summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2012-01-09 15:05:59 -0800
committerJean-Baptiste Queru <jbq@google.com>2012-01-09 15:05:59 -0800
commitd4dbdb67cac22f22ceb70055090b492b3010bd13 (patch)
tree62b5afc30427a0462c3aca90d26ed725a68a30ad
parent4c0f9817f605ad9f6da98b46aa1530f6af97de1b (diff)
downloadi686-linux-glibc2.7-4.4.3-d4dbdb67cac22f22ceb70055090b492b3010bd13.tar.gz
Relocate SDK toolchain
Change-Id: I4aa13a365108300e29cf3de3e5c463c3b13e10a8
-rw-r--r--PACKAGE_SOURCES32
-rw-r--r--TOOLCHAIN_SOURCES7
-rwxr-xr-xbin/i686-linux-addr2linebin0 -> 594536 bytes
-rwxr-xr-xbin/i686-linux-arbin0 -> 618956 bytes
-rwxr-xr-xbin/i686-linux-asbin0 -> 1045932 bytes
-rwxr-xr-xbin/i686-linux-c++bin0 -> 245100 bytes
-rwxr-xr-xbin/i686-linux-c++filtbin0 -> 594312 bytes
-rwxr-xr-xbin/i686-linux-cppbin0 -> 245100 bytes
-rwxr-xr-xbin/i686-linux-g++bin0 -> 245100 bytes
-rwxr-xr-xbin/i686-linux-gccbin0 -> 241004 bytes
-rwxr-xr-xbin/i686-linux-gcc-4.4.3bin0 -> 241004 bytes
-rwxr-xr-xbin/i686-linux-gccbug558
-rwxr-xr-xbin/i686-linux-gcovbin0 -> 104048 bytes
-rwxr-xr-xbin/i686-linux-gprofbin0 -> 660776 bytes
-rwxr-xr-xbin/i686-linux-ldbin0 -> 881708 bytes
-rwxr-xr-xbin/i686-linux-nmbin0 -> 607144 bytes
-rwxr-xr-xbin/i686-linux-objcopybin0 -> 747592 bytes
-rwxr-xr-xbin/i686-linux-objdumpbin0 -> 1071592 bytes
-rwxr-xr-xbin/i686-linux-ranlibbin0 -> 618988 bytes
-rwxr-xr-xbin/i686-linux-readelfbin0 -> 261820 bytes
-rwxr-xr-xbin/i686-linux-sizebin0 -> 598632 bytes
-rwxr-xr-xbin/i686-linux-stringsbin0 -> 594504 bytes
-rwxr-xr-xbin/i686-linux-stripbin0 -> 747592 bytes
-rwxr-xr-xbuild-hardy-toolchain.sh1385
-rwxr-xr-xi686-linux/bin/arbin0 -> 618956 bytes
-rwxr-xr-xi686-linux/bin/asbin0 -> 1045932 bytes
-rwxr-xr-xi686-linux/bin/c++bin0 -> 277814 bytes
-rwxr-xr-xi686-linux/bin/g++bin0 -> 277814 bytes
-rwxr-xr-xi686-linux/bin/gccbin0 -> 273683 bytes
-rwxr-xr-xi686-linux/bin/ldbin0 -> 881708 bytes
-rwxr-xr-xi686-linux/bin/nmbin0 -> 607144 bytes
-rwxr-xr-xi686-linux/bin/objcopybin0 -> 747592 bytes
-rwxr-xr-xi686-linux/bin/objdumpbin0 -> 1071592 bytes
-rwxr-xr-xi686-linux/bin/ranlibbin0 -> 618988 bytes
-rwxr-xr-xi686-linux/bin/stripbin0 -> 747592 bytes
-rw-r--r--i686-linux/include/c++/4.4.3/algorithm68
-rw-r--r--i686-linux/include/c++/4.4.3/array60
-rw-r--r--i686-linux/include/c++/4.4.3/backward/auto_ptr.h292
-rw-r--r--i686-linux/include/c++/4.4.3/backward/backward_warning.h56
-rw-r--r--i686-linux/include/c++/4.4.3/backward/binders.h168
-rw-r--r--i686-linux/include/c++/4.4.3/backward/hash_fun.h167
-rw-r--r--i686-linux/include/c++/4.4.3/backward/hash_map593
-rw-r--r--i686-linux/include/c++/4.4.3/backward/hash_set561
-rw-r--r--i686-linux/include/c++/4.4.3/backward/hashtable.h1147
-rw-r--r--i686-linux/include/c++/4.4.3/backward/strstream176
-rw-r--r--i686-linux/include/c++/4.4.3/bits/algorithmfwd.h805
-rw-r--r--i686-linux/include/c++/4.4.3/bits/allocator.h181
-rw-r--r--i686-linux/include/c++/4.4.3/bits/atomic_0.h464
-rw-r--r--i686-linux/include/c++/4.4.3/bits/atomic_2.h454
-rw-r--r--i686-linux/include/c++/4.4.3/bits/atomicfwd_c.h174
-rw-r--r--i686-linux/include/c++/4.4.3/bits/atomicfwd_cxx.h109
-rw-r--r--i686-linux/include/c++/4.4.3/bits/basic_ios.h474
-rw-r--r--i686-linux/include/c++/4.4.3/bits/basic_ios.tcc187
-rw-r--r--i686-linux/include/c++/4.4.3/bits/basic_string.h2692
-rw-r--r--i686-linux/include/c++/4.4.3/bits/basic_string.tcc1144
-rw-r--r--i686-linux/include/c++/4.4.3/bits/boost_concept_check.h787
-rw-r--r--i686-linux/include/c++/4.4.3/bits/char_traits.h575
-rw-r--r--i686-linux/include/c++/4.4.3/bits/cmath.tcc55
-rw-r--r--i686-linux/include/c++/4.4.3/bits/codecvt.h497
-rw-r--r--i686-linux/include/c++/4.4.3/bits/concept_check.h80
-rw-r--r--i686-linux/include/c++/4.4.3/bits/cpp_type_traits.h419
-rw-r--r--i686-linux/include/c++/4.4.3/bits/deque.tcc863
-rw-r--r--i686-linux/include/c++/4.4.3/bits/forward_list.h1306
-rw-r--r--i686-linux/include/c++/4.4.3/bits/forward_list.tcc478
-rw-r--r--i686-linux/include/c++/4.4.3/bits/fstream.tcc926
-rw-r--r--i686-linux/include/c++/4.4.3/bits/functexcept.h93
-rw-r--r--i686-linux/include/c++/4.4.3/bits/functional_hash.h68
-rw-r--r--i686-linux/include/c++/4.4.3/bits/gslice.h182
-rw-r--r--i686-linux/include/c++/4.4.3/bits/gslice_array.h216
-rw-r--r--i686-linux/include/c++/4.4.3/bits/hashtable.h58
-rw-r--r--i686-linux/include/c++/4.4.3/bits/indirect_array.h210
-rw-r--r--i686-linux/include/c++/4.4.3/bits/ios_base.h982
-rw-r--r--i686-linux/include/c++/4.4.3/bits/istream.tcc1022
-rw-r--r--i686-linux/include/c++/4.4.3/bits/list.tcc416
-rw-r--r--i686-linux/include/c++/4.4.3/bits/locale_classes.h812
-rw-r--r--i686-linux/include/c++/4.4.3/bits/locale_classes.tcc271
-rw-r--r--i686-linux/include/c++/4.4.3/bits/locale_facets.h2602
-rw-r--r--i686-linux/include/c++/4.4.3/bits/locale_facets.tcc1345
-rw-r--r--i686-linux/include/c++/4.4.3/bits/locale_facets_nonio.h1914
-rw-r--r--i686-linux/include/c++/4.4.3/bits/locale_facets_nonio.tcc1330
-rw-r--r--i686-linux/include/c++/4.4.3/bits/localefwd.h183
-rw-r--r--i686-linux/include/c++/4.4.3/bits/mask_array.h206
-rw-r--r--i686-linux/include/c++/4.4.3/bits/move.h98
-rw-r--r--i686-linux/include/c++/4.4.3/bits/ostream.tcc407
-rw-r--r--i686-linux/include/c++/4.4.3/bits/ostream_insert.h127
-rw-r--r--i686-linux/include/c++/4.4.3/bits/postypes.h241
-rw-r--r--i686-linux/include/c++/4.4.3/bits/shared_ptr.h1591
-rw-r--r--i686-linux/include/c++/4.4.3/bits/slice_array.h272
-rw-r--r--i686-linux/include/c++/4.4.3/bits/sstream.tcc273
-rw-r--r--i686-linux/include/c++/4.4.3/bits/stl_algo.h6138
-rw-r--r--i686-linux/include/c++/4.4.3/bits/stl_algobase.h1153
-rw-r--r--i686-linux/include/c++/4.4.3/bits/stl_bvector.h1024
-rw-r--r--i686-linux/include/c++/4.4.3/bits/stl_construct.h148
-rw-r--r--i686-linux/include/c++/4.4.3/bits/stl_deque.h1819
-rw-r--r--i686-linux/include/c++/4.4.3/bits/stl_function.h715
-rw-r--r--i686-linux/include/c++/4.4.3/bits/stl_heap.h578
-rw-r--r--i686-linux/include/c++/4.4.3/bits/stl_iterator.h1041
-rw-r--r--i686-linux/include/c++/4.4.3/bits/stl_iterator_base_funcs.h197
-rw-r--r--i686-linux/include/c++/4.4.3/bits/stl_iterator_base_types.h168
-rw-r--r--i686-linux/include/c++/4.4.3/bits/stl_list.h1533
-rw-r--r--i686-linux/include/c++/4.4.3/bits/stl_map.h871
-rw-r--r--i686-linux/include/c++/4.4.3/bits/stl_multimap.h800
-rw-r--r--i686-linux/include/c++/4.4.3/bits/stl_multiset.h697
-rw-r--r--i686-linux/include/c++/4.4.3/bits/stl_numeric.h373
-rw-r--r--i686-linux/include/c++/4.4.3/bits/stl_pair.h261
-rw-r--r--i686-linux/include/c++/4.4.3/bits/stl_queue.h586
-rw-r--r--i686-linux/include/c++/4.4.3/bits/stl_raw_storage_iter.h106
-rw-r--r--i686-linux/include/c++/4.4.3/bits/stl_relops.h131
-rw-r--r--i686-linux/include/c++/4.4.3/bits/stl_set.h708
-rw-r--r--i686-linux/include/c++/4.4.3/bits/stl_stack.h299
-rw-r--r--i686-linux/include/c++/4.4.3/bits/stl_tempbuf.h206
-rw-r--r--i686-linux/include/c++/4.4.3/bits/stl_tree.h1535
-rw-r--r--i686-linux/include/c++/4.4.3/bits/stl_uninitialized.h478
-rw-r--r--i686-linux/include/c++/4.4.3/bits/stl_vector.h1249
-rw-r--r--i686-linux/include/c++/4.4.3/bits/stream_iterator.h211
-rw-r--r--i686-linux/include/c++/4.4.3/bits/streambuf.tcc174
-rw-r--r--i686-linux/include/c++/4.4.3/bits/streambuf_iterator.h392
-rw-r--r--i686-linux/include/c++/4.4.3/bits/stringfwd.h77
-rw-r--r--i686-linux/include/c++/4.4.3/bits/unique_ptr.h450
-rw-r--r--i686-linux/include/c++/4.4.3/bits/valarray_after.h549
-rw-r--r--i686-linux/include/c++/4.4.3/bits/valarray_array.h699
-rw-r--r--i686-linux/include/c++/4.4.3/bits/valarray_array.tcc241
-rw-r--r--i686-linux/include/c++/4.4.3/bits/valarray_before.h730
-rw-r--r--i686-linux/include/c++/4.4.3/bits/vector.tcc681
-rw-r--r--i686-linux/include/c++/4.4.3/bitset1396
-rw-r--r--i686-linux/include/c++/4.4.3/c++0x_warning.h36
-rw-r--r--i686-linux/include/c++/4.4.3/cassert45
-rw-r--r--i686-linux/include/c++/4.4.3/ccomplex44
-rw-r--r--i686-linux/include/c++/4.4.3/cctype101
-rw-r--r--i686-linux/include/c++/4.4.3/cerrno53
-rw-r--r--i686-linux/include/c++/4.4.3/cfenv61
-rw-r--r--i686-linux/include/c++/4.4.3/cfloat60
-rw-r--r--i686-linux/include/c++/4.4.3/chrono672
-rw-r--r--i686-linux/include/c++/4.4.3/cinttypes71
-rw-r--r--i686-linux/include/c++/4.4.3/ciso64633
-rw-r--r--i686-linux/include/c++/4.4.3/climits60
-rw-r--r--i686-linux/include/c++/4.4.3/clocale61
-rw-r--r--i686-linux/include/c++/4.4.3/cmath631
-rw-r--r--i686-linux/include/c++/4.4.3/complex1587
-rw-r--r--i686-linux/include/c++/4.4.3/complex.h42
-rw-r--r--i686-linux/include/c++/4.4.3/condition_variable225
-rw-r--r--i686-linux/include/c++/4.4.3/csetjmp64
-rw-r--r--i686-linux/include/c++/4.4.3/csignal60
-rw-r--r--i686-linux/include/c++/4.4.3/cstdarg60
-rw-r--r--i686-linux/include/c++/4.4.3/cstdatomic848
-rw-r--r--i686-linux/include/c++/4.4.3/cstdbool44
-rw-r--r--i686-linux/include/c++/4.4.3/cstddef56
-rw-r--r--i686-linux/include/c++/4.4.3/cstdint79
-rw-r--r--i686-linux/include/c++/4.4.3/cstdio205
-rw-r--r--i686-linux/include/c++/4.4.3/cstdlib242
-rw-r--r--i686-linux/include/c++/4.4.3/cstring123
-rw-r--r--i686-linux/include/c++/4.4.3/ctgmath41
-rw-r--r--i686-linux/include/c++/4.4.3/ctime78
-rw-r--r--i686-linux/include/c++/4.4.3/cwchar291
-rw-r--r--i686-linux/include/c++/4.4.3/cwctype126
-rw-r--r--i686-linux/include/c++/4.4.3/cxxabi-forced.h51
-rw-r--r--i686-linux/include/c++/4.4.3/cxxabi.h608
-rw-r--r--i686-linux/include/c++/4.4.3/debug/bitset369
-rw-r--r--i686-linux/include/c++/4.4.3/debug/debug.h130
-rw-r--r--i686-linux/include/c++/4.4.3/debug/deque515
-rw-r--r--i686-linux/include/c++/4.4.3/debug/formatter.h392
-rw-r--r--i686-linux/include/c++/4.4.3/debug/functions.h383
-rw-r--r--i686-linux/include/c++/4.4.3/debug/list653
-rw-r--r--i686-linux/include/c++/4.4.3/debug/macros.h246
-rw-r--r--i686-linux/include/c++/4.4.3/debug/map37
-rw-r--r--i686-linux/include/c++/4.4.3/debug/map.h412
-rw-r--r--i686-linux/include/c++/4.4.3/debug/multimap.h400
-rw-r--r--i686-linux/include/c++/4.4.3/debug/multiset.h396
-rw-r--r--i686-linux/include/c++/4.4.3/debug/safe_base.h220
-rw-r--r--i686-linux/include/c++/4.4.3/debug/safe_iterator.h643
-rw-r--r--i686-linux/include/c++/4.4.3/debug/safe_iterator.tcc143
-rw-r--r--i686-linux/include/c++/4.4.3/debug/safe_sequence.h183
-rw-r--r--i686-linux/include/c++/4.4.3/debug/set37
-rw-r--r--i686-linux/include/c++/4.4.3/debug/set.h401
-rw-r--r--i686-linux/include/c++/4.4.3/debug/string1074
-rw-r--r--i686-linux/include/c++/4.4.3/debug/unordered_map608
-rw-r--r--i686-linux/include/c++/4.4.3/debug/unordered_set601
-rw-r--r--i686-linux/include/c++/4.4.3/debug/vector551
-rw-r--r--i686-linux/include/c++/4.4.3/deque75
-rw-r--r--i686-linux/include/c++/4.4.3/exception151
-rw-r--r--i686-linux/include/c++/4.4.3/exception_defines.h49
-rw-r--r--i686-linux/include/c++/4.4.3/exception_ptr.h171
-rw-r--r--i686-linux/include/c++/4.4.3/ext/algorithm524
-rw-r--r--i686-linux/include/c++/4.4.3/ext/array_allocator.h154
-rw-r--r--i686-linux/include/c++/4.4.3/ext/atomicity.h113
-rw-r--r--i686-linux/include/c++/4.4.3/ext/bitmap_allocator.h1145
-rw-r--r--i686-linux/include/c++/4.4.3/ext/cast.h113
-rw-r--r--i686-linux/include/c++/4.4.3/ext/codecvt_specializations.h507
-rw-r--r--i686-linux/include/c++/4.4.3/ext/concurrence.h322
-rw-r--r--i686-linux/include/c++/4.4.3/ext/debug_allocator.h124
-rw-r--r--i686-linux/include/c++/4.4.3/ext/enc_filebuf.h62
-rw-r--r--i686-linux/include/c++/4.4.3/ext/extptr_allocator.h176
-rw-r--r--i686-linux/include/c++/4.4.3/ext/functional425
-rw-r--r--i686-linux/include/c++/4.4.3/ext/hash_map593
-rw-r--r--i686-linux/include/c++/4.4.3/ext/hash_set561
-rw-r--r--i686-linux/include/c++/4.4.3/ext/iterator113
-rw-r--r--i686-linux/include/c++/4.4.3/ext/malloc_allocator.h134
-rw-r--r--i686-linux/include/c++/4.4.3/ext/memory195
-rw-r--r--i686-linux/include/c++/4.4.3/ext/mt_allocator.h751
-rw-r--r--i686-linux/include/c++/4.4.3/ext/new_allocator.h130
-rw-r--r--i686-linux/include/c++/4.4.3/ext/numeric146
-rw-r--r--i686-linux/include/c++/4.4.3/ext/numeric_traits.h135
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/assoc_container.hpp683
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/basic_tree_policy/basic_tree_policy_base.hpp173
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/basic_tree_policy/null_node_metadata.hpp67
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/basic_tree_policy/traits.hpp85
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/basic_types.hpp211
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/bin_search_tree_.hpp497
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/cond_dtor_entry_dealtor.hpp70
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/cond_key_dtor_entry_dealtor.hpp81
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/constructors_destructor_fn_imps.hpp218
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/debug_fn_imps.hpp272
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/erase_fn_imps.hpp120
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/find_fn_imps.hpp182
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/info_fn_imps.hpp64
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/insert_fn_imps.hpp211
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/iterators_fn_imps.hpp136
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/node_iterators.hpp237
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/point_iterators.hpp381
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/policy_access_fn_imps.hpp56
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/r_erase_fn_imps.hpp120
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/rotate_fn_imps.hpp156
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/split_join_fn_imps.hpp146
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/traits.hpp250
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp357
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/const_iterator.hpp152
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/const_point_iterator.hpp144
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/constructors_destructor_fn_imps.hpp159
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/debug_fn_imps.hpp72
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/entry_cmp.hpp93
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/entry_pred.hpp93
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/erase_fn_imps.hpp246
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/find_fn_imps.hpp91
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/info_fn_imps.hpp64
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/insert_fn_imps.hpp183
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/iterators_fn_imps.hpp72
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/policy_access_fn_imps.hpp56
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/resize_policy.hpp253
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/split_join_fn_imps.hpp172
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/trace_fn_imps.hpp78
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_/binomial_heap_.hpp116
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_/constructors_destructor_fn_imps.hpp61
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_/debug_fn_imps.hpp49
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_base_/binomial_heap_base_.hpp234
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_base_/constructors_destructor_fn_imps.hpp97
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_base_/debug_fn_imps.hpp98
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_base_/erase_fn_imps.hpp192
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_base_/find_fn_imps.hpp73
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_base_/insert_fn_imps.hpp216
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_base_/split_join_fn_imps.hpp232
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp636
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/cmp_fn_imps.hpp83
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/cond_key_dtor_entry_dealtor.hpp117
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_fn_imps.hpp191
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_no_store_hash_fn_imps.hpp55
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_store_hash_fn_imps.hpp56
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/debug_fn_imps.hpp74
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/debug_no_store_hash_fn_imps.hpp49
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/debug_store_hash_fn_imps.hpp53
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/entry_list_fn_imps.hpp91
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/erase_fn_imps.hpp103
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/erase_no_store_hash_fn_imps.hpp101
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/erase_store_hash_fn_imps.hpp95
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/find_fn_imps.hpp71
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/find_store_hash_fn_imps.hpp41
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/info_fn_imps.hpp100
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/insert_fn_imps.hpp43
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/insert_no_store_hash_fn_imps.hpp70
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/insert_store_hash_fn_imps.hpp71
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/iterators_fn_imps.hpp83
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/policy_access_fn_imps.hpp88
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/resize_fn_imps.hpp133
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/resize_no_store_hash_fn_imps.hpp54
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/resize_store_hash_fn_imps.hpp54
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/size_fn_imps.hpp59
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/standard_policies.hpp46
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/trace_fn_imps.hpp72
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cond_dealtor.hpp125
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/constructors_destructor_fn_imps.hpp103
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/container_base_dispatch.hpp332
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/debug_map_base.hpp360
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/eq_fn/eq_by_less.hpp68
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/eq_fn/hash_eq_fn.hpp179
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_fn_imps.hpp223
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_no_store_hash_fn_imps.hpp53
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_store_hash_fn_imps.hpp54
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/debug_fn_imps.hpp55
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/debug_no_store_hash_fn_imps.hpp71
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/debug_store_hash_fn_imps.hpp77
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/erase_fn_imps.hpp100
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/erase_no_store_hash_fn_imps.hpp85
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/erase_store_hash_fn_imps.hpp86
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/find_fn_imps.hpp70
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/find_no_store_hash_fn_imps.hpp46
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/find_store_hash_fn_imps.hpp40
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp677
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/info_fn_imps.hpp58
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/insert_fn_imps.hpp43
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/insert_no_store_hash_fn_imps.hpp111
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/insert_store_hash_fn_imps.hpp118
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/iterator_fn_imps.hpp83
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/policy_access_fn_imps.hpp100
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/resize_fn_imps.hpp137
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/resize_no_store_hash_fn_imps.hpp72
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/resize_store_hash_fn_imps.hpp74
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/standard_policies.hpp74
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/trace_fn_imps.hpp74
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/direct_mask_range_hashing_imp.hpp58
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/direct_mod_range_hashing_imp.hpp58
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/linear_probe_fn_imp.hpp53
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/mask_based_range_hashing.hpp107
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/mod_based_range_hashing.hpp108
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/probe_fn_base.hpp59
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/quadratic_probe_fn_imp.hpp53
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/ranged_hash_fn.hpp359
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/ranged_probe_fn.hpp327
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/sample_probe_fn.hpp73
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/sample_range_hashing.hpp77
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/sample_ranged_hash_fn.hpp77
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/sample_ranged_probe_fn.hpp77
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/const_iterator.hpp162
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/const_point_iterator.hpp154
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/constructors_destructor_fn_imps.hpp152
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/debug_fn_imps.hpp141
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/erase_fn_imps.hpp150
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/info_fn_imps.hpp64
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/insert_fn_imps.hpp175
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/iterators_fn_imps.hpp88
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp349
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/node.hpp123
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/null_metadata.hpp55
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/policy_access_fn_imps.hpp52
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/trace_fn_imps.hpp95
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/constructor_destructor_fn_imps.hpp141
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/debug_fn_imps.hpp57
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/entry_metadata_base.hpp60
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/erase_fn_imps.hpp135
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/find_fn_imps.hpp90
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/info_fn_imps.hpp57
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/insert_fn_imps.hpp106
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/iterators_fn_imps.hpp80
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/lu_map_.hpp359
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/trace_fn_imps.hpp59
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_policy/counter_lu_metadata.hpp86
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_policy/counter_lu_policy_imp.hpp51
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_policy/mtf_lu_policy_imp.hpp55
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_policy/sample_update_policy.hpp74
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/cond_dtor.hpp74
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/constructors_destructor_fn_imps.hpp273
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/debug_fn_imps.hpp84
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/erase_fn_imps.hpp193
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/info_fn_imps.hpp60
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/insert_fn_imps.hpp63
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/iterators_fn_imps.hpp103
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/node_iterators.hpp292
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp522
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/policy_access_fn_imps.hpp51
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/split_join_fn_imps.hpp137
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/traits.hpp183
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pairing_heap_/constructors_destructor_fn_imps.hpp91
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pairing_heap_/debug_fn_imps.hpp53
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pairing_heap_/erase_fn_imps.hpp236
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pairing_heap_/find_fn_imps.hpp50
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pairing_heap_/insert_fn_imps.hpp101
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pairing_heap_/pairing_heap_.hpp216
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pairing_heap_/split_join_fn_imps.hpp140
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/child_iterator.hpp93
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/cond_dtor_entry_dealtor.hpp79
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/const_child_iterator.hpp111
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/constructors_destructor_fn_imps.hpp214
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/debug_fn_imps.hpp117
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/erase_fn_imps.hpp319
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/find_fn_imps.hpp269
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/head.hpp124
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/info_fn_imps.hpp58
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/insert_join_fn_imps.hpp465
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/internal_node.hpp599
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/iterators_fn_imps.hpp120
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/leaf.hpp171
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/node_base.hpp128
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/node_iterators.hpp338
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/node_metadata_base.hpp86
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp515
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/point_iterators.hpp484
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/policy_access_fn_imps.hpp63
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/r_erase_fn_imps.hpp103
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/rotate_fn_imps.hpp150
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/split_fn_imps.hpp254
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/split_join_branch_bag.hpp93
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/synth_e_access_traits.hpp229
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/trace_fn_imps.hpp113
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/traits.hpp350
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/update_fn_imps.hpp55
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/priority_queue_base_dispatch.hpp91
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/constructors_destructor_fn_imps.hpp100
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/debug_fn_imps.hpp78
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/erase_fn_imps.hpp289
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/find_fn_imps.hpp39
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/info_fn_imps.hpp46
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/insert_fn_imps.hpp115
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/node.hpp138
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/rb_tree_.hpp280
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/split_join_fn_imps.hpp313
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/traits.hpp124
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rc_binomial_heap_/constructors_destructor_fn_imps.hpp88
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rc_binomial_heap_/debug_fn_imps.hpp121
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rc_binomial_heap_/erase_fn_imps.hpp107
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rc_binomial_heap_/insert_fn_imps.hpp154
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rc_binomial_heap_/rc.hpp262
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rc_binomial_heap_/rc_binomial_heap_.hpp198
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rc_binomial_heap_/split_join_fn_imps.hpp81
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rc_binomial_heap_/trace_fn_imps.hpp53
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/resize_policy/cc_hash_max_collision_check_resize_trigger_imp.hpp211
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/resize_policy/hash_exponential_size_policy_imp.hpp90
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_imp.hpp289
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_size_base.hpp94
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp161
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/resize_policy/hash_standard_resize_policy_imp.hpp249
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/resize_policy/sample_resize_policy.hpp125
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/resize_policy/sample_resize_trigger.hpp137
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/resize_policy/sample_size_policy.hpp73
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/constructors_destructor_fn_imps.hpp102
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/debug_fn_imps.hpp74
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/erase_fn_imps.hpp157
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/find_fn_imps.hpp99
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/info_fn_imps.hpp39
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/insert_fn_imps.hpp93
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/node.hpp125
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/splay_fn_imps.hpp283
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/splay_tree_.hpp298
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/split_join_fn_imps.hpp112
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/traits.hpp113
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/standard_policies.hpp136
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/thin_heap_/constructors_destructor_fn_imps.hpp106
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/thin_heap_/debug_fn_imps.hpp112
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/thin_heap_/erase_fn_imps.hpp296
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/thin_heap_/find_fn_imps.hpp51
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/thin_heap_/insert_fn_imps.hpp326
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/thin_heap_/split_join_fn_imps.hpp126
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/thin_heap_/thin_heap_.hpp351
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/thin_heap_/trace_fn_imps.hpp55
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/tree_policy/node_metadata_selector.hpp116
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/tree_policy/null_node_update_imp.hpp50
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/tree_policy/order_statistics_imp.hpp141
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/tree_policy/sample_tree_node_update.hpp72
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/tree_trace_base.hpp209
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/trie_policy/node_metadata_selector.hpp116
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/trie_policy/null_node_update_imp.hpp50
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/trie_policy/order_statistics_imp.hpp183
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/trie_policy/prefix_search_node_update_imp.hpp151
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/trie_policy/sample_trie_e_access_traits.hpp89
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/trie_policy/sample_trie_node_update.hpp72
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/trie_policy/string_trie_e_access_traits_imp.hpp99
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/trie_policy/trie_policy_base.hpp249
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/type_utils.hpp167
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/types_traits.hpp82
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/unordered_iterator/const_iterator.hpp129
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/unordered_iterator/const_point_iterator.hpp151
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/unordered_iterator/iterator.hpp150
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/detail/unordered_iterator/point_iterator.hpp143
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/exception.hpp103
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/hash_policy.hpp604
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/list_update_policy.hpp136
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/priority_queue.hpp125
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/tag_and_trait.hpp363
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/tree_policy.hpp162
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pb_ds/trie_policy.hpp355
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pod_char_traits.h182
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pointer.h551
-rw-r--r--i686-linux/include/c++/4.4.3/ext/pool_allocator.h263
-rw-r--r--i686-linux/include/c++/4.4.3/ext/rb_tree93
-rw-r--r--i686-linux/include/c++/4.4.3/ext/rc_string_base.h718
-rw-r--r--i686-linux/include/c++/4.4.3/ext/rope2958
-rw-r--r--i686-linux/include/c++/4.4.3/ext/ropeimpl.h1701
-rw-r--r--i686-linux/include/c++/4.4.3/ext/slist1077
-rw-r--r--i686-linux/include/c++/4.4.3/ext/sso_string_base.h592
-rw-r--r--i686-linux/include/c++/4.4.3/ext/stdio_filebuf.h157
-rw-r--r--i686-linux/include/c++/4.4.3/ext/stdio_sync_filebuf.h279
-rw-r--r--i686-linux/include/c++/4.4.3/ext/string_conversions.h94
-rw-r--r--i686-linux/include/c++/4.4.3/ext/throw_allocator.h448
-rw-r--r--i686-linux/include/c++/4.4.3/ext/type_traits.h204
-rw-r--r--i686-linux/include/c++/4.4.3/ext/typelist.h544
-rw-r--r--i686-linux/include/c++/4.4.3/ext/vstring.h2598
-rw-r--r--i686-linux/include/c++/4.4.3/ext/vstring.tcc696
-rw-r--r--i686-linux/include/c++/4.4.3/ext/vstring_fwd.h87
-rw-r--r--i686-linux/include/c++/4.4.3/ext/vstring_util.h180
-rw-r--r--i686-linux/include/c++/4.4.3/fenv.h58
-rw-r--r--i686-linux/include/c++/4.4.3/forward_list46
-rw-r--r--i686-linux/include/c++/4.4.3/fstream918
-rw-r--r--i686-linux/include/c++/4.4.3/functional78
-rw-r--r--i686-linux/include/c++/4.4.3/i686-linux/bits/atomic_word.h47
-rw-r--r--i686-linux/include/c++/4.4.3/i686-linux/bits/basic_file.h108
-rw-r--r--i686-linux/include/c++/4.4.3/i686-linux/bits/c++allocator.h37
-rw-r--r--i686-linux/include/c++/4.4.3/i686-linux/bits/c++config.h1431
-rw-r--r--i686-linux/include/c++/4.4.3/i686-linux/bits/c++io.h49
-rw-r--r--i686-linux/include/c++/4.4.3/i686-linux/bits/c++locale.h91
-rw-r--r--i686-linux/include/c++/4.4.3/i686-linux/bits/cpu_defines.h33
-rw-r--r--i686-linux/include/c++/4.4.3/i686-linux/bits/ctype_base.h61
-rw-r--r--i686-linux/include/c++/4.4.3/i686-linux/bits/ctype_inline.h73
-rw-r--r--i686-linux/include/c++/4.4.3/i686-linux/bits/ctype_noninline.h190
-rw-r--r--i686-linux/include/c++/4.4.3/i686-linux/bits/cxxabi_tweaks.h58
-rw-r--r--i686-linux/include/c++/4.4.3/i686-linux/bits/error_constants.h175
-rw-r--r--i686-linux/include/c++/4.4.3/i686-linux/bits/extc++.h69
-rw-r--r--i686-linux/include/c++/4.4.3/i686-linux/bits/gthr-default.h905
-rw-r--r--i686-linux/include/c++/4.4.3/i686-linux/bits/gthr-posix.h905
-rw-r--r--i686-linux/include/c++/4.4.3/i686-linux/bits/gthr-single.h292
-rw-r--r--i686-linux/include/c++/4.4.3/i686-linux/bits/gthr-tpf.h229
-rw-r--r--i686-linux/include/c++/4.4.3/i686-linux/bits/gthr.h173
-rw-r--r--i686-linux/include/c++/4.4.3/i686-linux/bits/messages_members.h90
-rw-r--r--i686-linux/include/c++/4.4.3/i686-linux/bits/os_defines.h41
-rw-r--r--i686-linux/include/c++/4.4.3/i686-linux/bits/stdc++.h111
-rw-r--r--i686-linux/include/c++/4.4.3/i686-linux/bits/stdtr1c++.h53
-rw-r--r--i686-linux/include/c++/4.4.3/i686-linux/bits/time_members.h90
-rw-r--r--i686-linux/include/c++/4.4.3/initializer_list72
-rw-r--r--i686-linux/include/c++/4.4.3/iomanip296
-rw-r--r--i686-linux/include/c++/4.4.3/ios47
-rw-r--r--i686-linux/include/c++/4.4.3/iosfwd160
-rw-r--r--i686-linux/include/c++/4.4.3/iostream76
-rw-r--r--i686-linux/include/c++/4.4.3/istream833
-rw-r--r--i686-linux/include/c++/4.4.3/iterator70
-rw-r--r--i686-linux/include/c++/4.4.3/limits1256
-rw-r--r--i686-linux/include/c++/4.4.3/list74
-rw-r--r--i686-linux/include/c++/4.4.3/locale45
-rw-r--r--i686-linux/include/c++/4.4.3/map68
-rw-r--r--i686-linux/include/c++/4.4.3/memory100
-rw-r--r--i686-linux/include/c++/4.4.3/mutex774
-rw-r--r--i686-linux/include/c++/4.4.3/new112
-rw-r--r--i686-linux/include/c++/4.4.3/numeric78
-rw-r--r--i686-linux/include/c++/4.4.3/ostream568
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/algo.h2364
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/algobase.h281
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/algorithm40
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/algorithmfwd.h898
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/balanced_quicksort.h477
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/base.h471
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/basic_iterator.h42
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/checkers.h154
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/compatibility.h350
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/compiletime_settings.h75
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/equally_split.h87
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/features.h104
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/find.h401
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/find_selectors.h192
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/for_each.h97
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/for_each_selectors.h360
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/iterator.h200
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/list_partition.h176
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/losertree.h1021
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/merge.h261
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/multiseq_selection.h619
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/multiway_merge.h2140
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/multiway_mergesort.h475
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/numeric500
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/numericfwd.h203
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/omp_loop.h118
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/omp_loop_static.h117
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/par_loop.h135
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/parallel.h42
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/partial_sum.h220
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/partition.h430
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/queue.h149
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/quicksort.h179
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/random_number.h124
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/random_shuffle.h519
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/search.h172
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/set_operations.h524
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/settings.h281
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/sort.h229
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/tags.h191
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/types.h155
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/unique_copy.h192
-rw-r--r--i686-linux/include/c++/4.4.3/parallel/workstealing.h306
-rw-r--r--i686-linux/include/c++/4.4.3/queue67
-rw-r--r--i686-linux/include/c++/4.4.3/random70
-rw-r--r--i686-linux/include/c++/4.4.3/ratio303
-rw-r--r--i686-linux/include/c++/4.4.3/regex68
-rw-r--r--i686-linux/include/c++/4.4.3/set68
-rw-r--r--i686-linux/include/c++/4.4.3/sstream576
-rw-r--r--i686-linux/include/c++/4.4.3/stack64
-rw-r--r--i686-linux/include/c++/4.4.3/stdatomic.h221
-rw-r--r--i686-linux/include/c++/4.4.3/stdexcept150
-rw-r--r--i686-linux/include/c++/4.4.3/streambuf799
-rw-r--r--i686-linux/include/c++/4.4.3/string59
-rw-r--r--i686-linux/include/c++/4.4.3/system_error353
-rw-r--r--i686-linux/include/c++/4.4.3/tgmath.h42
-rw-r--r--i686-linux/include/c++/4.4.3/thread284
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/array54
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/bessel_function.tcc627
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/beta_function.tcc197
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/ccomplex34
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/cctype49
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/cfenv53
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/cfloat42
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/cinttypes63
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/climits46
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/cmath507
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/complex91
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/complex.h34
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/cstdarg34
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/cstdbool40
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/cstdint76
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/cstdio54
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/cstdlib54
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/ctgmath34
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/ctime34
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/ctype.h34
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/cwchar54
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/cwctype54
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/ell_integral.tcc750
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/exp_integral.tcc524
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/fenv.h34
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/float.h34
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/functional63
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/functional_hash.h53
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/gamma.tcc471
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/hashtable.h53
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/hypergeometric.tcc774
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/inttypes.h34
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/legendre_function.tcc305
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/limits.h34
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/math.h186
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/memory67
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/modified_bessel_func.tcc436
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/poly_hermite.tcc124
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/poly_laguerre.tcc329
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/random66
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/regex64
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/riemann_zeta.tcc435
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/shared_ptr.h1020
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/special_function_util.h144
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/stdarg.h34
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/stdbool.h34
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/stdint.h34
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/stdio.h34
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/stdlib.h52
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/tgmath.h34
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/tuple422
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/type_traits249
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/unordered_map61
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/unordered_set61
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/utility56
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/wchar.h34
-rw-r--r--i686-linux/include/c++/4.4.3/tr1/wctype.h34
-rw-r--r--i686-linux/include/c++/4.4.3/tr1_impl/array287
-rw-r--r--i686-linux/include/c++/4.4.3/tr1_impl/boost_sp_counted_base.h239
-rw-r--r--i686-linux/include/c++/4.4.3/tr1_impl/cctype43
-rw-r--r--i686-linux/include/c++/4.4.3/tr1_impl/cfenv70
-rw-r--r--i686-linux/include/c++/4.4.3/tr1_impl/cinttypes64
-rw-r--r--i686-linux/include/c++/4.4.3/tr1_impl/cmath902
-rw-r--r--i686-linux/include/c++/4.4.3/tr1_impl/complex370
-rw-r--r--i686-linux/include/c++/4.4.3/tr1_impl/cstdint75
-rw-r--r--i686-linux/include/c++/4.4.3/tr1_impl/cstdio44
-rw-r--r--i686-linux/include/c++/4.4.3/tr1_impl/cstdlib65
-rw-r--r--i686-linux/include/c++/4.4.3/tr1_impl/cwchar58
-rw-r--r--i686-linux/include/c++/4.4.3/tr1_impl/cwctype43
-rw-r--r--i686-linux/include/c++/4.4.3/tr1_impl/functional2130
-rw-r--r--i686-linux/include/c++/4.4.3/tr1_impl/functional_hash.h183
-rw-r--r--i686-linux/include/c++/4.4.3/tr1_impl/hashtable1266
-rw-r--r--i686-linux/include/c++/4.4.3/tr1_impl/hashtable_policy.h865
-rw-r--r--i686-linux/include/c++/4.4.3/tr1_impl/random2407
-rw-r--r--i686-linux/include/c++/4.4.3/tr1_impl/random.tcc1577
-rw-r--r--i686-linux/include/c++/4.4.3/tr1_impl/regex2708
-rw-r--r--i686-linux/include/c++/4.4.3/tr1_impl/type_traits501
-rw-r--r--i686-linux/include/c++/4.4.3/tr1_impl/unordered_map370
-rw-r--r--i686-linux/include/c++/4.4.3/tr1_impl/unordered_set360
-rw-r--r--i686-linux/include/c++/4.4.3/tr1_impl/utility120
-rw-r--r--i686-linux/include/c++/4.4.3/tuple697
-rw-r--r--i686-linux/include/c++/4.4.3/type_traits605
-rw-r--r--i686-linux/include/c++/4.4.3/typeinfo196
-rw-r--r--i686-linux/include/c++/4.4.3/unordered_map78
-rw-r--r--i686-linux/include/c++/4.4.3/unordered_set78
-rw-r--r--i686-linux/include/c++/4.4.3/utility94
-rw-r--r--i686-linux/include/c++/4.4.3/valarray1087
-rw-r--r--i686-linux/include/c++/4.4.3/vector77
-rw-r--r--i686-linux/lib/ldscripts/elf_i386.x195
-rw-r--r--i686-linux/lib/ldscripts/elf_i386.xbn193
-rw-r--r--i686-linux/lib/ldscripts/elf_i386.xc200
-rw-r--r--i686-linux/lib/ldscripts/elf_i386.xd195
-rw-r--r--i686-linux/lib/ldscripts/elf_i386.xdc200
-rw-r--r--i686-linux/lib/ldscripts/elf_i386.xdw199
-rw-r--r--i686-linux/lib/ldscripts/elf_i386.xn195
-rw-r--r--i686-linux/lib/ldscripts/elf_i386.xr146
-rw-r--r--i686-linux/lib/ldscripts/elf_i386.xs188
-rw-r--r--i686-linux/lib/ldscripts/elf_i386.xsc193
-rw-r--r--i686-linux/lib/ldscripts/elf_i386.xsw192
-rw-r--r--i686-linux/lib/ldscripts/elf_i386.xu147
-rw-r--r--i686-linux/lib/ldscripts/elf_i386.xw199
-rw-r--r--i686-linux/lib/ldscripts/i386linux.x46
-rw-r--r--i686-linux/lib/ldscripts/i386linux.xbn46
-rw-r--r--i686-linux/lib/ldscripts/i386linux.xn46
-rw-r--r--i686-linux/lib/ldscripts/i386linux.xr37
-rw-r--r--i686-linux/lib/ldscripts/i386linux.xu38
l---------i686-linux/lib/libgcc_s.so1
-rw-r--r--i686-linux/lib/libgcc_s.so.1bin0 -> 492492 bytes
-rw-r--r--i686-linux/lib/libgomp.abin0 -> 318030 bytes
-rwxr-xr-xi686-linux/lib/libgomp.la41
l---------i686-linux/lib/libgomp.so1
l---------i686-linux/lib/libgomp.so.11
-rwxr-xr-xi686-linux/lib/libgomp.so.1.0.0bin0 -> 212760 bytes
-rw-r--r--i686-linux/lib/libgomp.spec3
-rw-r--r--i686-linux/lib/libiberty.abin0 -> 537414 bytes
-rw-r--r--i686-linux/lib/libmudflap.abin0 -> 314094 bytes
-rwxr-xr-xi686-linux/lib/libmudflap.la41
l---------i686-linux/lib/libmudflap.so1
l---------i686-linux/lib/libmudflap.so.01
-rwxr-xr-xi686-linux/lib/libmudflap.so.0.0.0bin0 -> 228807 bytes
-rw-r--r--i686-linux/lib/libmudflapth.abin0 -> 262732 bytes
-rwxr-xr-xi686-linux/lib/libmudflapth.la41
l---------i686-linux/lib/libmudflapth.so1
l---------i686-linux/lib/libmudflapth.so.01
-rwxr-xr-xi686-linux/lib/libmudflapth.so.0.0.0bin0 -> 231373 bytes
-rw-r--r--i686-linux/lib/libssp.abin0 -> 41034 bytes
-rwxr-xr-xi686-linux/lib/libssp.la41
l---------i686-linux/lib/libssp.so1
l---------i686-linux/lib/libssp.so.01
-rwxr-xr-xi686-linux/lib/libssp.so.0.0.0bin0 -> 22592 bytes
-rw-r--r--i686-linux/lib/libssp_nonshared.abin0 -> 2700 bytes
-rwxr-xr-xi686-linux/lib/libssp_nonshared.la41
-rw-r--r--i686-linux/lib/libstdc++.abin0 -> 8269612 bytes
-rwxr-xr-xi686-linux/lib/libstdc++.la41
l---------i686-linux/lib/libstdc++.so1
l---------i686-linux/lib/libstdc++.so.61
-rwxr-xr-xi686-linux/lib/libstdc++.so.6.0.13bin0 -> 4541067 bytes
-rw-r--r--i686-linux/lib/libsupc++.abin0 -> 568028 bytes
-rwxr-xr-xi686-linux/lib/libsupc++.la41
-rw-r--r--include/gmp.h2183
-rw-r--r--include/mpf2mpfr.h172
-rw-r--r--include/mpfr.h839
-rw-r--r--lib/gcc/i686-linux/4.4.3/crtbegin.obin0 -> 1648 bytes
-rw-r--r--lib/gcc/i686-linux/4.4.3/crtbeginS.obin0 -> 2136 bytes
-rw-r--r--lib/gcc/i686-linux/4.4.3/crtbeginT.obin0 -> 2040 bytes
-rw-r--r--lib/gcc/i686-linux/4.4.3/crtend.obin0 -> 1284 bytes
-rw-r--r--lib/gcc/i686-linux/4.4.3/crtendS.obin0 -> 1540 bytes
-rw-r--r--lib/gcc/i686-linux/4.4.3/crtfastmath.obin0 -> 4276 bytes
-rw-r--r--lib/gcc/i686-linux/4.4.3/crtprec32.obin0 -> 2128 bytes
-rw-r--r--lib/gcc/i686-linux/4.4.3/crtprec64.obin0 -> 2136 bytes
-rw-r--r--lib/gcc/i686-linux/4.4.3/crtprec80.obin0 -> 2128 bytes
-rw-r--r--lib/gcc/i686-linux/4.4.3/include-fixed/README14
-rw-r--r--lib/gcc/i686-linux/4.4.3/include-fixed/X11/Xos.h305
-rw-r--r--lib/gcc/i686-linux/4.4.3/include-fixed/X11/Xos_r.h1169
-rw-r--r--lib/gcc/i686-linux/4.4.3/include-fixed/X11/Xosdefs.h175
-rw-r--r--lib/gcc/i686-linux/4.4.3/include-fixed/X11/Xw32defs.h90
-rw-r--r--lib/gcc/i686-linux/4.4.3/include-fixed/limits.h125
-rw-r--r--lib/gcc/i686-linux/4.4.3/include-fixed/linux/a.out.h277
-rw-r--r--lib/gcc/i686-linux/4.4.3/include-fixed/syslimits.h8
-rw-r--r--lib/gcc/i686-linux/4.4.3/include/ammintrin.h88
-rw-r--r--lib/gcc/i686-linux/4.4.3/include/avxintrin.h1426
-rw-r--r--lib/gcc/i686-linux/4.4.3/include/bmmintrin.h1261
-rw-r--r--lib/gcc/i686-linux/4.4.3/include/cpuid.h179
-rw-r--r--lib/gcc/i686-linux/4.4.3/include/cross-stdarg.h73
-rw-r--r--lib/gcc/i686-linux/4.4.3/include/emmintrin.h1513
-rw-r--r--lib/gcc/i686-linux/4.4.3/include/float.h238
-rw-r--r--lib/gcc/i686-linux/4.4.3/include/immintrin.h59
-rw-r--r--lib/gcc/i686-linux/4.4.3/include/iso646.h45
-rw-r--r--lib/gcc/i686-linux/4.4.3/include/lwpintrin.h100
-rw-r--r--lib/gcc/i686-linux/4.4.3/include/mf-runtime.h244
-rw-r--r--lib/gcc/i686-linux/4.4.3/include/mm3dnow.h215
-rw-r--r--lib/gcc/i686-linux/4.4.3/include/mm_malloc.h57
-rw-r--r--lib/gcc/i686-linux/4.4.3/include/mmintrin-common.h155
-rw-r--r--lib/gcc/i686-linux/4.4.3/include/mmintrin.h921
-rw-r--r--lib/gcc/i686-linux/4.4.3/include/nmmintrin.h37
-rw-r--r--lib/gcc/i686-linux/4.4.3/include/omp.h105
-rw-r--r--lib/gcc/i686-linux/4.4.3/include/pmmintrin.h128
-rw-r--r--lib/gcc/i686-linux/4.4.3/include/smmintrin.h724
-rw-r--r--lib/gcc/i686-linux/4.4.3/include/ssp/ssp.h65
-rw-r--r--lib/gcc/i686-linux/4.4.3/include/ssp/stdio.h100
-rw-r--r--lib/gcc/i686-linux/4.4.3/include/ssp/string.h167
-rw-r--r--lib/gcc/i686-linux/4.4.3/include/ssp/unistd.h84
-rw-r--r--lib/gcc/i686-linux/4.4.3/include/stdarg.h130
-rw-r--r--lib/gcc/i686-linux/4.4.3/include/stdbool.h50
-rw-r--r--lib/gcc/i686-linux/4.4.3/include/stddef.h416
-rw-r--r--lib/gcc/i686-linux/4.4.3/include/stdfix.h204
-rw-r--r--lib/gcc/i686-linux/4.4.3/include/tmmintrin.h244
-rw-r--r--lib/gcc/i686-linux/4.4.3/include/unwind.h276
-rw-r--r--lib/gcc/i686-linux/4.4.3/include/varargs.h7
-rw-r--r--lib/gcc/i686-linux/4.4.3/include/wmmintrin.h120
-rw-r--r--lib/gcc/i686-linux/4.4.3/include/x86intrin.h74
-rw-r--r--lib/gcc/i686-linux/4.4.3/include/xmmintrin.h1251
-rw-r--r--lib/gcc/i686-linux/4.4.3/install-tools/fixinc_list1
-rw-r--r--lib/gcc/i686-linux/4.4.3/install-tools/gsyslimits.h8
-rw-r--r--lib/gcc/i686-linux/4.4.3/install-tools/include/README14
-rw-r--r--lib/gcc/i686-linux/4.4.3/install-tools/include/limits.h125
-rw-r--r--lib/gcc/i686-linux/4.4.3/install-tools/macro_list3
-rw-r--r--lib/gcc/i686-linux/4.4.3/install-tools/mkheaders.conf5
-rw-r--r--lib/gcc/i686-linux/4.4.3/libgcc.abin0 -> 4704870 bytes
-rw-r--r--lib/gcc/i686-linux/4.4.3/libgcc_eh.abin0 -> 266710 bytes
-rw-r--r--lib/gcc/i686-linux/4.4.3/libgcov.abin0 -> 333858 bytes
-rw-r--r--lib/libgmp.abin0 -> 511820 bytes
-rwxr-xr-xlib/libgmp.la35
-rw-r--r--lib/libiberty.abin0 -> 247038 bytes
-rw-r--r--lib/libmpfr.abin0 -> 1821700 bytes
-rwxr-xr-xlib/libmpfr.la41
-rwxr-xr-xlibexec/gcc/i686-linux/4.4.3/cc1bin0 -> 11785855 bytes
-rwxr-xr-xlibexec/gcc/i686-linux/4.4.3/cc1plusbin0 -> 12626587 bytes
-rwxr-xr-xlibexec/gcc/i686-linux/4.4.3/collect2bin0 -> 137400 bytes
-rwxr-xr-xlibexec/gcc/i686-linux/4.4.3/install-tools/fixinc.sh498
-rwxr-xr-xlibexec/gcc/i686-linux/4.4.3/install-tools/fixinclbin0 -> 169769 bytes
-rwxr-xr-xlibexec/gcc/i686-linux/4.4.3/install-tools/mkheaders109
-rwxr-xr-xlibexec/gcc/i686-linux/4.4.3/install-tools/mkinstalldirs158
-rw-r--r--sysroot/usr/include/GL/gl.h2252
-rw-r--r--sysroot/usr/include/GL/gl_mangle.h1568
-rw-r--r--sysroot/usr/include/GL/glext.h7260
-rw-r--r--sysroot/usr/include/GL/glx.h500
-rw-r--r--sysroot/usr/include/GL/glx_mangle.h81
-rw-r--r--sysroot/usr/include/GL/glxext.h785
-rw-r--r--sysroot/usr/include/X11/DECkeysym.h67
-rw-r--r--sysroot/usr/include/X11/HPkeysym.h165
-rw-r--r--sysroot/usr/include/X11/ImUtil.h31
-rw-r--r--sysroot/usr/include/X11/Sunkeysym.h112
-rw-r--r--sysroot/usr/include/X11/X.h721
-rw-r--r--sysroot/usr/include/X11/XF86keysym.h205
-rw-r--r--sysroot/usr/include/X11/XKBlib.h1151
-rw-r--r--sysroot/usr/include/X11/XWDFile.h114
-rw-r--r--sysroot/usr/include/X11/Xalloca.h145
-rw-r--r--sysroot/usr/include/X11/Xarch.h126
-rw-r--r--sysroot/usr/include/X11/Xatom.h79
-rw-r--r--sysroot/usr/include/X11/Xcms.h805
-rw-r--r--sysroot/usr/include/X11/Xdefs.h110
-rw-r--r--sysroot/usr/include/X11/Xfuncproto.h123
-rw-r--r--sysroot/usr/include/X11/Xfuncs.h98
-rw-r--r--sysroot/usr/include/X11/Xlib.h4013
-rw-r--r--sysroot/usr/include/X11/XlibConf.h40
-rw-r--r--sysroot/usr/include/X11/Xlibint.h1329
-rw-r--r--sysroot/usr/include/X11/Xlocale.h61
-rw-r--r--sysroot/usr/include/X11/Xmd.h211
-rw-r--r--sysroot/usr/include/X11/Xos.h296
-rw-r--r--sysroot/usr/include/X11/Xos_r.h1160
-rw-r--r--sysroot/usr/include/X11/Xosdefs.h166
-rw-r--r--sysroot/usr/include/X11/Xpoll.h255
-rw-r--r--sysroot/usr/include/X11/Xproto.h2129
-rw-r--r--sysroot/usr/include/X11/Xprotostr.h78
-rw-r--r--sysroot/usr/include/X11/Xregion.h190
-rw-r--r--sysroot/usr/include/X11/Xresource.h360
-rw-r--r--sysroot/usr/include/X11/Xthreads.h316
-rw-r--r--sysroot/usr/include/X11/Xutil.h828
-rw-r--r--sysroot/usr/include/X11/Xw32defs.h81
-rw-r--r--sysroot/usr/include/X11/Xwindows.h80
-rw-r--r--sysroot/usr/include/X11/Xwinsock.h66
-rw-r--r--sysroot/usr/include/X11/ap_keysym.h51
-rw-r--r--sysroot/usr/include/X11/cursorfont.h107
-rw-r--r--sysroot/usr/include/X11/extensions/MITMisc.h66
-rw-r--r--sysroot/usr/include/X11/extensions/XEVI.h64
-rw-r--r--sysroot/usr/include/X11/extensions/XEVIstr.h98
-rw-r--r--sysroot/usr/include/X11/extensions/XI.h287
-rw-r--r--sysroot/usr/include/X11/extensions/XInput.h1200
-rw-r--r--sysroot/usr/include/X11/extensions/XIproto.h1617
-rw-r--r--sysroot/usr/include/X11/extensions/XKB.h788
-rw-r--r--sysroot/usr/include/X11/extensions/XKBgeom.h659
-rw-r--r--sysroot/usr/include/X11/extensions/XKBproto.h1282
-rw-r--r--sysroot/usr/include/X11/extensions/XKBsrv.h1187
-rw-r--r--sysroot/usr/include/X11/extensions/XKBstr.h614
-rw-r--r--sysroot/usr/include/X11/extensions/XLbx.h155
-rw-r--r--sysroot/usr/include/X11/extensions/XShm.h161
-rw-r--r--sysroot/usr/include/X11/extensions/XTest.h164
-rw-r--r--sysroot/usr/include/X11/extensions/Xag.h114
-rw-r--r--sysroot/usr/include/X11/extensions/Xagsrv.h76
-rw-r--r--sysroot/usr/include/X11/extensions/Xagstr.h182
-rw-r--r--sysroot/usr/include/X11/extensions/Xcup.h69
-rw-r--r--sysroot/usr/include/X11/extensions/Xcupstr.h109
-rw-r--r--sysroot/usr/include/X11/extensions/Xdbe.h136
-rw-r--r--sysroot/usr/include/X11/extensions/Xdbeproto.h277
-rw-r--r--sysroot/usr/include/X11/extensions/Xext.h57
-rw-r--r--sysroot/usr/include/X11/extensions/dpms.h67
-rw-r--r--sysroot/usr/include/X11/extensions/dpmsstr.h186
-rw-r--r--sysroot/usr/include/X11/extensions/extutil.h192
-rw-r--r--sysroot/usr/include/X11/extensions/lbxbuf.h51
-rw-r--r--sysroot/usr/include/X11/extensions/lbxbufstr.h45
-rw-r--r--sysroot/usr/include/X11/extensions/lbxdeltastr.h105
-rw-r--r--sysroot/usr/include/X11/extensions/lbximage.h151
-rw-r--r--sysroot/usr/include/X11/extensions/lbxopts.h133
-rw-r--r--sysroot/usr/include/X11/extensions/lbxstr.h935
-rw-r--r--sysroot/usr/include/X11/extensions/lbxzlib.h64
-rw-r--r--sysroot/usr/include/X11/extensions/mitmiscstr.h70
-rw-r--r--sysroot/usr/include/X11/extensions/multibuf.h317
-rw-r--r--sysroot/usr/include/X11/extensions/multibufst.h609
-rw-r--r--sysroot/usr/include/X11/extensions/security.h195
-rw-r--r--sysroot/usr/include/X11/extensions/securstr.h116
-rw-r--r--sysroot/usr/include/X11/extensions/shape.h180
-rw-r--r--sysroot/usr/include/X11/extensions/shapestr.h234
-rw-r--r--sysroot/usr/include/X11/extensions/shmstr.h217
-rw-r--r--sysroot/usr/include/X11/extensions/sync.h469
-rw-r--r--sysroot/usr/include/X11/extensions/syncstr.h494
-rw-r--r--sysroot/usr/include/X11/extensions/xtestext1.h326
-rw-r--r--sysroot/usr/include/X11/extensions/xteststr.h120
-rw-r--r--sysroot/usr/include/X11/keysym.h76
-rw-r--r--sysroot/usr/include/X11/keysymdef.h2358
-rw-r--r--sysroot/usr/include/_G_config.h101
-rw-r--r--sysroot/usr/include/a.out.h138
-rw-r--r--sysroot/usr/include/af_vfs.h56
-rw-r--r--sysroot/usr/include/aio.h246
-rw-r--r--sysroot/usr/include/aliases.h64
-rw-r--r--sysroot/usr/include/alloca.h41
-rw-r--r--sysroot/usr/include/alsa/alisp.h55
-rw-r--r--sysroot/usr/include/alsa/asoundef.h253
-rw-r--r--sysroot/usr/include/alsa/asoundlib.h62
-rw-r--r--sysroot/usr/include/alsa/conf.h198
-rw-r--r--sysroot/usr/include/alsa/control.h555
-rw-r--r--sysroot/usr/include/alsa/control_external.h265
-rw-r--r--sysroot/usr/include/alsa/conv.h57
-rw-r--r--sysroot/usr/include/alsa/error.h78
-rw-r--r--sysroot/usr/include/alsa/global.h156
-rw-r--r--sysroot/usr/include/alsa/hwdep.h160
-rw-r--r--sysroot/usr/include/alsa/iatomic.h1106
-rw-r--r--sysroot/usr/include/alsa/input.h83
-rw-r--r--sysroot/usr/include/alsa/instr.h177
-rw-r--r--sysroot/usr/include/alsa/mixer.h315
-rw-r--r--sysroot/usr/include/alsa/mixer_abst.h110
-rw-r--r--sysroot/usr/include/alsa/output.h86
-rw-r--r--sysroot/usr/include/alsa/pcm.h1113
-rw-r--r--sysroot/usr/include/alsa/pcm_external.h70
-rw-r--r--sysroot/usr/include/alsa/pcm_extplug.h189
-rw-r--r--sysroot/usr/include/alsa/pcm_ioplug.h213
-rw-r--r--sysroot/usr/include/alsa/pcm_old.h230
-rw-r--r--sysroot/usr/include/alsa/pcm_plugin.h202
-rw-r--r--sysroot/usr/include/alsa/pcm_rate.h117
-rw-r--r--sysroot/usr/include/alsa/rawmidi.h159
-rw-r--r--sysroot/usr/include/alsa/seq.h740
-rw-r--r--sysroot/usr/include/alsa/seq_event.h452
-rw-r--r--sysroot/usr/include/alsa/seq_midi_event.h65
-rw-r--r--sysroot/usr/include/alsa/seqmid.h490
-rw-r--r--sysroot/usr/include/alsa/sound/ainstr_fm.h129
-rw-r--r--sysroot/usr/include/alsa/sound/ainstr_gf1.h224
-rw-r--r--sysroot/usr/include/alsa/sound/ainstr_iw.h372
-rw-r--r--sysroot/usr/include/alsa/sound/ainstr_simple.h155
-rw-r--r--sysroot/usr/include/alsa/sound/asound_fm.h115
-rw-r--r--sysroot/usr/include/alsa/sound/emu10k1.h349
-rw-r--r--sysroot/usr/include/alsa/sound/hdsp.h112
-rw-r--r--sysroot/usr/include/alsa/sound/sb16_csp.h115
-rw-r--r--sysroot/usr/include/alsa/sound/sscape_ioctl.h21
-rw-r--r--sysroot/usr/include/alsa/sound/type_compat.h40
-rw-r--r--sysroot/usr/include/alsa/timer.h257
-rw-r--r--sysroot/usr/include/alsa/version.h15
-rw-r--r--sysroot/usr/include/ar.h48
-rw-r--r--sysroot/usr/include/argp.h601
-rw-r--r--sysroot/usr/include/argz.h187
-rw-r--r--sysroot/usr/include/arpa/ftp.h105
-rw-r--r--sysroot/usr/include/arpa/inet.h106
-rw-r--r--sysroot/usr/include/arpa/nameser.h562
-rw-r--r--sysroot/usr/include/arpa/nameser_compat.h183
-rw-r--r--sysroot/usr/include/arpa/telnet.h316
-rw-r--r--sysroot/usr/include/arpa/tftp.h76
-rw-r--r--sysroot/usr/include/asm-generic/errno-base.h39
-rw-r--r--sysroot/usr/include/asm-generic/errno.h109
-rw-r--r--sysroot/usr/include/asm-generic/fcntl.h151
-rw-r--r--sysroot/usr/include/asm-generic/ioctl.h80
-rw-r--r--sysroot/usr/include/asm-generic/mman.h41
-rw-r--r--sysroot/usr/include/asm-generic/poll.h37
-rw-r--r--sysroot/usr/include/asm-generic/resource.h68
-rw-r--r--sysroot/usr/include/asm-generic/siginfo.h258
-rw-r--r--sysroot/usr/include/asm-generic/signal.h27
-rw-r--r--sysroot/usr/include/asm-generic/statfs.h51
-rw-r--r--sysroot/usr/include/asm/a.out.h21
-rw-r--r--sysroot/usr/include/asm/auxvec.h12
-rw-r--r--sysroot/usr/include/asm/boot.h20
-rw-r--r--sysroot/usr/include/asm/bootparam.h94
-rw-r--r--sysroot/usr/include/asm/byteorder.h71
-rw-r--r--sysroot/usr/include/asm/debugreg.h70
-rw-r--r--sysroot/usr/include/asm/e820.h29
-rw-r--r--sysroot/usr/include/asm/elf.h76
-rw-r--r--sysroot/usr/include/asm/errno.h1
-rw-r--r--sysroot/usr/include/asm/fcntl.h1
-rw-r--r--sysroot/usr/include/asm/ioctl.h1
-rw-r--r--sysroot/usr/include/asm/ioctls.h87
-rw-r--r--sysroot/usr/include/asm/ipcbuf.h29
-rw-r--r--sysroot/usr/include/asm/ist.h29
-rw-r--r--sysroot/usr/include/asm/kvm.h191
-rw-r--r--sysroot/usr/include/asm/ldt.h40
-rw-r--r--sysroot/usr/include/asm/mce.h86
-rw-r--r--sysroot/usr/include/asm/mman.h19
-rw-r--r--sysroot/usr/include/asm/msgbuf.h39
-rw-r--r--sysroot/usr/include/asm/msr-index.h292
-rw-r--r--sysroot/usr/include/asm/msr.h145
-rw-r--r--sysroot/usr/include/asm/mtrr.h86
-rw-r--r--sysroot/usr/include/asm/page.h5
-rw-r--r--sysroot/usr/include/asm/page_32.h13
-rw-r--r--sysroot/usr/include/asm/page_64.h41
-rw-r--r--sysroot/usr/include/asm/param.h17
-rw-r--r--sysroot/usr/include/asm/poll.h1
-rw-r--r--sysroot/usr/include/asm/posix_types.h5
-rw-r--r--sysroot/usr/include/asm/posix_types_32.h82
-rw-r--r--sysroot/usr/include/asm/posix_types_64.h47
-rw-r--r--sysroot/usr/include/asm/prctl.h10
-rw-r--r--sysroot/usr/include/asm/ptrace-abi.h81
-rw-r--r--sysroot/usr/include/asm/ptrace.h66
-rw-r--r--sysroot/usr/include/asm/resource.h1
-rw-r--r--sysroot/usr/include/asm/sembuf.h24
-rw-r--r--sysroot/usr/include/asm/setup.h7
-rw-r--r--sysroot/usr/include/asm/shmbuf.h51
-rw-r--r--sysroot/usr/include/asm/sigcontext.h137
-rw-r--r--sysroot/usr/include/asm/sigcontext32.h71
-rw-r--r--sysroot/usr/include/asm/siginfo.h10
-rw-r--r--sysroot/usr/include/asm/signal.h138
-rw-r--r--sysroot/usr/include/asm/socket.h55
-rw-r--r--sysroot/usr/include/asm/sockios.h13
-rw-r--r--sysroot/usr/include/asm/stat.h114
-rw-r--r--sysroot/usr/include/asm/statfs.h63
-rw-r--r--sysroot/usr/include/asm/termbits.h198
-rw-r--r--sysroot/usr/include/asm/termios.h43
-rw-r--r--sysroot/usr/include/asm/types.h38
-rw-r--r--sysroot/usr/include/asm/ucontext.h12
-rw-r--r--sysroot/usr/include/asm/unistd.h5
-rw-r--r--sysroot/usr/include/asm/unistd_32.h334
-rw-r--r--sysroot/usr/include/asm/unistd_64.h665
-rw-r--r--sysroot/usr/include/asm/user.h5
-rw-r--r--sysroot/usr/include/asm/user_32.h121
-rw-r--r--sysroot/usr/include/asm/user_64.h114
-rw-r--r--sysroot/usr/include/asm/vm86.h140
-rw-r--r--sysroot/usr/include/asm/vsyscall.h17
-rw-r--r--sysroot/usr/include/asm/vsyscall32.h20
-rw-r--r--sysroot/usr/include/assert.h118
-rw-r--r--sysroot/usr/include/audiofile.h601
-rw-r--r--sysroot/usr/include/aupvlist.h61
-rw-r--r--sysroot/usr/include/bits/a.out.h13
-rw-r--r--sysroot/usr/include/bits/byteswap.h136
-rw-r--r--sysroot/usr/include/bits/cmathcalls.h159
-rw-r--r--sysroot/usr/include/bits/confname.h602
-rw-r--r--sysroot/usr/include/bits/dirent.h53
-rw-r--r--sysroot/usr/include/bits/dlfcn.h65
-rw-r--r--sysroot/usr/include/bits/elfclass.h14
-rw-r--r--sysroot/usr/include/bits/endian.h7
-rw-r--r--sysroot/usr/include/bits/environments.h87
-rw-r--r--sysroot/usr/include/bits/errno.h59
-rw-r--r--sysroot/usr/include/bits/error.h74
-rw-r--r--sysroot/usr/include/bits/fcntl.h254
-rw-r--r--sysroot/usr/include/bits/fcntl2.h173
-rw-r--r--sysroot/usr/include/bits/fenv.h97
-rw-r--r--sysroot/usr/include/bits/fenvinline.h8
-rw-r--r--sysroot/usr/include/bits/huge_val.h55
-rw-r--r--sysroot/usr/include/bits/huge_valf.h53
-rw-r--r--sysroot/usr/include/bits/huge_vall.h29
-rw-r--r--sysroot/usr/include/bits/in.h170
-rw-r--r--sysroot/usr/include/bits/inf.h30
-rw-r--r--sysroot/usr/include/bits/initspin.h1
-rw-r--r--sysroot/usr/include/bits/ioctl-types.h78
-rw-r--r--sysroot/usr/include/bits/ioctls.h109
-rw-r--r--sysroot/usr/include/bits/ipc.h56
-rw-r--r--sysroot/usr/include/bits/ipctypes.h37
-rw-r--r--sysroot/usr/include/bits/libc-lock.h585
-rw-r--r--sysroot/usr/include/bits/libio-ldbl.h25
-rw-r--r--sysroot/usr/include/bits/link.h117
-rw-r--r--sysroot/usr/include/bits/local_lim.h92
-rw-r--r--sysroot/usr/include/bits/locale.h44
-rw-r--r--sysroot/usr/include/bits/mathcalls.h365
-rw-r--r--sysroot/usr/include/bits/mathdef.h48
-rw-r--r--sysroot/usr/include/bits/mathinline.h53
-rw-r--r--sysroot/usr/include/bits/mman.h104
-rw-r--r--sysroot/usr/include/bits/monetary-ldbl.h28
-rw-r--r--sysroot/usr/include/bits/mqueue.h32
-rw-r--r--sysroot/usr/include/bits/mqueue2.h56
-rw-r--r--sysroot/usr/include/bits/msq.h83
-rw-r--r--sysroot/usr/include/bits/nan.h53
-rw-r--r--sysroot/usr/include/bits/netdb.h33
-rw-r--r--sysroot/usr/include/bits/poll.h50
-rw-r--r--sysroot/usr/include/bits/posix1_lim.h168
-rw-r--r--sysroot/usr/include/bits/posix2_lim.h91
-rw-r--r--sysroot/usr/include/bits/posix_opt.h184
-rw-r--r--sysroot/usr/include/bits/printf-ldbl.h24
-rw-r--r--sysroot/usr/include/bits/pthreadtypes.h225
-rw-r--r--sysroot/usr/include/bits/resource.h225
-rw-r--r--sysroot/usr/include/bits/sched.h195
-rw-r--r--sysroot/usr/include/bits/select.h35
-rw-r--r--sysroot/usr/include/bits/sem.h87
-rw-r--r--sysroot/usr/include/bits/semaphore.h41
-rw-r--r--sysroot/usr/include/bits/setjmp.h39
-rw-r--r--sysroot/usr/include/bits/shm.h110
-rw-r--r--sysroot/usr/include/bits/sigaction.h77
-rw-r--r--sysroot/usr/include/bits/sigcontext.h159
-rw-r--r--sysroot/usr/include/bits/siginfo.h313
-rw-r--r--sysroot/usr/include/bits/signum.h80
-rw-r--r--sysroot/usr/include/bits/sigset.h126
-rw-r--r--sysroot/usr/include/bits/sigstack.h55
-rw-r--r--sysroot/usr/include/bits/sigthread.h38
-rw-r--r--sysroot/usr/include/bits/sockaddr.h40
-rw-r--r--sysroot/usr/include/bits/socket.h330
-rw-r--r--sysroot/usr/include/bits/socket2.h78
-rw-r--r--sysroot/usr/include/bits/stab.def234
-rw-r--r--sysroot/usr/include/bits/stat.h209
-rw-r--r--sysroot/usr/include/bits/statfs.h67
-rw-r--r--sysroot/usr/include/bits/statvfs.h109
-rw-r--r--sysroot/usr/include/bits/stdio-ldbl.h89
-rw-r--r--sysroot/usr/include/bits/stdio-lock.h111
-rw-r--r--sysroot/usr/include/bits/stdio.h191
-rw-r--r--sysroot/usr/include/bits/stdio2.h287
-rw-r--r--sysroot/usr/include/bits/stdio_lim.h41
-rw-r--r--sysroot/usr/include/bits/stdlib-ldbl.h42
-rw-r--r--sysroot/usr/include/bits/stdlib.h156
-rw-r--r--sysroot/usr/include/bits/string.h26
-rw-r--r--sysroot/usr/include/bits/string2.h1355
-rw-r--r--sysroot/usr/include/bits/string3.h154
-rw-r--r--sysroot/usr/include/bits/stropts.h231
-rw-r--r--sysroot/usr/include/bits/sys_errlist.h33
-rw-r--r--sysroot/usr/include/bits/syscall.h366
-rw-r--r--sysroot/usr/include/bits/syslog-ldbl.h36
-rw-r--r--sysroot/usr/include/bits/syslog-path.h29
-rw-r--r--sysroot/usr/include/bits/syslog.h50
-rw-r--r--sysroot/usr/include/bits/termios.h218
-rw-r--r--sysroot/usr/include/bits/time.h75
-rw-r--r--sysroot/usr/include/bits/types.h197
-rw-r--r--sysroot/usr/include/bits/typesizes.h66
-rw-r--r--sysroot/usr/include/bits/uio.h50
-rw-r--r--sysroot/usr/include/bits/unistd.h386
-rw-r--r--sysroot/usr/include/bits/ustat.h31
-rw-r--r--sysroot/usr/include/bits/utmp.h125
-rw-r--r--sysroot/usr/include/bits/utmpx.h103
-rw-r--r--sysroot/usr/include/bits/utsname.h29
-rw-r--r--sysroot/usr/include/bits/waitflags.h38
-rw-r--r--sysroot/usr/include/bits/waitstatus.h106
-rw-r--r--sysroot/usr/include/bits/wchar-ldbl.h75
-rw-r--r--sysroot/usr/include/bits/wchar.h26
-rw-r--r--sysroot/usr/include/bits/wchar2.h590
-rw-r--r--sysroot/usr/include/bits/wordsize.h8
-rw-r--r--sysroot/usr/include/bits/xopen_lim.h144
-rw-r--r--sysroot/usr/include/bits/xtitypes.h34
-rw-r--r--sysroot/usr/include/byteswap.h40
-rw-r--r--sysroot/usr/include/complex.h114
-rw-r--r--sysroot/usr/include/cpio.h74
-rw-r--r--sysroot/usr/include/crypt.h75
-rw-r--r--sysroot/usr/include/ctype.h325
-rw-r--r--sysroot/usr/include/curses.h1498
-rw-r--r--sysroot/usr/include/cursesapp.h176
-rw-r--r--sysroot/usr/include/cursesf.h967
-rw-r--r--sysroot/usr/include/cursesm.h672
-rw-r--r--sysroot/usr/include/cursesp.h265
-rw-r--r--sysroot/usr/include/cursesw.h1439
-rw-r--r--sysroot/usr/include/cursslk.h238
-rw-r--r--sysroot/usr/include/dirent.h351
-rw-r--r--sysroot/usr/include/dlfcn.h192
-rw-r--r--sysroot/usr/include/elf.h2646
-rw-r--r--sysroot/usr/include/endian.h58
-rw-r--r--sysroot/usr/include/envz.h74
-rw-r--r--sysroot/usr/include/err.h58
-rw-r--r--sysroot/usr/include/errno.h73
-rw-r--r--sysroot/usr/include/error.h58
-rw-r--r--sysroot/usr/include/esd.h340
-rw-r--r--sysroot/usr/include/eti.h54
-rw-r--r--sysroot/usr/include/etip.h372
-rw-r--r--sysroot/usr/include/execinfo.h44
-rw-r--r--sysroot/usr/include/fcntl.h222
-rw-r--r--sysroot/usr/include/features.h357
-rw-r--r--sysroot/usr/include/fenv.h136
-rw-r--r--sysroot/usr/include/fmtmsg.h106
-rw-r--r--sysroot/usr/include/fnmatch.h72
-rw-r--r--sysroot/usr/include/form.h403
-rw-r--r--sysroot/usr/include/fpu_control.h101
-rw-r--r--sysroot/usr/include/fstab.h79
-rw-r--r--sysroot/usr/include/fts.h131
-rw-r--r--sysroot/usr/include/ftw.h178
-rw-r--r--sysroot/usr/include/gconv.h180
-rw-r--r--sysroot/usr/include/getopt.h177
-rw-r--r--sysroot/usr/include/glob.h194
-rw-r--r--sysroot/usr/include/gnu-versions.h53
-rw-r--r--sysroot/usr/include/gnu/lib-names.h57
-rw-r--r--sysroot/usr/include/gnu/libc-version.h35
-rw-r--r--sysroot/usr/include/gnu/stubs-32.h23
-rw-r--r--sysroot/usr/include/gnu/stubs.h12
-rw-r--r--sysroot/usr/include/grp.h205
-rw-r--r--sysroot/usr/include/iconv.h56
-rw-r--r--sysroot/usr/include/ieee754.h199
-rw-r--r--sysroot/usr/include/ifaddrs.h74
-rw-r--r--sysroot/usr/include/inttypes.h444
-rw-r--r--sysroot/usr/include/langinfo.h598
-rw-r--r--sysroot/usr/include/lastlog.h4
-rw-r--r--sysroot/usr/include/libgen.h40
-rw-r--r--sysroot/usr/include/libintl.h124
-rw-r--r--sysroot/usr/include/libio.h553
-rw-r--r--sysroot/usr/include/limits.h154
-rw-r--r--sysroot/usr/include/link.h194
-rw-r--r--sysroot/usr/include/linux/a.out.h268
-rw-r--r--sysroot/usr/include/linux/acct.h116
-rw-r--r--sysroot/usr/include/linux/adb.h44
-rw-r--r--sysroot/usr/include/linux/adfs_fs.h44
-rw-r--r--sysroot/usr/include/linux/affs_hardblocks.h68
-rw-r--r--sysroot/usr/include/linux/agpgart.h111
-rw-r--r--sysroot/usr/include/linux/aio_abi.h110
-rw-r--r--sysroot/usr/include/linux/apm_bios.h135
-rw-r--r--sysroot/usr/include/linux/arcfb.h8
-rw-r--r--sysroot/usr/include/linux/atalk.h42
-rw-r--r--sysroot/usr/include/linux/atm.h238
-rw-r--r--sysroot/usr/include/linux/atm_eni.h23
-rw-r--r--sysroot/usr/include/linux/atm_he.h20
-rw-r--r--sysroot/usr/include/linux/atm_idt77105.h28
-rw-r--r--sysroot/usr/include/linux/atm_nicstar.h53
-rw-r--r--sysroot/usr/include/linux/atm_tcp.h60
-rw-r--r--sysroot/usr/include/linux/atm_zatm.h52
-rw-r--r--sysroot/usr/include/linux/atmapi.h29
-rw-r--r--sysroot/usr/include/linux/atmarp.h41
-rw-r--r--sysroot/usr/include/linux/atmbr2684.h101
-rw-r--r--sysroot/usr/include/linux/atmclip.h21
-rw-r--r--sysroot/usr/include/linux/atmdev.h211
-rw-r--r--sysroot/usr/include/linux/atmioc.h41
-rw-r--r--sysroot/usr/include/linux/atmlec.h97
-rw-r--r--sysroot/usr/include/linux/atmmpc.h125
-rw-r--r--sysroot/usr/include/linux/atmppp.h24
-rw-r--r--sysroot/usr/include/linux/atmsap.h162
-rw-r--r--sysroot/usr/include/linux/atmsvc.h55
-rw-r--r--sysroot/usr/include/linux/audit.h346
-rw-r--r--sysroot/usr/include/linux/auto_fs.h79
-rw-r--r--sysroot/usr/include/linux/auto_fs4.h106
-rw-r--r--sysroot/usr/include/linux/auxvec.h33
-rw-r--r--sysroot/usr/include/linux/ax25.h116
-rw-r--r--sysroot/usr/include/linux/b1lli.h73
-rw-r--r--sysroot/usr/include/linux/baycom.h39
-rw-r--r--sysroot/usr/include/linux/bfs_fs.h80
-rw-r--r--sysroot/usr/include/linux/binfmts.h20
-rw-r--r--sysroot/usr/include/linux/blkpg.h57
-rw-r--r--sysroot/usr/include/linux/bpqether.h41
-rw-r--r--sysroot/usr/include/linux/byteorder/big_endian.h106
-rw-r--r--sysroot/usr/include/linux/byteorder/generic.h87
-rw-r--r--sysroot/usr/include/linux/byteorder/little_endian.h106
-rw-r--r--sysroot/usr/include/linux/byteorder/swab.h210
-rw-r--r--sysroot/usr/include/linux/capability.h290
-rw-r--r--sysroot/usr/include/linux/capi.h131
-rw-r--r--sysroot/usr/include/linux/cciss_ioctl.h214
-rw-r--r--sysroot/usr/include/linux/cdk.h486
-rw-r--r--sysroot/usr/include/linux/cdrom.h908
-rw-r--r--sysroot/usr/include/linux/cgroupstats.h70
-rw-r--r--sysroot/usr/include/linux/chio.h168
-rw-r--r--sysroot/usr/include/linux/cm4000_cs.h60
-rw-r--r--sysroot/usr/include/linux/cn_proc.h100
-rw-r--r--sysroot/usr/include/linux/coda.h780
-rw-r--r--sysroot/usr/include/linux/coda_psdev.h92
-rw-r--r--sysroot/usr/include/linux/coff.h351
-rw-r--r--sysroot/usr/include/linux/comstats.h119
-rw-r--r--sysroot/usr/include/linux/connector.h95
-rw-r--r--sysroot/usr/include/linux/const.h19
-rw-r--r--sysroot/usr/include/linux/cramfs_fs.h93
-rw-r--r--sysroot/usr/include/linux/cuda.h28
-rw-r--r--sysroot/usr/include/linux/cyclades.h508
-rw-r--r--sysroot/usr/include/linux/cycx_cfm.h101
-rw-r--r--sysroot/usr/include/linux/dccp.h217
-rw-r--r--sysroot/usr/include/linux/dirent.h21
-rw-r--r--sysroot/usr/include/linux/dlm.h213
-rw-r--r--sysroot/usr/include/linux/dlm_device.h103
-rw-r--r--sysroot/usr/include/linux/dlm_netlink.h56
-rw-r--r--sysroot/usr/include/linux/dm-ioctl.h332
-rw-r--r--sysroot/usr/include/linux/dn.h147
-rw-r--r--sysroot/usr/include/linux/dqblk_v1.h24
-rw-r--r--sysroot/usr/include/linux/dqblk_v2.h26
-rw-r--r--sysroot/usr/include/linux/dqblk_xfs.h157
-rw-r--r--sysroot/usr/include/linux/dvb/audio.h136
-rw-r--r--sysroot/usr/include/linux/dvb/ca.h90
-rw-r--r--sysroot/usr/include/linux/dvb/dmx.h150
-rw-r--r--sysroot/usr/include/linux/dvb/frontend.h277
-rw-r--r--sysroot/usr/include/linux/dvb/net.h53
-rw-r--r--sysroot/usr/include/linux/dvb/osd.h143
-rw-r--r--sysroot/usr/include/linux/dvb/version.h29
-rw-r--r--sysroot/usr/include/linux/dvb/video.h274
-rw-r--r--sysroot/usr/include/linux/edd.h189
-rw-r--r--sysroot/usr/include/linux/efs_fs_sb.h61
-rw-r--r--sysroot/usr/include/linux/elf-em.h52
-rw-r--r--sysroot/usr/include/linux/elf-fdpic.h68
-rw-r--r--sysroot/usr/include/linux/elf.h402
-rw-r--r--sysroot/usr/include/linux/elfcore.h97
-rw-r--r--sysroot/usr/include/linux/errno.h7
-rw-r--r--sysroot/usr/include/linux/errqueue.h23
-rw-r--r--sysroot/usr/include/linux/ethtool.h404
-rw-r--r--sysroot/usr/include/linux/eventpoll.h50
-rw-r--r--sysroot/usr/include/linux/ext2_fs.h532
-rw-r--r--sysroot/usr/include/linux/ext3_fs.h649
-rw-r--r--sysroot/usr/include/linux/fadvise.h21
-rw-r--r--sysroot/usr/include/linux/fb.h385
-rw-r--r--sysroot/usr/include/linux/fcntl.h44
-rw-r--r--sysroot/usr/include/linux/fd.h373
-rw-r--r--sysroot/usr/include/linux/fdreg.h137
-rw-r--r--sysroot/usr/include/linux/fib_rules.h71
-rw-r--r--sysroot/usr/include/linux/filter.h126
-rw-r--r--sysroot/usr/include/linux/firewire-cdev.h477
-rw-r--r--sysroot/usr/include/linux/firewire-constants.h67
-rw-r--r--sysroot/usr/include/linux/flat.h58
-rw-r--r--sysroot/usr/include/linux/fs.h270
-rw-r--r--sysroot/usr/include/linux/fuse.h407
-rw-r--r--sysroot/usr/include/linux/futex.h136
-rw-r--r--sysroot/usr/include/linux/gameport.h28
-rw-r--r--sysroot/usr/include/linux/gen_stats.h67
-rw-r--r--sysroot/usr/include/linux/generic_serial.h36
-rw-r--r--sysroot/usr/include/linux/genetlink.h82
-rw-r--r--sysroot/usr/include/linux/genhd.h212
-rw-r--r--sysroot/usr/include/linux/gfs2_ondisk.h445
-rw-r--r--sysroot/usr/include/linux/gigaset_dev.h30
-rw-r--r--sysroot/usr/include/linux/hayesesp.h17
-rw-r--r--sysroot/usr/include/linux/hdlc.h23
-rw-r--r--sysroot/usr/include/linux/hdlc/ioctl.h81
-rw-r--r--sysroot/usr/include/linux/hdlcdrv.h110
-rw-r--r--sysroot/usr/include/linux/hdreg.h647
-rw-r--r--sysroot/usr/include/linux/hdsmart.h124
-rw-r--r--sysroot/usr/include/linux/hiddev.h210
-rw-r--r--sysroot/usr/include/linux/hpet.h22
-rw-r--r--sysroot/usr/include/linux/hysdn_if.h33
-rw-r--r--sysroot/usr/include/linux/i2c-dev.h73
-rw-r--r--sysroot/usr/include/linux/i2c.h153
-rw-r--r--sysroot/usr/include/linux/i2o-dev.h421
-rw-r--r--sysroot/usr/include/linux/i8k.h46
-rw-r--r--sysroot/usr/include/linux/icmp.h97
-rw-r--r--sysroot/usr/include/linux/icmpv6.h161
-rw-r--r--sysroot/usr/include/linux/if.h216
-rw-r--r--sysroot/usr/include/linux/if_addr.h60
-rw-r--r--sysroot/usr/include/linux/if_arcnet.h137
-rw-r--r--sysroot/usr/include/linux/if_arp.h152
-rw-r--r--sysroot/usr/include/linux/if_bonding.h125
-rw-r--r--sysroot/usr/include/linux/if_bridge.h104
-rw-r--r--sysroot/usr/include/linux/if_cablemodem.h22
-rw-r--r--sysroot/usr/include/linux/if_ec.h36
-rw-r--r--sysroot/usr/include/linux/if_eql.h54
-rw-r--r--sysroot/usr/include/linux/if_ether.h113
-rw-r--r--sysroot/usr/include/linux/if_fc.h50
-rw-r--r--sysroot/usr/include/linux/if_fddi.h108
-rw-r--r--sysroot/usr/include/linux/if_frad.h132
-rw-r--r--sysroot/usr/include/linux/if_hippi.h157
-rw-r--r--sysroot/usr/include/linux/if_infiniband.h29
-rw-r--r--sysroot/usr/include/linux/if_link.h189
-rw-r--r--sysroot/usr/include/linux/if_ltalk.h9
-rw-r--r--sysroot/usr/include/linux/if_packet.h115
-rw-r--r--sysroot/usr/include/linux/if_plip.h28
-rw-r--r--sysroot/usr/include/linux/if_ppp.h173
-rw-r--r--sysroot/usr/include/linux/if_pppol2tp.h66
-rw-r--r--sysroot/usr/include/linux/if_pppox.h123
-rw-r--r--sysroot/usr/include/linux/if_shaper.h22
-rw-r--r--sysroot/usr/include/linux/if_slip.h30
-rw-r--r--sysroot/usr/include/linux/if_strip.h25
-rw-r--r--sysroot/usr/include/linux/if_tr.h94
-rw-r--r--sysroot/usr/include/linux/if_tun.h60
-rw-r--r--sysroot/usr/include/linux/if_tunnel.h31
-rw-r--r--sysroot/usr/include/linux/if_vlan.h61
-rw-r--r--sysroot/usr/include/linux/if_wanpipe.h103
-rw-r--r--sysroot/usr/include/linux/igmp.h129
-rw-r--r--sysroot/usr/include/linux/in.h249
-rw-r--r--sysroot/usr/include/linux/in6.h252
-rw-r--r--sysroot/usr/include/linux/in_route.h32
-rw-r--r--sysroot/usr/include/linux/inet_diag.h122
-rw-r--r--sysroot/usr/include/linux/inotify.h67
-rw-r--r--sysroot/usr/include/linux/input.h936
-rw-r--r--sysroot/usr/include/linux/ioctl.h7
-rw-r--r--sysroot/usr/include/linux/ip.h136
-rw-r--r--sysroot/usr/include/linux/ip6_tunnel.h34
-rw-r--r--sysroot/usr/include/linux/ipc.h81
-rw-r--r--sysroot/usr/include/linux/ipmi.h462
-rw-r--r--sysroot/usr/include/linux/ipmi_msgdefs.h113
-rw-r--r--sysroot/usr/include/linux/ipsec.h47
-rw-r--r--sysroot/usr/include/linux/ipv6.h194
-rw-r--r--sysroot/usr/include/linux/ipv6_route.h56
-rw-r--r--sysroot/usr/include/linux/ipx.h74
-rw-r--r--sysroot/usr/include/linux/irda.h252
-rw-r--r--sysroot/usr/include/linux/isdn.h148
-rw-r--r--sysroot/usr/include/linux/isdn/capicmd.h115
-rw-r--r--sysroot/usr/include/linux/isdn_divertif.h26
-rw-r--r--sysroot/usr/include/linux/isdn_ppp.h67
-rw-r--r--sysroot/usr/include/linux/isdnif.h56
-rw-r--r--sysroot/usr/include/linux/iso_fs.h165
-rw-r--r--sysroot/usr/include/linux/ixjuser.h720
-rw-r--r--sysroot/usr/include/linux/jbd.h247
-rw-r--r--sysroot/usr/include/linux/jffs2.h224
-rw-r--r--sysroot/usr/include/linux/joystick.h138
-rw-r--r--sysroot/usr/include/linux/kd.h181
-rw-r--r--sysroot/usr/include/linux/kdev_t.h11
-rw-r--r--sysroot/usr/include/linux/kernel.h46
-rw-r--r--sysroot/usr/include/linux/kernelcapi.h47
-rw-r--r--sysroot/usr/include/linux/keyboard.h442
-rw-r--r--sysroot/usr/include/linux/keyctl.h53
-rw-r--r--sysroot/usr/include/linux/limits.h20
-rw-r--r--sysroot/usr/include/linux/llc.h73
-rw-r--r--sysroot/usr/include/linux/lock_dlm_plock.h41
-rw-r--r--sysroot/usr/include/linux/loop.h88
-rw-r--r--sysroot/usr/include/linux/lp.h100
-rw-r--r--sysroot/usr/include/linux/magic.h45
-rw-r--r--sysroot/usr/include/linux/major.h173
-rw-r--r--sysroot/usr/include/linux/matroxfb.h43
-rw-r--r--sysroot/usr/include/linux/mempolicy.h31
-rw-r--r--sysroot/usr/include/linux/meye.h66
-rw-r--r--sysroot/usr/include/linux/mii.h146
-rw-r--r--sysroot/usr/include/linux/minix_fs.h105
-rw-r--r--sysroot/usr/include/linux/mman.h13
-rw-r--r--sysroot/usr/include/linux/mmtimer.h56
-rw-r--r--sysroot/usr/include/linux/mqueue.h53
-rw-r--r--sysroot/usr/include/linux/mroute.h141
-rw-r--r--sysroot/usr/include/linux/msdos_fs.h182
-rw-r--r--sysroot/usr/include/linux/msg.h65
-rw-r--r--sysroot/usr/include/linux/mtio.h205
-rw-r--r--sysroot/usr/include/linux/n_r3964.h99
-rw-r--r--sysroot/usr/include/linux/nbd.h73
-rw-r--r--sysroot/usr/include/linux/ncp.h198
-rw-r--r--sysroot/usr/include/linux/ncp_fs.h147
-rw-r--r--sysroot/usr/include/linux/ncp_mount.h72
-rw-r--r--sysroot/usr/include/linux/ncp_no.h19
-rw-r--r--sysroot/usr/include/linux/neighbour.h159
-rw-r--r--sysroot/usr/include/linux/net.h58
-rw-r--r--sysroot/usr/include/linux/netdevice.h123
-rw-r--r--sysroot/usr/include/linux/netfilter.h30
-rw-r--r--sysroot/usr/include/linux/netfilter/nf_conntrack_common.h140
-rw-r--r--sysroot/usr/include/linux/netfilter/nf_conntrack_ftp.h19
-rw-r--r--sysroot/usr/include/linux/netfilter/nf_conntrack_sctp.h27
-rw-r--r--sysroot/usr/include/linux/netfilter/nf_conntrack_tcp.h39
-rw-r--r--sysroot/usr/include/linux/netfilter/nf_conntrack_tuple_common.h13
-rw-r--r--sysroot/usr/include/linux/netfilter/nfnetlink.h51
-rw-r--r--sysroot/usr/include/linux/netfilter/nfnetlink_compat.h61
-rw-r--r--sysroot/usr/include/linux/netfilter/nfnetlink_conntrack.h141
-rw-r--r--sysroot/usr/include/linux/netfilter/nfnetlink_log.h92
-rw-r--r--sysroot/usr/include/linux/netfilter/nfnetlink_queue.h90
-rw-r--r--sysroot/usr/include/linux/netfilter/x_tables.h130
-rw-r--r--sysroot/usr/include/linux/netfilter/xt_CLASSIFY.h8
-rw-r--r--sysroot/usr/include/linux/netfilter/xt_CONNMARK.h25
-rw-r--r--sysroot/usr/include/linux/netfilter/xt_CONNSECMARK.h13
-rw-r--r--sysroot/usr/include/linux/netfilter/xt_DSCP.h20
-rw-r--r--sysroot/usr/include/linux/netfilter/xt_MARK.h21
-rw-r--r--sysroot/usr/include/linux/netfilter/xt_NFLOG.h18
-rw-r--r--sysroot/usr/include/linux/netfilter/xt_NFQUEUE.h16
-rw-r--r--sysroot/usr/include/linux/netfilter/xt_SECMARK.h26
-rw-r--r--sysroot/usr/include/linux/netfilter/xt_TCPMSS.h10
-rw-r--r--sysroot/usr/include/linux/netfilter/xt_comment.h10
-rw-r--r--sysroot/usr/include/linux/netfilter/xt_connbytes.h25
-rw-r--r--sysroot/usr/include/linux/netfilter/xt_connmark.h18
-rw-r--r--sysroot/usr/include/linux/netfilter/xt_conntrack.h63
-rw-r--r--sysroot/usr/include/linux/netfilter/xt_dccp.h23
-rw-r--r--sysroot/usr/include/linux/netfilter/xt_dscp.h23
-rw-r--r--sysroot/usr/include/linux/netfilter/xt_esp.h14
-rw-r--r--sysroot/usr/include/linux/netfilter/xt_hashlimit.h40
-rw-r--r--sysroot/usr/include/linux/netfilter/xt_helper.h8
-rw-r--r--sysroot/usr/include/linux/netfilter/xt_length.h9
-rw-r--r--sysroot/usr/include/linux/netfilter/xt_limit.h21
-rw-r--r--sysroot/usr/include/linux/netfilter/xt_mac.h8
-rw-r--r--sysroot/usr/include/linux/netfilter/xt_mark.h9
-rw-r--r--sysroot/usr/include/linux/netfilter/xt_multiport.h30
-rw-r--r--sysroot/usr/include/linux/netfilter/xt_physdev.h21
-rw-r--r--sysroot/usr/include/linux/netfilter/xt_pkttype.h8
-rw-r--r--sysroot/usr/include/linux/netfilter/xt_policy.h58
-rw-r--r--sysroot/usr/include/linux/netfilter/xt_quota.h16
-rw-r--r--sysroot/usr/include/linux/netfilter/xt_realm.h10
-rw-r--r--sysroot/usr/include/linux/netfilter/xt_sctp.h104
-rw-r--r--sysroot/usr/include/linux/netfilter/xt_state.h13
-rw-r--r--sysroot/usr/include/linux/netfilter/xt_statistic.h32
-rw-r--r--sysroot/usr/include/linux/netfilter/xt_string.h18
-rw-r--r--sysroot/usr/include/linux/netfilter/xt_tcpmss.h9
-rw-r--r--sysroot/usr/include/linux/netfilter/xt_tcpudp.h36
-rw-r--r--sysroot/usr/include/linux/netfilter_arp.h19
-rw-r--r--sysroot/usr/include/linux/netfilter_arp/arp_tables.h231
-rw-r--r--sysroot/usr/include/linux/netfilter_arp/arpt_mangle.h26
-rw-r--r--sysroot/usr/include/linux/netfilter_bridge.h27
-rw-r--r--sysroot/usr/include/linux/netfilter_bridge/ebt_802_3.h61
-rw-r--r--sysroot/usr/include/linux/netfilter_bridge/ebt_among.h65
-rw-r--r--sysroot/usr/include/linux/netfilter_bridge/ebt_arp.h34
-rw-r--r--sysroot/usr/include/linux/netfilter_bridge/ebt_arpreply.h11
-rw-r--r--sysroot/usr/include/linux/netfilter_bridge/ebt_ip.h43
-rw-r--r--sysroot/usr/include/linux/netfilter_bridge/ebt_limit.h23
-rw-r--r--sysroot/usr/include/linux/netfilter_bridge/ebt_log.h18
-rw-r--r--sysroot/usr/include/linux/netfilter_bridge/ebt_mark_m.h15
-rw-r--r--sysroot/usr/include/linux/netfilter_bridge/ebt_mark_t.h24
-rw-r--r--sysroot/usr/include/linux/netfilter_bridge/ebt_nat.h14
-rw-r--r--sysroot/usr/include/linux/netfilter_bridge/ebt_pkttype.h11
-rw-r--r--sysroot/usr/include/linux/netfilter_bridge/ebt_redirect.h11
-rw-r--r--sysroot/usr/include/linux/netfilter_bridge/ebt_stp.h46
-rw-r--r--sysroot/usr/include/linux/netfilter_bridge/ebt_ulog.h36
-rw-r--r--sysroot/usr/include/linux/netfilter_bridge/ebt_vlan.h20
-rw-r--r--sysroot/usr/include/linux/netfilter_bridge/ebtables.h272
-rw-r--r--sysroot/usr/include/linux/netfilter_decnet.h72
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4.h76
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ip_queue.h64
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ip_tables.h282
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_CLASSIFY.h7
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_CLUSTERIP.h33
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_CONNMARK.h19
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_DSCP.h18
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_ECN.h31
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_LOG.h18
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_MARK.h18
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_NFQUEUE.h16
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_REJECT.h20
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_SAME.h19
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_TCPMSS.h9
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_TOS.h12
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_TTL.h21
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_ULOG.h49
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_addrtype.h11
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_ah.h16
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_comment.h10
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_connbytes.h18
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_connmark.h7
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_conntrack.h28
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_dccp.h15
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_dscp.h21
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_ecn.h33
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_esp.h10
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_hashlimit.h14
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_helper.h7
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_iprange.h25
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_length.h7
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_limit.h8
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_mac.h7
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_mark.h9
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_multiport.h15
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_owner.h20
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_physdev.h17
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_pkttype.h7
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_policy.h21
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_realm.h7
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_recent.h27
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_sctp.h105
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_state.h15
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_string.h10
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_tcpmss.h7
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_tos.h13
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv4/ipt_ttl.h21
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv6.h83
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv6/ip6_tables.h323
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv6/ip6t_HL.h22
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv6/ip6t_LOG.h18
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv6/ip6t_MARK.h9
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv6/ip6t_REJECT.h18
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv6/ip6t_ah.h21
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv6/ip6t_esp.h10
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv6/ip6t_frag.h24
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv6/ip6t_hl.h22
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv6/ip6t_ipv6header.h27
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv6/ip6t_length.h8
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv6/ip6t_limit.h8
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv6/ip6t_mac.h7
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv6/ip6t_mark.h9
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv6/ip6t_mh.h15
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv6/ip6t_multiport.h14
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv6/ip6t_opts.h23
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv6/ip6t_owner.h18
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv6/ip6t_physdev.h17
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv6/ip6t_policy.h21
-rw-r--r--sysroot/usr/include/linux/netfilter_ipv6/ip6t_rt.h33
-rw-r--r--sysroot/usr/include/linux/netlink.h153
-rw-r--r--sysroot/usr/include/linux/netrom.h34
-rw-r--r--sysroot/usr/include/linux/nfs.h129
-rw-r--r--sysroot/usr/include/linux/nfs2.h74
-rw-r--r--sysroot/usr/include/linux/nfs3.h105
-rw-r--r--sysroot/usr/include/linux/nfs4.h107
-rw-r--r--sysroot/usr/include/linux/nfs4_mount.h71
-rw-r--r--sysroot/usr/include/linux/nfs_fs.h48
-rw-r--r--sysroot/usr/include/linux/nfs_idmap.h63
-rw-r--r--sysroot/usr/include/linux/nfs_mount.h68
-rw-r--r--sysroot/usr/include/linux/nfsacl.h29
-rw-r--r--sysroot/usr/include/linux/nfsd/auth.h13
-rw-r--r--sysroot/usr/include/linux/nfsd/const.h30
-rw-r--r--sysroot/usr/include/linux/nfsd/debug.h40
-rw-r--r--sysroot/usr/include/linux/nfsd/export.h47
-rw-r--r--sysroot/usr/include/linux/nfsd/nfsfh.h116
-rw-r--r--sysroot/usr/include/linux/nfsd/stats.h41
-rw-r--r--sysroot/usr/include/linux/nfsd/syscall.h110
-rw-r--r--sysroot/usr/include/linux/nl80211.h129
-rw-r--r--sysroot/usr/include/linux/nubus.h355
-rw-r--r--sysroot/usr/include/linux/nvram.h16
-rw-r--r--sysroot/usr/include/linux/oom.h10
-rw-r--r--sysroot/usr/include/linux/param.h6
-rw-r--r--sysroot/usr/include/linux/parport.h97
-rw-r--r--sysroot/usr/include/linux/patchkey.h33
-rw-r--r--sysroot/usr/include/linux/pci.h42
-rw-r--r--sysroot/usr/include/linux/pci_regs.h530
-rw-r--r--sysroot/usr/include/linux/personality.h65
-rw-r--r--sysroot/usr/include/linux/pfkeyv2.h351
-rw-r--r--sysroot/usr/include/linux/pg.h63
-rw-r--r--sysroot/usr/include/linux/phantom.h46
-rw-r--r--sysroot/usr/include/linux/pkt_cls.h426
-rw-r--r--sysroot/usr/include/linux/pkt_sched.h478
-rw-r--r--sysroot/usr/include/linux/pktcdvd.h111
-rw-r--r--sysroot/usr/include/linux/pmu.h135
-rw-r--r--sysroot/usr/include/linux/poll.h7
-rw-r--r--sysroot/usr/include/linux/posix_types.h49
-rw-r--r--sysroot/usr/include/linux/ppdev.h99
-rw-r--r--sysroot/usr/include/linux/ppp-comp.h212
-rw-r--r--sysroot/usr/include/linux/ppp_defs.h180
-rw-r--r--sysroot/usr/include/linux/prctl.h66
-rw-r--r--sysroot/usr/include/linux/ps2esdi.h98
-rw-r--r--sysroot/usr/include/linux/ptrace.h52
-rw-r--r--sysroot/usr/include/linux/qnx4_fs.h91
-rw-r--r--sysroot/usr/include/linux/qnxtypes.h29
-rw-r--r--sysroot/usr/include/linux/quota.h169
-rw-r--r--sysroot/usr/include/linux/quotaio_v1.h33
-rw-r--r--sysroot/usr/include/linux/quotaio_v2.h79
-rw-r--r--sysroot/usr/include/linux/radeonfb.h15
-rw-r--r--sysroot/usr/include/linux/raid/md_p.h276
-rw-r--r--sysroot/usr/include/linux/raid/md_u.h124
-rw-r--r--sysroot/usr/include/linux/random.h44
-rw-r--r--sysroot/usr/include/linux/raw.h18
-rw-r--r--sysroot/usr/include/linux/reboot.h39
-rw-r--r--sysroot/usr/include/linux/reiserfs_fs.h2192
-rw-r--r--sysroot/usr/include/linux/reiserfs_xattr.h19
-rw-r--r--sysroot/usr/include/linux/resource.h74
-rw-r--r--sysroot/usr/include/linux/romfs_fs.h56
-rw-r--r--sysroot/usr/include/linux/rose.h87
-rw-r--r--sysroot/usr/include/linux/route.h67
-rw-r--r--sysroot/usr/include/linux/rtc.h101
-rw-r--r--sysroot/usr/include/linux/rtnetlink.h594
-rw-r--r--sysroot/usr/include/linux/scc.h172
-rw-r--r--sysroot/usr/include/linux/sched.h42
-rw-r--r--sysroot/usr/include/linux/screen_info.h69
-rw-r--r--sysroot/usr/include/linux/sdla.h119
-rw-r--r--sysroot/usr/include/linux/selinux_netlink.h46
-rw-r--r--sysroot/usr/include/linux/sem.h80
-rw-r--r--sysroot/usr/include/linux/serial.h157
-rw-r--r--sysroot/usr/include/linux/serial_core.h154
-rw-r--r--sysroot/usr/include/linux/serial_reg.h328
-rw-r--r--sysroot/usr/include/linux/serio.h72
-rw-r--r--sysroot/usr/include/linux/shm.h75
-rw-r--r--sysroot/usr/include/linux/signal.h8
-rw-r--r--sysroot/usr/include/linux/signalfd.h45
-rw-r--r--sysroot/usr/include/linux/smb.h64
-rw-r--r--sysroot/usr/include/linux/smb_fs.h25
-rw-r--r--sysroot/usr/include/linux/smb_mount.h27
-rw-r--r--sysroot/usr/include/linux/smbno.h363
-rw-r--r--sysroot/usr/include/linux/snmp.h220
-rw-r--r--sysroot/usr/include/linux/socket.h297
-rw-r--r--sysroot/usr/include/linux/sockios.h143
-rw-r--r--sysroot/usr/include/linux/som.h154
-rw-r--r--sysroot/usr/include/linux/sonet.h60
-rw-r--r--sysroot/usr/include/linux/sonypi.h133
-rw-r--r--sysroot/usr/include/linux/sound.h42
-rw-r--r--sysroot/usr/include/linux/soundcard.h1306
-rw-r--r--sysroot/usr/include/linux/spi/spidev.h128
-rw-r--r--sysroot/usr/include/linux/stat.h45
-rw-r--r--sysroot/usr/include/linux/stddef.h13
-rw-r--r--sysroot/usr/include/linux/string.h7
-rw-r--r--sysroot/usr/include/linux/sunrpc/debug.h48
-rw-r--r--sysroot/usr/include/linux/synclink.h295
-rw-r--r--sysroot/usr/include/linux/sysctl.h940
-rw-r--r--sysroot/usr/include/linux/taskstats.h206
-rw-r--r--sysroot/usr/include/linux/tc_act/tc_gact.h34
-rw-r--r--sysroot/usr/include/linux/tc_act/tc_ipt.h21
-rw-r--r--sysroot/usr/include/linux/tc_act/tc_mirred.h28
-rw-r--r--sysroot/usr/include/linux/tc_act/tc_nat.h29
-rw-r--r--sysroot/usr/include/linux/tc_act/tc_pedit.h36
-rw-r--r--sysroot/usr/include/linux/tc_ematch/tc_em_cmp.h26
-rw-r--r--sysroot/usr/include/linux/tc_ematch/tc_em_meta.h94
-rw-r--r--sysroot/usr/include/linux/tc_ematch/tc_em_nbyte.h13
-rw-r--r--sysroot/usr/include/linux/tc_ematch/tc_em_text.h19
-rw-r--r--sysroot/usr/include/linux/tcp.h174
-rw-r--r--sysroot/usr/include/linux/telephony.h266
-rw-r--r--sysroot/usr/include/linux/termios.h7
-rw-r--r--sysroot/usr/include/linux/time.h73
-rw-r--r--sysroot/usr/include/linux/times.h13
-rw-r--r--sysroot/usr/include/linux/timex.h187
-rw-r--r--sysroot/usr/include/linux/tiocl.h39
-rw-r--r--sysroot/usr/include/linux/tipc.h213
-rw-r--r--sysroot/usr/include/linux/tipc_config.h410
-rw-r--r--sysroot/usr/include/linux/toshiba.h38
-rw-r--r--sysroot/usr/include/linux/tty.h8
-rw-r--r--sysroot/usr/include/linux/types.h172
-rw-r--r--sysroot/usr/include/linux/udf_fs_i.h24
-rw-r--r--sysroot/usr/include/linux/udp.h40
-rw-r--r--sysroot/usr/include/linux/ufs_fs.h946
-rw-r--r--sysroot/usr/include/linux/uinput.h136
-rw-r--r--sysroot/usr/include/linux/uio.h48
-rw-r--r--sysroot/usr/include/linux/ultrasound.h103
-rw-r--r--sysroot/usr/include/linux/un.h11
-rw-r--r--sysroot/usr/include/linux/unistd.h9
-rw-r--r--sysroot/usr/include/linux/usb/audio.h53
-rw-r--r--sysroot/usr/include/linux/usb/cdc.h223
-rw-r--r--sysroot/usr/include/linux/usb/ch9.h580
-rw-r--r--sysroot/usr/include/linux/usb/gadgetfs.h81
-rw-r--r--sysroot/usr/include/linux/usb/midi.h112
-rw-r--r--sysroot/usr/include/linux/usbdevice_fs.h151
-rw-r--r--sysroot/usr/include/linux/user.h1
-rw-r--r--sysroot/usr/include/linux/utime.h11
-rw-r--r--sysroot/usr/include/linux/utsname.h34
-rw-r--r--sysroot/usr/include/linux/version.h2
-rw-r--r--sysroot/usr/include/linux/veth.h12
-rw-r--r--sysroot/usr/include/linux/video_decoder.h46
-rw-r--r--sysroot/usr/include/linux/video_encoder.h21
-rw-r--r--sysroot/usr/include/linux/videodev.h305
-rw-r--r--sysroot/usr/include/linux/videodev2.h1412
-rw-r--r--sysroot/usr/include/linux/videotext.h125
-rw-r--r--sysroot/usr/include/linux/virtio_blk.h53
-rw-r--r--sysroot/usr/include/linux/virtio_config.h18
-rw-r--r--sysroot/usr/include/linux/virtio_net.h36
-rw-r--r--sysroot/usr/include/linux/vt.h77
-rw-r--r--sysroot/usr/include/linux/wait.h21
-rw-r--r--sysroot/usr/include/linux/wanrouter.h452
-rw-r--r--sysroot/usr/include/linux/watchdog.h55
-rw-r--r--sysroot/usr/include/linux/wireless.h1111
-rw-r--r--sysroot/usr/include/linux/x25.h150
-rw-r--r--sysroot/usr/include/linux/xattr.h17
-rw-r--r--sysroot/usr/include/linux/xfrm.h445
-rw-r--r--sysroot/usr/include/locale.h210
-rw-r--r--sysroot/usr/include/malloc.h174
-rw-r--r--sysroot/usr/include/math.h468
-rw-r--r--sysroot/usr/include/mcheck.h62
-rw-r--r--sysroot/usr/include/memory.h34
-rw-r--r--sysroot/usr/include/menu.h256
-rw-r--r--sysroot/usr/include/mntent.h98
-rw-r--r--sysroot/usr/include/monetary.h60
-rw-r--r--sysroot/usr/include/mqueue.h101
-rw-r--r--sysroot/usr/include/nc_tparm.h65
l---------sysroot/usr/include/ncurses.h1
-rw-r--r--sysroot/usr/include/ncurses_dll.h86
-rw-r--r--sysroot/usr/include/net/ethernet.h76
-rw-r--r--sysroot/usr/include/net/if.h205
-rw-r--r--sysroot/usr/include/net/if_arp.h182
-rw-r--r--sysroot/usr/include/net/if_packet.h37
-rw-r--r--sysroot/usr/include/net/if_ppp.h169
-rw-r--r--sysroot/usr/include/net/if_shaper.h59
-rw-r--r--sysroot/usr/include/net/if_slip.h25
-rw-r--r--sysroot/usr/include/net/ppp-comp.h1
-rw-r--r--sysroot/usr/include/net/ppp_defs.h10
-rw-r--r--sysroot/usr/include/net/route.h145
-rw-r--r--sysroot/usr/include/netash/ash.h40
-rw-r--r--sysroot/usr/include/netatalk/at.h30
-rw-r--r--sysroot/usr/include/netax25/ax25.h171
-rw-r--r--sysroot/usr/include/netdb.h684
-rw-r--r--sysroot/usr/include/neteconet/ec.h52
-rw-r--r--sysroot/usr/include/netinet/ether.h54
-rw-r--r--sysroot/usr/include/netinet/icmp6.h346
-rw-r--r--sysroot/usr/include/netinet/if_ether.h105
-rw-r--r--sysroot/usr/include/netinet/if_fddi.h38
-rw-r--r--sysroot/usr/include/netinet/if_tr.h111
-rw-r--r--sysroot/usr/include/netinet/igmp.h126
-rw-r--r--sysroot/usr/include/netinet/in.h551
-rw-r--r--sysroot/usr/include/netinet/in_systm.h41
-rw-r--r--sysroot/usr/include/netinet/ip.h249
-rw-r--r--sysroot/usr/include/netinet/ip6.h189
-rw-r--r--sysroot/usr/include/netinet/ip_icmp.h283
-rw-r--r--sysroot/usr/include/netinet/tcp.h246
-rw-r--r--sysroot/usr/include/netinet/udp.h79
-rw-r--r--sysroot/usr/include/netipx/ipx.h113
-rw-r--r--sysroot/usr/include/netpacket/packet.h64
-rw-r--r--sysroot/usr/include/netrom/netrom.h84
-rw-r--r--sysroot/usr/include/netrose/rose.h116
-rw-r--r--sysroot/usr/include/nfs/nfs.h1
-rw-r--r--sysroot/usr/include/nl_types.h55
-rw-r--r--sysroot/usr/include/nss.h52
-rw-r--r--sysroot/usr/include/obstack.h509
-rw-r--r--sysroot/usr/include/panel.h77
-rw-r--r--sysroot/usr/include/paths.h74
-rw-r--r--sysroot/usr/include/poll.h1
-rw-r--r--sysroot/usr/include/printf.h149
-rw-r--r--sysroot/usr/include/protocols/routed.h101
-rw-r--r--sysroot/usr/include/protocols/rwhod.h67
-rw-r--r--sysroot/usr/include/protocols/talkd.h113
-rw-r--r--sysroot/usr/include/protocols/timed.h97
-rw-r--r--sysroot/usr/include/pthread.h1119
-rw-r--r--sysroot/usr/include/pty.h44
-rw-r--r--sysroot/usr/include/pulse/browser.h100
-rw-r--r--sysroot/usr/include/pulse/cdecl.h62
-rw-r--r--sysroot/usr/include/pulse/channelmap.h197
-rw-r--r--sysroot/usr/include/pulse/context.h233
-rw-r--r--sysroot/usr/include/pulse/def.h397
-rw-r--r--sysroot/usr/include/pulse/error.h41
-rw-r--r--sysroot/usr/include/pulse/glib-mainloop.h65
-rw-r--r--sysroot/usr/include/pulse/introspect.h520
-rw-r--r--sysroot/usr/include/pulse/mainloop-api.h124
-rw-r--r--sysroot/usr/include/pulse/mainloop-signal.h62
-rw-r--r--sysroot/usr/include/pulse/mainloop.h130
-rw-r--r--sysroot/usr/include/pulse/operation.h52
-rw-r--r--sysroot/usr/include/pulse/pulseaudio.h117
-rw-r--r--sysroot/usr/include/pulse/sample.h216
-rw-r--r--sysroot/usr/include/pulse/scache.h103
-rw-r--r--sysroot/usr/include/pulse/simple.h149
-rw-r--r--sysroot/usr/include/pulse/stream.h515
-rw-r--r--sysroot/usr/include/pulse/subscribe.h64
-rw-r--r--sysroot/usr/include/pulse/thread-mainloop.h305
-rw-r--r--sysroot/usr/include/pulse/timeval.h67
-rw-r--r--sysroot/usr/include/pulse/utf8.h50
-rw-r--r--sysroot/usr/include/pulse/util.h62
-rw-r--r--sysroot/usr/include/pulse/version.h56
-rw-r--r--sysroot/usr/include/pulse/volume.h175
-rw-r--r--sysroot/usr/include/pulse/xmalloc.h89
-rw-r--r--sysroot/usr/include/pwd.h186
-rw-r--r--sysroot/usr/include/re_comp.h26
-rw-r--r--sysroot/usr/include/regex.h556
-rw-r--r--sysroot/usr/include/regexp.h222
-rw-r--r--sysroot/usr/include/resolv.h383
-rw-r--r--sysroot/usr/include/rpc/auth.h213
-rw-r--r--sysroot/usr/include/rpc/auth_des.h112
-rw-r--r--sysroot/usr/include/rpc/auth_unix.h90
-rw-r--r--sysroot/usr/include/rpc/clnt.h421
-rw-r--r--sysroot/usr/include/rpc/des_crypt.h97
-rw-r--r--sysroot/usr/include/rpc/key_prot.h346
-rw-r--r--sysroot/usr/include/rpc/netdb.h74
-rw-r--r--sysroot/usr/include/rpc/pmap_clnt.h98
-rw-r--r--sysroot/usr/include/rpc/pmap_prot.h108
-rw-r--r--sysroot/usr/include/rpc/pmap_rmt.h68
-rw-r--r--sysroot/usr/include/rpc/rpc.h97
-rw-r--r--sysroot/usr/include/rpc/rpc_des.h72
-rw-r--r--sysroot/usr/include/rpc/rpc_msg.h202
-rw-r--r--sysroot/usr/include/rpc/svc.h316
-rw-r--r--sysroot/usr/include/rpc/svc_auth.h54
-rw-r--r--sysroot/usr/include/rpc/types.h99
-rw-r--r--sysroot/usr/include/rpc/xdr.h379
-rw-r--r--sysroot/usr/include/rpcsvc/bootparam.h25
-rw-r--r--sysroot/usr/include/rpcsvc/bootparam_prot.h124
-rw-r--r--sysroot/usr/include/rpcsvc/bootparam_prot.x97
-rw-r--r--sysroot/usr/include/rpcsvc/key_prot.h264
-rw-r--r--sysroot/usr/include/rpcsvc/key_prot.x286
-rw-r--r--sysroot/usr/include/rpcsvc/klm_prot.h136
-rw-r--r--sysroot/usr/include/rpcsvc/klm_prot.x134
-rw-r--r--sysroot/usr/include/rpcsvc/mount.h144
-rw-r--r--sysroot/usr/include/rpcsvc/mount.x161
-rw-r--r--sysroot/usr/include/rpcsvc/nfs_prot.h450
-rw-r--r--sysroot/usr/include/rpcsvc/nfs_prot.x354
-rw-r--r--sysroot/usr/include/rpcsvc/nis.h615
-rw-r--r--sysroot/usr/include/rpcsvc/nis.x473
-rw-r--r--sysroot/usr/include/rpcsvc/nis_callback.h71
-rw-r--r--sysroot/usr/include/rpcsvc/nis_callback.x65
-rw-r--r--sysroot/usr/include/rpcsvc/nis_object.x302
-rw-r--r--sysroot/usr/include/rpcsvc/nis_tags.h102
-rw-r--r--sysroot/usr/include/rpcsvc/nislib.h287
-rw-r--r--sysroot/usr/include/rpcsvc/nlm_prot.h330
-rw-r--r--sysroot/usr/include/rpcsvc/nlm_prot.x179
-rw-r--r--sysroot/usr/include/rpcsvc/rex.h227
-rw-r--r--sysroot/usr/include/rpcsvc/rex.x229
-rw-r--r--sysroot/usr/include/rpcsvc/rquota.h95
-rw-r--r--sysroot/usr/include/rpcsvc/rquota.x61
-rw-r--r--sysroot/usr/include/rpcsvc/rstat.h162
-rw-r--r--sysroot/usr/include/rpcsvc/rstat.x145
-rw-r--r--sysroot/usr/include/rpcsvc/rusers.h147
-rw-r--r--sysroot/usr/include/rpcsvc/rusers.x240
-rw-r--r--sysroot/usr/include/rpcsvc/sm_inter.h135
-rw-r--r--sysroot/usr/include/rpcsvc/sm_inter.x116
-rw-r--r--sysroot/usr/include/rpcsvc/spray.h81
-rw-r--r--sysroot/usr/include/rpcsvc/spray.x84
-rw-r--r--sysroot/usr/include/rpcsvc/yp.h337
-rw-r--r--sysroot/usr/include/rpcsvc/yp.x309
-rw-r--r--sysroot/usr/include/rpcsvc/yp_prot.h366
-rw-r--r--sysroot/usr/include/rpcsvc/ypclnt.h89
-rw-r--r--sysroot/usr/include/rpcsvc/yppasswd.h66
-rw-r--r--sysroot/usr/include/rpcsvc/yppasswd.x63
-rw-r--r--sysroot/usr/include/rpcsvc/ypupd.h90
-rw-r--r--sysroot/usr/include/sched.h120
-rw-r--r--sysroot/usr/include/scsi/scsi.h226
-rw-r--r--sysroot/usr/include/scsi/scsi_ioctl.h34
-rw-r--r--sysroot/usr/include/scsi/sg.h275
-rw-r--r--sysroot/usr/include/search.h175
-rw-r--r--sysroot/usr/include/semaphore.h79
-rw-r--r--sysroot/usr/include/setjmp.h116
-rw-r--r--sysroot/usr/include/sgtty.h41
-rw-r--r--sysroot/usr/include/shadow.h149
-rw-r--r--sysroot/usr/include/signal.h404
-rw-r--r--sysroot/usr/include/spawn.h190
-rw-r--r--sysroot/usr/include/stab.h17
-rw-r--r--sysroot/usr/include/stdint.h320
-rw-r--r--sysroot/usr/include/stdio.h916
-rw-r--r--sysroot/usr/include/stdio_ext.h87
-rw-r--r--sysroot/usr/include/stdlib.h885
-rw-r--r--sysroot/usr/include/string.h434
-rw-r--r--sysroot/usr/include/strings.h65
-rw-r--r--sysroot/usr/include/stropts.h92
-rw-r--r--sysroot/usr/include/sys/acct.h109
-rw-r--r--sysroot/usr/include/sys/asoundlib.h2
-rw-r--r--sysroot/usr/include/sys/bitypes.h3
-rw-r--r--sysroot/usr/include/sys/cdefs.h382
-rw-r--r--sysroot/usr/include/sys/debugreg.h88
-rw-r--r--sysroot/usr/include/sys/dir.h28
-rw-r--r--sysroot/usr/include/sys/elf.h26
-rw-r--r--sysroot/usr/include/sys/epoll.h130
-rw-r--r--sysroot/usr/include/sys/errno.h1
-rw-r--r--sysroot/usr/include/sys/fcntl.h1
-rw-r--r--sysroot/usr/include/sys/file.h56
-rw-r--r--sysroot/usr/include/sys/fsuid.h36
-rw-r--r--sysroot/usr/include/sys/gmon.h201
-rw-r--r--sysroot/usr/include/sys/gmon_out.h80
-rw-r--r--sysroot/usr/include/sys/inotify.h92
-rw-r--r--sysroot/usr/include/sys/io.h181
-rw-r--r--sysroot/usr/include/sys/ioctl.h46
-rw-r--r--sysroot/usr/include/sys/ipc.h59
-rw-r--r--sysroot/usr/include/sys/kd.h35
-rw-r--r--sysroot/usr/include/sys/kdaemon.h33
-rw-r--r--sysroot/usr/include/sys/klog.h34
-rw-r--r--sysroot/usr/include/sys/mman.h152
-rw-r--r--sysroot/usr/include/sys/mount.h119
-rw-r--r--sysroot/usr/include/sys/msg.h85
-rw-r--r--sysroot/usr/include/sys/mtio.h277
-rw-r--r--sysroot/usr/include/sys/param.h72
-rw-r--r--sysroot/usr/include/sys/pci.h25
-rw-r--r--sysroot/usr/include/sys/perm.h36
-rw-r--r--sysroot/usr/include/sys/personality.h76
-rw-r--r--sysroot/usr/include/sys/poll.h74
-rw-r--r--sysroot/usr/include/sys/prctl.h32
-rw-r--r--sysroot/usr/include/sys/procfs.h142
-rw-r--r--sysroot/usr/include/sys/profil.h61
-rw-r--r--sysroot/usr/include/sys/ptrace.h168
-rw-r--r--sysroot/usr/include/sys/queue.h557
-rw-r--r--sysroot/usr/include/sys/quota.h225
-rw-r--r--sysroot/usr/include/sys/raw.h39
-rw-r--r--sysroot/usr/include/sys/reboot.h49
-rw-r--r--sysroot/usr/include/sys/reg.h79
-rw-r--r--sysroot/usr/include/sys/resource.h103
-rw-r--r--sysroot/usr/include/sys/select.h130
-rw-r--r--sysroot/usr/include/sys/sem.h69
-rw-r--r--sysroot/usr/include/sys/sendfile.h52
-rw-r--r--sysroot/usr/include/sys/shm.h65
-rw-r--r--sysroot/usr/include/sys/signal.h1
-rw-r--r--sysroot/usr/include/sys/socket.h243
-rw-r--r--sysroot/usr/include/sys/socketvar.h3
-rw-r--r--sysroot/usr/include/sys/soundcard.h1
-rw-r--r--sysroot/usr/include/sys/stat.h535
-rw-r--r--sysroot/usr/include/sys/statfs.h68
-rw-r--r--sysroot/usr/include/sys/statvfs.h91
-rw-r--r--sysroot/usr/include/sys/stropts.h1
-rw-r--r--sysroot/usr/include/sys/swap.h43
-rw-r--r--sysroot/usr/include/sys/syscall.h35
-rw-r--r--sysroot/usr/include/sys/sysctl.h72
-rw-r--r--sysroot/usr/include/sys/sysinfo.h48
-rw-r--r--sysroot/usr/include/sys/syslog.h215
-rw-r--r--sysroot/usr/include/sys/sysmacros.h70
-rw-r--r--sysroot/usr/include/sys/termios.h4
-rw-r--r--sysroot/usr/include/sys/time.h193
-rw-r--r--sysroot/usr/include/sys/timeb.h46
-rw-r--r--sysroot/usr/include/sys/times.h53
-rw-r--r--sysroot/usr/include/sys/timex.h127
-rw-r--r--sysroot/usr/include/sys/ttychars.h61
-rw-r--r--sysroot/usr/include/sys/ttydefaults.h100
-rw-r--r--sysroot/usr/include/sys/types.h275
-rw-r--r--sysroot/usr/include/sys/ucontext.h248
-rw-r--r--sysroot/usr/include/sys/uio.h54
-rw-r--r--sysroot/usr/include/sys/ultrasound.h1
-rw-r--r--sysroot/usr/include/sys/un.h47
-rw-r--r--sysroot/usr/include/sys/unistd.h1
-rw-r--r--sysroot/usr/include/sys/user.h175
-rw-r--r--sysroot/usr/include/sys/ustat.h38
-rw-r--r--sysroot/usr/include/sys/utsname.h87
-rw-r--r--sysroot/usr/include/sys/vfs.h4
-rw-r--r--sysroot/usr/include/sys/vlimit.h68
-rw-r--r--sysroot/usr/include/sys/vm86.h35
-rw-r--r--sysroot/usr/include/sys/vt.h1
-rw-r--r--sysroot/usr/include/sys/vtimes.h69
-rw-r--r--sysroot/usr/include/sys/wait.h182
-rw-r--r--sysroot/usr/include/sys/xattr.h104
-rw-r--r--sysroot/usr/include/syscall.h1
-rw-r--r--sysroot/usr/include/sysexits.h114
-rw-r--r--sysroot/usr/include/syslog.h1
-rw-r--r--sysroot/usr/include/tar.h108
-rw-r--r--sysroot/usr/include/term.h790
-rw-r--r--sysroot/usr/include/term_entry.h168
-rw-r--r--sysroot/usr/include/termcap.h75
-rw-r--r--sysroot/usr/include/termio.h6
-rw-r--r--sysroot/usr/include/termios.h110
-rw-r--r--sysroot/usr/include/tgmath.h449
-rw-r--r--sysroot/usr/include/thread_db.h459
-rw-r--r--sysroot/usr/include/tic.h332
-rw-r--r--sysroot/usr/include/time.h420
-rw-r--r--sysroot/usr/include/ttyent.h65
-rw-r--r--sysroot/usr/include/ucontext.h53
-rw-r--r--sysroot/usr/include/ulimit.h48
-rw-r--r--sysroot/usr/include/unctrl.h63
-rw-r--r--sysroot/usr/include/unistd.h1105
-rw-r--r--sysroot/usr/include/ustat.h1
-rw-r--r--sysroot/usr/include/utime.h52
-rw-r--r--sysroot/usr/include/utmp.h97
-rw-r--r--sysroot/usr/include/utmpx.h127
-rw-r--r--sysroot/usr/include/values.h69
-rw-r--r--sysroot/usr/include/wait.h1
-rw-r--r--sysroot/usr/include/wchar.h847
-rw-r--r--sysroot/usr/include/wctype.h319
-rw-r--r--sysroot/usr/include/wordexp.h71
-rw-r--r--sysroot/usr/include/xlocale.h42
-rw-r--r--sysroot/usr/include/zconf.h394
-rw-r--r--sysroot/usr/include/zlib.h1399
-rw-r--r--sysroot/usr/include/zlibdefs.h13
-rw-r--r--sysroot/usr/lib/Mcrt1.obin0 -> 850 bytes
-rw-r--r--sysroot/usr/lib/Scrt1.obin0 -> 2450 bytes
-rw-r--r--sysroot/usr/lib/crt1.obin0 -> 2384 bytes
-rw-r--r--sysroot/usr/lib/crti.obin0 -> 2052 bytes
-rw-r--r--sysroot/usr/lib/crtn.obin0 -> 1760 bytes
l---------sysroot/usr/lib/esound/libesddsp.so.01
-rw-r--r--sysroot/usr/lib/esound/libesddsp.so.0.2.38bin0 -> 9916 bytes
-rw-r--r--sysroot/usr/lib/gconv/ANSI_X3.110.sobin0 -> 17672 bytes
-rw-r--r--sysroot/usr/lib/gconv/ARMSCII-8.sobin0 -> 9480 bytes
-rw-r--r--sysroot/usr/lib/gconv/ASMO_449.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/BIG5.sobin0 -> 83200 bytes
-rw-r--r--sysroot/usr/lib/gconv/BIG5HKSCS.sobin0 -> 222472 bytes
-rw-r--r--sysroot/usr/lib/gconv/BRF.sobin0 -> 9472 bytes
-rw-r--r--sysroot/usr/lib/gconv/CP10007.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/CP1125.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/CP1250.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/CP1251.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/CP1252.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/CP1253.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/CP1254.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/CP1255.sobin0 -> 13572 bytes
-rw-r--r--sysroot/usr/lib/gconv/CP1256.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/CP1257.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/CP1258.sobin0 -> 13576 bytes
-rw-r--r--sysroot/usr/lib/gconv/CP737.sobin0 -> 9668 bytes
-rw-r--r--sysroot/usr/lib/gconv/CP775.sobin0 -> 9692 bytes
-rw-r--r--sysroot/usr/lib/gconv/CP932.sobin0 -> 95492 bytes
-rw-r--r--sysroot/usr/lib/gconv/CSN_369103.sobin0 -> 9480 bytes
-rw-r--r--sysroot/usr/lib/gconv/CWI.sobin0 -> 9472 bytes
-rw-r--r--sysroot/usr/lib/gconv/DEC-MCS.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/EBCDIC-AT-DE-A.sobin0 -> 9484 bytes
-rw-r--r--sysroot/usr/lib/gconv/EBCDIC-AT-DE.sobin0 -> 9480 bytes
-rw-r--r--sysroot/usr/lib/gconv/EBCDIC-CA-FR.sobin0 -> 9480 bytes
-rw-r--r--sysroot/usr/lib/gconv/EBCDIC-DK-NO-A.sobin0 -> 9484 bytes
-rw-r--r--sysroot/usr/lib/gconv/EBCDIC-DK-NO.sobin0 -> 9480 bytes
-rw-r--r--sysroot/usr/lib/gconv/EBCDIC-ES-A.sobin0 -> 17672 bytes
-rw-r--r--sysroot/usr/lib/gconv/EBCDIC-ES-S.sobin0 -> 9480 bytes
-rw-r--r--sysroot/usr/lib/gconv/EBCDIC-ES.sobin0 -> 17672 bytes
-rw-r--r--sysroot/usr/lib/gconv/EBCDIC-FI-SE-A.sobin0 -> 9484 bytes
-rw-r--r--sysroot/usr/lib/gconv/EBCDIC-FI-SE.sobin0 -> 9480 bytes
-rw-r--r--sysroot/usr/lib/gconv/EBCDIC-FR.sobin0 -> 9480 bytes
-rw-r--r--sysroot/usr/lib/gconv/EBCDIC-IS-FRISS.sobin0 -> 17676 bytes
-rw-r--r--sysroot/usr/lib/gconv/EBCDIC-IT.sobin0 -> 9480 bytes
-rw-r--r--sysroot/usr/lib/gconv/EBCDIC-PT.sobin0 -> 9480 bytes
-rw-r--r--sysroot/usr/lib/gconv/EBCDIC-UK.sobin0 -> 17672 bytes
-rw-r--r--sysroot/usr/lib/gconv/EBCDIC-US.sobin0 -> 9480 bytes
-rw-r--r--sysroot/usr/lib/gconv/ECMA-CYRILLIC.sobin0 -> 9484 bytes
-rw-r--r--sysroot/usr/lib/gconv/EUC-CN.sobin0 -> 13572 bytes
-rw-r--r--sysroot/usr/lib/gconv/EUC-JISX0213.sobin0 -> 13576 bytes
-rw-r--r--sysroot/usr/lib/gconv/EUC-JP-MS.sobin0 -> 83208 bytes
-rw-r--r--sysroot/usr/lib/gconv/EUC-JP.sobin0 -> 13572 bytes
-rw-r--r--sysroot/usr/lib/gconv/EUC-KR.sobin0 -> 13572 bytes
-rw-r--r--sysroot/usr/lib/gconv/EUC-TW.sobin0 -> 21764 bytes
-rw-r--r--sysroot/usr/lib/gconv/GB18030.sobin0 -> 214276 bytes
-rw-r--r--sysroot/usr/lib/gconv/GBBIG5.sobin0 -> 54532 bytes
-rw-r--r--sysroot/usr/lib/gconv/GBGBK.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/GBK.sobin0 -> 111872 bytes
-rw-r--r--sysroot/usr/lib/gconv/GEORGIAN-ACADEMY.sobin0 -> 9484 bytes
-rw-r--r--sysroot/usr/lib/gconv/GEORGIAN-PS.sobin0 -> 9480 bytes
-rw-r--r--sysroot/usr/lib/gconv/GOST_19768-74.sobin0 -> 9484 bytes
-rw-r--r--sysroot/usr/lib/gconv/GREEK-CCITT.sobin0 -> 9480 bytes
-rw-r--r--sysroot/usr/lib/gconv/GREEK7-OLD.sobin0 -> 9480 bytes
-rw-r--r--sysroot/usr/lib/gconv/GREEK7.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/HP-ROMAN8.sobin0 -> 17672 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM037.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM038.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1004.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1008.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1008_420.sobin0 -> 5384 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1025.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1026.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1046.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1047.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1097.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1112.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1122.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1123.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1124.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1129.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1130.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1132.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1133.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1137.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1140.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1141.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1142.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1143.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1144.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1145.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1146.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1147.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1148.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1149.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1153.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1154.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1155.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1156.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1157.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1158.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1160.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1161.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1162.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1163.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1164.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1166.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1167.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM12712.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1364.sobin0 -> 148740 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1371.sobin0 -> 124164 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1388.sobin0 -> 173316 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1390.sobin0 -> 226564 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM1399.sobin0 -> 226564 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM16804.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM256.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM273.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM274.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM275.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM277.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM278.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM280.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM281.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM284.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM285.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM290.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM297.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM420.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM423.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM424.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM437.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM4517.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM4899.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM4909.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM4971.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM500.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM5347.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM803.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM850.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM851.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM852.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM855.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM856.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM857.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM860.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM861.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM862.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM863.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM864.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM865.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM866.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM866NAV.sobin0 -> 9480 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM868.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM869.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM870.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM871.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM874.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM875.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM880.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM891.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM901.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM902.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM903.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM9030.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM904.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM905.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM9066.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM918.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM921.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM922.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM930.sobin0 -> 99640 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM932.sobin0 -> 66820 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM933.sobin0 -> 116024 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM935.sobin0 -> 83256 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM937.sobin0 -> 111876 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM939.sobin0 -> 99640 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM943.sobin0 -> 66820 bytes
-rw-r--r--sysroot/usr/lib/gconv/IBM9448.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/IEC_P27-1.sobin0 -> 9480 bytes
-rw-r--r--sysroot/usr/lib/gconv/INIS-8.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/INIS-CYRILLIC.sobin0 -> 9484 bytes
-rw-r--r--sysroot/usr/lib/gconv/INIS.sobin0 -> 9472 bytes
-rw-r--r--sysroot/usr/lib/gconv/ISIRI-3342.sobin0 -> 9480 bytes
-rw-r--r--sysroot/usr/lib/gconv/ISO-2022-CN-EXT.sobin0 -> 42256 bytes
-rw-r--r--sysroot/usr/lib/gconv/ISO-2022-CN.sobin0 -> 29960 bytes
-rw-r--r--sysroot/usr/lib/gconv/ISO-2022-JP-3.sobin0 -> 21772 bytes
-rw-r--r--sysroot/usr/lib/gconv/ISO-2022-JP.sobin0 -> 38168 bytes
-rw-r--r--sysroot/usr/lib/gconv/ISO-2022-KR.sobin0 -> 13576 bytes
-rw-r--r--sysroot/usr/lib/gconv/ISO-IR-197.sobin0 -> 9480 bytes
-rw-r--r--sysroot/usr/lib/gconv/ISO-IR-209.sobin0 -> 9480 bytes
-rw-r--r--sysroot/usr/lib/gconv/ISO646.sobin0 -> 21828 bytes
-rw-r--r--sysroot/usr/lib/gconv/ISO8859-1.sobin0 -> 5384 bytes
-rw-r--r--sysroot/usr/lib/gconv/ISO8859-10.sobin0 -> 9480 bytes
-rw-r--r--sysroot/usr/lib/gconv/ISO8859-11.sobin0 -> 9480 bytes
-rw-r--r--sysroot/usr/lib/gconv/ISO8859-13.sobin0 -> 9480 bytes
-rw-r--r--sysroot/usr/lib/gconv/ISO8859-14.sobin0 -> 9480 bytes
-rw-r--r--sysroot/usr/lib/gconv/ISO8859-15.sobin0 -> 9480 bytes
-rw-r--r--sysroot/usr/lib/gconv/ISO8859-16.sobin0 -> 17672 bytes
-rw-r--r--sysroot/usr/lib/gconv/ISO8859-2.sobin0 -> 9480 bytes
-rw-r--r--sysroot/usr/lib/gconv/ISO8859-3.sobin0 -> 9480 bytes
-rw-r--r--sysroot/usr/lib/gconv/ISO8859-4.sobin0 -> 9480 bytes
-rw-r--r--sysroot/usr/lib/gconv/ISO8859-5.sobin0 -> 9480 bytes
-rw-r--r--sysroot/usr/lib/gconv/ISO8859-6.sobin0 -> 9480 bytes
-rw-r--r--sysroot/usr/lib/gconv/ISO8859-7.sobin0 -> 9480 bytes
-rw-r--r--sysroot/usr/lib/gconv/ISO8859-8.sobin0 -> 9480 bytes
-rw-r--r--sysroot/usr/lib/gconv/ISO8859-9.sobin0 -> 9480 bytes
-rw-r--r--sysroot/usr/lib/gconv/ISO8859-9E.sobin0 -> 17672 bytes
-rw-r--r--sysroot/usr/lib/gconv/ISO_10367-BOX.sobin0 -> 9484 bytes
-rw-r--r--sysroot/usr/lib/gconv/ISO_11548-1.sobin0 -> 5384 bytes
-rw-r--r--sysroot/usr/lib/gconv/ISO_2033.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/ISO_5427-EXT.sobin0 -> 9480 bytes
-rw-r--r--sysroot/usr/lib/gconv/ISO_5427.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/ISO_5428.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/ISO_6937-2.sobin0 -> 17672 bytes
-rw-r--r--sysroot/usr/lib/gconv/ISO_6937.sobin0 -> 17668 bytes
-rw-r--r--sysroot/usr/lib/gconv/JOHAB.sobin0 -> 17668 bytes
-rw-r--r--sysroot/usr/lib/gconv/KOI-8.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/KOI8-R.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/KOI8-RU.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/KOI8-T.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/KOI8-U.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/LATIN-GREEK-1.sobin0 -> 9484 bytes
-rw-r--r--sysroot/usr/lib/gconv/LATIN-GREEK.sobin0 -> 9480 bytes
-rw-r--r--sysroot/usr/lib/gconv/MAC-CENTRALEUROPE.sobin0 -> 9488 bytes
-rw-r--r--sysroot/usr/lib/gconv/MAC-IS.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/MAC-SAMI.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/MAC-UK.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/MACINTOSH.sobin0 -> 9480 bytes
-rw-r--r--sysroot/usr/lib/gconv/MIK.sobin0 -> 9472 bytes
-rw-r--r--sysroot/usr/lib/gconv/NATS-DANO.sobin0 -> 9480 bytes
-rw-r--r--sysroot/usr/lib/gconv/NATS-SEFI.sobin0 -> 9480 bytes
-rw-r--r--sysroot/usr/lib/gconv/PT154.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/RK1048.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/SAMI-WS2.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/SHIFT_JISX0213.sobin0 -> 13580 bytes
-rw-r--r--sysroot/usr/lib/gconv/SJIS.sobin0 -> 91392 bytes
-rw-r--r--sysroot/usr/lib/gconv/T.61.sobin0 -> 17664 bytes
-rw-r--r--sysroot/usr/lib/gconv/TCVN5712-1.sobin0 -> 13580 bytes
-rw-r--r--sysroot/usr/lib/gconv/TIS-620.sobin0 -> 9476 bytes
-rw-r--r--sysroot/usr/lib/gconv/TSCII.sobin0 -> 17668 bytes
-rw-r--r--sysroot/usr/lib/gconv/UHC.sobin0 -> 70912 bytes
-rw-r--r--sysroot/usr/lib/gconv/UNICODE.sobin0 -> 9484 bytes
-rw-r--r--sysroot/usr/lib/gconv/UTF-16.sobin0 -> 9488 bytes
-rw-r--r--sysroot/usr/lib/gconv/UTF-32.sobin0 -> 9488 bytes
-rw-r--r--sysroot/usr/lib/gconv/UTF-7.sobin0 -> 17672 bytes
-rw-r--r--sysroot/usr/lib/gconv/VISCII.sobin0 -> 17668 bytes
-rw-r--r--sysroot/usr/lib/gconv/gconv-modules1929
-rw-r--r--sysroot/usr/lib/gconv/libCNS.sobin0 -> 464124 bytes
-rw-r--r--sysroot/usr/lib/gconv/libGB.sobin0 -> 66812 bytes
-rw-r--r--sysroot/usr/lib/gconv/libISOIR165.sobin0 -> 54528 bytes
-rw-r--r--sysroot/usr/lib/gconv/libJIS.sobin0 -> 99580 bytes
-rw-r--r--sysroot/usr/lib/gconv/libJISX0213.sobin0 -> 120064 bytes
-rw-r--r--sysroot/usr/lib/gconv/libKSC.sobin0 -> 46332 bytes
-rw-r--r--sysroot/usr/lib/gcrt1.obin0 -> 4136 bytes
-rwxr-xr-xsysroot/usr/lib/ld-2.7.sobin0 -> 109152 bytes
l---------sysroot/usr/lib/ld-linux.so.21
-rw-r--r--sysroot/usr/lib/libBrokenLocale-2.7.sobin0 -> 5440 bytes
-rw-r--r--sysroot/usr/lib/libBrokenLocale.abin0 -> 1066 bytes
l---------sysroot/usr/lib/libBrokenLocale.so1
l---------sysroot/usr/lib/libBrokenLocale.so.11
l---------sysroot/usr/lib/libGL.so1
l---------sysroot/usr/lib/libGL.so.11
-rw-r--r--sysroot/usr/lib/libGL.so.1.2bin0 -> 394924 bytes
-rw-r--r--sysroot/usr/lib/libSegFault.sobin0 -> 13696 bytes
-rw-r--r--sysroot/usr/lib/libX11.abin0 -> 1487004 bytes
l---------sysroot/usr/lib/libX11.so1
l---------sysroot/usr/lib/libX11.so.61
l---------sysroot/usr/lib/libX11.so.6.21
-rw-r--r--sysroot/usr/lib/libX11.so.6.2.0bin0 -> 944876 bytes
l---------sysroot/usr/lib/libXau.so.61
l---------sysroot/usr/lib/libXau.so.6.01
-rw-r--r--sysroot/usr/lib/libXau.so.6.0.0bin0 -> 6988 bytes
l---------sysroot/usr/lib/libXdamage.so.11
l---------sysroot/usr/lib/libXdamage.so.1.11
-rw-r--r--sysroot/usr/lib/libXdamage.so.1.1.0bin0 -> 5992 bytes
l---------sysroot/usr/lib/libXdmcp.so.61
l---------sysroot/usr/lib/libXdmcp.so.6.01
-rw-r--r--sysroot/usr/lib/libXdmcp.so.6.0.0bin0 -> 16616 bytes
l---------sysroot/usr/lib/libXext.so.61
l---------sysroot/usr/lib/libXext.so.6.41
-rw-r--r--sysroot/usr/lib/libXext.so.6.4.0bin0 -> 56156 bytes
l---------sysroot/usr/lib/libXfixes.so.31
l---------sysroot/usr/lib/libXfixes.so.3.11
-rw-r--r--sysroot/usr/lib/libXfixes.so.3.1.0bin0 -> 14128 bytes
l---------sysroot/usr/lib/libXxf86vm.so.11
l---------sysroot/usr/lib/libXxf86vm.so.1.01
-rw-r--r--sysroot/usr/lib/libXxf86vm.so.1.0.0bin0 -> 16220 bytes
-rw-r--r--sysroot/usr/lib/libanl-2.7.sobin0 -> 9804 bytes
-rw-r--r--sysroot/usr/lib/libanl.abin0 -> 12520 bytes
l---------sysroot/usr/lib/libanl.so1
l---------sysroot/usr/lib/libanl.so.11
-rw-r--r--sysroot/usr/lib/libasound.abin0 -> 1360510 bytes
-rw-r--r--sysroot/usr/lib/libasound.la35
l---------sysroot/usr/lib/libasound.so1
l---------sysroot/usr/lib/libasound.so.21
l---------sysroot/usr/lib/libasound.so.2.01
-rw-r--r--sysroot/usr/lib/libasound.so.2.0.0bin0 -> 795680 bytes
-rw-r--r--sysroot/usr/lib/libaudiofile.abin0 -> 230794 bytes
-rw-r--r--sysroot/usr/lib/libaudiofile.la35
l---------sysroot/usr/lib/libaudiofile.so1
l---------sysroot/usr/lib/libaudiofile.so.0.01
-rw-r--r--sysroot/usr/lib/libbsd-compat.abin0 -> 814 bytes
-rwxr-xr-xsysroot/usr/lib/libc-2.7.sobin0 -> 1274092 bytes
-rw-r--r--sysroot/usr/lib/libc.abin0 -> 2906282 bytes
-rw-r--r--sysroot/usr/lib/libc.so5
l---------sysroot/usr/lib/libc.so.61
-rw-r--r--sysroot/usr/lib/libc_nonshared.abin0 -> 16282 bytes
-rw-r--r--sysroot/usr/lib/libcidn-2.7.sobin0 -> 181724 bytes
l---------sysroot/usr/lib/libcidn.so1
l---------sysroot/usr/lib/libcidn.so.11
-rw-r--r--sysroot/usr/lib/libcrypt-2.7.sobin0 -> 38300 bytes
-rw-r--r--sysroot/usr/lib/libcrypt.abin0 -> 44870 bytes
l---------sysroot/usr/lib/libcrypt.so1
l---------sysroot/usr/lib/libcrypt.so.11
l---------sysroot/usr/lib/libcurses.a1
l---------sysroot/usr/lib/libcurses.so1
-rw-r--r--sysroot/usr/lib/libdl-2.7.sobin0 -> 9684 bytes
-rw-r--r--sysroot/usr/lib/libdl.abin0 -> 8130 bytes
l---------sysroot/usr/lib/libdl.so1
l---------sysroot/usr/lib/libdl.so.21
l---------sysroot/usr/lib/libdrm.so.21
l---------sysroot/usr/lib/libdrm.so.2.31
-rw-r--r--sysroot/usr/lib/libdrm.so.2.3.0bin0 -> 34556 bytes
-rw-r--r--sysroot/usr/lib/libesd.abin0 -> 37768 bytes
-rw-r--r--sysroot/usr/lib/libesd.la35
l---------sysroot/usr/lib/libesd.so1
l---------sysroot/usr/lib/libesd.so.01
l---------sysroot/usr/lib/libesd.so.0.21
-rw-r--r--sysroot/usr/lib/libesd.so.0.2.38bin0 -> 37608 bytes
-rw-r--r--sysroot/usr/lib/libform.abin0 -> 80194 bytes
l---------sysroot/usr/lib/libform.so1
l---------sysroot/usr/lib/libform.so.51
-rw-r--r--sysroot/usr/lib/libform.so.5.6bin0 -> 46104 bytes
-rw-r--r--sysroot/usr/lib/libg.abin0 -> 814 bytes
-rw-r--r--sysroot/usr/lib/libieee.abin0 -> 654 bytes
-rw-r--r--sysroot/usr/lib/libm-2.7.sobin0 -> 145232 bytes
-rw-r--r--sysroot/usr/lib/libm.abin0 -> 492842 bytes
l---------sysroot/usr/lib/libm.so1
l---------sysroot/usr/lib/libm.so.61
-rw-r--r--sysroot/usr/lib/libmcheck.abin0 -> 1184 bytes
-rw-r--r--sysroot/usr/lib/libmemusage.sobin0 -> 13696 bytes
-rw-r--r--sysroot/usr/lib/libmenu.abin0 -> 43896 bytes
l---------sysroot/usr/lib/libmenu.so1
l---------sysroot/usr/lib/libmenu.so.51
-rw-r--r--sysroot/usr/lib/libmenu.so.5.6bin0 -> 23716 bytes
-rw-r--r--sysroot/usr/lib/libncurses++.abin0 -> 144176 bytes
-rw-r--r--sysroot/usr/lib/libncurses.abin0 -> 324510 bytes
l---------sysroot/usr/lib/libncurses.so1
l---------sysroot/usr/lib/libncurses.so.51
-rw-r--r--sysroot/usr/lib/libncurses.so.5.6bin0 -> 190584 bytes
-rw-r--r--sysroot/usr/lib/libnsl-2.7.sobin0 -> 79612 bytes
-rw-r--r--sysroot/usr/lib/libnsl.abin0 -> 122154 bytes
l---------sysroot/usr/lib/libnsl.so1
l---------sysroot/usr/lib/libnsl.so.11
-rw-r--r--sysroot/usr/lib/libnss_compat-2.7.sobin0 -> 26340 bytes
l---------sysroot/usr/lib/libnss_compat.so1
l---------sysroot/usr/lib/libnss_compat.so.21
-rw-r--r--sysroot/usr/lib/libnss_dns-2.7.sobin0 -> 17884 bytes
l---------sysroot/usr/lib/libnss_dns.so1
l---------sysroot/usr/lib/libnss_dns.so.21
-rw-r--r--sysroot/usr/lib/libnss_files-2.7.sobin0 -> 38412 bytes
l---------sysroot/usr/lib/libnss_files.so1
l---------sysroot/usr/lib/libnss_files.so.21
-rw-r--r--sysroot/usr/lib/libnss_hesiod-2.7.sobin0 -> 17900 bytes
l---------sysroot/usr/lib/libnss_hesiod.so1
l---------sysroot/usr/lib/libnss_hesiod.so.21
-rw-r--r--sysroot/usr/lib/libnss_nis-2.7.sobin0 -> 34352 bytes
l---------sysroot/usr/lib/libnss_nis.so1
l---------sysroot/usr/lib/libnss_nis.so.21
-rw-r--r--sysroot/usr/lib/libnss_nisplus-2.7.sobin0 -> 42508 bytes
l---------sysroot/usr/lib/libnss_nisplus.so1
l---------sysroot/usr/lib/libnss_nisplus.so.21
-rw-r--r--sysroot/usr/lib/libpanel.abin0 -> 18234 bytes
l---------sysroot/usr/lib/libpanel.so1
l---------sysroot/usr/lib/libpanel.so.51
-rw-r--r--sysroot/usr/lib/libpanel.so.5.6bin0 -> 9256 bytes
-rw-r--r--sysroot/usr/lib/libpcprofile.sobin0 -> 5444 bytes
-rwxr-xr-xsysroot/usr/lib/libpthread-2.7.sobin0 -> 112174 bytes
-rw-r--r--sysroot/usr/lib/libpthread.abin0 -> 1068468 bytes
-rw-r--r--sysroot/usr/lib/libpthread.so5
l---------sysroot/usr/lib/libpthread.so.01
-rw-r--r--sysroot/usr/lib/libpthread_nonshared.abin0 -> 3360 bytes
-rw-r--r--sysroot/usr/lib/libpulse-browse.abin0 -> 77154 bytes
l---------sysroot/usr/lib/libpulse-browse.so1
l---------sysroot/usr/lib/libpulse-browse.so.0.11
-rw-r--r--sysroot/usr/lib/libpulse-mainloop-glib.abin0 -> 72462 bytes
l---------sysroot/usr/lib/libpulse-mainloop-glib.so1
l---------sysroot/usr/lib/libpulse-mainloop-glib.so.0.01
-rw-r--r--sysroot/usr/lib/libpulse-simple.abin0 -> 69964 bytes
l---------sysroot/usr/lib/libpulse-simple.so1
l---------sysroot/usr/lib/libpulse-simple.so.01
l---------sysroot/usr/lib/libpulse-simple.so.0.01
-rw-r--r--sysroot/usr/lib/libpulse-simple.so.0.0.1bin0 -> 47360 bytes
-rw-r--r--sysroot/usr/lib/libpulse.abin0 -> 550222 bytes
l---------sysroot/usr/lib/libpulse.so1
l---------sysroot/usr/lib/libpulse.so.01
l---------sysroot/usr/lib/libpulse.so.0.41
-rw-r--r--sysroot/usr/lib/libpulse.so.0.4.1bin0 -> 316468 bytes
-rw-r--r--sysroot/usr/lib/libresolv-2.7.sobin0 -> 59216 bytes
-rw-r--r--sysroot/usr/lib/libresolv.abin0 -> 79902 bytes
l---------sysroot/usr/lib/libresolv.so1
l---------sysroot/usr/lib/libresolv.so.21
-rw-r--r--sysroot/usr/lib/librpcsvc.abin0 -> 43452 bytes
-rw-r--r--sysroot/usr/lib/librt-2.7.sobin0 -> 30624 bytes
-rw-r--r--sysroot/usr/lib/librt.abin0 -> 59610 bytes
l---------sysroot/usr/lib/librt.so1
l---------sysroot/usr/lib/librt.so.11
l---------sysroot/usr/lib/libtermcap.a1
l---------sysroot/usr/lib/libtermcap.so1
-rw-r--r--sysroot/usr/lib/libthread_db-1.0.sobin0 -> 26284 bytes
l---------sysroot/usr/lib/libthread_db.so1
l---------sysroot/usr/lib/libthread_db.so.11
-rw-r--r--sysroot/usr/lib/libtic.abin0 -> 85650 bytes
l---------sysroot/usr/lib/libtic.so1
l---------sysroot/usr/lib/libtic.so.51
-rw-r--r--sysroot/usr/lib/libtic.so.5.6bin0 -> 69952 bytes
-rw-r--r--sysroot/usr/lib/libutil-2.7.sobin0 -> 9696 bytes
-rw-r--r--sysroot/usr/lib/libutil.abin0 -> 8640 bytes
l---------sysroot/usr/lib/libutil.so1
l---------sysroot/usr/lib/libutil.so.11
l---------sysroot/usr/lib/libxcb-xlib.so.01
l---------sysroot/usr/lib/libxcb-xlib.so.0.01
-rw-r--r--sysroot/usr/lib/libxcb-xlib.so.0.0.0bin0 -> 4172 bytes
l---------sysroot/usr/lib/libxcb.so.11
l---------sysroot/usr/lib/libxcb.so.1.01
-rw-r--r--sysroot/usr/lib/libxcb.so.1.0.0bin0 -> 93832 bytes
-rw-r--r--sysroot/usr/lib/libz.abin0 -> 90374 bytes
l---------sysroot/usr/lib/libz.so1
l---------sysroot/usr/lib/libz.so.11
l---------sysroot/usr/lib/libz.so.1.2.31
-rw-r--r--sysroot/usr/lib/libz.so.1.2.3.3bin0 -> 81240 bytes
-rw-r--r--sysroot/usr/lib/pkgconfig/alsa.pc14
-rw-r--r--sysroot/usr/lib/pkgconfig/audiofile.pc12
-rw-r--r--sysroot/usr/lib/pkgconfig/esound.pc12
-rw-r--r--sysroot/usr/lib/pkgconfig/inputproto.pc9
-rw-r--r--sysroot/usr/lib/pkgconfig/kbproto.pc9
-rw-r--r--sysroot/usr/lib/pkgconfig/libpulse-browse.pc11
-rw-r--r--sysroot/usr/lib/pkgconfig/libpulse-mainloop-glib.pc11
-rw-r--r--sysroot/usr/lib/pkgconfig/libpulse-simple.pc11
-rw-r--r--sysroot/usr/lib/pkgconfig/libpulse.pc10
-rw-r--r--sysroot/usr/lib/pkgconfig/x11.pc15
-rw-r--r--sysroot/usr/lib/pkgconfig/xextproto.pc9
-rw-r--r--sysroot/usr/lib/pkgconfig/xproto.pc10
-rwxr-xr-xsysroot/usr/lib/pt_chownbin0 -> 9624 bytes
-rw-r--r--sysroot/usr/lib/xen/libBrokenLocale.abin0 -> 1066 bytes
-rw-r--r--sysroot/usr/lib/xen/libanl.abin0 -> 12524 bytes
-rw-r--r--sysroot/usr/lib/xen/libbsd-compat.abin0 -> 814 bytes
-rw-r--r--sysroot/usr/lib/xen/libc.abin0 -> 3045840 bytes
-rw-r--r--sysroot/usr/lib/xen/libc_nonshared.abin0 -> 16282 bytes
-rw-r--r--sysroot/usr/lib/xen/libcrypt.abin0 -> 49554 bytes
-rw-r--r--sysroot/usr/lib/xen/libdl.abin0 -> 8130 bytes
-rw-r--r--sysroot/usr/lib/xen/libg.abin0 -> 814 bytes
-rw-r--r--sysroot/usr/lib/xen/libieee.abin0 -> 654 bytes
-rw-r--r--sysroot/usr/lib/xen/libm.abin0 -> 496010 bytes
-rw-r--r--sysroot/usr/lib/xen/libmcheck.abin0 -> 1184 bytes
-rw-r--r--sysroot/usr/lib/xen/libnsl.abin0 -> 128378 bytes
-rw-r--r--sysroot/usr/lib/xen/libpthread.abin0 -> 1126332 bytes
-rw-r--r--sysroot/usr/lib/xen/libpthread_nonshared.abin0 -> 3512 bytes
-rw-r--r--sysroot/usr/lib/xen/libresolv.abin0 -> 88130 bytes
-rw-r--r--sysroot/usr/lib/xen/librt.abin0 -> 61530 bytes
-rw-r--r--sysroot/usr/lib/xen/libutil.abin0 -> 8640 bytes
2407 files changed, 411063 insertions, 0 deletions
diff --git a/PACKAGE_SOURCES b/PACKAGE_SOURCES
new file mode 100644
index 0000000..965cde9
--- /dev/null
+++ b/PACKAGE_SOURCES
@@ -0,0 +1,32 @@
+libasound2_1.0.15-3ubuntu4_i386.deb 8bfcb05b78aa5df590c0866f0f9017d8cd5662c0
+libasound2-dev_1.0.15-3ubuntu4_i386.deb 271860557a5afe895de811129866c74cfbeed3d9
+libaudiofile-dev_0.2.6-7ubuntu1_i386.deb 094fb3d380230dcd5769db26c35822f109bbc6ba
+libc6_2.7-10ubuntu3_i386.deb bb0d394af36e659580ec2adc02bddca822ad85b5
+libc6-dev_2.7-10ubuntu3_i386.deb ced31eec0c5380219c63da3db963b8af7a39a8fb
+libdrm2_2.3.0-4ubuntu1_i386.deb abfb124b85a9d833971fd4a2e6b66518ff54f045
+libesd0-dev_0.2.38-0ubuntu9_i386.deb 228ae06265f25d814557aa2997151d979f8441d1
+libesd-alsa0_0.2.38-0ubuntu9_i386.deb d38d70d1f2dc07c94729cb3ee8a20e7ee38bb2f8
+libgl1-mesa-dev_7.0.3~rc2-1ubuntu3_all.deb c465a7cd254021181c80dadbc594b252ab6c9713
+libgl1-mesa-glx_7.0.3~rc2-1ubuntu3_i386.deb a3142c529dde677f63dba5561270607fa248a91a
+libncurses5_5.6+20071124-1ubuntu2_i386.deb db1135e1458de71287e00c67ee495c3dd5bfdb48
+libncurses5-dev_5.6+20071124-1ubuntu2_i386.deb 2f1f263b188d72cab92df6eca52978112f77f7b4
+libpulse0_0.9.10-1ubuntu1_i386.deb f2da0daf9b95b9834a27788c26046944aa04ded1
+libpulse-dev_0.9.10-1ubuntu1_i386.deb f87a27d97f89c49f9b2bcb0fc072f0b939645605
+libx11-6_1.1.3-1ubuntu2_i386.deb 0412e06a5d6925a10e88aed5c676b7f18a138454
+libx11-dev_1.1.3-1ubuntu2_i386.deb e410c387a30bd435f0e88a46580aa43631e35886
+libxau6_1.0.3-2_i386.deb da3394e2e3295413b39995b23fc8a504fb176063
+libxcb1_1.1-1ubuntu1_i386.deb 21de84ea598385d9e9348cc70ad1db082790f810
+libxcb-xlib0_1.1-1ubuntu1_i386.deb e7e9a30712fefc58be1e7ff1b08598b64100cc4f
+libxdamage1_1.1.1-3_i386.deb f8cb0da949e5fdd949d95f29daa5a3611ff6555f
+libxdmcp6_1.0.2-2_i386.deb f132ce54b4958b257d440b65fbac3808944b672a
+libxext6_1.0.3-2build1_i386.deb 7759b3fd18c2a43603bb82ef0c4b775ee3266838
+libxfixes3_4.0.3-2_i386.deb 3231ff12de4270df38e54f569f40d9310084b85b
+libxxf86vm1_1.0.1-2_i386.deb 0c9b4cc97c4c65fe2a7f6fc85b27494782065e74
+linux-libc-dev_2.6.24-16.30_i386.deb 25356a21570c028a1775ddbf540e938946d244c2
+mesa-common-dev_7.0.3~rc2-1ubuntu3_all.deb c54c6c9e8d4bdac41ff244021c4c94ca41f22da5
+x11proto-core-dev_7.0.11-1_all.deb 3195aede2bf2ae577e6ca837bd25bcecc67ec0dc
+x11proto-input-dev_1.4.2-1_all.deb 870570bdd798b61a95ae5142de8939b11df24321
+x11proto-kb-dev_1.0.3-2ubuntu1_all.deb d54040ee73cc4f76ad0a4d988bfaa0b1070e8285
+x11proto-xext-dev_7.0.2-5ubuntu1_all.deb 8e24443f32c1aa1ac93fd6ef1ba2b346de1aa520
+zlib1g_1.2.3.3.dfsg-7ubuntu1_i386.deb 94a731229f8fc9928a1416013995e0f061845abf
+zlib1g-dev_1.2.3.3.dfsg-7ubuntu1_i386.deb d4e838a70be03fca63202bffc6c68766dcbfdc71
diff --git a/TOOLCHAIN_SOURCES b/TOOLCHAIN_SOURCES
new file mode 100644
index 0000000..429e228
--- /dev/null
+++ b/TOOLCHAIN_SOURCES
@@ -0,0 +1,7 @@
+toolchain/binutils.git: e4df3e0a5bb640ccfa2f30ee67fe9b3146b152d6 Sync internal and external version. -Fix problem with --save-temps in gas.
+toolchain/build.git: 7ee395d10100fc9ed2c03c49b949033600082a4f Fix host-libbfd installation problem caused by undefined $(INSTALL)
+toolchain/gcc.git: fe2afdf3f3701489c05d2a7509752d6f0c7616f7 Sync internal and external version:
+toolchain/gdb.git: 5f9d38fd85e779aa1fd17eb38d24f8ec994d9147 Sync internal and external versions. This fixed a problem that gdb inserts wrong kind of break points at ARM/THUMB boundaries. The patch is a backport of 3 upstream patches.
+toolchain/gmp.git: 9fb242a79dd122d7fbf867daf5620dba6927bd2e check in gmp sources for prebuilt toolchains in Eclair.
+toolchain/gold.git: 8d401cf711539af5a2f78d12447341d774892618 Empty initial commit.
+toolchain/mpfr.git: da6dfde986af1b56f0f41e9f5de61d093fa8af90 check in mpfr sources for prebuilt toolchains in Eclair.
diff --git a/bin/i686-linux-addr2line b/bin/i686-linux-addr2line
new file mode 100755
index 0000000..24493c0
--- /dev/null
+++ b/bin/i686-linux-addr2line
Binary files differ
diff --git a/bin/i686-linux-ar b/bin/i686-linux-ar
new file mode 100755
index 0000000..2dfc9e1
--- /dev/null
+++ b/bin/i686-linux-ar
Binary files differ
diff --git a/bin/i686-linux-as b/bin/i686-linux-as
new file mode 100755
index 0000000..28b5dca
--- /dev/null
+++ b/bin/i686-linux-as
Binary files differ
diff --git a/bin/i686-linux-c++ b/bin/i686-linux-c++
new file mode 100755
index 0000000..24d52b9
--- /dev/null
+++ b/bin/i686-linux-c++
Binary files differ
diff --git a/bin/i686-linux-c++filt b/bin/i686-linux-c++filt
new file mode 100755
index 0000000..fb54783
--- /dev/null
+++ b/bin/i686-linux-c++filt
Binary files differ
diff --git a/bin/i686-linux-cpp b/bin/i686-linux-cpp
new file mode 100755
index 0000000..29b53ab
--- /dev/null
+++ b/bin/i686-linux-cpp
Binary files differ
diff --git a/bin/i686-linux-g++ b/bin/i686-linux-g++
new file mode 100755
index 0000000..24d52b9
--- /dev/null
+++ b/bin/i686-linux-g++
Binary files differ
diff --git a/bin/i686-linux-gcc b/bin/i686-linux-gcc
new file mode 100755
index 0000000..d5544b0
--- /dev/null
+++ b/bin/i686-linux-gcc
Binary files differ
diff --git a/bin/i686-linux-gcc-4.4.3 b/bin/i686-linux-gcc-4.4.3
new file mode 100755
index 0000000..d5544b0
--- /dev/null
+++ b/bin/i686-linux-gcc-4.4.3
Binary files differ
diff --git a/bin/i686-linux-gccbug b/bin/i686-linux-gccbug
new file mode 100755
index 0000000..71a6f49
--- /dev/null
+++ b/bin/i686-linux-gccbug
@@ -0,0 +1,558 @@
+#!/bin/sh
+# Submit a problem report to a GNATS site.
+# Copyright (C) 1993, 2000, 2001, 2002, 2003, 2007 Free Software Foundation, Inc.
+# Contributed by Brendan Kehoe (brendan@cygnus.com), based on a
+# version written by Heinz G. Seidl (hgs@cygnus.com).
+#
+# This file is part of GNU GNATS.
+#
+# GNU GNATS is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU GNATS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU GNATS; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# The version of this send-pr.
+VERSION=3.113
+
+# The submitter-id for your site.
+SUBMITTER=net
+
+# The default mail address for PR submissions.
+GNATS_ADDR=gcc-gnats@gcc.gnu.org
+
+# The default release for this host.
+# We have to guess at what program_transform_name might have done.
+# "sed 1q" because neither "head -1" nor "head -n 1" is universal, argh.
+
+DEFAULT_GCC="`echo $0 | sed -e 's/bug//'`"
+DEFAULT_RELEASE="`$DEFAULT_GCC --version | sed 1q`"
+
+# The default organization.
+DEFAULT_ORGANIZATION=
+
+# What mailer to use. This must come after the config file, since it is
+# host-dependent.
+# Copied from cvsbug
+if [ -f /usr/sbin/sendmail ]; then
+ MAIL_AGENT="/usr/sbin/sendmail -oi -t"
+else
+ MAIL_AGENT="/usr/lib/sendmail -oi -t"
+fi
+MAILER=`echo $MAIL_AGENT | sed -e 's, .*,,'`
+if [ ! -f "$MAILER" ] ; then
+ echo "$COMMAND: Cannot file mail program \"$MAILER\"."
+ echo "$COMMAND: Please fix the MAIL_AGENT entry in the $COMMAND file."
+ exit 1
+fi
+
+
+# How to read the passwd database.
+PASSWD="cat /etc/passwd"
+
+ECHON=bsd
+
+if [ $ECHON = bsd ] ; then
+ ECHON1="echo -n"
+ ECHON2=
+elif [ $ECHON = sysv ] ; then
+ ECHON1=echo
+ ECHON2='\c'
+else
+ ECHON1=echo
+ ECHON2=
+fi
+
+#
+
+if [ -z "$TMPDIR" ]; then
+ TMPDIR=/tmp
+else
+ if [ "`echo $TMPDIR | grep '/$'`" != "" ]; then
+ TMPDIR="`echo $TMPDIR | sed -e 's,/$,,'`"
+ fi
+fi
+
+if [ yes = yes ]; then
+ TEMP0=`mktemp $TMPDIR/poXXXXXX` || exit 1
+ TEMP=`mktemp $TMPDIR/pXXXXXX` || exit 1
+ BAD=`mktemp $TMPDIR/pbadXXXXXX` || exit 1
+ REF=`mktemp $TMPDIR/pfXXXXXX` || exit 1
+ REMOVE_TEMP="rm -f $TEMP0 $TEMP $BAD $REF"
+else
+ TEMPD=$TMPDIR/pd$$
+ TEMP0=$TEMPD/po$$
+ TEMP=$TEMPD/p$$
+ BAD=$TEMPD/pbad$$
+ REF=$TEMPD/pf$$
+ mkdir $TEMPD || exit 1
+ REMOVE_TEMP="rm -rf $TEMPD"
+fi
+
+# find a user name
+if [ "$LOGNAME" = "" ]; then
+ if [ "$USER" != "" ]; then
+ LOGNAME="$USER"
+ else
+ LOGNAME="UNKNOWN"
+ fi
+fi
+
+FROM="$LOGNAME"
+REPLY_TO="${REPLY_TO:-${REPLYTO:-$LOGNAME}}"
+
+# Find out the name of the originator of this PR.
+if [ -n "$NAME" ]; then
+ ORIGINATOR="$NAME"
+elif [ -f $HOME/.fullname ]; then
+ ORIGINATOR="`sed -e '1q' $HOME/.fullname`"
+else
+ # Must use temp file due to incompatibilities in quoting behavior
+ # and to protect shell metacharacters in the expansion of $LOGNAME
+ $PASSWD | grep "^$LOGNAME:" | awk -F: '{print $5}' | sed -e 's/,.*//' > $TEMP0
+ ORIGINATOR="`cat $TEMP0`"
+ rm -f $TEMP0
+fi
+
+if [ -n "$ORGANIZATION" ]; then
+ if [ -f "$ORGANIZATION" ]; then
+ ORGANIZATION="`cat $ORGANIZATION`"
+ fi
+else
+ if [ -n "$DEFAULT_ORGANIZATION" ]; then
+ ORGANIZATION="$DEFAULT_ORGANIZATION"
+ elif [ -f $HOME/.organization ]; then
+ ORGANIZATION="`cat $HOME/.organization`"
+ fi
+fi
+
+# If they don't have a preferred editor set, then use
+if [ -z "$VISUAL" ]; then
+ if [ -z "$EDITOR" ]; then
+ EDIT=vi
+ else
+ EDIT="$EDITOR"
+ fi
+else
+ EDIT="$VISUAL"
+fi
+
+# Find out some information.
+SYSTEM=`( [ -f /bin/uname ] && /bin/uname -a ) || \
+ ( [ -f /usr/bin/uname ] && /usr/bin/uname -a ) || echo ""`
+ARCH=`[ -f /bin/arch ] && /bin/arch`
+MACHINE=`[ -f /bin/machine ] && /bin/machine`
+
+COMMAND=`echo $0 | sed -e 's,.*/,,'`
+USAGE="Usage: $COMMAND [-PVL] [-t address] [-f filename] [-s severity]
+ [-c address] [--request-id] [--version]"
+REMOVE=
+BATCH=
+CC=
+SEVERITY_C=
+
+while [ $# -gt 0 ]; do
+ case "$1" in
+ -r) ;; # Ignore for backward compat.
+ -t | --to) if [ $# -eq 1 ]; then echo "$USAGE"; $REMOVE_TEMP; exit 1; fi
+ shift ; GNATS_ADDR="$1"
+ EXPLICIT_GNATS_ADDR=true
+ ;;
+ -f | --file) if [ $# -eq 1 ]; then echo "$USAGE"; $REMOVE_TEMP; exit 1; fi
+ shift ; IN_FILE="$1"
+ if [ "$IN_FILE" != "-" -a ! -r "$IN_FILE" ]; then
+ echo "$COMMAND: cannot read $IN_FILE"
+ $REMOVE_TEMP
+ exit 1
+ fi
+ ;;
+ -b | --batch) BATCH=true ;;
+ -c | --cc) if [ $# -eq 1 ]; then echo "$USAGE"; $REMOVE_TEMP; exit 1; fi
+ shift ; CC="$1"
+ ;;
+ -s | --severity) if [ $# -eq 1 ]; then echo "$USAGE"; $REMOVE_TEMP; exit 1; fi
+ shift ; SEVERITY_C="$1"
+ ;;
+ -p | -P | --print) PRINT=true ;;
+ -L | --list) FORMAT=norm ;;
+ -l | -CL | --lisp) FORMAT=lisp ;;
+ --request-id) REQUEST_ID=true ;;
+ -h | --help) echo "$USAGE"; $REMOVE_TEMP; exit 0 ;;
+ -V | --version) cat <<EOF
+gccbug (GCC) $DEFAULT_RELEASE
+Copyright (C) 2002 Free Software Foundation, Inc.
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+EOF
+ $REMOVE_TEMP; exit 0 ;;
+ -*) echo "$USAGE" ; $REMOVE_TEMP; exit 1 ;;
+ *) echo "$USAGE" ; $REMOVE_TEMP; exit 1
+ esac
+ shift
+done
+
+# spam does not need to be listed here
+CATEGORIES="ada bootstrap c++ c debug driver fortran inline-asm java libgcj libobjc libstdc++ middle-end objc other pch preprocessor rtl-optimization target tree-optimization web"
+
+case "$FORMAT" in
+ lisp) echo "$CATEGORIES" | \
+ awk 'BEGIN {printf "( "} {printf "(\"%s\") ",$0} END {printf ")\n"}'
+ $REMOVE_TEMP
+ exit 0
+ ;;
+ norm) l=`echo "$CATEGORIES" | \
+ awk 'BEGIN {max = 0; } { if (length($0) > max) { max = length($0); } }
+ END {print max + 1;}'`
+ c=`expr 70 / $l`
+ if [ $c -eq 0 ]; then c=1; fi
+ echo "$CATEGORIES" | \
+ awk 'BEGIN {print "Known categories:"; i = 0 }
+ { printf ("%-'$l'.'$l's", $0); if ((++i % '$c') == 0) { print "" } }
+ END { print ""; }'
+ $REMOVE_TEMP
+ exit 0
+ ;;
+esac
+
+ORIGINATOR_C='<name of the PR author (one line)>'
+ORGANIZATION_C='<organization of PR author (multiple lines)>'
+SYNOPSIS_C='<synopsis of the problem (one line)>'
+if [ -z "$SEVERITY_C" ]; then
+ SEVERITY_C='<[ non-critical | serious | critical ] (one line)>'
+fi
+PRIORITY_C='<[ low | medium ] (one line)>'
+CATEGORY_C='<choose from the top of this file (one line)>'
+RELEASE_C='<release number or tag (one line)>'
+ENVIRONMENT_C='<machine, os, target, libraries (multiple lines)>'
+DESCRIPTION_C='<precise description of the problem (multiple lines)>'
+HOW_TO_REPEAT_C='<When reporting a compiler error, preprocessor output must be included>'
+FIX_C='<how to correct or work around the problem, if known (multiple lines)>'
+
+# Catch some signals. ($xs kludge needed by Sun /bin/sh)
+xs=0
+trap '$REMOVE_TEMP; exit $xs' 0
+trap 'echo "$COMMAND: Aborting ..."; $REMOVE_TEMP; xs=1; exit' 1 3 13 15
+
+# If they told us to use a specific file, then do so.
+if [ -n "$IN_FILE" ]; then
+ if [ "$IN_FILE" = "-" ]; then
+ # The PR is coming from the standard input.
+ if [ -n "$EXPLICIT_GNATS_ADDR" ]; then
+ sed -e "s;^[Tt][Oo]:.*;To: $GNATS_ADDR;" > $TEMP
+ else
+ cat > $TEMP
+ fi
+ else
+ # Use the file they named.
+ if [ -n "$EXPLICIT_GNATS_ADDR" ]; then
+ sed -e "s;^[Tt][Oo]:.*;To: $GNATS_ADDR;" $IN_FILE > $TEMP
+ else
+ cat $IN_FILE > $TEMP
+ fi
+ fi
+else
+
+ if [ -n "$PR_FORM" -a -z "$PRINT_INTERN" ]; then
+ # If their PR_FORM points to a bogus entry, then bail.
+ if [ ! -f "$PR_FORM" -o ! -r "$PR_FORM" -o ! -s "$PR_FORM" ]; then
+ echo "$COMMAND: can't seem to read your template file (\`$PR_FORM'), ignoring PR_FORM"
+ sleep 1
+ PRINT_INTERN=bad_prform
+ fi
+ fi
+
+ if [ -n "$PR_FORM" -a -z "$PRINT_INTERN" ]; then
+ cp $PR_FORM $TEMP ||
+ ( echo "$COMMAND: could not copy $PR_FORM" ; xs=1; exit )
+ else
+ for file in $TEMP $REF ; do
+ cat > $file << '__EOF__'
+SEND-PR: -*- send-pr -*-
+SEND-PR: Lines starting with `SEND-PR' will be removed automatically, as
+SEND-PR: will all comments (text enclosed in `<' and `>').
+SEND-PR:
+SEND-PR: Please consult the GCC manual if you are not sure how to
+SEND-PR: fill out a problem report.
+SEND-PR: Note that the Synopsis field is mandatory. The Subject (for
+SEND-PR: the mail) will be made the same as Synopsis unless explicitly
+SEND-PR: changed.
+SEND-PR:
+SEND-PR: Choose from the following categories:
+SEND-PR:
+__EOF__
+
+ # Format the categories so they fit onto lines.
+ l=`echo "$CATEGORIES" | \
+ awk 'BEGIN {max = 0; } { if (length($0) > max) { max = length($0); } }
+ END {print max + 1;}'`
+ c=`expr 61 / $l`
+ if [ $c -eq 0 ]; then c=1; fi
+ echo "$CATEGORIES" | \
+ awk 'BEGIN {printf "SEND-PR: "; i = 0 }
+ { printf ("%-'$l'.'$l's", $0);
+ if ((++i % '$c') == 0) { printf "\nSEND-PR: " } }
+ END { printf "\nSEND-PR:\n"; }' >> $file
+
+ cat >> $file << __EOF__
+To: $GNATS_ADDR
+Subject:
+From: $FROM
+Reply-To: $REPLYTO
+Cc: $CC
+X-send-pr-version: $VERSION
+X-GNATS-Notify:
+
+
+>Submitter-Id: $SUBMITTER
+>Originator: $ORIGINATOR
+>Organization: ${ORGANIZATION-$ORGANIZATION_C}
+>Confidential: no
+SEND-PR: Leave "Confidential" as "no"; all GCC PRs are public.
+>Synopsis: $SYNOPSIS_C
+>Severity: $SEVERITY_C
+SEND-PR: critical GCC is completely not operational; no work-around known.
+SEND-PR: serious GCC is not working properly; a work-around is possible.
+SEND-PR: non-critical Report indicates minor problem.
+>Priority: $PRIORITY_C
+SEND-PR: medium The problem should be solved in the next release.
+SEND-PR: low The problem should be solve in a future release.
+>Category: $CATEGORY_C
+>Class: <[ doc-bug | accepts-illegal | rejects-legal | wrong-code | ice-on-legal-code| ice-on-illegal-code | pessimizes-code | sw-bug | change-request | support ] (one line)>
+SEND-PR: doc-bug The documentation is incorrect.
+SEND-PR: accepts-illegal GCC fails to reject erroneous code.
+SEND-PR: rejects-legal GCC gives an error message for correct code.
+SEND-PR: wrong-code The machine code generated by gcc is incorrect.
+SEND-PR: ice-on-legal-code GCC gives an Internal Compiler Error (ICE)
+SEND-PR: for correct code
+SEND-PR: ice-on-illegal-code GCC gives an ICE instead of reporting an error
+SEND-PR: pessimizes-code GCC misses an important optimization opportunity
+SEND-PR: sw-bug Software bug of some other class than above
+SEND-PR: change-request A feature in GCC is missing.
+SEND-PR: support I need help with gcc.
+>Release: ${DEFAULT_RELEASE-$RELEASE_C}
+>Environment:
+`[ -n "$SYSTEM" ] && echo System: $SYSTEM`
+`[ -n "$ARCH" ] && echo Architecture: $ARCH`
+`[ -n "$MACHINE" ] && echo Machine: $MACHINE`
+ $ENVIRONMENT_C
+host: x86_64-unknown-linux-gnu
+build: x86_64-unknown-linux-gnu
+target: i686-pc-linux-gnu
+__EOF__
+ cat >> $file << \__EOF__
+configured with: /tmp/gcc32/toolchain-src/gcc/gcc-4.4.3/configure --prefix=/tmp/gcc32/1/i686-linux-glibc2.7-4.4.3 --with-sysroot=/tmp/gcc32/1/i686-linux-glibc2.7-4.4.3/sysroot --disable-nls --with-gmp=/tmp/gcc32/1/i686-linux-glibc2.7-4.4.3 --with-mpfr=/tmp/gcc32/1/i686-linux-glibc2.7-4.4.3 --target=i686-linux --disable-plugin --disable-docs --enable-languages=c,c++
+__EOF__
+ cat >> $file << __EOF__
+>Description:
+ $DESCRIPTION_C
+>How-To-Repeat:
+ $HOW_TO_REPEAT_C
+>Fix:
+ $FIX_C
+__EOF__
+ done
+ fi
+
+ if [ "$PRINT" = true -o "$PRINT_INTERN" = true ]; then
+ cat $TEMP
+ xs=0; exit
+ fi
+
+ chmod u+w $TEMP
+ if [ -z "$REQUEST_ID" ]; then
+ eval $EDIT $TEMP
+ else
+ ed -s $TEMP << '__EOF__'
+/^Subject/s/^Subject:.*/Subject: request for a customer id/
+/^>Category/s/^>Category:.*/>Category: send-pr/
+w
+q
+__EOF__
+ fi
+
+ if cmp -s $REF $TEMP ; then
+ echo "$COMMAND: problem report not filled out, therefore not sent"
+ xs=1; exit
+ fi
+fi
+
+#
+# Check the enumeration fields
+
+# This is a "sed-subroutine" with one keyword parameter
+# (with workaround for Sun sed bug)
+#
+SED_CMD='
+/$PATTERN/{
+s|||
+s|<.*>||
+s|^[ ]*||
+s|[ ]*$||
+p
+q
+}'
+
+
+while [ -z "$REQUEST_ID" ]; do
+ CNT=0
+
+ # 1) Confidential
+ #
+ PATTERN=">Confidential:"
+ CONFIDENTIAL=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
+ case "$CONFIDENTIAL" in
+ no) CNT=`expr $CNT + 1` ;;
+ *) echo "$COMMAND: \`$CONFIDENTIAL' is not a valid value for \`Confidential'." ;;
+ esac
+ #
+ # 2) Severity
+ #
+ PATTERN=">Severity:"
+ SEVERITY=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
+ case "$SEVERITY" in
+ ""|non-critical|serious|critical) CNT=`expr $CNT + 1` ;;
+ *) echo "$COMMAND: \`$SEVERITY' is not a valid value for \`Severity'."
+ esac
+ #
+ # 3) Priority
+ #
+ PATTERN=">Priority:"
+ PRIORITY=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
+ case "$PRIORITY" in
+ ""|low|medium) CNT=`expr $CNT + 1` ;;
+ high) echo "$COMMAND: \`Priority: high' is reserved for GCC maintainers." ;;
+ *) echo "$COMMAND: \`$PRIORITY' is not a valid value for \`Priority'."
+ esac
+ #
+ # 4) Category
+ #
+ PATTERN=">Category:"
+ CATEGORY=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
+ FOUND=
+ for C in $CATEGORIES
+ do
+ if [ "$C" = "$CATEGORY" ]; then FOUND=true ; break ; fi
+ done
+ if [ -n "$FOUND" ]; then
+ CNT=`expr $CNT + 1`
+ else
+ if [ -z "$CATEGORY" ]; then
+ echo "$COMMAND: you must include a Category: field in your report."
+ else
+ echo "$COMMAND: \`$CATEGORY' is not a known category."
+ fi
+ fi
+ #
+ # 5) Class
+ #
+ PATTERN=">Class:"
+ CLASS=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
+ case "$CLASS" in
+ ""|doc-bug|accepts-illegal|rejects-legal|wrong-code|ice-on-legal-code|ice-on-illegal-code|pessimizes-code|sw-bug|change-request|support) CNT=`expr $CNT + 1` ;;
+ *) echo "$COMMAND: \`$CLASS' is not a valid value for \`Class'."
+ esac
+ #
+ # 6) Check that synopsis is not empty
+ #
+ if grep "^>Synopsis:[ ]*${SYNOPSIS_C}\$" $TEMP > /dev/null
+ then
+ echo "$COMMAND: Synopsis must not be empty."
+ else
+ CNT=`expr $CNT + 1`
+ fi
+
+ [ $CNT -lt 6 -a -z "$BATCH" ] &&
+ echo "Errors were found with the problem report."
+
+ while true; do
+ if [ -z "$BATCH" ]; then
+ $ECHON1 "a)bort, e)dit or s)end? $ECHON2"
+ read input
+ else
+ if [ $CNT -eq 6 ]; then
+ input=s
+ else
+ input=a
+ fi
+ fi
+ case "$input" in
+ a*)
+ if [ -z "$BATCH" ]; then
+ echo "$COMMAND: the problem report remains in $BAD and is not sent."
+ REMOVE_TEMP="rm -f $TEMP0 $TEMP $REF"
+ mv $TEMP $BAD
+ else
+ echo "$COMMAND: the problem report is not sent."
+ fi
+ xs=1; exit
+ ;;
+ e*)
+ eval $EDIT $TEMP
+ continue 2
+ ;;
+ s*)
+ break 2
+ ;;
+ esac
+ done
+done
+
+#
+# Make sure the mail has got a Subject. If not, use the same as
+# in Synopsis.
+#
+
+if grep '^Subject:[ ]*$' $TEMP > /dev/null
+then
+ SYNOPSIS=`grep '^>Synopsis:' $TEMP | sed -e 's/^>Synopsis:[ ]*//'`
+ ed -s $TEMP << __EOF__
+/^Subject:/s/:.*\$/: $SYNOPSIS/
+w
+q
+__EOF__
+fi
+
+#
+# Remove comments and send the problem report
+# (we have to use patterns, where the comment contains regex chars)
+#
+# /^>Originator:/s;$ORIGINATOR;;
+sed -e "
+/^SEND-PR:/d
+/^>Organization:/,/^>[A-Za-z-]*:/s;$ORGANIZATION_C;;
+/^>Confidential:/s;<.*>;;
+/^>Synopsis:/s;$SYNOPSIS_C;;
+/^>Severity:/s;<.*>;;
+/^>Priority:/s;<.*>;;
+/^>Category:/s;$CATEGORY_C;;
+/^>Class:/s;<.*>;;
+/^>Release:/,/^>[A-Za-z-]*:/s;$RELEASE_C;;
+/^>Environment:/,/^>[A-Za-z-]*:/s;$ENVIRONMENT_C;;
+/^>Description:/,/^>[A-Za-z-]*:/s;$DESCRIPTION_C;;
+/^>How-To-Repeat:/,/^>[A-Za-z-]*:/s;$HOW_TO_REPEAT_C;;
+/^>Fix:/,/^>[A-Za-z-]*:/s;$FIX_C;;
+" $TEMP > $REF
+
+if $MAIL_AGENT < $REF; then
+ echo "$COMMAND: problem report sent"
+ xs=0; exit
+else
+ echo "$COMMAND: mysterious mail failure."
+ if [ -z "$BATCH" ]; then
+ echo "$COMMAND: the problem report remains in $BAD and is not sent."
+ REMOVE_TEMP="rm -f $TEMP0 $TEMP $REF"
+ mv $REF $BAD
+ else
+ echo "$COMMAND: the problem report is not sent."
+ fi
+ xs=1; exit
+fi
diff --git a/bin/i686-linux-gcov b/bin/i686-linux-gcov
new file mode 100755
index 0000000..7f3565a
--- /dev/null
+++ b/bin/i686-linux-gcov
Binary files differ
diff --git a/bin/i686-linux-gprof b/bin/i686-linux-gprof
new file mode 100755
index 0000000..a7a52d5
--- /dev/null
+++ b/bin/i686-linux-gprof
Binary files differ
diff --git a/bin/i686-linux-ld b/bin/i686-linux-ld
new file mode 100755
index 0000000..fe8f437
--- /dev/null
+++ b/bin/i686-linux-ld
Binary files differ
diff --git a/bin/i686-linux-nm b/bin/i686-linux-nm
new file mode 100755
index 0000000..0eb20fb
--- /dev/null
+++ b/bin/i686-linux-nm
Binary files differ
diff --git a/bin/i686-linux-objcopy b/bin/i686-linux-objcopy
new file mode 100755
index 0000000..7afa8ff
--- /dev/null
+++ b/bin/i686-linux-objcopy
Binary files differ
diff --git a/bin/i686-linux-objdump b/bin/i686-linux-objdump
new file mode 100755
index 0000000..3fb6f5d
--- /dev/null
+++ b/bin/i686-linux-objdump
Binary files differ
diff --git a/bin/i686-linux-ranlib b/bin/i686-linux-ranlib
new file mode 100755
index 0000000..021b083
--- /dev/null
+++ b/bin/i686-linux-ranlib
Binary files differ
diff --git a/bin/i686-linux-readelf b/bin/i686-linux-readelf
new file mode 100755
index 0000000..58fcc1b
--- /dev/null
+++ b/bin/i686-linux-readelf
Binary files differ
diff --git a/bin/i686-linux-size b/bin/i686-linux-size
new file mode 100755
index 0000000..33107df
--- /dev/null
+++ b/bin/i686-linux-size
Binary files differ
diff --git a/bin/i686-linux-strings b/bin/i686-linux-strings
new file mode 100755
index 0000000..c264347
--- /dev/null
+++ b/bin/i686-linux-strings
Binary files differ
diff --git a/bin/i686-linux-strip b/bin/i686-linux-strip
new file mode 100755
index 0000000..667ec3e
--- /dev/null
+++ b/bin/i686-linux-strip
Binary files differ
diff --git a/build-hardy-toolchain.sh b/build-hardy-toolchain.sh
new file mode 100755
index 0000000..294f9ae
--- /dev/null
+++ b/build-hardy-toolchain.sh
@@ -0,0 +1,1385 @@
+#!/bin/sh
+#
+# Copyright (C) 2010 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# This script is used to rebuild the Linux 32-bit cross-toolchain
+# that allows you to generate 32-bit binaries that target Ubuntu 8.04
+# (a.k.a. Hardy Heron) instead of the host system (which usually is 10.04,
+# a.k.a. Lucid Lynx)
+#
+# Use --help for complete usage information.
+#
+# WARNING: At this time, the generated toolchain binaries will *not* run
+# with GLibc 2.7, only the machine code it generates.
+#
+
+PROGNAME="`basename \"$0\"`"
+
+###########################################################################
+###########################################################################
+#####
+##### C O N F I G U R A T I O N
+#####
+###########################################################################
+###########################################################################
+
+# We only support running this script on Linux
+OS=`uname -s`
+case "$OS" in
+ Linux)
+ OS=linux
+ ;;
+ *)
+ echo "ERROR: This script can only run on Linux!"
+ exit 1
+ ;;
+esac
+
+# Location of temporary directory where everything will be downloaded
+# configured, built and installed before we generate the final
+# package archive
+WORK_DIR=/tmp/gcc32
+
+# Versions of various toolchain components, do not touch unless you know
+# what you're doing!
+BINUTILS_VERSION=2.19
+GMP_VERSION=4.2.4
+MPFR_VERSION=2.4.1
+GCC_VERSION=4.4.3
+GCC_TARGET=i686-linux
+GMP_TARGET=i386-linux
+
+GIT_CMD=git
+GIT_DATE=
+GIT_BRANCH=master
+GIT_REFERENCE=
+GIT_BASE=
+GIT_BASE_DEFAULT=git://android.git.kernel.org/toolchain
+
+# Location where we will download the toolchain sources
+TOOLCHAIN_SRC_DIR=$WORK_DIR/toolchain-src
+
+# Location of original sysroot. This is where we're going to extract all
+# binary Ubuntu packages.
+ORG_SYSROOT_DIR=$WORK_DIR/sysroot
+
+# Name of the final generated toolchain
+TOOLCHAIN_NAME=$GCC_TARGET-glibc2.7-$GCC_VERSION
+
+# Name of the final toolchain binary tarball that this script will create
+TOOLCHAIN_ARCHIVE=/tmp/$TOOLCHAIN_NAME.tar.bz2
+
+# Location where we're going to install the toolchain during the build
+# This will depend on the phase of the build.
+install_dir () { echo "$WORK_DIR/$PHASE/$TOOLCHAIN_NAME"; }
+
+# A file that will contain details about all the sources used to generate
+# the final toolchain. This includes both SHA-1 for toolchain git repositories
+# and SHA-1 hashes for downloaded Ubuntu packages.
+SOURCES_LIST=$WORK_DIR/SOURCES
+
+# Location where we're going to install the final binaries
+# If empty, TOOLCHAIN_ARCHIVE will be generated
+PREFIX_DIR=
+
+# Location of the final sysroot. This must be a sub-directory of INSTALL_DIR
+# to ensure that the toolchain binaries are properly relocatable (i.e. can
+# be used when moved to another directory).
+sysroot_dir () { echo "$(install_dir)/sysroot"; }
+
+# Try to parallelize the build for faster performance.
+JOBS=`cat /proc/cpuinfo | grep processor | wc -l`
+
+# The base URL of the Ubuntu mirror we're going to use.
+UBUNTU_MIRROR=http://mirrors.us.kernel.org
+
+# Ubuntu release name we want packages from. Can be a name or a number
+# (i.e. "hardy" or "8.04")
+UBUNTU_RELEASE=hardy
+
+
+# The list of packages we need to download from the Ubuntu servers and
+# extract into the original sysroot
+#
+# Call add_ubuntu_package <package-name> to add a package to the list,
+# which will be processed later.
+#
+UBUNTU_PACKAGES=
+
+add_ubuntu_package ()
+{
+ UBUNTU_PACKAGES="$UBUNTU_PACKAGES $@"
+}
+
+# The package files containing kernel headers for Hardy and the C
+# library headers and binaries
+add_ubuntu_package \
+ linux-libc-dev \
+ libc6 \
+ libc6-dev
+
+# The X11 headers and binaries (for the emulator)
+add_ubuntu_package \
+ libx11-6 \
+ libx11-dev \
+ libxcb-xlib0 \
+ libxcb1 \
+ libxau6 \
+ libxdmcp6 \
+ x11proto-core-dev \
+ x11proto-xext-dev \
+ x11proto-input-dev \
+ x11proto-kb-dev
+
+# The OpenGL-related headers and libraries (for GLES emulation)
+add_ubuntu_package \
+ mesa-common-dev \
+ libgl1-mesa-dev \
+ libgl1-mesa-glx \
+ libxxf86vm1 \
+ libxext6 \
+ libxdamage1 \
+ libxfixes3 \
+ libdrm2
+
+# Audio libraries (required by the emulator)
+add_ubuntu_package \
+ libasound2 \
+ libasound2-dev \
+ libesd-alsa0 \
+ libesd0-dev \
+ libaudiofile-dev \
+ libpulse0 \
+ libpulse-dev
+
+# ZLib
+add_ubuntu_package \
+ zlib1g \
+ zlib1g-dev \
+ libncurses5 \
+ libncurses5-dev
+
+
+
+###########################################################################
+###########################################################################
+#####
+##### E N D O F C O N F I G U R A T I O N
+#####
+###########################################################################
+###########################################################################
+
+# Parse all options
+OPTION_HELP=no
+VERBOSE=no
+VERBOSE2=no
+NDK_ROOT=
+FORCE=no
+ONLY_SYSROOT=no
+BOOTSTRAP=
+PARAMETERS=
+
+for opt do
+ optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
+ case "$opt" in
+ --help|-h|-\?) OPTION_HELP=yes
+ ;;
+ --verbose)
+ if [ "$VERBOSE" = "yes" ] ; then
+ VERBOSE2=yes
+ else
+ VERBOSE=yes
+ fi
+ ;;
+ --force) FORCE="yes"
+ ;;
+ --ubuntu-mirror=*) UBUNTU_MIRROR="$optarg"
+ ;;
+ --ubuntu-release=*) UBUNTU_RELEASE="$optarg"
+ ;;
+ --prefix=*) PREFIX_DIR="$optarg"
+ ;;
+ --work-dir=*) WORK_DIR="$optarg"
+ ;;
+ --gcc-version=*) GCC_VERSION="$optarg"
+ ;;
+ --binutils-version=*) BINUTILS_VERSION="$optarg"
+ ;;
+ --gmp-version=*) GMP_VERSION="$optarg"
+ ;;
+ --mpfr-version=*) MPFR_VERSION="$optarg"
+ ;;
+ --git=*) GIT_CMD=$optarg
+ ;;
+ --git-date=*) GIT_DATE=$optarg
+ ;;
+ --git-branch=*) GIT_BRANCH=$optarg
+ ;;
+ --git-base=*) GIT_BASE=$optarg
+ ;;
+ --git-reference=*) GIT_REFERENCE=$optarg
+ ;;
+ --out-dir=*) OPTION_OUT_DIR="$optarg"
+ ;;
+ --cc=*) OPTION_CC="$optarg"
+ ;;
+ --jobs=*) JOBS="$optarg"
+ ;;
+ -j*) JOBS=`expr "x$opt" : 'x-j\(.*\)'`
+ ;;
+ --only-sysroot) ONLY_SYSROOT=yes
+ ;;
+ --bootstrap) BOOTSTRAP=yes
+ ;;
+ -*)
+ echo "unknown option '$opt', use --help"
+ exit 1
+ ;;
+ *)
+ if [ -z "$PARAMETERS" ]; then
+ PARAMETERS="$opt"
+ else
+ PARAMETERS="$PARAMETERS $opt"
+ fi
+ esac
+done
+
+if [ "$OPTION_HELP" = "yes" ]; then
+ cat << EOF
+
+Usage: $PROGNAME [options] <path-to-toolchain-sources>
+
+This script is used to rebuild a 32-bit Linux host toolchain that targets
+GLibc 2.7 or higher. The machine code generated by this toolchain will run
+properly on Ubuntu 8.04 or higher.
+
+You need to a patch corresponding to the patched toolchain sources that
+are downloaded from android.git.toolchain.org/toolchain/. One way to do that
+is to use the NDK's dedicated script to do it, e.g.:
+
+ \$NDK/build/tools/download-toolchain-sources.sh /tmp/toolchain-src
+
+Then invoke this script as:
+
+ $PROGNAME /tmp/toolchain-src
+
+Alternatively, you can use --ndk-dir=<path> to specify the location of
+your NDK directory, and this script will directly download the toolchain
+sources for you.
+
+Note that this script will download various binary packages from Ubuntu
+servers in order to prepare a compatible 32-bit "sysroot".
+
+By default, it generates a package archive ($TOOLCHAIN_ARCHIVE) but you can,
+as an alternative, ask for direct installation with --prefix=<path>
+
+Options: [defaults in brackets after descriptions]
+EOF
+ echo "Standard options:"
+ echo " --help Print this message"
+ echo " --force Force-rebuild everything"
+ echo " --prefix=PATH Installation path [$PREFIX_DIR]"
+ echo " --ubuntu-mirror=URL Ubuntu mirror URL [$UBUNTU_MIRROR]"
+ echo " --ubuntu-release=NAME Ubuntu release name [$UBUNTU_RELEASE]"
+ echo " --work-dir=PATH Temporary work directory [$WORK_DIR]"
+ echo " --only-sysroot Only dowload and build sysroot packages"
+ echo " --verbose Verbose output. Can be used twice."
+ echo " --binutils-version=VERSION Binutils version number [$BINUTILS_VERSION]"
+ echo " --gcc-version=VERSION GCC version number [$GCC_VERSION]."
+ echo " --gmp-version=VERSION GMP version number [$GMP_VERSION]."
+ echo " --mpfr-version=VERSION MPFR version numner [$MPFR_VERSION]."
+ echo " --ndk-dir=PATH Path to NDK (used to download toolchain sources)."
+ echo " --jobs=COUNT Run COUNT build jobs in parallel [$JOBS]"
+ echo " --git=<cmd> Use this version of the git tool [$GIT_CMD]"
+ echo " --git-date=<date> Specify specific git date when download sources [none]"
+ echo " --git-branch=<name> Specify which branch to use when downloading the sources [$GIT_BRANCH]"
+ echo " --git-reference=<path> Use a git reference repository"
+ echo " --git-base=<url> Use this git repository base [$GIT_BASE]"
+ echo " -j<COUNT> Same as --jobs=COUNT."
+ echo " --bootstrap Bootstrap toolchain (i.e. compile it with itself)"
+ echo ""
+ exit 1
+fi
+
+if [ -z "$PARAMETERS" ] ; then
+ if [ -n "$GIT_REFERENCE" ] ; then
+ if [ ! -d "$GIT_REFERENCE" -o ! -d "$GIT_REFERENCE/build" ]; then
+ echo "ERROR: Invalid reference repository directory path: $GIT_REFERENCE"
+ exit 1
+ fi
+ if [ -n "$GIT_BASE" ]; then
+ echo "Using git clone reference: $GIT_REFERENCE"
+ else
+ # If we have a reference without a base, use it as a download base instead.
+ GIT_BASE=$GIT_REFERENCE
+ GIT_REFERENCE=
+ echo "Using git clone base: $GIT_BASE"
+ fi
+ elif [ -z "$GIT_BASE" ]; then
+ echo "ERROR: You did not provide the path to the toolchain sources."
+ echo " You can make this script download them for you by using"
+ echo " the --git-base=<url> option, as in:"
+ echo ""
+ echo " $0 --git-base=$GIT_BASE_DEFAULT"
+ echo ""
+ echo " Alternatively, you can use --git-reference=<path> if you"
+ echo " already have a copy of the source repositories."
+ echo ""
+ echo " See --help for more git-related options."
+ echo ""
+ exit 1
+ fi
+else
+ set_parameters () {
+ TOOLCHAIN_SRC_DIR="$1"
+ if [ ! -d "$TOOLCHAIN_SRC_DIR" ]; then
+ echo "ERROR: Not a directory: $1"
+ exit 1
+ fi
+ if [ ! -d "$TOOLCHAIN_SRC_DIR/build" ]; then
+ echo "ERROR: Missing directory: $1/build"
+ exit 1
+ fi
+ }
+
+ set_parameters $PARAMETERS
+fi
+
+# Determine Make flags
+MAKE_FLAGS="-j$JOBS"
+
+# Create the work directory
+mkdir -p $WORK_DIR
+
+# Location where we download packages from the Ubuntu servers
+DOWNLOAD_DIR=$WORK_DIR/download
+
+# Empty the SOURCES file
+rm -f $SOURCES_LIST && touch $SOURCES_LIST
+
+
+panic ()
+{
+ echo "ERROR: $@"
+ exit 1
+}
+
+fail_panic ()
+{
+ if [ $? != 0 ] ; then
+ echo "ERROR: $@"
+ exit 1
+ fi
+}
+
+if [ "$VERBOSE" = "yes" ] ; then
+ run () {
+ echo "## COMMAND: $@"
+ $@
+ }
+ log () {
+ echo "$@"
+ }
+ if [ "$VERBOSE2" = "yes" ] ; then
+ log2 () {
+ echo "$@"
+ }
+ else
+ log2 () {
+ return
+ }
+ fi
+else
+ run () {
+ $@ >>$TMPLOG 2>&1
+ }
+ log () {
+ return
+ }
+ log2 () {
+ return
+ }
+fi
+
+OLD_PATH="$PATH"
+OLD_LD_LIBRARY_PATH="$LD_LIBRARY_PATH"
+
+BUILD_DIR=$WORK_DIR/build
+mkdir -p $BUILD_DIR
+
+TMPLOG=$BUILD_DIR/build.log
+rm -rf $TMPLOG && touch $TMPLOG
+
+build_binutils_dir () { echo "$BUILD_DIR/$PHASE/binutils"; }
+build_gmp_dir () { echo "$BUILD_DIR/$PHASE/gmp"; }
+build_mpfr_dir () { echo "$BUILD_DIR/$PHASE/mpfr"; }
+build_gcc_dir () { echo "$BUILD_DIR/$PHASE/gcc"; }
+
+TIMESTAMPS_DIR=$BUILD_DIR/timestamps
+mkdir -p $TIMESTAMPS_DIR
+
+if [ "$FORCE" = "yes" ] ; then
+ echo "Cleaning up timestamps (forcing the build)."
+ rm -f $TIMESTAMPS_DIR/*
+fi
+
+if [ "$VERBOSE" = "no" ] ; then
+ echo "To follow build, run: tail -F $TMPLOG"
+fi
+
+# returns 0 iff the string in $2 matches the pattern in $1
+# $1: pattern
+# $2: string
+pattern_match ()
+{
+ echo "$2" | grep -q -E -e "$1"
+}
+
+# Find if a given shell program is available.
+# We need to take care of the fact that the 'which <foo>' command
+# may return either an empty string (Linux) or something like
+# "no <foo> in ..." (Darwin). Also, we need to redirect stderr
+# to /dev/null for Cygwin
+#
+# $1: variable name
+# $2: program name
+#
+# Result: set $1 to the full path of the corresponding command
+# or to the empty/undefined string if not available
+#
+find_program ()
+{
+ local PROG
+ PROG=`which $2 2>/dev/null`
+ if [ -n "$PROG" ] ; then
+ if pattern_match '^no ' "$PROG"; then
+ PROG=
+ fi
+ fi
+ eval $1="$PROG"
+}
+
+# Copy a directory, create target location if needed
+#
+# $1: source directory
+# $2: target directory location
+#
+copy_directory ()
+{
+ local SRCDIR="$1"
+ local DSTDIR="$2"
+ if [ ! -d "$SRCDIR" ] ; then
+ panic "Can't copy from non-directory: $SRCDIR"
+ fi
+ mkdir -p "$DSTDIR" && (cd "$SRCDIR" && tar cf - *) | (tar xf - -C "$DSTDIR")
+ fail_panic "Cannot copy to directory: $DSTDIR"
+}
+
+find_program CMD_WGET wget
+find_program CMD_CURL curl
+find_program CMD_SCP scp
+
+# Download a file with either 'curl', 'wget' or 'scp'
+#
+# $1: source URL (e.g. http://foo.com, ssh://blah, /some/path)
+# $2: target file
+download_file ()
+{
+ # Is this HTTP, HTTPS or FTP ?
+ if pattern_match "^(http|https|ftp):.*" "$1"; then
+ if [ -n "$CMD_WGET" ] ; then
+ run $CMD_WGET -O $2 $1
+ elif [ -n "$CMD_CURL" ] ; then
+ run $CMD_CURL -o $2 $1
+ else
+ echo "Please install wget or curl on this machine"
+ exit 1
+ fi
+ return
+ fi
+
+ # Is this SSH ?
+ # Accept both ssh://<path> or <machine>:<path>
+ #
+ if pattern_match "^(ssh|[^:]+):.*" "$1"; then
+ if [ -n "$CMD_SCP" ] ; then
+ scp_src=`echo $1 | sed -e s%ssh://%%g`
+ run $CMD_SCP $scp_src $2
+ else
+ echo "Please install scp on this machine"
+ exit 1
+ fi
+ return
+ fi
+
+ # Is this a file copy ?
+ # Accept both file://<path> or /<path>
+ #
+ if pattern_match "^(file://|/).*" "$1"; then
+ cp_src=`echo $1 | sed -e s%^file://%%g`
+ run cp -f $cp_src $2
+ return
+ fi
+
+ # Unknown schema
+ echo "ERROR: Unsupported source URI: $1"
+ exit 1
+}
+
+# A variant of 'download_file' used to specify the target directory
+# $1: source URL
+# $2: target directory
+download_file_to ()
+{
+ local URL="$1"
+ local DIR="$2"
+ local DST="$DIR/`basename $URL`"
+ mkdir -p $DIR
+ download_file "$URL" "$DST"
+}
+
+# Pack a given archive
+#
+# $1: archive file path (including extension)
+# $2: source directory for archive content
+# $3+: list of files (including patterns), all if empty
+pack_archive ()
+{
+ local ARCHIVE="$1"
+ local SRCDIR="$2"
+ local SRCFILES
+ local TARFLAGS ZIPFLAGS
+ shift; shift;
+ if [ -z "$1" ] ; then
+ SRCFILES="*"
+ else
+ SRCFILES="$@"
+ fi
+ if [ "`basename $ARCHIVE`" = "$ARCHIVE" ] ; then
+ ARCHIVE="`pwd`/$ARCHIVE"
+ fi
+ mkdir -p `dirname $ARCHIVE`
+ if [ "$VERBOSE2" = "yes" ] ; then
+ TARFLAGS="vcf"
+ ZIPFLAGS="-9r"
+ else
+ TARFLAGS="cf"
+ ZIPFLAGS="-9qr"
+ fi
+ case "$ARCHIVE" in
+ *.zip)
+ (cd $SRCDIR && run zip $ZIPFLAGS "$ARCHIVE" $SRCFILES)
+ ;;
+ *.tar)
+ (cd $SRCDIR && run tar $TARFLAGS "$ARCHIVE" $SRCFILES)
+ ;;
+ *.tar.gz)
+ (cd $SRCDIR && run tar z$TARFLAGS "$ARCHIVE" $SRCFILES)
+ ;;
+ *.tar.bz2)
+ (cd $SRCDIR && run tar j$TARFLAGS "$ARCHIVE" $SRCFILES)
+ ;;
+ *)
+ panic "Unsupported archive format: $ARCHIVE"
+ ;;
+ esac
+}
+
+no_trailing_slash ()
+{
+ echo "$1" | sed -e 's!/$!!g'
+}
+
+# Load the Ubuntu packages file. This is a long text file that will list
+# each package for a given release.
+#
+# $1: Ubuntu mirror base URL (e.g. http://mirrors.us.kernel.org/)
+# $2: Release name
+#
+get_ubuntu_packages_list ()
+{
+ local RELEASE=$2
+ local BASE="`no_trailing_slash \"$1\"`"
+ local SRCFILE="$BASE/ubuntu/dists/$RELEASE/main/binary-i386/Packages.bz2"
+ local DSTFILE="$DOWNLOAD_DIR/Packages.bz2"
+ log "Trying to load $SRCFILE"
+ download_file "$SRCFILE" "$DSTFILE"
+ fail_panic "Could not download $SRCFILE"
+ (cd $DOWNLOAD_DIR && bunzip2 -f Packages.bz2)
+ fail_panic "Could not uncompress $DSTFILE"
+
+ # Write a small awk script used to extract filenames for a given package
+ cat > $DOWNLOAD_DIR/extract-filename.awk <<EOF
+BEGIN {
+ # escape special characters in package name
+ gsub("\\\\.","\\\\.",PKG)
+ gsub("\\\\+","\\\\+",PKG)
+ FILE = ""
+ PACKAGE = ""
+}
+
+\$1 == "Package:" {
+ if (\$2 == PKG) {
+ PACKAGE = \$2
+ } else {
+ PACKAGE = ""
+ }
+}
+
+\$1 == "Filename:" && PACKAGE == PKG {
+ FILE = \$2
+}
+
+END {
+ print FILE
+}
+EOF
+}
+
+# Convert an unversioned package name into a .deb package URL
+#
+# $1: Package name without version information (e.g. libc6-dev)
+# $2: Ubuntu mirror base URL
+#
+get_ubuntu_package_deb_url ()
+{
+ # The following is an awk command to parse the Packages file and extract
+ # the filename of a given package.
+ local BASE="`no_trailing_slash \"$1\"`"
+ local FILE=`awk -f "$DOWNLOAD_DIR/extract-filename.awk" -v PKG=$1 $DOWNLOAD_DIR/Packages`
+ if [ -z "$FILE" ]; then
+ log "Could not find filename for package $1"
+ exit 1
+ fi
+ echo "$2/ubuntu/$FILE"
+}
+
+# Does the host compiler generate 32-bit machine code?
+# If not, add the -m32 flag to the compiler name to ensure this.
+#
+compute_host_flags ()
+{
+ HOST_CC=${CC:-gcc}
+ HOST_CXX=${CXX-g++}
+ echo -n "Checking for ccache..."
+ find_program CMD_CCACHE ccache
+ if [ -n "$CMD_CCACHE" ] ; then
+ echo "$HOST_CC" | tr ' ' '\n' | grep -q -e "ccache"
+ if [ $? = 0 ] ; then
+ echo "yes (ignored)"
+ else
+ echo "yes"
+ HOST_CC="ccache $HOST_CC"
+ HOST_CXX="ccache $HOST_CXX"
+ fi
+ else
+ echo "no"
+ fi
+ echo -n "Checking whether the compiler generates 32-bit code... "
+ cat > $BUILD_DIR/conftest.c << EOF
+ /* This will fail to compile if void* is not 32-bit */
+ int test_array[1 - 2*(sizeof(void*) != 4)];
+EOF
+ $HOST_CC -o $BUILD_DIR/conftest.o -c $BUILD_DIR/conftest.c > $BUILD_DIR/conftest.log 2>&1
+ if [ $? != 0 ] ; then
+ echo "no"
+ HOST_CC="$HOST_CC -m32"
+ HOST_CXX="$HOST_CXX -m32"
+ else
+ echo "yes"
+ fi
+ export CC="$HOST_CC"
+ export CXX="$HOST_CXX"
+}
+
+compute_host_flags
+
+# Return the value of a given named variable
+# $1: variable name
+#
+# example:
+# FOO=BAR
+# BAR=ZOO
+# echo `var_value $FOO`
+# will print 'ZOO'
+#
+var_value ()
+{
+ eval echo \$$1
+}
+
+var_list_append ()
+{
+ local VARNAME=$1
+ local VARVAL=`var_value $VARNAME`
+ shift
+ if [ -z "$VARVAL" ] ; then
+ eval $VARNAME=\"$@\"
+ else
+ eval $VARNAME=\"$VARVAL $@\"
+ fi
+}
+
+var_list_prepend ()
+{
+ local VARNAME=$1
+ local VARVAL=`var_value $VARNAME`
+ shift
+ if [ -z "$VARVAL" ] ; then
+ eval $VARNAME=\"$@\"
+ else
+ eval $VARNAME=\"$@ $VARVAL\"
+ fi
+}
+
+_list_first ()
+{
+ echo $1
+}
+
+_list_rest ()
+{
+ shift
+ echo "$@"
+}
+
+var_list_pop_first ()
+{
+ local VARNAME=$1
+ local VARVAL=`var_value $VARNAME`
+ local FIRST=`_list_first $VARVAL`
+ eval $VARNAME=\"`_list_rest $VARVAL`\"
+ echo "$FIRST"
+}
+
+_list_first ()
+{
+ echo $1
+}
+
+_list_rest ()
+{
+ shift
+ echo "$@"
+}
+
+var_list_first ()
+{
+ local VAL=`var_value $1`
+ _list_first $VAL
+}
+
+var_list_rest ()
+{
+ local VAL=`var_value $1`
+ _list_rest $VAL
+}
+
+ALL_TASKS=
+
+# Define a new task for this build script
+# $1: Task name (e.g. build_stuff)
+# $2: Task description
+# $3: Optional: command name (will be cmd_$1 by default)
+#
+task_define ()
+{
+ local TASK="$1"
+ local DESCR="$2"
+ local COMMAND="${3:-cmd_$1}"
+
+ var_list_append ALL_TASKS $TASK
+ task_set $TASK name "$TASK"
+ task_set $TASK descr "$DESCR"
+ task_set $TASK cmd "$COMMAND"
+ task_set $TASK deps ""
+}
+
+# Variant of task define for dual tasks
+# This really defines two tasks named '<task>_1' and '<task>_2"
+# $1: Task base name
+# $2: Task description
+# $3: Optional: command name (will be cmd_$1 by default)
+task2_define ()
+{
+ local TASK="$1"
+ local DESCR="$2"
+ local COMMAND="${3:-cmd_$1}"
+
+ task_define "${TASK}_1" "$DESCR 1/2" "phase_1 $COMMAND"
+ task_define "${TASK}_2" "$DESCR 2/2" "phase_2 $COMMAND"
+}
+
+task_set ()
+{
+ local TASK="$1"
+ local FIELD="$2"
+ shift; shift;
+ eval TASK_${TASK}__${FIELD}=\"$@\"
+}
+
+task_get ()
+{
+ var_value TASK_$1__$2
+}
+
+# return the list of dependencies for a given task
+task_get_deps ()
+{
+ task_get $1 deps
+}
+
+task_get_cmd ()
+{
+ task_get $1 cmd
+}
+
+task_get_descr ()
+{
+ task_get $1 descr
+}
+
+# $1: task name
+# $2+: other tasks this task depends on.
+task_depends ()
+{
+ local TASK="$1"
+ shift;
+ var_list_append TASK_${TASK}__deps $@
+}
+
+# $1: dual task name
+# $2+: other non-dual tasks this dual task depends on
+task2_depends1 ()
+{
+ local TASK="$1"
+ shift
+ var_list_append TASK_${TASK}_1__deps $@
+ var_list_append TASK_${TASK}_2__deps $@
+}
+
+# $1: dual task name
+# $2+: other dual tasks this dual task depends on
+task2_depends2 ()
+{
+ local TASK="$1"
+ local DEP
+ shift
+ for DEP; do
+ var_list_append TASK_${TASK}_1__deps ${DEP}_1
+ var_list_append TASK_${TASK}_2__deps ${DEP}_2
+ done
+}
+
+task_dump ()
+{
+ local TASK
+ for TASK in $ALL_TASKS; do
+ local DEPS="`task_get_deps $TASK`"
+ local CMD="`task_get_cmd $TASK`"
+ local DESCR="`task_get_descr $TASK`"
+ echo "TASK $TASK: $DESCR: $CMD"
+ echo "> $DEPS"
+ done
+}
+
+task_visit ()
+{
+ task_set $TASK visit 1
+}
+
+task_unvisit ()
+{
+ task_set $TASK visit 0
+}
+
+task_is_visited ()
+{
+ [ `task_get $TASK visit` = 1 ]
+}
+
+task_queue_reset ()
+{
+ TASK_QUEUE=
+}
+
+task_queue_push ()
+{
+ var_list_append TASK_QUEUE $1
+}
+
+task_queue_pop ()
+{
+ local FIRST=`var_list_first TASK_QUEUE`
+ TASK_QUEUE=`var_list_rest TASK_QUEUE`
+}
+
+do_all_tasks ()
+{
+ local TASK
+ local TASK_LIST=
+ task_queue_reset
+ # Clear visit flags
+ for TASK in $ALL_TASKS; do
+ task_unvisit $TASK
+ done
+ task_queue_push $1
+ while [ -n "$TASK_QUEUE" ] ; do
+ TASK=`task_queue_pop`
+ if task_is_visited $TASK; then
+ continue
+ fi
+ # Prepend the task to the list if its timestamp is not set
+ if [ ! -f $TIMESTAMPS_DIR/$TASK ]; then
+ var_list_prepend TASK_LIST $TASK
+ fi
+ # Add all dependencies to the work-queue
+ local SUBTASK
+ for SUBTASK in `task_get_deps $TASK`; do
+ task_queue_push $SUBTASK
+ done
+ task_visit $TASK
+ done
+
+ # Now, TASK_LIST contains the
+}
+
+do_task ()
+{
+ local TASK="$1"
+ local DEPS="`task_get_deps $TASK`"
+ local DESCR="`task_get_descr $TASK`"
+ local DEP
+ #echo ">> $TASK: $DEPS"
+ if [ -f "$TIMESTAMPS_DIR/$TASK" ] ; then
+ echo "Skipping $1: already done."
+ return 0
+ fi
+
+ # do_task for any dependents
+ for DEP in $DEPS; do
+ #echo " ? $DEP"
+ if [ ! -f "$TIMESTAMPS_DIR/$DEP" ] ; then
+ do_task $DEP
+ fi
+ done
+
+ echo "Running: $DESCR"
+ if [ "$VERBOSE" = "yes" ] ; then
+ (eval `task_get_cmd $TASK`)
+ else
+ (eval `task_get_cmd $TASK`) >> $TMPLOG 2>&1
+ fi
+ if [ $? != 0 ] ; then
+ echo "ERROR: Cannot $DESCR"
+ exit 1
+ fi
+
+ touch "$TIMESTAMPS_DIR/$TASK"
+}
+
+# This function is used to clone a source repository either from a given
+# git base or a git reference.
+# $1: project/subdir name
+# $2: path to SOURCES file
+toolchain_clone ()
+{
+ local GITFLAGS
+ GITFLAGS=
+ if [ "$GIT_REFERENCE" ]; then
+ GITFLAGS="$GITFLAGS --shared --reference $GIT_REFERENCE/$1"
+ fi
+ echo "cleaning up toolchain/$1"
+ rm -rf $1
+ fail_panic "Could not clean $(pwd)/$1"
+ echo "downloading sources for toolchain/$1"
+ if [ -d "$GIT_BASE/$1" ]; then
+ log "cloning $GIT_BASE/$1"
+ run $GIT_CMD clone $GITFLAGS $GIT_BASE/$1 $1
+ else
+ log "cloning $GITPREFIX/$1.git"
+ run $GIT_CMD clone $GITFLAGS $GIT_BASE/$1.git $1
+ fi
+ fail_panic "Could not clone $GIT_BASE/$1.git ?"
+ cd $1
+ if [ "$GIT_BRANCH" != "master" ] ; then
+ log "checking out $GIT_BRANCH branch of $1.git"
+ run $GIT_CMD checkout -b $GIT_BRANCH origin/$GIT_BRANCH
+ fail_panic "Could not checkout $1 ?"
+ fi
+ # If --git-date is used, or we have a default
+ if [ -n "$GIT_DATE" ] ; then
+ REVISION=`git rev-list -n 1 --until="$GIT_DATE" HEAD`
+ echo "Using sources for date '$GIT_DATE': toolchain/$1 revision $REVISION"
+ run $GIT_CMD checkout $REVISION
+ fail_panic "Could not checkout $1 ?"
+ fi
+ (printf "%-32s " "toolchain/$1.git: " && git log -1 --format=oneline) >> $2
+ cd ..
+}
+
+task_define download_toolchain_sources "Download toolchain sources from $GIT_BASE "
+cmd_download_toolchain_sources ()
+{
+ local SUBDIRS="binutils build gcc gdb gmp gold mpfr"
+ (mkdir -p $TOOLCHAIN_SRC_DIR && cd $TOOLCHAIN_SRC_DIR &&
+ # Create a temporary SOURCES file for the toolchain sources only
+ # It's content will be copied to the final SOURCES file later.
+ SOURCES_LIST=$TOOLCHAIN_SRC_DIR/SOURCES
+ rm -f $SOURCES_LIST && touch $SOURCES_LIST
+ for SUB in $SUBDIRS; do
+ toolchain_clone $SUB $SOURCES_LIST
+ done
+ )
+}
+
+task_define download_ubuntu_packages_list "Download Ubuntu packages list"
+cmd_download_ubuntu_packages_list ()
+{
+ mkdir -p $DOWNLOAD_DIR
+ get_ubuntu_packages_list "$UBUNTU_MIRROR" "$UBUNTU_RELEASE"
+ fail_panic "Unable to download packages list, try --ubuntu-mirror=<url> to use another archive mirror"
+}
+
+task_define download_packages "Download Ubuntu packages"
+task_depends download_packages download_ubuntu_packages_list
+cmd_download_packages ()
+{
+ local PACKAGE
+
+ rm -f $DOWNLOAD_DIR/SOURCES && touch $DOWNLOAD_DIR/SOURCES
+ for PACKAGE in $UBUNTU_PACKAGES; do
+ echo "Downloading $PACKAGE"
+ local PKGURL=`get_ubuntu_package_deb_url $PACKAGE $UBUNTU_MIRROR`
+ echo "URL: $PKGURL"
+ download_file_to $PKGURL $DOWNLOAD_DIR
+ fail_panic "Could not download $PACKAGE"
+ done
+ sha1sum $DOWNLOAD_DIR/*.deb | while read LINE; do
+ PACKAGE=$(basename $(echo $LINE | awk '{ print $2;}'))
+ SHA1=$(echo $LINE | awk '{ print $1; }')
+ printf "%-64s %s\n" $PACKAGE $SHA1 >> $DOWNLOAD_DIR/SOURCES
+ done
+}
+
+task_define build_sysroot "Build sysroot"
+task_depends build_sysroot download_packages
+
+cmd_build_sysroot ()
+{
+ local PACKAGE
+ for PACKAGE in $UBUNTU_PACKAGES; do
+ local PKGURL=`get_ubuntu_package_deb_url $PACKAGE $UBUNTU_MIRROR`
+ local SRC_PKG=$DOWNLOAD_DIR/`basename $PKGURL`
+ echo "Extracting $SRC_PKG"
+ dpkg -x $SRC_PKG $ORG_SYSROOT_DIR/
+ done
+}
+
+# Now, we need to patch libc.so which is actually a linker script
+# referencing /lib and /usr/lib. Do the same for libpthread.so
+patch_library ()
+{
+ echo "Patching $1"
+ sed -i -e "s! /lib/! !g" -e "s! /usr/lib/! !g" $1
+}
+
+# Used to setup phase 1 the run a command
+phase_1 ()
+{
+ PHASE=1
+ $@
+}
+
+# Used to setup phase 2 then run a command
+phase_2 ()
+{
+ PHASE=1
+ BINPREFIX=$(install_dir)/bin/${GCC_TARGET}-
+ CC=${BINPREFIX}gcc
+ CXX=${BINPREFIX}g++
+ LD=${BINPREFIX}ld
+ AR=${BINPREFIX}ar
+ AS=${BINPREFIX}as
+ RANLIB=${BINPREFIX}ranlib
+ STRIP=${BINPREFIX}strip
+ export CC CXX LD AR AS RANLIB STRIP
+ PHASE=2
+ $@
+}
+
+task2_define copy_sysroot "Fix and copy sysroot"
+task2_depends1 copy_sysroot build_sysroot
+cmd_copy_sysroot ()
+{
+ local SL
+
+ # Copy the content of $BUILD_DIR/lib to $(sysroot_dir)/usr/lib
+ copy_directory $ORG_SYSROOT_DIR/lib $(sysroot_dir)/usr/lib
+ copy_directory $ORG_SYSROOT_DIR/usr/lib $(sysroot_dir)/usr/lib
+ copy_directory $ORG_SYSROOT_DIR/usr/include $(sysroot_dir)/usr/include
+
+ # We need to fix the symlink like librt.so -> /lib/librt.so.1
+ # in $(sysroot_dir)/usr/lib, they should point to librt.so.1 instead now.
+ SYMLINKS=`ls -l $(sysroot_dir)/usr/lib | grep /lib/ | awk '{ print $10; }'`
+ cd $(sysroot_dir)/usr/lib
+ for SL in $SYMLINKS; do
+ # convert /lib/libfoo.so.<n> into 'libfoo.so.<n>' for the target
+ local DST=`echo $SL | sed -e 's!^/lib/!!g'`
+ # convert libfoo.so.<n> into libfoo.so for the source
+ local SRC=`echo $DST | sed -e 's!\.[0-9]*$!!g'`
+ echo "Fixing symlink $SRC --> $DST"
+ ln -sf $DST $SRC
+ done
+
+ # Also deal with a few direct symlinks that don't use the /lib/ prefix
+ # we simply copy them. Useful for libGL.so -> libGL.so.1 for example.
+ SYMLINKS=`ls -l $(sysroot_dir)/usr/lib | grep -v /lib/ | awk '{ print $10; }'`
+ cd $(sysroot_dir)/usr/lib
+ for SL in $SYMLINKS; do
+ # convert /lib/libfoo.so.<n> into 'libfoo.so.<n>' for the target
+ local DST=`echo $SL`
+ # convert libfoo.so.<n> into libfoo.so for the source
+ local SRC=`echo $DST | sed -e 's!\.[0-9]*$!!g'`
+ if [ "$DST" != "$SRC" ]; then
+ echo "Copying symlink $SRC --> $DST"
+ ln -sf $DST $SRC
+ fi
+ done
+
+ patch_library $(sysroot_dir)/usr/lib/libc.so
+ patch_library $(sysroot_dir)/usr/lib/libpthread.so
+}
+
+task_define prepare_toolchain_sources "Prepare toolchain sources."
+if [ -n "$GIT_BASE" -o -n "$GIT_REFERENCE" ]; then
+ task_depends prepare_toolchain_sources download_toolchain_sources
+fi
+cmd_prepare_toolchain_sources ()
+{
+ return
+}
+
+task2_define configure_binutils "Configure binutils-$BINUTILS_VERSION"
+task2_depends1 configure_binutils prepare_toolchain_sources
+task2_depends2 configure_binutils copy_sysroot
+cmd_configure_binutils ()
+{
+ OUT_DIR=$(build_binutils_dir)
+ mkdir -p $OUT_DIR && cd $OUT_DIR &&
+ $TOOLCHAIN_SRC_DIR/binutils/binutils-$BINUTILS_VERSION/configure \
+ --prefix=$(install_dir) \
+ --with-sysroot=$(sysroot_dir) \
+ --target=$GCC_TARGET
+}
+
+task2_define build_binutils "Build binutils-$BINUTILS_VERSION"
+task2_depends2 build_binutils configure_binutils
+cmd_build_binutils ()
+{
+ cd $(build_binutils_dir) &&
+ make $MAKE_FLAGS
+}
+
+task2_define install_binutils "Install binutils-$BINUTILS_VERSION"
+task2_depends2 install_binutils build_binutils
+cmd_install_binutils ()
+{
+ cd $(build_binutils_dir) &&
+ make install
+}
+
+task2_define extract_gmp "Extract sources for gmp-$GMP_VERSION"
+task2_depends1 extract_gmp prepare_toolchain_sources
+cmd_extract_gmp ()
+{
+ OUT_DIR=$(build_gmp_dir)
+ mkdir -p $OUT_DIR && cd $OUT_DIR &&
+ tar xjf $TOOLCHAIN_SRC_DIR/gmp/gmp-$GMP_VERSION.tar.bz2
+}
+
+task2_define configure_gmp "Configure gmp-$GMP_VERSION"
+task2_depends2 configure_gmp extract_gmp install_binutils
+cmd_configure_gmp ()
+{
+ export ABI=32 &&
+ cd $(build_gmp_dir) && mkdir -p build && cd build &&
+ ../gmp-$GMP_VERSION/configure --prefix=$(install_dir) --host=$GMP_TARGET --disable-shared
+}
+
+task2_define build_gmp "Build gmp-$GMP_VERSION"
+task2_depends2 build_gmp configure_gmp
+cmd_build_gmp ()
+{
+ export ABI=32 &&
+ cd $(build_gmp_dir)/build &&
+ make $MAKE_FLAGS
+}
+
+task2_define install_gmp "Install gmp-$GMP_VERSION"
+task2_depends2 install_gmp build_gmp
+cmd_install_gmp ()
+{
+ cd $(build_gmp_dir)/build &&
+ make install
+}
+
+# Third, build mpfr
+task2_define extract_mpfr "Extract sources from mpfr-$MPFR_VERSION"
+task2_depends1 extract_mpfr prepare_toolchain_sources
+cmd_extract_mpfr ()
+{
+ OUT_DIR=$(build_mpfr_dir)
+ mkdir -p $OUT_DIR && cd $OUT_DIR &&
+ tar xjf $TOOLCHAIN_SRC_DIR/mpfr/mpfr-$MPFR_VERSION.tar.bz2
+}
+
+task2_define configure_mpfr "Configure mpfr-$MPFR_VERSION"
+task2_depends2 configure_mpfr extract_mpfr install_gmp
+cmd_configure_mpfr ()
+{
+ cd $(build_mpfr_dir) && mkdir -p build && cd build &&
+ ../mpfr-$MPFR_VERSION/configure \
+ --prefix=$(install_dir) \
+ --host=$GMP_TARGET \
+ --with-gmp=$(install_dir) \
+ --with-sysroot=$(sysroot_dir) \
+ --disable-shared
+}
+
+task2_define build_mpfr "Build mpfr-$MPFR_VERSION"
+task2_depends2 build_mpfr configure_mpfr
+cmd_build_mpfr ()
+{
+ cd $(build_mpfr_dir)/build &&
+ make $MAKE_FLAGS
+}
+
+task2_define install_mpfr "Install mpfr-$MPFR_VERSION"
+task2_depends2 install_mpfr build_mpfr
+cmd_install_mpfr ()
+{
+ cd $(build_mpfr_dir)/build &&
+ make install
+}
+
+
+# Fourth, the compiler itself
+task2_define configure_gcc "Configure gcc-$GCC_VERSION"
+task2_depends1 configure_gcc prepare_toolchain_sources
+task2_depends2 configure_gcc install_binutils install_gmp install_mpfr
+cmd_configure_gcc ()
+{
+ OUT_DIR=$(build_gcc_dir)
+ mkdir -p $OUT_DIR && cd $OUT_DIR &&
+ export PATH=$(install_dir)/bin:$OLD_PATH &&
+ export CFLAGS="-m32" &&
+ export CC_FOR_TARGET="$HOST_CC" &&
+ export LD_LIBRARY_PATH=$(install_dir)/lib:$OLD_LD_LIBRARY_PATH &&
+ export LDFLAGS="-L$(install_dir)/lib" &&
+ $TOOLCHAIN_SRC_DIR/gcc/gcc-$GCC_VERSION/configure \
+ --prefix=$(install_dir) \
+ --with-sysroot=$(sysroot_dir) \
+ --disable-nls \
+ --with-gmp=$(install_dir) \
+ --with-mpfr=$(install_dir) \
+ --target=$GCC_TARGET \
+ --disable-plugin \
+ --disable-docs \
+ --enable-languages=c,c++
+}
+
+task2_define build_gcc "Build gcc-$GCC_VERSION"
+task2_depends2 build_gcc configure_gcc
+cmd_build_gcc ()
+{
+ export PATH=$(install_dir)/bin:$OLD_PATH &&
+ export LD_LIBRARY_PATH=$(install_dir)/lib:$OLD_LD_LIBRARY_PATH &&
+ cd $(build_gcc_dir) &&
+ make $MAKE_FLAGS
+}
+
+task2_define install_gcc "Install gcc-$GCC_VERSION"
+task2_depends2 install_gcc build_gcc
+cmd_install_gcc ()
+{
+ export PATH=$(install_dir)/bin:$OLD_PATH &&
+ export LD_LIBRARY_PATH=$(install_dir)/lib:$OLD_LD_LIBRARY_PATH &&
+ cd $(build_gcc_dir) &&
+ make install
+}
+
+task2_define cleanup_toolchain "Cleanup toolchain"
+task2_depends2 cleanup_toolchain install_gcc
+cmd_cleanup_toolchain ()
+{
+ # Remove un-needed directories and files
+ rm -rf $(install_dir)/share
+ rm -rf $(install_dir)/man
+ rm -rf $(install_dir)/info
+ rm -rf $(install_dir)/lib32
+ rm -rf $(install_dir)/libexec/*/*/install-tools
+
+ (strip $(install_dir)/bin/*)
+ true
+}
+
+task2_define package_toolchain "Package final toolchain"
+task2_depends2 package_toolchain cleanup_toolchain
+cmd_package_toolchain ()
+{
+ # Copy this script to the install directory
+ cp -f $0 $(install_dir)
+ fail_panic "Could not copy build script to install directory"
+
+ # Copy the SOURCES file as well
+ cp $DOWNLOAD_DIR/SOURCES $(install_dir)/PACKAGE_SOURCES &&
+ cp $TOOLCHAIN_SRC_DIR/SOURCES $(install_dir)/TOOLCHAIN_SOURCES
+ fail_panic "Could not copy SOURCES files to install directory"
+
+ # Package everything
+ pack_archive $TOOLCHAIN_ARCHIVE "`dirname $(install_dir)`" "`basename $(install_dir)`"
+}
+
+task2_define install_toolchain "Install final toolchain"
+task2_depends2 install_toolchain cleanup_toolchain
+cmd_install_toolchain ()
+{
+ copy_directory "$(install_dir)" "$PREFIX_DIR/$TOOLCHAIN_NAME"
+ cp -f $0 "$PREFIX_DIR/$TOOLCHAIN_NAME/"
+}
+
+# Get sure that the second toolchain depends on the first one
+task_depends configure_binutils_2 install_gcc_1
+
+if [ "$ONLY_SYSROOT" = "yes" ]; then
+ do_task copy_sysroot
+ echo "Done, see sysroot files in $(sysroot_dir)"
+elif [ -n "$PREFIX_DIR" ]; then
+ if [ -z "$BOOTSTRAP" ]; then
+ do_task install_toolchain_1
+ else
+ do_task install_toolchain_2
+ fi
+ echo "Done, see $PREFIX_DIR/$TOOLCHAIN_NAME"
+else
+ if [ -z "$BOOTSTRAP" ]; then
+ do_task package_toolchain_1
+ else
+ do_task package_toolchain_2
+ fi
+ echo "Done, see $TOOLCHAIN_ARCHIVE"
+fi
diff --git a/i686-linux/bin/ar b/i686-linux/bin/ar
new file mode 100755
index 0000000..2dfc9e1
--- /dev/null
+++ b/i686-linux/bin/ar
Binary files differ
diff --git a/i686-linux/bin/as b/i686-linux/bin/as
new file mode 100755
index 0000000..28b5dca
--- /dev/null
+++ b/i686-linux/bin/as
Binary files differ
diff --git a/i686-linux/bin/c++ b/i686-linux/bin/c++
new file mode 100755
index 0000000..3f741bf
--- /dev/null
+++ b/i686-linux/bin/c++
Binary files differ
diff --git a/i686-linux/bin/g++ b/i686-linux/bin/g++
new file mode 100755
index 0000000..3f741bf
--- /dev/null
+++ b/i686-linux/bin/g++
Binary files differ
diff --git a/i686-linux/bin/gcc b/i686-linux/bin/gcc
new file mode 100755
index 0000000..898e3b6
--- /dev/null
+++ b/i686-linux/bin/gcc
Binary files differ
diff --git a/i686-linux/bin/ld b/i686-linux/bin/ld
new file mode 100755
index 0000000..fe8f437
--- /dev/null
+++ b/i686-linux/bin/ld
Binary files differ
diff --git a/i686-linux/bin/nm b/i686-linux/bin/nm
new file mode 100755
index 0000000..0eb20fb
--- /dev/null
+++ b/i686-linux/bin/nm
Binary files differ
diff --git a/i686-linux/bin/objcopy b/i686-linux/bin/objcopy
new file mode 100755
index 0000000..7afa8ff
--- /dev/null
+++ b/i686-linux/bin/objcopy
Binary files differ
diff --git a/i686-linux/bin/objdump b/i686-linux/bin/objdump
new file mode 100755
index 0000000..3fb6f5d
--- /dev/null
+++ b/i686-linux/bin/objdump
Binary files differ
diff --git a/i686-linux/bin/ranlib b/i686-linux/bin/ranlib
new file mode 100755
index 0000000..021b083
--- /dev/null
+++ b/i686-linux/bin/ranlib
Binary files differ
diff --git a/i686-linux/bin/strip b/i686-linux/bin/strip
new file mode 100755
index 0000000..667ec3e
--- /dev/null
+++ b/i686-linux/bin/strip
Binary files differ
diff --git a/i686-linux/include/c++/4.4.3/algorithm b/i686-linux/include/c++/4.4.3/algorithm
new file mode 100644
index 0000000..cb8488c
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/algorithm
@@ -0,0 +1,68 @@
+// <algorithm> -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file include/algorithm
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_ALGORITHM
+#define _GLIBCXX_ALGORITHM 1
+
+#pragma GCC system_header
+
+#include <bits/stl_algobase.h>
+#include <bits/stl_algo.h>
+
+#ifdef _GLIBCXX_PARALLEL
+# include <parallel/algorithm>
+#endif
+
+#endif /* _GLIBCXX_ALGORITHM */
diff --git a/i686-linux/include/c++/4.4.3/array b/i686-linux/include/c++/4.4.3/array
new file mode 100644
index 0000000..70e7756
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/array
@@ -0,0 +1,60 @@
+// <array> -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/array
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_ARRAY
+#define _GLIBCXX_ARRAY 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#else
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+#endif
+
+#include <bits/stl_algobase.h>
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/array>
+#else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/array>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+#endif
+
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+#endif // _GLIBCXX_ARRAY
diff --git a/i686-linux/include/c++/4.4.3/backward/auto_ptr.h b/i686-linux/include/c++/4.4.3/backward/auto_ptr.h
new file mode 100644
index 0000000..4554d7a
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/backward/auto_ptr.h
@@ -0,0 +1,292 @@
+// auto_ptr implementation -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file backward/auto_ptr.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_AUTO_PTR_H
+#define _STL_AUTO_PTR_H 1
+
+#include <bits/c++config.h>
+#include <debug/debug.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * A wrapper class to provide auto_ptr with reference semantics.
+ * For example, an auto_ptr can be assigned (or constructed from)
+ * the result of a function which returns an auto_ptr by value.
+ *
+ * All the auto_ptr_ref stuff should happen behind the scenes.
+ */
+ template<typename _Tp1>
+ struct auto_ptr_ref
+ {
+ _Tp1* _M_ptr;
+
+ explicit
+ auto_ptr_ref(_Tp1* __p): _M_ptr(__p) { }
+ } _GLIBCXX_DEPRECATED_ATTR;
+
+
+ /**
+ * @brief A simple smart pointer providing strict ownership semantics.
+ *
+ * The Standard says:
+ * <pre>
+ * An @c auto_ptr owns the object it holds a pointer to. Copying
+ * an @c auto_ptr copies the pointer and transfers ownership to the
+ * destination. If more than one @c auto_ptr owns the same object
+ * at the same time the behavior of the program is undefined.
+ *
+ * The uses of @c auto_ptr include providing temporary
+ * exception-safety for dynamically allocated memory, passing
+ * ownership of dynamically allocated memory to a function, and
+ * returning dynamically allocated memory from a function. @c
+ * auto_ptr does not meet the CopyConstructible and Assignable
+ * requirements for Standard Library <a
+ * href="tables.html#65">container</a> elements and thus
+ * instantiating a Standard Library container with an @c auto_ptr
+ * results in undefined behavior.
+ * </pre>
+ * Quoted from [20.4.5]/3.
+ *
+ * Good examples of what can and cannot be done with auto_ptr can
+ * be found in the libstdc++ testsuite.
+ *
+ * _GLIBCXX_RESOLVE_LIB_DEFECTS
+ * 127. auto_ptr<> conversion issues
+ * These resolutions have all been incorporated.
+ */
+ template<typename _Tp>
+ class auto_ptr
+ {
+ private:
+ _Tp* _M_ptr;
+
+ public:
+ /// The pointed-to type.
+ typedef _Tp element_type;
+
+ /**
+ * @brief An %auto_ptr is usually constructed from a raw pointer.
+ * @param p A pointer (defaults to NULL).
+ *
+ * This object now @e owns the object pointed to by @a p.
+ */
+ explicit
+ auto_ptr(element_type* __p = 0) throw() : _M_ptr(__p) { }
+
+ /**
+ * @brief An %auto_ptr can be constructed from another %auto_ptr.
+ * @param a Another %auto_ptr of the same type.
+ *
+ * This object now @e owns the object previously owned by @a a,
+ * which has given up ownership.
+ */
+ auto_ptr(auto_ptr& __a) throw() : _M_ptr(__a.release()) { }
+
+ /**
+ * @brief An %auto_ptr can be constructed from another %auto_ptr.
+ * @param a Another %auto_ptr of a different but related type.
+ *
+ * A pointer-to-Tp1 must be convertible to a
+ * pointer-to-Tp/element_type.
+ *
+ * This object now @e owns the object previously owned by @a a,
+ * which has given up ownership.
+ */
+ template<typename _Tp1>
+ auto_ptr(auto_ptr<_Tp1>& __a) throw() : _M_ptr(__a.release()) { }
+
+ /**
+ * @brief %auto_ptr assignment operator.
+ * @param a Another %auto_ptr of the same type.
+ *
+ * This object now @e owns the object previously owned by @a a,
+ * which has given up ownership. The object that this one @e
+ * used to own and track has been deleted.
+ */
+ auto_ptr&
+ operator=(auto_ptr& __a) throw()
+ {
+ reset(__a.release());
+ return *this;
+ }
+
+ /**
+ * @brief %auto_ptr assignment operator.
+ * @param a Another %auto_ptr of a different but related type.
+ *
+ * A pointer-to-Tp1 must be convertible to a pointer-to-Tp/element_type.
+ *
+ * This object now @e owns the object previously owned by @a a,
+ * which has given up ownership. The object that this one @e
+ * used to own and track has been deleted.
+ */
+ template<typename _Tp1>
+ auto_ptr&
+ operator=(auto_ptr<_Tp1>& __a) throw()
+ {
+ reset(__a.release());
+ return *this;
+ }
+
+ /**
+ * When the %auto_ptr goes out of scope, the object it owns is
+ * deleted. If it no longer owns anything (i.e., @c get() is
+ * @c NULL), then this has no effect.
+ *
+ * The C++ standard says there is supposed to be an empty throw
+ * specification here, but omitting it is standard conforming. Its
+ * presence can be detected only if _Tp::~_Tp() throws, but this is
+ * prohibited. [17.4.3.6]/2
+ */
+ ~auto_ptr() { delete _M_ptr; }
+
+ /**
+ * @brief Smart pointer dereferencing.
+ *
+ * If this %auto_ptr no longer owns anything, then this
+ * operation will crash. (For a smart pointer, "no longer owns
+ * anything" is the same as being a null pointer, and you know
+ * what happens when you dereference one of those...)
+ */
+ element_type&
+ operator*() const throw()
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_ptr != 0);
+ return *_M_ptr;
+ }
+
+ /**
+ * @brief Smart pointer dereferencing.
+ *
+ * This returns the pointer itself, which the language then will
+ * automatically cause to be dereferenced.
+ */
+ element_type*
+ operator->() const throw()
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_ptr != 0);
+ return _M_ptr;
+ }
+
+ /**
+ * @brief Bypassing the smart pointer.
+ * @return The raw pointer being managed.
+ *
+ * You can get a copy of the pointer that this object owns, for
+ * situations such as passing to a function which only accepts
+ * a raw pointer.
+ *
+ * @note This %auto_ptr still owns the memory.
+ */
+ element_type*
+ get() const throw() { return _M_ptr; }
+
+ /**
+ * @brief Bypassing the smart pointer.
+ * @return The raw pointer being managed.
+ *
+ * You can get a copy of the pointer that this object owns, for
+ * situations such as passing to a function which only accepts
+ * a raw pointer.
+ *
+ * @note This %auto_ptr no longer owns the memory. When this object
+ * goes out of scope, nothing will happen.
+ */
+ element_type*
+ release() throw()
+ {
+ element_type* __tmp = _M_ptr;
+ _M_ptr = 0;
+ return __tmp;
+ }
+
+ /**
+ * @brief Forcibly deletes the managed object.
+ * @param p A pointer (defaults to NULL).
+ *
+ * This object now @e owns the object pointed to by @a p. The
+ * previous object has been deleted.
+ */
+ void
+ reset(element_type* __p = 0) throw()
+ {
+ if (__p != _M_ptr)
+ {
+ delete _M_ptr;
+ _M_ptr = __p;
+ }
+ }
+
+ /**
+ * @brief Automatic conversions
+ *
+ * These operations convert an %auto_ptr into and from an auto_ptr_ref
+ * automatically as needed. This allows constructs such as
+ * @code
+ * auto_ptr<Derived> func_returning_auto_ptr(.....);
+ * ...
+ * auto_ptr<Base> ptr = func_returning_auto_ptr(.....);
+ * @endcode
+ */
+ auto_ptr(auto_ptr_ref<element_type> __ref) throw()
+ : _M_ptr(__ref._M_ptr) { }
+
+ auto_ptr&
+ operator=(auto_ptr_ref<element_type> __ref) throw()
+ {
+ if (__ref._M_ptr != this->get())
+ {
+ delete _M_ptr;
+ _M_ptr = __ref._M_ptr;
+ }
+ return *this;
+ }
+
+ template<typename _Tp1>
+ operator auto_ptr_ref<_Tp1>() throw()
+ { return auto_ptr_ref<_Tp1>(this->release()); }
+
+ template<typename _Tp1>
+ operator auto_ptr<_Tp1>() throw()
+ { return auto_ptr<_Tp1>(this->release()); }
+ } _GLIBCXX_DEPRECATED_ATTR;
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 541. shared_ptr template assignment and void
+ template<>
+ class auto_ptr<void>
+ {
+ public:
+ typedef void element_type;
+ } _GLIBCXX_DEPRECATED_ATTR;
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _STL_AUTO_PTR_H */
diff --git a/i686-linux/include/c++/4.4.3/backward/backward_warning.h b/i686-linux/include/c++/4.4.3/backward/backward_warning.h
new file mode 100644
index 0000000..53df521
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/backward/backward_warning.h
@@ -0,0 +1,56 @@
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+#ifndef _BACKWARD_BACKWARD_WARNING_H
+#define _BACKWARD_BACKWARD_WARNING_H 1
+
+#ifdef __DEPRECATED
+#warning \
+ This file includes at least one deprecated or antiquated header which \
+ may be removed without further notice at a future date. Please use a \
+ non-deprecated interface with equivalent functionality instead. For a \
+ listing of replacement headers and interfaces, consult the file \
+ backward_warning.h. To disable this warning use -Wno-deprecated.
+
+/*
+ A list of valid replacements is as follows:
+
+ Use: Instead of:
+ <sstream>, basic_stringbuf <strstream>, strstreambuf
+ <sstream>, basic_istringstream <strstream>, istrstream
+ <sstream>, basic_ostringstream <strstream>, ostrstream
+ <sstream>, basic_stringstream <strstream>, strstream
+ <unordered_set>, unordered_set <ext/hash_set>, hash_set
+ <unordered_set>, unordered_multiset <ext/hash_set>, hash_multiset
+ <unordered_map>, unordered_map <ext/hash_map>, hash_map
+ <unordered_map>, unordered_multimap <ext/hash_map>, hash_multimap
+ <functional>, bind <functional>, binder1st
+ <functional>, bind <functional>, binder2nd
+ <functional>, bind <functional>, bind1st
+ <functional>, bind <functional>, bind2nd
+ <memory>, unique_ptr <memory>, auto_ptr
+*/
+
+#endif
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/backward/binders.h b/i686-linux/include/c++/4.4.3/backward/binders.h
new file mode 100644
index 0000000..9b059ce
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/backward/binders.h
@@ -0,0 +1,168 @@
+// Functor implementations -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996-1998
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file backward/binders.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _GLIBCXX_BINDERS_H
+#define _GLIBCXX_BINDERS_H 1
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // 20.3.6 binders
+ /** @defgroup binders Binder Classes
+ * @ingroup functors
+ *
+ * Binders turn functions/functors with two arguments into functors with
+ * a single argument, storing an argument to be applied later. For
+ * example, a variable @c B of type @c binder1st is constructed from a
+ * functor @c f and an argument @c x. Later, B's @c operator() is called
+ * with a single argument @c y. The return value is the value of @c f(x,y).
+ * @c B can be "called" with various arguments (y1, y2, ...) and will in
+ * turn call @c f(x,y1), @c f(x,y2), ...
+ *
+ * The function @c bind1st is provided to save some typing. It takes the
+ * function and an argument as parameters, and returns an instance of
+ * @c binder1st.
+ *
+ * The type @c binder2nd and its creator function @c bind2nd do the same
+ * thing, but the stored argument is passed as the second parameter instead
+ * of the first, e.g., @c bind2nd(std::minus<float>,1.3) will create a
+ * functor whose @c operator() accepts a floating-point number, subtracts
+ * 1.3 from it, and returns the result. (If @c bind1st had been used,
+ * the functor would perform "1.3 - x" instead.
+ *
+ * Creator-wrapper functions like @c bind1st are intended to be used in
+ * calling algorithms. Their return values will be temporary objects.
+ * (The goal is to not require you to type names like
+ * @c std::binder1st<std::plus<int>> for declaring a variable to hold the
+ * return value from @c bind1st(std::plus<int>,5).
+ *
+ * These become more useful when combined with the composition functions.
+ *
+ * @{
+ */
+ /// One of the @link binders binder functors@endlink.
+ template<typename _Operation>
+ class binder1st
+ : public unary_function<typename _Operation::second_argument_type,
+ typename _Operation::result_type>
+ {
+ protected:
+ _Operation op;
+ typename _Operation::first_argument_type value;
+
+ public:
+ binder1st(const _Operation& __x,
+ const typename _Operation::first_argument_type& __y)
+ : op(__x), value(__y) { }
+
+ typename _Operation::result_type
+ operator()(const typename _Operation::second_argument_type& __x) const
+ { return op(value, __x); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 109. Missing binders for non-const sequence elements
+ typename _Operation::result_type
+ operator()(typename _Operation::second_argument_type& __x) const
+ { return op(value, __x); }
+ } _GLIBCXX_DEPRECATED_ATTR;
+
+ /// One of the @link binders binder functors@endlink.
+ template<typename _Operation, typename _Tp>
+ inline binder1st<_Operation>
+ bind1st(const _Operation& __fn, const _Tp& __x)
+ {
+ typedef typename _Operation::first_argument_type _Arg1_type;
+ return binder1st<_Operation>(__fn, _Arg1_type(__x));
+ }
+
+ /// One of the @link binders binder functors@endlink.
+ template<typename _Operation>
+ class binder2nd
+ : public unary_function<typename _Operation::first_argument_type,
+ typename _Operation::result_type>
+ {
+ protected:
+ _Operation op;
+ typename _Operation::second_argument_type value;
+
+ public:
+ binder2nd(const _Operation& __x,
+ const typename _Operation::second_argument_type& __y)
+ : op(__x), value(__y) { }
+
+ typename _Operation::result_type
+ operator()(const typename _Operation::first_argument_type& __x) const
+ { return op(__x, value); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 109. Missing binders for non-const sequence elements
+ typename _Operation::result_type
+ operator()(typename _Operation::first_argument_type& __x) const
+ { return op(__x, value); }
+ } _GLIBCXX_DEPRECATED_ATTR;
+
+ /// One of the @link binders binder functors@endlink.
+ template<typename _Operation, typename _Tp>
+ inline binder2nd<_Operation>
+ bind2nd(const _Operation& __fn, const _Tp& __x)
+ {
+ typedef typename _Operation::second_argument_type _Arg2_type;
+ return binder2nd<_Operation>(__fn, _Arg2_type(__x));
+ }
+ /** @} */
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _GLIBCXX_BINDERS_H */
diff --git a/i686-linux/include/c++/4.4.3/backward/hash_fun.h b/i686-linux/include/c++/4.4.3/backward/hash_fun.h
new file mode 100644
index 0000000..8cc7a42
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/backward/hash_fun.h
@@ -0,0 +1,167 @@
+// 'struct hash' from SGI -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1996-1998
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ */
+
+/** @file backward/hash_fun.h
+ * This file is a GNU extension to the Standard C++ Library (possibly
+ * containing extensions from the HP/SGI STL subset).
+ */
+
+#ifndef _HASH_FUN_H
+#define _HASH_FUN_H 1
+
+#include <cstddef>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::size_t;
+
+ template<class _Key>
+ struct hash { };
+
+ inline size_t
+ __stl_hash_string(const char* __s)
+ {
+ unsigned long __h = 0;
+ for ( ; *__s; ++__s)
+ __h = 5 * __h + *__s;
+ return size_t(__h);
+ }
+
+ template<>
+ struct hash<char*>
+ {
+ size_t
+ operator()(const char* __s) const
+ { return __stl_hash_string(__s); }
+ };
+
+ template<>
+ struct hash<const char*>
+ {
+ size_t
+ operator()(const char* __s) const
+ { return __stl_hash_string(__s); }
+ };
+
+ template<>
+ struct hash<char>
+ {
+ size_t
+ operator()(char __x) const
+ { return __x; }
+ };
+
+ template<>
+ struct hash<unsigned char>
+ {
+ size_t
+ operator()(unsigned char __x) const
+ { return __x; }
+ };
+
+ template<>
+ struct hash<signed char>
+ {
+ size_t
+ operator()(unsigned char __x) const
+ { return __x; }
+ };
+
+ template<>
+ struct hash<short>
+ {
+ size_t
+ operator()(short __x) const
+ { return __x; }
+ };
+
+ template<>
+ struct hash<unsigned short>
+ {
+ size_t
+ operator()(unsigned short __x) const
+ { return __x; }
+ };
+
+ template<>
+ struct hash<int>
+ {
+ size_t
+ operator()(int __x) const
+ { return __x; }
+ };
+
+ template<>
+ struct hash<unsigned int>
+ {
+ size_t
+ operator()(unsigned int __x) const
+ { return __x; }
+ };
+
+ template<>
+ struct hash<long>
+ {
+ size_t
+ operator()(long __x) const
+ { return __x; }
+ };
+
+ template<>
+ struct hash<unsigned long>
+ {
+ size_t
+ operator()(unsigned long __x) const
+ { return __x; }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/backward/hash_map b/i686-linux/include/c++/4.4.3/backward/hash_map
new file mode 100644
index 0000000..7f5c2c5
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/backward/hash_map
@@ -0,0 +1,593 @@
+// Hashing map implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2004, 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1996
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ */
+
+/** @file backward/hash_map
+ * This file is a GNU extension to the Standard C++ Library (possibly
+ * containing extensions from the HP/SGI STL subset).
+ */
+
+#ifndef _HASH_MAP
+#define _HASH_MAP 1
+
+#ifndef _GLIBCXX_PERMIT_BACKWARD_HASH
+#include "backward_warning.h"
+#endif
+
+#include <bits/c++config.h>
+#include <backward/hashtable.h>
+#include <bits/concept_check.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::equal_to;
+ using std::allocator;
+ using std::pair;
+ using std::_Select1st;
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template<class _Key, class _Tp, class _HashFn = hash<_Key>,
+ class _EqualKey = equal_to<_Key>, class _Alloc = allocator<_Tp> >
+ class hash_map
+ {
+ private:
+ typedef hashtable<pair<const _Key, _Tp>,_Key, _HashFn,
+ _Select1st<pair<const _Key, _Tp> >,
+ _EqualKey, _Alloc> _Ht;
+
+ _Ht _M_ht;
+
+ public:
+ typedef typename _Ht::key_type key_type;
+ typedef _Tp data_type;
+ typedef _Tp mapped_type;
+ typedef typename _Ht::value_type value_type;
+ typedef typename _Ht::hasher hasher;
+ typedef typename _Ht::key_equal key_equal;
+
+ typedef typename _Ht::size_type size_type;
+ typedef typename _Ht::difference_type difference_type;
+ typedef typename _Ht::pointer pointer;
+ typedef typename _Ht::const_pointer const_pointer;
+ typedef typename _Ht::reference reference;
+ typedef typename _Ht::const_reference const_reference;
+
+ typedef typename _Ht::iterator iterator;
+ typedef typename _Ht::const_iterator const_iterator;
+
+ typedef typename _Ht::allocator_type allocator_type;
+
+ hasher
+ hash_funct() const
+ { return _M_ht.hash_funct(); }
+
+ key_equal
+ key_eq() const
+ { return _M_ht.key_eq(); }
+
+ allocator_type
+ get_allocator() const
+ { return _M_ht.get_allocator(); }
+
+ hash_map()
+ : _M_ht(100, hasher(), key_equal(), allocator_type()) {}
+
+ explicit
+ hash_map(size_type __n)
+ : _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
+
+ hash_map(size_type __n, const hasher& __hf)
+ : _M_ht(__n, __hf, key_equal(), allocator_type()) {}
+
+ hash_map(size_type __n, const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _M_ht(__n, __hf, __eql, __a) {}
+
+ template<class _InputIterator>
+ hash_map(_InputIterator __f, _InputIterator __l)
+ : _M_ht(100, hasher(), key_equal(), allocator_type())
+ { _M_ht.insert_unique(__f, __l); }
+
+ template<class _InputIterator>
+ hash_map(_InputIterator __f, _InputIterator __l, size_type __n)
+ : _M_ht(__n, hasher(), key_equal(), allocator_type())
+ { _M_ht.insert_unique(__f, __l); }
+
+ template<class _InputIterator>
+ hash_map(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf)
+ : _M_ht(__n, __hf, key_equal(), allocator_type())
+ { _M_ht.insert_unique(__f, __l); }
+
+ template<class _InputIterator>
+ hash_map(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _M_ht(__n, __hf, __eql, __a)
+ { _M_ht.insert_unique(__f, __l); }
+
+ size_type
+ size() const
+ { return _M_ht.size(); }
+
+ size_type
+ max_size() const
+ { return _M_ht.max_size(); }
+
+ bool
+ empty() const
+ { return _M_ht.empty(); }
+
+ void
+ swap(hash_map& __hs)
+ { _M_ht.swap(__hs._M_ht); }
+
+ template<class _K1, class _T1, class _HF, class _EqK, class _Al>
+ friend bool
+ operator== (const hash_map<_K1, _T1, _HF, _EqK, _Al>&,
+ const hash_map<_K1, _T1, _HF, _EqK, _Al>&);
+
+ iterator
+ begin()
+ { return _M_ht.begin(); }
+
+ iterator
+ end()
+ { return _M_ht.end(); }
+
+ const_iterator
+ begin() const
+ { return _M_ht.begin(); }
+
+ const_iterator
+ end() const
+ { return _M_ht.end(); }
+
+ pair<iterator, bool>
+ insert(const value_type& __obj)
+ { return _M_ht.insert_unique(__obj); }
+
+ template<class _InputIterator>
+ void
+ insert(_InputIterator __f, _InputIterator __l)
+ { _M_ht.insert_unique(__f, __l); }
+
+ pair<iterator, bool>
+ insert_noresize(const value_type& __obj)
+ { return _M_ht.insert_unique_noresize(__obj); }
+
+ iterator
+ find(const key_type& __key)
+ { return _M_ht.find(__key); }
+
+ const_iterator
+ find(const key_type& __key) const
+ { return _M_ht.find(__key); }
+
+ _Tp&
+ operator[](const key_type& __key)
+ { return _M_ht.find_or_insert(value_type(__key, _Tp())).second; }
+
+ size_type
+ count(const key_type& __key) const
+ { return _M_ht.count(__key); }
+
+ pair<iterator, iterator>
+ equal_range(const key_type& __key)
+ { return _M_ht.equal_range(__key); }
+
+ pair<const_iterator, const_iterator>
+ equal_range(const key_type& __key) const
+ { return _M_ht.equal_range(__key); }
+
+ size_type
+ erase(const key_type& __key)
+ {return _M_ht.erase(__key); }
+
+ void
+ erase(iterator __it)
+ { _M_ht.erase(__it); }
+
+ void
+ erase(iterator __f, iterator __l)
+ { _M_ht.erase(__f, __l); }
+
+ void
+ clear()
+ { _M_ht.clear(); }
+
+ void
+ resize(size_type __hint)
+ { _M_ht.resize(__hint); }
+
+ size_type
+ bucket_count() const
+ { return _M_ht.bucket_count(); }
+
+ size_type
+ max_bucket_count() const
+ { return _M_ht.max_bucket_count(); }
+
+ size_type
+ elems_in_bucket(size_type __n) const
+ { return _M_ht.elems_in_bucket(__n); }
+ };
+
+ template<class _Key, class _Tp, class _HashFn, class _EqlKey, class _Alloc>
+ inline bool
+ operator==(const hash_map<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm1,
+ const hash_map<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm2)
+ { return __hm1._M_ht == __hm2._M_ht; }
+
+ template<class _Key, class _Tp, class _HashFn, class _EqlKey, class _Alloc>
+ inline bool
+ operator!=(const hash_map<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm1,
+ const hash_map<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm2)
+ { return !(__hm1 == __hm2); }
+
+ template<class _Key, class _Tp, class _HashFn, class _EqlKey, class _Alloc>
+ inline void
+ swap(hash_map<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm1,
+ hash_map<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm2)
+ { __hm1.swap(__hm2); }
+
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template<class _Key, class _Tp,
+ class _HashFn = hash<_Key>,
+ class _EqualKey = equal_to<_Key>,
+ class _Alloc = allocator<_Tp> >
+ class hash_multimap
+ {
+ // concept requirements
+ __glibcxx_class_requires(_Key, _SGIAssignableConcept)
+ __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
+ __glibcxx_class_requires3(_HashFn, size_t, _Key, _UnaryFunctionConcept)
+ __glibcxx_class_requires3(_EqualKey, _Key, _Key, _BinaryPredicateConcept)
+
+ private:
+ typedef hashtable<pair<const _Key, _Tp>, _Key, _HashFn,
+ _Select1st<pair<const _Key, _Tp> >, _EqualKey, _Alloc>
+ _Ht;
+
+ _Ht _M_ht;
+
+ public:
+ typedef typename _Ht::key_type key_type;
+ typedef _Tp data_type;
+ typedef _Tp mapped_type;
+ typedef typename _Ht::value_type value_type;
+ typedef typename _Ht::hasher hasher;
+ typedef typename _Ht::key_equal key_equal;
+
+ typedef typename _Ht::size_type size_type;
+ typedef typename _Ht::difference_type difference_type;
+ typedef typename _Ht::pointer pointer;
+ typedef typename _Ht::const_pointer const_pointer;
+ typedef typename _Ht::reference reference;
+ typedef typename _Ht::const_reference const_reference;
+
+ typedef typename _Ht::iterator iterator;
+ typedef typename _Ht::const_iterator const_iterator;
+
+ typedef typename _Ht::allocator_type allocator_type;
+
+ hasher
+ hash_funct() const
+ { return _M_ht.hash_funct(); }
+
+ key_equal
+ key_eq() const
+ { return _M_ht.key_eq(); }
+
+ allocator_type
+ get_allocator() const
+ { return _M_ht.get_allocator(); }
+
+ hash_multimap()
+ : _M_ht(100, hasher(), key_equal(), allocator_type()) {}
+
+ explicit
+ hash_multimap(size_type __n)
+ : _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
+
+ hash_multimap(size_type __n, const hasher& __hf)
+ : _M_ht(__n, __hf, key_equal(), allocator_type()) {}
+
+ hash_multimap(size_type __n, const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _M_ht(__n, __hf, __eql, __a) {}
+
+ template<class _InputIterator>
+ hash_multimap(_InputIterator __f, _InputIterator __l)
+ : _M_ht(100, hasher(), key_equal(), allocator_type())
+ { _M_ht.insert_equal(__f, __l); }
+
+ template<class _InputIterator>
+ hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n)
+ : _M_ht(__n, hasher(), key_equal(), allocator_type())
+ { _M_ht.insert_equal(__f, __l); }
+
+ template<class _InputIterator>
+ hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf)
+ : _M_ht(__n, __hf, key_equal(), allocator_type())
+ { _M_ht.insert_equal(__f, __l); }
+
+ template<class _InputIterator>
+ hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _M_ht(__n, __hf, __eql, __a)
+ { _M_ht.insert_equal(__f, __l); }
+
+ size_type
+ size() const
+ { return _M_ht.size(); }
+
+ size_type
+ max_size() const
+ { return _M_ht.max_size(); }
+
+ bool
+ empty() const
+ { return _M_ht.empty(); }
+
+ void
+ swap(hash_multimap& __hs)
+ { _M_ht.swap(__hs._M_ht); }
+
+ template<class _K1, class _T1, class _HF, class _EqK, class _Al>
+ friend bool
+ operator==(const hash_multimap<_K1, _T1, _HF, _EqK, _Al>&,
+ const hash_multimap<_K1, _T1, _HF, _EqK, _Al>&);
+
+ iterator
+ begin()
+ { return _M_ht.begin(); }
+
+ iterator
+ end()
+ { return _M_ht.end(); }
+
+ const_iterator
+ begin() const
+ { return _M_ht.begin(); }
+
+ const_iterator
+ end() const
+ { return _M_ht.end(); }
+
+ iterator
+ insert(const value_type& __obj)
+ { return _M_ht.insert_equal(__obj); }
+
+ template<class _InputIterator>
+ void
+ insert(_InputIterator __f, _InputIterator __l)
+ { _M_ht.insert_equal(__f,__l); }
+
+ iterator
+ insert_noresize(const value_type& __obj)
+ { return _M_ht.insert_equal_noresize(__obj); }
+
+ iterator
+ find(const key_type& __key)
+ { return _M_ht.find(__key); }
+
+ const_iterator
+ find(const key_type& __key) const
+ { return _M_ht.find(__key); }
+
+ size_type
+ count(const key_type& __key) const
+ { return _M_ht.count(__key); }
+
+ pair<iterator, iterator>
+ equal_range(const key_type& __key)
+ { return _M_ht.equal_range(__key); }
+
+ pair<const_iterator, const_iterator>
+ equal_range(const key_type& __key) const
+ { return _M_ht.equal_range(__key); }
+
+ size_type
+ erase(const key_type& __key)
+ { return _M_ht.erase(__key); }
+
+ void
+ erase(iterator __it)
+ { _M_ht.erase(__it); }
+
+ void
+ erase(iterator __f, iterator __l)
+ { _M_ht.erase(__f, __l); }
+
+ void
+ clear()
+ { _M_ht.clear(); }
+
+ void
+ resize(size_type __hint)
+ { _M_ht.resize(__hint); }
+
+ size_type
+ bucket_count() const
+ { return _M_ht.bucket_count(); }
+
+ size_type
+ max_bucket_count() const
+ { return _M_ht.max_bucket_count(); }
+
+ size_type
+ elems_in_bucket(size_type __n) const
+ { return _M_ht.elems_in_bucket(__n); }
+ };
+
+ template<class _Key, class _Tp, class _HF, class _EqKey, class _Alloc>
+ inline bool
+ operator==(const hash_multimap<_Key, _Tp, _HF, _EqKey, _Alloc>& __hm1,
+ const hash_multimap<_Key, _Tp, _HF, _EqKey, _Alloc>& __hm2)
+ { return __hm1._M_ht == __hm2._M_ht; }
+
+ template<class _Key, class _Tp, class _HF, class _EqKey, class _Alloc>
+ inline bool
+ operator!=(const hash_multimap<_Key, _Tp, _HF, _EqKey, _Alloc>& __hm1,
+ const hash_multimap<_Key, _Tp, _HF, _EqKey, _Alloc>& __hm2)
+ { return !(__hm1 == __hm2); }
+
+ template<class _Key, class _Tp, class _HashFn, class _EqlKey, class _Alloc>
+ inline void
+ swap(hash_multimap<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm1,
+ hash_multimap<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm2)
+ { __hm1.swap(__hm2); }
+
+_GLIBCXX_END_NAMESPACE
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // Specialization of insert_iterator so that it will work for hash_map
+ // and hash_multimap.
+ template<class _Key, class _Tp, class _HashFn, class _EqKey, class _Alloc>
+ class insert_iterator<__gnu_cxx::hash_map<_Key, _Tp, _HashFn,
+ _EqKey, _Alloc> >
+ {
+ protected:
+ typedef __gnu_cxx::hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc>
+ _Container;
+ _Container* container;
+
+ public:
+ typedef _Container container_type;
+ typedef output_iterator_tag iterator_category;
+ typedef void value_type;
+ typedef void difference_type;
+ typedef void pointer;
+ typedef void reference;
+
+ insert_iterator(_Container& __x)
+ : container(&__x) {}
+
+ insert_iterator(_Container& __x, typename _Container::iterator)
+ : container(&__x) {}
+
+ insert_iterator<_Container>&
+ operator=(const typename _Container::value_type& __value)
+ {
+ container->insert(__value);
+ return *this;
+ }
+
+ insert_iterator<_Container>&
+ operator*()
+ { return *this; }
+
+ insert_iterator<_Container>&
+ operator++() { return *this; }
+
+ insert_iterator<_Container>&
+ operator++(int)
+ { return *this; }
+ };
+
+ template<class _Key, class _Tp, class _HashFn, class _EqKey, class _Alloc>
+ class insert_iterator<__gnu_cxx::hash_multimap<_Key, _Tp, _HashFn,
+ _EqKey, _Alloc> >
+ {
+ protected:
+ typedef __gnu_cxx::hash_multimap<_Key, _Tp, _HashFn, _EqKey, _Alloc>
+ _Container;
+ _Container* container;
+ typename _Container::iterator iter;
+
+ public:
+ typedef _Container container_type;
+ typedef output_iterator_tag iterator_category;
+ typedef void value_type;
+ typedef void difference_type;
+ typedef void pointer;
+ typedef void reference;
+
+ insert_iterator(_Container& __x)
+ : container(&__x) {}
+
+ insert_iterator(_Container& __x, typename _Container::iterator)
+ : container(&__x) {}
+
+ insert_iterator<_Container>&
+ operator=(const typename _Container::value_type& __value)
+ {
+ container->insert(__value);
+ return *this;
+ }
+
+ insert_iterator<_Container>&
+ operator*()
+ { return *this; }
+
+ insert_iterator<_Container>&
+ operator++()
+ { return *this; }
+
+ insert_iterator<_Container>&
+ operator++(int)
+ { return *this; }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/backward/hash_set b/i686-linux/include/c++/4.4.3/backward/hash_set
new file mode 100644
index 0000000..8e365bd
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/backward/hash_set
@@ -0,0 +1,561 @@
+// Hashing set implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2004, 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1996
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ */
+
+/** @file backward/hash_set
+ * This file is a GNU extension to the Standard C++ Library (possibly
+ * containing extensions from the HP/SGI STL subset).
+ */
+
+#ifndef _HASH_SET
+#define _HASH_SET 1
+
+#ifndef _GLIBCXX_PERMIT_BACKWARD_HASH
+#include "backward_warning.h"
+#endif
+
+#include <bits/c++config.h>
+#include <backward/hashtable.h>
+#include <bits/concept_check.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::equal_to;
+ using std::allocator;
+ using std::pair;
+ using std::_Identity;
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template<class _Value, class _HashFcn = hash<_Value>,
+ class _EqualKey = equal_to<_Value>,
+ class _Alloc = allocator<_Value> >
+ class hash_set
+ {
+ // concept requirements
+ __glibcxx_class_requires(_Value, _SGIAssignableConcept)
+ __glibcxx_class_requires3(_HashFcn, size_t, _Value, _UnaryFunctionConcept)
+ __glibcxx_class_requires3(_EqualKey, _Value, _Value, _BinaryPredicateConcept)
+
+ private:
+ typedef hashtable<_Value, _Value, _HashFcn, _Identity<_Value>,
+ _EqualKey, _Alloc> _Ht;
+ _Ht _M_ht;
+
+ public:
+ typedef typename _Ht::key_type key_type;
+ typedef typename _Ht::value_type value_type;
+ typedef typename _Ht::hasher hasher;
+ typedef typename _Ht::key_equal key_equal;
+
+ typedef typename _Ht::size_type size_type;
+ typedef typename _Ht::difference_type difference_type;
+ typedef typename _Alloc::pointer pointer;
+ typedef typename _Alloc::const_pointer const_pointer;
+ typedef typename _Alloc::reference reference;
+ typedef typename _Alloc::const_reference const_reference;
+
+ typedef typename _Ht::const_iterator iterator;
+ typedef typename _Ht::const_iterator const_iterator;
+
+ typedef typename _Ht::allocator_type allocator_type;
+
+ hasher
+ hash_funct() const
+ { return _M_ht.hash_funct(); }
+
+ key_equal
+ key_eq() const
+ { return _M_ht.key_eq(); }
+
+ allocator_type
+ get_allocator() const
+ { return _M_ht.get_allocator(); }
+
+ hash_set()
+ : _M_ht(100, hasher(), key_equal(), allocator_type()) {}
+
+ explicit
+ hash_set(size_type __n)
+ : _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
+
+ hash_set(size_type __n, const hasher& __hf)
+ : _M_ht(__n, __hf, key_equal(), allocator_type()) {}
+
+ hash_set(size_type __n, const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _M_ht(__n, __hf, __eql, __a) {}
+
+ template<class _InputIterator>
+ hash_set(_InputIterator __f, _InputIterator __l)
+ : _M_ht(100, hasher(), key_equal(), allocator_type())
+ { _M_ht.insert_unique(__f, __l); }
+
+ template<class _InputIterator>
+ hash_set(_InputIterator __f, _InputIterator __l, size_type __n)
+ : _M_ht(__n, hasher(), key_equal(), allocator_type())
+ { _M_ht.insert_unique(__f, __l); }
+
+ template<class _InputIterator>
+ hash_set(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf)
+ : _M_ht(__n, __hf, key_equal(), allocator_type())
+ { _M_ht.insert_unique(__f, __l); }
+
+ template<class _InputIterator>
+ hash_set(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _M_ht(__n, __hf, __eql, __a)
+ { _M_ht.insert_unique(__f, __l); }
+
+ size_type
+ size() const
+ { return _M_ht.size(); }
+
+ size_type
+ max_size() const
+ { return _M_ht.max_size(); }
+
+ bool
+ empty() const
+ { return _M_ht.empty(); }
+
+ void
+ swap(hash_set& __hs)
+ { _M_ht.swap(__hs._M_ht); }
+
+ template<class _Val, class _HF, class _EqK, class _Al>
+ friend bool
+ operator==(const hash_set<_Val, _HF, _EqK, _Al>&,
+ const hash_set<_Val, _HF, _EqK, _Al>&);
+
+ iterator
+ begin() const
+ { return _M_ht.begin(); }
+
+ iterator
+ end() const
+ { return _M_ht.end(); }
+
+ pair<iterator, bool>
+ insert(const value_type& __obj)
+ {
+ pair<typename _Ht::iterator, bool> __p = _M_ht.insert_unique(__obj);
+ return pair<iterator,bool>(__p.first, __p.second);
+ }
+
+ template<class _InputIterator>
+ void
+ insert(_InputIterator __f, _InputIterator __l)
+ { _M_ht.insert_unique(__f, __l); }
+
+ pair<iterator, bool>
+ insert_noresize(const value_type& __obj)
+ {
+ pair<typename _Ht::iterator, bool> __p
+ = _M_ht.insert_unique_noresize(__obj);
+ return pair<iterator, bool>(__p.first, __p.second);
+ }
+
+ iterator
+ find(const key_type& __key) const
+ { return _M_ht.find(__key); }
+
+ size_type
+ count(const key_type& __key) const
+ { return _M_ht.count(__key); }
+
+ pair<iterator, iterator>
+ equal_range(const key_type& __key) const
+ { return _M_ht.equal_range(__key); }
+
+ size_type
+ erase(const key_type& __key)
+ {return _M_ht.erase(__key); }
+
+ void
+ erase(iterator __it)
+ { _M_ht.erase(__it); }
+
+ void
+ erase(iterator __f, iterator __l)
+ { _M_ht.erase(__f, __l); }
+
+ void
+ clear()
+ { _M_ht.clear(); }
+
+ void
+ resize(size_type __hint)
+ { _M_ht.resize(__hint); }
+
+ size_type
+ bucket_count() const
+ { return _M_ht.bucket_count(); }
+
+ size_type
+ max_bucket_count() const
+ { return _M_ht.max_bucket_count(); }
+
+ size_type
+ elems_in_bucket(size_type __n) const
+ { return _M_ht.elems_in_bucket(__n); }
+ };
+
+ template<class _Value, class _HashFcn, class _EqualKey, class _Alloc>
+ inline bool
+ operator==(const hash_set<_Value, _HashFcn, _EqualKey, _Alloc>& __hs1,
+ const hash_set<_Value, _HashFcn, _EqualKey, _Alloc>& __hs2)
+ { return __hs1._M_ht == __hs2._M_ht; }
+
+ template<class _Value, class _HashFcn, class _EqualKey, class _Alloc>
+ inline bool
+ operator!=(const hash_set<_Value, _HashFcn, _EqualKey, _Alloc>& __hs1,
+ const hash_set<_Value, _HashFcn, _EqualKey, _Alloc>& __hs2)
+ { return !(__hs1 == __hs2); }
+
+ template<class _Val, class _HashFcn, class _EqualKey, class _Alloc>
+ inline void
+ swap(hash_set<_Val, _HashFcn, _EqualKey, _Alloc>& __hs1,
+ hash_set<_Val, _HashFcn, _EqualKey, _Alloc>& __hs2)
+ { __hs1.swap(__hs2); }
+
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template<class _Value,
+ class _HashFcn = hash<_Value>,
+ class _EqualKey = equal_to<_Value>,
+ class _Alloc = allocator<_Value> >
+ class hash_multiset
+ {
+ // concept requirements
+ __glibcxx_class_requires(_Value, _SGIAssignableConcept)
+ __glibcxx_class_requires3(_HashFcn, size_t, _Value, _UnaryFunctionConcept)
+ __glibcxx_class_requires3(_EqualKey, _Value, _Value, _BinaryPredicateConcept)
+
+ private:
+ typedef hashtable<_Value, _Value, _HashFcn, _Identity<_Value>,
+ _EqualKey, _Alloc> _Ht;
+ _Ht _M_ht;
+
+ public:
+ typedef typename _Ht::key_type key_type;
+ typedef typename _Ht::value_type value_type;
+ typedef typename _Ht::hasher hasher;
+ typedef typename _Ht::key_equal key_equal;
+
+ typedef typename _Ht::size_type size_type;
+ typedef typename _Ht::difference_type difference_type;
+ typedef typename _Alloc::pointer pointer;
+ typedef typename _Alloc::const_pointer const_pointer;
+ typedef typename _Alloc::reference reference;
+ typedef typename _Alloc::const_reference const_reference;
+
+ typedef typename _Ht::const_iterator iterator;
+ typedef typename _Ht::const_iterator const_iterator;
+
+ typedef typename _Ht::allocator_type allocator_type;
+
+ hasher
+ hash_funct() const
+ { return _M_ht.hash_funct(); }
+
+ key_equal
+ key_eq() const
+ { return _M_ht.key_eq(); }
+
+ allocator_type
+ get_allocator() const
+ { return _M_ht.get_allocator(); }
+
+ hash_multiset()
+ : _M_ht(100, hasher(), key_equal(), allocator_type()) {}
+
+ explicit
+ hash_multiset(size_type __n)
+ : _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
+
+ hash_multiset(size_type __n, const hasher& __hf)
+ : _M_ht(__n, __hf, key_equal(), allocator_type()) {}
+
+ hash_multiset(size_type __n, const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _M_ht(__n, __hf, __eql, __a) {}
+
+ template<class _InputIterator>
+ hash_multiset(_InputIterator __f, _InputIterator __l)
+ : _M_ht(100, hasher(), key_equal(), allocator_type())
+ { _M_ht.insert_equal(__f, __l); }
+
+ template<class _InputIterator>
+ hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n)
+ : _M_ht(__n, hasher(), key_equal(), allocator_type())
+ { _M_ht.insert_equal(__f, __l); }
+
+ template<class _InputIterator>
+ hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf)
+ : _M_ht(__n, __hf, key_equal(), allocator_type())
+ { _M_ht.insert_equal(__f, __l); }
+
+ template<class _InputIterator>
+ hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _M_ht(__n, __hf, __eql, __a)
+ { _M_ht.insert_equal(__f, __l); }
+
+ size_type
+ size() const
+ { return _M_ht.size(); }
+
+ size_type
+ max_size() const
+ { return _M_ht.max_size(); }
+
+ bool
+ empty() const
+ { return _M_ht.empty(); }
+
+ void
+ swap(hash_multiset& hs)
+ { _M_ht.swap(hs._M_ht); }
+
+ template<class _Val, class _HF, class _EqK, class _Al>
+ friend bool
+ operator==(const hash_multiset<_Val, _HF, _EqK, _Al>&,
+ const hash_multiset<_Val, _HF, _EqK, _Al>&);
+
+ iterator
+ begin() const
+ { return _M_ht.begin(); }
+
+ iterator
+ end() const
+ { return _M_ht.end(); }
+
+ iterator
+ insert(const value_type& __obj)
+ { return _M_ht.insert_equal(__obj); }
+
+ template<class _InputIterator>
+ void
+ insert(_InputIterator __f, _InputIterator __l)
+ { _M_ht.insert_equal(__f,__l); }
+
+ iterator
+ insert_noresize(const value_type& __obj)
+ { return _M_ht.insert_equal_noresize(__obj); }
+
+ iterator
+ find(const key_type& __key) const
+ { return _M_ht.find(__key); }
+
+ size_type
+ count(const key_type& __key) const
+ { return _M_ht.count(__key); }
+
+ pair<iterator, iterator>
+ equal_range(const key_type& __key) const
+ { return _M_ht.equal_range(__key); }
+
+ size_type
+ erase(const key_type& __key)
+ { return _M_ht.erase(__key); }
+
+ void
+ erase(iterator __it)
+ { _M_ht.erase(__it); }
+
+ void
+ erase(iterator __f, iterator __l)
+ { _M_ht.erase(__f, __l); }
+
+ void
+ clear()
+ { _M_ht.clear(); }
+
+ void
+ resize(size_type __hint)
+ { _M_ht.resize(__hint); }
+
+ size_type
+ bucket_count() const
+ { return _M_ht.bucket_count(); }
+
+ size_type
+ max_bucket_count() const
+ { return _M_ht.max_bucket_count(); }
+
+ size_type
+ elems_in_bucket(size_type __n) const
+ { return _M_ht.elems_in_bucket(__n); }
+ };
+
+ template<class _Val, class _HashFcn, class _EqualKey, class _Alloc>
+ inline bool
+ operator==(const hash_multiset<_Val, _HashFcn, _EqualKey, _Alloc>& __hs1,
+ const hash_multiset<_Val, _HashFcn, _EqualKey, _Alloc>& __hs2)
+ { return __hs1._M_ht == __hs2._M_ht; }
+
+ template<class _Val, class _HashFcn, class _EqualKey, class _Alloc>
+ inline bool
+ operator!=(const hash_multiset<_Val, _HashFcn, _EqualKey, _Alloc>& __hs1,
+ const hash_multiset<_Val, _HashFcn, _EqualKey, _Alloc>& __hs2)
+ { return !(__hs1 == __hs2); }
+
+ template<class _Val, class _HashFcn, class _EqualKey, class _Alloc>
+ inline void
+ swap(hash_multiset<_Val, _HashFcn, _EqualKey, _Alloc>& __hs1,
+ hash_multiset<_Val, _HashFcn, _EqualKey, _Alloc>& __hs2)
+ { __hs1.swap(__hs2); }
+
+_GLIBCXX_END_NAMESPACE
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // Specialization of insert_iterator so that it will work for hash_set
+ // and hash_multiset.
+ template<class _Value, class _HashFcn, class _EqualKey, class _Alloc>
+ class insert_iterator<__gnu_cxx::hash_set<_Value, _HashFcn,
+ _EqualKey, _Alloc> >
+ {
+ protected:
+ typedef __gnu_cxx::hash_set<_Value, _HashFcn, _EqualKey, _Alloc>
+ _Container;
+ _Container* container;
+
+ public:
+ typedef _Container container_type;
+ typedef output_iterator_tag iterator_category;
+ typedef void value_type;
+ typedef void difference_type;
+ typedef void pointer;
+ typedef void reference;
+
+ insert_iterator(_Container& __x)
+ : container(&__x) {}
+
+ insert_iterator(_Container& __x, typename _Container::iterator)
+ : container(&__x) {}
+
+ insert_iterator<_Container>&
+ operator=(const typename _Container::value_type& __value)
+ {
+ container->insert(__value);
+ return *this;
+ }
+
+ insert_iterator<_Container>&
+ operator*()
+ { return *this; }
+
+ insert_iterator<_Container>&
+ operator++()
+ { return *this; }
+
+ insert_iterator<_Container>&
+ operator++(int)
+ { return *this; }
+ };
+
+ template<class _Value, class _HashFcn, class _EqualKey, class _Alloc>
+ class insert_iterator<__gnu_cxx::hash_multiset<_Value, _HashFcn,
+ _EqualKey, _Alloc> >
+ {
+ protected:
+ typedef __gnu_cxx::hash_multiset<_Value, _HashFcn, _EqualKey, _Alloc>
+ _Container;
+ _Container* container;
+ typename _Container::iterator iter;
+
+ public:
+ typedef _Container container_type;
+ typedef output_iterator_tag iterator_category;
+ typedef void value_type;
+ typedef void difference_type;
+ typedef void pointer;
+ typedef void reference;
+
+ insert_iterator(_Container& __x)
+ : container(&__x) {}
+
+ insert_iterator(_Container& __x, typename _Container::iterator)
+ : container(&__x) {}
+
+ insert_iterator<_Container>&
+ operator=(const typename _Container::value_type& __value)
+ {
+ container->insert(__value);
+ return *this;
+ }
+
+ insert_iterator<_Container>&
+ operator*()
+ { return *this; }
+
+ insert_iterator<_Container>&
+ operator++()
+ { return *this; }
+
+ insert_iterator<_Container>&
+ operator++(int) { return *this; }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/backward/hashtable.h b/i686-linux/include/c++/4.4.3/backward/hashtable.h
new file mode 100644
index 0000000..4d74eaf
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/backward/hashtable.h
@@ -0,0 +1,1147 @@
+// Hashtable implementation used by containers -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ */
+
+/** @file backward/hashtable.h
+ * This file is a GNU extension to the Standard C++ Library (possibly
+ * containing extensions from the HP/SGI STL subset).
+ */
+
+#ifndef _HASHTABLE_H
+#define _HASHTABLE_H 1
+
+// Hashtable class, used to implement the hashed associative containers
+// hash_set, hash_map, hash_multiset, and hash_multimap.
+
+#include <vector>
+#include <iterator>
+#include <algorithm>
+#include <bits/stl_function.h>
+#include <backward/hash_fun.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::size_t;
+ using std::ptrdiff_t;
+ using std::forward_iterator_tag;
+ using std::input_iterator_tag;
+ using std::_Construct;
+ using std::_Destroy;
+ using std::distance;
+ using std::vector;
+ using std::pair;
+ using std::__iterator_category;
+
+ template<class _Val>
+ struct _Hashtable_node
+ {
+ _Hashtable_node* _M_next;
+ _Val _M_val;
+ };
+
+ template<class _Val, class _Key, class _HashFcn, class _ExtractKey,
+ class _EqualKey, class _Alloc = std::allocator<_Val> >
+ class hashtable;
+
+ template<class _Val, class _Key, class _HashFcn,
+ class _ExtractKey, class _EqualKey, class _Alloc>
+ struct _Hashtable_iterator;
+
+ template<class _Val, class _Key, class _HashFcn,
+ class _ExtractKey, class _EqualKey, class _Alloc>
+ struct _Hashtable_const_iterator;
+
+ template<class _Val, class _Key, class _HashFcn,
+ class _ExtractKey, class _EqualKey, class _Alloc>
+ struct _Hashtable_iterator
+ {
+ typedef hashtable<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc>
+ _Hashtable;
+ typedef _Hashtable_iterator<_Val, _Key, _HashFcn,
+ _ExtractKey, _EqualKey, _Alloc>
+ iterator;
+ typedef _Hashtable_const_iterator<_Val, _Key, _HashFcn,
+ _ExtractKey, _EqualKey, _Alloc>
+ const_iterator;
+ typedef _Hashtable_node<_Val> _Node;
+ typedef forward_iterator_tag iterator_category;
+ typedef _Val value_type;
+ typedef ptrdiff_t difference_type;
+ typedef size_t size_type;
+ typedef _Val& reference;
+ typedef _Val* pointer;
+
+ _Node* _M_cur;
+ _Hashtable* _M_ht;
+
+ _Hashtable_iterator(_Node* __n, _Hashtable* __tab)
+ : _M_cur(__n), _M_ht(__tab) { }
+
+ _Hashtable_iterator()
+ : _M_cur(0), _M_ht(0) { }
+
+ reference
+ operator*() const
+ { return _M_cur->_M_val; }
+
+ pointer
+ operator->() const
+ { return &(operator*()); }
+
+ iterator&
+ operator++();
+
+ iterator
+ operator++(int);
+
+ bool
+ operator==(const iterator& __it) const
+ { return _M_cur == __it._M_cur; }
+
+ bool
+ operator!=(const iterator& __it) const
+ { return _M_cur != __it._M_cur; }
+ };
+
+ template<class _Val, class _Key, class _HashFcn,
+ class _ExtractKey, class _EqualKey, class _Alloc>
+ struct _Hashtable_const_iterator
+ {
+ typedef hashtable<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc>
+ _Hashtable;
+ typedef _Hashtable_iterator<_Val,_Key,_HashFcn,
+ _ExtractKey,_EqualKey,_Alloc>
+ iterator;
+ typedef _Hashtable_const_iterator<_Val, _Key, _HashFcn,
+ _ExtractKey, _EqualKey, _Alloc>
+ const_iterator;
+ typedef _Hashtable_node<_Val> _Node;
+
+ typedef forward_iterator_tag iterator_category;
+ typedef _Val value_type;
+ typedef ptrdiff_t difference_type;
+ typedef size_t size_type;
+ typedef const _Val& reference;
+ typedef const _Val* pointer;
+
+ const _Node* _M_cur;
+ const _Hashtable* _M_ht;
+
+ _Hashtable_const_iterator(const _Node* __n, const _Hashtable* __tab)
+ : _M_cur(__n), _M_ht(__tab) { }
+
+ _Hashtable_const_iterator() { }
+
+ _Hashtable_const_iterator(const iterator& __it)
+ : _M_cur(__it._M_cur), _M_ht(__it._M_ht) { }
+
+ reference
+ operator*() const
+ { return _M_cur->_M_val; }
+
+ pointer
+ operator->() const
+ { return &(operator*()); }
+
+ const_iterator&
+ operator++();
+
+ const_iterator
+ operator++(int);
+
+ bool
+ operator==(const const_iterator& __it) const
+ { return _M_cur == __it._M_cur; }
+
+ bool
+ operator!=(const const_iterator& __it) const
+ { return _M_cur != __it._M_cur; }
+ };
+
+ // Note: assumes long is at least 32 bits.
+ enum { _S_num_primes = 29 };
+
+ static const unsigned long __stl_prime_list[_S_num_primes] =
+ {
+ 5ul, 53ul, 97ul, 193ul, 389ul,
+ 769ul, 1543ul, 3079ul, 6151ul, 12289ul,
+ 24593ul, 49157ul, 98317ul, 196613ul, 393241ul,
+ 786433ul, 1572869ul, 3145739ul, 6291469ul, 12582917ul,
+ 25165843ul, 50331653ul, 100663319ul, 201326611ul, 402653189ul,
+ 805306457ul, 1610612741ul, 3221225473ul, 4294967291ul
+ };
+
+ inline unsigned long
+ __stl_next_prime(unsigned long __n)
+ {
+ const unsigned long* __first = __stl_prime_list;
+ const unsigned long* __last = __stl_prime_list + (int)_S_num_primes;
+ const unsigned long* pos = std::lower_bound(__first, __last, __n);
+ return pos == __last ? *(__last - 1) : *pos;
+ }
+
+ // Forward declaration of operator==.
+ template<class _Val, class _Key, class _HF, class _Ex,
+ class _Eq, class _All>
+ class hashtable;
+
+ template<class _Val, class _Key, class _HF, class _Ex,
+ class _Eq, class _All>
+ bool
+ operator==(const hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>& __ht1,
+ const hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>& __ht2);
+
+ // Hashtables handle allocators a bit differently than other
+ // containers do. If we're using standard-conforming allocators, then
+ // a hashtable unconditionally has a member variable to hold its
+ // allocator, even if it so happens that all instances of the
+ // allocator type are identical. This is because, for hashtables,
+ // this extra storage is negligible. Additionally, a base class
+ // wouldn't serve any other purposes; it wouldn't, for example,
+ // simplify the exception-handling code.
+ template<class _Val, class _Key, class _HashFcn,
+ class _ExtractKey, class _EqualKey, class _Alloc>
+ class hashtable
+ {
+ public:
+ typedef _Key key_type;
+ typedef _Val value_type;
+ typedef _HashFcn hasher;
+ typedef _EqualKey key_equal;
+
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef value_type* pointer;
+ typedef const value_type* const_pointer;
+ typedef value_type& reference;
+ typedef const value_type& const_reference;
+
+ hasher
+ hash_funct() const
+ { return _M_hash; }
+
+ key_equal
+ key_eq() const
+ { return _M_equals; }
+
+ private:
+ typedef _Hashtable_node<_Val> _Node;
+
+ public:
+ typedef typename _Alloc::template rebind<value_type>::other allocator_type;
+ allocator_type
+ get_allocator() const
+ { return _M_node_allocator; }
+
+ private:
+ typedef typename _Alloc::template rebind<_Node>::other _Node_Alloc;
+ typedef typename _Alloc::template rebind<_Node*>::other _Nodeptr_Alloc;
+ typedef vector<_Node*, _Nodeptr_Alloc> _Vector_type;
+
+ _Node_Alloc _M_node_allocator;
+
+ _Node*
+ _M_get_node()
+ { return _M_node_allocator.allocate(1); }
+
+ void
+ _M_put_node(_Node* __p)
+ { _M_node_allocator.deallocate(__p, 1); }
+
+ private:
+ hasher _M_hash;
+ key_equal _M_equals;
+ _ExtractKey _M_get_key;
+ _Vector_type _M_buckets;
+ size_type _M_num_elements;
+
+ public:
+ typedef _Hashtable_iterator<_Val, _Key, _HashFcn, _ExtractKey,
+ _EqualKey, _Alloc>
+ iterator;
+ typedef _Hashtable_const_iterator<_Val, _Key, _HashFcn, _ExtractKey,
+ _EqualKey, _Alloc>
+ const_iterator;
+
+ friend struct
+ _Hashtable_iterator<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc>;
+
+ friend struct
+ _Hashtable_const_iterator<_Val, _Key, _HashFcn, _ExtractKey,
+ _EqualKey, _Alloc>;
+
+ public:
+ hashtable(size_type __n, const _HashFcn& __hf,
+ const _EqualKey& __eql, const _ExtractKey& __ext,
+ const allocator_type& __a = allocator_type())
+ : _M_node_allocator(__a), _M_hash(__hf), _M_equals(__eql),
+ _M_get_key(__ext), _M_buckets(__a), _M_num_elements(0)
+ { _M_initialize_buckets(__n); }
+
+ hashtable(size_type __n, const _HashFcn& __hf,
+ const _EqualKey& __eql,
+ const allocator_type& __a = allocator_type())
+ : _M_node_allocator(__a), _M_hash(__hf), _M_equals(__eql),
+ _M_get_key(_ExtractKey()), _M_buckets(__a), _M_num_elements(0)
+ { _M_initialize_buckets(__n); }
+
+ hashtable(const hashtable& __ht)
+ : _M_node_allocator(__ht.get_allocator()), _M_hash(__ht._M_hash),
+ _M_equals(__ht._M_equals), _M_get_key(__ht._M_get_key),
+ _M_buckets(__ht.get_allocator()), _M_num_elements(0)
+ { _M_copy_from(__ht); }
+
+ hashtable&
+ operator= (const hashtable& __ht)
+ {
+ if (&__ht != this)
+ {
+ clear();
+ _M_hash = __ht._M_hash;
+ _M_equals = __ht._M_equals;
+ _M_get_key = __ht._M_get_key;
+ _M_copy_from(__ht);
+ }
+ return *this;
+ }
+
+ ~hashtable()
+ { clear(); }
+
+ size_type
+ size() const
+ { return _M_num_elements; }
+
+ size_type
+ max_size() const
+ { return size_type(-1); }
+
+ bool
+ empty() const
+ { return size() == 0; }
+
+ void
+ swap(hashtable& __ht)
+ {
+ std::swap(_M_hash, __ht._M_hash);
+ std::swap(_M_equals, __ht._M_equals);
+ std::swap(_M_get_key, __ht._M_get_key);
+ _M_buckets.swap(__ht._M_buckets);
+ std::swap(_M_num_elements, __ht._M_num_elements);
+ }
+
+ iterator
+ begin()
+ {
+ for (size_type __n = 0; __n < _M_buckets.size(); ++__n)
+ if (_M_buckets[__n])
+ return iterator(_M_buckets[__n], this);
+ return end();
+ }
+
+ iterator
+ end()
+ { return iterator(0, this); }
+
+ const_iterator
+ begin() const
+ {
+ for (size_type __n = 0; __n < _M_buckets.size(); ++__n)
+ if (_M_buckets[__n])
+ return const_iterator(_M_buckets[__n], this);
+ return end();
+ }
+
+ const_iterator
+ end() const
+ { return const_iterator(0, this); }
+
+ template<class _Vl, class _Ky, class _HF, class _Ex, class _Eq,
+ class _Al>
+ friend bool
+ operator==(const hashtable<_Vl, _Ky, _HF, _Ex, _Eq, _Al>&,
+ const hashtable<_Vl, _Ky, _HF, _Ex, _Eq, _Al>&);
+
+ public:
+ size_type
+ bucket_count() const
+ { return _M_buckets.size(); }
+
+ size_type
+ max_bucket_count() const
+ { return __stl_prime_list[(int)_S_num_primes - 1]; }
+
+ size_type
+ elems_in_bucket(size_type __bucket) const
+ {
+ size_type __result = 0;
+ for (_Node* __n = _M_buckets[__bucket]; __n; __n = __n->_M_next)
+ __result += 1;
+ return __result;
+ }
+
+ pair<iterator, bool>
+ insert_unique(const value_type& __obj)
+ {
+ resize(_M_num_elements + 1);
+ return insert_unique_noresize(__obj);
+ }
+
+ iterator
+ insert_equal(const value_type& __obj)
+ {
+ resize(_M_num_elements + 1);
+ return insert_equal_noresize(__obj);
+ }
+
+ pair<iterator, bool>
+ insert_unique_noresize(const value_type& __obj);
+
+ iterator
+ insert_equal_noresize(const value_type& __obj);
+
+ template<class _InputIterator>
+ void
+ insert_unique(_InputIterator __f, _InputIterator __l)
+ { insert_unique(__f, __l, __iterator_category(__f)); }
+
+ template<class _InputIterator>
+ void
+ insert_equal(_InputIterator __f, _InputIterator __l)
+ { insert_equal(__f, __l, __iterator_category(__f)); }
+
+ template<class _InputIterator>
+ void
+ insert_unique(_InputIterator __f, _InputIterator __l,
+ input_iterator_tag)
+ {
+ for ( ; __f != __l; ++__f)
+ insert_unique(*__f);
+ }
+
+ template<class _InputIterator>
+ void
+ insert_equal(_InputIterator __f, _InputIterator __l,
+ input_iterator_tag)
+ {
+ for ( ; __f != __l; ++__f)
+ insert_equal(*__f);
+ }
+
+ template<class _ForwardIterator>
+ void
+ insert_unique(_ForwardIterator __f, _ForwardIterator __l,
+ forward_iterator_tag)
+ {
+ size_type __n = distance(__f, __l);
+ resize(_M_num_elements + __n);
+ for ( ; __n > 0; --__n, ++__f)
+ insert_unique_noresize(*__f);
+ }
+
+ template<class _ForwardIterator>
+ void
+ insert_equal(_ForwardIterator __f, _ForwardIterator __l,
+ forward_iterator_tag)
+ {
+ size_type __n = distance(__f, __l);
+ resize(_M_num_elements + __n);
+ for ( ; __n > 0; --__n, ++__f)
+ insert_equal_noresize(*__f);
+ }
+
+ reference
+ find_or_insert(const value_type& __obj);
+
+ iterator
+ find(const key_type& __key)
+ {
+ size_type __n = _M_bkt_num_key(__key);
+ _Node* __first;
+ for (__first = _M_buckets[__n];
+ __first && !_M_equals(_M_get_key(__first->_M_val), __key);
+ __first = __first->_M_next)
+ { }
+ return iterator(__first, this);
+ }
+
+ const_iterator
+ find(const key_type& __key) const
+ {
+ size_type __n = _M_bkt_num_key(__key);
+ const _Node* __first;
+ for (__first = _M_buckets[__n];
+ __first && !_M_equals(_M_get_key(__first->_M_val), __key);
+ __first = __first->_M_next)
+ { }
+ return const_iterator(__first, this);
+ }
+
+ size_type
+ count(const key_type& __key) const
+ {
+ const size_type __n = _M_bkt_num_key(__key);
+ size_type __result = 0;
+
+ for (const _Node* __cur = _M_buckets[__n]; __cur;
+ __cur = __cur->_M_next)
+ if (_M_equals(_M_get_key(__cur->_M_val), __key))
+ ++__result;
+ return __result;
+ }
+
+ pair<iterator, iterator>
+ equal_range(const key_type& __key);
+
+ pair<const_iterator, const_iterator>
+ equal_range(const key_type& __key) const;
+
+ size_type
+ erase(const key_type& __key);
+
+ void
+ erase(const iterator& __it);
+
+ void
+ erase(iterator __first, iterator __last);
+
+ void
+ erase(const const_iterator& __it);
+
+ void
+ erase(const_iterator __first, const_iterator __last);
+
+ void
+ resize(size_type __num_elements_hint);
+
+ void
+ clear();
+
+ private:
+ size_type
+ _M_next_size(size_type __n) const
+ { return __stl_next_prime(__n); }
+
+ void
+ _M_initialize_buckets(size_type __n)
+ {
+ const size_type __n_buckets = _M_next_size(__n);
+ _M_buckets.reserve(__n_buckets);
+ _M_buckets.insert(_M_buckets.end(), __n_buckets, (_Node*) 0);
+ _M_num_elements = 0;
+ }
+
+ size_type
+ _M_bkt_num_key(const key_type& __key) const
+ { return _M_bkt_num_key(__key, _M_buckets.size()); }
+
+ size_type
+ _M_bkt_num(const value_type& __obj) const
+ { return _M_bkt_num_key(_M_get_key(__obj)); }
+
+ size_type
+ _M_bkt_num_key(const key_type& __key, size_t __n) const
+ { return _M_hash(__key) % __n; }
+
+ size_type
+ _M_bkt_num(const value_type& __obj, size_t __n) const
+ { return _M_bkt_num_key(_M_get_key(__obj), __n); }
+
+ _Node*
+ _M_new_node(const value_type& __obj)
+ {
+ _Node* __n = _M_get_node();
+ __n->_M_next = 0;
+ __try
+ {
+ this->get_allocator().construct(&__n->_M_val, __obj);
+ return __n;
+ }
+ __catch(...)
+ {
+ _M_put_node(__n);
+ __throw_exception_again;
+ }
+ }
+
+ void
+ _M_delete_node(_Node* __n)
+ {
+ this->get_allocator().destroy(&__n->_M_val);
+ _M_put_node(__n);
+ }
+
+ void
+ _M_erase_bucket(const size_type __n, _Node* __first, _Node* __last);
+
+ void
+ _M_erase_bucket(const size_type __n, _Node* __last);
+
+ void
+ _M_copy_from(const hashtable& __ht);
+ };
+
+ template<class _Val, class _Key, class _HF, class _ExK, class _EqK,
+ class _All>
+ _Hashtable_iterator<_Val, _Key, _HF, _ExK, _EqK, _All>&
+ _Hashtable_iterator<_Val, _Key, _HF, _ExK, _EqK, _All>::
+ operator++()
+ {
+ const _Node* __old = _M_cur;
+ _M_cur = _M_cur->_M_next;
+ if (!_M_cur)
+ {
+ size_type __bucket = _M_ht->_M_bkt_num(__old->_M_val);
+ while (!_M_cur && ++__bucket < _M_ht->_M_buckets.size())
+ _M_cur = _M_ht->_M_buckets[__bucket];
+ }
+ return *this;
+ }
+
+ template<class _Val, class _Key, class _HF, class _ExK, class _EqK,
+ class _All>
+ inline _Hashtable_iterator<_Val, _Key, _HF, _ExK, _EqK, _All>
+ _Hashtable_iterator<_Val, _Key, _HF, _ExK, _EqK, _All>::
+ operator++(int)
+ {
+ iterator __tmp = *this;
+ ++*this;
+ return __tmp;
+ }
+
+ template<class _Val, class _Key, class _HF, class _ExK, class _EqK,
+ class _All>
+ _Hashtable_const_iterator<_Val, _Key, _HF, _ExK, _EqK, _All>&
+ _Hashtable_const_iterator<_Val, _Key, _HF, _ExK, _EqK, _All>::
+ operator++()
+ {
+ const _Node* __old = _M_cur;
+ _M_cur = _M_cur->_M_next;
+ if (!_M_cur)
+ {
+ size_type __bucket = _M_ht->_M_bkt_num(__old->_M_val);
+ while (!_M_cur && ++__bucket < _M_ht->_M_buckets.size())
+ _M_cur = _M_ht->_M_buckets[__bucket];
+ }
+ return *this;
+ }
+
+ template<class _Val, class _Key, class _HF, class _ExK, class _EqK,
+ class _All>
+ inline _Hashtable_const_iterator<_Val, _Key, _HF, _ExK, _EqK, _All>
+ _Hashtable_const_iterator<_Val, _Key, _HF, _ExK, _EqK, _All>::
+ operator++(int)
+ {
+ const_iterator __tmp = *this;
+ ++*this;
+ return __tmp;
+ }
+
+ template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+ bool
+ operator==(const hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>& __ht1,
+ const hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>& __ht2)
+ {
+ typedef typename hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::_Node _Node;
+
+ if (__ht1._M_buckets.size() != __ht2._M_buckets.size())
+ return false;
+
+ for (size_t __n = 0; __n < __ht1._M_buckets.size(); ++__n)
+ {
+ _Node* __cur1 = __ht1._M_buckets[__n];
+ _Node* __cur2 = __ht2._M_buckets[__n];
+ // Check same length of lists
+ for (; __cur1 && __cur2;
+ __cur1 = __cur1->_M_next, __cur2 = __cur2->_M_next)
+ { }
+ if (__cur1 || __cur2)
+ return false;
+ // Now check one's elements are in the other
+ for (__cur1 = __ht1._M_buckets[__n] ; __cur1;
+ __cur1 = __cur1->_M_next)
+ {
+ bool _found__cur1 = false;
+ for (__cur2 = __ht2._M_buckets[__n];
+ __cur2; __cur2 = __cur2->_M_next)
+ {
+ if (__cur1->_M_val == __cur2->_M_val)
+ {
+ _found__cur1 = true;
+ break;
+ }
+ }
+ if (!_found__cur1)
+ return false;
+ }
+ }
+ return true;
+ }
+
+ template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+ inline bool
+ operator!=(const hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>& __ht1,
+ const hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>& __ht2)
+ { return !(__ht1 == __ht2); }
+
+ template<class _Val, class _Key, class _HF, class _Extract, class _EqKey,
+ class _All>
+ inline void
+ swap(hashtable<_Val, _Key, _HF, _Extract, _EqKey, _All>& __ht1,
+ hashtable<_Val, _Key, _HF, _Extract, _EqKey, _All>& __ht2)
+ { __ht1.swap(__ht2); }
+
+ template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+ pair<typename hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::iterator, bool>
+ hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+ insert_unique_noresize(const value_type& __obj)
+ {
+ const size_type __n = _M_bkt_num(__obj);
+ _Node* __first = _M_buckets[__n];
+
+ for (_Node* __cur = __first; __cur; __cur = __cur->_M_next)
+ if (_M_equals(_M_get_key(__cur->_M_val), _M_get_key(__obj)))
+ return pair<iterator, bool>(iterator(__cur, this), false);
+
+ _Node* __tmp = _M_new_node(__obj);
+ __tmp->_M_next = __first;
+ _M_buckets[__n] = __tmp;
+ ++_M_num_elements;
+ return pair<iterator, bool>(iterator(__tmp, this), true);
+ }
+
+ template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+ typename hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::iterator
+ hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+ insert_equal_noresize(const value_type& __obj)
+ {
+ const size_type __n = _M_bkt_num(__obj);
+ _Node* __first = _M_buckets[__n];
+
+ for (_Node* __cur = __first; __cur; __cur = __cur->_M_next)
+ if (_M_equals(_M_get_key(__cur->_M_val), _M_get_key(__obj)))
+ {
+ _Node* __tmp = _M_new_node(__obj);
+ __tmp->_M_next = __cur->_M_next;
+ __cur->_M_next = __tmp;
+ ++_M_num_elements;
+ return iterator(__tmp, this);
+ }
+
+ _Node* __tmp = _M_new_node(__obj);
+ __tmp->_M_next = __first;
+ _M_buckets[__n] = __tmp;
+ ++_M_num_elements;
+ return iterator(__tmp, this);
+ }
+
+ template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+ typename hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::reference
+ hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+ find_or_insert(const value_type& __obj)
+ {
+ resize(_M_num_elements + 1);
+
+ size_type __n = _M_bkt_num(__obj);
+ _Node* __first = _M_buckets[__n];
+
+ for (_Node* __cur = __first; __cur; __cur = __cur->_M_next)
+ if (_M_equals(_M_get_key(__cur->_M_val), _M_get_key(__obj)))
+ return __cur->_M_val;
+
+ _Node* __tmp = _M_new_node(__obj);
+ __tmp->_M_next = __first;
+ _M_buckets[__n] = __tmp;
+ ++_M_num_elements;
+ return __tmp->_M_val;
+ }
+
+ template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+ pair<typename hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::iterator,
+ typename hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::iterator>
+ hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+ equal_range(const key_type& __key)
+ {
+ typedef pair<iterator, iterator> _Pii;
+ const size_type __n = _M_bkt_num_key(__key);
+
+ for (_Node* __first = _M_buckets[__n]; __first;
+ __first = __first->_M_next)
+ if (_M_equals(_M_get_key(__first->_M_val), __key))
+ {
+ for (_Node* __cur = __first->_M_next; __cur;
+ __cur = __cur->_M_next)
+ if (!_M_equals(_M_get_key(__cur->_M_val), __key))
+ return _Pii(iterator(__first, this), iterator(__cur, this));
+ for (size_type __m = __n + 1; __m < _M_buckets.size(); ++__m)
+ if (_M_buckets[__m])
+ return _Pii(iterator(__first, this),
+ iterator(_M_buckets[__m], this));
+ return _Pii(iterator(__first, this), end());
+ }
+ return _Pii(end(), end());
+ }
+
+ template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+ pair<typename hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::const_iterator,
+ typename hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::const_iterator>
+ hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+ equal_range(const key_type& __key) const
+ {
+ typedef pair<const_iterator, const_iterator> _Pii;
+ const size_type __n = _M_bkt_num_key(__key);
+
+ for (const _Node* __first = _M_buckets[__n]; __first;
+ __first = __first->_M_next)
+ {
+ if (_M_equals(_M_get_key(__first->_M_val), __key))
+ {
+ for (const _Node* __cur = __first->_M_next; __cur;
+ __cur = __cur->_M_next)
+ if (!_M_equals(_M_get_key(__cur->_M_val), __key))
+ return _Pii(const_iterator(__first, this),
+ const_iterator(__cur, this));
+ for (size_type __m = __n + 1; __m < _M_buckets.size(); ++__m)
+ if (_M_buckets[__m])
+ return _Pii(const_iterator(__first, this),
+ const_iterator(_M_buckets[__m], this));
+ return _Pii(const_iterator(__first, this), end());
+ }
+ }
+ return _Pii(end(), end());
+ }
+
+ template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+ typename hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::size_type
+ hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+ erase(const key_type& __key)
+ {
+ const size_type __n = _M_bkt_num_key(__key);
+ _Node* __first = _M_buckets[__n];
+ _Node* __saved_slot = 0;
+ size_type __erased = 0;
+
+ if (__first)
+ {
+ _Node* __cur = __first;
+ _Node* __next = __cur->_M_next;
+ while (__next)
+ {
+ if (_M_equals(_M_get_key(__next->_M_val), __key))
+ {
+ if (&_M_get_key(__next->_M_val) != &__key)
+ {
+ __cur->_M_next = __next->_M_next;
+ _M_delete_node(__next);
+ __next = __cur->_M_next;
+ ++__erased;
+ --_M_num_elements;
+ }
+ else
+ {
+ __saved_slot = __cur;
+ __cur = __next;
+ __next = __cur->_M_next;
+ }
+ }
+ else
+ {
+ __cur = __next;
+ __next = __cur->_M_next;
+ }
+ }
+ if (_M_equals(_M_get_key(__first->_M_val), __key))
+ {
+ _M_buckets[__n] = __first->_M_next;
+ _M_delete_node(__first);
+ ++__erased;
+ --_M_num_elements;
+ }
+ if (__saved_slot)
+ {
+ __next = __saved_slot->_M_next;
+ __saved_slot->_M_next = __next->_M_next;
+ _M_delete_node(__next);
+ ++__erased;
+ --_M_num_elements;
+ }
+ }
+ return __erased;
+ }
+
+ template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+ void hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+ erase(const iterator& __it)
+ {
+ _Node* __p = __it._M_cur;
+ if (__p)
+ {
+ const size_type __n = _M_bkt_num(__p->_M_val);
+ _Node* __cur = _M_buckets[__n];
+
+ if (__cur == __p)
+ {
+ _M_buckets[__n] = __cur->_M_next;
+ _M_delete_node(__cur);
+ --_M_num_elements;
+ }
+ else
+ {
+ _Node* __next = __cur->_M_next;
+ while (__next)
+ {
+ if (__next == __p)
+ {
+ __cur->_M_next = __next->_M_next;
+ _M_delete_node(__next);
+ --_M_num_elements;
+ break;
+ }
+ else
+ {
+ __cur = __next;
+ __next = __cur->_M_next;
+ }
+ }
+ }
+ }
+ }
+
+ template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+ void
+ hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+ erase(iterator __first, iterator __last)
+ {
+ size_type __f_bucket = __first._M_cur ? _M_bkt_num(__first._M_cur->_M_val)
+ : _M_buckets.size();
+
+ size_type __l_bucket = __last._M_cur ? _M_bkt_num(__last._M_cur->_M_val)
+ : _M_buckets.size();
+
+ if (__first._M_cur == __last._M_cur)
+ return;
+ else if (__f_bucket == __l_bucket)
+ _M_erase_bucket(__f_bucket, __first._M_cur, __last._M_cur);
+ else
+ {
+ _M_erase_bucket(__f_bucket, __first._M_cur, 0);
+ for (size_type __n = __f_bucket + 1; __n < __l_bucket; ++__n)
+ _M_erase_bucket(__n, 0);
+ if (__l_bucket != _M_buckets.size())
+ _M_erase_bucket(__l_bucket, __last._M_cur);
+ }
+ }
+
+ template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+ inline void
+ hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+ erase(const_iterator __first, const_iterator __last)
+ {
+ erase(iterator(const_cast<_Node*>(__first._M_cur),
+ const_cast<hashtable*>(__first._M_ht)),
+ iterator(const_cast<_Node*>(__last._M_cur),
+ const_cast<hashtable*>(__last._M_ht)));
+ }
+
+ template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+ inline void
+ hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+ erase(const const_iterator& __it)
+ { erase(iterator(const_cast<_Node*>(__it._M_cur),
+ const_cast<hashtable*>(__it._M_ht))); }
+
+ template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+ void
+ hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+ resize(size_type __num_elements_hint)
+ {
+ const size_type __old_n = _M_buckets.size();
+ if (__num_elements_hint > __old_n)
+ {
+ const size_type __n = _M_next_size(__num_elements_hint);
+ if (__n > __old_n)
+ {
+ _Vector_type __tmp(__n, (_Node*)(0), _M_buckets.get_allocator());
+ __try
+ {
+ for (size_type __bucket = 0; __bucket < __old_n; ++__bucket)
+ {
+ _Node* __first = _M_buckets[__bucket];
+ while (__first)
+ {
+ size_type __new_bucket = _M_bkt_num(__first->_M_val,
+ __n);
+ _M_buckets[__bucket] = __first->_M_next;
+ __first->_M_next = __tmp[__new_bucket];
+ __tmp[__new_bucket] = __first;
+ __first = _M_buckets[__bucket];
+ }
+ }
+ _M_buckets.swap(__tmp);
+ }
+ __catch(...)
+ {
+ for (size_type __bucket = 0; __bucket < __tmp.size();
+ ++__bucket)
+ {
+ while (__tmp[__bucket])
+ {
+ _Node* __next = __tmp[__bucket]->_M_next;
+ _M_delete_node(__tmp[__bucket]);
+ __tmp[__bucket] = __next;
+ }
+ }
+ __throw_exception_again;
+ }
+ }
+ }
+ }
+
+ template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+ void
+ hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+ _M_erase_bucket(const size_type __n, _Node* __first, _Node* __last)
+ {
+ _Node* __cur = _M_buckets[__n];
+ if (__cur == __first)
+ _M_erase_bucket(__n, __last);
+ else
+ {
+ _Node* __next;
+ for (__next = __cur->_M_next;
+ __next != __first;
+ __cur = __next, __next = __cur->_M_next)
+ ;
+ while (__next != __last)
+ {
+ __cur->_M_next = __next->_M_next;
+ _M_delete_node(__next);
+ __next = __cur->_M_next;
+ --_M_num_elements;
+ }
+ }
+ }
+
+ template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+ void
+ hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+ _M_erase_bucket(const size_type __n, _Node* __last)
+ {
+ _Node* __cur = _M_buckets[__n];
+ while (__cur != __last)
+ {
+ _Node* __next = __cur->_M_next;
+ _M_delete_node(__cur);
+ __cur = __next;
+ _M_buckets[__n] = __cur;
+ --_M_num_elements;
+ }
+ }
+
+ template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+ void
+ hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+ clear()
+ {
+ if (_M_num_elements == 0)
+ return;
+
+ for (size_type __i = 0; __i < _M_buckets.size(); ++__i)
+ {
+ _Node* __cur = _M_buckets[__i];
+ while (__cur != 0)
+ {
+ _Node* __next = __cur->_M_next;
+ _M_delete_node(__cur);
+ __cur = __next;
+ }
+ _M_buckets[__i] = 0;
+ }
+ _M_num_elements = 0;
+ }
+
+ template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+ void
+ hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+ _M_copy_from(const hashtable& __ht)
+ {
+ _M_buckets.clear();
+ _M_buckets.reserve(__ht._M_buckets.size());
+ _M_buckets.insert(_M_buckets.end(), __ht._M_buckets.size(), (_Node*) 0);
+ __try
+ {
+ for (size_type __i = 0; __i < __ht._M_buckets.size(); ++__i) {
+ const _Node* __cur = __ht._M_buckets[__i];
+ if (__cur)
+ {
+ _Node* __local_copy = _M_new_node(__cur->_M_val);
+ _M_buckets[__i] = __local_copy;
+
+ for (_Node* __next = __cur->_M_next;
+ __next;
+ __cur = __next, __next = __cur->_M_next)
+ {
+ __local_copy->_M_next = _M_new_node(__next->_M_val);
+ __local_copy = __local_copy->_M_next;
+ }
+ }
+ }
+ _M_num_elements = __ht._M_num_elements;
+ }
+ __catch(...)
+ {
+ clear();
+ __throw_exception_again;
+ }
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/backward/strstream b/i686-linux/include/c++/4.4.3/backward/strstream
new file mode 100644
index 0000000..a643e8b
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/backward/strstream
@@ -0,0 +1,176 @@
+// Backward-compat support -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2004, 2005, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1998
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+// WARNING: The classes defined in this header are DEPRECATED. This
+// header is defined in section D.7.1 of the C++ standard, and it
+// MAY BE REMOVED in a future standard revision. One should use the
+// header <sstream> instead.
+
+#ifndef _GLIBCXX_STRSTREAM
+#define _GLIBCXX_STRSTREAM
+
+#include "backward_warning.h"
+#include <iosfwd>
+#include <ios>
+#include <istream>
+#include <ostream>
+#include <string>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // Class strstreambuf, a streambuf class that manages an array of char.
+ // Note that this class is not a template.
+ class strstreambuf : public basic_streambuf<char, char_traits<char> >
+ {
+ public:
+ // Types.
+ typedef char_traits<char> _Traits;
+ typedef basic_streambuf<char, _Traits> _Base;
+
+ public:
+ // Constructor, destructor
+ explicit strstreambuf(streamsize __initial_capacity = 0);
+ strstreambuf(void* (*__alloc)(size_t), void (*__free)(void*));
+
+ strstreambuf(char* __get, streamsize __n, char* __put = 0);
+ strstreambuf(signed char* __get, streamsize __n, signed char* __put = 0);
+ strstreambuf(unsigned char* __get, streamsize __n, unsigned char* __put=0);
+
+ strstreambuf(const char* __get, streamsize __n);
+ strstreambuf(const signed char* __get, streamsize __n);
+ strstreambuf(const unsigned char* __get, streamsize __n);
+
+ virtual ~strstreambuf();
+
+ public:
+ void freeze(bool = true);
+ char* str();
+ int pcount() const;
+
+ protected:
+ virtual int_type overflow(int_type __c = _Traits::eof());
+ virtual int_type pbackfail(int_type __c = _Traits::eof());
+ virtual int_type underflow();
+ virtual _Base* setbuf(char* __buf, streamsize __n);
+ virtual pos_type seekoff(off_type __off, ios_base::seekdir __dir,
+ ios_base::openmode __mode
+ = ios_base::in | ios_base::out);
+ virtual pos_type seekpos(pos_type __pos, ios_base::openmode __mode
+ = ios_base::in | ios_base::out);
+
+ private:
+ strstreambuf&
+ operator=(const strstreambuf&);
+
+ strstreambuf(const strstreambuf&);
+
+ // Dynamic allocation, possibly using _M_alloc_fun and _M_free_fun.
+ char* _M_alloc(size_t);
+ void _M_free(char*);
+
+ // Helper function used in constructors.
+ void _M_setup(char* __get, char* __put, streamsize __n);
+
+ private:
+ // Data members.
+ void* (*_M_alloc_fun)(size_t);
+ void (*_M_free_fun)(void*);
+
+ bool _M_dynamic : 1;
+ bool _M_frozen : 1;
+ bool _M_constant : 1;
+ };
+
+ // Class istrstream, an istream that manages a strstreambuf.
+ class istrstream : public basic_istream<char>
+ {
+ public:
+ explicit istrstream(char*);
+ explicit istrstream(const char*);
+ istrstream(char* , streamsize);
+ istrstream(const char*, streamsize);
+ virtual ~istrstream();
+
+ strstreambuf* rdbuf() const;
+ char* str();
+
+ private:
+ strstreambuf _M_buf;
+ };
+
+ // Class ostrstream
+ class ostrstream : public basic_ostream<char>
+ {
+ public:
+ ostrstream();
+ ostrstream(char*, int, ios_base::openmode = ios_base::out);
+ virtual ~ostrstream();
+
+ strstreambuf* rdbuf() const;
+ void freeze(bool = true);
+ char* str();
+ int pcount() const;
+
+ private:
+ strstreambuf _M_buf;
+ };
+
+ // Class strstream
+ class strstream : public basic_iostream<char>
+ {
+ public:
+ typedef char char_type;
+ typedef char_traits<char>::int_type int_type;
+ typedef char_traits<char>::pos_type pos_type;
+ typedef char_traits<char>::off_type off_type;
+
+ strstream();
+ strstream(char*, int, ios_base::openmode = ios_base::in | ios_base::out);
+ virtual ~strstream();
+
+ strstreambuf* rdbuf() const;
+ void freeze(bool = true);
+ int pcount() const;
+ char* str();
+
+ private:
+ strstreambuf _M_buf;
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/bits/algorithmfwd.h b/i686-linux/include/c++/4.4.3/bits/algorithmfwd.h
new file mode 100644
index 0000000..e33a14c
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/algorithmfwd.h
@@ -0,0 +1,805 @@
+// <algorithm> declarations -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/algorithmfwd.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _GLIBCXX_ALGORITHMFWD_H
+#define _GLIBCXX_ALGORITHMFWD_H 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <bits/stl_pair.h>
+#include <bits/stl_iterator_base_types.h>
+#include <initializer_list>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /*
+ adjacent_find
+ all_of (C++0x)
+ any_of (C++0x)
+ binary_search
+ copy
+ copy_backward
+ copy_if (C++0x)
+ copy_n (C++0x)
+ count
+ count_if
+ equal
+ equal_range
+ fill
+ fill_n
+ find
+ find_end
+ find_first_of
+ find_if
+ find_if_not (C++0x)
+ for_each
+ generate
+ generate_n
+ includes
+ inplace_merge
+ is_heap (C++0x)
+ is_heap_until (C++0x)
+ is_partitioned (C++0x)
+ is_sorted (C++0x)
+ is_sorted_until (C++0x)
+ iter_swap
+ lexicographical_compare
+ lower_bound
+ make_heap
+ max
+ max_element
+ merge
+ min
+ min_element
+ minmax (C++0x)
+ minmax_element (C++0x)
+ mismatch
+ next_permutation
+ none_of (C++0x)
+ nth_element
+ partial_sort
+ partial_sort_copy
+ partition
+ partition_copy (C++0x)
+ partition_point (C++0x)
+ pop_heap
+ prev_permutation
+ push_heap
+ random_shuffle
+ remove
+ remove_copy
+ remove_copy_if
+ remove_if
+ replace
+ replace_copy
+ replace_copy_if
+ replace_if
+ reverse
+ reverse_copy
+ rotate
+ rotate_copy
+ search
+ search_n
+ set_difference
+ set_intersection
+ set_symmetric_difference
+ set_union
+ sort
+ sort_heap
+ stable_partition
+ stable_sort
+ swap
+ swap_ranges
+ transform
+ unique
+ unique_copy
+ upper_bound
+ */
+
+ /**
+ * @defgroup algorithms Algorithms
+ *
+ * Components for performing algorithmic operations. Includes
+ * non-modifying sequence, modifying (mutating) sequence, sorting,
+ * searching, merge, partition, heap, set, minima, maxima, and
+ * permutation operations.
+ */
+
+ /**
+ * @defgroup mutating_algorithms Mutating Algorithms
+ * @ingroup algorithms
+ */
+
+ /**
+ * @defgroup non_mutating_algorithms Non-Mutating Algorithms
+ * @ingroup algorithms
+ */
+
+ /**
+ * @defgroup sorting_algorithms Sorting Algorithms
+ * @ingroup algorithms
+ */
+
+ /**
+ * @defgroup set_algorithms Set Operation Algorithms
+ * @ingroup sorting_algorithms
+ *
+ * These algorithms are common set operations performed on sequences
+ * that are already sorted. The number of comparisons will be
+ * linear.
+ */
+
+ /**
+ * @defgroup binary_search_algorithms Binary Search Algorithms
+ * @ingroup sorting_algorithms
+ *
+ * These algorithms are variations of a classic binary search, and
+ * all assume that the sequence being searched is already sorted.
+ *
+ * The number of comparisons will be logarithmic (and as few as
+ * possible). The number of steps through the sequence will be
+ * logarithmic for random-access iterators (e.g., pointers), and
+ * linear otherwise.
+ *
+ * The LWG has passed Defect Report 270, which notes: <em>The
+ * proposed resolution reinterprets binary search. Instead of
+ * thinking about searching for a value in a sorted range, we view
+ * that as an important special case of a more general algorithm:
+ * searching for the partition point in a partitioned range. We
+ * also add a guarantee that the old wording did not: we ensure that
+ * the upper bound is no earlier than the lower bound, that the pair
+ * returned by equal_range is a valid range, and that the first part
+ * of that pair is the lower bound.</em>
+ *
+ * The actual effect of the first sentence is that a comparison
+ * functor passed by the user doesn't necessarily need to induce a
+ * strict weak ordering relation. Rather, it partitions the range.
+ */
+
+ // adjacent_find
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _IIter, typename _Predicate>
+ bool
+ all_of(_IIter, _IIter, _Predicate);
+
+ template<typename _IIter, typename _Predicate>
+ bool
+ any_of(_IIter, _IIter, _Predicate);
+#endif
+
+ template<typename _FIter, typename _Tp>
+ bool
+ binary_search(_FIter, _FIter, const _Tp&);
+
+ template<typename _FIter, typename _Tp, typename _Compare>
+ bool
+ binary_search(_FIter, _FIter, const _Tp&, _Compare);
+
+ template<typename _IIter, typename _OIter>
+ _OIter
+ copy(_IIter, _IIter, _OIter);
+
+ template<typename _BIter1, typename _BIter2>
+ _BIter2
+ copy_backward(_BIter1, _BIter1, _BIter2);
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _IIter, typename _OIter, typename _Predicate>
+ _OIter
+ copy_if(_IIter, _IIter, _OIter, _Predicate);
+
+ template<typename _IIter, typename _Size, typename _OIter>
+ _OIter
+ copy_n(_IIter, _Size, _OIter);
+#endif
+
+ // count
+ // count_if
+
+ template<typename _FIter, typename _Tp>
+ pair<_FIter, _FIter>
+ equal_range(_FIter, _FIter, const _Tp&);
+
+ template<typename _FIter, typename _Tp, typename _Compare>
+ pair<_FIter, _FIter>
+ equal_range(_FIter, _FIter, const _Tp&, _Compare);
+
+ template<typename _FIter, typename _Tp>
+ void
+ fill(_FIter, _FIter, const _Tp&);
+
+/*
+ XXX NB: return type different from ISO C++.
+ template<typename _OIter, typename _Size, typename _Tp>
+ void
+ fill_n(_OIter, _Size, const _Tp&);
+*/
+
+ template<typename _OIter, typename _Size, typename _Tp>
+ _OIter
+ fill_n(_OIter, _Size, const _Tp&);
+
+ // find
+
+ template<typename _FIter1, typename _FIter2>
+ _FIter1
+ find_end(_FIter1, _FIter1, _FIter2, _FIter2);
+
+ template<typename _FIter1, typename _FIter2, typename _BinaryPredicate>
+ _FIter1
+ find_end(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate);
+
+ // find_first_of
+ // find_if
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _IIter, typename _Predicate>
+ _IIter
+ find_if_not(_IIter, _IIter, _Predicate);
+#endif
+
+ // for_each
+ // generate
+ // generate_n
+
+ template<typename _IIter1, typename _IIter2>
+ bool
+ includes(_IIter1, _IIter1, _IIter2, _IIter2);
+
+ template<typename _IIter1, typename _IIter2, typename _Compare>
+ bool
+ includes(_IIter1, _IIter1, _IIter2, _IIter2, _Compare);
+
+ template<typename _BIter>
+ void
+ inplace_merge(_BIter, _BIter, _BIter);
+
+ template<typename _BIter, typename _Compare>
+ void
+ inplace_merge(_BIter, _BIter, _BIter, _Compare);
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _RAIter>
+ bool
+ is_heap(_RAIter, _RAIter);
+
+ template<typename _RAIter, typename _Compare>
+ bool
+ is_heap(_RAIter, _RAIter, _Compare);
+
+ template<typename _RAIter>
+ _RAIter
+ is_heap_until(_RAIter, _RAIter);
+
+ template<typename _RAIter, typename _Compare>
+ _RAIter
+ is_heap_until(_RAIter, _RAIter, _Compare);
+
+ template<typename _IIter, typename _Predicate>
+ bool
+ is_partitioned(_IIter, _IIter, _Predicate);
+
+ template<typename _FIter>
+ bool
+ is_sorted(_FIter, _FIter);
+
+ template<typename _FIter, typename _Compare>
+ bool
+ is_sorted(_FIter, _FIter, _Compare);
+
+ template<typename _FIter>
+ _FIter
+ is_sorted_until(_FIter, _FIter);
+
+ template<typename _FIter, typename _Compare>
+ _FIter
+ is_sorted_until(_FIter, _FIter, _Compare);
+#endif
+
+ template<typename _FIter1, typename _FIter2>
+ void
+ iter_swap(_FIter1, _FIter2);
+
+ template<typename _FIter, typename _Tp>
+ _FIter
+ lower_bound(_FIter, _FIter, const _Tp&);
+
+ template<typename _FIter, typename _Tp, typename _Compare>
+ _FIter
+ lower_bound(_FIter, _FIter, const _Tp&, _Compare);
+
+ template<typename _RAIter>
+ void
+ make_heap(_RAIter, _RAIter);
+
+ template<typename _RAIter, typename _Compare>
+ void
+ make_heap(_RAIter, _RAIter, _Compare);
+
+ template<typename _Tp>
+ const _Tp&
+ max(const _Tp&, const _Tp&);
+
+ template<typename _Tp, typename _Compare>
+ const _Tp&
+ max(const _Tp&, const _Tp&, _Compare);
+
+ // max_element
+ // merge
+
+ template<typename _Tp>
+ const _Tp&
+ min(const _Tp&, const _Tp&);
+
+ template<typename _Tp, typename _Compare>
+ const _Tp&
+ min(const _Tp&, const _Tp&, _Compare);
+
+ // min_element
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp>
+ pair<const _Tp&, const _Tp&>
+ minmax(const _Tp&, const _Tp&);
+
+ template<typename _Tp, typename _Compare>
+ pair<const _Tp&, const _Tp&>
+ minmax(const _Tp&, const _Tp&, _Compare);
+
+ template<typename _FIter>
+ pair<_FIter, _FIter>
+ minmax_element(_FIter, _FIter);
+
+ template<typename _FIter, typename _Compare>
+ pair<_FIter, _FIter>
+ minmax_element(_FIter, _FIter, _Compare);
+
+ template<typename _Tp>
+ _Tp
+ min(initializer_list<_Tp>);
+
+ template<typename _Tp, typename _Compare>
+ _Tp
+ min(initializer_list<_Tp>, _Compare);
+
+ template<typename _Tp>
+ _Tp
+ max(initializer_list<_Tp>);
+
+ template<typename _Tp, typename _Compare>
+ _Tp
+ max(initializer_list<_Tp>, _Compare);
+
+ template<typename _Tp>
+ pair<_Tp, _Tp>
+ minmax(initializer_list<_Tp>);
+
+ template<typename _Tp, typename _Compare>
+ pair<_Tp, _Tp>
+ minmax(initializer_list<_Tp>, _Compare);
+#endif
+
+ // mismatch
+
+ template<typename _BIter>
+ bool
+ next_permutation(_BIter, _BIter);
+
+ template<typename _BIter, typename _Compare>
+ bool
+ next_permutation(_BIter, _BIter, _Compare);
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _IIter, typename _Predicate>
+ bool
+ none_of(_IIter, _IIter, _Predicate);
+#endif
+
+ // nth_element
+ // partial_sort
+
+ template<typename _IIter, typename _RAIter>
+ _RAIter
+ partial_sort_copy(_IIter, _IIter, _RAIter, _RAIter);
+
+ template<typename _IIter, typename _RAIter, typename _Compare>
+ _RAIter
+ partial_sort_copy(_IIter, _IIter, _RAIter, _RAIter, _Compare);
+
+ // partition
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _IIter, typename _OIter1,
+ typename _OIter2, typename _Predicate>
+ pair<_OIter1, _OIter2>
+ partition_copy(_IIter, _IIter, _OIter1, _OIter2, _Predicate);
+
+ template<typename _FIter, typename _Predicate>
+ _FIter
+ partition_point(_FIter, _FIter, _Predicate);
+#endif
+
+ template<typename _RAIter>
+ void
+ pop_heap(_RAIter, _RAIter);
+
+ template<typename _RAIter, typename _Compare>
+ void
+ pop_heap(_RAIter, _RAIter, _Compare);
+
+ template<typename _BIter>
+ bool
+ prev_permutation(_BIter, _BIter);
+
+ template<typename _BIter, typename _Compare>
+ bool
+ prev_permutation(_BIter, _BIter, _Compare);
+
+ template<typename _RAIter>
+ void
+ push_heap(_RAIter, _RAIter);
+
+ template<typename _RAIter, typename _Compare>
+ void
+ push_heap(_RAIter, _RAIter, _Compare);
+
+ // random_shuffle
+
+ template<typename _FIter, typename _Tp>
+ _FIter
+ remove(_FIter, _FIter, const _Tp&);
+
+ template<typename _FIter, typename _Predicate>
+ _FIter
+ remove_if(_FIter, _FIter, _Predicate);
+
+ template<typename _IIter, typename _OIter, typename _Tp>
+ _OIter
+ remove_copy(_IIter, _IIter, _OIter, const _Tp&);
+
+ template<typename _IIter, typename _OIter, typename _Predicate>
+ _OIter
+ remove_copy_if(_IIter, _IIter, _OIter, _Predicate);
+
+ // replace
+
+ template<typename _IIter, typename _OIter, typename _Tp>
+ _OIter
+ replace_copy(_IIter, _IIter, _OIter, const _Tp&, const _Tp&);
+
+ template<typename _Iter, typename _OIter, typename _Predicate, typename _Tp>
+ _OIter
+ replace_copy_if(_Iter, _Iter, _OIter, _Predicate, const _Tp&);
+
+ // replace_if
+
+ template<typename _BIter>
+ void
+ reverse(_BIter, _BIter);
+
+ template<typename _BIter, typename _OIter>
+ _OIter
+ reverse_copy(_BIter, _BIter, _OIter);
+
+ template<typename _FIter>
+ void
+ rotate(_FIter, _FIter, _FIter);
+
+ template<typename _FIter, typename _OIter>
+ _OIter
+ rotate_copy(_FIter, _FIter, _FIter, _OIter);
+
+ // search
+ // search_n
+ // set_difference
+ // set_intersection
+ // set_symmetric_difference
+ // set_union
+
+ template<typename _RAIter>
+ void
+ sort_heap(_RAIter, _RAIter);
+
+ template<typename _RAIter, typename _Compare>
+ void
+ sort_heap(_RAIter, _RAIter, _Compare);
+
+ template<typename _BIter, typename _Predicate>
+ _BIter
+ stable_partition(_BIter, _BIter, _Predicate);
+
+ template<typename _Tp>
+ void
+ swap(_Tp&, _Tp&);
+
+ template<typename _Tp, size_t _Nm>
+ void
+ swap(_Tp (&)[_Nm], _Tp (&)[_Nm]);
+
+ template<typename _FIter1, typename _FIter2>
+ _FIter2
+ swap_ranges(_FIter1, _FIter1, _FIter2);
+
+ // transform
+
+ template<typename _FIter>
+ _FIter
+ unique(_FIter, _FIter);
+
+ template<typename _FIter, typename _BinaryPredicate>
+ _FIter
+ unique(_FIter, _FIter, _BinaryPredicate);
+
+ // unique_copy
+
+ template<typename _FIter, typename _Tp>
+ _FIter
+ upper_bound(_FIter, _FIter, const _Tp&);
+
+ template<typename _FIter, typename _Tp, typename _Compare>
+ _FIter
+ upper_bound(_FIter, _FIter, const _Tp&, _Compare);
+
+_GLIBCXX_END_NAMESPACE
+
+_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_P)
+
+ template<typename _FIter>
+ _FIter
+ adjacent_find(_FIter, _FIter);
+
+ template<typename _FIter, typename _BinaryPredicate>
+ _FIter
+ adjacent_find(_FIter, _FIter, _BinaryPredicate);
+
+ template<typename _IIter, typename _Tp>
+ typename iterator_traits<_IIter>::difference_type
+ count(_IIter, _IIter, const _Tp&);
+
+ template<typename _IIter, typename _Predicate>
+ typename iterator_traits<_IIter>::difference_type
+ count_if(_IIter, _IIter, _Predicate);
+
+ template<typename _IIter1, typename _IIter2>
+ bool
+ equal(_IIter1, _IIter1, _IIter2);
+
+ template<typename _IIter1, typename _IIter2, typename _BinaryPredicate>
+ bool
+ equal(_IIter1, _IIter1, _IIter2, _BinaryPredicate);
+
+ template<typename _IIter, typename _Tp>
+ _IIter
+ find(_IIter, _IIter, const _Tp&);
+
+ template<typename _FIter1, typename _FIter2>
+ _FIter1
+ find_first_of(_FIter1, _FIter1, _FIter2, _FIter2);
+
+ template<typename _FIter1, typename _FIter2, typename _BinaryPredicate>
+ _FIter1
+ find_first_of(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate);
+
+ template<typename _IIter, typename _Predicate>
+ _IIter
+ find_if(_IIter, _IIter, _Predicate);
+
+ template<typename _IIter, typename _Funct>
+ _Funct
+ for_each(_IIter, _IIter, _Funct);
+
+ template<typename _FIter, typename _Generator>
+ void
+ generate(_FIter, _FIter, _Generator);
+
+/*
+ XXX NB: return type different from ISO C++.
+ template<typename _OIter, typename _Size, typename _Tp>
+ void
+ generate_n(_OIter, _Size, _Generator);
+*/
+
+ template<typename _OIter, typename _Size, typename _Generator>
+ _OIter
+ generate_n(_OIter, _Size, _Generator);
+
+ template<typename _IIter1, typename _IIter2>
+ bool
+ lexicographical_compare(_IIter1, _IIter1, _IIter2, _IIter2);
+
+ template<typename _IIter1, typename _IIter2, typename _Compare>
+ bool
+ lexicographical_compare(_IIter1, _IIter1, _IIter2, _IIter2, _Compare);
+
+ template<typename _FIter>
+ _FIter
+ max_element(_FIter, _FIter);
+
+ template<typename _FIter, typename _Compare>
+ _FIter
+ max_element(_FIter, _FIter, _Compare);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter>
+ _OIter
+ merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _Compare>
+ _OIter
+ merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
+
+ template<typename _FIter>
+ _FIter
+ min_element(_FIter, _FIter);
+
+ template<typename _FIter, typename _Compare>
+ _FIter
+ min_element(_FIter, _FIter, _Compare);
+
+ template<typename _IIter1, typename _IIter2>
+ pair<_IIter1, _IIter2>
+ mismatch(_IIter1, _IIter1, _IIter2);
+
+ template<typename _IIter1, typename _IIter2, typename _BinaryPredicate>
+ pair<_IIter1, _IIter2>
+ mismatch(_IIter1, _IIter1, _IIter2, _BinaryPredicate);
+
+ template<typename _RAIter>
+ void
+ nth_element(_RAIter, _RAIter, _RAIter);
+
+ template<typename _RAIter, typename _Compare>
+ void
+ nth_element(_RAIter, _RAIter, _RAIter, _Compare);
+
+ template<typename _RAIter>
+ void
+ partial_sort(_RAIter, _RAIter, _RAIter);
+
+ template<typename _RAIter, typename _Compare>
+ void
+ partial_sort(_RAIter, _RAIter, _RAIter, _Compare);
+
+ template<typename _BIter, typename _Predicate>
+ _BIter
+ partition(_BIter, _BIter, _Predicate);
+
+ template<typename _RAIter>
+ void
+ random_shuffle(_RAIter, _RAIter);
+
+ template<typename _RAIter, typename _Generator>
+ void
+ random_shuffle(_RAIter, _RAIter, _Generator&);
+
+ template<typename _FIter, typename _Tp>
+ void
+ replace(_FIter, _FIter, const _Tp&, const _Tp&);
+
+ template<typename _FIter, typename _Predicate, typename _Tp>
+ void
+ replace_if(_FIter, _FIter, _Predicate, const _Tp&);
+
+ template<typename _FIter1, typename _FIter2>
+ _FIter1
+ search(_FIter1, _FIter1, _FIter2, _FIter2);
+
+ template<typename _FIter1, typename _FIter2, typename _BinaryPredicate>
+ _FIter1
+ search(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate);
+
+ template<typename _FIter, typename _Size, typename _Tp>
+ _FIter
+ search_n(_FIter, _FIter, _Size, const _Tp&);
+
+ template<typename _FIter, typename _Size, typename _Tp,
+ typename _BinaryPredicate>
+ _FIter
+ search_n(_FIter, _FIter, _Size, const _Tp&, _BinaryPredicate);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter>
+ _OIter
+ set_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _Compare>
+ _OIter
+ set_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter>
+ _OIter
+ set_intersection(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _Compare>
+ _OIter
+ set_intersection(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter>
+ _OIter
+ set_symmetric_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _Compare>
+ _OIter
+ set_symmetric_difference(_IIter1, _IIter1, _IIter2, _IIter2,
+ _OIter, _Compare);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter>
+ _OIter
+ set_union(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _Compare>
+ _OIter
+ set_union(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
+
+ template<typename _RAIter>
+ void
+ sort(_RAIter, _RAIter);
+
+ template<typename _RAIter, typename _Compare>
+ void
+ sort(_RAIter, _RAIter, _Compare);
+
+ template<typename _RAIter>
+ void
+ stable_sort(_RAIter, _RAIter);
+
+ template<typename _RAIter, typename _Compare>
+ void
+ stable_sort(_RAIter, _RAIter, _Compare);
+
+ template<typename _IIter, typename _OIter, typename _UnaryOperation>
+ _OIter
+ transform(_IIter, _IIter, _OIter, _UnaryOperation);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _BinaryOperation>
+ _OIter
+ transform(_IIter1, _IIter1, _IIter2, _OIter, _BinaryOperation);
+
+ template<typename _IIter, typename _OIter>
+ _OIter
+ unique_copy(_IIter, _IIter, _OIter);
+
+ template<typename _IIter, typename _OIter, typename _BinaryPredicate>
+ _OIter
+ unique_copy(_IIter, _IIter, _OIter, _BinaryPredicate);
+
+_GLIBCXX_END_NESTED_NAMESPACE
+
+#ifdef _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL
+# include <parallel/algorithmfwd.h>
+#endif
+
+#endif
+
diff --git a/i686-linux/include/c++/4.4.3/bits/allocator.h b/i686-linux/include/c++/4.4.3/bits/allocator.h
new file mode 100644
index 0000000..334fee5
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/allocator.h
@@ -0,0 +1,181 @@
+// Allocators -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1996-1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file allocator.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _ALLOCATOR_H
+#define _ALLOCATOR_H 1
+
+// Define the base class to std::allocator.
+#include <bits/c++allocator.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @defgroup allocators Allocators
+ * @ingroup memory
+ *
+ * Classes encapsulating memory operations.
+ */
+
+ template<typename _Tp>
+ class allocator;
+
+ /// allocator<void> specialization.
+ template<>
+ class allocator<void>
+ {
+ public:
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef void* pointer;
+ typedef const void* const_pointer;
+ typedef void value_type;
+
+ template<typename _Tp1>
+ struct rebind
+ { typedef allocator<_Tp1> other; };
+ };
+
+ /**
+ * @brief The "standard" allocator, as per [20.4].
+ * @ingroup allocators
+ *
+ * Further details:
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt04ch11.html
+ */
+ template<typename _Tp>
+ class allocator: public __glibcxx_base_allocator<_Tp>
+ {
+ public:
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Tp* pointer;
+ typedef const _Tp* const_pointer;
+ typedef _Tp& reference;
+ typedef const _Tp& const_reference;
+ typedef _Tp value_type;
+
+ template<typename _Tp1>
+ struct rebind
+ { typedef allocator<_Tp1> other; };
+
+ allocator() throw() { }
+
+ allocator(const allocator& __a) throw()
+ : __glibcxx_base_allocator<_Tp>(__a) { }
+
+ template<typename _Tp1>
+ allocator(const allocator<_Tp1>&) throw() { }
+
+ ~allocator() throw() { }
+
+ // Inherit everything else.
+ };
+
+ template<typename _T1, typename _T2>
+ inline bool
+ operator==(const allocator<_T1>&, const allocator<_T2>&)
+ { return true; }
+
+ template<typename _Tp>
+ inline bool
+ operator==(const allocator<_Tp>&, const allocator<_Tp>&)
+ { return true; }
+
+ template<typename _T1, typename _T2>
+ inline bool
+ operator!=(const allocator<_T1>&, const allocator<_T2>&)
+ { return false; }
+
+ template<typename _Tp>
+ inline bool
+ operator!=(const allocator<_Tp>&, const allocator<_Tp>&)
+ { return false; }
+
+ // Inhibit implicit instantiations for required instantiations,
+ // which are defined via explicit instantiations elsewhere.
+ // NB: This syntax is a GNU extension.
+#if _GLIBCXX_EXTERN_TEMPLATE
+ extern template class allocator<char>;
+ extern template class allocator<wchar_t>;
+#endif
+
+ // Undefine.
+#undef __glibcxx_base_allocator
+
+ // To implement Option 3 of DR 431.
+ template<typename _Alloc, bool = __is_empty(_Alloc)>
+ struct __alloc_swap
+ { static void _S_do_it(_Alloc&, _Alloc&) { } };
+
+ template<typename _Alloc>
+ struct __alloc_swap<_Alloc, false>
+ {
+ static void
+ _S_do_it(_Alloc& __one, _Alloc& __two)
+ {
+ // Precondition: swappable allocators.
+ if (__one != __two)
+ swap(__one, __two);
+ }
+ };
+
+ // Optimize for stateless allocators.
+ template<typename _Alloc, bool = __is_empty(_Alloc)>
+ struct __alloc_neq
+ {
+ static bool
+ _S_do_it(const _Alloc&, const _Alloc&)
+ { return false; }
+ };
+
+ template<typename _Alloc>
+ struct __alloc_neq<_Alloc, false>
+ {
+ static bool
+ _S_do_it(const _Alloc& __one, const _Alloc& __two)
+ { return __one != __two; }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/bits/atomic_0.h b/i686-linux/include/c++/4.4.3/bits/atomic_0.h
new file mode 100644
index 0000000..0caffaf
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/atomic_0.h
@@ -0,0 +1,464 @@
+// -*- C++ -*- header.
+
+// Copyright (C) 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/atomic_0.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _GLIBCXX_ATOMIC_0_H
+#define _GLIBCXX_ATOMIC_0_H 1
+
+#pragma GCC system_header
+
+// _GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // 0 == __atomic0 == Never lock-free
+namespace __atomic0
+{
+ struct atomic_flag;
+
+ // Implementation specific defines.
+#define _ATOMIC_LOAD_(__a, __x) \
+ ({ volatile __typeof__ _ATOMIC_MEMBER_* __p = &_ATOMIC_MEMBER_; \
+ volatile __atomic_flag_base* __g = __atomic_flag_for_address(__p); \
+ __atomic_flag_wait_explicit(__g, __x); \
+ __typeof__ _ATOMIC_MEMBER_ __r = *__p; \
+ atomic_flag_clear_explicit(__g, __x); \
+ __r; })
+
+#define _ATOMIC_STORE_(__a, __m, __x) \
+ ({ volatile __typeof__ _ATOMIC_MEMBER_* __p = &_ATOMIC_MEMBER_; \
+ __typeof__(__m) __v = (__m); \
+ volatile __atomic_flag_base* __g = __atomic_flag_for_address(__p); \
+ __atomic_flag_wait_explicit(__g, __x); \
+ *__p = __v; \
+ atomic_flag_clear_explicit(__g, __x); \
+ __v; })
+
+#define _ATOMIC_MODIFY_(__a, __o, __m, __x) \
+ ({ volatile __typeof__ _ATOMIC_MEMBER_* __p = &_ATOMIC_MEMBER_; \
+ __typeof__(__m) __v = (__m); \
+ volatile __atomic_flag_base* __g = __atomic_flag_for_address(__p); \
+ __atomic_flag_wait_explicit(__g, __x); \
+ __typeof__ _ATOMIC_MEMBER_ __r = *__p; \
+ *__p __o __v; \
+ atomic_flag_clear_explicit(__g, __x); \
+ __r; })
+
+#define _ATOMIC_CMPEXCHNG_(__a, __e, __m, __x) \
+ ({ volatile __typeof__ _ATOMIC_MEMBER_* __p = &_ATOMIC_MEMBER_; \
+ __typeof__(__e) __q = (__e); \
+ __typeof__(__m) __v = (__m); \
+ bool __r; \
+ volatile __atomic_flag_base* __g = __atomic_flag_for_address(__p); \
+ __atomic_flag_wait_explicit(__g, __x); \
+ __typeof__ _ATOMIC_MEMBER_ __t__ = *__p; \
+ if (__t__ == *__q) { *__p = __v; __r = true; } \
+ else { *__q = __t__; __r = false; } \
+ atomic_flag_clear_explicit(__g, __x); \
+ __r; })
+
+ /// atomic_flag
+ struct atomic_flag : public __atomic_flag_base
+ {
+ atomic_flag() = default;
+ ~atomic_flag() = default;
+ atomic_flag(const atomic_flag&) = delete;
+ atomic_flag& operator=(const atomic_flag&) = delete;
+
+ // Conversion to ATOMIC_FLAG_INIT.
+ atomic_flag(bool __i): __atomic_flag_base({ __i }) { }
+
+ bool
+ test_and_set(memory_order __m = memory_order_seq_cst) volatile;
+
+ void
+ clear(memory_order __m = memory_order_seq_cst) volatile;
+ };
+
+ /// 29.4.2, address types
+ struct atomic_address
+ {
+ private:
+ void* _M_i;
+
+ public:
+ atomic_address() = default;
+ ~atomic_address() = default;
+ atomic_address(const atomic_address&) = delete;
+ atomic_address& operator=(const atomic_address&) = delete;
+
+ atomic_address(void* __v) { _M_i = __v; }
+
+ bool
+ is_lock_free() const volatile
+ { return false; }
+
+ void
+ store(void* __v, memory_order __m = memory_order_seq_cst) volatile
+ {
+ __glibcxx_assert(__m != memory_order_acquire);
+ __glibcxx_assert(__m != memory_order_acq_rel);
+ __glibcxx_assert(__m != memory_order_consume);
+ _ATOMIC_STORE_(this, __v, __m);
+ }
+
+ void*
+ load(memory_order __m = memory_order_seq_cst) const volatile
+ {
+ __glibcxx_assert(__m != memory_order_release);
+ __glibcxx_assert(__m != memory_order_acq_rel);
+ return _ATOMIC_LOAD_(this, __m);
+ }
+
+ void*
+ exchange(void* __v, memory_order __m = memory_order_seq_cst) volatile
+ { return _ATOMIC_MODIFY_(this, =, __v, __m); }
+
+ bool
+ compare_exchange_weak(void*& __v1, void* __v2, memory_order __m1,
+ memory_order __m2) volatile
+ {
+ __glibcxx_assert(__m2 != memory_order_release);
+ __glibcxx_assert(__m2 != memory_order_acq_rel);
+ __glibcxx_assert(__m2 <= __m1);
+ return _ATOMIC_CMPEXCHNG_(this, &__v1, __v2, __m1);
+ }
+
+ bool
+ compare_exchange_weak(void*& __v1, void* __v2,
+ memory_order __m = memory_order_seq_cst) volatile
+ {
+ return compare_exchange_weak(__v1, __v2, __m,
+ __calculate_memory_order(__m));
+ }
+
+ bool
+ compare_exchange_strong(void*& __v1, void* __v2, memory_order __m1,
+ memory_order __m2) volatile
+ {
+ __glibcxx_assert(__m2 != memory_order_release);
+ __glibcxx_assert(__m2 != memory_order_acq_rel);
+ __glibcxx_assert(__m2 <= __m1);
+ return _ATOMIC_CMPEXCHNG_(this, &__v1, __v2, __m1);
+ }
+
+ bool
+ compare_exchange_strong(void*& __v1, void* __v2,
+ memory_order __m = memory_order_seq_cst) volatile
+ {
+ return compare_exchange_strong(__v1, __v2, __m,
+ __calculate_memory_order(__m));
+ }
+
+ void*
+ fetch_add(ptrdiff_t __d, memory_order __m = memory_order_seq_cst) volatile
+ {
+ void* volatile* __p = &(_M_i);
+ volatile __atomic_flag_base* __g = __atomic_flag_for_address(__p);
+ __atomic_flag_wait_explicit(__g, __m);
+ void* __r = *__p;
+ *__p = (void*)((char*)(*__p) + __d);
+ atomic_flag_clear_explicit(__g, __m);
+ return __r;
+ }
+
+ void*
+ fetch_sub(ptrdiff_t __d, memory_order __m = memory_order_seq_cst) volatile
+ {
+ void* volatile* __p = &(_M_i);
+ volatile __atomic_flag_base* __g = __atomic_flag_for_address(__p);
+ __atomic_flag_wait_explicit(__g, __m);
+ void* __r = *__p;
+ *__p = (void*)((char*)(*__p) - __d);
+ atomic_flag_clear_explicit(__g, __m);
+ return __r;
+ }
+
+ operator void*() const volatile
+ { return load(); }
+
+ void*
+ operator=(void* __v) // XXX volatile
+ {
+ store(__v);
+ return __v;
+ }
+
+ void*
+ operator+=(ptrdiff_t __d) volatile
+ { return fetch_add(__d) + __d; }
+
+ void*
+ operator-=(ptrdiff_t __d) volatile
+ { return fetch_sub(__d) - __d; }
+ };
+
+
+ // 29.3.1 atomic integral types
+ // For each of the integral types, define atomic_[integral type] struct
+ //
+ // atomic_bool bool
+ // atomic_char char
+ // atomic_schar signed char
+ // atomic_uchar unsigned char
+ // atomic_short short
+ // atomic_ushort unsigned short
+ // atomic_int int
+ // atomic_uint unsigned int
+ // atomic_long long
+ // atomic_ulong unsigned long
+ // atomic_llong long long
+ // atomic_ullong unsigned long long
+ // atomic_char16_t char16_t
+ // atomic_char32_t char32_t
+ // atomic_wchar_t wchar_t
+
+ // Base type.
+ // NB: Assuming _ITp is an integral scalar type that is 1, 2, 4, or 8 bytes,
+ // since that is what GCC built-in functions for atomic memory access work on.
+ template<typename _ITp>
+ struct __atomic_base
+ {
+ private:
+ typedef _ITp __integral_type;
+
+ __integral_type _M_i;
+
+ public:
+ __atomic_base() = default;
+ ~__atomic_base() = default;
+ __atomic_base(const __atomic_base&) = delete;
+ __atomic_base& operator=(const __atomic_base&) = delete;
+
+ // Requires __integral_type convertible to _M_base._M_i.
+ __atomic_base(__integral_type __i) { _M_i = __i; }
+
+ operator __integral_type() const volatile
+ { return load(); }
+
+ __integral_type
+ operator=(__integral_type __i) // XXX volatile
+ {
+ store(__i);
+ return __i;
+ }
+
+ __integral_type
+ operator++(int) volatile
+ { return fetch_add(1); }
+
+ __integral_type
+ operator--(int) volatile
+ { return fetch_sub(1); }
+
+ __integral_type
+ operator++() volatile
+ { return fetch_add(1) + 1; }
+
+ __integral_type
+ operator--() volatile
+ { return fetch_sub(1) - 1; }
+
+ __integral_type
+ operator+=(__integral_type __i) volatile
+ { return fetch_add(__i) + __i; }
+
+ __integral_type
+ operator-=(__integral_type __i) volatile
+ { return fetch_sub(__i) - __i; }
+
+ __integral_type
+ operator&=(__integral_type __i) volatile
+ { return fetch_and(__i) & __i; }
+
+ __integral_type
+ operator|=(__integral_type __i) volatile
+ { return fetch_or(__i) | __i; }
+
+ __integral_type
+ operator^=(__integral_type __i) volatile
+ { return fetch_xor(__i) ^ __i; }
+
+ bool
+ is_lock_free() const volatile
+ { return false; }
+
+ void
+ store(__integral_type __i,
+ memory_order __m = memory_order_seq_cst) volatile
+ {
+ __glibcxx_assert(__m != memory_order_acquire);
+ __glibcxx_assert(__m != memory_order_acq_rel);
+ __glibcxx_assert(__m != memory_order_consume);
+ _ATOMIC_STORE_(this, __i, __m);
+ }
+
+ __integral_type
+ load(memory_order __m = memory_order_seq_cst) const volatile
+ {
+ __glibcxx_assert(__m != memory_order_release);
+ __glibcxx_assert(__m != memory_order_acq_rel);
+ return _ATOMIC_LOAD_(this, __m);
+ }
+
+ __integral_type
+ exchange(__integral_type __i,
+ memory_order __m = memory_order_seq_cst) volatile
+ { return _ATOMIC_MODIFY_(this, =, __i, __m); }
+
+ bool
+ compare_exchange_weak(__integral_type& __i1, __integral_type __i2,
+ memory_order __m1, memory_order __m2) volatile
+ {
+ __glibcxx_assert(__m2 != memory_order_release);
+ __glibcxx_assert(__m2 != memory_order_acq_rel);
+ __glibcxx_assert(__m2 <= __m1);
+ return _ATOMIC_CMPEXCHNG_(this, &__i1, __i2, __m1);
+ }
+
+ bool
+ compare_exchange_weak(__integral_type& __i1, __integral_type __i2,
+ memory_order __m = memory_order_seq_cst) volatile
+ {
+ return compare_exchange_weak(__i1, __i2, __m,
+ __calculate_memory_order(__m));
+ }
+
+ bool
+ compare_exchange_strong(__integral_type& __i1, __integral_type __i2,
+ memory_order __m1, memory_order __m2) volatile
+ {
+ __glibcxx_assert(__m2 != memory_order_release);
+ __glibcxx_assert(__m2 != memory_order_acq_rel);
+ __glibcxx_assert(__m2 <= __m1);
+ return _ATOMIC_CMPEXCHNG_(this, &__i1, __i2, __m1);
+ }
+
+ bool
+ compare_exchange_strong(__integral_type& __i1, __integral_type __i2,
+ memory_order __m = memory_order_seq_cst) volatile
+ {
+ return compare_exchange_strong(__i1, __i2, __m,
+ __calculate_memory_order(__m));
+ }
+
+ __integral_type
+ fetch_add(__integral_type __i,
+ memory_order __m = memory_order_seq_cst) volatile
+ { return _ATOMIC_MODIFY_(this, +=, __i, __m); }
+
+ __integral_type
+ fetch_sub(__integral_type __i,
+ memory_order __m = memory_order_seq_cst) volatile
+ { return _ATOMIC_MODIFY_(this, -=, __i, __m); }
+
+ __integral_type
+ fetch_and(__integral_type __i,
+ memory_order __m = memory_order_seq_cst) volatile
+ { return _ATOMIC_MODIFY_(this, &=, __i, __m); }
+
+ __integral_type
+ fetch_or(__integral_type __i,
+ memory_order __m = memory_order_seq_cst) volatile
+ { return _ATOMIC_MODIFY_(this, |=, __i, __m); }
+
+ __integral_type
+ fetch_xor(__integral_type __i,
+ memory_order __m = memory_order_seq_cst) volatile
+ { return _ATOMIC_MODIFY_(this, ^=, __i, __m); }
+ };
+
+
+ /// atomic_bool
+ // NB: No operators or fetch-operations for this type.
+ struct atomic_bool
+ {
+ private:
+ __atomic_base<bool> _M_base;
+
+ public:
+ atomic_bool() = default;
+ ~atomic_bool() = default;
+ atomic_bool(const atomic_bool&) = delete;
+ atomic_bool& operator=(const atomic_bool&) = delete;
+
+ atomic_bool(bool __i) : _M_base(__i) { }
+
+ bool
+ operator=(bool __i) // XXX volatile
+ { return _M_base.operator=(__i); }
+
+ operator bool() const volatile
+ { return _M_base.load(); }
+
+ bool
+ is_lock_free() const volatile
+ { return _M_base.is_lock_free(); }
+
+ void
+ store(bool __i, memory_order __m = memory_order_seq_cst) volatile
+ { _M_base.store(__i, __m); }
+
+ bool
+ load(memory_order __m = memory_order_seq_cst) const volatile
+ { return _M_base.load(__m); }
+
+ bool
+ exchange(bool __i, memory_order __m = memory_order_seq_cst) volatile
+ { return _M_base.exchange(__i, __m); }
+
+ bool
+ compare_exchange_weak(bool& __i1, bool __i2, memory_order __m1,
+ memory_order __m2) volatile
+ { return _M_base.compare_exchange_weak(__i1, __i2, __m1, __m2); }
+
+ bool
+ compare_exchange_weak(bool& __i1, bool __i2,
+ memory_order __m = memory_order_seq_cst) volatile
+ { return _M_base.compare_exchange_weak(__i1, __i2, __m); }
+
+ bool
+ compare_exchange_strong(bool& __i1, bool __i2, memory_order __m1,
+ memory_order __m2) volatile
+ { return _M_base.compare_exchange_strong(__i1, __i2, __m1, __m2); }
+
+
+ bool
+ compare_exchange_strong(bool& __i1, bool __i2,
+ memory_order __m = memory_order_seq_cst) volatile
+ { return _M_base.compare_exchange_strong(__i1, __i2, __m); }
+ };
+
+#undef _ATOMIC_LOAD_
+#undef _ATOMIC_STORE_
+#undef _ATOMIC_MODIFY_
+#undef _ATOMIC_CMPEXCHNG_
+} // namespace __atomic0
+
+// _GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/bits/atomic_2.h b/i686-linux/include/c++/4.4.3/bits/atomic_2.h
new file mode 100644
index 0000000..2815d59
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/atomic_2.h
@@ -0,0 +1,454 @@
+// -*- C++ -*- header.
+
+// Copyright (C) 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/atomic_2.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _GLIBCXX_ATOMIC_2_H
+#define _GLIBCXX_ATOMIC_2_H 1
+
+#pragma GCC system_header
+
+// _GLIBCXX_BEGIN_NAMESPACE(std)
+
+// 2 == __atomic2 == Always lock-free
+// Assumed:
+// _GLIBCXX_ATOMIC_BUILTINS_1
+// _GLIBCXX_ATOMIC_BUILTINS_2
+// _GLIBCXX_ATOMIC_BUILTINS_4
+// _GLIBCXX_ATOMIC_BUILTINS_8
+namespace __atomic2
+{
+ /// atomic_flag
+ struct atomic_flag : public __atomic_flag_base
+ {
+ atomic_flag() = default;
+ ~atomic_flag() = default;
+ atomic_flag(const atomic_flag&) = delete;
+ atomic_flag& operator=(const atomic_flag&) = delete;
+
+ // Conversion to ATOMIC_FLAG_INIT.
+ atomic_flag(bool __i): __atomic_flag_base({ __i }) { }
+
+ bool
+ test_and_set(memory_order __m = memory_order_seq_cst) volatile
+ {
+ // Redundant synchronize if built-in for lock is a full barrier.
+ if (__m != memory_order_acquire && __m != memory_order_acq_rel)
+ __sync_synchronize();
+ return __sync_lock_test_and_set(&_M_i, 1);
+ }
+
+ void
+ clear(memory_order __m = memory_order_seq_cst) volatile
+ {
+ __glibcxx_assert(__m != memory_order_consume);
+ __glibcxx_assert(__m != memory_order_acquire);
+ __glibcxx_assert(__m != memory_order_acq_rel);
+
+ __sync_lock_release(&_M_i);
+ if (__m != memory_order_acquire && __m != memory_order_acq_rel)
+ __sync_synchronize();
+ }
+ };
+
+
+ /// 29.4.2, address types
+ struct atomic_address
+ {
+ private:
+ void* _M_i;
+
+ public:
+ atomic_address() = default;
+ ~atomic_address() = default;
+ atomic_address(const atomic_address&) = delete;
+ atomic_address& operator=(const atomic_address&) = delete;
+
+ atomic_address(void* __v) { _M_i = __v; }
+
+ bool
+ is_lock_free() const volatile
+ { return true; }
+
+ void
+ store(void* __v, memory_order __m = memory_order_seq_cst) volatile
+ {
+ __glibcxx_assert(__m != memory_order_acquire);
+ __glibcxx_assert(__m != memory_order_acq_rel);
+ __glibcxx_assert(__m != memory_order_consume);
+
+ if (__m == memory_order_relaxed)
+ _M_i = __v;
+ else
+ {
+ // write_mem_barrier();
+ _M_i = __v;
+ if (__m == memory_order_seq_cst)
+ __sync_synchronize();
+ }
+ }
+
+ void*
+ load(memory_order __m = memory_order_seq_cst) const volatile
+ {
+ __glibcxx_assert(__m != memory_order_release);
+ __glibcxx_assert(__m != memory_order_acq_rel);
+
+ __sync_synchronize();
+ void* __ret = _M_i;
+ __sync_synchronize();
+ return __ret;
+ }
+
+ void*
+ exchange(void* __v, memory_order __m = memory_order_seq_cst) volatile
+ {
+ // XXX built-in assumes memory_order_acquire.
+ return __sync_lock_test_and_set(&_M_i, __v);
+ }
+
+ bool
+ compare_exchange_weak(void*& __v1, void* __v2, memory_order __m1,
+ memory_order __m2) volatile
+ { return compare_exchange_strong(__v1, __v2, __m1, __m2); }
+
+ bool
+ compare_exchange_weak(void*& __v1, void* __v2,
+ memory_order __m = memory_order_seq_cst) volatile
+ {
+ return compare_exchange_weak(__v1, __v2, __m,
+ __calculate_memory_order(__m));
+ }
+
+ bool
+ compare_exchange_strong(void*& __v1, void* __v2, memory_order __m1,
+ memory_order __m2) volatile
+ {
+ __glibcxx_assert(__m2 != memory_order_release);
+ __glibcxx_assert(__m2 != memory_order_acq_rel);
+ __glibcxx_assert(__m2 <= __m1);
+
+ void* __v1o = __v1;
+ void* __v1n = __sync_val_compare_and_swap(&_M_i, __v1o, __v2);
+
+ // Assume extra stores (of same value) allowed in true case.
+ __v1 = __v1n;
+ return __v1o == __v1n;
+ }
+
+ bool
+ compare_exchange_strong(void*& __v1, void* __v2,
+ memory_order __m = memory_order_seq_cst) volatile
+ {
+ return compare_exchange_strong(__v1, __v2, __m,
+ __calculate_memory_order(__m));
+ }
+
+ void*
+ fetch_add(ptrdiff_t __d, memory_order __m = memory_order_seq_cst) volatile
+ { return __sync_fetch_and_add(&_M_i, __d); }
+
+ void*
+ fetch_sub(ptrdiff_t __d, memory_order __m = memory_order_seq_cst) volatile
+ { return __sync_fetch_and_sub(&_M_i, __d); }
+
+ operator void*() const volatile
+ { return load(); }
+
+ void*
+ operator=(void* __v) // XXX volatile
+ {
+ store(__v);
+ return __v;
+ }
+
+ void*
+ operator+=(ptrdiff_t __d) volatile
+ { return __sync_add_and_fetch(&_M_i, __d); }
+
+ void*
+ operator-=(ptrdiff_t __d) volatile
+ { return __sync_sub_and_fetch(&_M_i, __d); }
+ };
+
+ // 29.3.1 atomic integral types
+ // For each of the integral types, define atomic_[integral type] struct
+ //
+ // atomic_bool bool
+ // atomic_char char
+ // atomic_schar signed char
+ // atomic_uchar unsigned char
+ // atomic_short short
+ // atomic_ushort unsigned short
+ // atomic_int int
+ // atomic_uint unsigned int
+ // atomic_long long
+ // atomic_ulong unsigned long
+ // atomic_llong long long
+ // atomic_ullong unsigned long long
+ // atomic_char16_t char16_t
+ // atomic_char32_t char32_t
+ // atomic_wchar_t wchar_t
+
+ // Base type.
+ // NB: Assuming _ITp is an integral scalar type that is 1, 2, 4, or 8 bytes,
+ // since that is what GCC built-in functions for atomic memory access work on.
+ template<typename _ITp>
+ struct __atomic_base
+ {
+ private:
+ typedef _ITp __integral_type;
+
+ __integral_type _M_i;
+
+ public:
+ __atomic_base() = default;
+ ~__atomic_base() = default;
+ __atomic_base(const __atomic_base&) = delete;
+ __atomic_base& operator=(const __atomic_base&) = delete;
+
+ // Requires __integral_type convertible to _M_base._M_i.
+ __atomic_base(__integral_type __i) { _M_i = __i; }
+
+ operator __integral_type() const volatile
+ { return load(); }
+
+ __integral_type
+ operator=(__integral_type __i) // XXX volatile
+ {
+ store(__i);
+ return __i;
+ }
+
+ __integral_type
+ operator++(int) volatile
+ { return fetch_add(1); }
+
+ __integral_type
+ operator--(int) volatile
+ { return fetch_sub(1); }
+
+ __integral_type
+ operator++() volatile
+ { return __sync_add_and_fetch(&_M_i, 1); }
+
+ __integral_type
+ operator--() volatile
+ { return __sync_sub_and_fetch(&_M_i, 1); }
+
+ __integral_type
+ operator+=(__integral_type __i) volatile
+ { return __sync_add_and_fetch(&_M_i, __i); }
+
+ __integral_type
+ operator-=(__integral_type __i) volatile
+ { return __sync_sub_and_fetch(&_M_i, __i); }
+
+ __integral_type
+ operator&=(__integral_type __i) volatile
+ { return __sync_and_and_fetch(&_M_i, __i); }
+
+ __integral_type
+ operator|=(__integral_type __i) volatile
+ { return __sync_or_and_fetch(&_M_i, __i); }
+
+ __integral_type
+ operator^=(__integral_type __i) volatile
+ { return __sync_xor_and_fetch(&_M_i, __i); }
+
+ bool
+ is_lock_free() const volatile
+ { return true; }
+
+ void
+ store(__integral_type __i,
+ memory_order __m = memory_order_seq_cst) volatile
+ {
+ __glibcxx_assert(__m != memory_order_acquire);
+ __glibcxx_assert(__m != memory_order_acq_rel);
+ __glibcxx_assert(__m != memory_order_consume);
+
+ if (__m == memory_order_relaxed)
+ _M_i = __i;
+ else
+ {
+ // write_mem_barrier();
+ _M_i = __i;
+ if (__m == memory_order_seq_cst)
+ __sync_synchronize();
+ }
+ }
+
+ __integral_type
+ load(memory_order __m = memory_order_seq_cst) const volatile
+ {
+ __glibcxx_assert(__m != memory_order_release);
+ __glibcxx_assert(__m != memory_order_acq_rel);
+
+ __sync_synchronize();
+ __integral_type __ret = _M_i;
+ __sync_synchronize();
+ return __ret;
+ }
+
+ __integral_type
+ exchange(__integral_type __i,
+ memory_order __m = memory_order_seq_cst) volatile
+ {
+ // XXX built-in assumes memory_order_acquire.
+ return __sync_lock_test_and_set(&_M_i, __i);
+ }
+
+ bool
+ compare_exchange_weak(__integral_type& __i1, __integral_type __i2,
+ memory_order __m1, memory_order __m2) volatile
+ { return compare_exchange_strong(__i1, __i2, __m1, __m2); }
+
+ bool
+ compare_exchange_weak(__integral_type& __i1, __integral_type __i2,
+ memory_order __m = memory_order_seq_cst) volatile
+ {
+ return compare_exchange_weak(__i1, __i2, __m,
+ __calculate_memory_order(__m));
+ }
+
+ bool
+ compare_exchange_strong(__integral_type& __i1, __integral_type __i2,
+ memory_order __m1, memory_order __m2) volatile
+ {
+ __glibcxx_assert(__m2 != memory_order_release);
+ __glibcxx_assert(__m2 != memory_order_acq_rel);
+ __glibcxx_assert(__m2 <= __m1);
+
+ __integral_type __i1o = __i1;
+ __integral_type __i1n = __sync_val_compare_and_swap(&_M_i, __i1o, __i2);
+
+ // Assume extra stores (of same value) allowed in true case.
+ __i1 = __i1n;
+ return __i1o == __i1n;
+ }
+
+ bool
+ compare_exchange_strong(__integral_type& __i1, __integral_type __i2,
+ memory_order __m = memory_order_seq_cst) volatile
+ {
+ return compare_exchange_strong(__i1, __i2, __m,
+ __calculate_memory_order(__m));
+ }
+
+ __integral_type
+ fetch_add(__integral_type __i,
+ memory_order __m = memory_order_seq_cst) volatile
+ { return __sync_fetch_and_add(&_M_i, __i); }
+
+ __integral_type
+ fetch_sub(__integral_type __i,
+ memory_order __m = memory_order_seq_cst) volatile
+ { return __sync_fetch_and_sub(&_M_i, __i); }
+
+ __integral_type
+ fetch_and(__integral_type __i,
+ memory_order __m = memory_order_seq_cst) volatile
+ { return __sync_fetch_and_and(&_M_i, __i); }
+
+ __integral_type
+ fetch_or(__integral_type __i,
+ memory_order __m = memory_order_seq_cst) volatile
+ { return __sync_fetch_and_or(&_M_i, __i); }
+
+ __integral_type
+ fetch_xor(__integral_type __i,
+ memory_order __m = memory_order_seq_cst) volatile
+ { return __sync_fetch_and_xor(&_M_i, __i); }
+ };
+
+
+ /// atomic_bool
+ // NB: No operators or fetch-operations for this type.
+ struct atomic_bool
+ {
+ private:
+ __atomic_base<bool> _M_base;
+
+ public:
+ atomic_bool() = default;
+ ~atomic_bool() = default;
+ atomic_bool(const atomic_bool&) = delete;
+ atomic_bool& operator=(const atomic_bool&) = delete;
+
+ atomic_bool(bool __i) : _M_base(__i) { }
+
+ bool
+ operator=(bool __i) // XXX volatile
+ { return _M_base.operator=(__i); }
+
+ operator bool() const volatile
+ { return _M_base.load(); }
+
+ bool
+ is_lock_free() const volatile
+ { return _M_base.is_lock_free(); }
+
+ void
+ store(bool __i, memory_order __m = memory_order_seq_cst) volatile
+ { _M_base.store(__i, __m); }
+
+ bool
+ load(memory_order __m = memory_order_seq_cst) const volatile
+ { return _M_base.load(__m); }
+
+ bool
+ exchange(bool __i, memory_order __m = memory_order_seq_cst) volatile
+ { return _M_base.exchange(__i, __m); }
+
+ bool
+ compare_exchange_weak(bool& __i1, bool __i2, memory_order __m1,
+ memory_order __m2) volatile
+ { return _M_base.compare_exchange_weak(__i1, __i2, __m1, __m2); }
+
+ bool
+ compare_exchange_weak(bool& __i1, bool __i2,
+ memory_order __m = memory_order_seq_cst) volatile
+ { return _M_base.compare_exchange_weak(__i1, __i2, __m); }
+
+ bool
+ compare_exchange_strong(bool& __i1, bool __i2, memory_order __m1,
+ memory_order __m2) volatile
+ { return _M_base.compare_exchange_strong(__i1, __i2, __m1, __m2); }
+
+
+ bool
+ compare_exchange_strong(bool& __i1, bool __i2,
+ memory_order __m = memory_order_seq_cst) volatile
+ { return _M_base.compare_exchange_strong(__i1, __i2, __m); }
+ };
+} // namespace __atomic2
+
+// _GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/bits/atomicfwd_c.h b/i686-linux/include/c++/4.4.3/bits/atomicfwd_c.h
new file mode 100644
index 0000000..0841843
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/atomicfwd_c.h
@@ -0,0 +1,174 @@
+// -*- C++ -*- header.
+
+// Copyright (C) 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/atomicfwd_c.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+// "C" only bits.
+
+#define _ATOMIC_MEMBER_ ((__a)->_M_i)
+
+ // POD base classes for atomic intgral types.
+ struct __atomic_bool_base
+ {
+ bool _M_i;
+ };
+
+ struct __atomic_char_base
+ {
+ char _M_i;
+ };
+
+ struct __atomic_schar_base
+ {
+ signed char _M_i;
+ };
+
+ struct __atomic_uchar_base
+ {
+ unsigned char _M_i;
+ };
+
+ struct __atomic_short_base
+ {
+ short _M_i;
+ };
+
+ struct __atomic_ushort_base
+ {
+ unsigned short _M_i;
+ };
+
+ struct __atomic_int_base
+ {
+ int _M_i;
+ };
+
+ struct __atomic_uint_base
+ {
+ unsigned int _M_i;
+ };
+
+ struct __atomic_long_base
+ {
+ long _M_i;
+ };
+
+ struct __atomic_ulong_base
+ {
+ unsigned long _M_i;
+ };
+
+ struct __atomic_llong_base
+ {
+ long long _M_i;
+ };
+
+ struct __atomic_ullong_base
+ {
+ unsigned long long _M_i;
+ };
+
+ struct __atomic_wchar_t_base
+ {
+ wchar_t _M_i;
+ };
+
+ typedef struct __atomic_flag_base atomic_flag;
+ typedef struct __atomic_address_base atomic_address;
+ typedef struct __atomic_bool_base atomic_bool;
+ typedef struct __atomic_char_base atomic_char;
+ typedef struct __atomic_schar_base atomic_schar;
+ typedef struct __atomic_uchar_base atomic_uchar;
+ typedef struct __atomic_short_base atomic_short;
+ typedef struct __atomic_ushort_base atomic_ushort;
+ typedef struct __atomic_int_base atomic_int;
+ typedef struct __atomic_uint_base atomic_uint;
+ typedef struct __atomic_long_base atomic_long;
+ typedef struct __atomic_ulong_base atomic_ulong;
+ typedef struct __atomic_llong_base atomic_llong;
+ typedef struct __atomic_ullong_base atomic_ullong;
+ typedef struct __atomic_wchar_t_base atomic_wchar_t;
+ typedef struct __atomic_short_base atomic_char16_t;
+ typedef struct __atomic_int_base atomic_char32_t;
+
+#define atomic_is_lock_free(__a) \
+ false
+
+#define atomic_load_explicit(__a, __x) \
+ _ATOMIC_LOAD_(__a, __x)
+
+#define atomic_load(__a) \
+ atomic_load_explicit(__a, memory_order_seq_cst)
+
+#define atomic_store_explicit(__a, __m, __x) \
+ _ATOMIC_STORE_(__a, __m, __x)
+
+#define atomic_store(__a, __m) \
+ atomic_store_explicit(__a, __m, memory_order_seq_cst)
+
+#define atomic_exchange_explicit(__a, __m, __x) \
+ _ATOMIC_MODIFY_(__a, =, __m, __x)
+
+#define atomic_exchange(__a, __m) \
+ atomic_exchange_explicit(__a, __m, memory_order_seq_cst)
+
+#define atomic_compare_exchange_explicit(__a, __e, __m, __x, __y) \
+ _ATOMIC_CMPEXCHNG_(__a, __e, __m, __x)
+
+#define atomic_compare_exchange(__a, __e, __m) \
+ _ATOMIC_CMPEXCHNG_(__a, __e, __m, memory_order_seq_cst)
+
+#define atomic_fetch_add_explicit(__a, __m, __x) \
+ _ATOMIC_MODIFY_(__a, +=, __m, __x)
+
+#define atomic_fetch_add(__a, __m) \
+ atomic_fetch_add_explicit(__a, __m, memory_order_seq_cst)
+
+#define atomic_fetch_sub_explicit(__a, __m, __x) \
+ _ATOMIC_MODIFY_(__a, -=, __m, __x)
+
+#define atomic_fetch_sub(__a, __m) \
+ atomic_fetch_sub_explicit(__a, __m, memory_order_seq_cst)
+
+#define atomic_fetch_and_explicit(__a, __m, __x) \
+ _ATOMIC_MODIFY_(__a, &=, __m, __x)
+
+#define atomic_fetch_and(__a, __m) \
+ atomic_fetch_and_explicit(__a, __m, memory_order_seq_cst)
+
+#define atomic_fetch_or_explicit(__a, __m, __x) \
+ _ATOMIC_MODIFY_(__a, |=, __m, __x)
+
+#define atomic_fetch_or(__a, __m) \
+ atomic_fetch_or_explicit(__a, __m, memory_order_seq_cst)
+
+#define atomic_fetch_xor_explicit(__a, __m, __x) \
+ _ATOMIC_MODIFY_(__a, ^=, __m, __x)
+
+#define atomic_fetch_xor(__a, __m) \
+ atomic_fetch_xor_explicit(__a, __m, memory_order_seq_cst)
diff --git a/i686-linux/include/c++/4.4.3/bits/atomicfwd_cxx.h b/i686-linux/include/c++/4.4.3/bits/atomicfwd_cxx.h
new file mode 100644
index 0000000..8b67635
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/atomicfwd_cxx.h
@@ -0,0 +1,109 @@
+// -*- C++ -*- header.
+
+// Copyright (C) 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/atomicfwd_cxx.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+// "C++" only bits.
+
+#define _ATOMIC_MEMBER_ _M_i
+
+_GLIBCXX_END_EXTERN_C
+
+ namespace __atomic0
+ {
+ template<typename _IntTp>
+ struct __atomic_base;
+
+ struct atomic_flag;
+ struct atomic_address;
+ struct atomic_bool;
+ }
+
+ namespace __atomic2
+ {
+ template<typename _IntTp>
+ struct __atomic_base;
+
+ struct atomic_flag;
+ struct atomic_address;
+ struct atomic_bool;
+ }
+
+ namespace __atomic1
+ {
+ using __atomic2::atomic_flag;
+ using __atomic2::atomic_bool;
+ using __atomic0::atomic_address;
+ using __atomic0::__atomic_base;
+ }
+
+ /// atomic_char
+ typedef __atomic_base<char> atomic_char;
+
+ /// atomic_schar
+ typedef __atomic_base<signed char> atomic_schar;
+
+ /// atomic_uchar
+ typedef __atomic_base<unsigned char> atomic_uchar;
+
+ /// atomic_short
+ typedef __atomic_base<short> atomic_short;
+
+ /// atomic_ushort
+ typedef __atomic_base<unsigned short> atomic_ushort;
+
+ /// atomic_int
+ typedef __atomic_base<int> atomic_int;
+
+ /// atomic_uint
+ typedef __atomic_base<unsigned int> atomic_uint;
+
+ /// atomic_long
+ typedef __atomic_base<long> atomic_long;
+
+ /// atomic_ulong
+ typedef __atomic_base<unsigned long> atomic_ulong;
+
+ /// atomic_llong
+ typedef __atomic_base<long long> atomic_llong;
+
+ /// atomic_ullong
+ typedef __atomic_base<unsigned long long> atomic_ullong;
+
+ /// atomic_wchar_t
+ typedef __atomic_base<wchar_t> atomic_wchar_t;
+
+ /// atomic_char16_t
+ typedef __atomic_base<char16_t> atomic_char16_t;
+
+ /// atomic_char32_t
+ typedef __atomic_base<char32_t> atomic_char32_t;
+
+ template<typename _Tp>
+ struct atomic;
+_GLIBCXX_BEGIN_EXTERN_C
diff --git a/i686-linux/include/c++/4.4.3/bits/basic_ios.h b/i686-linux/include/c++/4.4.3/bits/basic_ios.h
new file mode 100644
index 0000000..ee1b646
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/basic_ios.h
@@ -0,0 +1,474 @@
+// Iostreams base classes -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file basic_ios.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _BASIC_IOS_H
+#define _BASIC_IOS_H 1
+
+#pragma GCC system_header
+
+#include <bits/localefwd.h>
+#include <bits/locale_classes.h>
+#include <bits/locale_facets.h>
+#include <bits/streambuf_iterator.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _Facet>
+ inline const _Facet&
+ __check_facet(const _Facet* __f)
+ {
+ if (!__f)
+ __throw_bad_cast();
+ return *__f;
+ }
+
+ // 27.4.5 Template class basic_ios
+ /**
+ * @brief Virtual base class for all stream classes.
+ * @ingroup io
+ *
+ * Most of the member functions called dispatched on stream objects
+ * (e.g., @c std::cout.foo(bar);) are consolidated in this class.
+ */
+ template<typename _CharT, typename _Traits>
+ class basic_ios : public ios_base
+ {
+ public:
+ //@{
+ /**
+ * These are standard types. They permit a standardized way of
+ * referring to names of (or names dependant on) the template
+ * parameters, which are specific to the implementation.
+ */
+ typedef _CharT char_type;
+ typedef typename _Traits::int_type int_type;
+ typedef typename _Traits::pos_type pos_type;
+ typedef typename _Traits::off_type off_type;
+ typedef _Traits traits_type;
+ //@}
+
+ //@{
+ /**
+ * These are non-standard types.
+ */
+ typedef ctype<_CharT> __ctype_type;
+ typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> >
+ __num_put_type;
+ typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> >
+ __num_get_type;
+ //@}
+
+ // Data members:
+ protected:
+ basic_ostream<_CharT, _Traits>* _M_tie;
+ mutable char_type _M_fill;
+ mutable bool _M_fill_init;
+ basic_streambuf<_CharT, _Traits>* _M_streambuf;
+
+ // Cached use_facet<ctype>, which is based on the current locale info.
+ const __ctype_type* _M_ctype;
+ // For ostream.
+ const __num_put_type* _M_num_put;
+ // For istream.
+ const __num_get_type* _M_num_get;
+
+ public:
+ //@{
+ /**
+ * @brief The quick-and-easy status check.
+ *
+ * This allows you to write constructs such as
+ * "if (!a_stream) ..." and "while (a_stream) ..."
+ */
+ operator void*() const
+ { return this->fail() ? 0 : const_cast<basic_ios*>(this); }
+
+ bool
+ operator!() const
+ { return this->fail(); }
+ //@}
+
+ /**
+ * @brief Returns the error state of the stream buffer.
+ * @return A bit pattern (well, isn't everything?)
+ *
+ * See std::ios_base::iostate for the possible bit values. Most
+ * users will call one of the interpreting wrappers, e.g., good().
+ */
+ iostate
+ rdstate() const
+ { return _M_streambuf_state; }
+
+ /**
+ * @brief [Re]sets the error state.
+ * @param state The new state flag(s) to set.
+ *
+ * See std::ios_base::iostate for the possible bit values. Most
+ * users will not need to pass an argument.
+ */
+ void
+ clear(iostate __state = goodbit);
+
+ /**
+ * @brief Sets additional flags in the error state.
+ * @param state The additional state flag(s) to set.
+ *
+ * See std::ios_base::iostate for the possible bit values.
+ */
+ void
+ setstate(iostate __state)
+ { this->clear(this->rdstate() | __state); }
+
+ // Flip the internal state on for the proper state bits, then re
+ // throws the propagated exception if bit also set in
+ // exceptions().
+ void
+ _M_setstate(iostate __state)
+ {
+ // 27.6.1.2.1 Common requirements.
+ // Turn this on without causing an ios::failure to be thrown.
+ _M_streambuf_state |= __state;
+ if (this->exceptions() & __state)
+ __throw_exception_again;
+ }
+
+ /**
+ * @brief Fast error checking.
+ * @return True if no error flags are set.
+ *
+ * A wrapper around rdstate.
+ */
+ bool
+ good() const
+ { return this->rdstate() == 0; }
+
+ /**
+ * @brief Fast error checking.
+ * @return True if the eofbit is set.
+ *
+ * Note that other iostate flags may also be set.
+ */
+ bool
+ eof() const
+ { return (this->rdstate() & eofbit) != 0; }
+
+ /**
+ * @brief Fast error checking.
+ * @return True if either the badbit or the failbit is set.
+ *
+ * Checking the badbit in fail() is historical practice.
+ * Note that other iostate flags may also be set.
+ */
+ bool
+ fail() const
+ { return (this->rdstate() & (badbit | failbit)) != 0; }
+
+ /**
+ * @brief Fast error checking.
+ * @return True if the badbit is set.
+ *
+ * Note that other iostate flags may also be set.
+ */
+ bool
+ bad() const
+ { return (this->rdstate() & badbit) != 0; }
+
+ /**
+ * @brief Throwing exceptions on errors.
+ * @return The current exceptions mask.
+ *
+ * This changes nothing in the stream. See the one-argument version
+ * of exceptions(iostate) for the meaning of the return value.
+ */
+ iostate
+ exceptions() const
+ { return _M_exception; }
+
+ /**
+ * @brief Throwing exceptions on errors.
+ * @param except The new exceptions mask.
+ *
+ * By default, error flags are set silently. You can set an
+ * exceptions mask for each stream; if a bit in the mask becomes set
+ * in the error flags, then an exception of type
+ * std::ios_base::failure is thrown.
+ *
+ * If the error flag is already set when the exceptions mask is
+ * added, the exception is immediately thrown. Try running the
+ * following under GCC 3.1 or later:
+ * @code
+ * #include <iostream>
+ * #include <fstream>
+ * #include <exception>
+ *
+ * int main()
+ * {
+ * std::set_terminate (__gnu_cxx::__verbose_terminate_handler);
+ *
+ * std::ifstream f ("/etc/motd");
+ *
+ * std::cerr << "Setting badbit\n";
+ * f.setstate (std::ios_base::badbit);
+ *
+ * std::cerr << "Setting exception mask\n";
+ * f.exceptions (std::ios_base::badbit);
+ * }
+ * @endcode
+ */
+ void
+ exceptions(iostate __except)
+ {
+ _M_exception = __except;
+ this->clear(_M_streambuf_state);
+ }
+
+ // Constructor/destructor:
+ /**
+ * @brief Constructor performs initialization.
+ *
+ * The parameter is passed by derived streams.
+ */
+ explicit
+ basic_ios(basic_streambuf<_CharT, _Traits>* __sb)
+ : ios_base(), _M_tie(0), _M_fill(), _M_fill_init(false), _M_streambuf(0),
+ _M_ctype(0), _M_num_put(0), _M_num_get(0)
+ { this->init(__sb); }
+
+ /**
+ * @brief Empty.
+ *
+ * The destructor does nothing. More specifically, it does not
+ * destroy the streambuf held by rdbuf().
+ */
+ virtual
+ ~basic_ios() { }
+
+ // Members:
+ /**
+ * @brief Fetches the current @e tied stream.
+ * @return A pointer to the tied stream, or NULL if the stream is
+ * not tied.
+ *
+ * A stream may be @e tied (or synchronized) to a second output
+ * stream. When this stream performs any I/O, the tied stream is
+ * first flushed. For example, @c std::cin is tied to @c std::cout.
+ */
+ basic_ostream<_CharT, _Traits>*
+ tie() const
+ { return _M_tie; }
+
+ /**
+ * @brief Ties this stream to an output stream.
+ * @param tiestr The output stream.
+ * @return The previously tied output stream, or NULL if the stream
+ * was not tied.
+ *
+ * This sets up a new tie; see tie() for more.
+ */
+ basic_ostream<_CharT, _Traits>*
+ tie(basic_ostream<_CharT, _Traits>* __tiestr)
+ {
+ basic_ostream<_CharT, _Traits>* __old = _M_tie;
+ _M_tie = __tiestr;
+ return __old;
+ }
+
+ /**
+ * @brief Accessing the underlying buffer.
+ * @return The current stream buffer.
+ *
+ * This does not change the state of the stream.
+ */
+ basic_streambuf<_CharT, _Traits>*
+ rdbuf() const
+ { return _M_streambuf; }
+
+ /**
+ * @brief Changing the underlying buffer.
+ * @param sb The new stream buffer.
+ * @return The previous stream buffer.
+ *
+ * Associates a new buffer with the current stream, and clears the
+ * error state.
+ *
+ * Due to historical accidents which the LWG refuses to correct, the
+ * I/O library suffers from a design error: this function is hidden
+ * in derived classes by overrides of the zero-argument @c rdbuf(),
+ * which is non-virtual for hysterical raisins. As a result, you
+ * must use explicit qualifications to access this function via any
+ * derived class. For example:
+ *
+ * @code
+ * std::fstream foo; // or some other derived type
+ * std::streambuf* p = .....;
+ *
+ * foo.ios::rdbuf(p); // ios == basic_ios<char>
+ * @endcode
+ */
+ basic_streambuf<_CharT, _Traits>*
+ rdbuf(basic_streambuf<_CharT, _Traits>* __sb);
+
+ /**
+ * @brief Copies fields of __rhs into this.
+ * @param __rhs The source values for the copies.
+ * @return Reference to this object.
+ *
+ * All fields of __rhs are copied into this object except that rdbuf()
+ * and rdstate() remain unchanged. All values in the pword and iword
+ * arrays are copied. Before copying, each callback is invoked with
+ * erase_event. After copying, each (new) callback is invoked with
+ * copyfmt_event. The final step is to copy exceptions().
+ */
+ basic_ios&
+ copyfmt(const basic_ios& __rhs);
+
+ /**
+ * @brief Retrieves the "empty" character.
+ * @return The current fill character.
+ *
+ * It defaults to a space (' ') in the current locale.
+ */
+ char_type
+ fill() const
+ {
+ if (!_M_fill_init)
+ {
+ _M_fill = this->widen(' ');
+ _M_fill_init = true;
+ }
+ return _M_fill;
+ }
+
+ /**
+ * @brief Sets a new "empty" character.
+ * @param ch The new character.
+ * @return The previous fill character.
+ *
+ * The fill character is used to fill out space when P+ characters
+ * have been requested (e.g., via setw), Q characters are actually
+ * used, and Q<P. It defaults to a space (' ') in the current locale.
+ */
+ char_type
+ fill(char_type __ch)
+ {
+ char_type __old = this->fill();
+ _M_fill = __ch;
+ return __old;
+ }
+
+ // Locales:
+ /**
+ * @brief Moves to a new locale.
+ * @param loc The new locale.
+ * @return The previous locale.
+ *
+ * Calls @c ios_base::imbue(loc), and if a stream buffer is associated
+ * with this stream, calls that buffer's @c pubimbue(loc).
+ *
+ * Additional l10n notes are at
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html
+ */
+ locale
+ imbue(const locale& __loc);
+
+ /**
+ * @brief Squeezes characters.
+ * @param c The character to narrow.
+ * @param dfault The character to narrow.
+ * @return The narrowed character.
+ *
+ * Maps a character of @c char_type to a character of @c char,
+ * if possible.
+ *
+ * Returns the result of
+ * @code
+ * std::use_facet<ctype<char_type> >(getloc()).narrow(c,dfault)
+ * @endcode
+ *
+ * Additional l10n notes are at
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html
+ */
+ char
+ narrow(char_type __c, char __dfault) const
+ { return __check_facet(_M_ctype).narrow(__c, __dfault); }
+
+ /**
+ * @brief Widens characters.
+ * @param c The character to widen.
+ * @return The widened character.
+ *
+ * Maps a character of @c char to a character of @c char_type.
+ *
+ * Returns the result of
+ * @code
+ * std::use_facet<ctype<char_type> >(getloc()).widen(c)
+ * @endcode
+ *
+ * Additional l10n notes are at
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html
+ */
+ char_type
+ widen(char __c) const
+ { return __check_facet(_M_ctype).widen(__c); }
+
+ protected:
+ // 27.4.5.1 basic_ios constructors
+ /**
+ * @brief Empty.
+ *
+ * The default constructor does nothing and is not normally
+ * accessible to users.
+ */
+ basic_ios()
+ : ios_base(), _M_tie(0), _M_fill(char_type()), _M_fill_init(false),
+ _M_streambuf(0), _M_ctype(0), _M_num_put(0), _M_num_get(0)
+ { }
+
+ /**
+ * @brief All setup is performed here.
+ *
+ * This is called from the public constructor. It is not virtual and
+ * cannot be redefined.
+ */
+ void
+ init(basic_streambuf<_CharT, _Traits>* __sb);
+
+ void
+ _M_cache_locale(const locale& __loc);
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+#include <bits/basic_ios.tcc>
+#endif
+
+#endif /* _BASIC_IOS_H */
diff --git a/i686-linux/include/c++/4.4.3/bits/basic_ios.tcc b/i686-linux/include/c++/4.4.3/bits/basic_ios.tcc
new file mode 100644
index 0000000..a0dc67e
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/basic_ios.tcc
@@ -0,0 +1,187 @@
+// basic_ios member functions -*- C++ -*-
+
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+// 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file basic_ios.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _BASIC_IOS_TCC
+#define _BASIC_IOS_TCC 1
+
+#pragma GCC system_header
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _CharT, typename _Traits>
+ void
+ basic_ios<_CharT, _Traits>::clear(iostate __state)
+ {
+ if (this->rdbuf())
+ _M_streambuf_state = __state;
+ else
+ _M_streambuf_state = __state | badbit;
+ if (this->exceptions() & this->rdstate())
+ __throw_ios_failure(__N("basic_ios::clear"));
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_streambuf<_CharT, _Traits>*
+ basic_ios<_CharT, _Traits>::rdbuf(basic_streambuf<_CharT, _Traits>* __sb)
+ {
+ basic_streambuf<_CharT, _Traits>* __old = _M_streambuf;
+ _M_streambuf = __sb;
+ this->clear();
+ return __old;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_ios<_CharT, _Traits>&
+ basic_ios<_CharT, _Traits>::copyfmt(const basic_ios& __rhs)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 292. effects of a.copyfmt (a)
+ if (this != &__rhs)
+ {
+ // Per 27.1.1, do not call imbue, yet must trash all caches
+ // associated with imbue()
+
+ // Alloc any new word array first, so if it fails we have "rollback".
+ _Words* __words = (__rhs._M_word_size <= _S_local_word_size) ?
+ _M_local_word : new _Words[__rhs._M_word_size];
+
+ // Bump refs before doing callbacks, for safety.
+ _Callback_list* __cb = __rhs._M_callbacks;
+ if (__cb)
+ __cb->_M_add_reference();
+ _M_call_callbacks(erase_event);
+ if (_M_word != _M_local_word)
+ {
+ delete [] _M_word;
+ _M_word = 0;
+ }
+ _M_dispose_callbacks();
+
+ // NB: Don't want any added during above.
+ _M_callbacks = __cb;
+ for (int __i = 0; __i < __rhs._M_word_size; ++__i)
+ __words[__i] = __rhs._M_word[__i];
+ _M_word = __words;
+ _M_word_size = __rhs._M_word_size;
+
+ this->flags(__rhs.flags());
+ this->width(__rhs.width());
+ this->precision(__rhs.precision());
+ this->tie(__rhs.tie());
+ this->fill(__rhs.fill());
+ _M_ios_locale = __rhs.getloc();
+ _M_cache_locale(_M_ios_locale);
+
+ _M_call_callbacks(copyfmt_event);
+
+ // The next is required to be the last assignment.
+ this->exceptions(__rhs.exceptions());
+ }
+ return *this;
+ }
+
+ // Locales:
+ template<typename _CharT, typename _Traits>
+ locale
+ basic_ios<_CharT, _Traits>::imbue(const locale& __loc)
+ {
+ locale __old(this->getloc());
+ ios_base::imbue(__loc);
+ _M_cache_locale(__loc);
+ if (this->rdbuf() != 0)
+ this->rdbuf()->pubimbue(__loc);
+ return __old;
+ }
+
+ template<typename _CharT, typename _Traits>
+ void
+ basic_ios<_CharT, _Traits>::init(basic_streambuf<_CharT, _Traits>* __sb)
+ {
+ // NB: This may be called more than once on the same object.
+ ios_base::_M_init();
+
+ // Cache locale data and specific facets used by iostreams.
+ _M_cache_locale(_M_ios_locale);
+
+ // NB: The 27.4.4.1 Postconditions Table specifies requirements
+ // after basic_ios::init() has been called. As part of this,
+ // fill() must return widen(' ') any time after init() has been
+ // called, which needs an imbued ctype facet of char_type to
+ // return without throwing an exception. Unfortunately,
+ // ctype<char_type> is not necessarily a required facet, so
+ // streams with char_type != [char, wchar_t] will not have it by
+ // default. Because of this, the correct value for _M_fill is
+ // constructed on the first call of fill(). That way,
+ // unformatted input and output with non-required basic_ios
+ // instantiations is possible even without imbuing the expected
+ // ctype<char_type> facet.
+ _M_fill = _CharT();
+ _M_fill_init = false;
+
+ _M_tie = 0;
+ _M_exception = goodbit;
+ _M_streambuf = __sb;
+ _M_streambuf_state = __sb ? goodbit : badbit;
+ }
+
+ template<typename _CharT, typename _Traits>
+ void
+ basic_ios<_CharT, _Traits>::_M_cache_locale(const locale& __loc)
+ {
+ if (__builtin_expect(has_facet<__ctype_type>(__loc), true))
+ _M_ctype = &use_facet<__ctype_type>(__loc);
+ else
+ _M_ctype = 0;
+
+ if (__builtin_expect(has_facet<__num_put_type>(__loc), true))
+ _M_num_put = &use_facet<__num_put_type>(__loc);
+ else
+ _M_num_put = 0;
+
+ if (__builtin_expect(has_facet<__num_get_type>(__loc), true))
+ _M_num_get = &use_facet<__num_get_type>(__loc);
+ else
+ _M_num_get = 0;
+ }
+
+ // Inhibit implicit instantiations for required instantiations,
+ // which are defined via explicit instantiations elsewhere.
+ // NB: This syntax is a GNU extension.
+#if _GLIBCXX_EXTERN_TEMPLATE
+ extern template class basic_ios<char>;
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ extern template class basic_ios<wchar_t>;
+#endif
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/bits/basic_string.h b/i686-linux/include/c++/4.4.3/bits/basic_string.h
new file mode 100644
index 0000000..1e8300d
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/basic_string.h
@@ -0,0 +1,2692 @@
+// Components for manipulating sequences of characters -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file basic_string.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 21 Strings library
+//
+
+#ifndef _BASIC_STRING_H
+#define _BASIC_STRING_H 1
+
+#pragma GCC system_header
+
+#include <ext/atomicity.h>
+#include <debug/debug.h>
+#include <initializer_list>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @class basic_string basic_string.h <string>
+ * @brief Managing sequences of characters and character-like objects.
+ *
+ * @ingroup sequences
+ *
+ * Meets the requirements of a <a href="tables.html#65">container</a>, a
+ * <a href="tables.html#66">reversible container</a>, and a
+ * <a href="tables.html#67">sequence</a>. Of the
+ * <a href="tables.html#68">optional sequence requirements</a>, only
+ * @c push_back, @c at, and array access are supported.
+ *
+ * @doctodo
+ *
+ *
+ * Documentation? What's that?
+ * Nathan Myers <ncm@cantrip.org>.
+ *
+ * A string looks like this:
+ *
+ * @code
+ * [_Rep]
+ * _M_length
+ * [basic_string<char_type>] _M_capacity
+ * _M_dataplus _M_refcount
+ * _M_p ----------------> unnamed array of char_type
+ * @endcode
+ *
+ * Where the _M_p points to the first character in the string, and
+ * you cast it to a pointer-to-_Rep and subtract 1 to get a
+ * pointer to the header.
+ *
+ * This approach has the enormous advantage that a string object
+ * requires only one allocation. All the ugliness is confined
+ * within a single pair of inline functions, which each compile to
+ * a single "add" instruction: _Rep::_M_data(), and
+ * string::_M_rep(); and the allocation function which gets a
+ * block of raw bytes and with room enough and constructs a _Rep
+ * object at the front.
+ *
+ * The reason you want _M_data pointing to the character array and
+ * not the _Rep is so that the debugger can see the string
+ * contents. (Probably we should add a non-inline member to get
+ * the _Rep for the debugger to use, so users can check the actual
+ * string length.)
+ *
+ * Note that the _Rep object is a POD so that you can have a
+ * static "empty string" _Rep object already "constructed" before
+ * static constructors have run. The reference-count encoding is
+ * chosen so that a 0 indicates one reference, so you never try to
+ * destroy the empty-string _Rep object.
+ *
+ * All but the last paragraph is considered pretty conventional
+ * for a C++ string implementation.
+ */
+ // 21.3 Template class basic_string
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ class basic_string
+ {
+ typedef typename _Alloc::template rebind<_CharT>::other _CharT_alloc_type;
+
+ // Types:
+ public:
+ typedef _Traits traits_type;
+ typedef typename _Traits::char_type value_type;
+ typedef _Alloc allocator_type;
+ typedef typename _CharT_alloc_type::size_type size_type;
+ typedef typename _CharT_alloc_type::difference_type difference_type;
+ typedef typename _CharT_alloc_type::reference reference;
+ typedef typename _CharT_alloc_type::const_reference const_reference;
+ typedef typename _CharT_alloc_type::pointer pointer;
+ typedef typename _CharT_alloc_type::const_pointer const_pointer;
+ typedef __gnu_cxx::__normal_iterator<pointer, basic_string> iterator;
+ typedef __gnu_cxx::__normal_iterator<const_pointer, basic_string>
+ const_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+
+ private:
+ // _Rep: string representation
+ // Invariants:
+ // 1. String really contains _M_length + 1 characters: due to 21.3.4
+ // must be kept null-terminated.
+ // 2. _M_capacity >= _M_length
+ // Allocated memory is always (_M_capacity + 1) * sizeof(_CharT).
+ // 3. _M_refcount has three states:
+ // -1: leaked, one reference, no ref-copies allowed, non-const.
+ // 0: one reference, non-const.
+ // n>0: n + 1 references, operations require a lock, const.
+ // 4. All fields==0 is an empty string, given the extra storage
+ // beyond-the-end for a null terminator; thus, the shared
+ // empty string representation needs no constructor.
+
+ struct _Rep_base
+ {
+ size_type _M_length;
+ size_type _M_capacity;
+ _Atomic_word _M_refcount;
+ };
+
+ struct _Rep : _Rep_base
+ {
+ // Types:
+ typedef typename _Alloc::template rebind<char>::other _Raw_bytes_alloc;
+
+ // (Public) Data members:
+
+ // The maximum number of individual char_type elements of an
+ // individual string is determined by _S_max_size. This is the
+ // value that will be returned by max_size(). (Whereas npos
+ // is the maximum number of bytes the allocator can allocate.)
+ // If one was to divvy up the theoretical largest size string,
+ // with a terminating character and m _CharT elements, it'd
+ // look like this:
+ // npos = sizeof(_Rep) + (m * sizeof(_CharT)) + sizeof(_CharT)
+ // Solving for m:
+ // m = ((npos - sizeof(_Rep))/sizeof(CharT)) - 1
+ // In addition, this implementation quarters this amount.
+ static const size_type _S_max_size;
+ static const _CharT _S_terminal;
+
+ // The following storage is init'd to 0 by the linker, resulting
+ // (carefully) in an empty string with one reference.
+ static size_type _S_empty_rep_storage[];
+
+ static _Rep&
+ _S_empty_rep()
+ {
+ // NB: Mild hack to avoid strict-aliasing warnings. Note that
+ // _S_empty_rep_storage is never modified and the punning should
+ // be reasonably safe in this case.
+ void* __p = reinterpret_cast<void*>(&_S_empty_rep_storage);
+ return *reinterpret_cast<_Rep*>(__p);
+ }
+
+ bool
+ _M_is_leaked() const
+ { return this->_M_refcount < 0; }
+
+ bool
+ _M_is_shared() const
+ { return this->_M_refcount > 0; }
+
+ void
+ _M_set_leaked()
+ { this->_M_refcount = -1; }
+
+ void
+ _M_set_sharable()
+ { this->_M_refcount = 0; }
+
+ void
+ _M_set_length_and_sharable(size_type __n)
+ {
+ this->_M_set_sharable(); // One reference.
+ this->_M_length = __n;
+ traits_type::assign(this->_M_refdata()[__n], _S_terminal);
+ // grrr. (per 21.3.4)
+ // You cannot leave those LWG people alone for a second.
+ }
+
+ _CharT*
+ _M_refdata() throw()
+ { return reinterpret_cast<_CharT*>(this + 1); }
+
+ _CharT*
+ _M_grab(const _Alloc& __alloc1, const _Alloc& __alloc2)
+ {
+ return (!_M_is_leaked() && __alloc1 == __alloc2)
+ ? _M_refcopy() : _M_clone(__alloc1);
+ }
+
+ // Create & Destroy
+ static _Rep*
+ _S_create(size_type, size_type, const _Alloc&);
+
+ void
+ _M_dispose(const _Alloc& __a)
+ {
+#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
+ if (__builtin_expect(this != &_S_empty_rep(), false))
+#endif
+ if (__gnu_cxx::__exchange_and_add_dispatch(&this->_M_refcount,
+ -1) <= 0)
+ _M_destroy(__a);
+ } // XXX MT
+
+ void
+ _M_destroy(const _Alloc&) throw();
+
+ _CharT*
+ _M_refcopy() throw()
+ {
+#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
+ if (__builtin_expect(this != &_S_empty_rep(), false))
+#endif
+ __gnu_cxx::__atomic_add_dispatch(&this->_M_refcount, 1);
+ return _M_refdata();
+ } // XXX MT
+
+ _CharT*
+ _M_clone(const _Alloc&, size_type __res = 0);
+ };
+
+ // Use empty-base optimization: http://www.cantrip.org/emptyopt.html
+ struct _Alloc_hider : _Alloc
+ {
+ _Alloc_hider(_CharT* __dat, const _Alloc& __a)
+ : _Alloc(__a), _M_p(__dat) { }
+
+ _CharT* _M_p; // The actual data.
+ };
+
+ public:
+ // Data Members (public):
+ // NB: This is an unsigned type, and thus represents the maximum
+ // size that the allocator can hold.
+ /// Value returned by various member functions when they fail.
+ static const size_type npos = static_cast<size_type>(-1);
+
+ private:
+ // Data Members (private):
+ mutable _Alloc_hider _M_dataplus;
+
+ _CharT*
+ _M_data() const
+ { return _M_dataplus._M_p; }
+
+ _CharT*
+ _M_data(_CharT* __p)
+ { return (_M_dataplus._M_p = __p); }
+
+ _Rep*
+ _M_rep() const
+ { return &((reinterpret_cast<_Rep*> (_M_data()))[-1]); }
+
+ // For the internal use we have functions similar to `begin'/`end'
+ // but they do not call _M_leak.
+ iterator
+ _M_ibegin() const
+ { return iterator(_M_data()); }
+
+ iterator
+ _M_iend() const
+ { return iterator(_M_data() + this->size()); }
+
+ void
+ _M_leak() // for use in begin() & non-const op[]
+ {
+ if (!_M_rep()->_M_is_leaked())
+ _M_leak_hard();
+ }
+
+ size_type
+ _M_check(size_type __pos, const char* __s) const
+ {
+ if (__pos > this->size())
+ __throw_out_of_range(__N(__s));
+ return __pos;
+ }
+
+ void
+ _M_check_length(size_type __n1, size_type __n2, const char* __s) const
+ {
+ if (this->max_size() - (this->size() - __n1) < __n2)
+ __throw_length_error(__N(__s));
+ }
+
+ // NB: _M_limit doesn't check for a bad __pos value.
+ size_type
+ _M_limit(size_type __pos, size_type __off) const
+ {
+ const bool __testoff = __off < this->size() - __pos;
+ return __testoff ? __off : this->size() - __pos;
+ }
+
+ // True if _Rep and source do not overlap.
+ bool
+ _M_disjunct(const _CharT* __s) const
+ {
+ return (less<const _CharT*>()(__s, _M_data())
+ || less<const _CharT*>()(_M_data() + this->size(), __s));
+ }
+
+ // When __n = 1 way faster than the general multichar
+ // traits_type::copy/move/assign.
+ static void
+ _M_copy(_CharT* __d, const _CharT* __s, size_type __n)
+ {
+ if (__n == 1)
+ traits_type::assign(*__d, *__s);
+ else
+ traits_type::copy(__d, __s, __n);
+ }
+
+ static void
+ _M_move(_CharT* __d, const _CharT* __s, size_type __n)
+ {
+ if (__n == 1)
+ traits_type::assign(*__d, *__s);
+ else
+ traits_type::move(__d, __s, __n);
+ }
+
+ static void
+ _M_assign(_CharT* __d, size_type __n, _CharT __c)
+ {
+ if (__n == 1)
+ traits_type::assign(*__d, __c);
+ else
+ traits_type::assign(__d, __n, __c);
+ }
+
+ // _S_copy_chars is a separate template to permit specialization
+ // to optimize for the common case of pointers as iterators.
+ template<class _Iterator>
+ static void
+ _S_copy_chars(_CharT* __p, _Iterator __k1, _Iterator __k2)
+ {
+ for (; __k1 != __k2; ++__k1, ++__p)
+ traits_type::assign(*__p, *__k1); // These types are off.
+ }
+
+ static void
+ _S_copy_chars(_CharT* __p, iterator __k1, iterator __k2)
+ { _S_copy_chars(__p, __k1.base(), __k2.base()); }
+
+ static void
+ _S_copy_chars(_CharT* __p, const_iterator __k1, const_iterator __k2)
+ { _S_copy_chars(__p, __k1.base(), __k2.base()); }
+
+ static void
+ _S_copy_chars(_CharT* __p, _CharT* __k1, _CharT* __k2)
+ { _M_copy(__p, __k1, __k2 - __k1); }
+
+ static void
+ _S_copy_chars(_CharT* __p, const _CharT* __k1, const _CharT* __k2)
+ { _M_copy(__p, __k1, __k2 - __k1); }
+
+ static int
+ _S_compare(size_type __n1, size_type __n2)
+ {
+ const difference_type __d = difference_type(__n1 - __n2);
+
+ if (__d > __gnu_cxx::__numeric_traits<int>::__max)
+ return __gnu_cxx::__numeric_traits<int>::__max;
+ else if (__d < __gnu_cxx::__numeric_traits<int>::__min)
+ return __gnu_cxx::__numeric_traits<int>::__min;
+ else
+ return int(__d);
+ }
+
+ void
+ _M_mutate(size_type __pos, size_type __len1, size_type __len2);
+
+ void
+ _M_leak_hard();
+
+ static _Rep&
+ _S_empty_rep()
+ { return _Rep::_S_empty_rep(); }
+
+ public:
+ // Construct/copy/destroy:
+ // NB: We overload ctors in some cases instead of using default
+ // arguments, per 17.4.4.4 para. 2 item 2.
+
+ /**
+ * @brief Default constructor creates an empty string.
+ */
+ inline
+ basic_string();
+
+ /**
+ * @brief Construct an empty string using allocator @a a.
+ */
+ explicit
+ basic_string(const _Alloc& __a);
+
+ // NB: per LWG issue 42, semantics different from IS:
+ /**
+ * @brief Construct string with copy of value of @a str.
+ * @param str Source string.
+ */
+ basic_string(const basic_string& __str);
+ /**
+ * @brief Construct string as copy of a substring.
+ * @param str Source string.
+ * @param pos Index of first character to copy from.
+ * @param n Number of characters to copy (default remainder).
+ */
+ basic_string(const basic_string& __str, size_type __pos,
+ size_type __n = npos);
+ /**
+ * @brief Construct string as copy of a substring.
+ * @param str Source string.
+ * @param pos Index of first character to copy from.
+ * @param n Number of characters to copy.
+ * @param a Allocator to use.
+ */
+ basic_string(const basic_string& __str, size_type __pos,
+ size_type __n, const _Alloc& __a);
+
+ /**
+ * @brief Construct string initialized by a character array.
+ * @param s Source character array.
+ * @param n Number of characters to copy.
+ * @param a Allocator to use (default is default allocator).
+ *
+ * NB: @a s must have at least @a n characters, '\\0' has no special
+ * meaning.
+ */
+ basic_string(const _CharT* __s, size_type __n,
+ const _Alloc& __a = _Alloc());
+ /**
+ * @brief Construct string as copy of a C string.
+ * @param s Source C string.
+ * @param a Allocator to use (default is default allocator).
+ */
+ basic_string(const _CharT* __s, const _Alloc& __a = _Alloc());
+ /**
+ * @brief Construct string as multiple characters.
+ * @param n Number of characters.
+ * @param c Character to use.
+ * @param a Allocator to use (default is default allocator).
+ */
+ basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc());
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Construct string from an initializer list.
+ * @param l std::initializer_list of characters.
+ * @param a Allocator to use (default is default allocator).
+ */
+ basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc());
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+ /**
+ * @brief Construct string as copy of a range.
+ * @param beg Start of range.
+ * @param end End of range.
+ * @param a Allocator to use (default is default allocator).
+ */
+ template<class _InputIterator>
+ basic_string(_InputIterator __beg, _InputIterator __end,
+ const _Alloc& __a = _Alloc());
+
+ /**
+ * @brief Destroy the string instance.
+ */
+ ~basic_string()
+ { _M_rep()->_M_dispose(this->get_allocator()); }
+
+ /**
+ * @brief Assign the value of @a str to this string.
+ * @param str Source string.
+ */
+ basic_string&
+ operator=(const basic_string& __str)
+ { return this->assign(__str); }
+
+ /**
+ * @brief Copy contents of @a s into this string.
+ * @param s Source null-terminated string.
+ */
+ basic_string&
+ operator=(const _CharT* __s)
+ { return this->assign(__s); }
+
+ /**
+ * @brief Set value to string of length 1.
+ * @param c Source character.
+ *
+ * Assigning to a character makes this string length 1 and
+ * (*this)[0] == @a c.
+ */
+ basic_string&
+ operator=(_CharT __c)
+ {
+ this->assign(1, __c);
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Set value to string constructed from initializer list.
+ * @param l std::initializer_list.
+ */
+ basic_string&
+ operator=(initializer_list<_CharT> __l)
+ {
+ this->assign (__l.begin(), __l.end());
+ return *this;
+ }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+ // Iterators:
+ /**
+ * Returns a read/write iterator that points to the first character in
+ * the %string. Unshares the string.
+ */
+ iterator
+ begin()
+ {
+ _M_leak();
+ return iterator(_M_data());
+ }
+
+ /**
+ * Returns a read-only (constant) iterator that points to the first
+ * character in the %string.
+ */
+ const_iterator
+ begin() const
+ { return const_iterator(_M_data()); }
+
+ /**
+ * Returns a read/write iterator that points one past the last
+ * character in the %string. Unshares the string.
+ */
+ iterator
+ end()
+ {
+ _M_leak();
+ return iterator(_M_data() + this->size());
+ }
+
+ /**
+ * Returns a read-only (constant) iterator that points one past the
+ * last character in the %string.
+ */
+ const_iterator
+ end() const
+ { return const_iterator(_M_data() + this->size()); }
+
+ /**
+ * Returns a read/write reverse iterator that points to the last
+ * character in the %string. Iteration is done in reverse element
+ * order. Unshares the string.
+ */
+ reverse_iterator
+ rbegin()
+ { return reverse_iterator(this->end()); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points
+ * to the last character in the %string. Iteration is done in
+ * reverse element order.
+ */
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(this->end()); }
+
+ /**
+ * Returns a read/write reverse iterator that points to one before the
+ * first character in the %string. Iteration is done in reverse
+ * element order. Unshares the string.
+ */
+ reverse_iterator
+ rend()
+ { return reverse_iterator(this->begin()); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points
+ * to one before the first character in the %string. Iteration
+ * is done in reverse element order.
+ */
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(this->begin()); }
+
+ public:
+ // Capacity:
+ /// Returns the number of characters in the string, not including any
+ /// null-termination.
+ size_type
+ size() const
+ { return _M_rep()->_M_length; }
+
+ /// Returns the number of characters in the string, not including any
+ /// null-termination.
+ size_type
+ length() const
+ { return _M_rep()->_M_length; }
+
+ /// Returns the size() of the largest possible %string.
+ size_type
+ max_size() const
+ { return _Rep::_S_max_size; }
+
+ /**
+ * @brief Resizes the %string to the specified number of characters.
+ * @param n Number of characters the %string should contain.
+ * @param c Character to fill any new elements.
+ *
+ * This function will %resize the %string to the specified
+ * number of characters. If the number is smaller than the
+ * %string's current size the %string is truncated, otherwise
+ * the %string is extended and new elements are set to @a c.
+ */
+ void
+ resize(size_type __n, _CharT __c);
+
+ /**
+ * @brief Resizes the %string to the specified number of characters.
+ * @param n Number of characters the %string should contain.
+ *
+ * This function will resize the %string to the specified length. If
+ * the new size is smaller than the %string's current size the %string
+ * is truncated, otherwise the %string is extended and new characters
+ * are default-constructed. For basic types such as char, this means
+ * setting them to 0.
+ */
+ void
+ resize(size_type __n)
+ { this->resize(__n, _CharT()); }
+
+ /**
+ * Returns the total number of characters that the %string can hold
+ * before needing to allocate more memory.
+ */
+ size_type
+ capacity() const
+ { return _M_rep()->_M_capacity; }
+
+ /**
+ * @brief Attempt to preallocate enough memory for specified number of
+ * characters.
+ * @param res_arg Number of characters required.
+ * @throw std::length_error If @a res_arg exceeds @c max_size().
+ *
+ * This function attempts to reserve enough memory for the
+ * %string to hold the specified number of characters. If the
+ * number requested is more than max_size(), length_error is
+ * thrown.
+ *
+ * The advantage of this function is that if optimal code is a
+ * necessity and the user can determine the string length that will be
+ * required, the user can reserve the memory in %advance, and thus
+ * prevent a possible reallocation of memory and copying of %string
+ * data.
+ */
+ void
+ reserve(size_type __res_arg = 0);
+
+ /**
+ * Erases the string, making it empty.
+ */
+ void
+ clear()
+ { _M_mutate(0, this->size(), 0); }
+
+ /**
+ * Returns true if the %string is empty. Equivalent to *this == "".
+ */
+ bool
+ empty() const
+ { return this->size() == 0; }
+
+ // Element access:
+ /**
+ * @brief Subscript access to the data contained in the %string.
+ * @param pos The index of the character to access.
+ * @return Read-only (constant) reference to the character.
+ *
+ * This operator allows for easy, array-style, data access.
+ * Note that data access with this operator is unchecked and
+ * out_of_range lookups are not defined. (For checked lookups
+ * see at().)
+ */
+ const_reference
+ operator[] (size_type __pos) const
+ {
+ _GLIBCXX_DEBUG_ASSERT(__pos <= size());
+ return _M_data()[__pos];
+ }
+
+ /**
+ * @brief Subscript access to the data contained in the %string.
+ * @param pos The index of the character to access.
+ * @return Read/write reference to the character.
+ *
+ * This operator allows for easy, array-style, data access.
+ * Note that data access with this operator is unchecked and
+ * out_of_range lookups are not defined. (For checked lookups
+ * see at().) Unshares the string.
+ */
+ reference
+ operator[](size_type __pos)
+ {
+ // allow pos == size() as v3 extension:
+ _GLIBCXX_DEBUG_ASSERT(__pos <= size());
+ // but be strict in pedantic mode:
+ _GLIBCXX_DEBUG_PEDASSERT(__pos < size());
+ _M_leak();
+ return _M_data()[__pos];
+ }
+
+ /**
+ * @brief Provides access to the data contained in the %string.
+ * @param n The index of the character to access.
+ * @return Read-only (const) reference to the character.
+ * @throw std::out_of_range If @a n is an invalid index.
+ *
+ * This function provides for safer data access. The parameter is
+ * first checked that it is in the range of the string. The function
+ * throws out_of_range if the check fails.
+ */
+ const_reference
+ at(size_type __n) const
+ {
+ if (__n >= this->size())
+ __throw_out_of_range(__N("basic_string::at"));
+ return _M_data()[__n];
+ }
+
+ /**
+ * @brief Provides access to the data contained in the %string.
+ * @param n The index of the character to access.
+ * @return Read/write reference to the character.
+ * @throw std::out_of_range If @a n is an invalid index.
+ *
+ * This function provides for safer data access. The parameter is
+ * first checked that it is in the range of the string. The function
+ * throws out_of_range if the check fails. Success results in
+ * unsharing the string.
+ */
+ reference
+ at(size_type __n)
+ {
+ if (__n >= size())
+ __throw_out_of_range(__N("basic_string::at"));
+ _M_leak();
+ return _M_data()[__n];
+ }
+
+ // Modifiers:
+ /**
+ * @brief Append a string to this string.
+ * @param str The string to append.
+ * @return Reference to this string.
+ */
+ basic_string&
+ operator+=(const basic_string& __str)
+ { return this->append(__str); }
+
+ /**
+ * @brief Append a C string.
+ * @param s The C string to append.
+ * @return Reference to this string.
+ */
+ basic_string&
+ operator+=(const _CharT* __s)
+ { return this->append(__s); }
+
+ /**
+ * @brief Append a character.
+ * @param c The character to append.
+ * @return Reference to this string.
+ */
+ basic_string&
+ operator+=(_CharT __c)
+ {
+ this->push_back(__c);
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Append an initializer_list of characters.
+ * @param l The initializer_list of characters to be appended.
+ * @return Reference to this string.
+ */
+ basic_string&
+ operator+=(initializer_list<_CharT> __l)
+ { return this->append(__l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+ /**
+ * @brief Append a string to this string.
+ * @param str The string to append.
+ * @return Reference to this string.
+ */
+ basic_string&
+ append(const basic_string& __str);
+
+ /**
+ * @brief Append a substring.
+ * @param str The string to append.
+ * @param pos Index of the first character of str to append.
+ * @param n The number of characters to append.
+ * @return Reference to this string.
+ * @throw std::out_of_range if @a pos is not a valid index.
+ *
+ * This function appends @a n characters from @a str starting at @a pos
+ * to this string. If @a n is is larger than the number of available
+ * characters in @a str, the remainder of @a str is appended.
+ */
+ basic_string&
+ append(const basic_string& __str, size_type __pos, size_type __n);
+
+ /**
+ * @brief Append a C substring.
+ * @param s The C string to append.
+ * @param n The number of characters to append.
+ * @return Reference to this string.
+ */
+ basic_string&
+ append(const _CharT* __s, size_type __n);
+
+ /**
+ * @brief Append a C string.
+ * @param s The C string to append.
+ * @return Reference to this string.
+ */
+ basic_string&
+ append(const _CharT* __s)
+ {
+ __glibcxx_requires_string(__s);
+ return this->append(__s, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Append multiple characters.
+ * @param n The number of characters to append.
+ * @param c The character to use.
+ * @return Reference to this string.
+ *
+ * Appends n copies of c to this string.
+ */
+ basic_string&
+ append(size_type __n, _CharT __c);
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Append an initializer_list of characters.
+ * @param l The initializer_list of characters to append.
+ * @return Reference to this string.
+ */
+ basic_string&
+ append(initializer_list<_CharT> __l)
+ { return this->append(__l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+ /**
+ * @brief Append a range of characters.
+ * @param first Iterator referencing the first character to append.
+ * @param last Iterator marking the end of the range.
+ * @return Reference to this string.
+ *
+ * Appends characters in the range [first,last) to this string.
+ */
+ template<class _InputIterator>
+ basic_string&
+ append(_InputIterator __first, _InputIterator __last)
+ { return this->replace(_M_iend(), _M_iend(), __first, __last); }
+
+ /**
+ * @brief Append a single character.
+ * @param c Character to append.
+ */
+ void
+ push_back(_CharT __c)
+ {
+ const size_type __len = 1 + this->size();
+ if (__len > this->capacity() || _M_rep()->_M_is_shared())
+ this->reserve(__len);
+ traits_type::assign(_M_data()[this->size()], __c);
+ _M_rep()->_M_set_length_and_sharable(__len);
+ }
+
+ /**
+ * @brief Set value to contents of another string.
+ * @param str Source string to use.
+ * @return Reference to this string.
+ */
+ basic_string&
+ assign(const basic_string& __str);
+
+ /**
+ * @brief Set value to a substring of a string.
+ * @param str The string to use.
+ * @param pos Index of the first character of str.
+ * @param n Number of characters to use.
+ * @return Reference to this string.
+ * @throw std::out_of_range if @a pos is not a valid index.
+ *
+ * This function sets this string to the substring of @a str consisting
+ * of @a n characters at @a pos. If @a n is is larger than the number
+ * of available characters in @a str, the remainder of @a str is used.
+ */
+ basic_string&
+ assign(const basic_string& __str, size_type __pos, size_type __n)
+ { return this->assign(__str._M_data()
+ + __str._M_check(__pos, "basic_string::assign"),
+ __str._M_limit(__pos, __n)); }
+
+ /**
+ * @brief Set value to a C substring.
+ * @param s The C string to use.
+ * @param n Number of characters to use.
+ * @return Reference to this string.
+ *
+ * This function sets the value of this string to the first @a n
+ * characters of @a s. If @a n is is larger than the number of
+ * available characters in @a s, the remainder of @a s is used.
+ */
+ basic_string&
+ assign(const _CharT* __s, size_type __n);
+
+ /**
+ * @brief Set value to contents of a C string.
+ * @param s The C string to use.
+ * @return Reference to this string.
+ *
+ * This function sets the value of this string to the value of @a s.
+ * The data is copied, so there is no dependence on @a s once the
+ * function returns.
+ */
+ basic_string&
+ assign(const _CharT* __s)
+ {
+ __glibcxx_requires_string(__s);
+ return this->assign(__s, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Set value to multiple characters.
+ * @param n Length of the resulting string.
+ * @param c The character to use.
+ * @return Reference to this string.
+ *
+ * This function sets the value of this string to @a n copies of
+ * character @a c.
+ */
+ basic_string&
+ assign(size_type __n, _CharT __c)
+ { return _M_replace_aux(size_type(0), this->size(), __n, __c); }
+
+ /**
+ * @brief Set value to a range of characters.
+ * @param first Iterator referencing the first character to append.
+ * @param last Iterator marking the end of the range.
+ * @return Reference to this string.
+ *
+ * Sets value of string to characters in the range [first,last).
+ */
+ template<class _InputIterator>
+ basic_string&
+ assign(_InputIterator __first, _InputIterator __last)
+ { return this->replace(_M_ibegin(), _M_iend(), __first, __last); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Set value to an initializer_list of characters.
+ * @param l The initializer_list of characters to assign.
+ * @return Reference to this string.
+ */
+ basic_string&
+ assign(initializer_list<_CharT> __l)
+ { return this->assign(__l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+ /**
+ * @brief Insert multiple characters.
+ * @param p Iterator referencing location in string to insert at.
+ * @param n Number of characters to insert
+ * @param c The character to insert.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Inserts @a n copies of character @a c starting at the position
+ * referenced by iterator @a p. If adding characters causes the length
+ * to exceed max_size(), length_error is thrown. The value of the
+ * string doesn't change if an error is thrown.
+ */
+ void
+ insert(iterator __p, size_type __n, _CharT __c)
+ { this->replace(__p, __p, __n, __c); }
+
+ /**
+ * @brief Insert a range of characters.
+ * @param p Iterator referencing location in string to insert at.
+ * @param beg Start of range.
+ * @param end End of range.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Inserts characters in range [beg,end). If adding characters causes
+ * the length to exceed max_size(), length_error is thrown. The value
+ * of the string doesn't change if an error is thrown.
+ */
+ template<class _InputIterator>
+ void
+ insert(iterator __p, _InputIterator __beg, _InputIterator __end)
+ { this->replace(__p, __p, __beg, __end); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Insert an initializer_list of characters.
+ * @param p Iterator referencing location in string to insert at.
+ * @param l The initializer_list of characters to insert.
+ * @throw std::length_error If new length exceeds @c max_size().
+ */
+ void
+ insert(iterator __p, initializer_list<_CharT> __l)
+ { this->insert(__p, __l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+ /**
+ * @brief Insert value of a string.
+ * @param pos1 Iterator referencing location in string to insert at.
+ * @param str The string to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Inserts value of @a str starting at @a pos1. If adding characters
+ * causes the length to exceed max_size(), length_error is thrown. The
+ * value of the string doesn't change if an error is thrown.
+ */
+ basic_string&
+ insert(size_type __pos1, const basic_string& __str)
+ { return this->insert(__pos1, __str, size_type(0), __str.size()); }
+
+ /**
+ * @brief Insert a substring.
+ * @param pos1 Iterator referencing location in string to insert at.
+ * @param str The string to insert.
+ * @param pos2 Start of characters in str to insert.
+ * @param n Number of characters to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ * @throw std::out_of_range If @a pos1 > size() or
+ * @a pos2 > @a str.size().
+ *
+ * Starting at @a pos1, insert @a n character of @a str beginning with
+ * @a pos2. If adding characters causes the length to exceed
+ * max_size(), length_error is thrown. If @a pos1 is beyond the end of
+ * this string or @a pos2 is beyond the end of @a str, out_of_range is
+ * thrown. The value of the string doesn't change if an error is
+ * thrown.
+ */
+ basic_string&
+ insert(size_type __pos1, const basic_string& __str,
+ size_type __pos2, size_type __n)
+ { return this->insert(__pos1, __str._M_data()
+ + __str._M_check(__pos2, "basic_string::insert"),
+ __str._M_limit(__pos2, __n)); }
+
+ /**
+ * @brief Insert a C substring.
+ * @param pos Iterator referencing location in string to insert at.
+ * @param s The C string to insert.
+ * @param n The number of characters to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ * @throw std::out_of_range If @a pos is beyond the end of this
+ * string.
+ *
+ * Inserts the first @a n characters of @a s starting at @a pos. If
+ * adding characters causes the length to exceed max_size(),
+ * length_error is thrown. If @a pos is beyond end(), out_of_range is
+ * thrown. The value of the string doesn't change if an error is
+ * thrown.
+ */
+ basic_string&
+ insert(size_type __pos, const _CharT* __s, size_type __n);
+
+ /**
+ * @brief Insert a C string.
+ * @param pos Iterator referencing location in string to insert at.
+ * @param s The C string to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ * @throw std::out_of_range If @a pos is beyond the end of this
+ * string.
+ *
+ * Inserts the first @a n characters of @a s starting at @a pos. If
+ * adding characters causes the length to exceed max_size(),
+ * length_error is thrown. If @a pos is beyond end(), out_of_range is
+ * thrown. The value of the string doesn't change if an error is
+ * thrown.
+ */
+ basic_string&
+ insert(size_type __pos, const _CharT* __s)
+ {
+ __glibcxx_requires_string(__s);
+ return this->insert(__pos, __s, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Insert multiple characters.
+ * @param pos Index in string to insert at.
+ * @param n Number of characters to insert
+ * @param c The character to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ * @throw std::out_of_range If @a pos is beyond the end of this
+ * string.
+ *
+ * Inserts @a n copies of character @a c starting at index @a pos. If
+ * adding characters causes the length to exceed max_size(),
+ * length_error is thrown. If @a pos > length(), out_of_range is
+ * thrown. The value of the string doesn't change if an error is
+ * thrown.
+ */
+ basic_string&
+ insert(size_type __pos, size_type __n, _CharT __c)
+ { return _M_replace_aux(_M_check(__pos, "basic_string::insert"),
+ size_type(0), __n, __c); }
+
+ /**
+ * @brief Insert one character.
+ * @param p Iterator referencing position in string to insert at.
+ * @param c The character to insert.
+ * @return Iterator referencing newly inserted char.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Inserts character @a c at position referenced by @a p. If adding
+ * character causes the length to exceed max_size(), length_error is
+ * thrown. If @a p is beyond end of string, out_of_range is thrown.
+ * The value of the string doesn't change if an error is thrown.
+ */
+ iterator
+ insert(iterator __p, _CharT __c)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(__p >= _M_ibegin() && __p <= _M_iend());
+ const size_type __pos = __p - _M_ibegin();
+ _M_replace_aux(__pos, size_type(0), size_type(1), __c);
+ _M_rep()->_M_set_leaked();
+ return iterator(_M_data() + __pos);
+ }
+
+ /**
+ * @brief Remove characters.
+ * @param pos Index of first character to remove (default 0).
+ * @param n Number of characters to remove (default remainder).
+ * @return Reference to this string.
+ * @throw std::out_of_range If @a pos is beyond the end of this
+ * string.
+ *
+ * Removes @a n characters from this string starting at @a pos. The
+ * length of the string is reduced by @a n. If there are < @a n
+ * characters to remove, the remainder of the string is truncated. If
+ * @a p is beyond end of string, out_of_range is thrown. The value of
+ * the string doesn't change if an error is thrown.
+ */
+ basic_string&
+ erase(size_type __pos = 0, size_type __n = npos)
+ {
+ _M_mutate(_M_check(__pos, "basic_string::erase"),
+ _M_limit(__pos, __n), size_type(0));
+ return *this;
+ }
+
+ /**
+ * @brief Remove one character.
+ * @param position Iterator referencing the character to remove.
+ * @return iterator referencing same location after removal.
+ *
+ * Removes the character at @a position from this string. The value
+ * of the string doesn't change if an error is thrown.
+ */
+ iterator
+ erase(iterator __position)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(__position >= _M_ibegin()
+ && __position < _M_iend());
+ const size_type __pos = __position - _M_ibegin();
+ _M_mutate(__pos, size_type(1), size_type(0));
+ _M_rep()->_M_set_leaked();
+ return iterator(_M_data() + __pos);
+ }
+
+ /**
+ * @brief Remove a range of characters.
+ * @param first Iterator referencing the first character to remove.
+ * @param last Iterator referencing the end of the range.
+ * @return Iterator referencing location of first after removal.
+ *
+ * Removes the characters in the range [first,last) from this string.
+ * The value of the string doesn't change if an error is thrown.
+ */
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(__first >= _M_ibegin() && __first <= __last
+ && __last <= _M_iend());
+ const size_type __pos = __first - _M_ibegin();
+ _M_mutate(__pos, __last - __first, size_type(0));
+ _M_rep()->_M_set_leaked();
+ return iterator(_M_data() + __pos);
+ }
+
+ /**
+ * @brief Replace characters with value from another string.
+ * @param pos Index of first character to replace.
+ * @param n Number of characters to be replaced.
+ * @param str String to insert.
+ * @return Reference to this string.
+ * @throw std::out_of_range If @a pos is beyond the end of this
+ * string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [pos,pos+n) from this string.
+ * In place, the value of @a str is inserted. If @a pos is beyond end
+ * of string, out_of_range is thrown. If the length of the result
+ * exceeds max_size(), length_error is thrown. The value of the string
+ * doesn't change if an error is thrown.
+ */
+ basic_string&
+ replace(size_type __pos, size_type __n, const basic_string& __str)
+ { return this->replace(__pos, __n, __str._M_data(), __str.size()); }
+
+ /**
+ * @brief Replace characters with value from another string.
+ * @param pos1 Index of first character to replace.
+ * @param n1 Number of characters to be replaced.
+ * @param str String to insert.
+ * @param pos2 Index of first character of str to use.
+ * @param n2 Number of characters from str to use.
+ * @return Reference to this string.
+ * @throw std::out_of_range If @a pos1 > size() or @a pos2 >
+ * str.size().
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [pos1,pos1 + n) from this
+ * string. In place, the value of @a str is inserted. If @a pos is
+ * beyond end of string, out_of_range is thrown. If the length of the
+ * result exceeds max_size(), length_error is thrown. The value of the
+ * string doesn't change if an error is thrown.
+ */
+ basic_string&
+ replace(size_type __pos1, size_type __n1, const basic_string& __str,
+ size_type __pos2, size_type __n2)
+ { return this->replace(__pos1, __n1, __str._M_data()
+ + __str._M_check(__pos2, "basic_string::replace"),
+ __str._M_limit(__pos2, __n2)); }
+
+ /**
+ * @brief Replace characters with value of a C substring.
+ * @param pos Index of first character to replace.
+ * @param n1 Number of characters to be replaced.
+ * @param s C string to insert.
+ * @param n2 Number of characters from @a s to use.
+ * @return Reference to this string.
+ * @throw std::out_of_range If @a pos1 > size().
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [pos,pos + n1) from this string.
+ * In place, the first @a n2 characters of @a s are inserted, or all
+ * of @a s if @a n2 is too large. If @a pos is beyond end of string,
+ * out_of_range is thrown. If the length of result exceeds max_size(),
+ * length_error is thrown. The value of the string doesn't change if
+ * an error is thrown.
+ */
+ basic_string&
+ replace(size_type __pos, size_type __n1, const _CharT* __s,
+ size_type __n2);
+
+ /**
+ * @brief Replace characters with value of a C string.
+ * @param pos Index of first character to replace.
+ * @param n1 Number of characters to be replaced.
+ * @param s C string to insert.
+ * @return Reference to this string.
+ * @throw std::out_of_range If @a pos > size().
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [pos,pos + n1) from this string.
+ * In place, the first @a n characters of @a s are inserted. If @a
+ * pos is beyond end of string, out_of_range is thrown. If the length
+ * of result exceeds max_size(), length_error is thrown. The value of
+ * the string doesn't change if an error is thrown.
+ */
+ basic_string&
+ replace(size_type __pos, size_type __n1, const _CharT* __s)
+ {
+ __glibcxx_requires_string(__s);
+ return this->replace(__pos, __n1, __s, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Replace characters with multiple characters.
+ * @param pos Index of first character to replace.
+ * @param n1 Number of characters to be replaced.
+ * @param n2 Number of characters to insert.
+ * @param c Character to insert.
+ * @return Reference to this string.
+ * @throw std::out_of_range If @a pos > size().
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [pos,pos + n1) from this string.
+ * In place, @a n2 copies of @a c are inserted. If @a pos is beyond
+ * end of string, out_of_range is thrown. If the length of result
+ * exceeds max_size(), length_error is thrown. The value of the string
+ * doesn't change if an error is thrown.
+ */
+ basic_string&
+ replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c)
+ { return _M_replace_aux(_M_check(__pos, "basic_string::replace"),
+ _M_limit(__pos, __n1), __n2, __c); }
+
+ /**
+ * @brief Replace range of characters with string.
+ * @param i1 Iterator referencing start of range to replace.
+ * @param i2 Iterator referencing end of range to replace.
+ * @param str String value to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [i1,i2). In place, the value of
+ * @a str is inserted. If the length of result exceeds max_size(),
+ * length_error is thrown. The value of the string doesn't change if
+ * an error is thrown.
+ */
+ basic_string&
+ replace(iterator __i1, iterator __i2, const basic_string& __str)
+ { return this->replace(__i1, __i2, __str._M_data(), __str.size()); }
+
+ /**
+ * @brief Replace range of characters with C substring.
+ * @param i1 Iterator referencing start of range to replace.
+ * @param i2 Iterator referencing end of range to replace.
+ * @param s C string value to insert.
+ * @param n Number of characters from s to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [i1,i2). In place, the first @a
+ * n characters of @a s are inserted. If the length of result exceeds
+ * max_size(), length_error is thrown. The value of the string doesn't
+ * change if an error is thrown.
+ */
+ basic_string&
+ replace(iterator __i1, iterator __i2, const _CharT* __s, size_type __n)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+ && __i2 <= _M_iend());
+ return this->replace(__i1 - _M_ibegin(), __i2 - __i1, __s, __n);
+ }
+
+ /**
+ * @brief Replace range of characters with C string.
+ * @param i1 Iterator referencing start of range to replace.
+ * @param i2 Iterator referencing end of range to replace.
+ * @param s C string value to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [i1,i2). In place, the
+ * characters of @a s are inserted. If the length of result exceeds
+ * max_size(), length_error is thrown. The value of the string doesn't
+ * change if an error is thrown.
+ */
+ basic_string&
+ replace(iterator __i1, iterator __i2, const _CharT* __s)
+ {
+ __glibcxx_requires_string(__s);
+ return this->replace(__i1, __i2, __s, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Replace range of characters with multiple characters
+ * @param i1 Iterator referencing start of range to replace.
+ * @param i2 Iterator referencing end of range to replace.
+ * @param n Number of characters to insert.
+ * @param c Character to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [i1,i2). In place, @a n copies
+ * of @a c are inserted. If the length of result exceeds max_size(),
+ * length_error is thrown. The value of the string doesn't change if
+ * an error is thrown.
+ */
+ basic_string&
+ replace(iterator __i1, iterator __i2, size_type __n, _CharT __c)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+ && __i2 <= _M_iend());
+ return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __c);
+ }
+
+ /**
+ * @brief Replace range of characters with range.
+ * @param i1 Iterator referencing start of range to replace.
+ * @param i2 Iterator referencing end of range to replace.
+ * @param k1 Iterator referencing start of range to insert.
+ * @param k2 Iterator referencing end of range to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [i1,i2). In place, characters
+ * in the range [k1,k2) are inserted. If the length of result exceeds
+ * max_size(), length_error is thrown. The value of the string doesn't
+ * change if an error is thrown.
+ */
+ template<class _InputIterator>
+ basic_string&
+ replace(iterator __i1, iterator __i2,
+ _InputIterator __k1, _InputIterator __k2)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+ && __i2 <= _M_iend());
+ __glibcxx_requires_valid_range(__k1, __k2);
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ return _M_replace_dispatch(__i1, __i2, __k1, __k2, _Integral());
+ }
+
+ // Specializations for the common case of pointer and iterator:
+ // useful to avoid the overhead of temporary buffering in _M_replace.
+ basic_string&
+ replace(iterator __i1, iterator __i2, _CharT* __k1, _CharT* __k2)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+ && __i2 <= _M_iend());
+ __glibcxx_requires_valid_range(__k1, __k2);
+ return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
+ __k1, __k2 - __k1);
+ }
+
+ basic_string&
+ replace(iterator __i1, iterator __i2,
+ const _CharT* __k1, const _CharT* __k2)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+ && __i2 <= _M_iend());
+ __glibcxx_requires_valid_range(__k1, __k2);
+ return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
+ __k1, __k2 - __k1);
+ }
+
+ basic_string&
+ replace(iterator __i1, iterator __i2, iterator __k1, iterator __k2)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+ && __i2 <= _M_iend());
+ __glibcxx_requires_valid_range(__k1, __k2);
+ return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
+ __k1.base(), __k2 - __k1);
+ }
+
+ basic_string&
+ replace(iterator __i1, iterator __i2,
+ const_iterator __k1, const_iterator __k2)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+ && __i2 <= _M_iend());
+ __glibcxx_requires_valid_range(__k1, __k2);
+ return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
+ __k1.base(), __k2 - __k1);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Replace range of characters with initializer_list.
+ * @param i1 Iterator referencing start of range to replace.
+ * @param i2 Iterator referencing end of range to replace.
+ * @param l The initializer_list of characters to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [i1,i2). In place, characters
+ * in the range [k1,k2) are inserted. If the length of result exceeds
+ * max_size(), length_error is thrown. The value of the string doesn't
+ * change if an error is thrown.
+ */
+ basic_string& replace(iterator __i1, iterator __i2,
+ initializer_list<_CharT> __l)
+ { return this->replace(__i1, __i2, __l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+ private:
+ template<class _Integer>
+ basic_string&
+ _M_replace_dispatch(iterator __i1, iterator __i2, _Integer __n,
+ _Integer __val, __true_type)
+ { return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __val); }
+
+ template<class _InputIterator>
+ basic_string&
+ _M_replace_dispatch(iterator __i1, iterator __i2, _InputIterator __k1,
+ _InputIterator __k2, __false_type);
+
+ basic_string&
+ _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2,
+ _CharT __c);
+
+ basic_string&
+ _M_replace_safe(size_type __pos1, size_type __n1, const _CharT* __s,
+ size_type __n2);
+
+ // _S_construct_aux is used to implement the 21.3.1 para 15 which
+ // requires special behaviour if _InIter is an integral type
+ template<class _InIterator>
+ static _CharT*
+ _S_construct_aux(_InIterator __beg, _InIterator __end,
+ const _Alloc& __a, __false_type)
+ {
+ typedef typename iterator_traits<_InIterator>::iterator_category _Tag;
+ return _S_construct(__beg, __end, __a, _Tag());
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 438. Ambiguity in the "do the right thing" clause
+ template<class _Integer>
+ static _CharT*
+ _S_construct_aux(_Integer __beg, _Integer __end,
+ const _Alloc& __a, __true_type)
+ { return _S_construct(static_cast<size_type>(__beg), __end, __a); }
+
+ template<class _InIterator>
+ static _CharT*
+ _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a)
+ {
+ typedef typename std::__is_integer<_InIterator>::__type _Integral;
+ return _S_construct_aux(__beg, __end, __a, _Integral());
+ }
+
+ // For Input Iterators, used in istreambuf_iterators, etc.
+ template<class _InIterator>
+ static _CharT*
+ _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a,
+ input_iterator_tag);
+
+ // For forward_iterators up to random_access_iterators, used for
+ // string::iterator, _CharT*, etc.
+ template<class _FwdIterator>
+ static _CharT*
+ _S_construct(_FwdIterator __beg, _FwdIterator __end, const _Alloc& __a,
+ forward_iterator_tag);
+
+ static _CharT*
+ _S_construct(size_type __req, _CharT __c, const _Alloc& __a);
+
+ public:
+
+ /**
+ * @brief Copy substring into C string.
+ * @param s C string to copy value into.
+ * @param n Number of characters to copy.
+ * @param pos Index of first character to copy.
+ * @return Number of characters actually copied
+ * @throw std::out_of_range If pos > size().
+ *
+ * Copies up to @a n characters starting at @a pos into the C string @a
+ * s. If @a pos is greater than size(), out_of_range is thrown.
+ */
+ size_type
+ copy(_CharT* __s, size_type __n, size_type __pos = 0) const;
+
+ /**
+ * @brief Swap contents with another string.
+ * @param s String to swap with.
+ *
+ * Exchanges the contents of this string with that of @a s in constant
+ * time.
+ */
+ void
+ swap(basic_string& __s);
+
+ // String operations:
+ /**
+ * @brief Return const pointer to null-terminated contents.
+ *
+ * This is a handle to internal data. Do not modify or dire things may
+ * happen.
+ */
+ const _CharT*
+ c_str() const
+ { return _M_data(); }
+
+ /**
+ * @brief Return const pointer to contents.
+ *
+ * This is a handle to internal data. Do not modify or dire things may
+ * happen.
+ */
+ const _CharT*
+ data() const
+ { return _M_data(); }
+
+ /**
+ * @brief Return copy of allocator used to construct this string.
+ */
+ allocator_type
+ get_allocator() const
+ { return _M_dataplus; }
+
+ /**
+ * @brief Find position of a C substring.
+ * @param s C string to locate.
+ * @param pos Index of character to search from.
+ * @param n Number of characters from @a s to search for.
+ * @return Index of start of first occurrence.
+ *
+ * Starting from @a pos, searches forward for the first @a n characters
+ * in @a s within this string. If found, returns the index where it
+ * begins. If not found, returns npos.
+ */
+ size_type
+ find(const _CharT* __s, size_type __pos, size_type __n) const;
+
+ /**
+ * @brief Find position of a string.
+ * @param str String to locate.
+ * @param pos Index of character to search from (default 0).
+ * @return Index of start of first occurrence.
+ *
+ * Starting from @a pos, searches forward for value of @a str within
+ * this string. If found, returns the index where it begins. If not
+ * found, returns npos.
+ */
+ size_type
+ find(const basic_string& __str, size_type __pos = 0) const
+ { return this->find(__str.data(), __pos, __str.size()); }
+
+ /**
+ * @brief Find position of a C string.
+ * @param s C string to locate.
+ * @param pos Index of character to search from (default 0).
+ * @return Index of start of first occurrence.
+ *
+ * Starting from @a pos, searches forward for the value of @a s within
+ * this string. If found, returns the index where it begins. If not
+ * found, returns npos.
+ */
+ size_type
+ find(const _CharT* __s, size_type __pos = 0) const
+ {
+ __glibcxx_requires_string(__s);
+ return this->find(__s, __pos, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Find position of a character.
+ * @param c Character to locate.
+ * @param pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a pos, searches forward for @a c within this string.
+ * If found, returns the index where it was found. If not found,
+ * returns npos.
+ */
+ size_type
+ find(_CharT __c, size_type __pos = 0) const;
+
+ /**
+ * @brief Find last position of a string.
+ * @param str String to locate.
+ * @param pos Index of character to search back from (default end).
+ * @return Index of start of last occurrence.
+ *
+ * Starting from @a pos, searches backward for value of @a str within
+ * this string. If found, returns the index where it begins. If not
+ * found, returns npos.
+ */
+ size_type
+ rfind(const basic_string& __str, size_type __pos = npos) const
+ { return this->rfind(__str.data(), __pos, __str.size()); }
+
+ /**
+ * @brief Find last position of a C substring.
+ * @param s C string to locate.
+ * @param pos Index of character to search back from.
+ * @param n Number of characters from s to search for.
+ * @return Index of start of last occurrence.
+ *
+ * Starting from @a pos, searches backward for the first @a n
+ * characters in @a s within this string. If found, returns the index
+ * where it begins. If not found, returns npos.
+ */
+ size_type
+ rfind(const _CharT* __s, size_type __pos, size_type __n) const;
+
+ /**
+ * @brief Find last position of a C string.
+ * @param s C string to locate.
+ * @param pos Index of character to start search at (default end).
+ * @return Index of start of last occurrence.
+ *
+ * Starting from @a pos, searches backward for the value of @a s within
+ * this string. If found, returns the index where it begins. If not
+ * found, returns npos.
+ */
+ size_type
+ rfind(const _CharT* __s, size_type __pos = npos) const
+ {
+ __glibcxx_requires_string(__s);
+ return this->rfind(__s, __pos, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Find last position of a character.
+ * @param c Character to locate.
+ * @param pos Index of character to search back from (default end).
+ * @return Index of last occurrence.
+ *
+ * Starting from @a pos, searches backward for @a c within this string.
+ * If found, returns the index where it was found. If not found,
+ * returns npos.
+ */
+ size_type
+ rfind(_CharT __c, size_type __pos = npos) const;
+
+ /**
+ * @brief Find position of a character of string.
+ * @param str String containing characters to locate.
+ * @param pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a pos, searches forward for one of the characters of
+ * @a str within this string. If found, returns the index where it was
+ * found. If not found, returns npos.
+ */
+ size_type
+ find_first_of(const basic_string& __str, size_type __pos = 0) const
+ { return this->find_first_of(__str.data(), __pos, __str.size()); }
+
+ /**
+ * @brief Find position of a character of C substring.
+ * @param s String containing characters to locate.
+ * @param pos Index of character to search from.
+ * @param n Number of characters from s to search for.
+ * @return Index of first occurrence.
+ *
+ * Starting from @a pos, searches forward for one of the first @a n
+ * characters of @a s within this string. If found, returns the index
+ * where it was found. If not found, returns npos.
+ */
+ size_type
+ find_first_of(const _CharT* __s, size_type __pos, size_type __n) const;
+
+ /**
+ * @brief Find position of a character of C string.
+ * @param s String containing characters to locate.
+ * @param pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a pos, searches forward for one of the characters of
+ * @a s within this string. If found, returns the index where it was
+ * found. If not found, returns npos.
+ */
+ size_type
+ find_first_of(const _CharT* __s, size_type __pos = 0) const
+ {
+ __glibcxx_requires_string(__s);
+ return this->find_first_of(__s, __pos, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Find position of a character.
+ * @param c Character to locate.
+ * @param pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a pos, searches forward for the character @a c within
+ * this string. If found, returns the index where it was found. If
+ * not found, returns npos.
+ *
+ * Note: equivalent to find(c, pos).
+ */
+ size_type
+ find_first_of(_CharT __c, size_type __pos = 0) const
+ { return this->find(__c, __pos); }
+
+ /**
+ * @brief Find last position of a character of string.
+ * @param str String containing characters to locate.
+ * @param pos Index of character to search back from (default end).
+ * @return Index of last occurrence.
+ *
+ * Starting from @a pos, searches backward for one of the characters of
+ * @a str within this string. If found, returns the index where it was
+ * found. If not found, returns npos.
+ */
+ size_type
+ find_last_of(const basic_string& __str, size_type __pos = npos) const
+ { return this->find_last_of(__str.data(), __pos, __str.size()); }
+
+ /**
+ * @brief Find last position of a character of C substring.
+ * @param s C string containing characters to locate.
+ * @param pos Index of character to search back from.
+ * @param n Number of characters from s to search for.
+ * @return Index of last occurrence.
+ *
+ * Starting from @a pos, searches backward for one of the first @a n
+ * characters of @a s within this string. If found, returns the index
+ * where it was found. If not found, returns npos.
+ */
+ size_type
+ find_last_of(const _CharT* __s, size_type __pos, size_type __n) const;
+
+ /**
+ * @brief Find last position of a character of C string.
+ * @param s C string containing characters to locate.
+ * @param pos Index of character to search back from (default end).
+ * @return Index of last occurrence.
+ *
+ * Starting from @a pos, searches backward for one of the characters of
+ * @a s within this string. If found, returns the index where it was
+ * found. If not found, returns npos.
+ */
+ size_type
+ find_last_of(const _CharT* __s, size_type __pos = npos) const
+ {
+ __glibcxx_requires_string(__s);
+ return this->find_last_of(__s, __pos, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Find last position of a character.
+ * @param c Character to locate.
+ * @param pos Index of character to search back from (default end).
+ * @return Index of last occurrence.
+ *
+ * Starting from @a pos, searches backward for @a c within this string.
+ * If found, returns the index where it was found. If not found,
+ * returns npos.
+ *
+ * Note: equivalent to rfind(c, pos).
+ */
+ size_type
+ find_last_of(_CharT __c, size_type __pos = npos) const
+ { return this->rfind(__c, __pos); }
+
+ /**
+ * @brief Find position of a character not in string.
+ * @param str String containing characters to avoid.
+ * @param pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a pos, searches forward for a character not contained
+ * in @a str within this string. If found, returns the index where it
+ * was found. If not found, returns npos.
+ */
+ size_type
+ find_first_not_of(const basic_string& __str, size_type __pos = 0) const
+ { return this->find_first_not_of(__str.data(), __pos, __str.size()); }
+
+ /**
+ * @brief Find position of a character not in C substring.
+ * @param s C string containing characters to avoid.
+ * @param pos Index of character to search from.
+ * @param n Number of characters from s to consider.
+ * @return Index of first occurrence.
+ *
+ * Starting from @a pos, searches forward for a character not contained
+ * in the first @a n characters of @a s within this string. If found,
+ * returns the index where it was found. If not found, returns npos.
+ */
+ size_type
+ find_first_not_of(const _CharT* __s, size_type __pos,
+ size_type __n) const;
+
+ /**
+ * @brief Find position of a character not in C string.
+ * @param s C string containing characters to avoid.
+ * @param pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a pos, searches forward for a character not contained
+ * in @a s within this string. If found, returns the index where it
+ * was found. If not found, returns npos.
+ */
+ size_type
+ find_first_not_of(const _CharT* __s, size_type __pos = 0) const
+ {
+ __glibcxx_requires_string(__s);
+ return this->find_first_not_of(__s, __pos, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Find position of a different character.
+ * @param c Character to avoid.
+ * @param pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a pos, searches forward for a character other than @a c
+ * within this string. If found, returns the index where it was found.
+ * If not found, returns npos.
+ */
+ size_type
+ find_first_not_of(_CharT __c, size_type __pos = 0) const;
+
+ /**
+ * @brief Find last position of a character not in string.
+ * @param str String containing characters to avoid.
+ * @param pos Index of character to search back from (default end).
+ * @return Index of last occurrence.
+ *
+ * Starting from @a pos, searches backward for a character not
+ * contained in @a str within this string. If found, returns the index
+ * where it was found. If not found, returns npos.
+ */
+ size_type
+ find_last_not_of(const basic_string& __str, size_type __pos = npos) const
+ { return this->find_last_not_of(__str.data(), __pos, __str.size()); }
+
+ /**
+ * @brief Find last position of a character not in C substring.
+ * @param s C string containing characters to avoid.
+ * @param pos Index of character to search back from.
+ * @param n Number of characters from s to consider.
+ * @return Index of last occurrence.
+ *
+ * Starting from @a pos, searches backward for a character not
+ * contained in the first @a n characters of @a s within this string.
+ * If found, returns the index where it was found. If not found,
+ * returns npos.
+ */
+ size_type
+ find_last_not_of(const _CharT* __s, size_type __pos,
+ size_type __n) const;
+ /**
+ * @brief Find last position of a character not in C string.
+ * @param s C string containing characters to avoid.
+ * @param pos Index of character to search back from (default end).
+ * @return Index of last occurrence.
+ *
+ * Starting from @a pos, searches backward for a character not
+ * contained in @a s within this string. If found, returns the index
+ * where it was found. If not found, returns npos.
+ */
+ size_type
+ find_last_not_of(const _CharT* __s, size_type __pos = npos) const
+ {
+ __glibcxx_requires_string(__s);
+ return this->find_last_not_of(__s, __pos, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Find last position of a different character.
+ * @param c Character to avoid.
+ * @param pos Index of character to search back from (default end).
+ * @return Index of last occurrence.
+ *
+ * Starting from @a pos, searches backward for a character other than
+ * @a c within this string. If found, returns the index where it was
+ * found. If not found, returns npos.
+ */
+ size_type
+ find_last_not_of(_CharT __c, size_type __pos = npos) const;
+
+ /**
+ * @brief Get a substring.
+ * @param pos Index of first character (default 0).
+ * @param n Number of characters in substring (default remainder).
+ * @return The new string.
+ * @throw std::out_of_range If pos > size().
+ *
+ * Construct and return a new string using the @a n characters starting
+ * at @a pos. If the string is too short, use the remainder of the
+ * characters. If @a pos is beyond the end of the string, out_of_range
+ * is thrown.
+ */
+ basic_string
+ substr(size_type __pos = 0, size_type __n = npos) const
+ { return basic_string(*this,
+ _M_check(__pos, "basic_string::substr"), __n); }
+
+ /**
+ * @brief Compare to a string.
+ * @param str String to compare against.
+ * @return Integer < 0, 0, or > 0.
+ *
+ * Returns an integer < 0 if this string is ordered before @a str, 0 if
+ * their values are equivalent, or > 0 if this string is ordered after
+ * @a str. Determines the effective length rlen of the strings to
+ * compare as the smallest of size() and str.size(). The function
+ * then compares the two strings by calling traits::compare(data(),
+ * str.data(),rlen). If the result of the comparison is nonzero returns
+ * it, otherwise the shorter one is ordered first.
+ */
+ int
+ compare(const basic_string& __str) const
+ {
+ const size_type __size = this->size();
+ const size_type __osize = __str.size();
+ const size_type __len = std::min(__size, __osize);
+
+ int __r = traits_type::compare(_M_data(), __str.data(), __len);
+ if (!__r)
+ __r = _S_compare(__size, __osize);
+ return __r;
+ }
+
+ /**
+ * @brief Compare substring to a string.
+ * @param pos Index of first character of substring.
+ * @param n Number of characters in substring.
+ * @param str String to compare against.
+ * @return Integer < 0, 0, or > 0.
+ *
+ * Form the substring of this string from the @a n characters starting
+ * at @a pos. Returns an integer < 0 if the substring is ordered
+ * before @a str, 0 if their values are equivalent, or > 0 if the
+ * substring is ordered after @a str. Determines the effective length
+ * rlen of the strings to compare as the smallest of the length of the
+ * substring and @a str.size(). The function then compares the two
+ * strings by calling traits::compare(substring.data(),str.data(),rlen).
+ * If the result of the comparison is nonzero returns it, otherwise the
+ * shorter one is ordered first.
+ */
+ int
+ compare(size_type __pos, size_type __n, const basic_string& __str) const;
+
+ /**
+ * @brief Compare substring to a substring.
+ * @param pos1 Index of first character of substring.
+ * @param n1 Number of characters in substring.
+ * @param str String to compare against.
+ * @param pos2 Index of first character of substring of str.
+ * @param n2 Number of characters in substring of str.
+ * @return Integer < 0, 0, or > 0.
+ *
+ * Form the substring of this string from the @a n1 characters starting
+ * at @a pos1. Form the substring of @a str from the @a n2 characters
+ * starting at @a pos2. Returns an integer < 0 if this substring is
+ * ordered before the substring of @a str, 0 if their values are
+ * equivalent, or > 0 if this substring is ordered after the substring
+ * of @a str. Determines the effective length rlen of the strings
+ * to compare as the smallest of the lengths of the substrings. The
+ * function then compares the two strings by calling
+ * traits::compare(substring.data(),str.substr(pos2,n2).data(),rlen).
+ * If the result of the comparison is nonzero returns it, otherwise the
+ * shorter one is ordered first.
+ */
+ int
+ compare(size_type __pos1, size_type __n1, const basic_string& __str,
+ size_type __pos2, size_type __n2) const;
+
+ /**
+ * @brief Compare to a C string.
+ * @param s C string to compare against.
+ * @return Integer < 0, 0, or > 0.
+ *
+ * Returns an integer < 0 if this string is ordered before @a s, 0 if
+ * their values are equivalent, or > 0 if this string is ordered after
+ * @a s. Determines the effective length rlen of the strings to
+ * compare as the smallest of size() and the length of a string
+ * constructed from @a s. The function then compares the two strings
+ * by calling traits::compare(data(),s,rlen). If the result of the
+ * comparison is nonzero returns it, otherwise the shorter one is
+ * ordered first.
+ */
+ int
+ compare(const _CharT* __s) const;
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 5 String::compare specification questionable
+ /**
+ * @brief Compare substring to a C string.
+ * @param pos Index of first character of substring.
+ * @param n1 Number of characters in substring.
+ * @param s C string to compare against.
+ * @return Integer < 0, 0, or > 0.
+ *
+ * Form the substring of this string from the @a n1 characters starting
+ * at @a pos. Returns an integer < 0 if the substring is ordered
+ * before @a s, 0 if their values are equivalent, or > 0 if the
+ * substring is ordered after @a s. Determines the effective length
+ * rlen of the strings to compare as the smallest of the length of the
+ * substring and the length of a string constructed from @a s. The
+ * function then compares the two string by calling
+ * traits::compare(substring.data(),s,rlen). If the result of the
+ * comparison is nonzero returns it, otherwise the shorter one is
+ * ordered first.
+ */
+ int
+ compare(size_type __pos, size_type __n1, const _CharT* __s) const;
+
+ /**
+ * @brief Compare substring against a character array.
+ * @param pos1 Index of first character of substring.
+ * @param n1 Number of characters in substring.
+ * @param s character array to compare against.
+ * @param n2 Number of characters of s.
+ * @return Integer < 0, 0, or > 0.
+ *
+ * Form the substring of this string from the @a n1 characters starting
+ * at @a pos1. Form a string from the first @a n2 characters of @a s.
+ * Returns an integer < 0 if this substring is ordered before the string
+ * from @a s, 0 if their values are equivalent, or > 0 if this substring
+ * is ordered after the string from @a s. Determines the effective
+ * length rlen of the strings to compare as the smallest of the length
+ * of the substring and @a n2. The function then compares the two
+ * strings by calling traits::compare(substring.data(),s,rlen). If the
+ * result of the comparison is nonzero returns it, otherwise the shorter
+ * one is ordered first.
+ *
+ * NB: s must have at least n2 characters, '\\0' has no special
+ * meaning.
+ */
+ int
+ compare(size_type __pos, size_type __n1, const _CharT* __s,
+ size_type __n2) const;
+ };
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline basic_string<_CharT, _Traits, _Alloc>::
+ basic_string()
+#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
+ : _M_dataplus(_S_empty_rep()._M_refdata(), _Alloc()) { }
+#else
+ : _M_dataplus(_S_construct(size_type(), _CharT(), _Alloc()), _Alloc()) { }
+#endif
+
+ // operator+
+ /**
+ * @brief Concatenate two strings.
+ * @param lhs First string.
+ * @param rhs Last string.
+ * @return New string with value of @a lhs followed by @a rhs.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>
+ operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ {
+ basic_string<_CharT, _Traits, _Alloc> __str(__lhs);
+ __str.append(__rhs);
+ return __str;
+ }
+
+ /**
+ * @brief Concatenate C string and string.
+ * @param lhs First string.
+ * @param rhs Last string.
+ * @return New string with value of @a lhs followed by @a rhs.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT,_Traits,_Alloc>
+ operator+(const _CharT* __lhs,
+ const basic_string<_CharT,_Traits,_Alloc>& __rhs);
+
+ /**
+ * @brief Concatenate character and string.
+ * @param lhs First string.
+ * @param rhs Last string.
+ * @return New string with @a lhs followed by @a rhs.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT,_Traits,_Alloc>
+ operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs);
+
+ /**
+ * @brief Concatenate string and C string.
+ * @param lhs First string.
+ * @param rhs Last string.
+ * @return New string with @a lhs followed by @a rhs.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline basic_string<_CharT, _Traits, _Alloc>
+ operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const _CharT* __rhs)
+ {
+ basic_string<_CharT, _Traits, _Alloc> __str(__lhs);
+ __str.append(__rhs);
+ return __str;
+ }
+
+ /**
+ * @brief Concatenate string and character.
+ * @param lhs First string.
+ * @param rhs Last string.
+ * @return New string with @a lhs followed by @a rhs.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline basic_string<_CharT, _Traits, _Alloc>
+ operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs)
+ {
+ typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
+ typedef typename __string_type::size_type __size_type;
+ __string_type __str(__lhs);
+ __str.append(__size_type(1), __rhs);
+ return __str;
+ }
+
+ // operator ==
+ /**
+ * @brief Test equivalence of two strings.
+ * @param lhs First string.
+ * @param rhs Second string.
+ * @return True if @a lhs.compare(@a rhs) == 0. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { return __lhs.compare(__rhs) == 0; }
+
+ template<typename _CharT>
+ inline
+ typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value, bool>::__type
+ operator==(const basic_string<_CharT>& __lhs,
+ const basic_string<_CharT>& __rhs)
+ { return (__lhs.size() == __rhs.size()
+ && !std::char_traits<_CharT>::compare(__lhs.data(), __rhs.data(),
+ __lhs.size())); }
+
+ /**
+ * @brief Test equivalence of C string and string.
+ * @param lhs C string.
+ * @param rhs String.
+ * @return True if @a rhs.compare(@a lhs) == 0. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator==(const _CharT* __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { return __rhs.compare(__lhs) == 0; }
+
+ /**
+ * @brief Test equivalence of string and C string.
+ * @param lhs String.
+ * @param rhs C string.
+ * @return True if @a lhs.compare(@a rhs) == 0. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const _CharT* __rhs)
+ { return __lhs.compare(__rhs) == 0; }
+
+ // operator !=
+ /**
+ * @brief Test difference of two strings.
+ * @param lhs First string.
+ * @param rhs Second string.
+ * @return True if @a lhs.compare(@a rhs) != 0. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { return !(__lhs == __rhs); }
+
+ /**
+ * @brief Test difference of C string and string.
+ * @param lhs C string.
+ * @param rhs String.
+ * @return True if @a rhs.compare(@a lhs) != 0. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator!=(const _CharT* __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { return !(__lhs == __rhs); }
+
+ /**
+ * @brief Test difference of string and C string.
+ * @param lhs String.
+ * @param rhs C string.
+ * @return True if @a lhs.compare(@a rhs) != 0. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const _CharT* __rhs)
+ { return !(__lhs == __rhs); }
+
+ // operator <
+ /**
+ * @brief Test if string precedes string.
+ * @param lhs First string.
+ * @param rhs Second string.
+ * @return True if @a lhs precedes @a rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { return __lhs.compare(__rhs) < 0; }
+
+ /**
+ * @brief Test if string precedes C string.
+ * @param lhs String.
+ * @param rhs C string.
+ * @return True if @a lhs precedes @a rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const _CharT* __rhs)
+ { return __lhs.compare(__rhs) < 0; }
+
+ /**
+ * @brief Test if C string precedes string.
+ * @param lhs C string.
+ * @param rhs String.
+ * @return True if @a lhs precedes @a rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator<(const _CharT* __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { return __rhs.compare(__lhs) > 0; }
+
+ // operator >
+ /**
+ * @brief Test if string follows string.
+ * @param lhs First string.
+ * @param rhs Second string.
+ * @return True if @a lhs follows @a rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { return __lhs.compare(__rhs) > 0; }
+
+ /**
+ * @brief Test if string follows C string.
+ * @param lhs String.
+ * @param rhs C string.
+ * @return True if @a lhs follows @a rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const _CharT* __rhs)
+ { return __lhs.compare(__rhs) > 0; }
+
+ /**
+ * @brief Test if C string follows string.
+ * @param lhs C string.
+ * @param rhs String.
+ * @return True if @a lhs follows @a rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator>(const _CharT* __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { return __rhs.compare(__lhs) < 0; }
+
+ // operator <=
+ /**
+ * @brief Test if string doesn't follow string.
+ * @param lhs First string.
+ * @param rhs Second string.
+ * @return True if @a lhs doesn't follow @a rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { return __lhs.compare(__rhs) <= 0; }
+
+ /**
+ * @brief Test if string doesn't follow C string.
+ * @param lhs String.
+ * @param rhs C string.
+ * @return True if @a lhs doesn't follow @a rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const _CharT* __rhs)
+ { return __lhs.compare(__rhs) <= 0; }
+
+ /**
+ * @brief Test if C string doesn't follow string.
+ * @param lhs C string.
+ * @param rhs String.
+ * @return True if @a lhs doesn't follow @a rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator<=(const _CharT* __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { return __rhs.compare(__lhs) >= 0; }
+
+ // operator >=
+ /**
+ * @brief Test if string doesn't precede string.
+ * @param lhs First string.
+ * @param rhs Second string.
+ * @return True if @a lhs doesn't precede @a rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator>=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { return __lhs.compare(__rhs) >= 0; }
+
+ /**
+ * @brief Test if string doesn't precede C string.
+ * @param lhs String.
+ * @param rhs C string.
+ * @return True if @a lhs doesn't precede @a rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator>=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const _CharT* __rhs)
+ { return __lhs.compare(__rhs) >= 0; }
+
+ /**
+ * @brief Test if C string doesn't precede string.
+ * @param lhs C string.
+ * @param rhs String.
+ * @return True if @a lhs doesn't precede @a rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator>=(const _CharT* __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { return __rhs.compare(__lhs) <= 0; }
+
+ /**
+ * @brief Swap contents of two strings.
+ * @param lhs First string.
+ * @param rhs Second string.
+ *
+ * Exchanges the contents of @a lhs and @a rhs in constant time.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline void
+ swap(basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { __lhs.swap(__rhs); }
+
+ /**
+ * @brief Read stream into a string.
+ * @param is Input stream.
+ * @param str Buffer to store into.
+ * @return Reference to the input stream.
+ *
+ * Stores characters from @a is into @a str until whitespace is found, the
+ * end of the stream is encountered, or str.max_size() is reached. If
+ * is.width() is non-zero, that is the limit on the number of characters
+ * stored into @a str. Any previous contents of @a str are erased.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __is,
+ basic_string<_CharT, _Traits, _Alloc>& __str);
+
+ template<>
+ basic_istream<char>&
+ operator>>(basic_istream<char>& __is, basic_string<char>& __str);
+
+ /**
+ * @brief Write string to a stream.
+ * @param os Output stream.
+ * @param str String to write out.
+ * @return Reference to the output stream.
+ *
+ * Output characters of @a str into os following the same rules as for
+ * writing a C string.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __os,
+ const basic_string<_CharT, _Traits, _Alloc>& __str)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 586. string inserter not a formatted function
+ return __ostream_insert(__os, __str.data(), __str.size());
+ }
+
+ /**
+ * @brief Read a line from stream into a string.
+ * @param is Input stream.
+ * @param str Buffer to store into.
+ * @param delim Character marking end of line.
+ * @return Reference to the input stream.
+ *
+ * Stores characters from @a is into @a str until @a delim is found, the
+ * end of the stream is encountered, or str.max_size() is reached. If
+ * is.width() is non-zero, that is the limit on the number of characters
+ * stored into @a str. Any previous contents of @a str are erased. If @a
+ * delim was encountered, it is extracted but not stored into @a str.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_istream<_CharT, _Traits>&
+ getline(basic_istream<_CharT, _Traits>& __is,
+ basic_string<_CharT, _Traits, _Alloc>& __str, _CharT __delim);
+
+ /**
+ * @brief Read a line from stream into a string.
+ * @param is Input stream.
+ * @param str Buffer to store into.
+ * @return Reference to the input stream.
+ *
+ * Stores characters from is into @a str until '\n' is found, the end of
+ * the stream is encountered, or str.max_size() is reached. If is.width()
+ * is non-zero, that is the limit on the number of characters stored into
+ * @a str. Any previous contents of @a str are erased. If end of line was
+ * encountered, it is extracted but not stored into @a str.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline basic_istream<_CharT, _Traits>&
+ getline(basic_istream<_CharT, _Traits>& __is,
+ basic_string<_CharT, _Traits, _Alloc>& __str)
+ { return getline(__is, __str, __is.widen('\n')); }
+
+ template<>
+ basic_istream<char>&
+ getline(basic_istream<char>& __in, basic_string<char>& __str,
+ char __delim);
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template<>
+ basic_istream<wchar_t>&
+ getline(basic_istream<wchar_t>& __in, basic_string<wchar_t>& __str,
+ wchar_t __delim);
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#if (defined(__GXX_EXPERIMENTAL_CXX0X__) && defined(_GLIBCXX_USE_C99) \
+ && !defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF))
+
+#include <ext/string_conversions.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // 21.4 Numeric Conversions [string.conversions].
+ inline int
+ stoi(const string& __str, size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa<long, int>(&std::strtol, "stoi", __str.c_str(),
+ __idx, __base); }
+
+ inline long
+ stol(const string& __str, size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa(&std::strtol, "stol", __str.c_str(),
+ __idx, __base); }
+
+ inline unsigned long
+ stoul(const string& __str, size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa(&std::strtoul, "stoul", __str.c_str(),
+ __idx, __base); }
+
+ inline long long
+ stoll(const string& __str, size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa(&std::strtoll, "stoll", __str.c_str(),
+ __idx, __base); }
+
+ inline unsigned long long
+ stoull(const string& __str, size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa(&std::strtoull, "stoull", __str.c_str(),
+ __idx, __base); }
+
+ // NB: strtof vs strtod.
+ inline float
+ stof(const string& __str, size_t* __idx = 0)
+ { return __gnu_cxx::__stoa(&std::strtof, "stof", __str.c_str(), __idx); }
+
+ inline double
+ stod(const string& __str, size_t* __idx = 0)
+ { return __gnu_cxx::__stoa(&std::strtod, "stod", __str.c_str(), __idx); }
+
+ inline long double
+ stold(const string& __str, size_t* __idx = 0)
+ { return __gnu_cxx::__stoa(&std::strtold, "stold", __str.c_str(), __idx); }
+
+ // NB: (v)snprintf vs sprintf.
+ inline string
+ to_string(long long __val)
+ { return __gnu_cxx::__to_xstring<string>(&std::vsnprintf,
+ 4 * sizeof(long long),
+ "%lld", __val); }
+
+ inline string
+ to_string(unsigned long long __val)
+ { return __gnu_cxx::__to_xstring<string>(&std::vsnprintf,
+ 4 * sizeof(unsigned long long),
+ "%llu", __val); }
+
+ inline string
+ to_string(long double __val)
+ {
+ const int __n =
+ __gnu_cxx::__numeric_traits<long double>::__max_exponent10 + 20;
+ return __gnu_cxx::__to_xstring<string>(&std::vsnprintf, __n,
+ "%Lf", __val);
+ }
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ inline int
+ stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa<long, int>(&std::wcstol, "stoi", __str.c_str(),
+ __idx, __base); }
+
+ inline long
+ stol(const wstring& __str, size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa(&std::wcstol, "stol", __str.c_str(),
+ __idx, __base); }
+
+ inline unsigned long
+ stoul(const wstring& __str, size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa(&std::wcstoul, "stoul", __str.c_str(),
+ __idx, __base); }
+
+ inline long long
+ stoll(const wstring& __str, size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa(&std::wcstoll, "stoll", __str.c_str(),
+ __idx, __base); }
+
+ inline unsigned long long
+ stoull(const wstring& __str, size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa(&std::wcstoull, "stoull", __str.c_str(),
+ __idx, __base); }
+
+ // NB: wcstof vs wcstod.
+ inline float
+ stof(const wstring& __str, size_t* __idx = 0)
+ { return __gnu_cxx::__stoa(&std::wcstof, "stof", __str.c_str(), __idx); }
+
+ inline double
+ stod(const wstring& __str, size_t* __idx = 0)
+ { return __gnu_cxx::__stoa(&std::wcstod, "stod", __str.c_str(), __idx); }
+
+ inline long double
+ stold(const wstring& __str, size_t* __idx = 0)
+ { return __gnu_cxx::__stoa(&std::wcstold, "stold", __str.c_str(), __idx); }
+
+ inline wstring
+ to_wstring(long long __val)
+ { return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf,
+ 4 * sizeof(long long),
+ L"%lld", __val); }
+
+ inline wstring
+ to_wstring(unsigned long long __val)
+ { return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf,
+ 4 * sizeof(unsigned long long),
+ L"%llu", __val); }
+
+ inline wstring
+ to_wstring(long double __val)
+ {
+ const int __n =
+ __gnu_cxx::__numeric_traits<long double>::__max_exponent10 + 20;
+ return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf, __n,
+ L"%Lf", __val);
+ }
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
+
+#endif /* _BASIC_STRING_H */
diff --git a/i686-linux/include/c++/4.4.3/bits/basic_string.tcc b/i686-linux/include/c++/4.4.3/bits/basic_string.tcc
new file mode 100644
index 0000000..a5553c6
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/basic_string.tcc
@@ -0,0 +1,1144 @@
+// Components for manipulating sequences of characters -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file basic_string.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 21 Strings library
+//
+
+// Written by Jason Merrill based upon the specification by Takanori Adachi
+// in ANSI X3J16/94-0013R2. Rewritten by Nathan Myers to ISO-14882.
+
+#ifndef _BASIC_STRING_TCC
+#define _BASIC_STRING_TCC 1
+
+#pragma GCC system_header
+
+#include <cxxabi-forced.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ const typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::
+ _Rep::_S_max_size = (((npos - sizeof(_Rep_base))/sizeof(_CharT)) - 1) / 4;
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ const _CharT
+ basic_string<_CharT, _Traits, _Alloc>::
+ _Rep::_S_terminal = _CharT();
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ const typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::npos;
+
+ // Linker sets _S_empty_rep_storage to all 0s (one reference, empty string)
+ // at static init time (before static ctors are run).
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_empty_rep_storage[
+ (sizeof(_Rep_base) + sizeof(_CharT) + sizeof(size_type) - 1) /
+ sizeof(size_type)];
+
+ // NB: This is the special case for Input Iterators, used in
+ // istreambuf_iterators, etc.
+ // Input Iterators have a cost structure very different from
+ // pointers, calling for a different coding style.
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ template<typename _InIterator>
+ _CharT*
+ basic_string<_CharT, _Traits, _Alloc>::
+ _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a,
+ input_iterator_tag)
+ {
+#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
+ if (__beg == __end && __a == _Alloc())
+ return _S_empty_rep()._M_refdata();
+#endif
+ // Avoid reallocation for common case.
+ _CharT __buf[128];
+ size_type __len = 0;
+ while (__beg != __end && __len < sizeof(__buf) / sizeof(_CharT))
+ {
+ __buf[__len++] = *__beg;
+ ++__beg;
+ }
+ _Rep* __r = _Rep::_S_create(__len, size_type(0), __a);
+ _M_copy(__r->_M_refdata(), __buf, __len);
+ __try
+ {
+ while (__beg != __end)
+ {
+ if (__len == __r->_M_capacity)
+ {
+ // Allocate more space.
+ _Rep* __another = _Rep::_S_create(__len + 1, __len, __a);
+ _M_copy(__another->_M_refdata(), __r->_M_refdata(), __len);
+ __r->_M_destroy(__a);
+ __r = __another;
+ }
+ __r->_M_refdata()[__len++] = *__beg;
+ ++__beg;
+ }
+ }
+ __catch(...)
+ {
+ __r->_M_destroy(__a);
+ __throw_exception_again;
+ }
+ __r->_M_set_length_and_sharable(__len);
+ return __r->_M_refdata();
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ template <typename _InIterator>
+ _CharT*
+ basic_string<_CharT, _Traits, _Alloc>::
+ _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a,
+ forward_iterator_tag)
+ {
+#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
+ if (__beg == __end && __a == _Alloc())
+ return _S_empty_rep()._M_refdata();
+#endif
+ // NB: Not required, but considered best practice.
+ if (__builtin_expect(__gnu_cxx::__is_null_pointer(__beg)
+ && __beg != __end, 0))
+ __throw_logic_error(__N("basic_string::_S_construct NULL not valid"));
+
+ const size_type __dnew = static_cast<size_type>(std::distance(__beg,
+ __end));
+ // Check for out_of_range and length_error exceptions.
+ _Rep* __r = _Rep::_S_create(__dnew, size_type(0), __a);
+ __try
+ { _S_copy_chars(__r->_M_refdata(), __beg, __end); }
+ __catch(...)
+ {
+ __r->_M_destroy(__a);
+ __throw_exception_again;
+ }
+ __r->_M_set_length_and_sharable(__dnew);
+ return __r->_M_refdata();
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ _CharT*
+ basic_string<_CharT, _Traits, _Alloc>::
+ _S_construct(size_type __n, _CharT __c, const _Alloc& __a)
+ {
+#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
+ if (__n == 0 && __a == _Alloc())
+ return _S_empty_rep()._M_refdata();
+#endif
+ // Check for out_of_range and length_error exceptions.
+ _Rep* __r = _Rep::_S_create(__n, size_type(0), __a);
+ if (__n)
+ _M_assign(__r->_M_refdata(), __n, __c);
+
+ __r->_M_set_length_and_sharable(__n);
+ return __r->_M_refdata();
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>::
+ basic_string(const basic_string& __str)
+ : _M_dataplus(__str._M_rep()->_M_grab(_Alloc(__str.get_allocator()),
+ __str.get_allocator()),
+ __str.get_allocator())
+ { }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>::
+ basic_string(const _Alloc& __a)
+ : _M_dataplus(_S_construct(size_type(), _CharT(), __a), __a)
+ { }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>::
+ basic_string(const basic_string& __str, size_type __pos, size_type __n)
+ : _M_dataplus(_S_construct(__str._M_data()
+ + __str._M_check(__pos,
+ "basic_string::basic_string"),
+ __str._M_data() + __str._M_limit(__pos, __n)
+ + __pos, _Alloc()), _Alloc())
+ { }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>::
+ basic_string(const basic_string& __str, size_type __pos,
+ size_type __n, const _Alloc& __a)
+ : _M_dataplus(_S_construct(__str._M_data()
+ + __str._M_check(__pos,
+ "basic_string::basic_string"),
+ __str._M_data() + __str._M_limit(__pos, __n)
+ + __pos, __a), __a)
+ { }
+
+ // TBD: DPG annotate
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>::
+ basic_string(const _CharT* __s, size_type __n, const _Alloc& __a)
+ : _M_dataplus(_S_construct(__s, __s + __n, __a), __a)
+ { }
+
+ // TBD: DPG annotate
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>::
+ basic_string(const _CharT* __s, const _Alloc& __a)
+ : _M_dataplus(_S_construct(__s, __s ? __s + traits_type::length(__s) :
+ __s + npos, __a), __a)
+ { }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>::
+ basic_string(size_type __n, _CharT __c, const _Alloc& __a)
+ : _M_dataplus(_S_construct(__n, __c, __a), __a)
+ { }
+
+ // TBD: DPG annotate
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ template<typename _InputIterator>
+ basic_string<_CharT, _Traits, _Alloc>::
+ basic_string(_InputIterator __beg, _InputIterator __end, const _Alloc& __a)
+ : _M_dataplus(_S_construct(__beg, __end, __a), __a)
+ { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>::
+ basic_string(initializer_list<_CharT> __l, const _Alloc& __a)
+ : _M_dataplus(_S_construct(__l.begin(), __l.end(), __a), __a)
+ { }
+#endif
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>&
+ basic_string<_CharT, _Traits, _Alloc>::
+ assign(const basic_string& __str)
+ {
+ if (_M_rep() != __str._M_rep())
+ {
+ // XXX MT
+ const allocator_type __a = this->get_allocator();
+ _CharT* __tmp = __str._M_rep()->_M_grab(__a, __str.get_allocator());
+ _M_rep()->_M_dispose(__a);
+ _M_data(__tmp);
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>&
+ basic_string<_CharT, _Traits, _Alloc>::
+ assign(const _CharT* __s, size_type __n)
+ {
+ __glibcxx_requires_string_len(__s, __n);
+ _M_check_length(this->size(), __n, "basic_string::assign");
+ if (_M_disjunct(__s) || _M_rep()->_M_is_shared())
+ return _M_replace_safe(size_type(0), this->size(), __s, __n);
+ else
+ {
+ // Work in-place.
+ const size_type __pos = __s - _M_data();
+ if (__pos >= __n)
+ _M_copy(_M_data(), __s, __n);
+ else if (__pos)
+ _M_move(_M_data(), __s, __n);
+ _M_rep()->_M_set_length_and_sharable(__n);
+ return *this;
+ }
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>&
+ basic_string<_CharT, _Traits, _Alloc>::
+ append(size_type __n, _CharT __c)
+ {
+ if (__n)
+ {
+ _M_check_length(size_type(0), __n, "basic_string::append");
+ const size_type __len = __n + this->size();
+ if (__len > this->capacity() || _M_rep()->_M_is_shared())
+ this->reserve(__len);
+ _M_assign(_M_data() + this->size(), __n, __c);
+ _M_rep()->_M_set_length_and_sharable(__len);
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>&
+ basic_string<_CharT, _Traits, _Alloc>::
+ append(const _CharT* __s, size_type __n)
+ {
+ __glibcxx_requires_string_len(__s, __n);
+ if (__n)
+ {
+ _M_check_length(size_type(0), __n, "basic_string::append");
+ const size_type __len = __n + this->size();
+ if (__len > this->capacity() || _M_rep()->_M_is_shared())
+ {
+ if (_M_disjunct(__s))
+ this->reserve(__len);
+ else
+ {
+ const size_type __off = __s - _M_data();
+ this->reserve(__len);
+ __s = _M_data() + __off;
+ }
+ }
+ _M_copy(_M_data() + this->size(), __s, __n);
+ _M_rep()->_M_set_length_and_sharable(__len);
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>&
+ basic_string<_CharT, _Traits, _Alloc>::
+ append(const basic_string& __str)
+ {
+ const size_type __size = __str.size();
+ if (__size)
+ {
+ const size_type __len = __size + this->size();
+ if (__len > this->capacity() || _M_rep()->_M_is_shared())
+ this->reserve(__len);
+ _M_copy(_M_data() + this->size(), __str._M_data(), __size);
+ _M_rep()->_M_set_length_and_sharable(__len);
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>&
+ basic_string<_CharT, _Traits, _Alloc>::
+ append(const basic_string& __str, size_type __pos, size_type __n)
+ {
+ __str._M_check(__pos, "basic_string::append");
+ __n = __str._M_limit(__pos, __n);
+ if (__n)
+ {
+ const size_type __len = __n + this->size();
+ if (__len > this->capacity() || _M_rep()->_M_is_shared())
+ this->reserve(__len);
+ _M_copy(_M_data() + this->size(), __str._M_data() + __pos, __n);
+ _M_rep()->_M_set_length_and_sharable(__len);
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>&
+ basic_string<_CharT, _Traits, _Alloc>::
+ insert(size_type __pos, const _CharT* __s, size_type __n)
+ {
+ __glibcxx_requires_string_len(__s, __n);
+ _M_check(__pos, "basic_string::insert");
+ _M_check_length(size_type(0), __n, "basic_string::insert");
+ if (_M_disjunct(__s) || _M_rep()->_M_is_shared())
+ return _M_replace_safe(__pos, size_type(0), __s, __n);
+ else
+ {
+ // Work in-place.
+ const size_type __off = __s - _M_data();
+ _M_mutate(__pos, 0, __n);
+ __s = _M_data() + __off;
+ _CharT* __p = _M_data() + __pos;
+ if (__s + __n <= __p)
+ _M_copy(__p, __s, __n);
+ else if (__s >= __p)
+ _M_copy(__p, __s + __n, __n);
+ else
+ {
+ const size_type __nleft = __p - __s;
+ _M_copy(__p, __s, __nleft);
+ _M_copy(__p + __nleft, __p + __n, __n - __nleft);
+ }
+ return *this;
+ }
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>&
+ basic_string<_CharT, _Traits, _Alloc>::
+ replace(size_type __pos, size_type __n1, const _CharT* __s,
+ size_type __n2)
+ {
+ __glibcxx_requires_string_len(__s, __n2);
+ _M_check(__pos, "basic_string::replace");
+ __n1 = _M_limit(__pos, __n1);
+ _M_check_length(__n1, __n2, "basic_string::replace");
+ bool __left;
+ if (_M_disjunct(__s) || _M_rep()->_M_is_shared())
+ return _M_replace_safe(__pos, __n1, __s, __n2);
+ else if ((__left = __s + __n2 <= _M_data() + __pos)
+ || _M_data() + __pos + __n1 <= __s)
+ {
+ // Work in-place: non-overlapping case.
+ size_type __off = __s - _M_data();
+ __left ? __off : (__off += __n2 - __n1);
+ _M_mutate(__pos, __n1, __n2);
+ _M_copy(_M_data() + __pos, _M_data() + __off, __n2);
+ return *this;
+ }
+ else
+ {
+ // Todo: overlapping case.
+ const basic_string __tmp(__s, __n2);
+ return _M_replace_safe(__pos, __n1, __tmp._M_data(), __n2);
+ }
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ basic_string<_CharT, _Traits, _Alloc>::_Rep::
+ _M_destroy(const _Alloc& __a) throw ()
+ {
+ const size_type __size = sizeof(_Rep_base) +
+ (this->_M_capacity + 1) * sizeof(_CharT);
+ _Raw_bytes_alloc(__a).deallocate(reinterpret_cast<char*>(this), __size);
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ basic_string<_CharT, _Traits, _Alloc>::
+ _M_leak_hard()
+ {
+#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
+ if (_M_rep() == &_S_empty_rep())
+ return;
+#endif
+ if (_M_rep()->_M_is_shared())
+ _M_mutate(0, 0, 0);
+ _M_rep()->_M_set_leaked();
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ basic_string<_CharT, _Traits, _Alloc>::
+ _M_mutate(size_type __pos, size_type __len1, size_type __len2)
+ {
+ const size_type __old_size = this->size();
+ const size_type __new_size = __old_size + __len2 - __len1;
+ const size_type __how_much = __old_size - __pos - __len1;
+
+ if (__new_size > this->capacity() || _M_rep()->_M_is_shared())
+ {
+ // Must reallocate.
+ const allocator_type __a = get_allocator();
+ _Rep* __r = _Rep::_S_create(__new_size, this->capacity(), __a);
+
+ if (__pos)
+ _M_copy(__r->_M_refdata(), _M_data(), __pos);
+ if (__how_much)
+ _M_copy(__r->_M_refdata() + __pos + __len2,
+ _M_data() + __pos + __len1, __how_much);
+
+ _M_rep()->_M_dispose(__a);
+ _M_data(__r->_M_refdata());
+ }
+ else if (__how_much && __len1 != __len2)
+ {
+ // Work in-place.
+ _M_move(_M_data() + __pos + __len2,
+ _M_data() + __pos + __len1, __how_much);
+ }
+ _M_rep()->_M_set_length_and_sharable(__new_size);
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ basic_string<_CharT, _Traits, _Alloc>::
+ reserve(size_type __res)
+ {
+ if (__res != this->capacity() || _M_rep()->_M_is_shared())
+ {
+ // Make sure we don't shrink below the current size
+ if (__res < this->size())
+ __res = this->size();
+ const allocator_type __a = get_allocator();
+ _CharT* __tmp = _M_rep()->_M_clone(__a, __res - this->size());
+ _M_rep()->_M_dispose(__a);
+ _M_data(__tmp);
+ }
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ basic_string<_CharT, _Traits, _Alloc>::
+ swap(basic_string& __s)
+ {
+ if (_M_rep()->_M_is_leaked())
+ _M_rep()->_M_set_sharable();
+ if (__s._M_rep()->_M_is_leaked())
+ __s._M_rep()->_M_set_sharable();
+ if (this->get_allocator() == __s.get_allocator())
+ {
+ _CharT* __tmp = _M_data();
+ _M_data(__s._M_data());
+ __s._M_data(__tmp);
+ }
+ // The code below can usually be optimized away.
+ else
+ {
+ const basic_string __tmp1(_M_ibegin(), _M_iend(),
+ __s.get_allocator());
+ const basic_string __tmp2(__s._M_ibegin(), __s._M_iend(),
+ this->get_allocator());
+ *this = __tmp2;
+ __s = __tmp1;
+ }
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::_Rep*
+ basic_string<_CharT, _Traits, _Alloc>::_Rep::
+ _S_create(size_type __capacity, size_type __old_capacity,
+ const _Alloc& __alloc)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 83. String::npos vs. string::max_size()
+ if (__capacity > _S_max_size)
+ __throw_length_error(__N("basic_string::_S_create"));
+
+ // The standard places no restriction on allocating more memory
+ // than is strictly needed within this layer at the moment or as
+ // requested by an explicit application call to reserve().
+
+ // Many malloc implementations perform quite poorly when an
+ // application attempts to allocate memory in a stepwise fashion
+ // growing each allocation size by only 1 char. Additionally,
+ // it makes little sense to allocate less linear memory than the
+ // natural blocking size of the malloc implementation.
+ // Unfortunately, we would need a somewhat low-level calculation
+ // with tuned parameters to get this perfect for any particular
+ // malloc implementation. Fortunately, generalizations about
+ // common features seen among implementations seems to suffice.
+
+ // __pagesize need not match the actual VM page size for good
+ // results in practice, thus we pick a common value on the low
+ // side. __malloc_header_size is an estimate of the amount of
+ // overhead per memory allocation (in practice seen N * sizeof
+ // (void*) where N is 0, 2 or 4). According to folklore,
+ // picking this value on the high side is better than
+ // low-balling it (especially when this algorithm is used with
+ // malloc implementations that allocate memory blocks rounded up
+ // to a size which is a power of 2).
+ const size_type __pagesize = 4096;
+ const size_type __malloc_header_size = 4 * sizeof(void*);
+
+ // The below implements an exponential growth policy, necessary to
+ // meet amortized linear time requirements of the library: see
+ // http://gcc.gnu.org/ml/libstdc++/2001-07/msg00085.html.
+ // It's active for allocations requiring an amount of memory above
+ // system pagesize. This is consistent with the requirements of the
+ // standard: http://gcc.gnu.org/ml/libstdc++/2001-07/msg00130.html
+ if (__capacity > __old_capacity && __capacity < 2 * __old_capacity)
+ __capacity = 2 * __old_capacity;
+
+ // NB: Need an array of char_type[__capacity], plus a terminating
+ // null char_type() element, plus enough for the _Rep data structure.
+ // Whew. Seemingly so needy, yet so elemental.
+ size_type __size = (__capacity + 1) * sizeof(_CharT) + sizeof(_Rep);
+
+ const size_type __adj_size = __size + __malloc_header_size;
+ if (__adj_size > __pagesize && __capacity > __old_capacity)
+ {
+ const size_type __extra = __pagesize - __adj_size % __pagesize;
+ __capacity += __extra / sizeof(_CharT);
+ // Never allocate a string bigger than _S_max_size.
+ if (__capacity > _S_max_size)
+ __capacity = _S_max_size;
+ __size = (__capacity + 1) * sizeof(_CharT) + sizeof(_Rep);
+ }
+
+ // NB: Might throw, but no worries about a leak, mate: _Rep()
+ // does not throw.
+ void* __place = _Raw_bytes_alloc(__alloc).allocate(__size);
+ _Rep *__p = new (__place) _Rep;
+ __p->_M_capacity = __capacity;
+ // ABI compatibility - 3.4.x set in _S_create both
+ // _M_refcount and _M_length. All callers of _S_create
+ // in basic_string.tcc then set just _M_length.
+ // In 4.0.x and later both _M_refcount and _M_length
+ // are initialized in the callers, unfortunately we can
+ // have 3.4.x compiled code with _S_create callers inlined
+ // calling 4.0.x+ _S_create.
+ __p->_M_set_sharable();
+ return __p;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ _CharT*
+ basic_string<_CharT, _Traits, _Alloc>::_Rep::
+ _M_clone(const _Alloc& __alloc, size_type __res)
+ {
+ // Requested capacity of the clone.
+ const size_type __requested_cap = this->_M_length + __res;
+ _Rep* __r = _Rep::_S_create(__requested_cap, this->_M_capacity,
+ __alloc);
+ if (this->_M_length)
+ _M_copy(__r->_M_refdata(), _M_refdata(), this->_M_length);
+
+ __r->_M_set_length_and_sharable(this->_M_length);
+ return __r->_M_refdata();
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ basic_string<_CharT, _Traits, _Alloc>::
+ resize(size_type __n, _CharT __c)
+ {
+ const size_type __size = this->size();
+ _M_check_length(__size, __n, "basic_string::resize");
+ if (__size < __n)
+ this->append(__n - __size, __c);
+ else if (__n < __size)
+ this->erase(__n);
+ // else nothing (in particular, avoid calling _M_mutate() unnecessarily.)
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ template<typename _InputIterator>
+ basic_string<_CharT, _Traits, _Alloc>&
+ basic_string<_CharT, _Traits, _Alloc>::
+ _M_replace_dispatch(iterator __i1, iterator __i2, _InputIterator __k1,
+ _InputIterator __k2, __false_type)
+ {
+ const basic_string __s(__k1, __k2);
+ const size_type __n1 = __i2 - __i1;
+ _M_check_length(__n1, __s.size(), "basic_string::_M_replace_dispatch");
+ return _M_replace_safe(__i1 - _M_ibegin(), __n1, __s._M_data(),
+ __s.size());
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>&
+ basic_string<_CharT, _Traits, _Alloc>::
+ _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2,
+ _CharT __c)
+ {
+ _M_check_length(__n1, __n2, "basic_string::_M_replace_aux");
+ _M_mutate(__pos1, __n1, __n2);
+ if (__n2)
+ _M_assign(_M_data() + __pos1, __n2, __c);
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>&
+ basic_string<_CharT, _Traits, _Alloc>::
+ _M_replace_safe(size_type __pos1, size_type __n1, const _CharT* __s,
+ size_type __n2)
+ {
+ _M_mutate(__pos1, __n1, __n2);
+ if (__n2)
+ _M_copy(_M_data() + __pos1, __s, __n2);
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>
+ operator+(const _CharT* __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ {
+ __glibcxx_requires_string(__lhs);
+ typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
+ typedef typename __string_type::size_type __size_type;
+ const __size_type __len = _Traits::length(__lhs);
+ __string_type __str;
+ __str.reserve(__len + __rhs.size());
+ __str.append(__lhs, __len);
+ __str.append(__rhs);
+ return __str;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>
+ operator+(_CharT __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ {
+ typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
+ typedef typename __string_type::size_type __size_type;
+ __string_type __str;
+ const __size_type __len = __rhs.size();
+ __str.reserve(__len + 1);
+ __str.append(__size_type(1), __lhs);
+ __str.append(__rhs);
+ return __str;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::
+ copy(_CharT* __s, size_type __n, size_type __pos) const
+ {
+ _M_check(__pos, "basic_string::copy");
+ __n = _M_limit(__pos, __n);
+ __glibcxx_requires_string_len(__s, __n);
+ if (__n)
+ _M_copy(__s, _M_data() + __pos, __n);
+ // 21.3.5.7 par 3: do not append null. (good.)
+ return __n;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::
+ find(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_requires_string_len(__s, __n);
+ const size_type __size = this->size();
+ const _CharT* __data = _M_data();
+
+ if (__n == 0)
+ return __pos <= __size ? __pos : npos;
+
+ if (__n <= __size)
+ {
+ for (; __pos <= __size - __n; ++__pos)
+ if (traits_type::eq(__data[__pos], __s[0])
+ && traits_type::compare(__data + __pos + 1,
+ __s + 1, __n - 1) == 0)
+ return __pos;
+ }
+ return npos;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::
+ find(_CharT __c, size_type __pos) const
+ {
+ size_type __ret = npos;
+ const size_type __size = this->size();
+ if (__pos < __size)
+ {
+ const _CharT* __data = _M_data();
+ const size_type __n = __size - __pos;
+ const _CharT* __p = traits_type::find(__data + __pos, __n, __c);
+ if (__p)
+ __ret = __p - __data;
+ }
+ return __ret;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::
+ rfind(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_requires_string_len(__s, __n);
+ const size_type __size = this->size();
+ if (__n <= __size)
+ {
+ __pos = std::min(size_type(__size - __n), __pos);
+ const _CharT* __data = _M_data();
+ do
+ {
+ if (traits_type::compare(__data + __pos, __s, __n) == 0)
+ return __pos;
+ }
+ while (__pos-- > 0);
+ }
+ return npos;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::
+ rfind(_CharT __c, size_type __pos) const
+ {
+ size_type __size = this->size();
+ if (__size)
+ {
+ if (--__size > __pos)
+ __size = __pos;
+ for (++__size; __size-- > 0; )
+ if (traits_type::eq(_M_data()[__size], __c))
+ return __size;
+ }
+ return npos;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::
+ find_first_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_requires_string_len(__s, __n);
+ for (; __n && __pos < this->size(); ++__pos)
+ {
+ const _CharT* __p = traits_type::find(__s, __n, _M_data()[__pos]);
+ if (__p)
+ return __pos;
+ }
+ return npos;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::
+ find_last_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_requires_string_len(__s, __n);
+ size_type __size = this->size();
+ if (__size && __n)
+ {
+ if (--__size > __pos)
+ __size = __pos;
+ do
+ {
+ if (traits_type::find(__s, __n, _M_data()[__size]))
+ return __size;
+ }
+ while (__size-- != 0);
+ }
+ return npos;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::
+ find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_requires_string_len(__s, __n);
+ for (; __pos < this->size(); ++__pos)
+ if (!traits_type::find(__s, __n, _M_data()[__pos]))
+ return __pos;
+ return npos;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::
+ find_first_not_of(_CharT __c, size_type __pos) const
+ {
+ for (; __pos < this->size(); ++__pos)
+ if (!traits_type::eq(_M_data()[__pos], __c))
+ return __pos;
+ return npos;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::
+ find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_requires_string_len(__s, __n);
+ size_type __size = this->size();
+ if (__size)
+ {
+ if (--__size > __pos)
+ __size = __pos;
+ do
+ {
+ if (!traits_type::find(__s, __n, _M_data()[__size]))
+ return __size;
+ }
+ while (__size--);
+ }
+ return npos;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::
+ find_last_not_of(_CharT __c, size_type __pos) const
+ {
+ size_type __size = this->size();
+ if (__size)
+ {
+ if (--__size > __pos)
+ __size = __pos;
+ do
+ {
+ if (!traits_type::eq(_M_data()[__size], __c))
+ return __size;
+ }
+ while (__size--);
+ }
+ return npos;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ int
+ basic_string<_CharT, _Traits, _Alloc>::
+ compare(size_type __pos, size_type __n, const basic_string& __str) const
+ {
+ _M_check(__pos, "basic_string::compare");
+ __n = _M_limit(__pos, __n);
+ const size_type __osize = __str.size();
+ const size_type __len = std::min(__n, __osize);
+ int __r = traits_type::compare(_M_data() + __pos, __str.data(), __len);
+ if (!__r)
+ __r = _S_compare(__n, __osize);
+ return __r;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ int
+ basic_string<_CharT, _Traits, _Alloc>::
+ compare(size_type __pos1, size_type __n1, const basic_string& __str,
+ size_type __pos2, size_type __n2) const
+ {
+ _M_check(__pos1, "basic_string::compare");
+ __str._M_check(__pos2, "basic_string::compare");
+ __n1 = _M_limit(__pos1, __n1);
+ __n2 = __str._M_limit(__pos2, __n2);
+ const size_type __len = std::min(__n1, __n2);
+ int __r = traits_type::compare(_M_data() + __pos1,
+ __str.data() + __pos2, __len);
+ if (!__r)
+ __r = _S_compare(__n1, __n2);
+ return __r;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ int
+ basic_string<_CharT, _Traits, _Alloc>::
+ compare(const _CharT* __s) const
+ {
+ __glibcxx_requires_string(__s);
+ const size_type __size = this->size();
+ const size_type __osize = traits_type::length(__s);
+ const size_type __len = std::min(__size, __osize);
+ int __r = traits_type::compare(_M_data(), __s, __len);
+ if (!__r)
+ __r = _S_compare(__size, __osize);
+ return __r;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ int
+ basic_string <_CharT, _Traits, _Alloc>::
+ compare(size_type __pos, size_type __n1, const _CharT* __s) const
+ {
+ __glibcxx_requires_string(__s);
+ _M_check(__pos, "basic_string::compare");
+ __n1 = _M_limit(__pos, __n1);
+ const size_type __osize = traits_type::length(__s);
+ const size_type __len = std::min(__n1, __osize);
+ int __r = traits_type::compare(_M_data() + __pos, __s, __len);
+ if (!__r)
+ __r = _S_compare(__n1, __osize);
+ return __r;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ int
+ basic_string <_CharT, _Traits, _Alloc>::
+ compare(size_type __pos, size_type __n1, const _CharT* __s,
+ size_type __n2) const
+ {
+ __glibcxx_requires_string_len(__s, __n2);
+ _M_check(__pos, "basic_string::compare");
+ __n1 = _M_limit(__pos, __n1);
+ const size_type __len = std::min(__n1, __n2);
+ int __r = traits_type::compare(_M_data() + __pos, __s, __len);
+ if (!__r)
+ __r = _S_compare(__n1, __n2);
+ return __r;
+ }
+
+ // 21.3.7.9 basic_string::getline and operators
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __in,
+ basic_string<_CharT, _Traits, _Alloc>& __str)
+ {
+ typedef basic_istream<_CharT, _Traits> __istream_type;
+ typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
+ typedef typename __istream_type::ios_base __ios_base;
+ typedef typename __istream_type::int_type __int_type;
+ typedef typename __string_type::size_type __size_type;
+ typedef ctype<_CharT> __ctype_type;
+ typedef typename __ctype_type::ctype_base __ctype_base;
+
+ __size_type __extracted = 0;
+ typename __ios_base::iostate __err = __ios_base::goodbit;
+ typename __istream_type::sentry __cerb(__in, false);
+ if (__cerb)
+ {
+ __try
+ {
+ // Avoid reallocation for common case.
+ __str.erase();
+ _CharT __buf[128];
+ __size_type __len = 0;
+ const streamsize __w = __in.width();
+ const __size_type __n = __w > 0 ? static_cast<__size_type>(__w)
+ : __str.max_size();
+ const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc());
+ const __int_type __eof = _Traits::eof();
+ __int_type __c = __in.rdbuf()->sgetc();
+
+ while (__extracted < __n
+ && !_Traits::eq_int_type(__c, __eof)
+ && !__ct.is(__ctype_base::space,
+ _Traits::to_char_type(__c)))
+ {
+ if (__len == sizeof(__buf) / sizeof(_CharT))
+ {
+ __str.append(__buf, sizeof(__buf) / sizeof(_CharT));
+ __len = 0;
+ }
+ __buf[__len++] = _Traits::to_char_type(__c);
+ ++__extracted;
+ __c = __in.rdbuf()->snextc();
+ }
+ __str.append(__buf, __len);
+
+ if (_Traits::eq_int_type(__c, __eof))
+ __err |= __ios_base::eofbit;
+ __in.width(0);
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ __in._M_setstate(__ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 91. Description of operator>> and getline() for string<>
+ // might cause endless loop
+ __in._M_setstate(__ios_base::badbit);
+ }
+ }
+ // 211. operator>>(istream&, string&) doesn't set failbit
+ if (!__extracted)
+ __err |= __ios_base::failbit;
+ if (__err)
+ __in.setstate(__err);
+ return __in;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_istream<_CharT, _Traits>&
+ getline(basic_istream<_CharT, _Traits>& __in,
+ basic_string<_CharT, _Traits, _Alloc>& __str, _CharT __delim)
+ {
+ typedef basic_istream<_CharT, _Traits> __istream_type;
+ typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
+ typedef typename __istream_type::ios_base __ios_base;
+ typedef typename __istream_type::int_type __int_type;
+ typedef typename __string_type::size_type __size_type;
+
+ __size_type __extracted = 0;
+ const __size_type __n = __str.max_size();
+ typename __ios_base::iostate __err = __ios_base::goodbit;
+ typename __istream_type::sentry __cerb(__in, true);
+ if (__cerb)
+ {
+ __try
+ {
+ __str.erase();
+ const __int_type __idelim = _Traits::to_int_type(__delim);
+ const __int_type __eof = _Traits::eof();
+ __int_type __c = __in.rdbuf()->sgetc();
+
+ while (__extracted < __n
+ && !_Traits::eq_int_type(__c, __eof)
+ && !_Traits::eq_int_type(__c, __idelim))
+ {
+ __str += _Traits::to_char_type(__c);
+ ++__extracted;
+ __c = __in.rdbuf()->snextc();
+ }
+
+ if (_Traits::eq_int_type(__c, __eof))
+ __err |= __ios_base::eofbit;
+ else if (_Traits::eq_int_type(__c, __idelim))
+ {
+ ++__extracted;
+ __in.rdbuf()->sbumpc();
+ }
+ else
+ __err |= __ios_base::failbit;
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ __in._M_setstate(__ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 91. Description of operator>> and getline() for string<>
+ // might cause endless loop
+ __in._M_setstate(__ios_base::badbit);
+ }
+ }
+ if (!__extracted)
+ __err |= __ios_base::failbit;
+ if (__err)
+ __in.setstate(__err);
+ return __in;
+ }
+
+ // Inhibit implicit instantiations for required instantiations,
+ // which are defined via explicit instantiations elsewhere.
+ // NB: This syntax is a GNU extension.
+#if _GLIBCXX_EXTERN_TEMPLATE > 0
+ extern template class basic_string<char>;
+ extern template
+ basic_istream<char>&
+ operator>>(basic_istream<char>&, string&);
+ extern template
+ basic_ostream<char>&
+ operator<<(basic_ostream<char>&, const string&);
+ extern template
+ basic_istream<char>&
+ getline(basic_istream<char>&, string&, char);
+ extern template
+ basic_istream<char>&
+ getline(basic_istream<char>&, string&);
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ extern template class basic_string<wchar_t>;
+ extern template
+ basic_istream<wchar_t>&
+ operator>>(basic_istream<wchar_t>&, wstring&);
+ extern template
+ basic_ostream<wchar_t>&
+ operator<<(basic_ostream<wchar_t>&, const wstring&);
+ extern template
+ basic_istream<wchar_t>&
+ getline(basic_istream<wchar_t>&, wstring&, wchar_t);
+ extern template
+ basic_istream<wchar_t>&
+ getline(basic_istream<wchar_t>&, wstring&);
+#endif
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/bits/boost_concept_check.h b/i686-linux/include/c++/4.4.3/bits/boost_concept_check.h
new file mode 100644
index 0000000..054fcf2
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/boost_concept_check.h
@@ -0,0 +1,787 @@
+// -*- C++ -*-
+
+// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// (C) Copyright Jeremy Siek 2000. Permission to copy, use, modify,
+// sell and distribute this software is granted provided this
+// copyright notice appears in all copies. This software is provided
+// "as is" without express or implied warranty, and with no claim as
+// to its suitability for any purpose.
+//
+
+/** @file boost_concept_check.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+// GCC Note: based on version 1.12.0 of the Boost library.
+
+#ifndef _BOOST_CONCEPT_CHECK_H
+#define _BOOST_CONCEPT_CHECK_H 1
+
+#pragma GCC system_header
+
+#include <cstddef> // for ptrdiff_t, used next
+#include <bits/stl_iterator_base_types.h> // for traits and tags
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+#define _IsUnused __attribute__ ((__unused__))
+
+// When the C-C code is in use, we would like this function to do as little
+// as possible at runtime, use as few resources as possible, and hopefully
+// be elided out of existence... hmmm.
+template <class _Concept>
+inline void __function_requires()
+{
+ void (_Concept::*__x)() _IsUnused = &_Concept::__constraints;
+}
+
+// No definition: if this is referenced, there's a problem with
+// the instantiating type not being one of the required integer types.
+// Unfortunately, this results in a link-time error, not a compile-time error.
+void __error_type_must_be_an_integer_type();
+void __error_type_must_be_an_unsigned_integer_type();
+void __error_type_must_be_a_signed_integer_type();
+
+// ??? Should the "concept_checking*" structs begin with more than _ ?
+#define _GLIBCXX_CLASS_REQUIRES(_type_var, _ns, _concept) \
+ typedef void (_ns::_concept <_type_var>::* _func##_type_var##_concept)(); \
+ template <_func##_type_var##_concept _Tp1> \
+ struct _concept_checking##_type_var##_concept { }; \
+ typedef _concept_checking##_type_var##_concept< \
+ &_ns::_concept <_type_var>::__constraints> \
+ _concept_checking_typedef##_type_var##_concept
+
+#define _GLIBCXX_CLASS_REQUIRES2(_type_var1, _type_var2, _ns, _concept) \
+ typedef void (_ns::_concept <_type_var1,_type_var2>::* _func##_type_var1##_type_var2##_concept)(); \
+ template <_func##_type_var1##_type_var2##_concept _Tp1> \
+ struct _concept_checking##_type_var1##_type_var2##_concept { }; \
+ typedef _concept_checking##_type_var1##_type_var2##_concept< \
+ &_ns::_concept <_type_var1,_type_var2>::__constraints> \
+ _concept_checking_typedef##_type_var1##_type_var2##_concept
+
+#define _GLIBCXX_CLASS_REQUIRES3(_type_var1, _type_var2, _type_var3, _ns, _concept) \
+ typedef void (_ns::_concept <_type_var1,_type_var2,_type_var3>::* _func##_type_var1##_type_var2##_type_var3##_concept)(); \
+ template <_func##_type_var1##_type_var2##_type_var3##_concept _Tp1> \
+ struct _concept_checking##_type_var1##_type_var2##_type_var3##_concept { }; \
+ typedef _concept_checking##_type_var1##_type_var2##_type_var3##_concept< \
+ &_ns::_concept <_type_var1,_type_var2,_type_var3>::__constraints> \
+ _concept_checking_typedef##_type_var1##_type_var2##_type_var3##_concept
+
+#define _GLIBCXX_CLASS_REQUIRES4(_type_var1, _type_var2, _type_var3, _type_var4, _ns, _concept) \
+ typedef void (_ns::_concept <_type_var1,_type_var2,_type_var3,_type_var4>::* _func##_type_var1##_type_var2##_type_var3##_type_var4##_concept)(); \
+ template <_func##_type_var1##_type_var2##_type_var3##_type_var4##_concept _Tp1> \
+ struct _concept_checking##_type_var1##_type_var2##_type_var3##_type_var4##_concept { }; \
+ typedef _concept_checking##_type_var1##_type_var2##_type_var3##_type_var4##_concept< \
+ &_ns::_concept <_type_var1,_type_var2,_type_var3,_type_var4>::__constraints> \
+ _concept_checking_typedef##_type_var1##_type_var2##_type_var3##_type_var4##_concept
+
+
+template <class _Tp1, class _Tp2>
+struct _Aux_require_same { };
+
+template <class _Tp>
+struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
+
+ template <class _Tp1, class _Tp2>
+ struct _SameTypeConcept
+ {
+ void __constraints() {
+ typedef typename _Aux_require_same<_Tp1, _Tp2>::_Type _Required;
+ }
+ };
+
+ template <class _Tp>
+ struct _IntegerConcept {
+ void __constraints() {
+ __error_type_must_be_an_integer_type();
+ }
+ };
+ template <> struct _IntegerConcept<short> { void __constraints() {} };
+ template <> struct _IntegerConcept<unsigned short> { void __constraints(){} };
+ template <> struct _IntegerConcept<int> { void __constraints() {} };
+ template <> struct _IntegerConcept<unsigned int> { void __constraints() {} };
+ template <> struct _IntegerConcept<long> { void __constraints() {} };
+ template <> struct _IntegerConcept<unsigned long> { void __constraints() {} };
+ template <> struct _IntegerConcept<long long> { void __constraints() {} };
+ template <> struct _IntegerConcept<unsigned long long>
+ { void __constraints() {} };
+
+ template <class _Tp>
+ struct _SignedIntegerConcept {
+ void __constraints() {
+ __error_type_must_be_a_signed_integer_type();
+ }
+ };
+ template <> struct _SignedIntegerConcept<short> { void __constraints() {} };
+ template <> struct _SignedIntegerConcept<int> { void __constraints() {} };
+ template <> struct _SignedIntegerConcept<long> { void __constraints() {} };
+ template <> struct _SignedIntegerConcept<long long> { void __constraints(){}};
+
+ template <class _Tp>
+ struct _UnsignedIntegerConcept {
+ void __constraints() {
+ __error_type_must_be_an_unsigned_integer_type();
+ }
+ };
+ template <> struct _UnsignedIntegerConcept<unsigned short>
+ { void __constraints() {} };
+ template <> struct _UnsignedIntegerConcept<unsigned int>
+ { void __constraints() {} };
+ template <> struct _UnsignedIntegerConcept<unsigned long>
+ { void __constraints() {} };
+ template <> struct _UnsignedIntegerConcept<unsigned long long>
+ { void __constraints() {} };
+
+ //===========================================================================
+ // Basic Concepts
+
+ template <class _Tp>
+ struct _DefaultConstructibleConcept
+ {
+ void __constraints() {
+ _Tp __a _IsUnused; // require default constructor
+ }
+ };
+
+ template <class _Tp>
+ struct _AssignableConcept
+ {
+ void __constraints() {
+ __a = __a; // require assignment operator
+ __const_constraints(__a);
+ }
+ void __const_constraints(const _Tp& __b) {
+ __a = __b; // const required for argument to assignment
+ }
+ _Tp __a;
+ // possibly should be "Tp* a;" and then dereference "a" in constraint
+ // functions? present way would require a default ctor, i think...
+ };
+
+ template <class _Tp>
+ struct _CopyConstructibleConcept
+ {
+ void __constraints() {
+ _Tp __a(__b); // require copy constructor
+ _Tp* __ptr _IsUnused = &__a; // require address of operator
+ __const_constraints(__a);
+ }
+ void __const_constraints(const _Tp& __a) {
+ _Tp __c _IsUnused(__a); // require const copy constructor
+ const _Tp* __ptr _IsUnused = &__a; // require const address of operator
+ }
+ _Tp __b;
+ };
+
+ // The SGI STL version of Assignable requires copy constructor and operator=
+ template <class _Tp>
+ struct _SGIAssignableConcept
+ {
+ void __constraints() {
+ _Tp __b _IsUnused(__a);
+ __a = __a; // require assignment operator
+ __const_constraints(__a);
+ }
+ void __const_constraints(const _Tp& __b) {
+ _Tp __c _IsUnused(__b);
+ __a = __b; // const required for argument to assignment
+ }
+ _Tp __a;
+ };
+
+ template <class _From, class _To>
+ struct _ConvertibleConcept
+ {
+ void __constraints() {
+ _To __y _IsUnused = __x;
+ }
+ _From __x;
+ };
+
+ // The C++ standard requirements for many concepts talk about return
+ // types that must be "convertible to bool". The problem with this
+ // requirement is that it leaves the door open for evil proxies that
+ // define things like operator|| with strange return types. Two
+ // possible solutions are:
+ // 1) require the return type to be exactly bool
+ // 2) stay with convertible to bool, and also
+ // specify stuff about all the logical operators.
+ // For now we just test for convertible to bool.
+ template <class _Tp>
+ void __aux_require_boolean_expr(const _Tp& __t) {
+ bool __x _IsUnused = __t;
+ }
+
+// FIXME
+ template <class _Tp>
+ struct _EqualityComparableConcept
+ {
+ void __constraints() {
+ __aux_require_boolean_expr(__a == __b);
+ }
+ _Tp __a, __b;
+ };
+
+ template <class _Tp>
+ struct _LessThanComparableConcept
+ {
+ void __constraints() {
+ __aux_require_boolean_expr(__a < __b);
+ }
+ _Tp __a, __b;
+ };
+
+ // This is equivalent to SGI STL's LessThanComparable.
+ template <class _Tp>
+ struct _ComparableConcept
+ {
+ void __constraints() {
+ __aux_require_boolean_expr(__a < __b);
+ __aux_require_boolean_expr(__a > __b);
+ __aux_require_boolean_expr(__a <= __b);
+ __aux_require_boolean_expr(__a >= __b);
+ }
+ _Tp __a, __b;
+ };
+
+#define _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(_OP,_NAME) \
+ template <class _First, class _Second> \
+ struct _NAME { \
+ void __constraints() { (void)__constraints_(); } \
+ bool __constraints_() { \
+ return __a _OP __b; \
+ } \
+ _First __a; \
+ _Second __b; \
+ }
+
+#define _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT(_OP,_NAME) \
+ template <class _Ret, class _First, class _Second> \
+ struct _NAME { \
+ void __constraints() { (void)__constraints_(); } \
+ _Ret __constraints_() { \
+ return __a _OP __b; \
+ } \
+ _First __a; \
+ _Second __b; \
+ }
+
+ _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(==, _EqualOpConcept);
+ _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(!=, _NotEqualOpConcept);
+ _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(<, _LessThanOpConcept);
+ _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(<=, _LessEqualOpConcept);
+ _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(>, _GreaterThanOpConcept);
+ _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(>=, _GreaterEqualOpConcept);
+
+ _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT(+, _PlusOpConcept);
+ _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT(*, _TimesOpConcept);
+ _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT(/, _DivideOpConcept);
+ _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT(-, _SubtractOpConcept);
+ _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT(%, _ModOpConcept);
+
+#undef _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT
+#undef _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT
+
+ //===========================================================================
+ // Function Object Concepts
+
+ template <class _Func, class _Return>
+ struct _GeneratorConcept
+ {
+ void __constraints() {
+ const _Return& __r _IsUnused = __f();// require operator() member function
+ }
+ _Func __f;
+ };
+
+
+ template <class _Func>
+ struct _GeneratorConcept<_Func,void>
+ {
+ void __constraints() {
+ __f(); // require operator() member function
+ }
+ _Func __f;
+ };
+
+ template <class _Func, class _Return, class _Arg>
+ struct _UnaryFunctionConcept
+ {
+ void __constraints() {
+ __r = __f(__arg); // require operator()
+ }
+ _Func __f;
+ _Arg __arg;
+ _Return __r;
+ };
+
+ template <class _Func, class _Arg>
+ struct _UnaryFunctionConcept<_Func, void, _Arg> {
+ void __constraints() {
+ __f(__arg); // require operator()
+ }
+ _Func __f;
+ _Arg __arg;
+ };
+
+ template <class _Func, class _Return, class _First, class _Second>
+ struct _BinaryFunctionConcept
+ {
+ void __constraints() {
+ __r = __f(__first, __second); // require operator()
+ }
+ _Func __f;
+ _First __first;
+ _Second __second;
+ _Return __r;
+ };
+
+ template <class _Func, class _First, class _Second>
+ struct _BinaryFunctionConcept<_Func, void, _First, _Second>
+ {
+ void __constraints() {
+ __f(__first, __second); // require operator()
+ }
+ _Func __f;
+ _First __first;
+ _Second __second;
+ };
+
+ template <class _Func, class _Arg>
+ struct _UnaryPredicateConcept
+ {
+ void __constraints() {
+ __aux_require_boolean_expr(__f(__arg)); // require op() returning bool
+ }
+ _Func __f;
+ _Arg __arg;
+ };
+
+ template <class _Func, class _First, class _Second>
+ struct _BinaryPredicateConcept
+ {
+ void __constraints() {
+ __aux_require_boolean_expr(__f(__a, __b)); // require op() returning bool
+ }
+ _Func __f;
+ _First __a;
+ _Second __b;
+ };
+
+ // use this when functor is used inside a container class like std::set
+ template <class _Func, class _First, class _Second>
+ struct _Const_BinaryPredicateConcept {
+ void __constraints() {
+ __const_constraints(__f);
+ }
+ void __const_constraints(const _Func& __fun) {
+ __function_requires<_BinaryPredicateConcept<_Func, _First, _Second> >();
+ // operator() must be a const member function
+ __aux_require_boolean_expr(__fun(__a, __b));
+ }
+ _Func __f;
+ _First __a;
+ _Second __b;
+ };
+
+ //===========================================================================
+ // Iterator Concepts
+
+ template <class _Tp>
+ struct _TrivialIteratorConcept
+ {
+ void __constraints() {
+// __function_requires< _DefaultConstructibleConcept<_Tp> >();
+ __function_requires< _AssignableConcept<_Tp> >();
+ __function_requires< _EqualityComparableConcept<_Tp> >();
+// typedef typename std::iterator_traits<_Tp>::value_type _V;
+ (void)*__i; // require dereference operator
+ }
+ _Tp __i;
+ };
+
+ template <class _Tp>
+ struct _Mutable_TrivialIteratorConcept
+ {
+ void __constraints() {
+ __function_requires< _TrivialIteratorConcept<_Tp> >();
+ *__i = *__j; // require dereference and assignment
+ }
+ _Tp __i, __j;
+ };
+
+ template <class _Tp>
+ struct _InputIteratorConcept
+ {
+ void __constraints() {
+ __function_requires< _TrivialIteratorConcept<_Tp> >();
+ // require iterator_traits typedef's
+ typedef typename std::iterator_traits<_Tp>::difference_type _Diff;
+// __function_requires< _SignedIntegerConcept<_Diff> >();
+ typedef typename std::iterator_traits<_Tp>::reference _Ref;
+ typedef typename std::iterator_traits<_Tp>::pointer _Pt;
+ typedef typename std::iterator_traits<_Tp>::iterator_category _Cat;
+ __function_requires< _ConvertibleConcept<
+ typename std::iterator_traits<_Tp>::iterator_category,
+ std::input_iterator_tag> >();
+ ++__i; // require preincrement operator
+ __i++; // require postincrement operator
+ }
+ _Tp __i;
+ };
+
+ template <class _Tp, class _ValueT>
+ struct _OutputIteratorConcept
+ {
+ void __constraints() {
+ __function_requires< _AssignableConcept<_Tp> >();
+ ++__i; // require preincrement operator
+ __i++; // require postincrement operator
+ *__i++ = __t; // require postincrement and assignment
+ }
+ _Tp __i;
+ _ValueT __t;
+ };
+
+ template <class _Tp>
+ struct _ForwardIteratorConcept
+ {
+ void __constraints() {
+ __function_requires< _InputIteratorConcept<_Tp> >();
+ __function_requires< _DefaultConstructibleConcept<_Tp> >();
+ __function_requires< _ConvertibleConcept<
+ typename std::iterator_traits<_Tp>::iterator_category,
+ std::forward_iterator_tag> >();
+ typedef typename std::iterator_traits<_Tp>::reference _Ref;
+ _Ref __r _IsUnused = *__i;
+ }
+ _Tp __i;
+ };
+
+ template <class _Tp>
+ struct _Mutable_ForwardIteratorConcept
+ {
+ void __constraints() {
+ __function_requires< _ForwardIteratorConcept<_Tp> >();
+ *__i++ = *__i; // require postincrement and assignment
+ }
+ _Tp __i;
+ };
+
+ template <class _Tp>
+ struct _BidirectionalIteratorConcept
+ {
+ void __constraints() {
+ __function_requires< _ForwardIteratorConcept<_Tp> >();
+ __function_requires< _ConvertibleConcept<
+ typename std::iterator_traits<_Tp>::iterator_category,
+ std::bidirectional_iterator_tag> >();
+ --__i; // require predecrement operator
+ __i--; // require postdecrement operator
+ }
+ _Tp __i;
+ };
+
+ template <class _Tp>
+ struct _Mutable_BidirectionalIteratorConcept
+ {
+ void __constraints() {
+ __function_requires< _BidirectionalIteratorConcept<_Tp> >();
+ __function_requires< _Mutable_ForwardIteratorConcept<_Tp> >();
+ *__i-- = *__i; // require postdecrement and assignment
+ }
+ _Tp __i;
+ };
+
+
+ template <class _Tp>
+ struct _RandomAccessIteratorConcept
+ {
+ void __constraints() {
+ __function_requires< _BidirectionalIteratorConcept<_Tp> >();
+ __function_requires< _ComparableConcept<_Tp> >();
+ __function_requires< _ConvertibleConcept<
+ typename std::iterator_traits<_Tp>::iterator_category,
+ std::random_access_iterator_tag> >();
+ // ??? We don't use _Ref, are we just checking for "referenceability"?
+ typedef typename std::iterator_traits<_Tp>::reference _Ref;
+
+ __i += __n; // require assignment addition operator
+ __i = __i + __n; __i = __n + __i; // require addition with difference type
+ __i -= __n; // require assignment subtraction op
+ __i = __i - __n; // require subtraction with
+ // difference type
+ __n = __i - __j; // require difference operator
+ (void)__i[__n]; // require element access operator
+ }
+ _Tp __a, __b;
+ _Tp __i, __j;
+ typename std::iterator_traits<_Tp>::difference_type __n;
+ };
+
+ template <class _Tp>
+ struct _Mutable_RandomAccessIteratorConcept
+ {
+ void __constraints() {
+ __function_requires< _RandomAccessIteratorConcept<_Tp> >();
+ __function_requires< _Mutable_BidirectionalIteratorConcept<_Tp> >();
+ __i[__n] = *__i; // require element access and assignment
+ }
+ _Tp __i;
+ typename std::iterator_traits<_Tp>::difference_type __n;
+ };
+
+ //===========================================================================
+ // Container Concepts
+
+ template <class _Container>
+ struct _ContainerConcept
+ {
+ typedef typename _Container::value_type _Value_type;
+ typedef typename _Container::difference_type _Difference_type;
+ typedef typename _Container::size_type _Size_type;
+ typedef typename _Container::const_reference _Const_reference;
+ typedef typename _Container::const_pointer _Const_pointer;
+ typedef typename _Container::const_iterator _Const_iterator;
+
+ void __constraints() {
+ __function_requires< _InputIteratorConcept<_Const_iterator> >();
+ __function_requires< _AssignableConcept<_Container> >();
+ const _Container __c;
+ __i = __c.begin();
+ __i = __c.end();
+ __n = __c.size();
+ __n = __c.max_size();
+ __b = __c.empty();
+ }
+ bool __b;
+ _Const_iterator __i;
+ _Size_type __n;
+ };
+
+ template <class _Container>
+ struct _Mutable_ContainerConcept
+ {
+ typedef typename _Container::value_type _Value_type;
+ typedef typename _Container::reference _Reference;
+ typedef typename _Container::iterator _Iterator;
+ typedef typename _Container::pointer _Pointer;
+
+ void __constraints() {
+ __function_requires< _ContainerConcept<_Container> >();
+ __function_requires< _AssignableConcept<_Value_type> >();
+ __function_requires< _InputIteratorConcept<_Iterator> >();
+
+ __i = __c.begin();
+ __i = __c.end();
+ __c.swap(__c2);
+ }
+ _Iterator __i;
+ _Container __c, __c2;
+ };
+
+ template <class _ForwardContainer>
+ struct _ForwardContainerConcept
+ {
+ void __constraints() {
+ __function_requires< _ContainerConcept<_ForwardContainer> >();
+ typedef typename _ForwardContainer::const_iterator _Const_iterator;
+ __function_requires< _ForwardIteratorConcept<_Const_iterator> >();
+ }
+ };
+
+ template <class _ForwardContainer>
+ struct _Mutable_ForwardContainerConcept
+ {
+ void __constraints() {
+ __function_requires< _ForwardContainerConcept<_ForwardContainer> >();
+ __function_requires< _Mutable_ContainerConcept<_ForwardContainer> >();
+ typedef typename _ForwardContainer::iterator _Iterator;
+ __function_requires< _Mutable_ForwardIteratorConcept<_Iterator> >();
+ }
+ };
+
+ template <class _ReversibleContainer>
+ struct _ReversibleContainerConcept
+ {
+ typedef typename _ReversibleContainer::const_iterator _Const_iterator;
+ typedef typename _ReversibleContainer::const_reverse_iterator
+ _Const_reverse_iterator;
+
+ void __constraints() {
+ __function_requires< _ForwardContainerConcept<_ReversibleContainer> >();
+ __function_requires< _BidirectionalIteratorConcept<_Const_iterator> >();
+ __function_requires<
+ _BidirectionalIteratorConcept<_Const_reverse_iterator> >();
+
+ const _ReversibleContainer __c;
+ _Const_reverse_iterator __i = __c.rbegin();
+ __i = __c.rend();
+ }
+ };
+
+ template <class _ReversibleContainer>
+ struct _Mutable_ReversibleContainerConcept
+ {
+ typedef typename _ReversibleContainer::iterator _Iterator;
+ typedef typename _ReversibleContainer::reverse_iterator _Reverse_iterator;
+
+ void __constraints() {
+ __function_requires<_ReversibleContainerConcept<_ReversibleContainer> >();
+ __function_requires<
+ _Mutable_ForwardContainerConcept<_ReversibleContainer> >();
+ __function_requires<_Mutable_BidirectionalIteratorConcept<_Iterator> >();
+ __function_requires<
+ _Mutable_BidirectionalIteratorConcept<_Reverse_iterator> >();
+
+ _Reverse_iterator __i = __c.rbegin();
+ __i = __c.rend();
+ }
+ _ReversibleContainer __c;
+ };
+
+ template <class _RandomAccessContainer>
+ struct _RandomAccessContainerConcept
+ {
+ typedef typename _RandomAccessContainer::size_type _Size_type;
+ typedef typename _RandomAccessContainer::const_reference _Const_reference;
+ typedef typename _RandomAccessContainer::const_iterator _Const_iterator;
+ typedef typename _RandomAccessContainer::const_reverse_iterator
+ _Const_reverse_iterator;
+
+ void __constraints() {
+ __function_requires<
+ _ReversibleContainerConcept<_RandomAccessContainer> >();
+ __function_requires< _RandomAccessIteratorConcept<_Const_iterator> >();
+ __function_requires<
+ _RandomAccessIteratorConcept<_Const_reverse_iterator> >();
+
+ const _RandomAccessContainer __c;
+ _Const_reference __r _IsUnused = __c[__n];
+ }
+ _Size_type __n;
+ };
+
+ template <class _RandomAccessContainer>
+ struct _Mutable_RandomAccessContainerConcept
+ {
+ typedef typename _RandomAccessContainer::size_type _Size_type;
+ typedef typename _RandomAccessContainer::reference _Reference;
+ typedef typename _RandomAccessContainer::iterator _Iterator;
+ typedef typename _RandomAccessContainer::reverse_iterator _Reverse_iterator;
+
+ void __constraints() {
+ __function_requires<
+ _RandomAccessContainerConcept<_RandomAccessContainer> >();
+ __function_requires<
+ _Mutable_ReversibleContainerConcept<_RandomAccessContainer> >();
+ __function_requires< _Mutable_RandomAccessIteratorConcept<_Iterator> >();
+ __function_requires<
+ _Mutable_RandomAccessIteratorConcept<_Reverse_iterator> >();
+
+ _Reference __r _IsUnused = __c[__i];
+ }
+ _Size_type __i;
+ _RandomAccessContainer __c;
+ };
+
+ // A Sequence is inherently mutable
+ template <class _Sequence>
+ struct _SequenceConcept
+ {
+ typedef typename _Sequence::reference _Reference;
+ typedef typename _Sequence::const_reference _Const_reference;
+
+ void __constraints() {
+ // Matt Austern's book puts DefaultConstructible here, the C++
+ // standard places it in Container
+ // function_requires< DefaultConstructible<Sequence> >();
+ __function_requires< _Mutable_ForwardContainerConcept<_Sequence> >();
+ __function_requires< _DefaultConstructibleConcept<_Sequence> >();
+
+ _Sequence
+ __c _IsUnused(__n, __t),
+ __c2 _IsUnused(__first, __last);
+
+ __c.insert(__p, __t);
+ __c.insert(__p, __n, __t);
+ __c.insert(__p, __first, __last);
+
+ __c.erase(__p);
+ __c.erase(__p, __q);
+
+ _Reference __r _IsUnused = __c.front();
+
+ __const_constraints(__c);
+ }
+ void __const_constraints(const _Sequence& __c) {
+ _Const_reference __r _IsUnused = __c.front();
+ }
+ typename _Sequence::value_type __t;
+ typename _Sequence::size_type __n;
+ typename _Sequence::value_type *__first, *__last;
+ typename _Sequence::iterator __p, __q;
+ };
+
+ template <class _FrontInsertionSequence>
+ struct _FrontInsertionSequenceConcept
+ {
+ void __constraints() {
+ __function_requires< _SequenceConcept<_FrontInsertionSequence> >();
+
+ __c.push_front(__t);
+ __c.pop_front();
+ }
+ _FrontInsertionSequence __c;
+ typename _FrontInsertionSequence::value_type __t;
+ };
+
+ template <class _BackInsertionSequence>
+ struct _BackInsertionSequenceConcept
+ {
+ typedef typename _BackInsertionSequence::reference _Reference;
+ typedef typename _BackInsertionSequence::const_reference _Const_reference;
+
+ void __constraints() {
+ __function_requires< _SequenceConcept<_BackInsertionSequence> >();
+
+ __c.push_back(__t);
+ __c.pop_back();
+ _Reference __r _IsUnused = __c.back();
+ }
+ void __const_constraints(const _BackInsertionSequence& __c) {
+ _Const_reference __r _IsUnused = __c.back();
+ };
+ _BackInsertionSequence __c;
+ typename _BackInsertionSequence::value_type __t;
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#undef _IsUnused
+
+#endif // _GLIBCXX_BOOST_CONCEPT_CHECK
+
+
diff --git a/i686-linux/include/c++/4.4.3/bits/char_traits.h b/i686-linux/include/c++/4.4.3/bits/char_traits.h
new file mode 100644
index 0000000..5e52c75
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/char_traits.h
@@ -0,0 +1,575 @@
+// Character Traits for use by standard string and iostream -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file char_traits.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 21 Strings library
+//
+
+#ifndef _CHAR_TRAITS_H
+#define _CHAR_TRAITS_H 1
+
+#pragma GCC system_header
+
+#include <bits/stl_algobase.h> // std::copy, std::fill_n
+#include <bits/postypes.h> // For streampos
+#include <cwchar> // For WEOF, wmemmove, wmemset, etc.
+
+#ifndef _GLIBCXX_STDIO_MACROS
+# include <cstdio> // For EOF
+# define _CHAR_TRAITS_EOF EOF
+#else
+# define _CHAR_TRAITS_EOF (-1)
+#endif
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ /**
+ * @brief Mapping from character type to associated types.
+ *
+ * @note This is an implementation class for the generic version
+ * of char_traits. It defines int_type, off_type, pos_type, and
+ * state_type. By default these are unsigned long, streamoff,
+ * streampos, and mbstate_t. Users who need a different set of
+ * types, but who don't need to change the definitions of any function
+ * defined in char_traits, can specialize __gnu_cxx::_Char_types
+ * while leaving __gnu_cxx::char_traits alone. */
+ template<typename _CharT>
+ struct _Char_types
+ {
+ typedef unsigned long int_type;
+ typedef std::streampos pos_type;
+ typedef std::streamoff off_type;
+ typedef std::mbstate_t state_type;
+ };
+
+
+ /**
+ * @brief Base class used to implement std::char_traits.
+ *
+ * @note For any given actual character type, this definition is
+ * probably wrong. (Most of the member functions are likely to be
+ * right, but the int_type and state_type typedefs, and the eof()
+ * member function, are likely to be wrong.) The reason this class
+ * exists is so users can specialize it. Classes in namespace std
+ * may not be specialized for fundamental types, but classes in
+ * namespace __gnu_cxx may be.
+ *
+ * See http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt05ch13s03.html
+ * for advice on how to make use of this class for "unusual" character
+ * types. Also, check out include/ext/pod_char_traits.h.
+ */
+ template<typename _CharT>
+ struct char_traits
+ {
+ typedef _CharT char_type;
+ typedef typename _Char_types<_CharT>::int_type int_type;
+ typedef typename _Char_types<_CharT>::pos_type pos_type;
+ typedef typename _Char_types<_CharT>::off_type off_type;
+ typedef typename _Char_types<_CharT>::state_type state_type;
+
+ static void
+ assign(char_type& __c1, const char_type& __c2)
+ { __c1 = __c2; }
+
+ static bool
+ eq(const char_type& __c1, const char_type& __c2)
+ { return __c1 == __c2; }
+
+ static bool
+ lt(const char_type& __c1, const char_type& __c2)
+ { return __c1 < __c2; }
+
+ static int
+ compare(const char_type* __s1, const char_type* __s2, std::size_t __n);
+
+ static std::size_t
+ length(const char_type* __s);
+
+ static const char_type*
+ find(const char_type* __s, std::size_t __n, const char_type& __a);
+
+ static char_type*
+ move(char_type* __s1, const char_type* __s2, std::size_t __n);
+
+ static char_type*
+ copy(char_type* __s1, const char_type* __s2, std::size_t __n);
+
+ static char_type*
+ assign(char_type* __s, std::size_t __n, char_type __a);
+
+ static char_type
+ to_char_type(const int_type& __c)
+ { return static_cast<char_type>(__c); }
+
+ static int_type
+ to_int_type(const char_type& __c)
+ { return static_cast<int_type>(__c); }
+
+ static bool
+ eq_int_type(const int_type& __c1, const int_type& __c2)
+ { return __c1 == __c2; }
+
+ static int_type
+ eof()
+ { return static_cast<int_type>(_CHAR_TRAITS_EOF); }
+
+ static int_type
+ not_eof(const int_type& __c)
+ { return !eq_int_type(__c, eof()) ? __c : to_int_type(char_type()); }
+ };
+
+ template<typename _CharT>
+ int
+ char_traits<_CharT>::
+ compare(const char_type* __s1, const char_type* __s2, std::size_t __n)
+ {
+ for (std::size_t __i = 0; __i < __n; ++__i)
+ if (lt(__s1[__i], __s2[__i]))
+ return -1;
+ else if (lt(__s2[__i], __s1[__i]))
+ return 1;
+ return 0;
+ }
+
+ template<typename _CharT>
+ std::size_t
+ char_traits<_CharT>::
+ length(const char_type* __p)
+ {
+ std::size_t __i = 0;
+ while (!eq(__p[__i], char_type()))
+ ++__i;
+ return __i;
+ }
+
+ template<typename _CharT>
+ const typename char_traits<_CharT>::char_type*
+ char_traits<_CharT>::
+ find(const char_type* __s, std::size_t __n, const char_type& __a)
+ {
+ for (std::size_t __i = 0; __i < __n; ++__i)
+ if (eq(__s[__i], __a))
+ return __s + __i;
+ return 0;
+ }
+
+ template<typename _CharT>
+ typename char_traits<_CharT>::char_type*
+ char_traits<_CharT>::
+ move(char_type* __s1, const char_type* __s2, std::size_t __n)
+ {
+ return static_cast<_CharT*>(__builtin_memmove(__s1, __s2,
+ __n * sizeof(char_type)));
+ }
+
+ template<typename _CharT>
+ typename char_traits<_CharT>::char_type*
+ char_traits<_CharT>::
+ copy(char_type* __s1, const char_type* __s2, std::size_t __n)
+ {
+ // NB: Inline std::copy so no recursive dependencies.
+ std::copy(__s2, __s2 + __n, __s1);
+ return __s1;
+ }
+
+ template<typename _CharT>
+ typename char_traits<_CharT>::char_type*
+ char_traits<_CharT>::
+ assign(char_type* __s, std::size_t __n, char_type __a)
+ {
+ // NB: Inline std::fill_n so no recursive dependencies.
+ std::fill_n(__s, __n, __a);
+ return __s;
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // 21.1
+ /**
+ * @brief Basis for explicit traits specializations.
+ *
+ * @note For any given actual character type, this definition is
+ * probably wrong. Since this is just a thin wrapper around
+ * __gnu_cxx::char_traits, it is possible to achieve a more
+ * appropriate definition by specializing __gnu_cxx::char_traits.
+ *
+ * See http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt05ch13s03.html
+ * for advice on how to make use of this class for "unusual" character
+ * types. Also, check out include/ext/pod_char_traits.h.
+ */
+ template<class _CharT>
+ struct char_traits : public __gnu_cxx::char_traits<_CharT>
+ { };
+
+
+ /// 21.1.3.1 char_traits specializations
+ template<>
+ struct char_traits<char>
+ {
+ typedef char char_type;
+ typedef int int_type;
+ typedef streampos pos_type;
+ typedef streamoff off_type;
+ typedef mbstate_t state_type;
+
+ static void
+ assign(char_type& __c1, const char_type& __c2)
+ { __c1 = __c2; }
+
+ static bool
+ eq(const char_type& __c1, const char_type& __c2)
+ { return __c1 == __c2; }
+
+ static bool
+ lt(const char_type& __c1, const char_type& __c2)
+ { return __c1 < __c2; }
+
+ static int
+ compare(const char_type* __s1, const char_type* __s2, size_t __n)
+ { return __builtin_memcmp(__s1, __s2, __n); }
+
+ static size_t
+ length(const char_type* __s)
+ { return __builtin_strlen(__s); }
+
+ static const char_type*
+ find(const char_type* __s, size_t __n, const char_type& __a)
+ { return static_cast<const char_type*>(__builtin_memchr(__s, __a, __n)); }
+
+ static char_type*
+ move(char_type* __s1, const char_type* __s2, size_t __n)
+ { return static_cast<char_type*>(__builtin_memmove(__s1, __s2, __n)); }
+
+ static char_type*
+ copy(char_type* __s1, const char_type* __s2, size_t __n)
+ { return static_cast<char_type*>(__builtin_memcpy(__s1, __s2, __n)); }
+
+ static char_type*
+ assign(char_type* __s, size_t __n, char_type __a)
+ { return static_cast<char_type*>(__builtin_memset(__s, __a, __n)); }
+
+ static char_type
+ to_char_type(const int_type& __c)
+ { return static_cast<char_type>(__c); }
+
+ // To keep both the byte 0xff and the eof symbol 0xffffffff
+ // from ending up as 0xffffffff.
+ static int_type
+ to_int_type(const char_type& __c)
+ { return static_cast<int_type>(static_cast<unsigned char>(__c)); }
+
+ static bool
+ eq_int_type(const int_type& __c1, const int_type& __c2)
+ { return __c1 == __c2; }
+
+ static int_type
+ eof()
+ { return static_cast<int_type>(_CHAR_TRAITS_EOF); }
+
+ static int_type
+ not_eof(const int_type& __c)
+ { return (__c == eof()) ? 0 : __c; }
+ };
+
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ /// 21.1.3.2 char_traits specializations
+ template<>
+ struct char_traits<wchar_t>
+ {
+ typedef wchar_t char_type;
+ typedef wint_t int_type;
+ typedef streamoff off_type;
+ typedef wstreampos pos_type;
+ typedef mbstate_t state_type;
+
+ static void
+ assign(char_type& __c1, const char_type& __c2)
+ { __c1 = __c2; }
+
+ static bool
+ eq(const char_type& __c1, const char_type& __c2)
+ { return __c1 == __c2; }
+
+ static bool
+ lt(const char_type& __c1, const char_type& __c2)
+ { return __c1 < __c2; }
+
+ static int
+ compare(const char_type* __s1, const char_type* __s2, size_t __n)
+ { return wmemcmp(__s1, __s2, __n); }
+
+ static size_t
+ length(const char_type* __s)
+ { return wcslen(__s); }
+
+ static const char_type*
+ find(const char_type* __s, size_t __n, const char_type& __a)
+ { return wmemchr(__s, __a, __n); }
+
+ static char_type*
+ move(char_type* __s1, const char_type* __s2, size_t __n)
+ { return wmemmove(__s1, __s2, __n); }
+
+ static char_type*
+ copy(char_type* __s1, const char_type* __s2, size_t __n)
+ { return wmemcpy(__s1, __s2, __n); }
+
+ static char_type*
+ assign(char_type* __s, size_t __n, char_type __a)
+ { return wmemset(__s, __a, __n); }
+
+ static char_type
+ to_char_type(const int_type& __c)
+ { return char_type(__c); }
+
+ static int_type
+ to_int_type(const char_type& __c)
+ { return int_type(__c); }
+
+ static bool
+ eq_int_type(const int_type& __c1, const int_type& __c2)
+ { return __c1 == __c2; }
+
+ static int_type
+ eof()
+ { return static_cast<int_type>(WEOF); }
+
+ static int_type
+ not_eof(const int_type& __c)
+ { return eq_int_type(__c, eof()) ? 0 : __c; }
+ };
+#endif //_GLIBCXX_USE_WCHAR_T
+
+_GLIBCXX_END_NAMESPACE
+
+#if (defined(__GXX_EXPERIMENTAL_CXX0X__) \
+ && defined(_GLIBCXX_USE_C99_STDINT_TR1))
+
+#include <cstdint>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<>
+ struct char_traits<char16_t>
+ {
+ typedef char16_t char_type;
+ typedef uint_least16_t int_type;
+ typedef streamoff off_type;
+ typedef u16streampos pos_type;
+ typedef mbstate_t state_type;
+
+ static void
+ assign(char_type& __c1, const char_type& __c2)
+ { __c1 = __c2; }
+
+ static bool
+ eq(const char_type& __c1, const char_type& __c2)
+ { return __c1 == __c2; }
+
+ static bool
+ lt(const char_type& __c1, const char_type& __c2)
+ { return __c1 < __c2; }
+
+ static int
+ compare(const char_type* __s1, const char_type* __s2, size_t __n)
+ {
+ for (size_t __i = 0; __i < __n; ++__i)
+ if (lt(__s1[__i], __s2[__i]))
+ return -1;
+ else if (lt(__s2[__i], __s1[__i]))
+ return 1;
+ return 0;
+ }
+
+ static size_t
+ length(const char_type* __s)
+ {
+ size_t __i = 0;
+ while (!eq(__s[__i], char_type()))
+ ++__i;
+ return __i;
+ }
+
+ static const char_type*
+ find(const char_type* __s, size_t __n, const char_type& __a)
+ {
+ for (size_t __i = 0; __i < __n; ++__i)
+ if (eq(__s[__i], __a))
+ return __s + __i;
+ return 0;
+ }
+
+ static char_type*
+ move(char_type* __s1, const char_type* __s2, size_t __n)
+ {
+ return (static_cast<char_type*>
+ (__builtin_memmove(__s1, __s2, __n * sizeof(char_type))));
+ }
+
+ static char_type*
+ copy(char_type* __s1, const char_type* __s2, size_t __n)
+ {
+ return (static_cast<char_type*>
+ (__builtin_memcpy(__s1, __s2, __n * sizeof(char_type))));
+ }
+
+ static char_type*
+ assign(char_type* __s, size_t __n, char_type __a)
+ {
+ for (size_t __i = 0; __i < __n; ++__i)
+ assign(__s[__i], __a);
+ return __s;
+ }
+
+ static char_type
+ to_char_type(const int_type& __c)
+ { return char_type(__c); }
+
+ static int_type
+ to_int_type(const char_type& __c)
+ { return int_type(__c); }
+
+ static bool
+ eq_int_type(const int_type& __c1, const int_type& __c2)
+ { return __c1 == __c2; }
+
+ static int_type
+ eof()
+ { return static_cast<int_type>(-1); }
+
+ static int_type
+ not_eof(const int_type& __c)
+ { return eq_int_type(__c, eof()) ? 0 : __c; }
+ };
+
+ template<>
+ struct char_traits<char32_t>
+ {
+ typedef char32_t char_type;
+ typedef uint_least32_t int_type;
+ typedef streamoff off_type;
+ typedef u32streampos pos_type;
+ typedef mbstate_t state_type;
+
+ static void
+ assign(char_type& __c1, const char_type& __c2)
+ { __c1 = __c2; }
+
+ static bool
+ eq(const char_type& __c1, const char_type& __c2)
+ { return __c1 == __c2; }
+
+ static bool
+ lt(const char_type& __c1, const char_type& __c2)
+ { return __c1 < __c2; }
+
+ static int
+ compare(const char_type* __s1, const char_type* __s2, size_t __n)
+ {
+ for (size_t __i = 0; __i < __n; ++__i)
+ if (lt(__s1[__i], __s2[__i]))
+ return -1;
+ else if (lt(__s2[__i], __s1[__i]))
+ return 1;
+ return 0;
+ }
+
+ static size_t
+ length(const char_type* __s)
+ {
+ size_t __i = 0;
+ while (!eq(__s[__i], char_type()))
+ ++__i;
+ return __i;
+ }
+
+ static const char_type*
+ find(const char_type* __s, size_t __n, const char_type& __a)
+ {
+ for (size_t __i = 0; __i < __n; ++__i)
+ if (eq(__s[__i], __a))
+ return __s + __i;
+ return 0;
+ }
+
+ static char_type*
+ move(char_type* __s1, const char_type* __s2, size_t __n)
+ {
+ return (static_cast<char_type*>
+ (__builtin_memmove(__s1, __s2, __n * sizeof(char_type))));
+ }
+
+ static char_type*
+ copy(char_type* __s1, const char_type* __s2, size_t __n)
+ {
+ return (static_cast<char_type*>
+ (__builtin_memcpy(__s1, __s2, __n * sizeof(char_type))));
+ }
+
+ static char_type*
+ assign(char_type* __s, size_t __n, char_type __a)
+ {
+ for (size_t __i = 0; __i < __n; ++__i)
+ assign(__s[__i], __a);
+ return __s;
+ }
+
+ static char_type
+ to_char_type(const int_type& __c)
+ { return char_type(__c); }
+
+ static int_type
+ to_int_type(const char_type& __c)
+ { return int_type(__c); }
+
+ static bool
+ eq_int_type(const int_type& __c1, const int_type& __c2)
+ { return __c1 == __c2; }
+
+ static int_type
+ eof()
+ { return static_cast<int_type>(-1); }
+
+ static int_type
+ not_eof(const int_type& __c)
+ { return eq_int_type(__c, eof()) ? 0 : __c; }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
+
+#undef _CHAR_TRAITS_EOF
+
+#endif // _CHAR_TRAITS_H
diff --git a/i686-linux/include/c++/4.4.3/bits/cmath.tcc b/i686-linux/include/c++/4.4.3/bits/cmath.tcc
new file mode 100644
index 0000000..9f4c853
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/cmath.tcc
@@ -0,0 +1,55 @@
+// -*- C++ -*- C math library.
+
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// This file was written by Gabriel Dos Reis <gdr@codesourcery.com>
+
+/** @file cmath.tcc
+ * This is a Standard C++ Library file.
+ */
+
+#ifndef _GLIBCXX_CMATH_TCC
+#define _GLIBCXX_CMATH_TCC 1
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _Tp>
+ inline _Tp
+ __cmath_power(_Tp __x, unsigned int __n)
+ {
+ _Tp __y = __n % 2 ? __x : _Tp(1);
+
+ while (__n >>= 1)
+ {
+ __x = __x * __x;
+ if (__n % 2)
+ __y = __y * __x;
+ }
+
+ return __y;
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/bits/codecvt.h b/i686-linux/include/c++/4.4.3/bits/codecvt.h
new file mode 100644
index 0000000..2dbb498
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/codecvt.h
@@ -0,0 +1,497 @@
+// Locale support (codecvt) -*- C++ -*-
+
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+// 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/codecvt.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 22.2.1.5 Template class codecvt
+//
+
+// Written by Benjamin Kosnik <bkoz@redhat.com>
+
+#ifndef _CODECVT_H
+#define _CODECVT_H 1
+
+#pragma GCC system_header
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /// Empty base class for codecvt facet [22.2.1.5].
+ class codecvt_base
+ {
+ public:
+ enum result
+ {
+ ok,
+ partial,
+ error,
+ noconv
+ };
+ };
+
+ /**
+ * @brief Common base for codecvt functions.
+ *
+ * This template class provides implementations of the public functions
+ * that forward to the protected virtual functions.
+ *
+ * This template also provides abstract stubs for the protected virtual
+ * functions.
+ */
+ template<typename _InternT, typename _ExternT, typename _StateT>
+ class __codecvt_abstract_base
+ : public locale::facet, public codecvt_base
+ {
+ public:
+ // Types:
+ typedef codecvt_base::result result;
+ typedef _InternT intern_type;
+ typedef _ExternT extern_type;
+ typedef _StateT state_type;
+
+ // 22.2.1.5.1 codecvt members
+ /**
+ * @brief Convert from internal to external character set.
+ *
+ * Converts input string of intern_type to output string of
+ * extern_type. This is analogous to wcsrtombs. It does this by
+ * calling codecvt::do_out.
+ *
+ * The source and destination character sets are determined by the
+ * facet's locale, internal and external types.
+ *
+ * The characters in [from,from_end) are converted and written to
+ * [to,to_end). from_next and to_next are set to point to the
+ * character following the last successfully converted character,
+ * respectively. If the result needed no conversion, from_next and
+ * to_next are not affected.
+ *
+ * The @a state argument should be initialized if the input is at the
+ * beginning and carried from a previous call if continuing
+ * conversion. There are no guarantees about how @a state is used.
+ *
+ * The result returned is a member of codecvt_base::result. If
+ * all the input is converted, returns codecvt_base::ok. If no
+ * conversion is necessary, returns codecvt_base::noconv. If
+ * the input ends early or there is insufficient space in the
+ * output, returns codecvt_base::partial. Otherwise the
+ * conversion failed and codecvt_base::error is returned.
+ *
+ * @param state Persistent conversion state data.
+ * @param from Start of input.
+ * @param from_end End of input.
+ * @param from_next Returns start of unconverted data.
+ * @param to Start of output buffer.
+ * @param to_end End of output buffer.
+ * @param to_next Returns start of unused output area.
+ * @return codecvt_base::result.
+ */
+ result
+ out(state_type& __state, const intern_type* __from,
+ const intern_type* __from_end, const intern_type*& __from_next,
+ extern_type* __to, extern_type* __to_end,
+ extern_type*& __to_next) const
+ {
+ return this->do_out(__state, __from, __from_end, __from_next,
+ __to, __to_end, __to_next);
+ }
+
+ /**
+ * @brief Reset conversion state.
+ *
+ * Writes characters to output that would restore @a state to initial
+ * conditions. The idea is that if a partial conversion occurs, then
+ * the converting the characters written by this function would leave
+ * the state in initial conditions, rather than partial conversion
+ * state. It does this by calling codecvt::do_unshift().
+ *
+ * For example, if 4 external characters always converted to 1 internal
+ * character, and input to in() had 6 external characters with state
+ * saved, this function would write two characters to the output and
+ * set the state to initialized conditions.
+ *
+ * The source and destination character sets are determined by the
+ * facet's locale, internal and external types.
+ *
+ * The result returned is a member of codecvt_base::result. If the
+ * state could be reset and data written, returns codecvt_base::ok. If
+ * no conversion is necessary, returns codecvt_base::noconv. If the
+ * output has insufficient space, returns codecvt_base::partial.
+ * Otherwise the reset failed and codecvt_base::error is returned.
+ *
+ * @param state Persistent conversion state data.
+ * @param to Start of output buffer.
+ * @param to_end End of output buffer.
+ * @param to_next Returns start of unused output area.
+ * @return codecvt_base::result.
+ */
+ result
+ unshift(state_type& __state, extern_type* __to, extern_type* __to_end,
+ extern_type*& __to_next) const
+ { return this->do_unshift(__state, __to,__to_end,__to_next); }
+
+ /**
+ * @brief Convert from external to internal character set.
+ *
+ * Converts input string of extern_type to output string of
+ * intern_type. This is analogous to mbsrtowcs. It does this by
+ * calling codecvt::do_in.
+ *
+ * The source and destination character sets are determined by the
+ * facet's locale, internal and external types.
+ *
+ * The characters in [from,from_end) are converted and written to
+ * [to,to_end). from_next and to_next are set to point to the
+ * character following the last successfully converted character,
+ * respectively. If the result needed no conversion, from_next and
+ * to_next are not affected.
+ *
+ * The @a state argument should be initialized if the input is at the
+ * beginning and carried from a previous call if continuing
+ * conversion. There are no guarantees about how @a state is used.
+ *
+ * The result returned is a member of codecvt_base::result. If
+ * all the input is converted, returns codecvt_base::ok. If no
+ * conversion is necessary, returns codecvt_base::noconv. If
+ * the input ends early or there is insufficient space in the
+ * output, returns codecvt_base::partial. Otherwise the
+ * conversion failed and codecvt_base::error is returned.
+ *
+ * @param state Persistent conversion state data.
+ * @param from Start of input.
+ * @param from_end End of input.
+ * @param from_next Returns start of unconverted data.
+ * @param to Start of output buffer.
+ * @param to_end End of output buffer.
+ * @param to_next Returns start of unused output area.
+ * @return codecvt_base::result.
+ */
+ result
+ in(state_type& __state, const extern_type* __from,
+ const extern_type* __from_end, const extern_type*& __from_next,
+ intern_type* __to, intern_type* __to_end,
+ intern_type*& __to_next) const
+ {
+ return this->do_in(__state, __from, __from_end, __from_next,
+ __to, __to_end, __to_next);
+ }
+
+ int
+ encoding() const throw()
+ { return this->do_encoding(); }
+
+ bool
+ always_noconv() const throw()
+ { return this->do_always_noconv(); }
+
+ int
+ length(state_type& __state, const extern_type* __from,
+ const extern_type* __end, size_t __max) const
+ { return this->do_length(__state, __from, __end, __max); }
+
+ int
+ max_length() const throw()
+ { return this->do_max_length(); }
+
+ protected:
+ explicit
+ __codecvt_abstract_base(size_t __refs = 0) : locale::facet(__refs) { }
+
+ virtual
+ ~__codecvt_abstract_base() { }
+
+ /**
+ * @brief Convert from internal to external character set.
+ *
+ * Converts input string of intern_type to output string of
+ * extern_type. This function is a hook for derived classes to change
+ * the value returned. @see out for more information.
+ */
+ virtual result
+ do_out(state_type& __state, const intern_type* __from,
+ const intern_type* __from_end, const intern_type*& __from_next,
+ extern_type* __to, extern_type* __to_end,
+ extern_type*& __to_next) const = 0;
+
+ virtual result
+ do_unshift(state_type& __state, extern_type* __to,
+ extern_type* __to_end, extern_type*& __to_next) const = 0;
+
+ virtual result
+ do_in(state_type& __state, const extern_type* __from,
+ const extern_type* __from_end, const extern_type*& __from_next,
+ intern_type* __to, intern_type* __to_end,
+ intern_type*& __to_next) const = 0;
+
+ virtual int
+ do_encoding() const throw() = 0;
+
+ virtual bool
+ do_always_noconv() const throw() = 0;
+
+ virtual int
+ do_length(state_type&, const extern_type* __from,
+ const extern_type* __end, size_t __max) const = 0;
+
+ virtual int
+ do_max_length() const throw() = 0;
+ };
+
+ /// @brief class codecvt [22.2.1.5].
+ /// NB: Generic, mostly useless implementation.
+ template<typename _InternT, typename _ExternT, typename _StateT>
+ class codecvt
+ : public __codecvt_abstract_base<_InternT, _ExternT, _StateT>
+ {
+ public:
+ // Types:
+ typedef codecvt_base::result result;
+ typedef _InternT intern_type;
+ typedef _ExternT extern_type;
+ typedef _StateT state_type;
+
+ protected:
+ __c_locale _M_c_locale_codecvt;
+
+ public:
+ static locale::id id;
+
+ explicit
+ codecvt(size_t __refs = 0)
+ : __codecvt_abstract_base<_InternT, _ExternT, _StateT> (__refs) { }
+
+ explicit
+ codecvt(__c_locale __cloc, size_t __refs = 0);
+
+ protected:
+ virtual
+ ~codecvt() { }
+
+ virtual result
+ do_out(state_type& __state, const intern_type* __from,
+ const intern_type* __from_end, const intern_type*& __from_next,
+ extern_type* __to, extern_type* __to_end,
+ extern_type*& __to_next) const;
+
+ virtual result
+ do_unshift(state_type& __state, extern_type* __to,
+ extern_type* __to_end, extern_type*& __to_next) const;
+
+ virtual result
+ do_in(state_type& __state, const extern_type* __from,
+ const extern_type* __from_end, const extern_type*& __from_next,
+ intern_type* __to, intern_type* __to_end,
+ intern_type*& __to_next) const;
+
+ virtual int
+ do_encoding() const throw();
+
+ virtual bool
+ do_always_noconv() const throw();
+
+ virtual int
+ do_length(state_type&, const extern_type* __from,
+ const extern_type* __end, size_t __max) const;
+
+ virtual int
+ do_max_length() const throw();
+ };
+
+ template<typename _InternT, typename _ExternT, typename _StateT>
+ locale::id codecvt<_InternT, _ExternT, _StateT>::id;
+
+ /// class codecvt<char, char, mbstate_t> specialization.
+ template<>
+ class codecvt<char, char, mbstate_t>
+ : public __codecvt_abstract_base<char, char, mbstate_t>
+ {
+ public:
+ // Types:
+ typedef char intern_type;
+ typedef char extern_type;
+ typedef mbstate_t state_type;
+
+ protected:
+ __c_locale _M_c_locale_codecvt;
+
+ public:
+ static locale::id id;
+
+ explicit
+ codecvt(size_t __refs = 0);
+
+ explicit
+ codecvt(__c_locale __cloc, size_t __refs = 0);
+
+ protected:
+ virtual
+ ~codecvt();
+
+ virtual result
+ do_out(state_type& __state, const intern_type* __from,
+ const intern_type* __from_end, const intern_type*& __from_next,
+ extern_type* __to, extern_type* __to_end,
+ extern_type*& __to_next) const;
+
+ virtual result
+ do_unshift(state_type& __state, extern_type* __to,
+ extern_type* __to_end, extern_type*& __to_next) const;
+
+ virtual result
+ do_in(state_type& __state, const extern_type* __from,
+ const extern_type* __from_end, const extern_type*& __from_next,
+ intern_type* __to, intern_type* __to_end,
+ intern_type*& __to_next) const;
+
+ virtual int
+ do_encoding() const throw();
+
+ virtual bool
+ do_always_noconv() const throw();
+
+ virtual int
+ do_length(state_type&, const extern_type* __from,
+ const extern_type* __end, size_t __max) const;
+
+ virtual int
+ do_max_length() const throw();
+ };
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ /// class codecvt<wchar_t, char, mbstate_t> specialization.
+ template<>
+ class codecvt<wchar_t, char, mbstate_t>
+ : public __codecvt_abstract_base<wchar_t, char, mbstate_t>
+ {
+ public:
+ // Types:
+ typedef wchar_t intern_type;
+ typedef char extern_type;
+ typedef mbstate_t state_type;
+
+ protected:
+ __c_locale _M_c_locale_codecvt;
+
+ public:
+ static locale::id id;
+
+ explicit
+ codecvt(size_t __refs = 0);
+
+ explicit
+ codecvt(__c_locale __cloc, size_t __refs = 0);
+
+ protected:
+ virtual
+ ~codecvt();
+
+ virtual result
+ do_out(state_type& __state, const intern_type* __from,
+ const intern_type* __from_end, const intern_type*& __from_next,
+ extern_type* __to, extern_type* __to_end,
+ extern_type*& __to_next) const;
+
+ virtual result
+ do_unshift(state_type& __state,
+ extern_type* __to, extern_type* __to_end,
+ extern_type*& __to_next) const;
+
+ virtual result
+ do_in(state_type& __state,
+ const extern_type* __from, const extern_type* __from_end,
+ const extern_type*& __from_next,
+ intern_type* __to, intern_type* __to_end,
+ intern_type*& __to_next) const;
+
+ virtual
+ int do_encoding() const throw();
+
+ virtual
+ bool do_always_noconv() const throw();
+
+ virtual
+ int do_length(state_type&, const extern_type* __from,
+ const extern_type* __end, size_t __max) const;
+
+ virtual int
+ do_max_length() const throw();
+ };
+#endif //_GLIBCXX_USE_WCHAR_T
+
+ /// class codecvt_byname [22.2.1.6].
+ template<typename _InternT, typename _ExternT, typename _StateT>
+ class codecvt_byname : public codecvt<_InternT, _ExternT, _StateT>
+ {
+ public:
+ explicit
+ codecvt_byname(const char* __s, size_t __refs = 0)
+ : codecvt<_InternT, _ExternT, _StateT>(__refs)
+ {
+ if (__builtin_strcmp(__s, "C") != 0
+ && __builtin_strcmp(__s, "POSIX") != 0)
+ {
+ this->_S_destroy_c_locale(this->_M_c_locale_codecvt);
+ this->_S_create_c_locale(this->_M_c_locale_codecvt, __s);
+ }
+ }
+
+ protected:
+ virtual
+ ~codecvt_byname() { }
+ };
+
+ // Inhibit implicit instantiations for required instantiations,
+ // which are defined via explicit instantiations elsewhere.
+ // NB: This syntax is a GNU extension.
+#if _GLIBCXX_EXTERN_TEMPLATE
+ extern template class codecvt_byname<char, char, mbstate_t>;
+
+ extern template
+ const codecvt<char, char, mbstate_t>&
+ use_facet<codecvt<char, char, mbstate_t> >(const locale&);
+
+ extern template
+ bool
+ has_facet<codecvt<char, char, mbstate_t> >(const locale&);
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ extern template class codecvt_byname<wchar_t, char, mbstate_t>;
+
+ extern template
+ const codecvt<wchar_t, char, mbstate_t>&
+ use_facet<codecvt<wchar_t, char, mbstate_t> >(const locale&);
+
+ extern template
+ bool
+ has_facet<codecvt<wchar_t, char, mbstate_t> >(const locale&);
+#endif
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif // _CODECVT_H
diff --git a/i686-linux/include/c++/4.4.3/bits/concept_check.h b/i686-linux/include/c++/4.4.3/bits/concept_check.h
new file mode 100644
index 0000000..6d45e26
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/concept_check.h
@@ -0,0 +1,80 @@
+// Concept-checking control -*- C++ -*-
+
+// Copyright (C) 2001, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file concept_check.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _CONCEPT_CHECK_H
+#define _CONCEPT_CHECK_H 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+
+// All places in libstdc++-v3 where these are used, or /might/ be used, or
+// don't need to be used, or perhaps /should/ be used, are commented with
+// "concept requirements" (and maybe some more text). So grep like crazy
+// if you're looking for additional places to use these.
+
+// Concept-checking code is off by default unless users turn it on via
+// configure options or editing c++config.h.
+
+#ifndef _GLIBCXX_CONCEPT_CHECKS
+
+#define __glibcxx_function_requires(...)
+#define __glibcxx_class_requires(_a,_b)
+#define __glibcxx_class_requires2(_a,_b,_c)
+#define __glibcxx_class_requires3(_a,_b,_c,_d)
+#define __glibcxx_class_requires4(_a,_b,_c,_d,_e)
+
+#else // the checks are on
+
+#include <bits/boost_concept_check.h>
+
+// Note that the obvious and elegant approach of
+//
+//#define glibcxx_function_requires(C) boost::function_requires< boost::C >()
+//
+// won't work due to concept templates with more than one parameter, e.g.,
+// BinaryPredicateConcept. The preprocessor tries to split things up on
+// the commas in the template argument list. We can't use an inner pair of
+// parenthesis to hide the commas, because "boost::(Temp<Foo,Bar>)" isn't
+// a valid instantiation pattern. Thus, we steal a feature from C99.
+
+#define __glibcxx_function_requires(...) \
+ __gnu_cxx::__function_requires< __gnu_cxx::__VA_ARGS__ >();
+#define __glibcxx_class_requires(_a,_C) \
+ _GLIBCXX_CLASS_REQUIRES(_a, __gnu_cxx, _C);
+#define __glibcxx_class_requires2(_a,_b,_C) \
+ _GLIBCXX_CLASS_REQUIRES2(_a, _b, __gnu_cxx, _C);
+#define __glibcxx_class_requires3(_a,_b,_c,_C) \
+ _GLIBCXX_CLASS_REQUIRES3(_a, _b, _c, __gnu_cxx, _C);
+#define __glibcxx_class_requires4(_a,_b,_c,_d,_C) \
+ _GLIBCXX_CLASS_REQUIRES4(_a, _b, _c, _d, __gnu_cxx, _C);
+
+#endif // enable/disable
+
+#endif // _GLIBCXX_CONCEPT_CHECK
diff --git a/i686-linux/include/c++/4.4.3/bits/cpp_type_traits.h b/i686-linux/include/c++/4.4.3/bits/cpp_type_traits.h
new file mode 100644
index 0000000..afb0049
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/cpp_type_traits.h
@@ -0,0 +1,419 @@
+// The -*- C++ -*- type traits classes for internal use in libstdc++
+
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file cpp_type_traits.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+// Written by Gabriel Dos Reis <dosreis@cmla.ens-cachan.fr>
+
+#ifndef _CPP_TYPE_TRAITS_H
+#define _CPP_TYPE_TRAITS_H 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+
+//
+// This file provides some compile-time information about various types.
+// These representations were designed, on purpose, to be constant-expressions
+// and not types as found in <bits/type_traits.h>. In particular, they
+// can be used in control structures and the optimizer hopefully will do
+// the obvious thing.
+//
+// Why integral expressions, and not functions nor types?
+// Firstly, these compile-time entities are used as template-arguments
+// so function return values won't work: We need compile-time entities.
+// We're left with types and constant integral expressions.
+// Secondly, from the point of view of ease of use, type-based compile-time
+// information is -not- *that* convenient. On has to write lots of
+// overloaded functions and to hope that the compiler will select the right
+// one. As a net effect, the overall structure isn't very clear at first
+// glance.
+// Thirdly, partial ordering and overload resolution (of function templates)
+// is highly costly in terms of compiler-resource. It is a Good Thing to
+// keep these resource consumption as least as possible.
+//
+// See valarray_array.h for a case use.
+//
+// -- Gaby (dosreis@cmla.ens-cachan.fr) 2000-03-06.
+//
+// Update 2005: types are also provided and <bits/type_traits.h> has been
+// removed.
+//
+
+// Forward declaration hack, should really include this from somewhere.
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ template<typename _Iterator, typename _Container>
+ class __normal_iterator;
+
+_GLIBCXX_END_NAMESPACE
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ struct __true_type { };
+ struct __false_type { };
+
+ template<bool>
+ struct __truth_type
+ { typedef __false_type __type; };
+
+ template<>
+ struct __truth_type<true>
+ { typedef __true_type __type; };
+
+ // N.B. The conversions to bool are needed due to the issue
+ // explained in c++/19404.
+ template<class _Sp, class _Tp>
+ struct __traitor
+ {
+ enum { __value = bool(_Sp::__value) || bool(_Tp::__value) };
+ typedef typename __truth_type<__value>::__type __type;
+ };
+
+ // Compare for equality of types.
+ template<typename, typename>
+ struct __are_same
+ {
+ enum { __value = 0 };
+ typedef __false_type __type;
+ };
+
+ template<typename _Tp>
+ struct __are_same<_Tp, _Tp>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ // Holds if the template-argument is a void type.
+ template<typename _Tp>
+ struct __is_void
+ {
+ enum { __value = 0 };
+ typedef __false_type __type;
+ };
+
+ template<>
+ struct __is_void<void>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ //
+ // Integer types
+ //
+ template<typename _Tp>
+ struct __is_integer
+ {
+ enum { __value = 0 };
+ typedef __false_type __type;
+ };
+
+ // Thirteen specializations (yes there are eleven standard integer
+ // types; 'long long' and 'unsigned long long' are supported as
+ // extensions)
+ template<>
+ struct __is_integer<bool>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ template<>
+ struct __is_integer<char>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ template<>
+ struct __is_integer<signed char>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ template<>
+ struct __is_integer<unsigned char>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+# ifdef _GLIBCXX_USE_WCHAR_T
+ template<>
+ struct __is_integer<wchar_t>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+# endif
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<>
+ struct __is_integer<char16_t>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ template<>
+ struct __is_integer<char32_t>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+#endif
+
+ template<>
+ struct __is_integer<short>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ template<>
+ struct __is_integer<unsigned short>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ template<>
+ struct __is_integer<int>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ template<>
+ struct __is_integer<unsigned int>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ template<>
+ struct __is_integer<long>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ template<>
+ struct __is_integer<unsigned long>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ template<>
+ struct __is_integer<long long>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ template<>
+ struct __is_integer<unsigned long long>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ //
+ // Floating point types
+ //
+ template<typename _Tp>
+ struct __is_floating
+ {
+ enum { __value = 0 };
+ typedef __false_type __type;
+ };
+
+ // three specializations (float, double and 'long double')
+ template<>
+ struct __is_floating<float>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ template<>
+ struct __is_floating<double>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ template<>
+ struct __is_floating<long double>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ //
+ // Pointer types
+ //
+ template<typename _Tp>
+ struct __is_pointer
+ {
+ enum { __value = 0 };
+ typedef __false_type __type;
+ };
+
+ template<typename _Tp>
+ struct __is_pointer<_Tp*>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ //
+ // Normal iterator type
+ //
+ template<typename _Tp>
+ struct __is_normal_iterator
+ {
+ enum { __value = 0 };
+ typedef __false_type __type;
+ };
+
+ template<typename _Iterator, typename _Container>
+ struct __is_normal_iterator< __gnu_cxx::__normal_iterator<_Iterator,
+ _Container> >
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ //
+ // An arithmetic type is an integer type or a floating point type
+ //
+ template<typename _Tp>
+ struct __is_arithmetic
+ : public __traitor<__is_integer<_Tp>, __is_floating<_Tp> >
+ { };
+
+ //
+ // A fundamental type is `void' or and arithmetic type
+ //
+ template<typename _Tp>
+ struct __is_fundamental
+ : public __traitor<__is_void<_Tp>, __is_arithmetic<_Tp> >
+ { };
+
+ //
+ // A scalar type is an arithmetic type or a pointer type
+ //
+ template<typename _Tp>
+ struct __is_scalar
+ : public __traitor<__is_arithmetic<_Tp>, __is_pointer<_Tp> >
+ { };
+
+ //
+ // For use in std::copy and std::find overloads for streambuf iterators.
+ //
+ template<typename _Tp>
+ struct __is_char
+ {
+ enum { __value = 0 };
+ typedef __false_type __type;
+ };
+
+ template<>
+ struct __is_char<char>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template<>
+ struct __is_char<wchar_t>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+#endif
+
+ template<typename _Tp>
+ struct __is_byte
+ {
+ enum { __value = 0 };
+ typedef __false_type __type;
+ };
+
+ template<>
+ struct __is_byte<char>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ template<>
+ struct __is_byte<signed char>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ template<>
+ struct __is_byte<unsigned char>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ //
+ // Move iterator type
+ //
+ template<typename _Tp>
+ struct __is_move_iterator
+ {
+ enum { __value = 0 };
+ typedef __false_type __type;
+ };
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Iterator>
+ class move_iterator;
+
+ template<typename _Iterator>
+ struct __is_move_iterator< move_iterator<_Iterator> >
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif //_CPP_TYPE_TRAITS_H
diff --git a/i686-linux/include/c++/4.4.3/bits/deque.tcc b/i686-linux/include/c++/4.4.3/bits/deque.tcc
new file mode 100644
index 0000000..aac0d59
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/deque.tcc
@@ -0,0 +1,863 @@
+// Deque implementation (out of line) -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file deque.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _DEQUE_TCC
+#define _DEQUE_TCC 1
+
+_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
+
+ template <typename _Tp, typename _Alloc>
+ deque<_Tp, _Alloc>&
+ deque<_Tp, _Alloc>::
+ operator=(const deque& __x)
+ {
+ const size_type __len = size();
+ if (&__x != this)
+ {
+ if (__len >= __x.size())
+ _M_erase_at_end(std::copy(__x.begin(), __x.end(),
+ this->_M_impl._M_start));
+ else
+ {
+ const_iterator __mid = __x.begin() + difference_type(__len);
+ std::copy(__x.begin(), __mid, this->_M_impl._M_start);
+ insert(this->_M_impl._M_finish, __mid, __x.end());
+ }
+ }
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp, typename _Alloc>
+ template<typename... _Args>
+ void
+ deque<_Tp, _Alloc>::
+ emplace_front(_Args&&... __args)
+ {
+ if (this->_M_impl._M_start._M_cur != this->_M_impl._M_start._M_first)
+ {
+ this->_M_impl.construct(this->_M_impl._M_start._M_cur - 1,
+ std::forward<_Args>(__args)...);
+ --this->_M_impl._M_start._M_cur;
+ }
+ else
+ _M_push_front_aux(std::forward<_Args>(__args)...);
+ }
+
+ template<typename _Tp, typename _Alloc>
+ template<typename... _Args>
+ void
+ deque<_Tp, _Alloc>::
+ emplace_back(_Args&&... __args)
+ {
+ if (this->_M_impl._M_finish._M_cur
+ != this->_M_impl._M_finish._M_last - 1)
+ {
+ this->_M_impl.construct(this->_M_impl._M_finish._M_cur,
+ std::forward<_Args>(__args)...);
+ ++this->_M_impl._M_finish._M_cur;
+ }
+ else
+ _M_push_back_aux(std::forward<_Args>(__args)...);
+ }
+#endif
+
+ template <typename _Tp, typename _Alloc>
+ typename deque<_Tp, _Alloc>::iterator
+ deque<_Tp, _Alloc>::
+ insert(iterator __position, const value_type& __x)
+ {
+ if (__position._M_cur == this->_M_impl._M_start._M_cur)
+ {
+ push_front(__x);
+ return this->_M_impl._M_start;
+ }
+ else if (__position._M_cur == this->_M_impl._M_finish._M_cur)
+ {
+ push_back(__x);
+ iterator __tmp = this->_M_impl._M_finish;
+ --__tmp;
+ return __tmp;
+ }
+ else
+ return _M_insert_aux(__position, __x);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp, typename _Alloc>
+ template<typename... _Args>
+ typename deque<_Tp, _Alloc>::iterator
+ deque<_Tp, _Alloc>::
+ emplace(iterator __position, _Args&&... __args)
+ {
+ if (__position._M_cur == this->_M_impl._M_start._M_cur)
+ {
+ push_front(std::forward<_Args>(__args)...);
+ return this->_M_impl._M_start;
+ }
+ else if (__position._M_cur == this->_M_impl._M_finish._M_cur)
+ {
+ push_back(std::forward<_Args>(__args)...);
+ iterator __tmp = this->_M_impl._M_finish;
+ --__tmp;
+ return __tmp;
+ }
+ else
+ return _M_insert_aux(__position, std::forward<_Args>(__args)...);
+ }
+#endif
+
+ template <typename _Tp, typename _Alloc>
+ typename deque<_Tp, _Alloc>::iterator
+ deque<_Tp, _Alloc>::
+ erase(iterator __position)
+ {
+ iterator __next = __position;
+ ++__next;
+ const difference_type __index = __position - begin();
+ if (static_cast<size_type>(__index) < (size() >> 1))
+ {
+ if (__position != begin())
+ _GLIBCXX_MOVE_BACKWARD3(begin(), __position, __next);
+ pop_front();
+ }
+ else
+ {
+ if (__next != end())
+ _GLIBCXX_MOVE3(__next, end(), __position);
+ pop_back();
+ }
+ return begin() + __index;
+ }
+
+ template <typename _Tp, typename _Alloc>
+ typename deque<_Tp, _Alloc>::iterator
+ deque<_Tp, _Alloc>::
+ erase(iterator __first, iterator __last)
+ {
+ if (__first == begin() && __last == end())
+ {
+ clear();
+ return end();
+ }
+ else
+ {
+ const difference_type __n = __last - __first;
+ const difference_type __elems_before = __first - begin();
+ if (static_cast<size_type>(__elems_before) <= (size() - __n) / 2)
+ {
+ if (__first != begin())
+ _GLIBCXX_MOVE_BACKWARD3(begin(), __first, __last);
+ _M_erase_at_begin(begin() + __n);
+ }
+ else
+ {
+ if (__last != end())
+ _GLIBCXX_MOVE3(__last, end(), __first);
+ _M_erase_at_end(end() - __n);
+ }
+ return begin() + __elems_before;
+ }
+ }
+
+ template <typename _Tp, class _Alloc>
+ template <typename _InputIterator>
+ void
+ deque<_Tp, _Alloc>::
+ _M_assign_aux(_InputIterator __first, _InputIterator __last,
+ std::input_iterator_tag)
+ {
+ iterator __cur = begin();
+ for (; __first != __last && __cur != end(); ++__cur, ++__first)
+ *__cur = *__first;
+ if (__first == __last)
+ _M_erase_at_end(__cur);
+ else
+ insert(end(), __first, __last);
+ }
+
+ template <typename _Tp, typename _Alloc>
+ void
+ deque<_Tp, _Alloc>::
+ _M_fill_insert(iterator __pos, size_type __n, const value_type& __x)
+ {
+ if (__pos._M_cur == this->_M_impl._M_start._M_cur)
+ {
+ iterator __new_start = _M_reserve_elements_at_front(__n);
+ __try
+ {
+ std::__uninitialized_fill_a(__new_start, this->_M_impl._M_start,
+ __x, _M_get_Tp_allocator());
+ this->_M_impl._M_start = __new_start;
+ }
+ __catch(...)
+ {
+ _M_destroy_nodes(__new_start._M_node,
+ this->_M_impl._M_start._M_node);
+ __throw_exception_again;
+ }
+ }
+ else if (__pos._M_cur == this->_M_impl._M_finish._M_cur)
+ {
+ iterator __new_finish = _M_reserve_elements_at_back(__n);
+ __try
+ {
+ std::__uninitialized_fill_a(this->_M_impl._M_finish,
+ __new_finish, __x,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_finish = __new_finish;
+ }
+ __catch(...)
+ {
+ _M_destroy_nodes(this->_M_impl._M_finish._M_node + 1,
+ __new_finish._M_node + 1);
+ __throw_exception_again;
+ }
+ }
+ else
+ _M_insert_aux(__pos, __n, __x);
+ }
+
+ template <typename _Tp, typename _Alloc>
+ void
+ deque<_Tp, _Alloc>::
+ _M_fill_initialize(const value_type& __value)
+ {
+ _Map_pointer __cur;
+ __try
+ {
+ for (__cur = this->_M_impl._M_start._M_node;
+ __cur < this->_M_impl._M_finish._M_node;
+ ++__cur)
+ std::__uninitialized_fill_a(*__cur, *__cur + _S_buffer_size(),
+ __value, _M_get_Tp_allocator());
+ std::__uninitialized_fill_a(this->_M_impl._M_finish._M_first,
+ this->_M_impl._M_finish._M_cur,
+ __value, _M_get_Tp_allocator());
+ }
+ __catch(...)
+ {
+ std::_Destroy(this->_M_impl._M_start, iterator(*__cur, __cur),
+ _M_get_Tp_allocator());
+ __throw_exception_again;
+ }
+ }
+
+ template <typename _Tp, typename _Alloc>
+ template <typename _InputIterator>
+ void
+ deque<_Tp, _Alloc>::
+ _M_range_initialize(_InputIterator __first, _InputIterator __last,
+ std::input_iterator_tag)
+ {
+ this->_M_initialize_map(0);
+ __try
+ {
+ for (; __first != __last; ++__first)
+ push_back(*__first);
+ }
+ __catch(...)
+ {
+ clear();
+ __throw_exception_again;
+ }
+ }
+
+ template <typename _Tp, typename _Alloc>
+ template <typename _ForwardIterator>
+ void
+ deque<_Tp, _Alloc>::
+ _M_range_initialize(_ForwardIterator __first, _ForwardIterator __last,
+ std::forward_iterator_tag)
+ {
+ const size_type __n = std::distance(__first, __last);
+ this->_M_initialize_map(__n);
+
+ _Map_pointer __cur_node;
+ __try
+ {
+ for (__cur_node = this->_M_impl._M_start._M_node;
+ __cur_node < this->_M_impl._M_finish._M_node;
+ ++__cur_node)
+ {
+ _ForwardIterator __mid = __first;
+ std::advance(__mid, _S_buffer_size());
+ std::__uninitialized_copy_a(__first, __mid, *__cur_node,
+ _M_get_Tp_allocator());
+ __first = __mid;
+ }
+ std::__uninitialized_copy_a(__first, __last,
+ this->_M_impl._M_finish._M_first,
+ _M_get_Tp_allocator());
+ }
+ __catch(...)
+ {
+ std::_Destroy(this->_M_impl._M_start,
+ iterator(*__cur_node, __cur_node),
+ _M_get_Tp_allocator());
+ __throw_exception_again;
+ }
+ }
+
+ // Called only if _M_impl._M_finish._M_cur == _M_impl._M_finish._M_last - 1.
+ template<typename _Tp, typename _Alloc>
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename... _Args>
+ void
+ deque<_Tp, _Alloc>::
+ _M_push_back_aux(_Args&&... __args)
+#else
+ void
+ deque<_Tp, _Alloc>::
+ _M_push_back_aux(const value_type& __t)
+#endif
+ {
+ _M_reserve_map_at_back();
+ *(this->_M_impl._M_finish._M_node + 1) = this->_M_allocate_node();
+ __try
+ {
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ this->_M_impl.construct(this->_M_impl._M_finish._M_cur,
+ std::forward<_Args>(__args)...);
+#else
+ this->_M_impl.construct(this->_M_impl._M_finish._M_cur, __t);
+#endif
+ this->_M_impl._M_finish._M_set_node(this->_M_impl._M_finish._M_node
+ + 1);
+ this->_M_impl._M_finish._M_cur = this->_M_impl._M_finish._M_first;
+ }
+ __catch(...)
+ {
+ _M_deallocate_node(*(this->_M_impl._M_finish._M_node + 1));
+ __throw_exception_again;
+ }
+ }
+
+ // Called only if _M_impl._M_start._M_cur == _M_impl._M_start._M_first.
+ template<typename _Tp, typename _Alloc>
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename... _Args>
+ void
+ deque<_Tp, _Alloc>::
+ _M_push_front_aux(_Args&&... __args)
+#else
+ void
+ deque<_Tp, _Alloc>::
+ _M_push_front_aux(const value_type& __t)
+#endif
+ {
+ _M_reserve_map_at_front();
+ *(this->_M_impl._M_start._M_node - 1) = this->_M_allocate_node();
+ __try
+ {
+ this->_M_impl._M_start._M_set_node(this->_M_impl._M_start._M_node
+ - 1);
+ this->_M_impl._M_start._M_cur = this->_M_impl._M_start._M_last - 1;
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ this->_M_impl.construct(this->_M_impl._M_start._M_cur,
+ std::forward<_Args>(__args)...);
+#else
+ this->_M_impl.construct(this->_M_impl._M_start._M_cur, __t);
+#endif
+ }
+ __catch(...)
+ {
+ ++this->_M_impl._M_start;
+ _M_deallocate_node(*(this->_M_impl._M_start._M_node - 1));
+ __throw_exception_again;
+ }
+ }
+
+ // Called only if _M_impl._M_finish._M_cur == _M_impl._M_finish._M_first.
+ template <typename _Tp, typename _Alloc>
+ void deque<_Tp, _Alloc>::
+ _M_pop_back_aux()
+ {
+ _M_deallocate_node(this->_M_impl._M_finish._M_first);
+ this->_M_impl._M_finish._M_set_node(this->_M_impl._M_finish._M_node - 1);
+ this->_M_impl._M_finish._M_cur = this->_M_impl._M_finish._M_last - 1;
+ this->_M_impl.destroy(this->_M_impl._M_finish._M_cur);
+ }
+
+ // Called only if _M_impl._M_start._M_cur == _M_impl._M_start._M_last - 1.
+ // Note that if the deque has at least one element (a precondition for this
+ // member function), and if
+ // _M_impl._M_start._M_cur == _M_impl._M_start._M_last,
+ // then the deque must have at least two nodes.
+ template <typename _Tp, typename _Alloc>
+ void deque<_Tp, _Alloc>::
+ _M_pop_front_aux()
+ {
+ this->_M_impl.destroy(this->_M_impl._M_start._M_cur);
+ _M_deallocate_node(this->_M_impl._M_start._M_first);
+ this->_M_impl._M_start._M_set_node(this->_M_impl._M_start._M_node + 1);
+ this->_M_impl._M_start._M_cur = this->_M_impl._M_start._M_first;
+ }
+
+ template <typename _Tp, typename _Alloc>
+ template <typename _InputIterator>
+ void
+ deque<_Tp, _Alloc>::
+ _M_range_insert_aux(iterator __pos,
+ _InputIterator __first, _InputIterator __last,
+ std::input_iterator_tag)
+ { std::copy(__first, __last, std::inserter(*this, __pos)); }
+
+ template <typename _Tp, typename _Alloc>
+ template <typename _ForwardIterator>
+ void
+ deque<_Tp, _Alloc>::
+ _M_range_insert_aux(iterator __pos,
+ _ForwardIterator __first, _ForwardIterator __last,
+ std::forward_iterator_tag)
+ {
+ const size_type __n = std::distance(__first, __last);
+ if (__pos._M_cur == this->_M_impl._M_start._M_cur)
+ {
+ iterator __new_start = _M_reserve_elements_at_front(__n);
+ __try
+ {
+ std::__uninitialized_copy_a(__first, __last, __new_start,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_start = __new_start;
+ }
+ __catch(...)
+ {
+ _M_destroy_nodes(__new_start._M_node,
+ this->_M_impl._M_start._M_node);
+ __throw_exception_again;
+ }
+ }
+ else if (__pos._M_cur == this->_M_impl._M_finish._M_cur)
+ {
+ iterator __new_finish = _M_reserve_elements_at_back(__n);
+ __try
+ {
+ std::__uninitialized_copy_a(__first, __last,
+ this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_finish = __new_finish;
+ }
+ __catch(...)
+ {
+ _M_destroy_nodes(this->_M_impl._M_finish._M_node + 1,
+ __new_finish._M_node + 1);
+ __throw_exception_again;
+ }
+ }
+ else
+ _M_insert_aux(__pos, __first, __last, __n);
+ }
+
+ template<typename _Tp, typename _Alloc>
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename... _Args>
+ typename deque<_Tp, _Alloc>::iterator
+ deque<_Tp, _Alloc>::
+ _M_insert_aux(iterator __pos, _Args&&... __args)
+ {
+ value_type __x_copy(std::forward<_Args>(__args)...); // XXX copy
+#else
+ typename deque<_Tp, _Alloc>::iterator
+ deque<_Tp, _Alloc>::
+ _M_insert_aux(iterator __pos, const value_type& __x)
+ {
+ value_type __x_copy = __x; // XXX copy
+#endif
+ difference_type __index = __pos - this->_M_impl._M_start;
+ if (static_cast<size_type>(__index) < size() / 2)
+ {
+ push_front(_GLIBCXX_MOVE(front()));
+ iterator __front1 = this->_M_impl._M_start;
+ ++__front1;
+ iterator __front2 = __front1;
+ ++__front2;
+ __pos = this->_M_impl._M_start + __index;
+ iterator __pos1 = __pos;
+ ++__pos1;
+ _GLIBCXX_MOVE3(__front2, __pos1, __front1);
+ }
+ else
+ {
+ push_back(_GLIBCXX_MOVE(back()));
+ iterator __back1 = this->_M_impl._M_finish;
+ --__back1;
+ iterator __back2 = __back1;
+ --__back2;
+ __pos = this->_M_impl._M_start + __index;
+ _GLIBCXX_MOVE_BACKWARD3(__pos, __back2, __back1);
+ }
+ *__pos = _GLIBCXX_MOVE(__x_copy);
+ return __pos;
+ }
+
+ template <typename _Tp, typename _Alloc>
+ void
+ deque<_Tp, _Alloc>::
+ _M_insert_aux(iterator __pos, size_type __n, const value_type& __x)
+ {
+ const difference_type __elems_before = __pos - this->_M_impl._M_start;
+ const size_type __length = this->size();
+ value_type __x_copy = __x;
+ if (__elems_before < difference_type(__length / 2))
+ {
+ iterator __new_start = _M_reserve_elements_at_front(__n);
+ iterator __old_start = this->_M_impl._M_start;
+ __pos = this->_M_impl._M_start + __elems_before;
+ __try
+ {
+ if (__elems_before >= difference_type(__n))
+ {
+ iterator __start_n = (this->_M_impl._M_start
+ + difference_type(__n));
+ std::__uninitialized_move_a(this->_M_impl._M_start,
+ __start_n, __new_start,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_start = __new_start;
+ _GLIBCXX_MOVE3(__start_n, __pos, __old_start);
+ std::fill(__pos - difference_type(__n), __pos, __x_copy);
+ }
+ else
+ {
+ std::__uninitialized_move_fill(this->_M_impl._M_start,
+ __pos, __new_start,
+ this->_M_impl._M_start,
+ __x_copy,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_start = __new_start;
+ std::fill(__old_start, __pos, __x_copy);
+ }
+ }
+ __catch(...)
+ {
+ _M_destroy_nodes(__new_start._M_node,
+ this->_M_impl._M_start._M_node);
+ __throw_exception_again;
+ }
+ }
+ else
+ {
+ iterator __new_finish = _M_reserve_elements_at_back(__n);
+ iterator __old_finish = this->_M_impl._M_finish;
+ const difference_type __elems_after =
+ difference_type(__length) - __elems_before;
+ __pos = this->_M_impl._M_finish - __elems_after;
+ __try
+ {
+ if (__elems_after > difference_type(__n))
+ {
+ iterator __finish_n = (this->_M_impl._M_finish
+ - difference_type(__n));
+ std::__uninitialized_move_a(__finish_n,
+ this->_M_impl._M_finish,
+ this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_finish = __new_finish;
+ _GLIBCXX_MOVE_BACKWARD3(__pos, __finish_n, __old_finish);
+ std::fill(__pos, __pos + difference_type(__n), __x_copy);
+ }
+ else
+ {
+ std::__uninitialized_fill_move(this->_M_impl._M_finish,
+ __pos + difference_type(__n),
+ __x_copy, __pos,
+ this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_finish = __new_finish;
+ std::fill(__pos, __old_finish, __x_copy);
+ }
+ }
+ __catch(...)
+ {
+ _M_destroy_nodes(this->_M_impl._M_finish._M_node + 1,
+ __new_finish._M_node + 1);
+ __throw_exception_again;
+ }
+ }
+ }
+
+ template <typename _Tp, typename _Alloc>
+ template <typename _ForwardIterator>
+ void
+ deque<_Tp, _Alloc>::
+ _M_insert_aux(iterator __pos,
+ _ForwardIterator __first, _ForwardIterator __last,
+ size_type __n)
+ {
+ const difference_type __elemsbefore = __pos - this->_M_impl._M_start;
+ const size_type __length = size();
+ if (static_cast<size_type>(__elemsbefore) < __length / 2)
+ {
+ iterator __new_start = _M_reserve_elements_at_front(__n);
+ iterator __old_start = this->_M_impl._M_start;
+ __pos = this->_M_impl._M_start + __elemsbefore;
+ __try
+ {
+ if (__elemsbefore >= difference_type(__n))
+ {
+ iterator __start_n = (this->_M_impl._M_start
+ + difference_type(__n));
+ std::__uninitialized_move_a(this->_M_impl._M_start,
+ __start_n, __new_start,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_start = __new_start;
+ _GLIBCXX_MOVE3(__start_n, __pos, __old_start);
+ std::copy(__first, __last, __pos - difference_type(__n));
+ }
+ else
+ {
+ _ForwardIterator __mid = __first;
+ std::advance(__mid, difference_type(__n) - __elemsbefore);
+ std::__uninitialized_move_copy(this->_M_impl._M_start,
+ __pos, __first, __mid,
+ __new_start,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_start = __new_start;
+ std::copy(__mid, __last, __old_start);
+ }
+ }
+ __catch(...)
+ {
+ _M_destroy_nodes(__new_start._M_node,
+ this->_M_impl._M_start._M_node);
+ __throw_exception_again;
+ }
+ }
+ else
+ {
+ iterator __new_finish = _M_reserve_elements_at_back(__n);
+ iterator __old_finish = this->_M_impl._M_finish;
+ const difference_type __elemsafter =
+ difference_type(__length) - __elemsbefore;
+ __pos = this->_M_impl._M_finish - __elemsafter;
+ __try
+ {
+ if (__elemsafter > difference_type(__n))
+ {
+ iterator __finish_n = (this->_M_impl._M_finish
+ - difference_type(__n));
+ std::__uninitialized_move_a(__finish_n,
+ this->_M_impl._M_finish,
+ this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_finish = __new_finish;
+ _GLIBCXX_MOVE_BACKWARD3(__pos, __finish_n, __old_finish);
+ std::copy(__first, __last, __pos);
+ }
+ else
+ {
+ _ForwardIterator __mid = __first;
+ std::advance(__mid, __elemsafter);
+ std::__uninitialized_copy_move(__mid, __last, __pos,
+ this->_M_impl._M_finish,
+ this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_finish = __new_finish;
+ std::copy(__first, __mid, __pos);
+ }
+ }
+ __catch(...)
+ {
+ _M_destroy_nodes(this->_M_impl._M_finish._M_node + 1,
+ __new_finish._M_node + 1);
+ __throw_exception_again;
+ }
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ void
+ deque<_Tp, _Alloc>::
+ _M_destroy_data_aux(iterator __first, iterator __last)
+ {
+ for (_Map_pointer __node = __first._M_node + 1;
+ __node < __last._M_node; ++__node)
+ std::_Destroy(*__node, *__node + _S_buffer_size(),
+ _M_get_Tp_allocator());
+
+ if (__first._M_node != __last._M_node)
+ {
+ std::_Destroy(__first._M_cur, __first._M_last,
+ _M_get_Tp_allocator());
+ std::_Destroy(__last._M_first, __last._M_cur,
+ _M_get_Tp_allocator());
+ }
+ else
+ std::_Destroy(__first._M_cur, __last._M_cur,
+ _M_get_Tp_allocator());
+ }
+
+ template <typename _Tp, typename _Alloc>
+ void
+ deque<_Tp, _Alloc>::
+ _M_new_elements_at_front(size_type __new_elems)
+ {
+ if (this->max_size() - this->size() < __new_elems)
+ __throw_length_error(__N("deque::_M_new_elements_at_front"));
+
+ const size_type __new_nodes = ((__new_elems + _S_buffer_size() - 1)
+ / _S_buffer_size());
+ _M_reserve_map_at_front(__new_nodes);
+ size_type __i;
+ __try
+ {
+ for (__i = 1; __i <= __new_nodes; ++__i)
+ *(this->_M_impl._M_start._M_node - __i) = this->_M_allocate_node();
+ }
+ __catch(...)
+ {
+ for (size_type __j = 1; __j < __i; ++__j)
+ _M_deallocate_node(*(this->_M_impl._M_start._M_node - __j));
+ __throw_exception_again;
+ }
+ }
+
+ template <typename _Tp, typename _Alloc>
+ void
+ deque<_Tp, _Alloc>::
+ _M_new_elements_at_back(size_type __new_elems)
+ {
+ if (this->max_size() - this->size() < __new_elems)
+ __throw_length_error(__N("deque::_M_new_elements_at_back"));
+
+ const size_type __new_nodes = ((__new_elems + _S_buffer_size() - 1)
+ / _S_buffer_size());
+ _M_reserve_map_at_back(__new_nodes);
+ size_type __i;
+ __try
+ {
+ for (__i = 1; __i <= __new_nodes; ++__i)
+ *(this->_M_impl._M_finish._M_node + __i) = this->_M_allocate_node();
+ }
+ __catch(...)
+ {
+ for (size_type __j = 1; __j < __i; ++__j)
+ _M_deallocate_node(*(this->_M_impl._M_finish._M_node + __j));
+ __throw_exception_again;
+ }
+ }
+
+ template <typename _Tp, typename _Alloc>
+ void
+ deque<_Tp, _Alloc>::
+ _M_reallocate_map(size_type __nodes_to_add, bool __add_at_front)
+ {
+ const size_type __old_num_nodes
+ = this->_M_impl._M_finish._M_node - this->_M_impl._M_start._M_node + 1;
+ const size_type __new_num_nodes = __old_num_nodes + __nodes_to_add;
+
+ _Map_pointer __new_nstart;
+ if (this->_M_impl._M_map_size > 2 * __new_num_nodes)
+ {
+ __new_nstart = this->_M_impl._M_map + (this->_M_impl._M_map_size
+ - __new_num_nodes) / 2
+ + (__add_at_front ? __nodes_to_add : 0);
+ if (__new_nstart < this->_M_impl._M_start._M_node)
+ std::copy(this->_M_impl._M_start._M_node,
+ this->_M_impl._M_finish._M_node + 1,
+ __new_nstart);
+ else
+ std::copy_backward(this->_M_impl._M_start._M_node,
+ this->_M_impl._M_finish._M_node + 1,
+ __new_nstart + __old_num_nodes);
+ }
+ else
+ {
+ size_type __new_map_size = this->_M_impl._M_map_size
+ + std::max(this->_M_impl._M_map_size,
+ __nodes_to_add) + 2;
+
+ _Map_pointer __new_map = this->_M_allocate_map(__new_map_size);
+ __new_nstart = __new_map + (__new_map_size - __new_num_nodes) / 2
+ + (__add_at_front ? __nodes_to_add : 0);
+ std::copy(this->_M_impl._M_start._M_node,
+ this->_M_impl._M_finish._M_node + 1,
+ __new_nstart);
+ _M_deallocate_map(this->_M_impl._M_map, this->_M_impl._M_map_size);
+
+ this->_M_impl._M_map = __new_map;
+ this->_M_impl._M_map_size = __new_map_size;
+ }
+
+ this->_M_impl._M_start._M_set_node(__new_nstart);
+ this->_M_impl._M_finish._M_set_node(__new_nstart + __old_num_nodes - 1);
+ }
+
+ // Overload for deque::iterators, exploiting the "segmented-iterator
+ // optimization". NB: leave const_iterators alone!
+ template<typename _Tp>
+ void
+ fill(const _Deque_iterator<_Tp, _Tp&, _Tp*>& __first,
+ const _Deque_iterator<_Tp, _Tp&, _Tp*>& __last, const _Tp& __value)
+ {
+ typedef typename _Deque_iterator<_Tp, _Tp&, _Tp*>::_Self _Self;
+
+ for (typename _Self::_Map_pointer __node = __first._M_node + 1;
+ __node < __last._M_node; ++__node)
+ std::fill(*__node, *__node + _Self::_S_buffer_size(), __value);
+
+ if (__first._M_node != __last._M_node)
+ {
+ std::fill(__first._M_cur, __first._M_last, __value);
+ std::fill(__last._M_first, __last._M_cur, __value);
+ }
+ else
+ std::fill(__first._M_cur, __last._M_cur, __value);
+ }
+
+_GLIBCXX_END_NESTED_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/bits/forward_list.h b/i686-linux/include/c++/4.4.3/bits/forward_list.h
new file mode 100644
index 0000000..d49eb4a
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/forward_list.h
@@ -0,0 +1,1306 @@
+// <forward_list.h> -*- C++ -*-
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file forward_list.h
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _FORWARD_LIST_H
+#define _FORWARD_LIST_H 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#else
+
+#include <memory>
+#include <initializer_list>
+#include <ext/cast.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ using __gnu_cxx::__static_pointer_cast;
+ using __gnu_cxx::__const_pointer_cast;
+
+ /**
+ * @brief A helper basic node class for %forward_list.
+ * This is just a linked list with nothing inside it.
+ * There are purely list shuffling utility methods here.
+ */
+ template<typename _Alloc>
+ struct _Fwd_list_node_base
+ {
+ // The type allocated by _Alloc cannot be this type, so we rebind
+ typedef typename _Alloc::template rebind<_Fwd_list_node_base<_Alloc> >
+ ::other::pointer _Pointer;
+ typedef typename _Alloc::template rebind<_Fwd_list_node_base<_Alloc> >
+ ::other::const_pointer _Const_pointer;
+
+ _Pointer _M_next;
+
+ _Fwd_list_node_base() : _M_next(0) { }
+
+ static void
+ swap(_Fwd_list_node_base& __x, _Fwd_list_node_base& __y)
+ { std::swap(__x._M_next, __y._M_next); }
+
+ void
+ _M_transfer_after(_Pointer __bbegin);
+
+ void
+ _M_transfer_after(_Pointer __bbegin, _Pointer __bend);
+
+ void
+ _M_reverse_after();
+ };
+
+ /**
+ * @brief A helper node class for %forward_list.
+ * This is just a linked list with a data value in each node.
+ * There is a sorting utility method.
+ */
+ template<typename _Tp, typename _Alloc>
+ struct _Fwd_list_node : public _Fwd_list_node_base<_Alloc>
+ {
+ typedef typename _Alloc::template rebind<_Fwd_list_node<_Tp, _Alloc> >
+ ::other::pointer _Pointer;
+
+ template<typename... _Args>
+ _Fwd_list_node(_Args&&... __args)
+ : _Fwd_list_node_base<_Alloc>(),
+ _M_value(std::forward<_Args>(__args)...) { }
+
+ template<typename _Comp>
+ void
+ _M_sort_after(_Comp __comp);
+
+ _Tp _M_value;
+ };
+
+ /**
+ * @brief A forward_list::iterator.
+ *
+ * All the functions are op overloads.
+ */
+ template<typename _Tp, typename _Alloc>
+ struct _Fwd_list_iterator
+ {
+ typedef _Fwd_list_iterator<_Tp, _Alloc> _Self;
+ typedef _Fwd_list_node<_Tp, _Alloc> _Node;
+ typedef _Fwd_list_node_base<_Alloc> _Node_base;
+
+ typedef _Tp value_type;
+ typedef typename _Alloc::pointer pointer;
+ typedef typename _Alloc::reference reference;
+ typedef typename _Alloc::difference_type difference_type;
+ typedef std::forward_iterator_tag iterator_category;
+
+ _Fwd_list_iterator() : _M_node() { }
+
+ explicit
+ _Fwd_list_iterator(typename _Node_base::_Pointer __n)
+ : _M_node(__n) { }
+
+ reference
+ operator*() const
+ { return __static_pointer_cast<_Node*>(_M_node)->_M_value; }
+
+ pointer
+ operator->() const
+ { return &__static_pointer_cast<_Node*>(_M_node)->_M_value; }
+
+ _Self&
+ operator++()
+ {
+ _M_node = _M_node->_M_next;
+ return *this;
+ }
+
+ _Self
+ operator++(int)
+ {
+ _Self __tmp(*this);
+ _M_node = _M_node->_M_next;
+ return __tmp;
+ }
+
+ bool
+ operator==(const _Self& __x) const
+ { return _M_node == __x._M_node; }
+
+ bool
+ operator!=(const _Self& __x) const
+ { return _M_node != __x._M_node; }
+
+ _Self
+ _M_next() const
+ {
+ if (_M_node)
+ return _Fwd_list_iterator(_M_node->_M_next);
+ else
+ return _Fwd_list_iterator(0);
+ }
+
+ typename _Node_base::_Pointer _M_node;
+ };
+
+ /**
+ * @brief A forward_list::const_iterator.
+ *
+ * All the functions are op overloads.
+ */
+ template<typename _Tp, typename _Alloc>
+ struct _Fwd_list_const_iterator
+ {
+ typedef _Fwd_list_const_iterator<_Tp, _Alloc> _Self;
+ typedef const _Fwd_list_node<_Tp, _Alloc> _Node;
+ typedef const _Fwd_list_node_base<_Alloc> _Node_base;
+ typedef _Fwd_list_iterator<_Tp, _Alloc> iterator;
+
+ typedef _Tp value_type;
+ typedef typename _Alloc::const_pointer pointer;
+ typedef typename _Alloc::const_reference reference;
+ typedef typename _Alloc::difference_type difference_type;
+ typedef std::forward_iterator_tag iterator_category;
+
+ _Fwd_list_const_iterator() : _M_node() { }
+
+ explicit
+ _Fwd_list_const_iterator(typename _Node_base::_Const_pointer __n)
+ : _M_node(__n) { }
+
+ _Fwd_list_const_iterator(const iterator& __iter)
+ : _M_node(__iter._M_node) { }
+
+ reference
+ operator*() const
+ { return __static_pointer_cast<_Node*>(_M_node)->_M_value; }
+
+ pointer
+ operator->() const
+ { return &__static_pointer_cast<_Node*>(_M_node)->_M_value; }
+
+ _Self&
+ operator++()
+ {
+ _M_node = _M_node->_M_next;
+ return *this;
+ }
+
+ _Self
+ operator++(int)
+ {
+ _Self __tmp(*this);
+ _M_node = _M_node->_M_next;
+ return __tmp;
+ }
+
+ bool
+ operator==(const _Self& __x) const
+ { return _M_node == __x._M_node; }
+
+ bool
+ operator!=(const _Self& __x) const
+ { return _M_node != __x._M_node; }
+
+ _Self
+ _M_next() const
+ {
+ if (this->_M_node)
+ return _Fwd_list_const_iterator(_M_node->_M_next);
+ else
+ return _Fwd_list_const_iterator(0);
+ }
+
+ typename _Node_base::_Const_pointer _M_node;
+ };
+
+ /**
+ * @brief Forward list iterator equality comparison.
+ */
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator==(const _Fwd_list_iterator<_Tp, _Alloc>& __x,
+ const _Fwd_list_const_iterator<_Tp, _Alloc>& __y)
+ { return __x._M_node == __y._M_node; }
+
+ /**
+ * @brief Forward list iterator inequality comparison.
+ */
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator!=(const _Fwd_list_iterator<_Tp, _Alloc>& __x,
+ const _Fwd_list_const_iterator<_Tp, _Alloc>& __y)
+ { return __x._M_node != __y._M_node; }
+
+ /**
+ * @brief Base class for %forward_list.
+ */
+ template<typename _Tp, typename _Alloc>
+ struct _Fwd_list_base
+ {
+ protected:
+ typedef typename _Alloc::template rebind<_Tp>::other _Tp_alloc_type;
+
+ typedef typename _Alloc::template
+ rebind<_Fwd_list_node<_Tp, _Tp_alloc_type>>::other _Node_alloc_type;
+
+ struct _Fwd_list_impl
+ : public _Node_alloc_type
+ {
+ _Fwd_list_node_base<_Tp_alloc_type> _M_head;
+
+ _Fwd_list_impl()
+ : _Node_alloc_type(), _M_head()
+ { }
+
+ _Fwd_list_impl(const _Node_alloc_type& __a)
+ : _Node_alloc_type(__a), _M_head()
+ { }
+ };
+
+ _Fwd_list_impl _M_impl;
+
+ public:
+ typedef _Fwd_list_iterator<_Tp, _Tp_alloc_type> iterator;
+ typedef _Fwd_list_const_iterator<_Tp, _Tp_alloc_type> const_iterator;
+
+ typedef _Fwd_list_node<_Tp, _Tp_alloc_type> _Node;
+ typedef _Fwd_list_node_base<_Tp_alloc_type> _Node_base;
+
+ _Node_alloc_type&
+ _M_get_Node_allocator()
+ { return *static_cast<_Node_alloc_type*>(&this->_M_impl); }
+
+ const _Node_alloc_type&
+ _M_get_Node_allocator() const
+ { return *static_cast<const _Node_alloc_type*>(&this->_M_impl); }
+
+ _Fwd_list_base()
+ : _M_impl()
+ { this->_M_impl._M_head._M_next = 0; }
+
+ _Fwd_list_base(const _Alloc& __a)
+ : _M_impl(__a)
+ { this->_M_impl._M_head._M_next = 0; }
+
+ _Fwd_list_base(const _Fwd_list_base& __lst, const _Alloc& __a);
+
+ _Fwd_list_base(_Fwd_list_base&& __lst, const _Alloc& __a)
+ : _M_impl(__a)
+ { _Node_base::swap(this->_M_impl._M_head,
+ __lst._M_impl._M_head); }
+
+ _Fwd_list_base(_Fwd_list_base&& __lst)
+ : _M_impl(__lst._M_get_Node_allocator())
+ { _Node_base::swap(this->_M_impl._M_head,
+ __lst._M_impl._M_head); }
+
+ ~_Fwd_list_base()
+ { _M_erase_after(&_M_impl._M_head, 0); }
+
+ protected:
+
+ typename _Node::_Pointer
+ _M_get_node()
+ { return _M_get_Node_allocator().allocate(1); }
+
+ template<typename... _Args>
+ typename _Node::_Pointer
+ _M_create_node(_Args&&... __args)
+ {
+ typename _Node::_Pointer __node = this->_M_get_node();
+ __try
+ {
+ _M_get_Node_allocator().construct(__node,
+ std::forward<_Args>(__args)...);
+ __node->_M_next = 0;
+ }
+ __catch(...)
+ {
+ this->_M_put_node(__node);
+ __throw_exception_again;
+ }
+ return __node;
+ }
+
+ template<typename... _Args>
+ typename _Node_base::_Pointer
+ _M_insert_after(const_iterator __pos, _Args&&... __args);
+
+ void
+ _M_put_node(typename _Node::_Pointer __p)
+ { _M_get_Node_allocator().deallocate(__p, 1); }
+
+ typename _Node_base::_Pointer
+ _M_erase_after(typename _Node_base::_Pointer __pos);
+
+ typename _Node_base::_Pointer
+ _M_erase_after(typename _Node_base::_Pointer __pos,
+ typename _Node_base::_Pointer __last);
+ };
+
+ /**
+ * @brief A standard container with linear time access to elements,
+ * and fixed time insertion/deletion at any point in the sequence.
+ *
+ * @ingroup sequences
+ *
+ * Meets the requirements of a <a href="tables.html#65">container</a>, a
+ * <a href="tables.html#67">sequence</a>, including the
+ * <a href="tables.html#68">optional sequence requirements</a> with the
+ * %exception of @c at and @c operator[].
+ *
+ * This is a @e singly @e linked %list. Traversal up the
+ * %list requires linear time, but adding and removing elements (or
+ * @e nodes) is done in constant time, regardless of where the
+ * change takes place. Unlike std::vector and std::deque,
+ * random-access iterators are not provided, so subscripting ( @c
+ * [] ) access is not allowed. For algorithms which only need
+ * sequential access, this lack makes no difference.
+ *
+ * Also unlike the other standard containers, std::forward_list provides
+ * specialized algorithms %unique to linked lists, such as
+ * splicing, sorting, and in-place reversal.
+ *
+ * A couple points on memory allocation for forward_list<Tp>:
+ *
+ * First, we never actually allocate a Tp, we allocate
+ * Fwd_list_node<Tp>'s and trust [20.1.5]/4 to DTRT. This is to ensure
+ * that after elements from %forward_list<X,Alloc1> are spliced into
+ * %forward_list<X,Alloc2>, destroying the memory of the second %list is a
+ * valid operation, i.e., Alloc1 giveth and Alloc2 taketh away.
+ */
+ template<typename _Tp, typename _Alloc = allocator<_Tp> >
+ class forward_list : private _Fwd_list_base<_Tp, _Alloc>
+ {
+ private:
+ typedef _Fwd_list_base<_Tp, _Alloc> _Base;
+ typedef typename _Base::_Node _Node;
+ typedef typename _Base::_Node_base _Node_base;
+ typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
+
+ public:
+ // types:
+ typedef _Tp value_type;
+ typedef typename _Tp_alloc_type::pointer pointer;
+ typedef typename _Tp_alloc_type::const_pointer const_pointer;
+ typedef typename _Tp_alloc_type::reference reference;
+ typedef typename _Tp_alloc_type::const_reference const_reference;
+
+ typedef typename _Base::iterator iterator;
+ typedef typename _Base::const_iterator const_iterator;
+ typedef std::size_t size_type;
+ typedef std::ptrdiff_t difference_type;
+ typedef _Alloc allocator_type;
+
+ // 23.2.3.1 construct/copy/destroy:
+
+ /**
+ * @brief Creates a %forward_list with no elements.
+ * @param al An allocator object.
+ */
+ explicit
+ forward_list(const _Alloc& __al = _Alloc())
+ : _Base(__al)
+ { }
+
+ /**
+ * @brief Copy constructor with allocator argument.
+ * @param list Input list to copy.
+ * @param al An allocator object.
+ */
+ forward_list(const forward_list& __list, const _Alloc& __al)
+ : _Base(__list, __al)
+ { }
+
+ /**
+ * @brief Move constructor with allocator argument.
+ * @param list Input list to move.
+ * @param al An allocator object.
+ */
+ forward_list(forward_list&& __list, const _Alloc& __al)
+ : _Base(std::forward<_Base>(__list), __al)
+ { }
+
+ /**
+ * @brief Creates a %forward_list with copies of the default element
+ * type.
+ * @param n The number of elements to initially create.
+ *
+ * This constructor fills the %forward_list with @a n copies of
+ * the default value.
+ */
+ explicit
+ forward_list(size_type __n)
+ : _Base()
+ { _M_fill_initialize(__n, value_type()); }
+
+ /**
+ * @brief Creates a %forward_list with copies of an exemplar element.
+ * @param n The number of elements to initially create.
+ * @param value An element to copy.
+ * @param al An allocator object.
+ *
+ * This constructor fills the %forward_list with @a n copies of @a
+ * value.
+ */
+ forward_list(size_type __n, const _Tp& __value,
+ const _Alloc& __al = _Alloc())
+ : _Base(__al)
+ { _M_fill_initialize(__n, __value); }
+
+ /**
+ * @brief Builds a %forward_list from a range.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param al An allocator object.
+ *
+ * Create a %forward_list consisting of copies of the elements from
+ * [@a first,@a last). This is linear in N (where N is
+ * distance(@a first,@a last)).
+ */
+ template<typename _InputIterator>
+ forward_list(_InputIterator __first, _InputIterator __last,
+ const _Alloc& __al = _Alloc())
+ : _Base(__al)
+ {
+ // Check whether it's an integral type. If so, it's not an iterator.
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ _M_initialize_dispatch(__first, __last, _Integral());
+ }
+
+ /**
+ * @brief The %forward_list copy constructor.
+ * @param list A %forward_list of identical element and allocator
+ * types.
+ *
+ * The newly-created %forward_list uses a copy of the allocation
+ * object used by @a list.
+ */
+ forward_list(const forward_list& __list)
+ : _Base(__list.get_allocator())
+ { _M_initialize_dispatch(__list.begin(), __list.end(), __false_type()); }
+
+ /**
+ * @brief The %forward_list move constructor.
+ * @param list A %forward_list of identical element and allocator
+ * types.
+ *
+ * The newly-created %forward_list contains the exact contents of @a
+ * forward_list. The contents of @a list are a valid, but unspecified
+ * %forward_list.
+ */
+ forward_list(forward_list&& __list)
+ : _Base(std::forward<_Base>(__list)) { }
+
+ /**
+ * @brief Builds a %forward_list from an initializer_list
+ * @param il An initializer_list of value_type.
+ * @param al An allocator object.
+ *
+ * Create a %forward_list consisting of copies of the elements
+ * in the initializer_list @a il. This is linear in il.size().
+ */
+ forward_list(std::initializer_list<_Tp> __il,
+ const _Alloc& __al = _Alloc())
+ : _Base(__al)
+ { _M_initialize_dispatch(__il.begin(), __il.end(), __false_type()); }
+
+ /**
+ * @brief The forward_list dtor.
+ */
+ ~forward_list()
+ { _M_erase_after(&this->_M_impl._M_head, 0); }
+
+ /**
+ * @brief The %forward_list assignment operator.
+ * @param list A %forward_list of identical element and allocator
+ * types.
+ *
+ * All the elements of @a list are copied, but unlike the copy
+ * constructor, the allocator object is not copied.
+ */
+ forward_list&
+ operator=(const forward_list& __list);
+
+ /**
+ * @brief The %forward_list move assignment operator.
+ * @param list A %forward_list of identical element and allocator
+ * types.
+ *
+ * The contents of @a list are moved into this %forward_list
+ * (without copying). @a list is a valid, but unspecified
+ * %forward_list
+ */
+ forward_list&
+ operator=(forward_list&& __list)
+ {
+ if (&__list != this)
+ {
+ this->clear();
+ this->swap(__list);
+ }
+ return *this;
+ }
+
+ /**
+ * @brief The %forward_list initializer list assignment operator.
+ * @param il An initializer_list of value_type.
+ *
+ * Replace the contents of the %forward_list with copies of the
+ * elements in the initializer_list @a il. This is linear in
+ * il.size().
+ */
+ forward_list&
+ operator=(std::initializer_list<_Tp> __il)
+ {
+ assign(__il);
+ return *this;
+ }
+
+ /**
+ * @brief Assigns a range to a %forward_list.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ *
+ * This function fills a %forward_list with copies of the elements
+ * in the range [@a first,@a last).
+ *
+ * Note that the assignment completely changes the %forward_list and
+ * that the resulting %forward_list's size is the same as the number
+ * of elements assigned. Old data may be lost.
+ */
+ template<typename _InputIterator>
+ void
+ assign(_InputIterator __first, _InputIterator __last)
+ {
+ clear();
+ insert_after(cbefore_begin(), __first, __last);
+ }
+
+ /**
+ * @brief Assigns a given value to a %forward_list.
+ * @param n Number of elements to be assigned.
+ * @param val Value to be assigned.
+ *
+ * This function fills a %forward_list with @a n copies of the given
+ * value. Note that the assignment completely changes the
+ * %forward_list and that the resulting %forward_list's size is the
+ * same as the number of elements assigned. Old data may be lost.
+ */
+ void
+ assign(size_type __n, const _Tp& __val)
+ {
+ clear();
+ insert_after(cbefore_begin(), __n, __val);
+ }
+
+ /**
+ * @brief Assigns an initializer_list to a %forward_list.
+ * @param il An initializer_list of value_type.
+ *
+ * Replace the contents of the %forward_list with copies of the
+ * elements in the initializer_list @a il. This is linear in
+ * il.size().
+ */
+ void
+ assign(std::initializer_list<_Tp> __il)
+ {
+ clear();
+ insert_after(cbefore_begin(), __il);
+ }
+
+ /// Get a copy of the memory allocation object.
+ allocator_type
+ get_allocator() const
+ { return this->_M_get_Node_allocator(); }
+
+ // 23.2.3.2 iterators:
+
+ /**
+ * Returns a read/write iterator that points before the first element
+ * in the %forward_list. Iteration is done in ordinary element order.
+ */
+ iterator
+ before_begin()
+ { return iterator(&this->_M_impl._M_head); }
+
+ /**
+ * Returns a read-only (constant) iterator that points before the
+ * first element in the %forward_list. Iteration is done in ordinary
+ * element order.
+ */
+ const_iterator
+ before_begin() const
+ { return const_iterator(&this->_M_impl._M_head); }
+
+ /**
+ * Returns a read/write iterator that points to the first element
+ * in the %forward_list. Iteration is done in ordinary element order.
+ */
+ iterator
+ begin()
+ { return iterator(this->_M_impl._M_head._M_next); }
+
+ /**
+ * Returns a read-only (constant) iterator that points to the first
+ * element in the %forward_list. Iteration is done in ordinary
+ * element order.
+ */
+ const_iterator
+ begin() const
+ { return const_iterator(this->_M_impl._M_head._M_next); }
+
+ /**
+ * Returns a read/write iterator that points one past the last
+ * element in the %forward_list. Iteration is done in ordinary
+ * element order.
+ */
+ iterator
+ end()
+ { return iterator(0); }
+
+ /**
+ * Returns a read-only iterator that points one past the last
+ * element in the %forward_list. Iteration is done in ordinary
+ * element order.
+ */
+ const_iterator
+ end() const
+ { return const_iterator(0); }
+
+ /**
+ * Returns a read-only (constant) iterator that points to the
+ * first element in the %forward_list. Iteration is done in ordinary
+ * element order.
+ */
+ const_iterator
+ cbegin() const
+ { return const_iterator(this->_M_impl._M_head._M_next); }
+
+ /**
+ * Returns a read-only (constant) iterator that points before the
+ * first element in the %forward_list. Iteration is done in ordinary
+ * element order.
+ */
+ const_iterator
+ cbefore_begin() const
+ { return const_iterator(&this->_M_impl._M_head); }
+
+ /**
+ * Returns a read-only (constant) iterator that points one past
+ * the last element in the %forward_list. Iteration is done in
+ * ordinary element order.
+ */
+ const_iterator
+ cend() const
+ { return const_iterator(0); }
+
+ /**
+ * Returns true if the %forward_list is empty. (Thus begin() would
+ * equal end().)
+ */
+ bool
+ empty() const
+ { return this->_M_impl._M_head._M_next == 0; }
+
+ /**
+ * Returns the largest possible size of %forward_list.
+ */
+ size_type
+ max_size() const
+ { return this->_M_get_Node_allocator().max_size(); }
+
+ // 23.2.3.3 element access:
+
+ /**
+ * Returns a read/write reference to the data at the first
+ * element of the %forward_list.
+ */
+ reference
+ front()
+ {
+ _Node* __front =
+ __static_pointer_cast<_Node*>(this->_M_impl._M_head._M_next);
+ return __front->_M_value;
+ }
+
+ /**
+ * Returns a read-only (constant) reference to the data at the first
+ * element of the %forward_list.
+ */
+ const_reference
+ front() const
+ {
+ _Node* __front =
+ __static_pointer_cast<_Node*>(this->_M_impl._M_head._M_next);
+ return __front->_M_value;
+ }
+
+ // 23.2.3.4 modiï¬ers:
+
+ /**
+ * @brief Constructs object in %forward_list at the front of the
+ * list.
+ * @param args Arguments.
+ *
+ * This function will insert an object of type Tp constructed
+ * with Tp(std::forward<Args>(args)...) at the front of the list
+ * Due to the nature of a %forward_list this operation can
+ * be done in constant time, and does not invalidate iterators
+ * and references.
+ */
+ template<typename... _Args>
+ void
+ emplace_front(_Args&&... __args)
+ { this->_M_insert_after(cbefore_begin(),
+ std::forward<_Args>(__args)...); }
+
+ /**
+ * @brief Add data to the front of the %forward_list.
+ * @param val Data to be added.
+ *
+ * This is a typical stack operation. The function creates an
+ * element at the front of the %forward_list and assigns the given
+ * data to it. Due to the nature of a %forward_list this operation
+ * can be done in constant time, and does not invalidate iterators
+ * and references.
+ */
+ void
+ push_front(const _Tp& __val)
+ { this->_M_insert_after(cbefore_begin(), __val); }
+
+ /**
+ *
+ */
+ void
+ push_front(_Tp&& __val)
+ { this->_M_insert_after(cbefore_begin(), std::move(__val)); }
+
+ /**
+ * @brief Removes first element.
+ *
+ * This is a typical stack operation. It shrinks the %forward_list
+ * by one. Due to the nature of a %forward_list this operation can
+ * be done in constant time, and only invalidates iterators/references
+ * to the element being removed.
+ *
+ * Note that no data is returned, and if the first element's data
+ * is needed, it should be retrieved before pop_front() is
+ * called.
+ */
+ void
+ pop_front()
+ { this->_M_erase_after(&this->_M_impl._M_head); }
+
+ /**
+ * @brief Constructs object in %forward_list after the specified
+ * iterator.
+ * @param pos A const_iterator into the %forward_list.
+ * @param args Arguments.
+ * @return An iterator that points to the inserted data.
+ *
+ * This function will insert an object of type T constructed
+ * with T(std::forward<Args>(args)...) after the specified
+ * location. Due to the nature of a %forward_list this operation can
+ * be done in constant time, and does not invalidate iterators
+ * and references.
+ */
+ template<typename... _Args>
+ iterator
+ emplace_after(const_iterator __pos, _Args&&... __args)
+ { return iterator(this->_M_insert_after(__pos,
+ std::forward<_Args>(__args)...)); }
+
+ /**
+ * @brief Inserts given value into %forward_list after specified
+ * iterator.
+ * @param pos An iterator into the %forward_list.
+ * @param val Data to be inserted.
+ * @return An iterator that points to the inserted data.
+ *
+ * This function will insert a copy of the given value after
+ * the specified location. Due to the nature of a %forward_list this
+ * operation can be done in constant time, and does not
+ * invalidate iterators and references.
+ */
+ iterator
+ insert_after(const_iterator __pos, const _Tp& __val)
+ { return iterator(this->_M_insert_after(__pos, __val)); }
+
+ /**
+ *
+ */
+ iterator
+ insert_after(const_iterator __pos, _Tp&& __val)
+ { return iterator(this->_M_insert_after(__pos, std::move(__val))); }
+
+ /**
+ * @brief Inserts a number of copies of given data into the
+ * %forward_list.
+ * @param pos An iterator into the %forward_list.
+ * @param n Number of elements to be inserted.
+ * @param val Data to be inserted.
+ *
+ * This function will insert a specified number of copies of the
+ * given data after the location specified by @a pos.
+ *
+ * This operation is linear in the number of elements inserted and
+ * does not invalidate iterators and references.
+ */
+ void
+ insert_after(const_iterator __pos, size_type __n, const _Tp& __val)
+ {
+ forward_list __tmp(__n, __val, this->get_allocator());
+ this->splice_after(__pos, std::move(__tmp));
+ }
+
+ /**
+ * @brief Inserts a range into the %forward_list.
+ * @param position An iterator into the %forward_list.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ *
+ * This function will insert copies of the data in the range [@a
+ * first,@a last) into the %forward_list after the location specified
+ * by @a pos.
+ *
+ * This operation is linear in the number of elements inserted and
+ * does not invalidate iterators and references.
+ */
+ template<typename _InputIterator>
+ void
+ insert_after(const_iterator __pos,
+ _InputIterator __first, _InputIterator __last)
+ {
+ forward_list __tmp(__first, __last, this->get_allocator());
+ this->splice_after(__pos, std::move(__tmp));
+ }
+
+ /**
+ * @brief Inserts the contents of an initializer_list into
+ * %forward_list after the specified iterator.
+ * @param pos An iterator into the %forward_list.
+ * @param il An initializer_list of value_type.
+ *
+ * This function will insert copies of the data in the
+ * initializer_list @a il into the %forward_list before the location
+ * specified by @a pos.
+ *
+ * This operation is linear in the number of elements inserted and
+ * does not invalidate iterators and references.
+ */
+ void
+ insert_after(const_iterator __pos, std::initializer_list<_Tp> __il)
+ {
+ forward_list __tmp(__il, this->get_allocator());
+ this->splice_after(__pos, std::move(__tmp));
+ }
+
+ /**
+ * @brief Removes the element pointed to by the iterator following
+ * @c pos.
+ * @param pos Iterator pointing to element to be erased.
+ * @return An iterator pointing to the next element (or end()).
+ *
+ * This function will erase the element at the given position and
+ * thus shorten the %forward_list by one.
+ *
+ * Due to the nature of a %forward_list this operation can be done
+ * in constant time, and only invalidates iterators/references to
+ * the element being removed. The user is also cautioned that
+ * this function only erases the element, and that if the element
+ * is itself a pointer, the pointed-to memory is not touched in
+ * any way. Managing the pointer is the user's responsibility.
+ */
+ iterator
+ erase_after(const_iterator __pos)
+ {
+ _Node_base* __tmp = __const_pointer_cast<_Node_base*>(__pos._M_node);
+ if (__tmp)
+ return iterator(this->_M_erase_after(__tmp));
+ else
+ return end();
+ }
+
+ /**
+ * @brief Remove a range of elements.
+ * @param pos Iterator pointing before the first element to be
+ * erased.
+ * @param last Iterator pointing to one past the last element to be
+ * erased.
+ * @return An iterator pointing to the element pointed to by @a last
+ * prior to erasing (or end()).
+ *
+ * This function will erase the elements in the range @a
+ * (pos,last) and shorten the %forward_list accordingly.
+ *
+ * This operation is linear time in the size of the range and only
+ * invalidates iterators/references to the element being removed.
+ * The user is also cautioned that this function only erases the
+ * elements, and that if the elements themselves are pointers, the
+ * pointed-to memory is not touched in any way. Managing the pointer
+ * is the user's responsibility.
+ */
+ iterator
+ erase_after(const_iterator __pos, iterator __last)
+ {
+ _Node_base* __tmp = __const_pointer_cast<_Node_base*>(__pos._M_node);
+ return iterator(this->_M_erase_after(__tmp, &*__last._M_node));
+ }
+
+ /**
+ * @brief Swaps data with another %forward_list.
+ * @param list A %forward_list of the same element and allocator
+ * types.
+ *
+ * This exchanges the elements between two lists in constant
+ * time. Note that the global std::swap() function is
+ * specialized such that std::swap(l1,l2) will feed to this
+ * function.
+ */
+ void
+ swap(forward_list&& __list)
+ { _Node_base::swap(this->_M_impl._M_head, __list._M_impl._M_head); }
+
+ /**
+ * @brief Resizes the %forward_list to the specified number of
+ * elements.
+ * @param sz Number of elements the %forward_list should contain.
+ *
+ * This function will %resize the %forward_list to the specified
+ * number of elements. If the number is smaller than the
+ * %forward_list's current size the %forward_list is truncated,
+ * otherwise the %forward_list is extended and new elements are
+ * populated with given data.
+ */
+ void
+ resize(size_type __sz)
+ { resize(__sz, _Tp()); }
+
+ /**
+ * @brief Resizes the %forward_list to the specified number of
+ * elements.
+ * @param sz Number of elements the %forward_list should contain.
+ * @param val Data with which new elements should be populated.
+ *
+ * This function will %resize the %forward_list to the specified
+ * number of elements. If the number is smaller than the
+ * %forward_list's current size the %forward_list is truncated,
+ * otherwise the %forward_list is extended and new elements are
+ * populated with given data.
+ */
+ void
+ resize(size_type __sz, value_type __val);
+
+ /**
+ * @brief Erases all the elements.
+ *
+ * Note that this function only erases
+ * the elements, and that if the elements themselves are
+ * pointers, the pointed-to memory is not touched in any way.
+ * Managing the pointer is the user's responsibility.
+ */
+ void
+ clear()
+ { this->_M_erase_after(&this->_M_impl._M_head, 0); }
+
+ // 23.2.3.5 forward_list operations:
+
+ /**
+ * @brief Insert contents of another %forward_list.
+ * @param pos Iterator referencing the element to insert after.
+ * @param list Source list.
+ *
+ * The elements of @a list are inserted in constant time after
+ * the element referenced by @a pos. @a list becomes an empty
+ * list.
+ *
+ * Requires this != @a x.
+ */
+ void
+ splice_after(const_iterator __pos, forward_list&& __list);
+
+ /**
+ * @brief Insert element from another %forward_list.
+ * @param pos Iterator referencing the element to insert after.
+ * @param list Source list.
+ * @param it Iterator referencing the element before the element
+ * to move.
+ *
+ * Removes the element in list @a list referenced by @a i and
+ * inserts it into the current list after @a pos.
+ */
+ void
+ splice_after(const_iterator __pos, forward_list&& __list,
+ const_iterator __it)
+ { this->splice_after(__pos, __list, __it, __it._M_next()); }
+
+ /**
+ * @brief Insert range from another %forward_list.
+ * @param pos Iterator referencing the element to insert after.
+ * @param list Source list.
+ * @param before Iterator referencing before the start of range
+ * in list.
+ * @param last Iterator referencing the end of range in list.
+ *
+ * Removes elements in the range (before,last) and inserts them
+ * after @a pos in constant time.
+ *
+ * Undefined if @a pos is in (before,last).
+ */
+ void
+ splice_after(const_iterator __pos, forward_list&& __list,
+ const_iterator __before, const_iterator __last);
+
+ /**
+ * @brief Remove all elements equal to value.
+ * @param val The value to remove.
+ *
+ * Removes every element in the list equal to @a value.
+ * Remaining elements stay in list order. Note that this
+ * function only erases the elements, and that if the elements
+ * themselves are pointers, the pointed-to memory is not
+ * touched in any way. Managing the pointer is the user's
+ * responsibility.
+ */
+ void
+ remove(const _Tp& __val);
+
+ /**
+ * @brief Remove all elements satisfying a predicate.
+ * @param pred Unary predicate function or object.
+ *
+ * Removes every element in the list for which the predicate
+ * returns true. Remaining elements stay in list order. Note
+ * that this function only erases the elements, and that if the
+ * elements themselves are pointers, the pointed-to memory is
+ * not touched in any way. Managing the pointer is the user's
+ * responsibility.
+ */
+ template<typename _Pred>
+ void
+ remove_if(_Pred __pred);
+
+ /**
+ * @brief Remove consecutive duplicate elements.
+ *
+ * For each consecutive set of elements with the same value,
+ * remove all but the first one. Remaining elements stay in
+ * list order. Note that this function only erases the
+ * elements, and that if the elements themselves are pointers,
+ * the pointed-to memory is not touched in any way. Managing
+ * the pointer is the user's responsibility.
+ */
+ void
+ unique()
+ { this->unique(std::equal_to<_Tp>()); }
+
+ /**
+ * @brief Remove consecutive elements satisfying a predicate.
+ * @param binary_pred Binary predicate function or object.
+ *
+ * For each consecutive set of elements [first,last) that
+ * satisfy predicate(first,i) where i is an iterator in
+ * [first,last), remove all but the first one. Remaining
+ * elements stay in list order. Note that this function only
+ * erases the elements, and that if the elements themselves are
+ * pointers, the pointed-to memory is not touched in any way.
+ * Managing the pointer is the user's responsibility.
+ */
+ template<typename _BinPred>
+ void
+ unique(_BinPred __binary_pred);
+
+ /**
+ * @brief Merge sorted lists.
+ * @param list Sorted list to merge.
+ *
+ * Assumes that both @a list and this list are sorted according to
+ * operator<(). Merges elements of @a list into this list in
+ * sorted order, leaving @a list empty when complete. Elements in
+ * this list precede elements in @a list that are equal.
+ */
+ void
+ merge(forward_list&& __list)
+ { this->merge(__list, std::less<_Tp>()); }
+
+ /**
+ * @brief Merge sorted lists according to comparison function.
+ * @param list Sorted list to merge.
+ * @param comp Comparison function defining sort order.
+ *
+ * Assumes that both @a list and this list are sorted according to
+ * comp. Merges elements of @a list into this list
+ * in sorted order, leaving @a list empty when complete. Elements
+ * in this list precede elements in @a list that are equivalent
+ * according to comp().
+ */
+ template<typename _Comp>
+ void
+ merge(forward_list&& __list, _Comp __comp);
+
+ /**
+ * @brief Sort the elements of the list.
+ *
+ * Sorts the elements of this list in NlogN time. Equivalent
+ * elements remain in list order.
+ */
+ void
+ sort()
+ {
+ _Node* __tmp = __static_pointer_cast<_Node*>(&this->_M_impl._M_head);
+ __tmp->_M_sort_after(std::less<_Tp>());
+ }
+
+ /**
+ * @brief Sort the forward_list using a comparison function.
+ *
+ * Sorts the elements of this list in NlogN time. Equivalent
+ * elements remain in list order.
+ */
+ template<typename _Comp>
+ void
+ sort(_Comp __comp)
+ {
+ _Node* __tmp = __static_pointer_cast<_Node*>(&this->_M_impl._M_head);
+ __tmp->_M_sort_after(__comp);
+ }
+
+ /**
+ * @brief Reverse the elements in list.
+ *
+ * Reverse the order of elements in the list in linear time.
+ */
+ void
+ reverse()
+ { this->_M_impl._M_head._M_reverse_after(); }
+
+ private:
+ template<typename _Integer>
+ void
+ _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type)
+ { _M_fill_initialize(static_cast<size_type>(__n), __x); }
+
+ // Called by the range constructor to implement [23.1.1]/9
+ template<typename _InputIterator>
+ void
+ _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
+ __false_type);
+
+ // Called by forward_list(n,v,a), and the range constructor when it
+ // turns out to be the same thing.
+ void
+ _M_fill_initialize(size_type __n, const value_type& __value);
+ };
+
+ /**
+ * @brief Forward list equality comparison.
+ * @param lx A %forward_list
+ * @param ly A %forward_list of the same type as @a lx.
+ * @return True iff the size and elements of the forward lists are equal.
+ *
+ * This is an equivalence relation. It is linear in the size of the
+ * forward lists. Deques are considered equivalent if corresponding
+ * elements compare equal.
+ */
+ template<typename _Tp, typename _Alloc>
+ bool
+ operator==(const forward_list<_Tp, _Alloc>& __lx,
+ const forward_list<_Tp, _Alloc>& __ly);
+
+ /**
+ * @brief Forward list ordering relation.
+ * @param lx A %forward_list.
+ * @param ly A %forward_list of the same type as @a lx.
+ * @return True iff @a lx is lexicographically less than @a ly.
+ *
+ * This is a total ordering relation. It is linear in the size of the
+ * forward lists. The elements must be comparable with @c <.
+ *
+ * See std::lexicographical_compare() for how the determination is made.
+ */
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<(const forward_list<_Tp, _Alloc>& __lx,
+ const forward_list<_Tp, _Alloc>& __ly)
+ { return std::lexicographical_compare(__lx.cbegin(), __lx.cend(),
+ __ly.cbegin(), __ly.cend()); }
+
+ /// Based on operator==
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator!=(const forward_list<_Tp, _Alloc>& __lx,
+ const forward_list<_Tp, _Alloc>& __ly)
+ { return !(__lx == __ly); }
+
+ /// Based on operator<
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>(const forward_list<_Tp, _Alloc>& __lx,
+ const forward_list<_Tp, _Alloc>& __ly)
+ { return (__ly < __lx); }
+
+ /// Based on operator<
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>=(const forward_list<_Tp, _Alloc>& __lx,
+ const forward_list<_Tp, _Alloc>& __ly)
+ { return !(__lx < __ly); }
+
+ /// Based on operator<
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<=(const forward_list<_Tp, _Alloc>& __lx,
+ const forward_list<_Tp, _Alloc>& __ly)
+ { return !(__ly < __lx); }
+
+ /// See std::forward_list::swap().
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(forward_list<_Tp, _Alloc>& __lx,
+ forward_list<_Tp, _Alloc>& __ly)
+ { __lx.swap(__ly); }
+
+ /// See std::forward_list::swap().
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(forward_list<_Tp, _Alloc>&& __lx,
+ forward_list<_Tp, _Alloc>& __ly)
+ { __lx.swap(__ly); }
+
+ /// See std::forward_list::swap().
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(forward_list<_Tp, _Alloc>& __lx,
+ forward_list<_Tp, _Alloc>&& __ly)
+ { __lx.swap(__ly); }
+
+_GLIBCXX_END_NAMESPACE // namespace std
+
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+#endif // _FORWARD_LIST_H
diff --git a/i686-linux/include/c++/4.4.3/bits/forward_list.tcc b/i686-linux/include/c++/4.4.3/bits/forward_list.tcc
new file mode 100644
index 0000000..8458e7e
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/forward_list.tcc
@@ -0,0 +1,478 @@
+// <forward_list.tcc> -*- C++ -*-
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file forward_list.tcc
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _FORWARD_LIST_TCC
+#define _FORWARD_LIST_TCC 1
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _Alloc>
+ void
+ _Fwd_list_node_base<_Alloc>::
+ _M_transfer_after(_Pointer __bbegin)
+ {
+ _Pointer __bend = __bbegin;
+ while (__bend && __bend->_M_next)
+ __bend = __bend->_M_next;
+ _M_transfer_after(__bbegin, __bend);
+ }
+
+ template<typename _Alloc>
+ void
+ _Fwd_list_node_base<_Alloc>::
+ _M_transfer_after(_Pointer __bbegin, _Pointer __bend)
+ {
+ _Pointer __keep = __bbegin->_M_next;
+ if (__bend)
+ {
+ __bbegin->_M_next = __bend->_M_next;
+ __bend->_M_next = _M_next;
+ }
+ else
+ __bbegin->_M_next = 0;
+ _M_next = __keep;
+ }
+
+ template<typename _Alloc>
+ void
+ _Fwd_list_node_base<_Alloc>::
+ _M_reverse_after()
+ {
+ _Pointer __tail = _M_next;
+ if (!__tail)
+ return;
+ while (_Pointer __temp = __tail->_M_next)
+ {
+ _Pointer __keep = _M_next;
+ _M_next = __temp;
+ __tail->_M_next = __temp->_M_next;
+ _M_next->_M_next = __keep;
+ }
+ }
+
+ /**
+ * @brief Sort the singly linked list starting after this node.
+ * This node is assumed to be an empty head node (of type
+ * _Fwd_list_node_base).
+ */
+ template<typename _Tp, class _Alloc>
+ template<typename _Comp>
+ void
+ _Fwd_list_node<_Tp, _Alloc>::
+ _M_sort_after(_Comp __comp)
+ {
+ // If `next' is 0, return immediately.
+ _Pointer __list = __static_pointer_cast<_Pointer>(this->_M_next);
+ if (!__list)
+ return;
+
+ unsigned long __insize = 1;
+
+ while (1)
+ {
+ _Pointer __p = __list;
+ __list = 0;
+ _Pointer __tail = 0;
+
+ // Count number of merges we do in this pass.
+ unsigned long __nmerges = 0;
+
+ while (__p)
+ {
+ ++__nmerges;
+ // There exists a merge to be done.
+ // Step `insize' places along from p.
+ _Pointer __q = __p;
+ unsigned long __psize = 0;
+ for (unsigned long __i = 0; __i < __insize; ++__i)
+ {
+ ++__psize;
+ __q = __static_pointer_cast<_Pointer>(__q->_M_next);
+ if (!__q)
+ break;
+ }
+
+ // If q hasn't fallen off end, we have two lists to merge.
+ unsigned long __qsize = __insize;
+
+ // Now we have two lists; merge them.
+ while (__psize > 0 || (__qsize > 0 && __q))
+ {
+ // Decide whether next node of merge comes from p or q.
+ _Pointer __e;
+ if (__psize == 0)
+ {
+ // p is empty; e must come from q.
+ __e = __q;
+ __q = __static_pointer_cast<_Pointer>(__q->_M_next);
+ --__qsize;
+ }
+ else if (__qsize == 0 || !__q)
+ {
+ // q is empty; e must come from p.
+ __e = __p;
+ __p = __static_pointer_cast<_Pointer>(__p->_M_next);
+ --__psize;
+ }
+ else if (__comp(__p->_M_value, __q->_M_value))
+ {
+ // First node of p is lower; e must come from p.
+ __e = __p;
+ __p = __static_pointer_cast<_Pointer>(__p->_M_next);
+ --__psize;
+ }
+ else
+ {
+ // First node of q is lower; e must come from q.
+ __e = __q;
+ __q = __static_pointer_cast<_Pointer>(__q->_M_next);
+ --__qsize;
+ }
+
+ // Add the next node to the merged list.
+ if (__tail)
+ __tail->_M_next = __e;
+ else
+ __list = __e;
+ __tail = __e;
+ }
+
+ // Now p has stepped `insize' places along, and q has too.
+ __p = __q;
+ }
+ __tail->_M_next = 0;
+
+ // If we have done only one merge, we're finished.
+ // Allow for nmerges == 0, the empty list case.
+ if (__nmerges <= 1)
+ {
+ this->_M_next = __list;
+ return;
+ }
+
+ // Otherwise repeat, merging lists twice the size.
+ __insize *= 2;
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ _Fwd_list_base<_Tp, _Alloc>::
+ _Fwd_list_base(const _Fwd_list_base& __lst, const _Alloc& __a)
+ : _M_impl(__a)
+ {
+ this->_M_impl._M_head._M_next = 0;
+ typename _Node_base::_Pointer __to = &this->_M_impl._M_head;
+ typename _Node::_Pointer __curr
+ = __static_pointer_cast<typename _Node::_Pointer>
+ (__lst._M_impl._M_head._M_next);
+ while (__curr)
+ {
+ __to->_M_next = _M_create_node(__curr->_M_value);
+ __to = __to->_M_next;
+ __curr = __static_pointer_cast<typename _Node::_Pointer>
+ (__curr->_M_next);
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ template<typename... _Args>
+ typename _Fwd_list_base<_Tp, _Alloc>::_Node_base::_Pointer
+ _Fwd_list_base<_Tp, _Alloc>::
+ _M_insert_after(const_iterator __pos, _Args&&... __args)
+ {
+ typename _Node_base::_Pointer __to
+ = __const_pointer_cast<typename _Node_base::_Pointer>
+ (__pos._M_node);
+ typename _Node::_Pointer __thing
+ = __static_pointer_cast<typename _Node::_Pointer>(
+ _M_create_node(std::forward<_Args>(__args)...) );
+ __thing->_M_next = __to->_M_next;
+ __to->_M_next = __thing;
+ return __static_pointer_cast<typename _Node_base::_Pointer>
+ (__to->_M_next);
+ }
+
+ template<typename _Tp, typename _Alloc>
+ typename _Fwd_list_base<_Tp, _Alloc>::_Node_base::_Pointer
+ _Fwd_list_base<_Tp, _Alloc>::
+ _M_erase_after(typename _Node_base::_Pointer __pos)
+ {
+ typename _Node::_Pointer __curr
+ = __static_pointer_cast<typename _Node::_Pointer>(__pos->_M_next);
+ if (__curr)
+ {
+ typename _Node_base::_Pointer __next = __curr->_M_next;
+ __pos->_M_next = __next;
+ _M_get_Node_allocator().destroy(__curr);
+ _M_put_node(__curr);
+ }
+ return __pos;
+ }
+
+ template<typename _Tp, typename _Alloc>
+ typename _Fwd_list_base<_Tp, _Alloc>::_Node_base::_Pointer
+ _Fwd_list_base<_Tp, _Alloc>::
+ _M_erase_after(typename _Node_base::_Pointer __pos,
+ typename _Node_base::_Pointer __last)
+ {
+ typename _Node::_Pointer __curr
+ = __static_pointer_cast<typename _Node::_Pointer>(__pos->_M_next);
+ while (__curr)
+ {
+ typename _Node::_Pointer __temp = __curr;
+ __curr = __static_pointer_cast<typename _Node::_Pointer>
+ (__curr->_M_next);
+ _M_get_Node_allocator().destroy(__temp);
+ _M_put_node(__temp);
+ __pos->_M_next = __curr;
+ if (__temp == __last)
+ break;
+ }
+ return __pos;
+ }
+
+ // Called by the range constructor to implement [23.1.1]/9
+ template<typename _Tp, typename _Alloc>
+ template<typename _InputIterator>
+ void
+ forward_list<_Tp, _Alloc>::
+ _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
+ __false_type)
+ {
+ typename _Node_base::_Pointer __to = &this->_M_impl._M_head;
+ for (; __first != __last; ++__first)
+ {
+ __to->_M_next = this->_M_create_node(*__first);
+ __to = __to->_M_next;
+ }
+ }
+
+ // Called by forward_list(n,v,a), and the range constructor
+ // when it turns out to be the same thing.
+ template<typename _Tp, typename _Alloc>
+ void
+ forward_list<_Tp, _Alloc>::
+ _M_fill_initialize(size_type __n, const value_type& __value)
+ {
+ typename _Node_base::_Pointer __to = &this->_M_impl._M_head;
+ for (; __n > 0; --__n)
+ {
+ __to->_M_next = this->_M_create_node(__value);
+ __to = __to->_M_next;
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ forward_list<_Tp, _Alloc>&
+ forward_list<_Tp, _Alloc>::
+ operator=(const forward_list& __list)
+ {
+ if (&__list != this)
+ {
+ iterator __prev1 = before_begin();
+ iterator __curr1 = begin();
+ iterator __last1 = end();
+ const_iterator __first2 = __list.cbegin();
+ const_iterator __last2 = __list.cend();
+ while (__curr1 != __last1 && __first2 != __last2)
+ {
+ *__curr1 = *__first2;
+ ++__prev1;
+ ++__curr1;
+ ++__first2;
+ }
+ if (__first2 == __last2)
+ erase_after(__prev1, __last1);
+ else
+ insert_after(__prev1, __first2, __last2);
+ }
+ return *this;
+ }
+
+ template<typename _Tp, typename _Alloc>
+ void
+ forward_list<_Tp, _Alloc>::
+ resize(size_type __sz, value_type __val)
+ {
+ iterator __k = before_begin();
+
+ size_type __len = 0;
+ while (__k._M_next() != end() && __len < __sz)
+ {
+ ++__k;
+ ++__len;
+ }
+ if (__len == __sz)
+ erase_after(__k, end());
+ else
+ insert_after(__k, __sz - __len, __val);
+ }
+
+ template<typename _Tp, typename _Alloc>
+ void
+ forward_list<_Tp, _Alloc>::
+ splice_after(const_iterator __pos, forward_list&& __list)
+ {
+ if (!__list.empty() && &__list != this)
+ {
+ typename _Node_base::_Pointer __tmp
+ = __const_pointer_cast<typename _Node_base::_Pointer>
+ (__pos._M_node);
+ const_iterator __before = __list.cbefore_begin();
+ __tmp->_M_transfer_after(__const_pointer_cast
+ <typename _Node_base::_Pointer>
+ (__before._M_node));
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ void
+ forward_list<_Tp, _Alloc>::
+ splice_after(const_iterator __pos, forward_list&& __list,
+ const_iterator __before, const_iterator __last)
+ {
+ typename _Node_base::_Pointer __tmp
+ = __const_pointer_cast<typename _Node_base::_Pointer>(__pos._M_node);
+ __tmp->_M_transfer_after(__const_pointer_cast
+ <typename _Node_base::_Pointer>
+ (__before._M_node),
+ __const_pointer_cast
+ <typename _Node_base::_Pointer>
+ (__last._M_node));
+ }
+
+ template<typename _Tp, typename _Alloc>
+ void
+ forward_list<_Tp, _Alloc>::
+ remove(const _Tp& __val)
+ {
+ typename _Node::_Pointer __curr
+ = __static_pointer_cast<typename _Node::_Pointer>
+ (&this->_M_impl._M_head);
+ while (typename _Node::_Pointer __temp =
+ __static_pointer_cast<typename _Node::_Pointer>(__curr->_M_next))
+ {
+ if (__temp->_M_value == __val)
+ this->_M_erase_after(__curr);
+ else
+ __curr = __static_pointer_cast<typename _Node::_Pointer>
+ (__curr->_M_next);
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ template<typename _Pred>
+ void
+ forward_list<_Tp, _Alloc>::
+ remove_if(_Pred __pred)
+ {
+ typename _Node::_Pointer __curr
+ = __static_pointer_cast<typename _Node::_Pointer>
+ (&this->_M_impl._M_head);
+ while (typename _Node::_Pointer __temp =
+ __static_pointer_cast<typename _Node::_Pointer>(__curr->_M_next))
+ {
+ if (__pred(__temp->_M_value))
+ this->_M_erase_after(__curr);
+ else
+ __curr = __static_pointer_cast<typename _Node::_Pointer>
+ (__curr->_M_next);
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ template<typename _BinPred>
+ void
+ forward_list<_Tp, _Alloc>::
+ unique(_BinPred __binary_pred)
+ {
+ iterator __first = begin();
+ iterator __last = end();
+ if (__first == __last)
+ return;
+ iterator __next = __first;
+ while (++__next != __last)
+ {
+ if (__binary_pred(*__first, *__next))
+ erase_after(__first);
+ else
+ __first = __next;
+ __next = __first;
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ template<typename _Comp>
+ void
+ forward_list<_Tp, _Alloc>::
+ merge(forward_list&& __list, _Comp __comp)
+ {
+ typename _Node_base::_Pointer __node = &this->_M_impl._M_head;
+ while (__node->_M_next && __list._M_impl._M_head._M_next)
+ {
+ if (__comp(__static_pointer_cast<typename _Node::_Pointer>
+ (__list._M_impl._M_head._M_next)->_M_value,
+ __static_pointer_cast<typename _Node::_Pointer>
+ (__node->_M_next)->_M_value))
+ __node->_M_transfer_after(&__list._M_impl._M_head,
+ __list._M_impl._M_head._M_next);
+ __node = __node->_M_next;
+ }
+ if (__list._M_impl._M_head._M_next)
+ {
+ __node->_M_next = __list._M_impl._M_head._M_next;
+ __list._M_impl._M_head._M_next = 0;
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ bool
+ operator==(const forward_list<_Tp, _Alloc>& __lx,
+ const forward_list<_Tp, _Alloc>& __ly)
+ {
+ // We don't have size() so we need to walk through both lists
+ // making sure both iterators are valid.
+ auto __ix = __lx.cbegin();
+ auto __iy = __ly.cbegin();
+ while (__ix != __lx.cend() && __iy != __ly.cend())
+ {
+ if (*__ix != *__iy)
+ return false;
+ ++__ix;
+ ++__iy;
+ }
+ if (__ix == __lx.cend() && __iy == __ly.cend())
+ return true;
+ else
+ return false;
+ }
+
+_GLIBCXX_END_NAMESPACE // namespace std
+
+#endif /* _FORWARD_LIST_TCC */
+
diff --git a/i686-linux/include/c++/4.4.3/bits/fstream.tcc b/i686-linux/include/c++/4.4.3/bits/fstream.tcc
new file mode 100644
index 0000000..c5f7f8c
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/fstream.tcc
@@ -0,0 +1,926 @@
+// File based streams -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+// 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file fstream.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 27.8 File-based streams
+//
+
+#ifndef _FSTREAM_TCC
+#define _FSTREAM_TCC 1
+
+#pragma GCC system_header
+
+#include <cxxabi-forced.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _CharT, typename _Traits>
+ void
+ basic_filebuf<_CharT, _Traits>::
+ _M_allocate_internal_buffer()
+ {
+ // Allocate internal buffer only if one doesn't already exist
+ // (either allocated or provided by the user via setbuf).
+ if (!_M_buf_allocated && !_M_buf)
+ {
+ _M_buf = new char_type[_M_buf_size];
+ _M_buf_allocated = true;
+ }
+ }
+
+ template<typename _CharT, typename _Traits>
+ void
+ basic_filebuf<_CharT, _Traits>::
+ _M_destroy_internal_buffer() throw()
+ {
+ if (_M_buf_allocated)
+ {
+ delete [] _M_buf;
+ _M_buf = NULL;
+ _M_buf_allocated = false;
+ }
+ delete [] _M_ext_buf;
+ _M_ext_buf = NULL;
+ _M_ext_buf_size = 0;
+ _M_ext_next = NULL;
+ _M_ext_end = NULL;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_filebuf<_CharT, _Traits>::
+ basic_filebuf() : __streambuf_type(), _M_lock(), _M_file(&_M_lock),
+ _M_mode(ios_base::openmode(0)), _M_state_beg(), _M_state_cur(),
+ _M_state_last(), _M_buf(NULL), _M_buf_size(BUFSIZ),
+ _M_buf_allocated(false), _M_reading(false), _M_writing(false), _M_pback(),
+ _M_pback_cur_save(0), _M_pback_end_save(0), _M_pback_init(false),
+ _M_codecvt(0), _M_ext_buf(0), _M_ext_buf_size(0), _M_ext_next(0),
+ _M_ext_end(0)
+ {
+ if (has_facet<__codecvt_type>(this->_M_buf_locale))
+ _M_codecvt = &use_facet<__codecvt_type>(this->_M_buf_locale);
+ }
+
+ template<typename _CharT, typename _Traits>
+ typename basic_filebuf<_CharT, _Traits>::__filebuf_type*
+ basic_filebuf<_CharT, _Traits>::
+ open(const char* __s, ios_base::openmode __mode)
+ {
+ __filebuf_type *__ret = NULL;
+ if (!this->is_open())
+ {
+ _M_file.open(__s, __mode);
+ if (this->is_open())
+ {
+ _M_allocate_internal_buffer();
+ _M_mode = __mode;
+
+ // Setup initial buffer to 'uncommitted' mode.
+ _M_reading = false;
+ _M_writing = false;
+ _M_set_buffer(-1);
+
+ // Reset to initial state.
+ _M_state_last = _M_state_cur = _M_state_beg;
+
+ // 27.8.1.3,4
+ if ((__mode & ios_base::ate)
+ && this->seekoff(0, ios_base::end, __mode)
+ == pos_type(off_type(-1)))
+ this->close();
+ else
+ __ret = this;
+ }
+ }
+ return __ret;
+ }
+
+ template<typename _CharT, typename _Traits>
+ typename basic_filebuf<_CharT, _Traits>::__filebuf_type*
+ basic_filebuf<_CharT, _Traits>::
+ close()
+ {
+ if (!this->is_open())
+ return NULL;
+
+ bool __testfail = false;
+ {
+ // NB: Do this here so that re-opened filebufs will be cool...
+ struct __close_sentry
+ {
+ basic_filebuf *__fb;
+ __close_sentry (basic_filebuf *__fbi): __fb(__fbi) { }
+ ~__close_sentry ()
+ {
+ __fb->_M_mode = ios_base::openmode(0);
+ __fb->_M_pback_init = false;
+ __fb->_M_destroy_internal_buffer();
+ __fb->_M_reading = false;
+ __fb->_M_writing = false;
+ __fb->_M_set_buffer(-1);
+ __fb->_M_state_last = __fb->_M_state_cur = __fb->_M_state_beg;
+ }
+ } __cs (this);
+
+ __try
+ {
+ if (!_M_terminate_output())
+ __testfail = true;
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ _M_file.close();
+ __throw_exception_again;
+ }
+ __catch(...)
+ { __testfail = true; }
+ }
+
+ if (!_M_file.close())
+ __testfail = true;
+
+ if (__testfail)
+ return NULL;
+ else
+ return this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ streamsize
+ basic_filebuf<_CharT, _Traits>::
+ showmanyc()
+ {
+ streamsize __ret = -1;
+ const bool __testin = _M_mode & ios_base::in;
+ if (__testin && this->is_open())
+ {
+ // For a stateful encoding (-1) the pending sequence might be just
+ // shift and unshift prefixes with no actual character.
+ __ret = this->egptr() - this->gptr();
+
+#if _GLIBCXX_HAVE_DOS_BASED_FILESYSTEM
+ // About this workaround, see libstdc++/20806.
+ const bool __testbinary = _M_mode & ios_base::binary;
+ if (__check_facet(_M_codecvt).encoding() >= 0
+ && __testbinary)
+#else
+ if (__check_facet(_M_codecvt).encoding() >= 0)
+#endif
+ __ret += _M_file.showmanyc() / _M_codecvt->max_length();
+ }
+ return __ret;
+ }
+
+ template<typename _CharT, typename _Traits>
+ typename basic_filebuf<_CharT, _Traits>::int_type
+ basic_filebuf<_CharT, _Traits>::
+ underflow()
+ {
+ int_type __ret = traits_type::eof();
+ const bool __testin = _M_mode & ios_base::in;
+ if (__testin && !_M_writing)
+ {
+ // Check for pback madness, and if so switch back to the
+ // normal buffers and jet outta here before expensive
+ // fileops happen...
+ _M_destroy_pback();
+
+ if (this->gptr() < this->egptr())
+ return traits_type::to_int_type(*this->gptr());
+
+ // Get and convert input sequence.
+ const size_t __buflen = _M_buf_size > 1 ? _M_buf_size - 1 : 1;
+
+ // Will be set to true if ::read() returns 0 indicating EOF.
+ bool __got_eof = false;
+ // Number of internal characters produced.
+ streamsize __ilen = 0;
+ codecvt_base::result __r = codecvt_base::ok;
+ if (__check_facet(_M_codecvt).always_noconv())
+ {
+ __ilen = _M_file.xsgetn(reinterpret_cast<char*>(this->eback()),
+ __buflen);
+ if (__ilen == 0)
+ __got_eof = true;
+ }
+ else
+ {
+ // Worst-case number of external bytes.
+ // XXX Not done encoding() == -1.
+ const int __enc = _M_codecvt->encoding();
+ streamsize __blen; // Minimum buffer size.
+ streamsize __rlen; // Number of chars to read.
+ if (__enc > 0)
+ __blen = __rlen = __buflen * __enc;
+ else
+ {
+ __blen = __buflen + _M_codecvt->max_length() - 1;
+ __rlen = __buflen;
+ }
+ const streamsize __remainder = _M_ext_end - _M_ext_next;
+ __rlen = __rlen > __remainder ? __rlen - __remainder : 0;
+
+ // An imbue in 'read' mode implies first converting the external
+ // chars already present.
+ if (_M_reading && this->egptr() == this->eback() && __remainder)
+ __rlen = 0;
+
+ // Allocate buffer if necessary and move unconverted
+ // bytes to front.
+ if (_M_ext_buf_size < __blen)
+ {
+ char* __buf = new char[__blen];
+ if (__remainder)
+ __builtin_memcpy(__buf, _M_ext_next, __remainder);
+
+ delete [] _M_ext_buf;
+ _M_ext_buf = __buf;
+ _M_ext_buf_size = __blen;
+ }
+ else if (__remainder)
+ __builtin_memmove(_M_ext_buf, _M_ext_next, __remainder);
+
+ _M_ext_next = _M_ext_buf;
+ _M_ext_end = _M_ext_buf + __remainder;
+ _M_state_last = _M_state_cur;
+
+ do
+ {
+ if (__rlen > 0)
+ {
+ // Sanity check!
+ // This may fail if the return value of
+ // codecvt::max_length() is bogus.
+ if (_M_ext_end - _M_ext_buf + __rlen > _M_ext_buf_size)
+ {
+ __throw_ios_failure(__N("basic_filebuf::underflow "
+ "codecvt::max_length() "
+ "is not valid"));
+ }
+ streamsize __elen = _M_file.xsgetn(_M_ext_end, __rlen);
+ if (__elen == 0)
+ __got_eof = true;
+ else if (__elen == -1)
+ break;
+ _M_ext_end += __elen;
+ }
+
+ char_type* __iend = this->eback();
+ if (_M_ext_next < _M_ext_end)
+ __r = _M_codecvt->in(_M_state_cur, _M_ext_next,
+ _M_ext_end, _M_ext_next,
+ this->eback(),
+ this->eback() + __buflen, __iend);
+ if (__r == codecvt_base::noconv)
+ {
+ size_t __avail = _M_ext_end - _M_ext_buf;
+ __ilen = std::min(__avail, __buflen);
+ traits_type::copy(this->eback(),
+ reinterpret_cast<char_type*>
+ (_M_ext_buf), __ilen);
+ _M_ext_next = _M_ext_buf + __ilen;
+ }
+ else
+ __ilen = __iend - this->eback();
+
+ // _M_codecvt->in may return error while __ilen > 0: this is
+ // ok, and actually occurs in case of mixed encodings (e.g.,
+ // XML files).
+ if (__r == codecvt_base::error)
+ break;
+
+ __rlen = 1;
+ }
+ while (__ilen == 0 && !__got_eof);
+ }
+
+ if (__ilen > 0)
+ {
+ _M_set_buffer(__ilen);
+ _M_reading = true;
+ __ret = traits_type::to_int_type(*this->gptr());
+ }
+ else if (__got_eof)
+ {
+ // If the actual end of file is reached, set 'uncommitted'
+ // mode, thus allowing an immediate write without an
+ // intervening seek.
+ _M_set_buffer(-1);
+ _M_reading = false;
+ // However, reaching it while looping on partial means that
+ // the file has got an incomplete character.
+ if (__r == codecvt_base::partial)
+ __throw_ios_failure(__N("basic_filebuf::underflow "
+ "incomplete character in file"));
+ }
+ else if (__r == codecvt_base::error)
+ __throw_ios_failure(__N("basic_filebuf::underflow "
+ "invalid byte sequence in file"));
+ else
+ __throw_ios_failure(__N("basic_filebuf::underflow "
+ "error reading the file"));
+ }
+ return __ret;
+ }
+
+ template<typename _CharT, typename _Traits>
+ typename basic_filebuf<_CharT, _Traits>::int_type
+ basic_filebuf<_CharT, _Traits>::
+ pbackfail(int_type __i)
+ {
+ int_type __ret = traits_type::eof();
+ const bool __testin = _M_mode & ios_base::in;
+ if (__testin && !_M_writing)
+ {
+ // Remember whether the pback buffer is active, otherwise below
+ // we may try to store in it a second char (libstdc++/9761).
+ const bool __testpb = _M_pback_init;
+ const bool __testeof = traits_type::eq_int_type(__i, __ret);
+ int_type __tmp;
+ if (this->eback() < this->gptr())
+ {
+ this->gbump(-1);
+ __tmp = traits_type::to_int_type(*this->gptr());
+ }
+ else if (this->seekoff(-1, ios_base::cur) != pos_type(off_type(-1)))
+ {
+ __tmp = this->underflow();
+ if (traits_type::eq_int_type(__tmp, __ret))
+ return __ret;
+ }
+ else
+ {
+ // At the beginning of the buffer, need to make a
+ // putback position available. But the seek may fail
+ // (f.i., at the beginning of a file, see
+ // libstdc++/9439) and in that case we return
+ // traits_type::eof().
+ return __ret;
+ }
+
+ // Try to put back __i into input sequence in one of three ways.
+ // Order these tests done in is unspecified by the standard.
+ if (!__testeof && traits_type::eq_int_type(__i, __tmp))
+ __ret = __i;
+ else if (__testeof)
+ __ret = traits_type::not_eof(__i);
+ else if (!__testpb)
+ {
+ _M_create_pback();
+ _M_reading = true;
+ *this->gptr() = traits_type::to_char_type(__i);
+ __ret = __i;
+ }
+ }
+ return __ret;
+ }
+
+ template<typename _CharT, typename _Traits>
+ typename basic_filebuf<_CharT, _Traits>::int_type
+ basic_filebuf<_CharT, _Traits>::
+ overflow(int_type __c)
+ {
+ int_type __ret = traits_type::eof();
+ const bool __testeof = traits_type::eq_int_type(__c, __ret);
+ const bool __testout = _M_mode & ios_base::out;
+ if (__testout && !_M_reading)
+ {
+ if (this->pbase() < this->pptr())
+ {
+ // If appropriate, append the overflow char.
+ if (!__testeof)
+ {
+ *this->pptr() = traits_type::to_char_type(__c);
+ this->pbump(1);
+ }
+
+ // Convert pending sequence to external representation,
+ // and output.
+ if (_M_convert_to_external(this->pbase(),
+ this->pptr() - this->pbase()))
+ {
+ _M_set_buffer(0);
+ __ret = traits_type::not_eof(__c);
+ }
+ }
+ else if (_M_buf_size > 1)
+ {
+ // Overflow in 'uncommitted' mode: set _M_writing, set
+ // the buffer to the initial 'write' mode, and put __c
+ // into the buffer.
+ _M_set_buffer(0);
+ _M_writing = true;
+ if (!__testeof)
+ {
+ *this->pptr() = traits_type::to_char_type(__c);
+ this->pbump(1);
+ }
+ __ret = traits_type::not_eof(__c);
+ }
+ else
+ {
+ // Unbuffered.
+ char_type __conv = traits_type::to_char_type(__c);
+ if (__testeof || _M_convert_to_external(&__conv, 1))
+ {
+ _M_writing = true;
+ __ret = traits_type::not_eof(__c);
+ }
+ }
+ }
+ return __ret;
+ }
+
+ template<typename _CharT, typename _Traits>
+ bool
+ basic_filebuf<_CharT, _Traits>::
+ _M_convert_to_external(_CharT* __ibuf, streamsize __ilen)
+ {
+ // Sizes of external and pending output.
+ streamsize __elen;
+ streamsize __plen;
+ if (__check_facet(_M_codecvt).always_noconv())
+ {
+ __elen = _M_file.xsputn(reinterpret_cast<char*>(__ibuf), __ilen);
+ __plen = __ilen;
+ }
+ else
+ {
+ // Worst-case number of external bytes needed.
+ // XXX Not done encoding() == -1.
+ streamsize __blen = __ilen * _M_codecvt->max_length();
+ char* __buf = static_cast<char*>(__builtin_alloca(__blen));
+
+ char* __bend;
+ const char_type* __iend;
+ codecvt_base::result __r;
+ __r = _M_codecvt->out(_M_state_cur, __ibuf, __ibuf + __ilen,
+ __iend, __buf, __buf + __blen, __bend);
+
+ if (__r == codecvt_base::ok || __r == codecvt_base::partial)
+ __blen = __bend - __buf;
+ else if (__r == codecvt_base::noconv)
+ {
+ // Same as the always_noconv case above.
+ __buf = reinterpret_cast<char*>(__ibuf);
+ __blen = __ilen;
+ }
+ else
+ __throw_ios_failure(__N("basic_filebuf::_M_convert_to_external "
+ "conversion error"));
+
+ __elen = _M_file.xsputn(__buf, __blen);
+ __plen = __blen;
+
+ // Try once more for partial conversions.
+ if (__r == codecvt_base::partial && __elen == __plen)
+ {
+ const char_type* __iresume = __iend;
+ streamsize __rlen = this->pptr() - __iend;
+ __r = _M_codecvt->out(_M_state_cur, __iresume,
+ __iresume + __rlen, __iend, __buf,
+ __buf + __blen, __bend);
+ if (__r != codecvt_base::error)
+ {
+ __rlen = __bend - __buf;
+ __elen = _M_file.xsputn(__buf, __rlen);
+ __plen = __rlen;
+ }
+ else
+ __throw_ios_failure(__N("basic_filebuf::_M_convert_to_external "
+ "conversion error"));
+ }
+ }
+ return __elen == __plen;
+ }
+
+ template<typename _CharT, typename _Traits>
+ streamsize
+ basic_filebuf<_CharT, _Traits>::
+ xsgetn(_CharT* __s, streamsize __n)
+ {
+ // Clear out pback buffer before going on to the real deal...
+ streamsize __ret = 0;
+ if (_M_pback_init)
+ {
+ if (__n > 0 && this->gptr() == this->eback())
+ {
+ *__s++ = *this->gptr();
+ this->gbump(1);
+ __ret = 1;
+ --__n;
+ }
+ _M_destroy_pback();
+ }
+
+ // Optimization in the always_noconv() case, to be generalized in the
+ // future: when __n > __buflen we read directly instead of using the
+ // buffer repeatedly.
+ const bool __testin = _M_mode & ios_base::in;
+ const streamsize __buflen = _M_buf_size > 1 ? _M_buf_size - 1 : 1;
+
+ if (__n > __buflen && __check_facet(_M_codecvt).always_noconv()
+ && __testin && !_M_writing)
+ {
+ // First, copy the chars already present in the buffer.
+ const streamsize __avail = this->egptr() - this->gptr();
+ if (__avail != 0)
+ {
+ if (__avail == 1)
+ *__s = *this->gptr();
+ else
+ traits_type::copy(__s, this->gptr(), __avail);
+ __s += __avail;
+ this->gbump(__avail);
+ __ret += __avail;
+ __n -= __avail;
+ }
+
+ // Need to loop in case of short reads (relatively common
+ // with pipes).
+ streamsize __len;
+ for (;;)
+ {
+ __len = _M_file.xsgetn(reinterpret_cast<char*>(__s),
+ __n);
+ if (__len == -1)
+ __throw_ios_failure(__N("basic_filebuf::xsgetn "
+ "error reading the file"));
+ if (__len == 0)
+ break;
+
+ __n -= __len;
+ __ret += __len;
+ if (__n == 0)
+ break;
+
+ __s += __len;
+ }
+
+ if (__n == 0)
+ {
+ _M_set_buffer(0);
+ _M_reading = true;
+ }
+ else if (__len == 0)
+ {
+ // If end of file is reached, set 'uncommitted'
+ // mode, thus allowing an immediate write without
+ // an intervening seek.
+ _M_set_buffer(-1);
+ _M_reading = false;
+ }
+ }
+ else
+ __ret += __streambuf_type::xsgetn(__s, __n);
+
+ return __ret;
+ }
+
+ template<typename _CharT, typename _Traits>
+ streamsize
+ basic_filebuf<_CharT, _Traits>::
+ xsputn(const _CharT* __s, streamsize __n)
+ {
+ // Optimization in the always_noconv() case, to be generalized in the
+ // future: when __n is sufficiently large we write directly instead of
+ // using the buffer.
+ streamsize __ret = 0;
+ const bool __testout = _M_mode & ios_base::out;
+ if (__check_facet(_M_codecvt).always_noconv()
+ && __testout && !_M_reading)
+ {
+ // Measurement would reveal the best choice.
+ const streamsize __chunk = 1ul << 10;
+ streamsize __bufavail = this->epptr() - this->pptr();
+
+ // Don't mistake 'uncommitted' mode buffered with unbuffered.
+ if (!_M_writing && _M_buf_size > 1)
+ __bufavail = _M_buf_size - 1;
+
+ const streamsize __limit = std::min(__chunk, __bufavail);
+ if (__n >= __limit)
+ {
+ const streamsize __buffill = this->pptr() - this->pbase();
+ const char* __buf = reinterpret_cast<const char*>(this->pbase());
+ __ret = _M_file.xsputn_2(__buf, __buffill,
+ reinterpret_cast<const char*>(__s),
+ __n);
+ if (__ret == __buffill + __n)
+ {
+ _M_set_buffer(0);
+ _M_writing = true;
+ }
+ if (__ret > __buffill)
+ __ret -= __buffill;
+ else
+ __ret = 0;
+ }
+ else
+ __ret = __streambuf_type::xsputn(__s, __n);
+ }
+ else
+ __ret = __streambuf_type::xsputn(__s, __n);
+ return __ret;
+ }
+
+ template<typename _CharT, typename _Traits>
+ typename basic_filebuf<_CharT, _Traits>::__streambuf_type*
+ basic_filebuf<_CharT, _Traits>::
+ setbuf(char_type* __s, streamsize __n)
+ {
+ if (!this->is_open())
+ {
+ if (__s == 0 && __n == 0)
+ _M_buf_size = 1;
+ else if (__s && __n > 0)
+ {
+ // This is implementation-defined behavior, and assumes that
+ // an external char_type array of length __n exists and has
+ // been pre-allocated. If this is not the case, things will
+ // quickly blow up. When __n > 1, __n - 1 positions will be
+ // used for the get area, __n - 1 for the put area and 1
+ // position to host the overflow char of a full put area.
+ // When __n == 1, 1 position will be used for the get area
+ // and 0 for the put area, as in the unbuffered case above.
+ _M_buf = __s;
+ _M_buf_size = __n;
+ }
+ }
+ return this;
+ }
+
+
+ // According to 27.8.1.4 p11 - 13, seekoff should ignore the last
+ // argument (of type openmode).
+ template<typename _CharT, typename _Traits>
+ typename basic_filebuf<_CharT, _Traits>::pos_type
+ basic_filebuf<_CharT, _Traits>::
+ seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode)
+ {
+ int __width = 0;
+ if (_M_codecvt)
+ __width = _M_codecvt->encoding();
+ if (__width < 0)
+ __width = 0;
+
+ pos_type __ret = pos_type(off_type(-1));
+ const bool __testfail = __off != 0 && __width <= 0;
+ if (this->is_open() && !__testfail)
+ {
+ // Ditch any pback buffers to avoid confusion.
+ _M_destroy_pback();
+
+ // Correct state at destination. Note that this is the correct
+ // state for the current position during output, because
+ // codecvt::unshift() returns the state to the initial state.
+ // This is also the correct state at the end of the file because
+ // an unshift sequence should have been written at the end.
+ __state_type __state = _M_state_beg;
+ off_type __computed_off = __off * __width;
+ if (_M_reading && __way == ios_base::cur)
+ {
+ if (_M_codecvt->always_noconv())
+ __computed_off += this->gptr() - this->egptr();
+ else
+ {
+ // Calculate offset from _M_ext_buf that corresponds
+ // to gptr(). Note: uses _M_state_last, which
+ // corresponds to eback().
+ const int __gptr_off =
+ _M_codecvt->length(_M_state_last, _M_ext_buf, _M_ext_next,
+ this->gptr() - this->eback());
+ __computed_off += _M_ext_buf + __gptr_off - _M_ext_end;
+
+ // _M_state_last is modified by codecvt::length() so
+ // it now corresponds to gptr().
+ __state = _M_state_last;
+ }
+ }
+ __ret = _M_seek(__computed_off, __way, __state);
+ }
+ return __ret;
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 171. Strange seekpos() semantics due to joint position
+ // According to the resolution of DR 171, seekpos should ignore the last
+ // argument (of type openmode).
+ template<typename _CharT, typename _Traits>
+ typename basic_filebuf<_CharT, _Traits>::pos_type
+ basic_filebuf<_CharT, _Traits>::
+ seekpos(pos_type __pos, ios_base::openmode)
+ {
+ pos_type __ret = pos_type(off_type(-1));
+ if (this->is_open())
+ {
+ // Ditch any pback buffers to avoid confusion.
+ _M_destroy_pback();
+ __ret = _M_seek(off_type(__pos), ios_base::beg, __pos.state());
+ }
+ return __ret;
+ }
+
+ template<typename _CharT, typename _Traits>
+ typename basic_filebuf<_CharT, _Traits>::pos_type
+ basic_filebuf<_CharT, _Traits>::
+ _M_seek(off_type __off, ios_base::seekdir __way, __state_type __state)
+ {
+ pos_type __ret = pos_type(off_type(-1));
+ if (_M_terminate_output())
+ {
+ // Returns pos_type(off_type(-1)) in case of failure.
+ __ret = pos_type(_M_file.seekoff(__off, __way));
+ if (__ret != pos_type(off_type(-1)))
+ {
+ _M_reading = false;
+ _M_writing = false;
+ _M_ext_next = _M_ext_end = _M_ext_buf;
+ _M_set_buffer(-1);
+ _M_state_cur = __state;
+ __ret.state(_M_state_cur);
+ }
+ }
+ return __ret;
+ }
+
+ template<typename _CharT, typename _Traits>
+ bool
+ basic_filebuf<_CharT, _Traits>::
+ _M_terminate_output()
+ {
+ // Part one: update the output sequence.
+ bool __testvalid = true;
+ if (this->pbase() < this->pptr())
+ {
+ const int_type __tmp = this->overflow();
+ if (traits_type::eq_int_type(__tmp, traits_type::eof()))
+ __testvalid = false;
+ }
+
+ // Part two: output unshift sequence.
+ if (_M_writing && !__check_facet(_M_codecvt).always_noconv()
+ && __testvalid)
+ {
+ // Note: this value is arbitrary, since there is no way to
+ // get the length of the unshift sequence from codecvt,
+ // without calling unshift.
+ const size_t __blen = 128;
+ char __buf[__blen];
+ codecvt_base::result __r;
+ streamsize __ilen = 0;
+
+ do
+ {
+ char* __next;
+ __r = _M_codecvt->unshift(_M_state_cur, __buf,
+ __buf + __blen, __next);
+ if (__r == codecvt_base::error)
+ __testvalid = false;
+ else if (__r == codecvt_base::ok ||
+ __r == codecvt_base::partial)
+ {
+ __ilen = __next - __buf;
+ if (__ilen > 0)
+ {
+ const streamsize __elen = _M_file.xsputn(__buf, __ilen);
+ if (__elen != __ilen)
+ __testvalid = false;
+ }
+ }
+ }
+ while (__r == codecvt_base::partial && __ilen > 0 && __testvalid);
+
+ if (__testvalid)
+ {
+ // This second call to overflow() is required by the standard,
+ // but it's not clear why it's needed, since the output buffer
+ // should be empty by this point (it should have been emptied
+ // in the first call to overflow()).
+ const int_type __tmp = this->overflow();
+ if (traits_type::eq_int_type(__tmp, traits_type::eof()))
+ __testvalid = false;
+ }
+ }
+ return __testvalid;
+ }
+
+ template<typename _CharT, typename _Traits>
+ int
+ basic_filebuf<_CharT, _Traits>::
+ sync()
+ {
+ // Make sure that the internal buffer resyncs its idea of
+ // the file position with the external file.
+ int __ret = 0;
+ if (this->pbase() < this->pptr())
+ {
+ const int_type __tmp = this->overflow();
+ if (traits_type::eq_int_type(__tmp, traits_type::eof()))
+ __ret = -1;
+ }
+ return __ret;
+ }
+
+ template<typename _CharT, typename _Traits>
+ void
+ basic_filebuf<_CharT, _Traits>::
+ imbue(const locale& __loc)
+ {
+ bool __testvalid = true;
+
+ const __codecvt_type* _M_codecvt_tmp = 0;
+ if (__builtin_expect(has_facet<__codecvt_type>(__loc), true))
+ _M_codecvt_tmp = &use_facet<__codecvt_type>(__loc);
+
+ if (this->is_open())
+ {
+ // encoding() == -1 is ok only at the beginning.
+ if ((_M_reading || _M_writing)
+ && __check_facet(_M_codecvt).encoding() == -1)
+ __testvalid = false;
+ else
+ {
+ if (_M_reading)
+ {
+ if (__check_facet(_M_codecvt).always_noconv())
+ {
+ if (_M_codecvt_tmp
+ && !__check_facet(_M_codecvt_tmp).always_noconv())
+ __testvalid = this->seekoff(0, ios_base::cur, _M_mode)
+ != pos_type(off_type(-1));
+ }
+ else
+ {
+ // External position corresponding to gptr().
+ _M_ext_next = _M_ext_buf
+ + _M_codecvt->length(_M_state_last, _M_ext_buf, _M_ext_next,
+ this->gptr() - this->eback());
+ const streamsize __remainder = _M_ext_end - _M_ext_next;
+ if (__remainder)
+ __builtin_memmove(_M_ext_buf, _M_ext_next, __remainder);
+
+ _M_ext_next = _M_ext_buf;
+ _M_ext_end = _M_ext_buf + __remainder;
+ _M_set_buffer(-1);
+ _M_state_last = _M_state_cur = _M_state_beg;
+ }
+ }
+ else if (_M_writing && (__testvalid = _M_terminate_output()))
+ _M_set_buffer(-1);
+ }
+ }
+
+ if (__testvalid)
+ _M_codecvt = _M_codecvt_tmp;
+ else
+ _M_codecvt = 0;
+ }
+
+ // Inhibit implicit instantiations for required instantiations,
+ // which are defined via explicit instantiations elsewhere.
+ // NB: This syntax is a GNU extension.
+#if _GLIBCXX_EXTERN_TEMPLATE
+ extern template class basic_filebuf<char>;
+ extern template class basic_ifstream<char>;
+ extern template class basic_ofstream<char>;
+ extern template class basic_fstream<char>;
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ extern template class basic_filebuf<wchar_t>;
+ extern template class basic_ifstream<wchar_t>;
+ extern template class basic_ofstream<wchar_t>;
+ extern template class basic_fstream<wchar_t>;
+#endif
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/bits/functexcept.h b/i686-linux/include/c++/4.4.3/bits/functexcept.h
new file mode 100644
index 0000000..9315d34
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/functexcept.h
@@ -0,0 +1,93 @@
+// Function-Based Exception Support -*- C++ -*-
+
+// Copyright (C) 2001, 2004, 2005, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file functexcept.h
+ * This header provides support for -fno-exceptions.
+ */
+
+//
+// ISO C++ 14882: 19.1 Exception classes
+//
+
+#ifndef _FUNCTEXCEPT_H
+#define _FUNCTEXCEPT_H 1
+
+#include <bits/c++config.h>
+#include <exception_defines.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // Helper for exception objects in <except>
+ void
+ __throw_bad_exception(void) __attribute__((__noreturn__));
+
+ // Helper for exception objects in <new>
+ void
+ __throw_bad_alloc(void) __attribute__((__noreturn__));
+
+ // Helper for exception objects in <typeinfo>
+ void
+ __throw_bad_cast(void) __attribute__((__noreturn__));
+
+ void
+ __throw_bad_typeid(void) __attribute__((__noreturn__));
+
+ // Helpers for exception objects in <stdexcept>
+ void
+ __throw_logic_error(const char*) __attribute__((__noreturn__));
+
+ void
+ __throw_domain_error(const char*) __attribute__((__noreturn__));
+
+ void
+ __throw_invalid_argument(const char*) __attribute__((__noreturn__));
+
+ void
+ __throw_length_error(const char*) __attribute__((__noreturn__));
+
+ void
+ __throw_out_of_range(const char*) __attribute__((__noreturn__));
+
+ void
+ __throw_runtime_error(const char*) __attribute__((__noreturn__));
+
+ void
+ __throw_range_error(const char*) __attribute__((__noreturn__));
+
+ void
+ __throw_overflow_error(const char*) __attribute__((__noreturn__));
+
+ void
+ __throw_underflow_error(const char*) __attribute__((__noreturn__));
+
+ // Helpers for exception objects in <ios>
+ void
+ __throw_ios_failure(const char*) __attribute__((__noreturn__));
+
+ void
+ __throw_system_error(int) __attribute__((__noreturn__));
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/bits/functional_hash.h b/i686-linux/include/c++/4.4.3/bits/functional_hash.h
new file mode 100644
index 0000000..892fcfa
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/functional_hash.h
@@ -0,0 +1,68 @@
+// functional_hash.h header -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/functional_hash.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _FUNCTIONAL_HASH_H
+#define _FUNCTIONAL_HASH_H 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#endif
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+#endif
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/functional_hash.h>
+#else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/functional_hash.h>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+#endif
+
+
+namespace std
+{
+ struct error_code;
+
+ template<>
+ size_t
+ hash<error_code>::operator()(error_code) const;
+}
+
+#endif // _FUNCTIONAL_HASH_H
+
diff --git a/i686-linux/include/c++/4.4.3/bits/gslice.h b/i686-linux/include/c++/4.4.3/bits/gslice.h
new file mode 100644
index 0000000..29ba46a
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/gslice.h
@@ -0,0 +1,182 @@
+// The template and inlines for the -*- C++ -*- gslice class.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2004, 2005, 2006, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file gslice.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
+
+#ifndef _GSLICE_H
+#define _GSLICE_H 1
+
+#pragma GCC system_header
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @addtogroup numeric_arrays
+ * @{
+ */
+
+ /**
+ * @brief Class defining multi-dimensional subset of an array.
+ *
+ * The slice class represents a multi-dimensional subset of an array,
+ * specified by three parameter sets: start offset, size array, and stride
+ * array. The start offset is the index of the first element of the array
+ * that is part of the subset. The size and stride array describe each
+ * dimension of the slice. Size is the number of elements in that
+ * dimension, and stride is the distance in the array between successive
+ * elements in that dimension. Each dimension's size and stride is taken
+ * to begin at an array element described by the previous dimension. The
+ * size array and stride array must be the same size.
+ *
+ * For example, if you have offset==3, stride[0]==11, size[1]==3,
+ * stride[1]==3, then slice[0,0]==array[3], slice[0,1]==array[6],
+ * slice[0,2]==array[9], slice[1,0]==array[14], slice[1,1]==array[17],
+ * slice[1,2]==array[20].
+ */
+ class gslice
+ {
+ public:
+ /// Construct an empty slice.
+ gslice();
+
+ /**
+ * @brief Construct a slice.
+ *
+ * Constructs a slice with as many dimensions as the length of the @a l
+ * and @a s arrays.
+ *
+ * @param o Offset in array of first element.
+ * @param l Array of dimension lengths.
+ * @param s Array of dimension strides between array elements.
+ */
+ gslice(size_t, const valarray<size_t>&, const valarray<size_t>&);
+
+ // XXX: the IS says the copy-ctor and copy-assignment operators are
+ // synthesized by the compiler but they are just unsuitable
+ // for a ref-counted semantic
+ /// Copy constructor.
+ gslice(const gslice&);
+
+ /// Destructor.
+ ~gslice();
+
+ // XXX: See the note above.
+ /// Assignment operator.
+ gslice& operator=(const gslice&);
+
+ /// Return array offset of first slice element.
+ size_t start() const;
+
+ /// Return array of sizes of slice dimensions.
+ valarray<size_t> size() const;
+
+ /// Return array of array strides for each dimension.
+ valarray<size_t> stride() const;
+
+ private:
+ struct _Indexer
+ {
+ size_t _M_count;
+ size_t _M_start;
+ valarray<size_t> _M_size;
+ valarray<size_t> _M_stride;
+ valarray<size_t> _M_index; // Linear array of referenced indices
+
+ _Indexer()
+ : _M_count(1), _M_start(0), _M_size(), _M_stride(), _M_index() {}
+
+ _Indexer(size_t, const valarray<size_t>&,
+ const valarray<size_t>&);
+
+ void
+ _M_increment_use()
+ { ++_M_count; }
+
+ size_t
+ _M_decrement_use()
+ { return --_M_count; }
+ };
+
+ _Indexer* _M_index;
+
+ template<typename _Tp> friend class valarray;
+ };
+
+ inline size_t
+ gslice::start() const
+ { return _M_index ? _M_index->_M_start : 0; }
+
+ inline valarray<size_t>
+ gslice::size() const
+ { return _M_index ? _M_index->_M_size : valarray<size_t>(); }
+
+ inline valarray<size_t>
+ gslice::stride() const
+ { return _M_index ? _M_index->_M_stride : valarray<size_t>(); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 543. valarray slice default constructor
+ inline
+ gslice::gslice()
+ : _M_index(new gslice::_Indexer()) {}
+
+ inline
+ gslice::gslice(size_t __o, const valarray<size_t>& __l,
+ const valarray<size_t>& __s)
+ : _M_index(new gslice::_Indexer(__o, __l, __s)) {}
+
+ inline
+ gslice::gslice(const gslice& __g)
+ : _M_index(__g._M_index)
+ { if (_M_index) _M_index->_M_increment_use(); }
+
+ inline
+ gslice::~gslice()
+ {
+ if (_M_index && _M_index->_M_decrement_use() == 0)
+ delete _M_index;
+ }
+
+ inline gslice&
+ gslice::operator=(const gslice& __g)
+ {
+ if (__g._M_index)
+ __g._M_index->_M_increment_use();
+ if (_M_index && _M_index->_M_decrement_use() == 0)
+ delete _M_index;
+ _M_index = __g._M_index;
+ return *this;
+ }
+
+ // @} group numeric_arrays
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _GSLICE_H */
diff --git a/i686-linux/include/c++/4.4.3/bits/gslice_array.h b/i686-linux/include/c++/4.4.3/bits/gslice_array.h
new file mode 100644
index 0000000..745a5a8
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/gslice_array.h
@@ -0,0 +1,216 @@
+// The template and inlines for the -*- C++ -*- gslice_array class.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2004, 2005, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file gslice_array.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
+
+#ifndef _GSLICE_ARRAY_H
+#define _GSLICE_ARRAY_H 1
+
+#pragma GCC system_header
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @addtogroup numeric_arrays
+ * @{
+ */
+
+ /**
+ * @brief Reference to multi-dimensional subset of an array.
+ *
+ * A gslice_array is a reference to the actual elements of an array
+ * specified by a gslice. The way to get a gslice_array is to call
+ * operator[](gslice) on a valarray. The returned gslice_array then
+ * permits carrying operations out on the referenced subset of elements in
+ * the original valarray. For example, operator+=(valarray) will add
+ * values to the subset of elements in the underlying valarray this
+ * gslice_array refers to.
+ *
+ * @param Tp Element type.
+ */
+ template<typename _Tp>
+ class gslice_array
+ {
+ public:
+ typedef _Tp value_type;
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 253. valarray helper functions are almost entirely useless
+
+ /// Copy constructor. Both slices refer to the same underlying array.
+ gslice_array(const gslice_array&);
+
+ /// Assignment operator. Assigns slice elements to corresponding
+ /// elements of @a a.
+ gslice_array& operator=(const gslice_array&);
+
+ /// Assign slice elements to corresponding elements of @a v.
+ void operator=(const valarray<_Tp>&) const;
+ /// Multiply slice elements by corresponding elements of @a v.
+ void operator*=(const valarray<_Tp>&) const;
+ /// Divide slice elements by corresponding elements of @a v.
+ void operator/=(const valarray<_Tp>&) const;
+ /// Modulo slice elements by corresponding elements of @a v.
+ void operator%=(const valarray<_Tp>&) const;
+ /// Add corresponding elements of @a v to slice elements.
+ void operator+=(const valarray<_Tp>&) const;
+ /// Subtract corresponding elements of @a v from slice elements.
+ void operator-=(const valarray<_Tp>&) const;
+ /// Logical xor slice elements with corresponding elements of @a v.
+ void operator^=(const valarray<_Tp>&) const;
+ /// Logical and slice elements with corresponding elements of @a v.
+ void operator&=(const valarray<_Tp>&) const;
+ /// Logical or slice elements with corresponding elements of @a v.
+ void operator|=(const valarray<_Tp>&) const;
+ /// Left shift slice elements by corresponding elements of @a v.
+ void operator<<=(const valarray<_Tp>&) const;
+ /// Right shift slice elements by corresponding elements of @a v.
+ void operator>>=(const valarray<_Tp>&) const;
+ /// Assign all slice elements to @a t.
+ void operator=(const _Tp&) const;
+
+ template<class _Dom>
+ void operator=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator*=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator/=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator%=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator+=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator-=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator^=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator&=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator|=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator<<=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator>>=(const _Expr<_Dom, _Tp>&) const;
+
+ private:
+ _Array<_Tp> _M_array;
+ const valarray<size_t>& _M_index;
+
+ friend class valarray<_Tp>;
+
+ gslice_array(_Array<_Tp>, const valarray<size_t>&);
+
+ // not implemented
+ gslice_array();
+ };
+
+ template<typename _Tp>
+ inline
+ gslice_array<_Tp>::gslice_array(_Array<_Tp> __a,
+ const valarray<size_t>& __i)
+ : _M_array(__a), _M_index(__i) {}
+
+ template<typename _Tp>
+ inline
+ gslice_array<_Tp>::gslice_array(const gslice_array<_Tp>& __a)
+ : _M_array(__a._M_array), _M_index(__a._M_index) {}
+
+ template<typename _Tp>
+ inline gslice_array<_Tp>&
+ gslice_array<_Tp>::operator=(const gslice_array<_Tp>& __a)
+ {
+ std::__valarray_copy(_Array<_Tp>(__a._M_array),
+ _Array<size_t>(__a._M_index), _M_index.size(),
+ _M_array, _Array<size_t>(_M_index));
+ return *this;
+ }
+
+ template<typename _Tp>
+ inline void
+ gslice_array<_Tp>::operator=(const _Tp& __t) const
+ {
+ std::__valarray_fill(_M_array, _Array<size_t>(_M_index),
+ _M_index.size(), __t);
+ }
+
+ template<typename _Tp>
+ inline void
+ gslice_array<_Tp>::operator=(const valarray<_Tp>& __v) const
+ {
+ std::__valarray_copy(_Array<_Tp>(__v), __v.size(),
+ _M_array, _Array<size_t>(_M_index));
+ }
+
+ template<typename _Tp>
+ template<class _Dom>
+ inline void
+ gslice_array<_Tp>::operator=(const _Expr<_Dom, _Tp>& __e) const
+ {
+ std::__valarray_copy (__e, _M_index.size(), _M_array,
+ _Array<size_t>(_M_index));
+ }
+
+#undef _DEFINE_VALARRAY_OPERATOR
+#define _DEFINE_VALARRAY_OPERATOR(_Op, _Name) \
+ template<typename _Tp> \
+ inline void \
+ gslice_array<_Tp>::operator _Op##=(const valarray<_Tp>& __v) const \
+ { \
+ _Array_augmented_##_Name(_M_array, _Array<size_t>(_M_index), \
+ _Array<_Tp>(__v), __v.size()); \
+ } \
+ \
+ template<typename _Tp> \
+ template<class _Dom> \
+ inline void \
+ gslice_array<_Tp>::operator _Op##= (const _Expr<_Dom, _Tp>& __e) const\
+ { \
+ _Array_augmented_##_Name(_M_array, _Array<size_t>(_M_index), __e,\
+ _M_index.size()); \
+ }
+
+_DEFINE_VALARRAY_OPERATOR(*, __multiplies)
+_DEFINE_VALARRAY_OPERATOR(/, __divides)
+_DEFINE_VALARRAY_OPERATOR(%, __modulus)
+_DEFINE_VALARRAY_OPERATOR(+, __plus)
+_DEFINE_VALARRAY_OPERATOR(-, __minus)
+_DEFINE_VALARRAY_OPERATOR(^, __bitwise_xor)
+_DEFINE_VALARRAY_OPERATOR(&, __bitwise_and)
+_DEFINE_VALARRAY_OPERATOR(|, __bitwise_or)
+_DEFINE_VALARRAY_OPERATOR(<<, __shift_left)
+_DEFINE_VALARRAY_OPERATOR(>>, __shift_right)
+
+#undef _DEFINE_VALARRAY_OPERATOR
+
+ // @} group numeric_arrays
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _GSLICE_ARRAY_H */
diff --git a/i686-linux/include/c++/4.4.3/bits/hashtable.h b/i686-linux/include/c++/4.4.3/bits/hashtable.h
new file mode 100644
index 0000000..cdfa8af
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/hashtable.h
@@ -0,0 +1,58 @@
+// hashtable.h header -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/hashtable.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _HASHTABLE_H
+#define _HASHTABLE_H 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#endif
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+#endif
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/hashtable>
+#else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/hashtable>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+#endif
+
+#endif // _HASHTABLE_H
+
diff --git a/i686-linux/include/c++/4.4.3/bits/indirect_array.h b/i686-linux/include/c++/4.4.3/bits/indirect_array.h
new file mode 100644
index 0000000..4920394
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/indirect_array.h
@@ -0,0 +1,210 @@
+// The template and inlines for the -*- C++ -*- indirect_array class.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file indirect_array.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
+
+#ifndef _INDIRECT_ARRAY_H
+#define _INDIRECT_ARRAY_H 1
+
+#pragma GCC system_header
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @addtogroup numeric_arrays
+ * @{
+ */
+
+ /**
+ * @brief Reference to arbitrary subset of an array.
+ *
+ * An indirect_array is a reference to the actual elements of an array
+ * specified by an ordered array of indices. The way to get an
+ * indirect_array is to call operator[](valarray<size_t>) on a valarray.
+ * The returned indirect_array then permits carrying operations out on the
+ * referenced subset of elements in the original valarray.
+ *
+ * For example, if an indirect_array is obtained using the array (4,2,0) as
+ * an argument, and then assigned to an array containing (1,2,3), then the
+ * underlying array will have array[0]==3, array[2]==2, and array[4]==1.
+ *
+ * @param Tp Element type.
+ */
+ template <class _Tp>
+ class indirect_array
+ {
+ public:
+ typedef _Tp value_type;
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 253. valarray helper functions are almost entirely useless
+
+ /// Copy constructor. Both slices refer to the same underlying array.
+ indirect_array(const indirect_array&);
+
+ /// Assignment operator. Assigns elements to corresponding elements
+ /// of @a a.
+ indirect_array& operator=(const indirect_array&);
+
+ /// Assign slice elements to corresponding elements of @a v.
+ void operator=(const valarray<_Tp>&) const;
+ /// Multiply slice elements by corresponding elements of @a v.
+ void operator*=(const valarray<_Tp>&) const;
+ /// Divide slice elements by corresponding elements of @a v.
+ void operator/=(const valarray<_Tp>&) const;
+ /// Modulo slice elements by corresponding elements of @a v.
+ void operator%=(const valarray<_Tp>&) const;
+ /// Add corresponding elements of @a v to slice elements.
+ void operator+=(const valarray<_Tp>&) const;
+ /// Subtract corresponding elements of @a v from slice elements.
+ void operator-=(const valarray<_Tp>&) const;
+ /// Logical xor slice elements with corresponding elements of @a v.
+ void operator^=(const valarray<_Tp>&) const;
+ /// Logical and slice elements with corresponding elements of @a v.
+ void operator&=(const valarray<_Tp>&) const;
+ /// Logical or slice elements with corresponding elements of @a v.
+ void operator|=(const valarray<_Tp>&) const;
+ /// Left shift slice elements by corresponding elements of @a v.
+ void operator<<=(const valarray<_Tp>&) const;
+ /// Right shift slice elements by corresponding elements of @a v.
+ void operator>>=(const valarray<_Tp>&) const;
+ /// Assign all slice elements to @a t.
+ void operator= (const _Tp&) const;
+ // ~indirect_array();
+
+ template<class _Dom>
+ void operator=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator*=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator/=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator%=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator+=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator-=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator^=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator&=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator|=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator<<=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator>>=(const _Expr<_Dom, _Tp>&) const;
+
+ private:
+ /// Copy constructor. Both slices refer to the same underlying array.
+ indirect_array(_Array<_Tp>, size_t, _Array<size_t>);
+
+ friend class valarray<_Tp>;
+ friend class gslice_array<_Tp>;
+
+ const size_t _M_sz;
+ const _Array<size_t> _M_index;
+ const _Array<_Tp> _M_array;
+
+ // not implemented
+ indirect_array();
+ };
+
+ template<typename _Tp>
+ inline
+ indirect_array<_Tp>::indirect_array(const indirect_array<_Tp>& __a)
+ : _M_sz(__a._M_sz), _M_index(__a._M_index), _M_array(__a._M_array) {}
+
+ template<typename _Tp>
+ inline
+ indirect_array<_Tp>::indirect_array(_Array<_Tp> __a, size_t __s,
+ _Array<size_t> __i)
+ : _M_sz(__s), _M_index(__i), _M_array(__a) {}
+
+ template<typename _Tp>
+ inline indirect_array<_Tp>&
+ indirect_array<_Tp>::operator=(const indirect_array<_Tp>& __a)
+ {
+ std::__valarray_copy(__a._M_array, _M_sz, __a._M_index, _M_array,
+ _M_index);
+ return *this;
+ }
+
+ template<typename _Tp>
+ inline void
+ indirect_array<_Tp>::operator=(const _Tp& __t) const
+ { std::__valarray_fill(_M_array, _M_index, _M_sz, __t); }
+
+ template<typename _Tp>
+ inline void
+ indirect_array<_Tp>::operator=(const valarray<_Tp>& __v) const
+ { std::__valarray_copy(_Array<_Tp>(__v), _M_sz, _M_array, _M_index); }
+
+ template<typename _Tp>
+ template<class _Dom>
+ inline void
+ indirect_array<_Tp>::operator=(const _Expr<_Dom, _Tp>& __e) const
+ { std::__valarray_copy(__e, _M_sz, _M_array, _M_index); }
+
+#undef _DEFINE_VALARRAY_OPERATOR
+#define _DEFINE_VALARRAY_OPERATOR(_Op, _Name) \
+ template<typename _Tp> \
+ inline void \
+ indirect_array<_Tp>::operator _Op##=(const valarray<_Tp>& __v) const\
+ { \
+ _Array_augmented_##_Name(_M_array, _M_index, _Array<_Tp>(__v), _M_sz); \
+ } \
+ \
+ template<typename _Tp> \
+ template<class _Dom> \
+ inline void \
+ indirect_array<_Tp>::operator _Op##=(const _Expr<_Dom,_Tp>& __e) const\
+ { \
+ _Array_augmented_##_Name(_M_array, _M_index, __e, _M_sz); \
+ }
+
+_DEFINE_VALARRAY_OPERATOR(*, __multiplies)
+_DEFINE_VALARRAY_OPERATOR(/, __divides)
+_DEFINE_VALARRAY_OPERATOR(%, __modulus)
+_DEFINE_VALARRAY_OPERATOR(+, __plus)
+_DEFINE_VALARRAY_OPERATOR(-, __minus)
+_DEFINE_VALARRAY_OPERATOR(^, __bitwise_xor)
+_DEFINE_VALARRAY_OPERATOR(&, __bitwise_and)
+_DEFINE_VALARRAY_OPERATOR(|, __bitwise_or)
+_DEFINE_VALARRAY_OPERATOR(<<, __shift_left)
+_DEFINE_VALARRAY_OPERATOR(>>, __shift_right)
+
+#undef _DEFINE_VALARRAY_OPERATOR
+
+ // @} group numeric_arrays
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _INDIRECT_ARRAY_H */
diff --git a/i686-linux/include/c++/4.4.3/bits/ios_base.h b/i686-linux/include/c++/4.4.3/bits/ios_base.h
new file mode 100644
index 0000000..8dde100
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/ios_base.h
@@ -0,0 +1,982 @@
+// Iostreams base classes -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ios_base.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 27.4 Iostreams base classes
+//
+
+#ifndef _IOS_BASE_H
+#define _IOS_BASE_H 1
+
+#pragma GCC system_header
+
+#include <ext/atomicity.h>
+#include <bits/localefwd.h>
+#include <bits/locale_classes.h>
+
+#ifndef _GLIBCXX_STDIO_MACROS
+# include <cstdio> // For SEEK_CUR, SEEK_END
+# define _IOS_BASE_SEEK_CUR SEEK_CUR
+# define _IOS_BASE_SEEK_END SEEK_END
+#else
+# define _IOS_BASE_SEEK_CUR 1
+# define _IOS_BASE_SEEK_END 2
+#endif
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // The following definitions of bitmask types are enums, not ints,
+ // as permitted (but not required) in the standard, in order to provide
+ // better type safety in iostream calls. A side effect is that
+ // expressions involving them are no longer compile-time constants.
+ enum _Ios_Fmtflags
+ {
+ _S_boolalpha = 1L << 0,
+ _S_dec = 1L << 1,
+ _S_fixed = 1L << 2,
+ _S_hex = 1L << 3,
+ _S_internal = 1L << 4,
+ _S_left = 1L << 5,
+ _S_oct = 1L << 6,
+ _S_right = 1L << 7,
+ _S_scientific = 1L << 8,
+ _S_showbase = 1L << 9,
+ _S_showpoint = 1L << 10,
+ _S_showpos = 1L << 11,
+ _S_skipws = 1L << 12,
+ _S_unitbuf = 1L << 13,
+ _S_uppercase = 1L << 14,
+ _S_adjustfield = _S_left | _S_right | _S_internal,
+ _S_basefield = _S_dec | _S_oct | _S_hex,
+ _S_floatfield = _S_scientific | _S_fixed,
+ _S_ios_fmtflags_end = 1L << 16
+ };
+
+ inline _Ios_Fmtflags
+ operator&(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
+ { return _Ios_Fmtflags(static_cast<int>(__a) & static_cast<int>(__b)); }
+
+ inline _Ios_Fmtflags
+ operator|(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
+ { return _Ios_Fmtflags(static_cast<int>(__a) | static_cast<int>(__b)); }
+
+ inline _Ios_Fmtflags
+ operator^(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
+ { return _Ios_Fmtflags(static_cast<int>(__a) ^ static_cast<int>(__b)); }
+
+ inline _Ios_Fmtflags&
+ operator|=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
+ { return __a = __a | __b; }
+
+ inline _Ios_Fmtflags&
+ operator&=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
+ { return __a = __a & __b; }
+
+ inline _Ios_Fmtflags&
+ operator^=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
+ { return __a = __a ^ __b; }
+
+ inline _Ios_Fmtflags
+ operator~(_Ios_Fmtflags __a)
+ { return _Ios_Fmtflags(~static_cast<int>(__a)); }
+
+
+ enum _Ios_Openmode
+ {
+ _S_app = 1L << 0,
+ _S_ate = 1L << 1,
+ _S_bin = 1L << 2,
+ _S_in = 1L << 3,
+ _S_out = 1L << 4,
+ _S_trunc = 1L << 5,
+ _S_ios_openmode_end = 1L << 16
+ };
+
+ inline _Ios_Openmode
+ operator&(_Ios_Openmode __a, _Ios_Openmode __b)
+ { return _Ios_Openmode(static_cast<int>(__a) & static_cast<int>(__b)); }
+
+ inline _Ios_Openmode
+ operator|(_Ios_Openmode __a, _Ios_Openmode __b)
+ { return _Ios_Openmode(static_cast<int>(__a) | static_cast<int>(__b)); }
+
+ inline _Ios_Openmode
+ operator^(_Ios_Openmode __a, _Ios_Openmode __b)
+ { return _Ios_Openmode(static_cast<int>(__a) ^ static_cast<int>(__b)); }
+
+ inline _Ios_Openmode&
+ operator|=(_Ios_Openmode& __a, _Ios_Openmode __b)
+ { return __a = __a | __b; }
+
+ inline _Ios_Openmode&
+ operator&=(_Ios_Openmode& __a, _Ios_Openmode __b)
+ { return __a = __a & __b; }
+
+ inline _Ios_Openmode&
+ operator^=(_Ios_Openmode& __a, _Ios_Openmode __b)
+ { return __a = __a ^ __b; }
+
+ inline _Ios_Openmode
+ operator~(_Ios_Openmode __a)
+ { return _Ios_Openmode(~static_cast<int>(__a)); }
+
+
+ enum _Ios_Iostate
+ {
+ _S_goodbit = 0,
+ _S_badbit = 1L << 0,
+ _S_eofbit = 1L << 1,
+ _S_failbit = 1L << 2,
+ _S_ios_iostate_end = 1L << 16
+ };
+
+ inline _Ios_Iostate
+ operator&(_Ios_Iostate __a, _Ios_Iostate __b)
+ { return _Ios_Iostate(static_cast<int>(__a) & static_cast<int>(__b)); }
+
+ inline _Ios_Iostate
+ operator|(_Ios_Iostate __a, _Ios_Iostate __b)
+ { return _Ios_Iostate(static_cast<int>(__a) | static_cast<int>(__b)); }
+
+ inline _Ios_Iostate
+ operator^(_Ios_Iostate __a, _Ios_Iostate __b)
+ { return _Ios_Iostate(static_cast<int>(__a) ^ static_cast<int>(__b)); }
+
+ inline _Ios_Iostate&
+ operator|=(_Ios_Iostate& __a, _Ios_Iostate __b)
+ { return __a = __a | __b; }
+
+ inline _Ios_Iostate&
+ operator&=(_Ios_Iostate& __a, _Ios_Iostate __b)
+ { return __a = __a & __b; }
+
+ inline _Ios_Iostate&
+ operator^=(_Ios_Iostate& __a, _Ios_Iostate __b)
+ { return __a = __a ^ __b; }
+
+ inline _Ios_Iostate
+ operator~(_Ios_Iostate __a)
+ { return _Ios_Iostate(~static_cast<int>(__a)); }
+
+ enum _Ios_Seekdir
+ {
+ _S_beg = 0,
+ _S_cur = _IOS_BASE_SEEK_CUR,
+ _S_end = _IOS_BASE_SEEK_END,
+ _S_ios_seekdir_end = 1L << 16
+ };
+
+ // 27.4.2 Class ios_base
+ /**
+ * @brief The base of the I/O class hierarchy.
+ * @ingroup io
+ *
+ * This class defines everything that can be defined about I/O that does
+ * not depend on the type of characters being input or output. Most
+ * people will only see @c ios_base when they need to specify the full
+ * name of the various I/O flags (e.g., the openmodes).
+ */
+ class ios_base
+ {
+ public:
+
+ /**
+ * @brief These are thrown to indicate problems with io.
+ * @ingroup exceptions
+ *
+ * 27.4.2.1.1 Class ios_base::failure
+ */
+ class failure : public exception
+ {
+ public:
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 48. Use of non-existent exception constructor
+ explicit
+ failure(const string& __str) throw();
+
+ // This declaration is not useless:
+ // http://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/Vague-Linkage.html
+ virtual
+ ~failure() throw();
+
+ virtual const char*
+ what() const throw();
+
+ private:
+ string _M_msg;
+ };
+
+ // 27.4.2.1.2 Type ios_base::fmtflags
+ /**
+ * @brief This is a bitmask type.
+ *
+ * @c "_Ios_Fmtflags" is implementation-defined, but it is valid to
+ * perform bitwise operations on these values and expect the Right
+ * Thing to happen. Defined objects of type fmtflags are:
+ * - boolalpha
+ * - dec
+ * - fixed
+ * - hex
+ * - internal
+ * - left
+ * - oct
+ * - right
+ * - scientific
+ * - showbase
+ * - showpoint
+ * - showpos
+ * - skipws
+ * - unitbuf
+ * - uppercase
+ * - adjustfield
+ * - basefield
+ * - floatfield
+ */
+ typedef _Ios_Fmtflags fmtflags;
+
+ /// Insert/extract @c bool in alphabetic rather than numeric format.
+ static const fmtflags boolalpha = _S_boolalpha;
+
+ /// Converts integer input or generates integer output in decimal base.
+ static const fmtflags dec = _S_dec;
+
+ /// Generate floating-point output in fixed-point notation.
+ static const fmtflags fixed = _S_fixed;
+
+ /// Converts integer input or generates integer output in hexadecimal base.
+ static const fmtflags hex = _S_hex;
+
+ /// Adds fill characters at a designated internal point in certain
+ /// generated output, or identical to @c right if no such point is
+ /// designated.
+ static const fmtflags internal = _S_internal;
+
+ /// Adds fill characters on the right (final positions) of certain
+ /// generated output. (I.e., the thing you print is flush left.)
+ static const fmtflags left = _S_left;
+
+ /// Converts integer input or generates integer output in octal base.
+ static const fmtflags oct = _S_oct;
+
+ /// Adds fill characters on the left (initial positions) of certain
+ /// generated output. (I.e., the thing you print is flush right.)
+ static const fmtflags right = _S_right;
+
+ /// Generates floating-point output in scientific notation.
+ static const fmtflags scientific = _S_scientific;
+
+ /// Generates a prefix indicating the numeric base of generated integer
+ /// output.
+ static const fmtflags showbase = _S_showbase;
+
+ /// Generates a decimal-point character unconditionally in generated
+ /// floating-point output.
+ static const fmtflags showpoint = _S_showpoint;
+
+ /// Generates a + sign in non-negative generated numeric output.
+ static const fmtflags showpos = _S_showpos;
+
+ /// Skips leading white space before certain input operations.
+ static const fmtflags skipws = _S_skipws;
+
+ /// Flushes output after each output operation.
+ static const fmtflags unitbuf = _S_unitbuf;
+
+ /// Replaces certain lowercase letters with their uppercase equivalents
+ /// in generated output.
+ static const fmtflags uppercase = _S_uppercase;
+
+ /// A mask of left|right|internal. Useful for the 2-arg form of @c setf.
+ static const fmtflags adjustfield = _S_adjustfield;
+
+ /// A mask of dec|oct|hex. Useful for the 2-arg form of @c setf.
+ static const fmtflags basefield = _S_basefield;
+
+ /// A mask of scientific|fixed. Useful for the 2-arg form of @c setf.
+ static const fmtflags floatfield = _S_floatfield;
+
+ // 27.4.2.1.3 Type ios_base::iostate
+ /**
+ * @brief This is a bitmask type.
+ *
+ * @c "_Ios_Iostate" is implementation-defined, but it is valid to
+ * perform bitwise operations on these values and expect the Right
+ * Thing to happen. Defined objects of type iostate are:
+ * - badbit
+ * - eofbit
+ * - failbit
+ * - goodbit
+ */
+ typedef _Ios_Iostate iostate;
+
+ /// Indicates a loss of integrity in an input or output sequence (such
+ /// as an irrecoverable read error from a file).
+ static const iostate badbit = _S_badbit;
+
+ /// Indicates that an input operation reached the end of an input sequence.
+ static const iostate eofbit = _S_eofbit;
+
+ /// Indicates that an input operation failed to read the expected
+ /// characters, or that an output operation failed to generate the
+ /// desired characters.
+ static const iostate failbit = _S_failbit;
+
+ /// Indicates all is well.
+ static const iostate goodbit = _S_goodbit;
+
+ // 27.4.2.1.4 Type ios_base::openmode
+ /**
+ * @brief This is a bitmask type.
+ *
+ * @c "_Ios_Openmode" is implementation-defined, but it is valid to
+ * perform bitwise operations on these values and expect the Right
+ * Thing to happen. Defined objects of type openmode are:
+ * - app
+ * - ate
+ * - binary
+ * - in
+ * - out
+ * - trunc
+ */
+ typedef _Ios_Openmode openmode;
+
+ /// Seek to end before each write.
+ static const openmode app = _S_app;
+
+ /// Open and seek to end immediately after opening.
+ static const openmode ate = _S_ate;
+
+ /// Perform input and output in binary mode (as opposed to text mode).
+ /// This is probably not what you think it is; see
+ /// http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt11ch27s02.html
+ static const openmode binary = _S_bin;
+
+ /// Open for input. Default for @c ifstream and fstream.
+ static const openmode in = _S_in;
+
+ /// Open for output. Default for @c ofstream and fstream.
+ static const openmode out = _S_out;
+
+ /// Open for input. Default for @c ofstream.
+ static const openmode trunc = _S_trunc;
+
+ // 27.4.2.1.5 Type ios_base::seekdir
+ /**
+ * @brief This is an enumerated type.
+ *
+ * @c "_Ios_Seekdir" is implementation-defined. Defined values
+ * of type seekdir are:
+ * - beg
+ * - cur, equivalent to @c SEEK_CUR in the C standard library.
+ * - end, equivalent to @c SEEK_END in the C standard library.
+ */
+ typedef _Ios_Seekdir seekdir;
+
+ /// Request a seek relative to the beginning of the stream.
+ static const seekdir beg = _S_beg;
+
+ /// Request a seek relative to the current position within the sequence.
+ static const seekdir cur = _S_cur;
+
+ /// Request a seek relative to the current end of the sequence.
+ static const seekdir end = _S_end;
+
+ // Annex D.6
+ typedef int io_state;
+ typedef int open_mode;
+ typedef int seek_dir;
+
+ typedef std::streampos streampos;
+ typedef std::streamoff streamoff;
+
+ // Callbacks;
+ /**
+ * @brief The set of events that may be passed to an event callback.
+ *
+ * erase_event is used during ~ios() and copyfmt(). imbue_event is used
+ * during imbue(). copyfmt_event is used during copyfmt().
+ */
+ enum event
+ {
+ erase_event,
+ imbue_event,
+ copyfmt_event
+ };
+
+ /**
+ * @brief The type of an event callback function.
+ * @param event One of the members of the event enum.
+ * @param ios_base Reference to the ios_base object.
+ * @param int The integer provided when the callback was registered.
+ *
+ * Event callbacks are user defined functions that get called during
+ * several ios_base and basic_ios functions, specifically imbue(),
+ * copyfmt(), and ~ios().
+ */
+ typedef void (*event_callback) (event, ios_base&, int);
+
+ /**
+ * @brief Add the callback __fn with parameter __index.
+ * @param __fn The function to add.
+ * @param __index The integer to pass to the function when invoked.
+ *
+ * Registers a function as an event callback with an integer parameter to
+ * be passed to the function when invoked. Multiple copies of the
+ * function are allowed. If there are multiple callbacks, they are
+ * invoked in the order they were registered.
+ */
+ void
+ register_callback(event_callback __fn, int __index);
+
+ protected:
+ //@{
+ /**
+ * ios_base data members (doc me)
+ */
+ streamsize _M_precision;
+ streamsize _M_width;
+ fmtflags _M_flags;
+ iostate _M_exception;
+ iostate _M_streambuf_state;
+ //@}
+
+ // 27.4.2.6 Members for callbacks
+ // 27.4.2.6 ios_base callbacks
+ struct _Callback_list
+ {
+ // Data Members
+ _Callback_list* _M_next;
+ ios_base::event_callback _M_fn;
+ int _M_index;
+ _Atomic_word _M_refcount; // 0 means one reference.
+
+ _Callback_list(ios_base::event_callback __fn, int __index,
+ _Callback_list* __cb)
+ : _M_next(__cb), _M_fn(__fn), _M_index(__index), _M_refcount(0) { }
+
+ void
+ _M_add_reference() { __gnu_cxx::__atomic_add_dispatch(&_M_refcount, 1); }
+
+ // 0 => OK to delete.
+ int
+ _M_remove_reference()
+ { return __gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1); }
+ };
+
+ _Callback_list* _M_callbacks;
+
+ void
+ _M_call_callbacks(event __ev) throw();
+
+ void
+ _M_dispose_callbacks(void);
+
+ // 27.4.2.5 Members for iword/pword storage
+ struct _Words
+ {
+ void* _M_pword;
+ long _M_iword;
+ _Words() : _M_pword(0), _M_iword(0) { }
+ };
+
+ // Only for failed iword/pword calls.
+ _Words _M_word_zero;
+
+ // Guaranteed storage.
+ // The first 5 iword and pword slots are reserved for internal use.
+ enum { _S_local_word_size = 8 };
+ _Words _M_local_word[_S_local_word_size];
+
+ // Allocated storage.
+ int _M_word_size;
+ _Words* _M_word;
+
+ _Words&
+ _M_grow_words(int __index, bool __iword);
+
+ // Members for locale and locale caching.
+ locale _M_ios_locale;
+
+ void
+ _M_init();
+
+ public:
+
+ // 27.4.2.1.6 Class ios_base::Init
+ // Used to initialize standard streams. In theory, g++ could use
+ // -finit-priority to order this stuff correctly without going
+ // through these machinations.
+ class Init
+ {
+ friend class ios_base;
+ public:
+ Init();
+ ~Init();
+
+ private:
+ static _Atomic_word _S_refcount;
+ static bool _S_synced_with_stdio;
+ };
+
+ // [27.4.2.2] fmtflags state functions
+ /**
+ * @brief Access to format flags.
+ * @return The format control flags for both input and output.
+ */
+ fmtflags
+ flags() const
+ { return _M_flags; }
+
+ /**
+ * @brief Setting new format flags all at once.
+ * @param fmtfl The new flags to set.
+ * @return The previous format control flags.
+ *
+ * This function overwrites all the format flags with @a fmtfl.
+ */
+ fmtflags
+ flags(fmtflags __fmtfl)
+ {
+ fmtflags __old = _M_flags;
+ _M_flags = __fmtfl;
+ return __old;
+ }
+
+ /**
+ * @brief Setting new format flags.
+ * @param fmtfl Additional flags to set.
+ * @return The previous format control flags.
+ *
+ * This function sets additional flags in format control. Flags that
+ * were previously set remain set.
+ */
+ fmtflags
+ setf(fmtflags __fmtfl)
+ {
+ fmtflags __old = _M_flags;
+ _M_flags |= __fmtfl;
+ return __old;
+ }
+
+ /**
+ * @brief Setting new format flags.
+ * @param fmtfl Additional flags to set.
+ * @param mask The flags mask for @a fmtfl.
+ * @return The previous format control flags.
+ *
+ * This function clears @a mask in the format flags, then sets
+ * @a fmtfl @c & @a mask. An example mask is @c ios_base::adjustfield.
+ */
+ fmtflags
+ setf(fmtflags __fmtfl, fmtflags __mask)
+ {
+ fmtflags __old = _M_flags;
+ _M_flags &= ~__mask;
+ _M_flags |= (__fmtfl & __mask);
+ return __old;
+ }
+
+ /**
+ * @brief Clearing format flags.
+ * @param mask The flags to unset.
+ *
+ * This function clears @a mask in the format flags.
+ */
+ void
+ unsetf(fmtflags __mask)
+ { _M_flags &= ~__mask; }
+
+ /**
+ * @brief Flags access.
+ * @return The precision to generate on certain output operations.
+ *
+ * Be careful if you try to give a definition of "precision" here; see
+ * DR 189.
+ */
+ streamsize
+ precision() const
+ { return _M_precision; }
+
+ /**
+ * @brief Changing flags.
+ * @param prec The new precision value.
+ * @return The previous value of precision().
+ */
+ streamsize
+ precision(streamsize __prec)
+ {
+ streamsize __old = _M_precision;
+ _M_precision = __prec;
+ return __old;
+ }
+
+ /**
+ * @brief Flags access.
+ * @return The minimum field width to generate on output operations.
+ *
+ * "Minimum field width" refers to the number of characters.
+ */
+ streamsize
+ width() const
+ { return _M_width; }
+
+ /**
+ * @brief Changing flags.
+ * @param wide The new width value.
+ * @return The previous value of width().
+ */
+ streamsize
+ width(streamsize __wide)
+ {
+ streamsize __old = _M_width;
+ _M_width = __wide;
+ return __old;
+ }
+
+ // [27.4.2.4] ios_base static members
+ /**
+ * @brief Interaction with the standard C I/O objects.
+ * @param sync Whether to synchronize or not.
+ * @return True if the standard streams were previously synchronized.
+ *
+ * The synchronization referred to is @e only that between the standard
+ * C facilities (e.g., stdout) and the standard C++ objects (e.g.,
+ * cout). User-declared streams are unaffected. See
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt11ch28s02.html
+ */
+ static bool
+ sync_with_stdio(bool __sync = true);
+
+ // [27.4.2.3] ios_base locale functions
+ /**
+ * @brief Setting a new locale.
+ * @param loc The new locale.
+ * @return The previous locale.
+ *
+ * Sets the new locale for this stream, and then invokes each callback
+ * with imbue_event.
+ */
+ locale
+ imbue(const locale& __loc);
+
+ /**
+ * @brief Locale access
+ * @return A copy of the current locale.
+ *
+ * If @c imbue(loc) has previously been called, then this function
+ * returns @c loc. Otherwise, it returns a copy of @c std::locale(),
+ * the global C++ locale.
+ */
+ locale
+ getloc() const
+ { return _M_ios_locale; }
+
+ /**
+ * @brief Locale access
+ * @return A reference to the current locale.
+ *
+ * Like getloc above, but returns a reference instead of
+ * generating a copy.
+ */
+ const locale&
+ _M_getloc() const
+ { return _M_ios_locale; }
+
+ // [27.4.2.5] ios_base storage functions
+ /**
+ * @brief Access to unique indices.
+ * @return An integer different from all previous calls.
+ *
+ * This function returns a unique integer every time it is called. It
+ * can be used for any purpose, but is primarily intended to be a unique
+ * index for the iword and pword functions. The expectation is that an
+ * application calls xalloc in order to obtain an index in the iword and
+ * pword arrays that can be used without fear of conflict.
+ *
+ * The implementation maintains a static variable that is incremented and
+ * returned on each invocation. xalloc is guaranteed to return an index
+ * that is safe to use in the iword and pword arrays.
+ */
+ static int
+ xalloc() throw();
+
+ /**
+ * @brief Access to integer array.
+ * @param __ix Index into the array.
+ * @return A reference to an integer associated with the index.
+ *
+ * The iword function provides access to an array of integers that can be
+ * used for any purpose. The array grows as required to hold the
+ * supplied index. All integers in the array are initialized to 0.
+ *
+ * The implementation reserves several indices. You should use xalloc to
+ * obtain an index that is safe to use. Also note that since the array
+ * can grow dynamically, it is not safe to hold onto the reference.
+ */
+ long&
+ iword(int __ix)
+ {
+ _Words& __word = (__ix < _M_word_size)
+ ? _M_word[__ix] : _M_grow_words(__ix, true);
+ return __word._M_iword;
+ }
+
+ /**
+ * @brief Access to void pointer array.
+ * @param __ix Index into the array.
+ * @return A reference to a void* associated with the index.
+ *
+ * The pword function provides access to an array of pointers that can be
+ * used for any purpose. The array grows as required to hold the
+ * supplied index. All pointers in the array are initialized to 0.
+ *
+ * The implementation reserves several indices. You should use xalloc to
+ * obtain an index that is safe to use. Also note that since the array
+ * can grow dynamically, it is not safe to hold onto the reference.
+ */
+ void*&
+ pword(int __ix)
+ {
+ _Words& __word = (__ix < _M_word_size)
+ ? _M_word[__ix] : _M_grow_words(__ix, false);
+ return __word._M_pword;
+ }
+
+ // Destructor
+ /**
+ * Invokes each callback with erase_event. Destroys local storage.
+ *
+ * Note that the ios_base object for the standard streams never gets
+ * destroyed. As a result, any callbacks registered with the standard
+ * streams will not get invoked with erase_event (unless copyfmt is
+ * used).
+ */
+ virtual ~ios_base();
+
+ protected:
+ ios_base();
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 50. Copy constructor and assignment operator of ios_base
+ private:
+ ios_base(const ios_base&);
+
+ ios_base&
+ operator=(const ios_base&);
+ };
+
+ // [27.4.5.1] fmtflags manipulators
+ /// Calls base.setf(ios_base::boolalpha).
+ inline ios_base&
+ boolalpha(ios_base& __base)
+ {
+ __base.setf(ios_base::boolalpha);
+ return __base;
+ }
+
+ /// Calls base.unsetf(ios_base::boolalpha).
+ inline ios_base&
+ noboolalpha(ios_base& __base)
+ {
+ __base.unsetf(ios_base::boolalpha);
+ return __base;
+ }
+
+ /// Calls base.setf(ios_base::showbase).
+ inline ios_base&
+ showbase(ios_base& __base)
+ {
+ __base.setf(ios_base::showbase);
+ return __base;
+ }
+
+ /// Calls base.unsetf(ios_base::showbase).
+ inline ios_base&
+ noshowbase(ios_base& __base)
+ {
+ __base.unsetf(ios_base::showbase);
+ return __base;
+ }
+
+ /// Calls base.setf(ios_base::showpoint).
+ inline ios_base&
+ showpoint(ios_base& __base)
+ {
+ __base.setf(ios_base::showpoint);
+ return __base;
+ }
+
+ /// Calls base.unsetf(ios_base::showpoint).
+ inline ios_base&
+ noshowpoint(ios_base& __base)
+ {
+ __base.unsetf(ios_base::showpoint);
+ return __base;
+ }
+
+ /// Calls base.setf(ios_base::showpos).
+ inline ios_base&
+ showpos(ios_base& __base)
+ {
+ __base.setf(ios_base::showpos);
+ return __base;
+ }
+
+ /// Calls base.unsetf(ios_base::showpos).
+ inline ios_base&
+ noshowpos(ios_base& __base)
+ {
+ __base.unsetf(ios_base::showpos);
+ return __base;
+ }
+
+ /// Calls base.setf(ios_base::skipws).
+ inline ios_base&
+ skipws(ios_base& __base)
+ {
+ __base.setf(ios_base::skipws);
+ return __base;
+ }
+
+ /// Calls base.unsetf(ios_base::skipws).
+ inline ios_base&
+ noskipws(ios_base& __base)
+ {
+ __base.unsetf(ios_base::skipws);
+ return __base;
+ }
+
+ /// Calls base.setf(ios_base::uppercase).
+ inline ios_base&
+ uppercase(ios_base& __base)
+ {
+ __base.setf(ios_base::uppercase);
+ return __base;
+ }
+
+ /// Calls base.unsetf(ios_base::uppercase).
+ inline ios_base&
+ nouppercase(ios_base& __base)
+ {
+ __base.unsetf(ios_base::uppercase);
+ return __base;
+ }
+
+ /// Calls base.setf(ios_base::unitbuf).
+ inline ios_base&
+ unitbuf(ios_base& __base)
+ {
+ __base.setf(ios_base::unitbuf);
+ return __base;
+ }
+
+ /// Calls base.unsetf(ios_base::unitbuf).
+ inline ios_base&
+ nounitbuf(ios_base& __base)
+ {
+ __base.unsetf(ios_base::unitbuf);
+ return __base;
+ }
+
+ // [27.4.5.2] adjustfield manipulators
+ /// Calls base.setf(ios_base::internal, ios_base::adjustfield).
+ inline ios_base&
+ internal(ios_base& __base)
+ {
+ __base.setf(ios_base::internal, ios_base::adjustfield);
+ return __base;
+ }
+
+ /// Calls base.setf(ios_base::left, ios_base::adjustfield).
+ inline ios_base&
+ left(ios_base& __base)
+ {
+ __base.setf(ios_base::left, ios_base::adjustfield);
+ return __base;
+ }
+
+ /// Calls base.setf(ios_base::right, ios_base::adjustfield).
+ inline ios_base&
+ right(ios_base& __base)
+ {
+ __base.setf(ios_base::right, ios_base::adjustfield);
+ return __base;
+ }
+
+ // [27.4.5.3] basefield manipulators
+ /// Calls base.setf(ios_base::dec, ios_base::basefield).
+ inline ios_base&
+ dec(ios_base& __base)
+ {
+ __base.setf(ios_base::dec, ios_base::basefield);
+ return __base;
+ }
+
+ /// Calls base.setf(ios_base::hex, ios_base::basefield).
+ inline ios_base&
+ hex(ios_base& __base)
+ {
+ __base.setf(ios_base::hex, ios_base::basefield);
+ return __base;
+ }
+
+ /// Calls base.setf(ios_base::oct, ios_base::basefield).
+ inline ios_base&
+ oct(ios_base& __base)
+ {
+ __base.setf(ios_base::oct, ios_base::basefield);
+ return __base;
+ }
+
+ // [27.4.5.4] floatfield manipulators
+ /// Calls base.setf(ios_base::fixed, ios_base::floatfield).
+ inline ios_base&
+ fixed(ios_base& __base)
+ {
+ __base.setf(ios_base::fixed, ios_base::floatfield);
+ return __base;
+ }
+
+ /// Calls base.setf(ios_base::scientific, ios_base::floatfield).
+ inline ios_base&
+ scientific(ios_base& __base)
+ {
+ __base.setf(ios_base::scientific, ios_base::floatfield);
+ return __base;
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#undef _IOS_BASE_SEEK_CUR
+#undef _IOS_BASE_SEEK_END
+
+#endif /* _IOS_BASE_H */
+
diff --git a/i686-linux/include/c++/4.4.3/bits/istream.tcc b/i686-linux/include/c++/4.4.3/bits/istream.tcc
new file mode 100644
index 0000000..5d60791
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/istream.tcc
@@ -0,0 +1,1022 @@
+// istream classes -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file istream.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 27.6.1 Input streams
+//
+
+#ifndef _ISTREAM_TCC
+#define _ISTREAM_TCC 1
+
+#pragma GCC system_header
+
+#include <cxxabi-forced.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>::sentry::
+ sentry(basic_istream<_CharT, _Traits>& __in, bool __noskip) : _M_ok(false)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ if (__in.good())
+ {
+ if (__in.tie())
+ __in.tie()->flush();
+ if (!__noskip && bool(__in.flags() & ios_base::skipws))
+ {
+ const __int_type __eof = traits_type::eof();
+ __streambuf_type* __sb = __in.rdbuf();
+ __int_type __c = __sb->sgetc();
+
+ const __ctype_type& __ct = __check_facet(__in._M_ctype);
+ while (!traits_type::eq_int_type(__c, __eof)
+ && __ct.is(ctype_base::space,
+ traits_type::to_char_type(__c)))
+ __c = __sb->snextc();
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 195. Should basic_istream::sentry's constructor ever
+ // set eofbit?
+ if (traits_type::eq_int_type(__c, __eof))
+ __err |= ios_base::eofbit;
+ }
+ }
+
+ if (__in.good() && __err == ios_base::goodbit)
+ _M_ok = true;
+ else
+ {
+ __err |= ios_base::failbit;
+ __in.setstate(__err);
+ }
+ }
+
+ template<typename _CharT, typename _Traits>
+ template<typename _ValueT>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ _M_extract(_ValueT& __v)
+ {
+ sentry __cerb(*this, false);
+ if (__cerb)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ __try
+ {
+ const __num_get_type& __ng = __check_facet(this->_M_num_get);
+ __ng.get(*this, 0, *this, __err, __v);
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ operator>>(short& __n)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 118. basic_istream uses nonexistent num_get member functions.
+ long __l;
+ _M_extract(__l);
+ if (!this->fail())
+ {
+ if (__gnu_cxx::__numeric_traits<short>::__min <= __l
+ && __l <= __gnu_cxx::__numeric_traits<short>::__max)
+ __n = short(__l);
+ else
+ this->setstate(ios_base::failbit);
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ operator>>(int& __n)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 118. basic_istream uses nonexistent num_get member functions.
+ long __l;
+ _M_extract(__l);
+ if (!this->fail())
+ {
+ if (__gnu_cxx::__numeric_traits<int>::__min <= __l
+ && __l <= __gnu_cxx::__numeric_traits<int>::__max)
+ __n = int(__l);
+ else
+ this->setstate(ios_base::failbit);
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ operator>>(__streambuf_type* __sbout)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ sentry __cerb(*this, false);
+ if (__cerb && __sbout)
+ {
+ __try
+ {
+ bool __ineof;
+ if (!__copy_streambufs_eof(this->rdbuf(), __sbout, __ineof))
+ __err |= ios_base::failbit;
+ if (__ineof)
+ __err |= ios_base::eofbit;
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::failbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::failbit); }
+ }
+ else if (!__sbout)
+ __err |= ios_base::failbit;
+ if (__err)
+ this->setstate(__err);
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ typename basic_istream<_CharT, _Traits>::int_type
+ basic_istream<_CharT, _Traits>::
+ get(void)
+ {
+ const int_type __eof = traits_type::eof();
+ int_type __c = __eof;
+ _M_gcount = 0;
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ sentry __cerb(*this, true);
+ if (__cerb)
+ {
+ __try
+ {
+ __c = this->rdbuf()->sbumpc();
+ // 27.6.1.1 paragraph 3
+ if (!traits_type::eq_int_type(__c, __eof))
+ _M_gcount = 1;
+ else
+ __err |= ios_base::eofbit;
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ }
+ if (!_M_gcount)
+ __err |= ios_base::failbit;
+ if (__err)
+ this->setstate(__err);
+ return __c;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ get(char_type& __c)
+ {
+ _M_gcount = 0;
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ sentry __cerb(*this, true);
+ if (__cerb)
+ {
+ __try
+ {
+ const int_type __cb = this->rdbuf()->sbumpc();
+ // 27.6.1.1 paragraph 3
+ if (!traits_type::eq_int_type(__cb, traits_type::eof()))
+ {
+ _M_gcount = 1;
+ __c = traits_type::to_char_type(__cb);
+ }
+ else
+ __err |= ios_base::eofbit;
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ }
+ if (!_M_gcount)
+ __err |= ios_base::failbit;
+ if (__err)
+ this->setstate(__err);
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ get(char_type* __s, streamsize __n, char_type __delim)
+ {
+ _M_gcount = 0;
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ sentry __cerb(*this, true);
+ if (__cerb)
+ {
+ __try
+ {
+ const int_type __idelim = traits_type::to_int_type(__delim);
+ const int_type __eof = traits_type::eof();
+ __streambuf_type* __sb = this->rdbuf();
+ int_type __c = __sb->sgetc();
+
+ while (_M_gcount + 1 < __n
+ && !traits_type::eq_int_type(__c, __eof)
+ && !traits_type::eq_int_type(__c, __idelim))
+ {
+ *__s++ = traits_type::to_char_type(__c);
+ ++_M_gcount;
+ __c = __sb->snextc();
+ }
+ if (traits_type::eq_int_type(__c, __eof))
+ __err |= ios_base::eofbit;
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ }
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 243. get and getline when sentry reports failure.
+ if (__n > 0)
+ *__s = char_type();
+ if (!_M_gcount)
+ __err |= ios_base::failbit;
+ if (__err)
+ this->setstate(__err);
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ get(__streambuf_type& __sb, char_type __delim)
+ {
+ _M_gcount = 0;
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ sentry __cerb(*this, true);
+ if (__cerb)
+ {
+ __try
+ {
+ const int_type __idelim = traits_type::to_int_type(__delim);
+ const int_type __eof = traits_type::eof();
+ __streambuf_type* __this_sb = this->rdbuf();
+ int_type __c = __this_sb->sgetc();
+ char_type __c2 = traits_type::to_char_type(__c);
+
+ while (!traits_type::eq_int_type(__c, __eof)
+ && !traits_type::eq_int_type(__c, __idelim)
+ && !traits_type::eq_int_type(__sb.sputc(__c2), __eof))
+ {
+ ++_M_gcount;
+ __c = __this_sb->snextc();
+ __c2 = traits_type::to_char_type(__c);
+ }
+ if (traits_type::eq_int_type(__c, __eof))
+ __err |= ios_base::eofbit;
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ }
+ if (!_M_gcount)
+ __err |= ios_base::failbit;
+ if (__err)
+ this->setstate(__err);
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ getline(char_type* __s, streamsize __n, char_type __delim)
+ {
+ _M_gcount = 0;
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ sentry __cerb(*this, true);
+ if (__cerb)
+ {
+ __try
+ {
+ const int_type __idelim = traits_type::to_int_type(__delim);
+ const int_type __eof = traits_type::eof();
+ __streambuf_type* __sb = this->rdbuf();
+ int_type __c = __sb->sgetc();
+
+ while (_M_gcount + 1 < __n
+ && !traits_type::eq_int_type(__c, __eof)
+ && !traits_type::eq_int_type(__c, __idelim))
+ {
+ *__s++ = traits_type::to_char_type(__c);
+ __c = __sb->snextc();
+ ++_M_gcount;
+ }
+ if (traits_type::eq_int_type(__c, __eof))
+ __err |= ios_base::eofbit;
+ else
+ {
+ if (traits_type::eq_int_type(__c, __idelim))
+ {
+ __sb->sbumpc();
+ ++_M_gcount;
+ }
+ else
+ __err |= ios_base::failbit;
+ }
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ }
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 243. get and getline when sentry reports failure.
+ if (__n > 0)
+ *__s = char_type();
+ if (!_M_gcount)
+ __err |= ios_base::failbit;
+ if (__err)
+ this->setstate(__err);
+ return *this;
+ }
+
+ // We provide three overloads, since the first two are much simpler
+ // than the general case. Also, the latter two can thus adopt the
+ // same "batchy" strategy used by getline above.
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ ignore(void)
+ {
+ _M_gcount = 0;
+ sentry __cerb(*this, true);
+ if (__cerb)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ __try
+ {
+ const int_type __eof = traits_type::eof();
+ __streambuf_type* __sb = this->rdbuf();
+
+ if (traits_type::eq_int_type(__sb->sbumpc(), __eof))
+ __err |= ios_base::eofbit;
+ else
+ _M_gcount = 1;
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ ignore(streamsize __n)
+ {
+ _M_gcount = 0;
+ sentry __cerb(*this, true);
+ if (__cerb && __n > 0)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ __try
+ {
+ const int_type __eof = traits_type::eof();
+ __streambuf_type* __sb = this->rdbuf();
+ int_type __c = __sb->sgetc();
+
+ // N.B. On LFS-enabled platforms streamsize is still 32 bits
+ // wide: if we want to implement the standard mandated behavior
+ // for n == max() (see 27.6.1.3/24) we are at risk of signed
+ // integer overflow: thus these contortions. Also note that,
+ // by definition, when more than 2G chars are actually ignored,
+ // _M_gcount (the return value of gcount, that is) cannot be
+ // really correct, being unavoidably too small.
+ bool __large_ignore = false;
+ while (true)
+ {
+ while (_M_gcount < __n
+ && !traits_type::eq_int_type(__c, __eof))
+ {
+ ++_M_gcount;
+ __c = __sb->snextc();
+ }
+ if (__n == __gnu_cxx::__numeric_traits<streamsize>::__max
+ && !traits_type::eq_int_type(__c, __eof))
+ {
+ _M_gcount =
+ __gnu_cxx::__numeric_traits<streamsize>::__min;
+ __large_ignore = true;
+ }
+ else
+ break;
+ }
+
+ if (__large_ignore)
+ _M_gcount = __gnu_cxx::__numeric_traits<streamsize>::__max;
+
+ if (traits_type::eq_int_type(__c, __eof))
+ __err |= ios_base::eofbit;
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ ignore(streamsize __n, int_type __delim)
+ {
+ _M_gcount = 0;
+ sentry __cerb(*this, true);
+ if (__cerb && __n > 0)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ __try
+ {
+ const int_type __eof = traits_type::eof();
+ __streambuf_type* __sb = this->rdbuf();
+ int_type __c = __sb->sgetc();
+
+ // See comment above.
+ bool __large_ignore = false;
+ while (true)
+ {
+ while (_M_gcount < __n
+ && !traits_type::eq_int_type(__c, __eof)
+ && !traits_type::eq_int_type(__c, __delim))
+ {
+ ++_M_gcount;
+ __c = __sb->snextc();
+ }
+ if (__n == __gnu_cxx::__numeric_traits<streamsize>::__max
+ && !traits_type::eq_int_type(__c, __eof)
+ && !traits_type::eq_int_type(__c, __delim))
+ {
+ _M_gcount =
+ __gnu_cxx::__numeric_traits<streamsize>::__min;
+ __large_ignore = true;
+ }
+ else
+ break;
+ }
+
+ if (__large_ignore)
+ _M_gcount = __gnu_cxx::__numeric_traits<streamsize>::__max;
+
+ if (traits_type::eq_int_type(__c, __eof))
+ __err |= ios_base::eofbit;
+ else if (traits_type::eq_int_type(__c, __delim))
+ {
+ if (_M_gcount
+ < __gnu_cxx::__numeric_traits<streamsize>::__max)
+ ++_M_gcount;
+ __sb->sbumpc();
+ }
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ typename basic_istream<_CharT, _Traits>::int_type
+ basic_istream<_CharT, _Traits>::
+ peek(void)
+ {
+ int_type __c = traits_type::eof();
+ _M_gcount = 0;
+ sentry __cerb(*this, true);
+ if (__cerb)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ __try
+ {
+ __c = this->rdbuf()->sgetc();
+ if (traits_type::eq_int_type(__c, traits_type::eof()))
+ __err |= ios_base::eofbit;
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return __c;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ read(char_type* __s, streamsize __n)
+ {
+ _M_gcount = 0;
+ sentry __cerb(*this, true);
+ if (__cerb)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ __try
+ {
+ _M_gcount = this->rdbuf()->sgetn(__s, __n);
+ if (_M_gcount != __n)
+ __err |= (ios_base::eofbit | ios_base::failbit);
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ streamsize
+ basic_istream<_CharT, _Traits>::
+ readsome(char_type* __s, streamsize __n)
+ {
+ _M_gcount = 0;
+ sentry __cerb(*this, true);
+ if (__cerb)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ __try
+ {
+ // Cannot compare int_type with streamsize generically.
+ const streamsize __num = this->rdbuf()->in_avail();
+ if (__num > 0)
+ _M_gcount = this->rdbuf()->sgetn(__s, std::min(__num, __n));
+ else if (__num == -1)
+ __err |= ios_base::eofbit;
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return _M_gcount;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ putback(char_type __c)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 60. What is a formatted input function?
+ _M_gcount = 0;
+ sentry __cerb(*this, true);
+ if (__cerb)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ __try
+ {
+ const int_type __eof = traits_type::eof();
+ __streambuf_type* __sb = this->rdbuf();
+ if (!__sb
+ || traits_type::eq_int_type(__sb->sputbackc(__c), __eof))
+ __err |= ios_base::badbit;
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ unget(void)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 60. What is a formatted input function?
+ _M_gcount = 0;
+ sentry __cerb(*this, true);
+ if (__cerb)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ __try
+ {
+ const int_type __eof = traits_type::eof();
+ __streambuf_type* __sb = this->rdbuf();
+ if (!__sb
+ || traits_type::eq_int_type(__sb->sungetc(), __eof))
+ __err |= ios_base::badbit;
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ int
+ basic_istream<_CharT, _Traits>::
+ sync(void)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR60. Do not change _M_gcount.
+ int __ret = -1;
+ sentry __cerb(*this, true);
+ if (__cerb)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ __try
+ {
+ __streambuf_type* __sb = this->rdbuf();
+ if (__sb)
+ {
+ if (__sb->pubsync() == -1)
+ __err |= ios_base::badbit;
+ else
+ __ret = 0;
+ }
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return __ret;
+ }
+
+ template<typename _CharT, typename _Traits>
+ typename basic_istream<_CharT, _Traits>::pos_type
+ basic_istream<_CharT, _Traits>::
+ tellg(void)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR60. Do not change _M_gcount.
+ pos_type __ret = pos_type(-1);
+ __try
+ {
+ if (!this->fail())
+ __ret = this->rdbuf()->pubseekoff(0, ios_base::cur,
+ ios_base::in);
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ return __ret;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ seekg(pos_type __pos)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR60. Do not change _M_gcount.
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ __try
+ {
+ if (!this->fail())
+ {
+ // 136. seekp, seekg setting wrong streams?
+ const pos_type __p = this->rdbuf()->pubseekpos(__pos,
+ ios_base::in);
+
+ // 129. Need error indication from seekp() and seekg()
+ if (__p == pos_type(off_type(-1)))
+ __err |= ios_base::failbit;
+ }
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ seekg(off_type __off, ios_base::seekdir __dir)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR60. Do not change _M_gcount.
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ __try
+ {
+ if (!this->fail())
+ {
+ // 136. seekp, seekg setting wrong streams?
+ const pos_type __p = this->rdbuf()->pubseekoff(__off, __dir,
+ ios_base::in);
+
+ // 129. Need error indication from seekp() and seekg()
+ if (__p == pos_type(off_type(-1)))
+ __err |= ios_base::failbit;
+ }
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ return *this;
+ }
+
+ // 27.6.1.2.3 Character extraction templates
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
+ {
+ typedef basic_istream<_CharT, _Traits> __istream_type;
+ typedef typename __istream_type::int_type __int_type;
+
+ typename __istream_type::sentry __cerb(__in, false);
+ if (__cerb)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ __try
+ {
+ const __int_type __cb = __in.rdbuf()->sbumpc();
+ if (!_Traits::eq_int_type(__cb, _Traits::eof()))
+ __c = _Traits::to_char_type(__cb);
+ else
+ __err |= (ios_base::eofbit | ios_base::failbit);
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ __in._M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { __in._M_setstate(ios_base::badbit); }
+ if (__err)
+ __in.setstate(__err);
+ }
+ return __in;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
+ {
+ typedef basic_istream<_CharT, _Traits> __istream_type;
+ typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
+ typedef typename _Traits::int_type int_type;
+ typedef _CharT char_type;
+ typedef ctype<_CharT> __ctype_type;
+
+ streamsize __extracted = 0;
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ typename __istream_type::sentry __cerb(__in, false);
+ if (__cerb)
+ {
+ __try
+ {
+ // Figure out how many characters to extract.
+ streamsize __num = __in.width();
+ if (__num <= 0)
+ __num = __gnu_cxx::__numeric_traits<streamsize>::__max;
+
+ const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc());
+
+ const int_type __eof = _Traits::eof();
+ __streambuf_type* __sb = __in.rdbuf();
+ int_type __c = __sb->sgetc();
+
+ while (__extracted < __num - 1
+ && !_Traits::eq_int_type(__c, __eof)
+ && !__ct.is(ctype_base::space,
+ _Traits::to_char_type(__c)))
+ {
+ *__s++ = _Traits::to_char_type(__c);
+ ++__extracted;
+ __c = __sb->snextc();
+ }
+ if (_Traits::eq_int_type(__c, __eof))
+ __err |= ios_base::eofbit;
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 68. Extractors for char* should store null at end
+ *__s = char_type();
+ __in.width(0);
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ __in._M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { __in._M_setstate(ios_base::badbit); }
+ }
+ if (!__extracted)
+ __err |= ios_base::failbit;
+ if (__err)
+ __in.setstate(__err);
+ return __in;
+ }
+
+ // 27.6.1.4 Standard basic_istream manipulators
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ ws(basic_istream<_CharT, _Traits>& __in)
+ {
+ typedef basic_istream<_CharT, _Traits> __istream_type;
+ typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
+ typedef typename __istream_type::int_type __int_type;
+ typedef ctype<_CharT> __ctype_type;
+
+ const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc());
+ const __int_type __eof = _Traits::eof();
+ __streambuf_type* __sb = __in.rdbuf();
+ __int_type __c = __sb->sgetc();
+
+ while (!_Traits::eq_int_type(__c, __eof)
+ && __ct.is(ctype_base::space, _Traits::to_char_type(__c)))
+ __c = __sb->snextc();
+
+ if (_Traits::eq_int_type(__c, __eof))
+ __in.setstate(ios_base::eofbit);
+ return __in;
+ }
+
+ // Inhibit implicit instantiations for required instantiations,
+ // which are defined via explicit instantiations elsewhere.
+ // NB: This syntax is a GNU extension.
+#if _GLIBCXX_EXTERN_TEMPLATE
+ extern template class basic_istream<char>;
+ extern template istream& ws(istream&);
+ extern template istream& operator>>(istream&, char&);
+ extern template istream& operator>>(istream&, char*);
+ extern template istream& operator>>(istream&, unsigned char&);
+ extern template istream& operator>>(istream&, signed char&);
+ extern template istream& operator>>(istream&, unsigned char*);
+ extern template istream& operator>>(istream&, signed char*);
+
+ extern template istream& istream::_M_extract(unsigned short&);
+ extern template istream& istream::_M_extract(unsigned int&);
+ extern template istream& istream::_M_extract(long&);
+ extern template istream& istream::_M_extract(unsigned long&);
+ extern template istream& istream::_M_extract(bool&);
+#ifdef _GLIBCXX_USE_LONG_LONG
+ extern template istream& istream::_M_extract(long long&);
+ extern template istream& istream::_M_extract(unsigned long long&);
+#endif
+ extern template istream& istream::_M_extract(float&);
+ extern template istream& istream::_M_extract(double&);
+ extern template istream& istream::_M_extract(long double&);
+ extern template istream& istream::_M_extract(void*&);
+
+ extern template class basic_iostream<char>;
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ extern template class basic_istream<wchar_t>;
+ extern template wistream& ws(wistream&);
+ extern template wistream& operator>>(wistream&, wchar_t&);
+ extern template wistream& operator>>(wistream&, wchar_t*);
+
+ extern template wistream& wistream::_M_extract(unsigned short&);
+ extern template wistream& wistream::_M_extract(unsigned int&);
+ extern template wistream& wistream::_M_extract(long&);
+ extern template wistream& wistream::_M_extract(unsigned long&);
+ extern template wistream& wistream::_M_extract(bool&);
+#ifdef _GLIBCXX_USE_LONG_LONG
+ extern template wistream& wistream::_M_extract(long long&);
+ extern template wistream& wistream::_M_extract(unsigned long long&);
+#endif
+ extern template wistream& wistream::_M_extract(float&);
+ extern template wistream& wistream::_M_extract(double&);
+ extern template wistream& wistream::_M_extract(long double&);
+ extern template wistream& wistream::_M_extract(void*&);
+
+ extern template class basic_iostream<wchar_t>;
+#endif
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/bits/list.tcc b/i686-linux/include/c++/4.4.3/bits/list.tcc
new file mode 100644
index 0000000..899b418
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/list.tcc
@@ -0,0 +1,416 @@
+// List implementation (out of line) -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file list.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _LIST_TCC
+#define _LIST_TCC 1
+
+_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
+
+ template<typename _Tp, typename _Alloc>
+ void
+ _List_base<_Tp, _Alloc>::
+ _M_clear()
+ {
+ typedef _List_node<_Tp> _Node;
+ _Node* __cur = static_cast<_Node*>(this->_M_impl._M_node._M_next);
+ while (__cur != &this->_M_impl._M_node)
+ {
+ _Node* __tmp = __cur;
+ __cur = static_cast<_Node*>(__cur->_M_next);
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ _M_get_Node_allocator().destroy(__tmp);
+#else
+ _M_get_Tp_allocator().destroy(&__tmp->_M_data);
+#endif
+ _M_put_node(__tmp);
+ }
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp, typename _Alloc>
+ template<typename... _Args>
+ typename list<_Tp, _Alloc>::iterator
+ list<_Tp, _Alloc>::
+ emplace(iterator __position, _Args&&... __args)
+ {
+ _Node* __tmp = _M_create_node(std::forward<_Args>(__args)...);
+ __tmp->hook(__position._M_node);
+ return iterator(__tmp);
+ }
+#endif
+
+ template<typename _Tp, typename _Alloc>
+ typename list<_Tp, _Alloc>::iterator
+ list<_Tp, _Alloc>::
+ insert(iterator __position, const value_type& __x)
+ {
+ _Node* __tmp = _M_create_node(__x);
+ __tmp->hook(__position._M_node);
+ return iterator(__tmp);
+ }
+
+ template<typename _Tp, typename _Alloc>
+ typename list<_Tp, _Alloc>::iterator
+ list<_Tp, _Alloc>::
+ erase(iterator __position)
+ {
+ iterator __ret = iterator(__position._M_node->_M_next);
+ _M_erase(__position);
+ return __ret;
+ }
+
+ template<typename _Tp, typename _Alloc>
+ void
+ list<_Tp, _Alloc>::
+ resize(size_type __new_size, value_type __x)
+ {
+ iterator __i = begin();
+ size_type __len = 0;
+ for (; __i != end() && __len < __new_size; ++__i, ++__len)
+ ;
+ if (__len == __new_size)
+ erase(__i, end());
+ else // __i == end()
+ insert(end(), __new_size - __len, __x);
+ }
+
+ template<typename _Tp, typename _Alloc>
+ list<_Tp, _Alloc>&
+ list<_Tp, _Alloc>::
+ operator=(const list& __x)
+ {
+ if (this != &__x)
+ {
+ iterator __first1 = begin();
+ iterator __last1 = end();
+ const_iterator __first2 = __x.begin();
+ const_iterator __last2 = __x.end();
+ for (; __first1 != __last1 && __first2 != __last2;
+ ++__first1, ++__first2)
+ *__first1 = *__first2;
+ if (__first2 == __last2)
+ erase(__first1, __last1);
+ else
+ insert(__last1, __first2, __last2);
+ }
+ return *this;
+ }
+
+ template<typename _Tp, typename _Alloc>
+ void
+ list<_Tp, _Alloc>::
+ _M_fill_assign(size_type __n, const value_type& __val)
+ {
+ iterator __i = begin();
+ for (; __i != end() && __n > 0; ++__i, --__n)
+ *__i = __val;
+ if (__n > 0)
+ insert(end(), __n, __val);
+ else
+ erase(__i, end());
+ }
+
+ template<typename _Tp, typename _Alloc>
+ template <typename _InputIterator>
+ void
+ list<_Tp, _Alloc>::
+ _M_assign_dispatch(_InputIterator __first2, _InputIterator __last2,
+ __false_type)
+ {
+ iterator __first1 = begin();
+ iterator __last1 = end();
+ for (; __first1 != __last1 && __first2 != __last2;
+ ++__first1, ++__first2)
+ *__first1 = *__first2;
+ if (__first2 == __last2)
+ erase(__first1, __last1);
+ else
+ insert(__last1, __first2, __last2);
+ }
+
+ template<typename _Tp, typename _Alloc>
+ void
+ list<_Tp, _Alloc>::
+ remove(const value_type& __value)
+ {
+ iterator __first = begin();
+ iterator __last = end();
+ iterator __extra = __last;
+ while (__first != __last)
+ {
+ iterator __next = __first;
+ ++__next;
+ if (*__first == __value)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 526. Is it undefined if a function in the standard changes
+ // in parameters?
+ if (&*__first != &__value)
+ _M_erase(__first);
+ else
+ __extra = __first;
+ }
+ __first = __next;
+ }
+ if (__extra != __last)
+ _M_erase(__extra);
+ }
+
+ template<typename _Tp, typename _Alloc>
+ void
+ list<_Tp, _Alloc>::
+ unique()
+ {
+ iterator __first = begin();
+ iterator __last = end();
+ if (__first == __last)
+ return;
+ iterator __next = __first;
+ while (++__next != __last)
+ {
+ if (*__first == *__next)
+ _M_erase(__next);
+ else
+ __first = __next;
+ __next = __first;
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ void
+ list<_Tp, _Alloc>::
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ merge(list&& __x)
+#else
+ merge(list& __x)
+#endif
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 300. list::merge() specification incomplete
+ if (this != &__x)
+ {
+ _M_check_equal_allocators(__x);
+
+ iterator __first1 = begin();
+ iterator __last1 = end();
+ iterator __first2 = __x.begin();
+ iterator __last2 = __x.end();
+ while (__first1 != __last1 && __first2 != __last2)
+ if (*__first2 < *__first1)
+ {
+ iterator __next = __first2;
+ _M_transfer(__first1, __first2, ++__next);
+ __first2 = __next;
+ }
+ else
+ ++__first1;
+ if (__first2 != __last2)
+ _M_transfer(__last1, __first2, __last2);
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ template <typename _StrictWeakOrdering>
+ void
+ list<_Tp, _Alloc>::
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ merge(list&& __x, _StrictWeakOrdering __comp)
+#else
+ merge(list& __x, _StrictWeakOrdering __comp)
+#endif
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 300. list::merge() specification incomplete
+ if (this != &__x)
+ {
+ _M_check_equal_allocators(__x);
+
+ iterator __first1 = begin();
+ iterator __last1 = end();
+ iterator __first2 = __x.begin();
+ iterator __last2 = __x.end();
+ while (__first1 != __last1 && __first2 != __last2)
+ if (__comp(*__first2, *__first1))
+ {
+ iterator __next = __first2;
+ _M_transfer(__first1, __first2, ++__next);
+ __first2 = __next;
+ }
+ else
+ ++__first1;
+ if (__first2 != __last2)
+ _M_transfer(__last1, __first2, __last2);
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ void
+ list<_Tp, _Alloc>::
+ sort()
+ {
+ // Do nothing if the list has length 0 or 1.
+ if (this->_M_impl._M_node._M_next != &this->_M_impl._M_node
+ && this->_M_impl._M_node._M_next->_M_next != &this->_M_impl._M_node)
+ {
+ list __carry;
+ list __tmp[64];
+ list * __fill = &__tmp[0];
+ list * __counter;
+
+ do
+ {
+ __carry.splice(__carry.begin(), *this, begin());
+
+ for(__counter = &__tmp[0];
+ __counter != __fill && !__counter->empty();
+ ++__counter)
+ {
+ __counter->merge(__carry);
+ __carry.swap(*__counter);
+ }
+ __carry.swap(*__counter);
+ if (__counter == __fill)
+ ++__fill;
+ }
+ while ( !empty() );
+
+ for (__counter = &__tmp[1]; __counter != __fill; ++__counter)
+ __counter->merge(*(__counter - 1));
+ swap( *(__fill - 1) );
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ template <typename _Predicate>
+ void
+ list<_Tp, _Alloc>::
+ remove_if(_Predicate __pred)
+ {
+ iterator __first = begin();
+ iterator __last = end();
+ while (__first != __last)
+ {
+ iterator __next = __first;
+ ++__next;
+ if (__pred(*__first))
+ _M_erase(__first);
+ __first = __next;
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ template <typename _BinaryPredicate>
+ void
+ list<_Tp, _Alloc>::
+ unique(_BinaryPredicate __binary_pred)
+ {
+ iterator __first = begin();
+ iterator __last = end();
+ if (__first == __last)
+ return;
+ iterator __next = __first;
+ while (++__next != __last)
+ {
+ if (__binary_pred(*__first, *__next))
+ _M_erase(__next);
+ else
+ __first = __next;
+ __next = __first;
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ template <typename _StrictWeakOrdering>
+ void
+ list<_Tp, _Alloc>::
+ sort(_StrictWeakOrdering __comp)
+ {
+ // Do nothing if the list has length 0 or 1.
+ if (this->_M_impl._M_node._M_next != &this->_M_impl._M_node
+ && this->_M_impl._M_node._M_next->_M_next != &this->_M_impl._M_node)
+ {
+ list __carry;
+ list __tmp[64];
+ list * __fill = &__tmp[0];
+ list * __counter;
+
+ do
+ {
+ __carry.splice(__carry.begin(), *this, begin());
+
+ for(__counter = &__tmp[0];
+ __counter != __fill && !__counter->empty();
+ ++__counter)
+ {
+ __counter->merge(__carry, __comp);
+ __carry.swap(*__counter);
+ }
+ __carry.swap(*__counter);
+ if (__counter == __fill)
+ ++__fill;
+ }
+ while ( !empty() );
+
+ for (__counter = &__tmp[1]; __counter != __fill; ++__counter)
+ __counter->merge(*(__counter - 1), __comp);
+ swap(*(__fill - 1));
+ }
+ }
+
+_GLIBCXX_END_NESTED_NAMESPACE
+
+#endif /* _LIST_TCC */
+
diff --git a/i686-linux/include/c++/4.4.3/bits/locale_classes.h b/i686-linux/include/c++/4.4.3/bits/locale_classes.h
new file mode 100644
index 0000000..4a64693
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/locale_classes.h
@@ -0,0 +1,812 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file locale_classes.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 22.1 Locales
+//
+
+#ifndef _LOCALE_CLASSES_H
+#define _LOCALE_CLASSES_H 1
+
+#pragma GCC system_header
+
+#include <bits/localefwd.h>
+#include <string>
+#include <ext/atomicity.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // 22.1.1 Class locale
+ /**
+ * @brief Container class for localization functionality.
+ *
+ * The locale class is first a class wrapper for C library locales. It is
+ * also an extensible container for user-defined localization. A locale is
+ * a collection of facets that implement various localization features such
+ * as money, time, and number printing.
+ *
+ * Constructing C++ locales does not change the C library locale.
+ *
+ * This library supports efficient construction and copying of locales
+ * through a reference counting implementation of the locale class.
+ */
+ class locale
+ {
+ public:
+ // Types:
+ /// Definition of locale::category.
+ typedef int category;
+
+ // Forward decls and friends:
+ class facet;
+ class id;
+ class _Impl;
+
+ friend class facet;
+ friend class _Impl;
+
+ template<typename _Facet>
+ friend bool
+ has_facet(const locale&) throw();
+
+ template<typename _Facet>
+ friend const _Facet&
+ use_facet(const locale&);
+
+ template<typename _Cache>
+ friend struct __use_cache;
+
+ //@{
+ /**
+ * @brief Category values.
+ *
+ * The standard category values are none, ctype, numeric, collate, time,
+ * monetary, and messages. They form a bitmask that supports union and
+ * intersection. The category all is the union of these values.
+ *
+ * NB: Order must match _S_facet_categories definition in locale.cc
+ */
+ static const category none = 0;
+ static const category ctype = 1L << 0;
+ static const category numeric = 1L << 1;
+ static const category collate = 1L << 2;
+ static const category time = 1L << 3;
+ static const category monetary = 1L << 4;
+ static const category messages = 1L << 5;
+ static const category all = (ctype | numeric | collate |
+ time | monetary | messages);
+ //@}
+
+ // Construct/copy/destroy:
+
+ /**
+ * @brief Default constructor.
+ *
+ * Constructs a copy of the global locale. If no locale has been
+ * explicitly set, this is the "C" locale.
+ */
+ locale() throw();
+
+ /**
+ * @brief Copy constructor.
+ *
+ * Constructs a copy of @a other.
+ *
+ * @param other The locale to copy.
+ */
+ locale(const locale& __other) throw();
+
+ /**
+ * @brief Named locale constructor.
+ *
+ * Constructs a copy of the named C library locale.
+ *
+ * @param s Name of the locale to construct.
+ * @throw std::runtime_error if s is null or an undefined locale.
+ */
+ explicit
+ locale(const char* __s);
+
+ /**
+ * @brief Construct locale with facets from another locale.
+ *
+ * Constructs a copy of the locale @a base. The facets specified by @a
+ * cat are replaced with those from the locale named by @a s. If base is
+ * named, this locale instance will also be named.
+ *
+ * @param base The locale to copy.
+ * @param s Name of the locale to use facets from.
+ * @param cat Set of categories defining the facets to use from s.
+ * @throw std::runtime_error if s is null or an undefined locale.
+ */
+ locale(const locale& __base, const char* __s, category __cat);
+
+ /**
+ * @brief Construct locale with facets from another locale.
+ *
+ * Constructs a copy of the locale @a base. The facets specified by @a
+ * cat are replaced with those from the locale @a add. If @a base and @a
+ * add are named, this locale instance will also be named.
+ *
+ * @param base The locale to copy.
+ * @param add The locale to use facets from.
+ * @param cat Set of categories defining the facets to use from add.
+ */
+ locale(const locale& __base, const locale& __add, category __cat);
+
+ /**
+ * @brief Construct locale with another facet.
+ *
+ * Constructs a copy of the locale @a other. The facet @f is added to
+ * @other, replacing an existing facet of type Facet if there is one. If
+ * @f is null, this locale is a copy of @a other.
+ *
+ * @param other The locale to copy.
+ * @param f The facet to add in.
+ */
+ template<typename _Facet>
+ locale(const locale& __other, _Facet* __f);
+
+ /// Locale destructor.
+ ~locale() throw();
+
+ /**
+ * @brief Assignment operator.
+ *
+ * Set this locale to be a copy of @a other.
+ *
+ * @param other The locale to copy.
+ * @return A reference to this locale.
+ */
+ const locale&
+ operator=(const locale& __other) throw();
+
+ /**
+ * @brief Construct locale with another facet.
+ *
+ * Constructs and returns a new copy of this locale. Adds or replaces an
+ * existing facet of type Facet from the locale @a other into the new
+ * locale.
+ *
+ * @param Facet The facet type to copy from other
+ * @param other The locale to copy from.
+ * @return Newly constructed locale.
+ * @throw std::runtime_error if other has no facet of type Facet.
+ */
+ template<typename _Facet>
+ locale
+ combine(const locale& __other) const;
+
+ // Locale operations:
+ /**
+ * @brief Return locale name.
+ * @return Locale name or "*" if unnamed.
+ */
+ string
+ name() const;
+
+ /**
+ * @brief Locale equality.
+ *
+ * @param other The locale to compare against.
+ * @return True if other and this refer to the same locale instance, are
+ * copies, or have the same name. False otherwise.
+ */
+ bool
+ operator==(const locale& __other) const throw ();
+
+ /**
+ * @brief Locale inequality.
+ *
+ * @param other The locale to compare against.
+ * @return ! (*this == other)
+ */
+ bool
+ operator!=(const locale& __other) const throw ()
+ { return !(this->operator==(__other)); }
+
+ /**
+ * @brief Compare two strings according to collate.
+ *
+ * Template operator to compare two strings using the compare function of
+ * the collate facet in this locale. One use is to provide the locale to
+ * the sort function. For example, a vector v of strings could be sorted
+ * according to locale loc by doing:
+ * @code
+ * std::sort(v.begin(), v.end(), loc);
+ * @endcode
+ *
+ * @param s1 First string to compare.
+ * @param s2 Second string to compare.
+ * @return True if collate<Char> facet compares s1 < s2, else false.
+ */
+ template<typename _Char, typename _Traits, typename _Alloc>
+ bool
+ operator()(const basic_string<_Char, _Traits, _Alloc>& __s1,
+ const basic_string<_Char, _Traits, _Alloc>& __s2) const;
+
+ // Global locale objects:
+ /**
+ * @brief Set global locale
+ *
+ * This function sets the global locale to the argument and returns a
+ * copy of the previous global locale. If the argument has a name, it
+ * will also call std::setlocale(LC_ALL, loc.name()).
+ *
+ * @param locale The new locale to make global.
+ * @return Copy of the old global locale.
+ */
+ static locale
+ global(const locale&);
+
+ /**
+ * @brief Return reference to the "C" locale.
+ */
+ static const locale&
+ classic();
+
+ private:
+ // The (shared) implementation
+ _Impl* _M_impl;
+
+ // The "C" reference locale
+ static _Impl* _S_classic;
+
+ // Current global locale
+ static _Impl* _S_global;
+
+ // Names of underlying locale categories.
+ // NB: locale::global() has to know how to modify all the
+ // underlying categories, not just the ones required by the C++
+ // standard.
+ static const char* const* const _S_categories;
+
+ // Number of standard categories. For C++, these categories are
+ // collate, ctype, monetary, numeric, time, and messages. These
+ // directly correspond to ISO C99 macros LC_COLLATE, LC_CTYPE,
+ // LC_MONETARY, LC_NUMERIC, and LC_TIME. In addition, POSIX (IEEE
+ // 1003.1-2001) specifies LC_MESSAGES.
+ // In addition to the standard categories, the underlying
+ // operating system is allowed to define extra LC_*
+ // macros. For GNU systems, the following are also valid:
+ // LC_PAPER, LC_NAME, LC_ADDRESS, LC_TELEPHONE, LC_MEASUREMENT,
+ // and LC_IDENTIFICATION.
+ enum { _S_categories_size = 6 + _GLIBCXX_NUM_CATEGORIES };
+
+#ifdef __GTHREADS
+ static __gthread_once_t _S_once;
+#endif
+
+ explicit
+ locale(_Impl*) throw();
+
+ static void
+ _S_initialize();
+
+ static void
+ _S_initialize_once();
+
+ static category
+ _S_normalize_category(category);
+
+ void
+ _M_coalesce(const locale& __base, const locale& __add, category __cat);
+ };
+
+
+ // 22.1.1.1.2 Class locale::facet
+ /**
+ * @brief Localization functionality base class.
+ *
+ * The facet class is the base class for a localization feature, such as
+ * money, time, and number printing. It provides common support for facets
+ * and reference management.
+ *
+ * Facets may not be copied or assigned.
+ */
+ class locale::facet
+ {
+ private:
+ friend class locale;
+ friend class locale::_Impl;
+
+ mutable _Atomic_word _M_refcount;
+
+ // Contains data from the underlying "C" library for the classic locale.
+ static __c_locale _S_c_locale;
+
+ // String literal for the name of the classic locale.
+ static const char _S_c_name[2];
+
+#ifdef __GTHREADS
+ static __gthread_once_t _S_once;
+#endif
+
+ static void
+ _S_initialize_once();
+
+ protected:
+ /**
+ * @brief Facet constructor.
+ *
+ * This is the constructor provided by the standard. If refs is 0, the
+ * facet is destroyed when the last referencing locale is destroyed.
+ * Otherwise the facet will never be destroyed.
+ *
+ * @param refs The initial value for reference count.
+ */
+ explicit
+ facet(size_t __refs = 0) throw() : _M_refcount(__refs ? 1 : 0)
+ { }
+
+ /// Facet destructor.
+ virtual
+ ~facet();
+
+ static void
+ _S_create_c_locale(__c_locale& __cloc, const char* __s,
+ __c_locale __old = 0);
+
+ static __c_locale
+ _S_clone_c_locale(__c_locale& __cloc);
+
+ static void
+ _S_destroy_c_locale(__c_locale& __cloc);
+
+ // Returns data from the underlying "C" library data for the
+ // classic locale.
+ static __c_locale
+ _S_get_c_locale();
+
+ static const char*
+ _S_get_c_name();
+
+ private:
+ void
+ _M_add_reference() const throw()
+ { __gnu_cxx::__atomic_add_dispatch(&_M_refcount, 1); }
+
+ void
+ _M_remove_reference() const throw()
+ {
+ if (__gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1) == 1)
+ {
+ __try
+ { delete this; }
+ __catch(...)
+ { }
+ }
+ }
+
+ facet(const facet&); // Not defined.
+
+ facet&
+ operator=(const facet&); // Not defined.
+ };
+
+
+ // 22.1.1.1.3 Class locale::id
+ /**
+ * @brief Facet ID class.
+ *
+ * The ID class provides facets with an index used to identify them.
+ * Every facet class must define a public static member locale::id, or be
+ * derived from a facet that provides this member, otherwise the facet
+ * cannot be used in a locale. The locale::id ensures that each class
+ * type gets a unique identifier.
+ */
+ class locale::id
+ {
+ private:
+ friend class locale;
+ friend class locale::_Impl;
+
+ template<typename _Facet>
+ friend const _Facet&
+ use_facet(const locale&);
+
+ template<typename _Facet>
+ friend bool
+ has_facet(const locale&) throw ();
+
+ // NB: There is no accessor for _M_index because it may be used
+ // before the constructor is run; the effect of calling a member
+ // function (even an inline) would be undefined.
+ mutable size_t _M_index;
+
+ // Last id number assigned.
+ static _Atomic_word _S_refcount;
+
+ void
+ operator=(const id&); // Not defined.
+
+ id(const id&); // Not defined.
+
+ public:
+ // NB: This class is always a static data member, and thus can be
+ // counted on to be zero-initialized.
+ /// Constructor.
+ id() { }
+
+ size_t
+ _M_id() const;
+ };
+
+
+ // Implementation object for locale.
+ class locale::_Impl
+ {
+ public:
+ // Friends.
+ friend class locale;
+ friend class locale::facet;
+
+ template<typename _Facet>
+ friend bool
+ has_facet(const locale&) throw();
+
+ template<typename _Facet>
+ friend const _Facet&
+ use_facet(const locale&);
+
+ template<typename _Cache>
+ friend struct __use_cache;
+
+ private:
+ // Data Members.
+ _Atomic_word _M_refcount;
+ const facet** _M_facets;
+ size_t _M_facets_size;
+ const facet** _M_caches;
+ char** _M_names;
+ static const locale::id* const _S_id_ctype[];
+ static const locale::id* const _S_id_numeric[];
+ static const locale::id* const _S_id_collate[];
+ static const locale::id* const _S_id_time[];
+ static const locale::id* const _S_id_monetary[];
+ static const locale::id* const _S_id_messages[];
+ static const locale::id* const* const _S_facet_categories[];
+
+ void
+ _M_add_reference() throw()
+ { __gnu_cxx::__atomic_add_dispatch(&_M_refcount, 1); }
+
+ void
+ _M_remove_reference() throw()
+ {
+ if (__gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1) == 1)
+ {
+ __try
+ { delete this; }
+ __catch(...)
+ { }
+ }
+ }
+
+ _Impl(const _Impl&, size_t);
+ _Impl(const char*, size_t);
+ _Impl(size_t) throw();
+
+ ~_Impl() throw();
+
+ _Impl(const _Impl&); // Not defined.
+
+ void
+ operator=(const _Impl&); // Not defined.
+
+ bool
+ _M_check_same_name()
+ {
+ bool __ret = true;
+ if (_M_names[1])
+ // We must actually compare all the _M_names: can be all equal!
+ for (size_t __i = 0; __ret && __i < _S_categories_size - 1; ++__i)
+ __ret = __builtin_strcmp(_M_names[__i], _M_names[__i + 1]) == 0;
+ return __ret;
+ }
+
+ void
+ _M_replace_categories(const _Impl*, category);
+
+ void
+ _M_replace_category(const _Impl*, const locale::id* const*);
+
+ void
+ _M_replace_facet(const _Impl*, const locale::id*);
+
+ void
+ _M_install_facet(const locale::id*, const facet*);
+
+ template<typename _Facet>
+ void
+ _M_init_facet(_Facet* __facet)
+ { _M_install_facet(&_Facet::id, __facet); }
+
+ void
+ _M_install_cache(const facet*, size_t);
+ };
+
+
+ /**
+ * @brief Test for the presence of a facet.
+ *
+ * has_facet tests the locale argument for the presence of the facet type
+ * provided as the template parameter. Facets derived from the facet
+ * parameter will also return true.
+ *
+ * @param Facet The facet type to test the presence of.
+ * @param locale The locale to test.
+ * @return true if locale contains a facet of type Facet, else false.
+ */
+ template<typename _Facet>
+ bool
+ has_facet(const locale& __loc) throw();
+
+ /**
+ * @brief Return a facet.
+ *
+ * use_facet looks for and returns a reference to a facet of type Facet
+ * where Facet is the template parameter. If has_facet(locale) is true,
+ * there is a suitable facet to return. It throws std::bad_cast if the
+ * locale doesn't contain a facet of type Facet.
+ *
+ * @param Facet The facet type to access.
+ * @param locale The locale to use.
+ * @return Reference to facet of type Facet.
+ * @throw std::bad_cast if locale doesn't contain a facet of type Facet.
+ */
+ template<typename _Facet>
+ const _Facet&
+ use_facet(const locale& __loc);
+
+
+ /**
+ * @brief Facet for localized string comparison.
+ *
+ * This facet encapsulates the code to compare strings in a localized
+ * manner.
+ *
+ * The collate template uses protected virtual functions to provide
+ * the actual results. The public accessors forward the call to
+ * the virtual functions. These virtual functions are hooks for
+ * developers to implement the behavior they require from the
+ * collate facet.
+ */
+ template<typename _CharT>
+ class collate : public locale::facet
+ {
+ public:
+ // Types:
+ //@{
+ /// Public typedefs
+ typedef _CharT char_type;
+ typedef basic_string<_CharT> string_type;
+ //@}
+
+ protected:
+ // Underlying "C" library locale information saved from
+ // initialization, needed by collate_byname as well.
+ __c_locale _M_c_locale_collate;
+
+ public:
+ /// Numpunct facet id.
+ static locale::id id;
+
+ /**
+ * @brief Constructor performs initialization.
+ *
+ * This is the constructor provided by the standard.
+ *
+ * @param refs Passed to the base facet class.
+ */
+ explicit
+ collate(size_t __refs = 0)
+ : facet(__refs), _M_c_locale_collate(_S_get_c_locale())
+ { }
+
+ /**
+ * @brief Internal constructor. Not for general use.
+ *
+ * This is a constructor for use by the library itself to set up new
+ * locales.
+ *
+ * @param cloc The "C" locale.
+ * @param refs Passed to the base facet class.
+ */
+ explicit
+ collate(__c_locale __cloc, size_t __refs = 0)
+ : facet(__refs), _M_c_locale_collate(_S_clone_c_locale(__cloc))
+ { }
+
+ /**
+ * @brief Compare two strings.
+ *
+ * This function compares two strings and returns the result by calling
+ * collate::do_compare().
+ *
+ * @param lo1 Start of string 1.
+ * @param hi1 End of string 1.
+ * @param lo2 Start of string 2.
+ * @param hi2 End of string 2.
+ * @return 1 if string1 > string2, -1 if string1 < string2, else 0.
+ */
+ int
+ compare(const _CharT* __lo1, const _CharT* __hi1,
+ const _CharT* __lo2, const _CharT* __hi2) const
+ { return this->do_compare(__lo1, __hi1, __lo2, __hi2); }
+
+ /**
+ * @brief Transform string to comparable form.
+ *
+ * This function is a wrapper for strxfrm functionality. It takes the
+ * input string and returns a modified string that can be directly
+ * compared to other transformed strings. In the "C" locale, this
+ * function just returns a copy of the input string. In some other
+ * locales, it may replace two chars with one, change a char for
+ * another, etc. It does so by returning collate::do_transform().
+ *
+ * @param lo Start of string.
+ * @param hi End of string.
+ * @return Transformed string_type.
+ */
+ string_type
+ transform(const _CharT* __lo, const _CharT* __hi) const
+ { return this->do_transform(__lo, __hi); }
+
+ /**
+ * @brief Return hash of a string.
+ *
+ * This function computes and returns a hash on the input string. It
+ * does so by returning collate::do_hash().
+ *
+ * @param lo Start of string.
+ * @param hi End of string.
+ * @return Hash value.
+ */
+ long
+ hash(const _CharT* __lo, const _CharT* __hi) const
+ { return this->do_hash(__lo, __hi); }
+
+ // Used to abstract out _CharT bits in virtual member functions, below.
+ int
+ _M_compare(const _CharT*, const _CharT*) const;
+
+ size_t
+ _M_transform(_CharT*, const _CharT*, size_t) const;
+
+ protected:
+ /// Destructor.
+ virtual
+ ~collate()
+ { _S_destroy_c_locale(_M_c_locale_collate); }
+
+ /**
+ * @brief Compare two strings.
+ *
+ * This function is a hook for derived classes to change the value
+ * returned. @see compare().
+ *
+ * @param lo1 Start of string 1.
+ * @param hi1 End of string 1.
+ * @param lo2 Start of string 2.
+ * @param hi2 End of string 2.
+ * @return 1 if string1 > string2, -1 if string1 < string2, else 0.
+ */
+ virtual int
+ do_compare(const _CharT* __lo1, const _CharT* __hi1,
+ const _CharT* __lo2, const _CharT* __hi2) const;
+
+ /**
+ * @brief Transform string to comparable form.
+ *
+ * This function is a hook for derived classes to change the value
+ * returned.
+ *
+ * @param lo1 Start of string 1.
+ * @param hi1 End of string 1.
+ * @param lo2 Start of string 2.
+ * @param hi2 End of string 2.
+ * @return 1 if string1 > string2, -1 if string1 < string2, else 0.
+ */
+ virtual string_type
+ do_transform(const _CharT* __lo, const _CharT* __hi) const;
+
+ /**
+ * @brief Return hash of a string.
+ *
+ * This function computes and returns a hash on the input string. This
+ * function is a hook for derived classes to change the value returned.
+ *
+ * @param lo Start of string.
+ * @param hi End of string.
+ * @return Hash value.
+ */
+ virtual long
+ do_hash(const _CharT* __lo, const _CharT* __hi) const;
+ };
+
+ template<typename _CharT>
+ locale::id collate<_CharT>::id;
+
+ // Specializations.
+ template<>
+ int
+ collate<char>::_M_compare(const char*, const char*) const;
+
+ template<>
+ size_t
+ collate<char>::_M_transform(char*, const char*, size_t) const;
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template<>
+ int
+ collate<wchar_t>::_M_compare(const wchar_t*, const wchar_t*) const;
+
+ template<>
+ size_t
+ collate<wchar_t>::_M_transform(wchar_t*, const wchar_t*, size_t) const;
+#endif
+
+ /// class collate_byname [22.2.4.2].
+ template<typename _CharT>
+ class collate_byname : public collate<_CharT>
+ {
+ public:
+ //@{
+ /// Public typedefs
+ typedef _CharT char_type;
+ typedef basic_string<_CharT> string_type;
+ //@}
+
+ explicit
+ collate_byname(const char* __s, size_t __refs = 0)
+ : collate<_CharT>(__refs)
+ {
+ if (__builtin_strcmp(__s, "C") != 0
+ && __builtin_strcmp(__s, "POSIX") != 0)
+ {
+ this->_S_destroy_c_locale(this->_M_c_locale_collate);
+ this->_S_create_c_locale(this->_M_c_locale_collate, __s);
+ }
+ }
+
+ protected:
+ virtual
+ ~collate_byname() { }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <bits/locale_classes.tcc>
+#endif
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/bits/locale_classes.tcc b/i686-linux/include/c++/4.4.3/bits/locale_classes.tcc
new file mode 100644
index 0000000..c97e555
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/locale_classes.tcc
@@ -0,0 +1,271 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file locale_classes.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 22.1 Locales
+//
+
+#ifndef _LOCALE_CLASSES_TCC
+#define _LOCALE_CLASSES_TCC 1
+
+#pragma GCC system_header
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _Facet>
+ locale::
+ locale(const locale& __other, _Facet* __f)
+ {
+ _M_impl = new _Impl(*__other._M_impl, 1);
+
+ __try
+ { _M_impl->_M_install_facet(&_Facet::id, __f); }
+ __catch(...)
+ {
+ _M_impl->_M_remove_reference();
+ __throw_exception_again;
+ }
+ delete [] _M_impl->_M_names[0];
+ _M_impl->_M_names[0] = 0; // Unnamed.
+ }
+
+ template<typename _Facet>
+ locale
+ locale::
+ combine(const locale& __other) const
+ {
+ _Impl* __tmp = new _Impl(*_M_impl, 1);
+ __try
+ {
+ __tmp->_M_replace_facet(__other._M_impl, &_Facet::id);
+ }
+ __catch(...)
+ {
+ __tmp->_M_remove_reference();
+ __throw_exception_again;
+ }
+ return locale(__tmp);
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ bool
+ locale::
+ operator()(const basic_string<_CharT, _Traits, _Alloc>& __s1,
+ const basic_string<_CharT, _Traits, _Alloc>& __s2) const
+ {
+ typedef std::collate<_CharT> __collate_type;
+ const __collate_type& __collate = use_facet<__collate_type>(*this);
+ return (__collate.compare(__s1.data(), __s1.data() + __s1.length(),
+ __s2.data(), __s2.data() + __s2.length()) < 0);
+ }
+
+
+ template<typename _Facet>
+ bool
+ has_facet(const locale& __loc) throw()
+ {
+ const size_t __i = _Facet::id._M_id();
+ const locale::facet** __facets = __loc._M_impl->_M_facets;
+ return (__i < __loc._M_impl->_M_facets_size
+#ifdef __GXX_RTTI
+ && dynamic_cast<const _Facet*>(__facets[__i]));
+#else
+ && static_cast<const _Facet*>(__facets[__i]));
+#endif
+ }
+
+ template<typename _Facet>
+ const _Facet&
+ use_facet(const locale& __loc)
+ {
+ const size_t __i = _Facet::id._M_id();
+ const locale::facet** __facets = __loc._M_impl->_M_facets;
+ if (__i >= __loc._M_impl->_M_facets_size || !__facets[__i])
+ __throw_bad_cast();
+#ifdef __GXX_RTTI
+ return dynamic_cast<const _Facet&>(*__facets[__i]);
+#else
+ return static_cast<const _Facet&>(*__facets[__i]);
+#endif
+ }
+
+
+ // Generic version does nothing.
+ template<typename _CharT>
+ int
+ collate<_CharT>::_M_compare(const _CharT*, const _CharT*) const
+ { return 0; }
+
+ // Generic version does nothing.
+ template<typename _CharT>
+ size_t
+ collate<_CharT>::_M_transform(_CharT*, const _CharT*, size_t) const
+ { return 0; }
+
+ template<typename _CharT>
+ int
+ collate<_CharT>::
+ do_compare(const _CharT* __lo1, const _CharT* __hi1,
+ const _CharT* __lo2, const _CharT* __hi2) const
+ {
+ // strcoll assumes zero-terminated strings so we make a copy
+ // and then put a zero at the end.
+ const string_type __one(__lo1, __hi1);
+ const string_type __two(__lo2, __hi2);
+
+ const _CharT* __p = __one.c_str();
+ const _CharT* __pend = __one.data() + __one.length();
+ const _CharT* __q = __two.c_str();
+ const _CharT* __qend = __two.data() + __two.length();
+
+ // strcoll stops when it sees a nul character so we break
+ // the strings into zero-terminated substrings and pass those
+ // to strcoll.
+ for (;;)
+ {
+ const int __res = _M_compare(__p, __q);
+ if (__res)
+ return __res;
+
+ __p += char_traits<_CharT>::length(__p);
+ __q += char_traits<_CharT>::length(__q);
+ if (__p == __pend && __q == __qend)
+ return 0;
+ else if (__p == __pend)
+ return -1;
+ else if (__q == __qend)
+ return 1;
+
+ __p++;
+ __q++;
+ }
+ }
+
+ template<typename _CharT>
+ typename collate<_CharT>::string_type
+ collate<_CharT>::
+ do_transform(const _CharT* __lo, const _CharT* __hi) const
+ {
+ string_type __ret;
+
+ // strxfrm assumes zero-terminated strings so we make a copy
+ const string_type __str(__lo, __hi);
+
+ const _CharT* __p = __str.c_str();
+ const _CharT* __pend = __str.data() + __str.length();
+
+ size_t __len = (__hi - __lo) * 2;
+
+ _CharT* __c = new _CharT[__len];
+
+ __try
+ {
+ // strxfrm stops when it sees a nul character so we break
+ // the string into zero-terminated substrings and pass those
+ // to strxfrm.
+ for (;;)
+ {
+ // First try a buffer perhaps big enough.
+ size_t __res = _M_transform(__c, __p, __len);
+ // If the buffer was not large enough, try again with the
+ // correct size.
+ if (__res >= __len)
+ {
+ __len = __res + 1;
+ delete [] __c, __c = 0;
+ __c = new _CharT[__len];
+ __res = _M_transform(__c, __p, __len);
+ }
+
+ __ret.append(__c, __res);
+ __p += char_traits<_CharT>::length(__p);
+ if (__p == __pend)
+ break;
+
+ __p++;
+ __ret.push_back(_CharT());
+ }
+ }
+ __catch(...)
+ {
+ delete [] __c;
+ __throw_exception_again;
+ }
+
+ delete [] __c;
+
+ return __ret;
+ }
+
+ template<typename _CharT>
+ long
+ collate<_CharT>::
+ do_hash(const _CharT* __lo, const _CharT* __hi) const
+ {
+ unsigned long __val = 0;
+ for (; __lo < __hi; ++__lo)
+ __val =
+ *__lo + ((__val << 7)
+ | (__val >> (__gnu_cxx::__numeric_traits<unsigned long>::
+ __digits - 7)));
+ return static_cast<long>(__val);
+ }
+
+ // Inhibit implicit instantiations for required instantiations,
+ // which are defined via explicit instantiations elsewhere.
+ // NB: This syntax is a GNU extension.
+#if _GLIBCXX_EXTERN_TEMPLATE
+ extern template class collate<char>;
+ extern template class collate_byname<char>;
+
+ extern template
+ const collate<char>&
+ use_facet<collate<char> >(const locale&);
+
+ extern template
+ bool
+ has_facet<collate<char> >(const locale&);
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ extern template class collate<wchar_t>;
+ extern template class collate_byname<wchar_t>;
+
+ extern template
+ const collate<wchar_t>&
+ use_facet<collate<wchar_t> >(const locale&);
+
+ extern template
+ bool
+ has_facet<collate<wchar_t> >(const locale&);
+#endif
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/bits/locale_facets.h b/i686-linux/include/c++/4.4.3/bits/locale_facets.h
new file mode 100644
index 0000000..beed6f1
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/locale_facets.h
@@ -0,0 +1,2602 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file locale_facets.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 22.1 Locales
+//
+
+#ifndef _LOCALE_FACETS_H
+#define _LOCALE_FACETS_H 1
+
+#pragma GCC system_header
+
+#include <cwctype> // For wctype_t
+#include <cctype>
+#include <bits/ctype_base.h>
+#include <iosfwd>
+#include <bits/ios_base.h> // For ios_base, ios_base::iostate
+#include <streambuf>
+#include <bits/cpp_type_traits.h>
+#include <ext/type_traits.h>
+#include <ext/numeric_traits.h>
+#include <bits/streambuf_iterator.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // NB: Don't instantiate required wchar_t facets if no wchar_t support.
+#ifdef _GLIBCXX_USE_WCHAR_T
+# define _GLIBCXX_NUM_FACETS 28
+#else
+# define _GLIBCXX_NUM_FACETS 14
+#endif
+
+ // Convert string to numeric value of type _Tv and store results.
+ // NB: This is specialized for all required types, there is no
+ // generic definition.
+ template<typename _Tv>
+ void
+ __convert_to_v(const char* __in, _Tv& __out, ios_base::iostate& __err,
+ const __c_locale& __cloc);
+
+ // Explicit specializations for required types.
+ template<>
+ void
+ __convert_to_v(const char*, float&, ios_base::iostate&,
+ const __c_locale&);
+
+ template<>
+ void
+ __convert_to_v(const char*, double&, ios_base::iostate&,
+ const __c_locale&);
+
+ template<>
+ void
+ __convert_to_v(const char*, long double&, ios_base::iostate&,
+ const __c_locale&);
+
+ // NB: __pad is a struct, rather than a function, so it can be
+ // partially-specialized.
+ template<typename _CharT, typename _Traits>
+ struct __pad
+ {
+ static void
+ _S_pad(ios_base& __io, _CharT __fill, _CharT* __news,
+ const _CharT* __olds, streamsize __newlen, streamsize __oldlen);
+ };
+
+ // Used by both numeric and monetary facets.
+ // Inserts "group separator" characters into an array of characters.
+ // It's recursive, one iteration per group. It moves the characters
+ // in the buffer this way: "xxxx12345" -> "12,345xxx". Call this
+ // only with __gsize != 0.
+ template<typename _CharT>
+ _CharT*
+ __add_grouping(_CharT* __s, _CharT __sep,
+ const char* __gbeg, size_t __gsize,
+ const _CharT* __first, const _CharT* __last);
+
+ // This template permits specializing facet output code for
+ // ostreambuf_iterator. For ostreambuf_iterator, sputn is
+ // significantly more efficient than incrementing iterators.
+ template<typename _CharT>
+ inline
+ ostreambuf_iterator<_CharT>
+ __write(ostreambuf_iterator<_CharT> __s, const _CharT* __ws, int __len)
+ {
+ __s._M_put(__ws, __len);
+ return __s;
+ }
+
+ // This is the unspecialized form of the template.
+ template<typename _CharT, typename _OutIter>
+ inline
+ _OutIter
+ __write(_OutIter __s, const _CharT* __ws, int __len)
+ {
+ for (int __j = 0; __j < __len; __j++, ++__s)
+ *__s = __ws[__j];
+ return __s;
+ }
+
+
+ // 22.2.1.1 Template class ctype
+ // Include host and configuration specific ctype enums for ctype_base.
+
+ // Common base for ctype<_CharT>.
+ /**
+ * @brief Common base for ctype facet
+ *
+ * This template class provides implementations of the public functions
+ * that forward to the protected virtual functions.
+ *
+ * This template also provides abstract stubs for the protected virtual
+ * functions.
+ */
+ template<typename _CharT>
+ class __ctype_abstract_base : public locale::facet, public ctype_base
+ {
+ public:
+ // Types:
+ /// Typedef for the template parameter
+ typedef _CharT char_type;
+
+ /**
+ * @brief Test char_type classification.
+ *
+ * This function finds a mask M for @a c and compares it to mask @a m.
+ * It does so by returning the value of ctype<char_type>::do_is().
+ *
+ * @param c The char_type to compare the mask of.
+ * @param m The mask to compare against.
+ * @return (M & m) != 0.
+ */
+ bool
+ is(mask __m, char_type __c) const
+ { return this->do_is(__m, __c); }
+
+ /**
+ * @brief Return a mask array.
+ *
+ * This function finds the mask for each char_type in the range [lo,hi)
+ * and successively writes it to vec. vec must have as many elements
+ * as the char array. It does so by returning the value of
+ * ctype<char_type>::do_is().
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @param vec Pointer to an array of mask storage.
+ * @return @a hi.
+ */
+ const char_type*
+ is(const char_type *__lo, const char_type *__hi, mask *__vec) const
+ { return this->do_is(__lo, __hi, __vec); }
+
+ /**
+ * @brief Find char_type matching a mask
+ *
+ * This function searches for and returns the first char_type c in
+ * [lo,hi) for which is(m,c) is true. It does so by returning
+ * ctype<char_type>::do_scan_is().
+ *
+ * @param m The mask to compare against.
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return Pointer to matching char_type if found, else @a hi.
+ */
+ const char_type*
+ scan_is(mask __m, const char_type* __lo, const char_type* __hi) const
+ { return this->do_scan_is(__m, __lo, __hi); }
+
+ /**
+ * @brief Find char_type not matching a mask
+ *
+ * This function searches for and returns the first char_type c in
+ * [lo,hi) for which is(m,c) is false. It does so by returning
+ * ctype<char_type>::do_scan_not().
+ *
+ * @param m The mask to compare against.
+ * @param lo Pointer to first char in range.
+ * @param hi Pointer to end of range.
+ * @return Pointer to non-matching char if found, else @a hi.
+ */
+ const char_type*
+ scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
+ { return this->do_scan_not(__m, __lo, __hi); }
+
+ /**
+ * @brief Convert to uppercase.
+ *
+ * This function converts the argument to uppercase if possible.
+ * If not possible (for example, '2'), returns the argument. It does
+ * so by returning ctype<char_type>::do_toupper().
+ *
+ * @param c The char_type to convert.
+ * @return The uppercase char_type if convertible, else @a c.
+ */
+ char_type
+ toupper(char_type __c) const
+ { return this->do_toupper(__c); }
+
+ /**
+ * @brief Convert array to uppercase.
+ *
+ * This function converts each char_type in the range [lo,hi) to
+ * uppercase if possible. Other elements remain untouched. It does so
+ * by returning ctype<char_type>:: do_toupper(lo, hi).
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return @a hi.
+ */
+ const char_type*
+ toupper(char_type *__lo, const char_type* __hi) const
+ { return this->do_toupper(__lo, __hi); }
+
+ /**
+ * @brief Convert to lowercase.
+ *
+ * This function converts the argument to lowercase if possible. If
+ * not possible (for example, '2'), returns the argument. It does so
+ * by returning ctype<char_type>::do_tolower(c).
+ *
+ * @param c The char_type to convert.
+ * @return The lowercase char_type if convertible, else @a c.
+ */
+ char_type
+ tolower(char_type __c) const
+ { return this->do_tolower(__c); }
+
+ /**
+ * @brief Convert array to lowercase.
+ *
+ * This function converts each char_type in the range [lo,hi) to
+ * lowercase if possible. Other elements remain untouched. It does so
+ * by returning ctype<char_type>:: do_tolower(lo, hi).
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return @a hi.
+ */
+ const char_type*
+ tolower(char_type* __lo, const char_type* __hi) const
+ { return this->do_tolower(__lo, __hi); }
+
+ /**
+ * @brief Widen char to char_type
+ *
+ * This function converts the char argument to char_type using the
+ * simplest reasonable transformation. It does so by returning
+ * ctype<char_type>::do_widen(c).
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param c The char to convert.
+ * @return The converted char_type.
+ */
+ char_type
+ widen(char __c) const
+ { return this->do_widen(__c); }
+
+ /**
+ * @brief Widen array to char_type
+ *
+ * This function converts each char in the input to char_type using the
+ * simplest reasonable transformation. It does so by returning
+ * ctype<char_type>::do_widen(c).
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @param to Pointer to the destination array.
+ * @return @a hi.
+ */
+ const char*
+ widen(const char* __lo, const char* __hi, char_type* __to) const
+ { return this->do_widen(__lo, __hi, __to); }
+
+ /**
+ * @brief Narrow char_type to char
+ *
+ * This function converts the char_type to char using the simplest
+ * reasonable transformation. If the conversion fails, dfault is
+ * returned instead. It does so by returning
+ * ctype<char_type>::do_narrow(c).
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param c The char_type to convert.
+ * @param dfault Char to return if conversion fails.
+ * @return The converted char.
+ */
+ char
+ narrow(char_type __c, char __dfault) const
+ { return this->do_narrow(__c, __dfault); }
+
+ /**
+ * @brief Narrow array to char array
+ *
+ * This function converts each char_type in the input to char using the
+ * simplest reasonable transformation and writes the results to the
+ * destination array. For any char_type in the input that cannot be
+ * converted, @a dfault is used instead. It does so by returning
+ * ctype<char_type>::do_narrow(lo, hi, dfault, to).
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @param dfault Char to use if conversion fails.
+ * @param to Pointer to the destination array.
+ * @return @a hi.
+ */
+ const char_type*
+ narrow(const char_type* __lo, const char_type* __hi,
+ char __dfault, char *__to) const
+ { return this->do_narrow(__lo, __hi, __dfault, __to); }
+
+ protected:
+ explicit
+ __ctype_abstract_base(size_t __refs = 0): facet(__refs) { }
+
+ virtual
+ ~__ctype_abstract_base() { }
+
+ /**
+ * @brief Test char_type classification.
+ *
+ * This function finds a mask M for @a c and compares it to mask @a m.
+ *
+ * do_is() is a hook for a derived facet to change the behavior of
+ * classifying. do_is() must always return the same result for the
+ * same input.
+ *
+ * @param c The char_type to find the mask of.
+ * @param m The mask to compare against.
+ * @return (M & m) != 0.
+ */
+ virtual bool
+ do_is(mask __m, char_type __c) const = 0;
+
+ /**
+ * @brief Return a mask array.
+ *
+ * This function finds the mask for each char_type in the range [lo,hi)
+ * and successively writes it to vec. vec must have as many elements
+ * as the input.
+ *
+ * do_is() is a hook for a derived facet to change the behavior of
+ * classifying. do_is() must always return the same result for the
+ * same input.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @param vec Pointer to an array of mask storage.
+ * @return @a hi.
+ */
+ virtual const char_type*
+ do_is(const char_type* __lo, const char_type* __hi,
+ mask* __vec) const = 0;
+
+ /**
+ * @brief Find char_type matching mask
+ *
+ * This function searches for and returns the first char_type c in
+ * [lo,hi) for which is(m,c) is true.
+ *
+ * do_scan_is() is a hook for a derived facet to change the behavior of
+ * match searching. do_is() must always return the same result for the
+ * same input.
+ *
+ * @param m The mask to compare against.
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return Pointer to a matching char_type if found, else @a hi.
+ */
+ virtual const char_type*
+ do_scan_is(mask __m, const char_type* __lo,
+ const char_type* __hi) const = 0;
+
+ /**
+ * @brief Find char_type not matching mask
+ *
+ * This function searches for and returns a pointer to the first
+ * char_type c of [lo,hi) for which is(m,c) is false.
+ *
+ * do_scan_is() is a hook for a derived facet to change the behavior of
+ * match searching. do_is() must always return the same result for the
+ * same input.
+ *
+ * @param m The mask to compare against.
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return Pointer to a non-matching char_type if found, else @a hi.
+ */
+ virtual const char_type*
+ do_scan_not(mask __m, const char_type* __lo,
+ const char_type* __hi) const = 0;
+
+ /**
+ * @brief Convert to uppercase.
+ *
+ * This virtual function converts the char_type argument to uppercase
+ * if possible. If not possible (for example, '2'), returns the
+ * argument.
+ *
+ * do_toupper() is a hook for a derived facet to change the behavior of
+ * uppercasing. do_toupper() must always return the same result for
+ * the same input.
+ *
+ * @param c The char_type to convert.
+ * @return The uppercase char_type if convertible, else @a c.
+ */
+ virtual char_type
+ do_toupper(char_type) const = 0;
+
+ /**
+ * @brief Convert array to uppercase.
+ *
+ * This virtual function converts each char_type in the range [lo,hi)
+ * to uppercase if possible. Other elements remain untouched.
+ *
+ * do_toupper() is a hook for a derived facet to change the behavior of
+ * uppercasing. do_toupper() must always return the same result for
+ * the same input.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return @a hi.
+ */
+ virtual const char_type*
+ do_toupper(char_type* __lo, const char_type* __hi) const = 0;
+
+ /**
+ * @brief Convert to lowercase.
+ *
+ * This virtual function converts the argument to lowercase if
+ * possible. If not possible (for example, '2'), returns the argument.
+ *
+ * do_tolower() is a hook for a derived facet to change the behavior of
+ * lowercasing. do_tolower() must always return the same result for
+ * the same input.
+ *
+ * @param c The char_type to convert.
+ * @return The lowercase char_type if convertible, else @a c.
+ */
+ virtual char_type
+ do_tolower(char_type) const = 0;
+
+ /**
+ * @brief Convert array to lowercase.
+ *
+ * This virtual function converts each char_type in the range [lo,hi)
+ * to lowercase if possible. Other elements remain untouched.
+ *
+ * do_tolower() is a hook for a derived facet to change the behavior of
+ * lowercasing. do_tolower() must always return the same result for
+ * the same input.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return @a hi.
+ */
+ virtual const char_type*
+ do_tolower(char_type* __lo, const char_type* __hi) const = 0;
+
+ /**
+ * @brief Widen char
+ *
+ * This virtual function converts the char to char_type using the
+ * simplest reasonable transformation.
+ *
+ * do_widen() is a hook for a derived facet to change the behavior of
+ * widening. do_widen() must always return the same result for the
+ * same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param c The char to convert.
+ * @return The converted char_type
+ */
+ virtual char_type
+ do_widen(char) const = 0;
+
+ /**
+ * @brief Widen char array
+ *
+ * This function converts each char in the input to char_type using the
+ * simplest reasonable transformation.
+ *
+ * do_widen() is a hook for a derived facet to change the behavior of
+ * widening. do_widen() must always return the same result for the
+ * same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param lo Pointer to start range.
+ * @param hi Pointer to end of range.
+ * @param to Pointer to the destination array.
+ * @return @a hi.
+ */
+ virtual const char*
+ do_widen(const char* __lo, const char* __hi,
+ char_type* __dest) const = 0;
+
+ /**
+ * @brief Narrow char_type to char
+ *
+ * This virtual function converts the argument to char using the
+ * simplest reasonable transformation. If the conversion fails, dfault
+ * is returned instead.
+ *
+ * do_narrow() is a hook for a derived facet to change the behavior of
+ * narrowing. do_narrow() must always return the same result for the
+ * same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param c The char_type to convert.
+ * @param dfault Char to return if conversion fails.
+ * @return The converted char.
+ */
+ virtual char
+ do_narrow(char_type, char __dfault) const = 0;
+
+ /**
+ * @brief Narrow char_type array to char
+ *
+ * This virtual function converts each char_type in the range [lo,hi) to
+ * char using the simplest reasonable transformation and writes the
+ * results to the destination array. For any element in the input that
+ * cannot be converted, @a dfault is used instead.
+ *
+ * do_narrow() is a hook for a derived facet to change the behavior of
+ * narrowing. do_narrow() must always return the same result for the
+ * same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @param dfault Char to use if conversion fails.
+ * @param to Pointer to the destination array.
+ * @return @a hi.
+ */
+ virtual const char_type*
+ do_narrow(const char_type* __lo, const char_type* __hi,
+ char __dfault, char* __dest) const = 0;
+ };
+
+ // NB: Generic, mostly useless implementation.
+ /**
+ * @brief Template ctype facet
+ *
+ * This template class defines classification and conversion functions for
+ * character sets. It wraps <cctype> functionality. Ctype gets used by
+ * streams for many I/O operations.
+ *
+ * This template provides the protected virtual functions the developer
+ * will have to replace in a derived class or specialization to make a
+ * working facet. The public functions that access them are defined in
+ * __ctype_abstract_base, to allow for implementation flexibility. See
+ * ctype<wchar_t> for an example. The functions are documented in
+ * __ctype_abstract_base.
+ *
+ * Note: implementations are provided for all the protected virtual
+ * functions, but will likely not be useful.
+ */
+ template<typename _CharT>
+ class ctype : public __ctype_abstract_base<_CharT>
+ {
+ public:
+ // Types:
+ typedef _CharT char_type;
+ typedef typename __ctype_abstract_base<_CharT>::mask mask;
+
+ /// The facet id for ctype<char_type>
+ static locale::id id;
+
+ explicit
+ ctype(size_t __refs = 0) : __ctype_abstract_base<_CharT>(__refs) { }
+
+ protected:
+ virtual
+ ~ctype();
+
+ virtual bool
+ do_is(mask __m, char_type __c) const;
+
+ virtual const char_type*
+ do_is(const char_type* __lo, const char_type* __hi, mask* __vec) const;
+
+ virtual const char_type*
+ do_scan_is(mask __m, const char_type* __lo, const char_type* __hi) const;
+
+ virtual const char_type*
+ do_scan_not(mask __m, const char_type* __lo,
+ const char_type* __hi) const;
+
+ virtual char_type
+ do_toupper(char_type __c) const;
+
+ virtual const char_type*
+ do_toupper(char_type* __lo, const char_type* __hi) const;
+
+ virtual char_type
+ do_tolower(char_type __c) const;
+
+ virtual const char_type*
+ do_tolower(char_type* __lo, const char_type* __hi) const;
+
+ virtual char_type
+ do_widen(char __c) const;
+
+ virtual const char*
+ do_widen(const char* __lo, const char* __hi, char_type* __dest) const;
+
+ virtual char
+ do_narrow(char_type, char __dfault) const;
+
+ virtual const char_type*
+ do_narrow(const char_type* __lo, const char_type* __hi,
+ char __dfault, char* __dest) const;
+ };
+
+ template<typename _CharT>
+ locale::id ctype<_CharT>::id;
+
+ // 22.2.1.3 ctype<char> specialization.
+ /**
+ * @brief The ctype<char> specialization.
+ *
+ * This class defines classification and conversion functions for
+ * the char type. It gets used by char streams for many I/O
+ * operations. The char specialization provides a number of
+ * optimizations as well.
+ */
+ template<>
+ class ctype<char> : public locale::facet, public ctype_base
+ {
+ public:
+ // Types:
+ /// Typedef for the template parameter char.
+ typedef char char_type;
+
+ protected:
+ // Data Members:
+ __c_locale _M_c_locale_ctype;
+ bool _M_del;
+ __to_type _M_toupper;
+ __to_type _M_tolower;
+ const mask* _M_table;
+ mutable char _M_widen_ok;
+ mutable char _M_widen[1 + static_cast<unsigned char>(-1)];
+ mutable char _M_narrow[1 + static_cast<unsigned char>(-1)];
+ mutable char _M_narrow_ok; // 0 uninitialized, 1 init,
+ // 2 memcpy can't be used
+
+ public:
+ /// The facet id for ctype<char>
+ static locale::id id;
+ /// The size of the mask table. It is SCHAR_MAX + 1.
+ static const size_t table_size = 1 + static_cast<unsigned char>(-1);
+
+ /**
+ * @brief Constructor performs initialization.
+ *
+ * This is the constructor provided by the standard.
+ *
+ * @param table If non-zero, table is used as the per-char mask.
+ * Else classic_table() is used.
+ * @param del If true, passes ownership of table to this facet.
+ * @param refs Passed to the base facet class.
+ */
+ explicit
+ ctype(const mask* __table = 0, bool __del = false, size_t __refs = 0);
+
+ /**
+ * @brief Constructor performs static initialization.
+ *
+ * This constructor is used to construct the initial C locale facet.
+ *
+ * @param cloc Handle to C locale data.
+ * @param table If non-zero, table is used as the per-char mask.
+ * @param del If true, passes ownership of table to this facet.
+ * @param refs Passed to the base facet class.
+ */
+ explicit
+ ctype(__c_locale __cloc, const mask* __table = 0, bool __del = false,
+ size_t __refs = 0);
+
+ /**
+ * @brief Test char classification.
+ *
+ * This function compares the mask table[c] to @a m.
+ *
+ * @param c The char to compare the mask of.
+ * @param m The mask to compare against.
+ * @return True if m & table[c] is true, false otherwise.
+ */
+ inline bool
+ is(mask __m, char __c) const;
+
+ /**
+ * @brief Return a mask array.
+ *
+ * This function finds the mask for each char in the range [lo, hi) and
+ * successively writes it to vec. vec must have as many elements as
+ * the char array.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @param vec Pointer to an array of mask storage.
+ * @return @a hi.
+ */
+ inline const char*
+ is(const char* __lo, const char* __hi, mask* __vec) const;
+
+ /**
+ * @brief Find char matching a mask
+ *
+ * This function searches for and returns the first char in [lo,hi) for
+ * which is(m,char) is true.
+ *
+ * @param m The mask to compare against.
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return Pointer to a matching char if found, else @a hi.
+ */
+ inline const char*
+ scan_is(mask __m, const char* __lo, const char* __hi) const;
+
+ /**
+ * @brief Find char not matching a mask
+ *
+ * This function searches for and returns a pointer to the first char
+ * in [lo,hi) for which is(m,char) is false.
+ *
+ * @param m The mask to compare against.
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return Pointer to a non-matching char if found, else @a hi.
+ */
+ inline const char*
+ scan_not(mask __m, const char* __lo, const char* __hi) const;
+
+ /**
+ * @brief Convert to uppercase.
+ *
+ * This function converts the char argument to uppercase if possible.
+ * If not possible (for example, '2'), returns the argument.
+ *
+ * toupper() acts as if it returns ctype<char>::do_toupper(c).
+ * do_toupper() must always return the same result for the same input.
+ *
+ * @param c The char to convert.
+ * @return The uppercase char if convertible, else @a c.
+ */
+ char_type
+ toupper(char_type __c) const
+ { return this->do_toupper(__c); }
+
+ /**
+ * @brief Convert array to uppercase.
+ *
+ * This function converts each char in the range [lo,hi) to uppercase
+ * if possible. Other chars remain untouched.
+ *
+ * toupper() acts as if it returns ctype<char>:: do_toupper(lo, hi).
+ * do_toupper() must always return the same result for the same input.
+ *
+ * @param lo Pointer to first char in range.
+ * @param hi Pointer to end of range.
+ * @return @a hi.
+ */
+ const char_type*
+ toupper(char_type *__lo, const char_type* __hi) const
+ { return this->do_toupper(__lo, __hi); }
+
+ /**
+ * @brief Convert to lowercase.
+ *
+ * This function converts the char argument to lowercase if possible.
+ * If not possible (for example, '2'), returns the argument.
+ *
+ * tolower() acts as if it returns ctype<char>::do_tolower(c).
+ * do_tolower() must always return the same result for the same input.
+ *
+ * @param c The char to convert.
+ * @return The lowercase char if convertible, else @a c.
+ */
+ char_type
+ tolower(char_type __c) const
+ { return this->do_tolower(__c); }
+
+ /**
+ * @brief Convert array to lowercase.
+ *
+ * This function converts each char in the range [lo,hi) to lowercase
+ * if possible. Other chars remain untouched.
+ *
+ * tolower() acts as if it returns ctype<char>:: do_tolower(lo, hi).
+ * do_tolower() must always return the same result for the same input.
+ *
+ * @param lo Pointer to first char in range.
+ * @param hi Pointer to end of range.
+ * @return @a hi.
+ */
+ const char_type*
+ tolower(char_type* __lo, const char_type* __hi) const
+ { return this->do_tolower(__lo, __hi); }
+
+ /**
+ * @brief Widen char
+ *
+ * This function converts the char to char_type using the simplest
+ * reasonable transformation. For an underived ctype<char> facet, the
+ * argument will be returned unchanged.
+ *
+ * This function works as if it returns ctype<char>::do_widen(c).
+ * do_widen() must always return the same result for the same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param c The char to convert.
+ * @return The converted character.
+ */
+ char_type
+ widen(char __c) const
+ {
+ if (_M_widen_ok)
+ return _M_widen[static_cast<unsigned char>(__c)];
+ this->_M_widen_init();
+ return this->do_widen(__c);
+ }
+
+ /**
+ * @brief Widen char array
+ *
+ * This function converts each char in the input to char using the
+ * simplest reasonable transformation. For an underived ctype<char>
+ * facet, the argument will be copied unchanged.
+ *
+ * This function works as if it returns ctype<char>::do_widen(c).
+ * do_widen() must always return the same result for the same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param lo Pointer to first char in range.
+ * @param hi Pointer to end of range.
+ * @param to Pointer to the destination array.
+ * @return @a hi.
+ */
+ const char*
+ widen(const char* __lo, const char* __hi, char_type* __to) const
+ {
+ if (_M_widen_ok == 1)
+ {
+ __builtin_memcpy(__to, __lo, __hi - __lo);
+ return __hi;
+ }
+ if (!_M_widen_ok)
+ _M_widen_init();
+ return this->do_widen(__lo, __hi, __to);
+ }
+
+ /**
+ * @brief Narrow char
+ *
+ * This function converts the char to char using the simplest
+ * reasonable transformation. If the conversion fails, dfault is
+ * returned instead. For an underived ctype<char> facet, @a c
+ * will be returned unchanged.
+ *
+ * This function works as if it returns ctype<char>::do_narrow(c).
+ * do_narrow() must always return the same result for the same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param c The char to convert.
+ * @param dfault Char to return if conversion fails.
+ * @return The converted character.
+ */
+ char
+ narrow(char_type __c, char __dfault) const
+ {
+ if (_M_narrow[static_cast<unsigned char>(__c)])
+ return _M_narrow[static_cast<unsigned char>(__c)];
+ const char __t = do_narrow(__c, __dfault);
+ if (__t != __dfault)
+ _M_narrow[static_cast<unsigned char>(__c)] = __t;
+ return __t;
+ }
+
+ /**
+ * @brief Narrow char array
+ *
+ * This function converts each char in the input to char using the
+ * simplest reasonable transformation and writes the results to the
+ * destination array. For any char in the input that cannot be
+ * converted, @a dfault is used instead. For an underived ctype<char>
+ * facet, the argument will be copied unchanged.
+ *
+ * This function works as if it returns ctype<char>::do_narrow(lo, hi,
+ * dfault, to). do_narrow() must always return the same result for the
+ * same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @param dfault Char to use if conversion fails.
+ * @param to Pointer to the destination array.
+ * @return @a hi.
+ */
+ const char_type*
+ narrow(const char_type* __lo, const char_type* __hi,
+ char __dfault, char *__to) const
+ {
+ if (__builtin_expect(_M_narrow_ok == 1, true))
+ {
+ __builtin_memcpy(__to, __lo, __hi - __lo);
+ return __hi;
+ }
+ if (!_M_narrow_ok)
+ _M_narrow_init();
+ return this->do_narrow(__lo, __hi, __dfault, __to);
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 695. ctype<char>::classic_table() not accessible.
+ /// Returns a pointer to the mask table provided to the constructor, or
+ /// the default from classic_table() if none was provided.
+ const mask*
+ table() const throw()
+ { return _M_table; }
+
+ /// Returns a pointer to the C locale mask table.
+ static const mask*
+ classic_table() throw();
+ protected:
+
+ /**
+ * @brief Destructor.
+ *
+ * This function deletes table() if @a del was true in the
+ * constructor.
+ */
+ virtual
+ ~ctype();
+
+ /**
+ * @brief Convert to uppercase.
+ *
+ * This virtual function converts the char argument to uppercase if
+ * possible. If not possible (for example, '2'), returns the argument.
+ *
+ * do_toupper() is a hook for a derived facet to change the behavior of
+ * uppercasing. do_toupper() must always return the same result for
+ * the same input.
+ *
+ * @param c The char to convert.
+ * @return The uppercase char if convertible, else @a c.
+ */
+ virtual char_type
+ do_toupper(char_type) const;
+
+ /**
+ * @brief Convert array to uppercase.
+ *
+ * This virtual function converts each char in the range [lo,hi) to
+ * uppercase if possible. Other chars remain untouched.
+ *
+ * do_toupper() is a hook for a derived facet to change the behavior of
+ * uppercasing. do_toupper() must always return the same result for
+ * the same input.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return @a hi.
+ */
+ virtual const char_type*
+ do_toupper(char_type* __lo, const char_type* __hi) const;
+
+ /**
+ * @brief Convert to lowercase.
+ *
+ * This virtual function converts the char argument to lowercase if
+ * possible. If not possible (for example, '2'), returns the argument.
+ *
+ * do_tolower() is a hook for a derived facet to change the behavior of
+ * lowercasing. do_tolower() must always return the same result for
+ * the same input.
+ *
+ * @param c The char to convert.
+ * @return The lowercase char if convertible, else @a c.
+ */
+ virtual char_type
+ do_tolower(char_type) const;
+
+ /**
+ * @brief Convert array to lowercase.
+ *
+ * This virtual function converts each char in the range [lo,hi) to
+ * lowercase if possible. Other chars remain untouched.
+ *
+ * do_tolower() is a hook for a derived facet to change the behavior of
+ * lowercasing. do_tolower() must always return the same result for
+ * the same input.
+ *
+ * @param lo Pointer to first char in range.
+ * @param hi Pointer to end of range.
+ * @return @a hi.
+ */
+ virtual const char_type*
+ do_tolower(char_type* __lo, const char_type* __hi) const;
+
+ /**
+ * @brief Widen char
+ *
+ * This virtual function converts the char to char using the simplest
+ * reasonable transformation. For an underived ctype<char> facet, the
+ * argument will be returned unchanged.
+ *
+ * do_widen() is a hook for a derived facet to change the behavior of
+ * widening. do_widen() must always return the same result for the
+ * same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param c The char to convert.
+ * @return The converted character.
+ */
+ virtual char_type
+ do_widen(char __c) const
+ { return __c; }
+
+ /**
+ * @brief Widen char array
+ *
+ * This function converts each char in the range [lo,hi) to char using
+ * the simplest reasonable transformation. For an underived
+ * ctype<char> facet, the argument will be copied unchanged.
+ *
+ * do_widen() is a hook for a derived facet to change the behavior of
+ * widening. do_widen() must always return the same result for the
+ * same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @param to Pointer to the destination array.
+ * @return @a hi.
+ */
+ virtual const char*
+ do_widen(const char* __lo, const char* __hi, char_type* __dest) const
+ {
+ __builtin_memcpy(__dest, __lo, __hi - __lo);
+ return __hi;
+ }
+
+ /**
+ * @brief Narrow char
+ *
+ * This virtual function converts the char to char using the simplest
+ * reasonable transformation. If the conversion fails, dfault is
+ * returned instead. For an underived ctype<char> facet, @a c will be
+ * returned unchanged.
+ *
+ * do_narrow() is a hook for a derived facet to change the behavior of
+ * narrowing. do_narrow() must always return the same result for the
+ * same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param c The char to convert.
+ * @param dfault Char to return if conversion fails.
+ * @return The converted char.
+ */
+ virtual char
+ do_narrow(char_type __c, char) const
+ { return __c; }
+
+ /**
+ * @brief Narrow char array to char array
+ *
+ * This virtual function converts each char in the range [lo,hi) to
+ * char using the simplest reasonable transformation and writes the
+ * results to the destination array. For any char in the input that
+ * cannot be converted, @a dfault is used instead. For an underived
+ * ctype<char> facet, the argument will be copied unchanged.
+ *
+ * do_narrow() is a hook for a derived facet to change the behavior of
+ * narrowing. do_narrow() must always return the same result for the
+ * same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @param dfault Char to use if conversion fails.
+ * @param to Pointer to the destination array.
+ * @return @a hi.
+ */
+ virtual const char_type*
+ do_narrow(const char_type* __lo, const char_type* __hi,
+ char, char* __dest) const
+ {
+ __builtin_memcpy(__dest, __lo, __hi - __lo);
+ return __hi;
+ }
+
+ private:
+ void _M_narrow_init() const;
+ void _M_widen_init() const;
+ };
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ // 22.2.1.3 ctype<wchar_t> specialization
+ /**
+ * @brief The ctype<wchar_t> specialization.
+ *
+ * This class defines classification and conversion functions for the
+ * wchar_t type. It gets used by wchar_t streams for many I/O operations.
+ * The wchar_t specialization provides a number of optimizations as well.
+ *
+ * ctype<wchar_t> inherits its public methods from
+ * __ctype_abstract_base<wchar_t>.
+ */
+ template<>
+ class ctype<wchar_t> : public __ctype_abstract_base<wchar_t>
+ {
+ public:
+ // Types:
+ /// Typedef for the template parameter wchar_t.
+ typedef wchar_t char_type;
+ typedef wctype_t __wmask_type;
+
+ protected:
+ __c_locale _M_c_locale_ctype;
+
+ // Pre-computed narrowed and widened chars.
+ bool _M_narrow_ok;
+ char _M_narrow[128];
+ wint_t _M_widen[1 + static_cast<unsigned char>(-1)];
+
+ // Pre-computed elements for do_is.
+ mask _M_bit[16];
+ __wmask_type _M_wmask[16];
+
+ public:
+ // Data Members:
+ /// The facet id for ctype<wchar_t>
+ static locale::id id;
+
+ /**
+ * @brief Constructor performs initialization.
+ *
+ * This is the constructor provided by the standard.
+ *
+ * @param refs Passed to the base facet class.
+ */
+ explicit
+ ctype(size_t __refs = 0);
+
+ /**
+ * @brief Constructor performs static initialization.
+ *
+ * This constructor is used to construct the initial C locale facet.
+ *
+ * @param cloc Handle to C locale data.
+ * @param refs Passed to the base facet class.
+ */
+ explicit
+ ctype(__c_locale __cloc, size_t __refs = 0);
+
+ protected:
+ __wmask_type
+ _M_convert_to_wmask(const mask __m) const;
+
+ /// Destructor
+ virtual
+ ~ctype();
+
+ /**
+ * @brief Test wchar_t classification.
+ *
+ * This function finds a mask M for @a c and compares it to mask @a m.
+ *
+ * do_is() is a hook for a derived facet to change the behavior of
+ * classifying. do_is() must always return the same result for the
+ * same input.
+ *
+ * @param c The wchar_t to find the mask of.
+ * @param m The mask to compare against.
+ * @return (M & m) != 0.
+ */
+ virtual bool
+ do_is(mask __m, char_type __c) const;
+
+ /**
+ * @brief Return a mask array.
+ *
+ * This function finds the mask for each wchar_t in the range [lo,hi)
+ * and successively writes it to vec. vec must have as many elements
+ * as the input.
+ *
+ * do_is() is a hook for a derived facet to change the behavior of
+ * classifying. do_is() must always return the same result for the
+ * same input.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @param vec Pointer to an array of mask storage.
+ * @return @a hi.
+ */
+ virtual const char_type*
+ do_is(const char_type* __lo, const char_type* __hi, mask* __vec) const;
+
+ /**
+ * @brief Find wchar_t matching mask
+ *
+ * This function searches for and returns the first wchar_t c in
+ * [lo,hi) for which is(m,c) is true.
+ *
+ * do_scan_is() is a hook for a derived facet to change the behavior of
+ * match searching. do_is() must always return the same result for the
+ * same input.
+ *
+ * @param m The mask to compare against.
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return Pointer to a matching wchar_t if found, else @a hi.
+ */
+ virtual const char_type*
+ do_scan_is(mask __m, const char_type* __lo, const char_type* __hi) const;
+
+ /**
+ * @brief Find wchar_t not matching mask
+ *
+ * This function searches for and returns a pointer to the first
+ * wchar_t c of [lo,hi) for which is(m,c) is false.
+ *
+ * do_scan_is() is a hook for a derived facet to change the behavior of
+ * match searching. do_is() must always return the same result for the
+ * same input.
+ *
+ * @param m The mask to compare against.
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return Pointer to a non-matching wchar_t if found, else @a hi.
+ */
+ virtual const char_type*
+ do_scan_not(mask __m, const char_type* __lo,
+ const char_type* __hi) const;
+
+ /**
+ * @brief Convert to uppercase.
+ *
+ * This virtual function converts the wchar_t argument to uppercase if
+ * possible. If not possible (for example, '2'), returns the argument.
+ *
+ * do_toupper() is a hook for a derived facet to change the behavior of
+ * uppercasing. do_toupper() must always return the same result for
+ * the same input.
+ *
+ * @param c The wchar_t to convert.
+ * @return The uppercase wchar_t if convertible, else @a c.
+ */
+ virtual char_type
+ do_toupper(char_type) const;
+
+ /**
+ * @brief Convert array to uppercase.
+ *
+ * This virtual function converts each wchar_t in the range [lo,hi) to
+ * uppercase if possible. Other elements remain untouched.
+ *
+ * do_toupper() is a hook for a derived facet to change the behavior of
+ * uppercasing. do_toupper() must always return the same result for
+ * the same input.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return @a hi.
+ */
+ virtual const char_type*
+ do_toupper(char_type* __lo, const char_type* __hi) const;
+
+ /**
+ * @brief Convert to lowercase.
+ *
+ * This virtual function converts the argument to lowercase if
+ * possible. If not possible (for example, '2'), returns the argument.
+ *
+ * do_tolower() is a hook for a derived facet to change the behavior of
+ * lowercasing. do_tolower() must always return the same result for
+ * the same input.
+ *
+ * @param c The wchar_t to convert.
+ * @return The lowercase wchar_t if convertible, else @a c.
+ */
+ virtual char_type
+ do_tolower(char_type) const;
+
+ /**
+ * @brief Convert array to lowercase.
+ *
+ * This virtual function converts each wchar_t in the range [lo,hi) to
+ * lowercase if possible. Other elements remain untouched.
+ *
+ * do_tolower() is a hook for a derived facet to change the behavior of
+ * lowercasing. do_tolower() must always return the same result for
+ * the same input.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return @a hi.
+ */
+ virtual const char_type*
+ do_tolower(char_type* __lo, const char_type* __hi) const;
+
+ /**
+ * @brief Widen char to wchar_t
+ *
+ * This virtual function converts the char to wchar_t using the
+ * simplest reasonable transformation. For an underived ctype<wchar_t>
+ * facet, the argument will be cast to wchar_t.
+ *
+ * do_widen() is a hook for a derived facet to change the behavior of
+ * widening. do_widen() must always return the same result for the
+ * same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param c The char to convert.
+ * @return The converted wchar_t.
+ */
+ virtual char_type
+ do_widen(char) const;
+
+ /**
+ * @brief Widen char array to wchar_t array
+ *
+ * This function converts each char in the input to wchar_t using the
+ * simplest reasonable transformation. For an underived ctype<wchar_t>
+ * facet, the argument will be copied, casting each element to wchar_t.
+ *
+ * do_widen() is a hook for a derived facet to change the behavior of
+ * widening. do_widen() must always return the same result for the
+ * same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param lo Pointer to start range.
+ * @param hi Pointer to end of range.
+ * @param to Pointer to the destination array.
+ * @return @a hi.
+ */
+ virtual const char*
+ do_widen(const char* __lo, const char* __hi, char_type* __dest) const;
+
+ /**
+ * @brief Narrow wchar_t to char
+ *
+ * This virtual function converts the argument to char using
+ * the simplest reasonable transformation. If the conversion
+ * fails, dfault is returned instead. For an underived
+ * ctype<wchar_t> facet, @a c will be cast to char and
+ * returned.
+ *
+ * do_narrow() is a hook for a derived facet to change the
+ * behavior of narrowing. do_narrow() must always return the
+ * same result for the same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param c The wchar_t to convert.
+ * @param dfault Char to return if conversion fails.
+ * @return The converted char.
+ */
+ virtual char
+ do_narrow(char_type, char __dfault) const;
+
+ /**
+ * @brief Narrow wchar_t array to char array
+ *
+ * This virtual function converts each wchar_t in the range [lo,hi) to
+ * char using the simplest reasonable transformation and writes the
+ * results to the destination array. For any wchar_t in the input that
+ * cannot be converted, @a dfault is used instead. For an underived
+ * ctype<wchar_t> facet, the argument will be copied, casting each
+ * element to char.
+ *
+ * do_narrow() is a hook for a derived facet to change the behavior of
+ * narrowing. do_narrow() must always return the same result for the
+ * same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @param dfault Char to use if conversion fails.
+ * @param to Pointer to the destination array.
+ * @return @a hi.
+ */
+ virtual const char_type*
+ do_narrow(const char_type* __lo, const char_type* __hi,
+ char __dfault, char* __dest) const;
+
+ // For use at construction time only.
+ void
+ _M_initialize_ctype();
+ };
+#endif //_GLIBCXX_USE_WCHAR_T
+
+ /// class ctype_byname [22.2.1.2].
+ template<typename _CharT>
+ class ctype_byname : public ctype<_CharT>
+ {
+ public:
+ typedef typename ctype<_CharT>::mask mask;
+
+ explicit
+ ctype_byname(const char* __s, size_t __refs = 0);
+
+ protected:
+ virtual
+ ~ctype_byname() { };
+ };
+
+ /// 22.2.1.4 Class ctype_byname specializations.
+ template<>
+ class ctype_byname<char> : public ctype<char>
+ {
+ public:
+ explicit
+ ctype_byname(const char* __s, size_t __refs = 0);
+
+ protected:
+ virtual
+ ~ctype_byname();
+ };
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template<>
+ class ctype_byname<wchar_t> : public ctype<wchar_t>
+ {
+ public:
+ explicit
+ ctype_byname(const char* __s, size_t __refs = 0);
+
+ protected:
+ virtual
+ ~ctype_byname();
+ };
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+// Include host and configuration specific ctype inlines.
+#include <bits/ctype_inline.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // 22.2.2 The numeric category.
+ class __num_base
+ {
+ public:
+ // NB: Code depends on the order of _S_atoms_out elements.
+ // Below are the indices into _S_atoms_out.
+ enum
+ {
+ _S_ominus,
+ _S_oplus,
+ _S_ox,
+ _S_oX,
+ _S_odigits,
+ _S_odigits_end = _S_odigits + 16,
+ _S_oudigits = _S_odigits_end,
+ _S_oudigits_end = _S_oudigits + 16,
+ _S_oe = _S_odigits + 14, // For scientific notation, 'e'
+ _S_oE = _S_oudigits + 14, // For scientific notation, 'E'
+ _S_oend = _S_oudigits_end
+ };
+
+ // A list of valid numeric literals for output. This array
+ // contains chars that will be passed through the current locale's
+ // ctype<_CharT>.widen() and then used to render numbers.
+ // For the standard "C" locale, this is
+ // "-+xX0123456789abcdef0123456789ABCDEF".
+ static const char* _S_atoms_out;
+
+ // String literal of acceptable (narrow) input, for num_get.
+ // "-+xX0123456789abcdefABCDEF"
+ static const char* _S_atoms_in;
+
+ enum
+ {
+ _S_iminus,
+ _S_iplus,
+ _S_ix,
+ _S_iX,
+ _S_izero,
+ _S_ie = _S_izero + 14,
+ _S_iE = _S_izero + 20,
+ _S_iend = 26
+ };
+
+ // num_put
+ // Construct and return valid scanf format for floating point types.
+ static void
+ _S_format_float(const ios_base& __io, char* __fptr, char __mod);
+ };
+
+ template<typename _CharT>
+ struct __numpunct_cache : public locale::facet
+ {
+ const char* _M_grouping;
+ size_t _M_grouping_size;
+ bool _M_use_grouping;
+ const _CharT* _M_truename;
+ size_t _M_truename_size;
+ const _CharT* _M_falsename;
+ size_t _M_falsename_size;
+ _CharT _M_decimal_point;
+ _CharT _M_thousands_sep;
+
+ // A list of valid numeric literals for output: in the standard
+ // "C" locale, this is "-+xX0123456789abcdef0123456789ABCDEF".
+ // This array contains the chars after having been passed
+ // through the current locale's ctype<_CharT>.widen().
+ _CharT _M_atoms_out[__num_base::_S_oend];
+
+ // A list of valid numeric literals for input: in the standard
+ // "C" locale, this is "-+xX0123456789abcdefABCDEF"
+ // This array contains the chars after having been passed
+ // through the current locale's ctype<_CharT>.widen().
+ _CharT _M_atoms_in[__num_base::_S_iend];
+
+ bool _M_allocated;
+
+ __numpunct_cache(size_t __refs = 0) : facet(__refs),
+ _M_grouping(NULL), _M_grouping_size(0), _M_use_grouping(false),
+ _M_truename(NULL), _M_truename_size(0), _M_falsename(NULL),
+ _M_falsename_size(0), _M_decimal_point(_CharT()),
+ _M_thousands_sep(_CharT()), _M_allocated(false)
+ { }
+
+ ~__numpunct_cache();
+
+ void
+ _M_cache(const locale& __loc);
+
+ private:
+ __numpunct_cache&
+ operator=(const __numpunct_cache&);
+
+ explicit
+ __numpunct_cache(const __numpunct_cache&);
+ };
+
+ template<typename _CharT>
+ __numpunct_cache<_CharT>::~__numpunct_cache()
+ {
+ if (_M_allocated)
+ {
+ delete [] _M_grouping;
+ delete [] _M_truename;
+ delete [] _M_falsename;
+ }
+ }
+
+ /**
+ * @brief Numpunct facet.
+ *
+ * This facet stores several pieces of information related to printing and
+ * scanning numbers, such as the decimal point character. It takes a
+ * template parameter specifying the char type. The numpunct facet is
+ * used by streams for many I/O operations involving numbers.
+ *
+ * The numpunct template uses protected virtual functions to provide the
+ * actual results. The public accessors forward the call to the virtual
+ * functions. These virtual functions are hooks for developers to
+ * implement the behavior they require from a numpunct facet.
+ */
+ template<typename _CharT>
+ class numpunct : public locale::facet
+ {
+ public:
+ // Types:
+ //@{
+ /// Public typedefs
+ typedef _CharT char_type;
+ typedef basic_string<_CharT> string_type;
+ //@}
+ typedef __numpunct_cache<_CharT> __cache_type;
+
+ protected:
+ __cache_type* _M_data;
+
+ public:
+ /// Numpunct facet id.
+ static locale::id id;
+
+ /**
+ * @brief Numpunct constructor.
+ *
+ * @param refs Refcount to pass to the base class.
+ */
+ explicit
+ numpunct(size_t __refs = 0) : facet(__refs), _M_data(NULL)
+ { _M_initialize_numpunct(); }
+
+ /**
+ * @brief Internal constructor. Not for general use.
+ *
+ * This is a constructor for use by the library itself to set up the
+ * predefined locale facets.
+ *
+ * @param cache __numpunct_cache object.
+ * @param refs Refcount to pass to the base class.
+ */
+ explicit
+ numpunct(__cache_type* __cache, size_t __refs = 0)
+ : facet(__refs), _M_data(__cache)
+ { _M_initialize_numpunct(); }
+
+ /**
+ * @brief Internal constructor. Not for general use.
+ *
+ * This is a constructor for use by the library itself to set up new
+ * locales.
+ *
+ * @param cloc The "C" locale.
+ * @param refs Refcount to pass to the base class.
+ */
+ explicit
+ numpunct(__c_locale __cloc, size_t __refs = 0)
+ : facet(__refs), _M_data(NULL)
+ { _M_initialize_numpunct(__cloc); }
+
+ /**
+ * @brief Return decimal point character.
+ *
+ * This function returns a char_type to use as a decimal point. It
+ * does so by returning returning
+ * numpunct<char_type>::do_decimal_point().
+ *
+ * @return @a char_type representing a decimal point.
+ */
+ char_type
+ decimal_point() const
+ { return this->do_decimal_point(); }
+
+ /**
+ * @brief Return thousands separator character.
+ *
+ * This function returns a char_type to use as a thousands
+ * separator. It does so by returning returning
+ * numpunct<char_type>::do_thousands_sep().
+ *
+ * @return char_type representing a thousands separator.
+ */
+ char_type
+ thousands_sep() const
+ { return this->do_thousands_sep(); }
+
+ /**
+ * @brief Return grouping specification.
+ *
+ * This function returns a string representing groupings for the
+ * integer part of a number. Groupings indicate where thousands
+ * separators should be inserted in the integer part of a number.
+ *
+ * Each char in the return string is interpret as an integer
+ * rather than a character. These numbers represent the number
+ * of digits in a group. The first char in the string
+ * represents the number of digits in the least significant
+ * group. If a char is negative, it indicates an unlimited
+ * number of digits for the group. If more chars from the
+ * string are required to group a number, the last char is used
+ * repeatedly.
+ *
+ * For example, if the grouping() returns "\003\002" and is
+ * applied to the number 123456789, this corresponds to
+ * 12,34,56,789. Note that if the string was "32", this would
+ * put more than 50 digits into the least significant group if
+ * the character set is ASCII.
+ *
+ * The string is returned by calling
+ * numpunct<char_type>::do_grouping().
+ *
+ * @return string representing grouping specification.
+ */
+ string
+ grouping() const
+ { return this->do_grouping(); }
+
+ /**
+ * @brief Return string representation of bool true.
+ *
+ * This function returns a string_type containing the text
+ * representation for true bool variables. It does so by calling
+ * numpunct<char_type>::do_truename().
+ *
+ * @return string_type representing printed form of true.
+ */
+ string_type
+ truename() const
+ { return this->do_truename(); }
+
+ /**
+ * @brief Return string representation of bool false.
+ *
+ * This function returns a string_type containing the text
+ * representation for false bool variables. It does so by calling
+ * numpunct<char_type>::do_falsename().
+ *
+ * @return string_type representing printed form of false.
+ */
+ string_type
+ falsename() const
+ { return this->do_falsename(); }
+
+ protected:
+ /// Destructor.
+ virtual
+ ~numpunct();
+
+ /**
+ * @brief Return decimal point character.
+ *
+ * Returns a char_type to use as a decimal point. This function is a
+ * hook for derived classes to change the value returned.
+ *
+ * @return @a char_type representing a decimal point.
+ */
+ virtual char_type
+ do_decimal_point() const
+ { return _M_data->_M_decimal_point; }
+
+ /**
+ * @brief Return thousands separator character.
+ *
+ * Returns a char_type to use as a thousands separator. This function
+ * is a hook for derived classes to change the value returned.
+ *
+ * @return @a char_type representing a thousands separator.
+ */
+ virtual char_type
+ do_thousands_sep() const
+ { return _M_data->_M_thousands_sep; }
+
+ /**
+ * @brief Return grouping specification.
+ *
+ * Returns a string representing groupings for the integer part of a
+ * number. This function is a hook for derived classes to change the
+ * value returned. @see grouping() for details.
+ *
+ * @return String representing grouping specification.
+ */
+ virtual string
+ do_grouping() const
+ { return _M_data->_M_grouping; }
+
+ /**
+ * @brief Return string representation of bool true.
+ *
+ * Returns a string_type containing the text representation for true
+ * bool variables. This function is a hook for derived classes to
+ * change the value returned.
+ *
+ * @return string_type representing printed form of true.
+ */
+ virtual string_type
+ do_truename() const
+ { return _M_data->_M_truename; }
+
+ /**
+ * @brief Return string representation of bool false.
+ *
+ * Returns a string_type containing the text representation for false
+ * bool variables. This function is a hook for derived classes to
+ * change the value returned.
+ *
+ * @return string_type representing printed form of false.
+ */
+ virtual string_type
+ do_falsename() const
+ { return _M_data->_M_falsename; }
+
+ // For use at construction time only.
+ void
+ _M_initialize_numpunct(__c_locale __cloc = NULL);
+ };
+
+ template<typename _CharT>
+ locale::id numpunct<_CharT>::id;
+
+ template<>
+ numpunct<char>::~numpunct();
+
+ template<>
+ void
+ numpunct<char>::_M_initialize_numpunct(__c_locale __cloc);
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template<>
+ numpunct<wchar_t>::~numpunct();
+
+ template<>
+ void
+ numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc);
+#endif
+
+ /// class numpunct_byname [22.2.3.2].
+ template<typename _CharT>
+ class numpunct_byname : public numpunct<_CharT>
+ {
+ public:
+ typedef _CharT char_type;
+ typedef basic_string<_CharT> string_type;
+
+ explicit
+ numpunct_byname(const char* __s, size_t __refs = 0)
+ : numpunct<_CharT>(__refs)
+ {
+ if (__builtin_strcmp(__s, "C") != 0
+ && __builtin_strcmp(__s, "POSIX") != 0)
+ {
+ __c_locale __tmp;
+ this->_S_create_c_locale(__tmp, __s);
+ this->_M_initialize_numpunct(__tmp);
+ this->_S_destroy_c_locale(__tmp);
+ }
+ }
+
+ protected:
+ virtual
+ ~numpunct_byname() { }
+ };
+
+_GLIBCXX_BEGIN_LDBL_NAMESPACE
+
+ /**
+ * @brief Facet for parsing number strings.
+ *
+ * This facet encapsulates the code to parse and return a number
+ * from a string. It is used by the istream numeric extraction
+ * operators.
+ *
+ * The num_get template uses protected virtual functions to provide the
+ * actual results. The public accessors forward the call to the virtual
+ * functions. These virtual functions are hooks for developers to
+ * implement the behavior they require from the num_get facet.
+ */
+ template<typename _CharT, typename _InIter>
+ class num_get : public locale::facet
+ {
+ public:
+ // Types:
+ //@{
+ /// Public typedefs
+ typedef _CharT char_type;
+ typedef _InIter iter_type;
+ //@}
+
+ /// Numpunct facet id.
+ static locale::id id;
+
+ /**
+ * @brief Constructor performs initialization.
+ *
+ * This is the constructor provided by the standard.
+ *
+ * @param refs Passed to the base facet class.
+ */
+ explicit
+ num_get(size_t __refs = 0) : facet(__refs) { }
+
+ /**
+ * @brief Numeric parsing.
+ *
+ * Parses the input stream into the bool @a v. It does so by calling
+ * num_get::do_get().
+ *
+ * If ios_base::boolalpha is set, attempts to read
+ * ctype<CharT>::truename() or ctype<CharT>::falsename(). Sets
+ * @a v to true or false if successful. Sets err to
+ * ios_base::failbit if reading the string fails. Sets err to
+ * ios_base::eofbit if the stream is emptied.
+ *
+ * If ios_base::boolalpha is not set, proceeds as with reading a long,
+ * except if the value is 1, sets @a v to true, if the value is 0, sets
+ * @a v to false, and otherwise set err to ios_base::failbit.
+ *
+ * @param in Start of input stream.
+ * @param end End of input stream.
+ * @param io Source of locale and flags.
+ * @param err Error flags to set.
+ * @param v Value to format and insert.
+ * @return Iterator after reading.
+ */
+ iter_type
+ get(iter_type __in, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, bool& __v) const
+ { return this->do_get(__in, __end, __io, __err, __v); }
+
+ //@{
+ /**
+ * @brief Numeric parsing.
+ *
+ * Parses the input stream into the integral variable @a v. It does so
+ * by calling num_get::do_get().
+ *
+ * Parsing is affected by the flag settings in @a io.
+ *
+ * The basic parse is affected by the value of io.flags() &
+ * ios_base::basefield. If equal to ios_base::oct, parses like the
+ * scanf %o specifier. Else if equal to ios_base::hex, parses like %X
+ * specifier. Else if basefield equal to 0, parses like the %i
+ * specifier. Otherwise, parses like %d for signed and %u for unsigned
+ * types. The matching type length modifier is also used.
+ *
+ * Digit grouping is interpreted according to numpunct::grouping() and
+ * numpunct::thousands_sep(). If the pattern of digit groups isn't
+ * consistent, sets err to ios_base::failbit.
+ *
+ * If parsing the string yields a valid value for @a v, @a v is set.
+ * Otherwise, sets err to ios_base::failbit and leaves @a v unaltered.
+ * Sets err to ios_base::eofbit if the stream is emptied.
+ *
+ * @param in Start of input stream.
+ * @param end End of input stream.
+ * @param io Source of locale and flags.
+ * @param err Error flags to set.
+ * @param v Value to format and insert.
+ * @return Iterator after reading.
+ */
+ iter_type
+ get(iter_type __in, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, long& __v) const
+ { return this->do_get(__in, __end, __io, __err, __v); }
+
+ iter_type
+ get(iter_type __in, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, unsigned short& __v) const
+ { return this->do_get(__in, __end, __io, __err, __v); }
+
+ iter_type
+ get(iter_type __in, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, unsigned int& __v) const
+ { return this->do_get(__in, __end, __io, __err, __v); }
+
+ iter_type
+ get(iter_type __in, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, unsigned long& __v) const
+ { return this->do_get(__in, __end, __io, __err, __v); }
+
+#ifdef _GLIBCXX_USE_LONG_LONG
+ iter_type
+ get(iter_type __in, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, long long& __v) const
+ { return this->do_get(__in, __end, __io, __err, __v); }
+
+ iter_type
+ get(iter_type __in, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, unsigned long long& __v) const
+ { return this->do_get(__in, __end, __io, __err, __v); }
+#endif
+ //@}
+
+ //@{
+ /**
+ * @brief Numeric parsing.
+ *
+ * Parses the input stream into the integral variable @a v. It does so
+ * by calling num_get::do_get().
+ *
+ * The input characters are parsed like the scanf %g specifier. The
+ * matching type length modifier is also used.
+ *
+ * The decimal point character used is numpunct::decimal_point().
+ * Digit grouping is interpreted according to numpunct::grouping() and
+ * numpunct::thousands_sep(). If the pattern of digit groups isn't
+ * consistent, sets err to ios_base::failbit.
+ *
+ * If parsing the string yields a valid value for @a v, @a v is set.
+ * Otherwise, sets err to ios_base::failbit and leaves @a v unaltered.
+ * Sets err to ios_base::eofbit if the stream is emptied.
+ *
+ * @param in Start of input stream.
+ * @param end End of input stream.
+ * @param io Source of locale and flags.
+ * @param err Error flags to set.
+ * @param v Value to format and insert.
+ * @return Iterator after reading.
+ */
+ iter_type
+ get(iter_type __in, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, float& __v) const
+ { return this->do_get(__in, __end, __io, __err, __v); }
+
+ iter_type
+ get(iter_type __in, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, double& __v) const
+ { return this->do_get(__in, __end, __io, __err, __v); }
+
+ iter_type
+ get(iter_type __in, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, long double& __v) const
+ { return this->do_get(__in, __end, __io, __err, __v); }
+ //@}
+
+ /**
+ * @brief Numeric parsing.
+ *
+ * Parses the input stream into the pointer variable @a v. It does so
+ * by calling num_get::do_get().
+ *
+ * The input characters are parsed like the scanf %p specifier.
+ *
+ * Digit grouping is interpreted according to numpunct::grouping() and
+ * numpunct::thousands_sep(). If the pattern of digit groups isn't
+ * consistent, sets err to ios_base::failbit.
+ *
+ * Note that the digit grouping effect for pointers is a bit ambiguous
+ * in the standard and shouldn't be relied on. See DR 344.
+ *
+ * If parsing the string yields a valid value for @a v, @a v is set.
+ * Otherwise, sets err to ios_base::failbit and leaves @a v unaltered.
+ * Sets err to ios_base::eofbit if the stream is emptied.
+ *
+ * @param in Start of input stream.
+ * @param end End of input stream.
+ * @param io Source of locale and flags.
+ * @param err Error flags to set.
+ * @param v Value to format and insert.
+ * @return Iterator after reading.
+ */
+ iter_type
+ get(iter_type __in, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, void*& __v) const
+ { return this->do_get(__in, __end, __io, __err, __v); }
+
+ protected:
+ /// Destructor.
+ virtual ~num_get() { }
+
+ iter_type
+ _M_extract_float(iter_type, iter_type, ios_base&, ios_base::iostate&,
+ string&) const;
+
+ template<typename _ValueT>
+ iter_type
+ _M_extract_int(iter_type, iter_type, ios_base&, ios_base::iostate&,
+ _ValueT&) const;
+
+ template<typename _CharT2>
+ typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value, int>::__type
+ _M_find(const _CharT2*, size_t __len, _CharT2 __c) const
+ {
+ int __ret = -1;
+ if (__len <= 10)
+ {
+ if (__c >= _CharT2('0') && __c < _CharT2(_CharT2('0') + __len))
+ __ret = __c - _CharT2('0');
+ }
+ else
+ {
+ if (__c >= _CharT2('0') && __c <= _CharT2('9'))
+ __ret = __c - _CharT2('0');
+ else if (__c >= _CharT2('a') && __c <= _CharT2('f'))
+ __ret = 10 + (__c - _CharT2('a'));
+ else if (__c >= _CharT2('A') && __c <= _CharT2('F'))
+ __ret = 10 + (__c - _CharT2('A'));
+ }
+ return __ret;
+ }
+
+ template<typename _CharT2>
+ typename __gnu_cxx::__enable_if<!__is_char<_CharT2>::__value,
+ int>::__type
+ _M_find(const _CharT2* __zero, size_t __len, _CharT2 __c) const
+ {
+ int __ret = -1;
+ const char_type* __q = char_traits<_CharT2>::find(__zero, __len, __c);
+ if (__q)
+ {
+ __ret = __q - __zero;
+ if (__ret > 15)
+ __ret -= 6;
+ }
+ return __ret;
+ }
+
+ //@{
+ /**
+ * @brief Numeric parsing.
+ *
+ * Parses the input stream into the variable @a v. This function is a
+ * hook for derived classes to change the value returned. @see get()
+ * for more details.
+ *
+ * @param in Start of input stream.
+ * @param end End of input stream.
+ * @param io Source of locale and flags.
+ * @param err Error flags to set.
+ * @param v Value to format and insert.
+ * @return Iterator after reading.
+ */
+ virtual iter_type
+ do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, bool&) const;
+
+ virtual iter_type
+ do_get(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, long& __v) const
+ { return _M_extract_int(__beg, __end, __io, __err, __v); }
+
+ virtual iter_type
+ do_get(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, unsigned short& __v) const
+ { return _M_extract_int(__beg, __end, __io, __err, __v); }
+
+ virtual iter_type
+ do_get(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, unsigned int& __v) const
+ { return _M_extract_int(__beg, __end, __io, __err, __v); }
+
+ virtual iter_type
+ do_get(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, unsigned long& __v) const
+ { return _M_extract_int(__beg, __end, __io, __err, __v); }
+
+#ifdef _GLIBCXX_USE_LONG_LONG
+ virtual iter_type
+ do_get(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, long long& __v) const
+ { return _M_extract_int(__beg, __end, __io, __err, __v); }
+
+ virtual iter_type
+ do_get(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, unsigned long long& __v) const
+ { return _M_extract_int(__beg, __end, __io, __err, __v); }
+#endif
+
+ virtual iter_type
+ do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
+ float&) const;
+
+ virtual iter_type
+ do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
+ double&) const;
+
+ // XXX GLIBCXX_ABI Deprecated
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
+ virtual iter_type
+ __do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
+ double&) const;
+#else
+ virtual iter_type
+ do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
+ long double&) const;
+#endif
+
+ virtual iter_type
+ do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
+ void*&) const;
+
+ // XXX GLIBCXX_ABI Deprecated
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
+ virtual iter_type
+ do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
+ long double&) const;
+#endif
+ //@}
+ };
+
+ template<typename _CharT, typename _InIter>
+ locale::id num_get<_CharT, _InIter>::id;
+
+
+ /**
+ * @brief Facet for converting numbers to strings.
+ *
+ * This facet encapsulates the code to convert a number to a string. It is
+ * used by the ostream numeric insertion operators.
+ *
+ * The num_put template uses protected virtual functions to provide the
+ * actual results. The public accessors forward the call to the virtual
+ * functions. These virtual functions are hooks for developers to
+ * implement the behavior they require from the num_put facet.
+ */
+ template<typename _CharT, typename _OutIter>
+ class num_put : public locale::facet
+ {
+ public:
+ // Types:
+ //@{
+ /// Public typedefs
+ typedef _CharT char_type;
+ typedef _OutIter iter_type;
+ //@}
+
+ /// Numpunct facet id.
+ static locale::id id;
+
+ /**
+ * @brief Constructor performs initialization.
+ *
+ * This is the constructor provided by the standard.
+ *
+ * @param refs Passed to the base facet class.
+ */
+ explicit
+ num_put(size_t __refs = 0) : facet(__refs) { }
+
+ /**
+ * @brief Numeric formatting.
+ *
+ * Formats the boolean @a v and inserts it into a stream. It does so
+ * by calling num_put::do_put().
+ *
+ * If ios_base::boolalpha is set, writes ctype<CharT>::truename() or
+ * ctype<CharT>::falsename(). Otherwise formats @a v as an int.
+ *
+ * @param s Stream to write to.
+ * @param io Source of locale and flags.
+ * @param fill Char_type to use for filling.
+ * @param v Value to format and insert.
+ * @return Iterator after writing.
+ */
+ iter_type
+ put(iter_type __s, ios_base& __f, char_type __fill, bool __v) const
+ { return this->do_put(__s, __f, __fill, __v); }
+
+ //@{
+ /**
+ * @brief Numeric formatting.
+ *
+ * Formats the integral value @a v and inserts it into a
+ * stream. It does so by calling num_put::do_put().
+ *
+ * Formatting is affected by the flag settings in @a io.
+ *
+ * The basic format is affected by the value of io.flags() &
+ * ios_base::basefield. If equal to ios_base::oct, formats like the
+ * printf %o specifier. Else if equal to ios_base::hex, formats like
+ * %x or %X with ios_base::uppercase unset or set respectively.
+ * Otherwise, formats like %d, %ld, %lld for signed and %u, %lu, %llu
+ * for unsigned values. Note that if both oct and hex are set, neither
+ * will take effect.
+ *
+ * If ios_base::showpos is set, '+' is output before positive values.
+ * If ios_base::showbase is set, '0' precedes octal values (except 0)
+ * and '0[xX]' precedes hex values.
+ *
+ * Thousands separators are inserted according to numpunct::grouping()
+ * and numpunct::thousands_sep(). The decimal point character used is
+ * numpunct::decimal_point().
+ *
+ * If io.width() is non-zero, enough @a fill characters are inserted to
+ * make the result at least that wide. If
+ * (io.flags() & ios_base::adjustfield) == ios_base::left, result is
+ * padded at the end. If ios_base::internal, then padding occurs
+ * immediately after either a '+' or '-' or after '0x' or '0X'.
+ * Otherwise, padding occurs at the beginning.
+ *
+ * @param s Stream to write to.
+ * @param io Source of locale and flags.
+ * @param fill Char_type to use for filling.
+ * @param v Value to format and insert.
+ * @return Iterator after writing.
+ */
+ iter_type
+ put(iter_type __s, ios_base& __f, char_type __fill, long __v) const
+ { return this->do_put(__s, __f, __fill, __v); }
+
+ iter_type
+ put(iter_type __s, ios_base& __f, char_type __fill,
+ unsigned long __v) const
+ { return this->do_put(__s, __f, __fill, __v); }
+
+#ifdef _GLIBCXX_USE_LONG_LONG
+ iter_type
+ put(iter_type __s, ios_base& __f, char_type __fill, long long __v) const
+ { return this->do_put(__s, __f, __fill, __v); }
+
+ iter_type
+ put(iter_type __s, ios_base& __f, char_type __fill,
+ unsigned long long __v) const
+ { return this->do_put(__s, __f, __fill, __v); }
+#endif
+ //@}
+
+ //@{
+ /**
+ * @brief Numeric formatting.
+ *
+ * Formats the floating point value @a v and inserts it into a stream.
+ * It does so by calling num_put::do_put().
+ *
+ * Formatting is affected by the flag settings in @a io.
+ *
+ * The basic format is affected by the value of io.flags() &
+ * ios_base::floatfield. If equal to ios_base::fixed, formats like the
+ * printf %f specifier. Else if equal to ios_base::scientific, formats
+ * like %e or %E with ios_base::uppercase unset or set respectively.
+ * Otherwise, formats like %g or %G depending on uppercase. Note that
+ * if both fixed and scientific are set, the effect will also be like
+ * %g or %G.
+ *
+ * The output precision is given by io.precision(). This precision is
+ * capped at numeric_limits::digits10 + 2 (different for double and
+ * long double). The default precision is 6.
+ *
+ * If ios_base::showpos is set, '+' is output before positive values.
+ * If ios_base::showpoint is set, a decimal point will always be
+ * output.
+ *
+ * Thousands separators are inserted according to numpunct::grouping()
+ * and numpunct::thousands_sep(). The decimal point character used is
+ * numpunct::decimal_point().
+ *
+ * If io.width() is non-zero, enough @a fill characters are inserted to
+ * make the result at least that wide. If
+ * (io.flags() & ios_base::adjustfield) == ios_base::left, result is
+ * padded at the end. If ios_base::internal, then padding occurs
+ * immediately after either a '+' or '-' or after '0x' or '0X'.
+ * Otherwise, padding occurs at the beginning.
+ *
+ * @param s Stream to write to.
+ * @param io Source of locale and flags.
+ * @param fill Char_type to use for filling.
+ * @param v Value to format and insert.
+ * @return Iterator after writing.
+ */
+ iter_type
+ put(iter_type __s, ios_base& __f, char_type __fill, double __v) const
+ { return this->do_put(__s, __f, __fill, __v); }
+
+ iter_type
+ put(iter_type __s, ios_base& __f, char_type __fill,
+ long double __v) const
+ { return this->do_put(__s, __f, __fill, __v); }
+ //@}
+
+ /**
+ * @brief Numeric formatting.
+ *
+ * Formats the pointer value @a v and inserts it into a stream. It
+ * does so by calling num_put::do_put().
+ *
+ * This function formats @a v as an unsigned long with ios_base::hex
+ * and ios_base::showbase set.
+ *
+ * @param s Stream to write to.
+ * @param io Source of locale and flags.
+ * @param fill Char_type to use for filling.
+ * @param v Value to format and insert.
+ * @return Iterator after writing.
+ */
+ iter_type
+ put(iter_type __s, ios_base& __f, char_type __fill,
+ const void* __v) const
+ { return this->do_put(__s, __f, __fill, __v); }
+
+ protected:
+ template<typename _ValueT>
+ iter_type
+ _M_insert_float(iter_type, ios_base& __io, char_type __fill,
+ char __mod, _ValueT __v) const;
+
+ void
+ _M_group_float(const char* __grouping, size_t __grouping_size,
+ char_type __sep, const char_type* __p, char_type* __new,
+ char_type* __cs, int& __len) const;
+
+ template<typename _ValueT>
+ iter_type
+ _M_insert_int(iter_type, ios_base& __io, char_type __fill,
+ _ValueT __v) const;
+
+ void
+ _M_group_int(const char* __grouping, size_t __grouping_size,
+ char_type __sep, ios_base& __io, char_type* __new,
+ char_type* __cs, int& __len) const;
+
+ void
+ _M_pad(char_type __fill, streamsize __w, ios_base& __io,
+ char_type* __new, const char_type* __cs, int& __len) const;
+
+ /// Destructor.
+ virtual
+ ~num_put() { };
+
+ //@{
+ /**
+ * @brief Numeric formatting.
+ *
+ * These functions do the work of formatting numeric values and
+ * inserting them into a stream. This function is a hook for derived
+ * classes to change the value returned.
+ *
+ * @param s Stream to write to.
+ * @param io Source of locale and flags.
+ * @param fill Char_type to use for filling.
+ * @param v Value to format and insert.
+ * @return Iterator after writing.
+ */
+ virtual iter_type
+ do_put(iter_type, ios_base&, char_type __fill, bool __v) const;
+
+ virtual iter_type
+ do_put(iter_type __s, ios_base& __io, char_type __fill, long __v) const
+ { return _M_insert_int(__s, __io, __fill, __v); }
+
+ virtual iter_type
+ do_put(iter_type __s, ios_base& __io, char_type __fill,
+ unsigned long __v) const
+ { return _M_insert_int(__s, __io, __fill, __v); }
+
+#ifdef _GLIBCXX_USE_LONG_LONG
+ virtual iter_type
+ do_put(iter_type __s, ios_base& __io, char_type __fill,
+ long long __v) const
+ { return _M_insert_int(__s, __io, __fill, __v); }
+
+ virtual iter_type
+ do_put(iter_type __s, ios_base& __io, char_type __fill,
+ unsigned long long __v) const
+ { return _M_insert_int(__s, __io, __fill, __v); }
+#endif
+
+ virtual iter_type
+ do_put(iter_type, ios_base&, char_type __fill, double __v) const;
+
+ // XXX GLIBCXX_ABI Deprecated
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
+ virtual iter_type
+ __do_put(iter_type, ios_base&, char_type __fill, double __v) const;
+#else
+ virtual iter_type
+ do_put(iter_type, ios_base&, char_type __fill, long double __v) const;
+#endif
+
+ virtual iter_type
+ do_put(iter_type, ios_base&, char_type __fill, const void* __v) const;
+
+ // XXX GLIBCXX_ABI Deprecated
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
+ virtual iter_type
+ do_put(iter_type, ios_base&, char_type __fill, long double __v) const;
+#endif
+ //@}
+ };
+
+ template <typename _CharT, typename _OutIter>
+ locale::id num_put<_CharT, _OutIter>::id;
+
+_GLIBCXX_END_LDBL_NAMESPACE
+
+ // Subclause convenience interfaces, inlines.
+ // NB: These are inline because, when used in a loop, some compilers
+ // can hoist the body out of the loop; then it's just as fast as the
+ // C is*() function.
+
+ /// Convenience interface to ctype.is(ctype_base::space, __c).
+ template<typename _CharT>
+ inline bool
+ isspace(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::space, __c); }
+
+ /// Convenience interface to ctype.is(ctype_base::print, __c).
+ template<typename _CharT>
+ inline bool
+ isprint(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::print, __c); }
+
+ /// Convenience interface to ctype.is(ctype_base::cntrl, __c).
+ template<typename _CharT>
+ inline bool
+ iscntrl(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::cntrl, __c); }
+
+ /// Convenience interface to ctype.is(ctype_base::upper, __c).
+ template<typename _CharT>
+ inline bool
+ isupper(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::upper, __c); }
+
+ /// Convenience interface to ctype.is(ctype_base::lower, __c).
+ template<typename _CharT>
+ inline bool
+ islower(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::lower, __c); }
+
+ /// Convenience interface to ctype.is(ctype_base::alpha, __c).
+ template<typename _CharT>
+ inline bool
+ isalpha(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::alpha, __c); }
+
+ /// Convenience interface to ctype.is(ctype_base::digit, __c).
+ template<typename _CharT>
+ inline bool
+ isdigit(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::digit, __c); }
+
+ /// Convenience interface to ctype.is(ctype_base::punct, __c).
+ template<typename _CharT>
+ inline bool
+ ispunct(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::punct, __c); }
+
+ /// Convenience interface to ctype.is(ctype_base::xdigit, __c).
+ template<typename _CharT>
+ inline bool
+ isxdigit(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::xdigit, __c); }
+
+ /// Convenience interface to ctype.is(ctype_base::alnum, __c).
+ template<typename _CharT>
+ inline bool
+ isalnum(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::alnum, __c); }
+
+ /// Convenience interface to ctype.is(ctype_base::graph, __c).
+ template<typename _CharT>
+ inline bool
+ isgraph(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::graph, __c); }
+
+ /// Convenience interface to ctype.toupper(__c).
+ template<typename _CharT>
+ inline _CharT
+ toupper(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).toupper(__c); }
+
+ /// Convenience interface to ctype.tolower(__c).
+ template<typename _CharT>
+ inline _CharT
+ tolower(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).tolower(__c); }
+
+_GLIBCXX_END_NAMESPACE
+
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <bits/locale_facets.tcc>
+#endif
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/bits/locale_facets.tcc b/i686-linux/include/c++/4.4.3/bits/locale_facets.tcc
new file mode 100644
index 0000000..ba8f398
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/locale_facets.tcc
@@ -0,0 +1,1345 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file locale_facets.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _LOCALE_FACETS_TCC
+#define _LOCALE_FACETS_TCC 1
+
+#pragma GCC system_header
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // Routine to access a cache for the facet. If the cache didn't
+ // exist before, it gets constructed on the fly.
+ template<typename _Facet>
+ struct __use_cache
+ {
+ const _Facet*
+ operator() (const locale& __loc) const;
+ };
+
+ // Specializations.
+ template<typename _CharT>
+ struct __use_cache<__numpunct_cache<_CharT> >
+ {
+ const __numpunct_cache<_CharT>*
+ operator() (const locale& __loc) const
+ {
+ const size_t __i = numpunct<_CharT>::id._M_id();
+ const locale::facet** __caches = __loc._M_impl->_M_caches;
+ if (!__caches[__i])
+ {
+ __numpunct_cache<_CharT>* __tmp = NULL;
+ __try
+ {
+ __tmp = new __numpunct_cache<_CharT>;
+ __tmp->_M_cache(__loc);
+ }
+ __catch(...)
+ {
+ delete __tmp;
+ __throw_exception_again;
+ }
+ __loc._M_impl->_M_install_cache(__tmp, __i);
+ }
+ return static_cast<const __numpunct_cache<_CharT>*>(__caches[__i]);
+ }
+ };
+
+ template<typename _CharT>
+ void
+ __numpunct_cache<_CharT>::_M_cache(const locale& __loc)
+ {
+ _M_allocated = true;
+
+ const numpunct<_CharT>& __np = use_facet<numpunct<_CharT> >(__loc);
+
+ _M_grouping_size = __np.grouping().size();
+ char* __grouping = new char[_M_grouping_size];
+ __np.grouping().copy(__grouping, _M_grouping_size);
+ _M_grouping = __grouping;
+ _M_use_grouping = (_M_grouping_size
+ && static_cast<signed char>(_M_grouping[0]) > 0
+ && (_M_grouping[0]
+ != __gnu_cxx::__numeric_traits<char>::__max));
+
+ _M_truename_size = __np.truename().size();
+ _CharT* __truename = new _CharT[_M_truename_size];
+ __np.truename().copy(__truename, _M_truename_size);
+ _M_truename = __truename;
+
+ _M_falsename_size = __np.falsename().size();
+ _CharT* __falsename = new _CharT[_M_falsename_size];
+ __np.falsename().copy(__falsename, _M_falsename_size);
+ _M_falsename = __falsename;
+
+ _M_decimal_point = __np.decimal_point();
+ _M_thousands_sep = __np.thousands_sep();
+
+ const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__loc);
+ __ct.widen(__num_base::_S_atoms_out,
+ __num_base::_S_atoms_out + __num_base::_S_oend, _M_atoms_out);
+ __ct.widen(__num_base::_S_atoms_in,
+ __num_base::_S_atoms_in + __num_base::_S_iend, _M_atoms_in);
+ }
+
+ // Used by both numeric and monetary facets.
+ // Check to make sure that the __grouping_tmp string constructed in
+ // money_get or num_get matches the canonical grouping for a given
+ // locale.
+ // __grouping_tmp is parsed L to R
+ // 1,222,444 == __grouping_tmp of "\1\3\3"
+ // __grouping is parsed R to L
+ // 1,222,444 == __grouping of "\3" == "\3\3\3"
+ bool
+ __verify_grouping(const char* __grouping, size_t __grouping_size,
+ const string& __grouping_tmp);
+
+_GLIBCXX_BEGIN_LDBL_NAMESPACE
+
+ template<typename _CharT, typename _InIter>
+ _InIter
+ num_get<_CharT, _InIter>::
+ _M_extract_float(_InIter __beg, _InIter __end, ios_base& __io,
+ ios_base::iostate& __err, string& __xtrc) const
+ {
+ typedef char_traits<_CharT> __traits_type;
+ typedef __numpunct_cache<_CharT> __cache_type;
+ __use_cache<__cache_type> __uc;
+ const locale& __loc = __io._M_getloc();
+ const __cache_type* __lc = __uc(__loc);
+ const _CharT* __lit = __lc->_M_atoms_in;
+ char_type __c = char_type();
+
+ // True if __beg becomes equal to __end.
+ bool __testeof = __beg == __end;
+
+ // First check for sign.
+ if (!__testeof)
+ {
+ __c = *__beg;
+ const bool __plus = __c == __lit[__num_base::_S_iplus];
+ if ((__plus || __c == __lit[__num_base::_S_iminus])
+ && !(__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
+ && !(__c == __lc->_M_decimal_point))
+ {
+ __xtrc += __plus ? '+' : '-';
+ if (++__beg != __end)
+ __c = *__beg;
+ else
+ __testeof = true;
+ }
+ }
+
+ // Next, look for leading zeros.
+ bool __found_mantissa = false;
+ int __sep_pos = 0;
+ while (!__testeof)
+ {
+ if ((__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
+ || __c == __lc->_M_decimal_point)
+ break;
+ else if (__c == __lit[__num_base::_S_izero])
+ {
+ if (!__found_mantissa)
+ {
+ __xtrc += '0';
+ __found_mantissa = true;
+ }
+ ++__sep_pos;
+
+ if (++__beg != __end)
+ __c = *__beg;
+ else
+ __testeof = true;
+ }
+ else
+ break;
+ }
+
+ // Only need acceptable digits for floating point numbers.
+ bool __found_dec = false;
+ bool __found_sci = false;
+ string __found_grouping;
+ if (__lc->_M_use_grouping)
+ __found_grouping.reserve(32);
+ const char_type* __lit_zero = __lit + __num_base::_S_izero;
+
+ if (!__lc->_M_allocated)
+ // "C" locale
+ while (!__testeof)
+ {
+ const int __digit = _M_find(__lit_zero, 10, __c);
+ if (__digit != -1)
+ {
+ __xtrc += '0' + __digit;
+ __found_mantissa = true;
+ }
+ else if (__c == __lc->_M_decimal_point
+ && !__found_dec && !__found_sci)
+ {
+ __xtrc += '.';
+ __found_dec = true;
+ }
+ else if ((__c == __lit[__num_base::_S_ie]
+ || __c == __lit[__num_base::_S_iE])
+ && !__found_sci && __found_mantissa)
+ {
+ // Scientific notation.
+ __xtrc += 'e';
+ __found_sci = true;
+
+ // Remove optional plus or minus sign, if they exist.
+ if (++__beg != __end)
+ {
+ __c = *__beg;
+ const bool __plus = __c == __lit[__num_base::_S_iplus];
+ if (__plus || __c == __lit[__num_base::_S_iminus])
+ __xtrc += __plus ? '+' : '-';
+ else
+ continue;
+ }
+ else
+ {
+ __testeof = true;
+ break;
+ }
+ }
+ else
+ break;
+
+ if (++__beg != __end)
+ __c = *__beg;
+ else
+ __testeof = true;
+ }
+ else
+ while (!__testeof)
+ {
+ // According to 22.2.2.1.2, p8-9, first look for thousands_sep
+ // and decimal_point.
+ if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
+ {
+ if (!__found_dec && !__found_sci)
+ {
+ // NB: Thousands separator at the beginning of a string
+ // is a no-no, as is two consecutive thousands separators.
+ if (__sep_pos)
+ {
+ __found_grouping += static_cast<char>(__sep_pos);
+ __sep_pos = 0;
+ }
+ else
+ {
+ // NB: __convert_to_v will not assign __v and will
+ // set the failbit.
+ __xtrc.clear();
+ break;
+ }
+ }
+ else
+ break;
+ }
+ else if (__c == __lc->_M_decimal_point)
+ {
+ if (!__found_dec && !__found_sci)
+ {
+ // If no grouping chars are seen, no grouping check
+ // is applied. Therefore __found_grouping is adjusted
+ // only if decimal_point comes after some thousands_sep.
+ if (__found_grouping.size())
+ __found_grouping += static_cast<char>(__sep_pos);
+ __xtrc += '.';
+ __found_dec = true;
+ }
+ else
+ break;
+ }
+ else
+ {
+ const char_type* __q =
+ __traits_type::find(__lit_zero, 10, __c);
+ if (__q)
+ {
+ __xtrc += '0' + (__q - __lit_zero);
+ __found_mantissa = true;
+ ++__sep_pos;
+ }
+ else if ((__c == __lit[__num_base::_S_ie]
+ || __c == __lit[__num_base::_S_iE])
+ && !__found_sci && __found_mantissa)
+ {
+ // Scientific notation.
+ if (__found_grouping.size() && !__found_dec)
+ __found_grouping += static_cast<char>(__sep_pos);
+ __xtrc += 'e';
+ __found_sci = true;
+
+ // Remove optional plus or minus sign, if they exist.
+ if (++__beg != __end)
+ {
+ __c = *__beg;
+ const bool __plus = __c == __lit[__num_base::_S_iplus];
+ if ((__plus || __c == __lit[__num_base::_S_iminus])
+ && !(__lc->_M_use_grouping
+ && __c == __lc->_M_thousands_sep)
+ && !(__c == __lc->_M_decimal_point))
+ __xtrc += __plus ? '+' : '-';
+ else
+ continue;
+ }
+ else
+ {
+ __testeof = true;
+ break;
+ }
+ }
+ else
+ break;
+ }
+
+ if (++__beg != __end)
+ __c = *__beg;
+ else
+ __testeof = true;
+ }
+
+ // Digit grouping is checked. If grouping and found_grouping don't
+ // match, then get very very upset, and set failbit.
+ if (__found_grouping.size())
+ {
+ // Add the ending grouping if a decimal or 'e'/'E' wasn't found.
+ if (!__found_dec && !__found_sci)
+ __found_grouping += static_cast<char>(__sep_pos);
+
+ if (!std::__verify_grouping(__lc->_M_grouping,
+ __lc->_M_grouping_size,
+ __found_grouping))
+ __err = ios_base::failbit;
+ }
+
+ return __beg;
+ }
+
+ template<typename _CharT, typename _InIter>
+ template<typename _ValueT>
+ _InIter
+ num_get<_CharT, _InIter>::
+ _M_extract_int(_InIter __beg, _InIter __end, ios_base& __io,
+ ios_base::iostate& __err, _ValueT& __v) const
+ {
+ typedef char_traits<_CharT> __traits_type;
+ using __gnu_cxx::__add_unsigned;
+ typedef typename __add_unsigned<_ValueT>::__type __unsigned_type;
+ typedef __numpunct_cache<_CharT> __cache_type;
+ __use_cache<__cache_type> __uc;
+ const locale& __loc = __io._M_getloc();
+ const __cache_type* __lc = __uc(__loc);
+ const _CharT* __lit = __lc->_M_atoms_in;
+ char_type __c = char_type();
+
+ // NB: Iff __basefield == 0, __base can change based on contents.
+ const ios_base::fmtflags __basefield = __io.flags()
+ & ios_base::basefield;
+ const bool __oct = __basefield == ios_base::oct;
+ int __base = __oct ? 8 : (__basefield == ios_base::hex ? 16 : 10);
+
+ // True if __beg becomes equal to __end.
+ bool __testeof = __beg == __end;
+
+ // First check for sign.
+ bool __negative = false;
+ if (!__testeof)
+ {
+ __c = *__beg;
+ __negative = __c == __lit[__num_base::_S_iminus];
+ if ((__negative || __c == __lit[__num_base::_S_iplus])
+ && !(__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
+ && !(__c == __lc->_M_decimal_point))
+ {
+ if (++__beg != __end)
+ __c = *__beg;
+ else
+ __testeof = true;
+ }
+ }
+
+ // Next, look for leading zeros and check required digits
+ // for base formats.
+ bool __found_zero = false;
+ int __sep_pos = 0;
+ while (!__testeof)
+ {
+ if ((__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
+ || __c == __lc->_M_decimal_point)
+ break;
+ else if (__c == __lit[__num_base::_S_izero]
+ && (!__found_zero || __base == 10))
+ {
+ __found_zero = true;
+ ++__sep_pos;
+ if (__basefield == 0)
+ __base = 8;
+ if (__base == 8)
+ __sep_pos = 0;
+ }
+ else if (__found_zero
+ && (__c == __lit[__num_base::_S_ix]
+ || __c == __lit[__num_base::_S_iX]))
+ {
+ if (__basefield == 0)
+ __base = 16;
+ if (__base == 16)
+ {
+ __found_zero = false;
+ __sep_pos = 0;
+ }
+ else
+ break;
+ }
+ else
+ break;
+
+ if (++__beg != __end)
+ {
+ __c = *__beg;
+ if (!__found_zero)
+ break;
+ }
+ else
+ __testeof = true;
+ }
+
+ // At this point, base is determined. If not hex, only allow
+ // base digits as valid input.
+ const size_t __len = (__base == 16 ? __num_base::_S_iend
+ - __num_base::_S_izero : __base);
+
+ // Extract.
+ string __found_grouping;
+ if (__lc->_M_use_grouping)
+ __found_grouping.reserve(32);
+ bool __testfail = false;
+ bool __testoverflow = false;
+ const __unsigned_type __max =
+ (__negative && __gnu_cxx::__numeric_traits<_ValueT>::__is_signed)
+ ? -__gnu_cxx::__numeric_traits<_ValueT>::__min
+ : __gnu_cxx::__numeric_traits<_ValueT>::__max;
+ const __unsigned_type __smax = __max / __base;
+ __unsigned_type __result = 0;
+ int __digit = 0;
+ const char_type* __lit_zero = __lit + __num_base::_S_izero;
+
+ if (!__lc->_M_allocated)
+ // "C" locale
+ while (!__testeof)
+ {
+ __digit = _M_find(__lit_zero, __len, __c);
+ if (__digit == -1)
+ break;
+
+ if (__result > __smax)
+ __testoverflow = true;
+ else
+ {
+ __result *= __base;
+ __testoverflow |= __result > __max - __digit;
+ __result += __digit;
+ ++__sep_pos;
+ }
+
+ if (++__beg != __end)
+ __c = *__beg;
+ else
+ __testeof = true;
+ }
+ else
+ while (!__testeof)
+ {
+ // According to 22.2.2.1.2, p8-9, first look for thousands_sep
+ // and decimal_point.
+ if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
+ {
+ // NB: Thousands separator at the beginning of a string
+ // is a no-no, as is two consecutive thousands separators.
+ if (__sep_pos)
+ {
+ __found_grouping += static_cast<char>(__sep_pos);
+ __sep_pos = 0;
+ }
+ else
+ {
+ __testfail = true;
+ break;
+ }
+ }
+ else if (__c == __lc->_M_decimal_point)
+ break;
+ else
+ {
+ const char_type* __q =
+ __traits_type::find(__lit_zero, __len, __c);
+ if (!__q)
+ break;
+
+ __digit = __q - __lit_zero;
+ if (__digit > 15)
+ __digit -= 6;
+ if (__result > __smax)
+ __testoverflow = true;
+ else
+ {
+ __result *= __base;
+ __testoverflow |= __result > __max - __digit;
+ __result += __digit;
+ ++__sep_pos;
+ }
+ }
+
+ if (++__beg != __end)
+ __c = *__beg;
+ else
+ __testeof = true;
+ }
+
+ // Digit grouping is checked. If grouping and found_grouping don't
+ // match, then get very very upset, and set failbit.
+ if (__found_grouping.size())
+ {
+ // Add the ending grouping.
+ __found_grouping += static_cast<char>(__sep_pos);
+
+ if (!std::__verify_grouping(__lc->_M_grouping,
+ __lc->_M_grouping_size,
+ __found_grouping))
+ __err = ios_base::failbit;
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 23. Num_get overflow result.
+ if ((!__sep_pos && !__found_zero && !__found_grouping.size())
+ || __testfail)
+ {
+ __v = 0;
+ __err = ios_base::failbit;
+ }
+ else if (__testoverflow)
+ {
+ if (__negative
+ && __gnu_cxx::__numeric_traits<_ValueT>::__is_signed)
+ __v = __gnu_cxx::__numeric_traits<_ValueT>::__min;
+ else
+ __v = __gnu_cxx::__numeric_traits<_ValueT>::__max;
+ __err = ios_base::failbit;
+ }
+ else
+ __v = __negative ? -__result : __result;
+
+ if (__testeof)
+ __err |= ios_base::eofbit;
+ return __beg;
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 17. Bad bool parsing
+ template<typename _CharT, typename _InIter>
+ _InIter
+ num_get<_CharT, _InIter>::
+ do_get(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, bool& __v) const
+ {
+ if (!(__io.flags() & ios_base::boolalpha))
+ {
+ // Parse bool values as long.
+ // NB: We can't just call do_get(long) here, as it might
+ // refer to a derived class.
+ long __l = -1;
+ __beg = _M_extract_int(__beg, __end, __io, __err, __l);
+ if (__l == 0 || __l == 1)
+ __v = bool(__l);
+ else
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 23. Num_get overflow result.
+ __v = true;
+ __err = ios_base::failbit;
+ if (__beg == __end)
+ __err |= ios_base::eofbit;
+ }
+ }
+ else
+ {
+ // Parse bool values as alphanumeric.
+ typedef __numpunct_cache<_CharT> __cache_type;
+ __use_cache<__cache_type> __uc;
+ const locale& __loc = __io._M_getloc();
+ const __cache_type* __lc = __uc(__loc);
+
+ bool __testf = true;
+ bool __testt = true;
+ bool __donef = __lc->_M_falsename_size == 0;
+ bool __donet = __lc->_M_truename_size == 0;
+ bool __testeof = false;
+ size_t __n = 0;
+ while (!__donef || !__donet)
+ {
+ if (__beg == __end)
+ {
+ __testeof = true;
+ break;
+ }
+
+ const char_type __c = *__beg;
+
+ if (!__donef)
+ __testf = __c == __lc->_M_falsename[__n];
+
+ if (!__testf && __donet)
+ break;
+
+ if (!__donet)
+ __testt = __c == __lc->_M_truename[__n];
+
+ if (!__testt && __donef)
+ break;
+
+ if (!__testt && !__testf)
+ break;
+
+ ++__n;
+ ++__beg;
+
+ __donef = !__testf || __n >= __lc->_M_falsename_size;
+ __donet = !__testt || __n >= __lc->_M_truename_size;
+ }
+ if (__testf && __n == __lc->_M_falsename_size && __n)
+ {
+ __v = false;
+ if (__testt && __n == __lc->_M_truename_size)
+ __err = ios_base::failbit;
+ else
+ __err = __testeof ? ios_base::eofbit : ios_base::goodbit;
+ }
+ else if (__testt && __n == __lc->_M_truename_size && __n)
+ {
+ __v = true;
+ __err = __testeof ? ios_base::eofbit : ios_base::goodbit;
+ }
+ else
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 23. Num_get overflow result.
+ __v = false;
+ __err = ios_base::failbit;
+ if (__testeof)
+ __err |= ios_base::eofbit;
+ }
+ }
+ return __beg;
+ }
+
+ template<typename _CharT, typename _InIter>
+ _InIter
+ num_get<_CharT, _InIter>::
+ do_get(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, float& __v) const
+ {
+ string __xtrc;
+ __xtrc.reserve(32);
+ __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
+ std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale());
+ if (__beg == __end)
+ __err |= ios_base::eofbit;
+ return __beg;
+ }
+
+ template<typename _CharT, typename _InIter>
+ _InIter
+ num_get<_CharT, _InIter>::
+ do_get(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, double& __v) const
+ {
+ string __xtrc;
+ __xtrc.reserve(32);
+ __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
+ std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale());
+ if (__beg == __end)
+ __err |= ios_base::eofbit;
+ return __beg;
+ }
+
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
+ template<typename _CharT, typename _InIter>
+ _InIter
+ num_get<_CharT, _InIter>::
+ __do_get(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, double& __v) const
+ {
+ string __xtrc;
+ __xtrc.reserve(32);
+ __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
+ std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale());
+ if (__beg == __end)
+ __err |= ios_base::eofbit;
+ return __beg;
+ }
+#endif
+
+ template<typename _CharT, typename _InIter>
+ _InIter
+ num_get<_CharT, _InIter>::
+ do_get(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, long double& __v) const
+ {
+ string __xtrc;
+ __xtrc.reserve(32);
+ __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
+ std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale());
+ if (__beg == __end)
+ __err |= ios_base::eofbit;
+ return __beg;
+ }
+
+ template<typename _CharT, typename _InIter>
+ _InIter
+ num_get<_CharT, _InIter>::
+ do_get(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, void*& __v) const
+ {
+ // Prepare for hex formatted input.
+ typedef ios_base::fmtflags fmtflags;
+ const fmtflags __fmt = __io.flags();
+ __io.flags((__fmt & ~ios_base::basefield) | ios_base::hex);
+
+ typedef __gnu_cxx::__conditional_type<(sizeof(void*)
+ <= sizeof(unsigned long)),
+ unsigned long, unsigned long long>::__type _UIntPtrType;
+
+ _UIntPtrType __ul;
+ __beg = _M_extract_int(__beg, __end, __io, __err, __ul);
+
+ // Reset from hex formatted input.
+ __io.flags(__fmt);
+
+ __v = reinterpret_cast<void*>(__ul);
+ return __beg;
+ }
+
+ // For use by integer and floating-point types after they have been
+ // converted into a char_type string.
+ template<typename _CharT, typename _OutIter>
+ void
+ num_put<_CharT, _OutIter>::
+ _M_pad(_CharT __fill, streamsize __w, ios_base& __io,
+ _CharT* __new, const _CharT* __cs, int& __len) const
+ {
+ // [22.2.2.2.2] Stage 3.
+ // If necessary, pad.
+ __pad<_CharT, char_traits<_CharT> >::_S_pad(__io, __fill, __new,
+ __cs, __w, __len);
+ __len = static_cast<int>(__w);
+ }
+
+_GLIBCXX_END_LDBL_NAMESPACE
+
+ template<typename _CharT, typename _ValueT>
+ int
+ __int_to_char(_CharT* __bufend, _ValueT __v, const _CharT* __lit,
+ ios_base::fmtflags __flags, bool __dec)
+ {
+ _CharT* __buf = __bufend;
+ if (__builtin_expect(__dec, true))
+ {
+ // Decimal.
+ do
+ {
+ *--__buf = __lit[(__v % 10) + __num_base::_S_odigits];
+ __v /= 10;
+ }
+ while (__v != 0);
+ }
+ else if ((__flags & ios_base::basefield) == ios_base::oct)
+ {
+ // Octal.
+ do
+ {
+ *--__buf = __lit[(__v & 0x7) + __num_base::_S_odigits];
+ __v >>= 3;
+ }
+ while (__v != 0);
+ }
+ else
+ {
+ // Hex.
+ const bool __uppercase = __flags & ios_base::uppercase;
+ const int __case_offset = __uppercase ? __num_base::_S_oudigits
+ : __num_base::_S_odigits;
+ do
+ {
+ *--__buf = __lit[(__v & 0xf) + __case_offset];
+ __v >>= 4;
+ }
+ while (__v != 0);
+ }
+ return __bufend - __buf;
+ }
+
+_GLIBCXX_BEGIN_LDBL_NAMESPACE
+
+ template<typename _CharT, typename _OutIter>
+ void
+ num_put<_CharT, _OutIter>::
+ _M_group_int(const char* __grouping, size_t __grouping_size, _CharT __sep,
+ ios_base&, _CharT* __new, _CharT* __cs, int& __len) const
+ {
+ _CharT* __p = std::__add_grouping(__new, __sep, __grouping,
+ __grouping_size, __cs, __cs + __len);
+ __len = __p - __new;
+ }
+
+ template<typename _CharT, typename _OutIter>
+ template<typename _ValueT>
+ _OutIter
+ num_put<_CharT, _OutIter>::
+ _M_insert_int(_OutIter __s, ios_base& __io, _CharT __fill,
+ _ValueT __v) const
+ {
+ using __gnu_cxx::__add_unsigned;
+ typedef typename __add_unsigned<_ValueT>::__type __unsigned_type;
+ typedef __numpunct_cache<_CharT> __cache_type;
+ __use_cache<__cache_type> __uc;
+ const locale& __loc = __io._M_getloc();
+ const __cache_type* __lc = __uc(__loc);
+ const _CharT* __lit = __lc->_M_atoms_out;
+ const ios_base::fmtflags __flags = __io.flags();
+
+ // Long enough to hold hex, dec, and octal representations.
+ const int __ilen = 5 * sizeof(_ValueT);
+ _CharT* __cs = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+ * __ilen));
+
+ // [22.2.2.2.2] Stage 1, numeric conversion to character.
+ // Result is returned right-justified in the buffer.
+ const ios_base::fmtflags __basefield = __flags & ios_base::basefield;
+ const bool __dec = (__basefield != ios_base::oct
+ && __basefield != ios_base::hex);
+ const __unsigned_type __u = ((__v > 0 || !__dec)
+ ? __unsigned_type(__v)
+ : -__unsigned_type(__v));
+ int __len = __int_to_char(__cs + __ilen, __u, __lit, __flags, __dec);
+ __cs += __ilen - __len;
+
+ // Add grouping, if necessary.
+ if (__lc->_M_use_grouping)
+ {
+ // Grouping can add (almost) as many separators as the number
+ // of digits + space is reserved for numeric base or sign.
+ _CharT* __cs2 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+ * (__len + 1)
+ * 2));
+ _M_group_int(__lc->_M_grouping, __lc->_M_grouping_size,
+ __lc->_M_thousands_sep, __io, __cs2 + 2, __cs, __len);
+ __cs = __cs2 + 2;
+ }
+
+ // Complete Stage 1, prepend numeric base or sign.
+ if (__builtin_expect(__dec, true))
+ {
+ // Decimal.
+ if (__v >= 0)
+ {
+ if (bool(__flags & ios_base::showpos)
+ && __gnu_cxx::__numeric_traits<_ValueT>::__is_signed)
+ *--__cs = __lit[__num_base::_S_oplus], ++__len;
+ }
+ else
+ *--__cs = __lit[__num_base::_S_ominus], ++__len;
+ }
+ else if (bool(__flags & ios_base::showbase) && __v)
+ {
+ if (__basefield == ios_base::oct)
+ *--__cs = __lit[__num_base::_S_odigits], ++__len;
+ else
+ {
+ // 'x' or 'X'
+ const bool __uppercase = __flags & ios_base::uppercase;
+ *--__cs = __lit[__num_base::_S_ox + __uppercase];
+ // '0'
+ *--__cs = __lit[__num_base::_S_odigits];
+ __len += 2;
+ }
+ }
+
+ // Pad.
+ const streamsize __w = __io.width();
+ if (__w > static_cast<streamsize>(__len))
+ {
+ _CharT* __cs3 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+ * __w));
+ _M_pad(__fill, __w, __io, __cs3, __cs, __len);
+ __cs = __cs3;
+ }
+ __io.width(0);
+
+ // [22.2.2.2.2] Stage 4.
+ // Write resulting, fully-formatted string to output iterator.
+ return std::__write(__s, __cs, __len);
+ }
+
+ template<typename _CharT, typename _OutIter>
+ void
+ num_put<_CharT, _OutIter>::
+ _M_group_float(const char* __grouping, size_t __grouping_size,
+ _CharT __sep, const _CharT* __p, _CharT* __new,
+ _CharT* __cs, int& __len) const
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 282. What types does numpunct grouping refer to?
+ // Add grouping, if necessary.
+ const int __declen = __p ? __p - __cs : __len;
+ _CharT* __p2 = std::__add_grouping(__new, __sep, __grouping,
+ __grouping_size,
+ __cs, __cs + __declen);
+
+ // Tack on decimal part.
+ int __newlen = __p2 - __new;
+ if (__p)
+ {
+ char_traits<_CharT>::copy(__p2, __p, __len - __declen);
+ __newlen += __len - __declen;
+ }
+ __len = __newlen;
+ }
+
+ // The following code uses vsnprintf (or vsprintf(), when
+ // _GLIBCXX_USE_C99 is not defined) to convert floating point values
+ // for insertion into a stream. An optimization would be to replace
+ // them with code that works directly on a wide buffer and then use
+ // __pad to do the padding. It would be good to replace them anyway
+ // to gain back the efficiency that C++ provides by knowing up front
+ // the type of the values to insert. Also, sprintf is dangerous
+ // since may lead to accidental buffer overruns. This
+ // implementation follows the C++ standard fairly directly as
+ // outlined in 22.2.2.2 [lib.locale.num.put]
+ template<typename _CharT, typename _OutIter>
+ template<typename _ValueT>
+ _OutIter
+ num_put<_CharT, _OutIter>::
+ _M_insert_float(_OutIter __s, ios_base& __io, _CharT __fill, char __mod,
+ _ValueT __v) const
+ {
+ typedef __numpunct_cache<_CharT> __cache_type;
+ __use_cache<__cache_type> __uc;
+ const locale& __loc = __io._M_getloc();
+ const __cache_type* __lc = __uc(__loc);
+
+ // Use default precision if out of range.
+ const streamsize __prec = __io.precision() < 0 ? 6 : __io.precision();
+
+ const int __max_digits =
+ __gnu_cxx::__numeric_traits<_ValueT>::__digits10;
+
+ // [22.2.2.2.2] Stage 1, numeric conversion to character.
+ int __len;
+ // Long enough for the max format spec.
+ char __fbuf[16];
+ __num_base::_S_format_float(__io, __fbuf, __mod);
+
+#ifdef _GLIBCXX_USE_C99
+ // First try a buffer perhaps big enough (most probably sufficient
+ // for non-ios_base::fixed outputs)
+ int __cs_size = __max_digits * 3;
+ char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
+ __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size,
+ __fbuf, __prec, __v);
+
+ // If the buffer was not large enough, try again with the correct size.
+ if (__len >= __cs_size)
+ {
+ __cs_size = __len + 1;
+ __cs = static_cast<char*>(__builtin_alloca(__cs_size));
+ __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size,
+ __fbuf, __prec, __v);
+ }
+#else
+ // Consider the possibility of long ios_base::fixed outputs
+ const bool __fixed = __io.flags() & ios_base::fixed;
+ const int __max_exp =
+ __gnu_cxx::__numeric_traits<_ValueT>::__max_exponent10;
+
+ // The size of the output string is computed as follows.
+ // ios_base::fixed outputs may need up to __max_exp + 1 chars
+ // for the integer part + __prec chars for the fractional part
+ // + 3 chars for sign, decimal point, '\0'. On the other hand,
+ // for non-fixed outputs __max_digits * 2 + __prec chars are
+ // largely sufficient.
+ const int __cs_size = __fixed ? __max_exp + __prec + 4
+ : __max_digits * 2 + __prec;
+ char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
+ __len = std::__convert_from_v(_S_get_c_locale(), __cs, 0, __fbuf,
+ __prec, __v);
+#endif
+
+ // [22.2.2.2.2] Stage 2, convert to char_type, using correct
+ // numpunct.decimal_point() values for '.' and adding grouping.
+ const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+
+ _CharT* __ws = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+ * __len));
+ __ctype.widen(__cs, __cs + __len, __ws);
+
+ // Replace decimal point.
+ _CharT* __wp = 0;
+ const char* __p = char_traits<char>::find(__cs, __len, '.');
+ if (__p)
+ {
+ __wp = __ws + (__p - __cs);
+ *__wp = __lc->_M_decimal_point;
+ }
+
+ // Add grouping, if necessary.
+ // N.B. Make sure to not group things like 2e20, i.e., no decimal
+ // point, scientific notation.
+ if (__lc->_M_use_grouping
+ && (__wp || __len < 3 || (__cs[1] <= '9' && __cs[2] <= '9'
+ && __cs[1] >= '0' && __cs[2] >= '0')))
+ {
+ // Grouping can add (almost) as many separators as the
+ // number of digits, but no more.
+ _CharT* __ws2 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+ * __len * 2));
+
+ streamsize __off = 0;
+ if (__cs[0] == '-' || __cs[0] == '+')
+ {
+ __off = 1;
+ __ws2[0] = __ws[0];
+ __len -= 1;
+ }
+
+ _M_group_float(__lc->_M_grouping, __lc->_M_grouping_size,
+ __lc->_M_thousands_sep, __wp, __ws2 + __off,
+ __ws + __off, __len);
+ __len += __off;
+
+ __ws = __ws2;
+ }
+
+ // Pad.
+ const streamsize __w = __io.width();
+ if (__w > static_cast<streamsize>(__len))
+ {
+ _CharT* __ws3 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+ * __w));
+ _M_pad(__fill, __w, __io, __ws3, __ws, __len);
+ __ws = __ws3;
+ }
+ __io.width(0);
+
+ // [22.2.2.2.2] Stage 4.
+ // Write resulting, fully-formatted string to output iterator.
+ return std::__write(__s, __ws, __len);
+ }
+
+ template<typename _CharT, typename _OutIter>
+ _OutIter
+ num_put<_CharT, _OutIter>::
+ do_put(iter_type __s, ios_base& __io, char_type __fill, bool __v) const
+ {
+ const ios_base::fmtflags __flags = __io.flags();
+ if ((__flags & ios_base::boolalpha) == 0)
+ {
+ const long __l = __v;
+ __s = _M_insert_int(__s, __io, __fill, __l);
+ }
+ else
+ {
+ typedef __numpunct_cache<_CharT> __cache_type;
+ __use_cache<__cache_type> __uc;
+ const locale& __loc = __io._M_getloc();
+ const __cache_type* __lc = __uc(__loc);
+
+ const _CharT* __name = __v ? __lc->_M_truename
+ : __lc->_M_falsename;
+ int __len = __v ? __lc->_M_truename_size
+ : __lc->_M_falsename_size;
+
+ const streamsize __w = __io.width();
+ if (__w > static_cast<streamsize>(__len))
+ {
+ const streamsize __plen = __w - __len;
+ _CharT* __ps
+ = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+ * __plen));
+
+ char_traits<_CharT>::assign(__ps, __plen, __fill);
+ __io.width(0);
+
+ if ((__flags & ios_base::adjustfield) == ios_base::left)
+ {
+ __s = std::__write(__s, __name, __len);
+ __s = std::__write(__s, __ps, __plen);
+ }
+ else
+ {
+ __s = std::__write(__s, __ps, __plen);
+ __s = std::__write(__s, __name, __len);
+ }
+ return __s;
+ }
+ __io.width(0);
+ __s = std::__write(__s, __name, __len);
+ }
+ return __s;
+ }
+
+ template<typename _CharT, typename _OutIter>
+ _OutIter
+ num_put<_CharT, _OutIter>::
+ do_put(iter_type __s, ios_base& __io, char_type __fill, double __v) const
+ { return _M_insert_float(__s, __io, __fill, char(), __v); }
+
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
+ template<typename _CharT, typename _OutIter>
+ _OutIter
+ num_put<_CharT, _OutIter>::
+ __do_put(iter_type __s, ios_base& __io, char_type __fill, double __v) const
+ { return _M_insert_float(__s, __io, __fill, char(), __v); }
+#endif
+
+ template<typename _CharT, typename _OutIter>
+ _OutIter
+ num_put<_CharT, _OutIter>::
+ do_put(iter_type __s, ios_base& __io, char_type __fill,
+ long double __v) const
+ { return _M_insert_float(__s, __io, __fill, 'L', __v); }
+
+ template<typename _CharT, typename _OutIter>
+ _OutIter
+ num_put<_CharT, _OutIter>::
+ do_put(iter_type __s, ios_base& __io, char_type __fill,
+ const void* __v) const
+ {
+ const ios_base::fmtflags __flags = __io.flags();
+ const ios_base::fmtflags __fmt = ~(ios_base::basefield
+ | ios_base::uppercase);
+ __io.flags((__flags & __fmt) | (ios_base::hex | ios_base::showbase));
+
+ typedef __gnu_cxx::__conditional_type<(sizeof(const void*)
+ <= sizeof(unsigned long)),
+ unsigned long, unsigned long long>::__type _UIntPtrType;
+
+ __s = _M_insert_int(__s, __io, __fill,
+ reinterpret_cast<_UIntPtrType>(__v));
+ __io.flags(__flags);
+ return __s;
+ }
+
+_GLIBCXX_END_LDBL_NAMESPACE
+
+ // Construct correctly padded string, as per 22.2.2.2.2
+ // Assumes
+ // __newlen > __oldlen
+ // __news is allocated for __newlen size
+
+ // NB: Of the two parameters, _CharT can be deduced from the
+ // function arguments. The other (_Traits) has to be explicitly specified.
+ template<typename _CharT, typename _Traits>
+ void
+ __pad<_CharT, _Traits>::_S_pad(ios_base& __io, _CharT __fill,
+ _CharT* __news, const _CharT* __olds,
+ streamsize __newlen, streamsize __oldlen)
+ {
+ const size_t __plen = static_cast<size_t>(__newlen - __oldlen);
+ const ios_base::fmtflags __adjust = __io.flags() & ios_base::adjustfield;
+
+ // Padding last.
+ if (__adjust == ios_base::left)
+ {
+ _Traits::copy(__news, __olds, __oldlen);
+ _Traits::assign(__news + __oldlen, __plen, __fill);
+ return;
+ }
+
+ size_t __mod = 0;
+ if (__adjust == ios_base::internal)
+ {
+ // Pad after the sign, if there is one.
+ // Pad after 0[xX], if there is one.
+ // Who came up with these rules, anyway? Jeeze.
+ const locale& __loc = __io._M_getloc();
+ const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+
+ if (__ctype.widen('-') == __olds[0]
+ || __ctype.widen('+') == __olds[0])
+ {
+ __news[0] = __olds[0];
+ __mod = 1;
+ ++__news;
+ }
+ else if (__ctype.widen('0') == __olds[0]
+ && __oldlen > 1
+ && (__ctype.widen('x') == __olds[1]
+ || __ctype.widen('X') == __olds[1]))
+ {
+ __news[0] = __olds[0];
+ __news[1] = __olds[1];
+ __mod = 2;
+ __news += 2;
+ }
+ // else Padding first.
+ }
+ _Traits::assign(__news, __plen, __fill);
+ _Traits::copy(__news + __plen, __olds + __mod, __oldlen - __mod);
+ }
+
+ template<typename _CharT>
+ _CharT*
+ __add_grouping(_CharT* __s, _CharT __sep,
+ const char* __gbeg, size_t __gsize,
+ const _CharT* __first, const _CharT* __last)
+ {
+ size_t __idx = 0;
+ size_t __ctr = 0;
+
+ while (__last - __first > __gbeg[__idx]
+ && static_cast<signed char>(__gbeg[__idx]) > 0
+ && __gbeg[__idx] != __gnu_cxx::__numeric_traits<char>::__max)
+ {
+ __last -= __gbeg[__idx];
+ __idx < __gsize - 1 ? ++__idx : ++__ctr;
+ }
+
+ while (__first != __last)
+ *__s++ = *__first++;
+
+ while (__ctr--)
+ {
+ *__s++ = __sep;
+ for (char __i = __gbeg[__idx]; __i > 0; --__i)
+ *__s++ = *__first++;
+ }
+
+ while (__idx--)
+ {
+ *__s++ = __sep;
+ for (char __i = __gbeg[__idx]; __i > 0; --__i)
+ *__s++ = *__first++;
+ }
+
+ return __s;
+ }
+
+ // Inhibit implicit instantiations for required instantiations,
+ // which are defined via explicit instantiations elsewhere.
+ // NB: This syntax is a GNU extension.
+#if _GLIBCXX_EXTERN_TEMPLATE
+ extern template class numpunct<char>;
+ extern template class numpunct_byname<char>;
+ extern template class _GLIBCXX_LDBL_NAMESPACE num_get<char>;
+ extern template class _GLIBCXX_LDBL_NAMESPACE num_put<char>;
+ extern template class ctype_byname<char>;
+
+ extern template
+ const ctype<char>&
+ use_facet<ctype<char> >(const locale&);
+
+ extern template
+ const numpunct<char>&
+ use_facet<numpunct<char> >(const locale&);
+
+ extern template
+ const num_put<char>&
+ use_facet<num_put<char> >(const locale&);
+
+ extern template
+ const num_get<char>&
+ use_facet<num_get<char> >(const locale&);
+
+ extern template
+ bool
+ has_facet<ctype<char> >(const locale&);
+
+ extern template
+ bool
+ has_facet<numpunct<char> >(const locale&);
+
+ extern template
+ bool
+ has_facet<num_put<char> >(const locale&);
+
+ extern template
+ bool
+ has_facet<num_get<char> >(const locale&);
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ extern template class numpunct<wchar_t>;
+ extern template class numpunct_byname<wchar_t>;
+ extern template class _GLIBCXX_LDBL_NAMESPACE num_get<wchar_t>;
+ extern template class _GLIBCXX_LDBL_NAMESPACE num_put<wchar_t>;
+ extern template class ctype_byname<wchar_t>;
+
+ extern template
+ const ctype<wchar_t>&
+ use_facet<ctype<wchar_t> >(const locale&);
+
+ extern template
+ const numpunct<wchar_t>&
+ use_facet<numpunct<wchar_t> >(const locale&);
+
+ extern template
+ const num_put<wchar_t>&
+ use_facet<num_put<wchar_t> >(const locale&);
+
+ extern template
+ const num_get<wchar_t>&
+ use_facet<num_get<wchar_t> >(const locale&);
+
+ extern template
+ bool
+ has_facet<ctype<wchar_t> >(const locale&);
+
+ extern template
+ bool
+ has_facet<numpunct<wchar_t> >(const locale&);
+
+ extern template
+ bool
+ has_facet<num_put<wchar_t> >(const locale&);
+
+ extern template
+ bool
+ has_facet<num_get<wchar_t> >(const locale&);
+#endif
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/bits/locale_facets_nonio.h b/i686-linux/include/c++/4.4.3/bits/locale_facets_nonio.h
new file mode 100644
index 0000000..aba96d6
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/locale_facets_nonio.h
@@ -0,0 +1,1914 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file locale_facets_nonio.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 22.1 Locales
+//
+
+#ifndef _LOCALE_FACETS_NONIO_H
+#define _LOCALE_FACETS_NONIO_H 1
+
+#pragma GCC system_header
+
+#include <ctime> // For struct tm
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @brief Time format ordering data.
+ *
+ * This class provides an enum representing different orderings of day,
+ * month, and year.
+ */
+ class time_base
+ {
+ public:
+ enum dateorder { no_order, dmy, mdy, ymd, ydm };
+ };
+
+ template<typename _CharT>
+ struct __timepunct_cache : public locale::facet
+ {
+ // List of all known timezones, with GMT first.
+ static const _CharT* _S_timezones[14];
+
+ const _CharT* _M_date_format;
+ const _CharT* _M_date_era_format;
+ const _CharT* _M_time_format;
+ const _CharT* _M_time_era_format;
+ const _CharT* _M_date_time_format;
+ const _CharT* _M_date_time_era_format;
+ const _CharT* _M_am;
+ const _CharT* _M_pm;
+ const _CharT* _M_am_pm_format;
+
+ // Day names, starting with "C"'s Sunday.
+ const _CharT* _M_day1;
+ const _CharT* _M_day2;
+ const _CharT* _M_day3;
+ const _CharT* _M_day4;
+ const _CharT* _M_day5;
+ const _CharT* _M_day6;
+ const _CharT* _M_day7;
+
+ // Abbreviated day names, starting with "C"'s Sun.
+ const _CharT* _M_aday1;
+ const _CharT* _M_aday2;
+ const _CharT* _M_aday3;
+ const _CharT* _M_aday4;
+ const _CharT* _M_aday5;
+ const _CharT* _M_aday6;
+ const _CharT* _M_aday7;
+
+ // Month names, starting with "C"'s January.
+ const _CharT* _M_month01;
+ const _CharT* _M_month02;
+ const _CharT* _M_month03;
+ const _CharT* _M_month04;
+ const _CharT* _M_month05;
+ const _CharT* _M_month06;
+ const _CharT* _M_month07;
+ const _CharT* _M_month08;
+ const _CharT* _M_month09;
+ const _CharT* _M_month10;
+ const _CharT* _M_month11;
+ const _CharT* _M_month12;
+
+ // Abbreviated month names, starting with "C"'s Jan.
+ const _CharT* _M_amonth01;
+ const _CharT* _M_amonth02;
+ const _CharT* _M_amonth03;
+ const _CharT* _M_amonth04;
+ const _CharT* _M_amonth05;
+ const _CharT* _M_amonth06;
+ const _CharT* _M_amonth07;
+ const _CharT* _M_amonth08;
+ const _CharT* _M_amonth09;
+ const _CharT* _M_amonth10;
+ const _CharT* _M_amonth11;
+ const _CharT* _M_amonth12;
+
+ bool _M_allocated;
+
+ __timepunct_cache(size_t __refs = 0) : facet(__refs),
+ _M_date_format(NULL), _M_date_era_format(NULL), _M_time_format(NULL),
+ _M_time_era_format(NULL), _M_date_time_format(NULL),
+ _M_date_time_era_format(NULL), _M_am(NULL), _M_pm(NULL),
+ _M_am_pm_format(NULL), _M_day1(NULL), _M_day2(NULL), _M_day3(NULL),
+ _M_day4(NULL), _M_day5(NULL), _M_day6(NULL), _M_day7(NULL),
+ _M_aday1(NULL), _M_aday2(NULL), _M_aday3(NULL), _M_aday4(NULL),
+ _M_aday5(NULL), _M_aday6(NULL), _M_aday7(NULL), _M_month01(NULL),
+ _M_month02(NULL), _M_month03(NULL), _M_month04(NULL), _M_month05(NULL),
+ _M_month06(NULL), _M_month07(NULL), _M_month08(NULL), _M_month09(NULL),
+ _M_month10(NULL), _M_month11(NULL), _M_month12(NULL), _M_amonth01(NULL),
+ _M_amonth02(NULL), _M_amonth03(NULL), _M_amonth04(NULL),
+ _M_amonth05(NULL), _M_amonth06(NULL), _M_amonth07(NULL),
+ _M_amonth08(NULL), _M_amonth09(NULL), _M_amonth10(NULL),
+ _M_amonth11(NULL), _M_amonth12(NULL), _M_allocated(false)
+ { }
+
+ ~__timepunct_cache();
+
+ void
+ _M_cache(const locale& __loc);
+
+ private:
+ __timepunct_cache&
+ operator=(const __timepunct_cache&);
+
+ explicit
+ __timepunct_cache(const __timepunct_cache&);
+ };
+
+ template<typename _CharT>
+ __timepunct_cache<_CharT>::~__timepunct_cache()
+ {
+ if (_M_allocated)
+ {
+ // Unused.
+ }
+ }
+
+ // Specializations.
+ template<>
+ const char*
+ __timepunct_cache<char>::_S_timezones[14];
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template<>
+ const wchar_t*
+ __timepunct_cache<wchar_t>::_S_timezones[14];
+#endif
+
+ // Generic.
+ template<typename _CharT>
+ const _CharT* __timepunct_cache<_CharT>::_S_timezones[14];
+
+ template<typename _CharT>
+ class __timepunct : public locale::facet
+ {
+ public:
+ // Types:
+ typedef _CharT __char_type;
+ typedef basic_string<_CharT> __string_type;
+ typedef __timepunct_cache<_CharT> __cache_type;
+
+ protected:
+ __cache_type* _M_data;
+ __c_locale _M_c_locale_timepunct;
+ const char* _M_name_timepunct;
+
+ public:
+ /// Numpunct facet id.
+ static locale::id id;
+
+ explicit
+ __timepunct(size_t __refs = 0);
+
+ explicit
+ __timepunct(__cache_type* __cache, size_t __refs = 0);
+
+ /**
+ * @brief Internal constructor. Not for general use.
+ *
+ * This is a constructor for use by the library itself to set up new
+ * locales.
+ *
+ * @param cloc The "C" locale.
+ * @param s The name of a locale.
+ * @param refs Passed to the base facet class.
+ */
+ explicit
+ __timepunct(__c_locale __cloc, const char* __s, size_t __refs = 0);
+
+ // FIXME: for error checking purposes _M_put should return the return
+ // value of strftime/wcsftime.
+ void
+ _M_put(_CharT* __s, size_t __maxlen, const _CharT* __format,
+ const tm* __tm) const;
+
+ void
+ _M_date_formats(const _CharT** __date) const
+ {
+ // Always have default first.
+ __date[0] = _M_data->_M_date_format;
+ __date[1] = _M_data->_M_date_era_format;
+ }
+
+ void
+ _M_time_formats(const _CharT** __time) const
+ {
+ // Always have default first.
+ __time[0] = _M_data->_M_time_format;
+ __time[1] = _M_data->_M_time_era_format;
+ }
+
+ void
+ _M_date_time_formats(const _CharT** __dt) const
+ {
+ // Always have default first.
+ __dt[0] = _M_data->_M_date_time_format;
+ __dt[1] = _M_data->_M_date_time_era_format;
+ }
+
+ void
+ _M_am_pm_format(const _CharT* __ampm) const
+ { __ampm = _M_data->_M_am_pm_format; }
+
+ void
+ _M_am_pm(const _CharT** __ampm) const
+ {
+ __ampm[0] = _M_data->_M_am;
+ __ampm[1] = _M_data->_M_pm;
+ }
+
+ void
+ _M_days(const _CharT** __days) const
+ {
+ __days[0] = _M_data->_M_day1;
+ __days[1] = _M_data->_M_day2;
+ __days[2] = _M_data->_M_day3;
+ __days[3] = _M_data->_M_day4;
+ __days[4] = _M_data->_M_day5;
+ __days[5] = _M_data->_M_day6;
+ __days[6] = _M_data->_M_day7;
+ }
+
+ void
+ _M_days_abbreviated(const _CharT** __days) const
+ {
+ __days[0] = _M_data->_M_aday1;
+ __days[1] = _M_data->_M_aday2;
+ __days[2] = _M_data->_M_aday3;
+ __days[3] = _M_data->_M_aday4;
+ __days[4] = _M_data->_M_aday5;
+ __days[5] = _M_data->_M_aday6;
+ __days[6] = _M_data->_M_aday7;
+ }
+
+ void
+ _M_months(const _CharT** __months) const
+ {
+ __months[0] = _M_data->_M_month01;
+ __months[1] = _M_data->_M_month02;
+ __months[2] = _M_data->_M_month03;
+ __months[3] = _M_data->_M_month04;
+ __months[4] = _M_data->_M_month05;
+ __months[5] = _M_data->_M_month06;
+ __months[6] = _M_data->_M_month07;
+ __months[7] = _M_data->_M_month08;
+ __months[8] = _M_data->_M_month09;
+ __months[9] = _M_data->_M_month10;
+ __months[10] = _M_data->_M_month11;
+ __months[11] = _M_data->_M_month12;
+ }
+
+ void
+ _M_months_abbreviated(const _CharT** __months) const
+ {
+ __months[0] = _M_data->_M_amonth01;
+ __months[1] = _M_data->_M_amonth02;
+ __months[2] = _M_data->_M_amonth03;
+ __months[3] = _M_data->_M_amonth04;
+ __months[4] = _M_data->_M_amonth05;
+ __months[5] = _M_data->_M_amonth06;
+ __months[6] = _M_data->_M_amonth07;
+ __months[7] = _M_data->_M_amonth08;
+ __months[8] = _M_data->_M_amonth09;
+ __months[9] = _M_data->_M_amonth10;
+ __months[10] = _M_data->_M_amonth11;
+ __months[11] = _M_data->_M_amonth12;
+ }
+
+ protected:
+ virtual
+ ~__timepunct();
+
+ // For use at construction time only.
+ void
+ _M_initialize_timepunct(__c_locale __cloc = NULL);
+ };
+
+ template<typename _CharT>
+ locale::id __timepunct<_CharT>::id;
+
+ // Specializations.
+ template<>
+ void
+ __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc);
+
+ template<>
+ void
+ __timepunct<char>::_M_put(char*, size_t, const char*, const tm*) const;
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template<>
+ void
+ __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc);
+
+ template<>
+ void
+ __timepunct<wchar_t>::_M_put(wchar_t*, size_t, const wchar_t*,
+ const tm*) const;
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+ // Include host and configuration specific timepunct functions.
+ #include <bits/time_members.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @brief Facet for parsing dates and times.
+ *
+ * This facet encapsulates the code to parse and return a date or
+ * time from a string. It is used by the istream numeric
+ * extraction operators.
+ *
+ * The time_get template uses protected virtual functions to provide the
+ * actual results. The public accessors forward the call to the virtual
+ * functions. These virtual functions are hooks for developers to
+ * implement the behavior they require from the time_get facet.
+ */
+ template<typename _CharT, typename _InIter>
+ class time_get : public locale::facet, public time_base
+ {
+ public:
+ // Types:
+ //@{
+ /// Public typedefs
+ typedef _CharT char_type;
+ typedef _InIter iter_type;
+ //@}
+ typedef basic_string<_CharT> __string_type;
+
+ /// Numpunct facet id.
+ static locale::id id;
+
+ /**
+ * @brief Constructor performs initialization.
+ *
+ * This is the constructor provided by the standard.
+ *
+ * @param refs Passed to the base facet class.
+ */
+ explicit
+ time_get(size_t __refs = 0)
+ : facet (__refs) { }
+
+ /**
+ * @brief Return preferred order of month, day, and year.
+ *
+ * This function returns an enum from timebase::dateorder giving the
+ * preferred ordering if the format "x" given to time_put::put() only
+ * uses month, day, and year. If the format "x" for the associated
+ * locale uses other fields, this function returns
+ * timebase::dateorder::noorder.
+ *
+ * NOTE: The library always returns noorder at the moment.
+ *
+ * @return A member of timebase::dateorder.
+ */
+ dateorder
+ date_order() const
+ { return this->do_date_order(); }
+
+ /**
+ * @brief Parse input time string.
+ *
+ * This function parses a time according to the format "x" and puts the
+ * results into a user-supplied struct tm. The result is returned by
+ * calling time_get::do_get_time().
+ *
+ * If there is a valid time string according to format "x", @a tm will
+ * be filled in accordingly and the returned iterator will point to the
+ * first character beyond the time string. If an error occurs before
+ * the end, err |= ios_base::failbit. If parsing reads all the
+ * characters, err |= ios_base::eofbit.
+ *
+ * @param beg Start of string to parse.
+ * @param end End of string to parse.
+ * @param io Source of the locale.
+ * @param err Error flags to set.
+ * @param tm Pointer to struct tm to fill in.
+ * @return Iterator to first char beyond time string.
+ */
+ iter_type
+ get_time(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, tm* __tm) const
+ { return this->do_get_time(__beg, __end, __io, __err, __tm); }
+
+ /**
+ * @brief Parse input date string.
+ *
+ * This function parses a date according to the format "X" and puts the
+ * results into a user-supplied struct tm. The result is returned by
+ * calling time_get::do_get_date().
+ *
+ * If there is a valid date string according to format "X", @a tm will
+ * be filled in accordingly and the returned iterator will point to the
+ * first character beyond the date string. If an error occurs before
+ * the end, err |= ios_base::failbit. If parsing reads all the
+ * characters, err |= ios_base::eofbit.
+ *
+ * @param beg Start of string to parse.
+ * @param end End of string to parse.
+ * @param io Source of the locale.
+ * @param err Error flags to set.
+ * @param tm Pointer to struct tm to fill in.
+ * @return Iterator to first char beyond date string.
+ */
+ iter_type
+ get_date(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, tm* __tm) const
+ { return this->do_get_date(__beg, __end, __io, __err, __tm); }
+
+ /**
+ * @brief Parse input weekday string.
+ *
+ * This function parses a weekday name and puts the results into a
+ * user-supplied struct tm. The result is returned by calling
+ * time_get::do_get_weekday().
+ *
+ * Parsing starts by parsing an abbreviated weekday name. If a valid
+ * abbreviation is followed by a character that would lead to the full
+ * weekday name, parsing continues until the full name is found or an
+ * error occurs. Otherwise parsing finishes at the end of the
+ * abbreviated name.
+ *
+ * If an error occurs before the end, err |= ios_base::failbit. If
+ * parsing reads all the characters, err |= ios_base::eofbit.
+ *
+ * @param beg Start of string to parse.
+ * @param end End of string to parse.
+ * @param io Source of the locale.
+ * @param err Error flags to set.
+ * @param tm Pointer to struct tm to fill in.
+ * @return Iterator to first char beyond weekday name.
+ */
+ iter_type
+ get_weekday(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, tm* __tm) const
+ { return this->do_get_weekday(__beg, __end, __io, __err, __tm); }
+
+ /**
+ * @brief Parse input month string.
+ *
+ * This function parses a month name and puts the results into a
+ * user-supplied struct tm. The result is returned by calling
+ * time_get::do_get_monthname().
+ *
+ * Parsing starts by parsing an abbreviated month name. If a valid
+ * abbreviation is followed by a character that would lead to the full
+ * month name, parsing continues until the full name is found or an
+ * error occurs. Otherwise parsing finishes at the end of the
+ * abbreviated name.
+ *
+ * If an error occurs before the end, err |= ios_base::failbit. If
+ * parsing reads all the characters, err |=
+ * ios_base::eofbit.
+ *
+ * @param beg Start of string to parse.
+ * @param end End of string to parse.
+ * @param io Source of the locale.
+ * @param err Error flags to set.
+ * @param tm Pointer to struct tm to fill in.
+ * @return Iterator to first char beyond month name.
+ */
+ iter_type
+ get_monthname(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, tm* __tm) const
+ { return this->do_get_monthname(__beg, __end, __io, __err, __tm); }
+
+ /**
+ * @brief Parse input year string.
+ *
+ * This function reads up to 4 characters to parse a year string and
+ * puts the results into a user-supplied struct tm. The result is
+ * returned by calling time_get::do_get_year().
+ *
+ * 4 consecutive digits are interpreted as a full year. If there are
+ * exactly 2 consecutive digits, the library interprets this as the
+ * number of years since 1900.
+ *
+ * If an error occurs before the end, err |= ios_base::failbit. If
+ * parsing reads all the characters, err |= ios_base::eofbit.
+ *
+ * @param beg Start of string to parse.
+ * @param end End of string to parse.
+ * @param io Source of the locale.
+ * @param err Error flags to set.
+ * @param tm Pointer to struct tm to fill in.
+ * @return Iterator to first char beyond year.
+ */
+ iter_type
+ get_year(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, tm* __tm) const
+ { return this->do_get_year(__beg, __end, __io, __err, __tm); }
+
+ protected:
+ /// Destructor.
+ virtual
+ ~time_get() { }
+
+ /**
+ * @brief Return preferred order of month, day, and year.
+ *
+ * This function returns an enum from timebase::dateorder giving the
+ * preferred ordering if the format "x" given to time_put::put() only
+ * uses month, day, and year. This function is a hook for derived
+ * classes to change the value returned.
+ *
+ * @return A member of timebase::dateorder.
+ */
+ virtual dateorder
+ do_date_order() const;
+
+ /**
+ * @brief Parse input time string.
+ *
+ * This function parses a time according to the format "x" and puts the
+ * results into a user-supplied struct tm. This function is a hook for
+ * derived classes to change the value returned. @see get_time() for
+ * details.
+ *
+ * @param beg Start of string to parse.
+ * @param end End of string to parse.
+ * @param io Source of the locale.
+ * @param err Error flags to set.
+ * @param tm Pointer to struct tm to fill in.
+ * @return Iterator to first char beyond time string.
+ */
+ virtual iter_type
+ do_get_time(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, tm* __tm) const;
+
+ /**
+ * @brief Parse input date string.
+ *
+ * This function parses a date according to the format "X" and puts the
+ * results into a user-supplied struct tm. This function is a hook for
+ * derived classes to change the value returned. @see get_date() for
+ * details.
+ *
+ * @param beg Start of string to parse.
+ * @param end End of string to parse.
+ * @param io Source of the locale.
+ * @param err Error flags to set.
+ * @param tm Pointer to struct tm to fill in.
+ * @return Iterator to first char beyond date string.
+ */
+ virtual iter_type
+ do_get_date(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, tm* __tm) const;
+
+ /**
+ * @brief Parse input weekday string.
+ *
+ * This function parses a weekday name and puts the results into a
+ * user-supplied struct tm. This function is a hook for derived
+ * classes to change the value returned. @see get_weekday() for
+ * details.
+ *
+ * @param beg Start of string to parse.
+ * @param end End of string to parse.
+ * @param io Source of the locale.
+ * @param err Error flags to set.
+ * @param tm Pointer to struct tm to fill in.
+ * @return Iterator to first char beyond weekday name.
+ */
+ virtual iter_type
+ do_get_weekday(iter_type __beg, iter_type __end, ios_base&,
+ ios_base::iostate& __err, tm* __tm) const;
+
+ /**
+ * @brief Parse input month string.
+ *
+ * This function parses a month name and puts the results into a
+ * user-supplied struct tm. This function is a hook for derived
+ * classes to change the value returned. @see get_monthname() for
+ * details.
+ *
+ * @param beg Start of string to parse.
+ * @param end End of string to parse.
+ * @param io Source of the locale.
+ * @param err Error flags to set.
+ * @param tm Pointer to struct tm to fill in.
+ * @return Iterator to first char beyond month name.
+ */
+ virtual iter_type
+ do_get_monthname(iter_type __beg, iter_type __end, ios_base&,
+ ios_base::iostate& __err, tm* __tm) const;
+
+ /**
+ * @brief Parse input year string.
+ *
+ * This function reads up to 4 characters to parse a year string and
+ * puts the results into a user-supplied struct tm. This function is a
+ * hook for derived classes to change the value returned. @see
+ * get_year() for details.
+ *
+ * @param beg Start of string to parse.
+ * @param end End of string to parse.
+ * @param io Source of the locale.
+ * @param err Error flags to set.
+ * @param tm Pointer to struct tm to fill in.
+ * @return Iterator to first char beyond year.
+ */
+ virtual iter_type
+ do_get_year(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, tm* __tm) const;
+
+ // Extract numeric component of length __len.
+ iter_type
+ _M_extract_num(iter_type __beg, iter_type __end, int& __member,
+ int __min, int __max, size_t __len,
+ ios_base& __io, ios_base::iostate& __err) const;
+
+ // Extract day or month name, or any unique array of string
+ // literals in a const _CharT* array.
+ iter_type
+ _M_extract_name(iter_type __beg, iter_type __end, int& __member,
+ const _CharT** __names, size_t __indexlen,
+ ios_base& __io, ios_base::iostate& __err) const;
+
+ // Extract on a component-by-component basis, via __format argument.
+ iter_type
+ _M_extract_via_format(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, tm* __tm,
+ const _CharT* __format) const;
+ };
+
+ template<typename _CharT, typename _InIter>
+ locale::id time_get<_CharT, _InIter>::id;
+
+ /// class time_get_byname [22.2.5.2].
+ template<typename _CharT, typename _InIter>
+ class time_get_byname : public time_get<_CharT, _InIter>
+ {
+ public:
+ // Types:
+ typedef _CharT char_type;
+ typedef _InIter iter_type;
+
+ explicit
+ time_get_byname(const char*, size_t __refs = 0)
+ : time_get<_CharT, _InIter>(__refs) { }
+
+ protected:
+ virtual
+ ~time_get_byname() { }
+ };
+
+ /**
+ * @brief Facet for outputting dates and times.
+ *
+ * This facet encapsulates the code to format and output dates and times
+ * according to formats used by strftime().
+ *
+ * The time_put template uses protected virtual functions to provide the
+ * actual results. The public accessors forward the call to the virtual
+ * functions. These virtual functions are hooks for developers to
+ * implement the behavior they require from the time_put facet.
+ */
+ template<typename _CharT, typename _OutIter>
+ class time_put : public locale::facet
+ {
+ public:
+ // Types:
+ //@{
+ /// Public typedefs
+ typedef _CharT char_type;
+ typedef _OutIter iter_type;
+ //@}
+
+ /// Numpunct facet id.
+ static locale::id id;
+
+ /**
+ * @brief Constructor performs initialization.
+ *
+ * This is the constructor provided by the standard.
+ *
+ * @param refs Passed to the base facet class.
+ */
+ explicit
+ time_put(size_t __refs = 0)
+ : facet(__refs) { }
+
+ /**
+ * @brief Format and output a time or date.
+ *
+ * This function formats the data in struct tm according to the
+ * provided format string. The format string is interpreted as by
+ * strftime().
+ *
+ * @param s The stream to write to.
+ * @param io Source of locale.
+ * @param fill char_type to use for padding.
+ * @param tm Struct tm with date and time info to format.
+ * @param beg Start of format string.
+ * @param end End of format string.
+ * @return Iterator after writing.
+ */
+ iter_type
+ put(iter_type __s, ios_base& __io, char_type __fill, const tm* __tm,
+ const _CharT* __beg, const _CharT* __end) const;
+
+ /**
+ * @brief Format and output a time or date.
+ *
+ * This function formats the data in struct tm according to the
+ * provided format char and optional modifier. The format and modifier
+ * are interpreted as by strftime(). It does so by returning
+ * time_put::do_put().
+ *
+ * @param s The stream to write to.
+ * @param io Source of locale.
+ * @param fill char_type to use for padding.
+ * @param tm Struct tm with date and time info to format.
+ * @param format Format char.
+ * @param mod Optional modifier char.
+ * @return Iterator after writing.
+ */
+ iter_type
+ put(iter_type __s, ios_base& __io, char_type __fill,
+ const tm* __tm, char __format, char __mod = 0) const
+ { return this->do_put(__s, __io, __fill, __tm, __format, __mod); }
+
+ protected:
+ /// Destructor.
+ virtual
+ ~time_put()
+ { }
+
+ /**
+ * @brief Format and output a time or date.
+ *
+ * This function formats the data in struct tm according to the
+ * provided format char and optional modifier. This function is a hook
+ * for derived classes to change the value returned. @see put() for
+ * more details.
+ *
+ * @param s The stream to write to.
+ * @param io Source of locale.
+ * @param fill char_type to use for padding.
+ * @param tm Struct tm with date and time info to format.
+ * @param format Format char.
+ * @param mod Optional modifier char.
+ * @return Iterator after writing.
+ */
+ virtual iter_type
+ do_put(iter_type __s, ios_base& __io, char_type __fill, const tm* __tm,
+ char __format, char __mod) const;
+ };
+
+ template<typename _CharT, typename _OutIter>
+ locale::id time_put<_CharT, _OutIter>::id;
+
+ /// class time_put_byname [22.2.5.4].
+ template<typename _CharT, typename _OutIter>
+ class time_put_byname : public time_put<_CharT, _OutIter>
+ {
+ public:
+ // Types:
+ typedef _CharT char_type;
+ typedef _OutIter iter_type;
+
+ explicit
+ time_put_byname(const char*, size_t __refs = 0)
+ : time_put<_CharT, _OutIter>(__refs)
+ { };
+
+ protected:
+ virtual
+ ~time_put_byname() { }
+ };
+
+
+ /**
+ * @brief Money format ordering data.
+ *
+ * This class contains an ordered array of 4 fields to represent the
+ * pattern for formatting a money amount. Each field may contain one entry
+ * from the part enum. symbol, sign, and value must be present and the
+ * remaining field must contain either none or space. @see
+ * moneypunct::pos_format() and moneypunct::neg_format() for details of how
+ * these fields are interpreted.
+ */
+ class money_base
+ {
+ public:
+ enum part { none, space, symbol, sign, value };
+ struct pattern { char field[4]; };
+
+ static const pattern _S_default_pattern;
+
+ enum
+ {
+ _S_minus,
+ _S_zero,
+ _S_end = 11
+ };
+
+ // String literal of acceptable (narrow) input/output, for
+ // money_get/money_put. "-0123456789"
+ static const char* _S_atoms;
+
+ // Construct and return valid pattern consisting of some combination of:
+ // space none symbol sign value
+ static pattern
+ _S_construct_pattern(char __precedes, char __space, char __posn);
+ };
+
+ template<typename _CharT, bool _Intl>
+ struct __moneypunct_cache : public locale::facet
+ {
+ const char* _M_grouping;
+ size_t _M_grouping_size;
+ bool _M_use_grouping;
+ _CharT _M_decimal_point;
+ _CharT _M_thousands_sep;
+ const _CharT* _M_curr_symbol;
+ size_t _M_curr_symbol_size;
+ const _CharT* _M_positive_sign;
+ size_t _M_positive_sign_size;
+ const _CharT* _M_negative_sign;
+ size_t _M_negative_sign_size;
+ int _M_frac_digits;
+ money_base::pattern _M_pos_format;
+ money_base::pattern _M_neg_format;
+
+ // A list of valid numeric literals for input and output: in the standard
+ // "C" locale, this is "-0123456789". This array contains the chars after
+ // having been passed through the current locale's ctype<_CharT>.widen().
+ _CharT _M_atoms[money_base::_S_end];
+
+ bool _M_allocated;
+
+ __moneypunct_cache(size_t __refs = 0) : facet(__refs),
+ _M_grouping(NULL), _M_grouping_size(0), _M_use_grouping(false),
+ _M_decimal_point(_CharT()), _M_thousands_sep(_CharT()),
+ _M_curr_symbol(NULL), _M_curr_symbol_size(0),
+ _M_positive_sign(NULL), _M_positive_sign_size(0),
+ _M_negative_sign(NULL), _M_negative_sign_size(0),
+ _M_frac_digits(0),
+ _M_pos_format(money_base::pattern()),
+ _M_neg_format(money_base::pattern()), _M_allocated(false)
+ { }
+
+ ~__moneypunct_cache();
+
+ void
+ _M_cache(const locale& __loc);
+
+ private:
+ __moneypunct_cache&
+ operator=(const __moneypunct_cache&);
+
+ explicit
+ __moneypunct_cache(const __moneypunct_cache&);
+ };
+
+ template<typename _CharT, bool _Intl>
+ __moneypunct_cache<_CharT, _Intl>::~__moneypunct_cache()
+ {
+ if (_M_allocated)
+ {
+ delete [] _M_grouping;
+ delete [] _M_curr_symbol;
+ delete [] _M_positive_sign;
+ delete [] _M_negative_sign;
+ }
+ }
+
+ /**
+ * @brief Facet for formatting data for money amounts.
+ *
+ * This facet encapsulates the punctuation, grouping and other formatting
+ * features of money amount string representations.
+ */
+ template<typename _CharT, bool _Intl>
+ class moneypunct : public locale::facet, public money_base
+ {
+ public:
+ // Types:
+ //@{
+ /// Public typedefs
+ typedef _CharT char_type;
+ typedef basic_string<_CharT> string_type;
+ //@}
+ typedef __moneypunct_cache<_CharT, _Intl> __cache_type;
+
+ private:
+ __cache_type* _M_data;
+
+ public:
+ /// This value is provided by the standard, but no reason for its
+ /// existence.
+ static const bool intl = _Intl;
+ /// Numpunct facet id.
+ static locale::id id;
+
+ /**
+ * @brief Constructor performs initialization.
+ *
+ * This is the constructor provided by the standard.
+ *
+ * @param refs Passed to the base facet class.
+ */
+ explicit
+ moneypunct(size_t __refs = 0) : facet(__refs), _M_data(NULL)
+ { _M_initialize_moneypunct(); }
+
+ /**
+ * @brief Constructor performs initialization.
+ *
+ * This is an internal constructor.
+ *
+ * @param cache Cache for optimization.
+ * @param refs Passed to the base facet class.
+ */
+ explicit
+ moneypunct(__cache_type* __cache, size_t __refs = 0)
+ : facet(__refs), _M_data(__cache)
+ { _M_initialize_moneypunct(); }
+
+ /**
+ * @brief Internal constructor. Not for general use.
+ *
+ * This is a constructor for use by the library itself to set up new
+ * locales.
+ *
+ * @param cloc The "C" locale.
+ * @param s The name of a locale.
+ * @param refs Passed to the base facet class.
+ */
+ explicit
+ moneypunct(__c_locale __cloc, const char* __s, size_t __refs = 0)
+ : facet(__refs), _M_data(NULL)
+ { _M_initialize_moneypunct(__cloc, __s); }
+
+ /**
+ * @brief Return decimal point character.
+ *
+ * This function returns a char_type to use as a decimal point. It
+ * does so by returning returning
+ * moneypunct<char_type>::do_decimal_point().
+ *
+ * @return @a char_type representing a decimal point.
+ */
+ char_type
+ decimal_point() const
+ { return this->do_decimal_point(); }
+
+ /**
+ * @brief Return thousands separator character.
+ *
+ * This function returns a char_type to use as a thousands
+ * separator. It does so by returning returning
+ * moneypunct<char_type>::do_thousands_sep().
+ *
+ * @return char_type representing a thousands separator.
+ */
+ char_type
+ thousands_sep() const
+ { return this->do_thousands_sep(); }
+
+ /**
+ * @brief Return grouping specification.
+ *
+ * This function returns a string representing groupings for the
+ * integer part of an amount. Groupings indicate where thousands
+ * separators should be inserted.
+ *
+ * Each char in the return string is interpret as an integer rather
+ * than a character. These numbers represent the number of digits in a
+ * group. The first char in the string represents the number of digits
+ * in the least significant group. If a char is negative, it indicates
+ * an unlimited number of digits for the group. If more chars from the
+ * string are required to group a number, the last char is used
+ * repeatedly.
+ *
+ * For example, if the grouping() returns "\003\002" and is applied to
+ * the number 123456789, this corresponds to 12,34,56,789. Note that
+ * if the string was "32", this would put more than 50 digits into the
+ * least significant group if the character set is ASCII.
+ *
+ * The string is returned by calling
+ * moneypunct<char_type>::do_grouping().
+ *
+ * @return string representing grouping specification.
+ */
+ string
+ grouping() const
+ { return this->do_grouping(); }
+
+ /**
+ * @brief Return currency symbol string.
+ *
+ * This function returns a string_type to use as a currency symbol. It
+ * does so by returning returning
+ * moneypunct<char_type>::do_curr_symbol().
+ *
+ * @return @a string_type representing a currency symbol.
+ */
+ string_type
+ curr_symbol() const
+ { return this->do_curr_symbol(); }
+
+ /**
+ * @brief Return positive sign string.
+ *
+ * This function returns a string_type to use as a sign for positive
+ * amounts. It does so by returning returning
+ * moneypunct<char_type>::do_positive_sign().
+ *
+ * If the return value contains more than one character, the first
+ * character appears in the position indicated by pos_format() and the
+ * remainder appear at the end of the formatted string.
+ *
+ * @return @a string_type representing a positive sign.
+ */
+ string_type
+ positive_sign() const
+ { return this->do_positive_sign(); }
+
+ /**
+ * @brief Return negative sign string.
+ *
+ * This function returns a string_type to use as a sign for negative
+ * amounts. It does so by returning returning
+ * moneypunct<char_type>::do_negative_sign().
+ *
+ * If the return value contains more than one character, the first
+ * character appears in the position indicated by neg_format() and the
+ * remainder appear at the end of the formatted string.
+ *
+ * @return @a string_type representing a negative sign.
+ */
+ string_type
+ negative_sign() const
+ { return this->do_negative_sign(); }
+
+ /**
+ * @brief Return number of digits in fraction.
+ *
+ * This function returns the exact number of digits that make up the
+ * fractional part of a money amount. It does so by returning
+ * returning moneypunct<char_type>::do_frac_digits().
+ *
+ * The fractional part of a money amount is optional. But if it is
+ * present, there must be frac_digits() digits.
+ *
+ * @return Number of digits in amount fraction.
+ */
+ int
+ frac_digits() const
+ { return this->do_frac_digits(); }
+
+ //@{
+ /**
+ * @brief Return pattern for money values.
+ *
+ * This function returns a pattern describing the formatting of a
+ * positive or negative valued money amount. It does so by returning
+ * returning moneypunct<char_type>::do_pos_format() or
+ * moneypunct<char_type>::do_neg_format().
+ *
+ * The pattern has 4 fields describing the ordering of symbol, sign,
+ * value, and none or space. There must be one of each in the pattern.
+ * The none and space enums may not appear in the first field and space
+ * may not appear in the final field.
+ *
+ * The parts of a money string must appear in the order indicated by
+ * the fields of the pattern. The symbol field indicates that the
+ * value of curr_symbol() may be present. The sign field indicates
+ * that the value of positive_sign() or negative_sign() must be
+ * present. The value field indicates that the absolute value of the
+ * money amount is present. none indicates 0 or more whitespace
+ * characters, except at the end, where it permits no whitespace.
+ * space indicates that 1 or more whitespace characters must be
+ * present.
+ *
+ * For example, for the US locale and pos_format() pattern
+ * {symbol,sign,value,none}, curr_symbol() == '$' positive_sign() ==
+ * '+', and value 10.01, and options set to force the symbol, the
+ * corresponding string is "$+10.01".
+ *
+ * @return Pattern for money values.
+ */
+ pattern
+ pos_format() const
+ { return this->do_pos_format(); }
+
+ pattern
+ neg_format() const
+ { return this->do_neg_format(); }
+ //@}
+
+ protected:
+ /// Destructor.
+ virtual
+ ~moneypunct();
+
+ /**
+ * @brief Return decimal point character.
+ *
+ * Returns a char_type to use as a decimal point. This function is a
+ * hook for derived classes to change the value returned.
+ *
+ * @return @a char_type representing a decimal point.
+ */
+ virtual char_type
+ do_decimal_point() const
+ { return _M_data->_M_decimal_point; }
+
+ /**
+ * @brief Return thousands separator character.
+ *
+ * Returns a char_type to use as a thousands separator. This function
+ * is a hook for derived classes to change the value returned.
+ *
+ * @return @a char_type representing a thousands separator.
+ */
+ virtual char_type
+ do_thousands_sep() const
+ { return _M_data->_M_thousands_sep; }
+
+ /**
+ * @brief Return grouping specification.
+ *
+ * Returns a string representing groupings for the integer part of a
+ * number. This function is a hook for derived classes to change the
+ * value returned. @see grouping() for details.
+ *
+ * @return String representing grouping specification.
+ */
+ virtual string
+ do_grouping() const
+ { return _M_data->_M_grouping; }
+
+ /**
+ * @brief Return currency symbol string.
+ *
+ * This function returns a string_type to use as a currency symbol.
+ * This function is a hook for derived classes to change the value
+ * returned. @see curr_symbol() for details.
+ *
+ * @return @a string_type representing a currency symbol.
+ */
+ virtual string_type
+ do_curr_symbol() const
+ { return _M_data->_M_curr_symbol; }
+
+ /**
+ * @brief Return positive sign string.
+ *
+ * This function returns a string_type to use as a sign for positive
+ * amounts. This function is a hook for derived classes to change the
+ * value returned. @see positive_sign() for details.
+ *
+ * @return @a string_type representing a positive sign.
+ */
+ virtual string_type
+ do_positive_sign() const
+ { return _M_data->_M_positive_sign; }
+
+ /**
+ * @brief Return negative sign string.
+ *
+ * This function returns a string_type to use as a sign for negative
+ * amounts. This function is a hook for derived classes to change the
+ * value returned. @see negative_sign() for details.
+ *
+ * @return @a string_type representing a negative sign.
+ */
+ virtual string_type
+ do_negative_sign() const
+ { return _M_data->_M_negative_sign; }
+
+ /**
+ * @brief Return number of digits in fraction.
+ *
+ * This function returns the exact number of digits that make up the
+ * fractional part of a money amount. This function is a hook for
+ * derived classes to change the value returned. @see frac_digits()
+ * for details.
+ *
+ * @return Number of digits in amount fraction.
+ */
+ virtual int
+ do_frac_digits() const
+ { return _M_data->_M_frac_digits; }
+
+ /**
+ * @brief Return pattern for money values.
+ *
+ * This function returns a pattern describing the formatting of a
+ * positive valued money amount. This function is a hook for derived
+ * classes to change the value returned. @see pos_format() for
+ * details.
+ *
+ * @return Pattern for money values.
+ */
+ virtual pattern
+ do_pos_format() const
+ { return _M_data->_M_pos_format; }
+
+ /**
+ * @brief Return pattern for money values.
+ *
+ * This function returns a pattern describing the formatting of a
+ * negative valued money amount. This function is a hook for derived
+ * classes to change the value returned. @see neg_format() for
+ * details.
+ *
+ * @return Pattern for money values.
+ */
+ virtual pattern
+ do_neg_format() const
+ { return _M_data->_M_neg_format; }
+
+ // For use at construction time only.
+ void
+ _M_initialize_moneypunct(__c_locale __cloc = NULL,
+ const char* __name = NULL);
+ };
+
+ template<typename _CharT, bool _Intl>
+ locale::id moneypunct<_CharT, _Intl>::id;
+
+ template<typename _CharT, bool _Intl>
+ const bool moneypunct<_CharT, _Intl>::intl;
+
+ template<>
+ moneypunct<char, true>::~moneypunct();
+
+ template<>
+ moneypunct<char, false>::~moneypunct();
+
+ template<>
+ void
+ moneypunct<char, true>::_M_initialize_moneypunct(__c_locale, const char*);
+
+ template<>
+ void
+ moneypunct<char, false>::_M_initialize_moneypunct(__c_locale, const char*);
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template<>
+ moneypunct<wchar_t, true>::~moneypunct();
+
+ template<>
+ moneypunct<wchar_t, false>::~moneypunct();
+
+ template<>
+ void
+ moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale,
+ const char*);
+
+ template<>
+ void
+ moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale,
+ const char*);
+#endif
+
+ /// class moneypunct_byname [22.2.6.4].
+ template<typename _CharT, bool _Intl>
+ class moneypunct_byname : public moneypunct<_CharT, _Intl>
+ {
+ public:
+ typedef _CharT char_type;
+ typedef basic_string<_CharT> string_type;
+
+ static const bool intl = _Intl;
+
+ explicit
+ moneypunct_byname(const char* __s, size_t __refs = 0)
+ : moneypunct<_CharT, _Intl>(__refs)
+ {
+ if (__builtin_strcmp(__s, "C") != 0
+ && __builtin_strcmp(__s, "POSIX") != 0)
+ {
+ __c_locale __tmp;
+ this->_S_create_c_locale(__tmp, __s);
+ this->_M_initialize_moneypunct(__tmp);
+ this->_S_destroy_c_locale(__tmp);
+ }
+ }
+
+ protected:
+ virtual
+ ~moneypunct_byname() { }
+ };
+
+ template<typename _CharT, bool _Intl>
+ const bool moneypunct_byname<_CharT, _Intl>::intl;
+
+_GLIBCXX_BEGIN_LDBL_NAMESPACE
+
+ /**
+ * @brief Facet for parsing monetary amounts.
+ *
+ * This facet encapsulates the code to parse and return a monetary
+ * amount from a string.
+ *
+ * The money_get template uses protected virtual functions to
+ * provide the actual results. The public accessors forward the
+ * call to the virtual functions. These virtual functions are
+ * hooks for developers to implement the behavior they require from
+ * the money_get facet.
+ */
+ template<typename _CharT, typename _InIter>
+ class money_get : public locale::facet
+ {
+ public:
+ // Types:
+ //@{
+ /// Public typedefs
+ typedef _CharT char_type;
+ typedef _InIter iter_type;
+ typedef basic_string<_CharT> string_type;
+ //@}
+
+ /// Numpunct facet id.
+ static locale::id id;
+
+ /**
+ * @brief Constructor performs initialization.
+ *
+ * This is the constructor provided by the standard.
+ *
+ * @param refs Passed to the base facet class.
+ */
+ explicit
+ money_get(size_t __refs = 0) : facet(__refs) { }
+
+ /**
+ * @brief Read and parse a monetary value.
+ *
+ * This function reads characters from @a s, interprets them as a
+ * monetary value according to moneypunct and ctype facets retrieved
+ * from io.getloc(), and returns the result in @a units as an integral
+ * value moneypunct::frac_digits() * the actual amount. For example,
+ * the string $10.01 in a US locale would store 1001 in @a units.
+ *
+ * Any characters not part of a valid money amount are not consumed.
+ *
+ * If a money value cannot be parsed from the input stream, sets
+ * err=(err|io.failbit). If the stream is consumed before finishing
+ * parsing, sets err=(err|io.failbit|io.eofbit). @a units is
+ * unchanged if parsing fails.
+ *
+ * This function works by returning the result of do_get().
+ *
+ * @param s Start of characters to parse.
+ * @param end End of characters to parse.
+ * @param intl Parameter to use_facet<moneypunct<CharT,intl> >.
+ * @param io Source of facets and io state.
+ * @param err Error field to set if parsing fails.
+ * @param units Place to store result of parsing.
+ * @return Iterator referencing first character beyond valid money
+ * amount.
+ */
+ iter_type
+ get(iter_type __s, iter_type __end, bool __intl, ios_base& __io,
+ ios_base::iostate& __err, long double& __units) const
+ { return this->do_get(__s, __end, __intl, __io, __err, __units); }
+
+ /**
+ * @brief Read and parse a monetary value.
+ *
+ * This function reads characters from @a s, interprets them as a
+ * monetary value according to moneypunct and ctype facets retrieved
+ * from io.getloc(), and returns the result in @a digits. For example,
+ * the string $10.01 in a US locale would store "1001" in @a digits.
+ *
+ * Any characters not part of a valid money amount are not consumed.
+ *
+ * If a money value cannot be parsed from the input stream, sets
+ * err=(err|io.failbit). If the stream is consumed before finishing
+ * parsing, sets err=(err|io.failbit|io.eofbit).
+ *
+ * This function works by returning the result of do_get().
+ *
+ * @param s Start of characters to parse.
+ * @param end End of characters to parse.
+ * @param intl Parameter to use_facet<moneypunct<CharT,intl> >.
+ * @param io Source of facets and io state.
+ * @param err Error field to set if parsing fails.
+ * @param digits Place to store result of parsing.
+ * @return Iterator referencing first character beyond valid money
+ * amount.
+ */
+ iter_type
+ get(iter_type __s, iter_type __end, bool __intl, ios_base& __io,
+ ios_base::iostate& __err, string_type& __digits) const
+ { return this->do_get(__s, __end, __intl, __io, __err, __digits); }
+
+ protected:
+ /// Destructor.
+ virtual
+ ~money_get() { }
+
+ /**
+ * @brief Read and parse a monetary value.
+ *
+ * This function reads and parses characters representing a monetary
+ * value. This function is a hook for derived classes to change the
+ * value returned. @see get() for details.
+ */
+ // XXX GLIBCXX_ABI Deprecated
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
+ virtual iter_type
+ __do_get(iter_type __s, iter_type __end, bool __intl, ios_base& __io,
+ ios_base::iostate& __err, double& __units) const;
+#else
+ virtual iter_type
+ do_get(iter_type __s, iter_type __end, bool __intl, ios_base& __io,
+ ios_base::iostate& __err, long double& __units) const;
+#endif
+
+ /**
+ * @brief Read and parse a monetary value.
+ *
+ * This function reads and parses characters representing a monetary
+ * value. This function is a hook for derived classes to change the
+ * value returned. @see get() for details.
+ */
+ virtual iter_type
+ do_get(iter_type __s, iter_type __end, bool __intl, ios_base& __io,
+ ios_base::iostate& __err, string_type& __digits) const;
+
+ // XXX GLIBCXX_ABI Deprecated
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
+ virtual iter_type
+ do_get(iter_type __s, iter_type __end, bool __intl, ios_base& __io,
+ ios_base::iostate& __err, long double& __units) const;
+#endif
+
+ template<bool _Intl>
+ iter_type
+ _M_extract(iter_type __s, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, string& __digits) const;
+ };
+
+ template<typename _CharT, typename _InIter>
+ locale::id money_get<_CharT, _InIter>::id;
+
+ /**
+ * @brief Facet for outputting monetary amounts.
+ *
+ * This facet encapsulates the code to format and output a monetary
+ * amount.
+ *
+ * The money_put template uses protected virtual functions to
+ * provide the actual results. The public accessors forward the
+ * call to the virtual functions. These virtual functions are
+ * hooks for developers to implement the behavior they require from
+ * the money_put facet.
+ */
+ template<typename _CharT, typename _OutIter>
+ class money_put : public locale::facet
+ {
+ public:
+ //@{
+ /// Public typedefs
+ typedef _CharT char_type;
+ typedef _OutIter iter_type;
+ typedef basic_string<_CharT> string_type;
+ //@}
+
+ /// Numpunct facet id.
+ static locale::id id;
+
+ /**
+ * @brief Constructor performs initialization.
+ *
+ * This is the constructor provided by the standard.
+ *
+ * @param refs Passed to the base facet class.
+ */
+ explicit
+ money_put(size_t __refs = 0) : facet(__refs) { }
+
+ /**
+ * @brief Format and output a monetary value.
+ *
+ * This function formats @a units as a monetary value according to
+ * moneypunct and ctype facets retrieved from io.getloc(), and writes
+ * the resulting characters to @a s. For example, the value 1001 in a
+ * US locale would write "$10.01" to @a s.
+ *
+ * This function works by returning the result of do_put().
+ *
+ * @param s The stream to write to.
+ * @param intl Parameter to use_facet<moneypunct<CharT,intl> >.
+ * @param io Source of facets and io state.
+ * @param fill char_type to use for padding.
+ * @param units Place to store result of parsing.
+ * @return Iterator after writing.
+ */
+ iter_type
+ put(iter_type __s, bool __intl, ios_base& __io,
+ char_type __fill, long double __units) const
+ { return this->do_put(__s, __intl, __io, __fill, __units); }
+
+ /**
+ * @brief Format and output a monetary value.
+ *
+ * This function formats @a digits as a monetary value according to
+ * moneypunct and ctype facets retrieved from io.getloc(), and writes
+ * the resulting characters to @a s. For example, the string "1001" in
+ * a US locale would write "$10.01" to @a s.
+ *
+ * This function works by returning the result of do_put().
+ *
+ * @param s The stream to write to.
+ * @param intl Parameter to use_facet<moneypunct<CharT,intl> >.
+ * @param io Source of facets and io state.
+ * @param fill char_type to use for padding.
+ * @param units Place to store result of parsing.
+ * @return Iterator after writing.
+ */
+ iter_type
+ put(iter_type __s, bool __intl, ios_base& __io,
+ char_type __fill, const string_type& __digits) const
+ { return this->do_put(__s, __intl, __io, __fill, __digits); }
+
+ protected:
+ /// Destructor.
+ virtual
+ ~money_put() { }
+
+ /**
+ * @brief Format and output a monetary value.
+ *
+ * This function formats @a units as a monetary value according to
+ * moneypunct and ctype facets retrieved from io.getloc(), and writes
+ * the resulting characters to @a s. For example, the value 1001 in a
+ * US locale would write "$10.01" to @a s.
+ *
+ * This function is a hook for derived classes to change the value
+ * returned. @see put().
+ *
+ * @param s The stream to write to.
+ * @param intl Parameter to use_facet<moneypunct<CharT,intl> >.
+ * @param io Source of facets and io state.
+ * @param fill char_type to use for padding.
+ * @param units Place to store result of parsing.
+ * @return Iterator after writing.
+ */
+ // XXX GLIBCXX_ABI Deprecated
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
+ virtual iter_type
+ __do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
+ double __units) const;
+#else
+ virtual iter_type
+ do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
+ long double __units) const;
+#endif
+
+ /**
+ * @brief Format and output a monetary value.
+ *
+ * This function formats @a digits as a monetary value according to
+ * moneypunct and ctype facets retrieved from io.getloc(), and writes
+ * the resulting characters to @a s. For example, the string "1001" in
+ * a US locale would write "$10.01" to @a s.
+ *
+ * This function is a hook for derived classes to change the value
+ * returned. @see put().
+ *
+ * @param s The stream to write to.
+ * @param intl Parameter to use_facet<moneypunct<CharT,intl> >.
+ * @param io Source of facets and io state.
+ * @param fill char_type to use for padding.
+ * @param units Place to store result of parsing.
+ * @return Iterator after writing.
+ */
+ virtual iter_type
+ do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
+ const string_type& __digits) const;
+
+ // XXX GLIBCXX_ABI Deprecated
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
+ virtual iter_type
+ do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
+ long double __units) const;
+#endif
+
+ template<bool _Intl>
+ iter_type
+ _M_insert(iter_type __s, ios_base& __io, char_type __fill,
+ const string_type& __digits) const;
+ };
+
+ template<typename _CharT, typename _OutIter>
+ locale::id money_put<_CharT, _OutIter>::id;
+
+_GLIBCXX_END_LDBL_NAMESPACE
+
+ /**
+ * @brief Messages facet base class providing catalog typedef.
+ */
+ struct messages_base
+ {
+ typedef int catalog;
+ };
+
+ /**
+ * @brief Facet for handling message catalogs
+ *
+ * This facet encapsulates the code to retrieve messages from
+ * message catalogs. The only thing defined by the standard for this facet
+ * is the interface. All underlying functionality is
+ * implementation-defined.
+ *
+ * This library currently implements 3 versions of the message facet. The
+ * first version (gnu) is a wrapper around gettext, provided by libintl.
+ * The second version (ieee) is a wrapper around catgets. The final
+ * version (default) does no actual translation. These implementations are
+ * only provided for char and wchar_t instantiations.
+ *
+ * The messages template uses protected virtual functions to
+ * provide the actual results. The public accessors forward the
+ * call to the virtual functions. These virtual functions are
+ * hooks for developers to implement the behavior they require from
+ * the messages facet.
+ */
+ template<typename _CharT>
+ class messages : public locale::facet, public messages_base
+ {
+ public:
+ // Types:
+ //@{
+ /// Public typedefs
+ typedef _CharT char_type;
+ typedef basic_string<_CharT> string_type;
+ //@}
+
+ protected:
+ // Underlying "C" library locale information saved from
+ // initialization, needed by messages_byname as well.
+ __c_locale _M_c_locale_messages;
+ const char* _M_name_messages;
+
+ public:
+ /// Numpunct facet id.
+ static locale::id id;
+
+ /**
+ * @brief Constructor performs initialization.
+ *
+ * This is the constructor provided by the standard.
+ *
+ * @param refs Passed to the base facet class.
+ */
+ explicit
+ messages(size_t __refs = 0);
+
+ // Non-standard.
+ /**
+ * @brief Internal constructor. Not for general use.
+ *
+ * This is a constructor for use by the library itself to set up new
+ * locales.
+ *
+ * @param cloc The "C" locale.
+ * @param s The name of a locale.
+ * @param refs Refcount to pass to the base class.
+ */
+ explicit
+ messages(__c_locale __cloc, const char* __s, size_t __refs = 0);
+
+ /*
+ * @brief Open a message catalog.
+ *
+ * This function opens and returns a handle to a message catalog by
+ * returning do_open(s, loc).
+ *
+ * @param s The catalog to open.
+ * @param loc Locale to use for character set conversions.
+ * @return Handle to the catalog or value < 0 if open fails.
+ */
+ catalog
+ open(const basic_string<char>& __s, const locale& __loc) const
+ { return this->do_open(__s, __loc); }
+
+ // Non-standard and unorthodox, yet effective.
+ /*
+ * @brief Open a message catalog.
+ *
+ * This non-standard function opens and returns a handle to a message
+ * catalog by returning do_open(s, loc). The third argument provides a
+ * message catalog root directory for gnu gettext and is ignored
+ * otherwise.
+ *
+ * @param s The catalog to open.
+ * @param loc Locale to use for character set conversions.
+ * @param dir Message catalog root directory.
+ * @return Handle to the catalog or value < 0 if open fails.
+ */
+ catalog
+ open(const basic_string<char>&, const locale&, const char*) const;
+
+ /*
+ * @brief Look up a string in a message catalog.
+ *
+ * This function retrieves and returns a message from a catalog by
+ * returning do_get(c, set, msgid, s).
+ *
+ * For gnu, @a set and @a msgid are ignored. Returns gettext(s).
+ * For default, returns s. For ieee, returns catgets(c,set,msgid,s).
+ *
+ * @param c The catalog to access.
+ * @param set Implementation-defined.
+ * @param msgid Implementation-defined.
+ * @param s Default return value if retrieval fails.
+ * @return Retrieved message or @a s if get fails.
+ */
+ string_type
+ get(catalog __c, int __set, int __msgid, const string_type& __s) const
+ { return this->do_get(__c, __set, __msgid, __s); }
+
+ /*
+ * @brief Close a message catalog.
+ *
+ * Closes catalog @a c by calling do_close(c).
+ *
+ * @param c The catalog to close.
+ */
+ void
+ close(catalog __c) const
+ { return this->do_close(__c); }
+
+ protected:
+ /// Destructor.
+ virtual
+ ~messages();
+
+ /*
+ * @brief Open a message catalog.
+ *
+ * This function opens and returns a handle to a message catalog in an
+ * implementation-defined manner. This function is a hook for derived
+ * classes to change the value returned.
+ *
+ * @param s The catalog to open.
+ * @param loc Locale to use for character set conversions.
+ * @return Handle to the opened catalog, value < 0 if open failed.
+ */
+ virtual catalog
+ do_open(const basic_string<char>&, const locale&) const;
+
+ /*
+ * @brief Look up a string in a message catalog.
+ *
+ * This function retrieves and returns a message from a catalog in an
+ * implementation-defined manner. This function is a hook for derived
+ * classes to change the value returned.
+ *
+ * For gnu, @a set and @a msgid are ignored. Returns gettext(s).
+ * For default, returns s. For ieee, returns catgets(c,set,msgid,s).
+ *
+ * @param c The catalog to access.
+ * @param set Implementation-defined.
+ * @param msgid Implementation-defined.
+ * @param s Default return value if retrieval fails.
+ * @return Retrieved message or @a s if get fails.
+ */
+ virtual string_type
+ do_get(catalog, int, int, const string_type& __dfault) const;
+
+ /*
+ * @brief Close a message catalog.
+ *
+ * @param c The catalog to close.
+ */
+ virtual void
+ do_close(catalog) const;
+
+ // Returns a locale and codeset-converted string, given a char* message.
+ char*
+ _M_convert_to_char(const string_type& __msg) const
+ {
+ // XXX
+ return reinterpret_cast<char*>(const_cast<_CharT*>(__msg.c_str()));
+ }
+
+ // Returns a locale and codeset-converted string, given a char* message.
+ string_type
+ _M_convert_from_char(char*) const
+ {
+#if 0
+ // Length of message string without terminating null.
+ size_t __len = char_traits<char>::length(__msg) - 1;
+
+ // "everybody can easily convert the string using
+ // mbsrtowcs/wcsrtombs or with iconv()"
+
+ // Convert char* to _CharT in locale used to open catalog.
+ // XXX need additional template parameter on messages class for this..
+ // typedef typename codecvt<char, _CharT, _StateT> __codecvt_type;
+ typedef typename codecvt<char, _CharT, mbstate_t> __codecvt_type;
+
+ __codecvt_type::state_type __state;
+ // XXX may need to initialize state.
+ //initialize_state(__state._M_init());
+
+ char* __from_next;
+ // XXX what size for this string?
+ _CharT* __to = static_cast<_CharT*>(__builtin_alloca(__len + 1));
+ const __codecvt_type& __cvt = use_facet<__codecvt_type>(_M_locale_conv);
+ __cvt.out(__state, __msg, __msg + __len, __from_next,
+ __to, __to + __len + 1, __to_next);
+ return string_type(__to);
+#endif
+#if 0
+ typedef ctype<_CharT> __ctype_type;
+ // const __ctype_type& __cvt = use_facet<__ctype_type>(_M_locale_msg);
+ const __ctype_type& __cvt = use_facet<__ctype_type>(locale());
+ // XXX Again, proper length of converted string an issue here.
+ // For now, assume the converted length is not larger.
+ _CharT* __dest = static_cast<_CharT*>(__builtin_alloca(__len + 1));
+ __cvt.widen(__msg, __msg + __len, __dest);
+ return basic_string<_CharT>(__dest);
+#endif
+ return string_type();
+ }
+ };
+
+ template<typename _CharT>
+ locale::id messages<_CharT>::id;
+
+ // Specializations for required instantiations.
+ template<>
+ string
+ messages<char>::do_get(catalog, int, int, const string&) const;
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template<>
+ wstring
+ messages<wchar_t>::do_get(catalog, int, int, const wstring&) const;
+#endif
+
+ /// class messages_byname [22.2.7.2].
+ template<typename _CharT>
+ class messages_byname : public messages<_CharT>
+ {
+ public:
+ typedef _CharT char_type;
+ typedef basic_string<_CharT> string_type;
+
+ explicit
+ messages_byname(const char* __s, size_t __refs = 0);
+
+ protected:
+ virtual
+ ~messages_byname()
+ { }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+// Include host and configuration specific messages functions.
+#include <bits/messages_members.h>
+
+// 22.2.1.5 Template class codecvt
+#include <bits/codecvt.h>
+
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <bits/locale_facets_nonio.tcc>
+#endif
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/bits/locale_facets_nonio.tcc b/i686-linux/include/c++/4.4.3/bits/locale_facets_nonio.tcc
new file mode 100644
index 0000000..06bbfcf
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/locale_facets_nonio.tcc
@@ -0,0 +1,1330 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file locale_facets_nonio.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _LOCALE_FACETS_NONIO_TCC
+#define _LOCALE_FACETS_NONIO_TCC 1
+
+#pragma GCC system_header
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _CharT, bool _Intl>
+ struct __use_cache<__moneypunct_cache<_CharT, _Intl> >
+ {
+ const __moneypunct_cache<_CharT, _Intl>*
+ operator() (const locale& __loc) const
+ {
+ const size_t __i = moneypunct<_CharT, _Intl>::id._M_id();
+ const locale::facet** __caches = __loc._M_impl->_M_caches;
+ if (!__caches[__i])
+ {
+ __moneypunct_cache<_CharT, _Intl>* __tmp = NULL;
+ __try
+ {
+ __tmp = new __moneypunct_cache<_CharT, _Intl>;
+ __tmp->_M_cache(__loc);
+ }
+ __catch(...)
+ {
+ delete __tmp;
+ __throw_exception_again;
+ }
+ __loc._M_impl->_M_install_cache(__tmp, __i);
+ }
+ return static_cast<
+ const __moneypunct_cache<_CharT, _Intl>*>(__caches[__i]);
+ }
+ };
+
+ template<typename _CharT, bool _Intl>
+ void
+ __moneypunct_cache<_CharT, _Intl>::_M_cache(const locale& __loc)
+ {
+ _M_allocated = true;
+
+ const moneypunct<_CharT, _Intl>& __mp =
+ use_facet<moneypunct<_CharT, _Intl> >(__loc);
+
+ _M_grouping_size = __mp.grouping().size();
+ char* __grouping = new char[_M_grouping_size];
+ __mp.grouping().copy(__grouping, _M_grouping_size);
+ _M_grouping = __grouping;
+ _M_use_grouping = (_M_grouping_size
+ && static_cast<signed char>(_M_grouping[0]) > 0
+ && (_M_grouping[0]
+ != __gnu_cxx::__numeric_traits<char>::__max));
+
+ _M_decimal_point = __mp.decimal_point();
+ _M_thousands_sep = __mp.thousands_sep();
+ _M_frac_digits = __mp.frac_digits();
+
+ _M_curr_symbol_size = __mp.curr_symbol().size();
+ _CharT* __curr_symbol = new _CharT[_M_curr_symbol_size];
+ __mp.curr_symbol().copy(__curr_symbol, _M_curr_symbol_size);
+ _M_curr_symbol = __curr_symbol;
+
+ _M_positive_sign_size = __mp.positive_sign().size();
+ _CharT* __positive_sign = new _CharT[_M_positive_sign_size];
+ __mp.positive_sign().copy(__positive_sign, _M_positive_sign_size);
+ _M_positive_sign = __positive_sign;
+
+ _M_negative_sign_size = __mp.negative_sign().size();
+ _CharT* __negative_sign = new _CharT[_M_negative_sign_size];
+ __mp.negative_sign().copy(__negative_sign, _M_negative_sign_size);
+ _M_negative_sign = __negative_sign;
+
+ _M_pos_format = __mp.pos_format();
+ _M_neg_format = __mp.neg_format();
+
+ const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__loc);
+ __ct.widen(money_base::_S_atoms,
+ money_base::_S_atoms + money_base::_S_end, _M_atoms);
+ }
+
+_GLIBCXX_BEGIN_LDBL_NAMESPACE
+
+ template<typename _CharT, typename _InIter>
+ template<bool _Intl>
+ _InIter
+ money_get<_CharT, _InIter>::
+ _M_extract(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, string& __units) const
+ {
+ typedef char_traits<_CharT> __traits_type;
+ typedef typename string_type::size_type size_type;
+ typedef money_base::part part;
+ typedef __moneypunct_cache<_CharT, _Intl> __cache_type;
+
+ const locale& __loc = __io._M_getloc();
+ const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+
+ __use_cache<__cache_type> __uc;
+ const __cache_type* __lc = __uc(__loc);
+ const char_type* __lit = __lc->_M_atoms;
+
+ // Deduced sign.
+ bool __negative = false;
+ // Sign size.
+ size_type __sign_size = 0;
+ // True if sign is mandatory.
+ const bool __mandatory_sign = (__lc->_M_positive_sign_size
+ && __lc->_M_negative_sign_size);
+ // String of grouping info from thousands_sep plucked from __units.
+ string __grouping_tmp;
+ if (__lc->_M_use_grouping)
+ __grouping_tmp.reserve(32);
+ // Last position before the decimal point.
+ int __last_pos = 0;
+ // Separator positions, then, possibly, fractional digits.
+ int __n = 0;
+ // If input iterator is in a valid state.
+ bool __testvalid = true;
+ // Flag marking when a decimal point is found.
+ bool __testdecfound = false;
+
+ // The tentative returned string is stored here.
+ string __res;
+ __res.reserve(32);
+
+ const char_type* __lit_zero = __lit + money_base::_S_zero;
+ const money_base::pattern __p = __lc->_M_neg_format;
+ for (int __i = 0; __i < 4 && __testvalid; ++__i)
+ {
+ const part __which = static_cast<part>(__p.field[__i]);
+ switch (__which)
+ {
+ case money_base::symbol:
+ // According to 22.2.6.1.2, p2, symbol is required
+ // if (__io.flags() & ios_base::showbase), otherwise
+ // is optional and consumed only if other characters
+ // are needed to complete the format.
+ if (__io.flags() & ios_base::showbase || __sign_size > 1
+ || __i == 0
+ || (__i == 1 && (__mandatory_sign
+ || (static_cast<part>(__p.field[0])
+ == money_base::sign)
+ || (static_cast<part>(__p.field[2])
+ == money_base::space)))
+ || (__i == 2 && ((static_cast<part>(__p.field[3])
+ == money_base::value)
+ || (__mandatory_sign
+ && (static_cast<part>(__p.field[3])
+ == money_base::sign)))))
+ {
+ const size_type __len = __lc->_M_curr_symbol_size;
+ size_type __j = 0;
+ for (; __beg != __end && __j < __len
+ && *__beg == __lc->_M_curr_symbol[__j];
+ ++__beg, ++__j);
+ if (__j != __len
+ && (__j || __io.flags() & ios_base::showbase))
+ __testvalid = false;
+ }
+ break;
+ case money_base::sign:
+ // Sign might not exist, or be more than one character long.
+ if (__lc->_M_positive_sign_size && __beg != __end
+ && *__beg == __lc->_M_positive_sign[0])
+ {
+ __sign_size = __lc->_M_positive_sign_size;
+ ++__beg;
+ }
+ else if (__lc->_M_negative_sign_size && __beg != __end
+ && *__beg == __lc->_M_negative_sign[0])
+ {
+ __negative = true;
+ __sign_size = __lc->_M_negative_sign_size;
+ ++__beg;
+ }
+ else if (__lc->_M_positive_sign_size
+ && !__lc->_M_negative_sign_size)
+ // "... if no sign is detected, the result is given the sign
+ // that corresponds to the source of the empty string"
+ __negative = true;
+ else if (__mandatory_sign)
+ __testvalid = false;
+ break;
+ case money_base::value:
+ // Extract digits, remove and stash away the
+ // grouping of found thousands separators.
+ for (; __beg != __end; ++__beg)
+ {
+ const char_type __c = *__beg;
+ const char_type* __q = __traits_type::find(__lit_zero,
+ 10, __c);
+ if (__q != 0)
+ {
+ __res += money_base::_S_atoms[__q - __lit];
+ ++__n;
+ }
+ else if (__c == __lc->_M_decimal_point
+ && !__testdecfound)
+ {
+ if (__lc->_M_frac_digits <= 0)
+ break;
+
+ __last_pos = __n;
+ __n = 0;
+ __testdecfound = true;
+ }
+ else if (__lc->_M_use_grouping
+ && __c == __lc->_M_thousands_sep
+ && !__testdecfound)
+ {
+ if (__n)
+ {
+ // Mark position for later analysis.
+ __grouping_tmp += static_cast<char>(__n);
+ __n = 0;
+ }
+ else
+ {
+ __testvalid = false;
+ break;
+ }
+ }
+ else
+ break;
+ }
+ if (__res.empty())
+ __testvalid = false;
+ break;
+ case money_base::space:
+ // At least one space is required.
+ if (__beg != __end && __ctype.is(ctype_base::space, *__beg))
+ ++__beg;
+ else
+ __testvalid = false;
+ case money_base::none:
+ // Only if not at the end of the pattern.
+ if (__i != 3)
+ for (; __beg != __end
+ && __ctype.is(ctype_base::space, *__beg); ++__beg);
+ break;
+ }
+ }
+
+ // Need to get the rest of the sign characters, if they exist.
+ if (__sign_size > 1 && __testvalid)
+ {
+ const char_type* __sign = __negative ? __lc->_M_negative_sign
+ : __lc->_M_positive_sign;
+ size_type __i = 1;
+ for (; __beg != __end && __i < __sign_size
+ && *__beg == __sign[__i]; ++__beg, ++__i);
+
+ if (__i != __sign_size)
+ __testvalid = false;
+ }
+
+ if (__testvalid)
+ {
+ // Strip leading zeros.
+ if (__res.size() > 1)
+ {
+ const size_type __first = __res.find_first_not_of('0');
+ const bool __only_zeros = __first == string::npos;
+ if (__first)
+ __res.erase(0, __only_zeros ? __res.size() - 1 : __first);
+ }
+
+ // 22.2.6.1.2, p4
+ if (__negative && __res[0] != '0')
+ __res.insert(__res.begin(), '-');
+
+ // Test for grouping fidelity.
+ if (__grouping_tmp.size())
+ {
+ // Add the ending grouping.
+ __grouping_tmp += static_cast<char>(__testdecfound ? __last_pos
+ : __n);
+ if (!std::__verify_grouping(__lc->_M_grouping,
+ __lc->_M_grouping_size,
+ __grouping_tmp))
+ __err |= ios_base::failbit;
+ }
+
+ // Iff not enough digits were supplied after the decimal-point.
+ if (__testdecfound && __n != __lc->_M_frac_digits)
+ __testvalid = false;
+ }
+
+ // Iff valid sequence is not recognized.
+ if (!__testvalid)
+ __err |= ios_base::failbit;
+ else
+ __units.swap(__res);
+
+ // Iff no more characters are available.
+ if (__beg == __end)
+ __err |= ios_base::eofbit;
+ return __beg;
+ }
+
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
+ template<typename _CharT, typename _InIter>
+ _InIter
+ money_get<_CharT, _InIter>::
+ __do_get(iter_type __beg, iter_type __end, bool __intl, ios_base& __io,
+ ios_base::iostate& __err, double& __units) const
+ {
+ string __str;
+ __beg = __intl ? _M_extract<true>(__beg, __end, __io, __err, __str)
+ : _M_extract<false>(__beg, __end, __io, __err, __str);
+ std::__convert_to_v(__str.c_str(), __units, __err, _S_get_c_locale());
+ return __beg;
+ }
+#endif
+
+ template<typename _CharT, typename _InIter>
+ _InIter
+ money_get<_CharT, _InIter>::
+ do_get(iter_type __beg, iter_type __end, bool __intl, ios_base& __io,
+ ios_base::iostate& __err, long double& __units) const
+ {
+ string __str;
+ __beg = __intl ? _M_extract<true>(__beg, __end, __io, __err, __str)
+ : _M_extract<false>(__beg, __end, __io, __err, __str);
+ std::__convert_to_v(__str.c_str(), __units, __err, _S_get_c_locale());
+ return __beg;
+ }
+
+ template<typename _CharT, typename _InIter>
+ _InIter
+ money_get<_CharT, _InIter>::
+ do_get(iter_type __beg, iter_type __end, bool __intl, ios_base& __io,
+ ios_base::iostate& __err, string_type& __digits) const
+ {
+ typedef typename string::size_type size_type;
+
+ const locale& __loc = __io._M_getloc();
+ const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+
+ string __str;
+ __beg = __intl ? _M_extract<true>(__beg, __end, __io, __err, __str)
+ : _M_extract<false>(__beg, __end, __io, __err, __str);
+ const size_type __len = __str.size();
+ if (__len)
+ {
+ __digits.resize(__len);
+ __ctype.widen(__str.data(), __str.data() + __len, &__digits[0]);
+ }
+ return __beg;
+ }
+
+ template<typename _CharT, typename _OutIter>
+ template<bool _Intl>
+ _OutIter
+ money_put<_CharT, _OutIter>::
+ _M_insert(iter_type __s, ios_base& __io, char_type __fill,
+ const string_type& __digits) const
+ {
+ typedef typename string_type::size_type size_type;
+ typedef money_base::part part;
+ typedef __moneypunct_cache<_CharT, _Intl> __cache_type;
+
+ const locale& __loc = __io._M_getloc();
+ const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+
+ __use_cache<__cache_type> __uc;
+ const __cache_type* __lc = __uc(__loc);
+ const char_type* __lit = __lc->_M_atoms;
+
+ // Determine if negative or positive formats are to be used, and
+ // discard leading negative_sign if it is present.
+ const char_type* __beg = __digits.data();
+
+ money_base::pattern __p;
+ const char_type* __sign;
+ size_type __sign_size;
+ if (!(*__beg == __lit[money_base::_S_minus]))
+ {
+ __p = __lc->_M_pos_format;
+ __sign = __lc->_M_positive_sign;
+ __sign_size = __lc->_M_positive_sign_size;
+ }
+ else
+ {
+ __p = __lc->_M_neg_format;
+ __sign = __lc->_M_negative_sign;
+ __sign_size = __lc->_M_negative_sign_size;
+ if (__digits.size())
+ ++__beg;
+ }
+
+ // Look for valid numbers in the ctype facet within input digits.
+ size_type __len = __ctype.scan_not(ctype_base::digit, __beg,
+ __beg + __digits.size()) - __beg;
+ if (__len)
+ {
+ // Assume valid input, and attempt to format.
+ // Break down input numbers into base components, as follows:
+ // final_value = grouped units + (decimal point) + (digits)
+ string_type __value;
+ __value.reserve(2 * __len);
+
+ // Add thousands separators to non-decimal digits, per
+ // grouping rules.
+ long __paddec = __len - __lc->_M_frac_digits;
+ if (__paddec > 0)
+ {
+ if (__lc->_M_frac_digits < 0)
+ __paddec = __len;
+ if (__lc->_M_grouping_size)
+ {
+ __value.assign(2 * __paddec, char_type());
+ _CharT* __vend =
+ std::__add_grouping(&__value[0], __lc->_M_thousands_sep,
+ __lc->_M_grouping,
+ __lc->_M_grouping_size,
+ __beg, __beg + __paddec);
+ __value.erase(__vend - &__value[0]);
+ }
+ else
+ __value.assign(__beg, __paddec);
+ }
+
+ // Deal with decimal point, decimal digits.
+ if (__lc->_M_frac_digits > 0)
+ {
+ __value += __lc->_M_decimal_point;
+ if (__paddec >= 0)
+ __value.append(__beg + __paddec, __lc->_M_frac_digits);
+ else
+ {
+ // Have to pad zeros in the decimal position.
+ __value.append(-__paddec, __lit[money_base::_S_zero]);
+ __value.append(__beg, __len);
+ }
+ }
+
+ // Calculate length of resulting string.
+ const ios_base::fmtflags __f = __io.flags()
+ & ios_base::adjustfield;
+ __len = __value.size() + __sign_size;
+ __len += ((__io.flags() & ios_base::showbase)
+ ? __lc->_M_curr_symbol_size : 0);
+
+ string_type __res;
+ __res.reserve(2 * __len);
+
+ const size_type __width = static_cast<size_type>(__io.width());
+ const bool __testipad = (__f == ios_base::internal
+ && __len < __width);
+ // Fit formatted digits into the required pattern.
+ for (int __i = 0; __i < 4; ++__i)
+ {
+ const part __which = static_cast<part>(__p.field[__i]);
+ switch (__which)
+ {
+ case money_base::symbol:
+ if (__io.flags() & ios_base::showbase)
+ __res.append(__lc->_M_curr_symbol,
+ __lc->_M_curr_symbol_size);
+ break;
+ case money_base::sign:
+ // Sign might not exist, or be more than one
+ // character long. In that case, add in the rest
+ // below.
+ if (__sign_size)
+ __res += __sign[0];
+ break;
+ case money_base::value:
+ __res += __value;
+ break;
+ case money_base::space:
+ // At least one space is required, but if internal
+ // formatting is required, an arbitrary number of
+ // fill spaces will be necessary.
+ if (__testipad)
+ __res.append(__width - __len, __fill);
+ else
+ __res += __fill;
+ break;
+ case money_base::none:
+ if (__testipad)
+ __res.append(__width - __len, __fill);
+ break;
+ }
+ }
+
+ // Special case of multi-part sign parts.
+ if (__sign_size > 1)
+ __res.append(__sign + 1, __sign_size - 1);
+
+ // Pad, if still necessary.
+ __len = __res.size();
+ if (__width > __len)
+ {
+ if (__f == ios_base::left)
+ // After.
+ __res.append(__width - __len, __fill);
+ else
+ // Before.
+ __res.insert(0, __width - __len, __fill);
+ __len = __width;
+ }
+
+ // Write resulting, fully-formatted string to output iterator.
+ __s = std::__write(__s, __res.data(), __len);
+ }
+ __io.width(0);
+ return __s;
+ }
+
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
+ template<typename _CharT, typename _OutIter>
+ _OutIter
+ money_put<_CharT, _OutIter>::
+ __do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
+ double __units) const
+ { return this->do_put(__s, __intl, __io, __fill, (long double) __units); }
+#endif
+
+ template<typename _CharT, typename _OutIter>
+ _OutIter
+ money_put<_CharT, _OutIter>::
+ do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
+ long double __units) const
+ {
+ const locale __loc = __io.getloc();
+ const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+#ifdef _GLIBCXX_USE_C99
+ // First try a buffer perhaps big enough.
+ int __cs_size = 64;
+ char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 328. Bad sprintf format modifier in money_put<>::do_put()
+ int __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size,
+ "%.*Lf", 0, __units);
+ // If the buffer was not large enough, try again with the correct size.
+ if (__len >= __cs_size)
+ {
+ __cs_size = __len + 1;
+ __cs = static_cast<char*>(__builtin_alloca(__cs_size));
+ __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size,
+ "%.*Lf", 0, __units);
+ }
+#else
+ // max_exponent10 + 1 for the integer part, + 2 for sign and '\0'.
+ const int __cs_size =
+ __gnu_cxx::__numeric_traits<long double>::__max_exponent10 + 3;
+ char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
+ int __len = std::__convert_from_v(_S_get_c_locale(), __cs, 0, "%.*Lf",
+ 0, __units);
+#endif
+ string_type __digits(__len, char_type());
+ __ctype.widen(__cs, __cs + __len, &__digits[0]);
+ return __intl ? _M_insert<true>(__s, __io, __fill, __digits)
+ : _M_insert<false>(__s, __io, __fill, __digits);
+ }
+
+ template<typename _CharT, typename _OutIter>
+ _OutIter
+ money_put<_CharT, _OutIter>::
+ do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
+ const string_type& __digits) const
+ { return __intl ? _M_insert<true>(__s, __io, __fill, __digits)
+ : _M_insert<false>(__s, __io, __fill, __digits); }
+
+_GLIBCXX_END_LDBL_NAMESPACE
+
+ // NB: Not especially useful. Without an ios_base object or some
+ // kind of locale reference, we are left clawing at the air where
+ // the side of the mountain used to be...
+ template<typename _CharT, typename _InIter>
+ time_base::dateorder
+ time_get<_CharT, _InIter>::do_date_order() const
+ { return time_base::no_order; }
+
+ // Expand a strftime format string and parse it. E.g., do_get_date() may
+ // pass %m/%d/%Y => extracted characters.
+ template<typename _CharT, typename _InIter>
+ _InIter
+ time_get<_CharT, _InIter>::
+ _M_extract_via_format(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, tm* __tm,
+ const _CharT* __format) const
+ {
+ const locale& __loc = __io._M_getloc();
+ const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc);
+ const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+ const size_t __len = char_traits<_CharT>::length(__format);
+
+ ios_base::iostate __tmperr = ios_base::goodbit;
+ for (size_t __i = 0; __beg != __end && __i < __len && !__tmperr; ++__i)
+ {
+ if (__ctype.narrow(__format[__i], 0) == '%')
+ {
+ // Verify valid formatting code, attempt to extract.
+ char __c = __ctype.narrow(__format[++__i], 0);
+ int __mem = 0;
+ if (__c == 'E' || __c == 'O')
+ __c = __ctype.narrow(__format[++__i], 0);
+ switch (__c)
+ {
+ const char* __cs;
+ _CharT __wcs[10];
+ case 'a':
+ // Abbreviated weekday name [tm_wday]
+ const char_type* __days1[7];
+ __tp._M_days_abbreviated(__days1);
+ __beg = _M_extract_name(__beg, __end, __tm->tm_wday, __days1,
+ 7, __io, __tmperr);
+ break;
+ case 'A':
+ // Weekday name [tm_wday].
+ const char_type* __days2[7];
+ __tp._M_days(__days2);
+ __beg = _M_extract_name(__beg, __end, __tm->tm_wday, __days2,
+ 7, __io, __tmperr);
+ break;
+ case 'h':
+ case 'b':
+ // Abbreviated month name [tm_mon]
+ const char_type* __months1[12];
+ __tp._M_months_abbreviated(__months1);
+ __beg = _M_extract_name(__beg, __end, __tm->tm_mon,
+ __months1, 12, __io, __tmperr);
+ break;
+ case 'B':
+ // Month name [tm_mon].
+ const char_type* __months2[12];
+ __tp._M_months(__months2);
+ __beg = _M_extract_name(__beg, __end, __tm->tm_mon,
+ __months2, 12, __io, __tmperr);
+ break;
+ case 'c':
+ // Default time and date representation.
+ const char_type* __dt[2];
+ __tp._M_date_time_formats(__dt);
+ __beg = _M_extract_via_format(__beg, __end, __io, __tmperr,
+ __tm, __dt[0]);
+ break;
+ case 'd':
+ // Day [01, 31]. [tm_mday]
+ __beg = _M_extract_num(__beg, __end, __tm->tm_mday, 1, 31, 2,
+ __io, __tmperr);
+ break;
+ case 'e':
+ // Day [1, 31], with single digits preceded by
+ // space. [tm_mday]
+ if (__ctype.is(ctype_base::space, *__beg))
+ __beg = _M_extract_num(++__beg, __end, __tm->tm_mday, 1, 9,
+ 1, __io, __tmperr);
+ else
+ __beg = _M_extract_num(__beg, __end, __tm->tm_mday, 10, 31,
+ 2, __io, __tmperr);
+ break;
+ case 'D':
+ // Equivalent to %m/%d/%y.[tm_mon, tm_mday, tm_year]
+ __cs = "%m/%d/%y";
+ __ctype.widen(__cs, __cs + 9, __wcs);
+ __beg = _M_extract_via_format(__beg, __end, __io, __tmperr,
+ __tm, __wcs);
+ break;
+ case 'H':
+ // Hour [00, 23]. [tm_hour]
+ __beg = _M_extract_num(__beg, __end, __tm->tm_hour, 0, 23, 2,
+ __io, __tmperr);
+ break;
+ case 'I':
+ // Hour [01, 12]. [tm_hour]
+ __beg = _M_extract_num(__beg, __end, __tm->tm_hour, 1, 12, 2,
+ __io, __tmperr);
+ break;
+ case 'm':
+ // Month [01, 12]. [tm_mon]
+ __beg = _M_extract_num(__beg, __end, __mem, 1, 12, 2,
+ __io, __tmperr);
+ if (!__tmperr)
+ __tm->tm_mon = __mem - 1;
+ break;
+ case 'M':
+ // Minute [00, 59]. [tm_min]
+ __beg = _M_extract_num(__beg, __end, __tm->tm_min, 0, 59, 2,
+ __io, __tmperr);
+ break;
+ case 'n':
+ if (__ctype.narrow(*__beg, 0) == '\n')
+ ++__beg;
+ else
+ __tmperr |= ios_base::failbit;
+ break;
+ case 'R':
+ // Equivalent to (%H:%M).
+ __cs = "%H:%M";
+ __ctype.widen(__cs, __cs + 6, __wcs);
+ __beg = _M_extract_via_format(__beg, __end, __io, __tmperr,
+ __tm, __wcs);
+ break;
+ case 'S':
+ // Seconds. [tm_sec]
+ // [00, 60] in C99 (one leap-second), [00, 61] in C89.
+#ifdef _GLIBCXX_USE_C99
+ __beg = _M_extract_num(__beg, __end, __tm->tm_sec, 0, 60, 2,
+#else
+ __beg = _M_extract_num(__beg, __end, __tm->tm_sec, 0, 61, 2,
+#endif
+ __io, __tmperr);
+ break;
+ case 't':
+ if (__ctype.narrow(*__beg, 0) == '\t')
+ ++__beg;
+ else
+ __tmperr |= ios_base::failbit;
+ break;
+ case 'T':
+ // Equivalent to (%H:%M:%S).
+ __cs = "%H:%M:%S";
+ __ctype.widen(__cs, __cs + 9, __wcs);
+ __beg = _M_extract_via_format(__beg, __end, __io, __tmperr,
+ __tm, __wcs);
+ break;
+ case 'x':
+ // Locale's date.
+ const char_type* __dates[2];
+ __tp._M_date_formats(__dates);
+ __beg = _M_extract_via_format(__beg, __end, __io, __tmperr,
+ __tm, __dates[0]);
+ break;
+ case 'X':
+ // Locale's time.
+ const char_type* __times[2];
+ __tp._M_time_formats(__times);
+ __beg = _M_extract_via_format(__beg, __end, __io, __tmperr,
+ __tm, __times[0]);
+ break;
+ case 'y':
+ case 'C': // C99
+ // Two digit year. [tm_year]
+ __beg = _M_extract_num(__beg, __end, __tm->tm_year, 0, 99, 2,
+ __io, __tmperr);
+ break;
+ case 'Y':
+ // Year [1900). [tm_year]
+ __beg = _M_extract_num(__beg, __end, __mem, 0, 9999, 4,
+ __io, __tmperr);
+ if (!__tmperr)
+ __tm->tm_year = __mem - 1900;
+ break;
+ case 'Z':
+ // Timezone info.
+ if (__ctype.is(ctype_base::upper, *__beg))
+ {
+ int __tmp;
+ __beg = _M_extract_name(__beg, __end, __tmp,
+ __timepunct_cache<_CharT>::_S_timezones,
+ 14, __io, __tmperr);
+
+ // GMT requires special effort.
+ if (__beg != __end && !__tmperr && __tmp == 0
+ && (*__beg == __ctype.widen('-')
+ || *__beg == __ctype.widen('+')))
+ {
+ __beg = _M_extract_num(__beg, __end, __tmp, 0, 23, 2,
+ __io, __tmperr);
+ __beg = _M_extract_num(__beg, __end, __tmp, 0, 59, 2,
+ __io, __tmperr);
+ }
+ }
+ else
+ __tmperr |= ios_base::failbit;
+ break;
+ default:
+ // Not recognized.
+ __tmperr |= ios_base::failbit;
+ }
+ }
+ else
+ {
+ // Verify format and input match, extract and discard.
+ if (__format[__i] == *__beg)
+ ++__beg;
+ else
+ __tmperr |= ios_base::failbit;
+ }
+ }
+
+ if (__tmperr)
+ __err |= ios_base::failbit;
+
+ return __beg;
+ }
+
+ template<typename _CharT, typename _InIter>
+ _InIter
+ time_get<_CharT, _InIter>::
+ _M_extract_num(iter_type __beg, iter_type __end, int& __member,
+ int __min, int __max, size_t __len,
+ ios_base& __io, ios_base::iostate& __err) const
+ {
+ const locale& __loc = __io._M_getloc();
+ const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+
+ // As-is works for __len = 1, 2, 4, the values actually used.
+ int __mult = __len == 2 ? 10 : (__len == 4 ? 1000 : 1);
+
+ ++__min;
+ size_t __i = 0;
+ int __value = 0;
+ for (; __beg != __end && __i < __len; ++__beg, ++__i)
+ {
+ const char __c = __ctype.narrow(*__beg, '*');
+ if (__c >= '0' && __c <= '9')
+ {
+ __value = __value * 10 + (__c - '0');
+ const int __valuec = __value * __mult;
+ if (__valuec > __max || __valuec + __mult < __min)
+ break;
+ __mult /= 10;
+ }
+ else
+ break;
+ }
+ if (__i == __len)
+ __member = __value;
+ else
+ __err |= ios_base::failbit;
+
+ return __beg;
+ }
+
+ // Assumptions:
+ // All elements in __names are unique.
+ template<typename _CharT, typename _InIter>
+ _InIter
+ time_get<_CharT, _InIter>::
+ _M_extract_name(iter_type __beg, iter_type __end, int& __member,
+ const _CharT** __names, size_t __indexlen,
+ ios_base& __io, ios_base::iostate& __err) const
+ {
+ typedef char_traits<_CharT> __traits_type;
+ const locale& __loc = __io._M_getloc();
+ const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+
+ int* __matches = static_cast<int*>(__builtin_alloca(sizeof(int)
+ * __indexlen));
+ size_t __nmatches = 0;
+ size_t __pos = 0;
+ bool __testvalid = true;
+ const char_type* __name;
+
+ // Look for initial matches.
+ // NB: Some of the locale data is in the form of all lowercase
+ // names, and some is in the form of initially-capitalized
+ // names. Look for both.
+ if (__beg != __end)
+ {
+ const char_type __c = *__beg;
+ for (size_t __i1 = 0; __i1 < __indexlen; ++__i1)
+ if (__c == __names[__i1][0]
+ || __c == __ctype.toupper(__names[__i1][0]))
+ __matches[__nmatches++] = __i1;
+ }
+
+ while (__nmatches > 1)
+ {
+ // Find smallest matching string.
+ size_t __minlen = __traits_type::length(__names[__matches[0]]);
+ for (size_t __i2 = 1; __i2 < __nmatches; ++__i2)
+ __minlen = std::min(__minlen,
+ __traits_type::length(__names[__matches[__i2]]));
+ ++__beg, ++__pos;
+ if (__pos < __minlen && __beg != __end)
+ for (size_t __i3 = 0; __i3 < __nmatches;)
+ {
+ __name = __names[__matches[__i3]];
+ if (!(__name[__pos] == *__beg))
+ __matches[__i3] = __matches[--__nmatches];
+ else
+ ++__i3;
+ }
+ else
+ break;
+ }
+
+ if (__nmatches == 1)
+ {
+ // Make sure found name is completely extracted.
+ ++__beg, ++__pos;
+ __name = __names[__matches[0]];
+ const size_t __len = __traits_type::length(__name);
+ while (__pos < __len && __beg != __end && __name[__pos] == *__beg)
+ ++__beg, ++__pos;
+
+ if (__len == __pos)
+ __member = __matches[0];
+ else
+ __testvalid = false;
+ }
+ else
+ __testvalid = false;
+ if (!__testvalid)
+ __err |= ios_base::failbit;
+
+ return __beg;
+ }
+
+ template<typename _CharT, typename _InIter>
+ _InIter
+ time_get<_CharT, _InIter>::
+ do_get_time(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, tm* __tm) const
+ {
+ const locale& __loc = __io._M_getloc();
+ const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc);
+ const char_type* __times[2];
+ __tp._M_time_formats(__times);
+ __beg = _M_extract_via_format(__beg, __end, __io, __err,
+ __tm, __times[0]);
+ if (__beg == __end)
+ __err |= ios_base::eofbit;
+ return __beg;
+ }
+
+ template<typename _CharT, typename _InIter>
+ _InIter
+ time_get<_CharT, _InIter>::
+ do_get_date(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, tm* __tm) const
+ {
+ const locale& __loc = __io._M_getloc();
+ const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc);
+ const char_type* __dates[2];
+ __tp._M_date_formats(__dates);
+ __beg = _M_extract_via_format(__beg, __end, __io, __err,
+ __tm, __dates[0]);
+ if (__beg == __end)
+ __err |= ios_base::eofbit;
+ return __beg;
+ }
+
+ template<typename _CharT, typename _InIter>
+ _InIter
+ time_get<_CharT, _InIter>::
+ do_get_weekday(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, tm* __tm) const
+ {
+ typedef char_traits<_CharT> __traits_type;
+ const locale& __loc = __io._M_getloc();
+ const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc);
+ const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+ const char_type* __days[7];
+ __tp._M_days_abbreviated(__days);
+ int __tmpwday;
+ ios_base::iostate __tmperr = ios_base::goodbit;
+ __beg = _M_extract_name(__beg, __end, __tmpwday, __days, 7,
+ __io, __tmperr);
+
+ // Check to see if non-abbreviated name exists, and extract.
+ // NB: Assumes both _M_days and _M_days_abbreviated organized in
+ // exact same order, first to last, such that the resulting
+ // __days array with the same index points to a day, and that
+ // day's abbreviated form.
+ // NB: Also assumes that an abbreviated name is a subset of the name.
+ if (!__tmperr && __beg != __end)
+ {
+ size_t __pos = __traits_type::length(__days[__tmpwday]);
+ __tp._M_days(__days);
+ const char_type* __name = __days[__tmpwday];
+ if (__name[__pos] == *__beg)
+ {
+ // Extract the rest of it.
+ const size_t __len = __traits_type::length(__name);
+ while (__pos < __len && __beg != __end
+ && __name[__pos] == *__beg)
+ ++__beg, ++__pos;
+ if (__len != __pos)
+ __tmperr |= ios_base::failbit;
+ }
+ }
+ if (!__tmperr)
+ __tm->tm_wday = __tmpwday;
+ else
+ __err |= ios_base::failbit;
+
+ if (__beg == __end)
+ __err |= ios_base::eofbit;
+ return __beg;
+ }
+
+ template<typename _CharT, typename _InIter>
+ _InIter
+ time_get<_CharT, _InIter>::
+ do_get_monthname(iter_type __beg, iter_type __end,
+ ios_base& __io, ios_base::iostate& __err, tm* __tm) const
+ {
+ typedef char_traits<_CharT> __traits_type;
+ const locale& __loc = __io._M_getloc();
+ const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc);
+ const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+ const char_type* __months[12];
+ __tp._M_months_abbreviated(__months);
+ int __tmpmon;
+ ios_base::iostate __tmperr = ios_base::goodbit;
+ __beg = _M_extract_name(__beg, __end, __tmpmon, __months, 12,
+ __io, __tmperr);
+
+ // Check to see if non-abbreviated name exists, and extract.
+ // NB: Assumes both _M_months and _M_months_abbreviated organized in
+ // exact same order, first to last, such that the resulting
+ // __months array with the same index points to a month, and that
+ // month's abbreviated form.
+ // NB: Also assumes that an abbreviated name is a subset of the name.
+ if (!__tmperr && __beg != __end)
+ {
+ size_t __pos = __traits_type::length(__months[__tmpmon]);
+ __tp._M_months(__months);
+ const char_type* __name = __months[__tmpmon];
+ if (__name[__pos] == *__beg)
+ {
+ // Extract the rest of it.
+ const size_t __len = __traits_type::length(__name);
+ while (__pos < __len && __beg != __end
+ && __name[__pos] == *__beg)
+ ++__beg, ++__pos;
+ if (__len != __pos)
+ __tmperr |= ios_base::failbit;
+ }
+ }
+ if (!__tmperr)
+ __tm->tm_mon = __tmpmon;
+ else
+ __err |= ios_base::failbit;
+
+ if (__beg == __end)
+ __err |= ios_base::eofbit;
+ return __beg;
+ }
+
+ template<typename _CharT, typename _InIter>
+ _InIter
+ time_get<_CharT, _InIter>::
+ do_get_year(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, tm* __tm) const
+ {
+ const locale& __loc = __io._M_getloc();
+ const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+
+ size_t __i = 0;
+ int __value = 0;
+ for (; __beg != __end && __i < 4; ++__beg, ++__i)
+ {
+ const char __c = __ctype.narrow(*__beg, '*');
+ if (__c >= '0' && __c <= '9')
+ __value = __value * 10 + (__c - '0');
+ else
+ break;
+ }
+ if (__i == 2 || __i == 4)
+ __tm->tm_year = __i == 2 ? __value : __value - 1900;
+ else
+ __err |= ios_base::failbit;
+
+ if (__beg == __end)
+ __err |= ios_base::eofbit;
+ return __beg;
+ }
+
+ template<typename _CharT, typename _OutIter>
+ _OutIter
+ time_put<_CharT, _OutIter>::
+ put(iter_type __s, ios_base& __io, char_type __fill, const tm* __tm,
+ const _CharT* __beg, const _CharT* __end) const
+ {
+ const locale& __loc = __io._M_getloc();
+ ctype<_CharT> const& __ctype = use_facet<ctype<_CharT> >(__loc);
+ for (; __beg != __end; ++__beg)
+ if (__ctype.narrow(*__beg, 0) != '%')
+ {
+ *__s = *__beg;
+ ++__s;
+ }
+ else if (++__beg != __end)
+ {
+ char __format;
+ char __mod = 0;
+ const char __c = __ctype.narrow(*__beg, 0);
+ if (__c != 'E' && __c != 'O')
+ __format = __c;
+ else if (++__beg != __end)
+ {
+ __mod = __c;
+ __format = __ctype.narrow(*__beg, 0);
+ }
+ else
+ break;
+ __s = this->do_put(__s, __io, __fill, __tm, __format, __mod);
+ }
+ else
+ break;
+ return __s;
+ }
+
+ template<typename _CharT, typename _OutIter>
+ _OutIter
+ time_put<_CharT, _OutIter>::
+ do_put(iter_type __s, ios_base& __io, char_type, const tm* __tm,
+ char __format, char __mod) const
+ {
+ const locale& __loc = __io._M_getloc();
+ ctype<_CharT> const& __ctype = use_facet<ctype<_CharT> >(__loc);
+ __timepunct<_CharT> const& __tp = use_facet<__timepunct<_CharT> >(__loc);
+
+ // NB: This size is arbitrary. Should this be a data member,
+ // initialized at construction?
+ const size_t __maxlen = 128;
+ char_type* __res =
+ static_cast<char_type*>(__builtin_alloca(sizeof(char_type) * __maxlen));
+
+ // NB: In IEE 1003.1-200x, and perhaps other locale models, it
+ // is possible that the format character will be longer than one
+ // character. Possibilities include 'E' or 'O' followed by a
+ // format character: if __mod is not the default argument, assume
+ // it's a valid modifier.
+ char_type __fmt[4];
+ __fmt[0] = __ctype.widen('%');
+ if (!__mod)
+ {
+ __fmt[1] = __format;
+ __fmt[2] = char_type();
+ }
+ else
+ {
+ __fmt[1] = __mod;
+ __fmt[2] = __format;
+ __fmt[3] = char_type();
+ }
+
+ __tp._M_put(__res, __maxlen, __fmt, __tm);
+
+ // Write resulting, fully-formatted string to output iterator.
+ return std::__write(__s, __res, char_traits<char_type>::length(__res));
+ }
+
+
+ // Inhibit implicit instantiations for required instantiations,
+ // which are defined via explicit instantiations elsewhere.
+ // NB: This syntax is a GNU extension.
+#if _GLIBCXX_EXTERN_TEMPLATE
+ extern template class moneypunct<char, false>;
+ extern template class moneypunct<char, true>;
+ extern template class moneypunct_byname<char, false>;
+ extern template class moneypunct_byname<char, true>;
+ extern template class _GLIBCXX_LDBL_NAMESPACE money_get<char>;
+ extern template class _GLIBCXX_LDBL_NAMESPACE money_put<char>;
+ extern template class __timepunct<char>;
+ extern template class time_put<char>;
+ extern template class time_put_byname<char>;
+ extern template class time_get<char>;
+ extern template class time_get_byname<char>;
+ extern template class messages<char>;
+ extern template class messages_byname<char>;
+
+ extern template
+ const moneypunct<char, true>&
+ use_facet<moneypunct<char, true> >(const locale&);
+
+ extern template
+ const moneypunct<char, false>&
+ use_facet<moneypunct<char, false> >(const locale&);
+
+ extern template
+ const money_put<char>&
+ use_facet<money_put<char> >(const locale&);
+
+ extern template
+ const money_get<char>&
+ use_facet<money_get<char> >(const locale&);
+
+ extern template
+ const __timepunct<char>&
+ use_facet<__timepunct<char> >(const locale&);
+
+ extern template
+ const time_put<char>&
+ use_facet<time_put<char> >(const locale&);
+
+ extern template
+ const time_get<char>&
+ use_facet<time_get<char> >(const locale&);
+
+ extern template
+ const messages<char>&
+ use_facet<messages<char> >(const locale&);
+
+ extern template
+ bool
+ has_facet<moneypunct<char> >(const locale&);
+
+ extern template
+ bool
+ has_facet<money_put<char> >(const locale&);
+
+ extern template
+ bool
+ has_facet<money_get<char> >(const locale&);
+
+ extern template
+ bool
+ has_facet<__timepunct<char> >(const locale&);
+
+ extern template
+ bool
+ has_facet<time_put<char> >(const locale&);
+
+ extern template
+ bool
+ has_facet<time_get<char> >(const locale&);
+
+ extern template
+ bool
+ has_facet<messages<char> >(const locale&);
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ extern template class moneypunct<wchar_t, false>;
+ extern template class moneypunct<wchar_t, true>;
+ extern template class moneypunct_byname<wchar_t, false>;
+ extern template class moneypunct_byname<wchar_t, true>;
+ extern template class _GLIBCXX_LDBL_NAMESPACE money_get<wchar_t>;
+ extern template class _GLIBCXX_LDBL_NAMESPACE money_put<wchar_t>;
+ extern template class __timepunct<wchar_t>;
+ extern template class time_put<wchar_t>;
+ extern template class time_put_byname<wchar_t>;
+ extern template class time_get<wchar_t>;
+ extern template class time_get_byname<wchar_t>;
+ extern template class messages<wchar_t>;
+ extern template class messages_byname<wchar_t>;
+
+ extern template
+ const moneypunct<wchar_t, true>&
+ use_facet<moneypunct<wchar_t, true> >(const locale&);
+
+ extern template
+ const moneypunct<wchar_t, false>&
+ use_facet<moneypunct<wchar_t, false> >(const locale&);
+
+ extern template
+ const money_put<wchar_t>&
+ use_facet<money_put<wchar_t> >(const locale&);
+
+ extern template
+ const money_get<wchar_t>&
+ use_facet<money_get<wchar_t> >(const locale&);
+
+ extern template
+ const __timepunct<wchar_t>&
+ use_facet<__timepunct<wchar_t> >(const locale&);
+
+ extern template
+ const time_put<wchar_t>&
+ use_facet<time_put<wchar_t> >(const locale&);
+
+ extern template
+ const time_get<wchar_t>&
+ use_facet<time_get<wchar_t> >(const locale&);
+
+ extern template
+ const messages<wchar_t>&
+ use_facet<messages<wchar_t> >(const locale&);
+
+ extern template
+ bool
+ has_facet<moneypunct<wchar_t> >(const locale&);
+
+ extern template
+ bool
+ has_facet<money_put<wchar_t> >(const locale&);
+
+ extern template
+ bool
+ has_facet<money_get<wchar_t> >(const locale&);
+
+ extern template
+ bool
+ has_facet<__timepunct<wchar_t> >(const locale&);
+
+ extern template
+ bool
+ has_facet<time_put<wchar_t> >(const locale&);
+
+ extern template
+ bool
+ has_facet<time_get<wchar_t> >(const locale&);
+
+ extern template
+ bool
+ has_facet<messages<wchar_t> >(const locale&);
+#endif
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/bits/localefwd.h b/i686-linux/include/c++/4.4.3/bits/localefwd.h
new file mode 100644
index 0000000..909df1e
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/localefwd.h
@@ -0,0 +1,183 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file localefwd.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 22.1 Locales
+//
+
+#ifndef _LOCALE_FWD_H
+#define _LOCALE_FWD_H 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <bits/c++locale.h> // Defines __c_locale, config-specific include
+#include <iosfwd> // For ostreambuf_iterator, istreambuf_iterator
+#include <cctype>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // 22.1.1 Locale
+ class locale;
+
+ template<typename _Facet>
+ bool
+ has_facet(const locale&) throw();
+
+ template<typename _Facet>
+ const _Facet&
+ use_facet(const locale&);
+
+ // 22.1.3 Convenience interfaces
+ template<typename _CharT>
+ bool
+ isspace(_CharT, const locale&);
+
+ template<typename _CharT>
+ bool
+ isprint(_CharT, const locale&);
+
+ template<typename _CharT>
+ bool
+ iscntrl(_CharT, const locale&);
+
+ template<typename _CharT>
+ bool
+ isupper(_CharT, const locale&);
+
+ template<typename _CharT>
+ bool
+ islower(_CharT, const locale&);
+
+ template<typename _CharT>
+ bool
+ isalpha(_CharT, const locale&);
+
+ template<typename _CharT>
+ bool
+ isdigit(_CharT, const locale&);
+
+ template<typename _CharT>
+ bool
+ ispunct(_CharT, const locale&);
+
+ template<typename _CharT>
+ bool
+ isxdigit(_CharT, const locale&);
+
+ template<typename _CharT>
+ bool
+ isalnum(_CharT, const locale&);
+
+ template<typename _CharT>
+ bool
+ isgraph(_CharT, const locale&);
+
+ template<typename _CharT>
+ _CharT
+ toupper(_CharT, const locale&);
+
+ template<typename _CharT>
+ _CharT
+ tolower(_CharT, const locale&);
+
+ // 22.2.1 and 22.2.1.3 ctype
+ class ctype_base;
+ template<typename _CharT>
+ class ctype;
+ template<> class ctype<char>;
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template<> class ctype<wchar_t>;
+#endif
+ template<typename _CharT>
+ class ctype_byname;
+ // NB: Specialized for char and wchar_t in locale_facets.h.
+
+ class codecvt_base;
+ template<typename _InternT, typename _ExternT, typename _StateT>
+ class codecvt;
+ template<> class codecvt<char, char, mbstate_t>;
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template<> class codecvt<wchar_t, char, mbstate_t>;
+#endif
+ template<typename _InternT, typename _ExternT, typename _StateT>
+ class codecvt_byname;
+
+ // 22.2.2 and 22.2.3 numeric
+_GLIBCXX_BEGIN_LDBL_NAMESPACE
+ template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
+ class num_get;
+ template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
+ class num_put;
+_GLIBCXX_END_LDBL_NAMESPACE
+ template<typename _CharT> class numpunct;
+ template<typename _CharT> class numpunct_byname;
+
+ // 22.2.4 collation
+ template<typename _CharT>
+ class collate;
+ template<typename _CharT> class
+ collate_byname;
+
+ // 22.2.5 date and time
+ class time_base;
+ template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
+ class time_get;
+ template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
+ class time_get_byname;
+ template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
+ class time_put;
+ template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
+ class time_put_byname;
+
+ // 22.2.6 money
+ class money_base;
+_GLIBCXX_BEGIN_LDBL_NAMESPACE
+ template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
+ class money_get;
+ template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
+ class money_put;
+_GLIBCXX_END_LDBL_NAMESPACE
+ template<typename _CharT, bool _Intl = false>
+ class moneypunct;
+ template<typename _CharT, bool _Intl = false>
+ class moneypunct_byname;
+
+ // 22.2.7 message retrieval
+ class messages_base;
+ template<typename _CharT>
+ class messages;
+ template<typename _CharT>
+ class messages_byname;
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/bits/mask_array.h b/i686-linux/include/c++/4.4.3/bits/mask_array.h
new file mode 100644
index 0000000..f915dd9
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/mask_array.h
@@ -0,0 +1,206 @@
+// The template and inlines for the -*- C++ -*- mask_array class.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file mask_array.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
+
+#ifndef _MASK_ARRAY_H
+#define _MASK_ARRAY_H 1
+
+#pragma GCC system_header
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @addtogroup numeric_arrays
+ * @{
+ */
+
+ /**
+ * @brief Reference to selected subset of an array.
+ *
+ * A mask_array is a reference to the actual elements of an array specified
+ * by a bitmask in the form of an array of bool. The way to get a
+ * mask_array is to call operator[](valarray<bool>) on a valarray. The
+ * returned mask_array then permits carrying operations out on the
+ * referenced subset of elements in the original valarray.
+ *
+ * For example, if a mask_array is obtained using the array (false, true,
+ * false, true) as an argument, the mask array has two elements referring
+ * to array[1] and array[3] in the underlying array.
+ *
+ * @param Tp Element type.
+ */
+ template <class _Tp>
+ class mask_array
+ {
+ public:
+ typedef _Tp value_type;
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 253. valarray helper functions are almost entirely useless
+
+ /// Copy constructor. Both slices refer to the same underlying array.
+ mask_array (const mask_array&);
+
+ /// Assignment operator. Assigns elements to corresponding elements
+ /// of @a a.
+ mask_array& operator=(const mask_array&);
+
+ void operator=(const valarray<_Tp>&) const;
+ /// Multiply slice elements by corresponding elements of @a v.
+ void operator*=(const valarray<_Tp>&) const;
+ /// Divide slice elements by corresponding elements of @a v.
+ void operator/=(const valarray<_Tp>&) const;
+ /// Modulo slice elements by corresponding elements of @a v.
+ void operator%=(const valarray<_Tp>&) const;
+ /// Add corresponding elements of @a v to slice elements.
+ void operator+=(const valarray<_Tp>&) const;
+ /// Subtract corresponding elements of @a v from slice elements.
+ void operator-=(const valarray<_Tp>&) const;
+ /// Logical xor slice elements with corresponding elements of @a v.
+ void operator^=(const valarray<_Tp>&) const;
+ /// Logical and slice elements with corresponding elements of @a v.
+ void operator&=(const valarray<_Tp>&) const;
+ /// Logical or slice elements with corresponding elements of @a v.
+ void operator|=(const valarray<_Tp>&) const;
+ /// Left shift slice elements by corresponding elements of @a v.
+ void operator<<=(const valarray<_Tp>&) const;
+ /// Right shift slice elements by corresponding elements of @a v.
+ void operator>>=(const valarray<_Tp>&) const;
+ /// Assign all slice elements to @a t.
+ void operator=(const _Tp&) const;
+
+ // ~mask_array ();
+
+ template<class _Dom>
+ void operator=(const _Expr<_Dom,_Tp>&) const;
+ template<class _Dom>
+ void operator*=(const _Expr<_Dom,_Tp>&) const;
+ template<class _Dom>
+ void operator/=(const _Expr<_Dom,_Tp>&) const;
+ template<class _Dom>
+ void operator%=(const _Expr<_Dom,_Tp>&) const;
+ template<class _Dom>
+ void operator+=(const _Expr<_Dom,_Tp>&) const;
+ template<class _Dom>
+ void operator-=(const _Expr<_Dom,_Tp>&) const;
+ template<class _Dom>
+ void operator^=(const _Expr<_Dom,_Tp>&) const;
+ template<class _Dom>
+ void operator&=(const _Expr<_Dom,_Tp>&) const;
+ template<class _Dom>
+ void operator|=(const _Expr<_Dom,_Tp>&) const;
+ template<class _Dom>
+ void operator<<=(const _Expr<_Dom,_Tp>&) const;
+ template<class _Dom>
+ void operator>>=(const _Expr<_Dom,_Tp>&) const;
+
+ private:
+ mask_array(_Array<_Tp>, size_t, _Array<bool>);
+ friend class valarray<_Tp>;
+
+ const size_t _M_sz;
+ const _Array<bool> _M_mask;
+ const _Array<_Tp> _M_array;
+
+ // not implemented
+ mask_array();
+ };
+
+ template<typename _Tp>
+ inline mask_array<_Tp>::mask_array(const mask_array<_Tp>& a)
+ : _M_sz(a._M_sz), _M_mask(a._M_mask), _M_array(a._M_array) {}
+
+ template<typename _Tp>
+ inline
+ mask_array<_Tp>::mask_array(_Array<_Tp> __a, size_t __s, _Array<bool> __m)
+ : _M_sz(__s), _M_mask(__m), _M_array(__a) {}
+
+ template<typename _Tp>
+ inline mask_array<_Tp>&
+ mask_array<_Tp>::operator=(const mask_array<_Tp>& __a)
+ {
+ std::__valarray_copy(__a._M_array, __a._M_mask,
+ _M_sz, _M_array, _M_mask);
+ return *this;
+ }
+
+ template<typename _Tp>
+ inline void
+ mask_array<_Tp>::operator=(const _Tp& __t) const
+ { std::__valarray_fill(_M_array, _M_sz, _M_mask, __t); }
+
+ template<typename _Tp>
+ inline void
+ mask_array<_Tp>::operator=(const valarray<_Tp>& __v) const
+ { std::__valarray_copy(_Array<_Tp>(__v), __v.size(), _M_array, _M_mask); }
+
+ template<typename _Tp>
+ template<class _Ex>
+ inline void
+ mask_array<_Tp>::operator=(const _Expr<_Ex, _Tp>& __e) const
+ { std::__valarray_copy(__e, __e.size(), _M_array, _M_mask); }
+
+#undef _DEFINE_VALARRAY_OPERATOR
+#define _DEFINE_VALARRAY_OPERATOR(_Op, _Name) \
+ template<typename _Tp> \
+ inline void \
+ mask_array<_Tp>::operator _Op##=(const valarray<_Tp>& __v) const \
+ { \
+ _Array_augmented_##_Name(_M_array, _M_mask, \
+ _Array<_Tp>(__v), __v.size()); \
+ } \
+ \
+ template<typename _Tp> \
+ template<class _Dom> \
+ inline void \
+ mask_array<_Tp>::operator _Op##=(const _Expr<_Dom, _Tp>& __e) const\
+ { \
+ _Array_augmented_##_Name(_M_array, _M_mask, __e, __e.size()); \
+ }
+
+_DEFINE_VALARRAY_OPERATOR(*, __multiplies)
+_DEFINE_VALARRAY_OPERATOR(/, __divides)
+_DEFINE_VALARRAY_OPERATOR(%, __modulus)
+_DEFINE_VALARRAY_OPERATOR(+, __plus)
+_DEFINE_VALARRAY_OPERATOR(-, __minus)
+_DEFINE_VALARRAY_OPERATOR(^, __bitwise_xor)
+_DEFINE_VALARRAY_OPERATOR(&, __bitwise_and)
+_DEFINE_VALARRAY_OPERATOR(|, __bitwise_or)
+_DEFINE_VALARRAY_OPERATOR(<<, __shift_left)
+_DEFINE_VALARRAY_OPERATOR(>>, __shift_right)
+
+#undef _DEFINE_VALARRAY_OPERATOR
+
+ // @} group numeric_arrays
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _MASK_ARRAY_H */
diff --git a/i686-linux/include/c++/4.4.3/bits/move.h b/i686-linux/include/c++/4.4.3/bits/move.h
new file mode 100644
index 0000000..ef86c4d
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/move.h
@@ -0,0 +1,98 @@
+// Move, forward and identity for C++0x + swap -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file move.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _MOVE_H
+#define _MOVE_H 1
+
+#include <bits/c++config.h>
+#include <cstddef>
+#include <bits/concept_check.h>
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#include <type_traits>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // 20.2.2, forward/move
+ template<typename _Tp>
+ struct identity
+ {
+ typedef _Tp type;
+ };
+
+ template<typename _Tp>
+ inline _Tp&&
+ forward(typename std::identity<_Tp>::type&& __t)
+ { return __t; }
+
+ template<typename _Tp>
+ inline typename std::remove_reference<_Tp>::type&&
+ move(_Tp&& __t)
+ { return __t; }
+
+_GLIBCXX_END_NAMESPACE
+
+#define _GLIBCXX_MOVE(_Tp) std::move(_Tp)
+#else
+#define _GLIBCXX_MOVE(_Tp) (_Tp)
+#endif
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @brief Swaps two values.
+ * @param a A thing of arbitrary type.
+ * @param b Another thing of arbitrary type.
+ * @return Nothing.
+ */
+ template<typename _Tp>
+ inline void
+ swap(_Tp& __a, _Tp& __b)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_SGIAssignableConcept<_Tp>)
+
+ _Tp __tmp = _GLIBCXX_MOVE(__a);
+ __a = _GLIBCXX_MOVE(__b);
+ __b = _GLIBCXX_MOVE(__tmp);
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 809. std::swap should be overloaded for array types.
+ template<typename _Tp, size_t _Nm>
+ inline void
+ swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
+ {
+ for (size_t __n = 0; __n < _Nm; ++__n)
+ swap(__a[__n], __b[__n]);
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _MOVE_H */
diff --git a/i686-linux/include/c++/4.4.3/bits/ostream.tcc b/i686-linux/include/c++/4.4.3/bits/ostream.tcc
new file mode 100644
index 0000000..e2cbb58
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/ostream.tcc
@@ -0,0 +1,407 @@
+// ostream classes -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ostream.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 27.6.2 Output streams
+//
+
+#ifndef _OSTREAM_TCC
+#define _OSTREAM_TCC 1
+
+#pragma GCC system_header
+
+#include <cxxabi-forced.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>::sentry::
+ sentry(basic_ostream<_CharT, _Traits>& __os)
+ : _M_ok(false), _M_os(__os)
+ {
+ // XXX MT
+ if (__os.tie() && __os.good())
+ __os.tie()->flush();
+
+ if (__os.good())
+ _M_ok = true;
+ else
+ __os.setstate(ios_base::failbit);
+ }
+
+ template<typename _CharT, typename _Traits>
+ template<typename _ValueT>
+ basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>::
+ _M_insert(_ValueT __v)
+ {
+ sentry __cerb(*this);
+ if (__cerb)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ __try
+ {
+ const __num_put_type& __np = __check_facet(this->_M_num_put);
+ if (__np.put(*this, *this, this->fill(), __v).failed())
+ __err |= ios_base::badbit;
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>::
+ operator<<(short __n)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 117. basic_ostream uses nonexistent num_put member functions.
+ const ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
+ if (__fmt == ios_base::oct || __fmt == ios_base::hex)
+ return _M_insert(static_cast<long>(static_cast<unsigned short>(__n)));
+ else
+ return _M_insert(static_cast<long>(__n));
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>::
+ operator<<(int __n)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 117. basic_ostream uses nonexistent num_put member functions.
+ const ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
+ if (__fmt == ios_base::oct || __fmt == ios_base::hex)
+ return _M_insert(static_cast<long>(static_cast<unsigned int>(__n)));
+ else
+ return _M_insert(static_cast<long>(__n));
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>::
+ operator<<(__streambuf_type* __sbin)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ sentry __cerb(*this);
+ if (__cerb && __sbin)
+ {
+ __try
+ {
+ if (!__copy_streambufs(__sbin, this->rdbuf()))
+ __err |= ios_base::failbit;
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::failbit); }
+ }
+ else if (!__sbin)
+ __err |= ios_base::badbit;
+ if (__err)
+ this->setstate(__err);
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>::
+ put(char_type __c)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 60. What is a formatted input function?
+ // basic_ostream::put(char_type) is an unformatted output function.
+ // DR 63. Exception-handling policy for unformatted output.
+ // Unformatted output functions should catch exceptions thrown
+ // from streambuf members.
+ sentry __cerb(*this);
+ if (__cerb)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ __try
+ {
+ const int_type __put = this->rdbuf()->sputc(__c);
+ if (traits_type::eq_int_type(__put, traits_type::eof()))
+ __err |= ios_base::badbit;
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>::
+ write(const _CharT* __s, streamsize __n)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 60. What is a formatted input function?
+ // basic_ostream::write(const char_type*, streamsize) is an
+ // unformatted output function.
+ // DR 63. Exception-handling policy for unformatted output.
+ // Unformatted output functions should catch exceptions thrown
+ // from streambuf members.
+ sentry __cerb(*this);
+ if (__cerb)
+ {
+ __try
+ { _M_write(__s, __n); }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>::
+ flush()
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 60. What is a formatted input function?
+ // basic_ostream::flush() is *not* an unformatted output function.
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ __try
+ {
+ if (this->rdbuf() && this->rdbuf()->pubsync() == -1)
+ __err |= ios_base::badbit;
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ typename basic_ostream<_CharT, _Traits>::pos_type
+ basic_ostream<_CharT, _Traits>::
+ tellp()
+ {
+ pos_type __ret = pos_type(-1);
+ __try
+ {
+ if (!this->fail())
+ __ret = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::out);
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ return __ret;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>::
+ seekp(pos_type __pos)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ __try
+ {
+ if (!this->fail())
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 136. seekp, seekg setting wrong streams?
+ const pos_type __p = this->rdbuf()->pubseekpos(__pos,
+ ios_base::out);
+
+ // 129. Need error indication from seekp() and seekg()
+ if (__p == pos_type(off_type(-1)))
+ __err |= ios_base::failbit;
+ }
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>::
+ seekp(off_type __off, ios_base::seekdir __dir)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ __try
+ {
+ if (!this->fail())
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 136. seekp, seekg setting wrong streams?
+ const pos_type __p = this->rdbuf()->pubseekoff(__off, __dir,
+ ios_base::out);
+
+ // 129. Need error indication from seekp() and seekg()
+ if (__p == pos_type(off_type(-1)))
+ __err |= ios_base::failbit;
+ }
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
+ {
+ if (!__s)
+ __out.setstate(ios_base::badbit);
+ else
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 167. Improper use of traits_type::length()
+ const size_t __clen = char_traits<char>::length(__s);
+ __try
+ {
+ struct __ptr_guard
+ {
+ _CharT *__p;
+ __ptr_guard (_CharT *__ip): __p(__ip) { }
+ ~__ptr_guard() { delete[] __p; }
+ _CharT* __get() { return __p; }
+ } __pg (new _CharT[__clen]);
+
+ _CharT *__ws = __pg.__get();
+ for (size_t __i = 0; __i < __clen; ++__i)
+ __ws[__i] = __out.widen(__s[__i]);
+ __ostream_insert(__out, __ws, __clen);
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ __out._M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { __out._M_setstate(ios_base::badbit); }
+ }
+ return __out;
+ }
+
+ // Inhibit implicit instantiations for required instantiations,
+ // which are defined via explicit instantiations elsewhere.
+ // NB: This syntax is a GNU extension.
+#if _GLIBCXX_EXTERN_TEMPLATE
+ extern template class basic_ostream<char>;
+ extern template ostream& endl(ostream&);
+ extern template ostream& ends(ostream&);
+ extern template ostream& flush(ostream&);
+ extern template ostream& operator<<(ostream&, char);
+ extern template ostream& operator<<(ostream&, unsigned char);
+ extern template ostream& operator<<(ostream&, signed char);
+ extern template ostream& operator<<(ostream&, const char*);
+ extern template ostream& operator<<(ostream&, const unsigned char*);
+ extern template ostream& operator<<(ostream&, const signed char*);
+
+ extern template ostream& ostream::_M_insert(long);
+ extern template ostream& ostream::_M_insert(unsigned long);
+ extern template ostream& ostream::_M_insert(bool);
+#ifdef _GLIBCXX_USE_LONG_LONG
+ extern template ostream& ostream::_M_insert(long long);
+ extern template ostream& ostream::_M_insert(unsigned long long);
+#endif
+ extern template ostream& ostream::_M_insert(double);
+ extern template ostream& ostream::_M_insert(long double);
+ extern template ostream& ostream::_M_insert(const void*);
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ extern template class basic_ostream<wchar_t>;
+ extern template wostream& endl(wostream&);
+ extern template wostream& ends(wostream&);
+ extern template wostream& flush(wostream&);
+ extern template wostream& operator<<(wostream&, wchar_t);
+ extern template wostream& operator<<(wostream&, char);
+ extern template wostream& operator<<(wostream&, const wchar_t*);
+ extern template wostream& operator<<(wostream&, const char*);
+
+ extern template wostream& wostream::_M_insert(long);
+ extern template wostream& wostream::_M_insert(unsigned long);
+ extern template wostream& wostream::_M_insert(bool);
+#ifdef _GLIBCXX_USE_LONG_LONG
+ extern template wostream& wostream::_M_insert(long long);
+ extern template wostream& wostream::_M_insert(unsigned long long);
+#endif
+ extern template wostream& wostream::_M_insert(double);
+ extern template wostream& wostream::_M_insert(long double);
+ extern template wostream& wostream::_M_insert(const void*);
+#endif
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/bits/ostream_insert.h b/i686-linux/include/c++/4.4.3/bits/ostream_insert.h
new file mode 100644
index 0000000..e0017ee
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/ostream_insert.h
@@ -0,0 +1,127 @@
+// Helpers for ostream inserters -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ostream_insert.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _OSTREAM_INSERT_H
+#define _OSTREAM_INSERT_H 1
+
+#pragma GCC system_header
+
+#include <iosfwd>
+#include <cxxabi-forced.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _CharT, typename _Traits>
+ inline void
+ __ostream_write(basic_ostream<_CharT, _Traits>& __out,
+ const _CharT* __s, streamsize __n)
+ {
+ typedef basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+
+ const streamsize __put = __out.rdbuf()->sputn(__s, __n);
+ if (__put != __n)
+ __out.setstate(__ios_base::badbit);
+ }
+
+ template<typename _CharT, typename _Traits>
+ inline void
+ __ostream_fill(basic_ostream<_CharT, _Traits>& __out, streamsize __n)
+ {
+ typedef basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+
+ const _CharT __c = __out.fill();
+ for (; __n > 0; --__n)
+ {
+ const typename _Traits::int_type __put = __out.rdbuf()->sputc(__c);
+ if (_Traits::eq_int_type(__put, _Traits::eof()))
+ {
+ __out.setstate(__ios_base::badbit);
+ break;
+ }
+ }
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>&
+ __ostream_insert(basic_ostream<_CharT, _Traits>& __out,
+ const _CharT* __s, streamsize __n)
+ {
+ typedef basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+
+ typename __ostream_type::sentry __cerb(__out);
+ if (__cerb)
+ {
+ __try
+ {
+ const streamsize __w = __out.width();
+ if (__w > __n)
+ {
+ const bool __left = ((__out.flags()
+ & __ios_base::adjustfield)
+ == __ios_base::left);
+ if (!__left)
+ __ostream_fill(__out, __w - __n);
+ if (__out.good())
+ __ostream_write(__out, __s, __n);
+ if (__left && __out.good())
+ __ostream_fill(__out, __w - __n);
+ }
+ else
+ __ostream_write(__out, __s, __n);
+ __out.width(0);
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ __out._M_setstate(__ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { __out._M_setstate(__ios_base::badbit); }
+ }
+ return __out;
+ }
+
+ // Inhibit implicit instantiations for required instantiations,
+ // which are defined via explicit instantiations elsewhere.
+ // NB: This syntax is a GNU extension.
+#if _GLIBCXX_EXTERN_TEMPLATE
+ extern template ostream& __ostream_insert(ostream&, const char*, streamsize);
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ extern template wostream& __ostream_insert(wostream&, const wchar_t*,
+ streamsize);
+#endif
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _OSTREAM_INSERT_H */
diff --git a/i686-linux/include/c++/4.4.3/bits/postypes.h b/i686-linux/include/c++/4.4.3/bits/postypes.h
new file mode 100644
index 0000000..8066d9b
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/postypes.h
@@ -0,0 +1,241 @@
+// Position types -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file postypes.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 27.4.1 - Types
+// ISO C++ 14882: 27.4.3 - Template class fpos
+//
+
+#ifndef _GLIBCXX_POSTYPES_H
+#define _GLIBCXX_POSTYPES_H 1
+
+#pragma GCC system_header
+
+#include <cwchar> // For mbstate_t
+
+// XXX If <stdint.h> is really needed, make sure to define the macros
+// before including it, in order not to break <tr1/cstdint> (and <cstdint>
+// in C++0x). Reconsider all this as soon as possible...
+#if (defined(_GLIBCXX_HAVE_INT64_T) && !defined(_GLIBCXX_HAVE_INT64_T_LONG) \
+ && !defined(_GLIBCXX_HAVE_INT64_T_LONG_LONG))
+
+#ifndef __STDC_LIMIT_MACROS
+# define _UNDEF__STDC_LIMIT_MACROS
+# define __STDC_LIMIT_MACROS
+#endif
+#ifndef __STDC_CONSTANT_MACROS
+# define _UNDEF__STDC_CONSTANT_MACROS
+# define __STDC_CONSTANT_MACROS
+#endif
+#include <stdint.h> // For int64_t
+#ifdef _UNDEF__STDC_LIMIT_MACROS
+# undef __STDC_LIMIT_MACROS
+# undef _UNDEF__STDC_LIMIT_MACROS
+#endif
+#ifdef _UNDEF__STDC_CONSTANT_MACROS
+# undef __STDC_CONSTANT_MACROS
+# undef _UNDEF__STDC_CONSTANT_MACROS
+#endif
+
+#endif
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // The types streamoff, streampos and wstreampos and the class
+ // template fpos<> are described in clauses 21.1.2, 21.1.3, 27.1.2,
+ // 27.2, 27.4.1, 27.4.3 and D.6. Despite all this verbiage, the
+ // behaviour of these types is mostly implementation defined or
+ // unspecified. The behaviour in this implementation is as noted
+ // below.
+
+ /**
+ * @brief Type used by fpos, char_traits<char>, and char_traits<wchar_t>.
+ *
+ * In clauses 21.1.3.1 and 27.4.1 streamoff is described as an
+ * implementation defined type.
+ * Note: In versions of GCC up to and including GCC 3.3, streamoff
+ * was typedef long.
+ */
+#ifdef _GLIBCXX_HAVE_INT64_T_LONG
+ typedef long streamoff;
+#elif defined(_GLIBCXX_HAVE_INT64_T_LONG_LONG)
+ typedef long long streamoff;
+#elif defined(_GLIBCXX_HAVE_INT64_T)
+ typedef int64_t streamoff;
+#else
+ typedef long long streamoff;
+#endif
+
+ /// Integral type for I/O operation counts and buffer sizes.
+ typedef ptrdiff_t streamsize; // Signed integral type
+
+ /**
+ * @brief Class representing stream positions.
+ *
+ * The standard places no requirements upon the template parameter StateT.
+ * In this implementation StateT must be DefaultConstructible,
+ * CopyConstructible and Assignable. The standard only requires that fpos
+ * should contain a member of type StateT. In this implementation it also
+ * contains an offset stored as a signed integer.
+ *
+ * @param StateT Type passed to and returned from state().
+ */
+ template<typename _StateT>
+ class fpos
+ {
+ private:
+ streamoff _M_off;
+ _StateT _M_state;
+
+ public:
+ // The standard doesn't require that fpos objects can be default
+ // constructed. This implementation provides a default
+ // constructor that initializes the offset to 0 and default
+ // constructs the state.
+ fpos()
+ : _M_off(0), _M_state() { }
+
+ // The standard requires that fpos objects can be constructed
+ // from streamoff objects using the constructor syntax, and
+ // fails to give any meaningful semantics. In this
+ // implementation implicit conversion is also allowed, and this
+ // constructor stores the streamoff as the offset and default
+ // constructs the state.
+ /// Construct position from offset.
+ fpos(streamoff __off)
+ : _M_off(__off), _M_state() { }
+
+ /// Convert to streamoff.
+ operator streamoff() const { return _M_off; }
+
+ /// Remember the value of @a st.
+ void
+ state(_StateT __st)
+ { _M_state = __st; }
+
+ /// Return the last set value of @a st.
+ _StateT
+ state() const
+ { return _M_state; }
+
+ // The standard requires that this operator must be defined, but
+ // gives no semantics. In this implementation it just adds its
+ // argument to the stored offset and returns *this.
+ /// Add offset to this position.
+ fpos&
+ operator+=(streamoff __off)
+ {
+ _M_off += __off;
+ return *this;
+ }
+
+ // The standard requires that this operator must be defined, but
+ // gives no semantics. In this implementation it just subtracts
+ // its argument from the stored offset and returns *this.
+ /// Subtract offset from this position.
+ fpos&
+ operator-=(streamoff __off)
+ {
+ _M_off -= __off;
+ return *this;
+ }
+
+ // The standard requires that this operator must be defined, but
+ // defines its semantics only in terms of operator-. In this
+ // implementation it constructs a copy of *this, adds the
+ // argument to that copy using operator+= and then returns the
+ // copy.
+ /// Add position and offset.
+ fpos
+ operator+(streamoff __off) const
+ {
+ fpos __pos(*this);
+ __pos += __off;
+ return __pos;
+ }
+
+ // The standard requires that this operator must be defined, but
+ // defines its semantics only in terms of operator+. In this
+ // implementation it constructs a copy of *this, subtracts the
+ // argument from that copy using operator-= and then returns the
+ // copy.
+ /// Subtract offset from position.
+ fpos
+ operator-(streamoff __off) const
+ {
+ fpos __pos(*this);
+ __pos -= __off;
+ return __pos;
+ }
+
+ // The standard requires that this operator must be defined, but
+ // defines its semantics only in terms of operator+. In this
+ // implementation it returns the difference between the offset
+ // stored in *this and in the argument.
+ /// Subtract position to return offset.
+ streamoff
+ operator-(const fpos& __other) const
+ { return _M_off - __other._M_off; }
+ };
+
+ // The standard only requires that operator== must be an
+ // equivalence relation. In this implementation two fpos<StateT>
+ // objects belong to the same equivalence class if the contained
+ // offsets compare equal.
+ /// Test if equivalent to another position.
+ template<typename _StateT>
+ inline bool
+ operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
+ { return streamoff(__lhs) == streamoff(__rhs); }
+
+ template<typename _StateT>
+ inline bool
+ operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
+ { return streamoff(__lhs) != streamoff(__rhs); }
+
+ // Clauses 21.1.3.1 and 21.1.3.2 describe streampos and wstreampos
+ // as implementation defined types, but clause 27.2 requires that
+ // they must both be typedefs for fpos<mbstate_t>
+ /// File position for char streams.
+ typedef fpos<mbstate_t> streampos;
+ /// File position for wchar_t streams.
+ typedef fpos<mbstate_t> wstreampos;
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /// File position for char16_t streams.
+ typedef fpos<mbstate_t> u16streampos;
+ /// File position for char32_t streams.
+ typedef fpos<mbstate_t> u32streampos;
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/bits/shared_ptr.h b/i686-linux/include/c++/4.4.3/bits/shared_ptr.h
new file mode 100644
index 0000000..a378ae0
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/shared_ptr.h
@@ -0,0 +1,1591 @@
+// shared_ptr and weak_ptr implementation -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// shared_count.hpp
+// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd.
+
+// shared_ptr.hpp
+// Copyright (C) 1998, 1999 Greg Colvin and Beman Dawes.
+// Copyright (C) 2001, 2002, 2003 Peter Dimov
+
+// weak_ptr.hpp
+// Copyright (C) 2001, 2002, 2003 Peter Dimov
+
+// enable_shared_from_this.hpp
+// Copyright (C) 2002 Peter Dimov
+
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// GCC Note: based on version 1.32.0 of the Boost library.
+
+/** @file bits/shared_ptr.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _SHARED_PTR_H
+#define _SHARED_PTR_H 1
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#endif
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+#endif
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @addtogroup pointer_abstractions
+ * @{
+ */
+
+ // counted ptr with no deleter or allocator support
+ template<typename _Ptr, _Lock_policy _Lp>
+ class _Sp_counted_ptr
+ : public _Sp_counted_base<_Lp>
+ {
+ public:
+ _Sp_counted_ptr(_Ptr __p)
+ : _M_ptr(__p) { }
+
+ virtual void
+ _M_dispose() // nothrow
+ { delete _M_ptr; }
+
+ virtual void
+ _M_destroy() // nothrow
+ { delete this; }
+
+ virtual void*
+ _M_get_deleter(const std::type_info& __ti)
+ { return 0; }
+
+ _Sp_counted_ptr(const _Sp_counted_ptr&) = delete;
+ _Sp_counted_ptr& operator=(const _Sp_counted_ptr&) = delete;
+
+ protected:
+ _Ptr _M_ptr; // copy constructor must not throw
+ };
+
+ // support for custom deleter and/or allocator
+ template<typename _Ptr, typename _Deleter, typename _Alloc, _Lock_policy _Lp>
+ class _Sp_counted_deleter
+ : public _Sp_counted_ptr<_Ptr, _Lp>
+ {
+ typedef typename _Alloc::template
+ rebind<_Sp_counted_deleter>::other _My_alloc_type;
+
+ // Helper class that stores the Deleter and also acts as an allocator.
+ // Used to dispose of the owned pointer and the internal refcount
+ // Requires that copies of _Alloc can free each other's memory.
+ struct _My_Deleter
+ : public _My_alloc_type // copy constructor must not throw
+ {
+ _Deleter _M_del; // copy constructor must not throw
+ _My_Deleter(_Deleter __d, const _Alloc& __a)
+ : _My_alloc_type(__a), _M_del(__d) { }
+ };
+
+ protected:
+ typedef _Sp_counted_ptr<_Ptr, _Lp> _Base_type;
+
+ public:
+ /**
+ * @brief
+ * @pre __d(__p) must not throw.
+ */
+ _Sp_counted_deleter(_Ptr __p, _Deleter __d)
+ : _Base_type(__p), _M_del(__d, _Alloc()) { }
+
+ /**
+ * @brief
+ * @pre __d(__p) must not throw.
+ */
+ _Sp_counted_deleter(_Ptr __p, _Deleter __d, const _Alloc& __a)
+ : _Base_type(__p), _M_del(__d, __a) { }
+
+ virtual void
+ _M_dispose() // nothrow
+ { _M_del._M_del(_Base_type::_M_ptr); }
+
+ virtual void
+ _M_destroy() // nothrow
+ {
+ _My_alloc_type __a(_M_del);
+ this->~_Sp_counted_deleter();
+ __a.deallocate(this, 1);
+ }
+
+ virtual void*
+ _M_get_deleter(const std::type_info& __ti)
+ { return __ti == typeid(_Deleter) ? &_M_del._M_del : 0; }
+
+ protected:
+ _My_Deleter _M_del; // copy constructor must not throw
+ };
+
+ // helpers for make_shared / allocate_shared
+
+ template<typename _Tp>
+ struct _Sp_destroy_inplace
+ {
+ void operator()(_Tp* __p) const { if (__p) __p->~_Tp(); }
+ };
+
+ struct _Sp_make_shared_tag { };
+
+ template<typename _Tp, typename _Alloc, _Lock_policy _Lp>
+ class _Sp_counted_ptr_inplace
+ : public _Sp_counted_deleter<_Tp*, _Sp_destroy_inplace<_Tp>, _Alloc, _Lp>
+ {
+ typedef _Sp_counted_deleter<_Tp*, _Sp_destroy_inplace<_Tp>, _Alloc, _Lp>
+ _Base_type;
+
+ public:
+ _Sp_counted_ptr_inplace(_Alloc __a)
+ : _Base_type(static_cast<_Tp*>(0), _Sp_destroy_inplace<_Tp>(), __a)
+ , _M_storage()
+ {
+ void* __p = &_M_storage;
+ ::new (__p) _Tp(); // might throw
+ _Base_type::_Base_type::_M_ptr = static_cast<_Tp*>(__p);
+ }
+
+ template<typename... _Args>
+ _Sp_counted_ptr_inplace(_Alloc __a, _Args&&... __args)
+ : _Base_type(static_cast<_Tp*>(0), _Sp_destroy_inplace<_Tp>(), __a)
+ , _M_storage()
+ {
+ void* __p = &_M_storage;
+ ::new (__p) _Tp(std::forward<_Args>(__args)...); // might throw
+ _Base_type::_Base_type::_M_ptr = static_cast<_Tp*>(__p);
+ }
+
+ // override because the allocator needs to know the dynamic type
+ virtual void
+ _M_destroy() // nothrow
+ {
+ typedef typename _Alloc::template
+ rebind<_Sp_counted_ptr_inplace>::other _My_alloc_type;
+ _My_alloc_type __a(_Base_type::_M_del);
+ this->~_Sp_counted_ptr_inplace();
+ __a.deallocate(this, 1);
+ }
+
+ // sneaky trick so __shared_ptr can get the managed pointer
+ virtual void*
+ _M_get_deleter(const std::type_info& __ti)
+ {
+ return __ti == typeid(_Sp_make_shared_tag)
+ ? static_cast<void*>(&_M_storage)
+ : _Base_type::_M_get_deleter(__ti);
+ }
+
+ private:
+ typename aligned_storage<sizeof(_Tp), alignment_of<_Tp>::value>::type
+ _M_storage;
+ };
+
+ template<_Lock_policy _Lp = __default_lock_policy>
+ class __weak_count;
+
+ template<_Lock_policy _Lp = __default_lock_policy>
+ class __shared_count
+ {
+ public:
+ __shared_count()
+ : _M_pi(0) // nothrow
+ { }
+
+ template<typename _Ptr>
+ __shared_count(_Ptr __p) : _M_pi(0)
+ {
+ __try
+ {
+ _M_pi = new _Sp_counted_ptr<_Ptr, _Lp>(__p);
+ }
+ __catch(...)
+ {
+ delete __p;
+ __throw_exception_again;
+ }
+ }
+
+ template<typename _Ptr, typename _Deleter>
+ __shared_count(_Ptr __p, _Deleter __d) : _M_pi(0)
+ {
+ // allocator's value_type doesn't matter, will rebind it anyway
+ typedef std::allocator<int> _Alloc;
+ typedef _Sp_counted_deleter<_Ptr, _Deleter, _Alloc, _Lp> _Sp_cd_type;
+ typedef std::allocator<_Sp_cd_type> _Alloc2;
+ _Alloc2 __a2;
+ __try
+ {
+ _M_pi = __a2.allocate(1);
+ ::new(static_cast<void*>(_M_pi)) _Sp_cd_type(__p, __d);
+ }
+ __catch(...)
+ {
+ __d(__p); // Call _Deleter on __p.
+ if (_M_pi)
+ __a2.deallocate(static_cast<_Sp_cd_type*>(_M_pi), 1);
+ __throw_exception_again;
+ }
+ }
+
+ template<typename _Ptr, typename _Deleter, typename _Alloc>
+ __shared_count(_Ptr __p, _Deleter __d, _Alloc __a) : _M_pi(0)
+ {
+ typedef _Sp_counted_deleter<_Ptr, _Deleter, _Alloc, _Lp> _Sp_cd_type;
+ typedef typename _Alloc::template rebind<_Sp_cd_type>::other _Alloc2;
+ _Alloc2 __a2(__a);
+ __try
+ {
+ _M_pi = __a2.allocate(1);
+ ::new(static_cast<void*>(_M_pi)) _Sp_cd_type(__p, __d, __a);
+ }
+ __catch(...)
+ {
+ __d(__p); // Call _Deleter on __p.
+ if (_M_pi)
+ __a2.deallocate(static_cast<_Sp_cd_type*>(_M_pi), 1);
+ __throw_exception_again;
+ }
+ }
+
+ template<typename _Tp, typename _Alloc, typename... _Args>
+ __shared_count(_Sp_make_shared_tag, _Tp*, _Alloc __a, _Args&&... __args)
+ : _M_pi(0)
+ {
+ typedef _Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp> _Sp_cp_type;
+ typedef typename _Alloc::template rebind<_Sp_cp_type>::other _Alloc2;
+ _Alloc2 __a2(__a);
+ __try
+ {
+ _M_pi = __a2.allocate(1);
+ ::new(static_cast<void*>(_M_pi)) _Sp_cp_type(__a,
+ std::forward<_Args>(__args)...);
+ }
+ __catch(...)
+ {
+ if (_M_pi)
+ __a2.deallocate(static_cast<_Sp_cp_type*>(_M_pi), 1);
+ __throw_exception_again;
+ }
+ }
+
+#if _GLIBCXX_DEPRECATED
+ // Special case for auto_ptr<_Tp> to provide the strong guarantee.
+ template<typename _Tp>
+ explicit
+ __shared_count(std::auto_ptr<_Tp>&& __r)
+ : _M_pi(new _Sp_counted_ptr<_Tp*, _Lp>(__r.get()))
+ { __r.release(); }
+#endif
+
+ // Special case for unique_ptr<_Tp,_Del> to provide the strong guarantee.
+ template<typename _Tp, typename _Del>
+ explicit
+ __shared_count(std::unique_ptr<_Tp, _Del>&& __r)
+ : _M_pi(_S_create_from_up(std::move(__r)))
+ { __r.release(); }
+
+ // Throw bad_weak_ptr when __r._M_get_use_count() == 0.
+ explicit
+ __shared_count(const __weak_count<_Lp>& __r);
+
+ ~__shared_count() // nothrow
+ {
+ if (_M_pi != 0)
+ _M_pi->_M_release();
+ }
+
+ __shared_count(const __shared_count& __r)
+ : _M_pi(__r._M_pi) // nothrow
+ {
+ if (_M_pi != 0)
+ _M_pi->_M_add_ref_copy();
+ }
+
+ __shared_count&
+ operator=(const __shared_count& __r) // nothrow
+ {
+ _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
+ if (__tmp != _M_pi)
+ {
+ if (__tmp != 0)
+ __tmp->_M_add_ref_copy();
+ if (_M_pi != 0)
+ _M_pi->_M_release();
+ _M_pi = __tmp;
+ }
+ return *this;
+ }
+
+ void
+ _M_swap(__shared_count& __r) // nothrow
+ {
+ _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
+ __r._M_pi = _M_pi;
+ _M_pi = __tmp;
+ }
+
+ long
+ _M_get_use_count() const // nothrow
+ { return _M_pi != 0 ? _M_pi->_M_get_use_count() : 0; }
+
+ bool
+ _M_unique() const // nothrow
+ { return this->_M_get_use_count() == 1; }
+
+ void*
+ _M_get_deleter(const std::type_info& __ti) const
+ { return _M_pi ? _M_pi->_M_get_deleter(__ti) : 0; }
+
+ bool
+ _M_less(const __shared_count& __rhs) const
+ { return std::less<_Sp_counted_base<_Lp>*>()(this->_M_pi, __rhs._M_pi); }
+
+ bool
+ _M_less(const __weak_count<_Lp>& __rhs) const
+ { return std::less<_Sp_counted_base<_Lp>*>()(this->_M_pi, __rhs._M_pi); }
+
+ // friend function injected into enclosing namespace and found by ADL
+ friend inline bool
+ operator==(const __shared_count& __a, const __shared_count& __b)
+ { return __a._M_pi == __b._M_pi; }
+
+ private:
+ friend class __weak_count<_Lp>;
+
+ template<typename _Tp, typename _Del>
+ static _Sp_counted_base<_Lp>*
+ _S_create_from_up(std::unique_ptr<_Tp, _Del>&& __r,
+ typename std::enable_if<!std::is_reference<_Del>::value>::type* = 0)
+ {
+ return new _Sp_counted_deleter<_Tp*, _Del, std::allocator<_Tp>,
+ _Lp>(__r.get(), __r.get_deleter());
+ }
+
+ template<typename _Tp, typename _Del>
+ static _Sp_counted_base<_Lp>*
+ _S_create_from_up(std::unique_ptr<_Tp, _Del>&& __r,
+ typename std::enable_if<std::is_reference<_Del>::value>::type* = 0)
+ {
+ typedef typename std::remove_reference<_Del>::type _Del1;
+ typedef std::reference_wrapper<_Del1> _Del2;
+ return new _Sp_counted_deleter<_Tp*, _Del2, std::allocator<_Tp>,
+ _Lp>(__r.get(), std::ref(__r.get_deleter()));
+ }
+
+ _Sp_counted_base<_Lp>* _M_pi;
+ };
+
+
+ template<_Lock_policy _Lp>
+ class __weak_count
+ {
+ public:
+ __weak_count()
+ : _M_pi(0) // nothrow
+ { }
+
+ __weak_count(const __shared_count<_Lp>& __r)
+ : _M_pi(__r._M_pi) // nothrow
+ {
+ if (_M_pi != 0)
+ _M_pi->_M_weak_add_ref();
+ }
+
+ __weak_count(const __weak_count<_Lp>& __r)
+ : _M_pi(__r._M_pi) // nothrow
+ {
+ if (_M_pi != 0)
+ _M_pi->_M_weak_add_ref();
+ }
+
+ ~__weak_count() // nothrow
+ {
+ if (_M_pi != 0)
+ _M_pi->_M_weak_release();
+ }
+
+ __weak_count<_Lp>&
+ operator=(const __shared_count<_Lp>& __r) // nothrow
+ {
+ _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
+ if (__tmp != 0)
+ __tmp->_M_weak_add_ref();
+ if (_M_pi != 0)
+ _M_pi->_M_weak_release();
+ _M_pi = __tmp;
+ return *this;
+ }
+
+ __weak_count<_Lp>&
+ operator=(const __weak_count<_Lp>& __r) // nothrow
+ {
+ _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
+ if (__tmp != 0)
+ __tmp->_M_weak_add_ref();
+ if (_M_pi != 0)
+ _M_pi->_M_weak_release();
+ _M_pi = __tmp;
+ return *this;
+ }
+
+ void
+ _M_swap(__weak_count<_Lp>& __r) // nothrow
+ {
+ _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
+ __r._M_pi = _M_pi;
+ _M_pi = __tmp;
+ }
+
+ long
+ _M_get_use_count() const // nothrow
+ { return _M_pi != 0 ? _M_pi->_M_get_use_count() : 0; }
+
+ bool
+ _M_less(const __weak_count& __rhs) const
+ { return std::less<_Sp_counted_base<_Lp>*>()(this->_M_pi, __rhs._M_pi); }
+
+ bool
+ _M_less(const __shared_count<_Lp>& __rhs) const
+ { return std::less<_Sp_counted_base<_Lp>*>()(this->_M_pi, __rhs._M_pi); }
+
+ // friend function injected into enclosing namespace and found by ADL
+ friend inline bool
+ operator==(const __weak_count& __a, const __weak_count& __b)
+ { return __a._M_pi == __b._M_pi; }
+
+ private:
+ friend class __shared_count<_Lp>;
+
+ _Sp_counted_base<_Lp>* _M_pi;
+ };
+
+ // now that __weak_count is defined we can define this constructor:
+ template<_Lock_policy _Lp>
+ inline
+ __shared_count<_Lp>::
+ __shared_count(const __weak_count<_Lp>& __r)
+ : _M_pi(__r._M_pi)
+ {
+ if (_M_pi != 0)
+ _M_pi->_M_add_ref_lock();
+ else
+ __throw_bad_weak_ptr();
+ }
+
+ // Forward declarations.
+ template<typename _Tp, _Lock_policy _Lp = __default_lock_policy>
+ class __shared_ptr;
+
+ template<typename _Tp, _Lock_policy _Lp = __default_lock_policy>
+ class __weak_ptr;
+
+ template<typename _Tp, _Lock_policy _Lp = __default_lock_policy>
+ class __enable_shared_from_this;
+
+ template<typename _Tp>
+ class shared_ptr;
+
+ template<typename _Tp>
+ class weak_ptr;
+
+ template<typename _Tp>
+ class enable_shared_from_this;
+
+ // Support for enable_shared_from_this.
+
+ // Friend of __enable_shared_from_this.
+ template<_Lock_policy _Lp, typename _Tp1, typename _Tp2>
+ void
+ __enable_shared_from_this_helper(const __shared_count<_Lp>&,
+ const __enable_shared_from_this<_Tp1,
+ _Lp>*, const _Tp2*);
+
+ // Friend of enable_shared_from_this.
+ template<typename _Tp1, typename _Tp2>
+ void
+ __enable_shared_from_this_helper(const __shared_count<>&,
+ const enable_shared_from_this<_Tp1>*,
+ const _Tp2*);
+
+ template<_Lock_policy _Lp>
+ inline void
+ __enable_shared_from_this_helper(const __shared_count<_Lp>&, ...)
+ { }
+
+
+ template<typename _Tp, _Lock_policy _Lp>
+ class __shared_ptr
+ {
+ public:
+ typedef _Tp element_type;
+
+ /** @brief Construct an empty %__shared_ptr.
+ * @post use_count()==0 && get()==0
+ */
+ __shared_ptr()
+ : _M_ptr(0), _M_refcount() // never throws
+ { }
+
+ /** @brief Construct a %__shared_ptr that owns the pointer @a __p.
+ * @param __p A pointer that is convertible to element_type*.
+ * @post use_count() == 1 && get() == __p
+ * @throw std::bad_alloc, in which case @c delete @a __p is called.
+ */
+ template<typename _Tp1>
+ explicit
+ __shared_ptr(_Tp1* __p)
+ : _M_ptr(__p), _M_refcount(__p)
+ {
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
+ // __glibcxx_function_requires(_CompleteConcept<_Tp1*>)
+ __enable_shared_from_this_helper(_M_refcount, __p, __p);
+ }
+
+ //
+ // Requirements: _Deleter's copy constructor and destructor must
+ // not throw
+ //
+ // __shared_ptr will release __p by calling __d(__p)
+ //
+ /** @brief Construct a %__shared_ptr that owns the pointer @a __p
+ * and the deleter @a __d.
+ * @param __p A pointer.
+ * @param __d A deleter.
+ * @post use_count() == 1 && get() == __p
+ * @throw std::bad_alloc, in which case @a __d(__p) is called.
+ */
+ template<typename _Tp1, typename _Deleter>
+ __shared_ptr(_Tp1* __p, _Deleter __d)
+ : _M_ptr(__p), _M_refcount(__p, __d)
+ {
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
+ // TODO requires _Deleter CopyConstructible and __d(__p) well-formed
+ __enable_shared_from_this_helper(_M_refcount, __p, __p);
+ }
+
+ //
+ // Requirements: _Deleter's copy constructor and destructor must
+ // not throw _Alloc's copy constructor and destructor must not
+ // throw.
+ //
+ // __shared_ptr will release __p by calling __d(__p)
+ //
+ /** @brief Construct a %__shared_ptr that owns the pointer @a __p
+ * and the deleter @a __d.
+ * @param __p A pointer.
+ * @param __d A deleter.
+ * @param __a An allocator.
+ * @post use_count() == 1 && get() == __p
+ * @throw std::bad_alloc, in which case @a __d(__p) is called.
+ */
+ template<typename _Tp1, typename _Deleter, typename _Alloc>
+ __shared_ptr(_Tp1* __p, _Deleter __d, const _Alloc& __a)
+ : _M_ptr(__p), _M_refcount(__p, __d, __a)
+ {
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
+ // TODO requires _Deleter CopyConstructible and __d(__p) well-formed
+ __enable_shared_from_this_helper(_M_refcount, __p, __p);
+ }
+
+ /** @brief Constructs a %__shared_ptr instance that stores @a __p
+ * and shares ownership with @a __r.
+ * @param __r A %__shared_ptr.
+ * @param __p A pointer that will remain valid while @a *__r is valid.
+ * @post get() == __p && use_count() == __r.use_count()
+ *
+ * This can be used to construct a @c shared_ptr to a sub-object
+ * of an object managed by an existing @c shared_ptr.
+ *
+ * @code
+ * shared_ptr< pair<int,int> > pii(new pair<int,int>());
+ * shared_ptr<int> pi(pii, &pii->first);
+ * assert(pii.use_count() == 2);
+ * @endcode
+ */
+ template<typename _Tp1>
+ __shared_ptr(const __shared_ptr<_Tp1, _Lp>& __r, _Tp* __p)
+ : _M_ptr(__p), _M_refcount(__r._M_refcount) // never throws
+ { }
+
+ // generated copy constructor, assignment, destructor are fine.
+
+ /** @brief If @a __r is empty, constructs an empty %__shared_ptr;
+ * otherwise construct a %__shared_ptr that shares ownership
+ * with @a __r.
+ * @param __r A %__shared_ptr.
+ * @post get() == __r.get() && use_count() == __r.use_count()
+ */
+ template<typename _Tp1>
+ __shared_ptr(const __shared_ptr<_Tp1, _Lp>& __r)
+ : _M_ptr(__r._M_ptr), _M_refcount(__r._M_refcount) // never throws
+ { __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>) }
+
+ /** @brief Move-constructs a %__shared_ptr instance from @a __r.
+ * @param __r A %__shared_ptr rvalue.
+ * @post *this contains the old value of @a __r, @a __r is empty.
+ */
+ __shared_ptr(__shared_ptr&& __r)
+ : _M_ptr(__r._M_ptr), _M_refcount() // never throws
+ {
+ _M_refcount._M_swap(__r._M_refcount);
+ __r._M_ptr = 0;
+ }
+
+ /** @brief Move-constructs a %__shared_ptr instance from @a __r.
+ * @param __r A %__shared_ptr rvalue.
+ * @post *this contains the old value of @a __r, @a __r is empty.
+ */
+ template<typename _Tp1>
+ __shared_ptr(__shared_ptr<_Tp1, _Lp>&& __r)
+ : _M_ptr(__r._M_ptr), _M_refcount() // never throws
+ {
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
+ _M_refcount._M_swap(__r._M_refcount);
+ __r._M_ptr = 0;
+ }
+
+ /** @brief Constructs a %__shared_ptr that shares ownership with @a __r
+ * and stores a copy of the pointer stored in @a __r.
+ * @param __r A weak_ptr.
+ * @post use_count() == __r.use_count()
+ * @throw bad_weak_ptr when __r.expired(),
+ * in which case the constructor has no effect.
+ */
+ template<typename _Tp1>
+ explicit
+ __shared_ptr(const __weak_ptr<_Tp1, _Lp>& __r)
+ : _M_refcount(__r._M_refcount) // may throw
+ {
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
+ // It is now safe to copy __r._M_ptr, as _M_refcount(__r._M_refcount)
+ // did not throw.
+ _M_ptr = __r._M_ptr;
+ }
+
+ template<typename _Tp1, typename _Del>
+ explicit
+ __shared_ptr(const std::unique_ptr<_Tp1, _Del>&) = delete;
+
+ /**
+ * If an exception is thrown this constructor has no effect.
+ */
+ template<typename _Tp1, typename _Del>
+ explicit
+ __shared_ptr(std::unique_ptr<_Tp1, _Del>&& __r)
+ : _M_ptr(__r.get()), _M_refcount()
+ {
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
+ _Tp1* __tmp = __r.get();
+ _M_refcount = __shared_count<_Lp>(std::move(__r));
+ __enable_shared_from_this_helper(_M_refcount, __tmp, __tmp);
+ }
+
+#if _GLIBCXX_DEPRECATED
+ /**
+ * @post use_count() == 1 and __r.get() == 0
+ */
+ template<typename _Tp1>
+ explicit
+ __shared_ptr(std::auto_ptr<_Tp1>&& __r)
+ : _M_ptr(__r.get()), _M_refcount()
+ {
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
+ // TODO requires _Tp1 is complete, delete __r.release() well-formed
+ _Tp1* __tmp = __r.get();
+ _M_refcount = __shared_count<_Lp>(std::move(__r));
+ __enable_shared_from_this_helper(_M_refcount, __tmp, __tmp);
+ }
+#endif
+
+ template<typename _Tp1>
+ __shared_ptr&
+ operator=(const __shared_ptr<_Tp1, _Lp>& __r) // never throws
+ {
+ _M_ptr = __r._M_ptr;
+ _M_refcount = __r._M_refcount; // __shared_count::op= doesn't throw
+ return *this;
+ }
+
+#if _GLIBCXX_DEPRECATED
+ template<typename _Tp1>
+ __shared_ptr&
+ operator=(std::auto_ptr<_Tp1>&& __r)
+ {
+ __shared_ptr(std::move(__r)).swap(*this);
+ return *this;
+ }
+#endif
+
+ __shared_ptr&
+ operator=(__shared_ptr&& __r)
+ {
+ __shared_ptr(std::move(__r)).swap(*this);
+ return *this;
+ }
+
+ template<class _Tp1>
+ __shared_ptr&
+ operator=(__shared_ptr<_Tp1, _Lp>&& __r)
+ {
+ __shared_ptr(std::move(__r)).swap(*this);
+ return *this;
+ }
+
+ template<typename _Tp1, typename _Del>
+ __shared_ptr&
+ operator=(const std::unique_ptr<_Tp1, _Del>& __r) = delete;
+
+ template<typename _Tp1, typename _Del>
+ __shared_ptr&
+ operator=(std::unique_ptr<_Tp1, _Del>&& __r)
+ {
+ __shared_ptr(std::move(__r)).swap(*this);
+ return *this;
+ }
+
+ void
+ reset() // never throws
+ { __shared_ptr().swap(*this); }
+
+ template<typename _Tp1>
+ void
+ reset(_Tp1* __p) // _Tp1 must be complete.
+ {
+ // Catch self-reset errors.
+ _GLIBCXX_DEBUG_ASSERT(__p == 0 || __p != _M_ptr);
+ __shared_ptr(__p).swap(*this);
+ }
+
+ template<typename _Tp1, typename _Deleter>
+ void
+ reset(_Tp1* __p, _Deleter __d)
+ { __shared_ptr(__p, __d).swap(*this); }
+
+ template<typename _Tp1, typename _Deleter, typename _Alloc>
+ void
+ reset(_Tp1* __p, _Deleter __d, const _Alloc& __a)
+ { __shared_ptr(__p, __d, __a).swap(*this); }
+
+ // Allow class instantiation when _Tp is [cv-qual] void.
+ typename std::add_lvalue_reference<_Tp>::type
+ operator*() const // never throws
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_ptr != 0);
+ return *_M_ptr;
+ }
+
+ _Tp*
+ operator->() const // never throws
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_ptr != 0);
+ return _M_ptr;
+ }
+
+ _Tp*
+ get() const // never throws
+ { return _M_ptr; }
+
+ // Implicit conversion to "bool"
+ private:
+ typedef _Tp* __shared_ptr::*__unspecified_bool_type;
+
+ public:
+ operator __unspecified_bool_type() const // never throws
+ { return _M_ptr == 0 ? 0 : &__shared_ptr::_M_ptr; }
+
+ bool
+ unique() const // never throws
+ { return _M_refcount._M_unique(); }
+
+ long
+ use_count() const // never throws
+ { return _M_refcount._M_get_use_count(); }
+
+ void
+ swap(__shared_ptr<_Tp, _Lp>&& __other) // never throws
+ {
+ std::swap(_M_ptr, __other._M_ptr);
+ _M_refcount._M_swap(__other._M_refcount);
+ }
+
+ template<typename _Tp1>
+ bool
+ owner_before(__shared_ptr<_Tp1, _Lp> const& __rhs) const
+ { return _M_refcount._M_less(__rhs._M_refcount); }
+
+ template<typename _Tp1>
+ bool
+ owner_before(__weak_ptr<_Tp1, _Lp> const& __rhs) const
+ { return _M_refcount._M_less(__rhs._M_refcount); }
+
+ protected:
+ // This constructor is non-standard, it is used by allocate_shared.
+ template<typename _Alloc, typename... _Args>
+ __shared_ptr(_Sp_make_shared_tag __tag, _Alloc __a, _Args&&... __args)
+ : _M_ptr(), _M_refcount(__tag, (_Tp*)0, __a,
+ std::forward<_Args>(__args)...)
+ {
+ // _M_ptr needs to point to the newly constructed object.
+ // This relies on _Sp_counted_ptr_inplace::_M_get_deleter.
+ void* __p = _M_refcount._M_get_deleter(typeid(__tag));
+ _M_ptr = static_cast<_Tp*>(__p);
+ __enable_shared_from_this_helper(_M_refcount, _M_ptr, _M_ptr);
+ }
+
+ template<typename _Tp1, _Lock_policy _Lp1, typename _Alloc,
+ typename... _Args>
+ friend __shared_ptr<_Tp1, _Lp1>
+ __allocate_shared(_Alloc __a, _Args&&... __args);
+
+ private:
+ void*
+ _M_get_deleter(const std::type_info& __ti) const
+ { return _M_refcount._M_get_deleter(__ti); }
+
+ template<typename _Tp1, _Lock_policy _Lp1> friend class __shared_ptr;
+ template<typename _Tp1, _Lock_policy _Lp1> friend class __weak_ptr;
+
+ template<typename _Del, typename _Tp1, _Lock_policy _Lp1>
+ friend _Del* get_deleter(const __shared_ptr<_Tp1, _Lp1>&);
+
+ _Tp* _M_ptr; // Contained pointer.
+ __shared_count<_Lp> _M_refcount; // Reference counter.
+ };
+
+ // 20.8.13.2.7 shared_ptr comparisons
+ template<typename _Tp1, typename _Tp2, _Lock_policy _Lp>
+ inline bool
+ operator==(const __shared_ptr<_Tp1, _Lp>& __a,
+ const __shared_ptr<_Tp2, _Lp>& __b)
+ { return __a.get() == __b.get(); }
+
+ template<typename _Tp1, typename _Tp2, _Lock_policy _Lp>
+ inline bool
+ operator!=(const __shared_ptr<_Tp1, _Lp>& __a,
+ const __shared_ptr<_Tp2, _Lp>& __b)
+ { return __a.get() != __b.get(); }
+
+ template<typename _Tp1, typename _Tp2, _Lock_policy _Lp>
+ inline bool
+ operator<(const __shared_ptr<_Tp1, _Lp>& __a,
+ const __shared_ptr<_Tp2, _Lp>& __b)
+ { return __a.get() < __b.get(); }
+
+ template<typename _Sp>
+ struct _Sp_less : public binary_function<_Sp, _Sp, bool>
+ {
+ bool
+ operator()(const _Sp& __lhs, const _Sp& __rhs) const
+ {
+ return std::less<typename _Sp::element_type*>()(__lhs.get(),
+ __rhs.get());
+ }
+ };
+
+ template<typename _Tp, _Lock_policy _Lp>
+ struct less<__shared_ptr<_Tp, _Lp>>
+ : public _Sp_less<__shared_ptr<_Tp, _Lp>>
+ { };
+
+ // XXX LessThanComparable<_Tp> concept should provide >, >= and <=
+ template<typename _Tp, _Lock_policy _Lp>
+ inline bool
+ operator>(const __shared_ptr<_Tp, _Lp>& __a,
+ const __shared_ptr<_Tp, _Lp>& __b)
+ { return __a.get() > __b.get(); }
+
+ template<typename _Tp, _Lock_policy _Lp>
+ inline bool
+ operator>=(const __shared_ptr<_Tp, _Lp>& __a,
+ const __shared_ptr<_Tp, _Lp>& __b)
+ { return __a.get() >= __b.get(); }
+
+ template<typename _Tp, _Lock_policy _Lp>
+ inline bool
+ operator<=(const __shared_ptr<_Tp, _Lp>& __a,
+ const __shared_ptr<_Tp, _Lp>& __b)
+ { return __a.get() <= __b.get(); }
+
+ // 2.2.3.8 shared_ptr specialized algorithms.
+ template<typename _Tp, _Lock_policy _Lp>
+ inline void
+ swap(__shared_ptr<_Tp, _Lp>& __a, __shared_ptr<_Tp, _Lp>& __b)
+ { __a.swap(__b); }
+
+ template<typename _Tp, _Lock_policy _Lp>
+ inline void
+ swap(__shared_ptr<_Tp, _Lp>&& __a, __shared_ptr<_Tp, _Lp>& __b)
+ { __a.swap(__b); }
+
+ template<typename _Tp, _Lock_policy _Lp>
+ inline void
+ swap(__shared_ptr<_Tp, _Lp>& __a, __shared_ptr<_Tp, _Lp>&& __b)
+ { __a.swap(__b); }
+
+ // 2.2.3.9 shared_ptr casts
+ /** @warning The seemingly equivalent
+ * <code>shared_ptr<_Tp, _Lp>(static_cast<_Tp*>(__r.get()))</code>
+ * will eventually result in undefined behaviour,
+ * attempting to delete the same object twice.
+ */
+ template<typename _Tp, typename _Tp1, _Lock_policy _Lp>
+ inline __shared_ptr<_Tp, _Lp>
+ static_pointer_cast(const __shared_ptr<_Tp1, _Lp>& __r)
+ { return __shared_ptr<_Tp, _Lp>(__r, static_cast<_Tp*>(__r.get())); }
+
+ /** @warning The seemingly equivalent
+ * <code>shared_ptr<_Tp, _Lp>(const_cast<_Tp*>(__r.get()))</code>
+ * will eventually result in undefined behaviour,
+ * attempting to delete the same object twice.
+ */
+ template<typename _Tp, typename _Tp1, _Lock_policy _Lp>
+ inline __shared_ptr<_Tp, _Lp>
+ const_pointer_cast(const __shared_ptr<_Tp1, _Lp>& __r)
+ { return __shared_ptr<_Tp, _Lp>(__r, const_cast<_Tp*>(__r.get())); }
+
+ /** @warning The seemingly equivalent
+ * <code>shared_ptr<_Tp, _Lp>(dynamic_cast<_Tp*>(__r.get()))</code>
+ * will eventually result in undefined behaviour,
+ * attempting to delete the same object twice.
+ */
+ template<typename _Tp, typename _Tp1, _Lock_policy _Lp>
+ inline __shared_ptr<_Tp, _Lp>
+ dynamic_pointer_cast(const __shared_ptr<_Tp1, _Lp>& __r)
+ {
+ if (_Tp* __p = dynamic_cast<_Tp*>(__r.get()))
+ return __shared_ptr<_Tp, _Lp>(__r, __p);
+ return __shared_ptr<_Tp, _Lp>();
+ }
+
+ // 2.2.3.7 shared_ptr I/O
+ template<typename _Ch, typename _Tr, typename _Tp, _Lock_policy _Lp>
+ std::basic_ostream<_Ch, _Tr>&
+ operator<<(std::basic_ostream<_Ch, _Tr>& __os,
+ const __shared_ptr<_Tp, _Lp>& __p)
+ {
+ __os << __p.get();
+ return __os;
+ }
+
+ // 2.2.3.10 shared_ptr get_deleter (experimental)
+ template<typename _Del, typename _Tp, _Lock_policy _Lp>
+ inline _Del*
+ get_deleter(const __shared_ptr<_Tp, _Lp>& __p)
+ { return static_cast<_Del*>(__p._M_get_deleter(typeid(_Del))); }
+
+
+ template<typename _Tp, _Lock_policy _Lp>
+ class __weak_ptr
+ {
+ public:
+ typedef _Tp element_type;
+
+ __weak_ptr()
+ : _M_ptr(0), _M_refcount() // never throws
+ { }
+
+ // Generated copy constructor, assignment, destructor are fine.
+
+ // The "obvious" converting constructor implementation:
+ //
+ // template<typename _Tp1>
+ // __weak_ptr(const __weak_ptr<_Tp1, _Lp>& __r)
+ // : _M_ptr(__r._M_ptr), _M_refcount(__r._M_refcount) // never throws
+ // { }
+ //
+ // has a serious problem.
+ //
+ // __r._M_ptr may already have been invalidated. The _M_ptr(__r._M_ptr)
+ // conversion may require access to *__r._M_ptr (virtual inheritance).
+ //
+ // It is not possible to avoid spurious access violations since
+ // in multithreaded programs __r._M_ptr may be invalidated at any point.
+ template<typename _Tp1>
+ __weak_ptr(const __weak_ptr<_Tp1, _Lp>& __r)
+ : _M_refcount(__r._M_refcount) // never throws
+ {
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
+ _M_ptr = __r.lock().get();
+ }
+
+ template<typename _Tp1>
+ __weak_ptr(const __shared_ptr<_Tp1, _Lp>& __r)
+ : _M_ptr(__r._M_ptr), _M_refcount(__r._M_refcount) // never throws
+ { __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>) }
+
+ template<typename _Tp1>
+ __weak_ptr&
+ operator=(const __weak_ptr<_Tp1, _Lp>& __r) // never throws
+ {
+ _M_ptr = __r.lock().get();
+ _M_refcount = __r._M_refcount;
+ return *this;
+ }
+
+ template<typename _Tp1>
+ __weak_ptr&
+ operator=(const __shared_ptr<_Tp1, _Lp>& __r) // never throws
+ {
+ _M_ptr = __r._M_ptr;
+ _M_refcount = __r._M_refcount;
+ return *this;
+ }
+
+ __shared_ptr<_Tp, _Lp>
+ lock() const // never throws
+ {
+#ifdef __GTHREADS
+ // Optimization: avoid throw overhead.
+ if (expired())
+ return __shared_ptr<element_type, _Lp>();
+
+ __try
+ {
+ return __shared_ptr<element_type, _Lp>(*this);
+ }
+ __catch(const bad_weak_ptr&)
+ {
+ // Q: How can we get here?
+ // A: Another thread may have invalidated r after the
+ // use_count test above.
+ return __shared_ptr<element_type, _Lp>();
+ }
+
+#else
+ // Optimization: avoid try/catch overhead when single threaded.
+ return expired() ? __shared_ptr<element_type, _Lp>()
+ : __shared_ptr<element_type, _Lp>(*this);
+
+#endif
+ } // XXX MT
+
+ long
+ use_count() const // never throws
+ { return _M_refcount._M_get_use_count(); }
+
+ bool
+ expired() const // never throws
+ { return _M_refcount._M_get_use_count() == 0; }
+
+ template<typename _Tp1>
+ bool
+ owner_before(const __shared_ptr<_Tp1, _Lp>& __rhs) const
+ { return _M_refcount._M_less(__rhs._M_refcount); }
+
+ template<typename _Tp1>
+ bool
+ owner_before(const __weak_ptr<_Tp1, _Lp>& __rhs) const
+ { return _M_refcount._M_less(__rhs._M_refcount); }
+
+ void
+ reset() // never throws
+ { __weak_ptr().swap(*this); }
+
+ void
+ swap(__weak_ptr& __s) // never throws
+ {
+ std::swap(_M_ptr, __s._M_ptr);
+ _M_refcount._M_swap(__s._M_refcount);
+ }
+
+ // comparisons
+ template<typename _Tp1>
+ bool operator<(const __weak_ptr<_Tp1, _Lp>&) const = delete;
+ template<typename _Tp1>
+ bool operator<=(const __weak_ptr<_Tp1, _Lp>&) const = delete;
+ template<typename _Tp1>
+ bool operator>(const __weak_ptr<_Tp1, _Lp>&) const = delete;
+ template<typename _Tp1>
+ bool operator>=(const __weak_ptr<_Tp1, _Lp>&) const = delete;
+
+ private:
+ // Used by __enable_shared_from_this.
+ void
+ _M_assign(_Tp* __ptr, const __shared_count<_Lp>& __refcount)
+ {
+ _M_ptr = __ptr;
+ _M_refcount = __refcount;
+ }
+
+ template<typename _Tp1, _Lock_policy _Lp1> friend class __shared_ptr;
+ template<typename _Tp1, _Lock_policy _Lp1> friend class __weak_ptr;
+ friend class __enable_shared_from_this<_Tp, _Lp>;
+ friend class enable_shared_from_this<_Tp>;
+
+ _Tp* _M_ptr; // Contained pointer.
+ __weak_count<_Lp> _M_refcount; // Reference counter.
+ };
+
+ // 20.8.13.3.7 weak_ptr specialized algorithms.
+ template<typename _Tp, _Lock_policy _Lp>
+ inline void
+ swap(__weak_ptr<_Tp, _Lp>& __a, __weak_ptr<_Tp, _Lp>& __b)
+ { __a.swap(__b); }
+
+ /// owner_less
+ template<typename _Tp> struct owner_less;
+
+ template<typename _Tp, typename _Tp1>
+ struct _Sp_owner_less : public binary_function<_Tp, _Tp, bool>
+ {
+ bool
+ operator()(const _Tp& __lhs, const _Tp& __rhs) const
+ { return __lhs.owner_before(__rhs); }
+ bool
+ operator()(const _Tp& __lhs, const _Tp1& __rhs) const
+ { return __lhs.owner_before(__rhs); }
+ bool
+ operator()(const _Tp1& __lhs, const _Tp& __rhs) const
+ { return __lhs.owner_before(__rhs); }
+ };
+
+ template<typename _Tp, _Lock_policy _Lp>
+ struct owner_less<__shared_ptr<_Tp, _Lp>>
+ : public _Sp_owner_less<__shared_ptr<_Tp, _Lp>, __weak_ptr<_Tp, _Lp>>
+ { };
+
+ template<typename _Tp, _Lock_policy _Lp>
+ struct owner_less<__weak_ptr<_Tp, _Lp>>
+ : public _Sp_owner_less<__weak_ptr<_Tp, _Lp>, __shared_ptr<_Tp, _Lp>>
+ {
+ };
+
+
+ template<typename _Tp, _Lock_policy _Lp>
+ class __enable_shared_from_this
+ {
+ protected:
+ __enable_shared_from_this() { }
+
+ __enable_shared_from_this(const __enable_shared_from_this&) { }
+
+ __enable_shared_from_this&
+ operator=(const __enable_shared_from_this&)
+ { return *this; }
+
+ ~__enable_shared_from_this() { }
+
+ public:
+ __shared_ptr<_Tp, _Lp>
+ shared_from_this()
+ { return __shared_ptr<_Tp, _Lp>(this->_M_weak_this); }
+
+ __shared_ptr<const _Tp, _Lp>
+ shared_from_this() const
+ { return __shared_ptr<const _Tp, _Lp>(this->_M_weak_this); }
+
+ private:
+ template<typename _Tp1>
+ void
+ _M_weak_assign(_Tp1* __p, const __shared_count<_Lp>& __n) const
+ { _M_weak_this._M_assign(__p, __n); }
+
+ template<typename _Tp1>
+ friend void
+ __enable_shared_from_this_helper(const __shared_count<_Lp>& __pn,
+ const __enable_shared_from_this* __pe,
+ const _Tp1* __px)
+ {
+ if (__pe != 0)
+ __pe->_M_weak_assign(const_cast<_Tp1*>(__px), __pn);
+ }
+
+ mutable __weak_ptr<_Tp, _Lp> _M_weak_this;
+ };
+
+ /**
+ * @brief A smart pointer with reference-counted copy semantics.
+ *
+ * The object pointed to is deleted when the last shared_ptr pointing to
+ * it is destroyed or reset.
+ */
+ template<typename _Tp>
+ class shared_ptr
+ : public __shared_ptr<_Tp>
+ {
+ public:
+ shared_ptr()
+ : __shared_ptr<_Tp>() { }
+
+ template<typename _Tp1>
+ explicit
+ shared_ptr(_Tp1* __p)
+ : __shared_ptr<_Tp>(__p) { }
+
+ template<typename _Tp1, typename _Deleter>
+ shared_ptr(_Tp1* __p, _Deleter __d)
+ : __shared_ptr<_Tp>(__p, __d) { }
+
+ template<typename _Tp1, typename _Deleter, typename _Alloc>
+ shared_ptr(_Tp1* __p, _Deleter __d, const _Alloc& __a)
+ : __shared_ptr<_Tp>(__p, __d, __a) { }
+
+ // Aliasing constructor
+ template<typename _Tp1>
+ shared_ptr(const shared_ptr<_Tp1>& __r, _Tp* __p)
+ : __shared_ptr<_Tp>(__r, __p) { }
+
+ template<typename _Tp1>
+ shared_ptr(const shared_ptr<_Tp1>& __r)
+ : __shared_ptr<_Tp>(__r) { }
+
+ shared_ptr(shared_ptr&& __r)
+ : __shared_ptr<_Tp>(std::move(__r)) { }
+
+ template<typename _Tp1>
+ shared_ptr(shared_ptr<_Tp1>&& __r)
+ : __shared_ptr<_Tp>(std::move(__r)) { }
+
+ template<typename _Tp1>
+ explicit
+ shared_ptr(const weak_ptr<_Tp1>& __r)
+ : __shared_ptr<_Tp>(__r) { }
+
+#if _GLIBCXX_DEPRECATED
+ template<typename _Tp1>
+ explicit
+ shared_ptr(std::auto_ptr<_Tp1>&& __r)
+ : __shared_ptr<_Tp>(std::move(__r)) { }
+#endif
+
+ template<typename _Tp1, typename _Del>
+ explicit
+ shared_ptr(const std::unique_ptr<_Tp1, _Del>&) = delete;
+
+ template<typename _Tp1, typename _Del>
+ explicit
+ shared_ptr(std::unique_ptr<_Tp1, _Del>&& __r)
+ : __shared_ptr<_Tp>(std::move(__r)) { }
+
+ template<typename _Tp1>
+ shared_ptr&
+ operator=(const shared_ptr<_Tp1>& __r) // never throws
+ {
+ this->__shared_ptr<_Tp>::operator=(__r);
+ return *this;
+ }
+
+#if _GLIBCXX_DEPRECATED
+ template<typename _Tp1>
+ shared_ptr&
+ operator=(std::auto_ptr<_Tp1>&& __r)
+ {
+ this->__shared_ptr<_Tp>::operator=(std::move(__r));
+ return *this;
+ }
+#endif
+
+ shared_ptr&
+ operator=(shared_ptr&& __r)
+ {
+ this->__shared_ptr<_Tp>::operator=(std::move(__r));
+ return *this;
+ }
+
+ template<class _Tp1>
+ shared_ptr&
+ operator=(shared_ptr<_Tp1>&& __r)
+ {
+ this->__shared_ptr<_Tp>::operator=(std::move(__r));
+ return *this;
+ }
+
+ template<typename _Tp1, typename _Del>
+ shared_ptr&
+ operator=(const std::unique_ptr<_Tp1, _Del>& __r) = delete;
+
+ template<typename _Tp1, typename _Del>
+ shared_ptr&
+ operator=(std::unique_ptr<_Tp1, _Del>&& __r)
+ {
+ this->__shared_ptr<_Tp>::operator=(std::move(__r));
+ return *this;
+ }
+
+ private:
+ // This constructor is non-standard, it is used by allocate_shared.
+ template<typename _Alloc, typename... _Args>
+ shared_ptr(_Sp_make_shared_tag __tag, _Alloc __a, _Args&&... __args)
+ : __shared_ptr<_Tp>(__tag, __a, std::forward<_Args>(__args)...)
+ { }
+
+ template<typename _Tp1, typename _Alloc, typename... _Args>
+ friend shared_ptr<_Tp1>
+ allocate_shared(_Alloc __a, _Args&&... __args);
+ };
+
+ // 20.8.13.2.7 shared_ptr comparisons
+ template<typename _Tp1, typename _Tp2>
+ inline bool
+ operator==(const shared_ptr<_Tp1>& __a, const shared_ptr<_Tp2>& __b)
+ { return __a.get() == __b.get(); }
+
+ template<typename _Tp1, typename _Tp2>
+ inline bool
+ operator!=(const shared_ptr<_Tp1>& __a, const shared_ptr<_Tp2>& __b)
+ { return __a.get() != __b.get(); }
+
+ template<typename _Tp1, typename _Tp2>
+ inline bool
+ operator<(const shared_ptr<_Tp1>& __a, const shared_ptr<_Tp2>& __b)
+ { return __a.get() < __b.get(); }
+
+ template<typename _Tp>
+ struct less<shared_ptr<_Tp>>
+ : public _Sp_less<shared_ptr<_Tp>>
+ { };
+
+ // 20.8.13.2.9 shared_ptr specialized algorithms.
+ template<typename _Tp>
+ inline void
+ swap(shared_ptr<_Tp>& __a, shared_ptr<_Tp>& __b)
+ { __a.swap(__b); }
+
+ template<typename _Tp>
+ inline void
+ swap(shared_ptr<_Tp>&& __a, shared_ptr<_Tp>& __b)
+ { __a.swap(__b); }
+
+ template<typename _Tp>
+ inline void
+ swap(shared_ptr<_Tp>& __a, shared_ptr<_Tp>&& __b)
+ { __a.swap(__b); }
+
+ // 20.8.13.2.10 shared_ptr casts.
+ template<typename _Tp, typename _Tp1>
+ inline shared_ptr<_Tp>
+ static_pointer_cast(const shared_ptr<_Tp1>& __r)
+ { return shared_ptr<_Tp>(__r, static_cast<_Tp*>(__r.get())); }
+
+ template<typename _Tp, typename _Tp1>
+ inline shared_ptr<_Tp>
+ const_pointer_cast(const shared_ptr<_Tp1>& __r)
+ { return shared_ptr<_Tp>(__r, const_cast<_Tp*>(__r.get())); }
+
+ template<typename _Tp, typename _Tp1>
+ inline shared_ptr<_Tp>
+ dynamic_pointer_cast(const shared_ptr<_Tp1>& __r)
+ {
+ if (_Tp* __p = dynamic_cast<_Tp*>(__r.get()))
+ return shared_ptr<_Tp>(__r, __p);
+ return shared_ptr<_Tp>();
+ }
+
+
+ /**
+ * @brief A smart pointer with weak semantics.
+ *
+ * With forwarding constructors and assignment operators.
+ */
+ template<typename _Tp>
+ class weak_ptr
+ : public __weak_ptr<_Tp>
+ {
+ public:
+ weak_ptr()
+ : __weak_ptr<_Tp>() { }
+
+ template<typename _Tp1>
+ weak_ptr(const weak_ptr<_Tp1>& __r)
+ : __weak_ptr<_Tp>(__r) { }
+
+ template<typename _Tp1>
+ weak_ptr(const shared_ptr<_Tp1>& __r)
+ : __weak_ptr<_Tp>(__r) { }
+
+ template<typename _Tp1>
+ weak_ptr&
+ operator=(const weak_ptr<_Tp1>& __r) // never throws
+ {
+ this->__weak_ptr<_Tp>::operator=(__r);
+ return *this;
+ }
+
+ template<typename _Tp1>
+ weak_ptr&
+ operator=(const shared_ptr<_Tp1>& __r) // never throws
+ {
+ this->__weak_ptr<_Tp>::operator=(__r);
+ return *this;
+ }
+
+ shared_ptr<_Tp>
+ lock() const // never throws
+ {
+#ifdef __GTHREADS
+ if (this->expired())
+ return shared_ptr<_Tp>();
+
+ __try
+ {
+ return shared_ptr<_Tp>(*this);
+ }
+ __catch(const bad_weak_ptr&)
+ {
+ return shared_ptr<_Tp>();
+ }
+#else
+ return this->expired() ? shared_ptr<_Tp>()
+ : shared_ptr<_Tp>(*this);
+#endif
+ }
+
+ // comparisons
+ template<typename _Tp1>
+ bool operator<(const weak_ptr<_Tp1>&) const = delete;
+ template<typename _Tp1>
+ bool operator<=(const weak_ptr<_Tp1>&) const = delete;
+ template<typename _Tp1>
+ bool operator>(const weak_ptr<_Tp1>&) const = delete;
+ template<typename _Tp1>
+ bool operator>=(const weak_ptr<_Tp1>&) const = delete;
+ };
+
+ // 20.8.13.3.7 weak_ptr specialized algorithms.
+ template<typename _Tp>
+ inline void
+ swap(weak_ptr<_Tp>& __a, weak_ptr<_Tp>& __b)
+ { __a.swap(__b); }
+
+ /// owner_less
+ template<typename _Tp>
+ struct owner_less<shared_ptr<_Tp>>
+ : public _Sp_owner_less<shared_ptr<_Tp>, weak_ptr<_Tp>>
+ { };
+
+ template<typename _Tp>
+ struct owner_less<weak_ptr<_Tp>>
+ : public _Sp_owner_less<weak_ptr<_Tp>, shared_ptr<_Tp>>
+ { };
+
+ /**
+ * @brief Base class allowing use of member function shared_from_this.
+ */
+ template<typename _Tp>
+ class enable_shared_from_this
+ {
+ protected:
+ enable_shared_from_this() { }
+
+ enable_shared_from_this(const enable_shared_from_this&) { }
+
+ enable_shared_from_this&
+ operator=(const enable_shared_from_this&)
+ { return *this; }
+
+ ~enable_shared_from_this() { }
+
+ public:
+ shared_ptr<_Tp>
+ shared_from_this()
+ { return shared_ptr<_Tp>(this->_M_weak_this); }
+
+ shared_ptr<const _Tp>
+ shared_from_this() const
+ { return shared_ptr<const _Tp>(this->_M_weak_this); }
+
+ private:
+ template<typename _Tp1>
+ void
+ _M_weak_assign(_Tp1* __p, const __shared_count<>& __n) const
+ { _M_weak_this._M_assign(__p, __n); }
+
+ template<typename _Tp1>
+ friend void
+ __enable_shared_from_this_helper(const __shared_count<>& __pn,
+ const enable_shared_from_this* __pe,
+ const _Tp1* __px)
+ {
+ if (__pe != 0)
+ __pe->_M_weak_assign(const_cast<_Tp1*>(__px), __pn);
+ }
+
+ mutable weak_ptr<_Tp> _M_weak_this;
+ };
+
+ template<typename _Tp, _Lock_policy _Lp, typename _Alloc, typename... _Args>
+ inline __shared_ptr<_Tp, _Lp>
+ __allocate_shared(_Alloc __a, _Args&&... __args)
+ {
+ return __shared_ptr<_Tp, _Lp>(_Sp_make_shared_tag(),
+ std::forward<_Alloc>(__a), std::forward<_Args>(__args)...);
+ }
+
+ template<typename _Tp, _Lock_policy _Lp, typename... _Args>
+ inline __shared_ptr<_Tp, _Lp>
+ __make_shared(_Args&&... __args)
+ {
+ typedef typename std::remove_const<_Tp>::type _Tp_nc;
+ return __allocate_shared<_Tp, _Lp>(std::allocator<_Tp_nc>(),
+ std::forward<_Args>(__args)...);
+ }
+
+ /** @brief Create an object that is owned by a shared_ptr.
+ * @param __a An allocator.
+ * @param __args Arguments for the @a _Tp object's constructor.
+ * @return A shared_ptr that owns the newly created object.
+ * @throw An exception thrown from @a _Alloc::allocate or from the
+ * constructor of @a _Tp.
+ *
+ * A copy of @a __a will be used to allocate memory for the shared_ptr
+ * and the new object.
+ */
+ template<typename _Tp, typename _Alloc, typename... _Args>
+ inline shared_ptr<_Tp>
+ allocate_shared(_Alloc __a, _Args&&... __args)
+ {
+ return shared_ptr<_Tp>(_Sp_make_shared_tag(), std::forward<_Alloc>(__a),
+ std::forward<_Args>(__args)...);
+ }
+
+ /** @brief Create an object that is owned by a shared_ptr.
+ * @param __args Arguments for the @a _Tp object's constructor.
+ * @return A shared_ptr that owns the newly created object.
+ * @throw std::bad_alloc, or an exception thrown from the
+ * constructor of @a _Tp.
+ */
+ template<typename _Tp, typename... _Args>
+ inline shared_ptr<_Tp>
+ make_shared(_Args&&... __args)
+ {
+ typedef typename std::remove_const<_Tp>::type _Tp_nc;
+ return allocate_shared<_Tp>(std::allocator<_Tp_nc>(),
+ std::forward<_Args>(__args)...);
+ }
+
+ // @} group pointer_abstractions
+
+_GLIBCXX_END_NAMESPACE
+
+#endif // _SHARED_PTR_H
diff --git a/i686-linux/include/c++/4.4.3/bits/slice_array.h b/i686-linux/include/c++/4.4.3/bits/slice_array.h
new file mode 100644
index 0000000..566c764
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/slice_array.h
@@ -0,0 +1,272 @@
+// The template and inlines for the -*- C++ -*- slice_array class.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file slice_array.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
+
+#ifndef _SLICE_ARRAY_H
+#define _SLICE_ARRAY_H 1
+
+#pragma GCC system_header
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @addtogroup numeric_arrays
+ * @{
+ */
+
+ /**
+ * @brief Class defining one-dimensional subset of an array.
+ *
+ * The slice class represents a one-dimensional subset of an array,
+ * specified by three parameters: start offset, size, and stride. The
+ * start offset is the index of the first element of the array that is part
+ * of the subset. The size is the total number of elements in the subset.
+ * Stride is the distance between each successive array element to include
+ * in the subset.
+ *
+ * For example, with an array of size 10, and a slice with offset 1, size 3
+ * and stride 2, the subset consists of array elements 1, 3, and 5.
+ */
+ class slice
+ {
+ public:
+ /// Construct an empty slice.
+ slice();
+
+ /**
+ * @brief Construct a slice.
+ *
+ * @param o Offset in array of first element.
+ * @param d Number of elements in slice.
+ * @param s Stride between array elements.
+ */
+ slice(size_t, size_t, size_t);
+
+ /// Return array offset of first slice element.
+ size_t start() const;
+ /// Return size of slice.
+ size_t size() const;
+ /// Return array stride of slice.
+ size_t stride() const;
+
+ private:
+ size_t _M_off; // offset
+ size_t _M_sz; // size
+ size_t _M_st; // stride unit
+ };
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 543. valarray slice default constructor
+ inline
+ slice::slice()
+ : _M_off(0), _M_sz(0), _M_st(0) {}
+
+ inline
+ slice::slice(size_t __o, size_t __d, size_t __s)
+ : _M_off(__o), _M_sz(__d), _M_st(__s) {}
+
+ inline size_t
+ slice::start() const
+ { return _M_off; }
+
+ inline size_t
+ slice::size() const
+ { return _M_sz; }
+
+ inline size_t
+ slice::stride() const
+ { return _M_st; }
+
+ /**
+ * @brief Reference to one-dimensional subset of an array.
+ *
+ * A slice_array is a reference to the actual elements of an array
+ * specified by a slice. The way to get a slice_array is to call
+ * operator[](slice) on a valarray. The returned slice_array then permits
+ * carrying operations out on the referenced subset of elements in the
+ * original valarray. For example, operator+=(valarray) will add values
+ * to the subset of elements in the underlying valarray this slice_array
+ * refers to.
+ *
+ * @param Tp Element type.
+ */
+ template<typename _Tp>
+ class slice_array
+ {
+ public:
+ typedef _Tp value_type;
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 253. valarray helper functions are almost entirely useless
+
+ /// Copy constructor. Both slices refer to the same underlying array.
+ slice_array(const slice_array&);
+
+ /// Assignment operator. Assigns slice elements to corresponding
+ /// elements of @a a.
+ slice_array& operator=(const slice_array&);
+
+ /// Assign slice elements to corresponding elements of @a v.
+ void operator=(const valarray<_Tp>&) const;
+ /// Multiply slice elements by corresponding elements of @a v.
+ void operator*=(const valarray<_Tp>&) const;
+ /// Divide slice elements by corresponding elements of @a v.
+ void operator/=(const valarray<_Tp>&) const;
+ /// Modulo slice elements by corresponding elements of @a v.
+ void operator%=(const valarray<_Tp>&) const;
+ /// Add corresponding elements of @a v to slice elements.
+ void operator+=(const valarray<_Tp>&) const;
+ /// Subtract corresponding elements of @a v from slice elements.
+ void operator-=(const valarray<_Tp>&) const;
+ /// Logical xor slice elements with corresponding elements of @a v.
+ void operator^=(const valarray<_Tp>&) const;
+ /// Logical and slice elements with corresponding elements of @a v.
+ void operator&=(const valarray<_Tp>&) const;
+ /// Logical or slice elements with corresponding elements of @a v.
+ void operator|=(const valarray<_Tp>&) const;
+ /// Left shift slice elements by corresponding elements of @a v.
+ void operator<<=(const valarray<_Tp>&) const;
+ /// Right shift slice elements by corresponding elements of @a v.
+ void operator>>=(const valarray<_Tp>&) const;
+ /// Assign all slice elements to @a t.
+ void operator=(const _Tp &) const;
+ // ~slice_array ();
+
+ template<class _Dom>
+ void operator=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator*=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator/=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator%=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator+=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator-=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator^=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator&=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator|=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator<<=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator>>=(const _Expr<_Dom, _Tp>&) const;
+
+ private:
+ friend class valarray<_Tp>;
+ slice_array(_Array<_Tp>, const slice&);
+
+ const size_t _M_sz;
+ const size_t _M_stride;
+ const _Array<_Tp> _M_array;
+
+ // not implemented
+ slice_array();
+ };
+
+ template<typename _Tp>
+ inline
+ slice_array<_Tp>::slice_array(_Array<_Tp> __a, const slice& __s)
+ : _M_sz(__s.size()), _M_stride(__s.stride()),
+ _M_array(__a.begin() + __s.start()) {}
+
+ template<typename _Tp>
+ inline
+ slice_array<_Tp>::slice_array(const slice_array<_Tp>& a)
+ : _M_sz(a._M_sz), _M_stride(a._M_stride), _M_array(a._M_array) {}
+
+ // template<typename _Tp>
+ // inline slice_array<_Tp>::~slice_array () {}
+
+ template<typename _Tp>
+ inline slice_array<_Tp>&
+ slice_array<_Tp>::operator=(const slice_array<_Tp>& __a)
+ {
+ std::__valarray_copy(__a._M_array, __a._M_sz, __a._M_stride,
+ _M_array, _M_stride);
+ return *this;
+ }
+
+ template<typename _Tp>
+ inline void
+ slice_array<_Tp>::operator=(const _Tp& __t) const
+ { std::__valarray_fill(_M_array, _M_sz, _M_stride, __t); }
+
+ template<typename _Tp>
+ inline void
+ slice_array<_Tp>::operator=(const valarray<_Tp>& __v) const
+ { std::__valarray_copy(_Array<_Tp>(__v), _M_array, _M_sz, _M_stride); }
+
+ template<typename _Tp>
+ template<class _Dom>
+ inline void
+ slice_array<_Tp>::operator=(const _Expr<_Dom,_Tp>& __e) const
+ { std::__valarray_copy(__e, _M_sz, _M_array, _M_stride); }
+
+#undef _DEFINE_VALARRAY_OPERATOR
+#define _DEFINE_VALARRAY_OPERATOR(_Op,_Name) \
+ template<typename _Tp> \
+ inline void \
+ slice_array<_Tp>::operator _Op##=(const valarray<_Tp>& __v) const \
+ { \
+ _Array_augmented_##_Name(_M_array, _M_sz, _M_stride, _Array<_Tp>(__v));\
+ } \
+ \
+ template<typename _Tp> \
+ template<class _Dom> \
+ inline void \
+ slice_array<_Tp>::operator _Op##=(const _Expr<_Dom,_Tp>& __e) const\
+ { \
+ _Array_augmented_##_Name(_M_array, _M_stride, __e, _M_sz); \
+ }
+
+
+_DEFINE_VALARRAY_OPERATOR(*, __multiplies)
+_DEFINE_VALARRAY_OPERATOR(/, __divides)
+_DEFINE_VALARRAY_OPERATOR(%, __modulus)
+_DEFINE_VALARRAY_OPERATOR(+, __plus)
+_DEFINE_VALARRAY_OPERATOR(-, __minus)
+_DEFINE_VALARRAY_OPERATOR(^, __bitwise_xor)
+_DEFINE_VALARRAY_OPERATOR(&, __bitwise_and)
+_DEFINE_VALARRAY_OPERATOR(|, __bitwise_or)
+_DEFINE_VALARRAY_OPERATOR(<<, __shift_left)
+_DEFINE_VALARRAY_OPERATOR(>>, __shift_right)
+
+#undef _DEFINE_VALARRAY_OPERATOR
+
+ // @} group numeric_arrays
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _SLICE_ARRAY_H */
diff --git a/i686-linux/include/c++/4.4.3/bits/sstream.tcc b/i686-linux/include/c++/4.4.3/bits/sstream.tcc
new file mode 100644
index 0000000..0f9db8e
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/sstream.tcc
@@ -0,0 +1,273 @@
+// String based streams -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file sstream.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 27.7 String-based streams
+//
+
+#ifndef _SSTREAM_TCC
+#define _SSTREAM_TCC 1
+
+#pragma GCC system_header
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template <class _CharT, class _Traits, class _Alloc>
+ typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type
+ basic_stringbuf<_CharT, _Traits, _Alloc>::
+ pbackfail(int_type __c)
+ {
+ int_type __ret = traits_type::eof();
+ if (this->eback() < this->gptr())
+ {
+ // Try to put back __c into input sequence in one of three ways.
+ // Order these tests done in is unspecified by the standard.
+ const bool __testeof = traits_type::eq_int_type(__c, __ret);
+ if (!__testeof)
+ {
+ const bool __testeq = traits_type::eq(traits_type::
+ to_char_type(__c),
+ this->gptr()[-1]);
+ const bool __testout = this->_M_mode & ios_base::out;
+ if (__testeq || __testout)
+ {
+ this->gbump(-1);
+ if (!__testeq)
+ *this->gptr() = traits_type::to_char_type(__c);
+ __ret = __c;
+ }
+ }
+ else
+ {
+ this->gbump(-1);
+ __ret = traits_type::not_eof(__c);
+ }
+ }
+ return __ret;
+ }
+
+ template <class _CharT, class _Traits, class _Alloc>
+ typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type
+ basic_stringbuf<_CharT, _Traits, _Alloc>::
+ overflow(int_type __c)
+ {
+ const bool __testout = this->_M_mode & ios_base::out;
+ if (__builtin_expect(!__testout, false))
+ return traits_type::eof();
+
+ const bool __testeof = traits_type::eq_int_type(__c, traits_type::eof());
+ if (__builtin_expect(__testeof, false))
+ return traits_type::not_eof(__c);
+
+ const __size_type __capacity = _M_string.capacity();
+ const __size_type __max_size = _M_string.max_size();
+ const bool __testput = this->pptr() < this->epptr();
+ if (__builtin_expect(!__testput && __capacity == __max_size, false))
+ return traits_type::eof();
+
+ // Try to append __c into output sequence in one of two ways.
+ // Order these tests done in is unspecified by the standard.
+ const char_type __conv = traits_type::to_char_type(__c);
+ if (!__testput)
+ {
+ // NB: Start ostringstream buffers at 512 chars. This is an
+ // experimental value (pronounced "arbitrary" in some of the
+ // hipper English-speaking countries), and can be changed to
+ // suit particular needs.
+ //
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 169. Bad efficiency of overflow() mandated
+ // 432. stringbuf::overflow() makes only one write position
+ // available
+ const __size_type __opt_len = std::max(__size_type(2 * __capacity),
+ __size_type(512));
+ const __size_type __len = std::min(__opt_len, __max_size);
+ __string_type __tmp;
+ __tmp.reserve(__len);
+ if (this->pbase())
+ __tmp.assign(this->pbase(), this->epptr() - this->pbase());
+ __tmp.push_back(__conv);
+ _M_string.swap(__tmp);
+ _M_sync(const_cast<char_type*>(_M_string.data()),
+ this->gptr() - this->eback(), this->pptr() - this->pbase());
+ }
+ else
+ *this->pptr() = __conv;
+ this->pbump(1);
+ return __c;
+ }
+
+ template <class _CharT, class _Traits, class _Alloc>
+ typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type
+ basic_stringbuf<_CharT, _Traits, _Alloc>::
+ underflow()
+ {
+ int_type __ret = traits_type::eof();
+ const bool __testin = this->_M_mode & ios_base::in;
+ if (__testin)
+ {
+ // Update egptr() to match the actual string end.
+ _M_update_egptr();
+
+ if (this->gptr() < this->egptr())
+ __ret = traits_type::to_int_type(*this->gptr());
+ }
+ return __ret;
+ }
+
+ template <class _CharT, class _Traits, class _Alloc>
+ typename basic_stringbuf<_CharT, _Traits, _Alloc>::pos_type
+ basic_stringbuf<_CharT, _Traits, _Alloc>::
+ seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode __mode)
+ {
+ pos_type __ret = pos_type(off_type(-1));
+ bool __testin = (ios_base::in & this->_M_mode & __mode) != 0;
+ bool __testout = (ios_base::out & this->_M_mode & __mode) != 0;
+ const bool __testboth = __testin && __testout && __way != ios_base::cur;
+ __testin &= !(__mode & ios_base::out);
+ __testout &= !(__mode & ios_base::in);
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 453. basic_stringbuf::seekoff need not always fail for an empty stream.
+ const char_type* __beg = __testin ? this->eback() : this->pbase();
+ if ((__beg || !__off) && (__testin || __testout || __testboth))
+ {
+ _M_update_egptr();
+
+ off_type __newoffi = __off;
+ off_type __newoffo = __newoffi;
+ if (__way == ios_base::cur)
+ {
+ __newoffi += this->gptr() - __beg;
+ __newoffo += this->pptr() - __beg;
+ }
+ else if (__way == ios_base::end)
+ __newoffo = __newoffi += this->egptr() - __beg;
+
+ if ((__testin || __testboth)
+ && __newoffi >= 0
+ && this->egptr() - __beg >= __newoffi)
+ {
+ this->gbump((__beg + __newoffi) - this->gptr());
+ __ret = pos_type(__newoffi);
+ }
+ if ((__testout || __testboth)
+ && __newoffo >= 0
+ && this->egptr() - __beg >= __newoffo)
+ {
+ this->pbump((__beg + __newoffo) - this->pptr());
+ __ret = pos_type(__newoffo);
+ }
+ }
+ return __ret;
+ }
+
+ template <class _CharT, class _Traits, class _Alloc>
+ typename basic_stringbuf<_CharT, _Traits, _Alloc>::pos_type
+ basic_stringbuf<_CharT, _Traits, _Alloc>::
+ seekpos(pos_type __sp, ios_base::openmode __mode)
+ {
+ pos_type __ret = pos_type(off_type(-1));
+ const bool __testin = (ios_base::in & this->_M_mode & __mode) != 0;
+ const bool __testout = (ios_base::out & this->_M_mode & __mode) != 0;
+
+ const char_type* __beg = __testin ? this->eback() : this->pbase();
+ if ((__beg || !off_type(__sp)) && (__testin || __testout))
+ {
+ _M_update_egptr();
+
+ const off_type __pos(__sp);
+ const bool __testpos = (0 <= __pos
+ && __pos <= this->egptr() - __beg);
+ if (__testpos)
+ {
+ if (__testin)
+ this->gbump((__beg + __pos) - this->gptr());
+ if (__testout)
+ this->pbump((__beg + __pos) - this->pptr());
+ __ret = __sp;
+ }
+ }
+ return __ret;
+ }
+
+ template <class _CharT, class _Traits, class _Alloc>
+ void
+ basic_stringbuf<_CharT, _Traits, _Alloc>::
+ _M_sync(char_type* __base, __size_type __i, __size_type __o)
+ {
+ const bool __testin = _M_mode & ios_base::in;
+ const bool __testout = _M_mode & ios_base::out;
+ char_type* __endg = __base + _M_string.size();
+ char_type* __endp = __base + _M_string.capacity();
+
+ if (__base != _M_string.data())
+ {
+ // setbuf: __i == size of buffer area (_M_string.size() == 0).
+ __endg += __i;
+ __i = 0;
+ __endp = __endg;
+ }
+
+ if (__testin)
+ this->setg(__base, __base + __i, __endg);
+ if (__testout)
+ {
+ this->setp(__base, __endp);
+ this->pbump(__o);
+ // egptr() always tracks the string end. When !__testin,
+ // for the correct functioning of the streambuf inlines
+ // the other get area pointers are identical.
+ if (!__testin)
+ this->setg(__endg, __endg, __endg);
+ }
+ }
+
+ // Inhibit implicit instantiations for required instantiations,
+ // which are defined via explicit instantiations elsewhere.
+ // NB: This syntax is a GNU extension.
+#if _GLIBCXX_EXTERN_TEMPLATE
+ extern template class basic_stringbuf<char>;
+ extern template class basic_istringstream<char>;
+ extern template class basic_ostringstream<char>;
+ extern template class basic_stringstream<char>;
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ extern template class basic_stringbuf<wchar_t>;
+ extern template class basic_istringstream<wchar_t>;
+ extern template class basic_ostringstream<wchar_t>;
+ extern template class basic_stringstream<wchar_t>;
+#endif
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/bits/stl_algo.h b/i686-linux/include/c++/4.4.3/bits/stl_algo.h
new file mode 100644
index 0000000..d4b04d1
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/stl_algo.h
@@ -0,0 +1,6138 @@
+// Algorithm implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_algo.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_ALGO_H
+#define _STL_ALGO_H 1
+
+#include <cstdlib> // for rand
+#include <bits/algorithmfwd.h>
+#include <bits/stl_heap.h>
+#include <bits/stl_tempbuf.h> // for _Temporary_buffer
+#include <debug/debug.h>
+#include <initializer_list>
+
+// See concept_check.h for the __glibcxx_*_requires macros.
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+// Local modification: if __google_stl_debug_compare is defined to
+// non-zero value, check sort predicate for strict weak ordering.
+// See http://b/1731200.
+#if __google_stl_debug_compare
+ template<typename _Compare>
+ struct _CheckedCompare {
+ _Compare _M_compare;
+
+ _CheckedCompare(const _Compare & __comp): _M_compare(__comp) { }
+
+ template <typename _Tp>
+ bool operator()(const _Tp& __x, const _Tp& __y) {
+ if (_M_compare(__x, __x))
+ __throw_runtime_error("strict weak ordering: (__x LT __x) != false");
+ if (_M_compare(__y, __y))
+ __throw_runtime_error("strict weak ordering: (__y LT __y) != false");
+ bool lt = _M_compare(__x, __y);
+ if (lt && _M_compare(__y, __x))
+ __throw_runtime_error("strict weak ordering: ((__x LT __y) && (__y LT __x)) != false");
+ return lt;
+ }
+
+ // Different types; can't perform any checks.
+ // When building //indexterm/internal:indexterm,
+ // indexterm/internal/numericterms.cc
+ // fails without this.
+ template <typename _Tp1, typename _Tp2>
+ bool operator()(const _Tp1& __x, const _Tp2& __y) {
+ return _M_compare(__x, __y);
+ }
+ };
+# define __CheckedCompare(__comp) _CheckedCompare<__typeof__(__comp)>(__comp)
+#else
+# define __CheckedCompare(__comp) __comp
+#endif
+
+ /**
+ * @brief Find the median of three values.
+ * @param a A value.
+ * @param b A value.
+ * @param c A value.
+ * @return One of @p a, @p b or @p c.
+ *
+ * If @c {l,m,n} is some convolution of @p {a,b,c} such that @c l<=m<=n
+ * then the value returned will be @c m.
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ */
+ template<typename _Tp>
+ inline const _Tp&
+ __median(const _Tp& __a, const _Tp& __b, const _Tp& __c)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_LessThanComparableConcept<_Tp>)
+ if (__a < __b)
+ if (__b < __c)
+ return __b;
+ else if (__a < __c)
+ return __c;
+ else
+ return __a;
+ else if (__a < __c)
+ return __a;
+ else if (__b < __c)
+ return __c;
+ else
+ return __b;
+ }
+
+ /**
+ * @brief Find the median of three values using a predicate for comparison.
+ * @param a A value.
+ * @param b A value.
+ * @param c A value.
+ * @param comp A binary predicate.
+ * @return One of @p a, @p b or @p c.
+ *
+ * If @c {l,m,n} is some convolution of @p {a,b,c} such that @p comp(l,m)
+ * and @p comp(m,n) are both true then the value returned will be @c m.
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ */
+ template<typename _Tp, typename _Compare>
+ inline const _Tp&
+ __median(const _Tp& __a, const _Tp& __b, const _Tp& __c, _Compare __comp)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_BinaryFunctionConcept<_Compare, bool,
+ _Tp, _Tp>)
+ if (__comp(__a, __b))
+ if (__comp(__b, __c))
+ return __b;
+ else if (__comp(__a, __c))
+ return __c;
+ else
+ return __a;
+ else if (__comp(__a, __c))
+ return __a;
+ else if (__comp(__b, __c))
+ return __c;
+ else
+ return __b;
+ }
+
+ // for_each
+
+ /// This is an overload used by find() for the Input Iterator case.
+ template<typename _InputIterator, typename _Tp>
+ inline _InputIterator
+ __find(_InputIterator __first, _InputIterator __last,
+ const _Tp& __val, input_iterator_tag)
+ {
+ while (__first != __last && !(*__first == __val))
+ ++__first;
+ return __first;
+ }
+
+ /// This is an overload used by find_if() for the Input Iterator case.
+ template<typename _InputIterator, typename _Predicate>
+ inline _InputIterator
+ __find_if(_InputIterator __first, _InputIterator __last,
+ _Predicate __pred, input_iterator_tag)
+ {
+ while (__first != __last && !bool(__pred(*__first)))
+ ++__first;
+ return __first;
+ }
+
+ /// This is an overload used by find() for the RAI case.
+ template<typename _RandomAccessIterator, typename _Tp>
+ _RandomAccessIterator
+ __find(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ const _Tp& __val, random_access_iterator_tag)
+ {
+ typename iterator_traits<_RandomAccessIterator>::difference_type
+ __trip_count = (__last - __first) >> 2;
+
+ for (; __trip_count > 0; --__trip_count)
+ {
+ if (*__first == __val)
+ return __first;
+ ++__first;
+
+ if (*__first == __val)
+ return __first;
+ ++__first;
+
+ if (*__first == __val)
+ return __first;
+ ++__first;
+
+ if (*__first == __val)
+ return __first;
+ ++__first;
+ }
+
+ switch (__last - __first)
+ {
+ case 3:
+ if (*__first == __val)
+ return __first;
+ ++__first;
+ case 2:
+ if (*__first == __val)
+ return __first;
+ ++__first;
+ case 1:
+ if (*__first == __val)
+ return __first;
+ ++__first;
+ case 0:
+ default:
+ return __last;
+ }
+ }
+
+ /// This is an overload used by find_if() for the RAI case.
+ template<typename _RandomAccessIterator, typename _Predicate>
+ _RandomAccessIterator
+ __find_if(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ _Predicate __pred, random_access_iterator_tag)
+ {
+ typename iterator_traits<_RandomAccessIterator>::difference_type
+ __trip_count = (__last - __first) >> 2;
+
+ for (; __trip_count > 0; --__trip_count)
+ {
+ if (__pred(*__first))
+ return __first;
+ ++__first;
+
+ if (__pred(*__first))
+ return __first;
+ ++__first;
+
+ if (__pred(*__first))
+ return __first;
+ ++__first;
+
+ if (__pred(*__first))
+ return __first;
+ ++__first;
+ }
+
+ switch (__last - __first)
+ {
+ case 3:
+ if (__pred(*__first))
+ return __first;
+ ++__first;
+ case 2:
+ if (__pred(*__first))
+ return __first;
+ ++__first;
+ case 1:
+ if (__pred(*__first))
+ return __first;
+ ++__first;
+ case 0:
+ default:
+ return __last;
+ }
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /// This is an overload used by find_if_not() for the Input Iterator case.
+ template<typename _InputIterator, typename _Predicate>
+ inline _InputIterator
+ __find_if_not(_InputIterator __first, _InputIterator __last,
+ _Predicate __pred, input_iterator_tag)
+ {
+ while (__first != __last && bool(__pred(*__first)))
+ ++__first;
+ return __first;
+ }
+
+ /// This is an overload used by find_if_not() for the RAI case.
+ template<typename _RandomAccessIterator, typename _Predicate>
+ _RandomAccessIterator
+ __find_if_not(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ _Predicate __pred, random_access_iterator_tag)
+ {
+ typename iterator_traits<_RandomAccessIterator>::difference_type
+ __trip_count = (__last - __first) >> 2;
+
+ for (; __trip_count > 0; --__trip_count)
+ {
+ if (!bool(__pred(*__first)))
+ return __first;
+ ++__first;
+
+ if (!bool(__pred(*__first)))
+ return __first;
+ ++__first;
+
+ if (!bool(__pred(*__first)))
+ return __first;
+ ++__first;
+
+ if (!bool(__pred(*__first)))
+ return __first;
+ ++__first;
+ }
+
+ switch (__last - __first)
+ {
+ case 3:
+ if (!bool(__pred(*__first)))
+ return __first;
+ ++__first;
+ case 2:
+ if (!bool(__pred(*__first)))
+ return __first;
+ ++__first;
+ case 1:
+ if (!bool(__pred(*__first)))
+ return __first;
+ ++__first;
+ case 0:
+ default:
+ return __last;
+ }
+ }
+#endif
+
+ // set_difference
+ // set_intersection
+ // set_symmetric_difference
+ // set_union
+ // for_each
+ // find
+ // find_if
+ // find_first_of
+ // adjacent_find
+ // count
+ // count_if
+ // search
+
+ /**
+ * This is an uglified
+ * search_n(_ForwardIterator, _ForwardIterator, _Integer, const _Tp&)
+ * overloaded for forward iterators.
+ */
+ template<typename _ForwardIterator, typename _Integer, typename _Tp>
+ _ForwardIterator
+ __search_n(_ForwardIterator __first, _ForwardIterator __last,
+ _Integer __count, const _Tp& __val,
+ std::forward_iterator_tag)
+ {
+ __first = _GLIBCXX_STD_P::find(__first, __last, __val);
+ while (__first != __last)
+ {
+ typename iterator_traits<_ForwardIterator>::difference_type
+ __n = __count;
+ _ForwardIterator __i = __first;
+ ++__i;
+ while (__i != __last && __n != 1 && *__i == __val)
+ {
+ ++__i;
+ --__n;
+ }
+ if (__n == 1)
+ return __first;
+ if (__i == __last)
+ return __last;
+ __first = _GLIBCXX_STD_P::find(++__i, __last, __val);
+ }
+ return __last;
+ }
+
+ /**
+ * This is an uglified
+ * search_n(_ForwardIterator, _ForwardIterator, _Integer, const _Tp&)
+ * overloaded for random access iterators.
+ */
+ template<typename _RandomAccessIter, typename _Integer, typename _Tp>
+ _RandomAccessIter
+ __search_n(_RandomAccessIter __first, _RandomAccessIter __last,
+ _Integer __count, const _Tp& __val,
+ std::random_access_iterator_tag)
+ {
+
+ typedef typename std::iterator_traits<_RandomAccessIter>::difference_type
+ _DistanceType;
+
+ _DistanceType __tailSize = __last - __first;
+ const _DistanceType __pattSize = __count;
+
+ if (__tailSize < __pattSize)
+ return __last;
+
+ const _DistanceType __skipOffset = __pattSize - 1;
+ _RandomAccessIter __lookAhead = __first + __skipOffset;
+ __tailSize -= __pattSize;
+
+ while (1) // the main loop...
+ {
+ // __lookAhead here is always pointing to the last element of next
+ // possible match.
+ while (!(*__lookAhead == __val)) // the skip loop...
+ {
+ if (__tailSize < __pattSize)
+ return __last; // Failure
+ __lookAhead += __pattSize;
+ __tailSize -= __pattSize;
+ }
+ _DistanceType __remainder = __skipOffset;
+ for (_RandomAccessIter __backTrack = __lookAhead - 1;
+ *__backTrack == __val; --__backTrack)
+ {
+ if (--__remainder == 0)
+ return (__lookAhead - __skipOffset); // Success
+ }
+ if (__remainder > __tailSize)
+ return __last; // Failure
+ __lookAhead += __remainder;
+ __tailSize -= __remainder;
+ }
+ }
+
+ // search_n
+
+ /**
+ * This is an uglified
+ * search_n(_ForwardIterator, _ForwardIterator, _Integer, const _Tp&,
+ * _BinaryPredicate)
+ * overloaded for forward iterators.
+ */
+ template<typename _ForwardIterator, typename _Integer, typename _Tp,
+ typename _BinaryPredicate>
+ _ForwardIterator
+ __search_n(_ForwardIterator __first, _ForwardIterator __last,
+ _Integer __count, const _Tp& __val,
+ _BinaryPredicate __binary_pred, std::forward_iterator_tag)
+ {
+ while (__first != __last && !bool(__binary_pred(*__first, __val)))
+ ++__first;
+
+ while (__first != __last)
+ {
+ typename iterator_traits<_ForwardIterator>::difference_type
+ __n = __count;
+ _ForwardIterator __i = __first;
+ ++__i;
+ while (__i != __last && __n != 1 && bool(__binary_pred(*__i, __val)))
+ {
+ ++__i;
+ --__n;
+ }
+ if (__n == 1)
+ return __first;
+ if (__i == __last)
+ return __last;
+ __first = ++__i;
+ while (__first != __last
+ && !bool(__binary_pred(*__first, __val)))
+ ++__first;
+ }
+ return __last;
+ }
+
+ /**
+ * This is an uglified
+ * search_n(_ForwardIterator, _ForwardIterator, _Integer, const _Tp&,
+ * _BinaryPredicate)
+ * overloaded for random access iterators.
+ */
+ template<typename _RandomAccessIter, typename _Integer, typename _Tp,
+ typename _BinaryPredicate>
+ _RandomAccessIter
+ __search_n(_RandomAccessIter __first, _RandomAccessIter __last,
+ _Integer __count, const _Tp& __val,
+ _BinaryPredicate __binary_pred, std::random_access_iterator_tag)
+ {
+
+ typedef typename std::iterator_traits<_RandomAccessIter>::difference_type
+ _DistanceType;
+
+ _DistanceType __tailSize = __last - __first;
+ const _DistanceType __pattSize = __count;
+
+ if (__tailSize < __pattSize)
+ return __last;
+
+ const _DistanceType __skipOffset = __pattSize - 1;
+ _RandomAccessIter __lookAhead = __first + __skipOffset;
+ __tailSize -= __pattSize;
+
+ while (1) // the main loop...
+ {
+ // __lookAhead here is always pointing to the last element of next
+ // possible match.
+ while (!bool(__binary_pred(*__lookAhead, __val))) // the skip loop...
+ {
+ if (__tailSize < __pattSize)
+ return __last; // Failure
+ __lookAhead += __pattSize;
+ __tailSize -= __pattSize;
+ }
+ _DistanceType __remainder = __skipOffset;
+ for (_RandomAccessIter __backTrack = __lookAhead - 1;
+ __binary_pred(*__backTrack, __val); --__backTrack)
+ {
+ if (--__remainder == 0)
+ return (__lookAhead - __skipOffset); // Success
+ }
+ if (__remainder > __tailSize)
+ return __last; // Failure
+ __lookAhead += __remainder;
+ __tailSize -= __remainder;
+ }
+ }
+
+ // find_end for forward iterators.
+ template<typename _ForwardIterator1, typename _ForwardIterator2>
+ _ForwardIterator1
+ __find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2, _ForwardIterator2 __last2,
+ forward_iterator_tag, forward_iterator_tag)
+ {
+ if (__first2 == __last2)
+ return __last1;
+ else
+ {
+ _ForwardIterator1 __result = __last1;
+ while (1)
+ {
+ _ForwardIterator1 __new_result
+ = _GLIBCXX_STD_P::search(__first1, __last1, __first2, __last2);
+ if (__new_result == __last1)
+ return __result;
+ else
+ {
+ __result = __new_result;
+ __first1 = __new_result;
+ ++__first1;
+ }
+ }
+ }
+ }
+
+ template<typename _ForwardIterator1, typename _ForwardIterator2,
+ typename _BinaryPredicate>
+ _ForwardIterator1
+ __find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2, _ForwardIterator2 __last2,
+ forward_iterator_tag, forward_iterator_tag,
+ _BinaryPredicate __comp)
+ {
+ if (__first2 == __last2)
+ return __last1;
+ else
+ {
+ _ForwardIterator1 __result = __last1;
+ while (1)
+ {
+ _ForwardIterator1 __new_result
+ = _GLIBCXX_STD_P::search(__first1, __last1, __first2,
+ __last2, __comp);
+ if (__new_result == __last1)
+ return __result;
+ else
+ {
+ __result = __new_result;
+ __first1 = __new_result;
+ ++__first1;
+ }
+ }
+ }
+ }
+
+ // find_end for bidirectional iterators (much faster).
+ template<typename _BidirectionalIterator1, typename _BidirectionalIterator2>
+ _BidirectionalIterator1
+ __find_end(_BidirectionalIterator1 __first1,
+ _BidirectionalIterator1 __last1,
+ _BidirectionalIterator2 __first2,
+ _BidirectionalIterator2 __last2,
+ bidirectional_iterator_tag, bidirectional_iterator_tag)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_BidirectionalIteratorConcept<
+ _BidirectionalIterator1>)
+ __glibcxx_function_requires(_BidirectionalIteratorConcept<
+ _BidirectionalIterator2>)
+
+ typedef reverse_iterator<_BidirectionalIterator1> _RevIterator1;
+ typedef reverse_iterator<_BidirectionalIterator2> _RevIterator2;
+
+ _RevIterator1 __rlast1(__first1);
+ _RevIterator2 __rlast2(__first2);
+ _RevIterator1 __rresult = _GLIBCXX_STD_P::search(_RevIterator1(__last1),
+ __rlast1,
+ _RevIterator2(__last2),
+ __rlast2);
+
+ if (__rresult == __rlast1)
+ return __last1;
+ else
+ {
+ _BidirectionalIterator1 __result = __rresult.base();
+ std::advance(__result, -std::distance(__first2, __last2));
+ return __result;
+ }
+ }
+
+ template<typename _BidirectionalIterator1, typename _BidirectionalIterator2,
+ typename _BinaryPredicate>
+ _BidirectionalIterator1
+ __find_end(_BidirectionalIterator1 __first1,
+ _BidirectionalIterator1 __last1,
+ _BidirectionalIterator2 __first2,
+ _BidirectionalIterator2 __last2,
+ bidirectional_iterator_tag, bidirectional_iterator_tag,
+ _BinaryPredicate __comp)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_BidirectionalIteratorConcept<
+ _BidirectionalIterator1>)
+ __glibcxx_function_requires(_BidirectionalIteratorConcept<
+ _BidirectionalIterator2>)
+
+ typedef reverse_iterator<_BidirectionalIterator1> _RevIterator1;
+ typedef reverse_iterator<_BidirectionalIterator2> _RevIterator2;
+
+ _RevIterator1 __rlast1(__first1);
+ _RevIterator2 __rlast2(__first2);
+ _RevIterator1 __rresult = std::search(_RevIterator1(__last1), __rlast1,
+ _RevIterator2(__last2), __rlast2,
+ __comp);
+
+ if (__rresult == __rlast1)
+ return __last1;
+ else
+ {
+ _BidirectionalIterator1 __result = __rresult.base();
+ std::advance(__result, -std::distance(__first2, __last2));
+ return __result;
+ }
+ }
+
+ /**
+ * @brief Find last matching subsequence in a sequence.
+ * @ingroup non_mutating_algorithms
+ * @param first1 Start of range to search.
+ * @param last1 End of range to search.
+ * @param first2 Start of sequence to match.
+ * @param last2 End of sequence to match.
+ * @return The last iterator @c i in the range
+ * @p [first1,last1-(last2-first2)) such that @c *(i+N) == @p *(first2+N)
+ * for each @c N in the range @p [0,last2-first2), or @p last1 if no
+ * such iterator exists.
+ *
+ * Searches the range @p [first1,last1) for a sub-sequence that compares
+ * equal value-by-value with the sequence given by @p [first2,last2) and
+ * returns an iterator to the first element of the sub-sequence, or
+ * @p last1 if the sub-sequence is not found. The sub-sequence will be the
+ * last such subsequence contained in [first,last1).
+ *
+ * Because the sub-sequence must lie completely within the range
+ * @p [first1,last1) it must start at a position less than
+ * @p last1-(last2-first2) where @p last2-first2 is the length of the
+ * sub-sequence.
+ * This means that the returned iterator @c i will be in the range
+ * @p [first1,last1-(last2-first2))
+ */
+ template<typename _ForwardIterator1, typename _ForwardIterator2>
+ inline _ForwardIterator1
+ find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2, _ForwardIterator2 __last2)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator1>)
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator2>)
+ __glibcxx_function_requires(_EqualOpConcept<
+ typename iterator_traits<_ForwardIterator1>::value_type,
+ typename iterator_traits<_ForwardIterator2>::value_type>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+ __glibcxx_requires_valid_range(__first2, __last2);
+
+ return std::__find_end(__first1, __last1, __first2, __last2,
+ std::__iterator_category(__first1),
+ std::__iterator_category(__first2));
+ }
+
+ /**
+ * @brief Find last matching subsequence in a sequence using a predicate.
+ * @ingroup non_mutating_algorithms
+ * @param first1 Start of range to search.
+ * @param last1 End of range to search.
+ * @param first2 Start of sequence to match.
+ * @param last2 End of sequence to match.
+ * @param comp The predicate to use.
+ * @return The last iterator @c i in the range
+ * @p [first1,last1-(last2-first2)) such that @c predicate(*(i+N), @p
+ * (first2+N)) is true for each @c N in the range @p [0,last2-first2), or
+ * @p last1 if no such iterator exists.
+ *
+ * Searches the range @p [first1,last1) for a sub-sequence that compares
+ * equal value-by-value with the sequence given by @p [first2,last2) using
+ * comp as a predicate and returns an iterator to the first element of the
+ * sub-sequence, or @p last1 if the sub-sequence is not found. The
+ * sub-sequence will be the last such subsequence contained in
+ * [first,last1).
+ *
+ * Because the sub-sequence must lie completely within the range
+ * @p [first1,last1) it must start at a position less than
+ * @p last1-(last2-first2) where @p last2-first2 is the length of the
+ * sub-sequence.
+ * This means that the returned iterator @c i will be in the range
+ * @p [first1,last1-(last2-first2))
+ */
+ template<typename _ForwardIterator1, typename _ForwardIterator2,
+ typename _BinaryPredicate>
+ inline _ForwardIterator1
+ find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2, _ForwardIterator2 __last2,
+ _BinaryPredicate __comp)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator1>)
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator2>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
+ typename iterator_traits<_ForwardIterator1>::value_type,
+ typename iterator_traits<_ForwardIterator2>::value_type>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+ __glibcxx_requires_valid_range(__first2, __last2);
+
+ return std::__find_end(__first1, __last1, __first2, __last2,
+ std::__iterator_category(__first1),
+ std::__iterator_category(__first2),
+ __comp);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Checks that a predicate is true for all the elements
+ * of a sequence.
+ * @ingroup non_mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param pred A predicate.
+ * @return True if the check is true, false otherwise.
+ *
+ * Returns true if @p pred is true for each element in the range
+ * @p [first,last), and false otherwise.
+ */
+ template<typename _InputIterator, typename _Predicate>
+ inline bool
+ all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)
+ { return __last == std::find_if_not(__first, __last, __pred); }
+
+ /**
+ * @brief Checks that a predicate is false for all the elements
+ * of a sequence.
+ * @ingroup non_mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param pred A predicate.
+ * @return True if the check is true, false otherwise.
+ *
+ * Returns true if @p pred is false for each element in the range
+ * @p [first,last), and false otherwise.
+ */
+ template<typename _InputIterator, typename _Predicate>
+ inline bool
+ none_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)
+ { return __last == _GLIBCXX_STD_P::find_if(__first, __last, __pred); }
+
+ /**
+ * @brief Checks that a predicate is false for at least an element
+ * of a sequence.
+ * @ingroup non_mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param pred A predicate.
+ * @return True if the check is true, false otherwise.
+ *
+ * Returns true if an element exists in the range @p [first,last) such that
+ * @p pred is true, and false otherwise.
+ */
+ template<typename _InputIterator, typename _Predicate>
+ inline bool
+ any_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)
+ { return !std::none_of(__first, __last, __pred); }
+
+ /**
+ * @brief Find the first element in a sequence for which a
+ * predicate is false.
+ * @ingroup non_mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param pred A predicate.
+ * @return The first iterator @c i in the range @p [first,last)
+ * such that @p pred(*i) is false, or @p last if no such iterator exists.
+ */
+ template<typename _InputIterator, typename _Predicate>
+ inline _InputIterator
+ find_if_not(_InputIterator __first, _InputIterator __last,
+ _Predicate __pred)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
+ typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+ return std::__find_if_not(__first, __last, __pred,
+ std::__iterator_category(__first));
+ }
+
+ /**
+ * @brief Checks whether the sequence is partitioned.
+ * @ingroup mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param pred A predicate.
+ * @return True if the range @p [first,last) is partioned by @p pred,
+ * i.e. if all elements that satisfy @p pred appear before those that
+ * do not.
+ */
+ template<typename _InputIterator, typename _Predicate>
+ inline bool
+ is_partitioned(_InputIterator __first, _InputIterator __last,
+ _Predicate __pred)
+ {
+ __first = std::find_if_not(__first, __last, __pred);
+ return std::none_of(__first, __last, __pred);
+ }
+
+ /**
+ * @brief Find the partition point of a partitioned range.
+ * @ingroup mutating_algorithms
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @param pred A predicate.
+ * @return An iterator @p mid such that @p all_of(first, mid, pred)
+ * and @p none_of(mid, last, pred) are both true.
+ */
+ template<typename _ForwardIterator, typename _Predicate>
+ _ForwardIterator
+ partition_point(_ForwardIterator __first, _ForwardIterator __last,
+ _Predicate __pred)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+
+ // A specific debug-mode test will be necessary...
+ __glibcxx_requires_valid_range(__first, __last);
+
+ typedef typename iterator_traits<_ForwardIterator>::difference_type
+ _DistanceType;
+
+ _DistanceType __len = std::distance(__first, __last);
+ _DistanceType __half;
+ _ForwardIterator __middle;
+
+ while (__len > 0)
+ {
+ __half = __len >> 1;
+ __middle = __first;
+ std::advance(__middle, __half);
+ if (__pred(*__middle))
+ {
+ __first = __middle;
+ ++__first;
+ __len = __len - __half - 1;
+ }
+ else
+ __len = __half;
+ }
+ return __first;
+ }
+#endif
+
+
+ /**
+ * @brief Copy a sequence, removing elements of a given value.
+ * @ingroup mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param result An output iterator.
+ * @param value The value to be removed.
+ * @return An iterator designating the end of the resulting sequence.
+ *
+ * Copies each element in the range @p [first,last) not equal to @p value
+ * to the range beginning at @p result.
+ * remove_copy() is stable, so the relative order of elements that are
+ * copied is unchanged.
+ */
+ template<typename _InputIterator, typename _OutputIterator, typename _Tp>
+ _OutputIterator
+ remove_copy(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result, const _Tp& __value)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_function_requires(_EqualOpConcept<
+ typename iterator_traits<_InputIterator>::value_type, _Tp>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ for (; __first != __last; ++__first)
+ if (!(*__first == __value))
+ {
+ *__result = *__first;
+ ++__result;
+ }
+ return __result;
+ }
+
+ /**
+ * @brief Copy a sequence, removing elements for which a predicate is true.
+ * @ingroup mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param result An output iterator.
+ * @param pred A predicate.
+ * @return An iterator designating the end of the resulting sequence.
+ *
+ * Copies each element in the range @p [first,last) for which
+ * @p pred returns false to the range beginning at @p result.
+ *
+ * remove_copy_if() is stable, so the relative order of elements that are
+ * copied is unchanged.
+ */
+ template<typename _InputIterator, typename _OutputIterator,
+ typename _Predicate>
+ _OutputIterator
+ remove_copy_if(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result, _Predicate __pred)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
+ typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ for (; __first != __last; ++__first)
+ if (!bool(__pred(*__first)))
+ {
+ *__result = *__first;
+ ++__result;
+ }
+ return __result;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Copy the elements of a sequence for which a predicate is true.
+ * @ingroup mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param result An output iterator.
+ * @param pred A predicate.
+ * @return An iterator designating the end of the resulting sequence.
+ *
+ * Copies each element in the range @p [first,last) for which
+ * @p pred returns true to the range beginning at @p result.
+ *
+ * copy_if() is stable, so the relative order of elements that are
+ * copied is unchanged.
+ */
+ template<typename _InputIterator, typename _OutputIterator,
+ typename _Predicate>
+ _OutputIterator
+ copy_if(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result, _Predicate __pred)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
+ typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ for (; __first != __last; ++__first)
+ if (__pred(*__first))
+ {
+ *__result = *__first;
+ ++__result;
+ }
+ return __result;
+ }
+
+
+ template<typename _InputIterator, typename _Size, typename _OutputIterator>
+ _OutputIterator
+ __copy_n(_InputIterator __first, _Size __n,
+ _OutputIterator __result, input_iterator_tag)
+ {
+ for (; __n > 0; --__n)
+ {
+ *__result = *__first;
+ ++__first;
+ ++__result;
+ }
+ return __result;
+ }
+
+ template<typename _RandomAccessIterator, typename _Size,
+ typename _OutputIterator>
+ inline _OutputIterator
+ __copy_n(_RandomAccessIterator __first, _Size __n,
+ _OutputIterator __result, random_access_iterator_tag)
+ { return std::copy(__first, __first + __n, __result); }
+
+ /**
+ * @brief Copies the range [first,first+n) into [result,result+n).
+ * @ingroup mutating_algorithms
+ * @param first An input iterator.
+ * @param n The number of elements to copy.
+ * @param result An output iterator.
+ * @return result+n.
+ *
+ * This inline function will boil down to a call to @c memmove whenever
+ * possible. Failing that, if random access iterators are passed, then the
+ * loop count will be known (and therefore a candidate for compiler
+ * optimizations such as unrolling).
+ */
+ template<typename _InputIterator, typename _Size, typename _OutputIterator>
+ inline _OutputIterator
+ copy_n(_InputIterator __first, _Size __n, _OutputIterator __result)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator>::value_type>)
+
+ return std::__copy_n(__first, __n, __result,
+ std::__iterator_category(__first));
+ }
+
+ /**
+ * @brief Copy the elements of a sequence to separate output sequences
+ * depending on the truth value of a predicate.
+ * @ingroup mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param out_true An output iterator.
+ * @param out_false An output iterator.
+ * @param pred A predicate.
+ * @return A pair designating the ends of the resulting sequences.
+ *
+ * Copies each element in the range @p [first,last) for which
+ * @p pred returns true to the range beginning at @p out_true
+ * and each element for which @p pred returns false to @p out_false.
+ */
+ template<typename _InputIterator, typename _OutputIterator1,
+ typename _OutputIterator2, typename _Predicate>
+ pair<_OutputIterator1, _OutputIterator2>
+ partition_copy(_InputIterator __first, _InputIterator __last,
+ _OutputIterator1 __out_true, _OutputIterator2 __out_false,
+ _Predicate __pred)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator1,
+ typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator2,
+ typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
+ typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ for (; __first != __last; ++__first)
+ if (__pred(*__first))
+ {
+ *__out_true = *__first;
+ ++__out_true;
+ }
+ else
+ {
+ *__out_false = *__first;
+ ++__out_false;
+ }
+
+ return pair<_OutputIterator1, _OutputIterator2>(__out_true, __out_false);
+ }
+#endif
+
+ /**
+ * @brief Remove elements from a sequence.
+ * @ingroup mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param value The value to be removed.
+ * @return An iterator designating the end of the resulting sequence.
+ *
+ * All elements equal to @p value are removed from the range
+ * @p [first,last).
+ *
+ * remove() is stable, so the relative order of elements that are
+ * not removed is unchanged.
+ *
+ * Elements between the end of the resulting sequence and @p last
+ * are still present, but their value is unspecified.
+ */
+ template<typename _ForwardIterator, typename _Tp>
+ _ForwardIterator
+ remove(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __value)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
+ _ForwardIterator>)
+ __glibcxx_function_requires(_EqualOpConcept<
+ typename iterator_traits<_ForwardIterator>::value_type, _Tp>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ __first = _GLIBCXX_STD_P::find(__first, __last, __value);
+ if(__first == __last)
+ return __first;
+ _ForwardIterator __result = __first;
+ ++__first;
+ for(; __first != __last; ++__first)
+ if(!(*__first == __value))
+ {
+ *__result = _GLIBCXX_MOVE(*__first);
+ ++__result;
+ }
+ return __result;
+ }
+
+ /**
+ * @brief Remove elements from a sequence using a predicate.
+ * @ingroup mutating_algorithms
+ * @param first A forward iterator.
+ * @param last A forward iterator.
+ * @param pred A predicate.
+ * @return An iterator designating the end of the resulting sequence.
+ *
+ * All elements for which @p pred returns true are removed from the range
+ * @p [first,last).
+ *
+ * remove_if() is stable, so the relative order of elements that are
+ * not removed is unchanged.
+ *
+ * Elements between the end of the resulting sequence and @p last
+ * are still present, but their value is unspecified.
+ */
+ template<typename _ForwardIterator, typename _Predicate>
+ _ForwardIterator
+ remove_if(_ForwardIterator __first, _ForwardIterator __last,
+ _Predicate __pred)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
+ _ForwardIterator>)
+ __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ __first = _GLIBCXX_STD_P::find_if(__first, __last, __pred);
+ if(__first == __last)
+ return __first;
+ _ForwardIterator __result = __first;
+ ++__first;
+ for(; __first != __last; ++__first)
+ if(!bool(__pred(*__first)))
+ {
+ *__result = _GLIBCXX_MOVE(*__first);
+ ++__result;
+ }
+ return __result;
+ }
+
+ /**
+ * @brief Remove consecutive duplicate values from a sequence.
+ * @ingroup mutating_algorithms
+ * @param first A forward iterator.
+ * @param last A forward iterator.
+ * @return An iterator designating the end of the resulting sequence.
+ *
+ * Removes all but the first element from each group of consecutive
+ * values that compare equal.
+ * unique() is stable, so the relative order of elements that are
+ * not removed is unchanged.
+ * Elements between the end of the resulting sequence and @p last
+ * are still present, but their value is unspecified.
+ */
+ template<typename _ForwardIterator>
+ _ForwardIterator
+ unique(_ForwardIterator __first, _ForwardIterator __last)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
+ _ForwardIterator>)
+ __glibcxx_function_requires(_EqualityComparableConcept<
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ // Skip the beginning, if already unique.
+ __first = _GLIBCXX_STD_P::adjacent_find(__first, __last);
+ if (__first == __last)
+ return __last;
+
+ // Do the real copy work.
+ _ForwardIterator __dest = __first;
+ ++__first;
+ while (++__first != __last)
+ if (!(*__dest == *__first))
+ *++__dest = _GLIBCXX_MOVE(*__first);
+ return ++__dest;
+ }
+
+ /**
+ * @brief Remove consecutive values from a sequence using a predicate.
+ * @ingroup mutating_algorithms
+ * @param first A forward iterator.
+ * @param last A forward iterator.
+ * @param binary_pred A binary predicate.
+ * @return An iterator designating the end of the resulting sequence.
+ *
+ * Removes all but the first element from each group of consecutive
+ * values for which @p binary_pred returns true.
+ * unique() is stable, so the relative order of elements that are
+ * not removed is unchanged.
+ * Elements between the end of the resulting sequence and @p last
+ * are still present, but their value is unspecified.
+ */
+ template<typename _ForwardIterator, typename _BinaryPredicate>
+ _ForwardIterator
+ unique(_ForwardIterator __first, _ForwardIterator __last,
+ _BinaryPredicate __binary_pred)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
+ _ForwardIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
+ typename iterator_traits<_ForwardIterator>::value_type,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ // Skip the beginning, if already unique.
+ __first = _GLIBCXX_STD_P::adjacent_find(__first, __last, __binary_pred);
+ if (__first == __last)
+ return __last;
+
+ // Do the real copy work.
+ _ForwardIterator __dest = __first;
+ ++__first;
+ while (++__first != __last)
+ if (!bool(__binary_pred(*__dest, *__first)))
+ *++__dest = _GLIBCXX_MOVE(*__first);
+ return ++__dest;
+ }
+
+ /**
+ * This is an uglified unique_copy(_InputIterator, _InputIterator,
+ * _OutputIterator)
+ * overloaded for forward iterators and output iterator as result.
+ */
+ template<typename _ForwardIterator, typename _OutputIterator>
+ _OutputIterator
+ __unique_copy(_ForwardIterator __first, _ForwardIterator __last,
+ _OutputIterator __result,
+ forward_iterator_tag, output_iterator_tag)
+ {
+ // concept requirements -- taken care of in dispatching function
+ _ForwardIterator __next = __first;
+ *__result = *__first;
+ while (++__next != __last)
+ if (!(*__first == *__next))
+ {
+ __first = __next;
+ *++__result = *__first;
+ }
+ return ++__result;
+ }
+
+ /**
+ * This is an uglified unique_copy(_InputIterator, _InputIterator,
+ * _OutputIterator)
+ * overloaded for input iterators and output iterator as result.
+ */
+ template<typename _InputIterator, typename _OutputIterator>
+ _OutputIterator
+ __unique_copy(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result,
+ input_iterator_tag, output_iterator_tag)
+ {
+ // concept requirements -- taken care of in dispatching function
+ typename iterator_traits<_InputIterator>::value_type __value = *__first;
+ *__result = __value;
+ while (++__first != __last)
+ if (!(__value == *__first))
+ {
+ __value = *__first;
+ *++__result = __value;
+ }
+ return ++__result;
+ }
+
+ /**
+ * This is an uglified unique_copy(_InputIterator, _InputIterator,
+ * _OutputIterator)
+ * overloaded for input iterators and forward iterator as result.
+ */
+ template<typename _InputIterator, typename _ForwardIterator>
+ _ForwardIterator
+ __unique_copy(_InputIterator __first, _InputIterator __last,
+ _ForwardIterator __result,
+ input_iterator_tag, forward_iterator_tag)
+ {
+ // concept requirements -- taken care of in dispatching function
+ *__result = *__first;
+ while (++__first != __last)
+ if (!(*__result == *__first))
+ *++__result = *__first;
+ return ++__result;
+ }
+
+ /**
+ * This is an uglified
+ * unique_copy(_InputIterator, _InputIterator, _OutputIterator,
+ * _BinaryPredicate)
+ * overloaded for forward iterators and output iterator as result.
+ */
+ template<typename _ForwardIterator, typename _OutputIterator,
+ typename _BinaryPredicate>
+ _OutputIterator
+ __unique_copy(_ForwardIterator __first, _ForwardIterator __last,
+ _OutputIterator __result, _BinaryPredicate __binary_pred,
+ forward_iterator_tag, output_iterator_tag)
+ {
+ // concept requirements -- iterators already checked
+ __glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
+ typename iterator_traits<_ForwardIterator>::value_type,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+
+ _ForwardIterator __next = __first;
+ *__result = *__first;
+ while (++__next != __last)
+ if (!bool(__binary_pred(*__first, *__next)))
+ {
+ __first = __next;
+ *++__result = *__first;
+ }
+ return ++__result;
+ }
+
+ /**
+ * This is an uglified
+ * unique_copy(_InputIterator, _InputIterator, _OutputIterator,
+ * _BinaryPredicate)
+ * overloaded for input iterators and output iterator as result.
+ */
+ template<typename _InputIterator, typename _OutputIterator,
+ typename _BinaryPredicate>
+ _OutputIterator
+ __unique_copy(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result, _BinaryPredicate __binary_pred,
+ input_iterator_tag, output_iterator_tag)
+ {
+ // concept requirements -- iterators already checked
+ __glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
+ typename iterator_traits<_InputIterator>::value_type,
+ typename iterator_traits<_InputIterator>::value_type>)
+
+ typename iterator_traits<_InputIterator>::value_type __value = *__first;
+ *__result = __value;
+ while (++__first != __last)
+ if (!bool(__binary_pred(__value, *__first)))
+ {
+ __value = *__first;
+ *++__result = __value;
+ }
+ return ++__result;
+ }
+
+ /**
+ * This is an uglified
+ * unique_copy(_InputIterator, _InputIterator, _OutputIterator,
+ * _BinaryPredicate)
+ * overloaded for input iterators and forward iterator as result.
+ */
+ template<typename _InputIterator, typename _ForwardIterator,
+ typename _BinaryPredicate>
+ _ForwardIterator
+ __unique_copy(_InputIterator __first, _InputIterator __last,
+ _ForwardIterator __result, _BinaryPredicate __binary_pred,
+ input_iterator_tag, forward_iterator_tag)
+ {
+ // concept requirements -- iterators already checked
+ __glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
+ typename iterator_traits<_ForwardIterator>::value_type,
+ typename iterator_traits<_InputIterator>::value_type>)
+
+ *__result = *__first;
+ while (++__first != __last)
+ if (!bool(__binary_pred(*__result, *__first)))
+ *++__result = *__first;
+ return ++__result;
+ }
+
+ /**
+ * This is an uglified reverse(_BidirectionalIterator,
+ * _BidirectionalIterator)
+ * overloaded for bidirectional iterators.
+ */
+ template<typename _BidirectionalIterator>
+ void
+ __reverse(_BidirectionalIterator __first, _BidirectionalIterator __last,
+ bidirectional_iterator_tag)
+ {
+ while (true)
+ if (__first == __last || __first == --__last)
+ return;
+ else
+ {
+ std::iter_swap(__first, __last);
+ ++__first;
+ }
+ }
+
+ /**
+ * This is an uglified reverse(_BidirectionalIterator,
+ * _BidirectionalIterator)
+ * overloaded for random access iterators.
+ */
+ template<typename _RandomAccessIterator>
+ void
+ __reverse(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ random_access_iterator_tag)
+ {
+ if (__first == __last)
+ return;
+ --__last;
+ while (__first < __last)
+ {
+ std::iter_swap(__first, __last);
+ ++__first;
+ --__last;
+ }
+ }
+
+ /**
+ * @brief Reverse a sequence.
+ * @ingroup mutating_algorithms
+ * @param first A bidirectional iterator.
+ * @param last A bidirectional iterator.
+ * @return reverse() returns no value.
+ *
+ * Reverses the order of the elements in the range @p [first,last),
+ * so that the first element becomes the last etc.
+ * For every @c i such that @p 0<=i<=(last-first)/2), @p reverse()
+ * swaps @p *(first+i) and @p *(last-(i+1))
+ */
+ template<typename _BidirectionalIterator>
+ inline void
+ reverse(_BidirectionalIterator __first, _BidirectionalIterator __last)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept<
+ _BidirectionalIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
+ std::__reverse(__first, __last, std::__iterator_category(__first));
+ }
+
+ /**
+ * @brief Copy a sequence, reversing its elements.
+ * @ingroup mutating_algorithms
+ * @param first A bidirectional iterator.
+ * @param last A bidirectional iterator.
+ * @param result An output iterator.
+ * @return An iterator designating the end of the resulting sequence.
+ *
+ * Copies the elements in the range @p [first,last) to the range
+ * @p [result,result+(last-first)) such that the order of the
+ * elements is reversed.
+ * For every @c i such that @p 0<=i<=(last-first), @p reverse_copy()
+ * performs the assignment @p *(result+(last-first)-i) = *(first+i).
+ * The ranges @p [first,last) and @p [result,result+(last-first))
+ * must not overlap.
+ */
+ template<typename _BidirectionalIterator, typename _OutputIterator>
+ _OutputIterator
+ reverse_copy(_BidirectionalIterator __first, _BidirectionalIterator __last,
+ _OutputIterator __result)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_BidirectionalIteratorConcept<
+ _BidirectionalIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_BidirectionalIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ while (__first != __last)
+ {
+ --__last;
+ *__result = *__last;
+ ++__result;
+ }
+ return __result;
+ }
+
+ /**
+ * This is a helper function for the rotate algorithm specialized on RAIs.
+ * It returns the greatest common divisor of two integer values.
+ */
+ template<typename _EuclideanRingElement>
+ _EuclideanRingElement
+ __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n)
+ {
+ while (__n != 0)
+ {
+ _EuclideanRingElement __t = __m % __n;
+ __m = __n;
+ __n = __t;
+ }
+ return __m;
+ }
+
+ /// This is a helper function for the rotate algorithm.
+ template<typename _ForwardIterator>
+ void
+ __rotate(_ForwardIterator __first,
+ _ForwardIterator __middle,
+ _ForwardIterator __last,
+ forward_iterator_tag)
+ {
+ if (__first == __middle || __last == __middle)
+ return;
+
+ _ForwardIterator __first2 = __middle;
+ do
+ {
+ std::iter_swap(__first, __first2);
+ ++__first;
+ ++__first2;
+ if (__first == __middle)
+ __middle = __first2;
+ }
+ while (__first2 != __last);
+
+ __first2 = __middle;
+
+ while (__first2 != __last)
+ {
+ std::iter_swap(__first, __first2);
+ ++__first;
+ ++__first2;
+ if (__first == __middle)
+ __middle = __first2;
+ else if (__first2 == __last)
+ __first2 = __middle;
+ }
+ }
+
+ /// This is a helper function for the rotate algorithm.
+ template<typename _BidirectionalIterator>
+ void
+ __rotate(_BidirectionalIterator __first,
+ _BidirectionalIterator __middle,
+ _BidirectionalIterator __last,
+ bidirectional_iterator_tag)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept<
+ _BidirectionalIterator>)
+
+ if (__first == __middle || __last == __middle)
+ return;
+
+ std::__reverse(__first, __middle, bidirectional_iterator_tag());
+ std::__reverse(__middle, __last, bidirectional_iterator_tag());
+
+ while (__first != __middle && __middle != __last)
+ {
+ std::iter_swap(__first, --__last);
+ ++__first;
+ }
+
+ if (__first == __middle)
+ std::__reverse(__middle, __last, bidirectional_iterator_tag());
+ else
+ std::__reverse(__first, __middle, bidirectional_iterator_tag());
+ }
+
+ /// This is a helper function for the rotate algorithm.
+ template<typename _RandomAccessIterator>
+ void
+ __rotate(_RandomAccessIterator __first,
+ _RandomAccessIterator __middle,
+ _RandomAccessIterator __last,
+ random_access_iterator_tag)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+
+ if (__first == __middle || __last == __middle)
+ return;
+
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type
+ _Distance;
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+
+ const _Distance __n = __last - __first;
+ const _Distance __k = __middle - __first;
+ const _Distance __l = __n - __k;
+
+ if (__k == __l)
+ {
+ std::swap_ranges(__first, __middle, __middle);
+ return;
+ }
+
+ const _Distance __d = std::__gcd(__n, __k);
+
+ for (_Distance __i = 0; __i < __d; __i++)
+ {
+ _ValueType __tmp = _GLIBCXX_MOVE(*__first);
+ _RandomAccessIterator __p = __first;
+
+ if (__k < __l)
+ {
+ for (_Distance __j = 0; __j < __l / __d; __j++)
+ {
+ if (__p > __first + __l)
+ {
+ *__p = _GLIBCXX_MOVE(*(__p - __l));
+ __p -= __l;
+ }
+
+ *__p = _GLIBCXX_MOVE(*(__p + __k));
+ __p += __k;
+ }
+ }
+ else
+ {
+ for (_Distance __j = 0; __j < __k / __d - 1; __j ++)
+ {
+ if (__p < __last - __k)
+ {
+ *__p = _GLIBCXX_MOVE(*(__p + __k));
+ __p += __k;
+ }
+ *__p = _GLIBCXX_MOVE(*(__p - __l));
+ __p -= __l;
+ }
+ }
+
+ *__p = _GLIBCXX_MOVE(__tmp);
+ ++__first;
+ }
+ }
+
+ /**
+ * @brief Rotate the elements of a sequence.
+ * @ingroup mutating_algorithms
+ * @param first A forward iterator.
+ * @param middle A forward iterator.
+ * @param last A forward iterator.
+ * @return Nothing.
+ *
+ * Rotates the elements of the range @p [first,last) by @p (middle-first)
+ * positions so that the element at @p middle is moved to @p first, the
+ * element at @p middle+1 is moved to @first+1 and so on for each element
+ * in the range @p [first,last).
+ *
+ * This effectively swaps the ranges @p [first,middle) and
+ * @p [middle,last).
+ *
+ * Performs @p *(first+(n+(last-middle))%(last-first))=*(first+n) for
+ * each @p n in the range @p [0,last-first).
+ */
+ template<typename _ForwardIterator>
+ inline void
+ rotate(_ForwardIterator __first, _ForwardIterator __middle,
+ _ForwardIterator __last)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
+ _ForwardIterator>)
+ __glibcxx_requires_valid_range(__first, __middle);
+ __glibcxx_requires_valid_range(__middle, __last);
+
+ typedef typename iterator_traits<_ForwardIterator>::iterator_category
+ _IterType;
+ std::__rotate(__first, __middle, __last, _IterType());
+ }
+
+ /**
+ * @brief Copy a sequence, rotating its elements.
+ * @ingroup mutating_algorithms
+ * @param first A forward iterator.
+ * @param middle A forward iterator.
+ * @param last A forward iterator.
+ * @param result An output iterator.
+ * @return An iterator designating the end of the resulting sequence.
+ *
+ * Copies the elements of the range @p [first,last) to the range
+ * beginning at @result, rotating the copied elements by @p (middle-first)
+ * positions so that the element at @p middle is moved to @p result, the
+ * element at @p middle+1 is moved to @result+1 and so on for each element
+ * in the range @p [first,last).
+ *
+ * Performs @p *(result+(n+(last-middle))%(last-first))=*(first+n) for
+ * each @p n in the range @p [0,last-first).
+ */
+ template<typename _ForwardIterator, typename _OutputIterator>
+ _OutputIterator
+ rotate_copy(_ForwardIterator __first, _ForwardIterator __middle,
+ _ForwardIterator __last, _OutputIterator __result)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __middle);
+ __glibcxx_requires_valid_range(__middle, __last);
+
+ return std::copy(__first, __middle,
+ std::copy(__middle, __last, __result));
+ }
+
+ /// This is a helper function...
+ template<typename _ForwardIterator, typename _Predicate>
+ _ForwardIterator
+ __partition(_ForwardIterator __first, _ForwardIterator __last,
+ _Predicate __pred, forward_iterator_tag)
+ {
+ if (__first == __last)
+ return __first;
+
+ while (__pred(*__first))
+ if (++__first == __last)
+ return __first;
+
+ _ForwardIterator __next = __first;
+
+ while (++__next != __last)
+ if (__pred(*__next))
+ {
+ std::iter_swap(__first, __next);
+ ++__first;
+ }
+
+ return __first;
+ }
+
+ /// This is a helper function...
+ template<typename _BidirectionalIterator, typename _Predicate>
+ _BidirectionalIterator
+ __partition(_BidirectionalIterator __first, _BidirectionalIterator __last,
+ _Predicate __pred, bidirectional_iterator_tag)
+ {
+ while (true)
+ {
+ while (true)
+ if (__first == __last)
+ return __first;
+ else if (__pred(*__first))
+ ++__first;
+ else
+ break;
+ --__last;
+ while (true)
+ if (__first == __last)
+ return __first;
+ else if (!bool(__pred(*__last)))
+ --__last;
+ else
+ break;
+ std::iter_swap(__first, __last);
+ ++__first;
+ }
+ }
+
+ // partition
+
+ /// This is a helper function...
+ template<typename _ForwardIterator, typename _Predicate, typename _Distance>
+ _ForwardIterator
+ __inplace_stable_partition(_ForwardIterator __first,
+ _ForwardIterator __last,
+ _Predicate __pred, _Distance __len)
+ {
+ if (__len == 1)
+ return __pred(*__first) ? __last : __first;
+ _ForwardIterator __middle = __first;
+ std::advance(__middle, __len / 2);
+ _ForwardIterator __begin = std::__inplace_stable_partition(__first,
+ __middle,
+ __pred,
+ __len / 2);
+ _ForwardIterator __end = std::__inplace_stable_partition(__middle, __last,
+ __pred,
+ __len
+ - __len / 2);
+ std::rotate(__begin, __middle, __end);
+ std::advance(__begin, std::distance(__middle, __end));
+ return __begin;
+ }
+
+ /// This is a helper function...
+ template<typename _ForwardIterator, typename _Pointer, typename _Predicate,
+ typename _Distance>
+ _ForwardIterator
+ __stable_partition_adaptive(_ForwardIterator __first,
+ _ForwardIterator __last,
+ _Predicate __pred, _Distance __len,
+ _Pointer __buffer,
+ _Distance __buffer_size)
+ {
+ if (__len <= __buffer_size)
+ {
+ _ForwardIterator __result1 = __first;
+ _Pointer __result2 = __buffer;
+ for (; __first != __last; ++__first)
+ if (__pred(*__first))
+ {
+ *__result1 = *__first;
+ ++__result1;
+ }
+ else
+ {
+ *__result2 = *__first;
+ ++__result2;
+ }
+ std::copy(__buffer, __result2, __result1);
+ return __result1;
+ }
+ else
+ {
+ _ForwardIterator __middle = __first;
+ std::advance(__middle, __len / 2);
+ _ForwardIterator __begin =
+ std::__stable_partition_adaptive(__first, __middle, __pred,
+ __len / 2, __buffer,
+ __buffer_size);
+ _ForwardIterator __end =
+ std::__stable_partition_adaptive(__middle, __last, __pred,
+ __len - __len / 2,
+ __buffer, __buffer_size);
+ std::rotate(__begin, __middle, __end);
+ std::advance(__begin, std::distance(__middle, __end));
+ return __begin;
+ }
+ }
+
+ /**
+ * @brief Move elements for which a predicate is true to the beginning
+ * of a sequence, preserving relative ordering.
+ * @ingroup mutating_algorithms
+ * @param first A forward iterator.
+ * @param last A forward iterator.
+ * @param pred A predicate functor.
+ * @return An iterator @p middle such that @p pred(i) is true for each
+ * iterator @p i in the range @p [first,middle) and false for each @p i
+ * in the range @p [middle,last).
+ *
+ * Performs the same function as @p partition() with the additional
+ * guarantee that the relative ordering of elements in each group is
+ * preserved, so any two elements @p x and @p y in the range
+ * @p [first,last) such that @p pred(x)==pred(y) will have the same
+ * relative ordering after calling @p stable_partition().
+ */
+ template<typename _ForwardIterator, typename _Predicate>
+ _ForwardIterator
+ stable_partition(_ForwardIterator __first, _ForwardIterator __last,
+ _Predicate __pred)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
+ _ForwardIterator>)
+ __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return __first;
+ else
+ {
+ typedef typename iterator_traits<_ForwardIterator>::value_type
+ _ValueType;
+ typedef typename iterator_traits<_ForwardIterator>::difference_type
+ _DistanceType;
+
+ _Temporary_buffer<_ForwardIterator, _ValueType> __buf(__first,
+ __last);
+ if (__buf.size() > 0)
+ return
+ std::__stable_partition_adaptive(__first, __last, __pred,
+ _DistanceType(__buf.requested_size()),
+ __buf.begin(),
+ _DistanceType(__buf.size()));
+ else
+ return
+ std::__inplace_stable_partition(__first, __last, __pred,
+ _DistanceType(__buf.requested_size()));
+ }
+ }
+
+ /// This is a helper function for the sort routines.
+ template<typename _RandomAccessIterator>
+ void
+ __heap_select(_RandomAccessIterator __first,
+ _RandomAccessIterator __middle,
+ _RandomAccessIterator __last)
+ {
+ std::make_heap(__first, __middle);
+ for (_RandomAccessIterator __i = __middle; __i < __last; ++__i)
+ if (*__i < *__first)
+ std::__pop_heap(__first, __middle, __i);
+ }
+
+ /// This is a helper function for the sort routines.
+ template<typename _RandomAccessIterator, typename _Compare>
+ void
+ __heap_select(_RandomAccessIterator __first,
+ _RandomAccessIterator __middle,
+ _RandomAccessIterator __last, _Compare __comp)
+ {
+ std::make_heap(__first, __middle, __comp);
+ for (_RandomAccessIterator __i = __middle; __i < __last; ++__i)
+ if (__comp(*__i, *__first))
+ std::__pop_heap(__first, __middle, __i, __comp);
+ }
+
+ // partial_sort
+
+ /**
+ * @brief Copy the smallest elements of a sequence.
+ * @ingroup sorting_algorithms
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @param result_first A random-access iterator.
+ * @param result_last Another random-access iterator.
+ * @return An iterator indicating the end of the resulting sequence.
+ *
+ * Copies and sorts the smallest N values from the range @p [first,last)
+ * to the range beginning at @p result_first, where the number of
+ * elements to be copied, @p N, is the smaller of @p (last-first) and
+ * @p (result_last-result_first).
+ * After the sort if @p i and @j are iterators in the range
+ * @p [result_first,result_first+N) such that @i precedes @j then
+ * @p *j<*i is false.
+ * The value returned is @p result_first+N.
+ */
+ template<typename _InputIterator, typename _RandomAccessIterator>
+ _RandomAccessIterator
+ partial_sort_copy(_InputIterator __first, _InputIterator __last,
+ _RandomAccessIterator __result_first,
+ _RandomAccessIterator __result_last)
+ {
+ typedef typename iterator_traits<_InputIterator>::value_type
+ _InputValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _OutputValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type
+ _DistanceType;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_ConvertibleConcept<_InputValueType,
+ _OutputValueType>)
+ __glibcxx_function_requires(_LessThanOpConcept<_InputValueType,
+ _OutputValueType>)
+ __glibcxx_function_requires(_LessThanComparableConcept<_OutputValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
+ __glibcxx_requires_valid_range(__result_first, __result_last);
+
+ if (__result_first == __result_last)
+ return __result_last;
+ _RandomAccessIterator __result_real_last = __result_first;
+ while(__first != __last && __result_real_last != __result_last)
+ {
+ *__result_real_last = *__first;
+ ++__result_real_last;
+ ++__first;
+ }
+ std::make_heap(__result_first, __result_real_last);
+ while (__first != __last)
+ {
+ if (*__first < *__result_first)
+ std::__adjust_heap(__result_first, _DistanceType(0),
+ _DistanceType(__result_real_last
+ - __result_first),
+ _InputValueType(*__first));
+ ++__first;
+ }
+ std::sort_heap(__result_first, __result_real_last);
+ return __result_real_last;
+ }
+
+ /**
+ * @brief Copy the smallest elements of a sequence using a predicate for
+ * comparison.
+ * @ingroup sorting_algorithms
+ * @param first An input iterator.
+ * @param last Another input iterator.
+ * @param result_first A random-access iterator.
+ * @param result_last Another random-access iterator.
+ * @param comp A comparison functor.
+ * @return An iterator indicating the end of the resulting sequence.
+ *
+ * Copies and sorts the smallest N values from the range @p [first,last)
+ * to the range beginning at @p result_first, where the number of
+ * elements to be copied, @p N, is the smaller of @p (last-first) and
+ * @p (result_last-result_first).
+ * After the sort if @p i and @j are iterators in the range
+ * @p [result_first,result_first+N) such that @i precedes @j then
+ * @p comp(*j,*i) is false.
+ * The value returned is @p result_first+N.
+ */
+ template<typename _InputIterator, typename _RandomAccessIterator, typename _Compare>
+ _RandomAccessIterator
+ partial_sort_copy(_InputIterator __first, _InputIterator __last,
+ _RandomAccessIterator __result_first,
+ _RandomAccessIterator __result_last,
+ _Compare __comp)
+ {
+ typedef typename iterator_traits<_InputIterator>::value_type
+ _InputValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _OutputValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type
+ _DistanceType;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_function_requires(_ConvertibleConcept<_InputValueType,
+ _OutputValueType>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _InputValueType, _OutputValueType>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _OutputValueType, _OutputValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
+ __glibcxx_requires_valid_range(__result_first, __result_last);
+
+ if (__result_first == __result_last)
+ return __result_last;
+ _RandomAccessIterator __result_real_last = __result_first;
+ while(__first != __last && __result_real_last != __result_last)
+ {
+ *__result_real_last = *__first;
+ ++__result_real_last;
+ ++__first;
+ }
+ std::make_heap(__result_first, __result_real_last,
+ __CheckedCompare(__comp));
+ while (__first != __last)
+ {
+ if (__CheckedCompare(__comp)(*__first, *__result_first))
+ std::__adjust_heap(__result_first, _DistanceType(0),
+ _DistanceType(__result_real_last
+ - __result_first),
+ _InputValueType(*__first),
+ __CheckedCompare(__comp));
+ ++__first;
+ }
+ std::sort_heap(__result_first, __result_real_last,
+ __CheckedCompare(__comp));
+ return __result_real_last;
+ }
+
+ /// This is a helper function for the sort routine.
+ template<typename _RandomAccessIterator, typename _Tp>
+ void
+ __unguarded_linear_insert(_RandomAccessIterator __last, _Tp __val)
+ {
+ _RandomAccessIterator __next = __last;
+ --__next;
+ while (__val < *__next)
+ {
+ *__last = *__next;
+ __last = __next;
+ --__next;
+ }
+ *__last = __val;
+ }
+
+ /// This is a helper function for the sort routine.
+ template<typename _RandomAccessIterator, typename _Tp, typename _Compare>
+ void
+ __unguarded_linear_insert(_RandomAccessIterator __last, _Tp __val,
+ _Compare __comp)
+ {
+ _RandomAccessIterator __next = __last;
+ --__next;
+ while (__comp(__val, *__next))
+ {
+ *__last = *__next;
+ __last = __next;
+ --__next;
+ }
+ *__last = __val;
+ }
+
+ /// This is a helper function for the sort routine.
+ template<typename _RandomAccessIterator>
+ void
+ __insertion_sort(_RandomAccessIterator __first,
+ _RandomAccessIterator __last)
+ {
+ if (__first == __last)
+ return;
+
+ for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)
+ {
+ typename iterator_traits<_RandomAccessIterator>::value_type
+ __val = *__i;
+ if (__val < *__first)
+ {
+ std::copy_backward(__first, __i, __i + 1);
+ *__first = __val;
+ }
+ else
+ std::__unguarded_linear_insert(__i, __val);
+ }
+ }
+
+ /// This is a helper function for the sort routine.
+ template<typename _RandomAccessIterator, typename _Compare>
+ void
+ __insertion_sort(_RandomAccessIterator __first,
+ _RandomAccessIterator __last, _Compare __comp)
+ {
+ if (__first == __last) return;
+
+ for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)
+ {
+ typename iterator_traits<_RandomAccessIterator>::value_type
+ __val = *__i;
+ if (__comp(__val, *__first))
+ {
+ std::copy_backward(__first, __i, __i + 1);
+ *__first = __val;
+ }
+ else
+ std::__unguarded_linear_insert(__i, __val, __comp);
+ }
+ }
+
+ /// This is a helper function for the sort routine.
+ template<typename _RandomAccessIterator>
+ inline void
+ __unguarded_insertion_sort(_RandomAccessIterator __first,
+ _RandomAccessIterator __last)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+
+ for (_RandomAccessIterator __i = __first; __i != __last; ++__i)
+ std::__unguarded_linear_insert(__i, _ValueType(*__i));
+ }
+
+ /// This is a helper function for the sort routine.
+ template<typename _RandomAccessIterator, typename _Compare>
+ inline void
+ __unguarded_insertion_sort(_RandomAccessIterator __first,
+ _RandomAccessIterator __last, _Compare __comp)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+
+ for (_RandomAccessIterator __i = __first; __i != __last; ++__i)
+ std::__unguarded_linear_insert(__i, _ValueType(*__i), __comp);
+ }
+
+ /**
+ * @doctodo
+ * This controls some aspect of the sort routines.
+ */
+ enum { _S_threshold = 16 };
+
+ /// This is a helper function for the sort routine.
+ template<typename _RandomAccessIterator>
+ void
+ __final_insertion_sort(_RandomAccessIterator __first,
+ _RandomAccessIterator __last)
+ {
+ if (__last - __first > int(_S_threshold))
+ {
+ std::__insertion_sort(__first, __first + int(_S_threshold));
+ std::__unguarded_insertion_sort(__first + int(_S_threshold), __last);
+ }
+ else
+ std::__insertion_sort(__first, __last);
+ }
+
+ /// This is a helper function for the sort routine.
+ template<typename _RandomAccessIterator, typename _Compare>
+ void
+ __final_insertion_sort(_RandomAccessIterator __first,
+ _RandomAccessIterator __last, _Compare __comp)
+ {
+ if (__last - __first > int(_S_threshold))
+ {
+ std::__insertion_sort(__first, __first + int(_S_threshold), __comp);
+ std::__unguarded_insertion_sort(__first + int(_S_threshold), __last,
+ __comp);
+ }
+ else
+ std::__insertion_sort(__first, __last, __comp);
+ }
+
+ /// This is a helper function...
+ template<typename _RandomAccessIterator, typename _Tp>
+ _RandomAccessIterator
+ __unguarded_partition(_RandomAccessIterator __first,
+ _RandomAccessIterator __last, _Tp __pivot)
+ {
+ while (true)
+ {
+ while (*__first < __pivot)
+ ++__first;
+ --__last;
+ while (__pivot < *__last)
+ --__last;
+ if (!(__first < __last))
+ return __first;
+ std::iter_swap(__first, __last);
+ ++__first;
+ }
+ }
+
+ /// This is a helper function...
+ template<typename _RandomAccessIterator, typename _Tp, typename _Compare>
+ _RandomAccessIterator
+ __unguarded_partition(_RandomAccessIterator __first,
+ _RandomAccessIterator __last,
+ _Tp __pivot, _Compare __comp)
+ {
+ while (true)
+ {
+ while (__comp(*__first, __pivot))
+ ++__first;
+ --__last;
+ while (__comp(__pivot, *__last))
+ --__last;
+ if (!(__first < __last))
+ return __first;
+ std::iter_swap(__first, __last);
+ ++__first;
+ }
+ }
+
+ /// This is a helper function for the sort routine.
+ template<typename _RandomAccessIterator, typename _Size>
+ void
+ __introsort_loop(_RandomAccessIterator __first,
+ _RandomAccessIterator __last,
+ _Size __depth_limit)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+
+ while (__last - __first > int(_S_threshold))
+ {
+ if (__depth_limit == 0)
+ {
+ _GLIBCXX_STD_P::partial_sort(__first, __last, __last);
+ return;
+ }
+ --__depth_limit;
+ _RandomAccessIterator __cut =
+ std::__unguarded_partition(__first, __last,
+ _ValueType(std::__median(*__first,
+ *(__first
+ + (__last
+ - __first)
+ / 2),
+ *(__last
+ - 1))));
+ std::__introsort_loop(__cut, __last, __depth_limit);
+ __last = __cut;
+ }
+ }
+
+ /// This is a helper function for the sort routine.
+ template<typename _RandomAccessIterator, typename _Size, typename _Compare>
+ void
+ __introsort_loop(_RandomAccessIterator __first,
+ _RandomAccessIterator __last,
+ _Size __depth_limit, _Compare __comp)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+
+ while (__last - __first > int(_S_threshold))
+ {
+ if (__depth_limit == 0)
+ {
+ _GLIBCXX_STD_P::partial_sort(__first, __last, __last, __comp);
+ return;
+ }
+ --__depth_limit;
+ _RandomAccessIterator __cut =
+ std::__unguarded_partition(__first, __last,
+ _ValueType(std::__median(*__first,
+ *(__first
+ + (__last
+ - __first)
+ / 2),
+ *(__last - 1),
+ __comp)),
+ __comp);
+ std::__introsort_loop(__cut, __last, __depth_limit, __comp);
+ __last = __cut;
+ }
+ }
+
+ /// This is a helper function for the sort routines. Precondition: __n > 0.
+ template<typename _Size>
+ inline _Size
+ __lg(_Size __n)
+ {
+ _Size __k;
+ for (__k = 0; __n != 0; __n >>= 1)
+ ++__k;
+ return __k - 1;
+ }
+
+ inline int
+ __lg(int __n)
+ { return sizeof(int) * __CHAR_BIT__ - 1 - __builtin_clz(__n); }
+
+ inline long
+ __lg(long __n)
+ { return sizeof(long) * __CHAR_BIT__ - 1 - __builtin_clzl(__n); }
+
+ inline long long
+ __lg(long long __n)
+ { return sizeof(long long) * __CHAR_BIT__ - 1 - __builtin_clzll(__n); }
+
+ // sort
+
+ template<typename _RandomAccessIterator, typename _Size>
+ void
+ __introselect(_RandomAccessIterator __first, _RandomAccessIterator __nth,
+ _RandomAccessIterator __last, _Size __depth_limit)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+
+ while (__last - __first > 3)
+ {
+ if (__depth_limit == 0)
+ {
+ std::__heap_select(__first, __nth + 1, __last);
+
+ // Place the nth largest element in its final position.
+ std::iter_swap(__first, __nth);
+ return;
+ }
+ --__depth_limit;
+ _RandomAccessIterator __cut =
+ std::__unguarded_partition(__first, __last,
+ _ValueType(std::__median(*__first,
+ *(__first
+ + (__last
+ - __first)
+ / 2),
+ *(__last
+ - 1))));
+ if (__cut <= __nth)
+ __first = __cut;
+ else
+ __last = __cut;
+ }
+ std::__insertion_sort(__first, __last);
+ }
+
+ template<typename _RandomAccessIterator, typename _Size, typename _Compare>
+ void
+ __introselect(_RandomAccessIterator __first, _RandomAccessIterator __nth,
+ _RandomAccessIterator __last, _Size __depth_limit,
+ _Compare __comp)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+
+ while (__last - __first > 3)
+ {
+ if (__depth_limit == 0)
+ {
+ std::__heap_select(__first, __nth + 1, __last, __comp);
+ // Place the nth largest element in its final position.
+ std::iter_swap(__first, __nth);
+ return;
+ }
+ --__depth_limit;
+ _RandomAccessIterator __cut =
+ std::__unguarded_partition(__first, __last,
+ _ValueType(std::__median(*__first,
+ *(__first
+ + (__last
+ - __first)
+ / 2),
+ *(__last - 1),
+ __comp)),
+ __comp);
+ if (__cut <= __nth)
+ __first = __cut;
+ else
+ __last = __cut;
+ }
+ std::__insertion_sort(__first, __last, __comp);
+ }
+
+ // nth_element
+
+ /**
+ * @brief Finds the first position in which @a val could be inserted
+ * without changing the ordering.
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @param val The search term.
+ * @return An iterator pointing to the first element "not less
+ * than" @a val, or end() if every element is less than
+ * @a val.
+ * @ingroup binary_search_algorithms
+ */
+ template<typename _ForwardIterator, typename _Tp>
+ _ForwardIterator
+ lower_bound(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __val)
+ {
+ typedef typename iterator_traits<_ForwardIterator>::value_type
+ _ValueType;
+ typedef typename iterator_traits<_ForwardIterator>::difference_type
+ _DistanceType;
+
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_LessThanOpConcept<_ValueType, _Tp>)
+ __glibcxx_requires_partitioned_lower(__first, __last, __val);
+
+ _DistanceType __len = std::distance(__first, __last);
+ _DistanceType __half;
+ _ForwardIterator __middle;
+
+ while (__len > 0)
+ {
+ __half = __len >> 1;
+ __middle = __first;
+ std::advance(__middle, __half);
+ if (*__middle < __val)
+ {
+ __first = __middle;
+ ++__first;
+ __len = __len - __half - 1;
+ }
+ else
+ __len = __half;
+ }
+ return __first;
+ }
+
+ /**
+ * @brief Finds the first position in which @a val could be inserted
+ * without changing the ordering.
+ * @ingroup binary_search_algorithms
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @param val The search term.
+ * @param comp A functor to use for comparisons.
+ * @return An iterator pointing to the first element "not less than" @a val,
+ * or end() if every element is less than @a val.
+ * @ingroup binary_search_algorithms
+ *
+ * The comparison function should have the same effects on ordering as
+ * the function used for the initial sort.
+ */
+ template<typename _ForwardIterator, typename _Tp, typename _Compare>
+ _ForwardIterator
+ lower_bound(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __val, _Compare __comp)
+ {
+ typedef typename iterator_traits<_ForwardIterator>::value_type
+ _ValueType;
+ typedef typename iterator_traits<_ForwardIterator>::difference_type
+ _DistanceType;
+
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _ValueType, _Tp>)
+ __glibcxx_requires_partitioned_lower_pred(__first, __last,
+ __val, __comp);
+
+ _DistanceType __len = std::distance(__first, __last);
+ _DistanceType __half;
+ _ForwardIterator __middle;
+
+ while (__len > 0)
+ {
+ __half = __len >> 1;
+ __middle = __first;
+ std::advance(__middle, __half);
+ if (__CheckedCompare(__comp)(*__middle, __val))
+ {
+ __first = __middle;
+ ++__first;
+ __len = __len - __half - 1;
+ }
+ else
+ __len = __half;
+ }
+ return __first;
+ }
+
+ /**
+ * @brief Finds the last position in which @a val could be inserted
+ * without changing the ordering.
+ * @ingroup binary_search_algorithms
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @param val The search term.
+ * @return An iterator pointing to the first element greater than @a val,
+ * or end() if no elements are greater than @a val.
+ * @ingroup binary_search_algorithms
+ */
+ template<typename _ForwardIterator, typename _Tp>
+ _ForwardIterator
+ upper_bound(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __val)
+ {
+ typedef typename iterator_traits<_ForwardIterator>::value_type
+ _ValueType;
+ typedef typename iterator_traits<_ForwardIterator>::difference_type
+ _DistanceType;
+
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_LessThanOpConcept<_Tp, _ValueType>)
+ __glibcxx_requires_partitioned_upper(__first, __last, __val);
+
+ _DistanceType __len = std::distance(__first, __last);
+ _DistanceType __half;
+ _ForwardIterator __middle;
+
+ while (__len > 0)
+ {
+ __half = __len >> 1;
+ __middle = __first;
+ std::advance(__middle, __half);
+ if (__val < *__middle)
+ __len = __half;
+ else
+ {
+ __first = __middle;
+ ++__first;
+ __len = __len - __half - 1;
+ }
+ }
+ return __first;
+ }
+
+ /**
+ * @brief Finds the last position in which @a val could be inserted
+ * without changing the ordering.
+ * @ingroup binary_search_algorithms
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @param val The search term.
+ * @param comp A functor to use for comparisons.
+ * @return An iterator pointing to the first element greater than @a val,
+ * or end() if no elements are greater than @a val.
+ * @ingroup binary_search_algorithms
+ *
+ * The comparison function should have the same effects on ordering as
+ * the function used for the initial sort.
+ */
+ template<typename _ForwardIterator, typename _Tp, typename _Compare>
+ _ForwardIterator
+ upper_bound(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __val, _Compare __comp)
+ {
+ typedef typename iterator_traits<_ForwardIterator>::value_type
+ _ValueType;
+ typedef typename iterator_traits<_ForwardIterator>::difference_type
+ _DistanceType;
+
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _Tp, _ValueType>)
+ __glibcxx_requires_partitioned_upper_pred(__first, __last,
+ __val, __comp);
+
+ _DistanceType __len = std::distance(__first, __last);
+ _DistanceType __half;
+ _ForwardIterator __middle;
+
+ while (__len > 0)
+ {
+ __half = __len >> 1;
+ __middle = __first;
+ std::advance(__middle, __half);
+ if (__CheckedCompare(__comp)(__val, *__middle))
+ __len = __half;
+ else
+ {
+ __first = __middle;
+ ++__first;
+ __len = __len - __half - 1;
+ }
+ }
+ return __first;
+ }
+
+ /**
+ * @brief Finds the largest subrange in which @a val could be inserted
+ * at any place in it without changing the ordering.
+ * @ingroup binary_search_algorithms
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @param val The search term.
+ * @return An pair of iterators defining the subrange.
+ * @ingroup binary_search_algorithms
+ *
+ * This is equivalent to
+ * @code
+ * std::make_pair(lower_bound(first, last, val),
+ * upper_bound(first, last, val))
+ * @endcode
+ * but does not actually call those functions.
+ */
+ template<typename _ForwardIterator, typename _Tp>
+ pair<_ForwardIterator, _ForwardIterator>
+ equal_range(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __val)
+ {
+ typedef typename iterator_traits<_ForwardIterator>::value_type
+ _ValueType;
+ typedef typename iterator_traits<_ForwardIterator>::difference_type
+ _DistanceType;
+
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_LessThanOpConcept<_ValueType, _Tp>)
+ __glibcxx_function_requires(_LessThanOpConcept<_Tp, _ValueType>)
+ __glibcxx_requires_partitioned_lower(__first, __last, __val);
+ __glibcxx_requires_partitioned_upper(__first, __last, __val);
+
+ _DistanceType __len = std::distance(__first, __last);
+ _DistanceType __half;
+ _ForwardIterator __middle, __left, __right;
+
+ while (__len > 0)
+ {
+ __half = __len >> 1;
+ __middle = __first;
+ std::advance(__middle, __half);
+ if (*__middle < __val)
+ {
+ __first = __middle;
+ ++__first;
+ __len = __len - __half - 1;
+ }
+ else if (__val < *__middle)
+ __len = __half;
+ else
+ {
+ __left = std::lower_bound(__first, __middle, __val);
+ std::advance(__first, __len);
+ __right = std::upper_bound(++__middle, __first, __val);
+ return pair<_ForwardIterator, _ForwardIterator>(__left, __right);
+ }
+ }
+ return pair<_ForwardIterator, _ForwardIterator>(__first, __first);
+ }
+
+ /**
+ * @brief Finds the largest subrange in which @a val could be inserted
+ * at any place in it without changing the ordering.
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @param val The search term.
+ * @param comp A functor to use for comparisons.
+ * @return An pair of iterators defining the subrange.
+ * @ingroup binary_search_algorithms
+ *
+ * This is equivalent to
+ * @code
+ * std::make_pair(lower_bound(first, last, val, comp),
+ * upper_bound(first, last, val, comp))
+ * @endcode
+ * but does not actually call those functions.
+ */
+ template<typename _ForwardIterator, typename _Tp, typename _Compare>
+ pair<_ForwardIterator, _ForwardIterator>
+ equal_range(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __val,
+ _Compare __comp)
+ {
+ typedef typename iterator_traits<_ForwardIterator>::value_type
+ _ValueType;
+ typedef typename iterator_traits<_ForwardIterator>::difference_type
+ _DistanceType;
+
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _ValueType, _Tp>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _Tp, _ValueType>)
+ __glibcxx_requires_partitioned_lower_pred(__first, __last,
+ __val, __comp);
+ __glibcxx_requires_partitioned_upper_pred(__first, __last,
+ __val, __comp);
+
+ _DistanceType __len = std::distance(__first, __last);
+ _DistanceType __half;
+ _ForwardIterator __middle, __left, __right;
+
+ while (__len > 0)
+ {
+ __half = __len >> 1;
+ __middle = __first;
+ std::advance(__middle, __half);
+ if (__CheckedCompare(__comp)(*__middle, __val))
+ {
+ __first = __middle;
+ ++__first;
+ __len = __len - __half - 1;
+ }
+ else if (__CheckedCompare(__comp)(__val, *__middle))
+ __len = __half;
+ else
+ {
+ __left = std::lower_bound(__first, __middle, __val,
+ __CheckedCompare(__comp));
+ std::advance(__first, __len);
+ __right = std::upper_bound(++__middle, __first, __val,
+ __CheckedCompare(__comp));
+ return pair<_ForwardIterator, _ForwardIterator>(__left, __right);
+ }
+ }
+ return pair<_ForwardIterator, _ForwardIterator>(__first, __first);
+ }
+
+ /**
+ * @brief Determines whether an element exists in a range.
+ * @ingroup binary_search_algorithms
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @param val The search term.
+ * @return True if @a val (or its equivalent) is in [@a first,@a last ].
+ *
+ * Note that this does not actually return an iterator to @a val. For
+ * that, use std::find or a container's specialized find member functions.
+ */
+ template<typename _ForwardIterator, typename _Tp>
+ bool
+ binary_search(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __val)
+ {
+ typedef typename iterator_traits<_ForwardIterator>::value_type
+ _ValueType;
+
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_LessThanOpConcept<_Tp, _ValueType>)
+ __glibcxx_requires_partitioned_lower(__first, __last, __val);
+ __glibcxx_requires_partitioned_upper(__first, __last, __val);
+
+ _ForwardIterator __i = std::lower_bound(__first, __last, __val);
+ return __i != __last && !(__val < *__i);
+ }
+
+ /**
+ * @brief Determines whether an element exists in a range.
+ * @ingroup binary_search_algorithms
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @param val The search term.
+ * @param comp A functor to use for comparisons.
+ * @return True if @a val (or its equivalent) is in [@a first,@a last ].
+ *
+ * Note that this does not actually return an iterator to @a val. For
+ * that, use std::find or a container's specialized find member functions.
+ *
+ * The comparison function should have the same effects on ordering as
+ * the function used for the initial sort.
+ */
+ template<typename _ForwardIterator, typename _Tp, typename _Compare>
+ bool
+ binary_search(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __val, _Compare __comp)
+ {
+ typedef typename iterator_traits<_ForwardIterator>::value_type
+ _ValueType;
+
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _Tp, _ValueType>)
+ __glibcxx_requires_partitioned_lower_pred(__first, __last,
+ __val, __comp);
+ __glibcxx_requires_partitioned_upper_pred(__first, __last,
+ __val, __comp);
+
+ _ForwardIterator __i = std::lower_bound(__first, __last, __val,
+ __CheckedCompare(__comp));
+ return __i != __last && !bool(__CheckedCompare(__comp)(__val, *__i));
+ }
+
+ // merge
+
+ /// This is a helper function for the merge routines.
+ template<typename _BidirectionalIterator1, typename _BidirectionalIterator2,
+ typename _BidirectionalIterator3>
+ _BidirectionalIterator3
+ __merge_backward(_BidirectionalIterator1 __first1,
+ _BidirectionalIterator1 __last1,
+ _BidirectionalIterator2 __first2,
+ _BidirectionalIterator2 __last2,
+ _BidirectionalIterator3 __result)
+ {
+ if (__first1 == __last1)
+ return std::copy_backward(__first2, __last2, __result);
+ if (__first2 == __last2)
+ return std::copy_backward(__first1, __last1, __result);
+ --__last1;
+ --__last2;
+ while (true)
+ {
+ if (*__last2 < *__last1)
+ {
+ *--__result = *__last1;
+ if (__first1 == __last1)
+ return std::copy_backward(__first2, ++__last2, __result);
+ --__last1;
+ }
+ else
+ {
+ *--__result = *__last2;
+ if (__first2 == __last2)
+ return std::copy_backward(__first1, ++__last1, __result);
+ --__last2;
+ }
+ }
+ }
+
+ /// This is a helper function for the merge routines.
+ template<typename _BidirectionalIterator1, typename _BidirectionalIterator2,
+ typename _BidirectionalIterator3, typename _Compare>
+ _BidirectionalIterator3
+ __merge_backward(_BidirectionalIterator1 __first1,
+ _BidirectionalIterator1 __last1,
+ _BidirectionalIterator2 __first2,
+ _BidirectionalIterator2 __last2,
+ _BidirectionalIterator3 __result,
+ _Compare __comp)
+ {
+ if (__first1 == __last1)
+ return std::copy_backward(__first2, __last2, __result);
+ if (__first2 == __last2)
+ return std::copy_backward(__first1, __last1, __result);
+ --__last1;
+ --__last2;
+ while (true)
+ {
+ if (__comp(*__last2, *__last1))
+ {
+ *--__result = *__last1;
+ if (__first1 == __last1)
+ return std::copy_backward(__first2, ++__last2, __result);
+ --__last1;
+ }
+ else
+ {
+ *--__result = *__last2;
+ if (__first2 == __last2)
+ return std::copy_backward(__first1, ++__last1, __result);
+ --__last2;
+ }
+ }
+ }
+
+ /// This is a helper function for the merge routines.
+ template<typename _BidirectionalIterator1, typename _BidirectionalIterator2,
+ typename _Distance>
+ _BidirectionalIterator1
+ __rotate_adaptive(_BidirectionalIterator1 __first,
+ _BidirectionalIterator1 __middle,
+ _BidirectionalIterator1 __last,
+ _Distance __len1, _Distance __len2,
+ _BidirectionalIterator2 __buffer,
+ _Distance __buffer_size)
+ {
+ _BidirectionalIterator2 __buffer_end;
+ if (__len1 > __len2 && __len2 <= __buffer_size)
+ {
+ __buffer_end = std::copy(__middle, __last, __buffer);
+ std::copy_backward(__first, __middle, __last);
+ return std::copy(__buffer, __buffer_end, __first);
+ }
+ else if (__len1 <= __buffer_size)
+ {
+ __buffer_end = std::copy(__first, __middle, __buffer);
+ std::copy(__middle, __last, __first);
+ return std::copy_backward(__buffer, __buffer_end, __last);
+ }
+ else
+ {
+ std::rotate(__first, __middle, __last);
+ std::advance(__first, std::distance(__middle, __last));
+ return __first;
+ }
+ }
+
+ /// This is a helper function for the merge routines.
+ template<typename _BidirectionalIterator, typename _Distance,
+ typename _Pointer>
+ void
+ __merge_adaptive(_BidirectionalIterator __first,
+ _BidirectionalIterator __middle,
+ _BidirectionalIterator __last,
+ _Distance __len1, _Distance __len2,
+ _Pointer __buffer, _Distance __buffer_size)
+ {
+ if (__len1 <= __len2 && __len1 <= __buffer_size)
+ {
+ _Pointer __buffer_end = std::copy(__first, __middle, __buffer);
+ _GLIBCXX_STD_P::merge(__buffer, __buffer_end, __middle, __last,
+ __first);
+ }
+ else if (__len2 <= __buffer_size)
+ {
+ _Pointer __buffer_end = std::copy(__middle, __last, __buffer);
+ std::__merge_backward(__first, __middle, __buffer,
+ __buffer_end, __last);
+ }
+ else
+ {
+ _BidirectionalIterator __first_cut = __first;
+ _BidirectionalIterator __second_cut = __middle;
+ _Distance __len11 = 0;
+ _Distance __len22 = 0;
+ if (__len1 > __len2)
+ {
+ __len11 = __len1 / 2;
+ std::advance(__first_cut, __len11);
+ __second_cut = std::lower_bound(__middle, __last,
+ *__first_cut);
+ __len22 = std::distance(__middle, __second_cut);
+ }
+ else
+ {
+ __len22 = __len2 / 2;
+ std::advance(__second_cut, __len22);
+ __first_cut = std::upper_bound(__first, __middle,
+ *__second_cut);
+ __len11 = std::distance(__first, __first_cut);
+ }
+ _BidirectionalIterator __new_middle =
+ std::__rotate_adaptive(__first_cut, __middle, __second_cut,
+ __len1 - __len11, __len22, __buffer,
+ __buffer_size);
+ std::__merge_adaptive(__first, __first_cut, __new_middle, __len11,
+ __len22, __buffer, __buffer_size);
+ std::__merge_adaptive(__new_middle, __second_cut, __last,
+ __len1 - __len11,
+ __len2 - __len22, __buffer, __buffer_size);
+ }
+ }
+
+ /// This is a helper function for the merge routines.
+ template<typename _BidirectionalIterator, typename _Distance,
+ typename _Pointer, typename _Compare>
+ void
+ __merge_adaptive(_BidirectionalIterator __first,
+ _BidirectionalIterator __middle,
+ _BidirectionalIterator __last,
+ _Distance __len1, _Distance __len2,
+ _Pointer __buffer, _Distance __buffer_size,
+ _Compare __comp)
+ {
+ if (__len1 <= __len2 && __len1 <= __buffer_size)
+ {
+ _Pointer __buffer_end = std::copy(__first, __middle, __buffer);
+ _GLIBCXX_STD_P::merge(__buffer, __buffer_end, __middle, __last,
+ __first, __comp);
+ }
+ else if (__len2 <= __buffer_size)
+ {
+ _Pointer __buffer_end = std::copy(__middle, __last, __buffer);
+ std::__merge_backward(__first, __middle, __buffer, __buffer_end,
+ __last, __comp);
+ }
+ else
+ {
+ _BidirectionalIterator __first_cut = __first;
+ _BidirectionalIterator __second_cut = __middle;
+ _Distance __len11 = 0;
+ _Distance __len22 = 0;
+ if (__len1 > __len2)
+ {
+ __len11 = __len1 / 2;
+ std::advance(__first_cut, __len11);
+ __second_cut = std::lower_bound(__middle, __last, *__first_cut,
+ __comp);
+ __len22 = std::distance(__middle, __second_cut);
+ }
+ else
+ {
+ __len22 = __len2 / 2;
+ std::advance(__second_cut, __len22);
+ __first_cut = std::upper_bound(__first, __middle, *__second_cut,
+ __comp);
+ __len11 = std::distance(__first, __first_cut);
+ }
+ _BidirectionalIterator __new_middle =
+ std::__rotate_adaptive(__first_cut, __middle, __second_cut,
+ __len1 - __len11, __len22, __buffer,
+ __buffer_size);
+ std::__merge_adaptive(__first, __first_cut, __new_middle, __len11,
+ __len22, __buffer, __buffer_size, __comp);
+ std::__merge_adaptive(__new_middle, __second_cut, __last,
+ __len1 - __len11,
+ __len2 - __len22, __buffer,
+ __buffer_size, __comp);
+ }
+ }
+
+ /// This is a helper function for the merge routines.
+ template<typename _BidirectionalIterator, typename _Distance>
+ void
+ __merge_without_buffer(_BidirectionalIterator __first,
+ _BidirectionalIterator __middle,
+ _BidirectionalIterator __last,
+ _Distance __len1, _Distance __len2)
+ {
+ if (__len1 == 0 || __len2 == 0)
+ return;
+ if (__len1 + __len2 == 2)
+ {
+ if (*__middle < *__first)
+ std::iter_swap(__first, __middle);
+ return;
+ }
+ _BidirectionalIterator __first_cut = __first;
+ _BidirectionalIterator __second_cut = __middle;
+ _Distance __len11 = 0;
+ _Distance __len22 = 0;
+ if (__len1 > __len2)
+ {
+ __len11 = __len1 / 2;
+ std::advance(__first_cut, __len11);
+ __second_cut = std::lower_bound(__middle, __last, *__first_cut);
+ __len22 = std::distance(__middle, __second_cut);
+ }
+ else
+ {
+ __len22 = __len2 / 2;
+ std::advance(__second_cut, __len22);
+ __first_cut = std::upper_bound(__first, __middle, *__second_cut);
+ __len11 = std::distance(__first, __first_cut);
+ }
+ std::rotate(__first_cut, __middle, __second_cut);
+ _BidirectionalIterator __new_middle = __first_cut;
+ std::advance(__new_middle, std::distance(__middle, __second_cut));
+ std::__merge_without_buffer(__first, __first_cut, __new_middle,
+ __len11, __len22);
+ std::__merge_without_buffer(__new_middle, __second_cut, __last,
+ __len1 - __len11, __len2 - __len22);
+ }
+
+ /// This is a helper function for the merge routines.
+ template<typename _BidirectionalIterator, typename _Distance,
+ typename _Compare>
+ void
+ __merge_without_buffer(_BidirectionalIterator __first,
+ _BidirectionalIterator __middle,
+ _BidirectionalIterator __last,
+ _Distance __len1, _Distance __len2,
+ _Compare __comp)
+ {
+ if (__len1 == 0 || __len2 == 0)
+ return;
+ if (__len1 + __len2 == 2)
+ {
+ if (__comp(*__middle, *__first))
+ std::iter_swap(__first, __middle);
+ return;
+ }
+ _BidirectionalIterator __first_cut = __first;
+ _BidirectionalIterator __second_cut = __middle;
+ _Distance __len11 = 0;
+ _Distance __len22 = 0;
+ if (__len1 > __len2)
+ {
+ __len11 = __len1 / 2;
+ std::advance(__first_cut, __len11);
+ __second_cut = std::lower_bound(__middle, __last, *__first_cut,
+ __comp);
+ __len22 = std::distance(__middle, __second_cut);
+ }
+ else
+ {
+ __len22 = __len2 / 2;
+ std::advance(__second_cut, __len22);
+ __first_cut = std::upper_bound(__first, __middle, *__second_cut,
+ __comp);
+ __len11 = std::distance(__first, __first_cut);
+ }
+ std::rotate(__first_cut, __middle, __second_cut);
+ _BidirectionalIterator __new_middle = __first_cut;
+ std::advance(__new_middle, std::distance(__middle, __second_cut));
+ std::__merge_without_buffer(__first, __first_cut, __new_middle,
+ __len11, __len22, __comp);
+ std::__merge_without_buffer(__new_middle, __second_cut, __last,
+ __len1 - __len11, __len2 - __len22, __comp);
+ }
+
+ /**
+ * @brief Merges two sorted ranges in place.
+ * @ingroup sorting_algorithms
+ * @param first An iterator.
+ * @param middle Another iterator.
+ * @param last Another iterator.
+ * @return Nothing.
+ *
+ * Merges two sorted and consecutive ranges, [first,middle) and
+ * [middle,last), and puts the result in [first,last). The output will
+ * be sorted. The sort is @e stable, that is, for equivalent
+ * elements in the two ranges, elements from the first range will always
+ * come before elements from the second.
+ *
+ * If enough additional memory is available, this takes (last-first)-1
+ * comparisons. Otherwise an NlogN algorithm is used, where N is
+ * distance(first,last).
+ */
+ template<typename _BidirectionalIterator>
+ void
+ inplace_merge(_BidirectionalIterator __first,
+ _BidirectionalIterator __middle,
+ _BidirectionalIterator __last)
+ {
+ typedef typename iterator_traits<_BidirectionalIterator>::value_type
+ _ValueType;
+ typedef typename iterator_traits<_BidirectionalIterator>::difference_type
+ _DistanceType;
+
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept<
+ _BidirectionalIterator>)
+ __glibcxx_function_requires(_LessThanComparableConcept<_ValueType>)
+ __glibcxx_requires_sorted(__first, __middle);
+ __glibcxx_requires_sorted(__middle, __last);
+
+ if (__first == __middle || __middle == __last)
+ return;
+
+ _DistanceType __len1 = std::distance(__first, __middle);
+ _DistanceType __len2 = std::distance(__middle, __last);
+
+ _Temporary_buffer<_BidirectionalIterator, _ValueType> __buf(__first,
+ __last);
+ if (__buf.begin() == 0)
+ std::__merge_without_buffer(__first, __middle, __last, __len1, __len2);
+ else
+ std::__merge_adaptive(__first, __middle, __last, __len1, __len2,
+ __buf.begin(), _DistanceType(__buf.size()));
+ }
+
+ /**
+ * @brief Merges two sorted ranges in place.
+ * @ingroup sorting_algorithms
+ * @param first An iterator.
+ * @param middle Another iterator.
+ * @param last Another iterator.
+ * @param comp A functor to use for comparisons.
+ * @return Nothing.
+ *
+ * Merges two sorted and consecutive ranges, [first,middle) and
+ * [middle,last), and puts the result in [first,last). The output will
+ * be sorted. The sort is @e stable, that is, for equivalent
+ * elements in the two ranges, elements from the first range will always
+ * come before elements from the second.
+ *
+ * If enough additional memory is available, this takes (last-first)-1
+ * comparisons. Otherwise an NlogN algorithm is used, where N is
+ * distance(first,last).
+ *
+ * The comparison function should have the same effects on ordering as
+ * the function used for the initial sort.
+ */
+ template<typename _BidirectionalIterator, typename _Compare>
+ void
+ inplace_merge(_BidirectionalIterator __first,
+ _BidirectionalIterator __middle,
+ _BidirectionalIterator __last,
+ _Compare __comp)
+ {
+ typedef typename iterator_traits<_BidirectionalIterator>::value_type
+ _ValueType;
+ typedef typename iterator_traits<_BidirectionalIterator>::difference_type
+ _DistanceType;
+
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept<
+ _BidirectionalIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _ValueType, _ValueType>)
+ __glibcxx_requires_sorted_pred(__first, __middle, __comp);
+ __glibcxx_requires_sorted_pred(__middle, __last, __comp);
+
+ if (__first == __middle || __middle == __last)
+ return;
+
+ const _DistanceType __len1 = std::distance(__first, __middle);
+ const _DistanceType __len2 = std::distance(__middle, __last);
+
+ _Temporary_buffer<_BidirectionalIterator, _ValueType> __buf(__first,
+ __last);
+ if (__buf.begin() == 0)
+ std::__merge_without_buffer(__first, __middle, __last, __len1,
+ __len2, __CheckedCompare(__comp));
+ else
+ std::__merge_adaptive(__first, __middle, __last, __len1, __len2,
+ __buf.begin(), _DistanceType(__buf.size()),
+ __CheckedCompare(__comp));
+ }
+
+ template<typename _RandomAccessIterator1, typename _RandomAccessIterator2,
+ typename _Distance>
+ void
+ __merge_sort_loop(_RandomAccessIterator1 __first,
+ _RandomAccessIterator1 __last,
+ _RandomAccessIterator2 __result,
+ _Distance __step_size)
+ {
+ const _Distance __two_step = 2 * __step_size;
+
+ while (__last - __first >= __two_step)
+ {
+ __result = _GLIBCXX_STD_P::merge(__first, __first + __step_size,
+ __first + __step_size,
+ __first + __two_step,
+ __result);
+ __first += __two_step;
+ }
+
+ __step_size = std::min(_Distance(__last - __first), __step_size);
+ _GLIBCXX_STD_P::merge(__first, __first + __step_size,
+ __first + __step_size, __last,
+ __result);
+ }
+
+ template<typename _RandomAccessIterator1, typename _RandomAccessIterator2,
+ typename _Distance, typename _Compare>
+ void
+ __merge_sort_loop(_RandomAccessIterator1 __first,
+ _RandomAccessIterator1 __last,
+ _RandomAccessIterator2 __result, _Distance __step_size,
+ _Compare __comp)
+ {
+ const _Distance __two_step = 2 * __step_size;
+
+ while (__last - __first >= __two_step)
+ {
+ __result = _GLIBCXX_STD_P::merge(__first, __first + __step_size,
+ __first + __step_size, __first + __two_step,
+ __result,
+ __comp);
+ __first += __two_step;
+ }
+ __step_size = std::min(_Distance(__last - __first), __step_size);
+
+ _GLIBCXX_STD_P::merge(__first, __first + __step_size,
+ __first + __step_size, __last, __result, __comp);
+ }
+
+ template<typename _RandomAccessIterator, typename _Distance>
+ void
+ __chunk_insertion_sort(_RandomAccessIterator __first,
+ _RandomAccessIterator __last,
+ _Distance __chunk_size)
+ {
+ while (__last - __first >= __chunk_size)
+ {
+ std::__insertion_sort(__first, __first + __chunk_size);
+ __first += __chunk_size;
+ }
+ std::__insertion_sort(__first, __last);
+ }
+
+ template<typename _RandomAccessIterator, typename _Distance,
+ typename _Compare>
+ void
+ __chunk_insertion_sort(_RandomAccessIterator __first,
+ _RandomAccessIterator __last,
+ _Distance __chunk_size, _Compare __comp)
+ {
+ while (__last - __first >= __chunk_size)
+ {
+ std::__insertion_sort(__first, __first + __chunk_size, __comp);
+ __first += __chunk_size;
+ }
+ std::__insertion_sort(__first, __last, __comp);
+ }
+
+ enum { _S_chunk_size = 7 };
+
+ template<typename _RandomAccessIterator, typename _Pointer>
+ void
+ __merge_sort_with_buffer(_RandomAccessIterator __first,
+ _RandomAccessIterator __last,
+ _Pointer __buffer)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type
+ _Distance;
+
+ const _Distance __len = __last - __first;
+ const _Pointer __buffer_last = __buffer + __len;
+
+ _Distance __step_size = _S_chunk_size;
+ std::__chunk_insertion_sort(__first, __last, __step_size);
+
+ while (__step_size < __len)
+ {
+ std::__merge_sort_loop(__first, __last, __buffer, __step_size);
+ __step_size *= 2;
+ std::__merge_sort_loop(__buffer, __buffer_last, __first, __step_size);
+ __step_size *= 2;
+ }
+ }
+
+ template<typename _RandomAccessIterator, typename _Pointer, typename _Compare>
+ void
+ __merge_sort_with_buffer(_RandomAccessIterator __first,
+ _RandomAccessIterator __last,
+ _Pointer __buffer, _Compare __comp)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type
+ _Distance;
+
+ const _Distance __len = __last - __first;
+ const _Pointer __buffer_last = __buffer + __len;
+
+ _Distance __step_size = _S_chunk_size;
+ std::__chunk_insertion_sort(__first, __last, __step_size, __comp);
+
+ while (__step_size < __len)
+ {
+ std::__merge_sort_loop(__first, __last, __buffer,
+ __step_size, __comp);
+ __step_size *= 2;
+ std::__merge_sort_loop(__buffer, __buffer_last, __first,
+ __step_size, __comp);
+ __step_size *= 2;
+ }
+ }
+
+ template<typename _RandomAccessIterator, typename _Pointer,
+ typename _Distance>
+ void
+ __stable_sort_adaptive(_RandomAccessIterator __first,
+ _RandomAccessIterator __last,
+ _Pointer __buffer, _Distance __buffer_size)
+ {
+ const _Distance __len = (__last - __first + 1) / 2;
+ const _RandomAccessIterator __middle = __first + __len;
+ if (__len > __buffer_size)
+ {
+ std::__stable_sort_adaptive(__first, __middle,
+ __buffer, __buffer_size);
+ std::__stable_sort_adaptive(__middle, __last,
+ __buffer, __buffer_size);
+ }
+ else
+ {
+ std::__merge_sort_with_buffer(__first, __middle, __buffer);
+ std::__merge_sort_with_buffer(__middle, __last, __buffer);
+ }
+ std::__merge_adaptive(__first, __middle, __last,
+ _Distance(__middle - __first),
+ _Distance(__last - __middle),
+ __buffer, __buffer_size);
+ }
+
+ template<typename _RandomAccessIterator, typename _Pointer,
+ typename _Distance, typename _Compare>
+ void
+ __stable_sort_adaptive(_RandomAccessIterator __first,
+ _RandomAccessIterator __last,
+ _Pointer __buffer, _Distance __buffer_size,
+ _Compare __comp)
+ {
+ const _Distance __len = (__last - __first + 1) / 2;
+ const _RandomAccessIterator __middle = __first + __len;
+ if (__len > __buffer_size)
+ {
+ std::__stable_sort_adaptive(__first, __middle, __buffer,
+ __buffer_size, __comp);
+ std::__stable_sort_adaptive(__middle, __last, __buffer,
+ __buffer_size, __comp);
+ }
+ else
+ {
+ std::__merge_sort_with_buffer(__first, __middle, __buffer, __comp);
+ std::__merge_sort_with_buffer(__middle, __last, __buffer, __comp);
+ }
+ std::__merge_adaptive(__first, __middle, __last,
+ _Distance(__middle - __first),
+ _Distance(__last - __middle),
+ __buffer, __buffer_size,
+ __comp);
+ }
+
+ /// This is a helper function for the stable sorting routines.
+ template<typename _RandomAccessIterator>
+ void
+ __inplace_stable_sort(_RandomAccessIterator __first,
+ _RandomAccessIterator __last)
+ {
+ if (__last - __first < 15)
+ {
+ std::__insertion_sort(__first, __last);
+ return;
+ }
+ _RandomAccessIterator __middle = __first + (__last - __first) / 2;
+ std::__inplace_stable_sort(__first, __middle);
+ std::__inplace_stable_sort(__middle, __last);
+ std::__merge_without_buffer(__first, __middle, __last,
+ __middle - __first,
+ __last - __middle);
+ }
+
+ /// This is a helper function for the stable sorting routines.
+ template<typename _RandomAccessIterator, typename _Compare>
+ void
+ __inplace_stable_sort(_RandomAccessIterator __first,
+ _RandomAccessIterator __last, _Compare __comp)
+ {
+ if (__last - __first < 15)
+ {
+ std::__insertion_sort(__first, __last, __comp);
+ return;
+ }
+ _RandomAccessIterator __middle = __first + (__last - __first) / 2;
+ std::__inplace_stable_sort(__first, __middle, __comp);
+ std::__inplace_stable_sort(__middle, __last, __comp);
+ std::__merge_without_buffer(__first, __middle, __last,
+ __middle - __first,
+ __last - __middle,
+ __comp);
+ }
+
+ // stable_sort
+
+ // Set algorithms: includes, set_union, set_intersection, set_difference,
+ // set_symmetric_difference. All of these algorithms have the precondition
+ // that their input ranges are sorted and the postcondition that their output
+ // ranges are sorted.
+
+ /**
+ * @brief Determines whether all elements of a sequence exists in a range.
+ * @param first1 Start of search range.
+ * @param last1 End of search range.
+ * @param first2 Start of sequence
+ * @param last2 End of sequence.
+ * @return True if each element in [first2,last2) is contained in order
+ * within [first1,last1). False otherwise.
+ * @ingroup set_algorithms
+ *
+ * This operation expects both [first1,last1) and [first2,last2) to be
+ * sorted. Searches for the presence of each element in [first2,last2)
+ * within [first1,last1). The iterators over each range only move forward,
+ * so this is a linear algorithm. If an element in [first2,last2) is not
+ * found before the search iterator reaches @a last2, false is returned.
+ */
+ template<typename _InputIterator1, typename _InputIterator2>
+ bool
+ includes(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2)
+ {
+ typedef typename iterator_traits<_InputIterator1>::value_type
+ _ValueType1;
+ typedef typename iterator_traits<_InputIterator2>::value_type
+ _ValueType2;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_function_requires(_LessThanOpConcept<_ValueType1, _ValueType2>)
+ __glibcxx_function_requires(_LessThanOpConcept<_ValueType2, _ValueType1>)
+ __glibcxx_requires_sorted_set(__first1, __last1, __first2);
+ __glibcxx_requires_sorted_set(__first2, __last2, __first1);
+
+ while (__first1 != __last1 && __first2 != __last2)
+ if (*__first2 < *__first1)
+ return false;
+ else if(*__first1 < *__first2)
+ ++__first1;
+ else
+ ++__first1, ++__first2;
+
+ return __first2 == __last2;
+ }
+
+ /**
+ * @brief Determines whether all elements of a sequence exists in a range
+ * using comparison.
+ * @ingroup set_algorithms
+ * @param first1 Start of search range.
+ * @param last1 End of search range.
+ * @param first2 Start of sequence
+ * @param last2 End of sequence.
+ * @param comp Comparison function to use.
+ * @return True if each element in [first2,last2) is contained in order
+ * within [first1,last1) according to comp. False otherwise.
+ * @ingroup set_algorithms
+ *
+ * This operation expects both [first1,last1) and [first2,last2) to be
+ * sorted. Searches for the presence of each element in [first2,last2)
+ * within [first1,last1), using comp to decide. The iterators over each
+ * range only move forward, so this is a linear algorithm. If an element
+ * in [first2,last2) is not found before the search iterator reaches @a
+ * last2, false is returned.
+ */
+ template<typename _InputIterator1, typename _InputIterator2,
+ typename _Compare>
+ bool
+ includes(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2,
+ _Compare __comp)
+ {
+ typedef typename iterator_traits<_InputIterator1>::value_type
+ _ValueType1;
+ typedef typename iterator_traits<_InputIterator2>::value_type
+ _ValueType2;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _ValueType1, _ValueType2>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _ValueType2, _ValueType1>)
+ __glibcxx_requires_sorted_set_pred(__first1, __last1, __first2, __comp);
+ __glibcxx_requires_sorted_set_pred(__first2, __last2, __first1, __comp);
+
+ while (__first1 != __last1 && __first2 != __last2)
+ if (__CheckedCompare(__comp)(*__first2, *__first1))
+ return false;
+ else if(__CheckedCompare(__comp)(*__first1, *__first2))
+ ++__first1;
+ else
+ ++__first1, ++__first2;
+
+ return __first2 == __last2;
+ }
+
+ // nth_element
+ // merge
+ // set_difference
+ // set_intersection
+ // set_union
+ // stable_sort
+ // set_symmetric_difference
+ // min_element
+ // max_element
+
+ /**
+ * @brief Permute range into the next "dictionary" ordering.
+ * @ingroup sorting_algorithms
+ * @param first Start of range.
+ * @param last End of range.
+ * @return False if wrapped to first permutation, true otherwise.
+ *
+ * Treats all permutations of the range as a set of "dictionary" sorted
+ * sequences. Permutes the current sequence into the next one of this set.
+ * Returns true if there are more sequences to generate. If the sequence
+ * is the largest of the set, the smallest is generated and false returned.
+ */
+ template<typename _BidirectionalIterator>
+ bool
+ next_permutation(_BidirectionalIterator __first,
+ _BidirectionalIterator __last)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_BidirectionalIteratorConcept<
+ _BidirectionalIterator>)
+ __glibcxx_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_BidirectionalIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return false;
+ _BidirectionalIterator __i = __first;
+ ++__i;
+ if (__i == __last)
+ return false;
+ __i = __last;
+ --__i;
+
+ for(;;)
+ {
+ _BidirectionalIterator __ii = __i;
+ --__i;
+ if (*__i < *__ii)
+ {
+ _BidirectionalIterator __j = __last;
+ while (!(*__i < *--__j))
+ {}
+ std::iter_swap(__i, __j);
+ std::reverse(__ii, __last);
+ return true;
+ }
+ if (__i == __first)
+ {
+ std::reverse(__first, __last);
+ return false;
+ }
+ }
+ }
+
+ /**
+ * @brief Permute range into the next "dictionary" ordering using
+ * comparison functor.
+ * @ingroup sorting_algorithms
+ * @param first Start of range.
+ * @param last End of range.
+ * @param comp A comparison functor.
+ * @return False if wrapped to first permutation, true otherwise.
+ *
+ * Treats all permutations of the range [first,last) as a set of
+ * "dictionary" sorted sequences ordered by @a comp. Permutes the current
+ * sequence into the next one of this set. Returns true if there are more
+ * sequences to generate. If the sequence is the largest of the set, the
+ * smallest is generated and false returned.
+ */
+ template<typename _BidirectionalIterator, typename _Compare>
+ bool
+ next_permutation(_BidirectionalIterator __first,
+ _BidirectionalIterator __last, _Compare __comp)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_BidirectionalIteratorConcept<
+ _BidirectionalIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ typename iterator_traits<_BidirectionalIterator>::value_type,
+ typename iterator_traits<_BidirectionalIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return false;
+ _BidirectionalIterator __i = __first;
+ ++__i;
+ if (__i == __last)
+ return false;
+ __i = __last;
+ --__i;
+
+ for(;;)
+ {
+ _BidirectionalIterator __ii = __i;
+ --__i;
+ if (__CheckedCompare(__comp)(*__i, *__ii))
+ {
+ _BidirectionalIterator __j = __last;
+ while (!bool(__CheckedCompare(__comp)(*__i, *--__j)))
+ {}
+ std::iter_swap(__i, __j);
+ std::reverse(__ii, __last);
+ return true;
+ }
+ if (__i == __first)
+ {
+ std::reverse(__first, __last);
+ return false;
+ }
+ }
+ }
+
+ /**
+ * @brief Permute range into the previous "dictionary" ordering.
+ * @ingroup sorting_algorithms
+ * @param first Start of range.
+ * @param last End of range.
+ * @return False if wrapped to last permutation, true otherwise.
+ *
+ * Treats all permutations of the range as a set of "dictionary" sorted
+ * sequences. Permutes the current sequence into the previous one of this
+ * set. Returns true if there are more sequences to generate. If the
+ * sequence is the smallest of the set, the largest is generated and false
+ * returned.
+ */
+ template<typename _BidirectionalIterator>
+ bool
+ prev_permutation(_BidirectionalIterator __first,
+ _BidirectionalIterator __last)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_BidirectionalIteratorConcept<
+ _BidirectionalIterator>)
+ __glibcxx_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_BidirectionalIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return false;
+ _BidirectionalIterator __i = __first;
+ ++__i;
+ if (__i == __last)
+ return false;
+ __i = __last;
+ --__i;
+
+ for(;;)
+ {
+ _BidirectionalIterator __ii = __i;
+ --__i;
+ if (*__ii < *__i)
+ {
+ _BidirectionalIterator __j = __last;
+ while (!(*--__j < *__i))
+ {}
+ std::iter_swap(__i, __j);
+ std::reverse(__ii, __last);
+ return true;
+ }
+ if (__i == __first)
+ {
+ std::reverse(__first, __last);
+ return false;
+ }
+ }
+ }
+
+ /**
+ * @brief Permute range into the previous "dictionary" ordering using
+ * comparison functor.
+ * @ingroup sorting_algorithms
+ * @param first Start of range.
+ * @param last End of range.
+ * @param comp A comparison functor.
+ * @return False if wrapped to last permutation, true otherwise.
+ *
+ * Treats all permutations of the range [first,last) as a set of
+ * "dictionary" sorted sequences ordered by @a comp. Permutes the current
+ * sequence into the previous one of this set. Returns true if there are
+ * more sequences to generate. If the sequence is the smallest of the set,
+ * the largest is generated and false returned.
+ */
+ template<typename _BidirectionalIterator, typename _Compare>
+ bool
+ prev_permutation(_BidirectionalIterator __first,
+ _BidirectionalIterator __last, _Compare __comp)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_BidirectionalIteratorConcept<
+ _BidirectionalIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ typename iterator_traits<_BidirectionalIterator>::value_type,
+ typename iterator_traits<_BidirectionalIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return false;
+ _BidirectionalIterator __i = __first;
+ ++__i;
+ if (__i == __last)
+ return false;
+ __i = __last;
+ --__i;
+
+ for(;;)
+ {
+ _BidirectionalIterator __ii = __i;
+ --__i;
+ if (__CheckedCompare(__comp)(*__ii, *__i))
+ {
+ _BidirectionalIterator __j = __last;
+ while (!bool(__CheckedCompare(__comp)(*--__j, *__i)))
+ {}
+ std::iter_swap(__i, __j);
+ std::reverse(__ii, __last);
+ return true;
+ }
+ if (__i == __first)
+ {
+ std::reverse(__first, __last);
+ return false;
+ }
+ }
+ }
+
+ // replace
+ // replace_if
+
+ /**
+ * @brief Copy a sequence, replacing each element of one value with another
+ * value.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param result An output iterator.
+ * @param old_value The value to be replaced.
+ * @param new_value The replacement value.
+ * @return The end of the output sequence, @p result+(last-first).
+ *
+ * Copies each element in the input range @p [first,last) to the
+ * output range @p [result,result+(last-first)) replacing elements
+ * equal to @p old_value with @p new_value.
+ */
+ template<typename _InputIterator, typename _OutputIterator, typename _Tp>
+ _OutputIterator
+ replace_copy(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result,
+ const _Tp& __old_value, const _Tp& __new_value)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_function_requires(_EqualOpConcept<
+ typename iterator_traits<_InputIterator>::value_type, _Tp>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ for (; __first != __last; ++__first, ++__result)
+ if (*__first == __old_value)
+ *__result = __new_value;
+ else
+ *__result = *__first;
+ return __result;
+ }
+
+ /**
+ * @brief Copy a sequence, replacing each value for which a predicate
+ * returns true with another value.
+ * @ingroup mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param result An output iterator.
+ * @param pred A predicate.
+ * @param new_value The replacement value.
+ * @return The end of the output sequence, @p result+(last-first).
+ *
+ * Copies each element in the range @p [first,last) to the range
+ * @p [result,result+(last-first)) replacing elements for which
+ * @p pred returns true with @p new_value.
+ */
+ template<typename _InputIterator, typename _OutputIterator,
+ typename _Predicate, typename _Tp>
+ _OutputIterator
+ replace_copy_if(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result,
+ _Predicate __pred, const _Tp& __new_value)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
+ typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ for (; __first != __last; ++__first, ++__result)
+ if (__pred(*__first))
+ *__result = __new_value;
+ else
+ *__result = *__first;
+ return __result;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Determines whether the elements of a sequence are sorted.
+ * @ingroup sorting_algorithms
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @return True if the elements are sorted, false otherwise.
+ */
+ template<typename _ForwardIterator>
+ inline bool
+ is_sorted(_ForwardIterator __first, _ForwardIterator __last)
+ { return std::is_sorted_until(__first, __last) == __last; }
+
+ /**
+ * @brief Determines whether the elements of a sequence are sorted
+ * according to a comparison functor.
+ * @ingroup sorting_algorithms
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @param comp A comparison functor.
+ * @return True if the elements are sorted, false otherwise.
+ */
+ template<typename _ForwardIterator, typename _Compare>
+ inline bool
+ is_sorted(_ForwardIterator __first, _ForwardIterator __last,
+ _Compare __comp)
+ { return std::is_sorted_until(__first, __last, __comp) == __last; }
+
+ /**
+ * @brief Determines the end of a sorted sequence.
+ * @ingroup sorting_algorithms
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @return An iterator pointing to the last iterator i in [first, last)
+ * for which the range [first, i) is sorted.
+ */
+ template<typename _ForwardIterator>
+ _ForwardIterator
+ is_sorted_until(_ForwardIterator __first, _ForwardIterator __last)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return __last;
+
+ _ForwardIterator __next = __first;
+ for (++__next; __next != __last; __first = __next, ++__next)
+ if (*__next < *__first)
+ return __next;
+ return __next;
+ }
+
+ /**
+ * @brief Determines the end of a sorted sequence using comparison functor.
+ * @ingroup sorting_algorithms
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @param comp A comparison functor.
+ * @return An iterator pointing to the last iterator i in [first, last)
+ * for which the range [first, i) is sorted.
+ */
+ template<typename _ForwardIterator, typename _Compare>
+ _ForwardIterator
+ is_sorted_until(_ForwardIterator __first, _ForwardIterator __last,
+ _Compare __comp)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ typename iterator_traits<_ForwardIterator>::value_type,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return __last;
+
+ _ForwardIterator __next = __first;
+ for (++__next; __next != __last; __first = __next, ++__next)
+ if (__CheckedCompare(__comp)(*__next, *__first))
+ return __next;
+ return __next;
+ }
+
+ /**
+ * @brief Determines min and max at once as an ordered pair.
+ * @ingroup sorting_algorithms
+ * @param a A thing of arbitrary type.
+ * @param b Another thing of arbitrary type.
+ * @return A pair(b, a) if b is smaller than a, pair(a, b) otherwise.
+ */
+ template<typename _Tp>
+ inline pair<const _Tp&, const _Tp&>
+ minmax(const _Tp& __a, const _Tp& __b)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_LessThanComparableConcept<_Tp>)
+
+ return __b < __a ? pair<const _Tp&, const _Tp&>(__b, __a)
+ : pair<const _Tp&, const _Tp&>(__a, __b);
+ }
+
+ /**
+ * @brief Determines min and max at once as an ordered pair.
+ * @ingroup sorting_algorithms
+ * @param a A thing of arbitrary type.
+ * @param b Another thing of arbitrary type.
+ * @param comp A @link comparison_functor comparison functor@endlink.
+ * @return A pair(b, a) if b is smaller than a, pair(a, b) otherwise.
+ */
+ template<typename _Tp, typename _Compare>
+ inline pair<const _Tp&, const _Tp&>
+ minmax(const _Tp& __a, const _Tp& __b, _Compare __comp)
+ {
+ return __CheckedCompare(__comp)(__b, __a)
+ ? pair<const _Tp&, const _Tp&>(__b, __a)
+ : pair<const _Tp&, const _Tp&>(__a, __b);
+ }
+
+ /**
+ * @brief Return a pair of iterators pointing to the minimum and maximum
+ * elements in a range.
+ * @ingroup sorting_algorithms
+ * @param first Start of range.
+ * @param last End of range.
+ * @return make_pair(m, M), where m is the first iterator i in
+ * [first, last) such that no other element in the range is
+ * smaller, and where M is the last iterator i in [first, last)
+ * such that no other element in the range is larger.
+ */
+ template<typename _ForwardIterator>
+ pair<_ForwardIterator, _ForwardIterator>
+ minmax_element(_ForwardIterator __first, _ForwardIterator __last)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ _ForwardIterator __next = __first;
+ if (__first == __last
+ || ++__next == __last)
+ return std::make_pair(__first, __first);
+
+ _ForwardIterator __min, __max;
+ if (*__next < *__first)
+ {
+ __min = __next;
+ __max = __first;
+ }
+ else
+ {
+ __min = __first;
+ __max = __next;
+ }
+
+ __first = __next;
+ ++__first;
+
+ while (__first != __last)
+ {
+ __next = __first;
+ if (++__next == __last)
+ {
+ if (*__first < *__min)
+ __min = __first;
+ else if (!(*__first < *__max))
+ __max = __first;
+ break;
+ }
+
+ if (*__next < *__first)
+ {
+ if (*__next < *__min)
+ __min = __next;
+ if (!(*__first < *__max))
+ __max = __first;
+ }
+ else
+ {
+ if (*__first < *__min)
+ __min = __first;
+ if (!(*__next < *__max))
+ __max = __next;
+ }
+
+ __first = __next;
+ ++__first;
+ }
+
+ return std::make_pair(__min, __max);
+ }
+
+ /**
+ * @brief Return a pair of iterators pointing to the minimum and maximum
+ * elements in a range.
+ * @ingroup sorting_algorithms
+ * @param first Start of range.
+ * @param last End of range.
+ * @param comp Comparison functor.
+ * @return make_pair(m, M), where m is the first iterator i in
+ * [first, last) such that no other element in the range is
+ * smaller, and where M is the last iterator i in [first, last)
+ * such that no other element in the range is larger.
+ */
+ template<typename _ForwardIterator, typename _Compare>
+ pair<_ForwardIterator, _ForwardIterator>
+ minmax_element(_ForwardIterator __first, _ForwardIterator __last,
+ _Compare __comp)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ typename iterator_traits<_ForwardIterator>::value_type,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ _ForwardIterator __next = __first;
+ if (__first == __last
+ || ++__next == __last)
+ return std::make_pair(__first, __first);
+
+ _ForwardIterator __min, __max;
+ if (__CheckedCompare(__comp)(*__next, *__first))
+ {
+ __min = __next;
+ __max = __first;
+ }
+ else
+ {
+ __min = __first;
+ __max = __next;
+ }
+
+ __first = __next;
+ ++__first;
+
+ while (__first != __last)
+ {
+ __next = __first;
+ if (++__next == __last)
+ {
+ if (__CheckedCompare(__comp)(*__first, *__min))
+ __min = __first;
+ else if (!__CheckedCompare(__comp)(*__first, *__max))
+ __max = __first;
+ break;
+ }
+
+ if (__CheckedCompare(__comp)(*__next, *__first))
+ {
+ if (__CheckedCompare(__comp)(*__next, *__min))
+ __min = __next;
+ if (!__CheckedCompare(__comp)(*__first, *__max))
+ __max = __first;
+ }
+ else
+ {
+ if (__CheckedCompare(__comp)(*__first, *__min))
+ __min = __first;
+ if (!__CheckedCompare(__comp)(*__next, *__max))
+ __max = __next;
+ }
+
+ __first = __next;
+ ++__first;
+ }
+
+ return std::make_pair(__min, __max);
+ }
+
+ // N2722 + fixes.
+ template<typename _Tp>
+ inline _Tp
+ min(initializer_list<_Tp> __l)
+ { return *std::min_element(__l.begin(), __l.end()); }
+
+ template<typename _Tp, typename _Compare>
+ inline _Tp
+ min(initializer_list<_Tp> __l, _Compare __comp)
+ { return *std::min_element(__l.begin(), __l.end(), __comp); }
+
+ template<typename _Tp>
+ inline _Tp
+ max(initializer_list<_Tp> __l)
+ { return *std::max_element(__l.begin(), __l.end()); }
+
+ template<typename _Tp, typename _Compare>
+ inline _Tp
+ max(initializer_list<_Tp> __l, _Compare __comp)
+ { return *std::max_element(__l.begin(), __l.end(), __comp); }
+
+ template<typename _Tp>
+ inline pair<_Tp, _Tp>
+ minmax(initializer_list<_Tp> __l)
+ {
+ pair<const _Tp*, const _Tp*> __p =
+ std::minmax_element(__l.begin(), __l.end());
+ return std::make_pair(*__p.first, *__p.second);
+ }
+
+ template<typename _Tp, typename _Compare>
+ inline pair<_Tp, _Tp>
+ minmax(initializer_list<_Tp> __l, _Compare __comp)
+ {
+ pair<const _Tp*, const _Tp*> __p =
+ std::minmax_element(__l.begin(), __l.end(), __comp);
+ return std::make_pair(*__p.first, *__p.second);
+ }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+_GLIBCXX_END_NAMESPACE
+
+_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_P)
+
+ /**
+ * @brief Apply a function to every element of a sequence.
+ * @ingroup non_mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param f A unary function object.
+ * @return @p f.
+ *
+ * Applies the function object @p f to each element in the range
+ * @p [first,last). @p f must not modify the order of the sequence.
+ * If @p f has a return value it is ignored.
+ */
+ template<typename _InputIterator, typename _Function>
+ _Function
+ for_each(_InputIterator __first, _InputIterator __last, _Function __f)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
+ for (; __first != __last; ++__first)
+ __f(*__first);
+ return __f;
+ }
+
+ /**
+ * @brief Find the first occurrence of a value in a sequence.
+ * @ingroup non_mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param val The value to find.
+ * @return The first iterator @c i in the range @p [first,last)
+ * such that @c *i == @p val, or @p last if no such iterator exists.
+ */
+ template<typename _InputIterator, typename _Tp>
+ inline _InputIterator
+ find(_InputIterator __first, _InputIterator __last,
+ const _Tp& __val)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_EqualOpConcept<
+ typename iterator_traits<_InputIterator>::value_type, _Tp>)
+ __glibcxx_requires_valid_range(__first, __last);
+ return std::__find(__first, __last, __val,
+ std::__iterator_category(__first));
+ }
+
+ /**
+ * @brief Find the first element in a sequence for which a
+ * predicate is true.
+ * @ingroup non_mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param pred A predicate.
+ * @return The first iterator @c i in the range @p [first,last)
+ * such that @p pred(*i) is true, or @p last if no such iterator exists.
+ */
+ template<typename _InputIterator, typename _Predicate>
+ inline _InputIterator
+ find_if(_InputIterator __first, _InputIterator __last,
+ _Predicate __pred)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
+ typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+ return std::__find_if(__first, __last, __pred,
+ std::__iterator_category(__first));
+ }
+
+ /**
+ * @brief Find element from a set in a sequence.
+ * @ingroup non_mutating_algorithms
+ * @param first1 Start of range to search.
+ * @param last1 End of range to search.
+ * @param first2 Start of match candidates.
+ * @param last2 End of match candidates.
+ * @return The first iterator @c i in the range
+ * @p [first1,last1) such that @c *i == @p *(i2) such that i2 is an
+ * iterator in [first2,last2), or @p last1 if no such iterator exists.
+ *
+ * Searches the range @p [first1,last1) for an element that is equal to
+ * some element in the range [first2,last2). If found, returns an iterator
+ * in the range [first1,last1), otherwise returns @p last1.
+ */
+ template<typename _InputIterator, typename _ForwardIterator>
+ _InputIterator
+ find_first_of(_InputIterator __first1, _InputIterator __last1,
+ _ForwardIterator __first2, _ForwardIterator __last2)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_EqualOpConcept<
+ typename iterator_traits<_InputIterator>::value_type,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+ __glibcxx_requires_valid_range(__first2, __last2);
+
+ for (; __first1 != __last1; ++__first1)
+ for (_ForwardIterator __iter = __first2; __iter != __last2; ++__iter)
+ if (*__first1 == *__iter)
+ return __first1;
+ return __last1;
+ }
+
+ /**
+ * @brief Find element from a set in a sequence using a predicate.
+ * @ingroup non_mutating_algorithms
+ * @param first1 Start of range to search.
+ * @param last1 End of range to search.
+ * @param first2 Start of match candidates.
+ * @param last2 End of match candidates.
+ * @param comp Predicate to use.
+ * @return The first iterator @c i in the range
+ * @p [first1,last1) such that @c comp(*i, @p *(i2)) is true and i2 is an
+ * iterator in [first2,last2), or @p last1 if no such iterator exists.
+ *
+
+ * Searches the range @p [first1,last1) for an element that is
+ * equal to some element in the range [first2,last2). If found,
+ * returns an iterator in the range [first1,last1), otherwise
+ * returns @p last1.
+ */
+ template<typename _InputIterator, typename _ForwardIterator,
+ typename _BinaryPredicate>
+ _InputIterator
+ find_first_of(_InputIterator __first1, _InputIterator __last1,
+ _ForwardIterator __first2, _ForwardIterator __last2,
+ _BinaryPredicate __comp)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
+ typename iterator_traits<_InputIterator>::value_type,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+ __glibcxx_requires_valid_range(__first2, __last2);
+
+ for (; __first1 != __last1; ++__first1)
+ for (_ForwardIterator __iter = __first2; __iter != __last2; ++__iter)
+ if (__comp(*__first1, *__iter))
+ return __first1;
+ return __last1;
+ }
+
+ /**
+ * @brief Find two adjacent values in a sequence that are equal.
+ * @ingroup non_mutating_algorithms
+ * @param first A forward iterator.
+ * @param last A forward iterator.
+ * @return The first iterator @c i such that @c i and @c i+1 are both
+ * valid iterators in @p [first,last) and such that @c *i == @c *(i+1),
+ * or @p last if no such iterator exists.
+ */
+ template<typename _ForwardIterator>
+ _ForwardIterator
+ adjacent_find(_ForwardIterator __first, _ForwardIterator __last)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_EqualityComparableConcept<
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+ if (__first == __last)
+ return __last;
+ _ForwardIterator __next = __first;
+ while(++__next != __last)
+ {
+ if (*__first == *__next)
+ return __first;
+ __first = __next;
+ }
+ return __last;
+ }
+
+ /**
+ * @brief Find two adjacent values in a sequence using a predicate.
+ * @ingroup non_mutating_algorithms
+ * @param first A forward iterator.
+ * @param last A forward iterator.
+ * @param binary_pred A binary predicate.
+ * @return The first iterator @c i such that @c i and @c i+1 are both
+ * valid iterators in @p [first,last) and such that
+ * @p binary_pred(*i,*(i+1)) is true, or @p last if no such iterator
+ * exists.
+ */
+ template<typename _ForwardIterator, typename _BinaryPredicate>
+ _ForwardIterator
+ adjacent_find(_ForwardIterator __first, _ForwardIterator __last,
+ _BinaryPredicate __binary_pred)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
+ typename iterator_traits<_ForwardIterator>::value_type,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+ if (__first == __last)
+ return __last;
+ _ForwardIterator __next = __first;
+ while(++__next != __last)
+ {
+ if (__binary_pred(*__first, *__next))
+ return __first;
+ __first = __next;
+ }
+ return __last;
+ }
+
+ /**
+ * @brief Count the number of copies of a value in a sequence.
+ * @ingroup non_mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param value The value to be counted.
+ * @return The number of iterators @c i in the range @p [first,last)
+ * for which @c *i == @p value
+ */
+ template<typename _InputIterator, typename _Tp>
+ typename iterator_traits<_InputIterator>::difference_type
+ count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_EqualOpConcept<
+ typename iterator_traits<_InputIterator>::value_type, _Tp>)
+ __glibcxx_requires_valid_range(__first, __last);
+ typename iterator_traits<_InputIterator>::difference_type __n = 0;
+ for (; __first != __last; ++__first)
+ if (*__first == __value)
+ ++__n;
+ return __n;
+ }
+
+ /**
+ * @brief Count the elements of a sequence for which a predicate is true.
+ * @ingroup non_mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param pred A predicate.
+ * @return The number of iterators @c i in the range @p [first,last)
+ * for which @p pred(*i) is true.
+ */
+ template<typename _InputIterator, typename _Predicate>
+ typename iterator_traits<_InputIterator>::difference_type
+ count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
+ typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+ typename iterator_traits<_InputIterator>::difference_type __n = 0;
+ for (; __first != __last; ++__first)
+ if (__pred(*__first))
+ ++__n;
+ return __n;
+ }
+
+ /**
+ * @brief Search a sequence for a matching sub-sequence.
+ * @ingroup non_mutating_algorithms
+ * @param first1 A forward iterator.
+ * @param last1 A forward iterator.
+ * @param first2 A forward iterator.
+ * @param last2 A forward iterator.
+ * @return The first iterator @c i in the range
+ * @p [first1,last1-(last2-first2)) such that @c *(i+N) == @p *(first2+N)
+ * for each @c N in the range @p [0,last2-first2), or @p last1 if no
+ * such iterator exists.
+ *
+ * Searches the range @p [first1,last1) for a sub-sequence that compares
+ * equal value-by-value with the sequence given by @p [first2,last2) and
+ * returns an iterator to the first element of the sub-sequence, or
+ * @p last1 if the sub-sequence is not found.
+ *
+ * Because the sub-sequence must lie completely within the range
+ * @p [first1,last1) it must start at a position less than
+ * @p last1-(last2-first2) where @p last2-first2 is the length of the
+ * sub-sequence.
+ * This means that the returned iterator @c i will be in the range
+ * @p [first1,last1-(last2-first2))
+ */
+ template<typename _ForwardIterator1, typename _ForwardIterator2>
+ _ForwardIterator1
+ search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2, _ForwardIterator2 __last2)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator1>)
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator2>)
+ __glibcxx_function_requires(_EqualOpConcept<
+ typename iterator_traits<_ForwardIterator1>::value_type,
+ typename iterator_traits<_ForwardIterator2>::value_type>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+ __glibcxx_requires_valid_range(__first2, __last2);
+
+ // Test for empty ranges
+ if (__first1 == __last1 || __first2 == __last2)
+ return __first1;
+
+ // Test for a pattern of length 1.
+ _ForwardIterator2 __p1(__first2);
+ if (++__p1 == __last2)
+ return _GLIBCXX_STD_P::find(__first1, __last1, *__first2);
+
+ // General case.
+ _ForwardIterator2 __p;
+ _ForwardIterator1 __current = __first1;
+
+ for (;;)
+ {
+ __first1 = _GLIBCXX_STD_P::find(__first1, __last1, *__first2);
+ if (__first1 == __last1)
+ return __last1;
+
+ __p = __p1;
+ __current = __first1;
+ if (++__current == __last1)
+ return __last1;
+
+ while (*__current == *__p)
+ {
+ if (++__p == __last2)
+ return __first1;
+ if (++__current == __last1)
+ return __last1;
+ }
+ ++__first1;
+ }
+ return __first1;
+ }
+
+ /**
+ * @brief Search a sequence for a matching sub-sequence using a predicate.
+ * @ingroup non_mutating_algorithms
+ * @param first1 A forward iterator.
+ * @param last1 A forward iterator.
+ * @param first2 A forward iterator.
+ * @param last2 A forward iterator.
+ * @param predicate A binary predicate.
+ * @return The first iterator @c i in the range
+ * @p [first1,last1-(last2-first2)) such that
+ * @p predicate(*(i+N),*(first2+N)) is true for each @c N in the range
+ * @p [0,last2-first2), or @p last1 if no such iterator exists.
+ *
+ * Searches the range @p [first1,last1) for a sub-sequence that compares
+ * equal value-by-value with the sequence given by @p [first2,last2),
+ * using @p predicate to determine equality, and returns an iterator
+ * to the first element of the sub-sequence, or @p last1 if no such
+ * iterator exists.
+ *
+ * @see search(_ForwardIter1, _ForwardIter1, _ForwardIter2, _ForwardIter2)
+ */
+ template<typename _ForwardIterator1, typename _ForwardIterator2,
+ typename _BinaryPredicate>
+ _ForwardIterator1
+ search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2, _ForwardIterator2 __last2,
+ _BinaryPredicate __predicate)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator1>)
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator2>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
+ typename iterator_traits<_ForwardIterator1>::value_type,
+ typename iterator_traits<_ForwardIterator2>::value_type>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+ __glibcxx_requires_valid_range(__first2, __last2);
+
+ // Test for empty ranges
+ if (__first1 == __last1 || __first2 == __last2)
+ return __first1;
+
+ // Test for a pattern of length 1.
+ _ForwardIterator2 __p1(__first2);
+ if (++__p1 == __last2)
+ {
+ while (__first1 != __last1
+ && !bool(__predicate(*__first1, *__first2)))
+ ++__first1;
+ return __first1;
+ }
+
+ // General case.
+ _ForwardIterator2 __p;
+ _ForwardIterator1 __current = __first1;
+
+ for (;;)
+ {
+ while (__first1 != __last1
+ && !bool(__predicate(*__first1, *__first2)))
+ ++__first1;
+ if (__first1 == __last1)
+ return __last1;
+
+ __p = __p1;
+ __current = __first1;
+ if (++__current == __last1)
+ return __last1;
+
+ while (__predicate(*__current, *__p))
+ {
+ if (++__p == __last2)
+ return __first1;
+ if (++__current == __last1)
+ return __last1;
+ }
+ ++__first1;
+ }
+ return __first1;
+ }
+
+
+ /**
+ * @brief Search a sequence for a number of consecutive values.
+ * @ingroup non_mutating_algorithms
+ * @param first A forward iterator.
+ * @param last A forward iterator.
+ * @param count The number of consecutive values.
+ * @param val The value to find.
+ * @return The first iterator @c i in the range @p [first,last-count)
+ * such that @c *(i+N) == @p val for each @c N in the range @p [0,count),
+ * or @p last if no such iterator exists.
+ *
+ * Searches the range @p [first,last) for @p count consecutive elements
+ * equal to @p val.
+ */
+ template<typename _ForwardIterator, typename _Integer, typename _Tp>
+ _ForwardIterator
+ search_n(_ForwardIterator __first, _ForwardIterator __last,
+ _Integer __count, const _Tp& __val)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_EqualOpConcept<
+ typename iterator_traits<_ForwardIterator>::value_type, _Tp>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__count <= 0)
+ return __first;
+ if (__count == 1)
+ return _GLIBCXX_STD_P::find(__first, __last, __val);
+ return std::__search_n(__first, __last, __count, __val,
+ std::__iterator_category(__first));
+ }
+
+
+ /**
+ * @brief Search a sequence for a number of consecutive values using a
+ * predicate.
+ * @ingroup non_mutating_algorithms
+ * @param first A forward iterator.
+ * @param last A forward iterator.
+ * @param count The number of consecutive values.
+ * @param val The value to find.
+ * @param binary_pred A binary predicate.
+ * @return The first iterator @c i in the range @p [first,last-count)
+ * such that @p binary_pred(*(i+N),val) is true for each @c N in the
+ * range @p [0,count), or @p last if no such iterator exists.
+ *
+ * Searches the range @p [first,last) for @p count consecutive elements
+ * for which the predicate returns true.
+ */
+ template<typename _ForwardIterator, typename _Integer, typename _Tp,
+ typename _BinaryPredicate>
+ _ForwardIterator
+ search_n(_ForwardIterator __first, _ForwardIterator __last,
+ _Integer __count, const _Tp& __val,
+ _BinaryPredicate __binary_pred)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
+ typename iterator_traits<_ForwardIterator>::value_type, _Tp>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__count <= 0)
+ return __first;
+ if (__count == 1)
+ {
+ while (__first != __last && !bool(__binary_pred(*__first, __val)))
+ ++__first;
+ return __first;
+ }
+ return std::__search_n(__first, __last, __count, __val, __binary_pred,
+ std::__iterator_category(__first));
+ }
+
+
+ /**
+ * @brief Perform an operation on a sequence.
+ * @ingroup mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param result An output iterator.
+ * @param unary_op A unary operator.
+ * @return An output iterator equal to @p result+(last-first).
+ *
+ * Applies the operator to each element in the input range and assigns
+ * the results to successive elements of the output sequence.
+ * Evaluates @p *(result+N)=unary_op(*(first+N)) for each @c N in the
+ * range @p [0,last-first).
+ *
+ * @p unary_op must not alter its argument.
+ */
+ template<typename _InputIterator, typename _OutputIterator,
+ typename _UnaryOperation>
+ _OutputIterator
+ transform(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result, _UnaryOperation __unary_op)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ // "the type returned by a _UnaryOperation"
+ __typeof__(__unary_op(*__first))>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ for (; __first != __last; ++__first, ++__result)
+ *__result = __unary_op(*__first);
+ return __result;
+ }
+
+ /**
+ * @brief Perform an operation on corresponding elements of two sequences.
+ * @ingroup mutating_algorithms
+ * @param first1 An input iterator.
+ * @param last1 An input iterator.
+ * @param first2 An input iterator.
+ * @param result An output iterator.
+ * @param binary_op A binary operator.
+ * @return An output iterator equal to @p result+(last-first).
+ *
+ * Applies the operator to the corresponding elements in the two
+ * input ranges and assigns the results to successive elements of the
+ * output sequence.
+ * Evaluates @p *(result+N)=binary_op(*(first1+N),*(first2+N)) for each
+ * @c N in the range @p [0,last1-first1).
+ *
+ * @p binary_op must not alter either of its arguments.
+ */
+ template<typename _InputIterator1, typename _InputIterator2,
+ typename _OutputIterator, typename _BinaryOperation>
+ _OutputIterator
+ transform(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _OutputIterator __result,
+ _BinaryOperation __binary_op)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ // "the type returned by a _BinaryOperation"
+ __typeof__(__binary_op(*__first1,*__first2))>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+
+ for (; __first1 != __last1; ++__first1, ++__first2, ++__result)
+ *__result = __binary_op(*__first1, *__first2);
+ return __result;
+ }
+
+ /**
+ * @brief Replace each occurrence of one value in a sequence with another
+ * value.
+ * @ingroup mutating_algorithms
+ * @param first A forward iterator.
+ * @param last A forward iterator.
+ * @param old_value The value to be replaced.
+ * @param new_value The replacement value.
+ * @return replace() returns no value.
+ *
+ * For each iterator @c i in the range @p [first,last) if @c *i ==
+ * @p old_value then the assignment @c *i = @p new_value is performed.
+ */
+ template<typename _ForwardIterator, typename _Tp>
+ void
+ replace(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __old_value, const _Tp& __new_value)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
+ _ForwardIterator>)
+ __glibcxx_function_requires(_EqualOpConcept<
+ typename iterator_traits<_ForwardIterator>::value_type, _Tp>)
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ for (; __first != __last; ++__first)
+ if (*__first == __old_value)
+ *__first = __new_value;
+ }
+
+ /**
+ * @brief Replace each value in a sequence for which a predicate returns
+ * true with another value.
+ * @ingroup mutating_algorithms
+ * @param first A forward iterator.
+ * @param last A forward iterator.
+ * @param pred A predicate.
+ * @param new_value The replacement value.
+ * @return replace_if() returns no value.
+ *
+ * For each iterator @c i in the range @p [first,last) if @p pred(*i)
+ * is true then the assignment @c *i = @p new_value is performed.
+ */
+ template<typename _ForwardIterator, typename _Predicate, typename _Tp>
+ void
+ replace_if(_ForwardIterator __first, _ForwardIterator __last,
+ _Predicate __pred, const _Tp& __new_value)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
+ _ForwardIterator>)
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ for (; __first != __last; ++__first)
+ if (__pred(*__first))
+ *__first = __new_value;
+ }
+
+ /**
+ * @brief Assign the result of a function object to each value in a
+ * sequence.
+ * @ingroup mutating_algorithms
+ * @param first A forward iterator.
+ * @param last A forward iterator.
+ * @param gen A function object taking no arguments and returning
+ * std::iterator_traits<_ForwardIterator>::value_type
+ * @return generate() returns no value.
+ *
+ * Performs the assignment @c *i = @p gen() for each @c i in the range
+ * @p [first,last).
+ */
+ template<typename _ForwardIterator, typename _Generator>
+ void
+ generate(_ForwardIterator __first, _ForwardIterator __last,
+ _Generator __gen)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_GeneratorConcept<_Generator,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ for (; __first != __last; ++__first)
+ *__first = __gen();
+ }
+
+ /**
+ * @brief Assign the result of a function object to each value in a
+ * sequence.
+ * @ingroup mutating_algorithms
+ * @param first A forward iterator.
+ * @param n The length of the sequence.
+ * @param gen A function object taking no arguments and returning
+ * std::iterator_traits<_ForwardIterator>::value_type
+ * @return The end of the sequence, @p first+n
+ *
+ * Performs the assignment @c *i = @p gen() for each @c i in the range
+ * @p [first,first+n).
+ */
+ template<typename _OutputIterator, typename _Size, typename _Generator>
+ _OutputIterator
+ generate_n(_OutputIterator __first, _Size __n, _Generator __gen)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ // "the type returned by a _Generator"
+ __typeof__(__gen())>)
+
+ for (; __n > 0; --__n, ++__first)
+ *__first = __gen();
+ return __first;
+ }
+
+
+ /**
+ * @brief Copy a sequence, removing consecutive duplicate values.
+ * @ingroup mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param result An output iterator.
+ * @return An iterator designating the end of the resulting sequence.
+ *
+ * Copies each element in the range @p [first,last) to the range
+ * beginning at @p result, except that only the first element is copied
+ * from groups of consecutive elements that compare equal.
+ * unique_copy() is stable, so the relative order of elements that are
+ * copied is unchanged.
+ *
+ * _GLIBCXX_RESOLVE_LIB_DEFECTS
+ * DR 241. Does unique_copy() require CopyConstructible and Assignable?
+ *
+ * _GLIBCXX_RESOLVE_LIB_DEFECTS
+ * DR 538. 241 again: Does unique_copy() require CopyConstructible and
+ * Assignable?
+ */
+ template<typename _InputIterator, typename _OutputIterator>
+ inline _OutputIterator
+ unique_copy(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_function_requires(_EqualityComparableConcept<
+ typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return __result;
+ return std::__unique_copy(__first, __last, __result,
+ std::__iterator_category(__first),
+ std::__iterator_category(__result));
+ }
+
+ /**
+ * @brief Copy a sequence, removing consecutive values using a predicate.
+ * @ingroup mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param result An output iterator.
+ * @param binary_pred A binary predicate.
+ * @return An iterator designating the end of the resulting sequence.
+ *
+ * Copies each element in the range @p [first,last) to the range
+ * beginning at @p result, except that only the first element is copied
+ * from groups of consecutive elements for which @p binary_pred returns
+ * true.
+ * unique_copy() is stable, so the relative order of elements that are
+ * copied is unchanged.
+ *
+ * _GLIBCXX_RESOLVE_LIB_DEFECTS
+ * DR 241. Does unique_copy() require CopyConstructible and Assignable?
+ */
+ template<typename _InputIterator, typename _OutputIterator,
+ typename _BinaryPredicate>
+ inline _OutputIterator
+ unique_copy(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result,
+ _BinaryPredicate __binary_pred)
+ {
+ // concept requirements -- predicates checked later
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return __result;
+ return std::__unique_copy(__first, __last, __result, __binary_pred,
+ std::__iterator_category(__first),
+ std::__iterator_category(__result));
+ }
+
+
+ /**
+ * @brief Randomly shuffle the elements of a sequence.
+ * @ingroup mutating_algorithms
+ * @param first A forward iterator.
+ * @param last A forward iterator.
+ * @return Nothing.
+ *
+ * Reorder the elements in the range @p [first,last) using a random
+ * distribution, so that every possible ordering of the sequence is
+ * equally likely.
+ */
+ template<typename _RandomAccessIterator>
+ inline void
+ random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first != __last)
+ for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)
+ std::iter_swap(__i, __first + (std::rand() % ((__i - __first) + 1)));
+ }
+
+ /**
+ * @brief Shuffle the elements of a sequence using a random number
+ * generator.
+ * @ingroup mutating_algorithms
+ * @param first A forward iterator.
+ * @param last A forward iterator.
+ * @param rand The RNG functor or function.
+ * @return Nothing.
+ *
+ * Reorders the elements in the range @p [first,last) using @p rand to
+ * provide a random distribution. Calling @p rand(N) for a positive
+ * integer @p N should return a randomly chosen integer from the
+ * range [0,N).
+ */
+ template<typename _RandomAccessIterator, typename _RandomNumberGenerator>
+ void
+ random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ _RandomNumberGenerator& __rand)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return;
+ for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)
+ std::iter_swap(__i, __first + __rand((__i - __first) + 1));
+ }
+
+
+ /**
+ * @brief Move elements for which a predicate is true to the beginning
+ * of a sequence.
+ * @ingroup mutating_algorithms
+ * @param first A forward iterator.
+ * @param last A forward iterator.
+ * @param pred A predicate functor.
+ * @return An iterator @p middle such that @p pred(i) is true for each
+ * iterator @p i in the range @p [first,middle) and false for each @p i
+ * in the range @p [middle,last).
+ *
+ * @p pred must not modify its operand. @p partition() does not preserve
+ * the relative ordering of elements in each group, use
+ * @p stable_partition() if this is needed.
+ */
+ template<typename _ForwardIterator, typename _Predicate>
+ inline _ForwardIterator
+ partition(_ForwardIterator __first, _ForwardIterator __last,
+ _Predicate __pred)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
+ _ForwardIterator>)
+ __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ return std::__partition(__first, __last, __pred,
+ std::__iterator_category(__first));
+ }
+
+
+
+ /**
+ * @brief Sort the smallest elements of a sequence.
+ * @ingroup sorting_algorithms
+ * @param first An iterator.
+ * @param middle Another iterator.
+ * @param last Another iterator.
+ * @return Nothing.
+ *
+ * Sorts the smallest @p (middle-first) elements in the range
+ * @p [first,last) and moves them to the range @p [first,middle). The
+ * order of the remaining elements in the range @p [middle,last) is
+ * undefined.
+ * After the sort if @p i and @j are iterators in the range
+ * @p [first,middle) such that @i precedes @j and @k is an iterator in
+ * the range @p [middle,last) then @p *j<*i and @p *k<*i are both false.
+ */
+ template<typename _RandomAccessIterator>
+ inline void
+ partial_sort(_RandomAccessIterator __first,
+ _RandomAccessIterator __middle,
+ _RandomAccessIterator __last)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_function_requires(_LessThanComparableConcept<_ValueType>)
+ __glibcxx_requires_valid_range(__first, __middle);
+ __glibcxx_requires_valid_range(__middle, __last);
+
+ std::__heap_select(__first, __middle, __last);
+ std::sort_heap(__first, __middle);
+ }
+
+ /**
+ * @brief Sort the smallest elements of a sequence using a predicate
+ * for comparison.
+ * @ingroup sorting_algorithms
+ * @param first An iterator.
+ * @param middle Another iterator.
+ * @param last Another iterator.
+ * @param comp A comparison functor.
+ * @return Nothing.
+ *
+ * Sorts the smallest @p (middle-first) elements in the range
+ * @p [first,last) and moves them to the range @p [first,middle). The
+ * order of the remaining elements in the range @p [middle,last) is
+ * undefined.
+ * After the sort if @p i and @j are iterators in the range
+ * @p [first,middle) such that @i precedes @j and @k is an iterator in
+ * the range @p [middle,last) then @p *comp(j,*i) and @p comp(*k,*i)
+ * are both false.
+ */
+ template<typename _RandomAccessIterator, typename _Compare>
+ inline void
+ partial_sort(_RandomAccessIterator __first,
+ _RandomAccessIterator __middle,
+ _RandomAccessIterator __last,
+ _Compare __comp)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _ValueType, _ValueType>)
+ __glibcxx_requires_valid_range(__first, __middle);
+ __glibcxx_requires_valid_range(__middle, __last);
+
+ std::__heap_select(__first, __middle, __last, __CheckedCompare(__comp));
+ std::sort_heap(__first, __middle, __CheckedCompare(__comp));
+ }
+
+ /**
+ * @brief Sort a sequence just enough to find a particular position.
+ * @ingroup sorting_algorithms
+ * @param first An iterator.
+ * @param nth Another iterator.
+ * @param last Another iterator.
+ * @return Nothing.
+ *
+ * Rearranges the elements in the range @p [first,last) so that @p *nth
+ * is the same element that would have been in that position had the
+ * whole sequence been sorted.
+ * whole sequence been sorted. The elements either side of @p *nth are
+ * not completely sorted, but for any iterator @i in the range
+ * @p [first,nth) and any iterator @j in the range @p [nth,last) it
+ * holds that @p *j<*i is false.
+ */
+ template<typename _RandomAccessIterator>
+ inline void
+ nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth,
+ _RandomAccessIterator __last)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_function_requires(_LessThanComparableConcept<_ValueType>)
+ __glibcxx_requires_valid_range(__first, __nth);
+ __glibcxx_requires_valid_range(__nth, __last);
+
+ if (__first == __last || __nth == __last)
+ return;
+
+ std::__introselect(__first, __nth, __last,
+ std::__lg(__last - __first) * 2);
+ }
+
+ /**
+ * @brief Sort a sequence just enough to find a particular position
+ * using a predicate for comparison.
+ * @ingroup sorting_algorithms
+ * @param first An iterator.
+ * @param nth Another iterator.
+ * @param last Another iterator.
+ * @param comp A comparison functor.
+ * @return Nothing.
+ *
+ * Rearranges the elements in the range @p [first,last) so that @p *nth
+ * is the same element that would have been in that position had the
+ * whole sequence been sorted. The elements either side of @p *nth are
+ * not completely sorted, but for any iterator @i in the range
+ * @p [first,nth) and any iterator @j in the range @p [nth,last) it
+ * holds that @p comp(*j,*i) is false.
+ */
+ template<typename _RandomAccessIterator, typename _Compare>
+ inline void
+ nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth,
+ _RandomAccessIterator __last, _Compare __comp)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _ValueType, _ValueType>)
+ __glibcxx_requires_valid_range(__first, __nth);
+ __glibcxx_requires_valid_range(__nth, __last);
+
+ if (__first == __last || __nth == __last)
+ return;
+
+ std::__introselect(__first, __nth, __last,
+ std::__lg(__last - __first) * 2,
+ __CheckedCompare(__comp));
+ }
+
+
+ /**
+ * @brief Sort the elements of a sequence.
+ * @ingroup sorting_algorithms
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @return Nothing.
+ *
+ * Sorts the elements in the range @p [first,last) in ascending order,
+ * such that @p *(i+1)<*i is false for each iterator @p i in the range
+ * @p [first,last-1).
+ *
+ * The relative ordering of equivalent elements is not preserved, use
+ * @p stable_sort() if this is needed.
+ */
+ template<typename _RandomAccessIterator>
+ inline void
+ sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_function_requires(_LessThanComparableConcept<_ValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first != __last)
+ {
+ std::__introsort_loop(__first, __last,
+ std::__lg(__last - __first) * 2);
+ std::__final_insertion_sort(__first, __last);
+ }
+ }
+
+ /**
+ * @brief Sort the elements of a sequence using a predicate for comparison.
+ * @ingroup sorting_algorithms
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @param comp A comparison functor.
+ * @return Nothing.
+ *
+ * Sorts the elements in the range @p [first,last) in ascending order,
+ * such that @p comp(*(i+1),*i) is false for every iterator @p i in the
+ * range @p [first,last-1).
+ *
+ * The relative ordering of equivalent elements is not preserved, use
+ * @p stable_sort() if this is needed.
+ */
+ template<typename _RandomAccessIterator, typename _Compare>
+ inline void
+ sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ _Compare __comp)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, _ValueType,
+ _ValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first != __last)
+ {
+ std::__introsort_loop(__first, __last,
+ std::__lg(__last - __first) * 2,
+ __CheckedCompare(__comp));
+ std::__final_insertion_sort(__first, __last,
+ __CheckedCompare(__comp));
+ }
+ }
+
+ /**
+ * @brief Merges two sorted ranges.
+ * @ingroup sorting_algorithms
+ * @param first1 An iterator.
+ * @param first2 Another iterator.
+ * @param last1 Another iterator.
+ * @param last2 Another iterator.
+ * @param result An iterator pointing to the end of the merged range.
+ * @return An iterator pointing to the first element "not less
+ * than" @a val.
+ *
+ * Merges the ranges [first1,last1) and [first2,last2) into the sorted range
+ * [result, result + (last1-first1) + (last2-first2)). Both input ranges
+ * must be sorted, and the output range must not overlap with either of
+ * the input ranges. The sort is @e stable, that is, for equivalent
+ * elements in the two ranges, elements from the first range will always
+ * come before elements from the second.
+ */
+ template<typename _InputIterator1, typename _InputIterator2,
+ typename _OutputIterator>
+ _OutputIterator
+ merge(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2,
+ _OutputIterator __result)
+ {
+ typedef typename iterator_traits<_InputIterator1>::value_type
+ _ValueType1;
+ typedef typename iterator_traits<_InputIterator2>::value_type
+ _ValueType2;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType1>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType2>)
+ __glibcxx_function_requires(_LessThanOpConcept<_ValueType2, _ValueType1>)
+ __glibcxx_requires_sorted_set(__first1, __last1, __first2);
+ __glibcxx_requires_sorted_set(__first2, __last2, __first1);
+
+ while (__first1 != __last1 && __first2 != __last2)
+ {
+ if (*__first2 < *__first1)
+ {
+ *__result = *__first2;
+ ++__first2;
+ }
+ else
+ {
+ *__result = *__first1;
+ ++__first1;
+ }
+ ++__result;
+ }
+ return std::copy(__first2, __last2, std::copy(__first1, __last1,
+ __result));
+ }
+
+ /**
+ * @brief Merges two sorted ranges.
+ * @ingroup sorting_algorithms
+ * @param first1 An iterator.
+ * @param first2 Another iterator.
+ * @param last1 Another iterator.
+ * @param last2 Another iterator.
+ * @param result An iterator pointing to the end of the merged range.
+ * @param comp A functor to use for comparisons.
+ * @return An iterator pointing to the first element "not less
+ * than" @a val.
+ *
+ * Merges the ranges [first1,last1) and [first2,last2) into the sorted range
+ * [result, result + (last1-first1) + (last2-first2)). Both input ranges
+ * must be sorted, and the output range must not overlap with either of
+ * the input ranges. The sort is @e stable, that is, for equivalent
+ * elements in the two ranges, elements from the first range will always
+ * come before elements from the second.
+ *
+ * The comparison function should have the same effects on ordering as
+ * the function used for the initial sort.
+ */
+ template<typename _InputIterator1, typename _InputIterator2,
+ typename _OutputIterator, typename _Compare>
+ _OutputIterator
+ merge(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2,
+ _OutputIterator __result, _Compare __comp)
+ {
+ typedef typename iterator_traits<_InputIterator1>::value_type
+ _ValueType1;
+ typedef typename iterator_traits<_InputIterator2>::value_type
+ _ValueType2;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType1>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType2>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _ValueType2, _ValueType1>)
+ __glibcxx_requires_sorted_set_pred(__first1, __last1, __first2, __comp);
+ __glibcxx_requires_sorted_set_pred(__first2, __last2, __first1, __comp);
+
+ while (__first1 != __last1 && __first2 != __last2)
+ {
+ if (__CheckedCompare(__comp)(*__first2, *__first1))
+ {
+ *__result = *__first2;
+ ++__first2;
+ }
+ else
+ {
+ *__result = *__first1;
+ ++__first1;
+ }
+ ++__result;
+ }
+ return std::copy(__first2, __last2, std::copy(__first1, __last1,
+ __result));
+ }
+
+
+ /**
+ * @brief Sort the elements of a sequence, preserving the relative order
+ * of equivalent elements.
+ * @ingroup sorting_algorithms
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @return Nothing.
+ *
+ * Sorts the elements in the range @p [first,last) in ascending order,
+ * such that @p *(i+1)<*i is false for each iterator @p i in the range
+ * @p [first,last-1).
+ *
+ * The relative ordering of equivalent elements is preserved, so any two
+ * elements @p x and @p y in the range @p [first,last) such that
+ * @p x<y is false and @p y<x is false will have the same relative
+ * ordering after calling @p stable_sort().
+ */
+ template<typename _RandomAccessIterator>
+ inline void
+ stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type
+ _DistanceType;
+
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_function_requires(_LessThanComparableConcept<_ValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ _Temporary_buffer<_RandomAccessIterator, _ValueType> __buf(__first,
+ __last);
+ if (__buf.begin() == 0)
+ std::__inplace_stable_sort(__first, __last);
+ else
+ std::__stable_sort_adaptive(__first, __last, __buf.begin(),
+ _DistanceType(__buf.size()));
+ }
+
+ /**
+ * @brief Sort the elements of a sequence using a predicate for comparison,
+ * preserving the relative order of equivalent elements.
+ * @ingroup sorting_algorithms
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @param comp A comparison functor.
+ * @return Nothing.
+ *
+ * Sorts the elements in the range @p [first,last) in ascending order,
+ * such that @p comp(*(i+1),*i) is false for each iterator @p i in the
+ * range @p [first,last-1).
+ *
+ * The relative ordering of equivalent elements is preserved, so any two
+ * elements @p x and @p y in the range @p [first,last) such that
+ * @p comp(x,y) is false and @p comp(y,x) is false will have the same
+ * relative ordering after calling @p stable_sort().
+ */
+ template<typename _RandomAccessIterator, typename _Compare>
+ inline void
+ stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ _Compare __comp)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type
+ _DistanceType;
+
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _ValueType,
+ _ValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ _Temporary_buffer<_RandomAccessIterator, _ValueType> __buf(__first,
+ __last);
+ if (__buf.begin() == 0)
+ std::__inplace_stable_sort(__first, __last, __CheckedCompare(__comp));
+ else
+ std::__stable_sort_adaptive(__first, __last, __buf.begin(),
+ _DistanceType(__buf.size()),
+ __CheckedCompare(__comp));
+ }
+
+
+ /**
+ * @brief Return the union of two sorted ranges.
+ * @ingroup set_algorithms
+ * @param first1 Start of first range.
+ * @param last1 End of first range.
+ * @param first2 Start of second range.
+ * @param last2 End of second range.
+ * @return End of the output range.
+ * @ingroup set_algorithms
+ *
+ * This operation iterates over both ranges, copying elements present in
+ * each range in order to the output range. Iterators increment for each
+ * range. When the current element of one range is less than the other,
+ * that element is copied and the iterator advanced. If an element is
+ * contained in both ranges, the element from the first range is copied and
+ * both ranges advance. The output range may not overlap either input
+ * range.
+ */
+ template<typename _InputIterator1, typename _InputIterator2,
+ typename _OutputIterator>
+ _OutputIterator
+ set_union(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2,
+ _OutputIterator __result)
+ {
+ typedef typename iterator_traits<_InputIterator1>::value_type
+ _ValueType1;
+ typedef typename iterator_traits<_InputIterator2>::value_type
+ _ValueType2;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType1>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType2>)
+ __glibcxx_function_requires(_LessThanOpConcept<_ValueType1, _ValueType2>)
+ __glibcxx_function_requires(_LessThanOpConcept<_ValueType2, _ValueType1>)
+ __glibcxx_requires_sorted_set(__first1, __last1, __first2);
+ __glibcxx_requires_sorted_set(__first2, __last2, __first1);
+
+ while (__first1 != __last1 && __first2 != __last2)
+ {
+ if (*__first1 < *__first2)
+ {
+ *__result = *__first1;
+ ++__first1;
+ }
+ else if (*__first2 < *__first1)
+ {
+ *__result = *__first2;
+ ++__first2;
+ }
+ else
+ {
+ *__result = *__first1;
+ ++__first1;
+ ++__first2;
+ }
+ ++__result;
+ }
+ return std::copy(__first2, __last2, std::copy(__first1, __last1,
+ __result));
+ }
+
+ /**
+ * @brief Return the union of two sorted ranges using a comparison functor.
+ * @ingroup set_algorithms
+ * @param first1 Start of first range.
+ * @param last1 End of first range.
+ * @param first2 Start of second range.
+ * @param last2 End of second range.
+ * @param comp The comparison functor.
+ * @return End of the output range.
+ * @ingroup set_algorithms
+ *
+ * This operation iterates over both ranges, copying elements present in
+ * each range in order to the output range. Iterators increment for each
+ * range. When the current element of one range is less than the other
+ * according to @a comp, that element is copied and the iterator advanced.
+ * If an equivalent element according to @a comp is contained in both
+ * ranges, the element from the first range is copied and both ranges
+ * advance. The output range may not overlap either input range.
+ */
+ template<typename _InputIterator1, typename _InputIterator2,
+ typename _OutputIterator, typename _Compare>
+ _OutputIterator
+ set_union(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2,
+ _OutputIterator __result, _Compare __comp)
+ {
+ typedef typename iterator_traits<_InputIterator1>::value_type
+ _ValueType1;
+ typedef typename iterator_traits<_InputIterator2>::value_type
+ _ValueType2;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType1>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType2>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _ValueType1, _ValueType2>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _ValueType2, _ValueType1>)
+ __glibcxx_requires_sorted_set_pred(__first1, __last1, __first2, __comp);
+ __glibcxx_requires_sorted_set_pred(__first2, __last2, __first1, __comp);
+
+ while (__first1 != __last1 && __first2 != __last2)
+ {
+ if (__CheckedCompare(__comp)(*__first1, *__first2))
+ {
+ *__result = *__first1;
+ ++__first1;
+ }
+ else if (__CheckedCompare(__comp)(*__first2, *__first1))
+ {
+ *__result = *__first2;
+ ++__first2;
+ }
+ else
+ {
+ *__result = *__first1;
+ ++__first1;
+ ++__first2;
+ }
+ ++__result;
+ }
+ return std::copy(__first2, __last2, std::copy(__first1, __last1,
+ __result));
+ }
+
+ /**
+ * @brief Return the intersection of two sorted ranges.
+ * @ingroup set_algorithms
+ * @param first1 Start of first range.
+ * @param last1 End of first range.
+ * @param first2 Start of second range.
+ * @param last2 End of second range.
+ * @return End of the output range.
+ * @ingroup set_algorithms
+ *
+ * This operation iterates over both ranges, copying elements present in
+ * both ranges in order to the output range. Iterators increment for each
+ * range. When the current element of one range is less than the other,
+ * that iterator advances. If an element is contained in both ranges, the
+ * element from the first range is copied and both ranges advance. The
+ * output range may not overlap either input range.
+ */
+ template<typename _InputIterator1, typename _InputIterator2,
+ typename _OutputIterator>
+ _OutputIterator
+ set_intersection(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2,
+ _OutputIterator __result)
+ {
+ typedef typename iterator_traits<_InputIterator1>::value_type
+ _ValueType1;
+ typedef typename iterator_traits<_InputIterator2>::value_type
+ _ValueType2;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType1>)
+ __glibcxx_function_requires(_LessThanOpConcept<_ValueType1, _ValueType2>)
+ __glibcxx_function_requires(_LessThanOpConcept<_ValueType2, _ValueType1>)
+ __glibcxx_requires_sorted_set(__first1, __last1, __first2);
+ __glibcxx_requires_sorted_set(__first2, __last2, __first1);
+
+ while (__first1 != __last1 && __first2 != __last2)
+ if (*__first1 < *__first2)
+ ++__first1;
+ else if (*__first2 < *__first1)
+ ++__first2;
+ else
+ {
+ *__result = *__first1;
+ ++__first1;
+ ++__first2;
+ ++__result;
+ }
+ return __result;
+ }
+
+ /**
+ * @brief Return the intersection of two sorted ranges using comparison
+ * functor.
+ * @ingroup set_algorithms
+ * @param first1 Start of first range.
+ * @param last1 End of first range.
+ * @param first2 Start of second range.
+ * @param last2 End of second range.
+ * @param comp The comparison functor.
+ * @return End of the output range.
+ * @ingroup set_algorithms
+ *
+ * This operation iterates over both ranges, copying elements present in
+ * both ranges in order to the output range. Iterators increment for each
+ * range. When the current element of one range is less than the other
+ * according to @a comp, that iterator advances. If an element is
+ * contained in both ranges according to @a comp, the element from the
+ * first range is copied and both ranges advance. The output range may not
+ * overlap either input range.
+ */
+ template<typename _InputIterator1, typename _InputIterator2,
+ typename _OutputIterator, typename _Compare>
+ _OutputIterator
+ set_intersection(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2,
+ _OutputIterator __result, _Compare __comp)
+ {
+ typedef typename iterator_traits<_InputIterator1>::value_type
+ _ValueType1;
+ typedef typename iterator_traits<_InputIterator2>::value_type
+ _ValueType2;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType1>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _ValueType1, _ValueType2>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _ValueType2, _ValueType1>)
+ __glibcxx_requires_sorted_set_pred(__first1, __last1, __first2, __comp);
+ __glibcxx_requires_sorted_set_pred(__first2, __last2, __first1, __comp);
+
+ while (__first1 != __last1 && __first2 != __last2)
+ if (__CheckedCompare(__comp)(*__first1, *__first2))
+ ++__first1;
+ else if (__CheckedCompare(__comp)(*__first2, *__first1))
+ ++__first2;
+ else
+ {
+ *__result = *__first1;
+ ++__first1;
+ ++__first2;
+ ++__result;
+ }
+ return __result;
+ }
+
+ /**
+ * @brief Return the difference of two sorted ranges.
+ * @ingroup set_algorithms
+ * @param first1 Start of first range.
+ * @param last1 End of first range.
+ * @param first2 Start of second range.
+ * @param last2 End of second range.
+ * @return End of the output range.
+ * @ingroup set_algorithms
+ *
+ * This operation iterates over both ranges, copying elements present in
+ * the first range but not the second in order to the output range.
+ * Iterators increment for each range. When the current element of the
+ * first range is less than the second, that element is copied and the
+ * iterator advances. If the current element of the second range is less,
+ * the iterator advances, but no element is copied. If an element is
+ * contained in both ranges, no elements are copied and both ranges
+ * advance. The output range may not overlap either input range.
+ */
+ template<typename _InputIterator1, typename _InputIterator2,
+ typename _OutputIterator>
+ _OutputIterator
+ set_difference(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2,
+ _OutputIterator __result)
+ {
+ typedef typename iterator_traits<_InputIterator1>::value_type
+ _ValueType1;
+ typedef typename iterator_traits<_InputIterator2>::value_type
+ _ValueType2;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType1>)
+ __glibcxx_function_requires(_LessThanOpConcept<_ValueType1, _ValueType2>)
+ __glibcxx_function_requires(_LessThanOpConcept<_ValueType2, _ValueType1>)
+ __glibcxx_requires_sorted_set(__first1, __last1, __first2);
+ __glibcxx_requires_sorted_set(__first2, __last2, __first1);
+
+ while (__first1 != __last1 && __first2 != __last2)
+ if (*__first1 < *__first2)
+ {
+ *__result = *__first1;
+ ++__first1;
+ ++__result;
+ }
+ else if (*__first2 < *__first1)
+ ++__first2;
+ else
+ {
+ ++__first1;
+ ++__first2;
+ }
+ return std::copy(__first1, __last1, __result);
+ }
+
+ /**
+ * @brief Return the difference of two sorted ranges using comparison
+ * functor.
+ * @ingroup set_algorithms
+ * @param first1 Start of first range.
+ * @param last1 End of first range.
+ * @param first2 Start of second range.
+ * @param last2 End of second range.
+ * @param comp The comparison functor.
+ * @return End of the output range.
+ * @ingroup set_algorithms
+ *
+ * This operation iterates over both ranges, copying elements present in
+ * the first range but not the second in order to the output range.
+ * Iterators increment for each range. When the current element of the
+ * first range is less than the second according to @a comp, that element
+ * is copied and the iterator advances. If the current element of the
+ * second range is less, no element is copied and the iterator advances.
+ * If an element is contained in both ranges according to @a comp, no
+ * elements are copied and both ranges advance. The output range may not
+ * overlap either input range.
+ */
+ template<typename _InputIterator1, typename _InputIterator2,
+ typename _OutputIterator, typename _Compare>
+ _OutputIterator
+ set_difference(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2,
+ _OutputIterator __result, _Compare __comp)
+ {
+ typedef typename iterator_traits<_InputIterator1>::value_type
+ _ValueType1;
+ typedef typename iterator_traits<_InputIterator2>::value_type
+ _ValueType2;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType1>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _ValueType1, _ValueType2>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _ValueType2, _ValueType1>)
+ __glibcxx_requires_sorted_set_pred(__first1, __last1, __first2, __comp);
+ __glibcxx_requires_sorted_set_pred(__first2, __last2, __first1, __comp);
+
+ while (__first1 != __last1 && __first2 != __last2)
+ if (__CheckedCompare(__comp)(*__first1, *__first2))
+ {
+ *__result = *__first1;
+ ++__first1;
+ ++__result;
+ }
+ else if (__CheckedCompare(__comp)(*__first2, *__first1))
+ ++__first2;
+ else
+ {
+ ++__first1;
+ ++__first2;
+ }
+ return std::copy(__first1, __last1, __result);
+ }
+
+ /**
+ * @brief Return the symmetric difference of two sorted ranges.
+ * @ingroup set_algorithms
+ * @param first1 Start of first range.
+ * @param last1 End of first range.
+ * @param first2 Start of second range.
+ * @param last2 End of second range.
+ * @return End of the output range.
+ * @ingroup set_algorithms
+ *
+ * This operation iterates over both ranges, copying elements present in
+ * one range but not the other in order to the output range. Iterators
+ * increment for each range. When the current element of one range is less
+ * than the other, that element is copied and the iterator advances. If an
+ * element is contained in both ranges, no elements are copied and both
+ * ranges advance. The output range may not overlap either input range.
+ */
+ template<typename _InputIterator1, typename _InputIterator2,
+ typename _OutputIterator>
+ _OutputIterator
+ set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2,
+ _OutputIterator __result)
+ {
+ typedef typename iterator_traits<_InputIterator1>::value_type
+ _ValueType1;
+ typedef typename iterator_traits<_InputIterator2>::value_type
+ _ValueType2;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType1>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType2>)
+ __glibcxx_function_requires(_LessThanOpConcept<_ValueType1, _ValueType2>)
+ __glibcxx_function_requires(_LessThanOpConcept<_ValueType2, _ValueType1>)
+ __glibcxx_requires_sorted_set(__first1, __last1, __first2);
+ __glibcxx_requires_sorted_set(__first2, __last2, __first1);
+
+ while (__first1 != __last1 && __first2 != __last2)
+ if (*__first1 < *__first2)
+ {
+ *__result = *__first1;
+ ++__first1;
+ ++__result;
+ }
+ else if (*__first2 < *__first1)
+ {
+ *__result = *__first2;
+ ++__first2;
+ ++__result;
+ }
+ else
+ {
+ ++__first1;
+ ++__first2;
+ }
+ return std::copy(__first2, __last2, std::copy(__first1,
+ __last1, __result));
+ }
+
+ /**
+ * @brief Return the symmetric difference of two sorted ranges using
+ * comparison functor.
+ * @ingroup set_algorithms
+ * @param first1 Start of first range.
+ * @param last1 End of first range.
+ * @param first2 Start of second range.
+ * @param last2 End of second range.
+ * @param comp The comparison functor.
+ * @return End of the output range.
+ * @ingroup set_algorithms
+ *
+ * This operation iterates over both ranges, copying elements present in
+ * one range but not the other in order to the output range. Iterators
+ * increment for each range. When the current element of one range is less
+ * than the other according to @a comp, that element is copied and the
+ * iterator advances. If an element is contained in both ranges according
+ * to @a comp, no elements are copied and both ranges advance. The output
+ * range may not overlap either input range.
+ */
+ template<typename _InputIterator1, typename _InputIterator2,
+ typename _OutputIterator, typename _Compare>
+ _OutputIterator
+ set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2,
+ _OutputIterator __result,
+ _Compare __comp)
+ {
+ typedef typename iterator_traits<_InputIterator1>::value_type
+ _ValueType1;
+ typedef typename iterator_traits<_InputIterator2>::value_type
+ _ValueType2;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType1>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType2>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _ValueType1, _ValueType2>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _ValueType2, _ValueType1>)
+ __glibcxx_requires_sorted_set_pred(__first1, __last1, __first2, __comp);
+ __glibcxx_requires_sorted_set_pred(__first2, __last2, __first1, __comp);
+
+ while (__first1 != __last1 && __first2 != __last2)
+ if (__CheckedCompare(__comp)(*__first1, *__first2))
+ {
+ *__result = *__first1;
+ ++__first1;
+ ++__result;
+ }
+ else if (__CheckedCompare(__comp)(*__first2, *__first1))
+ {
+ *__result = *__first2;
+ ++__first2;
+ ++__result;
+ }
+ else
+ {
+ ++__first1;
+ ++__first2;
+ }
+ return std::copy(__first2, __last2,
+ std::copy(__first1, __last1, __result));
+ }
+
+
+ /**
+ * @brief Return the minimum element in a range.
+ * @ingroup sorting_algorithms
+ * @param first Start of range.
+ * @param last End of range.
+ * @return Iterator referencing the first instance of the smallest value.
+ */
+ template<typename _ForwardIterator>
+ _ForwardIterator
+ min_element(_ForwardIterator __first, _ForwardIterator __last)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return __first;
+ _ForwardIterator __result = __first;
+ while (++__first != __last)
+ if (*__first < *__result)
+ __result = __first;
+ return __result;
+ }
+
+ /**
+ * @brief Return the minimum element in a range using comparison functor.
+ * @ingroup sorting_algorithms
+ * @param first Start of range.
+ * @param last End of range.
+ * @param comp Comparison functor.
+ * @return Iterator referencing the first instance of the smallest value
+ * according to comp.
+ */
+ template<typename _ForwardIterator, typename _Compare>
+ _ForwardIterator
+ min_element(_ForwardIterator __first, _ForwardIterator __last,
+ _Compare __comp)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ typename iterator_traits<_ForwardIterator>::value_type,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return __first;
+ _ForwardIterator __result = __first;
+ while (++__first != __last)
+ if (__CheckedCompare(__comp)(*__first, *__result))
+ __result = __first;
+ return __result;
+ }
+
+ /**
+ * @brief Return the maximum element in a range.
+ * @ingroup sorting_algorithms
+ * @param first Start of range.
+ * @param last End of range.
+ * @return Iterator referencing the first instance of the largest value.
+ */
+ template<typename _ForwardIterator>
+ _ForwardIterator
+ max_element(_ForwardIterator __first, _ForwardIterator __last)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return __first;
+ _ForwardIterator __result = __first;
+ while (++__first != __last)
+ if (*__result < *__first)
+ __result = __first;
+ return __result;
+ }
+
+ /**
+ * @brief Return the maximum element in a range using comparison functor.
+ * @ingroup sorting_algorithms
+ * @param first Start of range.
+ * @param last End of range.
+ * @param comp Comparison functor.
+ * @return Iterator referencing the first instance of the largest value
+ * according to comp.
+ */
+ template<typename _ForwardIterator, typename _Compare>
+ _ForwardIterator
+ max_element(_ForwardIterator __first, _ForwardIterator __last,
+ _Compare __comp)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ typename iterator_traits<_ForwardIterator>::value_type,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last) return __first;
+ _ForwardIterator __result = __first;
+ while (++__first != __last)
+ if (__CheckedCompare(__comp)(*__result, *__first))
+ __result = __first;
+ return __result;
+ }
+
+#undef __CheckedCompare
+
+_GLIBCXX_END_NESTED_NAMESPACE
+
+#endif /* _STL_ALGO_H */
diff --git a/i686-linux/include/c++/4.4.3/bits/stl_algobase.h b/i686-linux/include/c++/4.4.3/bits/stl_algobase.h
new file mode 100644
index 0000000..2cef923
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/stl_algobase.h
@@ -0,0 +1,1153 @@
+// Core algorithmic facilities -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996-1998
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_algobase.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_ALGOBASE_H
+#define _STL_ALGOBASE_H 1
+
+#include <bits/c++config.h>
+#include <cstddef>
+#include <bits/functexcept.h>
+#include <bits/cpp_type_traits.h>
+#include <ext/type_traits.h>
+#include <ext/numeric_traits.h>
+#include <bits/stl_pair.h>
+#include <bits/stl_iterator_base_types.h>
+#include <bits/stl_iterator_base_funcs.h>
+#include <bits/stl_iterator.h>
+#include <bits/concept_check.h>
+#include <debug/debug.h>
+#include <bits/move.h> // For std::swap and _GLIBCXX_MOVE
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // See http://gcc.gnu.org/ml/libstdc++/2004-08/msg00167.html: in a
+ // nutshell, we are partially implementing the resolution of DR 187,
+ // when it's safe, i.e., the value_types are equal.
+ template<bool _BoolType>
+ struct __iter_swap
+ {
+ template<typename _ForwardIterator1, typename _ForwardIterator2>
+ static void
+ iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
+ {
+ typedef typename iterator_traits<_ForwardIterator1>::value_type
+ _ValueType1;
+ _ValueType1 __tmp = _GLIBCXX_MOVE(*__a);
+ *__a = _GLIBCXX_MOVE(*__b);
+ *__b = _GLIBCXX_MOVE(__tmp);
+ }
+ };
+
+ template<>
+ struct __iter_swap<true>
+ {
+ template<typename _ForwardIterator1, typename _ForwardIterator2>
+ static void
+ iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
+ {
+ swap(*__a, *__b);
+ }
+ };
+
+ /**
+ * @brief Swaps the contents of two iterators.
+ * @ingroup mutating_algorithms
+ * @param a An iterator.
+ * @param b Another iterator.
+ * @return Nothing.
+ *
+ * This function swaps the values pointed to by two iterators, not the
+ * iterators themselves.
+ */
+ template<typename _ForwardIterator1, typename _ForwardIterator2>
+ inline void
+ iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
+ {
+ typedef typename iterator_traits<_ForwardIterator1>::value_type
+ _ValueType1;
+ typedef typename iterator_traits<_ForwardIterator2>::value_type
+ _ValueType2;
+
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
+ _ForwardIterator1>)
+ __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
+ _ForwardIterator2>)
+ __glibcxx_function_requires(_ConvertibleConcept<_ValueType1,
+ _ValueType2>)
+ __glibcxx_function_requires(_ConvertibleConcept<_ValueType2,
+ _ValueType1>)
+
+ typedef typename iterator_traits<_ForwardIterator1>::reference
+ _ReferenceType1;
+ typedef typename iterator_traits<_ForwardIterator2>::reference
+ _ReferenceType2;
+ std::__iter_swap<__are_same<_ValueType1, _ValueType2>::__value
+ && __are_same<_ValueType1&, _ReferenceType1>::__value
+ && __are_same<_ValueType2&, _ReferenceType2>::__value>::
+ iter_swap(__a, __b);
+ }
+
+ /**
+ * @brief Swap the elements of two sequences.
+ * @ingroup mutating_algorithms
+ * @param first1 A forward iterator.
+ * @param last1 A forward iterator.
+ * @param first2 A forward iterator.
+ * @return An iterator equal to @p first2+(last1-first1).
+ *
+ * Swaps each element in the range @p [first1,last1) with the
+ * corresponding element in the range @p [first2,(last1-first1)).
+ * The ranges must not overlap.
+ */
+ template<typename _ForwardIterator1, typename _ForwardIterator2>
+ _ForwardIterator2
+ swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
+ _ForwardIterator1>)
+ __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
+ _ForwardIterator2>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+
+ for (; __first1 != __last1; ++__first1, ++__first2)
+ std::iter_swap(__first1, __first2);
+ return __first2;
+ }
+
+ /**
+ * @brief This does what you think it does.
+ * @ingroup sorting_algorithms
+ * @param a A thing of arbitrary type.
+ * @param b Another thing of arbitrary type.
+ * @return The lesser of the parameters.
+ *
+ * This is the simple classic generic implementation. It will work on
+ * temporary expressions, since they are only evaluated once, unlike a
+ * preprocessor macro.
+ */
+ template<typename _Tp>
+ inline const _Tp&
+ min(const _Tp& __a, const _Tp& __b)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_LessThanComparableConcept<_Tp>)
+ //return __b < __a ? __b : __a;
+ if (__b < __a)
+ return __b;
+ return __a;
+ }
+
+ /**
+ * @brief This does what you think it does.
+ * @ingroup sorting_algorithms
+ * @param a A thing of arbitrary type.
+ * @param b Another thing of arbitrary type.
+ * @return The greater of the parameters.
+ *
+ * This is the simple classic generic implementation. It will work on
+ * temporary expressions, since they are only evaluated once, unlike a
+ * preprocessor macro.
+ */
+ template<typename _Tp>
+ inline const _Tp&
+ max(const _Tp& __a, const _Tp& __b)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_LessThanComparableConcept<_Tp>)
+ //return __a < __b ? __b : __a;
+ if (__a < __b)
+ return __b;
+ return __a;
+ }
+
+ /**
+ * @brief This does what you think it does.
+ * @ingroup sorting_algorithms
+ * @param a A thing of arbitrary type.
+ * @param b Another thing of arbitrary type.
+ * @param comp A @link comparison_functors comparison functor@endlink.
+ * @return The lesser of the parameters.
+ *
+ * This will work on temporary expressions, since they are only evaluated
+ * once, unlike a preprocessor macro.
+ */
+ template<typename _Tp, typename _Compare>
+ inline const _Tp&
+ min(const _Tp& __a, const _Tp& __b, _Compare __comp)
+ {
+ //return __comp(__b, __a) ? __b : __a;
+ if (__comp(__b, __a))
+ return __b;
+ return __a;
+ }
+
+ /**
+ * @brief This does what you think it does.
+ * @ingroup sorting_algorithms
+ * @param a A thing of arbitrary type.
+ * @param b Another thing of arbitrary type.
+ * @param comp A @link comparison_functors comparison functor@endlink.
+ * @return The greater of the parameters.
+ *
+ * This will work on temporary expressions, since they are only evaluated
+ * once, unlike a preprocessor macro.
+ */
+ template<typename _Tp, typename _Compare>
+ inline const _Tp&
+ max(const _Tp& __a, const _Tp& __b, _Compare __comp)
+ {
+ //return __comp(__a, __b) ? __b : __a;
+ if (__comp(__a, __b))
+ return __b;
+ return __a;
+ }
+
+
+ // If _Iterator is a __normal_iterator return its base (a plain pointer,
+ // normally) otherwise return it untouched. See copy, fill, ...
+ template<typename _Iterator,
+ bool _IsNormal = __is_normal_iterator<_Iterator>::__value>
+ struct __niter_base
+ {
+ static _Iterator
+ __b(_Iterator __it)
+ { return __it; }
+ };
+
+ template<typename _Iterator>
+ struct __niter_base<_Iterator, true>
+ {
+ static typename _Iterator::iterator_type
+ __b(_Iterator __it)
+ { return __it.base(); }
+ };
+
+ // Likewise, for move_iterator.
+ template<typename _Iterator,
+ bool _IsMove = __is_move_iterator<_Iterator>::__value>
+ struct __miter_base
+ {
+ static _Iterator
+ __b(_Iterator __it)
+ { return __it; }
+ };
+
+ template<typename _Iterator>
+ struct __miter_base<_Iterator, true>
+ {
+ static typename _Iterator::iterator_type
+ __b(_Iterator __it)
+ { return __it.base(); }
+ };
+
+ // All of these auxiliary structs serve two purposes. (1) Replace
+ // calls to copy with memmove whenever possible. (Memmove, not memcpy,
+ // because the input and output ranges are permitted to overlap.)
+ // (2) If we're using random access iterators, then write the loop as
+ // a for loop with an explicit count.
+
+ template<bool, bool, typename>
+ struct __copy_move
+ {
+ template<typename _II, typename _OI>
+ static _OI
+ __copy_m(_II __first, _II __last, _OI __result)
+ {
+ for (; __first != __last; ++__result, ++__first)
+ *__result = *__first;
+ return __result;
+ }
+ };
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Category>
+ struct __copy_move<true, false, _Category>
+ {
+ template<typename _II, typename _OI>
+ static _OI
+ __copy_m(_II __first, _II __last, _OI __result)
+ {
+ for (; __first != __last; ++__result, ++__first)
+ *__result = std::move(*__first);
+ return __result;
+ }
+ };
+#endif
+
+ template<>
+ struct __copy_move<false, false, random_access_iterator_tag>
+ {
+ template<typename _II, typename _OI>
+ static _OI
+ __copy_m(_II __first, _II __last, _OI __result)
+ {
+ typedef typename iterator_traits<_II>::difference_type _Distance;
+ for(_Distance __n = __last - __first; __n > 0; --__n)
+ {
+ *__result = *__first;
+ ++__first;
+ ++__result;
+ }
+ return __result;
+ }
+ };
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<>
+ struct __copy_move<true, false, random_access_iterator_tag>
+ {
+ template<typename _II, typename _OI>
+ static _OI
+ __copy_m(_II __first, _II __last, _OI __result)
+ {
+ typedef typename iterator_traits<_II>::difference_type _Distance;
+ for(_Distance __n = __last - __first; __n > 0; --__n)
+ {
+ *__result = std::move(*__first);
+ ++__first;
+ ++__result;
+ }
+ return __result;
+ }
+ };
+#endif
+
+ template<bool _IsMove>
+ struct __copy_move<_IsMove, true, random_access_iterator_tag>
+ {
+ template<typename _Tp>
+ static _Tp*
+ __copy_m(const _Tp* __first, const _Tp* __last, _Tp* __result)
+ {
+ __builtin_memmove(__result, __first,
+ sizeof(_Tp) * (__last - __first));
+ return __result + (__last - __first);
+ }
+ };
+
+ template<bool _IsMove, typename _II, typename _OI>
+ inline _OI
+ __copy_move_a(_II __first, _II __last, _OI __result)
+ {
+ typedef typename iterator_traits<_II>::value_type _ValueTypeI;
+ typedef typename iterator_traits<_OI>::value_type _ValueTypeO;
+ typedef typename iterator_traits<_II>::iterator_category _Category;
+ const bool __simple = (__is_pod(_ValueTypeI)
+ && __is_pointer<_II>::__value
+ && __is_pointer<_OI>::__value
+ && __are_same<_ValueTypeI, _ValueTypeO>::__value);
+
+ return std::__copy_move<_IsMove, __simple,
+ _Category>::__copy_m(__first, __last, __result);
+ }
+
+ // Helpers for streambuf iterators (either istream or ostream).
+ // NB: avoid including <iosfwd>, relatively large.
+ template<typename _CharT>
+ struct char_traits;
+
+ template<typename _CharT, typename _Traits>
+ class istreambuf_iterator;
+
+ template<typename _CharT, typename _Traits>
+ class ostreambuf_iterator;
+
+ template<bool _IsMove, typename _CharT>
+ typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+ ostreambuf_iterator<_CharT, char_traits<_CharT> > >::__type
+ __copy_move_a2(_CharT*, _CharT*,
+ ostreambuf_iterator<_CharT, char_traits<_CharT> >);
+
+ template<bool _IsMove, typename _CharT>
+ typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+ ostreambuf_iterator<_CharT, char_traits<_CharT> > >::__type
+ __copy_move_a2(const _CharT*, const _CharT*,
+ ostreambuf_iterator<_CharT, char_traits<_CharT> >);
+
+ template<bool _IsMove, typename _CharT>
+ typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+ _CharT*>::__type
+ __copy_move_a2(istreambuf_iterator<_CharT, char_traits<_CharT> >,
+ istreambuf_iterator<_CharT, char_traits<_CharT> >, _CharT*);
+
+ template<bool _IsMove, typename _II, typename _OI>
+ inline _OI
+ __copy_move_a2(_II __first, _II __last, _OI __result)
+ {
+ return _OI(std::__copy_move_a<_IsMove>
+ (std::__niter_base<_II>::__b(__first),
+ std::__niter_base<_II>::__b(__last),
+ std::__niter_base<_OI>::__b(__result)));
+ }
+
+ /**
+ * @brief Copies the range [first,last) into result.
+ * @ingroup mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param result An output iterator.
+ * @return result + (first - last)
+ *
+ * This inline function will boil down to a call to @c memmove whenever
+ * possible. Failing that, if random access iterators are passed, then the
+ * loop count will be known (and therefore a candidate for compiler
+ * optimizations such as unrolling). Result may not be contained within
+ * [first,last); the copy_backward function should be used instead.
+ *
+ * Note that the end of the output range is permitted to be contained
+ * within [first,last).
+ */
+ template<typename _II, typename _OI>
+ inline _OI
+ copy(_II __first, _II __last, _OI __result)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_II>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OI,
+ typename iterator_traits<_II>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ return (std::__copy_move_a2<__is_move_iterator<_II>::__value>
+ (std::__miter_base<_II>::__b(__first),
+ std::__miter_base<_II>::__b(__last), __result));
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Moves the range [first,last) into result.
+ * @ingroup mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param result An output iterator.
+ * @return result + (first - last)
+ *
+ * This inline function will boil down to a call to @c memmove whenever
+ * possible. Failing that, if random access iterators are passed, then the
+ * loop count will be known (and therefore a candidate for compiler
+ * optimizations such as unrolling). Result may not be contained within
+ * [first,last); the move_backward function should be used instead.
+ *
+ * Note that the end of the output range is permitted to be contained
+ * within [first,last).
+ */
+ template<typename _II, typename _OI>
+ inline _OI
+ move(_II __first, _II __last, _OI __result)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_II>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OI,
+ typename iterator_traits<_II>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ return (std::__copy_move_a2<true>
+ (std::__miter_base<_II>::__b(__first),
+ std::__miter_base<_II>::__b(__last), __result));
+ }
+
+#define _GLIBCXX_MOVE3(_Tp, _Up, _Vp) std::move(_Tp, _Up, _Vp)
+#else
+#define _GLIBCXX_MOVE3(_Tp, _Up, _Vp) std::copy(_Tp, _Up, _Vp)
+#endif
+
+ template<bool, bool, typename>
+ struct __copy_move_backward
+ {
+ template<typename _BI1, typename _BI2>
+ static _BI2
+ __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
+ {
+ while (__first != __last)
+ *--__result = *--__last;
+ return __result;
+ }
+ };
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Category>
+ struct __copy_move_backward<true, false, _Category>
+ {
+ template<typename _BI1, typename _BI2>
+ static _BI2
+ __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
+ {
+ while (__first != __last)
+ *--__result = std::move(*--__last);
+ return __result;
+ }
+ };
+#endif
+
+ template<>
+ struct __copy_move_backward<false, false, random_access_iterator_tag>
+ {
+ template<typename _BI1, typename _BI2>
+ static _BI2
+ __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
+ {
+ typename iterator_traits<_BI1>::difference_type __n;
+ for (__n = __last - __first; __n > 0; --__n)
+ *--__result = *--__last;
+ return __result;
+ }
+ };
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<>
+ struct __copy_move_backward<true, false, random_access_iterator_tag>
+ {
+ template<typename _BI1, typename _BI2>
+ static _BI2
+ __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
+ {
+ typename iterator_traits<_BI1>::difference_type __n;
+ for (__n = __last - __first; __n > 0; --__n)
+ *--__result = std::move(*--__last);
+ return __result;
+ }
+ };
+#endif
+
+ template<bool _IsMove>
+ struct __copy_move_backward<_IsMove, true, random_access_iterator_tag>
+ {
+ template<typename _Tp>
+ static _Tp*
+ __copy_move_b(const _Tp* __first, const _Tp* __last, _Tp* __result)
+ {
+ const ptrdiff_t _Num = __last - __first;
+ __builtin_memmove(__result - _Num, __first, sizeof(_Tp) * _Num);
+ return __result - _Num;
+ }
+ };
+
+ template<bool _IsMove, typename _BI1, typename _BI2>
+ inline _BI2
+ __copy_move_backward_a(_BI1 __first, _BI1 __last, _BI2 __result)
+ {
+ typedef typename iterator_traits<_BI1>::value_type _ValueType1;
+ typedef typename iterator_traits<_BI2>::value_type _ValueType2;
+ typedef typename iterator_traits<_BI1>::iterator_category _Category;
+ const bool __simple = (__is_pod(_ValueType1)
+ && __is_pointer<_BI1>::__value
+ && __is_pointer<_BI2>::__value
+ && __are_same<_ValueType1, _ValueType2>::__value);
+
+ return std::__copy_move_backward<_IsMove, __simple,
+ _Category>::__copy_move_b(__first,
+ __last,
+ __result);
+ }
+
+ template<bool _IsMove, typename _BI1, typename _BI2>
+ inline _BI2
+ __copy_move_backward_a2(_BI1 __first, _BI1 __last, _BI2 __result)
+ {
+ return _BI2(std::__copy_move_backward_a<_IsMove>
+ (std::__niter_base<_BI1>::__b(__first),
+ std::__niter_base<_BI1>::__b(__last),
+ std::__niter_base<_BI2>::__b(__result)));
+ }
+
+ /**
+ * @brief Copies the range [first,last) into result.
+ * @ingroup mutating_algorithms
+ * @param first A bidirectional iterator.
+ * @param last A bidirectional iterator.
+ * @param result A bidirectional iterator.
+ * @return result - (first - last)
+ *
+ * The function has the same effect as copy, but starts at the end of the
+ * range and works its way to the start, returning the start of the result.
+ * This inline function will boil down to a call to @c memmove whenever
+ * possible. Failing that, if random access iterators are passed, then the
+ * loop count will be known (and therefore a candidate for compiler
+ * optimizations such as unrolling).
+ *
+ * Result may not be in the range [first,last). Use copy instead. Note
+ * that the start of the output range may overlap [first,last).
+ */
+ template<typename _BI1, typename _BI2>
+ inline _BI2
+ copy_backward(_BI1 __first, _BI1 __last, _BI2 __result)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_BidirectionalIteratorConcept<_BI1>)
+ __glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept<_BI2>)
+ __glibcxx_function_requires(_ConvertibleConcept<
+ typename iterator_traits<_BI1>::value_type,
+ typename iterator_traits<_BI2>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ return (std::__copy_move_backward_a2<__is_move_iterator<_BI1>::__value>
+ (std::__miter_base<_BI1>::__b(__first),
+ std::__miter_base<_BI1>::__b(__last), __result));
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Moves the range [first,last) into result.
+ * @ingroup mutating_algorithms
+ * @param first A bidirectional iterator.
+ * @param last A bidirectional iterator.
+ * @param result A bidirectional iterator.
+ * @return result - (first - last)
+ *
+ * The function has the same effect as move, but starts at the end of the
+ * range and works its way to the start, returning the start of the result.
+ * This inline function will boil down to a call to @c memmove whenever
+ * possible. Failing that, if random access iterators are passed, then the
+ * loop count will be known (and therefore a candidate for compiler
+ * optimizations such as unrolling).
+ *
+ * Result may not be in the range [first,last). Use move instead. Note
+ * that the start of the output range may overlap [first,last).
+ */
+ template<typename _BI1, typename _BI2>
+ inline _BI2
+ move_backward(_BI1 __first, _BI1 __last, _BI2 __result)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_BidirectionalIteratorConcept<_BI1>)
+ __glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept<_BI2>)
+ __glibcxx_function_requires(_ConvertibleConcept<
+ typename iterator_traits<_BI1>::value_type,
+ typename iterator_traits<_BI2>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ return (std::__copy_move_backward_a2<true>
+ (std::__miter_base<_BI1>::__b(__first),
+ std::__miter_base<_BI1>::__b(__last), __result));
+ }
+
+#define _GLIBCXX_MOVE_BACKWARD3(_Tp, _Up, _Vp) std::move_backward(_Tp, _Up, _Vp)
+#else
+#define _GLIBCXX_MOVE_BACKWARD3(_Tp, _Up, _Vp) std::copy_backward(_Tp, _Up, _Vp)
+#endif
+
+ template<typename _ForwardIterator, typename _Tp>
+ inline typename
+ __gnu_cxx::__enable_if<!__is_scalar<_Tp>::__value, void>::__type
+ __fill_a(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __value)
+ {
+ for (; __first != __last; ++__first)
+ *__first = __value;
+ }
+
+ template<typename _ForwardIterator, typename _Tp>
+ inline typename
+ __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, void>::__type
+ __fill_a(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __value)
+ {
+ const _Tp __tmp = __value;
+ for (; __first != __last; ++__first)
+ *__first = __tmp;
+ }
+
+ // Specialization: for char types we can use memset.
+ template<typename _Tp>
+ inline typename
+ __gnu_cxx::__enable_if<__is_byte<_Tp>::__value, void>::__type
+ __fill_a(_Tp* __first, _Tp* __last, const _Tp& __c)
+ {
+ const _Tp __tmp = __c;
+ __builtin_memset(__first, static_cast<unsigned char>(__tmp),
+ __last - __first);
+ }
+
+ /**
+ * @brief Fills the range [first,last) with copies of value.
+ * @ingroup mutating_algorithms
+ * @param first A forward iterator.
+ * @param last A forward iterator.
+ * @param value A reference-to-const of arbitrary type.
+ * @return Nothing.
+ *
+ * This function fills a range with copies of the same value. For char
+ * types filling contiguous areas of memory, this becomes an inline call
+ * to @c memset or @c wmemset.
+ */
+ template<typename _ForwardIterator, typename _Tp>
+ inline void
+ fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
+ _ForwardIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ std::__fill_a(std::__niter_base<_ForwardIterator>::__b(__first),
+ std::__niter_base<_ForwardIterator>::__b(__last), __value);
+ }
+
+ template<typename _OutputIterator, typename _Size, typename _Tp>
+ inline typename
+ __gnu_cxx::__enable_if<!__is_scalar<_Tp>::__value, _OutputIterator>::__type
+ __fill_n_a(_OutputIterator __first, _Size __n, const _Tp& __value)
+ {
+ for (; __n > 0; --__n, ++__first)
+ *__first = __value;
+ return __first;
+ }
+
+ template<typename _OutputIterator, typename _Size, typename _Tp>
+ inline typename
+ __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, _OutputIterator>::__type
+ __fill_n_a(_OutputIterator __first, _Size __n, const _Tp& __value)
+ {
+ const _Tp __tmp = __value;
+ for (; __n > 0; --__n, ++__first)
+ *__first = __tmp;
+ return __first;
+ }
+
+ template<typename _Size, typename _Tp>
+ inline typename
+ __gnu_cxx::__enable_if<__is_byte<_Tp>::__value, _Tp*>::__type
+ __fill_n_a(_Tp* __first, _Size __n, const _Tp& __c)
+ {
+ std::__fill_a(__first, __first + __n, __c);
+ return __first + __n;
+ }
+
+ /**
+ * @brief Fills the range [first,first+n) with copies of value.
+ * @ingroup mutating_algorithms
+ * @param first An output iterator.
+ * @param n The count of copies to perform.
+ * @param value A reference-to-const of arbitrary type.
+ * @return The iterator at first+n.
+ *
+ * This function fills a range with copies of the same value. For char
+ * types filling contiguous areas of memory, this becomes an inline call
+ * to @c memset or @ wmemset.
+ */
+ template<typename _OI, typename _Size, typename _Tp>
+ inline _OI
+ fill_n(_OI __first, _Size __n, const _Tp& __value)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_OutputIteratorConcept<_OI, _Tp>)
+
+ return _OI(std::__fill_n_a(std::__niter_base<_OI>::__b(__first),
+ __n, __value));
+ }
+
+ template<bool _BoolType>
+ struct __equal
+ {
+ template<typename _II1, typename _II2>
+ static bool
+ equal(_II1 __first1, _II1 __last1, _II2 __first2)
+ {
+ for (; __first1 != __last1; ++__first1, ++__first2)
+ if (!(*__first1 == *__first2))
+ return false;
+ return true;
+ }
+ };
+
+ template<>
+ struct __equal<true>
+ {
+ template<typename _Tp>
+ static bool
+ equal(const _Tp* __first1, const _Tp* __last1, const _Tp* __first2)
+ {
+ return !__builtin_memcmp(__first1, __first2, sizeof(_Tp)
+ * (__last1 - __first1));
+ }
+ };
+
+ template<typename _II1, typename _II2>
+ inline bool
+ __equal_aux(_II1 __first1, _II1 __last1, _II2 __first2)
+ {
+ typedef typename iterator_traits<_II1>::value_type _ValueType1;
+ typedef typename iterator_traits<_II2>::value_type _ValueType2;
+ const bool __simple = (__is_integer<_ValueType1>::__value
+ && __is_pointer<_II1>::__value
+ && __is_pointer<_II2>::__value
+ && __are_same<_ValueType1, _ValueType2>::__value);
+
+ return std::__equal<__simple>::equal(__first1, __last1, __first2);
+ }
+
+
+ template<typename, typename>
+ struct __lc_rai
+ {
+ template<typename _II1, typename _II2>
+ static _II1
+ __newlast1(_II1, _II1 __last1, _II2, _II2)
+ { return __last1; }
+
+ template<typename _II>
+ static bool
+ __cnd2(_II __first, _II __last)
+ { return __first != __last; }
+ };
+
+ template<>
+ struct __lc_rai<random_access_iterator_tag, random_access_iterator_tag>
+ {
+ template<typename _RAI1, typename _RAI2>
+ static _RAI1
+ __newlast1(_RAI1 __first1, _RAI1 __last1,
+ _RAI2 __first2, _RAI2 __last2)
+ {
+ const typename iterator_traits<_RAI1>::difference_type
+ __diff1 = __last1 - __first1;
+ const typename iterator_traits<_RAI2>::difference_type
+ __diff2 = __last2 - __first2;
+ return __diff2 < __diff1 ? __first1 + __diff2 : __last1;
+ }
+
+ template<typename _RAI>
+ static bool
+ __cnd2(_RAI, _RAI)
+ { return true; }
+ };
+
+ template<bool _BoolType>
+ struct __lexicographical_compare
+ {
+ template<typename _II1, typename _II2>
+ static bool __lc(_II1, _II1, _II2, _II2);
+ };
+
+ template<bool _BoolType>
+ template<typename _II1, typename _II2>
+ bool
+ __lexicographical_compare<_BoolType>::
+ __lc(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2)
+ {
+ typedef typename iterator_traits<_II1>::iterator_category _Category1;
+ typedef typename iterator_traits<_II2>::iterator_category _Category2;
+ typedef std::__lc_rai<_Category1, _Category2> __rai_type;
+
+ __last1 = __rai_type::__newlast1(__first1, __last1,
+ __first2, __last2);
+ for (; __first1 != __last1 && __rai_type::__cnd2(__first2, __last2);
+ ++__first1, ++__first2)
+ {
+ if (*__first1 < *__first2)
+ return true;
+ if (*__first2 < *__first1)
+ return false;
+ }
+ return __first1 == __last1 && __first2 != __last2;
+ }
+
+ template<>
+ struct __lexicographical_compare<true>
+ {
+ template<typename _Tp, typename _Up>
+ static bool
+ __lc(const _Tp* __first1, const _Tp* __last1,
+ const _Up* __first2, const _Up* __last2)
+ {
+ const size_t __len1 = __last1 - __first1;
+ const size_t __len2 = __last2 - __first2;
+ const int __result = __builtin_memcmp(__first1, __first2,
+ std::min(__len1, __len2));
+ return __result != 0 ? __result < 0 : __len1 < __len2;
+ }
+ };
+
+ template<typename _II1, typename _II2>
+ inline bool
+ __lexicographical_compare_aux(_II1 __first1, _II1 __last1,
+ _II2 __first2, _II2 __last2)
+ {
+ typedef typename iterator_traits<_II1>::value_type _ValueType1;
+ typedef typename iterator_traits<_II2>::value_type _ValueType2;
+ const bool __simple =
+ (__is_byte<_ValueType1>::__value && __is_byte<_ValueType2>::__value
+ && !__gnu_cxx::__numeric_traits<_ValueType1>::__is_signed
+ && !__gnu_cxx::__numeric_traits<_ValueType2>::__is_signed
+ && __is_pointer<_II1>::__value
+ && __is_pointer<_II2>::__value);
+
+ return std::__lexicographical_compare<__simple>::__lc(__first1, __last1,
+ __first2, __last2);
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_P)
+
+ /**
+ * @brief Tests a range for element-wise equality.
+ * @ingroup non_mutating_algorithms
+ * @param first1 An input iterator.
+ * @param last1 An input iterator.
+ * @param first2 An input iterator.
+ * @return A boolean true or false.
+ *
+ * This compares the elements of two ranges using @c == and returns true or
+ * false depending on whether all of the corresponding elements of the
+ * ranges are equal.
+ */
+ template<typename _II1, typename _II2>
+ inline bool
+ equal(_II1 __first1, _II1 __last1, _II2 __first2)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_II1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_II2>)
+ __glibcxx_function_requires(_EqualOpConcept<
+ typename iterator_traits<_II1>::value_type,
+ typename iterator_traits<_II2>::value_type>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+
+ return std::__equal_aux(std::__niter_base<_II1>::__b(__first1),
+ std::__niter_base<_II1>::__b(__last1),
+ std::__niter_base<_II2>::__b(__first2));
+ }
+
+ /**
+ * @brief Tests a range for element-wise equality.
+ * @ingroup non_mutating_algorithms
+ * @param first1 An input iterator.
+ * @param last1 An input iterator.
+ * @param first2 An input iterator.
+ * @param binary_pred A binary predicate @link functors
+ * functor@endlink.
+ * @return A boolean true or false.
+ *
+ * This compares the elements of two ranges using the binary_pred
+ * parameter, and returns true or
+ * false depending on whether all of the corresponding elements of the
+ * ranges are equal.
+ */
+ template<typename _IIter1, typename _IIter2, typename _BinaryPredicate>
+ inline bool
+ equal(_IIter1 __first1, _IIter1 __last1,
+ _IIter2 __first2, _BinaryPredicate __binary_pred)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_IIter1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_IIter2>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+
+ for (; __first1 != __last1; ++__first1, ++__first2)
+ if (!bool(__binary_pred(*__first1, *__first2)))
+ return false;
+ return true;
+ }
+
+ /**
+ * @brief Performs "dictionary" comparison on ranges.
+ * @ingroup sorting_algorithms
+ * @param first1 An input iterator.
+ * @param last1 An input iterator.
+ * @param first2 An input iterator.
+ * @param last2 An input iterator.
+ * @return A boolean true or false.
+ *
+ * "Returns true if the sequence of elements defined by the range
+ * [first1,last1) is lexicographically less than the sequence of elements
+ * defined by the range [first2,last2). Returns false otherwise."
+ * (Quoted from [25.3.8]/1.) If the iterators are all character pointers,
+ * then this is an inline call to @c memcmp.
+ */
+ template<typename _II1, typename _II2>
+ inline bool
+ lexicographical_compare(_II1 __first1, _II1 __last1,
+ _II2 __first2, _II2 __last2)
+ {
+ // concept requirements
+ typedef typename iterator_traits<_II1>::value_type _ValueType1;
+ typedef typename iterator_traits<_II2>::value_type _ValueType2;
+ __glibcxx_function_requires(_InputIteratorConcept<_II1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_II2>)
+ __glibcxx_function_requires(_LessThanOpConcept<_ValueType1, _ValueType2>)
+ __glibcxx_function_requires(_LessThanOpConcept<_ValueType2, _ValueType1>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+ __glibcxx_requires_valid_range(__first2, __last2);
+
+ return std::__lexicographical_compare_aux
+ (std::__niter_base<_II1>::__b(__first1),
+ std::__niter_base<_II1>::__b(__last1),
+ std::__niter_base<_II2>::__b(__first2),
+ std::__niter_base<_II2>::__b(__last2));
+ }
+
+ /**
+ * @brief Performs "dictionary" comparison on ranges.
+ * @ingroup sorting_algorithms
+ * @param first1 An input iterator.
+ * @param last1 An input iterator.
+ * @param first2 An input iterator.
+ * @param last2 An input iterator.
+ * @param comp A @link comparison_functors comparison functor@endlink.
+ * @return A boolean true or false.
+ *
+ * The same as the four-parameter @c lexicographical_compare, but uses the
+ * comp parameter instead of @c <.
+ */
+ template<typename _II1, typename _II2, typename _Compare>
+ bool
+ lexicographical_compare(_II1 __first1, _II1 __last1,
+ _II2 __first2, _II2 __last2, _Compare __comp)
+ {
+ typedef typename iterator_traits<_II1>::iterator_category _Category1;
+ typedef typename iterator_traits<_II2>::iterator_category _Category2;
+ typedef std::__lc_rai<_Category1, _Category2> __rai_type;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_II1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_II2>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+ __glibcxx_requires_valid_range(__first2, __last2);
+
+ __last1 = __rai_type::__newlast1(__first1, __last1, __first2, __last2);
+ for (; __first1 != __last1 && __rai_type::__cnd2(__first2, __last2);
+ ++__first1, ++__first2)
+ {
+ if (__comp(*__first1, *__first2))
+ return true;
+ if (__comp(*__first2, *__first1))
+ return false;
+ }
+ return __first1 == __last1 && __first2 != __last2;
+ }
+
+ /**
+ * @brief Finds the places in ranges which don't match.
+ * @ingroup non_mutating_algorithms
+ * @param first1 An input iterator.
+ * @param last1 An input iterator.
+ * @param first2 An input iterator.
+ * @return A pair of iterators pointing to the first mismatch.
+ *
+ * This compares the elements of two ranges using @c == and returns a pair
+ * of iterators. The first iterator points into the first range, the
+ * second iterator points into the second range, and the elements pointed
+ * to by the iterators are not equal.
+ */
+ template<typename _InputIterator1, typename _InputIterator2>
+ pair<_InputIterator1, _InputIterator2>
+ mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_function_requires(_EqualOpConcept<
+ typename iterator_traits<_InputIterator1>::value_type,
+ typename iterator_traits<_InputIterator2>::value_type>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+
+ while (__first1 != __last1 && *__first1 == *__first2)
+ {
+ ++__first1;
+ ++__first2;
+ }
+ return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
+ }
+
+ /**
+ * @brief Finds the places in ranges which don't match.
+ * @ingroup non_mutating_algorithms
+ * @param first1 An input iterator.
+ * @param last1 An input iterator.
+ * @param first2 An input iterator.
+ * @param binary_pred A binary predicate @link functors
+ * functor@endlink.
+ * @return A pair of iterators pointing to the first mismatch.
+ *
+ * This compares the elements of two ranges using the binary_pred
+ * parameter, and returns a pair
+ * of iterators. The first iterator points into the first range, the
+ * second iterator points into the second range, and the elements pointed
+ * to by the iterators are not equal.
+ */
+ template<typename _InputIterator1, typename _InputIterator2,
+ typename _BinaryPredicate>
+ pair<_InputIterator1, _InputIterator2>
+ mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _BinaryPredicate __binary_pred)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+
+ while (__first1 != __last1 && bool(__binary_pred(*__first1, *__first2)))
+ {
+ ++__first1;
+ ++__first2;
+ }
+ return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
+ }
+
+_GLIBCXX_END_NESTED_NAMESPACE
+
+// NB: This file is included within many other C++ includes, as a way
+// of getting the base algorithms. So, make sure that parallel bits
+// come in too if requested.
+#ifdef _GLIBCXX_PARALLEL
+# include <parallel/algobase.h>
+#endif
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/bits/stl_bvector.h b/i686-linux/include/c++/4.4.3/bits/stl_bvector.h
new file mode 100644
index 0000000..0e60b7f
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/stl_bvector.h
@@ -0,0 +1,1024 @@
+// vector<bool> specialization -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996-1999
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_bvector.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_BVECTOR_H
+#define _STL_BVECTOR_H 1
+
+#include <initializer_list>
+
+_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
+
+ typedef unsigned long _Bit_type;
+ enum { _S_word_bit = int(__CHAR_BIT__ * sizeof(_Bit_type)) };
+
+ struct _Bit_reference
+ {
+ _Bit_type * _M_p;
+ _Bit_type _M_mask;
+
+ _Bit_reference(_Bit_type * __x, _Bit_type __y)
+ : _M_p(__x), _M_mask(__y) { }
+
+ _Bit_reference() : _M_p(0), _M_mask(0) { }
+
+ operator bool() const
+ { return !!(*_M_p & _M_mask); }
+
+ _Bit_reference&
+ operator=(bool __x)
+ {
+ if (__x)
+ *_M_p |= _M_mask;
+ else
+ *_M_p &= ~_M_mask;
+ return *this;
+ }
+
+ _Bit_reference&
+ operator=(const _Bit_reference& __x)
+ { return *this = bool(__x); }
+
+ bool
+ operator==(const _Bit_reference& __x) const
+ { return bool(*this) == bool(__x); }
+
+ bool
+ operator<(const _Bit_reference& __x) const
+ { return !bool(*this) && bool(__x); }
+
+ void
+ flip()
+ { *_M_p ^= _M_mask; }
+ };
+
+ struct _Bit_iterator_base
+ : public std::iterator<std::random_access_iterator_tag, bool>
+ {
+ _Bit_type * _M_p;
+ unsigned int _M_offset;
+
+ _Bit_iterator_base(_Bit_type * __x, unsigned int __y)
+ : _M_p(__x), _M_offset(__y) { }
+
+ void
+ _M_bump_up()
+ {
+ if (_M_offset++ == int(_S_word_bit) - 1)
+ {
+ _M_offset = 0;
+ ++_M_p;
+ }
+ }
+
+ void
+ _M_bump_down()
+ {
+ if (_M_offset-- == 0)
+ {
+ _M_offset = int(_S_word_bit) - 1;
+ --_M_p;
+ }
+ }
+
+ void
+ _M_incr(ptrdiff_t __i)
+ {
+ difference_type __n = __i + _M_offset;
+ _M_p += __n / int(_S_word_bit);
+ __n = __n % int(_S_word_bit);
+ if (__n < 0)
+ {
+ __n += int(_S_word_bit);
+ --_M_p;
+ }
+ _M_offset = static_cast<unsigned int>(__n);
+ }
+
+ bool
+ operator==(const _Bit_iterator_base& __i) const
+ { return _M_p == __i._M_p && _M_offset == __i._M_offset; }
+
+ bool
+ operator<(const _Bit_iterator_base& __i) const
+ {
+ return _M_p < __i._M_p
+ || (_M_p == __i._M_p && _M_offset < __i._M_offset);
+ }
+
+ bool
+ operator!=(const _Bit_iterator_base& __i) const
+ { return !(*this == __i); }
+
+ bool
+ operator>(const _Bit_iterator_base& __i) const
+ { return __i < *this; }
+
+ bool
+ operator<=(const _Bit_iterator_base& __i) const
+ { return !(__i < *this); }
+
+ bool
+ operator>=(const _Bit_iterator_base& __i) const
+ { return !(*this < __i); }
+ };
+
+ inline ptrdiff_t
+ operator-(const _Bit_iterator_base& __x, const _Bit_iterator_base& __y)
+ {
+ return (int(_S_word_bit) * (__x._M_p - __y._M_p)
+ + __x._M_offset - __y._M_offset);
+ }
+
+ struct _Bit_iterator : public _Bit_iterator_base
+ {
+ typedef _Bit_reference reference;
+ typedef _Bit_reference* pointer;
+ typedef _Bit_iterator iterator;
+
+ _Bit_iterator() : _Bit_iterator_base(0, 0) { }
+
+ _Bit_iterator(_Bit_type * __x, unsigned int __y)
+ : _Bit_iterator_base(__x, __y) { }
+
+ reference
+ operator*() const
+ { return reference(_M_p, 1UL << _M_offset); }
+
+ iterator&
+ operator++()
+ {
+ _M_bump_up();
+ return *this;
+ }
+
+ iterator
+ operator++(int)
+ {
+ iterator __tmp = *this;
+ _M_bump_up();
+ return __tmp;
+ }
+
+ iterator&
+ operator--()
+ {
+ _M_bump_down();
+ return *this;
+ }
+
+ iterator
+ operator--(int)
+ {
+ iterator __tmp = *this;
+ _M_bump_down();
+ return __tmp;
+ }
+
+ iterator&
+ operator+=(difference_type __i)
+ {
+ _M_incr(__i);
+ return *this;
+ }
+
+ iterator&
+ operator-=(difference_type __i)
+ {
+ *this += -__i;
+ return *this;
+ }
+
+ iterator
+ operator+(difference_type __i) const
+ {
+ iterator __tmp = *this;
+ return __tmp += __i;
+ }
+
+ iterator
+ operator-(difference_type __i) const
+ {
+ iterator __tmp = *this;
+ return __tmp -= __i;
+ }
+
+ reference
+ operator[](difference_type __i) const
+ { return *(*this + __i); }
+ };
+
+ inline _Bit_iterator
+ operator+(ptrdiff_t __n, const _Bit_iterator& __x)
+ { return __x + __n; }
+
+ struct _Bit_const_iterator : public _Bit_iterator_base
+ {
+ typedef bool reference;
+ typedef bool const_reference;
+ typedef const bool* pointer;
+ typedef _Bit_const_iterator const_iterator;
+
+ _Bit_const_iterator() : _Bit_iterator_base(0, 0) { }
+
+ _Bit_const_iterator(_Bit_type * __x, unsigned int __y)
+ : _Bit_iterator_base(__x, __y) { }
+
+ _Bit_const_iterator(const _Bit_iterator& __x)
+ : _Bit_iterator_base(__x._M_p, __x._M_offset) { }
+
+ const_reference
+ operator*() const
+ { return _Bit_reference(_M_p, 1UL << _M_offset); }
+
+ const_iterator&
+ operator++()
+ {
+ _M_bump_up();
+ return *this;
+ }
+
+ const_iterator
+ operator++(int)
+ {
+ const_iterator __tmp = *this;
+ _M_bump_up();
+ return __tmp;
+ }
+
+ const_iterator&
+ operator--()
+ {
+ _M_bump_down();
+ return *this;
+ }
+
+ const_iterator
+ operator--(int)
+ {
+ const_iterator __tmp = *this;
+ _M_bump_down();
+ return __tmp;
+ }
+
+ const_iterator&
+ operator+=(difference_type __i)
+ {
+ _M_incr(__i);
+ return *this;
+ }
+
+ const_iterator&
+ operator-=(difference_type __i)
+ {
+ *this += -__i;
+ return *this;
+ }
+
+ const_iterator
+ operator+(difference_type __i) const
+ {
+ const_iterator __tmp = *this;
+ return __tmp += __i;
+ }
+
+ const_iterator
+ operator-(difference_type __i) const
+ {
+ const_iterator __tmp = *this;
+ return __tmp -= __i;
+ }
+
+ const_reference
+ operator[](difference_type __i) const
+ { return *(*this + __i); }
+ };
+
+ inline _Bit_const_iterator
+ operator+(ptrdiff_t __n, const _Bit_const_iterator& __x)
+ { return __x + __n; }
+
+ inline void
+ __fill_bvector(_Bit_iterator __first, _Bit_iterator __last, bool __x)
+ {
+ for (; __first != __last; ++__first)
+ *__first = __x;
+ }
+
+ inline void
+ fill(_Bit_iterator __first, _Bit_iterator __last, const bool& __x)
+ {
+ if (__first._M_p != __last._M_p)
+ {
+ std::fill(__first._M_p + 1, __last._M_p, __x ? ~0 : 0);
+ __fill_bvector(__first, _Bit_iterator(__first._M_p + 1, 0), __x);
+ __fill_bvector(_Bit_iterator(__last._M_p, 0), __last, __x);
+ }
+ else
+ __fill_bvector(__first, __last, __x);
+ }
+
+ template<typename _Alloc>
+ struct _Bvector_base
+ {
+ typedef typename _Alloc::template rebind<_Bit_type>::other
+ _Bit_alloc_type;
+
+ struct _Bvector_impl
+ : public _Bit_alloc_type
+ {
+ _Bit_iterator _M_start;
+ _Bit_iterator _M_finish;
+ _Bit_type* _M_end_of_storage;
+
+ _Bvector_impl()
+ : _Bit_alloc_type(), _M_start(), _M_finish(), _M_end_of_storage(0)
+ { }
+
+ _Bvector_impl(const _Bit_alloc_type& __a)
+ : _Bit_alloc_type(__a), _M_start(), _M_finish(), _M_end_of_storage(0)
+ { }
+ };
+
+ public:
+ typedef _Alloc allocator_type;
+
+ _Bit_alloc_type&
+ _M_get_Bit_allocator()
+ { return *static_cast<_Bit_alloc_type*>(&this->_M_impl); }
+
+ const _Bit_alloc_type&
+ _M_get_Bit_allocator() const
+ { return *static_cast<const _Bit_alloc_type*>(&this->_M_impl); }
+
+ allocator_type
+ get_allocator() const
+ { return allocator_type(_M_get_Bit_allocator()); }
+
+ _Bvector_base()
+ : _M_impl() { }
+
+ _Bvector_base(const allocator_type& __a)
+ : _M_impl(__a) { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ _Bvector_base(_Bvector_base&& __x)
+ : _M_impl(__x._M_get_Bit_allocator())
+ {
+ this->_M_impl._M_start = __x._M_impl._M_start;
+ this->_M_impl._M_finish = __x._M_impl._M_finish;
+ this->_M_impl._M_end_of_storage = __x._M_impl._M_end_of_storage;
+ __x._M_impl._M_start = _Bit_iterator();
+ __x._M_impl._M_finish = _Bit_iterator();
+ __x._M_impl._M_end_of_storage = 0;
+ }
+#endif
+
+ ~_Bvector_base()
+ { this->_M_deallocate(); }
+
+ protected:
+ _Bvector_impl _M_impl;
+
+ _Bit_type*
+ _M_allocate(size_t __n)
+ { return _M_impl.allocate((__n + int(_S_word_bit) - 1)
+ / int(_S_word_bit)); }
+
+ void
+ _M_deallocate()
+ {
+ if (_M_impl._M_start._M_p)
+ _M_impl.deallocate(_M_impl._M_start._M_p,
+ _M_impl._M_end_of_storage - _M_impl._M_start._M_p);
+ }
+ };
+
+_GLIBCXX_END_NESTED_NAMESPACE
+
+// Declare a partial specialization of vector<T, Alloc>.
+#include <bits/stl_vector.h>
+
+_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
+
+ /**
+ * @brief A specialization of vector for booleans which offers fixed time
+ * access to individual elements in any order.
+ *
+ * Note that vector<bool> does not actually meet the requirements for being
+ * a container. This is because the reference and pointer types are not
+ * really references and pointers to bool. See DR96 for details. @see
+ * vector for function documentation.
+ *
+ * @ingroup sequences
+ *
+ * In some terminology a %vector can be described as a dynamic
+ * C-style array, it offers fast and efficient access to individual
+ * elements in any order and saves the user from worrying about
+ * memory and size allocation. Subscripting ( @c [] ) access is
+ * also provided as with C-style arrays.
+ */
+template<typename _Alloc>
+ class vector<bool, _Alloc> : protected _Bvector_base<_Alloc>
+ {
+ typedef _Bvector_base<_Alloc> _Base;
+
+ public:
+ typedef bool value_type;
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Bit_reference reference;
+ typedef bool const_reference;
+ typedef _Bit_reference* pointer;
+ typedef const bool* const_pointer;
+ typedef _Bit_iterator iterator;
+ typedef _Bit_const_iterator const_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef _Alloc allocator_type;
+
+ allocator_type get_allocator() const
+ { return _Base::get_allocator(); }
+
+ protected:
+ using _Base::_M_allocate;
+ using _Base::_M_deallocate;
+ using _Base::_M_get_Bit_allocator;
+
+ public:
+ vector()
+ : _Base() { }
+
+ explicit
+ vector(const allocator_type& __a)
+ : _Base(__a) { }
+
+ explicit
+ vector(size_type __n, const bool& __value = bool(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ {
+ _M_initialize(__n);
+ std::fill(this->_M_impl._M_start._M_p, this->_M_impl._M_end_of_storage,
+ __value ? ~0 : 0);
+ }
+
+ vector(const vector& __x)
+ : _Base(__x._M_get_Bit_allocator())
+ {
+ _M_initialize(__x.size());
+ _M_copy_aligned(__x.begin(), __x.end(), this->_M_impl._M_start);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ vector(vector&& __x)
+ : _Base(std::forward<_Base>(__x)) { }
+
+ vector(initializer_list<bool> __l,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ {
+ _M_initialize_range(__l.begin(), __l.end(),
+ random_access_iterator_tag());
+ }
+#endif
+
+ template<typename _InputIterator>
+ vector(_InputIterator __first, _InputIterator __last,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ {
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ _M_initialize_dispatch(__first, __last, _Integral());
+ }
+
+ ~vector() { }
+
+ vector&
+ operator=(const vector& __x)
+ {
+ if (&__x == this)
+ return *this;
+ if (__x.size() > capacity())
+ {
+ this->_M_deallocate();
+ _M_initialize(__x.size());
+ }
+ this->_M_impl._M_finish = _M_copy_aligned(__x.begin(), __x.end(),
+ begin());
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ vector&
+ operator=(vector&& __x)
+ {
+ // NB: DR 675.
+ this->clear();
+ this->swap(__x);
+ return *this;
+ }
+
+ vector&
+ operator=(initializer_list<bool> __l)
+ {
+ this->assign (__l.begin(), __l.end());
+ return *this;
+ }
+#endif
+
+ // assign(), a generalized assignment member function. Two
+ // versions: one that takes a count, and one that takes a range.
+ // The range version is a member template, so we dispatch on whether
+ // or not the type is an integer.
+ void
+ assign(size_type __n, const bool& __x)
+ { _M_fill_assign(__n, __x); }
+
+ template<typename _InputIterator>
+ void
+ assign(_InputIterator __first, _InputIterator __last)
+ {
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ _M_assign_dispatch(__first, __last, _Integral());
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ assign(initializer_list<bool> __l)
+ { this->assign(__l.begin(), __l.end()); }
+#endif
+
+ iterator
+ begin()
+ { return this->_M_impl._M_start; }
+
+ const_iterator
+ begin() const
+ { return this->_M_impl._M_start; }
+
+ iterator
+ end()
+ { return this->_M_impl._M_finish; }
+
+ const_iterator
+ end() const
+ { return this->_M_impl._M_finish; }
+
+ reverse_iterator
+ rbegin()
+ { return reverse_iterator(end()); }
+
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(end()); }
+
+ reverse_iterator
+ rend()
+ { return reverse_iterator(begin()); }
+
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(begin()); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ const_iterator
+ cbegin() const
+ { return this->_M_impl._M_start; }
+
+ const_iterator
+ cend() const
+ { return this->_M_impl._M_finish; }
+
+ const_reverse_iterator
+ crbegin() const
+ { return const_reverse_iterator(end()); }
+
+ const_reverse_iterator
+ crend() const
+ { return const_reverse_iterator(begin()); }
+#endif
+
+ size_type
+ size() const
+ { return size_type(end() - begin()); }
+
+ size_type
+ max_size() const
+ {
+ const size_type __isize =
+ __gnu_cxx::__numeric_traits<difference_type>::__max
+ - int(_S_word_bit) + 1;
+ const size_type __asize = _M_get_Bit_allocator().max_size();
+ return (__asize <= __isize / int(_S_word_bit)
+ ? __asize * int(_S_word_bit) : __isize);
+ }
+
+ size_type
+ capacity() const
+ { return size_type(const_iterator(this->_M_impl._M_end_of_storage, 0)
+ - begin()); }
+
+ bool
+ empty() const
+ { return begin() == end(); }
+
+ reference
+ operator[](size_type __n)
+ {
+ return *iterator(this->_M_impl._M_start._M_p
+ + __n / int(_S_word_bit), __n % int(_S_word_bit));
+ }
+
+ const_reference
+ operator[](size_type __n) const
+ {
+ return *const_iterator(this->_M_impl._M_start._M_p
+ + __n / int(_S_word_bit), __n % int(_S_word_bit));
+ }
+
+ protected:
+ void
+ _M_range_check(size_type __n) const
+ {
+ if (__n >= this->size())
+ __throw_out_of_range(__N("vector<bool>::_M_range_check"));
+ }
+
+ public:
+ reference
+ at(size_type __n)
+ { _M_range_check(__n); return (*this)[__n]; }
+
+ const_reference
+ at(size_type __n) const
+ { _M_range_check(__n); return (*this)[__n]; }
+
+ void
+ reserve(size_type __n);
+
+ reference
+ front()
+ { return *begin(); }
+
+ const_reference
+ front() const
+ { return *begin(); }
+
+ reference
+ back()
+ { return *(end() - 1); }
+
+ const_reference
+ back() const
+ { return *(end() - 1); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 464. Suggestion for new member functions in standard containers.
+ // N.B. DR 464 says nothing about vector<bool> but we need something
+ // here due to the way we are implementing DR 464 in the debug-mode
+ // vector class.
+ void
+ data() { }
+
+ void
+ push_back(bool __x)
+ {
+ if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_of_storage)
+ *this->_M_impl._M_finish++ = __x;
+ else
+ _M_insert_aux(end(), __x);
+ }
+
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(vector&& __x)
+#else
+ swap(vector& __x)
+#endif
+ {
+ std::swap(this->_M_impl._M_start, __x._M_impl._M_start);
+ std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish);
+ std::swap(this->_M_impl._M_end_of_storage,
+ __x._M_impl._M_end_of_storage);
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 431. Swapping containers with unequal allocators.
+ std::__alloc_swap<typename _Base::_Bit_alloc_type>::
+ _S_do_it(_M_get_Bit_allocator(), __x._M_get_Bit_allocator());
+ }
+
+ // [23.2.5]/1, third-to-last entry in synopsis listing
+ static void
+ swap(reference __x, reference __y)
+ {
+ bool __tmp = __x;
+ __x = __y;
+ __y = __tmp;
+ }
+
+ iterator
+ insert(iterator __position, const bool& __x = bool())
+ {
+ const difference_type __n = __position - begin();
+ if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_of_storage
+ && __position == end())
+ *this->_M_impl._M_finish++ = __x;
+ else
+ _M_insert_aux(__position, __x);
+ return begin() + __n;
+ }
+
+ template<typename _InputIterator>
+ void
+ insert(iterator __position,
+ _InputIterator __first, _InputIterator __last)
+ {
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ _M_insert_dispatch(__position, __first, __last, _Integral());
+ }
+
+ void
+ insert(iterator __position, size_type __n, const bool& __x)
+ { _M_fill_insert(__position, __n, __x); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void insert(iterator __p, initializer_list<bool> __l)
+ { this->insert(__p, __l.begin(), __l.end()); }
+#endif
+
+ void
+ pop_back()
+ { --this->_M_impl._M_finish; }
+
+ iterator
+ erase(iterator __position)
+ {
+ if (__position + 1 != end())
+ std::copy(__position + 1, end(), __position);
+ --this->_M_impl._M_finish;
+ return __position;
+ }
+
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ _M_erase_at_end(std::copy(__last, end(), __first));
+ return __first;
+ }
+
+ void
+ resize(size_type __new_size, bool __x = bool())
+ {
+ if (__new_size < size())
+ _M_erase_at_end(begin() + difference_type(__new_size));
+ else
+ insert(end(), __new_size - size(), __x);
+ }
+
+ void
+ flip()
+ {
+ for (_Bit_type * __p = this->_M_impl._M_start._M_p;
+ __p != this->_M_impl._M_end_of_storage; ++__p)
+ *__p = ~*__p;
+ }
+
+ void
+ clear()
+ { _M_erase_at_end(begin()); }
+
+
+ protected:
+ // Precondition: __first._M_offset == 0 && __result._M_offset == 0.
+ iterator
+ _M_copy_aligned(const_iterator __first, const_iterator __last,
+ iterator __result)
+ {
+ _Bit_type* __q = std::copy(__first._M_p, __last._M_p, __result._M_p);
+ return std::copy(const_iterator(__last._M_p, 0), __last,
+ iterator(__q, 0));
+ }
+
+ void
+ _M_initialize(size_type __n)
+ {
+ _Bit_type* __q = this->_M_allocate(__n);
+ this->_M_impl._M_end_of_storage = (__q
+ + ((__n + int(_S_word_bit) - 1)
+ / int(_S_word_bit)));
+ this->_M_impl._M_start = iterator(__q, 0);
+ this->_M_impl._M_finish = this->_M_impl._M_start + difference_type(__n);
+ }
+
+ // Check whether it's an integral type. If so, it's not an iterator.
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 438. Ambiguity in the "do the right thing" clause
+ template<typename _Integer>
+ void
+ _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type)
+ {
+ _M_initialize(static_cast<size_type>(__n));
+ std::fill(this->_M_impl._M_start._M_p,
+ this->_M_impl._M_end_of_storage, __x ? ~0 : 0);
+ }
+
+ template<typename _InputIterator>
+ void
+ _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
+ __false_type)
+ { _M_initialize_range(__first, __last,
+ std::__iterator_category(__first)); }
+
+ template<typename _InputIterator>
+ void
+ _M_initialize_range(_InputIterator __first, _InputIterator __last,
+ std::input_iterator_tag)
+ {
+ for (; __first != __last; ++__first)
+ push_back(*__first);
+ }
+
+ template<typename _ForwardIterator>
+ void
+ _M_initialize_range(_ForwardIterator __first, _ForwardIterator __last,
+ std::forward_iterator_tag)
+ {
+ const size_type __n = std::distance(__first, __last);
+ _M_initialize(__n);
+ std::copy(__first, __last, this->_M_impl._M_start);
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 438. Ambiguity in the "do the right thing" clause
+ template<typename _Integer>
+ void
+ _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
+ { _M_fill_assign(__n, __val); }
+
+ template<class _InputIterator>
+ void
+ _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
+ __false_type)
+ { _M_assign_aux(__first, __last, std::__iterator_category(__first)); }
+
+ void
+ _M_fill_assign(size_t __n, bool __x)
+ {
+ if (__n > size())
+ {
+ std::fill(this->_M_impl._M_start._M_p,
+ this->_M_impl._M_end_of_storage, __x ? ~0 : 0);
+ insert(end(), __n - size(), __x);
+ }
+ else
+ {
+ _M_erase_at_end(begin() + __n);
+ std::fill(this->_M_impl._M_start._M_p,
+ this->_M_impl._M_end_of_storage, __x ? ~0 : 0);
+ }
+ }
+
+ template<typename _InputIterator>
+ void
+ _M_assign_aux(_InputIterator __first, _InputIterator __last,
+ std::input_iterator_tag)
+ {
+ iterator __cur = begin();
+ for (; __first != __last && __cur != end(); ++__cur, ++__first)
+ *__cur = *__first;
+ if (__first == __last)
+ _M_erase_at_end(__cur);
+ else
+ insert(end(), __first, __last);
+ }
+
+ template<typename _ForwardIterator>
+ void
+ _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
+ std::forward_iterator_tag)
+ {
+ const size_type __len = std::distance(__first, __last);
+ if (__len < size())
+ _M_erase_at_end(std::copy(__first, __last, begin()));
+ else
+ {
+ _ForwardIterator __mid = __first;
+ std::advance(__mid, size());
+ std::copy(__first, __mid, begin());
+ insert(end(), __mid, __last);
+ }
+ }
+
+ // Check whether it's an integral type. If so, it's not an iterator.
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 438. Ambiguity in the "do the right thing" clause
+ template<typename _Integer>
+ void
+ _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x,
+ __true_type)
+ { _M_fill_insert(__pos, __n, __x); }
+
+ template<typename _InputIterator>
+ void
+ _M_insert_dispatch(iterator __pos,
+ _InputIterator __first, _InputIterator __last,
+ __false_type)
+ { _M_insert_range(__pos, __first, __last,
+ std::__iterator_category(__first)); }
+
+ void
+ _M_fill_insert(iterator __position, size_type __n, bool __x);
+
+ template<typename _InputIterator>
+ void
+ _M_insert_range(iterator __pos, _InputIterator __first,
+ _InputIterator __last, std::input_iterator_tag)
+ {
+ for (; __first != __last; ++__first)
+ {
+ __pos = insert(__pos, *__first);
+ ++__pos;
+ }
+ }
+
+ template<typename _ForwardIterator>
+ void
+ _M_insert_range(iterator __position, _ForwardIterator __first,
+ _ForwardIterator __last, std::forward_iterator_tag);
+
+ void
+ _M_insert_aux(iterator __position, bool __x);
+
+ size_type
+ _M_check_len(size_type __n, const char* __s) const
+ {
+ if (max_size() - size() < __n)
+ __throw_length_error(__N(__s));
+
+ const size_type __len = size() + std::max(size(), __n);
+ return (__len < size() || __len > max_size()) ? max_size() : __len;
+ }
+
+ void
+ _M_erase_at_end(iterator __pos)
+ { this->_M_impl._M_finish = __pos; }
+ };
+
+_GLIBCXX_END_NESTED_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/bits/stl_construct.h b/i686-linux/include/c++/4.4.3/bits/stl_construct.h
new file mode 100644
index 0000000..9df37fe
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/stl_construct.h
@@ -0,0 +1,148 @@
+// nonstandard construct and destroy functions -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_construct.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_CONSTRUCT_H
+#define _STL_CONSTRUCT_H 1
+
+#include <new>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * Constructs an object in existing memory by invoking an allocated
+ * object's constructor with an initializer.
+ */
+ template<typename _T1, typename _T2>
+ inline void
+ _Construct(_T1* __p, const _T2& __value)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 402. wrong new expression in [some_]allocator::construct
+ ::new(static_cast<void*>(__p)) _T1(__value);
+ }
+
+ /**
+ * Destroy the object pointed to by a pointer type.
+ */
+ template<typename _Tp>
+ inline void
+ _Destroy(_Tp* __pointer)
+ { __pointer->~_Tp(); }
+
+ template<bool>
+ struct _Destroy_aux
+ {
+ template<typename _ForwardIterator>
+ static void
+ __destroy(_ForwardIterator __first, _ForwardIterator __last)
+ {
+ for (; __first != __last; ++__first)
+ std::_Destroy(&*__first);
+ }
+ };
+
+ template<>
+ struct _Destroy_aux<true>
+ {
+ template<typename _ForwardIterator>
+ static void
+ __destroy(_ForwardIterator, _ForwardIterator) { }
+ };
+
+ /**
+ * Destroy a range of objects. If the value_type of the object has
+ * a trivial destructor, the compiler should optimize all of this
+ * away, otherwise the objects' destructors must be invoked.
+ */
+ template<typename _ForwardIterator>
+ inline void
+ _Destroy(_ForwardIterator __first, _ForwardIterator __last)
+ {
+ typedef typename iterator_traits<_ForwardIterator>::value_type
+ _Value_type;
+ std::_Destroy_aux<__has_trivial_destructor(_Value_type)>::
+ __destroy(__first, __last);
+ }
+
+ /**
+ * Destroy a range of objects using the supplied allocator. For
+ * nondefault allocators we do not optimize away invocation of
+ * destroy() even if _Tp has a trivial destructor.
+ */
+
+ template <typename _Tp> class allocator;
+
+ template<typename _ForwardIterator, typename _Allocator>
+ void
+ _Destroy(_ForwardIterator __first, _ForwardIterator __last,
+ _Allocator& __alloc)
+ {
+ for (; __first != __last; ++__first)
+ __alloc.destroy(&*__first);
+ }
+
+ template<typename _ForwardIterator, typename _Tp>
+ inline void
+ _Destroy(_ForwardIterator __first, _ForwardIterator __last,
+ allocator<_Tp>&)
+ {
+ _Destroy(__first, __last);
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _STL_CONSTRUCT_H */
+
diff --git a/i686-linux/include/c++/4.4.3/bits/stl_deque.h b/i686-linux/include/c++/4.4.3/bits/stl_deque.h
new file mode 100644
index 0000000..1c20e27
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/stl_deque.h
@@ -0,0 +1,1819 @@
+// Deque implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_deque.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_DEQUE_H
+#define _STL_DEQUE_H 1
+
+#include <bits/concept_check.h>
+#include <bits/stl_iterator_base_types.h>
+#include <bits/stl_iterator_base_funcs.h>
+#include <initializer_list>
+
+_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
+
+ /**
+ * @brief This function controls the size of memory nodes.
+ * @param size The size of an element.
+ * @return The number (not byte size) of elements per node.
+ *
+ * This function started off as a compiler kludge from SGI, but seems to
+ * be a useful wrapper around a repeated constant expression. The '512' is
+ * tunable (and no other code needs to change), but no investigation has
+ * been done since inheriting the SGI code.
+ */
+ inline size_t
+ __deque_buf_size(size_t __size)
+ { return __size < 512 ? size_t(512 / __size) : size_t(1); }
+
+
+ /**
+ * @brief A deque::iterator.
+ *
+ * Quite a bit of intelligence here. Much of the functionality of
+ * deque is actually passed off to this class. A deque holds two
+ * of these internally, marking its valid range. Access to
+ * elements is done as offsets of either of those two, relying on
+ * operator overloading in this class.
+ *
+ * All the functions are op overloads except for _M_set_node.
+ */
+ template<typename _Tp, typename _Ref, typename _Ptr>
+ struct _Deque_iterator
+ {
+ typedef _Deque_iterator<_Tp, _Tp&, _Tp*> iterator;
+ typedef _Deque_iterator<_Tp, const _Tp&, const _Tp*> const_iterator;
+
+ static size_t _S_buffer_size()
+ { return __deque_buf_size(sizeof(_Tp)); }
+
+ typedef std::random_access_iterator_tag iterator_category;
+ typedef _Tp value_type;
+ typedef _Ptr pointer;
+ typedef _Ref reference;
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Tp** _Map_pointer;
+ typedef _Deque_iterator _Self;
+
+ _Tp* _M_cur;
+ _Tp* _M_first;
+ _Tp* _M_last;
+ _Map_pointer _M_node;
+
+ _Deque_iterator(_Tp* __x, _Map_pointer __y)
+ : _M_cur(__x), _M_first(*__y),
+ _M_last(*__y + _S_buffer_size()), _M_node(__y) { }
+
+ _Deque_iterator()
+ : _M_cur(0), _M_first(0), _M_last(0), _M_node(0) { }
+
+ _Deque_iterator(const iterator& __x)
+ : _M_cur(__x._M_cur), _M_first(__x._M_first),
+ _M_last(__x._M_last), _M_node(__x._M_node) { }
+
+ reference
+ operator*() const
+ { return *_M_cur; }
+
+ pointer
+ operator->() const
+ { return _M_cur; }
+
+ _Self&
+ operator++()
+ {
+ ++_M_cur;
+ if (_M_cur == _M_last)
+ {
+ _M_set_node(_M_node + 1);
+ _M_cur = _M_first;
+ }
+ return *this;
+ }
+
+ _Self
+ operator++(int)
+ {
+ _Self __tmp = *this;
+ ++*this;
+ return __tmp;
+ }
+
+ _Self&
+ operator--()
+ {
+ if (_M_cur == _M_first)
+ {
+ _M_set_node(_M_node - 1);
+ _M_cur = _M_last;
+ }
+ --_M_cur;
+ return *this;
+ }
+
+ _Self
+ operator--(int)
+ {
+ _Self __tmp = *this;
+ --*this;
+ return __tmp;
+ }
+
+ _Self&
+ operator+=(difference_type __n)
+ {
+ const difference_type __offset = __n + (_M_cur - _M_first);
+ if (__offset >= 0 && __offset < difference_type(_S_buffer_size()))
+ _M_cur += __n;
+ else
+ {
+ const difference_type __node_offset =
+ __offset > 0 ? __offset / difference_type(_S_buffer_size())
+ : -difference_type((-__offset - 1)
+ / _S_buffer_size()) - 1;
+ _M_set_node(_M_node + __node_offset);
+ _M_cur = _M_first + (__offset - __node_offset
+ * difference_type(_S_buffer_size()));
+ }
+ return *this;
+ }
+
+ _Self
+ operator+(difference_type __n) const
+ {
+ _Self __tmp = *this;
+ return __tmp += __n;
+ }
+
+ _Self&
+ operator-=(difference_type __n)
+ { return *this += -__n; }
+
+ _Self
+ operator-(difference_type __n) const
+ {
+ _Self __tmp = *this;
+ return __tmp -= __n;
+ }
+
+ reference
+ operator[](difference_type __n) const
+ { return *(*this + __n); }
+
+ /**
+ * Prepares to traverse new_node. Sets everything except
+ * _M_cur, which should therefore be set by the caller
+ * immediately afterwards, based on _M_first and _M_last.
+ */
+ void
+ _M_set_node(_Map_pointer __new_node)
+ {
+ _M_node = __new_node;
+ _M_first = *__new_node;
+ _M_last = _M_first + difference_type(_S_buffer_size());
+ }
+ };
+
+ // Note: we also provide overloads whose operands are of the same type in
+ // order to avoid ambiguous overload resolution when std::rel_ops operators
+ // are in scope (for additional details, see libstdc++/3628)
+ template<typename _Tp, typename _Ref, typename _Ptr>
+ inline bool
+ operator==(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
+ const _Deque_iterator<_Tp, _Ref, _Ptr>& __y)
+ { return __x._M_cur == __y._M_cur; }
+
+ template<typename _Tp, typename _RefL, typename _PtrL,
+ typename _RefR, typename _PtrR>
+ inline bool
+ operator==(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
+ const _Deque_iterator<_Tp, _RefR, _PtrR>& __y)
+ { return __x._M_cur == __y._M_cur; }
+
+ template<typename _Tp, typename _Ref, typename _Ptr>
+ inline bool
+ operator!=(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
+ const _Deque_iterator<_Tp, _Ref, _Ptr>& __y)
+ { return !(__x == __y); }
+
+ template<typename _Tp, typename _RefL, typename _PtrL,
+ typename _RefR, typename _PtrR>
+ inline bool
+ operator!=(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
+ const _Deque_iterator<_Tp, _RefR, _PtrR>& __y)
+ { return !(__x == __y); }
+
+ template<typename _Tp, typename _Ref, typename _Ptr>
+ inline bool
+ operator<(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
+ const _Deque_iterator<_Tp, _Ref, _Ptr>& __y)
+ { return (__x._M_node == __y._M_node) ? (__x._M_cur < __y._M_cur)
+ : (__x._M_node < __y._M_node); }
+
+ template<typename _Tp, typename _RefL, typename _PtrL,
+ typename _RefR, typename _PtrR>
+ inline bool
+ operator<(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
+ const _Deque_iterator<_Tp, _RefR, _PtrR>& __y)
+ { return (__x._M_node == __y._M_node) ? (__x._M_cur < __y._M_cur)
+ : (__x._M_node < __y._M_node); }
+
+ template<typename _Tp, typename _Ref, typename _Ptr>
+ inline bool
+ operator>(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
+ const _Deque_iterator<_Tp, _Ref, _Ptr>& __y)
+ { return __y < __x; }
+
+ template<typename _Tp, typename _RefL, typename _PtrL,
+ typename _RefR, typename _PtrR>
+ inline bool
+ operator>(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
+ const _Deque_iterator<_Tp, _RefR, _PtrR>& __y)
+ { return __y < __x; }
+
+ template<typename _Tp, typename _Ref, typename _Ptr>
+ inline bool
+ operator<=(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
+ const _Deque_iterator<_Tp, _Ref, _Ptr>& __y)
+ { return !(__y < __x); }
+
+ template<typename _Tp, typename _RefL, typename _PtrL,
+ typename _RefR, typename _PtrR>
+ inline bool
+ operator<=(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
+ const _Deque_iterator<_Tp, _RefR, _PtrR>& __y)
+ { return !(__y < __x); }
+
+ template<typename _Tp, typename _Ref, typename _Ptr>
+ inline bool
+ operator>=(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
+ const _Deque_iterator<_Tp, _Ref, _Ptr>& __y)
+ { return !(__x < __y); }
+
+ template<typename _Tp, typename _RefL, typename _PtrL,
+ typename _RefR, typename _PtrR>
+ inline bool
+ operator>=(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
+ const _Deque_iterator<_Tp, _RefR, _PtrR>& __y)
+ { return !(__x < __y); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // According to the resolution of DR179 not only the various comparison
+ // operators but also operator- must accept mixed iterator/const_iterator
+ // parameters.
+ template<typename _Tp, typename _Ref, typename _Ptr>
+ inline typename _Deque_iterator<_Tp, _Ref, _Ptr>::difference_type
+ operator-(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
+ const _Deque_iterator<_Tp, _Ref, _Ptr>& __y)
+ {
+ return typename _Deque_iterator<_Tp, _Ref, _Ptr>::difference_type
+ (_Deque_iterator<_Tp, _Ref, _Ptr>::_S_buffer_size())
+ * (__x._M_node - __y._M_node - 1) + (__x._M_cur - __x._M_first)
+ + (__y._M_last - __y._M_cur);
+ }
+
+ template<typename _Tp, typename _RefL, typename _PtrL,
+ typename _RefR, typename _PtrR>
+ inline typename _Deque_iterator<_Tp, _RefL, _PtrL>::difference_type
+ operator-(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
+ const _Deque_iterator<_Tp, _RefR, _PtrR>& __y)
+ {
+ return typename _Deque_iterator<_Tp, _RefL, _PtrL>::difference_type
+ (_Deque_iterator<_Tp, _RefL, _PtrL>::_S_buffer_size())
+ * (__x._M_node - __y._M_node - 1) + (__x._M_cur - __x._M_first)
+ + (__y._M_last - __y._M_cur);
+ }
+
+ template<typename _Tp, typename _Ref, typename _Ptr>
+ inline _Deque_iterator<_Tp, _Ref, _Ptr>
+ operator+(ptrdiff_t __n, const _Deque_iterator<_Tp, _Ref, _Ptr>& __x)
+ { return __x + __n; }
+
+ template<typename _Tp>
+ void
+ fill(const _Deque_iterator<_Tp, _Tp&, _Tp*>& __first,
+ const _Deque_iterator<_Tp, _Tp&, _Tp*>& __last, const _Tp& __value);
+
+ /**
+ * Deque base class. This class provides the unified face for %deque's
+ * allocation. This class's constructor and destructor allocate and
+ * deallocate (but do not initialize) storage. This makes %exception
+ * safety easier.
+ *
+ * Nothing in this class ever constructs or destroys an actual Tp element.
+ * (Deque handles that itself.) Only/All memory management is performed
+ * here.
+ */
+ template<typename _Tp, typename _Alloc>
+ class _Deque_base
+ {
+ public:
+ typedef _Alloc allocator_type;
+
+ allocator_type
+ get_allocator() const
+ { return allocator_type(_M_get_Tp_allocator()); }
+
+ typedef _Deque_iterator<_Tp, _Tp&, _Tp*> iterator;
+ typedef _Deque_iterator<_Tp, const _Tp&, const _Tp*> const_iterator;
+
+ _Deque_base()
+ : _M_impl()
+ { _M_initialize_map(0); }
+
+ _Deque_base(const allocator_type& __a, size_t __num_elements)
+ : _M_impl(__a)
+ { _M_initialize_map(__num_elements); }
+
+ _Deque_base(const allocator_type& __a)
+ : _M_impl(__a)
+ { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ _Deque_base(_Deque_base&& __x)
+ : _M_impl(__x._M_get_Tp_allocator())
+ {
+ _M_initialize_map(0);
+ if (__x._M_impl._M_map)
+ {
+ std::swap(this->_M_impl._M_start, __x._M_impl._M_start);
+ std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish);
+ std::swap(this->_M_impl._M_map, __x._M_impl._M_map);
+ std::swap(this->_M_impl._M_map_size, __x._M_impl._M_map_size);
+ }
+ }
+#endif
+
+ ~_Deque_base();
+
+ protected:
+ //This struct encapsulates the implementation of the std::deque
+ //standard container and at the same time makes use of the EBO
+ //for empty allocators.
+ typedef typename _Alloc::template rebind<_Tp*>::other _Map_alloc_type;
+
+ 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()
+ { }
+
+ _Deque_impl(const _Tp_alloc_type& __a)
+ : _Tp_alloc_type(__a), _M_map(0), _M_map_size(0),
+ _M_start(), _M_finish()
+ { }
+ };
+
+ _Tp_alloc_type&
+ _M_get_Tp_allocator()
+ { return *static_cast<_Tp_alloc_type*>(&this->_M_impl); }
+
+ const _Tp_alloc_type&
+ _M_get_Tp_allocator() const
+ { return *static_cast<const _Tp_alloc_type*>(&this->_M_impl); }
+
+ _Map_alloc_type
+ _M_get_map_allocator() const
+ { return _Map_alloc_type(_M_get_Tp_allocator()); }
+
+ _Tp*
+ _M_allocate_node()
+ {
+ return _M_impl._Tp_alloc_type::allocate(__deque_buf_size(sizeof(_Tp)));
+ }
+
+ void
+ _M_deallocate_node(_Tp* __p)
+ {
+ _M_impl._Tp_alloc_type::deallocate(__p, __deque_buf_size(sizeof(_Tp)));
+ }
+
+ _Tp**
+ _M_allocate_map(size_t __n)
+ { return _M_get_map_allocator().allocate(__n); }
+
+ void
+ _M_deallocate_map(_Tp** __p, size_t __n)
+ { _M_get_map_allocator().deallocate(__p, __n); }
+
+ protected:
+ void _M_initialize_map(size_t);
+ void _M_create_nodes(_Tp** __nstart, _Tp** __nfinish);
+ void _M_destroy_nodes(_Tp** __nstart, _Tp** __nfinish);
+ enum { _S_initial_map_size = 8 };
+
+ _Deque_impl _M_impl;
+ };
+
+ template<typename _Tp, typename _Alloc>
+ _Deque_base<_Tp, _Alloc>::
+ ~_Deque_base()
+ {
+ if (this->_M_impl._M_map)
+ {
+ _M_destroy_nodes(this->_M_impl._M_start._M_node,
+ this->_M_impl._M_finish._M_node + 1);
+ _M_deallocate_map(this->_M_impl._M_map, this->_M_impl._M_map_size);
+ }
+ }
+
+ /**
+ * @brief Layout storage.
+ * @param num_elements The count of T's for which to allocate space
+ * at first.
+ * @return Nothing.
+ *
+ * The initial underlying memory layout is a bit complicated...
+ */
+ template<typename _Tp, typename _Alloc>
+ void
+ _Deque_base<_Tp, _Alloc>::
+ _M_initialize_map(size_t __num_elements)
+ {
+ const size_t __num_nodes = (__num_elements/ __deque_buf_size(sizeof(_Tp))
+ + 1);
+
+ this->_M_impl._M_map_size = std::max((size_t) _S_initial_map_size,
+ size_t(__num_nodes + 2));
+ this->_M_impl._M_map = _M_allocate_map(this->_M_impl._M_map_size);
+
+ // For "small" maps (needing less than _M_map_size nodes), allocation
+ // starts in the middle elements and grows outwards. So nstart may be
+ // the beginning of _M_map, but for small maps it may be as far in as
+ // _M_map+3.
+
+ _Tp** __nstart = (this->_M_impl._M_map
+ + (this->_M_impl._M_map_size - __num_nodes) / 2);
+ _Tp** __nfinish = __nstart + __num_nodes;
+
+ __try
+ { _M_create_nodes(__nstart, __nfinish); }
+ __catch(...)
+ {
+ _M_deallocate_map(this->_M_impl._M_map, this->_M_impl._M_map_size);
+ this->_M_impl._M_map = 0;
+ this->_M_impl._M_map_size = 0;
+ __throw_exception_again;
+ }
+
+ this->_M_impl._M_start._M_set_node(__nstart);
+ this->_M_impl._M_finish._M_set_node(__nfinish - 1);
+ this->_M_impl._M_start._M_cur = _M_impl._M_start._M_first;
+ this->_M_impl._M_finish._M_cur = (this->_M_impl._M_finish._M_first
+ + __num_elements
+ % __deque_buf_size(sizeof(_Tp)));
+ }
+
+ template<typename _Tp, typename _Alloc>
+ void
+ _Deque_base<_Tp, _Alloc>::
+ _M_create_nodes(_Tp** __nstart, _Tp** __nfinish)
+ {
+ _Tp** __cur;
+ __try
+ {
+ for (__cur = __nstart; __cur < __nfinish; ++__cur)
+ *__cur = this->_M_allocate_node();
+ }
+ __catch(...)
+ {
+ _M_destroy_nodes(__nstart, __cur);
+ __throw_exception_again;
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ void
+ _Deque_base<_Tp, _Alloc>::
+ _M_destroy_nodes(_Tp** __nstart, _Tp** __nfinish)
+ {
+ for (_Tp** __n = __nstart; __n < __nfinish; ++__n)
+ _M_deallocate_node(*__n);
+ }
+
+ /**
+ * @brief A standard container using fixed-size memory allocation and
+ * constant-time manipulation of elements at either end.
+ *
+ * @ingroup sequences
+ *
+ * Meets the requirements of a <a href="tables.html#65">container</a>, a
+ * <a href="tables.html#66">reversible container</a>, and a
+ * <a href="tables.html#67">sequence</a>, including the
+ * <a href="tables.html#68">optional sequence requirements</a>.
+ *
+ * In previous HP/SGI versions of deque, there was an extra template
+ * parameter so users could control the node size. This extension turned
+ * out to violate the C++ standard (it can be detected using template
+ * template parameters), and it was removed.
+ *
+ * Here's how a deque<Tp> manages memory. Each deque has 4 members:
+ *
+ * - Tp** _M_map
+ * - size_t _M_map_size
+ * - iterator _M_start, _M_finish
+ *
+ * map_size is at least 8. %map is an array of map_size
+ * pointers-to-"nodes". (The name %map has nothing to do with the
+ * std::map class, and "nodes" should not be confused with
+ * std::list's usage of "node".)
+ *
+ * A "node" has no specific type name as such, but it is referred
+ * to as "node" in this file. It is a simple array-of-Tp. If Tp
+ * is very large, there will be one Tp element per node (i.e., an
+ * "array" of one). For non-huge Tp's, node size is inversely
+ * related to Tp size: the larger the Tp, the fewer Tp's will fit
+ * in a node. The goal here is to keep the total size of a node
+ * relatively small and constant over different Tp's, to improve
+ * allocator efficiency.
+ *
+ * Not every pointer in the %map array will point to a node. If
+ * the initial number of elements in the deque is small, the
+ * /middle/ %map pointers will be valid, and the ones at the edges
+ * will be unused. This same situation will arise as the %map
+ * grows: available %map pointers, if any, will be on the ends. As
+ * new nodes are created, only a subset of the %map's pointers need
+ * to be copied "outward".
+ *
+ * Class invariants:
+ * - For any nonsingular iterator i:
+ * - i.node points to a member of the %map array. (Yes, you read that
+ * correctly: i.node does not actually point to a node.) The member of
+ * the %map array is what actually points to the node.
+ * - i.first == *(i.node) (This points to the node (first Tp element).)
+ * - i.last == i.first + node_size
+ * - i.cur is a pointer in the range [i.first, i.last). NOTE:
+ * the implication of this is that i.cur is always a dereferenceable
+ * pointer, even if i is a past-the-end iterator.
+ * - Start and Finish are always nonsingular iterators. NOTE: this
+ * means that an empty deque must have one node, a deque with <N
+ * elements (where N is the node buffer size) must have one node, a
+ * deque with N through (2N-1) elements must have two nodes, etc.
+ * - For every node other than start.node and finish.node, every
+ * element in the node is an initialized object. If start.node ==
+ * finish.node, then [start.cur, finish.cur) are initialized
+ * objects, and the elements outside that range are uninitialized
+ * storage. Otherwise, [start.cur, start.last) and [finish.first,
+ * finish.cur) are initialized objects, and [start.first, start.cur)
+ * and [finish.cur, finish.last) are uninitialized storage.
+ * - [%map, %map + map_size) is a valid, non-empty range.
+ * - [start.node, finish.node] is a valid range contained within
+ * [%map, %map + map_size).
+ * - A pointer in the range [%map, %map + map_size) points to an allocated
+ * node if and only if the pointer is in the range
+ * [start.node, finish.node].
+ *
+ * Here's the magic: nothing in deque is "aware" of the discontiguous
+ * storage!
+ *
+ * The memory setup and layout occurs in the parent, _Base, and the iterator
+ * class is entirely responsible for "leaping" from one node to the next.
+ * All the implementation routines for deque itself work only through the
+ * start and finish iterators. This keeps the routines simple and sane,
+ * and we can use other standard algorithms as well.
+ */
+ template<typename _Tp, typename _Alloc = std::allocator<_Tp> >
+ class deque : protected _Deque_base<_Tp, _Alloc>
+ {
+ // concept requirements
+ typedef typename _Alloc::value_type _Alloc_value_type;
+ __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
+ __glibcxx_class_requires2(_Tp, _Alloc_value_type, _SameTypeConcept)
+
+ typedef _Deque_base<_Tp, _Alloc> _Base;
+ typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
+
+ public:
+ typedef _Tp value_type;
+ typedef typename _Tp_alloc_type::pointer pointer;
+ typedef typename _Tp_alloc_type::const_pointer const_pointer;
+ typedef typename _Tp_alloc_type::reference reference;
+ typedef typename _Tp_alloc_type::const_reference const_reference;
+ typedef typename _Base::iterator iterator;
+ typedef typename _Base::const_iterator const_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Alloc allocator_type;
+
+ protected:
+ typedef pointer* _Map_pointer;
+
+ static size_t _S_buffer_size()
+ { return __deque_buf_size(sizeof(_Tp)); }
+
+ // Functions controlling memory layout, and nothing else.
+ using _Base::_M_initialize_map;
+ using _Base::_M_create_nodes;
+ using _Base::_M_destroy_nodes;
+ using _Base::_M_allocate_node;
+ using _Base::_M_deallocate_node;
+ using _Base::_M_allocate_map;
+ using _Base::_M_deallocate_map;
+ using _Base::_M_get_Tp_allocator;
+
+ /**
+ * A total of four data members accumulated down the hierarchy.
+ * May be accessed via _M_impl.*
+ */
+ using _Base::_M_impl;
+
+ public:
+ // [23.2.1.1] construct/copy/destroy
+ // (assign() and get_allocator() are also listed in this section)
+ /**
+ * @brief Default constructor creates no elements.
+ */
+ deque()
+ : _Base() { }
+
+ /**
+ * @brief Creates a %deque with no elements.
+ * @param a An allocator object.
+ */
+ explicit
+ deque(const allocator_type& __a)
+ : _Base(__a, 0) { }
+
+ /**
+ * @brief Creates a %deque with copies of an exemplar element.
+ * @param n The number of elements to initially create.
+ * @param value An element to copy.
+ * @param a An allocator.
+ *
+ * This constructor fills the %deque with @a n copies of @a value.
+ */
+ explicit
+ deque(size_type __n, const value_type& __value = value_type(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__a, __n)
+ { _M_fill_initialize(__value); }
+
+ /**
+ * @brief %Deque copy constructor.
+ * @param x A %deque of identical element and allocator types.
+ *
+ * The newly-created %deque uses a copy of the allocation object used
+ * by @a x.
+ */
+ deque(const deque& __x)
+ : _Base(__x._M_get_Tp_allocator(), __x.size())
+ { std::__uninitialized_copy_a(__x.begin(), __x.end(),
+ this->_M_impl._M_start,
+ _M_get_Tp_allocator()); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief %Deque move constructor.
+ * @param x A %deque of identical element and allocator types.
+ *
+ * The newly-created %deque contains the exact contents of @a x.
+ * The contents of @a x are a valid, but unspecified %deque.
+ */
+ deque(deque&& __x)
+ : _Base(std::forward<_Base>(__x)) { }
+
+ /**
+ * @brief Builds a %deque from an initializer list.
+ * @param l An initializer_list.
+ * @param a An allocator object.
+ *
+ * Create a %deque consisting of copies of the elements in the
+ * initializer_list @a l.
+ *
+ * This will call the element type's copy constructor N times
+ * (where N is l.size()) and do no memory reallocation.
+ */
+ deque(initializer_list<value_type> __l,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ {
+ _M_range_initialize(__l.begin(), __l.end(),
+ random_access_iterator_tag());
+ }
+#endif
+
+ /**
+ * @brief Builds a %deque from a range.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param a An allocator object.
+ *
+ * Create a %deque consisting of copies of the elements from [first,
+ * last).
+ *
+ * If the iterators are forward, bidirectional, or random-access, then
+ * this will call the elements' copy constructor N times (where N is
+ * distance(first,last)) and do no memory reallocation. But if only
+ * input iterators are used, then this will do at most 2N calls to the
+ * copy constructor, and logN memory reallocations.
+ */
+ template<typename _InputIterator>
+ deque(_InputIterator __first, _InputIterator __last,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ {
+ // Check whether it's an integral type. If so, it's not an iterator.
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ _M_initialize_dispatch(__first, __last, _Integral());
+ }
+
+ /**
+ * The dtor only erases the elements, and note that if the elements
+ * themselves are pointers, the pointed-to memory is not touched in any
+ * way. Managing the pointer is the user's responsibility.
+ */
+ ~deque()
+ { _M_destroy_data(begin(), end(), _M_get_Tp_allocator()); }
+
+ /**
+ * @brief %Deque assignment operator.
+ * @param x A %deque of identical element and allocator types.
+ *
+ * All the elements of @a x are copied, but unlike the copy constructor,
+ * the allocator object is not copied.
+ */
+ deque&
+ operator=(const deque& __x);
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief %Deque move assignment operator.
+ * @param x A %deque of identical element and allocator types.
+ *
+ * The contents of @a x are moved into this deque (without copying).
+ * @a x is a valid, but unspecified %deque.
+ */
+ deque&
+ operator=(deque&& __x)
+ {
+ // NB: DR 675.
+ this->clear();
+ this->swap(__x);
+ return *this;
+ }
+
+ /**
+ * @brief Assigns an initializer list to a %deque.
+ * @param l An initializer_list.
+ *
+ * This function fills a %deque with copies of the elements in the
+ * initializer_list @a l.
+ *
+ * Note that the assignment completely changes the %deque and that the
+ * resulting %deque's size is the same as the number of elements
+ * assigned. Old data may be lost.
+ */
+ deque&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->assign(__l.begin(), __l.end());
+ return *this;
+ }
+#endif
+
+ /**
+ * @brief Assigns a given value to a %deque.
+ * @param n Number of elements to be assigned.
+ * @param val Value to be assigned.
+ *
+ * This function fills a %deque with @a n copies of the given
+ * value. Note that the assignment completely changes the
+ * %deque and that the resulting %deque's size is the same as
+ * the number of elements assigned. Old data may be lost.
+ */
+ void
+ assign(size_type __n, const value_type& __val)
+ { _M_fill_assign(__n, __val); }
+
+ /**
+ * @brief Assigns a range to a %deque.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ *
+ * This function fills a %deque with copies of the elements in the
+ * range [first,last).
+ *
+ * Note that the assignment completely changes the %deque and that the
+ * resulting %deque's size is the same as the number of elements
+ * assigned. Old data may be lost.
+ */
+ template<typename _InputIterator>
+ void
+ assign(_InputIterator __first, _InputIterator __last)
+ {
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ _M_assign_dispatch(__first, __last, _Integral());
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Assigns an initializer list to a %deque.
+ * @param l An initializer_list.
+ *
+ * This function fills a %deque with copies of the elements in the
+ * initializer_list @a l.
+ *
+ * Note that the assignment completely changes the %deque and that the
+ * resulting %deque's size is the same as the number of elements
+ * assigned. Old data may be lost.
+ */
+ void
+ assign(initializer_list<value_type> __l)
+ { this->assign(__l.begin(), __l.end()); }
+#endif
+
+ /// Get a copy of the memory allocation object.
+ allocator_type
+ get_allocator() const
+ { return _Base::get_allocator(); }
+
+ // iterators
+ /**
+ * Returns a read/write iterator that points to the first element in the
+ * %deque. Iteration is done in ordinary element order.
+ */
+ iterator
+ begin()
+ { return this->_M_impl._M_start; }
+
+ /**
+ * Returns a read-only (constant) iterator that points to the first
+ * element in the %deque. Iteration is done in ordinary element order.
+ */
+ const_iterator
+ begin() const
+ { return this->_M_impl._M_start; }
+
+ /**
+ * Returns a read/write iterator that points one past the last
+ * element in the %deque. Iteration is done in ordinary
+ * element order.
+ */
+ iterator
+ end()
+ { return this->_M_impl._M_finish; }
+
+ /**
+ * Returns a read-only (constant) iterator that points one past
+ * the last element in the %deque. Iteration is done in
+ * ordinary element order.
+ */
+ const_iterator
+ end() const
+ { return this->_M_impl._M_finish; }
+
+ /**
+ * Returns a read/write reverse iterator that points to the
+ * last element in the %deque. Iteration is done in reverse
+ * element order.
+ */
+ reverse_iterator
+ rbegin()
+ { return reverse_iterator(this->_M_impl._M_finish); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points
+ * to the last element in the %deque. Iteration is done in
+ * reverse element order.
+ */
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(this->_M_impl._M_finish); }
+
+ /**
+ * Returns a read/write reverse iterator that points to one
+ * before the first element in the %deque. Iteration is done
+ * in reverse element order.
+ */
+ reverse_iterator
+ rend()
+ { return reverse_iterator(this->_M_impl._M_start); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points
+ * to one before the first element in the %deque. Iteration is
+ * done in reverse element order.
+ */
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(this->_M_impl._M_start); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * Returns a read-only (constant) iterator that points to the first
+ * element in the %deque. Iteration is done in ordinary element order.
+ */
+ const_iterator
+ cbegin() const
+ { return this->_M_impl._M_start; }
+
+ /**
+ * Returns a read-only (constant) iterator that points one past
+ * the last element in the %deque. Iteration is done in
+ * ordinary element order.
+ */
+ const_iterator
+ cend() const
+ { return this->_M_impl._M_finish; }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points
+ * to the last element in the %deque. Iteration is done in
+ * reverse element order.
+ */
+ const_reverse_iterator
+ crbegin() const
+ { return const_reverse_iterator(this->_M_impl._M_finish); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points
+ * to one before the first element in the %deque. Iteration is
+ * done in reverse element order.
+ */
+ const_reverse_iterator
+ crend() const
+ { return const_reverse_iterator(this->_M_impl._M_start); }
+#endif
+
+ // [23.2.1.2] capacity
+ /** Returns the number of elements in the %deque. */
+ size_type
+ size() const
+ { return this->_M_impl._M_finish - this->_M_impl._M_start; }
+
+ /** Returns the size() of the largest possible %deque. */
+ size_type
+ max_size() const
+ { return _M_get_Tp_allocator().max_size(); }
+
+ /**
+ * @brief Resizes the %deque to the specified number of elements.
+ * @param new_size Number of elements the %deque should contain.
+ * @param x Data with which new elements should be populated.
+ *
+ * This function will %resize the %deque to the specified
+ * number of elements. If the number is smaller than the
+ * %deque's current size the %deque is truncated, otherwise the
+ * %deque is extended and new elements are populated with given
+ * data.
+ */
+ void
+ resize(size_type __new_size, value_type __x = value_type())
+ {
+ const size_type __len = size();
+ if (__new_size < __len)
+ _M_erase_at_end(this->_M_impl._M_start + difference_type(__new_size));
+ else
+ insert(this->_M_impl._M_finish, __new_size - __len, __x);
+ }
+
+ /**
+ * Returns true if the %deque is empty. (Thus begin() would
+ * equal end().)
+ */
+ bool
+ empty() const
+ { return this->_M_impl._M_finish == this->_M_impl._M_start; }
+
+ // element access
+ /**
+ * @brief Subscript access to the data contained in the %deque.
+ * @param n The index of the element for which data should be
+ * accessed.
+ * @return Read/write reference to data.
+ *
+ * This operator allows for easy, array-style, data access.
+ * Note that data access with this operator is unchecked and
+ * out_of_range lookups are not defined. (For checked lookups
+ * see at().)
+ */
+ reference
+ operator[](size_type __n)
+ { return this->_M_impl._M_start[difference_type(__n)]; }
+
+ /**
+ * @brief Subscript access to the data contained in the %deque.
+ * @param n The index of the element for which data should be
+ * accessed.
+ * @return Read-only (constant) reference to data.
+ *
+ * This operator allows for easy, array-style, data access.
+ * Note that data access with this operator is unchecked and
+ * out_of_range lookups are not defined. (For checked lookups
+ * see at().)
+ */
+ const_reference
+ operator[](size_type __n) const
+ { return this->_M_impl._M_start[difference_type(__n)]; }
+
+ protected:
+ /// Safety check used only from at().
+ void
+ _M_range_check(size_type __n) const
+ {
+ if (__n >= this->size())
+ __throw_out_of_range(__N("deque::_M_range_check"));
+ }
+
+ public:
+ /**
+ * @brief Provides access to the data contained in the %deque.
+ * @param n The index of the element for which data should be
+ * accessed.
+ * @return Read/write reference to data.
+ * @throw std::out_of_range If @a n is an invalid index.
+ *
+ * This function provides for safer data access. The parameter
+ * is first checked that it is in the range of the deque. The
+ * function throws out_of_range if the check fails.
+ */
+ reference
+ at(size_type __n)
+ {
+ _M_range_check(__n);
+ return (*this)[__n];
+ }
+
+ /**
+ * @brief Provides access to the data contained in the %deque.
+ * @param n The index of the element for which data should be
+ * accessed.
+ * @return Read-only (constant) reference to data.
+ * @throw std::out_of_range If @a n is an invalid index.
+ *
+ * This function provides for safer data access. The parameter is first
+ * checked that it is in the range of the deque. The function throws
+ * out_of_range if the check fails.
+ */
+ const_reference
+ at(size_type __n) const
+ {
+ _M_range_check(__n);
+ return (*this)[__n];
+ }
+
+ /**
+ * Returns a read/write reference to the data at the first
+ * element of the %deque.
+ */
+ reference
+ front()
+ { return *begin(); }
+
+ /**
+ * Returns a read-only (constant) reference to the data at the first
+ * element of the %deque.
+ */
+ const_reference
+ front() const
+ { return *begin(); }
+
+ /**
+ * Returns a read/write reference to the data at the last element of the
+ * %deque.
+ */
+ reference
+ back()
+ {
+ iterator __tmp = end();
+ --__tmp;
+ return *__tmp;
+ }
+
+ /**
+ * Returns a read-only (constant) reference to the data at the last
+ * element of the %deque.
+ */
+ const_reference
+ back() const
+ {
+ const_iterator __tmp = end();
+ --__tmp;
+ return *__tmp;
+ }
+
+ // [23.2.1.2] modifiers
+ /**
+ * @brief Add data to the front of the %deque.
+ * @param x Data to be added.
+ *
+ * This is a typical stack operation. The function creates an
+ * element at the front of the %deque and assigns the given
+ * data to it. Due to the nature of a %deque this operation
+ * can be done in constant time.
+ */
+ void
+ push_front(const value_type& __x)
+ {
+ if (this->_M_impl._M_start._M_cur != this->_M_impl._M_start._M_first)
+ {
+ this->_M_impl.construct(this->_M_impl._M_start._M_cur - 1, __x);
+ --this->_M_impl._M_start._M_cur;
+ }
+ else
+ _M_push_front_aux(__x);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ push_front(value_type&& __x)
+ { emplace_front(std::move(__x)); }
+
+ template<typename... _Args>
+ void
+ emplace_front(_Args&&... __args);
+#endif
+
+ /**
+ * @brief Add data to the end of the %deque.
+ * @param x Data to be added.
+ *
+ * This is a typical stack operation. The function creates an
+ * element at the end of the %deque and assigns the given data
+ * to it. Due to the nature of a %deque this operation can be
+ * done in constant time.
+ */
+ void
+ push_back(const value_type& __x)
+ {
+ if (this->_M_impl._M_finish._M_cur
+ != this->_M_impl._M_finish._M_last - 1)
+ {
+ this->_M_impl.construct(this->_M_impl._M_finish._M_cur, __x);
+ ++this->_M_impl._M_finish._M_cur;
+ }
+ else
+ _M_push_back_aux(__x);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ push_back(value_type&& __x)
+ { emplace_back(std::move(__x)); }
+
+ template<typename... _Args>
+ void
+ emplace_back(_Args&&... __args);
+#endif
+
+ /**
+ * @brief Removes first element.
+ *
+ * This is a typical stack operation. It shrinks the %deque by one.
+ *
+ * Note that no data is returned, and if the first element's data is
+ * needed, it should be retrieved before pop_front() is called.
+ */
+ void
+ pop_front()
+ {
+ if (this->_M_impl._M_start._M_cur
+ != this->_M_impl._M_start._M_last - 1)
+ {
+ this->_M_impl.destroy(this->_M_impl._M_start._M_cur);
+ ++this->_M_impl._M_start._M_cur;
+ }
+ else
+ _M_pop_front_aux();
+ }
+
+ /**
+ * @brief Removes last element.
+ *
+ * This is a typical stack operation. It shrinks the %deque by one.
+ *
+ * Note that no data is returned, and if the last element's data is
+ * needed, it should be retrieved before pop_back() is called.
+ */
+ void
+ pop_back()
+ {
+ if (this->_M_impl._M_finish._M_cur
+ != this->_M_impl._M_finish._M_first)
+ {
+ --this->_M_impl._M_finish._M_cur;
+ this->_M_impl.destroy(this->_M_impl._M_finish._M_cur);
+ }
+ else
+ _M_pop_back_aux();
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Inserts an object in %deque before specified iterator.
+ * @param position An iterator into the %deque.
+ * @param args Arguments.
+ * @return An iterator that points to the inserted data.
+ *
+ * This function will insert an object of type T constructed
+ * with T(std::forward<Args>(args)...) before the specified location.
+ */
+ template<typename... _Args>
+ iterator
+ emplace(iterator __position, _Args&&... __args);
+#endif
+
+ /**
+ * @brief Inserts given value into %deque before specified iterator.
+ * @param position An iterator into the %deque.
+ * @param x Data to be inserted.
+ * @return An iterator that points to the inserted data.
+ *
+ * This function will insert a copy of the given value before the
+ * specified location.
+ */
+ iterator
+ insert(iterator __position, const value_type& __x);
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Inserts given rvalue into %deque before specified iterator.
+ * @param position An iterator into the %deque.
+ * @param x Data to be inserted.
+ * @return An iterator that points to the inserted data.
+ *
+ * This function will insert a copy of the given rvalue before the
+ * specified location.
+ */
+ iterator
+ insert(iterator __position, value_type&& __x)
+ { return emplace(__position, std::move(__x)); }
+
+ /**
+ * @brief Inserts an initializer list into the %deque.
+ * @param p An iterator into the %deque.
+ * @param l An initializer_list.
+ *
+ * This function will insert copies of the data in the
+ * initializer_list @a l into the %deque before the location
+ * specified by @a p. This is known as "list insert."
+ */
+ void
+ insert(iterator __p, initializer_list<value_type> __l)
+ { this->insert(__p, __l.begin(), __l.end()); }
+#endif
+
+ /**
+ * @brief Inserts a number of copies of given data into the %deque.
+ * @param position An iterator into the %deque.
+ * @param n Number of elements to be inserted.
+ * @param x Data to be inserted.
+ *
+ * This function will insert a specified number of copies of the given
+ * data before the location specified by @a position.
+ */
+ void
+ insert(iterator __position, size_type __n, const value_type& __x)
+ { _M_fill_insert(__position, __n, __x); }
+
+ /**
+ * @brief Inserts a range into the %deque.
+ * @param position An iterator into the %deque.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ *
+ * This function will insert copies of the data in the range
+ * [first,last) into the %deque before the location specified
+ * by @a pos. This is known as "range insert."
+ */
+ template<typename _InputIterator>
+ void
+ insert(iterator __position, _InputIterator __first,
+ _InputIterator __last)
+ {
+ // Check whether it's an integral type. If so, it's not an iterator.
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ _M_insert_dispatch(__position, __first, __last, _Integral());
+ }
+
+ /**
+ * @brief Remove element at given position.
+ * @param position Iterator pointing to element to be erased.
+ * @return An iterator pointing to the next element (or end()).
+ *
+ * This function will erase the element at the given position and thus
+ * shorten the %deque by one.
+ *
+ * The user is cautioned that
+ * this function only erases the element, and that if the element is
+ * itself a pointer, the pointed-to memory is not touched in any way.
+ * Managing the pointer is the user's responsibility.
+ */
+ iterator
+ erase(iterator __position);
+
+ /**
+ * @brief Remove a range of elements.
+ * @param first Iterator pointing to the first element to be erased.
+ * @param last Iterator pointing to one past the last element to be
+ * erased.
+ * @return An iterator pointing to the element pointed to by @a last
+ * prior to erasing (or end()).
+ *
+ * This function will erase the elements in the range [first,last) and
+ * shorten the %deque accordingly.
+ *
+ * The user is cautioned that
+ * this function only erases the elements, and that if the elements
+ * themselves are pointers, the pointed-to memory is not touched in any
+ * way. Managing the pointer is the user's responsibility.
+ */
+ iterator
+ erase(iterator __first, iterator __last);
+
+ /**
+ * @brief Swaps data with another %deque.
+ * @param x A %deque of the same element and allocator types.
+ *
+ * This exchanges the elements between two deques in constant time.
+ * (Four pointers, so it should be quite fast.)
+ * Note that the global std::swap() function is specialized such that
+ * std::swap(d1,d2) will feed to this function.
+ */
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(deque&& __x)
+#else
+ swap(deque& __x)
+#endif
+ {
+ std::swap(this->_M_impl._M_start, __x._M_impl._M_start);
+ std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish);
+ std::swap(this->_M_impl._M_map, __x._M_impl._M_map);
+ std::swap(this->_M_impl._M_map_size, __x._M_impl._M_map_size);
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 431. Swapping containers with unequal allocators.
+ std::__alloc_swap<_Tp_alloc_type>::_S_do_it(_M_get_Tp_allocator(),
+ __x._M_get_Tp_allocator());
+ }
+
+ /**
+ * Erases all the elements. Note that this function only erases the
+ * elements, and that if the elements themselves are pointers, the
+ * pointed-to memory is not touched in any way. Managing the pointer is
+ * the user's responsibility.
+ */
+ void
+ clear()
+ { _M_erase_at_end(begin()); }
+
+ protected:
+ // Internal constructor functions follow.
+
+ // called by the range constructor to implement [23.1.1]/9
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 438. Ambiguity in the "do the right thing" clause
+ template<typename _Integer>
+ void
+ _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type)
+ {
+ _M_initialize_map(static_cast<size_type>(__n));
+ _M_fill_initialize(__x);
+ }
+
+ // called by the range constructor to implement [23.1.1]/9
+ template<typename _InputIterator>
+ void
+ _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
+ __false_type)
+ {
+ typedef typename std::iterator_traits<_InputIterator>::
+ iterator_category _IterCategory;
+ _M_range_initialize(__first, __last, _IterCategory());
+ }
+
+ // called by the second initialize_dispatch above
+ //@{
+ /**
+ * @brief Fills the deque with whatever is in [first,last).
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @return Nothing.
+ *
+ * If the iterators are actually forward iterators (or better), then the
+ * memory layout can be done all at once. Else we move forward using
+ * push_back on each value from the iterator.
+ */
+ template<typename _InputIterator>
+ void
+ _M_range_initialize(_InputIterator __first, _InputIterator __last,
+ std::input_iterator_tag);
+
+ // called by the second initialize_dispatch above
+ template<typename _ForwardIterator>
+ void
+ _M_range_initialize(_ForwardIterator __first, _ForwardIterator __last,
+ std::forward_iterator_tag);
+ //@}
+
+ /**
+ * @brief Fills the %deque with copies of value.
+ * @param value Initial value.
+ * @return Nothing.
+ * @pre _M_start and _M_finish have already been initialized,
+ * but none of the %deque's elements have yet been constructed.
+ *
+ * This function is called only when the user provides an explicit size
+ * (with or without an explicit exemplar value).
+ */
+ void
+ _M_fill_initialize(const value_type& __value);
+
+ // Internal assign functions follow. The *_aux functions do the actual
+ // assignment work for the range versions.
+
+ // called by the range assign to implement [23.1.1]/9
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 438. Ambiguity in the "do the right thing" clause
+ template<typename _Integer>
+ void
+ _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
+ { _M_fill_assign(__n, __val); }
+
+ // called by the range assign to implement [23.1.1]/9
+ template<typename _InputIterator>
+ void
+ _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
+ __false_type)
+ {
+ typedef typename std::iterator_traits<_InputIterator>::
+ iterator_category _IterCategory;
+ _M_assign_aux(__first, __last, _IterCategory());
+ }
+
+ // called by the second assign_dispatch above
+ template<typename _InputIterator>
+ void
+ _M_assign_aux(_InputIterator __first, _InputIterator __last,
+ std::input_iterator_tag);
+
+ // called by the second assign_dispatch above
+ template<typename _ForwardIterator>
+ void
+ _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
+ std::forward_iterator_tag)
+ {
+ const size_type __len = std::distance(__first, __last);
+ if (__len > size())
+ {
+ _ForwardIterator __mid = __first;
+ std::advance(__mid, size());
+ std::copy(__first, __mid, begin());
+ insert(end(), __mid, __last);
+ }
+ else
+ _M_erase_at_end(std::copy(__first, __last, begin()));
+ }
+
+ // Called by assign(n,t), and the range assign when it turns out
+ // to be the same thing.
+ void
+ _M_fill_assign(size_type __n, const value_type& __val)
+ {
+ if (__n > size())
+ {
+ std::fill(begin(), end(), __val);
+ insert(end(), __n - size(), __val);
+ }
+ else
+ {
+ _M_erase_at_end(begin() + difference_type(__n));
+ std::fill(begin(), end(), __val);
+ }
+ }
+
+ //@{
+ /// Helper functions for push_* and pop_*.
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+ void _M_push_back_aux(const value_type&);
+
+ void _M_push_front_aux(const value_type&);
+#else
+ template<typename... _Args>
+ void _M_push_back_aux(_Args&&... __args);
+
+ template<typename... _Args>
+ void _M_push_front_aux(_Args&&... __args);
+#endif
+
+ void _M_pop_back_aux();
+
+ void _M_pop_front_aux();
+ //@}
+
+ // Internal insert functions follow. The *_aux functions do the actual
+ // insertion work when all shortcuts fail.
+
+ // called by the range insert to implement [23.1.1]/9
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 438. Ambiguity in the "do the right thing" clause
+ template<typename _Integer>
+ void
+ _M_insert_dispatch(iterator __pos,
+ _Integer __n, _Integer __x, __true_type)
+ { _M_fill_insert(__pos, __n, __x); }
+
+ // called by the range insert to implement [23.1.1]/9
+ template<typename _InputIterator>
+ void
+ _M_insert_dispatch(iterator __pos,
+ _InputIterator __first, _InputIterator __last,
+ __false_type)
+ {
+ typedef typename std::iterator_traits<_InputIterator>::
+ iterator_category _IterCategory;
+ _M_range_insert_aux(__pos, __first, __last, _IterCategory());
+ }
+
+ // called by the second insert_dispatch above
+ template<typename _InputIterator>
+ void
+ _M_range_insert_aux(iterator __pos, _InputIterator __first,
+ _InputIterator __last, std::input_iterator_tag);
+
+ // called by the second insert_dispatch above
+ template<typename _ForwardIterator>
+ void
+ _M_range_insert_aux(iterator __pos, _ForwardIterator __first,
+ _ForwardIterator __last, std::forward_iterator_tag);
+
+ // Called by insert(p,n,x), and the range insert when it turns out to be
+ // the same thing. Can use fill functions in optimal situations,
+ // otherwise passes off to insert_aux(p,n,x).
+ void
+ _M_fill_insert(iterator __pos, size_type __n, const value_type& __x);
+
+ // called by insert(p,x)
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+ iterator
+ _M_insert_aux(iterator __pos, const value_type& __x);
+#else
+ template<typename... _Args>
+ iterator
+ _M_insert_aux(iterator __pos, _Args&&... __args);
+#endif
+
+ // called by insert(p,n,x) via fill_insert
+ void
+ _M_insert_aux(iterator __pos, size_type __n, const value_type& __x);
+
+ // called by range_insert_aux for forward iterators
+ template<typename _ForwardIterator>
+ void
+ _M_insert_aux(iterator __pos,
+ _ForwardIterator __first, _ForwardIterator __last,
+ size_type __n);
+
+
+ // Internal erase functions follow.
+
+ void
+ _M_destroy_data_aux(iterator __first, iterator __last);
+
+ // Called by ~deque().
+ // NB: Doesn't deallocate the nodes.
+ template<typename _Alloc1>
+ void
+ _M_destroy_data(iterator __first, iterator __last, const _Alloc1&)
+ { _M_destroy_data_aux(__first, __last); }
+
+ void
+ _M_destroy_data(iterator __first, iterator __last,
+ const std::allocator<_Tp>&)
+ {
+ if (!__has_trivial_destructor(value_type))
+ _M_destroy_data_aux(__first, __last);
+ }
+
+ // Called by erase(q1, q2).
+ void
+ _M_erase_at_begin(iterator __pos)
+ {
+ _M_destroy_data(begin(), __pos, _M_get_Tp_allocator());
+ _M_destroy_nodes(this->_M_impl._M_start._M_node, __pos._M_node);
+ this->_M_impl._M_start = __pos;
+ }
+
+ // Called by erase(q1, q2), resize(), clear(), _M_assign_aux,
+ // _M_fill_assign, operator=.
+ void
+ _M_erase_at_end(iterator __pos)
+ {
+ _M_destroy_data(__pos, end(), _M_get_Tp_allocator());
+ _M_destroy_nodes(__pos._M_node + 1,
+ this->_M_impl._M_finish._M_node + 1);
+ this->_M_impl._M_finish = __pos;
+ }
+
+ //@{
+ /// Memory-handling helpers for the previous internal insert functions.
+ iterator
+ _M_reserve_elements_at_front(size_type __n)
+ {
+ const size_type __vacancies = this->_M_impl._M_start._M_cur
+ - this->_M_impl._M_start._M_first;
+ if (__n > __vacancies)
+ _M_new_elements_at_front(__n - __vacancies);
+ return this->_M_impl._M_start - difference_type(__n);
+ }
+
+ iterator
+ _M_reserve_elements_at_back(size_type __n)
+ {
+ const size_type __vacancies = (this->_M_impl._M_finish._M_last
+ - this->_M_impl._M_finish._M_cur) - 1;
+ if (__n > __vacancies)
+ _M_new_elements_at_back(__n - __vacancies);
+ return this->_M_impl._M_finish + difference_type(__n);
+ }
+
+ void
+ _M_new_elements_at_front(size_type __new_elements);
+
+ void
+ _M_new_elements_at_back(size_type __new_elements);
+ //@}
+
+
+ //@{
+ /**
+ * @brief Memory-handling helpers for the major %map.
+ *
+ * Makes sure the _M_map has space for new nodes. Does not
+ * actually add the nodes. Can invalidate _M_map pointers.
+ * (And consequently, %deque iterators.)
+ */
+ void
+ _M_reserve_map_at_back(size_type __nodes_to_add = 1)
+ {
+ if (__nodes_to_add + 1 > this->_M_impl._M_map_size
+ - (this->_M_impl._M_finish._M_node - this->_M_impl._M_map))
+ _M_reallocate_map(__nodes_to_add, false);
+ }
+
+ void
+ _M_reserve_map_at_front(size_type __nodes_to_add = 1)
+ {
+ if (__nodes_to_add > size_type(this->_M_impl._M_start._M_node
+ - this->_M_impl._M_map))
+ _M_reallocate_map(__nodes_to_add, true);
+ }
+
+ void
+ _M_reallocate_map(size_type __nodes_to_add, bool __add_at_front);
+ //@}
+ };
+
+
+ /**
+ * @brief Deque equality comparison.
+ * @param x A %deque.
+ * @param y A %deque of the same type as @a x.
+ * @return True iff the size and elements of the deques are equal.
+ *
+ * This is an equivalence relation. It is linear in the size of the
+ * deques. Deques are considered equivalent if their sizes are equal,
+ * and if corresponding elements compare equal.
+ */
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator==(const deque<_Tp, _Alloc>& __x,
+ const deque<_Tp, _Alloc>& __y)
+ { return __x.size() == __y.size()
+ && std::equal(__x.begin(), __x.end(), __y.begin()); }
+
+ /**
+ * @brief Deque ordering relation.
+ * @param x A %deque.
+ * @param y A %deque of the same type as @a x.
+ * @return True iff @a x is lexicographically less than @a y.
+ *
+ * This is a total ordering relation. It is linear in the size of the
+ * deques. The elements must be comparable with @c <.
+ *
+ * See std::lexicographical_compare() for how the determination is made.
+ */
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<(const deque<_Tp, _Alloc>& __x,
+ const deque<_Tp, _Alloc>& __y)
+ { return std::lexicographical_compare(__x.begin(), __x.end(),
+ __y.begin(), __y.end()); }
+
+ /// Based on operator==
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator!=(const deque<_Tp, _Alloc>& __x,
+ const deque<_Tp, _Alloc>& __y)
+ { return !(__x == __y); }
+
+ /// Based on operator<
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>(const deque<_Tp, _Alloc>& __x,
+ const deque<_Tp, _Alloc>& __y)
+ { return __y < __x; }
+
+ /// Based on operator<
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<=(const deque<_Tp, _Alloc>& __x,
+ const deque<_Tp, _Alloc>& __y)
+ { return !(__y < __x); }
+
+ /// Based on operator<
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>=(const deque<_Tp, _Alloc>& __x,
+ const deque<_Tp, _Alloc>& __y)
+ { return !(__x < __y); }
+
+ /// See std::deque::swap().
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(deque<_Tp,_Alloc>& __x, deque<_Tp,_Alloc>& __y)
+ { __x.swap(__y); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(deque<_Tp,_Alloc>&& __x, deque<_Tp,_Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(deque<_Tp,_Alloc>& __x, deque<_Tp,_Alloc>&& __y)
+ { __x.swap(__y); }
+#endif
+
+_GLIBCXX_END_NESTED_NAMESPACE
+
+#endif /* _STL_DEQUE_H */
diff --git a/i686-linux/include/c++/4.4.3/bits/stl_function.h b/i686-linux/include/c++/4.4.3/bits/stl_function.h
new file mode 100644
index 0000000..b2569d5
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/stl_function.h
@@ -0,0 +1,715 @@
+// Functor implementations -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996-1998
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_function.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_FUNCTION_H
+#define _STL_FUNCTION_H 1
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // 20.3.1 base classes
+ /** @defgroup functors Function Objects
+ * @ingroup utilities
+ *
+ * Function objects, or @e functors, are objects with an @c operator()
+ * defined and accessible. They can be passed as arguments to algorithm
+ * templates and used in place of a function pointer. Not only is the
+ * resulting expressiveness of the library increased, but the generated
+ * code can be more efficient than what you might write by hand. When we
+ * refer to "functors," then, generally we include function pointers in
+ * the description as well.
+ *
+ * Often, functors are only created as temporaries passed to algorithm
+ * calls, rather than being created as named variables.
+ *
+ * Two examples taken from the standard itself follow. To perform a
+ * by-element addition of two vectors @c a and @c b containing @c double,
+ * and put the result in @c a, use
+ * \code
+ * transform (a.begin(), a.end(), b.begin(), a.begin(), plus<double>());
+ * \endcode
+ * To negate every element in @c a, use
+ * \code
+ * transform(a.begin(), a.end(), a.begin(), negate<double>());
+ * \endcode
+ * The addition and negation functions will be inlined directly.
+ *
+ * The standard functors are derived from structs named @c unary_function
+ * and @c binary_function. These two classes contain nothing but typedefs,
+ * to aid in generic (template) programming. If you write your own
+ * functors, you might consider doing the same.
+ *
+ * @{
+ */
+ /**
+ * This is one of the @link functors functor base classes@endlink.
+ */
+ template<typename _Arg, typename _Result>
+ struct unary_function
+ {
+ typedef _Arg argument_type; ///< @c argument_type is the type of the
+ /// argument (no surprises here)
+
+ typedef _Result result_type; ///< @c result_type is the return type
+ };
+
+ /**
+ * This is one of the @link functors functor base classes@endlink.
+ */
+ template<typename _Arg1, typename _Arg2, typename _Result>
+ struct binary_function
+ {
+ typedef _Arg1 first_argument_type; ///< the type of the first argument
+ /// (no surprises here)
+
+ typedef _Arg2 second_argument_type; ///< the type of the second argument
+ typedef _Result result_type; ///< type of the return type
+ };
+ /** @} */
+
+ // 20.3.2 arithmetic
+ /** @defgroup arithmetic_functors Arithmetic Classes
+ * @ingroup functors
+ *
+ * Because basic math often needs to be done during an algorithm,
+ * the library provides functors for those operations. See the
+ * documentation for @link functors the base classes@endlink
+ * for examples of their use.
+ *
+ * @{
+ */
+ /// One of the @link arithmetic_functors math functors@endlink.
+ template<typename _Tp>
+ struct plus : public binary_function<_Tp, _Tp, _Tp>
+ {
+ _Tp
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x + __y; }
+ };
+
+ /// One of the @link arithmetic_functors math functors@endlink.
+ template<typename _Tp>
+ struct minus : public binary_function<_Tp, _Tp, _Tp>
+ {
+ _Tp
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x - __y; }
+ };
+
+ /// One of the @link arithmetic_functors math functors@endlink.
+ template<typename _Tp>
+ struct multiplies : public binary_function<_Tp, _Tp, _Tp>
+ {
+ _Tp
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x * __y; }
+ };
+
+ /// One of the @link arithmetic_functors math functors@endlink.
+ template<typename _Tp>
+ struct divides : public binary_function<_Tp, _Tp, _Tp>
+ {
+ _Tp
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x / __y; }
+ };
+
+ /// One of the @link arithmetic_functors math functors@endlink.
+ template<typename _Tp>
+ struct modulus : public binary_function<_Tp, _Tp, _Tp>
+ {
+ _Tp
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x % __y; }
+ };
+
+ /// One of the @link arithmetic_functors math functors@endlink.
+ template<typename _Tp>
+ struct negate : public unary_function<_Tp, _Tp>
+ {
+ _Tp
+ operator()(const _Tp& __x) const
+ { return -__x; }
+ };
+ /** @} */
+
+ // 20.3.3 comparisons
+ /** @defgroup comparison_functors Comparison Classes
+ * @ingroup functors
+ *
+ * The library provides six wrapper functors for all the basic comparisons
+ * in C++, like @c <.
+ *
+ * @{
+ */
+ /// One of the @link comparison_functors comparison functors@endlink.
+ template<typename _Tp>
+ struct equal_to : public binary_function<_Tp, _Tp, bool>
+ {
+ bool
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x == __y; }
+ };
+
+ /// One of the @link comparison_functors comparison functors@endlink.
+ template<typename _Tp>
+ struct not_equal_to : public binary_function<_Tp, _Tp, bool>
+ {
+ bool
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x != __y; }
+ };
+
+ /// One of the @link comparison_functors comparison functors@endlink.
+ template<typename _Tp>
+ struct greater : public binary_function<_Tp, _Tp, bool>
+ {
+ bool
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x > __y; }
+ };
+
+ /// One of the @link comparison_functors comparison functors@endlink.
+ template<typename _Tp>
+ struct less : public binary_function<_Tp, _Tp, bool>
+ {
+ bool
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x < __y; }
+ };
+
+ /// One of the @link comparison_functors comparison functors@endlink.
+ template<typename _Tp>
+ struct greater_equal : public binary_function<_Tp, _Tp, bool>
+ {
+ bool
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x >= __y; }
+ };
+
+ /// One of the @link comparison_functors comparison functors@endlink.
+ template<typename _Tp>
+ struct less_equal : public binary_function<_Tp, _Tp, bool>
+ {
+ bool
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x <= __y; }
+ };
+ /** @} */
+
+ // 20.3.4 logical operations
+ /** @defgroup logical_functors Boolean Operations Classes
+ * @ingroup functors
+ *
+ * Here are wrapper functors for Boolean operations: @c &&, @c ||,
+ * and @c !.
+ *
+ * @{
+ */
+ /// One of the @link logical_functors Boolean operations functors@endlink.
+ template<typename _Tp>
+ struct logical_and : public binary_function<_Tp, _Tp, bool>
+ {
+ bool
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x && __y; }
+ };
+
+ /// One of the @link logical_functors Boolean operations functors@endlink.
+ template<typename _Tp>
+ struct logical_or : public binary_function<_Tp, _Tp, bool>
+ {
+ bool
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x || __y; }
+ };
+
+ /// One of the @link logical_functors Boolean operations functors@endlink.
+ template<typename _Tp>
+ struct logical_not : public unary_function<_Tp, bool>
+ {
+ bool
+ operator()(const _Tp& __x) const
+ { return !__x; }
+ };
+ /** @} */
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 660. Missing Bitwise Operations.
+ template<typename _Tp>
+ struct bit_and : public binary_function<_Tp, _Tp, _Tp>
+ {
+ _Tp
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x & __y; }
+ };
+
+ template<typename _Tp>
+ struct bit_or : public binary_function<_Tp, _Tp, _Tp>
+ {
+ _Tp
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x | __y; }
+ };
+
+ template<typename _Tp>
+ struct bit_xor : public binary_function<_Tp, _Tp, _Tp>
+ {
+ _Tp
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x ^ __y; }
+ };
+
+ // 20.3.5 negators
+ /** @defgroup negators Negators
+ * @ingroup functors
+ *
+ * The functions @c not1 and @c not2 each take a predicate functor
+ * and return an instance of @c unary_negate or
+ * @c binary_negate, respectively. These classes are functors whose
+ * @c operator() performs the stored predicate function and then returns
+ * the negation of the result.
+ *
+ * For example, given a vector of integers and a trivial predicate,
+ * \code
+ * struct IntGreaterThanThree
+ * : public std::unary_function<int, bool>
+ * {
+ * bool operator() (int x) { return x > 3; }
+ * };
+ *
+ * std::find_if (v.begin(), v.end(), not1(IntGreaterThanThree()));
+ * \endcode
+ * The call to @c find_if will locate the first index (i) of @c v for which
+ * "!(v[i] > 3)" is true.
+ *
+ * The not1/unary_negate combination works on predicates taking a single
+ * argument. The not2/binary_negate combination works on predicates which
+ * take two arguments.
+ *
+ * @{
+ */
+ /// One of the @link negators negation functors@endlink.
+ template<typename _Predicate>
+ class unary_negate
+ : public unary_function<typename _Predicate::argument_type, bool>
+ {
+ protected:
+ _Predicate _M_pred;
+
+ public:
+ explicit
+ unary_negate(const _Predicate& __x) : _M_pred(__x) { }
+
+ bool
+ operator()(const typename _Predicate::argument_type& __x) const
+ { return !_M_pred(__x); }
+ };
+
+ /// One of the @link negators negation functors@endlink.
+ template<typename _Predicate>
+ inline unary_negate<_Predicate>
+ not1(const _Predicate& __pred)
+ { return unary_negate<_Predicate>(__pred); }
+
+ /// One of the @link negators negation functors@endlink.
+ template<typename _Predicate>
+ class binary_negate
+ : public binary_function<typename _Predicate::first_argument_type,
+ typename _Predicate::second_argument_type, bool>
+ {
+ protected:
+ _Predicate _M_pred;
+
+ public:
+ explicit
+ binary_negate(const _Predicate& __x) : _M_pred(__x) { }
+
+ bool
+ operator()(const typename _Predicate::first_argument_type& __x,
+ const typename _Predicate::second_argument_type& __y) const
+ { return !_M_pred(__x, __y); }
+ };
+
+ /// One of the @link negators negation functors@endlink.
+ template<typename _Predicate>
+ inline binary_negate<_Predicate>
+ not2(const _Predicate& __pred)
+ { return binary_negate<_Predicate>(__pred); }
+ /** @} */
+
+ // 20.3.7 adaptors pointers functions
+ /** @defgroup pointer_adaptors Adaptors for pointers to functions
+ * @ingroup functors
+ *
+ * The advantage of function objects over pointers to functions is that
+ * the objects in the standard library declare nested typedefs describing
+ * their argument and result types with uniform names (e.g., @c result_type
+ * from the base classes @c unary_function and @c binary_function).
+ * Sometimes those typedefs are required, not just optional.
+ *
+ * Adaptors are provided to turn pointers to unary (single-argument) and
+ * binary (double-argument) functions into function objects. The
+ * long-winded functor @c pointer_to_unary_function is constructed with a
+ * function pointer @c f, and its @c operator() called with argument @c x
+ * returns @c f(x). The functor @c pointer_to_binary_function does the same
+ * thing, but with a double-argument @c f and @c operator().
+ *
+ * The function @c ptr_fun takes a pointer-to-function @c f and constructs
+ * an instance of the appropriate functor.
+ *
+ * @{
+ */
+ /// One of the @link pointer_adaptors adaptors for function pointers@endlink.
+ template<typename _Arg, typename _Result>
+ class pointer_to_unary_function : public unary_function<_Arg, _Result>
+ {
+ protected:
+ _Result (*_M_ptr)(_Arg);
+
+ public:
+ pointer_to_unary_function() { }
+
+ explicit
+ pointer_to_unary_function(_Result (*__x)(_Arg))
+ : _M_ptr(__x) { }
+
+ _Result
+ operator()(_Arg __x) const
+ { return _M_ptr(__x); }
+ };
+
+ /// One of the @link pointer_adaptors adaptors for function pointers@endlink.
+ template<typename _Arg, typename _Result>
+ inline pointer_to_unary_function<_Arg, _Result>
+ ptr_fun(_Result (*__x)(_Arg))
+ { return pointer_to_unary_function<_Arg, _Result>(__x); }
+
+ /// One of the @link pointer_adaptors adaptors for function pointers@endlink.
+ template<typename _Arg1, typename _Arg2, typename _Result>
+ class pointer_to_binary_function
+ : public binary_function<_Arg1, _Arg2, _Result>
+ {
+ protected:
+ _Result (*_M_ptr)(_Arg1, _Arg2);
+
+ public:
+ pointer_to_binary_function() { }
+
+ explicit
+ pointer_to_binary_function(_Result (*__x)(_Arg1, _Arg2))
+ : _M_ptr(__x) { }
+
+ _Result
+ operator()(_Arg1 __x, _Arg2 __y) const
+ { return _M_ptr(__x, __y); }
+ };
+
+ /// One of the @link pointer_adaptors adaptors for function pointers@endlink.
+ template<typename _Arg1, typename _Arg2, typename _Result>
+ inline pointer_to_binary_function<_Arg1, _Arg2, _Result>
+ ptr_fun(_Result (*__x)(_Arg1, _Arg2))
+ { return pointer_to_binary_function<_Arg1, _Arg2, _Result>(__x); }
+ /** @} */
+
+ template<typename _Tp>
+ struct _Identity : public unary_function<_Tp,_Tp>
+ {
+ _Tp&
+ operator()(_Tp& __x) const
+ { return __x; }
+
+ const _Tp&
+ operator()(const _Tp& __x) const
+ { return __x; }
+ };
+
+ template<typename _Pair>
+ struct _Select1st : public unary_function<_Pair,
+ typename _Pair::first_type>
+ {
+ typename _Pair::first_type&
+ operator()(_Pair& __x) const
+ { return __x.first; }
+
+ const typename _Pair::first_type&
+ operator()(const _Pair& __x) const
+ { return __x.first; }
+ };
+
+ template<typename _Pair>
+ struct _Select2nd : public unary_function<_Pair,
+ typename _Pair::second_type>
+ {
+ typename _Pair::second_type&
+ operator()(_Pair& __x) const
+ { return __x.second; }
+
+ const typename _Pair::second_type&
+ operator()(const _Pair& __x) const
+ { return __x.second; }
+ };
+
+ // 20.3.8 adaptors pointers members
+ /** @defgroup memory_adaptors Adaptors for pointers to members
+ * @ingroup functors
+ *
+ * There are a total of 8 = 2^3 function objects in this family.
+ * (1) Member functions taking no arguments vs member functions taking
+ * one argument.
+ * (2) Call through pointer vs call through reference.
+ * (3) Const vs non-const member function.
+ *
+ * All of this complexity is in the function objects themselves. You can
+ * ignore it by using the helper function mem_fun and mem_fun_ref,
+ * which create whichever type of adaptor is appropriate.
+ *
+ * @{
+ */
+ /// One of the @link memory_adaptors adaptors for member
+ /// pointers@endlink.
+ template<typename _Ret, typename _Tp>
+ class mem_fun_t : public unary_function<_Tp*, _Ret>
+ {
+ public:
+ explicit
+ mem_fun_t(_Ret (_Tp::*__pf)())
+ : _M_f(__pf) { }
+
+ _Ret
+ operator()(_Tp* __p) const
+ { return (__p->*_M_f)(); }
+
+ private:
+ _Ret (_Tp::*_M_f)();
+ };
+
+ /// One of the @link memory_adaptors adaptors for member
+ /// pointers@endlink.
+ template<typename _Ret, typename _Tp>
+ class const_mem_fun_t : public unary_function<const _Tp*, _Ret>
+ {
+ public:
+ explicit
+ const_mem_fun_t(_Ret (_Tp::*__pf)() const)
+ : _M_f(__pf) { }
+
+ _Ret
+ operator()(const _Tp* __p) const
+ { return (__p->*_M_f)(); }
+
+ private:
+ _Ret (_Tp::*_M_f)() const;
+ };
+
+ /// One of the @link memory_adaptors adaptors for member
+ /// pointers@endlink.
+ template<typename _Ret, typename _Tp>
+ class mem_fun_ref_t : public unary_function<_Tp, _Ret>
+ {
+ public:
+ explicit
+ mem_fun_ref_t(_Ret (_Tp::*__pf)())
+ : _M_f(__pf) { }
+
+ _Ret
+ operator()(_Tp& __r) const
+ { return (__r.*_M_f)(); }
+
+ private:
+ _Ret (_Tp::*_M_f)();
+ };
+
+ /// One of the @link memory_adaptors adaptors for member
+ /// pointers@endlink.
+ template<typename _Ret, typename _Tp>
+ class const_mem_fun_ref_t : public unary_function<_Tp, _Ret>
+ {
+ public:
+ explicit
+ const_mem_fun_ref_t(_Ret (_Tp::*__pf)() const)
+ : _M_f(__pf) { }
+
+ _Ret
+ operator()(const _Tp& __r) const
+ { return (__r.*_M_f)(); }
+
+ private:
+ _Ret (_Tp::*_M_f)() const;
+ };
+
+ /// One of the @link memory_adaptors adaptors for member
+ /// pointers@endlink.
+ template<typename _Ret, typename _Tp, typename _Arg>
+ class mem_fun1_t : public binary_function<_Tp*, _Arg, _Ret>
+ {
+ public:
+ explicit
+ mem_fun1_t(_Ret (_Tp::*__pf)(_Arg))
+ : _M_f(__pf) { }
+
+ _Ret
+ operator()(_Tp* __p, _Arg __x) const
+ { return (__p->*_M_f)(__x); }
+
+ private:
+ _Ret (_Tp::*_M_f)(_Arg);
+ };
+
+ /// One of the @link memory_adaptors adaptors for member
+ /// pointers@endlink.
+ template<typename _Ret, typename _Tp, typename _Arg>
+ class const_mem_fun1_t : public binary_function<const _Tp*, _Arg, _Ret>
+ {
+ public:
+ explicit
+ const_mem_fun1_t(_Ret (_Tp::*__pf)(_Arg) const)
+ : _M_f(__pf) { }
+
+ _Ret
+ operator()(const _Tp* __p, _Arg __x) const
+ { return (__p->*_M_f)(__x); }
+
+ private:
+ _Ret (_Tp::*_M_f)(_Arg) const;
+ };
+
+ /// One of the @link memory_adaptors adaptors for member
+ /// pointers@endlink.
+ template<typename _Ret, typename _Tp, typename _Arg>
+ class mem_fun1_ref_t : public binary_function<_Tp, _Arg, _Ret>
+ {
+ public:
+ explicit
+ mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg))
+ : _M_f(__pf) { }
+
+ _Ret
+ operator()(_Tp& __r, _Arg __x) const
+ { return (__r.*_M_f)(__x); }
+
+ private:
+ _Ret (_Tp::*_M_f)(_Arg);
+ };
+
+ /// One of the @link memory_adaptors adaptors for member
+ /// pointers@endlink.
+ template<typename _Ret, typename _Tp, typename _Arg>
+ class const_mem_fun1_ref_t : public binary_function<_Tp, _Arg, _Ret>
+ {
+ public:
+ explicit
+ const_mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg) const)
+ : _M_f(__pf) { }
+
+ _Ret
+ operator()(const _Tp& __r, _Arg __x) const
+ { return (__r.*_M_f)(__x); }
+
+ private:
+ _Ret (_Tp::*_M_f)(_Arg) const;
+ };
+
+ // Mem_fun adaptor helper functions. There are only two:
+ // mem_fun and mem_fun_ref.
+ template<typename _Ret, typename _Tp>
+ inline mem_fun_t<_Ret, _Tp>
+ mem_fun(_Ret (_Tp::*__f)())
+ { return mem_fun_t<_Ret, _Tp>(__f); }
+
+ template<typename _Ret, typename _Tp>
+ inline const_mem_fun_t<_Ret, _Tp>
+ mem_fun(_Ret (_Tp::*__f)() const)
+ { return const_mem_fun_t<_Ret, _Tp>(__f); }
+
+ template<typename _Ret, typename _Tp>
+ inline mem_fun_ref_t<_Ret, _Tp>
+ mem_fun_ref(_Ret (_Tp::*__f)())
+ { return mem_fun_ref_t<_Ret, _Tp>(__f); }
+
+ template<typename _Ret, typename _Tp>
+ inline const_mem_fun_ref_t<_Ret, _Tp>
+ mem_fun_ref(_Ret (_Tp::*__f)() const)
+ { return const_mem_fun_ref_t<_Ret, _Tp>(__f); }
+
+ template<typename _Ret, typename _Tp, typename _Arg>
+ inline mem_fun1_t<_Ret, _Tp, _Arg>
+ mem_fun(_Ret (_Tp::*__f)(_Arg))
+ { return mem_fun1_t<_Ret, _Tp, _Arg>(__f); }
+
+ template<typename _Ret, typename _Tp, typename _Arg>
+ inline const_mem_fun1_t<_Ret, _Tp, _Arg>
+ mem_fun(_Ret (_Tp::*__f)(_Arg) const)
+ { return const_mem_fun1_t<_Ret, _Tp, _Arg>(__f); }
+
+ template<typename _Ret, typename _Tp, typename _Arg>
+ inline mem_fun1_ref_t<_Ret, _Tp, _Arg>
+ mem_fun_ref(_Ret (_Tp::*__f)(_Arg))
+ { return mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); }
+
+ template<typename _Ret, typename _Tp, typename _Arg>
+ inline const_mem_fun1_ref_t<_Ret, _Tp, _Arg>
+ mem_fun_ref(_Ret (_Tp::*__f)(_Arg) const)
+ { return const_mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); }
+
+ /** @} */
+
+_GLIBCXX_END_NAMESPACE
+
+#if !defined(__GXX_EXPERIMENTAL_CXX0X__) || _GLIBCXX_DEPRECATED
+# include <backward/binders.h>
+#endif
+
+#endif /* _STL_FUNCTION_H */
diff --git a/i686-linux/include/c++/4.4.3/bits/stl_heap.h b/i686-linux/include/c++/4.4.3/bits/stl_heap.h
new file mode 100644
index 0000000..9348fe9
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/stl_heap.h
@@ -0,0 +1,578 @@
+// Heap implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * Copyright (c) 1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_heap.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_HEAP_H
+#define _STL_HEAP_H 1
+
+#include <debug/debug.h>
+#include <bits/move.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @defgroup heap_algorithms Heap Algorithms
+ * @ingroup sorting_algorithms
+ */
+
+ template<typename _RandomAccessIterator, typename _Distance>
+ _Distance
+ __is_heap_until(_RandomAccessIterator __first, _Distance __n)
+ {
+ _Distance __parent = 0;
+ for (_Distance __child = 1; __child < __n; ++__child)
+ {
+ if (__first[__parent] < __first[__child])
+ return __child;
+ if ((__child & 1) == 0)
+ ++__parent;
+ }
+ return __n;
+ }
+
+ template<typename _RandomAccessIterator, typename _Distance,
+ typename _Compare>
+ _Distance
+ __is_heap_until(_RandomAccessIterator __first, _Distance __n,
+ _Compare __comp)
+ {
+ _Distance __parent = 0;
+ for (_Distance __child = 1; __child < __n; ++__child)
+ {
+ if (__comp(__first[__parent], __first[__child]))
+ return __child;
+ if ((__child & 1) == 0)
+ ++__parent;
+ }
+ return __n;
+ }
+
+ // __is_heap, a predicate testing whether or not a range is a heap.
+ // This function is an extension, not part of the C++ standard.
+ template<typename _RandomAccessIterator, typename _Distance>
+ inline bool
+ __is_heap(_RandomAccessIterator __first, _Distance __n)
+ { return std::__is_heap_until(__first, __n) == __n; }
+
+ template<typename _RandomAccessIterator, typename _Compare,
+ typename _Distance>
+ inline bool
+ __is_heap(_RandomAccessIterator __first, _Compare __comp, _Distance __n)
+ { return std::__is_heap_until(__first, __n, __comp) == __n; }
+
+ template<typename _RandomAccessIterator>
+ inline bool
+ __is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
+ { return std::__is_heap(__first, std::distance(__first, __last)); }
+
+ template<typename _RandomAccessIterator, typename _Compare>
+ inline bool
+ __is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ _Compare __comp)
+ { return std::__is_heap(__first, __comp, std::distance(__first, __last)); }
+
+ // Heap-manipulation functions: push_heap, pop_heap, make_heap, sort_heap,
+ // + is_heap and is_heap_until in C++0x.
+
+ template<typename _RandomAccessIterator, typename _Distance, typename _Tp>
+ void
+ __push_heap(_RandomAccessIterator __first,
+ _Distance __holeIndex, _Distance __topIndex, _Tp __value)
+ {
+ _Distance __parent = (__holeIndex - 1) / 2;
+ while (__holeIndex > __topIndex && *(__first + __parent) < __value)
+ {
+ *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __parent));
+ __holeIndex = __parent;
+ __parent = (__holeIndex - 1) / 2;
+ }
+ *(__first + __holeIndex) = _GLIBCXX_MOVE(__value);
+ }
+
+ /**
+ * @brief Push an element onto a heap.
+ * @param first Start of heap.
+ * @param last End of heap + element.
+ * @ingroup heap_algorithms
+ *
+ * This operation pushes the element at last-1 onto the valid heap over the
+ * range [first,last-1). After completion, [first,last) is a valid heap.
+ */
+ template<typename _RandomAccessIterator>
+ inline void
+ push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type
+ _DistanceType;
+
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_function_requires(_LessThanComparableConcept<_ValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
+ __glibcxx_requires_heap(__first, __last - 1);
+
+ _ValueType __value = _GLIBCXX_MOVE(*(__last - 1));
+ std::__push_heap(__first, _DistanceType((__last - __first) - 1),
+ _DistanceType(0), _GLIBCXX_MOVE(__value));
+ }
+
+ template<typename _RandomAccessIterator, typename _Distance, typename _Tp,
+ typename _Compare>
+ void
+ __push_heap(_RandomAccessIterator __first, _Distance __holeIndex,
+ _Distance __topIndex, _Tp __value, _Compare __comp)
+ {
+ _Distance __parent = (__holeIndex - 1) / 2;
+ while (__holeIndex > __topIndex
+ && __comp(*(__first + __parent), __value))
+ {
+ *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __parent));
+ __holeIndex = __parent;
+ __parent = (__holeIndex - 1) / 2;
+ }
+ *(__first + __holeIndex) = _GLIBCXX_MOVE(__value);
+ }
+
+ /**
+ * @brief Push an element onto a heap using comparison functor.
+ * @param first Start of heap.
+ * @param last End of heap + element.
+ * @param comp Comparison functor.
+ * @ingroup heap_algorithms
+ *
+ * This operation pushes the element at last-1 onto the valid heap over the
+ * range [first,last-1). After completion, [first,last) is a valid heap.
+ * Compare operations are performed using comp.
+ */
+ template<typename _RandomAccessIterator, typename _Compare>
+ inline void
+ push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ _Compare __comp)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type
+ _DistanceType;
+
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
+ __glibcxx_requires_heap_pred(__first, __last - 1, __comp);
+
+ _ValueType __value = _GLIBCXX_MOVE(*(__last - 1));
+ std::__push_heap(__first, _DistanceType((__last - __first) - 1),
+ _DistanceType(0), _GLIBCXX_MOVE(__value), __comp);
+ }
+
+ template<typename _RandomAccessIterator, typename _Distance, typename _Tp>
+ void
+ __adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex,
+ _Distance __len, _Tp __value)
+ {
+ const _Distance __topIndex = __holeIndex;
+ _Distance __secondChild = __holeIndex;
+ while (__secondChild < (__len - 1) / 2)
+ {
+ __secondChild = 2 * (__secondChild + 1);
+ if (*(__first + __secondChild) < *(__first + (__secondChild - 1)))
+ __secondChild--;
+ *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __secondChild));
+ __holeIndex = __secondChild;
+ }
+ if ((__len & 1) == 0 && __secondChild == (__len - 2) / 2)
+ {
+ __secondChild = 2 * (__secondChild + 1);
+ *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first
+ + (__secondChild - 1)));
+ __holeIndex = __secondChild - 1;
+ }
+ std::__push_heap(__first, __holeIndex, __topIndex,
+ _GLIBCXX_MOVE(__value));
+ }
+
+ template<typename _RandomAccessIterator>
+ inline void
+ __pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ _RandomAccessIterator __result)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type
+ _DistanceType;
+
+ _ValueType __value = _GLIBCXX_MOVE(*__result);
+ *__result = _GLIBCXX_MOVE(*__first);
+ std::__adjust_heap(__first, _DistanceType(0),
+ _DistanceType(__last - __first),
+ _GLIBCXX_MOVE(__value));
+ }
+
+ /**
+ * @brief Pop an element off a heap.
+ * @param first Start of heap.
+ * @param last End of heap.
+ * @ingroup heap_algorithms
+ *
+ * This operation pops the top of the heap. The elements first and last-1
+ * are swapped and [first,last-1) is made into a heap.
+ */
+ template<typename _RandomAccessIterator>
+ inline void
+ pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_function_requires(_LessThanComparableConcept<_ValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
+ __glibcxx_requires_heap(__first, __last);
+
+ --__last;
+ std::__pop_heap(__first, __last, __last);
+ }
+
+ template<typename _RandomAccessIterator, typename _Distance,
+ typename _Tp, typename _Compare>
+ void
+ __adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex,
+ _Distance __len, _Tp __value, _Compare __comp)
+ {
+ const _Distance __topIndex = __holeIndex;
+ _Distance __secondChild = __holeIndex;
+ while (__secondChild < (__len - 1) / 2)
+ {
+ __secondChild = 2 * (__secondChild + 1);
+ if (__comp(*(__first + __secondChild),
+ *(__first + (__secondChild - 1))))
+ __secondChild--;
+ *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __secondChild));
+ __holeIndex = __secondChild;
+ }
+ if ((__len & 1) == 0 && __secondChild == (__len - 2) / 2)
+ {
+ __secondChild = 2 * (__secondChild + 1);
+ *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first
+ + (__secondChild - 1)));
+ __holeIndex = __secondChild - 1;
+ }
+ std::__push_heap(__first, __holeIndex, __topIndex,
+ _GLIBCXX_MOVE(__value), __comp);
+ }
+
+ template<typename _RandomAccessIterator, typename _Compare>
+ inline void
+ __pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ _RandomAccessIterator __result, _Compare __comp)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type
+ _DistanceType;
+
+ _ValueType __value = _GLIBCXX_MOVE(*__result);
+ *__result = _GLIBCXX_MOVE(*__first);
+ std::__adjust_heap(__first, _DistanceType(0),
+ _DistanceType(__last - __first),
+ _GLIBCXX_MOVE(__value), __comp);
+ }
+
+ /**
+ * @brief Pop an element off a heap using comparison functor.
+ * @param first Start of heap.
+ * @param last End of heap.
+ * @param comp Comparison functor to use.
+ * @ingroup heap_algorithms
+ *
+ * This operation pops the top of the heap. The elements first and last-1
+ * are swapped and [first,last-1) is made into a heap. Comparisons are
+ * made using comp.
+ */
+ template<typename _RandomAccessIterator, typename _Compare>
+ inline void
+ pop_heap(_RandomAccessIterator __first,
+ _RandomAccessIterator __last, _Compare __comp)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
+ __glibcxx_requires_heap_pred(__first, __last, __comp);
+
+ --__last;
+ std::__pop_heap(__first, __last, __last, __comp);
+ }
+
+ /**
+ * @brief Construct a heap over a range.
+ * @param first Start of heap.
+ * @param last End of heap.
+ * @ingroup heap_algorithms
+ *
+ * This operation makes the elements in [first,last) into a heap.
+ */
+ template<typename _RandomAccessIterator>
+ void
+ make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type
+ _DistanceType;
+
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_function_requires(_LessThanComparableConcept<_ValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__last - __first < 2)
+ return;
+
+ const _DistanceType __len = __last - __first;
+ _DistanceType __parent = (__len - 2) / 2;
+ while (true)
+ {
+ _ValueType __value = _GLIBCXX_MOVE(*(__first + __parent));
+ std::__adjust_heap(__first, __parent, __len, _GLIBCXX_MOVE(__value));
+ if (__parent == 0)
+ return;
+ __parent--;
+ }
+ }
+
+ /**
+ * @brief Construct a heap over a range using comparison functor.
+ * @param first Start of heap.
+ * @param last End of heap.
+ * @param comp Comparison functor to use.
+ * @ingroup heap_algorithms
+ *
+ * This operation makes the elements in [first,last) into a heap.
+ * Comparisons are made using comp.
+ */
+ template<typename _RandomAccessIterator, typename _Compare>
+ void
+ make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ _Compare __comp)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type
+ _DistanceType;
+
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__last - __first < 2)
+ return;
+
+ const _DistanceType __len = __last - __first;
+ _DistanceType __parent = (__len - 2) / 2;
+ while (true)
+ {
+ _ValueType __value = _GLIBCXX_MOVE(*(__first + __parent));
+ std::__adjust_heap(__first, __parent, __len, _GLIBCXX_MOVE(__value),
+ __comp);
+ if (__parent == 0)
+ return;
+ __parent--;
+ }
+ }
+
+ /**
+ * @brief Sort a heap.
+ * @param first Start of heap.
+ * @param last End of heap.
+ * @ingroup heap_algorithms
+ *
+ * This operation sorts the valid heap in the range [first,last).
+ */
+ template<typename _RandomAccessIterator>
+ void
+ sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_RandomAccessIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+ __glibcxx_requires_heap(__first, __last);
+
+ while (__last - __first > 1)
+ {
+ --__last;
+ std::__pop_heap(__first, __last, __last);
+ }
+ }
+
+ /**
+ * @brief Sort a heap using comparison functor.
+ * @param first Start of heap.
+ * @param last End of heap.
+ * @param comp Comparison functor to use.
+ * @ingroup heap_algorithms
+ *
+ * This operation sorts the valid heap in the range [first,last).
+ * Comparisons are made using comp.
+ */
+ template<typename _RandomAccessIterator, typename _Compare>
+ void
+ sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ _Compare __comp)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
+ __glibcxx_requires_heap_pred(__first, __last, __comp);
+
+ while (__last - __first > 1)
+ {
+ --__last;
+ std::__pop_heap(__first, __last, __last, __comp);
+ }
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Search the end of a heap.
+ * @param first Start of range.
+ * @param last End of range.
+ * @return An iterator pointing to the first element not in the heap.
+ * @ingroup heap_algorithms
+ *
+ * This operation returns the last iterator i in [first, last) for which
+ * the range [first, i) is a heap.
+ */
+ template<typename _RandomAccessIterator>
+ inline _RandomAccessIterator
+ is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_RandomAccessIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ return __first + std::__is_heap_until(__first, std::distance(__first,
+ __last));
+ }
+
+ /**
+ * @brief Search the end of a heap using comparison functor.
+ * @param first Start of range.
+ * @param last End of range.
+ * @param comp Comparison functor to use.
+ * @return An iterator pointing to the first element not in the heap.
+ * @ingroup heap_algorithms
+ *
+ * This operation returns the last iterator i in [first, last) for which
+ * the range [first, i) is a heap. Comparisons are made using comp.
+ */
+ template<typename _RandomAccessIterator, typename _Compare>
+ inline _RandomAccessIterator
+ is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ _Compare __comp)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ return __first + std::__is_heap_until(__first, std::distance(__first,
+ __last),
+ __comp);
+ }
+
+ /**
+ * @brief Determines whether a range is a heap.
+ * @param first Start of range.
+ * @param last End of range.
+ * @return True if range is a heap, false otherwise.
+ * @ingroup heap_algorithms
+ */
+ template<typename _RandomAccessIterator>
+ inline bool
+ is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
+ { return std::is_heap_until(__first, __last) == __last; }
+
+ /**
+ * @brief Determines whether a range is a heap using comparison functor.
+ * @param first Start of range.
+ * @param last End of range.
+ * @param comp Comparison functor to use.
+ * @return True if range is a heap, false otherwise.
+ * @ingroup heap_algorithms
+ */
+ template<typename _RandomAccessIterator, typename _Compare>
+ inline bool
+ is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ _Compare __comp)
+ { return std::is_heap_until(__first, __last, __comp) == __last; }
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _STL_HEAP_H */
diff --git a/i686-linux/include/c++/4.4.3/bits/stl_iterator.h b/i686-linux/include/c++/4.4.3/bits/stl_iterator.h
new file mode 100644
index 0000000..129552f
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/stl_iterator.h
@@ -0,0 +1,1041 @@
+// Iterators -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996-1998
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_iterator.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ *
+ * This file implements reverse_iterator, back_insert_iterator,
+ * front_insert_iterator, insert_iterator, __normal_iterator, and their
+ * supporting functions and overloaded operators.
+ */
+
+#ifndef _STL_ITERATOR_H
+#define _STL_ITERATOR_H 1
+
+#include <bits/cpp_type_traits.h>
+#include <ext/type_traits.h>
+#include <bits/move.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // 24.4.1 Reverse iterators
+ /**
+ * "Bidirectional and random access iterators have corresponding reverse
+ * %iterator adaptors that iterate through the data structure in the
+ * opposite direction. They have the same signatures as the corresponding
+ * iterators. The fundamental relation between a reverse %iterator and its
+ * corresponding %iterator @c i is established by the identity:
+ * @code
+ * &*(reverse_iterator(i)) == &*(i - 1)
+ * @endcode
+ *
+ * This mapping is dictated by the fact that while there is always a
+ * pointer past the end of an array, there might not be a valid pointer
+ * before the beginning of an array." [24.4.1]/1,2
+ *
+ * Reverse iterators can be tricky and surprising at first. Their
+ * semantics make sense, however, and the trickiness is a side effect of
+ * the requirement that the iterators must be safe.
+ */
+ template<typename _Iterator>
+ class reverse_iterator
+ : public iterator<typename iterator_traits<_Iterator>::iterator_category,
+ typename iterator_traits<_Iterator>::value_type,
+ typename iterator_traits<_Iterator>::difference_type,
+ typename iterator_traits<_Iterator>::pointer,
+ typename iterator_traits<_Iterator>::reference>
+ {
+ protected:
+ _Iterator current;
+
+ public:
+ typedef _Iterator iterator_type;
+ typedef typename iterator_traits<_Iterator>::difference_type
+ difference_type;
+ typedef typename iterator_traits<_Iterator>::reference reference;
+ typedef typename iterator_traits<_Iterator>::pointer pointer;
+
+ public:
+ /**
+ * The default constructor default-initializes member @p current.
+ * If it is a pointer, that means it is zero-initialized.
+ */
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 235 No specification of default ctor for reverse_iterator
+ reverse_iterator() : current() { }
+
+ /**
+ * This %iterator will move in the opposite direction that @p x does.
+ */
+ explicit
+ reverse_iterator(iterator_type __x) : current(__x) { }
+
+ /**
+ * The copy constructor is normal.
+ */
+ reverse_iterator(const reverse_iterator& __x)
+ : current(__x.current) { }
+
+ /**
+ * A reverse_iterator across other types can be copied in the normal
+ * fashion.
+ */
+ template<typename _Iter>
+ reverse_iterator(const reverse_iterator<_Iter>& __x)
+ : current(__x.base()) { }
+
+ /**
+ * @return @c current, the %iterator used for underlying work.
+ */
+ iterator_type
+ base() const
+ { return current; }
+
+ /**
+ * @return TODO
+ *
+ * @doctodo
+ */
+ reference
+ operator*() const
+ {
+ _Iterator __tmp = current;
+ return *--__tmp;
+ }
+
+ /**
+ * @return TODO
+ *
+ * @doctodo
+ */
+ pointer
+ operator->() const
+ { return &(operator*()); }
+
+ /**
+ * @return TODO
+ *
+ * @doctodo
+ */
+ reverse_iterator&
+ operator++()
+ {
+ --current;
+ return *this;
+ }
+
+ /**
+ * @return TODO
+ *
+ * @doctodo
+ */
+ reverse_iterator
+ operator++(int)
+ {
+ reverse_iterator __tmp = *this;
+ --current;
+ return __tmp;
+ }
+
+ /**
+ * @return TODO
+ *
+ * @doctodo
+ */
+ reverse_iterator&
+ operator--()
+ {
+ ++current;
+ return *this;
+ }
+
+ /**
+ * @return TODO
+ *
+ * @doctodo
+ */
+ reverse_iterator
+ operator--(int)
+ {
+ reverse_iterator __tmp = *this;
+ ++current;
+ return __tmp;
+ }
+
+ /**
+ * @return TODO
+ *
+ * @doctodo
+ */
+ reverse_iterator
+ operator+(difference_type __n) const
+ { return reverse_iterator(current - __n); }
+
+ /**
+ * @return TODO
+ *
+ * @doctodo
+ */
+ reverse_iterator&
+ operator+=(difference_type __n)
+ {
+ current -= __n;
+ return *this;
+ }
+
+ /**
+ * @return TODO
+ *
+ * @doctodo
+ */
+ reverse_iterator
+ operator-(difference_type __n) const
+ { return reverse_iterator(current + __n); }
+
+ /**
+ * @return TODO
+ *
+ * @doctodo
+ */
+ reverse_iterator&
+ operator-=(difference_type __n)
+ {
+ current += __n;
+ return *this;
+ }
+
+ /**
+ * @return TODO
+ *
+ * @doctodo
+ */
+ reference
+ operator[](difference_type __n) const
+ { return *(*this + __n); }
+ };
+
+ //@{
+ /**
+ * @param x A %reverse_iterator.
+ * @param y A %reverse_iterator.
+ * @return A simple bool.
+ *
+ * Reverse iterators forward many operations to their underlying base()
+ * iterators. Others are implemented in terms of one another.
+ *
+ */
+ template<typename _Iterator>
+ inline bool
+ operator==(const reverse_iterator<_Iterator>& __x,
+ const reverse_iterator<_Iterator>& __y)
+ { return __x.base() == __y.base(); }
+
+ template<typename _Iterator>
+ inline bool
+ operator<(const reverse_iterator<_Iterator>& __x,
+ const reverse_iterator<_Iterator>& __y)
+ { return __y.base() < __x.base(); }
+
+ template<typename _Iterator>
+ inline bool
+ operator!=(const reverse_iterator<_Iterator>& __x,
+ const reverse_iterator<_Iterator>& __y)
+ { return !(__x == __y); }
+
+ template<typename _Iterator>
+ inline bool
+ operator>(const reverse_iterator<_Iterator>& __x,
+ const reverse_iterator<_Iterator>& __y)
+ { return __y < __x; }
+
+ template<typename _Iterator>
+ inline bool
+ operator<=(const reverse_iterator<_Iterator>& __x,
+ const reverse_iterator<_Iterator>& __y)
+ { return !(__y < __x); }
+
+ template<typename _Iterator>
+ inline bool
+ operator>=(const reverse_iterator<_Iterator>& __x,
+ const reverse_iterator<_Iterator>& __y)
+ { return !(__x < __y); }
+
+ template<typename _Iterator>
+ inline typename reverse_iterator<_Iterator>::difference_type
+ operator-(const reverse_iterator<_Iterator>& __x,
+ const reverse_iterator<_Iterator>& __y)
+ { return __y.base() - __x.base(); }
+
+ template<typename _Iterator>
+ inline reverse_iterator<_Iterator>
+ operator+(typename reverse_iterator<_Iterator>::difference_type __n,
+ const reverse_iterator<_Iterator>& __x)
+ { return reverse_iterator<_Iterator>(__x.base() - __n); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 280. Comparison of reverse_iterator to const reverse_iterator.
+ template<typename _IteratorL, typename _IteratorR>
+ inline bool
+ operator==(const reverse_iterator<_IteratorL>& __x,
+ const reverse_iterator<_IteratorR>& __y)
+ { return __x.base() == __y.base(); }
+
+ template<typename _IteratorL, typename _IteratorR>
+ inline bool
+ operator<(const reverse_iterator<_IteratorL>& __x,
+ const reverse_iterator<_IteratorR>& __y)
+ { return __y.base() < __x.base(); }
+
+ template<typename _IteratorL, typename _IteratorR>
+ inline bool
+ operator!=(const reverse_iterator<_IteratorL>& __x,
+ const reverse_iterator<_IteratorR>& __y)
+ { return !(__x == __y); }
+
+ template<typename _IteratorL, typename _IteratorR>
+ inline bool
+ operator>(const reverse_iterator<_IteratorL>& __x,
+ const reverse_iterator<_IteratorR>& __y)
+ { return __y < __x; }
+
+ template<typename _IteratorL, typename _IteratorR>
+ inline bool
+ operator<=(const reverse_iterator<_IteratorL>& __x,
+ const reverse_iterator<_IteratorR>& __y)
+ { return !(__y < __x); }
+
+ template<typename _IteratorL, typename _IteratorR>
+ inline bool
+ operator>=(const reverse_iterator<_IteratorL>& __x,
+ const reverse_iterator<_IteratorR>& __y)
+ { return !(__x < __y); }
+
+ template<typename _IteratorL, typename _IteratorR>
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ // DR 685.
+ inline auto
+ operator-(const reverse_iterator<_IteratorL>& __x,
+ const reverse_iterator<_IteratorR>& __y)
+ -> decltype(__y.base() - __x.base())
+#else
+ inline typename reverse_iterator<_IteratorL>::difference_type
+ operator-(const reverse_iterator<_IteratorL>& __x,
+ const reverse_iterator<_IteratorR>& __y)
+#endif
+ { return __y.base() - __x.base(); }
+ //@}
+
+ // 24.4.2.2.1 back_insert_iterator
+ /**
+ * @brief Turns assignment into insertion.
+ *
+ * These are output iterators, constructed from a container-of-T.
+ * Assigning a T to the iterator appends it to the container using
+ * push_back.
+ *
+ * Tip: Using the back_inserter function to create these iterators can
+ * save typing.
+ */
+ template<typename _Container>
+ class back_insert_iterator
+ : public iterator<output_iterator_tag, void, void, void, void>
+ {
+ protected:
+ _Container* container;
+
+ public:
+ /// A nested typedef for the type of whatever container you used.
+ typedef _Container container_type;
+
+ /// The only way to create this %iterator is with a container.
+ explicit
+ back_insert_iterator(_Container& __x) : container(&__x) { }
+
+ /**
+ * @param value An instance of whatever type
+ * container_type::const_reference is; presumably a
+ * reference-to-const T for container<T>.
+ * @return This %iterator, for chained operations.
+ *
+ * This kind of %iterator doesn't really have a "position" in the
+ * container (you can think of the position as being permanently at
+ * the end, if you like). Assigning a value to the %iterator will
+ * always append the value to the end of the container.
+ */
+ back_insert_iterator&
+ operator=(typename _Container::const_reference __value)
+ {
+ container->push_back(__value);
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ back_insert_iterator&
+ operator=(typename _Container::value_type&& __value)
+ {
+ container->push_back(std::move(__value));
+ return *this;
+ }
+#endif
+
+ /// Simply returns *this.
+ back_insert_iterator&
+ operator*()
+ { return *this; }
+
+ /// Simply returns *this. (This %iterator does not "move".)
+ back_insert_iterator&
+ operator++()
+ { return *this; }
+
+ /// Simply returns *this. (This %iterator does not "move".)
+ back_insert_iterator
+ operator++(int)
+ { return *this; }
+ };
+
+ /**
+ * @param x A container of arbitrary type.
+ * @return An instance of back_insert_iterator working on @p x.
+ *
+ * This wrapper function helps in creating back_insert_iterator instances.
+ * Typing the name of the %iterator requires knowing the precise full
+ * type of the container, which can be tedious and impedes generic
+ * programming. Using this function lets you take advantage of automatic
+ * template parameter deduction, making the compiler match the correct
+ * types for you.
+ */
+ template<typename _Container>
+ inline back_insert_iterator<_Container>
+ back_inserter(_Container& __x)
+ { return back_insert_iterator<_Container>(__x); }
+
+ /**
+ * @brief Turns assignment into insertion.
+ *
+ * These are output iterators, constructed from a container-of-T.
+ * Assigning a T to the iterator prepends it to the container using
+ * push_front.
+ *
+ * Tip: Using the front_inserter function to create these iterators can
+ * save typing.
+ */
+ template<typename _Container>
+ class front_insert_iterator
+ : public iterator<output_iterator_tag, void, void, void, void>
+ {
+ protected:
+ _Container* container;
+
+ public:
+ /// A nested typedef for the type of whatever container you used.
+ typedef _Container container_type;
+
+ /// The only way to create this %iterator is with a container.
+ explicit front_insert_iterator(_Container& __x) : container(&__x) { }
+
+ /**
+ * @param value An instance of whatever type
+ * container_type::const_reference is; presumably a
+ * reference-to-const T for container<T>.
+ * @return This %iterator, for chained operations.
+ *
+ * This kind of %iterator doesn't really have a "position" in the
+ * container (you can think of the position as being permanently at
+ * the front, if you like). Assigning a value to the %iterator will
+ * always prepend the value to the front of the container.
+ */
+ front_insert_iterator&
+ operator=(typename _Container::const_reference __value)
+ {
+ container->push_front(__value);
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ front_insert_iterator&
+ operator=(typename _Container::value_type&& __value)
+ {
+ container->push_front(std::move(__value));
+ return *this;
+ }
+#endif
+
+ /// Simply returns *this.
+ front_insert_iterator&
+ operator*()
+ { return *this; }
+
+ /// Simply returns *this. (This %iterator does not "move".)
+ front_insert_iterator&
+ operator++()
+ { return *this; }
+
+ /// Simply returns *this. (This %iterator does not "move".)
+ front_insert_iterator
+ operator++(int)
+ { return *this; }
+ };
+
+ /**
+ * @param x A container of arbitrary type.
+ * @return An instance of front_insert_iterator working on @p x.
+ *
+ * This wrapper function helps in creating front_insert_iterator instances.
+ * Typing the name of the %iterator requires knowing the precise full
+ * type of the container, which can be tedious and impedes generic
+ * programming. Using this function lets you take advantage of automatic
+ * template parameter deduction, making the compiler match the correct
+ * types for you.
+ */
+ template<typename _Container>
+ inline front_insert_iterator<_Container>
+ front_inserter(_Container& __x)
+ { return front_insert_iterator<_Container>(__x); }
+
+ /**
+ * @brief Turns assignment into insertion.
+ *
+ * These are output iterators, constructed from a container-of-T.
+ * Assigning a T to the iterator inserts it in the container at the
+ * %iterator's position, rather than overwriting the value at that
+ * position.
+ *
+ * (Sequences will actually insert a @e copy of the value before the
+ * %iterator's position.)
+ *
+ * Tip: Using the inserter function to create these iterators can
+ * save typing.
+ */
+ template<typename _Container>
+ class insert_iterator
+ : public iterator<output_iterator_tag, void, void, void, void>
+ {
+ protected:
+ _Container* container;
+ typename _Container::iterator iter;
+
+ public:
+ /// A nested typedef for the type of whatever container you used.
+ typedef _Container container_type;
+
+ /**
+ * The only way to create this %iterator is with a container and an
+ * initial position (a normal %iterator into the container).
+ */
+ insert_iterator(_Container& __x, typename _Container::iterator __i)
+ : container(&__x), iter(__i) {}
+
+ /**
+ * @param value An instance of whatever type
+ * container_type::const_reference is; presumably a
+ * reference-to-const T for container<T>.
+ * @return This %iterator, for chained operations.
+ *
+ * This kind of %iterator maintains its own position in the
+ * container. Assigning a value to the %iterator will insert the
+ * value into the container at the place before the %iterator.
+ *
+ * The position is maintained such that subsequent assignments will
+ * insert values immediately after one another. For example,
+ * @code
+ * // vector v contains A and Z
+ *
+ * insert_iterator i (v, ++v.begin());
+ * i = 1;
+ * i = 2;
+ * i = 3;
+ *
+ * // vector v contains A, 1, 2, 3, and Z
+ * @endcode
+ */
+ insert_iterator&
+ operator=(typename _Container::const_reference __value)
+ {
+ iter = container->insert(iter, __value);
+ ++iter;
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ insert_iterator&
+ operator=(typename _Container::value_type&& __value)
+ {
+ iter = container->insert(iter, std::move(__value));
+ ++iter;
+ return *this;
+ }
+#endif
+
+ /// Simply returns *this.
+ insert_iterator&
+ operator*()
+ { return *this; }
+
+ /// Simply returns *this. (This %iterator does not "move".)
+ insert_iterator&
+ operator++()
+ { return *this; }
+
+ /// Simply returns *this. (This %iterator does not "move".)
+ insert_iterator&
+ operator++(int)
+ { return *this; }
+ };
+
+ /**
+ * @param x A container of arbitrary type.
+ * @return An instance of insert_iterator working on @p x.
+ *
+ * This wrapper function helps in creating insert_iterator instances.
+ * Typing the name of the %iterator requires knowing the precise full
+ * type of the container, which can be tedious and impedes generic
+ * programming. Using this function lets you take advantage of automatic
+ * template parameter deduction, making the compiler match the correct
+ * types for you.
+ */
+ template<typename _Container, typename _Iterator>
+ inline insert_iterator<_Container>
+ inserter(_Container& __x, _Iterator __i)
+ {
+ return insert_iterator<_Container>(__x,
+ typename _Container::iterator(__i));
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ // This iterator adapter is 'normal' in the sense that it does not
+ // change the semantics of any of the operators of its iterator
+ // parameter. Its primary purpose is to convert an iterator that is
+ // not a class, e.g. a pointer, into an iterator that is a class.
+ // The _Container parameter exists solely so that different containers
+ // using this template can instantiate different types, even if the
+ // _Iterator parameter is the same.
+ using std::iterator_traits;
+ using std::iterator;
+ template<typename _Iterator, typename _Container>
+ class __normal_iterator
+ {
+ protected:
+ _Iterator _M_current;
+
+ public:
+ typedef _Iterator iterator_type;
+ typedef typename iterator_traits<_Iterator>::iterator_category
+ iterator_category;
+ typedef typename iterator_traits<_Iterator>::value_type value_type;
+ typedef typename iterator_traits<_Iterator>::difference_type
+ difference_type;
+ typedef typename iterator_traits<_Iterator>::reference reference;
+ typedef typename iterator_traits<_Iterator>::pointer pointer;
+
+ __normal_iterator() : _M_current(_Iterator()) { }
+
+ explicit
+ __normal_iterator(const _Iterator& __i) : _M_current(__i) { }
+
+ // Allow iterator to const_iterator conversion
+ template<typename _Iter>
+ __normal_iterator(const __normal_iterator<_Iter,
+ typename __enable_if<
+ (std::__are_same<_Iter, typename _Container::pointer>::__value),
+ _Container>::__type>& __i)
+ : _M_current(__i.base()) { }
+
+ // Forward iterator requirements
+ reference
+ operator*() const
+ { return *_M_current; }
+
+ pointer
+ operator->() const
+ { return _M_current; }
+
+ __normal_iterator&
+ operator++()
+ {
+ ++_M_current;
+ return *this;
+ }
+
+ __normal_iterator
+ operator++(int)
+ { return __normal_iterator(_M_current++); }
+
+ // Bidirectional iterator requirements
+ __normal_iterator&
+ operator--()
+ {
+ --_M_current;
+ return *this;
+ }
+
+ __normal_iterator
+ operator--(int)
+ { return __normal_iterator(_M_current--); }
+
+ // Random access iterator requirements
+ reference
+ operator[](const difference_type& __n) const
+ { return _M_current[__n]; }
+
+ __normal_iterator&
+ operator+=(const difference_type& __n)
+ { _M_current += __n; return *this; }
+
+ __normal_iterator
+ operator+(const difference_type& __n) const
+ { return __normal_iterator(_M_current + __n); }
+
+ __normal_iterator&
+ operator-=(const difference_type& __n)
+ { _M_current -= __n; return *this; }
+
+ __normal_iterator
+ operator-(const difference_type& __n) const
+ { return __normal_iterator(_M_current - __n); }
+
+ const _Iterator&
+ base() const
+ { return _M_current; }
+ };
+
+ // Note: In what follows, the left- and right-hand-side iterators are
+ // allowed to vary in types (conceptually in cv-qualification) so that
+ // comparison between cv-qualified and non-cv-qualified iterators be
+ // valid. However, the greedy and unfriendly operators in std::rel_ops
+ // will make overload resolution ambiguous (when in scope) if we don't
+ // provide overloads whose operands are of the same type. Can someone
+ // remind me what generic programming is about? -- Gaby
+
+ // Forward iterator requirements
+ template<typename _IteratorL, typename _IteratorR, typename _Container>
+ inline bool
+ operator==(const __normal_iterator<_IteratorL, _Container>& __lhs,
+ const __normal_iterator<_IteratorR, _Container>& __rhs)
+ { return __lhs.base() == __rhs.base(); }
+
+ template<typename _Iterator, typename _Container>
+ inline bool
+ operator==(const __normal_iterator<_Iterator, _Container>& __lhs,
+ const __normal_iterator<_Iterator, _Container>& __rhs)
+ { return __lhs.base() == __rhs.base(); }
+
+ template<typename _IteratorL, typename _IteratorR, typename _Container>
+ inline bool
+ operator!=(const __normal_iterator<_IteratorL, _Container>& __lhs,
+ const __normal_iterator<_IteratorR, _Container>& __rhs)
+ { return __lhs.base() != __rhs.base(); }
+
+ template<typename _Iterator, typename _Container>
+ inline bool
+ operator!=(const __normal_iterator<_Iterator, _Container>& __lhs,
+ const __normal_iterator<_Iterator, _Container>& __rhs)
+ { return __lhs.base() != __rhs.base(); }
+
+ // Random access iterator requirements
+ template<typename _IteratorL, typename _IteratorR, typename _Container>
+ inline bool
+ operator<(const __normal_iterator<_IteratorL, _Container>& __lhs,
+ const __normal_iterator<_IteratorR, _Container>& __rhs)
+ { return __lhs.base() < __rhs.base(); }
+
+ template<typename _Iterator, typename _Container>
+ inline bool
+ operator<(const __normal_iterator<_Iterator, _Container>& __lhs,
+ const __normal_iterator<_Iterator, _Container>& __rhs)
+ { return __lhs.base() < __rhs.base(); }
+
+ template<typename _IteratorL, typename _IteratorR, typename _Container>
+ inline bool
+ operator>(const __normal_iterator<_IteratorL, _Container>& __lhs,
+ const __normal_iterator<_IteratorR, _Container>& __rhs)
+ { return __lhs.base() > __rhs.base(); }
+
+ template<typename _Iterator, typename _Container>
+ inline bool
+ operator>(const __normal_iterator<_Iterator, _Container>& __lhs,
+ const __normal_iterator<_Iterator, _Container>& __rhs)
+ { return __lhs.base() > __rhs.base(); }
+
+ template<typename _IteratorL, typename _IteratorR, typename _Container>
+ inline bool
+ operator<=(const __normal_iterator<_IteratorL, _Container>& __lhs,
+ const __normal_iterator<_IteratorR, _Container>& __rhs)
+ { return __lhs.base() <= __rhs.base(); }
+
+ template<typename _Iterator, typename _Container>
+ inline bool
+ operator<=(const __normal_iterator<_Iterator, _Container>& __lhs,
+ const __normal_iterator<_Iterator, _Container>& __rhs)
+ { return __lhs.base() <= __rhs.base(); }
+
+ template<typename _IteratorL, typename _IteratorR, typename _Container>
+ inline bool
+ operator>=(const __normal_iterator<_IteratorL, _Container>& __lhs,
+ const __normal_iterator<_IteratorR, _Container>& __rhs)
+ { return __lhs.base() >= __rhs.base(); }
+
+ template<typename _Iterator, typename _Container>
+ inline bool
+ operator>=(const __normal_iterator<_Iterator, _Container>& __lhs,
+ const __normal_iterator<_Iterator, _Container>& __rhs)
+ { return __lhs.base() >= __rhs.base(); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // According to the resolution of DR179 not only the various comparison
+ // operators but also operator- must accept mixed iterator/const_iterator
+ // parameters.
+ template<typename _IteratorL, typename _IteratorR, typename _Container>
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ // DR 685.
+ inline auto
+ operator-(const __normal_iterator<_IteratorL, _Container>& __lhs,
+ const __normal_iterator<_IteratorR, _Container>& __rhs)
+ -> decltype(__lhs.base() - __rhs.base())
+#else
+ inline typename __normal_iterator<_IteratorL, _Container>::difference_type
+ operator-(const __normal_iterator<_IteratorL, _Container>& __lhs,
+ const __normal_iterator<_IteratorR, _Container>& __rhs)
+#endif
+ { return __lhs.base() - __rhs.base(); }
+
+ template<typename _Iterator, typename _Container>
+ inline typename __normal_iterator<_Iterator, _Container>::difference_type
+ operator-(const __normal_iterator<_Iterator, _Container>& __lhs,
+ const __normal_iterator<_Iterator, _Container>& __rhs)
+ { return __lhs.base() - __rhs.base(); }
+
+ template<typename _Iterator, typename _Container>
+ inline __normal_iterator<_Iterator, _Container>
+ operator+(typename __normal_iterator<_Iterator, _Container>::difference_type
+ __n, const __normal_iterator<_Iterator, _Container>& __i)
+ { return __normal_iterator<_Iterator, _Container>(__i.base() + __n); }
+
+_GLIBCXX_END_NAMESPACE
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // 24.4.3 Move iterators
+ /**
+ * Class template move_iterator is an iterator adapter with the same
+ * behavior as the underlying iterator except that its dereference
+ * operator implicitly converts the value returned by the underlying
+ * iterator's dereference operator to an rvalue reference. Some
+ * generic algorithms can be called with move iterators to replace
+ * copying with moving.
+ */
+ template<typename _Iterator>
+ class move_iterator
+ {
+ protected:
+ _Iterator _M_current;
+
+ public:
+ typedef _Iterator iterator_type;
+ typedef typename iterator_traits<_Iterator>::difference_type
+ difference_type;
+ // NB: DR 680.
+ typedef _Iterator pointer;
+ typedef typename iterator_traits<_Iterator>::value_type value_type;
+ typedef typename iterator_traits<_Iterator>::iterator_category
+ iterator_category;
+ typedef value_type&& reference;
+
+ public:
+ move_iterator()
+ : _M_current() { }
+
+ explicit
+ move_iterator(iterator_type __i)
+ : _M_current(__i) { }
+
+ template<typename _Iter>
+ move_iterator(const move_iterator<_Iter>& __i)
+ : _M_current(__i.base()) { }
+
+ iterator_type
+ base() const
+ { return _M_current; }
+
+ reference
+ operator*() const
+ { return *_M_current; }
+
+ pointer
+ operator->() const
+ { return _M_current; }
+
+ move_iterator&
+ operator++()
+ {
+ ++_M_current;
+ return *this;
+ }
+
+ move_iterator
+ operator++(int)
+ {
+ move_iterator __tmp = *this;
+ ++_M_current;
+ return __tmp;
+ }
+
+ move_iterator&
+ operator--()
+ {
+ --_M_current;
+ return *this;
+ }
+
+ move_iterator
+ operator--(int)
+ {
+ move_iterator __tmp = *this;
+ --_M_current;
+ return __tmp;
+ }
+
+ move_iterator
+ operator+(difference_type __n) const
+ { return move_iterator(_M_current + __n); }
+
+ move_iterator&
+ operator+=(difference_type __n)
+ {
+ _M_current += __n;
+ return *this;
+ }
+
+ move_iterator
+ operator-(difference_type __n) const
+ { return move_iterator(_M_current - __n); }
+
+ move_iterator&
+ operator-=(difference_type __n)
+ {
+ _M_current -= __n;
+ return *this;
+ }
+
+ reference
+ operator[](difference_type __n) const
+ { return _M_current[__n]; }
+ };
+
+ template<typename _IteratorL, typename _IteratorR>
+ inline bool
+ operator==(const move_iterator<_IteratorL>& __x,
+ const move_iterator<_IteratorR>& __y)
+ { return __x.base() == __y.base(); }
+
+ template<typename _IteratorL, typename _IteratorR>
+ inline bool
+ operator!=(const move_iterator<_IteratorL>& __x,
+ const move_iterator<_IteratorR>& __y)
+ { return !(__x == __y); }
+
+ template<typename _IteratorL, typename _IteratorR>
+ inline bool
+ operator<(const move_iterator<_IteratorL>& __x,
+ const move_iterator<_IteratorR>& __y)
+ { return __x.base() < __y.base(); }
+
+ template<typename _IteratorL, typename _IteratorR>
+ inline bool
+ operator<=(const move_iterator<_IteratorL>& __x,
+ const move_iterator<_IteratorR>& __y)
+ { return !(__y < __x); }
+
+ template<typename _IteratorL, typename _IteratorR>
+ inline bool
+ operator>(const move_iterator<_IteratorL>& __x,
+ const move_iterator<_IteratorR>& __y)
+ { return __y < __x; }
+
+ template<typename _IteratorL, typename _IteratorR>
+ inline bool
+ operator>=(const move_iterator<_IteratorL>& __x,
+ const move_iterator<_IteratorR>& __y)
+ { return !(__x < __y); }
+
+ // DR 685.
+ template<typename _IteratorL, typename _IteratorR>
+ inline auto
+ operator-(const move_iterator<_IteratorL>& __x,
+ const move_iterator<_IteratorR>& __y)
+ -> decltype(__x.base() - __y.base())
+ { return __x.base() - __y.base(); }
+
+ template<typename _Iterator>
+ inline move_iterator<_Iterator>
+ operator+(typename move_iterator<_Iterator>::difference_type __n,
+ const move_iterator<_Iterator>& __x)
+ { return __x + __n; }
+
+ template<typename _Iterator>
+ inline move_iterator<_Iterator>
+ make_move_iterator(const _Iterator& __i)
+ { return move_iterator<_Iterator>(__i); }
+
+_GLIBCXX_END_NAMESPACE
+
+#define _GLIBCXX_MAKE_MOVE_ITERATOR(_Iter) std::make_move_iterator(_Iter)
+#else
+#define _GLIBCXX_MAKE_MOVE_ITERATOR(_Iter) (_Iter)
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/bits/stl_iterator_base_funcs.h b/i686-linux/include/c++/4.4.3/bits/stl_iterator_base_funcs.h
new file mode 100644
index 0000000..0a854fa
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/stl_iterator_base_funcs.h
@@ -0,0 +1,197 @@
+// Functions used by iterators -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996-1998
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_iterator_base_funcs.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ *
+ * This file contains all of the general iterator-related utility
+ * functions, such as distance() and advance().
+ */
+
+#ifndef _STL_ITERATOR_BASE_FUNCS_H
+#define _STL_ITERATOR_BASE_FUNCS_H 1
+
+#pragma GCC system_header
+#include <bits/concept_check.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _InputIterator>
+ inline typename iterator_traits<_InputIterator>::difference_type
+ __distance(_InputIterator __first, _InputIterator __last,
+ input_iterator_tag)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+
+ typename iterator_traits<_InputIterator>::difference_type __n = 0;
+ while (__first != __last)
+ {
+ ++__first;
+ ++__n;
+ }
+ return __n;
+ }
+
+ template<typename _RandomAccessIterator>
+ inline typename iterator_traits<_RandomAccessIterator>::difference_type
+ __distance(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ random_access_iterator_tag)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ return __last - __first;
+ }
+
+ /**
+ * @brief A generalization of pointer arithmetic.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @return The distance between them.
+ *
+ * Returns @c n such that first + n == last. This requires that @p last
+ * must be reachable from @p first. Note that @c n may be negative.
+ *
+ * For random access iterators, this uses their @c + and @c - operations
+ * and are constant time. For other %iterator classes they are linear time.
+ */
+ template<typename _InputIterator>
+ inline typename iterator_traits<_InputIterator>::difference_type
+ distance(_InputIterator __first, _InputIterator __last)
+ {
+ // concept requirements -- taken care of in __distance
+ return std::__distance(__first, __last,
+ std::__iterator_category(__first));
+ }
+
+ template<typename _InputIterator, typename _Distance>
+ inline void
+ __advance(_InputIterator& __i, _Distance __n, input_iterator_tag)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ while (__n--)
+ ++__i;
+ }
+
+ template<typename _BidirectionalIterator, typename _Distance>
+ inline void
+ __advance(_BidirectionalIterator& __i, _Distance __n,
+ bidirectional_iterator_tag)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_BidirectionalIteratorConcept<
+ _BidirectionalIterator>)
+ if (__n > 0)
+ while (__n--)
+ ++__i;
+ else
+ while (__n++)
+ --__i;
+ }
+
+ template<typename _RandomAccessIterator, typename _Distance>
+ inline void
+ __advance(_RandomAccessIterator& __i, _Distance __n,
+ random_access_iterator_tag)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __i += __n;
+ }
+
+ /**
+ * @brief A generalization of pointer arithmetic.
+ * @param i An input iterator.
+ * @param n The "delta" by which to change @p i.
+ * @return Nothing.
+ *
+ * This increments @p i by @p n. For bidirectional and random access
+ * iterators, @p n may be negative, in which case @p i is decremented.
+ *
+ * For random access iterators, this uses their @c + and @c - operations
+ * and are constant time. For other %iterator classes they are linear time.
+ */
+ template<typename _InputIterator, typename _Distance>
+ inline void
+ advance(_InputIterator& __i, _Distance __n)
+ {
+ // concept requirements -- taken care of in __advance
+ typename iterator_traits<_InputIterator>::difference_type __d = __n;
+ std::__advance(__i, __d, std::__iterator_category(__i));
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _InputIterator>
+ inline _InputIterator
+ next(_InputIterator __x, typename
+ iterator_traits<_InputIterator>::difference_type __n = 1)
+ {
+ std::advance(__x, __n);
+ return __x;
+ }
+
+ template<typename _BidirectionalIterator>
+ inline _BidirectionalIterator
+ prev(_BidirectionalIterator __x, typename
+ iterator_traits<_BidirectionalIterator>::difference_type __n = 1)
+ {
+ std::advance(__x, -__n);
+ return __x;
+ }
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _STL_ITERATOR_BASE_FUNCS_H */
diff --git a/i686-linux/include/c++/4.4.3/bits/stl_iterator_base_types.h b/i686-linux/include/c++/4.4.3/bits/stl_iterator_base_types.h
new file mode 100644
index 0000000..6dc0d78
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/stl_iterator_base_types.h
@@ -0,0 +1,168 @@
+// Types used in iterator implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996-1998
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_iterator_base_types.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ *
+ * This file contains all of the general iterator-related utility types,
+ * such as iterator_traits and struct iterator.
+ */
+
+#ifndef _STL_ITERATOR_BASE_TYPES_H
+#define _STL_ITERATOR_BASE_TYPES_H 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <cstddef>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @defgroup iterators Iterators
+ * These are empty types, used to distinguish different iterators. The
+ * distinction is not made by what they contain, but simply by what they
+ * are. Different underlying algorithms can then be used based on the
+ * different operations supported by different iterator types.
+ */
+ //@{
+ /// Marking input iterators.
+ struct input_iterator_tag { };
+ /// Marking output iterators.
+ struct output_iterator_tag { };
+ /// Forward iterators support a superset of input iterator operations.
+ struct forward_iterator_tag : public input_iterator_tag { };
+ /// Bidirectional iterators support a superset of forward iterator
+ /// operations.
+ struct bidirectional_iterator_tag : public forward_iterator_tag { };
+ /// Random-access iterators support a superset of bidirectional iterator
+ /// operations.
+ struct random_access_iterator_tag : public bidirectional_iterator_tag { };
+
+
+ /**
+ * @brief Common %iterator class.
+ *
+ * This class does nothing but define nested typedefs. %Iterator classes
+ * can inherit from this class to save some work. The typedefs are then
+ * used in specializations and overloading.
+ *
+ * In particular, there are no default implementations of requirements
+ * such as @c operator++ and the like. (How could there be?)
+ */
+ template<typename _Category, typename _Tp, typename _Distance = ptrdiff_t,
+ typename _Pointer = _Tp*, typename _Reference = _Tp&>
+ struct iterator
+ {
+ /// One of the @link iterator_tags tag types@endlink.
+ typedef _Category iterator_category;
+ /// The type "pointed to" by the iterator.
+ typedef _Tp value_type;
+ /// Distance between iterators is represented as this type.
+ typedef _Distance difference_type;
+ /// This type represents a pointer-to-value_type.
+ typedef _Pointer pointer;
+ /// This type represents a reference-to-value_type.
+ typedef _Reference reference;
+ };
+
+ /**
+ * This class does nothing but define nested typedefs. The general
+ * version simply "forwards" the nested typedefs from the Iterator
+ * argument. Specialized versions for pointers and pointers-to-const
+ * provide tighter, more correct semantics.
+ */
+ template<typename _Iterator>
+ struct iterator_traits
+ {
+ typedef typename _Iterator::iterator_category iterator_category;
+ typedef typename _Iterator::value_type value_type;
+ typedef typename _Iterator::difference_type difference_type;
+ typedef typename _Iterator::pointer pointer;
+ typedef typename _Iterator::reference reference;
+ };
+
+ template<typename _Tp>
+ struct iterator_traits<_Tp*>
+ {
+ typedef random_access_iterator_tag iterator_category;
+ typedef _Tp value_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Tp* pointer;
+ typedef _Tp& reference;
+ };
+
+ template<typename _Tp>
+ struct iterator_traits<const _Tp*>
+ {
+ typedef random_access_iterator_tag iterator_category;
+ typedef _Tp value_type;
+ typedef ptrdiff_t difference_type;
+ typedef const _Tp* pointer;
+ typedef const _Tp& reference;
+ };
+
+ /**
+ * This function is not a part of the C++ standard but is syntactic
+ * sugar for internal library use only.
+ */
+ template<typename _Iter>
+ inline typename iterator_traits<_Iter>::iterator_category
+ __iterator_category(const _Iter&)
+ { return typename iterator_traits<_Iter>::iterator_category(); }
+
+ //@}
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _STL_ITERATOR_BASE_TYPES_H */
+
diff --git a/i686-linux/include/c++/4.4.3/bits/stl_list.h b/i686-linux/include/c++/4.4.3/bits/stl_list.h
new file mode 100644
index 0000000..66a50b8
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/stl_list.h
@@ -0,0 +1,1533 @@
+// List implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_list.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_LIST_H
+#define _STL_LIST_H 1
+
+#include <bits/concept_check.h>
+#include <initializer_list>
+
+_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
+
+ // Supporting structures are split into common and templated types; the
+ // latter publicly inherits from the former in an effort to reduce code
+ // duplication. This results in some "needless" static_cast'ing later on,
+ // but it's all safe downcasting.
+
+ /// Common part of a node in the %list.
+ struct _List_node_base
+ {
+ _List_node_base* _M_next;
+ _List_node_base* _M_prev;
+
+ static void
+ swap(_List_node_base& __x, _List_node_base& __y);
+
+ void
+ transfer(_List_node_base * const __first,
+ _List_node_base * const __last);
+
+ void
+ reverse();
+
+ void
+ hook(_List_node_base * const __position);
+
+ void
+ unhook();
+ };
+
+ /// An actual node in the %list.
+ template<typename _Tp>
+ struct _List_node : public _List_node_base
+ {
+ ///< User's data.
+ _Tp _M_data;
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename... _Args>
+ _List_node(_Args&&... __args)
+ : _List_node_base(), _M_data(std::forward<_Args>(__args)...) { }
+#endif
+ };
+
+ /**
+ * @brief A list::iterator.
+ *
+ * All the functions are op overloads.
+ */
+ template<typename _Tp>
+ struct _List_iterator
+ {
+ typedef _List_iterator<_Tp> _Self;
+ typedef _List_node<_Tp> _Node;
+
+ typedef ptrdiff_t difference_type;
+ typedef std::bidirectional_iterator_tag iterator_category;
+ typedef _Tp value_type;
+ typedef _Tp* pointer;
+ typedef _Tp& reference;
+
+ _List_iterator()
+ : _M_node() { }
+
+ explicit
+ _List_iterator(_List_node_base* __x)
+ : _M_node(__x) { }
+
+ // Must downcast from List_node_base to _List_node to get to _M_data.
+ reference
+ operator*() const
+ { return static_cast<_Node*>(_M_node)->_M_data; }
+
+ pointer
+ operator->() const
+ { return &static_cast<_Node*>(_M_node)->_M_data; }
+
+ _Self&
+ operator++()
+ {
+ _M_node = _M_node->_M_next;
+ return *this;
+ }
+
+ _Self
+ operator++(int)
+ {
+ _Self __tmp = *this;
+ _M_node = _M_node->_M_next;
+ return __tmp;
+ }
+
+ _Self&
+ operator--()
+ {
+ _M_node = _M_node->_M_prev;
+ return *this;
+ }
+
+ _Self
+ operator--(int)
+ {
+ _Self __tmp = *this;
+ _M_node = _M_node->_M_prev;
+ return __tmp;
+ }
+
+ bool
+ operator==(const _Self& __x) const
+ { return _M_node == __x._M_node; }
+
+ bool
+ operator!=(const _Self& __x) const
+ { return _M_node != __x._M_node; }
+
+ // The only member points to the %list element.
+ _List_node_base* _M_node;
+ };
+
+ /**
+ * @brief A list::const_iterator.
+ *
+ * All the functions are op overloads.
+ */
+ template<typename _Tp>
+ struct _List_const_iterator
+ {
+ typedef _List_const_iterator<_Tp> _Self;
+ typedef const _List_node<_Tp> _Node;
+ typedef _List_iterator<_Tp> iterator;
+
+ typedef ptrdiff_t difference_type;
+ typedef std::bidirectional_iterator_tag iterator_category;
+ typedef _Tp value_type;
+ typedef const _Tp* pointer;
+ typedef const _Tp& reference;
+
+ _List_const_iterator()
+ : _M_node() { }
+
+ explicit
+ _List_const_iterator(const _List_node_base* __x)
+ : _M_node(__x) { }
+
+ _List_const_iterator(const iterator& __x)
+ : _M_node(__x._M_node) { }
+
+ // Must downcast from List_node_base to _List_node to get to
+ // _M_data.
+ reference
+ operator*() const
+ { return static_cast<_Node*>(_M_node)->_M_data; }
+
+ pointer
+ operator->() const
+ { return &static_cast<_Node*>(_M_node)->_M_data; }
+
+ _Self&
+ operator++()
+ {
+ _M_node = _M_node->_M_next;
+ return *this;
+ }
+
+ _Self
+ operator++(int)
+ {
+ _Self __tmp = *this;
+ _M_node = _M_node->_M_next;
+ return __tmp;
+ }
+
+ _Self&
+ operator--()
+ {
+ _M_node = _M_node->_M_prev;
+ return *this;
+ }
+
+ _Self
+ operator--(int)
+ {
+ _Self __tmp = *this;
+ _M_node = _M_node->_M_prev;
+ return __tmp;
+ }
+
+ bool
+ operator==(const _Self& __x) const
+ { return _M_node == __x._M_node; }
+
+ bool
+ operator!=(const _Self& __x) const
+ { return _M_node != __x._M_node; }
+
+ // The only member points to the %list element.
+ const _List_node_base* _M_node;
+ };
+
+ template<typename _Val>
+ inline bool
+ operator==(const _List_iterator<_Val>& __x,
+ const _List_const_iterator<_Val>& __y)
+ { return __x._M_node == __y._M_node; }
+
+ template<typename _Val>
+ inline bool
+ operator!=(const _List_iterator<_Val>& __x,
+ const _List_const_iterator<_Val>& __y)
+ { return __x._M_node != __y._M_node; }
+
+
+ /// See bits/stl_deque.h's _Deque_base for an explanation.
+ template<typename _Tp, typename _Alloc>
+ class _List_base
+ {
+ protected:
+ // NOTA BENE
+ // The stored instance is not actually of "allocator_type"'s
+ // type. Instead we rebind the type to
+ // Allocator<List_node<Tp>>, which according to [20.1.5]/4
+ // should probably be the same. List_node<Tp> is not the same
+ // size as Tp (it's two pointers larger), and specializations on
+ // Tp may go unused because List_node<Tp> is being bound
+ // instead.
+ //
+ // We put this to the test in the constructors and in
+ // get_allocator, where we use conversions between
+ // allocator_type and _Node_alloc_type. The conversion is
+ // required by table 32 in [20.1.5].
+ typedef typename _Alloc::template rebind<_List_node<_Tp> >::other
+ _Node_alloc_type;
+
+ typedef typename _Alloc::template rebind<_Tp>::other _Tp_alloc_type;
+
+ struct _List_impl
+ : public _Node_alloc_type
+ {
+ _List_node_base _M_node;
+
+ _List_impl()
+ : _Node_alloc_type(), _M_node()
+ { }
+
+ _List_impl(const _Node_alloc_type& __a)
+ : _Node_alloc_type(__a), _M_node()
+ { }
+ };
+
+ _List_impl _M_impl;
+
+ _List_node<_Tp>*
+ _M_get_node()
+ { return _M_impl._Node_alloc_type::allocate(1); }
+
+ void
+ _M_put_node(_List_node<_Tp>* __p)
+ { _M_impl._Node_alloc_type::deallocate(__p, 1); }
+
+ public:
+ typedef _Alloc allocator_type;
+
+ _Node_alloc_type&
+ _M_get_Node_allocator()
+ { return *static_cast<_Node_alloc_type*>(&this->_M_impl); }
+
+ const _Node_alloc_type&
+ _M_get_Node_allocator() const
+ { return *static_cast<const _Node_alloc_type*>(&this->_M_impl); }
+
+ _Tp_alloc_type
+ _M_get_Tp_allocator() const
+ { return _Tp_alloc_type(_M_get_Node_allocator()); }
+
+ allocator_type
+ get_allocator() const
+ { return allocator_type(_M_get_Node_allocator()); }
+
+ _List_base()
+ : _M_impl()
+ { _M_init(); }
+
+ _List_base(const allocator_type& __a)
+ : _M_impl(__a)
+ { _M_init(); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ _List_base(_List_base&& __x)
+ : _M_impl(__x._M_get_Node_allocator())
+ {
+ _M_init();
+ _List_node_base::swap(this->_M_impl._M_node, __x._M_impl._M_node);
+ }
+#endif
+
+ // This is what actually destroys the list.
+ ~_List_base()
+ { _M_clear(); }
+
+ void
+ _M_clear();
+
+ void
+ _M_init()
+ {
+ this->_M_impl._M_node._M_next = &this->_M_impl._M_node;
+ this->_M_impl._M_node._M_prev = &this->_M_impl._M_node;
+ }
+ };
+
+ /**
+ * @brief A standard container with linear time access to elements,
+ * and fixed time insertion/deletion at any point in the sequence.
+ *
+ * @ingroup sequences
+ *
+ * Meets the requirements of a <a href="tables.html#65">container</a>, a
+ * <a href="tables.html#66">reversible container</a>, and a
+ * <a href="tables.html#67">sequence</a>, including the
+ * <a href="tables.html#68">optional sequence requirements</a> with the
+ * %exception of @c at and @c operator[].
+ *
+ * This is a @e doubly @e linked %list. Traversal up and down the
+ * %list requires linear time, but adding and removing elements (or
+ * @e nodes) is done in constant time, regardless of where the
+ * change takes place. Unlike std::vector and std::deque,
+ * random-access iterators are not provided, so subscripting ( @c
+ * [] ) access is not allowed. For algorithms which only need
+ * sequential access, this lack makes no difference.
+ *
+ * Also unlike the other standard containers, std::list provides
+ * specialized algorithms %unique to linked lists, such as
+ * splicing, sorting, and in-place reversal.
+ *
+ * A couple points on memory allocation for list<Tp>:
+ *
+ * First, we never actually allocate a Tp, we allocate
+ * List_node<Tp>'s and trust [20.1.5]/4 to DTRT. This is to ensure
+ * that after elements from %list<X,Alloc1> are spliced into
+ * %list<X,Alloc2>, destroying the memory of the second %list is a
+ * valid operation, i.e., Alloc1 giveth and Alloc2 taketh away.
+ *
+ * Second, a %list conceptually represented as
+ * @code
+ * A <---> B <---> C <---> D
+ * @endcode
+ * is actually circular; a link exists between A and D. The %list
+ * class holds (as its only data member) a private list::iterator
+ * pointing to @e D, not to @e A! To get to the head of the %list,
+ * we start at the tail and move forward by one. When this member
+ * iterator's next/previous pointers refer to itself, the %list is
+ * %empty.
+ */
+ template<typename _Tp, typename _Alloc = std::allocator<_Tp> >
+ class list : protected _List_base<_Tp, _Alloc>
+ {
+ // concept requirements
+ typedef typename _Alloc::value_type _Alloc_value_type;
+ __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
+ __glibcxx_class_requires2(_Tp, _Alloc_value_type, _SameTypeConcept)
+
+ typedef _List_base<_Tp, _Alloc> _Base;
+ typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
+
+ public:
+ typedef _Tp value_type;
+ typedef typename _Tp_alloc_type::pointer pointer;
+ typedef typename _Tp_alloc_type::const_pointer const_pointer;
+ typedef typename _Tp_alloc_type::reference reference;
+ typedef typename _Tp_alloc_type::const_reference const_reference;
+ typedef _List_iterator<_Tp> iterator;
+ typedef _List_const_iterator<_Tp> const_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Alloc allocator_type;
+
+ protected:
+ // Note that pointers-to-_Node's can be ctor-converted to
+ // iterator types.
+ typedef _List_node<_Tp> _Node;
+
+ using _Base::_M_impl;
+ using _Base::_M_put_node;
+ using _Base::_M_get_node;
+ using _Base::_M_get_Tp_allocator;
+ using _Base::_M_get_Node_allocator;
+
+ /**
+ * @param x An instance of user data.
+ *
+ * Allocates space for a new node and constructs a copy of @a x in it.
+ */
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+ _Node*
+ _M_create_node(const value_type& __x)
+ {
+ _Node* __p = this->_M_get_node();
+ __try
+ {
+ _M_get_Tp_allocator().construct(&__p->_M_data, __x);
+ }
+ __catch(...)
+ {
+ _M_put_node(__p);
+ __throw_exception_again;
+ }
+ return __p;
+ }
+#else
+ template<typename... _Args>
+ _Node*
+ _M_create_node(_Args&&... __args)
+ {
+ _Node* __p = this->_M_get_node();
+ __try
+ {
+ _M_get_Node_allocator().construct(__p,
+ std::forward<_Args>(__args)...);
+ }
+ __catch(...)
+ {
+ _M_put_node(__p);
+ __throw_exception_again;
+ }
+ return __p;
+ }
+#endif
+
+ public:
+ // [23.2.2.1] construct/copy/destroy
+ // (assign() and get_allocator() are also listed in this section)
+ /**
+ * @brief Default constructor creates no elements.
+ */
+ list()
+ : _Base() { }
+
+ /**
+ * @brief Creates a %list with no elements.
+ * @param a An allocator object.
+ */
+ explicit
+ list(const allocator_type& __a)
+ : _Base(__a) { }
+
+ /**
+ * @brief Creates a %list with copies of an exemplar element.
+ * @param n The number of elements to initially create.
+ * @param value An element to copy.
+ * @param a An allocator object.
+ *
+ * This constructor fills the %list with @a n copies of @a value.
+ */
+ explicit
+ list(size_type __n, const value_type& __value = value_type(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ { _M_fill_initialize(__n, __value); }
+
+ /**
+ * @brief %List copy constructor.
+ * @param x A %list of identical element and allocator types.
+ *
+ * The newly-created %list uses a copy of the allocation object used
+ * by @a x.
+ */
+ list(const list& __x)
+ : _Base(__x._M_get_Node_allocator())
+ { _M_initialize_dispatch(__x.begin(), __x.end(), __false_type()); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief %List move constructor.
+ * @param x A %list of identical element and allocator types.
+ *
+ * The newly-created %list contains the exact contents of @a x.
+ * The contents of @a x are a valid, but unspecified %list.
+ */
+ list(list&& __x)
+ : _Base(std::forward<_Base>(__x)) { }
+
+ /**
+ * @brief Builds a %list from an initializer_list
+ * @param l An initializer_list of value_type.
+ * @param a An allocator object.
+ *
+ * Create a %list consisting of copies of the elements in the
+ * initializer_list @a l. This is linear in l.size().
+ */
+ list(initializer_list<value_type> __l,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ { _M_initialize_dispatch(__l.begin(), __l.end(), __false_type()); }
+#endif
+
+ /**
+ * @brief Builds a %list from a range.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param a An allocator object.
+ *
+ * Create a %list consisting of copies of the elements from
+ * [@a first,@a last). This is linear in N (where N is
+ * distance(@a first,@a last)).
+ */
+ template<typename _InputIterator>
+ list(_InputIterator __first, _InputIterator __last,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ {
+ // Check whether it's an integral type. If so, it's not an iterator.
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ _M_initialize_dispatch(__first, __last, _Integral());
+ }
+
+ /**
+ * No explicit dtor needed as the _Base dtor takes care of
+ * things. The _Base dtor only erases the elements, and note
+ * that if the elements themselves are pointers, the pointed-to
+ * memory is not touched in any way. Managing the pointer is
+ * the user's responsibility.
+ */
+
+ /**
+ * @brief %List assignment operator.
+ * @param x A %list of identical element and allocator types.
+ *
+ * All the elements of @a x are copied, but unlike the copy
+ * constructor, the allocator object is not copied.
+ */
+ list&
+ operator=(const list& __x);
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief %List move assignment operator.
+ * @param x A %list of identical element and allocator types.
+ *
+ * The contents of @a x are moved into this %list (without copying).
+ * @a x is a valid, but unspecified %list
+ */
+ list&
+ operator=(list&& __x)
+ {
+ // NB: DR 675.
+ this->clear();
+ this->swap(__x);
+ return *this;
+ }
+
+ /**
+ * @brief %List initializer list assignment operator.
+ * @param l An initializer_list of value_type.
+ *
+ * Replace the contents of the %list with copies of the elements
+ * in the initializer_list @a l. This is linear in l.size().
+ */
+ list&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->assign(__l.begin(), __l.end());
+ return *this;
+ }
+#endif
+
+ /**
+ * @brief Assigns a given value to a %list.
+ * @param n Number of elements to be assigned.
+ * @param val Value to be assigned.
+ *
+ * This function fills a %list with @a n copies of the given
+ * value. Note that the assignment completely changes the %list
+ * and that the resulting %list's size is the same as the number
+ * of elements assigned. Old data may be lost.
+ */
+ void
+ assign(size_type __n, const value_type& __val)
+ { _M_fill_assign(__n, __val); }
+
+ /**
+ * @brief Assigns a range to a %list.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ *
+ * This function fills a %list with copies of the elements in the
+ * range [@a first,@a last).
+ *
+ * Note that the assignment completely changes the %list and
+ * that the resulting %list's size is the same as the number of
+ * elements assigned. Old data may be lost.
+ */
+ template<typename _InputIterator>
+ void
+ assign(_InputIterator __first, _InputIterator __last)
+ {
+ // Check whether it's an integral type. If so, it's not an iterator.
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ _M_assign_dispatch(__first, __last, _Integral());
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Assigns an initializer_list to a %list.
+ * @param l An initializer_list of value_type.
+ *
+ * Replace the contents of the %list with copies of the elements
+ * in the initializer_list @a l. This is linear in l.size().
+ */
+ void
+ assign(initializer_list<value_type> __l)
+ { this->assign(__l.begin(), __l.end()); }
+#endif
+
+ /// Get a copy of the memory allocation object.
+ allocator_type
+ get_allocator() const
+ { return _Base::get_allocator(); }
+
+ // iterators
+ /**
+ * Returns a read/write iterator that points to the first element in the
+ * %list. Iteration is done in ordinary element order.
+ */
+ iterator
+ begin()
+ { return iterator(this->_M_impl._M_node._M_next); }
+
+ /**
+ * Returns a read-only (constant) iterator that points to the
+ * first element in the %list. Iteration is done in ordinary
+ * element order.
+ */
+ const_iterator
+ begin() const
+ { return const_iterator(this->_M_impl._M_node._M_next); }
+
+ /**
+ * Returns a read/write iterator that points one past the last
+ * element in the %list. Iteration is done in ordinary element
+ * order.
+ */
+ iterator
+ end()
+ { return iterator(&this->_M_impl._M_node); }
+
+ /**
+ * Returns a read-only (constant) iterator that points one past
+ * the last element in the %list. Iteration is done in ordinary
+ * element order.
+ */
+ const_iterator
+ end() const
+ { return const_iterator(&this->_M_impl._M_node); }
+
+ /**
+ * Returns a read/write reverse iterator that points to the last
+ * element in the %list. Iteration is done in reverse element
+ * order.
+ */
+ reverse_iterator
+ rbegin()
+ { return reverse_iterator(end()); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to
+ * the last element in the %list. Iteration is done in reverse
+ * element order.
+ */
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(end()); }
+
+ /**
+ * Returns a read/write reverse iterator that points to one
+ * before the first element in the %list. Iteration is done in
+ * reverse element order.
+ */
+ reverse_iterator
+ rend()
+ { return reverse_iterator(begin()); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to one
+ * before the first element in the %list. Iteration is done in reverse
+ * element order.
+ */
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(begin()); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * Returns a read-only (constant) iterator that points to the
+ * first element in the %list. Iteration is done in ordinary
+ * element order.
+ */
+ const_iterator
+ cbegin() const
+ { return const_iterator(this->_M_impl._M_node._M_next); }
+
+ /**
+ * Returns a read-only (constant) iterator that points one past
+ * the last element in the %list. Iteration is done in ordinary
+ * element order.
+ */
+ const_iterator
+ cend() const
+ { return const_iterator(&this->_M_impl._M_node); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to
+ * the last element in the %list. Iteration is done in reverse
+ * element order.
+ */
+ const_reverse_iterator
+ crbegin() const
+ { return const_reverse_iterator(end()); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to one
+ * before the first element in the %list. Iteration is done in reverse
+ * element order.
+ */
+ const_reverse_iterator
+ crend() const
+ { return const_reverse_iterator(begin()); }
+#endif
+
+ // [23.2.2.2] capacity
+ /**
+ * Returns true if the %list is empty. (Thus begin() would equal
+ * end().)
+ */
+ bool
+ empty() const
+ { return this->_M_impl._M_node._M_next == &this->_M_impl._M_node; }
+
+ /** Returns the number of elements in the %list. */
+ size_type
+ size() const
+ { return std::distance(begin(), end()); }
+
+ /** Returns the size() of the largest possible %list. */
+ size_type
+ max_size() const
+ { return _M_get_Node_allocator().max_size(); }
+
+ /**
+ * @brief Resizes the %list to the specified number of elements.
+ * @param new_size Number of elements the %list should contain.
+ * @param x Data with which new elements should be populated.
+ *
+ * This function will %resize the %list to the specified number
+ * of elements. If the number is smaller than the %list's
+ * current size the %list is truncated, otherwise the %list is
+ * extended and new elements are populated with given data.
+ */
+ void
+ resize(size_type __new_size, value_type __x = value_type());
+
+ // element access
+ /**
+ * Returns a read/write reference to the data at the first
+ * element of the %list.
+ */
+ reference
+ front()
+ { return *begin(); }
+
+ /**
+ * Returns a read-only (constant) reference to the data at the first
+ * element of the %list.
+ */
+ const_reference
+ front() const
+ { return *begin(); }
+
+ /**
+ * Returns a read/write reference to the data at the last element
+ * of the %list.
+ */
+ reference
+ back()
+ {
+ iterator __tmp = end();
+ --__tmp;
+ return *__tmp;
+ }
+
+ /**
+ * Returns a read-only (constant) reference to the data at the last
+ * element of the %list.
+ */
+ const_reference
+ back() const
+ {
+ const_iterator __tmp = end();
+ --__tmp;
+ return *__tmp;
+ }
+
+ // [23.2.2.3] modifiers
+ /**
+ * @brief Add data to the front of the %list.
+ * @param x Data to be added.
+ *
+ * This is a typical stack operation. The function creates an
+ * element at the front of the %list and assigns the given data
+ * to it. Due to the nature of a %list this operation can be
+ * done in constant time, and does not invalidate iterators and
+ * references.
+ */
+ void
+ push_front(const value_type& __x)
+ { this->_M_insert(begin(), __x); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ push_front(value_type&& __x)
+ { this->_M_insert(begin(), std::move(__x)); }
+
+ template<typename... _Args>
+ void
+ emplace_front(_Args&&... __args)
+ { this->_M_insert(begin(), std::forward<_Args>(__args)...); }
+#endif
+
+ /**
+ * @brief Removes first element.
+ *
+ * This is a typical stack operation. It shrinks the %list by
+ * one. Due to the nature of a %list this operation can be done
+ * in constant time, and only invalidates iterators/references to
+ * the element being removed.
+ *
+ * Note that no data is returned, and if the first element's data
+ * is needed, it should be retrieved before pop_front() is
+ * called.
+ */
+ void
+ pop_front()
+ { this->_M_erase(begin()); }
+
+ /**
+ * @brief Add data to the end of the %list.
+ * @param x Data to be added.
+ *
+ * This is a typical stack operation. The function creates an
+ * element at the end of the %list and assigns the given data to
+ * it. Due to the nature of a %list this operation can be done
+ * in constant time, and does not invalidate iterators and
+ * references.
+ */
+ void
+ push_back(const value_type& __x)
+ { this->_M_insert(end(), __x); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ push_back(value_type&& __x)
+ { this->_M_insert(end(), std::move(__x)); }
+
+ template<typename... _Args>
+ void
+ emplace_back(_Args&&... __args)
+ { this->_M_insert(end(), std::forward<_Args>(__args)...); }
+#endif
+
+ /**
+ * @brief Removes last element.
+ *
+ * This is a typical stack operation. It shrinks the %list by
+ * one. Due to the nature of a %list this operation can be done
+ * in constant time, and only invalidates iterators/references to
+ * the element being removed.
+ *
+ * Note that no data is returned, and if the last element's data
+ * is needed, it should be retrieved before pop_back() is called.
+ */
+ void
+ pop_back()
+ { this->_M_erase(iterator(this->_M_impl._M_node._M_prev)); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Constructs object in %list before specified iterator.
+ * @param position A const_iterator into the %list.
+ * @param args Arguments.
+ * @return An iterator that points to the inserted data.
+ *
+ * This function will insert an object of type T constructed
+ * with T(std::forward<Args>(args)...) before the specified
+ * location. Due to the nature of a %list this operation can
+ * be done in constant time, and does not invalidate iterators
+ * and references.
+ */
+ template<typename... _Args>
+ iterator
+ emplace(iterator __position, _Args&&... __args);
+#endif
+
+ /**
+ * @brief Inserts given value into %list before specified iterator.
+ * @param position An iterator into the %list.
+ * @param x Data to be inserted.
+ * @return An iterator that points to the inserted data.
+ *
+ * This function will insert a copy of the given value before
+ * the specified location. Due to the nature of a %list this
+ * operation can be done in constant time, and does not
+ * invalidate iterators and references.
+ */
+ iterator
+ insert(iterator __position, const value_type& __x);
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Inserts given rvalue into %list before specified iterator.
+ * @param position An iterator into the %list.
+ * @param x Data to be inserted.
+ * @return An iterator that points to the inserted data.
+ *
+ * This function will insert a copy of the given rvalue before
+ * the specified location. Due to the nature of a %list this
+ * operation can be done in constant time, and does not
+ * invalidate iterators and references.
+ */
+ iterator
+ insert(iterator __position, value_type&& __x)
+ { return emplace(__position, std::move(__x)); }
+
+ /**
+ * @brief Inserts the contents of an initializer_list into %list
+ * before specified iterator.
+ * @param p An iterator into the %list.
+ * @param l An initializer_list of value_type.
+ *
+ * This function will insert copies of the data in the
+ * initializer_list @a l into the %list before the location
+ * specified by @a p.
+ *
+ * This operation is linear in the number of elements inserted and
+ * does not invalidate iterators and references.
+ */
+ void
+ insert(iterator __p, initializer_list<value_type> __l)
+ { this->insert(__p, __l.begin(), __l.end()); }
+#endif
+
+ /**
+ * @brief Inserts a number of copies of given data into the %list.
+ * @param position An iterator into the %list.
+ * @param n Number of elements to be inserted.
+ * @param x Data to be inserted.
+ *
+ * This function will insert a specified number of copies of the
+ * given data before the location specified by @a position.
+ *
+ * This operation is linear in the number of elements inserted and
+ * does not invalidate iterators and references.
+ */
+ void
+ insert(iterator __position, size_type __n, const value_type& __x)
+ {
+ list __tmp(__n, __x, _M_get_Node_allocator());
+ splice(__position, __tmp);
+ }
+
+ /**
+ * @brief Inserts a range into the %list.
+ * @param position An iterator into the %list.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ *
+ * This function will insert copies of the data in the range [@a
+ * first,@a last) into the %list before the location specified by
+ * @a position.
+ *
+ * This operation is linear in the number of elements inserted and
+ * does not invalidate iterators and references.
+ */
+ template<typename _InputIterator>
+ void
+ insert(iterator __position, _InputIterator __first,
+ _InputIterator __last)
+ {
+ list __tmp(__first, __last, _M_get_Node_allocator());
+ splice(__position, __tmp);
+ }
+
+ /**
+ * @brief Remove element at given position.
+ * @param position Iterator pointing to element to be erased.
+ * @return An iterator pointing to the next element (or end()).
+ *
+ * This function will erase the element at the given position and thus
+ * shorten the %list by one.
+ *
+ * Due to the nature of a %list this operation can be done in
+ * constant time, and only invalidates iterators/references to
+ * the element being removed. The user is also cautioned that
+ * this function only erases the element, and that if the element
+ * is itself a pointer, the pointed-to memory is not touched in
+ * any way. Managing the pointer is the user's responsibility.
+ */
+ iterator
+ erase(iterator __position);
+
+ /**
+ * @brief Remove a range of elements.
+ * @param first Iterator pointing to the first element to be erased.
+ * @param last Iterator pointing to one past the last element to be
+ * erased.
+ * @return An iterator pointing to the element pointed to by @a last
+ * prior to erasing (or end()).
+ *
+ * This function will erase the elements in the range @a
+ * [first,last) and shorten the %list accordingly.
+ *
+ * This operation is linear time in the size of the range and only
+ * invalidates iterators/references to the element being removed.
+ * The user is also cautioned that this function only erases the
+ * elements, and that if the elements themselves are pointers, the
+ * pointed-to memory is not touched in any way. Managing the pointer
+ * is the user's responsibility.
+ */
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ while (__first != __last)
+ __first = erase(__first);
+ return __last;
+ }
+
+ /**
+ * @brief Swaps data with another %list.
+ * @param x A %list of the same element and allocator types.
+ *
+ * This exchanges the elements between two lists in constant
+ * time. Note that the global std::swap() function is
+ * specialized such that std::swap(l1,l2) will feed to this
+ * function.
+ */
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(list&& __x)
+#else
+ swap(list& __x)
+#endif
+ {
+ _List_node_base::swap(this->_M_impl._M_node, __x._M_impl._M_node);
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 431. Swapping containers with unequal allocators.
+ std::__alloc_swap<typename _Base::_Node_alloc_type>::
+ _S_do_it(_M_get_Node_allocator(), __x._M_get_Node_allocator());
+ }
+
+ /**
+ * Erases all the elements. Note that this function only erases
+ * the elements, and that if the elements themselves are
+ * pointers, the pointed-to memory is not touched in any way.
+ * Managing the pointer is the user's responsibility.
+ */
+ void
+ clear()
+ {
+ _Base::_M_clear();
+ _Base::_M_init();
+ }
+
+ // [23.2.2.4] list operations
+ /**
+ * @brief Insert contents of another %list.
+ * @param position Iterator referencing the element to insert before.
+ * @param x Source list.
+ *
+ * The elements of @a x are inserted in constant time in front of
+ * the element referenced by @a position. @a x becomes an empty
+ * list.
+ *
+ * Requires this != @a x.
+ */
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ splice(iterator __position, list&& __x)
+#else
+ splice(iterator __position, list& __x)
+#endif
+ {
+ if (!__x.empty())
+ {
+ _M_check_equal_allocators(__x);
+
+ this->_M_transfer(__position, __x.begin(), __x.end());
+ }
+ }
+
+ /**
+ * @brief Insert element from another %list.
+ * @param position Iterator referencing the element to insert before.
+ * @param x Source list.
+ * @param i Iterator referencing the element to move.
+ *
+ * Removes the element in list @a x referenced by @a i and
+ * inserts it into the current list before @a position.
+ */
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ splice(iterator __position, list&& __x, iterator __i)
+#else
+ splice(iterator __position, list& __x, iterator __i)
+#endif
+ {
+ iterator __j = __i;
+ ++__j;
+ if (__position == __i || __position == __j)
+ return;
+
+ if (this != &__x)
+ _M_check_equal_allocators(__x);
+
+ this->_M_transfer(__position, __i, __j);
+ }
+
+ /**
+ * @brief Insert range from another %list.
+ * @param position Iterator referencing the element to insert before.
+ * @param x Source list.
+ * @param first Iterator referencing the start of range in x.
+ * @param last Iterator referencing the end of range in x.
+ *
+ * Removes elements in the range [first,last) and inserts them
+ * before @a position in constant time.
+ *
+ * Undefined if @a position is in [first,last).
+ */
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ splice(iterator __position, list&& __x, iterator __first,
+ iterator __last)
+#else
+ splice(iterator __position, list& __x, iterator __first,
+ iterator __last)
+#endif
+ {
+ if (__first != __last)
+ {
+ if (this != &__x)
+ _M_check_equal_allocators(__x);
+
+ this->_M_transfer(__position, __first, __last);
+ }
+ }
+
+ /**
+ * @brief Remove all elements equal to value.
+ * @param value The value to remove.
+ *
+ * Removes every element in the list equal to @a value.
+ * Remaining elements stay in list order. Note that this
+ * function only erases the elements, and that if the elements
+ * themselves are pointers, the pointed-to memory is not
+ * touched in any way. Managing the pointer is the user's
+ * responsibility.
+ */
+ void
+ remove(const _Tp& __value);
+
+ /**
+ * @brief Remove all elements satisfying a predicate.
+ * @param Predicate Unary predicate function or object.
+ *
+ * Removes every element in the list for which the predicate
+ * returns true. Remaining elements stay in list order. Note
+ * that this function only erases the elements, and that if the
+ * elements themselves are pointers, the pointed-to memory is
+ * not touched in any way. Managing the pointer is the user's
+ * responsibility.
+ */
+ template<typename _Predicate>
+ void
+ remove_if(_Predicate);
+
+ /**
+ * @brief Remove consecutive duplicate elements.
+ *
+ * For each consecutive set of elements with the same value,
+ * remove all but the first one. Remaining elements stay in
+ * list order. Note that this function only erases the
+ * elements, and that if the elements themselves are pointers,
+ * the pointed-to memory is not touched in any way. Managing
+ * the pointer is the user's responsibility.
+ */
+ void
+ unique();
+
+ /**
+ * @brief Remove consecutive elements satisfying a predicate.
+ * @param BinaryPredicate Binary predicate function or object.
+ *
+ * For each consecutive set of elements [first,last) that
+ * satisfy predicate(first,i) where i is an iterator in
+ * [first,last), remove all but the first one. Remaining
+ * elements stay in list order. Note that this function only
+ * erases the elements, and that if the elements themselves are
+ * pointers, the pointed-to memory is not touched in any way.
+ * Managing the pointer is the user's responsibility.
+ */
+ template<typename _BinaryPredicate>
+ void
+ unique(_BinaryPredicate);
+
+ /**
+ * @brief Merge sorted lists.
+ * @param x Sorted list to merge.
+ *
+ * Assumes that both @a x and this list are sorted according to
+ * operator<(). Merges elements of @a x into this list in
+ * sorted order, leaving @a x empty when complete. Elements in
+ * this list precede elements in @a x that are equal.
+ */
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ merge(list&& __x);
+#else
+ merge(list& __x);
+#endif
+
+ /**
+ * @brief Merge sorted lists according to comparison function.
+ * @param x Sorted list to merge.
+ * @param StrictWeakOrdering Comparison function defining
+ * sort order.
+ *
+ * Assumes that both @a x and this list are sorted according to
+ * StrictWeakOrdering. Merges elements of @a x into this list
+ * in sorted order, leaving @a x empty when complete. Elements
+ * in this list precede elements in @a x that are equivalent
+ * according to StrictWeakOrdering().
+ */
+ template<typename _StrictWeakOrdering>
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ merge(list&&, _StrictWeakOrdering);
+#else
+ merge(list&, _StrictWeakOrdering);
+#endif
+
+ /**
+ * @brief Reverse the elements in list.
+ *
+ * Reverse the order of elements in the list in linear time.
+ */
+ void
+ reverse()
+ { this->_M_impl._M_node.reverse(); }
+
+ /**
+ * @brief Sort the elements.
+ *
+ * Sorts the elements of this list in NlogN time. Equivalent
+ * elements remain in list order.
+ */
+ void
+ sort();
+
+ /**
+ * @brief Sort the elements according to comparison function.
+ *
+ * Sorts the elements of this list in NlogN time. Equivalent
+ * elements remain in list order.
+ */
+ template<typename _StrictWeakOrdering>
+ void
+ sort(_StrictWeakOrdering);
+
+ protected:
+ // Internal constructor functions follow.
+
+ // Called by the range constructor to implement [23.1.1]/9
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 438. Ambiguity in the "do the right thing" clause
+ template<typename _Integer>
+ void
+ _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type)
+ { _M_fill_initialize(static_cast<size_type>(__n), __x); }
+
+ // Called by the range constructor to implement [23.1.1]/9
+ template<typename _InputIterator>
+ void
+ _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
+ __false_type)
+ {
+ for (; __first != __last; ++__first)
+ push_back(*__first);
+ }
+
+ // Called by list(n,v,a), and the range constructor when it turns out
+ // to be the same thing.
+ void
+ _M_fill_initialize(size_type __n, const value_type& __x)
+ {
+ for (; __n > 0; --__n)
+ push_back(__x);
+ }
+
+
+ // Internal assign functions follow.
+
+ // Called by the range assign to implement [23.1.1]/9
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 438. Ambiguity in the "do the right thing" clause
+ template<typename _Integer>
+ void
+ _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
+ { _M_fill_assign(__n, __val); }
+
+ // Called by the range assign to implement [23.1.1]/9
+ template<typename _InputIterator>
+ void
+ _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
+ __false_type);
+
+ // Called by assign(n,t), and the range assign when it turns out
+ // to be the same thing.
+ void
+ _M_fill_assign(size_type __n, const value_type& __val);
+
+
+ // Moves the elements from [first,last) before position.
+ void
+ _M_transfer(iterator __position, iterator __first, iterator __last)
+ { __position._M_node->transfer(__first._M_node, __last._M_node); }
+
+ // Inserts new element at position given and with value given.
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ _M_insert(iterator __position, const value_type& __x)
+ {
+ _Node* __tmp = _M_create_node(__x);
+ __tmp->hook(__position._M_node);
+ }
+#else
+ template<typename... _Args>
+ void
+ _M_insert(iterator __position, _Args&&... __args)
+ {
+ _Node* __tmp = _M_create_node(std::forward<_Args>(__args)...);
+ __tmp->hook(__position._M_node);
+ }
+#endif
+
+ // Erases element at position given.
+ void
+ _M_erase(iterator __position)
+ {
+ __position._M_node->unhook();
+ _Node* __n = static_cast<_Node*>(__position._M_node);
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ _M_get_Node_allocator().destroy(__n);
+#else
+ _M_get_Tp_allocator().destroy(&__n->_M_data);
+#endif
+ _M_put_node(__n);
+ }
+
+ // To implement the splice (and merge) bits of N1599.
+ void
+ _M_check_equal_allocators(list& __x)
+ {
+ if (std::__alloc_neq<typename _Base::_Node_alloc_type>::
+ _S_do_it(_M_get_Node_allocator(), __x._M_get_Node_allocator()))
+ __throw_runtime_error(__N("list::_M_check_equal_allocators"));
+ }
+ };
+
+ /**
+ * @brief List equality comparison.
+ * @param x A %list.
+ * @param y A %list of the same type as @a x.
+ * @return True iff the size and elements of the lists are equal.
+ *
+ * This is an equivalence relation. It is linear in the size of
+ * the lists. Lists are considered equivalent if their sizes are
+ * equal, and if corresponding elements compare equal.
+ */
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator==(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
+ {
+ typedef typename list<_Tp, _Alloc>::const_iterator const_iterator;
+ const_iterator __end1 = __x.end();
+ const_iterator __end2 = __y.end();
+
+ const_iterator __i1 = __x.begin();
+ const_iterator __i2 = __y.begin();
+ while (__i1 != __end1 && __i2 != __end2 && *__i1 == *__i2)
+ {
+ ++__i1;
+ ++__i2;
+ }
+ return __i1 == __end1 && __i2 == __end2;
+ }
+
+ /**
+ * @brief List ordering relation.
+ * @param x A %list.
+ * @param y A %list of the same type as @a x.
+ * @return True iff @a x is lexicographically less than @a y.
+ *
+ * This is a total ordering relation. It is linear in the size of the
+ * lists. The elements must be comparable with @c <.
+ *
+ * See std::lexicographical_compare() for how the determination is made.
+ */
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
+ { return std::lexicographical_compare(__x.begin(), __x.end(),
+ __y.begin(), __y.end()); }
+
+ /// Based on operator==
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator!=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
+ { return !(__x == __y); }
+
+ /// Based on operator<
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
+ { return __y < __x; }
+
+ /// Based on operator<
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
+ { return !(__y < __x); }
+
+ /// Based on operator<
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
+ { return !(__x < __y); }
+
+ /// See std::list::swap().
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(list<_Tp, _Alloc>& __x, list<_Tp, _Alloc>& __y)
+ { __x.swap(__y); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(list<_Tp, _Alloc>&& __x, list<_Tp, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(list<_Tp, _Alloc>& __x, list<_Tp, _Alloc>&& __y)
+ { __x.swap(__y); }
+#endif
+
+_GLIBCXX_END_NESTED_NAMESPACE
+
+#endif /* _STL_LIST_H */
diff --git a/i686-linux/include/c++/4.4.3/bits/stl_map.h b/i686-linux/include/c++/4.4.3/bits/stl_map.h
new file mode 100644
index 0000000..90e5239
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/stl_map.h
@@ -0,0 +1,871 @@
+// Map implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_map.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_MAP_H
+#define _STL_MAP_H 1
+
+#include <bits/functexcept.h>
+#include <bits/concept_check.h>
+#include <initializer_list>
+
+_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
+
+ /**
+ * @brief A standard container made up of (key,value) pairs, which can be
+ * retrieved based on a key, in logarithmic time.
+ *
+ * @ingroup associative_containers
+ *
+ * Meets the requirements of a <a href="tables.html#65">container</a>, a
+ * <a href="tables.html#66">reversible container</a>, and an
+ * <a href="tables.html#69">associative container</a> (using unique keys).
+ * For a @c map<Key,T> the key_type is Key, the mapped_type is T, and the
+ * value_type is std::pair<const Key,T>.
+ *
+ * Maps support bidirectional iterators.
+ *
+ * The private tree data is declared exactly the same way for map and
+ * multimap; the distinction is made entirely in how the tree functions are
+ * called (*_unique versus *_equal, same as the standard).
+ */
+ template <typename _Key, typename _Tp, typename _Compare = std::less<_Key>,
+ typename _Alloc = std::allocator<std::pair<const _Key, _Tp> > >
+ class map
+ {
+ public:
+ typedef _Key key_type;
+ typedef _Tp mapped_type;
+ typedef std::pair<const _Key, _Tp> value_type;
+ typedef _Compare key_compare;
+ typedef _Alloc allocator_type;
+
+ private:
+ // concept requirements
+ typedef typename _Alloc::value_type _Alloc_value_type;
+ __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
+ __glibcxx_class_requires4(_Compare, bool, _Key, _Key,
+ _BinaryFunctionConcept)
+ __glibcxx_class_requires2(value_type, _Alloc_value_type, _SameTypeConcept)
+
+ public:
+ class value_compare
+ : public std::binary_function<value_type, value_type, bool>
+ {
+ friend class map<_Key, _Tp, _Compare, _Alloc>;
+ protected:
+ _Compare comp;
+
+ value_compare(_Compare __c)
+ : comp(__c) { }
+
+ public:
+ bool operator()(const value_type& __x, const value_type& __y) const
+ { return comp(__x.first, __y.first); }
+ };
+
+ private:
+ /// This turns a red-black tree into a [multi]map.
+ typedef typename _Alloc::template rebind<value_type>::other
+ _Pair_alloc_type;
+
+ typedef _Rb_tree<key_type, value_type, _Select1st<value_type>,
+ key_compare, _Pair_alloc_type> _Rep_type;
+
+ /// The actual tree structure.
+ _Rep_type _M_t;
+
+ public:
+ // many of these are specified differently in ISO, but the following are
+ // "functionally equivalent"
+ typedef typename _Pair_alloc_type::pointer pointer;
+ typedef typename _Pair_alloc_type::const_pointer const_pointer;
+ typedef typename _Pair_alloc_type::reference reference;
+ typedef typename _Pair_alloc_type::const_reference const_reference;
+ typedef typename _Rep_type::iterator iterator;
+ typedef typename _Rep_type::const_iterator const_iterator;
+ typedef typename _Rep_type::size_type size_type;
+ typedef typename _Rep_type::difference_type difference_type;
+ typedef typename _Rep_type::reverse_iterator reverse_iterator;
+ typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;
+
+ // [23.3.1.1] construct/copy/destroy
+ // (get_allocator() is normally listed in this section, but seems to have
+ // been accidentally omitted in the printed standard)
+ /**
+ * @brief Default constructor creates no elements.
+ */
+ map()
+ : _M_t() { }
+
+ /**
+ * @brief Creates a %map with no elements.
+ * @param comp A comparison object.
+ * @param a An allocator object.
+ */
+ explicit
+ map(const _Compare& __comp,
+ const allocator_type& __a = allocator_type())
+ : _M_t(__comp, __a) { }
+
+ /**
+ * @brief %Map copy constructor.
+ * @param x A %map of identical element and allocator types.
+ *
+ * The newly-created %map uses a copy of the allocation object
+ * used by @a x.
+ */
+ map(const map& __x)
+ : _M_t(__x._M_t) { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief %Map move constructor.
+ * @param x A %map of identical element and allocator types.
+ *
+ * The newly-created %map contains the exact contents of @a x.
+ * The contents of @a x are a valid, but unspecified %map.
+ */
+ map(map&& __x)
+ : _M_t(std::forward<_Rep_type>(__x._M_t)) { }
+
+ /**
+ * @brief Builds a %map from an initializer_list.
+ * @param l An initializer_list.
+ * @param comp A comparison object.
+ * @param a An allocator object.
+ *
+ * Create a %map consisting of copies of the elements in the
+ * initializer_list @a l.
+ * This is linear in N if the range is already sorted, and NlogN
+ * otherwise (where N is @a l.size()).
+ */
+ map(initializer_list<value_type> __l,
+ const _Compare& __c = _Compare(),
+ const allocator_type& __a = allocator_type())
+ : _M_t(__c, __a)
+ { _M_t._M_insert_unique(__l.begin(), __l.end()); }
+#endif
+
+ /**
+ * @brief Builds a %map from a range.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ *
+ * Create a %map consisting of copies of the elements from [first,last).
+ * This is linear in N if the range is already sorted, and NlogN
+ * otherwise (where N is distance(first,last)).
+ */
+ template<typename _InputIterator>
+ map(_InputIterator __first, _InputIterator __last)
+ : _M_t()
+ { _M_t._M_insert_unique(__first, __last); }
+
+ /**
+ * @brief Builds a %map from a range.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param comp A comparison functor.
+ * @param a An allocator object.
+ *
+ * Create a %map consisting of copies of the elements from [first,last).
+ * This is linear in N if the range is already sorted, and NlogN
+ * otherwise (where N is distance(first,last)).
+ */
+ template<typename _InputIterator>
+ map(_InputIterator __first, _InputIterator __last,
+ const _Compare& __comp,
+ const allocator_type& __a = allocator_type())
+ : _M_t(__comp, __a)
+ { _M_t._M_insert_unique(__first, __last); }
+
+ // FIXME There is no dtor declared, but we should have something
+ // generated by Doxygen. I don't know what tags to add to this
+ // paragraph to make that happen:
+ /**
+ * The dtor only erases the elements, and note that if the elements
+ * themselves are pointers, the pointed-to memory is not touched in any
+ * way. Managing the pointer is the user's responsibility.
+ */
+
+ /**
+ * @brief %Map assignment operator.
+ * @param x A %map of identical element and allocator types.
+ *
+ * All the elements of @a x are copied, but unlike the copy constructor,
+ * the allocator object is not copied.
+ */
+ map&
+ operator=(const map& __x)
+ {
+ _M_t = __x._M_t;
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief %Map move assignment operator.
+ * @param x A %map of identical element and allocator types.
+ *
+ * The contents of @a x are moved into this map (without copying).
+ * @a x is a valid, but unspecified %map.
+ */
+ map&
+ operator=(map&& __x)
+ {
+ // NB: DR 675.
+ this->clear();
+ this->swap(__x);
+ return *this;
+ }
+
+ /**
+ * @brief %Map list assignment operator.
+ * @param l An initializer_list.
+ *
+ * This function fills a %map with copies of the elements in the
+ * initializer list @a l.
+ *
+ * Note that the assignment completely changes the %map and
+ * that the resulting %map's size is the same as the number
+ * of elements assigned. Old data may be lost.
+ */
+ map&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l.begin(), __l.end());
+ return *this;
+ }
+#endif
+
+ /// Get a copy of the memory allocation object.
+ allocator_type
+ get_allocator() const
+ { return _M_t.get_allocator(); }
+
+ // iterators
+ /**
+ * Returns a read/write iterator that points to the first pair in the
+ * %map.
+ * Iteration is done in ascending order according to the keys.
+ */
+ iterator
+ begin()
+ { return _M_t.begin(); }
+
+ /**
+ * Returns a read-only (constant) iterator that points to the first pair
+ * in the %map. Iteration is done in ascending order according to the
+ * keys.
+ */
+ const_iterator
+ begin() const
+ { return _M_t.begin(); }
+
+ /**
+ * Returns a read/write iterator that points one past the last
+ * pair in the %map. Iteration is done in ascending order
+ * according to the keys.
+ */
+ iterator
+ end()
+ { return _M_t.end(); }
+
+ /**
+ * Returns a read-only (constant) iterator that points one past the last
+ * pair in the %map. Iteration is done in ascending order according to
+ * the keys.
+ */
+ const_iterator
+ end() const
+ { return _M_t.end(); }
+
+ /**
+ * Returns a read/write reverse iterator that points to the last pair in
+ * the %map. Iteration is done in descending order according to the
+ * keys.
+ */
+ reverse_iterator
+ rbegin()
+ { return _M_t.rbegin(); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to the
+ * last pair in the %map. Iteration is done in descending order
+ * according to the keys.
+ */
+ const_reverse_iterator
+ rbegin() const
+ { return _M_t.rbegin(); }
+
+ /**
+ * Returns a read/write reverse iterator that points to one before the
+ * first pair in the %map. Iteration is done in descending order
+ * according to the keys.
+ */
+ reverse_iterator
+ rend()
+ { return _M_t.rend(); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to one
+ * before the first pair in the %map. Iteration is done in descending
+ * order according to the keys.
+ */
+ const_reverse_iterator
+ rend() const
+ { return _M_t.rend(); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * Returns a read-only (constant) iterator that points to the first pair
+ * in the %map. Iteration is done in ascending order according to the
+ * keys.
+ */
+ const_iterator
+ cbegin() const
+ { return _M_t.begin(); }
+
+ /**
+ * Returns a read-only (constant) iterator that points one past the last
+ * pair in the %map. Iteration is done in ascending order according to
+ * the keys.
+ */
+ const_iterator
+ cend() const
+ { return _M_t.end(); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to the
+ * last pair in the %map. Iteration is done in descending order
+ * according to the keys.
+ */
+ const_reverse_iterator
+ crbegin() const
+ { return _M_t.rbegin(); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to one
+ * before the first pair in the %map. Iteration is done in descending
+ * order according to the keys.
+ */
+ const_reverse_iterator
+ crend() const
+ { return _M_t.rend(); }
+#endif
+
+ // capacity
+ /** Returns true if the %map is empty. (Thus begin() would equal
+ * end().)
+ */
+ bool
+ empty() const
+ { return _M_t.empty(); }
+
+ /** Returns the size of the %map. */
+ size_type
+ size() const
+ { return _M_t.size(); }
+
+ /** Returns the maximum size of the %map. */
+ size_type
+ max_size() const
+ { return _M_t.max_size(); }
+
+ // [23.3.1.2] element access
+ /**
+ * @brief Subscript ( @c [] ) access to %map data.
+ * @param k The key for which data should be retrieved.
+ * @return A reference to the data of the (key,data) %pair.
+ *
+ * Allows for easy lookup with the subscript ( @c [] )
+ * operator. Returns data associated with the key specified in
+ * subscript. If the key does not exist, a pair with that key
+ * is created using default values, which is then returned.
+ *
+ * Lookup requires logarithmic time.
+ */
+ mapped_type&
+ operator[](const key_type& __k)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_DefaultConstructibleConcept<mapped_type>)
+
+ iterator __i = lower_bound(__k);
+ // __i->first is greater than or equivalent to __k.
+ if (__i == end() || key_comp()(__k, (*__i).first))
+ __i = insert(__i, value_type(__k, mapped_type()));
+ return (*__i).second;
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 464. Suggestion for new member functions in standard containers.
+ /**
+ * @brief Access to %map data.
+ * @param k The key for which data should be retrieved.
+ * @return A reference to the data whose key is equivalent to @a k, if
+ * such a data is present in the %map.
+ * @throw std::out_of_range If no such data is present.
+ */
+ mapped_type&
+ at(const key_type& __k)
+ {
+ iterator __i = lower_bound(__k);
+ if (__i == end() || key_comp()(__k, (*__i).first))
+ __throw_out_of_range(__N("map::at"));
+ return (*__i).second;
+ }
+
+ const mapped_type&
+ at(const key_type& __k) const
+ {
+ const_iterator __i = lower_bound(__k);
+ if (__i == end() || key_comp()(__k, (*__i).first))
+ __throw_out_of_range(__N("map::at"));
+ return (*__i).second;
+ }
+
+ // modifiers
+ /**
+ * @brief Attempts to insert a std::pair into the %map.
+
+ * @param x Pair to be inserted (see std::make_pair for easy creation
+ * of pairs).
+
+ * @return A pair, of which the first element is an iterator that
+ * points to the possibly inserted pair, and the second is
+ * a bool that is true if the pair was actually inserted.
+ *
+ * This function attempts to insert a (key, value) %pair into the %map.
+ * A %map relies on unique keys and thus a %pair is only inserted if its
+ * first element (the key) is not already present in the %map.
+ *
+ * Insertion requires logarithmic time.
+ */
+ std::pair<iterator, bool>
+ insert(const value_type& __x)
+ { return _M_t._M_insert_unique(__x); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Attempts to insert a list of std::pairs into the %map.
+ * @param list A std::initializer_list<value_type> of pairs to be
+ * inserted.
+ *
+ * Complexity similar to that of the range constructor.
+ */
+ void
+ insert(std::initializer_list<value_type> __list)
+ { insert (__list.begin(), __list.end()); }
+#endif
+
+ /**
+ * @brief Attempts to insert a std::pair into the %map.
+ * @param position An iterator that serves as a hint as to where the
+ * pair should be inserted.
+ * @param x Pair to be inserted (see std::make_pair for easy creation
+ * of pairs).
+ * @return An iterator that points to the element with key of @a x (may
+ * or may not be the %pair passed in).
+ *
+
+ * This function is not concerned about whether the insertion
+ * took place, and thus does not return a boolean like the
+ * single-argument insert() does. Note that the first
+ * parameter is only a hint and can potentially improve the
+ * performance of the insertion process. A bad hint would
+ * cause no gains in efficiency.
+ *
+ * See
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt07ch17.html
+ * for more on "hinting".
+ *
+ * Insertion requires logarithmic time (if the hint is not taken).
+ */
+ iterator
+ insert(iterator __position, const value_type& __x)
+ { return _M_t._M_insert_unique_(__position, __x); }
+
+ /**
+ * @brief Template function that attempts to insert a range of elements.
+ * @param first Iterator pointing to the start of the range to be
+ * inserted.
+ * @param last Iterator pointing to the end of the range.
+ *
+ * Complexity similar to that of the range constructor.
+ */
+ template<typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ { _M_t._M_insert_unique(__first, __last); }
+
+ /**
+ * @brief Erases an element from a %map.
+ * @param position An iterator pointing to the element to be erased.
+ *
+ * This function erases an element, pointed to by the given
+ * iterator, from a %map. Note that this function only erases
+ * the element, and that if the element is itself a pointer,
+ * the pointed-to memory is not touched in any way. Managing
+ * the pointer is the user's responsibility.
+ */
+ void
+ erase(iterator __position)
+ { _M_t.erase(__position); }
+
+ /**
+ * @brief Erases elements according to the provided key.
+ * @param x Key of element to be erased.
+ * @return The number of elements erased.
+ *
+ * This function erases all the elements located by the given key from
+ * a %map.
+ * Note that this function only erases the element, and that if
+ * the element is itself a pointer, the pointed-to memory is not touched
+ * in any way. Managing the pointer is the user's responsibility.
+ */
+ size_type
+ erase(const key_type& __x)
+ { return _M_t.erase(__x); }
+
+ /**
+ * @brief Erases a [first,last) range of elements from a %map.
+ * @param first Iterator pointing to the start of the range to be
+ * erased.
+ * @param last Iterator pointing to the end of the range to be erased.
+ *
+ * This function erases a sequence of elements from a %map.
+ * Note that this function only erases the element, and that if
+ * the element is itself a pointer, the pointed-to memory is not touched
+ * in any way. Managing the pointer is the user's responsibility.
+ */
+ void
+ erase(iterator __first, iterator __last)
+ { _M_t.erase(__first, __last); }
+
+ /**
+ * @brief Swaps data with another %map.
+ * @param x A %map of the same element and allocator types.
+ *
+ * This exchanges the elements between two maps in constant
+ * time. (It is only swapping a pointer, an integer, and an
+ * instance of the @c Compare type (which itself is often
+ * stateless and empty), so it should be quite fast.) Note
+ * that the global std::swap() function is specialized such
+ * that std::swap(m1,m2) will feed to this function.
+ */
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(map&& __x)
+#else
+ swap(map& __x)
+#endif
+ { _M_t.swap(__x._M_t); }
+
+ /**
+ * Erases all elements in a %map. Note that this function only
+ * erases the elements, and that if the elements themselves are
+ * pointers, the pointed-to memory is not touched in any way.
+ * Managing the pointer is the user's responsibility.
+ */
+ void
+ clear()
+ { _M_t.clear(); }
+
+ // observers
+ /**
+ * Returns the key comparison object out of which the %map was
+ * constructed.
+ */
+ key_compare
+ key_comp() const
+ { return _M_t.key_comp(); }
+
+ /**
+ * Returns a value comparison object, built from the key comparison
+ * object out of which the %map was constructed.
+ */
+ value_compare
+ value_comp() const
+ { return value_compare(_M_t.key_comp()); }
+
+ // [23.3.1.3] map operations
+ /**
+ * @brief Tries to locate an element in a %map.
+ * @param x Key of (key, value) %pair to be located.
+ * @return Iterator pointing to sought-after element, or end() if not
+ * found.
+ *
+ * This function takes a key and tries to locate the element with which
+ * the key matches. If successful the function returns an iterator
+ * pointing to the sought after %pair. If unsuccessful it returns the
+ * past-the-end ( @c end() ) iterator.
+ */
+ iterator
+ find(const key_type& __x)
+ { return _M_t.find(__x); }
+
+ /**
+ * @brief Tries to locate an element in a %map.
+ * @param x Key of (key, value) %pair to be located.
+ * @return Read-only (constant) iterator pointing to sought-after
+ * element, or end() if not found.
+ *
+ * This function takes a key and tries to locate the element with which
+ * the key matches. If successful the function returns a constant
+ * iterator pointing to the sought after %pair. If unsuccessful it
+ * returns the past-the-end ( @c end() ) iterator.
+ */
+ const_iterator
+ find(const key_type& __x) const
+ { return _M_t.find(__x); }
+
+ /**
+ * @brief Finds the number of elements with given key.
+ * @param x Key of (key, value) pairs to be located.
+ * @return Number of elements with specified key.
+ *
+ * This function only makes sense for multimaps; for map the result will
+ * either be 0 (not present) or 1 (present).
+ */
+ size_type
+ count(const key_type& __x) const
+ { return _M_t.find(__x) == _M_t.end() ? 0 : 1; }
+
+ /**
+ * @brief Finds the beginning of a subsequence matching given key.
+ * @param x Key of (key, value) pair to be located.
+ * @return Iterator pointing to first element equal to or greater
+ * than key, or end().
+ *
+ * This function returns the first element of a subsequence of elements
+ * that matches the given key. If unsuccessful it returns an iterator
+ * pointing to the first element that has a greater value than given key
+ * or end() if no such element exists.
+ */
+ iterator
+ lower_bound(const key_type& __x)
+ { return _M_t.lower_bound(__x); }
+
+ /**
+ * @brief Finds the beginning of a subsequence matching given key.
+ * @param x Key of (key, value) pair to be located.
+ * @return Read-only (constant) iterator pointing to first element
+ * equal to or greater than key, or end().
+ *
+ * This function returns the first element of a subsequence of elements
+ * that matches the given key. If unsuccessful it returns an iterator
+ * pointing to the first element that has a greater value than given key
+ * or end() if no such element exists.
+ */
+ const_iterator
+ lower_bound(const key_type& __x) const
+ { return _M_t.lower_bound(__x); }
+
+ /**
+ * @brief Finds the end of a subsequence matching given key.
+ * @param x Key of (key, value) pair to be located.
+ * @return Iterator pointing to the first element
+ * greater than key, or end().
+ */
+ iterator
+ upper_bound(const key_type& __x)
+ { return _M_t.upper_bound(__x); }
+
+ /**
+ * @brief Finds the end of a subsequence matching given key.
+ * @param x Key of (key, value) pair to be located.
+ * @return Read-only (constant) iterator pointing to first iterator
+ * greater than key, or end().
+ */
+ const_iterator
+ upper_bound(const key_type& __x) const
+ { return _M_t.upper_bound(__x); }
+
+ /**
+ * @brief Finds a subsequence matching given key.
+ * @param x Key of (key, value) pairs to be located.
+ * @return Pair of iterators that possibly points to the subsequence
+ * matching given key.
+ *
+ * This function is equivalent to
+ * @code
+ * std::make_pair(c.lower_bound(val),
+ * c.upper_bound(val))
+ * @endcode
+ * (but is faster than making the calls separately).
+ *
+ * This function probably only makes sense for multimaps.
+ */
+ std::pair<iterator, iterator>
+ equal_range(const key_type& __x)
+ { return _M_t.equal_range(__x); }
+
+ /**
+ * @brief Finds a subsequence matching given key.
+ * @param x Key of (key, value) pairs to be located.
+ * @return Pair of read-only (constant) iterators that possibly points
+ * to the subsequence matching given key.
+ *
+ * This function is equivalent to
+ * @code
+ * std::make_pair(c.lower_bound(val),
+ * c.upper_bound(val))
+ * @endcode
+ * (but is faster than making the calls separately).
+ *
+ * This function probably only makes sense for multimaps.
+ */
+ std::pair<const_iterator, const_iterator>
+ equal_range(const key_type& __x) const
+ { return _M_t.equal_range(__x); }
+
+ template<typename _K1, typename _T1, typename _C1, typename _A1>
+ friend bool
+ operator==(const map<_K1, _T1, _C1, _A1>&,
+ const map<_K1, _T1, _C1, _A1>&);
+
+ template<typename _K1, typename _T1, typename _C1, typename _A1>
+ friend bool
+ operator<(const map<_K1, _T1, _C1, _A1>&,
+ const map<_K1, _T1, _C1, _A1>&);
+ };
+
+ /**
+ * @brief Map equality comparison.
+ * @param x A %map.
+ * @param y A %map of the same type as @a x.
+ * @return True iff the size and elements of the maps are equal.
+ *
+ * This is an equivalence relation. It is linear in the size of the
+ * maps. Maps are considered equivalent if their sizes are equal,
+ * and if corresponding elements compare equal.
+ */
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline bool
+ operator==(const map<_Key, _Tp, _Compare, _Alloc>& __x,
+ const map<_Key, _Tp, _Compare, _Alloc>& __y)
+ { return __x._M_t == __y._M_t; }
+
+ /**
+ * @brief Map ordering relation.
+ * @param x A %map.
+ * @param y A %map of the same type as @a x.
+ * @return True iff @a x is lexicographically less than @a y.
+ *
+ * This is a total ordering relation. It is linear in the size of the
+ * maps. The elements must be comparable with @c <.
+ *
+ * See std::lexicographical_compare() for how the determination is made.
+ */
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline bool
+ operator<(const map<_Key, _Tp, _Compare, _Alloc>& __x,
+ const map<_Key, _Tp, _Compare, _Alloc>& __y)
+ { return __x._M_t < __y._M_t; }
+
+ /// Based on operator==
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline bool
+ operator!=(const map<_Key, _Tp, _Compare, _Alloc>& __x,
+ const map<_Key, _Tp, _Compare, _Alloc>& __y)
+ { return !(__x == __y); }
+
+ /// Based on operator<
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline bool
+ operator>(const map<_Key, _Tp, _Compare, _Alloc>& __x,
+ const map<_Key, _Tp, _Compare, _Alloc>& __y)
+ { return __y < __x; }
+
+ /// Based on operator<
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline bool
+ operator<=(const map<_Key, _Tp, _Compare, _Alloc>& __x,
+ const map<_Key, _Tp, _Compare, _Alloc>& __y)
+ { return !(__y < __x); }
+
+ /// Based on operator<
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline bool
+ operator>=(const map<_Key, _Tp, _Compare, _Alloc>& __x,
+ const map<_Key, _Tp, _Compare, _Alloc>& __y)
+ { return !(__x < __y); }
+
+ /// See std::map::swap().
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline void
+ swap(map<_Key, _Tp, _Compare, _Alloc>& __x,
+ map<_Key, _Tp, _Compare, _Alloc>& __y)
+ { __x.swap(__y); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline void
+ swap(map<_Key, _Tp, _Compare, _Alloc>&& __x,
+ map<_Key, _Tp, _Compare, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline void
+ swap(map<_Key, _Tp, _Compare, _Alloc>& __x,
+ map<_Key, _Tp, _Compare, _Alloc>&& __y)
+ { __x.swap(__y); }
+#endif
+
+_GLIBCXX_END_NESTED_NAMESPACE
+
+#endif /* _STL_MAP_H */
diff --git a/i686-linux/include/c++/4.4.3/bits/stl_multimap.h b/i686-linux/include/c++/4.4.3/bits/stl_multimap.h
new file mode 100644
index 0000000..484537c
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/stl_multimap.h
@@ -0,0 +1,800 @@
+// Multimap implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_multimap.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_MULTIMAP_H
+#define _STL_MULTIMAP_H 1
+
+#include <bits/concept_check.h>
+#include <initializer_list>
+
+_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
+
+ /**
+ * @brief A standard container made up of (key,value) pairs, which can be
+ * retrieved based on a key, in logarithmic time.
+ *
+ * @ingroup associative_containers
+ *
+ * Meets the requirements of a <a href="tables.html#65">container</a>, a
+ * <a href="tables.html#66">reversible container</a>, and an
+ * <a href="tables.html#69">associative container</a> (using equivalent
+ * keys). For a @c multimap<Key,T> the key_type is Key, the mapped_type
+ * is T, and the value_type is std::pair<const Key,T>.
+ *
+ * Multimaps support bidirectional iterators.
+ *
+ * The private tree data is declared exactly the same way for map and
+ * multimap; the distinction is made entirely in how the tree functions are
+ * called (*_unique versus *_equal, same as the standard).
+ */
+ template <typename _Key, typename _Tp,
+ typename _Compare = std::less<_Key>,
+ typename _Alloc = std::allocator<std::pair<const _Key, _Tp> > >
+ class multimap
+ {
+ public:
+ typedef _Key key_type;
+ typedef _Tp mapped_type;
+ typedef std::pair<const _Key, _Tp> value_type;
+ typedef _Compare key_compare;
+ typedef _Alloc allocator_type;
+
+ private:
+ // concept requirements
+ typedef typename _Alloc::value_type _Alloc_value_type;
+ __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
+ __glibcxx_class_requires4(_Compare, bool, _Key, _Key,
+ _BinaryFunctionConcept)
+ __glibcxx_class_requires2(value_type, _Alloc_value_type, _SameTypeConcept)
+
+ public:
+ class value_compare
+ : public std::binary_function<value_type, value_type, bool>
+ {
+ friend class multimap<_Key, _Tp, _Compare, _Alloc>;
+ protected:
+ _Compare comp;
+
+ value_compare(_Compare __c)
+ : comp(__c) { }
+
+ public:
+ bool operator()(const value_type& __x, const value_type& __y) const
+ { return comp(__x.first, __y.first); }
+ };
+
+ private:
+ /// This turns a red-black tree into a [multi]map.
+ typedef typename _Alloc::template rebind<value_type>::other
+ _Pair_alloc_type;
+
+ typedef _Rb_tree<key_type, value_type, _Select1st<value_type>,
+ key_compare, _Pair_alloc_type> _Rep_type;
+ /// The actual tree structure.
+ _Rep_type _M_t;
+
+ public:
+ // many of these are specified differently in ISO, but the following are
+ // "functionally equivalent"
+ typedef typename _Pair_alloc_type::pointer pointer;
+ typedef typename _Pair_alloc_type::const_pointer const_pointer;
+ typedef typename _Pair_alloc_type::reference reference;
+ typedef typename _Pair_alloc_type::const_reference const_reference;
+ typedef typename _Rep_type::iterator iterator;
+ typedef typename _Rep_type::const_iterator const_iterator;
+ typedef typename _Rep_type::size_type size_type;
+ typedef typename _Rep_type::difference_type difference_type;
+ typedef typename _Rep_type::reverse_iterator reverse_iterator;
+ typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;
+
+ // [23.3.2] construct/copy/destroy
+ // (get_allocator() is also listed in this section)
+ /**
+ * @brief Default constructor creates no elements.
+ */
+ multimap()
+ : _M_t() { }
+
+ /**
+ * @brief Creates a %multimap with no elements.
+ * @param comp A comparison object.
+ * @param a An allocator object.
+ */
+ explicit
+ multimap(const _Compare& __comp,
+ const allocator_type& __a = allocator_type())
+ : _M_t(__comp, __a) { }
+
+ /**
+ * @brief %Multimap copy constructor.
+ * @param x A %multimap of identical element and allocator types.
+ *
+ * The newly-created %multimap uses a copy of the allocation object
+ * used by @a x.
+ */
+ multimap(const multimap& __x)
+ : _M_t(__x._M_t) { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief %Multimap move constructor.
+ * @param x A %multimap of identical element and allocator types.
+ *
+ * The newly-created %multimap contains the exact contents of @a x.
+ * The contents of @a x are a valid, but unspecified %multimap.
+ */
+ multimap(multimap&& __x)
+ : _M_t(std::forward<_Rep_type>(__x._M_t)) { }
+
+ /**
+ * @brief Builds a %multimap from an initializer_list.
+ * @param l An initializer_list.
+ * @param comp A comparison functor.
+ * @param a An allocator object.
+ *
+ * Create a %multimap consisting of copies of the elements from
+ * the initializer_list. This is linear in N if the list is already
+ * sorted, and NlogN otherwise (where N is @a __l.size()).
+ */
+ multimap(initializer_list<value_type> __l,
+ const _Compare& __comp = _Compare(),
+ const allocator_type& __a = allocator_type())
+ : _M_t(__comp, __a)
+ { _M_t._M_insert_equal(__l.begin(), __l.end()); }
+#endif
+
+ /**
+ * @brief Builds a %multimap from a range.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ *
+ * Create a %multimap consisting of copies of the elements from
+ * [first,last). This is linear in N if the range is already sorted,
+ * and NlogN otherwise (where N is distance(first,last)).
+ */
+ template<typename _InputIterator>
+ multimap(_InputIterator __first, _InputIterator __last)
+ : _M_t()
+ { _M_t._M_insert_equal(__first, __last); }
+
+ /**
+ * @brief Builds a %multimap from a range.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param comp A comparison functor.
+ * @param a An allocator object.
+ *
+ * Create a %multimap consisting of copies of the elements from
+ * [first,last). This is linear in N if the range is already sorted,
+ * and NlogN otherwise (where N is distance(first,last)).
+ */
+ template<typename _InputIterator>
+ multimap(_InputIterator __first, _InputIterator __last,
+ const _Compare& __comp,
+ const allocator_type& __a = allocator_type())
+ : _M_t(__comp, __a)
+ { _M_t._M_insert_equal(__first, __last); }
+
+ // FIXME There is no dtor declared, but we should have something generated
+ // by Doxygen. I don't know what tags to add to this paragraph to make
+ // that happen:
+ /**
+ * The dtor only erases the elements, and note that if the elements
+ * themselves are pointers, the pointed-to memory is not touched in any
+ * way. Managing the pointer is the user's responsibility.
+ */
+
+ /**
+ * @brief %Multimap assignment operator.
+ * @param x A %multimap of identical element and allocator types.
+ *
+ * All the elements of @a x are copied, but unlike the copy constructor,
+ * the allocator object is not copied.
+ */
+ multimap&
+ operator=(const multimap& __x)
+ {
+ _M_t = __x._M_t;
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief %Multimap move assignment operator.
+ * @param x A %multimap of identical element and allocator types.
+ *
+ * The contents of @a x are moved into this multimap (without copying).
+ * @a x is a valid, but unspecified multimap.
+ */
+ multimap&
+ operator=(multimap&& __x)
+ {
+ // NB: DR 675.
+ this->clear();
+ this->swap(__x);
+ return *this;
+ }
+
+ /**
+ * @brief %Multimap list assignment operator.
+ * @param l An initializer_list.
+ *
+ * This function fills a %multimap with copies of the elements
+ * in the initializer list @a l.
+ *
+ * Note that the assignment completely changes the %multimap and
+ * that the resulting %multimap's size is the same as the number
+ * of elements assigned. Old data may be lost.
+ */
+ multimap&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l.begin(), __l.end());
+ return *this;
+ }
+#endif
+
+ /// Get a copy of the memory allocation object.
+ allocator_type
+ get_allocator() const
+ { return _M_t.get_allocator(); }
+
+ // iterators
+ /**
+ * Returns a read/write iterator that points to the first pair in the
+ * %multimap. Iteration is done in ascending order according to the
+ * keys.
+ */
+ iterator
+ begin()
+ { return _M_t.begin(); }
+
+ /**
+ * Returns a read-only (constant) iterator that points to the first pair
+ * in the %multimap. Iteration is done in ascending order according to
+ * the keys.
+ */
+ const_iterator
+ begin() const
+ { return _M_t.begin(); }
+
+ /**
+ * Returns a read/write iterator that points one past the last pair in
+ * the %multimap. Iteration is done in ascending order according to the
+ * keys.
+ */
+ iterator
+ end()
+ { return _M_t.end(); }
+
+ /**
+ * Returns a read-only (constant) iterator that points one past the last
+ * pair in the %multimap. Iteration is done in ascending order according
+ * to the keys.
+ */
+ const_iterator
+ end() const
+ { return _M_t.end(); }
+
+ /**
+ * Returns a read/write reverse iterator that points to the last pair in
+ * the %multimap. Iteration is done in descending order according to the
+ * keys.
+ */
+ reverse_iterator
+ rbegin()
+ { return _M_t.rbegin(); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to the
+ * last pair in the %multimap. Iteration is done in descending order
+ * according to the keys.
+ */
+ const_reverse_iterator
+ rbegin() const
+ { return _M_t.rbegin(); }
+
+ /**
+ * Returns a read/write reverse iterator that points to one before the
+ * first pair in the %multimap. Iteration is done in descending order
+ * according to the keys.
+ */
+ reverse_iterator
+ rend()
+ { return _M_t.rend(); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to one
+ * before the first pair in the %multimap. Iteration is done in
+ * descending order according to the keys.
+ */
+ const_reverse_iterator
+ rend() const
+ { return _M_t.rend(); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * Returns a read-only (constant) iterator that points to the first pair
+ * in the %multimap. Iteration is done in ascending order according to
+ * the keys.
+ */
+ const_iterator
+ cbegin() const
+ { return _M_t.begin(); }
+
+ /**
+ * Returns a read-only (constant) iterator that points one past the last
+ * pair in the %multimap. Iteration is done in ascending order according
+ * to the keys.
+ */
+ const_iterator
+ cend() const
+ { return _M_t.end(); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to the
+ * last pair in the %multimap. Iteration is done in descending order
+ * according to the keys.
+ */
+ const_reverse_iterator
+ crbegin() const
+ { return _M_t.rbegin(); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to one
+ * before the first pair in the %multimap. Iteration is done in
+ * descending order according to the keys.
+ */
+ const_reverse_iterator
+ crend() const
+ { return _M_t.rend(); }
+#endif
+
+ // capacity
+ /** Returns true if the %multimap is empty. */
+ bool
+ empty() const
+ { return _M_t.empty(); }
+
+ /** Returns the size of the %multimap. */
+ size_type
+ size() const
+ { return _M_t.size(); }
+
+ /** Returns the maximum size of the %multimap. */
+ size_type
+ max_size() const
+ { return _M_t.max_size(); }
+
+ // modifiers
+ /**
+ * @brief Inserts a std::pair into the %multimap.
+ * @param x Pair to be inserted (see std::make_pair for easy creation
+ * of pairs).
+ * @return An iterator that points to the inserted (key,value) pair.
+ *
+ * This function inserts a (key, value) pair into the %multimap.
+ * Contrary to a std::map the %multimap does not rely on unique keys and
+ * thus multiple pairs with the same key can be inserted.
+ *
+ * Insertion requires logarithmic time.
+ */
+ iterator
+ insert(const value_type& __x)
+ { return _M_t._M_insert_equal(__x); }
+
+ /**
+ * @brief Inserts a std::pair into the %multimap.
+ * @param position An iterator that serves as a hint as to where the
+ * pair should be inserted.
+ * @param x Pair to be inserted (see std::make_pair for easy creation
+ * of pairs).
+ * @return An iterator that points to the inserted (key,value) pair.
+ *
+ * This function inserts a (key, value) pair into the %multimap.
+ * Contrary to a std::map the %multimap does not rely on unique keys and
+ * thus multiple pairs with the same key can be inserted.
+ * Note that the first parameter is only a hint and can potentially
+ * improve the performance of the insertion process. A bad hint would
+ * cause no gains in efficiency.
+ *
+ * For more on "hinting," see:
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt07ch17.html
+ *
+ * Insertion requires logarithmic time (if the hint is not taken).
+ */
+ iterator
+ insert(iterator __position, const value_type& __x)
+ { return _M_t._M_insert_equal_(__position, __x); }
+
+ /**
+ * @brief A template function that attempts to insert a range
+ * of elements.
+ * @param first Iterator pointing to the start of the range to be
+ * inserted.
+ * @param last Iterator pointing to the end of the range.
+ *
+ * Complexity similar to that of the range constructor.
+ */
+ template<typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ { _M_t._M_insert_equal(__first, __last); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Attempts to insert a list of std::pairs into the %multimap.
+ * @param list A std::initializer_list<value_type> of pairs to be
+ * inserted.
+ *
+ * Complexity similar to that of the range constructor.
+ */
+ void
+ insert(initializer_list<value_type> __l)
+ { this->insert(__l.begin(), __l.end()); }
+#endif
+
+ /**
+ * @brief Erases an element from a %multimap.
+ * @param position An iterator pointing to the element to be erased.
+ *
+ * This function erases an element, pointed to by the given iterator,
+ * from a %multimap. Note that this function only erases the element,
+ * and that if the element is itself a pointer, the pointed-to memory is
+ * not touched in any way. Managing the pointer is the user's
+ * responsibility.
+ */
+ void
+ erase(iterator __position)
+ { _M_t.erase(__position); }
+
+ /**
+ * @brief Erases elements according to the provided key.
+ * @param x Key of element to be erased.
+ * @return The number of elements erased.
+ *
+ * This function erases all elements located by the given key from a
+ * %multimap.
+ * Note that this function only erases the element, and that if
+ * the element is itself a pointer, the pointed-to memory is not touched
+ * in any way. Managing the pointer is the user's responsibility.
+ */
+ size_type
+ erase(const key_type& __x)
+ { return _M_t.erase(__x); }
+
+ /**
+ * @brief Erases a [first,last) range of elements from a %multimap.
+ * @param first Iterator pointing to the start of the range to be
+ * erased.
+ * @param last Iterator pointing to the end of the range to be erased.
+ *
+ * This function erases a sequence of elements from a %multimap.
+ * Note that this function only erases the elements, and that if
+ * the elements themselves are pointers, the pointed-to memory is not
+ * touched in any way. Managing the pointer is the user's responsibility.
+ */
+ void
+ erase(iterator __first, iterator __last)
+ { _M_t.erase(__first, __last); }
+
+ /**
+ * @brief Swaps data with another %multimap.
+ * @param x A %multimap of the same element and allocator types.
+ *
+ * This exchanges the elements between two multimaps in constant time.
+ * (It is only swapping a pointer, an integer, and an instance of
+ * the @c Compare type (which itself is often stateless and empty), so it
+ * should be quite fast.)
+ * Note that the global std::swap() function is specialized such that
+ * std::swap(m1,m2) will feed to this function.
+ */
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(multimap&& __x)
+#else
+ swap(multimap& __x)
+#endif
+ { _M_t.swap(__x._M_t); }
+
+ /**
+ * Erases all elements in a %multimap. Note that this function only
+ * erases the elements, and that if the elements themselves are pointers,
+ * the pointed-to memory is not touched in any way. Managing the pointer
+ * is the user's responsibility.
+ */
+ void
+ clear()
+ { _M_t.clear(); }
+
+ // observers
+ /**
+ * Returns the key comparison object out of which the %multimap
+ * was constructed.
+ */
+ key_compare
+ key_comp() const
+ { return _M_t.key_comp(); }
+
+ /**
+ * Returns a value comparison object, built from the key comparison
+ * object out of which the %multimap was constructed.
+ */
+ value_compare
+ value_comp() const
+ { return value_compare(_M_t.key_comp()); }
+
+ // multimap operations
+ /**
+ * @brief Tries to locate an element in a %multimap.
+ * @param x Key of (key, value) pair to be located.
+ * @return Iterator pointing to sought-after element,
+ * or end() if not found.
+ *
+ * This function takes a key and tries to locate the element with which
+ * the key matches. If successful the function returns an iterator
+ * pointing to the sought after %pair. If unsuccessful it returns the
+ * past-the-end ( @c end() ) iterator.
+ */
+ iterator
+ find(const key_type& __x)
+ { return _M_t.find(__x); }
+
+ /**
+ * @brief Tries to locate an element in a %multimap.
+ * @param x Key of (key, value) pair to be located.
+ * @return Read-only (constant) iterator pointing to sought-after
+ * element, or end() if not found.
+ *
+ * This function takes a key and tries to locate the element with which
+ * the key matches. If successful the function returns a constant
+ * iterator pointing to the sought after %pair. If unsuccessful it
+ * returns the past-the-end ( @c end() ) iterator.
+ */
+ const_iterator
+ find(const key_type& __x) const
+ { return _M_t.find(__x); }
+
+ /**
+ * @brief Finds the number of elements with given key.
+ * @param x Key of (key, value) pairs to be located.
+ * @return Number of elements with specified key.
+ */
+ size_type
+ count(const key_type& __x) const
+ { return _M_t.count(__x); }
+
+ /**
+ * @brief Finds the beginning of a subsequence matching given key.
+ * @param x Key of (key, value) pair to be located.
+ * @return Iterator pointing to first element equal to or greater
+ * than key, or end().
+ *
+ * This function returns the first element of a subsequence of elements
+ * that matches the given key. If unsuccessful it returns an iterator
+ * pointing to the first element that has a greater value than given key
+ * or end() if no such element exists.
+ */
+ iterator
+ lower_bound(const key_type& __x)
+ { return _M_t.lower_bound(__x); }
+
+ /**
+ * @brief Finds the beginning of a subsequence matching given key.
+ * @param x Key of (key, value) pair to be located.
+ * @return Read-only (constant) iterator pointing to first element
+ * equal to or greater than key, or end().
+ *
+ * This function returns the first element of a subsequence of elements
+ * that matches the given key. If unsuccessful the iterator will point
+ * to the next greatest element or, if no such greater element exists, to
+ * end().
+ */
+ const_iterator
+ lower_bound(const key_type& __x) const
+ { return _M_t.lower_bound(__x); }
+
+ /**
+ * @brief Finds the end of a subsequence matching given key.
+ * @param x Key of (key, value) pair to be located.
+ * @return Iterator pointing to the first element
+ * greater than key, or end().
+ */
+ iterator
+ upper_bound(const key_type& __x)
+ { return _M_t.upper_bound(__x); }
+
+ /**
+ * @brief Finds the end of a subsequence matching given key.
+ * @param x Key of (key, value) pair to be located.
+ * @return Read-only (constant) iterator pointing to first iterator
+ * greater than key, or end().
+ */
+ const_iterator
+ upper_bound(const key_type& __x) const
+ { return _M_t.upper_bound(__x); }
+
+ /**
+ * @brief Finds a subsequence matching given key.
+ * @param x Key of (key, value) pairs to be located.
+ * @return Pair of iterators that possibly points to the subsequence
+ * matching given key.
+ *
+ * This function is equivalent to
+ * @code
+ * std::make_pair(c.lower_bound(val),
+ * c.upper_bound(val))
+ * @endcode
+ * (but is faster than making the calls separately).
+ */
+ std::pair<iterator, iterator>
+ equal_range(const key_type& __x)
+ { return _M_t.equal_range(__x); }
+
+ /**
+ * @brief Finds a subsequence matching given key.
+ * @param x Key of (key, value) pairs to be located.
+ * @return Pair of read-only (constant) iterators that possibly points
+ * to the subsequence matching given key.
+ *
+ * This function is equivalent to
+ * @code
+ * std::make_pair(c.lower_bound(val),
+ * c.upper_bound(val))
+ * @endcode
+ * (but is faster than making the calls separately).
+ */
+ std::pair<const_iterator, const_iterator>
+ equal_range(const key_type& __x) const
+ { return _M_t.equal_range(__x); }
+
+ template<typename _K1, typename _T1, typename _C1, typename _A1>
+ friend bool
+ operator==(const multimap<_K1, _T1, _C1, _A1>&,
+ const multimap<_K1, _T1, _C1, _A1>&);
+
+ template<typename _K1, typename _T1, typename _C1, typename _A1>
+ friend bool
+ operator<(const multimap<_K1, _T1, _C1, _A1>&,
+ const multimap<_K1, _T1, _C1, _A1>&);
+ };
+
+ /**
+ * @brief Multimap equality comparison.
+ * @param x A %multimap.
+ * @param y A %multimap of the same type as @a x.
+ * @return True iff the size and elements of the maps are equal.
+ *
+ * This is an equivalence relation. It is linear in the size of the
+ * multimaps. Multimaps are considered equivalent if their sizes are equal,
+ * and if corresponding elements compare equal.
+ */
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline bool
+ operator==(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
+ const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
+ { return __x._M_t == __y._M_t; }
+
+ /**
+ * @brief Multimap ordering relation.
+ * @param x A %multimap.
+ * @param y A %multimap of the same type as @a x.
+ * @return True iff @a x is lexicographically less than @a y.
+ *
+ * This is a total ordering relation. It is linear in the size of the
+ * multimaps. The elements must be comparable with @c <.
+ *
+ * See std::lexicographical_compare() for how the determination is made.
+ */
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline bool
+ operator<(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
+ const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
+ { return __x._M_t < __y._M_t; }
+
+ /// Based on operator==
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline bool
+ operator!=(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
+ const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
+ { return !(__x == __y); }
+
+ /// Based on operator<
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline bool
+ operator>(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
+ const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
+ { return __y < __x; }
+
+ /// Based on operator<
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline bool
+ operator<=(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
+ const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
+ { return !(__y < __x); }
+
+ /// Based on operator<
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline bool
+ operator>=(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
+ const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
+ { return !(__x < __y); }
+
+ /// See std::multimap::swap().
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline void
+ swap(multimap<_Key, _Tp, _Compare, _Alloc>& __x,
+ multimap<_Key, _Tp, _Compare, _Alloc>& __y)
+ { __x.swap(__y); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline void
+ swap(multimap<_Key, _Tp, _Compare, _Alloc>&& __x,
+ multimap<_Key, _Tp, _Compare, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline void
+ swap(multimap<_Key, _Tp, _Compare, _Alloc>& __x,
+ multimap<_Key, _Tp, _Compare, _Alloc>&& __y)
+ { __x.swap(__y); }
+#endif
+
+_GLIBCXX_END_NESTED_NAMESPACE
+
+#endif /* _STL_MULTIMAP_H */
diff --git a/i686-linux/include/c++/4.4.3/bits/stl_multiset.h b/i686-linux/include/c++/4.4.3/bits/stl_multiset.h
new file mode 100644
index 0000000..b5c710f
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/stl_multiset.h
@@ -0,0 +1,697 @@
+// Multiset implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_multiset.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_MULTISET_H
+#define _STL_MULTISET_H 1
+
+#include <bits/concept_check.h>
+#include <initializer_list>
+
+_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
+
+ /**
+ * @brief A standard container made up of elements, which can be retrieved
+ * in logarithmic time.
+ *
+ * @ingroup associative_containers
+ *
+ * Meets the requirements of a <a href="tables.html#65">container</a>, a
+ * <a href="tables.html#66">reversible container</a>, and an
+ * <a href="tables.html#69">associative container</a> (using equivalent
+ * keys). For a @c multiset<Key> the key_type and value_type are Key.
+ *
+ * Multisets support bidirectional iterators.
+ *
+ * The private tree data is declared exactly the same way for set and
+ * multiset; the distinction is made entirely in how the tree functions are
+ * called (*_unique versus *_equal, same as the standard).
+ */
+ template <typename _Key, typename _Compare = std::less<_Key>,
+ typename _Alloc = std::allocator<_Key> >
+ class multiset
+ {
+ // concept requirements
+ typedef typename _Alloc::value_type _Alloc_value_type;
+ __glibcxx_class_requires(_Key, _SGIAssignableConcept)
+ __glibcxx_class_requires4(_Compare, bool, _Key, _Key,
+ _BinaryFunctionConcept)
+ __glibcxx_class_requires2(_Key, _Alloc_value_type, _SameTypeConcept)
+
+ public:
+ // typedefs:
+ typedef _Key key_type;
+ typedef _Key value_type;
+ typedef _Compare key_compare;
+ typedef _Compare value_compare;
+ typedef _Alloc allocator_type;
+
+ private:
+ /// This turns a red-black tree into a [multi]set.
+ typedef typename _Alloc::template rebind<_Key>::other _Key_alloc_type;
+
+ typedef _Rb_tree<key_type, value_type, _Identity<value_type>,
+ key_compare, _Key_alloc_type> _Rep_type;
+ /// The actual tree structure.
+ _Rep_type _M_t;
+
+ public:
+ typedef typename _Key_alloc_type::pointer pointer;
+ typedef typename _Key_alloc_type::const_pointer const_pointer;
+ typedef typename _Key_alloc_type::reference reference;
+ typedef typename _Key_alloc_type::const_reference const_reference;
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 103. set::iterator is required to be modifiable,
+ // but this allows modification of keys.
+ typedef typename _Rep_type::const_iterator iterator;
+ typedef typename _Rep_type::const_iterator const_iterator;
+ typedef typename _Rep_type::const_reverse_iterator reverse_iterator;
+ typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;
+ typedef typename _Rep_type::size_type size_type;
+ typedef typename _Rep_type::difference_type difference_type;
+
+ // allocation/deallocation
+ /**
+ * @brief Default constructor creates no elements.
+ */
+ multiset()
+ : _M_t() { }
+
+ /**
+ * @brief Creates a %multiset with no elements.
+ * @param comp Comparator to use.
+ * @param a An allocator object.
+ */
+ explicit
+ multiset(const _Compare& __comp,
+ const allocator_type& __a = allocator_type())
+ : _M_t(__comp, __a) { }
+
+ /**
+ * @brief Builds a %multiset from a range.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ *
+ * Create a %multiset consisting of copies of the elements from
+ * [first,last). This is linear in N if the range is already sorted,
+ * and NlogN otherwise (where N is distance(first,last)).
+ */
+ template<typename _InputIterator>
+ multiset(_InputIterator __first, _InputIterator __last)
+ : _M_t()
+ { _M_t._M_insert_equal(__first, __last); }
+
+ /**
+ * @brief Builds a %multiset from a range.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param comp A comparison functor.
+ * @param a An allocator object.
+ *
+ * Create a %multiset consisting of copies of the elements from
+ * [first,last). This is linear in N if the range is already sorted,
+ * and NlogN otherwise (where N is distance(first,last)).
+ */
+ template<typename _InputIterator>
+ multiset(_InputIterator __first, _InputIterator __last,
+ const _Compare& __comp,
+ const allocator_type& __a = allocator_type())
+ : _M_t(__comp, __a)
+ { _M_t._M_insert_equal(__first, __last); }
+
+ /**
+ * @brief %Multiset copy constructor.
+ * @param x A %multiset of identical element and allocator types.
+ *
+ * The newly-created %multiset uses a copy of the allocation object used
+ * by @a x.
+ */
+ multiset(const multiset& __x)
+ : _M_t(__x._M_t) { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief %Multiset move constructor.
+ * @param x A %multiset of identical element and allocator types.
+ *
+ * The newly-created %multiset contains the exact contents of @a x.
+ * The contents of @a x are a valid, but unspecified %multiset.
+ */
+ multiset(multiset&& __x)
+ : _M_t(std::forward<_Rep_type>(__x._M_t)) { }
+
+ /**
+ * @brief Builds a %multiset from an initializer_list.
+ * @param l An initializer_list.
+ * @param comp A comparison functor.
+ * @param a An allocator object.
+ *
+ * Create a %multiset consisting of copies of the elements from
+ * the list. This is linear in N if the list is already sorted,
+ * and NlogN otherwise (where N is @a l.size()).
+ */
+ multiset(initializer_list<value_type> __l,
+ const _Compare& __comp = _Compare(),
+ const allocator_type& __a = allocator_type())
+ : _M_t(__comp, __a)
+ { _M_t._M_insert_equal(__l.begin(), __l.end()); }
+#endif
+
+ /**
+ * @brief %Multiset assignment operator.
+ * @param x A %multiset of identical element and allocator types.
+ *
+ * All the elements of @a x are copied, but unlike the copy constructor,
+ * the allocator object is not copied.
+ */
+ multiset&
+ operator=(const multiset& __x)
+ {
+ _M_t = __x._M_t;
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief %Multiset move assignment operator.
+ * @param x A %multiset of identical element and allocator types.
+ *
+ * The contents of @a x are moved into this %multiset (without copying).
+ * @a x is a valid, but unspecified %multiset.
+ */
+ multiset&
+ operator=(multiset&& __x)
+ {
+ // NB: DR 675.
+ this->clear();
+ this->swap(__x);
+ return *this;
+ }
+
+ /**
+ * @brief %Multiset list assignment operator.
+ * @param l An initializer_list.
+ *
+ * This function fills a %multiset with copies of the elements in the
+ * initializer list @a l.
+ *
+ * Note that the assignment completely changes the %multiset and
+ * that the resulting %multiset's size is the same as the number
+ * of elements assigned. Old data may be lost.
+ */
+ multiset&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l.begin(), __l.end());
+ return *this;
+ }
+#endif
+
+ // accessors:
+
+ /// Returns the comparison object.
+ key_compare
+ key_comp() const
+ { return _M_t.key_comp(); }
+ /// Returns the comparison object.
+ value_compare
+ value_comp() const
+ { return _M_t.key_comp(); }
+ /// Returns the memory allocation object.
+ allocator_type
+ get_allocator() const
+ { return _M_t.get_allocator(); }
+
+ /**
+ * Returns a read-only (constant) iterator that points to the first
+ * element in the %multiset. Iteration is done in ascending order
+ * according to the keys.
+ */
+ iterator
+ begin() const
+ { return _M_t.begin(); }
+
+ /**
+ * Returns a read-only (constant) iterator that points one past the last
+ * element in the %multiset. Iteration is done in ascending order
+ * according to the keys.
+ */
+ iterator
+ end() const
+ { return _M_t.end(); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to the
+ * last element in the %multiset. Iteration is done in descending order
+ * according to the keys.
+ */
+ reverse_iterator
+ rbegin() const
+ { return _M_t.rbegin(); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to the
+ * last element in the %multiset. Iteration is done in descending order
+ * according to the keys.
+ */
+ reverse_iterator
+ rend() const
+ { return _M_t.rend(); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * Returns a read-only (constant) iterator that points to the first
+ * element in the %multiset. Iteration is done in ascending order
+ * according to the keys.
+ */
+ iterator
+ cbegin() const
+ { return _M_t.begin(); }
+
+ /**
+ * Returns a read-only (constant) iterator that points one past the last
+ * element in the %multiset. Iteration is done in ascending order
+ * according to the keys.
+ */
+ iterator
+ cend() const
+ { return _M_t.end(); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to the
+ * last element in the %multiset. Iteration is done in descending order
+ * according to the keys.
+ */
+ reverse_iterator
+ crbegin() const
+ { return _M_t.rbegin(); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to the
+ * last element in the %multiset. Iteration is done in descending order
+ * according to the keys.
+ */
+ reverse_iterator
+ crend() const
+ { return _M_t.rend(); }
+#endif
+
+ /// Returns true if the %set is empty.
+ bool
+ empty() const
+ { return _M_t.empty(); }
+
+ /// Returns the size of the %set.
+ size_type
+ size() const
+ { return _M_t.size(); }
+
+ /// Returns the maximum size of the %set.
+ size_type
+ max_size() const
+ { return _M_t.max_size(); }
+
+ /**
+ * @brief Swaps data with another %multiset.
+ * @param x A %multiset of the same element and allocator types.
+ *
+ * This exchanges the elements between two multisets in constant time.
+ * (It is only swapping a pointer, an integer, and an instance of the @c
+ * Compare type (which itself is often stateless and empty), so it should
+ * be quite fast.)
+ * Note that the global std::swap() function is specialized such that
+ * std::swap(s1,s2) will feed to this function.
+ */
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(multiset&& __x)
+#else
+ swap(multiset& __x)
+#endif
+ { _M_t.swap(__x._M_t); }
+
+ // insert/erase
+ /**
+ * @brief Inserts an element into the %multiset.
+ * @param x Element to be inserted.
+ * @return An iterator that points to the inserted element.
+ *
+ * This function inserts an element into the %multiset. Contrary
+ * to a std::set the %multiset does not rely on unique keys and thus
+ * multiple copies of the same element can be inserted.
+ *
+ * Insertion requires logarithmic time.
+ */
+ iterator
+ insert(const value_type& __x)
+ { return _M_t._M_insert_equal(__x); }
+
+ /**
+ * @brief Inserts an element into the %multiset.
+ * @param position An iterator that serves as a hint as to where the
+ * element should be inserted.
+ * @param x Element to be inserted.
+ * @return An iterator that points to the inserted element.
+ *
+ * This function inserts an element into the %multiset. Contrary
+ * to a std::set the %multiset does not rely on unique keys and thus
+ * multiple copies of the same element can be inserted.
+ *
+ * Note that the first parameter is only a hint and can potentially
+ * improve the performance of the insertion process. A bad hint would
+ * cause no gains in efficiency.
+ *
+ * See http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt07ch17.html
+ * for more on "hinting".
+ *
+ * Insertion requires logarithmic time (if the hint is not taken).
+ */
+ iterator
+ insert(iterator __position, const value_type& __x)
+ { return _M_t._M_insert_equal_(__position, __x); }
+
+ /**
+ * @brief A template function that attempts to insert a range of elements.
+ * @param first Iterator pointing to the start of the range to be
+ * inserted.
+ * @param last Iterator pointing to the end of the range.
+ *
+ * Complexity similar to that of the range constructor.
+ */
+ template<typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ { _M_t._M_insert_equal(__first, __last); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Attempts to insert a list of elements into the %multiset.
+ * @param list A std::initializer_list<value_type> of elements
+ * to be inserted.
+ *
+ * Complexity similar to that of the range constructor.
+ */
+ void
+ insert(initializer_list<value_type> __l)
+ { this->insert(__l.begin(), __l.end()); }
+#endif
+
+ /**
+ * @brief Erases an element from a %multiset.
+ * @param position An iterator pointing to the element to be erased.
+ *
+ * This function erases an element, pointed to by the given iterator,
+ * from a %multiset. Note that this function only erases the element,
+ * and that if the element is itself a pointer, the pointed-to memory is
+ * not touched in any way. Managing the pointer is the user's
+ * responsibility.
+ */
+ void
+ erase(iterator __position)
+ { _M_t.erase(__position); }
+
+ /**
+ * @brief Erases elements according to the provided key.
+ * @param x Key of element to be erased.
+ * @return The number of elements erased.
+ *
+ * This function erases all elements located by the given key from a
+ * %multiset.
+ * Note that this function only erases the element, and that if
+ * the element is itself a pointer, the pointed-to memory is not touched
+ * in any way. Managing the pointer is the user's responsibility.
+ */
+ size_type
+ erase(const key_type& __x)
+ { return _M_t.erase(__x); }
+
+ /**
+ * @brief Erases a [first,last) range of elements from a %multiset.
+ * @param first Iterator pointing to the start of the range to be
+ * erased.
+ * @param last Iterator pointing to the end of the range to be erased.
+ *
+ * This function erases a sequence of elements from a %multiset.
+ * Note that this function only erases the elements, and that if
+ * the elements themselves are pointers, the pointed-to memory is not
+ * touched in any way. Managing the pointer is the user's responsibility.
+ */
+ void
+ erase(iterator __first, iterator __last)
+ { _M_t.erase(__first, __last); }
+
+ /**
+ * Erases all elements in a %multiset. Note that this function only
+ * erases the elements, and that if the elements themselves are pointers,
+ * the pointed-to memory is not touched in any way. Managing the pointer
+ * is the user's responsibility.
+ */
+ void
+ clear()
+ { _M_t.clear(); }
+
+ // multiset operations:
+
+ /**
+ * @brief Finds the number of elements with given key.
+ * @param x Key of elements to be located.
+ * @return Number of elements with specified key.
+ */
+ size_type
+ count(const key_type& __x) const
+ { return _M_t.count(__x); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 214. set::find() missing const overload
+ //@{
+ /**
+ * @brief Tries to locate an element in a %set.
+ * @param x Element to be located.
+ * @return Iterator pointing to sought-after element, or end() if not
+ * found.
+ *
+ * This function takes a key and tries to locate the element with which
+ * the key matches. If successful the function returns an iterator
+ * pointing to the sought after element. If unsuccessful it returns the
+ * past-the-end ( @c end() ) iterator.
+ */
+ iterator
+ find(const key_type& __x)
+ { return _M_t.find(__x); }
+
+ const_iterator
+ find(const key_type& __x) const
+ { return _M_t.find(__x); }
+ //@}
+
+ //@{
+ /**
+ * @brief Finds the beginning of a subsequence matching given key.
+ * @param x Key to be located.
+ * @return Iterator pointing to first element equal to or greater
+ * than key, or end().
+ *
+ * This function returns the first element of a subsequence of elements
+ * that matches the given key. If unsuccessful it returns an iterator
+ * pointing to the first element that has a greater value than given key
+ * or end() if no such element exists.
+ */
+ iterator
+ lower_bound(const key_type& __x)
+ { return _M_t.lower_bound(__x); }
+
+ const_iterator
+ lower_bound(const key_type& __x) const
+ { return _M_t.lower_bound(__x); }
+ //@}
+
+ //@{
+ /**
+ * @brief Finds the end of a subsequence matching given key.
+ * @param x Key to be located.
+ * @return Iterator pointing to the first element
+ * greater than key, or end().
+ */
+ iterator
+ upper_bound(const key_type& __x)
+ { return _M_t.upper_bound(__x); }
+
+ const_iterator
+ upper_bound(const key_type& __x) const
+ { return _M_t.upper_bound(__x); }
+ //@}
+
+ //@{
+ /**
+ * @brief Finds a subsequence matching given key.
+ * @param x Key to be located.
+ * @return Pair of iterators that possibly points to the subsequence
+ * matching given key.
+ *
+ * This function is equivalent to
+ * @code
+ * std::make_pair(c.lower_bound(val),
+ * c.upper_bound(val))
+ * @endcode
+ * (but is faster than making the calls separately).
+ *
+ * This function probably only makes sense for multisets.
+ */
+ std::pair<iterator, iterator>
+ equal_range(const key_type& __x)
+ { return _M_t.equal_range(__x); }
+
+ std::pair<const_iterator, const_iterator>
+ equal_range(const key_type& __x) const
+ { return _M_t.equal_range(__x); }
+
+ template<typename _K1, typename _C1, typename _A1>
+ friend bool
+ operator==(const multiset<_K1, _C1, _A1>&,
+ const multiset<_K1, _C1, _A1>&);
+
+ template<typename _K1, typename _C1, typename _A1>
+ friend bool
+ operator< (const multiset<_K1, _C1, _A1>&,
+ const multiset<_K1, _C1, _A1>&);
+ };
+
+ /**
+ * @brief Multiset equality comparison.
+ * @param x A %multiset.
+ * @param y A %multiset of the same type as @a x.
+ * @return True iff the size and elements of the multisets are equal.
+ *
+ * This is an equivalence relation. It is linear in the size of the
+ * multisets.
+ * Multisets are considered equivalent if their sizes are equal, and if
+ * corresponding elements compare equal.
+ */
+ template<typename _Key, typename _Compare, typename _Alloc>
+ inline bool
+ operator==(const multiset<_Key, _Compare, _Alloc>& __x,
+ const multiset<_Key, _Compare, _Alloc>& __y)
+ { return __x._M_t == __y._M_t; }
+
+ /**
+ * @brief Multiset ordering relation.
+ * @param x A %multiset.
+ * @param y A %multiset of the same type as @a x.
+ * @return True iff @a x is lexicographically less than @a y.
+ *
+ * This is a total ordering relation. It is linear in the size of the
+ * maps. The elements must be comparable with @c <.
+ *
+ * See std::lexicographical_compare() for how the determination is made.
+ */
+ template<typename _Key, typename _Compare, typename _Alloc>
+ inline bool
+ operator<(const multiset<_Key, _Compare, _Alloc>& __x,
+ const multiset<_Key, _Compare, _Alloc>& __y)
+ { return __x._M_t < __y._M_t; }
+
+ /// Returns !(x == y).
+ template<typename _Key, typename _Compare, typename _Alloc>
+ inline bool
+ operator!=(const multiset<_Key, _Compare, _Alloc>& __x,
+ const multiset<_Key, _Compare, _Alloc>& __y)
+ { return !(__x == __y); }
+
+ /// Returns y < x.
+ template<typename _Key, typename _Compare, typename _Alloc>
+ inline bool
+ operator>(const multiset<_Key,_Compare,_Alloc>& __x,
+ const multiset<_Key,_Compare,_Alloc>& __y)
+ { return __y < __x; }
+
+ /// Returns !(y < x)
+ template<typename _Key, typename _Compare, typename _Alloc>
+ inline bool
+ operator<=(const multiset<_Key, _Compare, _Alloc>& __x,
+ const multiset<_Key, _Compare, _Alloc>& __y)
+ { return !(__y < __x); }
+
+ /// Returns !(x < y)
+ template<typename _Key, typename _Compare, typename _Alloc>
+ inline bool
+ operator>=(const multiset<_Key, _Compare, _Alloc>& __x,
+ const multiset<_Key, _Compare, _Alloc>& __y)
+ { return !(__x < __y); }
+
+ /// See std::multiset::swap().
+ template<typename _Key, typename _Compare, typename _Alloc>
+ inline void
+ swap(multiset<_Key, _Compare, _Alloc>& __x,
+ multiset<_Key, _Compare, _Alloc>& __y)
+ { __x.swap(__y); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Key, typename _Compare, typename _Alloc>
+ inline void
+ swap(multiset<_Key, _Compare, _Alloc>&& __x,
+ multiset<_Key, _Compare, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Key, typename _Compare, typename _Alloc>
+ inline void
+ swap(multiset<_Key, _Compare, _Alloc>& __x,
+ multiset<_Key, _Compare, _Alloc>&& __y)
+ { __x.swap(__y); }
+#endif
+
+_GLIBCXX_END_NESTED_NAMESPACE
+
+#endif /* _STL_MULTISET_H */
diff --git a/i686-linux/include/c++/4.4.3/bits/stl_numeric.h b/i686-linux/include/c++/4.4.3/bits/stl_numeric.h
new file mode 100644
index 0000000..5edf2bc
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/stl_numeric.h
@@ -0,0 +1,373 @@
+// Numeric functions implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_numeric.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_NUMERIC_H
+#define _STL_NUMERIC_H 1
+
+#include <bits/concept_check.h>
+#include <debug/debug.h>
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @brief Create a range of sequentially increasing values.
+ *
+ * For each element in the range @p [first,last) assigns @p value and
+ * increments @p value as if by @p ++value.
+ *
+ * @param first Start of range.
+ * @param last End of range.
+ * @param value Starting value.
+ * @return Nothing.
+ */
+ template<typename _ForwardIterator, typename _Tp>
+ void
+ iota(_ForwardIterator __first, _ForwardIterator __last, _Tp __value)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
+ _ForwardIterator>)
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ for (; __first != __last; ++__first)
+ {
+ *__first = __value;
+ ++__value;
+ }
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
+
+_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_P)
+
+ /**
+ * @brief Accumulate values in a range.
+ *
+ * Accumulates the values in the range [first,last) using operator+(). The
+ * initial value is @a init. The values are processed in order.
+ *
+ * @param first Start of range.
+ * @param last End of range.
+ * @param init Starting value to add other values to.
+ * @return The final sum.
+ */
+ template<typename _InputIterator, typename _Tp>
+ inline _Tp
+ accumulate(_InputIterator __first, _InputIterator __last, _Tp __init)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ for (; __first != __last; ++__first)
+ __init = __init + *__first;
+ return __init;
+ }
+
+ /**
+ * @brief Accumulate values in a range with operation.
+ *
+ * Accumulates the values in the range [first,last) using the function
+ * object @a binary_op. The initial value is @a init. The values are
+ * processed in order.
+ *
+ * @param first Start of range.
+ * @param last End of range.
+ * @param init Starting value to add other values to.
+ * @param binary_op Function object to accumulate with.
+ * @return The final sum.
+ */
+ template<typename _InputIterator, typename _Tp, typename _BinaryOperation>
+ inline _Tp
+ accumulate(_InputIterator __first, _InputIterator __last, _Tp __init,
+ _BinaryOperation __binary_op)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ for (; __first != __last; ++__first)
+ __init = __binary_op(__init, *__first);
+ return __init;
+ }
+
+ /**
+ * @brief Compute inner product of two ranges.
+ *
+ * Starting with an initial value of @a init, multiplies successive
+ * elements from the two ranges and adds each product into the accumulated
+ * value using operator+(). The values in the ranges are processed in
+ * order.
+ *
+ * @param first1 Start of range 1.
+ * @param last1 End of range 1.
+ * @param first2 Start of range 2.
+ * @param init Starting value to add other values to.
+ * @return The final inner product.
+ */
+ template<typename _InputIterator1, typename _InputIterator2, typename _Tp>
+ inline _Tp
+ inner_product(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _Tp __init)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+
+ for (; __first1 != __last1; ++__first1, ++__first2)
+ __init = __init + (*__first1 * *__first2);
+ return __init;
+ }
+
+ /**
+ * @brief Compute inner product of two ranges.
+ *
+ * Starting with an initial value of @a init, applies @a binary_op2 to
+ * successive elements from the two ranges and accumulates each result into
+ * the accumulated value using @a binary_op1. The values in the ranges are
+ * processed in order.
+ *
+ * @param first1 Start of range 1.
+ * @param last1 End of range 1.
+ * @param first2 Start of range 2.
+ * @param init Starting value to add other values to.
+ * @param binary_op1 Function object to accumulate with.
+ * @param binary_op2 Function object to apply to pairs of input values.
+ * @return The final inner product.
+ */
+ template<typename _InputIterator1, typename _InputIterator2, typename _Tp,
+ typename _BinaryOperation1, typename _BinaryOperation2>
+ inline _Tp
+ inner_product(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _Tp __init,
+ _BinaryOperation1 __binary_op1,
+ _BinaryOperation2 __binary_op2)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+
+ for (; __first1 != __last1; ++__first1, ++__first2)
+ __init = __binary_op1(__init, __binary_op2(*__first1, *__first2));
+ return __init;
+ }
+
+ /**
+ * @brief Return list of partial sums
+ *
+ * Accumulates the values in the range [first,last) using operator+().
+ * As each successive input value is added into the total, that partial sum
+ * is written to @a result. Therefore, the first value in result is the
+ * first value of the input, the second value in result is the sum of the
+ * first and second input values, and so on.
+ *
+ * @param first Start of input range.
+ * @param last End of input range.
+ * @param result Output to write sums to.
+ * @return Iterator pointing just beyond the values written to result.
+ */
+ template<typename _InputIterator, typename _OutputIterator>
+ _OutputIterator
+ partial_sum(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result)
+ {
+ typedef typename iterator_traits<_InputIterator>::value_type _ValueType;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return __result;
+ _ValueType __value = *__first;
+ *__result = __value;
+ while (++__first != __last)
+ {
+ __value = __value + *__first;
+ *++__result = __value;
+ }
+ return ++__result;
+ }
+
+ /**
+ * @brief Return list of partial sums
+ *
+ * Accumulates the values in the range [first,last) using operator+().
+ * As each successive input value is added into the total, that partial sum
+ * is written to @a result. Therefore, the first value in result is the
+ * first value of the input, the second value in result is the sum of the
+ * first and second input values, and so on.
+ *
+ * @param first Start of input range.
+ * @param last End of input range.
+ * @param result Output to write sums to.
+ * @return Iterator pointing just beyond the values written to result.
+ */
+ template<typename _InputIterator, typename _OutputIterator,
+ typename _BinaryOperation>
+ _OutputIterator
+ partial_sum(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result, _BinaryOperation __binary_op)
+ {
+ typedef typename iterator_traits<_InputIterator>::value_type _ValueType;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return __result;
+ _ValueType __value = *__first;
+ *__result = __value;
+ while (++__first != __last)
+ {
+ __value = __binary_op(__value, *__first);
+ *++__result = __value;
+ }
+ return ++__result;
+ }
+
+ /**
+ * @brief Return differences between adjacent values.
+ *
+ * Computes the difference between adjacent values in the range
+ * [first,last) using operator-() and writes the result to @a result.
+ *
+ * @param first Start of input range.
+ * @param last End of input range.
+ * @param result Output to write sums to.
+ * @return Iterator pointing just beyond the values written to result.
+ */
+ template<typename _InputIterator, typename _OutputIterator>
+ _OutputIterator
+ adjacent_difference(_InputIterator __first,
+ _InputIterator __last, _OutputIterator __result)
+ {
+ typedef typename iterator_traits<_InputIterator>::value_type _ValueType;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return __result;
+ _ValueType __value = *__first;
+ *__result = __value;
+ while (++__first != __last)
+ {
+ _ValueType __tmp = *__first;
+ *++__result = __tmp - __value;
+ __value = __tmp;
+ }
+ return ++__result;
+ }
+
+ /**
+ * @brief Return differences between adjacent values.
+ *
+ * Computes the difference between adjacent values in the range
+ * [first,last) using the function object @a binary_op and writes the
+ * result to @a result.
+ *
+ * @param first Start of input range.
+ * @param last End of input range.
+ * @param result Output to write sums to.
+ * @return Iterator pointing just beyond the values written to result.
+ */
+ template<typename _InputIterator, typename _OutputIterator,
+ typename _BinaryOperation>
+ _OutputIterator
+ adjacent_difference(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result, _BinaryOperation __binary_op)
+ {
+ typedef typename iterator_traits<_InputIterator>::value_type _ValueType;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return __result;
+ _ValueType __value = *__first;
+ *__result = __value;
+ while (++__first != __last)
+ {
+ _ValueType __tmp = *__first;
+ *++__result = __binary_op(__tmp, __value);
+ __value = __tmp;
+ }
+ return ++__result;
+ }
+
+_GLIBCXX_END_NESTED_NAMESPACE
+
+#endif /* _STL_NUMERIC_H */
diff --git a/i686-linux/include/c++/4.4.3/bits/stl_pair.h b/i686-linux/include/c++/4.4.3/bits/stl_pair.h
new file mode 100644
index 0000000..fd395ad
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/stl_pair.h
@@ -0,0 +1,261 @@
+// Pair implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_pair.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_PAIR_H
+#define _STL_PAIR_H 1
+
+#include <bits/move.h> // for std::move / std::forward, std::decay, and
+ // std::swap
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /// pair holds two objects of arbitrary type.
+ template<class _T1, class _T2>
+ struct pair
+ {
+ typedef _T1 first_type; ///< @c first_type is the first bound type
+ typedef _T2 second_type; ///< @c second_type is the second bound type
+
+ _T1 first; ///< @c first is a copy of the first object
+ _T2 second; ///< @c second is a copy of the second object
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 265. std::pair::pair() effects overly restrictive
+ /** The default constructor creates @c first and @c second using their
+ * respective default constructors. */
+ pair()
+ : first(), second() { }
+
+ /** Two objects may be passed to a @c pair constructor to be copied. */
+ pair(const _T1& __a, const _T2& __b)
+ : first(__a), second(__b) { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<class _U1, class _U2>
+ pair(_U1&& __x, _U2&& __y)
+ : first(std::forward<_U1>(__x)),
+ second(std::forward<_U2>(__y)) { }
+
+ pair(pair&& __p)
+ : first(std::move(__p.first)),
+ second(std::move(__p.second)) { }
+#endif
+
+ /** There is also a templated copy ctor for the @c pair class itself. */
+ template<class _U1, class _U2>
+ pair(const pair<_U1, _U2>& __p)
+ : first(__p.first),
+ second(__p.second) { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<class _U1, class _U2>
+ pair(pair<_U1, _U2>&& __p)
+ : first(std::move(__p.first)),
+ second(std::move(__p.second)) { }
+
+ // http://gcc.gnu.org/ml/libstdc++/2007-08/msg00052.html
+ template<class _U1, class _Arg0, class... _Args>
+ pair(_U1&& __x, _Arg0&& __arg0, _Args&&... __args)
+ : first(std::forward<_U1>(__x)),
+ second(std::forward<_Arg0>(__arg0),
+ std::forward<_Args>(__args)...) { }
+
+ pair&
+ operator=(pair&& __p)
+ {
+ first = std::move(__p.first);
+ second = std::move(__p.second);
+ return *this;
+ }
+
+ template<class _U1, class _U2>
+ pair&
+ operator=(pair<_U1, _U2>&& __p)
+ {
+ first = std::move(__p.first);
+ second = std::move(__p.second);
+ return *this;
+ }
+
+ void
+ swap(pair&& __p)
+ {
+ using std::swap;
+ swap(first, __p.first);
+ swap(second, __p.second);
+ }
+#endif
+ };
+
+ /// Two pairs of the same type are equal iff their members are equal.
+ template<class _T1, class _T2>
+ inline bool
+ operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
+ { return __x.first == __y.first && __x.second == __y.second; }
+
+ /// <http://gcc.gnu.org/onlinedocs/libstdc++/manual/utilities.html>
+ template<class _T1, class _T2>
+ inline bool
+ operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
+ { return __x.first < __y.first
+ || (!(__y.first < __x.first) && __x.second < __y.second); }
+
+ /// Uses @c operator== to find the result.
+ template<class _T1, class _T2>
+ inline bool
+ operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
+ { return !(__x == __y); }
+
+ /// Uses @c operator< to find the result.
+ template<class _T1, class _T2>
+ inline bool
+ operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
+ { return __y < __x; }
+
+ /// Uses @c operator< to find the result.
+ template<class _T1, class _T2>
+ inline bool
+ operator<=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
+ { return !(__y < __x); }
+
+ /// Uses @c operator< to find the result.
+ template<class _T1, class _T2>
+ inline bool
+ operator>=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
+ { return !(__x < __y); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /// See std::pair::swap().
+ // Note: no std::swap overloads in C++03 mode, this has performance
+ // implications, see, eg, libstdc++/38466.
+ template<class _T1, class _T2>
+ inline void
+ swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
+ { __x.swap(__y); }
+
+ template<class _T1, class _T2>
+ inline void
+ swap(pair<_T1, _T2>&& __x, pair<_T1, _T2>& __y)
+ { __x.swap(__y); }
+
+ template<class _T1, class _T2>
+ inline void
+ swap(pair<_T1, _T2>& __x, pair<_T1, _T2>&& __y)
+ { __x.swap(__y); }
+#endif
+
+ /**
+ * @brief A convenience wrapper for creating a pair from two objects.
+ * @param x The first object.
+ * @param y The second object.
+ * @return A newly-constructed pair<> object of the appropriate type.
+ *
+ * The standard requires that the objects be passed by reference-to-const,
+ * but LWG issue #181 says they should be passed by const value. We follow
+ * the LWG by default.
+ */
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 181. make_pair() unintended behavior
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+ template<class _T1, class _T2>
+ inline pair<_T1, _T2>
+ make_pair(_T1 __x, _T2 __y)
+ { return pair<_T1, _T2>(__x, __y); }
+#else
+ template<typename _Tp>
+ class reference_wrapper;
+
+ // Helper which adds a reference to a type when given a reference_wrapper
+ template<typename _Tp>
+ struct __strip_reference_wrapper
+ {
+ typedef _Tp __type;
+ };
+
+ template<typename _Tp>
+ struct __strip_reference_wrapper<reference_wrapper<_Tp> >
+ {
+ typedef _Tp& __type;
+ };
+
+ template<typename _Tp>
+ struct __strip_reference_wrapper<const reference_wrapper<_Tp> >
+ {
+ typedef _Tp& __type;
+ };
+
+ template<typename _Tp>
+ struct __decay_and_strip
+ {
+ typedef typename __strip_reference_wrapper<
+ typename decay<_Tp>::type>::__type __type;
+ };
+
+ // NB: DR 706.
+ template<class _T1, class _T2>
+ inline pair<typename __decay_and_strip<_T1>::__type,
+ typename __decay_and_strip<_T2>::__type>
+ make_pair(_T1&& __x, _T2&& __y)
+ {
+ return pair<typename __decay_and_strip<_T1>::__type,
+ typename __decay_and_strip<_T2>::__type>
+ (std::forward<_T1>(__x), std::forward<_T2>(__y));
+ }
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _STL_PAIR_H */
diff --git a/i686-linux/include/c++/4.4.3/bits/stl_queue.h b/i686-linux/include/c++/4.4.3/bits/stl_queue.h
new file mode 100644
index 0000000..7479469
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/stl_queue.h
@@ -0,0 +1,586 @@
+// Queue implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_queue.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_QUEUE_H
+#define _STL_QUEUE_H 1
+
+#include <bits/concept_check.h>
+#include <debug/debug.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @brief A standard container giving FIFO behavior.
+ *
+ * @ingroup sequences
+ *
+ * Meets many of the requirements of a
+ * <a href="tables.html#65">container</a>,
+ * but does not define anything to do with iterators. Very few of the
+ * other standard container interfaces are defined.
+ *
+ * This is not a true container, but an @e adaptor. It holds another
+ * container, and provides a wrapper interface to that container. The
+ * wrapper is what enforces strict first-in-first-out %queue behavior.
+ *
+ * The second template parameter defines the type of the underlying
+ * sequence/container. It defaults to std::deque, but it can be any type
+ * that supports @c front, @c back, @c push_back, and @c pop_front,
+ * such as std::list or an appropriate user-defined type.
+ *
+ * Members not found in "normal" containers are @c container_type,
+ * which is a typedef for the second Sequence parameter, and @c push and
+ * @c pop, which are standard %queue/FIFO operations.
+ */
+ template<typename _Tp, typename _Sequence = deque<_Tp> >
+ class queue
+ {
+ // concept requirements
+ typedef typename _Sequence::value_type _Sequence_value_type;
+ __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
+ __glibcxx_class_requires(_Sequence, _FrontInsertionSequenceConcept)
+ __glibcxx_class_requires(_Sequence, _BackInsertionSequenceConcept)
+ __glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept)
+
+ template<typename _Tp1, typename _Seq1>
+ friend bool
+ operator==(const queue<_Tp1, _Seq1>&, const queue<_Tp1, _Seq1>&);
+
+ template<typename _Tp1, typename _Seq1>
+ friend bool
+ operator<(const queue<_Tp1, _Seq1>&, const queue<_Tp1, _Seq1>&);
+
+ public:
+ typedef typename _Sequence::value_type value_type;
+ typedef typename _Sequence::reference reference;
+ typedef typename _Sequence::const_reference const_reference;
+ typedef typename _Sequence::size_type size_type;
+ typedef _Sequence container_type;
+
+ protected:
+ /**
+ * 'c' is the underlying container. Maintainers wondering why
+ * this isn't uglified as per style guidelines should note that
+ * this name is specified in the standard, [23.2.3.1]. (Why?
+ * Presumably for the same reason that it's protected instead
+ * of private: to allow derivation. But none of the other
+ * containers allow for derivation. Odd.)
+ */
+ _Sequence c;
+
+ public:
+ /**
+ * @brief Default constructor creates no elements.
+ */
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+ explicit
+ queue(const _Sequence& __c = _Sequence())
+ : c(__c) { }
+#else
+ explicit
+ queue(const _Sequence& __c)
+ : c(__c) { }
+
+ explicit
+ queue(_Sequence&& __c = _Sequence())
+ : c(std::move(__c)) { }
+
+ queue(queue&& __q)
+ : c(std::move(__q.c)) { }
+
+ queue&
+ operator=(queue&& __q)
+ {
+ c = std::move(__q.c);
+ return *this;
+ }
+#endif
+
+ /**
+ * Returns true if the %queue is empty.
+ */
+ bool
+ empty() const
+ { return c.empty(); }
+
+ /** Returns the number of elements in the %queue. */
+ size_type
+ size() const
+ { return c.size(); }
+
+ /**
+ * Returns a read/write reference to the data at the first
+ * element of the %queue.
+ */
+ reference
+ front()
+ {
+ __glibcxx_requires_nonempty();
+ return c.front();
+ }
+
+ /**
+ * Returns a read-only (constant) reference to the data at the first
+ * element of the %queue.
+ */
+ const_reference
+ front() const
+ {
+ __glibcxx_requires_nonempty();
+ return c.front();
+ }
+
+ /**
+ * Returns a read/write reference to the data at the last
+ * element of the %queue.
+ */
+ reference
+ back()
+ {
+ __glibcxx_requires_nonempty();
+ return c.back();
+ }
+
+ /**
+ * Returns a read-only (constant) reference to the data at the last
+ * element of the %queue.
+ */
+ const_reference
+ back() const
+ {
+ __glibcxx_requires_nonempty();
+ return c.back();
+ }
+
+ /**
+ * @brief Add data to the end of the %queue.
+ * @param x Data to be added.
+ *
+ * This is a typical %queue operation. The function creates an
+ * element at the end of the %queue and assigns the given data
+ * to it. The time complexity of the operation depends on the
+ * underlying sequence.
+ */
+ void
+ push(const value_type& __x)
+ { c.push_back(__x); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ push(value_type&& __x)
+ { c.push_back(std::move(__x)); }
+
+ template<typename... _Args>
+ void
+ emplace(_Args&&... __args)
+ { c.emplace_back(std::forward<_Args>(__args)...); }
+#endif
+
+ /**
+ * @brief Removes first element.
+ *
+ * This is a typical %queue operation. It shrinks the %queue by one.
+ * The time complexity of the operation depends on the underlying
+ * sequence.
+ *
+ * Note that no data is returned, and if the first element's
+ * data is needed, it should be retrieved before pop() is
+ * called.
+ */
+ void
+ pop()
+ {
+ __glibcxx_requires_nonempty();
+ c.pop_front();
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ swap(queue&& __q)
+ { c.swap(__q.c); }
+#endif
+ };
+
+ /**
+ * @brief Queue equality comparison.
+ * @param x A %queue.
+ * @param y A %queue of the same type as @a x.
+ * @return True iff the size and elements of the queues are equal.
+ *
+ * This is an equivalence relation. Complexity and semantics depend on the
+ * underlying sequence type, but the expected rules are: this relation is
+ * linear in the size of the sequences, and queues are considered equivalent
+ * if their sequences compare equal.
+ */
+ template<typename _Tp, typename _Seq>
+ inline bool
+ operator==(const queue<_Tp, _Seq>& __x, const queue<_Tp, _Seq>& __y)
+ { return __x.c == __y.c; }
+
+ /**
+ * @brief Queue ordering relation.
+ * @param x A %queue.
+ * @param y A %queue of the same type as @a x.
+ * @return True iff @a x is lexicographically less than @a y.
+ *
+ * This is an total ordering relation. Complexity and semantics
+ * depend on the underlying sequence type, but the expected rules
+ * are: this relation is linear in the size of the sequences, the
+ * elements must be comparable with @c <, and
+ * std::lexicographical_compare() is usually used to make the
+ * determination.
+ */
+ template<typename _Tp, typename _Seq>
+ inline bool
+ operator<(const queue<_Tp, _Seq>& __x, const queue<_Tp, _Seq>& __y)
+ { return __x.c < __y.c; }
+
+ /// Based on operator==
+ template<typename _Tp, typename _Seq>
+ inline bool
+ operator!=(const queue<_Tp, _Seq>& __x, const queue<_Tp, _Seq>& __y)
+ { return !(__x == __y); }
+
+ /// Based on operator<
+ template<typename _Tp, typename _Seq>
+ inline bool
+ operator>(const queue<_Tp, _Seq>& __x, const queue<_Tp, _Seq>& __y)
+ { return __y < __x; }
+
+ /// Based on operator<
+ template<typename _Tp, typename _Seq>
+ inline bool
+ operator<=(const queue<_Tp, _Seq>& __x, const queue<_Tp, _Seq>& __y)
+ { return !(__y < __x); }
+
+ /// Based on operator<
+ template<typename _Tp, typename _Seq>
+ inline bool
+ operator>=(const queue<_Tp, _Seq>& __x, const queue<_Tp, _Seq>& __y)
+ { return !(__x < __y); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp, typename _Seq>
+ inline void
+ swap(queue<_Tp, _Seq>& __x, queue<_Tp, _Seq>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Tp, typename _Seq>
+ inline void
+ swap(queue<_Tp, _Seq>&& __x, queue<_Tp, _Seq>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Tp, typename _Seq>
+ inline void
+ swap(queue<_Tp, _Seq>& __x, queue<_Tp, _Seq>&& __y)
+ { __x.swap(__y); }
+#endif
+
+ /**
+ * @brief A standard container automatically sorting its contents.
+ *
+ * @ingroup sequences
+ *
+ * This is not a true container, but an @e adaptor. It holds
+ * another container, and provides a wrapper interface to that
+ * container. The wrapper is what enforces priority-based sorting
+ * and %queue behavior. Very few of the standard container/sequence
+ * interface requirements are met (e.g., iterators).
+ *
+ * The second template parameter defines the type of the underlying
+ * sequence/container. It defaults to std::vector, but it can be
+ * any type that supports @c front(), @c push_back, @c pop_back,
+ * and random-access iterators, such as std::deque or an
+ * appropriate user-defined type.
+ *
+ * The third template parameter supplies the means of making
+ * priority comparisons. It defaults to @c less<value_type> but
+ * can be anything defining a strict weak ordering.
+ *
+ * Members not found in "normal" containers are @c container_type,
+ * which is a typedef for the second Sequence parameter, and @c
+ * push, @c pop, and @c top, which are standard %queue operations.
+ *
+ * @note No equality/comparison operators are provided for
+ * %priority_queue.
+ *
+ * @note Sorting of the elements takes place as they are added to,
+ * and removed from, the %priority_queue using the
+ * %priority_queue's member functions. If you access the elements
+ * by other means, and change their data such that the sorting
+ * order would be different, the %priority_queue will not re-sort
+ * the elements for you. (How could it know to do so?)
+ */
+ template<typename _Tp, typename _Sequence = vector<_Tp>,
+ typename _Compare = less<typename _Sequence::value_type> >
+ class priority_queue
+ {
+ // concept requirements
+ typedef typename _Sequence::value_type _Sequence_value_type;
+ __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
+ __glibcxx_class_requires(_Sequence, _SequenceConcept)
+ __glibcxx_class_requires(_Sequence, _RandomAccessContainerConcept)
+ __glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept)
+ __glibcxx_class_requires4(_Compare, bool, _Tp, _Tp,
+ _BinaryFunctionConcept)
+
+ public:
+ typedef typename _Sequence::value_type value_type;
+ typedef typename _Sequence::reference reference;
+ typedef typename _Sequence::const_reference const_reference;
+ typedef typename _Sequence::size_type size_type;
+ typedef _Sequence container_type;
+
+ protected:
+ // See queue::c for notes on these names.
+ _Sequence c;
+ _Compare comp;
+
+ public:
+ /**
+ * @brief Default constructor creates no elements.
+ */
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+ explicit
+ priority_queue(const _Compare& __x = _Compare(),
+ const _Sequence& __s = _Sequence())
+ : c(__s), comp(__x)
+ { std::make_heap(c.begin(), c.end(), comp); }
+#else
+ explicit
+ priority_queue(const _Compare& __x,
+ const _Sequence& __s)
+ : c(__s), comp(__x)
+ { std::make_heap(c.begin(), c.end(), comp); }
+
+ explicit
+ priority_queue(const _Compare& __x = _Compare(),
+ _Sequence&& __s = _Sequence())
+ : c(std::move(__s)), comp(__x)
+ { std::make_heap(c.begin(), c.end(), comp); }
+#endif
+
+ /**
+ * @brief Builds a %queue from a range.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param x A comparison functor describing a strict weak ordering.
+ * @param s An initial sequence with which to start.
+ *
+ * Begins by copying @a s, inserting a copy of the elements
+ * from @a [first,last) into the copy of @a s, then ordering
+ * the copy according to @a x.
+ *
+ * For more information on function objects, see the
+ * documentation on @link functors functor base
+ * classes@endlink.
+ */
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _InputIterator>
+ priority_queue(_InputIterator __first, _InputIterator __last,
+ const _Compare& __x = _Compare(),
+ const _Sequence& __s = _Sequence())
+ : c(__s), comp(__x)
+ {
+ __glibcxx_requires_valid_range(__first, __last);
+ c.insert(c.end(), __first, __last);
+ std::make_heap(c.begin(), c.end(), comp);
+ }
+#else
+ template<typename _InputIterator>
+ priority_queue(_InputIterator __first, _InputIterator __last,
+ const _Compare& __x,
+ const _Sequence& __s)
+ : c(__s), comp(__x)
+ {
+ __glibcxx_requires_valid_range(__first, __last);
+ c.insert(c.end(), __first, __last);
+ std::make_heap(c.begin(), c.end(), comp);
+ }
+
+ template<typename _InputIterator>
+ priority_queue(_InputIterator __first, _InputIterator __last,
+ const _Compare& __x = _Compare(),
+ _Sequence&& __s = _Sequence())
+ : c(std::move(__s)), comp(__x)
+ {
+ __glibcxx_requires_valid_range(__first, __last);
+ c.insert(c.end(), __first, __last);
+ std::make_heap(c.begin(), c.end(), comp);
+ }
+
+ priority_queue(priority_queue&& __pq)
+ : c(std::move(__pq.c)), comp(std::move(__pq.comp)) { }
+
+ priority_queue&
+ operator=(priority_queue&& __pq)
+ {
+ c = std::move(__pq.c);
+ comp = std::move(__pq.comp);
+ return *this;
+ }
+#endif
+
+ /**
+ * Returns true if the %queue is empty.
+ */
+ bool
+ empty() const
+ { return c.empty(); }
+
+ /** Returns the number of elements in the %queue. */
+ size_type
+ size() const
+ { return c.size(); }
+
+ /**
+ * Returns a read-only (constant) reference to the data at the first
+ * element of the %queue.
+ */
+ const_reference
+ top() const
+ {
+ __glibcxx_requires_nonempty();
+ return c.front();
+ }
+
+ /**
+ * @brief Add data to the %queue.
+ * @param x Data to be added.
+ *
+ * This is a typical %queue operation.
+ * The time complexity of the operation depends on the underlying
+ * sequence.
+ */
+ void
+ push(const value_type& __x)
+ {
+ c.push_back(__x);
+ std::push_heap(c.begin(), c.end(), comp);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ push(value_type&& __x)
+ {
+ c.push_back(std::move(__x));
+ std::push_heap(c.begin(), c.end(), comp);
+ }
+
+ template<typename... _Args>
+ void
+ emplace(_Args&&... __args)
+ {
+ c.emplace_back(std::forward<_Args>(__args)...);
+ std::push_heap(c.begin(), c.end(), comp);
+ }
+#endif
+
+ /**
+ * @brief Removes first element.
+ *
+ * This is a typical %queue operation. It shrinks the %queue
+ * by one. The time complexity of the operation depends on the
+ * underlying sequence.
+ *
+ * Note that no data is returned, and if the first element's
+ * data is needed, it should be retrieved before pop() is
+ * called.
+ */
+ void
+ pop()
+ {
+ __glibcxx_requires_nonempty();
+ std::pop_heap(c.begin(), c.end(), comp);
+ c.pop_back();
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ swap(priority_queue&& __pq)
+ {
+ using std::swap;
+ c.swap(__pq.c);
+ swap(comp, __pq.comp);
+ }
+#endif
+ };
+
+ // No equality/comparison operators are provided for priority_queue.
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp, typename _Sequence, typename _Compare>
+ inline void
+ swap(priority_queue<_Tp, _Sequence, _Compare>& __x,
+ priority_queue<_Tp, _Sequence, _Compare>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Tp, typename _Sequence, typename _Compare>
+ inline void
+ swap(priority_queue<_Tp, _Sequence, _Compare>&& __x,
+ priority_queue<_Tp, _Sequence, _Compare>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Tp, typename _Sequence, typename _Compare>
+ inline void
+ swap(priority_queue<_Tp, _Sequence, _Compare>& __x,
+ priority_queue<_Tp, _Sequence, _Compare>&& __y)
+ { __x.swap(__y); }
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _STL_QUEUE_H */
diff --git a/i686-linux/include/c++/4.4.3/bits/stl_raw_storage_iter.h b/i686-linux/include/c++/4.4.3/bits/stl_raw_storage_iter.h
new file mode 100644
index 0000000..de6cad9
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/stl_raw_storage_iter.h
@@ -0,0 +1,106 @@
+// -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_raw_storage_iter.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_RAW_STORAGE_ITERATOR_H
+#define _STL_RAW_STORAGE_ITERATOR_H 1
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * This iterator class lets algorithms store their results into
+ * uninitialized memory.
+ */
+ template <class _OutputIterator, class _Tp>
+ class raw_storage_iterator
+ : public iterator<output_iterator_tag, void, void, void, void>
+ {
+ protected:
+ _OutputIterator _M_iter;
+
+ public:
+ explicit
+ raw_storage_iterator(_OutputIterator __x)
+ : _M_iter(__x) {}
+
+ raw_storage_iterator&
+ operator*() { return *this; }
+
+ raw_storage_iterator&
+ operator=(const _Tp& __element)
+ {
+ std::_Construct(&*_M_iter, __element);
+ return *this;
+ }
+
+ raw_storage_iterator<_OutputIterator, _Tp>&
+ operator++()
+ {
+ ++_M_iter;
+ return *this;
+ }
+
+ raw_storage_iterator<_OutputIterator, _Tp>
+ operator++(int)
+ {
+ raw_storage_iterator<_OutputIterator, _Tp> __tmp = *this;
+ ++_M_iter;
+ return __tmp;
+ }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/bits/stl_relops.h b/i686-linux/include/c++/4.4.3/bits/stl_relops.h
new file mode 100644
index 0000000..4377c5f
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/stl_relops.h
@@ -0,0 +1,131 @@
+// std::rel_ops implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2004, 2005, 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the, 2009 Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ */
+
+/** @file stl_relops.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ *
+ * Inclusion of this file has been removed from
+ * all of the other STL headers for safety reasons, except std_utility.h.
+ * For more information, see the thread of about twenty messages starting
+ * with http://gcc.gnu.org/ml/libstdc++/2001-01/msg00223.html, or
+ * http://gcc.gnu.org/onlinedocs/libstdc++/faq.html#faq.ambiguous_overloads
+ *
+ * Short summary: the rel_ops operators should be avoided for the present.
+ */
+
+#ifndef _STL_RELOPS_H
+#define _STL_RELOPS_H 1
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ namespace rel_ops
+ {
+ /** @namespace std::rel_ops
+ * @brief The generated relational operators are sequestered here.
+ */
+
+ /**
+ * @brief Defines @c != for arbitrary types, in terms of @c ==.
+ * @param x A thing.
+ * @param y Another thing.
+ * @return x != y
+ *
+ * This function uses @c == to determine its result.
+ */
+ template <class _Tp>
+ inline bool
+ operator!=(const _Tp& __x, const _Tp& __y)
+ { return !(__x == __y); }
+
+ /**
+ * @brief Defines @c > for arbitrary types, in terms of @c <.
+ * @param x A thing.
+ * @param y Another thing.
+ * @return x > y
+ *
+ * This function uses @c < to determine its result.
+ */
+ template <class _Tp>
+ inline bool
+ operator>(const _Tp& __x, const _Tp& __y)
+ { return __y < __x; }
+
+ /**
+ * @brief Defines @c <= for arbitrary types, in terms of @c <.
+ * @param x A thing.
+ * @param y Another thing.
+ * @return x <= y
+ *
+ * This function uses @c < to determine its result.
+ */
+ template <class _Tp>
+ inline bool
+ operator<=(const _Tp& __x, const _Tp& __y)
+ { return !(__y < __x); }
+
+ /**
+ * @brief Defines @c >= for arbitrary types, in terms of @c <.
+ * @param x A thing.
+ * @param y Another thing.
+ * @return x >= y
+ *
+ * This function uses @c < to determine its result.
+ */
+ template <class _Tp>
+ inline bool
+ operator>=(const _Tp& __x, const _Tp& __y)
+ { return !(__x < __y); }
+
+ } // namespace rel_ops
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _STL_RELOPS_H */
diff --git a/i686-linux/include/c++/4.4.3/bits/stl_set.h b/i686-linux/include/c++/4.4.3/bits/stl_set.h
new file mode 100644
index 0000000..f06fe03
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/stl_set.h
@@ -0,0 +1,708 @@
+// Set implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_set.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_SET_H
+#define _STL_SET_H 1
+
+#include <bits/concept_check.h>
+#include <initializer_list>
+
+_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
+
+ /**
+ * @brief A standard container made up of unique keys, which can be
+ * retrieved in logarithmic time.
+ *
+ * @ingroup associative_containers
+ *
+ * Meets the requirements of a <a href="tables.html#65">container</a>, a
+ * <a href="tables.html#66">reversible container</a>, and an
+ * <a href="tables.html#69">associative container</a> (using unique keys).
+ *
+ * Sets support bidirectional iterators.
+ *
+ * @param Key Type of key objects.
+ * @param Compare Comparison function object type, defaults to less<Key>.
+ * @param Alloc Allocator type, defaults to allocator<Key>.
+ *
+ * The private tree data is declared exactly the same way for set and
+ * multiset; the distinction is made entirely in how the tree functions are
+ * called (*_unique versus *_equal, same as the standard).
+ */
+ template<typename _Key, typename _Compare = std::less<_Key>,
+ typename _Alloc = std::allocator<_Key> >
+ class set
+ {
+ // concept requirements
+ typedef typename _Alloc::value_type _Alloc_value_type;
+ __glibcxx_class_requires(_Key, _SGIAssignableConcept)
+ __glibcxx_class_requires4(_Compare, bool, _Key, _Key,
+ _BinaryFunctionConcept)
+ __glibcxx_class_requires2(_Key, _Alloc_value_type, _SameTypeConcept)
+
+ public:
+ // typedefs:
+ //@{
+ /// Public typedefs.
+ typedef _Key key_type;
+ typedef _Key value_type;
+ typedef _Compare key_compare;
+ typedef _Compare value_compare;
+ typedef _Alloc allocator_type;
+ //@}
+
+ private:
+ typedef typename _Alloc::template rebind<_Key>::other _Key_alloc_type;
+
+ typedef _Rb_tree<key_type, value_type, _Identity<value_type>,
+ key_compare, _Key_alloc_type> _Rep_type;
+ _Rep_type _M_t; // Red-black tree representing set.
+
+ public:
+ //@{
+ /// Iterator-related typedefs.
+ typedef typename _Key_alloc_type::pointer pointer;
+ typedef typename _Key_alloc_type::const_pointer const_pointer;
+ typedef typename _Key_alloc_type::reference reference;
+ typedef typename _Key_alloc_type::const_reference const_reference;
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 103. set::iterator is required to be modifiable,
+ // but this allows modification of keys.
+ typedef typename _Rep_type::const_iterator iterator;
+ typedef typename _Rep_type::const_iterator const_iterator;
+ typedef typename _Rep_type::const_reverse_iterator reverse_iterator;
+ typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;
+ typedef typename _Rep_type::size_type size_type;
+ typedef typename _Rep_type::difference_type difference_type;
+ //@}
+
+ // allocation/deallocation
+ /**
+ * @brief Default constructor creates no elements.
+ */
+ set()
+ : _M_t() { }
+
+ /**
+ * @brief Creates a %set with no elements.
+ * @param comp Comparator to use.
+ * @param a An allocator object.
+ */
+ explicit
+ set(const _Compare& __comp,
+ const allocator_type& __a = allocator_type())
+ : _M_t(__comp, __a) { }
+
+ /**
+ * @brief Builds a %set from a range.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ *
+ * Create a %set consisting of copies of the elements from [first,last).
+ * This is linear in N if the range is already sorted, and NlogN
+ * otherwise (where N is distance(first,last)).
+ */
+ template<typename _InputIterator>
+ set(_InputIterator __first, _InputIterator __last)
+ : _M_t()
+ { _M_t._M_insert_unique(__first, __last); }
+
+ /**
+ * @brief Builds a %set from a range.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param comp A comparison functor.
+ * @param a An allocator object.
+ *
+ * Create a %set consisting of copies of the elements from [first,last).
+ * This is linear in N if the range is already sorted, and NlogN
+ * otherwise (where N is distance(first,last)).
+ */
+ template<typename _InputIterator>
+ set(_InputIterator __first, _InputIterator __last,
+ const _Compare& __comp,
+ const allocator_type& __a = allocator_type())
+ : _M_t(__comp, __a)
+ { _M_t._M_insert_unique(__first, __last); }
+
+ /**
+ * @brief %Set copy constructor.
+ * @param x A %set of identical element and allocator types.
+ *
+ * The newly-created %set uses a copy of the allocation object used
+ * by @a x.
+ */
+ set(const set& __x)
+ : _M_t(__x._M_t) { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief %Set move constructor
+ * @param x A %set of identical element and allocator types.
+ *
+ * The newly-created %set contains the exact contents of @a x.
+ * The contents of @a x are a valid, but unspecified %set.
+ */
+ set(set&& __x)
+ : _M_t(std::forward<_Rep_type>(__x._M_t)) { }
+
+ /**
+ * @brief Builds a %set from an initializer_list.
+ * @param l An initializer_list.
+ * @param comp A comparison functor.
+ * @param a An allocator object.
+ *
+ * Create a %set consisting of copies of the elements in the list.
+ * This is linear in N if the list is already sorted, and NlogN
+ * otherwise (where N is @a l.size()).
+ */
+ set(initializer_list<value_type> __l,
+ const _Compare& __comp = _Compare(),
+ const allocator_type& __a = allocator_type())
+ : _M_t(__comp, __a)
+ { _M_t._M_insert_unique(__l.begin(), __l.end()); }
+#endif
+
+ /**
+ * @brief %Set assignment operator.
+ * @param x A %set of identical element and allocator types.
+ *
+ * All the elements of @a x are copied, but unlike the copy constructor,
+ * the allocator object is not copied.
+ */
+ set&
+ operator=(const set& __x)
+ {
+ _M_t = __x._M_t;
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief %Set move assignment operator.
+ * @param x A %set of identical element and allocator types.
+ *
+ * The contents of @a x are moved into this %set (without copying).
+ * @a x is a valid, but unspecified %set.
+ */
+ set&
+ operator=(set&& __x)
+ {
+ // NB: DR 675.
+ this->clear();
+ this->swap(__x);
+ return *this;
+ }
+
+ /**
+ * @brief %Set list assignment operator.
+ * @param l An initializer_list.
+ *
+ * This function fills a %set with copies of the elements in the
+ * initializer list @a l.
+ *
+ * Note that the assignment completely changes the %set and
+ * that the resulting %set's size is the same as the number
+ * of elements assigned. Old data may be lost.
+ */
+ set&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l.begin(), __l.end());
+ return *this;
+ }
+#endif
+
+ // accessors:
+
+ /// Returns the comparison object with which the %set was constructed.
+ key_compare
+ key_comp() const
+ { return _M_t.key_comp(); }
+ /// Returns the comparison object with which the %set was constructed.
+ value_compare
+ value_comp() const
+ { return _M_t.key_comp(); }
+ /// Returns the allocator object with which the %set was constructed.
+ allocator_type
+ get_allocator() const
+ { return _M_t.get_allocator(); }
+
+ /**
+ * Returns a read-only (constant) iterator that points to the first
+ * element in the %set. Iteration is done in ascending order according
+ * to the keys.
+ */
+ iterator
+ begin() const
+ { return _M_t.begin(); }
+
+ /**
+ * Returns a read-only (constant) iterator that points one past the last
+ * element in the %set. Iteration is done in ascending order according
+ * to the keys.
+ */
+ iterator
+ end() const
+ { return _M_t.end(); }
+
+ /**
+ * Returns a read-only (constant) iterator that points to the last
+ * element in the %set. Iteration is done in descending order according
+ * to the keys.
+ */
+ reverse_iterator
+ rbegin() const
+ { return _M_t.rbegin(); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to the
+ * last pair in the %set. Iteration is done in descending order
+ * according to the keys.
+ */
+ reverse_iterator
+ rend() const
+ { return _M_t.rend(); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * Returns a read-only (constant) iterator that points to the first
+ * element in the %set. Iteration is done in ascending order according
+ * to the keys.
+ */
+ iterator
+ cbegin() const
+ { return _M_t.begin(); }
+
+ /**
+ * Returns a read-only (constant) iterator that points one past the last
+ * element in the %set. Iteration is done in ascending order according
+ * to the keys.
+ */
+ iterator
+ cend() const
+ { return _M_t.end(); }
+
+ /**
+ * Returns a read-only (constant) iterator that points to the last
+ * element in the %set. Iteration is done in descending order according
+ * to the keys.
+ */
+ reverse_iterator
+ crbegin() const
+ { return _M_t.rbegin(); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to the
+ * last pair in the %set. Iteration is done in descending order
+ * according to the keys.
+ */
+ reverse_iterator
+ crend() const
+ { return _M_t.rend(); }
+#endif
+
+ /// Returns true if the %set is empty.
+ bool
+ empty() const
+ { return _M_t.empty(); }
+
+ /// Returns the size of the %set.
+ size_type
+ size() const
+ { return _M_t.size(); }
+
+ /// Returns the maximum size of the %set.
+ size_type
+ max_size() const
+ { return _M_t.max_size(); }
+
+ /**
+ * @brief Swaps data with another %set.
+ * @param x A %set of the same element and allocator types.
+ *
+ * This exchanges the elements between two sets in constant time.
+ * (It is only swapping a pointer, an integer, and an instance of
+ * the @c Compare type (which itself is often stateless and empty), so it
+ * should be quite fast.)
+ * Note that the global std::swap() function is specialized such that
+ * std::swap(s1,s2) will feed to this function.
+ */
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(set&& __x)
+#else
+ swap(set& __x)
+#endif
+ { _M_t.swap(__x._M_t); }
+
+ // insert/erase
+ /**
+ * @brief Attempts to insert an element into the %set.
+ * @param x Element to be inserted.
+ * @return A pair, of which the first element is an iterator that points
+ * to the possibly inserted element, and the second is a bool
+ * that is true if the element was actually inserted.
+ *
+ * This function attempts to insert an element into the %set. A %set
+ * relies on unique keys and thus an element is only inserted if it is
+ * not already present in the %set.
+ *
+ * Insertion requires logarithmic time.
+ */
+ std::pair<iterator, bool>
+ insert(const value_type& __x)
+ {
+ std::pair<typename _Rep_type::iterator, bool> __p =
+ _M_t._M_insert_unique(__x);
+ return std::pair<iterator, bool>(__p.first, __p.second);
+ }
+
+ /**
+ * @brief Attempts to insert an element into the %set.
+ * @param position An iterator that serves as a hint as to where the
+ * element should be inserted.
+ * @param x Element to be inserted.
+ * @return An iterator that points to the element with key of @a x (may
+ * or may not be the element passed in).
+ *
+ * This function is not concerned about whether the insertion took place,
+ * and thus does not return a boolean like the single-argument insert()
+ * does. Note that the first parameter is only a hint and can
+ * potentially improve the performance of the insertion process. A bad
+ * hint would cause no gains in efficiency.
+ *
+ * For more on "hinting", see:
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt07ch17.html
+ *
+ * Insertion requires logarithmic time (if the hint is not taken).
+ */
+ iterator
+ insert(iterator __position, const value_type& __x)
+ { return _M_t._M_insert_unique_(__position, __x); }
+
+ /**
+ * @brief A template function that attempts to insert a range
+ * of elements.
+ * @param first Iterator pointing to the start of the range to be
+ * inserted.
+ * @param last Iterator pointing to the end of the range.
+ *
+ * Complexity similar to that of the range constructor.
+ */
+ template<typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ { _M_t._M_insert_unique(__first, __last); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Attempts to insert a list of elements into the %set.
+ * @param list A std::initializer_list<value_type> of elements
+ * to be inserted.
+ *
+ * Complexity similar to that of the range constructor.
+ */
+ void
+ insert(initializer_list<value_type> __l)
+ { this->insert(__l.begin(), __l.end()); }
+#endif
+
+ /**
+ * @brief Erases an element from a %set.
+ * @param position An iterator pointing to the element to be erased.
+ *
+ * This function erases an element, pointed to by the given iterator,
+ * from a %set. Note that this function only erases the element, and
+ * that if the element is itself a pointer, the pointed-to memory is not
+ * touched in any way. Managing the pointer is the user's responsibility.
+ */
+ void
+ erase(iterator __position)
+ { _M_t.erase(__position); }
+
+ /**
+ * @brief Erases elements according to the provided key.
+ * @param x Key of element to be erased.
+ * @return The number of elements erased.
+ *
+ * This function erases all the elements located by the given key from
+ * a %set.
+ * Note that this function only erases the element, and that if
+ * the element is itself a pointer, the pointed-to memory is not touched
+ * in any way. Managing the pointer is the user's responsibility.
+ */
+ size_type
+ erase(const key_type& __x)
+ { return _M_t.erase(__x); }
+
+ /**
+ * @brief Erases a [first,last) range of elements from a %set.
+ * @param first Iterator pointing to the start of the range to be
+ * erased.
+ * @param last Iterator pointing to the end of the range to be erased.
+ *
+ * This function erases a sequence of elements from a %set.
+ * Note that this function only erases the element, and that if
+ * the element is itself a pointer, the pointed-to memory is not touched
+ * in any way. Managing the pointer is the user's responsibility.
+ */
+ void
+ erase(iterator __first, iterator __last)
+ { _M_t.erase(__first, __last); }
+
+ /**
+ * Erases all elements in a %set. Note that this function only erases
+ * the elements, and that if the elements themselves are pointers, the
+ * pointed-to memory is not touched in any way. Managing the pointer is
+ * the user's responsibility.
+ */
+ void
+ clear()
+ { _M_t.clear(); }
+
+ // set operations:
+
+ /**
+ * @brief Finds the number of elements.
+ * @param x Element to located.
+ * @return Number of elements with specified key.
+ *
+ * This function only makes sense for multisets; for set the result will
+ * either be 0 (not present) or 1 (present).
+ */
+ size_type
+ count(const key_type& __x) const
+ { return _M_t.find(__x) == _M_t.end() ? 0 : 1; }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 214. set::find() missing const overload
+ //@{
+ /**
+ * @brief Tries to locate an element in a %set.
+ * @param x Element to be located.
+ * @return Iterator pointing to sought-after element, or end() if not
+ * found.
+ *
+ * This function takes a key and tries to locate the element with which
+ * the key matches. If successful the function returns an iterator
+ * pointing to the sought after element. If unsuccessful it returns the
+ * past-the-end ( @c end() ) iterator.
+ */
+ iterator
+ find(const key_type& __x)
+ { return _M_t.find(__x); }
+
+ const_iterator
+ find(const key_type& __x) const
+ { return _M_t.find(__x); }
+ //@}
+
+ //@{
+ /**
+ * @brief Finds the beginning of a subsequence matching given key.
+ * @param x Key to be located.
+ * @return Iterator pointing to first element equal to or greater
+ * than key, or end().
+ *
+ * This function returns the first element of a subsequence of elements
+ * that matches the given key. If unsuccessful it returns an iterator
+ * pointing to the first element that has a greater value than given key
+ * or end() if no such element exists.
+ */
+ iterator
+ lower_bound(const key_type& __x)
+ { return _M_t.lower_bound(__x); }
+
+ const_iterator
+ lower_bound(const key_type& __x) const
+ { return _M_t.lower_bound(__x); }
+ //@}
+
+ //@{
+ /**
+ * @brief Finds the end of a subsequence matching given key.
+ * @param x Key to be located.
+ * @return Iterator pointing to the first element
+ * greater than key, or end().
+ */
+ iterator
+ upper_bound(const key_type& __x)
+ { return _M_t.upper_bound(__x); }
+
+ const_iterator
+ upper_bound(const key_type& __x) const
+ { return _M_t.upper_bound(__x); }
+ //@}
+
+ //@{
+ /**
+ * @brief Finds a subsequence matching given key.
+ * @param x Key to be located.
+ * @return Pair of iterators that possibly points to the subsequence
+ * matching given key.
+ *
+ * This function is equivalent to
+ * @code
+ * std::make_pair(c.lower_bound(val),
+ * c.upper_bound(val))
+ * @endcode
+ * (but is faster than making the calls separately).
+ *
+ * This function probably only makes sense for multisets.
+ */
+ std::pair<iterator, iterator>
+ equal_range(const key_type& __x)
+ { return _M_t.equal_range(__x); }
+
+ std::pair<const_iterator, const_iterator>
+ equal_range(const key_type& __x) const
+ { return _M_t.equal_range(__x); }
+ //@}
+
+ template<typename _K1, typename _C1, typename _A1>
+ friend bool
+ operator==(const set<_K1, _C1, _A1>&, const set<_K1, _C1, _A1>&);
+
+ template<typename _K1, typename _C1, typename _A1>
+ friend bool
+ operator<(const set<_K1, _C1, _A1>&, const set<_K1, _C1, _A1>&);
+ };
+
+
+ /**
+ * @brief Set equality comparison.
+ * @param x A %set.
+ * @param y A %set of the same type as @a x.
+ * @return True iff the size and elements of the sets are equal.
+ *
+ * This is an equivalence relation. It is linear in the size of the sets.
+ * Sets are considered equivalent if their sizes are equal, and if
+ * corresponding elements compare equal.
+ */
+ template<typename _Key, typename _Compare, typename _Alloc>
+ inline bool
+ operator==(const set<_Key, _Compare, _Alloc>& __x,
+ const set<_Key, _Compare, _Alloc>& __y)
+ { return __x._M_t == __y._M_t; }
+
+ /**
+ * @brief Set ordering relation.
+ * @param x A %set.
+ * @param y A %set of the same type as @a x.
+ * @return True iff @a x is lexicographically less than @a y.
+ *
+ * This is a total ordering relation. It is linear in the size of the
+ * maps. The elements must be comparable with @c <.
+ *
+ * See std::lexicographical_compare() for how the determination is made.
+ */
+ template<typename _Key, typename _Compare, typename _Alloc>
+ inline bool
+ operator<(const set<_Key, _Compare, _Alloc>& __x,
+ const set<_Key, _Compare, _Alloc>& __y)
+ { return __x._M_t < __y._M_t; }
+
+ /// Returns !(x == y).
+ template<typename _Key, typename _Compare, typename _Alloc>
+ inline bool
+ operator!=(const set<_Key, _Compare, _Alloc>& __x,
+ const set<_Key, _Compare, _Alloc>& __y)
+ { return !(__x == __y); }
+
+ /// Returns y < x.
+ template<typename _Key, typename _Compare, typename _Alloc>
+ inline bool
+ operator>(const set<_Key, _Compare, _Alloc>& __x,
+ const set<_Key, _Compare, _Alloc>& __y)
+ { return __y < __x; }
+
+ /// Returns !(y < x)
+ template<typename _Key, typename _Compare, typename _Alloc>
+ inline bool
+ operator<=(const set<_Key, _Compare, _Alloc>& __x,
+ const set<_Key, _Compare, _Alloc>& __y)
+ { return !(__y < __x); }
+
+ /// Returns !(x < y)
+ template<typename _Key, typename _Compare, typename _Alloc>
+ inline bool
+ operator>=(const set<_Key, _Compare, _Alloc>& __x,
+ const set<_Key, _Compare, _Alloc>& __y)
+ { return !(__x < __y); }
+
+ /// See std::set::swap().
+ template<typename _Key, typename _Compare, typename _Alloc>
+ inline void
+ swap(set<_Key, _Compare, _Alloc>& __x, set<_Key, _Compare, _Alloc>& __y)
+ { __x.swap(__y); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Key, typename _Compare, typename _Alloc>
+ inline void
+ swap(set<_Key, _Compare, _Alloc>&& __x, set<_Key, _Compare, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Key, typename _Compare, typename _Alloc>
+ inline void
+ swap(set<_Key, _Compare, _Alloc>& __x, set<_Key, _Compare, _Alloc>&& __y)
+ { __x.swap(__y); }
+#endif
+
+_GLIBCXX_END_NESTED_NAMESPACE
+
+#endif /* _STL_SET_H */
diff --git a/i686-linux/include/c++/4.4.3/bits/stl_stack.h b/i686-linux/include/c++/4.4.3/bits/stl_stack.h
new file mode 100644
index 0000000..da301d4
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/stl_stack.h
@@ -0,0 +1,299 @@
+// Stack implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_stack.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_STACK_H
+#define _STL_STACK_H 1
+
+#include <bits/concept_check.h>
+#include <debug/debug.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @brief A standard container giving FILO behavior.
+ *
+ * @ingroup sequences
+ *
+ * Meets many of the requirements of a
+ * <a href="tables.html#65">container</a>,
+ * but does not define anything to do with iterators. Very few of the
+ * other standard container interfaces are defined.
+ *
+ * This is not a true container, but an @e adaptor. It holds
+ * another container, and provides a wrapper interface to that
+ * container. The wrapper is what enforces strict
+ * first-in-last-out %stack behavior.
+ *
+ * The second template parameter defines the type of the underlying
+ * sequence/container. It defaults to std::deque, but it can be
+ * any type that supports @c back, @c push_back, and @c pop_front,
+ * such as std::list, std::vector, or an appropriate user-defined
+ * type.
+ *
+ * Members not found in "normal" containers are @c container_type,
+ * which is a typedef for the second Sequence parameter, and @c
+ * push, @c pop, and @c top, which are standard %stack/FILO
+ * operations.
+ */
+ template<typename _Tp, typename _Sequence = deque<_Tp> >
+ class stack
+ {
+ // concept requirements
+ typedef typename _Sequence::value_type _Sequence_value_type;
+ __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
+ __glibcxx_class_requires(_Sequence, _BackInsertionSequenceConcept)
+ __glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept)
+
+ template<typename _Tp1, typename _Seq1>
+ friend bool
+ operator==(const stack<_Tp1, _Seq1>&, const stack<_Tp1, _Seq1>&);
+
+ template<typename _Tp1, typename _Seq1>
+ friend bool
+ operator<(const stack<_Tp1, _Seq1>&, const stack<_Tp1, _Seq1>&);
+
+ public:
+ typedef typename _Sequence::value_type value_type;
+ typedef typename _Sequence::reference reference;
+ typedef typename _Sequence::const_reference const_reference;
+ typedef typename _Sequence::size_type size_type;
+ typedef _Sequence container_type;
+
+ protected:
+ // See queue::c for notes on this name.
+ _Sequence c;
+
+ public:
+ // XXX removed old def ctor, added def arg to this one to match 14882
+ /**
+ * @brief Default constructor creates no elements.
+ */
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+ explicit
+ stack(const _Sequence& __c = _Sequence())
+ : c(__c) { }
+#else
+ explicit
+ stack(const _Sequence& __c)
+ : c(__c) { }
+
+ explicit
+ stack(_Sequence&& __c = _Sequence())
+ : c(std::move(__c)) { }
+#endif
+
+ /**
+ * Returns true if the %stack is empty.
+ */
+ bool
+ empty() const
+ { return c.empty(); }
+
+ /** Returns the number of elements in the %stack. */
+ size_type
+ size() const
+ { return c.size(); }
+
+ /**
+ * Returns a read/write reference to the data at the first
+ * element of the %stack.
+ */
+ reference
+ top()
+ {
+ __glibcxx_requires_nonempty();
+ return c.back();
+ }
+
+ /**
+ * Returns a read-only (constant) reference to the data at the first
+ * element of the %stack.
+ */
+ const_reference
+ top() const
+ {
+ __glibcxx_requires_nonempty();
+ return c.back();
+ }
+
+ /**
+ * @brief Add data to the top of the %stack.
+ * @param x Data to be added.
+ *
+ * This is a typical %stack operation. The function creates an
+ * element at the top of the %stack and assigns the given data
+ * to it. The time complexity of the operation depends on the
+ * underlying sequence.
+ */
+ void
+ push(const value_type& __x)
+ { c.push_back(__x); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ push(value_type&& __x)
+ { c.push_back(std::move(__x)); }
+
+ template<typename... _Args>
+ void
+ emplace(_Args&&... __args)
+ { c.emplace_back(std::forward<_Args>(__args)...); }
+#endif
+
+ /**
+ * @brief Removes first element.
+ *
+ * This is a typical %stack operation. It shrinks the %stack
+ * by one. The time complexity of the operation depends on the
+ * underlying sequence.
+ *
+ * Note that no data is returned, and if the first element's
+ * data is needed, it should be retrieved before pop() is
+ * called.
+ */
+ void
+ pop()
+ {
+ __glibcxx_requires_nonempty();
+ c.pop_back();
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ swap(stack&& __s)
+ { c.swap(__s.c); }
+#endif
+ };
+
+ /**
+ * @brief Stack equality comparison.
+ * @param x A %stack.
+ * @param y A %stack of the same type as @a x.
+ * @return True iff the size and elements of the stacks are equal.
+ *
+ * This is an equivalence relation. Complexity and semantics
+ * depend on the underlying sequence type, but the expected rules
+ * are: this relation is linear in the size of the sequences, and
+ * stacks are considered equivalent if their sequences compare
+ * equal.
+ */
+ template<typename _Tp, typename _Seq>
+ inline bool
+ operator==(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y)
+ { return __x.c == __y.c; }
+
+ /**
+ * @brief Stack ordering relation.
+ * @param x A %stack.
+ * @param y A %stack of the same type as @a x.
+ * @return True iff @a x is lexicographically less than @a y.
+ *
+ * This is an total ordering relation. Complexity and semantics
+ * depend on the underlying sequence type, but the expected rules
+ * are: this relation is linear in the size of the sequences, the
+ * elements must be comparable with @c <, and
+ * std::lexicographical_compare() is usually used to make the
+ * determination.
+ */
+ template<typename _Tp, typename _Seq>
+ inline bool
+ operator<(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y)
+ { return __x.c < __y.c; }
+
+ /// Based on operator==
+ template<typename _Tp, typename _Seq>
+ inline bool
+ operator!=(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y)
+ { return !(__x == __y); }
+
+ /// Based on operator<
+ template<typename _Tp, typename _Seq>
+ inline bool
+ operator>(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y)
+ { return __y < __x; }
+
+ /// Based on operator<
+ template<typename _Tp, typename _Seq>
+ inline bool
+ operator<=(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y)
+ { return !(__y < __x); }
+
+ /// Based on operator<
+ template<typename _Tp, typename _Seq>
+ inline bool
+ operator>=(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y)
+ { return !(__x < __y); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp, typename _Seq>
+ inline void
+ swap(stack<_Tp, _Seq>& __x, stack<_Tp, _Seq>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Tp, typename _Seq>
+ inline void
+ swap(stack<_Tp, _Seq>&& __x, stack<_Tp, _Seq>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Tp, typename _Seq>
+ inline void
+ swap(stack<_Tp, _Seq>& __x, stack<_Tp, _Seq>&& __y)
+ { __x.swap(__y); }
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _STL_STACK_H */
diff --git a/i686-linux/include/c++/4.4.3/bits/stl_tempbuf.h b/i686-linux/include/c++/4.4.3/bits/stl_tempbuf.h
new file mode 100644
index 0000000..a3b0810
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/stl_tempbuf.h
@@ -0,0 +1,206 @@
+// Temporary buffer implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_tempbuf.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_TEMPBUF_H
+#define _STL_TEMPBUF_H 1
+
+#include <bits/stl_algobase.h>
+#include <bits/stl_construct.h>
+#include <bits/stl_uninitialized.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @brief Allocates a temporary buffer.
+ * @param len The number of objects of type Tp.
+ * @return See full description.
+ *
+ * Reinventing the wheel, but this time with prettier spokes!
+ *
+ * This function tries to obtain storage for @c len adjacent Tp
+ * objects. The objects themselves are not constructed, of course.
+ * A pair<> is returned containing "the buffer s address and
+ * capacity (in the units of sizeof(Tp)), or a pair of 0 values if
+ * no storage can be obtained." Note that the capacity obtained
+ * may be less than that requested if the memory is unavailable;
+ * you should compare len with the .second return value.
+ *
+ * Provides the nothrow exception guarantee.
+ */
+ template<typename _Tp>
+ pair<_Tp*, ptrdiff_t>
+ get_temporary_buffer(ptrdiff_t __len)
+ {
+ const ptrdiff_t __max =
+ __gnu_cxx::__numeric_traits<ptrdiff_t>::__max / sizeof(_Tp);
+ if (__len > __max)
+ __len = __max;
+
+ while (__len > 0)
+ {
+ _Tp* __tmp = static_cast<_Tp*>(::operator new(__len * sizeof(_Tp),
+ std::nothrow));
+ if (__tmp != 0)
+ return std::pair<_Tp*, ptrdiff_t>(__tmp, __len);
+ __len /= 2;
+ }
+ return std::pair<_Tp*, ptrdiff_t>(static_cast<_Tp*>(0), 0);
+ }
+
+ /**
+ * @brief The companion to get_temporary_buffer().
+ * @param p A buffer previously allocated by get_temporary_buffer.
+ * @return None.
+ *
+ * Frees the memory pointed to by p.
+ */
+ template<typename _Tp>
+ inline void
+ return_temporary_buffer(_Tp* __p)
+ { ::operator delete(__p, std::nothrow); }
+
+
+ /**
+ * This class is used in two places: stl_algo.h and ext/memory,
+ * where it is wrapped as the temporary_buffer class. See
+ * temporary_buffer docs for more notes.
+ */
+ template<typename _ForwardIterator, typename _Tp>
+ class _Temporary_buffer
+ {
+ // concept requirements
+ __glibcxx_class_requires(_ForwardIterator, _ForwardIteratorConcept)
+
+ public:
+ typedef _Tp value_type;
+ typedef value_type* pointer;
+ typedef pointer iterator;
+ typedef ptrdiff_t size_type;
+
+ protected:
+ size_type _M_original_len;
+ size_type _M_len;
+ pointer _M_buffer;
+
+ public:
+ /// As per Table mumble.
+ size_type
+ size() const
+ { return _M_len; }
+
+ /// Returns the size requested by the constructor; may be >size().
+ size_type
+ requested_size() const
+ { return _M_original_len; }
+
+ /// As per Table mumble.
+ iterator
+ begin()
+ { return _M_buffer; }
+
+ /// As per Table mumble.
+ iterator
+ end()
+ { return _M_buffer + _M_len; }
+
+ /**
+ * Constructs a temporary buffer of a size somewhere between
+ * zero and the size of the given range.
+ */
+ _Temporary_buffer(_ForwardIterator __first, _ForwardIterator __last);
+
+ ~_Temporary_buffer()
+ {
+ std::_Destroy(_M_buffer, _M_buffer + _M_len);
+ std::return_temporary_buffer(_M_buffer);
+ }
+
+ private:
+ // Disable copy constructor and assignment operator.
+ _Temporary_buffer(const _Temporary_buffer&);
+
+ void
+ operator=(const _Temporary_buffer&);
+ };
+
+ template<typename _ForwardIterator, typename _Tp>
+ _Temporary_buffer<_ForwardIterator, _Tp>::
+ _Temporary_buffer(_ForwardIterator __first, _ForwardIterator __last)
+ : _M_original_len(std::distance(__first, __last)),
+ _M_len(0), _M_buffer(0)
+ {
+ __try
+ {
+ std::pair<pointer, size_type> __p(std::get_temporary_buffer<
+ value_type>(_M_original_len));
+ _M_buffer = __p.first;
+ _M_len = __p.second;
+ if (!__is_pod(_Tp) && _M_len > 0)
+ std::uninitialized_fill_n(_M_buffer, _M_len, *__first);
+ }
+ __catch(...)
+ {
+ std::return_temporary_buffer(_M_buffer);
+ _M_buffer = 0;
+ _M_len = 0;
+ __throw_exception_again;
+ }
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _STL_TEMPBUF_H */
+
diff --git a/i686-linux/include/c++/4.4.3/bits/stl_tree.h b/i686-linux/include/c++/4.4.3/bits/stl_tree.h
new file mode 100644
index 0000000..e2cc151
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/stl_tree.h
@@ -0,0 +1,1535 @@
+// RB tree implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ */
+
+/** @file stl_tree.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_TREE_H
+#define _STL_TREE_H 1
+
+#include <bits/stl_algobase.h>
+#include <bits/allocator.h>
+#include <bits/stl_function.h>
+#include <bits/cpp_type_traits.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // Red-black tree class, designed for use in implementing STL
+ // associative containers (set, multiset, map, and multimap). The
+ // insertion and deletion algorithms are based on those in Cormen,
+ // Leiserson, and Rivest, Introduction to Algorithms (MIT Press,
+ // 1990), except that
+ //
+ // (1) the header cell is maintained with links not only to the root
+ // but also to the leftmost node of the tree, to enable constant
+ // time begin(), and to the rightmost node of the tree, to enable
+ // linear time performance when used with the generic set algorithms
+ // (set_union, etc.)
+ //
+ // (2) when a node being deleted has two children its successor node
+ // is relinked into its place, rather than copied, so that the only
+ // iterators invalidated are those referring to the deleted node.
+
+ enum _Rb_tree_color { _S_red = false, _S_black = true };
+
+ struct _Rb_tree_node_base
+ {
+ typedef _Rb_tree_node_base* _Base_ptr;
+ typedef const _Rb_tree_node_base* _Const_Base_ptr;
+
+ _Rb_tree_color _M_color;
+ _Base_ptr _M_parent;
+ _Base_ptr _M_left;
+ _Base_ptr _M_right;
+
+ static _Base_ptr
+ _S_minimum(_Base_ptr __x)
+ {
+ while (__x->_M_left != 0) __x = __x->_M_left;
+ return __x;
+ }
+
+ static _Const_Base_ptr
+ _S_minimum(_Const_Base_ptr __x)
+ {
+ while (__x->_M_left != 0) __x = __x->_M_left;
+ return __x;
+ }
+
+ static _Base_ptr
+ _S_maximum(_Base_ptr __x)
+ {
+ while (__x->_M_right != 0) __x = __x->_M_right;
+ return __x;
+ }
+
+ static _Const_Base_ptr
+ _S_maximum(_Const_Base_ptr __x)
+ {
+ while (__x->_M_right != 0) __x = __x->_M_right;
+ return __x;
+ }
+ };
+
+ template<typename _Val>
+ struct _Rb_tree_node : public _Rb_tree_node_base
+ {
+ typedef _Rb_tree_node<_Val>* _Link_type;
+ _Val _M_value_field;
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename... _Args>
+ _Rb_tree_node(_Args&&... __args)
+ : _Rb_tree_node_base(),
+ _M_value_field(std::forward<_Args>(__args)...) { }
+#endif
+ };
+
+ _Rb_tree_node_base*
+ _Rb_tree_increment(_Rb_tree_node_base* __x);
+
+ const _Rb_tree_node_base*
+ _Rb_tree_increment(const _Rb_tree_node_base* __x);
+
+ _Rb_tree_node_base*
+ _Rb_tree_decrement(_Rb_tree_node_base* __x);
+
+ const _Rb_tree_node_base*
+ _Rb_tree_decrement(const _Rb_tree_node_base* __x);
+
+ template<typename _Tp>
+ struct _Rb_tree_iterator
+ {
+ typedef _Tp value_type;
+ typedef _Tp& reference;
+ typedef _Tp* pointer;
+
+ typedef bidirectional_iterator_tag iterator_category;
+ typedef ptrdiff_t difference_type;
+
+ typedef _Rb_tree_iterator<_Tp> _Self;
+ typedef _Rb_tree_node_base::_Base_ptr _Base_ptr;
+ typedef _Rb_tree_node<_Tp>* _Link_type;
+
+ _Rb_tree_iterator()
+ : _M_node() { }
+
+ explicit
+ _Rb_tree_iterator(_Link_type __x)
+ : _M_node(__x) { }
+
+ reference
+ operator*() const
+ { return static_cast<_Link_type>(_M_node)->_M_value_field; }
+
+ pointer
+ operator->() const
+ { return &static_cast<_Link_type>(_M_node)->_M_value_field; }
+
+ _Self&
+ operator++()
+ {
+ _M_node = _Rb_tree_increment(_M_node);
+ return *this;
+ }
+
+ _Self
+ operator++(int)
+ {
+ _Self __tmp = *this;
+ _M_node = _Rb_tree_increment(_M_node);
+ return __tmp;
+ }
+
+ _Self&
+ operator--()
+ {
+ _M_node = _Rb_tree_decrement(_M_node);
+ return *this;
+ }
+
+ _Self
+ operator--(int)
+ {
+ _Self __tmp = *this;
+ _M_node = _Rb_tree_decrement(_M_node);
+ return __tmp;
+ }
+
+ bool
+ operator==(const _Self& __x) const
+ { return _M_node == __x._M_node; }
+
+ bool
+ operator!=(const _Self& __x) const
+ { return _M_node != __x._M_node; }
+
+ _Base_ptr _M_node;
+ };
+
+ template<typename _Tp>
+ struct _Rb_tree_const_iterator
+ {
+ typedef _Tp value_type;
+ typedef const _Tp& reference;
+ typedef const _Tp* pointer;
+
+ typedef _Rb_tree_iterator<_Tp> iterator;
+
+ typedef bidirectional_iterator_tag iterator_category;
+ typedef ptrdiff_t difference_type;
+
+ typedef _Rb_tree_const_iterator<_Tp> _Self;
+ typedef _Rb_tree_node_base::_Const_Base_ptr _Base_ptr;
+ typedef const _Rb_tree_node<_Tp>* _Link_type;
+
+ _Rb_tree_const_iterator()
+ : _M_node() { }
+
+ explicit
+ _Rb_tree_const_iterator(_Link_type __x)
+ : _M_node(__x) { }
+
+ _Rb_tree_const_iterator(const iterator& __it)
+ : _M_node(__it._M_node) { }
+
+ reference
+ operator*() const
+ { return static_cast<_Link_type>(_M_node)->_M_value_field; }
+
+ pointer
+ operator->() const
+ { return &static_cast<_Link_type>(_M_node)->_M_value_field; }
+
+ _Self&
+ operator++()
+ {
+ _M_node = _Rb_tree_increment(_M_node);
+ return *this;
+ }
+
+ _Self
+ operator++(int)
+ {
+ _Self __tmp = *this;
+ _M_node = _Rb_tree_increment(_M_node);
+ return __tmp;
+ }
+
+ _Self&
+ operator--()
+ {
+ _M_node = _Rb_tree_decrement(_M_node);
+ return *this;
+ }
+
+ _Self
+ operator--(int)
+ {
+ _Self __tmp = *this;
+ _M_node = _Rb_tree_decrement(_M_node);
+ return __tmp;
+ }
+
+ bool
+ operator==(const _Self& __x) const
+ { return _M_node == __x._M_node; }
+
+ bool
+ operator!=(const _Self& __x) const
+ { return _M_node != __x._M_node; }
+
+ _Base_ptr _M_node;
+ };
+
+ template<typename _Val>
+ inline bool
+ operator==(const _Rb_tree_iterator<_Val>& __x,
+ const _Rb_tree_const_iterator<_Val>& __y)
+ { return __x._M_node == __y._M_node; }
+
+ template<typename _Val>
+ inline bool
+ operator!=(const _Rb_tree_iterator<_Val>& __x,
+ const _Rb_tree_const_iterator<_Val>& __y)
+ { return __x._M_node != __y._M_node; }
+
+ void
+ _Rb_tree_insert_and_rebalance(const bool __insert_left,
+ _Rb_tree_node_base* __x,
+ _Rb_tree_node_base* __p,
+ _Rb_tree_node_base& __header);
+
+ _Rb_tree_node_base*
+ _Rb_tree_rebalance_for_erase(_Rb_tree_node_base* const __z,
+ _Rb_tree_node_base& __header);
+
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc = allocator<_Val> >
+ class _Rb_tree
+ {
+ typedef typename _Alloc::template rebind<_Rb_tree_node<_Val> >::other
+ _Node_allocator;
+
+ protected:
+ typedef _Rb_tree_node_base* _Base_ptr;
+ typedef const _Rb_tree_node_base* _Const_Base_ptr;
+
+ public:
+ typedef _Key key_type;
+ typedef _Val value_type;
+ typedef value_type* pointer;
+ typedef const value_type* const_pointer;
+ typedef value_type& reference;
+ typedef const value_type& const_reference;
+ typedef _Rb_tree_node<_Val>* _Link_type;
+ typedef const _Rb_tree_node<_Val>* _Const_Link_type;
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Alloc allocator_type;
+
+ _Node_allocator&
+ _M_get_Node_allocator()
+ { return *static_cast<_Node_allocator*>(&this->_M_impl); }
+
+ const _Node_allocator&
+ _M_get_Node_allocator() const
+ { return *static_cast<const _Node_allocator*>(&this->_M_impl); }
+
+ allocator_type
+ get_allocator() const
+ { return allocator_type(_M_get_Node_allocator()); }
+
+ protected:
+ _Link_type
+ _M_get_node()
+ { return _M_impl._Node_allocator::allocate(1); }
+
+ void
+ _M_put_node(_Link_type __p)
+ { _M_impl._Node_allocator::deallocate(__p, 1); }
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+ _Link_type
+ _M_create_node(const value_type& __x)
+ {
+ _Link_type __tmp = _M_get_node();
+ __try
+ { get_allocator().construct(&__tmp->_M_value_field, __x); }
+ __catch(...)
+ {
+ _M_put_node(__tmp);
+ __throw_exception_again;
+ }
+ return __tmp;
+ }
+
+ void
+ _M_destroy_node(_Link_type __p)
+ {
+ get_allocator().destroy(&__p->_M_value_field);
+ _M_put_node(__p);
+ }
+#else
+ template<typename... _Args>
+ _Link_type
+ _M_create_node(_Args&&... __args)
+ {
+ _Link_type __tmp = _M_get_node();
+ __try
+ {
+ _M_get_Node_allocator().construct(__tmp,
+ std::forward<_Args>(__args)...);
+ }
+ __catch(...)
+ {
+ _M_put_node(__tmp);
+ __throw_exception_again;
+ }
+ return __tmp;
+ }
+
+ void
+ _M_destroy_node(_Link_type __p)
+ {
+ _M_get_Node_allocator().destroy(__p);
+ _M_put_node(__p);
+ }
+#endif
+
+ _Link_type
+ _M_clone_node(_Const_Link_type __x)
+ {
+ _Link_type __tmp = _M_create_node(__x->_M_value_field);
+ __tmp->_M_color = __x->_M_color;
+ __tmp->_M_left = 0;
+ __tmp->_M_right = 0;
+ return __tmp;
+ }
+
+ protected:
+ template<typename _Key_compare,
+ bool _Is_pod_comparator = __is_pod(_Key_compare)>
+ struct _Rb_tree_impl : public _Node_allocator
+ {
+ _Key_compare _M_key_compare;
+ _Rb_tree_node_base _M_header;
+ size_type _M_node_count; // Keeps track of size of tree.
+
+ _Rb_tree_impl()
+ : _Node_allocator(), _M_key_compare(), _M_header(),
+ _M_node_count(0)
+ { _M_initialize(); }
+
+ _Rb_tree_impl(const _Key_compare& __comp, const _Node_allocator& __a)
+ : _Node_allocator(__a), _M_key_compare(__comp), _M_header(),
+ _M_node_count(0)
+ { _M_initialize(); }
+
+ private:
+ void
+ _M_initialize()
+ {
+ this->_M_header._M_color = _S_red;
+ this->_M_header._M_parent = 0;
+ this->_M_header._M_left = &this->_M_header;
+ this->_M_header._M_right = &this->_M_header;
+ }
+ };
+
+ // Local modification: if __google_stl_debug_rbtree is defined to
+ // non-zero value, check sort predicate for strict weak ordering.
+ // See http://b/1731200.
+#if __google_stl_debug_rbtree
+ template<typename _KeyCompare>
+ struct _CheckedCompare {
+ _KeyCompare _M_key_compare;
+
+ _CheckedCompare(): _M_key_compare() { }
+ _CheckedCompare(const _KeyCompare & __comp): _M_key_compare(__comp) { }
+
+ // Template arg required to avoid duplicating code in the two op()
+ // operators below. User-provided _M_key_compare may not be const,
+ // but needs to be callable from our const op().
+ // See http://b/1731200 for details.
+ template <typename _KeyCompareT>
+ static bool _M_compare_with(_KeyCompareT& __comp, const _Key& __x, const _Key& __y) {
+ if (__comp(__x, __x))
+ __throw_runtime_error("strict weak ordering: (__x LT __x) != false");
+ if (__comp(__y, __y))
+ __throw_runtime_error("strict weak ordering: (__y LT __y) != false");
+ bool lt = __comp(__x, __y);
+ if (lt && __comp(__y, __x))
+ __throw_runtime_error("strict weak ordering: ((__x LT __y) && (__y LT __x)) != false");
+ return lt;
+ }
+ bool operator()(const _Key& __x, const _Key& __y) const {
+ return _M_compare_with(_M_key_compare, __x, __y);
+ }
+
+ bool operator()(const _Key& __x, const _Key& __y) {
+ return _M_compare_with(_M_key_compare, __x, __y);
+ }
+
+ operator _KeyCompare() const { return _M_key_compare; }
+ };
+
+ _Rb_tree_impl<_CheckedCompare<_Compare> > _M_impl;
+#else
+ _Rb_tree_impl<_Compare> _M_impl;
+#endif
+
+ protected:
+ _Base_ptr&
+ _M_root()
+ { return this->_M_impl._M_header._M_parent; }
+
+ _Const_Base_ptr
+ _M_root() const
+ { return this->_M_impl._M_header._M_parent; }
+
+ _Base_ptr&
+ _M_leftmost()
+ { return this->_M_impl._M_header._M_left; }
+
+ _Const_Base_ptr
+ _M_leftmost() const
+ { return this->_M_impl._M_header._M_left; }
+
+ _Base_ptr&
+ _M_rightmost()
+ { return this->_M_impl._M_header._M_right; }
+
+ _Const_Base_ptr
+ _M_rightmost() const
+ { return this->_M_impl._M_header._M_right; }
+
+ _Link_type
+ _M_begin()
+ { return static_cast<_Link_type>(this->_M_impl._M_header._M_parent); }
+
+ _Const_Link_type
+ _M_begin() const
+ {
+ return static_cast<_Const_Link_type>
+ (this->_M_impl._M_header._M_parent);
+ }
+
+ _Link_type
+ _M_end()
+ { return static_cast<_Link_type>(&this->_M_impl._M_header); }
+
+ _Const_Link_type
+ _M_end() const
+ { return static_cast<_Const_Link_type>(&this->_M_impl._M_header); }
+
+ static const_reference
+ _S_value(_Const_Link_type __x)
+ { return __x->_M_value_field; }
+
+ static const _Key&
+ _S_key(_Const_Link_type __x)
+ { return _KeyOfValue()(_S_value(__x)); }
+
+ static _Link_type
+ _S_left(_Base_ptr __x)
+ { return static_cast<_Link_type>(__x->_M_left); }
+
+ static _Const_Link_type
+ _S_left(_Const_Base_ptr __x)
+ { return static_cast<_Const_Link_type>(__x->_M_left); }
+
+ static _Link_type
+ _S_right(_Base_ptr __x)
+ { return static_cast<_Link_type>(__x->_M_right); }
+
+ static _Const_Link_type
+ _S_right(_Const_Base_ptr __x)
+ { return static_cast<_Const_Link_type>(__x->_M_right); }
+
+ static const_reference
+ _S_value(_Const_Base_ptr __x)
+ { return static_cast<_Const_Link_type>(__x)->_M_value_field; }
+
+ static const _Key&
+ _S_key(_Const_Base_ptr __x)
+ { return _KeyOfValue()(_S_value(__x)); }
+
+ static _Base_ptr
+ _S_minimum(_Base_ptr __x)
+ { return _Rb_tree_node_base::_S_minimum(__x); }
+
+ static _Const_Base_ptr
+ _S_minimum(_Const_Base_ptr __x)
+ { return _Rb_tree_node_base::_S_minimum(__x); }
+
+ static _Base_ptr
+ _S_maximum(_Base_ptr __x)
+ { return _Rb_tree_node_base::_S_maximum(__x); }
+
+ static _Const_Base_ptr
+ _S_maximum(_Const_Base_ptr __x)
+ { return _Rb_tree_node_base::_S_maximum(__x); }
+
+ public:
+ typedef _Rb_tree_iterator<value_type> iterator;
+ typedef _Rb_tree_const_iterator<value_type> const_iterator;
+
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+
+ private:
+ iterator
+ _M_insert_(_Const_Base_ptr __x, _Const_Base_ptr __y,
+ const value_type& __v);
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 233. Insertion hints in associative containers.
+ iterator
+ _M_insert_lower(_Base_ptr __x, _Base_ptr __y, const value_type& __v);
+
+ iterator
+ _M_insert_equal_lower(const value_type& __x);
+
+ _Link_type
+ _M_copy(_Const_Link_type __x, _Link_type __p);
+
+ void
+ _M_erase(_Link_type __x);
+
+ iterator
+ _M_lower_bound(_Link_type __x, _Link_type __y,
+ const _Key& __k);
+
+ const_iterator
+ _M_lower_bound(_Const_Link_type __x, _Const_Link_type __y,
+ const _Key& __k) const;
+
+ iterator
+ _M_upper_bound(_Link_type __x, _Link_type __y,
+ const _Key& __k);
+
+ const_iterator
+ _M_upper_bound(_Const_Link_type __x, _Const_Link_type __y,
+ const _Key& __k) const;
+
+ public:
+ // allocation/deallocation
+ _Rb_tree() { }
+
+ _Rb_tree(const _Compare& __comp,
+ const allocator_type& __a = allocator_type())
+ : _M_impl(__comp, __a) { }
+
+ _Rb_tree(const _Rb_tree& __x)
+ : _M_impl(__x._M_impl._M_key_compare, __x._M_get_Node_allocator())
+ {
+ if (__x._M_root() != 0)
+ {
+ _M_root() = _M_copy(__x._M_begin(), _M_end());
+ _M_leftmost() = _S_minimum(_M_root());
+ _M_rightmost() = _S_maximum(_M_root());
+ _M_impl._M_node_count = __x._M_impl._M_node_count;
+ }
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ _Rb_tree(_Rb_tree&& __x);
+#endif
+
+ ~_Rb_tree()
+ { _M_erase(_M_begin()); }
+
+ _Rb_tree&
+ operator=(const _Rb_tree& __x);
+
+ // Accessors.
+ _Compare
+ key_comp() const
+ { return _M_impl._M_key_compare; }
+
+ iterator
+ begin()
+ {
+ return iterator(static_cast<_Link_type>
+ (this->_M_impl._M_header._M_left));
+ }
+
+ const_iterator
+ begin() const
+ {
+ return const_iterator(static_cast<_Const_Link_type>
+ (this->_M_impl._M_header._M_left));
+ }
+
+ iterator
+ end()
+ { return iterator(static_cast<_Link_type>(&this->_M_impl._M_header)); }
+
+ const_iterator
+ end() const
+ {
+ return const_iterator(static_cast<_Const_Link_type>
+ (&this->_M_impl._M_header));
+ }
+
+ reverse_iterator
+ rbegin()
+ { return reverse_iterator(end()); }
+
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(end()); }
+
+ reverse_iterator
+ rend()
+ { return reverse_iterator(begin()); }
+
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(begin()); }
+
+ bool
+ empty() const
+ { return _M_impl._M_node_count == 0; }
+
+ size_type
+ size() const
+ { return _M_impl._M_node_count; }
+
+ size_type
+ max_size() const
+ { return _M_get_Node_allocator().max_size(); }
+
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(_Rb_tree&& __t);
+#else
+ swap(_Rb_tree& __t);
+#endif
+
+ // Insert/erase.
+ pair<iterator, bool>
+ _M_insert_unique(const value_type& __x);
+
+ iterator
+ _M_insert_equal(const value_type& __x);
+
+ iterator
+ _M_insert_unique_(const_iterator __position, const value_type& __x);
+
+ iterator
+ _M_insert_equal_(const_iterator __position, const value_type& __x);
+
+ template<typename _InputIterator>
+ void
+ _M_insert_unique(_InputIterator __first, _InputIterator __last);
+
+ template<typename _InputIterator>
+ void
+ _M_insert_equal(_InputIterator __first, _InputIterator __last);
+
+ void
+ erase(iterator __position);
+
+ void
+ erase(const_iterator __position);
+
+ size_type
+ erase(const key_type& __x);
+
+ void
+ erase(iterator __first, iterator __last);
+
+ void
+ erase(const_iterator __first, const_iterator __last);
+
+ void
+ erase(const key_type* __first, const key_type* __last);
+
+ void
+ clear()
+ {
+ _M_erase(_M_begin());
+ _M_leftmost() = _M_end();
+ _M_root() = 0;
+ _M_rightmost() = _M_end();
+ _M_impl._M_node_count = 0;
+ }
+
+ // Set operations.
+ iterator
+ find(const key_type& __k);
+
+ const_iterator
+ find(const key_type& __k) const;
+
+ size_type
+ count(const key_type& __k) const;
+
+ iterator
+ lower_bound(const key_type& __k)
+ { return _M_lower_bound(_M_begin(), _M_end(), __k); }
+
+ const_iterator
+ lower_bound(const key_type& __k) const
+ { return _M_lower_bound(_M_begin(), _M_end(), __k); }
+
+ iterator
+ upper_bound(const key_type& __k)
+ { return _M_upper_bound(_M_begin(), _M_end(), __k); }
+
+ const_iterator
+ upper_bound(const key_type& __k) const
+ { return _M_upper_bound(_M_begin(), _M_end(), __k); }
+
+ pair<iterator, iterator>
+ equal_range(const key_type& __k);
+
+ pair<const_iterator, const_iterator>
+ equal_range(const key_type& __k) const;
+
+ // Debugging.
+ bool
+ __rb_verify() const;
+ };
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ inline bool
+ operator==(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
+ const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
+ {
+ return __x.size() == __y.size()
+ && std::equal(__x.begin(), __x.end(), __y.begin());
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ inline bool
+ operator<(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
+ const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
+ {
+ return std::lexicographical_compare(__x.begin(), __x.end(),
+ __y.begin(), __y.end());
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ inline bool
+ operator!=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
+ const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
+ { return !(__x == __y); }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ inline bool
+ operator>(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
+ const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
+ { return __y < __x; }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ inline bool
+ operator<=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
+ const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
+ { return !(__y < __x); }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ inline bool
+ operator>=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
+ const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
+ { return !(__x < __y); }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ inline void
+ swap(_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
+ { __x.swap(__y); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _Rb_tree(_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&& __x)
+ : _M_impl(__x._M_impl._M_key_compare, __x._M_get_Node_allocator())
+ {
+ if (__x._M_root() != 0)
+ {
+ _M_root() = __x._M_root();
+ _M_leftmost() = __x._M_leftmost();
+ _M_rightmost() = __x._M_rightmost();
+ _M_root()->_M_parent = _M_end();
+
+ __x._M_root() = 0;
+ __x._M_leftmost() = __x._M_end();
+ __x._M_rightmost() = __x._M_end();
+
+ this->_M_impl._M_node_count = __x._M_impl._M_node_count;
+ __x._M_impl._M_node_count = 0;
+ }
+ }
+#endif
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ operator=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x)
+ {
+ if (this != &__x)
+ {
+ // Note that _Key may be a constant type.
+ clear();
+ _M_impl._M_key_compare = __x._M_impl._M_key_compare;
+ if (__x._M_root() != 0)
+ {
+ _M_root() = _M_copy(__x._M_begin(), _M_end());
+ _M_leftmost() = _S_minimum(_M_root());
+ _M_rightmost() = _S_maximum(_M_root());
+ _M_impl._M_node_count = __x._M_impl._M_node_count;
+ }
+ }
+ return *this;
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_insert_(_Const_Base_ptr __x, _Const_Base_ptr __p, const _Val& __v)
+ {
+ bool __insert_left = (__x != 0 || __p == _M_end()
+ || _M_impl._M_key_compare(_KeyOfValue()(__v),
+ _S_key(__p)));
+
+ _Link_type __z = _M_create_node(__v);
+
+ _Rb_tree_insert_and_rebalance(__insert_left, __z,
+ const_cast<_Base_ptr>(__p),
+ this->_M_impl._M_header);
+ ++_M_impl._M_node_count;
+ return iterator(__z);
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_insert_lower(_Base_ptr __x, _Base_ptr __p, const _Val& __v)
+ {
+ bool __insert_left = (__x != 0 || __p == _M_end()
+ || !_M_impl._M_key_compare(_S_key(__p),
+ _KeyOfValue()(__v)));
+
+ _Link_type __z = _M_create_node(__v);
+
+ _Rb_tree_insert_and_rebalance(__insert_left, __z, __p,
+ this->_M_impl._M_header);
+ ++_M_impl._M_node_count;
+ return iterator(__z);
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_insert_equal_lower(const _Val& __v)
+ {
+ _Link_type __x = _M_begin();
+ _Link_type __y = _M_end();
+ while (__x != 0)
+ {
+ __y = __x;
+ __x = !_M_impl._M_key_compare(_S_key(__x), _KeyOfValue()(__v)) ?
+ _S_left(__x) : _S_right(__x);
+ }
+ return _M_insert_lower(__x, __y, __v);
+ }
+
+ template<typename _Key, typename _Val, typename _KoV,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KoV, _Compare, _Alloc>::_Link_type
+ _Rb_tree<_Key, _Val, _KoV, _Compare, _Alloc>::
+ _M_copy(_Const_Link_type __x, _Link_type __p)
+ {
+ // Structural copy. __x and __p must be non-null.
+ _Link_type __top = _M_clone_node(__x);
+ __top->_M_parent = __p;
+
+ __try
+ {
+ if (__x->_M_right)
+ __top->_M_right = _M_copy(_S_right(__x), __top);
+ __p = __top;
+ __x = _S_left(__x);
+
+ while (__x != 0)
+ {
+ _Link_type __y = _M_clone_node(__x);
+ __p->_M_left = __y;
+ __y->_M_parent = __p;
+ if (__x->_M_right)
+ __y->_M_right = _M_copy(_S_right(__x), __y);
+ __p = __y;
+ __x = _S_left(__x);
+ }
+ }
+ __catch(...)
+ {
+ _M_erase(__top);
+ __throw_exception_again;
+ }
+ return __top;
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ void
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_erase(_Link_type __x)
+ {
+ // Erase without rebalancing.
+ while (__x != 0)
+ {
+ _M_erase(_S_right(__x));
+ _Link_type __y = _S_left(__x);
+ _M_destroy_node(__x);
+ __x = __y;
+ }
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue,
+ _Compare, _Alloc>::iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_lower_bound(_Link_type __x, _Link_type __y,
+ const _Key& __k)
+ {
+ while (__x != 0)
+ if (!_M_impl._M_key_compare(_S_key(__x), __k))
+ __y = __x, __x = _S_left(__x);
+ else
+ __x = _S_right(__x);
+ return iterator(__y);
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue,
+ _Compare, _Alloc>::const_iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_lower_bound(_Const_Link_type __x, _Const_Link_type __y,
+ const _Key& __k) const
+ {
+ while (__x != 0)
+ if (!_M_impl._M_key_compare(_S_key(__x), __k))
+ __y = __x, __x = _S_left(__x);
+ else
+ __x = _S_right(__x);
+ return const_iterator(__y);
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue,
+ _Compare, _Alloc>::iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_upper_bound(_Link_type __x, _Link_type __y,
+ const _Key& __k)
+ {
+ while (__x != 0)
+ if (_M_impl._M_key_compare(__k, _S_key(__x)))
+ __y = __x, __x = _S_left(__x);
+ else
+ __x = _S_right(__x);
+ return iterator(__y);
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue,
+ _Compare, _Alloc>::const_iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_upper_bound(_Const_Link_type __x, _Const_Link_type __y,
+ const _Key& __k) const
+ {
+ while (__x != 0)
+ if (_M_impl._M_key_compare(__k, _S_key(__x)))
+ __y = __x, __x = _S_left(__x);
+ else
+ __x = _S_right(__x);
+ return const_iterator(__y);
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ pair<typename _Rb_tree<_Key, _Val, _KeyOfValue,
+ _Compare, _Alloc>::iterator,
+ typename _Rb_tree<_Key, _Val, _KeyOfValue,
+ _Compare, _Alloc>::iterator>
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ equal_range(const _Key& __k)
+ {
+ _Link_type __x = _M_begin();
+ _Link_type __y = _M_end();
+ while (__x != 0)
+ {
+ if (_M_impl._M_key_compare(_S_key(__x), __k))
+ __x = _S_right(__x);
+ else if (_M_impl._M_key_compare(__k, _S_key(__x)))
+ __y = __x, __x = _S_left(__x);
+ else
+ {
+ _Link_type __xu(__x), __yu(__y);
+ __y = __x, __x = _S_left(__x);
+ __xu = _S_right(__xu);
+ return pair<iterator,
+ iterator>(_M_lower_bound(__x, __y, __k),
+ _M_upper_bound(__xu, __yu, __k));
+ }
+ }
+ return pair<iterator, iterator>(iterator(__y),
+ iterator(__y));
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ pair<typename _Rb_tree<_Key, _Val, _KeyOfValue,
+ _Compare, _Alloc>::const_iterator,
+ typename _Rb_tree<_Key, _Val, _KeyOfValue,
+ _Compare, _Alloc>::const_iterator>
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ equal_range(const _Key& __k) const
+ {
+ _Const_Link_type __x = _M_begin();
+ _Const_Link_type __y = _M_end();
+ while (__x != 0)
+ {
+ if (_M_impl._M_key_compare(_S_key(__x), __k))
+ __x = _S_right(__x);
+ else if (_M_impl._M_key_compare(__k, _S_key(__x)))
+ __y = __x, __x = _S_left(__x);
+ else
+ {
+ _Const_Link_type __xu(__x), __yu(__y);
+ __y = __x, __x = _S_left(__x);
+ __xu = _S_right(__xu);
+ return pair<const_iterator,
+ const_iterator>(_M_lower_bound(__x, __y, __k),
+ _M_upper_bound(__xu, __yu, __k));
+ }
+ }
+ return pair<const_iterator, const_iterator>(const_iterator(__y),
+ const_iterator(__y));
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ void
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&& __t)
+#else
+ swap(_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __t)
+#endif
+ {
+ if (_M_root() == 0)
+ {
+ if (__t._M_root() != 0)
+ {
+ _M_root() = __t._M_root();
+ _M_leftmost() = __t._M_leftmost();
+ _M_rightmost() = __t._M_rightmost();
+ _M_root()->_M_parent = _M_end();
+
+ __t._M_root() = 0;
+ __t._M_leftmost() = __t._M_end();
+ __t._M_rightmost() = __t._M_end();
+ }
+ }
+ else if (__t._M_root() == 0)
+ {
+ __t._M_root() = _M_root();
+ __t._M_leftmost() = _M_leftmost();
+ __t._M_rightmost() = _M_rightmost();
+ __t._M_root()->_M_parent = __t._M_end();
+
+ _M_root() = 0;
+ _M_leftmost() = _M_end();
+ _M_rightmost() = _M_end();
+ }
+ else
+ {
+ std::swap(_M_root(),__t._M_root());
+ std::swap(_M_leftmost(),__t._M_leftmost());
+ std::swap(_M_rightmost(),__t._M_rightmost());
+
+ _M_root()->_M_parent = _M_end();
+ __t._M_root()->_M_parent = __t._M_end();
+ }
+ // No need to swap header's color as it does not change.
+ std::swap(this->_M_impl._M_node_count, __t._M_impl._M_node_count);
+ std::swap(this->_M_impl._M_key_compare, __t._M_impl._M_key_compare);
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 431. Swapping containers with unequal allocators.
+ std::__alloc_swap<_Node_allocator>::
+ _S_do_it(_M_get_Node_allocator(), __t._M_get_Node_allocator());
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ pair<typename _Rb_tree<_Key, _Val, _KeyOfValue,
+ _Compare, _Alloc>::iterator, bool>
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_insert_unique(const _Val& __v)
+ {
+ _Link_type __x = _M_begin();
+ _Link_type __y = _M_end();
+ bool __comp = true;
+ while (__x != 0)
+ {
+ __y = __x;
+ __comp = _M_impl._M_key_compare(_KeyOfValue()(__v), _S_key(__x));
+ __x = __comp ? _S_left(__x) : _S_right(__x);
+ }
+ iterator __j = iterator(__y);
+ if (__comp)
+ {
+ if (__j == begin())
+ return pair<iterator, bool>(_M_insert_(__x, __y, __v), true);
+ else
+ --__j;
+ }
+ if (_M_impl._M_key_compare(_S_key(__j._M_node), _KeyOfValue()(__v)))
+ return pair<iterator, bool>(_M_insert_(__x, __y, __v), true);
+ return pair<iterator, bool>(__j, false);
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_insert_equal(const _Val& __v)
+ {
+ _Link_type __x = _M_begin();
+ _Link_type __y = _M_end();
+ while (__x != 0)
+ {
+ __y = __x;
+ __x = _M_impl._M_key_compare(_KeyOfValue()(__v), _S_key(__x)) ?
+ _S_left(__x) : _S_right(__x);
+ }
+ return _M_insert_(__x, __y, __v);
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_insert_unique_(const_iterator __position, const _Val& __v)
+ {
+ // end()
+ if (__position._M_node == _M_end())
+ {
+ if (size() > 0
+ && _M_impl._M_key_compare(_S_key(_M_rightmost()),
+ _KeyOfValue()(__v)))
+ return _M_insert_(0, _M_rightmost(), __v);
+ else
+ return _M_insert_unique(__v).first;
+ }
+ else if (_M_impl._M_key_compare(_KeyOfValue()(__v),
+ _S_key(__position._M_node)))
+ {
+ // First, try before...
+ const_iterator __before = __position;
+ if (__position._M_node == _M_leftmost()) // begin()
+ return _M_insert_(_M_leftmost(), _M_leftmost(), __v);
+ else if (_M_impl._M_key_compare(_S_key((--__before)._M_node),
+ _KeyOfValue()(__v)))
+ {
+ if (_S_right(__before._M_node) == 0)
+ return _M_insert_(0, __before._M_node, __v);
+ else
+ return _M_insert_(__position._M_node,
+ __position._M_node, __v);
+ }
+ else
+ return _M_insert_unique(__v).first;
+ }
+ else if (_M_impl._M_key_compare(_S_key(__position._M_node),
+ _KeyOfValue()(__v)))
+ {
+ // ... then try after.
+ const_iterator __after = __position;
+ if (__position._M_node == _M_rightmost())
+ return _M_insert_(0, _M_rightmost(), __v);
+ else if (_M_impl._M_key_compare(_KeyOfValue()(__v),
+ _S_key((++__after)._M_node)))
+ {
+ if (_S_right(__position._M_node) == 0)
+ return _M_insert_(0, __position._M_node, __v);
+ else
+ return _M_insert_(__after._M_node, __after._M_node, __v);
+ }
+ else
+ return _M_insert_unique(__v).first;
+ }
+ else
+ // Equivalent keys.
+ return iterator(static_cast<_Link_type>
+ (const_cast<_Base_ptr>(__position._M_node)));
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_insert_equal_(const_iterator __position, const _Val& __v)
+ {
+ // end()
+ if (__position._M_node == _M_end())
+ {
+ if (size() > 0
+ && !_M_impl._M_key_compare(_KeyOfValue()(__v),
+ _S_key(_M_rightmost())))
+ return _M_insert_(0, _M_rightmost(), __v);
+ else
+ return _M_insert_equal(__v);
+ }
+ else if (!_M_impl._M_key_compare(_S_key(__position._M_node),
+ _KeyOfValue()(__v)))
+ {
+ // First, try before...
+ const_iterator __before = __position;
+ if (__position._M_node == _M_leftmost()) // begin()
+ return _M_insert_(_M_leftmost(), _M_leftmost(), __v);
+ else if (!_M_impl._M_key_compare(_KeyOfValue()(__v),
+ _S_key((--__before)._M_node)))
+ {
+ if (_S_right(__before._M_node) == 0)
+ return _M_insert_(0, __before._M_node, __v);
+ else
+ return _M_insert_(__position._M_node,
+ __position._M_node, __v);
+ }
+ else
+ return _M_insert_equal(__v);
+ }
+ else
+ {
+ // ... then try after.
+ const_iterator __after = __position;
+ if (__position._M_node == _M_rightmost())
+ return _M_insert_(0, _M_rightmost(), __v);
+ else if (!_M_impl._M_key_compare(_S_key((++__after)._M_node),
+ _KeyOfValue()(__v)))
+ {
+ if (_S_right(__position._M_node) == 0)
+ return _M_insert_(0, __position._M_node, __v);
+ else
+ return _M_insert_(__after._M_node, __after._M_node, __v);
+ }
+ else
+ return _M_insert_equal_lower(__v);
+ }
+ }
+
+ template<typename _Key, typename _Val, typename _KoV,
+ typename _Cmp, typename _Alloc>
+ template<class _II>
+ void
+ _Rb_tree<_Key, _Val, _KoV, _Cmp, _Alloc>::
+ _M_insert_unique(_II __first, _II __last)
+ {
+ for (; __first != __last; ++__first)
+ _M_insert_unique_(end(), *__first);
+ }
+
+ template<typename _Key, typename _Val, typename _KoV,
+ typename _Cmp, typename _Alloc>
+ template<class _II>
+ void
+ _Rb_tree<_Key, _Val, _KoV, _Cmp, _Alloc>::
+ _M_insert_equal(_II __first, _II __last)
+ {
+ for (; __first != __last; ++__first)
+ _M_insert_equal_(end(), *__first);
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ inline void
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ erase(iterator __position)
+ {
+ _Link_type __y =
+ static_cast<_Link_type>(_Rb_tree_rebalance_for_erase
+ (__position._M_node,
+ this->_M_impl._M_header));
+ _M_destroy_node(__y);
+ --_M_impl._M_node_count;
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ inline void
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ erase(const_iterator __position)
+ {
+ _Link_type __y =
+ static_cast<_Link_type>(_Rb_tree_rebalance_for_erase
+ (const_cast<_Base_ptr>(__position._M_node),
+ this->_M_impl._M_header));
+ _M_destroy_node(__y);
+ --_M_impl._M_node_count;
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::size_type
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ erase(const _Key& __x)
+ {
+ pair<iterator, iterator> __p = equal_range(__x);
+ const size_type __old_size = size();
+ erase(__p.first, __p.second);
+ return __old_size - size();
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ void
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ erase(iterator __first, iterator __last)
+ {
+ if (__first == begin() && __last == end())
+ clear();
+ else
+ while (__first != __last)
+ erase(__first++);
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ void
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ erase(const_iterator __first, const_iterator __last)
+ {
+ if (__first == begin() && __last == end())
+ clear();
+ else
+ while (__first != __last)
+ erase(__first++);
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ void
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ erase(const _Key* __first, const _Key* __last)
+ {
+ while (__first != __last)
+ erase(*__first++);
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue,
+ _Compare, _Alloc>::iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ find(const _Key& __k)
+ {
+ iterator __j = _M_lower_bound(_M_begin(), _M_end(), __k);
+ return (__j == end()
+ || _M_impl._M_key_compare(__k,
+ _S_key(__j._M_node))) ? end() : __j;
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue,
+ _Compare, _Alloc>::const_iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ find(const _Key& __k) const
+ {
+ const_iterator __j = _M_lower_bound(_M_begin(), _M_end(), __k);
+ return (__j == end()
+ || _M_impl._M_key_compare(__k,
+ _S_key(__j._M_node))) ? end() : __j;
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::size_type
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ count(const _Key& __k) const
+ {
+ pair<const_iterator, const_iterator> __p = equal_range(__k);
+ const size_type __n = std::distance(__p.first, __p.second);
+ return __n;
+ }
+
+ unsigned int
+ _Rb_tree_black_count(const _Rb_tree_node_base* __node,
+ const _Rb_tree_node_base* __root);
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ bool
+ _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::__rb_verify() const
+ {
+ if (_M_impl._M_node_count == 0 || begin() == end())
+ return _M_impl._M_node_count == 0 && begin() == end()
+ && this->_M_impl._M_header._M_left == _M_end()
+ && this->_M_impl._M_header._M_right == _M_end();
+
+ unsigned int __len = _Rb_tree_black_count(_M_leftmost(), _M_root());
+ for (const_iterator __it = begin(); __it != end(); ++__it)
+ {
+ _Const_Link_type __x = static_cast<_Const_Link_type>(__it._M_node);
+ _Const_Link_type __L = _S_left(__x);
+ _Const_Link_type __R = _S_right(__x);
+
+ if (__x->_M_color == _S_red)
+ if ((__L && __L->_M_color == _S_red)
+ || (__R && __R->_M_color == _S_red))
+ return false;
+
+ if (__L && _M_impl._M_key_compare(_S_key(__x), _S_key(__L)))
+ return false;
+ if (__R && _M_impl._M_key_compare(_S_key(__R), _S_key(__x)))
+ return false;
+
+ if (!__L && !__R && _Rb_tree_black_count(__x, _M_root()) != __len)
+ return false;
+ }
+
+ if (_M_leftmost() != _Rb_tree_node_base::_S_minimum(_M_root()))
+ return false;
+ if (_M_rightmost() != _Rb_tree_node_base::_S_maximum(_M_root()))
+ return false;
+ return true;
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/bits/stl_uninitialized.h b/i686-linux/include/c++/4.4.3/bits/stl_uninitialized.h
new file mode 100644
index 0000000..11a66c7
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/stl_uninitialized.h
@@ -0,0 +1,478 @@
+// Raw memory manipulators -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_uninitialized.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_UNINITIALIZED_H
+#define _STL_UNINITIALIZED_H 1
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<bool>
+ struct __uninitialized_copy
+ {
+ template<typename _InputIterator, typename _ForwardIterator>
+ static _ForwardIterator
+ uninitialized_copy(_InputIterator __first, _InputIterator __last,
+ _ForwardIterator __result)
+ {
+ _ForwardIterator __cur = __result;
+ __try
+ {
+ for (; __first != __last; ++__first, ++__cur)
+ ::new(static_cast<void*>(&*__cur)) typename
+ iterator_traits<_ForwardIterator>::value_type(*__first);
+ return __cur;
+ }
+ __catch(...)
+ {
+ std::_Destroy(__result, __cur);
+ __throw_exception_again;
+ }
+ }
+ };
+
+ template<>
+ struct __uninitialized_copy<true>
+ {
+ template<typename _InputIterator, typename _ForwardIterator>
+ static _ForwardIterator
+ uninitialized_copy(_InputIterator __first, _InputIterator __last,
+ _ForwardIterator __result)
+ { return std::copy(__first, __last, __result); }
+ };
+
+ /**
+ * @brief Copies the range [first,last) into result.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param result An output iterator.
+ * @return result + (first - last)
+ *
+ * Like copy(), but does not require an initialized output range.
+ */
+ template<typename _InputIterator, typename _ForwardIterator>
+ inline _ForwardIterator
+ uninitialized_copy(_InputIterator __first, _InputIterator __last,
+ _ForwardIterator __result)
+ {
+ typedef typename iterator_traits<_InputIterator>::value_type
+ _ValueType1;
+ typedef typename iterator_traits<_ForwardIterator>::value_type
+ _ValueType2;
+
+ return std::__uninitialized_copy<(__is_pod(_ValueType1)
+ && __is_pod(_ValueType2))>::
+ uninitialized_copy(__first, __last, __result);
+ }
+
+
+ template<bool>
+ struct __uninitialized_fill
+ {
+ template<typename _ForwardIterator, typename _Tp>
+ static void
+ uninitialized_fill(_ForwardIterator __first,
+ _ForwardIterator __last, const _Tp& __x)
+ {
+ _ForwardIterator __cur = __first;
+ __try
+ {
+ for (; __cur != __last; ++__cur)
+ std::_Construct(&*__cur, __x);
+ }
+ __catch(...)
+ {
+ std::_Destroy(__first, __cur);
+ __throw_exception_again;
+ }
+ }
+ };
+
+ template<>
+ struct __uninitialized_fill<true>
+ {
+ template<typename _ForwardIterator, typename _Tp>
+ static void
+ uninitialized_fill(_ForwardIterator __first,
+ _ForwardIterator __last, const _Tp& __x)
+ { std::fill(__first, __last, __x); }
+ };
+
+ /**
+ * @brief Copies the value x into the range [first,last).
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param x The source value.
+ * @return Nothing.
+ *
+ * Like fill(), but does not require an initialized output range.
+ */
+ template<typename _ForwardIterator, typename _Tp>
+ inline void
+ uninitialized_fill(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __x)
+ {
+ typedef typename iterator_traits<_ForwardIterator>::value_type
+ _ValueType;
+
+ std::__uninitialized_fill<__is_pod(_ValueType)>::
+ uninitialized_fill(__first, __last, __x);
+ }
+
+
+ template<bool>
+ struct __uninitialized_fill_n
+ {
+ template<typename _ForwardIterator, typename _Size, typename _Tp>
+ static void
+ uninitialized_fill_n(_ForwardIterator __first, _Size __n,
+ const _Tp& __x)
+ {
+ _ForwardIterator __cur = __first;
+ __try
+ {
+ for (; __n > 0; --__n, ++__cur)
+ std::_Construct(&*__cur, __x);
+ }
+ __catch(...)
+ {
+ std::_Destroy(__first, __cur);
+ __throw_exception_again;
+ }
+ }
+ };
+
+ template<>
+ struct __uninitialized_fill_n<true>
+ {
+ template<typename _ForwardIterator, typename _Size, typename _Tp>
+ static void
+ uninitialized_fill_n(_ForwardIterator __first, _Size __n,
+ const _Tp& __x)
+ { std::fill_n(__first, __n, __x); }
+ };
+
+ /**
+ * @brief Copies the value x into the range [first,first+n).
+ * @param first An input iterator.
+ * @param n The number of copies to make.
+ * @param x The source value.
+ * @return Nothing.
+ *
+ * Like fill_n(), but does not require an initialized output range.
+ */
+ template<typename _ForwardIterator, typename _Size, typename _Tp>
+ inline void
+ uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x)
+ {
+ typedef typename iterator_traits<_ForwardIterator>::value_type
+ _ValueType;
+
+ std::__uninitialized_fill_n<__is_pod(_ValueType)>::
+ uninitialized_fill_n(__first, __n, __x);
+ }
+
+ // Extensions: versions of uninitialized_copy, uninitialized_fill,
+ // and uninitialized_fill_n that take an allocator parameter.
+ // We dispatch back to the standard versions when we're given the
+ // default allocator. For nondefault allocators we do not use
+ // any of the POD optimizations.
+
+ template<typename _InputIterator, typename _ForwardIterator,
+ typename _Allocator>
+ _ForwardIterator
+ __uninitialized_copy_a(_InputIterator __first, _InputIterator __last,
+ _ForwardIterator __result, _Allocator& __alloc)
+ {
+ _ForwardIterator __cur = __result;
+ __try
+ {
+ for (; __first != __last; ++__first, ++__cur)
+ __alloc.construct(&*__cur, *__first);
+ return __cur;
+ }
+ __catch(...)
+ {
+ std::_Destroy(__result, __cur, __alloc);
+ __throw_exception_again;
+ }
+ }
+
+ template<typename _InputIterator, typename _ForwardIterator, typename _Tp>
+ inline _ForwardIterator
+ __uninitialized_copy_a(_InputIterator __first, _InputIterator __last,
+ _ForwardIterator __result, allocator<_Tp>&)
+ { return std::uninitialized_copy(__first, __last, __result); }
+
+ template<typename _InputIterator, typename _ForwardIterator,
+ typename _Allocator>
+ inline _ForwardIterator
+ __uninitialized_move_a(_InputIterator __first, _InputIterator __last,
+ _ForwardIterator __result, _Allocator& __alloc)
+ {
+ return std::__uninitialized_copy_a(_GLIBCXX_MAKE_MOVE_ITERATOR(__first),
+ _GLIBCXX_MAKE_MOVE_ITERATOR(__last),
+ __result, __alloc);
+ }
+
+ template<typename _ForwardIterator, typename _Tp, typename _Allocator>
+ void
+ __uninitialized_fill_a(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __x, _Allocator& __alloc)
+ {
+ _ForwardIterator __cur = __first;
+ __try
+ {
+ for (; __cur != __last; ++__cur)
+ __alloc.construct(&*__cur, __x);
+ }
+ __catch(...)
+ {
+ std::_Destroy(__first, __cur, __alloc);
+ __throw_exception_again;
+ }
+ }
+
+ template<typename _ForwardIterator, typename _Tp, typename _Tp2>
+ inline void
+ __uninitialized_fill_a(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __x, allocator<_Tp2>&)
+ { std::uninitialized_fill(__first, __last, __x); }
+
+ template<typename _ForwardIterator, typename _Size, typename _Tp,
+ typename _Allocator>
+ void
+ __uninitialized_fill_n_a(_ForwardIterator __first, _Size __n,
+ const _Tp& __x, _Allocator& __alloc)
+ {
+ _ForwardIterator __cur = __first;
+ __try
+ {
+ for (; __n > 0; --__n, ++__cur)
+ __alloc.construct(&*__cur, __x);
+ }
+ __catch(...)
+ {
+ std::_Destroy(__first, __cur, __alloc);
+ __throw_exception_again;
+ }
+ }
+
+ template<typename _ForwardIterator, typename _Size, typename _Tp,
+ typename _Tp2>
+ inline void
+ __uninitialized_fill_n_a(_ForwardIterator __first, _Size __n,
+ const _Tp& __x, allocator<_Tp2>&)
+ { std::uninitialized_fill_n(__first, __n, __x); }
+
+
+ // Extensions: __uninitialized_copy_move, __uninitialized_move_copy,
+ // __uninitialized_fill_move, __uninitialized_move_fill.
+ // All of these algorithms take a user-supplied allocator, which is used
+ // for construction and destruction.
+
+ // __uninitialized_copy_move
+ // Copies [first1, last1) into [result, result + (last1 - first1)), and
+ // move [first2, last2) into
+ // [result, result + (last1 - first1) + (last2 - first2)).
+ template<typename _InputIterator1, typename _InputIterator2,
+ typename _ForwardIterator, typename _Allocator>
+ inline _ForwardIterator
+ __uninitialized_copy_move(_InputIterator1 __first1,
+ _InputIterator1 __last1,
+ _InputIterator2 __first2,
+ _InputIterator2 __last2,
+ _ForwardIterator __result,
+ _Allocator& __alloc)
+ {
+ _ForwardIterator __mid = std::__uninitialized_copy_a(__first1, __last1,
+ __result,
+ __alloc);
+ __try
+ {
+ return std::__uninitialized_move_a(__first2, __last2, __mid, __alloc);
+ }
+ __catch(...)
+ {
+ std::_Destroy(__result, __mid, __alloc);
+ __throw_exception_again;
+ }
+ }
+
+ // __uninitialized_move_copy
+ // Moves [first1, last1) into [result, result + (last1 - first1)), and
+ // copies [first2, last2) into
+ // [result, result + (last1 - first1) + (last2 - first2)).
+ template<typename _InputIterator1, typename _InputIterator2,
+ typename _ForwardIterator, typename _Allocator>
+ inline _ForwardIterator
+ __uninitialized_move_copy(_InputIterator1 __first1,
+ _InputIterator1 __last1,
+ _InputIterator2 __first2,
+ _InputIterator2 __last2,
+ _ForwardIterator __result,
+ _Allocator& __alloc)
+ {
+ _ForwardIterator __mid = std::__uninitialized_move_a(__first1, __last1,
+ __result,
+ __alloc);
+ __try
+ {
+ return std::__uninitialized_copy_a(__first2, __last2, __mid, __alloc);
+ }
+ __catch(...)
+ {
+ std::_Destroy(__result, __mid, __alloc);
+ __throw_exception_again;
+ }
+ }
+
+ // __uninitialized_fill_move
+ // Fills [result, mid) with x, and moves [first, last) into
+ // [mid, mid + (last - first)).
+ template<typename _ForwardIterator, typename _Tp, typename _InputIterator,
+ typename _Allocator>
+ inline _ForwardIterator
+ __uninitialized_fill_move(_ForwardIterator __result, _ForwardIterator __mid,
+ const _Tp& __x, _InputIterator __first,
+ _InputIterator __last, _Allocator& __alloc)
+ {
+ std::__uninitialized_fill_a(__result, __mid, __x, __alloc);
+ __try
+ {
+ return std::__uninitialized_move_a(__first, __last, __mid, __alloc);
+ }
+ __catch(...)
+ {
+ std::_Destroy(__result, __mid, __alloc);
+ __throw_exception_again;
+ }
+ }
+
+ // __uninitialized_move_fill
+ // Moves [first1, last1) into [first2, first2 + (last1 - first1)), and
+ // fills [first2 + (last1 - first1), last2) with x.
+ template<typename _InputIterator, typename _ForwardIterator, typename _Tp,
+ typename _Allocator>
+ inline void
+ __uninitialized_move_fill(_InputIterator __first1, _InputIterator __last1,
+ _ForwardIterator __first2,
+ _ForwardIterator __last2, const _Tp& __x,
+ _Allocator& __alloc)
+ {
+ _ForwardIterator __mid2 = std::__uninitialized_move_a(__first1, __last1,
+ __first2,
+ __alloc);
+ __try
+ {
+ std::__uninitialized_fill_a(__mid2, __last2, __x, __alloc);
+ }
+ __catch(...)
+ {
+ std::_Destroy(__first2, __mid2, __alloc);
+ __throw_exception_again;
+ }
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _InputIterator, typename _Size,
+ typename _ForwardIterator>
+ _ForwardIterator
+ __uninitialized_copy_n(_InputIterator __first, _Size __n,
+ _ForwardIterator __result, input_iterator_tag)
+ {
+ _ForwardIterator __cur = __result;
+ __try
+ {
+ for (; __n > 0; --__n, ++__first, ++__cur)
+ ::new(static_cast<void*>(&*__cur)) typename
+ iterator_traits<_ForwardIterator>::value_type(*__first);
+ return __cur;
+ }
+ __catch(...)
+ {
+ std::_Destroy(__result, __cur);
+ __throw_exception_again;
+ }
+ }
+
+ template<typename _RandomAccessIterator, typename _Size,
+ typename _ForwardIterator>
+ inline _ForwardIterator
+ __uninitialized_copy_n(_RandomAccessIterator __first, _Size __n,
+ _ForwardIterator __result,
+ random_access_iterator_tag)
+ { return std::uninitialized_copy(__first, __first + __n, __result); }
+
+ /**
+ * @brief Copies the range [first,first+n) into result.
+ * @param first An input iterator.
+ * @param n The number of elements to copy.
+ * @param result An output iterator.
+ * @return result + n
+ *
+ * Like copy_n(), but does not require an initialized output range.
+ */
+ template<typename _InputIterator, typename _Size, typename _ForwardIterator>
+ inline _ForwardIterator
+ uninitialized_copy_n(_InputIterator __first, _Size __n,
+ _ForwardIterator __result)
+ { return std::__uninitialized_copy_n(__first, __n, __result,
+ std::__iterator_category(__first)); }
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _STL_UNINITIALIZED_H */
diff --git a/i686-linux/include/c++/4.4.3/bits/stl_vector.h b/i686-linux/include/c++/4.4.3/bits/stl_vector.h
new file mode 100644
index 0000000..6871bb0
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/stl_vector.h
@@ -0,0 +1,1249 @@
+// Vector implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_vector.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_VECTOR_H
+#define _STL_VECTOR_H 1
+
+#include <bits/stl_iterator_base_funcs.h>
+#include <bits/functexcept.h>
+#include <bits/concept_check.h>
+#include <initializer_list>
+
+_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
+
+ /// See bits/stl_deque.h's _Deque_base for an explanation.
+ template<typename _Tp, typename _Alloc>
+ struct _Vector_base
+ {
+ typedef typename _Alloc::template rebind<_Tp>::other _Tp_alloc_type;
+
+ struct _Vector_impl
+ : public _Tp_alloc_type
+ {
+ typename _Tp_alloc_type::pointer _M_start;
+ typename _Tp_alloc_type::pointer _M_finish;
+ typename _Tp_alloc_type::pointer _M_end_of_storage;
+
+ _Vector_impl()
+ : _Tp_alloc_type(), _M_start(0), _M_finish(0), _M_end_of_storage(0)
+ { }
+
+ _Vector_impl(_Tp_alloc_type const& __a)
+ : _Tp_alloc_type(__a), _M_start(0), _M_finish(0), _M_end_of_storage(0)
+ { }
+ };
+
+ public:
+ typedef _Alloc allocator_type;
+
+ _Tp_alloc_type&
+ _M_get_Tp_allocator()
+ { return *static_cast<_Tp_alloc_type*>(&this->_M_impl); }
+
+ const _Tp_alloc_type&
+ _M_get_Tp_allocator() const
+ { return *static_cast<const _Tp_alloc_type*>(&this->_M_impl); }
+
+ allocator_type
+ get_allocator() const
+ { return allocator_type(_M_get_Tp_allocator()); }
+
+ _Vector_base()
+ : _M_impl() { }
+
+ _Vector_base(const allocator_type& __a)
+ : _M_impl(__a) { }
+
+ _Vector_base(size_t __n, const allocator_type& __a)
+ : _M_impl(__a)
+ {
+ this->_M_impl._M_start = this->_M_allocate(__n);
+ this->_M_impl._M_finish = this->_M_impl._M_start;
+ this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ _Vector_base(_Vector_base&& __x)
+ : _M_impl(__x._M_get_Tp_allocator())
+ {
+ this->_M_impl._M_start = __x._M_impl._M_start;
+ this->_M_impl._M_finish = __x._M_impl._M_finish;
+ this->_M_impl._M_end_of_storage = __x._M_impl._M_end_of_storage;
+ __x._M_impl._M_start = 0;
+ __x._M_impl._M_finish = 0;
+ __x._M_impl._M_end_of_storage = 0;
+ }
+#endif
+
+ ~_Vector_base()
+ { _M_deallocate(this->_M_impl._M_start, this->_M_impl._M_end_of_storage
+ - this->_M_impl._M_start); }
+
+ public:
+ _Vector_impl _M_impl;
+
+ typename _Tp_alloc_type::pointer
+ _M_allocate(size_t __n)
+ { return __n != 0 ? _M_impl.allocate(__n) : 0; }
+
+ void
+ _M_deallocate(typename _Tp_alloc_type::pointer __p, size_t __n)
+ {
+ if (__p)
+ _M_impl.deallocate(__p, __n);
+ }
+ };
+
+
+ /**
+ * @brief A standard container which offers fixed time access to
+ * individual elements in any order.
+ *
+ * @ingroup sequences
+ *
+ * Meets the requirements of a <a href="tables.html#65">container</a>, a
+ * <a href="tables.html#66">reversible container</a>, and a
+ * <a href="tables.html#67">sequence</a>, including the
+ * <a href="tables.html#68">optional sequence requirements</a> with the
+ * %exception of @c push_front and @c pop_front.
+ *
+ * In some terminology a %vector can be described as a dynamic
+ * C-style array, it offers fast and efficient access to individual
+ * elements in any order and saves the user from worrying about
+ * memory and size allocation. Subscripting ( @c [] ) access is
+ * also provided as with C-style arrays.
+ */
+ template<typename _Tp, typename _Alloc = std::allocator<_Tp> >
+ class vector : protected _Vector_base<_Tp, _Alloc>
+ {
+ // Concept requirements.
+ typedef typename _Alloc::value_type _Alloc_value_type;
+ __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
+ __glibcxx_class_requires2(_Tp, _Alloc_value_type, _SameTypeConcept)
+
+ typedef _Vector_base<_Tp, _Alloc> _Base;
+ typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
+
+ public:
+ typedef _Tp value_type;
+ typedef typename _Tp_alloc_type::pointer pointer;
+ typedef typename _Tp_alloc_type::const_pointer const_pointer;
+ typedef typename _Tp_alloc_type::reference reference;
+ typedef typename _Tp_alloc_type::const_reference const_reference;
+ typedef __gnu_cxx::__normal_iterator<pointer, vector> iterator;
+ typedef __gnu_cxx::__normal_iterator<const_pointer, vector>
+ const_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Alloc allocator_type;
+
+ protected:
+ using _Base::_M_allocate;
+ using _Base::_M_deallocate;
+ using _Base::_M_impl;
+ using _Base::_M_get_Tp_allocator;
+
+ public:
+ // [23.2.4.1] construct/copy/destroy
+ // (assign() and get_allocator() are also listed in this section)
+ /**
+ * @brief Default constructor creates no elements.
+ */
+ vector()
+ : _Base() { }
+
+ /**
+ * @brief Creates a %vector with no elements.
+ * @param a An allocator object.
+ */
+ explicit
+ vector(const allocator_type& __a)
+ : _Base(__a) { }
+
+ /**
+ * @brief Creates a %vector with copies of an exemplar element.
+ * @param n The number of elements to initially create.
+ * @param value An element to copy.
+ * @param a An allocator.
+ *
+ * This constructor fills the %vector with @a n copies of @a value.
+ */
+ explicit
+ vector(size_type __n, const value_type& __value = value_type(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__n, __a)
+ { _M_fill_initialize(__n, __value); }
+
+ /**
+ * @brief %Vector copy constructor.
+ * @param x A %vector of identical element and allocator types.
+ *
+ * The newly-created %vector uses a copy of the allocation
+ * object used by @a x. All the elements of @a x are copied,
+ * but any extra memory in
+ * @a x (for fast expansion) will not be copied.
+ */
+ vector(const vector& __x)
+ : _Base(__x.size(), __x._M_get_Tp_allocator())
+ { this->_M_impl._M_finish =
+ std::__uninitialized_copy_a(__x.begin(), __x.end(),
+ this->_M_impl._M_start,
+ _M_get_Tp_allocator());
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief %Vector move constructor.
+ * @param x A %vector of identical element and allocator types.
+ *
+ * The newly-created %vector contains the exact contents of @a x.
+ * The contents of @a x are a valid, but unspecified %vector.
+ */
+ vector(vector&& __x)
+ : _Base(std::forward<_Base>(__x)) { }
+
+ /**
+ * @brief Builds a %vector from an initializer list.
+ * @param l An initializer_list.
+ * @param a An allocator.
+ *
+ * Create a %vector consisting of copies of the elements in the
+ * initializer_list @a l.
+ *
+ * This will call the element type's copy constructor N times
+ * (where N is @a l.size()) and do no memory reallocation.
+ */
+ vector(initializer_list<value_type> __l,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ {
+ _M_range_initialize(__l.begin(), __l.end(),
+ random_access_iterator_tag());
+ }
+#endif
+
+ /**
+ * @brief Builds a %vector from a range.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param a An allocator.
+ *
+ * Create a %vector consisting of copies of the elements from
+ * [first,last).
+ *
+ * If the iterators are forward, bidirectional, or
+ * random-access, then this will call the elements' copy
+ * constructor N times (where N is distance(first,last)) and do
+ * no memory reallocation. But if only input iterators are
+ * used, then this will do at most 2N calls to the copy
+ * constructor, and logN memory reallocations.
+ */
+ template<typename _InputIterator>
+ vector(_InputIterator __first, _InputIterator __last,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ {
+ // Check whether it's an integral type. If so, it's not an iterator.
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ _M_initialize_dispatch(__first, __last, _Integral());
+ }
+
+ /**
+ * The dtor only erases the elements, and note that if the
+ * elements themselves are pointers, the pointed-to memory is
+ * not touched in any way. Managing the pointer is the user's
+ * responsibility.
+ */
+ ~vector()
+ { std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
+ _M_get_Tp_allocator()); }
+
+ /**
+ * @brief %Vector assignment operator.
+ * @param x A %vector of identical element and allocator types.
+ *
+ * All the elements of @a x are copied, but any extra memory in
+ * @a x (for fast expansion) will not be copied. Unlike the
+ * copy constructor, the allocator object is not copied.
+ */
+ vector&
+ operator=(const vector& __x);
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief %Vector move assignment operator.
+ * @param x A %vector of identical element and allocator types.
+ *
+ * The contents of @a x are moved into this %vector (without copying).
+ * @a x is a valid, but unspecified %vector.
+ */
+ vector&
+ operator=(vector&& __x)
+ {
+ // NB: DR 675.
+ this->clear();
+ this->swap(__x);
+ return *this;
+ }
+
+ /**
+ * @brief %Vector list assignment operator.
+ * @param l An initializer_list.
+ *
+ * This function fills a %vector with copies of the elements in the
+ * initializer list @a l.
+ *
+ * Note that the assignment completely changes the %vector and
+ * that the resulting %vector's size is the same as the number
+ * of elements assigned. Old data may be lost.
+ */
+ vector&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->assign(__l.begin(), __l.end());
+ return *this;
+ }
+#endif
+
+ /**
+ * @brief Assigns a given value to a %vector.
+ * @param n Number of elements to be assigned.
+ * @param val Value to be assigned.
+ *
+ * This function fills a %vector with @a n copies of the given
+ * value. Note that the assignment completely changes the
+ * %vector and that the resulting %vector's size is the same as
+ * the number of elements assigned. Old data may be lost.
+ */
+ void
+ assign(size_type __n, const value_type& __val)
+ { _M_fill_assign(__n, __val); }
+
+ /**
+ * @brief Assigns a range to a %vector.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ *
+ * This function fills a %vector with copies of the elements in the
+ * range [first,last).
+ *
+ * Note that the assignment completely changes the %vector and
+ * that the resulting %vector's size is the same as the number
+ * of elements assigned. Old data may be lost.
+ */
+ template<typename _InputIterator>
+ void
+ assign(_InputIterator __first, _InputIterator __last)
+ {
+ // Check whether it's an integral type. If so, it's not an iterator.
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ _M_assign_dispatch(__first, __last, _Integral());
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Assigns an initializer list to a %vector.
+ * @param l An initializer_list.
+ *
+ * This function fills a %vector with copies of the elements in the
+ * initializer list @a l.
+ *
+ * Note that the assignment completely changes the %vector and
+ * that the resulting %vector's size is the same as the number
+ * of elements assigned. Old data may be lost.
+ */
+ void
+ assign(initializer_list<value_type> __l)
+ { this->assign(__l.begin(), __l.end()); }
+#endif
+
+ /// Get a copy of the memory allocation object.
+ using _Base::get_allocator;
+
+ // iterators
+ /**
+ * Returns a read/write iterator that points to the first
+ * element in the %vector. Iteration is done in ordinary
+ * element order.
+ */
+ iterator
+ begin()
+ { return iterator(this->_M_impl._M_start); }
+
+ /**
+ * Returns a read-only (constant) iterator that points to the
+ * first element in the %vector. Iteration is done in ordinary
+ * element order.
+ */
+ const_iterator
+ begin() const
+ { return const_iterator(this->_M_impl._M_start); }
+
+ /**
+ * Returns a read/write iterator that points one past the last
+ * element in the %vector. Iteration is done in ordinary
+ * element order.
+ */
+ iterator
+ end()
+ { return iterator(this->_M_impl._M_finish); }
+
+ /**
+ * Returns a read-only (constant) iterator that points one past
+ * the last element in the %vector. Iteration is done in
+ * ordinary element order.
+ */
+ const_iterator
+ end() const
+ { return const_iterator(this->_M_impl._M_finish); }
+
+ /**
+ * Returns a read/write reverse iterator that points to the
+ * last element in the %vector. Iteration is done in reverse
+ * element order.
+ */
+ reverse_iterator
+ rbegin()
+ { return reverse_iterator(end()); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points
+ * to the last element in the %vector. Iteration is done in
+ * reverse element order.
+ */
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(end()); }
+
+ /**
+ * Returns a read/write reverse iterator that points to one
+ * before the first element in the %vector. Iteration is done
+ * in reverse element order.
+ */
+ reverse_iterator
+ rend()
+ { return reverse_iterator(begin()); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points
+ * to one before the first element in the %vector. Iteration
+ * is done in reverse element order.
+ */
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(begin()); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * Returns a read-only (constant) iterator that points to the
+ * first element in the %vector. Iteration is done in ordinary
+ * element order.
+ */
+ const_iterator
+ cbegin() const
+ { return const_iterator(this->_M_impl._M_start); }
+
+ /**
+ * Returns a read-only (constant) iterator that points one past
+ * the last element in the %vector. Iteration is done in
+ * ordinary element order.
+ */
+ const_iterator
+ cend() const
+ { return const_iterator(this->_M_impl._M_finish); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points
+ * to the last element in the %vector. Iteration is done in
+ * reverse element order.
+ */
+ const_reverse_iterator
+ crbegin() const
+ { return const_reverse_iterator(end()); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points
+ * to one before the first element in the %vector. Iteration
+ * is done in reverse element order.
+ */
+ const_reverse_iterator
+ crend() const
+ { return const_reverse_iterator(begin()); }
+#endif
+
+ // [23.2.4.2] capacity
+ /** Returns the number of elements in the %vector. */
+ size_type
+ size() const
+ { return size_type(this->_M_impl._M_finish - this->_M_impl._M_start); }
+
+ /** Returns the size() of the largest possible %vector. */
+ size_type
+ max_size() const
+ { return _M_get_Tp_allocator().max_size(); }
+
+ /**
+ * @brief Resizes the %vector to the specified number of elements.
+ * @param new_size Number of elements the %vector should contain.
+ * @param x Data with which new elements should be populated.
+ *
+ * This function will %resize the %vector to the specified
+ * number of elements. If the number is smaller than the
+ * %vector's current size the %vector is truncated, otherwise
+ * the %vector is extended and new elements are populated with
+ * given data.
+ */
+ void
+ resize(size_type __new_size, value_type __x = value_type())
+ {
+ if (__new_size < size())
+ _M_erase_at_end(this->_M_impl._M_start + __new_size);
+ else
+ insert(end(), __new_size - size(), __x);
+ }
+
+ /**
+ * Returns the total number of elements that the %vector can
+ * hold before needing to allocate more memory.
+ */
+ size_type
+ capacity() const
+ { return size_type(this->_M_impl._M_end_of_storage
+ - this->_M_impl._M_start); }
+
+ /**
+ * Returns true if the %vector is empty. (Thus begin() would
+ * equal end().)
+ */
+ bool
+ empty() const
+ { return begin() == end(); }
+
+ /**
+ * @brief Attempt to preallocate enough memory for specified number of
+ * elements.
+ * @param n Number of elements required.
+ * @throw std::length_error If @a n exceeds @c max_size().
+ *
+ * This function attempts to reserve enough memory for the
+ * %vector to hold the specified number of elements. If the
+ * number requested is more than max_size(), length_error is
+ * thrown.
+ *
+ * The advantage of this function is that if optimal code is a
+ * necessity and the user can determine the number of elements
+ * that will be required, the user can reserve the memory in
+ * %advance, and thus prevent a possible reallocation of memory
+ * and copying of %vector data.
+ */
+ void
+ reserve(size_type __n);
+
+ // element access
+ /**
+ * @brief Subscript access to the data contained in the %vector.
+ * @param n The index of the element for which data should be
+ * accessed.
+ * @return Read/write reference to data.
+ *
+ * This operator allows for easy, array-style, data access.
+ * Note that data access with this operator is unchecked and
+ * out_of_range lookups are not defined. (For checked lookups
+ * see at().)
+ *
+ * Local modification: range checks are performed if
+ * __google_stl_debug_vector is defined to non-zero.
+ */
+ reference
+ operator[](size_type __n)
+ {
+#if __google_stl_debug_vector
+ _M_range_check(__n);
+#endif
+ return *(this->_M_impl._M_start + __n);
+ }
+
+ /**
+ * @brief Subscript access to the data contained in the %vector.
+ * @param n The index of the element for which data should be
+ * accessed.
+ * @return Read-only (constant) reference to data.
+ *
+ * This operator allows for easy, array-style, data access.
+ * Note that data access with this operator is unchecked and
+ * out_of_range lookups are not defined. (For checked lookups
+ * see at().)
+ *
+ * Local modification: range checks are performed if
+ * __google_stl_debug_vector is defined to non-zero.
+ */
+ const_reference
+ operator[](size_type __n) const
+ {
+#if __google_stl_debug_vector
+ _M_range_check(__n);
+#endif
+ return *(this->_M_impl._M_start + __n);
+ }
+
+ protected:
+ /// Safety check used only from at().
+ void
+ _M_range_check(size_type __n) const
+ {
+ if (__n >= this->size())
+ __throw_out_of_range(__N("vector::_M_range_check"));
+ }
+
+ public:
+ /**
+ * @brief Provides access to the data contained in the %vector.
+ * @param n The index of the element for which data should be
+ * accessed.
+ * @return Read/write reference to data.
+ * @throw std::out_of_range If @a n is an invalid index.
+ *
+ * This function provides for safer data access. The parameter
+ * is first checked that it is in the range of the vector. The
+ * function throws out_of_range if the check fails.
+ */
+ reference
+ at(size_type __n)
+ {
+ _M_range_check(__n);
+ return (*this)[__n];
+ }
+
+ /**
+ * @brief Provides access to the data contained in the %vector.
+ * @param n The index of the element for which data should be
+ * accessed.
+ * @return Read-only (constant) reference to data.
+ * @throw std::out_of_range If @a n is an invalid index.
+ *
+ * This function provides for safer data access. The parameter
+ * is first checked that it is in the range of the vector. The
+ * function throws out_of_range if the check fails.
+ */
+ const_reference
+ at(size_type __n) const
+ {
+ _M_range_check(__n);
+ return (*this)[__n];
+ }
+
+ /**
+ * Returns a read/write reference to the data at the first
+ * element of the %vector.
+ */
+ reference
+ front()
+ { return *begin(); }
+
+ /**
+ * Returns a read-only (constant) reference to the data at the first
+ * element of the %vector.
+ */
+ const_reference
+ front() const
+ { return *begin(); }
+
+ /**
+ * Returns a read/write reference to the data at the last
+ * element of the %vector.
+ */
+ reference
+ back()
+ { return *(end() - 1); }
+
+ /**
+ * Returns a read-only (constant) reference to the data at the
+ * last element of the %vector.
+ */
+ const_reference
+ back() const
+ { return *(end() - 1); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 464. Suggestion for new member functions in standard containers.
+ // data access
+ /**
+ * Returns a pointer such that [data(), data() + size()) is a valid
+ * range. For a non-empty %vector, data() == &front().
+ */
+ pointer
+ data()
+ { return pointer(this->_M_impl._M_start); }
+
+ const_pointer
+ data() const
+ { return const_pointer(this->_M_impl._M_start); }
+
+ // [23.2.4.3] modifiers
+ /**
+ * @brief Add data to the end of the %vector.
+ * @param x Data to be added.
+ *
+ * This is a typical stack operation. The function creates an
+ * element at the end of the %vector and assigns the given data
+ * to it. Due to the nature of a %vector this operation can be
+ * done in constant time if the %vector has preallocated space
+ * available.
+ */
+ void
+ push_back(const value_type& __x)
+ {
+ if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
+ {
+ this->_M_impl.construct(this->_M_impl._M_finish, __x);
+ ++this->_M_impl._M_finish;
+ }
+ else
+ _M_insert_aux(end(), __x);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ push_back(value_type&& __x)
+ { emplace_back(std::move(__x)); }
+
+ template<typename... _Args>
+ void
+ emplace_back(_Args&&... __args);
+#endif
+
+ /**
+ * @brief Removes last element.
+ *
+ * This is a typical stack operation. It shrinks the %vector by one.
+ *
+ * Note that no data is returned, and if the last element's
+ * data is needed, it should be retrieved before pop_back() is
+ * called.
+ */
+ void
+ pop_back()
+ {
+ --this->_M_impl._M_finish;
+ this->_M_impl.destroy(this->_M_impl._M_finish);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Inserts an object in %vector before specified iterator.
+ * @param position An iterator into the %vector.
+ * @param args Arguments.
+ * @return An iterator that points to the inserted data.
+ *
+ * This function will insert an object of type T constructed
+ * with T(std::forward<Args>(args)...) before the specified location.
+ * Note that this kind of operation could be expensive for a %vector
+ * and if it is frequently used the user should consider using
+ * std::list.
+ */
+ template<typename... _Args>
+ iterator
+ emplace(iterator __position, _Args&&... __args);
+#endif
+
+ /**
+ * @brief Inserts given value into %vector before specified iterator.
+ * @param position An iterator into the %vector.
+ * @param x Data to be inserted.
+ * @return An iterator that points to the inserted data.
+ *
+ * This function will insert a copy of the given value before
+ * the specified location. Note that this kind of operation
+ * could be expensive for a %vector and if it is frequently
+ * used the user should consider using std::list.
+ */
+ iterator
+ insert(iterator __position, const value_type& __x);
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Inserts given rvalue into %vector before specified iterator.
+ * @param position An iterator into the %vector.
+ * @param x Data to be inserted.
+ * @return An iterator that points to the inserted data.
+ *
+ * This function will insert a copy of the given rvalue before
+ * the specified location. Note that this kind of operation
+ * could be expensive for a %vector and if it is frequently
+ * used the user should consider using std::list.
+ */
+ iterator
+ insert(iterator __position, value_type&& __x)
+ { return emplace(__position, std::move(__x)); }
+
+ /**
+ * @brief Inserts an initializer_list into the %vector.
+ * @param position An iterator into the %vector.
+ * @param l An initializer_list.
+ *
+ * This function will insert copies of the data in the
+ * initializer_list @a l into the %vector before the location
+ * specified by @a position.
+ *
+ * Note that this kind of operation could be expensive for a
+ * %vector and if it is frequently used the user should
+ * consider using std::list.
+ */
+ void
+ insert(iterator __position, initializer_list<value_type> __l)
+ { this->insert(__position, __l.begin(), __l.end()); }
+#endif
+
+ /**
+ * @brief Inserts a number of copies of given data into the %vector.
+ * @param position An iterator into the %vector.
+ * @param n Number of elements to be inserted.
+ * @param x Data to be inserted.
+ *
+ * This function will insert a specified number of copies of
+ * the given data before the location specified by @a position.
+ *
+ * Note that this kind of operation could be expensive for a
+ * %vector and if it is frequently used the user should
+ * consider using std::list.
+ */
+ void
+ insert(iterator __position, size_type __n, const value_type& __x)
+ { _M_fill_insert(__position, __n, __x); }
+
+ /**
+ * @brief Inserts a range into the %vector.
+ * @param position An iterator into the %vector.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ *
+ * This function will insert copies of the data in the range
+ * [first,last) into the %vector before the location specified
+ * by @a pos.
+ *
+ * Note that this kind of operation could be expensive for a
+ * %vector and if it is frequently used the user should
+ * consider using std::list.
+ */
+ template<typename _InputIterator>
+ void
+ insert(iterator __position, _InputIterator __first,
+ _InputIterator __last)
+ {
+ // Check whether it's an integral type. If so, it's not an iterator.
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ _M_insert_dispatch(__position, __first, __last, _Integral());
+ }
+
+ /**
+ * @brief Remove element at given position.
+ * @param position Iterator pointing to element to be erased.
+ * @return An iterator pointing to the next element (or end()).
+ *
+ * This function will erase the element at the given position and thus
+ * shorten the %vector by one.
+ *
+ * Note This operation could be expensive and if it is
+ * frequently used the user should consider using std::list.
+ * The user is also cautioned that this function only erases
+ * the element, and that if the element is itself a pointer,
+ * the pointed-to memory is not touched in any way. Managing
+ * the pointer is the user's responsibility.
+ */
+ iterator
+ erase(iterator __position);
+
+ /**
+ * @brief Remove a range of elements.
+ * @param first Iterator pointing to the first element to be erased.
+ * @param last Iterator pointing to one past the last element to be
+ * erased.
+ * @return An iterator pointing to the element pointed to by @a last
+ * prior to erasing (or end()).
+ *
+ * This function will erase the elements in the range [first,last) and
+ * shorten the %vector accordingly.
+ *
+ * Note This operation could be expensive and if it is
+ * frequently used the user should consider using std::list.
+ * The user is also cautioned that this function only erases
+ * the elements, and that if the elements themselves are
+ * pointers, the pointed-to memory is not touched in any way.
+ * Managing the pointer is the user's responsibility.
+ */
+ iterator
+ erase(iterator __first, iterator __last);
+
+ /**
+ * @brief Swaps data with another %vector.
+ * @param x A %vector of the same element and allocator types.
+ *
+ * This exchanges the elements between two vectors in constant time.
+ * (Three pointers, so it should be quite fast.)
+ * Note that the global std::swap() function is specialized such that
+ * std::swap(v1,v2) will feed to this function.
+ */
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(vector&& __x)
+#else
+ swap(vector& __x)
+#endif
+ {
+ std::swap(this->_M_impl._M_start, __x._M_impl._M_start);
+ std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish);
+ std::swap(this->_M_impl._M_end_of_storage,
+ __x._M_impl._M_end_of_storage);
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 431. Swapping containers with unequal allocators.
+ std::__alloc_swap<_Tp_alloc_type>::_S_do_it(_M_get_Tp_allocator(),
+ __x._M_get_Tp_allocator());
+ }
+
+ /**
+ * Erases all the elements. Note that this function only erases the
+ * elements, and that if the elements themselves are pointers, the
+ * pointed-to memory is not touched in any way. Managing the pointer is
+ * the user's responsibility.
+ */
+ void
+ clear()
+ { _M_erase_at_end(this->_M_impl._M_start); }
+
+ protected:
+ /**
+ * Memory expansion handler. Uses the member allocation function to
+ * obtain @a n bytes of memory, and then copies [first,last) into it.
+ */
+ template<typename _ForwardIterator>
+ pointer
+ _M_allocate_and_copy(size_type __n,
+ _ForwardIterator __first, _ForwardIterator __last)
+ {
+ pointer __result = this->_M_allocate(__n);
+ __try
+ {
+ std::__uninitialized_copy_a(__first, __last, __result,
+ _M_get_Tp_allocator());
+ return __result;
+ }
+ __catch(...)
+ {
+ _M_deallocate(__result, __n);
+ __throw_exception_again;
+ }
+ }
+
+
+ // Internal constructor functions follow.
+
+ // Called by the range constructor to implement [23.1.1]/9
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 438. Ambiguity in the "do the right thing" clause
+ template<typename _Integer>
+ void
+ _M_initialize_dispatch(_Integer __n, _Integer __value, __true_type)
+ {
+ this->_M_impl._M_start = _M_allocate(static_cast<size_type>(__n));
+ this->_M_impl._M_end_of_storage =
+ this->_M_impl._M_start + static_cast<size_type>(__n);
+ _M_fill_initialize(static_cast<size_type>(__n), __value);
+ }
+
+ // Called by the range constructor to implement [23.1.1]/9
+ template<typename _InputIterator>
+ void
+ _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
+ __false_type)
+ {
+ typedef typename std::iterator_traits<_InputIterator>::
+ iterator_category _IterCategory;
+ _M_range_initialize(__first, __last, _IterCategory());
+ }
+
+ // Called by the second initialize_dispatch above
+ template<typename _InputIterator>
+ void
+ _M_range_initialize(_InputIterator __first,
+ _InputIterator __last, std::input_iterator_tag)
+ {
+ for (; __first != __last; ++__first)
+ push_back(*__first);
+ }
+
+ // Called by the second initialize_dispatch above
+ template<typename _ForwardIterator>
+ void
+ _M_range_initialize(_ForwardIterator __first,
+ _ForwardIterator __last, std::forward_iterator_tag)
+ {
+ const size_type __n = std::distance(__first, __last);
+ this->_M_impl._M_start = this->_M_allocate(__n);
+ this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
+ this->_M_impl._M_finish =
+ std::__uninitialized_copy_a(__first, __last,
+ this->_M_impl._M_start,
+ _M_get_Tp_allocator());
+ }
+
+ // Called by the first initialize_dispatch above and by the
+ // vector(n,value,a) constructor.
+ void
+ _M_fill_initialize(size_type __n, const value_type& __value)
+ {
+ std::__uninitialized_fill_n_a(this->_M_impl._M_start, __n, __value,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_finish = this->_M_impl._M_end_of_storage;
+ }
+
+
+ // Internal assign functions follow. The *_aux functions do the actual
+ // assignment work for the range versions.
+
+ // Called by the range assign to implement [23.1.1]/9
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 438. Ambiguity in the "do the right thing" clause
+ template<typename _Integer>
+ void
+ _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
+ { _M_fill_assign(__n, __val); }
+
+ // Called by the range assign to implement [23.1.1]/9
+ template<typename _InputIterator>
+ void
+ _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
+ __false_type)
+ {
+ typedef typename std::iterator_traits<_InputIterator>::
+ iterator_category _IterCategory;
+ _M_assign_aux(__first, __last, _IterCategory());
+ }
+
+ // Called by the second assign_dispatch above
+ template<typename _InputIterator>
+ void
+ _M_assign_aux(_InputIterator __first, _InputIterator __last,
+ std::input_iterator_tag);
+
+ // Called by the second assign_dispatch above
+ template<typename _ForwardIterator>
+ void
+ _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
+ std::forward_iterator_tag);
+
+ // Called by assign(n,t), and the range assign when it turns out
+ // to be the same thing.
+ void
+ _M_fill_assign(size_type __n, const value_type& __val);
+
+
+ // Internal insert functions follow.
+
+ // Called by the range insert to implement [23.1.1]/9
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 438. Ambiguity in the "do the right thing" clause
+ template<typename _Integer>
+ void
+ _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __val,
+ __true_type)
+ { _M_fill_insert(__pos, __n, __val); }
+
+ // Called by the range insert to implement [23.1.1]/9
+ template<typename _InputIterator>
+ void
+ _M_insert_dispatch(iterator __pos, _InputIterator __first,
+ _InputIterator __last, __false_type)
+ {
+ typedef typename std::iterator_traits<_InputIterator>::
+ iterator_category _IterCategory;
+ _M_range_insert(__pos, __first, __last, _IterCategory());
+ }
+
+ // Called by the second insert_dispatch above
+ template<typename _InputIterator>
+ void
+ _M_range_insert(iterator __pos, _InputIterator __first,
+ _InputIterator __last, std::input_iterator_tag);
+
+ // Called by the second insert_dispatch above
+ template<typename _ForwardIterator>
+ void
+ _M_range_insert(iterator __pos, _ForwardIterator __first,
+ _ForwardIterator __last, std::forward_iterator_tag);
+
+ // Called by insert(p,n,x), and the range insert when it turns out to be
+ // the same thing.
+ void
+ _M_fill_insert(iterator __pos, size_type __n, const value_type& __x);
+
+ // Called by insert(p,x)
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ _M_insert_aux(iterator __position, const value_type& __x);
+#else
+ template<typename... _Args>
+ void
+ _M_insert_aux(iterator __position, _Args&&... __args);
+#endif
+
+ // Called by the latter.
+ size_type
+ _M_check_len(size_type __n, const char* __s) const
+ {
+ if (max_size() - size() < __n)
+ __throw_length_error(__N(__s));
+
+ const size_type __len = size() + std::max(size(), __n);
+ return (__len < size() || __len > max_size()) ? max_size() : __len;
+ }
+
+ // Internal erase functions follow.
+
+ // Called by erase(q1,q2), clear(), resize(), _M_fill_assign,
+ // _M_assign_aux.
+ void
+ _M_erase_at_end(pointer __pos)
+ {
+ std::_Destroy(__pos, this->_M_impl._M_finish, _M_get_Tp_allocator());
+ this->_M_impl._M_finish = __pos;
+ }
+ };
+
+
+ /**
+ * @brief Vector equality comparison.
+ * @param x A %vector.
+ * @param y A %vector of the same type as @a x.
+ * @return True iff the size and elements of the vectors are equal.
+ *
+ * This is an equivalence relation. It is linear in the size of the
+ * vectors. Vectors are considered equivalent if their sizes are equal,
+ * and if corresponding elements compare equal.
+ */
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator==(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
+ { return (__x.size() == __y.size()
+ && std::equal(__x.begin(), __x.end(), __y.begin())); }
+
+ /**
+ * @brief Vector ordering relation.
+ * @param x A %vector.
+ * @param y A %vector of the same type as @a x.
+ * @return True iff @a x is lexicographically less than @a y.
+ *
+ * This is a total ordering relation. It is linear in the size of the
+ * vectors. The elements must be comparable with @c <.
+ *
+ * See std::lexicographical_compare() for how the determination is made.
+ */
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
+ { return std::lexicographical_compare(__x.begin(), __x.end(),
+ __y.begin(), __y.end()); }
+
+ /// Based on operator==
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator!=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
+ { return !(__x == __y); }
+
+ /// Based on operator<
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
+ { return __y < __x; }
+
+ /// Based on operator<
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
+ { return !(__y < __x); }
+
+ /// Based on operator<
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
+ { return !(__x < __y); }
+
+ /// See std::vector::swap().
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(vector<_Tp, _Alloc>& __x, vector<_Tp, _Alloc>& __y)
+ { __x.swap(__y); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(vector<_Tp, _Alloc>&& __x, vector<_Tp, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(vector<_Tp, _Alloc>& __x, vector<_Tp, _Alloc>&& __y)
+ { __x.swap(__y); }
+#endif
+
+_GLIBCXX_END_NESTED_NAMESPACE
+
+#endif /* _STL_VECTOR_H */
diff --git a/i686-linux/include/c++/4.4.3/bits/stream_iterator.h b/i686-linux/include/c++/4.4.3/bits/stream_iterator.h
new file mode 100644
index 0000000..fce6c26
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/stream_iterator.h
@@ -0,0 +1,211 @@
+// Stream iterators
+
+// Copyright (C) 2001, 2004, 2005, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file stream_iterator.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STREAM_ITERATOR_H
+#define _STREAM_ITERATOR_H 1
+
+#pragma GCC system_header
+
+#include <debug/debug.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /// Provides input iterator semantics for streams.
+ template<typename _Tp, typename _CharT = char,
+ typename _Traits = char_traits<_CharT>, typename _Dist = ptrdiff_t>
+ class istream_iterator
+ : public iterator<input_iterator_tag, _Tp, _Dist, const _Tp*, const _Tp&>
+ {
+ public:
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ typedef basic_istream<_CharT, _Traits> istream_type;
+
+ private:
+ istream_type* _M_stream;
+ _Tp _M_value;
+ bool _M_ok;
+
+ public:
+ /// Construct end of input stream iterator.
+ istream_iterator()
+ : _M_stream(0), _M_value(), _M_ok(false) {}
+
+ /// Construct start of input stream iterator.
+ istream_iterator(istream_type& __s)
+ : _M_stream(&__s)
+ { _M_read(); }
+
+ istream_iterator(const istream_iterator& __obj)
+ : _M_stream(__obj._M_stream), _M_value(__obj._M_value),
+ _M_ok(__obj._M_ok)
+ { }
+
+ const _Tp&
+ operator*() const
+ {
+ __glibcxx_requires_cond(_M_ok,
+ _M_message(__gnu_debug::__msg_deref_istream)
+ ._M_iterator(*this));
+ return _M_value;
+ }
+
+ const _Tp*
+ operator->() const { return &(operator*()); }
+
+ istream_iterator&
+ operator++()
+ {
+ __glibcxx_requires_cond(_M_ok,
+ _M_message(__gnu_debug::__msg_inc_istream)
+ ._M_iterator(*this));
+ _M_read();
+ return *this;
+ }
+
+ istream_iterator
+ operator++(int)
+ {
+ __glibcxx_requires_cond(_M_ok,
+ _M_message(__gnu_debug::__msg_inc_istream)
+ ._M_iterator(*this));
+ istream_iterator __tmp = *this;
+ _M_read();
+ return __tmp;
+ }
+
+ bool
+ _M_equal(const istream_iterator& __x) const
+ { return (_M_ok == __x._M_ok) && (!_M_ok || _M_stream == __x._M_stream); }
+
+ private:
+ void
+ _M_read()
+ {
+ _M_ok = (_M_stream && *_M_stream) ? true : false;
+ if (_M_ok)
+ {
+ *_M_stream >> _M_value;
+ _M_ok = *_M_stream ? true : false;
+ }
+ }
+ };
+
+ /// Return true if x and y are both end or not end, or x and y are the same.
+ template<typename _Tp, typename _CharT, typename _Traits, typename _Dist>
+ inline bool
+ operator==(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x,
+ const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __y)
+ { return __x._M_equal(__y); }
+
+ /// Return false if x and y are both end or not end, or x and y are the same.
+ template <class _Tp, class _CharT, class _Traits, class _Dist>
+ inline bool
+ operator!=(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x,
+ const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __y)
+ { return !__x._M_equal(__y); }
+
+ /**
+ * @brief Provides output iterator semantics for streams.
+ *
+ * This class provides an iterator to write to an ostream. The type Tp is
+ * the only type written by this iterator and there must be an
+ * operator<<(Tp) defined.
+ *
+ * @param Tp The type to write to the ostream.
+ * @param CharT The ostream char_type.
+ * @param Traits The ostream char_traits.
+ */
+ template<typename _Tp, typename _CharT = char,
+ typename _Traits = char_traits<_CharT> >
+ class ostream_iterator
+ : public iterator<output_iterator_tag, void, void, void, void>
+ {
+ public:
+ //@{
+ /// Public typedef
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ typedef basic_ostream<_CharT, _Traits> ostream_type;
+ //@}
+
+ private:
+ ostream_type* _M_stream;
+ const _CharT* _M_string;
+
+ public:
+ /// Construct from an ostream.
+ ostream_iterator(ostream_type& __s) : _M_stream(&__s), _M_string(0) {}
+
+ /**
+ * Construct from an ostream.
+ *
+ * The delimiter string @a c is written to the stream after every Tp
+ * written to the stream. The delimiter is not copied, and thus must
+ * not be destroyed while this iterator is in use.
+ *
+ * @param s Underlying ostream to write to.
+ * @param c CharT delimiter string to insert.
+ */
+ ostream_iterator(ostream_type& __s, const _CharT* __c)
+ : _M_stream(&__s), _M_string(__c) { }
+
+ /// Copy constructor.
+ ostream_iterator(const ostream_iterator& __obj)
+ : _M_stream(__obj._M_stream), _M_string(__obj._M_string) { }
+
+ /// Writes @a value to underlying ostream using operator<<. If
+ /// constructed with delimiter string, writes delimiter to ostream.
+ ostream_iterator&
+ operator=(const _Tp& __value)
+ {
+ __glibcxx_requires_cond(_M_stream != 0,
+ _M_message(__gnu_debug::__msg_output_ostream)
+ ._M_iterator(*this));
+ *_M_stream << __value;
+ if (_M_string) *_M_stream << _M_string;
+ return *this;
+ }
+
+ ostream_iterator&
+ operator*()
+ { return *this; }
+
+ ostream_iterator&
+ operator++()
+ { return *this; }
+
+ ostream_iterator&
+ operator++(int)
+ { return *this; }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/bits/streambuf.tcc b/i686-linux/include/c++/4.4.3/bits/streambuf.tcc
new file mode 100644
index 0000000..f3e6ce7
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/streambuf.tcc
@@ -0,0 +1,174 @@
+// Stream buffer classes -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file streambuf.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 27.5 Stream buffers
+//
+
+#ifndef _STREAMBUF_TCC
+#define _STREAMBUF_TCC 1
+
+#pragma GCC system_header
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _CharT, typename _Traits>
+ streamsize
+ basic_streambuf<_CharT, _Traits>::
+ xsgetn(char_type* __s, streamsize __n)
+ {
+ streamsize __ret = 0;
+ while (__ret < __n)
+ {
+ const streamsize __buf_len = this->egptr() - this->gptr();
+ if (__buf_len)
+ {
+ const streamsize __remaining = __n - __ret;
+ const streamsize __len = std::min(__buf_len, __remaining);
+ traits_type::copy(__s, this->gptr(), __len);
+ __ret += __len;
+ __s += __len;
+ this->gbump(__len);
+ }
+
+ if (__ret < __n)
+ {
+ const int_type __c = this->uflow();
+ if (!traits_type::eq_int_type(__c, traits_type::eof()))
+ {
+ traits_type::assign(*__s++, traits_type::to_char_type(__c));
+ ++__ret;
+ }
+ else
+ break;
+ }
+ }
+ return __ret;
+ }
+
+ template<typename _CharT, typename _Traits>
+ streamsize
+ basic_streambuf<_CharT, _Traits>::
+ xsputn(const char_type* __s, streamsize __n)
+ {
+ streamsize __ret = 0;
+ while (__ret < __n)
+ {
+ const streamsize __buf_len = this->epptr() - this->pptr();
+ if (__buf_len)
+ {
+ const streamsize __remaining = __n - __ret;
+ const streamsize __len = std::min(__buf_len, __remaining);
+ traits_type::copy(this->pptr(), __s, __len);
+ __ret += __len;
+ __s += __len;
+ this->pbump(__len);
+ }
+
+ if (__ret < __n)
+ {
+ int_type __c = this->overflow(traits_type::to_int_type(*__s));
+ if (!traits_type::eq_int_type(__c, traits_type::eof()))
+ {
+ ++__ret;
+ ++__s;
+ }
+ else
+ break;
+ }
+ }
+ return __ret;
+ }
+
+ // Conceivably, this could be used to implement buffer-to-buffer
+ // copies, if this was ever desired in an un-ambiguous way by the
+ // standard.
+ template<typename _CharT, typename _Traits>
+ streamsize
+ __copy_streambufs_eof(basic_streambuf<_CharT, _Traits>* __sbin,
+ basic_streambuf<_CharT, _Traits>* __sbout,
+ bool& __ineof)
+ {
+ streamsize __ret = 0;
+ __ineof = true;
+ typename _Traits::int_type __c = __sbin->sgetc();
+ while (!_Traits::eq_int_type(__c, _Traits::eof()))
+ {
+ __c = __sbout->sputc(_Traits::to_char_type(__c));
+ if (_Traits::eq_int_type(__c, _Traits::eof()))
+ {
+ __ineof = false;
+ break;
+ }
+ ++__ret;
+ __c = __sbin->snextc();
+ }
+ return __ret;
+ }
+
+ template<typename _CharT, typename _Traits>
+ inline streamsize
+ __copy_streambufs(basic_streambuf<_CharT, _Traits>* __sbin,
+ basic_streambuf<_CharT, _Traits>* __sbout)
+ {
+ bool __ineof;
+ return __copy_streambufs_eof(__sbin, __sbout, __ineof);
+ }
+
+ // Inhibit implicit instantiations for required instantiations,
+ // which are defined via explicit instantiations elsewhere.
+ // NB: This syntax is a GNU extension.
+#if _GLIBCXX_EXTERN_TEMPLATE
+ extern template class basic_streambuf<char>;
+ extern template
+ streamsize
+ __copy_streambufs(basic_streambuf<char>*,
+ basic_streambuf<char>*);
+ extern template
+ streamsize
+ __copy_streambufs_eof(basic_streambuf<char>*,
+ basic_streambuf<char>*, bool&);
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ extern template class basic_streambuf<wchar_t>;
+ extern template
+ streamsize
+ __copy_streambufs(basic_streambuf<wchar_t>*,
+ basic_streambuf<wchar_t>*);
+ extern template
+ streamsize
+ __copy_streambufs_eof(basic_streambuf<wchar_t>*,
+ basic_streambuf<wchar_t>*, bool&);
+#endif
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/bits/streambuf_iterator.h b/i686-linux/include/c++/4.4.3/bits/streambuf_iterator.h
new file mode 100644
index 0000000..d02b555
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/streambuf_iterator.h
@@ -0,0 +1,392 @@
+// Streambuf iterators
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file streambuf_iterator.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STREAMBUF_ITERATOR_H
+#define _STREAMBUF_ITERATOR_H 1
+
+#pragma GCC system_header
+
+#include <streambuf>
+#include <debug/debug.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // 24.5.3 Template class istreambuf_iterator
+ /// Provides input iterator semantics for streambufs.
+ template<typename _CharT, typename _Traits>
+ class istreambuf_iterator
+ : public iterator<input_iterator_tag, _CharT, typename _Traits::off_type,
+ _CharT*, _CharT&>
+ {
+ public:
+ // Types:
+ //@{
+ /// Public typedefs
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ typedef typename _Traits::int_type int_type;
+ typedef basic_streambuf<_CharT, _Traits> streambuf_type;
+ typedef basic_istream<_CharT, _Traits> istream_type;
+ //@}
+
+ template<typename _CharT2>
+ friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
+ ostreambuf_iterator<_CharT2> >::__type
+ copy(istreambuf_iterator<_CharT2>, istreambuf_iterator<_CharT2>,
+ ostreambuf_iterator<_CharT2>);
+
+ template<bool _IsMove, typename _CharT2>
+ friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
+ _CharT2*>::__type
+ __copy_move_a2(istreambuf_iterator<_CharT2>,
+ istreambuf_iterator<_CharT2>, _CharT2*);
+
+ template<typename _CharT2>
+ friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
+ istreambuf_iterator<_CharT2> >::__type
+ find(istreambuf_iterator<_CharT2>, istreambuf_iterator<_CharT2>,
+ const _CharT2&);
+
+ private:
+ // 24.5.3 istreambuf_iterator
+ // p 1
+ // If the end of stream is reached (streambuf_type::sgetc()
+ // returns traits_type::eof()), the iterator becomes equal to
+ // the "end of stream" iterator value.
+ // NB: This implementation assumes the "end of stream" value
+ // is EOF, or -1.
+ mutable streambuf_type* _M_sbuf;
+ mutable int_type _M_c;
+
+ public:
+ /// Construct end of input stream iterator.
+ istreambuf_iterator() throw()
+ : _M_sbuf(0), _M_c(traits_type::eof()) { }
+
+ /// Construct start of input stream iterator.
+ istreambuf_iterator(istream_type& __s) throw()
+ : _M_sbuf(__s.rdbuf()), _M_c(traits_type::eof()) { }
+
+ /// Construct start of streambuf iterator.
+ istreambuf_iterator(streambuf_type* __s) throw()
+ : _M_sbuf(__s), _M_c(traits_type::eof()) { }
+
+ /// Return the current character pointed to by iterator. This returns
+ /// streambuf.sgetc(). It cannot be assigned. NB: The result of
+ /// operator*() on an end of stream is undefined.
+ char_type
+ operator*() const
+ {
+#ifdef _GLIBCXX_DEBUG_PEDANTIC
+ // Dereferencing a past-the-end istreambuf_iterator is a
+ // libstdc++ extension
+ __glibcxx_requires_cond(!_M_at_eof(),
+ _M_message(__gnu_debug::__msg_deref_istreambuf)
+ ._M_iterator(*this));
+#endif
+ return traits_type::to_char_type(_M_get());
+ }
+
+ /// Advance the iterator. Calls streambuf.sbumpc().
+ istreambuf_iterator&
+ operator++()
+ {
+ __glibcxx_requires_cond(!_M_at_eof(),
+ _M_message(__gnu_debug::__msg_inc_istreambuf)
+ ._M_iterator(*this));
+ if (_M_sbuf)
+ {
+ _M_sbuf->sbumpc();
+ _M_c = traits_type::eof();
+ }
+ return *this;
+ }
+
+ /// Advance the iterator. Calls streambuf.sbumpc().
+ istreambuf_iterator
+ operator++(int)
+ {
+ __glibcxx_requires_cond(!_M_at_eof(),
+ _M_message(__gnu_debug::__msg_inc_istreambuf)
+ ._M_iterator(*this));
+
+ istreambuf_iterator __old = *this;
+ if (_M_sbuf)
+ {
+ __old._M_c = _M_sbuf->sbumpc();
+ _M_c = traits_type::eof();
+ }
+ return __old;
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 110 istreambuf_iterator::equal not const
+ // NB: there is also number 111 (NAD, Future) pending on this function.
+ /// Return true both iterators are end or both are not end.
+ bool
+ equal(const istreambuf_iterator& __b) const
+ { return _M_at_eof() == __b._M_at_eof(); }
+
+ private:
+ int_type
+ _M_get() const
+ {
+ const int_type __eof = traits_type::eof();
+ int_type __ret = __eof;
+ if (_M_sbuf)
+ {
+ if (!traits_type::eq_int_type(_M_c, __eof))
+ __ret = _M_c;
+ else if (!traits_type::eq_int_type((__ret = _M_sbuf->sgetc()),
+ __eof))
+ _M_c = __ret;
+ else
+ _M_sbuf = 0;
+ }
+ return __ret;
+ }
+
+ bool
+ _M_at_eof() const
+ {
+ const int_type __eof = traits_type::eof();
+ return traits_type::eq_int_type(_M_get(), __eof);
+ }
+ };
+
+ template<typename _CharT, typename _Traits>
+ inline bool
+ operator==(const istreambuf_iterator<_CharT, _Traits>& __a,
+ const istreambuf_iterator<_CharT, _Traits>& __b)
+ { return __a.equal(__b); }
+
+ template<typename _CharT, typename _Traits>
+ inline bool
+ operator!=(const istreambuf_iterator<_CharT, _Traits>& __a,
+ const istreambuf_iterator<_CharT, _Traits>& __b)
+ { return !__a.equal(__b); }
+
+ /// Provides output iterator semantics for streambufs.
+ template<typename _CharT, typename _Traits>
+ class ostreambuf_iterator
+ : public iterator<output_iterator_tag, void, void, void, void>
+ {
+ public:
+ // Types:
+ //@{
+ /// Public typedefs
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ typedef basic_streambuf<_CharT, _Traits> streambuf_type;
+ typedef basic_ostream<_CharT, _Traits> ostream_type;
+ //@}
+
+ template<typename _CharT2>
+ friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
+ ostreambuf_iterator<_CharT2> >::__type
+ copy(istreambuf_iterator<_CharT2>, istreambuf_iterator<_CharT2>,
+ ostreambuf_iterator<_CharT2>);
+
+ private:
+ streambuf_type* _M_sbuf;
+ bool _M_failed;
+
+ public:
+ /// Construct output iterator from ostream.
+ ostreambuf_iterator(ostream_type& __s) throw ()
+ : _M_sbuf(__s.rdbuf()), _M_failed(!_M_sbuf) { }
+
+ /// Construct output iterator from streambuf.
+ ostreambuf_iterator(streambuf_type* __s) throw ()
+ : _M_sbuf(__s), _M_failed(!_M_sbuf) { }
+
+ /// Write character to streambuf. Calls streambuf.sputc().
+ ostreambuf_iterator&
+ operator=(_CharT __c)
+ {
+ if (!_M_failed &&
+ _Traits::eq_int_type(_M_sbuf->sputc(__c), _Traits::eof()))
+ _M_failed = true;
+ return *this;
+ }
+
+ /// Return *this.
+ ostreambuf_iterator&
+ operator*()
+ { return *this; }
+
+ /// Return *this.
+ ostreambuf_iterator&
+ operator++(int)
+ { return *this; }
+
+ /// Return *this.
+ ostreambuf_iterator&
+ operator++()
+ { return *this; }
+
+ /// Return true if previous operator=() failed.
+ bool
+ failed() const throw()
+ { return _M_failed; }
+
+ ostreambuf_iterator&
+ _M_put(const _CharT* __ws, streamsize __len)
+ {
+ if (__builtin_expect(!_M_failed, true)
+ && __builtin_expect(this->_M_sbuf->sputn(__ws, __len) != __len,
+ false))
+ _M_failed = true;
+ return *this;
+ }
+ };
+
+ // Overloads for streambuf iterators.
+ template<typename _CharT>
+ typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+ ostreambuf_iterator<_CharT> >::__type
+ copy(istreambuf_iterator<_CharT> __first,
+ istreambuf_iterator<_CharT> __last,
+ ostreambuf_iterator<_CharT> __result)
+ {
+ if (__first._M_sbuf && !__last._M_sbuf && !__result._M_failed)
+ {
+ bool __ineof;
+ __copy_streambufs_eof(__first._M_sbuf, __result._M_sbuf, __ineof);
+ if (!__ineof)
+ __result._M_failed = true;
+ }
+ return __result;
+ }
+
+ template<bool _IsMove, typename _CharT>
+ typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+ ostreambuf_iterator<_CharT> >::__type
+ __copy_move_a2(_CharT* __first, _CharT* __last,
+ ostreambuf_iterator<_CharT> __result)
+ {
+ const streamsize __num = __last - __first;
+ if (__num > 0)
+ __result._M_put(__first, __num);
+ return __result;
+ }
+
+ template<bool _IsMove, typename _CharT>
+ typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+ ostreambuf_iterator<_CharT> >::__type
+ __copy_move_a2(const _CharT* __first, const _CharT* __last,
+ ostreambuf_iterator<_CharT> __result)
+ {
+ const streamsize __num = __last - __first;
+ if (__num > 0)
+ __result._M_put(__first, __num);
+ return __result;
+ }
+
+ template<bool _IsMove, typename _CharT>
+ typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+ _CharT*>::__type
+ __copy_move_a2(istreambuf_iterator<_CharT> __first,
+ istreambuf_iterator<_CharT> __last, _CharT* __result)
+ {
+ typedef istreambuf_iterator<_CharT> __is_iterator_type;
+ typedef typename __is_iterator_type::traits_type traits_type;
+ typedef typename __is_iterator_type::streambuf_type streambuf_type;
+ typedef typename traits_type::int_type int_type;
+
+ if (__first._M_sbuf && !__last._M_sbuf)
+ {
+ streambuf_type* __sb = __first._M_sbuf;
+ int_type __c = __sb->sgetc();
+ while (!traits_type::eq_int_type(__c, traits_type::eof()))
+ {
+ const streamsize __n = __sb->egptr() - __sb->gptr();
+ if (__n > 1)
+ {
+ traits_type::copy(__result, __sb->gptr(), __n);
+ __sb->gbump(__n);
+ __result += __n;
+ __c = __sb->underflow();
+ }
+ else
+ {
+ *__result++ = traits_type::to_char_type(__c);
+ __c = __sb->snextc();
+ }
+ }
+ }
+ return __result;
+ }
+
+ template<typename _CharT>
+ typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+ istreambuf_iterator<_CharT> >::__type
+ find(istreambuf_iterator<_CharT> __first,
+ istreambuf_iterator<_CharT> __last, const _CharT& __val)
+ {
+ typedef istreambuf_iterator<_CharT> __is_iterator_type;
+ typedef typename __is_iterator_type::traits_type traits_type;
+ typedef typename __is_iterator_type::streambuf_type streambuf_type;
+ typedef typename traits_type::int_type int_type;
+
+ if (__first._M_sbuf && !__last._M_sbuf)
+ {
+ const int_type __ival = traits_type::to_int_type(__val);
+ streambuf_type* __sb = __first._M_sbuf;
+ int_type __c = __sb->sgetc();
+ while (!traits_type::eq_int_type(__c, traits_type::eof())
+ && !traits_type::eq_int_type(__c, __ival))
+ {
+ streamsize __n = __sb->egptr() - __sb->gptr();
+ if (__n > 1)
+ {
+ const _CharT* __p = traits_type::find(__sb->gptr(),
+ __n, __val);
+ if (__p)
+ __n = __p - __sb->gptr();
+ __sb->gbump(__n);
+ __c = __sb->sgetc();
+ }
+ else
+ __c = __sb->snextc();
+ }
+
+ if (!traits_type::eq_int_type(__c, traits_type::eof()))
+ __first._M_c = __c;
+ else
+ __first._M_sbuf = 0;
+ }
+ return __first;
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/bits/stringfwd.h b/i686-linux/include/c++/4.4.3/bits/stringfwd.h
new file mode 100644
index 0000000..c63e777
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/stringfwd.h
@@ -0,0 +1,77 @@
+// String support -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file stringfwd.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 21 Strings library
+//
+
+#ifndef _STRINGFWD_H
+#define _STRINGFWD_H 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _Alloc>
+ class allocator;
+
+ template<class _CharT>
+ struct char_traits;
+
+ template<typename _CharT, typename _Traits = char_traits<_CharT>,
+ typename _Alloc = allocator<_CharT> >
+ class basic_string;
+
+ template<> struct char_traits<char>;
+
+ typedef basic_string<char> string;
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template<> struct char_traits<wchar_t>;
+
+ typedef basic_string<wchar_t> wstring;
+#endif
+
+#if (defined(__GXX_EXPERIMENTAL_CXX0X__) \
+ && defined(_GLIBCXX_USE_C99_STDINT_TR1))
+
+ template<> struct char_traits<char16_t>;
+ template<> struct char_traits<char32_t>;
+
+ typedef basic_string<char16_t> u16string;
+ typedef basic_string<char32_t> u32string;
+
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif // _STRINGFWD_H
diff --git a/i686-linux/include/c++/4.4.3/bits/unique_ptr.h b/i686-linux/include/c++/4.4.3/bits/unique_ptr.h
new file mode 100644
index 0000000..b686d11
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/unique_ptr.h
@@ -0,0 +1,450 @@
+// unique_ptr implementation -*- C++ -*-
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file unique_ptr.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _UNIQUE_PTR_H
+#define _UNIQUE_PTR_H 1
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#endif
+
+#include <bits/c++config.h>
+#include <debug/debug.h>
+#include <type_traits>
+#include <utility>
+#include <tuple>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @addtogroup pointer_abstractions
+ * @{
+ */
+
+ /// Primary template, default_delete.
+ template<typename _Tp>
+ struct default_delete
+ {
+ default_delete() { }
+
+ template<typename _Up>
+ default_delete(const default_delete<_Up>&) { }
+
+ void
+ operator()(_Tp* __ptr) const
+ {
+ static_assert(sizeof(_Tp)>0,
+ "can't delete pointer to incomplete type");
+ delete __ptr;
+ }
+ };
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 740 - omit specialization for array objects with a compile time length
+ /// Specialization, default_delete.
+ template<typename _Tp>
+ struct default_delete<_Tp[]>
+ {
+ void
+ operator()(_Tp* __ptr) const
+ {
+ static_assert(sizeof(_Tp)>0,
+ "can't delete pointer to incomplete type");
+ delete [] __ptr;
+ }
+ };
+
+ /// 20.7.12.2 unique_ptr for single objects.
+ template <typename _Tp, typename _Tp_Deleter = default_delete<_Tp> >
+ class unique_ptr
+ {
+ typedef std::tuple<_Tp*, _Tp_Deleter> __tuple_type;
+ typedef __tuple_type unique_ptr::* __unspecified_bool_type;
+ typedef _Tp* unique_ptr::* __unspecified_pointer_type;
+
+ public:
+ typedef _Tp* pointer;
+ typedef _Tp element_type;
+ typedef _Tp_Deleter deleter_type;
+
+ // Constructors.
+ unique_ptr()
+ : _M_t(pointer(), deleter_type())
+ { static_assert(!std::is_pointer<deleter_type>::value,
+ "constructed with null function pointer deleter"); }
+
+ explicit
+ unique_ptr(pointer __p)
+ : _M_t(__p, deleter_type())
+ { static_assert(!std::is_pointer<deleter_type>::value,
+ "constructed with null function pointer deleter"); }
+
+ unique_ptr(pointer __p,
+ typename std::conditional<std::is_reference<deleter_type>::value,
+ deleter_type, const deleter_type&>::type __d)
+ : _M_t(__p, __d) { }
+
+ unique_ptr(pointer __p,
+ typename std::remove_reference<deleter_type>::type&& __d)
+ : _M_t(std::move(__p), std::move(__d))
+ { static_assert(!std::is_reference<deleter_type>::value,
+ "rvalue deleter bound to reference"); }
+
+ // Move constructors.
+ unique_ptr(unique_ptr&& __u)
+ : _M_t(__u.release(), std::forward<deleter_type>(__u.get_deleter())) { }
+
+ template<typename _Up, typename _Up_Deleter>
+ unique_ptr(unique_ptr<_Up, _Up_Deleter>&& __u)
+ : _M_t(__u.release(), std::forward<deleter_type>(__u.get_deleter()))
+ { }
+
+ // Destructor.
+ ~unique_ptr() { reset(); }
+
+ // Assignment.
+ unique_ptr&
+ operator=(unique_ptr&& __u)
+ {
+ reset(__u.release());
+ get_deleter() = std::move(__u.get_deleter());
+ return *this;
+ }
+
+ template<typename _Up, typename _Up_Deleter>
+ unique_ptr&
+ operator=(unique_ptr<_Up, _Up_Deleter>&& __u)
+ {
+ reset(__u.release());
+ get_deleter() = std::move(__u.get_deleter());
+ return *this;
+ }
+
+ unique_ptr&
+ operator=(__unspecified_pointer_type)
+ {
+ reset();
+ return *this;
+ }
+
+ // Observers.
+ typename std::add_lvalue_reference<element_type>::type operator*() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(get() != 0);
+ return *get();
+ }
+
+ pointer
+ operator->() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(get() != 0);
+ return get();
+ }
+
+ pointer
+ get() const
+ { return std::get<0>(_M_t); }
+
+ typename std::add_lvalue_reference<deleter_type>::type
+ get_deleter()
+ { return std::get<1>(_M_t); }
+
+ typename std::add_lvalue_reference<
+ typename std::add_const<deleter_type>::type
+ >::type
+ get_deleter() const
+ { return std::get<1>(_M_t); }
+
+ operator __unspecified_bool_type () const
+ { return get() == 0 ? 0 : &unique_ptr::_M_t; }
+
+ // Modifiers.
+ pointer
+ release()
+ {
+ pointer __p = get();
+ std::get<0>(_M_t) = 0;
+ return __p;
+ }
+
+ void
+ reset(pointer __p = pointer())
+ {
+ if (__p != get())
+ {
+ get_deleter()(get());
+ std::get<0>(_M_t) = __p;
+ }
+ }
+
+ void
+ swap(unique_ptr&& __u)
+ {
+ using std::swap;
+ swap(_M_t, __u._M_t);
+ }
+
+ // Disable copy from lvalue.
+ unique_ptr(const unique_ptr&) = delete;
+
+ template<typename _Up, typename _Up_Deleter>
+ unique_ptr(const unique_ptr<_Up, _Up_Deleter>&) = delete;
+
+ unique_ptr& operator=(const unique_ptr&) = delete;
+
+ template<typename _Up, typename _Up_Deleter>
+ unique_ptr& operator=(const unique_ptr<_Up, _Up_Deleter>&) = delete;
+
+ private:
+ __tuple_type _M_t;
+ };
+
+ /// 20.7.12.3 unique_ptr for array objects with a runtime length
+ // [unique.ptr.runtime]
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 740 - omit specialization for array objects with a compile time length
+ template<typename _Tp, typename _Tp_Deleter>
+ class unique_ptr<_Tp[], _Tp_Deleter>
+ {
+ typedef std::tuple<_Tp*, _Tp_Deleter> __tuple_type;
+ typedef __tuple_type unique_ptr::* __unspecified_bool_type;
+ typedef _Tp* unique_ptr::* __unspecified_pointer_type;
+
+ public:
+ typedef _Tp* pointer;
+ typedef _Tp element_type;
+ typedef _Tp_Deleter deleter_type;
+
+ // Constructors.
+ unique_ptr()
+ : _M_t(pointer(), deleter_type())
+ { static_assert(!std::is_pointer<deleter_type>::value,
+ "constructed with null function pointer deleter"); }
+
+ explicit
+ unique_ptr(pointer __p)
+ : _M_t(__p, deleter_type())
+ { static_assert(!std::is_pointer<deleter_type>::value,
+ "constructed with null function pointer deleter"); }
+
+ unique_ptr(pointer __p,
+ typename std::conditional<std::is_reference<deleter_type>::value,
+ deleter_type, const deleter_type&>::type __d)
+ : _M_t(__p, __d) { }
+
+ unique_ptr(pointer __p,
+ typename std::remove_reference<deleter_type>::type && __d)
+ : _M_t(std::move(__p), std::move(__d))
+ { static_assert(!std::is_reference<deleter_type>::value,
+ "rvalue deleter bound to reference"); }
+
+ // Move constructors.
+ unique_ptr(unique_ptr&& __u)
+ : _M_t(__u.release(), std::forward<deleter_type>(__u.get_deleter())) { }
+
+ template<typename _Up, typename _Up_Deleter>
+ unique_ptr(unique_ptr<_Up, _Up_Deleter>&& __u)
+ : _M_t(__u.release(), std::forward<deleter_type>(__u.get_deleter()))
+ { }
+
+ // Destructor.
+ ~unique_ptr() { reset(); }
+
+ // Assignment.
+ unique_ptr&
+ operator=(unique_ptr&& __u)
+ {
+ reset(__u.release());
+ get_deleter() = std::move(__u.get_deleter());
+ return *this;
+ }
+
+ template<typename _Up, typename _Up_Deleter>
+ unique_ptr&
+ operator=(unique_ptr<_Up, _Up_Deleter>&& __u)
+ {
+ reset(__u.release());
+ get_deleter() = std::move(__u.get_deleter());
+ return *this;
+ }
+
+ unique_ptr&
+ operator=(__unspecified_pointer_type)
+ {
+ reset();
+ return *this;
+ }
+
+ // Observers.
+ typename std::add_lvalue_reference<element_type>::type
+ operator[](size_t __i) const
+ {
+ _GLIBCXX_DEBUG_ASSERT(get() != 0);
+ return get()[__i];
+ }
+
+ pointer
+ get() const
+ { return std::get<0>(_M_t); }
+
+ typename std::add_lvalue_reference<deleter_type>::type
+ get_deleter()
+ { return std::get<1>(_M_t); }
+
+ typename std::add_lvalue_reference<
+ typename std::add_const<deleter_type>::type
+ >::type
+ get_deleter() const
+ { return std::get<1>(_M_t); }
+
+ operator __unspecified_bool_type () const
+ { return get() == 0 ? 0 : &unique_ptr::_M_t; }
+
+ // Modifiers.
+ pointer
+ release()
+ {
+ pointer __p = get();
+ std::get<0>(_M_t) = 0;
+ return __p;
+ }
+
+ void
+ reset(pointer __p = pointer())
+ {
+ if (__p != get())
+ {
+ get_deleter()(get());
+ std::get<0>(_M_t) = __p;
+ }
+ }
+
+ // DR 821.
+ template<typename _Up>
+ void reset(_Up) = delete;
+
+ void
+ swap(unique_ptr&& __u)
+ {
+ using std::swap;
+ swap(_M_t, __u._M_t);
+ }
+
+ // Disable copy from lvalue.
+ unique_ptr(const unique_ptr&) = delete;
+ unique_ptr& operator=(const unique_ptr&) = delete;
+
+ // Disable construction from convertible pointer types.
+ // (N2315 - 20.6.5.3.1)
+ template<typename _Up>
+ unique_ptr(_Up*, typename
+ std::conditional<std::is_reference<deleter_type>::value,
+ deleter_type, const deleter_type&>::type,
+ typename std::enable_if<std::is_convertible<_Up*,
+ pointer>::value>::type* = 0) = delete;
+
+ template<typename _Up>
+ unique_ptr(_Up*, typename std::remove_reference<deleter_type>::type&&,
+ typename std::enable_if<std::is_convertible<_Up*,
+ pointer>::value>::type* = 0) = delete;
+
+ template<typename _Up>
+ explicit
+ unique_ptr(_Up*, typename std::enable_if<std::is_convertible<_Up*,
+ pointer>::value>::type* = 0) = delete;
+
+ private:
+ __tuple_type _M_t;
+ };
+
+ template<typename _Tp, typename _Tp_Deleter>
+ inline void
+ swap(unique_ptr<_Tp, _Tp_Deleter>& __x,
+ unique_ptr<_Tp, _Tp_Deleter>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Tp, typename _Tp_Deleter>
+ inline void
+ swap(unique_ptr<_Tp, _Tp_Deleter>&& __x,
+ unique_ptr<_Tp, _Tp_Deleter>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Tp, typename _Tp_Deleter>
+ inline void
+ swap(unique_ptr<_Tp, _Tp_Deleter>& __x,
+ unique_ptr<_Tp, _Tp_Deleter>&& __y)
+ { __x.swap(__y); }
+
+ template<typename _Tp, typename _Tp_Deleter,
+ typename _Up, typename _Up_Deleter>
+ inline bool
+ operator==(const unique_ptr<_Tp, _Tp_Deleter>& __x,
+ const unique_ptr<_Up, _Up_Deleter>& __y)
+ { return __x.get() == __y.get(); }
+
+ template<typename _Tp, typename _Tp_Deleter,
+ typename _Up, typename _Up_Deleter>
+ inline bool
+ operator!=(const unique_ptr<_Tp, _Tp_Deleter>& __x,
+ const unique_ptr<_Up, _Up_Deleter>& __y)
+ { return !(__x.get() == __y.get()); }
+
+ template<typename _Tp, typename _Tp_Deleter,
+ typename _Up, typename _Up_Deleter>
+ inline bool
+ operator<(const unique_ptr<_Tp, _Tp_Deleter>& __x,
+ const unique_ptr<_Up, _Up_Deleter>& __y)
+ { return __x.get() < __y.get(); }
+
+ template<typename _Tp, typename _Tp_Deleter,
+ typename _Up, typename _Up_Deleter>
+ inline bool
+ operator<=(const unique_ptr<_Tp, _Tp_Deleter>& __x,
+ const unique_ptr<_Up, _Up_Deleter>& __y)
+ { return !(__y.get() < __x.get()); }
+
+ template<typename _Tp, typename _Tp_Deleter,
+ typename _Up, typename _Up_Deleter>
+ inline bool
+ operator>(const unique_ptr<_Tp, _Tp_Deleter>& __x,
+ const unique_ptr<_Up, _Up_Deleter>& __y)
+ { return __y.get() < __x.get(); }
+
+ template<typename _Tp, typename _Tp_Deleter,
+ typename _Up, typename _Up_Deleter>
+ inline bool
+ operator>=(const unique_ptr<_Tp, _Tp_Deleter>& __x,
+ const unique_ptr<_Up, _Up_Deleter>& __y)
+ { return !(__x.get() < __y.get()); }
+
+ // @} group pointer_abstractions
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _UNIQUE_PTR_H */
diff --git a/i686-linux/include/c++/4.4.3/bits/valarray_after.h b/i686-linux/include/c++/4.4.3/bits/valarray_after.h
new file mode 100644
index 0000000..e4093f1
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/valarray_after.h
@@ -0,0 +1,549 @@
+// The template and inlines for the -*- C++ -*- internal _Meta class.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file valarray_after.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@cmla.ens-cachan.fr>
+
+#ifndef _VALARRAY_AFTER_H
+#define _VALARRAY_AFTER_H 1
+
+#pragma GCC system_header
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ //
+ // gslice_array closure.
+ //
+ template<class _Dom>
+ class _GBase
+ {
+ public:
+ typedef typename _Dom::value_type value_type;
+
+ _GBase (const _Dom& __e, const valarray<size_t>& __i)
+ : _M_expr (__e), _M_index(__i) {}
+
+ value_type
+ operator[] (size_t __i) const
+ { return _M_expr[_M_index[__i]]; }
+
+ size_t
+ size () const
+ { return _M_index.size(); }
+
+ private:
+ const _Dom& _M_expr;
+ const valarray<size_t>& _M_index;
+ };
+
+ template<typename _Tp>
+ class _GBase<_Array<_Tp> >
+ {
+ public:
+ typedef _Tp value_type;
+
+ _GBase (_Array<_Tp> __a, const valarray<size_t>& __i)
+ : _M_array (__a), _M_index(__i) {}
+
+ value_type
+ operator[] (size_t __i) const
+ { return _M_array._M_data[_M_index[__i]]; }
+
+ size_t
+ size () const
+ { return _M_index.size(); }
+
+ private:
+ const _Array<_Tp> _M_array;
+ const valarray<size_t>& _M_index;
+ };
+
+ template<class _Dom>
+ struct _GClos<_Expr, _Dom>
+ : _GBase<_Dom>
+ {
+ typedef _GBase<_Dom> _Base;
+ typedef typename _Base::value_type value_type;
+
+ _GClos (const _Dom& __e, const valarray<size_t>& __i)
+ : _Base (__e, __i) {}
+ };
+
+ template<typename _Tp>
+ struct _GClos<_ValArray, _Tp>
+ : _GBase<_Array<_Tp> >
+ {
+ typedef _GBase<_Array<_Tp> > _Base;
+ typedef typename _Base::value_type value_type;
+
+ _GClos (_Array<_Tp> __a, const valarray<size_t>& __i)
+ : _Base (__a, __i) {}
+ };
+
+ //
+ // indirect_array closure
+ //
+ template<class _Dom>
+ class _IBase
+ {
+ public:
+ typedef typename _Dom::value_type value_type;
+
+ _IBase (const _Dom& __e, const valarray<size_t>& __i)
+ : _M_expr (__e), _M_index (__i) {}
+
+ value_type
+ operator[] (size_t __i) const
+ { return _M_expr[_M_index[__i]]; }
+
+ size_t
+ size() const
+ { return _M_index.size(); }
+
+ private:
+ const _Dom& _M_expr;
+ const valarray<size_t>& _M_index;
+ };
+
+ template<class _Dom>
+ struct _IClos<_Expr, _Dom>
+ : _IBase<_Dom>
+ {
+ typedef _IBase<_Dom> _Base;
+ typedef typename _Base::value_type value_type;
+
+ _IClos (const _Dom& __e, const valarray<size_t>& __i)
+ : _Base (__e, __i) {}
+ };
+
+ template<typename _Tp>
+ struct _IClos<_ValArray, _Tp>
+ : _IBase<valarray<_Tp> >
+ {
+ typedef _IBase<valarray<_Tp> > _Base;
+ typedef _Tp value_type;
+
+ _IClos (const valarray<_Tp>& __a, const valarray<size_t>& __i)
+ : _Base (__a, __i) {}
+ };
+
+ //
+ // class _Expr
+ //
+ template<class _Clos, typename _Tp>
+ class _Expr
+ {
+ public:
+ typedef _Tp value_type;
+
+ _Expr(const _Clos&);
+
+ const _Clos& operator()() const;
+
+ value_type operator[](size_t) const;
+ valarray<value_type> operator[](slice) const;
+ valarray<value_type> operator[](const gslice&) const;
+ valarray<value_type> operator[](const valarray<bool>&) const;
+ valarray<value_type> operator[](const valarray<size_t>&) const;
+
+ _Expr<_UnClos<__unary_plus, std::_Expr, _Clos>, value_type>
+ operator+() const;
+
+ _Expr<_UnClos<__negate, std::_Expr, _Clos>, value_type>
+ operator-() const;
+
+ _Expr<_UnClos<__bitwise_not, std::_Expr, _Clos>, value_type>
+ operator~() const;
+
+ _Expr<_UnClos<__logical_not, std::_Expr, _Clos>, bool>
+ operator!() const;
+
+ size_t size() const;
+ value_type sum() const;
+
+ valarray<value_type> shift(int) const;
+ valarray<value_type> cshift(int) const;
+
+ value_type min() const;
+ value_type max() const;
+
+ valarray<value_type> apply(value_type (*)(const value_type&)) const;
+ valarray<value_type> apply(value_type (*)(value_type)) const;
+
+ private:
+ const _Clos _M_closure;
+ };
+
+ template<class _Clos, typename _Tp>
+ inline
+ _Expr<_Clos, _Tp>::_Expr(const _Clos& __c) : _M_closure(__c) {}
+
+ template<class _Clos, typename _Tp>
+ inline const _Clos&
+ _Expr<_Clos, _Tp>::operator()() const
+ { return _M_closure; }
+
+ template<class _Clos, typename _Tp>
+ inline _Tp
+ _Expr<_Clos, _Tp>::operator[](size_t __i) const
+ { return _M_closure[__i]; }
+
+ template<class _Clos, typename _Tp>
+ inline valarray<_Tp>
+ _Expr<_Clos, _Tp>::operator[](slice __s) const
+ {
+ valarray<_Tp> __v = valarray<_Tp>(*this)[__s];
+ return __v;
+ }
+
+ template<class _Clos, typename _Tp>
+ inline valarray<_Tp>
+ _Expr<_Clos, _Tp>::operator[](const gslice& __gs) const
+ {
+ valarray<_Tp> __v = valarray<_Tp>(*this)[__gs];
+ return __v;
+ }
+
+ template<class _Clos, typename _Tp>
+ inline valarray<_Tp>
+ _Expr<_Clos, _Tp>::operator[](const valarray<bool>& __m) const
+ {
+ valarray<_Tp> __v = valarray<_Tp>(*this)[__m];
+ return __v;
+ }
+
+ template<class _Clos, typename _Tp>
+ inline valarray<_Tp>
+ _Expr<_Clos, _Tp>::operator[](const valarray<size_t>& __i) const
+ {
+ valarray<_Tp> __v = valarray<_Tp>(*this)[__i];
+ return __v;
+ }
+
+ template<class _Clos, typename _Tp>
+ inline size_t
+ _Expr<_Clos, _Tp>::size() const
+ { return _M_closure.size(); }
+
+ template<class _Clos, typename _Tp>
+ inline valarray<_Tp>
+ _Expr<_Clos, _Tp>::shift(int __n) const
+ {
+ valarray<_Tp> __v = valarray<_Tp>(*this).shift(__n);
+ return __v;
+ }
+
+ template<class _Clos, typename _Tp>
+ inline valarray<_Tp>
+ _Expr<_Clos, _Tp>::cshift(int __n) const
+ {
+ valarray<_Tp> __v = valarray<_Tp>(*this).cshift(__n);
+ return __v;
+ }
+
+ template<class _Clos, typename _Tp>
+ inline valarray<_Tp>
+ _Expr<_Clos, _Tp>::apply(_Tp __f(const _Tp&)) const
+ {
+ valarray<_Tp> __v = valarray<_Tp>(*this).apply(__f);
+ return __v;
+ }
+
+ template<class _Clos, typename _Tp>
+ inline valarray<_Tp>
+ _Expr<_Clos, _Tp>::apply(_Tp __f(_Tp)) const
+ {
+ valarray<_Tp> __v = valarray<_Tp>(*this).apply(__f);
+ return __v;
+ }
+
+ // XXX: replace this with a more robust summation algorithm.
+ template<class _Clos, typename _Tp>
+ inline _Tp
+ _Expr<_Clos, _Tp>::sum() const
+ {
+ size_t __n = _M_closure.size();
+ if (__n == 0)
+ return _Tp();
+ else
+ {
+ _Tp __s = _M_closure[--__n];
+ while (__n != 0)
+ __s += _M_closure[--__n];
+ return __s;
+ }
+ }
+
+ template<class _Clos, typename _Tp>
+ inline _Tp
+ _Expr<_Clos, _Tp>::min() const
+ { return __valarray_min(_M_closure); }
+
+ template<class _Clos, typename _Tp>
+ inline _Tp
+ _Expr<_Clos, _Tp>::max() const
+ { return __valarray_max(_M_closure); }
+
+ template<class _Dom, typename _Tp>
+ inline _Expr<_UnClos<__logical_not, _Expr, _Dom>, bool>
+ _Expr<_Dom, _Tp>::operator!() const
+ {
+ typedef _UnClos<__logical_not, std::_Expr, _Dom> _Closure;
+ return _Expr<_Closure, bool>(_Closure(this->_M_closure));
+ }
+
+#define _DEFINE_EXPR_UNARY_OPERATOR(_Op, _Name) \
+ template<class _Dom, typename _Tp> \
+ inline _Expr<_UnClos<_Name, std::_Expr, _Dom>, _Tp> \
+ _Expr<_Dom, _Tp>::operator _Op() const \
+ { \
+ typedef _UnClos<_Name, std::_Expr, _Dom> _Closure; \
+ return _Expr<_Closure, _Tp>(_Closure(this->_M_closure)); \
+ }
+
+ _DEFINE_EXPR_UNARY_OPERATOR(+, __unary_plus)
+ _DEFINE_EXPR_UNARY_OPERATOR(-, __negate)
+ _DEFINE_EXPR_UNARY_OPERATOR(~, __bitwise_not)
+
+#undef _DEFINE_EXPR_UNARY_OPERATOR
+
+#define _DEFINE_EXPR_BINARY_OPERATOR(_Op, _Name) \
+ template<class _Dom1, class _Dom2> \
+ inline _Expr<_BinClos<_Name, _Expr, _Expr, _Dom1, _Dom2>, \
+ typename __fun<_Name, typename _Dom1::value_type>::result_type> \
+ operator _Op(const _Expr<_Dom1, typename _Dom1::value_type>& __v, \
+ const _Expr<_Dom2, typename _Dom2::value_type>& __w) \
+ { \
+ typedef typename _Dom1::value_type _Arg; \
+ typedef typename __fun<_Name, _Arg>::result_type _Value; \
+ typedef _BinClos<_Name, _Expr, _Expr, _Dom1, _Dom2> _Closure; \
+ return _Expr<_Closure, _Value>(_Closure(__v(), __w())); \
+ } \
+ \
+ template<class _Dom> \
+ inline _Expr<_BinClos<_Name, _Expr, _Constant, _Dom, \
+ typename _Dom::value_type>, \
+ typename __fun<_Name, typename _Dom::value_type>::result_type> \
+ operator _Op(const _Expr<_Dom, typename _Dom::value_type>& __v, \
+ const typename _Dom::value_type& __t) \
+ { \
+ typedef typename _Dom::value_type _Arg; \
+ typedef typename __fun<_Name, _Arg>::result_type _Value; \
+ typedef _BinClos<_Name, _Expr, _Constant, _Dom, _Arg> _Closure; \
+ return _Expr<_Closure, _Value>(_Closure(__v(), __t)); \
+ } \
+ \
+ template<class _Dom> \
+ inline _Expr<_BinClos<_Name, _Constant, _Expr, \
+ typename _Dom::value_type, _Dom>, \
+ typename __fun<_Name, typename _Dom::value_type>::result_type> \
+ operator _Op(const typename _Dom::value_type& __t, \
+ const _Expr<_Dom, typename _Dom::value_type>& __v) \
+ { \
+ typedef typename _Dom::value_type _Arg; \
+ typedef typename __fun<_Name, _Arg>::result_type _Value; \
+ typedef _BinClos<_Name, _Constant, _Expr, _Arg, _Dom> _Closure; \
+ return _Expr<_Closure, _Value>(_Closure(__t, __v())); \
+ } \
+ \
+ template<class _Dom> \
+ inline _Expr<_BinClos<_Name, _Expr, _ValArray, \
+ _Dom, typename _Dom::value_type>, \
+ typename __fun<_Name, typename _Dom::value_type>::result_type> \
+ operator _Op(const _Expr<_Dom,typename _Dom::value_type>& __e, \
+ const valarray<typename _Dom::value_type>& __v) \
+ { \
+ typedef typename _Dom::value_type _Arg; \
+ typedef typename __fun<_Name, _Arg>::result_type _Value; \
+ typedef _BinClos<_Name, _Expr, _ValArray, _Dom, _Arg> _Closure; \
+ return _Expr<_Closure, _Value>(_Closure(__e(), __v)); \
+ } \
+ \
+ template<class _Dom> \
+ inline _Expr<_BinClos<_Name, _ValArray, _Expr, \
+ typename _Dom::value_type, _Dom>, \
+ typename __fun<_Name, typename _Dom::value_type>::result_type> \
+ operator _Op(const valarray<typename _Dom::value_type>& __v, \
+ const _Expr<_Dom, typename _Dom::value_type>& __e) \
+ { \
+ typedef typename _Dom::value_type _Tp; \
+ typedef typename __fun<_Name, _Tp>::result_type _Value; \
+ typedef _BinClos<_Name, _ValArray, _Expr, _Tp, _Dom> _Closure; \
+ return _Expr<_Closure, _Value>(_Closure(__v, __e ())); \
+ }
+
+ _DEFINE_EXPR_BINARY_OPERATOR(+, __plus)
+ _DEFINE_EXPR_BINARY_OPERATOR(-, __minus)
+ _DEFINE_EXPR_BINARY_OPERATOR(*, __multiplies)
+ _DEFINE_EXPR_BINARY_OPERATOR(/, __divides)
+ _DEFINE_EXPR_BINARY_OPERATOR(%, __modulus)
+ _DEFINE_EXPR_BINARY_OPERATOR(^, __bitwise_xor)
+ _DEFINE_EXPR_BINARY_OPERATOR(&, __bitwise_and)
+ _DEFINE_EXPR_BINARY_OPERATOR(|, __bitwise_or)
+ _DEFINE_EXPR_BINARY_OPERATOR(<<, __shift_left)
+ _DEFINE_EXPR_BINARY_OPERATOR(>>, __shift_right)
+ _DEFINE_EXPR_BINARY_OPERATOR(&&, __logical_and)
+ _DEFINE_EXPR_BINARY_OPERATOR(||, __logical_or)
+ _DEFINE_EXPR_BINARY_OPERATOR(==, __equal_to)
+ _DEFINE_EXPR_BINARY_OPERATOR(!=, __not_equal_to)
+ _DEFINE_EXPR_BINARY_OPERATOR(<, __less)
+ _DEFINE_EXPR_BINARY_OPERATOR(>, __greater)
+ _DEFINE_EXPR_BINARY_OPERATOR(<=, __less_equal)
+ _DEFINE_EXPR_BINARY_OPERATOR(>=, __greater_equal)
+
+#undef _DEFINE_EXPR_BINARY_OPERATOR
+
+#define _DEFINE_EXPR_UNARY_FUNCTION(_Name) \
+ template<class _Dom> \
+ inline _Expr<_UnClos<__##_Name, _Expr, _Dom>, \
+ typename _Dom::value_type> \
+ _Name(const _Expr<_Dom, typename _Dom::value_type>& __e) \
+ { \
+ typedef typename _Dom::value_type _Tp; \
+ typedef _UnClos<__##_Name, _Expr, _Dom> _Closure; \
+ return _Expr<_Closure, _Tp>(_Closure(__e())); \
+ } \
+ \
+ template<typename _Tp> \
+ inline _Expr<_UnClos<__##_Name, _ValArray, _Tp>, _Tp> \
+ _Name(const valarray<_Tp>& __v) \
+ { \
+ typedef _UnClos<__##_Name, _ValArray, _Tp> _Closure; \
+ return _Expr<_Closure, _Tp>(_Closure(__v)); \
+ }
+
+ _DEFINE_EXPR_UNARY_FUNCTION(abs)
+ _DEFINE_EXPR_UNARY_FUNCTION(cos)
+ _DEFINE_EXPR_UNARY_FUNCTION(acos)
+ _DEFINE_EXPR_UNARY_FUNCTION(cosh)
+ _DEFINE_EXPR_UNARY_FUNCTION(sin)
+ _DEFINE_EXPR_UNARY_FUNCTION(asin)
+ _DEFINE_EXPR_UNARY_FUNCTION(sinh)
+ _DEFINE_EXPR_UNARY_FUNCTION(tan)
+ _DEFINE_EXPR_UNARY_FUNCTION(tanh)
+ _DEFINE_EXPR_UNARY_FUNCTION(atan)
+ _DEFINE_EXPR_UNARY_FUNCTION(exp)
+ _DEFINE_EXPR_UNARY_FUNCTION(log)
+ _DEFINE_EXPR_UNARY_FUNCTION(log10)
+ _DEFINE_EXPR_UNARY_FUNCTION(sqrt)
+
+#undef _DEFINE_EXPR_UNARY_FUNCTION
+
+#define _DEFINE_EXPR_BINARY_FUNCTION(_Fun) \
+ template<class _Dom1, class _Dom2> \
+ inline _Expr<_BinClos<__##_Fun, _Expr, _Expr, _Dom1, _Dom2>, \
+ typename _Dom1::value_type> \
+ _Fun(const _Expr<_Dom1, typename _Dom1::value_type>& __e1, \
+ const _Expr<_Dom2, typename _Dom2::value_type>& __e2) \
+ { \
+ typedef typename _Dom1::value_type _Tp; \
+ typedef _BinClos<__##_Fun, _Expr, _Expr, _Dom1, _Dom2> _Closure; \
+ return _Expr<_Closure, _Tp>(_Closure(__e1(), __e2())); \
+ } \
+ \
+ template<class _Dom> \
+ inline _Expr<_BinClos<__##_Fun, _Expr, _ValArray, _Dom, \
+ typename _Dom::value_type>, \
+ typename _Dom::value_type> \
+ _Fun(const _Expr<_Dom, typename _Dom::value_type>& __e, \
+ const valarray<typename _Dom::value_type>& __v) \
+ { \
+ typedef typename _Dom::value_type _Tp; \
+ typedef _BinClos<__##_Fun, _Expr, _ValArray, _Dom, _Tp> _Closure; \
+ return _Expr<_Closure, _Tp>(_Closure(__e(), __v)); \
+ } \
+ \
+ template<class _Dom> \
+ inline _Expr<_BinClos<__##_Fun, _ValArray, _Expr, \
+ typename _Dom::value_type, _Dom>, \
+ typename _Dom::value_type> \
+ _Fun(const valarray<typename _Dom::valarray>& __v, \
+ const _Expr<_Dom, typename _Dom::value_type>& __e) \
+ { \
+ typedef typename _Dom::value_type _Tp; \
+ typedef _BinClos<__##_Fun, _ValArray, _Expr, _Tp, _Dom> _Closure; \
+ return _Expr<_Closure, _Tp>(_Closure(__v, __e())); \
+ } \
+ \
+ template<class _Dom> \
+ inline _Expr<_BinClos<__##_Fun, _Expr, _Constant, _Dom, \
+ typename _Dom::value_type>, \
+ typename _Dom::value_type> \
+ _Fun(const _Expr<_Dom, typename _Dom::value_type>& __e, \
+ const typename _Dom::value_type& __t) \
+ { \
+ typedef typename _Dom::value_type _Tp; \
+ typedef _BinClos<__##_Fun, _Expr, _Constant, _Dom, _Tp> _Closure;\
+ return _Expr<_Closure, _Tp>(_Closure(__e(), __t)); \
+ } \
+ \
+ template<class _Dom> \
+ inline _Expr<_BinClos<__##_Fun, _Constant, _Expr, \
+ typename _Dom::value_type, _Dom>, \
+ typename _Dom::value_type> \
+ _Fun(const typename _Dom::value_type& __t, \
+ const _Expr<_Dom, typename _Dom::value_type>& __e) \
+ { \
+ typedef typename _Dom::value_type _Tp; \
+ typedef _BinClos<__##_Fun, _Constant, _Expr, _Tp, _Dom> _Closure; \
+ return _Expr<_Closure, _Tp>(_Closure(__t, __e())); \
+ } \
+ \
+ template<typename _Tp> \
+ inline _Expr<_BinClos<__##_Fun, _ValArray, _ValArray, _Tp, _Tp>, _Tp> \
+ _Fun(const valarray<_Tp>& __v, const valarray<_Tp>& __w) \
+ { \
+ typedef _BinClos<__##_Fun, _ValArray, _ValArray, _Tp, _Tp> _Closure; \
+ return _Expr<_Closure, _Tp>(_Closure(__v, __w)); \
+ } \
+ \
+ template<typename _Tp> \
+ inline _Expr<_BinClos<__##_Fun, _ValArray, _Constant, _Tp, _Tp>, _Tp> \
+ _Fun(const valarray<_Tp>& __v, const _Tp& __t) \
+ { \
+ typedef _BinClos<__##_Fun, _ValArray, _Constant, _Tp, _Tp> _Closure; \
+ return _Expr<_Closure, _Tp>(_Closure(__v, __t)); \
+ } \
+ \
+ template<typename _Tp> \
+ inline _Expr<_BinClos<__##_Fun, _Constant, _ValArray, _Tp, _Tp>, _Tp> \
+ _Fun(const _Tp& __t, const valarray<_Tp>& __v) \
+ { \
+ typedef _BinClos<__##_Fun, _Constant, _ValArray, _Tp, _Tp> _Closure; \
+ return _Expr<_Closure, _Tp>(_Closure(__t, __v)); \
+ }
+
+_DEFINE_EXPR_BINARY_FUNCTION(atan2)
+_DEFINE_EXPR_BINARY_FUNCTION(pow)
+
+#undef _DEFINE_EXPR_BINARY_FUNCTION
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _CPP_VALARRAY_AFTER_H */
diff --git a/i686-linux/include/c++/4.4.3/bits/valarray_array.h b/i686-linux/include/c++/4.4.3/bits/valarray_array.h
new file mode 100644
index 0000000..492891b
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/valarray_array.h
@@ -0,0 +1,699 @@
+// The template and inlines for the -*- C++ -*- internal _Array helper class.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file valarray_array.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
+
+#ifndef _VALARRAY_ARRAY_H
+#define _VALARRAY_ARRAY_H 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <bits/cpp_type_traits.h>
+#include <cstdlib>
+#include <new>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ //
+ // Helper functions on raw pointers
+ //
+
+ // We get memory by the old fashion way
+ inline void*
+ __valarray_get_memory(size_t __n)
+ { return operator new(__n); }
+
+ template<typename _Tp>
+ inline _Tp*__restrict__
+ __valarray_get_storage(size_t __n)
+ {
+ return static_cast<_Tp*__restrict__>
+ (std::__valarray_get_memory(__n * sizeof(_Tp)));
+ }
+
+ // Return memory to the system
+ inline void
+ __valarray_release_memory(void* __p)
+ { operator delete(__p); }
+
+ // Turn a raw-memory into an array of _Tp filled with _Tp()
+ // This is required in 'valarray<T> v(n);'
+ template<typename _Tp, bool>
+ struct _Array_default_ctor
+ {
+ // Please note that this isn't exception safe. But
+ // valarrays aren't required to be exception safe.
+ inline static void
+ _S_do_it(_Tp* __restrict__ __b, _Tp* __restrict__ __e)
+ {
+ while (__b != __e)
+ new(__b++) _Tp();
+ }
+ };
+
+ template<typename _Tp>
+ struct _Array_default_ctor<_Tp, true>
+ {
+ // For fundamental types, it suffices to say 'memset()'
+ inline static void
+ _S_do_it(_Tp* __restrict__ __b, _Tp* __restrict__ __e)
+ { __builtin_memset(__b, 0, (__e - __b) * sizeof(_Tp)); }
+ };
+
+ template<typename _Tp>
+ inline void
+ __valarray_default_construct(_Tp* __restrict__ __b, _Tp* __restrict__ __e)
+ {
+ _Array_default_ctor<_Tp, __is_scalar<_Tp>::__value>::_S_do_it(__b, __e);
+ }
+
+ // Turn a raw-memory into an array of _Tp filled with __t
+ // This is the required in valarray<T> v(n, t). Also
+ // used in valarray<>::resize().
+ template<typename _Tp, bool>
+ struct _Array_init_ctor
+ {
+ // Please note that this isn't exception safe. But
+ // valarrays aren't required to be exception safe.
+ inline static void
+ _S_do_it(_Tp* __restrict__ __b, _Tp* __restrict__ __e, const _Tp __t)
+ {
+ while (__b != __e)
+ new(__b++) _Tp(__t);
+ }
+ };
+
+ template<typename _Tp>
+ struct _Array_init_ctor<_Tp, true>
+ {
+ inline static void
+ _S_do_it(_Tp* __restrict__ __b, _Tp* __restrict__ __e, const _Tp __t)
+ {
+ while (__b != __e)
+ *__b++ = __t;
+ }
+ };
+
+ template<typename _Tp>
+ inline void
+ __valarray_fill_construct(_Tp* __restrict__ __b, _Tp* __restrict__ __e,
+ const _Tp __t)
+ {
+ _Array_init_ctor<_Tp, __is_pod(_Tp)>::_S_do_it(__b, __e, __t);
+ }
+
+ //
+ // copy-construct raw array [__o, *) from plain array [__b, __e)
+ // We can't just say 'memcpy()'
+ //
+ template<typename _Tp, bool>
+ struct _Array_copy_ctor
+ {
+ // Please note that this isn't exception safe. But
+ // valarrays aren't required to be exception safe.
+ inline static void
+ _S_do_it(const _Tp* __restrict__ __b, const _Tp* __restrict__ __e,
+ _Tp* __restrict__ __o)
+ {
+ while (__b != __e)
+ new(__o++) _Tp(*__b++);
+ }
+ };
+
+ template<typename _Tp>
+ struct _Array_copy_ctor<_Tp, true>
+ {
+ inline static void
+ _S_do_it(const _Tp* __restrict__ __b, const _Tp* __restrict__ __e,
+ _Tp* __restrict__ __o)
+ { __builtin_memcpy(__o, __b, (__e - __b) * sizeof(_Tp)); }
+ };
+
+ template<typename _Tp>
+ inline void
+ __valarray_copy_construct(const _Tp* __restrict__ __b,
+ const _Tp* __restrict__ __e,
+ _Tp* __restrict__ __o)
+ {
+ _Array_copy_ctor<_Tp, __is_pod(_Tp)>::_S_do_it(__b, __e, __o);
+ }
+
+ // copy-construct raw array [__o, *) from strided array __a[<__n : __s>]
+ template<typename _Tp>
+ inline void
+ __valarray_copy_construct (const _Tp* __restrict__ __a, size_t __n,
+ size_t __s, _Tp* __restrict__ __o)
+ {
+ if (__is_pod(_Tp))
+ while (__n--)
+ {
+ *__o++ = *__a;
+ __a += __s;
+ }
+ else
+ while (__n--)
+ {
+ new(__o++) _Tp(*__a);
+ __a += __s;
+ }
+ }
+
+ // copy-construct raw array [__o, *) from indexed array __a[__i[<__n>]]
+ template<typename _Tp>
+ inline void
+ __valarray_copy_construct (const _Tp* __restrict__ __a,
+ const size_t* __restrict__ __i,
+ _Tp* __restrict__ __o, size_t __n)
+ {
+ if (__is_pod(_Tp))
+ while (__n--)
+ *__o++ = __a[*__i++];
+ else
+ while (__n--)
+ new (__o++) _Tp(__a[*__i++]);
+ }
+
+ // Do the necessary cleanup when we're done with arrays.
+ template<typename _Tp>
+ inline void
+ __valarray_destroy_elements(_Tp* __restrict__ __b, _Tp* __restrict__ __e)
+ {
+ if (!__is_pod(_Tp))
+ while (__b != __e)
+ {
+ __b->~_Tp();
+ ++__b;
+ }
+ }
+
+ // Fill a plain array __a[<__n>] with __t
+ template<typename _Tp>
+ inline void
+ __valarray_fill(_Tp* __restrict__ __a, size_t __n, const _Tp& __t)
+ {
+ while (__n--)
+ *__a++ = __t;
+ }
+
+ // fill strided array __a[<__n-1 : __s>] with __t
+ template<typename _Tp>
+ inline void
+ __valarray_fill(_Tp* __restrict__ __a, size_t __n,
+ size_t __s, const _Tp& __t)
+ {
+ for (size_t __i = 0; __i < __n; ++__i, __a += __s)
+ *__a = __t;
+ }
+
+ // fill indirect array __a[__i[<__n>]] with __i
+ template<typename _Tp>
+ inline void
+ __valarray_fill(_Tp* __restrict__ __a, const size_t* __restrict__ __i,
+ size_t __n, const _Tp& __t)
+ {
+ for (size_t __j = 0; __j < __n; ++__j, ++__i)
+ __a[*__i] = __t;
+ }
+
+ // copy plain array __a[<__n>] in __b[<__n>]
+ // For non-fundamental types, it is wrong to say 'memcpy()'
+ template<typename _Tp, bool>
+ struct _Array_copier
+ {
+ inline static void
+ _S_do_it(const _Tp* __restrict__ __a, size_t __n, _Tp* __restrict__ __b)
+ {
+ while(__n--)
+ *__b++ = *__a++;
+ }
+ };
+
+ template<typename _Tp>
+ struct _Array_copier<_Tp, true>
+ {
+ inline static void
+ _S_do_it(const _Tp* __restrict__ __a, size_t __n, _Tp* __restrict__ __b)
+ { __builtin_memcpy(__b, __a, __n * sizeof (_Tp)); }
+ };
+
+ // Copy a plain array __a[<__n>] into a play array __b[<>]
+ template<typename _Tp>
+ inline void
+ __valarray_copy(const _Tp* __restrict__ __a, size_t __n,
+ _Tp* __restrict__ __b)
+ {
+ _Array_copier<_Tp, __is_pod(_Tp)>::_S_do_it(__a, __n, __b);
+ }
+
+ // Copy strided array __a[<__n : __s>] in plain __b[<__n>]
+ template<typename _Tp>
+ inline void
+ __valarray_copy(const _Tp* __restrict__ __a, size_t __n, size_t __s,
+ _Tp* __restrict__ __b)
+ {
+ for (size_t __i = 0; __i < __n; ++__i, ++__b, __a += __s)
+ *__b = *__a;
+ }
+
+ // Copy a plain array __a[<__n>] into a strided array __b[<__n : __s>]
+ template<typename _Tp>
+ inline void
+ __valarray_copy(const _Tp* __restrict__ __a, _Tp* __restrict__ __b,
+ size_t __n, size_t __s)
+ {
+ for (size_t __i = 0; __i < __n; ++__i, ++__a, __b += __s)
+ *__b = *__a;
+ }
+
+ // Copy strided array __src[<__n : __s1>] into another
+ // strided array __dst[< : __s2>]. Their sizes must match.
+ template<typename _Tp>
+ inline void
+ __valarray_copy(const _Tp* __restrict__ __src, size_t __n, size_t __s1,
+ _Tp* __restrict__ __dst, size_t __s2)
+ {
+ for (size_t __i = 0; __i < __n; ++__i)
+ __dst[__i * __s2] = __src[__i * __s1];
+ }
+
+ // Copy an indexed array __a[__i[<__n>]] in plain array __b[<__n>]
+ template<typename _Tp>
+ inline void
+ __valarray_copy(const _Tp* __restrict__ __a,
+ const size_t* __restrict__ __i,
+ _Tp* __restrict__ __b, size_t __n)
+ {
+ for (size_t __j = 0; __j < __n; ++__j, ++__b, ++__i)
+ *__b = __a[*__i];
+ }
+
+ // Copy a plain array __a[<__n>] in an indexed array __b[__i[<__n>]]
+ template<typename _Tp>
+ inline void
+ __valarray_copy(const _Tp* __restrict__ __a, size_t __n,
+ _Tp* __restrict__ __b, const size_t* __restrict__ __i)
+ {
+ for (size_t __j = 0; __j < __n; ++__j, ++__a, ++__i)
+ __b[*__i] = *__a;
+ }
+
+ // Copy the __n first elements of an indexed array __src[<__i>] into
+ // another indexed array __dst[<__j>].
+ template<typename _Tp>
+ inline void
+ __valarray_copy(const _Tp* __restrict__ __src, size_t __n,
+ const size_t* __restrict__ __i,
+ _Tp* __restrict__ __dst, const size_t* __restrict__ __j)
+ {
+ for (size_t __k = 0; __k < __n; ++__k)
+ __dst[*__j++] = __src[*__i++];
+ }
+
+ //
+ // Compute the sum of elements in range [__f, __l)
+ // This is a naive algorithm. It suffers from cancelling.
+ // In the future try to specialize
+ // for _Tp = float, double, long double using a more accurate
+ // algorithm.
+ //
+ template<typename _Tp>
+ inline _Tp
+ __valarray_sum(const _Tp* __restrict__ __f, const _Tp* __restrict__ __l)
+ {
+ _Tp __r = _Tp();
+ while (__f != __l)
+ __r += *__f++;
+ return __r;
+ }
+
+ // Compute the product of all elements in range [__f, __l)
+ template<typename _Tp>
+ inline _Tp
+ __valarray_product(const _Tp* __restrict__ __f,
+ const _Tp* __restrict__ __l)
+ {
+ _Tp __r = _Tp(1);
+ while (__f != __l)
+ __r = __r * *__f++;
+ return __r;
+ }
+
+ // Compute the min/max of an array-expression
+ template<typename _Ta>
+ inline typename _Ta::value_type
+ __valarray_min(const _Ta& __a)
+ {
+ size_t __s = __a.size();
+ typedef typename _Ta::value_type _Value_type;
+ _Value_type __r = __s == 0 ? _Value_type() : __a[0];
+ for (size_t __i = 1; __i < __s; ++__i)
+ {
+ _Value_type __t = __a[__i];
+ if (__t < __r)
+ __r = __t;
+ }
+ return __r;
+ }
+
+ template<typename _Ta>
+ inline typename _Ta::value_type
+ __valarray_max(const _Ta& __a)
+ {
+ size_t __s = __a.size();
+ typedef typename _Ta::value_type _Value_type;
+ _Value_type __r = __s == 0 ? _Value_type() : __a[0];
+ for (size_t __i = 1; __i < __s; ++__i)
+ {
+ _Value_type __t = __a[__i];
+ if (__t > __r)
+ __r = __t;
+ }
+ return __r;
+ }
+
+ //
+ // Helper class _Array, first layer of valarray abstraction.
+ // All operations on valarray should be forwarded to this class
+ // whenever possible. -- gdr
+ //
+
+ template<typename _Tp>
+ struct _Array
+ {
+ explicit _Array(size_t);
+ explicit _Array(_Tp* const __restrict__);
+ explicit _Array(const valarray<_Tp>&);
+ _Array(const _Tp* __restrict__, size_t);
+
+ _Tp* begin() const;
+
+ _Tp* const __restrict__ _M_data;
+ };
+
+
+ // Copy-construct plain array __b[<__n>] from indexed array __a[__i[<__n>]]
+ template<typename _Tp>
+ inline void
+ __valarray_copy_construct(_Array<_Tp> __a, _Array<size_t> __i,
+ _Array<_Tp> __b, size_t __n)
+ { std::__valarray_copy_construct(__a._M_data, __i._M_data,
+ __b._M_data, __n); }
+
+ // Copy-construct plain array __b[<__n>] from strided array __a[<__n : __s>]
+ template<typename _Tp>
+ inline void
+ __valarray_copy_construct(_Array<_Tp> __a, size_t __n, size_t __s,
+ _Array<_Tp> __b)
+ { std::__valarray_copy_construct(__a._M_data, __n, __s, __b._M_data); }
+
+ template<typename _Tp>
+ inline void
+ __valarray_fill (_Array<_Tp> __a, size_t __n, const _Tp& __t)
+ { std::__valarray_fill(__a._M_data, __n, __t); }
+
+ template<typename _Tp>
+ inline void
+ __valarray_fill(_Array<_Tp> __a, size_t __n, size_t __s, const _Tp& __t)
+ { std::__valarray_fill(__a._M_data, __n, __s, __t); }
+
+ template<typename _Tp>
+ inline void
+ __valarray_fill(_Array<_Tp> __a, _Array<size_t> __i,
+ size_t __n, const _Tp& __t)
+ { std::__valarray_fill(__a._M_data, __i._M_data, __n, __t); }
+
+ // Copy a plain array __a[<__n>] into a play array __b[<>]
+ template<typename _Tp>
+ inline void
+ __valarray_copy(_Array<_Tp> __a, size_t __n, _Array<_Tp> __b)
+ { std::__valarray_copy(__a._M_data, __n, __b._M_data); }
+
+ // Copy strided array __a[<__n : __s>] in plain __b[<__n>]
+ template<typename _Tp>
+ inline void
+ __valarray_copy(_Array<_Tp> __a, size_t __n, size_t __s, _Array<_Tp> __b)
+ { std::__valarray_copy(__a._M_data, __n, __s, __b._M_data); }
+
+ // Copy a plain array __a[<__n>] into a strided array __b[<__n : __s>]
+ template<typename _Tp>
+ inline void
+ __valarray_copy(_Array<_Tp> __a, _Array<_Tp> __b, size_t __n, size_t __s)
+ { __valarray_copy(__a._M_data, __b._M_data, __n, __s); }
+
+ // Copy strided array __src[<__n : __s1>] into another
+ // strided array __dst[< : __s2>]. Their sizes must match.
+ template<typename _Tp>
+ inline void
+ __valarray_copy(_Array<_Tp> __a, size_t __n, size_t __s1,
+ _Array<_Tp> __b, size_t __s2)
+ { std::__valarray_copy(__a._M_data, __n, __s1, __b._M_data, __s2); }
+
+ // Copy an indexed array __a[__i[<__n>]] in plain array __b[<__n>]
+ template<typename _Tp>
+ inline void
+ __valarray_copy(_Array<_Tp> __a, _Array<size_t> __i,
+ _Array<_Tp> __b, size_t __n)
+ { std::__valarray_copy(__a._M_data, __i._M_data, __b._M_data, __n); }
+
+ // Copy a plain array __a[<__n>] in an indexed array __b[__i[<__n>]]
+ template<typename _Tp>
+ inline void
+ __valarray_copy(_Array<_Tp> __a, size_t __n, _Array<_Tp> __b,
+ _Array<size_t> __i)
+ { std::__valarray_copy(__a._M_data, __n, __b._M_data, __i._M_data); }
+
+ // Copy the __n first elements of an indexed array __src[<__i>] into
+ // another indexed array __dst[<__j>].
+ template<typename _Tp>
+ inline void
+ __valarray_copy(_Array<_Tp> __src, size_t __n, _Array<size_t> __i,
+ _Array<_Tp> __dst, _Array<size_t> __j)
+ {
+ std::__valarray_copy(__src._M_data, __n, __i._M_data,
+ __dst._M_data, __j._M_data);
+ }
+
+ template<typename _Tp>
+ inline
+ _Array<_Tp>::_Array(size_t __n)
+ : _M_data(__valarray_get_storage<_Tp>(__n))
+ { std::__valarray_default_construct(_M_data, _M_data + __n); }
+
+ template<typename _Tp>
+ inline
+ _Array<_Tp>::_Array(_Tp* const __restrict__ __p)
+ : _M_data (__p) {}
+
+ template<typename _Tp>
+ inline
+ _Array<_Tp>::_Array(const valarray<_Tp>& __v)
+ : _M_data (__v._M_data) {}
+
+ template<typename _Tp>
+ inline
+ _Array<_Tp>::_Array(const _Tp* __restrict__ __b, size_t __s)
+ : _M_data(__valarray_get_storage<_Tp>(__s))
+ { std::__valarray_copy_construct(__b, __s, _M_data); }
+
+ template<typename _Tp>
+ inline _Tp*
+ _Array<_Tp>::begin () const
+ { return _M_data; }
+
+#define _DEFINE_ARRAY_FUNCTION(_Op, _Name) \
+ template<typename _Tp> \
+ inline void \
+ _Array_augmented_##_Name(_Array<_Tp> __a, size_t __n, const _Tp& __t) \
+ { \
+ for (_Tp* __p = __a._M_data; __p < __a._M_data + __n; ++__p) \
+ *__p _Op##= __t; \
+ } \
+ \
+ template<typename _Tp> \
+ inline void \
+ _Array_augmented_##_Name(_Array<_Tp> __a, size_t __n, _Array<_Tp> __b) \
+ { \
+ _Tp* __p = __a._M_data; \
+ for (_Tp* __q = __b._M_data; __q < __b._M_data + __n; ++__p, ++__q) \
+ *__p _Op##= *__q; \
+ } \
+ \
+ template<typename _Tp, class _Dom> \
+ void \
+ _Array_augmented_##_Name(_Array<_Tp> __a, \
+ const _Expr<_Dom, _Tp>& __e, size_t __n) \
+ { \
+ _Tp* __p(__a._M_data); \
+ for (size_t __i = 0; __i < __n; ++__i, ++__p) \
+ *__p _Op##= __e[__i]; \
+ } \
+ \
+ template<typename _Tp> \
+ inline void \
+ _Array_augmented_##_Name(_Array<_Tp> __a, size_t __n, size_t __s, \
+ _Array<_Tp> __b) \
+ { \
+ _Tp* __q(__b._M_data); \
+ for (_Tp* __p = __a._M_data; __p < __a._M_data + __s * __n; \
+ __p += __s, ++__q) \
+ *__p _Op##= *__q; \
+ } \
+ \
+ template<typename _Tp> \
+ inline void \
+ _Array_augmented_##_Name(_Array<_Tp> __a, _Array<_Tp> __b, \
+ size_t __n, size_t __s) \
+ { \
+ _Tp* __q(__b._M_data); \
+ for (_Tp* __p = __a._M_data; __p < __a._M_data + __n; \
+ ++__p, __q += __s) \
+ *__p _Op##= *__q; \
+ } \
+ \
+ template<typename _Tp, class _Dom> \
+ void \
+ _Array_augmented_##_Name(_Array<_Tp> __a, size_t __s, \
+ const _Expr<_Dom, _Tp>& __e, size_t __n) \
+ { \
+ _Tp* __p(__a._M_data); \
+ for (size_t __i = 0; __i < __n; ++__i, __p += __s) \
+ *__p _Op##= __e[__i]; \
+ } \
+ \
+ template<typename _Tp> \
+ inline void \
+ _Array_augmented_##_Name(_Array<_Tp> __a, _Array<size_t> __i, \
+ _Array<_Tp> __b, size_t __n) \
+ { \
+ _Tp* __q(__b._M_data); \
+ for (size_t* __j = __i._M_data; __j < __i._M_data + __n; \
+ ++__j, ++__q) \
+ __a._M_data[*__j] _Op##= *__q; \
+ } \
+ \
+ template<typename _Tp> \
+ inline void \
+ _Array_augmented_##_Name(_Array<_Tp> __a, size_t __n, \
+ _Array<_Tp> __b, _Array<size_t> __i) \
+ { \
+ _Tp* __p(__a._M_data); \
+ for (size_t* __j = __i._M_data; __j<__i._M_data + __n; \
+ ++__j, ++__p) \
+ *__p _Op##= __b._M_data[*__j]; \
+ } \
+ \
+ template<typename _Tp, class _Dom> \
+ void \
+ _Array_augmented_##_Name(_Array<_Tp> __a, _Array<size_t> __i, \
+ const _Expr<_Dom, _Tp>& __e, size_t __n) \
+ { \
+ size_t* __j(__i._M_data); \
+ for (size_t __k = 0; __k<__n; ++__k, ++__j) \
+ __a._M_data[*__j] _Op##= __e[__k]; \
+ } \
+ \
+ template<typename _Tp> \
+ void \
+ _Array_augmented_##_Name(_Array<_Tp> __a, _Array<bool> __m, \
+ _Array<_Tp> __b, size_t __n) \
+ { \
+ bool* __ok(__m._M_data); \
+ _Tp* __p(__a._M_data); \
+ for (_Tp* __q = __b._M_data; __q < __b._M_data + __n; \
+ ++__q, ++__ok, ++__p) \
+ { \
+ while (! *__ok) \
+ { \
+ ++__ok; \
+ ++__p; \
+ } \
+ *__p _Op##= *__q; \
+ } \
+ } \
+ \
+ template<typename _Tp> \
+ void \
+ _Array_augmented_##_Name(_Array<_Tp> __a, size_t __n, \
+ _Array<_Tp> __b, _Array<bool> __m) \
+ { \
+ bool* __ok(__m._M_data); \
+ _Tp* __q(__b._M_data); \
+ for (_Tp* __p = __a._M_data; __p < __a._M_data + __n; \
+ ++__p, ++__ok, ++__q) \
+ { \
+ while (! *__ok) \
+ { \
+ ++__ok; \
+ ++__q; \
+ } \
+ *__p _Op##= *__q; \
+ } \
+ } \
+ \
+ template<typename _Tp, class _Dom> \
+ void \
+ _Array_augmented_##_Name(_Array<_Tp> __a, _Array<bool> __m, \
+ const _Expr<_Dom, _Tp>& __e, size_t __n) \
+ { \
+ bool* __ok(__m._M_data); \
+ _Tp* __p(__a._M_data); \
+ for (size_t __i = 0; __i < __n; ++__i, ++__ok, ++__p) \
+ { \
+ while (! *__ok) \
+ { \
+ ++__ok; \
+ ++__p; \
+ } \
+ *__p _Op##= __e[__i]; \
+ } \
+ }
+
+ _DEFINE_ARRAY_FUNCTION(+, __plus)
+ _DEFINE_ARRAY_FUNCTION(-, __minus)
+ _DEFINE_ARRAY_FUNCTION(*, __multiplies)
+ _DEFINE_ARRAY_FUNCTION(/, __divides)
+ _DEFINE_ARRAY_FUNCTION(%, __modulus)
+ _DEFINE_ARRAY_FUNCTION(^, __bitwise_xor)
+ _DEFINE_ARRAY_FUNCTION(|, __bitwise_or)
+ _DEFINE_ARRAY_FUNCTION(&, __bitwise_and)
+ _DEFINE_ARRAY_FUNCTION(<<, __shift_left)
+ _DEFINE_ARRAY_FUNCTION(>>, __shift_right)
+
+#undef _DEFINE_ARRAY_FUNCTION
+
+_GLIBCXX_END_NAMESPACE
+
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <bits/valarray_array.tcc>
+#endif
+
+#endif /* _ARRAY_H */
diff --git a/i686-linux/include/c++/4.4.3/bits/valarray_array.tcc b/i686-linux/include/c++/4.4.3/bits/valarray_array.tcc
new file mode 100644
index 0000000..15cb7b1
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/valarray_array.tcc
@@ -0,0 +1,241 @@
+// The template and inlines for the -*- C++ -*- internal _Array helper class.
+
+// Copyright (C) 1997, 1998, 1999, 2003, 2005, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file valarray_array.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
+
+#ifndef _VALARRAY_ARRAY_TCC
+#define _VALARRAY_ARRAY_TCC 1
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _Tp>
+ void
+ __valarray_fill(_Array<_Tp> __a, size_t __n, _Array<bool> __m,
+ const _Tp& __t)
+ {
+ _Tp* __p = __a._M_data;
+ bool* __ok (__m._M_data);
+ for (size_t __i=0; __i < __n; ++__i, ++__ok, ++__p)
+ {
+ while (!*__ok)
+ {
+ ++__ok;
+ ++__p;
+ }
+ *__p = __t;
+ }
+ }
+
+ // Copy n elements of a into consecutive elements of b. When m is
+ // false, the corresponding element of a is skipped. m must contain
+ // at least n true elements. a must contain at least n elements and
+ // enough elements to match up with m through the nth true element
+ // of m. I.e. if n is 10, m has 15 elements with 5 false followed
+ // by 10 true, a must have 15 elements.
+ template<typename _Tp>
+ void
+ __valarray_copy(_Array<_Tp> __a, _Array<bool> __m, _Array<_Tp> __b,
+ size_t __n)
+ {
+ _Tp* __p (__a._M_data);
+ bool* __ok (__m._M_data);
+ for (_Tp* __q = __b._M_data; __q < __b._M_data + __n;
+ ++__q, ++__ok, ++__p)
+ {
+ while (! *__ok)
+ {
+ ++__ok;
+ ++__p;
+ }
+ *__q = *__p;
+ }
+ }
+
+ // Copy n consecutive elements from a into elements of b. Elements
+ // of b are skipped if the corresponding element of m is false. m
+ // must contain at least n true elements. b must have at least as
+ // many elements as the index of the nth true element of m. I.e. if
+ // m has 15 elements with 5 false followed by 10 true, b must have
+ // at least 15 elements.
+ template<typename _Tp>
+ void
+ __valarray_copy(_Array<_Tp> __a, size_t __n, _Array<_Tp> __b,
+ _Array<bool> __m)
+ {
+ _Tp* __q (__b._M_data);
+ bool* __ok (__m._M_data);
+ for (_Tp* __p = __a._M_data; __p < __a._M_data+__n;
+ ++__p, ++__ok, ++__q)
+ {
+ while (! *__ok)
+ {
+ ++__ok;
+ ++__q;
+ }
+ *__q = *__p;
+ }
+ }
+
+ // Copy n elements from a into elements of b. Elements of a are
+ // skipped if the corresponding element of m is false. Elements of
+ // b are skipped if the corresponding element of k is false. m and
+ // k must contain at least n true elements. a and b must have at
+ // least as many elements as the index of the nth true element of m.
+ template<typename _Tp>
+ void
+ __valarray_copy(_Array<_Tp> __a, _Array<bool> __m, size_t __n,
+ _Array<_Tp> __b, _Array<bool> __k)
+ {
+ _Tp* __p (__a._M_data);
+ _Tp* __q (__b._M_data);
+ bool* __srcok (__m._M_data);
+ bool* __dstok (__k._M_data);
+ for (size_t __i = 0; __i < __n;
+ ++__srcok, ++__p, ++__dstok, ++__q, ++__i)
+ {
+ while (! *__srcok)
+ {
+ ++__srcok;
+ ++__p;
+ }
+ while (! *__dstok)
+ {
+ ++__dstok;
+ ++__q;
+ }
+ *__q = *__p;
+ }
+ }
+
+ // Copy n consecutive elements of e into consecutive elements of a.
+ // I.e. a[i] = e[i].
+ template<typename _Tp, class _Dom>
+ void
+ __valarray_copy(const _Expr<_Dom, _Tp>& __e, size_t __n, _Array<_Tp> __a)
+ {
+ _Tp* __p (__a._M_data);
+ for (size_t __i = 0; __i < __n; ++__i, ++__p)
+ *__p = __e[__i];
+ }
+
+ // Copy n consecutive elements of e into elements of a using stride
+ // s. I.e., a[0] = e[0], a[s] = e[1], a[2*s] = e[2].
+ template<typename _Tp, class _Dom>
+ void
+ __valarray_copy(const _Expr<_Dom, _Tp>& __e, size_t __n,
+ _Array<_Tp> __a, size_t __s)
+ {
+ _Tp* __p (__a._M_data);
+ for (size_t __i = 0; __i < __n; ++__i, __p += __s)
+ *__p = __e[__i];
+ }
+
+ // Copy n consecutive elements of e into elements of a indexed by
+ // contents of i. I.e., a[i[0]] = e[0].
+ template<typename _Tp, class _Dom>
+ void
+ __valarray_copy(const _Expr<_Dom, _Tp>& __e, size_t __n,
+ _Array<_Tp> __a, _Array<size_t> __i)
+ {
+ size_t* __j (__i._M_data);
+ for (size_t __k = 0; __k < __n; ++__k, ++__j)
+ __a._M_data[*__j] = __e[__k];
+ }
+
+ // Copy n elements of e indexed by contents of f into elements of a
+ // indexed by contents of i. I.e., a[i[0]] = e[f[0]].
+ template<typename _Tp>
+ void
+ __valarray_copy(_Array<_Tp> __e, _Array<size_t> __f,
+ size_t __n,
+ _Array<_Tp> __a, _Array<size_t> __i)
+ {
+ size_t* __g (__f._M_data);
+ size_t* __j (__i._M_data);
+ for (size_t __k = 0; __k < __n; ++__k, ++__j, ++__g)
+ __a._M_data[*__j] = __e._M_data[*__g];
+ }
+
+ // Copy n consecutive elements of e into elements of a. Elements of
+ // a are skipped if the corresponding element of m is false. m must
+ // have at least n true elements and a must have at least as many
+ // elements as the index of the nth true element of m. I.e. if m
+ // has 5 false followed by 10 true elements and n == 10, a must have
+ // at least 15 elements.
+ template<typename _Tp, class _Dom>
+ void
+ __valarray_copy(const _Expr<_Dom, _Tp>& __e, size_t __n,
+ _Array<_Tp> __a, _Array<bool> __m)
+ {
+ bool* __ok (__m._M_data);
+ _Tp* __p (__a._M_data);
+ for (size_t __i = 0; __i < __n; ++__i, ++__ok, ++__p)
+ {
+ while (! *__ok)
+ {
+ ++__ok;
+ ++__p;
+ }
+ *__p = __e[__i];
+ }
+ }
+
+
+ template<typename _Tp, class _Dom>
+ void
+ __valarray_copy_construct(const _Expr<_Dom, _Tp>& __e, size_t __n,
+ _Array<_Tp> __a)
+ {
+ _Tp* __p (__a._M_data);
+ for (size_t __i = 0; __i < __n; ++__i, ++__p)
+ new (__p) _Tp(__e[__i]);
+ }
+
+
+ template<typename _Tp>
+ void
+ __valarray_copy_construct(_Array<_Tp> __a, _Array<bool> __m,
+ _Array<_Tp> __b, size_t __n)
+ {
+ _Tp* __p (__a._M_data);
+ bool* __ok (__m._M_data);
+ for (_Tp* __q = __b._M_data; __q < __b._M_data+__n; ++__q, ++__ok, ++__p)
+ {
+ while (! *__ok)
+ {
+ ++__ok;
+ ++__p;
+ }
+ new (__q) _Tp(*__p);
+ }
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _VALARRAY_ARRAY_TCC */
diff --git a/i686-linux/include/c++/4.4.3/bits/valarray_before.h b/i686-linux/include/c++/4.4.3/bits/valarray_before.h
new file mode 100644
index 0000000..444129b
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/valarray_before.h
@@ -0,0 +1,730 @@
+// The template and inlines for the -*- C++ -*- internal _Meta class.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file valarray_before.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@cmla.ens-cachan.fr>
+
+#ifndef _VALARRAY_BEFORE_H
+#define _VALARRAY_BEFORE_H 1
+
+#pragma GCC system_header
+
+#include <bits/slice_array.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ //
+ // Implementing a loosened valarray return value is tricky.
+ // First we need to meet 26.3.1/3: we should not add more than
+ // two levels of template nesting. Therefore we resort to template
+ // template to "flatten" loosened return value types.
+ // At some point we use partial specialization to remove one level
+ // template nesting due to _Expr<>
+ //
+
+ // This class is NOT defined. It doesn't need to.
+ template<typename _Tp1, typename _Tp2> class _Constant;
+
+ // Implementations of unary functions applied to valarray<>s.
+ // I use hard-coded object functions here instead of a generic
+ // approach like pointers to function:
+ // 1) correctness: some functions take references, others values.
+ // we can't deduce the correct type afterwards.
+ // 2) efficiency -- object functions can be easily inlined
+ // 3) be Koenig-lookup-friendly
+
+ struct __abs
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __t) const
+ { return abs(__t); }
+ };
+
+ struct __cos
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __t) const
+ { return cos(__t); }
+ };
+
+ struct __acos
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __t) const
+ { return acos(__t); }
+ };
+
+ struct __cosh
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __t) const
+ { return cosh(__t); }
+ };
+
+ struct __sin
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __t) const
+ { return sin(__t); }
+ };
+
+ struct __asin
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __t) const
+ { return asin(__t); }
+ };
+
+ struct __sinh
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __t) const
+ { return sinh(__t); }
+ };
+
+ struct __tan
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __t) const
+ { return tan(__t); }
+ };
+
+ struct __atan
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __t) const
+ { return atan(__t); }
+ };
+
+ struct __tanh
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __t) const
+ { return tanh(__t); }
+ };
+
+ struct __exp
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __t) const
+ { return exp(__t); }
+ };
+
+ struct __log
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __t) const
+ { return log(__t); }
+ };
+
+ struct __log10
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __t) const
+ { return log10(__t); }
+ };
+
+ struct __sqrt
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __t) const
+ { return sqrt(__t); }
+ };
+
+ // In the past, we used to tailor operator applications semantics
+ // to the specialization of standard function objects (i.e. plus<>, etc.)
+ // That is incorrect. Therefore we provide our own surrogates.
+
+ struct __unary_plus
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __t) const
+ { return +__t; }
+ };
+
+ struct __negate
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __t) const
+ { return -__t; }
+ };
+
+ struct __bitwise_not
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __t) const
+ { return ~__t; }
+ };
+
+ struct __plus
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x + __y; }
+ };
+
+ struct __minus
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x - __y; }
+ };
+
+ struct __multiplies
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x * __y; }
+ };
+
+ struct __divides
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x / __y; }
+ };
+
+ struct __modulus
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x % __y; }
+ };
+
+ struct __bitwise_xor
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x ^ __y; }
+ };
+
+ struct __bitwise_and
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x & __y; }
+ };
+
+ struct __bitwise_or
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x | __y; }
+ };
+
+ struct __shift_left
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x << __y; }
+ };
+
+ struct __shift_right
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x >> __y; }
+ };
+
+ struct __logical_and
+ {
+ template<typename _Tp>
+ bool operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x && __y; }
+ };
+
+ struct __logical_or
+ {
+ template<typename _Tp>
+ bool operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x || __y; }
+ };
+
+ struct __logical_not
+ {
+ template<typename _Tp>
+ bool operator()(const _Tp& __x) const { return !__x; }
+ };
+
+ struct __equal_to
+ {
+ template<typename _Tp>
+ bool operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x == __y; }
+ };
+
+ struct __not_equal_to
+ {
+ template<typename _Tp>
+ bool operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x != __y; }
+ };
+
+ struct __less
+ {
+ template<typename _Tp>
+ bool operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x < __y; }
+ };
+
+ struct __greater
+ {
+ template<typename _Tp>
+ bool operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x > __y; }
+ };
+
+ struct __less_equal
+ {
+ template<typename _Tp>
+ bool operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x <= __y; }
+ };
+
+ struct __greater_equal
+ {
+ template<typename _Tp>
+ bool operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x >= __y; }
+ };
+
+ // The few binary functions we miss.
+ struct __atan2
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __x, const _Tp& __y) const
+ { return atan2(__x, __y); }
+ };
+
+ struct __pow
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __x, const _Tp& __y) const
+ { return pow(__x, __y); }
+ };
+
+
+ // We need these bits in order to recover the return type of
+ // some functions/operators now that we're no longer using
+ // function templates.
+ template<typename, typename _Tp>
+ struct __fun
+ {
+ typedef _Tp result_type;
+ };
+
+ // several specializations for relational operators.
+ template<typename _Tp>
+ struct __fun<__logical_not, _Tp>
+ {
+ typedef bool result_type;
+ };
+
+ template<typename _Tp>
+ struct __fun<__logical_and, _Tp>
+ {
+ typedef bool result_type;
+ };
+
+ template<typename _Tp>
+ struct __fun<__logical_or, _Tp>
+ {
+ typedef bool result_type;
+ };
+
+ template<typename _Tp>
+ struct __fun<__less, _Tp>
+ {
+ typedef bool result_type;
+ };
+
+ template<typename _Tp>
+ struct __fun<__greater, _Tp>
+ {
+ typedef bool result_type;
+ };
+
+ template<typename _Tp>
+ struct __fun<__less_equal, _Tp>
+ {
+ typedef bool result_type;
+ };
+
+ template<typename _Tp>
+ struct __fun<__greater_equal, _Tp>
+ {
+ typedef bool result_type;
+ };
+
+ template<typename _Tp>
+ struct __fun<__equal_to, _Tp>
+ {
+ typedef bool result_type;
+ };
+
+ template<typename _Tp>
+ struct __fun<__not_equal_to, _Tp>
+ {
+ typedef bool result_type;
+ };
+
+ //
+ // Apply function taking a value/const reference closure
+ //
+
+ template<typename _Dom, typename _Arg>
+ class _FunBase
+ {
+ public:
+ typedef typename _Dom::value_type value_type;
+
+ _FunBase(const _Dom& __e, value_type __f(_Arg))
+ : _M_expr(__e), _M_func(__f) {}
+
+ value_type operator[](size_t __i) const
+ { return _M_func (_M_expr[__i]); }
+
+ size_t size() const { return _M_expr.size ();}
+
+ private:
+ const _Dom& _M_expr;
+ value_type (*_M_func)(_Arg);
+ };
+
+ template<class _Dom>
+ struct _ValFunClos<_Expr,_Dom> : _FunBase<_Dom, typename _Dom::value_type>
+ {
+ typedef _FunBase<_Dom, typename _Dom::value_type> _Base;
+ typedef typename _Base::value_type value_type;
+ typedef value_type _Tp;
+
+ _ValFunClos(const _Dom& __e, _Tp __f(_Tp)) : _Base(__e, __f) {}
+ };
+
+ template<typename _Tp>
+ struct _ValFunClos<_ValArray,_Tp> : _FunBase<valarray<_Tp>, _Tp>
+ {
+ typedef _FunBase<valarray<_Tp>, _Tp> _Base;
+ typedef _Tp value_type;
+
+ _ValFunClos(const valarray<_Tp>& __v, _Tp __f(_Tp)) : _Base(__v, __f) {}
+ };
+
+ template<class _Dom>
+ struct _RefFunClos<_Expr, _Dom>
+ : _FunBase<_Dom, const typename _Dom::value_type&>
+ {
+ typedef _FunBase<_Dom, const typename _Dom::value_type&> _Base;
+ typedef typename _Base::value_type value_type;
+ typedef value_type _Tp;
+
+ _RefFunClos(const _Dom& __e, _Tp __f(const _Tp&))
+ : _Base(__e, __f) {}
+ };
+
+ template<typename _Tp>
+ struct _RefFunClos<_ValArray, _Tp>
+ : _FunBase<valarray<_Tp>, const _Tp&>
+ {
+ typedef _FunBase<valarray<_Tp>, const _Tp&> _Base;
+ typedef _Tp value_type;
+
+ _RefFunClos(const valarray<_Tp>& __v, _Tp __f(const _Tp&))
+ : _Base(__v, __f) {}
+ };
+
+ //
+ // Unary expression closure.
+ //
+
+ template<class _Oper, class _Arg>
+ class _UnBase
+ {
+ public:
+ typedef typename _Arg::value_type _Vt;
+ typedef typename __fun<_Oper, _Vt>::result_type value_type;
+
+ _UnBase(const _Arg& __e) : _M_expr(__e) {}
+
+ value_type operator[](size_t __i) const
+ { return _Oper()(_M_expr[__i]); }
+
+ size_t size() const { return _M_expr.size(); }
+
+ private:
+ const _Arg& _M_expr;
+ };
+
+ template<class _Oper, class _Dom>
+ struct _UnClos<_Oper, _Expr, _Dom>
+ : _UnBase<_Oper, _Dom>
+ {
+ typedef _Dom _Arg;
+ typedef _UnBase<_Oper, _Dom> _Base;
+ typedef typename _Base::value_type value_type;
+
+ _UnClos(const _Arg& __e) : _Base(__e) {}
+ };
+
+ template<class _Oper, typename _Tp>
+ struct _UnClos<_Oper, _ValArray, _Tp>
+ : _UnBase<_Oper, valarray<_Tp> >
+ {
+ typedef valarray<_Tp> _Arg;
+ typedef _UnBase<_Oper, valarray<_Tp> > _Base;
+ typedef typename _Base::value_type value_type;
+
+ _UnClos(const _Arg& __e) : _Base(__e) {}
+ };
+
+
+ //
+ // Binary expression closure.
+ //
+
+ template<class _Oper, class _FirstArg, class _SecondArg>
+ class _BinBase
+ {
+ public:
+ typedef typename _FirstArg::value_type _Vt;
+ typedef typename __fun<_Oper, _Vt>::result_type value_type;
+
+ _BinBase(const _FirstArg& __e1, const _SecondArg& __e2)
+ : _M_expr1(__e1), _M_expr2(__e2) {}
+
+ value_type operator[](size_t __i) const
+ { return _Oper()(_M_expr1[__i], _M_expr2[__i]); }
+
+ size_t size() const { return _M_expr1.size(); }
+
+ private:
+ const _FirstArg& _M_expr1;
+ const _SecondArg& _M_expr2;
+ };
+
+
+ template<class _Oper, class _Clos>
+ class _BinBase2
+ {
+ public:
+ typedef typename _Clos::value_type _Vt;
+ typedef typename __fun<_Oper, _Vt>::result_type value_type;
+
+ _BinBase2(const _Clos& __e, const _Vt& __t)
+ : _M_expr1(__e), _M_expr2(__t) {}
+
+ value_type operator[](size_t __i) const
+ { return _Oper()(_M_expr1[__i], _M_expr2); }
+
+ size_t size() const { return _M_expr1.size(); }
+
+ private:
+ const _Clos& _M_expr1;
+ const _Vt& _M_expr2;
+ };
+
+ template<class _Oper, class _Clos>
+ class _BinBase1
+ {
+ public:
+ typedef typename _Clos::value_type _Vt;
+ typedef typename __fun<_Oper, _Vt>::result_type value_type;
+
+ _BinBase1(const _Vt& __t, const _Clos& __e)
+ : _M_expr1(__t), _M_expr2(__e) {}
+
+ value_type operator[](size_t __i) const
+ { return _Oper()(_M_expr1, _M_expr2[__i]); }
+
+ size_t size() const { return _M_expr2.size(); }
+
+ private:
+ const _Vt& _M_expr1;
+ const _Clos& _M_expr2;
+ };
+
+ template<class _Oper, class _Dom1, class _Dom2>
+ struct _BinClos<_Oper, _Expr, _Expr, _Dom1, _Dom2>
+ : _BinBase<_Oper, _Dom1, _Dom2>
+ {
+ typedef _BinBase<_Oper, _Dom1, _Dom2> _Base;
+ typedef typename _Base::value_type value_type;
+
+ _BinClos(const _Dom1& __e1, const _Dom2& __e2) : _Base(__e1, __e2) {}
+ };
+
+ template<class _Oper, typename _Tp>
+ struct _BinClos<_Oper,_ValArray, _ValArray, _Tp, _Tp>
+ : _BinBase<_Oper, valarray<_Tp>, valarray<_Tp> >
+ {
+ typedef _BinBase<_Oper, valarray<_Tp>, valarray<_Tp> > _Base;
+ typedef typename _Base::value_type value_type;
+
+ _BinClos(const valarray<_Tp>& __v, const valarray<_Tp>& __w)
+ : _Base(__v, __w) {}
+ };
+
+ template<class _Oper, class _Dom>
+ struct _BinClos<_Oper, _Expr, _ValArray, _Dom, typename _Dom::value_type>
+ : _BinBase<_Oper, _Dom, valarray<typename _Dom::value_type> >
+ {
+ typedef typename _Dom::value_type _Tp;
+ typedef _BinBase<_Oper,_Dom,valarray<_Tp> > _Base;
+ typedef typename _Base::value_type value_type;
+
+ _BinClos(const _Dom& __e1, const valarray<_Tp>& __e2)
+ : _Base(__e1, __e2) {}
+ };
+
+ template<class _Oper, class _Dom>
+ struct _BinClos<_Oper, _ValArray, _Expr, typename _Dom::value_type, _Dom>
+ : _BinBase<_Oper, valarray<typename _Dom::value_type>,_Dom>
+ {
+ typedef typename _Dom::value_type _Tp;
+ typedef _BinBase<_Oper, valarray<_Tp>, _Dom> _Base;
+ typedef typename _Base::value_type value_type;
+
+ _BinClos(const valarray<_Tp>& __e1, const _Dom& __e2)
+ : _Base(__e1, __e2) {}
+ };
+
+ template<class _Oper, class _Dom>
+ struct _BinClos<_Oper, _Expr, _Constant, _Dom, typename _Dom::value_type>
+ : _BinBase2<_Oper, _Dom>
+ {
+ typedef typename _Dom::value_type _Tp;
+ typedef _BinBase2<_Oper,_Dom> _Base;
+ typedef typename _Base::value_type value_type;
+
+ _BinClos(const _Dom& __e1, const _Tp& __e2) : _Base(__e1, __e2) {}
+ };
+
+ template<class _Oper, class _Dom>
+ struct _BinClos<_Oper, _Constant, _Expr, typename _Dom::value_type, _Dom>
+ : _BinBase1<_Oper, _Dom>
+ {
+ typedef typename _Dom::value_type _Tp;
+ typedef _BinBase1<_Oper, _Dom> _Base;
+ typedef typename _Base::value_type value_type;
+
+ _BinClos(const _Tp& __e1, const _Dom& __e2) : _Base(__e1, __e2) {}
+ };
+
+ template<class _Oper, typename _Tp>
+ struct _BinClos<_Oper, _ValArray, _Constant, _Tp, _Tp>
+ : _BinBase2<_Oper, valarray<_Tp> >
+ {
+ typedef _BinBase2<_Oper,valarray<_Tp> > _Base;
+ typedef typename _Base::value_type value_type;
+
+ _BinClos(const valarray<_Tp>& __v, const _Tp& __t) : _Base(__v, __t) {}
+ };
+
+ template<class _Oper, typename _Tp>
+ struct _BinClos<_Oper, _Constant, _ValArray, _Tp, _Tp>
+ : _BinBase1<_Oper, valarray<_Tp> >
+ {
+ typedef _BinBase1<_Oper, valarray<_Tp> > _Base;
+ typedef typename _Base::value_type value_type;
+
+ _BinClos(const _Tp& __t, const valarray<_Tp>& __v) : _Base(__t, __v) {}
+ };
+
+ //
+ // slice_array closure.
+ //
+ template<typename _Dom>
+ class _SBase
+ {
+ public:
+ typedef typename _Dom::value_type value_type;
+
+ _SBase (const _Dom& __e, const slice& __s)
+ : _M_expr (__e), _M_slice (__s) {}
+
+ value_type
+ operator[] (size_t __i) const
+ { return _M_expr[_M_slice.start () + __i * _M_slice.stride ()]; }
+
+ size_t
+ size() const
+ { return _M_slice.size (); }
+
+ private:
+ const _Dom& _M_expr;
+ const slice& _M_slice;
+ };
+
+ template<typename _Tp>
+ class _SBase<_Array<_Tp> >
+ {
+ public:
+ typedef _Tp value_type;
+
+ _SBase (_Array<_Tp> __a, const slice& __s)
+ : _M_array (__a._M_data+__s.start()), _M_size (__s.size()),
+ _M_stride (__s.stride()) {}
+
+ value_type
+ operator[] (size_t __i) const
+ { return _M_array._M_data[__i * _M_stride]; }
+
+ size_t
+ size() const
+ { return _M_size; }
+
+ private:
+ const _Array<_Tp> _M_array;
+ const size_t _M_size;
+ const size_t _M_stride;
+ };
+
+ template<class _Dom>
+ struct _SClos<_Expr, _Dom>
+ : _SBase<_Dom>
+ {
+ typedef _SBase<_Dom> _Base;
+ typedef typename _Base::value_type value_type;
+
+ _SClos (const _Dom& __e, const slice& __s) : _Base (__e, __s) {}
+ };
+
+ template<typename _Tp>
+ struct _SClos<_ValArray, _Tp>
+ : _SBase<_Array<_Tp> >
+ {
+ typedef _SBase<_Array<_Tp> > _Base;
+ typedef _Tp value_type;
+
+ _SClos (_Array<_Tp> __a, const slice& __s) : _Base (__a, __s) {}
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _CPP_VALARRAY_BEFORE_H */
diff --git a/i686-linux/include/c++/4.4.3/bits/vector.tcc b/i686-linux/include/c++/4.4.3/bits/vector.tcc
new file mode 100644
index 0000000..8f67493
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bits/vector.tcc
@@ -0,0 +1,681 @@
+// Vector implementation (out of line) -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file vector.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _VECTOR_TCC
+#define _VECTOR_TCC 1
+
+_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
+
+ template<typename _Tp, typename _Alloc>
+ void
+ vector<_Tp, _Alloc>::
+ reserve(size_type __n)
+ {
+ if (__n > this->max_size())
+ __throw_length_error(__N("vector::reserve"));
+ if (this->capacity() < __n)
+ {
+ const size_type __old_size = size();
+ pointer __tmp = _M_allocate_and_copy(__n,
+ _GLIBCXX_MAKE_MOVE_ITERATOR(this->_M_impl._M_start),
+ _GLIBCXX_MAKE_MOVE_ITERATOR(this->_M_impl._M_finish));
+ std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ _M_deallocate(this->_M_impl._M_start,
+ this->_M_impl._M_end_of_storage
+ - this->_M_impl._M_start);
+ this->_M_impl._M_start = __tmp;
+ this->_M_impl._M_finish = __tmp + __old_size;
+ this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
+ }
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp, typename _Alloc>
+ template<typename... _Args>
+ void
+ vector<_Tp, _Alloc>::
+ emplace_back(_Args&&... __args)
+ {
+ if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
+ {
+ this->_M_impl.construct(this->_M_impl._M_finish,
+ std::forward<_Args>(__args)...);
+ ++this->_M_impl._M_finish;
+ }
+ else
+ _M_insert_aux(end(), std::forward<_Args>(__args)...);
+ }
+#endif
+
+ template<typename _Tp, typename _Alloc>
+ typename vector<_Tp, _Alloc>::iterator
+ vector<_Tp, _Alloc>::
+ insert(iterator __position, const value_type& __x)
+ {
+ const size_type __n = __position - begin();
+ if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage
+ && __position == end())
+ {
+ this->_M_impl.construct(this->_M_impl._M_finish, __x);
+ ++this->_M_impl._M_finish;
+ }
+ else
+ {
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
+ {
+ _Tp __x_copy = __x;
+ _M_insert_aux(__position, std::move(__x_copy));
+ }
+ else
+#endif
+ _M_insert_aux(__position, __x);
+ }
+ return iterator(this->_M_impl._M_start + __n);
+ }
+
+ template<typename _Tp, typename _Alloc>
+ typename vector<_Tp, _Alloc>::iterator
+ vector<_Tp, _Alloc>::
+ erase(iterator __position)
+ {
+ if (__position + 1 != end())
+ _GLIBCXX_MOVE3(__position + 1, end(), __position);
+ --this->_M_impl._M_finish;
+ this->_M_impl.destroy(this->_M_impl._M_finish);
+ return __position;
+ }
+
+ template<typename _Tp, typename _Alloc>
+ typename vector<_Tp, _Alloc>::iterator
+ vector<_Tp, _Alloc>::
+ erase(iterator __first, iterator __last)
+ {
+ if (__last != end())
+ _GLIBCXX_MOVE3(__last, end(), __first);
+ _M_erase_at_end(__first.base() + (end() - __last));
+ return __first;
+ }
+
+ template<typename _Tp, typename _Alloc>
+ vector<_Tp, _Alloc>&
+ vector<_Tp, _Alloc>::
+ operator=(const vector<_Tp, _Alloc>& __x)
+ {
+ if (&__x != this)
+ {
+ const size_type __xlen = __x.size();
+ if (__xlen > capacity())
+ {
+ pointer __tmp = _M_allocate_and_copy(__xlen, __x.begin(),
+ __x.end());
+ std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ _M_deallocate(this->_M_impl._M_start,
+ this->_M_impl._M_end_of_storage
+ - this->_M_impl._M_start);
+ this->_M_impl._M_start = __tmp;
+ this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __xlen;
+ }
+ else if (size() >= __xlen)
+ {
+ std::_Destroy(std::copy(__x.begin(), __x.end(), begin()),
+ end(), _M_get_Tp_allocator());
+ }
+ else
+ {
+ std::copy(__x._M_impl._M_start, __x._M_impl._M_start + size(),
+ this->_M_impl._M_start);
+ std::__uninitialized_copy_a(__x._M_impl._M_start + size(),
+ __x._M_impl._M_finish,
+ this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ }
+ this->_M_impl._M_finish = this->_M_impl._M_start + __xlen;
+ }
+ return *this;
+ }
+
+ template<typename _Tp, typename _Alloc>
+ void
+ vector<_Tp, _Alloc>::
+ _M_fill_assign(size_t __n, const value_type& __val)
+ {
+ if (__n > capacity())
+ {
+ vector __tmp(__n, __val, _M_get_Tp_allocator());
+ __tmp.swap(*this);
+ }
+ else if (__n > size())
+ {
+ std::fill(begin(), end(), __val);
+ std::__uninitialized_fill_n_a(this->_M_impl._M_finish,
+ __n - size(), __val,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_finish += __n - size();
+ }
+ else
+ _M_erase_at_end(std::fill_n(this->_M_impl._M_start, __n, __val));
+ }
+
+ template<typename _Tp, typename _Alloc>
+ template<typename _InputIterator>
+ void
+ vector<_Tp, _Alloc>::
+ _M_assign_aux(_InputIterator __first, _InputIterator __last,
+ std::input_iterator_tag)
+ {
+ pointer __cur(this->_M_impl._M_start);
+ for (; __first != __last && __cur != this->_M_impl._M_finish;
+ ++__cur, ++__first)
+ *__cur = *__first;
+ if (__first == __last)
+ _M_erase_at_end(__cur);
+ else
+ insert(end(), __first, __last);
+ }
+
+ template<typename _Tp, typename _Alloc>
+ template<typename _ForwardIterator>
+ void
+ vector<_Tp, _Alloc>::
+ _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
+ std::forward_iterator_tag)
+ {
+ const size_type __len = std::distance(__first, __last);
+
+ if (__len > capacity())
+ {
+ pointer __tmp(_M_allocate_and_copy(__len, __first, __last));
+ std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ _M_deallocate(this->_M_impl._M_start,
+ this->_M_impl._M_end_of_storage
+ - this->_M_impl._M_start);
+ this->_M_impl._M_start = __tmp;
+ this->_M_impl._M_finish = this->_M_impl._M_start + __len;
+ this->_M_impl._M_end_of_storage = this->_M_impl._M_finish;
+ }
+ else if (size() >= __len)
+ _M_erase_at_end(std::copy(__first, __last, this->_M_impl._M_start));
+ else
+ {
+ _ForwardIterator __mid = __first;
+ std::advance(__mid, size());
+ std::copy(__first, __mid, this->_M_impl._M_start);
+ this->_M_impl._M_finish =
+ std::__uninitialized_copy_a(__mid, __last,
+ this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ }
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp, typename _Alloc>
+ template<typename... _Args>
+ typename vector<_Tp, _Alloc>::iterator
+ vector<_Tp, _Alloc>::
+ emplace(iterator __position, _Args&&... __args)
+ {
+ const size_type __n = __position - begin();
+ if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage
+ && __position == end())
+ {
+ this->_M_impl.construct(this->_M_impl._M_finish,
+ std::forward<_Args>(__args)...);
+ ++this->_M_impl._M_finish;
+ }
+ else
+ _M_insert_aux(__position, std::forward<_Args>(__args)...);
+ return iterator(this->_M_impl._M_start + __n);
+ }
+
+ template<typename _Tp, typename _Alloc>
+ template<typename... _Args>
+ void
+ vector<_Tp, _Alloc>::
+ _M_insert_aux(iterator __position, _Args&&... __args)
+#else
+ template<typename _Tp, typename _Alloc>
+ void
+ vector<_Tp, _Alloc>::
+ _M_insert_aux(iterator __position, const _Tp& __x)
+#endif
+ {
+ if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
+ {
+ this->_M_impl.construct(this->_M_impl._M_finish,
+ _GLIBCXX_MOVE(*(this->_M_impl._M_finish
+ - 1)));
+ ++this->_M_impl._M_finish;
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+ _Tp __x_copy = __x;
+#endif
+ _GLIBCXX_MOVE_BACKWARD3(__position.base(),
+ this->_M_impl._M_finish - 2,
+ this->_M_impl._M_finish - 1);
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+ *__position = __x_copy;
+#else
+ *__position = _Tp(std::forward<_Args>(__args)...);
+#endif
+ }
+ else
+ {
+ const size_type __len =
+ _M_check_len(size_type(1), "vector::_M_insert_aux");
+ const size_type __elems_before = __position - begin();
+ pointer __new_start(this->_M_allocate(__len));
+ pointer __new_finish(__new_start);
+ __try
+ {
+ // The order of the three operations is dictated by the C++0x
+ // case, where the moves could alter a new element belonging
+ // to the existing vector. This is an issue only for callers
+ // taking the element by const lvalue ref (see 23.1/13).
+ this->_M_impl.construct(__new_start + __elems_before,
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ std::forward<_Args>(__args)...);
+#else
+ __x);
+#endif
+ __new_finish = 0;
+
+ __new_finish =
+ std::__uninitialized_move_a(this->_M_impl._M_start,
+ __position.base(), __new_start,
+ _M_get_Tp_allocator());
+ ++__new_finish;
+
+ __new_finish =
+ std::__uninitialized_move_a(__position.base(),
+ this->_M_impl._M_finish,
+ __new_finish,
+ _M_get_Tp_allocator());
+ }
+ __catch(...)
+ {
+ if (!__new_finish)
+ this->_M_impl.destroy(__new_start + __elems_before);
+ else
+ std::_Destroy(__new_start, __new_finish, _M_get_Tp_allocator());
+ _M_deallocate(__new_start, __len);
+ __throw_exception_again;
+ }
+ std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ _M_deallocate(this->_M_impl._M_start,
+ this->_M_impl._M_end_of_storage
+ - this->_M_impl._M_start);
+ this->_M_impl._M_start = __new_start;
+ this->_M_impl._M_finish = __new_finish;
+ this->_M_impl._M_end_of_storage = __new_start + __len;
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ void
+ vector<_Tp, _Alloc>::
+ _M_fill_insert(iterator __position, size_type __n, const value_type& __x)
+ {
+ if (__n != 0)
+ {
+ if (size_type(this->_M_impl._M_end_of_storage
+ - this->_M_impl._M_finish) >= __n)
+ {
+ value_type __x_copy = __x;
+ const size_type __elems_after = end() - __position;
+ pointer __old_finish(this->_M_impl._M_finish);
+ if (__elems_after > __n)
+ {
+ std::__uninitialized_move_a(this->_M_impl._M_finish - __n,
+ this->_M_impl._M_finish,
+ this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_finish += __n;
+ _GLIBCXX_MOVE_BACKWARD3(__position.base(),
+ __old_finish - __n, __old_finish);
+ std::fill(__position.base(), __position.base() + __n,
+ __x_copy);
+ }
+ else
+ {
+ std::__uninitialized_fill_n_a(this->_M_impl._M_finish,
+ __n - __elems_after,
+ __x_copy,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_finish += __n - __elems_after;
+ std::__uninitialized_move_a(__position.base(), __old_finish,
+ this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_finish += __elems_after;
+ std::fill(__position.base(), __old_finish, __x_copy);
+ }
+ }
+ else
+ {
+ const size_type __len =
+ _M_check_len(__n, "vector::_M_fill_insert");
+ const size_type __elems_before = __position - begin();
+ pointer __new_start(this->_M_allocate(__len));
+ pointer __new_finish(__new_start);
+ __try
+ {
+ // See _M_insert_aux above.
+ std::__uninitialized_fill_n_a(__new_start + __elems_before,
+ __n, __x,
+ _M_get_Tp_allocator());
+ __new_finish = 0;
+
+ __new_finish =
+ std::__uninitialized_move_a(this->_M_impl._M_start,
+ __position.base(),
+ __new_start,
+ _M_get_Tp_allocator());
+ __new_finish += __n;
+
+ __new_finish =
+ std::__uninitialized_move_a(__position.base(),
+ this->_M_impl._M_finish,
+ __new_finish,
+ _M_get_Tp_allocator());
+ }
+ __catch(...)
+ {
+ if (!__new_finish)
+ std::_Destroy(__new_start + __elems_before,
+ __new_start + __elems_before + __n,
+ _M_get_Tp_allocator());
+ else
+ std::_Destroy(__new_start, __new_finish,
+ _M_get_Tp_allocator());
+ _M_deallocate(__new_start, __len);
+ __throw_exception_again;
+ }
+ std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ _M_deallocate(this->_M_impl._M_start,
+ this->_M_impl._M_end_of_storage
+ - this->_M_impl._M_start);
+ this->_M_impl._M_start = __new_start;
+ this->_M_impl._M_finish = __new_finish;
+ this->_M_impl._M_end_of_storage = __new_start + __len;
+ }
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ template<typename _InputIterator>
+ void
+ vector<_Tp, _Alloc>::
+ _M_range_insert(iterator __pos, _InputIterator __first,
+ _InputIterator __last, std::input_iterator_tag)
+ {
+ for (; __first != __last; ++__first)
+ {
+ __pos = insert(__pos, *__first);
+ ++__pos;
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ template<typename _ForwardIterator>
+ void
+ vector<_Tp, _Alloc>::
+ _M_range_insert(iterator __position, _ForwardIterator __first,
+ _ForwardIterator __last, std::forward_iterator_tag)
+ {
+ if (__first != __last)
+ {
+ const size_type __n = std::distance(__first, __last);
+ if (size_type(this->_M_impl._M_end_of_storage
+ - this->_M_impl._M_finish) >= __n)
+ {
+ const size_type __elems_after = end() - __position;
+ pointer __old_finish(this->_M_impl._M_finish);
+ if (__elems_after > __n)
+ {
+ std::__uninitialized_move_a(this->_M_impl._M_finish - __n,
+ this->_M_impl._M_finish,
+ this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_finish += __n;
+ _GLIBCXX_MOVE_BACKWARD3(__position.base(),
+ __old_finish - __n, __old_finish);
+ std::copy(__first, __last, __position);
+ }
+ else
+ {
+ _ForwardIterator __mid = __first;
+ std::advance(__mid, __elems_after);
+ std::__uninitialized_copy_a(__mid, __last,
+ this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_finish += __n - __elems_after;
+ std::__uninitialized_move_a(__position.base(),
+ __old_finish,
+ this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_finish += __elems_after;
+ std::copy(__first, __mid, __position);
+ }
+ }
+ else
+ {
+ const size_type __len =
+ _M_check_len(__n, "vector::_M_range_insert");
+ pointer __new_start(this->_M_allocate(__len));
+ pointer __new_finish(__new_start);
+ __try
+ {
+ __new_finish =
+ std::__uninitialized_move_a(this->_M_impl._M_start,
+ __position.base(),
+ __new_start,
+ _M_get_Tp_allocator());
+ __new_finish =
+ std::__uninitialized_copy_a(__first, __last,
+ __new_finish,
+ _M_get_Tp_allocator());
+ __new_finish =
+ std::__uninitialized_move_a(__position.base(),
+ this->_M_impl._M_finish,
+ __new_finish,
+ _M_get_Tp_allocator());
+ }
+ __catch(...)
+ {
+ std::_Destroy(__new_start, __new_finish,
+ _M_get_Tp_allocator());
+ _M_deallocate(__new_start, __len);
+ __throw_exception_again;
+ }
+ std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ _M_deallocate(this->_M_impl._M_start,
+ this->_M_impl._M_end_of_storage
+ - this->_M_impl._M_start);
+ this->_M_impl._M_start = __new_start;
+ this->_M_impl._M_finish = __new_finish;
+ this->_M_impl._M_end_of_storage = __new_start + __len;
+ }
+ }
+ }
+
+
+ // vector<bool>
+
+ template<typename _Alloc>
+ void
+ vector<bool, _Alloc>::
+ reserve(size_type __n)
+ {
+ if (__n > this->max_size())
+ __throw_length_error(__N("vector::reserve"));
+ if (this->capacity() < __n)
+ {
+ _Bit_type* __q = this->_M_allocate(__n);
+ this->_M_impl._M_finish = _M_copy_aligned(begin(), end(),
+ iterator(__q, 0));
+ this->_M_deallocate();
+ this->_M_impl._M_start = iterator(__q, 0);
+ this->_M_impl._M_end_of_storage = (__q + (__n + int(_S_word_bit) - 1)
+ / int(_S_word_bit));
+ }
+ }
+
+ template<typename _Alloc>
+ void
+ vector<bool, _Alloc>::
+ _M_fill_insert(iterator __position, size_type __n, bool __x)
+ {
+ if (__n == 0)
+ return;
+ if (capacity() - size() >= __n)
+ {
+ std::copy_backward(__position, end(),
+ this->_M_impl._M_finish + difference_type(__n));
+ std::fill(__position, __position + difference_type(__n), __x);
+ this->_M_impl._M_finish += difference_type(__n);
+ }
+ else
+ {
+ const size_type __len =
+ _M_check_len(__n, "vector<bool>::_M_fill_insert");
+ _Bit_type * __q = this->_M_allocate(__len);
+ iterator __i = _M_copy_aligned(begin(), __position,
+ iterator(__q, 0));
+ std::fill(__i, __i + difference_type(__n), __x);
+ this->_M_impl._M_finish = std::copy(__position, end(),
+ __i + difference_type(__n));
+ this->_M_deallocate();
+ this->_M_impl._M_end_of_storage = (__q + ((__len
+ + int(_S_word_bit) - 1)
+ / int(_S_word_bit)));
+ this->_M_impl._M_start = iterator(__q, 0);
+ }
+ }
+
+ template<typename _Alloc>
+ template<typename _ForwardIterator>
+ void
+ vector<bool, _Alloc>::
+ _M_insert_range(iterator __position, _ForwardIterator __first,
+ _ForwardIterator __last, std::forward_iterator_tag)
+ {
+ if (__first != __last)
+ {
+ size_type __n = std::distance(__first, __last);
+ if (capacity() - size() >= __n)
+ {
+ std::copy_backward(__position, end(),
+ this->_M_impl._M_finish
+ + difference_type(__n));
+ std::copy(__first, __last, __position);
+ this->_M_impl._M_finish += difference_type(__n);
+ }
+ else
+ {
+ const size_type __len =
+ _M_check_len(__n, "vector<bool>::_M_insert_range");
+ _Bit_type * __q = this->_M_allocate(__len);
+ iterator __i = _M_copy_aligned(begin(), __position,
+ iterator(__q, 0));
+ __i = std::copy(__first, __last, __i);
+ this->_M_impl._M_finish = std::copy(__position, end(), __i);
+ this->_M_deallocate();
+ this->_M_impl._M_end_of_storage = (__q
+ + ((__len
+ + int(_S_word_bit) - 1)
+ / int(_S_word_bit)));
+ this->_M_impl._M_start = iterator(__q, 0);
+ }
+ }
+ }
+
+ template<typename _Alloc>
+ void
+ vector<bool, _Alloc>::
+ _M_insert_aux(iterator __position, bool __x)
+ {
+ if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_of_storage)
+ {
+ std::copy_backward(__position, this->_M_impl._M_finish,
+ this->_M_impl._M_finish + 1);
+ *__position = __x;
+ ++this->_M_impl._M_finish;
+ }
+ else
+ {
+ const size_type __len =
+ _M_check_len(size_type(1), "vector<bool>::_M_insert_aux");
+ _Bit_type * __q = this->_M_allocate(__len);
+ iterator __i = _M_copy_aligned(begin(), __position,
+ iterator(__q, 0));
+ *__i++ = __x;
+ this->_M_impl._M_finish = std::copy(__position, end(), __i);
+ this->_M_deallocate();
+ this->_M_impl._M_end_of_storage = (__q + ((__len
+ + int(_S_word_bit) - 1)
+ / int(_S_word_bit)));
+ this->_M_impl._M_start = iterator(__q, 0);
+ }
+ }
+
+_GLIBCXX_END_NESTED_NAMESPACE
+
+#endif /* _VECTOR_TCC */
diff --git a/i686-linux/include/c++/4.4.3/bitset b/i686-linux/include/c++/4.4.3/bitset
new file mode 100644
index 0000000..5ca4429
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/bitset
@@ -0,0 +1,1396 @@
+// <bitset> -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1998
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file include/bitset
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_BITSET
+#define _GLIBCXX_BITSET 1
+
+#pragma GCC system_header
+
+#include <cstddef> // For size_t
+#include <string>
+#include <bits/functexcept.h> // For invalid_argument, out_of_range,
+ // overflow_error
+#include <iosfwd>
+#include <cxxabi-forced.h>
+
+#define _GLIBCXX_BITSET_BITS_PER_WORD (__CHAR_BIT__ * sizeof(unsigned long))
+#define _GLIBCXX_BITSET_WORDS(__n) \
+ ((__n) < 1 ? 0 : ((__n) + _GLIBCXX_BITSET_BITS_PER_WORD - 1) \
+ / _GLIBCXX_BITSET_BITS_PER_WORD)
+
+_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
+
+ /**
+ * Base class, general case. It is a class invariant that _Nw will be
+ * nonnegative.
+ *
+ * See documentation for bitset.
+ */
+ template<size_t _Nw>
+ struct _Base_bitset
+ {
+ typedef unsigned long _WordT;
+
+ /// 0 is the least significant word.
+ _WordT _M_w[_Nw];
+
+ _Base_bitset()
+ { _M_do_reset(); }
+
+ _Base_bitset(unsigned long __val)
+ {
+ _M_do_reset();
+ _M_w[0] = __val;
+ }
+
+ static size_t
+ _S_whichword(size_t __pos )
+ { return __pos / _GLIBCXX_BITSET_BITS_PER_WORD; }
+
+ static size_t
+ _S_whichbyte(size_t __pos )
+ { return (__pos % _GLIBCXX_BITSET_BITS_PER_WORD) / __CHAR_BIT__; }
+
+ static size_t
+ _S_whichbit(size_t __pos )
+ { return __pos % _GLIBCXX_BITSET_BITS_PER_WORD; }
+
+ static _WordT
+ _S_maskbit(size_t __pos )
+ { return (static_cast<_WordT>(1)) << _S_whichbit(__pos); }
+
+ _WordT&
+ _M_getword(size_t __pos)
+ { return _M_w[_S_whichword(__pos)]; }
+
+ _WordT
+ _M_getword(size_t __pos) const
+ { return _M_w[_S_whichword(__pos)]; }
+
+ _WordT&
+ _M_hiword()
+ { return _M_w[_Nw - 1]; }
+
+ _WordT
+ _M_hiword() const
+ { return _M_w[_Nw - 1]; }
+
+ void
+ _M_do_and(const _Base_bitset<_Nw>& __x)
+ {
+ for (size_t __i = 0; __i < _Nw; __i++)
+ _M_w[__i] &= __x._M_w[__i];
+ }
+
+ void
+ _M_do_or(const _Base_bitset<_Nw>& __x)
+ {
+ for (size_t __i = 0; __i < _Nw; __i++)
+ _M_w[__i] |= __x._M_w[__i];
+ }
+
+ void
+ _M_do_xor(const _Base_bitset<_Nw>& __x)
+ {
+ for (size_t __i = 0; __i < _Nw; __i++)
+ _M_w[__i] ^= __x._M_w[__i];
+ }
+
+ void
+ _M_do_left_shift(size_t __shift);
+
+ void
+ _M_do_right_shift(size_t __shift);
+
+ void
+ _M_do_flip()
+ {
+ for (size_t __i = 0; __i < _Nw; __i++)
+ _M_w[__i] = ~_M_w[__i];
+ }
+
+ void
+ _M_do_set()
+ {
+ for (size_t __i = 0; __i < _Nw; __i++)
+ _M_w[__i] = ~static_cast<_WordT>(0);
+ }
+
+ void
+ _M_do_reset()
+ { __builtin_memset(_M_w, 0, _Nw * sizeof(_WordT)); }
+
+ bool
+ _M_is_equal(const _Base_bitset<_Nw>& __x) const
+ {
+ for (size_t __i = 0; __i < _Nw; ++__i)
+ if (_M_w[__i] != __x._M_w[__i])
+ return false;
+ return true;
+ }
+
+ size_t
+ _M_are_all_aux() const
+ {
+ for (size_t __i = 0; __i < _Nw - 1; __i++)
+ if (_M_w[__i] != ~static_cast<_WordT>(0))
+ return 0;
+ return ((_Nw - 1) * _GLIBCXX_BITSET_BITS_PER_WORD
+ + __builtin_popcountl(_M_hiword()));
+ }
+
+ bool
+ _M_is_any() const
+ {
+ for (size_t __i = 0; __i < _Nw; __i++)
+ if (_M_w[__i] != static_cast<_WordT>(0))
+ return true;
+ return false;
+ }
+
+ size_t
+ _M_do_count() const
+ {
+ size_t __result = 0;
+ for (size_t __i = 0; __i < _Nw; __i++)
+ __result += __builtin_popcountl(_M_w[__i]);
+ return __result;
+ }
+
+ unsigned long
+ _M_do_to_ulong() const;
+
+ // find first "on" bit
+ size_t
+ _M_do_find_first(size_t __not_found) const;
+
+ // find the next "on" bit that follows "prev"
+ size_t
+ _M_do_find_next(size_t __prev, size_t __not_found) const;
+ };
+
+ // Definitions of non-inline functions from _Base_bitset.
+ template<size_t _Nw>
+ void
+ _Base_bitset<_Nw>::_M_do_left_shift(size_t __shift)
+ {
+ if (__builtin_expect(__shift != 0, 1))
+ {
+ const size_t __wshift = __shift / _GLIBCXX_BITSET_BITS_PER_WORD;
+ const size_t __offset = __shift % _GLIBCXX_BITSET_BITS_PER_WORD;
+
+ if (__offset == 0)
+ for (size_t __n = _Nw - 1; __n >= __wshift; --__n)
+ _M_w[__n] = _M_w[__n - __wshift];
+ else
+ {
+ const size_t __sub_offset = (_GLIBCXX_BITSET_BITS_PER_WORD
+ - __offset);
+ for (size_t __n = _Nw - 1; __n > __wshift; --__n)
+ _M_w[__n] = ((_M_w[__n - __wshift] << __offset)
+ | (_M_w[__n - __wshift - 1] >> __sub_offset));
+ _M_w[__wshift] = _M_w[0] << __offset;
+ }
+
+ std::fill(_M_w + 0, _M_w + __wshift, static_cast<_WordT>(0));
+ }
+ }
+
+ template<size_t _Nw>
+ void
+ _Base_bitset<_Nw>::_M_do_right_shift(size_t __shift)
+ {
+ if (__builtin_expect(__shift != 0, 1))
+ {
+ const size_t __wshift = __shift / _GLIBCXX_BITSET_BITS_PER_WORD;
+ const size_t __offset = __shift % _GLIBCXX_BITSET_BITS_PER_WORD;
+ const size_t __limit = _Nw - __wshift - 1;
+
+ if (__offset == 0)
+ for (size_t __n = 0; __n <= __limit; ++__n)
+ _M_w[__n] = _M_w[__n + __wshift];
+ else
+ {
+ const size_t __sub_offset = (_GLIBCXX_BITSET_BITS_PER_WORD
+ - __offset);
+ for (size_t __n = 0; __n < __limit; ++__n)
+ _M_w[__n] = ((_M_w[__n + __wshift] >> __offset)
+ | (_M_w[__n + __wshift + 1] << __sub_offset));
+ _M_w[__limit] = _M_w[_Nw-1] >> __offset;
+ }
+
+ std::fill(_M_w + __limit + 1, _M_w + _Nw, static_cast<_WordT>(0));
+ }
+ }
+
+ template<size_t _Nw>
+ unsigned long
+ _Base_bitset<_Nw>::_M_do_to_ulong() const
+ {
+ for (size_t __i = 1; __i < _Nw; ++__i)
+ if (_M_w[__i])
+ __throw_overflow_error(__N("_Base_bitset::_M_do_to_ulong"));
+ return _M_w[0];
+ }
+
+ template<size_t _Nw>
+ size_t
+ _Base_bitset<_Nw>::_M_do_find_first(size_t __not_found) const
+ {
+ for (size_t __i = 0; __i < _Nw; __i++)
+ {
+ _WordT __thisword = _M_w[__i];
+ if (__thisword != static_cast<_WordT>(0))
+ return (__i * _GLIBCXX_BITSET_BITS_PER_WORD
+ + __builtin_ctzl(__thisword));
+ }
+ // not found, so return an indication of failure.
+ return __not_found;
+ }
+
+ template<size_t _Nw>
+ size_t
+ _Base_bitset<_Nw>::_M_do_find_next(size_t __prev, size_t __not_found) const
+ {
+ // make bound inclusive
+ ++__prev;
+
+ // check out of bounds
+ if (__prev >= _Nw * _GLIBCXX_BITSET_BITS_PER_WORD)
+ return __not_found;
+
+ // search first word
+ size_t __i = _S_whichword(__prev);
+ _WordT __thisword = _M_w[__i];
+
+ // mask off bits below bound
+ __thisword &= (~static_cast<_WordT>(0)) << _S_whichbit(__prev);
+
+ if (__thisword != static_cast<_WordT>(0))
+ return (__i * _GLIBCXX_BITSET_BITS_PER_WORD
+ + __builtin_ctzl(__thisword));
+
+ // check subsequent words
+ __i++;
+ for (; __i < _Nw; __i++)
+ {
+ __thisword = _M_w[__i];
+ if (__thisword != static_cast<_WordT>(0))
+ return (__i * _GLIBCXX_BITSET_BITS_PER_WORD
+ + __builtin_ctzl(__thisword));
+ }
+ // not found, so return an indication of failure.
+ return __not_found;
+ } // end _M_do_find_next
+
+ /**
+ * Base class, specialization for a single word.
+ *
+ * See documentation for bitset.
+ */
+ template<>
+ struct _Base_bitset<1>
+ {
+ typedef unsigned long _WordT;
+ _WordT _M_w;
+
+ _Base_bitset(void)
+ : _M_w(0)
+ { }
+
+ _Base_bitset(unsigned long __val)
+ : _M_w(__val)
+ { }
+
+ static size_t
+ _S_whichword(size_t __pos )
+ { return __pos / _GLIBCXX_BITSET_BITS_PER_WORD; }
+
+ static size_t
+ _S_whichbyte(size_t __pos )
+ { return (__pos % _GLIBCXX_BITSET_BITS_PER_WORD) / __CHAR_BIT__; }
+
+ static size_t
+ _S_whichbit(size_t __pos )
+ { return __pos % _GLIBCXX_BITSET_BITS_PER_WORD; }
+
+ static _WordT
+ _S_maskbit(size_t __pos )
+ { return (static_cast<_WordT>(1)) << _S_whichbit(__pos); }
+
+ _WordT&
+ _M_getword(size_t)
+ { return _M_w; }
+
+ _WordT
+ _M_getword(size_t) const
+ { return _M_w; }
+
+ _WordT&
+ _M_hiword()
+ { return _M_w; }
+
+ _WordT
+ _M_hiword() const
+ { return _M_w; }
+
+ void
+ _M_do_and(const _Base_bitset<1>& __x)
+ { _M_w &= __x._M_w; }
+
+ void
+ _M_do_or(const _Base_bitset<1>& __x)
+ { _M_w |= __x._M_w; }
+
+ void
+ _M_do_xor(const _Base_bitset<1>& __x)
+ { _M_w ^= __x._M_w; }
+
+ void
+ _M_do_left_shift(size_t __shift)
+ { _M_w <<= __shift; }
+
+ void
+ _M_do_right_shift(size_t __shift)
+ { _M_w >>= __shift; }
+
+ void
+ _M_do_flip()
+ { _M_w = ~_M_w; }
+
+ void
+ _M_do_set()
+ { _M_w = ~static_cast<_WordT>(0); }
+
+ void
+ _M_do_reset()
+ { _M_w = 0; }
+
+ bool
+ _M_is_equal(const _Base_bitset<1>& __x) const
+ { return _M_w == __x._M_w; }
+
+ size_t
+ _M_are_all_aux() const
+ { return __builtin_popcountl(_M_w); }
+
+ bool
+ _M_is_any() const
+ { return _M_w != 0; }
+
+ size_t
+ _M_do_count() const
+ { return __builtin_popcountl(_M_w); }
+
+ unsigned long
+ _M_do_to_ulong() const
+ { return _M_w; }
+
+ size_t
+ _M_do_find_first(size_t __not_found) const
+ {
+ if (_M_w != 0)
+ return __builtin_ctzl(_M_w);
+ else
+ return __not_found;
+ }
+
+ // find the next "on" bit that follows "prev"
+ size_t
+ _M_do_find_next(size_t __prev, size_t __not_found) const
+ {
+ ++__prev;
+ if (__prev >= ((size_t) _GLIBCXX_BITSET_BITS_PER_WORD))
+ return __not_found;
+
+ _WordT __x = _M_w >> __prev;
+ if (__x != 0)
+ return __builtin_ctzl(__x) + __prev;
+ else
+ return __not_found;
+ }
+ };
+
+ /**
+ * Base class, specialization for no storage (zero-length %bitset).
+ *
+ * See documentation for bitset.
+ */
+ template<>
+ struct _Base_bitset<0>
+ {
+ typedef unsigned long _WordT;
+
+ _Base_bitset()
+ { }
+
+ _Base_bitset(unsigned long)
+ { }
+
+ static size_t
+ _S_whichword(size_t __pos )
+ { return __pos / _GLIBCXX_BITSET_BITS_PER_WORD; }
+
+ static size_t
+ _S_whichbyte(size_t __pos )
+ { return (__pos % _GLIBCXX_BITSET_BITS_PER_WORD) / __CHAR_BIT__; }
+
+ static size_t
+ _S_whichbit(size_t __pos )
+ { return __pos % _GLIBCXX_BITSET_BITS_PER_WORD; }
+
+ static _WordT
+ _S_maskbit(size_t __pos )
+ { return (static_cast<_WordT>(1)) << _S_whichbit(__pos); }
+
+ // This would normally give access to the data. The bounds-checking
+ // in the bitset class will prevent the user from getting this far,
+ // but (1) it must still return an lvalue to compile, and (2) the
+ // user might call _Unchecked_set directly, in which case this /needs/
+ // to fail. Let's not penalize zero-length users unless they actually
+ // make an unchecked call; all the memory ugliness is therefore
+ // localized to this single should-never-get-this-far function.
+ _WordT&
+ _M_getword(size_t) const
+ {
+ __throw_out_of_range(__N("_Base_bitset::_M_getword"));
+ return *new _WordT;
+ }
+
+ _WordT
+ _M_hiword() const
+ { return 0; }
+
+ void
+ _M_do_and(const _Base_bitset<0>&)
+ { }
+
+ void
+ _M_do_or(const _Base_bitset<0>&)
+ { }
+
+ void
+ _M_do_xor(const _Base_bitset<0>&)
+ { }
+
+ void
+ _M_do_left_shift(size_t)
+ { }
+
+ void
+ _M_do_right_shift(size_t)
+ { }
+
+ void
+ _M_do_flip()
+ { }
+
+ void
+ _M_do_set()
+ { }
+
+ void
+ _M_do_reset()
+ { }
+
+ // Are all empty bitsets equal to each other? Are they equal to
+ // themselves? How to compare a thing which has no state? What is
+ // the sound of one zero-length bitset clapping?
+ bool
+ _M_is_equal(const _Base_bitset<0>&) const
+ { return true; }
+
+ size_t
+ _M_are_all_aux() const
+ { return 0; }
+
+ bool
+ _M_is_any() const
+ { return false; }
+
+ size_t
+ _M_do_count() const
+ { return 0; }
+
+ unsigned long
+ _M_do_to_ulong() const
+ { return 0; }
+
+ // Normally "not found" is the size, but that could also be
+ // misinterpreted as an index in this corner case. Oh well.
+ size_t
+ _M_do_find_first(size_t) const
+ { return 0; }
+
+ size_t
+ _M_do_find_next(size_t, size_t) const
+ { return 0; }
+ };
+
+
+ // Helper class to zero out the unused high-order bits in the highest word.
+ template<size_t _Extrabits>
+ struct _Sanitize
+ {
+ static void _S_do_sanitize(unsigned long& __val)
+ { __val &= ~((~static_cast<unsigned long>(0)) << _Extrabits); }
+ };
+
+ template<>
+ struct _Sanitize<0>
+ { static void _S_do_sanitize(unsigned long) {} };
+
+ /**
+ * @brief The %bitset class represents a @e fixed-size sequence of bits.
+ *
+ * @ingroup containers
+ *
+ * (Note that %bitset does @e not meet the formal requirements of a
+ * <a href="tables.html#65">container</a>. Mainly, it lacks iterators.)
+ *
+ * The template argument, @a Nb, may be any non-negative number,
+ * specifying the number of bits (e.g., "0", "12", "1024*1024").
+ *
+ * In the general unoptimized case, storage is allocated in word-sized
+ * blocks. Let B be the number of bits in a word, then (Nb+(B-1))/B
+ * words will be used for storage. B - Nb%B bits are unused. (They are
+ * the high-order bits in the highest word.) It is a class invariant
+ * that those unused bits are always zero.
+ *
+ * If you think of %bitset as "a simple array of bits," be aware that
+ * your mental picture is reversed: a %bitset behaves the same way as
+ * bits in integers do, with the bit at index 0 in the "least significant
+ * / right-hand" position, and the bit at index Nb-1 in the "most
+ * significant / left-hand" position. Thus, unlike other containers, a
+ * %bitset's index "counts from right to left," to put it very loosely.
+ *
+ * This behavior is preserved when translating to and from strings. For
+ * example, the first line of the following program probably prints
+ * "b('a') is 0001100001" on a modern ASCII system.
+ *
+ * @code
+ * #include <bitset>
+ * #include <iostream>
+ * #include <sstream>
+ *
+ * using namespace std;
+ *
+ * int main()
+ * {
+ * long a = 'a';
+ * bitset<10> b(a);
+ *
+ * cout << "b('a') is " << b << endl;
+ *
+ * ostringstream s;
+ * s << b;
+ * string str = s.str();
+ * cout << "index 3 in the string is " << str[3] << " but\n"
+ * << "index 3 in the bitset is " << b[3] << endl;
+ * }
+ * @endcode
+ *
+ * Also see:
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt12ch33s02.html
+ * for a description of extensions.
+ *
+ * Most of the actual code isn't contained in %bitset<> itself, but in the
+ * base class _Base_bitset. The base class works with whole words, not with
+ * individual bits. This allows us to specialize _Base_bitset for the
+ * important special case where the %bitset is only a single word.
+ *
+ * Extra confusion can result due to the fact that the storage for
+ * _Base_bitset @e is a regular array, and is indexed as such. This is
+ * carefully encapsulated.
+ */
+ template<size_t _Nb>
+ class bitset
+ : private _Base_bitset<_GLIBCXX_BITSET_WORDS(_Nb)>
+ {
+ private:
+ typedef _Base_bitset<_GLIBCXX_BITSET_WORDS(_Nb)> _Base;
+ typedef unsigned long _WordT;
+
+ void
+ _M_do_sanitize()
+ {
+ _Sanitize<_Nb % _GLIBCXX_BITSET_BITS_PER_WORD>::
+ _S_do_sanitize(this->_M_hiword());
+ }
+
+ public:
+ /**
+ * This encapsulates the concept of a single bit. An instance of this
+ * class is a proxy for an actual bit; this way the individual bit
+ * operations are done as faster word-size bitwise instructions.
+ *
+ * Most users will never need to use this class directly; conversions
+ * to and from bool are automatic and should be transparent. Overloaded
+ * operators help to preserve the illusion.
+ *
+ * (On a typical system, this "bit %reference" is 64 times the size of
+ * an actual bit. Ha.)
+ */
+ class reference
+ {
+ friend class bitset;
+
+ _WordT *_M_wp;
+ size_t _M_bpos;
+
+ // left undefined
+ reference();
+
+ public:
+ reference(bitset& __b, size_t __pos)
+ {
+ _M_wp = &__b._M_getword(__pos);
+ _M_bpos = _Base::_S_whichbit(__pos);
+ }
+
+ ~reference()
+ { }
+
+ // For b[i] = __x;
+ reference&
+ operator=(bool __x)
+ {
+ if (__x)
+ *_M_wp |= _Base::_S_maskbit(_M_bpos);
+ else
+ *_M_wp &= ~_Base::_S_maskbit(_M_bpos);
+ return *this;
+ }
+
+ // For b[i] = b[__j];
+ reference&
+ operator=(const reference& __j)
+ {
+ if ((*(__j._M_wp) & _Base::_S_maskbit(__j._M_bpos)))
+ *_M_wp |= _Base::_S_maskbit(_M_bpos);
+ else
+ *_M_wp &= ~_Base::_S_maskbit(_M_bpos);
+ return *this;
+ }
+
+ // Flips the bit
+ bool
+ operator~() const
+ { return (*(_M_wp) & _Base::_S_maskbit(_M_bpos)) == 0; }
+
+ // For __x = b[i];
+ operator bool() const
+ { return (*(_M_wp) & _Base::_S_maskbit(_M_bpos)) != 0; }
+
+ // For b[i].flip();
+ reference&
+ flip()
+ {
+ *_M_wp ^= _Base::_S_maskbit(_M_bpos);
+ return *this;
+ }
+ };
+ friend class reference;
+
+ // 23.3.5.1 constructors:
+ /// All bits set to zero.
+ bitset()
+ { }
+
+ /// Initial bits bitwise-copied from a single word (others set to zero).
+ bitset(unsigned long __val)
+ : _Base(__val)
+ { _M_do_sanitize(); }
+
+ /**
+ * @brief Use a subset of a string.
+ * @param s A string of '0' and '1' characters.
+ * @param position Index of the first character in @a s to use;
+ * defaults to zero.
+ * @throw std::out_of_range If @a pos is bigger the size of @a s.
+ * @throw std::invalid_argument If a character appears in the string
+ * which is neither '0' nor '1'.
+ */
+ template<class _CharT, class _Traits, class _Alloc>
+ explicit
+ bitset(const std::basic_string<_CharT, _Traits, _Alloc>& __s,
+ size_t __position = 0)
+ : _Base()
+ {
+ if (__position > __s.size())
+ __throw_out_of_range(__N("bitset::bitset initial position "
+ "not valid"));
+ _M_copy_from_string(__s, __position,
+ std::basic_string<_CharT, _Traits, _Alloc>::npos,
+ _CharT('0'), _CharT('1'));
+ }
+
+ /**
+ * @brief Use a subset of a string.
+ * @param s A string of '0' and '1' characters.
+ * @param position Index of the first character in @a s to use.
+ * @param n The number of characters to copy.
+ * @throw std::out_of_range If @a pos is bigger the size of @a s.
+ * @throw std::invalid_argument If a character appears in the string
+ * which is neither '0' nor '1'.
+ */
+ template<class _CharT, class _Traits, class _Alloc>
+ bitset(const std::basic_string<_CharT, _Traits, _Alloc>& __s,
+ size_t __position, size_t __n)
+ : _Base()
+ {
+ if (__position > __s.size())
+ __throw_out_of_range(__N("bitset::bitset initial position "
+ "not valid"));
+ _M_copy_from_string(__s, __position, __n, _CharT('0'), _CharT('1'));
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 396. what are characters zero and one.
+ template<class _CharT, class _Traits, class _Alloc>
+ bitset(const std::basic_string<_CharT, _Traits, _Alloc>& __s,
+ size_t __position, size_t __n,
+ _CharT __zero, _CharT __one = _CharT('1'))
+ : _Base()
+ {
+ if (__position > __s.size())
+ __throw_out_of_range(__N("bitset::bitset initial position "
+ "not valid"));
+ _M_copy_from_string(__s, __position, __n, __zero, __one);
+ }
+
+ // 23.3.5.2 bitset operations:
+ //@{
+ /**
+ * @brief Operations on bitsets.
+ * @param rhs A same-sized bitset.
+ *
+ * These should be self-explanatory.
+ */
+ bitset<_Nb>&
+ operator&=(const bitset<_Nb>& __rhs)
+ {
+ this->_M_do_and(__rhs);
+ return *this;
+ }
+
+ bitset<_Nb>&
+ operator|=(const bitset<_Nb>& __rhs)
+ {
+ this->_M_do_or(__rhs);
+ return *this;
+ }
+
+ bitset<_Nb>&
+ operator^=(const bitset<_Nb>& __rhs)
+ {
+ this->_M_do_xor(__rhs);
+ return *this;
+ }
+ //@}
+
+ //@{
+ /**
+ * @brief Operations on bitsets.
+ * @param position The number of places to shift.
+ *
+ * These should be self-explanatory.
+ */
+ bitset<_Nb>&
+ operator<<=(size_t __position)
+ {
+ if (__builtin_expect(__position < _Nb, 1))
+ {
+ this->_M_do_left_shift(__position);
+ this->_M_do_sanitize();
+ }
+ else
+ this->_M_do_reset();
+ return *this;
+ }
+
+ bitset<_Nb>&
+ operator>>=(size_t __position)
+ {
+ if (__builtin_expect(__position < _Nb, 1))
+ {
+ this->_M_do_right_shift(__position);
+ this->_M_do_sanitize();
+ }
+ else
+ this->_M_do_reset();
+ return *this;
+ }
+ //@}
+
+ //@{
+ /**
+ * These versions of single-bit set, reset, flip, and test are
+ * extensions from the SGI version. They do no range checking.
+ * @ingroup SGIextensions
+ */
+ bitset<_Nb>&
+ _Unchecked_set(size_t __pos)
+ {
+ this->_M_getword(__pos) |= _Base::_S_maskbit(__pos);
+ return *this;
+ }
+
+ bitset<_Nb>&
+ _Unchecked_set(size_t __pos, int __val)
+ {
+ if (__val)
+ this->_M_getword(__pos) |= _Base::_S_maskbit(__pos);
+ else
+ this->_M_getword(__pos) &= ~_Base::_S_maskbit(__pos);
+ return *this;
+ }
+
+ bitset<_Nb>&
+ _Unchecked_reset(size_t __pos)
+ {
+ this->_M_getword(__pos) &= ~_Base::_S_maskbit(__pos);
+ return *this;
+ }
+
+ bitset<_Nb>&
+ _Unchecked_flip(size_t __pos)
+ {
+ this->_M_getword(__pos) ^= _Base::_S_maskbit(__pos);
+ return *this;
+ }
+
+ bool
+ _Unchecked_test(size_t __pos) const
+ { return ((this->_M_getword(__pos) & _Base::_S_maskbit(__pos))
+ != static_cast<_WordT>(0)); }
+ //@}
+
+ // Set, reset, and flip.
+ /**
+ * @brief Sets every bit to true.
+ */
+ bitset<_Nb>&
+ set()
+ {
+ this->_M_do_set();
+ this->_M_do_sanitize();
+ return *this;
+ }
+
+ /**
+ * @brief Sets a given bit to a particular value.
+ * @param position The index of the bit.
+ * @param val Either true or false, defaults to true.
+ * @throw std::out_of_range If @a pos is bigger the size of the %set.
+ */
+ bitset<_Nb>&
+ set(size_t __position, bool __val = true)
+ {
+ if (__position >= _Nb)
+ __throw_out_of_range(__N("bitset::set"));
+ return _Unchecked_set(__position, __val);
+ }
+
+ /**
+ * @brief Sets every bit to false.
+ */
+ bitset<_Nb>&
+ reset()
+ {
+ this->_M_do_reset();
+ return *this;
+ }
+
+ /**
+ * @brief Sets a given bit to false.
+ * @param position The index of the bit.
+ * @throw std::out_of_range If @a pos is bigger the size of the %set.
+ *
+ * Same as writing @c set(pos,false).
+ */
+ bitset<_Nb>&
+ reset(size_t __position)
+ {
+ if (__position >= _Nb)
+ __throw_out_of_range(__N("bitset::reset"));
+ return _Unchecked_reset(__position);
+ }
+
+ /**
+ * @brief Toggles every bit to its opposite value.
+ */
+ bitset<_Nb>&
+ flip()
+ {
+ this->_M_do_flip();
+ this->_M_do_sanitize();
+ return *this;
+ }
+
+ /**
+ * @brief Toggles a given bit to its opposite value.
+ * @param position The index of the bit.
+ * @throw std::out_of_range If @a pos is bigger the size of the %set.
+ */
+ bitset<_Nb>&
+ flip(size_t __position)
+ {
+ if (__position >= _Nb)
+ __throw_out_of_range(__N("bitset::flip"));
+ return _Unchecked_flip(__position);
+ }
+
+ /// See the no-argument flip().
+ bitset<_Nb>
+ operator~() const
+ { return bitset<_Nb>(*this).flip(); }
+
+ //@{
+ /**
+ * @brief Array-indexing support.
+ * @param position Index into the %bitset.
+ * @return A bool for a 'const %bitset'. For non-const bitsets, an
+ * instance of the reference proxy class.
+ * @note These operators do no range checking and throw no exceptions,
+ * as required by DR 11 to the standard.
+ *
+ * _GLIBCXX_RESOLVE_LIB_DEFECTS Note that this implementation already
+ * resolves DR 11 (items 1 and 2), but does not do the range-checking
+ * required by that DR's resolution. -pme
+ * The DR has since been changed: range-checking is a precondition
+ * (users' responsibility), and these functions must not throw. -pme
+ */
+ reference
+ operator[](size_t __position)
+ { return reference(*this,__position); }
+
+ bool
+ operator[](size_t __position) const
+ { return _Unchecked_test(__position); }
+ //@}
+
+ /**
+ * @brief Returns a numerical interpretation of the %bitset.
+ * @return The integral equivalent of the bits.
+ * @throw std::overflow_error If there are too many bits to be
+ * represented in an @c unsigned @c long.
+ */
+ unsigned long
+ to_ulong() const
+ { return this->_M_do_to_ulong(); }
+
+ /**
+ * @brief Returns a character interpretation of the %bitset.
+ * @return The string equivalent of the bits.
+ *
+ * Note the ordering of the bits: decreasing character positions
+ * correspond to increasing bit positions (see the main class notes for
+ * an example).
+ */
+ template<class _CharT, class _Traits, class _Alloc>
+ std::basic_string<_CharT, _Traits, _Alloc>
+ to_string() const
+ {
+ std::basic_string<_CharT, _Traits, _Alloc> __result;
+ _M_copy_to_string(__result, _CharT('0'), _CharT('1'));
+ return __result;
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 396. what are characters zero and one.
+ template<class _CharT, class _Traits, class _Alloc>
+ std::basic_string<_CharT, _Traits, _Alloc>
+ to_string(_CharT __zero, _CharT __one = _CharT('1')) const
+ {
+ std::basic_string<_CharT, _Traits, _Alloc> __result;
+ _M_copy_to_string(__result, __zero, __one);
+ return __result;
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 434. bitset::to_string() hard to use.
+ template<class _CharT, class _Traits>
+ std::basic_string<_CharT, _Traits, std::allocator<_CharT> >
+ to_string() const
+ { return to_string<_CharT, _Traits, std::allocator<_CharT> >(); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 853. to_string needs updating with zero and one.
+ template<class _CharT, class _Traits>
+ std::basic_string<_CharT, _Traits, std::allocator<_CharT> >
+ to_string(_CharT __zero, _CharT __one = _CharT('1')) const
+ { return to_string<_CharT, _Traits,
+ std::allocator<_CharT> >(__zero, __one); }
+
+ template<class _CharT>
+ std::basic_string<_CharT, std::char_traits<_CharT>,
+ std::allocator<_CharT> >
+ to_string() const
+ {
+ return to_string<_CharT, std::char_traits<_CharT>,
+ std::allocator<_CharT> >();
+ }
+
+ template<class _CharT>
+ std::basic_string<_CharT, std::char_traits<_CharT>,
+ std::allocator<_CharT> >
+ to_string(_CharT __zero, _CharT __one = _CharT('1')) const
+ {
+ return to_string<_CharT, std::char_traits<_CharT>,
+ std::allocator<_CharT> >(__zero, __one);
+ }
+
+ std::basic_string<char, std::char_traits<char>, std::allocator<char> >
+ to_string() const
+ {
+ return to_string<char, std::char_traits<char>,
+ std::allocator<char> >();
+ }
+
+ std::basic_string<char, std::char_traits<char>, std::allocator<char> >
+ to_string(char __zero, char __one = '1') const
+ {
+ return to_string<char, std::char_traits<char>,
+ std::allocator<char> >(__zero, __one);
+ }
+
+ // Helper functions for string operations.
+ template<class _CharT, class _Traits>
+ void
+ _M_copy_from_ptr(const _CharT*, size_t, size_t, size_t,
+ _CharT, _CharT);
+
+ template<class _CharT, class _Traits, class _Alloc>
+ void
+ _M_copy_from_string(const std::basic_string<_CharT,
+ _Traits, _Alloc>& __s, size_t __pos, size_t __n,
+ _CharT __zero, _CharT __one)
+ { _M_copy_from_ptr<_CharT, _Traits>(__s.data(), __s.size(), __pos, __n,
+ __zero, __one); }
+
+ template<class _CharT, class _Traits, class _Alloc>
+ void
+ _M_copy_to_string(std::basic_string<_CharT, _Traits, _Alloc>&,
+ _CharT, _CharT) const;
+
+ // NB: Backward compat.
+ template<class _CharT, class _Traits, class _Alloc>
+ void
+ _M_copy_from_string(const std::basic_string<_CharT,
+ _Traits, _Alloc>& __s, size_t __pos, size_t __n)
+ { _M_copy_from_string(__s, __pos, __n, _CharT('0'), _CharT('1')); }
+
+ template<class _CharT, class _Traits, class _Alloc>
+ void
+ _M_copy_to_string(std::basic_string<_CharT, _Traits,_Alloc>& __s) const
+ { _M_copy_to_string(__s, _CharT('0'), _CharT('1')); }
+
+ /// Returns the number of bits which are set.
+ size_t
+ count() const
+ { return this->_M_do_count(); }
+
+ /// Returns the total number of bits.
+ size_t
+ size() const
+ { return _Nb; }
+
+ //@{
+ /// These comparisons for equality/inequality are, well, @e bitwise.
+ bool
+ operator==(const bitset<_Nb>& __rhs) const
+ { return this->_M_is_equal(__rhs); }
+
+ bool
+ operator!=(const bitset<_Nb>& __rhs) const
+ { return !this->_M_is_equal(__rhs); }
+ //@}
+
+ /**
+ * @brief Tests the value of a bit.
+ * @param position The index of a bit.
+ * @return The value at @a pos.
+ * @throw std::out_of_range If @a pos is bigger the size of the %set.
+ */
+ bool
+ test(size_t __position) const
+ {
+ if (__position >= _Nb)
+ __throw_out_of_range(__N("bitset::test"));
+ return _Unchecked_test(__position);
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 693. std::bitset::all() missing.
+ /**
+ * @brief Tests whether all the bits are on.
+ * @return True if all the bits are set.
+ */
+ bool
+ all() const
+ { return this->_M_are_all_aux() == _Nb; }
+
+ /**
+ * @brief Tests whether any of the bits are on.
+ * @return True if at least one bit is set.
+ */
+ bool
+ any() const
+ { return this->_M_is_any(); }
+
+ /**
+ * @brief Tests whether any of the bits are on.
+ * @return True if none of the bits are set.
+ */
+ bool
+ none() const
+ { return !this->_M_is_any(); }
+
+ //@{
+ /// Self-explanatory.
+ bitset<_Nb>
+ operator<<(size_t __position) const
+ { return bitset<_Nb>(*this) <<= __position; }
+
+ bitset<_Nb>
+ operator>>(size_t __position) const
+ { return bitset<_Nb>(*this) >>= __position; }
+ //@}
+
+ /**
+ * @brief Finds the index of the first "on" bit.
+ * @return The index of the first bit set, or size() if not found.
+ * @ingroup SGIextensions
+ * @sa _Find_next
+ */
+ size_t
+ _Find_first() const
+ { return this->_M_do_find_first(_Nb); }
+
+ /**
+ * @brief Finds the index of the next "on" bit after prev.
+ * @return The index of the next bit set, or size() if not found.
+ * @param prev Where to start searching.
+ * @ingroup SGIextensions
+ * @sa _Find_first
+ */
+ size_t
+ _Find_next(size_t __prev ) const
+ { return this->_M_do_find_next(__prev, _Nb); }
+ };
+
+ // Definitions of non-inline member functions.
+ template<size_t _Nb>
+ template<class _CharT, class _Traits>
+ void
+ bitset<_Nb>::
+ _M_copy_from_ptr(const _CharT* __s, size_t __len,
+ size_t __pos, size_t __n, _CharT __zero, _CharT __one)
+ {
+ reset();
+ const size_t __nbits = std::min(_Nb, std::min(__n, __len - __pos));
+ for (size_t __i = __nbits; __i > 0; --__i)
+ {
+ const _CharT __c = __s[__pos + __nbits - __i];
+ if (_Traits::eq(__c, __zero))
+ ;
+ else if (_Traits::eq(__c, __one))
+ _Unchecked_set(__i - 1);
+ else
+ __throw_invalid_argument(__N("bitset::_M_copy_from_ptr"));
+ }
+ }
+
+ template<size_t _Nb>
+ template<class _CharT, class _Traits, class _Alloc>
+ void
+ bitset<_Nb>::
+ _M_copy_to_string(std::basic_string<_CharT, _Traits, _Alloc>& __s,
+ _CharT __zero, _CharT __one) const
+ {
+ __s.assign(_Nb, __zero);
+ for (size_t __i = _Nb; __i > 0; --__i)
+ if (_Unchecked_test(__i - 1))
+ _Traits::assign(__s[_Nb - __i], __one);
+ }
+
+ // 23.3.5.3 bitset operations:
+ //@{
+ /**
+ * @brief Global bitwise operations on bitsets.
+ * @param x A bitset.
+ * @param y A bitset of the same size as @a x.
+ * @return A new bitset.
+ *
+ * These should be self-explanatory.
+ */
+ template<size_t _Nb>
+ inline bitset<_Nb>
+ operator&(const bitset<_Nb>& __x, const bitset<_Nb>& __y)
+ {
+ bitset<_Nb> __result(__x);
+ __result &= __y;
+ return __result;
+ }
+
+ template<size_t _Nb>
+ inline bitset<_Nb>
+ operator|(const bitset<_Nb>& __x, const bitset<_Nb>& __y)
+ {
+ bitset<_Nb> __result(__x);
+ __result |= __y;
+ return __result;
+ }
+
+ template <size_t _Nb>
+ inline bitset<_Nb>
+ operator^(const bitset<_Nb>& __x, const bitset<_Nb>& __y)
+ {
+ bitset<_Nb> __result(__x);
+ __result ^= __y;
+ return __result;
+ }
+ //@}
+
+ //@{
+ /**
+ * @brief Global I/O operators for bitsets.
+ *
+ * Direct I/O between streams and bitsets is supported. Output is
+ * straightforward. Input will skip whitespace, only accept '0' and '1'
+ * characters, and will only extract as many digits as the %bitset will
+ * hold.
+ */
+ template<class _CharT, class _Traits, size_t _Nb>
+ std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x)
+ {
+ typedef typename _Traits::char_type char_type;
+ typedef std::basic_istream<_CharT, _Traits> __istream_type;
+ typedef typename __istream_type::ios_base __ios_base;
+
+ std::basic_string<_CharT, _Traits> __tmp;
+ __tmp.reserve(_Nb);
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 303. Bitset input operator underspecified
+ const char_type __zero = __is.widen('0');
+ const char_type __one = __is.widen('1');
+
+ typename __ios_base::iostate __state = __ios_base::goodbit;
+ typename __istream_type::sentry __sentry(__is);
+ if (__sentry)
+ {
+ __try
+ {
+ for (size_t __i = _Nb; __i > 0; --__i)
+ {
+ static typename _Traits::int_type __eof = _Traits::eof();
+
+ typename _Traits::int_type __c1 = __is.rdbuf()->sbumpc();
+ if (_Traits::eq_int_type(__c1, __eof))
+ {
+ __state |= __ios_base::eofbit;
+ break;
+ }
+ else
+ {
+ const char_type __c2 = _Traits::to_char_type(__c1);
+ if (_Traits::eq(__c2, __zero))
+ __tmp.push_back(__zero);
+ else if (_Traits::eq(__c2, __one))
+ __tmp.push_back(__one);
+ else if (_Traits::
+ eq_int_type(__is.rdbuf()->sputbackc(__c2),
+ __eof))
+ {
+ __state |= __ios_base::failbit;
+ break;
+ }
+ }
+ }
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ __is._M_setstate(__ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { __is._M_setstate(__ios_base::badbit); }
+ }
+
+ if (__tmp.empty() && _Nb)
+ __state |= __ios_base::failbit;
+ else
+ __x._M_copy_from_string(__tmp, static_cast<size_t>(0), _Nb,
+ __zero, __one);
+ if (__state)
+ __is.setstate(__state);
+ return __is;
+ }
+
+ template <class _CharT, class _Traits, size_t _Nb>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const bitset<_Nb>& __x)
+ {
+ std::basic_string<_CharT, _Traits> __tmp;
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 396. what are characters zero and one.
+ const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__os.getloc());
+ __x._M_copy_to_string(__tmp, __ct.widen('0'), __ct.widen('1'));
+ return __os << __tmp;
+ }
+ //@}
+
+_GLIBCXX_END_NESTED_NAMESPACE
+
+#undef _GLIBCXX_BITSET_WORDS
+#undef _GLIBCXX_BITSET_BITS_PER_WORD
+
+#ifdef _GLIBCXX_DEBUG
+# include <debug/bitset>
+#endif
+
+#endif /* _GLIBCXX_BITSET */
diff --git a/i686-linux/include/c++/4.4.3/c++0x_warning.h b/i686-linux/include/c++/4.4.3/c++0x_warning.h
new file mode 100644
index 0000000..b74f339
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/c++0x_warning.h
@@ -0,0 +1,36 @@
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/c++0x_warning.h
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _CXX0X_WARNING_H
+#define _CXX0X_WARNING_H 1
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+#error This file requires compiler and library support for the upcoming \
+ISO C++ standard, C++0x. This support is currently experimental, and must be \
+enabled with the -std=c++0x or -std=gnu++0x compiler options.
+#endif
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/cassert b/i686-linux/include/c++/4.4.3/cassert
new file mode 100644
index 0000000..186de0f
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/cassert
@@ -0,0 +1,45 @@
+// -*- C++ -*- forwarding header.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file cassert
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c assert.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
+
+//
+// ISO C++ 14882: 19.2 Assertions
+//
+
+// No include guards on this header...
+
+#pragma GCC system_header
+
+#include <assert.h>
diff --git a/i686-linux/include/c++/4.4.3/ccomplex b/i686-linux/include/c++/4.4.3/ccomplex
new file mode 100644
index 0000000..e347e17
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ccomplex
@@ -0,0 +1,44 @@
+// <ccomplex> -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/ccomplex
+ * This is a Standard C++ Library header.
+ */
+
+#pragma GCC system_header
+
+#ifndef _GLIBCXX_CCOMPLEX
+#define _GLIBCXX_CCOMPLEX 1
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#endif
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+#endif
+
+#include <complex>
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/cctype b/i686-linux/include/c++/4.4.3/cctype
new file mode 100644
index 0000000..44ef4d4
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/cctype
@@ -0,0 +1,101 @@
+// -*- C++ -*- forwarding header.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/cctype
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c ctype.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
+
+//
+// ISO C++ 14882: <ccytpe>
+//
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <ctype.h>
+
+#ifndef _GLIBCXX_CCTYPE
+#define _GLIBCXX_CCTYPE 1
+
+// Get rid of those macros defined in <ctype.h> in lieu of real functions.
+#undef isalnum
+#undef isalpha
+#undef iscntrl
+#undef isdigit
+#undef isgraph
+#undef islower
+#undef isprint
+#undef ispunct
+#undef isspace
+#undef isupper
+#undef isxdigit
+#undef tolower
+#undef toupper
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ using ::isalnum;
+ using ::isalpha;
+ using ::iscntrl;
+ using ::isdigit;
+ using ::isgraph;
+ using ::islower;
+ using ::isprint;
+ using ::ispunct;
+ using ::isspace;
+ using ::isupper;
+ using ::isxdigit;
+ using ::tolower;
+ using ::toupper;
+
+_GLIBCXX_END_NAMESPACE
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+# endif
+# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/cctype>
+# else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/cctype>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+# endif
+#endif
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/cerrno b/i686-linux/include/c++/4.4.3/cerrno
new file mode 100644
index 0000000..3716429
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/cerrno
@@ -0,0 +1,53 @@
+// The -*- C++ -*- forwarding header.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file cerrno
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c errno.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
+
+//
+// ISO C++ 14882: 19.3 Error numbers
+//
+
+#pragma GCC system_header
+
+#include <errno.h>
+
+#ifndef _GLIBCXX_CERRNO
+#define _GLIBCXX_CERRNO 1
+
+// Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998
+#ifndef errno
+#define errno errno
+#endif
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/cfenv b/i686-linux/include/c++/4.4.3/cfenv
new file mode 100644
index 0000000..9b02c8c
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/cfenv
@@ -0,0 +1,61 @@
+// <cfenv> -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/cfenv
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_CFENV
+#define _GLIBCXX_CFENV 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#endif
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+#endif
+
+#include <bits/c++config.h>
+#if _GLIBCXX_HAVE_FENV_H
+# include <fenv.h>
+#endif
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/cfenv>
+#else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/cfenv>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+#endif
+
+#endif // _GLIBCXX_CFENV
diff --git a/i686-linux/include/c++/4.4.3/cfloat b/i686-linux/include/c++/4.4.3/cfloat
new file mode 100644
index 0000000..54eb778
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/cfloat
@@ -0,0 +1,60 @@
+// -*- C++ -*- forwarding header.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/cfloat
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c float.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
+
+//
+// ISO C++ 14882: 18.2.2 Implementation properties: C library
+//
+
+#pragma GCC system_header
+
+#include <float.h>
+
+#ifndef _GLIBCXX_CFLOAT
+#define _GLIBCXX_CFLOAT 1
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+# endif
+# ifndef DECIMAL_DIG
+# define DECIMAL_DIG __DECIMAL_DIG__
+# endif
+# ifndef FLT_EVAL_METHOD
+# define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
+# endif
+#endif
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/chrono b/i686-linux/include/c++/4.4.3/chrono
new file mode 100644
index 0000000..aaa9646
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/chrono
@@ -0,0 +1,672 @@
+// <chrono> -*- C++ -*-
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/chrono
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_CHRONO
+#define _GLIBCXX_CHRONO 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#else
+
+#ifdef _GLIBCXX_INCLUDE_AS_TR1
+# error C++0x header cannot be included from TR1 header
+#endif
+
+#include <ratio>
+#include <type_traits>
+#include <limits>
+#include <ctime>
+
+#ifdef _GLIBCXX_USE_C99_STDINT_TR1
+
+namespace std
+{
+ /**
+ * @defgroup chrono Time
+ * @ingroup utilities
+ *
+ * Classes and functions for time.
+ * @{
+ */
+
+ /** @namespace std::chrono
+ * @brief ISO C++ 0x entities sub namespace for time and date.
+ */
+ namespace chrono
+ {
+ template<typename _Rep, typename _Period = ratio<1>>
+ struct duration;
+
+ template<typename _Clock, typename _Duration = typename _Clock::duration>
+ struct time_point;
+ }
+
+ // 20.8.2.3 specialization of common_type (for duration)
+ template<typename _Rep1, typename _Period1, typename _Rep2, typename _Period2>
+ struct common_type<chrono::duration<_Rep1, _Period1>,
+ chrono::duration<_Rep2, _Period2>>
+ {
+ typedef chrono::duration<typename common_type<_Rep1, _Rep2>::type,
+ ratio<__static_gcd<_Period1::num, _Period2::num>::value,
+ (_Period1::den / __static_gcd<_Period1::den, _Period2::den>::value)
+ * _Period2::den>> type;
+ };
+
+ // 20.8.2.3 specialization of common_type (for time_point)
+ template<typename _Clock, typename _Duration1, typename _Duration2>
+ struct common_type<chrono::time_point<_Clock, _Duration1>,
+ chrono::time_point<_Clock, _Duration2>>
+ {
+ typedef chrono::time_point<_Clock,
+ typename common_type<_Duration1, _Duration2>::type> type;
+ };
+
+ namespace chrono
+ {
+ // Primary template for duration_cast impl.
+ template<typename _ToDuration, typename _CF, typename _CR,
+ bool _NumIsOne = false, bool _DenIsOne = false>
+ struct __duration_cast_impl
+ {
+ template<typename _Rep, typename _Period>
+ static _ToDuration __cast(const duration<_Rep, _Period>& __d)
+ {
+ return _ToDuration(static_cast<
+ typename _ToDuration::rep>(static_cast<_CR>(__d.count())
+ * static_cast<_CR>(_CF::num)
+ / static_cast<_CR>(_CF::den)));
+ }
+ };
+
+ template<typename _ToDuration, typename _CF, typename _CR>
+ struct __duration_cast_impl<_ToDuration, _CF, _CR, true, true>
+ {
+ template<typename _Rep, typename _Period>
+ static _ToDuration __cast(const duration<_Rep, _Period>& __d)
+ {
+ return _ToDuration(
+ static_cast<typename _ToDuration::rep>(__d.count()));
+ }
+ };
+
+ template<typename _ToDuration, typename _CF, typename _CR>
+ struct __duration_cast_impl<_ToDuration, _CF, _CR, true, false>
+ {
+ template<typename _Rep, typename _Period>
+ static _ToDuration __cast(const duration<_Rep, _Period>& __d)
+ {
+ return _ToDuration(static_cast<typename _ToDuration::rep>(
+ static_cast<_CR>(__d.count()) / static_cast<_CR>(_CF::den)));
+ }
+ };
+
+ template<typename _ToDuration, typename _CF, typename _CR>
+ struct __duration_cast_impl<_ToDuration, _CF, _CR, false, true>
+ {
+ template<typename _Rep, typename _Period>
+ static _ToDuration __cast(const duration<_Rep, _Period>& __d)
+ {
+ return _ToDuration(static_cast<typename _ToDuration::rep>(
+ static_cast<_CR>(__d.count()) * static_cast<_CR>(_CF::num)));
+ }
+ };
+
+ /// duration_cast
+ template<typename _ToDuration, typename _Rep, typename _Period>
+ inline _ToDuration
+ duration_cast(const duration<_Rep, _Period>& __d)
+ {
+ typedef typename
+ ratio_divide<_Period, typename _ToDuration::period>::type __cf;
+ typedef typename
+ common_type<typename _ToDuration::rep, _Rep, intmax_t>::type __cr;
+
+ return __duration_cast_impl<_ToDuration, __cf, __cr,
+ __cf::num == 1, __cf::den == 1>::__cast(__d);
+ }
+
+ /// treat_as_floating_point
+ template<typename _Rep>
+ struct treat_as_floating_point
+ : is_floating_point<_Rep>
+ { };
+
+ /// duration_values
+ template<typename _Rep>
+ struct duration_values
+ {
+ static const _Rep
+ zero()
+ { return _Rep(0); }
+
+ static const _Rep
+ max()
+ { return numeric_limits<_Rep>::max(); }
+
+ static const _Rep
+ min()
+ { return numeric_limits<_Rep>::min(); }
+ };
+
+ template<typename _Tp>
+ struct __is_duration
+ : std::false_type
+ { };
+
+ template<typename _Rep, typename _Period>
+ struct __is_duration<duration<_Rep, _Period>>
+ : std::true_type
+ { };
+
+ template<typename T>
+ struct __is_ratio
+ : std::false_type
+ { };
+
+ template<intmax_t _Num, intmax_t _Den>
+ struct __is_ratio<ratio<_Num, _Den>>
+ : std::true_type
+ { };
+
+ /// duration
+ template<typename _Rep, typename _Period>
+ struct duration
+ {
+ static_assert(!__is_duration<_Rep>::value, "rep cannot be a duration");
+ static_assert(__is_ratio<_Period>::value,
+ "period must be a specialization of ratio");
+ static_assert(_Period::num > 0, "period must be positive");
+
+ typedef _Rep rep;
+ typedef _Period period;
+
+ // 20.8.3.1 construction / copy / destroy
+ duration() = default;
+
+ template<typename _Rep2>
+ explicit duration(_Rep2 const& __rep)
+ : __r(static_cast<rep>(__rep))
+ {
+ static_assert(is_convertible<_Rep2,rep>::value
+ && (treat_as_floating_point<rep>::value
+ || !treat_as_floating_point<_Rep2>::value),
+ "cannot construct integral duration with floating point type");
+ }
+
+ template<typename _Rep2, typename _Period2>
+ duration(const duration<_Rep2, _Period2>& __d)
+ : __r(duration_cast<duration>(__d).count())
+ {
+ static_assert(treat_as_floating_point<rep>::value == true
+ || ratio_divide<_Period2, period>::type::den == 1,
+ "the resulting duration is not exactly representable");
+ }
+
+ ~duration() = default;
+ duration(const duration&) = default;
+ duration& operator=(const duration&) = default;
+
+ // 20.8.3.2 observer
+ rep
+ count() const
+ { return __r; }
+
+ // 20.8.3.3 arithmetic
+ duration
+ operator+() const
+ { return *this; }
+
+ duration
+ operator-() const
+ { return duration(-__r); }
+
+ duration&
+ operator++()
+ {
+ ++__r;
+ return *this;
+ }
+
+ duration
+ operator++(int)
+ { return duration(__r++); }
+
+ duration&
+ operator--()
+ {
+ --__r;
+ return *this;
+ }
+
+ duration
+ operator--(int)
+ { return duration(__r--); }
+
+ duration&
+ operator+=(const duration& __d)
+ {
+ __r += __d.count();
+ return *this;
+ }
+
+ duration&
+ operator-=(const duration& __d)
+ {
+ __r -= __d.count();
+ return *this;
+ }
+
+ duration&
+ operator*=(const rep& __rhs)
+ {
+ __r *= __rhs;
+ return *this;
+ }
+
+ duration&
+ operator/=(const rep& __rhs)
+ {
+ __r /= __rhs;
+ return *this;
+ }
+
+ // 20.8.3.4 special values
+ // TODO: These should be constexprs.
+ static const duration
+ zero()
+ { return duration(duration_values<rep>::zero()); }
+
+ static const duration
+ min()
+ { return duration(duration_values<rep>::min()); }
+
+ static const duration
+ max()
+ { return duration(duration_values<rep>::max()); }
+
+ private:
+ rep __r;
+ };
+
+ template<typename _Rep1, typename _Period1,
+ typename _Rep2, typename _Period2>
+ inline typename common_type<duration<_Rep1, _Period1>,
+ duration<_Rep2, _Period2>>::type
+ operator+(const duration<_Rep1, _Period1>& __lhs,
+ const duration<_Rep2, _Period2>& __rhs)
+ {
+ typedef typename common_type<duration<_Rep1, _Period1>,
+ duration<_Rep2, _Period2>>::type __ct;
+ return __ct(__lhs) += __rhs;
+ }
+
+ template<typename _Rep1, typename _Period1,
+ typename _Rep2, typename _Period2>
+ inline typename common_type<duration<_Rep1, _Period1>,
+ duration<_Rep2, _Period2>>::type
+ operator-(const duration<_Rep1, _Period1>& __lhs,
+ const duration<_Rep2, _Period2>& __rhs)
+ {
+ typedef typename common_type<duration<_Rep1, _Period1>,
+ duration<_Rep2, _Period2>>::type __ct;
+ return __ct(__lhs) -= __rhs;
+ }
+
+ template<typename _Rep1, typename _Period, typename _Rep2>
+ inline duration<typename common_type<_Rep1, _Rep2>::type, _Period>
+ operator*(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
+ {
+ typedef typename common_type<_Rep1, _Rep2>::type __cr;
+ return duration<__cr, _Period>(__d) *= __s;
+ }
+
+ template<typename _Rep1, typename _Period, typename _Rep2>
+ inline duration<typename common_type<_Rep1, _Rep2>::type, _Period>
+ operator*(const _Rep2& __s, const duration<_Rep1, _Period>& __d)
+ { return __d * __s; }
+
+ template<typename _Tp, typename _Up, typename _Ep = void>
+ struct __division_impl;
+
+ template<typename _Rep1, typename _Period, typename _Rep2>
+ struct __division_impl<duration<_Rep1, _Period>, _Rep2,
+ typename enable_if<!__is_duration<_Rep2>::value>::type>
+ {
+ typedef typename common_type<_Rep1, _Rep2>::type __cr;
+ typedef
+ duration<typename common_type<_Rep1, _Rep2>::type, _Period> __rt;
+
+ static __rt
+ __divide(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
+ { return duration<__cr, _Period>(__d) /= __s; }
+ };
+
+ template<typename _Rep1, typename _Period1,
+ typename _Rep2, typename _Period2>
+ struct __division_impl<duration<_Rep1, _Period1>,
+ duration<_Rep2, _Period2>>
+ {
+ typedef typename common_type<duration<_Rep1, _Period1>,
+ duration<_Rep2, _Period2>>::type __ct;
+ typedef typename common_type<_Rep1, _Rep2>::type __rt;
+
+ static __rt
+ __divide(const duration<_Rep1, _Period1>& __lhs,
+ const duration<_Rep2, _Period2>& __rhs)
+ { return __ct(__lhs).count() / __ct(__rhs).count(); }
+ };
+
+ template<typename _Rep, typename _Period, typename _Up>
+ inline typename __division_impl<duration<_Rep, _Period>, _Up>::__rt
+ operator/(const duration<_Rep, _Period>& __d, const _Up& __u)
+ {
+ return
+ __division_impl<duration<_Rep, _Period>, _Up>::__divide(__d, __u);
+ }
+
+ // comparisons
+ template<typename _Rep1, typename _Period1,
+ typename _Rep2, typename _Period2>
+ inline bool
+ operator==(const duration<_Rep1, _Period1>& __lhs,
+ const duration<_Rep2, _Period2>& __rhs)
+ {
+ typedef typename common_type<duration<_Rep1, _Period1>,
+ duration<_Rep2, _Period2>>::type __ct;
+ return __ct(__lhs).count() == __ct(__rhs).count();
+ }
+
+ template<typename _Rep1, typename _Period1,
+ typename _Rep2, typename _Period2>
+ inline bool
+ operator<(const duration<_Rep1, _Period1>& __lhs,
+ const duration<_Rep2, _Period2>& __rhs)
+ {
+ typedef typename common_type<duration<_Rep1, _Period1>,
+ duration<_Rep2, _Period2>>::type __ct;
+ return __ct(__lhs).count() < __ct(__rhs).count();
+ }
+
+ template<typename _Rep1, typename _Period1,
+ typename _Rep2, typename _Period2>
+ inline bool
+ operator!=(const duration<_Rep1, _Period1>& __lhs,
+ const duration<_Rep2, _Period2>& __rhs)
+ { return !(__lhs == __rhs); }
+
+ template<typename _Rep1, typename _Period1,
+ typename _Rep2, typename _Period2>
+ inline bool
+ operator<=(const duration<_Rep1, _Period1>& __lhs,
+ const duration<_Rep2, _Period2>& __rhs)
+ { return !(__rhs < __lhs); }
+
+ template<typename _Rep1, typename _Period1,
+ typename _Rep2, typename _Period2>
+ inline bool
+ operator>(const duration<_Rep1, _Period1>& __lhs,
+ const duration<_Rep2, _Period2>& __rhs)
+ { return __rhs < __lhs; }
+
+ template<typename _Rep1, typename _Period1,
+ typename _Rep2, typename _Period2>
+ inline bool
+ operator>=(const duration<_Rep1, _Period1>& __lhs,
+ const duration<_Rep2, _Period2>& __rhs)
+ { return !(__lhs < __rhs); }
+
+ /// nanoseconds
+ typedef duration<int64_t, nano> nanoseconds;
+
+ /// microseconds
+ typedef duration<int64_t, micro> microseconds;
+
+ /// milliseconds
+ typedef duration<int64_t, milli> milliseconds;
+
+ /// seconds
+ typedef duration<int64_t > seconds;
+
+ /// minutes
+ typedef duration<int, ratio< 60>> minutes;
+
+ /// hours
+ typedef duration<int, ratio<3600>> hours;
+
+ /// time_point
+ template<typename _Clock, typename _Duration>
+ struct time_point
+ {
+ typedef _Clock clock;
+ typedef _Duration duration;
+ typedef typename duration::rep rep;
+ typedef typename duration::period period;
+
+ time_point() : __d(duration::zero())
+ { }
+
+ explicit time_point(const duration& __dur)
+ : __d(duration::zero() + __dur)
+ { }
+
+ // conversions
+ template<typename _Duration2>
+ time_point(const time_point<clock, _Duration2>& __t)
+ : __d(__t.time_since_epoch())
+ { }
+
+ // observer
+ duration
+ time_since_epoch() const
+ { return __d; }
+
+ // arithmetic
+ time_point&
+ operator+=(const duration& __dur)
+ {
+ __d += __dur;
+ return *this;
+ }
+
+ time_point&
+ operator-=(const duration& __dur)
+ {
+ __d -= __dur;
+ return *this;
+ }
+
+ // special values
+ // TODO: These should be constexprs.
+ static const time_point
+ min()
+ { return time_point(duration::min()); }
+
+ static const time_point
+ max()
+ { return time_point(duration::max()); }
+
+ private:
+ duration __d;
+ };
+
+ /// time_point_cast
+ template<typename _ToDuration, typename _Clock, typename _Duration>
+ inline time_point<_Clock, _ToDuration>
+ time_point_cast(const time_point<_Clock, _Duration>& __t)
+ {
+ return time_point<_Clock, _ToDuration>(
+ duration_cast<_ToDuration>(__t.time_since_epoch()));
+ }
+
+ template<typename _Clock, typename _Duration1,
+ typename _Rep2, typename _Period2>
+ inline time_point<_Clock,
+ typename common_type<_Duration1, duration<_Rep2, _Period2>>::type>
+ operator+(const time_point<_Clock, _Duration1>& __lhs,
+ const duration<_Rep2, _Period2>& __rhs)
+ {
+ typedef time_point<_Clock,
+ typename common_type<_Duration1,
+ duration<_Rep2, _Period2>>::type> __ct;
+ return __ct(__lhs) += __rhs;
+ }
+
+ template<typename _Rep1, typename _Period1,
+ typename _Clock, typename _Duration2>
+ inline time_point<_Clock,
+ typename common_type<duration<_Rep1, _Period1>, _Duration2>::type>
+ operator+(const duration<_Rep1, _Period1>& __lhs,
+ const time_point<_Clock, _Duration2>& __rhs)
+ { return __rhs + __lhs; }
+
+ template<typename _Clock, typename _Duration1,
+ typename _Rep2, typename _Period2>
+ inline time_point<_Clock,
+ typename common_type<_Duration1, duration<_Rep2, _Period2>>::type>
+ operator-(const time_point<_Clock, _Duration1>& __lhs,
+ const duration<_Rep2, _Period2>& __rhs)
+ { return __lhs + (-__rhs); }
+
+ template<typename _Clock, typename _Duration1, typename _Duration2>
+ inline typename common_type<_Duration1, _Duration2>::type
+ operator-(const time_point<_Clock, _Duration1>& __lhs,
+ const time_point<_Clock, _Duration2>& __rhs)
+ { return __lhs.time_since_epoch() - __rhs.time_since_epoch(); }
+
+ template<typename _Clock, typename _Duration1, typename _Duration2>
+ inline bool
+ operator==(const time_point<_Clock, _Duration1>& __lhs,
+ const time_point<_Clock, _Duration2>& __rhs)
+ { return __lhs.time_since_epoch() == __rhs.time_since_epoch(); }
+
+ template<typename _Clock, typename _Duration1, typename _Duration2>
+ inline bool
+ operator!=(const time_point<_Clock, _Duration1>& __lhs,
+ const time_point<_Clock, _Duration2>& __rhs)
+ { return !(__lhs == __rhs); }
+
+ template<typename _Clock, typename _Duration1, typename _Duration2>
+ inline bool
+ operator<(const time_point<_Clock, _Duration1>& __lhs,
+ const time_point<_Clock, _Duration2>& __rhs)
+ { return __lhs.time_since_epoch() < __rhs.time_since_epoch(); }
+
+ template<typename _Clock, typename _Duration1, typename _Duration2>
+ inline bool
+ operator<=(const time_point<_Clock, _Duration1>& __lhs,
+ const time_point<_Clock, _Duration2>& __rhs)
+ { return !(__rhs < __lhs); }
+
+ template<typename _Clock, typename _Duration1, typename _Duration2>
+ inline bool
+ operator>(const time_point<_Clock, _Duration1>& __lhs,
+ const time_point<_Clock, _Duration2>& __rhs)
+ { return __rhs < __lhs; }
+
+ template<typename _Clock, typename _Duration1, typename _Duration2>
+ inline bool
+ operator>=(const time_point<_Clock, _Duration1>& __lhs,
+ const time_point<_Clock, _Duration2>& __rhs)
+ { return !(__lhs < __rhs); }
+
+ /// system_clock
+ struct system_clock
+ {
+#ifdef _GLIBCXX_USE_CLOCK_REALTIME
+ typedef chrono::nanoseconds duration;
+#elif defined(_GLIBCXX_USE_GETTIMEOFDAY)
+ typedef chrono::microseconds duration;
+#else
+ typedef chrono::seconds duration;
+#endif
+
+ typedef duration::rep rep;
+ typedef duration::period period;
+ typedef chrono::time_point<system_clock, duration> time_point;
+
+ static const bool is_monotonic = false;
+
+ static time_point
+ now();
+
+ // Map to C API
+ static std::time_t
+ to_time_t(const time_point& __t)
+ {
+ return std::time_t(
+ duration_cast<chrono::seconds>(__t.time_since_epoch()).count());
+ }
+
+ static time_point
+ from_time_t(std::time_t __t)
+ {
+ return time_point_cast<system_clock::duration>(
+ chrono::time_point<system_clock, chrono::seconds>(
+ chrono::seconds(__t)));
+ }
+
+ // TODO: requires constexpr
+ /*
+ static_assert(
+ system_clock::duration::min() <
+ system_clock::duration::zero(),
+ "a clock's minimum duration cannot be less than its epoch");
+ */
+ };
+
+#ifdef _GLIBCXX_USE_CLOCK_MONOTONIC
+ /// monotonic_clock
+ struct monotonic_clock
+ {
+ typedef chrono::nanoseconds duration;
+ typedef duration::rep rep;
+ typedef duration::period period;
+ typedef chrono::time_point<monotonic_clock, duration> time_point;
+
+ static const bool is_monotonic = true;
+
+ static time_point
+ now();
+ };
+#else
+ typedef system_clock monotonic_clock;
+#endif
+
+ typedef system_clock high_resolution_clock;
+ } // namespace chrono
+
+ // @} group chrono
+} // namespace std
+
+#endif //_GLIBCXX_USE_C99_STDINT_TR1
+
+#endif //__GXX_EXPERIMENTAL_CXX0X__
+
+#endif //_GLIBCXX_CHRONO
diff --git a/i686-linux/include/c++/4.4.3/cinttypes b/i686-linux/include/c++/4.4.3/cinttypes
new file mode 100644
index 0000000..5ed1a21
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/cinttypes
@@ -0,0 +1,71 @@
+// <cinttypes> -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/cinttypes
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_CINTTYPES
+#define _GLIBCXX_CINTTYPES 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#endif
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+#endif
+
+#include <cstdint>
+
+// For 8.11.1/1 (see C99, Note 184)
+#if _GLIBCXX_HAVE_INTTYPES_H
+# ifndef __STDC_FORMAT_MACROS
+# define _UNDEF__STDC_FORMAT_MACROS
+# define __STDC_FORMAT_MACROS
+# endif
+# include <inttypes.h>
+# ifdef _UNDEF__STDC_FORMAT_MACROS
+# undef __STDC_FORMAT_MACROS
+# undef _UNDEF__STDC_FORMAT_MACROS
+# endif
+#endif
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/cinttypes>
+#else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/cinttypes>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+#endif
+
+#endif // _GLIBCXX_CINTTYPES
diff --git a/i686-linux/include/c++/4.4.3/ciso646 b/i686-linux/include/c++/4.4.3/ciso646
new file mode 100644
index 0000000..a3c3f9b
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ciso646
@@ -0,0 +1,33 @@
+// -*- C++ -*- forwarding header.
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ciso646
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c iso646.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
diff --git a/i686-linux/include/c++/4.4.3/climits b/i686-linux/include/c++/4.4.3/climits
new file mode 100644
index 0000000..943d69e
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/climits
@@ -0,0 +1,60 @@
+// -*- C++ -*- forwarding header.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/climits
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c limits.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
+
+//
+// ISO C++ 14882: 18.2.2 Implementation properties: C library
+//
+
+#pragma GCC system_header
+
+#include <limits.h>
+
+#ifndef _GLIBCXX_CLIMITS
+#define _GLIBCXX_CLIMITS 1
+
+#ifndef LLONG_MIN
+#define LLONG_MIN (-__LONG_LONG_MAX__ - 1)
+#endif
+
+#ifndef LLONG_MAX
+#define LLONG_MAX __LONG_LONG_MAX__
+#endif
+
+#ifndef ULLONG_MAX
+#define ULLONG_MAX (__LONG_LONG_MAX__ * 2ULL + 1)
+#endif
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/clocale b/i686-linux/include/c++/4.4.3/clocale
new file mode 100644
index 0000000..eb955c9
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/clocale
@@ -0,0 +1,61 @@
+// -*- C++ -*- forwarding header.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file clocale
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c locale.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
+
+//
+// ISO C++ 14882: 18.2.2 Implementation properties: C library
+//
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <locale.h>
+
+#ifndef _GLIBCXX_CLOCALE
+#define _GLIBCXX_CLOCALE 1
+
+// Get rid of those macros defined in <locale.h> in lieu of real functions.
+#undef setlocale
+#undef localeconv
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ using ::lconv;
+ using ::setlocale;
+ using ::localeconv;
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/cmath b/i686-linux/include/c++/4.4.3/cmath
new file mode 100644
index 0000000..9a63a01
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/cmath
@@ -0,0 +1,631 @@
+// -*- C++ -*- C forwarding header.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/cmath
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c math.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
+
+//
+// ISO C++ 14882: 26.5 C library
+//
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <bits/cpp_type_traits.h>
+#include <ext/type_traits.h>
+#include <math.h>
+
+#ifndef _GLIBCXX_CMATH
+#define _GLIBCXX_CMATH 1
+
+// Get rid of those macros defined in <math.h> in lieu of real functions.
+#undef abs
+#undef div
+#undef acos
+#undef asin
+#undef atan
+#undef atan2
+#undef ceil
+#undef cos
+#undef cosh
+#undef exp
+#undef fabs
+#undef floor
+#undef fmod
+#undef frexp
+#undef ldexp
+#undef log
+#undef log10
+#undef modf
+#undef pow
+#undef sin
+#undef sinh
+#undef sqrt
+#undef tan
+#undef tanh
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // Forward declaration of a helper function. This really should be
+ // an `exported' forward declaration.
+ template<typename _Tp>
+ _Tp __cmath_power(_Tp, unsigned int);
+
+ template<typename _Tp>
+ inline _Tp
+ __pow_helper(_Tp __x, int __n)
+ {
+ return __n < 0
+ ? _Tp(1)/__cmath_power(__x, -__n)
+ : __cmath_power(__x, __n);
+ }
+
+ inline double
+ abs(double __x)
+ { return __builtin_fabs(__x); }
+
+ inline float
+ abs(float __x)
+ { return __builtin_fabsf(__x); }
+
+ inline long double
+ abs(long double __x)
+ { return __builtin_fabsl(__x); }
+
+ using ::acos;
+
+ inline float
+ acos(float __x)
+ { return __builtin_acosf(__x); }
+
+ inline long double
+ acos(long double __x)
+ { return __builtin_acosl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+ double>::__type
+ acos(_Tp __x)
+ { return __builtin_acos(__x); }
+
+ using ::asin;
+
+ inline float
+ asin(float __x)
+ { return __builtin_asinf(__x); }
+
+ inline long double
+ asin(long double __x)
+ { return __builtin_asinl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+ double>::__type
+ asin(_Tp __x)
+ { return __builtin_asin(__x); }
+
+ using ::atan;
+
+ inline float
+ atan(float __x)
+ { return __builtin_atanf(__x); }
+
+ inline long double
+ atan(long double __x)
+ { return __builtin_atanl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+ double>::__type
+ atan(_Tp __x)
+ { return __builtin_atan(__x); }
+
+ using ::atan2;
+
+ inline float
+ atan2(float __y, float __x)
+ { return __builtin_atan2f(__y, __x); }
+
+ inline long double
+ atan2(long double __y, long double __x)
+ { return __builtin_atan2l(__y, __x); }
+
+ template<typename _Tp, typename _Up>
+ inline
+ typename __gnu_cxx::__promote_2<
+ typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
+ && __is_arithmetic<_Up>::__value,
+ _Tp>::__type, _Up>::__type
+ atan2(_Tp __y, _Up __x)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+ return atan2(__type(__y), __type(__x));
+ }
+
+ using ::ceil;
+
+ inline float
+ ceil(float __x)
+ { return __builtin_ceilf(__x); }
+
+ inline long double
+ ceil(long double __x)
+ { return __builtin_ceill(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+ double>::__type
+ ceil(_Tp __x)
+ { return __builtin_ceil(__x); }
+
+ using ::cos;
+
+ inline float
+ cos(float __x)
+ { return __builtin_cosf(__x); }
+
+ inline long double
+ cos(long double __x)
+ { return __builtin_cosl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+ double>::__type
+ cos(_Tp __x)
+ { return __builtin_cos(__x); }
+
+ using ::cosh;
+
+ inline float
+ cosh(float __x)
+ { return __builtin_coshf(__x); }
+
+ inline long double
+ cosh(long double __x)
+ { return __builtin_coshl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+ double>::__type
+ cosh(_Tp __x)
+ { return __builtin_cosh(__x); }
+
+ using ::exp;
+
+ inline float
+ exp(float __x)
+ { return __builtin_expf(__x); }
+
+ inline long double
+ exp(long double __x)
+ { return __builtin_expl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+ double>::__type
+ exp(_Tp __x)
+ { return __builtin_exp(__x); }
+
+ using ::fabs;
+
+ inline float
+ fabs(float __x)
+ { return __builtin_fabsf(__x); }
+
+ inline long double
+ fabs(long double __x)
+ { return __builtin_fabsl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+ double>::__type
+ fabs(_Tp __x)
+ { return __builtin_fabs(__x); }
+
+ using ::floor;
+
+ inline float
+ floor(float __x)
+ { return __builtin_floorf(__x); }
+
+ inline long double
+ floor(long double __x)
+ { return __builtin_floorl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+ double>::__type
+ floor(_Tp __x)
+ { return __builtin_floor(__x); }
+
+ using ::fmod;
+
+ inline float
+ fmod(float __x, float __y)
+ { return __builtin_fmodf(__x, __y); }
+
+ inline long double
+ fmod(long double __x, long double __y)
+ { return __builtin_fmodl(__x, __y); }
+
+ using ::frexp;
+
+ inline float
+ frexp(float __x, int* __exp)
+ { return __builtin_frexpf(__x, __exp); }
+
+ inline long double
+ frexp(long double __x, int* __exp)
+ { return __builtin_frexpl(__x, __exp); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+ double>::__type
+ frexp(_Tp __x, int* __exp)
+ { return __builtin_frexp(__x, __exp); }
+
+ using ::ldexp;
+
+ inline float
+ ldexp(float __x, int __exp)
+ { return __builtin_ldexpf(__x, __exp); }
+
+ inline long double
+ ldexp(long double __x, int __exp)
+ { return __builtin_ldexpl(__x, __exp); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+ double>::__type
+ ldexp(_Tp __x, int __exp)
+ { return __builtin_ldexp(__x, __exp); }
+
+ using ::log;
+
+ inline float
+ log(float __x)
+ { return __builtin_logf(__x); }
+
+ inline long double
+ log(long double __x)
+ { return __builtin_logl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+ double>::__type
+ log(_Tp __x)
+ { return __builtin_log(__x); }
+
+ using ::log10;
+
+ inline float
+ log10(float __x)
+ { return __builtin_log10f(__x); }
+
+ inline long double
+ log10(long double __x)
+ { return __builtin_log10l(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+ double>::__type
+ log10(_Tp __x)
+ { return __builtin_log10(__x); }
+
+ using ::modf;
+
+ inline float
+ modf(float __x, float* __iptr)
+ { return __builtin_modff(__x, __iptr); }
+
+ inline long double
+ modf(long double __x, long double* __iptr)
+ { return __builtin_modfl(__x, __iptr); }
+
+ using ::pow;
+
+ inline float
+ pow(float __x, float __y)
+ { return __builtin_powf(__x, __y); }
+
+ inline long double
+ pow(long double __x, long double __y)
+ { return __builtin_powl(__x, __y); }
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 550. What should the return type of pow(float,int) be?
+ inline double
+ pow(double __x, int __i)
+ { return __builtin_powi(__x, __i); }
+
+ inline float
+ pow(float __x, int __n)
+ { return __builtin_powif(__x, __n); }
+
+ inline long double
+ pow(long double __x, int __n)
+ { return __builtin_powil(__x, __n); }
+#endif
+
+ template<typename _Tp, typename _Up>
+ inline
+ typename __gnu_cxx::__promote_2<
+ typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
+ && __is_arithmetic<_Up>::__value,
+ _Tp>::__type, _Up>::__type
+ pow(_Tp __x, _Up __y)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+ return pow(__type(__x), __type(__y));
+ }
+
+ using ::sin;
+
+ inline float
+ sin(float __x)
+ { return __builtin_sinf(__x); }
+
+ inline long double
+ sin(long double __x)
+ { return __builtin_sinl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+ double>::__type
+ sin(_Tp __x)
+ { return __builtin_sin(__x); }
+
+ using ::sinh;
+
+ inline float
+ sinh(float __x)
+ { return __builtin_sinhf(__x); }
+
+ inline long double
+ sinh(long double __x)
+ { return __builtin_sinhl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+ double>::__type
+ sinh(_Tp __x)
+ { return __builtin_sinh(__x); }
+
+ using ::sqrt;
+
+ inline float
+ sqrt(float __x)
+ { return __builtin_sqrtf(__x); }
+
+ inline long double
+ sqrt(long double __x)
+ { return __builtin_sqrtl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+ double>::__type
+ sqrt(_Tp __x)
+ { return __builtin_sqrt(__x); }
+
+ using ::tan;
+
+ inline float
+ tan(float __x)
+ { return __builtin_tanf(__x); }
+
+ inline long double
+ tan(long double __x)
+ { return __builtin_tanl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+ double>::__type
+ tan(_Tp __x)
+ { return __builtin_tan(__x); }
+
+ using ::tanh;
+
+ inline float
+ tanh(float __x)
+ { return __builtin_tanhf(__x); }
+
+ inline long double
+ tanh(long double __x)
+ { return __builtin_tanhl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+ double>::__type
+ tanh(_Tp __x)
+ { return __builtin_tanh(__x); }
+
+_GLIBCXX_END_NAMESPACE
+
+#if _GLIBCXX_USE_C99_MATH
+#if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
+
+// These are possible macros imported from C99-land.
+#undef fpclassify
+#undef isfinite
+#undef isinf
+#undef isnan
+#undef isnormal
+#undef signbit
+#undef isgreater
+#undef isgreaterequal
+#undef isless
+#undef islessequal
+#undef islessgreater
+#undef isunordered
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
+ int>::__type
+ fpclassify(_Tp __f)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
+ FP_SUBNORMAL, FP_ZERO, __type(__f));
+ }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
+ int>::__type
+ isfinite(_Tp __f)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __builtin_isfinite(__type(__f));
+ }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
+ int>::__type
+ isinf(_Tp __f)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __builtin_isinf(__type(__f));
+ }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
+ int>::__type
+ isnan(_Tp __f)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __builtin_isnan(__type(__f));
+ }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
+ int>::__type
+ isnormal(_Tp __f)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __builtin_isnormal(__type(__f));
+ }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
+ int>::__type
+ signbit(_Tp __f)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __builtin_signbit(__type(__f));
+ }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
+ int>::__type
+ isgreater(_Tp __f1, _Tp __f2)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __builtin_isgreater(__type(__f1), __type(__f2));
+ }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
+ int>::__type
+ isgreaterequal(_Tp __f1, _Tp __f2)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __builtin_isgreaterequal(__type(__f1), __type(__f2));
+ }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
+ int>::__type
+ isless(_Tp __f1, _Tp __f2)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __builtin_isless(__type(__f1), __type(__f2));
+ }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
+ int>::__type
+ islessequal(_Tp __f1, _Tp __f2)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __builtin_islessequal(__type(__f1), __type(__f2));
+ }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
+ int>::__type
+ islessgreater(_Tp __f1, _Tp __f2)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __builtin_islessgreater(__type(__f1), __type(__f2));
+ }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
+ int>::__type
+ isunordered(_Tp __f1, _Tp __f2)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __builtin_isunordered(__type(__f1), __type(__f2));
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC */
+#endif
+
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <bits/cmath.tcc>
+#endif
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+# endif
+# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/cmath>
+# else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/cmath>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+# endif
+#endif
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/complex b/i686-linux/include/c++/4.4.3/complex
new file mode 100644
index 0000000..4c0d3fb
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/complex
@@ -0,0 +1,1587 @@
+// The template and inlines for the -*- C++ -*- complex number classes.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/complex
+ * This is a Standard C++ Library header.
+ */
+
+//
+// ISO C++ 14882: 26.2 Complex Numbers
+// Note: this is not a conforming implementation.
+// Initially implemented by Ulrich Drepper <drepper@cygnus.com>
+// Improved by Gabriel Dos Reis <dosreis@cmla.ens-cachan.fr>
+//
+
+#ifndef _GLIBCXX_COMPLEX
+#define _GLIBCXX_COMPLEX 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <bits/cpp_type_traits.h>
+#include <ext/type_traits.h>
+#include <cmath>
+#include <sstream>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @defgroup complex_numbers Complex Numbers
+ * @ingroup numerics
+ *
+ * Classes and functions for complex numbers.
+ * @{
+ */
+
+ // Forward declarations.
+ template<typename _Tp> class complex;
+ template<> class complex<float>;
+ template<> class complex<double>;
+ template<> class complex<long double>;
+
+ /// Return magnitude of @a z.
+ template<typename _Tp> _Tp abs(const complex<_Tp>&);
+ /// Return phase angle of @a z.
+ template<typename _Tp> _Tp arg(const complex<_Tp>&);
+ /// Return @a z magnitude squared.
+ template<typename _Tp> _Tp norm(const complex<_Tp>&);
+
+ /// Return complex conjugate of @a z.
+ template<typename _Tp> complex<_Tp> conj(const complex<_Tp>&);
+ /// Return complex with magnitude @a rho and angle @a theta.
+ template<typename _Tp> complex<_Tp> polar(const _Tp&, const _Tp& = 0);
+
+ // Transcendentals:
+ /// Return complex cosine of @a z.
+ template<typename _Tp> complex<_Tp> cos(const complex<_Tp>&);
+ /// Return complex hyperbolic cosine of @a z.
+ template<typename _Tp> complex<_Tp> cosh(const complex<_Tp>&);
+ /// Return complex base e exponential of @a z.
+ template<typename _Tp> complex<_Tp> exp(const complex<_Tp>&);
+ /// Return complex natural logarithm of @a z.
+ template<typename _Tp> complex<_Tp> log(const complex<_Tp>&);
+ /// Return complex base 10 logarithm of @a z.
+ template<typename _Tp> complex<_Tp> log10(const complex<_Tp>&);
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+ // DR 844.
+ /// Return @a x to the @a y'th power.
+ template<typename _Tp> complex<_Tp> pow(const complex<_Tp>&, int);
+#endif
+ /// Return @a x to the @a y'th power.
+ template<typename _Tp> complex<_Tp> pow(const complex<_Tp>&, const _Tp&);
+ /// Return @a x to the @a y'th power.
+ template<typename _Tp> complex<_Tp> pow(const complex<_Tp>&,
+ const complex<_Tp>&);
+ /// Return @a x to the @a y'th power.
+ template<typename _Tp> complex<_Tp> pow(const _Tp&, const complex<_Tp>&);
+ /// Return complex sine of @a z.
+ template<typename _Tp> complex<_Tp> sin(const complex<_Tp>&);
+ /// Return complex hyperbolic sine of @a z.
+ template<typename _Tp> complex<_Tp> sinh(const complex<_Tp>&);
+ /// Return complex square root of @a z.
+ template<typename _Tp> complex<_Tp> sqrt(const complex<_Tp>&);
+ /// Return complex tangent of @a z.
+ template<typename _Tp> complex<_Tp> tan(const complex<_Tp>&);
+ /// Return complex hyperbolic tangent of @a z.
+ template<typename _Tp> complex<_Tp> tanh(const complex<_Tp>&);
+
+
+ // 26.2.2 Primary template class complex
+ /**
+ * Template to represent complex numbers.
+ *
+ * Specializations for float, double, and long double are part of the
+ * library. Results with any other type are not guaranteed.
+ *
+ * @param Tp Type of real and imaginary values.
+ */
+ template<typename _Tp>
+ struct complex
+ {
+ /// Value typedef.
+ typedef _Tp value_type;
+
+ /// Default constructor. First parameter is x, second parameter is y.
+ /// Unspecified parameters default to 0.
+ complex(const _Tp& __r = _Tp(), const _Tp& __i = _Tp())
+ : _M_real(__r), _M_imag(__i) { }
+
+ // Lets the compiler synthesize the copy constructor
+ // complex (const complex<_Tp>&);
+ /// Copy constructor.
+ template<typename _Up>
+ complex(const complex<_Up>& __z)
+ : _M_real(__z.real()), _M_imag(__z.imag()) { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 387. std::complex over-encapsulated.
+ _Tp real() const
+ { return _M_real; }
+
+ _Tp imag() const
+ { return _M_imag; }
+#else
+ /// Return real part of complex number.
+ _Tp& real()
+ { return _M_real; }
+
+ /// Return real part of complex number.
+ const _Tp& real() const
+ { return _M_real; }
+
+ /// Return imaginary part of complex number.
+ _Tp& imag()
+ { return _M_imag; }
+
+ /// Return imaginary part of complex number.
+ const _Tp& imag() const
+ { return _M_imag; }
+#endif
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 387. std::complex over-encapsulated.
+ void real(_Tp __val)
+ { _M_real = __val; }
+
+ void imag(_Tp __val)
+ { _M_imag = __val; }
+
+ /// Assign this complex number to scalar @a t.
+ complex<_Tp>& operator=(const _Tp&);
+
+ /// Add @a t to this complex number.
+ // 26.2.5/1
+ complex<_Tp>&
+ operator+=(const _Tp& __t)
+ {
+ _M_real += __t;
+ return *this;
+ }
+
+ /// Subtract @a t from this complex number.
+ // 26.2.5/3
+ complex<_Tp>&
+ operator-=(const _Tp& __t)
+ {
+ _M_real -= __t;
+ return *this;
+ }
+
+ /// Multiply this complex number by @a t.
+ complex<_Tp>& operator*=(const _Tp&);
+ /// Divide this complex number by @a t.
+ complex<_Tp>& operator/=(const _Tp&);
+
+ // Lets the compiler synthesize the
+ // copy and assignment operator
+ // complex<_Tp>& operator= (const complex<_Tp>&);
+ /// Assign this complex number to complex @a z.
+ template<typename _Up>
+ complex<_Tp>& operator=(const complex<_Up>&);
+ /// Add @a z to this complex number.
+ template<typename _Up>
+ complex<_Tp>& operator+=(const complex<_Up>&);
+ /// Subtract @a z from this complex number.
+ template<typename _Up>
+ complex<_Tp>& operator-=(const complex<_Up>&);
+ /// Multiply this complex number by @a z.
+ template<typename _Up>
+ complex<_Tp>& operator*=(const complex<_Up>&);
+ /// Divide this complex number by @a z.
+ template<typename _Up>
+ complex<_Tp>& operator/=(const complex<_Up>&);
+
+ const complex& __rep() const
+ { return *this; }
+
+ private:
+ _Tp _M_real;
+ _Tp _M_imag;
+ };
+
+ template<typename _Tp>
+ complex<_Tp>&
+ complex<_Tp>::operator=(const _Tp& __t)
+ {
+ _M_real = __t;
+ _M_imag = _Tp();
+ return *this;
+ }
+
+ // 26.2.5/5
+ template<typename _Tp>
+ complex<_Tp>&
+ complex<_Tp>::operator*=(const _Tp& __t)
+ {
+ _M_real *= __t;
+ _M_imag *= __t;
+ return *this;
+ }
+
+ // 26.2.5/7
+ template<typename _Tp>
+ complex<_Tp>&
+ complex<_Tp>::operator/=(const _Tp& __t)
+ {
+ _M_real /= __t;
+ _M_imag /= __t;
+ return *this;
+ }
+
+ template<typename _Tp>
+ template<typename _Up>
+ complex<_Tp>&
+ complex<_Tp>::operator=(const complex<_Up>& __z)
+ {
+ _M_real = __z.real();
+ _M_imag = __z.imag();
+ return *this;
+ }
+
+ // 26.2.5/9
+ template<typename _Tp>
+ template<typename _Up>
+ complex<_Tp>&
+ complex<_Tp>::operator+=(const complex<_Up>& __z)
+ {
+ _M_real += __z.real();
+ _M_imag += __z.imag();
+ return *this;
+ }
+
+ // 26.2.5/11
+ template<typename _Tp>
+ template<typename _Up>
+ complex<_Tp>&
+ complex<_Tp>::operator-=(const complex<_Up>& __z)
+ {
+ _M_real -= __z.real();
+ _M_imag -= __z.imag();
+ return *this;
+ }
+
+ // 26.2.5/13
+ // XXX: This is a grammar school implementation.
+ template<typename _Tp>
+ template<typename _Up>
+ complex<_Tp>&
+ complex<_Tp>::operator*=(const complex<_Up>& __z)
+ {
+ const _Tp __r = _M_real * __z.real() - _M_imag * __z.imag();
+ _M_imag = _M_real * __z.imag() + _M_imag * __z.real();
+ _M_real = __r;
+ return *this;
+ }
+
+ // 26.2.5/15
+ // XXX: This is a grammar school implementation.
+ template<typename _Tp>
+ template<typename _Up>
+ complex<_Tp>&
+ complex<_Tp>::operator/=(const complex<_Up>& __z)
+ {
+ const _Tp __r = _M_real * __z.real() + _M_imag * __z.imag();
+ const _Tp __n = std::norm(__z);
+ _M_imag = (_M_imag * __z.real() - _M_real * __z.imag()) / __n;
+ _M_real = __r / __n;
+ return *this;
+ }
+
+ // Operators:
+ //@{
+ /// Return new complex value @a x plus @a y.
+ template<typename _Tp>
+ inline complex<_Tp>
+ operator+(const complex<_Tp>& __x, const complex<_Tp>& __y)
+ {
+ complex<_Tp> __r = __x;
+ __r += __y;
+ return __r;
+ }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ operator+(const complex<_Tp>& __x, const _Tp& __y)
+ {
+ complex<_Tp> __r = __x;
+ __r += __y;
+ return __r;
+ }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ operator+(const _Tp& __x, const complex<_Tp>& __y)
+ {
+ complex<_Tp> __r = __y;
+ __r += __x;
+ return __r;
+ }
+ //@}
+
+ //@{
+ /// Return new complex value @a x minus @a y.
+ template<typename _Tp>
+ inline complex<_Tp>
+ operator-(const complex<_Tp>& __x, const complex<_Tp>& __y)
+ {
+ complex<_Tp> __r = __x;
+ __r -= __y;
+ return __r;
+ }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ operator-(const complex<_Tp>& __x, const _Tp& __y)
+ {
+ complex<_Tp> __r = __x;
+ __r -= __y;
+ return __r;
+ }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ operator-(const _Tp& __x, const complex<_Tp>& __y)
+ {
+ complex<_Tp> __r(__x, -__y.imag());
+ __r -= __y.real();
+ return __r;
+ }
+ //@}
+
+ //@{
+ /// Return new complex value @a x times @a y.
+ template<typename _Tp>
+ inline complex<_Tp>
+ operator*(const complex<_Tp>& __x, const complex<_Tp>& __y)
+ {
+ complex<_Tp> __r = __x;
+ __r *= __y;
+ return __r;
+ }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ operator*(const complex<_Tp>& __x, const _Tp& __y)
+ {
+ complex<_Tp> __r = __x;
+ __r *= __y;
+ return __r;
+ }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ operator*(const _Tp& __x, const complex<_Tp>& __y)
+ {
+ complex<_Tp> __r = __y;
+ __r *= __x;
+ return __r;
+ }
+ //@}
+
+ //@{
+ /// Return new complex value @a x divided by @a y.
+ template<typename _Tp>
+ inline complex<_Tp>
+ operator/(const complex<_Tp>& __x, const complex<_Tp>& __y)
+ {
+ complex<_Tp> __r = __x;
+ __r /= __y;
+ return __r;
+ }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ operator/(const complex<_Tp>& __x, const _Tp& __y)
+ {
+ complex<_Tp> __r = __x;
+ __r /= __y;
+ return __r;
+ }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ operator/(const _Tp& __x, const complex<_Tp>& __y)
+ {
+ complex<_Tp> __r = __x;
+ __r /= __y;
+ return __r;
+ }
+ //@}
+
+ /// Return @a x.
+ template<typename _Tp>
+ inline complex<_Tp>
+ operator+(const complex<_Tp>& __x)
+ { return __x; }
+
+ /// Return complex negation of @a x.
+ template<typename _Tp>
+ inline complex<_Tp>
+ operator-(const complex<_Tp>& __x)
+ { return complex<_Tp>(-__x.real(), -__x.imag()); }
+
+ //@{
+ /// Return true if @a x is equal to @a y.
+ template<typename _Tp>
+ inline bool
+ operator==(const complex<_Tp>& __x, const complex<_Tp>& __y)
+ { return __x.real() == __y.real() && __x.imag() == __y.imag(); }
+
+ template<typename _Tp>
+ inline bool
+ operator==(const complex<_Tp>& __x, const _Tp& __y)
+ { return __x.real() == __y && __x.imag() == _Tp(); }
+
+ template<typename _Tp>
+ inline bool
+ operator==(const _Tp& __x, const complex<_Tp>& __y)
+ { return __x == __y.real() && _Tp() == __y.imag(); }
+ //@}
+
+ //@{
+ /// Return false if @a x is equal to @a y.
+ template<typename _Tp>
+ inline bool
+ operator!=(const complex<_Tp>& __x, const complex<_Tp>& __y)
+ { return __x.real() != __y.real() || __x.imag() != __y.imag(); }
+
+ template<typename _Tp>
+ inline bool
+ operator!=(const complex<_Tp>& __x, const _Tp& __y)
+ { return __x.real() != __y || __x.imag() != _Tp(); }
+
+ template<typename _Tp>
+ inline bool
+ operator!=(const _Tp& __x, const complex<_Tp>& __y)
+ { return __x != __y.real() || _Tp() != __y.imag(); }
+ //@}
+
+ /// Extraction operator for complex values.
+ template<typename _Tp, typename _CharT, class _Traits>
+ basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x)
+ {
+ _Tp __re_x, __im_x;
+ _CharT __ch;
+ __is >> __ch;
+ if (__ch == '(')
+ {
+ __is >> __re_x >> __ch;
+ if (__ch == ',')
+ {
+ __is >> __im_x >> __ch;
+ if (__ch == ')')
+ __x = complex<_Tp>(__re_x, __im_x);
+ else
+ __is.setstate(ios_base::failbit);
+ }
+ else if (__ch == ')')
+ __x = __re_x;
+ else
+ __is.setstate(ios_base::failbit);
+ }
+ else
+ {
+ __is.putback(__ch);
+ __is >> __re_x;
+ __x = __re_x;
+ }
+ return __is;
+ }
+
+ /// Insertion operator for complex values.
+ template<typename _Tp, typename _CharT, class _Traits>
+ basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __os, const complex<_Tp>& __x)
+ {
+ basic_ostringstream<_CharT, _Traits> __s;
+ __s.flags(__os.flags());
+ __s.imbue(__os.getloc());
+ __s.precision(__os.precision());
+ __s << '(' << __x.real() << ',' << __x.imag() << ')';
+ return __os << __s.str();
+ }
+
+ // Values
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp>
+ inline _Tp
+ real(const complex<_Tp>& __z)
+ { return __z.real(); }
+
+ template<typename _Tp>
+ inline _Tp
+ imag(const complex<_Tp>& __z)
+ { return __z.imag(); }
+#else
+ template<typename _Tp>
+ inline _Tp&
+ real(complex<_Tp>& __z)
+ { return __z.real(); }
+
+ template<typename _Tp>
+ inline const _Tp&
+ real(const complex<_Tp>& __z)
+ { return __z.real(); }
+
+ template<typename _Tp>
+ inline _Tp&
+ imag(complex<_Tp>& __z)
+ { return __z.imag(); }
+
+ template<typename _Tp>
+ inline const _Tp&
+ imag(const complex<_Tp>& __z)
+ { return __z.imag(); }
+#endif
+
+ // 26.2.7/3 abs(__z): Returns the magnitude of __z.
+ template<typename _Tp>
+ inline _Tp
+ __complex_abs(const complex<_Tp>& __z)
+ {
+ _Tp __x = __z.real();
+ _Tp __y = __z.imag();
+ const _Tp __s = std::max(abs(__x), abs(__y));
+ if (__s == _Tp()) // well ...
+ return __s;
+ __x /= __s;
+ __y /= __s;
+ return __s * sqrt(__x * __x + __y * __y);
+ }
+
+#if _GLIBCXX_USE_C99_COMPLEX
+ inline float
+ __complex_abs(__complex__ float __z) { return __builtin_cabsf(__z); }
+
+ inline double
+ __complex_abs(__complex__ double __z) { return __builtin_cabs(__z); }
+
+ inline long double
+ __complex_abs(const __complex__ long double& __z)
+ { return __builtin_cabsl(__z); }
+
+ template<typename _Tp>
+ inline _Tp
+ abs(const complex<_Tp>& __z) { return __complex_abs(__z.__rep()); }
+#else
+ template<typename _Tp>
+ inline _Tp
+ abs(const complex<_Tp>& __z) { return __complex_abs(__z); }
+#endif
+
+
+ // 26.2.7/4: arg(__z): Returns the phase angle of __z.
+ template<typename _Tp>
+ inline _Tp
+ __complex_arg(const complex<_Tp>& __z)
+ { return atan2(__z.imag(), __z.real()); }
+
+#if _GLIBCXX_USE_C99_COMPLEX
+ inline float
+ __complex_arg(__complex__ float __z) { return __builtin_cargf(__z); }
+
+ inline double
+ __complex_arg(__complex__ double __z) { return __builtin_carg(__z); }
+
+ inline long double
+ __complex_arg(const __complex__ long double& __z)
+ { return __builtin_cargl(__z); }
+
+ template<typename _Tp>
+ inline _Tp
+ arg(const complex<_Tp>& __z) { return __complex_arg(__z.__rep()); }
+#else
+ template<typename _Tp>
+ inline _Tp
+ arg(const complex<_Tp>& __z) { return __complex_arg(__z); }
+#endif
+
+ // 26.2.7/5: norm(__z) returns the squared magnitude of __z.
+ // As defined, norm() is -not- a norm is the common mathematical
+ // sens used in numerics. The helper class _Norm_helper<> tries to
+ // distinguish between builtin floating point and the rest, so as
+ // to deliver an answer as close as possible to the real value.
+ template<bool>
+ struct _Norm_helper
+ {
+ template<typename _Tp>
+ static inline _Tp _S_do_it(const complex<_Tp>& __z)
+ {
+ const _Tp __x = __z.real();
+ const _Tp __y = __z.imag();
+ return __x * __x + __y * __y;
+ }
+ };
+
+ template<>
+ struct _Norm_helper<true>
+ {
+ template<typename _Tp>
+ static inline _Tp _S_do_it(const complex<_Tp>& __z)
+ {
+ _Tp __res = std::abs(__z);
+ return __res * __res;
+ }
+ };
+
+ template<typename _Tp>
+ inline _Tp
+ norm(const complex<_Tp>& __z)
+ {
+ return _Norm_helper<__is_floating<_Tp>::__value
+ && !_GLIBCXX_FAST_MATH>::_S_do_it(__z);
+ }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ polar(const _Tp& __rho, const _Tp& __theta)
+ { return complex<_Tp>(__rho * cos(__theta), __rho * sin(__theta)); }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ conj(const complex<_Tp>& __z)
+ { return complex<_Tp>(__z.real(), -__z.imag()); }
+
+ // Transcendentals
+
+ // 26.2.8/1 cos(__z): Returns the cosine of __z.
+ template<typename _Tp>
+ inline complex<_Tp>
+ __complex_cos(const complex<_Tp>& __z)
+ {
+ const _Tp __x = __z.real();
+ const _Tp __y = __z.imag();
+ return complex<_Tp>(cos(__x) * cosh(__y), -sin(__x) * sinh(__y));
+ }
+
+#if _GLIBCXX_USE_C99_COMPLEX
+ inline __complex__ float
+ __complex_cos(__complex__ float __z) { return __builtin_ccosf(__z); }
+
+ inline __complex__ double
+ __complex_cos(__complex__ double __z) { return __builtin_ccos(__z); }
+
+ inline __complex__ long double
+ __complex_cos(const __complex__ long double& __z)
+ { return __builtin_ccosl(__z); }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ cos(const complex<_Tp>& __z) { return __complex_cos(__z.__rep()); }
+#else
+ template<typename _Tp>
+ inline complex<_Tp>
+ cos(const complex<_Tp>& __z) { return __complex_cos(__z); }
+#endif
+
+ // 26.2.8/2 cosh(__z): Returns the hyperbolic cosine of __z.
+ template<typename _Tp>
+ inline complex<_Tp>
+ __complex_cosh(const complex<_Tp>& __z)
+ {
+ const _Tp __x = __z.real();
+ const _Tp __y = __z.imag();
+ return complex<_Tp>(cosh(__x) * cos(__y), sinh(__x) * sin(__y));
+ }
+
+#if _GLIBCXX_USE_C99_COMPLEX
+ inline __complex__ float
+ __complex_cosh(__complex__ float __z) { return __builtin_ccoshf(__z); }
+
+ inline __complex__ double
+ __complex_cosh(__complex__ double __z) { return __builtin_ccosh(__z); }
+
+ inline __complex__ long double
+ __complex_cosh(const __complex__ long double& __z)
+ { return __builtin_ccoshl(__z); }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ cosh(const complex<_Tp>& __z) { return __complex_cosh(__z.__rep()); }
+#else
+ template<typename _Tp>
+ inline complex<_Tp>
+ cosh(const complex<_Tp>& __z) { return __complex_cosh(__z); }
+#endif
+
+ // 26.2.8/3 exp(__z): Returns the complex base e exponential of x
+ template<typename _Tp>
+ inline complex<_Tp>
+ __complex_exp(const complex<_Tp>& __z)
+ { return std::polar(exp(__z.real()), __z.imag()); }
+
+#if _GLIBCXX_USE_C99_COMPLEX
+ inline __complex__ float
+ __complex_exp(__complex__ float __z) { return __builtin_cexpf(__z); }
+
+ inline __complex__ double
+ __complex_exp(__complex__ double __z) { return __builtin_cexp(__z); }
+
+ inline __complex__ long double
+ __complex_exp(const __complex__ long double& __z)
+ { return __builtin_cexpl(__z); }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ exp(const complex<_Tp>& __z) { return __complex_exp(__z.__rep()); }
+#else
+ template<typename _Tp>
+ inline complex<_Tp>
+ exp(const complex<_Tp>& __z) { return __complex_exp(__z); }
+#endif
+
+ // 26.2.8/5 log(__z): Returns the natural complex logarithm of __z.
+ // The branch cut is along the negative axis.
+ template<typename _Tp>
+ inline complex<_Tp>
+ __complex_log(const complex<_Tp>& __z)
+ { return complex<_Tp>(log(std::abs(__z)), std::arg(__z)); }
+
+#if _GLIBCXX_USE_C99_COMPLEX
+ inline __complex__ float
+ __complex_log(__complex__ float __z) { return __builtin_clogf(__z); }
+
+ inline __complex__ double
+ __complex_log(__complex__ double __z) { return __builtin_clog(__z); }
+
+ inline __complex__ long double
+ __complex_log(const __complex__ long double& __z)
+ { return __builtin_clogl(__z); }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ log(const complex<_Tp>& __z) { return __complex_log(__z.__rep()); }
+#else
+ template<typename _Tp>
+ inline complex<_Tp>
+ log(const complex<_Tp>& __z) { return __complex_log(__z); }
+#endif
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ log10(const complex<_Tp>& __z)
+ { return std::log(__z) / log(_Tp(10.0)); }
+
+ // 26.2.8/10 sin(__z): Returns the sine of __z.
+ template<typename _Tp>
+ inline complex<_Tp>
+ __complex_sin(const complex<_Tp>& __z)
+ {
+ const _Tp __x = __z.real();
+ const _Tp __y = __z.imag();
+ return complex<_Tp>(sin(__x) * cosh(__y), cos(__x) * sinh(__y));
+ }
+
+#if _GLIBCXX_USE_C99_COMPLEX
+ inline __complex__ float
+ __complex_sin(__complex__ float __z) { return __builtin_csinf(__z); }
+
+ inline __complex__ double
+ __complex_sin(__complex__ double __z) { return __builtin_csin(__z); }
+
+ inline __complex__ long double
+ __complex_sin(const __complex__ long double& __z)
+ { return __builtin_csinl(__z); }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ sin(const complex<_Tp>& __z) { return __complex_sin(__z.__rep()); }
+#else
+ template<typename _Tp>
+ inline complex<_Tp>
+ sin(const complex<_Tp>& __z) { return __complex_sin(__z); }
+#endif
+
+ // 26.2.8/11 sinh(__z): Returns the hyperbolic sine of __z.
+ template<typename _Tp>
+ inline complex<_Tp>
+ __complex_sinh(const complex<_Tp>& __z)
+ {
+ const _Tp __x = __z.real();
+ const _Tp __y = __z.imag();
+ return complex<_Tp>(sinh(__x) * cos(__y), cosh(__x) * sin(__y));
+ }
+
+#if _GLIBCXX_USE_C99_COMPLEX
+ inline __complex__ float
+ __complex_sinh(__complex__ float __z) { return __builtin_csinhf(__z); }
+
+ inline __complex__ double
+ __complex_sinh(__complex__ double __z) { return __builtin_csinh(__z); }
+
+ inline __complex__ long double
+ __complex_sinh(const __complex__ long double& __z)
+ { return __builtin_csinhl(__z); }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ sinh(const complex<_Tp>& __z) { return __complex_sinh(__z.__rep()); }
+#else
+ template<typename _Tp>
+ inline complex<_Tp>
+ sinh(const complex<_Tp>& __z) { return __complex_sinh(__z); }
+#endif
+
+ // 26.2.8/13 sqrt(__z): Returns the complex square root of __z.
+ // The branch cut is on the negative axis.
+ template<typename _Tp>
+ complex<_Tp>
+ __complex_sqrt(const complex<_Tp>& __z)
+ {
+ _Tp __x = __z.real();
+ _Tp __y = __z.imag();
+
+ if (__x == _Tp())
+ {
+ _Tp __t = sqrt(abs(__y) / 2);
+ return complex<_Tp>(__t, __y < _Tp() ? -__t : __t);
+ }
+ else
+ {
+ _Tp __t = sqrt(2 * (std::abs(__z) + abs(__x)));
+ _Tp __u = __t / 2;
+ return __x > _Tp()
+ ? complex<_Tp>(__u, __y / __t)
+ : complex<_Tp>(abs(__y) / __t, __y < _Tp() ? -__u : __u);
+ }
+ }
+
+#if _GLIBCXX_USE_C99_COMPLEX
+ inline __complex__ float
+ __complex_sqrt(__complex__ float __z) { return __builtin_csqrtf(__z); }
+
+ inline __complex__ double
+ __complex_sqrt(__complex__ double __z) { return __builtin_csqrt(__z); }
+
+ inline __complex__ long double
+ __complex_sqrt(const __complex__ long double& __z)
+ { return __builtin_csqrtl(__z); }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ sqrt(const complex<_Tp>& __z) { return __complex_sqrt(__z.__rep()); }
+#else
+ template<typename _Tp>
+ inline complex<_Tp>
+ sqrt(const complex<_Tp>& __z) { return __complex_sqrt(__z); }
+#endif
+
+ // 26.2.8/14 tan(__z): Return the complex tangent of __z.
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ __complex_tan(const complex<_Tp>& __z)
+ { return std::sin(__z) / std::cos(__z); }
+
+#if _GLIBCXX_USE_C99_COMPLEX
+ inline __complex__ float
+ __complex_tan(__complex__ float __z) { return __builtin_ctanf(__z); }
+
+ inline __complex__ double
+ __complex_tan(__complex__ double __z) { return __builtin_ctan(__z); }
+
+ inline __complex__ long double
+ __complex_tan(const __complex__ long double& __z)
+ { return __builtin_ctanl(__z); }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ tan(const complex<_Tp>& __z) { return __complex_tan(__z.__rep()); }
+#else
+ template<typename _Tp>
+ inline complex<_Tp>
+ tan(const complex<_Tp>& __z) { return __complex_tan(__z); }
+#endif
+
+
+ // 26.2.8/15 tanh(__z): Returns the hyperbolic tangent of __z.
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ __complex_tanh(const complex<_Tp>& __z)
+ { return std::sinh(__z) / std::cosh(__z); }
+
+#if _GLIBCXX_USE_C99_COMPLEX
+ inline __complex__ float
+ __complex_tanh(__complex__ float __z) { return __builtin_ctanhf(__z); }
+
+ inline __complex__ double
+ __complex_tanh(__complex__ double __z) { return __builtin_ctanh(__z); }
+
+ inline __complex__ long double
+ __complex_tanh(const __complex__ long double& __z)
+ { return __builtin_ctanhl(__z); }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ tanh(const complex<_Tp>& __z) { return __complex_tanh(__z.__rep()); }
+#else
+ template<typename _Tp>
+ inline complex<_Tp>
+ tanh(const complex<_Tp>& __z) { return __complex_tanh(__z); }
+#endif
+
+
+ // 26.2.8/9 pow(__x, __y): Returns the complex power base of __x
+ // raised to the __y-th power. The branch
+ // cut is on the negative axis.
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 844. complex pow return type is ambiguous.
+ template<typename _Tp>
+ inline complex<_Tp>
+ pow(const complex<_Tp>& __z, int __n)
+ { return std::__pow_helper(__z, __n); }
+#endif
+
+ template<typename _Tp>
+ complex<_Tp>
+ pow(const complex<_Tp>& __x, const _Tp& __y)
+ {
+#ifndef _GLIBCXX_USE_C99_COMPLEX
+ if (__x == _Tp())
+ return _Tp();
+#endif
+ if (__x.imag() == _Tp() && __x.real() > _Tp())
+ return pow(__x.real(), __y);
+
+ complex<_Tp> __t = std::log(__x);
+ return std::polar(exp(__y * __t.real()), __y * __t.imag());
+ }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ __complex_pow(const complex<_Tp>& __x, const complex<_Tp>& __y)
+ { return __x == _Tp() ? _Tp() : std::exp(__y * std::log(__x)); }
+
+#if _GLIBCXX_USE_C99_COMPLEX
+ inline __complex__ float
+ __complex_pow(__complex__ float __x, __complex__ float __y)
+ { return __builtin_cpowf(__x, __y); }
+
+ inline __complex__ double
+ __complex_pow(__complex__ double __x, __complex__ double __y)
+ { return __builtin_cpow(__x, __y); }
+
+ inline __complex__ long double
+ __complex_pow(const __complex__ long double& __x,
+ const __complex__ long double& __y)
+ { return __builtin_cpowl(__x, __y); }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ pow(const complex<_Tp>& __x, const complex<_Tp>& __y)
+ { return __complex_pow(__x.__rep(), __y.__rep()); }
+#else
+ template<typename _Tp>
+ inline complex<_Tp>
+ pow(const complex<_Tp>& __x, const complex<_Tp>& __y)
+ { return __complex_pow(__x, __y); }
+#endif
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ pow(const _Tp& __x, const complex<_Tp>& __y)
+ {
+ return __x > _Tp() ? std::polar(pow(__x, __y.real()),
+ __y.imag() * log(__x))
+ : std::pow(complex<_Tp>(__x), __y);
+ }
+
+ // 26.2.3 complex specializations
+ // complex<float> specialization
+ template<>
+ struct complex<float>
+ {
+ typedef float value_type;
+ typedef __complex__ float _ComplexT;
+
+ complex(_ComplexT __z) : _M_value(__z) { }
+
+ complex(float __r = 0.0f, float __i = 0.0f)
+ {
+ __real__ _M_value = __r;
+ __imag__ _M_value = __i;
+ }
+
+ explicit complex(const complex<double>&);
+ explicit complex(const complex<long double>&);
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 387. std::complex over-encapsulated.
+ float real() const
+ { return __real__ _M_value; }
+
+ float imag() const
+ { return __imag__ _M_value; }
+#else
+ float& real()
+ { return __real__ _M_value; }
+
+ const float& real() const
+ { return __real__ _M_value; }
+
+ float& imag()
+ { return __imag__ _M_value; }
+
+ const float& imag() const
+ { return __imag__ _M_value; }
+#endif
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 387. std::complex over-encapsulated.
+ void real(float __val)
+ { __real__ _M_value = __val; }
+
+ void imag(float __val)
+ { __imag__ _M_value = __val; }
+
+ complex<float>&
+ operator=(float __f)
+ {
+ __real__ _M_value = __f;
+ __imag__ _M_value = 0.0f;
+ return *this;
+ }
+
+ complex<float>&
+ operator+=(float __f)
+ {
+ __real__ _M_value += __f;
+ return *this;
+ }
+
+ complex<float>&
+ operator-=(float __f)
+ {
+ __real__ _M_value -= __f;
+ return *this;
+ }
+
+ complex<float>&
+ operator*=(float __f)
+ {
+ _M_value *= __f;
+ return *this;
+ }
+
+ complex<float>&
+ operator/=(float __f)
+ {
+ _M_value /= __f;
+ return *this;
+ }
+
+ // Let the compiler synthesize the copy and assignment
+ // operator. It always does a pretty good job.
+ // complex& operator=(const complex&);
+
+ template<typename _Tp>
+ complex<float>&
+ operator=(const complex<_Tp>& __z)
+ {
+ __real__ _M_value = __z.real();
+ __imag__ _M_value = __z.imag();
+ return *this;
+ }
+
+ template<typename _Tp>
+ complex<float>&
+ operator+=(const complex<_Tp>& __z)
+ {
+ __real__ _M_value += __z.real();
+ __imag__ _M_value += __z.imag();
+ return *this;
+ }
+
+ template<class _Tp>
+ complex<float>&
+ operator-=(const complex<_Tp>& __z)
+ {
+ __real__ _M_value -= __z.real();
+ __imag__ _M_value -= __z.imag();
+ return *this;
+ }
+
+ template<class _Tp>
+ complex<float>&
+ operator*=(const complex<_Tp>& __z)
+ {
+ _ComplexT __t;
+ __real__ __t = __z.real();
+ __imag__ __t = __z.imag();
+ _M_value *= __t;
+ return *this;
+ }
+
+ template<class _Tp>
+ complex<float>&
+ operator/=(const complex<_Tp>& __z)
+ {
+ _ComplexT __t;
+ __real__ __t = __z.real();
+ __imag__ __t = __z.imag();
+ _M_value /= __t;
+ return *this;
+ }
+
+ const _ComplexT& __rep() const { return _M_value; }
+
+ private:
+ _ComplexT _M_value;
+ };
+
+ // 26.2.3 complex specializations
+ // complex<double> specialization
+ template<>
+ struct complex<double>
+ {
+ typedef double value_type;
+ typedef __complex__ double _ComplexT;
+
+ complex(_ComplexT __z) : _M_value(__z) { }
+
+ complex(double __r = 0.0, double __i = 0.0)
+ {
+ __real__ _M_value = __r;
+ __imag__ _M_value = __i;
+ }
+
+ complex(const complex<float>& __z)
+ : _M_value(__z.__rep()) { }
+
+ explicit complex(const complex<long double>&);
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 387. std::complex over-encapsulated.
+ double real() const
+ { return __real__ _M_value; }
+
+ double imag() const
+ { return __imag__ _M_value; }
+#else
+ double& real()
+ { return __real__ _M_value; }
+
+ const double& real() const
+ { return __real__ _M_value; }
+
+ double& imag()
+ { return __imag__ _M_value; }
+
+ const double& imag() const
+ { return __imag__ _M_value; }
+#endif
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 387. std::complex over-encapsulated.
+ void real(double __val)
+ { __real__ _M_value = __val; }
+
+ void imag(double __val)
+ { __imag__ _M_value = __val; }
+
+ complex<double>&
+ operator=(double __d)
+ {
+ __real__ _M_value = __d;
+ __imag__ _M_value = 0.0;
+ return *this;
+ }
+
+ complex<double>&
+ operator+=(double __d)
+ {
+ __real__ _M_value += __d;
+ return *this;
+ }
+
+ complex<double>&
+ operator-=(double __d)
+ {
+ __real__ _M_value -= __d;
+ return *this;
+ }
+
+ complex<double>&
+ operator*=(double __d)
+ {
+ _M_value *= __d;
+ return *this;
+ }
+
+ complex<double>&
+ operator/=(double __d)
+ {
+ _M_value /= __d;
+ return *this;
+ }
+
+ // The compiler will synthesize this, efficiently.
+ // complex& operator=(const complex&);
+
+ template<typename _Tp>
+ complex<double>&
+ operator=(const complex<_Tp>& __z)
+ {
+ __real__ _M_value = __z.real();
+ __imag__ _M_value = __z.imag();
+ return *this;
+ }
+
+ template<typename _Tp>
+ complex<double>&
+ operator+=(const complex<_Tp>& __z)
+ {
+ __real__ _M_value += __z.real();
+ __imag__ _M_value += __z.imag();
+ return *this;
+ }
+
+ template<typename _Tp>
+ complex<double>&
+ operator-=(const complex<_Tp>& __z)
+ {
+ __real__ _M_value -= __z.real();
+ __imag__ _M_value -= __z.imag();
+ return *this;
+ }
+
+ template<typename _Tp>
+ complex<double>&
+ operator*=(const complex<_Tp>& __z)
+ {
+ _ComplexT __t;
+ __real__ __t = __z.real();
+ __imag__ __t = __z.imag();
+ _M_value *= __t;
+ return *this;
+ }
+
+ template<typename _Tp>
+ complex<double>&
+ operator/=(const complex<_Tp>& __z)
+ {
+ _ComplexT __t;
+ __real__ __t = __z.real();
+ __imag__ __t = __z.imag();
+ _M_value /= __t;
+ return *this;
+ }
+
+ const _ComplexT& __rep() const { return _M_value; }
+
+ private:
+ _ComplexT _M_value;
+ };
+
+ // 26.2.3 complex specializations
+ // complex<long double> specialization
+ template<>
+ struct complex<long double>
+ {
+ typedef long double value_type;
+ typedef __complex__ long double _ComplexT;
+
+ complex(_ComplexT __z) : _M_value(__z) { }
+
+ complex(long double __r = 0.0L, long double __i = 0.0L)
+ {
+ __real__ _M_value = __r;
+ __imag__ _M_value = __i;
+ }
+
+ complex(const complex<float>& __z)
+ : _M_value(__z.__rep()) { }
+
+ complex(const complex<double>& __z)
+ : _M_value(__z.__rep()) { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 387. std::complex over-encapsulated.
+ long double real() const
+ { return __real__ _M_value; }
+
+ long double imag() const
+ { return __imag__ _M_value; }
+#else
+ long double& real()
+ { return __real__ _M_value; }
+
+ const long double& real() const
+ { return __real__ _M_value; }
+
+ long double& imag()
+ { return __imag__ _M_value; }
+
+ const long double& imag() const
+ { return __imag__ _M_value; }
+#endif
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 387. std::complex over-encapsulated.
+ void real(long double __val)
+ { __real__ _M_value = __val; }
+
+ void imag(long double __val)
+ { __imag__ _M_value = __val; }
+
+ complex<long double>&
+ operator=(long double __r)
+ {
+ __real__ _M_value = __r;
+ __imag__ _M_value = 0.0L;
+ return *this;
+ }
+
+ complex<long double>&
+ operator+=(long double __r)
+ {
+ __real__ _M_value += __r;
+ return *this;
+ }
+
+ complex<long double>&
+ operator-=(long double __r)
+ {
+ __real__ _M_value -= __r;
+ return *this;
+ }
+
+ complex<long double>&
+ operator*=(long double __r)
+ {
+ _M_value *= __r;
+ return *this;
+ }
+
+ complex<long double>&
+ operator/=(long double __r)
+ {
+ _M_value /= __r;
+ return *this;
+ }
+
+ // The compiler knows how to do this efficiently
+ // complex& operator=(const complex&);
+
+ template<typename _Tp>
+ complex<long double>&
+ operator=(const complex<_Tp>& __z)
+ {
+ __real__ _M_value = __z.real();
+ __imag__ _M_value = __z.imag();
+ return *this;
+ }
+
+ template<typename _Tp>
+ complex<long double>&
+ operator+=(const complex<_Tp>& __z)
+ {
+ __real__ _M_value += __z.real();
+ __imag__ _M_value += __z.imag();
+ return *this;
+ }
+
+ template<typename _Tp>
+ complex<long double>&
+ operator-=(const complex<_Tp>& __z)
+ {
+ __real__ _M_value -= __z.real();
+ __imag__ _M_value -= __z.imag();
+ return *this;
+ }
+
+ template<typename _Tp>
+ complex<long double>&
+ operator*=(const complex<_Tp>& __z)
+ {
+ _ComplexT __t;
+ __real__ __t = __z.real();
+ __imag__ __t = __z.imag();
+ _M_value *= __t;
+ return *this;
+ }
+
+ template<typename _Tp>
+ complex<long double>&
+ operator/=(const complex<_Tp>& __z)
+ {
+ _ComplexT __t;
+ __real__ __t = __z.real();
+ __imag__ __t = __z.imag();
+ _M_value /= __t;
+ return *this;
+ }
+
+ const _ComplexT& __rep() const { return _M_value; }
+
+ private:
+ _ComplexT _M_value;
+ };
+
+ // These bits have to be at the end of this file, so that the
+ // specializations have all been defined.
+ inline
+ complex<float>::complex(const complex<double>& __z)
+ : _M_value(__z.__rep()) { }
+
+ inline
+ complex<float>::complex(const complex<long double>& __z)
+ : _M_value(__z.__rep()) { }
+
+ inline
+ complex<double>::complex(const complex<long double>& __z)
+ : _M_value(__z.__rep()) { }
+
+ // Inhibit implicit instantiations for required instantiations,
+ // which are defined via explicit instantiations elsewhere.
+ // NB: This syntax is a GNU extension.
+#if _GLIBCXX_EXTERN_TEMPLATE
+ extern template istream& operator>>(istream&, complex<float>&);
+ extern template ostream& operator<<(ostream&, const complex<float>&);
+ extern template istream& operator>>(istream&, complex<double>&);
+ extern template ostream& operator<<(ostream&, const complex<double>&);
+ extern template istream& operator>>(istream&, complex<long double>&);
+ extern template ostream& operator<<(ostream&, const complex<long double>&);
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ extern template wistream& operator>>(wistream&, complex<float>&);
+ extern template wostream& operator<<(wostream&, const complex<float>&);
+ extern template wistream& operator>>(wistream&, complex<double>&);
+ extern template wostream& operator<<(wostream&, const complex<double>&);
+ extern template wistream& operator>>(wistream&, complex<long double>&);
+ extern template wostream& operator<<(wostream&, const complex<long double>&);
+#endif
+#endif
+
+ // @} group complex_numbers
+
+_GLIBCXX_END_NAMESPACE
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ // See ext/type_traits.h for the primary template.
+ template<typename _Tp, typename _Up>
+ struct __promote_2<std::complex<_Tp>, _Up>
+ {
+ public:
+ typedef std::complex<typename __promote_2<_Tp, _Up>::__type> __type;
+ };
+
+ template<typename _Tp, typename _Up>
+ struct __promote_2<_Tp, std::complex<_Up> >
+ {
+ public:
+ typedef std::complex<typename __promote_2<_Tp, _Up>::__type> __type;
+ };
+
+ template<typename _Tp, typename _Up>
+ struct __promote_2<std::complex<_Tp>, std::complex<_Up> >
+ {
+ public:
+ typedef std::complex<typename __promote_2<_Tp, _Up>::__type> __type;
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+# endif
+# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/complex>
+# else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/complex>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+# endif
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // Forward declarations.
+ // DR 781.
+ template<typename _Tp> std::complex<_Tp> proj(const std::complex<_Tp>&);
+
+ template<typename _Tp>
+ std::complex<_Tp>
+ __complex_proj(const std::complex<_Tp>& __z)
+ {
+ const _Tp __den = (__z.real() * __z.real()
+ + __z.imag() * __z.imag() + _Tp(1.0));
+
+ return std::complex<_Tp>((_Tp(2.0) * __z.real()) / __den,
+ (_Tp(2.0) * __z.imag()) / __den);
+ }
+
+#if _GLIBCXX_USE_C99_COMPLEX
+ inline __complex__ float
+ __complex_proj(__complex__ float __z)
+ { return __builtin_cprojf(__z); }
+
+ inline __complex__ double
+ __complex_proj(__complex__ double __z)
+ { return __builtin_cproj(__z); }
+
+ inline __complex__ long double
+ __complex_proj(const __complex__ long double& __z)
+ { return __builtin_cprojl(__z); }
+
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ proj(const std::complex<_Tp>& __z)
+ { return __complex_proj(__z.__rep()); }
+#else
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ proj(const std::complex<_Tp>& __z)
+ { return __complex_proj(__z); }
+#endif
+
+ template<typename _Tp>
+ inline std::complex<typename __gnu_cxx::__promote<_Tp>::__type>
+ proj(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return std::proj(std::complex<__type>(__x));
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
+
+#endif /* _GLIBCXX_COMPLEX */
diff --git a/i686-linux/include/c++/4.4.3/complex.h b/i686-linux/include/c++/4.4.3/complex.h
new file mode 100644
index 0000000..7dc5926
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/complex.h
@@ -0,0 +1,42 @@
+// -*- C++ -*- compatibility header.
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file complex.h
+ * This is a Standard C++ Library header.
+ */
+
+#include <bits/c++config.h>
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# include <ccomplex>
+#else
+# if _GLIBCXX_HAVE_COMPLEX_H
+# include_next <complex.h>
+# endif
+#endif
+
+#ifndef _GLIBCXX_COMPLEX_H
+#define _GLIBCXX_COMPLEX_H 1
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/condition_variable b/i686-linux/include/c++/4.4.3/condition_variable
new file mode 100644
index 0000000..64f2bb7
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/condition_variable
@@ -0,0 +1,225 @@
+// <condition_variable> -*- C++ -*-
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file condition_variable
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_CONDITION_VARIABLE
+#define _GLIBCXX_CONDITION_VARIABLE 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#else
+
+#include <chrono>
+#include <mutex> // unique_lock
+
+#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
+
+namespace std
+{
+ /**
+ * @defgroup condition_variables Condition Variables
+ * @ingroup concurrency
+ *
+ * Classes for condition_variable support.
+ * @{
+ */
+
+ /// condition_variable
+ class condition_variable
+ {
+ typedef chrono::system_clock __clock_t;
+ typedef __gthread_cond_t __native_type;
+ __native_type _M_cond;
+
+ public:
+ typedef __native_type* native_handle_type;
+
+ condition_variable();
+ ~condition_variable();
+
+ condition_variable(const condition_variable&) = delete;
+ condition_variable& operator=(const condition_variable&) = delete;
+
+ void
+ notify_one();
+
+ void
+ notify_all();
+
+ void
+ wait(unique_lock<mutex>& __lock);
+
+ template<typename _Predicate>
+ void
+ wait(unique_lock<mutex>& __lock, _Predicate __p)
+ {
+ while (!__p())
+ wait(__lock);
+ }
+
+ template<typename _Duration>
+ bool
+ wait_until(unique_lock<mutex>& __lock,
+ const chrono::time_point<__clock_t, _Duration>& __atime)
+ { return __wait_until_impl(__lock, __atime); }
+
+ template<typename _Clock, typename _Duration>
+ bool
+ wait_until(unique_lock<mutex>& __lock,
+ const chrono::time_point<_Clock, _Duration>& __atime)
+ {
+ // DR 887 - Sync unknown clock to known clock.
+ typename _Clock::time_point __c_entry = _Clock::now();
+ __clock_t::time_point __s_entry = __clock_t::now();
+ chrono::nanoseconds __delta = __atime - __c_entry;
+ __clock_t::time_point __s_atime = __s_entry + __delta;
+
+ return __wait_until_impl(__lock, __s_atime);
+ }
+
+ template<typename _Clock, typename _Duration, typename _Predicate>
+ bool
+ wait_until(unique_lock<mutex>& __lock,
+ const chrono::time_point<_Clock, _Duration>& __atime,
+ _Predicate __p)
+ {
+ while (!__p())
+ if (!wait_until(__lock, __atime))
+ return __p();
+
+ return true;
+ }
+
+ template<typename _Rep, typename _Period>
+ bool
+ wait_for(unique_lock<mutex>& __lock,
+ const chrono::duration<_Rep, _Period>& __rtime)
+ { return wait_until(__lock, __clock_t::now() + __rtime); }
+
+ template<typename _Rep, typename _Period, typename _Predicate>
+ bool
+ wait_for(unique_lock<mutex>& __lock,
+ const chrono::duration<_Rep, _Period>& __rtime,
+ _Predicate __p)
+ { return wait_until(__lock, __clock_t::now() + __rtime, std::move(__p)); }
+
+ native_handle_type
+ native_handle()
+ { return &_M_cond; }
+
+ private:
+ template<typename _Clock, typename _Duration>
+ bool
+ __wait_until_impl(unique_lock<mutex>& __lock,
+ const chrono::time_point<_Clock, _Duration>& __atime)
+ {
+ chrono::time_point<__clock_t, chrono::seconds> __s =
+ chrono::time_point_cast<chrono::seconds>(__atime);
+
+ chrono::nanoseconds __ns =
+ chrono::duration_cast<chrono::nanoseconds>(__atime - __s);
+
+ __gthread_time_t __ts =
+ {
+ static_cast<std::time_t>(__s.time_since_epoch().count()),
+ static_cast<long>(__ns.count())
+ };
+
+ __gthread_cond_timedwait(&_M_cond, __lock.mutex()->native_handle(),
+ &__ts);
+
+ return _Clock::now() < __atime;
+ }
+ };
+
+ /// condition_variable_any
+ // Like above, only mutex may not have try_lock.
+ class condition_variable_any
+ {
+ typedef __gthread_cond_t __native_type;
+ __native_type _M_cond;
+
+ public:
+ typedef __native_type* native_handle_type;
+
+ condition_variable_any();
+ ~condition_variable_any();
+
+ condition_variable_any(const condition_variable_any&) = delete;
+ condition_variable_any& operator=(const condition_variable_any&) = delete;
+
+ void
+ notify_one();
+
+ void
+ notify_all();
+
+ template<typename _Lock>
+ void
+ wait(_Lock& __lock);
+
+ template<typename _Lock, typename _Predicate>
+ void
+ wait(_Lock& __lock, _Predicate __p);
+
+ template<typename _Lock, typename _Clock, typename _Duration>
+ bool
+ wait_until(_Lock& __lock,
+ const chrono::time_point<_Clock, _Duration>& __atime);
+
+ template<typename _Lock, typename _Clock,
+ typename _Duration, typename _Predicate>
+ bool
+ wait_until(_Lock& __lock,
+ const chrono::time_point<_Clock, _Duration>& __atime,
+ _Predicate __p);
+
+ template<typename _Lock, typename _Rep, typename _Period>
+ bool
+ wait_for(_Lock& __lock, const chrono::duration<_Rep, _Period>& __rtime);
+
+ template<typename _Lock, typename _Rep,
+ typename _Period, typename _Predicate>
+ bool
+ wait_for(_Lock& __lock,
+ const chrono::duration<_Rep, _Period>& __rtime, _Predicate __p);
+
+ native_handle_type
+ native_handle()
+ { return &_M_cond; }
+ };
+
+ // @} group condition_variables
+}
+
+#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1
+
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+#endif // _GLIBCXX_CONDITION_VARIABLE
diff --git a/i686-linux/include/c++/4.4.3/csetjmp b/i686-linux/include/c++/4.4.3/csetjmp
new file mode 100644
index 0000000..6d7ecab
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/csetjmp
@@ -0,0 +1,64 @@
+// -*- C++ -*- forwarding header.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file csetjmp
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c setjmp.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
+
+//
+// ISO C++ 14882: 20.4.6 C library
+//
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <setjmp.h>
+
+#ifndef _GLIBCXX_CSETJMP
+#define _GLIBCXX_CSETJMP 1
+
+// Get rid of those macros defined in <setjmp.h> in lieu of real functions.
+#undef longjmp
+
+// Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998
+#ifndef setjmp
+#define setjmp(env) setjmp (env)
+#endif
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ using ::jmp_buf;
+ using ::longjmp;
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/csignal b/i686-linux/include/c++/4.4.3/csignal
new file mode 100644
index 0000000..41af5e6
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/csignal
@@ -0,0 +1,60 @@
+// -*- C++ -*- forwarding header.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file csignal
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c signal.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
+
+//
+// ISO C++ 14882: 20.4.6 C library
+//
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <signal.h>
+
+#ifndef _GLIBCXX_CSIGNAL
+#define _GLIBCXX_CSIGNAL 1
+
+// Get rid of those macros defined in <signal.h> in lieu of real functions.
+#undef raise
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ using ::sig_atomic_t;
+ using ::signal;
+ using ::raise;
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/cstdarg b/i686-linux/include/c++/4.4.3/cstdarg
new file mode 100644
index 0000000..73327b1
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/cstdarg
@@ -0,0 +1,60 @@
+// -*- C++ -*- forwarding header.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/cstdarg
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c stdarg.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
+
+//
+// ISO C++ 14882: 20.4.6 C library
+//
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <stdarg.h>
+
+#ifndef _GLIBCXX_CSTDARG
+#define _GLIBCXX_CSTDARG 1
+
+// Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998
+#ifndef va_end
+#define va_end(ap) va_end (ap)
+#endif
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ using ::va_list;
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/cstdatomic b/i686-linux/include/c++/4.4.3/cstdatomic
new file mode 100644
index 0000000..7489d97
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/cstdatomic
@@ -0,0 +1,848 @@
+// -*- C++ -*- header.
+
+// Copyright (C) 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file cstdatomic
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c stdatomic.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
+
+// Based on "C++ Atomic Types and Operations" by Hans Boehm and Lawrence Crowl.
+// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2427.html
+
+#ifndef _GLIBCXX_STDATOMIC
+#define _GLIBCXX_STDATOMIC 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#endif
+
+#include <stdatomic.h>
+#include <cstddef>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @addtogroup atomics
+ * @{
+ */
+
+ /// kill_dependency
+ template<typename _Tp>
+ inline _Tp
+ kill_dependency(_Tp __y)
+ {
+ _Tp ret(__y);
+ return ret;
+ }
+
+ inline memory_order
+ __calculate_memory_order(memory_order __m)
+ {
+ const bool __cond1 = __m == memory_order_release;
+ const bool __cond2 = __m == memory_order_acq_rel;
+ memory_order __mo1(__cond1 ? memory_order_relaxed : __m);
+ memory_order __mo2(__cond2 ? memory_order_acquire : __mo1);
+ return __mo2;
+ }
+
+ //
+ // Three nested namespaces for atomic implementation details.
+ //
+ // The nested namespace inlined into std:: is determined by the value
+ // of the _GLIBCXX_ATOMIC_PROPERTY macro and the resulting
+ // ATOMIC_*_LOCK_FREE macros. See file stdatomic.h.
+ //
+ // 0 == __atomic0 == Never lock-free
+ // 1 == __atomic1 == Best available, sometimes lock-free
+ // 2 == __atomic2 == Always lock-free
+#include <bits/atomic_0.h>
+#include <bits/atomic_2.h>
+
+ /// atomic
+ /// 29.4.3, Generic atomic type, primary class template.
+ template<typename _Tp>
+ struct atomic
+ {
+ private:
+ _Tp _M_i;
+
+ public:
+ atomic() = default;
+ ~atomic() = default;
+ atomic(const atomic&) = delete;
+ atomic& operator=(const atomic&) = delete;
+
+ atomic(_Tp __i) : _M_i(__i) { }
+
+ operator _Tp() const volatile;
+
+ _Tp
+ operator=(_Tp __i) volatile { store(__i); return __i; }
+
+ bool
+ is_lock_free() const volatile;
+
+ void
+ store(_Tp, memory_order = memory_order_seq_cst) volatile;
+
+ _Tp
+ load(memory_order = memory_order_seq_cst) const volatile;
+
+ _Tp
+ exchange(_Tp __i, memory_order = memory_order_seq_cst) volatile;
+
+ bool
+ compare_exchange_weak(_Tp&, _Tp, memory_order, memory_order) volatile;
+
+ bool
+ compare_exchange_strong(_Tp&, _Tp, memory_order, memory_order) volatile;
+
+ bool
+ compare_exchange_weak(_Tp&, _Tp,
+ memory_order = memory_order_seq_cst) volatile;
+
+ bool
+ compare_exchange_strong(_Tp&, _Tp,
+ memory_order = memory_order_seq_cst) volatile;
+ };
+
+
+ /// Partial specialization for pointer types.
+ template<typename _Tp>
+ struct atomic<_Tp*> : atomic_address
+ {
+ atomic() = default;
+ ~atomic() = default;
+ atomic(const atomic&) = delete;
+ atomic& operator=(const atomic&) = delete;
+
+ atomic(_Tp* __v) : atomic_address(__v) { }
+
+ void
+ store(_Tp*, memory_order = memory_order_seq_cst) volatile;
+
+ _Tp*
+ load(memory_order = memory_order_seq_cst) const volatile;
+
+ _Tp*
+ exchange(_Tp*, memory_order = memory_order_seq_cst) volatile;
+
+ bool
+ compare_exchange_weak(_Tp*&, _Tp*, memory_order, memory_order) volatile;
+
+ bool
+ compare_exchange_strong(_Tp*&, _Tp*, memory_order, memory_order) volatile;
+
+ bool
+ compare_exchange_weak(_Tp*&, _Tp*,
+ memory_order = memory_order_seq_cst) volatile;
+
+ bool
+ compare_exchange_strong(_Tp*&, _Tp*,
+ memory_order = memory_order_seq_cst) volatile;
+
+ _Tp*
+ fetch_add(ptrdiff_t, memory_order = memory_order_seq_cst) volatile;
+
+ _Tp*
+ fetch_sub(ptrdiff_t, memory_order = memory_order_seq_cst) volatile;
+
+ operator _Tp*() const volatile
+ { return load(); }
+
+ _Tp*
+ operator=(_Tp* __v) volatile
+ {
+ store(__v);
+ return __v;
+ }
+
+ _Tp*
+ operator++(int) volatile { return fetch_add(1); }
+
+ _Tp*
+ operator--(int) volatile { return fetch_sub(1); }
+
+ _Tp*
+ operator++() volatile { return fetch_add(1) + 1; }
+
+ _Tp*
+ operator--() volatile { return fetch_sub(1) - 1; }
+
+ _Tp*
+ operator+=(ptrdiff_t __d) volatile
+ { return fetch_add(__d) + __d; }
+
+ _Tp*
+ operator-=(ptrdiff_t __d) volatile
+ { return fetch_sub(__d) - __d; }
+ };
+
+
+ /// Explicit specialization for void*
+ template<>
+ struct atomic<void*> : public atomic_address
+ {
+ typedef void* __integral_type;
+ typedef atomic_address __base_type;
+
+ atomic() = default;
+ ~atomic() = default;
+ atomic(const atomic&) = delete;
+ atomic& operator=(const atomic&) = delete;
+
+ atomic(__integral_type __i) : __base_type(__i) { }
+
+ using __base_type::operator __integral_type;
+ using __base_type::operator=;
+ };
+
+ /// Explicit specialization for bool.
+ template<>
+ struct atomic<bool> : public atomic_bool
+ {
+ typedef bool __integral_type;
+ typedef atomic_bool __base_type;
+
+ atomic() = default;
+ ~atomic() = default;
+ atomic(const atomic&) = delete;
+ atomic& operator=(const atomic&) = delete;
+
+ atomic(__integral_type __i) : __base_type(__i) { }
+
+ using __base_type::operator __integral_type;
+ using __base_type::operator=;
+ };
+
+ /// Explicit specialization for char.
+ template<>
+ struct atomic<char> : public atomic_char
+ {
+ typedef char __integral_type;
+ typedef atomic_char __base_type;
+
+ atomic() = default;
+ ~atomic() = default;
+ atomic(const atomic&) = delete;
+ atomic& operator=(const atomic&) = delete;
+
+ atomic(__integral_type __i) : __base_type(__i) { }
+
+ using __base_type::operator __integral_type;
+ using __base_type::operator=;
+ };
+
+ /// Explicit specialization for signed char.
+ template<>
+ struct atomic<signed char> : public atomic_schar
+ {
+ typedef signed char __integral_type;
+ typedef atomic_schar __base_type;
+
+ atomic() = default;
+ ~atomic() = default;
+ atomic(const atomic&) = delete;
+ atomic& operator=(const atomic&) = delete;
+
+ atomic(__integral_type __i) : __base_type(__i) { }
+
+ using __base_type::operator __integral_type;
+ using __base_type::operator=;
+ };
+
+ /// Explicit specialization for unsigned char.
+ template<>
+ struct atomic<unsigned char> : public atomic_uchar
+ {
+ typedef unsigned char __integral_type;
+ typedef atomic_uchar __base_type;
+
+ atomic() = default;
+ ~atomic() = default;
+ atomic(const atomic&) = delete;
+ atomic& operator=(const atomic&) = delete;
+
+ atomic(__integral_type __i) : __base_type(__i) { }
+
+ using __base_type::operator __integral_type;
+ using __base_type::operator=;
+ };
+
+ /// Explicit specialization for short.
+ template<>
+ struct atomic<short> : public atomic_short
+ {
+ typedef short __integral_type;
+ typedef atomic_short __base_type;
+
+ atomic() = default;
+ ~atomic() = default;
+ atomic(const atomic&) = delete;
+ atomic& operator=(const atomic&) = delete;
+
+ atomic(__integral_type __i) : __base_type(__i) { }
+
+ using __base_type::operator __integral_type;
+ using __base_type::operator=;
+ };
+
+ /// Explicit specialization for unsigned short.
+ template<>
+ struct atomic<unsigned short> : public atomic_ushort
+ {
+ typedef unsigned short __integral_type;
+ typedef atomic_ushort __base_type;
+
+ atomic() = default;
+ ~atomic() = default;
+ atomic(const atomic&) = delete;
+ atomic& operator=(const atomic&) = delete;
+
+ atomic(__integral_type __i) : __base_type(__i) { }
+
+ using __base_type::operator __integral_type;
+ using __base_type::operator=;
+ };
+
+ /// Explicit specialization for int.
+ template<>
+ struct atomic<int> : atomic_int
+ {
+ typedef int __integral_type;
+ typedef atomic_int __base_type;
+
+ atomic() = default;
+ ~atomic() = default;
+ atomic(const atomic&) = delete;
+ atomic& operator=(const atomic&) = delete;
+
+ atomic(__integral_type __i) : __base_type(__i) { }
+
+ using __base_type::operator __integral_type;
+ using __base_type::operator=;
+ };
+
+ /// Explicit specialization for unsigned int.
+ template<>
+ struct atomic<unsigned int> : public atomic_uint
+ {
+ typedef unsigned int __integral_type;
+ typedef atomic_uint __base_type;
+
+ atomic() = default;
+ ~atomic() = default;
+ atomic(const atomic&) = delete;
+ atomic& operator=(const atomic&) = delete;
+
+ atomic(__integral_type __i) : __base_type(__i) { }
+
+ using __base_type::operator __integral_type;
+ using __base_type::operator=;
+ };
+
+ /// Explicit specialization for long.
+ template<>
+ struct atomic<long> : public atomic_long
+ {
+ typedef long __integral_type;
+ typedef atomic_long __base_type;
+
+ atomic() = default;
+ ~atomic() = default;
+ atomic(const atomic&) = delete;
+ atomic& operator=(const atomic&) = delete;
+
+ atomic(__integral_type __i) : __base_type(__i) { }
+
+ using __base_type::operator __integral_type;
+ using __base_type::operator=;
+ };
+
+ /// Explicit specialization for unsigned long.
+ template<>
+ struct atomic<unsigned long> : public atomic_ulong
+ {
+ typedef unsigned long __integral_type;
+ typedef atomic_ulong __base_type;
+
+ atomic() = default;
+ ~atomic() = default;
+ atomic(const atomic&) = delete;
+ atomic& operator=(const atomic&) = delete;
+
+ atomic(__integral_type __i) : __base_type(__i) { }
+
+ using __base_type::operator __integral_type;
+ using __base_type::operator=;
+ };
+
+ /// Explicit specialization for long long.
+ template<>
+ struct atomic<long long> : public atomic_llong
+ {
+ typedef long long __integral_type;
+ typedef atomic_llong __base_type;
+
+ atomic() = default;
+ ~atomic() = default;
+ atomic(const atomic&) = delete;
+ atomic& operator=(const atomic&) = delete;
+
+ atomic(__integral_type __i) : __base_type(__i) { }
+
+ using __base_type::operator __integral_type;
+ using __base_type::operator=;
+ };
+
+ /// Explicit specialization for unsigned long long.
+ template<>
+ struct atomic<unsigned long long> : public atomic_ullong
+ {
+ typedef unsigned long long __integral_type;
+ typedef atomic_ullong __base_type;
+
+ atomic() = default;
+ ~atomic() = default;
+ atomic(const atomic&) = delete;
+ atomic& operator=(const atomic&) = delete;
+
+ atomic(__integral_type __i) : __base_type(__i) { }
+
+ using __base_type::operator __integral_type;
+ using __base_type::operator=;
+ };
+
+ /// Explicit specialization for wchar_t.
+ template<>
+ struct atomic<wchar_t> : public atomic_wchar_t
+ {
+ typedef wchar_t __integral_type;
+ typedef atomic_wchar_t __base_type;
+
+ atomic() = default;
+ ~atomic() = default;
+ atomic(const atomic&) = delete;
+ atomic& operator=(const atomic&) = delete;
+
+ atomic(__integral_type __i) : __base_type(__i) { }
+
+ using __base_type::operator __integral_type;
+ using __base_type::operator=;
+ };
+
+ /// Explicit specialization for char16_t.
+ template<>
+ struct atomic<char16_t> : public atomic_char16_t
+ {
+ typedef char16_t __integral_type;
+ typedef atomic_char16_t __base_type;
+
+ atomic() = default;
+ ~atomic() = default;
+ atomic(const atomic&) = delete;
+ atomic& operator=(const atomic&) = delete;
+
+ atomic(__integral_type __i) : __base_type(__i) { }
+
+ using __base_type::operator __integral_type;
+ using __base_type::operator=;
+ };
+
+ /// Explicit specialization for char32_t.
+ template<>
+ struct atomic<char32_t> : public atomic_char32_t
+ {
+ typedef char32_t __integral_type;
+ typedef atomic_char32_t __base_type;
+
+ atomic() = default;
+ ~atomic() = default;
+ atomic(const atomic&) = delete;
+ atomic& operator=(const atomic&) = delete;
+
+ atomic(__integral_type __i) : __base_type(__i) { }
+
+ using __base_type::operator __integral_type;
+ using __base_type::operator=;
+ };
+
+
+ template<typename _Tp>
+ _Tp*
+ atomic<_Tp*>::load(memory_order __m) const volatile
+ { return static_cast<_Tp*>(atomic_address::load(__m)); }
+
+ template<typename _Tp>
+ _Tp*
+ atomic<_Tp*>::exchange(_Tp* __v, memory_order __m) volatile
+ { return static_cast<_Tp*>(atomic_address::exchange(__v, __m)); }
+
+ template<typename _Tp>
+ bool
+ atomic<_Tp*>::compare_exchange_weak(_Tp*& __r, _Tp* __v, memory_order __m1,
+ memory_order __m2) volatile
+ {
+ void** __vr = reinterpret_cast<void**>(&__r);
+ void* __vv = static_cast<void*>(__v);
+ return atomic_address::compare_exchange_weak(*__vr, __vv, __m1, __m2);
+ }
+
+ template<typename _Tp>
+ bool
+ atomic<_Tp*>::compare_exchange_strong(_Tp*& __r, _Tp* __v,
+ memory_order __m1,
+ memory_order __m2) volatile
+ {
+ void** __vr = reinterpret_cast<void**>(&__r);
+ void* __vv = static_cast<void*>(__v);
+ return atomic_address::compare_exchange_strong(*__vr, __vv, __m1, __m2);
+ }
+
+ template<typename _Tp>
+ bool
+ atomic<_Tp*>::compare_exchange_weak(_Tp*& __r, _Tp* __v,
+ memory_order __m) volatile
+ {
+ return compare_exchange_weak(__r, __v, __m,
+ __calculate_memory_order(__m));
+ }
+
+ template<typename _Tp>
+ bool
+ atomic<_Tp*>::compare_exchange_strong(_Tp*& __r, _Tp* __v,
+ memory_order __m) volatile
+ {
+ return compare_exchange_strong(__r, __v, __m,
+ __calculate_memory_order(__m));
+ }
+
+ template<typename _Tp>
+ _Tp*
+ atomic<_Tp*>::fetch_add(ptrdiff_t __d, memory_order __m) volatile
+ {
+ void* __p = atomic_fetch_add_explicit(this, sizeof(_Tp) * __d, __m);
+ return static_cast<_Tp*>(__p);
+ }
+
+ template<typename _Tp>
+ _Tp*
+ atomic<_Tp*>::fetch_sub(ptrdiff_t __d, memory_order __m) volatile
+ {
+ void* __p = atomic_fetch_sub_explicit(this, sizeof(_Tp) * __d, __m);
+ return static_cast<_Tp*>(__p);
+ }
+
+ // Convenience function definitions, atomic_flag.
+ inline bool
+ atomic_flag_test_and_set_explicit(volatile atomic_flag* __a, memory_order __m)
+ { return __a->test_and_set(__m); }
+
+ inline void
+ atomic_flag_clear_explicit(volatile atomic_flag* __a, memory_order __m)
+ { return __a->clear(__m); }
+
+
+ // Convenience function definitions, atomic_address.
+ inline bool
+ atomic_is_lock_free(const volatile atomic_address* __a)
+ { return __a->is_lock_free(); }
+
+ inline void
+ atomic_store(volatile atomic_address* __a, void* __v)
+ { __a->store(__v); }
+
+ inline void
+ atomic_store_explicit(volatile atomic_address* __a, void* __v,
+ memory_order __m)
+ { __a->store(__v, __m); }
+
+ inline void*
+ atomic_load(const volatile atomic_address* __a)
+ { return __a->load(); }
+
+ inline void*
+ atomic_load_explicit(const volatile atomic_address* __a, memory_order __m)
+ { return __a->load(__m); }
+
+ inline void*
+ atomic_exchange(volatile atomic_address* __a, void* __v)
+ { return __a->exchange(__v); }
+
+ inline void*
+ atomic_exchange_explicit(volatile atomic_address* __a, void* __v,
+ memory_order __m)
+ { return __a->exchange(__v, __m); }
+
+ inline bool
+ atomic_compare_exchange_weak(volatile atomic_address* __a,
+ void** __v1, void* __v2)
+ {
+ return __a->compare_exchange_weak(*__v1, __v2, memory_order_seq_cst,
+ memory_order_seq_cst);
+ }
+
+ inline bool
+ atomic_compare_exchange_strong(volatile atomic_address* __a,
+ void** __v1, void* __v2)
+ {
+ return __a->compare_exchange_strong(*__v1, __v2, memory_order_seq_cst,
+ memory_order_seq_cst);
+ }
+
+ inline bool
+ atomic_compare_exchange_weak_explicit(volatile atomic_address* __a,
+ void** __v1, void* __v2,
+ memory_order __m1, memory_order __m2)
+ { return __a->compare_exchange_weak(*__v1, __v2, __m1, __m2); }
+
+ inline bool
+ atomic_compare_exchange_strong_explicit(volatile atomic_address* __a,
+ void** __v1, void* __v2,
+ memory_order __m1, memory_order __m2)
+ { return __a->compare_exchange_strong(*__v1, __v2, __m1, __m2); }
+
+ inline void*
+ atomic_fetch_add_explicit(volatile atomic_address* __a, ptrdiff_t __d,
+ memory_order __m)
+ { return __a->fetch_add(__d, __m); }
+
+ inline void*
+ atomic_fetch_add(volatile atomic_address* __a, ptrdiff_t __d)
+ { return __a->fetch_add(__d); }
+
+ inline void*
+ atomic_fetch_sub_explicit(volatile atomic_address* __a, ptrdiff_t __d,
+ memory_order __m)
+ { return __a->fetch_sub(__d, __m); }
+
+ inline void*
+ atomic_fetch_sub(volatile atomic_address* __a, ptrdiff_t __d)
+ { return __a->fetch_sub(__d); }
+
+
+ // Convenience function definitions, atomic_bool.
+ inline bool
+ atomic_is_lock_free(const volatile atomic_bool* __a)
+ { return __a->is_lock_free(); }
+
+ inline void
+ atomic_store(volatile atomic_bool* __a, bool __i)
+ { __a->store(__i); }
+
+ inline void
+ atomic_store_explicit(volatile atomic_bool* __a, bool __i, memory_order __m)
+ { __a->store(__i, __m); }
+
+ inline bool
+ atomic_load(const volatile atomic_bool* __a)
+ { return __a->load(); }
+
+ inline bool
+ atomic_load_explicit(const volatile atomic_bool* __a, memory_order __m)
+ { return __a->load(__m); }
+
+ inline bool
+ atomic_exchange(volatile atomic_bool* __a, bool __i)
+ { return __a->exchange(__i); }
+
+ inline bool
+ atomic_exchange_explicit(volatile atomic_bool* __a, bool __i,
+ memory_order __m)
+ { return __a->exchange(__i, __m); }
+
+ inline bool
+ atomic_compare_exchange_weak(volatile atomic_bool* __a, bool* __i1, bool __i2)
+ {
+ return __a->compare_exchange_weak(*__i1, __i2, memory_order_seq_cst,
+ memory_order_seq_cst);
+ }
+
+ inline bool
+ atomic_compare_exchange_strong(volatile atomic_bool* __a,
+ bool* __i1, bool __i2)
+ {
+ return __a->compare_exchange_strong(*__i1, __i2, memory_order_seq_cst,
+ memory_order_seq_cst);
+ }
+
+ inline bool
+ atomic_compare_exchange_weak_explicit(volatile atomic_bool* __a, bool* __i1,
+ bool __i2, memory_order __m1,
+ memory_order __m2)
+ { return __a->compare_exchange_weak(*__i1, __i2, __m1, __m2); }
+
+ inline bool
+ atomic_compare_exchange_strong_explicit(volatile atomic_bool* __a,
+ bool* __i1, bool __i2,
+ memory_order __m1, memory_order __m2)
+ { return __a->compare_exchange_strong(*__i1, __i2, __m1, __m2); }
+
+
+
+ // Free standing functions. Template argument should be constricted
+ // to intergral types as specified in the standard.
+ template<typename _ITp>
+ inline void
+ atomic_store_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i,
+ memory_order __m)
+ { __a->store(__i, __m); }
+
+ template<typename _ITp>
+ inline _ITp
+ atomic_load_explicit(const volatile __atomic_base<_ITp>* __a,
+ memory_order __m)
+ { return __a->load(__m); }
+
+ template<typename _ITp>
+ inline _ITp
+ atomic_exchange_explicit(volatile __atomic_base<_ITp>* __a,
+ _ITp __i, memory_order __m)
+ { return __a->exchange(__i, __m); }
+
+ template<typename _ITp>
+ inline bool
+ atomic_compare_exchange_weak_explicit(volatile __atomic_base<_ITp>* __a,
+ _ITp* __i1, _ITp __i2,
+ memory_order __m1, memory_order __m2)
+ { return __a->compare_exchange_weak(*__i1, __i2, __m1, __m2); }
+
+ template<typename _ITp>
+ inline bool
+ atomic_compare_exchange_strong_explicit(volatile __atomic_base<_ITp>* __a,
+ _ITp* __i1, _ITp __i2,
+ memory_order __m1,
+ memory_order __m2)
+ { return __a->compare_exchange_strong(*__i1, __i2, __m1, __m2); }
+
+ template<typename _ITp>
+ inline _ITp
+ atomic_fetch_add_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i,
+ memory_order __m)
+ { return __a->fetch_add(__i, __m); }
+
+ template<typename _ITp>
+ inline _ITp
+ atomic_fetch_sub_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i,
+ memory_order __m)
+ { return __a->fetch_sub(__i, __m); }
+
+ template<typename _ITp>
+ inline _ITp
+ atomic_fetch_and_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i,
+ memory_order __m)
+ { return __a->fetch_and(__i, __m); }
+
+ template<typename _ITp>
+ inline _ITp
+ atomic_fetch_or_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i,
+ memory_order __m)
+ { return __a->fetch_or(__i, __m); }
+
+ template<typename _ITp>
+ inline _ITp
+ atomic_fetch_xor_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i,
+ memory_order __m)
+ { return __a->fetch_xor(__i, __m); }
+
+ template<typename _ITp>
+ inline bool
+ atomic_is_lock_free(const volatile __atomic_base<_ITp>* __a)
+ { return __a->is_lock_free(); }
+
+ template<typename _ITp>
+ inline void
+ atomic_store(volatile __atomic_base<_ITp>* __a, _ITp __i)
+ { atomic_store_explicit(__a, __i, memory_order_seq_cst); }
+
+ template<typename _ITp>
+ inline _ITp
+ atomic_load(const volatile __atomic_base<_ITp>* __a)
+ { return atomic_load_explicit(__a, memory_order_seq_cst); }
+
+ template<typename _ITp>
+ inline _ITp
+ atomic_exchange(volatile __atomic_base<_ITp>* __a, _ITp __i)
+ { return atomic_exchange_explicit(__a, __i, memory_order_seq_cst); }
+
+ template<typename _ITp>
+ inline bool
+ atomic_compare_exchange_weak(volatile __atomic_base<_ITp>* __a,
+ _ITp* __i1, _ITp __i2)
+ {
+ return atomic_compare_exchange_weak_explicit(__a, __i1, __i2,
+ memory_order_seq_cst,
+ memory_order_seq_cst);
+ }
+
+ template<typename _ITp>
+ inline bool
+ atomic_compare_exchange_strong(volatile __atomic_base<_ITp>* __a,
+ _ITp* __i1, _ITp __i2)
+ {
+ return atomic_compare_exchange_strong_explicit(__a, __i1, __i2,
+ memory_order_seq_cst,
+ memory_order_seq_cst);
+ }
+
+ template<typename _ITp>
+ inline _ITp
+ atomic_fetch_add(volatile __atomic_base<_ITp>* __a, _ITp __i)
+ { return atomic_fetch_add_explicit(__a, __i, memory_order_seq_cst); }
+
+ template<typename _ITp>
+ inline _ITp
+ atomic_fetch_sub(volatile __atomic_base<_ITp>* __a, _ITp __i)
+ { return atomic_fetch_sub_explicit(__a, __i, memory_order_seq_cst); }
+
+ template<typename _ITp>
+ inline _ITp
+ atomic_fetch_and(volatile __atomic_base<_ITp>* __a, _ITp __i)
+ { return atomic_fetch_and_explicit(__a, __i, memory_order_seq_cst); }
+
+ template<typename _ITp>
+ inline _ITp
+ atomic_fetch_or(volatile __atomic_base<_ITp>* __a, _ITp __i)
+ { return atomic_fetch_or_explicit(__a, __i, memory_order_seq_cst); }
+
+ template<typename _ITp>
+ inline _ITp
+ atomic_fetch_xor(volatile __atomic_base<_ITp>* __a, _ITp __i)
+ { return atomic_fetch_xor_explicit(__a, __i, memory_order_seq_cst); }
+
+ // @} group atomics
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
+
+
diff --git a/i686-linux/include/c++/4.4.3/cstdbool b/i686-linux/include/c++/4.4.3/cstdbool
new file mode 100644
index 0000000..3012c46
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/cstdbool
@@ -0,0 +1,44 @@
+// <cstdbool> -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/cstdbool
+ * This is a Standard C++ Library header.
+ */
+
+#pragma GCC system_header
+
+#ifndef _GLIBCXX_CSTDBOOL
+#define _GLIBCXX_CSTDBOOL 1
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#else
+# include <bits/c++config.h>
+# if _GLIBCXX_HAVE_STDBOOL_H
+# include <stdbool.h>
+# endif
+#endif
+
+#endif
+
diff --git a/i686-linux/include/c++/4.4.3/cstddef b/i686-linux/include/c++/4.4.3/cstddef
new file mode 100644
index 0000000..bb16e75
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/cstddef
@@ -0,0 +1,56 @@
+// -*- C++ -*- forwarding header.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file cstddef
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c stddef.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
+
+//
+// ISO C++ 14882: 18.1 Types
+//
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <stddef.h>
+
+#ifndef _GLIBCXX_CSTDDEF
+#define _GLIBCXX_CSTDDEF 1
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ using ::ptrdiff_t;
+ using ::size_t;
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/cstdint b/i686-linux/include/c++/4.4.3/cstdint
new file mode 100644
index 0000000..0927f8a
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/cstdint
@@ -0,0 +1,79 @@
+// <cstdint> -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/cstdint
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_CSTDINT
+#define _GLIBCXX_CSTDINT 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#endif
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+#endif
+
+#include <bits/c++config.h>
+
+// For 8.22.1/1 (see C99, Notes 219, 220, 222)
+#if _GLIBCXX_HAVE_STDINT_H
+# ifndef __STDC_LIMIT_MACROS
+# define _UNDEF__STDC_LIMIT_MACROS
+# define __STDC_LIMIT_MACROS
+# endif
+# ifndef __STDC_CONSTANT_MACROS
+# define _UNDEF__STDC_CONSTANT_MACROS
+# define __STDC_CONSTANT_MACROS
+# endif
+# include <stdint.h>
+# ifdef _UNDEF__STDC_LIMIT_MACROS
+# undef __STDC_LIMIT_MACROS
+# undef _UNDEF__STDC_LIMIT_MACROS
+# endif
+# ifdef _UNDEF__STDC_CONSTANT_MACROS
+# undef __STDC_CONSTANT_MACROS
+# undef _UNDEF__STDC_CONSTANT_MACROS
+# endif
+#endif
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/cstdint>
+#else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/cstdint>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+#endif
+
+#endif // _GLIBCXX_CSTDINT
diff --git a/i686-linux/include/c++/4.4.3/cstdio b/i686-linux/include/c++/4.4.3/cstdio
new file mode 100644
index 0000000..b4826e2
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/cstdio
@@ -0,0 +1,205 @@
+// -*- C++ -*- forwarding header.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/cstdio
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c stdio.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
+
+//
+// ISO C++ 14882: 27.8.2 C Library files
+//
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <cstddef>
+#include <stdio.h>
+
+#ifndef _GLIBCXX_CSTDIO
+#define _GLIBCXX_CSTDIO 1
+
+// Get rid of those macros defined in <stdio.h> in lieu of real functions.
+#undef clearerr
+#undef fclose
+#undef feof
+#undef ferror
+#undef fflush
+#undef fgetc
+#undef fgetpos
+#undef fgets
+#undef fopen
+#undef fprintf
+#undef fputc
+#undef fputs
+#undef fread
+#undef freopen
+#undef fscanf
+#undef fseek
+#undef fsetpos
+#undef ftell
+#undef fwrite
+#undef getc
+#undef getchar
+#undef gets
+#undef perror
+#undef printf
+#undef putc
+#undef putchar
+#undef puts
+#undef remove
+#undef rename
+#undef rewind
+#undef scanf
+#undef setbuf
+#undef setvbuf
+#undef sprintf
+#undef sscanf
+#undef tmpfile
+#undef tmpnam
+#undef ungetc
+#undef vfprintf
+#undef vprintf
+#undef vsprintf
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ using ::FILE;
+ using ::fpos_t;
+
+ using ::clearerr;
+ using ::fclose;
+ using ::feof;
+ using ::ferror;
+ using ::fflush;
+ using ::fgetc;
+ using ::fgetpos;
+ using ::fgets;
+ using ::fopen;
+ using ::fprintf;
+ using ::fputc;
+ using ::fputs;
+ using ::fread;
+ using ::freopen;
+ using ::fscanf;
+ using ::fseek;
+ using ::fsetpos;
+ using ::ftell;
+ using ::fwrite;
+ using ::getc;
+ using ::getchar;
+ using ::gets;
+ using ::perror;
+ using ::printf;
+ using ::putc;
+ using ::putchar;
+ using ::puts;
+ using ::remove;
+ using ::rename;
+ using ::rewind;
+ using ::scanf;
+ using ::setbuf;
+ using ::setvbuf;
+ using ::sprintf;
+ using ::sscanf;
+ using ::tmpfile;
+ using ::tmpnam;
+ using ::ungetc;
+ using ::vfprintf;
+ using ::vprintf;
+ using ::vsprintf;
+
+_GLIBCXX_END_NAMESPACE
+
+#if _GLIBCXX_USE_C99
+
+#undef snprintf
+#undef vfscanf
+#undef vscanf
+#undef vsnprintf
+#undef vsscanf
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+#if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC
+ extern "C" int
+ (snprintf)(char * restrict, size_t, const char * restrict, ...);
+ extern "C" int
+ (vfscanf)(FILE * restrict, const char * restrict, __gnuc_va_list);
+ extern "C" int (vscanf)(const char * restrict, __gnuc_va_list);
+ extern "C" int
+ (vsnprintf)(char * restrict, size_t, const char * restrict, __gnuc_va_list);
+ extern "C" int
+ (vsscanf)(const char * restrict, const char * restrict, __gnuc_va_list);
+#endif
+
+#if !_GLIBCXX_USE_C99_DYNAMIC
+ using ::snprintf;
+ using ::vfscanf;
+ using ::vscanf;
+ using ::vsnprintf;
+ using ::vsscanf;
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ using ::__gnu_cxx::snprintf;
+ using ::__gnu_cxx::vfscanf;
+ using ::__gnu_cxx::vscanf;
+ using ::__gnu_cxx::vsnprintf;
+ using ::__gnu_cxx::vsscanf;
+
+_GLIBCXX_END_NAMESPACE
+
+#endif // _GLIBCXX_USE_C99
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+# endif
+# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/cstdio>
+# else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/cstdio>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+# endif
+#endif
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/cstdlib b/i686-linux/include/c++/4.4.3/cstdlib
new file mode 100644
index 0000000..a29031e
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/cstdlib
@@ -0,0 +1,242 @@
+// -*- C++ -*- forwarding header.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/cstdlib
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c stdlib.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
+
+//
+// ISO C++ 14882: 20.4.6 C library
+//
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <cstddef>
+
+#ifndef _GLIBCXX_CSTDLIB
+#define _GLIBCXX_CSTDLIB 1
+
+#if !_GLIBCXX_HOSTED
+// The C standard does not require a freestanding implementation to
+// provide <stdlib.h>. However, the C++ standard does still require
+// <cstdlib> -- but only the functionality mentioned in
+// [lib.support.start.term].
+
+#define EXIT_SUCCESS 0
+#define EXIT_FAILURE 1
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ extern "C" void abort(void);
+ extern "C" int atexit(void (*)());
+ extern "C" void exit(int);
+
+_GLIBCXX_END_NAMESPACE
+
+#else
+
+#include <stdlib.h>
+
+// Get rid of those macros defined in <stdlib.h> in lieu of real functions.
+#undef abort
+#undef abs
+#undef atexit
+#undef atof
+#undef atoi
+#undef atol
+#undef bsearch
+#undef calloc
+#undef div
+#undef exit
+#undef free
+#undef getenv
+#undef labs
+#undef ldiv
+#undef malloc
+#undef mblen
+#undef mbstowcs
+#undef mbtowc
+#undef qsort
+#undef rand
+#undef realloc
+#undef srand
+#undef strtod
+#undef strtol
+#undef strtoul
+#undef system
+#undef wcstombs
+#undef wctomb
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ using ::div_t;
+ using ::ldiv_t;
+
+ using ::abort;
+ using ::abs;
+ using ::atexit;
+ using ::atof;
+ using ::atoi;
+ using ::atol;
+ using ::bsearch;
+ using ::calloc;
+ using ::div;
+ using ::exit;
+ using ::free;
+ using ::getenv;
+ using ::labs;
+ using ::ldiv;
+ using ::malloc;
+#ifdef _GLIBCXX_HAVE_MBSTATE_T
+ using ::mblen;
+ using ::mbstowcs;
+ using ::mbtowc;
+#endif // _GLIBCXX_HAVE_MBSTATE_T
+ using ::qsort;
+ using ::rand;
+ using ::realloc;
+ using ::srand;
+ using ::strtod;
+ using ::strtol;
+ using ::strtoul;
+ using ::system;
+#ifdef _GLIBCXX_USE_WCHAR_T
+ using ::wcstombs;
+ using ::wctomb;
+#endif // _GLIBCXX_USE_WCHAR_T
+
+ inline long
+ abs(long __i) { return labs(__i); }
+
+ inline ldiv_t
+ div(long __i, long __j) { return ldiv(__i, __j); }
+
+_GLIBCXX_END_NAMESPACE
+
+#if _GLIBCXX_USE_C99
+
+#undef _Exit
+#undef llabs
+#undef lldiv
+#undef atoll
+#undef strtoll
+#undef strtoull
+#undef strtof
+#undef strtold
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
+ using ::lldiv_t;
+#endif
+#if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC
+ extern "C" void (_Exit)(int);
+#endif
+#if !_GLIBCXX_USE_C99_DYNAMIC
+ using ::_Exit;
+#endif
+
+ inline long long
+ abs(long long __x) { return __x >= 0 ? __x : -__x; }
+
+#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
+ using ::llabs;
+
+ inline lldiv_t
+ div(long long __n, long long __d)
+ { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
+
+ using ::lldiv;
+#endif
+
+#if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
+ extern "C" long long int (atoll)(const char *);
+ extern "C" long long int
+ (strtoll)(const char * restrict, char ** restrict, int);
+ extern "C" unsigned long long int
+ (strtoull)(const char * restrict, char ** restrict, int);
+#endif
+#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
+ using ::atoll;
+ using ::strtoll;
+ using ::strtoull;
+#endif
+ using ::strtof;
+ using ::strtold;
+
+_GLIBCXX_END_NAMESPACE
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
+ using ::__gnu_cxx::lldiv_t;
+#endif
+ using ::__gnu_cxx::_Exit;
+ using ::__gnu_cxx::abs;
+#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
+ using ::__gnu_cxx::llabs;
+ using ::__gnu_cxx::div;
+ using ::__gnu_cxx::lldiv;
+#endif
+ using ::__gnu_cxx::atoll;
+ using ::__gnu_cxx::strtof;
+ using ::__gnu_cxx::strtoll;
+ using ::__gnu_cxx::strtoull;
+ using ::__gnu_cxx::strtold;
+
+_GLIBCXX_END_NAMESPACE
+
+#endif // _GLIBCXX_USE_C99
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+# endif
+# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/cstdlib>
+# else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/cstdlib>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+# endif
+#endif
+
+#endif // !_GLIBCXX_HOSTED
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/cstring b/i686-linux/include/c++/4.4.3/cstring
new file mode 100644
index 0000000..de0ce24
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/cstring
@@ -0,0 +1,123 @@
+// -*- C++ -*- forwarding header.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file cstring
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c string.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
+
+//
+// ISO C++ 14882: 20.4.6 C library
+//
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <cstddef>
+#include <string.h>
+
+#ifndef _GLIBCXX_CSTRING
+#define _GLIBCXX_CSTRING 1
+
+// Get rid of those macros defined in <string.h> in lieu of real functions.
+#undef memchr
+#undef memcmp
+#undef memcpy
+#undef memmove
+#undef memset
+#undef strcat
+#undef strchr
+#undef strcmp
+#undef strcoll
+#undef strcpy
+#undef strcspn
+#undef strerror
+#undef strlen
+#undef strncat
+#undef strncmp
+#undef strncpy
+#undef strpbrk
+#undef strrchr
+#undef strspn
+#undef strstr
+#undef strtok
+#undef strxfrm
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ using ::memchr;
+ using ::memcmp;
+ using ::memcpy;
+ using ::memmove;
+ using ::memset;
+ using ::strcat;
+ using ::strcmp;
+ using ::strcoll;
+ using ::strcpy;
+ using ::strcspn;
+ using ::strerror;
+ using ::strlen;
+ using ::strncat;
+ using ::strncmp;
+ using ::strncpy;
+ using ::strspn;
+ using ::strtok;
+ using ::strxfrm;
+ using ::strchr;
+ using ::strpbrk;
+ using ::strrchr;
+ using ::strstr;
+
+#ifndef __CORRECT_ISO_CPP_STRING_H_PROTO
+ inline void*
+ memchr(void* __p, int __c, size_t __n)
+ { return memchr(const_cast<const void*>(__p), __c, __n); }
+
+ inline char*
+ strchr(char* __s1, int __n)
+ { return __builtin_strchr(const_cast<const char*>(__s1), __n); }
+
+ inline char*
+ strpbrk(char* __s1, const char* __s2)
+ { return __builtin_strpbrk(const_cast<const char*>(__s1), __s2); }
+
+ inline char*
+ strrchr(char* __s1, int __n)
+ { return __builtin_strrchr(const_cast<const char*>(__s1), __n); }
+
+ inline char*
+ strstr(char* __s1, const char* __s2)
+ { return __builtin_strstr(const_cast<const char*>(__s1), __s2); }
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ctgmath b/i686-linux/include/c++/4.4.3/ctgmath
new file mode 100644
index 0000000..3c6fcf7
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ctgmath
@@ -0,0 +1,41 @@
+// <ctgmath> -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/ctgmath
+ * This is a Standard C++ Library header.
+ */
+
+#pragma GCC system_header
+
+#ifndef _GLIBCXX_CTGMATH
+#define _GLIBCXX_CTGMATH 1
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#else
+# include <cmath>
+#endif
+
+#endif
+
diff --git a/i686-linux/include/c++/4.4.3/ctime b/i686-linux/include/c++/4.4.3/ctime
new file mode 100644
index 0000000..e236cf4
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ctime
@@ -0,0 +1,78 @@
+// -*- C++ -*- forwarding header.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/ctime
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c time.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
+
+//
+// ISO C++ 14882: 20.5 Date and time
+//
+
+#pragma GCC system_header
+
+#include <cstddef>
+#include <time.h>
+
+#ifndef _GLIBCXX_CTIME
+#define _GLIBCXX_CTIME 1
+
+// Get rid of those macros defined in <time.h> in lieu of real functions.
+#undef clock
+#undef difftime
+#undef mktime
+#undef time
+#undef asctime
+#undef ctime
+#undef gmtime
+#undef localtime
+#undef strftime
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ using ::clock_t;
+ using ::time_t;
+ using ::tm;
+
+ using ::clock;
+ using ::difftime;
+ using ::mktime;
+ using ::time;
+ using ::asctime;
+ using ::ctime;
+ using ::gmtime;
+ using ::localtime;
+ using ::strftime;
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/cwchar b/i686-linux/include/c++/4.4.3/cwchar
new file mode 100644
index 0000000..e5ea07e
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/cwchar
@@ -0,0 +1,291 @@
+// -*- C++ -*- forwarding header.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/cwchar
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c wchar.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
+
+//
+// ISO C++ 14882: 21.4
+//
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <cstddef>
+
+#if _GLIBCXX_HAVE_WCHAR_H
+#include <wchar.h>
+#endif
+
+#ifndef _GLIBCXX_CWCHAR
+#define _GLIBCXX_CWCHAR 1
+
+// Need to do a bit of trickery here with mbstate_t as char_traits
+// assumes it is in wchar.h, regardless of wchar_t specializations.
+#ifndef _GLIBCXX_HAVE_MBSTATE_T
+extern "C"
+{
+ typedef struct
+ {
+ int __fill[6];
+ } mbstate_t;
+}
+#endif
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ using ::mbstate_t;
+
+_GLIBCXX_END_NAMESPACE
+
+// Get rid of those macros defined in <wchar.h> in lieu of real functions.
+#undef btowc
+#undef fgetwc
+#undef fgetws
+#undef fputwc
+#undef fputws
+#undef fwide
+#undef fwprintf
+#undef fwscanf
+#undef getwc
+#undef getwchar
+#undef mbrlen
+#undef mbrtowc
+#undef mbsinit
+#undef mbsrtowcs
+#undef putwc
+#undef putwchar
+#undef swprintf
+#undef swscanf
+#undef ungetwc
+#undef vfwprintf
+#if _GLIBCXX_HAVE_VFWSCANF
+# undef vfwscanf
+#endif
+#undef vswprintf
+#if _GLIBCXX_HAVE_VSWSCANF
+# undef vswscanf
+#endif
+#undef vwprintf
+#if _GLIBCXX_HAVE_VWSCANF
+# undef vwscanf
+#endif
+#undef wcrtomb
+#undef wcscat
+#undef wcschr
+#undef wcscmp
+#undef wcscoll
+#undef wcscpy
+#undef wcscspn
+#undef wcsftime
+#undef wcslen
+#undef wcsncat
+#undef wcsncmp
+#undef wcsncpy
+#undef wcspbrk
+#undef wcsrchr
+#undef wcsrtombs
+#undef wcsspn
+#undef wcsstr
+#undef wcstod
+#if _GLIBCXX_HAVE_WCSTOF
+# undef wcstof
+#endif
+#undef wcstok
+#undef wcstol
+#undef wcstoul
+#undef wcsxfrm
+#undef wctob
+#undef wmemchr
+#undef wmemcmp
+#undef wmemcpy
+#undef wmemmove
+#undef wmemset
+#undef wprintf
+#undef wscanf
+
+#if _GLIBCXX_USE_WCHAR_T
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ using ::wint_t;
+
+ using ::btowc;
+ using ::fgetwc;
+ using ::fgetws;
+ using ::fputwc;
+ using ::fputws;
+ using ::fwide;
+ using ::fwprintf;
+ using ::fwscanf;
+ using ::getwc;
+ using ::getwchar;
+ using ::mbrlen;
+ using ::mbrtowc;
+ using ::mbsinit;
+ using ::mbsrtowcs;
+ using ::putwc;
+ using ::putwchar;
+ using ::swprintf;
+ using ::swscanf;
+ using ::ungetwc;
+ using ::vfwprintf;
+#if _GLIBCXX_HAVE_VFWSCANF
+ using ::vfwscanf;
+#endif
+ using ::vswprintf;
+#if _GLIBCXX_HAVE_VSWSCANF
+ using ::vswscanf;
+#endif
+ using ::vwprintf;
+#if _GLIBCXX_HAVE_VWSCANF
+ using ::vwscanf;
+#endif
+ using ::wcrtomb;
+ using ::wcscat;
+ using ::wcscmp;
+ using ::wcscoll;
+ using ::wcscpy;
+ using ::wcscspn;
+ using ::wcsftime;
+ using ::wcslen;
+ using ::wcsncat;
+ using ::wcsncmp;
+ using ::wcsncpy;
+ using ::wcsrtombs;
+ using ::wcsspn;
+ using ::wcstod;
+#if _GLIBCXX_HAVE_WCSTOF
+ using ::wcstof;
+#endif
+ using ::wcstok;
+ using ::wcstol;
+ using ::wcstoul;
+ using ::wcsxfrm;
+ using ::wctob;
+ using ::wmemcmp;
+ using ::wmemcpy;
+ using ::wmemmove;
+ using ::wmemset;
+ using ::wprintf;
+ using ::wscanf;
+ using ::wcschr;
+ using ::wcspbrk;
+ using ::wcsrchr;
+ using ::wcsstr;
+ using ::wmemchr;
+
+#ifndef __CORRECT_ISO_CPP_WCHAR_H_PROTO
+ inline wchar_t*
+ wcschr(wchar_t* __p, wchar_t __c)
+ { return wcschr(const_cast<const wchar_t*>(__p), __c); }
+
+ inline wchar_t*
+ wcspbrk(wchar_t* __s1, const wchar_t* __s2)
+ { return wcspbrk(const_cast<const wchar_t*>(__s1), __s2); }
+
+ inline wchar_t*
+ wcsrchr(wchar_t* __p, wchar_t __c)
+ { return wcsrchr(const_cast<const wchar_t*>(__p), __c); }
+
+ inline wchar_t*
+ wcsstr(wchar_t* __s1, const wchar_t* __s2)
+ { return wcsstr(const_cast<const wchar_t*>(__s1), __s2); }
+
+ inline wchar_t*
+ wmemchr(wchar_t* __p, wchar_t __c, size_t __n)
+ { return wmemchr(const_cast<const wchar_t*>(__p), __c, __n); }
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#if _GLIBCXX_USE_C99
+
+#undef wcstold
+#undef wcstoll
+#undef wcstoull
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+#if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC
+ extern "C" long double
+ (wcstold)(const wchar_t * restrict, wchar_t ** restrict);
+#endif
+#if !_GLIBCXX_USE_C99_DYNAMIC
+ using ::wcstold;
+#endif
+#if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
+ extern "C" long long int
+ (wcstoll)(const wchar_t * restrict, wchar_t ** restrict, int);
+ extern "C" unsigned long long int
+ (wcstoull)(const wchar_t * restrict, wchar_t ** restrict, int);
+#endif
+#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
+ using ::wcstoll;
+ using ::wcstoull;
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ using ::__gnu_cxx::wcstold;
+ using ::__gnu_cxx::wcstoll;
+ using ::__gnu_cxx::wcstoull;
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
+
+#endif //_GLIBCXX_USE_WCHAR_T
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+# endif
+# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/cwchar>
+# else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/cwchar>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+# endif
+#endif
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/cwctype b/i686-linux/include/c++/4.4.3/cwctype
new file mode 100644
index 0000000..4e94fec
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/cwctype
@@ -0,0 +1,126 @@
+// -*- C++ -*- forwarding header.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/cwctype
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c wctype.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
+
+//
+// ISO C++ 14882: <cwctype>
+//
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+
+#if _GLIBCXX_HAVE_WCTYPE_H
+#include <wctype.h>
+#endif
+
+#ifndef _GLIBCXX_CWCTYPE
+#define _GLIBCXX_CWCTYPE 1
+
+// Get rid of those macros defined in <wctype.h> in lieu of real functions.
+#undef iswalnum
+#undef iswalpha
+#if _GLIBCXX_HAVE_ISWBLANK
+# undef iswblank
+#endif
+#undef iswcntrl
+#undef iswctype
+#undef iswdigit
+#undef iswgraph
+#undef iswlower
+#undef iswprint
+#undef iswpunct
+#undef iswspace
+#undef iswupper
+#undef iswxdigit
+#undef towctrans
+#undef towlower
+#undef towupper
+#undef wctrans
+#undef wctype
+
+#if _GLIBCXX_USE_WCHAR_T
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ using ::wctrans_t;
+ using ::wctype_t;
+ using ::wint_t;
+
+ using ::iswalnum;
+ using ::iswalpha;
+#if _GLIBCXX_HAVE_ISWBLANK
+ using ::iswblank;
+#endif
+ using ::iswcntrl;
+ using ::iswctype;
+ using ::iswdigit;
+ using ::iswgraph;
+ using ::iswlower;
+ using ::iswprint;
+ using ::iswpunct;
+ using ::iswspace;
+ using ::iswupper;
+ using ::iswxdigit;
+ using ::towctrans;
+ using ::towlower;
+ using ::towupper;
+ using ::wctrans;
+ using ::wctype;
+
+_GLIBCXX_END_NAMESPACE
+
+#endif //_GLIBCXX_USE_WCHAR_T
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+# endif
+# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/cwctype>
+# else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/cwctype>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+# endif
+#endif
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/cxxabi-forced.h b/i686-linux/include/c++/4.4.3/cxxabi-forced.h
new file mode 100644
index 0000000..e0cf1d0
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/cxxabi-forced.h
@@ -0,0 +1,51 @@
+// cxxabi.h subset for inclusion by other library headers -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of GCC.
+//
+// GCC is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// GCC is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+#ifndef _CXXABI_FORCED_H
+#define _CXXABI_FORCED_H 1
+
+#pragma GCC visibility push(default)
+
+#ifdef __cplusplus
+namespace __cxxabiv1
+{
+ /**
+ * @brief Thrown as part of forced unwinding.
+ * @ingroup exceptions
+ *
+ * A magic placeholder class that can be caught by reference to
+ * recognize forced unwinding.
+ */
+ class __forced_unwind
+ {
+ virtual ~__forced_unwind() throw();
+ virtual void __pure_dummy() = 0; // prevent catch by value
+ };
+}
+#endif // __cplusplus
+
+#pragma GCC visibility pop
+
+#endif // __CXXABI_FORCED_H
diff --git a/i686-linux/include/c++/4.4.3/cxxabi.h b/i686-linux/include/c++/4.4.3/cxxabi.h
new file mode 100644
index 0000000..bfdd8e5
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/cxxabi.h
@@ -0,0 +1,608 @@
+// new abi support -*- C++ -*-
+
+// Copyright (C) 2000, 2002, 2003, 2004, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of GCC.
+//
+// GCC is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// GCC is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Written by Nathan Sidwell, Codesourcery LLC, <nathan@codesourcery.com>
+
+/* This file declares the new abi entry points into the runtime. It is not
+ normally necessary for user programs to include this header, or use the
+ entry points directly. However, this header is available should that be
+ needed.
+
+ Some of the entry points are intended for both C and C++, thus this header
+ is includable from both C and C++. Though the C++ specific parts are not
+ available in C, naturally enough. */
+
+/** @file cxxabi.h
+ * The header provides an interface to the C++ ABI.
+ */
+
+#ifndef _CXXABI_H
+#define _CXXABI_H 1
+
+#pragma GCC visibility push(default)
+
+#include <stddef.h>
+#include <bits/cxxabi_tweaks.h>
+#include <cxxabi-forced.h>
+
+#ifdef __cplusplus
+#define _GLIBCXX_NOTHROW throw()
+#else
+#define _GLIBCXX_NOTHROW __attribute__((nothrow))
+#endif
+
+#ifdef __cplusplus
+namespace __cxxabiv1
+{
+ extern "C"
+ {
+#endif
+
+ typedef __cxa_cdtor_return_type (*__cxa_cdtor_type)(void *);
+
+ // Allocate array.
+ void*
+ __cxa_vec_new(size_t __element_count, size_t __element_size,
+ size_t __padding_size, __cxa_cdtor_type constructor,
+ __cxa_cdtor_type destructor);
+
+ void*
+ __cxa_vec_new2(size_t __element_count, size_t __element_size,
+ size_t __padding_size, __cxa_cdtor_type constructor,
+ __cxa_cdtor_type destructor, void *(*__alloc) (size_t),
+ void (*__dealloc) (void*));
+
+ void*
+ __cxa_vec_new3(size_t __element_count, size_t __element_size,
+ size_t __padding_size, __cxa_cdtor_type constructor,
+ __cxa_cdtor_type destructor, void *(*__alloc) (size_t),
+ void (*__dealloc) (void*, size_t));
+
+ // Construct array.
+ __cxa_vec_ctor_return_type
+ __cxa_vec_ctor(void* __array_address, size_t __element_count,
+ size_t __element_size, __cxa_cdtor_type constructor,
+ __cxa_cdtor_type destructor);
+
+ __cxa_vec_ctor_return_type
+ __cxa_vec_cctor(void* dest_array, void* src_array, size_t element_count,
+ size_t element_size,
+ __cxa_cdtor_return_type (*constructor) (void*, void*),
+ __cxa_cdtor_type destructor);
+
+ // Destruct array.
+ void
+ __cxa_vec_dtor(void* __array_address, size_t __element_count,
+ size_t __element_size, __cxa_cdtor_type destructor);
+
+ void
+ __cxa_vec_cleanup(void* __array_address, size_t __element_count,
+ size_t __element_size, __cxa_cdtor_type destructor);
+
+ // Destruct and release array.
+ void
+ __cxa_vec_delete(void* __array_address, size_t __element_size,
+ size_t __padding_size, __cxa_cdtor_type destructor);
+
+ void
+ __cxa_vec_delete2(void* __array_address, size_t __element_size,
+ size_t __padding_size, __cxa_cdtor_type destructor,
+ void (*__dealloc) (void*));
+
+ void
+ __cxa_vec_delete3(void* __array_address, size_t __element_size,
+ size_t __padding_size, __cxa_cdtor_type destructor,
+ void (*__dealloc) (void*, size_t));
+
+ int
+ __cxa_guard_acquire(__guard*);
+
+ void
+ __cxa_guard_release(__guard*);
+
+ void
+ __cxa_guard_abort(__guard*);
+
+ // Pure virtual functions.
+ void
+ __cxa_pure_virtual(void);
+
+ // Exception handling.
+ void
+ __cxa_bad_cast();
+
+ void
+ __cxa_bad_typeid();
+
+ // DSO destruction.
+ int
+ __cxa_atexit(void (*)(void*), void*, void*) _GLIBCXX_NOTHROW;
+
+ int
+ __cxa_finalize(void*);
+
+
+ /**
+ * @brief Demangling routine.
+ * ABI-mandated entry point in the C++ runtime library for demangling.
+ *
+ * @param __mangled_name A NUL-terminated character string
+ * containing the name to be demangled.
+ *
+ * @param __output_buffer A region of memory, allocated with
+ * malloc, of @a *__length bytes, into which the demangled name is
+ * stored. If @a __output_buffer is not long enough, it is
+ * expanded using realloc. @a __output_buffer may instead be NULL;
+ * in that case, the demangled name is placed in a region of memory
+ * allocated with malloc.
+ *
+ * @param __length If @a __length is non-NULL, the length of the
+ * buffer containing the demangled name is placed in @a *__length.
+ *
+ * @param __status @a *__status is set to one of the following values:
+ * 0: The demangling operation succeeded.
+ * -1: A memory allocation failiure occurred.
+ * -2: @a mangled_name is not a valid name under the C++ ABI mangling rules.
+ * -3: One of the arguments is invalid.
+ *
+ * @return A pointer to the start of the NUL-terminated demangled
+ * name, or NULL if the demangling fails. The caller is
+ * responsible for deallocating this memory using @c free.
+ *
+ * The demangling is performed using the C++ ABI mangling rules,
+ * with GNU extensions. For example, this function is used in
+ * __gnu_cxx::__verbose_terminate_handler.
+ *
+ * See http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt12ch39.html
+ * for other examples of use.
+ *
+ * @note The same demangling functionality is available via
+ * libiberty (@c <libiberty/demangle.h> and @c libiberty.a) in GCC
+ * 3.1 and later, but that requires explicit installation (@c
+ * --enable-install-libiberty) and uses a different API, although
+ * the ABI is unchanged.
+ */
+ char*
+ __cxa_demangle(const char* __mangled_name, char* __output_buffer,
+ size_t* __length, int* __status);
+#ifdef __cplusplus
+ }
+} // namespace __cxxabiv1
+#endif
+
+#ifdef __cplusplus
+
+#include <typeinfo>
+
+namespace __cxxabiv1
+{
+ // Type information for int, float etc.
+ class __fundamental_type_info : public std::type_info
+ {
+ public:
+ explicit
+ __fundamental_type_info(const char* __n) : std::type_info(__n) { }
+
+ virtual
+ ~__fundamental_type_info();
+ };
+
+ // Type information for array objects.
+ class __array_type_info : public std::type_info
+ {
+ public:
+ explicit
+ __array_type_info(const char* __n) : std::type_info(__n) { }
+
+ virtual
+ ~__array_type_info();
+ };
+
+ // Type information for functions (both member and non-member).
+ class __function_type_info : public std::type_info
+ {
+ public:
+ explicit
+ __function_type_info(const char* __n) : std::type_info(__n) { }
+
+ virtual
+ ~__function_type_info();
+
+ protected:
+ // Implementation defined member function.
+ virtual bool
+ __is_function_p() const;
+ };
+
+ // Type information for enumerations.
+ class __enum_type_info : public std::type_info
+ {
+ public:
+ explicit
+ __enum_type_info(const char* __n) : std::type_info(__n) { }
+
+ virtual
+ ~__enum_type_info();
+ };
+
+ // Common type information for simple pointers and pointers to member.
+ class __pbase_type_info : public std::type_info
+ {
+ public:
+ unsigned int __flags; // Qualification of the target object.
+ const std::type_info* __pointee; // Type of pointed to object.
+
+ explicit
+ __pbase_type_info(const char* __n, int __quals,
+ const std::type_info* __type)
+ : std::type_info(__n), __flags(__quals), __pointee(__type)
+ { }
+
+ virtual
+ ~__pbase_type_info();
+
+ // Implementation defined type.
+ enum __masks
+ {
+ __const_mask = 0x1,
+ __volatile_mask = 0x2,
+ __restrict_mask = 0x4,
+ __incomplete_mask = 0x8,
+ __incomplete_class_mask = 0x10
+ };
+
+ protected:
+ __pbase_type_info(const __pbase_type_info&);
+
+ __pbase_type_info&
+ operator=(const __pbase_type_info&);
+
+ // Implementation defined member functions.
+ virtual bool
+ __do_catch(const std::type_info* __thr_type, void** __thr_obj,
+ unsigned int __outer) const;
+
+ inline virtual bool
+ __pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj,
+ unsigned __outer) const;
+ };
+
+ // Type information for simple pointers.
+ class __pointer_type_info : public __pbase_type_info
+ {
+ public:
+ explicit
+ __pointer_type_info(const char* __n, int __quals,
+ const std::type_info* __type)
+ : __pbase_type_info (__n, __quals, __type) { }
+
+
+ virtual
+ ~__pointer_type_info();
+
+ protected:
+ // Implementation defined member functions.
+ virtual bool
+ __is_pointer_p() const;
+
+ virtual bool
+ __pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj,
+ unsigned __outer) const;
+ };
+
+ class __class_type_info;
+
+ // Type information for a pointer to member variable.
+ class __pointer_to_member_type_info : public __pbase_type_info
+ {
+ public:
+ __class_type_info* __context; // Class of the member.
+
+ explicit
+ __pointer_to_member_type_info(const char* __n, int __quals,
+ const std::type_info* __type,
+ __class_type_info* __klass)
+ : __pbase_type_info(__n, __quals, __type), __context(__klass) { }
+
+ virtual
+ ~__pointer_to_member_type_info();
+
+ protected:
+ __pointer_to_member_type_info(const __pointer_to_member_type_info&);
+
+ __pointer_to_member_type_info&
+ operator=(const __pointer_to_member_type_info&);
+
+ // Implementation defined member function.
+ virtual bool
+ __pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj,
+ unsigned __outer) const;
+ };
+
+ // Helper class for __vmi_class_type.
+ class __base_class_type_info
+ {
+ public:
+ const __class_type_info* __base_type; // Base class type.
+ long __offset_flags; // Offset and info.
+
+ enum __offset_flags_masks
+ {
+ __virtual_mask = 0x1,
+ __public_mask = 0x2,
+ __hwm_bit = 2,
+ __offset_shift = 8 // Bits to shift offset.
+ };
+
+ // Implementation defined member functions.
+ bool
+ __is_virtual_p() const
+ { return __offset_flags & __virtual_mask; }
+
+ bool
+ __is_public_p() const
+ { return __offset_flags & __public_mask; }
+
+ ptrdiff_t
+ __offset() const
+ {
+ // This shift, being of a signed type, is implementation
+ // defined. GCC implements such shifts as arithmetic, which is
+ // what we want.
+ return static_cast<ptrdiff_t>(__offset_flags) >> __offset_shift;
+ }
+ };
+
+ // Type information for a class.
+ class __class_type_info : public std::type_info
+ {
+ public:
+ explicit
+ __class_type_info (const char *__n) : type_info(__n) { }
+
+ virtual
+ ~__class_type_info ();
+
+ // Implementation defined types.
+ // The type sub_kind tells us about how a base object is contained
+ // within a derived object. We often do this lazily, hence the
+ // UNKNOWN value. At other times we may use NOT_CONTAINED to mean
+ // not publicly contained.
+ enum __sub_kind
+ {
+ // We have no idea.
+ __unknown = 0,
+
+ // Not contained within us (in some circumstances this might
+ // mean not contained publicly)
+ __not_contained,
+
+ // Contained ambiguously.
+ __contained_ambig,
+
+ // Via a virtual path.
+ __contained_virtual_mask = __base_class_type_info::__virtual_mask,
+
+ // Via a public path.
+ __contained_public_mask = __base_class_type_info::__public_mask,
+
+ // Contained within us.
+ __contained_mask = 1 << __base_class_type_info::__hwm_bit,
+
+ __contained_private = __contained_mask,
+ __contained_public = __contained_mask | __contained_public_mask
+ };
+
+ struct __upcast_result;
+ struct __dyncast_result;
+
+ protected:
+ // Implementation defined member functions.
+ virtual bool
+ __do_upcast(const __class_type_info* __dst_type, void**__obj_ptr) const;
+
+ virtual bool
+ __do_catch(const type_info* __thr_type, void** __thr_obj,
+ unsigned __outer) const;
+
+ public:
+ // Helper for upcast. See if DST is us, or one of our bases.
+ // Return false if not found, true if found.
+ virtual bool
+ __do_upcast(const __class_type_info* __dst, const void* __obj,
+ __upcast_result& __restrict __result) const;
+
+ // Indicate whether SRC_PTR of type SRC_TYPE is contained publicly
+ // within OBJ_PTR. OBJ_PTR points to a base object of our type,
+ // which is the destination type. SRC2DST indicates how SRC
+ // objects might be contained within this type. If SRC_PTR is one
+ // of our SRC_TYPE bases, indicate the virtuality. Returns
+ // not_contained for non containment or private containment.
+ inline __sub_kind
+ __find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr,
+ const __class_type_info* __src_type,
+ const void* __src_ptr) const;
+
+ // Helper for dynamic cast. ACCESS_PATH gives the access from the
+ // most derived object to this base. DST_TYPE indicates the
+ // desired type we want. OBJ_PTR points to a base of our type
+ // within the complete object. SRC_TYPE indicates the static type
+ // started from and SRC_PTR points to that base within the most
+ // derived object. Fill in RESULT with what we find. Return true
+ // if we have located an ambiguous match.
+ virtual bool
+ __do_dyncast(ptrdiff_t __src2dst, __sub_kind __access_path,
+ const __class_type_info* __dst_type, const void* __obj_ptr,
+ const __class_type_info* __src_type, const void* __src_ptr,
+ __dyncast_result& __result) const;
+
+ // Helper for find_public_subobj. SRC2DST indicates how SRC_TYPE
+ // bases are inherited by the type started from -- which is not
+ // necessarily the current type. The current type will be a base
+ // of the destination type. OBJ_PTR points to the current base.
+ virtual __sub_kind
+ __do_find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr,
+ const __class_type_info* __src_type,
+ const void* __src_ptr) const;
+ };
+
+ // Type information for a class with a single non-virtual base.
+ class __si_class_type_info : public __class_type_info
+ {
+ public:
+ const __class_type_info* __base_type;
+
+ explicit
+ __si_class_type_info(const char *__n, const __class_type_info *__base)
+ : __class_type_info(__n), __base_type(__base) { }
+
+ virtual
+ ~__si_class_type_info();
+
+ protected:
+ __si_class_type_info(const __si_class_type_info&);
+
+ __si_class_type_info&
+ operator=(const __si_class_type_info&);
+
+ // Implementation defined member functions.
+ virtual bool
+ __do_dyncast(ptrdiff_t __src2dst, __sub_kind __access_path,
+ const __class_type_info* __dst_type, const void* __obj_ptr,
+ const __class_type_info* __src_type, const void* __src_ptr,
+ __dyncast_result& __result) const;
+
+ virtual __sub_kind
+ __do_find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr,
+ const __class_type_info* __src_type,
+ const void* __sub_ptr) const;
+
+ virtual bool
+ __do_upcast(const __class_type_info*__dst, const void*__obj,
+ __upcast_result& __restrict __result) const;
+ };
+
+ // Type information for a class with multiple and/or virtual bases.
+ class __vmi_class_type_info : public __class_type_info
+ {
+ public:
+ unsigned int __flags; // Details about the class hierarchy.
+ unsigned int __base_count; // Number of direct bases.
+
+ // The array of bases uses the trailing array struct hack so this
+ // class is not constructable with a normal constructor. It is
+ // internally generated by the compiler.
+ __base_class_type_info __base_info[1]; // Array of bases.
+
+ explicit
+ __vmi_class_type_info(const char* __n, int ___flags)
+ : __class_type_info(__n), __flags(___flags), __base_count(0) { }
+
+ virtual
+ ~__vmi_class_type_info();
+
+ // Implementation defined types.
+ enum __flags_masks
+ {
+ __non_diamond_repeat_mask = 0x1, // Distinct instance of repeated base.
+ __diamond_shaped_mask = 0x2, // Diamond shaped multiple inheritance.
+ __flags_unknown_mask = 0x10
+ };
+
+ protected:
+ // Implementation defined member functions.
+ virtual bool
+ __do_dyncast(ptrdiff_t __src2dst, __sub_kind __access_path,
+ const __class_type_info* __dst_type, const void* __obj_ptr,
+ const __class_type_info* __src_type, const void* __src_ptr,
+ __dyncast_result& __result) const;
+
+ virtual __sub_kind
+ __do_find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr,
+ const __class_type_info* __src_type,
+ const void* __src_ptr) const;
+
+ virtual bool
+ __do_upcast(const __class_type_info* __dst, const void* __obj,
+ __upcast_result& __restrict __result) const;
+ };
+
+ // Dynamic cast runtime.
+ // src2dst has the following possible values
+ // >-1: src_type is a unique public non-virtual base of dst_type
+ // dst_ptr + src2dst == src_ptr
+ // -1: unspecified relationship
+ // -2: src_type is not a public base of dst_type
+ // -3: src_type is a multiple public non-virtual base of dst_type
+ extern "C" void*
+ __dynamic_cast(const void* __src_ptr, // Starting object.
+ const __class_type_info* __src_type, // Static type of object.
+ const __class_type_info* __dst_type, // Desired target type.
+ ptrdiff_t __src2dst); // How src and dst are related.
+
+
+ // Returns the type_info for the currently handled exception [15.3/8], or
+ // null if there is none.
+ extern "C" std::type_info*
+ __cxa_current_exception_type();
+
+ // A magic placeholder class that can be caught by reference
+ // to recognize foreign exceptions.
+ class __foreign_exception
+ {
+ virtual ~__foreign_exception() throw();
+ virtual void __pure_dummy() = 0; // prevent catch by value
+ };
+
+} // namespace __cxxabiv1
+
+/** @namespace abi
+ * @brief The cross-vendor C++ Application Binary Interface. A
+ * namespace alias to __cxxabiv1, but user programs should use the
+ * alias `abi'.
+ *
+ * A brief overview of an ABI is given in the libstdc++ FAQ, question
+ * 5.8 (you may have a copy of the FAQ locally, or you can view the online
+ * version at http://gcc.gnu.org/onlinedocs/libstdc++/faq/index.html#5_8).
+ *
+ * GCC subscribes to a cross-vendor ABI for C++, sometimes
+ * called the IA64 ABI because it happens to be the native ABI for that
+ * platform. It is summarized at http://www.codesourcery.com/cxx-abi/
+ * along with the current specification.
+ *
+ * For users of GCC greater than or equal to 3.x, entry points are
+ * available in <cxxabi.h>, which notes, <em>"It is not normally
+ * necessary for user programs to include this header, or use the
+ * entry points directly. However, this header is available should
+ * that be needed."</em>
+*/
+namespace abi = __cxxabiv1;
+
+#endif // __cplusplus
+
+#pragma GCC visibility pop
+
+#endif // __CXXABI_H
diff --git a/i686-linux/include/c++/4.4.3/debug/bitset b/i686-linux/include/c++/4.4.3/debug/bitset
new file mode 100644
index 0000000..b493442
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/debug/bitset
@@ -0,0 +1,369 @@
+// Debugging bitset implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/bitset
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_BITSET
+#define _GLIBCXX_DEBUG_BITSET
+
+#include <bitset>
+#include <debug/safe_sequence.h>
+#include <debug/safe_iterator.h>
+
+namespace std
+{
+namespace __debug
+{
+ template<size_t _Nb>
+ class bitset
+ : public _GLIBCXX_STD_D::bitset<_Nb>,
+ public __gnu_debug::_Safe_sequence_base
+ {
+ typedef _GLIBCXX_STD_D::bitset<_Nb> _Base;
+ typedef __gnu_debug::_Safe_sequence_base _Safe_base;
+
+ public:
+ // bit reference:
+ class reference
+ : private _Base::reference, public __gnu_debug::_Safe_iterator_base
+ {
+ typedef typename _Base::reference _Base_ref;
+
+ friend class bitset;
+ reference();
+
+ reference(const _Base_ref& __base, bitset* __seq)
+ : _Base_ref(__base), _Safe_iterator_base(__seq, false)
+ { }
+
+ public:
+ reference(const reference& __x)
+ : _Base_ref(__x), _Safe_iterator_base(__x, false)
+ { }
+
+ reference&
+ operator=(bool __x)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! this->_M_singular(),
+ _M_message(__gnu_debug::__msg_bad_bitset_write)
+ ._M_iterator(*this));
+ *static_cast<_Base_ref*>(this) = __x;
+ return *this;
+ }
+
+ reference&
+ operator=(const reference& __x)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __x._M_singular(),
+ _M_message(__gnu_debug::__msg_bad_bitset_read)
+ ._M_iterator(__x));
+ _GLIBCXX_DEBUG_VERIFY(! this->_M_singular(),
+ _M_message(__gnu_debug::__msg_bad_bitset_write)
+ ._M_iterator(*this));
+ *static_cast<_Base_ref*>(this) = __x;
+ return *this;
+ }
+
+ bool
+ operator~() const
+ {
+ _GLIBCXX_DEBUG_VERIFY(! this->_M_singular(),
+ _M_message(__gnu_debug::__msg_bad_bitset_read)
+ ._M_iterator(*this));
+ return ~(*static_cast<const _Base_ref*>(this));
+ }
+
+ operator bool() const
+ {
+ _GLIBCXX_DEBUG_VERIFY(! this->_M_singular(),
+ _M_message(__gnu_debug::__msg_bad_bitset_read)
+ ._M_iterator(*this));
+ return *static_cast<const _Base_ref*>(this);
+ }
+
+ reference&
+ flip()
+ {
+ _GLIBCXX_DEBUG_VERIFY(! this->_M_singular(),
+ _M_message(__gnu_debug::__msg_bad_bitset_flip)
+ ._M_iterator(*this));
+ _Base_ref::flip();
+ return *this;
+ }
+ };
+
+ // 23.3.5.1 constructors:
+ bitset() : _Base() { }
+
+ bitset(unsigned long __val) : _Base(__val) { }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ explicit
+ bitset(const std::basic_string<_CharT, _Traits, _Alloc>& __str,
+ typename std::basic_string<_CharT, _Traits, _Alloc>::size_type
+ __pos = 0,
+ typename std::basic_string<_CharT, _Traits, _Alloc>::size_type
+ __n = (std::basic_string<_CharT, _Traits, _Alloc>::npos))
+ : _Base(__str, __pos, __n) { }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 396. what are characters zero and one.
+ template<class _CharT, class _Traits, class _Alloc>
+ bitset(const std::basic_string<_CharT, _Traits, _Alloc>& __str,
+ typename std::basic_string<_CharT, _Traits, _Alloc>::size_type
+ __pos,
+ typename std::basic_string<_CharT, _Traits, _Alloc>::size_type
+ __n,
+ _CharT __zero, _CharT __one = _CharT('1'))
+ : _Base(__str, __pos, __n, __zero, __one) { }
+
+ bitset(const _Base& __x) : _Base(__x), _Safe_base() { }
+
+ // 23.3.5.2 bitset operations:
+ bitset<_Nb>&
+ operator&=(const bitset<_Nb>& __rhs)
+ {
+ _M_base() &= __rhs;
+ return *this;
+ }
+
+ bitset<_Nb>&
+ operator|=(const bitset<_Nb>& __rhs)
+ {
+ _M_base() |= __rhs;
+ return *this;
+ }
+
+ bitset<_Nb>&
+ operator^=(const bitset<_Nb>& __rhs)
+ {
+ _M_base() ^= __rhs;
+ return *this;
+ }
+
+ bitset<_Nb>&
+ operator<<=(size_t __pos)
+ {
+ _M_base() <<= __pos;
+ return *this;
+ }
+
+ bitset<_Nb>&
+ operator>>=(size_t __pos)
+ {
+ _M_base() >>= __pos;
+ return *this;
+ }
+
+ bitset<_Nb>&
+ set()
+ {
+ _Base::set();
+ return *this;
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 186. bitset::set() second parameter should be bool
+ bitset<_Nb>&
+ set(size_t __pos, bool __val = true)
+ {
+ _Base::set(__pos, __val);
+ return *this;
+ }
+
+ bitset<_Nb>&
+ reset()
+ {
+ _Base::reset();
+ return *this;
+ }
+
+ bitset<_Nb>&
+ reset(size_t __pos)
+ {
+ _Base::reset(__pos);
+ return *this;
+ }
+
+ bitset<_Nb> operator~() const { return bitset(~_M_base()); }
+
+ bitset<_Nb>&
+ flip()
+ {
+ _Base::flip();
+ return *this;
+ }
+
+ bitset<_Nb>&
+ flip(size_t __pos)
+ {
+ _Base::flip(__pos);
+ return *this;
+ }
+
+ // element access:
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 11. Bitset minor problems
+ reference
+ operator[](size_t __pos)
+ {
+ __glibcxx_check_subscript(__pos);
+ return reference(_M_base()[__pos], this);
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 11. Bitset minor problems
+ bool
+ operator[](size_t __pos) const
+ {
+ __glibcxx_check_subscript(__pos);
+ return _M_base()[__pos];
+ }
+
+ using _Base::to_ulong;
+
+ template <typename _CharT, typename _Traits, typename _Alloc>
+ std::basic_string<_CharT, _Traits, _Alloc>
+ to_string() const
+ { return _M_base().template to_string<_CharT, _Traits, _Alloc>(); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 396. what are characters zero and one.
+ template<class _CharT, class _Traits, class _Alloc>
+ std::basic_string<_CharT, _Traits, _Alloc>
+ to_string(_CharT __zero, _CharT __one = _CharT('1')) const
+ {
+ return _M_base().template
+ to_string<_CharT, _Traits, _Alloc>(__zero, __one);
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 434. bitset::to_string() hard to use.
+ template<typename _CharT, typename _Traits>
+ std::basic_string<_CharT, _Traits, std::allocator<_CharT> >
+ to_string() const
+ { return to_string<_CharT, _Traits, std::allocator<_CharT> >(); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 853. to_string needs updating with zero and one.
+ template<class _CharT, class _Traits>
+ std::basic_string<_CharT, _Traits, std::allocator<_CharT> >
+ to_string(_CharT __zero, _CharT __one = _CharT('1')) const
+ { return to_string<_CharT, _Traits,
+ std::allocator<_CharT> >(__zero, __one); }
+
+ template<typename _CharT>
+ std::basic_string<_CharT, std::char_traits<_CharT>,
+ std::allocator<_CharT> >
+ to_string() const
+ {
+ return to_string<_CharT, std::char_traits<_CharT>,
+ std::allocator<_CharT> >();
+ }
+
+ template<class _CharT>
+ std::basic_string<_CharT, std::char_traits<_CharT>,
+ std::allocator<_CharT> >
+ to_string(_CharT __zero, _CharT __one = _CharT('1')) const
+ {
+ return to_string<_CharT, std::char_traits<_CharT>,
+ std::allocator<_CharT> >(__zero, __one);
+ }
+
+ std::basic_string<char, std::char_traits<char>, std::allocator<char> >
+ to_string() const
+ {
+ return to_string<char,std::char_traits<char>,std::allocator<char> >();
+ }
+
+ std::basic_string<char, std::char_traits<char>, std::allocator<char> >
+ to_string(char __zero, char __one = '1') const
+ {
+ return to_string<char, std::char_traits<char>,
+ std::allocator<char> >(__zero, __one);
+ }
+
+ using _Base::count;
+ using _Base::size;
+
+ bool
+ operator==(const bitset<_Nb>& __rhs) const
+ { return _M_base() == __rhs; }
+
+ bool
+ operator!=(const bitset<_Nb>& __rhs) const
+ { return _M_base() != __rhs; }
+
+ using _Base::test;
+ using _Base::all;
+ using _Base::any;
+ using _Base::none;
+
+ bitset<_Nb>
+ operator<<(size_t __pos) const
+ { return bitset<_Nb>(_M_base() << __pos); }
+
+ bitset<_Nb>
+ operator>>(size_t __pos) const
+ { return bitset<_Nb>(_M_base() >> __pos); }
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+ };
+
+ template<size_t _Nb>
+ bitset<_Nb>
+ operator&(const bitset<_Nb>& __x, const bitset<_Nb>& __y)
+ { return bitset<_Nb>(__x) &= __y; }
+
+ template<size_t _Nb>
+ bitset<_Nb>
+ operator|(const bitset<_Nb>& __x, const bitset<_Nb>& __y)
+ { return bitset<_Nb>(__x) |= __y; }
+
+ template<size_t _Nb>
+ bitset<_Nb>
+ operator^(const bitset<_Nb>& __x, const bitset<_Nb>& __y)
+ { return bitset<_Nb>(__x) ^= __y; }
+
+ template<typename _CharT, typename _Traits, size_t _Nb>
+ std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x)
+ { return __is >> __x._M_base(); }
+
+ template<typename _CharT, typename _Traits, size_t _Nb>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const bitset<_Nb>& __x)
+ { return __os << __x._M_base(); }
+} // namespace __debug
+} // namespace std
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/debug/debug.h b/i686-linux/include/c++/4.4.3/debug/debug.h
new file mode 100644
index 0000000..305299b
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/debug/debug.h
@@ -0,0 +1,130 @@
+// Debugging support implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/debug.h
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_MACRO_SWITCH_H
+#define _GLIBCXX_DEBUG_MACRO_SWITCH_H 1
+
+/** Macros and namespaces used by the implementation outside of debug
+ * wrappers to verify certain properties. The __glibcxx_requires_xxx
+ * macros are merely wrappers around the __glibcxx_check_xxx wrappers
+ * when we are compiling with debug mode, but disappear when we are
+ * in release mode so that there is no checking performed in, e.g.,
+ * the standard library algorithms.
+*/
+
+// Debug mode namespaces.
+
+/**
+ * @namespace std::__debug
+ * @brief GNU debug code, replaces standard behavior with debug behavior.
+ */
+namespace std
+{
+ namespace __debug { }
+}
+
+/** @namespace __gnu_debug
+ * @brief GNU debug classes for public use.
+*/
+namespace __gnu_debug
+{
+ using namespace std::__debug;
+}
+
+#ifndef _GLIBCXX_DEBUG
+
+# define _GLIBCXX_DEBUG_ASSERT(_Condition)
+# define _GLIBCXX_DEBUG_PEDASSERT(_Condition)
+# define _GLIBCXX_DEBUG_ONLY(_Statement) ;
+# define __glibcxx_requires_cond(_Cond,_Msg)
+# define __glibcxx_requires_valid_range(_First,_Last)
+# define __glibcxx_requires_sorted(_First,_Last)
+# define __glibcxx_requires_sorted_pred(_First,_Last,_Pred)
+# define __glibcxx_requires_sorted_set(_First1,_Last1,_First2)
+# define __glibcxx_requires_sorted_set_pred(_First1,_Last1,_First2,_Pred)
+# define __glibcxx_requires_partitioned_lower(_First,_Last,_Value)
+# define __glibcxx_requires_partitioned_upper(_First,_Last,_Value)
+# define __glibcxx_requires_partitioned_lower_pred(_First,_Last,_Value,_Pred)
+# define __glibcxx_requires_partitioned_upper_pred(_First,_Last,_Value,_Pred)
+# define __glibcxx_requires_heap(_First,_Last)
+# define __glibcxx_requires_heap_pred(_First,_Last,_Pred)
+# define __glibcxx_requires_nonempty()
+# define __glibcxx_requires_string(_String)
+# define __glibcxx_requires_string_len(_String,_Len)
+# define __glibcxx_requires_subscript(_N)
+
+#else
+
+# include <debug/macros.h>
+
+#define _GLIBCXX_DEBUG_ASSERT(_Condition) __glibcxx_assert(_Condition)
+
+#ifdef _GLIBCXX_DEBUG_PEDANTIC
+# define _GLIBCXX_DEBUG_PEDASSERT(_Condition) _GLIBCXX_DEBUG_ASSERT(_Condition)
+#else
+# define _GLIBCXX_DEBUG_PEDASSERT(_Condition)
+#endif
+
+# define _GLIBCXX_DEBUG_ONLY(_Statement) _Statement
+
+# define __glibcxx_requires_cond(_Cond,_Msg) _GLIBCXX_DEBUG_VERIFY(_Cond,_Msg)
+# define __glibcxx_requires_valid_range(_First,_Last) \
+ __glibcxx_check_valid_range(_First,_Last)
+# define __glibcxx_requires_sorted(_First,_Last) \
+ __glibcxx_check_sorted(_First,_Last)
+# define __glibcxx_requires_sorted_pred(_First,_Last,_Pred) \
+ __glibcxx_check_sorted_pred(_First,_Last,_Pred)
+# define __glibcxx_requires_sorted_set(_First1,_Last1,_First2) \
+ __glibcxx_check_sorted_set(_First1,_Last1,_First2)
+# define __glibcxx_requires_sorted_set_pred(_First1,_Last1,_First2,_Pred) \
+ __glibcxx_check_sorted_set_pred(_First1,_Last1,_First2,_Pred)
+# define __glibcxx_requires_partitioned_lower(_First,_Last,_Value) \
+ __glibcxx_check_partitioned_lower(_First,_Last,_Value)
+# define __glibcxx_requires_partitioned_upper(_First,_Last,_Value) \
+ __glibcxx_check_partitioned_upper(_First,_Last,_Value)
+# define __glibcxx_requires_partitioned_lower_pred(_First,_Last,_Value,_Pred) \
+ __glibcxx_check_partitioned_lower_pred(_First,_Last,_Value,_Pred)
+# define __glibcxx_requires_partitioned_upper_pred(_First,_Last,_Value,_Pred) \
+ __glibcxx_check_partitioned_upper_pred(_First,_Last,_Value,_Pred)
+# define __glibcxx_requires_heap(_First,_Last) \
+ __glibcxx_check_heap(_First,_Last)
+# define __glibcxx_requires_heap_pred(_First,_Last,_Pred) \
+ __glibcxx_check_heap_pred(_First,_Last,_Pred)
+# define __glibcxx_requires_nonempty() __glibcxx_check_nonempty()
+# define __glibcxx_requires_string(_String) __glibcxx_check_string(_String)
+# define __glibcxx_requires_string_len(_String,_Len) \
+ __glibcxx_check_string_len(_String,_Len)
+# define __glibcxx_requires_subscript(_N) __glibcxx_check_subscript(_N)
+
+# include <debug/functions.h>
+# include <debug/formatter.h>
+
+#endif
+
+#endif // _GLIBCXX_DEBUG_MACRO_SWITCH_H
diff --git a/i686-linux/include/c++/4.4.3/debug/deque b/i686-linux/include/c++/4.4.3/debug/deque
new file mode 100644
index 0000000..b481fd1
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/debug/deque
@@ -0,0 +1,515 @@
+// Debugging deque implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/deque
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_DEQUE
+#define _GLIBCXX_DEBUG_DEQUE 1
+
+#include <deque>
+#include <debug/safe_sequence.h>
+#include <debug/safe_iterator.h>
+
+namespace std
+{
+namespace __debug
+{
+ template<typename _Tp, typename _Allocator = std::allocator<_Tp> >
+ class deque
+ : public _GLIBCXX_STD_D::deque<_Tp, _Allocator>,
+ public __gnu_debug::_Safe_sequence<deque<_Tp, _Allocator> >
+ {
+ typedef _GLIBCXX_STD_D::deque<_Tp, _Allocator> _Base;
+ typedef __gnu_debug::_Safe_sequence<deque> _Safe_base;
+
+ public:
+ typedef typename _Base::reference reference;
+ typedef typename _Base::const_reference const_reference;
+
+ typedef __gnu_debug::_Safe_iterator<typename _Base::iterator,deque>
+ iterator;
+ typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator,deque>
+ const_iterator;
+
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::difference_type difference_type;
+
+ typedef _Tp value_type;
+ typedef _Allocator allocator_type;
+ typedef typename _Base::pointer pointer;
+ typedef typename _Base::const_pointer const_pointer;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+
+ // 23.2.1.1 construct/copy/destroy:
+ explicit deque(const _Allocator& __a = _Allocator())
+ : _Base(__a) { }
+
+ explicit deque(size_type __n, const _Tp& __value = _Tp(),
+ const _Allocator& __a = _Allocator())
+ : _Base(__n, __value, __a) { }
+
+ template<class _InputIterator>
+ deque(_InputIterator __first, _InputIterator __last,
+ const _Allocator& __a = _Allocator())
+ : _Base(__gnu_debug::__check_valid_range(__first, __last), __last, __a)
+ { }
+
+ deque(const deque& __x)
+ : _Base(__x), _Safe_base() { }
+
+ deque(const _Base& __x)
+ : _Base(__x), _Safe_base() { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ deque(deque&& __x)
+ : _Base(std::forward<deque>(__x)), _Safe_base()
+ { this->_M_swap(__x); }
+
+ deque(initializer_list<value_type> __l,
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __a), _Safe_base() { }
+#endif
+
+ ~deque() { }
+
+ deque&
+ operator=(const deque& __x)
+ {
+ *static_cast<_Base*>(this) = __x;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ deque&
+ operator=(deque&& __x)
+ {
+ // NB: DR 675.
+ clear();
+ swap(__x);
+ return *this;
+ }
+
+ deque&
+ operator=(initializer_list<value_type> __l)
+ {
+ *static_cast<_Base*>(this) = __l;
+ this->_M_invalidate_all();
+ return *this;
+ }
+#endif
+
+ template<class _InputIterator>
+ void
+ assign(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::assign(__first, __last);
+ this->_M_invalidate_all();
+ }
+
+ void
+ assign(size_type __n, const _Tp& __t)
+ {
+ _Base::assign(__n, __t);
+ this->_M_invalidate_all();
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ assign(initializer_list<value_type> __l)
+ {
+ _Base::assign(__l);
+ this->_M_invalidate_all();
+ }
+#endif
+
+ using _Base::get_allocator;
+
+ // iterators:
+ iterator
+ begin()
+ { return iterator(_Base::begin(), this); }
+
+ const_iterator
+ begin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ iterator
+ end()
+ { return iterator(_Base::end(), this); }
+
+ const_iterator
+ end() const
+ { return const_iterator(_Base::end(), this); }
+
+ reverse_iterator
+ rbegin()
+ { return reverse_iterator(end()); }
+
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(end()); }
+
+ reverse_iterator
+ rend()
+ { return reverse_iterator(begin()); }
+
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(begin()); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ const_iterator
+ cbegin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ const_iterator
+ cend() const
+ { return const_iterator(_Base::end(), this); }
+
+ const_reverse_iterator
+ crbegin() const
+ { return const_reverse_iterator(end()); }
+
+ const_reverse_iterator
+ crend() const
+ { return const_reverse_iterator(begin()); }
+#endif
+
+ // 23.2.1.2 capacity:
+ using _Base::size;
+ using _Base::max_size;
+
+ void
+ resize(size_type __sz, _Tp __c = _Tp())
+ {
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ typedef __gnu_debug::_After_nth_from<_Base_const_iterator> _After_nth;
+
+ bool __invalidate_all = __sz > this->size();
+ if (__sz < this->size())
+ this->_M_invalidate_if(_After_nth(__sz, _M_base().begin()));
+
+ _Base::resize(__sz, __c);
+
+ if (__invalidate_all)
+ this->_M_invalidate_all();
+ }
+
+ using _Base::empty;
+
+ // element access:
+ reference
+ operator[](size_type __n)
+ {
+ __glibcxx_check_subscript(__n);
+ return _M_base()[__n];
+ }
+
+ const_reference
+ operator[](size_type __n) const
+ {
+ __glibcxx_check_subscript(__n);
+ return _M_base()[__n];
+ }
+
+ using _Base::at;
+
+ reference
+ front()
+ {
+ __glibcxx_check_nonempty();
+ return _Base::front();
+ }
+
+ const_reference
+ front() const
+ {
+ __glibcxx_check_nonempty();
+ return _Base::front();
+ }
+
+ reference
+ back()
+ {
+ __glibcxx_check_nonempty();
+ return _Base::back();
+ }
+
+ const_reference
+ back() const
+ {
+ __glibcxx_check_nonempty();
+ return _Base::back();
+ }
+
+ // 23.2.1.3 modifiers:
+ void
+ push_front(const _Tp& __x)
+ {
+ _Base::push_front(__x);
+ this->_M_invalidate_all();
+ }
+
+ void
+ push_back(const _Tp& __x)
+ {
+ _Base::push_back(__x);
+ this->_M_invalidate_all();
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ push_front(_Tp&& __x)
+ { emplace_front(std::move(__x)); }
+
+ void
+ push_back(_Tp&& __x)
+ { emplace_back(std::move(__x)); }
+
+ template<typename... _Args>
+ void
+ emplace_front(_Args&&... __args)
+ {
+ _Base::emplace_front(std::forward<_Args>(__args)...);
+ this->_M_invalidate_all();
+ }
+
+ template<typename... _Args>
+ void
+ emplace_back(_Args&&... __args)
+ {
+ _Base::emplace_back(std::forward<_Args>(__args)...);
+ this->_M_invalidate_all();
+ }
+
+ template<typename... _Args>
+ iterator
+ emplace(iterator __position, _Args&&... __args)
+ {
+ __glibcxx_check_insert(__position);
+ typename _Base::iterator __res = _Base::emplace(__position.base(),
+ std::forward<_Args>(__args)...);
+ this->_M_invalidate_all();
+ return iterator(__res, this);
+ }
+#endif
+
+ iterator
+ insert(iterator __position, const _Tp& __x)
+ {
+ __glibcxx_check_insert(__position);
+ typename _Base::iterator __res = _Base::insert(__position.base(), __x);
+ this->_M_invalidate_all();
+ return iterator(__res, this);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ iterator
+ insert(iterator __position, _Tp&& __x)
+ { return emplace(__position, std::move(__x)); }
+
+ void
+ insert(iterator __p, initializer_list<value_type> __l)
+ {
+ _Base::insert(__p, __l);
+ this->_M_invalidate_all();
+ }
+#endif
+
+ void
+ insert(iterator __position, size_type __n, const _Tp& __x)
+ {
+ __glibcxx_check_insert(__position);
+ _Base::insert(__position.base(), __n, __x);
+ this->_M_invalidate_all();
+ }
+
+ template<class _InputIterator>
+ void
+ insert(iterator __position,
+ _InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_insert_range(__position, __first, __last);
+ _Base::insert(__position.base(), __first, __last);
+ this->_M_invalidate_all();
+ }
+
+ void
+ pop_front()
+ {
+ __glibcxx_check_nonempty();
+ iterator __victim = begin();
+ __victim._M_invalidate();
+ _Base::pop_front();
+ }
+
+ void
+ pop_back()
+ {
+ __glibcxx_check_nonempty();
+ iterator __victim = end();
+ --__victim;
+ __victim._M_invalidate();
+ _Base::pop_back();
+ }
+
+ iterator
+ erase(iterator __position)
+ {
+ __glibcxx_check_erase(__position);
+ if (__position == begin() || __position == end()-1)
+ {
+ __position._M_invalidate();
+ return iterator(_Base::erase(__position.base()), this);
+ }
+ else
+ {
+ typename _Base::iterator __res = _Base::erase(__position.base());
+ this->_M_invalidate_all();
+ return iterator(__res, this);
+ }
+ }
+
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 151. can't currently clear() empty container
+ __glibcxx_check_erase_range(__first, __last);
+ if (__first == begin() || __last == end())
+ {
+ this->_M_detach_singular();
+ for (iterator __position = __first; __position != __last; )
+ {
+ iterator __victim = __position++;
+ __victim._M_invalidate();
+ }
+ __try
+ {
+ return iterator(_Base::erase(__first.base(), __last.base()),
+ this);
+ }
+ __catch(...)
+ {
+ this->_M_revalidate_singular();
+ __throw_exception_again;
+ }
+ }
+ else
+ {
+ typename _Base::iterator __res = _Base::erase(__first.base(),
+ __last.base());
+ this->_M_invalidate_all();
+ return iterator(__res, this);
+ }
+ }
+
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(deque&& __x)
+#else
+ swap(deque& __x)
+#endif
+ {
+ _Base::swap(__x);
+ this->_M_swap(__x);
+ }
+
+ void
+ clear()
+ {
+ _Base::clear();
+ this->_M_invalidate_all();
+ }
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+ };
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator==(const deque<_Tp, _Alloc>& __lhs,
+ const deque<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() == __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator!=(const deque<_Tp, _Alloc>& __lhs,
+ const deque<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() != __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<(const deque<_Tp, _Alloc>& __lhs,
+ const deque<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() < __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<=(const deque<_Tp, _Alloc>& __lhs,
+ const deque<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() <= __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>=(const deque<_Tp, _Alloc>& __lhs,
+ const deque<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() >= __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>(const deque<_Tp, _Alloc>& __lhs,
+ const deque<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() > __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(deque<_Tp, _Alloc>& __lhs, deque<_Tp, _Alloc>& __rhs)
+ { __lhs.swap(__rhs); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(deque<_Tp, _Alloc>&& __lhs, deque<_Tp, _Alloc>& __rhs)
+ { __lhs.swap(__rhs); }
+
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(deque<_Tp, _Alloc>& __lhs, deque<_Tp, _Alloc>&& __rhs)
+ { __lhs.swap(__rhs); }
+#endif
+
+} // namespace __debug
+} // namespace std
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/debug/formatter.h b/i686-linux/include/c++/4.4.3/debug/formatter.h
new file mode 100644
index 0000000..0538edb
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/debug/formatter.h
@@ -0,0 +1,392 @@
+// Debug-mode error formatting implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/formatter.h
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_FORMATTER_H
+#define _GLIBCXX_DEBUG_FORMATTER_H 1
+
+#include <typeinfo>
+#include <debug/debug.h>
+
+namespace __gnu_debug
+{
+ using std::type_info;
+
+ /** Determine if the two types are the same. */
+ template<typename _Type1, typename _Type2>
+ struct __is_same
+ {
+ static const bool value = false;
+ };
+
+ template<typename _Type>
+ struct __is_same<_Type, _Type>
+ {
+ static const bool value = true;
+ };
+
+ template<bool> struct __truth { };
+
+ class _Safe_sequence_base;
+
+ template<typename _Iterator, typename _Sequence>
+ class _Safe_iterator;
+
+ template<typename _Sequence>
+ class _Safe_sequence;
+
+ enum _Debug_msg_id
+ {
+ // General checks
+ __msg_valid_range,
+ __msg_insert_singular,
+ __msg_insert_different,
+ __msg_erase_bad,
+ __msg_erase_different,
+ __msg_subscript_oob,
+ __msg_empty,
+ __msg_unpartitioned,
+ __msg_unpartitioned_pred,
+ __msg_unsorted,
+ __msg_unsorted_pred,
+ __msg_not_heap,
+ __msg_not_heap_pred,
+ // std::bitset checks
+ __msg_bad_bitset_write,
+ __msg_bad_bitset_read,
+ __msg_bad_bitset_flip,
+ // std::list checks
+ __msg_self_splice,
+ __msg_splice_alloc,
+ __msg_splice_bad,
+ __msg_splice_other,
+ __msg_splice_overlap,
+ // iterator checks
+ __msg_init_singular,
+ __msg_init_copy_singular,
+ __msg_init_const_singular,
+ __msg_copy_singular,
+ __msg_bad_deref,
+ __msg_bad_inc,
+ __msg_bad_dec,
+ __msg_iter_subscript_oob,
+ __msg_advance_oob,
+ __msg_retreat_oob,
+ __msg_iter_compare_bad,
+ __msg_compare_different,
+ __msg_iter_order_bad,
+ __msg_order_different,
+ __msg_distance_bad,
+ __msg_distance_different,
+ // istream_iterator
+ __msg_deref_istream,
+ __msg_inc_istream,
+ // ostream_iterator
+ __msg_output_ostream,
+ // istreambuf_iterator
+ __msg_deref_istreambuf,
+ __msg_inc_istreambuf
+ };
+
+ class _Error_formatter
+ {
+ /// Whether an iterator is constant, mutable, or unknown
+ enum _Constness
+ {
+ __unknown_constness,
+ __const_iterator,
+ __mutable_iterator,
+ __last_constness
+ };
+
+ // The state of the iterator (fine-grained), if we know it.
+ enum _Iterator_state
+ {
+ __unknown_state,
+ __singular, // singular, may still be attached to a sequence
+ __begin, // dereferenceable, and at the beginning
+ __middle, // dereferenceable, not at the beginning
+ __end, // past-the-end, may be at beginning if sequence empty
+ __last_state
+ };
+
+ // Tags denoting the type of parameter for construction
+ struct _Is_iterator { };
+ struct _Is_sequence { };
+
+ // A parameter that may be referenced by an error message
+ struct _Parameter
+ {
+ enum
+ {
+ __unused_param,
+ __iterator,
+ __sequence,
+ __integer,
+ __string
+ } _M_kind;
+
+ union
+ {
+ // When _M_kind == __iterator
+ struct
+ {
+ const char* _M_name;
+ const void* _M_address;
+ const type_info* _M_type;
+ _Constness _M_constness;
+ _Iterator_state _M_state;
+ const void* _M_sequence;
+ const type_info* _M_seq_type;
+ } _M_iterator;
+
+ // When _M_kind == __sequence
+ struct
+ {
+ const char* _M_name;
+ const void* _M_address;
+ const type_info* _M_type;
+ } _M_sequence;
+
+ // When _M_kind == __integer
+ struct
+ {
+ const char* _M_name;
+ long _M_value;
+ } _M_integer;
+
+ // When _M_kind == __string
+ struct
+ {
+ const char* _M_name;
+ const char* _M_value;
+ } _M_string;
+ } _M_variant;
+
+ _Parameter() : _M_kind(__unused_param), _M_variant() { }
+
+ _Parameter(long __value, const char* __name)
+ : _M_kind(__integer), _M_variant()
+ {
+ _M_variant._M_integer._M_name = __name;
+ _M_variant._M_integer._M_value = __value;
+ }
+
+ _Parameter(const char* __value, const char* __name)
+ : _M_kind(__string), _M_variant()
+ {
+ _M_variant._M_string._M_name = __name;
+ _M_variant._M_string._M_value = __value;
+ }
+
+ template<typename _Iterator, typename _Sequence>
+ _Parameter(const _Safe_iterator<_Iterator, _Sequence>& __it,
+ const char* __name, _Is_iterator)
+ : _M_kind(__iterator), _M_variant()
+ {
+ _M_variant._M_iterator._M_name = __name;
+ _M_variant._M_iterator._M_address = &__it;
+ _M_variant._M_iterator._M_type = &typeid(__it);
+ _M_variant._M_iterator._M_constness =
+ __is_same<_Safe_iterator<_Iterator, _Sequence>,
+ typename _Sequence::iterator>::
+ value? __mutable_iterator : __const_iterator;
+ _M_variant._M_iterator._M_sequence = __it._M_get_sequence();
+ _M_variant._M_iterator._M_seq_type = &typeid(_Sequence);
+
+ if (__it._M_singular())
+ _M_variant._M_iterator._M_state = __singular;
+ else
+ {
+ bool __is_begin = __it._M_is_begin();
+ bool __is_end = __it._M_is_end();
+ if (__is_end)
+ _M_variant._M_iterator._M_state = __end;
+ else if (__is_begin)
+ _M_variant._M_iterator._M_state = __begin;
+ else
+ _M_variant._M_iterator._M_state = __middle;
+ }
+ }
+
+ template<typename _Type>
+ _Parameter(const _Type*& __it, const char* __name, _Is_iterator)
+ : _M_kind(__iterator), _M_variant()
+ {
+ _M_variant._M_iterator._M_name = __name;
+ _M_variant._M_iterator._M_address = &__it;
+ _M_variant._M_iterator._M_type = &typeid(__it);
+ _M_variant._M_iterator._M_constness = __mutable_iterator;
+ _M_variant._M_iterator._M_state = __it? __unknown_state : __singular;
+ _M_variant._M_iterator._M_sequence = 0;
+ _M_variant._M_iterator._M_seq_type = 0;
+ }
+
+ template<typename _Type>
+ _Parameter(_Type*& __it, const char* __name, _Is_iterator)
+ : _M_kind(__iterator), _M_variant()
+ {
+ _M_variant._M_iterator._M_name = __name;
+ _M_variant._M_iterator._M_address = &__it;
+ _M_variant._M_iterator._M_type = &typeid(__it);
+ _M_variant._M_iterator._M_constness = __const_iterator;
+ _M_variant._M_iterator._M_state = __it? __unknown_state : __singular;
+ _M_variant._M_iterator._M_sequence = 0;
+ _M_variant._M_iterator._M_seq_type = 0;
+ }
+
+ template<typename _Iterator>
+ _Parameter(const _Iterator& __it, const char* __name, _Is_iterator)
+ : _M_kind(__iterator), _M_variant()
+ {
+ _M_variant._M_iterator._M_name = __name;
+ _M_variant._M_iterator._M_address = &__it;
+ _M_variant._M_iterator._M_type = &typeid(__it);
+ _M_variant._M_iterator._M_constness = __unknown_constness;
+ _M_variant._M_iterator._M_state =
+ __gnu_debug::__check_singular(__it)? __singular : __unknown_state;
+ _M_variant._M_iterator._M_sequence = 0;
+ _M_variant._M_iterator._M_seq_type = 0;
+ }
+
+ template<typename _Sequence>
+ _Parameter(const _Safe_sequence<_Sequence>& __seq,
+ const char* __name, _Is_sequence)
+ : _M_kind(__sequence), _M_variant()
+ {
+ _M_variant._M_sequence._M_name = __name;
+ _M_variant._M_sequence._M_address =
+ static_cast<const _Sequence*>(&__seq);
+ _M_variant._M_sequence._M_type = &typeid(_Sequence);
+ }
+
+ template<typename _Sequence>
+ _Parameter(const _Sequence& __seq, const char* __name, _Is_sequence)
+ : _M_kind(__sequence), _M_variant()
+ {
+ _M_variant._M_sequence._M_name = __name;
+ _M_variant._M_sequence._M_address = &__seq;
+ _M_variant._M_sequence._M_type = &typeid(_Sequence);
+ }
+
+ void
+ _M_print_field(const _Error_formatter* __formatter,
+ const char* __name) const;
+
+ void
+ _M_print_description(const _Error_formatter* __formatter) const;
+ };
+
+ friend struct _Parameter;
+
+ public:
+ template<typename _Iterator>
+ const _Error_formatter&
+ _M_iterator(const _Iterator& __it, const char* __name = 0) const
+ {
+ if (_M_num_parameters < size_t(__max_parameters))
+ _M_parameters[_M_num_parameters++] = _Parameter(__it, __name,
+ _Is_iterator());
+ return *this;
+ }
+
+ const _Error_formatter&
+ _M_integer(long __value, const char* __name = 0) const
+ {
+ if (_M_num_parameters < size_t(__max_parameters))
+ _M_parameters[_M_num_parameters++] = _Parameter(__value, __name);
+ return *this;
+ }
+
+ const _Error_formatter&
+ _M_string(const char* __value, const char* __name = 0) const
+ {
+ if (_M_num_parameters < size_t(__max_parameters))
+ _M_parameters[_M_num_parameters++] = _Parameter(__value, __name);
+ return *this;
+ }
+
+ template<typename _Sequence>
+ const _Error_formatter&
+ _M_sequence(const _Sequence& __seq, const char* __name = 0) const
+ {
+ if (_M_num_parameters < size_t(__max_parameters))
+ _M_parameters[_M_num_parameters++] = _Parameter(__seq, __name,
+ _Is_sequence());
+ return *this;
+ }
+
+ const _Error_formatter&
+ _M_message(const char* __text) const
+ { _M_text = __text; return *this; }
+
+ const _Error_formatter&
+ _M_message(_Debug_msg_id __id) const;
+
+ void
+ _M_error() const;
+
+ private:
+ _Error_formatter(const char* __file, size_t __line)
+ : _M_file(__file), _M_line(__line), _M_num_parameters(0), _M_text(0),
+ _M_max_length(78), _M_column(1), _M_first_line(true), _M_wordwrap(false)
+ { _M_get_max_length(); }
+
+ template<typename _Tp>
+ void
+ _M_format_word(char*, int, const char*, _Tp) const;
+
+ void
+ _M_print_word(const char* __word) const;
+
+ void
+ _M_print_string(const char* __string) const;
+
+ void
+ _M_get_max_length() const;
+
+ enum { __max_parameters = 9 };
+
+ const char* _M_file;
+ size_t _M_line;
+ mutable _Parameter _M_parameters[__max_parameters];
+ mutable size_t _M_num_parameters;
+ mutable const char* _M_text;
+ mutable size_t _M_max_length;
+ enum { _M_indent = 4 } ;
+ mutable size_t _M_column;
+ mutable bool _M_first_line;
+ mutable bool _M_wordwrap;
+
+ public:
+ static _Error_formatter
+ _M_at(const char* __file, size_t __line)
+ { return _Error_formatter(__file, __line); }
+ };
+} // namespace __gnu_debug
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/debug/functions.h b/i686-linux/include/c++/4.4.3/debug/functions.h
new file mode 100644
index 0000000..a4b1d78
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/debug/functions.h
@@ -0,0 +1,383 @@
+// Debugging support implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/functions.h
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_FUNCTIONS_H
+#define _GLIBCXX_DEBUG_FUNCTIONS_H 1
+
+#include <bits/c++config.h>
+#include <cstddef> // for ptrdiff_t
+#include <bits/stl_iterator_base_types.h> // for iterator_traits, categories
+#include <bits/cpp_type_traits.h> // for __is_integer
+
+namespace __gnu_debug
+{
+ template<typename _Iterator, typename _Sequence>
+ class _Safe_iterator;
+
+ // An arbitrary iterator pointer is not singular.
+ inline bool
+ __check_singular_aux(const void*) { return false; }
+
+ // We may have an iterator that derives from _Safe_iterator_base but isn't
+ // a _Safe_iterator.
+ template<typename _Iterator>
+ inline bool
+ __check_singular(_Iterator& __x)
+ { return __check_singular_aux(&__x); }
+
+ /** Non-NULL pointers are nonsingular. */
+ template<typename _Tp>
+ inline bool
+ __check_singular(const _Tp* __ptr)
+ { return __ptr == 0; }
+
+ /** Safe iterators know if they are singular. */
+ template<typename _Iterator, typename _Sequence>
+ inline bool
+ __check_singular(const _Safe_iterator<_Iterator, _Sequence>& __x)
+ { return __x._M_singular(); }
+
+ /** Assume that some arbitrary iterator is dereferenceable, because we
+ can't prove that it isn't. */
+ template<typename _Iterator>
+ inline bool
+ __check_dereferenceable(_Iterator&)
+ { return true; }
+
+ /** Non-NULL pointers are dereferenceable. */
+ template<typename _Tp>
+ inline bool
+ __check_dereferenceable(const _Tp* __ptr)
+ { return __ptr; }
+
+ /** Safe iterators know if they are singular. */
+ template<typename _Iterator, typename _Sequence>
+ inline bool
+ __check_dereferenceable(const _Safe_iterator<_Iterator, _Sequence>& __x)
+ { return __x._M_dereferenceable(); }
+
+ /** If the distance between two random access iterators is
+ * nonnegative, assume the range is valid.
+ */
+ template<typename _RandomAccessIterator>
+ inline bool
+ __valid_range_aux2(const _RandomAccessIterator& __first,
+ const _RandomAccessIterator& __last,
+ std::random_access_iterator_tag)
+ { return __last - __first >= 0; }
+
+ /** Can't test for a valid range with input iterators, because
+ * iteration may be destructive. So we just assume that the range
+ * is valid.
+ */
+ template<typename _InputIterator>
+ inline bool
+ __valid_range_aux2(const _InputIterator&, const _InputIterator&,
+ std::input_iterator_tag)
+ { return true; }
+
+ /** We say that integral types for a valid range, and defer to other
+ * routines to realize what to do with integral types instead of
+ * iterators.
+ */
+ template<typename _Integral>
+ inline bool
+ __valid_range_aux(const _Integral&, const _Integral&, std::__true_type)
+ { return true; }
+
+ /** We have iterators, so figure out what kind of iterators that are
+ * to see if we can check the range ahead of time.
+ */
+ template<typename _InputIterator>
+ inline bool
+ __valid_range_aux(const _InputIterator& __first,
+ const _InputIterator& __last, std::__false_type)
+ {
+ typedef typename std::iterator_traits<_InputIterator>::iterator_category
+ _Category;
+ return __valid_range_aux2(__first, __last, _Category());
+ }
+
+ /** Don't know what these iterators are, or if they are even
+ * iterators (we may get an integral type for InputIterator), so
+ * see if they are integral and pass them on to the next phase
+ * otherwise.
+ */
+ template<typename _InputIterator>
+ inline bool
+ __valid_range(const _InputIterator& __first, const _InputIterator& __last)
+ {
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ return __valid_range_aux(__first, __last, _Integral());
+ }
+
+ /** Safe iterators know how to check if they form a valid range. */
+ template<typename _Iterator, typename _Sequence>
+ inline bool
+ __valid_range(const _Safe_iterator<_Iterator, _Sequence>& __first,
+ const _Safe_iterator<_Iterator, _Sequence>& __last)
+ { return __first._M_valid_range(__last); }
+
+ /* Checks that [first, last) is a valid range, and then returns
+ * __first. This routine is useful when we can't use a separate
+ * assertion statement because, e.g., we are in a constructor.
+ */
+ template<typename _InputIterator>
+ inline _InputIterator
+ __check_valid_range(const _InputIterator& __first,
+ const _InputIterator& __last
+ __attribute__((__unused__)))
+ {
+ _GLIBCXX_DEBUG_ASSERT(__valid_range(__first, __last));
+ return __first;
+ }
+
+ /** Checks that __s is non-NULL or __n == 0, and then returns __s. */
+ template<typename _CharT, typename _Integer>
+ inline const _CharT*
+ __check_string(const _CharT* __s,
+ const _Integer& __n __attribute__((__unused__)))
+ {
+#ifdef _GLIBCXX_DEBUG_PEDANTIC
+ _GLIBCXX_DEBUG_ASSERT(__s != 0 || __n == 0);
+#endif
+ return __s;
+ }
+
+ /** Checks that __s is non-NULL and then returns __s. */
+ template<typename _CharT>
+ inline const _CharT*
+ __check_string(const _CharT* __s)
+ {
+#ifdef _GLIBCXX_DEBUG_PEDANTIC
+ _GLIBCXX_DEBUG_ASSERT(__s != 0);
+#endif
+ return __s;
+ }
+
+ // Can't check if an input iterator sequence is sorted, because we
+ // can't step through the sequence.
+ template<typename _InputIterator>
+ inline bool
+ __check_sorted_aux(const _InputIterator&, const _InputIterator&,
+ std::input_iterator_tag)
+ { return true; }
+
+ // Can verify if a forward iterator sequence is in fact sorted using
+ // std::__is_sorted
+ template<typename _ForwardIterator>
+ inline bool
+ __check_sorted_aux(_ForwardIterator __first, _ForwardIterator __last,
+ std::forward_iterator_tag)
+ {
+ if (__first == __last)
+ return true;
+
+ _ForwardIterator __next = __first;
+ for (++__next; __next != __last; __first = __next, ++__next)
+ if (*__next < *__first)
+ return false;
+
+ return true;
+ }
+
+ // Can't check if an input iterator sequence is sorted, because we can't step
+ // through the sequence.
+ template<typename _InputIterator, typename _Predicate>
+ inline bool
+ __check_sorted_aux(const _InputIterator&, const _InputIterator&,
+ _Predicate, std::input_iterator_tag)
+ { return true; }
+
+ // Can verify if a forward iterator sequence is in fact sorted using
+ // std::__is_sorted
+ template<typename _ForwardIterator, typename _Predicate>
+ inline bool
+ __check_sorted_aux(_ForwardIterator __first, _ForwardIterator __last,
+ _Predicate __pred, std::forward_iterator_tag)
+ {
+ if (__first == __last)
+ return true;
+
+ _ForwardIterator __next = __first;
+ for (++__next; __next != __last; __first = __next, ++__next)
+ if (__pred(*__next, *__first))
+ return false;
+
+ return true;
+ }
+
+ // Determine if a sequence is sorted.
+ template<typename _InputIterator>
+ inline bool
+ __check_sorted(const _InputIterator& __first, const _InputIterator& __last)
+ {
+ typedef typename std::iterator_traits<_InputIterator>::iterator_category
+ _Category;
+
+ // Verify that the < operator for elements in the sequence is a
+ // StrictWeakOrdering by checking that it is irreflexive.
+ _GLIBCXX_DEBUG_ASSERT(__first == __last || !(*__first < *__first));
+
+ return __check_sorted_aux(__first, __last, _Category());
+ }
+
+ template<typename _InputIterator, typename _Predicate>
+ inline bool
+ __check_sorted(const _InputIterator& __first, const _InputIterator& __last,
+ _Predicate __pred)
+ {
+ typedef typename std::iterator_traits<_InputIterator>::iterator_category
+ _Category;
+
+ // Verify that the predicate is StrictWeakOrdering by checking that it
+ // is irreflexive.
+ _GLIBCXX_DEBUG_ASSERT(__first == __last || !__pred(*__first, *__first));
+
+ return __check_sorted_aux(__first, __last, __pred, _Category());
+ }
+
+ template<typename _InputIterator>
+ inline bool
+ __check_sorted_set_aux(const _InputIterator& __first,
+ const _InputIterator& __last,
+ std::__true_type)
+ { return __check_sorted(__first, __last); }
+
+ template<typename _InputIterator>
+ inline bool
+ __check_sorted_set_aux(const _InputIterator&,
+ const _InputIterator&,
+ std::__false_type)
+ { return true; }
+
+ template<typename _InputIterator, typename _Predicate>
+ inline bool
+ __check_sorted_set_aux(const _InputIterator& __first,
+ const _InputIterator& __last,
+ _Predicate __pred, std::__true_type)
+ { return __check_sorted(__first, __last, __pred); }
+
+ template<typename _InputIterator, typename _Predicate>
+ inline bool
+ __check_sorted_set_aux(const _InputIterator&,
+ const _InputIterator&, _Predicate,
+ std::__false_type)
+ { return true; }
+
+ // ... special variant used in std::merge, std::includes, std::set_*.
+ template<typename _InputIterator1, typename _InputIterator2>
+ inline bool
+ __check_sorted_set(const _InputIterator1& __first,
+ const _InputIterator1& __last,
+ const _InputIterator2&)
+ {
+ typedef typename std::iterator_traits<_InputIterator1>::value_type
+ _ValueType1;
+ typedef typename std::iterator_traits<_InputIterator2>::value_type
+ _ValueType2;
+
+ typedef typename std::__are_same<_ValueType1, _ValueType2>::__type
+ _SameType;
+ return __check_sorted_set_aux(__first, __last, _SameType());
+ }
+
+ template<typename _InputIterator1, typename _InputIterator2,
+ typename _Predicate>
+ inline bool
+ __check_sorted_set(const _InputIterator1& __first,
+ const _InputIterator1& __last,
+ const _InputIterator2&, _Predicate __pred)
+ {
+ typedef typename std::iterator_traits<_InputIterator1>::value_type
+ _ValueType1;
+ typedef typename std::iterator_traits<_InputIterator2>::value_type
+ _ValueType2;
+
+ typedef typename std::__are_same<_ValueType1, _ValueType2>::__type
+ _SameType;
+ return __check_sorted_set_aux(__first, __last, __pred, _SameType());
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 270. Binary search requirements overly strict
+ // Determine if a sequence is partitioned w.r.t. this element.
+ template<typename _ForwardIterator, typename _Tp>
+ inline bool
+ __check_partitioned_lower(_ForwardIterator __first,
+ _ForwardIterator __last, const _Tp& __value)
+ {
+ while (__first != __last && *__first < __value)
+ ++__first;
+ while (__first != __last && !(*__first < __value))
+ ++__first;
+ return __first == __last;
+ }
+
+ template<typename _ForwardIterator, typename _Tp>
+ inline bool
+ __check_partitioned_upper(_ForwardIterator __first,
+ _ForwardIterator __last, const _Tp& __value)
+ {
+ while (__first != __last && !(__value < *__first))
+ ++__first;
+ while (__first != __last && __value < *__first)
+ ++__first;
+ return __first == __last;
+ }
+
+ // Determine if a sequence is partitioned w.r.t. this element.
+ template<typename _ForwardIterator, typename _Tp, typename _Pred>
+ inline bool
+ __check_partitioned_lower(_ForwardIterator __first,
+ _ForwardIterator __last, const _Tp& __value,
+ _Pred __pred)
+ {
+ while (__first != __last && bool(__pred(*__first, __value)))
+ ++__first;
+ while (__first != __last && !bool(__pred(*__first, __value)))
+ ++__first;
+ return __first == __last;
+ }
+
+ template<typename _ForwardIterator, typename _Tp, typename _Pred>
+ inline bool
+ __check_partitioned_upper(_ForwardIterator __first,
+ _ForwardIterator __last, const _Tp& __value,
+ _Pred __pred)
+ {
+ while (__first != __last && !bool(__pred(__value, *__first)))
+ ++__first;
+ while (__first != __last && bool(__pred(__value, *__first)))
+ ++__first;
+ return __first == __last;
+ }
+} // namespace __gnu_debug
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/debug/list b/i686-linux/include/c++/4.4.3/debug/list
new file mode 100644
index 0000000..39f763a
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/debug/list
@@ -0,0 +1,653 @@
+// Debugging list implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/list
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_LIST
+#define _GLIBCXX_DEBUG_LIST 1
+
+#include <list>
+#include <bits/stl_algo.h>
+#include <debug/safe_sequence.h>
+#include <debug/safe_iterator.h>
+
+namespace std
+{
+namespace __debug
+{
+ template<typename _Tp, typename _Allocator = std::allocator<_Tp> >
+ class list
+ : public _GLIBCXX_STD_D::list<_Tp, _Allocator>,
+ public __gnu_debug::_Safe_sequence<list<_Tp, _Allocator> >
+ {
+ typedef _GLIBCXX_STD_D::list<_Tp, _Allocator> _Base;
+ typedef __gnu_debug::_Safe_sequence<list> _Safe_base;
+
+ public:
+ typedef typename _Base::reference reference;
+ typedef typename _Base::const_reference const_reference;
+
+ typedef __gnu_debug::_Safe_iterator<typename _Base::iterator, list>
+ iterator;
+ typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator, list>
+ const_iterator;
+
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::difference_type difference_type;
+
+ typedef _Tp value_type;
+ typedef _Allocator allocator_type;
+ typedef typename _Base::pointer pointer;
+ typedef typename _Base::const_pointer const_pointer;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+
+ // 23.2.2.1 construct/copy/destroy:
+ explicit list(const _Allocator& __a = _Allocator())
+ : _Base(__a) { }
+
+ explicit list(size_type __n, const _Tp& __value = _Tp(),
+ const _Allocator& __a = _Allocator())
+ : _Base(__n, __value, __a) { }
+
+ template<class _InputIterator>
+ list(_InputIterator __first, _InputIterator __last,
+ const _Allocator& __a = _Allocator())
+ : _Base(__gnu_debug::__check_valid_range(__first, __last), __last, __a)
+ { }
+
+
+ list(const list& __x)
+ : _Base(__x), _Safe_base() { }
+
+ list(const _Base& __x)
+ : _Base(__x), _Safe_base() { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ list(list&& __x)
+ : _Base(std::forward<list>(__x)), _Safe_base()
+ { this->_M_swap(__x); }
+
+ list(initializer_list<value_type> __l,
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __a), _Safe_base() { }
+#endif
+
+ ~list() { }
+
+ list&
+ operator=(const list& __x)
+ {
+ static_cast<_Base&>(*this) = __x;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ list&
+ operator=(list&& __x)
+ {
+ // NB: DR 675.
+ clear();
+ swap(__x);
+ return *this;
+ }
+
+ list&
+ operator=(initializer_list<value_type> __l)
+ {
+ static_cast<_Base&>(*this) = __l;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ void
+ assign(initializer_list<value_type> __l)
+ {
+ _Base::assign(__l);
+ this->_M_invalidate_all();
+ }
+#endif
+
+ template<class _InputIterator>
+ void
+ assign(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::assign(__first, __last);
+ this->_M_invalidate_all();
+ }
+
+ void
+ assign(size_type __n, const _Tp& __t)
+ {
+ _Base::assign(__n, __t);
+ this->_M_invalidate_all();
+ }
+
+ using _Base::get_allocator;
+
+ // iterators:
+ iterator
+ begin()
+ { return iterator(_Base::begin(), this); }
+
+ const_iterator
+ begin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ iterator
+ end()
+ { return iterator(_Base::end(), this); }
+
+ const_iterator
+ end() const
+ { return const_iterator(_Base::end(), this); }
+
+ reverse_iterator
+ rbegin()
+ { return reverse_iterator(end()); }
+
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(end()); }
+
+ reverse_iterator
+ rend()
+ { return reverse_iterator(begin()); }
+
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(begin()); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ const_iterator
+ cbegin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ const_iterator
+ cend() const
+ { return const_iterator(_Base::end(), this); }
+
+ const_reverse_iterator
+ crbegin() const
+ { return const_reverse_iterator(end()); }
+
+ const_reverse_iterator
+ crend() const
+ { return const_reverse_iterator(begin()); }
+#endif
+
+ // 23.2.2.2 capacity:
+ using _Base::empty;
+ using _Base::size;
+ using _Base::max_size;
+
+ void
+ resize(size_type __sz, _Tp __c = _Tp())
+ {
+ this->_M_detach_singular();
+
+ // if __sz < size(), invalidate all iterators in [begin+__sz, end())
+ iterator __victim = begin();
+ iterator __end = end();
+ for (size_type __i = __sz; __victim != __end && __i > 0; --__i)
+ ++__victim;
+
+ while (__victim != __end)
+ {
+ iterator __real_victim = __victim++;
+ __real_victim._M_invalidate();
+ }
+
+ __try
+ {
+ _Base::resize(__sz, __c);
+ }
+ __catch(...)
+ {
+ this->_M_revalidate_singular();
+ __throw_exception_again;
+ }
+ }
+
+ // element access:
+ reference
+ front()
+ {
+ __glibcxx_check_nonempty();
+ return _Base::front();
+ }
+
+ const_reference
+ front() const
+ {
+ __glibcxx_check_nonempty();
+ return _Base::front();
+ }
+
+ reference
+ back()
+ {
+ __glibcxx_check_nonempty();
+ return _Base::back();
+ }
+
+ const_reference
+ back() const
+ {
+ __glibcxx_check_nonempty();
+ return _Base::back();
+ }
+
+ // 23.2.2.3 modifiers:
+ using _Base::push_front;
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ using _Base::emplace_front;
+#endif
+
+ void
+ pop_front()
+ {
+ __glibcxx_check_nonempty();
+ iterator __victim = begin();
+ __victim._M_invalidate();
+ _Base::pop_front();
+ }
+
+ using _Base::push_back;
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ using _Base::emplace_back;
+#endif
+
+ void
+ pop_back()
+ {
+ __glibcxx_check_nonempty();
+ iterator __victim = end();
+ --__victim;
+ __victim._M_invalidate();
+ _Base::pop_back();
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename... _Args>
+ iterator
+ emplace(iterator __position, _Args&&... __args)
+ {
+ __glibcxx_check_insert(__position);
+ return iterator(_Base::emplace(__position.base(),
+ std::forward<_Args>(__args)...), this);
+ }
+#endif
+
+ iterator
+ insert(iterator __position, const _Tp& __x)
+ {
+ __glibcxx_check_insert(__position);
+ return iterator(_Base::insert(__position.base(), __x), this);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ iterator
+ insert(iterator __position, _Tp&& __x)
+ { return emplace(__position, std::move(__x)); }
+
+ void
+ insert(iterator __p, initializer_list<value_type> __l)
+ {
+ __glibcxx_check_insert(__p);
+ _Base::insert(__p, __l);
+ }
+#endif
+
+ void
+ insert(iterator __position, size_type __n, const _Tp& __x)
+ {
+ __glibcxx_check_insert(__position);
+ _Base::insert(__position.base(), __n, __x);
+ }
+
+ template<class _InputIterator>
+ void
+ insert(iterator __position, _InputIterator __first,
+ _InputIterator __last)
+ {
+ __glibcxx_check_insert_range(__position, __first, __last);
+ _Base::insert(__position.base(), __first, __last);
+ }
+
+ iterator
+ erase(iterator __position)
+ {
+ __glibcxx_check_erase(__position);
+ __position._M_invalidate();
+ return iterator(_Base::erase(__position.base()), this);
+ }
+
+ iterator
+ erase(iterator __position, iterator __last)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 151. can't currently clear() empty container
+ __glibcxx_check_erase_range(__position, __last);
+ for (iterator __victim = __position; __victim != __last; )
+ {
+ iterator __old = __victim;
+ ++__victim;
+ __old._M_invalidate();
+ }
+ return iterator(_Base::erase(__position.base(), __last.base()), this);
+ }
+
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(list&& __x)
+#else
+ swap(list& __x)
+#endif
+ {
+ _Base::swap(__x);
+ this->_M_swap(__x);
+ }
+
+ void
+ clear()
+ {
+ _Base::clear();
+ this->_M_invalidate_all();
+ }
+
+ // 23.2.2.4 list operations:
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ splice(iterator __position, list&& __x)
+#else
+ splice(iterator __position, list& __x)
+#endif
+ {
+ _GLIBCXX_DEBUG_VERIFY(&__x != this,
+ _M_message(__gnu_debug::__msg_self_splice)
+ ._M_sequence(*this, "this"));
+ this->splice(__position, _GLIBCXX_MOVE(__x), __x.begin(), __x.end());
+ }
+
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ splice(iterator __position, list&& __x, iterator __i)
+#else
+ splice(iterator __position, list& __x, iterator __i)
+#endif
+ {
+ __glibcxx_check_insert(__position);
+
+ // We used to perform the splice_alloc check: not anymore, redundant
+ // after implementing the relevant bits of N1599.
+
+ _GLIBCXX_DEBUG_VERIFY(__i._M_dereferenceable(),
+ _M_message(__gnu_debug::__msg_splice_bad)
+ ._M_iterator(__i, "__i"));
+ _GLIBCXX_DEBUG_VERIFY(__i._M_attached_to(&__x),
+ _M_message(__gnu_debug::__msg_splice_other)
+ ._M_iterator(__i, "__i")._M_sequence(__x, "__x"));
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 250. splicing invalidates iterators
+ this->_M_transfer_iter(__i);
+ _Base::splice(__position.base(), _GLIBCXX_MOVE(__x._M_base()),
+ __i.base());
+ }
+
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ splice(iterator __position, list&& __x, iterator __first,
+ iterator __last)
+#else
+ splice(iterator __position, list& __x, iterator __first,
+ iterator __last)
+#endif
+ {
+ __glibcxx_check_insert(__position);
+ __glibcxx_check_valid_range(__first, __last);
+ _GLIBCXX_DEBUG_VERIFY(__first._M_attached_to(&__x),
+ _M_message(__gnu_debug::__msg_splice_other)
+ ._M_sequence(__x, "x")
+ ._M_iterator(__first, "first"));
+
+ // We used to perform the splice_alloc check: not anymore, redundant
+ // after implementing the relevant bits of N1599.
+
+ for (iterator __tmp = __first; __tmp != __last; )
+ {
+ _GLIBCXX_DEBUG_VERIFY(&__x != this || __tmp != __position,
+ _M_message(__gnu_debug::__msg_splice_overlap)
+ ._M_iterator(__tmp, "position")
+ ._M_iterator(__first, "first")
+ ._M_iterator(__last, "last"));
+ iterator __victim = __tmp++;
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 250. splicing invalidates iterators
+ this->_M_transfer_iter(__victim);
+ }
+
+ _Base::splice(__position.base(), _GLIBCXX_MOVE(__x._M_base()),
+ __first.base(), __last.base());
+ }
+
+ void
+ remove(const _Tp& __value)
+ {
+ for (iterator __x = begin(); __x.base() != _Base::end(); )
+ {
+ if (*__x == __value)
+ __x = erase(__x);
+ else
+ ++__x;
+ }
+ }
+
+ template<class _Predicate>
+ void
+ remove_if(_Predicate __pred)
+ {
+ for (iterator __x = begin(); __x.base() != _Base::end(); )
+ {
+ if (__pred(*__x))
+ __x = erase(__x);
+ else
+ ++__x;
+ }
+ }
+
+ void
+ unique()
+ {
+ iterator __first = begin();
+ iterator __last = end();
+ if (__first == __last)
+ return;
+ iterator __next = __first;
+ while (++__next != __last)
+ {
+ if (*__first == *__next)
+ erase(__next);
+ else
+ __first = __next;
+ __next = __first;
+ }
+ }
+
+ template<class _BinaryPredicate>
+ void
+ unique(_BinaryPredicate __binary_pred)
+ {
+ iterator __first = begin();
+ iterator __last = end();
+ if (__first == __last)
+ return;
+ iterator __next = __first;
+ while (++__next != __last)
+ {
+ if (__binary_pred(*__first, *__next))
+ erase(__next);
+ else
+ __first = __next;
+ __next = __first;
+ }
+ }
+
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ merge(list&& __x)
+#else
+ merge(list& __x)
+#endif
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 300. list::merge() specification incomplete
+ if (this != &__x)
+ {
+ __glibcxx_check_sorted(_Base::begin(), _Base::end());
+ __glibcxx_check_sorted(__x.begin().base(), __x.end().base());
+ for (iterator __tmp = __x.begin(); __tmp != __x.end();)
+ {
+ iterator __victim = __tmp++;
+ this->_M_transfer_iter(__victim);
+ }
+ _Base::merge(_GLIBCXX_MOVE(__x._M_base()));
+ }
+ }
+
+ template<class _Compare>
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ merge(list&& __x, _Compare __comp)
+#else
+ merge(list& __x, _Compare __comp)
+#endif
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 300. list::merge() specification incomplete
+ if (this != &__x)
+ {
+ __glibcxx_check_sorted_pred(_Base::begin(), _Base::end(),
+ __comp);
+ __glibcxx_check_sorted_pred(__x.begin().base(), __x.end().base(),
+ __comp);
+ for (iterator __tmp = __x.begin(); __tmp != __x.end();)
+ {
+ iterator __victim = __tmp++;
+ this->_M_transfer_iter(__victim);
+ }
+ _Base::merge(_GLIBCXX_MOVE(__x._M_base()), __comp);
+ }
+ }
+
+ void
+ sort() { _Base::sort(); }
+
+ template<typename _StrictWeakOrdering>
+ void
+ sort(_StrictWeakOrdering __pred) { _Base::sort(__pred); }
+
+ using _Base::reverse;
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+
+ private:
+ void
+ _M_invalidate_all()
+ {
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
+ this->_M_invalidate_if(_Not_equal(_M_base().end()));
+ }
+ };
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator==(const list<_Tp, _Alloc>& __lhs,
+ const list<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() == __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator!=(const list<_Tp, _Alloc>& __lhs,
+ const list<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() != __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<(const list<_Tp, _Alloc>& __lhs,
+ const list<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() < __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<=(const list<_Tp, _Alloc>& __lhs,
+ const list<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() <= __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>=(const list<_Tp, _Alloc>& __lhs,
+ const list<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() >= __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>(const list<_Tp, _Alloc>& __lhs,
+ const list<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() > __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(list<_Tp, _Alloc>& __lhs, list<_Tp, _Alloc>& __rhs)
+ { __lhs.swap(__rhs); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(list<_Tp, _Alloc>&& __lhs, list<_Tp, _Alloc>& __rhs)
+ { __lhs.swap(__rhs); }
+
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(list<_Tp, _Alloc>& __lhs, list<_Tp, _Alloc>&& __rhs)
+ { __lhs.swap(__rhs); }
+#endif
+
+} // namespace __debug
+} // namespace std
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/debug/macros.h b/i686-linux/include/c++/4.4.3/debug/macros.h
new file mode 100644
index 0000000..1a8ce69
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/debug/macros.h
@@ -0,0 +1,246 @@
+// Debugging support implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/macros.h
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_MACROS_H
+#define _GLIBCXX_DEBUG_MACROS_H 1
+
+/**
+ * Macros used by the implementation to verify certain
+ * properties. These macros may only be used directly by the debug
+ * wrappers. Note that these are macros (instead of the more obviously
+ * "correct" choice of making them functions) because we need line and
+ * file information at the call site, to minimize the distance between
+ * the user error and where the error is reported.
+ *
+ */
+#define _GLIBCXX_DEBUG_VERIFY(_Condition,_ErrorMessage) \
+ do \
+ { \
+ if (! (_Condition)) \
+ __gnu_debug::_Error_formatter::_M_at(__FILE__, __LINE__) \
+ ._ErrorMessage._M_error(); \
+ } while (false)
+
+// Verify that [_First, _Last) forms a valid iterator range.
+#define __glibcxx_check_valid_range(_First,_Last) \
+_GLIBCXX_DEBUG_VERIFY(__gnu_debug::__valid_range(_First, _Last), \
+ _M_message(__gnu_debug::__msg_valid_range) \
+ ._M_iterator(_First, #_First) \
+ ._M_iterator(_Last, #_Last))
+
+/** Verify that we can insert into *this with the iterator _Position.
+ * Insertion into a container at a specific position requires that
+ * the iterator be nonsingular (i.e., either dereferenceable or
+ * past-the-end) and that it reference the sequence we are inserting
+ * into. Note that this macro is only valid when the container is a
+ * _Safe_sequence and the iterator is a _Safe_iterator.
+*/
+#define __glibcxx_check_insert(_Position) \
+_GLIBCXX_DEBUG_VERIFY(!_Position._M_singular(), \
+ _M_message(__gnu_debug::__msg_insert_singular) \
+ ._M_sequence(*this, "this") \
+ ._M_iterator(_Position, #_Position)); \
+_GLIBCXX_DEBUG_VERIFY(_Position._M_attached_to(this), \
+ _M_message(__gnu_debug::__msg_insert_different) \
+ ._M_sequence(*this, "this") \
+ ._M_iterator(_Position, #_Position))
+
+/** Verify that we can insert the values in the iterator range
+ * [_First, _Last) into *this with the iterator _Position. Insertion
+ * into a container at a specific position requires that the iterator
+ * be nonsingular (i.e., either dereferenceable or past-the-end),
+ * that it reference the sequence we are inserting into, and that the
+ * iterator range [_First, Last) is a valid (possibly empty)
+ * range. Note that this macro is only valid when the container is a
+ * _Safe_sequence and the iterator is a _Safe_iterator.
+ *
+ * @tbd We would like to be able to check for noninterference of
+ * _Position and the range [_First, _Last), but that can't (in
+ * general) be done.
+*/
+#define __glibcxx_check_insert_range(_Position,_First,_Last) \
+__glibcxx_check_valid_range(_First,_Last); \
+_GLIBCXX_DEBUG_VERIFY(!_Position._M_singular(), \
+ _M_message(__gnu_debug::__msg_insert_singular) \
+ ._M_sequence(*this, "this") \
+ ._M_iterator(_Position, #_Position)); \
+_GLIBCXX_DEBUG_VERIFY(_Position._M_attached_to(this), \
+ _M_message(__gnu_debug::__msg_insert_different) \
+ ._M_sequence(*this, "this") \
+ ._M_iterator(_Position, #_Position))
+
+/** Verify that we can erase the element referenced by the iterator
+ * _Position. We can erase the element if the _Position iterator is
+ * dereferenceable and references this sequence.
+*/
+#define __glibcxx_check_erase(_Position) \
+_GLIBCXX_DEBUG_VERIFY(_Position._M_dereferenceable(), \
+ _M_message(__gnu_debug::__msg_erase_bad) \
+ ._M_sequence(*this, "this") \
+ ._M_iterator(_Position, #_Position)); \
+_GLIBCXX_DEBUG_VERIFY(_Position._M_attached_to(this), \
+ _M_message(__gnu_debug::__msg_erase_different) \
+ ._M_sequence(*this, "this") \
+ ._M_iterator(_Position, #_Position))
+
+/** Verify that we can erase the elements in the iterator range
+ * [_First, _Last). We can erase the elements if [_First, _Last) is a
+ * valid iterator range within this sequence.
+*/
+#define __glibcxx_check_erase_range(_First,_Last) \
+__glibcxx_check_valid_range(_First,_Last); \
+_GLIBCXX_DEBUG_VERIFY(_First._M_attached_to(this), \
+ _M_message(__gnu_debug::__msg_erase_different) \
+ ._M_sequence(*this, "this") \
+ ._M_iterator(_First, #_First) \
+ ._M_iterator(_Last, #_Last))
+
+// Verify that the subscript _N is less than the container's size.
+#define __glibcxx_check_subscript(_N) \
+_GLIBCXX_DEBUG_VERIFY(_N < this->size(), \
+ _M_message(__gnu_debug::__msg_subscript_oob) \
+ ._M_sequence(*this, "this") \
+ ._M_integer(_N, #_N) \
+ ._M_integer(this->size(), "size"))
+
+// Verify that the container is nonempty
+#define __glibcxx_check_nonempty() \
+_GLIBCXX_DEBUG_VERIFY(! this->empty(), \
+ _M_message(__gnu_debug::__msg_empty) \
+ ._M_sequence(*this, "this"))
+
+// Verify that the iterator range [_First, _Last) is sorted
+#define __glibcxx_check_sorted(_First,_Last) \
+__glibcxx_check_valid_range(_First,_Last); \
+_GLIBCXX_DEBUG_VERIFY(__gnu_debug::__check_sorted(_First, _Last), \
+ _M_message(__gnu_debug::__msg_unsorted) \
+ ._M_iterator(_First, #_First) \
+ ._M_iterator(_Last, #_Last))
+
+/** Verify that the iterator range [_First, _Last) is sorted by the
+ predicate _Pred. */
+#define __glibcxx_check_sorted_pred(_First,_Last,_Pred) \
+__glibcxx_check_valid_range(_First,_Last); \
+_GLIBCXX_DEBUG_VERIFY(__gnu_debug::__check_sorted(_First, _Last, _Pred), \
+ _M_message(__gnu_debug::__msg_unsorted_pred) \
+ ._M_iterator(_First, #_First) \
+ ._M_iterator(_Last, #_Last) \
+ ._M_string(#_Pred))
+
+// Special variant for std::merge, std::includes, std::set_*
+#define __glibcxx_check_sorted_set(_First1,_Last1,_First2) \
+__glibcxx_check_valid_range(_First1,_Last1); \
+_GLIBCXX_DEBUG_VERIFY( \
+ __gnu_debug::__check_sorted_set(_First1, _Last1, _First2), \
+ _M_message(__gnu_debug::__msg_unsorted) \
+ ._M_iterator(_First1, #_First1) \
+ ._M_iterator(_Last1, #_Last1))
+
+// Likewise with a _Pred.
+#define __glibcxx_check_sorted_set_pred(_First1,_Last1,_First2,_Pred) \
+__glibcxx_check_valid_range(_First1,_Last1); \
+_GLIBCXX_DEBUG_VERIFY( \
+ __gnu_debug::__check_sorted_set(_First1, _Last1, _First2, _Pred), \
+ _M_message(__gnu_debug::__msg_unsorted_pred) \
+ ._M_iterator(_First1, #_First1) \
+ ._M_iterator(_Last1, #_Last1) \
+ ._M_string(#_Pred))
+
+/** Verify that the iterator range [_First, _Last) is partitioned
+ w.r.t. the value _Value. */
+#define __glibcxx_check_partitioned_lower(_First,_Last,_Value) \
+__glibcxx_check_valid_range(_First,_Last); \
+_GLIBCXX_DEBUG_VERIFY(__gnu_debug::__check_partitioned_lower(_First, _Last, \
+ _Value), \
+ _M_message(__gnu_debug::__msg_unpartitioned) \
+ ._M_iterator(_First, #_First) \
+ ._M_iterator(_Last, #_Last) \
+ ._M_string(#_Value))
+
+#define __glibcxx_check_partitioned_upper(_First,_Last,_Value) \
+__glibcxx_check_valid_range(_First,_Last); \
+_GLIBCXX_DEBUG_VERIFY(__gnu_debug::__check_partitioned_upper(_First, _Last, \
+ _Value), \
+ _M_message(__gnu_debug::__msg_unpartitioned) \
+ ._M_iterator(_First, #_First) \
+ ._M_iterator(_Last, #_Last) \
+ ._M_string(#_Value))
+
+/** Verify that the iterator range [_First, _Last) is partitioned
+ w.r.t. the value _Value and predicate _Pred. */
+#define __glibcxx_check_partitioned_lower_pred(_First,_Last,_Value,_Pred) \
+__glibcxx_check_valid_range(_First,_Last); \
+_GLIBCXX_DEBUG_VERIFY(__gnu_debug::__check_partitioned_lower(_First, _Last, \
+ _Value, _Pred), \
+ _M_message(__gnu_debug::__msg_unpartitioned_pred) \
+ ._M_iterator(_First, #_First) \
+ ._M_iterator(_Last, #_Last) \
+ ._M_string(#_Pred) \
+ ._M_string(#_Value))
+
+/** Verify that the iterator range [_First, _Last) is partitioned
+ w.r.t. the value _Value and predicate _Pred. */
+#define __glibcxx_check_partitioned_upper_pred(_First,_Last,_Value,_Pred) \
+__glibcxx_check_valid_range(_First,_Last); \
+_GLIBCXX_DEBUG_VERIFY(__gnu_debug::__check_partitioned_upper(_First, _Last, \
+ _Value, _Pred), \
+ _M_message(__gnu_debug::__msg_unpartitioned_pred) \
+ ._M_iterator(_First, #_First) \
+ ._M_iterator(_Last, #_Last) \
+ ._M_string(#_Pred) \
+ ._M_string(#_Value))
+
+// Verify that the iterator range [_First, _Last) is a heap
+#define __glibcxx_check_heap(_First,_Last) \
+__glibcxx_check_valid_range(_First,_Last); \
+_GLIBCXX_DEBUG_VERIFY(std::__is_heap(_First, _Last), \
+ _M_message(__gnu_debug::__msg_not_heap) \
+ ._M_iterator(_First, #_First) \
+ ._M_iterator(_Last, #_Last))
+
+/** Verify that the iterator range [_First, _Last) is a heap
+ w.r.t. the predicate _Pred. */
+#define __glibcxx_check_heap_pred(_First,_Last,_Pred) \
+__glibcxx_check_valid_range(_First,_Last); \
+_GLIBCXX_DEBUG_VERIFY(std::__is_heap(_First, _Last, _Pred), \
+ _M_message(__gnu_debug::__msg_not_heap_pred) \
+ ._M_iterator(_First, #_First) \
+ ._M_iterator(_Last, #_Last) \
+ ._M_string(#_Pred))
+
+#ifdef _GLIBCXX_DEBUG_PEDANTIC
+# define __glibcxx_check_string(_String) _GLIBCXX_DEBUG_ASSERT(_String != 0)
+# define __glibcxx_check_string_len(_String,_Len) \
+ _GLIBCXX_DEBUG_ASSERT(_String != 0 || _Len == 0)
+#else
+# define __glibcxx_check_string(_String)
+# define __glibcxx_check_string_len(_String,_Len)
+#endif
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/debug/map b/i686-linux/include/c++/4.4.3/debug/map
new file mode 100644
index 0000000..2d16b71
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/debug/map
@@ -0,0 +1,37 @@
+// Debugging map/multimap implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2006, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/map
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_MAP
+#define _GLIBCXX_DEBUG_MAP 1
+
+#include <map>
+#include <debug/map.h>
+#include <debug/multimap.h>
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/debug/map.h b/i686-linux/include/c++/4.4.3/debug/map.h
new file mode 100644
index 0000000..de1e5a5
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/debug/map.h
@@ -0,0 +1,412 @@
+// Debugging map implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/map.h
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_MAP_H
+#define _GLIBCXX_DEBUG_MAP_H 1
+
+#include <debug/safe_sequence.h>
+#include <debug/safe_iterator.h>
+#include <utility>
+
+namespace std
+{
+namespace __debug
+{
+ template<typename _Key, typename _Tp, typename _Compare = std::less<_Key>,
+ typename _Allocator = std::allocator<std::pair<const _Key, _Tp> > >
+ class map
+ : public _GLIBCXX_STD_D::map<_Key, _Tp, _Compare, _Allocator>,
+ public __gnu_debug::_Safe_sequence<map<_Key, _Tp, _Compare, _Allocator> >
+ {
+ typedef _GLIBCXX_STD_D::map<_Key, _Tp, _Compare, _Allocator> _Base;
+ typedef __gnu_debug::_Safe_sequence<map> _Safe_base;
+
+ public:
+ // types:
+ typedef _Key key_type;
+ typedef _Tp mapped_type;
+ typedef std::pair<const _Key, _Tp> value_type;
+ typedef _Compare key_compare;
+ typedef _Allocator allocator_type;
+ typedef typename _Base::reference reference;
+ typedef typename _Base::const_reference const_reference;
+
+ typedef __gnu_debug::_Safe_iterator<typename _Base::iterator, map>
+ iterator;
+ typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator, map>
+ const_iterator;
+
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::difference_type difference_type;
+ typedef typename _Base::pointer pointer;
+ typedef typename _Base::const_pointer const_pointer;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+
+ using _Base::value_compare;
+
+ // 23.3.1.1 construct/copy/destroy:
+ explicit map(const _Compare& __comp = _Compare(),
+ const _Allocator& __a = _Allocator())
+ : _Base(__comp, __a) { }
+
+ template<typename _InputIterator>
+ map(_InputIterator __first, _InputIterator __last,
+ const _Compare& __comp = _Compare(),
+ const _Allocator& __a = _Allocator())
+ : _Base(__gnu_debug::__check_valid_range(__first, __last), __last,
+ __comp, __a), _Safe_base() { }
+
+ map(const map& __x)
+ : _Base(__x), _Safe_base() { }
+
+ map(const _Base& __x)
+ : _Base(__x), _Safe_base() { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ map(map&& __x)
+ : _Base(std::forward<map>(__x)), _Safe_base()
+ { this->_M_swap(__x); }
+
+ map(initializer_list<value_type> __l,
+ const _Compare& __c = _Compare(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __c, __a), _Safe_base() { }
+#endif
+
+ ~map() { }
+
+ map&
+ operator=(const map& __x)
+ {
+ *static_cast<_Base*>(this) = __x;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ map&
+ operator=(map&& __x)
+ {
+ // NB: DR 675.
+ clear();
+ swap(__x);
+ return *this;
+ }
+
+ map&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l);
+ return *this;
+ }
+#endif
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 133. map missing get_allocator()
+ using _Base::get_allocator;
+
+ // iterators:
+ iterator
+ begin()
+ { return iterator(_Base::begin(), this); }
+
+ const_iterator
+ begin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ iterator
+ end()
+ { return iterator(_Base::end(), this); }
+
+ const_iterator
+ end() const
+ { return const_iterator(_Base::end(), this); }
+
+ reverse_iterator
+ rbegin()
+ { return reverse_iterator(end()); }
+
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(end()); }
+
+ reverse_iterator
+ rend()
+ { return reverse_iterator(begin()); }
+
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(begin()); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ const_iterator
+ cbegin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ const_iterator
+ cend() const
+ { return const_iterator(_Base::end(), this); }
+
+ const_reverse_iterator
+ crbegin() const
+ { return const_reverse_iterator(end()); }
+
+ const_reverse_iterator
+ crend() const
+ { return const_reverse_iterator(begin()); }
+#endif
+
+ // capacity:
+ using _Base::empty;
+ using _Base::size;
+ using _Base::max_size;
+
+ // 23.3.1.2 element access:
+ using _Base::operator[];
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 464. Suggestion for new member functions in standard containers.
+ using _Base::at;
+
+ // modifiers:
+ std::pair<iterator, bool>
+ insert(const value_type& __x)
+ {
+ typedef typename _Base::iterator _Base_iterator;
+ std::pair<_Base_iterator, bool> __res = _Base::insert(__x);
+ return std::pair<iterator, bool>(iterator(__res.first, this),
+ __res.second);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ insert(std::initializer_list<value_type> __list)
+ { _Base::insert(__list); }
+#endif
+
+ iterator
+ insert(iterator __position, const value_type& __x)
+ {
+ __glibcxx_check_insert(__position);
+ return iterator(_Base::insert(__position.base(), __x), this);
+ }
+
+ template<typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::insert(__first, __last);
+ }
+
+ void
+ erase(iterator __position)
+ {
+ __glibcxx_check_erase(__position);
+ __position._M_invalidate();
+ _Base::erase(__position.base());
+ }
+
+ size_type
+ erase(const key_type& __x)
+ {
+ iterator __victim = find(__x);
+ if (__victim == end())
+ return 0;
+ else
+ {
+ __victim._M_invalidate();
+ _Base::erase(__victim.base());
+ return 1;
+ }
+ }
+
+ void
+ erase(iterator __first, iterator __last)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 151. can't currently clear() empty container
+ __glibcxx_check_erase_range(__first, __last);
+ while (__first != __last)
+ this->erase(__first++);
+ }
+
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(map&& __x)
+#else
+ swap(map& __x)
+#endif
+ {
+ _Base::swap(__x);
+ this->_M_swap(__x);
+ }
+
+ void
+ clear()
+ { this->erase(begin(), end()); }
+
+ // observers:
+ using _Base::key_comp;
+ using _Base::value_comp;
+
+ // 23.3.1.3 map operations:
+ iterator
+ find(const key_type& __x)
+ { return iterator(_Base::find(__x), this); }
+
+ const_iterator
+ find(const key_type& __x) const
+ { return const_iterator(_Base::find(__x), this); }
+
+ using _Base::count;
+
+ iterator
+ lower_bound(const key_type& __x)
+ { return iterator(_Base::lower_bound(__x), this); }
+
+ const_iterator
+ lower_bound(const key_type& __x) const
+ { return const_iterator(_Base::lower_bound(__x), this); }
+
+ iterator
+ upper_bound(const key_type& __x)
+ { return iterator(_Base::upper_bound(__x), this); }
+
+ const_iterator
+ upper_bound(const key_type& __x) const
+ { return const_iterator(_Base::upper_bound(__x), this); }
+
+ std::pair<iterator,iterator>
+ equal_range(const key_type& __x)
+ {
+ typedef typename _Base::iterator _Base_iterator;
+ std::pair<_Base_iterator, _Base_iterator> __res =
+ _Base::equal_range(__x);
+ return std::make_pair(iterator(__res.first, this),
+ iterator(__res.second, this));
+ }
+
+ std::pair<const_iterator,const_iterator>
+ equal_range(const key_type& __x) const
+ {
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ std::pair<_Base_const_iterator, _Base_const_iterator> __res =
+ _Base::equal_range(__x);
+ return std::make_pair(const_iterator(__res.first, this),
+ const_iterator(__res.second, this));
+ }
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+
+ private:
+ void
+ _M_invalidate_all()
+ {
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
+ this->_M_invalidate_if(_Not_equal(_M_base().end()));
+ }
+ };
+
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline bool
+ operator==(const map<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ const map<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() == __rhs._M_base(); }
+
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline bool
+ operator!=(const map<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ const map<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() != __rhs._M_base(); }
+
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline bool
+ operator<(const map<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ const map<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() < __rhs._M_base(); }
+
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline bool
+ operator<=(const map<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ const map<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() <= __rhs._M_base(); }
+
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline bool
+ operator>=(const map<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ const map<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() >= __rhs._M_base(); }
+
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline bool
+ operator>(const map<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ const map<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() > __rhs._M_base(); }
+
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline void
+ swap(map<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ map<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ { __lhs.swap(__rhs); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline void
+ swap(map<_Key, _Tp, _Compare, _Allocator>&& __lhs,
+ map<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ { __lhs.swap(__rhs); }
+
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline void
+ swap(map<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ map<_Key, _Tp, _Compare, _Allocator>&& __rhs)
+ { __lhs.swap(__rhs); }
+#endif
+
+} // namespace __debug
+} // namespace std
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/debug/multimap.h b/i686-linux/include/c++/4.4.3/debug/multimap.h
new file mode 100644
index 0000000..42741da
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/debug/multimap.h
@@ -0,0 +1,400 @@
+// Debugging multimap implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/multimap.h
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_MULTIMAP_H
+#define _GLIBCXX_DEBUG_MULTIMAP_H 1
+
+#include <debug/safe_sequence.h>
+#include <debug/safe_iterator.h>
+#include <utility>
+
+namespace std
+{
+namespace __debug
+{
+ template<typename _Key, typename _Tp, typename _Compare = std::less<_Key>,
+ typename _Allocator = std::allocator<std::pair<const _Key, _Tp> > >
+ class multimap
+ : public _GLIBCXX_STD_D::multimap<_Key, _Tp, _Compare, _Allocator>,
+ public __gnu_debug::_Safe_sequence<multimap<_Key, _Tp,
+ _Compare, _Allocator> >
+ {
+ typedef _GLIBCXX_STD_D::multimap<_Key, _Tp, _Compare, _Allocator> _Base;
+ typedef __gnu_debug::_Safe_sequence<multimap> _Safe_base;
+
+ public:
+ // types:
+ typedef _Key key_type;
+ typedef _Tp mapped_type;
+ typedef std::pair<const _Key, _Tp> value_type;
+ typedef _Compare key_compare;
+ typedef _Allocator allocator_type;
+ typedef typename _Base::reference reference;
+ typedef typename _Base::const_reference const_reference;
+
+ typedef __gnu_debug::_Safe_iterator<typename _Base::iterator, multimap>
+ iterator;
+ typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator,
+ multimap> const_iterator;
+
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::difference_type difference_type;
+ typedef typename _Base::pointer pointer;
+ typedef typename _Base::const_pointer const_pointer;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+
+ using _Base::value_compare;
+
+ // 23.3.1.1 construct/copy/destroy:
+ explicit multimap(const _Compare& __comp = _Compare(),
+ const _Allocator& __a = _Allocator())
+ : _Base(__comp, __a) { }
+
+ template<typename _InputIterator>
+ multimap(_InputIterator __first, _InputIterator __last,
+ const _Compare& __comp = _Compare(),
+ const _Allocator& __a = _Allocator())
+ : _Base(__gnu_debug::__check_valid_range(__first, __last), __last,
+ __comp, __a) { }
+
+ multimap(const multimap& __x)
+ : _Base(__x), _Safe_base() { }
+
+ multimap(const _Base& __x)
+ : _Base(__x), _Safe_base() { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ multimap(multimap&& __x)
+ : _Base(std::forward<multimap>(__x)), _Safe_base()
+ { this->_M_swap(__x); }
+
+ multimap(initializer_list<value_type> __l,
+ const _Compare& __c = _Compare(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __c, __a), _Safe_base() { }
+#endif
+
+ ~multimap() { }
+
+ multimap&
+ operator=(const multimap& __x)
+ {
+ *static_cast<_Base*>(this) = __x;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ multimap&
+ operator=(multimap&& __x)
+ {
+ // NB: DR 675.
+ clear();
+ swap(__x);
+ return *this;
+ }
+
+ multimap&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l);
+ return *this;
+ }
+#endif
+
+ using _Base::get_allocator;
+
+ // iterators:
+ iterator
+ begin()
+ { return iterator(_Base::begin(), this); }
+
+ const_iterator
+ begin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ iterator
+ end()
+ { return iterator(_Base::end(), this); }
+
+ const_iterator
+ end() const
+ { return const_iterator(_Base::end(), this); }
+
+ reverse_iterator
+ rbegin()
+ { return reverse_iterator(end()); }
+
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(end()); }
+
+ reverse_iterator
+ rend()
+ { return reverse_iterator(begin()); }
+
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(begin()); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ const_iterator
+ cbegin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ const_iterator
+ cend() const
+ { return const_iterator(_Base::end(), this); }
+
+ const_reverse_iterator
+ crbegin() const
+ { return const_reverse_iterator(end()); }
+
+ const_reverse_iterator
+ crend() const
+ { return const_reverse_iterator(begin()); }
+#endif
+
+ // capacity:
+ using _Base::empty;
+ using _Base::size;
+ using _Base::max_size;
+
+ // modifiers:
+ iterator
+ insert(const value_type& __x)
+ { return iterator(_Base::insert(__x), this); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ insert(std::initializer_list<value_type> __list)
+ { _Base::insert(__list); }
+#endif
+
+ iterator
+ insert(iterator __position, const value_type& __x)
+ {
+ __glibcxx_check_insert(__position);
+ return iterator(_Base::insert(__position.base(), __x), this);
+ }
+
+ template<typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::insert(__first, __last);
+ }
+
+ void
+ erase(iterator __position)
+ {
+ __glibcxx_check_erase(__position);
+ __position._M_invalidate();
+ _Base::erase(__position.base());
+ }
+
+ size_type
+ erase(const key_type& __x)
+ {
+ std::pair<iterator, iterator> __victims = this->equal_range(__x);
+ size_type __count = 0;
+ while (__victims.first != __victims.second)
+ {
+ iterator __victim = __victims.first++;
+ __victim._M_invalidate();
+ _Base::erase(__victim.base());
+ ++__count;
+ }
+ return __count;
+ }
+
+ void
+ erase(iterator __first, iterator __last)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 151. can't currently clear() empty container
+ __glibcxx_check_erase_range(__first, __last);
+ while (__first != __last)
+ this->erase(__first++);
+ }
+
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(multimap&& __x)
+#else
+ swap(multimap& __x)
+#endif
+ {
+ _Base::swap(__x);
+ this->_M_swap(__x);
+ }
+
+ void
+ clear()
+ { this->erase(begin(), end()); }
+
+ // observers:
+ using _Base::key_comp;
+ using _Base::value_comp;
+
+ // 23.3.1.3 multimap operations:
+ iterator
+ find(const key_type& __x)
+ { return iterator(_Base::find(__x), this); }
+
+ const_iterator
+ find(const key_type& __x) const
+ { return const_iterator(_Base::find(__x), this); }
+
+ using _Base::count;
+
+ iterator
+ lower_bound(const key_type& __x)
+ { return iterator(_Base::lower_bound(__x), this); }
+
+ const_iterator
+ lower_bound(const key_type& __x) const
+ { return const_iterator(_Base::lower_bound(__x), this); }
+
+ iterator
+ upper_bound(const key_type& __x)
+ { return iterator(_Base::upper_bound(__x), this); }
+
+ const_iterator
+ upper_bound(const key_type& __x) const
+ { return const_iterator(_Base::upper_bound(__x), this); }
+
+ std::pair<iterator,iterator>
+ equal_range(const key_type& __x)
+ {
+ typedef typename _Base::iterator _Base_iterator;
+ std::pair<_Base_iterator, _Base_iterator> __res =
+ _Base::equal_range(__x);
+ return std::make_pair(iterator(__res.first, this),
+ iterator(__res.second, this));
+ }
+
+ std::pair<const_iterator,const_iterator>
+ equal_range(const key_type& __x) const
+ {
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ std::pair<_Base_const_iterator, _Base_const_iterator> __res =
+ _Base::equal_range(__x);
+ return std::make_pair(const_iterator(__res.first, this),
+ const_iterator(__res.second, this));
+ }
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+
+ private:
+ void
+ _M_invalidate_all()
+ {
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
+ this->_M_invalidate_if(_Not_equal(_M_base().end()));
+ }
+ };
+
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline bool
+ operator==(const multimap<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ const multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() == __rhs._M_base(); }
+
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline bool
+ operator!=(const multimap<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ const multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() != __rhs._M_base(); }
+
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline bool
+ operator<(const multimap<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ const multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() < __rhs._M_base(); }
+
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline bool
+ operator<=(const multimap<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ const multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() <= __rhs._M_base(); }
+
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline bool
+ operator>=(const multimap<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ const multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() >= __rhs._M_base(); }
+
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline bool
+ operator>(const multimap<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ const multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() > __rhs._M_base(); }
+
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline void
+ swap(multimap<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ { __lhs.swap(__rhs); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline void
+ swap(multimap<_Key, _Tp, _Compare, _Allocator>&& __lhs,
+ multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ { __lhs.swap(__rhs); }
+
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline void
+ swap(multimap<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ multimap<_Key, _Tp, _Compare, _Allocator>&& __rhs)
+ { __lhs.swap(__rhs); }
+#endif
+
+} // namespace __debug
+} // namespace std
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/debug/multiset.h b/i686-linux/include/c++/4.4.3/debug/multiset.h
new file mode 100644
index 0000000..3e4ee86
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/debug/multiset.h
@@ -0,0 +1,396 @@
+// Debugging multiset implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/multiset.h
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_MULTISET_H
+#define _GLIBCXX_DEBUG_MULTISET_H 1
+
+#include <debug/safe_sequence.h>
+#include <debug/safe_iterator.h>
+#include <utility>
+
+namespace std
+{
+namespace __debug
+{
+ template<typename _Key, typename _Compare = std::less<_Key>,
+ typename _Allocator = std::allocator<_Key> >
+ class multiset
+ : public _GLIBCXX_STD_D::multiset<_Key, _Compare, _Allocator>,
+ public __gnu_debug::_Safe_sequence<multiset<_Key, _Compare, _Allocator> >
+ {
+ typedef _GLIBCXX_STD_D::multiset<_Key, _Compare, _Allocator> _Base;
+ typedef __gnu_debug::_Safe_sequence<multiset> _Safe_base;
+
+ public:
+ // types:
+ typedef _Key key_type;
+ typedef _Key value_type;
+ typedef _Compare key_compare;
+ typedef _Compare value_compare;
+ typedef _Allocator allocator_type;
+ typedef typename _Base::reference reference;
+ typedef typename _Base::const_reference const_reference;
+
+ typedef __gnu_debug::_Safe_iterator<typename _Base::iterator, multiset>
+ iterator;
+ typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator,
+ multiset> const_iterator;
+
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::difference_type difference_type;
+ typedef typename _Base::pointer pointer;
+ typedef typename _Base::const_pointer const_pointer;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+
+ // 23.3.3.1 construct/copy/destroy:
+ explicit multiset(const _Compare& __comp = _Compare(),
+ const _Allocator& __a = _Allocator())
+ : _Base(__comp, __a) { }
+
+ template<typename _InputIterator>
+ multiset(_InputIterator __first, _InputIterator __last,
+ const _Compare& __comp = _Compare(),
+ const _Allocator& __a = _Allocator())
+ : _Base(__gnu_debug::__check_valid_range(__first, __last), __last,
+ __comp, __a) { }
+
+ multiset(const multiset& __x)
+ : _Base(__x), _Safe_base() { }
+
+ multiset(const _Base& __x)
+ : _Base(__x), _Safe_base() { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ multiset(multiset&& __x)
+ : _Base(std::forward<multiset>(__x)), _Safe_base()
+ { this->_M_swap(__x); }
+
+ multiset(initializer_list<value_type> __l,
+ const _Compare& __comp = _Compare(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __comp, __a), _Safe_base() { }
+#endif
+
+ ~multiset() { }
+
+ multiset&
+ operator=(const multiset& __x)
+ {
+ *static_cast<_Base*>(this) = __x;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ multiset&
+ operator=(multiset&& __x)
+ {
+ // NB: DR 675.
+ clear();
+ swap(__x);
+ return *this;
+ }
+
+ multiset&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l);
+ return *this;
+ }
+#endif
+
+ using _Base::get_allocator;
+
+ // iterators:
+ iterator
+ begin()
+ { return iterator(_Base::begin(), this); }
+
+ const_iterator
+ begin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ iterator
+ end()
+ { return iterator(_Base::end(), this); }
+
+ const_iterator
+ end() const
+ { return const_iterator(_Base::end(), this); }
+
+ reverse_iterator
+ rbegin()
+ { return reverse_iterator(end()); }
+
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(end()); }
+
+ reverse_iterator
+ rend()
+ { return reverse_iterator(begin()); }
+
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(begin()); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ const_iterator
+ cbegin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ const_iterator
+ cend() const
+ { return const_iterator(_Base::end(), this); }
+
+ const_reverse_iterator
+ crbegin() const
+ { return const_reverse_iterator(end()); }
+
+ const_reverse_iterator
+ crend() const
+ { return const_reverse_iterator(begin()); }
+#endif
+
+ // capacity:
+ using _Base::empty;
+ using _Base::size;
+ using _Base::max_size;
+
+ // modifiers:
+ iterator
+ insert(const value_type& __x)
+ { return iterator(_Base::insert(__x), this); }
+
+ iterator
+ insert(iterator __position, const value_type& __x)
+ {
+ __glibcxx_check_insert(__position);
+ return iterator(_Base::insert(__position.base(), __x), this);
+ }
+
+ template<typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::insert(__first, __last);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ insert(initializer_list<value_type> __l)
+ { _Base::insert(__l); }
+#endif
+
+ void
+ erase(iterator __position)
+ {
+ __glibcxx_check_erase(__position);
+ __position._M_invalidate();
+ _Base::erase(__position.base());
+ }
+
+ size_type
+ erase(const key_type& __x)
+ {
+ std::pair<iterator, iterator> __victims = this->equal_range(__x);
+ size_type __count = 0;
+ while (__victims.first != __victims.second)
+ {
+ iterator __victim = __victims.first++;
+ __victim._M_invalidate();
+ _Base::erase(__victim.base());
+ ++__count;
+ }
+ return __count;
+ }
+
+ void
+ erase(iterator __first, iterator __last)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 151. can't currently clear() empty container
+ __glibcxx_check_erase_range(__first, __last);
+ while (__first != __last)
+ this->erase(__first++);
+ }
+
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(multiset&& __x)
+#else
+ swap(multiset& __x)
+#endif
+ {
+ _Base::swap(__x);
+ this->_M_swap(__x);
+ }
+
+ void
+ clear()
+ { this->erase(begin(), end()); }
+
+ // observers:
+ using _Base::key_comp;
+ using _Base::value_comp;
+
+ // multiset operations:
+ iterator
+ find(const key_type& __x)
+ { return iterator(_Base::find(__x), this); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 214. set::find() missing const overload
+ const_iterator
+ find(const key_type& __x) const
+ { return const_iterator(_Base::find(__x), this); }
+
+ using _Base::count;
+
+ iterator
+ lower_bound(const key_type& __x)
+ { return iterator(_Base::lower_bound(__x), this); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 214. set::find() missing const overload
+ const_iterator
+ lower_bound(const key_type& __x) const
+ { return const_iterator(_Base::lower_bound(__x), this); }
+
+ iterator
+ upper_bound(const key_type& __x)
+ { return iterator(_Base::upper_bound(__x), this); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 214. set::find() missing const overload
+ const_iterator
+ upper_bound(const key_type& __x) const
+ { return const_iterator(_Base::upper_bound(__x), this); }
+
+ std::pair<iterator,iterator>
+ equal_range(const key_type& __x)
+ {
+ typedef typename _Base::iterator _Base_iterator;
+ std::pair<_Base_iterator, _Base_iterator> __res =
+ _Base::equal_range(__x);
+ return std::make_pair(iterator(__res.first, this),
+ iterator(__res.second, this));
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 214. set::find() missing const overload
+ std::pair<const_iterator,const_iterator>
+ equal_range(const key_type& __x) const
+ {
+ typedef typename _Base::const_iterator _Base_iterator;
+ std::pair<_Base_iterator, _Base_iterator> __res =
+ _Base::equal_range(__x);
+ return std::make_pair(const_iterator(__res.first, this),
+ const_iterator(__res.second, this));
+ }
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+
+ private:
+ void
+ _M_invalidate_all()
+ {
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
+ this->_M_invalidate_if(_Not_equal(_M_base().end()));
+ }
+ };
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ inline bool
+ operator==(const multiset<_Key, _Compare, _Allocator>& __lhs,
+ const multiset<_Key, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() == __rhs._M_base(); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ inline bool
+ operator!=(const multiset<_Key, _Compare, _Allocator>& __lhs,
+ const multiset<_Key, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() != __rhs._M_base(); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ inline bool
+ operator<(const multiset<_Key, _Compare, _Allocator>& __lhs,
+ const multiset<_Key, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() < __rhs._M_base(); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ inline bool
+ operator<=(const multiset<_Key, _Compare, _Allocator>& __lhs,
+ const multiset<_Key, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() <= __rhs._M_base(); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ inline bool
+ operator>=(const multiset<_Key, _Compare, _Allocator>& __lhs,
+ const multiset<_Key, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() >= __rhs._M_base(); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ inline bool
+ operator>(const multiset<_Key, _Compare, _Allocator>& __lhs,
+ const multiset<_Key, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() > __rhs._M_base(); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ void
+ swap(multiset<_Key, _Compare, _Allocator>& __x,
+ multiset<_Key, _Compare, _Allocator>& __y)
+ { return __x.swap(__y); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Key, typename _Compare, typename _Allocator>
+ void
+ swap(multiset<_Key, _Compare, _Allocator>&& __x,
+ multiset<_Key, _Compare, _Allocator>& __y)
+ { return __x.swap(__y); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ void
+ swap(multiset<_Key, _Compare, _Allocator>& __x,
+ multiset<_Key, _Compare, _Allocator>&& __y)
+ { return __x.swap(__y); }
+#endif
+
+} // namespace __debug
+} // namespace std
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/debug/safe_base.h b/i686-linux/include/c++/4.4.3/debug/safe_base.h
new file mode 100644
index 0000000..1bef5e7
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/debug/safe_base.h
@@ -0,0 +1,220 @@
+// Safe sequence/iterator base implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/safe_base.h
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_SAFE_BASE_H
+#define _GLIBCXX_DEBUG_SAFE_BASE_H 1
+
+#include <ext/concurrence.h>
+
+namespace __gnu_debug
+{
+ class _Safe_sequence_base;
+
+ /** \brief Basic functionality for a "safe" iterator.
+ *
+ * The %_Safe_iterator_base base class implements the functionality
+ * of a safe iterator that is not specific to a particular iterator
+ * type. It contains a pointer back to the sequence it references
+ * along with iterator version information and pointers to form a
+ * doubly-linked list of iterators referenced by the container.
+ *
+ * This class must not perform any operations that can throw an
+ * exception, or the exception guarantees of derived iterators will
+ * be broken.
+ */
+ class _Safe_iterator_base
+ {
+ public:
+ /** The sequence this iterator references; may be NULL to indicate
+ a singular iterator. */
+ _Safe_sequence_base* _M_sequence;
+
+ /** The version number of this iterator. The sentinel value 0 is
+ * used to indicate an invalidated iterator (i.e., one that is
+ * singular because of an operation on the container). This
+ * version number must equal the version number in the sequence
+ * referenced by _M_sequence for the iterator to be
+ * non-singular.
+ */
+ unsigned int _M_version;
+
+ /** Pointer to the previous iterator in the sequence's list of
+ iterators. Only valid when _M_sequence != NULL. */
+ _Safe_iterator_base* _M_prior;
+
+ /** Pointer to the next iterator in the sequence's list of
+ iterators. Only valid when _M_sequence != NULL. */
+ _Safe_iterator_base* _M_next;
+
+ protected:
+ /** Initializes the iterator and makes it singular. */
+ _Safe_iterator_base()
+ : _M_sequence(0), _M_version(0), _M_prior(0), _M_next(0)
+ { }
+
+ /** Initialize the iterator to reference the sequence pointed to
+ * by @p__seq. @p __constant is true when we are initializing a
+ * constant iterator, and false if it is a mutable iterator. Note
+ * that @p __seq may be NULL, in which case the iterator will be
+ * singular. Otherwise, the iterator will reference @p __seq and
+ * be nonsingular.
+ */
+ _Safe_iterator_base(const _Safe_sequence_base* __seq, bool __constant)
+ : _M_sequence(0), _M_version(0), _M_prior(0), _M_next(0)
+ { this->_M_attach(const_cast<_Safe_sequence_base*>(__seq), __constant); }
+
+ /** Initializes the iterator to reference the same sequence that
+ @p __x does. @p __constant is true if this is a constant
+ iterator, and false if it is mutable. */
+ _Safe_iterator_base(const _Safe_iterator_base& __x, bool __constant)
+ : _M_sequence(0), _M_version(0), _M_prior(0), _M_next(0)
+ { this->_M_attach(__x._M_sequence, __constant); }
+
+ _Safe_iterator_base&
+ operator=(const _Safe_iterator_base&);
+
+ explicit
+ _Safe_iterator_base(const _Safe_iterator_base&);
+
+ ~_Safe_iterator_base() { this->_M_detach(); }
+
+ /** For use in _Safe_iterator. */
+ __gnu_cxx::__mutex& _M_get_mutex();
+
+ public:
+ /** Attaches this iterator to the given sequence, detaching it
+ * from whatever sequence it was attached to originally. If the
+ * new sequence is the NULL pointer, the iterator is left
+ * unattached.
+ */
+ void _M_attach(_Safe_sequence_base* __seq, bool __constant);
+
+ /** Likewise, but not thread-safe. */
+ void _M_attach_single(_Safe_sequence_base* __seq, bool __constant);
+
+ /** Detach the iterator for whatever sequence it is attached to,
+ * if any.
+ */
+ void _M_detach();
+
+ /** Likewise, but not thread-safe. */
+ void _M_detach_single();
+
+ /** Determines if we are attached to the given sequence. */
+ bool _M_attached_to(const _Safe_sequence_base* __seq) const
+ { return _M_sequence == __seq; }
+
+ /** Is this iterator singular? */
+ bool _M_singular() const;
+
+ /** Can we compare this iterator to the given iterator @p __x?
+ Returns true if both iterators are nonsingular and reference
+ the same sequence. */
+ bool _M_can_compare(const _Safe_iterator_base& __x) const;
+ };
+
+ /**
+ * @brief Base class that supports tracking of iterators that
+ * reference a sequence.
+ *
+ * The %_Safe_sequence_base class provides basic support for
+ * tracking iterators into a sequence. Sequences that track
+ * iterators must derived from %_Safe_sequence_base publicly, so
+ * that safe iterators (which inherit _Safe_iterator_base) can
+ * attach to them. This class contains two linked lists of
+ * iterators, one for constant iterators and one for mutable
+ * iterators, and a version number that allows very fast
+ * invalidation of all iterators that reference the container.
+ *
+ * This class must ensure that no operation on it may throw an
+ * exception, otherwise "safe" sequences may fail to provide the
+ * exception-safety guarantees required by the C++ standard.
+ */
+ class _Safe_sequence_base
+ {
+ public:
+ /// The list of mutable iterators that reference this container
+ _Safe_iterator_base* _M_iterators;
+
+ /// The list of constant iterators that reference this container
+ _Safe_iterator_base* _M_const_iterators;
+
+ /// The container version number. This number may never be 0.
+ mutable unsigned int _M_version;
+
+ protected:
+ // Initialize with a version number of 1 and no iterators
+ _Safe_sequence_base()
+ : _M_iterators(0), _M_const_iterators(0), _M_version(1)
+ { }
+
+ /** Notify all iterators that reference this sequence that the
+ sequence is being destroyed. */
+ ~_Safe_sequence_base()
+ { this->_M_detach_all(); }
+
+ /** Detach all iterators, leaving them singular. */
+ void
+ _M_detach_all();
+
+ /** Detach all singular iterators.
+ * @post for all iterators i attached to this sequence,
+ * i->_M_version == _M_version.
+ */
+ void
+ _M_detach_singular();
+
+ /** Revalidates all attached singular iterators. This method may
+ * be used to validate iterators that were invalidated before
+ * (but for some reason, such as an exception, need to become
+ * valid again).
+ */
+ void
+ _M_revalidate_singular();
+
+ /** Swap this sequence with the given sequence. This operation
+ * also swaps ownership of the iterators, so that when the
+ * operation is complete all iterators that originally referenced
+ * one container now reference the other container.
+ */
+ void
+ _M_swap(_Safe_sequence_base& __x);
+
+ /** For use in _Safe_sequence. */
+ __gnu_cxx::__mutex& _M_get_mutex();
+
+ public:
+ /** Invalidates all iterators. */
+ void
+ _M_invalidate_all() const
+ { if (++_M_version == 0) _M_version = 1; }
+ };
+} // namespace __gnu_debug
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/debug/safe_iterator.h b/i686-linux/include/c++/4.4.3/debug/safe_iterator.h
new file mode 100644
index 0000000..dbdb32e
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/debug/safe_iterator.h
@@ -0,0 +1,643 @@
+// Safe iterator implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/safe_iterator.h
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_SAFE_ITERATOR_H
+#define _GLIBCXX_DEBUG_SAFE_ITERATOR_H 1
+
+#include <debug/debug.h>
+#include <debug/macros.h>
+#include <debug/functions.h>
+#include <debug/formatter.h>
+#include <debug/safe_base.h>
+#include <bits/stl_pair.h>
+#include <ext/type_traits.h>
+
+namespace __gnu_debug
+{
+ /** Iterators that derive from _Safe_iterator_base but that aren't
+ * _Safe_iterators can be determined singular or non-singular via
+ * _Safe_iterator_base.
+ */
+ inline bool
+ __check_singular_aux(const _Safe_iterator_base* __x)
+ { return __x->_M_singular(); }
+
+ /** \brief Safe iterator wrapper.
+ *
+ * The class template %_Safe_iterator is a wrapper around an
+ * iterator that tracks the iterator's movement among sequences and
+ * checks that operations performed on the "safe" iterator are
+ * legal. In additional to the basic iterator operations (which are
+ * validated, and then passed to the underlying iterator),
+ * %_Safe_iterator has member functions for iterator invalidation,
+ * attaching/detaching the iterator from sequences, and querying
+ * the iterator's state.
+ */
+ template<typename _Iterator, typename _Sequence>
+ class _Safe_iterator : public _Safe_iterator_base
+ {
+ typedef _Safe_iterator _Self;
+
+ /** The precision to which we can calculate the distance between
+ * two iterators.
+ */
+ enum _Distance_precision
+ {
+ __dp_equality, //< Can compare iterator equality, only
+ __dp_sign, //< Can determine equality and ordering
+ __dp_exact //< Can determine distance precisely
+ };
+
+ /// The underlying iterator
+ _Iterator _M_current;
+
+ /// Determine if this is a constant iterator.
+ bool
+ _M_constant() const
+ {
+ typedef typename _Sequence::const_iterator const_iterator;
+ return __is_same<const_iterator, _Safe_iterator>::value;
+ }
+
+ typedef std::iterator_traits<_Iterator> _Traits;
+
+ public:
+ typedef _Iterator _Base_iterator;
+ typedef typename _Traits::iterator_category iterator_category;
+ typedef typename _Traits::value_type value_type;
+ typedef typename _Traits::difference_type difference_type;
+ typedef typename _Traits::reference reference;
+ typedef typename _Traits::pointer pointer;
+
+ /// @post the iterator is singular and unattached
+ _Safe_iterator() : _M_current() { }
+
+ /**
+ * @brief Safe iterator construction from an unsafe iterator and
+ * its sequence.
+ *
+ * @pre @p seq is not NULL
+ * @post this is not singular
+ */
+ _Safe_iterator(const _Iterator& __i, const _Sequence* __seq)
+ : _Safe_iterator_base(__seq, _M_constant()), _M_current(__i)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! this->_M_singular(),
+ _M_message(__msg_init_singular)
+ ._M_iterator(*this, "this"));
+ }
+
+ /**
+ * @brief Copy construction.
+ * @pre @p x is not singular
+ */
+ _Safe_iterator(const _Safe_iterator& __x)
+ : _Safe_iterator_base(__x, _M_constant()), _M_current(__x._M_current)
+ {
+ _GLIBCXX_DEBUG_VERIFY(!__x._M_singular(),
+ _M_message(__msg_init_copy_singular)
+ ._M_iterator(*this, "this")
+ ._M_iterator(__x, "other"));
+ }
+
+ /**
+ * @brief Converting constructor from a mutable iterator to a
+ * constant iterator.
+ *
+ * @pre @p x is not singular
+ */
+ template<typename _MutableIterator>
+ _Safe_iterator(
+ const _Safe_iterator<_MutableIterator,
+ typename __gnu_cxx::__enable_if<(std::__are_same<_MutableIterator,
+ typename _Sequence::iterator::_Base_iterator>::__value),
+ _Sequence>::__type>& __x)
+ : _Safe_iterator_base(__x, _M_constant()), _M_current(__x.base())
+ {
+ _GLIBCXX_DEBUG_VERIFY(!__x._M_singular(),
+ _M_message(__msg_init_const_singular)
+ ._M_iterator(*this, "this")
+ ._M_iterator(__x, "other"));
+ }
+
+ /**
+ * @brief Copy assignment.
+ * @pre @p x is not singular
+ */
+ _Safe_iterator&
+ operator=(const _Safe_iterator& __x)
+ {
+ _GLIBCXX_DEBUG_VERIFY(!__x._M_singular(),
+ _M_message(__msg_copy_singular)
+ ._M_iterator(*this, "this")
+ ._M_iterator(__x, "other"));
+ _M_current = __x._M_current;
+ this->_M_attach(static_cast<_Sequence*>(__x._M_sequence));
+ return *this;
+ }
+
+ /**
+ * @brief Iterator dereference.
+ * @pre iterator is dereferenceable
+ */
+ reference
+ operator*() const
+ {
+
+ _GLIBCXX_DEBUG_VERIFY(this->_M_dereferenceable(),
+ _M_message(__msg_bad_deref)
+ ._M_iterator(*this, "this"));
+ return *_M_current;
+ }
+
+ /**
+ * @brief Iterator dereference.
+ * @pre iterator is dereferenceable
+ * @todo Make this correct w.r.t. iterators that return proxies
+ * @todo Use addressof() instead of & operator
+ */
+ pointer
+ operator->() const
+ {
+ _GLIBCXX_DEBUG_VERIFY(this->_M_dereferenceable(),
+ _M_message(__msg_bad_deref)
+ ._M_iterator(*this, "this"));
+ return &*_M_current;
+ }
+
+ // ------ Input iterator requirements ------
+ /**
+ * @brief Iterator preincrement
+ * @pre iterator is incrementable
+ */
+ _Safe_iterator&
+ operator++()
+ {
+ _GLIBCXX_DEBUG_VERIFY(this->_M_incrementable(),
+ _M_message(__msg_bad_inc)
+ ._M_iterator(*this, "this"));
+ ++_M_current;
+ return *this;
+ }
+
+ /**
+ * @brief Iterator postincrement
+ * @pre iterator is incrementable
+ */
+ _Safe_iterator
+ operator++(int)
+ {
+ _GLIBCXX_DEBUG_VERIFY(this->_M_incrementable(),
+ _M_message(__msg_bad_inc)
+ ._M_iterator(*this, "this"));
+ _Safe_iterator __tmp(*this);
+ ++_M_current;
+ return __tmp;
+ }
+
+ // ------ Bidirectional iterator requirements ------
+ /**
+ * @brief Iterator predecrement
+ * @pre iterator is decrementable
+ */
+ _Safe_iterator&
+ operator--()
+ {
+ _GLIBCXX_DEBUG_VERIFY(this->_M_decrementable(),
+ _M_message(__msg_bad_dec)
+ ._M_iterator(*this, "this"));
+ --_M_current;
+ return *this;
+ }
+
+ /**
+ * @brief Iterator postdecrement
+ * @pre iterator is decrementable
+ */
+ _Safe_iterator
+ operator--(int)
+ {
+ _GLIBCXX_DEBUG_VERIFY(this->_M_decrementable(),
+ _M_message(__msg_bad_dec)
+ ._M_iterator(*this, "this"));
+ _Safe_iterator __tmp(*this);
+ --_M_current;
+ return __tmp;
+ }
+
+ // ------ Random access iterator requirements ------
+ reference
+ operator[](const difference_type& __n) const
+ {
+ _GLIBCXX_DEBUG_VERIFY(this->_M_can_advance(__n)
+ && this->_M_can_advance(__n+1),
+ _M_message(__msg_iter_subscript_oob)
+ ._M_iterator(*this)._M_integer(__n));
+
+ return _M_current[__n];
+ }
+
+ _Safe_iterator&
+ operator+=(const difference_type& __n)
+ {
+ _GLIBCXX_DEBUG_VERIFY(this->_M_can_advance(__n),
+ _M_message(__msg_advance_oob)
+ ._M_iterator(*this)._M_integer(__n));
+ _M_current += __n;
+ return *this;
+ }
+
+ _Safe_iterator
+ operator+(const difference_type& __n) const
+ {
+ _Safe_iterator __tmp(*this);
+ __tmp += __n;
+ return __tmp;
+ }
+
+ _Safe_iterator&
+ operator-=(const difference_type& __n)
+ {
+ _GLIBCXX_DEBUG_VERIFY(this->_M_can_advance(-__n),
+ _M_message(__msg_retreat_oob)
+ ._M_iterator(*this)._M_integer(__n));
+ _M_current += -__n;
+ return *this;
+ }
+
+ _Safe_iterator
+ operator-(const difference_type& __n) const
+ {
+ _Safe_iterator __tmp(*this);
+ __tmp -= __n;
+ return __tmp;
+ }
+
+ // ------ Utilities ------
+ /**
+ * @brief Return the underlying iterator
+ */
+ _Iterator
+ base() const { return _M_current; }
+
+ /**
+ * @brief Conversion to underlying non-debug iterator to allow
+ * better interaction with non-debug containers.
+ */
+ operator _Iterator() const { return _M_current; }
+
+ /** Attach iterator to the given sequence. */
+ void
+ _M_attach(const _Sequence* __seq)
+ {
+ _Safe_iterator_base::_M_attach(const_cast<_Sequence*>(__seq),
+ _M_constant());
+ }
+
+ /** Likewise, but not thread-safe. */
+ void
+ _M_attach_single(const _Sequence* __seq)
+ {
+ _Safe_iterator_base::_M_attach_single(const_cast<_Sequence*>(__seq),
+ _M_constant());
+ }
+
+ /** Invalidate the iterator, making it singular. */
+ void
+ _M_invalidate();
+
+ /** Likewise, but not thread-safe. */
+ void
+ _M_invalidate_single();
+
+ /// Is the iterator dereferenceable?
+ bool
+ _M_dereferenceable() const
+ { return !this->_M_singular() && !_M_is_end(); }
+
+ /// Is the iterator incrementable?
+ bool
+ _M_incrementable() const { return this->_M_dereferenceable(); }
+
+ // Is the iterator decrementable?
+ bool
+ _M_decrementable() const { return !_M_singular() && !_M_is_begin(); }
+
+ // Can we advance the iterator @p __n steps (@p __n may be negative)
+ bool
+ _M_can_advance(const difference_type& __n) const;
+
+ // Is the iterator range [*this, __rhs) valid?
+ template<typename _Other>
+ bool
+ _M_valid_range(const _Safe_iterator<_Other, _Sequence>& __rhs) const;
+
+ // The sequence this iterator references.
+ const _Sequence*
+ _M_get_sequence() const
+ { return static_cast<const _Sequence*>(_M_sequence); }
+
+ /** Determine the distance between two iterators with some known
+ * precision.
+ */
+ template<typename _Iterator1, typename _Iterator2>
+ static std::pair<difference_type, _Distance_precision>
+ _M_get_distance(const _Iterator1& __lhs, const _Iterator2& __rhs)
+ {
+ typedef typename std::iterator_traits<_Iterator1>::iterator_category
+ _Category;
+ return _M_get_distance(__lhs, __rhs, _Category());
+ }
+
+ template<typename _Iterator1, typename _Iterator2>
+ static std::pair<difference_type, _Distance_precision>
+ _M_get_distance(const _Iterator1& __lhs, const _Iterator2& __rhs,
+ std::random_access_iterator_tag)
+ {
+ return std::make_pair(__rhs.base() - __lhs.base(), __dp_exact);
+ }
+
+ template<typename _Iterator1, typename _Iterator2>
+ static std::pair<difference_type, _Distance_precision>
+ _M_get_distance(const _Iterator1& __lhs, const _Iterator2& __rhs,
+ std::forward_iterator_tag)
+ {
+ return std::make_pair(__lhs.base() == __rhs.base()? 0 : 1,
+ __dp_equality);
+ }
+
+ /// Is this iterator equal to the sequence's begin() iterator?
+ bool _M_is_begin() const
+ { return *this == static_cast<const _Sequence*>(_M_sequence)->begin(); }
+
+ /// Is this iterator equal to the sequence's end() iterator?
+ bool _M_is_end() const
+ { return *this == static_cast<const _Sequence*>(_M_sequence)->end(); }
+ };
+
+ template<typename _IteratorL, typename _IteratorR, typename _Sequence>
+ inline bool
+ operator==(const _Safe_iterator<_IteratorL, _Sequence>& __lhs,
+ const _Safe_iterator<_IteratorR, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_compare_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_compare_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() == __rhs.base();
+ }
+
+ template<typename _Iterator, typename _Sequence>
+ inline bool
+ operator==(const _Safe_iterator<_Iterator, _Sequence>& __lhs,
+ const _Safe_iterator<_Iterator, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_compare_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_compare_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() == __rhs.base();
+ }
+
+ template<typename _IteratorL, typename _IteratorR, typename _Sequence>
+ inline bool
+ operator!=(const _Safe_iterator<_IteratorL, _Sequence>& __lhs,
+ const _Safe_iterator<_IteratorR, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_compare_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_compare_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() != __rhs.base();
+ }
+
+ template<typename _Iterator, typename _Sequence>
+ inline bool
+ operator!=(const _Safe_iterator<_Iterator, _Sequence>& __lhs,
+ const _Safe_iterator<_Iterator, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_compare_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_compare_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() != __rhs.base();
+ }
+
+ template<typename _IteratorL, typename _IteratorR, typename _Sequence>
+ inline bool
+ operator<(const _Safe_iterator<_IteratorL, _Sequence>& __lhs,
+ const _Safe_iterator<_IteratorR, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_order_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_order_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() < __rhs.base();
+ }
+
+ template<typename _Iterator, typename _Sequence>
+ inline bool
+ operator<(const _Safe_iterator<_Iterator, _Sequence>& __lhs,
+ const _Safe_iterator<_Iterator, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_order_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_order_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() < __rhs.base();
+ }
+
+ template<typename _IteratorL, typename _IteratorR, typename _Sequence>
+ inline bool
+ operator<=(const _Safe_iterator<_IteratorL, _Sequence>& __lhs,
+ const _Safe_iterator<_IteratorR, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_order_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_order_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() <= __rhs.base();
+ }
+
+ template<typename _Iterator, typename _Sequence>
+ inline bool
+ operator<=(const _Safe_iterator<_Iterator, _Sequence>& __lhs,
+ const _Safe_iterator<_Iterator, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_order_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_order_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() <= __rhs.base();
+ }
+
+ template<typename _IteratorL, typename _IteratorR, typename _Sequence>
+ inline bool
+ operator>(const _Safe_iterator<_IteratorL, _Sequence>& __lhs,
+ const _Safe_iterator<_IteratorR, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_order_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_order_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() > __rhs.base();
+ }
+
+ template<typename _Iterator, typename _Sequence>
+ inline bool
+ operator>(const _Safe_iterator<_Iterator, _Sequence>& __lhs,
+ const _Safe_iterator<_Iterator, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_order_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_order_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() > __rhs.base();
+ }
+
+ template<typename _IteratorL, typename _IteratorR, typename _Sequence>
+ inline bool
+ operator>=(const _Safe_iterator<_IteratorL, _Sequence>& __lhs,
+ const _Safe_iterator<_IteratorR, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_order_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_order_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() >= __rhs.base();
+ }
+
+ template<typename _Iterator, typename _Sequence>
+ inline bool
+ operator>=(const _Safe_iterator<_Iterator, _Sequence>& __lhs,
+ const _Safe_iterator<_Iterator, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_order_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_order_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() >= __rhs.base();
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // According to the resolution of DR179 not only the various comparison
+ // operators but also operator- must accept mixed iterator/const_iterator
+ // parameters.
+ template<typename _IteratorL, typename _IteratorR, typename _Sequence>
+ inline typename _Safe_iterator<_IteratorL, _Sequence>::difference_type
+ operator-(const _Safe_iterator<_IteratorL, _Sequence>& __lhs,
+ const _Safe_iterator<_IteratorR, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_distance_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_distance_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() - __rhs.base();
+ }
+
+ template<typename _Iterator, typename _Sequence>
+ inline typename _Safe_iterator<_Iterator, _Sequence>::difference_type
+ operator-(const _Safe_iterator<_Iterator, _Sequence>& __lhs,
+ const _Safe_iterator<_Iterator, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_distance_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_distance_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() - __rhs.base();
+ }
+
+ template<typename _Iterator, typename _Sequence>
+ inline _Safe_iterator<_Iterator, _Sequence>
+ operator+(typename _Safe_iterator<_Iterator,_Sequence>::difference_type __n,
+ const _Safe_iterator<_Iterator, _Sequence>& __i)
+ { return __i + __n; }
+} // namespace __gnu_debug
+
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <debug/safe_iterator.tcc>
+#endif
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/debug/safe_iterator.tcc b/i686-linux/include/c++/4.4.3/debug/safe_iterator.tcc
new file mode 100644
index 0000000..d4f2aee
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/debug/safe_iterator.tcc
@@ -0,0 +1,143 @@
+// Debugging iterator implementation (out of line) -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/safe_iterator.tcc
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_SAFE_ITERATOR_TCC
+#define _GLIBCXX_DEBUG_SAFE_ITERATOR_TCC 1
+
+namespace __gnu_debug
+{
+ template<typename _Iterator, typename _Sequence>
+ bool
+ _Safe_iterator<_Iterator, _Sequence>::
+ _M_can_advance(const difference_type& __n) const
+ {
+ typedef typename _Sequence::const_iterator const_iterator;
+
+ if (this->_M_singular())
+ return false;
+ if (__n == 0)
+ return true;
+ if (__n < 0)
+ {
+ const_iterator __begin =
+ static_cast<const _Sequence*>(_M_sequence)->begin();
+ std::pair<difference_type, _Distance_precision> __dist =
+ this->_M_get_distance(__begin, *this);
+ bool __ok = ((__dist.second == __dp_exact && __dist.first >= -__n)
+ || (__dist.second != __dp_exact && __dist.first > 0));
+ return __ok;
+ }
+ else
+ {
+ const_iterator __end =
+ static_cast<const _Sequence*>(_M_sequence)->end();
+ std::pair<difference_type, _Distance_precision> __dist =
+ this->_M_get_distance(*this, __end);
+ bool __ok = ((__dist.second == __dp_exact && __dist.first >= __n)
+ || (__dist.second != __dp_exact && __dist.first > 0));
+ return __ok;
+ }
+ }
+
+ template<typename _Iterator, typename _Sequence>
+ template<typename _Other>
+ bool
+ _Safe_iterator<_Iterator, _Sequence>::
+ _M_valid_range(const _Safe_iterator<_Other, _Sequence>& __rhs) const
+ {
+ if (!_M_can_compare(__rhs))
+ return false;
+
+ /* Determine if we can order the iterators without the help of
+ the container */
+ std::pair<difference_type, _Distance_precision> __dist =
+ this->_M_get_distance(*this, __rhs);
+ switch (__dist.second) {
+ case __dp_equality:
+ if (__dist.first == 0)
+ return true;
+ break;
+
+ case __dp_sign:
+ case __dp_exact:
+ return __dist.first >= 0;
+ }
+
+ /* We can only test for equality, but check if one of the
+ iterators is at an extreme. */
+ if (_M_is_begin() || __rhs._M_is_end())
+ return true;
+ else if (_M_is_end() || __rhs._M_is_begin())
+ return false;
+
+ // Assume that this is a valid range; we can't check anything else
+ return true;
+ }
+
+ template<typename _Iterator, typename _Sequence>
+ void
+ _Safe_iterator<_Iterator, _Sequence>::
+ _M_invalidate()
+ {
+ __gnu_cxx::__scoped_lock sentry(this->_M_get_mutex());
+ _M_invalidate_single();
+ }
+
+ template<typename _Iterator, typename _Sequence>
+ void
+ _Safe_iterator<_Iterator, _Sequence>::
+ _M_invalidate_single()
+ {
+ typedef typename _Sequence::iterator iterator;
+ typedef typename _Sequence::const_iterator const_iterator;
+
+ if (!this->_M_singular())
+ {
+ for (_Safe_iterator_base* __iter = _M_sequence->_M_iterators;
+ __iter; __iter = __iter->_M_next)
+ {
+ iterator* __victim = static_cast<iterator*>(__iter);
+ if (this->base() == __victim->base())
+ __victim->_M_version = 0;
+ }
+
+ for (_Safe_iterator_base* __iter2 = _M_sequence->_M_const_iterators;
+ __iter2; __iter2 = __iter2->_M_next)
+ {
+ const_iterator* __victim = static_cast<const_iterator*>(__iter2);
+ if (__victim->base() == this->base())
+ __victim->_M_version = 0;
+ }
+ _M_version = 0;
+ }
+ }
+} // namespace __gnu_debug
+
+#endif
+
diff --git a/i686-linux/include/c++/4.4.3/debug/safe_sequence.h b/i686-linux/include/c++/4.4.3/debug/safe_sequence.h
new file mode 100644
index 0000000..bbeac1d
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/debug/safe_sequence.h
@@ -0,0 +1,183 @@
+// Safe sequence implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/safe_sequence.h
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_SAFE_SEQUENCE_H
+#define _GLIBCXX_DEBUG_SAFE_SEQUENCE_H 1
+
+#include <debug/debug.h>
+#include <debug/macros.h>
+#include <debug/functions.h>
+#include <debug/safe_base.h>
+
+namespace __gnu_debug
+{
+ template<typename _Iterator, typename _Sequence>
+ class _Safe_iterator;
+
+ /** A simple function object that returns true if the passed-in
+ * value is not equal to the stored value. It saves typing over
+ * using both bind1st and not_equal.
+ */
+ template<typename _Type>
+ class _Not_equal_to
+ {
+ _Type __value;
+
+ public:
+ explicit _Not_equal_to(const _Type& __v) : __value(__v) { }
+
+ bool
+ operator()(const _Type& __x) const
+ { return __value != __x; }
+ };
+
+ /** A function object that returns true when the given random access
+ iterator is at least @c n steps away from the given iterator. */
+ template<typename _Iterator>
+ class _After_nth_from
+ {
+ typedef typename std::iterator_traits<_Iterator>::difference_type
+ difference_type;
+
+ _Iterator _M_base;
+ difference_type _M_n;
+
+ public:
+ _After_nth_from(const difference_type& __n, const _Iterator& __base)
+ : _M_base(__base), _M_n(__n) { }
+
+ bool
+ operator()(const _Iterator& __x) const
+ { return __x - _M_base >= _M_n; }
+ };
+
+ /**
+ * @brief Base class for constructing a "safe" sequence type that
+ * tracks iterators that reference it.
+ *
+ * The class template %_Safe_sequence simplifies the construction of
+ * "safe" sequences that track the iterators that reference the
+ * sequence, so that the iterators are notified of changes in the
+ * sequence that may affect their operation, e.g., if the container
+ * invalidates its iterators or is destructed. This class template
+ * may only be used by deriving from it and passing the name of the
+ * derived class as its template parameter via the curiously
+ * recurring template pattern. The derived class must have @c
+ * iterator and @const_iterator types that are instantiations of
+ * class template _Safe_iterator for this sequence. Iterators will
+ * then be tracked automatically.
+ */
+ template<typename _Sequence>
+ class _Safe_sequence : public _Safe_sequence_base
+ {
+ public:
+ /** Invalidates all iterators @c x that reference this sequence,
+ are not singular, and for which @c pred(x) returns @c
+ true. The user of this routine should be careful not to make
+ copies of the iterators passed to @p pred, as the copies may
+ interfere with the invalidation. */
+ template<typename _Predicate>
+ void
+ _M_invalidate_if(_Predicate __pred);
+
+ /** Transfers all iterators that reference this memory location
+ to this sequence from whatever sequence they are attached
+ to. */
+ template<typename _Iterator>
+ void
+ _M_transfer_iter(const _Safe_iterator<_Iterator, _Sequence>& __x);
+ };
+
+ template<typename _Sequence>
+ template<typename _Predicate>
+ void
+ _Safe_sequence<_Sequence>::
+ _M_invalidate_if(_Predicate __pred)
+ {
+ typedef typename _Sequence::iterator iterator;
+ typedef typename _Sequence::const_iterator const_iterator;
+
+ __gnu_cxx::__scoped_lock sentry(this->_M_get_mutex());
+ for (_Safe_iterator_base* __iter = _M_iterators; __iter;)
+ {
+ iterator* __victim = static_cast<iterator*>(__iter);
+ __iter = __iter->_M_next;
+ if (!__victim->_M_singular())
+ {
+ if (__pred(__victim->base()))
+ __victim->_M_invalidate_single();
+ }
+ }
+
+ for (_Safe_iterator_base* __iter2 = _M_const_iterators; __iter2;)
+ {
+ const_iterator* __victim = static_cast<const_iterator*>(__iter2);
+ __iter2 = __iter2->_M_next;
+ if (!__victim->_M_singular())
+ {
+ if (__pred(__victim->base()))
+ __victim->_M_invalidate_single();
+ }
+ }
+ }
+
+ template<typename _Sequence>
+ template<typename _Iterator>
+ void
+ _Safe_sequence<_Sequence>::
+ _M_transfer_iter(const _Safe_iterator<_Iterator, _Sequence>& __x)
+ {
+ _Safe_sequence_base* __from = __x._M_sequence;
+ if (!__from)
+ return;
+
+ typedef typename _Sequence::iterator iterator;
+ typedef typename _Sequence::const_iterator const_iterator;
+
+ __gnu_cxx::__scoped_lock sentry(this->_M_get_mutex());
+ for (_Safe_iterator_base* __iter = __from->_M_iterators; __iter;)
+ {
+ iterator* __victim = static_cast<iterator*>(__iter);
+ __iter = __iter->_M_next;
+ if (!__victim->_M_singular() && __victim->base() == __x.base())
+ __victim->_M_attach_single(static_cast<_Sequence*>(this));
+ }
+
+ for (_Safe_iterator_base* __iter2 = __from->_M_const_iterators;
+ __iter2;)
+ {
+ const_iterator* __victim = static_cast<const_iterator*>(__iter2);
+ __iter2 = __iter2->_M_next;
+ if (!__victim->_M_singular() && __victim->base() == __x.base())
+ __victim->_M_attach_single(static_cast<_Sequence*>(this));
+ }
+ }
+} // namespace __gnu_debug
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/debug/set b/i686-linux/include/c++/4.4.3/debug/set
new file mode 100644
index 0000000..34f3ea5
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/debug/set
@@ -0,0 +1,37 @@
+// Debugging set/multiset implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/set
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_SET
+#define _GLIBCXX_DEBUG_SET 1
+
+#include <set>
+#include <debug/set.h>
+#include <debug/multiset.h>
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/debug/set.h b/i686-linux/include/c++/4.4.3/debug/set.h
new file mode 100644
index 0000000..a025b3d
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/debug/set.h
@@ -0,0 +1,401 @@
+// Debugging set implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/set.h
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_SET_H
+#define _GLIBCXX_DEBUG_SET_H 1
+
+#include <debug/safe_sequence.h>
+#include <debug/safe_iterator.h>
+#include <utility>
+
+namespace std
+{
+namespace __debug
+{
+ template<typename _Key, typename _Compare = std::less<_Key>,
+ typename _Allocator = std::allocator<_Key> >
+ class set
+ : public _GLIBCXX_STD_D::set<_Key,_Compare,_Allocator>,
+ public __gnu_debug::_Safe_sequence<set<_Key, _Compare, _Allocator> >
+ {
+ typedef _GLIBCXX_STD_D::set<_Key, _Compare, _Allocator> _Base;
+ typedef __gnu_debug::_Safe_sequence<set> _Safe_base;
+
+ public:
+ // types:
+ typedef _Key key_type;
+ typedef _Key value_type;
+ typedef _Compare key_compare;
+ typedef _Compare value_compare;
+ typedef _Allocator allocator_type;
+ typedef typename _Base::reference reference;
+ typedef typename _Base::const_reference const_reference;
+
+ typedef __gnu_debug::_Safe_iterator<typename _Base::iterator, set>
+ iterator;
+ typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator, set>
+ const_iterator;
+
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::difference_type difference_type;
+ typedef typename _Base::pointer pointer;
+ typedef typename _Base::const_pointer const_pointer;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+
+ // 23.3.3.1 construct/copy/destroy:
+ explicit set(const _Compare& __comp = _Compare(),
+ const _Allocator& __a = _Allocator())
+ : _Base(__comp, __a) { }
+
+ template<typename _InputIterator>
+ set(_InputIterator __first, _InputIterator __last,
+ const _Compare& __comp = _Compare(),
+ const _Allocator& __a = _Allocator())
+ : _Base(__gnu_debug::__check_valid_range(__first, __last), __last,
+ __comp, __a) { }
+
+ set(const set& __x)
+ : _Base(__x), _Safe_base() { }
+
+ set(const _Base& __x)
+ : _Base(__x), _Safe_base() { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ set(set&& __x)
+ : _Base(std::forward<set>(__x)), _Safe_base()
+ { this->_M_swap(__x); }
+
+ set(initializer_list<value_type> __l,
+ const _Compare& __comp = _Compare(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __comp, __a), _Safe_base() { }
+#endif
+
+ ~set() { }
+
+ set&
+ operator=(const set& __x)
+ {
+ *static_cast<_Base*>(this) = __x;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ set&
+ operator=(set&& __x)
+ {
+ // NB: DR 675.
+ clear();
+ swap(__x);
+ return *this;
+ }
+
+ set&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l);
+ return *this;
+ }
+#endif
+
+ using _Base::get_allocator;
+
+ // iterators:
+ iterator
+ begin()
+ { return iterator(_Base::begin(), this); }
+
+ const_iterator
+ begin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ iterator
+ end()
+ { return iterator(_Base::end(), this); }
+
+ const_iterator
+ end() const
+ { return const_iterator(_Base::end(), this); }
+
+ reverse_iterator
+ rbegin()
+ { return reverse_iterator(end()); }
+
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(end()); }
+
+ reverse_iterator
+ rend()
+ { return reverse_iterator(begin()); }
+
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(begin()); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ const_iterator
+ cbegin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ const_iterator
+ cend() const
+ { return const_iterator(_Base::end(), this); }
+
+ const_reverse_iterator
+ crbegin() const
+ { return const_reverse_iterator(end()); }
+
+ const_reverse_iterator
+ crend() const
+ { return const_reverse_iterator(begin()); }
+#endif
+
+ // capacity:
+ using _Base::empty;
+ using _Base::size;
+ using _Base::max_size;
+
+ // modifiers:
+ std::pair<iterator, bool>
+ insert(const value_type& __x)
+ {
+ typedef typename _Base::iterator _Base_iterator;
+ std::pair<_Base_iterator, bool> __res = _Base::insert(__x);
+ return std::pair<iterator, bool>(iterator(__res.first, this),
+ __res.second);
+ }
+
+ iterator
+ insert(iterator __position, const value_type& __x)
+ {
+ __glibcxx_check_insert(__position);
+ return iterator(_Base::insert(__position.base(), __x), this);
+ }
+
+ template <typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::insert(__first, __last);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ insert(initializer_list<value_type> __l)
+ { _Base::insert(__l); }
+#endif
+
+ void
+ erase(iterator __position)
+ {
+ __glibcxx_check_erase(__position);
+ __position._M_invalidate();
+ _Base::erase(__position.base());
+ }
+
+ size_type
+ erase(const key_type& __x)
+ {
+ iterator __victim = find(__x);
+ if (__victim == end())
+ return 0;
+ else
+ {
+ __victim._M_invalidate();
+ _Base::erase(__victim.base());
+ return 1;
+ }
+ }
+
+ void
+ erase(iterator __first, iterator __last)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 151. can't currently clear() empty container
+ __glibcxx_check_erase_range(__first, __last);
+
+ while (__first != __last)
+ this->erase(__first++);
+ }
+
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(set&& __x)
+#else
+ swap(set& __x)
+#endif
+ {
+ _Base::swap(__x);
+ this->_M_swap(__x);
+ }
+
+ void
+ clear()
+ { this->erase(begin(), end()); }
+
+ // observers:
+ using _Base::key_comp;
+ using _Base::value_comp;
+
+ // set operations:
+ iterator
+ find(const key_type& __x)
+ { return iterator(_Base::find(__x), this); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 214. set::find() missing const overload
+ const_iterator
+ find(const key_type& __x) const
+ { return const_iterator(_Base::find(__x), this); }
+
+ using _Base::count;
+
+ iterator
+ lower_bound(const key_type& __x)
+ { return iterator(_Base::lower_bound(__x), this); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 214. set::find() missing const overload
+ const_iterator
+ lower_bound(const key_type& __x) const
+ { return const_iterator(_Base::lower_bound(__x), this); }
+
+ iterator
+ upper_bound(const key_type& __x)
+ { return iterator(_Base::upper_bound(__x), this); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 214. set::find() missing const overload
+ const_iterator
+ upper_bound(const key_type& __x) const
+ { return const_iterator(_Base::upper_bound(__x), this); }
+
+ std::pair<iterator,iterator>
+ equal_range(const key_type& __x)
+ {
+ typedef typename _Base::iterator _Base_iterator;
+ std::pair<_Base_iterator, _Base_iterator> __res =
+ _Base::equal_range(__x);
+ return std::make_pair(iterator(__res.first, this),
+ iterator(__res.second, this));
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 214. set::find() missing const overload
+ std::pair<const_iterator,const_iterator>
+ equal_range(const key_type& __x) const
+ {
+ typedef typename _Base::const_iterator _Base_iterator;
+ std::pair<_Base_iterator, _Base_iterator> __res =
+ _Base::equal_range(__x);
+ return std::make_pair(const_iterator(__res.first, this),
+ const_iterator(__res.second, this));
+ }
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+
+ private:
+ void
+ _M_invalidate_all()
+ {
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
+ this->_M_invalidate_if(_Not_equal(_M_base().end()));
+ }
+ };
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ inline bool
+ operator==(const set<_Key, _Compare, _Allocator>& __lhs,
+ const set<_Key, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() == __rhs._M_base(); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ inline bool
+ operator!=(const set<_Key, _Compare, _Allocator>& __lhs,
+ const set<_Key, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() != __rhs._M_base(); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ inline bool
+ operator<(const set<_Key, _Compare, _Allocator>& __lhs,
+ const set<_Key, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() < __rhs._M_base(); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ inline bool
+ operator<=(const set<_Key, _Compare, _Allocator>& __lhs,
+ const set<_Key, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() <= __rhs._M_base(); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ inline bool
+ operator>=(const set<_Key, _Compare, _Allocator>& __lhs,
+ const set<_Key, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() >= __rhs._M_base(); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ inline bool
+ operator>(const set<_Key, _Compare, _Allocator>& __lhs,
+ const set<_Key, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() > __rhs._M_base(); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ void
+ swap(set<_Key, _Compare, _Allocator>& __x,
+ set<_Key, _Compare, _Allocator>& __y)
+ { return __x.swap(__y); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Key, typename _Compare, typename _Allocator>
+ void
+ swap(set<_Key, _Compare, _Allocator>&& __x,
+ set<_Key, _Compare, _Allocator>& __y)
+ { return __x.swap(__y); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ void
+ swap(set<_Key, _Compare, _Allocator>& __x,
+ set<_Key, _Compare, _Allocator>&& __y)
+ { return __x.swap(__y); }
+#endif
+
+} // namespace __debug
+} // namespace std
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/debug/string b/i686-linux/include/c++/4.4.3/debug/string
new file mode 100644
index 0000000..d88989a
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/debug/string
@@ -0,0 +1,1074 @@
+// Debugging string implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2005, 2006, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/string
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_STRING
+#define _GLIBCXX_DEBUG_STRING 1
+
+#include <string>
+#include <debug/safe_sequence.h>
+#include <debug/safe_iterator.h>
+
+namespace __gnu_debug
+{
+ template<typename _CharT, typename _Traits = std::char_traits<_CharT>,
+ typename _Allocator = std::allocator<_CharT> >
+ class basic_string
+ : public std::basic_string<_CharT, _Traits, _Allocator>,
+ public __gnu_debug::_Safe_sequence<basic_string<_CharT, _Traits,
+ _Allocator> >
+ {
+ typedef std::basic_string<_CharT, _Traits, _Allocator> _Base;
+ typedef __gnu_debug::_Safe_sequence<basic_string> _Safe_base;
+
+ public:
+ // types:
+ typedef _Traits traits_type;
+ typedef typename _Traits::char_type value_type;
+ typedef _Allocator allocator_type;
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::difference_type difference_type;
+ typedef typename _Base::reference reference;
+ typedef typename _Base::const_reference const_reference;
+ typedef typename _Base::pointer pointer;
+ typedef typename _Base::const_pointer const_pointer;
+
+ typedef __gnu_debug::_Safe_iterator<typename _Base::iterator, basic_string>
+ iterator;
+ typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator,
+ basic_string> const_iterator;
+
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+
+ using _Base::npos;
+
+ // 21.3.1 construct/copy/destroy:
+ explicit basic_string(const _Allocator& __a = _Allocator())
+ : _Base(__a)
+ { }
+
+ // Provides conversion from a release-mode string to a debug-mode string
+ basic_string(const _Base& __base) : _Base(__base), _Safe_base() { }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 42. string ctors specify wrong default allocator
+ basic_string(const basic_string& __str)
+ : _Base(__str, 0, _Base::npos, __str.get_allocator()), _Safe_base()
+ { }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 42. string ctors specify wrong default allocator
+ basic_string(const basic_string& __str, size_type __pos,
+ size_type __n = _Base::npos,
+ const _Allocator& __a = _Allocator())
+ : _Base(__str, __pos, __n, __a)
+ { }
+
+ basic_string(const _CharT* __s, size_type __n,
+ const _Allocator& __a = _Allocator())
+ : _Base(__gnu_debug::__check_string(__s, __n), __n, __a)
+ { }
+
+ basic_string(const _CharT* __s, const _Allocator& __a = _Allocator())
+ : _Base(__gnu_debug::__check_string(__s), __a)
+ { this->assign(__s); }
+
+ basic_string(size_type __n, _CharT __c,
+ const _Allocator& __a = _Allocator())
+ : _Base(__n, __c, __a)
+ { }
+
+ template<typename _InputIterator>
+ basic_string(_InputIterator __begin, _InputIterator __end,
+ const _Allocator& __a = _Allocator())
+ : _Base(__gnu_debug::__check_valid_range(__begin, __end), __end, __a)
+ { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
+ : _Base(__l, __a)
+ { }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+ ~basic_string() { }
+
+ basic_string&
+ operator=(const basic_string& __str)
+ {
+ *static_cast<_Base*>(this) = __str;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ operator=(const _CharT* __s)
+ {
+ __glibcxx_check_string(__s);
+ *static_cast<_Base*>(this) = __s;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ operator=(_CharT __c)
+ {
+ *static_cast<_Base*>(this) = __c;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ basic_string&
+ operator=(initializer_list<_CharT> __l)
+ {
+ *static_cast<_Base*>(this) = __l;
+ this->_M_invalidate_all();
+ return *this;
+ }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+ // 21.3.2 iterators:
+ iterator
+ begin()
+ { return iterator(_Base::begin(), this); }
+
+ const_iterator
+ begin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ iterator
+ end()
+ { return iterator(_Base::end(), this); }
+
+ const_iterator
+ end() const
+ { return const_iterator(_Base::end(), this); }
+
+ reverse_iterator
+ rbegin()
+ { return reverse_iterator(end()); }
+
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(end()); }
+
+ reverse_iterator
+ rend()
+ { return reverse_iterator(begin()); }
+
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(begin()); }
+
+ // 21.3.3 capacity:
+ using _Base::size;
+ using _Base::length;
+ using _Base::max_size;
+
+ void
+ resize(size_type __n, _CharT __c)
+ {
+ _Base::resize(__n, __c);
+ this->_M_invalidate_all();
+ }
+
+ void
+ resize(size_type __n)
+ { this->resize(__n, _CharT()); }
+
+ using _Base::capacity;
+ using _Base::reserve;
+
+ void
+ clear()
+ {
+ _Base::clear();
+ this->_M_invalidate_all();
+ }
+
+ using _Base::empty;
+
+ // 21.3.4 element access:
+ const_reference
+ operator[](size_type __pos) const
+ {
+ _GLIBCXX_DEBUG_VERIFY(__pos <= this->size(),
+ _M_message(__gnu_debug::__msg_subscript_oob)
+ ._M_sequence(*this, "this")
+ ._M_integer(__pos, "__pos")
+ ._M_integer(this->size(), "size"));
+ return _M_base()[__pos];
+ }
+
+ reference
+ operator[](size_type __pos)
+ {
+#ifdef _GLIBCXX_DEBUG_PEDANTIC
+ __glibcxx_check_subscript(__pos);
+#else
+ // as an extension v3 allows s[s.size()] when s is non-const.
+ _GLIBCXX_DEBUG_VERIFY(__pos <= this->size(),
+ _M_message(__gnu_debug::__msg_subscript_oob)
+ ._M_sequence(*this, "this")
+ ._M_integer(__pos, "__pos")
+ ._M_integer(this->size(), "size"));
+#endif
+ return _M_base()[__pos];
+ }
+
+ using _Base::at;
+
+ // 21.3.5 modifiers:
+ basic_string&
+ operator+=(const basic_string& __str)
+ {
+ _M_base() += __str;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ operator+=(const _CharT* __s)
+ {
+ __glibcxx_check_string(__s);
+ _M_base() += __s;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ operator+=(_CharT __c)
+ {
+ _M_base() += __c;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ basic_string&
+ operator+=(initializer_list<_CharT> __l)
+ {
+ _M_base() += __l;
+ this->_M_invalidate_all();
+ return *this;
+ }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+ basic_string&
+ append(const basic_string& __str)
+ {
+ _Base::append(__str);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ append(const basic_string& __str, size_type __pos, size_type __n)
+ {
+ _Base::append(__str, __pos, __n);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ append(const _CharT* __s, size_type __n)
+ {
+ __glibcxx_check_string_len(__s, __n);
+ _Base::append(__s, __n);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ append(const _CharT* __s)
+ {
+ __glibcxx_check_string(__s);
+ _Base::append(__s);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ append(size_type __n, _CharT __c)
+ {
+ _Base::append(__n, __c);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ template<typename _InputIterator>
+ basic_string&
+ append(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::append(__first, __last);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 7. string clause minor problems
+ void
+ push_back(_CharT __c)
+ {
+ _Base::push_back(__c);
+ this->_M_invalidate_all();
+ }
+
+ basic_string&
+ assign(const basic_string& __x)
+ {
+ _Base::assign(__x);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ assign(const basic_string& __str, size_type __pos, size_type __n)
+ {
+ _Base::assign(__str, __pos, __n);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ assign(const _CharT* __s, size_type __n)
+ {
+ __glibcxx_check_string_len(__s, __n);
+ _Base::assign(__s, __n);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ assign(const _CharT* __s)
+ {
+ __glibcxx_check_string(__s);
+ _Base::assign(__s);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ assign(size_type __n, _CharT __c)
+ {
+ _Base::assign(__n, __c);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ template<typename _InputIterator>
+ basic_string&
+ assign(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::assign(__first, __last);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ basic_string&
+ assign(initializer_list<_CharT> __l)
+ {
+ _Base::assign(__l);
+ this->_M_invalidate_all();
+ return *this;
+ }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+ basic_string&
+ insert(size_type __pos1, const basic_string& __str)
+ {
+ _Base::insert(__pos1, __str);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ insert(size_type __pos1, const basic_string& __str,
+ size_type __pos2, size_type __n)
+ {
+ _Base::insert(__pos1, __str, __pos2, __n);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ insert(size_type __pos, const _CharT* __s, size_type __n)
+ {
+ __glibcxx_check_string(__s);
+ _Base::insert(__pos, __s, __n);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ insert(size_type __pos, const _CharT* __s)
+ {
+ __glibcxx_check_string(__s);
+ _Base::insert(__pos, __s);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ insert(size_type __pos, size_type __n, _CharT __c)
+ {
+ _Base::insert(__pos, __n, __c);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ iterator
+ insert(iterator __p, _CharT __c)
+ {
+ __glibcxx_check_insert(__p);
+ typename _Base::iterator __res = _Base::insert(__p.base(), __c);
+ this->_M_invalidate_all();
+ return iterator(__res, this);
+ }
+
+ void
+ insert(iterator __p, size_type __n, _CharT __c)
+ {
+ __glibcxx_check_insert(__p);
+ _Base::insert(__p.base(), __n, __c);
+ this->_M_invalidate_all();
+ }
+
+ template<typename _InputIterator>
+ void
+ insert(iterator __p, _InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_insert_range(__p, __first, __last);
+ _Base::insert(__p.base(), __first, __last);
+ this->_M_invalidate_all();
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ insert(iterator __p, initializer_list<_CharT> __l)
+ {
+ _Base::insert(__p, __l);
+ this->_M_invalidate_all();
+ }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+ basic_string&
+ erase(size_type __pos = 0, size_type __n = _Base::npos)
+ {
+ _Base::erase(__pos, __n);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ iterator
+ erase(iterator __position)
+ {
+ __glibcxx_check_erase(__position);
+ typename _Base::iterator __res = _Base::erase(__position.base());
+ this->_M_invalidate_all();
+ return iterator(__res, this);
+ }
+
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 151. can't currently clear() empty container
+ __glibcxx_check_erase_range(__first, __last);
+ typename _Base::iterator __res = _Base::erase(__first.base(),
+ __last.base());
+ this->_M_invalidate_all();
+ return iterator(__res, this);
+ }
+
+ basic_string&
+ replace(size_type __pos1, size_type __n1, const basic_string& __str)
+ {
+ _Base::replace(__pos1, __n1, __str);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ replace(size_type __pos1, size_type __n1, const basic_string& __str,
+ size_type __pos2, size_type __n2)
+ {
+ _Base::replace(__pos1, __n1, __str, __pos2, __n2);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ replace(size_type __pos, size_type __n1, const _CharT* __s,
+ size_type __n2)
+ {
+ __glibcxx_check_string_len(__s, __n2);
+ _Base::replace(__pos, __n1, __s, __n2);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ replace(size_type __pos, size_type __n1, const _CharT* __s)
+ {
+ __glibcxx_check_string(__s);
+ _Base::replace(__pos, __n1, __s);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c)
+ {
+ _Base::replace(__pos, __n1, __n2, __c);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ replace(iterator __i1, iterator __i2, const basic_string& __str)
+ {
+ __glibcxx_check_erase_range(__i1, __i2);
+ _Base::replace(__i1.base(), __i2.base(), __str);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ replace(iterator __i1, iterator __i2, const _CharT* __s, size_type __n)
+ {
+ __glibcxx_check_erase_range(__i1, __i2);
+ __glibcxx_check_string_len(__s, __n);
+ _Base::replace(__i1.base(), __i2.base(), __s, __n);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ replace(iterator __i1, iterator __i2, const _CharT* __s)
+ {
+ __glibcxx_check_erase_range(__i1, __i2);
+ __glibcxx_check_string(__s);
+ _Base::replace(__i1.base(), __i2.base(), __s);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ replace(iterator __i1, iterator __i2, size_type __n, _CharT __c)
+ {
+ __glibcxx_check_erase_range(__i1, __i2);
+ _Base::replace(__i1.base(), __i2.base(), __n, __c);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ template<typename _InputIterator>
+ basic_string&
+ replace(iterator __i1, iterator __i2,
+ _InputIterator __j1, _InputIterator __j2)
+ {
+ __glibcxx_check_erase_range(__i1, __i2);
+ __glibcxx_check_valid_range(__j1, __j2);
+ _Base::replace(__i1.base(), __i2.base(), __j1, __j2);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ basic_string& replace(iterator __i1, iterator __i2,
+ initializer_list<_CharT> __l)
+ {
+ __glibcxx_check_erase_range(__i1, __i2);
+ _Base::replace(__i1.base(), __i2.base(), __l);
+ this->_M_invalidate_all();
+ return *this;
+ }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+ size_type
+ copy(_CharT* __s, size_type __n, size_type __pos = 0) const
+ {
+ __glibcxx_check_string_len(__s, __n);
+ return _Base::copy(__s, __n, __pos);
+ }
+
+ void
+ swap(basic_string<_CharT,_Traits,_Allocator>& __x)
+ {
+ _Base::swap(__x);
+ this->_M_swap(__x);
+ this->_M_invalidate_all();
+ __x._M_invalidate_all();
+ }
+
+ // 21.3.6 string operations:
+ const _CharT*
+ c_str() const
+ {
+ const _CharT* __res = _Base::c_str();
+ this->_M_invalidate_all();
+ return __res;
+ }
+
+ const _CharT*
+ data() const
+ {
+ const _CharT* __res = _Base::data();
+ this->_M_invalidate_all();
+ return __res;
+ }
+
+ using _Base::get_allocator;
+
+ size_type
+ find(const basic_string& __str, size_type __pos = 0) const
+ { return _Base::find(__str, __pos); }
+
+ size_type
+ find(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_check_string(__s);
+ return _Base::find(__s, __pos, __n);
+ }
+
+ size_type
+ find(const _CharT* __s, size_type __pos = 0) const
+ {
+ __glibcxx_check_string(__s);
+ return _Base::find(__s, __pos);
+ }
+
+ size_type
+ find(_CharT __c, size_type __pos = 0) const
+ { return _Base::find(__c, __pos); }
+
+ size_type
+ rfind(const basic_string& __str, size_type __pos = _Base::npos) const
+ { return _Base::rfind(__str, __pos); }
+
+ size_type
+ rfind(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_check_string_len(__s, __n);
+ return _Base::rfind(__s, __pos, __n);
+ }
+
+ size_type
+ rfind(const _CharT* __s, size_type __pos = _Base::npos) const
+ {
+ __glibcxx_check_string(__s);
+ return _Base::rfind(__s, __pos);
+ }
+
+ size_type
+ rfind(_CharT __c, size_type __pos = _Base::npos) const
+ { return _Base::rfind(__c, __pos); }
+
+ size_type
+ find_first_of(const basic_string& __str, size_type __pos = 0) const
+ { return _Base::find_first_of(__str, __pos); }
+
+ size_type
+ find_first_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_check_string(__s);
+ return _Base::find_first_of(__s, __pos, __n);
+ }
+
+ size_type
+ find_first_of(const _CharT* __s, size_type __pos = 0) const
+ {
+ __glibcxx_check_string(__s);
+ return _Base::find_first_of(__s, __pos);
+ }
+
+ size_type
+ find_first_of(_CharT __c, size_type __pos = 0) const
+ { return _Base::find_first_of(__c, __pos); }
+
+ size_type
+ find_last_of(const basic_string& __str,
+ size_type __pos = _Base::npos) const
+ { return _Base::find_last_of(__str, __pos); }
+
+ size_type
+ find_last_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_check_string(__s);
+ return _Base::find_last_of(__s, __pos, __n);
+ }
+
+ size_type
+ find_last_of(const _CharT* __s, size_type __pos = _Base::npos) const
+ {
+ __glibcxx_check_string(__s);
+ return _Base::find_last_of(__s, __pos);
+ }
+
+ size_type
+ find_last_of(_CharT __c, size_type __pos = _Base::npos) const
+ { return _Base::find_last_of(__c, __pos); }
+
+ size_type
+ find_first_not_of(const basic_string& __str, size_type __pos = 0) const
+ { return _Base::find_first_not_of(__str, __pos); }
+
+ size_type
+ find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_check_string_len(__s, __n);
+ return _Base::find_first_not_of(__s, __pos, __n);
+ }
+
+ size_type
+ find_first_not_of(const _CharT* __s, size_type __pos = 0) const
+ {
+ __glibcxx_check_string(__s);
+ return _Base::find_first_not_of(__s, __pos);
+ }
+
+ size_type
+ find_first_not_of(_CharT __c, size_type __pos = 0) const
+ { return _Base::find_first_not_of(__c, __pos); }
+
+ size_type
+ find_last_not_of(const basic_string& __str,
+ size_type __pos = _Base::npos) const
+ { return _Base::find_last_not_of(__str, __pos); }
+
+ size_type
+ find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_check_string(__s);
+ return _Base::find_last_not_of(__s, __pos, __n);
+ }
+
+ size_type
+ find_last_not_of(const _CharT* __s, size_type __pos = _Base::npos) const
+ {
+ __glibcxx_check_string(__s);
+ return _Base::find_last_not_of(__s, __pos);
+ }
+
+ size_type
+ find_last_not_of(_CharT __c, size_type __pos = _Base::npos) const
+ { return _Base::find_last_not_of(__c, __pos); }
+
+ basic_string
+ substr(size_type __pos = 0, size_type __n = _Base::npos) const
+ { return basic_string(_Base::substr(__pos, __n)); }
+
+ int
+ compare(const basic_string& __str) const
+ { return _Base::compare(__str); }
+
+ int
+ compare(size_type __pos1, size_type __n1,
+ const basic_string& __str) const
+ { return _Base::compare(__pos1, __n1, __str); }
+
+ int
+ compare(size_type __pos1, size_type __n1, const basic_string& __str,
+ size_type __pos2, size_type __n2) const
+ { return _Base::compare(__pos1, __n1, __str, __pos2, __n2); }
+
+ int
+ compare(const _CharT* __s) const
+ {
+ __glibcxx_check_string(__s);
+ return _Base::compare(__s);
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 5. string::compare specification questionable
+ int
+ compare(size_type __pos1, size_type __n1, const _CharT* __s) const
+ {
+ __glibcxx_check_string(__s);
+ return _Base::compare(__pos1, __n1, __s);
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 5. string::compare specification questionable
+ int
+ compare(size_type __pos1, size_type __n1,const _CharT* __s,
+ size_type __n2) const
+ {
+ __glibcxx_check_string_len(__s, __n2);
+ return _Base::compare(__pos1, __n1, __s, __n2);
+ }
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+
+ using _Safe_base::_M_invalidate_all;
+ };
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline basic_string<_CharT,_Traits,_Allocator>
+ operator+(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ { return basic_string<_CharT,_Traits,_Allocator>(__lhs) += __rhs; }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline basic_string<_CharT,_Traits,_Allocator>
+ operator+(const _CharT* __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ {
+ __glibcxx_check_string(__lhs);
+ return basic_string<_CharT,_Traits,_Allocator>(__lhs) += __rhs;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline basic_string<_CharT,_Traits,_Allocator>
+ operator+(_CharT __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ { return basic_string<_CharT,_Traits,_Allocator>(1, __lhs) += __rhs; }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline basic_string<_CharT,_Traits,_Allocator>
+ operator+(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const _CharT* __rhs)
+ {
+ __glibcxx_check_string(__rhs);
+ return basic_string<_CharT,_Traits,_Allocator>(__lhs) += __rhs;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline basic_string<_CharT,_Traits,_Allocator>
+ operator+(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ _CharT __rhs)
+ { return basic_string<_CharT,_Traits,_Allocator>(__lhs) += __rhs; }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator==(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ { return __lhs._M_base() == __rhs._M_base(); }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator==(const _CharT* __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ {
+ __glibcxx_check_string(__lhs);
+ return __lhs == __rhs._M_base();
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator==(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const _CharT* __rhs)
+ {
+ __glibcxx_check_string(__rhs);
+ return __lhs._M_base() == __rhs;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator!=(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ { return __lhs._M_base() != __rhs._M_base(); }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator!=(const _CharT* __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ {
+ __glibcxx_check_string(__lhs);
+ return __lhs != __rhs._M_base();
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator!=(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const _CharT* __rhs)
+ {
+ __glibcxx_check_string(__rhs);
+ return __lhs._M_base() != __rhs;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator<(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ { return __lhs._M_base() < __rhs._M_base(); }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator<(const _CharT* __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ {
+ __glibcxx_check_string(__lhs);
+ return __lhs < __rhs._M_base();
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator<(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const _CharT* __rhs)
+ {
+ __glibcxx_check_string(__rhs);
+ return __lhs._M_base() < __rhs;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator<=(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ { return __lhs._M_base() <= __rhs._M_base(); }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator<=(const _CharT* __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ {
+ __glibcxx_check_string(__lhs);
+ return __lhs <= __rhs._M_base();
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator<=(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const _CharT* __rhs)
+ {
+ __glibcxx_check_string(__rhs);
+ return __lhs._M_base() <= __rhs;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator>=(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ { return __lhs._M_base() >= __rhs._M_base(); }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator>=(const _CharT* __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ {
+ __glibcxx_check_string(__lhs);
+ return __lhs >= __rhs._M_base();
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator>=(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const _CharT* __rhs)
+ {
+ __glibcxx_check_string(__rhs);
+ return __lhs._M_base() >= __rhs;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator>(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ { return __lhs._M_base() > __rhs._M_base(); }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator>(const _CharT* __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ {
+ __glibcxx_check_string(__lhs);
+ return __lhs > __rhs._M_base();
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator>(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const _CharT* __rhs)
+ {
+ __glibcxx_check_string(__rhs);
+ return __lhs._M_base() > __rhs;
+ }
+
+ // 21.3.7.8:
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline void
+ swap(basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ { __lhs.swap(__rhs); }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const basic_string<_CharT, _Traits, _Allocator>& __str)
+ { return __os << __str._M_base(); }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ std::basic_istream<_CharT,_Traits>&
+ operator>>(std::basic_istream<_CharT,_Traits>& __is,
+ basic_string<_CharT,_Traits,_Allocator>& __str)
+ {
+ std::basic_istream<_CharT,_Traits>& __res = __is >> __str._M_base();
+ __str._M_invalidate_all();
+ return __res;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ std::basic_istream<_CharT,_Traits>&
+ getline(std::basic_istream<_CharT,_Traits>& __is,
+ basic_string<_CharT,_Traits,_Allocator>& __str, _CharT __delim)
+ {
+ std::basic_istream<_CharT,_Traits>& __res = getline(__is,
+ __str._M_base(),
+ __delim);
+ __str._M_invalidate_all();
+ return __res;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ std::basic_istream<_CharT,_Traits>&
+ getline(std::basic_istream<_CharT,_Traits>& __is,
+ basic_string<_CharT,_Traits,_Allocator>& __str)
+ {
+ std::basic_istream<_CharT,_Traits>& __res = getline(__is,
+ __str._M_base());
+ __str._M_invalidate_all();
+ return __res;
+ }
+
+ typedef basic_string<char> string;
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ typedef basic_string<wchar_t> wstring;
+#endif
+
+} // namespace __gnu_debug
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/debug/unordered_map b/i686-linux/include/c++/4.4.3/debug/unordered_map
new file mode 100644
index 0000000..fd7c31e
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/debug/unordered_map
@@ -0,0 +1,608 @@
+// Debugging unordered_map/unordered_multimap implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/unordered_map
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_UNORDERED_MAP
+#define _GLIBCXX_DEBUG_UNORDERED_MAP 1
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# include <unordered_map>
+#else
+# include <c++0x_warning.h>
+#endif
+
+#include <debug/safe_sequence.h>
+#include <debug/safe_iterator.h>
+#include <initializer_list>
+
+namespace std
+{
+namespace __debug
+{
+ template<typename _Key, typename _Tp,
+ typename _Hash = std::hash<_Key>,
+ typename _Pred = std::equal_to<_Key>,
+ typename _Alloc = std::allocator<_Key> >
+ class unordered_map
+ : public _GLIBCXX_STD_D::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>,
+ public __gnu_debug::_Safe_sequence<unordered_map<_Key, _Tp, _Hash,
+ _Pred, _Alloc> >
+ {
+ typedef _GLIBCXX_STD_D::unordered_map<_Key, _Tp, _Hash,
+ _Pred, _Alloc> _Base;
+ typedef __gnu_debug::_Safe_sequence<unordered_map> _Safe_base;
+
+ public:
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::hasher hasher;
+ typedef typename _Base::key_equal key_equal;
+ typedef typename _Base::allocator_type allocator_type;
+
+ typedef typename _Base::key_type key_type;
+ typedef typename _Base::value_type value_type;
+
+ typedef __gnu_debug::_Safe_iterator<typename _Base::iterator,
+ unordered_map> iterator;
+ typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator,
+ unordered_map> const_iterator;
+
+ explicit
+ unordered_map(size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__n, __hf, __eql, __a) { }
+
+ template<typename _InputIterator>
+ unordered_map(_InputIterator __f, _InputIterator __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__gnu_debug::__check_valid_range(__f, __l), __l, __n,
+ __hf, __eql, __a), _Safe_base() { }
+
+ unordered_map(const unordered_map& __x)
+ : _Base(__x), _Safe_base() { }
+
+ unordered_map(const _Base& __x)
+ : _Base(__x), _Safe_base() { }
+
+ unordered_map(unordered_map&& __x)
+ : _Base(std::forward<unordered_map>(__x)), _Safe_base() { }
+
+ unordered_map(initializer_list<value_type> __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __n, __hf, __eql, __a), _Safe_base() { }
+
+ unordered_map&
+ operator=(const unordered_map& __x)
+ {
+ *static_cast<_Base*>(this) = __x;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ unordered_map&
+ operator=(unordered_map&& __x)
+ {
+ // NB: DR 675.
+ clear();
+ swap(__x);
+ return *this;
+ }
+
+ unordered_map&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l);
+ return *this;
+ }
+
+ void
+ swap(unordered_map&& __x)
+ {
+ _Base::swap(__x);
+ _Safe_base::_M_swap(__x);
+ }
+
+ void
+ clear()
+ {
+ _Base::clear();
+ this->_M_invalidate_all();
+ }
+
+ iterator
+ begin()
+ { return iterator(_Base::begin(), this); }
+
+ const_iterator
+ begin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ iterator
+ end()
+ { return iterator(_Base::end(), this); }
+
+ const_iterator
+ end() const
+ { return const_iterator(_Base::end(), this); }
+
+ const_iterator
+ cbegin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ const_iterator
+ cend() const
+ { return const_iterator(_Base::end(), this); }
+
+ // local versions
+ using _Base::begin;
+ using _Base::end;
+ using _Base::cbegin;
+ using _Base::cend;
+
+ std::pair<iterator, bool>
+ insert(const value_type& __obj)
+ {
+ typedef std::pair<typename _Base::iterator, bool> __pair_type;
+ __pair_type __res = _Base::insert(__obj);
+ return std::make_pair(iterator(__res.first, this), __res.second);
+ }
+
+ iterator
+ insert(iterator, const value_type& __obj)
+ {
+ typedef std::pair<typename _Base::iterator, bool> __pair_type;
+ __pair_type __res = _Base::insert(__obj);
+ return iterator(__res.first, this);
+ }
+
+ const_iterator
+ insert(const_iterator, const value_type& __obj)
+ {
+ typedef std::pair<typename _Base::iterator, bool> __pair_type;
+ __pair_type __res = _Base::insert(__obj);
+ return const_iterator(__res.first, this);
+ }
+
+ void
+ insert(std::initializer_list<value_type> __l)
+ { _Base::insert(__l); }
+
+ template<typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::insert(__first, __last);
+ }
+
+ iterator
+ find(const key_type& __key)
+ { return iterator(_Base::find(__key), this); }
+
+ const_iterator
+ find(const key_type& __key) const
+ { return const_iterator(_Base::find(__key), this); }
+
+ std::pair<iterator, iterator>
+ equal_range(const key_type& __key)
+ {
+ typedef typename _Base::iterator _Base_iterator;
+ typedef std::pair<_Base_iterator, _Base_iterator> __pair_type;
+ __pair_type __res = _Base::equal_range(__key);
+ return std::make_pair(iterator(__res.first, this),
+ iterator(__res.second, this));
+ }
+
+ std::pair<const_iterator, const_iterator>
+ equal_range(const key_type& __key) const
+ {
+ typedef typename _Base::const_iterator _Base_iterator;
+ typedef std::pair<_Base_iterator, _Base_iterator> __pair_type;
+ __pair_type __res = _Base::equal_range(__key);
+ return std::make_pair(const_iterator(__res.first, this),
+ const_iterator(__res.second, this));
+ }
+
+ size_type
+ erase(const key_type& __key)
+ {
+ size_type __ret(0);
+ iterator __victim(_Base::find(__key), this);
+ if (__victim != end())
+ {
+ this->erase(__victim);
+ __ret = 1;
+ }
+ return __ret;
+ }
+
+ iterator
+ erase(iterator __it)
+ {
+ __glibcxx_check_erase(__it);
+ __it._M_invalidate();
+ return iterator(_Base::erase(__it.base()), this);
+ }
+
+ const_iterator
+ erase(const_iterator __it)
+ {
+ __glibcxx_check_erase(__it);
+ __it._M_invalidate();
+ return const_iterator(_Base::erase(__it.base()), this);
+ }
+
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ __glibcxx_check_erase_range(__first, __last);
+ for (iterator __tmp = __first; __tmp != __last;)
+ {
+ iterator __victim = __tmp++;
+ __victim._M_invalidate();
+ }
+ return iterator(_Base::erase(__first.base(),
+ __last.base()), this);
+ }
+
+ const_iterator
+ erase(const_iterator __first, const_iterator __last)
+ {
+ __glibcxx_check_erase_range(__first, __last);
+ for (const_iterator __tmp = __first; __tmp != __last;)
+ {
+ const_iterator __victim = __tmp++;
+ __victim._M_invalidate();
+ }
+ return const_iterator(_Base::erase(__first.base(),
+ __last.base()), this);
+ }
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+
+ private:
+ void
+ _M_invalidate_all()
+ {
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
+ this->_M_invalidate_if(_Not_equal(_M_base().end()));
+ }
+ };
+
+ template<typename _Key, typename _Tp, typename _Hash,
+ typename _Pred, typename _Alloc>
+ inline void
+ swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
+ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Key, typename _Tp, typename _Hash,
+ typename _Pred, typename _Alloc>
+ inline void
+ swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&& __x,
+ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Key, typename _Tp, typename _Hash,
+ typename _Pred, typename _Alloc>
+ inline void
+ swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
+ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&& __y)
+ { __x.swap(__y); }
+
+
+ template<typename _Key, typename _Tp,
+ typename _Hash = std::hash<_Key>,
+ typename _Pred = std::equal_to<_Key>,
+ typename _Alloc = std::allocator<_Key> >
+ class unordered_multimap
+ : public _GLIBCXX_STD_D::unordered_multimap<_Key, _Tp, _Hash,
+ _Pred, _Alloc>,
+ public __gnu_debug::_Safe_sequence<unordered_multimap<_Key, _Tp, _Hash,
+ _Pred, _Alloc> >
+ {
+ typedef _GLIBCXX_STD_D::unordered_multimap<_Key, _Tp, _Hash,
+ _Pred, _Alloc> _Base;
+ typedef __gnu_debug::_Safe_sequence<unordered_multimap> _Safe_base;
+
+ public:
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::hasher hasher;
+ typedef typename _Base::key_equal key_equal;
+ typedef typename _Base::allocator_type allocator_type;
+
+ typedef typename _Base::key_type key_type;
+ typedef typename _Base::value_type value_type;
+
+ typedef __gnu_debug::_Safe_iterator<typename _Base::iterator,
+ unordered_multimap> iterator;
+ typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator,
+ unordered_multimap> const_iterator;
+
+ explicit
+ unordered_multimap(size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__n, __hf, __eql, __a) { }
+
+ template<typename _InputIterator>
+ unordered_multimap(_InputIterator __f, _InputIterator __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__gnu_debug::__check_valid_range(__f, __l), __l, __n,
+ __hf, __eql, __a), _Safe_base() { }
+
+ unordered_multimap(const unordered_multimap& __x)
+ : _Base(__x), _Safe_base() { }
+
+ unordered_multimap(const _Base& __x)
+ : _Base(__x), _Safe_base() { }
+
+ unordered_multimap(unordered_multimap&& __x)
+ : _Base(std::forward<unordered_multimap>(__x)), _Safe_base() { }
+
+ unordered_multimap(initializer_list<value_type> __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __n, __hf, __eql, __a), _Safe_base() { }
+
+ unordered_multimap&
+ operator=(const unordered_multimap& __x)
+ {
+ *static_cast<_Base*>(this) = __x;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ unordered_multimap&
+ operator=(unordered_multimap&& __x)
+ {
+ // NB: DR 675.
+ clear();
+ swap(__x);
+ return *this;
+ }
+
+ unordered_multimap&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l);
+ return *this;
+ }
+
+ void
+ swap(unordered_multimap&& __x)
+ {
+ _Base::swap(__x);
+ _Safe_base::_M_swap(__x);
+ }
+
+ void
+ clear()
+ {
+ _Base::clear();
+ this->_M_invalidate_all();
+ }
+
+ iterator
+ begin()
+ { return iterator(_Base::begin(), this); }
+
+ const_iterator
+ begin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ iterator
+ end()
+ { return iterator(_Base::end(), this); }
+
+ const_iterator
+ end() const
+ { return const_iterator(_Base::end(), this); }
+
+ const_iterator
+ cbegin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ const_iterator
+ cend() const
+ { return const_iterator(_Base::end(), this); }
+
+ // local versions
+ using _Base::begin;
+ using _Base::end;
+ using _Base::cbegin;
+ using _Base::cend;
+
+ iterator
+ insert(const value_type& __obj)
+ { return iterator(_Base::insert(__obj), this); }
+
+ iterator
+ insert(iterator, const value_type& __obj)
+ { return iterator(_Base::insert(__obj), this); }
+
+ const_iterator
+ insert(const_iterator, const value_type& __obj)
+ { return const_iterator(_Base::insert(__obj), this); }
+
+ void
+ insert(std::initializer_list<value_type> __l)
+ { _Base::insert(__l); }
+
+ template<typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::insert(__first, __last);
+ }
+
+ iterator
+ find(const key_type& __key)
+ { return iterator(_Base::find(__key), this); }
+
+ const_iterator
+ find(const key_type& __key) const
+ { return const_iterator(_Base::find(__key), this); }
+
+ std::pair<iterator, iterator>
+ equal_range(const key_type& __key)
+ {
+ typedef typename _Base::iterator _Base_iterator;
+ typedef std::pair<_Base_iterator, _Base_iterator> __pair_type;
+ __pair_type __res = _Base::equal_range(__key);
+ return std::make_pair(iterator(__res.first, this),
+ iterator(__res.second, this));
+ }
+
+ std::pair<const_iterator, const_iterator>
+ equal_range(const key_type& __key) const
+ {
+ typedef typename _Base::const_iterator _Base_iterator;
+ typedef std::pair<_Base_iterator, _Base_iterator> __pair_type;
+ __pair_type __res = _Base::equal_range(__key);
+ return std::make_pair(const_iterator(__res.first, this),
+ const_iterator(__res.second, this));
+ }
+
+ size_type
+ erase(const key_type& __key)
+ {
+ size_type __ret(0);
+ iterator __victim(_Base::find(__key), this);
+ if (__victim != end())
+ {
+ this->erase(__victim);
+ __ret = 1;
+ }
+ return __ret;
+ }
+
+ iterator
+ erase(iterator __it)
+ {
+ __glibcxx_check_erase(__it);
+ __it._M_invalidate();
+ return iterator(_Base::erase(__it.base()), this);
+ }
+
+ const_iterator
+ erase(const_iterator __it)
+ {
+ __glibcxx_check_erase(__it);
+ __it._M_invalidate();
+ return const_iterator(_Base::erase(__it.base()), this);
+ }
+
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ __glibcxx_check_erase_range(__first, __last);
+ for (iterator __tmp = __first; __tmp != __last;)
+ {
+ iterator __victim = __tmp++;
+ __victim._M_invalidate();
+ }
+ return iterator(_Base::erase(__first.base(),
+ __last.base()), this);
+ }
+
+ const_iterator
+ erase(const_iterator __first, const_iterator __last)
+ {
+ __glibcxx_check_erase_range(__first, __last);
+ for (const_iterator __tmp = __first; __tmp != __last;)
+ {
+ const_iterator __victim = __tmp++;
+ __victim._M_invalidate();
+ }
+ return const_iterator(_Base::erase(__first.base(),
+ __last.base()), this);
+ }
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+
+ private:
+ void
+ _M_invalidate_all()
+ {
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
+ this->_M_invalidate_if(_Not_equal(_M_base().end()));
+ }
+ };
+
+ template<typename _Key, typename _Tp, typename _Hash,
+ typename _Pred, typename _Alloc>
+ inline void
+ swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
+ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Key, typename _Tp, typename _Hash,
+ typename _Pred, typename _Alloc>
+ inline void
+ swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>&& __x,
+ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Key, typename _Tp, typename _Hash,
+ typename _Pred, typename _Alloc>
+ inline void
+ swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
+ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>&& __y)
+ { __x.swap(__y); }
+
+} // namespace __debug
+} // namespace std
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/debug/unordered_set b/i686-linux/include/c++/4.4.3/debug/unordered_set
new file mode 100644
index 0000000..d340442
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/debug/unordered_set
@@ -0,0 +1,601 @@
+// Debugging unordered_set/unordered_multiset implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/unordered_set
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_UNORDERED_SET
+#define _GLIBCXX_DEBUG_UNORDERED_SET 1
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# include <unordered_set>
+#else
+# include <c++0x_warning.h>
+#endif
+
+#include <debug/safe_sequence.h>
+#include <debug/safe_iterator.h>
+#include <initializer_list>
+
+namespace std
+{
+namespace __debug
+{
+ template<typename _Value,
+ typename _Hash = std::hash<_Value>,
+ typename _Pred = std::equal_to<_Value>,
+ typename _Alloc = std::allocator<_Value> >
+ class unordered_set
+ : public _GLIBCXX_STD_D::unordered_set<_Value, _Hash, _Pred, _Alloc>,
+ public __gnu_debug::_Safe_sequence<unordered_set<_Value, _Hash,
+ _Pred, _Alloc> >
+ {
+ typedef _GLIBCXX_STD_D::unordered_set<_Value, _Hash,
+ _Pred, _Alloc> _Base;
+ typedef __gnu_debug::_Safe_sequence<unordered_set> _Safe_base;
+
+ public:
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::hasher hasher;
+ typedef typename _Base::key_equal key_equal;
+ typedef typename _Base::allocator_type allocator_type;
+
+ typedef typename _Base::key_type key_type;
+ typedef typename _Base::value_type value_type;
+
+ typedef __gnu_debug::_Safe_iterator<typename _Base::iterator,
+ unordered_set> iterator;
+ typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator,
+ unordered_set> const_iterator;
+
+ explicit
+ unordered_set(size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__n, __hf, __eql, __a) { }
+
+ template<typename _InputIterator>
+ unordered_set(_InputIterator __f, _InputIterator __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__gnu_debug::__check_valid_range(__f, __l), __l, __n,
+ __hf, __eql, __a), _Safe_base() { }
+
+ unordered_set(const unordered_set& __x)
+ : _Base(__x), _Safe_base() { }
+
+ unordered_set(const _Base& __x)
+ : _Base(__x), _Safe_base() { }
+
+ unordered_set(unordered_set&& __x)
+ : _Base(std::forward<unordered_set>(__x)), _Safe_base() { }
+
+ unordered_set(initializer_list<value_type> __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __n, __hf, __eql, __a), _Safe_base() { }
+
+ unordered_set&
+ operator=(const unordered_set& __x)
+ {
+ *static_cast<_Base*>(this) = __x;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ unordered_set&
+ operator=(unordered_set&& __x)
+ {
+ // NB: DR 675.
+ clear();
+ swap(__x);
+ return *this;
+ }
+
+ unordered_set&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l);
+ return *this;
+ }
+
+ void
+ swap(unordered_set&& __x)
+ {
+ _Base::swap(__x);
+ _Safe_base::_M_swap(__x);
+ }
+
+ void
+ clear()
+ {
+ _Base::clear();
+ this->_M_invalidate_all();
+ }
+
+ iterator
+ begin()
+ { return iterator(_Base::begin(), this); }
+
+ const_iterator
+ begin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ iterator
+ end()
+ { return iterator(_Base::end(), this); }
+
+ const_iterator
+ end() const
+ { return const_iterator(_Base::end(), this); }
+
+ const_iterator
+ cbegin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ const_iterator
+ cend() const
+ { return const_iterator(_Base::end(), this); }
+
+ // local versions
+ using _Base::begin;
+ using _Base::end;
+ using _Base::cbegin;
+ using _Base::cend;
+
+ std::pair<iterator, bool>
+ insert(const value_type& __obj)
+ {
+ typedef std::pair<typename _Base::iterator, bool> __pair_type;
+ __pair_type __res = _Base::insert(__obj);
+ return std::make_pair(iterator(__res.first, this), __res.second);
+ }
+
+ iterator
+ insert(iterator, const value_type& __obj)
+ {
+ typedef std::pair<typename _Base::iterator, bool> __pair_type;
+ __pair_type __res = _Base::insert(__obj);
+ return iterator(__res.first, this);
+ }
+
+ const_iterator
+ insert(const_iterator, const value_type& __obj)
+ {
+ typedef std::pair<typename _Base::iterator, bool> __pair_type;
+ __pair_type __res = _Base::insert(__obj);
+ return const_iterator(__res.first, this);
+ }
+
+ void
+ insert(std::initializer_list<value_type> __l)
+ { _Base::insert(__l); }
+
+ template<typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::insert(__first, __last);
+ }
+
+ iterator
+ find(const key_type& __key)
+ { return iterator(_Base::find(__key), this); }
+
+ const_iterator
+ find(const key_type& __key) const
+ { return const_iterator(_Base::find(__key), this); }
+
+ std::pair<iterator, iterator>
+ equal_range(const key_type& __key)
+ {
+ typedef typename _Base::iterator _Base_iterator;
+ typedef std::pair<_Base_iterator, _Base_iterator> __pair_type;
+ __pair_type __res = _Base::equal_range(__key);
+ return std::make_pair(iterator(__res.first, this),
+ iterator(__res.second, this));
+ }
+
+ std::pair<const_iterator, const_iterator>
+ equal_range(const key_type& __key) const
+ {
+ typedef typename _Base::const_iterator _Base_iterator;
+ typedef std::pair<_Base_iterator, _Base_iterator> __pair_type;
+ __pair_type __res = _Base::equal_range(__key);
+ return std::make_pair(const_iterator(__res.first, this),
+ const_iterator(__res.second, this));
+ }
+
+ size_type
+ erase(const key_type& __key)
+ {
+ size_type __ret(0);
+ iterator __victim(_Base::find(__key), this);
+ if (__victim != end())
+ {
+ this->erase(__victim);
+ __ret = 1;
+ }
+ return __ret;
+ }
+
+ iterator
+ erase(iterator __it)
+ {
+ __glibcxx_check_erase(__it);
+ __it._M_invalidate();
+ return iterator(_Base::erase(__it.base()), this);
+ }
+
+ const_iterator
+ erase(const_iterator __it)
+ {
+ __glibcxx_check_erase(__it);
+ __it._M_invalidate();
+ return const_iterator(_Base::erase(__it.base()), this);
+ }
+
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ __glibcxx_check_erase_range(__first, __last);
+ for (iterator __tmp = __first; __tmp != __last;)
+ {
+ iterator __victim = __tmp++;
+ __victim._M_invalidate();
+ }
+ return iterator(_Base::erase(__first.base(),
+ __last.base()), this);
+ }
+
+ const_iterator
+ erase(const_iterator __first, const_iterator __last)
+ {
+ __glibcxx_check_erase_range(__first, __last);
+ for (const_iterator __tmp = __first; __tmp != __last;)
+ {
+ const_iterator __victim = __tmp++;
+ __victim._M_invalidate();
+ }
+ return const_iterator(_Base::erase(__first.base(),
+ __last.base()), this);
+ }
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+
+ private:
+ void
+ _M_invalidate_all()
+ {
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
+ this->_M_invalidate_if(_Not_equal(_M_base().end()));
+ }
+ };
+
+ template<typename _Value, typename _Hash, typename _Pred, typename _Alloc>
+ inline void
+ swap(unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
+ unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Value, typename _Hash, typename _Pred, typename _Alloc>
+ inline void
+ swap(unordered_set<_Value, _Hash, _Pred, _Alloc>&& __x,
+ unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Value, typename _Hash, typename _Pred, typename _Alloc>
+ inline void
+ swap(unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
+ unordered_set<_Value, _Hash, _Pred, _Alloc>&& __y)
+ { __x.swap(__y); }
+
+
+ template<typename _Value,
+ typename _Hash = std::hash<_Value>,
+ typename _Pred = std::equal_to<_Value>,
+ typename _Alloc = std::allocator<_Value> >
+ class unordered_multiset
+ : public _GLIBCXX_STD_D::unordered_multiset<_Value, _Hash, _Pred, _Alloc>,
+ public __gnu_debug::_Safe_sequence<unordered_multiset<_Value, _Hash,
+ _Pred, _Alloc> >
+ {
+ typedef _GLIBCXX_STD_D::unordered_multiset<_Value, _Hash,
+ _Pred, _Alloc> _Base;
+ typedef __gnu_debug::_Safe_sequence<unordered_multiset> _Safe_base;
+
+ public:
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::hasher hasher;
+ typedef typename _Base::key_equal key_equal;
+ typedef typename _Base::allocator_type allocator_type;
+
+ typedef typename _Base::key_type key_type;
+ typedef typename _Base::value_type value_type;
+
+ typedef __gnu_debug::_Safe_iterator<typename _Base::iterator,
+ unordered_multiset> iterator;
+ typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator,
+ unordered_multiset> const_iterator;
+
+ explicit
+ unordered_multiset(size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__n, __hf, __eql, __a) { }
+
+ template<typename _InputIterator>
+ unordered_multiset(_InputIterator __f, _InputIterator __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__gnu_debug::__check_valid_range(__f, __l), __l, __n,
+ __hf, __eql, __a), _Safe_base() { }
+
+ unordered_multiset(const unordered_multiset& __x)
+ : _Base(__x), _Safe_base() { }
+
+ unordered_multiset(const _Base& __x)
+ : _Base(__x), _Safe_base() { }
+
+ unordered_multiset(unordered_multiset&& __x)
+ : _Base(std::forward<unordered_multiset>(__x)), _Safe_base() { }
+
+ unordered_multiset(initializer_list<value_type> __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __n, __hf, __eql, __a), _Safe_base() { }
+
+ unordered_multiset&
+ operator=(const unordered_multiset& __x)
+ {
+ *static_cast<_Base*>(this) = __x;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ unordered_multiset&
+ operator=(unordered_multiset&& __x)
+ {
+ // NB: DR 675.
+ clear();
+ swap(__x);
+ return *this;
+ }
+
+ unordered_multiset&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l);
+ return *this;
+ }
+
+ void
+ swap(unordered_multiset&& __x)
+ {
+ _Base::swap(__x);
+ _Safe_base::_M_swap(__x);
+ }
+
+ void
+ clear()
+ {
+ _Base::clear();
+ this->_M_invalidate_all();
+ }
+
+ iterator
+ begin()
+ { return iterator(_Base::begin(), this); }
+
+ const_iterator
+ begin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ iterator
+ end()
+ { return iterator(_Base::end(), this); }
+
+ const_iterator
+ end() const
+ { return const_iterator(_Base::end(), this); }
+
+ const_iterator
+ cbegin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ const_iterator
+ cend() const
+ { return const_iterator(_Base::end(), this); }
+
+ // local versions
+ using _Base::begin;
+ using _Base::end;
+ using _Base::cbegin;
+ using _Base::cend;
+
+ iterator
+ insert(const value_type& __obj)
+ { return iterator(_Base::insert(__obj), this); }
+
+ iterator
+ insert(iterator, const value_type& __obj)
+ { return iterator(_Base::insert(__obj), this); }
+
+ const_iterator
+ insert(const_iterator, const value_type& __obj)
+ { return const_iterator(_Base::insert(__obj), this); }
+
+ void
+ insert(std::initializer_list<value_type> __l)
+ { _Base::insert(__l); }
+
+ template<typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::insert(__first, __last);
+ }
+
+ iterator
+ find(const key_type& __key)
+ { return iterator(_Base::find(__key), this); }
+
+ const_iterator
+ find(const key_type& __key) const
+ { return const_iterator(_Base::find(__key), this); }
+
+ std::pair<iterator, iterator>
+ equal_range(const key_type& __key)
+ {
+ typedef typename _Base::iterator _Base_iterator;
+ typedef std::pair<_Base_iterator, _Base_iterator> __pair_type;
+ __pair_type __res = _Base::equal_range(__key);
+ return std::make_pair(iterator(__res.first, this),
+ iterator(__res.second, this));
+ }
+
+ std::pair<const_iterator, const_iterator>
+ equal_range(const key_type& __key) const
+ {
+ typedef typename _Base::const_iterator _Base_iterator;
+ typedef std::pair<_Base_iterator, _Base_iterator> __pair_type;
+ __pair_type __res = _Base::equal_range(__key);
+ return std::make_pair(const_iterator(__res.first, this),
+ const_iterator(__res.second, this));
+ }
+
+ size_type
+ erase(const key_type& __key)
+ {
+ size_type __ret(0);
+ iterator __victim(_Base::find(__key), this);
+ if (__victim != end())
+ {
+ this->erase(__victim);
+ __ret = 1;
+ }
+ return __ret;
+ }
+
+ iterator
+ erase(iterator __it)
+ {
+ __glibcxx_check_erase(__it);
+ __it._M_invalidate();
+ return iterator(_Base::erase(__it.base()), this);
+ }
+
+ const_iterator
+ erase(const_iterator __it)
+ {
+ __glibcxx_check_erase(__it);
+ __it._M_invalidate();
+ return const_iterator(_Base::erase(__it.base()), this);
+ }
+
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ __glibcxx_check_erase_range(__first, __last);
+ for (iterator __tmp = __first; __tmp != __last;)
+ {
+ iterator __victim = __tmp++;
+ __victim._M_invalidate();
+ }
+ return iterator(_Base::erase(__first.base(),
+ __last.base()), this);
+ }
+
+ const_iterator
+ erase(const_iterator __first, const_iterator __last)
+ {
+ __glibcxx_check_erase_range(__first, __last);
+ for (const_iterator __tmp = __first; __tmp != __last;)
+ {
+ const_iterator __victim = __tmp++;
+ __victim._M_invalidate();
+ }
+ return const_iterator(_Base::erase(__first.base(),
+ __last.base()), this);
+ }
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+
+ private:
+ void
+ _M_invalidate_all()
+ {
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
+ this->_M_invalidate_if(_Not_equal(_M_base().end()));
+ }
+ };
+
+ template<typename _Value, typename _Hash, typename _Pred, typename _Alloc>
+ inline void
+ swap(unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
+ unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Value, typename _Hash, typename _Pred, typename _Alloc>
+ inline void
+ swap(unordered_multiset<_Value, _Hash, _Pred, _Alloc>&& __x,
+ unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Value, typename _Hash, typename _Pred, typename _Alloc>
+ inline void
+ swap(unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
+ unordered_multiset<_Value, _Hash, _Pred, _Alloc>&& __y)
+ { __x.swap(__y); }
+
+} // namespace __debug
+} // namespace std
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/debug/vector b/i686-linux/include/c++/4.4.3/debug/vector
new file mode 100644
index 0000000..97ab7bf
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/debug/vector
@@ -0,0 +1,551 @@
+// Debugging vector implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/vector
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_VECTOR
+#define _GLIBCXX_DEBUG_VECTOR 1
+
+#include <vector>
+#include <utility>
+#include <debug/safe_sequence.h>
+#include <debug/safe_iterator.h>
+
+namespace std
+{
+namespace __debug
+{
+ template<typename _Tp,
+ typename _Allocator = std::allocator<_Tp> >
+ class vector
+ : public _GLIBCXX_STD_D::vector<_Tp, _Allocator>,
+ public __gnu_debug::_Safe_sequence<vector<_Tp, _Allocator> >
+ {
+ typedef _GLIBCXX_STD_D::vector<_Tp, _Allocator> _Base;
+ typedef __gnu_debug::_Safe_sequence<vector> _Safe_base;
+
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ typedef __gnu_debug::_After_nth_from<_Base_const_iterator> _After_nth;
+
+ public:
+ typedef typename _Base::reference reference;
+ typedef typename _Base::const_reference const_reference;
+
+ typedef __gnu_debug::_Safe_iterator<typename _Base::iterator,vector>
+ iterator;
+ typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator,vector>
+ const_iterator;
+
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::difference_type difference_type;
+
+ typedef _Tp value_type;
+ typedef _Allocator allocator_type;
+ typedef typename _Base::pointer pointer;
+ typedef typename _Base::const_pointer const_pointer;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+
+ // 23.2.4.1 construct/copy/destroy:
+ explicit vector(const _Allocator& __a = _Allocator())
+ : _Base(__a), _M_guaranteed_capacity(0) { }
+
+ explicit vector(size_type __n, const _Tp& __value = _Tp(),
+ const _Allocator& __a = _Allocator())
+ : _Base(__n, __value, __a), _M_guaranteed_capacity(__n) { }
+
+ template<class _InputIterator>
+ vector(_InputIterator __first, _InputIterator __last,
+ const _Allocator& __a = _Allocator())
+ : _Base(__gnu_debug::__check_valid_range(__first, __last),
+ __last, __a),
+ _M_guaranteed_capacity(0)
+ { _M_update_guaranteed_capacity(); }
+
+ vector(const vector& __x)
+ : _Base(__x), _Safe_base(), _M_guaranteed_capacity(__x.size()) { }
+
+ /// Construction from a release-mode vector
+ vector(const _Base& __x)
+ : _Base(__x), _Safe_base(), _M_guaranteed_capacity(__x.size()) { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ vector(vector&& __x)
+ : _Base(std::forward<vector>(__x)), _Safe_base(),
+ _M_guaranteed_capacity(this->size())
+ {
+ this->_M_swap(__x);
+ __x._M_guaranteed_capacity = 0;
+ }
+
+ vector(initializer_list<value_type> __l,
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __a), _Safe_base(),
+ _M_guaranteed_capacity(__l.size()) { }
+#endif
+
+ ~vector() { }
+
+ vector&
+ operator=(const vector& __x)
+ {
+ static_cast<_Base&>(*this) = __x;
+ this->_M_invalidate_all();
+ _M_update_guaranteed_capacity();
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ vector&
+ operator=(vector&& __x)
+ {
+ // NB: DR 675.
+ clear();
+ swap(__x);
+ return *this;
+ }
+
+ vector&
+ operator=(initializer_list<value_type> __l)
+ {
+ static_cast<_Base&>(*this) = __l;
+ this->_M_invalidate_all();
+ _M_update_guaranteed_capacity();
+ return *this;
+ }
+#endif
+
+ template<typename _InputIterator>
+ void
+ assign(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::assign(__first, __last);
+ this->_M_invalidate_all();
+ _M_update_guaranteed_capacity();
+ }
+
+ void
+ assign(size_type __n, const _Tp& __u)
+ {
+ _Base::assign(__n, __u);
+ this->_M_invalidate_all();
+ _M_update_guaranteed_capacity();
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ assign(initializer_list<value_type> __l)
+ {
+ _Base::assign(__l);
+ this->_M_invalidate_all();
+ _M_update_guaranteed_capacity();
+ }
+#endif
+
+ using _Base::get_allocator;
+
+ // iterators:
+ iterator
+ begin()
+ { return iterator(_Base::begin(), this); }
+
+ const_iterator
+ begin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ iterator
+ end()
+ { return iterator(_Base::end(), this); }
+
+ const_iterator
+ end() const
+ { return const_iterator(_Base::end(), this); }
+
+ reverse_iterator
+ rbegin()
+ { return reverse_iterator(end()); }
+
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(end()); }
+
+ reverse_iterator
+ rend()
+ { return reverse_iterator(begin()); }
+
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(begin()); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ const_iterator
+ cbegin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ const_iterator
+ cend() const
+ { return const_iterator(_Base::end(), this); }
+
+ const_reverse_iterator
+ crbegin() const
+ { return const_reverse_iterator(end()); }
+
+ const_reverse_iterator
+ crend() const
+ { return const_reverse_iterator(begin()); }
+#endif
+
+ // 23.2.4.2 capacity:
+ using _Base::size;
+ using _Base::max_size;
+
+ void
+ resize(size_type __sz, _Tp __c = _Tp())
+ {
+ bool __realloc = _M_requires_reallocation(__sz);
+ if (__sz < this->size())
+ this->_M_invalidate_if(_After_nth(__sz, _M_base().begin()));
+ _Base::resize(__sz, __c);
+ if (__realloc)
+ this->_M_invalidate_all();
+ }
+
+ size_type
+ capacity() const
+ {
+#ifdef _GLIBCXX_DEBUG_PEDANTIC
+ return _M_guaranteed_capacity;
+#else
+ return _Base::capacity();
+#endif
+ }
+
+ using _Base::empty;
+
+ void
+ reserve(size_type __n)
+ {
+ bool __realloc = _M_requires_reallocation(__n);
+ _Base::reserve(__n);
+ if (__n > _M_guaranteed_capacity)
+ _M_guaranteed_capacity = __n;
+ if (__realloc)
+ this->_M_invalidate_all();
+ }
+
+ // element access:
+ reference
+ operator[](size_type __n)
+ {
+ __glibcxx_check_subscript(__n);
+ return _M_base()[__n];
+ }
+
+ const_reference
+ operator[](size_type __n) const
+ {
+ __glibcxx_check_subscript(__n);
+ return _M_base()[__n];
+ }
+
+ using _Base::at;
+
+ reference
+ front()
+ {
+ __glibcxx_check_nonempty();
+ return _Base::front();
+ }
+
+ const_reference
+ front() const
+ {
+ __glibcxx_check_nonempty();
+ return _Base::front();
+ }
+
+ reference
+ back()
+ {
+ __glibcxx_check_nonempty();
+ return _Base::back();
+ }
+
+ const_reference
+ back() const
+ {
+ __glibcxx_check_nonempty();
+ return _Base::back();
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 464. Suggestion for new member functions in standard containers.
+ using _Base::data;
+
+ // 23.2.4.3 modifiers:
+ void
+ push_back(const _Tp& __x)
+ {
+ bool __realloc = _M_requires_reallocation(this->size() + 1);
+ _Base::push_back(__x);
+ if (__realloc)
+ this->_M_invalidate_all();
+ _M_update_guaranteed_capacity();
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Up = _Tp>
+ typename __gnu_cxx::__enable_if<!std::__are_same<_Up, bool>::__value,
+ void>::__type
+ push_back(_Tp&& __x)
+ { emplace_back(std::move(__x)); }
+
+ template<typename... _Args>
+ void
+ emplace_back(_Args&&... __args)
+ {
+ bool __realloc = _M_requires_reallocation(this->size() + 1);
+ _Base::emplace_back(std::forward<_Args>(__args)...);
+ if (__realloc)
+ this->_M_invalidate_all();
+ _M_update_guaranteed_capacity();
+ }
+#endif
+
+ void
+ pop_back()
+ {
+ __glibcxx_check_nonempty();
+ iterator __victim = end() - 1;
+ __victim._M_invalidate();
+ _Base::pop_back();
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename... _Args>
+ iterator
+ emplace(iterator __position, _Args&&... __args)
+ {
+ __glibcxx_check_insert(__position);
+ bool __realloc = _M_requires_reallocation(this->size() + 1);
+ difference_type __offset = __position - begin();
+ typename _Base::iterator __res = _Base::emplace(__position.base(),
+ std::forward<_Args>(__args)...);
+ if (__realloc)
+ this->_M_invalidate_all();
+ else
+ this->_M_invalidate_if(_After_nth(__offset, _M_base().begin()));
+ _M_update_guaranteed_capacity();
+ return iterator(__res, this);
+ }
+#endif
+
+ iterator
+ insert(iterator __position, const _Tp& __x)
+ {
+ __glibcxx_check_insert(__position);
+ bool __realloc = _M_requires_reallocation(this->size() + 1);
+ difference_type __offset = __position - begin();
+ typename _Base::iterator __res = _Base::insert(__position.base(),__x);
+ if (__realloc)
+ this->_M_invalidate_all();
+ else
+ this->_M_invalidate_if(_After_nth(__offset, _M_base().begin()));
+ _M_update_guaranteed_capacity();
+ return iterator(__res, this);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Up = _Tp>
+ typename __gnu_cxx::__enable_if<!std::__are_same<_Up, bool>::__value,
+ iterator>::__type
+ insert(iterator __position, _Tp&& __x)
+ { return emplace(__position, std::move(__x)); }
+
+ void
+ insert(iterator __position, initializer_list<value_type> __l)
+ { this->insert(__position, __l.begin(), __l.end()); }
+#endif
+
+ void
+ insert(iterator __position, size_type __n, const _Tp& __x)
+ {
+ __glibcxx_check_insert(__position);
+ bool __realloc = _M_requires_reallocation(this->size() + __n);
+ difference_type __offset = __position - begin();
+ _Base::insert(__position.base(), __n, __x);
+ if (__realloc)
+ this->_M_invalidate_all();
+ else
+ this->_M_invalidate_if(_After_nth(__offset, _M_base().begin()));
+ _M_update_guaranteed_capacity();
+ }
+
+ template<class _InputIterator>
+ void
+ insert(iterator __position,
+ _InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_insert_range(__position, __first, __last);
+
+ /* Hard to guess if invalidation will occur, because __last
+ - __first can't be calculated in all cases, so we just
+ punt here by checking if it did occur. */
+ typename _Base::iterator __old_begin = _M_base().begin();
+ difference_type __offset = __position - begin();
+ _Base::insert(__position.base(), __first, __last);
+
+ if (_M_base().begin() != __old_begin)
+ this->_M_invalidate_all();
+ else
+ this->_M_invalidate_if(_After_nth(__offset, _M_base().begin()));
+ _M_update_guaranteed_capacity();
+ }
+
+ iterator
+ erase(iterator __position)
+ {
+ __glibcxx_check_erase(__position);
+ difference_type __offset = __position - begin();
+ typename _Base::iterator __res = _Base::erase(__position.base());
+ this->_M_invalidate_if(_After_nth(__offset, _M_base().begin()));
+ return iterator(__res, this);
+ }
+
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 151. can't currently clear() empty container
+ __glibcxx_check_erase_range(__first, __last);
+
+ difference_type __offset = __first - begin();
+ typename _Base::iterator __res = _Base::erase(__first.base(),
+ __last.base());
+ this->_M_invalidate_if(_After_nth(__offset, _M_base().begin()));
+ return iterator(__res, this);
+ }
+
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(vector&& __x)
+#else
+ swap(vector& __x)
+#endif
+ {
+ _Base::swap(__x);
+ this->_M_swap(__x);
+ std::swap(_M_guaranteed_capacity, __x._M_guaranteed_capacity);
+ }
+
+ void
+ clear()
+ {
+ _Base::clear();
+ this->_M_invalidate_all();
+ _M_guaranteed_capacity = 0;
+ }
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+
+ private:
+ size_type _M_guaranteed_capacity;
+
+ bool
+ _M_requires_reallocation(size_type __elements)
+ { return __elements > this->capacity(); }
+
+ void
+ _M_update_guaranteed_capacity()
+ {
+ if (this->size() > _M_guaranteed_capacity)
+ _M_guaranteed_capacity = this->size();
+ }
+ };
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator==(const vector<_Tp, _Alloc>& __lhs,
+ const vector<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() == __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator!=(const vector<_Tp, _Alloc>& __lhs,
+ const vector<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() != __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<(const vector<_Tp, _Alloc>& __lhs,
+ const vector<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() < __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<=(const vector<_Tp, _Alloc>& __lhs,
+ const vector<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() <= __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>=(const vector<_Tp, _Alloc>& __lhs,
+ const vector<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() >= __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>(const vector<_Tp, _Alloc>& __lhs,
+ const vector<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() > __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(vector<_Tp, _Alloc>& __lhs, vector<_Tp, _Alloc>& __rhs)
+ { __lhs.swap(__rhs); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(vector<_Tp, _Alloc>&& __lhs, vector<_Tp, _Alloc>& __rhs)
+ { __lhs.swap(__rhs); }
+
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(vector<_Tp, _Alloc>& __lhs, vector<_Tp, _Alloc>&& __rhs)
+ { __lhs.swap(__rhs); }
+#endif
+
+} // namespace __debug
+} // namespace std
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/deque b/i686-linux/include/c++/4.4.3/deque
new file mode 100644
index 0000000..8f64b00
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/deque
@@ -0,0 +1,75 @@
+// <deque> -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file include/deque
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_DEQUE
+#define _GLIBCXX_DEQUE 1
+
+#pragma GCC system_header
+
+#include <bits/stl_algobase.h>
+#include <bits/allocator.h>
+#include <bits/stl_construct.h>
+#include <bits/stl_uninitialized.h>
+#include <bits/stl_deque.h>
+
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <bits/deque.tcc>
+#endif
+
+#ifdef _GLIBCXX_DEBUG
+# include <debug/deque>
+#endif
+
+#endif /* _GLIBCXX_DEQUE */
diff --git a/i686-linux/include/c++/4.4.3/exception b/i686-linux/include/c++/4.4.3/exception
new file mode 100644
index 0000000..7fa929b
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/exception
@@ -0,0 +1,151 @@
+// Exception Handling support header for -*- C++ -*-
+
+// Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
+// 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation
+//
+// This file is part of GCC.
+//
+// GCC is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// GCC is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file exception
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef __EXCEPTION__
+#define __EXCEPTION__
+
+#pragma GCC visibility push(default)
+
+#include <bits/c++config.h>
+
+extern "C++" {
+
+namespace std
+{
+ /**
+ * @defgroup exceptions Exceptions
+ * @ingroup diagnostics
+ *
+ * Classes and functions for reporting errors via exception classes.
+ * @{
+ */
+
+ /**
+ * @brief Base class for all library exceptions.
+ *
+ * This is the base class for all exceptions thrown by the standard
+ * library, and by certain language expressions. You are free to derive
+ * your own %exception classes, or use a different hierarchy, or to
+ * throw non-class data (e.g., fundamental types).
+ */
+ class exception
+ {
+ public:
+ exception() throw() { }
+ virtual ~exception() throw();
+
+ /** Returns a C-style character string describing the general cause
+ * of the current error. */
+ virtual const char* what() const throw();
+ };
+
+ /** If an %exception is thrown which is not listed in a function's
+ * %exception specification, one of these may be thrown. */
+ class bad_exception : public exception
+ {
+ public:
+ bad_exception() throw() { }
+
+ // This declaration is not useless:
+ // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118
+ virtual ~bad_exception() throw();
+
+ // See comment in eh_exception.cc.
+ virtual const char* what() const throw();
+ };
+
+ /// If you write a replacement %terminate handler, it must be of this type.
+ typedef void (*terminate_handler) ();
+
+ /// If you write a replacement %unexpected handler, it must be of this type.
+ typedef void (*unexpected_handler) ();
+
+ /// Takes a new handler function as an argument, returns the old function.
+ terminate_handler set_terminate(terminate_handler) throw();
+
+ /** The runtime will call this function if %exception handling must be
+ * abandoned for any reason. It can also be called by the user. */
+ void terminate() __attribute__ ((__noreturn__));
+
+ /// Takes a new handler function as an argument, returns the old function.
+ unexpected_handler set_unexpected(unexpected_handler) throw();
+
+ /** The runtime will call this function if an %exception is thrown which
+ * violates the function's %exception specification. */
+ void unexpected() __attribute__ ((__noreturn__));
+
+ /** [18.6.4]/1: "Returns true after completing evaluation of a
+ * throw-expression until either completing initialization of the
+ * exception-declaration in the matching handler or entering @c unexpected()
+ * due to the throw; or after entering @c terminate() for any reason
+ * other than an explicit call to @c terminate(). [Note: This includes
+ * stack unwinding [15.2]. end note]"
+ *
+ * 2: "When @c uncaught_exception() is true, throwing an %exception can
+ * result in a call of @c terminate() (15.5.1)."
+ */
+ bool uncaught_exception() throw();
+
+ // @} group exceptions
+} // namespace std
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ /**
+ * @brief A replacement for the standard terminate_handler which
+ * prints more information about the terminating exception (if any)
+ * on stderr.
+ *
+ * @ingroup exceptions
+ *
+ * Call
+ * @code
+ * std::set_terminate(__gnu_cxx::__verbose_terminate_handler)
+ * @endcode
+ * to use. For more info, see
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt02ch06s02.html
+ *
+ * In 3.4 and later, this is on by default.
+ */
+ void __verbose_terminate_handler();
+
+_GLIBCXX_END_NAMESPACE
+
+} // extern "C++"
+
+#pragma GCC visibility pop
+
+#if (defined(__GXX_EXPERIMENTAL_CXX0X__) \
+ && defined(_GLIBCXX_ATOMIC_BUILTINS_4))
+#include <exception_ptr.h>
+#endif
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/exception_defines.h b/i686-linux/include/c++/4.4.3/exception_defines.h
new file mode 100644
index 0000000..951d96f
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/exception_defines.h
@@ -0,0 +1,49 @@
+// -fno-exceptions Support -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+//
+// ISO C++ 14882: 19.1 Exception classes
+//
+
+/** @file exception_defines.h
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _EXCEPTION_DEFINES_H
+#define _EXCEPTION_DEFINES_H 1
+
+#ifndef __EXCEPTIONS
+// Iff -fno-exceptions, transform error handling code to work without it.
+# define __try if (true)
+# define __catch(X) if (false)
+# define __throw_exception_again
+#else
+// Else proceed normally.
+# define __try try
+# define __catch(X) catch(X)
+# define __throw_exception_again throw
+#endif
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/exception_ptr.h b/i686-linux/include/c++/4.4.3/exception_ptr.h
new file mode 100644
index 0000000..b24ec21
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/exception_ptr.h
@@ -0,0 +1,171 @@
+// Exception Handling support header (exception_ptr class) for -*- C++ -*-
+
+// Copyright (C) 2008, 2009 Free Software Foundation
+//
+// This file is part of GCC.
+//
+// GCC is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// GCC is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file exception_ptr.h
+ * This is an internal header file, included by other headers and the
+ * implementation. You should not attempt to use it directly.
+ */
+
+#ifndef _EXCEPTION_PTR_H
+#define _EXCEPTION_PTR_H
+
+#pragma GCC visibility push(default)
+
+#include <bits/c++config.h>
+#include <exception_defines.h>
+
+#if !defined(_GLIBCXX_ATOMIC_BUILTINS_4)
+# error This platform does not support exception propagation.
+#endif
+
+extern "C++" {
+
+namespace std
+{
+ /**
+ * @addtogroup exceptions
+ * @{
+ */
+
+ // Hide the free operators from other types
+ namespace __exception_ptr
+ {
+ /**
+ * @brief An opaque pointer to an arbitrary exception.
+ */
+ class exception_ptr;
+ }
+
+ using __exception_ptr::exception_ptr;
+
+ /** Obtain an %exception_ptr to the currently handled exception. If there
+ * is none, or the currently handled exception is foreign, return the null
+ * value.
+ */
+ exception_ptr current_exception() throw();
+
+ /// Throw the object pointed to by the %exception_ptr.
+ void rethrow_exception(exception_ptr) __attribute__ ((__noreturn__));
+
+ /// Obtain an %exception_ptr pointing to a copy of the supplied object.
+ template<typename _Ex>
+ exception_ptr
+ copy_exception(_Ex __ex) throw();
+
+ namespace __exception_ptr
+ {
+ bool
+ operator==(const exception_ptr&, const exception_ptr&) throw();
+
+ bool
+ operator!=(const exception_ptr&, const exception_ptr&) throw();
+
+ class exception_ptr
+ {
+ void* _M_exception_object;
+
+ explicit exception_ptr(void* __e) throw();
+
+ void _M_addref() throw();
+ void _M_release() throw();
+
+ void *_M_get() const throw();
+
+ void _M_safe_bool_dummy();
+
+ friend exception_ptr std::current_exception() throw();
+ friend void std::rethrow_exception(exception_ptr);
+
+ public:
+ exception_ptr() throw();
+
+ typedef void (exception_ptr::*__safe_bool)();
+
+ // For construction from nullptr or 0.
+ exception_ptr(__safe_bool) throw();
+
+ exception_ptr(const exception_ptr&) throw();
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ exception_ptr(exception_ptr&& __o) throw()
+ : _M_exception_object(__o._M_exception_object)
+ { __o._M_exception_object = 0; }
+#endif
+
+ exception_ptr&
+ operator=(const exception_ptr&) throw();
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ exception_ptr&
+ operator=(exception_ptr&& __o) throw()
+ {
+ exception_ptr(static_cast<exception_ptr&&>(__o)).swap(*this);
+ return *this;
+ }
+#endif
+
+ ~exception_ptr() throw();
+
+ void
+ swap(exception_ptr&) throw();
+
+#ifdef _GLIBCXX_EH_PTR_COMPAT
+ // Retained for compatibility with CXXABI_1.3.
+ bool operator!() const throw();
+ operator __safe_bool() const throw();
+#endif
+
+ friend bool
+ operator==(const exception_ptr&, const exception_ptr&) throw();
+
+ const type_info*
+ __cxa_exception_type() const throw();
+ };
+
+ } // namespace __exception_ptr
+
+
+ template<typename _Ex>
+ exception_ptr
+ copy_exception(_Ex __ex) throw()
+ {
+ __try
+ {
+ throw __ex;
+ }
+ __catch(...)
+ {
+ return current_exception ();
+ }
+ }
+
+ // @} group exceptions
+} // namespace std
+
+} // extern "C++"
+
+#pragma GCC visibility pop
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/algorithm b/i686-linux/include/c++/4.4.3/ext/algorithm
new file mode 100644
index 0000000..3337d6c
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/algorithm
@@ -0,0 +1,524 @@
+// Algorithm extensions -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file ext/algorithm
+ * This file is a GNU extension to the Standard C++ Library (possibly
+ * containing extensions from the HP/SGI STL subset).
+ */
+
+#ifndef _EXT_ALGORITHM
+#define _EXT_ALGORITHM 1
+
+#pragma GCC system_header
+
+#include <algorithm>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::ptrdiff_t;
+ using std::min;
+ using std::pair;
+ using std::input_iterator_tag;
+ using std::random_access_iterator_tag;
+ using std::iterator_traits;
+
+ //--------------------------------------------------
+ // copy_n (not part of the C++ standard)
+
+ template<typename _InputIterator, typename _Size, typename _OutputIterator>
+ pair<_InputIterator, _OutputIterator>
+ __copy_n(_InputIterator __first, _Size __count,
+ _OutputIterator __result,
+ input_iterator_tag)
+ {
+ for ( ; __count > 0; --__count)
+ {
+ *__result = *__first;
+ ++__first;
+ ++__result;
+ }
+ return pair<_InputIterator, _OutputIterator>(__first, __result);
+ }
+
+ template<typename _RAIterator, typename _Size, typename _OutputIterator>
+ inline pair<_RAIterator, _OutputIterator>
+ __copy_n(_RAIterator __first, _Size __count,
+ _OutputIterator __result,
+ random_access_iterator_tag)
+ {
+ _RAIterator __last = __first + __count;
+ return pair<_RAIterator, _OutputIterator>(__last, std::copy(__first,
+ __last,
+ __result));
+ }
+
+ /**
+ * @brief Copies the range [first,first+count) into [result,result+count).
+ * @param first An input iterator.
+ * @param count The number of elements to copy.
+ * @param result An output iterator.
+ * @return A std::pair composed of first+count and result+count.
+ *
+ * This is an SGI extension.
+ * This inline function will boil down to a call to @c memmove whenever
+ * possible. Failing that, if random access iterators are passed, then the
+ * loop count will be known (and therefore a candidate for compiler
+ * optimizations such as unrolling).
+ * @ingroup SGIextensions
+ */
+ template<typename _InputIterator, typename _Size, typename _OutputIterator>
+ inline pair<_InputIterator, _OutputIterator>
+ copy_n(_InputIterator __first, _Size __count, _OutputIterator __result)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator>::value_type>)
+
+ return __copy_n(__first, __count, __result,
+ std::__iterator_category(__first));
+ }
+
+ template<typename _InputIterator1, typename _InputIterator2>
+ int
+ __lexicographical_compare_3way(_InputIterator1 __first1,
+ _InputIterator1 __last1,
+ _InputIterator2 __first2,
+ _InputIterator2 __last2)
+ {
+ while (__first1 != __last1 && __first2 != __last2)
+ {
+ if (*__first1 < *__first2)
+ return -1;
+ if (*__first2 < *__first1)
+ return 1;
+ ++__first1;
+ ++__first2;
+ }
+ if (__first2 == __last2)
+ return !(__first1 == __last1);
+ else
+ return -1;
+ }
+
+ inline int
+ __lexicographical_compare_3way(const unsigned char* __first1,
+ const unsigned char* __last1,
+ const unsigned char* __first2,
+ const unsigned char* __last2)
+ {
+ const ptrdiff_t __len1 = __last1 - __first1;
+ const ptrdiff_t __len2 = __last2 - __first2;
+ const int __result = __builtin_memcmp(__first1, __first2,
+ min(__len1, __len2));
+ return __result != 0 ? __result
+ : (__len1 == __len2 ? 0 : (__len1 < __len2 ? -1 : 1));
+ }
+
+ inline int
+ __lexicographical_compare_3way(const char* __first1, const char* __last1,
+ const char* __first2, const char* __last2)
+ {
+#if CHAR_MAX == SCHAR_MAX
+ return __lexicographical_compare_3way((const signed char*) __first1,
+ (const signed char*) __last1,
+ (const signed char*) __first2,
+ (const signed char*) __last2);
+#else
+ return __lexicographical_compare_3way((const unsigned char*) __first1,
+ (const unsigned char*) __last1,
+ (const unsigned char*) __first2,
+ (const unsigned char*) __last2);
+#endif
+ }
+
+ /**
+ * @brief @c memcmp on steroids.
+ * @param first1 An input iterator.
+ * @param last1 An input iterator.
+ * @param first2 An input iterator.
+ * @param last2 An input iterator.
+ * @return An int, as with @c memcmp.
+ *
+ * The return value will be less than zero if the first range is
+ * "lexigraphically less than" the second, greater than zero if the second
+ * range is "lexigraphically less than" the first, and zero otherwise.
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ */
+ template<typename _InputIterator1, typename _InputIterator2>
+ int
+ lexicographical_compare_3way(_InputIterator1 __first1,
+ _InputIterator1 __last1,
+ _InputIterator2 __first2,
+ _InputIterator2 __last2)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_InputIterator1>::value_type>)
+ __glibcxx_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_InputIterator2>::value_type>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+ __glibcxx_requires_valid_range(__first2, __last2);
+
+ return __lexicographical_compare_3way(__first1, __last1, __first2,
+ __last2);
+ }
+
+ // count and count_if: this version, whose return type is void, was present
+ // in the HP STL, and is retained as an extension for backward compatibility.
+ template<typename _InputIterator, typename _Tp, typename _Size>
+ void
+ count(_InputIterator __first, _InputIterator __last,
+ const _Tp& __value,
+ _Size& __n)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_EqualityComparableConcept<
+ typename iterator_traits<_InputIterator>::value_type >)
+ __glibcxx_function_requires(_EqualityComparableConcept<_Tp>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ for ( ; __first != __last; ++__first)
+ if (*__first == __value)
+ ++__n;
+ }
+
+ template<typename _InputIterator, typename _Predicate, typename _Size>
+ void
+ count_if(_InputIterator __first, _InputIterator __last,
+ _Predicate __pred,
+ _Size& __n)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
+ typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ for ( ; __first != __last; ++__first)
+ if (__pred(*__first))
+ ++__n;
+ }
+
+ // random_sample and random_sample_n (extensions, not part of the standard).
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template<typename _ForwardIterator, typename _OutputIterator,
+ typename _Distance>
+ _OutputIterator
+ random_sample_n(_ForwardIterator __first, _ForwardIterator __last,
+ _OutputIterator __out, const _Distance __n)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ _Distance __remaining = std::distance(__first, __last);
+ _Distance __m = min(__n, __remaining);
+
+ while (__m > 0)
+ {
+ if ((std::rand() % __remaining) < __m)
+ {
+ *__out = *__first;
+ ++__out;
+ --__m;
+ }
+ --__remaining;
+ ++__first;
+ }
+ return __out;
+ }
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template<typename _ForwardIterator, typename _OutputIterator,
+ typename _Distance, typename _RandomNumberGenerator>
+ _OutputIterator
+ random_sample_n(_ForwardIterator __first, _ForwardIterator __last,
+ _OutputIterator __out, const _Distance __n,
+ _RandomNumberGenerator& __rand)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_function_requires(_UnaryFunctionConcept<
+ _RandomNumberGenerator, _Distance, _Distance>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ _Distance __remaining = std::distance(__first, __last);
+ _Distance __m = min(__n, __remaining);
+
+ while (__m > 0)
+ {
+ if (__rand(__remaining) < __m)
+ {
+ *__out = *__first;
+ ++__out;
+ --__m;
+ }
+ --__remaining;
+ ++__first;
+ }
+ return __out;
+ }
+
+ template<typename _InputIterator, typename _RandomAccessIterator,
+ typename _Distance>
+ _RandomAccessIterator
+ __random_sample(_InputIterator __first, _InputIterator __last,
+ _RandomAccessIterator __out,
+ const _Distance __n)
+ {
+ _Distance __m = 0;
+ _Distance __t = __n;
+ for ( ; __first != __last && __m < __n; ++__m, ++__first)
+ __out[__m] = *__first;
+
+ while (__first != __last)
+ {
+ ++__t;
+ _Distance __M = std::rand() % (__t);
+ if (__M < __n)
+ __out[__M] = *__first;
+ ++__first;
+ }
+ return __out + __m;
+ }
+
+ template<typename _InputIterator, typename _RandomAccessIterator,
+ typename _RandomNumberGenerator, typename _Distance>
+ _RandomAccessIterator
+ __random_sample(_InputIterator __first, _InputIterator __last,
+ _RandomAccessIterator __out,
+ _RandomNumberGenerator& __rand,
+ const _Distance __n)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_UnaryFunctionConcept<
+ _RandomNumberGenerator, _Distance, _Distance>)
+
+ _Distance __m = 0;
+ _Distance __t = __n;
+ for ( ; __first != __last && __m < __n; ++__m, ++__first)
+ __out[__m] = *__first;
+
+ while (__first != __last)
+ {
+ ++__t;
+ _Distance __M = __rand(__t);
+ if (__M < __n)
+ __out[__M] = *__first;
+ ++__first;
+ }
+ return __out + __m;
+ }
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template<typename _InputIterator, typename _RandomAccessIterator>
+ inline _RandomAccessIterator
+ random_sample(_InputIterator __first, _InputIterator __last,
+ _RandomAccessIterator __out_first,
+ _RandomAccessIterator __out_last)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
+ __glibcxx_requires_valid_range(__out_first, __out_last);
+
+ return __random_sample(__first, __last,
+ __out_first, __out_last - __out_first);
+ }
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template<typename _InputIterator, typename _RandomAccessIterator,
+ typename _RandomNumberGenerator>
+ inline _RandomAccessIterator
+ random_sample(_InputIterator __first, _InputIterator __last,
+ _RandomAccessIterator __out_first,
+ _RandomAccessIterator __out_last,
+ _RandomNumberGenerator& __rand)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
+ __glibcxx_requires_valid_range(__out_first, __out_last);
+
+ return __random_sample(__first, __last,
+ __out_first, __rand,
+ __out_last - __out_first);
+ }
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template<typename _RandomAccessIterator>
+ inline bool
+ is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_RandomAccessIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ return std::__is_heap(__first, __last - __first);
+ }
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template<typename _RandomAccessIterator, typename _StrictWeakOrdering>
+ inline bool
+ is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ _StrictWeakOrdering __comp)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_StrictWeakOrdering,
+ typename iterator_traits<_RandomAccessIterator>::value_type,
+ typename iterator_traits<_RandomAccessIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ return std::__is_heap(__first, __comp, __last - __first);
+ }
+
+ // is_sorted, a predicated testing whether a range is sorted in
+ // nondescending order. This is an extension, not part of the C++
+ // standard.
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template<typename _ForwardIterator>
+ bool
+ is_sorted(_ForwardIterator __first, _ForwardIterator __last)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return true;
+
+ _ForwardIterator __next = __first;
+ for (++__next; __next != __last; __first = __next, ++__next)
+ if (*__next < *__first)
+ return false;
+ return true;
+ }
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template<typename _ForwardIterator, typename _StrictWeakOrdering>
+ bool
+ is_sorted(_ForwardIterator __first, _ForwardIterator __last,
+ _StrictWeakOrdering __comp)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_StrictWeakOrdering,
+ typename iterator_traits<_ForwardIterator>::value_type,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return true;
+
+ _ForwardIterator __next = __first;
+ for (++__next; __next != __last; __first = __next, ++__next)
+ if (__comp(*__next, *__first))
+ return false;
+ return true;
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _EXT_ALGORITHM */
diff --git a/i686-linux/include/c++/4.4.3/ext/array_allocator.h b/i686-linux/include/c++/4.4.3/ext/array_allocator.h
new file mode 100644
index 0000000..f36f273
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/array_allocator.h
@@ -0,0 +1,154 @@
+// array allocator -*- C++ -*-
+
+// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ext/array_allocator.h
+ * This file is a GNU extension to the Standard C++ Library.
+ */
+
+#ifndef _ARRAY_ALLOCATOR_H
+#define _ARRAY_ALLOCATOR_H 1
+
+#include <cstddef>
+#include <new>
+#include <bits/functexcept.h>
+#include <tr1/array>
+#include <bits/move.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::size_t;
+ using std::ptrdiff_t;
+
+ /// Base class.
+ template<typename _Tp>
+ class array_allocator_base
+ {
+ public:
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Tp* pointer;
+ typedef const _Tp* const_pointer;
+ typedef _Tp& reference;
+ typedef const _Tp& const_reference;
+ typedef _Tp value_type;
+
+ pointer
+ address(reference __x) const { return &__x; }
+
+ const_pointer
+ address(const_reference __x) const { return &__x; }
+
+ void
+ deallocate(pointer, size_type)
+ {
+ // Does nothing.
+ }
+
+ size_type
+ max_size() const throw()
+ { return size_t(-1) / sizeof(_Tp); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 402. wrong new expression in [some_] allocator::construct
+ void
+ construct(pointer __p, const _Tp& __val)
+ { ::new((void *)__p) value_type(__val); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename... _Args>
+ void
+ construct(pointer __p, _Args&&... __args)
+ { ::new((void *)__p) _Tp(std::forward<_Args>(__args)...); }
+#endif
+
+ void
+ destroy(pointer __p) { __p->~_Tp(); }
+ };
+
+ /**
+ * @brief An allocator that uses previously allocated memory.
+ * This memory can be externally, globally, or otherwise allocated.
+ * @ingroup allocators
+ */
+ template<typename _Tp, typename _Array = std::tr1::array<_Tp, 1> >
+ class array_allocator : public array_allocator_base<_Tp>
+ {
+ public:
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Tp* pointer;
+ typedef const _Tp* const_pointer;
+ typedef _Tp& reference;
+ typedef const _Tp& const_reference;
+ typedef _Tp value_type;
+ typedef _Array array_type;
+
+ private:
+ array_type* _M_array;
+ size_type _M_used;
+
+ public:
+ template<typename _Tp1, typename _Array1 = _Array>
+ struct rebind
+ { typedef array_allocator<_Tp1, _Array1> other; };
+
+ array_allocator(array_type* __array = NULL) throw()
+ : _M_array(__array), _M_used(size_type()) { }
+
+ array_allocator(const array_allocator& __o) throw()
+ : _M_array(__o._M_array), _M_used(__o._M_used) { }
+
+ template<typename _Tp1, typename _Array1>
+ array_allocator(const array_allocator<_Tp1, _Array1>&) throw()
+ : _M_array(NULL), _M_used(size_type()) { }
+
+ ~array_allocator() throw() { }
+
+ pointer
+ allocate(size_type __n, const void* = 0)
+ {
+ if (_M_array == 0 || _M_used + __n > _M_array->size())
+ std::__throw_bad_alloc();
+ pointer __ret = _M_array->begin() + _M_used;
+ _M_used += __n;
+ return __ret;
+ }
+ };
+
+ template<typename _Tp, typename _Array>
+ inline bool
+ operator==(const array_allocator<_Tp, _Array>&,
+ const array_allocator<_Tp, _Array>&)
+ { return true; }
+
+ template<typename _Tp, typename _Array>
+ inline bool
+ operator!=(const array_allocator<_Tp, _Array>&,
+ const array_allocator<_Tp, _Array>&)
+ { return false; }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/atomicity.h b/i686-linux/include/c++/4.4.3/ext/atomicity.h
new file mode 100644
index 0000000..bb891e8
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/atomicity.h
@@ -0,0 +1,113 @@
+// Support for atomic operations -*- C++ -*-
+
+// Copyright (C) 2004, 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file atomicity.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _GLIBCXX_ATOMICITY_H
+#define _GLIBCXX_ATOMICITY_H 1
+
+#include <bits/c++config.h>
+#include <bits/gthr.h>
+#include <bits/atomic_word.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ // Functions for portable atomic access.
+ // To abstract locking primitives across all thread policies, use:
+ // __exchange_and_add_dispatch
+ // __atomic_add_dispatch
+#ifdef _GLIBCXX_ATOMIC_BUILTINS_4
+ static inline _Atomic_word
+ __exchange_and_add(volatile _Atomic_word* __mem, int __val)
+ { return __sync_fetch_and_add(__mem, __val); }
+
+ static inline void
+ __atomic_add(volatile _Atomic_word* __mem, int __val)
+ { __sync_fetch_and_add(__mem, __val); }
+#else
+ _Atomic_word
+ __attribute__ ((__unused__))
+ __exchange_and_add(volatile _Atomic_word*, int);
+
+ void
+ __attribute__ ((__unused__))
+ __atomic_add(volatile _Atomic_word*, int);
+#endif
+
+ static inline _Atomic_word
+ __exchange_and_add_single(_Atomic_word* __mem, int __val)
+ {
+ _Atomic_word __result = *__mem;
+ *__mem += __val;
+ return __result;
+ }
+
+ static inline void
+ __atomic_add_single(_Atomic_word* __mem, int __val)
+ { *__mem += __val; }
+
+ static inline _Atomic_word
+ __attribute__ ((__unused__))
+ __exchange_and_add_dispatch(_Atomic_word* __mem, int __val)
+ {
+#ifdef __GTHREADS
+ if (__gthread_active_p())
+ return __exchange_and_add(__mem, __val);
+ else
+ return __exchange_and_add_single(__mem, __val);
+#else
+ return __exchange_and_add_single(__mem, __val);
+#endif
+ }
+
+ static inline void
+ __attribute__ ((__unused__))
+ __atomic_add_dispatch(_Atomic_word* __mem, int __val)
+ {
+#ifdef __GTHREADS
+ if (__gthread_active_p())
+ __atomic_add(__mem, __val);
+ else
+ __atomic_add_single(__mem, __val);
+#else
+ __atomic_add_single(__mem, __val);
+#endif
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+// Even if the CPU doesn't need a memory barrier, we need to ensure
+// that the compiler doesn't reorder memory accesses across the
+// barriers.
+#ifndef _GLIBCXX_READ_MEM_BARRIER
+#define _GLIBCXX_READ_MEM_BARRIER __asm __volatile ("":::"memory")
+#endif
+#ifndef _GLIBCXX_WRITE_MEM_BARRIER
+#define _GLIBCXX_WRITE_MEM_BARRIER __asm __volatile ("":::"memory")
+#endif
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/bitmap_allocator.h b/i686-linux/include/c++/4.4.3/ext/bitmap_allocator.h
new file mode 100644
index 0000000..3ad08fb
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/bitmap_allocator.h
@@ -0,0 +1,1145 @@
+// Bitmap Allocator. -*- C++ -*-
+
+// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ext/bitmap_allocator.h
+ * This file is a GNU extension to the Standard C++ Library.
+ */
+
+#ifndef _BITMAP_ALLOCATOR_H
+#define _BITMAP_ALLOCATOR_H 1
+
+#include <cstddef> // For std::size_t, and ptrdiff_t.
+#include <bits/functexcept.h> // For __throw_bad_alloc().
+#include <utility> // For std::pair.
+#include <functional> // For greater_equal, and less_equal.
+#include <new> // For operator new.
+#include <debug/debug.h> // _GLIBCXX_DEBUG_ASSERT
+#include <ext/concurrence.h>
+#include <bits/move.h>
+
+/** @brief The constant in the expression below is the alignment
+ * required in bytes.
+ */
+#define _BALLOC_ALIGN_BYTES 8
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::size_t;
+ using std::ptrdiff_t;
+
+ namespace __detail
+ {
+ /** @class __mini_vector bitmap_allocator.h bitmap_allocator.h
+ *
+ * @brief __mini_vector<> is a stripped down version of the
+ * full-fledged std::vector<>.
+ *
+ * It is to be used only for built-in types or PODs. Notable
+ * differences are:
+ *
+ * @detail
+ * 1. Not all accessor functions are present.
+ * 2. Used ONLY for PODs.
+ * 3. No Allocator template argument. Uses ::operator new() to get
+ * memory, and ::operator delete() to free it.
+ * Caveat: The dtor does NOT free the memory allocated, so this a
+ * memory-leaking vector!
+ */
+ template<typename _Tp>
+ class __mini_vector
+ {
+ __mini_vector(const __mini_vector&);
+ __mini_vector& operator=(const __mini_vector&);
+
+ public:
+ typedef _Tp value_type;
+ typedef _Tp* pointer;
+ typedef _Tp& reference;
+ typedef const _Tp& const_reference;
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef pointer iterator;
+
+ private:
+ pointer _M_start;
+ pointer _M_finish;
+ pointer _M_end_of_storage;
+
+ size_type
+ _M_space_left() const throw()
+ { return _M_end_of_storage - _M_finish; }
+
+ pointer
+ allocate(size_type __n)
+ { return static_cast<pointer>(::operator new(__n * sizeof(_Tp))); }
+
+ void
+ deallocate(pointer __p, size_type)
+ { ::operator delete(__p); }
+
+ public:
+ // Members used: size(), push_back(), pop_back(),
+ // insert(iterator, const_reference), erase(iterator),
+ // begin(), end(), back(), operator[].
+
+ __mini_vector() : _M_start(0), _M_finish(0),
+ _M_end_of_storage(0)
+ { }
+
+#if 0
+ ~__mini_vector()
+ {
+ if (this->_M_start)
+ {
+ this->deallocate(this->_M_start, this->_M_end_of_storage
+ - this->_M_start);
+ }
+ }
+#endif
+
+ size_type
+ size() const throw()
+ { return _M_finish - _M_start; }
+
+ iterator
+ begin() const throw()
+ { return this->_M_start; }
+
+ iterator
+ end() const throw()
+ { return this->_M_finish; }
+
+ reference
+ back() const throw()
+ { return *(this->end() - 1); }
+
+ reference
+ operator[](const size_type __pos) const throw()
+ { return this->_M_start[__pos]; }
+
+ void
+ insert(iterator __pos, const_reference __x);
+
+ void
+ push_back(const_reference __x)
+ {
+ if (this->_M_space_left())
+ {
+ *this->end() = __x;
+ ++this->_M_finish;
+ }
+ else
+ this->insert(this->end(), __x);
+ }
+
+ void
+ pop_back() throw()
+ { --this->_M_finish; }
+
+ void
+ erase(iterator __pos) throw();
+
+ void
+ clear() throw()
+ { this->_M_finish = this->_M_start; }
+ };
+
+ // Out of line function definitions.
+ template<typename _Tp>
+ void __mini_vector<_Tp>::
+ insert(iterator __pos, const_reference __x)
+ {
+ if (this->_M_space_left())
+ {
+ size_type __to_move = this->_M_finish - __pos;
+ iterator __dest = this->end();
+ iterator __src = this->end() - 1;
+
+ ++this->_M_finish;
+ while (__to_move)
+ {
+ *__dest = *__src;
+ --__dest; --__src; --__to_move;
+ }
+ *__pos = __x;
+ }
+ else
+ {
+ size_type __new_size = this->size() ? this->size() * 2 : 1;
+ iterator __new_start = this->allocate(__new_size);
+ iterator __first = this->begin();
+ iterator __start = __new_start;
+ while (__first != __pos)
+ {
+ *__start = *__first;
+ ++__start; ++__first;
+ }
+ *__start = __x;
+ ++__start;
+ while (__first != this->end())
+ {
+ *__start = *__first;
+ ++__start; ++__first;
+ }
+ if (this->_M_start)
+ this->deallocate(this->_M_start, this->size());
+
+ this->_M_start = __new_start;
+ this->_M_finish = __start;
+ this->_M_end_of_storage = this->_M_start + __new_size;
+ }
+ }
+
+ template<typename _Tp>
+ void __mini_vector<_Tp>::
+ erase(iterator __pos) throw()
+ {
+ while (__pos + 1 != this->end())
+ {
+ *__pos = __pos[1];
+ ++__pos;
+ }
+ --this->_M_finish;
+ }
+
+
+ template<typename _Tp>
+ struct __mv_iter_traits
+ {
+ typedef typename _Tp::value_type value_type;
+ typedef typename _Tp::difference_type difference_type;
+ };
+
+ template<typename _Tp>
+ struct __mv_iter_traits<_Tp*>
+ {
+ typedef _Tp value_type;
+ typedef ptrdiff_t difference_type;
+ };
+
+ enum
+ {
+ bits_per_byte = 8,
+ bits_per_block = sizeof(size_t) * size_t(bits_per_byte)
+ };
+
+ template<typename _ForwardIterator, typename _Tp, typename _Compare>
+ _ForwardIterator
+ __lower_bound(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __val, _Compare __comp)
+ {
+ typedef typename __mv_iter_traits<_ForwardIterator>::value_type
+ _ValueType;
+ typedef typename __mv_iter_traits<_ForwardIterator>::difference_type
+ _DistanceType;
+
+ _DistanceType __len = __last - __first;
+ _DistanceType __half;
+ _ForwardIterator __middle;
+
+ while (__len > 0)
+ {
+ __half = __len >> 1;
+ __middle = __first;
+ __middle += __half;
+ if (__comp(*__middle, __val))
+ {
+ __first = __middle;
+ ++__first;
+ __len = __len - __half - 1;
+ }
+ else
+ __len = __half;
+ }
+ return __first;
+ }
+
+ template<typename _InputIterator, typename _Predicate>
+ inline _InputIterator
+ __find_if(_InputIterator __first, _InputIterator __last, _Predicate __p)
+ {
+ while (__first != __last && !__p(*__first))
+ ++__first;
+ return __first;
+ }
+
+ /** @brief The number of Blocks pointed to by the address pair
+ * passed to the function.
+ */
+ template<typename _AddrPair>
+ inline size_t
+ __num_blocks(_AddrPair __ap)
+ { return (__ap.second - __ap.first) + 1; }
+
+ /** @brief The number of Bit-maps pointed to by the address pair
+ * passed to the function.
+ */
+ template<typename _AddrPair>
+ inline size_t
+ __num_bitmaps(_AddrPair __ap)
+ { return __num_blocks(__ap) / size_t(bits_per_block); }
+
+ // _Tp should be a pointer type.
+ template<typename _Tp>
+ class _Inclusive_between
+ : public std::unary_function<typename std::pair<_Tp, _Tp>, bool>
+ {
+ typedef _Tp pointer;
+ pointer _M_ptr_value;
+ typedef typename std::pair<_Tp, _Tp> _Block_pair;
+
+ public:
+ _Inclusive_between(pointer __ptr) : _M_ptr_value(__ptr)
+ { }
+
+ bool
+ operator()(_Block_pair __bp) const throw()
+ {
+ if (std::less_equal<pointer>()(_M_ptr_value, __bp.second)
+ && std::greater_equal<pointer>()(_M_ptr_value, __bp.first))
+ return true;
+ else
+ return false;
+ }
+ };
+
+ // Used to pass a Functor to functions by reference.
+ template<typename _Functor>
+ class _Functor_Ref
+ : public std::unary_function<typename _Functor::argument_type,
+ typename _Functor::result_type>
+ {
+ _Functor& _M_fref;
+
+ public:
+ typedef typename _Functor::argument_type argument_type;
+ typedef typename _Functor::result_type result_type;
+
+ _Functor_Ref(_Functor& __fref) : _M_fref(__fref)
+ { }
+
+ result_type
+ operator()(argument_type __arg)
+ { return _M_fref(__arg); }
+ };
+
+ /** @class _Ffit_finder bitmap_allocator.h bitmap_allocator.h
+ *
+ * @brief The class which acts as a predicate for applying the
+ * first-fit memory allocation policy for the bitmap allocator.
+ */
+ // _Tp should be a pointer type, and _Alloc is the Allocator for
+ // the vector.
+ template<typename _Tp>
+ class _Ffit_finder
+ : public std::unary_function<typename std::pair<_Tp, _Tp>, bool>
+ {
+ typedef typename std::pair<_Tp, _Tp> _Block_pair;
+ typedef typename __detail::__mini_vector<_Block_pair> _BPVector;
+ typedef typename _BPVector::difference_type _Counter_type;
+
+ size_t* _M_pbitmap;
+ _Counter_type _M_data_offset;
+
+ public:
+ _Ffit_finder() : _M_pbitmap(0), _M_data_offset(0)
+ { }
+
+ bool
+ operator()(_Block_pair __bp) throw()
+ {
+ // Set the _rover to the last physical location bitmap,
+ // which is the bitmap which belongs to the first free
+ // block. Thus, the bitmaps are in exact reverse order of
+ // the actual memory layout. So, we count down the bitmaps,
+ // which is the same as moving up the memory.
+
+ // If the used count stored at the start of the Bit Map headers
+ // is equal to the number of Objects that the current Block can
+ // store, then there is definitely no space for another single
+ // object, so just return false.
+ _Counter_type __diff =
+ __gnu_cxx::__detail::__num_bitmaps(__bp);
+
+ if (*(reinterpret_cast<size_t*>
+ (__bp.first) - (__diff + 1))
+ == __gnu_cxx::__detail::__num_blocks(__bp))
+ return false;
+
+ size_t* __rover = reinterpret_cast<size_t*>(__bp.first) - 1;
+
+ for (_Counter_type __i = 0; __i < __diff; ++__i)
+ {
+ _M_data_offset = __i;
+ if (*__rover)
+ {
+ _M_pbitmap = __rover;
+ return true;
+ }
+ --__rover;
+ }
+ return false;
+ }
+
+
+ size_t*
+ _M_get() const throw()
+ { return _M_pbitmap; }
+
+ _Counter_type
+ _M_offset() const throw()
+ { return _M_data_offset * size_t(bits_per_block); }
+ };
+
+
+ /** @class _Bitmap_counter bitmap_allocator.h bitmap_allocator.h
+ *
+ * @brief The bitmap counter which acts as the bitmap
+ * manipulator, and manages the bit-manipulation functions and
+ * the searching and identification functions on the bit-map.
+ */
+ // _Tp should be a pointer type.
+ template<typename _Tp>
+ class _Bitmap_counter
+ {
+ typedef typename __detail::__mini_vector<typename std::pair<_Tp, _Tp> >
+ _BPVector;
+ typedef typename _BPVector::size_type _Index_type;
+ typedef _Tp pointer;
+
+ _BPVector& _M_vbp;
+ size_t* _M_curr_bmap;
+ size_t* _M_last_bmap_in_block;
+ _Index_type _M_curr_index;
+
+ public:
+ // Use the 2nd parameter with care. Make sure that such an
+ // entry exists in the vector before passing that particular
+ // index to this ctor.
+ _Bitmap_counter(_BPVector& Rvbp, long __index = -1) : _M_vbp(Rvbp)
+ { this->_M_reset(__index); }
+
+ void
+ _M_reset(long __index = -1) throw()
+ {
+ if (__index == -1)
+ {
+ _M_curr_bmap = 0;
+ _M_curr_index = static_cast<_Index_type>(-1);
+ return;
+ }
+
+ _M_curr_index = __index;
+ _M_curr_bmap = reinterpret_cast<size_t*>
+ (_M_vbp[_M_curr_index].first) - 1;
+
+ _GLIBCXX_DEBUG_ASSERT(__index <= (long)_M_vbp.size() - 1);
+
+ _M_last_bmap_in_block = _M_curr_bmap
+ - ((_M_vbp[_M_curr_index].second
+ - _M_vbp[_M_curr_index].first + 1)
+ / size_t(bits_per_block) - 1);
+ }
+
+ // Dangerous Function! Use with extreme care. Pass to this
+ // function ONLY those values that are known to be correct,
+ // otherwise this will mess up big time.
+ void
+ _M_set_internal_bitmap(size_t* __new_internal_marker) throw()
+ { _M_curr_bmap = __new_internal_marker; }
+
+ bool
+ _M_finished() const throw()
+ { return(_M_curr_bmap == 0); }
+
+ _Bitmap_counter&
+ operator++() throw()
+ {
+ if (_M_curr_bmap == _M_last_bmap_in_block)
+ {
+ if (++_M_curr_index == _M_vbp.size())
+ _M_curr_bmap = 0;
+ else
+ this->_M_reset(_M_curr_index);
+ }
+ else
+ --_M_curr_bmap;
+ return *this;
+ }
+
+ size_t*
+ _M_get() const throw()
+ { return _M_curr_bmap; }
+
+ pointer
+ _M_base() const throw()
+ { return _M_vbp[_M_curr_index].first; }
+
+ _Index_type
+ _M_offset() const throw()
+ {
+ return size_t(bits_per_block)
+ * ((reinterpret_cast<size_t*>(this->_M_base())
+ - _M_curr_bmap) - 1);
+ }
+
+ _Index_type
+ _M_where() const throw()
+ { return _M_curr_index; }
+ };
+
+ /** @brief Mark a memory address as allocated by re-setting the
+ * corresponding bit in the bit-map.
+ */
+ inline void
+ __bit_allocate(size_t* __pbmap, size_t __pos) throw()
+ {
+ size_t __mask = 1 << __pos;
+ __mask = ~__mask;
+ *__pbmap &= __mask;
+ }
+
+ /** @brief Mark a memory address as free by setting the
+ * corresponding bit in the bit-map.
+ */
+ inline void
+ __bit_free(size_t* __pbmap, size_t __pos) throw()
+ {
+ size_t __mask = 1 << __pos;
+ *__pbmap |= __mask;
+ }
+ } // namespace __detail
+
+ /** @brief Generic Version of the bsf instruction.
+ */
+ inline size_t
+ _Bit_scan_forward(size_t __num)
+ { return static_cast<size_t>(__builtin_ctzl(__num)); }
+
+ /** @class free_list bitmap_allocator.h bitmap_allocator.h
+ *
+ * @brief The free list class for managing chunks of memory to be
+ * given to and returned by the bitmap_allocator.
+ */
+ class free_list
+ {
+ typedef size_t* value_type;
+ typedef __detail::__mini_vector<value_type> vector_type;
+ typedef vector_type::iterator iterator;
+ typedef __mutex __mutex_type;
+
+ struct _LT_pointer_compare
+ {
+ bool
+ operator()(const size_t* __pui,
+ const size_t __cui) const throw()
+ { return *__pui < __cui; }
+ };
+
+#if defined __GTHREADS
+ __mutex_type&
+ _M_get_mutex()
+ {
+ static __mutex_type _S_mutex;
+ return _S_mutex;
+ }
+#endif
+
+ vector_type&
+ _M_get_free_list()
+ {
+ static vector_type _S_free_list;
+ return _S_free_list;
+ }
+
+ /** @brief Performs validation of memory based on their size.
+ *
+ * @param __addr The pointer to the memory block to be
+ * validated.
+ *
+ * @detail Validates the memory block passed to this function and
+ * appropriately performs the action of managing the free list of
+ * blocks by adding this block to the free list or deleting this
+ * or larger blocks from the free list.
+ */
+ void
+ _M_validate(size_t* __addr) throw()
+ {
+ vector_type& __free_list = _M_get_free_list();
+ const vector_type::size_type __max_size = 64;
+ if (__free_list.size() >= __max_size)
+ {
+ // Ok, the threshold value has been reached. We determine
+ // which block to remove from the list of free blocks.
+ if (*__addr >= *__free_list.back())
+ {
+ // Ok, the new block is greater than or equal to the
+ // last block in the list of free blocks. We just free
+ // the new block.
+ ::operator delete(static_cast<void*>(__addr));
+ return;
+ }
+ else
+ {
+ // Deallocate the last block in the list of free lists,
+ // and insert the new one in its correct position.
+ ::operator delete(static_cast<void*>(__free_list.back()));
+ __free_list.pop_back();
+ }
+ }
+
+ // Just add the block to the list of free lists unconditionally.
+ iterator __temp = __gnu_cxx::__detail::__lower_bound
+ (__free_list.begin(), __free_list.end(),
+ *__addr, _LT_pointer_compare());
+
+ // We may insert the new free list before _temp;
+ __free_list.insert(__temp, __addr);
+ }
+
+ /** @brief Decides whether the wastage of memory is acceptable for
+ * the current memory request and returns accordingly.
+ *
+ * @param __block_size The size of the block available in the free
+ * list.
+ *
+ * @param __required_size The required size of the memory block.
+ *
+ * @return true if the wastage incurred is acceptable, else returns
+ * false.
+ */
+ bool
+ _M_should_i_give(size_t __block_size,
+ size_t __required_size) throw()
+ {
+ const size_t __max_wastage_percentage = 36;
+ if (__block_size >= __required_size &&
+ (((__block_size - __required_size) * 100 / __block_size)
+ < __max_wastage_percentage))
+ return true;
+ else
+ return false;
+ }
+
+ public:
+ /** @brief This function returns the block of memory to the
+ * internal free list.
+ *
+ * @param __addr The pointer to the memory block that was given
+ * by a call to the _M_get function.
+ */
+ inline void
+ _M_insert(size_t* __addr) throw()
+ {
+#if defined __GTHREADS
+ __gnu_cxx::__scoped_lock __bfl_lock(_M_get_mutex());
+#endif
+ // Call _M_validate to decide what should be done with
+ // this particular free list.
+ this->_M_validate(reinterpret_cast<size_t*>(__addr) - 1);
+ // See discussion as to why this is 1!
+ }
+
+ /** @brief This function gets a block of memory of the specified
+ * size from the free list.
+ *
+ * @param __sz The size in bytes of the memory required.
+ *
+ * @return A pointer to the new memory block of size at least
+ * equal to that requested.
+ */
+ size_t*
+ _M_get(size_t __sz) throw(std::bad_alloc);
+
+ /** @brief This function just clears the internal Free List, and
+ * gives back all the memory to the OS.
+ */
+ void
+ _M_clear();
+ };
+
+
+ // Forward declare the class.
+ template<typename _Tp>
+ class bitmap_allocator;
+
+ // Specialize for void:
+ template<>
+ class bitmap_allocator<void>
+ {
+ public:
+ typedef void* pointer;
+ typedef const void* const_pointer;
+
+ // Reference-to-void members are impossible.
+ typedef void value_type;
+ template<typename _Tp1>
+ struct rebind
+ {
+ typedef bitmap_allocator<_Tp1> other;
+ };
+ };
+
+ /**
+ * @brief Bitmap Allocator, primary template.
+ * @ingroup allocators
+ */
+ template<typename _Tp>
+ class bitmap_allocator : private free_list
+ {
+ public:
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Tp* pointer;
+ typedef const _Tp* const_pointer;
+ typedef _Tp& reference;
+ typedef const _Tp& const_reference;
+ typedef _Tp value_type;
+ typedef free_list::__mutex_type __mutex_type;
+
+ template<typename _Tp1>
+ struct rebind
+ {
+ typedef bitmap_allocator<_Tp1> other;
+ };
+
+ private:
+ template<size_t _BSize, size_t _AlignSize>
+ struct aligned_size
+ {
+ enum
+ {
+ modulus = _BSize % _AlignSize,
+ value = _BSize + (modulus ? _AlignSize - (modulus) : 0)
+ };
+ };
+
+ struct _Alloc_block
+ {
+ char __M_unused[aligned_size<sizeof(value_type),
+ _BALLOC_ALIGN_BYTES>::value];
+ };
+
+
+ typedef typename std::pair<_Alloc_block*, _Alloc_block*> _Block_pair;
+
+ typedef typename
+ __detail::__mini_vector<_Block_pair> _BPVector;
+
+#if defined _GLIBCXX_DEBUG
+ // Complexity: O(lg(N)). Where, N is the number of block of size
+ // sizeof(value_type).
+ void
+ _S_check_for_free_blocks() throw()
+ {
+ typedef typename
+ __gnu_cxx::__detail::_Ffit_finder<_Alloc_block*> _FFF;
+ _FFF __fff;
+ typedef typename _BPVector::iterator _BPiter;
+ _BPiter __bpi =
+ __gnu_cxx::__detail::__find_if
+ (_S_mem_blocks.begin(), _S_mem_blocks.end(),
+ __gnu_cxx::__detail::_Functor_Ref<_FFF>(__fff));
+
+ _GLIBCXX_DEBUG_ASSERT(__bpi == _S_mem_blocks.end());
+ }
+#endif
+
+ /** @brief Responsible for exponentially growing the internal
+ * memory pool.
+ *
+ * @throw std::bad_alloc. If memory can not be allocated.
+ *
+ * @detail Complexity: O(1), but internally depends upon the
+ * complexity of the function free_list::_M_get. The part where
+ * the bitmap headers are written has complexity: O(X),where X
+ * is the number of blocks of size sizeof(value_type) within
+ * the newly acquired block. Having a tight bound.
+ */
+ void
+ _S_refill_pool() throw(std::bad_alloc)
+ {
+#if defined _GLIBCXX_DEBUG
+ _S_check_for_free_blocks();
+#endif
+
+ const size_t __num_bitmaps = (_S_block_size
+ / size_t(__detail::bits_per_block));
+ const size_t __size_to_allocate = sizeof(size_t)
+ + _S_block_size * sizeof(_Alloc_block)
+ + __num_bitmaps * sizeof(size_t);
+
+ size_t* __temp =
+ reinterpret_cast<size_t*>
+ (this->_M_get(__size_to_allocate));
+ *__temp = 0;
+ ++__temp;
+
+ // The Header information goes at the Beginning of the Block.
+ _Block_pair __bp =
+ std::make_pair(reinterpret_cast<_Alloc_block*>
+ (__temp + __num_bitmaps),
+ reinterpret_cast<_Alloc_block*>
+ (__temp + __num_bitmaps)
+ + _S_block_size - 1);
+
+ // Fill the Vector with this information.
+ _S_mem_blocks.push_back(__bp);
+
+ size_t __bit_mask = 0; // 0 Indicates all Allocated.
+ __bit_mask = ~__bit_mask; // 1 Indicates all Free.
+
+ for (size_t __i = 0; __i < __num_bitmaps; ++__i)
+ __temp[__i] = __bit_mask;
+
+ _S_block_size *= 2;
+ }
+
+
+ static _BPVector _S_mem_blocks;
+ static size_t _S_block_size;
+ static __gnu_cxx::__detail::
+ _Bitmap_counter<_Alloc_block*> _S_last_request;
+ static typename _BPVector::size_type _S_last_dealloc_index;
+#if defined __GTHREADS
+ static __mutex_type _S_mut;
+#endif
+
+ public:
+
+ /** @brief Allocates memory for a single object of size
+ * sizeof(_Tp).
+ *
+ * @throw std::bad_alloc. If memory can not be allocated.
+ *
+ * @detail Complexity: Worst case complexity is O(N), but that
+ * is hardly ever hit. If and when this particular case is
+ * encountered, the next few cases are guaranteed to have a
+ * worst case complexity of O(1)! That's why this function
+ * performs very well on average. You can consider this
+ * function to have a complexity referred to commonly as:
+ * Amortized Constant time.
+ */
+ pointer
+ _M_allocate_single_object() throw(std::bad_alloc)
+ {
+#if defined __GTHREADS
+ __gnu_cxx::__scoped_lock __bit_lock(_S_mut);
+#endif
+
+ // The algorithm is something like this: The last_request
+ // variable points to the last accessed Bit Map. When such a
+ // condition occurs, we try to find a free block in the
+ // current bitmap, or succeeding bitmaps until the last bitmap
+ // is reached. If no free block turns up, we resort to First
+ // Fit method.
+
+ // WARNING: Do not re-order the condition in the while
+ // statement below, because it relies on C++'s short-circuit
+ // evaluation. The return from _S_last_request->_M_get() will
+ // NOT be dereference able if _S_last_request->_M_finished()
+ // returns true. This would inevitably lead to a NULL pointer
+ // dereference if tinkered with.
+ while (_S_last_request._M_finished() == false
+ && (*(_S_last_request._M_get()) == 0))
+ {
+ _S_last_request.operator++();
+ }
+
+ if (__builtin_expect(_S_last_request._M_finished() == true, false))
+ {
+ // Fall Back to First Fit algorithm.
+ typedef typename
+ __gnu_cxx::__detail::_Ffit_finder<_Alloc_block*> _FFF;
+ _FFF __fff;
+ typedef typename _BPVector::iterator _BPiter;
+ _BPiter __bpi =
+ __gnu_cxx::__detail::__find_if
+ (_S_mem_blocks.begin(), _S_mem_blocks.end(),
+ __gnu_cxx::__detail::_Functor_Ref<_FFF>(__fff));
+
+ if (__bpi != _S_mem_blocks.end())
+ {
+ // Search was successful. Ok, now mark the first bit from
+ // the right as 0, meaning Allocated. This bit is obtained
+ // by calling _M_get() on __fff.
+ size_t __nz_bit = _Bit_scan_forward(*__fff._M_get());
+ __detail::__bit_allocate(__fff._M_get(), __nz_bit);
+
+ _S_last_request._M_reset(__bpi - _S_mem_blocks.begin());
+
+ // Now, get the address of the bit we marked as allocated.
+ pointer __ret = reinterpret_cast<pointer>
+ (__bpi->first + __fff._M_offset() + __nz_bit);
+ size_t* __puse_count =
+ reinterpret_cast<size_t*>
+ (__bpi->first)
+ - (__gnu_cxx::__detail::__num_bitmaps(*__bpi) + 1);
+
+ ++(*__puse_count);
+ return __ret;
+ }
+ else
+ {
+ // Search was unsuccessful. We Add more memory to the
+ // pool by calling _S_refill_pool().
+ _S_refill_pool();
+
+ // _M_Reset the _S_last_request structure to the first
+ // free block's bit map.
+ _S_last_request._M_reset(_S_mem_blocks.size() - 1);
+
+ // Now, mark that bit as allocated.
+ }
+ }
+
+ // _S_last_request holds a pointer to a valid bit map, that
+ // points to a free block in memory.
+ size_t __nz_bit = _Bit_scan_forward(*_S_last_request._M_get());
+ __detail::__bit_allocate(_S_last_request._M_get(), __nz_bit);
+
+ pointer __ret = reinterpret_cast<pointer>
+ (_S_last_request._M_base() + _S_last_request._M_offset() + __nz_bit);
+
+ size_t* __puse_count = reinterpret_cast<size_t*>
+ (_S_mem_blocks[_S_last_request._M_where()].first)
+ - (__gnu_cxx::__detail::
+ __num_bitmaps(_S_mem_blocks[_S_last_request._M_where()]) + 1);
+
+ ++(*__puse_count);
+ return __ret;
+ }
+
+ /** @brief Deallocates memory that belongs to a single object of
+ * size sizeof(_Tp).
+ *
+ * @detail Complexity: O(lg(N)), but the worst case is not hit
+ * often! This is because containers usually deallocate memory
+ * close to each other and this case is handled in O(1) time by
+ * the deallocate function.
+ */
+ void
+ _M_deallocate_single_object(pointer __p) throw()
+ {
+#if defined __GTHREADS
+ __gnu_cxx::__scoped_lock __bit_lock(_S_mut);
+#endif
+ _Alloc_block* __real_p = reinterpret_cast<_Alloc_block*>(__p);
+
+ typedef typename _BPVector::iterator _Iterator;
+ typedef typename _BPVector::difference_type _Difference_type;
+
+ _Difference_type __diff;
+ long __displacement;
+
+ _GLIBCXX_DEBUG_ASSERT(_S_last_dealloc_index >= 0);
+
+
+ if (__gnu_cxx::__detail::_Inclusive_between<_Alloc_block*>
+ (__real_p) (_S_mem_blocks[_S_last_dealloc_index]))
+ {
+ _GLIBCXX_DEBUG_ASSERT(_S_last_dealloc_index
+ <= _S_mem_blocks.size() - 1);
+
+ // Initial Assumption was correct!
+ __diff = _S_last_dealloc_index;
+ __displacement = __real_p - _S_mem_blocks[__diff].first;
+ }
+ else
+ {
+ _Iterator _iter = __gnu_cxx::__detail::
+ __find_if(_S_mem_blocks.begin(),
+ _S_mem_blocks.end(),
+ __gnu_cxx::__detail::
+ _Inclusive_between<_Alloc_block*>(__real_p));
+
+ _GLIBCXX_DEBUG_ASSERT(_iter != _S_mem_blocks.end());
+
+ __diff = _iter - _S_mem_blocks.begin();
+ __displacement = __real_p - _S_mem_blocks[__diff].first;
+ _S_last_dealloc_index = __diff;
+ }
+
+ // Get the position of the iterator that has been found.
+ const size_t __rotate = (__displacement
+ % size_t(__detail::bits_per_block));
+ size_t* __bitmapC =
+ reinterpret_cast<size_t*>
+ (_S_mem_blocks[__diff].first) - 1;
+ __bitmapC -= (__displacement / size_t(__detail::bits_per_block));
+
+ __detail::__bit_free(__bitmapC, __rotate);
+ size_t* __puse_count = reinterpret_cast<size_t*>
+ (_S_mem_blocks[__diff].first)
+ - (__gnu_cxx::__detail::__num_bitmaps(_S_mem_blocks[__diff]) + 1);
+
+ _GLIBCXX_DEBUG_ASSERT(*__puse_count != 0);
+
+ --(*__puse_count);
+
+ if (__builtin_expect(*__puse_count == 0, false))
+ {
+ _S_block_size /= 2;
+
+ // We can safely remove this block.
+ // _Block_pair __bp = _S_mem_blocks[__diff];
+ this->_M_insert(__puse_count);
+ _S_mem_blocks.erase(_S_mem_blocks.begin() + __diff);
+
+ // Reset the _S_last_request variable to reflect the
+ // erased block. We do this to protect future requests
+ // after the last block has been removed from a particular
+ // memory Chunk, which in turn has been returned to the
+ // free list, and hence had been erased from the vector,
+ // so the size of the vector gets reduced by 1.
+ if ((_Difference_type)_S_last_request._M_where() >= __diff--)
+ _S_last_request._M_reset(__diff);
+
+ // If the Index into the vector of the region of memory
+ // that might hold the next address that will be passed to
+ // deallocated may have been invalidated due to the above
+ // erase procedure being called on the vector, hence we
+ // try to restore this invariant too.
+ if (_S_last_dealloc_index >= _S_mem_blocks.size())
+ {
+ _S_last_dealloc_index =(__diff != -1 ? __diff : 0);
+ _GLIBCXX_DEBUG_ASSERT(_S_last_dealloc_index >= 0);
+ }
+ }
+ }
+
+ public:
+ bitmap_allocator() throw()
+ { }
+
+ bitmap_allocator(const bitmap_allocator&)
+ { }
+
+ template<typename _Tp1>
+ bitmap_allocator(const bitmap_allocator<_Tp1>&) throw()
+ { }
+
+ ~bitmap_allocator() throw()
+ { }
+
+ pointer
+ allocate(size_type __n)
+ {
+ if (__builtin_expect(__n > this->max_size(), false))
+ std::__throw_bad_alloc();
+
+ if (__builtin_expect(__n == 1, true))
+ return this->_M_allocate_single_object();
+ else
+ {
+ const size_type __b = __n * sizeof(value_type);
+ return reinterpret_cast<pointer>(::operator new(__b));
+ }
+ }
+
+ pointer
+ allocate(size_type __n, typename bitmap_allocator<void>::const_pointer)
+ { return allocate(__n); }
+
+ void
+ deallocate(pointer __p, size_type __n) throw()
+ {
+ if (__builtin_expect(__p != 0, true))
+ {
+ if (__builtin_expect(__n == 1, true))
+ this->_M_deallocate_single_object(__p);
+ else
+ ::operator delete(__p);
+ }
+ }
+
+ pointer
+ address(reference __r) const
+ { return &__r; }
+
+ const_pointer
+ address(const_reference __r) const
+ { return &__r; }
+
+ size_type
+ max_size() const throw()
+ { return size_type(-1) / sizeof(value_type); }
+
+ void
+ construct(pointer __p, const_reference __data)
+ { ::new((void *)__p) value_type(__data); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename... _Args>
+ void
+ construct(pointer __p, _Args&&... __args)
+ { ::new((void *)__p) _Tp(std::forward<_Args>(__args)...); }
+#endif
+
+ void
+ destroy(pointer __p)
+ { __p->~value_type(); }
+ };
+
+ template<typename _Tp1, typename _Tp2>
+ bool
+ operator==(const bitmap_allocator<_Tp1>&,
+ const bitmap_allocator<_Tp2>&) throw()
+ { return true; }
+
+ template<typename _Tp1, typename _Tp2>
+ bool
+ operator!=(const bitmap_allocator<_Tp1>&,
+ const bitmap_allocator<_Tp2>&) throw()
+ { return false; }
+
+ // Static member definitions.
+ template<typename _Tp>
+ typename bitmap_allocator<_Tp>::_BPVector
+ bitmap_allocator<_Tp>::_S_mem_blocks;
+
+ template<typename _Tp>
+ size_t bitmap_allocator<_Tp>::_S_block_size =
+ 2 * size_t(__detail::bits_per_block);
+
+ template<typename _Tp>
+ typename __gnu_cxx::bitmap_allocator<_Tp>::_BPVector::size_type
+ bitmap_allocator<_Tp>::_S_last_dealloc_index = 0;
+
+ template<typename _Tp>
+ __gnu_cxx::__detail::_Bitmap_counter
+ <typename bitmap_allocator<_Tp>::_Alloc_block*>
+ bitmap_allocator<_Tp>::_S_last_request(_S_mem_blocks);
+
+#if defined __GTHREADS
+ template<typename _Tp>
+ typename bitmap_allocator<_Tp>::__mutex_type
+ bitmap_allocator<_Tp>::_S_mut;
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
+
diff --git a/i686-linux/include/c++/4.4.3/ext/cast.h b/i686-linux/include/c++/4.4.3/ext/cast.h
new file mode 100644
index 0000000..3ffad7c
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/cast.h
@@ -0,0 +1,113 @@
+// <cast.h> -*- C++ -*-
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+#ifndef _CAST_H
+#define _CAST_H 1
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx);
+
+ /**
+ * These functions are here to allow containers to support non standard
+ * pointer types. For normal pointers, these resolve to the use of the
+ * standard cast operation. For other types the functions will perform
+ * the apprpriate cast to/from the custom pointer class so long as that
+ * class meets the following conditions:
+ * 1) has a typedef element_type which names tehe type it points to.
+ * 2) has a get() const method which returns element_type*.
+ * 3) has a constructor which can take one element_type* argument.
+ */
+
+ /**
+ * This type supports the semantics of the pointer cast operators (below.)
+ */
+ template<typename _ToType>
+ struct _Caster
+ { typedef typename _ToType::element_type* type; };
+
+ template<typename _ToType>
+ struct _Caster<_ToType*>
+ { typedef _ToType* type; };
+
+ /**
+ * Casting operations for cases where _FromType is not a standard pointer.
+ * _ToType can be a standard or non-standard pointer. Given that _FromType
+ * is not a pointer, it must have a get() method that returns the standard
+ * pointer equivalent of the address it points to, and must have an
+ * element_type typedef which names the type it points to.
+ */
+ template<typename _ToType, typename _FromType>
+ inline _ToType
+ __static_pointer_cast(const _FromType& __arg)
+ { return _ToType(static_cast<typename _Caster<_ToType>::
+ type>(__arg.get())); }
+
+ template<typename _ToType, typename _FromType>
+ inline _ToType
+ __dynamic_pointer_cast(const _FromType& __arg)
+ { return _ToType(dynamic_cast<typename _Caster<_ToType>::
+ type>(__arg.get())); }
+
+ template<typename _ToType, typename _FromType>
+ inline _ToType
+ __const_pointer_cast(const _FromType& __arg)
+ { return _ToType(const_cast<typename _Caster<_ToType>::
+ type>(__arg.get())); }
+
+ template<typename _ToType, typename _FromType>
+ inline _ToType
+ __reinterpret_pointer_cast(const _FromType& __arg)
+ { return _ToType(reinterpret_cast<typename _Caster<_ToType>::
+ type>(__arg.get())); }
+
+ /**
+ * Casting operations for cases where _FromType is a standard pointer.
+ * _ToType can be a standard or non-standard pointer.
+ */
+ template<typename _ToType, typename _FromType>
+ inline _ToType
+ __static_pointer_cast(_FromType* __arg)
+ { return _ToType(static_cast<typename _Caster<_ToType>::
+ type>(__arg)); }
+
+ template<typename _ToType, typename _FromType>
+ inline _ToType
+ __dynamic_pointer_cast(_FromType* __arg)
+ { return _ToType(dynamic_cast<typename _Caster<_ToType>::
+ type>(__arg)); }
+
+ template<typename _ToType, typename _FromType>
+ inline _ToType
+ __const_pointer_cast(_FromType* __arg)
+ { return _ToType(const_cast<typename _Caster<_ToType>::
+ type>(__arg)); }
+
+ template<typename _ToType, typename _FromType>
+ inline _ToType
+ __reinterpret_pointer_cast(_FromType* __arg)
+ { return _ToType(reinterpret_cast<typename _Caster<_ToType>::
+ type>(__arg)); }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif // _CAST_H
diff --git a/i686-linux/include/c++/4.4.3/ext/codecvt_specializations.h b/i686-linux/include/c++/4.4.3/ext/codecvt_specializations.h
new file mode 100644
index 0000000..89adb3f
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/codecvt_specializations.h
@@ -0,0 +1,507 @@
+// Locale support (codecvt) -*- C++ -*-
+
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+//
+// ISO C++ 14882: 22.2.1.5 Template class codecvt
+//
+
+// Written by Benjamin Kosnik <bkoz@redhat.com>
+
+/** @file ext/codecvt_specializations.h
+ * This file is a GNU extension to the Standard C++ Library.
+ */
+
+#ifndef _EXT_CODECVT_SPECIALIZATIONS_H
+#define _EXT_CODECVT_SPECIALIZATIONS_H 1
+
+#include <bits/c++config.h>
+#include <locale>
+#include <iconv.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ /// Extension to use iconv for dealing with character encodings.
+ // This includes conversions and comparisons between various character
+ // sets. This object encapsulates data that may need to be shared between
+ // char_traits, codecvt and ctype.
+ class encoding_state
+ {
+ public:
+ // Types:
+ // NB: A conversion descriptor subsumes and enhances the
+ // functionality of a simple state type such as mbstate_t.
+ typedef iconv_t descriptor_type;
+
+ protected:
+ // Name of internal character set encoding.
+ std::string _M_int_enc;
+
+ // Name of external character set encoding.
+ std::string _M_ext_enc;
+
+ // Conversion descriptor between external encoding to internal encoding.
+ descriptor_type _M_in_desc;
+
+ // Conversion descriptor between internal encoding to external encoding.
+ descriptor_type _M_out_desc;
+
+ // The byte-order marker for the external encoding, if necessary.
+ int _M_ext_bom;
+
+ // The byte-order marker for the internal encoding, if necessary.
+ int _M_int_bom;
+
+ // Number of external bytes needed to construct one complete
+ // character in the internal encoding.
+ // NB: -1 indicates variable, or stateful, encodings.
+ int _M_bytes;
+
+ public:
+ explicit
+ encoding_state()
+ : _M_in_desc(0), _M_out_desc(0), _M_ext_bom(0), _M_int_bom(0), _M_bytes(0)
+ { }
+
+ explicit
+ encoding_state(const char* __int, const char* __ext,
+ int __ibom = 0, int __ebom = 0, int __bytes = 1)
+ : _M_int_enc(__int), _M_ext_enc(__ext), _M_in_desc(0), _M_out_desc(0),
+ _M_ext_bom(__ebom), _M_int_bom(__ibom), _M_bytes(__bytes)
+ { init(); }
+
+ // 21.1.2 traits typedefs
+ // p4
+ // typedef STATE_T state_type
+ // requires: state_type shall meet the requirements of
+ // CopyConstructible types (20.1.3)
+ // NB: This does not preserve the actual state of the conversion
+ // descriptor member, but it does duplicate the encoding
+ // information.
+ encoding_state(const encoding_state& __obj) : _M_in_desc(0), _M_out_desc(0)
+ { construct(__obj); }
+
+ // Need assignment operator as well.
+ encoding_state&
+ operator=(const encoding_state& __obj)
+ {
+ construct(__obj);
+ return *this;
+ }
+
+ ~encoding_state()
+ { destroy(); }
+
+ bool
+ good() const throw()
+ {
+ const descriptor_type __err = (iconv_t)(-1);
+ bool __test = _M_in_desc && _M_in_desc != __err;
+ __test &= _M_out_desc && _M_out_desc != __err;
+ return __test;
+ }
+
+ int
+ character_ratio() const
+ { return _M_bytes; }
+
+ const std::string
+ internal_encoding() const
+ { return _M_int_enc; }
+
+ int
+ internal_bom() const
+ { return _M_int_bom; }
+
+ const std::string
+ external_encoding() const
+ { return _M_ext_enc; }
+
+ int
+ external_bom() const
+ { return _M_ext_bom; }
+
+ const descriptor_type&
+ in_descriptor() const
+ { return _M_in_desc; }
+
+ const descriptor_type&
+ out_descriptor() const
+ { return _M_out_desc; }
+
+ protected:
+ void
+ init()
+ {
+ const descriptor_type __err = (iconv_t)(-1);
+ const bool __have_encodings = _M_int_enc.size() && _M_ext_enc.size();
+ if (!_M_in_desc && __have_encodings)
+ {
+ _M_in_desc = iconv_open(_M_int_enc.c_str(), _M_ext_enc.c_str());
+ if (_M_in_desc == __err)
+ std::__throw_runtime_error(__N("encoding_state::_M_init "
+ "creating iconv input descriptor failed"));
+ }
+ if (!_M_out_desc && __have_encodings)
+ {
+ _M_out_desc = iconv_open(_M_ext_enc.c_str(), _M_int_enc.c_str());
+ if (_M_out_desc == __err)
+ std::__throw_runtime_error(__N("encoding_state::_M_init "
+ "creating iconv output descriptor failed"));
+ }
+ }
+
+ void
+ construct(const encoding_state& __obj)
+ {
+ destroy();
+ _M_int_enc = __obj._M_int_enc;
+ _M_ext_enc = __obj._M_ext_enc;
+ _M_ext_bom = __obj._M_ext_bom;
+ _M_int_bom = __obj._M_int_bom;
+ _M_bytes = __obj._M_bytes;
+ init();
+ }
+
+ void
+ destroy() throw()
+ {
+ const descriptor_type __err = (iconv_t)(-1);
+ if (_M_in_desc && _M_in_desc != __err)
+ {
+ iconv_close(_M_in_desc);
+ _M_in_desc = 0;
+ }
+ if (_M_out_desc && _M_out_desc != __err)
+ {
+ iconv_close(_M_out_desc);
+ _M_out_desc = 0;
+ }
+ }
+ };
+
+ /// encoding_char_traits
+ // Custom traits type with encoding_state for the state type, and the
+ // associated fpos<encoding_state> for the position type, all other
+ // bits equivalent to the required char_traits instantiations.
+ template<typename _CharT>
+ struct encoding_char_traits : public std::char_traits<_CharT>
+ {
+ typedef encoding_state state_type;
+ typedef typename std::fpos<state_type> pos_type;
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ using __gnu_cxx::encoding_state;
+
+ /// codecvt<InternT, _ExternT, encoding_state> specialization.
+ // This partial specialization takes advantage of iconv to provide
+ // code conversions between a large number of character encodings.
+ template<typename _InternT, typename _ExternT>
+ class codecvt<_InternT, _ExternT, encoding_state>
+ : public __codecvt_abstract_base<_InternT, _ExternT, encoding_state>
+ {
+ public:
+ // Types:
+ typedef codecvt_base::result result;
+ typedef _InternT intern_type;
+ typedef _ExternT extern_type;
+ typedef __gnu_cxx::encoding_state state_type;
+ typedef state_type::descriptor_type descriptor_type;
+
+ // Data Members:
+ static locale::id id;
+
+ explicit
+ codecvt(size_t __refs = 0)
+ : __codecvt_abstract_base<intern_type, extern_type, state_type>(__refs)
+ { }
+
+ explicit
+ codecvt(state_type& __enc, size_t __refs = 0)
+ : __codecvt_abstract_base<intern_type, extern_type, state_type>(__refs)
+ { }
+
+ protected:
+ virtual
+ ~codecvt() { }
+
+ virtual result
+ do_out(state_type& __state, const intern_type* __from,
+ const intern_type* __from_end, const intern_type*& __from_next,
+ extern_type* __to, extern_type* __to_end,
+ extern_type*& __to_next) const;
+
+ virtual result
+ do_unshift(state_type& __state, extern_type* __to,
+ extern_type* __to_end, extern_type*& __to_next) const;
+
+ virtual result
+ do_in(state_type& __state, const extern_type* __from,
+ const extern_type* __from_end, const extern_type*& __from_next,
+ intern_type* __to, intern_type* __to_end,
+ intern_type*& __to_next) const;
+
+ virtual int
+ do_encoding() const throw();
+
+ virtual bool
+ do_always_noconv() const throw();
+
+ virtual int
+ do_length(state_type&, const extern_type* __from,
+ const extern_type* __end, size_t __max) const;
+
+ virtual int
+ do_max_length() const throw();
+ };
+
+ template<typename _InternT, typename _ExternT>
+ locale::id
+ codecvt<_InternT, _ExternT, encoding_state>::id;
+
+ // This adaptor works around the signature problems of the second
+ // argument to iconv(): SUSv2 and others use 'const char**', but glibc 2.2
+ // uses 'char**', which matches the POSIX 1003.1-2001 standard.
+ // Using this adaptor, g++ will do the work for us.
+ template<typename _Tp>
+ inline size_t
+ __iconv_adaptor(size_t(*__func)(iconv_t, _Tp, size_t*, char**, size_t*),
+ iconv_t __cd, char** __inbuf, size_t* __inbytes,
+ char** __outbuf, size_t* __outbytes)
+ { return __func(__cd, (_Tp)__inbuf, __inbytes, __outbuf, __outbytes); }
+
+ template<typename _InternT, typename _ExternT>
+ codecvt_base::result
+ codecvt<_InternT, _ExternT, encoding_state>::
+ do_out(state_type& __state, const intern_type* __from,
+ const intern_type* __from_end, const intern_type*& __from_next,
+ extern_type* __to, extern_type* __to_end,
+ extern_type*& __to_next) const
+ {
+ result __ret = codecvt_base::error;
+ if (__state.good())
+ {
+ const descriptor_type& __desc = __state.out_descriptor();
+ const size_t __fmultiple = sizeof(intern_type);
+ size_t __fbytes = __fmultiple * (__from_end - __from);
+ const size_t __tmultiple = sizeof(extern_type);
+ size_t __tbytes = __tmultiple * (__to_end - __to);
+
+ // Argument list for iconv specifies a byte sequence. Thus,
+ // all to/from arrays must be brutally casted to char*.
+ char* __cto = reinterpret_cast<char*>(__to);
+ char* __cfrom;
+ size_t __conv;
+
+ // Some encodings need a byte order marker as the first item
+ // in the byte stream, to designate endian-ness. The default
+ // value for the byte order marker is NULL, so if this is
+ // the case, it's not necessary and we can just go on our
+ // merry way.
+ int __int_bom = __state.internal_bom();
+ if (__int_bom)
+ {
+ size_t __size = __from_end - __from;
+ intern_type* __cfixed = static_cast<intern_type*>
+ (__builtin_alloca(sizeof(intern_type) * (__size + 1)));
+ __cfixed[0] = static_cast<intern_type>(__int_bom);
+ char_traits<intern_type>::copy(__cfixed + 1, __from, __size);
+ __cfrom = reinterpret_cast<char*>(__cfixed);
+ __conv = __iconv_adaptor(iconv, __desc, &__cfrom,
+ &__fbytes, &__cto, &__tbytes);
+ }
+ else
+ {
+ intern_type* __cfixed = const_cast<intern_type*>(__from);
+ __cfrom = reinterpret_cast<char*>(__cfixed);
+ __conv = __iconv_adaptor(iconv, __desc, &__cfrom, &__fbytes,
+ &__cto, &__tbytes);
+ }
+
+ if (__conv != size_t(-1))
+ {
+ __from_next = reinterpret_cast<const intern_type*>(__cfrom);
+ __to_next = reinterpret_cast<extern_type*>(__cto);
+ __ret = codecvt_base::ok;
+ }
+ else
+ {
+ if (__fbytes < __fmultiple * (__from_end - __from))
+ {
+ __from_next = reinterpret_cast<const intern_type*>(__cfrom);
+ __to_next = reinterpret_cast<extern_type*>(__cto);
+ __ret = codecvt_base::partial;
+ }
+ else
+ __ret = codecvt_base::error;
+ }
+ }
+ return __ret;
+ }
+
+ template<typename _InternT, typename _ExternT>
+ codecvt_base::result
+ codecvt<_InternT, _ExternT, encoding_state>::
+ do_unshift(state_type& __state, extern_type* __to,
+ extern_type* __to_end, extern_type*& __to_next) const
+ {
+ result __ret = codecvt_base::error;
+ if (__state.good())
+ {
+ const descriptor_type& __desc = __state.in_descriptor();
+ const size_t __tmultiple = sizeof(intern_type);
+ size_t __tlen = __tmultiple * (__to_end - __to);
+
+ // Argument list for iconv specifies a byte sequence. Thus,
+ // all to/from arrays must be brutally casted to char*.
+ char* __cto = reinterpret_cast<char*>(__to);
+ size_t __conv = __iconv_adaptor(iconv,__desc, NULL, NULL,
+ &__cto, &__tlen);
+
+ if (__conv != size_t(-1))
+ {
+ __to_next = reinterpret_cast<extern_type*>(__cto);
+ if (__tlen == __tmultiple * (__to_end - __to))
+ __ret = codecvt_base::noconv;
+ else if (__tlen == 0)
+ __ret = codecvt_base::ok;
+ else
+ __ret = codecvt_base::partial;
+ }
+ else
+ __ret = codecvt_base::error;
+ }
+ return __ret;
+ }
+
+ template<typename _InternT, typename _ExternT>
+ codecvt_base::result
+ codecvt<_InternT, _ExternT, encoding_state>::
+ do_in(state_type& __state, const extern_type* __from,
+ const extern_type* __from_end, const extern_type*& __from_next,
+ intern_type* __to, intern_type* __to_end,
+ intern_type*& __to_next) const
+ {
+ result __ret = codecvt_base::error;
+ if (__state.good())
+ {
+ const descriptor_type& __desc = __state.in_descriptor();
+ const size_t __fmultiple = sizeof(extern_type);
+ size_t __flen = __fmultiple * (__from_end - __from);
+ const size_t __tmultiple = sizeof(intern_type);
+ size_t __tlen = __tmultiple * (__to_end - __to);
+
+ // Argument list for iconv specifies a byte sequence. Thus,
+ // all to/from arrays must be brutally casted to char*.
+ char* __cto = reinterpret_cast<char*>(__to);
+ char* __cfrom;
+ size_t __conv;
+
+ // Some encodings need a byte order marker as the first item
+ // in the byte stream, to designate endian-ness. The default
+ // value for the byte order marker is NULL, so if this is
+ // the case, it's not necessary and we can just go on our
+ // merry way.
+ int __ext_bom = __state.external_bom();
+ if (__ext_bom)
+ {
+ size_t __size = __from_end - __from;
+ extern_type* __cfixed = static_cast<extern_type*>
+ (__builtin_alloca(sizeof(extern_type) * (__size + 1)));
+ __cfixed[0] = static_cast<extern_type>(__ext_bom);
+ char_traits<extern_type>::copy(__cfixed + 1, __from, __size);
+ __cfrom = reinterpret_cast<char*>(__cfixed);
+ __conv = __iconv_adaptor(iconv, __desc, &__cfrom,
+ &__flen, &__cto, &__tlen);
+ }
+ else
+ {
+ extern_type* __cfixed = const_cast<extern_type*>(__from);
+ __cfrom = reinterpret_cast<char*>(__cfixed);
+ __conv = __iconv_adaptor(iconv, __desc, &__cfrom,
+ &__flen, &__cto, &__tlen);
+ }
+
+
+ if (__conv != size_t(-1))
+ {
+ __from_next = reinterpret_cast<const extern_type*>(__cfrom);
+ __to_next = reinterpret_cast<intern_type*>(__cto);
+ __ret = codecvt_base::ok;
+ }
+ else
+ {
+ if (__flen < static_cast<size_t>(__from_end - __from))
+ {
+ __from_next = reinterpret_cast<const extern_type*>(__cfrom);
+ __to_next = reinterpret_cast<intern_type*>(__cto);
+ __ret = codecvt_base::partial;
+ }
+ else
+ __ret = codecvt_base::error;
+ }
+ }
+ return __ret;
+ }
+
+ template<typename _InternT, typename _ExternT>
+ int
+ codecvt<_InternT, _ExternT, encoding_state>::
+ do_encoding() const throw()
+ {
+ int __ret = 0;
+ if (sizeof(_ExternT) <= sizeof(_InternT))
+ __ret = sizeof(_InternT) / sizeof(_ExternT);
+ return __ret;
+ }
+
+ template<typename _InternT, typename _ExternT>
+ bool
+ codecvt<_InternT, _ExternT, encoding_state>::
+ do_always_noconv() const throw()
+ { return false; }
+
+ template<typename _InternT, typename _ExternT>
+ int
+ codecvt<_InternT, _ExternT, encoding_state>::
+ do_length(state_type&, const extern_type* __from,
+ const extern_type* __end, size_t __max) const
+ { return std::min(__max, static_cast<size_t>(__end - __from)); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 74. Garbled text for codecvt::do_max_length
+ template<typename _InternT, typename _ExternT>
+ int
+ codecvt<_InternT, _ExternT, encoding_state>::
+ do_max_length() const throw()
+ { return 1; }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/concurrence.h b/i686-linux/include/c++/4.4.3/ext/concurrence.h
new file mode 100644
index 0000000..71f8cd0
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/concurrence.h
@@ -0,0 +1,322 @@
+// Support for concurrent programing -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file concurrence.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _CONCURRENCE_H
+#define _CONCURRENCE_H 1
+
+#include <exception>
+#include <bits/gthr.h>
+#include <bits/functexcept.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ // Available locking policies:
+ // _S_single single-threaded code that doesn't need to be locked.
+ // _S_mutex multi-threaded code that requires additional support
+ // from gthr.h or abstraction layers in concurrence.h.
+ // _S_atomic multi-threaded code using atomic operations.
+ enum _Lock_policy { _S_single, _S_mutex, _S_atomic };
+
+ // Compile time constant that indicates prefered locking policy in
+ // the current configuration.
+ static const _Lock_policy __default_lock_policy =
+#ifdef __GTHREADS
+#if (defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2) \
+ && defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4))
+ _S_atomic;
+#else
+ _S_mutex;
+#endif
+#else
+ _S_single;
+#endif
+
+ // NB: As this is used in libsupc++, need to only depend on
+ // exception. No stdexception classes, no use of std::string.
+ class __concurrence_lock_error : public std::exception
+ {
+ public:
+ virtual char const*
+ what() const throw()
+ { return "__gnu_cxx::__concurrence_lock_error"; }
+ };
+
+ class __concurrence_unlock_error : public std::exception
+ {
+ public:
+ virtual char const*
+ what() const throw()
+ { return "__gnu_cxx::__concurrence_unlock_error"; }
+ };
+
+ class __concurrence_broadcast_error : public std::exception
+ {
+ public:
+ virtual char const*
+ what() const throw()
+ { return "__gnu_cxx::__concurrence_broadcast_error"; }
+ };
+
+ class __concurrence_wait_error : public std::exception
+ {
+ public:
+ virtual char const*
+ what() const throw()
+ { return "__gnu_cxx::__concurrence_wait_error"; }
+ };
+
+ // Substitute for concurrence_error object in the case of -fno-exceptions.
+ inline void
+ __throw_concurrence_lock_error()
+ {
+#if __EXCEPTIONS
+ throw __concurrence_lock_error();
+#else
+ __builtin_abort();
+#endif
+ }
+
+ inline void
+ __throw_concurrence_unlock_error()
+ {
+#if __EXCEPTIONS
+ throw __concurrence_unlock_error();
+#else
+ __builtin_abort();
+#endif
+ }
+
+#ifdef __GTHREAD_HAS_COND
+ inline void
+ __throw_concurrence_broadcast_error()
+ {
+#if __EXCEPTIONS
+ throw __concurrence_broadcast_error();
+#else
+ __builtin_abort();
+#endif
+ }
+
+ inline void
+ __throw_concurrence_wait_error()
+ {
+#if __EXCEPTIONS
+ throw __concurrence_wait_error();
+#else
+ __builtin_abort();
+#endif
+ }
+#endif
+
+ class __mutex
+ {
+ private:
+ __gthread_mutex_t _M_mutex;
+
+ __mutex(const __mutex&);
+ __mutex& operator=(const __mutex&);
+
+ public:
+ __mutex()
+ {
+#if __GTHREADS
+ if (__gthread_active_p())
+ {
+#if defined __GTHREAD_MUTEX_INIT
+ __gthread_mutex_t __tmp = __GTHREAD_MUTEX_INIT;
+ _M_mutex = __tmp;
+#else
+ __GTHREAD_MUTEX_INIT_FUNCTION(&_M_mutex);
+#endif
+ }
+#endif
+ }
+
+ void lock()
+ {
+#if __GTHREADS
+ if (__gthread_active_p())
+ {
+ if (__gthread_mutex_lock(&_M_mutex) != 0)
+ __throw_concurrence_lock_error();
+ }
+#endif
+ }
+
+ void unlock()
+ {
+#if __GTHREADS
+ if (__gthread_active_p())
+ {
+ if (__gthread_mutex_unlock(&_M_mutex) != 0)
+ __throw_concurrence_unlock_error();
+ }
+#endif
+ }
+
+ __gthread_mutex_t* gthread_mutex(void)
+ { return &_M_mutex; }
+ };
+
+ class __recursive_mutex
+ {
+ private:
+ __gthread_recursive_mutex_t _M_mutex;
+
+ __recursive_mutex(const __recursive_mutex&);
+ __recursive_mutex& operator=(const __recursive_mutex&);
+
+ public:
+ __recursive_mutex()
+ {
+#if __GTHREADS
+ if (__gthread_active_p())
+ {
+#if defined __GTHREAD_RECURSIVE_MUTEX_INIT
+ __gthread_recursive_mutex_t __tmp = __GTHREAD_RECURSIVE_MUTEX_INIT;
+ _M_mutex = __tmp;
+#else
+ __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION(&_M_mutex);
+#endif
+ }
+#endif
+ }
+
+ void lock()
+ {
+#if __GTHREADS
+ if (__gthread_active_p())
+ {
+ if (__gthread_recursive_mutex_lock(&_M_mutex) != 0)
+ __throw_concurrence_lock_error();
+ }
+#endif
+ }
+
+ void unlock()
+ {
+#if __GTHREADS
+ if (__gthread_active_p())
+ {
+ if (__gthread_recursive_mutex_unlock(&_M_mutex) != 0)
+ __throw_concurrence_unlock_error();
+ }
+#endif
+ }
+
+ __gthread_recursive_mutex_t* gthread_recursive_mutex(void)
+ { return &_M_mutex; }
+ };
+
+ /// Scoped lock idiom.
+ // Acquire the mutex here with a constructor call, then release with
+ // the destructor call in accordance with RAII style.
+ class __scoped_lock
+ {
+ public:
+ typedef __mutex __mutex_type;
+
+ private:
+ __mutex_type& _M_device;
+
+ __scoped_lock(const __scoped_lock&);
+ __scoped_lock& operator=(const __scoped_lock&);
+
+ public:
+ explicit __scoped_lock(__mutex_type& __name) : _M_device(__name)
+ { _M_device.lock(); }
+
+ ~__scoped_lock() throw()
+ { _M_device.unlock(); }
+ };
+
+#ifdef __GTHREAD_HAS_COND
+ class __cond
+ {
+ private:
+ __gthread_cond_t _M_cond;
+
+ __cond(const __cond&);
+ __cond& operator=(const __cond&);
+
+ public:
+ __cond()
+ {
+#if __GTHREADS
+ if (__gthread_active_p())
+ {
+#if defined __GTHREAD_COND_INIT
+ __gthread_cond_t __tmp = __GTHREAD_COND_INIT;
+ _M_cond = __tmp;
+#else
+ __GTHREAD_COND_INIT_FUNCTION(&_M_cond);
+#endif
+ }
+#endif
+ }
+
+ void broadcast()
+ {
+#if __GTHREADS
+ if (__gthread_active_p())
+ {
+ if (__gthread_cond_broadcast(&_M_cond) != 0)
+ __throw_concurrence_broadcast_error();
+ }
+#endif
+ }
+
+ void wait(__mutex *mutex)
+ {
+#if __GTHREADS
+ {
+ if (__gthread_cond_wait(&_M_cond, mutex->gthread_mutex()) != 0)
+ __throw_concurrence_wait_error();
+ }
+#endif
+ }
+
+ void wait_recursive(__recursive_mutex *mutex)
+ {
+#if __GTHREADS
+ {
+ if (__gthread_cond_wait_recursive(&_M_cond,
+ mutex->gthread_recursive_mutex())
+ != 0)
+ __throw_concurrence_wait_error();
+ }
+#endif
+ }
+ };
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/debug_allocator.h b/i686-linux/include/c++/4.4.3/ext/debug_allocator.h
new file mode 100644
index 0000000..18d8049
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/debug_allocator.h
@@ -0,0 +1,124 @@
+// Allocators -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1996-1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file ext/debug_allocator.h
+ * This file is a GNU extension to the Standard C++ Library.
+ * You should only include this header if you are using GCC 3 or later.
+ */
+
+#ifndef _DEBUG_ALLOCATOR_H
+#define _DEBUG_ALLOCATOR_H 1
+
+#include <stdexcept>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::size_t;
+
+ /**
+ * @brief A meta-allocator with debugging bits, as per [20.4].
+ * @ingroup allocators
+ *
+ * This is precisely the allocator defined in the C++ Standard.
+ * - all allocation calls operator new
+ * - all deallocation calls operator delete
+ */
+ template<typename _Alloc>
+ class debug_allocator
+ {
+ public:
+ typedef typename _Alloc::size_type size_type;
+ typedef typename _Alloc::difference_type difference_type;
+ typedef typename _Alloc::pointer pointer;
+ typedef typename _Alloc::const_pointer const_pointer;
+ typedef typename _Alloc::reference reference;
+ typedef typename _Alloc::const_reference const_reference;
+ typedef typename _Alloc::value_type value_type;
+
+ private:
+ // _M_extra is the number of objects that correspond to the
+ // extra space where debug information is stored.
+ size_type _M_extra;
+
+ _Alloc _M_allocator;
+
+ public:
+ debug_allocator()
+ {
+ const size_t __obj_size = sizeof(value_type);
+ _M_extra = (sizeof(size_type) + __obj_size - 1) / __obj_size;
+ }
+
+ pointer
+ allocate(size_type __n)
+ {
+ pointer __res = _M_allocator.allocate(__n + _M_extra);
+ size_type* __ps = reinterpret_cast<size_type*>(__res);
+ *__ps = __n;
+ return __res + _M_extra;
+ }
+
+ pointer
+ allocate(size_type __n, const void* __hint)
+ {
+ pointer __res = _M_allocator.allocate(__n + _M_extra, __hint);
+ size_type* __ps = reinterpret_cast<size_type*>(__res);
+ *__ps = __n;
+ return __res + _M_extra;
+ }
+
+ void
+ deallocate(pointer __p, size_type __n)
+ {
+ if (__p)
+ {
+ pointer __real_p = __p - _M_extra;
+ if (*reinterpret_cast<size_type*>(__real_p) != __n)
+ {
+ throw std::runtime_error("debug_allocator::deallocate"
+ " wrong size");
+ }
+ _M_allocator.deallocate(__real_p, __n + _M_extra);
+ }
+ else
+ throw std::runtime_error("debug_allocator::deallocate null pointer");
+ }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/enc_filebuf.h b/i686-linux/include/c++/4.4.3/ext/enc_filebuf.h
new file mode 100644
index 0000000..4f83567
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/enc_filebuf.h
@@ -0,0 +1,62 @@
+// filebuf with encoding state type -*- C++ -*-
+
+// Copyright (C) 2002, 2003, 2004, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ext/enc_filebuf.h
+ * This file is a GNU extension to the Standard C++ Library.
+ */
+
+#ifndef _EXT_ENC_FILEBUF_H
+#define _EXT_ENC_FILEBUF_H 1
+
+#include <fstream>
+#include <locale>
+#include <ext/codecvt_specializations.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ /// class enc_filebuf.
+ template<typename _CharT>
+ class enc_filebuf
+ : public std::basic_filebuf<_CharT, encoding_char_traits<_CharT> >
+ {
+ public:
+ typedef encoding_char_traits<_CharT> traits_type;
+ typedef typename traits_type::state_type state_type;
+ typedef typename traits_type::pos_type pos_type;
+
+ enc_filebuf(state_type& __state)
+ : std::basic_filebuf<_CharT, encoding_char_traits<_CharT> >()
+ { this->_M_state_beg = __state; }
+
+ private:
+ // concept requirements:
+ // Set state type to something useful.
+ // Something more than copyconstructible is needed here, so
+ // require default and copy constructible + assignment operator.
+ __glibcxx_class_requires(state_type, _SGIAssignableConcept)
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/extptr_allocator.h b/i686-linux/include/c++/4.4.3/ext/extptr_allocator.h
new file mode 100644
index 0000000..fab6b1d
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/extptr_allocator.h
@@ -0,0 +1,176 @@
+// <extptr_allocator.h> -*- C++ -*-
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/**
+ * @file ext/extptr_allocator.h
+ * @author Bob Walters
+ *
+ * An example allocator which uses an alternative pointer type from
+ * bits/pointer.h. Supports test cases which confirm container support
+ * for alternative pointers.
+ */
+
+#ifndef _EXTPTR_ALLOCATOR_H
+#define _EXTPTR_ALLOCATOR_H 1
+
+#include <memory>
+#include <limits>
+#include <ext/pointer.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ /**
+ * @brief An example allocator which uses a non-standard pointer type.
+ * @ingroup allocators
+ *
+ * This allocator specifies that containers use a 'relative pointer' as it's
+ * pointer type. (See ext/pointer.h) Memory allocation in this example
+ * is still performed using std::allocator.
+ */
+ template<typename _Tp>
+ class _ExtPtr_allocator
+ {
+ public:
+ typedef std::size_t size_type;
+ typedef std::ptrdiff_t difference_type;
+
+ // Note the non-standard pointer types.
+ typedef _Pointer_adapter<_Relative_pointer_impl<_Tp> > pointer;
+ typedef _Pointer_adapter<_Relative_pointer_impl<const _Tp> >
+ const_pointer;
+
+ typedef _Tp& reference;
+ typedef const _Tp& const_reference;
+ typedef _Tp value_type;
+
+ template<typename _Up>
+ struct rebind
+ { typedef _ExtPtr_allocator<_Up> other; };
+
+ _ExtPtr_allocator() throw()
+ : _M_real_alloc() { }
+
+ _ExtPtr_allocator(const _ExtPtr_allocator &__rarg) throw()
+ : _M_real_alloc(__rarg._M_real_alloc) { }
+
+ template<typename _Up>
+ _ExtPtr_allocator(const _ExtPtr_allocator<_Up>& __rarg) throw()
+ : _M_real_alloc(__rarg._M_getUnderlyingImp()) { }
+
+ ~_ExtPtr_allocator() throw()
+ { }
+
+ pointer address(reference __x) const
+ { return &__x; }
+
+ const_pointer address(const_reference __x) const
+ { return &__x; }
+
+ pointer allocate(size_type __n, void* __hint = 0)
+ { return _M_real_alloc.allocate(__n,__hint); }
+
+ void deallocate(pointer __p, size_type __n)
+ { _M_real_alloc.deallocate(__p.get(), __n); }
+
+ size_type max_size() const throw()
+ { return std::numeric_limits<size_type>::max() / sizeof(_Tp); }
+
+ void construct(pointer __p, const _Tp& __val)
+ { ::new(__p.get()) _Tp(__val); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename... _Args>
+ void
+ construct(pointer __p, _Args&&... __args)
+ { ::new(__p.get()) _Tp(std::forward<_Args>(__args)...); }
+#endif
+
+ void destroy(pointer __p)
+ { __p->~_Tp(); }
+
+ template<typename _Up>
+ inline bool
+ operator==(const _ExtPtr_allocator<_Up>& __rarg)
+ { return _M_real_alloc == __rarg._M_getUnderlyingImp(); }
+
+ inline bool
+ operator==(const _ExtPtr_allocator& __rarg)
+ { return _M_real_alloc == __rarg._M_real_alloc; }
+
+ template<typename _Up>
+ inline bool
+ operator!=(const _ExtPtr_allocator<_Up>& __rarg)
+ { return _M_real_alloc != __rarg._M_getUnderlyingImp(); }
+
+ inline bool
+ operator!=(const _ExtPtr_allocator& __rarg)
+ { return _M_real_alloc != __rarg._M_real_alloc; }
+
+ template<typename _Up>
+ inline friend void
+ swap(_ExtPtr_allocator<_Up>&, _ExtPtr_allocator<_Up>&);
+
+ // A method specific to this implementation.
+ const std::allocator<_Tp>&
+ _M_getUnderlyingImp() const
+ { return _M_real_alloc; }
+
+ private:
+ std::allocator<_Tp> _M_real_alloc;
+ };
+
+ // _ExtPtr_allocator<void> specialization.
+ template<>
+ class _ExtPtr_allocator<void>
+ {
+ public:
+ typedef std::size_t size_type;
+ typedef std::ptrdiff_t difference_type;
+ typedef void value_type;
+
+ // Note the non-standard pointer types
+ typedef _Pointer_adapter<_Relative_pointer_impl<void> > pointer;
+ typedef _Pointer_adapter<_Relative_pointer_impl<const void> >
+ const_pointer;
+
+ template<typename _Up>
+ struct rebind
+ { typedef _ExtPtr_allocator<_Up> other; };
+
+ private:
+ std::allocator<void> _M_real_alloc;
+ };
+
+ template<typename _Tp>
+ inline void
+ swap(_ExtPtr_allocator<_Tp>& __larg, _ExtPtr_allocator<_Tp>& __rarg)
+ {
+ std::allocator<_Tp> __tmp( __rarg._M_real_alloc );
+ __rarg._M_real_alloc = __larg._M_real_alloc;
+ __larg._M_real_alloc = __tmp;
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _EXTPTR_ALLOCATOR_H */
diff --git a/i686-linux/include/c++/4.4.3/ext/functional b/i686-linux/include/c++/4.4.3/ext/functional
new file mode 100644
index 0000000..30afd58
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/functional
@@ -0,0 +1,425 @@
+// Functional extensions -*- C++ -*-
+
+// Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file ext/functional
+ * This file is a GNU extension to the Standard C++ Library (possibly
+ * containing extensions from the HP/SGI STL subset).
+ */
+
+#ifndef _EXT_FUNCTIONAL
+#define _EXT_FUNCTIONAL 1
+
+#pragma GCC system_header
+
+#include <functional>
+#include <cstddef>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::size_t;
+ using std::unary_function;
+ using std::binary_function;
+ using std::mem_fun1_t;
+ using std::const_mem_fun1_t;
+ using std::mem_fun1_ref_t;
+ using std::const_mem_fun1_ref_t;
+
+ /** The @c identity_element functions are not part of the C++
+ * standard; SGI provided them as an extension. Its argument is an
+ * operation, and its return value is the identity element for that
+ * operation. It is overloaded for addition and multiplication,
+ * and you can overload it for your own nefarious operations.
+ *
+ * @addtogroup SGIextensions
+ * @{
+ */
+ /// An \link SGIextensions SGI extension \endlink.
+ template <class _Tp>
+ inline _Tp
+ identity_element(std::plus<_Tp>)
+ { return _Tp(0); }
+
+ /// An \link SGIextensions SGI extension \endlink.
+ template <class _Tp>
+ inline _Tp
+ identity_element(std::multiplies<_Tp>)
+ { return _Tp(1); }
+ /** @} */
+
+ /** As an extension to the binders, SGI provided composition functors and
+ * wrapper functions to aid in their creation. The @c unary_compose
+ * functor is constructed from two functions/functors, @c f and @c g.
+ * Calling @c operator() with a single argument @c x returns @c f(g(x)).
+ * The function @c compose1 takes the two functions and constructs a
+ * @c unary_compose variable for you.
+ *
+ * @c binary_compose is constructed from three functors, @c f, @c g1,
+ * and @c g2. Its @c operator() returns @c f(g1(x),g2(x)). The function
+ * @compose2 takes f, g1, and g2, and constructs the @c binary_compose
+ * instance for you. For example, if @c f returns an int, then
+ * \code
+ * int answer = (compose2(f,g1,g2))(x);
+ * \endcode
+ * is equivalent to
+ * \code
+ * int temp1 = g1(x);
+ * int temp2 = g2(x);
+ * int answer = f(temp1,temp2);
+ * \endcode
+ * But the first form is more compact, and can be passed around as a
+ * functor to other algorithms.
+ *
+ * @addtogroup SGIextensions
+ * @{
+ */
+ /// An \link SGIextensions SGI extension \endlink.
+ template <class _Operation1, class _Operation2>
+ class unary_compose
+ : public unary_function<typename _Operation2::argument_type,
+ typename _Operation1::result_type>
+ {
+ protected:
+ _Operation1 _M_fn1;
+ _Operation2 _M_fn2;
+
+ public:
+ unary_compose(const _Operation1& __x, const _Operation2& __y)
+ : _M_fn1(__x), _M_fn2(__y) {}
+
+ typename _Operation1::result_type
+ operator()(const typename _Operation2::argument_type& __x) const
+ { return _M_fn1(_M_fn2(__x)); }
+ };
+
+ /// An \link SGIextensions SGI extension \endlink.
+ template <class _Operation1, class _Operation2>
+ inline unary_compose<_Operation1, _Operation2>
+ compose1(const _Operation1& __fn1, const _Operation2& __fn2)
+ { return unary_compose<_Operation1,_Operation2>(__fn1, __fn2); }
+
+ /// An \link SGIextensions SGI extension \endlink.
+ template <class _Operation1, class _Operation2, class _Operation3>
+ class binary_compose
+ : public unary_function<typename _Operation2::argument_type,
+ typename _Operation1::result_type>
+ {
+ protected:
+ _Operation1 _M_fn1;
+ _Operation2 _M_fn2;
+ _Operation3 _M_fn3;
+
+ public:
+ binary_compose(const _Operation1& __x, const _Operation2& __y,
+ const _Operation3& __z)
+ : _M_fn1(__x), _M_fn2(__y), _M_fn3(__z) { }
+
+ typename _Operation1::result_type
+ operator()(const typename _Operation2::argument_type& __x) const
+ { return _M_fn1(_M_fn2(__x), _M_fn3(__x)); }
+ };
+
+ /// An \link SGIextensions SGI extension \endlink.
+ template <class _Operation1, class _Operation2, class _Operation3>
+ inline binary_compose<_Operation1, _Operation2, _Operation3>
+ compose2(const _Operation1& __fn1, const _Operation2& __fn2,
+ const _Operation3& __fn3)
+ { return binary_compose<_Operation1, _Operation2, _Operation3>
+ (__fn1, __fn2, __fn3); }
+ /** @} */
+
+ /** As an extension, SGI provided a functor called @c identity. When a
+ * functor is required but no operations are desired, this can be used as a
+ * pass-through. Its @c operator() returns its argument unchanged.
+ *
+ * @addtogroup SGIextensions
+ */
+ template <class _Tp>
+ struct identity : public std::_Identity<_Tp> {};
+
+ /** @c select1st and @c select2nd are extensions provided by SGI. Their
+ * @c operator()s
+ * take a @c std::pair as an argument, and return either the first member
+ * or the second member, respectively. They can be used (especially with
+ * the composition functors) to "strip" data from a sequence before
+ * performing the remainder of an algorithm.
+ *
+ * @addtogroup SGIextensions
+ * @{
+ */
+ /// An \link SGIextensions SGI extension \endlink.
+ template <class _Pair>
+ struct select1st : public std::_Select1st<_Pair> {};
+
+ /// An \link SGIextensions SGI extension \endlink.
+ template <class _Pair>
+ struct select2nd : public std::_Select2nd<_Pair> {};
+ /** @} */
+
+ // extension documented next
+ template <class _Arg1, class _Arg2>
+ struct _Project1st : public binary_function<_Arg1, _Arg2, _Arg1>
+ {
+ _Arg1
+ operator()(const _Arg1& __x, const _Arg2&) const
+ { return __x; }
+ };
+
+ template <class _Arg1, class _Arg2>
+ struct _Project2nd : public binary_function<_Arg1, _Arg2, _Arg2>
+ {
+ _Arg2
+ operator()(const _Arg1&, const _Arg2& __y) const
+ { return __y; }
+ };
+
+ /** The @c operator() of the @c project1st functor takes two arbitrary
+ * arguments and returns the first one, while @c project2nd returns the
+ * second one. They are extensions provided by SGI.
+ *
+ * @addtogroup SGIextensions
+ * @{
+ */
+
+ /// An \link SGIextensions SGI extension \endlink.
+ template <class _Arg1, class _Arg2>
+ struct project1st : public _Project1st<_Arg1, _Arg2> {};
+
+ /// An \link SGIextensions SGI extension \endlink.
+ template <class _Arg1, class _Arg2>
+ struct project2nd : public _Project2nd<_Arg1, _Arg2> {};
+ /** @} */
+
+ // extension documented next
+ template <class _Result>
+ struct _Constant_void_fun
+ {
+ typedef _Result result_type;
+ result_type _M_val;
+
+ _Constant_void_fun(const result_type& __v) : _M_val(__v) {}
+
+ const result_type&
+ operator()() const
+ { return _M_val; }
+ };
+
+ template <class _Result, class _Argument>
+ struct _Constant_unary_fun
+ {
+ typedef _Argument argument_type;
+ typedef _Result result_type;
+ result_type _M_val;
+
+ _Constant_unary_fun(const result_type& __v) : _M_val(__v) {}
+
+ const result_type&
+ operator()(const _Argument&) const
+ { return _M_val; }
+ };
+
+ template <class _Result, class _Arg1, class _Arg2>
+ struct _Constant_binary_fun
+ {
+ typedef _Arg1 first_argument_type;
+ typedef _Arg2 second_argument_type;
+ typedef _Result result_type;
+ _Result _M_val;
+
+ _Constant_binary_fun(const _Result& __v) : _M_val(__v) {}
+
+ const result_type&
+ operator()(const _Arg1&, const _Arg2&) const
+ { return _M_val; }
+ };
+
+ /** These three functors are each constructed from a single arbitrary
+ * variable/value. Later, their @c operator()s completely ignore any
+ * arguments passed, and return the stored value.
+ * - @c constant_void_fun's @c operator() takes no arguments
+ * - @c constant_unary_fun's @c operator() takes one argument (ignored)
+ * - @c constant_binary_fun's @c operator() takes two arguments (ignored)
+ *
+ * The helper creator functions @c constant0, @c constant1, and
+ * @c constant2 each take a "result" argument and construct variables of
+ * the appropriate functor type.
+ *
+ * @addtogroup SGIextensions
+ * @{
+ */
+ /// An \link SGIextensions SGI extension \endlink.
+ template <class _Result>
+ struct constant_void_fun
+ : public _Constant_void_fun<_Result>
+ {
+ constant_void_fun(const _Result& __v)
+ : _Constant_void_fun<_Result>(__v) {}
+ };
+
+ /// An \link SGIextensions SGI extension \endlink.
+ template <class _Result, class _Argument = _Result>
+ struct constant_unary_fun : public _Constant_unary_fun<_Result, _Argument>
+ {
+ constant_unary_fun(const _Result& __v)
+ : _Constant_unary_fun<_Result, _Argument>(__v) {}
+ };
+
+ /// An \link SGIextensions SGI extension \endlink.
+ template <class _Result, class _Arg1 = _Result, class _Arg2 = _Arg1>
+ struct constant_binary_fun
+ : public _Constant_binary_fun<_Result, _Arg1, _Arg2>
+ {
+ constant_binary_fun(const _Result& __v)
+ : _Constant_binary_fun<_Result, _Arg1, _Arg2>(__v) {}
+ };
+
+ /// An \link SGIextensions SGI extension \endlink.
+ template <class _Result>
+ inline constant_void_fun<_Result>
+ constant0(const _Result& __val)
+ { return constant_void_fun<_Result>(__val); }
+
+ /// An \link SGIextensions SGI extension \endlink.
+ template <class _Result>
+ inline constant_unary_fun<_Result, _Result>
+ constant1(const _Result& __val)
+ { return constant_unary_fun<_Result, _Result>(__val); }
+
+ /// An \link SGIextensions SGI extension \endlink.
+ template <class _Result>
+ inline constant_binary_fun<_Result,_Result,_Result>
+ constant2(const _Result& __val)
+ { return constant_binary_fun<_Result, _Result, _Result>(__val); }
+ /** @} */
+
+ /** The @c subtractive_rng class is documented on
+ * <a href="http://www.sgi.com/tech/stl/">SGI's site</a>.
+ * Note that this code assumes that @c int is 32 bits.
+ *
+ * @ingroup SGIextensions
+ */
+ class subtractive_rng
+ : public unary_function<unsigned int, unsigned int>
+ {
+ private:
+ unsigned int _M_table[55];
+ size_t _M_index1;
+ size_t _M_index2;
+
+ public:
+ /// Returns a number less than the argument.
+ unsigned int
+ operator()(unsigned int __limit)
+ {
+ _M_index1 = (_M_index1 + 1) % 55;
+ _M_index2 = (_M_index2 + 1) % 55;
+ _M_table[_M_index1] = _M_table[_M_index1] - _M_table[_M_index2];
+ return _M_table[_M_index1] % __limit;
+ }
+
+ void
+ _M_initialize(unsigned int __seed)
+ {
+ unsigned int __k = 1;
+ _M_table[54] = __seed;
+ size_t __i;
+ for (__i = 0; __i < 54; __i++)
+ {
+ size_t __ii = (21 * (__i + 1) % 55) - 1;
+ _M_table[__ii] = __k;
+ __k = __seed - __k;
+ __seed = _M_table[__ii];
+ }
+ for (int __loop = 0; __loop < 4; __loop++)
+ {
+ for (__i = 0; __i < 55; __i++)
+ _M_table[__i] = _M_table[__i] - _M_table[(1 + __i + 30) % 55];
+ }
+ _M_index1 = 0;
+ _M_index2 = 31;
+ }
+
+ /// Ctor allowing you to initialize the seed.
+ subtractive_rng(unsigned int __seed)
+ { _M_initialize(__seed); }
+
+ /// Default ctor; initializes its state with some number you don't see.
+ subtractive_rng()
+ { _M_initialize(161803398u); }
+ };
+
+ // Mem_fun adaptor helper functions mem_fun1 and mem_fun1_ref,
+ // provided for backward compatibility, they are no longer part of
+ // the C++ standard.
+
+ template <class _Ret, class _Tp, class _Arg>
+ inline mem_fun1_t<_Ret, _Tp, _Arg>
+ mem_fun1(_Ret (_Tp::*__f)(_Arg))
+ { return mem_fun1_t<_Ret, _Tp, _Arg>(__f); }
+
+ template <class _Ret, class _Tp, class _Arg>
+ inline const_mem_fun1_t<_Ret, _Tp, _Arg>
+ mem_fun1(_Ret (_Tp::*__f)(_Arg) const)
+ { return const_mem_fun1_t<_Ret, _Tp, _Arg>(__f); }
+
+ template <class _Ret, class _Tp, class _Arg>
+ inline mem_fun1_ref_t<_Ret, _Tp, _Arg>
+ mem_fun1_ref(_Ret (_Tp::*__f)(_Arg))
+ { return mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); }
+
+ template <class _Ret, class _Tp, class _Arg>
+ inline const_mem_fun1_ref_t<_Ret, _Tp, _Arg>
+ mem_fun1_ref(_Ret (_Tp::*__f)(_Arg) const)
+ { return const_mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
+
diff --git a/i686-linux/include/c++/4.4.3/ext/hash_map b/i686-linux/include/c++/4.4.3/ext/hash_map
new file mode 100644
index 0000000..7f5c2c5
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/hash_map
@@ -0,0 +1,593 @@
+// Hashing map implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2004, 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1996
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ */
+
+/** @file backward/hash_map
+ * This file is a GNU extension to the Standard C++ Library (possibly
+ * containing extensions from the HP/SGI STL subset).
+ */
+
+#ifndef _HASH_MAP
+#define _HASH_MAP 1
+
+#ifndef _GLIBCXX_PERMIT_BACKWARD_HASH
+#include "backward_warning.h"
+#endif
+
+#include <bits/c++config.h>
+#include <backward/hashtable.h>
+#include <bits/concept_check.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::equal_to;
+ using std::allocator;
+ using std::pair;
+ using std::_Select1st;
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template<class _Key, class _Tp, class _HashFn = hash<_Key>,
+ class _EqualKey = equal_to<_Key>, class _Alloc = allocator<_Tp> >
+ class hash_map
+ {
+ private:
+ typedef hashtable<pair<const _Key, _Tp>,_Key, _HashFn,
+ _Select1st<pair<const _Key, _Tp> >,
+ _EqualKey, _Alloc> _Ht;
+
+ _Ht _M_ht;
+
+ public:
+ typedef typename _Ht::key_type key_type;
+ typedef _Tp data_type;
+ typedef _Tp mapped_type;
+ typedef typename _Ht::value_type value_type;
+ typedef typename _Ht::hasher hasher;
+ typedef typename _Ht::key_equal key_equal;
+
+ typedef typename _Ht::size_type size_type;
+ typedef typename _Ht::difference_type difference_type;
+ typedef typename _Ht::pointer pointer;
+ typedef typename _Ht::const_pointer const_pointer;
+ typedef typename _Ht::reference reference;
+ typedef typename _Ht::const_reference const_reference;
+
+ typedef typename _Ht::iterator iterator;
+ typedef typename _Ht::const_iterator const_iterator;
+
+ typedef typename _Ht::allocator_type allocator_type;
+
+ hasher
+ hash_funct() const
+ { return _M_ht.hash_funct(); }
+
+ key_equal
+ key_eq() const
+ { return _M_ht.key_eq(); }
+
+ allocator_type
+ get_allocator() const
+ { return _M_ht.get_allocator(); }
+
+ hash_map()
+ : _M_ht(100, hasher(), key_equal(), allocator_type()) {}
+
+ explicit
+ hash_map(size_type __n)
+ : _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
+
+ hash_map(size_type __n, const hasher& __hf)
+ : _M_ht(__n, __hf, key_equal(), allocator_type()) {}
+
+ hash_map(size_type __n, const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _M_ht(__n, __hf, __eql, __a) {}
+
+ template<class _InputIterator>
+ hash_map(_InputIterator __f, _InputIterator __l)
+ : _M_ht(100, hasher(), key_equal(), allocator_type())
+ { _M_ht.insert_unique(__f, __l); }
+
+ template<class _InputIterator>
+ hash_map(_InputIterator __f, _InputIterator __l, size_type __n)
+ : _M_ht(__n, hasher(), key_equal(), allocator_type())
+ { _M_ht.insert_unique(__f, __l); }
+
+ template<class _InputIterator>
+ hash_map(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf)
+ : _M_ht(__n, __hf, key_equal(), allocator_type())
+ { _M_ht.insert_unique(__f, __l); }
+
+ template<class _InputIterator>
+ hash_map(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _M_ht(__n, __hf, __eql, __a)
+ { _M_ht.insert_unique(__f, __l); }
+
+ size_type
+ size() const
+ { return _M_ht.size(); }
+
+ size_type
+ max_size() const
+ { return _M_ht.max_size(); }
+
+ bool
+ empty() const
+ { return _M_ht.empty(); }
+
+ void
+ swap(hash_map& __hs)
+ { _M_ht.swap(__hs._M_ht); }
+
+ template<class _K1, class _T1, class _HF, class _EqK, class _Al>
+ friend bool
+ operator== (const hash_map<_K1, _T1, _HF, _EqK, _Al>&,
+ const hash_map<_K1, _T1, _HF, _EqK, _Al>&);
+
+ iterator
+ begin()
+ { return _M_ht.begin(); }
+
+ iterator
+ end()
+ { return _M_ht.end(); }
+
+ const_iterator
+ begin() const
+ { return _M_ht.begin(); }
+
+ const_iterator
+ end() const
+ { return _M_ht.end(); }
+
+ pair<iterator, bool>
+ insert(const value_type& __obj)
+ { return _M_ht.insert_unique(__obj); }
+
+ template<class _InputIterator>
+ void
+ insert(_InputIterator __f, _InputIterator __l)
+ { _M_ht.insert_unique(__f, __l); }
+
+ pair<iterator, bool>
+ insert_noresize(const value_type& __obj)
+ { return _M_ht.insert_unique_noresize(__obj); }
+
+ iterator
+ find(const key_type& __key)
+ { return _M_ht.find(__key); }
+
+ const_iterator
+ find(const key_type& __key) const
+ { return _M_ht.find(__key); }
+
+ _Tp&
+ operator[](const key_type& __key)
+ { return _M_ht.find_or_insert(value_type(__key, _Tp())).second; }
+
+ size_type
+ count(const key_type& __key) const
+ { return _M_ht.count(__key); }
+
+ pair<iterator, iterator>
+ equal_range(const key_type& __key)
+ { return _M_ht.equal_range(__key); }
+
+ pair<const_iterator, const_iterator>
+ equal_range(const key_type& __key) const
+ { return _M_ht.equal_range(__key); }
+
+ size_type
+ erase(const key_type& __key)
+ {return _M_ht.erase(__key); }
+
+ void
+ erase(iterator __it)
+ { _M_ht.erase(__it); }
+
+ void
+ erase(iterator __f, iterator __l)
+ { _M_ht.erase(__f, __l); }
+
+ void
+ clear()
+ { _M_ht.clear(); }
+
+ void
+ resize(size_type __hint)
+ { _M_ht.resize(__hint); }
+
+ size_type
+ bucket_count() const
+ { return _M_ht.bucket_count(); }
+
+ size_type
+ max_bucket_count() const
+ { return _M_ht.max_bucket_count(); }
+
+ size_type
+ elems_in_bucket(size_type __n) const
+ { return _M_ht.elems_in_bucket(__n); }
+ };
+
+ template<class _Key, class _Tp, class _HashFn, class _EqlKey, class _Alloc>
+ inline bool
+ operator==(const hash_map<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm1,
+ const hash_map<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm2)
+ { return __hm1._M_ht == __hm2._M_ht; }
+
+ template<class _Key, class _Tp, class _HashFn, class _EqlKey, class _Alloc>
+ inline bool
+ operator!=(const hash_map<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm1,
+ const hash_map<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm2)
+ { return !(__hm1 == __hm2); }
+
+ template<class _Key, class _Tp, class _HashFn, class _EqlKey, class _Alloc>
+ inline void
+ swap(hash_map<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm1,
+ hash_map<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm2)
+ { __hm1.swap(__hm2); }
+
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template<class _Key, class _Tp,
+ class _HashFn = hash<_Key>,
+ class _EqualKey = equal_to<_Key>,
+ class _Alloc = allocator<_Tp> >
+ class hash_multimap
+ {
+ // concept requirements
+ __glibcxx_class_requires(_Key, _SGIAssignableConcept)
+ __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
+ __glibcxx_class_requires3(_HashFn, size_t, _Key, _UnaryFunctionConcept)
+ __glibcxx_class_requires3(_EqualKey, _Key, _Key, _BinaryPredicateConcept)
+
+ private:
+ typedef hashtable<pair<const _Key, _Tp>, _Key, _HashFn,
+ _Select1st<pair<const _Key, _Tp> >, _EqualKey, _Alloc>
+ _Ht;
+
+ _Ht _M_ht;
+
+ public:
+ typedef typename _Ht::key_type key_type;
+ typedef _Tp data_type;
+ typedef _Tp mapped_type;
+ typedef typename _Ht::value_type value_type;
+ typedef typename _Ht::hasher hasher;
+ typedef typename _Ht::key_equal key_equal;
+
+ typedef typename _Ht::size_type size_type;
+ typedef typename _Ht::difference_type difference_type;
+ typedef typename _Ht::pointer pointer;
+ typedef typename _Ht::const_pointer const_pointer;
+ typedef typename _Ht::reference reference;
+ typedef typename _Ht::const_reference const_reference;
+
+ typedef typename _Ht::iterator iterator;
+ typedef typename _Ht::const_iterator const_iterator;
+
+ typedef typename _Ht::allocator_type allocator_type;
+
+ hasher
+ hash_funct() const
+ { return _M_ht.hash_funct(); }
+
+ key_equal
+ key_eq() const
+ { return _M_ht.key_eq(); }
+
+ allocator_type
+ get_allocator() const
+ { return _M_ht.get_allocator(); }
+
+ hash_multimap()
+ : _M_ht(100, hasher(), key_equal(), allocator_type()) {}
+
+ explicit
+ hash_multimap(size_type __n)
+ : _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
+
+ hash_multimap(size_type __n, const hasher& __hf)
+ : _M_ht(__n, __hf, key_equal(), allocator_type()) {}
+
+ hash_multimap(size_type __n, const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _M_ht(__n, __hf, __eql, __a) {}
+
+ template<class _InputIterator>
+ hash_multimap(_InputIterator __f, _InputIterator __l)
+ : _M_ht(100, hasher(), key_equal(), allocator_type())
+ { _M_ht.insert_equal(__f, __l); }
+
+ template<class _InputIterator>
+ hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n)
+ : _M_ht(__n, hasher(), key_equal(), allocator_type())
+ { _M_ht.insert_equal(__f, __l); }
+
+ template<class _InputIterator>
+ hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf)
+ : _M_ht(__n, __hf, key_equal(), allocator_type())
+ { _M_ht.insert_equal(__f, __l); }
+
+ template<class _InputIterator>
+ hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _M_ht(__n, __hf, __eql, __a)
+ { _M_ht.insert_equal(__f, __l); }
+
+ size_type
+ size() const
+ { return _M_ht.size(); }
+
+ size_type
+ max_size() const
+ { return _M_ht.max_size(); }
+
+ bool
+ empty() const
+ { return _M_ht.empty(); }
+
+ void
+ swap(hash_multimap& __hs)
+ { _M_ht.swap(__hs._M_ht); }
+
+ template<class _K1, class _T1, class _HF, class _EqK, class _Al>
+ friend bool
+ operator==(const hash_multimap<_K1, _T1, _HF, _EqK, _Al>&,
+ const hash_multimap<_K1, _T1, _HF, _EqK, _Al>&);
+
+ iterator
+ begin()
+ { return _M_ht.begin(); }
+
+ iterator
+ end()
+ { return _M_ht.end(); }
+
+ const_iterator
+ begin() const
+ { return _M_ht.begin(); }
+
+ const_iterator
+ end() const
+ { return _M_ht.end(); }
+
+ iterator
+ insert(const value_type& __obj)
+ { return _M_ht.insert_equal(__obj); }
+
+ template<class _InputIterator>
+ void
+ insert(_InputIterator __f, _InputIterator __l)
+ { _M_ht.insert_equal(__f,__l); }
+
+ iterator
+ insert_noresize(const value_type& __obj)
+ { return _M_ht.insert_equal_noresize(__obj); }
+
+ iterator
+ find(const key_type& __key)
+ { return _M_ht.find(__key); }
+
+ const_iterator
+ find(const key_type& __key) const
+ { return _M_ht.find(__key); }
+
+ size_type
+ count(const key_type& __key) const
+ { return _M_ht.count(__key); }
+
+ pair<iterator, iterator>
+ equal_range(const key_type& __key)
+ { return _M_ht.equal_range(__key); }
+
+ pair<const_iterator, const_iterator>
+ equal_range(const key_type& __key) const
+ { return _M_ht.equal_range(__key); }
+
+ size_type
+ erase(const key_type& __key)
+ { return _M_ht.erase(__key); }
+
+ void
+ erase(iterator __it)
+ { _M_ht.erase(__it); }
+
+ void
+ erase(iterator __f, iterator __l)
+ { _M_ht.erase(__f, __l); }
+
+ void
+ clear()
+ { _M_ht.clear(); }
+
+ void
+ resize(size_type __hint)
+ { _M_ht.resize(__hint); }
+
+ size_type
+ bucket_count() const
+ { return _M_ht.bucket_count(); }
+
+ size_type
+ max_bucket_count() const
+ { return _M_ht.max_bucket_count(); }
+
+ size_type
+ elems_in_bucket(size_type __n) const
+ { return _M_ht.elems_in_bucket(__n); }
+ };
+
+ template<class _Key, class _Tp, class _HF, class _EqKey, class _Alloc>
+ inline bool
+ operator==(const hash_multimap<_Key, _Tp, _HF, _EqKey, _Alloc>& __hm1,
+ const hash_multimap<_Key, _Tp, _HF, _EqKey, _Alloc>& __hm2)
+ { return __hm1._M_ht == __hm2._M_ht; }
+
+ template<class _Key, class _Tp, class _HF, class _EqKey, class _Alloc>
+ inline bool
+ operator!=(const hash_multimap<_Key, _Tp, _HF, _EqKey, _Alloc>& __hm1,
+ const hash_multimap<_Key, _Tp, _HF, _EqKey, _Alloc>& __hm2)
+ { return !(__hm1 == __hm2); }
+
+ template<class _Key, class _Tp, class _HashFn, class _EqlKey, class _Alloc>
+ inline void
+ swap(hash_multimap<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm1,
+ hash_multimap<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm2)
+ { __hm1.swap(__hm2); }
+
+_GLIBCXX_END_NAMESPACE
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // Specialization of insert_iterator so that it will work for hash_map
+ // and hash_multimap.
+ template<class _Key, class _Tp, class _HashFn, class _EqKey, class _Alloc>
+ class insert_iterator<__gnu_cxx::hash_map<_Key, _Tp, _HashFn,
+ _EqKey, _Alloc> >
+ {
+ protected:
+ typedef __gnu_cxx::hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc>
+ _Container;
+ _Container* container;
+
+ public:
+ typedef _Container container_type;
+ typedef output_iterator_tag iterator_category;
+ typedef void value_type;
+ typedef void difference_type;
+ typedef void pointer;
+ typedef void reference;
+
+ insert_iterator(_Container& __x)
+ : container(&__x) {}
+
+ insert_iterator(_Container& __x, typename _Container::iterator)
+ : container(&__x) {}
+
+ insert_iterator<_Container>&
+ operator=(const typename _Container::value_type& __value)
+ {
+ container->insert(__value);
+ return *this;
+ }
+
+ insert_iterator<_Container>&
+ operator*()
+ { return *this; }
+
+ insert_iterator<_Container>&
+ operator++() { return *this; }
+
+ insert_iterator<_Container>&
+ operator++(int)
+ { return *this; }
+ };
+
+ template<class _Key, class _Tp, class _HashFn, class _EqKey, class _Alloc>
+ class insert_iterator<__gnu_cxx::hash_multimap<_Key, _Tp, _HashFn,
+ _EqKey, _Alloc> >
+ {
+ protected:
+ typedef __gnu_cxx::hash_multimap<_Key, _Tp, _HashFn, _EqKey, _Alloc>
+ _Container;
+ _Container* container;
+ typename _Container::iterator iter;
+
+ public:
+ typedef _Container container_type;
+ typedef output_iterator_tag iterator_category;
+ typedef void value_type;
+ typedef void difference_type;
+ typedef void pointer;
+ typedef void reference;
+
+ insert_iterator(_Container& __x)
+ : container(&__x) {}
+
+ insert_iterator(_Container& __x, typename _Container::iterator)
+ : container(&__x) {}
+
+ insert_iterator<_Container>&
+ operator=(const typename _Container::value_type& __value)
+ {
+ container->insert(__value);
+ return *this;
+ }
+
+ insert_iterator<_Container>&
+ operator*()
+ { return *this; }
+
+ insert_iterator<_Container>&
+ operator++()
+ { return *this; }
+
+ insert_iterator<_Container>&
+ operator++(int)
+ { return *this; }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/hash_set b/i686-linux/include/c++/4.4.3/ext/hash_set
new file mode 100644
index 0000000..8e365bd
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/hash_set
@@ -0,0 +1,561 @@
+// Hashing set implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2004, 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1996
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ */
+
+/** @file backward/hash_set
+ * This file is a GNU extension to the Standard C++ Library (possibly
+ * containing extensions from the HP/SGI STL subset).
+ */
+
+#ifndef _HASH_SET
+#define _HASH_SET 1
+
+#ifndef _GLIBCXX_PERMIT_BACKWARD_HASH
+#include "backward_warning.h"
+#endif
+
+#include <bits/c++config.h>
+#include <backward/hashtable.h>
+#include <bits/concept_check.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::equal_to;
+ using std::allocator;
+ using std::pair;
+ using std::_Identity;
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template<class _Value, class _HashFcn = hash<_Value>,
+ class _EqualKey = equal_to<_Value>,
+ class _Alloc = allocator<_Value> >
+ class hash_set
+ {
+ // concept requirements
+ __glibcxx_class_requires(_Value, _SGIAssignableConcept)
+ __glibcxx_class_requires3(_HashFcn, size_t, _Value, _UnaryFunctionConcept)
+ __glibcxx_class_requires3(_EqualKey, _Value, _Value, _BinaryPredicateConcept)
+
+ private:
+ typedef hashtable<_Value, _Value, _HashFcn, _Identity<_Value>,
+ _EqualKey, _Alloc> _Ht;
+ _Ht _M_ht;
+
+ public:
+ typedef typename _Ht::key_type key_type;
+ typedef typename _Ht::value_type value_type;
+ typedef typename _Ht::hasher hasher;
+ typedef typename _Ht::key_equal key_equal;
+
+ typedef typename _Ht::size_type size_type;
+ typedef typename _Ht::difference_type difference_type;
+ typedef typename _Alloc::pointer pointer;
+ typedef typename _Alloc::const_pointer const_pointer;
+ typedef typename _Alloc::reference reference;
+ typedef typename _Alloc::const_reference const_reference;
+
+ typedef typename _Ht::const_iterator iterator;
+ typedef typename _Ht::const_iterator const_iterator;
+
+ typedef typename _Ht::allocator_type allocator_type;
+
+ hasher
+ hash_funct() const
+ { return _M_ht.hash_funct(); }
+
+ key_equal
+ key_eq() const
+ { return _M_ht.key_eq(); }
+
+ allocator_type
+ get_allocator() const
+ { return _M_ht.get_allocator(); }
+
+ hash_set()
+ : _M_ht(100, hasher(), key_equal(), allocator_type()) {}
+
+ explicit
+ hash_set(size_type __n)
+ : _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
+
+ hash_set(size_type __n, const hasher& __hf)
+ : _M_ht(__n, __hf, key_equal(), allocator_type()) {}
+
+ hash_set(size_type __n, const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _M_ht(__n, __hf, __eql, __a) {}
+
+ template<class _InputIterator>
+ hash_set(_InputIterator __f, _InputIterator __l)
+ : _M_ht(100, hasher(), key_equal(), allocator_type())
+ { _M_ht.insert_unique(__f, __l); }
+
+ template<class _InputIterator>
+ hash_set(_InputIterator __f, _InputIterator __l, size_type __n)
+ : _M_ht(__n, hasher(), key_equal(), allocator_type())
+ { _M_ht.insert_unique(__f, __l); }
+
+ template<class _InputIterator>
+ hash_set(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf)
+ : _M_ht(__n, __hf, key_equal(), allocator_type())
+ { _M_ht.insert_unique(__f, __l); }
+
+ template<class _InputIterator>
+ hash_set(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _M_ht(__n, __hf, __eql, __a)
+ { _M_ht.insert_unique(__f, __l); }
+
+ size_type
+ size() const
+ { return _M_ht.size(); }
+
+ size_type
+ max_size() const
+ { return _M_ht.max_size(); }
+
+ bool
+ empty() const
+ { return _M_ht.empty(); }
+
+ void
+ swap(hash_set& __hs)
+ { _M_ht.swap(__hs._M_ht); }
+
+ template<class _Val, class _HF, class _EqK, class _Al>
+ friend bool
+ operator==(const hash_set<_Val, _HF, _EqK, _Al>&,
+ const hash_set<_Val, _HF, _EqK, _Al>&);
+
+ iterator
+ begin() const
+ { return _M_ht.begin(); }
+
+ iterator
+ end() const
+ { return _M_ht.end(); }
+
+ pair<iterator, bool>
+ insert(const value_type& __obj)
+ {
+ pair<typename _Ht::iterator, bool> __p = _M_ht.insert_unique(__obj);
+ return pair<iterator,bool>(__p.first, __p.second);
+ }
+
+ template<class _InputIterator>
+ void
+ insert(_InputIterator __f, _InputIterator __l)
+ { _M_ht.insert_unique(__f, __l); }
+
+ pair<iterator, bool>
+ insert_noresize(const value_type& __obj)
+ {
+ pair<typename _Ht::iterator, bool> __p
+ = _M_ht.insert_unique_noresize(__obj);
+ return pair<iterator, bool>(__p.first, __p.second);
+ }
+
+ iterator
+ find(const key_type& __key) const
+ { return _M_ht.find(__key); }
+
+ size_type
+ count(const key_type& __key) const
+ { return _M_ht.count(__key); }
+
+ pair<iterator, iterator>
+ equal_range(const key_type& __key) const
+ { return _M_ht.equal_range(__key); }
+
+ size_type
+ erase(const key_type& __key)
+ {return _M_ht.erase(__key); }
+
+ void
+ erase(iterator __it)
+ { _M_ht.erase(__it); }
+
+ void
+ erase(iterator __f, iterator __l)
+ { _M_ht.erase(__f, __l); }
+
+ void
+ clear()
+ { _M_ht.clear(); }
+
+ void
+ resize(size_type __hint)
+ { _M_ht.resize(__hint); }
+
+ size_type
+ bucket_count() const
+ { return _M_ht.bucket_count(); }
+
+ size_type
+ max_bucket_count() const
+ { return _M_ht.max_bucket_count(); }
+
+ size_type
+ elems_in_bucket(size_type __n) const
+ { return _M_ht.elems_in_bucket(__n); }
+ };
+
+ template<class _Value, class _HashFcn, class _EqualKey, class _Alloc>
+ inline bool
+ operator==(const hash_set<_Value, _HashFcn, _EqualKey, _Alloc>& __hs1,
+ const hash_set<_Value, _HashFcn, _EqualKey, _Alloc>& __hs2)
+ { return __hs1._M_ht == __hs2._M_ht; }
+
+ template<class _Value, class _HashFcn, class _EqualKey, class _Alloc>
+ inline bool
+ operator!=(const hash_set<_Value, _HashFcn, _EqualKey, _Alloc>& __hs1,
+ const hash_set<_Value, _HashFcn, _EqualKey, _Alloc>& __hs2)
+ { return !(__hs1 == __hs2); }
+
+ template<class _Val, class _HashFcn, class _EqualKey, class _Alloc>
+ inline void
+ swap(hash_set<_Val, _HashFcn, _EqualKey, _Alloc>& __hs1,
+ hash_set<_Val, _HashFcn, _EqualKey, _Alloc>& __hs2)
+ { __hs1.swap(__hs2); }
+
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template<class _Value,
+ class _HashFcn = hash<_Value>,
+ class _EqualKey = equal_to<_Value>,
+ class _Alloc = allocator<_Value> >
+ class hash_multiset
+ {
+ // concept requirements
+ __glibcxx_class_requires(_Value, _SGIAssignableConcept)
+ __glibcxx_class_requires3(_HashFcn, size_t, _Value, _UnaryFunctionConcept)
+ __glibcxx_class_requires3(_EqualKey, _Value, _Value, _BinaryPredicateConcept)
+
+ private:
+ typedef hashtable<_Value, _Value, _HashFcn, _Identity<_Value>,
+ _EqualKey, _Alloc> _Ht;
+ _Ht _M_ht;
+
+ public:
+ typedef typename _Ht::key_type key_type;
+ typedef typename _Ht::value_type value_type;
+ typedef typename _Ht::hasher hasher;
+ typedef typename _Ht::key_equal key_equal;
+
+ typedef typename _Ht::size_type size_type;
+ typedef typename _Ht::difference_type difference_type;
+ typedef typename _Alloc::pointer pointer;
+ typedef typename _Alloc::const_pointer const_pointer;
+ typedef typename _Alloc::reference reference;
+ typedef typename _Alloc::const_reference const_reference;
+
+ typedef typename _Ht::const_iterator iterator;
+ typedef typename _Ht::const_iterator const_iterator;
+
+ typedef typename _Ht::allocator_type allocator_type;
+
+ hasher
+ hash_funct() const
+ { return _M_ht.hash_funct(); }
+
+ key_equal
+ key_eq() const
+ { return _M_ht.key_eq(); }
+
+ allocator_type
+ get_allocator() const
+ { return _M_ht.get_allocator(); }
+
+ hash_multiset()
+ : _M_ht(100, hasher(), key_equal(), allocator_type()) {}
+
+ explicit
+ hash_multiset(size_type __n)
+ : _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
+
+ hash_multiset(size_type __n, const hasher& __hf)
+ : _M_ht(__n, __hf, key_equal(), allocator_type()) {}
+
+ hash_multiset(size_type __n, const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _M_ht(__n, __hf, __eql, __a) {}
+
+ template<class _InputIterator>
+ hash_multiset(_InputIterator __f, _InputIterator __l)
+ : _M_ht(100, hasher(), key_equal(), allocator_type())
+ { _M_ht.insert_equal(__f, __l); }
+
+ template<class _InputIterator>
+ hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n)
+ : _M_ht(__n, hasher(), key_equal(), allocator_type())
+ { _M_ht.insert_equal(__f, __l); }
+
+ template<class _InputIterator>
+ hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf)
+ : _M_ht(__n, __hf, key_equal(), allocator_type())
+ { _M_ht.insert_equal(__f, __l); }
+
+ template<class _InputIterator>
+ hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _M_ht(__n, __hf, __eql, __a)
+ { _M_ht.insert_equal(__f, __l); }
+
+ size_type
+ size() const
+ { return _M_ht.size(); }
+
+ size_type
+ max_size() const
+ { return _M_ht.max_size(); }
+
+ bool
+ empty() const
+ { return _M_ht.empty(); }
+
+ void
+ swap(hash_multiset& hs)
+ { _M_ht.swap(hs._M_ht); }
+
+ template<class _Val, class _HF, class _EqK, class _Al>
+ friend bool
+ operator==(const hash_multiset<_Val, _HF, _EqK, _Al>&,
+ const hash_multiset<_Val, _HF, _EqK, _Al>&);
+
+ iterator
+ begin() const
+ { return _M_ht.begin(); }
+
+ iterator
+ end() const
+ { return _M_ht.end(); }
+
+ iterator
+ insert(const value_type& __obj)
+ { return _M_ht.insert_equal(__obj); }
+
+ template<class _InputIterator>
+ void
+ insert(_InputIterator __f, _InputIterator __l)
+ { _M_ht.insert_equal(__f,__l); }
+
+ iterator
+ insert_noresize(const value_type& __obj)
+ { return _M_ht.insert_equal_noresize(__obj); }
+
+ iterator
+ find(const key_type& __key) const
+ { return _M_ht.find(__key); }
+
+ size_type
+ count(const key_type& __key) const
+ { return _M_ht.count(__key); }
+
+ pair<iterator, iterator>
+ equal_range(const key_type& __key) const
+ { return _M_ht.equal_range(__key); }
+
+ size_type
+ erase(const key_type& __key)
+ { return _M_ht.erase(__key); }
+
+ void
+ erase(iterator __it)
+ { _M_ht.erase(__it); }
+
+ void
+ erase(iterator __f, iterator __l)
+ { _M_ht.erase(__f, __l); }
+
+ void
+ clear()
+ { _M_ht.clear(); }
+
+ void
+ resize(size_type __hint)
+ { _M_ht.resize(__hint); }
+
+ size_type
+ bucket_count() const
+ { return _M_ht.bucket_count(); }
+
+ size_type
+ max_bucket_count() const
+ { return _M_ht.max_bucket_count(); }
+
+ size_type
+ elems_in_bucket(size_type __n) const
+ { return _M_ht.elems_in_bucket(__n); }
+ };
+
+ template<class _Val, class _HashFcn, class _EqualKey, class _Alloc>
+ inline bool
+ operator==(const hash_multiset<_Val, _HashFcn, _EqualKey, _Alloc>& __hs1,
+ const hash_multiset<_Val, _HashFcn, _EqualKey, _Alloc>& __hs2)
+ { return __hs1._M_ht == __hs2._M_ht; }
+
+ template<class _Val, class _HashFcn, class _EqualKey, class _Alloc>
+ inline bool
+ operator!=(const hash_multiset<_Val, _HashFcn, _EqualKey, _Alloc>& __hs1,
+ const hash_multiset<_Val, _HashFcn, _EqualKey, _Alloc>& __hs2)
+ { return !(__hs1 == __hs2); }
+
+ template<class _Val, class _HashFcn, class _EqualKey, class _Alloc>
+ inline void
+ swap(hash_multiset<_Val, _HashFcn, _EqualKey, _Alloc>& __hs1,
+ hash_multiset<_Val, _HashFcn, _EqualKey, _Alloc>& __hs2)
+ { __hs1.swap(__hs2); }
+
+_GLIBCXX_END_NAMESPACE
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // Specialization of insert_iterator so that it will work for hash_set
+ // and hash_multiset.
+ template<class _Value, class _HashFcn, class _EqualKey, class _Alloc>
+ class insert_iterator<__gnu_cxx::hash_set<_Value, _HashFcn,
+ _EqualKey, _Alloc> >
+ {
+ protected:
+ typedef __gnu_cxx::hash_set<_Value, _HashFcn, _EqualKey, _Alloc>
+ _Container;
+ _Container* container;
+
+ public:
+ typedef _Container container_type;
+ typedef output_iterator_tag iterator_category;
+ typedef void value_type;
+ typedef void difference_type;
+ typedef void pointer;
+ typedef void reference;
+
+ insert_iterator(_Container& __x)
+ : container(&__x) {}
+
+ insert_iterator(_Container& __x, typename _Container::iterator)
+ : container(&__x) {}
+
+ insert_iterator<_Container>&
+ operator=(const typename _Container::value_type& __value)
+ {
+ container->insert(__value);
+ return *this;
+ }
+
+ insert_iterator<_Container>&
+ operator*()
+ { return *this; }
+
+ insert_iterator<_Container>&
+ operator++()
+ { return *this; }
+
+ insert_iterator<_Container>&
+ operator++(int)
+ { return *this; }
+ };
+
+ template<class _Value, class _HashFcn, class _EqualKey, class _Alloc>
+ class insert_iterator<__gnu_cxx::hash_multiset<_Value, _HashFcn,
+ _EqualKey, _Alloc> >
+ {
+ protected:
+ typedef __gnu_cxx::hash_multiset<_Value, _HashFcn, _EqualKey, _Alloc>
+ _Container;
+ _Container* container;
+ typename _Container::iterator iter;
+
+ public:
+ typedef _Container container_type;
+ typedef output_iterator_tag iterator_category;
+ typedef void value_type;
+ typedef void difference_type;
+ typedef void pointer;
+ typedef void reference;
+
+ insert_iterator(_Container& __x)
+ : container(&__x) {}
+
+ insert_iterator(_Container& __x, typename _Container::iterator)
+ : container(&__x) {}
+
+ insert_iterator<_Container>&
+ operator=(const typename _Container::value_type& __value)
+ {
+ container->insert(__value);
+ return *this;
+ }
+
+ insert_iterator<_Container>&
+ operator*()
+ { return *this; }
+
+ insert_iterator<_Container>&
+ operator++()
+ { return *this; }
+
+ insert_iterator<_Container>&
+ operator++(int) { return *this; }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/iterator b/i686-linux/include/c++/4.4.3/ext/iterator
new file mode 100644
index 0000000..83b4b57
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/iterator
@@ -0,0 +1,113 @@
+// HP/SGI iterator extensions -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2004, 2005, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996-1998
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file ext/iterator
+ * This file is a GNU extension to the Standard C++ Library (possibly
+ * containing extensions from the HP/SGI STL subset).
+ */
+
+#ifndef _EXT_ITERATOR
+#define _EXT_ITERATOR 1
+
+#pragma GCC system_header
+
+#include <bits/concept_check.h>
+#include <iterator>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ // There are two signatures for distance. In addition to the one
+ // taking two iterators and returning a result, there is another
+ // taking two iterators and a reference-to-result variable, and
+ // returning nothing. The latter seems to be an SGI extension.
+ // -- pedwards
+ template<typename _InputIterator, typename _Distance>
+ inline void
+ __distance(_InputIterator __first, _InputIterator __last,
+ _Distance& __n, std::input_iterator_tag)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ while (__first != __last)
+ {
+ ++__first;
+ ++__n;
+ }
+ }
+
+ template<typename _RandomAccessIterator, typename _Distance>
+ inline void
+ __distance(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ _Distance& __n, std::random_access_iterator_tag)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __n += __last - __first;
+ }
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template<typename _InputIterator, typename _Distance>
+ inline void
+ distance(_InputIterator __first, _InputIterator __last,
+ _Distance& __n)
+ {
+ // concept requirements -- taken care of in __distance
+ __distance(__first, __last, __n, std::__iterator_category(__first));
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
+
diff --git a/i686-linux/include/c++/4.4.3/ext/malloc_allocator.h b/i686-linux/include/c++/4.4.3/ext/malloc_allocator.h
new file mode 100644
index 0000000..4c4a72a
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/malloc_allocator.h
@@ -0,0 +1,134 @@
+// Allocator that wraps "C" malloc -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ext/malloc_allocator.h
+ * This file is a GNU extension to the Standard C++ Library.
+ */
+
+#ifndef _MALLOC_ALLOCATOR_H
+#define _MALLOC_ALLOCATOR_H 1
+
+#include <cstdlib>
+#include <new>
+#include <bits/functexcept.h>
+#include <bits/move.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::size_t;
+ using std::ptrdiff_t;
+
+ /**
+ * @brief An allocator that uses malloc.
+ * @ingroup allocators
+ *
+ * This is precisely the allocator defined in the C++ Standard.
+ * - all allocation calls malloc
+ * - all deallocation calls free
+ */
+ template<typename _Tp>
+ class malloc_allocator
+ {
+ public:
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Tp* pointer;
+ typedef const _Tp* const_pointer;
+ typedef _Tp& reference;
+ typedef const _Tp& const_reference;
+ typedef _Tp value_type;
+
+ template<typename _Tp1>
+ struct rebind
+ { typedef malloc_allocator<_Tp1> other; };
+
+ malloc_allocator() throw() { }
+
+ malloc_allocator(const malloc_allocator&) throw() { }
+
+ template<typename _Tp1>
+ malloc_allocator(const malloc_allocator<_Tp1>&) throw() { }
+
+ ~malloc_allocator() throw() { }
+
+ pointer
+ address(reference __x) const { return &__x; }
+
+ const_pointer
+ address(const_reference __x) const { return &__x; }
+
+ // NB: __n is permitted to be 0. The C++ standard says nothing
+ // about what the return value is when __n == 0.
+ pointer
+ allocate(size_type __n, const void* = 0)
+ {
+ if (__builtin_expect(__n > this->max_size(), false))
+ std::__throw_bad_alloc();
+
+ pointer __ret = static_cast<_Tp*>(std::malloc(__n * sizeof(_Tp)));
+ if (!__ret)
+ std::__throw_bad_alloc();
+ return __ret;
+ }
+
+ // __p is not permitted to be a null pointer.
+ void
+ deallocate(pointer __p, size_type)
+ { std::free(static_cast<void*>(__p)); }
+
+ size_type
+ max_size() const throw()
+ { return size_t(-1) / sizeof(_Tp); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 402. wrong new expression in [some_] allocator::construct
+ void
+ construct(pointer __p, const _Tp& __val)
+ { ::new((void *)__p) value_type(__val); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename... _Args>
+ void
+ construct(pointer __p, _Args&&... __args)
+ { ::new((void *)__p) _Tp(std::forward<_Args>(__args)...); }
+#endif
+
+ void
+ destroy(pointer __p) { __p->~_Tp(); }
+ };
+
+ template<typename _Tp>
+ inline bool
+ operator==(const malloc_allocator<_Tp>&, const malloc_allocator<_Tp>&)
+ { return true; }
+
+ template<typename _Tp>
+ inline bool
+ operator!=(const malloc_allocator<_Tp>&, const malloc_allocator<_Tp>&)
+ { return false; }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/memory b/i686-linux/include/c++/4.4.3/ext/memory
new file mode 100644
index 0000000..7776d73
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/memory
@@ -0,0 +1,195 @@
+// Memory extensions -*- C++ -*-
+
+// Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file ext/memory
+ * This file is a GNU extension to the Standard C++ Library (possibly
+ * containing extensions from the HP/SGI STL subset).
+ */
+
+#ifndef _EXT_MEMORY
+#define _EXT_MEMORY 1
+
+#pragma GCC system_header
+
+#include <memory>
+#include <bits/stl_tempbuf.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::ptrdiff_t;
+ using std::pair;
+ using std::__iterator_category;
+ using std::_Temporary_buffer;
+
+ template<typename _InputIter, typename _Size, typename _ForwardIter>
+ pair<_InputIter, _ForwardIter>
+ __uninitialized_copy_n(_InputIter __first, _Size __count,
+ _ForwardIter __result, std::input_iterator_tag)
+ {
+ _ForwardIter __cur = __result;
+ __try
+ {
+ for (; __count > 0 ; --__count, ++__first, ++__cur)
+ std::_Construct(&*__cur, *__first);
+ return pair<_InputIter, _ForwardIter>(__first, __cur);
+ }
+ __catch(...)
+ {
+ std::_Destroy(__result, __cur);
+ __throw_exception_again;
+ }
+ }
+
+ template<typename _RandomAccessIter, typename _Size, typename _ForwardIter>
+ inline pair<_RandomAccessIter, _ForwardIter>
+ __uninitialized_copy_n(_RandomAccessIter __first, _Size __count,
+ _ForwardIter __result,
+ std::random_access_iterator_tag)
+ {
+ _RandomAccessIter __last = __first + __count;
+ return (pair<_RandomAccessIter, _ForwardIter>
+ (__last, std::uninitialized_copy(__first, __last, __result)));
+ }
+
+ template<typename _InputIter, typename _Size, typename _ForwardIter>
+ inline pair<_InputIter, _ForwardIter>
+ __uninitialized_copy_n(_InputIter __first, _Size __count,
+ _ForwardIter __result)
+ { return __gnu_cxx::__uninitialized_copy_n(__first, __count, __result,
+ __iterator_category(__first)); }
+
+ /**
+ * @brief Copies the range [first,last) into result.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param result An output iterator.
+ * @return result + (first - last)
+ * @ingroup SGIextensions
+ *
+ * Like copy(), but does not require an initialized output range.
+ */
+ template<typename _InputIter, typename _Size, typename _ForwardIter>
+ inline pair<_InputIter, _ForwardIter>
+ uninitialized_copy_n(_InputIter __first, _Size __count,
+ _ForwardIter __result)
+ { return __gnu_cxx::__uninitialized_copy_n(__first, __count, __result,
+ __iterator_category(__first)); }
+
+
+ // An alternative version of uninitialized_copy_n that constructs
+ // and destroys objects with a user-provided allocator.
+ template<typename _InputIter, typename _Size, typename _ForwardIter,
+ typename _Allocator>
+ pair<_InputIter, _ForwardIter>
+ __uninitialized_copy_n_a(_InputIter __first, _Size __count,
+ _ForwardIter __result,
+ _Allocator __alloc)
+ {
+ _ForwardIter __cur = __result;
+ __try
+ {
+ for (; __count > 0 ; --__count, ++__first, ++__cur)
+ __alloc.construct(&*__cur, *__first);
+ return pair<_InputIter, _ForwardIter>(__first, __cur);
+ }
+ __catch(...)
+ {
+ std::_Destroy(__result, __cur, __alloc);
+ __throw_exception_again;
+ }
+ }
+
+ template<typename _InputIter, typename _Size, typename _ForwardIter,
+ typename _Tp>
+ inline pair<_InputIter, _ForwardIter>
+ __uninitialized_copy_n_a(_InputIter __first, _Size __count,
+ _ForwardIter __result,
+ std::allocator<_Tp>)
+ {
+ return __gnu_cxx::uninitialized_copy_n(__first, __count, __result);
+ }
+
+ /**
+ * This class provides similar behavior and semantics of the standard
+ * functions get_temporary_buffer() and return_temporary_buffer(), but
+ * encapsulated in a type vaguely resembling a standard container.
+ *
+ * By default, a temporary_buffer<Iter> stores space for objects of
+ * whatever type the Iter iterator points to. It is constructed from a
+ * typical [first,last) range, and provides the begin(), end(), size()
+ * functions, as well as requested_size(). For non-trivial types, copies
+ * of *first will be used to initialize the storage.
+ *
+ * @c malloc is used to obtain underlying storage.
+ *
+ * Like get_temporary_buffer(), not all the requested memory may be
+ * available. Ideally, the created buffer will be large enough to hold a
+ * copy of [first,last), but if size() is less than requested_size(),
+ * then this didn't happen.
+ *
+ * @ingroup SGIextensions
+ */
+ template <class _ForwardIterator, class _Tp
+ = typename std::iterator_traits<_ForwardIterator>::value_type >
+ struct temporary_buffer : public _Temporary_buffer<_ForwardIterator, _Tp>
+ {
+ /// Requests storage large enough to hold a copy of [first,last).
+ temporary_buffer(_ForwardIterator __first, _ForwardIterator __last)
+ : _Temporary_buffer<_ForwardIterator, _Tp>(__first, __last) { }
+
+ /// Destroys objects and frees storage.
+ ~temporary_buffer() { }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
+
diff --git a/i686-linux/include/c++/4.4.3/ext/mt_allocator.h b/i686-linux/include/c++/4.4.3/ext/mt_allocator.h
new file mode 100644
index 0000000..f03f3a6
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/mt_allocator.h
@@ -0,0 +1,751 @@
+// MT-optimized allocator -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ext/mt_allocator.h
+ * This file is a GNU extension to the Standard C++ Library.
+ */
+
+#ifndef _MT_ALLOCATOR_H
+#define _MT_ALLOCATOR_H 1
+
+#include <new>
+#include <cstdlib>
+#include <bits/functexcept.h>
+#include <ext/atomicity.h>
+#include <bits/move.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::size_t;
+ using std::ptrdiff_t;
+
+ typedef void (*__destroy_handler)(void*);
+
+ /// Base class for pool object.
+ struct __pool_base
+ {
+ // Using short int as type for the binmap implies we are never
+ // caching blocks larger than 32768 with this allocator.
+ typedef unsigned short int _Binmap_type;
+
+ // Variables used to configure the behavior of the allocator,
+ // assigned and explained in detail below.
+ struct _Tune
+ {
+ // Compile time constants for the default _Tune values.
+ enum { _S_align = 8 };
+ enum { _S_max_bytes = 128 };
+ enum { _S_min_bin = 8 };
+ enum { _S_chunk_size = 4096 - 4 * sizeof(void*) };
+ enum { _S_max_threads = 4096 };
+ enum { _S_freelist_headroom = 10 };
+
+ // Alignment needed.
+ // NB: In any case must be >= sizeof(_Block_record), that
+ // is 4 on 32 bit machines and 8 on 64 bit machines.
+ size_t _M_align;
+
+ // Allocation requests (after round-up to power of 2) below
+ // this value will be handled by the allocator. A raw new/
+ // call will be used for requests larger than this value.
+ // NB: Must be much smaller than _M_chunk_size and in any
+ // case <= 32768.
+ size_t _M_max_bytes;
+
+ // Size in bytes of the smallest bin.
+ // NB: Must be a power of 2 and >= _M_align (and of course
+ // much smaller than _M_max_bytes).
+ size_t _M_min_bin;
+
+ // In order to avoid fragmenting and minimize the number of
+ // new() calls we always request new memory using this
+ // value. Based on previous discussions on the libstdc++
+ // mailing list we have chosen the value below.
+ // See http://gcc.gnu.org/ml/libstdc++/2001-07/msg00077.html
+ // NB: At least one order of magnitude > _M_max_bytes.
+ size_t _M_chunk_size;
+
+ // The maximum number of supported threads. For
+ // single-threaded operation, use one. Maximum values will
+ // vary depending on details of the underlying system. (For
+ // instance, Linux 2.4.18 reports 4070 in
+ // /proc/sys/kernel/threads-max, while Linux 2.6.6 reports
+ // 65534)
+ size_t _M_max_threads;
+
+ // Each time a deallocation occurs in a threaded application
+ // we make sure that there are no more than
+ // _M_freelist_headroom % of used memory on the freelist. If
+ // the number of additional records is more than
+ // _M_freelist_headroom % of the freelist, we move these
+ // records back to the global pool.
+ size_t _M_freelist_headroom;
+
+ // Set to true forces all allocations to use new().
+ bool _M_force_new;
+
+ explicit
+ _Tune()
+ : _M_align(_S_align), _M_max_bytes(_S_max_bytes), _M_min_bin(_S_min_bin),
+ _M_chunk_size(_S_chunk_size), _M_max_threads(_S_max_threads),
+ _M_freelist_headroom(_S_freelist_headroom),
+ _M_force_new(std::getenv("GLIBCXX_FORCE_NEW") ? true : false)
+ { }
+
+ explicit
+ _Tune(size_t __align, size_t __maxb, size_t __minbin, size_t __chunk,
+ size_t __maxthreads, size_t __headroom, bool __force)
+ : _M_align(__align), _M_max_bytes(__maxb), _M_min_bin(__minbin),
+ _M_chunk_size(__chunk), _M_max_threads(__maxthreads),
+ _M_freelist_headroom(__headroom), _M_force_new(__force)
+ { }
+ };
+
+ struct _Block_address
+ {
+ void* _M_initial;
+ _Block_address* _M_next;
+ };
+
+ const _Tune&
+ _M_get_options() const
+ { return _M_options; }
+
+ void
+ _M_set_options(_Tune __t)
+ {
+ if (!_M_init)
+ _M_options = __t;
+ }
+
+ bool
+ _M_check_threshold(size_t __bytes)
+ { return __bytes > _M_options._M_max_bytes || _M_options._M_force_new; }
+
+ size_t
+ _M_get_binmap(size_t __bytes)
+ { return _M_binmap[__bytes]; }
+
+ size_t
+ _M_get_align()
+ { return _M_options._M_align; }
+
+ explicit
+ __pool_base()
+ : _M_options(_Tune()), _M_binmap(NULL), _M_init(false) { }
+
+ explicit
+ __pool_base(const _Tune& __options)
+ : _M_options(__options), _M_binmap(NULL), _M_init(false) { }
+
+ private:
+ explicit
+ __pool_base(const __pool_base&);
+
+ __pool_base&
+ operator=(const __pool_base&);
+
+ protected:
+ // Configuration options.
+ _Tune _M_options;
+
+ _Binmap_type* _M_binmap;
+
+ // Configuration of the pool object via _M_options can happen
+ // after construction but before initialization. After
+ // initialization is complete, this variable is set to true.
+ bool _M_init;
+ };
+
+
+ /**
+ * @brief Data describing the underlying memory pool, parameterized on
+ * threading support.
+ */
+ template<bool _Thread>
+ class __pool;
+
+ /// Specialization for single thread.
+ template<>
+ class __pool<false> : public __pool_base
+ {
+ public:
+ union _Block_record
+ {
+ // Points to the block_record of the next free block.
+ _Block_record* _M_next;
+ };
+
+ struct _Bin_record
+ {
+ // An "array" of pointers to the first free block.
+ _Block_record** _M_first;
+
+ // A list of the initial addresses of all allocated blocks.
+ _Block_address* _M_address;
+ };
+
+ void
+ _M_initialize_once()
+ {
+ if (__builtin_expect(_M_init == false, false))
+ _M_initialize();
+ }
+
+ void
+ _M_destroy() throw();
+
+ char*
+ _M_reserve_block(size_t __bytes, const size_t __thread_id);
+
+ void
+ _M_reclaim_block(char* __p, size_t __bytes);
+
+ size_t
+ _M_get_thread_id() { return 0; }
+
+ const _Bin_record&
+ _M_get_bin(size_t __which)
+ { return _M_bin[__which]; }
+
+ void
+ _M_adjust_freelist(const _Bin_record&, _Block_record*, size_t)
+ { }
+
+ explicit __pool()
+ : _M_bin(NULL), _M_bin_size(1) { }
+
+ explicit __pool(const __pool_base::_Tune& __tune)
+ : __pool_base(__tune), _M_bin(NULL), _M_bin_size(1) { }
+
+ private:
+ // An "array" of bin_records each of which represents a specific
+ // power of 2 size. Memory to this "array" is allocated in
+ // _M_initialize().
+ _Bin_record* _M_bin;
+
+ // Actual value calculated in _M_initialize().
+ size_t _M_bin_size;
+
+ void
+ _M_initialize();
+ };
+
+#ifdef __GTHREADS
+ /// Specialization for thread enabled, via gthreads.h.
+ template<>
+ class __pool<true> : public __pool_base
+ {
+ public:
+ // Each requesting thread is assigned an id ranging from 1 to
+ // _S_max_threads. Thread id 0 is used as a global memory pool.
+ // In order to get constant performance on the thread assignment
+ // routine, we keep a list of free ids. When a thread first
+ // requests memory we remove the first record in this list and
+ // stores the address in a __gthread_key. When initializing the
+ // __gthread_key we specify a destructor. When this destructor
+ // (i.e. the thread dies) is called, we return the thread id to
+ // the front of this list.
+ struct _Thread_record
+ {
+ // Points to next free thread id record. NULL if last record in list.
+ _Thread_record* _M_next;
+
+ // Thread id ranging from 1 to _S_max_threads.
+ size_t _M_id;
+ };
+
+ union _Block_record
+ {
+ // Points to the block_record of the next free block.
+ _Block_record* _M_next;
+
+ // The thread id of the thread which has requested this block.
+ size_t _M_thread_id;
+ };
+
+ struct _Bin_record
+ {
+ // An "array" of pointers to the first free block for each
+ // thread id. Memory to this "array" is allocated in
+ // _S_initialize() for _S_max_threads + global pool 0.
+ _Block_record** _M_first;
+
+ // A list of the initial addresses of all allocated blocks.
+ _Block_address* _M_address;
+
+ // An "array" of counters used to keep track of the amount of
+ // blocks that are on the freelist/used for each thread id.
+ // - Note that the second part of the allocated _M_used "array"
+ // actually hosts (atomic) counters of reclaimed blocks: in
+ // _M_reserve_block and in _M_reclaim_block those numbers are
+ // subtracted from the first ones to obtain the actual size
+ // of the "working set" of the given thread.
+ // - Memory to these "arrays" is allocated in _S_initialize()
+ // for _S_max_threads + global pool 0.
+ size_t* _M_free;
+ size_t* _M_used;
+
+ // Each bin has its own mutex which is used to ensure data
+ // integrity while changing "ownership" on a block. The mutex
+ // is initialized in _S_initialize().
+ __gthread_mutex_t* _M_mutex;
+ };
+
+ // XXX GLIBCXX_ABI Deprecated
+ void
+ _M_initialize(__destroy_handler);
+
+ void
+ _M_initialize_once()
+ {
+ if (__builtin_expect(_M_init == false, false))
+ _M_initialize();
+ }
+
+ void
+ _M_destroy() throw();
+
+ char*
+ _M_reserve_block(size_t __bytes, const size_t __thread_id);
+
+ void
+ _M_reclaim_block(char* __p, size_t __bytes);
+
+ const _Bin_record&
+ _M_get_bin(size_t __which)
+ { return _M_bin[__which]; }
+
+ void
+ _M_adjust_freelist(const _Bin_record& __bin, _Block_record* __block,
+ size_t __thread_id)
+ {
+ if (__gthread_active_p())
+ {
+ __block->_M_thread_id = __thread_id;
+ --__bin._M_free[__thread_id];
+ ++__bin._M_used[__thread_id];
+ }
+ }
+
+ // XXX GLIBCXX_ABI Deprecated
+ void
+ _M_destroy_thread_key(void*);
+
+ size_t
+ _M_get_thread_id();
+
+ explicit __pool()
+ : _M_bin(NULL), _M_bin_size(1), _M_thread_freelist(NULL)
+ { }
+
+ explicit __pool(const __pool_base::_Tune& __tune)
+ : __pool_base(__tune), _M_bin(NULL), _M_bin_size(1),
+ _M_thread_freelist(NULL)
+ { }
+
+ private:
+ // An "array" of bin_records each of which represents a specific
+ // power of 2 size. Memory to this "array" is allocated in
+ // _M_initialize().
+ _Bin_record* _M_bin;
+
+ // Actual value calculated in _M_initialize().
+ size_t _M_bin_size;
+
+ _Thread_record* _M_thread_freelist;
+ void* _M_thread_freelist_initial;
+
+ void
+ _M_initialize();
+ };
+#endif
+
+ template<template <bool> class _PoolTp, bool _Thread>
+ struct __common_pool
+ {
+ typedef _PoolTp<_Thread> pool_type;
+
+ static pool_type&
+ _S_get_pool()
+ {
+ static pool_type _S_pool;
+ return _S_pool;
+ }
+ };
+
+ template<template <bool> class _PoolTp, bool _Thread>
+ struct __common_pool_base;
+
+ template<template <bool> class _PoolTp>
+ struct __common_pool_base<_PoolTp, false>
+ : public __common_pool<_PoolTp, false>
+ {
+ using __common_pool<_PoolTp, false>::_S_get_pool;
+
+ static void
+ _S_initialize_once()
+ {
+ static bool __init;
+ if (__builtin_expect(__init == false, false))
+ {
+ _S_get_pool()._M_initialize_once();
+ __init = true;
+ }
+ }
+ };
+
+#ifdef __GTHREADS
+ template<template <bool> class _PoolTp>
+ struct __common_pool_base<_PoolTp, true>
+ : public __common_pool<_PoolTp, true>
+ {
+ using __common_pool<_PoolTp, true>::_S_get_pool;
+
+ static void
+ _S_initialize()
+ { _S_get_pool()._M_initialize_once(); }
+
+ static void
+ _S_initialize_once()
+ {
+ static bool __init;
+ if (__builtin_expect(__init == false, false))
+ {
+ if (__gthread_active_p())
+ {
+ // On some platforms, __gthread_once_t is an aggregate.
+ static __gthread_once_t __once = __GTHREAD_ONCE_INIT;
+ __gthread_once(&__once, _S_initialize);
+ }
+
+ // Double check initialization. May be necessary on some
+ // systems for proper construction when not compiling with
+ // thread flags.
+ _S_get_pool()._M_initialize_once();
+ __init = true;
+ }
+ }
+ };
+#endif
+
+ /// Policy for shared __pool objects.
+ template<template <bool> class _PoolTp, bool _Thread>
+ struct __common_pool_policy : public __common_pool_base<_PoolTp, _Thread>
+ {
+ template<typename _Tp1, template <bool> class _PoolTp1 = _PoolTp,
+ bool _Thread1 = _Thread>
+ struct _M_rebind
+ { typedef __common_pool_policy<_PoolTp1, _Thread1> other; };
+
+ using __common_pool_base<_PoolTp, _Thread>::_S_get_pool;
+ using __common_pool_base<_PoolTp, _Thread>::_S_initialize_once;
+ };
+
+
+ template<typename _Tp, template <bool> class _PoolTp, bool _Thread>
+ struct __per_type_pool
+ {
+ typedef _Tp value_type;
+ typedef _PoolTp<_Thread> pool_type;
+
+ static pool_type&
+ _S_get_pool()
+ {
+ // Sane defaults for the _PoolTp.
+ typedef typename pool_type::_Block_record _Block_record;
+ const static size_t __a = (__alignof__(_Tp) >= sizeof(_Block_record)
+ ? __alignof__(_Tp) : sizeof(_Block_record));
+
+ typedef typename __pool_base::_Tune _Tune;
+ static _Tune _S_tune(__a, sizeof(_Tp) * 64,
+ sizeof(_Tp) * 2 >= __a ? sizeof(_Tp) * 2 : __a,
+ sizeof(_Tp) * size_t(_Tune::_S_chunk_size),
+ _Tune::_S_max_threads,
+ _Tune::_S_freelist_headroom,
+ std::getenv("GLIBCXX_FORCE_NEW") ? true : false);
+ static pool_type _S_pool(_S_tune);
+ return _S_pool;
+ }
+ };
+
+ template<typename _Tp, template <bool> class _PoolTp, bool _Thread>
+ struct __per_type_pool_base;
+
+ template<typename _Tp, template <bool> class _PoolTp>
+ struct __per_type_pool_base<_Tp, _PoolTp, false>
+ : public __per_type_pool<_Tp, _PoolTp, false>
+ {
+ using __per_type_pool<_Tp, _PoolTp, false>::_S_get_pool;
+
+ static void
+ _S_initialize_once()
+ {
+ static bool __init;
+ if (__builtin_expect(__init == false, false))
+ {
+ _S_get_pool()._M_initialize_once();
+ __init = true;
+ }
+ }
+ };
+
+ #ifdef __GTHREADS
+ template<typename _Tp, template <bool> class _PoolTp>
+ struct __per_type_pool_base<_Tp, _PoolTp, true>
+ : public __per_type_pool<_Tp, _PoolTp, true>
+ {
+ using __per_type_pool<_Tp, _PoolTp, true>::_S_get_pool;
+
+ static void
+ _S_initialize()
+ { _S_get_pool()._M_initialize_once(); }
+
+ static void
+ _S_initialize_once()
+ {
+ static bool __init;
+ if (__builtin_expect(__init == false, false))
+ {
+ if (__gthread_active_p())
+ {
+ // On some platforms, __gthread_once_t is an aggregate.
+ static __gthread_once_t __once = __GTHREAD_ONCE_INIT;
+ __gthread_once(&__once, _S_initialize);
+ }
+
+ // Double check initialization. May be necessary on some
+ // systems for proper construction when not compiling with
+ // thread flags.
+ _S_get_pool()._M_initialize_once();
+ __init = true;
+ }
+ }
+ };
+#endif
+
+ /// Policy for individual __pool objects.
+ template<typename _Tp, template <bool> class _PoolTp, bool _Thread>
+ struct __per_type_pool_policy
+ : public __per_type_pool_base<_Tp, _PoolTp, _Thread>
+ {
+ template<typename _Tp1, template <bool> class _PoolTp1 = _PoolTp,
+ bool _Thread1 = _Thread>
+ struct _M_rebind
+ { typedef __per_type_pool_policy<_Tp1, _PoolTp1, _Thread1> other; };
+
+ using __per_type_pool_base<_Tp, _PoolTp, _Thread>::_S_get_pool;
+ using __per_type_pool_base<_Tp, _PoolTp, _Thread>::_S_initialize_once;
+ };
+
+
+ /// Base class for _Tp dependent member functions.
+ template<typename _Tp>
+ class __mt_alloc_base
+ {
+ public:
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Tp* pointer;
+ typedef const _Tp* const_pointer;
+ typedef _Tp& reference;
+ typedef const _Tp& const_reference;
+ typedef _Tp value_type;
+
+ pointer
+ address(reference __x) const
+ { return &__x; }
+
+ const_pointer
+ address(const_reference __x) const
+ { return &__x; }
+
+ size_type
+ max_size() const throw()
+ { return size_t(-1) / sizeof(_Tp); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 402. wrong new expression in [some_] allocator::construct
+ void
+ construct(pointer __p, const _Tp& __val)
+ { ::new((void *)__p) _Tp(__val); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename... _Args>
+ void
+ construct(pointer __p, _Args&&... __args)
+ { ::new((void *)__p) _Tp(std::forward<_Args>(__args)...); }
+#endif
+
+ void
+ destroy(pointer __p) { __p->~_Tp(); }
+ };
+
+#ifdef __GTHREADS
+#define __thread_default true
+#else
+#define __thread_default false
+#endif
+
+ /**
+ * @brief This is a fixed size (power of 2) allocator which - when
+ * compiled with thread support - will maintain one freelist per
+ * size per thread plus a "global" one. Steps are taken to limit
+ * the per thread freelist sizes (by returning excess back to
+ * the "global" list).
+ * @ingroup allocators
+ *
+ * Further details:
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt12ch32.html
+ */
+ template<typename _Tp,
+ typename _Poolp = __common_pool_policy<__pool, __thread_default> >
+ class __mt_alloc : public __mt_alloc_base<_Tp>
+ {
+ public:
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Tp* pointer;
+ typedef const _Tp* const_pointer;
+ typedef _Tp& reference;
+ typedef const _Tp& const_reference;
+ typedef _Tp value_type;
+ typedef _Poolp __policy_type;
+ typedef typename _Poolp::pool_type __pool_type;
+
+ template<typename _Tp1, typename _Poolp1 = _Poolp>
+ struct rebind
+ {
+ typedef typename _Poolp1::template _M_rebind<_Tp1>::other pol_type;
+ typedef __mt_alloc<_Tp1, pol_type> other;
+ };
+
+ __mt_alloc() throw() { }
+
+ __mt_alloc(const __mt_alloc&) throw() { }
+
+ template<typename _Tp1, typename _Poolp1>
+ __mt_alloc(const __mt_alloc<_Tp1, _Poolp1>&) throw() { }
+
+ ~__mt_alloc() throw() { }
+
+ pointer
+ allocate(size_type __n, const void* = 0);
+
+ void
+ deallocate(pointer __p, size_type __n);
+
+ const __pool_base::_Tune
+ _M_get_options()
+ {
+ // Return a copy, not a reference, for external consumption.
+ return __policy_type::_S_get_pool()._M_get_options();
+ }
+
+ void
+ _M_set_options(__pool_base::_Tune __t)
+ { __policy_type::_S_get_pool()._M_set_options(__t); }
+ };
+
+ template<typename _Tp, typename _Poolp>
+ typename __mt_alloc<_Tp, _Poolp>::pointer
+ __mt_alloc<_Tp, _Poolp>::
+ allocate(size_type __n, const void*)
+ {
+ if (__builtin_expect(__n > this->max_size(), false))
+ std::__throw_bad_alloc();
+
+ __policy_type::_S_initialize_once();
+
+ // Requests larger than _M_max_bytes are handled by operator
+ // new/delete directly.
+ __pool_type& __pool = __policy_type::_S_get_pool();
+ const size_t __bytes = __n * sizeof(_Tp);
+ if (__pool._M_check_threshold(__bytes))
+ {
+ void* __ret = ::operator new(__bytes);
+ return static_cast<_Tp*>(__ret);
+ }
+
+ // Round up to power of 2 and figure out which bin to use.
+ const size_t __which = __pool._M_get_binmap(__bytes);
+ const size_t __thread_id = __pool._M_get_thread_id();
+
+ // Find out if we have blocks on our freelist. If so, go ahead
+ // and use them directly without having to lock anything.
+ char* __c;
+ typedef typename __pool_type::_Bin_record _Bin_record;
+ const _Bin_record& __bin = __pool._M_get_bin(__which);
+ if (__bin._M_first[__thread_id])
+ {
+ // Already reserved.
+ typedef typename __pool_type::_Block_record _Block_record;
+ _Block_record* __block = __bin._M_first[__thread_id];
+ __bin._M_first[__thread_id] = __block->_M_next;
+
+ __pool._M_adjust_freelist(__bin, __block, __thread_id);
+ __c = reinterpret_cast<char*>(__block) + __pool._M_get_align();
+ }
+ else
+ {
+ // Null, reserve.
+ __c = __pool._M_reserve_block(__bytes, __thread_id);
+ }
+ return static_cast<_Tp*>(static_cast<void*>(__c));
+ }
+
+ template<typename _Tp, typename _Poolp>
+ void
+ __mt_alloc<_Tp, _Poolp>::
+ deallocate(pointer __p, size_type __n)
+ {
+ if (__builtin_expect(__p != 0, true))
+ {
+ // Requests larger than _M_max_bytes are handled by
+ // operators new/delete directly.
+ __pool_type& __pool = __policy_type::_S_get_pool();
+ const size_t __bytes = __n * sizeof(_Tp);
+ if (__pool._M_check_threshold(__bytes))
+ ::operator delete(__p);
+ else
+ __pool._M_reclaim_block(reinterpret_cast<char*>(__p), __bytes);
+ }
+ }
+
+ template<typename _Tp, typename _Poolp>
+ inline bool
+ operator==(const __mt_alloc<_Tp, _Poolp>&, const __mt_alloc<_Tp, _Poolp>&)
+ { return true; }
+
+ template<typename _Tp, typename _Poolp>
+ inline bool
+ operator!=(const __mt_alloc<_Tp, _Poolp>&, const __mt_alloc<_Tp, _Poolp>&)
+ { return false; }
+
+#undef __thread_default
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/new_allocator.h b/i686-linux/include/c++/4.4.3/ext/new_allocator.h
new file mode 100644
index 0000000..290c73a
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/new_allocator.h
@@ -0,0 +1,130 @@
+// Allocator that wraps operator new -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ext/new_allocator.h
+ * This file is a GNU extension to the Standard C++ Library.
+ */
+
+#ifndef _NEW_ALLOCATOR_H
+#define _NEW_ALLOCATOR_H 1
+
+#include <new>
+#include <bits/functexcept.h>
+#include <bits/move.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::size_t;
+ using std::ptrdiff_t;
+
+ /**
+ * @brief An allocator that uses global new, as per [20.4].
+ * @ingroup allocators
+ *
+ * This is precisely the allocator defined in the C++ Standard.
+ * - all allocation calls operator new
+ * - all deallocation calls operator delete
+ */
+ template<typename _Tp>
+ class new_allocator
+ {
+ public:
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Tp* pointer;
+ typedef const _Tp* const_pointer;
+ typedef _Tp& reference;
+ typedef const _Tp& const_reference;
+ typedef _Tp value_type;
+
+ template<typename _Tp1>
+ struct rebind
+ { typedef new_allocator<_Tp1> other; };
+
+ new_allocator() throw() { }
+
+ new_allocator(const new_allocator&) throw() { }
+
+ template<typename _Tp1>
+ new_allocator(const new_allocator<_Tp1>&) throw() { }
+
+ ~new_allocator() throw() { }
+
+ pointer
+ address(reference __x) const { return &__x; }
+
+ const_pointer
+ address(const_reference __x) const { return &__x; }
+
+ // NB: __n is permitted to be 0. The C++ standard says nothing
+ // about what the return value is when __n == 0.
+ pointer
+ allocate(size_type __n, const void* = 0)
+ {
+ if (__builtin_expect(__n > this->max_size(), false))
+ std::__throw_bad_alloc();
+
+ return static_cast<_Tp*>(::operator new(__n * sizeof(_Tp)));
+ }
+
+ // __p is not permitted to be a null pointer.
+ void
+ deallocate(pointer __p, size_type)
+ { ::operator delete(__p); }
+
+ size_type
+ max_size() const throw()
+ { return size_t(-1) / sizeof(_Tp); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 402. wrong new expression in [some_] allocator::construct
+ void
+ construct(pointer __p, const _Tp& __val)
+ { ::new((void *)__p) _Tp(__val); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename... _Args>
+ void
+ construct(pointer __p, _Args&&... __args)
+ { ::new((void *)__p) _Tp(std::forward<_Args>(__args)...); }
+#endif
+
+ void
+ destroy(pointer __p) { __p->~_Tp(); }
+ };
+
+ template<typename _Tp>
+ inline bool
+ operator==(const new_allocator<_Tp>&, const new_allocator<_Tp>&)
+ { return true; }
+
+ template<typename _Tp>
+ inline bool
+ operator!=(const new_allocator<_Tp>&, const new_allocator<_Tp>&)
+ { return false; }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/numeric b/i686-linux/include/c++/4.4.3/ext/numeric
new file mode 100644
index 0000000..5df5ee2
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/numeric
@@ -0,0 +1,146 @@
+// Numeric extensions -*- C++ -*-
+
+// Copyright (C) 2002, 2004, 2005, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file ext/numeric
+ * This file is a GNU extension to the Standard C++ Library (possibly
+ * containing extensions from the HP/SGI STL subset).
+ */
+
+#ifndef _EXT_NUMERIC
+#define _EXT_NUMERIC 1
+
+#pragma GCC system_header
+
+#include <bits/concept_check.h>
+#include <numeric>
+
+#include <ext/functional> // For identity_element
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ // Returns __x ** __n, where __n >= 0. _Note that "multiplication"
+ // is required to be associative, but not necessarily commutative.
+ template<typename _Tp, typename _Integer, typename _MonoidOperation>
+ _Tp
+ __power(_Tp __x, _Integer __n, _MonoidOperation __monoid_op)
+ {
+ if (__n == 0)
+ return identity_element(__monoid_op);
+ else
+ {
+ while ((__n & 1) == 0)
+ {
+ __n >>= 1;
+ __x = __monoid_op(__x, __x);
+ }
+
+ _Tp __result = __x;
+ __n >>= 1;
+ while (__n != 0)
+ {
+ __x = __monoid_op(__x, __x);
+ if ((__n & 1) != 0)
+ __result = __monoid_op(__result, __x);
+ __n >>= 1;
+ }
+ return __result;
+ }
+ }
+
+ template<typename _Tp, typename _Integer>
+ inline _Tp
+ __power(_Tp __x, _Integer __n)
+ { return __power(__x, __n, std::multiplies<_Tp>()); }
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ // Alias for the internal name __power. Note that power is an extension,
+ // not part of the C++ standard.
+ template<typename _Tp, typename _Integer, typename _MonoidOperation>
+ inline _Tp
+ power(_Tp __x, _Integer __n, _MonoidOperation __monoid_op)
+ { return __power(__x, __n, __monoid_op); }
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template<typename _Tp, typename _Integer>
+ inline _Tp
+ power(_Tp __x, _Integer __n)
+ { return __power(__x, __n); }
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ // iota is not part of the C++ standard. It is an extension.
+ template<typename _ForwardIter, typename _Tp>
+ void
+ iota(_ForwardIter __first, _ForwardIter __last, _Tp __value)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>)
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp,
+ typename std::iterator_traits<_ForwardIter>::value_type>)
+
+ while (__first != __last)
+ *__first++ = __value++;
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
+
diff --git a/i686-linux/include/c++/4.4.3/ext/numeric_traits.h b/i686-linux/include/c++/4.4.3/ext/numeric_traits.h
new file mode 100644
index 0000000..57fcf9c
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/numeric_traits.h
@@ -0,0 +1,135 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ext/numeric_traits.h
+ * This file is a GNU extension to the Standard C++ Library.
+ */
+
+#ifndef _EXT_NUMERIC_TRAITS
+#define _EXT_NUMERIC_TRAITS 1
+
+#pragma GCC system_header
+
+#include <bits/cpp_type_traits.h>
+#include <ext/type_traits.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ // Compile time constants for builtin types.
+ // Sadly std::numeric_limits member functions cannot be used for this.
+#define __glibcxx_signed(_Tp) ((_Tp)(-1) < 0)
+#define __glibcxx_digits(_Tp) \
+ (sizeof(_Tp) * __CHAR_BIT__ - __glibcxx_signed(_Tp))
+
+#define __glibcxx_min(_Tp) \
+ (__glibcxx_signed(_Tp) ? (_Tp)1 << __glibcxx_digits(_Tp) : (_Tp)0)
+
+#define __glibcxx_max(_Tp) \
+ (__glibcxx_signed(_Tp) ? \
+ (((((_Tp)1 << (__glibcxx_digits(_Tp) - 1)) - 1) << 1) + 1) : ~(_Tp)0)
+
+ template<typename _Value>
+ struct __numeric_traits_integer
+ {
+ // Only integers for initialization of member constant.
+ static const _Value __min = __glibcxx_min(_Value);
+ static const _Value __max = __glibcxx_max(_Value);
+
+ // NB: these two also available in std::numeric_limits as compile
+ // time constants, but <limits> is big and we avoid including it.
+ static const bool __is_signed = __glibcxx_signed(_Value);
+ static const int __digits = __glibcxx_digits(_Value);
+ };
+
+ template<typename _Value>
+ const _Value __numeric_traits_integer<_Value>::__min;
+
+ template<typename _Value>
+ const _Value __numeric_traits_integer<_Value>::__max;
+
+ template<typename _Value>
+ const bool __numeric_traits_integer<_Value>::__is_signed;
+
+ template<typename _Value>
+ const int __numeric_traits_integer<_Value>::__digits;
+
+#undef __glibcxx_signed
+#undef __glibcxx_digits
+#undef __glibcxx_min
+#undef __glibcxx_max
+
+#define __glibcxx_floating(_Tp, _Fval, _Dval, _LDval) \
+ (std::__are_same<_Tp, float>::__value ? _Fval \
+ : std::__are_same<_Tp, double>::__value ? _Dval : _LDval)
+
+#define __glibcxx_max_digits10(_Tp) \
+ (2 + __glibcxx_floating(_Tp, __FLT_MANT_DIG__, __DBL_MANT_DIG__, \
+ __LDBL_MANT_DIG__) * 3010 / 10000)
+
+#define __glibcxx_digits10(_Tp) \
+ __glibcxx_floating(_Tp, __FLT_DIG__, __DBL_DIG__, __LDBL_DIG__)
+
+#define __glibcxx_max_exponent10(_Tp) \
+ __glibcxx_floating(_Tp, __FLT_MAX_10_EXP__, __DBL_MAX_10_EXP__, \
+ __LDBL_MAX_10_EXP__)
+
+ template<typename _Value>
+ struct __numeric_traits_floating
+ {
+ // Only floating point types. See N1822.
+ static const int __max_digits10 = __glibcxx_max_digits10(_Value);
+
+ // See above comment...
+ static const bool __is_signed = true;
+ static const int __digits10 = __glibcxx_digits10(_Value);
+ static const int __max_exponent10 = __glibcxx_max_exponent10(_Value);
+ };
+
+ template<typename _Value>
+ const int __numeric_traits_floating<_Value>::__max_digits10;
+
+ template<typename _Value>
+ const bool __numeric_traits_floating<_Value>::__is_signed;
+
+ template<typename _Value>
+ const int __numeric_traits_floating<_Value>::__digits10;
+
+ template<typename _Value>
+ const int __numeric_traits_floating<_Value>::__max_exponent10;
+
+ template<typename _Value>
+ struct __numeric_traits
+ : public __conditional_type<std::__is_integer<_Value>::__value,
+ __numeric_traits_integer<_Value>,
+ __numeric_traits_floating<_Value> >::__type
+ { };
+
+_GLIBCXX_END_NAMESPACE
+
+#undef __glibcxx_floating
+#undef __glibcxx_max_digits10
+#undef __glibcxx_digits10
+#undef __glibcxx_max_exponent10
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/assoc_container.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/assoc_container.hpp
new file mode 100644
index 0000000..7bccb88
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/assoc_container.hpp
@@ -0,0 +1,683 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file assoc_container.hpp
+ * Contains associative containers.
+ */
+
+#ifndef PB_DS_ASSOC_CNTNR_HPP
+#define PB_DS_ASSOC_CNTNR_HPP
+
+#include <ext/typelist.h>
+#include <ext/pb_ds/tag_and_trait.hpp>
+#include <ext/pb_ds/detail/standard_policies.hpp>
+#include <ext/pb_ds/detail/container_base_dispatch.hpp>
+#include <ext/pb_ds/detail/basic_tree_policy/traits.hpp>
+
+namespace __gnu_pbds
+{
+#define PB_DS_BASE_C_DEC \
+ detail::container_base_dispatch<Key, Mapped, Tag, Policy_Tl, Allocator>::type
+
+ // An abstract basic associative container.
+ template<typename Key,
+ typename Mapped,
+ typename Tag,
+ typename Policy_Tl,
+ typename Allocator>
+ class container_base : public PB_DS_BASE_C_DEC
+ {
+ private:
+ typedef typename PB_DS_BASE_C_DEC base_type;
+
+ public:
+ typedef Tag container_category;
+ typedef Allocator allocator_type;
+ typedef typename allocator_type::size_type size_type;
+ typedef typename allocator_type::difference_type difference_type;
+
+ // key_type
+ typedef typename allocator_type::template rebind<Key>::other::value_type key_type;
+ typedef typename allocator_type::template rebind<key_type>::other key_rebind;
+ typedef typename key_rebind::reference key_reference;
+ typedef typename key_rebind::const_reference const_key_reference;
+ typedef typename key_rebind::pointer key_pointer;
+ typedef typename key_rebind::const_pointer const_key_pointer;
+
+ // mapped_type
+ typedef Mapped mapped_type;
+ typedef typename allocator_type::template rebind<mapped_type>::other mapped_rebind;
+ typedef typename mapped_rebind::reference mapped_reference;
+ typedef typename mapped_rebind::const_reference const_mapped_reference;
+ typedef typename mapped_rebind::pointer mapped_pointer;
+ typedef typename mapped_rebind::const_pointer const_mapped_pointer;
+
+ // value_type
+ typedef typename base_type::value_type value_type;
+ typedef typename allocator_type::template rebind<value_type>::other value_rebind;
+ typedef typename value_rebind::reference reference;
+ typedef typename value_rebind::const_reference const_reference;
+ typedef typename value_rebind::pointer pointer;
+ typedef typename value_rebind::const_pointer const_pointer;
+
+ // iterators
+ typedef typename base_type::iterator iterator;
+ typedef typename base_type::const_iterator const_iterator;
+ typedef typename base_type::point_iterator point_iterator;
+ typedef typename base_type::const_point_iterator const_point_iterator;
+
+ virtual
+ ~container_base() { }
+
+ protected:
+#define PB_DS_CLASS_NAME container_base
+#include <ext/pb_ds/detail/constructors_destructor_fn_imps.hpp>
+#undef PB_DS_CLASS_NAME
+ };
+
+#undef PB_DS_BASE_C_DEC
+
+
+#define PB_DS_BASE_C_DEC \
+ container_base<Key, Mapped, Tag, typename __gnu_cxx::typelist::append< \
+ typename __gnu_cxx::typelist::create4<Hash_Fn, Eq_Fn, Resize_Policy, detail::integral_constant<int, Store_Hash> >::type, Policy_TL>::type, Allocator>
+
+ // An abstract basic hash-based associative container.
+ template<typename Key,
+ typename Mapped,
+ typename Hash_Fn,
+ typename Eq_Fn,
+ typename Resize_Policy,
+ bool Store_Hash,
+ typename Tag,
+ typename Policy_TL,
+ typename Allocator>
+ class basic_hash_table : public PB_DS_BASE_C_DEC
+ {
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ public:
+ virtual
+ ~basic_hash_table() { }
+
+ protected:
+#define PB_DS_CLASS_NAME basic_hash_table
+#include <ext/pb_ds/detail/constructors_destructor_fn_imps.hpp>
+#undef PB_DS_CLASS_NAME
+
+ private:
+ basic_hash_table&
+ operator=(const base_type&);
+ };
+
+#undef PB_DS_BASE_C_DEC
+
+
+#define PB_DS_BASE_C_DEC \
+ basic_hash_table<Key, Mapped, Hash_Fn, Eq_Fn, Resize_Policy, Store_Hash, \
+ cc_hash_tag, \
+ typename __gnu_cxx::typelist::create1<Comb_Hash_Fn>::type, Allocator>
+
+ // A concrete collision-chaining hash-based associative container.
+ template<typename Key,
+ typename Mapped,
+ typename Hash_Fn = typename detail::default_hash_fn<Key>::type,
+ typename Eq_Fn = typename detail::default_eq_fn<Key>::type,
+ typename Comb_Hash_Fn = detail::default_comb_hash_fn::type,
+ typename Resize_Policy = typename detail::default_resize_policy<Comb_Hash_Fn>::type,
+ bool Store_Hash = detail::default_store_hash,
+ typename Allocator = std::allocator<char> >
+ class cc_hash_table : public PB_DS_BASE_C_DEC
+ {
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ public:
+ typedef Hash_Fn hash_fn;
+ typedef Eq_Fn eq_fn;
+ typedef Resize_Policy resize_policy;
+ typedef Comb_Hash_Fn comb_hash_fn;
+
+ // Default constructor.
+ cc_hash_table() { }
+
+ // Constructor taking some policy objects. r_hash_fn will be
+ // copied by the Hash_Fn object of the container object.
+ cc_hash_table(const hash_fn& h)
+ : base_type(h) { }
+
+ // Constructor taking some policy objects. r_hash_fn will be
+ // copied by the hash_fn object of the container object, and
+ // r_eq_fn will be copied by the eq_fn object of the container
+ // object.
+ cc_hash_table(const hash_fn& h, const eq_fn& e)
+ : base_type(h, e) { }
+
+ // Constructor taking some policy objects. r_hash_fn will be
+ // copied by the hash_fn object of the container object, r_eq_fn
+ // will be copied by the eq_fn object of the container object, and
+ // r_comb_hash_fn will be copied by the comb_hash_fn object of the
+ // container object.
+ cc_hash_table(const hash_fn& h, const eq_fn& e, const comb_hash_fn& ch)
+ : base_type(h, e, ch) { }
+
+ // Constructor taking some policy objects. r_hash_fn will be
+ // copied by the hash_fn object of the container object, r_eq_fn
+ // will be copied by the eq_fn object of the container object,
+ // r_comb_hash_fn will be copied by the comb_hash_fn object of the
+ // container object, and r_resize_policy will be copied by the
+ // resize_policy object of the container object.
+ cc_hash_table(const hash_fn& h, const eq_fn& e, const comb_hash_fn& ch,
+ const resize_policy& rp)
+ : base_type(h, e, ch, rp) { }
+
+ // Constructor taking __iterators to a range of value_types. The
+ // value_types between first_it and last_it will be inserted into
+ // the container object.
+ template<typename It>
+ cc_hash_table(It first, It last)
+ { base_type::copy_from_range(first, last); }
+
+ // Constructor taking __iterators to a range of value_types and
+ // some policy objects. The value_types between first_it and
+ // last_it will be inserted into the container object.
+ template<typename It>
+ cc_hash_table(It first, It last, const hash_fn& h)
+ : base_type(h)
+ { copy_from_range(first, last); }
+
+ // Constructor taking __iterators to a range of value_types and
+ // some policy objects The value_types between first_it and
+ // last_it will be inserted into the container object. r_hash_fn
+ // will be copied by the hash_fn object of the container object,
+ // and r_eq_fn will be copied by the eq_fn object of the container
+ // object.
+ template<typename It>
+ cc_hash_table(It first, It last, const hash_fn& h, const eq_fn& e)
+ : base_type(h, e)
+ { copy_from_range(first, last); }
+
+ // Constructor taking __iterators to a range of value_types and
+ // some policy objects The value_types between first_it and
+ // last_it will be inserted into the container object. r_hash_fn
+ // will be copied by the hash_fn object of the container object,
+ // r_eq_fn will be copied by the eq_fn object of the container
+ // object, and r_comb_hash_fn will be copied by the comb_hash_fn
+ // object of the container object.
+ template<typename It>
+ cc_hash_table(It first, It last, const hash_fn& h, const eq_fn& e,
+ const comb_hash_fn& ch)
+ : base_type(h, e, ch)
+ { copy_from_range(first, last); }
+
+ // Constructor taking __iterators to a range of value_types and
+ // some policy objects The value_types between first_it and
+ // last_it will be inserted into the container object. r_hash_fn
+ // will be copied by the hash_fn object of the container object,
+ // r_eq_fn will be copied by the eq_fn object of the container
+ // object, r_comb_hash_fn will be copied by the comb_hash_fn
+ // object of the container object, and r_resize_policy will be
+ // copied by the resize_policy object of the container object.
+ template<typename It>
+ cc_hash_table(It first, It last, const hash_fn& h, const eq_fn& e,
+ const comb_hash_fn& ch, const resize_policy& rp)
+ : base_type(h, e, ch, rp)
+ { copy_from_range(first, last); }
+
+ cc_hash_table(const cc_hash_table& other)
+ : base_type((const base_type&)other)
+ { }
+
+ virtual
+ ~cc_hash_table() { }
+
+ cc_hash_table&
+ operator=(const cc_hash_table& other)
+ {
+ if (this != &other)
+ {
+ cc_hash_table tmp(other);
+ swap(tmp);
+ }
+ return *this;
+ }
+
+ void
+ swap(cc_hash_table& other)
+ { base_type::swap(other); }
+ };
+
+#undef PB_DS_BASE_C_DEC
+
+
+#define PB_DS_BASE_C_DEC \
+ basic_hash_table<Key, Mapped, Hash_Fn, Eq_Fn, Resize_Policy, Store_Hash, \
+ gp_hash_tag, \
+ typename __gnu_cxx::typelist::create2<Comb_Probe_Fn, Probe_Fn>::type, Allocator>
+
+ // A concrete general-probing hash-based associative container.
+ template<typename Key,
+ typename Mapped,
+ typename Hash_Fn = typename detail::default_hash_fn<Key>::type,
+ typename Eq_Fn = typename detail::default_eq_fn<Key>::type,
+ typename Comb_Probe_Fn = detail::default_comb_hash_fn::type,
+ typename Probe_Fn = typename detail::default_probe_fn<Comb_Probe_Fn>::type,
+ typename Resize_Policy = typename detail::default_resize_policy<Comb_Probe_Fn>::type,
+ bool Store_Hash = detail::default_store_hash,
+ typename Allocator = std::allocator<char> >
+ class gp_hash_table : public PB_DS_BASE_C_DEC
+ {
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ public:
+ typedef Hash_Fn hash_fn;
+ typedef Eq_Fn eq_fn;
+ typedef Comb_Probe_Fn comb_probe_fn;
+ typedef Probe_Fn probe_fn;
+ typedef Resize_Policy resize_policy;
+
+ // Default constructor.
+ gp_hash_table() { }
+
+ // Constructor taking some policy objects. r_hash_fn will be
+ // copied by the hash_fn object of the container object.
+ gp_hash_table(const hash_fn& h)
+ : base_type(h) { }
+
+ // Constructor taking some policy objects. r_hash_fn will be
+ // copied by the hash_fn object of the container object, and
+ // r_eq_fn will be copied by the eq_fn object of the container
+ // object.
+ gp_hash_table(const hash_fn& h, const eq_fn& e)
+ : base_type(h, e) { }
+
+ // Constructor taking some policy objects. r_hash_fn will be
+ // copied by the hash_fn object of the container object, r_eq_fn
+ // will be copied by the eq_fn object of the container object, and
+ // r_comb_probe_fn will be copied by the comb_probe_fn object of
+ // the container object.
+ gp_hash_table(const hash_fn& h, const eq_fn& e, const comb_probe_fn& cp)
+ : base_type(h, e, cp) { }
+
+ // Constructor taking some policy objects. r_hash_fn will be
+ // copied by the hash_fn object of the container object, r_eq_fn
+ // will be copied by the eq_fn object of the container object,
+ // r_comb_probe_fn will be copied by the comb_probe_fn object of
+ // the container object, and r_probe_fn will be copied by the
+ // probe_fn object of the container object.
+ gp_hash_table(const hash_fn& h, const eq_fn& e, const comb_probe_fn& cp,
+ const probe_fn& p)
+ : base_type(h, e, cp, p) { }
+
+ // Constructor taking some policy objects. r_hash_fn will be
+ // copied by the hash_fn object of the container object, r_eq_fn
+ // will be copied by the eq_fn object of the container object,
+ // r_comb_probe_fn will be copied by the comb_probe_fn object of
+ // the container object, r_probe_fn will be copied by the probe_fn
+ // object of the container object, and r_resize_policy will be
+ // copied by the Resize_Policy object of the container object.
+ gp_hash_table(const hash_fn& h, const eq_fn& e, const comb_probe_fn& cp,
+ const probe_fn& p, const resize_policy& rp)
+ : base_type(h, e, cp, p, rp) { }
+
+ // Constructor taking __iterators to a range of value_types. The
+ // value_types between first_it and last_it will be inserted into
+ // the container object.
+ template<typename It>
+ gp_hash_table(It first, It last)
+ { base_type::copy_from_range(first, last); }
+
+ // Constructor taking __iterators to a range of value_types and
+ // some policy objects. The value_types between first_it and
+ // last_it will be inserted into the container object. r_hash_fn
+ // will be copied by the hash_fn object of the container object.
+ template<typename It>
+ gp_hash_table(It first, It last, const hash_fn& h)
+ : base_type(h)
+ { base_type::copy_from_range(first, last); }
+
+ // Constructor taking __iterators to a range of value_types and
+ // some policy objects. The value_types between first_it and
+ // last_it will be inserted into the container object. r_hash_fn
+ // will be copied by the hash_fn object of the container object,
+ // and r_eq_fn will be copied by the eq_fn object of the container
+ // object.
+ template<typename It>
+ gp_hash_table(It first, It last, const hash_fn& h, const eq_fn& e)
+ : base_type(h, e)
+ { base_type::copy_from_range(first, last); }
+
+ // Constructor taking __iterators to a range of value_types and
+ // some policy objects. The value_types between first_it and
+ // last_it will be inserted into the container object. r_hash_fn
+ // will be copied by the hash_fn object of the container object,
+ // r_eq_fn will be copied by the eq_fn object of the container
+ // object, and r_comb_probe_fn will be copied by the comb_probe_fn
+ // object of the container object.
+ template<typename It>
+ gp_hash_table(It first, It last, const hash_fn& h, const eq_fn& e,
+ const comb_probe_fn& cp)
+ : base_type(h, e, cp)
+ { base_type::copy_from_range(first, last); }
+
+ // Constructor taking __iterators to a range of value_types and
+ // some policy objects. The value_types between first_it and
+ // last_it will be inserted into the container object. r_hash_fn
+ // will be copied by the hash_fn object of the container object,
+ // r_eq_fn will be copied by the eq_fn object of the container
+ // object, r_comb_probe_fn will be copied by the comb_probe_fn
+ // object of the container object, and r_probe_fn will be copied
+ // by the probe_fn object of the container object.
+ template<typename It>
+ gp_hash_table(It first, It last, const hash_fn& h, const eq_fn& e,
+ const comb_probe_fn& cp, const probe_fn& p)
+ : base_type(h, e, cp, p)
+ { base_type::copy_from_range(first, last); }
+
+ // Constructor taking __iterators to a range of value_types and
+ // some policy objects. The value_types between first_it and
+ // last_it will be inserted into the container object. r_hash_fn
+ // will be copied by the hash_fn object of the container object,
+ // r_eq_fn will be copied by the eq_fn object of the container
+ // object, r_comb_probe_fn will be copied by the comb_probe_fn
+ // object of the container object, r_probe_fn will be copied by
+ // the probe_fn object of the container object, and
+ // r_resize_policy will be copied by the resize_policy object of
+ // the container object.
+ template<typename It>
+ gp_hash_table(It first, It last, const hash_fn& h, const eq_fn& e,
+ const comb_probe_fn& cp, const probe_fn& p,
+ const resize_policy& rp)
+ : base_type(h, e, cp, p, rp)
+ { base_type::copy_from_range(first, last); }
+
+ gp_hash_table(const gp_hash_table& other)
+ : base_type((const base_type&)other)
+ { }
+
+ virtual
+ ~gp_hash_table() { }
+
+ gp_hash_table&
+ operator=(const gp_hash_table& other)
+ {
+ if (this != &other)
+ {
+ gp_hash_table tmp(other);
+ swap(tmp);
+ }
+ return *this;
+ }
+
+ void
+ swap(gp_hash_table& other)
+ { base_type::swap(other); }
+ };
+
+#undef PB_DS_BASE_C_DEC
+
+
+#define PB_DS_BASE_C_DEC \
+ container_base<Key, Mapped, Tag, Policy_Tl, Allocator>
+
+ // An abstract basic tree-like (tree, trie) associative container.
+ template<typename Key, typename Mapped, typename Tag,
+ typename Node_Update, typename Policy_Tl, typename Allocator>
+ class basic_tree : public PB_DS_BASE_C_DEC
+ {
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ public:
+ typedef Node_Update node_update;
+
+ virtual
+ ~basic_tree() { }
+
+ protected:
+#define PB_DS_CLASS_NAME basic_tree
+#include <ext/pb_ds/detail/constructors_destructor_fn_imps.hpp>
+#undef PB_DS_CLASS_NAME
+ };
+
+#undef PB_DS_BASE_C_DEC
+
+
+#define PB_DS_TREE_NODE_AND_IT_TRAITS_C_DEC \
+ detail::tree_traits<Key, Mapped,Cmp_Fn,Node_Update,Tag, Allocator>
+
+#define PB_DS_BASE_C_DEC \
+ basic_tree<Key,Mapped,Tag,typename PB_DS_TREE_NODE_AND_IT_TRAITS_C_DEC::node_update, \
+ typename __gnu_cxx::typelist::create2<Cmp_Fn, PB_DS_TREE_NODE_AND_IT_TRAITS_C_DEC >::type, Allocator>
+
+ // A concrete basic tree-based associative container.
+ template<typename Key, typename Mapped, typename Cmp_Fn = std::less<Key>,
+ typename Tag = rb_tree_tag,
+ template<typename Const_Node_Iterator, typename Node_Iterator, typename Cmp_Fn_, typename Allocator_>
+ class Node_Update = __gnu_pbds::null_tree_node_update,
+ typename Allocator = std::allocator<char> >
+ class tree : public PB_DS_BASE_C_DEC
+ {
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ public:
+ // Comparison functor type.
+ typedef Cmp_Fn cmp_fn;
+
+ tree() { }
+
+ // Constructor taking some policy objects. r_cmp_fn will be copied
+ // by the Cmp_Fn object of the container object.
+ tree(const cmp_fn& c)
+ : base_type(c) { }
+
+ // Constructor taking __iterators to a range of value_types. The
+ // value_types between first_it and last_it will be inserted into
+ // the container object.
+ template<typename It>
+ tree(It first, It last)
+ { base_type::copy_from_range(first, last); }
+
+ // Constructor taking __iterators to a range of value_types and
+ // some policy objects The value_types between first_it and
+ // last_it will be inserted into the container object. r_cmp_fn
+ // will be copied by the cmp_fn object of the container object.
+ template<typename It>
+ tree(It first, It last, const cmp_fn& c)
+ : base_type(c)
+ { base_type::copy_from_range(first, last); }
+
+ tree(const tree& other)
+ : base_type((const base_type&)other) { }
+
+ virtual
+ ~tree() { }
+
+ tree&
+ operator=(const tree& other)
+ {
+ if (this != &other)
+ {
+ tree tmp(other);
+ swap(tmp);
+ }
+ return *this;
+ }
+
+ void
+ swap(tree& other)
+ { base_type::swap(other); }
+ };
+
+#undef PB_DS_BASE_C_DEC
+#undef PB_DS_TREE_NODE_AND_IT_TRAITS_C_DEC
+
+
+#define PB_DS_TRIE_NODE_AND_ITS_TRAITS \
+ detail::trie_traits<Key,Mapped,E_Access_Traits,Node_Update,Tag,Allocator>
+
+#define PB_DS_BASE_C_DEC \
+ basic_tree<Key,Mapped,Tag, typename PB_DS_TRIE_NODE_AND_ITS_TRAITS::node_update, \
+ typename __gnu_cxx::typelist::create2<E_Access_Traits, PB_DS_TRIE_NODE_AND_ITS_TRAITS >::type, Allocator>
+
+ // A concrete basic trie-based associative container.
+ template<typename Key,
+ typename Mapped,
+ typename E_Access_Traits = typename detail::default_trie_e_access_traits<Key>::type,
+ typename Tag = pat_trie_tag,
+ template<typename Const_Node_Iterator,
+ typename Node_Iterator,
+ typename E_Access_Traits_,
+ typename Allocator_>
+ class Node_Update = null_trie_node_update,
+ typename Allocator = std::allocator<char> >
+ class trie : public PB_DS_BASE_C_DEC
+ {
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ public:
+ // Element access traits type.
+ typedef E_Access_Traits e_access_traits;
+
+ trie() { }
+
+ // Constructor taking some policy objects. r_e_access_traits will
+ // be copied by the E_Access_Traits object of the container
+ // object.
+ trie(const e_access_traits& t)
+ : base_type(t) { }
+
+ // Constructor taking __iterators to a range of value_types. The
+ // value_types between first_it and last_it will be inserted into
+ // the container object.
+ template<typename It>
+ trie(It first, It last)
+ { base_type::copy_from_range(first, last); }
+
+ // Constructor taking __iterators to a range of value_types and
+ // some policy objects. The value_types between first_it and
+ // last_it will be inserted into the container object.
+ template<typename It>
+ trie(It first, It last, const e_access_traits& t)
+ : base_type(t)
+ { base_type::copy_from_range(first, last); }
+
+ trie(const trie& other)
+ : base_type((const base_type&)other) { }
+
+ virtual
+ ~trie() { }
+
+ trie&
+ operator=(const trie& other)
+ {
+ if (this != &other)
+ {
+ trie tmp(other);
+ swap(tmp);
+ }
+ return *this;
+ }
+
+ void
+ swap(trie& other)
+ { base_type::swap(other); }
+ };
+
+#undef PB_DS_BASE_C_DEC
+#undef PB_DS_TRIE_NODE_AND_ITS_TRAITS
+
+
+#define PB_DS_BASE_C_DEC \
+ container_base<Key, Mapped, list_update_tag, \
+ typename __gnu_cxx::typelist::create2<Eq_Fn, Update_Policy>::type, Allocator>
+
+ // A list-update based associative container.
+ template<typename Key,
+ typename Mapped,
+ class Eq_Fn = typename detail::default_eq_fn<Key>::type,
+ class Update_Policy = detail::default_update_policy::type,
+ class Allocator = std::allocator<char> >
+ class list_update : public PB_DS_BASE_C_DEC
+ {
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ public:
+ typedef Eq_Fn eq_fn;
+ typedef Update_Policy update_policy;
+ typedef Allocator allocator;
+
+ list_update() { }
+
+ // Constructor taking __iterators to a range of value_types. The
+ // value_types between first_it and last_it will be inserted into
+ // the container object.
+ template<typename It>
+ list_update(It first, It last)
+ { base_type::copy_from_range(first, last); }
+
+ list_update(const list_update& other)
+ : base_type((const base_type&)other) { }
+
+ virtual
+ ~list_update() { }
+
+ list_update&
+ operator=(const list_update& other)
+ {
+ if (this !=& other)
+ {
+ list_update tmp(other);
+ swap(tmp);
+ }
+ return *this;
+ }
+
+ void
+ swap(list_update& other)
+ { base_type::swap(other); }
+ };
+
+#undef PB_DS_BASE_C_DEC
+
+} // namespace __gnu_pbds
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/basic_tree_policy/basic_tree_policy_base.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/basic_tree_policy/basic_tree_policy_base.hpp
new file mode 100644
index 0000000..0ca90db
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/basic_tree_policy/basic_tree_policy_base.hpp
@@ -0,0 +1,173 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file basic_tree_policy_base.hpp
+ * Contains a base class for tree_like policies.
+ */
+
+#ifndef PB_DS_TREE_LIKE_POLICY_BASE_HPP
+#define PB_DS_TREE_LIKE_POLICY_BASE_HPP
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_CLASS_C_DEC \
+ basic_tree_policy_base< \
+ Const_Node_Iterator, \
+ Node_Iterator, \
+ Allocator>
+
+ template<typename Const_Node_Iterator,
+ typename Node_Iterator,
+ typename Allocator>
+ struct basic_tree_policy_base
+ {
+ protected:
+ typedef typename Node_Iterator::value_type it_type;
+
+ typedef typename std::iterator_traits< it_type>::value_type value_type;
+
+ typedef typename value_type::first_type key_type;
+
+ typedef
+ typename Allocator::template rebind<
+ typename remove_const<
+ key_type>::type>::other::const_reference
+ const_key_reference;
+
+ typedef
+ typename Allocator::template rebind<
+ typename remove_const<
+ value_type>::type>::other::const_reference
+ const_reference;
+
+ typedef
+ typename Allocator::template rebind<
+ typename remove_const<
+ value_type>::type>::other::reference
+ reference;
+
+ typedef
+ typename Allocator::template rebind<
+ typename remove_const<
+ value_type>::type>::other::const_pointer
+ const_pointer;
+
+ static inline const_key_reference
+ extract_key(const_reference r_val)
+ {
+ return (r_val.first);
+ }
+
+ virtual it_type
+ end() = 0;
+
+ it_type
+ end_iterator() const
+ {
+ return (const_cast<PB_DS_CLASS_C_DEC* >(this)->end());
+ }
+
+ virtual
+ ~basic_tree_policy_base()
+ { }
+ };
+
+ template<typename Const_Node_Iterator, typename Allocator>
+ struct basic_tree_policy_base<
+ Const_Node_Iterator,
+ Const_Node_Iterator,
+ Allocator>
+ {
+ protected:
+ typedef typename Const_Node_Iterator::value_type it_type;
+
+ typedef typename std::iterator_traits< it_type>::value_type value_type;
+
+ typedef value_type key_type;
+
+ typedef
+ typename Allocator::template rebind<
+ typename remove_const<
+ key_type>::type>::other::const_reference
+ const_key_reference;
+
+ typedef
+ typename Allocator::template rebind<
+ typename remove_const<
+ value_type>::type>::other::const_reference
+ const_reference;
+
+ typedef
+ typename Allocator::template rebind<
+ typename remove_const<
+ value_type>::type>::other::reference
+ reference;
+
+ typedef
+ typename Allocator::template rebind<
+ typename remove_const<
+ value_type>::type>::other::const_pointer
+ const_pointer;
+
+ static inline const_key_reference
+ extract_key(const_reference r_val)
+ {
+ return (r_val);
+ }
+
+ virtual it_type
+ end() const = 0;
+
+ it_type
+ end_iterator() const
+ {
+ return (end());
+ }
+
+ virtual
+ ~basic_tree_policy_base()
+ { }
+ };
+
+#undef PB_DS_CLASS_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_TREE_LIKE_POLICY_BASE_HPP
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/basic_tree_policy/null_node_metadata.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/basic_tree_policy/null_node_metadata.hpp
new file mode 100644
index 0000000..757b909
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/basic_tree_policy/null_node_metadata.hpp
@@ -0,0 +1,67 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file null_node_metadata.hpp
+ * Contains an implementation class for tree-like classes.
+ */
+
+#ifndef PB_DS_NULL_NODE_METADATA_HPP
+#define PB_DS_NULL_NODE_METADATA_HPP
+
+#include <ext/pb_ds/detail/types_traits.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ template<typename Key, class Data, class Allocator>
+ struct dumconst_node_iterator
+ {
+ private:
+ typedef typename types_traits<Key, Data, Allocator, false>::pointer const_iterator;
+
+ public:
+ typedef const_iterator value_type;
+ typedef const_iterator const_reference;
+ typedef const_reference reference;
+ };
+
+ struct null_node_metadata
+ { };
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/basic_tree_policy/traits.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/basic_tree_policy/traits.hpp
new file mode 100644
index 0000000..b30829a
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/basic_tree_policy/traits.hpp
@@ -0,0 +1,85 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file traits.hpp
+ * Contains an implementation class for tree-like classes.
+ */
+
+#ifndef PB_DS_NODE_AND_IT_TRAITS_HPP
+#define PB_DS_NODE_AND_IT_TRAITS_HPP
+
+#include <ext/pb_ds/detail/types_traits.hpp>
+#include <ext/pb_ds/detail/bin_search_tree_/traits.hpp>
+#include <ext/pb_ds/detail/tree_policy/node_metadata_selector.hpp>
+#include <ext/pb_ds/detail/trie_policy/node_metadata_selector.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ template<typename Key,
+ typename Data,
+ class Cmp_Fn,
+ template<typename Const_Node_Iterator,
+ class Node_Iterator,
+ class Cmp_Fn_,
+ class Allocator>
+ class Node_Update,
+ class Tag,
+ class Allocator>
+ struct tree_traits;
+
+ template<typename Key,
+ typename Data,
+ class E_Access_Traits,
+ template<typename Const_Node_Iterator,
+ class Node_Iterator,
+ class E_Access_Traits_,
+ class Allocator>
+ class Node_Update,
+ class Tag,
+ class Allocator>
+ struct trie_traits;
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#include <ext/pb_ds/detail/rb_tree_map_/traits.hpp>
+#include <ext/pb_ds/detail/splay_tree_/traits.hpp>
+#include <ext/pb_ds/detail/ov_tree_map_/traits.hpp>
+#include <ext/pb_ds/detail/pat_trie_/traits.hpp>
+
+#endif // #ifndef PB_DS_NODE_AND_IT_TRAITS_HPP
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/basic_types.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/basic_types.hpp
new file mode 100644
index 0000000..aac1397
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/basic_types.hpp
@@ -0,0 +1,211 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file basic_types.hpp
+ * Contains basic types used by containers.
+ */
+
+#ifndef PB_DS_BASIC_TYPES_HPP
+#define PB_DS_BASIC_TYPES_HPP
+
+#include <algorithm>
+#include <utility>
+#include <ext/pb_ds/tag_and_trait.hpp>
+#include <ext/pb_ds/detail/type_utils.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ template<typename Key, typename Mapped, typename Allocator, bool Store_Hash>
+ struct value_type_base;
+
+ /**
+ * Specialization of value_type_base for the case where the hash value
+ * is not stored alongside each value.
+ **/
+ template<typename Key, typename Mapped, typename Allocator>
+ struct value_type_base<Key, Mapped, Allocator, false>
+ {
+ typedef typename Allocator::template rebind<Mapped>::other mapped_type_allocator;
+ typedef typename mapped_type_allocator::value_type mapped_type;
+ typedef typename mapped_type_allocator::pointer mapped_pointer;
+ typedef typename mapped_type_allocator::const_pointer const_mapped_pointer;
+ typedef typename mapped_type_allocator::reference mapped_reference;
+ typedef typename mapped_type_allocator::const_reference const_mapped_reference;
+
+ typedef typename Allocator::template rebind<std::pair<const Key, Mapped> >::other value_type_allocator;
+ typedef typename value_type_allocator::value_type value_type;
+ typedef typename value_type_allocator::pointer pointer;
+ typedef typename value_type_allocator::const_pointer const_pointer;
+ typedef typename value_type_allocator::reference reference;
+ typedef typename value_type_allocator::const_reference const_reference;
+
+ struct stored_value_type
+ {
+ value_type m_value;
+ };
+ };
+
+ /**
+ * Specialization of value_type_base for the case where the hash value
+ * is stored alongside each value.
+ **/
+ template<typename Key, typename Mapped, typename Allocator>
+ struct value_type_base<Key, Mapped, Allocator, true>
+ {
+ typedef typename Allocator::template rebind<Mapped>::other mapped_type_allocator;
+ typedef typename mapped_type_allocator::value_type mapped_type;
+ typedef typename mapped_type_allocator::pointer mapped_pointer;
+ typedef typename mapped_type_allocator::const_pointer const_mapped_pointer;
+ typedef typename mapped_type_allocator::reference mapped_reference;
+ typedef typename mapped_type_allocator::const_reference const_mapped_reference;
+
+ typedef typename Allocator::template rebind<std::pair<const Key, Mapped> >::other value_type_allocator;
+ typedef typename value_type_allocator::value_type value_type;
+ typedef typename value_type_allocator::pointer pointer;
+ typedef typename value_type_allocator::const_pointer const_pointer;
+ typedef typename value_type_allocator::reference reference;
+ typedef typename value_type_allocator::const_reference const_reference;
+
+ struct stored_value_type
+ {
+ value_type m_value;
+ typename Allocator::size_type m_hash;
+ };
+ };
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, typename Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ value_type_base<Key, null_mapped_type, Allocator, false>
+
+ /**
+ * Specialization of value_type_base for the case where the hash value
+ * is not stored alongside each value.
+ **/
+ template<typename Key, typename Allocator>
+ struct value_type_base<Key, null_mapped_type, Allocator, false>
+ {
+ typedef typename Allocator::template rebind<null_mapped_type>::other mapped_type_allocator;
+ typedef typename mapped_type_allocator::value_type mapped_type;
+ typedef typename mapped_type_allocator::pointer mapped_pointer;
+ typedef typename mapped_type_allocator::const_pointer const_mapped_pointer;
+ typedef typename mapped_type_allocator::reference mapped_reference;
+ typedef typename mapped_type_allocator::const_reference const_mapped_reference;
+
+ typedef Key value_type;
+
+ typedef typename Allocator::template rebind<value_type>::other value_type_allocator;
+ typedef typename value_type_allocator::pointer pointer;
+ typedef typename value_type_allocator::const_pointer const_pointer;
+ typedef typename value_type_allocator::reference reference;
+ typedef typename value_type_allocator::const_reference const_reference;
+
+ struct stored_value_type
+ {
+ value_type m_value;
+ };
+
+ static null_mapped_type s_null_mapped;
+ };
+
+ PB_DS_CLASS_T_DEC
+ null_mapped_type PB_DS_CLASS_C_DEC::s_null_mapped;
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, typename Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ value_type_base<Key, null_mapped_type, Allocator, true>
+
+ /**
+ * Specialization of value_type_base for the case where the hash value
+ * is stored alongside each value.
+ **/
+ template<typename Key, typename Allocator>
+ struct value_type_base<Key, null_mapped_type, Allocator, true>
+ {
+ typedef typename Allocator::template rebind<null_mapped_type>::other mapped_type_allocator;
+ typedef typename mapped_type_allocator::value_type mapped_type;
+ typedef typename mapped_type_allocator::pointer mapped_pointer;
+ typedef typename mapped_type_allocator::const_pointer const_mapped_pointer;
+ typedef typename mapped_type_allocator::reference mapped_reference;
+ typedef typename mapped_type_allocator::const_reference const_mapped_reference;
+
+ typedef Key value_type;
+
+ typedef typename Allocator::template rebind<value_type>::other value_type_allocator;
+ typedef typename value_type_allocator::pointer pointer;
+ typedef typename value_type_allocator::const_pointer const_pointer;
+ typedef typename value_type_allocator::reference reference;
+ typedef typename value_type_allocator::const_reference const_reference;
+
+ struct stored_value_type
+ {
+ value_type m_value;
+ typename Allocator::size_type m_hash;
+ };
+
+ static null_mapped_type s_null_mapped;
+ };
+
+ PB_DS_CLASS_T_DEC
+ null_mapped_type PB_DS_CLASS_C_DEC::s_null_mapped;
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+ template<typename Key, typename Mapped>
+ struct no_throw_copies
+ {
+ typedef integral_constant<int, is_simple<Key>::value && is_simple<Mapped>::value> indicator;
+ };
+
+ template<typename Key>
+ struct no_throw_copies<Key, null_mapped_type>
+ {
+ typedef integral_constant<int, is_simple<Key>::value> indicator;
+ };
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/bin_search_tree_.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/bin_search_tree_.hpp
new file mode 100644
index 0000000..7315d95
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/bin_search_tree_.hpp
@@ -0,0 +1,497 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file bin_search_tree_.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+/*
+ * This implementation uses an idea from the SGI STL (using a "header" node
+ * which is needed for efficient iteration).
+ */
+
+#include <ext/pb_ds/exception.hpp>
+#include <ext/pb_ds/detail/eq_fn/eq_by_less.hpp>
+#include <ext/pb_ds/detail/types_traits.hpp>
+#include <ext/pb_ds/detail/debug_map_base.hpp>
+#include <ext/pb_ds/tree_policy.hpp>
+#include <ext/pb_ds/detail/cond_dealtor.hpp>
+#include <ext/pb_ds/detail/type_utils.hpp>
+#include <ext/pb_ds/detail/tree_trace_base.hpp>
+#include <utility>
+#include <functional>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, typename Mapped, class Cmp_Fn, \
+ class Node_And_It_Traits, class Allocator>
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_CLASS_NAME \
+ bin_search_tree_data_
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#define PB_DS_CLASS_NAME \
+ bin_search_tree_no_data_
+#endif
+
+#define PB_DS_CLASS_C_DEC \
+ PB_DS_CLASS_NAME< \
+ Key, \
+ Mapped, \
+ Cmp_Fn, \
+ Node_And_It_Traits, \
+ Allocator>
+
+#define PB_DS_TYPES_TRAITS_C_DEC \
+ types_traits< \
+ Key, \
+ Mapped, \
+ Allocator, \
+ false>
+
+#ifdef _GLIBCXX_DEBUG
+#define PB_DS_DEBUG_MAP_BASE_C_DEC \
+ debug_map_base<Key, eq_by_less<Key, Cmp_Fn>, \
+ typename Allocator::template rebind<Key>::other::const_reference>
+#endif
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_V2F(X) (X).first
+#define PB_DS_V2S(X) (X).second
+#define PB_DS_EP2VP(X)& ((X)->m_value)
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#define PB_DS_V2F(X) (X)
+#define PB_DS_V2S(X) Mapped_Data()
+#define PB_DS_EP2VP(X)& ((X)->m_value.first)
+#endif
+
+#ifdef PB_DS_TREE_TRACE
+#define PB_DS_TREE_TRACE_BASE_C_DEC \
+ tree_trace_base< \
+ typename Node_And_It_Traits::const_node_iterator, \
+ typename Node_And_It_Traits::node_iterator, \
+ Cmp_Fn, \
+ true, \
+ Allocator>
+#endif
+
+ /**
+ * class description = "8i|\|4ree $34rc|-| 7r33 74813.">
+ **/
+ template<typename Key,
+ typename Mapped,
+ class Cmp_Fn,
+ class Node_And_It_Traits,
+ class Allocator>
+ class PB_DS_CLASS_NAME :
+#ifdef _GLIBCXX_DEBUG
+ public PB_DS_DEBUG_MAP_BASE_C_DEC,
+#endif
+#ifdef PB_DS_TREE_TRACE
+ public PB_DS_TREE_TRACE_BASE_C_DEC,
+#endif
+ public Cmp_Fn,
+ public PB_DS_TYPES_TRAITS_C_DEC,
+ public Node_And_It_Traits::node_update
+ {
+
+ protected:
+ typedef
+ typename Allocator::template rebind<
+ typename Node_And_It_Traits::node>::other
+ node_allocator;
+
+ typedef typename node_allocator::value_type node;
+
+ typedef typename node_allocator::pointer node_pointer;
+
+ typedef PB_DS_TYPES_TRAITS_C_DEC traits_base;
+
+ typedef
+ typename Node_And_It_Traits::null_node_update_pointer
+ null_node_update_pointer;
+
+ private:
+ typedef cond_dealtor< node, Allocator> cond_dealtor_t;
+
+#ifdef _GLIBCXX_DEBUG
+ typedef PB_DS_DEBUG_MAP_BASE_C_DEC debug_base;
+#endif
+
+ public:
+
+ typedef typename Allocator::size_type size_type;
+
+ typedef typename Allocator::difference_type difference_type;
+
+ typedef typename PB_DS_TYPES_TRAITS_C_DEC::key_type key_type;
+
+ typedef typename PB_DS_TYPES_TRAITS_C_DEC::key_pointer key_pointer;
+
+ typedef
+ typename PB_DS_TYPES_TRAITS_C_DEC::const_key_pointer
+ const_key_pointer;
+
+ typedef typename PB_DS_TYPES_TRAITS_C_DEC::key_reference key_reference;
+
+ typedef
+ typename PB_DS_TYPES_TRAITS_C_DEC::const_key_reference
+ const_key_reference;
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ typedef typename PB_DS_TYPES_TRAITS_C_DEC::mapped_type mapped_type;
+
+ typedef
+ typename PB_DS_TYPES_TRAITS_C_DEC::mapped_pointer
+ mapped_pointer;
+
+ typedef
+ typename PB_DS_TYPES_TRAITS_C_DEC::const_mapped_pointer
+ const_mapped_pointer;
+
+ typedef
+ typename PB_DS_TYPES_TRAITS_C_DEC::mapped_reference
+ mapped_reference;
+
+ typedef
+ typename PB_DS_TYPES_TRAITS_C_DEC::const_mapped_reference
+ const_mapped_reference;
+#endif
+
+ typedef typename PB_DS_TYPES_TRAITS_C_DEC::value_type value_type;
+
+ typedef typename PB_DS_TYPES_TRAITS_C_DEC::pointer pointer;
+
+ typedef typename PB_DS_TYPES_TRAITS_C_DEC::const_pointer const_pointer;
+
+ typedef typename PB_DS_TYPES_TRAITS_C_DEC::reference reference;
+
+ typedef
+ typename PB_DS_TYPES_TRAITS_C_DEC::const_reference
+ const_reference;
+
+ typedef
+ typename Node_And_It_Traits::const_point_iterator
+ const_point_iterator;
+
+ typedef const_point_iterator const_iterator;
+
+ typedef typename Node_And_It_Traits::point_iterator point_iterator;
+
+ typedef point_iterator iterator;
+
+ typedef
+ typename Node_And_It_Traits::const_reverse_iterator
+ const_reverse_iterator;
+
+ typedef typename Node_And_It_Traits::reverse_iterator reverse_iterator;
+
+ typedef
+ typename Node_And_It_Traits::const_node_iterator
+ const_node_iterator;
+
+ typedef typename Node_And_It_Traits::node_iterator node_iterator;
+
+ typedef Cmp_Fn cmp_fn;
+
+ typedef Allocator allocator_type;
+
+ typedef typename Node_And_It_Traits::node_update node_update;
+
+ public:
+
+ PB_DS_CLASS_NAME();
+
+ PB_DS_CLASS_NAME(const Cmp_Fn& r_cmp_fn);
+
+ PB_DS_CLASS_NAME(const Cmp_Fn& r_cmp_fn, const node_update& r_update);
+
+ PB_DS_CLASS_NAME(const PB_DS_CLASS_C_DEC& other);
+
+ void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ ~PB_DS_CLASS_NAME();
+
+ inline bool
+ empty() const;
+
+ inline size_type
+ size() const;
+
+ inline size_type
+ max_size() const;
+
+ Cmp_Fn&
+ get_cmp_fn();
+
+ const Cmp_Fn&
+ get_cmp_fn() const;
+
+ inline point_iterator
+ lower_bound(const_key_reference r_key);
+
+ inline const_point_iterator
+ lower_bound(const_key_reference r_key) const;
+
+ inline point_iterator
+ upper_bound(const_key_reference r_key);
+
+ inline const_point_iterator
+ upper_bound(const_key_reference r_key) const;
+
+ inline point_iterator
+ find(const_key_reference r_key);
+
+ inline const_point_iterator
+ find(const_key_reference r_key) const;
+
+ inline iterator
+ begin();
+
+ inline const_iterator
+ begin() const;
+
+ inline iterator
+ end();
+
+ inline const_iterator
+ end() const;
+
+ inline reverse_iterator
+ rbegin();
+
+ inline const_reverse_iterator
+ rbegin() const;
+
+ inline reverse_iterator
+ rend();
+
+ inline const_reverse_iterator
+ rend() const;
+
+ inline const_node_iterator
+ node_begin() const;
+
+ inline node_iterator
+ node_begin();
+
+ inline const_node_iterator
+ node_end() const;
+
+ inline node_iterator
+ node_end();
+
+ void
+ clear();
+
+ protected:
+
+ void
+ value_swap(PB_DS_CLASS_C_DEC& other);
+
+ void
+ initialize_min_max();
+
+ inline iterator
+ insert_imp_empty(const_reference r_value);
+
+ inline iterator
+ insert_leaf_new(const_reference r_value, node_pointer p_nd, bool left_nd);
+
+ inline node_pointer
+ get_new_node_for_leaf_insert(const_reference r_val, false_type);
+
+ inline node_pointer
+ get_new_node_for_leaf_insert(const_reference r_val, true_type);
+
+ inline void
+ actual_erase_node(node_pointer p_nd);
+
+ inline std::pair<node_pointer, bool>
+ erase(node_pointer p_nd);
+
+ inline void
+ update_min_max_for_erased_node(node_pointer p_nd);
+
+ static void
+ clear_imp(node_pointer p_nd);
+
+ inline std::pair<
+ point_iterator,
+ bool>
+ insert_leaf(const_reference r_value);
+
+ inline void
+ rotate_left(node_pointer p_x);
+
+ inline void
+ rotate_right(node_pointer p_y);
+
+ inline void
+ rotate_parent(node_pointer p_nd);
+
+ inline void
+ apply_update(node_pointer p_nd, null_node_update_pointer);
+
+ template<typename Node_Update_>
+ inline void
+ apply_update(node_pointer p_nd, Node_Update_* p_update);
+
+ inline void
+ update_to_top(node_pointer p_nd, null_node_update_pointer);
+
+ template<typename Node_Update_>
+ inline void
+ update_to_top(node_pointer p_nd, Node_Update_* p_update);
+
+ bool
+ join_prep(PB_DS_CLASS_C_DEC& other);
+
+ void
+ join_finish(PB_DS_CLASS_C_DEC& other);
+
+ bool
+ split_prep(const_key_reference r_key, PB_DS_CLASS_C_DEC& other);
+
+ void
+ split_finish(PB_DS_CLASS_C_DEC& other);
+
+ size_type
+ recursive_count(node_pointer p_nd) const;
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid() const;
+
+ void
+ structure_only_assert_valid() const;
+
+ void
+ assert_node_consistent(const node_pointer p_nd) const;
+#endif
+
+ private:
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_iterators() const;
+
+ void
+ assert_consistent_with_debug_base() const;
+
+ void
+ assert_node_consistent_with_left(const node_pointer p_nd) const;
+
+ void
+ assert_node_consistent_with_right(const node_pointer p_nd) const;
+
+ void
+ assert_consistent_with_debug_base(const node_pointer p_nd) const;
+
+ void
+ assert_min() const;
+
+ void
+ assert_min_imp(const node_pointer p_nd) const;
+
+ void
+ assert_max() const;
+
+ void
+ assert_max_imp(const node_pointer p_nd) const;
+
+ void
+ assert_size() const;
+
+ typedef std::pair< const_pointer, const_pointer> node_consistent_t;
+
+ node_consistent_t
+ assert_node_consistent_(const node_pointer p_nd) const;
+#endif
+
+ void
+ initialize();
+
+ node_pointer
+ recursive_copy_node(const node_pointer p_nd);
+
+ protected:
+ node_pointer m_p_head;
+
+ size_type m_size;
+
+ static node_allocator s_node_allocator;
+ };
+
+#include <ext/pb_ds/detail/bin_search_tree_/constructors_destructor_fn_imps.hpp>
+#include <ext/pb_ds/detail/bin_search_tree_/iterators_fn_imps.hpp>
+#include <ext/pb_ds/detail/bin_search_tree_/debug_fn_imps.hpp>
+#include <ext/pb_ds/detail/bin_search_tree_/insert_fn_imps.hpp>
+#include <ext/pb_ds/detail/bin_search_tree_/erase_fn_imps.hpp>
+#include <ext/pb_ds/detail/bin_search_tree_/find_fn_imps.hpp>
+#include <ext/pb_ds/detail/bin_search_tree_/info_fn_imps.hpp>
+#include <ext/pb_ds/detail/bin_search_tree_/split_join_fn_imps.hpp>
+#include <ext/pb_ds/detail/bin_search_tree_/rotate_fn_imps.hpp>
+#include <ext/pb_ds/detail/bin_search_tree_/policy_access_fn_imps.hpp>
+
+#undef PB_DS_CLASS_C_DEC
+
+#undef PB_DS_CLASS_T_DEC
+
+#undef PB_DS_CLASS_NAME
+
+#undef PB_DS_TYPES_TRAITS_C_DEC
+
+#undef PB_DS_DEBUG_MAP_BASE_C_DEC
+
+#ifdef PB_DS_TREE_TRACE
+#undef PB_DS_TREE_TRACE_BASE_C_DEC
+#endif
+
+#undef PB_DS_V2F
+#undef PB_DS_EP2VP
+#undef PB_DS_V2S
+
+ } // namespace detail
+} // namespace __gnu_pbds
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/cond_dtor_entry_dealtor.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/cond_dtor_entry_dealtor.hpp
new file mode 100644
index 0000000..370574c
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/cond_dtor_entry_dealtor.hpp
@@ -0,0 +1,70 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file cond_dtor_entry_dealtor.hpp
+ * Contains a binary tree container conditional deallocator
+ */
+
+class bin_search_tree_cond_dtor_entry_dealtor_
+{
+public:
+ inline
+ bin_search_tree_cond_dtor_entry_dealtor_(node_pointer p_nd) : m_p_nd(p_nd),
+ m_no_action_dtor(false)
+ { }
+
+ inline void
+ set_no_action_dtor()
+ {
+ m_no_action_dtor = true;
+ }
+
+ inline
+ ~bin_search_tree_cond_dtor_entry_dealtor_()
+ {
+ if (m_no_action_dtor)
+ return;
+
+ typename Allocator::template rebind<Node>::other().
+ deallocate(m_p_nd, 1);
+ }
+
+protected:
+ node_pointer m_p_nd;
+
+ bool m_no_action_dtor;
+};
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/cond_key_dtor_entry_dealtor.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/cond_key_dtor_entry_dealtor.hpp
new file mode 100644
index 0000000..612eceb
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/cond_key_dtor_entry_dealtor.hpp
@@ -0,0 +1,81 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file cond_key_dtor_entry_dealtor.hpp
+ * Contains a binary tree container conditional deallocator
+ */
+
+class bin_seach_tree_cond_key_dtor_entry_dealtor_
+{
+public:
+ inline
+ bin_seach_tree_cond_key_dtor_entry_dealtor_(node_pointer p_nd) : m_p_nd(p_nd),
+ m_no_action_dtor(false),
+ m_key_destruct(false)
+ { }
+
+ inline void
+ set_no_action_dtor()
+ {
+ m_no_action_dtor = true;
+ }
+
+ inline void
+ set_key_destruct()
+ {
+ m_key_destruct = true;
+ }
+
+ inline
+ ~bin_seach_tree_cond_key_dtor_entry_dealtor_()
+ {
+ if (m_no_action_dtor)
+ return;
+
+ if (m_key_destruct)
+ m_p_nd->m_value.first.~Key();
+
+ bin_tree_base::s_alloc.deallocate(m_p_nd, 1);
+ }
+
+protected:
+ node_pointer m_p_nd;
+
+ bool m_no_action_dtor;
+
+ bool m_key_destruct;
+};
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/constructors_destructor_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/constructors_destructor_fn_imps.hpp
new file mode 100644
index 0000000..925d204
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/constructors_destructor_fn_imps.hpp
@@ -0,0 +1,218 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructors_destructor_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::node_allocator
+PB_DS_CLASS_C_DEC::s_node_allocator;
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME() : m_p_head(s_node_allocator.allocate(1)), m_size(0)
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(structure_only_assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const Cmp_Fn& r_cmp_fn) :
+ Cmp_Fn(r_cmp_fn), m_p_head(s_node_allocator.allocate(1)), m_size(0)
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(structure_only_assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const Cmp_Fn& r_cmp_fn, const node_update& r_node_update) :
+ Cmp_Fn(r_cmp_fn),
+ node_update(r_node_update),
+ m_p_head(s_node_allocator.allocate(1)),
+ m_size(0)
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(structure_only_assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const PB_DS_CLASS_C_DEC& other) :
+#ifdef _GLIBCXX_DEBUG
+ debug_base(other),
+#endif
+#ifdef PB_DS_TREE_TRACE
+ PB_DS_TREE_TRACE_BASE_C_DEC(other),
+#endif
+ Cmp_Fn(other),
+ node_update(other),
+ m_p_head(s_node_allocator.allocate(1)),
+ m_size(0)
+{
+ initialize();
+ m_size = other.m_size;
+ _GLIBCXX_DEBUG_ONLY(other.structure_only_assert_valid();)
+
+ __try
+ {
+ m_p_head->m_p_parent = recursive_copy_node(other.m_p_head->m_p_parent);
+ if (m_p_head->m_p_parent != NULL)
+ m_p_head->m_p_parent->m_p_parent = m_p_head;
+ m_size = other.m_size;
+ initialize_min_max();
+ }
+ __catch(...)
+ {
+ _GLIBCXX_DEBUG_ONLY(debug_base::clear();)
+ s_node_allocator.deallocate(m_p_head, 1);
+ __throw_exception_again;
+ }
+ _GLIBCXX_DEBUG_ONLY(structure_only_assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(structure_only_assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.structure_only_assert_valid();)
+ value_swap(other);
+ std::swap((Cmp_Fn& )(*this), (Cmp_Fn& )other);
+ _GLIBCXX_DEBUG_ONLY(structure_only_assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.structure_only_assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+value_swap(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(debug_base::swap(other);)
+ std::swap(m_p_head, other.m_p_head);
+ std::swap(m_size, other.m_size);
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+~PB_DS_CLASS_NAME()
+{
+ clear();
+ s_node_allocator.deallocate(m_p_head, 1);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+initialize()
+{
+ m_p_head->m_p_parent = NULL;
+ m_p_head->m_p_left = m_p_head;
+ m_p_head->m_p_right = m_p_head;
+ m_size = 0;
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+recursive_copy_node(const node_pointer p_nd)
+{
+ if (p_nd == NULL)
+ return (NULL);
+
+ node_pointer p_ret = s_node_allocator.allocate(1);
+ __try
+ {
+ new (p_ret) node(*p_nd);
+ }
+ __catch(...)
+ {
+ s_node_allocator.deallocate(p_ret, 1);
+ __throw_exception_again;
+ }
+
+ p_ret->m_p_left = p_ret->m_p_right = NULL;
+
+ __try
+ {
+ p_ret->m_p_left = recursive_copy_node(p_nd->m_p_left);
+ p_ret->m_p_right = recursive_copy_node(p_nd->m_p_right);
+ }
+ __catch(...)
+ {
+ clear_imp(p_ret);
+ __throw_exception_again;
+ }
+
+ if (p_ret->m_p_left != NULL)
+ p_ret->m_p_left->m_p_parent = p_ret;
+
+ if (p_ret->m_p_right != NULL)
+ p_ret->m_p_right->m_p_parent = p_ret;
+
+ _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_ret);)
+ return p_ret;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+initialize_min_max()
+{
+ if (m_p_head->m_p_parent == NULL)
+ {
+ m_p_head->m_p_left = m_p_head->m_p_right = m_p_head;
+ return;
+ }
+
+ {
+ node_pointer p_min = m_p_head->m_p_parent;
+ while (p_min->m_p_left != NULL)
+ p_min = p_min->m_p_left;
+ m_p_head->m_p_left = p_min;
+ }
+
+ {
+ node_pointer p_max = m_p_head->m_p_parent;
+ while (p_max->m_p_right != NULL)
+ p_max = p_max->m_p_right;
+ m_p_head->m_p_right = p_max;
+ }
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/debug_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/debug_fn_imps.hpp
new file mode 100644
index 0000000..e3447bd
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/debug_fn_imps.hpp
@@ -0,0 +1,272 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_valid() const
+{
+ structure_only_assert_valid();
+ assert_consistent_with_debug_base();
+ assert_size();
+ assert_iterators();
+ if (m_p_head->m_p_parent == NULL)
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_size == 0);
+ }
+ else
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_size > 0);
+ }
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+structure_only_assert_valid() const
+{
+ _GLIBCXX_DEBUG_ASSERT(m_p_head != NULL);
+ if (m_p_head->m_p_parent == NULL)
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_head->m_p_left == m_p_head);
+ _GLIBCXX_DEBUG_ASSERT(m_p_head->m_p_right == m_p_head);
+ }
+ else
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_head->m_p_parent->m_p_parent == m_p_head);
+ _GLIBCXX_DEBUG_ASSERT(m_p_head->m_p_left != m_p_head);
+ _GLIBCXX_DEBUG_ASSERT(m_p_head->m_p_right != m_p_head);
+ }
+
+ if (m_p_head->m_p_parent != NULL)
+ assert_node_consistent(m_p_head->m_p_parent);
+ assert_min();
+ assert_max();
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_node_consistent(const node_pointer p_nd) const
+{
+ assert_node_consistent_(p_nd);
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::node_consistent_t
+PB_DS_CLASS_C_DEC::
+assert_node_consistent_(const node_pointer p_nd) const
+{
+ if (p_nd == NULL)
+ return (std::make_pair((const_pointer)NULL,(const_pointer)NULL));
+
+ assert_node_consistent_with_left(p_nd);
+ assert_node_consistent_with_right(p_nd);
+
+ const std::pair<const_pointer, const_pointer>
+ l_range = assert_node_consistent_(p_nd->m_p_left);
+
+ if (l_range.second != NULL)
+ _GLIBCXX_DEBUG_ASSERT(Cmp_Fn::operator()(PB_DS_V2F(*l_range.second),
+ PB_DS_V2F(p_nd->m_value)));
+
+ const std::pair<const_pointer, const_pointer>
+ r_range = assert_node_consistent_(p_nd->m_p_right);
+
+ if (r_range.first != NULL)
+ _GLIBCXX_DEBUG_ASSERT(Cmp_Fn::operator()(PB_DS_V2F(p_nd->m_value),
+ PB_DS_V2F(*r_range.first)));
+
+ return (std::make_pair((l_range.first != NULL)? l_range.first :& p_nd->m_value,(r_range.second != NULL)? r_range.second :& p_nd->m_value));
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_node_consistent_with_left(const node_pointer p_nd) const
+{
+ if (p_nd->m_p_left == NULL)
+ return;
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_left->m_p_parent == p_nd);
+ _GLIBCXX_DEBUG_ASSERT(!Cmp_Fn::operator()(PB_DS_V2F(p_nd->m_value),
+ PB_DS_V2F(p_nd->m_p_left->m_value)));
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_node_consistent_with_right(const node_pointer p_nd) const
+{
+ if (p_nd->m_p_right == NULL)
+ return;
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_right->m_p_parent == p_nd);
+ _GLIBCXX_DEBUG_ASSERT(!Cmp_Fn::operator()(PB_DS_V2F(p_nd->m_p_right->m_value),
+ PB_DS_V2F(p_nd->m_value)));
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_min() const
+{
+ assert_min_imp(m_p_head->m_p_parent);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_min_imp(const node_pointer p_nd) const
+{
+ if (p_nd == NULL)
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_head->m_p_left == m_p_head);
+ return;
+ }
+
+ if (p_nd->m_p_left == NULL)
+ {
+ _GLIBCXX_DEBUG_ASSERT(p_nd == m_p_head->m_p_left);
+ return;
+ }
+ assert_min_imp(p_nd->m_p_left);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_max() const
+{
+ assert_max_imp(m_p_head->m_p_parent);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_max_imp(const node_pointer p_nd) const
+{
+ if (p_nd == NULL)
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_head->m_p_right == m_p_head);
+ return;
+ }
+
+ if (p_nd->m_p_right == NULL)
+ {
+ _GLIBCXX_DEBUG_ASSERT(p_nd == m_p_head->m_p_right);
+ return;
+ }
+
+ assert_max_imp(p_nd->m_p_right);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_iterators() const
+{
+ size_type iterated_num = 0;
+ const_iterator prev_it = end();
+ for (const_iterator it = begin(); it != end(); ++it)
+ {
+ ++iterated_num;
+ _GLIBCXX_DEBUG_ASSERT(lower_bound(PB_DS_V2F(*it)).m_p_nd == it.m_p_nd);
+ const_iterator upper_bound_it = upper_bound(PB_DS_V2F(*it));
+ --upper_bound_it;
+ _GLIBCXX_DEBUG_ASSERT(upper_bound_it.m_p_nd == it.m_p_nd);
+
+ if (prev_it != end())
+ _GLIBCXX_DEBUG_ASSERT(Cmp_Fn::operator()(PB_DS_V2F(*prev_it),
+ PB_DS_V2F(*it)));
+ prev_it = it;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(iterated_num == m_size);
+ size_type reverse_iterated_num = 0;
+ const_reverse_iterator reverse_prev_it = rend();
+ for (const_reverse_iterator reverse_it = rbegin(); reverse_it != rend();
+ ++reverse_it)
+ {
+ ++reverse_iterated_num;
+ _GLIBCXX_DEBUG_ASSERT(lower_bound(
+ PB_DS_V2F(*reverse_it)).m_p_nd == reverse_it.m_p_nd);
+
+ const_iterator upper_bound_it = upper_bound(PB_DS_V2F(*reverse_it));
+ --upper_bound_it;
+ _GLIBCXX_DEBUG_ASSERT(upper_bound_it.m_p_nd == reverse_it.m_p_nd);
+ if (reverse_prev_it != rend())
+ _GLIBCXX_DEBUG_ASSERT(!Cmp_Fn::operator()(PB_DS_V2F(*reverse_prev_it),
+ PB_DS_V2F(*reverse_it)));
+ reverse_prev_it = reverse_it;
+ }
+ _GLIBCXX_DEBUG_ASSERT(reverse_iterated_num == m_size);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_consistent_with_debug_base() const
+{
+ debug_base::check_size(m_size);
+ assert_consistent_with_debug_base(m_p_head->m_p_parent);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_consistent_with_debug_base(const node_pointer p_nd) const
+{
+ if (p_nd == NULL)
+ return;
+ debug_base::check_key_exists(PB_DS_V2F(p_nd->m_value));
+ assert_consistent_with_debug_base(p_nd->m_p_left);
+ assert_consistent_with_debug_base(p_nd->m_p_right);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_size() const
+{
+ _GLIBCXX_DEBUG_ASSERT(recursive_count(m_p_head->m_p_parent) == m_size);
+}
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/erase_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/erase_fn_imps.hpp
new file mode 100644
index 0000000..a000c74
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/erase_fn_imps.hpp
@@ -0,0 +1,120 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file erase_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+actual_erase_node(node_pointer p_z)
+{
+ _GLIBCXX_DEBUG_ASSERT(m_size > 0);
+ --m_size;
+
+ _GLIBCXX_DEBUG_ONLY(erase_existing(PB_DS_V2F(p_z->m_value)));
+
+ p_z->~node();
+
+ s_node_allocator.deallocate(p_z, 1);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+update_min_max_for_erased_node(node_pointer p_z)
+{
+ if (m_size == 1)
+ {
+ m_p_head->m_p_left = m_p_head->m_p_right = m_p_head;
+
+ return;
+ }
+
+ if (m_p_head->m_p_left == p_z)
+ {
+ iterator it(p_z);
+
+ ++it;
+
+ m_p_head->m_p_left = it.m_p_nd;
+ }
+ else if (m_p_head->m_p_right == p_z)
+ {
+ iterator it(p_z);
+
+ --it;
+
+ m_p_head->m_p_right = it.m_p_nd;
+ }
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+clear()
+{
+ _GLIBCXX_DEBUG_ONLY(structure_only_assert_valid();)
+
+ clear_imp(m_p_head->m_p_parent);
+
+ m_size = 0;
+
+ initialize();
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::clear();)
+
+ _GLIBCXX_DEBUG_ONLY(structure_only_assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+clear_imp(node_pointer p_nd)
+{
+ if (p_nd == NULL)
+ return;
+
+ clear_imp(p_nd->m_p_left);
+
+ clear_imp(p_nd->m_p_right);
+
+ p_nd->~node();
+
+ s_node_allocator.deallocate(p_nd, 1);
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/find_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/find_fn_imps.hpp
new file mode 100644
index 0000000..413304b
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/find_fn_imps.hpp
@@ -0,0 +1,182 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file find_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_point_iterator
+PB_DS_CLASS_C_DEC::
+lower_bound(const_key_reference r_key) const
+{
+ node_pointer p_pot = m_p_head;
+ node_pointer p_nd = m_p_head->m_p_parent;
+
+ while (p_nd != NULL)
+ if (Cmp_Fn::operator()(
+ PB_DS_V2F(p_nd->m_value),
+ r_key))
+ p_nd = p_nd->m_p_right;
+ else
+ {
+ p_pot = p_nd;
+
+ p_nd = p_nd->m_p_left;
+ }
+
+ return (iterator(p_pot));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::point_iterator
+PB_DS_CLASS_C_DEC::
+lower_bound(const_key_reference r_key)
+{
+ node_pointer p_pot = m_p_head;
+ node_pointer p_nd = m_p_head->m_p_parent;
+
+ while (p_nd != NULL)
+ if (Cmp_Fn::operator()(
+ PB_DS_V2F(p_nd->m_value),
+ r_key))
+ p_nd = p_nd->m_p_right;
+ else
+ {
+ p_pot = p_nd;
+
+ p_nd = p_nd->m_p_left;
+ }
+
+ return (iterator(p_pot));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_point_iterator
+PB_DS_CLASS_C_DEC::
+upper_bound(const_key_reference r_key) const
+{
+ node_pointer p_pot = m_p_head;
+ node_pointer p_nd = m_p_head->m_p_parent;
+
+ while (p_nd != NULL)
+ if (Cmp_Fn::operator()(r_key,
+ PB_DS_V2F(p_nd->m_value)))
+ {
+ p_pot = p_nd,
+
+ p_nd = p_nd->m_p_left;
+ }
+ else
+ p_nd = p_nd->m_p_right;
+
+ return (const_iterator(p_pot));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::point_iterator
+PB_DS_CLASS_C_DEC::
+upper_bound(const_key_reference r_key)
+{
+ node_pointer p_pot = m_p_head;
+ node_pointer p_nd = m_p_head->m_p_parent;
+
+ while (p_nd != NULL)
+ if (Cmp_Fn::operator()(r_key,
+ PB_DS_V2F(p_nd->m_value)))
+ {
+ p_pot = p_nd,
+
+ p_nd = p_nd->m_p_left;
+ }
+ else
+ p_nd = p_nd->m_p_right;
+
+ return (point_iterator(p_pot));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::point_iterator
+PB_DS_CLASS_C_DEC::
+find(const_key_reference r_key)
+{
+ _GLIBCXX_DEBUG_ONLY(structure_only_assert_valid();)
+
+ node_pointer p_pot = m_p_head;
+ node_pointer p_nd = m_p_head->m_p_parent;
+
+ while (p_nd != NULL)
+ if (!Cmp_Fn::operator()(PB_DS_V2F(p_nd->m_value), r_key))
+ {
+ p_pot = p_nd;
+
+ p_nd = p_nd->m_p_left;
+ }
+ else
+ p_nd = p_nd->m_p_right;
+
+ return point_iterator((p_pot != m_p_head&& Cmp_Fn::operator()(
+ r_key,
+ PB_DS_V2F(p_pot->m_value)))?
+ m_p_head : p_pot);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_point_iterator
+PB_DS_CLASS_C_DEC::
+find(const_key_reference r_key) const
+{
+ _GLIBCXX_DEBUG_ONLY(structure_only_assert_valid();)
+
+ node_pointer p_pot = m_p_head;
+ node_pointer p_nd = m_p_head->m_p_parent;
+
+ while (p_nd != NULL)
+ if (!Cmp_Fn::operator()(PB_DS_V2F(p_nd->m_value), r_key))
+ {
+ p_pot = p_nd;
+
+ p_nd = p_nd->m_p_left;
+ }
+ else
+ p_nd = p_nd->m_p_right;
+
+ return const_point_iterator((p_pot != m_p_head&& Cmp_Fn::operator()(
+ r_key,
+ PB_DS_V2F(p_pot->m_value)))?
+ m_p_head : p_pot);
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/info_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/info_fn_imps.hpp
new file mode 100644
index 0000000..b3e4611
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/info_fn_imps.hpp
@@ -0,0 +1,64 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file info_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+empty() const
+{
+ return (m_size == 0);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+size() const
+{
+ return (m_size);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+max_size() const
+{
+ return (s_node_allocator.max_size());
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/insert_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/insert_fn_imps.hpp
new file mode 100644
index 0000000..3abf0a0
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/insert_fn_imps.hpp
@@ -0,0 +1,211 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file insert_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline std::pair<typename PB_DS_CLASS_C_DEC::point_iterator, bool>
+PB_DS_CLASS_C_DEC::
+insert_leaf(const_reference r_value)
+{
+ _GLIBCXX_DEBUG_ONLY(structure_only_assert_valid();)
+
+ if (m_size == 0)
+ return (std::make_pair(
+ insert_imp_empty(r_value),
+ true));
+
+ node_pointer p_nd = m_p_head->m_p_parent;
+ node_pointer p_pot = m_p_head;
+
+ while (p_nd != NULL)
+ if (!Cmp_Fn::operator()(
+ PB_DS_V2F(p_nd->m_value),
+ PB_DS_V2F(r_value)))
+ {
+ p_pot = p_nd;
+
+ p_nd = p_nd->m_p_left;
+ }
+ else
+ p_nd = p_nd->m_p_right;
+
+ if (p_pot == m_p_head)
+ return (std::make_pair(
+ insert_leaf_new(r_value, m_p_head->m_p_right, false),
+ true));
+
+ if (!Cmp_Fn::operator()(
+ PB_DS_V2F(r_value),
+ PB_DS_V2F(p_pot->m_value)))
+ {
+ _GLIBCXX_DEBUG_ONLY(structure_only_assert_valid();)
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(
+ PB_DS_V2F(r_value)));
+
+ return (std::make_pair(p_pot, false));
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(
+ PB_DS_V2F(r_value)));
+
+ p_nd = p_pot->m_p_left;
+ if (p_nd == NULL)
+ return (std::make_pair(
+ insert_leaf_new(r_value, p_pot, true),
+ true));
+
+ while (p_nd->m_p_right != NULL)
+ p_nd = p_nd->m_p_right;
+
+ return (std::make_pair(
+ insert_leaf_new(r_value, p_nd, false),
+ true));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+insert_leaf_new(const_reference r_value, node_pointer p_nd, bool left_nd)
+{
+ node_pointer p_new_nd =
+ get_new_node_for_leaf_insert( r_value, traits_base::m_no_throw_copies_indicator);
+
+ if (left_nd)
+ {
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_left == NULL);
+ _GLIBCXX_DEBUG_ASSERT(Cmp_Fn::operator()(
+ PB_DS_V2F(r_value),
+ PB_DS_V2F(p_nd->m_value)));
+
+ p_nd->m_p_left = p_new_nd;
+
+ if (m_p_head->m_p_left == p_nd)
+ m_p_head->m_p_left = p_new_nd;
+ }
+ else
+ {
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_right == NULL);
+ _GLIBCXX_DEBUG_ASSERT(Cmp_Fn::operator()(
+ PB_DS_V2F(p_nd->m_value),
+ PB_DS_V2F(r_value)));
+
+ p_nd->m_p_right = p_new_nd;
+
+ if (m_p_head->m_p_right == p_nd)
+ m_p_head->m_p_right = p_new_nd;
+ }
+
+ p_new_nd->m_p_parent = p_nd;
+
+ p_new_nd->m_p_left = p_new_nd->m_p_right = NULL;
+
+ _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_nd));
+
+ update_to_top(p_new_nd, (node_update* )this);
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::insert_new(
+ PB_DS_V2F(r_value)));
+
+ return (iterator(p_new_nd));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+insert_imp_empty(const_reference r_value)
+{
+ node_pointer p_new_node =
+ get_new_node_for_leaf_insert( r_value, traits_base::m_no_throw_copies_indicator);
+
+ m_p_head->m_p_left = m_p_head->m_p_right =
+ m_p_head->m_p_parent = p_new_node;
+
+ p_new_node->m_p_parent = m_p_head;
+
+ p_new_node->m_p_left = p_new_node->m_p_right = NULL;
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::insert_new(
+ PB_DS_V2F(r_value)));
+
+ update_to_top(m_p_head->m_p_parent, (node_update* )this);
+
+ return (iterator(p_new_node));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+get_new_node_for_leaf_insert(const_reference r_val, false_type)
+{
+ node_pointer p_new_nd = s_node_allocator.allocate(1);
+
+ cond_dealtor_t cond(p_new_nd);
+
+ new (const_cast<void* >(
+ static_cast<const void* >(&p_new_nd->m_value)))
+ typename node::value_type(r_val);
+
+ cond.set_no_action();
+
+ p_new_nd->m_p_left = p_new_nd->m_p_right = NULL;
+
+ ++m_size;
+
+ return (p_new_nd);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+get_new_node_for_leaf_insert(const_reference r_val, true_type)
+{
+ node_pointer p_new_nd = s_node_allocator.allocate(1);
+
+ new (const_cast<void* >(
+ static_cast<const void* >(&p_new_nd->m_value)))
+ typename node::value_type(r_val);
+
+ p_new_nd->m_p_left = p_new_nd->m_p_right = NULL;
+
+ ++m_size;
+
+ return (p_new_nd);
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/iterators_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/iterators_fn_imps.hpp
new file mode 100644
index 0000000..ed7f1b1
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/iterators_fn_imps.hpp
@@ -0,0 +1,136 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file iterators_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+begin()
+{
+ return (iterator(m_p_head->m_p_left));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+begin() const
+{
+ return (const_iterator(m_p_head->m_p_left));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+end()
+{
+ return (iterator(m_p_head));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+end() const
+{
+ return (const_iterator(m_p_head));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_reverse_iterator
+PB_DS_CLASS_C_DEC::
+rbegin() const
+{
+ return (const_reverse_iterator(m_p_head->m_p_right));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::reverse_iterator
+PB_DS_CLASS_C_DEC::
+rbegin()
+{
+ return (reverse_iterator(m_p_head->m_p_right));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::reverse_iterator
+PB_DS_CLASS_C_DEC::
+rend()
+{
+ return (reverse_iterator(m_p_head));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_reverse_iterator
+PB_DS_CLASS_C_DEC::
+rend() const
+{
+ return (const_reverse_iterator(m_p_head));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_node_iterator
+PB_DS_CLASS_C_DEC::
+node_begin() const
+{
+ return (const_node_iterator(m_p_head->m_p_parent));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_iterator
+PB_DS_CLASS_C_DEC::
+node_begin()
+{
+ return (node_iterator(m_p_head->m_p_parent));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_node_iterator
+PB_DS_CLASS_C_DEC::
+node_end() const
+{
+ return (const_node_iterator(NULL));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_iterator
+PB_DS_CLASS_C_DEC::
+node_end()
+{
+ return (node_iterator(NULL));
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/node_iterators.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/node_iterators.hpp
new file mode 100644
index 0000000..365f02b
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/node_iterators.hpp
@@ -0,0 +1,237 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file node_iterators.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+#ifndef PB_DS_BIN_SEARCH_TREE_NODE_ITERATORS_HPP
+#define PB_DS_BIN_SEARCH_TREE_NODE_ITERATORS_HPP
+
+#include <ext/pb_ds/tag_and_trait.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC \
+ bin_search_tree_const_node_it_< \
+ Node, \
+ Const_Iterator, \
+ Iterator, \
+ Allocator>
+
+ // Const node iterator.
+ template<typename Node,
+ class Const_Iterator,
+ class Iterator,
+ class Allocator>
+ class bin_search_tree_const_node_it_
+ {
+ private:
+
+ private:
+ typedef
+ typename Allocator::template rebind<
+ Node>::other::pointer
+ node_pointer;
+
+ public:
+
+ // Category.
+ typedef trivial_iterator_tag iterator_category;
+
+ // Difference type.
+ typedef trivial_iterator_difference_type difference_type;
+
+ // __Iterator's value type.
+ typedef Const_Iterator value_type;
+
+ // __Iterator's reference type.
+ typedef Const_Iterator reference;
+
+ // __Iterator's __const reference type.
+ typedef Const_Iterator const_reference;
+
+ // Metadata type.
+ typedef typename Node::metadata_type metadata_type;
+
+ // Const metadata reference type.
+ typedef
+ typename Allocator::template rebind<
+ metadata_type>::other::const_reference
+ const_metadata_reference;
+
+ public:
+
+ // Default constructor.
+ /*
+ inline
+ bin_search_tree_const_node_it_()
+ */
+
+ inline
+ bin_search_tree_const_node_it_(const node_pointer p_nd = NULL) : m_p_nd(const_cast<node_pointer>(p_nd))
+ { }
+
+ // Access.
+ inline const_reference
+ operator*() const
+ {
+ return (Const_Iterator(m_p_nd));
+ }
+
+ // Metadata access.
+ inline const_metadata_reference
+ get_metadata() const
+ {
+ return (m_p_nd->get_metadata());
+ }
+
+ // Returns the __const node iterator associated with the left node.
+ inline PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC
+ get_l_child() const
+ {
+ return (PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC(m_p_nd->m_p_left));
+ }
+
+ // Returns the __const node iterator associated with the right node.
+ inline PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC
+ get_r_child() const
+ {
+ return (PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC(m_p_nd->m_p_right));
+ }
+
+ // Compares to a different iterator object.
+ inline bool
+ operator==(const PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC& other) const
+ {
+ return (m_p_nd == other.m_p_nd);
+ }
+
+ // Compares (negatively) to a different iterator object.
+ inline bool
+ operator!=(const PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC& other) const
+ {
+ return (m_p_nd != other.m_p_nd);
+ }
+
+ public:
+ node_pointer m_p_nd;
+ };
+
+#define PB_DS_TREE_NODE_ITERATOR_CLASS_C_DEC \
+ bin_search_tree_node_it_< \
+ Node, \
+ Const_Iterator, \
+ Iterator, \
+ Allocator>
+
+ // Node iterator.
+ template<typename Node,
+ class Const_Iterator,
+ class Iterator,
+ class Allocator>
+ class bin_search_tree_node_it_ :
+ public PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC
+
+ {
+
+ private:
+ typedef
+ typename Allocator::template rebind<
+ Node>::other::pointer
+ node_pointer;
+
+ public:
+
+ // __Iterator's value type.
+ typedef Iterator value_type;
+
+ // __Iterator's reference type.
+ typedef Iterator reference;
+
+ // __Iterator's __const reference type.
+ typedef Iterator const_reference;
+
+ public:
+
+ // Default constructor.
+ /*
+ inline
+ bin_search_tree_node_it_();
+ */
+
+ inline
+ bin_search_tree_node_it_(const node_pointer p_nd = NULL) : PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC(
+ const_cast<node_pointer>(p_nd))
+ { }
+
+ // Access.
+ inline Iterator
+ operator*() const
+ {
+ return (Iterator(PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC::m_p_nd));
+ }
+
+ // Returns the node iterator associated with the left node.
+ inline PB_DS_TREE_NODE_ITERATOR_CLASS_C_DEC
+ get_l_child() const
+ {
+ return (PB_DS_TREE_NODE_ITERATOR_CLASS_C_DEC(
+ PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC::m_p_nd->m_p_left));
+ }
+
+ // Returns the node iterator associated with the right node.
+ inline PB_DS_TREE_NODE_ITERATOR_CLASS_C_DEC
+ get_r_child() const
+ {
+ return (PB_DS_TREE_NODE_ITERATOR_CLASS_C_DEC(
+ PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC::m_p_nd->m_p_right));
+ }
+
+ };
+
+#undef PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC
+
+#undef PB_DS_TREE_NODE_ITERATOR_CLASS_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_BIN_SEARCH_TREE_NODE_ITERATORS_HPP
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/point_iterators.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/point_iterators.hpp
new file mode 100644
index 0000000..bb249e0
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/point_iterators.hpp
@@ -0,0 +1,381 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file point_iterators.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+#ifndef PB_DS_BIN_SEARCH_TREE_FIND_ITERATORS_HPP
+#define PB_DS_BIN_SEARCH_TREE_FIND_ITERATORS_HPP
+
+#include <ext/pb_ds/tag_and_trait.hpp>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_TREE_CONST_IT_C_DEC \
+ bin_search_tree_const_it_< \
+ Node_Pointer, \
+ Value_Type, \
+ Pointer, \
+ Const_Pointer, \
+ Reference, \
+ Const_Reference, \
+ Is_Forward_Iterator, \
+ Allocator>
+
+#define PB_DS_TREE_CONST_ODIR_IT_C_DEC \
+ bin_search_tree_const_it_< \
+ Node_Pointer, \
+ Value_Type, \
+ Pointer, \
+ Const_Pointer, \
+ Reference, \
+ Const_Reference, \
+ !Is_Forward_Iterator, \
+ Allocator>
+
+#define PB_DS_TREE_IT_C_DEC \
+ bin_search_tree_it_< \
+ Node_Pointer, \
+ Value_Type, \
+ Pointer, \
+ Const_Pointer, \
+ Reference, \
+ Const_Reference, \
+ Is_Forward_Iterator, \
+ Allocator>
+
+#define PB_DS_TREE_ODIR_IT_C_DEC \
+ bin_search_tree_it_< \
+ Node_Pointer, \
+ Value_Type, \
+ Pointer, \
+ Const_Pointer, \
+ Reference, \
+ Const_Reference, \
+ !Is_Forward_Iterator, \
+ Allocator>
+
+ // Const iterator.
+ template<typename Node_Pointer,
+ typename Value_Type,
+ typename Pointer,
+ typename Const_Pointer,
+ typename Reference,
+ typename Const_Reference,
+ bool Is_Forward_Iterator,
+ class Allocator>
+ class bin_search_tree_const_it_
+ {
+
+ public:
+
+ typedef std::bidirectional_iterator_tag iterator_category;
+
+ typedef typename Allocator::difference_type difference_type;
+
+ typedef Value_Type value_type;
+
+ typedef Pointer pointer;
+
+ typedef Const_Pointer const_pointer;
+
+ typedef Reference reference;
+
+ typedef Const_Reference const_reference;
+
+ public:
+
+ inline
+ bin_search_tree_const_it_(const Node_Pointer p_nd = NULL)
+ : m_p_nd(const_cast<Node_Pointer>(p_nd))
+ { }
+
+ inline
+ bin_search_tree_const_it_(const PB_DS_TREE_CONST_ODIR_IT_C_DEC& other)
+ : m_p_nd(other.m_p_nd)
+ { }
+
+ inline
+ PB_DS_TREE_CONST_IT_C_DEC&
+ operator=(const PB_DS_TREE_CONST_IT_C_DEC& other)
+ {
+ m_p_nd = other.m_p_nd;
+ return *this;
+ }
+
+ inline
+ PB_DS_TREE_CONST_IT_C_DEC&
+ operator=(const PB_DS_TREE_CONST_ODIR_IT_C_DEC& other)
+ {
+ m_p_nd = other.m_p_nd;
+ return *this;
+ }
+
+ inline const_pointer
+ operator->() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_nd != NULL);
+ return &m_p_nd->m_value;
+ }
+
+ inline const_reference
+ operator*() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_nd != NULL);
+ return m_p_nd->m_value;
+ }
+
+ inline bool
+ operator==(const PB_DS_TREE_CONST_IT_C_DEC & other) const
+ { return m_p_nd == other.m_p_nd; }
+
+ inline bool
+ operator==(const PB_DS_TREE_CONST_ODIR_IT_C_DEC & other) const
+ { return m_p_nd == other.m_p_nd; }
+
+ inline bool
+ operator!=(const PB_DS_TREE_CONST_IT_C_DEC& other) const
+ { return m_p_nd != other.m_p_nd; }
+
+ inline bool
+ operator!=(const PB_DS_TREE_CONST_ODIR_IT_C_DEC& other) const
+ { return m_p_nd != other.m_p_nd; }
+
+ inline PB_DS_TREE_CONST_IT_C_DEC&
+ operator++()
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_nd != NULL);
+ inc(integral_constant<int,Is_Forward_Iterator>());
+ return *this;
+ }
+
+ inline PB_DS_TREE_CONST_IT_C_DEC
+ operator++(int)
+ {
+ PB_DS_TREE_CONST_IT_C_DEC ret_it(m_p_nd);
+ operator++();
+ return ret_it;
+ }
+
+ inline PB_DS_TREE_CONST_IT_C_DEC&
+ operator--()
+ {
+ dec(integral_constant<int,Is_Forward_Iterator>());
+ return *this;
+ }
+
+ inline PB_DS_TREE_CONST_IT_C_DEC
+ operator--(int)
+ {
+ PB_DS_TREE_CONST_IT_C_DEC ret_it(m_p_nd);
+ operator--();
+ return ret_it;
+ }
+
+ protected:
+ inline void
+ inc(false_type)
+ { dec(true_type()); }
+
+ void
+ inc(true_type)
+ {
+ if (m_p_nd->special()&&
+ m_p_nd->m_p_parent->m_p_parent == m_p_nd)
+ {
+ m_p_nd = m_p_nd->m_p_left;
+ return;
+ }
+
+ if (m_p_nd->m_p_right != NULL)
+ {
+ m_p_nd = m_p_nd->m_p_right;
+ while (m_p_nd->m_p_left != NULL)
+ m_p_nd = m_p_nd->m_p_left;
+ return;
+ }
+
+ Node_Pointer p_y = m_p_nd->m_p_parent;
+ while (m_p_nd == p_y->m_p_right)
+ {
+ m_p_nd = p_y;
+ p_y = p_y->m_p_parent;
+ }
+
+ if (m_p_nd->m_p_right != p_y)
+ m_p_nd = p_y;
+ }
+
+ inline void
+ dec(false_type)
+ { inc(true_type()); }
+
+ void
+ dec(true_type)
+ {
+ if (m_p_nd->special() && m_p_nd->m_p_parent->m_p_parent == m_p_nd)
+ {
+ m_p_nd = m_p_nd->m_p_right;
+ return;
+ }
+
+ if (m_p_nd->m_p_left != NULL)
+ {
+ Node_Pointer p_y = m_p_nd->m_p_left;
+ while (p_y->m_p_right != NULL)
+ p_y = p_y->m_p_right;
+ m_p_nd = p_y;
+ return;
+ }
+
+ Node_Pointer p_y = m_p_nd->m_p_parent;
+ while (m_p_nd == p_y->m_p_left)
+ {
+ m_p_nd = p_y;
+ p_y = p_y->m_p_parent;
+ }
+ if (m_p_nd->m_p_left != p_y)
+ m_p_nd = p_y;
+ }
+
+ public:
+ Node_Pointer m_p_nd;
+ };
+
+ // Iterator.
+ template<typename Node_Pointer,
+ typename Value_Type,
+ typename Pointer,
+ typename Const_Pointer,
+ typename Reference,
+ typename Const_Reference,
+ bool Is_Forward_Iterator,
+ class Allocator>
+ class bin_search_tree_it_ :
+ public PB_DS_TREE_CONST_IT_C_DEC
+
+ {
+
+ public:
+
+ inline
+ bin_search_tree_it_(const Node_Pointer p_nd = NULL)
+ : PB_DS_TREE_CONST_IT_C_DEC((Node_Pointer)p_nd)
+ { }
+
+ inline
+ bin_search_tree_it_(const PB_DS_TREE_ODIR_IT_C_DEC& other)
+ : PB_DS_TREE_CONST_IT_C_DEC(other.m_p_nd)
+ { }
+
+ inline
+ PB_DS_TREE_IT_C_DEC&
+ operator=(const PB_DS_TREE_IT_C_DEC& other)
+ {
+ base_it_type::m_p_nd = other.m_p_nd;
+ return *this;
+ }
+
+ inline
+ PB_DS_TREE_IT_C_DEC&
+ operator=(const PB_DS_TREE_ODIR_IT_C_DEC& other)
+ {
+ base_it_type::m_p_nd = other.m_p_nd;
+ return *this;
+ }
+
+ inline typename PB_DS_TREE_CONST_IT_C_DEC::pointer
+ operator->() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(base_it_type::m_p_nd != NULL);
+ return &base_it_type::m_p_nd->m_value;
+ }
+
+ inline typename PB_DS_TREE_CONST_IT_C_DEC::reference
+ operator*() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(base_it_type::m_p_nd != NULL);
+ return base_it_type::m_p_nd->m_value;
+ }
+
+ inline PB_DS_TREE_IT_C_DEC&
+ operator++()
+ {
+ PB_DS_TREE_CONST_IT_C_DEC:: operator++();
+ return *this;
+ }
+
+ inline PB_DS_TREE_IT_C_DEC
+ operator++(int)
+ {
+ PB_DS_TREE_IT_C_DEC ret_it(base_it_type::m_p_nd);
+ operator++();
+ return ret_it;
+ }
+
+ inline PB_DS_TREE_IT_C_DEC&
+ operator--()
+ {
+ PB_DS_TREE_CONST_IT_C_DEC:: operator--();
+ return *this;
+ }
+
+ inline PB_DS_TREE_IT_C_DEC
+ operator--(int)
+ {
+ PB_DS_TREE_IT_C_DEC ret_it(base_it_type::m_p_nd);
+ operator--();
+ return ret_it;
+ }
+
+ protected:
+ typedef PB_DS_TREE_CONST_IT_C_DEC base_it_type;
+ };
+
+#undef PB_DS_TREE_CONST_IT_C_DEC
+#undef PB_DS_TREE_CONST_ODIR_IT_C_DEC
+#undef PB_DS_TREE_IT_C_DEC
+#undef PB_DS_TREE_ODIR_IT_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/policy_access_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/policy_access_fn_imps.hpp
new file mode 100644
index 0000000..63f307d
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/policy_access_fn_imps.hpp
@@ -0,0 +1,56 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file policy_access_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+Cmp_Fn&
+PB_DS_CLASS_C_DEC::
+get_cmp_fn()
+{
+ return (*this);
+}
+
+PB_DS_CLASS_T_DEC
+const Cmp_Fn&
+PB_DS_CLASS_C_DEC::
+get_cmp_fn() const
+{
+ return (*this);
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/r_erase_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/r_erase_fn_imps.hpp
new file mode 100644
index 0000000..667ef84
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/r_erase_fn_imps.hpp
@@ -0,0 +1,120 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file r_erase_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+actual_erase_node(node_pointer p_z)
+{
+ _GLIBCXX_DEBUG_ASSERT(m_size > 0);
+ --m_size;
+
+ _GLIBCXX_DEBUG_ONLY(erase_existing(PB_DS_V2F(p_z->m_value)));
+
+ p_z->~node();
+
+ s_node_allocator.deallocate(p_z, 1);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+update_min_max_for_erased_node(node_pointer p_z)
+{
+ if (m_size == 1)
+ {
+ m_p_head->m_p_left = m_p_head->m_p_right = m_p_head;
+
+ return;
+ }
+
+ if (m_p_head->m_p_left == p_z)
+ {
+ iterator it(p_z);
+
+ ++it;
+
+ m_p_head->m_p_left = it.m_p_nd;
+ }
+ else if (m_p_head->m_p_right == p_z)
+ {
+ iterator it(p_z);
+
+ --it;
+
+ m_p_head->m_p_right = it.m_p_nd;
+ }
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+clear()
+{
+ _GLIBCXX_DEBUG_ONLY(structure_only_assert_valid();)
+
+ clear_imp(m_p_head->m_p_parent);
+
+ m_size = 0;
+
+ initialize();
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::clear();)
+
+ _GLIBCXX_DEBUG_ONLY(structure_only_assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+clear_imp(node_pointer p_nd)
+{
+ if (p_nd == NULL)
+ return;
+
+ clear_imp(p_nd->m_p_left);
+
+ clear_imp(p_nd->m_p_right);
+
+ p_nd->~Node();
+
+ s_node_allocator.deallocate(p_nd, 1);
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/rotate_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/rotate_fn_imps.hpp
new file mode 100644
index 0000000..0598657
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/rotate_fn_imps.hpp
@@ -0,0 +1,156 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file rotate_fn_imps.hpp
+ * Contains imps for rotating nodes.
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+rotate_left(node_pointer p_x)
+{
+ node_pointer p_y = p_x->m_p_right;
+
+ p_x->m_p_right = p_y->m_p_left;
+
+ if (p_y->m_p_left != NULL)
+ p_y->m_p_left->m_p_parent = p_x;
+
+ p_y->m_p_parent = p_x->m_p_parent;
+
+ if (p_x == m_p_head->m_p_parent)
+ m_p_head->m_p_parent = p_y;
+ else if (p_x == p_x->m_p_parent->m_p_left)
+ p_x->m_p_parent->m_p_left = p_y;
+ else
+ p_x->m_p_parent->m_p_right = p_y;
+
+ p_y->m_p_left = p_x;
+ p_x->m_p_parent = p_y;
+
+ _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_x);)
+ _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_y);)
+
+ apply_update(p_x, (node_update* )this);
+ apply_update(p_x->m_p_parent, (node_update* )this);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+rotate_right(node_pointer p_x)
+{
+ node_pointer p_y = p_x->m_p_left;
+
+ p_x->m_p_left = p_y->m_p_right;
+
+ if (p_y->m_p_right != NULL)
+ p_y->m_p_right->m_p_parent = p_x;
+
+ p_y->m_p_parent = p_x->m_p_parent;
+
+ if (p_x == m_p_head->m_p_parent)
+ m_p_head->m_p_parent = p_y;
+ else if (p_x == p_x->m_p_parent->m_p_right)
+ p_x->m_p_parent->m_p_right = p_y;
+ else
+ p_x->m_p_parent->m_p_left = p_y;
+
+ p_y->m_p_right = p_x;
+ p_x->m_p_parent = p_y;
+
+ _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_x);)
+ _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_y);)
+
+ apply_update(p_x, (node_update* )this);
+ apply_update(p_x->m_p_parent, (node_update* )this);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+rotate_parent(node_pointer p_nd)
+{
+ node_pointer p_parent = p_nd->m_p_parent;
+
+ if (p_nd == p_parent->m_p_left)
+ rotate_right(p_parent);
+ else
+ rotate_left(p_parent);
+
+ _GLIBCXX_DEBUG_ASSERT(p_parent->m_p_parent = p_nd);
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_left == p_parent ||
+ p_nd->m_p_right == p_parent);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+apply_update(node_pointer /*p_nd*/, null_node_update_pointer /*p_update*/)
+{ }
+
+PB_DS_CLASS_T_DEC
+template<typename Node_Update_>
+inline void
+PB_DS_CLASS_C_DEC::
+apply_update(node_pointer p_nd, Node_Update_* /*p_update*/)
+{
+ node_update::operator()(
+ node_iterator(p_nd),
+ const_node_iterator(static_cast<node_pointer>(NULL)));
+}
+
+PB_DS_CLASS_T_DEC
+template<typename Node_Update_>
+inline void
+PB_DS_CLASS_C_DEC::
+update_to_top(node_pointer p_nd, Node_Update_* p_update)
+{
+ while (p_nd != m_p_head)
+ {
+ apply_update(p_nd, p_update);
+
+ p_nd = p_nd->m_p_parent;
+ }
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+update_to_top(node_pointer /*p_nd*/, null_node_update_pointer /*p_update*/)
+{ }
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/split_join_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/split_join_fn_imps.hpp
new file mode 100644
index 0000000..9d2bd6d
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/split_join_fn_imps.hpp
@@ -0,0 +1,146 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file split_join_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+bool
+PB_DS_CLASS_C_DEC::
+join_prep(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ if (other.m_size == 0)
+ return false;
+
+ if (m_size == 0)
+ {
+ value_swap(other);
+ return false;
+ }
+
+ const bool greater = Cmp_Fn::operator()(PB_DS_V2F(m_p_head->m_p_right->m_value), PB_DS_V2F(other.m_p_head->m_p_left->m_value));
+
+ const bool lesser = Cmp_Fn::operator()(PB_DS_V2F(other.m_p_head->m_p_right->m_value), PB_DS_V2F(m_p_head->m_p_left->m_value));
+
+ if (!greater && !lesser)
+ __throw_join_error();
+
+ if (lesser)
+ value_swap(other);
+
+ m_size += other.m_size;
+ _GLIBCXX_DEBUG_ONLY(debug_base::join(other);)
+ return true;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+join_finish(PB_DS_CLASS_C_DEC& other)
+{
+ initialize_min_max();
+ other.initialize();
+}
+
+PB_DS_CLASS_T_DEC
+bool
+PB_DS_CLASS_C_DEC::
+split_prep(const_key_reference r_key, PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ other.clear();
+
+ if (m_size == 0)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ return false;
+ }
+
+ if (Cmp_Fn::operator()(r_key, PB_DS_V2F(m_p_head->m_p_left->m_value)))
+ {
+ value_swap(other);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ return false;
+ }
+
+ if (!Cmp_Fn::operator()(r_key, PB_DS_V2F(m_p_head->m_p_right->m_value)))
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ return false;
+ }
+
+ if (m_size == 1)
+ {
+ value_swap(other);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ return false;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::split(r_key,(Cmp_Fn& )(*this), other);)
+ return true;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+split_finish(PB_DS_CLASS_C_DEC& other)
+{
+ other.initialize_min_max();
+ other.m_size = std::distance(other.begin(), other.end());
+ m_size -= other.m_size;
+ initialize_min_max();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+recursive_count(node_pointer p) const
+{
+ if (p == NULL)
+ return 0;
+ return 1 + recursive_count(p->m_p_left) + recursive_count(p->m_p_right);
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/traits.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/traits.hpp
new file mode 100644
index 0000000..58c30c3
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/bin_search_tree_/traits.hpp
@@ -0,0 +1,250 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file traits.hpp
+ * Contains an implementation for bin_search_tree_.
+ */
+
+#ifndef PB_DS_BIN_SEARCH_TREE_NODE_AND_IT_TRAITS_HPP
+#define PB_DS_BIN_SEARCH_TREE_NODE_AND_IT_TRAITS_HPP
+
+#include <ext/pb_ds/detail/bin_search_tree_/point_iterators.hpp>
+#include <ext/pb_ds/detail/bin_search_tree_/node_iterators.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+ template<typename Key,
+ typename Mapped,
+ class Cmp_Fn,
+ template<typename Const_Node_Iterator,
+ class Node_Iterator,
+ class Cmp_Fn,
+ class Allocator>
+ class Node_Update,
+ class Node,
+ class Allocator>
+ struct bin_search_tree_traits
+ {
+ private:
+ typedef
+ types_traits<
+ Key,
+ Mapped,
+ Allocator,
+ false>
+ type_traits;
+
+ public:
+ typedef Node node;
+
+ typedef
+ bin_search_tree_const_it_<
+ typename Allocator::template rebind<
+ node>::other::pointer,
+ typename type_traits::value_type,
+ typename type_traits::pointer,
+ typename type_traits::const_pointer,
+ typename type_traits::reference,
+ typename type_traits::const_reference,
+ true,
+ Allocator>
+ const_point_iterator;
+
+ typedef
+ bin_search_tree_it_<
+ typename Allocator::template rebind<
+ node>::other::pointer,
+ typename type_traits::value_type,
+ typename type_traits::pointer,
+ typename type_traits::const_pointer,
+ typename type_traits::reference,
+ typename type_traits::const_reference,
+ true,
+ Allocator>
+ point_iterator;
+
+ typedef
+ bin_search_tree_const_it_<
+ typename Allocator::template rebind<
+ node>::other::pointer,
+ typename type_traits::value_type,
+ typename type_traits::pointer,
+ typename type_traits::const_pointer,
+ typename type_traits::reference,
+ typename type_traits::const_reference,
+ false,
+ Allocator>
+ const_reverse_iterator;
+
+ typedef
+ bin_search_tree_it_<
+ typename Allocator::template rebind<
+ node>::other::pointer,
+ typename type_traits::value_type,
+ typename type_traits::pointer,
+ typename type_traits::const_pointer,
+ typename type_traits::reference,
+ typename type_traits::const_reference,
+ false,
+ Allocator>
+ reverse_iterator;
+
+ typedef
+ bin_search_tree_const_node_it_<
+ Node,
+ const_point_iterator,
+ point_iterator,
+ Allocator>
+ const_node_iterator;
+
+ typedef
+ bin_search_tree_node_it_<
+ Node,
+ const_point_iterator,
+ point_iterator,
+ Allocator>
+ node_iterator;
+
+ typedef
+ Node_Update<
+ const_node_iterator,
+ node_iterator,
+ Cmp_Fn,
+ Allocator>
+ node_update;
+
+ typedef
+ __gnu_pbds::null_tree_node_update<
+ const_node_iterator,
+ node_iterator,
+ Cmp_Fn,
+ Allocator>*
+ null_node_update_pointer;
+ };
+
+ template<typename Key,
+ class Cmp_Fn,
+ template<typename Const_Node_Iterator,
+ class Node_Iterator,
+ class Cmp_Fn,
+ class Allocator>
+ class Node_Update,
+ class Node,
+ class Allocator>
+ struct bin_search_tree_traits<
+ Key,
+ null_mapped_type,
+ Cmp_Fn,
+ Node_Update,
+ Node,
+ Allocator>
+ {
+ private:
+ typedef
+ types_traits<
+ Key,
+ null_mapped_type,
+ Allocator,
+ false>
+ type_traits;
+
+ public:
+ typedef Node node;
+
+ typedef
+ bin_search_tree_const_it_<
+ typename Allocator::template rebind<
+ node>::other::pointer,
+ typename type_traits::value_type,
+ typename type_traits::pointer,
+ typename type_traits::const_pointer,
+ typename type_traits::reference,
+ typename type_traits::const_reference,
+ true,
+ Allocator>
+ const_point_iterator;
+
+ typedef const_point_iterator point_iterator;
+
+ typedef
+ bin_search_tree_const_it_<
+ typename Allocator::template rebind<
+ node>::other::pointer,
+ typename type_traits::value_type,
+ typename type_traits::pointer,
+ typename type_traits::const_pointer,
+ typename type_traits::reference,
+ typename type_traits::const_reference,
+ false,
+ Allocator>
+ const_reverse_iterator;
+
+ typedef const_reverse_iterator reverse_iterator;
+
+ typedef
+ bin_search_tree_const_node_it_<
+ Node,
+ const_point_iterator,
+ point_iterator,
+ Allocator>
+ const_node_iterator;
+
+ typedef const_node_iterator node_iterator;
+
+ typedef
+ Node_Update<
+ const_node_iterator,
+ node_iterator,
+ Cmp_Fn,
+ Allocator>
+ node_update;
+
+ typedef
+ __gnu_pbds::null_tree_node_update<
+ const_node_iterator,
+ node_iterator,
+ Cmp_Fn,
+ Allocator>*
+ null_node_update_pointer;
+ };
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_BIN_SEARCH_TREE_NODE_AND_IT_TRAITS_HPP
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp
new file mode 100644
index 0000000..576cba2
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp
@@ -0,0 +1,357 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file binary_heap_.hpp
+ * Contains an implementation class for a binary heap.
+ */
+
+#ifndef PB_DS_BINARY_HEAP_HPP
+#define PB_DS_BINARY_HEAP_HPP
+
+/*
+ * Based on CLRS.
+ */
+
+#include <queue>
+#include <algorithm>
+#include <ext/pb_ds/detail/cond_dealtor.hpp>
+#include <ext/pb_ds/detail/cond_dealtor.hpp>
+#include <ext/pb_ds/detail/type_utils.hpp>
+#include <ext/pb_ds/detail/binary_heap_/entry_cmp.hpp>
+#include <ext/pb_ds/detail/binary_heap_/entry_pred.hpp>
+#include <ext/pb_ds/detail/binary_heap_/resize_policy.hpp>
+#include <ext/pb_ds/detail/binary_heap_/const_point_iterator.hpp>
+#include <ext/pb_ds/detail/binary_heap_/const_iterator.hpp>
+#ifdef PB_DS_BINARY_HEAP_TRACE_
+#include <iostream>
+#endif
+#include <ext/pb_ds/detail/type_utils.hpp>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+#define PB_DS_CLASS_T_DEC \
+ template<typename Value_Type, class Cmp_Fn, class Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ binary_heap_<Value_Type, Cmp_Fn, Allocator>
+
+#define PB_DS_ENTRY_CMP_DEC \
+ entry_cmp<Value_Type, Cmp_Fn, is_simple<Value_Type>::value, Allocator>::type
+
+#define PB_DS_RESIZE_POLICY_DEC \
+ __gnu_pbds::detail::resize_policy<typename Allocator::size_type>
+
+ /**
+ * class description = "Base class for some types of h3ap$">
+ **/
+ template<typename Value_Type, class Cmp_Fn, class Allocator>
+ class binary_heap_ : public PB_DS_ENTRY_CMP_DEC,
+ public PB_DS_RESIZE_POLICY_DEC
+ {
+
+ private:
+ enum
+ {
+ simple_value = is_simple<Value_Type>::value
+ };
+
+ typedef integral_constant<int, simple_value> no_throw_copies_t;
+
+ typedef
+ typename Allocator::template rebind<
+ Value_Type>::other
+ value_allocator;
+
+ typedef
+ typename __conditional_type<
+ simple_value,
+ Value_Type,
+ typename value_allocator::pointer>::__type
+ entry;
+
+ typedef
+ typename Allocator::template rebind<
+ entry>::other
+ entry_allocator;
+
+ typedef typename entry_allocator::pointer entry_pointer;
+
+ typedef typename PB_DS_ENTRY_CMP_DEC entry_cmp;
+
+ typedef PB_DS_RESIZE_POLICY_DEC resize_policy;
+
+ typedef
+ cond_dealtor<
+ Value_Type,
+ Allocator>
+ cond_dealtor_t;
+
+ public:
+
+ typedef typename Allocator::size_type size_type;
+
+ typedef typename Allocator::difference_type difference_type;
+
+ typedef Value_Type value_type;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::pointer
+ pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::const_pointer
+ const_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::reference
+ reference;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::const_reference
+ const_reference;
+
+ typedef
+ binary_heap_const_point_iterator_<
+ value_type,
+ entry,
+ simple_value,
+ Allocator>
+ const_point_iterator;
+
+ typedef const_point_iterator point_iterator;
+
+ typedef
+ binary_heap_const_iterator_<
+ value_type,
+ entry,
+ simple_value,
+ Allocator>
+ const_iterator;
+
+ typedef const_iterator iterator;
+
+ typedef Cmp_Fn cmp_fn;
+
+ typedef Allocator allocator_type;
+
+ public:
+
+ binary_heap_();
+
+ binary_heap_(const Cmp_Fn& r_cmp_fn);
+
+ binary_heap_(const PB_DS_CLASS_C_DEC& other);
+
+ void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ ~binary_heap_();
+
+ inline bool
+ empty() const;
+
+ inline size_type
+ size() const;
+
+ inline size_type
+ max_size() const;
+
+ Cmp_Fn&
+ get_cmp_fn();
+
+ const Cmp_Fn&
+ get_cmp_fn() const;
+
+ inline point_iterator
+ push(const_reference r_val);
+
+ void
+ modify(point_iterator it, const_reference r_new_val);
+
+ inline const_reference
+ top() const;
+
+ inline void
+ pop();
+
+ inline void
+ erase(point_iterator it);
+
+ template<typename Pred>
+ typename PB_DS_CLASS_C_DEC::size_type
+ erase_if(Pred pred);
+
+ inline static void
+ erase_at(entry_pointer a_entries, size_type size, false_type);
+
+ inline static void
+ erase_at(entry_pointer a_entries, size_type size, true_type);
+
+ inline iterator
+ begin();
+
+ inline const_iterator
+ begin() const;
+
+ inline iterator
+ end();
+
+ inline const_iterator
+ end() const;
+
+ void
+ clear();
+
+ template<typename Pred>
+ void
+ split(Pred pred, PB_DS_CLASS_C_DEC& other);
+
+ void
+ join(PB_DS_CLASS_C_DEC& other);
+
+#ifdef PB_DS_BINARY_HEAP_TRACE_
+ void
+ trace() const;
+#endif
+
+ protected:
+
+ template<typename It>
+ void
+ copy_from_range(It first_it, It last_it);
+
+ private:
+
+ void
+ value_swap(PB_DS_CLASS_C_DEC& other);
+
+ inline void
+ insert_value(const_reference r_val, false_type);
+
+ inline void
+ insert_value(value_type val, true_type);
+
+ inline void
+ insert_entry(entry e);
+
+ inline void
+ resize_for_insert_if_needed();
+
+ inline void
+ swap_value_imp(entry_pointer p_e, value_type new_val, true_type);
+
+ inline void
+ swap_value_imp(entry_pointer p_e, const_reference r_new_val, false_type);
+
+ void
+ fix(entry_pointer p_e);
+
+ inline const_reference
+ top_imp(true_type) const;
+
+ inline const_reference
+ top_imp(false_type) const;
+
+ inline static size_type
+ left_child(size_type i);
+
+ inline static size_type
+ right_child(size_type i);
+
+ inline static size_type
+ parent(size_type i);
+
+ inline void
+ resize_for_erase_if_needed();
+
+ template<typename Pred>
+ size_type
+ partition(Pred pred);
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid() const;
+#endif
+
+#ifdef PB_DS_BINARY_HEAP_TRACE_
+ void
+ trace_entry(const entry& r_e, false_type) const;
+
+ void
+ trace_entry(const entry& r_e, true_type) const;
+#endif
+
+ private:
+ static entry_allocator s_entry_allocator;
+
+ static value_allocator s_value_allocator;
+
+ static no_throw_copies_t s_no_throw_copies_ind;
+
+ size_type m_size;
+
+ size_type m_actual_size;
+
+ entry_pointer m_a_entries;
+ };
+
+#include <ext/pb_ds/detail/binary_heap_/insert_fn_imps.hpp>
+#include <ext/pb_ds/detail/binary_heap_/constructors_destructor_fn_imps.hpp>
+#include <ext/pb_ds/detail/binary_heap_/iterators_fn_imps.hpp>
+#include <ext/pb_ds/detail/binary_heap_/debug_fn_imps.hpp>
+#include <ext/pb_ds/detail/binary_heap_/trace_fn_imps.hpp>
+#include <ext/pb_ds/detail/binary_heap_/erase_fn_imps.hpp>
+#include <ext/pb_ds/detail/binary_heap_/info_fn_imps.hpp>
+#include <ext/pb_ds/detail/binary_heap_/find_fn_imps.hpp>
+#include <ext/pb_ds/detail/binary_heap_/split_join_fn_imps.hpp>
+#include <ext/pb_ds/detail/binary_heap_/policy_access_fn_imps.hpp>
+
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_ENTRY_CMP_DEC
+#undef PB_DS_RESIZE_POLICY_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/const_iterator.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/const_iterator.hpp
new file mode 100644
index 0000000..9cb13f9
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/const_iterator.hpp
@@ -0,0 +1,152 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file const_iterator.hpp
+ * Contains an iterator class returned by the table's const find and insert
+ * methods.
+ */
+
+#ifndef PB_DS_BINARY_HEAP_CONST_ITERATOR_HPP
+#define PB_DS_BINARY_HEAP_CONST_ITERATOR_HPP
+
+#include <ext/pb_ds/detail/binary_heap_/const_point_iterator.hpp>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_CLASS_C_DEC \
+ binary_heap_const_iterator_<Value_Type, Entry, Simple, Allocator>
+
+#define PB_DS_BASE_C_DEC \
+ binary_heap_const_point_iterator_<Value_Type, Entry, Simple, Allocator>
+
+ // Const point-type iterator.
+ template<typename Value_Type,
+ typename Entry,
+ bool Simple,
+ class Allocator>
+ class binary_heap_const_iterator_ : public PB_DS_BASE_C_DEC
+ {
+
+ private:
+ typedef typename PB_DS_BASE_C_DEC::entry_pointer entry_pointer;
+
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ public:
+
+ // Category.
+ typedef std::forward_iterator_tag iterator_category;
+
+ // Difference type.
+ typedef typename Allocator::difference_type difference_type;
+
+ // Iterator's value type.
+ typedef typename base_type::value_type value_type;
+
+ // Iterator's pointer type.
+ typedef typename base_type::pointer pointer;
+
+ // Iterator's const pointer type.
+ typedef typename base_type::const_pointer const_pointer;
+
+ // Iterator's reference type.
+ typedef typename base_type::reference reference;
+
+ // Iterator's const reference type.
+ typedef typename base_type::const_reference const_reference;
+
+ public:
+
+ inline
+ binary_heap_const_iterator_(entry_pointer p_e) : base_type(p_e)
+ { }
+
+ // Default constructor.
+ inline
+ binary_heap_const_iterator_()
+ { }
+
+ // Copy constructor.
+ inline
+ binary_heap_const_iterator_(const PB_DS_CLASS_C_DEC& other) : base_type(other)
+ { }
+
+ // Compares content to a different iterator object.
+ inline bool
+ operator==(const PB_DS_CLASS_C_DEC& other) const
+ {
+ return base_type::m_p_e == other.m_p_e;
+ }
+
+ // Compares content (negatively) to a different iterator object.
+ inline bool
+ operator!=(const PB_DS_CLASS_C_DEC& other) const
+ {
+ return base_type::m_p_e != other.m_p_e;
+ }
+
+ inline PB_DS_CLASS_C_DEC&
+ operator++()
+ {
+ _GLIBCXX_DEBUG_ASSERT(base_type::m_p_e != NULL);
+ inc();
+ return *this;
+ }
+
+ inline PB_DS_CLASS_C_DEC
+ operator++(int)
+ {
+ PB_DS_CLASS_C_DEC ret_it(base_type::m_p_e);
+ operator++();
+ return ret_it;
+ }
+
+ private:
+ void
+ inc()
+ { ++base_type::m_p_e; }
+ };
+
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_BASE_C_DEC
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/const_point_iterator.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/const_point_iterator.hpp
new file mode 100644
index 0000000..d4013db
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/const_point_iterator.hpp
@@ -0,0 +1,144 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file const_point_iterator.hpp
+ * Contains an iterator class returned by the table's const find and insert
+ * methods.
+ */
+
+#ifndef PB_DS_BINARY_HEAP_CONST_FIND_ITERATOR_HPP
+#define PB_DS_BINARY_HEAP_CONST_FIND_ITERATOR_HPP
+
+#include <ext/pb_ds/tag_and_trait.hpp>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ // Const point-type iterator.
+ template<typename Value_Type, typename Entry, bool Simple,
+ typename Allocator>
+ class binary_heap_const_point_iterator_
+ {
+ protected:
+ typedef typename Allocator::template rebind<Entry>::other::pointer entry_pointer;
+
+ public:
+ // Category.
+ typedef trivial_iterator_tag iterator_category;
+
+ // Difference type.
+ typedef trivial_iterator_difference_type difference_type;
+
+ // Iterator's value type.
+ typedef Value_Type value_type;
+
+ // Iterator's pointer type.
+ typedef typename Allocator::template rebind<value_type>::other::pointer
+ pointer;
+
+ // Iterator's const pointer type.
+ typedef
+ typename Allocator::template rebind<value_type>::other::const_pointer
+ const_pointer;
+
+ // Iterator's reference type.
+ typedef
+ typename Allocator::template rebind<value_type>::other::reference
+ reference;
+
+ // Iterator's const reference type.
+ typedef
+ typename Allocator::template rebind<value_type>::other::const_reference
+ const_reference;
+
+ inline
+ binary_heap_const_point_iterator_(entry_pointer p_e) : m_p_e(p_e)
+ { }
+
+ // Default constructor.
+ inline
+ binary_heap_const_point_iterator_() : m_p_e(NULL) { }
+
+ // Copy constructor.
+ inline
+ binary_heap_const_point_iterator_(const binary_heap_const_point_iterator_& other)
+ : m_p_e(other.m_p_e)
+ { }
+
+ // Access.
+ inline const_pointer
+ operator->() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_e != NULL);
+ return to_ptr(integral_constant<int, Simple>());
+ }
+
+ // Access.
+ inline const_reference
+ operator*() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_e != NULL);
+ return *to_ptr(integral_constant<int, Simple>());
+ }
+
+ // Compares content to a different iterator object.
+ inline bool
+ operator==(const binary_heap_const_point_iterator_& other) const
+ { return m_p_e == other.m_p_e; }
+
+ // Compares content (negatively) to a different iterator object.
+ inline bool
+ operator!=(const binary_heap_const_point_iterator_& other) const
+ { return m_p_e != other.m_p_e; }
+
+ private:
+ inline const_pointer
+ to_ptr(true_type) const
+ { return m_p_e; }
+
+ inline const_pointer
+ to_ptr(false_type) const
+ { return *m_p_e; }
+
+ public:
+ entry_pointer m_p_e;
+ };
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/constructors_destructor_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/constructors_destructor_fn_imps.hpp
new file mode 100644
index 0000000..a77a025
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/constructors_destructor_fn_imps.hpp
@@ -0,0 +1,159 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructors_destructor_fn_imps.hpp
+ * Contains an implementation class for binary_heap_.
+ */
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::entry_allocator
+PB_DS_CLASS_C_DEC::s_entry_allocator;
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::value_allocator
+PB_DS_CLASS_C_DEC::s_value_allocator;
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::no_throw_copies_t
+PB_DS_CLASS_C_DEC::s_no_throw_copies_ind;
+
+PB_DS_CLASS_T_DEC
+template<typename It>
+void
+PB_DS_CLASS_C_DEC::
+copy_from_range(It first_it, It last_it)
+{
+ while (first_it != last_it)
+ {
+ insert_value(*first_it, s_no_throw_copies_ind);
+ ++first_it;
+ }
+
+ std::make_heap(m_a_entries, m_a_entries + m_size, static_cast<entry_cmp& >(*this));
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+binary_heap_() :
+ m_size(0),
+ m_actual_size(resize_policy::min_size),
+ m_a_entries(s_entry_allocator.allocate(m_actual_size))
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+binary_heap_(const Cmp_Fn& r_cmp_fn) :
+ entry_cmp(r_cmp_fn),
+ m_size(0),
+ m_actual_size(resize_policy::min_size),
+ m_a_entries(s_entry_allocator.allocate(m_actual_size))
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+binary_heap_(const PB_DS_CLASS_C_DEC& other) :
+ entry_cmp(other),
+ resize_policy(other),
+ m_size(0),
+ m_actual_size(other.m_actual_size),
+ m_a_entries(s_entry_allocator.allocate(m_actual_size))
+{
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ _GLIBCXX_DEBUG_ASSERT(m_a_entries != other.m_a_entries);
+
+ const_iterator first_it = other.begin();
+ const_iterator last_it = other.end();
+
+ __try
+ {
+ while (first_it != last_it)
+ {
+ insert_value(*first_it, s_no_throw_copies_ind);
+ ++first_it;
+ }
+ }
+ __catch(...)
+ {
+ for (size_type i = 0; i < m_size; ++i)
+ erase_at(m_a_entries, i, s_no_throw_copies_ind);
+
+ s_entry_allocator.deallocate(m_a_entries, m_actual_size);
+ __throw_exception_again;
+ }
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ _GLIBCXX_DEBUG_ASSERT(m_a_entries != other.m_a_entries);
+
+ value_swap(other);
+ std::swap((entry_cmp& )(*this), (entry_cmp& )other);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+value_swap(PB_DS_CLASS_C_DEC& other)
+{
+ std::swap(m_a_entries, other.m_a_entries);
+ std::swap(m_size, other.m_size);
+ std::swap(m_actual_size, other.m_actual_size);
+ static_cast<resize_policy*>(this)->swap(other);
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+~binary_heap_()
+{
+ for (size_type i = 0; i < m_size; ++i)
+ erase_at(m_a_entries, i, s_no_throw_copies_ind);
+ s_entry_allocator.deallocate(m_a_entries, m_actual_size);
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/debug_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/debug_fn_imps.hpp
new file mode 100644
index 0000000..fcfecfd
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/debug_fn_imps.hpp
@@ -0,0 +1,72 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_fn_imps.hpp
+ * Contains an implementation class for a binary_heap.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_valid() const
+{
+#ifdef PB_DS_REGRESSION
+ s_entry_allocator.check_allocated(m_a_entries, m_actual_size);
+#endif
+
+ resize_policy::assert_valid();
+ _GLIBCXX_DEBUG_ASSERT(m_size <= m_actual_size);
+ for (size_type i = 0; i < m_size; ++i)
+ {
+#ifdef PB_DS_REGRESSION
+ s_value_allocator.check_allocated(m_a_entries[i], 1);
+#endif
+
+ if (left_child(i) < m_size)
+ _GLIBCXX_DEBUG_ASSERT(!entry_cmp::operator()(m_a_entries[i], m_a_entries[left_child(i)]));
+
+ _GLIBCXX_DEBUG_ASSERT(parent(left_child(i)) == i);
+
+ if (right_child(i) < m_size)
+ _GLIBCXX_DEBUG_ASSERT(!entry_cmp::operator()(m_a_entries[i], m_a_entries[right_child(i)]));
+
+ _GLIBCXX_DEBUG_ASSERT(parent(right_child(i)) == i);
+ }
+}
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/entry_cmp.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/entry_cmp.hpp
new file mode 100644
index 0000000..b0a9b5b
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/entry_cmp.hpp
@@ -0,0 +1,93 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file entry_cmp.hpp
+ * Contains an implementation class for a binary_heap.
+ */
+
+#ifndef PB_DS_BINARY_HEAP_ENTRY_CMP_HPP
+#define PB_DS_BINARY_HEAP_ENTRY_CMP_HPP
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+ template<typename Value_Type,
+ class Cmp_Fn,
+ bool No_Throw,
+ class Allocator>
+ struct entry_cmp
+ {
+ typedef Cmp_Fn type;
+ };
+
+ template<typename Value_Type, class Cmp_Fn, class Allocator>
+ struct entry_cmp<
+ Value_Type,
+ Cmp_Fn,
+ false,
+ Allocator>
+ {
+ public:
+ typedef
+ typename Allocator::template rebind<
+ Value_Type>::other::const_pointer
+ entry;
+
+ struct type : public Cmp_Fn
+ {
+ public:
+ inline
+ type()
+ { }
+
+ inline
+ type(const Cmp_Fn& other) : Cmp_Fn(other)
+ { }
+
+ inline bool
+ operator()(entry p_lhs, entry p_rhs) const
+ {
+ return Cmp_Fn::operator()(*p_lhs, * p_rhs);
+ }
+ };
+ };
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_BINARY_HEAP_ENTRY_CMP_HPP
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/entry_pred.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/entry_pred.hpp
new file mode 100644
index 0000000..185529e
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/entry_pred.hpp
@@ -0,0 +1,93 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file entry_pred.hpp
+ * Contains an implementation class for a binary_heap.
+ */
+
+#ifndef PB_DS_BINARY_HEAP_ENTRY_PRED_HPP
+#define PB_DS_BINARY_HEAP_ENTRY_PRED_HPP
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+ template<typename Value_Type,
+ class Pred,
+ bool No_Throw,
+ class Allocator>
+ struct entry_pred
+ {
+ typedef Pred type;
+ };
+
+ template<typename Value_Type, class Pred, class Allocator>
+ struct entry_pred<
+ Value_Type,
+ Pred,
+ false,
+ Allocator>
+ {
+ public:
+ typedef
+ typename Allocator::template rebind<
+ Value_Type>::other::const_pointer
+ entry;
+
+ struct type : public Pred
+ {
+ public:
+ inline
+ type()
+ { }
+
+ inline
+ type(const Pred& other) : Pred(other)
+ { }
+
+ inline bool
+ operator()(entry p_v) const
+ {
+ return Pred::operator()(*p_v);
+ }
+ };
+ };
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_BINARY_HEAP_ENTRY_PRED_HPP
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/erase_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/erase_fn_imps.hpp
new file mode 100644
index 0000000..30f3a48
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/erase_fn_imps.hpp
@@ -0,0 +1,246 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file erase_fn_imps.hpp
+ * Contains an implementation class for a binary_heap.
+ */
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+clear()
+{
+ for (size_type i = 0; i < m_size; ++i)
+ erase_at(m_a_entries, i, s_no_throw_copies_ind);
+
+ __try
+ {
+ const size_type actual_size = resize_policy::get_new_size_for_arbitrary(0);
+
+ entry_pointer a_entries = s_entry_allocator.allocate(actual_size);
+
+ resize_policy::notify_arbitrary(actual_size);
+
+ s_entry_allocator.deallocate(m_a_entries, m_actual_size);
+
+ m_actual_size = actual_size;
+
+ m_a_entries = a_entries;
+ }
+ __catch(...)
+ { }
+
+ m_size = 0;
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+erase_at(entry_pointer a_entries, size_type i, false_type)
+{
+ a_entries[i]->~value_type();
+
+ s_value_allocator.deallocate(a_entries[i], 1);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+erase_at(entry_pointer, size_type, true_type)
+{ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+pop()
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ASSERT(!empty());
+
+ erase_at(m_a_entries, 0, s_no_throw_copies_ind);
+
+ std::pop_heap(m_a_entries, m_a_entries + m_size, static_cast<entry_cmp& >(*this));
+
+ resize_for_erase_if_needed();
+
+ _GLIBCXX_DEBUG_ASSERT(m_size > 0);
+ --m_size;
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+erase_if(Pred pred)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ typedef
+ typename entry_pred<
+ value_type,
+ Pred,
+ simple_value,
+ Allocator>::type
+ pred_t;
+
+ const size_type left = partition(pred_t(pred));
+
+ _GLIBCXX_DEBUG_ASSERT(m_size >= left);
+
+ const size_type ersd = m_size - left;
+
+ for (size_type i = left; i < m_size; ++i)
+ erase_at(m_a_entries, i, s_no_throw_copies_ind);
+
+ __try
+ {
+ const size_type actual_size =
+ resize_policy::get_new_size_for_arbitrary(left);
+
+ entry_pointer a_entries = s_entry_allocator.allocate(actual_size);
+
+ std::copy(m_a_entries, m_a_entries + left, a_entries);
+
+ s_entry_allocator.deallocate(m_a_entries, m_actual_size);
+
+ m_actual_size = actual_size;
+
+ resize_policy::notify_arbitrary(m_actual_size);
+ }
+ __catch(...)
+ { };
+
+ m_size = left;
+
+ std::make_heap(m_a_entries, m_a_entries + m_size, static_cast<entry_cmp& >(*this));
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ return ersd;
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+erase(point_iterator it)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ASSERT(!empty());
+
+ const size_type fix_pos = it.m_p_e - m_a_entries;
+
+ std::swap(*it.m_p_e, m_a_entries[m_size - 1]);
+
+ erase_at(m_a_entries, m_size - 1, s_no_throw_copies_ind);
+
+ resize_for_erase_if_needed();
+
+ _GLIBCXX_DEBUG_ASSERT(m_size > 0);
+ --m_size;
+
+ _GLIBCXX_DEBUG_ASSERT(fix_pos <= m_size);
+
+ if (fix_pos != m_size)
+ fix(m_a_entries + fix_pos);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+resize_for_erase_if_needed()
+{
+ if (!resize_policy::resize_needed_for_shrink(m_size))
+ return;
+
+ __try
+ {
+ const size_type new_actual_size =
+ resize_policy::get_new_size_for_shrink();
+
+ entry_pointer a_new_entries = s_entry_allocator.allocate(new_actual_size);
+
+ resize_policy::notify_shrink_resize();
+
+ _GLIBCXX_DEBUG_ASSERT(m_size > 0);
+ std::copy(m_a_entries, m_a_entries + m_size - 1, a_new_entries);
+
+ s_entry_allocator.deallocate(m_a_entries, m_actual_size);
+
+ m_actual_size = new_actual_size;
+
+ m_a_entries = a_new_entries;
+ }
+ __catch(...)
+ { }
+}
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+partition(Pred pred)
+{
+ size_type left = 0;
+ size_type right = m_size - 1;
+
+ while (right + 1 != left)
+ {
+ _GLIBCXX_DEBUG_ASSERT(left <= m_size);
+
+ if (!pred(m_a_entries[left]))
+ ++left;
+ else if (pred(m_a_entries[right]))
+ --right;
+ else
+ {
+ _GLIBCXX_DEBUG_ASSERT(left < right);
+
+ std::swap(m_a_entries[left], m_a_entries[right]);
+
+ ++left;
+ --right;
+ }
+ }
+
+ return left;
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/find_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/find_fn_imps.hpp
new file mode 100644
index 0000000..28d4a8c
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/find_fn_imps.hpp
@@ -0,0 +1,91 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file find_fn_imps.hpp
+ * Contains an implementation class for a binary_heap.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_reference
+PB_DS_CLASS_C_DEC::
+top() const
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ASSERT(!empty());
+
+ return top_imp(s_no_throw_copies_ind);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_reference
+PB_DS_CLASS_C_DEC::
+top_imp(true_type) const
+{
+ return* m_a_entries;
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_reference
+PB_DS_CLASS_C_DEC::
+top_imp(false_type) const
+{
+ return** m_a_entries;
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+left_child(size_type i)
+{
+ return i* 2 + 1;
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+right_child(size_type i)
+{
+ return i* 2 + 2;
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+parent(size_type i)
+{
+ return (i - 1) / 2;
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/info_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/info_fn_imps.hpp
new file mode 100644
index 0000000..d292793
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/info_fn_imps.hpp
@@ -0,0 +1,64 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file info_fn_imps.hpp
+ * Contains an implementation class for a binary_heap.
+ */
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+empty() const
+{
+ return (m_size == 0);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+size() const
+{
+ return (m_size);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+max_size() const
+{
+ return (s_entry_allocator.max_size());
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/insert_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/insert_fn_imps.hpp
new file mode 100644
index 0000000..f13a3cb
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/insert_fn_imps.hpp
@@ -0,0 +1,183 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file insert_fn_imps.hpp
+ * Contains an implementation class for a binary_heap.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::point_iterator
+PB_DS_CLASS_C_DEC::
+push(const_reference r_val)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ insert_value(r_val, s_no_throw_copies_ind);
+ std::push_heap(m_a_entries, m_a_entries + m_size,
+ static_cast<entry_cmp&>(*this));
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return point_iterator(m_a_entries);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+insert_value(value_type val, true_type)
+{
+ resize_for_insert_if_needed();
+
+ m_a_entries[m_size++] = val;
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+insert_value(const_reference r_val, false_type)
+{
+ resize_for_insert_if_needed();
+ pointer p_new = s_value_allocator.allocate(1);
+ cond_dealtor_t cond(p_new);
+ new (p_new) value_type(r_val);
+ cond.set_no_action();
+ m_a_entries[m_size++] = p_new;
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+insert_entry(entry e)
+{
+ resize_for_insert_if_needed();
+ m_a_entries[m_size++] = e;
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+resize_for_insert_if_needed()
+{
+ if (!resize_policy::resize_needed_for_grow(m_size))
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_size < m_actual_size);
+ return;
+ }
+
+ const size_type new_actual_size = resize_policy::get_new_size_for_grow();
+ entry_pointer a_new_entries = s_entry_allocator.allocate(new_actual_size);
+ resize_policy::notify_grow_resize();
+ std::copy(m_a_entries, m_a_entries + m_size, a_new_entries);
+ s_entry_allocator.deallocate(m_a_entries, m_actual_size);
+ m_actual_size = new_actual_size;
+ m_a_entries = a_new_entries;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+modify(point_iterator it, const_reference r_new_val)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ swap_value_imp(it.m_p_e, r_new_val, s_no_throw_copies_ind);
+ fix(it.m_p_e);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+fix(entry_pointer p_e)
+{
+ size_type i = p_e - m_a_entries;
+ if (i > 0 && entry_cmp::operator()(m_a_entries[parent(i)], m_a_entries[i]))
+ {
+ size_type parent_i = parent(i);
+ while (i > 0
+ && entry_cmp::operator()(m_a_entries[parent_i], m_a_entries[i]))
+ {
+ std::swap(m_a_entries[i], m_a_entries[parent_i]);
+ i = parent_i;
+ parent_i = parent(i);
+ }
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return;
+ }
+
+ while (i < m_size)
+ {
+ const size_type left_child_i = left_child(i);
+ const size_type right_child_i = right_child(i);
+ _GLIBCXX_DEBUG_ASSERT(right_child_i > left_child_i);
+ const bool smaller_than_left_child = left_child_i < m_size &&
+ entry_cmp::operator()(m_a_entries[i], m_a_entries[left_child_i]);
+
+ const bool smaller_than_right_child = right_child_i < m_size &&
+ entry_cmp::operator()(m_a_entries[i], m_a_entries[right_child_i]);
+
+ const bool swap_with_r_child = smaller_than_right_child && (!smaller_than_left_child || entry_cmp::operator()(m_a_entries[left_child_i], m_a_entries[right_child_i]));
+
+ const bool swap_with_l_child = !swap_with_r_child && smaller_than_left_child;
+
+ if (swap_with_l_child)
+ {
+ std::swap(m_a_entries[i], m_a_entries[left_child_i]);
+ i = left_child_i;
+ }
+ else if (swap_with_r_child)
+ {
+ std::swap(m_a_entries[i], m_a_entries[right_child_i]);
+ i = right_child_i;
+ }
+ else
+ i = m_size;
+ }
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+swap_value_imp(entry_pointer p_e, value_type new_val, true_type)
+{
+ * p_e = new_val;
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+swap_value_imp(entry_pointer p_e, const_reference r_new_val, false_type)
+{
+ value_type tmp(r_new_val);
+ (*p_e)->swap(tmp);
+}
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/iterators_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/iterators_fn_imps.hpp
new file mode 100644
index 0000000..db0a64e
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/iterators_fn_imps.hpp
@@ -0,0 +1,72 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file iterators_fn_imps.hpp
+ * Contains an implementation class for a binary_heap.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+begin()
+{
+ return (iterator(m_a_entries));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+begin() const
+{
+ return (const_iterator(m_a_entries));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+end()
+{
+ return (iterator(m_a_entries + m_size));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+end() const
+{
+ return (const_iterator(m_a_entries + m_size));
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/policy_access_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/policy_access_fn_imps.hpp
new file mode 100644
index 0000000..11a7b89
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/policy_access_fn_imps.hpp
@@ -0,0 +1,56 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file policy_access_fn_imps.hpp
+ * Contains an implementation class for a binary_heap.
+ */
+
+PB_DS_CLASS_T_DEC
+Cmp_Fn&
+PB_DS_CLASS_C_DEC::
+get_cmp_fn()
+{
+ return (*this);
+}
+
+PB_DS_CLASS_T_DEC
+const Cmp_Fn&
+PB_DS_CLASS_C_DEC::
+get_cmp_fn() const
+{
+ return (*this);
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/resize_policy.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/resize_policy.hpp
new file mode 100644
index 0000000..588fb3d
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/resize_policy.hpp
@@ -0,0 +1,253 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file resize_policy.hpp
+ * Contains an implementation class for a binary_heap.
+ */
+
+#ifndef PB_DS_BINARY_HEAP_RESIZE_POLICY_HPP
+#define PB_DS_BINARY_HEAP_RESIZE_POLICY_HPP
+
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_CLASS_T_DEC template<typename Size_Type>
+
+#define PB_DS_CLASS_C_DEC resize_policy<Size_Type>
+
+ template<typename Size_Type>
+ class resize_policy
+ {
+ public:
+ typedef Size_Type size_type;
+
+ enum
+ {
+ min_size = 16
+ };
+
+ public:
+ inline
+ resize_policy();
+
+ inline void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ inline bool
+ resize_needed_for_grow(size_type size) const;
+
+ inline bool
+ resize_needed_for_shrink(size_type size) const;
+
+ inline bool
+ grow_needed(size_type size) const;
+
+ inline bool
+ shrink_needed(size_type size) const;
+
+ inline size_type
+ get_new_size_for_grow() const;
+
+ inline size_type
+ get_new_size_for_shrink() const;
+
+ size_type
+ get_new_size_for_arbitrary(size_type size) const;
+
+ inline void
+ notify_grow_resize();
+
+ inline void
+ notify_shrink_resize();
+
+ void
+ notify_arbitrary(size_type actual_size);
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid() const;
+#endif
+
+#ifdef PB_DS_BINARY_HEAP_TRACE_
+ void
+ trace() const;
+#endif
+
+ private:
+ enum
+ {
+ ratio = 8,
+ factor = 2
+ };
+
+ private:
+ size_type m_next_shrink_size;
+ size_type m_next_grow_size;
+ };
+
+ PB_DS_CLASS_T_DEC
+ inline
+ PB_DS_CLASS_C_DEC::
+ resize_policy() :
+ m_next_shrink_size(0),
+ m_next_grow_size(min_size)
+ { _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+ PB_DS_CLASS_T_DEC
+ inline void
+ PB_DS_CLASS_C_DEC::
+ swap(PB_DS_CLASS_C_DEC& other)
+ {
+ std::swap(m_next_shrink_size, other.m_next_shrink_size);
+ std::swap(m_next_grow_size, other.m_next_grow_size);
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline bool
+ PB_DS_CLASS_C_DEC::
+ resize_needed_for_grow(size_type size) const
+ {
+ _GLIBCXX_DEBUG_ASSERT(size <= m_next_grow_size);
+ return size == m_next_grow_size;
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline bool
+ PB_DS_CLASS_C_DEC::
+ resize_needed_for_shrink(size_type size) const
+ {
+ _GLIBCXX_DEBUG_ASSERT(size <= m_next_grow_size);
+ return size == m_next_shrink_size;
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::size_type
+ PB_DS_CLASS_C_DEC::
+ get_new_size_for_grow() const
+ { return m_next_grow_size* factor; }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::size_type
+ PB_DS_CLASS_C_DEC::
+ get_new_size_for_shrink() const
+ {
+ const size_type half_size = m_next_grow_size / factor;
+ return std::max(static_cast<size_type>(min_size), half_size);
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::size_type
+ PB_DS_CLASS_C_DEC::
+ get_new_size_for_arbitrary(size_type size) const
+ {
+ size_type ret = min_size;
+ while (ret < size)
+ ret *= factor;
+ return ret;
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline void
+ PB_DS_CLASS_C_DEC::
+ notify_grow_resize()
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ASSERT(m_next_grow_size >= min_size);
+ m_next_grow_size *= factor;
+ m_next_shrink_size = m_next_grow_size / ratio;
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline void
+ PB_DS_CLASS_C_DEC::
+ notify_shrink_resize()
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ m_next_shrink_size /= factor;
+ if (m_next_shrink_size == 1)
+ m_next_shrink_size = 0;
+
+ m_next_grow_size =
+ std::max(m_next_grow_size / factor, static_cast<size_type>(min_size));
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline void
+ PB_DS_CLASS_C_DEC::
+ notify_arbitrary(size_type actual_size)
+ {
+ m_next_grow_size = actual_size;
+ m_next_shrink_size = m_next_grow_size / ratio;
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+#ifdef _GLIBCXX_DEBUG
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ assert_valid() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_next_shrink_size == 0 ||
+ m_next_shrink_size* ratio == m_next_grow_size);
+
+ _GLIBCXX_DEBUG_ASSERT(m_next_grow_size >= min_size);
+ }
+#endif
+
+#ifdef PB_DS_BINARY_HEAP_TRACE_
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ trace() const
+ {
+ std::cerr << "shrink = " << m_next_shrink_size <<
+ " grow = " << m_next_grow_size << std::endl;
+ }
+#endif
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+} // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/split_join_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/split_join_fn_imps.hpp
new file mode 100644
index 0000000..04b7d54
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/split_join_fn_imps.hpp
@@ -0,0 +1,172 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file split_join_fn_imps.hpp
+ * Contains an implementation class for a binary_heap.
+ */
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+void
+PB_DS_CLASS_C_DEC::
+split(Pred pred, PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ typedef
+ typename entry_pred<
+ value_type,
+ Pred,
+ simple_value,
+ Allocator>::type
+ pred_t;
+
+ const size_type left = partition(pred_t(pred));
+
+ _GLIBCXX_DEBUG_ASSERT(m_size >= left);
+
+ const size_type ersd = m_size - left;
+
+ _GLIBCXX_DEBUG_ASSERT(m_size >= ersd);
+
+ const size_type actual_size =
+ resize_policy::get_new_size_for_arbitrary(left);
+
+ const size_type other_actual_size =
+ other.get_new_size_for_arbitrary(ersd);
+
+ entry_pointer a_entries = NULL;
+ entry_pointer a_other_entries = NULL;
+
+ __try
+ {
+ a_entries = s_entry_allocator.allocate(actual_size);
+
+ a_other_entries = s_entry_allocator.allocate(other_actual_size);
+ }
+ __catch(...)
+ {
+ if (a_entries != NULL)
+ s_entry_allocator.deallocate(a_entries, actual_size);
+
+ if (a_other_entries != NULL)
+ s_entry_allocator.deallocate(a_other_entries, other_actual_size);
+
+ __throw_exception_again;
+ };
+
+ for (size_type i = 0; i < other.m_size; ++i)
+ erase_at(other.m_a_entries, i, s_no_throw_copies_ind);
+
+ _GLIBCXX_DEBUG_ASSERT(actual_size >= left);
+ std::copy(m_a_entries, m_a_entries + left, a_entries);
+ std::copy(m_a_entries + left, m_a_entries + m_size, a_other_entries);
+
+ s_entry_allocator.deallocate(m_a_entries, m_actual_size);
+ s_entry_allocator.deallocate(other.m_a_entries, other.m_actual_size);
+
+ m_actual_size = actual_size;
+ other.m_actual_size = other_actual_size;
+
+ m_size = left;
+ other.m_size = ersd;
+
+ m_a_entries = a_entries;
+ other.m_a_entries = a_other_entries;
+
+ std::make_heap(m_a_entries, m_a_entries + m_size, static_cast<entry_cmp& >(*this));
+ std::make_heap(other.m_a_entries, other.m_a_entries + other.m_size, static_cast<entry_cmp& >(other));
+
+ resize_policy::notify_arbitrary(m_actual_size);
+ other.notify_arbitrary(other.m_actual_size);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+join(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+
+ const size_type len = m_size + other.m_size;
+ const size_type actual_size = resize_policy::get_new_size_for_arbitrary(len);
+
+ entry_pointer a_entries = NULL;
+ entry_pointer a_other_entries = NULL;
+
+ __try
+ {
+ a_entries = s_entry_allocator.allocate(actual_size);
+ a_other_entries = s_entry_allocator.allocate(resize_policy::min_size);
+ }
+ __catch(...)
+ {
+ if (a_entries != NULL)
+ s_entry_allocator.deallocate(a_entries, actual_size);
+
+ if (a_other_entries != NULL)
+ s_entry_allocator.deallocate(a_other_entries, resize_policy::min_size);
+
+ __throw_exception_again;
+ }
+
+ std::copy(m_a_entries, m_a_entries + m_size, a_entries);
+ std::copy(other.m_a_entries, other.m_a_entries + other.m_size, a_entries + m_size);
+
+ s_entry_allocator.deallocate(m_a_entries, m_actual_size);
+ m_a_entries = a_entries;
+ m_size = len;
+ m_actual_size = actual_size;
+
+ resize_policy::notify_arbitrary(actual_size);
+
+ std::make_heap(m_a_entries, m_a_entries + m_size, static_cast<entry_cmp& >(*this));
+
+ s_entry_allocator.deallocate(other.m_a_entries, other.m_actual_size);
+ other.m_a_entries = a_other_entries;
+ other.m_size = 0;
+ other.m_actual_size = resize_policy::min_size;
+
+ other.notify_arbitrary(resize_policy::min_size);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/trace_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/trace_fn_imps.hpp
new file mode 100644
index 0000000..36bd66f
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binary_heap_/trace_fn_imps.hpp
@@ -0,0 +1,78 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file trace_fn_imps.hpp
+ * Contains an implementation class for a binary_heap.
+ */
+
+#ifdef PB_DS_BINARY_HEAP_TRACE_
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+trace() const
+{
+ std::cerr << this << std::endl;
+
+ std::cerr << m_a_entries << std::endl;
+
+ for (size_type i = 0; i < m_size; ++i)
+ trace_entry(m_a_entries[i], s_no_throw_copies_ind);
+
+ std::cerr << std::endl;
+
+ std::cerr << "size = " << m_size << " " << "actual_size = " << m_actual_size << std::endl;
+
+ resize_policy::trace();
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+trace_entry(const entry& r_e, false_type) const
+{
+ std::cout << r_e << " " <<* r_e << std::endl;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+trace_entry(const entry& r_e, true_type) const
+{
+ std::cout << r_e << std::endl;
+}
+
+#endif // #ifdef PB_DS_BINARY_HEAP_TRACE_
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_/binomial_heap_.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_/binomial_heap_.hpp
new file mode 100644
index 0000000..3b4d6e9
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_/binomial_heap_.hpp
@@ -0,0 +1,116 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file binomial_heap_.hpp
+ * Contains an implementation class for a binomial heap.
+ */
+
+/*
+ * Binomial heap.
+ * Vuillemin J is the mastah.
+ * Modified from CLRS.
+ */
+
+#include <debug/debug.h>
+#include <ext/pb_ds/detail/cond_dealtor.hpp>
+#include <ext/pb_ds/detail/type_utils.hpp>
+#include <ext/pb_ds/detail/binomial_heap_base_/binomial_heap_base_.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Value_Type, class Cmp_Fn, class Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ binomial_heap_<Value_Type, Cmp_Fn, Allocator>
+
+#define PB_DS_BASE_C_DEC \
+ binomial_heap_base_<Value_Type, Cmp_Fn, Allocator>
+
+ /**
+ * class description = "8y|\|0|\/|i41 h34p 74813">
+ **/
+ template<typename Value_Type, class Cmp_Fn, class Allocator>
+ class binomial_heap_ : public PB_DS_BASE_C_DEC
+ {
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+ typedef typename base_type::node_pointer node_pointer;
+ typedef typename base_type::const_node_pointer const_node_pointer;
+
+ public:
+ typedef Value_Type value_type;
+ typedef typename Allocator::size_type size_type;
+ typedef typename Allocator::difference_type difference_type;
+ typedef typename base_type::pointer pointer;
+ typedef typename base_type::const_pointer const_pointer;
+ typedef typename base_type::reference reference;
+ typedef typename base_type::const_reference const_reference;
+ typedef typename base_type::const_point_iterator const_point_iterator;
+ typedef typename base_type::point_iterator point_iterator;
+ typedef typename base_type::const_iterator const_iterator;
+ typedef typename base_type::iterator iterator;
+ typedef typename base_type::cmp_fn cmp_fn;
+ typedef typename base_type::allocator_type allocator_type;
+
+ binomial_heap_();
+
+ binomial_heap_(const Cmp_Fn& r_cmp_fn);
+
+ binomial_heap_(const PB_DS_CLASS_C_DEC& other);
+
+ ~binomial_heap_();
+
+ protected:
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid() const;
+#endif
+ };
+
+#include <ext/pb_ds/detail/binomial_heap_/constructors_destructor_fn_imps.hpp>
+#include <ext/pb_ds/detail/binomial_heap_/debug_fn_imps.hpp>
+
+#undef PB_DS_CLASS_C_DEC
+
+#undef PB_DS_CLASS_T_DEC
+
+#undef PB_DS_BASE_C_DEC
+ } // namespace detail
+} // namespace __gnu_pbds
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_/constructors_destructor_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_/constructors_destructor_fn_imps.hpp
new file mode 100644
index 0000000..ef0937e
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_/constructors_destructor_fn_imps.hpp
@@ -0,0 +1,61 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructors_destructor_fn_imps.hpp
+ * Contains an implementation for binomial_heap_.
+ */
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+binomial_heap_()
+{ _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+binomial_heap_(const Cmp_Fn& r_cmp_fn) :
+ PB_DS_BASE_C_DEC(r_cmp_fn)
+{ _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+binomial_heap_(const PB_DS_CLASS_C_DEC& other) :
+ PB_DS_BASE_C_DEC(other)
+{ _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+~binomial_heap_() { }
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_/debug_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_/debug_fn_imps.hpp
new file mode 100644
index 0000000..10bec69
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_/debug_fn_imps.hpp
@@ -0,0 +1,49 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_fn_imps.hpp
+ * Contains an implementation for binomial_heap_.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_valid() const
+{ base_type::assert_valid(true); }
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_base_/binomial_heap_base_.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_base_/binomial_heap_base_.hpp
new file mode 100644
index 0000000..1d66d1b
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_base_/binomial_heap_base_.hpp
@@ -0,0 +1,234 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file binomial_heap_base_.hpp
+ * Contains an implementation class for a base of binomial heaps.
+ */
+
+#ifndef PB_DS_BINOMIAL_HEAP_BASE_HPP
+#define PB_DS_BINOMIAL_HEAP_BASE_HPP
+
+/*
+ * Binomial heap base.
+ * Vuillemin J is the mastah.
+ * Modified from CLRS.
+ */
+
+#include <debug/debug.h>
+#include <ext/pb_ds/detail/cond_dealtor.hpp>
+#include <ext/pb_ds/detail/type_utils.hpp>
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp>
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/null_metadata.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Value_Type, class Cmp_Fn, class Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ binomial_heap_base_<Value_Type, Cmp_Fn, Allocator>
+
+#ifdef _GLIBCXX_DEBUG
+#define PB_DS_BASE_C_DEC \
+ left_child_next_sibling_heap_<Value_Type, Cmp_Fn, \
+ typename Allocator::size_type, \
+ Allocator, false>
+#else
+#define PB_DS_BASE_C_DEC \
+ left_child_next_sibling_heap_<Value_Type, Cmp_Fn, \
+ typename Allocator::size_type, Allocator>
+#endif
+
+ /**
+ * class description = "8y|\|0|\/|i41 h34p 74813">
+ **/
+ template<typename Value_Type, class Cmp_Fn, class Allocator>
+ class binomial_heap_base_ : public PB_DS_BASE_C_DEC
+ {
+
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ protected:
+ typedef typename base_type::node node;
+
+ typedef typename base_type::node_pointer node_pointer;
+
+ typedef typename base_type::const_node_pointer const_node_pointer;
+
+ public:
+
+ typedef typename Allocator::size_type size_type;
+
+ typedef typename Allocator::difference_type difference_type;
+
+ typedef Value_Type value_type;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::pointer
+ pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::const_pointer
+ const_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::reference
+ reference;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::const_reference
+ const_reference;
+
+ typedef
+ typename PB_DS_BASE_C_DEC::const_point_iterator
+ const_point_iterator;
+
+ typedef typename PB_DS_BASE_C_DEC::point_iterator point_iterator;
+
+ typedef typename PB_DS_BASE_C_DEC::const_iterator const_iterator;
+
+ typedef typename PB_DS_BASE_C_DEC::iterator iterator;
+
+ typedef Cmp_Fn cmp_fn;
+
+ typedef Allocator allocator_type;
+
+ public:
+
+ inline point_iterator
+ push(const_reference r_val);
+
+ void
+ modify(point_iterator it, const_reference r_new_val);
+
+ inline const_reference
+ top() const;
+
+ void
+ pop();
+
+ void
+ erase(point_iterator it);
+
+ inline void
+ clear();
+
+ template<typename Pred>
+ size_type
+ erase_if(Pred pred);
+
+ template<typename Pred>
+ void
+ split(Pred pred, PB_DS_CLASS_C_DEC& other);
+
+ void
+ join(PB_DS_CLASS_C_DEC& other);
+
+ protected:
+
+ binomial_heap_base_();
+
+ binomial_heap_base_(const Cmp_Fn& r_cmp_fn);
+
+ binomial_heap_base_(const PB_DS_CLASS_C_DEC& other);
+
+ void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ ~binomial_heap_base_();
+
+ template<typename It>
+ void
+ copy_from_range(It first_it, It last_it);
+
+ inline void
+ find_max();
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid(bool strictly_binomial) const;
+
+ void
+ assert_max() const;
+#endif
+
+ private:
+
+ inline node_pointer
+ fix(node_pointer p_nd) const;
+
+ inline void
+ insert_node(node_pointer p_nd);
+
+ inline void
+ remove_parentless_node(node_pointer p_nd);
+
+ inline node_pointer
+ join(node_pointer p_lhs, node_pointer p_rhs) const;
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_node_consistent(const_node_pointer, bool, bool) const;
+#endif
+
+ protected:
+ node_pointer m_p_max;
+ };
+
+#include <ext/pb_ds/detail/binomial_heap_base_/constructors_destructor_fn_imps.hpp>
+#include <ext/pb_ds/detail/binomial_heap_base_/debug_fn_imps.hpp>
+#include <ext/pb_ds/detail/binomial_heap_base_/find_fn_imps.hpp>
+#include <ext/pb_ds/detail/binomial_heap_base_/insert_fn_imps.hpp>
+#include <ext/pb_ds/detail/binomial_heap_base_/erase_fn_imps.hpp>
+#include <ext/pb_ds/detail/binomial_heap_base_/split_join_fn_imps.hpp>
+
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_BASE_C_DEC
+
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_base_/constructors_destructor_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_base_/constructors_destructor_fn_imps.hpp
new file mode 100644
index 0000000..274c933
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_base_/constructors_destructor_fn_imps.hpp
@@ -0,0 +1,97 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructors_destructor_fn_imps.hpp
+ * Contains an implementation class for a base of binomial heaps.
+ */
+
+PB_DS_CLASS_T_DEC
+template<typename It>
+void
+PB_DS_CLASS_C_DEC::
+copy_from_range(It first_it, It last_it)
+{
+ while (first_it != last_it)
+ push(*(first_it++));
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid(false);)
+ }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+binomial_heap_base_() :
+ m_p_max(NULL)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid(false);)
+ }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+binomial_heap_base_(const Cmp_Fn& r_cmp_fn) :
+ PB_DS_BASE_C_DEC(r_cmp_fn),
+ m_p_max(NULL)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid(false);)
+ }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+binomial_heap_base_(const PB_DS_CLASS_C_DEC& other) :
+ PB_DS_BASE_C_DEC(other),
+ m_p_max(NULL)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid(false);)
+ }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid(false);)
+
+ base_type::swap(other);
+
+ std::swap(m_p_max, other.m_p_max);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid(false);)
+ }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+~binomial_heap_base_()
+{ }
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_base_/debug_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_base_/debug_fn_imps.hpp
new file mode 100644
index 0000000..9a07f0e
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_base_/debug_fn_imps.hpp
@@ -0,0 +1,98 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_fn_imps.hpp
+ * Contains an implementation class for a base of binomial heaps.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_valid(bool strictly_binomial) const
+{
+ base_type::assert_valid();
+ assert_node_consistent(base_type::m_p_root, strictly_binomial, true);
+ assert_max();
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_max() const
+{
+ if (m_p_max == NULL)
+ return;
+ _GLIBCXX_DEBUG_ASSERT(base_type::parent(m_p_max) == NULL);
+ for (const_iterator it = base_type::begin(); it != base_type::end(); ++it)
+ _GLIBCXX_DEBUG_ASSERT(!Cmp_Fn::operator()(m_p_max->m_value,
+ it.m_p_nd->m_value));
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_node_consistent(const_node_pointer p_nd, bool strictly_binomial,
+ bool increasing) const
+{
+ _GLIBCXX_DEBUG_ASSERT(increasing || strictly_binomial);
+ base_type::assert_node_consistent(p_nd, false);
+ if (p_nd == NULL)
+ return;
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_metadata == base_type::degree(p_nd));
+ _GLIBCXX_DEBUG_ASSERT(base_type::size_under_node(p_nd) ==
+ static_cast<size_type>(1 << p_nd->m_metadata));
+ assert_node_consistent(p_nd->m_p_next_sibling, strictly_binomial, increasing);
+ assert_node_consistent(p_nd->m_p_l_child, true, false);
+ if (p_nd->m_p_next_sibling != NULL)
+ {
+ if (increasing)
+ {
+ if (strictly_binomial)
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_metadata
+ < p_nd->m_p_next_sibling->m_metadata);
+ else
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_metadata
+ <= p_nd->m_p_next_sibling->m_metadata);
+ }
+ else
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_metadata
+ > p_nd->m_p_next_sibling->m_metadata);
+ }
+}
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_base_/erase_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_base_/erase_fn_imps.hpp
new file mode 100644
index 0000000..a4cf90c
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_base_/erase_fn_imps.hpp
@@ -0,0 +1,192 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file erase_fn_imps.hpp
+ * Contains an implementation class for a base of binomial heaps.
+ */
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+pop()
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true);)
+ _GLIBCXX_DEBUG_ASSERT(!base_type::empty());
+
+ if (m_p_max == NULL)
+ find_max();
+
+ _GLIBCXX_DEBUG_ASSERT(m_p_max != NULL);
+
+ node_pointer p_nd = m_p_max;
+
+ remove_parentless_node(m_p_max);
+
+ base_type::actual_erase_node(p_nd);
+
+ m_p_max = NULL;
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true);)
+ }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+remove_parentless_node(node_pointer p_nd)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_nd != NULL);
+ _GLIBCXX_DEBUG_ASSERT(base_type::parent(p_nd) == NULL);
+
+ node_pointer p_cur_root = p_nd == base_type::m_p_root?
+ p_nd->m_p_next_sibling :
+ base_type::m_p_root;
+
+ if (p_cur_root != NULL)
+ p_cur_root->m_p_prev_or_parent = NULL;
+
+ if (p_nd->m_p_prev_or_parent != NULL)
+ p_nd->m_p_prev_or_parent->m_p_next_sibling = p_nd->m_p_next_sibling;
+
+ if (p_nd->m_p_next_sibling != NULL)
+ p_nd->m_p_next_sibling->m_p_prev_or_parent = p_nd->m_p_prev_or_parent;
+
+ node_pointer p_child = p_nd->m_p_l_child;
+
+ if (p_child != NULL)
+ {
+ p_child->m_p_prev_or_parent = NULL;
+
+ while (p_child->m_p_next_sibling != NULL)
+ p_child = p_child->m_p_next_sibling;
+ }
+
+ m_p_max = NULL;
+
+ base_type::m_p_root = join(p_cur_root, p_child);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+clear()
+{
+ base_type::clear();
+
+ m_p_max = NULL;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+erase(point_iterator it)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true);)
+ _GLIBCXX_DEBUG_ASSERT(!base_type::empty());
+
+ base_type::bubble_to_top(it.m_p_nd);
+
+ remove_parentless_node(it.m_p_nd);
+
+ base_type::actual_erase_node(it.m_p_nd);
+
+ m_p_max = NULL;
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true);)
+ }
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+erase_if(Pred pred)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true);)
+
+ if (base_type::empty())
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true);)
+
+ return 0;
+ }
+
+ base_type::to_linked_list();
+
+ node_pointer p_out = base_type::prune(pred);
+
+ size_type ersd = 0;
+
+ while (p_out != NULL)
+ {
+ ++ersd;
+
+ node_pointer p_next = p_out->m_p_next_sibling;
+
+ base_type::actual_erase_node(p_out);
+
+ p_out = p_next;
+ }
+
+ node_pointer p_cur = base_type::m_p_root;
+
+ base_type::m_p_root = NULL;
+
+ while (p_cur != NULL)
+ {
+ node_pointer p_next = p_cur->m_p_next_sibling;
+
+ p_cur->m_p_l_child = p_cur->m_p_prev_or_parent = NULL;
+
+ p_cur->m_metadata = 0;
+
+ p_cur->m_p_next_sibling = base_type::m_p_root;
+
+ if (base_type::m_p_root != NULL)
+ base_type::m_p_root->m_p_prev_or_parent = p_cur;
+
+ base_type::m_p_root = p_cur;
+
+ base_type::m_p_root = fix(base_type::m_p_root);
+
+ p_cur = p_next;
+ }
+
+ m_p_max = NULL;
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true);)
+
+ return ersd;
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_base_/find_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_base_/find_fn_imps.hpp
new file mode 100644
index 0000000..ad7f651
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_base_/find_fn_imps.hpp
@@ -0,0 +1,73 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file find_fn_imps.hpp
+ * Contains an implementation class for a base of binomial heaps.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_reference
+PB_DS_CLASS_C_DEC::
+top() const
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid(false);)
+ _GLIBCXX_DEBUG_ASSERT(!base_type::empty());
+
+ if (m_p_max == NULL)
+ const_cast<PB_DS_CLASS_C_DEC* >(this)->find_max();
+
+ _GLIBCXX_DEBUG_ASSERT(m_p_max != NULL);
+ return m_p_max->m_value;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+find_max()
+{
+ node_pointer p_cur = base_type::m_p_root;
+
+ m_p_max = p_cur;
+
+ while (p_cur != NULL)
+ {
+ if (Cmp_Fn::operator()(m_p_max->m_value, p_cur->m_value))
+ m_p_max = p_cur;
+
+ p_cur = p_cur->m_p_next_sibling;
+ }
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_base_/insert_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_base_/insert_fn_imps.hpp
new file mode 100644
index 0000000..e67d0df
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_base_/insert_fn_imps.hpp
@@ -0,0 +1,216 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file insert_fn_imps.hpp
+ * Contains an implementation class for a base of binomial heaps.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::point_iterator
+PB_DS_CLASS_C_DEC::
+push(const_reference r_val)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true);)
+
+ node_pointer p_nd = base_type::get_new_node_for_insert(r_val);
+
+ insert_node(p_nd);
+
+ m_p_max = NULL;
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true);)
+
+ return point_iterator(p_nd);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+insert_node(node_pointer p_nd)
+{
+ if (base_type::m_p_root == NULL)
+ {
+ p_nd->m_p_next_sibling = p_nd->m_p_prev_or_parent =
+ p_nd->m_p_l_child = NULL;
+
+ p_nd->m_metadata = 0;
+
+ base_type::m_p_root = p_nd;
+
+ return;
+ }
+
+ if (base_type::m_p_root->m_metadata > 0)
+ {
+ p_nd->m_p_prev_or_parent = p_nd->m_p_l_child = NULL;
+
+ p_nd->m_p_next_sibling = base_type::m_p_root;
+
+ base_type::m_p_root->m_p_prev_or_parent = p_nd;
+
+ base_type::m_p_root = p_nd;
+
+ p_nd->m_metadata = 0;
+
+ return;
+ }
+
+ if (Cmp_Fn::operator()(base_type::m_p_root->m_value, p_nd->m_value))
+ {
+ p_nd->m_p_next_sibling = base_type::m_p_root->m_p_next_sibling;
+
+ p_nd->m_p_prev_or_parent = NULL;
+
+ p_nd->m_metadata = 1;
+
+ p_nd->m_p_l_child = base_type::m_p_root;
+
+ base_type::m_p_root->m_p_prev_or_parent = p_nd;
+
+ base_type::m_p_root->m_p_next_sibling = NULL;
+
+ base_type::m_p_root = p_nd;
+ }
+ else
+ {
+ p_nd->m_p_next_sibling = NULL;
+
+ p_nd->m_p_l_child = NULL;
+
+ p_nd->m_p_prev_or_parent = base_type::m_p_root;
+
+ p_nd->m_metadata = 0;
+
+ _GLIBCXX_DEBUG_ASSERT(base_type::m_p_root->m_p_l_child == 0);
+ base_type::m_p_root->m_p_l_child = p_nd;
+
+ base_type::m_p_root->m_metadata = 1;
+ }
+
+ base_type::m_p_root = fix(base_type::m_p_root);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+fix(node_pointer p_nd) const
+{
+ while (p_nd->m_p_next_sibling != NULL&&
+ p_nd->m_metadata == p_nd->m_p_next_sibling->m_metadata)
+ {
+ node_pointer p_next = p_nd->m_p_next_sibling;
+
+ if (Cmp_Fn::operator()(p_nd->m_value, p_next->m_value))
+ {
+ p_next->m_p_prev_or_parent =
+ p_nd->m_p_prev_or_parent;
+
+ if (p_nd->m_p_prev_or_parent != NULL)
+ p_nd->m_p_prev_or_parent->m_p_next_sibling = p_next;
+
+ base_type::make_child_of(p_nd, p_next);
+
+ ++p_next->m_metadata;
+
+ p_nd = p_next;
+ }
+ else
+ {
+ p_nd->m_p_next_sibling = p_next->m_p_next_sibling;
+
+ if (p_nd->m_p_next_sibling != NULL)
+ p_next->m_p_next_sibling = NULL;
+
+ base_type::make_child_of(p_next, p_nd);
+
+ ++p_nd->m_metadata;
+ }
+ }
+
+ if (p_nd->m_p_next_sibling != NULL)
+ p_nd->m_p_next_sibling->m_p_prev_or_parent = p_nd;
+
+ return p_nd;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+modify(point_iterator it, const_reference r_new_val)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true);)
+ node_pointer p_nd = it.m_p_nd;
+
+ _GLIBCXX_DEBUG_ASSERT(p_nd != NULL);
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_nd, false);)
+
+ const bool bubble_up = Cmp_Fn::operator()(p_nd->m_value, r_new_val);
+
+ p_nd->m_value = r_new_val;
+
+ if (bubble_up)
+ {
+ node_pointer p_parent = base_type::parent(p_nd);
+
+ while (p_parent != NULL&&
+ Cmp_Fn::operator()(p_parent->m_value, p_nd->m_value))
+ {
+ base_type::swap_with_parent(p_nd, p_parent);
+
+ p_parent = base_type::parent(p_nd);
+ }
+
+ if (p_nd->m_p_prev_or_parent == NULL)
+ base_type::m_p_root = p_nd;
+
+ m_p_max = NULL;
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true);)
+
+ return;
+ }
+
+ base_type::bubble_to_top(p_nd);
+
+ remove_parentless_node(p_nd);
+
+ insert_node(p_nd);
+
+ m_p_max = NULL;
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true);)
+ }
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_base_/split_join_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_base_/split_join_fn_imps.hpp
new file mode 100644
index 0000000..a701937
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/binomial_heap_base_/split_join_fn_imps.hpp
@@ -0,0 +1,232 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file split_join_fn_imps.hpp
+ * Contains an implementation class for a base of binomial heaps.
+ */
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+void
+PB_DS_CLASS_C_DEC::
+split(Pred pred, PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true);)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid(true);)
+
+ other.clear();
+
+ if (base_type::empty())
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true);)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid(true);)
+
+ return;
+ }
+
+ base_type::to_linked_list();
+
+ node_pointer p_out = base_type::prune(pred);
+
+ while (p_out != NULL)
+ {
+ _GLIBCXX_DEBUG_ASSERT(base_type::m_size > 0);
+ --base_type::m_size;
+
+ ++other.m_size;
+
+ node_pointer p_next = p_out->m_p_next_sibling;
+
+ p_out->m_p_l_child = p_out->m_p_prev_or_parent = NULL;
+
+ p_out->m_metadata = 0;
+
+ p_out->m_p_next_sibling = other.m_p_root;
+
+ if (other.m_p_root != NULL)
+ other.m_p_root->m_p_prev_or_parent = p_out;
+
+ other.m_p_root = p_out;
+
+ other.m_p_root = other.fix(other.m_p_root);
+
+ p_out = p_next;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid(true);)
+
+ node_pointer p_cur = base_type::m_p_root;
+
+ base_type::m_p_root = NULL;
+
+ while (p_cur != NULL)
+ {
+ node_pointer p_next = p_cur->m_p_next_sibling;
+
+ p_cur->m_p_l_child = p_cur->m_p_prev_or_parent = NULL;
+
+ p_cur->m_metadata = 0;
+
+ p_cur->m_p_next_sibling = base_type::m_p_root;
+
+ if (base_type::m_p_root != NULL)
+ base_type::m_p_root->m_p_prev_or_parent = p_cur;
+
+ base_type::m_p_root = p_cur;
+
+ base_type::m_p_root = fix(base_type::m_p_root);
+
+ p_cur = p_next;
+ }
+
+ m_p_max = NULL;
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true);)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid(true);)
+ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+join(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true);)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid(true);)
+
+ node_pointer p_other = other.m_p_root;
+
+ if (p_other != NULL)
+ do
+ {
+ node_pointer p_next = p_other->m_p_next_sibling;
+
+ std::swap(p_other->m_p_next_sibling, p_other->m_p_prev_or_parent);
+
+ p_other = p_next;
+ }
+ while (p_other != NULL);
+
+ base_type::m_p_root = join(base_type::m_p_root, other.m_p_root);
+ base_type::m_size += other.m_size;
+ m_p_max = NULL;
+
+ other.m_p_root = NULL;
+ other.m_size = 0;
+ other.m_p_max = NULL;
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true);)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid(true);)
+ }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+join(node_pointer p_lhs, node_pointer p_rhs) const
+{
+ node_pointer p_ret = NULL;
+
+ node_pointer p_cur = NULL;
+
+ while (p_lhs != NULL || p_rhs != NULL)
+ {
+ if (p_rhs == NULL)
+ {
+ if (p_cur == NULL)
+ p_ret = p_cur = p_lhs;
+ else
+ {
+ p_cur->m_p_next_sibling = p_lhs;
+
+ p_lhs->m_p_prev_or_parent = p_cur;
+ }
+
+ p_cur = p_lhs = NULL;
+ }
+ else if (p_lhs == NULL || p_rhs->m_metadata < p_lhs->m_metadata)
+ {
+ if (p_cur == NULL)
+ {
+ p_ret = p_cur = p_rhs;
+
+ p_rhs = p_rhs->m_p_prev_or_parent;
+ }
+ else
+ {
+ p_cur->m_p_next_sibling = p_rhs;
+
+ p_rhs = p_rhs->m_p_prev_or_parent;
+
+ p_cur->m_p_next_sibling->m_p_prev_or_parent = p_cur;
+
+ p_cur = p_cur->m_p_next_sibling;
+ }
+ }
+ else if (p_lhs->m_metadata < p_rhs->m_metadata)
+ {
+ if (p_cur == NULL)
+ p_ret = p_cur = p_lhs;
+ else
+ {
+ p_cur->m_p_next_sibling = p_lhs;
+
+ p_lhs->m_p_prev_or_parent = p_cur;
+
+ p_cur = p_cur->m_p_next_sibling;
+ }
+
+ p_lhs = p_cur->m_p_next_sibling;
+ }
+ else
+ {
+ node_pointer p_next_rhs = p_rhs->m_p_prev_or_parent;
+
+ p_rhs->m_p_next_sibling = p_lhs;
+
+ p_lhs = fix(p_rhs);
+
+ p_rhs = p_next_rhs;
+ }
+ }
+
+ if (p_cur != NULL)
+ p_cur->m_p_next_sibling = NULL;
+
+ if (p_ret != NULL)
+ p_ret->m_p_prev_or_parent = NULL;
+
+ return p_ret;
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp
new file mode 100644
index 0000000..f5efabe
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp
@@ -0,0 +1,636 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file cc_ht_map_.hpp
+ * Contains an implementation class for cc_ht_map_.
+ */
+
+#include <utility>
+#include <iterator>
+#include <ext/pb_ds/detail/cond_dealtor.hpp>
+#include <ext/pb_ds/tag_and_trait.hpp>
+#include <ext/pb_ds/detail/hash_fn/ranged_hash_fn.hpp>
+#include <ext/pb_ds/detail/types_traits.hpp>
+#include <ext/pb_ds/exception.hpp>
+#include <ext/pb_ds/detail/eq_fn/hash_eq_fn.hpp>
+#ifdef _GLIBCXX_DEBUG
+#include <ext/pb_ds/detail/debug_map_base.hpp>
+#endif
+#ifdef PB_DS_HT_MAP_TRACE_
+#include <iostream>
+#endif
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, typename Mapped, typename Hash_Fn, \
+ typename Eq_Fn, typename Allocator, bool Store_Hash, \
+ typename Comb_Hash_Fn, typename Resize_Policy>
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_CLASS_NAME cc_ht_map_data_
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#define PB_DS_CLASS_NAME cc_ht_map_no_data_
+#endif
+
+#define PB_DS_CLASS_C_DEC \
+ PB_DS_CLASS_NAME<Key, Mapped, Hash_Fn, Eq_Fn, Allocator, \
+ Store_Hash, Comb_Hash_Fn, Resize_Policy>
+
+#define PB_DS_HASH_EQ_FN_C_DEC \
+ hash_eq_fn<Key, Eq_Fn, Allocator, Store_Hash>
+
+#define PB_DS_RANGED_HASH_FN_C_DEC \
+ ranged_hash_fn<Key, Hash_Fn, Allocator, Comb_Hash_Fn, Store_Hash>
+
+#define PB_DS_TYPES_TRAITS_C_DEC \
+ types_traits<Key, Mapped, Allocator, Store_Hash>
+
+#ifdef _GLIBCXX_DEBUG
+#define PB_DS_DEBUG_MAP_BASE_C_DEC \
+ debug_map_base<Key, Eq_Fn, typename Allocator::template rebind<Key>::other::const_reference>
+#endif
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_V2F(X) (X).first
+#define PB_DS_V2S(X) (X).second
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#define PB_DS_V2F(X) (X)
+#define PB_DS_V2S(X) Mapped_Data()
+#endif
+
+ // <011i$i0|\|-<|-|4i|\|i|\|g |-|4$|-| 74813.
+ template<typename Key,
+ typename Mapped,
+ typename Hash_Fn,
+ typename Eq_Fn,
+ typename Allocator,
+ bool Store_Hash,
+ typename Comb_Hash_Fn,
+ typename Resize_Policy >
+ class PB_DS_CLASS_NAME:
+#ifdef _GLIBCXX_DEBUG
+ protected PB_DS_DEBUG_MAP_BASE_C_DEC,
+#endif
+ public PB_DS_HASH_EQ_FN_C_DEC,
+ public Resize_Policy,
+ public PB_DS_RANGED_HASH_FN_C_DEC,
+ public PB_DS_TYPES_TRAITS_C_DEC
+ {
+ private:
+ typedef PB_DS_TYPES_TRAITS_C_DEC traits_base;
+ typedef typename traits_base::comp_hash comp_hash;
+ typedef typename traits_base::value_type value_type_;
+ typedef typename traits_base::pointer pointer_;
+ typedef typename traits_base::const_pointer const_pointer_;
+ typedef typename traits_base::reference reference_;
+ typedef typename traits_base::const_reference const_reference_;
+
+ struct entry : public traits_base::stored_value_type
+ {
+ typename Allocator::template rebind<entry>::other::pointer m_p_next;
+ };
+
+ typedef cond_dealtor<entry, Allocator> cond_dealtor_t;
+
+ typedef typename Allocator::template rebind<entry>::other entry_allocator;
+ typedef typename entry_allocator::pointer entry_pointer;
+ typedef typename entry_allocator::const_pointer const_entry_pointer;
+ typedef typename entry_allocator::reference entry_reference;
+ typedef typename entry_allocator::const_reference const_entry_reference;
+
+ typedef typename Allocator::template rebind<entry_pointer>::other entry_pointer_allocator;
+ typedef typename entry_pointer_allocator::pointer entry_pointer_array;
+
+ typedef PB_DS_RANGED_HASH_FN_C_DEC ranged_hash_fn_base;
+ typedef PB_DS_HASH_EQ_FN_C_DEC hash_eq_fn_base;
+ typedef Resize_Policy resize_base;
+
+#ifdef _GLIBCXX_DEBUG
+ typedef PB_DS_DEBUG_MAP_BASE_C_DEC debug_base;
+#endif
+
+#define PB_DS_GEN_POS std::pair<entry_pointer, typename Allocator::size_type>
+
+#include <ext/pb_ds/detail/unordered_iterator/const_point_iterator.hpp>
+#include <ext/pb_ds/detail/unordered_iterator/point_iterator.hpp>
+#include <ext/pb_ds/detail/unordered_iterator/const_iterator.hpp>
+#include <ext/pb_ds/detail/unordered_iterator/iterator.hpp>
+
+#undef PB_DS_GEN_POS
+
+ public:
+ typedef Allocator allocator_type;
+ typedef typename Allocator::size_type size_type;
+ typedef typename Allocator::difference_type difference_type;
+ typedef Hash_Fn hash_fn;
+ typedef Eq_Fn eq_fn;
+ typedef Comb_Hash_Fn comb_hash_fn;
+ typedef Resize_Policy resize_policy;
+
+ enum
+ {
+ store_hash = Store_Hash
+ };
+
+ typedef typename traits_base::key_type key_type;
+ typedef typename traits_base::key_pointer key_pointer;
+ typedef typename traits_base::const_key_pointer const_key_pointer;
+ typedef typename traits_base::key_reference key_reference;
+ typedef typename traits_base::const_key_reference const_key_reference;
+ typedef typename traits_base::mapped_type mapped_type;
+ typedef typename traits_base::mapped_pointer mapped_pointer;
+ typedef typename traits_base::const_mapped_pointer const_mapped_pointer;
+ typedef typename traits_base::mapped_reference mapped_reference;
+ typedef typename traits_base::const_mapped_reference const_mapped_reference;
+ typedef typename traits_base::value_type value_type;
+ typedef typename traits_base::pointer pointer;
+ typedef typename traits_base::const_pointer const_pointer;
+ typedef typename traits_base::reference reference;
+ typedef typename traits_base::const_reference const_reference;
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ typedef point_iterator_ point_iterator;
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+ typedef const_point_iterator_ point_iterator;
+#endif
+
+ typedef const_point_iterator_ const_point_iterator;
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ typedef iterator_ iterator;
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+ typedef const_iterator_ iterator;
+#endif
+
+ typedef const_iterator_ const_iterator;
+
+ PB_DS_CLASS_NAME();
+
+ PB_DS_CLASS_NAME(const Hash_Fn&);
+
+ PB_DS_CLASS_NAME(const Hash_Fn&, const Eq_Fn&);
+
+ PB_DS_CLASS_NAME(const Hash_Fn&, const Eq_Fn&, const Comb_Hash_Fn&);
+
+ PB_DS_CLASS_NAME(const Hash_Fn&, const Eq_Fn&, const Comb_Hash_Fn&,
+ const Resize_Policy&);
+
+ PB_DS_CLASS_NAME(const PB_DS_CLASS_C_DEC&);
+
+ virtual
+ ~PB_DS_CLASS_NAME();
+
+ void
+ swap(PB_DS_CLASS_C_DEC&);
+
+ template<typename It>
+ void
+ copy_from_range(It, It);
+
+ void
+ initialize();
+
+ inline size_type
+ size() const;
+
+ inline size_type
+ max_size() const;
+
+ inline bool
+ empty() const;
+
+ Hash_Fn&
+ get_hash_fn();
+
+ const Hash_Fn&
+ get_hash_fn() const;
+
+ Eq_Fn&
+ get_eq_fn();
+
+ const Eq_Fn&
+ get_eq_fn() const;
+
+ Comb_Hash_Fn&
+ get_comb_hash_fn();
+
+ const Comb_Hash_Fn&
+ get_comb_hash_fn() const;
+
+ Resize_Policy&
+ get_resize_policy();
+
+ const Resize_Policy&
+ get_resize_policy() const;
+
+ inline std::pair<point_iterator, bool>
+ insert(const_reference r_val)
+ { return insert_imp(r_val, traits_base::m_store_extra_indicator); }
+
+ inline mapped_reference
+ operator[](const_key_reference r_key)
+ {
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ return (subscript_imp(r_key, traits_base::m_store_extra_indicator));
+#else
+ insert(r_key);
+ return traits_base::s_null_mapped;
+#endif
+ }
+
+ inline point_iterator
+ find(const_key_reference);
+
+ inline const_point_iterator
+ find(const_key_reference) const;
+
+ inline point_iterator
+ find_end();
+
+ inline const_point_iterator
+ find_end() const;
+
+ inline bool
+ erase(const_key_reference);
+
+ template<typename Pred>
+ inline size_type
+ erase_if(Pred);
+
+ void
+ clear();
+
+ inline iterator
+ begin();
+
+ inline const_iterator
+ begin() const;
+
+ inline iterator
+ end();
+
+ inline const_iterator
+ end() const;
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid() const;
+#endif
+
+#ifdef PB_DS_HT_MAP_TRACE_
+ void
+ trace() const;
+#endif
+
+ private:
+ void
+ deallocate_all();
+
+ inline bool
+ do_resize_if_needed();
+
+ inline void
+ do_resize_if_needed_no_throw();
+
+ void
+ resize_imp(size_type new_size);
+
+ void
+ do_resize(size_type new_size);
+
+ void
+ resize_imp_no_exceptions(size_type, entry_pointer_array, size_type);
+
+ inline entry_pointer
+ resize_imp_no_exceptions_reassign_pointer(entry_pointer, entry_pointer_array, false_type);
+
+ inline entry_pointer
+ resize_imp_no_exceptions_reassign_pointer(entry_pointer, entry_pointer_array, true_type);
+
+ void
+ deallocate_links_in_list(entry_pointer);
+
+ inline entry_pointer
+ get_entry(const_reference, false_type);
+
+ inline entry_pointer
+ get_entry(const_reference, true_type);
+
+ inline void
+ rels_entry(entry_pointer);
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ inline mapped_reference
+ subscript_imp(const_key_reference r_key, false_type)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ const size_type pos = ranged_hash_fn_base::operator()(r_key);
+ entry_pointer p_e = m_entries[pos];
+ resize_base::notify_insert_search_start();
+
+ while (p_e != NULL
+ && !hash_eq_fn_base::operator()(p_e->m_value.first, r_key))
+ {
+ resize_base::notify_insert_search_collision();
+ p_e = p_e->m_p_next;
+ }
+
+ resize_base::notify_insert_search_end();
+ if (p_e != NULL)
+ {
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key);)
+ return (p_e->m_value.second);
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key);)
+ return insert_new_imp(value_type(r_key, mapped_type()), pos)->second;
+ }
+
+ inline mapped_reference
+ subscript_imp(const_key_reference r_key, true_type)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ comp_hash pos_hash_pair = ranged_hash_fn_base::operator()(r_key);
+ entry_pointer p_e = m_entries[pos_hash_pair.first];
+ resize_base::notify_insert_search_start();
+ while (p_e != NULL &&
+ !hash_eq_fn_base::operator()(p_e->m_value.first, p_e->m_hash, r_key, pos_hash_pair.second))
+ {
+ resize_base::notify_insert_search_collision();
+ p_e = p_e->m_p_next;
+ }
+
+ resize_base::notify_insert_search_end();
+ if (p_e != NULL)
+ {
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key);)
+ return p_e->m_value.second;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key);)
+ return insert_new_imp(value_type(r_key, mapped_type()),
+ pos_hash_pair)->second;
+ }
+#endif
+
+ inline std::pair<point_iterator, bool>
+ insert_imp(const_reference, false_type);
+
+ inline std::pair<point_iterator, bool>
+ insert_imp(const_reference, true_type);
+
+ inline pointer
+ insert_new_imp(const_reference r_val, size_type pos)
+ {
+ if (do_resize_if_needed())
+ pos = ranged_hash_fn_base::operator()(PB_DS_V2F(r_val));
+
+ // Following lines might throw an exception.
+ entry_pointer p_e = get_entry(r_val, traits_base::m_no_throw_copies_indicator);
+
+ // At this point no exceptions can be thrown.
+ p_e->m_p_next = m_entries[pos];
+ m_entries[pos] = p_e;
+ resize_base::notify_inserted(++m_num_used_e);
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::insert_new(PB_DS_V2F(r_val));)
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return &p_e->m_value;
+ }
+
+ inline pointer
+ insert_new_imp(const_reference r_val, comp_hash& r_pos_hash_pair)
+ {
+ // Following lines might throw an exception.
+ if (do_resize_if_needed())
+ r_pos_hash_pair = ranged_hash_fn_base::operator()(PB_DS_V2F(r_val));
+
+ entry_pointer p_e = get_entry(r_val, traits_base::m_no_throw_copies_indicator);
+
+ // At this point no exceptions can be thrown.
+ p_e->m_hash = r_pos_hash_pair.second;
+ p_e->m_p_next = m_entries[r_pos_hash_pair.first];
+ m_entries[r_pos_hash_pair.first] = p_e;
+ resize_base::notify_inserted(++m_num_used_e);
+ _GLIBCXX_DEBUG_ONLY(debug_base::insert_new(PB_DS_V2F(r_val));)
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return &p_e->m_value;
+ }
+
+ inline pointer
+ find_key_pointer(const_key_reference r_key, false_type)
+ {
+ entry_pointer p_e = m_entries[ranged_hash_fn_base::operator()(r_key)];
+ resize_base::notify_find_search_start();
+ while (p_e != NULL &&
+ !hash_eq_fn_base::operator()(PB_DS_V2F(p_e->m_value), r_key))
+ {
+ resize_base::notify_find_search_collision();
+ p_e = p_e->m_p_next;
+ }
+
+ resize_base::notify_find_search_end();
+
+#ifdef _GLIBCXX_DEBUG
+ if (p_e == NULL)
+ debug_base::check_key_does_not_exist(r_key);
+ else
+ debug_base::check_key_exists(r_key);
+#endif
+ return &p_e->m_value;
+ }
+
+ inline pointer
+ find_key_pointer(const_key_reference r_key, true_type)
+ {
+ comp_hash pos_hash_pair = ranged_hash_fn_base::operator()(r_key);
+ entry_pointer p_e = m_entries[pos_hash_pair.first];
+ resize_base::notify_find_search_start();
+ while (p_e != NULL &&
+ !hash_eq_fn_base::operator()(PB_DS_V2F(p_e->m_value),
+ p_e->m_hash,
+ r_key, pos_hash_pair.second))
+ {
+ resize_base::notify_find_search_collision();
+ p_e = p_e->m_p_next;
+ }
+
+ resize_base::notify_find_search_end();
+
+#ifdef _GLIBCXX_DEBUG
+ if (p_e == NULL)
+ debug_base::check_key_does_not_exist(r_key);
+ else
+ debug_base::check_key_exists(r_key);
+#endif
+ return &p_e->m_value;
+ }
+
+ inline bool
+ erase_in_pos_imp(const_key_reference, size_type);
+
+ inline bool
+ erase_in_pos_imp(const_key_reference, const comp_hash&);
+
+ inline void
+ erase_entry_pointer(entry_pointer&);
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ void
+ inc_it_state(pointer& r_p_value,
+ std::pair<entry_pointer, size_type>& r_pos) const
+ {
+ inc_it_state((const_mapped_pointer& )r_p_value, r_pos);
+ }
+#endif
+
+ void
+ inc_it_state(const_pointer& r_p_value,
+ std::pair<entry_pointer, size_type>& r_pos) const
+ {
+ _GLIBCXX_DEBUG_ASSERT(r_p_value != NULL);
+ r_pos.first = r_pos.first->m_p_next;
+ if (r_pos.first != NULL)
+ {
+ r_p_value = &r_pos.first->m_value;
+ return;
+ }
+
+ for (++r_pos.second; r_pos.second < m_num_e; ++r_pos.second)
+ if (m_entries[r_pos.second] != NULL)
+ {
+ r_pos.first = m_entries[r_pos.second];
+ r_p_value = &r_pos.first->m_value;
+ return;
+ }
+ r_p_value = NULL;
+ }
+
+ void
+ get_start_it_state(pointer& r_p_value,
+ std::pair<entry_pointer, size_type>& r_pos) const
+ {
+ for (r_pos.second = 0; r_pos.second < m_num_e; ++r_pos.second)
+ if (m_entries[r_pos.second] != NULL)
+ {
+ r_pos.first = m_entries[r_pos.second];
+ r_p_value = &r_pos.first->m_value;
+ return;
+ }
+ r_p_value = NULL;
+ }
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_entry_pointer_array_valid(const entry_pointer_array) const;
+
+ void
+ assert_entry_pointer_valid(const entry_pointer, true_type) const;
+
+ void
+ assert_entry_pointer_valid(const entry_pointer, false_type) const;
+#endif
+
+#ifdef PB_DS_HT_MAP_TRACE_
+ void
+ trace_list(const_entry_pointer) const;
+#endif
+
+ private:
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ friend class iterator_;
+#endif
+
+ friend class const_iterator_;
+
+ static entry_allocator s_entry_allocator;
+ static entry_pointer_allocator s_entry_pointer_allocator;
+ static iterator s_end_it;
+ static const_iterator s_const_end_it;
+ static point_iterator s_find_end_it;
+ static const_point_iterator s_const_find_end_it;
+
+ size_type m_num_e;
+ size_type m_num_used_e;
+ entry_pointer_array m_entries;
+
+ enum
+ {
+ store_hash_ok = !Store_Hash
+ || !is_same<Hash_Fn, __gnu_pbds::null_hash_fn>::value
+ };
+
+ PB_DS_STATIC_ASSERT(sth, store_hash_ok);
+ };
+
+#include <ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_fn_imps.hpp>
+#include <ext/pb_ds/detail/cc_hash_table_map_/entry_list_fn_imps.hpp>
+#include <ext/pb_ds/detail/cc_hash_table_map_/find_fn_imps.hpp>
+#include <ext/pb_ds/detail/cc_hash_table_map_/resize_fn_imps.hpp>
+#include <ext/pb_ds/detail/cc_hash_table_map_/debug_fn_imps.hpp>
+#include <ext/pb_ds/detail/cc_hash_table_map_/size_fn_imps.hpp>
+#include <ext/pb_ds/detail/cc_hash_table_map_/policy_access_fn_imps.hpp>
+#include <ext/pb_ds/detail/cc_hash_table_map_/erase_fn_imps.hpp>
+#include <ext/pb_ds/detail/cc_hash_table_map_/iterators_fn_imps.hpp>
+#include <ext/pb_ds/detail/cc_hash_table_map_/insert_fn_imps.hpp>
+#include <ext/pb_ds/detail/cc_hash_table_map_/trace_fn_imps.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_HASH_EQ_FN_C_DEC
+#undef PB_DS_RANGED_HASH_FN_C_DEC
+#undef PB_DS_TYPES_TRAITS_C_DEC
+#undef PB_DS_DEBUG_MAP_BASE_C_DEC
+#undef PB_DS_CLASS_NAME
+#undef PB_DS_V2F
+#undef PB_DS_V2S
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/cmp_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/cmp_fn_imps.hpp
new file mode 100644
index 0000000..1a61893
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/cmp_fn_imps.hpp
@@ -0,0 +1,83 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file cmp_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s entire container comparison related
+ * functions.
+ */
+
+PB_DS_CLASS_T_DEC
+template<typename Other_HT_Map_Type>
+bool
+PB_DS_CLASS_C_DEC::
+operator==(const Other_HT_Map_Type& other) const
+{ return cmp_with_other(other); }
+
+PB_DS_CLASS_T_DEC
+template<typename Other_Map_Type>
+bool
+PB_DS_CLASS_C_DEC::
+cmp_with_other(const Other_Map_Type& other) const
+{
+ if (size() != other.size())
+ return false;
+
+ for (typename Other_Map_Type::const_iterator it = other.begin();
+ it != other.end(); ++it)
+ {
+ const_key_reference r_key = const_key_reference(PB_DS_V2F(*it));
+
+ const_mapped_pointer p_mapped_value =
+ const_cast<PB_DS_CLASS_C_DEC& >(*this).
+ find_key_pointer(r_key, traits_base::m_store_extra_indicator);
+
+ if (p_mapped_value == NULL)
+ return false;
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ if (p_mapped_value->second != it->second)
+ return false;
+#endif
+ }
+ return true;
+}
+
+PB_DS_CLASS_T_DEC
+template<typename Other_HT_Map_Type>
+bool
+PB_DS_CLASS_C_DEC::
+operator!=(const Other_HT_Map_Type& other) const
+{ return !operator==(other); }
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/cond_key_dtor_entry_dealtor.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/cond_key_dtor_entry_dealtor.hpp
new file mode 100644
index 0000000..fa3f31d
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/cond_key_dtor_entry_dealtor.hpp
@@ -0,0 +1,117 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file cond_key_dtor_entry_dealtor.hpp
+ * Contains a conditional key destructor, used for exception handling.
+ */
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_CLASS_T_DEC template<typename HT_Map>
+#define PB_DS_CLASS_C_DEC PB_DS_CKDED_CLASS_NAME<HT_Map>
+
+ /**
+ * A conditional key destructor, used for exception handling.
+ **/
+ template<typename HT_Map>
+ class PB_DS_CKDED_CLASS_NAME
+ {
+ public:
+ typedef typename HT_Map::entry entry;
+ typedef typename HT_Map::entry_allocator entry_allocator;
+ typedef typename HT_Map::key_type key_type;
+
+ inline
+ PB_DS_CKDED_CLASS_NAME(entry_allocator* p_a, entry* p_e);
+
+ inline
+ ~PB_DS_CKDED_CLASS_NAME();
+
+ inline void
+ set_key_destruct();
+
+ inline void
+ set_no_action_destructor();
+
+ protected:
+ entry_allocator* const m_p_a;
+ entry* const m_p_e;
+
+ bool m_key_destruct;
+ bool m_no_action_destructor;
+ };
+
+ PB_DS_CLASS_T_DEC
+ inline
+ PB_DS_CLASS_C_DEC::
+ PB_DS_CKDED_CLASS_NAME(entry_allocator* p_a, entry* p_e)
+ : m_p_a(p_a), m_p_e(p_e), m_key_destruct(false),
+ m_no_action_destructor(false)
+ { }
+
+ PB_DS_CLASS_T_DEC
+ inline void
+ PB_DS_CLASS_C_DEC::
+ set_key_destruct()
+ { m_key_destruct = true; }
+
+ PB_DS_CLASS_T_DEC
+ inline void
+ PB_DS_CLASS_C_DEC::
+ set_no_action_destructor()
+ { m_no_action_destructor = true; }
+
+ PB_DS_CLASS_T_DEC
+ inline
+ PB_DS_CLASS_C_DEC::
+ ~PB_DS_CKDED_CLASS_NAME()
+ {
+ if (m_no_action_destructor)
+ return;
+ if (m_key_destruct)
+ m_p_e->m_value.first.~key_type();
+ m_p_a->deallocate(m_p_e, 1);
+ }
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_fn_imps.hpp
new file mode 100644
index 0000000..5711153
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_fn_imps.hpp
@@ -0,0 +1,191 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructor_destructor_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s constructors, destructor,
+ * and related functions.
+ */
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::entry_allocator
+PB_DS_CLASS_C_DEC::s_entry_allocator;
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::entry_pointer_allocator
+PB_DS_CLASS_C_DEC::s_entry_pointer_allocator;
+
+PB_DS_CLASS_T_DEC
+template<typename It>
+void
+PB_DS_CLASS_C_DEC::
+copy_from_range(It first_it, It last_it)
+{
+ while (first_it != last_it)
+ insert(*(first_it++));
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME() :
+ ranged_hash_fn_base(resize_base::get_nearest_larger_size(1)),
+ m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
+ m_entries(s_entry_pointer_allocator.allocate(m_num_e))
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const Hash_Fn& r_hash_fn) :
+ ranged_hash_fn_base(resize_base::get_nearest_larger_size(1), r_hash_fn),
+ m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
+ m_entries(s_entry_pointer_allocator.allocate(m_num_e))
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const Hash_Fn& r_hash_fn, const Eq_Fn& r_eq_fn) :
+ PB_DS_HASH_EQ_FN_C_DEC(r_eq_fn),
+ ranged_hash_fn_base(resize_base::get_nearest_larger_size(1), r_hash_fn),
+ m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
+ m_entries(s_entry_pointer_allocator.allocate(m_num_e))
+{
+ std::fill(m_entries, m_entries + m_num_e, (entry_pointer)NULL);
+ Resize_Policy::notify_cleared();
+ ranged_hash_fn_base::notify_resized(m_num_e);
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const Hash_Fn& r_hash_fn, const Eq_Fn& r_eq_fn, const Comb_Hash_Fn& r_comb_hash_fn) :
+ PB_DS_HASH_EQ_FN_C_DEC(r_eq_fn),
+ ranged_hash_fn_base(resize_base::get_nearest_larger_size(1),
+ r_hash_fn, r_comb_hash_fn),
+ m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
+ m_entries(s_entry_pointer_allocator.allocate(m_num_e))
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const Hash_Fn& r_hash_fn, const Eq_Fn& r_eq_fn, const Comb_Hash_Fn& r_comb_hash_fn, const Resize_Policy& r_resize_policy) :
+ PB_DS_HASH_EQ_FN_C_DEC(r_eq_fn),
+ Resize_Policy(r_resize_policy),
+ ranged_hash_fn_base(resize_base::get_nearest_larger_size(1),
+ r_hash_fn, r_comb_hash_fn),
+ m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
+ m_entries(s_entry_pointer_allocator.allocate(m_num_e))
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const PB_DS_CLASS_C_DEC& other) :
+#ifdef _GLIBCXX_DEBUG
+ debug_base(other),
+#endif
+ PB_DS_HASH_EQ_FN_C_DEC(other),
+ resize_base(other), ranged_hash_fn_base(other),
+ m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
+ m_entries(m_entries = s_entry_pointer_allocator.allocate(m_num_e))
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+ __try
+ {
+ copy_from_range(other.begin(), other.end());
+ }
+ __catch(...)
+ {
+ deallocate_all();
+ __throw_exception_again;
+ }
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+~PB_DS_CLASS_NAME()
+{ deallocate_all(); }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid());
+
+ std::swap(m_entries, other.m_entries);
+ std::swap(m_num_e, other.m_num_e);
+ std::swap(m_num_used_e, other.m_num_used_e);
+ ranged_hash_fn_base::swap(other);
+ hash_eq_fn_base::swap(other);
+ resize_base::swap(other);
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::swap(other));
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid());
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+deallocate_all()
+{
+ clear();
+ s_entry_pointer_allocator.deallocate(m_entries, m_num_e);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+initialize()
+{
+ std::fill(m_entries, m_entries + m_num_e, entry_pointer(NULL));
+ Resize_Policy::notify_resized(m_num_e);
+ Resize_Policy::notify_cleared();
+ ranged_hash_fn_base::notify_resized(m_num_e);
+}
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_no_store_hash_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_no_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..4f1cce6
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_no_store_hash_fn_imps.hpp
@@ -0,0 +1,55 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructor_destructor_no_store_hash_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s constructors, destructor,
+ * and related functions.
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+constructor_insert_new_imp(const_mapped_reference r_val, size_type pos,
+ false_type)
+{
+ // Following lines might throw an exception.
+ entry_pointer p = get_entry(r_val, traits_base::s_no_throw_copies_indicator);
+
+ // At this point no exceptions can be thrown.
+ p->m_p_next = m_entries[pos];
+ m_entries[pos] = p;
+ _GLIBCXX_DEBUG_ONLY(debug_base::insert_new(r_key);)
+}
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_store_hash_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..a2b6fa1
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_store_hash_fn_imps.hpp
@@ -0,0 +1,56 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructor_destructor_store_hash_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s constructors, destructor,
+ * and related functions.
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+constructor_insert_new_imp(const_reference r_val, size_type pos, true_type)
+{
+ // Following lines might throw an exception.
+ entry_pointer p = get_entry(r_val, traits_base::s_no_throw_copies_indicator);
+
+ // At this point no exceptions can be thrown.
+ p->m_p_next = m_entries[pos];
+ p->m_hash = ranged_hash_fn_base::operator()((const_key_reference)(PB_DS_V2F(p->m_value))).second;
+
+ m_entries[pos] = p;
+ _GLIBCXX_DEBUG_ONLY(debug_base::insert_new(r_key);)
+}
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/debug_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/debug_fn_imps.hpp
new file mode 100644
index 0000000..4219eef
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/debug_fn_imps.hpp
@@ -0,0 +1,74 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s debug-mode functions.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_valid() const
+{
+ debug_base::check_size(m_num_used_e);
+ assert_entry_pointer_array_valid(m_entries);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_entry_pointer_array_valid(const entry_pointer_array a_p_entries) const
+{
+ size_type iterated_num_used_e = 0;
+ for (size_type pos = 0; pos < m_num_e; ++pos)
+ {
+ entry_pointer p_e = a_p_entries[pos];
+ while (p_e != NULL)
+ {
+ ++iterated_num_used_e;
+ assert_entry_pointer_valid(p_e, traits_base::m_store_extra_indicator);
+ p_e = p_e->m_p_next;
+ }
+ }
+ _GLIBCXX_DEBUG_ASSERT(iterated_num_used_e == m_num_used_e);
+}
+
+#include <ext/pb_ds/detail/cc_hash_table_map_/debug_store_hash_fn_imps.hpp>
+#include <ext/pb_ds/detail/cc_hash_table_map_/debug_no_store_hash_fn_imps.hpp>
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/debug_no_store_hash_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/debug_no_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..770bed3
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/debug_no_store_hash_fn_imps.hpp
@@ -0,0 +1,49 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_no_store_hash_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s debug-mode functions.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_entry_pointer_valid(const entry_pointer p, false_type) const
+{ debug_base::check_key_exists(PB_DS_V2F(p->m_value)); }
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/debug_store_hash_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/debug_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..3d17671
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/debug_store_hash_fn_imps.hpp
@@ -0,0 +1,53 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_store_hash_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s debug-mode functions.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_entry_pointer_valid(const entry_pointer p_e, true_type) const
+{
+ debug_base::check_key_exists(PB_DS_V2F(p_e->m_value));
+ comp_hash pos_hash_pair = ranged_hash_fn_base::operator()(PB_DS_V2F(p_e->m_value));
+ _GLIBCXX_DEBUG_ASSERT(p_e->m_hash == pos_hash_pair.second);
+}
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/entry_list_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/entry_list_fn_imps.hpp
new file mode 100644
index 0000000..fa09f73
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/entry_list_fn_imps.hpp
@@ -0,0 +1,91 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file entry_list_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s entry-list related functions.
+ */
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+deallocate_links_in_list(entry_pointer p_e)
+{
+ while (p_e != NULL)
+ {
+ entry_pointer p_dealloc_e = p_e;
+ p_e = p_e->m_p_next;
+ s_entry_allocator.deallocate(p_dealloc_e, 1);
+ }
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::entry_pointer
+PB_DS_CLASS_C_DEC::
+get_entry(const_reference r_val, true_type)
+{
+ // Following line might throw an exception.
+ entry_pointer p_e = s_entry_allocator.allocate(1);
+
+ // Following lines* cannot* throw an exception.
+ new (&p_e->m_value) value_type(r_val);
+ return p_e;
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::entry_pointer
+PB_DS_CLASS_C_DEC::
+get_entry(const_reference r_val, false_type)
+{
+ // Following line might throw an exception.
+ entry_pointer p_e = s_entry_allocator.allocate(1);
+ cond_dealtor_t cond(p_e);
+
+ // Following lines might throw an exception.
+ new (&p_e->m_value) value_type(r_val);
+ cond.set_no_action();
+ return p_e;
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+rels_entry(entry_pointer p_e)
+{
+ // The following lines cannot throw exceptions (unless if key-data dtors do).
+ p_e->m_value.~value_type();
+ s_entry_allocator.deallocate(p_e, 1);
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/erase_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/erase_fn_imps.hpp
new file mode 100644
index 0000000..9f9178b
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/erase_fn_imps.hpp
@@ -0,0 +1,103 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file erase_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s erase related functions.
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+erase_entry_pointer(entry_pointer& r_p_e)
+{
+ _GLIBCXX_DEBUG_ONLY(debug_base::erase_existing(PB_DS_V2F(r_p_e->m_value)));
+
+ entry_pointer p_e = r_p_e;
+ r_p_e = r_p_e->m_p_next;
+ rels_entry(p_e);
+ _GLIBCXX_DEBUG_ASSERT(m_num_used_e > 0);
+ resize_base::notify_erased(--m_num_used_e);
+}
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+erase_if(Pred pred)
+{
+ size_type num_ersd = 0;
+ for (size_type pos = 0; pos < m_num_e; ++pos)
+ {
+ while (m_entries[pos] != NULL && pred(m_entries[pos]->m_value))
+ {
+ ++num_ersd;
+ entry_pointer p_next_e = m_entries[pos]->m_p_next;
+ erase_entry_pointer(m_entries[pos]);
+ m_entries[pos] = p_next_e;
+ }
+
+ entry_pointer p_e = m_entries[pos];
+ while (p_e != NULL && p_e->m_p_next != NULL)
+ {
+ if (pred(p_e->m_p_next->m_value))
+ {
+ ++num_ersd;
+ erase_entry_pointer(p_e->m_p_next);
+ }
+ else
+ p_e = p_e->m_p_next;
+ }
+ }
+
+ do_resize_if_needed_no_throw();
+ return num_ersd;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+clear()
+{
+ for (size_type pos = 0; pos < m_num_e; ++pos)
+ while (m_entries[pos] != NULL)
+ erase_entry_pointer(m_entries[pos]);
+ do_resize_if_needed_no_throw();
+ resize_base::notify_cleared();
+}
+
+#include <ext/pb_ds/detail/cc_hash_table_map_/erase_no_store_hash_fn_imps.hpp>
+#include <ext/pb_ds/detail/cc_hash_table_map_/erase_store_hash_fn_imps.hpp>
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/erase_no_store_hash_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/erase_no_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..d24fc31
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/erase_no_store_hash_fn_imps.hpp
@@ -0,0 +1,101 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file erase_no_store_hash_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s erase related functions,
+ * when the hash value is not stored.
+ */
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+erase(const_key_reference r_key)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return erase_in_pos_imp(r_key, ranged_hash_fn_base::operator()(r_key));
+}
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+erase_in_pos_imp(const_key_reference r_key, size_type pos)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ entry_pointer p_e = m_entries[pos];
+ resize_base::notify_erase_search_start();
+ if (p_e == NULL)
+ {
+ resize_base::notify_erase_search_end();
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key);)
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return false;
+ }
+
+ if (hash_eq_fn_base::operator()(PB_DS_V2F(p_e->m_value), r_key))
+ {
+ resize_base::notify_erase_search_end();
+ _GLIBCXX_DEBUG_ONLY(debug_base:: check_key_exists(r_key);)
+ erase_entry_pointer(m_entries[pos]);
+ do_resize_if_needed_no_throw();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return true;
+ }
+
+ while (true)
+ {
+ entry_pointer p_next_e = p_e->m_p_next;
+ if (p_next_e == NULL)
+ {
+ resize_base::notify_erase_search_end();
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key);)
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return false;
+ }
+
+ if (hash_eq_fn_base::operator()(PB_DS_V2F(p_next_e->m_value), r_key))
+ {
+ resize_base::notify_erase_search_end();
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key);)
+ erase_entry_pointer(p_e->m_p_next);
+ do_resize_if_needed_no_throw();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return true;
+ }
+ resize_base::notify_erase_search_collision();
+ p_e = p_next_e;
+ }
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/erase_store_hash_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/erase_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..d72df69
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/erase_store_hash_fn_imps.hpp
@@ -0,0 +1,95 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file erase_store_hash_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s erase related functions,
+ * when the hash value is stored.
+ */
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+erase_in_pos_imp(const_key_reference r_key, const comp_hash& r_pos_hash_pair)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ entry_pointer p_e = m_entries[r_pos_hash_pair.first];
+ resize_base::notify_erase_search_start();
+ if (p_e == NULL)
+ {
+ resize_base::notify_erase_search_end();
+ _GLIBCXX_DEBUG_ONLY(debug_base:: check_key_does_not_exist(r_key);)
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return false;
+ }
+
+ if (hash_eq_fn_base::operator()(PB_DS_V2F(p_e->m_value), p_e->m_hash,
+ r_key, r_pos_hash_pair.second))
+ {
+ resize_base::notify_erase_search_end();
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key);)
+ erase_entry_pointer(m_entries[r_pos_hash_pair.first]);
+ do_resize_if_needed_no_throw();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return true;
+ }
+
+ while (true)
+ {
+ entry_pointer p_next_e = p_e->m_p_next;
+ if (p_next_e == NULL)
+ {
+ resize_base::notify_erase_search_end();
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key);)
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return false;
+ }
+
+ if (hash_eq_fn_base::operator()(PB_DS_V2F(p_next_e->m_value),
+ p_next_e->m_hash, r_key,
+ r_pos_hash_pair.second))
+ {
+ resize_base::notify_erase_search_end();
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key);)
+ erase_entry_pointer(p_e->m_p_next);
+ do_resize_if_needed_no_throw();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return true;
+ }
+ resize_base::notify_erase_search_collision();
+ p_e = p_next_e;
+ }
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/find_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/find_fn_imps.hpp
new file mode 100644
index 0000000..6ca9a03
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/find_fn_imps.hpp
@@ -0,0 +1,71 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file find_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s find related functions.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::point_iterator
+PB_DS_CLASS_C_DEC::
+find(const_key_reference r_key)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return find_key_pointer(r_key, traits_base::m_store_extra_indicator);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_point_iterator
+PB_DS_CLASS_C_DEC::
+find(const_key_reference r_key) const
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return const_cast<PB_DS_CLASS_C_DEC& >(*this).find_key_pointer(r_key,
+ traits_base::m_store_extra_indicator);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::point_iterator
+PB_DS_CLASS_C_DEC::
+find_end()
+{ return NULL; }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_point_iterator
+PB_DS_CLASS_C_DEC::
+find_end() const
+{ return NULL; }
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/find_store_hash_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/find_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..1db51c9
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/find_store_hash_fn_imps.hpp
@@ -0,0 +1,41 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file find_store_hash_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s find related functions,
+ * when the hash value is stored.
+ */
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/info_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/info_fn_imps.hpp
new file mode 100644
index 0000000..dc1519d
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/info_fn_imps.hpp
@@ -0,0 +1,100 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file info_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s entire container info related
+ * functions.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+size() const
+{ return m_num_used_e; }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+max_size() const
+{ return m_entry_allocator.max_size(); }
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+empty() const
+{ return (size() == 0); }
+
+PB_DS_CLASS_T_DEC
+template<typename Other_HT_Map_Type>
+bool
+PB_DS_CLASS_C_DEC::
+operator==(const Other_HT_Map_Type& other) const
+{ return cmp_with_other(other); }
+
+PB_DS_CLASS_T_DEC
+template<typename Other_Map_Type>
+bool
+PB_DS_CLASS_C_DEC::
+cmp_with_other(const Other_Map_Type& other) const
+{
+ if (size() != other.size())
+ return false;
+
+ for (typename Other_Map_Type::const_iterator it = other.begin();
+ it != other.end(); ++it)
+ {
+ const_key_reference r_key =(const_key_reference)PB_DS_V2F(*it);
+ const_mapped_pointer p_mapped_value =
+ const_cast<PB_DS_CLASS_C_DEC& >(*this).
+ find_key_pointer(r_key, traits_base::m_store_extra_indicator);
+
+ if (p_mapped_value == NULL)
+ return false;
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ if (p_mapped_value->second != it->second)
+ return false;
+#endif
+ }
+ return true;
+}
+
+PB_DS_CLASS_T_DEC
+template<typename Other_HT_Map_Type>
+bool
+PB_DS_CLASS_C_DEC::
+operator!=(const Other_HT_Map_Type& other) const
+{ return !operator==(other); }
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/insert_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/insert_fn_imps.hpp
new file mode 100644
index 0000000..0679dbe
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/insert_fn_imps.hpp
@@ -0,0 +1,43 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file insert_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s insert related functions.
+ */
+
+#include <ext/pb_ds/detail/cc_hash_table_map_/insert_no_store_hash_fn_imps.hpp>
+#include <ext/pb_ds/detail/cc_hash_table_map_/insert_store_hash_fn_imps.hpp>
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/insert_no_store_hash_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/insert_no_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..7215ccd
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/insert_no_store_hash_fn_imps.hpp
@@ -0,0 +1,70 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file insert_no_store_hash_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s insert related functions,
+ * when the hash value is not stored.
+ */
+
+PB_DS_CLASS_T_DEC
+inline std::pair<typename PB_DS_CLASS_C_DEC::point_iterator, bool>
+PB_DS_CLASS_C_DEC::
+insert_imp(const_reference r_val, false_type)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ const_key_reference r_key = PB_DS_V2F(r_val);
+ const size_type pos = ranged_hash_fn_base::operator()(r_key);
+ entry_pointer p_e = m_entries[pos];
+ resize_base::notify_insert_search_start();
+
+ while (p_e != NULL && !hash_eq_fn_base::operator()(PB_DS_V2F(p_e->m_value),
+ r_key))
+ {
+ resize_base::notify_insert_search_collision();
+ p_e = p_e->m_p_next;
+ }
+
+ resize_base::notify_insert_search_end();
+ if (p_e != NULL)
+ {
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key);)
+ return std::make_pair(&p_e->m_value, false);
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key);)
+ return std::make_pair(insert_new_imp(r_val, pos), true);
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/insert_store_hash_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/insert_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..fbc284f
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/insert_store_hash_fn_imps.hpp
@@ -0,0 +1,71 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file insert_store_hash_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s insert related functions,
+ * when the hash value is stored.
+ */
+
+PB_DS_CLASS_T_DEC
+inline std::pair<typename PB_DS_CLASS_C_DEC::point_iterator, bool>
+PB_DS_CLASS_C_DEC::
+insert_imp(const_reference r_val, true_type)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ const_key_reference key = PB_DS_V2F(r_val);
+ comp_hash pos_hash_pair = ranged_hash_fn_base::operator()(key);
+ entry_pointer p_e = m_entries[pos_hash_pair.first];
+ resize_base::notify_insert_search_start();
+
+ while (p_e != NULL && !hash_eq_fn_base::operator()(PB_DS_V2F(p_e->m_value),
+ p_e->m_hash,
+ key, pos_hash_pair.second))
+ {
+ resize_base::notify_insert_search_collision();
+ p_e = p_e->m_p_next;
+ }
+
+ resize_base::notify_insert_search_end();
+ if (p_e != NULL)
+ {
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(key);)
+ return std::make_pair(&p_e->m_value, false);
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(key);)
+ return std::make_pair(insert_new_imp(r_val, pos_hash_pair), true);
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/iterators_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/iterators_fn_imps.hpp
new file mode 100644
index 0000000..a7592b7
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/iterators_fn_imps.hpp
@@ -0,0 +1,83 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file iterators_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s iterators related functions, e.g.,
+ * begin().
+ */
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::s_end_it;
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::s_const_end_it;
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+begin()
+{
+ pointer p_value;
+ std::pair<entry_pointer, size_type> pos;
+ get_start_it_state(p_value, pos);
+ return iterator(p_value, pos, this);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+end()
+{ return s_end_it; }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+begin() const
+{
+ pointer p_value;
+ std::pair<entry_pointer, size_type> pos;
+ get_start_it_state(p_value, pos);
+ return const_iterator(p_value, pos, this);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+end() const
+{ return s_const_end_it; }
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/policy_access_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/policy_access_fn_imps.hpp
new file mode 100644
index 0000000..9a661b3
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/policy_access_fn_imps.hpp
@@ -0,0 +1,88 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file policy_access_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s policy access
+ * functions.
+ */
+
+PB_DS_CLASS_T_DEC
+Hash_Fn&
+PB_DS_CLASS_C_DEC::
+get_hash_fn()
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+const Hash_Fn&
+PB_DS_CLASS_C_DEC::
+get_hash_fn() const
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+Eq_Fn&
+PB_DS_CLASS_C_DEC::
+get_eq_fn()
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+const Eq_Fn&
+PB_DS_CLASS_C_DEC::
+get_eq_fn() const
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+Comb_Hash_Fn&
+PB_DS_CLASS_C_DEC::
+get_comb_hash_fn()
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+const Comb_Hash_Fn&
+PB_DS_CLASS_C_DEC::
+get_comb_hash_fn() const
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+Resize_Policy&
+PB_DS_CLASS_C_DEC::
+get_resize_policy()
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+const Resize_Policy&
+PB_DS_CLASS_C_DEC::
+get_resize_policy() const
+{ return *this; }
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/resize_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/resize_fn_imps.hpp
new file mode 100644
index 0000000..66333ec
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/resize_fn_imps.hpp
@@ -0,0 +1,133 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file resize_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s resize related functions.
+ */
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+do_resize_if_needed()
+{
+ if (!resize_base::is_resize_needed())
+ return false;
+ resize_imp(resize_base::get_new_size(m_num_e, m_num_used_e));
+ return true;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+do_resize(size_type len)
+{ resize_imp(resize_base::get_nearest_larger_size(len)); }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+do_resize_if_needed_no_throw()
+{
+ if (!resize_base::is_resize_needed())
+ return;
+
+ __try
+ {
+ resize_imp(resize_base::get_new_size(m_num_e, m_num_used_e));
+ }
+ __catch(...)
+ { }
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+resize_imp(size_type new_size)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ if (new_size == m_num_e)
+ return;
+
+ const size_type old_size = m_num_e;
+ entry_pointer_array a_p_entries_resized;
+
+ // Following line might throw an exception.
+ ranged_hash_fn_base::notify_resized(new_size);
+
+ __try
+ {
+ // Following line might throw an exception.
+ a_p_entries_resized = s_entry_pointer_allocator.allocate(new_size);
+ m_num_e = new_size;
+ }
+ __catch(...)
+ {
+ ranged_hash_fn_base::notify_resized(old_size);
+ __throw_exception_again;
+ }
+
+ // At this point no exceptions can be thrown.
+ resize_imp_no_exceptions(new_size, a_p_entries_resized, old_size);
+ Resize_Policy::notify_resized(new_size);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+resize_imp_no_exceptions(size_type new_size, entry_pointer_array a_p_entries_resized, size_type old_size)
+{
+ std::fill(a_p_entries_resized, a_p_entries_resized + m_num_e,
+ entry_pointer(NULL));
+
+ for (size_type pos = 0; pos < old_size; ++pos)
+ {
+ entry_pointer p_e = m_entries[pos];
+ while (p_e != NULL)
+ p_e = resize_imp_no_exceptions_reassign_pointer(p_e, a_p_entries_resized, traits_base::m_store_extra_indicator);
+ }
+
+ m_num_e = new_size;
+ _GLIBCXX_DEBUG_ONLY(assert_entry_pointer_array_valid(a_p_entries_resized);)
+ s_entry_pointer_allocator.deallocate(m_entries, old_size);
+ m_entries = a_p_entries_resized;
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+#include <ext/pb_ds/detail/cc_hash_table_map_/resize_no_store_hash_fn_imps.hpp>
+#include <ext/pb_ds/detail/cc_hash_table_map_/resize_store_hash_fn_imps.hpp>
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/resize_no_store_hash_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/resize_no_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..6577630
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/resize_no_store_hash_fn_imps.hpp
@@ -0,0 +1,54 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file resize_no_store_hash_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s resize related functions, when the
+ * hash value is not stored.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::entry_pointer
+PB_DS_CLASS_C_DEC::
+resize_imp_no_exceptions_reassign_pointer(entry_pointer p_e, entry_pointer_array a_p_entries_resized, false_type)
+{
+ const size_type hash_pos =
+ ranged_hash_fn_base::operator()(PB_DS_V2F(p_e->m_value));
+
+ entry_pointer const p_next_e = p_e->m_p_next;
+ p_e->m_p_next = a_p_entries_resized[hash_pos];
+ a_p_entries_resized[hash_pos] = p_e;
+ return p_next_e;
+}
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/resize_store_hash_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/resize_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..c1adb61
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/resize_store_hash_fn_imps.hpp
@@ -0,0 +1,54 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file resize_store_hash_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s resize related functions, when the
+ * hash value is stored.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::entry_pointer
+PB_DS_CLASS_C_DEC::
+resize_imp_no_exceptions_reassign_pointer(entry_pointer p_e, entry_pointer_array a_p_entries_resized, true_type)
+{
+ const comp_hash pos_hash_pair =
+ ranged_hash_fn_base::operator()(PB_DS_V2F(p_e->m_value), p_e->m_hash);
+
+ entry_pointer const p_next_e = p_e->m_p_next;
+ p_e->m_p_next = a_p_entries_resized[pos_hash_pair.first];
+ a_p_entries_resized[pos_hash_pair.first] = p_e;
+ return p_next_e;
+}
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/size_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/size_fn_imps.hpp
new file mode 100644
index 0000000..0d5ec85
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/size_fn_imps.hpp
@@ -0,0 +1,59 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file size_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s entire container size related
+ * functions.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+size() const
+{ return m_num_used_e; }
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+empty() const
+{ return (size() == 0); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+max_size() const
+{ return s_entry_allocator.max_size(); }
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/standard_policies.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/standard_policies.hpp
new file mode 100644
index 0000000..b9c1ee2
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/standard_policies.hpp
@@ -0,0 +1,46 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file standard_policies.hpp
+ * Contains standard policies for cc_ht_map types.
+ */
+
+#ifndef PB_DS_CC_HT_MAP_STANDARD_POLICIES_HPP
+#define PB_DS_CC_HT_MAP_STANDARD_POLICIES_HPP
+
+#include <ext/pb_ds/detail/standard_policies.hpp>
+
+#endif // #ifndef PB_DS_CC_HT_MAP_STANDARD_POLICIES_HPP
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/trace_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/trace_fn_imps.hpp
new file mode 100644
index 0000000..6fa5676
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cc_hash_table_map_/trace_fn_imps.hpp
@@ -0,0 +1,72 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file trace_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s trace-mode functions.
+ */
+
+#ifdef PB_DS_HT_MAP_TRACE_
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+trace() const
+{
+ std::cerr << static_cast<unsigned long>(m_num_e) << " "
+ << static_cast<unsigned long>(m_num_used_e) << std::endl;
+
+ for (size_type i = 0; i < m_num_e; ++i)
+ {
+ std::cerr << static_cast<unsigned long>(i) << " ";
+ trace_list(m_entries[i]);
+ std::cerr << std::endl;
+ }
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+trace_list(const_entry_pointer p_l) const
+{
+ size_type iterated_num_used_e = 0;
+ while (p_l != NULL)
+ {
+ std::cerr << PB_DS_V2F(p_l->m_value) << " ";
+ p_l = p_l->m_p_next;
+ }
+}
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cond_dealtor.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cond_dealtor.hpp
new file mode 100644
index 0000000..1ee48a2
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/cond_dealtor.hpp
@@ -0,0 +1,125 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file cond_dealtor.hpp
+ * Contains a conditional deallocator.
+ */
+
+#ifndef PB_DS_COND_DEALTOR_HPP
+#define PB_DS_COND_DEALTOR_HPP
+
+namespace __gnu_pbds
+{
+
+ namespace detail
+ {
+
+#define PB_DS_COND_DEALTOR_CLASS_T_DEC \
+ template<typename Entry, class Allocator>
+
+#define PB_DS_COND_DEALTOR_CLASS_C_DEC \
+ cond_dealtor< \
+ Entry, \
+ Allocator>
+
+ template<typename Entry, class Allocator>
+ class cond_dealtor
+ {
+ public:
+ typedef
+ typename Allocator::template rebind<Entry>::other
+ entry_allocator;
+
+ typedef typename entry_allocator::pointer entry_pointer;
+
+ public:
+ inline
+ cond_dealtor(entry_pointer p_e);
+
+ inline
+ ~cond_dealtor();
+
+ inline void
+ set_no_action();
+
+ private:
+ entry_pointer m_p_e;
+
+ bool m_no_action_destructor;
+
+ static entry_allocator s_alloc;
+ };
+
+ PB_DS_COND_DEALTOR_CLASS_T_DEC
+ typename PB_DS_COND_DEALTOR_CLASS_C_DEC::entry_allocator
+ PB_DS_COND_DEALTOR_CLASS_C_DEC::s_alloc;
+
+ PB_DS_COND_DEALTOR_CLASS_T_DEC
+ inline
+ PB_DS_COND_DEALTOR_CLASS_C_DEC::
+ cond_dealtor(entry_pointer p_e) :
+ m_p_e(p_e),
+ m_no_action_destructor(false)
+ { }
+
+ PB_DS_COND_DEALTOR_CLASS_T_DEC
+ inline void
+ PB_DS_COND_DEALTOR_CLASS_C_DEC::
+ set_no_action()
+ {
+ m_no_action_destructor = true;
+ }
+
+ PB_DS_COND_DEALTOR_CLASS_T_DEC
+ inline
+ PB_DS_COND_DEALTOR_CLASS_C_DEC::
+ ~cond_dealtor()
+ {
+ if (m_no_action_destructor)
+ return;
+
+ s_alloc.deallocate(m_p_e, 1);
+ }
+
+#undef PB_DS_COND_DEALTOR_CLASS_T_DEC
+#undef PB_DS_COND_DEALTOR_CLASS_C_DEC
+
+ } // namespace detail
+
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_COND_DEALTOR_HPP
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/constructors_destructor_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/constructors_destructor_fn_imps.hpp
new file mode 100644
index 0000000..20c9988
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/constructors_destructor_fn_imps.hpp
@@ -0,0 +1,103 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructors_destructor_fn_imps.hpp
+ * Contains constructors_destructor_fn_imps applicable to different containers.
+ */
+
+inline
+PB_DS_CLASS_NAME()
+{ }
+
+inline
+PB_DS_CLASS_NAME(const PB_DS_CLASS_NAME& other)
+: base_type((const base_type&)other)
+{ }
+
+template<typename T0>
+inline
+PB_DS_CLASS_NAME(T0 t0) : base_type(t0)
+{ }
+
+template<typename T0, typename T1>
+inline
+PB_DS_CLASS_NAME(T0 t0, T1 t1) : base_type(t0, t1)
+{ }
+
+template<typename T0, typename T1, typename T2>
+inline
+PB_DS_CLASS_NAME(T0 t0, T1 t1, T2 t2) : base_type(t0, t1, t2)
+{ }
+
+template<typename T0, typename T1, typename T2, typename T3>
+inline
+PB_DS_CLASS_NAME(T0 t0, T1 t1, T2 t2, T3 t3)
+: base_type(t0, t1, t2, t3)
+{ }
+
+template<typename T0, typename T1, typename T2, typename T3, typename T4>
+inline
+PB_DS_CLASS_NAME(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4)
+: base_type(t0, t1, t2, t3, t4)
+{ }
+
+template<typename T0, typename T1, typename T2, typename T3, typename T4,
+ typename T5>
+inline
+PB_DS_CLASS_NAME(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5)
+: base_type(t0, t1, t2, t3, t4, t5)
+{ }
+
+template<typename T0, typename T1, typename T2, typename T3, typename T4,
+ typename T5, typename T6>
+inline
+PB_DS_CLASS_NAME(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6)
+: base_type(t0, t1, t2, t3, t4, t5, t6)
+{ }
+
+template<typename T0, typename T1, typename T2, typename T3, typename T4,
+ typename T5, typename T6, typename T7>
+inline
+PB_DS_CLASS_NAME(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7)
+: base_type(t0, t1, t2, t3, t4, t5, t6, t7)
+{ }
+
+template<typename T0, typename T1, typename T2, typename T3, typename T4,
+ typename T5, typename T6, typename T7, typename T8>
+inline
+PB_DS_CLASS_NAME(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8)
+: base_type(t0, t1, t2, t3, t4, t5, t6, t7, t8)
+{ }
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/container_base_dispatch.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/container_base_dispatch.hpp
new file mode 100644
index 0000000..7f8d87a
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/container_base_dispatch.hpp
@@ -0,0 +1,332 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file container_base_dispatch.hpp
+ * Contains an associative container dispatching base.
+ */
+
+#ifndef PB_DS_ASSOC_CNTNR_BASE_DS_DISPATCHER_HPP
+#define PB_DS_ASSOC_CNTNR_BASE_DS_DISPATCHER_HPP
+
+#include <ext/typelist.h>
+
+#define PB_DS_DATA_TRUE_INDICATOR
+#include <ext/pb_ds/detail/list_update_map_/lu_map_.hpp>
+#undef PB_DS_DATA_TRUE_INDICATOR
+
+#define PB_DS_DATA_FALSE_INDICATOR
+#include <ext/pb_ds/detail/list_update_map_/lu_map_.hpp>
+#undef PB_DS_DATA_FALSE_INDICATOR
+
+#define PB_DS_DATA_TRUE_INDICATOR
+#include <ext/pb_ds/detail/rb_tree_map_/rb_tree_.hpp>
+#undef PB_DS_DATA_TRUE_INDICATOR
+
+#define PB_DS_DATA_FALSE_INDICATOR
+#include <ext/pb_ds/detail/rb_tree_map_/rb_tree_.hpp>
+#undef PB_DS_DATA_FALSE_INDICATOR
+
+#define PB_DS_DATA_TRUE_INDICATOR
+#include <ext/pb_ds/detail/splay_tree_/splay_tree_.hpp>
+#undef PB_DS_DATA_TRUE_INDICATOR
+
+#define PB_DS_DATA_FALSE_INDICATOR
+#include <ext/pb_ds/detail/splay_tree_/splay_tree_.hpp>
+#undef PB_DS_DATA_FALSE_INDICATOR
+
+#define PB_DS_DATA_TRUE_INDICATOR
+#include <ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp>
+#undef PB_DS_DATA_TRUE_INDICATOR
+
+#define PB_DS_DATA_FALSE_INDICATOR
+#include <ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp>
+#undef PB_DS_DATA_FALSE_INDICATOR
+
+#define PB_DS_DATA_TRUE_INDICATOR
+#include <ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp>
+#undef PB_DS_DATA_TRUE_INDICATOR
+
+#define PB_DS_DATA_FALSE_INDICATOR
+#include <ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp>
+#undef PB_DS_DATA_FALSE_INDICATOR
+
+#define PB_DS_DATA_TRUE_INDICATOR
+#include <ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp>
+#undef PB_DS_DATA_TRUE_INDICATOR
+
+#define PB_DS_DATA_FALSE_INDICATOR
+#include <ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp>
+#undef PB_DS_DATA_FALSE_INDICATOR
+
+#define PB_DS_DATA_TRUE_INDICATOR
+#include <ext/pb_ds/detail/pat_trie_/pat_trie_.hpp>
+#undef PB_DS_DATA_TRUE_INDICATOR
+
+#define PB_DS_DATA_FALSE_INDICATOR
+#include <ext/pb_ds/detail/pat_trie_/pat_trie_.hpp>
+#undef PB_DS_DATA_FALSE_INDICATOR
+
+namespace __gnu_pbds
+{
+namespace detail
+{
+ // Primary template.
+ template<typename Key, typename Mapped, typename Data_Structure_Taq,
+ typename Policy_Tl, typename Alloc>
+ struct container_base_dispatch;
+
+ template<typename Key, typename Mapped, typename Policy_Tl, typename Alloc>
+ struct container_base_dispatch<Key, Mapped, list_update_tag,
+ Policy_Tl, Alloc>
+ {
+ private:
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
+ typedef typename at0::type at0t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
+ typedef typename at1::type at1t;
+
+ public:
+ typedef lu_map_data_<Key, Mapped, at0t, Alloc, at1t> type;
+ };
+
+ template<typename Key, typename Policy_Tl, typename Alloc>
+ struct container_base_dispatch<Key, null_mapped_type, list_update_tag,
+ Policy_Tl, Alloc>
+ {
+ private:
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
+ typedef typename at0::type at0t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
+ typedef typename at1::type at1t;
+
+ public:
+ typedef lu_map_no_data_<Key, null_mapped_type, at0t, Alloc, at1t> type;
+ };
+
+ template<typename Key, typename Mapped, typename Policy_Tl, typename Alloc>
+ struct container_base_dispatch<Key, Mapped, pat_trie_tag, Policy_Tl, Alloc>
+ {
+ private:
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
+ typedef typename at1::type at1t;
+
+ public:
+ typedef pat_trie_data_<Key, Mapped, at1t, Alloc> type;
+ };
+
+ template<typename Key, typename Policy_Tl, typename Alloc>
+ struct container_base_dispatch<Key, null_mapped_type, pat_trie_tag,
+ Policy_Tl, Alloc>
+ {
+ private:
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
+ typedef typename at1::type at1t;
+
+ public:
+ typedef pat_trie_no_data_<Key, null_mapped_type, at1t, Alloc> type;
+ };
+
+ template<typename Key, typename Mapped, typename Policy_Tl, typename Alloc>
+ struct container_base_dispatch<Key, Mapped, rb_tree_tag, Policy_Tl, Alloc>
+ {
+ private:
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
+ typedef typename at0::type at0t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
+ typedef typename at1::type at1t;
+
+ public:
+ typedef rb_tree_data_<Key, Mapped, at0t, at1t, Alloc> type;
+ };
+
+ template<typename Key, typename Policy_Tl, typename Alloc>
+ struct container_base_dispatch<Key, null_mapped_type, rb_tree_tag,
+ Policy_Tl, Alloc>
+ {
+ private:
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
+ typedef typename at0::type at0t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
+ typedef typename at1::type at1t;
+
+ public:
+ typedef rb_tree_no_data_<Key, null_mapped_type, at0t, at1t, Alloc> type;
+ };
+
+ template<typename Key, typename Mapped, typename Policy_Tl, typename Alloc>
+ struct container_base_dispatch<Key, Mapped, splay_tree_tag,
+ Policy_Tl, Alloc>
+ {
+ private:
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
+ typedef typename at0::type at0t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
+ typedef typename at1::type at1t;
+
+ public:
+ typedef splay_tree_data_<Key, Mapped, at0t, at1t, Alloc> type;
+ };
+
+ template<typename Key, typename Policy_Tl, typename Alloc>
+ struct container_base_dispatch<Key, null_mapped_type, splay_tree_tag,
+ Policy_Tl, Alloc>
+ {
+ private:
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
+ typedef typename at0::type at0t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
+ typedef typename at1::type at1t;
+
+ public:
+ typedef splay_tree_no_data_<Key, null_mapped_type, at0t, at1t, Alloc> type;
+ };
+
+ template<typename Key, typename Mapped, typename Policy_Tl, typename Alloc>
+ struct container_base_dispatch<Key, Mapped, ov_tree_tag, Policy_Tl, Alloc>
+ {
+ private:
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
+ typedef typename at0::type at0t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
+ typedef typename at1::type at1t;
+
+ public:
+ typedef ov_tree_data_<Key, Mapped, at0t, at1t, Alloc> type;
+ };
+
+ template<typename Key, typename Policy_Tl, typename Alloc>
+ struct container_base_dispatch<Key, null_mapped_type, ov_tree_tag,
+ Policy_Tl, Alloc>
+ {
+ private:
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
+ typedef typename at0::type at0t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
+ typedef typename at1::type at1t;
+
+ public:
+ typedef ov_tree_no_data_<Key, null_mapped_type, at0t, at1t, Alloc> type;
+ };
+
+ template<typename Key, typename Mapped, typename Policy_Tl, typename Alloc>
+ struct container_base_dispatch<Key, Mapped, cc_hash_tag, Policy_Tl, Alloc>
+ {
+ private:
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
+ typedef typename at0::type at0t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
+ typedef typename at1::type at1t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 2> at2;
+ typedef typename at2::type at2t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 3> at3;
+ typedef typename at3::type at3t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 4> at4;
+ typedef typename at4::type at4t;
+
+ public:
+ typedef cc_ht_map_data_<Key, Mapped, at0t, at1t, Alloc, at3t::value,
+ at4t, at2t> type;
+ };
+
+ template<typename Key, typename Policy_Tl, typename Alloc>
+ struct container_base_dispatch<Key, null_mapped_type, cc_hash_tag,
+ Policy_Tl, Alloc>
+ {
+ private:
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
+ typedef typename at0::type at0t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
+ typedef typename at1::type at1t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 2> at2;
+ typedef typename at2::type at2t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 3> at3;
+ typedef typename at3::type at3t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 4> at4;
+ typedef typename at4::type at4t;
+
+ public:
+ typedef cc_ht_map_no_data_<Key, null_mapped_type, at0t, at1t, Alloc,
+ at3t::value, at4t, at2t> type;
+ };
+
+ template<typename Key, typename Mapped, typename Policy_Tl, typename Alloc>
+ struct container_base_dispatch<Key, Mapped, gp_hash_tag, Policy_Tl, Alloc>
+ {
+ private:
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
+ typedef typename at0::type at0t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
+ typedef typename at1::type at1t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 2> at2;
+ typedef typename at2::type at2t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 3> at3;
+ typedef typename at3::type at3t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 4> at4;
+ typedef typename at4::type at4t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 5> at5;
+ typedef typename at5::type at5t;
+
+ public:
+ typedef gp_ht_map_data_<Key, Mapped, at0t, at1t, Alloc, at3t::value,
+ at4t, at5t, at2t> type;
+ };
+
+ template<typename Key, typename Policy_Tl, typename Alloc>
+ struct container_base_dispatch<Key, null_mapped_type, gp_hash_tag,
+ Policy_Tl, Alloc>
+ {
+ private:
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
+ typedef typename at0::type at0t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
+ typedef typename at1::type at1t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 2> at2;
+ typedef typename at2::type at2t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 3> at3;
+ typedef typename at3::type at3t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 4> at4;
+ typedef typename at4::type at4t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 5> at5;
+ typedef typename at5::type at5t;
+
+ public:
+ typedef gp_ht_map_no_data_<Key, null_mapped_type, at0t, at1t, Alloc,
+ at3t::value, at4t, at5t, at2t> type;
+ };
+} // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/debug_map_base.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/debug_map_base.hpp
new file mode 100644
index 0000000..6f2defb
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/debug_map_base.hpp
@@ -0,0 +1,360 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_map_base.hpp
+ * Contains a debug-mode base for all maps.
+ */
+
+#ifndef PB_DS_DEBUG_MAP_BASE_HPP
+#define PB_DS_DEBUG_MAP_BASE_HPP
+
+#ifdef _GLIBCXX_DEBUG
+
+#include <list>
+#include <utility>
+#include <cstdlib>
+#include <iostream>
+#include <ext/throw_allocator.h>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ // Need std::pair ostream extractor.
+ template<typename _CharT, typename _Traits, typename _Tp1, typename _Tp2>
+ inline std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __out,
+ const std::pair<_Tp1, _Tp2>& p)
+ { return (__out << '(' << p.first << ',' << p.second << ')'); }
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, class Eq_Fn, typename Const_Key_Reference>
+
+#define PB_DS_CLASS_C_DEC \
+ debug_map_base<Key, Eq_Fn, Const_Key_Reference>
+
+ template<typename Key, class Eq_Fn, typename Const_Key_Reference>
+ class debug_map_base
+ {
+ private:
+ typedef typename std::allocator< Key> key_allocator;
+
+ typedef typename key_allocator::size_type size_type;
+
+ typedef Const_Key_Reference const_key_reference;
+
+ protected:
+ debug_map_base();
+
+ debug_map_base(const PB_DS_CLASS_C_DEC& other);
+
+ ~debug_map_base();
+
+ inline void
+ insert_new(const_key_reference r_key);
+
+ inline void
+ erase_existing(const_key_reference r_key);
+
+ void
+ clear();
+
+ inline void
+ check_key_exists(const_key_reference r_key) const;
+
+ inline void
+ check_key_does_not_exist(const_key_reference r_key) const;
+
+ inline void
+ check_size(size_type size) const;
+
+ void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ template<typename Cmp_Fn>
+ void
+ split(const_key_reference, Cmp_Fn, PB_DS_CLASS_C_DEC&);
+
+ void
+ join(PB_DS_CLASS_C_DEC& other);
+
+ private:
+ typedef std::list< Key> key_set;
+ typedef typename key_set::iterator key_set_iterator;
+ typedef typename key_set::const_iterator const_key_set_iterator;
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid() const;
+#endif
+
+ const_key_set_iterator
+ find(const_key_reference r_key) const;
+
+ key_set_iterator
+ find(const_key_reference r_key);
+
+ key_set m_key_set;
+ Eq_Fn m_eq;
+ };
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ debug_map_base()
+ { _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ debug_map_base(const PB_DS_CLASS_C_DEC& other) : m_key_set(other.m_key_set)
+ { _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ~debug_map_base()
+ { _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+ PB_DS_CLASS_T_DEC
+ inline void
+ PB_DS_CLASS_C_DEC::
+ insert_new(const_key_reference r_key)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ __gnu_cxx::throw_allocator<char> alloc;
+ const double orig_throw_prob = alloc.get_throw_prob();
+ alloc.set_throw_prob(0);
+ if (find(r_key) != m_key_set.end())
+ {
+ std::cerr << "insert_new" << r_key << std::endl;
+ std::abort();
+ }
+
+ __try
+ {
+ m_key_set.push_back(r_key);
+ }
+ __catch(...)
+ {
+ std::cerr << "insert_new" << r_key << std::endl;
+ std::abort();
+ }
+ alloc.set_throw_prob(orig_throw_prob);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline void
+ PB_DS_CLASS_C_DEC::
+ erase_existing(const_key_reference r_key)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ key_set_iterator it = find(r_key);
+ if (it == m_key_set.end())
+ {
+ std::cerr << "erase_existing" << r_key << std::endl;
+ std::abort();
+ }
+ m_key_set.erase(it);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ clear()
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ m_key_set.clear();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline void
+ PB_DS_CLASS_C_DEC::
+ check_key_exists(const_key_reference r_key) const
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ if (find(r_key) == m_key_set.end())
+ {
+ std::cerr << "check_key_exists" << r_key << std::endl;
+ std::abort();
+ }
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline void
+ PB_DS_CLASS_C_DEC::
+ check_key_does_not_exist(const_key_reference r_key) const
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ if (find(r_key) != m_key_set.end())
+ {
+ using std::cerr;
+ using std::endl;
+ cerr << "check_key_does_not_exist" << r_key << endl;
+ std::abort();
+ }
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline void
+ PB_DS_CLASS_C_DEC::
+ check_size(size_type size) const
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ const size_type key_set_size = m_key_set.size();
+ if (size != key_set_size)
+ {
+ std::cerr << "check_size " << size
+ << " " << key_set_size << std::endl;
+ std::abort();
+ }
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ swap(PB_DS_CLASS_C_DEC& other)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ m_key_set.swap(other.m_key_set);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::const_key_set_iterator
+ PB_DS_CLASS_C_DEC::
+ find(const_key_reference r_key) const
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ typedef const_key_set_iterator iterator_type;
+ for (iterator_type it = m_key_set.begin(); it != m_key_set.end(); ++it)
+ if (m_eq(*it, r_key))
+ return it;
+ return m_key_set.end();
+ }
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::key_set_iterator
+ PB_DS_CLASS_C_DEC::
+ find(const_key_reference r_key)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ key_set_iterator it = m_key_set.begin();
+ while (it != m_key_set.end())
+ {
+ if (m_eq(*it, r_key))
+ return it;
+ ++it;
+ }
+ return it;
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+#ifdef _GLIBCXX_DEBUG
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ assert_valid() const
+ {
+ const_key_set_iterator prime_it = m_key_set.begin();
+ while (prime_it != m_key_set.end())
+ {
+ const_key_set_iterator sec_it = prime_it;
+ ++sec_it;
+ while (sec_it != m_key_set.end())
+ {
+ _GLIBCXX_DEBUG_ASSERT(!m_eq(*sec_it, *prime_it));
+ _GLIBCXX_DEBUG_ASSERT(!m_eq(*prime_it, *sec_it));
+ ++sec_it;
+ }
+ ++prime_it;
+ }
+ }
+#endif
+
+ PB_DS_CLASS_T_DEC
+ template<typename Cmp_Fn>
+ void
+ PB_DS_CLASS_C_DEC::
+ split(const_key_reference r_key, Cmp_Fn cmp_fn, PB_DS_CLASS_C_DEC& other)
+ {
+ __gnu_cxx::throw_allocator<char> alloc;
+ const double orig_throw_prob = alloc.get_throw_prob();
+ alloc.set_throw_prob(0);
+ other.clear();
+ key_set_iterator it = m_key_set.begin();
+ while (it != m_key_set.end())
+ if (cmp_fn(r_key, * it))
+ {
+ other.insert_new(*it);
+ it = m_key_set.erase(it);
+ }
+ else
+ ++it;
+ alloc.set_throw_prob(orig_throw_prob);
+ }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ join(PB_DS_CLASS_C_DEC& other)
+ {
+ __gnu_cxx::throw_allocator<char> alloc;
+ const double orig_throw_prob = alloc.get_throw_prob();
+ alloc.set_throw_prob(0);
+ key_set_iterator it = other.m_key_set.begin();
+ while (it != other.m_key_set.end())
+ {
+ insert_new(*it);
+ it = other.m_key_set.erase(it);
+ }
+ _GLIBCXX_DEBUG_ASSERT(other.m_key_set.empty());
+ alloc.set_throw_prob(orig_throw_prob);
+ }
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+} // namespace detail
+} // namespace __gnu_pbds
+
+#endif
+
+#endif
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/eq_fn/eq_by_less.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/eq_fn/eq_by_less.hpp
new file mode 100644
index 0000000..ec95bca
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/eq_fn/eq_by_less.hpp
@@ -0,0 +1,68 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file eq_by_less.hpp
+ * Contains an equivalence function.
+ */
+
+#ifndef PB_DS_EQ_BY_LESS_HPP
+#define PB_DS_EQ_BY_LESS_HPP
+
+#include <utility>
+#include <functional>
+#include <vector>
+#include <assert.h>
+#include <ext/pb_ds/detail/types_traits.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ template<typename Key, class Cmp_Fn>
+ struct eq_by_less : private Cmp_Fn
+ {
+ bool
+ operator()(const Key& r_lhs, const Key& r_rhs) const
+ {
+ const bool l = Cmp_Fn::operator()(r_lhs, r_rhs);
+ const bool g = Cmp_Fn::operator()(r_rhs, r_lhs);
+ return !(l || g);
+ }
+ };
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_EQ_BY_LESS_HPP
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/eq_fn/hash_eq_fn.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/eq_fn/hash_eq_fn.hpp
new file mode 100644
index 0000000..b21c252
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/eq_fn/hash_eq_fn.hpp
@@ -0,0 +1,179 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file hash_eq_fn.hpp
+ * Contains 2 eqivalence functions, one employing a hash value,
+ * and one ignoring it.
+ */
+
+#ifndef PB_DS_HASH_EQ_FN_HPP
+#define PB_DS_HASH_EQ_FN_HPP
+
+#include <utility>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ template<typename Key, class Eq_Fn, class Allocator, bool Store_Hash>
+ struct hash_eq_fn;
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, class Eq_Fn, class Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ hash_eq_fn<Key, Eq_Fn, Allocator, false>
+
+ /**
+ * Specialization 1- The client requests that hash values not be stored.
+ **/
+ template<typename Key, class Eq_Fn, class Allocator>
+ struct hash_eq_fn<Key, Eq_Fn, Allocator, false> : public Eq_Fn
+ {
+ typedef Eq_Fn eq_fn_base;
+
+ typedef typename Allocator::template rebind<Key>::other key_allocator;
+
+ typedef typename key_allocator::const_reference const_key_reference;
+
+ hash_eq_fn();
+
+ hash_eq_fn(const Eq_Fn& r_eq_fn);
+
+ inline bool
+ operator()(const_key_reference r_lhs_key, const_key_reference r_rhs_key) const;
+
+ inline void
+ swap(const PB_DS_CLASS_C_DEC& other);
+ };
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ hash_eq_fn()
+ { }
+
+ PB_DS_CLASS_T_DEC
+ inline void
+ PB_DS_CLASS_C_DEC::
+ swap(const PB_DS_CLASS_C_DEC& other)
+ { std::swap((Eq_Fn& )(*this), (Eq_Fn& )other); }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ hash_eq_fn(const Eq_Fn& r_eq_fn) :
+ Eq_Fn(r_eq_fn)
+ { }
+
+ PB_DS_CLASS_T_DEC
+ inline bool
+ PB_DS_CLASS_C_DEC::
+ operator()(const_key_reference r_lhs_key, const_key_reference r_rhs_key) const
+ { return (eq_fn_base::operator()(r_lhs_key, r_rhs_key)); }
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, class Eq_Fn, class Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ hash_eq_fn<Key, Eq_Fn, Allocator, true>
+
+ /**
+ * Specialization 2- The client requests that hash values be stored.
+ **/
+ template<typename Key, class Eq_Fn, class Allocator>
+ struct hash_eq_fn<Key, Eq_Fn, Allocator, true> :
+ public Eq_Fn
+ {
+ typedef typename Allocator::size_type size_type;
+
+ typedef Eq_Fn eq_fn_base;
+
+ typedef typename Allocator::template rebind<Key>::other key_allocator;
+
+ typedef typename key_allocator::const_reference const_key_reference;
+
+ hash_eq_fn();
+
+ hash_eq_fn(const Eq_Fn& r_eq_fn);
+
+ inline bool
+ operator()(const_key_reference r_lhs_key, size_type lhs_hash,
+ const_key_reference r_rhs_key, size_type rhs_hash) const;
+
+ inline void
+ swap(const PB_DS_CLASS_C_DEC& other);
+ };
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ hash_eq_fn()
+ { }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ hash_eq_fn(const Eq_Fn& r_eq_fn) :
+ Eq_Fn(r_eq_fn)
+ { }
+
+ PB_DS_CLASS_T_DEC
+ inline bool
+ PB_DS_CLASS_C_DEC::
+ operator()(const_key_reference r_lhs_key, size_type lhs_hash,
+ const_key_reference r_rhs_key, size_type rhs_hash) const
+ {
+ _GLIBCXX_DEBUG_ASSERT(!eq_fn_base::operator()(r_lhs_key, r_rhs_key)
+ || lhs_hash == rhs_hash);
+
+ return (lhs_hash == rhs_hash &&
+ eq_fn_base::operator()(r_lhs_key, r_rhs_key));
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline void
+ PB_DS_CLASS_C_DEC::
+ swap(const PB_DS_CLASS_C_DEC& other)
+ { std::swap((Eq_Fn& )(*this), (Eq_Fn& )(other)); }
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_fn_imps.hpp
new file mode 100644
index 0000000..4ac145d
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_fn_imps.hpp
@@ -0,0 +1,223 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructor_destructor_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s constructors, destructor,
+ * and related functions.
+ */
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::entry_allocator
+PB_DS_CLASS_C_DEC::s_entry_allocator;
+
+PB_DS_CLASS_T_DEC
+template<typename It>
+void
+PB_DS_CLASS_C_DEC::
+copy_from_range(It first_it, It last_it)
+{
+ while (first_it != last_it)
+ insert(*(first_it++));
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME()
+: ranged_probe_fn_base(resize_base::get_nearest_larger_size(1)),
+ m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
+ m_entries(s_entry_allocator.allocate(m_num_e))
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const Hash_Fn& r_hash_fn)
+: ranged_probe_fn_base(resize_base::get_nearest_larger_size(1), r_hash_fn),
+ m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
+ m_entries(s_entry_allocator.allocate(m_num_e))
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const Hash_Fn& r_hash_fn, const Eq_Fn& r_eq_fn)
+: hash_eq_fn_base(r_eq_fn),
+ ranged_probe_fn_base(resize_base::get_nearest_larger_size(1), r_hash_fn),
+ m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
+ m_entries(s_entry_allocator.allocate(m_num_e))
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const Hash_Fn& r_hash_fn, const Eq_Fn& r_eq_fn,
+ const Comb_Probe_Fn& r_comb_hash_fn)
+: hash_eq_fn_base(r_eq_fn),
+ ranged_probe_fn_base(resize_base::get_nearest_larger_size(1),
+ r_hash_fn, r_comb_hash_fn),
+ m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
+ m_entries(s_entry_allocator.allocate(m_num_e))
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const Hash_Fn& r_hash_fn, const Eq_Fn& r_eq_fn,
+ const Comb_Probe_Fn& comb_hash_fn, const Probe_Fn& prober)
+: hash_eq_fn_base(r_eq_fn),
+ ranged_probe_fn_base(resize_base::get_nearest_larger_size(1),
+ r_hash_fn, comb_hash_fn, prober),
+ m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
+ m_entries(s_entry_allocator.allocate(m_num_e))
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const Hash_Fn& r_hash_fn, const Eq_Fn& r_eq_fn,
+ const Comb_Probe_Fn& comb_hash_fn, const Probe_Fn& prober,
+ const Resize_Policy& r_resize_policy)
+: hash_eq_fn_base(r_eq_fn), resize_base(r_resize_policy),
+ ranged_probe_fn_base(resize_base::get_nearest_larger_size(1),
+ r_hash_fn, comb_hash_fn, prober),
+ m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
+ m_entries(s_entry_allocator.allocate(m_num_e))
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const PB_DS_CLASS_C_DEC& other) :
+#ifdef _GLIBCXX_DEBUG
+ debug_base(other),
+#endif
+ hash_eq_fn_base(other),
+ resize_base(other),
+ ranged_probe_fn_base(other),
+ m_num_e(other.m_num_e),
+ m_num_used_e(other.m_num_used_e),
+ m_entries(s_entry_allocator.allocate(m_num_e))
+{
+ for (size_type i = 0; i < m_num_e; ++i)
+ m_entries[i].m_stat = (entry_status)empty_entry_status;
+
+ __try
+ {
+ for (size_type i = 0; i < m_num_e; ++i)
+ {
+ m_entries[i].m_stat = other.m_entries[i].m_stat;
+ if (m_entries[i].m_stat == valid_entry_status)
+ new (m_entries + i) entry(other.m_entries[i]);
+ }
+ }
+ __catch(...)
+ {
+ deallocate_all();
+ __throw_exception_again;
+ }
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+~PB_DS_CLASS_NAME()
+{ deallocate_all(); }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid());
+ std::swap(m_num_e, other.m_num_e);
+ std::swap(m_num_used_e, other.m_num_used_e);
+ std::swap(m_entries, other.m_entries);
+ ranged_probe_fn_base::swap(other);
+ hash_eq_fn_base::swap(other);
+ resize_base::swap(other);
+ _GLIBCXX_DEBUG_ONLY(debug_base::swap(other));
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid());
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+deallocate_all()
+{
+ clear();
+ erase_all_valid_entries(m_entries, m_num_e);
+ s_entry_allocator.deallocate(m_entries, m_num_e);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+erase_all_valid_entries(entry_array a_entries_resized, size_type len)
+{
+ for (size_type pos = 0; pos < len; ++pos)
+ {
+ entry_pointer p_e = &a_entries_resized[pos];
+ if (p_e->m_stat == valid_entry_status)
+ p_e->m_value.~value_type();
+ }
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+initialize()
+{
+ Resize_Policy::notify_resized(m_num_e);
+ Resize_Policy::notify_cleared();
+ ranged_probe_fn_base::notify_resized(m_num_e);
+ for (size_type i = 0; i < m_num_e; ++i)
+ m_entries[i].m_stat = empty_entry_status;
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_no_store_hash_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_no_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..ec80698
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_no_store_hash_fn_imps.hpp
@@ -0,0 +1,53 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructor_destructor_no_store_hash_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s constructors, destructor,
+ * and related functions.
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+constructor_insert_new_imp(const_mapped_reference r_val, size_type pos,
+ false_type)
+{
+ _GLIBCXX_DEBUG_ASSERT(m_entries[pos].m_stat != valid_entry_status)k;
+ entry* const p_e = m_entries + pos;
+ new (&p_e->m_value) mapped_value_type(r_val);
+ p_e->m_stat = valid_entry_status;
+ _GLIBCXX_DEBUG_ONLY(debug_base::insert_new(p_e->m_value.first);)
+}
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_store_hash_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..5f30487
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_store_hash_fn_imps.hpp
@@ -0,0 +1,54 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructor_destructor_store_hash_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s constructors, destructor,
+ * and related functions.
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+constructor_insert_new_imp(const_mapped_reference r_val, size_type pos,
+ true_type)
+{
+ _GLIBCXX_DEBUG_ASSERT(m_entries[pos].m_stat != valid_entry_status);
+ entry* const p_e = m_entries + pos;
+ new (&p_e->m_value) mapped_value_type(r_val);
+ p_e->m_hash = ranged_probe_fn_base::operator()(PB_DS_V2F(r_val)).second;
+ p_e->m_stat = valid_entry_status;
+ _GLIBCXX_DEBUG_ONLY(debug_base::insert_new(p_e->m_value.first);)
+}
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/debug_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/debug_fn_imps.hpp
new file mode 100644
index 0000000..d7018c6
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/debug_fn_imps.hpp
@@ -0,0 +1,55 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s debug-mode functions.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_valid() const
+{
+ debug_base::check_size(m_num_used_e);
+ assert_entry_array_valid(m_entries, traits_base::m_store_extra_indicator);
+}
+
+#include <ext/pb_ds/detail/gp_hash_table_map_/debug_no_store_hash_fn_imps.hpp>
+#include <ext/pb_ds/detail/gp_hash_table_map_/debug_store_hash_fn_imps.hpp>
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/debug_no_store_hash_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/debug_no_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..86b4d7d
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/debug_no_store_hash_fn_imps.hpp
@@ -0,0 +1,71 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_no_store_hash_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s debug-mode functions.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_entry_array_valid(const entry_array a_entries, false_type) const
+{
+ size_type iterated_num_used_e = 0;
+ for (size_type pos = 0; pos < m_num_e; ++pos)
+ {
+ const_entry_pointer p_e = &a_entries[pos];
+ switch(p_e->m_stat)
+ {
+ case empty_entry_status:
+ case erased_entry_status:
+ break;
+ case valid_entry_status:
+ {
+ const_key_reference r_key = PB_DS_V2F(p_e->m_value);
+ debug_base::check_key_exists(r_key);
+ ++iterated_num_used_e;
+ break;
+ }
+ default:
+ _GLIBCXX_DEBUG_ASSERT(0);
+ };
+ }
+ _GLIBCXX_DEBUG_ASSERT(iterated_num_used_e == m_num_used_e);
+}
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/debug_store_hash_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/debug_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..961f143
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/debug_store_hash_fn_imps.hpp
@@ -0,0 +1,77 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_store_hash_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s debug-mode functions.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_entry_array_valid(const entry_array a_entries, true_type) const
+{
+ size_type iterated_num_used_e = 0;
+
+ for (size_type pos = 0; pos < m_num_e; ++pos)
+ {
+ const_entry_pointer p_e =& a_entries[pos];
+ switch(p_e->m_stat)
+ {
+ case empty_entry_status:
+ case erased_entry_status:
+ break;
+ case valid_entry_status:
+ {
+ const_key_reference r_key = PB_DS_V2F(p_e->m_value);
+ debug_base::check_key_exists(r_key);
+
+ const comp_hash pos_hash_pair = ranged_probe_fn_base::operator()(r_key);
+
+ _GLIBCXX_DEBUG_ASSERT(p_e->m_hash == pos_hash_pair.second);
+ ++iterated_num_used_e;
+ break;
+ }
+ default:
+ _GLIBCXX_DEBUG_ASSERT(0);
+ };
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(iterated_num_used_e == m_num_used_e);
+}
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/erase_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/erase_fn_imps.hpp
new file mode 100644
index 0000000..68878eb
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/erase_fn_imps.hpp
@@ -0,0 +1,100 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file erase_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s erase related functions.
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+erase_entry(entry_pointer p_e)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_e->m_stat = valid_entry_status);
+ _GLIBCXX_DEBUG_ONLY(debug_base::erase_existing(PB_DS_V2F(p_e->m_value));)
+ p_e->m_value.~value_type();
+ p_e->m_stat = erased_entry_status;
+ _GLIBCXX_DEBUG_ASSERT(m_num_used_e > 0);
+ resize_base::notify_erased(--m_num_used_e);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+clear()
+{
+ for (size_type pos = 0; pos < m_num_e; ++pos)
+ {
+ entry_pointer p_e = &m_entries[pos];
+ if (p_e->m_stat == valid_entry_status)
+ erase_entry(p_e);
+ }
+ do_resize_if_needed_no_throw();
+ resize_base::notify_cleared();
+}
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+erase_if(Pred pred)
+{
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+ size_type num_ersd = 0;
+ for (size_type pos = 0; pos < m_num_e; ++pos)
+ {
+ entry_pointer p_e = &m_entries[pos];
+ if (p_e->m_stat == valid_entry_status)
+ if (pred(p_e->m_value))
+ {
+ ++num_ersd;
+ erase_entry(p_e);
+ }
+ }
+
+ do_resize_if_needed_no_throw();
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+ return num_ersd;
+}
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+erase(const_key_reference r_key)
+{ return erase_imp(r_key, traits_base::m_store_extra_indicator); }
+
+#include <ext/pb_ds/detail/gp_hash_table_map_/erase_no_store_hash_fn_imps.hpp>
+#include <ext/pb_ds/detail/gp_hash_table_map_/erase_store_hash_fn_imps.hpp>
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/erase_no_store_hash_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/erase_no_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..40d578e
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/erase_no_store_hash_fn_imps.hpp
@@ -0,0 +1,85 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file erase_no_store_hash_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s erase related functions,
+ * when the hash value is not stored.
+ */
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+erase_imp(const_key_reference r_key, false_type)
+{
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+ size_type hash = ranged_probe_fn_base::operator()(r_key);
+ size_type i;
+ resize_base::notify_erase_search_start();
+
+ for (i = 0; i < m_num_e; ++i)
+ {
+ const size_type pos = ranged_probe_fn_base::operator()(r_key, hash, i);
+ entry* const p_e = m_entries + pos;
+ switch(p_e->m_stat)
+ {
+ case empty_entry_status:
+ {
+ resize_base::notify_erase_search_end();
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(
+ r_key));
+ return false;
+ }
+ break;
+ case valid_entry_status:
+ if (hash_eq_fn_base::operator()(PB_DS_V2F(p_e->m_value), r_key))
+ {
+ resize_base::notify_erase_search_end();
+ erase_entry(p_e);
+ do_resize_if_needed_no_throw();
+ return true;
+ }
+ break;
+ case erased_entry_status:
+ break;
+ default:
+ _GLIBCXX_DEBUG_ASSERT(0);
+ };
+ resize_base::notify_erase_search_collision();
+ }
+ resize_base::notify_erase_search_end();
+ return false;
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/erase_store_hash_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/erase_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..8155a52
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/erase_store_hash_fn_imps.hpp
@@ -0,0 +1,86 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file erase_store_hash_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s erase related functions,
+ * when the hash value is stored.
+ */
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+erase_imp(const_key_reference r_key, true_type)
+{
+ const comp_hash pos_hash_pair = ranged_probe_fn_base::operator()(r_key);
+ size_type i;
+ resize_base::notify_erase_search_start();
+ for (i = 0; i < m_num_e; ++i)
+ {
+ const size_type pos = ranged_probe_fn_base::operator()(r_key, pos_hash_pair.second, i);
+
+ entry* const p_e = m_entries + pos;
+ switch(p_e->m_stat)
+ {
+ case empty_entry_status:
+ {
+ resize_base::notify_erase_search_end();
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(
+ r_key));
+ return false;
+ }
+ break;
+ case valid_entry_status:
+ if (hash_eq_fn_base::operator()(PB_DS_V2F(p_e->m_value), p_e->m_hash,
+ r_key, pos_hash_pair.second))
+ {
+ resize_base::notify_erase_search_end();
+ erase_entry(p_e);
+ do_resize_if_needed_no_throw();
+ return true;
+ }
+ break;
+ case erased_entry_status:
+ break;
+ default:
+ _GLIBCXX_DEBUG_ASSERT(0);
+ };
+
+ resize_base::notify_erase_search_collision();
+ }
+ resize_base::notify_erase_search_end();
+ return false;
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/find_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/find_fn_imps.hpp
new file mode 100644
index 0000000..69d5376
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/find_fn_imps.hpp
@@ -0,0 +1,70 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file find_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s find related functions.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::point_iterator
+PB_DS_CLASS_C_DEC::
+find(const_key_reference r_key)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return find_key_pointer(r_key, traits_base::m_store_extra_indicator);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_point_iterator
+PB_DS_CLASS_C_DEC::
+find(const_key_reference r_key) const
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return const_cast<PB_DS_CLASS_C_DEC&>(*this).find_key_pointer(r_key, traits_base::m_store_extra_indicator);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::point_iterator
+PB_DS_CLASS_C_DEC::
+find_end()
+{ return NULL; }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_point_iterator
+PB_DS_CLASS_C_DEC::
+find_end() const
+{ return NULL; }
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/find_no_store_hash_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/find_no_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..298604c
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/find_no_store_hash_fn_imps.hpp
@@ -0,0 +1,46 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file find_no_store_hash_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s find related functions,
+ * when the hash value is not stored.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::pointer
+PB_DS_CLASS_C_DEC::
+find_key_pointer(const_key_reference r_key, false_type)
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/find_store_hash_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/find_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..a44b832
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/find_store_hash_fn_imps.hpp
@@ -0,0 +1,40 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file find_store_hash_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s insert related functions,
+ * when the hash value is stored.
+ */
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp
new file mode 100644
index 0000000..4741afe
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp
@@ -0,0 +1,677 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file gp_ht_map_.hpp
+ * Contains an implementation class for gp_ht_map_.
+ */
+
+#include <ext/pb_ds/tag_and_trait.hpp>
+#include <ext/pb_ds/detail/hash_fn/ranged_probe_fn.hpp>
+#include <ext/pb_ds/detail/types_traits.hpp>
+#include <ext/pb_ds/exception.hpp>
+#include <ext/pb_ds/detail/eq_fn/hash_eq_fn.hpp>
+#include <utility>
+#ifdef PB_DS_HT_MAP_TRACE_
+#include <iostream>
+#endif
+#ifdef _GLIBCXX_DEBUG
+#include <ext/pb_ds/detail/debug_map_base.hpp>
+#endif
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, typename Mapped, typename Hash_Fn, typename Eq_Fn, \
+ typename Allocator, bool Store_Hash, typename Comb_Probe_Fn, \
+ typename Probe_Fn, typename Resize_Policy>
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_CLASS_NAME gp_ht_map_data_
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#define PB_DS_CLASS_NAME gp_ht_map_no_data_
+#endif
+
+#define PB_DS_CLASS_C_DEC \
+ PB_DS_CLASS_NAME<Key, Mapped, Hash_Fn, Eq_Fn, Allocator, \
+ Store_Hash, Comb_Probe_Fn, Probe_Fn, Resize_Policy>
+
+#define PB_DS_HASH_EQ_FN_C_DEC \
+ hash_eq_fn<Key, Eq_Fn, Allocator, Store_Hash>
+
+#define PB_DS_RANGED_PROBE_FN_C_DEC \
+ ranged_probe_fn<Key, Hash_Fn, Allocator, Comb_Probe_Fn, Probe_Fn, Store_Hash>
+
+#define PB_DS_TYPES_TRAITS_C_DEC \
+ types_traits<Key, Mapped, Allocator, Store_Hash>
+
+#ifdef _GLIBCXX_DEBUG
+#define PB_DS_DEBUG_MAP_BASE_C_DEC \
+ debug_map_base<Key, Eq_Fn, typename Allocator::template rebind<Key>::other::const_reference>
+#endif
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_V2F(X) (X).first
+#define PB_DS_V2S(X) (X).second
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#define PB_DS_V2F(X) (X)
+#define PB_DS_V2S(X) Mapped()
+#endif
+
+ template<typename Key,
+ typename Mapped,
+ typename Hash_Fn,
+ typename Eq_Fn,
+ typename Allocator,
+ bool Store_Hash,
+ typename Comb_Probe_Fn,
+ typename Probe_Fn,
+ typename Resize_Policy>
+ class PB_DS_CLASS_NAME :
+#ifdef _GLIBCXX_DEBUG
+ protected PB_DS_DEBUG_MAP_BASE_C_DEC,
+#endif
+ public PB_DS_HASH_EQ_FN_C_DEC,
+ public Resize_Policy,
+ public PB_DS_RANGED_PROBE_FN_C_DEC,
+ public PB_DS_TYPES_TRAITS_C_DEC
+ {
+ private:
+ typedef PB_DS_TYPES_TRAITS_C_DEC traits_base;
+ typedef typename traits_base::value_type value_type_;
+ typedef typename traits_base::pointer pointer_;
+ typedef typename traits_base::const_pointer const_pointer_;
+ typedef typename traits_base::reference reference_;
+ typedef typename traits_base::const_reference const_reference_;
+ typedef typename traits_base::comp_hash comp_hash;
+
+ enum entry_status
+ {
+ empty_entry_status,
+ valid_entry_status,
+ erased_entry_status
+ } __attribute__ ((packed));
+
+ struct entry : public traits_base::stored_value_type
+ {
+ entry_status m_stat;
+ };
+
+ typedef typename Allocator::template rebind<entry>::other entry_allocator;
+ typedef typename entry_allocator::pointer entry_pointer;
+ typedef typename entry_allocator::const_pointer const_entry_pointer;
+ typedef typename entry_allocator::reference entry_reference;
+ typedef typename entry_allocator::const_reference const_entry_reference;
+ typedef typename entry_allocator::pointer entry_array;
+
+ typedef PB_DS_RANGED_PROBE_FN_C_DEC ranged_probe_fn_base;
+
+#ifdef _GLIBCXX_DEBUG
+ typedef PB_DS_DEBUG_MAP_BASE_C_DEC debug_base;
+#endif
+
+ typedef PB_DS_HASH_EQ_FN_C_DEC hash_eq_fn_base;
+ typedef Resize_Policy resize_base;
+
+#define PB_DS_GEN_POS typename Allocator::size_type
+
+#include <ext/pb_ds/detail/unordered_iterator/const_point_iterator.hpp>
+#include <ext/pb_ds/detail/unordered_iterator/point_iterator.hpp>
+#include <ext/pb_ds/detail/unordered_iterator/const_iterator.hpp>
+#include <ext/pb_ds/detail/unordered_iterator/iterator.hpp>
+
+#undef PB_DS_GEN_POS
+
+ public:
+ typedef Allocator allocator_type;
+ typedef typename Allocator::size_type size_type;
+ typedef typename Allocator::difference_type difference_type;
+ typedef Hash_Fn hash_fn;
+ typedef Eq_Fn eq_fn;
+ typedef Probe_Fn probe_fn;
+ typedef Comb_Probe_Fn comb_probe_fn;
+ typedef Resize_Policy resize_policy;
+
+ enum
+ {
+ store_hash = Store_Hash
+ };
+
+ typedef typename traits_base::key_type key_type;
+ typedef typename traits_base::key_pointer key_pointer;
+ typedef typename traits_base::const_key_pointer const_key_pointer;
+ typedef typename traits_base::key_reference key_reference;
+ typedef typename traits_base::const_key_reference const_key_reference;
+ typedef typename traits_base::mapped_type mapped_type;
+ typedef typename traits_base::mapped_pointer mapped_pointer;
+ typedef typename traits_base::const_mapped_pointer const_mapped_pointer;
+ typedef typename traits_base::mapped_reference mapped_reference;
+ typedef typename traits_base::const_mapped_reference const_mapped_reference;
+ typedef typename traits_base::value_type value_type;
+ typedef typename traits_base::pointer pointer;
+ typedef typename traits_base::const_pointer const_pointer;
+ typedef typename traits_base::reference reference;
+ typedef typename traits_base::const_reference const_reference;
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ typedef point_iterator_ point_iterator;
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+ typedef const_point_iterator_ point_iterator;
+#endif
+
+ typedef const_point_iterator_ const_point_iterator;
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ typedef iterator_ iterator;
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+ typedef const_iterator_ iterator;
+#endif
+
+ typedef const_iterator_ const_iterator;
+
+ PB_DS_CLASS_NAME();
+
+ PB_DS_CLASS_NAME(const PB_DS_CLASS_C_DEC&);
+
+ PB_DS_CLASS_NAME(const Hash_Fn&);
+
+ PB_DS_CLASS_NAME(const Hash_Fn&, const Eq_Fn&);
+
+ PB_DS_CLASS_NAME(const Hash_Fn&, const Eq_Fn&, const Comb_Probe_Fn&);
+
+ PB_DS_CLASS_NAME(const Hash_Fn&, const Eq_Fn&, const Comb_Probe_Fn&,
+ const Probe_Fn&);
+
+ PB_DS_CLASS_NAME(const Hash_Fn&, const Eq_Fn&, const Comb_Probe_Fn&,
+ const Probe_Fn&, const Resize_Policy&);
+
+ template<typename It>
+ void
+ copy_from_range(It first_it, It last_it);
+
+ virtual
+ ~PB_DS_CLASS_NAME();
+
+ void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ inline size_type
+ size() const;
+
+ inline size_type
+ max_size() const;
+
+ inline bool
+ empty() const;
+
+ Hash_Fn&
+ get_hash_fn();
+
+ const Hash_Fn&
+ get_hash_fn() const;
+
+ Eq_Fn&
+ get_eq_fn();
+
+ const Eq_Fn&
+ get_eq_fn() const;
+
+ Probe_Fn&
+ get_probe_fn();
+
+ const Probe_Fn&
+ get_probe_fn() const;
+
+ Comb_Probe_Fn&
+ get_comb_probe_fn();
+
+ const Comb_Probe_Fn&
+ get_comb_probe_fn() const;
+
+ Resize_Policy&
+ get_resize_policy();
+
+ const Resize_Policy&
+ get_resize_policy() const;
+
+ inline std::pair<point_iterator, bool>
+ insert(const_reference r_val)
+ {
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+ return insert_imp(r_val, traits_base::m_store_extra_indicator);
+ }
+
+ inline mapped_reference
+ operator[](const_key_reference r_key)
+ {
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ return subscript_imp(r_key, traits_base::m_store_extra_indicator);
+#else
+ insert(r_key);
+ return traits_base::s_null_mapped;
+#endif
+ }
+
+ inline point_iterator
+ find(const_key_reference r_key);
+
+ inline const_point_iterator
+ find(const_key_reference r_key) const;
+
+ inline point_iterator
+ find_end();
+
+ inline const_point_iterator
+ find_end() const;
+
+ inline bool
+ erase(const_key_reference r_key);
+
+ template<typename Pred>
+ inline size_type
+ erase_if(Pred prd);
+
+ void
+ clear();
+
+ inline iterator
+ begin();
+
+ inline const_iterator
+ begin() const;
+
+ inline iterator
+ end();
+
+ inline const_iterator
+ end() const;
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid() const;
+#endif
+
+#ifdef PB_DS_HT_MAP_TRACE_
+ void
+ trace() const;
+#endif
+
+ private:
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ friend class iterator_;
+#endif
+
+ friend class const_iterator_;
+
+ void
+ deallocate_all();
+
+ void
+ initialize();
+
+ void
+ erase_all_valid_entries(entry_array, size_type);
+
+ inline bool
+ do_resize_if_needed();
+
+ inline void
+ do_resize_if_needed_no_throw();
+
+ void
+ resize_imp(size_type);
+
+ virtual void
+ do_resize(size_type);
+
+ void
+ resize_imp(entry_array, size_type);
+
+ inline void
+ resize_imp_reassign(entry_pointer, entry_array, false_type);
+
+ inline void
+ resize_imp_reassign(entry_pointer, entry_array, true_type);
+
+ inline size_type
+ find_ins_pos(const_key_reference, false_type);
+
+ inline comp_hash
+ find_ins_pos(const_key_reference, true_type);
+
+ inline std::pair<point_iterator, bool>
+ insert_imp(const_reference, false_type);
+
+ inline std::pair<point_iterator, bool>
+ insert_imp(const_reference, true_type);
+
+ inline pointer
+ insert_new_imp(const_reference r_val, size_type pos)
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_entries[pos].m_stat != valid_entry_status);
+
+ if (do_resize_if_needed())
+ pos = find_ins_pos(PB_DS_V2F(r_val),
+ traits_base::m_store_extra_indicator);
+
+ _GLIBCXX_DEBUG_ASSERT(m_entries[pos].m_stat != valid_entry_status);
+
+ entry* const p_e = m_entries + pos;
+ new (&p_e->m_value) value_type(r_val);
+ p_e->m_stat = valid_entry_status;
+ resize_base::notify_inserted(++m_num_used_e);
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::insert_new(PB_DS_V2F(p_e->m_value));)
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return &p_e->m_value;
+ }
+
+ inline pointer
+ insert_new_imp(const_reference r_val, comp_hash& r_pos_hash_pair)
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_entries[r_pos_hash_pair.first].m_stat !=
+ valid_entry_status);
+
+ if (do_resize_if_needed())
+ r_pos_hash_pair = find_ins_pos(PB_DS_V2F(r_val),
+ traits_base::m_store_extra_indicator);
+
+ _GLIBCXX_DEBUG_ASSERT(m_entries[r_pos_hash_pair.first].m_stat !=
+ valid_entry_status);
+
+ entry* const p_e = m_entries + r_pos_hash_pair.first;
+ new (&p_e->m_value) value_type(r_val);
+ p_e->m_hash = r_pos_hash_pair.second;
+ p_e->m_stat = valid_entry_status;
+
+ resize_base::notify_inserted(++m_num_used_e);
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::insert_new(PB_DS_V2F(p_e->m_value));)
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return &p_e->m_value;
+ }
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ inline mapped_reference
+ subscript_imp(const_key_reference key, false_type)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ const size_type pos = find_ins_pos(key,
+ traits_base::m_store_extra_indicator);
+
+ entry_pointer p_e = &m_entries[pos];
+ if (p_e->m_stat != valid_entry_status)
+ return insert_new_imp(value_type(key, mapped_type()), pos)->second;
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(key);)
+ return p_e->m_value.second;
+ }
+
+ inline mapped_reference
+ subscript_imp(const_key_reference key, true_type)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ comp_hash pos_hash_pair =
+ find_ins_pos(key, traits_base::m_store_extra_indicator);
+
+ if (m_entries[pos_hash_pair.first].m_stat != valid_entry_status)
+ return insert_new_imp(value_type(key, mapped_type()),
+ pos_hash_pair)->second;
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(key));
+ return (m_entries + pos_hash_pair.first)->m_value.second;
+ }
+#endif
+
+ inline pointer
+ find_key_pointer(const_key_reference key, false_type)
+ {
+ const size_type hash = ranged_probe_fn_base::operator()(key);
+ size_type i;
+ resize_base::notify_find_search_start();
+
+ // Loop until entry is found or until all possible entries accessed.
+ for (i = 0; i < m_num_e; ++i)
+ {
+ const size_type pos = ranged_probe_fn_base::operator()(key, hash, i);
+
+ entry* const p_e = m_entries + pos;
+ switch (p_e->m_stat)
+ {
+ case empty_entry_status:
+ {
+ resize_base::notify_find_search_end();
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(key);)
+
+ return NULL;
+ }
+ break;
+ case valid_entry_status:
+ if (hash_eq_fn_base::operator()(PB_DS_V2F(p_e->m_value), key))
+ {
+ resize_base::notify_find_search_end();
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(key);)
+
+ return pointer(&p_e->m_value);
+ }
+ break;
+ case erased_entry_status:
+ break;
+ default:
+ _GLIBCXX_DEBUG_ASSERT(0);
+ };
+
+ resize_base::notify_find_search_collision();
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(key);)
+ resize_base::notify_find_search_end();
+ return NULL;
+ }
+
+ inline pointer
+ find_key_pointer(const_key_reference key, true_type)
+ {
+ comp_hash pos_hash_pair = ranged_probe_fn_base::operator()(key);
+ size_type i;
+ resize_base::notify_find_search_start();
+
+ // Loop until entry is found or until all possible entries accessed.
+ for (i = 0; i < m_num_e; ++i)
+ {
+ const size_type pos =
+ ranged_probe_fn_base::operator()(key, pos_hash_pair.second, i);
+
+ entry* const p_e = m_entries + pos;
+
+ switch(p_e->m_stat)
+ {
+ case empty_entry_status:
+ {
+ resize_base::notify_find_search_end();
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(key);)
+
+ return NULL;
+ }
+ break;
+ case valid_entry_status:
+ if (hash_eq_fn_base::operator()(PB_DS_V2F(p_e->m_value),
+ p_e->m_hash,
+ key, pos_hash_pair.second))
+ {
+ resize_base::notify_find_search_end();
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(key);)
+ return pointer(&p_e->m_value);
+ }
+ break;
+ case erased_entry_status:
+ break;
+ default:
+ _GLIBCXX_DEBUG_ASSERT(0);
+ };
+
+ resize_base::notify_find_search_collision();
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(key);)
+ resize_base::notify_find_search_end();
+ return NULL;
+ }
+
+ inline bool
+ erase_imp(const_key_reference, true_type);
+
+ inline bool
+ erase_imp(const_key_reference, false_type);
+
+ inline void
+ erase_entry(entry_pointer p_e);
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ void
+ inc_it_state(pointer& r_p_value, size_type& r_pos) const
+ { inc_it_state((const_mapped_pointer& )r_p_value, r_pos); }
+#endif
+
+ void
+ inc_it_state(const_pointer& r_p_value, size_type& r_pos) const
+ {
+ _GLIBCXX_DEBUG_ASSERT(r_p_value != NULL);
+ for (++r_pos; r_pos < m_num_e; ++r_pos)
+ {
+ const_entry_pointer p_e =& m_entries[r_pos];
+ if (p_e->m_stat == valid_entry_status)
+ {
+ r_p_value =& p_e->m_value;
+ return;
+ }
+ }
+ r_p_value = NULL;
+ }
+
+ void
+ get_start_it_state(const_pointer& r_p_value, size_type& r_pos) const
+ {
+ for (r_pos = 0; r_pos < m_num_e; ++r_pos)
+ {
+ const_entry_pointer p_e = &m_entries[r_pos];
+ if (p_e->m_stat == valid_entry_status)
+ {
+ r_p_value = &p_e->m_value;
+ return;
+ }
+ }
+ r_p_value = NULL;
+ }
+
+ void
+ get_start_it_state(pointer& r_p_value, size_type& r_pos)
+ {
+ for (r_pos = 0; r_pos < m_num_e; ++r_pos)
+ {
+ entry_pointer p_e = &m_entries[r_pos];
+ if (p_e->m_stat == valid_entry_status)
+ {
+ r_p_value = &p_e->m_value;
+ return;
+ }
+ }
+ r_p_value = NULL;
+ }
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_entry_array_valid(const entry_array, false_type) const;
+
+ void
+ assert_entry_array_valid(const entry_array, true_type) const;
+#endif
+
+ static entry_allocator s_entry_allocator;
+ static iterator s_end_it;
+ static const_iterator s_const_end_it;
+
+ size_type m_num_e;
+ size_type m_num_used_e;
+ entry_pointer m_entries;
+
+ enum
+ {
+ store_hash_ok = !Store_Hash
+ || !is_same<Hash_Fn, __gnu_pbds::null_hash_fn>::value
+ };
+
+ PB_DS_STATIC_ASSERT(sth, store_hash_ok);
+ };
+
+#include <ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_fn_imps.hpp>
+#include <ext/pb_ds/detail/gp_hash_table_map_/find_fn_imps.hpp>
+#include <ext/pb_ds/detail/gp_hash_table_map_/resize_fn_imps.hpp>
+#include <ext/pb_ds/detail/gp_hash_table_map_/debug_fn_imps.hpp>
+#include <ext/pb_ds/detail/gp_hash_table_map_/info_fn_imps.hpp>
+#include <ext/pb_ds/detail/gp_hash_table_map_/policy_access_fn_imps.hpp>
+#include <ext/pb_ds/detail/gp_hash_table_map_/erase_fn_imps.hpp>
+#include <ext/pb_ds/detail/gp_hash_table_map_/iterator_fn_imps.hpp>
+#include <ext/pb_ds/detail/gp_hash_table_map_/insert_fn_imps.hpp>
+#include <ext/pb_ds/detail/gp_hash_table_map_/trace_fn_imps.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_HASH_EQ_FN_C_DEC
+#undef PB_DS_RANGED_PROBE_FN_C_DEC
+#undef PB_DS_TYPES_TRAITS_C_DEC
+#undef PB_DS_DEBUG_MAP_BASE_C_DEC
+#undef PB_DS_CLASS_NAME
+#undef PB_DS_V2F
+#undef PB_DS_V2S
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/info_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/info_fn_imps.hpp
new file mode 100644
index 0000000..423a928
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/info_fn_imps.hpp
@@ -0,0 +1,58 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file info_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s entire container info related
+ * functions.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+size() const
+{ return m_num_used_e; }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+max_size() const
+{ return s_entry_allocator.max_size(); }
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+empty() const
+{ return (size() == 0); }
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/insert_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/insert_fn_imps.hpp
new file mode 100644
index 0000000..101ce8c
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/insert_fn_imps.hpp
@@ -0,0 +1,43 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file insert_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s insert related functions.
+ */
+
+#include <ext/pb_ds/detail/gp_hash_table_map_/insert_no_store_hash_fn_imps.hpp>
+#include <ext/pb_ds/detail/gp_hash_table_map_/insert_store_hash_fn_imps.hpp>
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/insert_no_store_hash_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/insert_no_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..3227a4a
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/insert_no_store_hash_fn_imps.hpp
@@ -0,0 +1,111 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file insert_no_store_hash_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s insert related functions,
+ * when the hash value is not stored.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+find_ins_pos(const_key_reference r_key, false_type)
+{
+ size_type hash = ranged_probe_fn_base::operator()(r_key);
+ size_type i;
+
+ /* The insertion position is initted to a non-legal value to indicate
+ * that it has not been initted yet.
+ */
+ size_type ins_pos = m_num_e;
+ resize_base::notify_insert_search_start();
+ for (i = 0; i < m_num_e; ++i)
+ {
+ const size_type pos = ranged_probe_fn_base::operator()(r_key, hash, i);
+ _GLIBCXX_DEBUG_ASSERT(pos < m_num_e);
+ entry* const p_e = m_entries + pos;
+ switch(p_e->m_stat)
+ {
+ case empty_entry_status:
+ {
+ resize_base::notify_insert_search_end();
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key);)
+ return (ins_pos == m_num_e) ? pos : ins_pos;
+ }
+ break;
+ case erased_entry_status:
+ if (ins_pos == m_num_e)
+ ins_pos = pos;
+ break;
+ case valid_entry_status:
+ if (hash_eq_fn_base::operator()(PB_DS_V2F(p_e->m_value), r_key))
+ {
+ resize_base::notify_insert_search_end();
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key);)
+ return pos;
+ }
+ break;
+ default:
+ _GLIBCXX_DEBUG_ASSERT(0);
+ };
+
+ resize_base::notify_insert_search_collision();
+ }
+ resize_base::notify_insert_search_end();
+ if (ins_pos == m_num_e)
+ __throw_insert_error();
+ return ins_pos;
+}
+
+PB_DS_CLASS_T_DEC
+inline std::pair<typename PB_DS_CLASS_C_DEC::point_iterator, bool>
+PB_DS_CLASS_C_DEC::
+insert_imp(const_reference r_val, false_type)
+{
+ const_key_reference r_key = PB_DS_V2F(r_val);
+ const size_type pos = find_ins_pos(r_key,
+ traits_base::m_store_extra_indicator);
+
+ if (m_entries[pos].m_stat == valid_entry_status)
+ {
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key);)
+ return std::make_pair(&(m_entries + pos)->m_value, false);
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key));
+ return std::make_pair(insert_new_imp(r_val, pos), true);
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/insert_store_hash_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/insert_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..f4310b6
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/insert_store_hash_fn_imps.hpp
@@ -0,0 +1,118 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file insert_store_hash_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s find related functions,
+ * when the hash value is stored.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::comp_hash
+PB_DS_CLASS_C_DEC::
+find_ins_pos(const_key_reference r_key, true_type)
+{
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+ comp_hash pos_hash_pair = ranged_probe_fn_base::operator()(r_key);
+
+ size_type i;
+
+ /* The insertion position is initted to a non-legal value to indicate
+ * that it has not been initted yet.
+ */
+ size_type ins_pos = m_num_e;
+ resize_base::notify_insert_search_start();
+ for (i = 0; i < m_num_e; ++i)
+ {
+ const size_type pos = ranged_probe_fn_base::operator()(r_key, pos_hash_pair.second, i);
+
+ entry* const p_e = m_entries + pos;
+ switch(p_e->m_stat)
+ {
+ case empty_entry_status:
+ {
+ resize_base::notify_insert_search_end();
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key);)
+
+ return ((ins_pos == m_num_e) ?
+ std::make_pair(pos, pos_hash_pair.second) :
+ std::make_pair(ins_pos, pos_hash_pair.second));
+ }
+ break;
+ case erased_entry_status:
+ if (ins_pos == m_num_e)
+ ins_pos = pos;
+ break;
+ case valid_entry_status:
+ if (hash_eq_fn_base::operator()(PB_DS_V2F(p_e->m_value), p_e->m_hash,
+ r_key, pos_hash_pair.second))
+ {
+ resize_base::notify_insert_search_end();
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key);)
+ return std::make_pair(pos, pos_hash_pair.second);
+ }
+ break;
+ default:
+ _GLIBCXX_DEBUG_ASSERT(0);
+ };
+ resize_base::notify_insert_search_collision();
+ }
+ resize_base::notify_insert_search_end();
+ if (ins_pos == m_num_e)
+ __throw_insert_error();
+ return std::make_pair(ins_pos, pos_hash_pair.second);
+}
+
+PB_DS_CLASS_T_DEC
+inline std::pair<typename PB_DS_CLASS_C_DEC::point_iterator, bool>
+PB_DS_CLASS_C_DEC::
+insert_imp(const_reference r_val, true_type)
+{
+ const_key_reference r_key = PB_DS_V2F(r_val);
+ comp_hash pos_hash_pair = find_ins_pos(r_key,
+ traits_base::m_store_extra_indicator);
+
+ _GLIBCXX_DEBUG_ASSERT(pos_hash_pair.first < m_num_e);
+ entry_pointer p_e =& m_entries[pos_hash_pair.first];
+ if (p_e->m_stat == valid_entry_status)
+ {
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key));
+ return std::make_pair(&p_e->m_value, false);
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key));
+ return std::make_pair(insert_new_imp(r_val, pos_hash_pair), true);
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/iterator_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/iterator_fn_imps.hpp
new file mode 100644
index 0000000..ff1f80f
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/iterator_fn_imps.hpp
@@ -0,0 +1,83 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file iterator_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s iterators related functions, e.g.,
+ * begin().
+ */
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::s_end_it;
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::s_const_end_it;
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+begin()
+{
+ pointer_ p_value;
+ size_type pos;
+ get_start_it_state(p_value, pos);
+ return iterator(p_value, pos, this);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+end()
+{ return s_end_it; }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+begin() const
+{
+ const_pointer_ p_value;
+ size_type pos;
+ get_start_it_state(p_value, pos);
+ return const_iterator(p_value, pos, this);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+end() const
+{ return s_const_end_it; }
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/policy_access_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/policy_access_fn_imps.hpp
new file mode 100644
index 0000000..b1a3f7a
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/policy_access_fn_imps.hpp
@@ -0,0 +1,100 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file policy_access_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s policy agpess
+ * functions.
+ */
+
+PB_DS_CLASS_T_DEC
+Hash_Fn&
+PB_DS_CLASS_C_DEC::
+get_hash_fn()
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+const Hash_Fn&
+PB_DS_CLASS_C_DEC::
+get_hash_fn() const
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+Eq_Fn&
+PB_DS_CLASS_C_DEC::
+get_eq_fn()
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+const Eq_Fn&
+PB_DS_CLASS_C_DEC::
+get_eq_fn() const
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+Probe_Fn&
+PB_DS_CLASS_C_DEC::
+get_probe_fn()
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+const Probe_Fn&
+PB_DS_CLASS_C_DEC::
+get_probe_fn() const
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+Comb_Probe_Fn&
+PB_DS_CLASS_C_DEC::
+get_comb_probe_fn()
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+const Comb_Probe_Fn&
+PB_DS_CLASS_C_DEC::
+get_comb_probe_fn() const
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+Resize_Policy&
+PB_DS_CLASS_C_DEC::
+get_resize_policy()
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+const Resize_Policy&
+PB_DS_CLASS_C_DEC::
+get_resize_policy() const
+{ return *this; }
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/resize_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/resize_fn_imps.hpp
new file mode 100644
index 0000000..82a8ab0
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/resize_fn_imps.hpp
@@ -0,0 +1,137 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file resize_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s resize related functions.
+ */
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+do_resize_if_needed()
+{
+ if (!resize_base::is_resize_needed())
+ return false;
+ resize_imp(resize_base::get_new_size(m_num_e, m_num_used_e));
+ return true;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+do_resize(size_type n)
+{ resize_imp(resize_base::get_nearest_larger_size(n)); }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+do_resize_if_needed_no_throw()
+{
+ if (!resize_base::is_resize_needed())
+ return;
+
+ __try
+ {
+ resize_imp(resize_base::get_new_size(m_num_e, m_num_used_e));
+ }
+ __catch(...)
+ { }
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+resize_imp(size_type new_size)
+{
+#ifdef PB_DS_REGRESSION
+ typename Allocator::group_throw_prob_adjustor adjust(m_num_e);
+#endif
+
+ if (new_size == m_num_e)
+ return;
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ const size_type old_size = m_num_e;
+ entry_array a_entries_resized = NULL;
+
+ // Following line might throw an exception.
+ a_entries_resized = s_entry_allocator.allocate(new_size);
+
+ ranged_probe_fn_base::notify_resized(new_size);
+ m_num_e = new_size;
+
+ for (size_type i = 0; i < m_num_e; ++i)
+ a_entries_resized[i].m_stat = empty_entry_status;
+
+ __try
+ {
+ resize_imp(a_entries_resized, old_size);
+ }
+ __catch(...)
+ {
+ erase_all_valid_entries(a_entries_resized, new_size);
+ m_num_e = old_size;
+ s_entry_allocator.deallocate(a_entries_resized, new_size);
+ ranged_probe_fn_base::notify_resized(old_size);
+ __throw_exception_again;
+ }
+
+ // At this point no exceptions can be thrown.
+ _GLIBCXX_DEBUG_ONLY(assert_entry_array_valid(a_entries_resized, traits_base::m_store_extra_indicator);)
+
+ Resize_Policy::notify_resized(new_size);
+ erase_all_valid_entries(m_entries, old_size);
+ s_entry_allocator.deallocate(m_entries, old_size);
+ m_entries = a_entries_resized;
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+resize_imp(entry_array a_entries_resized, size_type old_size)
+{
+ for (size_type pos = 0; pos < old_size; ++pos)
+ if (m_entries[pos].m_stat == valid_entry_status)
+ resize_imp_reassign(m_entries + pos, a_entries_resized,
+ traits_base::m_store_extra_indicator);
+}
+
+#include <ext/pb_ds/detail/gp_hash_table_map_/resize_no_store_hash_fn_imps.hpp>
+#include <ext/pb_ds/detail/gp_hash_table_map_/resize_store_hash_fn_imps.hpp>
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/resize_no_store_hash_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/resize_no_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..1d2839e
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/resize_no_store_hash_fn_imps.hpp
@@ -0,0 +1,72 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file resize_no_store_hash_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s resize related functions, when the
+ * hash value is not stored.
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+resize_imp_reassign(entry_pointer p_e, entry_array a_entries_resized,
+ false_type)
+{
+ const_key_reference r_key = PB_DS_V2F(p_e->m_value);
+ size_type hash = ranged_probe_fn_base::operator()(r_key);
+ size_type i;
+ for (i = 0; i < m_num_e; ++i)
+ {
+ const size_type pos = ranged_probe_fn_base::operator()(r_key, hash, i);
+ entry_pointer p_new_e = a_entries_resized + pos;
+ switch(p_new_e->m_stat)
+ {
+ case empty_entry_status:
+ new (&p_new_e->m_value) value_type(p_e->m_value);
+ p_new_e->m_stat = valid_entry_status;
+ return;
+ case erased_entry_status:
+ _GLIBCXX_DEBUG_ASSERT(0);
+ break;
+ case valid_entry_status:
+ break;
+ default:
+ _GLIBCXX_DEBUG_ASSERT(0);
+ };
+ }
+ __throw_insert_error();
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/resize_store_hash_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/resize_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..765e962
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/resize_store_hash_fn_imps.hpp
@@ -0,0 +1,74 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file resize_store_hash_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s resize related functions, when the
+ * hash value is stored.
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+resize_imp_reassign(entry_pointer p_e, entry_array a_entries_resized,
+ true_type)
+{
+ const_key_reference r_key = PB_DS_V2F(p_e->m_value);
+ size_type hash = ranged_probe_fn_base::operator()(r_key, p_e->m_hash);
+
+ size_type i;
+ for (i = 0; i < m_num_e; ++i)
+ {
+ const size_type pos = ranged_probe_fn_base::operator()(r_key, hash, i);
+ entry_pointer p_new_e = a_entries_resized + pos;
+ switch(p_new_e->m_stat)
+ {
+ case empty_entry_status:
+ new (&p_new_e->m_value) value_type(p_e->m_value);
+ p_new_e->m_hash = hash;
+ p_new_e->m_stat = valid_entry_status;
+ return;
+ case erased_entry_status:
+ _GLIBCXX_DEBUG_ASSERT(0);
+ break;
+ case valid_entry_status:
+ break;
+ default:
+ _GLIBCXX_DEBUG_ASSERT(0);
+ };
+ }
+ __throw_insert_error();
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/standard_policies.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/standard_policies.hpp
new file mode 100644
index 0000000..479725f
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/standard_policies.hpp
@@ -0,0 +1,74 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file standard_policies.hpp
+ * Contains standard policies for gp_ht_map types.
+ */
+
+#ifndef PB_DS_GP_HT_MAP_STANDARD_POLICIES_HPP
+#define PB_DS_GP_HT_MAP_STANDARD_POLICIES_HPP
+
+#include <ext/pb_ds/detail/standard_policies.hpp>
+#include <ext/pb_ds/ht_load_check_resize_trigger.hpp>
+#include <ext/pb_ds/linear_probe_fn.hpp>
+#include <ext/pb_ds/quadratic_probe_fn.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ template<typename Comb_Probe_Fn>
+ struct default_probe_fn
+ {
+ private:
+ typedef typename Comb_Probe_Fn::size_type size_type;
+
+ public:
+ typedef
+ typename __conditional_type<
+ is_same<
+ __gnu_pbds::direct_mask_range_hashing<size_t>,
+ Comb_Probe_Fn>::value,
+ __gnu_pbds::linear_probe_fn<size_type>,
+ __gnu_pbds::quadratic_probe_fn<size_type> >::__type
+ type;
+ };
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/trace_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/trace_fn_imps.hpp
new file mode 100644
index 0000000..c3fe13c
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/gp_hash_table_map_/trace_fn_imps.hpp
@@ -0,0 +1,74 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file trace_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s trace-mode functions.
+ */
+
+#ifdef PB_DS_HT_MAP_TRACE_
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+trace() const
+{
+ std::cerr << static_cast<unsigned long>(m_num_e) << " " <<
+ static_cast<unsigned long>(m_num_used_e) << std::endl;
+
+ for (size_type i = 0; i < m_num_e; ++i)
+ {
+ std::cerr << static_cast<unsigned long>(i) << " ";
+
+ switch(m_entries[i].m_stat)
+ {
+ case empty_entry_status:
+ std::cerr << "<empty>";
+ break;
+ case erased_entry_status:
+ std::cerr << "<erased>";
+ break;
+ case valid_entry_status:
+ std::cerr << PB_DS_V2F(m_entries[i].m_value);
+ break;
+ default:
+ _GLIBCXX_DEBUG_ASSERT(0);
+ };
+
+ std::cerr << std::endl;
+ }
+}
+
+#endif // #ifdef PB_DS_HT_MAP_TRACE_
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/direct_mask_range_hashing_imp.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/direct_mask_range_hashing_imp.hpp
new file mode 100644
index 0000000..caf7848
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/direct_mask_range_hashing_imp.hpp
@@ -0,0 +1,58 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file direct_mask_range_hashing_imp.hpp
+ * Contains a range-hashing policy implementation
+ */
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{ mask_based_base::swap(other); }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+notify_resized(size_type size)
+{ mask_based_base::notify_resized(size); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+operator()(size_type hash) const
+{ return mask_based_base::range_hash(hash); }
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/direct_mod_range_hashing_imp.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/direct_mod_range_hashing_imp.hpp
new file mode 100644
index 0000000..17d57b2
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/direct_mod_range_hashing_imp.hpp
@@ -0,0 +1,58 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file direct_mod_range_hashing_imp.hpp
+ * Contains a range-hashing policy implementation
+ */
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{ mod_based_base::swap(other); }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+notify_resized(size_type n)
+{ mod_based_base::notify_resized(n); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+operator()(size_type hash) const
+{ return mod_based_base::range_hash(hash); }
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/linear_probe_fn_imp.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/linear_probe_fn_imp.hpp
new file mode 100644
index 0000000..e7b2644
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/linear_probe_fn_imp.hpp
@@ -0,0 +1,53 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file linear_probe_fn_imp.hpp
+ * Contains a probe policy implementation
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{ }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+operator()(size_type i) const
+{
+ return (i);
+}
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/mask_based_range_hashing.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/mask_based_range_hashing.hpp
new file mode 100644
index 0000000..936abbe
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/mask_based_range_hashing.hpp
@@ -0,0 +1,107 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file mask_based_range_hashing.hpp
+ * Contains a range hashing policy base.
+ */
+
+#ifndef PB_DS_MASK_BASED_RANGE_HASHING_HPP
+#define PB_DS_MASK_BASED_RANGE_HASHING_HPP
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+#define PB_DS_CLASS_T_DEC template<typename Size_Type>
+#define PB_DS_CLASS_C_DEC mask_based_range_hashing<Size_Type>
+
+ template<typename Size_Type>
+ class mask_based_range_hashing
+ {
+ protected:
+ typedef Size_Type size_type;
+
+ void
+ swap(mask_based_range_hashing& other)
+ { std::swap(m_mask, other.m_mask); }
+
+ void
+ notify_resized(size_type size);
+
+ inline size_type
+ range_hash(size_type hash) const
+ { return size_type(hash & m_mask); }
+
+ private:
+ size_type m_mask;
+ const static size_type s_num_bits_in_size_type;
+ const static size_type s_highest_bit_1;
+ };
+
+ PB_DS_CLASS_T_DEC
+ const typename PB_DS_CLASS_C_DEC::size_type
+ PB_DS_CLASS_C_DEC::s_num_bits_in_size_type =
+ sizeof(typename PB_DS_CLASS_C_DEC::size_type) << 3;
+
+ PB_DS_CLASS_T_DEC
+ const typename PB_DS_CLASS_C_DEC::size_type PB_DS_CLASS_C_DEC::s_highest_bit_1 = static_cast<typename PB_DS_CLASS_C_DEC::size_type>(1) << (s_num_bits_in_size_type - 1);
+
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ notify_resized(size_type size)
+ {
+ size_type i = 0;
+ while (size ^ s_highest_bit_1)
+ {
+ size <<= 1;
+ ++i;
+ }
+
+ m_mask = 1;
+ i += 2;
+ while (i++ < s_num_bits_in_size_type)
+ m_mask = (m_mask << 1) ^ 1;
+ }
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/mod_based_range_hashing.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/mod_based_range_hashing.hpp
new file mode 100644
index 0000000..2610e04
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/mod_based_range_hashing.hpp
@@ -0,0 +1,108 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file mod_based_range_hashing.hpp
+ * Contains a range hashing policy base.
+ */
+
+#ifndef PB_DS_MOD_BASED_RANGE_HASHING_HPP
+#define PB_DS_MOD_BASED_RANGE_HASHING_HPP
+
+namespace __gnu_pbds
+{
+
+ namespace detail
+ {
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Size_Type>
+
+#define PB_DS_CLASS_C_DEC \
+ mod_based_range_hashing< \
+ Size_Type>
+
+ template<typename Size_Type>
+ class mod_based_range_hashing
+ {
+ protected:
+ typedef Size_Type size_type;
+
+ protected:
+ void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ void
+ notify_resized(size_type size);
+
+ inline size_type
+ range_hash(size_type hash) const;
+
+ private:
+ size_type m_size;
+ };
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ swap(PB_DS_CLASS_C_DEC& other)
+ {
+ std::swap(m_size, other.m_size);
+ }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ notify_resized(size_type size)
+ {
+ m_size = size;
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::size_type
+ PB_DS_CLASS_C_DEC::
+ range_hash(size_type hash) const
+ {
+ return (hash % m_size);
+ }
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+ } // namespace detail
+
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_MOD_BASED_RANGE_HASHING_HPP
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/probe_fn_base.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/probe_fn_base.hpp
new file mode 100644
index 0000000..970cfc1
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/probe_fn_base.hpp
@@ -0,0 +1,59 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file probe_fn_base.hpp
+ * Contains a probe policy base.
+ */
+
+#ifndef PB_DS_PROBE_FN_BASE_HPP
+#define PB_DS_PROBE_FN_BASE_HPP
+
+#include <functional>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ template<typename Allocator>
+ class probe_fn_base
+ {
+ protected:
+ ~probe_fn_base() { }
+ };
+} // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/quadratic_probe_fn_imp.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/quadratic_probe_fn_imp.hpp
new file mode 100644
index 0000000..4c7a6c4
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/quadratic_probe_fn_imp.hpp
@@ -0,0 +1,53 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file quadratic_probe_fn_imp.hpp
+ * Contains a probe policy implementation
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{ }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+operator()(size_type i) const
+{
+ return (i* i);
+}
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/ranged_hash_fn.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/ranged_hash_fn.hpp
new file mode 100644
index 0000000..2489927
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/ranged_hash_fn.hpp
@@ -0,0 +1,359 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file ranged_hash_fn.hpp
+ * Contains a unified ranged hash functor, allowing the hash tables
+ * to deal with a single class for ranged hashing.
+ */
+
+#ifndef PB_DS_RANGED_HASH_FN_HPP
+#define PB_DS_RANGED_HASH_FN_HPP
+
+#include <ext/pb_ds/detail/basic_types.hpp>
+#include <utility>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ template<typename Key, typename Hash_Fn, typename Allocator,
+ typename Comb_Hash_Fn, bool Store_Hash>
+ class ranged_hash_fn;
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, typename Hash_Fn, typename Allocator, \
+ typename Comb_Hash_Fn>
+
+#define PB_DS_CLASS_C_DEC \
+ ranged_hash_fn<Key, Hash_Fn, Allocator, Comb_Hash_Fn, false>
+
+ /**
+ * Specialization 1
+ * The client supplies a hash function and a ranged hash function,
+ * and requests that hash values not be stored.
+ **/
+ template<typename Key, typename Hash_Fn, typename Allocator,
+ typename Comb_Hash_Fn>
+ class ranged_hash_fn< Key, Hash_Fn, Allocator, Comb_Hash_Fn, false>
+ : public Hash_Fn, public Comb_Hash_Fn
+ {
+ protected:
+ typedef typename Allocator::size_type size_type;
+ typedef Hash_Fn hash_fn_base;
+ typedef Comb_Hash_Fn comb_hash_fn_base;
+ typedef typename Allocator::template rebind< Key>::other key_allocator;
+ typedef typename key_allocator::const_reference const_key_reference;
+
+ ranged_hash_fn(size_type);
+
+ ranged_hash_fn(size_type, const Hash_Fn&);
+
+ ranged_hash_fn(size_type, const Hash_Fn&, const Comb_Hash_Fn&);
+
+ void
+ swap(PB_DS_CLASS_C_DEC&);
+
+ void
+ notify_resized(size_type);
+
+ inline size_type
+ operator()(const_key_reference) const;
+ };
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_hash_fn(size_type size)
+ { Comb_Hash_Fn::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_hash_fn(size_type size, const Hash_Fn& r_hash_fn)
+ : Hash_Fn(r_hash_fn)
+ { Comb_Hash_Fn::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_hash_fn(size_type size, const Hash_Fn& r_hash_fn,
+ const Comb_Hash_Fn& r_comb_hash_fn)
+ : Hash_Fn(r_hash_fn), Comb_Hash_Fn(r_comb_hash_fn)
+ { comb_hash_fn_base::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ swap(PB_DS_CLASS_C_DEC& other)
+ {
+ comb_hash_fn_base::swap(other);
+ std::swap((Hash_Fn& )(*this), (Hash_Fn& )other);
+ }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ notify_resized(size_type size)
+ { comb_hash_fn_base::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::size_type
+ PB_DS_CLASS_C_DEC::
+ operator()(const_key_reference r_key) const
+ { return (comb_hash_fn_base::operator()(hash_fn_base::operator()(r_key)));}
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, typename Hash_Fn, typename Allocator, \
+ typename Comb_Hash_Fn>
+
+#define PB_DS_CLASS_C_DEC \
+ ranged_hash_fn<Key,Hash_Fn, Allocator, Comb_Hash_Fn, true>
+
+ /**
+ * Specialization 2
+ * The client supplies a hash function and a ranged hash function,
+ * and requests that hash values be stored.
+ **/
+ template<typename Key, typename Hash_Fn, typename Allocator,
+ typename Comb_Hash_Fn>
+ class ranged_hash_fn<Key, Hash_Fn, Allocator, Comb_Hash_Fn, true>
+ : public Hash_Fn, public Comb_Hash_Fn
+ {
+ protected:
+ typedef typename Allocator::size_type size_type;
+ typedef std::pair<size_type, size_type> comp_hash;
+ typedef Hash_Fn hash_fn_base;
+ typedef Comb_Hash_Fn comb_hash_fn_base;
+ typedef typename Allocator::template rebind<Key>::other key_allocator;
+ typedef typename key_allocator::const_reference const_key_reference;
+
+ ranged_hash_fn(size_type);
+
+ ranged_hash_fn(size_type, const Hash_Fn&);
+
+ ranged_hash_fn(size_type, const Hash_Fn&, const Comb_Hash_Fn&);
+
+ void
+ swap(PB_DS_CLASS_C_DEC&);
+
+ void
+ notify_resized(size_type);
+
+ inline comp_hash
+ operator()(const_key_reference) const;
+
+ inline comp_hash
+ operator()(const_key_reference, size_type) const;
+ };
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_hash_fn(size_type size)
+ { Comb_Hash_Fn::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_hash_fn(size_type size, const Hash_Fn& r_hash_fn) :
+ Hash_Fn(r_hash_fn)
+ { Comb_Hash_Fn::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_hash_fn(size_type size, const Hash_Fn& r_hash_fn,
+ const Comb_Hash_Fn& r_comb_hash_fn)
+ : Hash_Fn(r_hash_fn), Comb_Hash_Fn(r_comb_hash_fn)
+ { comb_hash_fn_base::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ swap(PB_DS_CLASS_C_DEC& other)
+ {
+ comb_hash_fn_base::swap(other);
+ std::swap((Hash_Fn& )(*this), (Hash_Fn& )other);
+ }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ notify_resized(size_type size)
+ { comb_hash_fn_base::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::comp_hash
+ PB_DS_CLASS_C_DEC::
+ operator()(const_key_reference r_key) const
+ {
+ const size_type hash = hash_fn_base::operator()(r_key);
+ return std::make_pair(comb_hash_fn_base::operator()(hash), hash);
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::comp_hash
+ PB_DS_CLASS_C_DEC::
+ operator()
+#ifdef _GLIBCXX_DEBUG
+ (const_key_reference r_key, size_type hash) const
+#else
+ (const_key_reference /*r_key*/, size_type hash) const
+#endif
+ {
+ _GLIBCXX_DEBUG_ASSERT(hash == hash_fn_base::operator()(r_key));
+ return std::make_pair(comb_hash_fn_base::operator()(hash), hash);
+ }
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, typename Allocator, typename Comb_Hash_Fn>
+
+#define PB_DS_CLASS_C_DEC \
+ ranged_hash_fn<Key, null_hash_fn, Allocator, Comb_Hash_Fn, false>
+
+ /**
+ * Specialization 3
+ * The client does not supply a hash function (by specifying
+ * null_hash_fn as the Hash_Fn parameter), and requests that hash
+ * values not be stored.
+ **/
+ template<typename Key, typename Allocator, typename Comb_Hash_Fn>
+ class ranged_hash_fn<Key, null_hash_fn, Allocator, Comb_Hash_Fn, false>
+ : public null_hash_fn, public Comb_Hash_Fn
+ {
+ protected:
+ typedef typename Allocator::size_type size_type;
+ typedef Comb_Hash_Fn comb_hash_fn_base;
+
+ ranged_hash_fn(size_type);
+
+ ranged_hash_fn(size_type, const Comb_Hash_Fn&);
+
+ ranged_hash_fn(size_type, const null_hash_fn&, const Comb_Hash_Fn&);
+
+ void
+ swap(PB_DS_CLASS_C_DEC&);
+ };
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_hash_fn(size_type size)
+ { Comb_Hash_Fn::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_hash_fn(size_type size, const Comb_Hash_Fn& r_comb_hash_fn) :
+ Comb_Hash_Fn(r_comb_hash_fn)
+ { }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_hash_fn(size_type size, const null_hash_fn& r_null_hash_fn,
+ const Comb_Hash_Fn& r_comb_hash_fn)
+ : Comb_Hash_Fn(r_comb_hash_fn)
+ { }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ swap(PB_DS_CLASS_C_DEC& other)
+ { comb_hash_fn_base::swap(other); }
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, typename Allocator, typename Comb_Hash_Fn>
+
+#define PB_DS_CLASS_C_DEC \
+ ranged_hash_fn<Key, null_hash_fn, Allocator, Comb_Hash_Fn, true>
+
+ /**
+ * Specialization 4
+ * The client does not supply a hash function (by specifying
+ * null_hash_fn as the Hash_Fn parameter), and requests that hash
+ * values be stored.
+ **/
+ template<typename Key, typename Allocator, typename Comb_Hash_Fn>
+ class ranged_hash_fn<Key, null_hash_fn, Allocator, Comb_Hash_Fn, true>
+ : public null_hash_fn, public Comb_Hash_Fn
+ {
+ protected:
+ typedef typename Allocator::size_type size_type;
+ typedef Comb_Hash_Fn comb_hash_fn_base;
+
+ ranged_hash_fn(size_type);
+
+ ranged_hash_fn(size_type, const Comb_Hash_Fn&);
+
+ ranged_hash_fn(size_type, const null_hash_fn&, const Comb_Hash_Fn&);
+
+ void
+ swap(PB_DS_CLASS_C_DEC&);
+ };
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_hash_fn(size_type size)
+ { Comb_Hash_Fn::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_hash_fn(size_type size, const Comb_Hash_Fn& r_comb_hash_fn)
+ : Comb_Hash_Fn(r_comb_hash_fn)
+ { }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_hash_fn(size_type size, const null_hash_fn& r_null_hash_fn,
+ const Comb_Hash_Fn& r_comb_hash_fn)
+ : Comb_Hash_Fn(r_comb_hash_fn)
+ { }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ swap(PB_DS_CLASS_C_DEC& other)
+ { comb_hash_fn_base::swap(other); }
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/ranged_probe_fn.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/ranged_probe_fn.hpp
new file mode 100644
index 0000000..ddfba9d
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/ranged_probe_fn.hpp
@@ -0,0 +1,327 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file ranged_probe_fn.hpp
+ * Contains a unified ranged probe functor, allowing the probe tables to deal with
+ * a single class for ranged probeing.
+ */
+
+#ifndef PB_DS_RANGED_PROBE_FN_HPP
+#define PB_DS_RANGED_PROBE_FN_HPP
+
+#include <ext/pb_ds/detail/basic_types.hpp>
+#include <utility>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ template<typename Key, typename Hash_Fn, typename Allocator,
+ typename Comb_Probe_Fn, typename Probe_Fn, bool Store_Hash>
+ class ranged_probe_fn;
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, typename Hash_Fn, typename Allocator, \
+ typename Comb_Probe_Fn, typename Probe_Fn>
+
+#define PB_DS_CLASS_C_DEC \
+ ranged_probe_fn<Key, Hash_Fn, Allocator, Comb_Probe_Fn, Probe_Fn, false>
+
+ /**
+ * Specialization 1
+ * The client supplies a probe function and a ranged probe
+ * function, and requests that hash values not be stored.
+ **/
+ template<typename Key, typename Hash_Fn, typename Allocator,
+ typename Comb_Probe_Fn, typename Probe_Fn>
+ class ranged_probe_fn<Key, Hash_Fn, Allocator, Comb_Probe_Fn,
+ Probe_Fn, false>
+ : public Hash_Fn, public Comb_Probe_Fn, public Probe_Fn
+ {
+ protected:
+ typedef typename Allocator::size_type size_type;
+ typedef Comb_Probe_Fn comb_probe_fn_base;
+ typedef Hash_Fn hash_fn_base;
+ typedef Probe_Fn probe_fn_base;
+ typedef typename Allocator::template rebind<Key>::other key_allocator;
+ typedef typename key_allocator::const_reference const_key_reference;
+
+ ranged_probe_fn(size_type);
+
+ ranged_probe_fn(size_type, const Hash_Fn&);
+
+ ranged_probe_fn(size_type, const Hash_Fn&, const Comb_Probe_Fn&);
+
+ ranged_probe_fn(size_type, const Hash_Fn&, const Comb_Probe_Fn&,
+ const Probe_Fn&);
+
+ void
+ swap(PB_DS_CLASS_C_DEC&);
+
+ void
+ notify_resized(size_type);
+
+ inline size_type
+ operator()(const_key_reference) const;
+
+ inline size_type
+ operator()(const_key_reference, size_type, size_type) const;
+ };
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_probe_fn(size_type size)
+ { Comb_Probe_Fn::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_probe_fn(size_type size, const Hash_Fn& r_hash_fn)
+ : Hash_Fn(r_hash_fn)
+ { Comb_Probe_Fn::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_probe_fn(size_type size, const Hash_Fn& r_hash_fn,
+ const Comb_Probe_Fn& r_comb_probe_fn)
+ : Hash_Fn(r_hash_fn), Comb_Probe_Fn(r_comb_probe_fn)
+ { comb_probe_fn_base::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_probe_fn(size_type size, const Hash_Fn& r_hash_fn,
+ const Comb_Probe_Fn& r_comb_probe_fn,
+ const Probe_Fn& r_probe_fn)
+ : Hash_Fn(r_hash_fn), Comb_Probe_Fn(r_comb_probe_fn), Probe_Fn(r_probe_fn)
+ { comb_probe_fn_base::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ swap(PB_DS_CLASS_C_DEC& other)
+ {
+ comb_probe_fn_base::swap(other);
+ std::swap((Hash_Fn& )(*this), (Hash_Fn&)other);
+ }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ notify_resized(size_type size)
+ { comb_probe_fn_base::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::size_type
+ PB_DS_CLASS_C_DEC::
+ operator()(const_key_reference r_key) const
+ { return comb_probe_fn_base::operator()(hash_fn_base::operator()(r_key)); }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::size_type
+ PB_DS_CLASS_C_DEC::
+ operator()(const_key_reference, size_type hash, size_type i) const
+ {
+ return comb_probe_fn_base::operator()(hash + probe_fn_base::operator()(i));
+ }
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, typename Hash_Fn, typename Allocator, \
+ typename Comb_Probe_Fn, typename Probe_Fn>
+
+#define PB_DS_CLASS_C_DEC \
+ ranged_probe_fn<Key, Hash_Fn, Allocator, Comb_Probe_Fn, Probe_Fn, true>
+
+ /**
+ * Specialization 2- The client supplies a probe function and a ranged
+ * probe function, and requests that hash values not be stored.
+ **/
+ template<typename Key, typename Hash_Fn, typename Allocator,
+ typename Comb_Probe_Fn, typename Probe_Fn>
+ class ranged_probe_fn<Key, Hash_Fn, Allocator, Comb_Probe_Fn,
+ Probe_Fn, true>
+ : public Hash_Fn, public Comb_Probe_Fn, public Probe_Fn
+ {
+ protected:
+ typedef typename Allocator::size_type size_type;
+ typedef std::pair<size_type, size_type> comp_hash;
+ typedef Comb_Probe_Fn comb_probe_fn_base;
+ typedef Hash_Fn hash_fn_base;
+ typedef Probe_Fn probe_fn_base;
+ typedef typename Allocator::template rebind<Key>::other key_allocator;
+ typedef typename key_allocator::const_reference const_key_reference;
+
+ ranged_probe_fn(size_type);
+
+ ranged_probe_fn(size_type, const Hash_Fn&);
+
+ ranged_probe_fn(size_type, const Hash_Fn&,
+ const Comb_Probe_Fn&);
+
+ ranged_probe_fn(size_type, const Hash_Fn&, const Comb_Probe_Fn&,
+ const Probe_Fn&);
+
+ void
+ swap(PB_DS_CLASS_C_DEC&);
+
+ void
+ notify_resized(size_type);
+
+ inline comp_hash
+ operator()(const_key_reference) const;
+
+ inline size_type
+ operator()(const_key_reference, size_type, size_type) const;
+
+ inline size_type
+ operator()(const_key_reference, size_type) const;
+ };
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_probe_fn(size_type size)
+ { Comb_Probe_Fn::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_probe_fn(size_type size, const Hash_Fn& r_hash_fn)
+ : Hash_Fn(r_hash_fn)
+ { Comb_Probe_Fn::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_probe_fn(size_type size, const Hash_Fn& r_hash_fn,
+ const Comb_Probe_Fn& r_comb_probe_fn)
+ : Hash_Fn(r_hash_fn), Comb_Probe_Fn(r_comb_probe_fn)
+ { comb_probe_fn_base::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_probe_fn(size_type size, const Hash_Fn& r_hash_fn,
+ const Comb_Probe_Fn& r_comb_probe_fn,
+ const Probe_Fn& r_probe_fn)
+ : Hash_Fn(r_hash_fn), Comb_Probe_Fn(r_comb_probe_fn), Probe_Fn(r_probe_fn)
+ { comb_probe_fn_base::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ swap(PB_DS_CLASS_C_DEC& other)
+ {
+ comb_probe_fn_base::swap(other);
+ std::swap((Hash_Fn& )(*this), (Hash_Fn& )other);
+ }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ notify_resized(size_type size)
+ { comb_probe_fn_base::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::comp_hash
+ PB_DS_CLASS_C_DEC::
+ operator()(const_key_reference r_key) const
+ {
+ const size_type hash = hash_fn_base::operator()(r_key);
+ return std::make_pair(comb_probe_fn_base::operator()(hash), hash);
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::size_type
+ PB_DS_CLASS_C_DEC::
+ operator()(const_key_reference, size_type hash, size_type i) const
+ {
+ return comb_probe_fn_base::operator()(hash + probe_fn_base::operator()(i));
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::size_type
+ PB_DS_CLASS_C_DEC::
+ operator()
+#ifdef _GLIBCXX_DEBUG
+ (const_key_reference r_key, size_type hash) const
+#else
+ (const_key_reference /*r_key*/, size_type hash) const
+#endif
+ {
+ _GLIBCXX_DEBUG_ASSERT(hash == hash_fn_base::operator()(r_key));
+ return hash;
+ }
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+ /**
+ * Specialization 3 and 4
+ * The client does not supply a hash function or probe function,
+ * and requests that hash values not be stored.
+ **/
+ template<typename Key, typename Allocator, typename Comb_Probe_Fn>
+ class ranged_probe_fn<Key, null_hash_fn, Allocator, Comb_Probe_Fn,
+ null_probe_fn, false>
+ : public Comb_Probe_Fn, public null_hash_fn, public null_probe_fn
+ {
+ protected:
+ typedef typename Allocator::size_type size_type;
+ typedef Comb_Probe_Fn comb_probe_fn_base;
+ typedef typename Allocator::template rebind<Key>::other key_allocator;
+ typedef typename key_allocator::const_reference const_key_reference;
+
+ ranged_probe_fn(size_type size)
+ { Comb_Probe_Fn::notify_resized(size); }
+
+ ranged_probe_fn(size_type, const Comb_Probe_Fn& r_comb_probe_fn)
+ : Comb_Probe_Fn(r_comb_probe_fn)
+ { }
+
+ ranged_probe_fn(size_type, const null_hash_fn&,
+ const Comb_Probe_Fn& r_comb_probe_fn,
+ const null_probe_fn&)
+ : Comb_Probe_Fn(r_comb_probe_fn)
+ { }
+
+ void
+ swap(ranged_probe_fn& other)
+ { comb_probe_fn_base::swap(other); }
+ };
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/sample_probe_fn.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/sample_probe_fn.hpp
new file mode 100644
index 0000000..dad6451
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/sample_probe_fn.hpp
@@ -0,0 +1,73 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file sample_probe_fn.hpp
+ * Contains a sample probe policy.
+ */
+
+#ifndef PB_DS_SAMPLE_PROBE_FN_HPP
+#define PB_DS_SAMPLE_PROBE_FN_HPP
+
+// A sample probe policy.
+class sample_probe_fn
+{
+
+public:
+
+ // Size type.
+ typedef size_t size_type;
+
+public:
+
+ // Default constructor.
+ sample_probe_fn();
+
+ // Copy constructor.
+ sample_probe_fn(const sample_probe_fn& other);
+
+ // Swaps content.
+ inline void
+ swap(sample_probe_fn& other);
+
+protected:
+
+ // Returns the i-th offset from the hash value of some key r_key.
+ inline size_type
+ operator()(const_key_reference r_key, size_type i) const;
+
+};
+
+#endif // #ifndef PB_DS_SAMPLE_PROBE_FN_HPP
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/sample_range_hashing.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/sample_range_hashing.hpp
new file mode 100644
index 0000000..0912e7f
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/sample_range_hashing.hpp
@@ -0,0 +1,77 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file sample_range_hashing.hpp
+ * Contains a range hashing policy.
+ */
+
+#ifndef PB_DS_SAMPLE_RANGE_HASHING_HPP
+#define PB_DS_SAMPLE_RANGE_HASHING_HPP
+
+// A sample range-hashing functor.
+class sample_range_hashing
+{
+
+public:
+
+ // Size type.
+ typedef size_t size_type;
+
+public:
+
+ // Default constructor.
+ sample_range_hashing();
+
+ // Copy constructor.
+ sample_range_hashing(const sample_range_hashing& other);
+
+ // Swaps content.
+ inline void
+ swap(sample_range_hashing& other);
+
+protected:
+
+ // Notifies the policy object that the container's __size has changed to size.
+ void
+ notify_resized(size_type size);
+
+ // Transforms the __hash value hash into a ranged-hash value.
+ inline size_type
+ operator()(size_type hash) const;
+
+};
+
+#endif // #ifndef PB_DS_SAMPLE_RANGE_HASHING_HPP
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/sample_ranged_hash_fn.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/sample_ranged_hash_fn.hpp
new file mode 100644
index 0000000..6120231
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/sample_ranged_hash_fn.hpp
@@ -0,0 +1,77 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file sample_ranged_hash_fn.hpp
+ * Contains a ranged hash policy.
+ */
+
+#ifndef PB_DS_SAMPLE_RANGED_HASH_FN_HPP
+#define PB_DS_SAMPLE_RANGED_HASH_FN_HPP
+
+// A sample ranged-hash functor.
+class sample_ranged_hash_fn
+{
+
+public:
+
+ // Size type.
+ typedef size_t size_type;
+
+public:
+
+ // Default constructor.
+ sample_ranged_hash_fn();
+
+ // Copy constructor.
+ sample_ranged_hash_fn(const sample_ranged_hash_fn& other);
+
+ // Swaps content.
+ inline void
+ swap(sample_ranged_hash_fn& other);
+
+protected:
+
+ // Notifies the policy object that the container's __size has changed to size.
+ void
+ notify_resized(size_type size);
+
+ // Transforms r_key into a position within the table.
+ inline size_type
+ operator()(const_key_reference r_key) const;
+
+};
+
+#endif // #ifndef PB_DS_SAMPLE_RANGED_HASH_FN_HPP
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/sample_ranged_probe_fn.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/sample_ranged_probe_fn.hpp
new file mode 100644
index 0000000..915f108
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/hash_fn/sample_ranged_probe_fn.hpp
@@ -0,0 +1,77 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file sample_ranged_probe_fn.hpp
+ * Contains a ranged probe policy.
+ */
+
+#ifndef PB_DS_SAMPLE_RANGED_PROBE_FN_HPP
+#define PB_DS_SAMPLE_RANGED_PROBE_FN_HPP
+
+// A sample ranged-probe functor.
+class sample_ranged_probe_fn
+{
+
+public:
+
+ // Size type.
+ typedef size_t size_type;
+
+public:
+
+ // Default constructor.
+ sample_ranged_probe_fn();
+
+ // Copy constructor.
+ sample_ranged_probe_fn(const sample_ranged_probe_fn& other);
+
+ // Swaps content.
+ inline void
+ swap(sample_ranged_probe_fn& other);
+
+protected:
+
+ // Notifies the policy object that the container's __size has changed to size.
+ void
+ notify_resized(size_type size);
+
+ // Transforms the const key reference r_key into the i-th position within the table. This method is called for each collision within the probe sequence.
+ inline size_type
+ operator()(const_key_reference r_key, size_t hash, size_type i) const;
+
+};
+
+#endif // #ifndef PB_DS_SAMPLE_RANGED_PROBE_FN_HPP
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/const_iterator.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/const_iterator.hpp
new file mode 100644
index 0000000..5955df1
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/const_iterator.hpp
@@ -0,0 +1,162 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file const_iterator.hpp
+ * Contains an iterator class returned by the table's const find and insert
+ * methods.
+ */
+
+#ifndef PB_DS_LEFT_CHILD_NEXT_SIBLING_HEAP_CONST_ITERATOR_HPP
+#define PB_DS_LEFT_CHILD_NEXT_SIBLING_HEAP_CONST_ITERATOR_HPP
+
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/const_point_iterator.hpp>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_CLASS_C_DEC \
+ left_child_next_sibling_heap_const_iterator_<Node, Allocator>
+
+#define PB_DS_BASE_C_DEC \
+ left_child_next_sibling_heap_node_const_point_iterator_<Node, Allocator>
+
+ // Const point-type iterator.
+ template<typename Node, class Allocator>
+ class left_child_next_sibling_heap_const_iterator_ : public PB_DS_BASE_C_DEC
+ {
+
+ private:
+ typedef typename PB_DS_BASE_C_DEC::node_pointer node_pointer;
+
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ public:
+
+ // Category.
+ typedef std::forward_iterator_tag iterator_category;
+
+ // Difference type.
+ typedef typename Allocator::difference_type difference_type;
+
+ // Iterator's value type.
+ typedef typename base_type::value_type value_type;
+
+ // Iterator's pointer type.
+ typedef typename base_type::pointer pointer;
+
+ // Iterator's const pointer type.
+ typedef typename base_type::const_pointer const_pointer;
+
+ // Iterator's reference type.
+ typedef typename base_type::reference reference;
+
+ // Iterator's const reference type.
+ typedef typename base_type::const_reference const_reference;
+
+ public:
+
+ inline
+ left_child_next_sibling_heap_const_iterator_(node_pointer p_nd) : base_type(p_nd)
+ { }
+
+ // Default constructor.
+ inline
+ left_child_next_sibling_heap_const_iterator_()
+ { }
+
+ // Copy constructor.
+ inline
+ left_child_next_sibling_heap_const_iterator_(const PB_DS_CLASS_C_DEC& other) : base_type(other)
+ { }
+
+ // Compares content to a different iterator object.
+ inline bool
+ operator==(const PB_DS_CLASS_C_DEC& other) const
+ { return (base_type::m_p_nd == other.m_p_nd); }
+
+ // Compares content (negatively) to a different iterator object.
+ inline bool
+ operator!=(const PB_DS_CLASS_C_DEC& other) const
+ { return (base_type::m_p_nd != other.m_p_nd); }
+
+ inline PB_DS_CLASS_C_DEC&
+ operator++()
+ {
+ _GLIBCXX_DEBUG_ASSERT(base_type::m_p_nd != NULL);
+ inc();
+ return (*this);
+ }
+
+ inline PB_DS_CLASS_C_DEC
+ operator++(int)
+ {
+ PB_DS_CLASS_C_DEC ret_it(base_type::m_p_nd);
+ operator++();
+ return (ret_it);
+ }
+
+ private:
+ void
+ inc()
+ {
+ if (base_type::m_p_nd->m_p_next_sibling != NULL)
+ {
+ base_type::m_p_nd = base_type::m_p_nd->m_p_next_sibling;
+ while (base_type::m_p_nd->m_p_l_child != NULL)
+ base_type::m_p_nd = base_type::m_p_nd->m_p_l_child;
+ return;
+ }
+
+ while (true)
+ {
+ node_pointer p_next = base_type::m_p_nd;
+ base_type::m_p_nd = base_type::m_p_nd->m_p_prev_or_parent;
+ if (base_type::m_p_nd == NULL || base_type::m_p_nd->m_p_l_child == p_next)
+ return;
+ }
+ }
+ };
+
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_BASE_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/const_point_iterator.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/const_point_iterator.hpp
new file mode 100644
index 0000000..7d68252
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/const_point_iterator.hpp
@@ -0,0 +1,154 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file const_point_iterator.hpp
+ * Contains an iterator class returned by the table's const find and insert
+ * methods.
+ */
+
+#ifndef PB_DS_LEFT_CHILD_NEXT_SIBLING_HEAP_CONST_FIND_ITERATOR_HPP
+#define PB_DS_LEFT_CHILD_NEXT_SIBLING_HEAP_CONST_FIND_ITERATOR_HPP
+
+#include <ext/pb_ds/tag_and_trait.hpp>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Node, class Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ left_child_next_sibling_heap_node_const_point_iterator_<Node, Allocator>
+
+ // Const point-type iterator.
+ template<typename Node, class Allocator>
+ class left_child_next_sibling_heap_node_const_point_iterator_
+ {
+
+ protected:
+ typedef typename Allocator::template rebind<Node>::other::pointer node_pointer;
+
+ public:
+
+ // Category.
+ typedef trivial_iterator_tag iterator_category;
+
+ // Difference type.
+ typedef trivial_iterator_difference_type difference_type;
+
+ // Iterator's value type.
+ typedef typename Node::value_type value_type;
+
+ // Iterator's pointer type.
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::pointer
+ pointer;
+
+ // Iterator's const pointer type.
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::const_pointer
+ const_pointer;
+
+ // Iterator's reference type.
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::reference
+ reference;
+
+ // Iterator's const reference type.
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::const_reference
+ const_reference;
+
+ public:
+
+ inline
+ left_child_next_sibling_heap_node_const_point_iterator_(node_pointer p_nd) : m_p_nd(p_nd)
+ { }
+
+ // Default constructor.
+ inline
+ left_child_next_sibling_heap_node_const_point_iterator_() : m_p_nd(NULL)
+ { }
+
+ // Copy constructor.
+ inline
+ left_child_next_sibling_heap_node_const_point_iterator_(const PB_DS_CLASS_C_DEC& other) : m_p_nd(other.m_p_nd)
+ { }
+
+ // Access.
+ inline const_pointer
+ operator->() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_nd != NULL);
+ return &m_p_nd->m_value;
+ }
+
+ // Access.
+ inline const_reference
+ operator*() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_nd != NULL);
+ return m_p_nd->m_value;
+ }
+
+ // Compares content to a different iterator object.
+ inline bool
+ operator==(const PB_DS_CLASS_C_DEC& other) const
+ { return m_p_nd == other.m_p_nd; }
+
+ // Compares content (negatively) to a different iterator object.
+ inline bool
+ operator!=(const PB_DS_CLASS_C_DEC& other) const
+ { return m_p_nd != other.m_p_nd; }
+
+ public:
+ node_pointer m_p_nd;
+ };
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/constructors_destructor_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/constructors_destructor_fn_imps.hpp
new file mode 100644
index 0000000..ea05725
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/constructors_destructor_fn_imps.hpp
@@ -0,0 +1,152 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructors_destructor_fn_imps.hpp
+ * Contains an implementation class for left_child_next_sibling_heap_.
+ */
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::node_allocator
+PB_DS_CLASS_C_DEC::s_node_allocator;
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::no_throw_copies_t
+PB_DS_CLASS_C_DEC::s_no_throw_copies_ind;
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+left_child_next_sibling_heap_() :
+ m_p_root(NULL),
+ m_size(0)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+left_child_next_sibling_heap_(const Cmp_Fn& r_cmp_fn) :
+ Cmp_Fn(r_cmp_fn),
+ m_p_root(NULL),
+ m_size(0)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+left_child_next_sibling_heap_(const PB_DS_CLASS_C_DEC& other)
+: Cmp_Fn(other), m_p_root(NULL), m_size(0)
+{
+ m_size = other.m_size;
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ m_p_root = recursive_copy_node(other.m_p_root);
+ m_size = other.m_size;
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ value_swap(other);
+ std::swap((Cmp_Fn& )(*this), (Cmp_Fn& )other);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+value_swap(PB_DS_CLASS_C_DEC& other)
+{
+ std::swap(m_p_root, other.m_p_root);
+ std::swap(m_size, other.m_size);
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+~left_child_next_sibling_heap_()
+{
+ clear();
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+recursive_copy_node(const_node_pointer p_nd)
+{
+ if (p_nd == NULL)
+ return (NULL);
+
+ node_pointer p_ret = s_node_allocator.allocate(1);
+
+ __try
+ {
+ new (p_ret) node(*p_nd);
+ }
+ __catch(...)
+ {
+ s_node_allocator.deallocate(p_ret, 1);
+ __throw_exception_again;
+ }
+
+ p_ret->m_p_l_child = p_ret->m_p_next_sibling =
+ p_ret->m_p_prev_or_parent = NULL;
+
+ __try
+ {
+ p_ret->m_p_l_child = recursive_copy_node(p_nd->m_p_l_child);
+ p_ret->m_p_next_sibling = recursive_copy_node(p_nd->m_p_next_sibling);
+ }
+ __catch(...)
+ {
+ clear_imp(p_ret);
+ __throw_exception_again;
+ }
+
+ if (p_ret->m_p_l_child != NULL)
+ p_ret->m_p_l_child->m_p_prev_or_parent = p_ret;
+
+ if (p_ret->m_p_next_sibling != NULL)
+ p_ret->m_p_next_sibling->m_p_prev_or_parent =
+ p_nd->m_p_next_sibling->m_p_prev_or_parent == p_nd ? p_ret : NULL;
+
+ return p_ret;
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/debug_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/debug_fn_imps.hpp
new file mode 100644
index 0000000..86871ac
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/debug_fn_imps.hpp
@@ -0,0 +1,141 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_fn_imps.hpp
+ * Contains an implementation class for left_child_next_sibling_heap_.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_valid() const
+{
+ _GLIBCXX_DEBUG_ASSERT(m_p_root == NULL || m_p_root->m_p_prev_or_parent == NULL);
+
+ if (m_p_root != NULL)
+ assert_node_consistent(m_p_root, Single_Link_Roots);
+ assert_size();
+ assert_iterators();
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_node_consistent(const_node_pointer p_nd, bool single_link) const
+{
+ if (p_nd == NULL)
+ return;
+
+ assert_node_consistent(p_nd->m_p_l_child, false);
+ assert_node_consistent(p_nd->m_p_next_sibling, single_link);
+
+ if (single_link)
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_prev_or_parent == NULL);
+ else if (p_nd->m_p_next_sibling != NULL)
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_next_sibling->m_p_prev_or_parent == p_nd);
+
+ if (p_nd->m_p_l_child == NULL)
+ return;
+
+ const_node_pointer p_child = p_nd->m_p_l_child;
+ while (p_child != NULL)
+ {
+ const_node_pointer p_next_child = p_child->m_p_next_sibling;
+ _GLIBCXX_DEBUG_ASSERT(!Cmp_Fn::operator()(p_nd->m_value, p_child->m_value));
+ p_child = p_next_child;
+ }
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_l_child->m_p_prev_or_parent == p_nd);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_iterators() const
+{
+ const size_type calc_size = std::distance(begin(), end());
+ if (calc_size == size())
+ return;
+ _GLIBCXX_DEBUG_ASSERT(0);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_size() const
+{
+ if (size_from_node(m_p_root) == m_size)
+ return;
+ _GLIBCXX_DEBUG_ASSERT(0);
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+size_under_node(const_node_pointer p_nd)
+{ return 1 + size_from_node(p_nd->m_p_l_child); }
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+size_from_node(const_node_pointer p_nd)
+{
+ size_type ret = 0;
+ while (p_nd != NULL)
+ {
+ ret += 1 + size_from_node(p_nd->m_p_l_child);
+ p_nd = p_nd->m_p_next_sibling;
+ }
+ return ret;
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+degree(const_node_pointer p_nd)
+{
+ size_type ret = 0;
+ const_node_pointer p_child = p_nd->m_p_l_child;
+ while (p_child != NULL)
+ {
+ ++ret;
+ p_child = p_child->m_p_next_sibling;
+ }
+ return ret;
+}
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/erase_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/erase_fn_imps.hpp
new file mode 100644
index 0000000..9fa09f4
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/erase_fn_imps.hpp
@@ -0,0 +1,150 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file erase_fn_imps.hpp
+ * Contains an implementation class for left_child_next_sibling_heap_.
+ */
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+clear()
+{
+ clear_imp(m_p_root);
+ _GLIBCXX_DEBUG_ASSERT(m_size == 0);
+ m_p_root = NULL;
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+actual_erase_node(node_pointer p_nd)
+{
+ _GLIBCXX_DEBUG_ASSERT(m_size > 0);
+ --m_size;
+ p_nd->~node();
+ s_node_allocator.deallocate(p_nd, 1);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+clear_imp(node_pointer p_nd)
+{
+ while (p_nd != NULL)
+ {
+ clear_imp(p_nd->m_p_l_child);
+ node_pointer p_next = p_nd->m_p_next_sibling;
+ actual_erase_node(p_nd);
+ p_nd = p_next;
+ }
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+to_linked_list()
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ node_pointer p_cur = m_p_root;
+ while (p_cur != NULL)
+ if (p_cur->m_p_l_child != NULL)
+ {
+ node_pointer p_child_next = p_cur->m_p_l_child->m_p_next_sibling;
+ p_cur->m_p_l_child->m_p_next_sibling = p_cur->m_p_next_sibling;
+ p_cur->m_p_next_sibling = p_cur->m_p_l_child;
+ p_cur->m_p_l_child = p_child_next;
+ }
+ else
+ p_cur = p_cur->m_p_next_sibling;
+
+#ifdef _GLIBCXX_DEBUG
+ const_node_pointer p_counter = m_p_root;
+ size_type count = 0;
+ while (p_counter != NULL)
+ {
+ ++count;
+ _GLIBCXX_DEBUG_ASSERT(p_counter->m_p_l_child == NULL);
+ p_counter = p_counter->m_p_next_sibling;
+ }
+ _GLIBCXX_DEBUG_ASSERT(count == m_size);
+#endif
+}
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+prune(Pred pred)
+{
+ node_pointer p_cur = m_p_root;
+ m_p_root = NULL;
+ node_pointer p_out = NULL;
+ while (p_cur != NULL)
+ {
+ node_pointer p_next = p_cur->m_p_next_sibling;
+ if (pred(p_cur->m_value))
+ {
+ p_cur->m_p_next_sibling = p_out;
+ if (p_out != NULL)
+ p_out->m_p_prev_or_parent = p_cur;
+ p_out = p_cur;
+ }
+ else
+ {
+ p_cur->m_p_next_sibling = m_p_root;
+ if (m_p_root != NULL)
+ m_p_root->m_p_prev_or_parent = p_cur;
+ m_p_root = p_cur;
+ }
+ p_cur = p_next;
+ }
+ return p_out;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+bubble_to_top(node_pointer p_nd)
+{
+ node_pointer p_parent = parent(p_nd);
+ while (p_parent != NULL)
+ {
+ swap_with_parent(p_nd, p_parent);
+ p_parent = parent(p_nd);
+ }
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/info_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/info_fn_imps.hpp
new file mode 100644
index 0000000..75e6561
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/info_fn_imps.hpp
@@ -0,0 +1,64 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file info_fn_imps.hpp
+ * Contains an implementation class for left_child_next_sibling_heap_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+empty() const
+{
+ return (m_size == 0);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+size() const
+{
+ return (m_size);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+max_size() const
+{
+ return (s_node_allocator.max_size());
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/insert_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/insert_fn_imps.hpp
new file mode 100644
index 0000000..926ccd3
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/insert_fn_imps.hpp
@@ -0,0 +1,175 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file insert_fn_imps.hpp
+ * Contains an implementation class for left_child_next_sibling_heap_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+get_new_node_for_insert(const_reference r_val)
+{
+ return get_new_node_for_insert(r_val, s_no_throw_copies_ind);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+get_new_node_for_insert(const_reference r_val, false_type)
+{
+ node_pointer p_new_nd = s_node_allocator.allocate(1);
+
+ cond_dealtor_t cond(p_new_nd);
+
+ new (const_cast<void* >(
+ static_cast<const void* >(&p_new_nd->m_value)))
+ typename node::value_type(r_val);
+
+ cond.set_no_action();
+
+ ++m_size;
+
+ return (p_new_nd);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+get_new_node_for_insert(const_reference r_val, true_type)
+{
+ node_pointer p_new_nd = s_node_allocator.allocate(1);
+
+ new (const_cast<void* >(
+ static_cast<const void* >(&p_new_nd->m_value)))
+ typename node::value_type(r_val);
+
+ ++m_size;
+
+ return (p_new_nd);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+make_child_of(node_pointer p_nd, node_pointer p_new_parent)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_nd != NULL);
+ _GLIBCXX_DEBUG_ASSERT(p_new_parent != NULL);
+
+ p_nd->m_p_next_sibling = p_new_parent->m_p_l_child;
+
+ if (p_new_parent->m_p_l_child != NULL)
+ p_new_parent->m_p_l_child->m_p_prev_or_parent = p_nd;
+
+ p_nd->m_p_prev_or_parent = p_new_parent;
+
+ p_new_parent->m_p_l_child = p_nd;
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+parent(node_pointer p_nd)
+{
+ while (true)
+ {
+ node_pointer p_pot = p_nd->m_p_prev_or_parent;
+
+ if (p_pot == NULL || p_pot->m_p_l_child == p_nd)
+ return p_pot;
+
+ p_nd = p_pot;
+ }
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+swap_with_parent(node_pointer p_nd, node_pointer p_parent)
+{
+ if (p_parent == m_p_root)
+ m_p_root = p_nd;
+
+ _GLIBCXX_DEBUG_ASSERT(p_nd != NULL);
+ _GLIBCXX_DEBUG_ASSERT(p_parent != NULL);
+ _GLIBCXX_DEBUG_ASSERT(parent(p_nd) == p_parent);
+
+ const bool nd_direct_child = p_parent->m_p_l_child == p_nd;
+ const bool parent_root = p_parent->m_p_prev_or_parent == NULL;
+ const bool parent_direct_child =
+ !parent_root&& p_parent->m_p_prev_or_parent->m_p_l_child == p_parent;
+
+ std::swap(p_parent->m_p_prev_or_parent, p_nd->m_p_prev_or_parent);
+ std::swap(p_parent->m_p_next_sibling, p_nd->m_p_next_sibling);
+ std::swap(p_parent->m_p_l_child, p_nd->m_p_l_child);
+ std::swap(p_parent->m_metadata, p_nd->m_metadata);
+
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_l_child != NULL);
+ _GLIBCXX_DEBUG_ASSERT(p_parent->m_p_prev_or_parent != NULL);
+
+ if (p_nd->m_p_next_sibling != NULL)
+ p_nd->m_p_next_sibling->m_p_prev_or_parent = p_nd;
+
+ if (p_parent->m_p_next_sibling != NULL)
+ p_parent->m_p_next_sibling->m_p_prev_or_parent = p_parent;
+
+ if (p_parent->m_p_l_child != NULL)
+ p_parent->m_p_l_child->m_p_prev_or_parent = p_parent;
+
+ if (parent_direct_child)
+ p_nd->m_p_prev_or_parent->m_p_l_child = p_nd;
+ else if (!parent_root)
+ p_nd->m_p_prev_or_parent->m_p_next_sibling = p_nd;
+
+ if (!nd_direct_child)
+ {
+ p_nd->m_p_l_child->m_p_prev_or_parent = p_nd;
+
+ p_parent->m_p_prev_or_parent->m_p_next_sibling = p_parent;
+ }
+ else
+ {
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_l_child == p_nd);
+ _GLIBCXX_DEBUG_ASSERT(p_parent->m_p_prev_or_parent == p_parent);
+
+ p_nd->m_p_l_child = p_parent;
+ p_parent->m_p_prev_or_parent = p_nd;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(parent(p_parent) == p_nd);
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/iterators_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/iterators_fn_imps.hpp
new file mode 100644
index 0000000..dca70fd
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/iterators_fn_imps.hpp
@@ -0,0 +1,88 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file iterators_fn_imps.hpp
+ * Contains an implementation class for left_child_next_sibling_heap_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+begin()
+{
+ node_pointer p_nd = m_p_root;
+
+ if (p_nd == NULL)
+ return (iterator(NULL));
+
+ while (p_nd->m_p_l_child != NULL)
+ p_nd = p_nd->m_p_l_child;
+
+ return (iterator(p_nd));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+begin() const
+{
+ node_pointer p_nd = m_p_root;
+
+ if (p_nd == NULL)
+ return (const_iterator(NULL));
+
+ while (p_nd->m_p_l_child != NULL)
+ p_nd = p_nd->m_p_l_child;
+
+ return (const_iterator(p_nd));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+end()
+{
+ return (iterator(NULL));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+end() const
+{
+ return (const_iterator(NULL));
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp
new file mode 100644
index 0000000..34ad4be
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp
@@ -0,0 +1,349 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file left_child_next_sibling_heap_.hpp
+ * Contains an implementation class for a basic heap.
+ */
+
+#ifndef PB_DS_LEFT_CHILD_NEXT_SIBLING_HEAP_HPP
+#define PB_DS_LEFT_CHILD_NEXT_SIBLING_HEAP_HPP
+
+/*
+ * Based on CLRS.
+ */
+
+#include <iterator>
+#include <ext/pb_ds/detail/cond_dealtor.hpp>
+#include <ext/pb_ds/detail/type_utils.hpp>
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/node.hpp>
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/const_point_iterator.hpp>
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/const_iterator.hpp>
+#ifdef PB_DS_LC_NS_HEAP_TRACE_
+#include <iostream>
+#endif
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#ifdef _GLIBCXX_DEBUG
+#define PB_DS_CLASS_T_DEC \
+ template< \
+ typename Value_Type, \
+ class Cmp_Fn, \
+ typename Node_Metadata, \
+ class Allocator, \
+ bool Single_Link_Roots>
+#else
+#define PB_DS_CLASS_T_DEC \
+ template< \
+ typename Value_Type, \
+ class Cmp_Fn, \
+ typename Node_Metadata, \
+ class Allocator>
+#endif
+
+#ifdef _GLIBCXX_DEBUG
+#define PB_DS_CLASS_C_DEC \
+ left_child_next_sibling_heap_< \
+ Value_Type, \
+ Cmp_Fn, \
+ Node_Metadata, \
+ Allocator, \
+ Single_Link_Roots>
+#else
+#define PB_DS_CLASS_C_DEC \
+ left_child_next_sibling_heap_< \
+ Value_Type, \
+ Cmp_Fn, \
+ Node_Metadata, \
+ Allocator>
+#endif
+
+ /**
+ * class description = "Base class for some types of h3ap$">
+ **/
+#ifdef _GLIBCXX_DEBUG
+ template<typename Value_Type,
+ class Cmp_Fn,
+ typename Node_Metadata,
+ class Allocator,
+ bool Single_Link_Roots>
+#else
+ template<typename Value_Type,
+ class Cmp_Fn,
+ typename Node_Metadata,
+ class Allocator>
+#endif
+ class left_child_next_sibling_heap_ : public Cmp_Fn
+ {
+
+ protected:
+ typedef
+ typename Allocator::template rebind<
+ left_child_next_sibling_heap_node_<
+ Value_Type,
+ Node_Metadata,
+ Allocator> >::other
+ node_allocator;
+
+ typedef typename node_allocator::value_type node;
+
+ typedef typename node_allocator::pointer node_pointer;
+
+ typedef typename node_allocator::const_pointer const_node_pointer;
+
+ typedef Node_Metadata node_metadata;
+
+ typedef std::pair< node_pointer, node_pointer> node_pointer_pair;
+
+ private:
+ typedef cond_dealtor< node, Allocator> cond_dealtor_t;
+
+ enum
+ {
+ simple_value = is_simple<Value_Type>::value
+ };
+
+ typedef integral_constant<int, simple_value> no_throw_copies_t;
+
+ public:
+
+ typedef typename Allocator::size_type size_type;
+
+ typedef typename Allocator::difference_type difference_type;
+
+ typedef Value_Type value_type;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::pointer
+ pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::const_pointer
+ const_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::reference
+ reference;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::const_reference
+ const_reference;
+
+ typedef
+ left_child_next_sibling_heap_node_const_point_iterator_<
+ node,
+ Allocator>
+ const_point_iterator;
+
+ typedef const_point_iterator point_iterator;
+
+ typedef
+ left_child_next_sibling_heap_const_iterator_<
+ node,
+ Allocator>
+ const_iterator;
+
+ typedef const_iterator iterator;
+
+ typedef Cmp_Fn cmp_fn;
+
+ typedef Allocator allocator_type;
+
+ public:
+
+ left_child_next_sibling_heap_();
+
+ left_child_next_sibling_heap_(const Cmp_Fn& r_cmp_fn);
+
+ left_child_next_sibling_heap_(const PB_DS_CLASS_C_DEC& other);
+
+ void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ ~left_child_next_sibling_heap_();
+
+ inline bool
+ empty() const;
+
+ inline size_type
+ size() const;
+
+ inline size_type
+ max_size() const;
+
+ Cmp_Fn&
+ get_cmp_fn();
+
+ const Cmp_Fn&
+ get_cmp_fn() const;
+
+ inline iterator
+ begin();
+
+ inline const_iterator
+ begin() const;
+
+ inline iterator
+ end();
+
+ inline const_iterator
+ end() const;
+
+ void
+ clear();
+
+#ifdef PB_DS_LC_NS_HEAP_TRACE_
+ void
+ trace() const;
+#endif
+
+ protected:
+
+ inline node_pointer
+ get_new_node_for_insert(const_reference r_val);
+
+ inline static void
+ make_child_of(node_pointer p_nd, node_pointer p_new_parent);
+
+ void
+ value_swap(PB_DS_CLASS_C_DEC& other);
+
+ inline static node_pointer
+ parent(node_pointer p_nd);
+
+ inline void
+ swap_with_parent(node_pointer p_nd, node_pointer p_parent);
+
+ void
+ bubble_to_top(node_pointer p_nd);
+
+ inline void
+ actual_erase_node(node_pointer p_nd);
+
+ void
+ clear_imp(node_pointer p_nd);
+
+ void
+ to_linked_list();
+
+ template<typename Pred>
+ node_pointer
+ prune(Pred pred);
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid() const;
+
+ void
+ assert_node_consistent(const_node_pointer p_nd, bool single_link) const;
+
+ static size_type
+ size_under_node(const_node_pointer p_nd);
+
+ static size_type
+ degree(const_node_pointer p_nd);
+#endif
+
+#ifdef PB_DS_LC_NS_HEAP_TRACE_
+ static void
+ trace_node(const_node_pointer, size_type level);
+#endif
+
+ protected:
+ node_pointer m_p_root;
+
+ size_type m_size;
+
+ private:
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_iterators() const;
+
+ void
+ assert_size() const;
+
+ static size_type
+ size_from_node(const_node_pointer p_nd);
+#endif
+
+ node_pointer
+ recursive_copy_node(const_node_pointer p_nd);
+
+ inline node_pointer
+ get_new_node_for_insert(const_reference r_val, false_type);
+
+ inline node_pointer
+ get_new_node_for_insert(const_reference r_val, true_type);
+
+#ifdef PB_DS_LC_NS_HEAP_TRACE_
+ template<typename Metadata_>
+ static void
+ trace_node_metadata(const_node_pointer p_nd, type_to_type<Metadata_>);
+
+ static void
+ trace_node_metadata(const_node_pointer, type_to_type<null_left_child_next_sibling_heap_node_metadata>);
+#endif
+
+ private:
+ static node_allocator s_node_allocator;
+
+ static no_throw_copies_t s_no_throw_copies_ind;
+ };
+
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/constructors_destructor_fn_imps.hpp>
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/iterators_fn_imps.hpp>
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/debug_fn_imps.hpp>
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/trace_fn_imps.hpp>
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/insert_fn_imps.hpp>
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/erase_fn_imps.hpp>
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/info_fn_imps.hpp>
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/policy_access_fn_imps.hpp>
+
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_CLASS_T_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/node.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/node.hpp
new file mode 100644
index 0000000..1cdfe28
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/node.hpp
@@ -0,0 +1,123 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file node.hpp
+ * Contains an implementation struct for this type of heap's node.
+ */
+
+#ifndef PB_DS_LEFT_CHILD_NEXT_SIBLING_HEAP_NODE_HPP
+#define PB_DS_LEFT_CHILD_NEXT_SIBLING_HEAP_NODE_HPP
+
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/null_metadata.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+ template<typename Value_Type, typename Metadata_Type, class Allocator>
+ struct left_child_next_sibling_heap_node_
+ {
+ private:
+ typedef
+ left_child_next_sibling_heap_node_<
+ Value_Type,
+ Metadata_Type,
+ Allocator>
+ this_type;
+
+ public:
+ typedef typename Allocator::size_type size_type;
+
+ typedef
+ typename Allocator::template rebind<
+ this_type>::other::pointer
+ node_pointer;
+
+ typedef Value_Type value_type;
+
+ typedef Metadata_Type metadata_type;
+
+ public:
+ value_type m_value;
+
+ metadata_type m_metadata;
+
+ node_pointer m_p_l_child;
+
+ node_pointer m_p_next_sibling;
+
+ node_pointer m_p_prev_or_parent;
+ };
+
+ template<typename Value_Type, class Allocator>
+ struct left_child_next_sibling_heap_node_<
+ Value_Type,
+ null_left_child_next_sibling_heap_node_metadata,
+ Allocator>
+ {
+ private:
+ typedef
+ left_child_next_sibling_heap_node_<
+ Value_Type,
+ null_left_child_next_sibling_heap_node_metadata,
+ Allocator>
+ this_type;
+
+ public:
+ typedef typename Allocator::size_type size_type;
+
+ typedef
+ typename Allocator::template rebind<
+ this_type>::other::pointer
+ node_pointer;
+
+ typedef Value_Type value_type;
+
+ public:
+ value_type m_value;
+
+ node_pointer m_p_l_child;
+
+ node_pointer m_p_next_sibling;
+
+ node_pointer m_p_prev_or_parent;
+ };
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_LEFT_CHILD_NEXT_SIBLING_HEAP_NODE_HPP
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/null_metadata.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/null_metadata.hpp
new file mode 100644
index 0000000..040466e
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/null_metadata.hpp
@@ -0,0 +1,55 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file null_metadata.hpp
+ * Contains an implementation struct for this type of heap's node.
+ */
+
+#ifndef PB_DS_LEFT_CHILD_NEXT_SIBLING_HEAP_NULL_METADATA_HPP
+#define PB_DS_LEFT_CHILD_NEXT_SIBLING_HEAP_NULL_METADATA_HPP
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+ struct null_left_child_next_sibling_heap_node_metadata
+ { };
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_LEFT_CHILD_NEXT_SIBLING_HEAP_NULL_METADATA_HPP
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/policy_access_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/policy_access_fn_imps.hpp
new file mode 100644
index 0000000..350b4d0
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/policy_access_fn_imps.hpp
@@ -0,0 +1,52 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file policy_access_fn_imps.hpp
+ * Contains an implementation class for left_child_next_sibling_heap_.
+ */
+
+PB_DS_CLASS_T_DEC
+Cmp_Fn&
+PB_DS_CLASS_C_DEC::
+get_cmp_fn()
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+const Cmp_Fn&
+PB_DS_CLASS_C_DEC::
+get_cmp_fn() const
+{ return *this; }
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/trace_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/trace_fn_imps.hpp
new file mode 100644
index 0000000..2b90cfa
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/left_child_next_sibling_heap_/trace_fn_imps.hpp
@@ -0,0 +1,95 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file trace_fn_imps.hpp
+ * Contains an implementation class for left_child_next_sibling_heap_.
+ */
+
+#ifdef PB_DS_LC_NS_HEAP_TRACE_
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+trace() const
+{
+ std::cerr << std::endl;
+
+ trace_node(m_p_root, 0);
+
+ std::cerr << std::endl;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+trace_node(const_node_pointer p_nd, size_type level)
+{
+ while (p_nd != NULL)
+ {
+ for (size_type i = 0; i < level; ++i)
+ std::cerr << ' ';
+
+ std::cerr << p_nd <<
+ " prev = " << p_nd->m_p_prev_or_parent <<
+ " next " << p_nd->m_p_next_sibling <<
+ " left = " << p_nd->m_p_l_child << " ";
+
+ trace_node_metadata(p_nd, type_to_type<node_metadata>());
+
+ std::cerr << p_nd->m_value << std::endl;
+
+ trace_node(p_nd->m_p_l_child, level + 1);
+
+ p_nd = p_nd->m_p_next_sibling;
+ }
+}
+
+PB_DS_CLASS_T_DEC
+template<typename Metadata_>
+void
+PB_DS_CLASS_C_DEC::
+trace_node_metadata(const_node_pointer p_nd, type_to_type<Metadata_>)
+{
+ std::cerr << "(" << p_nd->m_metadata << ") ";
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+trace_node_metadata(const_node_pointer, type_to_type<null_left_child_next_sibling_heap_node_metadata>)
+{ }
+
+#endif // #ifdef PB_DS_LC_NS_HEAP_TRACE_
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/constructor_destructor_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/constructor_destructor_fn_imps.hpp
new file mode 100644
index 0000000..c998c3e
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/constructor_destructor_fn_imps.hpp
@@ -0,0 +1,141 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructor_destructor_fn_imps.hpp
+ * Contains implementations of PB_DS_CLASS_NAME.
+ */
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::entry_allocator
+PB_DS_CLASS_C_DEC::s_entry_allocator;
+
+PB_DS_CLASS_T_DEC
+Eq_Fn PB_DS_CLASS_C_DEC::s_eq_fn;
+
+PB_DS_CLASS_T_DEC
+null_lu_metadata PB_DS_CLASS_C_DEC::s_null_lu_metadata;
+
+PB_DS_CLASS_T_DEC
+Update_Policy PB_DS_CLASS_C_DEC::s_update_policy;
+
+PB_DS_CLASS_T_DEC
+type_to_type<
+ typename PB_DS_CLASS_C_DEC::update_metadata> PB_DS_CLASS_C_DEC::s_metadata_type_indicator;
+
+PB_DS_CLASS_T_DEC
+template<typename It>
+void
+PB_DS_CLASS_C_DEC::
+copy_from_range(It first_it, It last_it)
+{
+ while (first_it != last_it)
+ insert(*(first_it++));
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME() : m_p_l(NULL)
+{ _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+PB_DS_CLASS_T_DEC
+template<typename It>
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(It first_it, It last_it) : m_p_l(NULL)
+{
+ copy_from_range(first_it, last_it);
+ _GLIBCXX_DEBUG_ONLY(assert_valid(););
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const PB_DS_CLASS_C_DEC& other) :
+#ifdef _GLIBCXX_DEBUG
+ debug_base(),
+#endif
+m_p_l(NULL)
+{
+ __try
+ {
+ for (const_iterator it = other.begin(); it != other.end(); ++it)
+ {
+ entry_pointer p_l = allocate_new_entry(*it,
+ PB_DS_TYPES_TRAITS_C_DEC::m_no_throw_copies_indicator);
+
+ p_l->m_p_next = m_p_l;
+ m_p_l = p_l;
+ }
+ }
+ __catch(...)
+ {
+ deallocate_all();
+ __throw_exception_again;
+ }
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(debug_base::swap(other);)
+ std::swap(m_p_l, other.m_p_l);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+deallocate_all()
+{
+ entry_pointer p_l = m_p_l;
+ while (p_l != NULL)
+ {
+ entry_pointer p_next_l = p_l->m_p_next;
+ actual_erase_entry(p_l);
+ p_l = p_next_l;
+ }
+ m_p_l = NULL;
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+~PB_DS_CLASS_NAME()
+{ deallocate_all(); }
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/debug_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/debug_fn_imps.hpp
new file mode 100644
index 0000000..95e9e22
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/debug_fn_imps.hpp
@@ -0,0 +1,57 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s debug-mode functions.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_valid() const
+{
+ size_type calc_size = 0;
+ for (const_iterator it = begin(); it != end(); ++it)
+ {
+ debug_base::check_key_exists(PB_DS_V2F(*it));
+ ++calc_size;
+ }
+ debug_base::check_size(calc_size);
+}
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/entry_metadata_base.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/entry_metadata_base.hpp
new file mode 100644
index 0000000..021ef50
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/entry_metadata_base.hpp
@@ -0,0 +1,60 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file entry_metadata_base.hpp
+ * Contains an implementation for a list update map.
+ */
+
+#ifndef PB_DS_LU_MAP_ENTRY_METADATA_BASE_HPP
+#define PB_DS_LU_MAP_ENTRY_METADATA_BASE_HPP
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ template<typename Metadata>
+ struct lu_map_entry_metadata_base
+ {
+ Metadata m_update_metadata;
+ };
+
+ template<>
+ struct lu_map_entry_metadata_base<null_lu_metadata>
+ { };
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/erase_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/erase_fn_imps.hpp
new file mode 100644
index 0000000..cdc5920
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/erase_fn_imps.hpp
@@ -0,0 +1,135 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file erase_fn_imps.hpp
+ * Contains implementations of lu_map_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+erase(const_key_reference r_key)
+{
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+ if (m_p_l == NULL)
+ return false;
+
+ if (s_eq_fn(r_key, PB_DS_V2F(m_p_l->m_value)))
+ {
+ entry_pointer p_next = m_p_l->m_p_next;
+ actual_erase_entry(m_p_l);
+ m_p_l = p_next;
+ return true;
+ }
+
+ entry_pointer p_l = m_p_l;
+ while (p_l->m_p_next != NULL)
+ if (s_eq_fn(r_key, PB_DS_V2F(p_l->m_p_next->m_value)))
+ {
+ erase_next(p_l);
+ return true;
+ }
+ else
+ p_l = p_l->m_p_next;
+ return false;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+clear()
+{
+ deallocate_all();
+}
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+erase_if(Pred pred)
+{
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+ size_type num_ersd = 0;
+ while (m_p_l != NULL && pred(m_p_l->m_value))
+ {
+ entry_pointer p_next = m_p_l->m_p_next;
+ ++num_ersd;
+ actual_erase_entry(m_p_l);
+ m_p_l = p_next;
+ }
+
+ if (m_p_l == NULL)
+ return num_ersd;
+
+ entry_pointer p_l = m_p_l;
+ while (p_l->m_p_next != NULL)
+ {
+ if (pred(p_l->m_p_next->m_value))
+ {
+ ++num_ersd;
+ erase_next(p_l);
+ }
+ else
+ p_l = p_l->m_p_next;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+ return num_ersd;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+erase_next(entry_pointer p_l)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_l != NULL);
+ _GLIBCXX_DEBUG_ASSERT(p_l != m_p_l);
+ _GLIBCXX_DEBUG_ASSERT(p_l->m_p_next != NULL);
+ entry_pointer p_next_l = p_l->m_p_next->m_p_next;
+ actual_erase_entry(p_l->m_p_next);
+ p_l->m_p_next = p_next_l;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+actual_erase_entry(entry_pointer p_l)
+{
+ _GLIBCXX_DEBUG_ONLY(debug_base::erase_existing(PB_DS_V2F(p_l->m_value));)
+ p_l->~entry();
+ s_entry_allocator.deallocate(p_l, 1);
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/find_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/find_fn_imps.hpp
new file mode 100644
index 0000000..50347ac
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/find_fn_imps.hpp
@@ -0,0 +1,90 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file find_fn_imps.hpp
+ * Contains implementations of lu_map_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::entry_pointer
+PB_DS_CLASS_C_DEC::
+find_imp(const_key_reference r_key) const
+{
+ if (m_p_l == NULL)
+ return NULL;
+ if (s_eq_fn(r_key, PB_DS_V2F(m_p_l->m_value)))
+ {
+ apply_update(m_p_l, s_metadata_type_indicator);
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key);)
+ return m_p_l;
+ }
+
+ entry_pointer p_l = m_p_l;
+ while (p_l->m_p_next != NULL)
+ {
+ entry_pointer p_next = p_l->m_p_next;
+ if (s_eq_fn(r_key, PB_DS_V2F(p_next->m_value)))
+ {
+ if (apply_update(p_next, s_metadata_type_indicator))
+ {
+ p_l->m_p_next = p_next->m_p_next;
+ p_next->m_p_next = m_p_l;
+ m_p_l = p_next;
+ return m_p_l;
+ }
+ return p_next;
+ }
+ else
+ p_l = p_next;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key);)
+ return NULL;
+}
+
+PB_DS_CLASS_T_DEC
+template<typename Metadata>
+inline bool
+PB_DS_CLASS_C_DEC::
+apply_update(entry_pointer p_l, type_to_type<Metadata>)
+{ return s_update_policy(p_l->m_update_metadata); }
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+apply_update(entry_pointer, type_to_type<null_lu_metadata>)
+{ return s_update_policy(s_null_lu_metadata); }
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/info_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/info_fn_imps.hpp
new file mode 100644
index 0000000..5ad3970
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/info_fn_imps.hpp
@@ -0,0 +1,57 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file info_fn_imps.hpp
+ * Contains implementations of lu_map_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+size() const
+{ return std::distance(begin(), end()); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+max_size() const
+{ return s_entry_allocator.max_size(); }
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+empty() const
+{ return (m_p_l == NULL); }
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/insert_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/insert_fn_imps.hpp
new file mode 100644
index 0000000..5efe2a1
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/insert_fn_imps.hpp
@@ -0,0 +1,106 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file insert_fn_imps.hpp
+ * Contains implementations of lu_map_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline std::pair<
+ typename PB_DS_CLASS_C_DEC::point_iterator,
+ bool>
+PB_DS_CLASS_C_DEC::
+insert(const_reference r_val)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ entry_pointer p_l = find_imp(PB_DS_V2F(r_val));
+
+ if (p_l != NULL)
+ {
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(PB_DS_V2F(r_val));)
+ return std::make_pair(point_iterator(&p_l->m_value), false);
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(PB_DS_V2F(r_val));)
+
+ p_l = allocate_new_entry(r_val, traits_base::m_no_throw_copies_indicator);
+ p_l->m_p_next = m_p_l;
+ m_p_l = p_l;
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return std::make_pair(point_iterator(&p_l->m_value), true);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::entry_pointer
+PB_DS_CLASS_C_DEC::
+allocate_new_entry(const_reference r_val, false_type)
+{
+ entry_pointer p_l = s_entry_allocator.allocate(1);
+ cond_dealtor_t cond(p_l);
+ new (const_cast<void* >(static_cast<const void* >(&p_l->m_value)))
+ value_type(r_val);
+
+ cond.set_no_action();
+ _GLIBCXX_DEBUG_ONLY(debug_base::insert_new(PB_DS_V2F(r_val));)
+ init_entry_metadata(p_l, s_metadata_type_indicator);
+ return p_l;
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::entry_pointer
+PB_DS_CLASS_C_DEC::
+allocate_new_entry(const_reference r_val, true_type)
+{
+ entry_pointer p_l = s_entry_allocator.allocate(1);
+ new (&p_l->m_value) value_type(r_val);
+ _GLIBCXX_DEBUG_ONLY(debug_base::insert_new(PB_DS_V2F(r_val));)
+ init_entry_metadata(p_l, s_metadata_type_indicator);
+ return p_l;
+}
+
+PB_DS_CLASS_T_DEC
+template<typename Metadata>
+inline void
+PB_DS_CLASS_C_DEC::
+init_entry_metadata(entry_pointer p_l, type_to_type<Metadata>)
+{ new (&p_l->m_update_metadata) Metadata(s_update_policy()); }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+init_entry_metadata(entry_pointer, type_to_type<null_lu_metadata>)
+{ }
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/iterators_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/iterators_fn_imps.hpp
new file mode 100644
index 0000000..e3247c5
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/iterators_fn_imps.hpp
@@ -0,0 +1,80 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file iterators_fn_imps.hpp
+ * Contains implementations of lu_map_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+begin()
+{
+ if (m_p_l == NULL)
+ {
+ _GLIBCXX_DEBUG_ASSERT(empty());
+ return end();
+ }
+ return iterator(&m_p_l->m_value, m_p_l, this);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+begin() const
+{
+ if (m_p_l == NULL)
+ {
+ _GLIBCXX_DEBUG_ASSERT(empty());
+ return end();
+ }
+ return iterator(&m_p_l->m_value, m_p_l, const_cast<PB_DS_CLASS_C_DEC* >(this));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+end()
+{ return iterator(NULL, NULL, this); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+end() const
+{
+ return const_iterator(NULL, NULL, const_cast<PB_DS_CLASS_C_DEC* const>(this));
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/lu_map_.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/lu_map_.hpp
new file mode 100644
index 0000000..0e9336b
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/lu_map_.hpp
@@ -0,0 +1,359 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file lu_map_.hpp
+ * Contains a list update map.
+ */
+
+#include <utility>
+#include <iterator>
+#include <ext/pb_ds/detail/cond_dealtor.hpp>
+#include <ext/pb_ds/tag_and_trait.hpp>
+#include <ext/pb_ds/detail/types_traits.hpp>
+#include <ext/pb_ds/detail/list_update_map_/entry_metadata_base.hpp>
+#include <ext/pb_ds/exception.hpp>
+#ifdef _GLIBCXX_DEBUG
+#include <ext/pb_ds/detail/debug_map_base.hpp>
+#endif
+#ifdef PB_DS_LU_MAP_TRACE_
+#include <iostream>
+#endif
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, typename Mapped, class Eq_Fn, \
+ class Allocator, class Update_Policy>
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_CLASS_NAME lu_map_data_
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#define PB_DS_CLASS_NAME lu_map_no_data_
+#endif
+
+#define PB_DS_CLASS_C_DEC \
+ PB_DS_CLASS_NAME<Key, Mapped, Eq_Fn, Allocator, Update_Policy>
+
+#define PB_DS_TYPES_TRAITS_C_DEC \
+ types_traits<Key, Mapped, Allocator, false>
+
+#ifdef _GLIBCXX_DEBUG
+#define PB_DS_DEBUG_MAP_BASE_C_DEC \
+ debug_map_base<Key, Eq_Fn, \
+ typename Allocator::template rebind<Key>::other::const_reference>
+#endif
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_V2F(X) (X).first
+#define PB_DS_V2S(X) (X).second
+#define PB_DS_EP2VP(X)& ((X)->m_value)
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#define PB_DS_V2F(X) (X)
+#define PB_DS_V2S(X) Mapped_Data()
+#define PB_DS_EP2VP(X)& ((X)->m_value.first)
+#endif
+
+ /* Skip to the lu, my darling. */
+ // list-based (with updates) associative container.
+ template<typename Key,
+ typename Mapped,
+ class Eq_Fn,
+ class Allocator,
+ class Update_Policy>
+ class PB_DS_CLASS_NAME :
+#ifdef _GLIBCXX_DEBUG
+ protected PB_DS_DEBUG_MAP_BASE_C_DEC,
+#endif
+ public PB_DS_TYPES_TRAITS_C_DEC
+ {
+ private:
+ typedef PB_DS_TYPES_TRAITS_C_DEC traits_base;
+
+ struct entry
+ : public lu_map_entry_metadata_base<typename Update_Policy::metadata_type>
+ {
+ typename traits_base::value_type m_value;
+ typename Allocator::template rebind<entry>::other::pointer m_p_next;
+ };
+
+ typedef typename Allocator::template rebind<entry>::other entry_allocator;
+ typedef typename entry_allocator::pointer entry_pointer;
+ typedef typename entry_allocator::const_pointer const_entry_pointer;
+ typedef typename entry_allocator::reference entry_reference;
+ typedef typename entry_allocator::const_reference const_entry_reference;
+
+ typedef typename Allocator::template rebind<entry_pointer>::other entry_pointer_allocator;
+ typedef typename entry_pointer_allocator::pointer entry_pointer_array;
+
+ typedef typename traits_base::value_type value_type_;
+ typedef typename traits_base::pointer pointer_;
+ typedef typename traits_base::const_pointer const_pointer_;
+ typedef typename traits_base::reference reference_;
+ typedef typename traits_base::const_reference const_reference_;
+
+#define PB_DS_GEN_POS entry_pointer
+
+#include <ext/pb_ds/detail/unordered_iterator/const_point_iterator.hpp>
+#include <ext/pb_ds/detail/unordered_iterator/point_iterator.hpp>
+#include <ext/pb_ds/detail/unordered_iterator/const_iterator.hpp>
+#include <ext/pb_ds/detail/unordered_iterator/iterator.hpp>
+
+#undef PB_DS_GEN_POS
+
+
+#ifdef _GLIBCXX_DEBUG
+ typedef PB_DS_DEBUG_MAP_BASE_C_DEC debug_base;
+#endif
+
+ typedef cond_dealtor<entry, Allocator> cond_dealtor_t;
+
+ public:
+ typedef Allocator allocator_type;
+ typedef typename Allocator::size_type size_type;
+ typedef typename Allocator::difference_type difference_type;
+ typedef Eq_Fn eq_fn;
+ typedef Update_Policy update_policy;
+ typedef typename Update_Policy::metadata_type update_metadata;
+ typedef typename traits_base::key_type key_type;
+ typedef typename traits_base::key_pointer key_pointer;
+ typedef typename traits_base::const_key_pointer const_key_pointer;
+ typedef typename traits_base::key_reference key_reference;
+ typedef typename traits_base::const_key_reference const_key_reference;
+ typedef typename traits_base::mapped_type mapped_type;
+ typedef typename traits_base::mapped_pointer mapped_pointer;
+ typedef typename traits_base::const_mapped_pointer const_mapped_pointer;
+ typedef typename traits_base::mapped_reference mapped_reference;
+ typedef typename traits_base::const_mapped_reference const_mapped_reference;
+ typedef typename traits_base::value_type value_type;
+ typedef typename traits_base::pointer pointer;
+ typedef typename traits_base::const_pointer const_pointer;
+ typedef typename traits_base::reference reference;
+ typedef typename traits_base::const_reference const_reference;
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ typedef point_iterator_ point_iterator;
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+ typedef const_point_iterator_ point_iterator;
+#endif
+
+ typedef const_point_iterator_ const_point_iterator;
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ typedef iterator_ iterator;
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+ typedef const_iterator_ iterator;
+#endif
+
+ typedef const_iterator_ const_iterator;
+
+ public:
+ PB_DS_CLASS_NAME();
+
+ PB_DS_CLASS_NAME(const PB_DS_CLASS_C_DEC&);
+
+ virtual
+ ~PB_DS_CLASS_NAME();
+
+ template<typename It>
+ PB_DS_CLASS_NAME(It first_it, It last_it);
+
+ void
+ swap(PB_DS_CLASS_C_DEC&);
+
+ inline size_type
+ size() const;
+
+ inline size_type
+ max_size() const;
+
+ inline bool
+ empty() const;
+
+ inline mapped_reference
+ operator[](const_key_reference r_key)
+ {
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return insert(std::make_pair(r_key, mapped_type())).first->second;
+#else
+ insert(r_key);
+ return traits_base::s_null_mapped;
+#endif
+ }
+
+ inline std::pair<point_iterator, bool>
+ insert(const_reference);
+
+ inline point_iterator
+ find(const_key_reference r_key)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ entry_pointer p_e = find_imp(r_key);
+ return point_iterator(p_e == NULL ? NULL: &p_e->m_value);
+ }
+
+ inline const_point_iterator
+ find(const_key_reference r_key) const
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ entry_pointer p_e = find_imp(r_key);
+ return const_point_iterator(p_e == NULL ? NULL: &p_e->m_value);
+ }
+
+ inline bool
+ erase(const_key_reference);
+
+ template<typename Pred>
+ inline size_type
+ erase_if(Pred);
+
+ void
+ clear();
+
+ inline iterator
+ begin();
+
+ inline const_iterator
+ begin() const;
+
+ inline iterator
+ end();
+
+ inline const_iterator
+ end() const;
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid() const;
+#endif
+
+#ifdef PB_DS_LU_MAP_TRACE_
+ void
+ trace() const;
+#endif
+
+ protected:
+
+ template<typename It>
+ void
+ copy_from_range(It, It);
+
+ private:
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ friend class iterator_;
+#endif
+
+ friend class const_iterator_;
+
+ inline entry_pointer
+ allocate_new_entry(const_reference, false_type);
+
+ inline entry_pointer
+ allocate_new_entry(const_reference, true_type);
+
+ template<typename Metadata>
+ inline static void
+ init_entry_metadata(entry_pointer, type_to_type<Metadata>);
+
+ inline static void
+ init_entry_metadata(entry_pointer, type_to_type<null_lu_metadata>);
+
+ void
+ deallocate_all();
+
+ void
+ erase_next(entry_pointer);
+
+ void
+ actual_erase_entry(entry_pointer);
+
+ void
+ inc_it_state(const_pointer& r_p_value, entry_pointer& r_pos) const
+ {
+ r_pos = r_pos->m_p_next;
+ r_p_value = (r_pos == NULL) ? NULL : &r_pos->m_value;
+ }
+
+ template<typename Metadata>
+ inline static bool
+ apply_update(entry_pointer, type_to_type<Metadata>);
+
+ inline static bool
+ apply_update(entry_pointer, type_to_type<null_lu_metadata>);
+
+ inline entry_pointer
+ find_imp(const_key_reference) const;
+
+ static entry_allocator s_entry_allocator;
+ static Eq_Fn s_eq_fn;
+ static Update_Policy s_update_policy;
+ static type_to_type<update_metadata> s_metadata_type_indicator;
+ static null_lu_metadata s_null_lu_metadata;
+
+ mutable entry_pointer m_p_l;
+ };
+
+#include <ext/pb_ds/detail/list_update_map_/constructor_destructor_fn_imps.hpp>
+#include <ext/pb_ds/detail/list_update_map_/info_fn_imps.hpp>
+#include <ext/pb_ds/detail/list_update_map_/debug_fn_imps.hpp>
+#include <ext/pb_ds/detail/list_update_map_/iterators_fn_imps.hpp>
+#include <ext/pb_ds/detail/list_update_map_/erase_fn_imps.hpp>
+#include <ext/pb_ds/detail/list_update_map_/find_fn_imps.hpp>
+#include <ext/pb_ds/detail/list_update_map_/insert_fn_imps.hpp>
+#include <ext/pb_ds/detail/list_update_map_/trace_fn_imps.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_TYPES_TRAITS_C_DEC
+#undef PB_DS_DEBUG_MAP_BASE_C_DEC
+#undef PB_DS_CLASS_NAME
+#undef PB_DS_V2F
+#undef PB_DS_EP2VP
+#undef PB_DS_V2S
+
+ } // namespace detail
+} // namespace __gnu_pbds
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/trace_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/trace_fn_imps.hpp
new file mode 100644
index 0000000..908aacc
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_map_/trace_fn_imps.hpp
@@ -0,0 +1,59 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file trace_fn_imps.hpp
+ * Contains implementations of lu_map_.
+ */
+
+#ifdef PB_DS_LU_MAP_TRACE_
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+trace() const
+{
+ std::cerr << m_p_l << std::endl << std::endl;
+ const_entry_pointer p_l = m_p_l;
+ while (p_l != NULL)
+ {
+ std::cerr << PB_DS_V2F(p_l->m_value) << std::endl;
+ p_l = p_l->m_p_next;
+ }
+ std::cerr << std::endl;
+}
+
+#endif
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_policy/counter_lu_metadata.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_policy/counter_lu_metadata.hpp
new file mode 100644
index 0000000..4ef7fe4
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_policy/counter_lu_metadata.hpp
@@ -0,0 +1,86 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file counter_lu_metadata.hpp
+ * Contains implementation of a lu counter policy's metadata.
+ */
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ template<typename Size_Type>
+ class counter_lu_policy_base;
+
+ // A list-update metadata type that moves elements to the front of
+ // the list based on the counter algorithm.
+ template<typename Size_Type = size_t>
+ class counter_lu_metadata
+ {
+ public:
+ typedef Size_Type size_type;
+
+ private:
+ counter_lu_metadata(size_type init_count) : m_count(init_count)
+ { }
+
+ friend class counter_lu_policy_base<size_type>;
+
+ mutable size_type m_count;
+ };
+
+ template<typename Size_Type>
+ class counter_lu_policy_base
+ {
+ protected:
+ typedef Size_Type size_type;
+
+ counter_lu_metadata<size_type>
+ operator()(size_type max_size) const
+ { return counter_lu_metadata<Size_Type>(std::rand() % max_size); }
+
+ template<typename Metadata_Reference>
+ bool
+ operator()(Metadata_Reference r_data, size_type m_max_count) const
+ {
+ if (++r_data.m_count != m_max_count)
+ return false;
+ r_data.m_count = 0;
+ return true;
+ }
+ };
+ } // namespace detail
+} // namespace __gnu_pbds
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_policy/counter_lu_policy_imp.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_policy/counter_lu_policy_imp.hpp
new file mode 100644
index 0000000..f74a9fb
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_policy/counter_lu_policy_imp.hpp
@@ -0,0 +1,51 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file counter_lu_policy_imp.hpp
+ * Contains a lu counter policy implementation.
+ */
+
+PB_DS_CLASS_T_DEC
+detail::counter_lu_metadata<typename Allocator::size_type>
+PB_DS_CLASS_C_DEC::
+operator()() const
+{ return (base_type::operator()(max_count)); }
+
+PB_DS_CLASS_T_DEC
+bool
+PB_DS_CLASS_C_DEC::
+operator()(metadata_reference r_data) const
+{ return (base_type::operator()(r_data, max_count)); }
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_policy/mtf_lu_policy_imp.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_policy/mtf_lu_policy_imp.hpp
new file mode 100644
index 0000000..34426c5
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_policy/mtf_lu_policy_imp.hpp
@@ -0,0 +1,55 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file mtf_lu_policy_imp.hpp
+ * Contains a move-to-front policy implementation.
+ */
+
+PB_DS_CLASS_T_DEC
+null_lu_metadata PB_DS_CLASS_C_DEC::s_metadata;
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::metadata_type
+PB_DS_CLASS_C_DEC::
+operator()() const
+{ return s_metadata; }
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+operator()(metadata_reference /*r_data*/) const
+{ return true; }
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_policy/sample_update_policy.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_policy/sample_update_policy.hpp
new file mode 100644
index 0000000..c5da1e9
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/list_update_policy/sample_update_policy.hpp
@@ -0,0 +1,74 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file sample_update_policy.hpp
+ * Contains a sample policy for list update containers.
+ */
+
+#ifndef PB_DS_SAMPLE_UPDATE_POLICY_HPP
+#define PB_DS_SAMPLE_UPDATE_POLICY_HPP
+
+// A sample list-update policy.
+struct sample_update_policy
+{
+ // Default constructor.
+ sample_update_policy();
+
+ // Copy constructor.
+ sample_update_policy(const sample_update_policy&);
+
+ // Swaps content.
+ inline void
+ swap(sample_update_policy& other);
+
+protected:
+ // Metadata on which this functor operates.
+ typedef some_metadata_type metadata_type;
+
+ // Creates a metadata object.
+ metadata_type
+ operator()() const;
+
+ // Decides whether a metadata object should be moved to the front of
+ // the list. A list-update based containers object will call this
+ // method to decide whether to move a node to the front of the
+ // list. The method shoule return true if the node should be moved
+ // to the front of the list.
+ bool
+ operator()(metadata_reference) const;
+};
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/cond_dtor.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/cond_dtor.hpp
new file mode 100644
index 0000000..e2c4b9a
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/cond_dtor.hpp
@@ -0,0 +1,74 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file cond_dtor.hpp
+ * Contains a conditional destructor
+ */
+
+template<typename Size_Type>
+class cond_dtor
+{
+public:
+ cond_dtor(value_vector a_vec, iterator& r_last_it, Size_Type total_size)
+ : m_a_vec(a_vec), m_r_last_it(r_last_it), m_max_size(total_size),
+ m_no_action(false)
+ { }
+
+ ~cond_dtor()
+ {
+ if (m_no_action)
+ return;
+ iterator it = m_a_vec;
+ while (it != m_r_last_it)
+ {
+ it->~value_type();
+ ++it;
+ }
+
+ if (m_max_size > 0)
+ value_allocator().deallocate(m_a_vec, m_max_size);
+ }
+
+ inline void
+ set_no_action()
+ { m_no_action = true; }
+
+protected:
+ value_vector m_a_vec;
+ iterator& m_r_last_it;
+ const Size_Type m_max_size;
+ bool m_no_action;
+};
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/constructors_destructor_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/constructors_destructor_fn_imps.hpp
new file mode 100644
index 0000000..545b981
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/constructors_destructor_fn_imps.hpp
@@ -0,0 +1,273 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructors_destructor_fn_imps.hpp
+ * Contains an implementation class for ov_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::value_allocator
+PB_DS_CLASS_C_DEC::s_value_alloc;
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::metadata_allocator
+PB_DS_CLASS_C_DEC::s_metadata_alloc;
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_OV_TREE_CLASS_NAME() :
+ m_a_values(NULL),
+ m_a_metadata(NULL),
+ m_end_it(NULL),
+ m_size(0)
+{ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();) }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_OV_TREE_CLASS_NAME(const Cmp_Fn& r_cmp_fn) :
+ cmp_fn_base(r_cmp_fn),
+ m_a_values(NULL),
+ m_a_metadata(NULL),
+ m_end_it(NULL),
+ m_size(0)
+{ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();) }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_OV_TREE_CLASS_NAME(const Cmp_Fn& r_cmp_fn, const node_update& r_node_update) :
+ cmp_fn_base(r_cmp_fn),
+ node_update(r_node_update),
+ m_a_values(NULL),
+ m_a_metadata(NULL),
+ m_end_it(NULL),
+ m_size(0)
+{ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();) }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_OV_TREE_CLASS_NAME(const PB_DS_CLASS_C_DEC& other) :
+#ifdef _GLIBCXX_DEBUG
+ debug_base(other),
+#endif
+#ifdef PB_DS_TREE_TRACE
+ PB_DS_TREE_TRACE_BASE_C_DEC(other),
+#endif
+ cmp_fn_base(other),
+ node_update(other),
+ m_a_values(NULL),
+ m_a_metadata(NULL),
+ m_end_it(NULL),
+ m_size(0)
+{
+ copy_from_ordered_range(other.begin(), other.end());
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+template<typename It>
+inline void
+PB_DS_CLASS_C_DEC::
+copy_from_range(It first_it, It last_it)
+{
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ typedef
+ std::map<
+ key_type,
+ mapped_type,
+ Cmp_Fn,
+ typename Allocator::template rebind<
+ value_type>::other>
+ map_type;
+#else
+ typedef
+ std::set<
+ key_type,
+ Cmp_Fn,
+ typename Allocator::template rebind<
+ Key>::other>
+ map_type;
+#endif
+
+ map_type m(first_it, last_it);
+ copy_from_ordered_range(m.begin(), m.end());
+}
+
+PB_DS_CLASS_T_DEC
+template<typename It>
+void
+PB_DS_CLASS_C_DEC::
+copy_from_ordered_range(It first_it, It last_it)
+{
+ const size_type len = std::distance(first_it, last_it);
+ if (len == 0)
+ return;
+
+ value_vector a_values = s_value_alloc.allocate(len);
+ iterator target_it = a_values;
+ It source_it = first_it;
+ It source_end_it = last_it;
+
+ cond_dtor<size_type> cd(a_values, target_it, len);
+ while (source_it != source_end_it)
+ {
+ new (const_cast<void* >(static_cast<const void* >(target_it)))
+ value_type(*source_it++);
+
+ ++target_it;
+ }
+
+ reallocate_metadata((node_update* )this, len);
+ cd.set_no_action();
+ m_a_values = a_values;
+ m_size = len;
+ m_end_it = m_a_values + m_size;
+ update(PB_DS_node_begin_imp(), (node_update* )this);
+
+#ifdef _GLIBCXX_DEBUG
+ const_iterator dbg_it = m_a_values;
+ while (dbg_it != m_end_it)
+ {
+ debug_base::insert_new(PB_DS_V2F(*dbg_it));
+ dbg_it++;
+ }
+ PB_DS_CLASS_C_DEC::assert_valid();
+#endif
+}
+
+PB_DS_CLASS_T_DEC
+template<typename It>
+void
+PB_DS_CLASS_C_DEC::
+copy_from_ordered_range(It first_it, It last_it, It other_first_it,
+ It other_last_it)
+{
+ clear();
+ const size_type len = std::distance(first_it, last_it)
+ + std::distance(other_first_it, other_last_it);
+
+ value_vector a_values = s_value_alloc.allocate(len);
+
+ iterator target_it = a_values;
+ It source_it = first_it;
+ It source_end_it = last_it;
+
+ cond_dtor<size_type> cd(a_values, target_it, len);
+ while (source_it != source_end_it)
+ {
+ new (const_cast<void* >(static_cast<const void* >(target_it)))
+ value_type(*source_it++);
+ ++target_it;
+ }
+
+ source_it = other_first_it;
+ source_end_it = other_last_it;
+
+ while (source_it != source_end_it)
+ {
+ new (const_cast<void* >(static_cast<const void* >(target_it)))
+ value_type(*source_it++);
+ ++target_it;
+ }
+
+ reallocate_metadata((node_update* )this, len);
+ cd.set_no_action();
+ m_a_values = a_values;
+ m_size = len;
+ m_end_it = m_a_values + m_size;
+ update(PB_DS_node_begin_imp(), (node_update* )this);
+
+#ifdef _GLIBCXX_DEBUG
+ const_iterator dbg_it = m_a_values;
+ while (dbg_it != m_end_it)
+ {
+ debug_base::insert_new(PB_DS_V2F(*dbg_it));
+ dbg_it++;
+ }
+ PB_DS_CLASS_C_DEC::assert_valid();
+#endif
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ value_swap(other);
+ std::swap((Cmp_Fn& )(*this), (Cmp_Fn& )other);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+value_swap(PB_DS_CLASS_C_DEC& other)
+{
+ std::swap(m_a_values, other.m_a_values);
+ std::swap(m_a_metadata, other.m_a_metadata);
+ std::swap(m_size, other.m_size);
+ std::swap(m_end_it, other.m_end_it);
+ _GLIBCXX_DEBUG_ONLY(debug_base::swap(other);)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+~PB_DS_OV_TREE_CLASS_NAME()
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ cond_dtor<size_type> cd(m_a_values, m_end_it, m_size);
+ reallocate_metadata((node_update* )this, 0);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+update(node_iterator /*it*/, null_node_update_pointer)
+{ }
+
+PB_DS_CLASS_T_DEC
+template<typename Node_Update>
+void
+PB_DS_CLASS_C_DEC::
+update(node_iterator nd_it, Node_Update* p_update)
+{
+ const_node_iterator end_it = PB_DS_node_end_imp();
+ if (nd_it == end_it)
+ return;
+ update(nd_it.get_l_child(), p_update);
+ update(nd_it.get_r_child(), p_update);
+ node_update::operator()(nd_it, end_it);
+}
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/debug_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/debug_fn_imps.hpp
new file mode 100644
index 0000000..c32a8af
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/debug_fn_imps.hpp
@@ -0,0 +1,84 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_fn_imps.hpp
+ * Contains an implementation class for ov_tree_.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_valid() const
+{
+ std::cout << "av1" << std::endl;
+
+ if (m_a_values == NULL || m_end_it == NULL || m_size == 0)
+ _GLIBCXX_DEBUG_ASSERT(m_a_values == NULL && m_end_it == NULL && m_size == 0);
+
+ std::cout << "av2" << std::endl;
+ assert_iterators();
+ std::cout << "av3" << std::endl;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_iterators() const
+{
+ debug_base::check_size(m_size);
+ size_type iterated_num = 0;
+ const_iterator prev_it = end();
+ _GLIBCXX_DEBUG_ASSERT( m_end_it == m_a_values + m_size);
+ for (const_iterator it = begin(); it != end(); ++it)
+ {
+ ++iterated_num;
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(PB_DS_V2F(*it));)
+ _GLIBCXX_DEBUG_ASSERT(lower_bound(PB_DS_V2F(*it)) == it);
+ const_iterator upper_bound_it = upper_bound(PB_DS_V2F(*it));
+ --upper_bound_it;
+ _GLIBCXX_DEBUG_ASSERT(upper_bound_it == it);
+ if (prev_it != end())
+ _GLIBCXX_DEBUG_ASSERT(Cmp_Fn::operator()(PB_DS_V2F(*prev_it),
+ PB_DS_V2F(*it)));
+ prev_it = it;
+ }
+ _GLIBCXX_DEBUG_ASSERT(iterated_num == m_size);
+}
+
+#endif
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/erase_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/erase_fn_imps.hpp
new file mode 100644
index 0000000..618306d
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/erase_fn_imps.hpp
@@ -0,0 +1,193 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file erase_fn_imps.hpp
+ * Contains an implementation class for ov_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+clear()
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ if (m_size == 0)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return;
+ }
+ else
+ {
+ reallocate_metadata((node_update* )this, 0);
+ cond_dtor<size_type> cd(m_a_values, m_end_it, m_size);
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::clear();)
+ m_a_values = NULL;
+ m_size = 0;
+ m_end_it = m_a_values;
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+erase_if(Pred pred)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+#ifdef PB_DS_REGRESSION
+ typename Allocator::group_throw_prob_adjustor adjust(m_size);
+#endif
+
+ size_type new_size = 0;
+ size_type num_val_ersd = 0;
+ iterator source_it = m_a_values;
+ for (source_it = begin(); source_it != m_end_it; ++source_it)
+ if (!pred(*source_it))
+ ++new_size;
+ else
+ ++num_val_ersd;
+
+ if (new_size == 0)
+ {
+ clear();
+ return num_val_ersd;
+ }
+
+ value_vector a_new_values = s_value_alloc.allocate(new_size);
+ iterator target_it = a_new_values;
+ cond_dtor<size_type> cd(a_new_values, target_it, new_size);
+ _GLIBCXX_DEBUG_ONLY(debug_base::clear());
+ for (source_it = begin(); source_it != m_end_it; ++source_it)
+ {
+ if (!pred(*source_it))
+ {
+ new (const_cast<void*>(static_cast<const void* >(target_it)))
+ value_type(*source_it);
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::insert_new(PB_DS_V2F(*source_it)));
+ ++target_it;
+ }
+ }
+
+ reallocate_metadata((node_update* )this, new_size);
+ cd.set_no_action();
+
+ {
+ cond_dtor<size_type> cd1(m_a_values, m_end_it, m_size);
+ }
+
+ m_a_values = a_new_values;
+ m_size = new_size;
+ m_end_it = target_it;
+ update(node_begin(), (node_update* )this);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return num_val_ersd;
+}
+
+PB_DS_CLASS_T_DEC
+template<typename It>
+It
+PB_DS_CLASS_C_DEC::
+erase_imp(It it)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ if (it == end())
+ return end();
+
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::check_key_exists(PB_DS_V2F(*it));)
+
+#ifdef PB_DS_REGRESSION
+ typename Allocator::group_throw_prob_adjustor adjust(m_size);
+#endif
+
+ _GLIBCXX_DEBUG_ASSERT(m_size > 0);
+ value_vector a_values = s_value_alloc.allocate(m_size - 1);
+ iterator source_it = begin();
+ iterator source_end_it = end();
+ iterator target_it = a_values;
+ iterator ret_it = end();
+
+ cond_dtor<size_type> cd(a_values, target_it, m_size - 1);
+
+ _GLIBCXX_DEBUG_ONLY(size_type cnt = 0;)
+
+ while (source_it != source_end_it)
+ {
+ if (source_it != it)
+ {
+ _GLIBCXX_DEBUG_ONLY(++cnt;)
+ _GLIBCXX_DEBUG_ASSERT(cnt != m_size);
+ new (const_cast<void* >(static_cast<const void* >(target_it)))
+ value_type(*source_it);
+
+ ++target_it;
+ }
+ else
+ ret_it = target_it;
+ ++source_it;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(m_size > 0);
+ reallocate_metadata((node_update* )this, m_size - 1);
+ cd.set_no_action();
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::erase_existing(PB_DS_V2F(*it));)
+ {
+ cond_dtor<size_type> cd1(m_a_values, m_end_it, m_size);
+ }
+
+ m_a_values = a_values;
+ --m_size;
+ m_end_it = m_a_values + m_size;
+ update(node_begin(), (node_update* )this);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return It(ret_it);
+}
+
+PB_DS_CLASS_T_DEC
+bool
+PB_DS_CLASS_C_DEC::
+erase(const_key_reference r_key)
+{
+ point_iterator it = find(r_key);
+ if (it == end())
+ return false;
+ erase(it);
+ return true;
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/info_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/info_fn_imps.hpp
new file mode 100644
index 0000000..c9421af
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/info_fn_imps.hpp
@@ -0,0 +1,60 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file info_fn_imps.hpp
+ * Contains an implementation class for ov_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+size() const
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return m_size;
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+max_size() const
+{ return s_value_alloc.max_size(); }
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+empty() const
+{ return size() == 0; }
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/insert_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/insert_fn_imps.hpp
new file mode 100644
index 0000000..91d277b
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/insert_fn_imps.hpp
@@ -0,0 +1,63 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file insert_fn_imps.hpp
+ * Contains an implementation class for ov_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+reallocate_metadata(null_node_update_pointer, size_type)
+{ }
+
+PB_DS_CLASS_T_DEC
+template<typename Node_Update_>
+void
+PB_DS_CLASS_C_DEC::
+reallocate_metadata(Node_Update_* , size_type new_size)
+{
+ metadata_pointer a_new_metadata_vec =(new_size == 0) ? NULL : s_metadata_alloc.allocate(new_size);
+
+ if (m_a_metadata != NULL)
+ {
+ for (size_type i = 0; i < m_size; ++i)
+ m_a_metadata[i].~metadata_type();
+ s_metadata_alloc.deallocate(m_a_metadata, m_size);
+ }
+ std::swap(m_a_metadata, a_new_metadata_vec);
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/iterators_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/iterators_fn_imps.hpp
new file mode 100644
index 0000000..7652c4c
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/iterators_fn_imps.hpp
@@ -0,0 +1,103 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file iterators_fn_imps.hpp
+ * Contains an implementation class for ov_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_node_iterator
+PB_DS_CLASS_C_DEC::
+node_begin() const
+{ return PB_DS_node_begin_imp(); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_node_iterator
+PB_DS_CLASS_C_DEC::
+node_end() const
+{ return PB_DS_node_end_imp(); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_iterator
+PB_DS_CLASS_C_DEC::
+node_begin()
+{ return PB_DS_node_begin_imp(); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_iterator
+PB_DS_CLASS_C_DEC::
+node_end()
+{ return PB_DS_node_end_imp(); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_node_iterator
+PB_DS_CLASS_C_DEC::
+PB_DS_node_begin_imp() const
+{
+ return const_node_iterator(const_cast<pointer>(mid_pointer(begin(), end())),
+ const_cast<pointer>(begin()),
+ const_cast<pointer>(end()),(m_a_metadata == NULL)?
+ NULL :
+ mid_pointer(m_a_metadata, m_a_metadata + m_size));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_node_iterator
+PB_DS_CLASS_C_DEC::
+PB_DS_node_end_imp() const
+{
+ return const_node_iterator(end(), end(), end(),
+ (m_a_metadata == NULL) ? NULL : m_a_metadata + m_size);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_iterator
+PB_DS_CLASS_C_DEC::
+PB_DS_node_begin_imp()
+{
+ return node_iterator(mid_pointer(begin(), end()), begin(), end(),
+ (m_a_metadata == NULL) ? NULL : mid_pointer(m_a_metadata, m_a_metadata + m_size));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_iterator
+PB_DS_CLASS_C_DEC::
+PB_DS_node_end_imp()
+{
+ return node_iterator(end(), end(),
+ end(),(m_a_metadata == NULL) ? NULL : m_a_metadata + m_size);
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/node_iterators.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/node_iterators.hpp
new file mode 100644
index 0000000..68fedc0
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/node_iterators.hpp
@@ -0,0 +1,292 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file node_iterators.hpp
+ * Contains an implementation class for ov_tree_.
+ */
+
+#ifndef PB_DS_OV_TREE_NODE_ITERATORS_HPP
+#define PB_DS_OV_TREE_NODE_ITERATORS_HPP
+
+#include <ext/pb_ds/tag_and_trait.hpp>
+#include <ext/pb_ds/detail/type_utils.hpp>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_OV_TREE_CONST_NODE_ITERATOR_C_DEC \
+ ov_tree_node_const_it_<Value_Type, Metadata_Type, Allocator>
+
+ // Const node reference.
+ template<typename Value_Type, typename Metadata_Type, class Allocator>
+ class ov_tree_node_const_it_
+ {
+
+ protected:
+ typedef
+ typename Allocator::template rebind<
+ Value_Type>::other::pointer
+ pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ Value_Type>::other::const_pointer
+ const_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ Metadata_Type>::other::const_pointer
+ const_metadata_pointer;
+
+ typedef PB_DS_OV_TREE_CONST_NODE_ITERATOR_C_DEC this_type;
+
+ protected:
+
+ template<typename Ptr>
+ inline static Ptr
+ mid_pointer(Ptr p_begin, Ptr p_end)
+ {
+ _GLIBCXX_DEBUG_ASSERT(p_end >= p_begin);
+ return (p_begin + (p_end - p_begin) / 2);
+ }
+
+ public:
+
+ typedef trivial_iterator_tag iterator_category;
+
+ typedef trivial_iterator_difference_type difference_type;
+
+ typedef
+ typename Allocator::template rebind<
+ Value_Type>::other::const_pointer
+ value_type;
+
+ typedef
+ typename Allocator::template rebind<
+ typename remove_const<
+ Value_Type>::type>::other::const_pointer
+ reference;
+
+ typedef
+ typename Allocator::template rebind<
+ typename remove_const<
+ Value_Type>::type>::other::const_pointer
+ const_reference;
+
+ typedef Metadata_Type metadata_type;
+
+ typedef
+ typename Allocator::template rebind<
+ metadata_type>::other::const_reference
+ const_metadata_reference;
+
+ public:
+ inline
+ ov_tree_node_const_it_(const_pointer p_nd = NULL, const_pointer p_begin_nd = NULL, const_pointer p_end_nd = NULL, const_metadata_pointer p_metadata = NULL) : m_p_value(const_cast<pointer>(p_nd)), m_p_begin_value(const_cast<pointer>(p_begin_nd)), m_p_end_value(const_cast<pointer>(p_end_nd)), m_p_metadata(p_metadata)
+ { }
+
+ inline const_reference
+ operator*() const
+ { return m_p_value; }
+
+ inline const_metadata_reference
+ get_metadata() const
+ {
+ enum
+ {
+ has_metadata = !is_same<Metadata_Type, null_node_metadata>::value
+ };
+
+ PB_DS_STATIC_ASSERT(should_have_metadata, has_metadata);
+ _GLIBCXX_DEBUG_ASSERT(m_p_metadata != NULL);
+ return *m_p_metadata;
+ }
+
+ inline this_type
+ get_l_child() const
+ {
+ if (m_p_begin_value == m_p_value)
+ return (this_type(m_p_begin_value, m_p_begin_value, m_p_begin_value));
+
+ const_metadata_pointer p_begin_metadata =
+ m_p_metadata - (m_p_value - m_p_begin_value);
+
+ return (this_type(mid_pointer(m_p_begin_value, m_p_value),
+ m_p_begin_value,
+ m_p_value,
+ mid_pointer(p_begin_metadata, m_p_metadata)));
+ }
+
+ inline this_type
+ get_r_child() const
+ {
+ if (m_p_value == m_p_end_value)
+ return (this_type(m_p_end_value, m_p_end_value, m_p_end_value));
+
+ const_metadata_pointer p_end_metadata =
+ m_p_metadata + (m_p_end_value - m_p_value);
+
+ return (this_type(mid_pointer(m_p_value + 1, m_p_end_value),
+ m_p_value + 1,
+ m_p_end_value,(m_p_metadata == NULL) ?
+ NULL : mid_pointer(m_p_metadata + 1, p_end_metadata)));
+ }
+
+ inline bool
+ operator==(const this_type& other) const
+ {
+ const bool is_end = m_p_begin_value == m_p_end_value;
+ const bool is_other_end = other.m_p_begin_value == other.m_p_end_value;
+
+ if (is_end)
+ return (is_other_end);
+
+ if (is_other_end)
+ return (is_end);
+
+ return m_p_value == other.m_p_value;
+ }
+
+ inline bool
+ operator!=(const this_type& other) const
+ { return !operator==(other); }
+
+ public:
+ pointer m_p_value;
+ pointer m_p_begin_value;
+ pointer m_p_end_value;
+
+ const_metadata_pointer m_p_metadata;
+ };
+
+#define PB_DS_OV_TREE_NODE_ITERATOR_C_DEC \
+ ov_tree_node_it_<Value_Type, Metadata_Type, Allocator>
+
+ // Node reference.
+ template<typename Value_Type, typename Metadata_Type, class Allocator>
+ class ov_tree_node_it_ : public PB_DS_OV_TREE_CONST_NODE_ITERATOR_C_DEC
+ {
+
+ private:
+ typedef PB_DS_OV_TREE_NODE_ITERATOR_C_DEC this_type;
+
+ typedef PB_DS_OV_TREE_CONST_NODE_ITERATOR_C_DEC base_type;
+
+ typedef typename base_type::pointer pointer;
+
+ typedef typename base_type::const_pointer const_pointer;
+
+ typedef
+ typename base_type::const_metadata_pointer
+ const_metadata_pointer;
+
+ public:
+
+ typedef trivial_iterator_tag iterator_category;
+
+ typedef trivial_iterator_difference_type difference_type;
+
+ typedef
+ typename Allocator::template rebind<
+ Value_Type>::other::pointer
+ value_type;
+
+ typedef
+ typename Allocator::template rebind<
+ typename remove_const<
+ Value_Type>::type>::other::pointer
+ reference;
+
+ typedef
+ typename Allocator::template rebind<
+ typename remove_const<
+ Value_Type>::type>::other::pointer
+ const_reference;
+
+ public:
+ inline
+ ov_tree_node_it_(const_pointer p_nd = NULL, const_pointer p_begin_nd = NULL, const_pointer p_end_nd = NULL, const_metadata_pointer p_metadata = NULL) : base_type(p_nd, p_begin_nd, p_end_nd, p_metadata)
+ { }
+
+ // Access.
+ inline reference
+ operator*() const
+ { return reference(base_type::m_p_value); }
+
+ // Returns the node reference associated with the left node.
+ inline ov_tree_node_it_
+ get_l_child() const
+ {
+ if (base_type::m_p_begin_value == base_type::m_p_value)
+ return (this_type(base_type::m_p_begin_value, base_type::m_p_begin_value, base_type::m_p_begin_value));
+
+ const_metadata_pointer p_begin_metadata =
+ base_type::m_p_metadata - (base_type::m_p_value - base_type::m_p_begin_value);
+
+ return (this_type(base_type::mid_pointer(base_type::m_p_begin_value, base_type::m_p_value),
+ base_type::m_p_begin_value,
+ base_type::m_p_value,
+ base_type::mid_pointer(p_begin_metadata, base_type::m_p_metadata)));
+ }
+
+ // Returns the node reference associated with the right node.
+ inline ov_tree_node_it_
+ get_r_child() const
+ {
+ if (base_type::m_p_value == base_type::m_p_end_value)
+ return (this_type(base_type::m_p_end_value, base_type::m_p_end_value, base_type::m_p_end_value));
+
+ const_metadata_pointer p_end_metadata =
+ base_type::m_p_metadata + (base_type::m_p_end_value - base_type::m_p_value);
+
+ return (this_type(base_type::mid_pointer(base_type::m_p_value + 1, base_type::m_p_end_value),
+ base_type::m_p_value + 1,
+ base_type::m_p_end_value,(base_type::m_p_metadata == NULL)?
+ NULL : base_type::mid_pointer(base_type::m_p_metadata + 1, p_end_metadata)));
+ }
+
+ };
+
+#undef PB_DS_OV_TREE_NODE_ITERATOR_C_DEC
+#undef PB_DS_OV_TREE_CONST_NODE_ITERATOR_C_DEC
+
+} // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp
new file mode 100644
index 0000000..f331f0f
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp
@@ -0,0 +1,522 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file ov_tree_map_.hpp
+ * Contains an implementation class for ov_tree_.
+ */
+
+#include <map>
+#include <set>
+#include <ext/pb_ds/tree_policy.hpp>
+#include <ext/pb_ds/detail/eq_fn/eq_by_less.hpp>
+#include <ext/pb_ds/detail/types_traits.hpp>
+#include <ext/pb_ds/detail/debug_map_base.hpp>
+#include <ext/pb_ds/detail/type_utils.hpp>
+#include <ext/pb_ds/exception.hpp>
+#include <ext/pb_ds/detail/tree_trace_base.hpp>
+#include <utility>
+#include <functional>
+#include <algorithm>
+#include <vector>
+#include <assert.h>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, typename Mapped, class Cmp_Fn, \
+ class Node_And_It_Traits, class Allocator>
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_OV_TREE_CLASS_NAME ov_tree_data_
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#define PB_DS_OV_TREE_CLASS_NAME ov_tree_no_data_
+#endif
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_CONST_NODE_ITERATOR_NAME ov_tree_const_node_iterator_data_
+#else
+#define PB_DS_CONST_NODE_ITERATOR_NAME ov_tree_const_node_iterator_no_data_
+#endif
+
+#define PB_DS_CLASS_C_DEC \
+ PB_DS_OV_TREE_CLASS_NAME<Key, Mapped, Cmp_Fn, Node_And_It_Traits, Allocator>
+
+#define PB_DS_TYPES_TRAITS_C_DEC \
+ types_traits<Key, Mapped, Allocator, false>
+
+#ifdef _GLIBCXX_DEBUG
+#define PB_DS_DEBUG_MAP_BASE_C_DEC \
+ debug_map_base<Key, eq_by_less<Key, Cmp_Fn>, \
+ typename Allocator::template rebind<Key>::other::const_reference>
+#endif
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_V2F(X) (X).first
+#define PB_DS_V2S(X) (X).second
+#define PB_DS_EP2VP(X)& ((X)->m_value)
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#define PB_DS_V2F(X) (X)
+#define PB_DS_V2S(X) Mapped_Data()
+#define PB_DS_EP2VP(X)& ((X)->m_value.first)
+#endif
+
+#ifdef PB_DS_TREE_TRACE
+#define PB_DS_TREE_TRACE_BASE_C_DEC \
+ tree_trace_base<typename Node_And_It_Traits::const_node_iterator, \
+ typename Node_And_It_Traits::node_iterator, \
+ Cmp_Fn, false, Allocator>
+#endif
+
+ // Ordered-vector tree associative-container.
+ template<typename Key, typename Mapped, class Cmp_Fn,
+ class Node_And_It_Traits, class Allocator>
+ class PB_DS_OV_TREE_CLASS_NAME :
+#ifdef _GLIBCXX_DEBUG
+ protected PB_DS_DEBUG_MAP_BASE_C_DEC,
+#endif
+#ifdef PB_DS_TREE_TRACE
+ public PB_DS_TREE_TRACE_BASE_C_DEC,
+#endif
+ public Cmp_Fn,
+ public Node_And_It_Traits::node_update,
+ public PB_DS_TYPES_TRAITS_C_DEC
+ {
+ private:
+ typedef PB_DS_TYPES_TRAITS_C_DEC traits_base;
+
+ typedef typename remove_const<typename traits_base::value_type>::type non_const_value_type;
+
+ typedef typename Allocator::template rebind<non_const_value_type>::other value_allocator;
+ typedef typename value_allocator::pointer value_vector;
+
+
+ typedef Cmp_Fn cmp_fn_base;
+
+#ifdef _GLIBCXX_DEBUG
+ typedef PB_DS_DEBUG_MAP_BASE_C_DEC debug_base;
+#endif
+
+ typedef typename traits_base::pointer mapped_pointer_;
+ typedef typename traits_base::const_pointer const_mapped_pointer_;
+
+ typedef typename Node_And_It_Traits::metadata_type metadata_type;
+
+ typedef typename Allocator::template rebind<metadata_type>::other metadata_allocator;
+ typedef typename metadata_allocator::pointer metadata_pointer;
+ typedef typename metadata_allocator::const_reference const_metadata_reference;
+ typedef typename metadata_allocator::reference metadata_reference;
+
+ typedef
+ typename Node_And_It_Traits::null_node_update_pointer
+ null_node_update_pointer;
+
+ public:
+
+ typedef Allocator allocator_type;
+ typedef typename Allocator::size_type size_type;
+ typedef typename Allocator::difference_type difference_type;
+
+ typedef Cmp_Fn cmp_fn;
+
+ typedef typename Node_And_It_Traits::node_update node_update;
+
+ typedef typename traits_base::key_type key_type;
+ typedef typename traits_base::key_pointer key_pointer;
+ typedef typename traits_base::const_key_pointer const_key_pointer;
+ typedef typename traits_base::key_reference key_reference;
+ typedef typename traits_base::const_key_reference const_key_reference;
+ typedef typename traits_base::mapped_type mapped_type;
+ typedef typename traits_base::mapped_pointer mapped_pointer;
+ typedef typename traits_base::const_mapped_pointer const_mapped_pointer;
+ typedef typename traits_base::mapped_reference mapped_reference;
+ typedef typename traits_base::const_mapped_reference const_mapped_reference;
+ typedef typename traits_base::value_type value_type;
+ typedef typename traits_base::pointer pointer;
+ typedef typename traits_base::const_pointer const_pointer;
+ typedef typename traits_base::reference reference;
+ typedef typename traits_base::const_reference const_reference;
+
+ typedef const_pointer const_point_iterator;
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ typedef pointer point_iterator;
+#else
+ typedef const_point_iterator point_iterator;
+#endif
+
+ typedef const_point_iterator const_iterator;
+
+ typedef point_iterator iterator;
+
+#include <ext/pb_ds/detail/ov_tree_map_/cond_dtor.hpp>
+
+ typedef
+ typename Node_And_It_Traits::const_node_iterator
+ const_node_iterator;
+
+ typedef typename Node_And_It_Traits::node_iterator node_iterator;
+
+ public:
+
+ PB_DS_OV_TREE_CLASS_NAME();
+
+ PB_DS_OV_TREE_CLASS_NAME(const Cmp_Fn&);
+
+ PB_DS_OV_TREE_CLASS_NAME(const Cmp_Fn&, const node_update&);
+
+ PB_DS_OV_TREE_CLASS_NAME(const PB_DS_CLASS_C_DEC&);
+
+ ~PB_DS_OV_TREE_CLASS_NAME();
+
+ void
+ swap(PB_DS_CLASS_C_DEC&);
+
+ template<typename It>
+ void
+ copy_from_range(It, It);
+
+ inline size_type
+ max_size() const;
+
+ inline bool
+ empty() const;
+
+ inline size_type
+ size() const;
+
+ Cmp_Fn&
+ get_cmp_fn();
+
+ const Cmp_Fn&
+ get_cmp_fn() const;
+
+ inline mapped_reference
+ operator[](const_key_reference r_key)
+ {
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ point_iterator it = lower_bound(r_key);
+ if (it != end() && !Cmp_Fn::operator()(r_key, PB_DS_V2F(*it)))
+ {
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key));
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return it->second;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return (insert_new_val(it, std::make_pair(r_key, mapped_type()))->second);
+#else
+ insert(r_key);
+ return traits_base::s_null_mapped;
+#endif
+ }
+
+ inline std::pair<point_iterator, bool>
+ insert(const_reference r_value)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ const_key_reference r_key = PB_DS_V2F(r_value);
+ point_iterator it = lower_bound(r_key);
+
+ if (it != end()&& !Cmp_Fn::operator()(r_key, PB_DS_V2F(*it)))
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key));
+ return std::make_pair(it, false);
+ }
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return std::make_pair(insert_new_val(it, r_value), true);
+ }
+
+ inline point_iterator
+ lower_bound(const_key_reference r_key)
+ {
+ pointer it = m_a_values;
+ pointer e_it = m_a_values + m_size;
+ while (it != e_it)
+ {
+ pointer mid_it = it + ((e_it - it) >> 1);
+ if (cmp_fn_base::operator()(PB_DS_V2F(*mid_it), r_key))
+ it = ++mid_it;
+ else
+ e_it = mid_it;
+ }
+ return it;
+ }
+
+ inline const_point_iterator
+ lower_bound(const_key_reference r_key) const
+ { return const_cast<PB_DS_CLASS_C_DEC& >(*this).lower_bound(r_key); }
+
+ inline point_iterator
+ upper_bound(const_key_reference r_key)
+ {
+ iterator pot_it = lower_bound(r_key);
+ if (pot_it != end()&& !Cmp_Fn::operator()(r_key, PB_DS_V2F(*pot_it)))
+ {
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key));
+ return ++pot_it;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key));
+ return pot_it;
+ }
+
+ inline const_point_iterator
+ upper_bound(const_key_reference r_key) const
+ { return const_cast<PB_DS_CLASS_C_DEC&>(*this).upper_bound(r_key); }
+
+ inline point_iterator
+ find(const_key_reference r_key)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ iterator pot_it = lower_bound(r_key);
+ if (pot_it != end() && !Cmp_Fn::operator()(r_key, PB_DS_V2F(*pot_it)))
+ {
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key));
+ return pot_it;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key));
+ return end();
+ }
+
+ inline const_point_iterator
+ find(const_key_reference r_key) const
+ { return (const_cast<PB_DS_CLASS_C_DEC& >(*this).find(r_key)); }
+
+ bool
+ erase(const_key_reference);
+
+ template<typename Pred>
+ inline size_type
+ erase_if(Pred);
+
+ inline iterator
+ erase(iterator it)
+ { return erase_imp<iterator>(it); }
+
+ void
+ clear();
+
+ void
+ join(PB_DS_CLASS_C_DEC&);
+
+ void
+ split(const_key_reference, PB_DS_CLASS_C_DEC&);
+
+ inline iterator
+ begin()
+ { return m_a_values; }
+
+ inline const_iterator
+ begin() const
+ { return m_a_values; }
+
+ inline iterator
+ end()
+ { return m_end_it; }
+
+ inline const_iterator
+ end() const
+ { return m_end_it; }
+
+ inline const_node_iterator
+ node_begin() const;
+
+ inline const_node_iterator
+ node_end() const;
+
+ inline node_iterator
+ node_begin();
+
+ inline node_iterator
+ node_end();
+
+ private:
+
+ inline void
+ update(node_iterator /*it*/, null_node_update_pointer);
+
+ template<typename Node_Update>
+ void
+ update(node_iterator, Node_Update*);
+
+ void
+ reallocate_metadata(null_node_update_pointer, size_type);
+
+ template<typename Node_Update_>
+ void
+ reallocate_metadata(Node_Update_*, size_type);
+
+ template<typename It>
+ void
+ copy_from_ordered_range(It, It);
+
+ void
+ value_swap(PB_DS_CLASS_C_DEC&);
+
+ template<typename It>
+ void
+ copy_from_ordered_range(It, It, It, It);
+
+ template<typename Ptr>
+ inline static Ptr
+ mid_pointer(Ptr p_begin, Ptr p_end)
+ {
+ _GLIBCXX_DEBUG_ASSERT(p_end >= p_begin);
+ return (p_begin + (p_end - p_begin) / 2);
+ }
+
+ inline iterator
+ insert_new_val(iterator it, const_reference r_value)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+#ifdef PB_DS_REGRESSION
+ typename Allocator::group_throw_prob_adjustor adjust(m_size);
+#endif
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(PB_DS_V2F(r_value)));
+
+ value_vector a_values = s_value_alloc.allocate(m_size + 1);
+
+ iterator source_it = begin();
+ iterator source_end_it = end();
+ iterator target_it = a_values;
+ iterator ret_it;
+
+ cond_dtor<size_type> cd(a_values, target_it, m_size + 1);
+ while (source_it != it)
+ {
+ new (const_cast<void* >(static_cast<const void* >(target_it)))
+ value_type(*source_it++);
+ ++target_it;
+ }
+
+ new (const_cast<void* >(static_cast<const void* >(ret_it = target_it)))
+ value_type(r_value);
+ ++target_it;
+
+ while (source_it != source_end_it)
+ {
+ new (const_cast<void* >(static_cast<const void* >(target_it)))
+ value_type(*source_it++);
+ ++target_it;
+ }
+
+ reallocate_metadata((node_update* )this, m_size + 1);
+ cd.set_no_action();
+ if (m_size != 0)
+ {
+ cond_dtor<size_type> cd1(m_a_values, m_end_it, m_size);
+ }
+
+ ++m_size;
+ m_a_values = a_values;
+ m_end_it = m_a_values + m_size;
+ _GLIBCXX_DEBUG_ONLY(debug_base::insert_new(PB_DS_V2F(r_value)));
+ update(node_begin(), (node_update* )this);
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+ return ret_it;
+ }
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid() const;
+
+ void
+ assert_iterators() const;
+#endif
+
+ template<typename It>
+ It
+ erase_imp(It it);
+
+ inline const_node_iterator
+ PB_DS_node_begin_imp() const;
+
+ inline const_node_iterator
+ PB_DS_node_end_imp() const;
+
+ inline node_iterator
+ PB_DS_node_begin_imp();
+
+ inline node_iterator
+ PB_DS_node_end_imp();
+
+ private:
+ static value_allocator s_value_alloc;
+ static metadata_allocator s_metadata_alloc;
+
+ value_vector m_a_values;
+ metadata_pointer m_a_metadata;
+ iterator m_end_it;
+ size_type m_size;
+ };
+
+#include <ext/pb_ds/detail/ov_tree_map_/constructors_destructor_fn_imps.hpp>
+#include <ext/pb_ds/detail/ov_tree_map_/iterators_fn_imps.hpp>
+#include <ext/pb_ds/detail/ov_tree_map_/debug_fn_imps.hpp>
+#include <ext/pb_ds/detail/ov_tree_map_/erase_fn_imps.hpp>
+#include <ext/pb_ds/detail/ov_tree_map_/insert_fn_imps.hpp>
+#include <ext/pb_ds/detail/ov_tree_map_/info_fn_imps.hpp>
+#include <ext/pb_ds/detail/ov_tree_map_/split_join_fn_imps.hpp>
+#include <ext/pb_ds/detail/bin_search_tree_/policy_access_fn_imps.hpp>
+
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_OV_TREE_CLASS_NAME
+#undef PB_DS_TYPES_TRAITS_C_DEC
+#undef PB_DS_DEBUG_MAP_BASE_C_DEC
+#ifdef PB_DS_TREE_TRACE
+#undef PB_DS_TREE_TRACE_BASE_C_DEC
+#endif
+
+#undef PB_DS_V2F
+#undef PB_DS_EP2VP
+#undef PB_DS_V2S
+#undef PB_DS_CONST_NODE_ITERATOR_NAME
+
+ } // namespace detail
+} // namespace __gnu_pbds
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/policy_access_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/policy_access_fn_imps.hpp
new file mode 100644
index 0000000..c06d6f8
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/policy_access_fn_imps.hpp
@@ -0,0 +1,51 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file policy_access_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+Cmp_Fn&
+PB_DS_CLASS_C_DEC::
+get_cmp_fn()
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+const Cmp_Fn&
+PB_DS_CLASS_C_DEC::
+get_cmp_fn() const
+{ return *this; }
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/split_join_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/split_join_fn_imps.hpp
new file mode 100644
index 0000000..76bb6fa
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/split_join_fn_imps.hpp
@@ -0,0 +1,137 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file split_join_fn_imps.hpp
+ * Contains an implementation class for ov_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+split(const_key_reference r_key, PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+
+ if (m_size == 0)
+ {
+ other.clear();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ return;
+ }
+
+ if (Cmp_Fn::operator()(r_key, PB_DS_V2F(*begin())))
+ {
+ value_swap(other);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ return;
+ }
+
+ if (!Cmp_Fn::operator()(r_key, PB_DS_V2F(*(end() - 1))))
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ return;
+ }
+
+ if (m_size == 1)
+ {
+ value_swap(other);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ return;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::join(other);)
+ iterator it = upper_bound(r_key);
+ PB_DS_CLASS_C_DEC new_other(other, other);
+ new_other.copy_from_ordered_range(it, end());
+ PB_DS_CLASS_C_DEC new_this(*this, * this);
+ new_this.copy_from_ordered_range(begin(), it);
+
+ // No exceptions from this point.
+ _GLIBCXX_DEBUG_ONLY(debug_base::split(r_key,(Cmp_Fn& )(*this), other);)
+ other.update(other.node_begin(), (node_update* )(&other));
+ update(node_begin(), (node_update* )this);
+ other.value_swap(new_other);
+ value_swap(new_this);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+join(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ if (other.m_size == 0)
+ return;
+
+ if (m_size == 0)
+ {
+ value_swap(other);
+ return;
+ }
+
+ const bool greater = Cmp_Fn::operator()(PB_DS_V2F(*(end() - 1)),
+ PB_DS_V2F(*other.begin()));
+
+ const bool lesser = Cmp_Fn::operator()(PB_DS_V2F(*(other.end() - 1)),
+ PB_DS_V2F(*begin()));
+
+ if (!greater && !lesser)
+ __throw_join_error();
+
+ PB_DS_CLASS_C_DEC new_this(*this, *this);
+
+ if (greater)
+ new_this.copy_from_ordered_range(begin(), end(),
+ other.begin(), other.end());
+ else
+ new_this.copy_from_ordered_range(other.begin(), other.end(),
+ begin(), end());
+
+ // No exceptions from this point.
+ _GLIBCXX_DEBUG_ONLY(debug_base::join(other);)
+ value_swap(new_this);
+ other.clear();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+}
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/traits.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/traits.hpp
new file mode 100644
index 0000000..63cb0f7
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/ov_tree_map_/traits.hpp
@@ -0,0 +1,183 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file traits.hpp
+ * Contains an implementation class for ov_tree_.
+ */
+
+#ifndef PB_DS_OV_TREE_NODE_AND_IT_TRAITS_HPP
+#define PB_DS_OV_TREE_NODE_AND_IT_TRAITS_HPP
+
+#include <ext/pb_ds/detail/ov_tree_map_/node_iterators.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+ template<typename Key,
+ typename Mapped,
+ class Cmp_Fn,
+ template<typename Const_Node_Iterator,
+ class Node_Iterator,
+ class Cmp_Fn_,
+ class Allocator_>
+ class Node_Update,
+ class Allocator>
+ struct tree_traits<
+ Key,
+ Mapped,
+ Cmp_Fn,
+ Node_Update,
+ ov_tree_tag,
+ Allocator>
+ {
+ private:
+ typedef
+ typename types_traits<
+ Key,
+ Mapped,
+ Allocator,
+ false>::value_type
+ value_type;
+
+ public:
+ typedef
+ typename tree_node_metadata_selector<
+ Key,
+ Mapped,
+ Cmp_Fn,
+ Node_Update,
+ Allocator>::type
+ metadata_type;
+
+ typedef
+ ov_tree_node_const_it_<
+ value_type,
+ metadata_type,
+ Allocator>
+ const_node_iterator;
+
+ typedef
+ ov_tree_node_it_<
+ value_type,
+ metadata_type,
+ Allocator>
+ node_iterator;
+
+ typedef
+ Node_Update<
+ const_node_iterator,
+ node_iterator,
+ Cmp_Fn,
+ Allocator>
+ node_update;
+
+ typedef
+ __gnu_pbds::null_tree_node_update<
+ const_node_iterator,
+ node_iterator,
+ Cmp_Fn,
+ Allocator>*
+ null_node_update_pointer;
+ };
+
+ template<typename Key,
+ class Cmp_Fn,
+ template<typename Const_Node_Iterator,
+ class Node_Iterator,
+ class Cmp_Fn_,
+ class Allocator_>
+ class Node_Update,
+ class Allocator>
+ struct tree_traits<
+ Key,
+ null_mapped_type,
+ Cmp_Fn,
+ Node_Update,
+ ov_tree_tag,
+ Allocator>
+ {
+ private:
+ typedef
+ typename types_traits<
+ Key,
+ null_mapped_type,
+ Allocator,
+ false>::value_type
+ value_type;
+
+ public:
+ typedef
+ typename tree_node_metadata_selector<
+ Key,
+ null_mapped_type,
+ Cmp_Fn,
+ Node_Update,
+ Allocator>::type
+ metadata_type;
+
+ typedef
+ ov_tree_node_const_it_<
+ value_type,
+ metadata_type,
+ Allocator>
+ const_node_iterator;
+
+ typedef const_node_iterator node_iterator;
+
+ typedef
+ Node_Update<
+ const_node_iterator,
+ const_node_iterator,
+ Cmp_Fn,
+ Allocator>
+ node_update;
+
+ typedef
+ __gnu_pbds::null_tree_node_update<
+ const_node_iterator,
+ node_iterator,
+ Cmp_Fn,
+ Allocator>*
+ null_node_update_pointer;
+ };
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_OV_TREE_NODE_AND_IT_TRAITS_HPP
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pairing_heap_/constructors_destructor_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pairing_heap_/constructors_destructor_fn_imps.hpp
new file mode 100644
index 0000000..e292ed5
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pairing_heap_/constructors_destructor_fn_imps.hpp
@@ -0,0 +1,91 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructors_destructor_fn_imps.hpp
+ * Contains an implementation class for a pairing heap.
+ */
+
+PB_DS_CLASS_T_DEC
+template<typename It>
+void
+PB_DS_CLASS_C_DEC::
+copy_from_range(It first_it, It last_it)
+{
+ while (first_it != last_it)
+ push(*(first_it++));
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+pairing_heap_()
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+pairing_heap_(const Cmp_Fn& r_cmp_fn) :
+ PB_DS_BASE_C_DEC(r_cmp_fn)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+pairing_heap_(const PB_DS_CLASS_C_DEC& other) :
+ PB_DS_BASE_C_DEC(other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ PB_DS_BASE_C_DEC::swap(other);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+~pairing_heap_()
+{ }
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pairing_heap_/debug_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pairing_heap_/debug_fn_imps.hpp
new file mode 100644
index 0000000..7c9fc13
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pairing_heap_/debug_fn_imps.hpp
@@ -0,0 +1,53 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_fn_imps.hpp
+ * Contains an implementation class for a pairing heap.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_valid() const
+{
+ _GLIBCXX_DEBUG_ASSERT(base_type::m_p_root == NULL
+ || base_type::m_p_root->m_p_next_sibling == NULL);
+ base_type::assert_valid();
+}
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pairing_heap_/erase_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pairing_heap_/erase_fn_imps.hpp
new file mode 100644
index 0000000..905be10
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pairing_heap_/erase_fn_imps.hpp
@@ -0,0 +1,236 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file erase_fn_imps.hpp
+ * Contains an implementation class for a pairing heap.
+ */
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+pop()
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ASSERT(!base_type::empty());
+
+ node_pointer p_new_root = join_node_children(base_type::m_p_root);
+ _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_new_root, false);)
+ if (p_new_root != NULL)
+ p_new_root->m_p_prev_or_parent = NULL;
+
+ base_type::actual_erase_node(base_type::m_p_root);
+ base_type::m_p_root = p_new_root;
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+erase(point_iterator it)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ASSERT(!base_type::empty());
+ remove_node(it.m_p_nd);
+ base_type::actual_erase_node(it.m_p_nd);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+remove_node(node_pointer p_nd)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ASSERT(!base_type::empty());
+ node_pointer p_new_child = join_node_children(p_nd);
+
+#ifdef _GLIBCXX_DEBUG
+ if (p_new_child != NULL)
+ base_type::assert_node_consistent(p_new_child, false);
+#endif
+
+ if (p_nd == base_type::m_p_root)
+ {
+ if (p_new_child != NULL)
+ p_new_child->m_p_prev_or_parent = NULL;
+ base_type::m_p_root = p_new_child;
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(base_type::m_p_root, false);)
+ return;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_prev_or_parent != NULL);
+ if (p_nd->m_p_prev_or_parent->m_p_l_child == p_nd)
+ {
+ if (p_new_child != NULL)
+ {
+ p_new_child->m_p_prev_or_parent = p_nd->m_p_prev_or_parent;
+ p_new_child->m_p_next_sibling = p_nd->m_p_next_sibling;
+ if (p_new_child->m_p_next_sibling != NULL)
+ p_new_child->m_p_next_sibling->m_p_prev_or_parent = p_new_child;
+ p_nd->m_p_prev_or_parent->m_p_l_child = p_new_child;
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_nd->m_p_prev_or_parent, false);)
+ return;
+ }
+
+ p_nd->m_p_prev_or_parent->m_p_l_child = p_nd->m_p_next_sibling;
+ if (p_nd->m_p_next_sibling != NULL)
+ p_nd->m_p_next_sibling->m_p_prev_or_parent = p_nd->m_p_prev_or_parent;
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_nd->m_p_prev_or_parent, false);)
+ return;
+ }
+
+ if (p_new_child != NULL)
+ {
+ p_new_child->m_p_prev_or_parent = p_nd->m_p_prev_or_parent;
+ p_new_child->m_p_next_sibling = p_nd->m_p_next_sibling;
+ if (p_new_child->m_p_next_sibling != NULL)
+ p_new_child->m_p_next_sibling->m_p_prev_or_parent = p_new_child;
+ p_new_child->m_p_prev_or_parent->m_p_next_sibling = p_new_child;
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_nd->m_p_prev_or_parent, false);)
+ return;
+ }
+
+ p_nd->m_p_prev_or_parent->m_p_next_sibling = p_nd->m_p_next_sibling;
+ if (p_nd->m_p_next_sibling != NULL)
+ p_nd->m_p_next_sibling->m_p_prev_or_parent = p_nd->m_p_prev_or_parent;
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_nd->m_p_prev_or_parent, false);)
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+join_node_children(node_pointer p_nd)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_nd != NULL);
+ node_pointer p_ret = p_nd->m_p_l_child;
+ if (p_ret == NULL)
+ return NULL;
+ while (p_ret->m_p_next_sibling != NULL)
+ p_ret = forward_join(p_ret, p_ret->m_p_next_sibling);
+ while (p_ret->m_p_prev_or_parent != p_nd)
+ p_ret = back_join(p_ret->m_p_prev_or_parent, p_ret);
+ _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_ret, false);)
+ return p_ret;
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+forward_join(node_pointer p_nd, node_pointer p_next)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_nd != NULL);
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_next_sibling == p_next);
+ if (Cmp_Fn::operator()(p_nd->m_value, p_next->m_value))
+ {
+ p_next->m_p_prev_or_parent = p_nd->m_p_prev_or_parent;
+ base_type::make_child_of(p_nd, p_next);
+ return p_next->m_p_next_sibling == NULL
+ ? p_next : p_next->m_p_next_sibling;
+ }
+
+ if (p_next->m_p_next_sibling != NULL)
+ {
+ p_next->m_p_next_sibling->m_p_prev_or_parent = p_nd;
+ p_nd->m_p_next_sibling = p_next->m_p_next_sibling;
+ base_type::make_child_of(p_next, p_nd);
+ return p_nd->m_p_next_sibling;
+ }
+
+ p_nd->m_p_next_sibling = NULL;
+ base_type::make_child_of(p_next, p_nd);
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_nd, false));
+ return p_nd;
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+back_join(node_pointer p_nd, node_pointer p_next)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_nd != NULL);
+ _GLIBCXX_DEBUG_ASSERT(p_next->m_p_next_sibling == NULL);
+
+ if (Cmp_Fn::operator()(p_nd->m_value, p_next->m_value))
+ {
+ p_next->m_p_prev_or_parent = p_nd->m_p_prev_or_parent;
+ base_type::make_child_of(p_nd, p_next);
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_next, false));
+ return p_next;
+ }
+
+ p_nd->m_p_next_sibling = NULL;
+ base_type::make_child_of(p_next, p_nd);
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_nd, false));
+ return p_nd;
+}
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+erase_if(Pred pred)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ if (base_type::empty())
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return 0;
+ }
+ base_type::to_linked_list();
+ node_pointer p_out = base_type::prune(pred);
+ size_type ersd = 0;
+ while (p_out != NULL)
+ {
+ ++ersd;
+ node_pointer p_next = p_out->m_p_next_sibling;
+ base_type::actual_erase_node(p_out);
+ p_out = p_next;
+ }
+
+ node_pointer p_cur = base_type::m_p_root;
+ base_type::m_p_root = NULL;
+ while (p_cur != NULL)
+ {
+ node_pointer p_next = p_cur->m_p_next_sibling;
+ p_cur->m_p_l_child = p_cur->m_p_next_sibling = p_cur->m_p_prev_or_parent = NULL;
+
+ push_imp(p_cur);
+ p_cur = p_next;
+ }
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return ersd;
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pairing_heap_/find_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pairing_heap_/find_fn_imps.hpp
new file mode 100644
index 0000000..85efd70
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pairing_heap_/find_fn_imps.hpp
@@ -0,0 +1,50 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file find_fn_imps.hpp
+ * Contains an implementation class for a pairing heap.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_reference
+PB_DS_CLASS_C_DEC::
+top() const
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ASSERT(!base_type::empty());
+
+ return base_type::m_p_root->m_value;
+}
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pairing_heap_/insert_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pairing_heap_/insert_fn_imps.hpp
new file mode 100644
index 0000000..b00e9d1
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pairing_heap_/insert_fn_imps.hpp
@@ -0,0 +1,101 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file insert_fn_imps.hpp
+ * Contains an implementation class for a pairing heap.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::point_iterator
+PB_DS_CLASS_C_DEC::
+push(const_reference r_val)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ node_pointer p_new_nd = base_type::get_new_node_for_insert(r_val);
+
+ push_imp(p_new_nd);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ return point_iterator(p_new_nd);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+push_imp(node_pointer p_nd)
+{
+ p_nd->m_p_l_child = NULL;
+
+ if (base_type::m_p_root == NULL)
+ {
+ p_nd->m_p_next_sibling = p_nd->m_p_prev_or_parent = NULL;
+
+ base_type::m_p_root = p_nd;
+ }
+ else if (Cmp_Fn::operator()(base_type::m_p_root->m_value, p_nd->m_value))
+ {
+ p_nd->m_p_next_sibling = p_nd->m_p_prev_or_parent = NULL;
+
+ base_type::make_child_of(base_type::m_p_root, p_nd);
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_nd, false));
+
+ base_type::m_p_root = p_nd;
+ }
+ else
+ {
+ base_type::make_child_of(p_nd, base_type::m_p_root);
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(base_type::m_p_root, false));
+ }
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+modify(point_iterator it, const_reference r_new_val)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ remove_node(it.m_p_nd);
+
+ it.m_p_nd->m_value = r_new_val;
+
+ push_imp(it.m_p_nd);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pairing_heap_/pairing_heap_.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pairing_heap_/pairing_heap_.hpp
new file mode 100644
index 0000000..e19bcb6
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pairing_heap_/pairing_heap_.hpp
@@ -0,0 +1,216 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file pairing_heap_.hpp
+ * Contains an implementation class for a pairing heap.
+ */
+
+/*
+ * Pairing heap:
+ * Michael L. Fredman, Robert Sedgewick, Daniel Dominic Sleator,
+ * and Robert Endre Tarjan, The Pairing Heap:
+ * A New Form of Self-Adjusting Heap, Algorithmica, 1(1):111-129, 1986.
+ */
+
+#include <ext/pb_ds/detail/cond_dealtor.hpp>
+#include <ext/pb_ds/detail/type_utils.hpp>
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp>
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/null_metadata.hpp>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Value_Type, class Cmp_Fn, class Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ pairing_heap_<Value_Type, Cmp_Fn, Allocator>
+
+#ifdef _GLIBCXX_DEBUG
+#define PB_DS_BASE_C_DEC \
+ left_child_next_sibling_heap_< \
+ Value_Type, \
+ Cmp_Fn, \
+ null_left_child_next_sibling_heap_node_metadata, \
+ Allocator, \
+ false>
+#else
+#define PB_DS_BASE_C_DEC \
+ left_child_next_sibling_heap_< \
+ Value_Type, \
+ Cmp_Fn, \
+ null_left_child_next_sibling_heap_node_metadata, \
+ Allocator>
+#endif
+
+ /**
+ * class description = "P4ri|\|g h3ap$">
+ **/
+ template<typename Value_Type, class Cmp_Fn, class Allocator>
+ class pairing_heap_ : public PB_DS_BASE_C_DEC
+ {
+
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ typedef typename base_type::node_pointer node_pointer;
+
+ public:
+
+ typedef typename Allocator::size_type size_type;
+
+ typedef typename Allocator::difference_type difference_type;
+
+ typedef Value_Type value_type;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::pointer
+ pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::const_pointer
+ const_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::reference
+ reference;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::const_reference
+ const_reference;
+
+ typedef
+ typename PB_DS_BASE_C_DEC::const_point_iterator
+ const_point_iterator;
+
+ typedef typename PB_DS_BASE_C_DEC::point_iterator point_iterator;
+
+ typedef typename PB_DS_BASE_C_DEC::const_iterator const_iterator;
+
+ typedef typename PB_DS_BASE_C_DEC::iterator iterator;
+
+ typedef Cmp_Fn cmp_fn;
+
+ typedef Allocator allocator_type;
+
+
+ pairing_heap_();
+
+ pairing_heap_(const Cmp_Fn& r_cmp_fn);
+
+ pairing_heap_(const PB_DS_CLASS_C_DEC& other);
+
+ void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ ~pairing_heap_();
+
+ inline point_iterator
+ push(const_reference r_val);
+
+ void
+ modify(point_iterator it, const_reference r_new_val);
+
+ inline const_reference
+ top() const;
+
+ void
+ pop();
+
+ void
+ erase(point_iterator it);
+
+ template<typename Pred>
+ size_type
+ erase_if(Pred pred);
+
+ template<typename Pred>
+ void
+ split(Pred pred, PB_DS_CLASS_C_DEC& other);
+
+ void
+ join(PB_DS_CLASS_C_DEC& other);
+
+ protected:
+
+ template<typename It>
+ void
+ copy_from_range(It first_it, It last_it);
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid() const;
+#endif
+
+ private:
+
+ inline void
+ push_imp(node_pointer p_nd);
+
+ node_pointer
+ join_node_children(node_pointer p_nd);
+
+ node_pointer
+ forward_join(node_pointer p_nd, node_pointer p_next);
+
+ node_pointer
+ back_join(node_pointer p_nd, node_pointer p_next);
+
+ void
+ remove_node(node_pointer p_nd);
+
+ };
+
+#include <ext/pb_ds/detail/pairing_heap_/constructors_destructor_fn_imps.hpp>
+#include <ext/pb_ds/detail/pairing_heap_/debug_fn_imps.hpp>
+#include <ext/pb_ds/detail/pairing_heap_/find_fn_imps.hpp>
+#include <ext/pb_ds/detail/pairing_heap_/insert_fn_imps.hpp>
+#include <ext/pb_ds/detail/pairing_heap_/erase_fn_imps.hpp>
+#include <ext/pb_ds/detail/pairing_heap_/split_join_fn_imps.hpp>
+
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_BASE_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pairing_heap_/split_join_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pairing_heap_/split_join_fn_imps.hpp
new file mode 100644
index 0000000..85d4ddf
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pairing_heap_/split_join_fn_imps.hpp
@@ -0,0 +1,140 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file split_join_fn_imps.hpp
+ * Contains an implementation class for a pairing heap.
+ */
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+void
+PB_DS_CLASS_C_DEC::
+split(Pred pred, PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+
+ other.clear();
+
+ if (base_type::empty())
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+
+ return;
+ }
+
+ base_type::to_linked_list();
+
+ node_pointer p_out = base_type::prune(pred);
+
+ while (p_out != NULL)
+ {
+ _GLIBCXX_DEBUG_ASSERT(base_type::m_size > 0);
+ --base_type::m_size;
+
+ ++other.m_size;
+
+ node_pointer p_next = p_out->m_p_next_sibling;
+
+ p_out->m_p_l_child = p_out->m_p_next_sibling = p_out->m_p_prev_or_parent = NULL;
+
+ other.push_imp(p_out);
+
+ p_out = p_next;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+
+ node_pointer p_cur = base_type::m_p_root;
+
+ base_type::m_p_root = NULL;
+
+ while (p_cur != NULL)
+ {
+ node_pointer p_next = p_cur->m_p_next_sibling;
+
+ p_cur->m_p_l_child = p_cur->m_p_next_sibling = p_cur->m_p_prev_or_parent = NULL;
+
+ push_imp(p_cur);
+
+ p_cur = p_next;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+join(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+
+ if (other.m_p_root == NULL)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+
+ return;
+ }
+
+ if (base_type::m_p_root == NULL)
+ base_type::m_p_root = other.m_p_root;
+ else if (Cmp_Fn::operator()(base_type::m_p_root->m_value, other.m_p_root->m_value))
+ {
+ base_type::make_child_of(base_type::m_p_root, other.m_p_root);
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(other.m_p_root, false));
+
+ base_type::m_p_root = other.m_p_root;
+ }
+ else
+ {
+ base_type::make_child_of(other.m_p_root, base_type::m_p_root);
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(base_type::m_p_root, false));
+ }
+
+ base_type::m_size += other.m_size;
+
+ other.m_p_root = NULL;
+ other.m_size = 0;
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ }
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/child_iterator.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/child_iterator.hpp
new file mode 100644
index 0000000..15f349e
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/child_iterator.hpp
@@ -0,0 +1,93 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file child_iterator.hpp
+ * Contains a iterator for a patricia tree.
+ */
+
+struct iterator : public const_iterator
+{
+public:
+ typedef std::forward_iterator_tag iterator_category;
+ typedef typename Allocator::difference_type difference_type;
+ typedef node_pointer value_type;
+ typedef node_pointer_pointer pointer;
+ typedef node_pointer_reference reference;
+
+ inline
+ iterator(node_pointer_pointer p_p_cur = NULL,
+ node_pointer_pointer p_p_end = NULL)
+ : const_iterator(p_p_cur, p_p_end)
+ { }
+
+ inline bool
+ operator==(const iterator& other) const
+ { return const_iterator::m_p_p_cur == other.m_p_p_cur; }
+
+ inline bool
+ operator!=(const iterator& other) const
+ { return const_iterator::m_p_p_cur != other.m_p_p_cur; }
+
+ inline iterator&
+ operator++()
+ {
+ const_iterator::operator++();
+ return *this;
+ }
+
+ inline iterator
+ operator++(int)
+ {
+ iterator ret_it(*this);
+ operator++();
+ return ret_it;
+ }
+
+ node_pointer_pointer
+ operator->()
+ {
+ _GLIBCXX_DEBUG_ONLY(const_iterator::assert_referencible();)
+ return const_iterator::m_p_p_cur;
+ }
+
+ node_pointer
+ operator*()
+ {
+ _GLIBCXX_DEBUG_ONLY(const_iterator::assert_referencible();)
+ return *const_iterator::m_p_p_cur;
+ }
+};
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/cond_dtor_entry_dealtor.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/cond_dtor_entry_dealtor.hpp
new file mode 100644
index 0000000..184b986
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/cond_dtor_entry_dealtor.hpp
@@ -0,0 +1,79 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file cond_dtor_entry_dealtor.hpp
+ * Contains a binary tree container conditional deallocator
+ */
+
+class cond_dealtor
+{
+public:
+ inline
+ cond_dealtor(leaf_pointer p_nd) : m_p_nd(p_nd),
+ m_no_action_dtor(false),
+ m_call_destructor(false)
+ { }
+
+ inline void
+ set_no_action_dtor()
+ {
+ m_no_action_dtor = true;
+ }
+
+ inline void
+ set_call_destructor()
+ {
+ m_call_destructor = true;
+ }
+
+ inline
+ ~cond_dealtor()
+ {
+ if (m_no_action_dtor)
+ return;
+
+ if (m_call_destructor)
+ m_p_nd->~leaf();
+
+ s_leaf_allocator.deallocate(m_p_nd, 1);
+ }
+
+protected:
+ leaf_pointer m_p_nd;
+ bool m_no_action_dtor;
+ bool m_call_destructor;
+};
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/const_child_iterator.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/const_child_iterator.hpp
new file mode 100644
index 0000000..bc349cf
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/const_child_iterator.hpp
@@ -0,0 +1,111 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file const_child_iterator.hpp
+ * Contains a const_iterator for a patricia tree.
+ */
+
+struct const_iterator
+{
+public:
+ typedef std::forward_iterator_tag iterator_category;
+
+ typedef typename Allocator::difference_type difference_type;
+
+ typedef node_pointer value_type;
+
+ typedef node_pointer_pointer pointer;
+
+ typedef node_pointer_reference reference;
+
+public:
+ inline
+ const_iterator(node_pointer_pointer p_p_cur = NULL,
+ node_pointer_pointer p_p_end = NULL)
+ : m_p_p_cur(p_p_cur), m_p_p_end(p_p_end)
+ { }
+
+ inline bool
+ operator==(const const_iterator& other) const
+ { return m_p_p_cur == other.m_p_p_cur; }
+
+ inline bool
+ operator!=(const const_iterator& other) const
+ { return m_p_p_cur != other.m_p_p_cur; }
+
+ inline const_iterator&
+ operator++()
+ {
+ do
+ ++m_p_p_cur;
+ while (m_p_p_cur != m_p_p_end&& * m_p_p_cur == NULL);
+ return *this;
+ }
+
+ inline const_iterator
+ operator++(int)
+ {
+ const_iterator ret_it(*this);
+ operator++();
+ return ret_it;
+ }
+
+ const node_pointer_pointer
+ operator->() const
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_referencible();)
+ return (m_p_p_cur);
+ }
+
+ const_node_pointer
+ operator*() const
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_referencible();)
+ return (*m_p_p_cur);
+ }
+
+protected:
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_referencible() const
+ { _GLIBCXX_DEBUG_ASSERT(m_p_p_cur != m_p_p_end&& * m_p_p_cur != NULL); }
+#endif
+
+public:
+ node_pointer_pointer m_p_p_cur;
+ node_pointer_pointer m_p_p_end;
+};
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/constructors_destructor_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/constructors_destructor_fn_imps.hpp
new file mode 100644
index 0000000..ca38f93
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/constructors_destructor_fn_imps.hpp
@@ -0,0 +1,214 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructors_destructor_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::head_allocator
+PB_DS_CLASS_C_DEC::s_head_allocator;
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::internal_node_allocator
+PB_DS_CLASS_C_DEC::s_internal_node_allocator;
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::leaf_allocator
+PB_DS_CLASS_C_DEC::s_leaf_allocator;
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME() :
+ m_p_head(s_head_allocator.allocate(1)),
+ m_size(0)
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const e_access_traits& r_e_access_traits) :
+ synth_e_access_traits(r_e_access_traits),
+ m_p_head(s_head_allocator.allocate(1)),
+ m_size(0)
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const PB_DS_CLASS_C_DEC& other) :
+#ifdef _GLIBCXX_DEBUG
+ debug_base(other),
+#endif
+ synth_e_access_traits(other),
+ node_update(other),
+ m_p_head(s_head_allocator.allocate(1)),
+ m_size(0)
+{
+ initialize();
+ m_size = other.m_size;
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ if (other.m_p_head->m_p_parent == NULL)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return;
+ }
+ __try
+ {
+ m_p_head->m_p_parent = recursive_copy_node(other.m_p_head->m_p_parent);
+ }
+ __catch(...)
+ {
+ s_head_allocator.deallocate(m_p_head, 1);
+ __throw_exception_again;
+ }
+
+ m_p_head->m_p_min = leftmost_descendant(m_p_head->m_p_parent);
+ m_p_head->m_p_max = rightmost_descendant(m_p_head->m_p_parent);
+ m_p_head->m_p_parent->m_p_parent = m_p_head;
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ value_swap(other);
+ std::swap((e_access_traits& )(*this), (e_access_traits& )other);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+value_swap(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(debug_base::swap(other);)
+ std::swap(m_p_head, other.m_p_head);
+ std::swap(m_size, other.m_size);
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+~PB_DS_CLASS_NAME()
+{
+ clear();
+ s_head_allocator.deallocate(m_p_head, 1);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+initialize()
+{
+ new (m_p_head) head();
+ m_p_head->m_p_parent = NULL;
+ m_p_head->m_p_min = m_p_head;
+ m_p_head->m_p_max = m_p_head;
+ m_size = 0;
+}
+
+PB_DS_CLASS_T_DEC
+template<typename It>
+void
+PB_DS_CLASS_C_DEC::
+copy_from_range(It first_it, It last_it)
+{
+ while (first_it != last_it)
+ insert(*(first_it++));
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+recursive_copy_node(const_node_pointer p_other_nd)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_other_nd != NULL);
+ if (p_other_nd->m_type == pat_trie_leaf_node_type)
+ {
+ const_leaf_pointer p_other_leaf = static_cast<const_leaf_pointer>(p_other_nd);
+
+ leaf_pointer p_new_lf = s_leaf_allocator.allocate(1);
+ cond_dealtor cond(p_new_lf);
+ new (p_new_lf) leaf(p_other_leaf->value());
+ apply_update(p_new_lf, (node_update* )this);
+ cond.set_no_action_dtor();
+ return (p_new_lf);
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(p_other_nd->m_type == pat_trie_internal_node_type);
+ node_pointer a_p_children[internal_node::arr_size];
+ size_type child_i = 0;
+ const_internal_node_pointer p_other_internal_nd =
+ static_cast<const_internal_node_pointer>(p_other_nd);
+
+ typename internal_node::const_iterator child_it =
+ p_other_internal_nd->begin();
+
+ internal_node_pointer p_ret;
+ __try
+ {
+ while (child_it != p_other_internal_nd->end())
+ a_p_children[child_i++] = recursive_copy_node(*(child_it++));
+ p_ret = s_internal_node_allocator.allocate(1);
+ }
+ __catch(...)
+ {
+ while (child_i-- > 0)
+ clear_imp(a_p_children[child_i]);
+ __throw_exception_again;
+ }
+
+ new (p_ret) internal_node(p_other_internal_nd->get_e_ind(),
+ pref_begin(a_p_children[0]));
+
+ --child_i;
+ _GLIBCXX_DEBUG_ASSERT(child_i > 1);
+ do
+ p_ret->add_child(a_p_children[child_i], pref_begin(a_p_children[child_i]),
+ pref_end(a_p_children[child_i]), this);
+ while (child_i-- > 0);
+ apply_update(p_ret, (node_update* )this);
+ return p_ret;
+}
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/debug_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/debug_fn_imps.hpp
new file mode 100644
index 0000000..de75657
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/debug_fn_imps.hpp
@@ -0,0 +1,117 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_fn_imps.hpp
+ * Contains an implementation class for pat_trie_.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_valid() const
+{
+ if (m_p_head->m_p_parent != NULL)
+ m_p_head->m_p_parent->assert_valid(this);
+ assert_iterators();
+ assert_reverse_iterators();
+ if (m_p_head->m_p_parent == NULL)
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_head->m_p_min == m_p_head);
+ _GLIBCXX_DEBUG_ASSERT(m_p_head->m_p_max == m_p_head);
+ _GLIBCXX_DEBUG_ASSERT(empty());
+ return;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(m_p_head->m_p_min->m_type == pat_trie_leaf_node_type);
+ _GLIBCXX_DEBUG_ASSERT(m_p_head->m_p_max->m_type == pat_trie_leaf_node_type);
+ _GLIBCXX_DEBUG_ASSERT(!empty());
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_iterators() const
+{
+ size_type calc_size = 0;
+ for (const_iterator it = begin(); it != end(); ++it)
+ {
+ ++calc_size;
+ debug_base::check_key_exists(PB_DS_V2F(*it));
+ _GLIBCXX_DEBUG_ASSERT(lower_bound(PB_DS_V2F(*it)) == it);
+ _GLIBCXX_DEBUG_ASSERT(--upper_bound(PB_DS_V2F(*it)) == it);
+ }
+ _GLIBCXX_DEBUG_ASSERT(calc_size == m_size);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_reverse_iterators() const
+{
+ size_type calc_size = 0;
+ for (const_reverse_iterator it = rbegin(); it != rend(); ++it)
+ {
+ ++calc_size;
+ const_node_pointer p_nd =
+ const_cast<PB_DS_CLASS_C_DEC* >(this)->find_imp(PB_DS_V2F(*it));
+ _GLIBCXX_DEBUG_ASSERT(p_nd == it.m_p_nd);
+ }
+ _GLIBCXX_DEBUG_ASSERT(calc_size == m_size);
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+recursive_count_leafs(const_node_pointer p_nd)
+{
+ if (p_nd == NULL)
+ return (0);
+ if (p_nd->m_type == pat_trie_leaf_node_type)
+ return (1);
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_type == pat_trie_internal_node_type);
+ size_type ret = 0;
+ for (typename internal_node::const_iterator it =
+ static_cast<const_internal_node_pointer>(p_nd)->begin();
+ it != static_cast<const_internal_node_pointer>(p_nd)->end();
+ ++it)
+ ret += recursive_count_leafs(*it);
+ return ret;
+}
+
+#endif
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/erase_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/erase_fn_imps.hpp
new file mode 100644
index 0000000..9098818
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/erase_fn_imps.hpp
@@ -0,0 +1,319 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file erase_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+erase(const_key_reference r_key)
+{
+ node_pointer p_nd = find_imp(r_key);
+ if (p_nd == NULL || p_nd->m_type == pat_trie_internal_node_type)
+ {
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key));
+ return false;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_type == pat_trie_leaf_node_type);
+ if (!synth_e_access_traits::equal_keys(PB_DS_V2F(reinterpret_cast<leaf_pointer>(p_nd)->value()), r_key))
+ {
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key));
+ return false;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key));
+ erase_leaf(static_cast<leaf_pointer>(p_nd));
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return true;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+erase_fixup(internal_node_pointer p_nd)
+{
+ _GLIBCXX_DEBUG_ASSERT(std::distance(p_nd->begin(), p_nd->end()) >= 1);
+ if (std::distance(p_nd->begin(), p_nd->end()) == 1)
+ {
+ node_pointer p_parent = p_nd->m_p_parent;
+ if (p_parent == m_p_head)
+ m_p_head->m_p_parent =* p_nd->begin();
+ else
+ {
+ _GLIBCXX_DEBUG_ASSERT(p_parent->m_type == pat_trie_internal_node_type);
+ node_pointer p_new_child =* p_nd->begin();
+ static_cast<internal_node_pointer>(p_parent)->replace_child(
+ p_new_child,
+ pref_begin(p_new_child),
+ pref_end(p_new_child),
+ this);
+ }
+ (*p_nd->begin())->m_p_parent = p_nd->m_p_parent;
+ p_nd->~internal_node();
+ s_internal_node_allocator.deallocate(p_nd, 1);
+
+ if (p_parent == m_p_head)
+ return;
+
+ _GLIBCXX_DEBUG_ASSERT(p_parent->m_type == pat_trie_internal_node_type);
+ p_nd = static_cast<internal_node_pointer>(p_parent);
+ }
+
+ while (true)
+ {
+ _GLIBCXX_DEBUG_ASSERT(std::distance(p_nd->begin(), p_nd->end()) > 1);
+ p_nd->update_prefixes(this);
+ apply_update(p_nd, (node_update* )this);
+ _GLIBCXX_DEBUG_ONLY(p_nd->assert_valid(this);)
+ if (p_nd->m_p_parent->m_type == pat_trie_head_node_type)
+ return;
+
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_parent->m_type ==
+ pat_trie_internal_node_type);
+
+ p_nd = static_cast<internal_node_pointer>(p_nd->m_p_parent);
+ }
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+actual_erase_leaf(leaf_pointer p_l)
+{
+ _GLIBCXX_DEBUG_ASSERT(m_size > 0);
+ --m_size;
+ _GLIBCXX_DEBUG_ONLY(erase_existing(PB_DS_V2F(p_l->value())));
+ p_l->~leaf();
+ s_leaf_allocator.deallocate(p_l, 1);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+clear()
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ if (empty())
+ return;
+
+ clear_imp(m_p_head->m_p_parent);
+ m_size = 0;
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(debug_base::clear();)
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+clear_imp(node_pointer p_nd)
+{
+ if (p_nd->m_type == pat_trie_internal_node_type)
+ {
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_type == pat_trie_internal_node_type);
+ for (typename internal_node::iterator it =
+ static_cast<internal_node_pointer>(p_nd)->begin();
+ it != static_cast<internal_node_pointer>(p_nd)->end();
+ ++it)
+ {
+ node_pointer p_child =* it;
+ clear_imp(p_child);
+ }
+ s_internal_node_allocator.deallocate(static_cast<internal_node_pointer>(p_nd), 1);
+ return;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_type == pat_trie_leaf_node_type);
+ static_cast<leaf_pointer>(p_nd)->~leaf();
+ s_leaf_allocator.deallocate(static_cast<leaf_pointer>(p_nd), 1);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+erase(const_iterator it)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+
+ if (it == end())
+ return it;
+
+ const_iterator ret_it = it;
+ ++ret_it;
+ _GLIBCXX_DEBUG_ASSERT(it.m_p_nd->m_type == pat_trie_leaf_node_type);
+ erase_leaf(static_cast<leaf_pointer>(it.m_p_nd));
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ return ret_it;
+}
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+erase(iterator it)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+
+ if (it == end())
+ return it;
+ iterator ret_it = it;
+ ++ret_it;
+ _GLIBCXX_DEBUG_ASSERT(it.m_p_nd->m_type == pat_trie_leaf_node_type);
+ erase_leaf(static_cast<leaf_pointer>(it.m_p_nd));
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ return ret_it;
+}
+#endif // #ifdef PB_DS_DATA_TRUE_INDICATOR
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_reverse_iterator
+PB_DS_CLASS_C_DEC::
+erase(const_reverse_iterator it)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+
+ if (it.m_p_nd == m_p_head)
+ return it;
+ const_reverse_iterator ret_it = it;
+ ++ret_it;
+
+ _GLIBCXX_DEBUG_ASSERT(it.m_p_nd->m_type == pat_trie_leaf_node_type);
+ erase_leaf(static_cast<leaf_pointer>(it.m_p_nd));
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ return ret_it;
+}
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::reverse_iterator
+PB_DS_CLASS_C_DEC::
+erase(reverse_iterator it)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+
+ if (it.m_p_nd == m_p_head)
+ return it;
+ reverse_iterator ret_it = it;
+ ++ret_it;
+
+ _GLIBCXX_DEBUG_ASSERT(it.m_p_nd->m_type == pat_trie_leaf_node_type);
+ erase_leaf(static_cast<leaf_pointer>(it.m_p_nd));
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ return ret_it;
+}
+#endif // #ifdef PB_DS_DATA_TRUE_INDICATOR
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+erase_if(Pred pred)
+{
+ size_type num_ersd = 0;
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ iterator it = begin();
+ while (it != end())
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ if (pred(*it))
+ {
+ ++num_ersd;
+ it = erase(it);
+ }
+ else
+ ++it;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return num_ersd;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+erase_leaf(leaf_pointer p_l)
+{
+ update_min_max_for_erased_leaf(p_l);
+ if (p_l->m_p_parent->m_type == pat_trie_head_node_type)
+ {
+ _GLIBCXX_DEBUG_ASSERT(size() == 1);
+ clear();
+ return;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(size() > 1);
+ _GLIBCXX_DEBUG_ASSERT(p_l->m_p_parent->m_type ==
+ pat_trie_internal_node_type);
+
+ internal_node_pointer p_parent =
+ static_cast<internal_node_pointer>(p_l->m_p_parent);
+
+ p_parent->remove_child(p_l);
+ erase_fixup(p_parent);
+ actual_erase_leaf(p_l);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+update_min_max_for_erased_leaf(leaf_pointer p_l)
+{
+ if (m_size == 1)
+ {
+ m_p_head->m_p_min = m_p_head;
+ m_p_head->m_p_max = m_p_head;
+ return;
+ }
+
+ if (p_l == static_cast<const_leaf_pointer>(m_p_head->m_p_min))
+ {
+ iterator it(p_l);
+ ++it;
+ m_p_head->m_p_min = it.m_p_nd;
+ return;
+ }
+
+ if (p_l == static_cast<const_leaf_pointer>(m_p_head->m_p_max))
+ {
+ iterator it(p_l);
+ --it;
+ m_p_head->m_p_max = it.m_p_nd;
+ }
+}
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/find_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/find_fn_imps.hpp
new file mode 100644
index 0000000..2552ead
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/find_fn_imps.hpp
@@ -0,0 +1,269 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file find_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::point_iterator
+PB_DS_CLASS_C_DEC::
+find(const_key_reference r_key)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ node_pointer p_nd = find_imp(r_key);
+
+ if (p_nd == NULL || p_nd->m_type != pat_trie_leaf_node_type)
+ {
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key);)
+ return end();
+ }
+
+ if (synth_e_access_traits::equal_keys(PB_DS_V2F(static_cast<leaf_pointer>(p_nd)->value()), r_key))
+ {
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key));
+ return iterator(p_nd);
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key);)
+ return end();
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_point_iterator
+PB_DS_CLASS_C_DEC::
+find(const_key_reference r_key) const
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ const_node_pointer p_nd = const_cast<PB_DS_CLASS_C_DEC* >(this)->find_imp(r_key);
+
+ if (p_nd == NULL || p_nd->m_type != pat_trie_leaf_node_type)
+ {
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key);)
+ return end();
+ }
+
+ if (synth_e_access_traits::equal_keys(PB_DS_V2F(static_cast<const_leaf_pointer>(p_nd)->value()), r_key))
+ {
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key));
+ return const_iterator(const_cast<node_pointer>(p_nd));
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key);)
+ return end();
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+find_imp(const_key_reference r_key)
+{
+ if (empty())
+ return (NULL);
+
+ typename synth_e_access_traits::const_iterator b_it =
+ synth_e_access_traits::begin(r_key);
+ typename synth_e_access_traits::const_iterator e_it =
+ synth_e_access_traits::end(r_key);
+
+ node_pointer p_nd = m_p_head->m_p_parent;
+ _GLIBCXX_DEBUG_ASSERT(p_nd != NULL);
+
+ while (p_nd->m_type != pat_trie_leaf_node_type)
+ {
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_type == pat_trie_internal_node_type);
+ node_pointer p_next_nd = static_cast<internal_node_pointer>(p_nd)->get_child_node(b_it, e_it, this);
+
+ if (p_next_nd == NULL)
+ return p_nd;
+ p_nd = p_next_nd;
+ }
+ return p_nd;
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+lower_bound_imp(const_key_reference r_key)
+{
+ if (empty())
+ return (m_p_head);
+
+ node_pointer p_nd = m_p_head->m_p_parent;
+ _GLIBCXX_DEBUG_ASSERT(p_nd != NULL);
+
+ typename PB_DS_CLASS_C_DEC::const_e_iterator b_it =
+ synth_e_access_traits::begin(r_key);
+
+ typename PB_DS_CLASS_C_DEC::const_e_iterator e_it =
+ synth_e_access_traits::end(r_key);
+
+ size_type checked_ind = 0;
+ while (true)
+ {
+ if (p_nd->m_type == pat_trie_leaf_node_type)
+ {
+ if (!synth_e_access_traits::cmp_keys(PB_DS_V2F(static_cast<const_leaf_pointer>(p_nd)->value()), r_key))
+ return p_nd;
+ iterator it(p_nd);
+ ++it;
+ return it.m_p_nd;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_type == pat_trie_internal_node_type);
+ const size_type new_checked_ind =
+ static_cast<internal_node_pointer>(p_nd)->get_e_ind();
+
+ p_nd =
+ static_cast<internal_node_pointer>(p_nd)->get_lower_bound_child_node( b_it, e_it, checked_ind, this);
+ checked_ind = new_checked_ind;
+ }
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::point_iterator
+PB_DS_CLASS_C_DEC::
+lower_bound(const_key_reference r_key)
+{ return point_iterator(lower_bound_imp(r_key)); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_point_iterator
+PB_DS_CLASS_C_DEC::
+lower_bound(const_key_reference r_key) const
+{
+ return const_point_iterator(const_cast<PB_DS_CLASS_C_DEC* >(this)->lower_bound_imp(r_key));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::point_iterator
+PB_DS_CLASS_C_DEC::
+upper_bound(const_key_reference r_key)
+{
+ point_iterator l_bound_it = lower_bound(r_key);
+
+ _GLIBCXX_DEBUG_ASSERT(l_bound_it == end() ||
+ !synth_e_access_traits::cmp_keys(PB_DS_V2F(*l_bound_it),
+ r_key));
+
+ if (l_bound_it == end() ||
+ synth_e_access_traits::cmp_keys(r_key, PB_DS_V2F(*l_bound_it)))
+ return l_bound_it;
+
+ return ++l_bound_it;
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_point_iterator
+PB_DS_CLASS_C_DEC::
+upper_bound(const_key_reference r_key) const
+{
+ const_point_iterator l_bound_it = lower_bound(r_key);
+
+ _GLIBCXX_DEBUG_ASSERT(l_bound_it == end() ||
+ !synth_e_access_traits::cmp_keys(PB_DS_V2F(*l_bound_it),
+ r_key));
+
+ if (l_bound_it == end() ||
+ synth_e_access_traits::cmp_keys(r_key, PB_DS_V2F(*l_bound_it)))
+ return l_bound_it;
+ return ++l_bound_it;
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_e_iterator
+PB_DS_CLASS_C_DEC::
+pref_begin(const_node_pointer p_nd)
+{
+ if (p_nd->m_type == pat_trie_leaf_node_type)
+ return (synth_e_access_traits::begin(PB_DS_V2F(static_cast<const_leaf_pointer>(p_nd)->value())));
+
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_type == pat_trie_internal_node_type);
+ return static_cast<const_internal_node_pointer>(p_nd)->pref_b_it();
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_e_iterator
+PB_DS_CLASS_C_DEC::
+pref_end(const_node_pointer p_nd)
+{
+ if (p_nd->m_type == pat_trie_leaf_node_type)
+ return (synth_e_access_traits::end(PB_DS_V2F(static_cast<const_leaf_pointer>(p_nd)->value())));
+
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_type == pat_trie_internal_node_type);
+ return static_cast<const_internal_node_pointer>(p_nd)->pref_e_it();
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_leaf_pointer
+PB_DS_CLASS_C_DEC::
+leftmost_descendant(const_node_pointer p_nd)
+{
+ if (p_nd->m_type == pat_trie_leaf_node_type)
+ return static_cast<const_leaf_pointer>(p_nd);
+ return static_cast<const_internal_node_pointer>(p_nd)->leftmost_descendant();
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::leaf_pointer
+PB_DS_CLASS_C_DEC::
+leftmost_descendant(node_pointer p_nd)
+{
+ if (p_nd->m_type == pat_trie_leaf_node_type)
+ return static_cast<leaf_pointer>(p_nd);
+ return static_cast<internal_node_pointer>(p_nd)->leftmost_descendant();
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_leaf_pointer
+PB_DS_CLASS_C_DEC::
+rightmost_descendant(const_node_pointer p_nd)
+{
+ if (p_nd->m_type == pat_trie_leaf_node_type)
+ return static_cast<const_leaf_pointer>(p_nd);
+ return static_cast<const_internal_node_pointer>(p_nd)->rightmost_descendant();
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::leaf_pointer
+PB_DS_CLASS_C_DEC::
+rightmost_descendant(node_pointer p_nd)
+{
+ if (p_nd->m_type == pat_trie_leaf_node_type)
+ return static_cast<leaf_pointer>(p_nd);
+ return static_cast<internal_node_pointer>(p_nd)->rightmost_descendant();
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/head.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/head.hpp
new file mode 100644
index 0000000..0c73812
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/head.hpp
@@ -0,0 +1,124 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file head.hpp
+ * Contains a leaf for a patricia tree.
+ */
+
+#ifndef PB_DS_PAT_TRIE_IHEAD_HPP
+#define PB_DS_PAT_TRIE_IHEAD_HPP
+
+#include <ext/pb_ds/detail/pat_trie_/node_base.hpp>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+#define PB_DS_CLASS_T_DEC \
+ template<typename Type_Traits, typename E_Access_Traits, \
+ typename Metadata, typename Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ pat_trie_head<Type_Traits, E_Access_Traits, Metadata, Allocator>
+
+#define PB_DS_BASE_C_DEC \
+ pat_trie_node_base<Type_Traits, E_Access_Traits, Metadata, Allocator>
+
+ template<typename Type_Traits,
+ typename E_Access_Traits,
+ typename Metadata,
+ typename Allocator>
+ struct pat_trie_head : public PB_DS_BASE_C_DEC
+ {
+ private:
+ typedef E_Access_Traits e_access_traits;
+
+ typedef
+ typename Allocator::template rebind<
+ e_access_traits>::other::const_pointer
+ const_e_access_traits_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ PB_DS_BASE_C_DEC>::other::pointer
+ node_pointer;
+
+#ifdef _GLIBCXX_DEBUG
+ typedef
+ typename PB_DS_BASE_C_DEC::subtree_debug_info
+ subtree_debug_info;
+#endif
+
+ public:
+ pat_trie_head();
+
+#ifdef _GLIBCXX_DEBUG
+ virtual subtree_debug_info
+ assert_valid_imp(const_e_access_traits_pointer p_traits) const;
+#endif
+
+ public:
+ node_pointer m_p_min;
+
+ node_pointer m_p_max;
+ };
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ pat_trie_head() : PB_DS_BASE_C_DEC(pat_trie_head_node_type)
+ { }
+
+#ifdef _GLIBCXX_DEBUG
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::subtree_debug_info
+ PB_DS_CLASS_C_DEC::
+ assert_valid_imp(const_e_access_traits_pointer /*p_traits*/) const
+ {
+ _GLIBCXX_DEBUG_ASSERT(false);
+ return subtree_debug_info();
+ }
+#endif
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_BASE_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/info_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/info_fn_imps.hpp
new file mode 100644
index 0000000..81d7096
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/info_fn_imps.hpp
@@ -0,0 +1,58 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file info_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+empty() const
+{ return (m_size == 0); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+size() const
+{ return m_size; }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+max_size() const
+{ return s_internal_node_allocator.max_size(); }
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/insert_join_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/insert_join_fn_imps.hpp
new file mode 100644
index 0000000..e604974
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/insert_join_fn_imps.hpp
@@ -0,0 +1,465 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file insert_join_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+join(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid(););
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid(););
+ split_join_branch_bag bag;
+ if (!join_prep(other, bag))
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid(););
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid(););
+ return;
+ }
+
+ m_p_head->m_p_parent = rec_join(m_p_head->m_p_parent,
+ other.m_p_head->m_p_parent, 0, bag);
+
+ m_p_head->m_p_parent->m_p_parent = m_p_head;
+ m_size += other.m_size;
+ other.initialize();
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid(););
+ m_p_head->m_p_min = leftmost_descendant(m_p_head->m_p_parent);
+ m_p_head->m_p_max = rightmost_descendant(m_p_head->m_p_parent);
+ _GLIBCXX_DEBUG_ONLY(assert_valid(););
+}
+
+PB_DS_CLASS_T_DEC
+bool
+PB_DS_CLASS_C_DEC::
+join_prep(PB_DS_CLASS_C_DEC& other, split_join_branch_bag& r_bag)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ if (other.m_size == 0)
+ return false;
+
+ if (m_size == 0)
+ {
+ value_swap(other);
+ return false;
+ }
+
+ const bool greater = synth_e_access_traits::cmp_keys(PB_DS_V2F(static_cast<const_leaf_pointer>(
+ m_p_head->m_p_max)->value()),PB_DS_V2F(static_cast<const_leaf_pointer>(
+ other.m_p_head->m_p_min)->value()));
+
+ const bool lesser = synth_e_access_traits::cmp_keys(PB_DS_V2F(static_cast<const_leaf_pointer>(
+ other.m_p_head->m_p_max)->value()),PB_DS_V2F(static_cast<const_leaf_pointer>(m_p_head->m_p_min)->value()));
+
+ if (!greater && !lesser)
+ __throw_join_error();
+
+ rec_join_prep(m_p_head->m_p_parent, other.m_p_head->m_p_parent, r_bag);
+ _GLIBCXX_DEBUG_ONLY(debug_base::join(other);)
+ return true;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+rec_join_prep(const_node_pointer p_l, const_node_pointer p_r, split_join_branch_bag& r_bag)
+{
+ if (p_l->m_type == pat_trie_leaf_node_type)
+ {
+ if (p_r->m_type == pat_trie_leaf_node_type)
+ {
+ rec_join_prep(static_cast<const_leaf_pointer>(p_l),
+ static_cast<const_leaf_pointer>(p_r), r_bag);
+ return;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(p_r->m_type == pat_trie_internal_node_type);
+ rec_join_prep(static_cast<const_leaf_pointer>(p_l),
+ static_cast<const_internal_node_pointer>(p_r), r_bag);
+ return;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(p_l->m_type == pat_trie_internal_node_type);
+ if (p_r->m_type == pat_trie_leaf_node_type)
+ {
+ rec_join_prep(static_cast<const_internal_node_pointer>(p_l),
+ static_cast<const_leaf_pointer>(p_r), r_bag);
+ return;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(p_r->m_type == pat_trie_internal_node_type);
+
+ rec_join_prep(static_cast<const_internal_node_pointer>(p_l),
+ static_cast<const_internal_node_pointer>(p_r), r_bag);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+rec_join_prep(const_leaf_pointer /*p_l*/, const_leaf_pointer /*p_r*/,
+ split_join_branch_bag& r_bag)
+{ r_bag.add_branch(); }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+rec_join_prep(const_leaf_pointer /*p_l*/, const_internal_node_pointer /*p_r*/,
+ split_join_branch_bag& r_bag)
+{ r_bag.add_branch(); }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+rec_join_prep(const_internal_node_pointer /*p_l*/, const_leaf_pointer /*p_r*/,
+ split_join_branch_bag& r_bag)
+{ r_bag.add_branch(); }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+rec_join_prep(const_internal_node_pointer p_l, const_internal_node_pointer p_r,
+ split_join_branch_bag& r_bag)
+{
+ if (p_l->get_e_ind() == p_r->get_e_ind() &&
+ synth_e_access_traits::equal_prefixes(p_l->pref_b_it(), p_l->pref_e_it(),
+ p_r->pref_b_it(), p_r->pref_e_it()))
+ {
+ for (typename internal_node::const_iterator it = p_r->begin();
+ it != p_r->end(); ++ it)
+ {
+ const_node_pointer p_l_join_child = p_l->get_join_child(*it, this);
+ if (p_l_join_child != NULL)
+ rec_join_prep(p_l_join_child, * it, r_bag);
+ }
+ return;
+ }
+
+ if (p_r->get_e_ind() < p_l->get_e_ind() &&
+ p_r->should_be_mine(p_l->pref_b_it(), p_l->pref_e_it(), 0, this))
+ {
+ const_node_pointer p_r_join_child = p_r->get_join_child(p_l, this);
+ if (p_r_join_child != NULL)
+ rec_join_prep(p_r_join_child, p_l, r_bag);
+ return;
+ }
+
+ if (p_r->get_e_ind() < p_l->get_e_ind() &&
+ p_r->should_be_mine(p_l->pref_b_it(), p_l->pref_e_it(), 0, this))
+ {
+ const_node_pointer p_r_join_child = p_r->get_join_child(p_l, this);
+ if (p_r_join_child != NULL)
+ rec_join_prep(p_r_join_child, p_l, r_bag);
+ return;
+ }
+ r_bag.add_branch();
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+rec_join(node_pointer p_l, node_pointer p_r, size_type checked_ind, split_join_branch_bag& r_bag)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_r != NULL);
+ if (p_l == NULL)
+ {
+ apply_update(p_r, (node_update* )this);
+ return (p_r);
+ }
+
+ if (p_l->m_type == pat_trie_leaf_node_type)
+ {
+ if (p_r->m_type == pat_trie_leaf_node_type)
+ {
+ node_pointer p_ret = rec_join(static_cast<leaf_pointer>(p_l),
+ static_cast<leaf_pointer>(p_r), r_bag);
+ apply_update(p_ret, (node_update* )this);
+ return p_ret;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(p_r->m_type == pat_trie_internal_node_type);
+ node_pointer p_ret = rec_join(static_cast<leaf_pointer>(p_l),
+ static_cast<internal_node_pointer>(p_r),
+ checked_ind, r_bag);
+ apply_update(p_ret, (node_update* )this);
+ return p_ret;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(p_l->m_type == pat_trie_internal_node_type);
+ if (p_r->m_type == pat_trie_leaf_node_type)
+ {
+ node_pointer p_ret = rec_join(static_cast<internal_node_pointer>(p_l),
+ static_cast<leaf_pointer>(p_r),
+ checked_ind, r_bag);
+ apply_update(p_ret, (node_update* )this);
+ return p_ret;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(p_r->m_type == pat_trie_internal_node_type);
+ node_pointer p_ret = rec_join(static_cast<internal_node_pointer>(p_l),
+ static_cast<internal_node_pointer>(p_r),
+ r_bag);
+
+ apply_update(p_ret, (node_update* )this);
+ return p_ret;
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+rec_join(leaf_pointer p_l, leaf_pointer p_r, split_join_branch_bag& r_bag)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_r != NULL);
+ if (p_l == NULL)
+ return (p_r);
+ node_pointer p_ret = insert_branch(p_l, p_r, r_bag);
+ _GLIBCXX_DEBUG_ASSERT(recursive_count_leafs(p_ret) == 2);
+ return p_ret;
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+rec_join(leaf_pointer p_l, internal_node_pointer p_r, size_type checked_ind,
+ split_join_branch_bag& r_bag)
+{
+#ifdef _GLIBCXX_DEBUG
+ const size_type lhs_leafs = recursive_count_leafs(p_l);
+ const size_type rhs_leafs = recursive_count_leafs(p_r);
+#endif
+
+ _GLIBCXX_DEBUG_ASSERT(p_r != NULL);
+ node_pointer p_ret = rec_join(p_r, p_l, checked_ind, r_bag);
+ _GLIBCXX_DEBUG_ASSERT(recursive_count_leafs(p_ret) == lhs_leafs + rhs_leafs);
+ return p_ret;
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+rec_join(internal_node_pointer p_l, leaf_pointer p_r, size_type checked_ind, split_join_branch_bag& r_bag)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_l != NULL);
+ _GLIBCXX_DEBUG_ASSERT(p_r != NULL);
+
+#ifdef _GLIBCXX_DEBUG
+ const size_type lhs_leafs = recursive_count_leafs(p_l);
+ const size_type rhs_leafs = recursive_count_leafs(p_r);
+#endif
+
+ if (!p_l->should_be_mine(pref_begin(p_r), pref_end(p_r), checked_ind, this))
+ {
+ node_pointer p_ret = insert_branch(p_l, p_r, r_bag);
+ _GLIBCXX_DEBUG_ONLY(p_ret->assert_valid(this);)
+ _GLIBCXX_DEBUG_ASSERT(recursive_count_leafs(p_ret) ==
+ lhs_leafs + rhs_leafs);
+ return p_ret;
+ }
+
+ node_pointer p_pot_child = p_l->add_child(p_r, pref_begin(p_r),
+ pref_end(p_r), this);
+ if (p_pot_child != p_r)
+ {
+ node_pointer p_new_child = rec_join(p_pot_child, p_r, p_l->get_e_ind(),
+ r_bag);
+
+ p_l->replace_child(p_new_child, pref_begin(p_new_child),
+ pref_end(p_new_child), this);
+ }
+
+ _GLIBCXX_DEBUG_ONLY(p_l->assert_valid(this));
+ _GLIBCXX_DEBUG_ASSERT(recursive_count_leafs(p_l) == lhs_leafs + rhs_leafs);
+ return p_l;
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+rec_join(internal_node_pointer p_l, internal_node_pointer p_r, split_join_branch_bag& r_bag)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_l != NULL);
+ _GLIBCXX_DEBUG_ASSERT(p_r != NULL);
+
+#ifdef _GLIBCXX_DEBUG
+ const size_type lhs_leafs = recursive_count_leafs(p_l);
+ const size_type rhs_leafs = recursive_count_leafs(p_r);
+#endif
+
+ if (p_l->get_e_ind() == p_r->get_e_ind() &&
+ synth_e_access_traits::equal_prefixes(p_l->pref_b_it(), p_l->pref_e_it(),
+ p_r->pref_b_it(), p_r->pref_e_it()))
+ {
+ for (typename internal_node::iterator it = p_r->begin();
+ it != p_r->end(); ++ it)
+ {
+ node_pointer p_new_child = rec_join(p_l->get_join_child(*it, this),
+ * it, 0, r_bag);
+ p_l->replace_child(p_new_child, pref_begin(p_new_child),
+ pref_end(p_new_child), this);
+ }
+
+ p_r->~internal_node();
+ s_internal_node_allocator.deallocate(p_r, 1);
+ _GLIBCXX_DEBUG_ONLY(p_l->assert_valid(this);)
+ _GLIBCXX_DEBUG_ASSERT(recursive_count_leafs(p_l) == lhs_leafs + rhs_leafs);
+ return p_l;
+ }
+
+ if (p_l->get_e_ind() < p_r->get_e_ind() &&
+ p_l->should_be_mine(p_r->pref_b_it(), p_r->pref_e_it(), 0, this))
+ {
+ node_pointer p_new_child = rec_join(p_l->get_join_child(p_r, this),
+ p_r, 0, r_bag);
+ p_l->replace_child(p_new_child, pref_begin(p_new_child),
+ pref_end(p_new_child), this);
+ _GLIBCXX_DEBUG_ONLY(p_l->assert_valid(this);)
+ return p_l;
+ }
+
+ if (p_r->get_e_ind() < p_l->get_e_ind() &&
+ p_r->should_be_mine(p_l->pref_b_it(), p_l->pref_e_it(), 0, this))
+ {
+ node_pointer p_new_child = rec_join(p_r->get_join_child(p_l, this), p_l,
+ 0, r_bag);
+
+ p_r->replace_child(p_new_child, pref_begin(p_new_child),
+ pref_end(p_new_child), this);
+
+ _GLIBCXX_DEBUG_ONLY(p_r->assert_valid(this);)
+ _GLIBCXX_DEBUG_ASSERT(recursive_count_leafs(p_r) == lhs_leafs + rhs_leafs);
+ return p_r;
+ }
+
+ node_pointer p_ret = insert_branch(p_l, p_r, r_bag);
+ _GLIBCXX_DEBUG_ONLY(p_ret->assert_valid(this);)
+ _GLIBCXX_DEBUG_ASSERT(recursive_count_leafs(p_ret) == lhs_leafs + rhs_leafs);
+ return p_ret;
+}
+
+PB_DS_CLASS_T_DEC
+inline std::pair<typename PB_DS_CLASS_C_DEC::iterator, bool>
+PB_DS_CLASS_C_DEC::
+insert(const_reference r_val)
+{
+ node_pointer p_lf = find_imp(PB_DS_V2F(r_val));
+ if (p_lf != NULL && p_lf->m_type == pat_trie_leaf_node_type &&
+ synth_e_access_traits::equal_keys(PB_DS_V2F(static_cast<leaf_pointer>(p_lf)->value()), PB_DS_V2F(r_val)))
+ {
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(PB_DS_V2F(r_val)));
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return std::make_pair(iterator(p_lf), false);
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(PB_DS_V2F(r_val)));
+
+ leaf_pointer p_new_lf = s_leaf_allocator.allocate(1);
+ cond_dealtor cond(p_new_lf);
+
+ new (p_new_lf) leaf(r_val);
+ apply_update(p_new_lf, (node_update* )this);
+ cond.set_call_destructor();
+ split_join_branch_bag bag;
+ bag.add_branch();
+ m_p_head->m_p_parent = rec_join(m_p_head->m_p_parent, p_new_lf, 0, bag);
+ m_p_head->m_p_parent->m_p_parent = m_p_head;
+ cond.set_no_action_dtor();
+ ++m_size;
+ update_min_max_for_inserted_leaf(p_new_lf);
+ _GLIBCXX_DEBUG_ONLY(debug_base::insert_new(PB_DS_V2F(r_val));)
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return std::make_pair(point_iterator(p_new_lf), true);
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+keys_diff_ind(typename e_access_traits::const_iterator b_l, typename e_access_traits::const_iterator e_l, typename e_access_traits::const_iterator b_r, typename e_access_traits::const_iterator e_r)
+{
+ size_type diff_pos = 0;
+ while (b_l != e_l)
+ {
+ if (b_r == e_r)
+ return (diff_pos);
+ if (e_access_traits::e_pos(*b_l) != e_access_traits::e_pos(*b_r))
+ return (diff_pos);
+ ++b_l;
+ ++b_r;
+ ++diff_pos;
+ }
+ _GLIBCXX_DEBUG_ASSERT(b_r != e_r);
+ return diff_pos;
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::internal_node_pointer
+PB_DS_CLASS_C_DEC::
+insert_branch(node_pointer p_l, node_pointer p_r, split_join_branch_bag& r_bag)
+{
+ typename synth_e_access_traits::const_iterator left_b_it = pref_begin(p_l);
+ typename synth_e_access_traits::const_iterator left_e_it = pref_end(p_l);
+ typename synth_e_access_traits::const_iterator right_b_it = pref_begin(p_r);
+ typename synth_e_access_traits::const_iterator right_e_it = pref_end(p_r);
+
+ const size_type diff_ind = keys_diff_ind(left_b_it, left_e_it,
+ right_b_it, right_e_it);
+
+ internal_node_pointer p_new_nd = r_bag.get_branch();
+ new (p_new_nd) internal_node(diff_ind, left_b_it);
+ p_new_nd->add_child(p_l, left_b_it, left_e_it, this);
+ p_new_nd->add_child(p_r, right_b_it, right_e_it, this);
+ p_l->m_p_parent = p_new_nd;
+ p_r->m_p_parent = p_new_nd;
+ _GLIBCXX_DEBUG_ONLY(p_new_nd->assert_valid(this);)
+ return (p_new_nd);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+update_min_max_for_inserted_leaf(leaf_pointer p_new_lf)
+{
+ if (m_p_head->m_p_min == m_p_head ||
+ synth_e_access_traits::cmp_keys(PB_DS_V2F(p_new_lf->value()),
+ PB_DS_V2F(static_cast<const_leaf_pointer>(m_p_head->m_p_min)->value())))
+ m_p_head->m_p_min = p_new_lf;
+
+ if (m_p_head->m_p_max == m_p_head ||
+ synth_e_access_traits::cmp_keys(PB_DS_V2F(static_cast<const_leaf_pointer>(m_p_head->m_p_max)->value()), PB_DS_V2F(p_new_lf->value())))
+ m_p_head->m_p_max = p_new_lf;
+}
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/internal_node.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/internal_node.hpp
new file mode 100644
index 0000000..bf2f429
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/internal_node.hpp
@@ -0,0 +1,599 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file internal_node.hpp
+ * Contains an internal PB_DS_BASE_C_DEC for a patricia tree.
+ */
+
+#ifndef PB_DS_PAT_TRIE_INTERNAL_NODE_HPP
+#define PB_DS_PAT_TRIE_INTERNAL_NODE_HPP
+
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+#define PB_DS_CLASS_T_DEC \
+ template<typename Type_Traits, typename E_Access_Traits, \
+ typename Metadata, typename Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ pat_trie_internal_node<Type_Traits, E_Access_Traits, Metadata, Allocator>
+
+#define PB_DS_BASE_C_DEC \
+ pat_trie_node_base<Type_Traits, E_Access_Traits, Metadata, Allocator>
+
+#define PB_DS_LEAF_C_DEC \
+ pat_trie_leaf<Type_Traits, E_Access_Traits, Metadata, Allocator>
+
+ template<typename Type_Traits,
+ typename E_Access_Traits,
+ typename Metadata,
+ typename Allocator>
+ struct pat_trie_internal_node : public PB_DS_BASE_C_DEC
+ {
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+ typedef Type_Traits type_traits;
+ typedef typename type_traits::value_type value_type;
+ typedef typename Allocator::size_type size_type;
+
+ typedef E_Access_Traits e_access_traits;
+ typedef typename e_access_traits::const_iterator const_e_iterator;
+ typedef typename Allocator::template rebind<e_access_traits>::other access_rebind;
+ typedef typename access_rebind::const_pointer const_e_access_traits_pointer;
+
+ typedef typename Allocator::template rebind<base_type>::other base_rebind;
+ typedef typename base_rebind::pointer node_pointer;
+ typedef typename base_rebind::const_pointer const_node_pointer;
+
+ typedef PB_DS_LEAF_C_DEC leaf;
+ typedef typename Allocator::template rebind<leaf>::other leaf_rebind;
+ typedef typename leaf_rebind::pointer leaf_pointer;
+ typedef typename leaf_rebind::const_pointer const_leaf_pointer;
+
+ typedef typename Allocator::template rebind<pat_trie_internal_node>::other internal_node_rebind;
+ typedef typename internal_node_rebind::pointer internal_node_pointer;
+ typedef typename internal_node_rebind::const_pointer const_internal_node_pointer;
+
+#ifdef _GLIBCXX_DEBUG
+ typedef typename base_type::subtree_debug_info subtree_debug_info;
+
+ virtual subtree_debug_info
+ assert_valid_imp(const_e_access_traits_pointer) const;
+#endif
+
+ inline size_type
+ get_pref_pos(const_e_iterator, const_e_iterator,
+ const_e_access_traits_pointer) const;
+
+ public:
+ typedef typename Allocator::template rebind<node_pointer>::other node_pointer_rebind;
+ typedef typename node_pointer_rebind::pointer node_pointer_pointer;
+ typedef typename node_pointer_rebind::reference node_pointer_reference;
+
+ enum
+ {
+ arr_size = E_Access_Traits::max_size + 1
+ };
+ PB_DS_STATIC_ASSERT(min_arr_size, arr_size >= 2);
+
+#include <ext/pb_ds/detail/pat_trie_/const_child_iterator.hpp>
+#include <ext/pb_ds/detail/pat_trie_/child_iterator.hpp>
+
+ pat_trie_internal_node(size_type, const const_e_iterator);
+
+ void
+ update_prefixes(const_e_access_traits_pointer);
+
+ const_iterator
+ begin() const;
+
+ iterator
+ begin();
+
+ const_iterator
+ end() const;
+
+ iterator
+ end();
+
+ inline node_pointer
+ get_child_node(const_e_iterator, const_e_iterator,
+ const_e_access_traits_pointer);
+
+ inline const_node_pointer
+ get_child_node(const_e_iterator, const_e_iterator,
+ const_e_access_traits_pointer) const;
+
+ inline iterator
+ get_child_it(const_e_iterator, const_e_iterator,
+ const_e_access_traits_pointer);
+
+ inline node_pointer
+ get_lower_bound_child_node(const_e_iterator, const_e_iterator,
+ size_type, const_e_access_traits_pointer);
+
+ inline node_pointer
+ add_child(node_pointer, const_e_iterator, const_e_iterator,
+ const_e_access_traits_pointer);
+
+ inline const_node_pointer
+ get_join_child(const_node_pointer, const_e_access_traits_pointer) const;
+
+ inline node_pointer
+ get_join_child(node_pointer, const_e_access_traits_pointer);
+
+ void
+ remove_child(node_pointer p_nd);
+
+ iterator
+ remove_child(iterator it);
+
+ void
+ replace_child(node_pointer, const_e_iterator, const_e_iterator,
+ const_e_access_traits_pointer);
+
+ inline const_e_iterator
+ pref_b_it() const;
+
+ inline const_e_iterator
+ pref_e_it() const;
+
+ inline size_type
+ get_e_ind() const;
+
+ bool
+ should_be_mine(const_e_iterator, const_e_iterator, size_type,
+ const_e_access_traits_pointer) const;
+
+ leaf_pointer
+ leftmost_descendant();
+
+ const_leaf_pointer
+ leftmost_descendant() const;
+
+ leaf_pointer
+ rightmost_descendant();
+
+ const_leaf_pointer
+ rightmost_descendant() const;
+
+#ifdef _GLIBCXX_DEBUG
+ size_type
+ e_ind() const;
+#endif
+
+ private:
+ pat_trie_internal_node(const pat_trie_internal_node&);
+
+ size_type
+ get_begin_pos() const;
+
+ const size_type m_e_ind;
+ const_e_iterator m_pref_b_it;
+ const_e_iterator m_pref_e_it;
+ node_pointer m_a_p_children[arr_size];
+ static leaf_rebind s_leaf_alloc;
+ static internal_node_rebind s_internal_node_alloc;
+ };
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::leaf_rebind
+ PB_DS_CLASS_C_DEC::s_leaf_alloc;
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::internal_node_rebind
+ PB_DS_CLASS_C_DEC::s_internal_node_alloc;
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::size_type
+ PB_DS_CLASS_C_DEC::
+ get_pref_pos(const_e_iterator b_it, const_e_iterator e_it,
+ const_e_access_traits_pointer p_traits) const
+ {
+ if (static_cast<size_t>(std::distance(b_it, e_it)) <= m_e_ind)
+ return 0;
+ std::advance(b_it, m_e_ind);
+ return 1 + p_traits->e_pos(*b_it);
+ }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ pat_trie_internal_node(size_type len, const const_e_iterator it) :
+ PB_DS_BASE_C_DEC(pat_trie_internal_node_type),
+ m_e_ind(len), m_pref_b_it(it), m_pref_e_it(it)
+ {
+ std::advance(m_pref_e_it, m_e_ind);
+ std::fill(m_a_p_children, m_a_p_children + arr_size,
+ static_cast<node_pointer>(NULL));
+ }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ update_prefixes(const_e_access_traits_pointer p_traits)
+ {
+ node_pointer p_first = *begin();
+ if (p_first->m_type == pat_trie_leaf_node_type)
+ {
+ const_leaf_pointer p = static_cast<const_leaf_pointer>(p_first);
+ m_pref_b_it = p_traits->begin(e_access_traits::extract_key(p->value()));
+ }
+ else
+ {
+ _GLIBCXX_DEBUG_ASSERT(p_first->m_type == pat_trie_internal_node_type);
+ m_pref_b_it = static_cast<internal_node_pointer>(p_first)->pref_b_it();
+ }
+ m_pref_e_it = m_pref_b_it;
+ std::advance(m_pref_e_it, m_e_ind);
+ }
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::const_iterator
+ PB_DS_CLASS_C_DEC::
+ begin() const
+ {
+ typedef node_pointer_pointer pointer_type;
+ pointer_type p = const_cast<pointer_type>(m_a_p_children);
+ return const_iterator(p + get_begin_pos(), p + arr_size);
+ }
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::iterator
+ PB_DS_CLASS_C_DEC::
+ begin()
+ {
+ return iterator(m_a_p_children + get_begin_pos(),
+ m_a_p_children + arr_size);
+ }
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::const_iterator
+ PB_DS_CLASS_C_DEC::
+ end() const
+ {
+ typedef node_pointer_pointer pointer_type;
+ pointer_type p = const_cast<pointer_type>(m_a_p_children) + arr_size;
+ return const_iterator(p, p);
+ }
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::iterator
+ PB_DS_CLASS_C_DEC::
+ end()
+ { return iterator(m_a_p_children + arr_size, m_a_p_children + arr_size); }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::node_pointer
+ PB_DS_CLASS_C_DEC::
+ get_child_node(const_e_iterator b_it, const_e_iterator e_it,
+ const_e_access_traits_pointer p_traits)
+ {
+ const size_type i = get_pref_pos(b_it, e_it, p_traits);
+ _GLIBCXX_DEBUG_ASSERT(i < arr_size);
+ return m_a_p_children[i];
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::iterator
+ PB_DS_CLASS_C_DEC::
+ get_child_it(const_e_iterator b_it, const_e_iterator e_it,
+ const_e_access_traits_pointer p_traits)
+ {
+ const size_type i = get_pref_pos(b_it, e_it, p_traits);
+ _GLIBCXX_DEBUG_ASSERT(i < arr_size);
+ _GLIBCXX_DEBUG_ASSERT(m_a_p_children[i] != NULL);
+ return iterator(m_a_p_children + i, m_a_p_children + i);
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::const_node_pointer
+ PB_DS_CLASS_C_DEC::
+ get_child_node(const_e_iterator b_it, const_e_iterator e_it,
+ const_e_access_traits_pointer p_traits) const
+ { return const_cast<node_pointer>(get_child_node(b_it, e_it, p_traits)); }
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::node_pointer
+ PB_DS_CLASS_C_DEC::
+ get_lower_bound_child_node(const_e_iterator b_it, const_e_iterator e_it,
+ size_type checked_ind,
+ const_e_access_traits_pointer p_traits)
+ {
+ if (!should_be_mine(b_it, e_it, checked_ind, p_traits))
+ {
+ if (p_traits->cmp_prefixes(b_it, e_it, m_pref_b_it, m_pref_e_it, true))
+ return leftmost_descendant();
+ return rightmost_descendant();
+ }
+
+ size_type i = get_pref_pos(b_it, e_it, p_traits);
+ _GLIBCXX_DEBUG_ASSERT(i < arr_size);
+
+ if (m_a_p_children[i] != NULL)
+ return m_a_p_children[i];
+
+ while (++i < arr_size)
+ if (m_a_p_children[i] != NULL)
+ {
+ if (m_a_p_children[i]->m_type == pat_trie_leaf_node_type)
+ return m_a_p_children[i];
+
+ _GLIBCXX_DEBUG_ASSERT(m_a_p_children[i]->m_type == pat_trie_internal_node_type);
+
+ return static_cast<internal_node_pointer>(m_a_p_children[i])->leftmost_descendant();
+ }
+
+ return rightmost_descendant();
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::node_pointer
+ PB_DS_CLASS_C_DEC::
+ add_child(node_pointer p_nd, const_e_iterator b_it, const_e_iterator e_it,
+ const_e_access_traits_pointer p_traits)
+ {
+ const size_type i = get_pref_pos(b_it, e_it, p_traits);
+ _GLIBCXX_DEBUG_ASSERT(i < arr_size);
+ if (m_a_p_children[i] == NULL)
+ {
+ m_a_p_children[i] = p_nd;
+ p_nd->m_p_parent = this;
+ return p_nd;
+ }
+ return m_a_p_children[i];
+ }
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::const_node_pointer
+ PB_DS_CLASS_C_DEC::
+ get_join_child(const_node_pointer p_nd, const_e_access_traits_pointer p_traits) const
+ {
+ node_pointer p = const_cast<node_pointer>(p_nd);
+ return const_cast<internal_node_pointer>(this)->get_join_child(p, p_traits);
+ }
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::node_pointer
+ PB_DS_CLASS_C_DEC::
+ get_join_child(node_pointer p_nd, const_e_access_traits_pointer p_traits)
+ {
+ size_type i;
+ const_e_iterator b_it;
+ const_e_iterator e_it;
+ if (p_nd->m_type == pat_trie_leaf_node_type)
+ {
+ typename Type_Traits::const_key_reference r_key =
+ e_access_traits::extract_key(static_cast<const_leaf_pointer>(p_nd)->value());
+
+ b_it = p_traits->begin(r_key);
+ e_it = p_traits->end(r_key);
+ }
+ else
+ {
+ b_it = static_cast<internal_node_pointer>(p_nd)->pref_b_it();
+ e_it = static_cast<internal_node_pointer>(p_nd)->pref_e_it();
+ }
+ i = get_pref_pos(b_it, e_it, p_traits);
+ _GLIBCXX_DEBUG_ASSERT(i < arr_size);
+ return m_a_p_children[i];
+ }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ remove_child(node_pointer p_nd)
+ {
+ size_type i = 0;
+ for (; i < arr_size; ++i)
+ if (m_a_p_children[i] == p_nd)
+ {
+ m_a_p_children[i] = NULL;
+ return;
+ }
+ _GLIBCXX_DEBUG_ASSERT(i != arr_size);
+ }
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::iterator
+ PB_DS_CLASS_C_DEC::
+ remove_child(iterator it)
+ {
+ iterator ret = it;
+ ++ret;
+ * it.m_p_p_cur = NULL;
+ return ret;
+ }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ replace_child(node_pointer p_nd, const_e_iterator b_it,
+ const_e_iterator e_it,
+ const_e_access_traits_pointer p_traits)
+ {
+ const size_type i = get_pref_pos(b_it, e_it, p_traits);
+ _GLIBCXX_DEBUG_ASSERT(i < arr_size);
+ m_a_p_children[i] = p_nd;
+ p_nd->m_p_parent = this;
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::const_e_iterator
+ PB_DS_CLASS_C_DEC::
+ pref_b_it() const
+ { return m_pref_b_it; }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::const_e_iterator
+ PB_DS_CLASS_C_DEC::
+ pref_e_it() const
+ { return m_pref_e_it; }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::size_type
+ PB_DS_CLASS_C_DEC::
+ get_e_ind() const
+ { return m_e_ind; }
+
+ PB_DS_CLASS_T_DEC
+ bool
+ PB_DS_CLASS_C_DEC::
+ should_be_mine(const_e_iterator b_it, const_e_iterator e_it,
+ size_type checked_ind,
+ const_e_access_traits_pointer p_traits) const
+ {
+ if (m_e_ind == 0)
+ return true;
+
+ const size_type num_es = std::distance(b_it, e_it);
+ if (num_es < m_e_ind)
+ return false;
+
+ const_e_iterator key_b_it = b_it;
+ std::advance(key_b_it, checked_ind);
+ const_e_iterator key_e_it = b_it;
+ std::advance(key_e_it, m_e_ind);
+
+ const_e_iterator value_b_it = m_pref_b_it;
+ std::advance(value_b_it, checked_ind);
+ const_e_iterator value_e_it = m_pref_b_it;
+ std::advance(value_e_it, m_e_ind);
+
+ return p_traits->equal_prefixes(key_b_it, key_e_it, value_b_it,
+ value_e_it);
+ }
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::leaf_pointer
+ PB_DS_CLASS_C_DEC::
+ leftmost_descendant()
+ {
+ node_pointer p_pot =* begin();
+ if (p_pot->m_type == pat_trie_leaf_node_type)
+ return (static_cast<leaf_pointer>(p_pot));
+ _GLIBCXX_DEBUG_ASSERT(p_pot->m_type == pat_trie_internal_node_type);
+ return static_cast<internal_node_pointer>(p_pot)->leftmost_descendant();
+ }
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::const_leaf_pointer
+ PB_DS_CLASS_C_DEC::
+ leftmost_descendant() const
+ {
+ return const_cast<internal_node_pointer>(this)->leftmost_descendant();
+ }
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::leaf_pointer
+ PB_DS_CLASS_C_DEC::
+ rightmost_descendant()
+ {
+ const size_type num_children = std::distance(begin(), end());
+ _GLIBCXX_DEBUG_ASSERT(num_children >= 2);
+
+ iterator it = begin();
+ std::advance(it, num_children - 1);
+ node_pointer p_pot =* it;
+ if (p_pot->m_type == pat_trie_leaf_node_type)
+ return static_cast<leaf_pointer>(p_pot);
+ _GLIBCXX_DEBUG_ASSERT(p_pot->m_type == pat_trie_internal_node_type);
+ return static_cast<internal_node_pointer>(p_pot)->rightmost_descendant();
+ }
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::const_leaf_pointer
+ PB_DS_CLASS_C_DEC::
+ rightmost_descendant() const
+ {
+ return const_cast<internal_node_pointer>(this)->rightmost_descendant();
+ }
+
+#ifdef _GLIBCXX_DEBUG
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::size_type
+ PB_DS_CLASS_C_DEC::
+ e_ind() const
+ { return m_e_ind; }
+#endif
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::size_type
+ PB_DS_CLASS_C_DEC::
+ get_begin_pos() const
+ {
+ size_type i;
+ for (i = 0; i < arr_size && m_a_p_children[i] == NULL; ++i)
+ ;
+ return i;
+ }
+
+#ifdef _GLIBCXX_DEBUG
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::subtree_debug_info
+ PB_DS_CLASS_C_DEC::
+ assert_valid_imp(const_e_access_traits_pointer p_traits) const
+ {
+ _GLIBCXX_DEBUG_ASSERT(base_type::m_type == pat_trie_internal_node_type);
+ _GLIBCXX_DEBUG_ASSERT(static_cast<size_type>(std::distance(pref_b_it(), pref_e_it())) == m_e_ind);
+ _GLIBCXX_DEBUG_ASSERT(std::distance(begin(), end()) >= 2);
+
+ for (typename pat_trie_internal_node::const_iterator it = begin();
+ it != end(); ++it)
+ {
+ const_node_pointer p_nd =* it;
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_parent == this);
+ subtree_debug_info child_ret = p_nd->assert_valid_imp(p_traits);
+
+ _GLIBCXX_DEBUG_ASSERT(static_cast<size_type>(std::distance(child_ret.first, child_ret.second)) >= m_e_ind);
+ _GLIBCXX_DEBUG_ASSERT(should_be_mine(child_ret.first, child_ret.second, 0, p_traits));
+ _GLIBCXX_DEBUG_ASSERT(get_pref_pos(child_ret.first, child_ret.second, p_traits) == static_cast<size_type>(it.m_p_p_cur - m_a_p_children));
+ }
+ return std::make_pair(pref_b_it(), pref_e_it());
+ }
+#endif
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_BASE_C_DEC
+#undef PB_DS_LEAF_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/iterators_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/iterators_fn_imps.hpp
new file mode 100644
index 0000000..9902d96
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/iterators_fn_imps.hpp
@@ -0,0 +1,120 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file iterators_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+begin()
+{ return iterator(m_p_head->m_p_min); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+begin() const
+{ return const_iterator(m_p_head->m_p_min); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+end()
+{ return iterator(m_p_head); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+end() const
+{ return const_iterator(m_p_head); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_reverse_iterator
+PB_DS_CLASS_C_DEC::
+rbegin() const
+{
+ if (empty())
+ return rend();
+ return --end();
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::reverse_iterator
+PB_DS_CLASS_C_DEC::
+rbegin()
+{
+ if (empty())
+ return rend();
+ return --end();
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::reverse_iterator
+PB_DS_CLASS_C_DEC::
+rend()
+{ return reverse_iterator(m_p_head); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_reverse_iterator
+PB_DS_CLASS_C_DEC::
+rend() const
+{ return const_reverse_iterator(m_p_head); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_node_iterator
+PB_DS_CLASS_C_DEC::
+node_begin() const
+{ return const_node_iterator(m_p_head->m_p_parent, this); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_iterator
+PB_DS_CLASS_C_DEC::
+node_begin()
+{ return node_iterator(m_p_head->m_p_parent, this); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_node_iterator
+PB_DS_CLASS_C_DEC::
+node_end() const
+{ return const_node_iterator(NULL, this); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_iterator
+PB_DS_CLASS_C_DEC::
+node_end()
+{ return node_iterator(NULL, this); }
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/leaf.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/leaf.hpp
new file mode 100644
index 0000000..91cf14f
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/leaf.hpp
@@ -0,0 +1,171 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file leaf.hpp
+ * Contains a pat_trie_leaf for a patricia tree.
+ */
+
+#ifndef PB_DS_PAT_TRIE_LEAF_HPP
+#define PB_DS_PAT_TRIE_LEAF_HPP
+
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_CLASS_T_DEC \
+ template< \
+ class Type_Traits, \
+ class E_Access_Traits, \
+ class Metadata, \
+ class Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ pat_trie_leaf< \
+ Type_Traits, \
+ E_Access_Traits, \
+ Metadata, \
+ Allocator>
+
+#define PB_DS_BASE_C_DEC \
+ pat_trie_node_base< \
+ Type_Traits, \
+ E_Access_Traits, \
+ Metadata, \
+ Allocator>
+
+#define PB_DS_PAT_TRIE_SUBTREE_DEBUG_INFO_C_DEC \
+ pat_trie_subtree_debug_info< \
+ Type_Traits, \
+ E_Access_Traits, \
+ Allocator>
+
+ template<typename Type_Traits,
+ class E_Access_Traits,
+ class Metadata,
+ class Allocator>
+ struct pat_trie_leaf : public PB_DS_BASE_C_DEC
+ {
+ private:
+ typedef typename Type_Traits::value_type value_type;
+
+ typedef typename Type_Traits::const_reference const_reference;
+
+ typedef typename Type_Traits::reference reference;
+
+ typedef
+ typename Allocator::template rebind<
+ E_Access_Traits>::other::const_pointer
+ const_e_access_traits_pointer;
+
+#ifdef _GLIBCXX_DEBUG
+ typedef
+ typename PB_DS_BASE_C_DEC::subtree_debug_info
+ subtree_debug_info;
+#endif
+
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ public:
+ pat_trie_leaf(const_reference r_val);
+
+ inline reference
+ value();
+
+ inline const_reference
+ value() const;
+
+#ifdef _GLIBCXX_DEBUG
+ virtual subtree_debug_info
+ assert_valid_imp(const_e_access_traits_pointer p_traits) const;
+
+ virtual
+ ~pat_trie_leaf();
+#endif
+
+ private:
+ pat_trie_leaf(const PB_DS_CLASS_C_DEC& other);
+
+ value_type m_value;
+ };
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ pat_trie_leaf(const_reference r_val) :
+ PB_DS_BASE_C_DEC(pat_trie_leaf_node_type), m_value(r_val)
+ { }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::reference
+ PB_DS_CLASS_C_DEC::
+ value()
+ { return m_value; }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::const_reference
+ PB_DS_CLASS_C_DEC::
+ value() const
+ { return m_value; }
+
+#ifdef _GLIBCXX_DEBUG
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::subtree_debug_info
+ PB_DS_CLASS_C_DEC::
+ assert_valid_imp(const_e_access_traits_pointer p_traits) const
+ {
+ _GLIBCXX_DEBUG_ASSERT(base_type::m_type == pat_trie_leaf_node_type);
+ subtree_debug_info ret;
+ const_reference r_val = value();
+ return std::make_pair(p_traits->begin(p_traits->extract_key(r_val)),
+ p_traits->end(p_traits->extract_key(r_val)));
+ }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ~pat_trie_leaf() { }
+#endif
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_BASE_C_DEC
+#undef PB_DS_PAT_TRIE_SUBTREE_DEBUG_INFO_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/node_base.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/node_base.hpp
new file mode 100644
index 0000000..bb13068
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/node_base.hpp
@@ -0,0 +1,128 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file node_base.hpp
+ * Contains a pat_trie_node_base base for a patricia tree.
+ */
+
+#ifndef PB_DS_PAT_TRIE_NODE_BASE_HPP
+#define PB_DS_PAT_TRIE_NODE_BASE_HPP
+
+#include <ext/pb_ds/detail/pat_trie_/node_metadata_base.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+#define PB_DS_CLASS_T_DEC \
+ template<typename Type_Traits, typename E_Access_Traits, \
+ typename Metadata, typename Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ pat_trie_node_base<Type_Traits, E_Access_Traits, Metadata, Allocator>
+
+#define PB_DS_PAT_TRIE_SUBTREE_DEBUG_INFO_C_DEC \
+ pat_trie_subtree_debug_info<Type_Traits, E_Access_Traits, Allocator>
+
+ enum pat_trie_node_type
+ {
+ pat_trie_internal_node_type,
+ pat_trie_leaf_node_type,
+ pat_trie_head_node_type
+ };
+
+ template<typename Type_Traits,
+ typename E_Access_Traits,
+ typename Metadata,
+ typename Allocator>
+ struct pat_trie_node_base : public pat_trie_node_metadata_base<
+ Metadata,
+ Allocator>
+ {
+ public:
+ typedef
+ typename Allocator::template rebind<
+ pat_trie_node_base>::other::pointer
+ node_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ E_Access_Traits>::other::const_pointer
+ const_e_access_traits_pointer;
+
+#ifdef _GLIBCXX_DEBUG
+ typedef
+ std::pair<
+ typename E_Access_Traits::const_iterator,
+ typename E_Access_Traits::const_iterator>
+ subtree_debug_info;
+#endif
+
+ pat_trie_node_base(pat_trie_node_type type);
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid(const_e_access_traits_pointer p_traits) const;
+
+ virtual subtree_debug_info
+ assert_valid_imp(const_e_access_traits_pointer p_traits) const = 0;
+#endif
+
+ node_pointer m_p_parent;
+ const pat_trie_node_type m_type;
+ };
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ pat_trie_node_base(pat_trie_node_type type) : m_type(type)
+ { }
+
+#ifdef _GLIBCXX_DEBUG
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ assert_valid(const_e_access_traits_pointer p_traits) const
+ { assert_valid_imp(p_traits); }
+#endif
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_PAT_TRIE_SUBTREE_DEBUG_INFO_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/node_iterators.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/node_iterators.hpp
new file mode 100644
index 0000000..3725009
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/node_iterators.hpp
@@ -0,0 +1,338 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file node_iterators.hpp
+ * Contains an implementation class for pat_trie_.
+ */
+
+#ifndef PB_DS_PAT_TRIE_NODE_ITERATORS_HPP
+#define PB_DS_PAT_TRIE_NODE_ITERATORS_HPP
+
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_PAT_TRIE_CONST_NODE_ITERATOR_C_DEC \
+ pat_trie_const_node_it_< \
+ Node, \
+ Leaf, \
+ Head, \
+ Internal_Node, \
+ Const_Iterator, \
+ Iterator, \
+ E_Access_Traits, \
+ Allocator>
+
+#define PB_DS_PAT_TRIE_NODE_ITERATOR_C_DEC \
+ pat_trie_node_it_< \
+ Node, \
+ Leaf, \
+ Head, \
+ Internal_Node, \
+ Const_Iterator, \
+ Iterator, \
+ E_Access_Traits, \
+ Allocator>
+
+ // Const node iterator.
+ template<typename Node,
+ class Leaf,
+ class Head,
+ class Internal_Node,
+ class Const_Iterator,
+ class Iterator,
+ class E_Access_Traits,
+ class Allocator>
+ class pat_trie_const_node_it_
+ {
+ protected:
+ typedef
+ typename Allocator::template rebind<
+ Node>::other::pointer
+ node_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ Leaf>::other::const_pointer
+ const_leaf_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ Leaf>::other::pointer
+ leaf_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ Internal_Node>::other::pointer
+ internal_node_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ Internal_Node>::other::const_pointer
+ const_internal_node_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ E_Access_Traits>::other::const_pointer
+ const_e_access_traits_pointer;
+
+ private:
+ inline typename E_Access_Traits::const_iterator
+ pref_begin() const
+ {
+ if (m_p_nd->m_type == pat_trie_leaf_node_type)
+ return (m_p_traits->begin(
+ m_p_traits->extract_key(
+ static_cast<const_leaf_pointer>(m_p_nd)->value())));
+
+ _GLIBCXX_DEBUG_ASSERT(m_p_nd->m_type == pat_trie_internal_node_type);
+
+ return (static_cast<const_internal_node_pointer>(m_p_nd)->pref_b_it());
+ }
+
+ inline typename E_Access_Traits::const_iterator
+ pref_end() const
+ {
+ if (m_p_nd->m_type == pat_trie_leaf_node_type)
+ return (m_p_traits->end(
+ m_p_traits->extract_key(
+ static_cast<const_leaf_pointer>(m_p_nd)->value())));
+
+ _GLIBCXX_DEBUG_ASSERT(m_p_nd->m_type == pat_trie_internal_node_type);
+
+ return (static_cast<const_internal_node_pointer>(m_p_nd)->pref_e_it());
+ }
+
+ public:
+
+ // Size type.
+ typedef typename Allocator::size_type size_type;
+
+ // Category.
+ typedef trivial_iterator_tag iterator_category;
+
+ // Difference type.
+ typedef trivial_iterator_difference_type difference_type;
+
+ // __Iterator's value type.
+ typedef Const_Iterator value_type;
+
+ // __Iterator's reference type.
+ typedef value_type reference;
+
+ // __Iterator's __const reference type.
+ typedef value_type const_reference;
+
+ // Element access traits.
+ typedef E_Access_Traits e_access_traits;
+
+ // A key's element __const iterator.
+ typedef typename e_access_traits::const_iterator const_e_iterator;
+
+ // Metadata type.
+ typedef typename Node::metadata_type metadata_type;
+
+ // Const metadata reference type.
+ typedef
+ typename Allocator::template rebind<
+ metadata_type>::other::const_reference
+ const_metadata_reference;
+
+ // Default constructor.
+ /*
+ inline
+ pat_trie_const_node_it_()
+ */
+ inline
+ pat_trie_const_node_it_(node_pointer p_nd = NULL,
+ const_e_access_traits_pointer p_traits = NULL)
+ : m_p_nd(const_cast<node_pointer>(p_nd)), m_p_traits(p_traits)
+ { }
+
+ // Subtree valid prefix.
+ inline std::pair<const_e_iterator, const_e_iterator>
+ valid_prefix() const
+ { return std::make_pair(pref_begin(), pref_end()); }
+
+ // Const access; returns the __const iterator* associated with
+ // the current leaf.
+ inline const_reference
+ operator*() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(num_children() == 0);
+ return Const_Iterator(m_p_nd);
+ }
+
+ // Metadata access.
+ inline const_metadata_reference
+ get_metadata() const
+ { return m_p_nd->get_metadata(); }
+
+ // Returns the number of children in the corresponding node.
+ inline size_type
+ num_children() const
+ {
+ if (m_p_nd->m_type == pat_trie_leaf_node_type)
+ return 0;
+ _GLIBCXX_DEBUG_ASSERT(m_p_nd->m_type == pat_trie_internal_node_type);
+ return std::distance(static_cast<internal_node_pointer>(m_p_nd)->begin(), static_cast<internal_node_pointer>(m_p_nd)->end());
+ }
+
+ // Returns a __const node __iterator to the corresponding node's
+ // i-th child.
+ PB_DS_PAT_TRIE_CONST_NODE_ITERATOR_C_DEC
+ get_child(size_type i) const
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_nd->m_type == pat_trie_internal_node_type);
+ typename Internal_Node::iterator it =
+ static_cast<internal_node_pointer>(m_p_nd)->begin();
+
+ std::advance(it, i);
+ return PB_DS_PAT_TRIE_CONST_NODE_ITERATOR_C_DEC(*it, m_p_traits);
+ }
+
+ // Compares content to a different iterator object.
+ inline bool
+ operator==(const PB_DS_PAT_TRIE_CONST_NODE_ITERATOR_C_DEC& other) const
+ { return (m_p_nd == other.m_p_nd); }
+
+ // Compares content (negatively) to a different iterator object.
+ inline bool
+ operator!=(const PB_DS_PAT_TRIE_CONST_NODE_ITERATOR_C_DEC& other) const
+ { return m_p_nd != other.m_p_nd; }
+
+ private:
+
+ friend class PB_DS_CLASS_C_DEC;
+
+ public:
+ node_pointer m_p_nd;
+
+ const_e_access_traits_pointer m_p_traits;
+ };
+
+ // Node iterator.
+ template<typename Node,
+ class Leaf,
+ class Head,
+ class Internal_Node,
+ class Const_Iterator,
+ class Iterator,
+ class E_Access_Traits,
+ class Allocator>
+ class pat_trie_node_it_ :
+ public PB_DS_PAT_TRIE_CONST_NODE_ITERATOR_C_DEC
+
+ {
+ private:
+ typedef
+ typename Allocator::template rebind<
+ Node>::other::pointer
+ node_pointer;
+
+ typedef Iterator iterator;
+
+ typedef PB_DS_PAT_TRIE_CONST_NODE_ITERATOR_C_DEC base_type;
+
+ typedef
+ typename base_type::const_e_access_traits_pointer
+ const_e_access_traits_pointer;
+
+ typedef typename base_type::internal_node_pointer internal_node_pointer;
+
+ public:
+
+ // Size type.
+ typedef
+ typename PB_DS_PAT_TRIE_CONST_NODE_ITERATOR_C_DEC::size_type
+ size_type;
+
+ // __Iterator's value type.
+ typedef Iterator value_type;
+
+ // __Iterator's reference type.
+ typedef value_type reference;
+
+ // __Iterator's __const reference type.
+ typedef value_type const_reference;
+
+ // Default constructor.
+ /*
+ inline
+ pat_trie_node_it_() ;
+ */
+
+ inline
+ pat_trie_node_it_(node_pointer p_nd = NULL, const_e_access_traits_pointer p_traits = NULL) : base_type(p_nd, p_traits)
+ { }
+
+ // Access; returns the iterator* associated with the current leaf.
+ inline reference
+ operator*() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(base_type::num_children() == 0);
+ return Iterator(base_type::m_p_nd);
+
+ }
+
+ // Returns a node __iterator to the corresponding node's i-th child.
+ PB_DS_PAT_TRIE_NODE_ITERATOR_C_DEC
+ get_child(size_type i) const
+ {
+ _GLIBCXX_DEBUG_ASSERT(base_type::m_p_nd->m_type == pat_trie_internal_node_type);
+
+ typename Internal_Node::iterator it =
+ static_cast<internal_node_pointer>(base_type::m_p_nd)->begin();
+
+ std::advance(it, i);
+ return PB_DS_PAT_TRIE_NODE_ITERATOR_C_DEC(*it, base_type::m_p_traits);
+ }
+
+ private:
+ friend class PB_DS_CLASS_C_DEC;
+ };
+
+#undef PB_DS_PAT_TRIE_CONST_NODE_ITERATOR_C_DEC
+#undef PB_DS_PAT_TRIE_NODE_ITERATOR_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/node_metadata_base.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/node_metadata_base.hpp
new file mode 100644
index 0000000..36272ed
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/node_metadata_base.hpp
@@ -0,0 +1,86 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file node_metadata_base.hpp
+ * Contains an internal PB_DS_BASE_C_DEC for a patricia tree.
+ */
+
+#ifndef PB_DS_PAT_TRIE_NODE_METADATA_BASE_HPP
+#define PB_DS_PAT_TRIE_NODE_METADATA_BASE_HPP
+
+#include <ext/pb_ds/detail/basic_tree_policy/null_node_metadata.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+ template<typename Metadata, class Allocator>
+ struct pat_trie_node_metadata_base
+ {
+ public:
+ typedef Metadata metadata_type;
+
+ typedef
+ typename Allocator::template rebind<
+ metadata_type>::other::const_reference
+ const_metadata_reference;
+
+ public:
+ inline const_metadata_reference
+ get_metadata() const
+ {
+ return (m_metadata);
+ }
+
+ public:
+ metadata_type m_metadata;
+ };
+
+ template<typename Allocator>
+ struct pat_trie_node_metadata_base<
+ null_node_metadata,
+ Allocator>
+ {
+ public:
+ typedef null_node_metadata metadata_type;
+ };
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_PAT_TRIE_NODE_BASE_HPP
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp
new file mode 100644
index 0000000..f6f4209
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp
@@ -0,0 +1,515 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file pat_trie_.hpp
+ * Contains an implementation class for a patricia tree.
+ */
+
+/**
+ * This implementation loosely borrows ideas from:
+ * 1) "Fast Mergeable Integer Maps", Okasaki, Gill 1998
+ * 2) "Ptset: Sets of integers implemented as Patricia trees",
+ * Jean-Christophe Filliatr, 2000
+ **/
+
+#include <ext/pb_ds/detail/pat_trie_/synth_e_access_traits.hpp>
+#include <ext/pb_ds/detail/pat_trie_/node_base.hpp>
+#include <ext/pb_ds/exception.hpp>
+#include <ext/pb_ds/tag_and_trait.hpp>
+#include <ext/pb_ds/detail/eq_fn/eq_by_less.hpp>
+#include <ext/pb_ds/detail/types_traits.hpp>
+#include <ext/pb_ds/tree_policy.hpp>
+#include <ext/pb_ds/detail/cond_dealtor.hpp>
+#include <ext/pb_ds/detail/type_utils.hpp>
+#include <iterator>
+#include <utility>
+#include <algorithm>
+#include <functional>
+#include <assert.h>
+#include <list>
+#ifdef _GLIBCXX_DEBUG
+#include <ext/pb_ds/detail/debug_map_base.hpp>
+#endif
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, typename Mapped, typename Node_And_It_Traits, \
+ typename Allocator>
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_CLASS_NAME pat_trie_data_
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#define PB_DS_CLASS_NAME pat_trie_no_data_
+#endif
+
+#define PB_DS_CLASS_C_DEC \
+ PB_DS_CLASS_NAME<Key, Mapped, Node_And_It_Traits, Allocator>
+
+#define PB_DS_TYPES_TRAITS_C_DEC \
+ types_traits<Key, Mapped, Allocator, false>
+
+#ifdef _GLIBCXX_DEBUG
+#define PB_DS_DEBUG_MAP_BASE_C_DEC \
+ debug_map_base<Key, eq_by_less<Key, \
+ std::less<Key> >, typename Allocator::template rebind<Key>::other::const_reference>
+#endif
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_V2F(X) (X).first
+#define PB_DS_V2S(X) (X).second
+#define PB_DS_EP2VP(X)& ((X)->m_value)
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#define PB_DS_V2F(X) (X)
+#define PB_DS_V2S(X) Mapped_Data()
+#define PB_DS_EP2VP(X)& ((X)->m_value.first)
+#endif
+
+ /**
+ * class description = PATRICIA trie implementation.">
+ **/
+ template<typename Key,
+ typename Mapped,
+ typename Node_And_It_Traits,
+ typename Allocator>
+ class PB_DS_CLASS_NAME :
+#ifdef _GLIBCXX_DEBUG
+ public PB_DS_DEBUG_MAP_BASE_C_DEC,
+#endif
+ public Node_And_It_Traits::synth_e_access_traits,
+ public Node_And_It_Traits::node_update,
+ public PB_DS_TYPES_TRAITS_C_DEC
+ {
+ private:
+ typedef PB_DS_TYPES_TRAITS_C_DEC traits_base;
+
+ typedef typename Node_And_It_Traits::synth_e_access_traits synth_e_access_traits;
+ typedef typename Allocator::template rebind<synth_e_access_traits>::other::const_pointer const_e_access_traits_pointer;
+ typedef typename synth_e_access_traits::const_iterator const_e_iterator;
+
+ typedef typename Node_And_It_Traits::node node;
+ typedef typename Allocator::template rebind<node>::other::const_pointer const_node_pointer;
+
+ typedef typename Allocator::template rebind<node>::other::pointer node_pointer;
+
+ typedef typename Node_And_It_Traits::head head;
+ typedef typename Allocator::template rebind<head>::other head_allocator;
+ typedef typename head_allocator::pointer head_pointer;
+
+ typedef typename Node_And_It_Traits::leaf leaf;
+ typedef typename Allocator::template rebind<leaf>::other leaf_allocator;
+ typedef typename leaf_allocator::const_pointer const_leaf_pointer;
+ typedef typename leaf_allocator::pointer leaf_pointer;
+
+ typedef typename Node_And_It_Traits::internal_node internal_node;
+ typedef typename Allocator::template rebind<internal_node>::other internal_node_allocator;
+ typedef typename internal_node_allocator::const_pointer const_internal_node_pointer;
+ typedef typename internal_node_allocator::pointer internal_node_pointer;
+
+#include <ext/pb_ds/detail/pat_trie_/cond_dtor_entry_dealtor.hpp>
+
+#ifdef _GLIBCXX_DEBUG
+ typedef PB_DS_DEBUG_MAP_BASE_C_DEC debug_base;
+#endif
+
+#include <ext/pb_ds/detail/pat_trie_/split_join_branch_bag.hpp>
+
+ typedef typename Node_And_It_Traits::null_node_update_pointer null_node_update_pointer;
+
+ public:
+ typedef pat_trie_tag container_category;
+ typedef Allocator allocator_type;
+ typedef typename Allocator::size_type size_type;
+ typedef typename Allocator::difference_type difference_type;
+
+ typedef typename traits_base::key_type key_type;
+ typedef typename traits_base::key_pointer key_pointer;
+ typedef typename traits_base::const_key_pointer const_key_pointer;
+ typedef typename traits_base::key_reference key_reference;
+ typedef typename traits_base::const_key_reference const_key_reference;
+ typedef typename traits_base::mapped_type mapped_type;
+ typedef typename traits_base::mapped_pointer mapped_pointer;
+ typedef typename traits_base::const_mapped_pointer const_mapped_pointer;
+ typedef typename traits_base::mapped_reference mapped_reference;
+ typedef typename traits_base::const_mapped_reference const_mapped_reference;
+ typedef typename traits_base::value_type value_type;
+ typedef typename traits_base::pointer pointer;
+ typedef typename traits_base::const_pointer const_pointer;
+ typedef typename traits_base::reference reference;
+ typedef typename traits_base::const_reference const_reference;
+
+ typedef typename Node_And_It_Traits::const_iterator const_point_iterator;
+ typedef typename Node_And_It_Traits::iterator point_iterator;
+ typedef const_point_iterator const_iterator;
+ typedef point_iterator iterator;
+
+ typedef typename Node_And_It_Traits::const_reverse_iterator const_reverse_iterator;
+ typedef typename Node_And_It_Traits::reverse_iterator reverse_iterator;
+ typedef typename Node_And_It_Traits::const_node_iterator const_node_iterator;
+ typedef typename Node_And_It_Traits::node_iterator node_iterator;
+ typedef typename Node_And_It_Traits::e_access_traits e_access_traits;
+ typedef typename Node_And_It_Traits::node_update node_update;
+
+ PB_DS_CLASS_NAME();
+
+ PB_DS_CLASS_NAME(const e_access_traits&);
+
+ PB_DS_CLASS_NAME(const PB_DS_CLASS_C_DEC&);
+
+ void
+ swap(PB_DS_CLASS_C_DEC&);
+
+ ~PB_DS_CLASS_NAME();
+
+ inline bool
+ empty() const;
+
+ inline size_type
+ size() const;
+
+ inline size_type
+ max_size() const;
+
+ e_access_traits&
+ get_e_access_traits();
+
+ const e_access_traits&
+ get_e_access_traits() const;
+
+ node_update&
+ get_node_update();
+
+ const node_update&
+ get_node_update() const;
+
+ inline std::pair<point_iterator, bool>
+ insert(const_reference);
+
+ inline mapped_reference
+ operator[](const_key_reference r_key)
+ {
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ return insert(std::make_pair(r_key, mapped_type())).first->second;
+#else
+ insert(r_key);
+ return traits_base::s_null_mapped;
+#endif
+ }
+
+ inline point_iterator
+ find(const_key_reference);
+
+ inline const_point_iterator
+ find(const_key_reference) const;
+
+ inline point_iterator
+ lower_bound(const_key_reference);
+
+ inline const_point_iterator
+ lower_bound(const_key_reference) const;
+
+ inline point_iterator
+ upper_bound(const_key_reference);
+
+ inline const_point_iterator
+ upper_bound(const_key_reference) const;
+
+ void
+ clear();
+
+ inline bool
+ erase(const_key_reference);
+
+ inline const_iterator
+ erase(const_iterator);
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ inline iterator
+ erase(iterator);
+#endif
+
+ inline const_reverse_iterator
+ erase(const_reverse_iterator);
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ inline reverse_iterator
+ erase(reverse_iterator);
+#endif
+
+ template<typename Pred>
+ inline size_type
+ erase_if(Pred);
+
+ void
+ join(PB_DS_CLASS_C_DEC&);
+
+ void
+ split(const_key_reference, PB_DS_CLASS_C_DEC&);
+
+ inline iterator
+ begin();
+
+ inline const_iterator
+ begin() const;
+
+ inline iterator
+ end();
+
+ inline const_iterator
+ end() const;
+
+ inline reverse_iterator
+ rbegin();
+
+ inline const_reverse_iterator
+ rbegin() const;
+
+ inline reverse_iterator
+ rend();
+
+ inline const_reverse_iterator
+ rend() const;
+
+ inline const_node_iterator
+ node_begin() const;
+
+ inline node_iterator
+ node_begin();
+
+ inline const_node_iterator
+ node_end() const;
+
+ inline node_iterator
+ node_end();
+
+#ifdef PB_DS_PAT_TRIE_TRACE_
+ void
+ trace() const;
+#endif
+
+ protected:
+
+ template<typename It>
+ void
+ copy_from_range(It, It);
+
+ void
+ value_swap(PB_DS_CLASS_C_DEC&);
+
+ node_pointer
+ recursive_copy_node(const_node_pointer);
+
+ private:
+
+ void
+ initialize();
+
+ inline void
+ apply_update(node_pointer, null_node_update_pointer);
+
+ template<typename Node_Update_>
+ inline void
+ apply_update(node_pointer, Node_Update_*);
+
+ bool
+ join_prep(PB_DS_CLASS_C_DEC&, split_join_branch_bag&);
+
+ void
+ rec_join_prep(const_node_pointer, const_node_pointer,
+ split_join_branch_bag&);
+
+ void
+ rec_join_prep(const_leaf_pointer, const_leaf_pointer,
+ split_join_branch_bag&);
+
+ void
+ rec_join_prep(const_leaf_pointer, const_internal_node_pointer,
+ split_join_branch_bag&);
+
+ void
+ rec_join_prep(const_internal_node_pointer, const_leaf_pointer,
+ split_join_branch_bag&);
+
+ void
+ rec_join_prep(const_internal_node_pointer, const_internal_node_pointer,
+ split_join_branch_bag&);
+
+ node_pointer
+ rec_join(node_pointer, node_pointer, size_type, split_join_branch_bag&);
+
+ node_pointer
+ rec_join(leaf_pointer, leaf_pointer, split_join_branch_bag&);
+
+ node_pointer
+ rec_join(leaf_pointer, internal_node_pointer, size_type,
+ split_join_branch_bag&);
+
+ node_pointer
+ rec_join(internal_node_pointer, leaf_pointer, size_type,
+ split_join_branch_bag&);
+
+ node_pointer
+ rec_join(internal_node_pointer, internal_node_pointer,
+ split_join_branch_bag&);
+
+ size_type
+ keys_diff_ind(typename e_access_traits::const_iterator, typename e_access_traits::const_iterator, typename e_access_traits::const_iterator, typename e_access_traits::const_iterator);
+
+ internal_node_pointer
+ insert_branch(node_pointer, node_pointer, split_join_branch_bag&);
+
+ void
+ update_min_max_for_inserted_leaf(leaf_pointer);
+
+ void
+ erase_leaf(leaf_pointer);
+
+ inline void
+ actual_erase_leaf(leaf_pointer);
+
+ void
+ clear_imp(node_pointer);
+
+ void
+ erase_fixup(internal_node_pointer);
+
+ void
+ update_min_max_for_erased_leaf(leaf_pointer);
+
+ static inline const_e_iterator
+ pref_begin(const_node_pointer);
+
+ static inline const_e_iterator
+ pref_end(const_node_pointer);
+
+ inline node_pointer
+ find_imp(const_key_reference);
+
+ inline node_pointer
+ lower_bound_imp(const_key_reference);
+
+ inline node_pointer
+ upper_bound_imp(const_key_reference);
+
+ inline static const_leaf_pointer
+ leftmost_descendant(const_node_pointer);
+
+ inline static leaf_pointer
+ leftmost_descendant(node_pointer);
+
+ inline static const_leaf_pointer
+ rightmost_descendant(const_node_pointer);
+
+ inline static leaf_pointer
+ rightmost_descendant(node_pointer);
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid() const;
+
+ void
+ assert_iterators() const;
+
+ void
+ assert_reverse_iterators() const;
+
+ static size_type
+ recursive_count_leafs(const_node_pointer);
+#endif
+
+#ifdef PB_DS_PAT_TRIE_TRACE_
+ static void
+ trace_node(const_node_pointer, size_type);
+
+ template<typename Metadata_>
+ static void
+ trace_node_metadata(const_node_pointer, type_to_type<Metadata_>);
+
+ static void
+ trace_node_metadata(const_node_pointer, type_to_type<null_node_metadata>);
+#endif
+
+ leaf_pointer
+ split_prep(const_key_reference, PB_DS_CLASS_C_DEC&,
+ split_join_branch_bag&);
+
+ node_pointer
+ rec_split(node_pointer, const_e_iterator, const_e_iterator,
+ PB_DS_CLASS_C_DEC&, split_join_branch_bag&);
+
+ void
+ split_insert_branch(size_type, const_e_iterator,
+ typename internal_node::iterator,
+ size_type, split_join_branch_bag&);
+
+ static head_allocator s_head_allocator;
+ static internal_node_allocator s_internal_node_allocator;
+ static leaf_allocator s_leaf_allocator;
+
+ head_pointer m_p_head;
+ size_type m_size;
+ };
+
+#include <ext/pb_ds/detail/pat_trie_/constructors_destructor_fn_imps.hpp>
+#include <ext/pb_ds/detail/pat_trie_/iterators_fn_imps.hpp>
+#include <ext/pb_ds/detail/pat_trie_/insert_join_fn_imps.hpp>
+#include <ext/pb_ds/detail/pat_trie_/erase_fn_imps.hpp>
+#include <ext/pb_ds/detail/pat_trie_/find_fn_imps.hpp>
+#include <ext/pb_ds/detail/pat_trie_/info_fn_imps.hpp>
+#include <ext/pb_ds/detail/pat_trie_/policy_access_fn_imps.hpp>
+#include <ext/pb_ds/detail/pat_trie_/split_fn_imps.hpp>
+#include <ext/pb_ds/detail/pat_trie_/debug_fn_imps.hpp>
+#include <ext/pb_ds/detail/pat_trie_/trace_fn_imps.hpp>
+#include <ext/pb_ds/detail/pat_trie_/update_fn_imps.hpp>
+
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_NAME
+#undef PB_DS_TYPES_TRAITS_C_DEC
+#undef PB_DS_DEBUG_MAP_BASE_C_DEC
+#undef PB_DS_V2F
+#undef PB_DS_EP2VP
+#undef PB_DS_V2S
+
+ } // namespace detail
+} // namespace __gnu_pbds
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/point_iterators.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/point_iterators.hpp
new file mode 100644
index 0000000..cada907
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/point_iterators.hpp
@@ -0,0 +1,484 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file point_iterators.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+#ifndef PB_DS_PAT_TRIE_FIND_ITERATORS_HPP
+#define PB_DS_PAT_TRIE_FIND_ITERATORS_HPP
+
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_CONST_IT_C_DEC \
+ pat_trie_const_it_< \
+ Type_Traits, \
+ Node, \
+ Leaf, \
+ Head, \
+ Internal_Node, \
+ Is_Forward_Iterator, \
+ Allocator>
+
+#define PB_DS_CONST_ODIR_IT_C_DEC \
+ pat_trie_const_it_< \
+ Type_Traits, \
+ Node, \
+ Leaf, \
+ Head, \
+ Internal_Node, \
+ !Is_Forward_Iterator, \
+ Allocator>
+
+#define PB_DS_IT_C_DEC \
+ pat_trie_it_< \
+ Type_Traits, \
+ Node, \
+ Leaf, \
+ Head, \
+ Internal_Node, \
+ Is_Forward_Iterator, \
+ Allocator>
+
+#define PB_DS_ODIR_IT_C_DEC \
+ pat_trie_it_< \
+ Type_Traits, \
+ Node, \
+ Leaf, \
+ Head, \
+ Internal_Node, \
+ !Is_Forward_Iterator, \
+ Allocator>
+
+
+ // Const iterator.
+ template<typename Type_Traits,
+ class Node,
+ class Leaf,
+ class Head,
+ class Internal_Node,
+ bool Is_Forward_Iterator,
+ class Allocator>
+ class pat_trie_const_it_
+ {
+
+ private:
+ typedef
+ typename Allocator::template rebind<
+ Node>::other::pointer
+ node_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ Leaf>::other::const_pointer
+ const_leaf_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ Leaf>::other::pointer
+ leaf_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ Head>::other::pointer
+ head_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ Internal_Node>::other::pointer
+ internal_node_pointer;
+
+ public:
+
+ typedef std::bidirectional_iterator_tag iterator_category;
+
+ typedef typename Allocator::difference_type difference_type;
+
+ typedef typename Type_Traits::value_type value_type;
+
+ typedef typename Type_Traits::pointer pointer;
+
+ typedef typename Type_Traits::const_pointer const_pointer;
+
+ typedef typename Type_Traits::reference reference;
+
+ typedef typename Type_Traits::const_reference const_reference;
+
+ public:
+
+ inline
+ pat_trie_const_it_(node_pointer p_nd = NULL) : m_p_nd(p_nd)
+ { }
+
+ inline
+ pat_trie_const_it_(const PB_DS_CONST_ODIR_IT_C_DEC& other)
+ : m_p_nd(other.m_p_nd)
+ { }
+
+ inline
+ PB_DS_CONST_IT_C_DEC&
+ operator=(const PB_DS_CONST_IT_C_DEC& other)
+ {
+ m_p_nd = other.m_p_nd;
+ return *this;
+ }
+
+ inline
+ PB_DS_CONST_IT_C_DEC&
+ operator=(const PB_DS_CONST_ODIR_IT_C_DEC& other)
+ {
+ m_p_nd = other.m_p_nd;
+ return *this;
+ }
+
+ inline const_pointer
+ operator->() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_nd->m_type == pat_trie_leaf_node_type);
+ return &static_cast<leaf_pointer>(m_p_nd)->value();
+ }
+
+ inline const_reference
+ operator*() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_nd->m_type == pat_trie_leaf_node_type);
+ return static_cast<leaf_pointer>(m_p_nd)->value();
+ }
+
+ inline bool
+ operator==(const PB_DS_CONST_IT_C_DEC& other) const
+ { return (m_p_nd == other.m_p_nd); }
+
+ inline bool
+ operator==(const PB_DS_CONST_ODIR_IT_C_DEC& other) const
+ { return (m_p_nd == other.m_p_nd); }
+
+ inline bool
+ operator!=(const PB_DS_CONST_IT_C_DEC& other) const
+ { return (m_p_nd != other.m_p_nd); }
+
+ inline bool
+ operator!=(const PB_DS_CONST_ODIR_IT_C_DEC& other) const
+ { return (m_p_nd != other.m_p_nd); }
+
+ inline PB_DS_CONST_IT_C_DEC&
+ operator++()
+ {
+ inc(integral_constant<int,Is_Forward_Iterator>());
+ return *this;
+ }
+
+ inline PB_DS_CONST_IT_C_DEC
+ operator++(int)
+ {
+ PB_DS_CONST_IT_C_DEC ret_it(m_p_nd);
+ operator++();
+ return ret_it;
+ }
+
+ inline PB_DS_CONST_IT_C_DEC&
+ operator--()
+ {
+ dec(integral_constant<int,Is_Forward_Iterator>());
+ return *this;
+ }
+
+ inline PB_DS_CONST_IT_C_DEC
+ operator--(int)
+ {
+ PB_DS_CONST_IT_C_DEC ret_it(m_p_nd);
+ operator--();
+ return ret_it;
+ }
+
+ protected:
+ inline void
+ inc(false_type)
+ { dec(true_type()); }
+
+ void
+ inc(true_type)
+ {
+ if (m_p_nd->m_type == pat_trie_head_node_type)
+ {
+ m_p_nd = static_cast<head_pointer>(m_p_nd)->m_p_min;
+ return;
+ }
+
+ node_pointer p_y = m_p_nd->m_p_parent;
+ while (p_y->m_type != pat_trie_head_node_type &&
+ get_larger_sibling(m_p_nd) == NULL)
+ {
+ m_p_nd = p_y;
+ p_y = p_y->m_p_parent;
+ }
+
+ if (p_y->m_type == pat_trie_head_node_type)
+ {
+ m_p_nd = p_y;
+ return;
+ }
+ m_p_nd = leftmost_descendant(get_larger_sibling(m_p_nd));
+ }
+
+ inline void
+ dec(false_type)
+ { inc(true_type()); }
+
+ void
+ dec(true_type)
+ {
+ if (m_p_nd->m_type == pat_trie_head_node_type)
+ {
+ m_p_nd = static_cast<head_pointer>(m_p_nd)->m_p_max;
+ return;
+ }
+
+ node_pointer p_y = m_p_nd->m_p_parent;
+ while (p_y->m_type != pat_trie_head_node_type &&
+ get_smaller_sibling(m_p_nd) == NULL)
+ {
+ m_p_nd = p_y;
+ p_y = p_y->m_p_parent;
+ }
+
+ if (p_y->m_type == pat_trie_head_node_type)
+ {
+ m_p_nd = p_y;
+ return;
+ }
+ m_p_nd = rightmost_descendant(get_smaller_sibling(m_p_nd));
+ }
+
+ inline static node_pointer
+ get_larger_sibling(node_pointer p_nd)
+ {
+ internal_node_pointer p_parent =
+ static_cast<internal_node_pointer>(p_nd->m_p_parent);
+
+ typename Internal_Node::iterator it = p_parent->begin();
+ while (*it != p_nd)
+ ++it;
+
+ typename Internal_Node::iterator next_it = it;
+ ++next_it;
+ return ((next_it == p_parent->end())? NULL :* next_it);
+ }
+
+ inline static node_pointer
+ get_smaller_sibling(node_pointer p_nd)
+ {
+ internal_node_pointer p_parent =
+ static_cast<internal_node_pointer>(p_nd->m_p_parent);
+
+ typename Internal_Node::iterator it = p_parent->begin();
+
+ if (*it == p_nd)
+ return (NULL);
+ typename Internal_Node::iterator prev_it;
+ do
+ {
+ prev_it = it;
+ ++it;
+ if (*it == p_nd)
+ return (*prev_it);
+ }
+ while (true);
+
+ _GLIBCXX_DEBUG_ASSERT(false);
+ return (NULL);
+ }
+
+ inline static leaf_pointer
+ leftmost_descendant(node_pointer p_nd)
+ {
+ if (p_nd->m_type == pat_trie_leaf_node_type)
+ return static_cast<leaf_pointer>(p_nd);
+ return static_cast<internal_node_pointer>(p_nd)->leftmost_descendant();
+ }
+
+ inline static leaf_pointer
+ rightmost_descendant(node_pointer p_nd)
+ {
+ if (p_nd->m_type == pat_trie_leaf_node_type)
+ return static_cast<leaf_pointer>(p_nd);
+ return static_cast<internal_node_pointer>(p_nd)->rightmost_descendant();
+ }
+
+ public:
+ node_pointer m_p_nd;
+ };
+
+ // Iterator.
+ template<typename Type_Traits,
+ class Node,
+ class Leaf,
+ class Head,
+ class Internal_Node,
+ bool Is_Forward_Iterator,
+ class Allocator>
+ class pat_trie_it_ :
+ public PB_DS_CONST_IT_C_DEC
+
+ {
+ private:
+ typedef
+ typename Allocator::template rebind<
+ Node>::other::pointer
+ node_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ Leaf>::other::const_pointer
+ const_leaf_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ Leaf>::other::pointer
+ leaf_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ Head>::other::pointer
+ head_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ Internal_Node>::other::pointer
+ internal_node_pointer;
+
+ public:
+ typedef typename Type_Traits::value_type value_type;
+
+ typedef typename Type_Traits::const_pointer const_pointer;
+
+ typedef typename Type_Traits::pointer pointer;
+
+ typedef typename Type_Traits::const_reference const_reference;
+
+ typedef typename Type_Traits::reference reference;
+
+ inline
+ pat_trie_it_(node_pointer p_nd = NULL) : PB_DS_CONST_IT_C_DEC((node_pointer)p_nd)
+ { }
+
+ inline
+ pat_trie_it_(const PB_DS_ODIR_IT_C_DEC& other) : PB_DS_CONST_IT_C_DEC(other.m_p_nd)
+ { }
+
+ inline
+ PB_DS_IT_C_DEC&
+ operator=(const PB_DS_IT_C_DEC& other)
+ {
+ base_it_type::m_p_nd = other.m_p_nd;
+ return *this;
+ }
+
+ inline
+ PB_DS_IT_C_DEC&
+ operator=(const PB_DS_ODIR_IT_C_DEC& other)
+ {
+ base_it_type::m_p_nd = other.m_p_nd;
+ return *this;
+ }
+
+ inline pointer
+ operator->() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(base_it_type::m_p_nd->m_type == pat_trie_leaf_node_type);
+
+ return &static_cast<leaf_pointer>(base_it_type::m_p_nd)->value();
+ }
+
+ inline reference
+ operator*() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(base_it_type::m_p_nd->m_type == pat_trie_leaf_node_type);
+ return static_cast<leaf_pointer>(base_it_type::m_p_nd)->value();
+ }
+
+ inline PB_DS_IT_C_DEC&
+ operator++()
+ {
+ PB_DS_CONST_IT_C_DEC::
+ operator++();
+ return *this;
+ }
+
+ inline PB_DS_IT_C_DEC
+ operator++(int)
+ {
+ PB_DS_IT_C_DEC ret_it(base_it_type::m_p_nd);
+ operator++();
+ return ret_it;
+ }
+
+ inline PB_DS_IT_C_DEC&
+ operator--()
+ {
+ PB_DS_CONST_IT_C_DEC::operator--();
+ return *this;
+ }
+
+ inline PB_DS_IT_C_DEC
+ operator--(int)
+ {
+ PB_DS_IT_C_DEC ret_it(base_it_type::m_p_nd);
+ operator--();
+ return ret_it;
+ }
+
+ protected:
+ typedef PB_DS_CONST_IT_C_DEC base_it_type;
+
+ friend class PB_DS_CLASS_C_DEC;
+ };
+
+#undef PB_DS_CONST_IT_C_DEC
+#undef PB_DS_CONST_ODIR_IT_C_DEC
+#undef PB_DS_IT_C_DEC
+#undef PB_DS_ODIR_IT_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/policy_access_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/policy_access_fn_imps.hpp
new file mode 100644
index 0000000..79bfe42
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/policy_access_fn_imps.hpp
@@ -0,0 +1,63 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file policy_access_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::e_access_traits&
+PB_DS_CLASS_C_DEC::
+get_e_access_traits()
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+const typename PB_DS_CLASS_C_DEC::e_access_traits&
+PB_DS_CLASS_C_DEC::
+get_e_access_traits() const
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::node_update&
+PB_DS_CLASS_C_DEC::
+get_node_update()
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+const typename PB_DS_CLASS_C_DEC::node_update&
+PB_DS_CLASS_C_DEC::
+get_node_update() const
+{ return *this; }
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/r_erase_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/r_erase_fn_imps.hpp
new file mode 100644
index 0000000..52edf25
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/r_erase_fn_imps.hpp
@@ -0,0 +1,103 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file r_erase_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+actual_erase_node(node_pointer p_z)
+{
+ _GLIBCXX_DEBUG_ASSERT(m_size > 0);
+ --m_size;
+ _GLIBCXX_DEBUG_ONLY(erase_existing(PB_DS_V2F(p_z->m_value)));
+ p_z->~node();
+ s_node_allocator.deallocate(p_z, 1);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+update_min_max_for_erased_node(node_pointer p_z)
+{
+ if (m_size == 1)
+ {
+ m_p_head->m_p_left = m_p_head->m_p_right = m_p_head;
+ return;
+ }
+
+ if (m_p_head->m_p_left == p_z)
+ {
+ iterator it(p_z);
+ ++it;
+ m_p_head->m_p_left = it.m_p_nd;
+ }
+ else if (m_p_head->m_p_right == p_z)
+ {
+ iterator it(p_z);
+ --it;
+ m_p_head->m_p_right = it.m_p_nd;
+ }
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+clear()
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true, true);)
+ clear_imp(m_p_head->m_p_parent);
+ m_size = 0;
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(debug_base::clear();)
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true, true);)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+clear_imp(node_pointer p_nd)
+{
+ if (p_nd == NULL)
+ return;
+ clear_imp(p_nd->m_p_left);
+ clear_imp(p_nd->m_p_right);
+ p_nd->~Node();
+ s_node_allocator.deallocate(p_nd, 1);
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/rotate_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/rotate_fn_imps.hpp
new file mode 100644
index 0000000..c0809fa
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/rotate_fn_imps.hpp
@@ -0,0 +1,150 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file rotate_fn_imps.hpp
+ * Contains imps for rotating nodes.
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+rotate_left(node_pointer p_x)
+{
+ node_pointer p_y = p_x->m_p_right;
+ p_x->m_p_right = p_y->m_p_left;
+
+ if (p_y->m_p_left != NULL)
+ p_y->m_p_left->m_p_parent = p_x;
+
+ p_y->m_p_parent = p_x->m_p_parent;
+ if (p_x == m_p_head->m_p_parent)
+ m_p_head->m_p_parent = p_y;
+ else if (p_x == p_x->m_p_parent->m_p_left)
+ p_x->m_p_parent->m_p_left = p_y;
+ else
+ p_x->m_p_parent->m_p_right = p_y;
+
+ p_y->m_p_left = p_x;
+ p_x->m_p_parent = p_y;
+
+ _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_x);)
+ _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_y);)
+
+ apply_update(p_x, (Node_Update* )this);
+ apply_update(p_x->m_p_parent, (Node_Update* )this);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+rotate_right(node_pointer p_x)
+{
+ node_pointer p_y = p_x->m_p_left;
+ p_x->m_p_left = p_y->m_p_right;
+
+ if (p_y->m_p_right != NULL)
+ p_y->m_p_right->m_p_parent = p_x;
+
+ p_y->m_p_parent = p_x->m_p_parent;
+ if (p_x == m_p_head->m_p_parent)
+ m_p_head->m_p_parent = p_y;
+ else if (p_x == p_x->m_p_parent->m_p_right)
+ p_x->m_p_parent->m_p_right = p_y;
+ else
+ p_x->m_p_parent->m_p_left = p_y;
+
+ p_y->m_p_right = p_x;
+ p_x->m_p_parent = p_y;
+
+ _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_x);)
+ _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_y);)
+
+ apply_update(p_x, (Node_Update* )this);
+ apply_update(p_x->m_p_parent, (Node_Update* )this);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+rotate_parent(node_pointer p_nd)
+{
+ node_pointer p_parent = p_nd->m_p_parent;
+ if (p_nd == p_parent->m_p_left)
+ rotate_right(p_parent);
+ else
+ rotate_left(p_parent);
+ _GLIBCXX_DEBUG_ASSERT(p_parent->m_p_parent = p_nd);
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_left == p_parent || p_nd->m_p_right == p_parent);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+apply_update(node_pointer /*p_nd*/, __gnu_pbds::null_node_update* /*p_update*/)
+{ }
+
+PB_DS_CLASS_T_DEC
+template<typename Node_Update_>
+inline void
+PB_DS_CLASS_C_DEC::
+apply_update(node_pointer p_nd, Node_Update_* p_update)
+{
+ p_update->operator()(& PB_DS_V2F(p_nd->m_value),(p_nd->m_p_left == NULL) ?
+ NULL :
+ & PB_DS_V2F(p_nd->m_p_left->m_value),(p_nd->m_p_right == NULL) ?
+ NULL :
+ & PB_DS_V2F(p_nd->m_p_right->m_value));
+}
+
+PB_DS_CLASS_T_DEC
+template<typename Node_Update_>
+inline void
+PB_DS_CLASS_C_DEC::
+update_to_top(node_pointer p_nd, Node_Update_* p_update)
+{
+ while (p_nd != m_p_head)
+ {
+ apply_update(p_nd, p_update);
+ p_nd = p_nd->m_p_parent;
+ }
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+update_to_top(node_pointer /*p_nd*/, __gnu_pbds::null_node_update* /*p_update*/)
+{ }
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/split_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/split_fn_imps.hpp
new file mode 100644
index 0000000..9779a4b
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/split_fn_imps.hpp
@@ -0,0 +1,254 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file split_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+split(const_key_reference r_key, PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid(););
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid(););
+ split_join_branch_bag bag;
+ leaf_pointer p_split_lf = split_prep(r_key, other, bag);
+ if (p_split_lf == NULL)
+ {
+ _GLIBCXX_DEBUG_ASSERT(bag.empty());
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ return;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(!bag.empty());
+ other.clear();
+ m_p_head->m_p_parent = rec_split(m_p_head->m_p_parent,
+ pref_begin(p_split_lf),
+ pref_end(p_split_lf),
+ other,
+ bag);
+
+ m_p_head->m_p_parent->m_p_parent = m_p_head;
+
+ other.m_p_head->m_p_max = m_p_head->m_p_max;
+ m_p_head->m_p_max = rightmost_descendant(m_p_head->m_p_parent);
+ other.m_p_head->m_p_min =
+ other.leftmost_descendant(other.m_p_head->m_p_parent);
+
+ other.m_size = std::distance(other.PB_DS_CLASS_C_DEC::begin(),
+ other.PB_DS_CLASS_C_DEC::end());
+ m_size -= other.m_size;
+ _GLIBCXX_DEBUG_ONLY(assert_valid(););
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid(););
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::leaf_pointer
+PB_DS_CLASS_C_DEC::
+split_prep(const_key_reference r_key, PB_DS_CLASS_C_DEC& other, split_join_branch_bag& r_bag)
+{
+ _GLIBCXX_DEBUG_ASSERT(r_bag.empty());
+ if (m_size == 0)
+ {
+ other.clear();
+ _GLIBCXX_DEBUG_ONLY(assert_valid(););
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid(););
+ return (NULL);
+ }
+
+ if (synth_e_access_traits::cmp_keys(r_key,
+ PB_DS_V2F(static_cast<const_leaf_pointer>(m_p_head->m_p_min)->value())))
+ {
+ other.clear();
+ value_swap(other);
+ _GLIBCXX_DEBUG_ONLY(assert_valid(););
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid(););
+ return (NULL);
+ }
+
+ if (!synth_e_access_traits::cmp_keys(r_key,
+ PB_DS_V2F(static_cast<const_leaf_pointer>(m_p_head->m_p_max)->value())))
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid(););
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid(););
+ return (NULL);
+ }
+
+ iterator it = lower_bound(r_key);
+
+ if (!synth_e_access_traits::equal_keys(PB_DS_V2F(*it), r_key))
+ --it;
+
+ node_pointer p_nd = it.m_p_nd;
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_type == pat_trie_leaf_node_type);
+ leaf_pointer p_ret_l = static_cast<leaf_pointer>(p_nd);
+ while (p_nd->m_type != pat_trie_head_node_type)
+ {
+ r_bag.add_branch();
+ p_nd = p_nd->m_p_parent;
+ }
+ _GLIBCXX_DEBUG_ONLY(debug_base::split(r_key,(synth_e_access_traits& )(*this), other);)
+
+ return (p_ret_l);
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+rec_split(node_pointer p_nd, const_e_iterator b_it, const_e_iterator e_it, PB_DS_CLASS_C_DEC& other, split_join_branch_bag& r_bag)
+{
+ if (p_nd->m_type == pat_trie_leaf_node_type)
+ {
+ _GLIBCXX_DEBUG_ASSERT(other.m_p_head->m_p_parent == NULL);
+ return (p_nd);
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_type == pat_trie_internal_node_type);
+ internal_node_pointer p_internal_nd = static_cast<internal_node_pointer>(p_nd);
+
+ node_pointer p_child_ret = rec_split(p_internal_nd->get_child_node(b_it, e_it, this), b_it, e_it, other, r_bag);
+
+ _GLIBCXX_DEBUG_ONLY(p_child_ret->assert_valid(this);)
+ p_internal_nd->replace_child(p_child_ret, b_it, e_it, this);
+ apply_update(p_internal_nd, (node_update* )this);
+
+ typename internal_node::iterator child_it =
+ p_internal_nd->get_child_it(b_it, e_it, this);
+
+ const size_type lhs_num_children =
+ std::distance(p_internal_nd->begin(), child_it) + 1;
+
+ _GLIBCXX_DEBUG_ASSERT(lhs_num_children > 0);
+
+ size_type rhs_num_children =
+ std::distance(p_internal_nd->begin(), p_internal_nd->end()) -
+ lhs_num_children;
+
+ if (rhs_num_children == 0)
+ {
+ apply_update(p_internal_nd, (node_update* )this);
+ return (p_internal_nd);
+ }
+
+ ++child_it;
+ other.split_insert_branch(p_internal_nd->get_e_ind(),
+ b_it, child_it, rhs_num_children, r_bag);
+
+ child_it = p_internal_nd->get_child_it(b_it, e_it, this);
+ ++child_it;
+ while (rhs_num_children != 0)
+ {
+ child_it = p_internal_nd->remove_child(child_it);
+ --rhs_num_children;
+ }
+
+ apply_update(p_internal_nd, (node_update* )this);
+ _GLIBCXX_DEBUG_ASSERT(std::distance(p_internal_nd->begin(),
+ p_internal_nd->end()) >= 1);
+
+ if (std::distance(p_internal_nd->begin(), p_internal_nd->end()) > 1)
+ {
+ p_internal_nd->update_prefixes(this);
+ _GLIBCXX_DEBUG_ONLY(p_internal_nd->assert_valid(this);)
+ apply_update(p_internal_nd, (node_update* )this);
+ return (p_internal_nd);
+ }
+
+ node_pointer p_ret =* p_internal_nd->begin();
+ p_internal_nd->~internal_node();
+ s_internal_node_allocator.deallocate(p_internal_nd, 1);
+ apply_update(p_ret, (node_update* )this);
+ return (p_ret);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+split_insert_branch(size_type e_ind, const_e_iterator b_it, typename internal_node::iterator child_b_it, size_type num_children, split_join_branch_bag& r_bag)
+{
+#ifdef _GLIBCXX_DEBUG
+ if (m_p_head->m_p_parent != NULL)
+ m_p_head->m_p_parent->assert_valid(this);
+#endif
+
+ const size_type total_num_children =((m_p_head->m_p_parent == NULL)? 0 : 1) + num_children;
+
+ if (total_num_children == 0)
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_head->m_p_parent == NULL);
+ return;
+ }
+
+ if (total_num_children == 1)
+ {
+ if (m_p_head->m_p_parent != NULL)
+ {
+ _GLIBCXX_DEBUG_ONLY(m_p_head->m_p_parent->assert_valid(this);)
+ return;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(m_p_head->m_p_parent == NULL);
+ m_p_head->m_p_parent =* child_b_it;
+ m_p_head->m_p_parent->m_p_parent = m_p_head;
+ apply_update(m_p_head->m_p_parent, (node_update* )this);
+ _GLIBCXX_DEBUG_ONLY(m_p_head->m_p_parent->assert_valid(this);)
+ return;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(total_num_children > 1);
+ internal_node_pointer p_new_root = r_bag.get_branch();
+ new (p_new_root) internal_node(e_ind, b_it);
+ size_type num_inserted = 0;
+ while (num_inserted++ < num_children)
+ {
+ _GLIBCXX_DEBUG_ONLY((*child_b_it)->assert_valid(this);)
+ p_new_root->add_child(*child_b_it, pref_begin(*child_b_it),
+ pref_end(*child_b_it), this);
+ ++child_b_it;
+ }
+
+ if (m_p_head->m_p_parent != NULL)
+ p_new_root->add_child(m_p_head->m_p_parent,
+ pref_begin(m_p_head->m_p_parent),
+ pref_end(m_p_head->m_p_parent), this);
+
+ m_p_head->m_p_parent = p_new_root;
+ p_new_root->m_p_parent = m_p_head;
+ apply_update(m_p_head->m_p_parent, (node_update* )this);
+ _GLIBCXX_DEBUG_ONLY(m_p_head->m_p_parent->assert_valid(this);)
+}
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/split_join_branch_bag.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/split_join_branch_bag.hpp
new file mode 100644
index 0000000..9cecae5
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/split_join_branch_bag.hpp
@@ -0,0 +1,93 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file split_join_branch_bag.hpp
+ * Contains an implementation class for pat_trie_.
+ */
+
+class split_join_branch_bag
+{
+private:
+ typedef
+ std::list<
+ internal_node_pointer,
+ typename Allocator::template rebind<
+ internal_node_pointer>::other>
+ bag_t;
+
+public:
+
+ void
+ add_branch()
+ {
+ internal_node_pointer p_nd = s_internal_node_allocator.allocate(1);
+ __try
+ {
+ m_bag.push_back(p_nd);
+ }
+ __catch(...)
+ {
+ s_internal_node_allocator.deallocate(p_nd, 1);
+ __throw_exception_again;
+ }
+ }
+
+ internal_node_pointer
+ get_branch()
+ {
+ _GLIBCXX_DEBUG_ASSERT(!m_bag.empty());
+ internal_node_pointer p_nd =* m_bag.begin();
+ m_bag.pop_front();
+ return p_nd;
+ }
+
+ ~split_join_branch_bag()
+ {
+ while (!m_bag.empty())
+ {
+ internal_node_pointer p_nd =* m_bag.begin();
+ s_internal_node_allocator.deallocate(p_nd, 1);
+ m_bag.pop_front();
+ }
+ }
+
+ inline bool
+ empty() const
+ { return m_bag.empty(); }
+
+private:
+ bag_t m_bag;
+};
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/synth_e_access_traits.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/synth_e_access_traits.hpp
new file mode 100644
index 0000000..abf5f11
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/synth_e_access_traits.hpp
@@ -0,0 +1,229 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file synth_e_access_traits.hpp
+ * Contains an implementation class for a patricia tree.
+ */
+
+#ifndef PB_DS_SYNTH_E_ACCESS_TRAITS_HPP
+#define PB_DS_SYNTH_E_ACCESS_TRAITS_HPP
+
+#include <ext/pb_ds/detail/type_utils.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_SYNTH_E_ACCESS_TRAITS_T_DEC \
+ template<typename Type_Traits, bool Set, class E_Access_Traits>
+
+#define PB_DS_SYNTH_E_ACCESS_TRAITS_C_DEC \
+ synth_e_access_traits< \
+ Type_Traits, \
+ Set, \
+ E_Access_Traits>
+
+ template<typename Type_Traits, bool Set, class E_Access_Traits>
+ struct synth_e_access_traits : public E_Access_Traits
+ {
+
+ private:
+ typedef E_Access_Traits base_type;
+
+ typedef Type_Traits type_traits;
+
+ typedef typename type_traits::const_key_reference const_key_reference;
+
+ typedef typename type_traits::const_reference const_reference;
+
+ public:
+ synth_e_access_traits();
+
+ synth_e_access_traits(const E_Access_Traits& r_traits);
+
+ inline bool
+ equal_prefixes(typename base_type::const_iterator b_l, typename base_type::const_iterator e_l, typename base_type::const_iterator b_r, typename base_type::const_iterator e_r, bool compare_after = true) const;
+
+ bool
+ equal_keys(const_key_reference r_lhs_key, const_key_reference r_rhs_key) const;
+
+ bool
+ cmp_prefixes(typename base_type::const_iterator b_l, typename base_type::const_iterator e_l, typename base_type::const_iterator b_r, typename base_type::const_iterator e_r, bool compare_after = false) const;
+
+ bool
+ cmp_keys(const_key_reference r_lhs_key, const_key_reference r_rhs_key) const;
+
+ inline static const_key_reference
+ extract_key(const_reference r_val);
+
+#ifdef _GLIBCXX_DEBUG
+ bool
+ operator()(const_key_reference r_lhs, const_key_reference r_rhs);
+#endif
+
+ private:
+ inline static const_key_reference
+ extract_key(const_reference r_val, true_type);
+
+ inline static const_key_reference
+ extract_key(const_reference r_val, false_type);
+
+ private:
+ static integral_constant<int,Set> s_set_ind;
+ };
+
+ PB_DS_SYNTH_E_ACCESS_TRAITS_T_DEC
+ integral_constant<int,Set>
+ PB_DS_SYNTH_E_ACCESS_TRAITS_C_DEC::s_set_ind;
+
+ PB_DS_SYNTH_E_ACCESS_TRAITS_T_DEC
+ PB_DS_SYNTH_E_ACCESS_TRAITS_C_DEC::
+ synth_e_access_traits()
+ { }
+
+ PB_DS_SYNTH_E_ACCESS_TRAITS_T_DEC
+ PB_DS_SYNTH_E_ACCESS_TRAITS_C_DEC::
+ synth_e_access_traits(const E_Access_Traits& r_traits) :
+ E_Access_Traits(r_traits)
+ { }
+
+ PB_DS_SYNTH_E_ACCESS_TRAITS_T_DEC
+ inline bool
+ PB_DS_SYNTH_E_ACCESS_TRAITS_C_DEC::
+ equal_prefixes(typename base_type::const_iterator b_l, typename base_type::const_iterator e_l, typename base_type::const_iterator b_r, typename base_type::const_iterator e_r, bool compare_after /*= false */) const
+ {
+ while (b_l != e_l)
+ {
+ if (b_r == e_r)
+ return (false);
+ if (base_type::e_pos(*b_l) != base_type::e_pos(*b_r))
+ return (false);
+ ++b_l;
+ ++b_r;
+ }
+ return (!compare_after || b_r == e_r);
+ }
+
+ PB_DS_SYNTH_E_ACCESS_TRAITS_T_DEC
+ bool
+ PB_DS_SYNTH_E_ACCESS_TRAITS_C_DEC::
+ equal_keys(const_key_reference r_lhs_key, const_key_reference r_rhs_key) const
+ {
+ return (equal_prefixes(base_type::begin(r_lhs_key),
+ base_type::end(r_lhs_key),
+ base_type::begin(r_rhs_key),
+ base_type::end(r_rhs_key),
+ true));
+ }
+
+ PB_DS_SYNTH_E_ACCESS_TRAITS_T_DEC
+ bool
+ PB_DS_SYNTH_E_ACCESS_TRAITS_C_DEC::
+ cmp_prefixes(typename base_type::const_iterator b_l, typename base_type::const_iterator e_l, typename base_type::const_iterator b_r, typename base_type::const_iterator e_r, bool compare_after /* = false*/) const
+ {
+ while (b_l != e_l)
+ {
+ if (b_r == e_r)
+ return (false);
+ const typename base_type::size_type l_pos =
+ base_type::e_pos(*b_l);
+ const typename base_type::size_type r_pos =
+ base_type::e_pos(*b_r);
+ if (l_pos != r_pos)
+ return (l_pos < r_pos);
+ ++b_l;
+ ++b_r;
+ }
+
+ if (!compare_after)
+ return (false);
+ return (b_r != e_r);
+ }
+
+ PB_DS_SYNTH_E_ACCESS_TRAITS_T_DEC
+ bool
+ PB_DS_SYNTH_E_ACCESS_TRAITS_C_DEC::
+ cmp_keys(const_key_reference r_lhs_key, const_key_reference r_rhs_key) const
+ {
+ return (cmp_prefixes(base_type::begin(r_lhs_key),
+ base_type::end(r_lhs_key),
+ base_type::begin(r_rhs_key),
+ base_type::end(r_rhs_key),
+ true));
+ }
+
+ PB_DS_SYNTH_E_ACCESS_TRAITS_T_DEC
+ inline typename PB_DS_SYNTH_E_ACCESS_TRAITS_C_DEC::const_key_reference
+ PB_DS_SYNTH_E_ACCESS_TRAITS_C_DEC::
+ extract_key(const_reference r_val)
+ {
+ return (extract_key(r_val, s_set_ind));
+ }
+
+ PB_DS_SYNTH_E_ACCESS_TRAITS_T_DEC
+ inline typename PB_DS_SYNTH_E_ACCESS_TRAITS_C_DEC::const_key_reference
+ PB_DS_SYNTH_E_ACCESS_TRAITS_C_DEC::
+ extract_key(const_reference r_val, true_type)
+ {
+ return (r_val);
+ }
+
+ PB_DS_SYNTH_E_ACCESS_TRAITS_T_DEC
+ inline typename PB_DS_SYNTH_E_ACCESS_TRAITS_C_DEC::const_key_reference
+ PB_DS_SYNTH_E_ACCESS_TRAITS_C_DEC::
+ extract_key(const_reference r_val, false_type)
+ {
+ return (r_val.first);
+ }
+
+#ifdef _GLIBCXX_DEBUG
+ PB_DS_SYNTH_E_ACCESS_TRAITS_T_DEC
+ bool
+ PB_DS_SYNTH_E_ACCESS_TRAITS_C_DEC::
+ operator()(const_key_reference r_lhs, const_key_reference r_rhs)
+ {
+ return (cmp_keys(r_lhs, r_rhs));
+ }
+#endif
+
+#undef PB_DS_SYNTH_E_ACCESS_TRAITS_T_DEC
+#undef PB_DS_SYNTH_E_ACCESS_TRAITS_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/trace_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/trace_fn_imps.hpp
new file mode 100644
index 0000000..e4b2094
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/trace_fn_imps.hpp
@@ -0,0 +1,113 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file trace_fn_imps.hpp
+ * Contains an implementation class for pat_trie_.
+ */
+
+#ifdef PB_DS_PAT_TRIE_TRACE_
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+trace() const
+{
+ std::cerr << std::endl;
+ if (m_p_head->m_p_parent == NULL)
+ return;
+ trace_node(m_p_head->m_p_parent, 0);
+ std::cerr << std::endl;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+trace_node(const_node_pointer p_nd, size_type level)
+{
+ for (size_type i = 0; i < level; ++i)
+ std::cerr << ' ';
+ std::cerr << p_nd << " ";
+ std::cerr << ((p_nd->m_type == pat_trie_leaf_node_type) ? "l " : "i ");
+
+ trace_node_metadata(p_nd, type_to_type<typename node::metadata_type>());
+ typename e_access_traits::const_iterator el_it = pref_begin(p_nd);
+ while (el_it != pref_end(p_nd))
+ {
+ std::cerr <<* el_it;
+ ++el_it;
+ }
+
+ if (p_nd->m_type == pat_trie_leaf_node_type)
+ {
+ std::cerr << std::endl;
+ return;
+ }
+
+ const_internal_node_pointer p_internal =
+ static_cast<const_internal_node_pointer>(p_nd);
+
+ std::cerr << " " <<
+ static_cast<unsigned long>(p_internal->get_e_ind()) << std::endl;
+
+ const size_type num_children = std::distance(p_internal->begin(),
+ p_internal->end());
+
+ for (size_type child_i = 0; child_i < num_children; ++child_i)
+ {
+ typename internal_node::const_iterator child_it =
+ p_internal->begin();
+ std::advance(child_it, num_children - child_i - 1);
+ trace_node(*child_it, level + 1);
+ }
+}
+
+PB_DS_CLASS_T_DEC
+template<typename Metadata_>
+void
+PB_DS_CLASS_C_DEC::
+trace_node_metadata(const_node_pointer p_nd, type_to_type<Metadata_>)
+{
+ std::cerr << "(" << static_cast<unsigned long>(p_nd->get_metadata()) << ") ";
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+trace_node_metadata(const_node_pointer, type_to_type<null_node_metadata>)
+{ }
+
+#endif
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/traits.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/traits.hpp
new file mode 100644
index 0000000..c8e7f58
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/traits.hpp
@@ -0,0 +1,350 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file traits.hpp
+ * Contains an implementation class for pat_trie_.
+ */
+
+#ifndef PB_DS_PAT_TRIE_NODE_AND_IT_TRAITS_HPP
+#define PB_DS_PAT_TRIE_NODE_AND_IT_TRAITS_HPP
+
+#include <ext/pb_ds/detail/pat_trie_/node_base.hpp>
+#include <ext/pb_ds/detail/pat_trie_/head.hpp>
+#include <ext/pb_ds/detail/pat_trie_/leaf.hpp>
+#include <ext/pb_ds/detail/pat_trie_/internal_node.hpp>
+#include <ext/pb_ds/detail/pat_trie_/point_iterators.hpp>
+#include <ext/pb_ds/detail/pat_trie_/node_iterators.hpp>
+#include <ext/pb_ds/detail/pat_trie_/synth_e_access_traits.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+ template<typename Key,
+ typename Mapped,
+ class E_Access_Traits,
+ template<typename Const_Node_Iterator,
+ class Node_Iterator,
+ class Cmp_Fn_,
+ class Allocator_>
+ class Node_Update,
+ class Allocator>
+ struct trie_traits<
+ Key,
+ Mapped,
+ E_Access_Traits,
+ Node_Update,
+ pat_trie_tag,
+ Allocator>
+ {
+ private:
+ typedef types_traits< Key, Mapped, Allocator, false> type_traits;
+
+ public:
+ typedef
+ typename trie_node_metadata_selector<
+ Key,
+ Mapped,
+ E_Access_Traits,
+ Node_Update,
+ Allocator>::type
+ metadata_type;
+
+ typedef E_Access_Traits e_access_traits;
+
+ typedef
+ __gnu_pbds::detail::synth_e_access_traits<
+ type_traits,
+ false,
+ e_access_traits>
+ synth_e_access_traits;
+
+ typedef
+ pat_trie_node_base<
+ type_traits,
+ synth_e_access_traits,
+ metadata_type,
+ Allocator>
+ node;
+
+ typedef
+ pat_trie_leaf<
+ type_traits,
+ synth_e_access_traits,
+ metadata_type,
+ Allocator>
+ leaf;
+
+ typedef
+ pat_trie_head<
+ type_traits,
+ synth_e_access_traits,
+ metadata_type,
+ Allocator>
+ head;
+
+ typedef
+ pat_trie_internal_node<
+ type_traits,
+ synth_e_access_traits,
+ metadata_type,
+ Allocator>
+ internal_node;
+
+ typedef
+ pat_trie_const_it_<
+ type_traits,
+ node,
+ leaf,
+ head,
+ internal_node,
+ true,
+ Allocator>
+ const_iterator;
+
+ typedef
+ pat_trie_it_<
+ type_traits,
+ node,
+ leaf,
+ head,
+ internal_node,
+ true,
+ Allocator>
+ iterator;
+
+ typedef
+ pat_trie_const_it_<
+ type_traits,
+ node,
+ leaf,
+ head,
+ internal_node,
+ false,
+ Allocator>
+ const_reverse_iterator;
+
+ typedef
+ pat_trie_it_<
+ type_traits,
+ node,
+ leaf,
+ head,
+ internal_node,
+ false,
+ Allocator>
+ reverse_iterator;
+
+ typedef
+ pat_trie_const_node_it_<
+ node,
+ leaf,
+ head,
+ internal_node,
+ const_iterator,
+ iterator,
+ synth_e_access_traits,
+ Allocator>
+ const_node_iterator;
+
+ typedef
+ pat_trie_node_it_<
+ node,
+ leaf,
+ head,
+ internal_node,
+ const_iterator,
+ iterator,
+ synth_e_access_traits,
+ Allocator>
+ node_iterator;
+
+ typedef
+ Node_Update<
+ const_node_iterator,
+ node_iterator,
+ E_Access_Traits,
+ Allocator>
+ node_update;
+
+ typedef
+ __gnu_pbds::null_trie_node_update<
+ const_node_iterator,
+ node_iterator,
+ E_Access_Traits,
+ Allocator>*
+ null_node_update_pointer;
+ };
+
+ template<typename Key,
+ class E_Access_Traits,
+ template<typename Const_Node_Iterator,
+ class Node_Iterator,
+ class Cmp_Fn_,
+ class Allocator_>
+ class Node_Update,
+ class Allocator>
+ struct trie_traits<
+ Key,
+ null_mapped_type,
+ E_Access_Traits,
+ Node_Update,
+ pat_trie_tag,
+ Allocator>
+ {
+ private:
+ typedef
+ types_traits<
+ Key,
+ null_mapped_type,
+ Allocator,
+ false>
+ type_traits;
+
+ public:
+ typedef
+ typename trie_node_metadata_selector<
+ Key,
+ null_mapped_type,
+ E_Access_Traits,
+ Node_Update,
+ Allocator>::type
+ metadata_type;
+
+ typedef E_Access_Traits e_access_traits;
+
+ typedef
+ __gnu_pbds::detail::synth_e_access_traits<
+ type_traits,
+ true,
+ e_access_traits>
+ synth_e_access_traits;
+
+ typedef
+ pat_trie_node_base<
+ type_traits,
+ synth_e_access_traits,
+ metadata_type,
+ Allocator>
+ node;
+
+ typedef
+ pat_trie_leaf<
+ type_traits,
+ synth_e_access_traits,
+ metadata_type,
+ Allocator>
+ leaf;
+
+ typedef
+ pat_trie_head<
+ type_traits,
+ synth_e_access_traits,
+ metadata_type,
+ Allocator>
+ head;
+
+ typedef
+ pat_trie_internal_node<
+ type_traits,
+ synth_e_access_traits,
+ metadata_type,
+ Allocator>
+ internal_node;
+
+ typedef
+ pat_trie_const_it_<
+ type_traits,
+ node,
+ leaf,
+ head,
+ internal_node,
+ true,
+ Allocator>
+ const_iterator;
+
+ typedef const_iterator iterator;
+
+ typedef
+ pat_trie_const_it_<
+ type_traits,
+ node,
+ leaf,
+ head,
+ internal_node,
+ false,
+ Allocator>
+ const_reverse_iterator;
+
+ typedef const_reverse_iterator reverse_iterator;
+
+ typedef
+ pat_trie_const_node_it_<
+ node,
+ leaf,
+ head,
+ internal_node,
+ const_iterator,
+ iterator,
+ synth_e_access_traits,
+ Allocator>
+ const_node_iterator;
+
+ typedef const_node_iterator node_iterator;
+
+ typedef
+ Node_Update<
+ const_node_iterator,
+ node_iterator,
+ E_Access_Traits,
+ Allocator>
+ node_update;
+
+ typedef
+ __gnu_pbds::null_trie_node_update<
+ const_node_iterator,
+ const_node_iterator,
+ E_Access_Traits,
+ Allocator>*
+ null_node_update_pointer;
+ };
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_PAT_TRIE_NODE_AND_IT_TRAITS_HPP
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/update_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/update_fn_imps.hpp
new file mode 100644
index 0000000..6d275e7
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/pat_trie_/update_fn_imps.hpp
@@ -0,0 +1,55 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file update_fn_imps.hpp
+ * Contains an implementation class for pat_trie_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+apply_update(node_pointer /*p_nd*/, null_node_update_pointer)
+{ }
+
+PB_DS_CLASS_T_DEC
+template<typename Node_Update_>
+inline void
+PB_DS_CLASS_C_DEC::
+apply_update(node_pointer p_nd, Node_Update_* /*p_update*/)
+{
+ Node_Update_::operator()(node_iterator(p_nd, this),
+ const_node_iterator(NULL, this));
+}
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/priority_queue_base_dispatch.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/priority_queue_base_dispatch.hpp
new file mode 100644
index 0000000..ad05c4f
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/priority_queue_base_dispatch.hpp
@@ -0,0 +1,91 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file priority_queue_base_dispatch.hpp
+ * Contains an pqiative container dispatching base.
+ */
+
+#ifndef PB_DS_PRIORITY_QUEUE_BASE_DS_DISPATCHER_HPP
+#define PB_DS_PRIORITY_QUEUE_BASE_DS_DISPATCHER_HPP
+
+#include <ext/pb_ds/detail/pairing_heap_/pairing_heap_.hpp>
+#include <ext/pb_ds/detail/binomial_heap_/binomial_heap_.hpp>
+#include <ext/pb_ds/detail/rc_binomial_heap_/rc_binomial_heap_.hpp>
+#include <ext/pb_ds/detail/binary_heap_/binary_heap_.hpp>
+#include <ext/pb_ds/detail/thin_heap_/thin_heap_.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+ template<typename Value_Type, typename Cmp_Fn, typename Tag, typename Allocator>
+ struct priority_queue_base_dispatch;
+
+ template<typename Value_Type, typename Cmp_Fn, typename Allocator>
+ struct priority_queue_base_dispatch<Value_Type, Cmp_Fn, pairing_heap_tag, Allocator>
+ {
+ typedef pairing_heap_< Value_Type, Cmp_Fn, Allocator> type;
+ };
+
+ template<typename Value_Type, typename Cmp_Fn, typename Allocator>
+ struct priority_queue_base_dispatch<Value_Type, Cmp_Fn, binomial_heap_tag, Allocator>
+ {
+ typedef binomial_heap_< Value_Type, Cmp_Fn, Allocator> type;
+ };
+
+ template<typename Value_Type, typename Cmp_Fn, typename Allocator>
+ struct priority_queue_base_dispatch<Value_Type, Cmp_Fn, rc_binomial_heap_tag, Allocator>
+ {
+ typedef rc_binomial_heap_< Value_Type, Cmp_Fn, Allocator> type;
+ };
+
+ template<typename Value_Type, typename Cmp_Fn, typename Allocator>
+ struct priority_queue_base_dispatch<Value_Type, Cmp_Fn, binary_heap_tag, Allocator>
+ {
+ typedef binary_heap_< Value_Type, Cmp_Fn, Allocator> type;
+ };
+
+ template<typename Value_Type, typename Cmp_Fn, typename Allocator>
+ struct priority_queue_base_dispatch<Value_Type, Cmp_Fn, thin_heap_tag, Allocator>
+ {
+ typedef thin_heap_< Value_Type, Cmp_Fn, Allocator> type;
+ };
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_PRIORITY_QUEUE_BASE_DS_DISPATCHER_HPP
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/constructors_destructor_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/constructors_destructor_fn_imps.hpp
new file mode 100644
index 0000000..1abfe21
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/constructors_destructor_fn_imps.hpp
@@ -0,0 +1,100 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructors_destructor_fn_imps.hpp
+ * Contains an implementation for rb_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+template<typename It>
+void
+PB_DS_CLASS_C_DEC::
+copy_from_range(It first_it, It last_it)
+{
+ while (first_it != last_it)
+ insert(*(first_it++));
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME()
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const Cmp_Fn& r_cmp_fn) :
+ base_type(r_cmp_fn)
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const Cmp_Fn& r_cmp_fn, const node_update& r_node_update) :
+ base_type(r_cmp_fn, r_node_update)
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const PB_DS_CLASS_C_DEC& other) :
+ base_type(other)
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ base_type::swap(other);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+initialize()
+{ base_type::m_p_head->m_red = true; }
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/debug_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/debug_fn_imps.hpp
new file mode 100644
index 0000000..18ecc42
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/debug_fn_imps.hpp
@@ -0,0 +1,78 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_fn_imps.hpp
+ * Contains an implementation for rb_tree_.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+assert_node_consistent(const node_pointer p_nd) const
+{
+ if (p_nd == NULL)
+ return 1;
+
+ const size_type l_height = assert_node_consistent(p_nd->m_p_left);
+ const size_type r_height = assert_node_consistent(p_nd->m_p_right);
+ if (p_nd->m_red)
+ {
+ _GLIBCXX_DEBUG_ASSERT(is_effectively_black(p_nd->m_p_left));
+ _GLIBCXX_DEBUG_ASSERT(is_effectively_black(p_nd->m_p_right));
+ }
+ _GLIBCXX_DEBUG_ASSERT(l_height == r_height);
+ return (p_nd->m_red ? 0 : 1) + l_height;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_valid() const
+{
+ base_type::assert_valid();
+ const node_pointer p_head = base_type::m_p_head;
+ _GLIBCXX_DEBUG_ASSERT(p_head->m_red);
+ if (p_head->m_p_parent != NULL)
+ {
+ _GLIBCXX_DEBUG_ASSERT(!p_head->m_p_parent->m_red);
+ assert_node_consistent(p_head->m_p_parent);
+ }
+}
+
+#endif
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/erase_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/erase_fn_imps.hpp
new file mode 100644
index 0000000..685b8a5
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/erase_fn_imps.hpp
@@ -0,0 +1,289 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file erase_fn_imps.hpp
+ * Contains an implementation for rb_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+erase(const_key_reference r_key)
+{
+ point_iterator it = find(r_key);
+ if (it == base_type::end())
+ return false;
+ erase(it);
+ return true;
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+erase(iterator it)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ if (it == base_type::end())
+ return it;
+
+ iterator ret_it = it;
+ ++ret_it;
+ erase_node(it.m_p_nd);
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ return ret_it;
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::reverse_iterator
+PB_DS_CLASS_C_DEC::
+erase(reverse_iterator it)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ if (it.m_p_nd == base_type::m_p_head)
+ return it;
+
+ reverse_iterator ret_it = it;
+ ++ret_it;
+ erase_node(it.m_p_nd);
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ return ret_it;
+}
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+erase_if(Pred pred)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ size_type num_ersd = 0;
+ iterator it = base_type::begin();
+ while (it != base_type::end())
+ {
+ if (pred(*it))
+ {
+ ++num_ersd;
+ it = erase(it);
+ }
+ else
+ ++it;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return num_ersd;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+erase_node(node_pointer p_nd)
+{
+ remove_node(p_nd);
+ base_type::actual_erase_node(p_nd);
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+remove_node(node_pointer p_z)
+{
+ update_min_max_for_erased_node(p_z);
+ node_pointer p_y = p_z;
+ node_pointer p_x = NULL;
+ node_pointer p_new_x_parent = NULL;
+
+ if (p_y->m_p_left == NULL)
+ p_x = p_y->m_p_right;
+ else if (p_y->m_p_right == NULL)
+ p_x = p_y->m_p_left;
+ else
+ {
+ p_y = p_y->m_p_right;
+ while (p_y->m_p_left != NULL)
+ p_y = p_y->m_p_left;
+ p_x = p_y->m_p_right;
+ }
+
+ if (p_y == p_z)
+ {
+ p_new_x_parent = p_y->m_p_parent;
+ if (p_x != NULL)
+ p_x->m_p_parent = p_y->m_p_parent;
+
+ if (base_type::m_p_head->m_p_parent == p_z)
+ base_type::m_p_head->m_p_parent = p_x;
+ else if (p_z->m_p_parent->m_p_left == p_z)
+ {
+ p_y->m_p_left = p_z->m_p_parent;
+ p_z->m_p_parent->m_p_left = p_x;
+ }
+ else
+ {
+ p_y->m_p_left = NULL;
+ p_z->m_p_parent->m_p_right = p_x;
+ }
+ }
+ else
+ {
+ p_z->m_p_left->m_p_parent = p_y;
+ p_y->m_p_left = p_z->m_p_left;
+ if (p_y != p_z->m_p_right)
+ {
+ p_new_x_parent = p_y->m_p_parent;
+ if (p_x != NULL)
+ p_x->m_p_parent = p_y->m_p_parent;
+ p_y->m_p_parent->m_p_left = p_x;
+ p_y->m_p_right = p_z->m_p_right;
+ p_z->m_p_right->m_p_parent = p_y;
+ }
+ else
+ p_new_x_parent = p_y;
+
+ if (base_type::m_p_head->m_p_parent == p_z)
+ base_type::m_p_head->m_p_parent = p_y;
+ else if (p_z->m_p_parent->m_p_left == p_z)
+ p_z->m_p_parent->m_p_left = p_y;
+ else
+ p_z->m_p_parent->m_p_right = p_y;
+
+ p_y->m_p_parent = p_z->m_p_parent;
+ std::swap(p_y->m_red, p_z->m_red);
+ p_y = p_z;
+ }
+
+ update_to_top(p_new_x_parent, (node_update* )this);
+
+ if (p_y->m_red)
+ return;
+
+ remove_fixup(p_x, p_new_x_parent);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+remove_fixup(node_pointer p_x, node_pointer p_new_x_parent)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_x == NULL || p_x->m_p_parent == p_new_x_parent);
+
+ while (p_x != base_type::m_p_head->m_p_parent && is_effectively_black(p_x))
+ if (p_x == p_new_x_parent->m_p_left)
+ {
+ node_pointer p_w = p_new_x_parent->m_p_right;
+ if (p_w->m_red)
+ {
+ p_w->m_red = false;
+ p_new_x_parent->m_red = true;
+ base_type::rotate_left(p_new_x_parent);
+ p_w = p_new_x_parent->m_p_right;
+ }
+
+ if (is_effectively_black(p_w->m_p_left)
+ && is_effectively_black(p_w->m_p_right))
+ {
+ p_w->m_red = true;
+ p_x = p_new_x_parent;
+ p_new_x_parent = p_new_x_parent->m_p_parent;
+ }
+ else
+ {
+ if (is_effectively_black(p_w->m_p_right))
+ {
+ if (p_w->m_p_left != NULL)
+ p_w->m_p_left->m_red = false;
+
+ p_w->m_red = true;
+ base_type::rotate_right(p_w);
+ p_w = p_new_x_parent->m_p_right;
+ }
+
+ p_w->m_red = p_new_x_parent->m_red;
+ p_new_x_parent->m_red = false;
+
+ if (p_w->m_p_right != NULL)
+ p_w->m_p_right->m_red = false;
+
+ base_type::rotate_left(p_new_x_parent);
+ update_to_top(p_new_x_parent, (node_update* )this);
+ break;
+ }
+ }
+ else
+ {
+ node_pointer p_w = p_new_x_parent->m_p_left;
+ if (p_w->m_red == true)
+ {
+ p_w->m_red = false;
+ p_new_x_parent->m_red = true;
+ base_type::rotate_right(p_new_x_parent);
+ p_w = p_new_x_parent->m_p_left;
+ }
+
+ if (is_effectively_black(p_w->m_p_right)
+ && is_effectively_black(p_w->m_p_left))
+ {
+ p_w->m_red = true;
+ p_x = p_new_x_parent;
+ p_new_x_parent = p_new_x_parent->m_p_parent;
+ }
+ else
+ {
+ if (is_effectively_black(p_w->m_p_left))
+ {
+ if (p_w->m_p_right != NULL)
+ p_w->m_p_right->m_red = false;
+
+ p_w->m_red = true;
+ base_type::rotate_left(p_w);
+ p_w = p_new_x_parent->m_p_left;
+ }
+
+ p_w->m_red = p_new_x_parent->m_red;
+ p_new_x_parent->m_red = false;
+
+ if (p_w->m_p_left != NULL)
+ p_w->m_p_left->m_red = false;
+
+ base_type::rotate_right(p_new_x_parent);
+ update_to_top(p_new_x_parent, (node_update* )this);
+ break;
+ }
+ }
+
+ if (p_x != NULL)
+ p_x->m_red = false;
+}
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/find_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/find_fn_imps.hpp
new file mode 100644
index 0000000..9378e15
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/find_fn_imps.hpp
@@ -0,0 +1,39 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file find_fn_imps.hpp
+ * Contains an implementation for rb_tree_.
+ */
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/info_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/info_fn_imps.hpp
new file mode 100644
index 0000000..6b43b1a
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/info_fn_imps.hpp
@@ -0,0 +1,46 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file info_fn_imps.hpp
+ * Contains an implementation for rb_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+is_effectively_black(const node_pointer p_nd)
+{ return (p_nd == NULL || !p_nd->m_red); }
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/insert_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/insert_fn_imps.hpp
new file mode 100644
index 0000000..16a5d1e
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/insert_fn_imps.hpp
@@ -0,0 +1,115 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file insert_fn_imps.hpp
+ * Contains an implementation for rb_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline std::pair<typename PB_DS_CLASS_C_DEC::point_iterator, bool>
+PB_DS_CLASS_C_DEC::
+insert(const_reference r_value)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ std::pair<point_iterator, bool> ins_pair = base_type::insert_leaf(r_value);
+ if (ins_pair.second == true)
+ {
+ ins_pair.first.m_p_nd->m_red = true;
+ _GLIBCXX_DEBUG_ONLY(this->structure_only_assert_valid();)
+ insert_fixup(ins_pair.first.m_p_nd);
+ }
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return ins_pair;
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+insert_fixup(node_pointer p_nd)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_red == true);
+ while (p_nd != base_type::m_p_head->m_p_parent && p_nd->m_p_parent->m_red)
+ {
+ if (p_nd->m_p_parent == p_nd->m_p_parent->m_p_parent->m_p_left)
+ {
+ node_pointer p_y = p_nd->m_p_parent->m_p_parent->m_p_right;
+ if (p_y != NULL && p_y->m_red)
+ {
+ p_nd->m_p_parent->m_red = false;
+ p_y->m_red = false;
+ p_nd->m_p_parent->m_p_parent->m_red = true;
+ p_nd = p_nd->m_p_parent->m_p_parent;
+ }
+ else
+ {
+ if (p_nd == p_nd->m_p_parent->m_p_right)
+ {
+ p_nd = p_nd->m_p_parent;
+ base_type::rotate_left(p_nd);
+ }
+ p_nd->m_p_parent->m_red = false;
+ p_nd->m_p_parent->m_p_parent->m_red = true;
+ base_type::rotate_right(p_nd->m_p_parent->m_p_parent);
+ }
+ }
+ else
+ {
+ node_pointer p_y = p_nd->m_p_parent->m_p_parent->m_p_left;
+ if (p_y != NULL && p_y->m_red)
+ {
+ p_nd->m_p_parent->m_red = false;
+ p_y->m_red = false;
+ p_nd->m_p_parent->m_p_parent->m_red = true;
+ p_nd = p_nd->m_p_parent->m_p_parent;
+ }
+ else
+ {
+ if (p_nd == p_nd->m_p_parent->m_p_left)
+ {
+ p_nd = p_nd->m_p_parent;
+ base_type::rotate_right(p_nd);
+ }
+ p_nd->m_p_parent->m_red = false;
+ p_nd->m_p_parent->m_p_parent->m_red = true;
+ base_type::rotate_left(p_nd->m_p_parent->m_p_parent);
+ }
+ }
+ }
+
+ base_type::update_to_top(p_nd, (node_update* )this);
+ base_type::m_p_head->m_p_parent->m_red = false;
+}
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/node.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/node.hpp
new file mode 100644
index 0000000..3f24c76
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/node.hpp
@@ -0,0 +1,138 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file node.hpp
+ * Contains an implementation for rb_tree_.
+ */
+
+#ifndef PB_DS_RB_TREE_NODE_HPP
+#define PB_DS_RB_TREE_NODE_HPP
+
+#include <ext/pb_ds/detail/basic_tree_policy/null_node_metadata.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ template<typename Value_Type, class Metadata, class Allocator>
+ struct rb_tree_node_
+ {
+ public:
+ typedef Value_Type value_type;
+ typedef Metadata metadata_type;
+
+ typedef
+ typename Allocator::template rebind<
+ rb_tree_node_<
+ Value_Type,
+ Metadata,
+ Allocator> >::other::pointer
+ node_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ metadata_type>::other::reference
+ metadata_reference;
+
+ typedef
+ typename Allocator::template rebind<
+ metadata_type>::other::const_reference
+ const_metadata_reference;
+
+ inline bool
+ special() const
+ { return m_red; }
+
+ inline const_metadata_reference
+ get_metadata() const
+ { return m_metadata; }
+
+ inline metadata_reference
+ get_metadata()
+ { return m_metadata; }
+
+#ifdef PB_DS_BIN_SEARCH_TREE_TRACE_
+ void
+ trace() const
+ {
+ std::cout << PB_DS_V2F(m_value) <<(m_red? " <r> " : " <b> ")
+ << "(" << m_metadata << ")";
+ }
+#endif
+
+ node_pointer m_p_left;
+ node_pointer m_p_right;
+ node_pointer m_p_parent;
+ value_type m_value;
+ bool m_red;
+ metadata_type m_metadata;
+ };
+
+ template<typename Value_Type, class Allocator>
+ struct rb_tree_node_<Value_Type, null_node_metadata, Allocator>
+ {
+ public:
+ typedef Value_Type value_type;
+ typedef null_node_metadata metadata_type;
+
+ typedef
+ typename Allocator::template rebind<
+ rb_tree_node_<
+ Value_Type,
+ null_node_metadata,
+ Allocator> >::other::pointer
+ node_pointer;
+
+ inline bool
+ special() const
+ { return m_red; }
+
+#ifdef PB_DS_BIN_SEARCH_TREE_TRACE_
+ void
+ trace() const
+ { std::cout << PB_DS_V2F(m_value) <<(m_red? " <r> " : " <b> "); }
+#endif
+
+ node_pointer m_p_left;
+ node_pointer m_p_right;
+ node_pointer m_p_parent;
+ value_type m_value;
+ bool m_red;
+ };
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/rb_tree_.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/rb_tree_.hpp
new file mode 100644
index 0000000..9010def
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/rb_tree_.hpp
@@ -0,0 +1,280 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file rb_tree_.hpp
+ * Contains an implementation for rb_tree_.
+ */
+/*
+ * This implementation uses an idea from the SGI STL (using a "header" node
+ * which is needed for efficient iteration).
+ */
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#ifndef PB_DS_BIN_SEARCH_TREE_HPP__DATA_TRUE_INDICATOR
+#define PB_DS_BIN_SEARCH_TREE_HPP__DATA_TRUE_INDICATOR
+#include <ext/pb_ds/detail/bin_search_tree_/bin_search_tree_.hpp>
+#endif
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#ifndef PB_DS_BIN_SEARCH_TREE_HPP__DATA_FALSE_INDICATOR
+#define PB_DS_BIN_SEARCH_TREE_HPP__DATA_FALSE_INDICATOR
+#include <ext/pb_ds/detail/bin_search_tree_/bin_search_tree_.hpp>
+#endif
+#endif
+
+#include <ext/pb_ds/detail/standard_policies.hpp>
+#include <ext/pb_ds/detail/basic_types.hpp>
+#include <utility>
+#include <vector>
+#include <assert.h>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, typename Mapped, typename Cmp_Fn, \
+ typename Node_And_It_Traits, typename Allocator>
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_CLASS_NAME rb_tree_data_
+#endif
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_BASE_CLASS_NAME bin_search_tree_data_
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#define PB_DS_CLASS_NAME rb_tree_no_data_
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#define PB_DS_BASE_CLASS_NAME bin_search_tree_no_data_
+#endif
+
+#define PB_DS_CLASS_C_DEC \
+ PB_DS_CLASS_NAME<Key, Mapped, Cmp_Fn, Node_And_It_Traits, Allocator>
+
+#define PB_DS_BASE_C_DEC \
+ PB_DS_BASE_CLASS_NAME<Key, Mapped, Cmp_Fn, Node_And_It_Traits, Allocator>
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_V2F(X) (X).first
+#define PB_DS_V2S(X) (X).second
+#define PB_DS_EP2VP(X)& ((X)->m_value)
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#define PB_DS_V2F(X) (X)
+#define PB_DS_V2S(X) Mapped_Data()
+#define PB_DS_EP2VP(X)& ((X)->m_value.first)
+#endif
+
+ template<typename Key,
+ typename Mapped,
+ typename Cmp_Fn,
+ typename Node_And_It_Traits,
+ typename Allocator>
+ class PB_DS_CLASS_NAME : public PB_DS_BASE_C_DEC
+ {
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+ typedef typename base_type::node_pointer node_pointer;
+
+ public:
+ typedef Cmp_Fn cmp_fn;
+ typedef Allocator allocator_type;
+ typedef typename Allocator::size_type size_type;
+ typedef typename Allocator::difference_type difference_type;
+ typedef typename base_type::key_type key_type;
+ typedef typename base_type::key_pointer key_pointer;
+ typedef typename base_type::const_key_pointer const_key_pointer;
+ typedef typename base_type::key_reference key_reference;
+ typedef typename base_type::const_key_reference const_key_reference;
+ typedef typename base_type::mapped_type mapped_type;
+ typedef typename base_type::mapped_pointer mapped_pointer;
+ typedef typename base_type::const_mapped_pointer const_mapped_pointer;
+ typedef typename base_type::mapped_reference mapped_reference;
+ typedef typename base_type::const_mapped_reference const_mapped_reference;
+ typedef typename base_type::value_type value_type;
+ typedef typename base_type::pointer pointer;
+ typedef typename base_type::const_pointer const_pointer;
+ typedef typename base_type::reference reference;
+ typedef typename base_type::const_reference const_reference;
+ typedef typename base_type::point_iterator point_iterator;
+ typedef typename base_type::const_iterator const_point_iterator;
+ typedef typename base_type::iterator iterator;
+ typedef typename base_type::const_iterator const_iterator;
+ typedef typename base_type::reverse_iterator reverse_iterator;
+ typedef typename base_type::const_reverse_iterator const_reverse_iterator;
+ typedef typename base_type::node_update node_update;
+
+
+ PB_DS_CLASS_NAME();
+
+ PB_DS_CLASS_NAME(const Cmp_Fn&);
+
+ PB_DS_CLASS_NAME(const Cmp_Fn&, const node_update&);
+
+ PB_DS_CLASS_NAME(const PB_DS_CLASS_C_DEC&);
+
+ void
+ swap(PB_DS_CLASS_C_DEC&);
+
+ template<typename It>
+ void
+ copy_from_range(It, It);
+
+ inline std::pair<point_iterator, bool>
+ insert(const_reference);
+
+ inline mapped_reference
+ operator[](const_key_reference r_key)
+ {
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ std::pair<point_iterator, bool> ins_pair =
+ base_type::insert_leaf(value_type(r_key, mapped_type()));
+
+ if (ins_pair.second == true)
+ {
+ ins_pair.first.m_p_nd->m_red = true;
+ _GLIBCXX_DEBUG_ONLY(this->structure_only_assert_valid();)
+ insert_fixup(ins_pair.first.m_p_nd);
+ }
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return ins_pair.first.m_p_nd->m_value.second;
+#else
+ insert(r_key);
+ return base_type::s_null_mapped;
+#endif
+ }
+
+ inline bool
+ erase(const_key_reference);
+
+ inline iterator
+ erase(iterator);
+
+ inline reverse_iterator
+ erase(reverse_iterator);
+
+ template<typename Pred>
+ inline size_type
+ erase_if(Pred);
+
+ void
+ join(PB_DS_CLASS_C_DEC&);
+
+ void
+ split(const_key_reference, PB_DS_CLASS_C_DEC&);
+
+ protected:
+
+ private:
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid() const;
+
+ size_type
+ assert_node_consistent(const node_pointer) const;
+#endif
+
+ inline static bool
+ is_effectively_black(const node_pointer);
+
+ void
+ initialize();
+
+ void
+ insert_fixup(node_pointer);
+
+ void
+ erase_node(node_pointer);
+
+ void
+ remove_node(node_pointer);
+
+ void
+ remove_fixup(node_pointer, node_pointer);
+
+ void
+ split_imp(node_pointer, PB_DS_CLASS_C_DEC&);
+
+ inline node_pointer
+ split_min();
+
+ std::pair<node_pointer, node_pointer>
+ split_min_imp();
+
+ void
+ join_imp(node_pointer, node_pointer);
+
+ std::pair<node_pointer, node_pointer>
+ find_join_pos_right(node_pointer, size_type, size_type);
+
+ std::pair<node_pointer, node_pointer>
+ find_join_pos_left(node_pointer, size_type, size_type);
+
+ inline size_type
+ black_height(node_pointer);
+
+ void
+ split_at_node(node_pointer, PB_DS_CLASS_C_DEC&);
+ };
+
+#include <ext/pb_ds/detail/rb_tree_map_/constructors_destructor_fn_imps.hpp>
+#include <ext/pb_ds/detail/rb_tree_map_/insert_fn_imps.hpp>
+#include <ext/pb_ds/detail/rb_tree_map_/erase_fn_imps.hpp>
+#include <ext/pb_ds/detail/rb_tree_map_/debug_fn_imps.hpp>
+#include <ext/pb_ds/detail/rb_tree_map_/split_join_fn_imps.hpp>
+#include <ext/pb_ds/detail/rb_tree_map_/info_fn_imps.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_CLASS_NAME
+#undef PB_DS_BASE_CLASS_NAME
+#undef PB_DS_BASE_C_DEC
+#undef PB_DS_V2F
+#undef PB_DS_EP2VP
+#undef PB_DS_V2S
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/split_join_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/split_join_fn_imps.hpp
new file mode 100644
index 0000000..9776a8d
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/split_join_fn_imps.hpp
@@ -0,0 +1,313 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file split_join_fn_imps.hpp
+ * Contains an implementation for rb_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+join(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.base_type::assert_valid();)
+ if (base_type::join_prep(other) == false)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ return;
+ }
+
+ const node_pointer p_x = other.split_min();
+ join_imp(p_x, other.m_p_head->m_p_parent);
+ base_type::join_finish(other);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.base_type::assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+join_imp(node_pointer p_x, node_pointer p_r)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_x != NULL);
+ if (p_r != NULL)
+ p_r->m_red = false;
+
+ const size_type h = black_height(base_type::m_p_head->m_p_parent);
+ const size_type other_h = black_height(p_r);
+ node_pointer p_x_l;
+ node_pointer p_x_r;
+ std::pair<node_pointer, node_pointer> join_pos;
+ const bool right_join = h >= other_h;
+ if (right_join)
+ {
+ join_pos = find_join_pos_right(base_type::m_p_head->m_p_parent,
+ h, other_h);
+ p_x_l = join_pos.first;
+ p_x_r = p_r;
+ }
+ else
+ {
+ p_x_l = base_type::m_p_head->m_p_parent;
+ base_type::m_p_head->m_p_parent = p_r;
+ if (p_r != NULL)
+ p_r->m_p_parent = base_type::m_p_head;
+
+ join_pos = find_join_pos_left(base_type::m_p_head->m_p_parent,
+ h, other_h);
+ p_x_r = join_pos.first;
+ }
+
+ node_pointer p_parent = join_pos.second;
+ if (p_parent == base_type::m_p_head)
+ {
+ base_type::m_p_head->m_p_parent = p_x;
+ p_x->m_p_parent = base_type::m_p_head;
+ }
+ else
+ {
+ p_x->m_p_parent = p_parent;
+ if (right_join)
+ p_x->m_p_parent->m_p_right = p_x;
+ else
+ p_x->m_p_parent->m_p_left = p_x;
+ }
+
+ p_x->m_p_left = p_x_l;
+ if (p_x_l != NULL)
+ p_x_l->m_p_parent = p_x;
+
+ p_x->m_p_right = p_x_r;
+ if (p_x_r != NULL)
+ p_x_r->m_p_parent = p_x;
+
+ p_x->m_red = true;
+
+ base_type::initialize_min_max();
+ _GLIBCXX_DEBUG_ONLY(base_type::structure_only_assert_valid();)
+ base_type::update_to_top(p_x, (node_update* )this);
+ insert_fixup(p_x);
+ _GLIBCXX_DEBUG_ONLY(base_type::structure_only_assert_valid());
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+split_min()
+{
+ node_pointer p_min = base_type::m_p_head->m_p_left;
+
+#ifdef _GLIBCXX_DEBUG
+ const node_pointer p_head = base_type::m_p_head;
+ _GLIBCXX_DEBUG_ASSERT(p_min != p_head);
+#endif
+
+ remove_node(p_min);
+ return p_min;
+}
+
+PB_DS_CLASS_T_DEC
+std::pair<
+ typename PB_DS_CLASS_C_DEC::node_pointer,
+ typename PB_DS_CLASS_C_DEC::node_pointer>
+PB_DS_CLASS_C_DEC::
+find_join_pos_right(node_pointer p_l, size_type h_l, size_type h_r)
+{
+ _GLIBCXX_DEBUG_ASSERT(h_l >= h_r);
+
+ if (base_type::m_p_head->m_p_parent == NULL)
+ return (std::make_pair((node_pointer)NULL, base_type::m_p_head));
+
+ node_pointer p_l_parent = base_type::m_p_head;
+ while (h_l > h_r)
+ {
+ if (p_l->m_red == false)
+ {
+ _GLIBCXX_DEBUG_ASSERT(h_l > 0);
+ --h_l;
+ }
+
+ p_l_parent = p_l;
+ p_l = p_l->m_p_right;
+ }
+
+ if (!is_effectively_black(p_l))
+ {
+ p_l_parent = p_l;
+ p_l = p_l->m_p_right;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(is_effectively_black(p_l));
+ _GLIBCXX_DEBUG_ASSERT(black_height(p_l) == h_r);
+ _GLIBCXX_DEBUG_ASSERT(p_l == NULL || p_l->m_p_parent == p_l_parent);
+ return std::make_pair(p_l, p_l_parent);
+}
+
+PB_DS_CLASS_T_DEC
+std::pair<
+ typename PB_DS_CLASS_C_DEC::node_pointer,
+ typename PB_DS_CLASS_C_DEC::node_pointer>
+PB_DS_CLASS_C_DEC::
+find_join_pos_left(node_pointer p_r, size_type h_l, size_type h_r)
+{
+ _GLIBCXX_DEBUG_ASSERT(h_r > h_l);
+ if (base_type::m_p_head->m_p_parent == NULL)
+ return (std::make_pair((node_pointer)NULL,
+ base_type::m_p_head));
+ node_pointer p_r_parent = base_type::m_p_head;
+ while (h_r > h_l)
+ {
+ if (p_r->m_red == false)
+ {
+ _GLIBCXX_DEBUG_ASSERT(h_r > 0);
+ --h_r;
+ }
+
+ p_r_parent = p_r;
+ p_r = p_r->m_p_left;
+ }
+
+ if (!is_effectively_black(p_r))
+ {
+ p_r_parent = p_r;
+ p_r = p_r->m_p_left;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(is_effectively_black(p_r));
+ _GLIBCXX_DEBUG_ASSERT(black_height(p_r) == h_l);
+ _GLIBCXX_DEBUG_ASSERT(p_r == NULL || p_r->m_p_parent == p_r_parent);
+ return std::make_pair(p_r, p_r_parent);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+black_height(node_pointer p_nd)
+{
+ size_type h = 1;
+ while (p_nd != NULL)
+ {
+ if (p_nd->m_red == false)
+ ++h;
+ p_nd = p_nd->m_p_left;
+ }
+ return h;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+split(const_key_reference r_key, PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_valid();)
+
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid());
+ _GLIBCXX_DEBUG_ONLY(other.base_type::assert_valid();)
+
+ if (base_type::split_prep(r_key, other) == false)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid());
+ return;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(base_type::structure_only_assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.base_type::structure_only_assert_valid();)
+ node_pointer p_nd = upper_bound(r_key).m_p_nd;
+ do
+ {
+ node_pointer p_next_nd = p_nd->m_p_parent;
+ if (Cmp_Fn::operator()(r_key, PB_DS_V2F(p_nd->m_value)))
+ split_at_node(p_nd, other);
+
+ _GLIBCXX_DEBUG_ONLY(base_type::structure_only_assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.base_type::structure_only_assert_valid();)
+ p_nd = p_next_nd;
+ }
+ while (p_nd != base_type::m_p_head);
+
+ base_type::split_finish(other);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+split_at_node(node_pointer p_nd, PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_nd != NULL);
+
+ node_pointer p_l = p_nd->m_p_left;
+ node_pointer p_r = p_nd->m_p_right;
+ node_pointer p_parent = p_nd->m_p_parent;
+ if (p_parent == base_type::m_p_head)
+ {
+ base_type::m_p_head->m_p_parent = p_l;
+ if (p_l != NULL)
+ {
+ p_l->m_p_parent = base_type::m_p_head;
+ p_l->m_red = false;
+ }
+ }
+ else
+ {
+ if (p_parent->m_p_left == p_nd)
+ p_parent->m_p_left = p_l;
+ else
+ p_parent->m_p_right = p_l;
+
+ if (p_l != NULL)
+ p_l->m_p_parent = p_parent;
+
+ update_to_top(p_parent, (node_update* )this);
+
+ if (!p_nd->m_red)
+ remove_fixup(p_l, p_parent);
+ }
+
+ base_type::initialize_min_max();
+ other.join_imp(p_nd, p_r);
+ _GLIBCXX_DEBUG_ONLY(base_type::structure_only_assert_valid());
+ _GLIBCXX_DEBUG_ONLY(other.base_type::structure_only_assert_valid());
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/traits.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/traits.hpp
new file mode 100644
index 0000000..531d8e4
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rb_tree_map_/traits.hpp
@@ -0,0 +1,124 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file traits.hpp
+ * Contains an implementation for rb_tree_.
+ */
+
+#ifndef PB_DS_RB_TREE_NODE_AND_IT_TRAITS_HPP
+#define PB_DS_RB_TREE_NODE_AND_IT_TRAITS_HPP
+
+#include <ext/pb_ds/detail/rb_tree_map_/node.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ template<typename Key,
+ typename Mapped,
+ typename Cmp_Fn,
+ template<typename Const_Node_Iterator,
+ class Node_Iterator,
+ class Cmp_Fn_,
+ class Allocator_>
+ class Node_Update,
+ typename Allocator>
+ struct tree_traits<
+ Key,
+ Mapped,
+ Cmp_Fn,
+ Node_Update,
+ rb_tree_tag,
+ Allocator> : public bin_search_tree_traits<
+ Key,
+ Mapped,
+ Cmp_Fn,
+ Node_Update,
+ rb_tree_node_<
+ typename types_traits<
+ Key,
+ Mapped,
+ Allocator,
+ false>::value_type,
+ typename tree_node_metadata_selector<
+ Key,
+ Mapped,
+ Cmp_Fn,
+ Node_Update,
+ Allocator>::type,
+ Allocator>,
+ Allocator>
+ { };
+
+ template<typename Key,
+ class Cmp_Fn,
+ template<typename Const_Node_Iterator,
+ class Node_Iterator,
+ class Cmp_Fn_,
+ class Allocator_>
+ class Node_Update,
+ class Allocator>
+ struct tree_traits<
+ Key,
+ null_mapped_type,
+ Cmp_Fn,
+ Node_Update,
+ rb_tree_tag,
+ Allocator> : public bin_search_tree_traits<
+ Key,
+ null_mapped_type,
+ Cmp_Fn,
+ Node_Update,
+ rb_tree_node_<
+ typename types_traits<
+ Key,
+ null_mapped_type,
+ Allocator,
+ false>::value_type,
+ typename tree_node_metadata_selector<
+ Key,
+ null_mapped_type,
+ Cmp_Fn,
+ Node_Update,
+ Allocator>::type,
+ Allocator>,
+ Allocator>
+ { };
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rc_binomial_heap_/constructors_destructor_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rc_binomial_heap_/constructors_destructor_fn_imps.hpp
new file mode 100644
index 0000000..bf4dcfe
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rc_binomial_heap_/constructors_destructor_fn_imps.hpp
@@ -0,0 +1,88 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructors_destructor_fn_imps.hpp
+ * Contains an implementation for rc_binomial_heap_.
+ */
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+rc_binomial_heap_()
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+rc_binomial_heap_(const Cmp_Fn& r_cmp_fn) :
+ PB_DS_BASE_C_DEC(r_cmp_fn)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+rc_binomial_heap_(const PB_DS_CLASS_C_DEC& other) :
+ PB_DS_BASE_C_DEC(other)
+{
+ make_binomial_heap();
+
+ base_type::find_max();
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+~rc_binomial_heap_()
+{ }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+
+ base_type::swap(other);
+
+ m_rc.swap(other.m_rc);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ }
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rc_binomial_heap_/debug_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rc_binomial_heap_/debug_fn_imps.hpp
new file mode 100644
index 0000000..0194905
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rc_binomial_heap_/debug_fn_imps.hpp
@@ -0,0 +1,121 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_fn_imps.hpp
+ * Contains an implementation for rc_binomial_heap_.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_valid() const
+{
+ base_type::assert_valid(false);
+ if (!base_type::empty())
+ {
+ _GLIBCXX_DEBUG_ASSERT(base_type::m_p_max != NULL);
+ base_type::assert_max();
+ }
+
+ m_rc.assert_valid();
+
+ if (m_rc.empty())
+ {
+ base_type::assert_valid(true);
+ _GLIBCXX_DEBUG_ASSERT(next_2_pointer(base_type::m_p_root) == NULL);
+ return;
+ }
+
+ const_node_pointer p_nd = next_2_pointer(base_type::m_p_root);
+ typename rc_t::const_iterator it = m_rc.end();
+ --it;
+
+ while (p_nd != NULL)
+ {
+ _GLIBCXX_DEBUG_ASSERT(*it == p_nd);
+ const_node_pointer p_next = p_nd->m_p_next_sibling;
+ _GLIBCXX_DEBUG_ASSERT(p_next != NULL);
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_metadata == p_next->m_metadata);
+ _GLIBCXX_DEBUG_ASSERT(p_next->m_p_next_sibling == NULL ||
+ p_next->m_metadata < p_next->m_p_next_sibling->m_metadata);
+
+ --it;
+ p_nd = next_2_pointer(next_after_0_pointer(p_nd));
+ }
+ _GLIBCXX_DEBUG_ASSERT(it + 1 == m_rc.begin());
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::const_node_pointer
+PB_DS_CLASS_C_DEC::
+next_2_pointer(const_node_pointer p_nd)
+{
+ if (p_nd == NULL)
+ return NULL;
+
+ node_pointer p_next = p_nd->m_p_next_sibling;
+
+ if (p_next == NULL)
+ return NULL;
+
+ if (p_nd->m_metadata == p_next->m_metadata)
+ return p_nd;
+
+ return next_2_pointer(p_next);
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::const_node_pointer
+PB_DS_CLASS_C_DEC::
+next_after_0_pointer(const_node_pointer p_nd)
+{
+ if (p_nd == NULL)
+ return NULL;
+
+ node_pointer p_next = p_nd->m_p_next_sibling;
+
+ if (p_next == NULL)
+ return NULL;
+
+ if (p_nd->m_metadata < p_next->m_metadata)
+ return p_next;
+
+ return next_after_0_pointer(p_next);
+}
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rc_binomial_heap_/erase_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rc_binomial_heap_/erase_fn_imps.hpp
new file mode 100644
index 0000000..1113ffa
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rc_binomial_heap_/erase_fn_imps.hpp
@@ -0,0 +1,107 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file erase_fn_imps.hpp
+ * Contains an implementation for rc_binomial_heap_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+pop()
+{
+ make_binomial_heap();
+ _GLIBCXX_DEBUG_ASSERT(!base_type::empty());
+ base_type::pop();
+ base_type::find_max();
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+clear()
+{
+ base_type::clear();
+ m_rc.clear();
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+make_binomial_heap()
+{
+ node_pointer p_nd = base_type::m_p_root;
+ while (p_nd != NULL)
+ {
+ node_pointer p_next = p_nd->m_p_next_sibling;
+ if (p_next == NULL)
+ p_nd = p_next;
+ else if (p_nd->m_metadata == p_next->m_metadata)
+ p_nd = link_with_next_sibling(p_nd);
+ else if (p_nd->m_metadata < p_next->m_metadata)
+ p_nd = p_next;
+#ifdef _GLIBCXX_DEBUG
+ else
+ _GLIBCXX_DEBUG_ASSERT(0);
+#endif
+ }
+
+ m_rc.clear();
+}
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+erase_if(Pred pred)
+{
+ make_binomial_heap();
+ const size_type ersd = base_type::erase_if(pred);
+ base_type::find_max();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return ersd;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+erase(point_iterator it)
+{
+ make_binomial_heap();
+ base_type::erase(it);
+ base_type::find_max();
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rc_binomial_heap_/insert_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rc_binomial_heap_/insert_fn_imps.hpp
new file mode 100644
index 0000000..aef4b92
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rc_binomial_heap_/insert_fn_imps.hpp
@@ -0,0 +1,154 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file insert_fn_imps.hpp
+ * Contains an implementation for rc_binomial_heap_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::point_iterator
+PB_DS_CLASS_C_DEC::
+push(const_reference r_val)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ make_0_exposed();
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ node_pointer p_nd = base_type::get_new_node_for_insert(r_val);
+
+ p_nd->m_p_l_child = p_nd->m_p_prev_or_parent = NULL;
+ p_nd->m_metadata = 0;
+
+ if (base_type::m_p_max == NULL || Cmp_Fn::operator()(base_type::m_p_max->m_value, r_val))
+ base_type::m_p_max = p_nd;
+
+ p_nd->m_p_next_sibling = base_type::m_p_root;
+
+ if (base_type::m_p_root != NULL)
+ base_type::m_p_root->m_p_prev_or_parent = p_nd;
+
+ base_type::m_p_root = p_nd;
+
+ if (p_nd->m_p_next_sibling != NULL&& p_nd->m_p_next_sibling->m_metadata == 0)
+ m_rc.push(p_nd);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ return point_iterator(p_nd);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+modify(point_iterator it, const_reference r_new_val)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ make_binomial_heap();
+
+ base_type::modify(it, r_new_val);
+
+ base_type::find_max();
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+link_with_next_sibling(node_pointer p_nd)
+{
+ node_pointer p_next = p_nd->m_p_next_sibling;
+
+ _GLIBCXX_DEBUG_ASSERT(p_next != NULL);
+ _GLIBCXX_DEBUG_ASSERT(p_next->m_p_prev_or_parent == p_nd);
+
+ if (Cmp_Fn::operator()(p_nd->m_value, p_next->m_value))
+ {
+ p_next->m_p_prev_or_parent = p_nd->m_p_prev_or_parent;
+
+ if (p_next->m_p_prev_or_parent == NULL)
+ base_type::m_p_root = p_next;
+ else
+ p_next->m_p_prev_or_parent->m_p_next_sibling = p_next;
+
+ if (base_type::m_p_max == p_nd)
+ base_type::m_p_max = p_next;
+
+ base_type::make_child_of(p_nd, p_next);
+
+ ++p_next->m_metadata;
+
+ return p_next;
+ }
+
+ p_nd->m_p_next_sibling = p_next->m_p_next_sibling;
+
+ if (p_nd->m_p_next_sibling != NULL)
+ p_nd->m_p_next_sibling->m_p_prev_or_parent = p_nd;
+
+ if (base_type::m_p_max == p_next)
+ base_type::m_p_max = p_nd;
+
+ base_type::make_child_of(p_next, p_nd);
+
+ ++p_nd->m_metadata;
+
+ return p_nd;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+make_0_exposed()
+{
+ if (m_rc.empty())
+ return;
+
+ node_pointer p_nd = m_rc.top();
+
+ m_rc.pop();
+
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_next_sibling != NULL);
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_metadata == p_nd->m_p_next_sibling->m_metadata);
+
+ node_pointer p_res = link_with_next_sibling(p_nd);
+
+ if (p_res->m_p_next_sibling != NULL&& p_res->m_metadata == p_res->m_p_next_sibling->m_metadata)
+ m_rc.push(p_res);
+}
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rc_binomial_heap_/rc.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rc_binomial_heap_/rc.hpp
new file mode 100644
index 0000000..9b70acc
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rc_binomial_heap_/rc.hpp
@@ -0,0 +1,262 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file rc.hpp
+ * Contains a redundant (binary counter).
+ */
+
+#ifndef PB_DS_RC_HPP
+#define PB_DS_RC_HPP
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Node, class Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ rc<Node, Allocator>
+
+ template<typename Node, class Allocator>
+ class rc
+ {
+ private:
+ typedef Allocator allocator_type;
+
+ typedef typename allocator_type::size_type size_type;
+
+ typedef Node node;
+
+ typedef
+ typename allocator_type::template rebind<
+ node>::other::pointer
+ node_pointer;
+
+ typedef
+ typename allocator_type::template rebind<
+ node_pointer>::other::pointer
+ entry_pointer;
+
+ typedef
+ typename allocator_type::template rebind<
+ node_pointer>::other::const_pointer
+ const_entry_pointer;
+
+ enum
+ {
+ max_entries = sizeof(size_type) << 3
+ };
+
+ public:
+ typedef node_pointer entry;
+
+ typedef const_entry_pointer const_iterator;
+
+ public:
+ rc();
+
+ rc(const PB_DS_CLASS_C_DEC& other);
+
+ inline void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ inline void
+ push(entry p_nd);
+
+ inline node_pointer
+ top() const;
+
+ inline void
+ pop();
+
+ inline bool
+ empty() const;
+
+ inline size_type
+ size() const;
+
+ void
+ clear();
+
+ const const_iterator
+ begin() const;
+
+ const const_iterator
+ end() const;
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid() const;
+#endif
+
+#ifdef PB_DS_RC_BINOMIAL_HEAP_TRACE_
+ void
+ trace() const;
+#endif
+
+ private:
+ node_pointer m_a_entries[max_entries];
+
+ size_type m_over_top;
+ };
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ rc() : m_over_top(0)
+ { _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ rc(const PB_DS_CLASS_C_DEC& other) : m_over_top(0)
+ { _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+ PB_DS_CLASS_T_DEC
+ inline void
+ PB_DS_CLASS_C_DEC::
+ swap(PB_DS_CLASS_C_DEC& other)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+
+ const size_type over_top = std::max(m_over_top, other.m_over_top);
+
+ for (size_type i = 0; i < over_top; ++i)
+ std::swap(m_a_entries[i], other.m_a_entries[i]);
+
+ std::swap(m_over_top, other.m_over_top);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline void
+ PB_DS_CLASS_C_DEC::
+ push(entry p_nd)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ASSERT(m_over_top < max_entries);
+ m_a_entries[m_over_top++] = p_nd;
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline void
+ PB_DS_CLASS_C_DEC::
+ pop()
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ASSERT(!empty());
+ --m_over_top;
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::node_pointer
+ PB_DS_CLASS_C_DEC::
+ top() const
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ASSERT(!empty());
+ return *(m_a_entries + m_over_top - 1);
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline bool
+ PB_DS_CLASS_C_DEC::
+ empty() const
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return m_over_top == 0;
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::size_type
+ PB_DS_CLASS_C_DEC::
+ size() const
+ { return m_over_top; }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ clear()
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ m_over_top = 0;
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+ PB_DS_CLASS_T_DEC
+ const typename PB_DS_CLASS_C_DEC::const_iterator
+ PB_DS_CLASS_C_DEC::
+ begin() const
+ { return& m_a_entries[0]; }
+
+ PB_DS_CLASS_T_DEC
+ const typename PB_DS_CLASS_C_DEC::const_iterator
+ PB_DS_CLASS_C_DEC::
+ end() const
+ { return& m_a_entries[m_over_top]; }
+
+#ifdef _GLIBCXX_DEBUG
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ assert_valid() const
+ { _GLIBCXX_DEBUG_ASSERT(m_over_top < max_entries); }
+#endif
+
+#ifdef PB_DS_RC_BINOMIAL_HEAP_TRACE_
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ trace() const
+ {
+ std::cout << "rc" << std::endl;
+ for (size_type i = 0; i < m_over_top; ++i)
+ std::cerr << m_a_entries[i] << std::endl;
+ std::cout << std::endl;
+ }
+#endif
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+} // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rc_binomial_heap_/rc_binomial_heap_.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rc_binomial_heap_/rc_binomial_heap_.hpp
new file mode 100644
index 0000000..762e29b
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rc_binomial_heap_/rc_binomial_heap_.hpp
@@ -0,0 +1,198 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file rc_binomial_heap_.hpp
+ * Contains an implementation for rc_binomial_heap_.
+ */
+
+/*
+ * Redundant-counter binomial heap.
+ */
+
+#include <ext/pb_ds/detail/cond_dealtor.hpp>
+#include <ext/pb_ds/detail/type_utils.hpp>
+#include <ext/pb_ds/detail/binomial_heap_base_/binomial_heap_base_.hpp>
+#include <ext/pb_ds/detail/rc_binomial_heap_/rc.hpp>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+#define PB_DS_CLASS_T_DEC \
+ template<typename Value_Type, class Cmp_Fn, class Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ rc_binomial_heap_<Value_Type, Cmp_Fn, Allocator>
+
+#define PB_DS_BASE_C_DEC \
+ binomial_heap_base_<Value_Type, Cmp_Fn, Allocator>
+
+#define PB_DS_RC_C_DEC \
+ rc<typename PB_DS_BASE_C_DEC::node, Allocator>
+
+ /**
+ * class description = "8y|\|0|\/|i41 h34p 74813">
+ **/
+ template<typename Value_Type, class Cmp_Fn, class Allocator>
+ class rc_binomial_heap_ : public PB_DS_BASE_C_DEC
+ {
+
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ typedef typename base_type::node_pointer node_pointer;
+
+ typedef typename base_type::const_node_pointer const_node_pointer;
+
+ typedef PB_DS_RC_C_DEC rc_t;
+
+ public:
+
+ typedef typename Allocator::size_type size_type;
+
+ typedef typename Allocator::difference_type difference_type;
+
+ typedef Value_Type value_type;
+
+ typedef typename base_type::pointer pointer;
+
+ typedef typename base_type::const_pointer const_pointer;
+
+ typedef typename base_type::reference reference;
+
+ typedef typename base_type::const_reference const_reference;
+
+ typedef typename base_type::const_point_iterator const_point_iterator;
+
+ typedef typename base_type::point_iterator point_iterator;
+
+ typedef typename base_type::const_iterator const_iterator;
+
+ typedef typename base_type::iterator iterator;
+
+ typedef typename base_type::cmp_fn cmp_fn;
+
+ typedef typename base_type::allocator_type allocator_type;
+
+ public:
+
+ rc_binomial_heap_();
+
+ rc_binomial_heap_(const Cmp_Fn& r_cmp_fn);
+
+ rc_binomial_heap_(const PB_DS_CLASS_C_DEC& other);
+
+ ~rc_binomial_heap_();
+
+ void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ inline point_iterator
+ push(const_reference r_val);
+
+ void
+ modify(point_iterator it, const_reference r_new_val);
+
+ inline void
+ pop();
+
+ void
+ erase(point_iterator it);
+
+ inline void
+ clear();
+
+ template<typename Pred>
+ size_type
+ erase_if(Pred pred);
+
+ template<typename Pred>
+ void
+ split(Pred pred, PB_DS_CLASS_C_DEC& other);
+
+ void
+ join(PB_DS_CLASS_C_DEC& other);
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid() const;
+#endif
+
+#ifdef PB_DS_RC_BINOMIAL_HEAP_TRACE_
+ void
+ trace() const;
+#endif
+
+ private:
+
+ inline node_pointer
+ link_with_next_sibling(node_pointer p_nd);
+
+ void
+ make_0_exposed();
+
+ void
+ make_binomial_heap();
+
+#ifdef _GLIBCXX_DEBUG
+ static const_node_pointer
+ next_2_pointer(const_node_pointer p_nd);
+
+ static const_node_pointer
+ next_after_0_pointer(const_node_pointer p_nd);
+#endif
+
+ private:
+ rc_t m_rc;
+ };
+
+#include <ext/pb_ds/detail/rc_binomial_heap_/constructors_destructor_fn_imps.hpp>
+#include <ext/pb_ds/detail/rc_binomial_heap_/debug_fn_imps.hpp>
+#include <ext/pb_ds/detail/rc_binomial_heap_/erase_fn_imps.hpp>
+#include <ext/pb_ds/detail/rc_binomial_heap_/trace_fn_imps.hpp>
+#include <ext/pb_ds/detail/rc_binomial_heap_/insert_fn_imps.hpp>
+#include <ext/pb_ds/detail/rc_binomial_heap_/split_join_fn_imps.hpp>
+
+#undef PB_DS_CLASS_C_DEC
+
+#undef PB_DS_CLASS_T_DEC
+
+#undef PB_DS_BASE_C_DEC
+
+#undef PB_DS_RC_C_DEC
+ } // namespace detail
+} // namespace __gnu_pbds
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rc_binomial_heap_/split_join_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rc_binomial_heap_/split_join_fn_imps.hpp
new file mode 100644
index 0000000..26965ae
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rc_binomial_heap_/split_join_fn_imps.hpp
@@ -0,0 +1,81 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file split_join_fn_imps.hpp
+ * Contains an implementation for rc_binomial_heap_.
+ */
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+void
+PB_DS_CLASS_C_DEC::
+split(Pred pred, PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+
+ make_binomial_heap();
+ other.make_binomial_heap();
+
+ base_type::split(pred, other);
+
+ base_type::find_max();
+ other.find_max();
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+join(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+
+ make_binomial_heap();
+ other.make_binomial_heap();
+
+ base_type::join(other);
+
+ base_type::find_max();
+ other.find_max();
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ }
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rc_binomial_heap_/trace_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rc_binomial_heap_/trace_fn_imps.hpp
new file mode 100644
index 0000000..1fb3b8b
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/rc_binomial_heap_/trace_fn_imps.hpp
@@ -0,0 +1,53 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file trace_fn_imps.hpp
+ * Contains an implementation for rc_binomial_heap_.
+ */
+
+#ifdef PB_DS_RC_BINOMIAL_HEAP_TRACE_
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+trace() const
+{
+ base_type::trace();
+
+ m_rc.trace();
+}
+
+#endif // #ifdef PB_DS_RC_BINOMIAL_HEAP_TRACE_
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/resize_policy/cc_hash_max_collision_check_resize_trigger_imp.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/resize_policy/cc_hash_max_collision_check_resize_trigger_imp.hpp
new file mode 100644
index 0000000..94cd515
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/resize_policy/cc_hash_max_collision_check_resize_trigger_imp.hpp
@@ -0,0 +1,211 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file cc_hash_max_collision_check_resize_trigger_imp.hpp
+ * Contains a resize trigger implementation.
+ */
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+cc_hash_max_collision_check_resize_trigger(float load) :
+ m_load(load),
+ m_size(0),
+ m_num_col(0),
+ m_max_col(0),
+ m_resize_needed(false)
+{ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_find_search_start()
+{ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_find_search_collision()
+{ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_find_search_end()
+{ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_insert_search_start()
+{ m_num_col = 0; }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_insert_search_collision()
+{ ++m_num_col; }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_insert_search_end()
+{ calc_resize_needed(); }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_erase_search_start()
+{ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_erase_search_collision()
+{ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_erase_search_end()
+{ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_inserted(size_type)
+{ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_erased(size_type)
+{ m_resize_needed = true; }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+notify_cleared()
+{ m_resize_needed = false; }
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+is_resize_needed() const
+{ return m_resize_needed; }
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+is_grow_needed(size_type /*size*/, size_type /*num_used_e*/) const
+{ return m_num_col >= m_max_col; }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+notify_resized(size_type new_size)
+{
+ m_size = new_size;
+
+#ifdef PB_DS_HT_MAP_RESIZE_TRACE_
+ std::cerr << "chmccrt::notify_resized "
+ << static_cast<unsigned long>(new_size) << std::endl;
+#endif
+
+ calc_max_num_coll();
+ calc_resize_needed();
+ m_num_col = 0;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+calc_max_num_coll()
+{
+ // max_col <-- \sqrt{2 load \ln( 2 m \ln( m ) ) }
+ const double ln_arg = 2 * m_size * std::log(double(m_size));
+ m_max_col = size_type(std::ceil(std::sqrt(2 * m_load * std::log(ln_arg))));
+
+#ifdef PB_DS_HT_MAP_RESIZE_TRACE_
+ std::cerr << "chmccrt::calc_max_num_coll "
+ << static_cast<unsigned long>(m_size) << " "
+ << static_cast<unsigned long>(m_max_col) << std::endl;
+#endif
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+notify_externally_resized(size_type new_size)
+{ notify_resized(new_size); }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{
+ std::swap(m_load, other.m_load);
+ std::swap(m_size, other.m_size);
+ std::swap(m_num_col, other.m_num_col);
+ std::swap(m_max_col, other.m_max_col);
+ std::swap(m_resize_needed, other.m_resize_needed);
+}
+
+PB_DS_CLASS_T_DEC
+inline float
+PB_DS_CLASS_C_DEC::
+get_load() const
+{
+ PB_DS_STATIC_ASSERT(access, external_load_access);
+ return m_load;
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+calc_resize_needed()
+{ m_resize_needed = m_resize_needed || m_num_col >= m_max_col; }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+set_load(float load)
+{
+ PB_DS_STATIC_ASSERT(access, external_load_access);
+ m_load = load;
+ calc_max_num_coll();
+ calc_resize_needed();
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/resize_policy/hash_exponential_size_policy_imp.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/resize_policy/hash_exponential_size_policy_imp.hpp
new file mode 100644
index 0000000..b58f2ec
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/resize_policy/hash_exponential_size_policy_imp.hpp
@@ -0,0 +1,90 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file hash_exponential_size_policy_imp.hpp
+ * Contains a resize size policy implementation.
+ */
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+hash_exponential_size_policy(size_type start_size, size_type grow_factor) :
+ m_start_size(start_size),
+ m_grow_factor(grow_factor)
+{ }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{
+ std::swap(m_start_size, other.m_start_size);
+ std::swap(m_grow_factor, other.m_grow_factor);
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+get_nearest_larger_size(size_type size) const
+{
+ size_type ret = m_start_size;
+ while (ret <= size)
+ {
+ const size_type next_ret = ret* m_grow_factor;
+ if (next_ret < ret)
+ __throw_insert_error();
+ ret = next_ret;
+ }
+ return ret;
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+get_nearest_smaller_size(size_type size) const
+{
+ size_type ret = m_start_size;
+ while (true)
+ {
+ const size_type next_ret = ret* m_grow_factor;
+ if (next_ret < ret)
+ __throw_resize_error();
+ if (next_ret >= size)
+ return (ret);
+ ret = next_ret;
+ }
+ return ret;
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_imp.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_imp.hpp
new file mode 100644
index 0000000..3403b09
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_imp.hpp
@@ -0,0 +1,289 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file hash_load_check_resize_trigger_imp.hpp
+ * Contains a resize trigger implementation.
+ */
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+hash_load_check_resize_trigger(float load_min, float load_max)
+: m_load_min(load_min), m_load_max(load_max), m_next_shrink_size(0),
+ m_next_grow_size(0), m_resize_needed(false)
+{ _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_find_search_start()
+{ _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_find_search_collision()
+{ _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_find_search_end()
+{ _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_insert_search_start()
+{ _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_insert_search_collision()
+{ _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_insert_search_end()
+{ _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_erase_search_start()
+{ _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_erase_search_collision()
+{ _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_erase_search_end()
+{ _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_inserted(size_type num_entries)
+{
+ m_resize_needed = (num_entries >= m_next_grow_size);
+ size_base::set_size(num_entries);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_erased(size_type num_entries)
+{
+ size_base::set_size(num_entries);
+ m_resize_needed = num_entries <= m_next_shrink_size;
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+is_resize_needed() const
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return m_resize_needed;
+}
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+is_grow_needed(size_type /*size*/, size_type num_entries) const
+{
+ _GLIBCXX_DEBUG_ASSERT(m_resize_needed);
+ return num_entries >= m_next_grow_size;
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+~hash_load_check_resize_trigger() { }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+notify_resized(size_type new_size)
+{
+ m_resize_needed = false;
+ m_next_grow_size = size_type(m_load_max * new_size - 1);
+ m_next_shrink_size = size_type(m_load_min * new_size);
+
+#ifdef PB_DS_HT_MAP_RESIZE_TRACE_
+ std::cerr << "hlcrt::notify_resized " <<
+ static_cast<unsigned long>(new_size) << " " <<
+ static_cast<unsigned long>(m_load_min) << " " <<
+ static_cast<unsigned long>(m_load_max) << " " <<
+ static_cast<unsigned long>(m_next_shrink_size) << " " <<
+ static_cast<unsigned long>(m_next_grow_size) << " " << std::endl;
+#endif
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+notify_externally_resized(size_type new_size)
+{
+ m_resize_needed = false;
+ size_type new_grow_size = size_type(m_load_max * new_size - 1);
+ size_type new_shrink_size = size_type(m_load_min * new_size);
+ if (new_grow_size >= m_next_grow_size)
+ {
+ _GLIBCXX_DEBUG_ASSERT(new_shrink_size > m_next_shrink_size);
+ m_next_grow_size = new_grow_size;
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+#ifdef PB_DS_HT_MAP_RESIZE_TRACE_
+ std::cerr << "hlcrt::notify_externally_resized1 " <<
+ static_cast<unsigned long>(new_size) << " " <<
+ static_cast<unsigned long>(m_load_min) << " " <<
+ static_cast<unsigned long>(m_load_max) << " " <<
+ static_cast<unsigned long>(m_next_shrink_size) << " " <<
+ static_cast<unsigned long>(m_next_grow_size) << " " << std::endl;
+#endif
+ return;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(new_shrink_size <= m_next_shrink_size);
+ m_next_shrink_size = new_shrink_size;
+
+#ifdef PB_DS_HT_MAP_RESIZE_TRACE_
+ std::cerr << "hlcrt::notify_externally_resized2 " <<
+ static_cast<unsigned long>(new_size) << " " <<
+ static_cast<unsigned long>(m_load_min) << " " <<
+ static_cast<unsigned long>(m_load_max) << " " <<
+ static_cast<unsigned long>(m_next_shrink_size) << " " <<
+ static_cast<unsigned long>(m_next_grow_size) << " " << std::endl;
+#endif
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+notify_cleared()
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ size_base::set_size(0);
+ m_resize_needed = (0 < m_next_shrink_size);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+
+ size_base::swap(other);
+ std::swap(m_load_min, other.m_load_min);
+ std::swap(m_load_max, other.m_load_max);
+ std::swap(m_resize_needed, other.m_resize_needed);
+ std::swap(m_next_grow_size, other.m_next_grow_size);
+ std::swap(m_next_shrink_size, other.m_next_shrink_size);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+inline std::pair<float, float>
+PB_DS_CLASS_C_DEC::
+get_loads() const
+{
+ PB_DS_STATIC_ASSERT(access, external_load_access);
+ return std::make_pair(m_load_min, m_load_max);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+set_loads(std::pair<float, float> load_pair)
+{
+ PB_DS_STATIC_ASSERT(access, external_load_access);
+ const float old_load_min = m_load_min;
+ const float old_load_max = m_load_max;
+ const size_type old_next_shrink_size = m_next_shrink_size;
+ const size_type old_next_grow_size = m_next_grow_size;
+ const bool old_resize_needed = m_resize_needed;
+
+ __try
+ {
+ m_load_min = load_pair.first;
+ m_load_max = load_pair.second;
+ do_resize(static_cast<size_type>(size_base::get_size() / ((m_load_min + m_load_max) / 2)));
+ }
+ __catch(...)
+ {
+ m_load_min = old_load_min;
+ m_load_max = old_load_max;
+ m_next_shrink_size = old_next_shrink_size;
+ m_next_grow_size = old_next_grow_size;
+ m_resize_needed = old_resize_needed;
+ __throw_exception_again;
+ }
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+do_resize(size_type)
+{ std::abort(); }
+
+#ifdef _GLIBCXX_DEBUG
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_valid() const
+{
+ _GLIBCXX_DEBUG_ASSERT(m_load_max > m_load_min);
+ _GLIBCXX_DEBUG_ASSERT(m_next_grow_size >= m_next_shrink_size);
+}
+#endif
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_size_base.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_size_base.hpp
new file mode 100644
index 0000000..c29b3d5
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_size_base.hpp
@@ -0,0 +1,94 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file hash_load_check_resize_trigger_size_base.hpp
+ * Contains an base holding size for some resize policies.
+ */
+
+#ifndef PB_DS_HASH_LOAD_CHECK_RESIZE_TRIGGER_SIZE_BASE_HPP
+#define PB_DS_HASH_LOAD_CHECK_RESIZE_TRIGGER_SIZE_BASE_HPP
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ // Primary template.
+ template<typename Size_Type, bool Hold_Size>
+ class hash_load_check_resize_trigger_size_base;
+
+ // Specializations.
+ template<typename Size_Type>
+ class hash_load_check_resize_trigger_size_base<Size_Type, true>
+ {
+ protected:
+ typedef Size_Type size_type;
+
+ hash_load_check_resize_trigger_size_base(): m_size(0)
+ { }
+
+ inline void
+ swap(hash_load_check_resize_trigger_size_base& other)
+ { std::swap(m_size, other.m_size); }
+
+ inline void
+ set_size(size_type size)
+ { m_size = size; }
+
+ inline size_type
+ get_size() const
+ { return m_size; }
+
+ private:
+ size_type m_size;
+ };
+
+ template<typename Size_Type>
+ class hash_load_check_resize_trigger_size_base<Size_Type, false>
+ {
+ protected:
+ typedef Size_Type size_type;
+
+ protected:
+ inline void
+ swap(hash_load_check_resize_trigger_size_base& other) { }
+
+ inline void
+ set_size(size_type size) { }
+ };
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp
new file mode 100644
index 0000000..a28f5ed
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp
@@ -0,0 +1,161 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file hash_prime_size_policy_imp.hpp
+ * Contains a resize size policy implementation.
+ */
+
+#pragma GCC system_header
+
+namespace detail
+{
+ enum
+ {
+ num_distinct_sizes_32_bit = 30,
+ num_distinct_sizes_64_bit = 62,
+ num_distinct_sizes = sizeof(std::size_t) != 8 ?
+ num_distinct_sizes_32_bit : num_distinct_sizes_64_bit,
+ };
+
+ // Originally taken from the SGI implementation; acknowledged in the docs.
+ // Further modified (for 64 bits) from tr1's hashtable.
+ static const std::size_t g_a_sizes[num_distinct_sizes_64_bit] =
+ {
+ /* 0 */ 5ul,
+ /* 1 */ 11ul,
+ /* 2 */ 23ul,
+ /* 3 */ 47ul,
+ /* 4 */ 97ul,
+ /* 5 */ 199ul,
+ /* 6 */ 409ul,
+ /* 7 */ 823ul,
+ /* 8 */ 1741ul,
+ /* 9 */ 3469ul,
+ /* 10 */ 6949ul,
+ /* 11 */ 14033ul,
+ /* 12 */ 28411ul,
+ /* 13 */ 57557ul,
+ /* 14 */ 116731ul,
+ /* 15 */ 236897ul,
+ /* 16 */ 480881ul,
+ /* 17 */ 976369ul,
+ /* 18 */ 1982627ul,
+ /* 19 */ 4026031ul,
+ /* 20 */ 8175383ul,
+ /* 21 */ 16601593ul,
+ /* 22 */ 33712729ul,
+ /* 23 */ 68460391ul,
+ /* 24 */ 139022417ul,
+ /* 25 */ 282312799ul,
+ /* 26 */ 573292817ul,
+ /* 27 */ 1164186217ul,
+ /* 28 */ 2364114217ul,
+ /* 29 */ 4294967291ul,
+ /* 30 */ (std::size_t)8589934583ull,
+ /* 31 */ (std::size_t)17179869143ull,
+ /* 32 */ (std::size_t)34359738337ull,
+ /* 33 */ (std::size_t)68719476731ull,
+ /* 34 */ (std::size_t)137438953447ull,
+ /* 35 */ (std::size_t)274877906899ull,
+ /* 36 */ (std::size_t)549755813881ull,
+ /* 37 */ (std::size_t)1099511627689ull,
+ /* 38 */ (std::size_t)2199023255531ull,
+ /* 39 */ (std::size_t)4398046511093ull,
+ /* 40 */ (std::size_t)8796093022151ull,
+ /* 41 */ (std::size_t)17592186044399ull,
+ /* 42 */ (std::size_t)35184372088777ull,
+ /* 43 */ (std::size_t)70368744177643ull,
+ /* 44 */ (std::size_t)140737488355213ull,
+ /* 45 */ (std::size_t)281474976710597ull,
+ /* 46 */ (std::size_t)562949953421231ull,
+ /* 47 */ (std::size_t)1125899906842597ull,
+ /* 48 */ (std::size_t)2251799813685119ull,
+ /* 49 */ (std::size_t)4503599627370449ull,
+ /* 50 */ (std::size_t)9007199254740881ull,
+ /* 51 */ (std::size_t)18014398509481951ull,
+ /* 52 */ (std::size_t)36028797018963913ull,
+ /* 53 */ (std::size_t)72057594037927931ull,
+ /* 54 */ (std::size_t)144115188075855859ull,
+ /* 55 */ (std::size_t)288230376151711717ull,
+ /* 56 */ (std::size_t)576460752303423433ull,
+ /* 57 */ (std::size_t)1152921504606846883ull,
+ /* 58 */ (std::size_t)2305843009213693951ull,
+ /* 59 */ (std::size_t)4611686018427387847ull,
+ /* 60 */ (std::size_t)9223372036854775783ull,
+ /* 61 */ (std::size_t)18446744073709551557ull,
+ };
+
+} // namespace detail
+
+PB_DS_CLASS_T_DEC
+inline
+PB_DS_CLASS_C_DEC::
+hash_prime_size_policy(size_type n) : m_start_size(n)
+{ m_start_size = get_nearest_larger_size(n); }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{ std::swap(m_start_size, other.m_start_size); }
+
+PB_DS_CLASS_T_DEC
+inline PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+get_nearest_larger_size(size_type n) const
+{
+ const std::size_t* const p_upper = std::upper_bound(detail::g_a_sizes,
+ detail::g_a_sizes + detail::num_distinct_sizes, n);
+
+ if (p_upper == detail::g_a_sizes + detail::num_distinct_sizes)
+ __throw_resize_error();
+ return *p_upper;
+}
+
+PB_DS_CLASS_T_DEC
+inline PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+get_nearest_smaller_size(size_type n) const
+{
+ const size_t* p_lower = std::lower_bound(detail::g_a_sizes,
+ detail::g_a_sizes + detail::num_distinct_sizes, n);
+
+ if (*p_lower >= n && p_lower != detail::g_a_sizes)
+ --p_lower;
+ if (*p_lower < m_start_size)
+ return m_start_size;
+ return *p_lower;
+}
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/resize_policy/hash_standard_resize_policy_imp.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/resize_policy/hash_standard_resize_policy_imp.hpp
new file mode 100644
index 0000000..39cf7dc
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/resize_policy/hash_standard_resize_policy_imp.hpp
@@ -0,0 +1,249 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file hash_standard_resize_policy_imp.hpp
+ * Contains a resize policy implementation.
+ */
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+hash_standard_resize_policy()
+: m_size(Size_Policy::get_nearest_larger_size(1))
+{ trigger_policy_base::notify_externally_resized(m_size); }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+hash_standard_resize_policy(const Size_Policy& r_size_policy)
+: Size_Policy(r_size_policy), m_size(Size_Policy::get_nearest_larger_size(1))
+{ trigger_policy_base::notify_externally_resized(m_size); }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+hash_standard_resize_policy(const Size_Policy& r_size_policy,
+ const Trigger_Policy& r_trigger_policy)
+: Size_Policy(r_size_policy), Trigger_Policy(r_trigger_policy),
+ m_size(Size_Policy::get_nearest_larger_size(1))
+{ trigger_policy_base::notify_externally_resized(m_size); }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+~hash_standard_resize_policy()
+{ }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{
+ trigger_policy_base::swap(other);
+ size_policy_base::swap(other);
+ std::swap(m_size, other.m_size);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_find_search_start()
+{ trigger_policy_base::notify_find_search_start(); }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_find_search_collision()
+{ trigger_policy_base::notify_find_search_collision(); }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_find_search_end()
+{ trigger_policy_base::notify_find_search_end(); }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_insert_search_start()
+{ trigger_policy_base::notify_insert_search_start(); }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_insert_search_collision()
+{ trigger_policy_base::notify_insert_search_collision(); }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_insert_search_end()
+{ trigger_policy_base::notify_insert_search_end(); }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_erase_search_start()
+{ trigger_policy_base::notify_erase_search_start(); }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_erase_search_collision()
+{ trigger_policy_base::notify_erase_search_collision(); }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_erase_search_end()
+{ trigger_policy_base::notify_erase_search_end(); }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_inserted(size_type num_e)
+{ trigger_policy_base::notify_inserted(num_e); }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_erased(size_type num_e)
+{ trigger_policy_base::notify_erased(num_e); }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+notify_cleared()
+{ trigger_policy_base::notify_cleared(); }
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+is_resize_needed() const
+{ return trigger_policy_base::is_resize_needed(); }
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+get_new_size(size_type size, size_type num_used_e) const
+{
+ if (trigger_policy_base::is_grow_needed(size, num_used_e))
+ return size_policy_base::get_nearest_larger_size(size);
+ return size_policy_base::get_nearest_smaller_size(size);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+notify_resized(size_type new_size)
+{
+ trigger_policy_base::notify_resized(new_size);
+ m_size = new_size;
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+get_actual_size() const
+{
+ PB_DS_STATIC_ASSERT(access, external_size_access);
+ return m_size;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+resize(size_type new_size)
+{
+ PB_DS_STATIC_ASSERT(access, external_size_access);
+ size_type actual_size = size_policy_base::get_nearest_larger_size(1);
+ while (actual_size < new_size)
+ {
+ const size_type pot = size_policy_base::get_nearest_larger_size(actual_size);
+
+ if (pot == actual_size && pot < new_size)
+ __throw_resize_error();
+ actual_size = pot;
+ }
+
+ if (actual_size > 0)
+ --actual_size;
+
+ const size_type old_size = m_size;
+ __try
+ {
+ do_resize(actual_size - 1);
+ }
+ __catch(insert_error& )
+ {
+ m_size = old_size;
+ __throw_resize_error();
+ }
+ __catch(...)
+ {
+ m_size = old_size;
+ __throw_exception_again;
+ }
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+do_resize(size_type)
+{
+ // Do nothing
+}
+
+PB_DS_CLASS_T_DEC
+Trigger_Policy&
+PB_DS_CLASS_C_DEC::
+get_trigger_policy()
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+const Trigger_Policy&
+PB_DS_CLASS_C_DEC::
+get_trigger_policy() const
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+Size_Policy&
+PB_DS_CLASS_C_DEC::
+get_size_policy()
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+const Size_Policy&
+PB_DS_CLASS_C_DEC::
+get_size_policy() const
+{ return *this; }
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/resize_policy/sample_resize_policy.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/resize_policy/sample_resize_policy.hpp
new file mode 100644
index 0000000..ed70b95
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/resize_policy/sample_resize_policy.hpp
@@ -0,0 +1,125 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file sample_resize_policy.hpp
+ * Contains a sample resize policy for hash tables.
+ */
+
+#ifndef PB_DS_SAMPLE_RESIZE_POLICY_HPP
+#define PB_DS_SAMPLE_RESIZE_POLICY_HPP
+
+// A sample resize policy.
+class sample_resize_policy
+{
+public:
+
+ // Size type.
+ typedef size_t size_type;
+
+ // Default constructor.
+ sample_resize_policy();
+
+ // Copy constructor.
+ sample_range_hashing(const sample_resize_policy& other);
+
+ // Swaps content.
+ inline void
+ swap(sample_resize_policy& other);
+
+protected:
+
+ // Notifies a search started.
+ inline void
+ notify_insert_search_start();
+
+ // Notifies a search encountered a collision.
+ inline void
+ notify_insert_search_collision();
+
+ // Notifies a search ended.
+ inline void
+ notify_insert_search_end();
+
+ // Notifies a search started.
+ inline void
+ notify_find_search_start();
+
+ // Notifies a search encountered a collision.
+ inline void
+ notify_find_search_collision();
+
+ // Notifies a search ended.
+ inline void
+ notify_find_search_end();
+
+ // Notifies a search started.
+ inline void
+ notify_erase_search_start();
+
+ // Notifies a search encountered a collision.
+ inline void
+ notify_erase_search_collision();
+
+ // Notifies a search ended.
+ inline void
+ notify_erase_search_end();
+
+ // Notifies an element was inserted.
+ inline void
+ notify_inserted(size_type num_e);
+
+ // Notifies an element was erased.
+ inline void
+ notify_erased(size_type num_e);
+
+ // Notifies the table was cleared.
+ void
+ notify_cleared();
+
+ // Notifies the table was resized to new_size.
+ void
+ notify_resized(size_type new_size);
+
+ // Queries whether a resize is needed.
+ inline bool
+ is_resize_needed() const;
+
+ // Queries what the new size should be.
+ size_type
+ get_new_size(size_type size, size_type num_used_e) const;
+};
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/resize_policy/sample_resize_trigger.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/resize_policy/sample_resize_trigger.hpp
new file mode 100644
index 0000000..a27dd94
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/resize_policy/sample_resize_trigger.hpp
@@ -0,0 +1,137 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file sample_resize_trigger.hpp
+ * Contains a sample resize trigger policy class.
+ */
+
+#ifndef PB_DS_SAMPLE_RESIZE_TRIGGER_HPP
+#define PB_DS_SAMPLE_RESIZE_TRIGGER_HPP
+
+// A sample resize trigger policy.
+class sample_resize_trigger
+{
+public:
+
+ // Size type.
+ typedef size_t size_type;
+
+ // Default constructor.
+ sample_resize_trigger();
+
+ // Copy constructor.
+ sample_range_hashing(const sample_resize_trigger& other);
+
+ // Swaps content.
+ inline void
+ swap(sample_resize_trigger& other);
+
+protected:
+
+ // Notifies a search started.
+ inline void
+ notify_insert_search_start();
+
+ // Notifies a search encountered a collision.
+ inline void
+ notify_insert_search_collision();
+
+ // Notifies a search ended.
+ inline void
+ notify_insert_search_end();
+
+ // Notifies a search started.
+ inline void
+ notify_find_search_start();
+
+ // Notifies a search encountered a collision.
+ inline void
+ notify_find_search_collision();
+
+ // Notifies a search ended.
+ inline void
+ notify_find_search_end();
+
+ // Notifies a search started.
+ inline void
+ notify_erase_search_start();
+
+ // Notifies a search encountered a collision.
+ inline void
+ notify_erase_search_collision();
+
+ // Notifies a search ended.
+ inline void
+ notify_erase_search_end();
+
+ // Notifies an element was inserted. the total number of entries in
+ // the table is num_entries.
+ inline void
+ notify_inserted(size_type num_entries);
+
+ // Notifies an element was erased.
+ inline void
+ notify_erased(size_type num_entries);
+
+ // Notifies the table was cleared.
+ void
+ notify_cleared();
+
+ // Notifies the table was resized as a result of this object's
+ // signifying that a resize is needed.
+ void
+ notify_resized(size_type new_size);
+
+ // Notifies the table was resized externally.
+ void
+ notify_externally_resized(size_type new_size);
+
+ // Queries whether a resize is needed.
+ inline bool
+ is_resize_needed() const;
+
+ // Queries whether a grow is needed.
+ inline bool
+ is_grow_needed(size_type size, size_type num_entries) const;
+
+private:
+
+ // Resizes to new_size.
+ virtual void
+ do_resize(size_type new_size);
+};
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/resize_policy/sample_size_policy.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/resize_policy/sample_size_policy.hpp
new file mode 100644
index 0000000..1f2d3a9
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/resize_policy/sample_size_policy.hpp
@@ -0,0 +1,73 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file sample_size_policy.hpp
+ * Contains a sample size resize-policy.
+ */
+
+#ifndef PB_DS_SAMPLE_SIZE_POLICY_HPP
+#define PB_DS_SAMPLE_SIZE_POLICY_HPP
+
+// A sample size policy.
+class sample_size_policy
+{
+public:
+
+ // Size type.
+ typedef size_t size_type;
+
+ // Default constructor.
+ sample_size_policy();
+
+ // Copy constructor.
+ sample_range_hashing(const sample_size_policy& other);
+
+ // Swaps content.
+ inline void
+ swap(sample_size_policy& other);
+
+protected:
+
+ // Given a __size size, returns a __size that is larger.
+ inline size_type
+ get_nearest_larger_size(size_type size) const;
+
+ // Given a __size size, returns a __size that is smaller.
+ inline size_type
+ get_nearest_smaller_size(size_type size) const;
+};
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/constructors_destructor_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/constructors_destructor_fn_imps.hpp
new file mode 100644
index 0000000..2225895
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/constructors_destructor_fn_imps.hpp
@@ -0,0 +1,102 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructors_destructor_fn_imps.hpp
+ * Contains an implementation class for splay_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+template<typename It>
+void
+PB_DS_CLASS_C_DEC::
+copy_from_range(It first_it, It last_it)
+{
+ while (first_it != last_it)
+ insert(*(first_it++));
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME()
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const Cmp_Fn& r_cmp_fn) :
+ base_type(r_cmp_fn)
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const Cmp_Fn& r_cmp_fn, const node_update& r_node_update) :
+ base_type(r_cmp_fn, r_node_update)
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const PB_DS_CLASS_C_DEC& other) :
+ base_type(other)
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ base_type::swap(other);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+initialize()
+{ base_type::m_p_head->m_special = true; }
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/debug_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/debug_fn_imps.hpp
new file mode 100644
index 0000000..084e25d
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/debug_fn_imps.hpp
@@ -0,0 +1,74 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_fn_imps.hpp
+ * Contains an implementation class for splay_tree_.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_valid() const
+{
+ base_type::assert_valid();
+ const node_pointer p_head = base_type::m_p_head;
+ assert_special_imp(p_head);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_special_imp(const node_pointer p_nd) const
+{
+ if (p_nd == NULL)
+ return;
+
+ if (p_nd == base_type::m_p_head)
+ {
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_special);
+ assert_special_imp(p_nd->m_p_parent);
+ return;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(!p_nd->m_special);
+ assert_special_imp(p_nd->m_p_left);
+ assert_special_imp(p_nd->m_p_right);
+}
+
+#endif
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/erase_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/erase_fn_imps.hpp
new file mode 100644
index 0000000..508f586
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/erase_fn_imps.hpp
@@ -0,0 +1,157 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file erase_fn_imps.hpp
+ * Contains an implementation class for splay_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+erase(const_key_reference r_key)
+{
+ point_iterator it = find(r_key);
+ if (it == base_type::end())
+ return false;
+ erase(it);
+ return true;
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+erase(iterator it)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ if (it == base_type::end())
+ return it;
+ iterator ret_it = it;
+ ++ret_it;
+ erase_node(it.m_p_nd);
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ return ret_it;
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::reverse_iterator
+PB_DS_CLASS_C_DEC::
+erase(reverse_iterator it)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ if (it.m_p_nd == base_type::m_p_head)
+ return (it);
+ reverse_iterator ret_it = it;
+ ++ret_it;
+ erase_node(it.m_p_nd);
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ return ret_it;
+}
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+erase_if(Pred pred)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ size_type num_ersd = 0;
+ iterator it = base_type::begin();
+ while (it != base_type::end())
+ {
+ if (pred(*it))
+ {
+ ++num_ersd;
+ it = erase(it);
+ }
+ else
+ ++it;
+ }
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return num_ersd;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+erase_node(node_pointer p_nd)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_nd != NULL);
+ splay(p_nd);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ASSERT(p_nd == this->m_p_head->m_p_parent);
+
+ node_pointer p_l = p_nd->m_p_left;
+ node_pointer p_r = p_nd->m_p_right;
+
+ base_type::update_min_max_for_erased_node(p_nd);
+ base_type::actual_erase_node(p_nd);
+ if (p_r == NULL)
+ {
+ base_type::m_p_head->m_p_parent = p_l;
+ if (p_l != NULL)
+ p_l->m_p_parent = base_type::m_p_head;
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return;
+ }
+
+ node_pointer p_target_r = leftmost(p_r);
+ _GLIBCXX_DEBUG_ASSERT(p_target_r != NULL);
+ p_r->m_p_parent = base_type::m_p_head;
+ base_type::m_p_head->m_p_parent = p_r;
+ splay(p_target_r);
+
+ _GLIBCXX_DEBUG_ONLY(p_target_r->m_p_left = NULL);
+ _GLIBCXX_DEBUG_ASSERT(p_target_r->m_p_parent == this->m_p_head);
+ _GLIBCXX_DEBUG_ASSERT(this->m_p_head->m_p_parent == p_target_r);
+
+ p_target_r->m_p_left = p_l;
+ if (p_l != NULL)
+ p_l->m_p_parent = p_target_r;
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ apply_update(p_target_r, (node_update* )this);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+leftmost(node_pointer p_nd)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_nd != NULL);
+ while (p_nd->m_p_left != NULL)
+ p_nd = p_nd->m_p_left;
+ return p_nd;
+}
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/find_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/find_fn_imps.hpp
new file mode 100644
index 0000000..182425a
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/find_fn_imps.hpp
@@ -0,0 +1,99 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file find_fn_imps.hpp
+ * Contains an implementation class for splay_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::point_iterator
+PB_DS_CLASS_C_DEC::
+find(const_key_reference r_key)
+{
+ node_pointer p_found = find_imp(r_key);
+ if (p_found != base_type::m_p_head)
+ splay(p_found);
+ return point_iterator(p_found);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_point_iterator
+PB_DS_CLASS_C_DEC::
+find(const_key_reference r_key) const
+{
+ const node_pointer p_found = find_imp(r_key);
+ if (p_found != base_type::m_p_head)
+ const_cast<PB_DS_CLASS_C_DEC* >(this)->splay(p_found);
+ return point_iterator(p_found);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+find_imp(const_key_reference r_key)
+{
+ _GLIBCXX_DEBUG_ONLY(base_type::structure_only_assert_valid();)
+ node_pointer p_nd = base_type::m_p_head->m_p_parent;
+ while (p_nd != NULL)
+ if (!Cmp_Fn::operator()(PB_DS_V2F(p_nd->m_value), r_key))
+ {
+ if (!Cmp_Fn::operator()(r_key, PB_DS_V2F(p_nd->m_value)))
+ return p_nd;
+ p_nd = p_nd->m_p_left;
+ }
+ else
+ p_nd = p_nd->m_p_right;
+ return base_type::m_p_head;
+}
+
+PB_DS_CLASS_T_DEC
+inline const typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+find_imp(const_key_reference r_key) const
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ node_pointer p_nd = base_type::m_p_head->m_p_parent;
+ while (p_nd != NULL)
+ if (!Cmp_Fn::operator()(PB_DS_V2F(p_nd->m_value), r_key))
+ {
+ if (!Cmp_Fn::operator()(r_key, PB_DS_V2F(p_nd->m_value)))
+ return p_nd;
+ p_nd = p_nd->m_p_left;
+ }
+ else
+ p_nd = p_nd->m_p_right;
+ return base_type::m_p_head;
+}
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/info_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/info_fn_imps.hpp
new file mode 100644
index 0000000..636b9ab
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/info_fn_imps.hpp
@@ -0,0 +1,39 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file info_fn_imps.hpp
+ * Contains an implementation.
+ */
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/insert_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/insert_fn_imps.hpp
new file mode 100644
index 0000000..e9ae987
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/insert_fn_imps.hpp
@@ -0,0 +1,93 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file insert_fn_imps.hpp
+ * Contains an implementation class for splay_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline std::pair<typename PB_DS_CLASS_C_DEC::point_iterator, bool>
+PB_DS_CLASS_C_DEC::
+insert(const_reference r_value)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ std::pair<point_iterator, bool> ins_pair = insert_leaf_imp(r_value);
+ ins_pair.first.m_p_nd->m_special = false;
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ splay(ins_pair.first.m_p_nd);
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ return ins_pair;
+}
+
+PB_DS_CLASS_T_DEC
+inline std::pair<typename PB_DS_CLASS_C_DEC::point_iterator, bool>
+PB_DS_CLASS_C_DEC::
+insert_leaf_imp(const_reference r_value)
+{
+ _GLIBCXX_DEBUG_ONLY(base_type::structure_only_assert_valid();)
+ if (base_type::m_size == 0)
+ return std::make_pair(base_type::insert_imp_empty(r_value), true);
+
+ node_pointer p_nd = base_type::m_p_head->m_p_parent;
+ node_pointer p_pot = base_type::m_p_head;
+
+ while (p_nd != NULL)
+ if (!Cmp_Fn::operator()(PB_DS_V2F(p_nd->m_value), PB_DS_V2F(r_value)))
+ {
+ if (!Cmp_Fn::operator()(PB_DS_V2F(r_value), PB_DS_V2F(p_nd->m_value)))
+ {
+ return std::make_pair(point_iterator(p_nd), false);
+ }
+ p_pot = p_nd;
+ p_nd = p_nd->m_p_left;
+ }
+ else
+ p_nd = p_nd->m_p_right;
+
+ if (p_pot == base_type::m_p_head)
+ return std::make_pair(base_type::insert_leaf_new(r_value, base_type::m_p_head->m_p_right, false), true);
+
+ _GLIBCXX_DEBUG_ONLY(base_type::check_key_does_not_exist(PB_DS_V2F(r_value)));
+
+ p_nd = p_pot->m_p_left;
+ if (p_nd == NULL)
+ return (std::make_pair(base_type::insert_leaf_new(r_value, p_pot, true), true));
+
+ while (p_nd->m_p_right != NULL)
+ p_nd = p_nd->m_p_right;
+
+ return std::make_pair(insert_leaf_new(r_value, p_nd, false), true);
+}
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/node.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/node.hpp
new file mode 100644
index 0000000..fbf398d
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/node.hpp
@@ -0,0 +1,125 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file node.hpp
+ * Contains an implementation struct for splay_tree_'s node.
+ */
+
+#ifndef PB_DS_SPLAY_TREE_NODE_HPP
+#define PB_DS_SPLAY_TREE_NODE_HPP
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ template<typename Value_Type, class Metadata, class Allocator>
+ struct splay_tree_node_
+ {
+ public:
+ typedef Value_Type value_type;
+ typedef Metadata metadata_type;
+
+ typedef
+ typename Allocator::template rebind<
+ splay_tree_node_<Value_Type, Metadata, Allocator> >::other::pointer
+ node_pointer;
+
+ typedef
+ typename Allocator::template rebind<metadata_type>::other::reference
+ metadata_reference;
+
+ typedef
+ typename Allocator::template rebind<metadata_type>::other::const_reference
+ const_metadata_reference;
+
+#ifdef PB_DS_BIN_SEARCH_TREE_TRACE_
+ void
+ trace() const
+ { std::cout << PB_DS_V2F(m_value) << "(" << m_metadata << ")"; }
+#endif
+
+ inline bool
+ special() const
+ { return m_special; }
+
+ inline const_metadata_reference
+ get_metadata() const
+ { return m_metadata; }
+
+ inline metadata_reference
+ get_metadata()
+ { return m_metadata; }
+
+ value_type m_value;
+ bool m_special;
+ node_pointer m_p_left;
+ node_pointer m_p_right;
+ node_pointer m_p_parent;
+ metadata_type m_metadata;
+ };
+
+ template<typename Value_Type, typename Allocator>
+ struct splay_tree_node_<Value_Type, null_node_metadata, Allocator>
+ {
+ public:
+ typedef Value_Type value_type;
+ typedef null_node_metadata metadata_type;
+
+ typedef
+ typename Allocator::template rebind<
+ splay_tree_node_<Value_Type, null_node_metadata, Allocator> >::other::pointer
+ node_pointer;
+
+ inline bool
+ special() const
+ { return m_special; }
+
+#ifdef PB_DS_BIN_SEARCH_TREE_TRACE_
+ void
+ trace() const
+ { std::cout << PB_DS_V2F(m_value); }
+#endif
+
+ node_pointer m_p_left;
+ node_pointer m_p_right;
+ node_pointer m_p_parent;
+ value_type m_value;
+ bool m_special;
+ };
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/splay_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/splay_fn_imps.hpp
new file mode 100644
index 0000000..e4f3556
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/splay_fn_imps.hpp
@@ -0,0 +1,283 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file splay_fn_imps.hpp
+ * Contains an implementation class for splay_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+splay(node_pointer p_nd)
+{
+ while (p_nd->m_p_parent != base_type::m_p_head)
+ {
+#ifdef _GLIBCXX_DEBUG
+ {
+ node_pointer p_head = base_type::m_p_head;
+ assert_special_imp(p_head);
+ }
+#endif
+
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_nd);)
+
+ if (p_nd->m_p_parent->m_p_parent == base_type::m_p_head)
+ {
+ base_type::rotate_parent(p_nd);
+ _GLIBCXX_DEBUG_ASSERT(p_nd == this->m_p_head->m_p_parent);
+ }
+ else
+ {
+ const node_pointer p_parent = p_nd->m_p_parent;
+ const node_pointer p_grandparent = p_parent->m_p_parent;
+
+#ifdef _GLIBCXX_DEBUG
+ const size_type total =
+ base_type::recursive_count(p_grandparent);
+ _GLIBCXX_DEBUG_ASSERT(total >= 3);
+#endif
+
+ if (p_parent->m_p_left == p_nd &&
+ p_grandparent->m_p_right == p_parent)
+ splay_zig_zag_left(p_nd, p_parent, p_grandparent);
+ else if (p_parent->m_p_right == p_nd &&
+ p_grandparent->m_p_left == p_parent)
+ splay_zig_zag_right(p_nd, p_parent, p_grandparent);
+ else if (p_parent->m_p_left == p_nd &&
+ p_grandparent->m_p_left == p_parent)
+ splay_zig_zig_left(p_nd, p_parent, p_grandparent);
+ else
+ splay_zig_zig_right(p_nd, p_parent, p_grandparent);
+ _GLIBCXX_DEBUG_ASSERT(total ==this->recursive_count(p_nd));
+ }
+
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_nd);)
+ }
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+splay_zig_zag_left(node_pointer p_nd, node_pointer p_parent,
+ node_pointer p_grandparent)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_parent == p_nd->m_p_parent);
+ _GLIBCXX_DEBUG_ASSERT(p_grandparent == p_parent->m_p_parent);
+
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_grandparent);)
+
+ _GLIBCXX_DEBUG_ASSERT(p_parent->m_p_left == p_nd &&
+ p_grandparent->m_p_right == p_parent);
+
+ splay_zz_start(p_nd, p_parent, p_grandparent);
+
+ node_pointer p_b = p_nd->m_p_right;
+ node_pointer p_c = p_nd->m_p_left;
+
+ p_nd->m_p_right = p_parent;
+ p_parent->m_p_parent = p_nd;
+
+ p_nd->m_p_left = p_grandparent;
+ p_grandparent->m_p_parent = p_nd;
+
+ p_parent->m_p_left = p_b;
+ if (p_b != NULL)
+ p_b->m_p_parent = p_parent;
+
+ p_grandparent->m_p_right = p_c;
+ if (p_c != NULL)
+ p_c->m_p_parent = p_grandparent;
+
+ splay_zz_end(p_nd, p_parent, p_grandparent);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+splay_zig_zag_right(node_pointer p_nd, node_pointer p_parent,
+ node_pointer p_grandparent)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_parent == p_nd->m_p_parent);
+ _GLIBCXX_DEBUG_ASSERT(p_grandparent == p_parent->m_p_parent);
+
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_grandparent);)
+
+ _GLIBCXX_DEBUG_ASSERT(p_parent->m_p_right == p_nd &&
+ p_grandparent->m_p_left == p_parent);
+
+ splay_zz_start(p_nd, p_parent, p_grandparent);
+
+ node_pointer p_b = p_nd->m_p_left;
+ node_pointer p_c = p_nd->m_p_right;
+
+ p_nd->m_p_left = p_parent;
+ p_parent->m_p_parent = p_nd;
+
+ p_nd->m_p_right = p_grandparent;
+ p_grandparent->m_p_parent = p_nd;
+
+ p_parent->m_p_right = p_b;
+ if (p_b != NULL)
+ p_b->m_p_parent = p_parent;
+
+ p_grandparent->m_p_left = p_c;
+ if (p_c != NULL)
+ p_c->m_p_parent = p_grandparent;
+
+ splay_zz_end(p_nd, p_parent, p_grandparent);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+splay_zig_zig_left(node_pointer p_nd, node_pointer p_parent,
+ node_pointer p_grandparent)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_parent == p_nd->m_p_parent);
+ _GLIBCXX_DEBUG_ASSERT(p_grandparent == p_parent->m_p_parent);
+
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_grandparent);)
+
+ _GLIBCXX_DEBUG_ASSERT(p_parent->m_p_left == p_nd &&
+ p_nd->m_p_parent->m_p_parent->m_p_left == p_nd->m_p_parent);
+
+ splay_zz_start(p_nd, p_parent, p_grandparent);
+
+ node_pointer p_b = p_nd->m_p_right;
+ node_pointer p_c = p_parent->m_p_right;
+
+ p_nd->m_p_right = p_parent;
+ p_parent->m_p_parent = p_nd;
+
+ p_parent->m_p_right = p_grandparent;
+ p_grandparent->m_p_parent = p_parent;
+
+ p_parent->m_p_left = p_b;
+ if (p_b != NULL)
+ p_b->m_p_parent = p_parent;
+
+ p_grandparent->m_p_left = p_c;
+ if (p_c != NULL)
+ p_c->m_p_parent = p_grandparent;
+
+ splay_zz_end(p_nd, p_parent, p_grandparent);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+splay_zig_zig_right(node_pointer p_nd, node_pointer p_parent,
+ node_pointer p_grandparent)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_parent == p_nd->m_p_parent);
+ _GLIBCXX_DEBUG_ASSERT(p_grandparent == p_parent->m_p_parent);
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_grandparent);)
+ _GLIBCXX_DEBUG_ASSERT(p_parent->m_p_right == p_nd &&
+ p_nd->m_p_parent->m_p_parent->m_p_right == p_nd->m_p_parent);
+
+ splay_zz_start(p_nd, p_parent, p_grandparent);
+
+ node_pointer p_b = p_nd->m_p_left;
+ node_pointer p_c = p_parent->m_p_left;
+
+ p_nd->m_p_left = p_parent;
+ p_parent->m_p_parent = p_nd;
+
+ p_parent->m_p_left = p_grandparent;
+ p_grandparent->m_p_parent = p_parent;
+
+ p_parent->m_p_right = p_b;
+ if (p_b != NULL)
+ p_b->m_p_parent = p_parent;
+
+ p_grandparent->m_p_right = p_c;
+ if (p_c != NULL)
+ p_c->m_p_parent = p_grandparent;
+
+ base_type::update_to_top(p_grandparent, (node_update* )this);
+ splay_zz_end(p_nd, p_parent, p_grandparent);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+splay_zz_start(node_pointer p_nd,
+#ifdef _GLIBCXX_DEBUG
+ node_pointer p_parent,
+#else
+ node_pointer /*p_parent*/,
+#endif
+ node_pointer p_grandparent)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_nd != NULL);
+ _GLIBCXX_DEBUG_ASSERT(p_parent != NULL);
+ _GLIBCXX_DEBUG_ASSERT(p_grandparent != NULL);
+
+ const bool grandparent_head = p_grandparent->m_p_parent == base_type::m_p_head;
+
+ if (grandparent_head)
+ {
+ base_type::m_p_head->m_p_parent = base_type::m_p_head->m_p_parent;
+ p_nd->m_p_parent = base_type::m_p_head;
+ return;
+ }
+
+ node_pointer p_greatgrandparent = p_grandparent->m_p_parent;
+
+ p_nd->m_p_parent = p_greatgrandparent;
+
+ if (p_grandparent == p_greatgrandparent->m_p_left)
+ p_greatgrandparent->m_p_left = p_nd;
+ else
+ p_greatgrandparent->m_p_right = p_nd;
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+splay_zz_end(node_pointer p_nd, node_pointer p_parent,
+ node_pointer p_grandparent)
+{
+ if (p_nd->m_p_parent == base_type::m_p_head)
+ base_type::m_p_head->m_p_parent = p_nd;
+
+ apply_update(p_grandparent, (node_update* )this);
+ apply_update(p_parent, (node_update* )this);
+ apply_update(p_nd, (node_update* )this);
+
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_nd);)
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/splay_tree_.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/splay_tree_.hpp
new file mode 100644
index 0000000..959893e
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/splay_tree_.hpp
@@ -0,0 +1,298 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file splay_tree_.hpp
+ * Contains an implementation class for splay_tree_.
+ */
+/*
+ * This implementation uses an idea from the SGI STL (using a "header" node
+ * which is needed for efficient iteration). Following is the SGI STL
+ * copyright.
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ */
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#ifndef PB_DS_BIN_SEARCH_TREE_HPP__DATA_TRUE_INDICATOR
+#define PB_DS_BIN_SEARCH_TREE_HPP__DATA_TRUE_INDICATOR
+#include <ext/pb_ds/detail/bin_search_tree_/bin_search_tree_.hpp>
+#endif
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#ifndef PB_DS_BIN_SEARCH_TREE_HPP__DATA_FALSE_INDICATOR
+#define PB_DS_BIN_SEARCH_TREE_HPP__DATA_FALSE_INDICATOR
+#include <ext/pb_ds/detail/bin_search_tree_/bin_search_tree_.hpp>
+#endif
+#endif
+
+#include <utility>
+#include <vector>
+#include <assert.h>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, typename Mapped, typename Cmp_Fn, \
+ typename Node_And_It_Traits, typename Allocator>
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_CLASS_NAME splay_tree_data_
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#define PB_DS_CLASS_NAME splay_tree_no_data_
+#endif
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_BASE_CLASS_NAME bin_search_tree_data_
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#define PB_DS_BASE_CLASS_NAME bin_search_tree_no_data_
+#endif
+
+#define PB_DS_CLASS_C_DEC \
+ PB_DS_CLASS_NAME<Key, Mapped, Cmp_Fn, Node_And_It_Traits, Allocator>
+
+#define PB_DS_BASE_C_DEC \
+ PB_DS_BASE_CLASS_NAME<Key, Mapped, Cmp_Fn, Node_And_It_Traits, Allocator>
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_V2F(X) (X).first
+#define PB_DS_V2S(X) (X).second
+#define PB_DS_EP2VP(X)& ((X)->m_value)
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#define PB_DS_V2F(X) (X)
+#define PB_DS_V2S(X) Mapped_Data()
+#define PB_DS_EP2VP(X)& ((X)->m_value.first)
+#endif
+
+ // $p14y 7r33 7481.
+ template<typename Key, typename Mapped, typename Cmp_Fn,
+ typename Node_And_It_Traits, typename Allocator>
+ class PB_DS_CLASS_NAME : public PB_DS_BASE_C_DEC
+ {
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+ typedef typename base_type::node_pointer node_pointer;
+
+ public:
+ typedef Allocator allocator_type;
+ typedef typename Allocator::size_type size_type;
+ typedef typename Allocator::difference_type difference_type;
+ typedef Cmp_Fn cmp_fn;
+ typedef typename base_type::key_type key_type;
+ typedef typename base_type::key_pointer key_pointer;
+ typedef typename base_type::const_key_pointer const_key_pointer;
+ typedef typename base_type::key_reference key_reference;
+ typedef typename base_type::const_key_reference const_key_reference;
+ typedef typename base_type::mapped_type mapped_type;
+ typedef typename base_type::mapped_pointer mapped_pointer;
+ typedef typename base_type::const_mapped_pointer const_mapped_pointer;
+ typedef typename base_type::mapped_reference mapped_reference;
+ typedef typename base_type::const_mapped_reference const_mapped_reference;
+ typedef typename base_type::value_type value_type;
+ typedef typename base_type::pointer pointer;
+ typedef typename base_type::const_pointer const_pointer;
+ typedef typename base_type::reference reference;
+ typedef typename base_type::const_reference const_reference;
+ typedef typename base_type::point_iterator point_iterator;
+ typedef typename base_type::const_iterator const_point_iterator;
+ typedef typename base_type::iterator iterator;
+ typedef typename base_type::const_iterator const_iterator;
+ typedef typename base_type::reverse_iterator reverse_iterator;
+ typedef typename base_type::const_reverse_iterator const_reverse_iterator;
+ typedef typename base_type::node_update node_update;
+
+ PB_DS_CLASS_NAME();
+
+ PB_DS_CLASS_NAME(const Cmp_Fn&);
+
+ PB_DS_CLASS_NAME(const Cmp_Fn&, const node_update&);
+
+ PB_DS_CLASS_NAME(const PB_DS_CLASS_C_DEC&);
+
+ void
+ swap(PB_DS_CLASS_C_DEC&);
+
+ template<typename It>
+ void
+ copy_from_range(It, It);
+
+ void
+ initialize();
+
+ inline std::pair<point_iterator, bool>
+ insert(const_reference r_value);
+
+ inline mapped_reference
+ operator[](const_key_reference r_key)
+ {
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+ std::pair<point_iterator, bool> ins_pair =
+ insert_leaf_imp(value_type(r_key, mapped_type()));
+
+ ins_pair.first.m_p_nd->m_special = false;
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_valid());
+ splay(ins_pair.first.m_p_nd);
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+ return ins_pair.first.m_p_nd->m_value.second;
+#else
+ insert(r_key);
+ return base_type::s_null_mapped;
+#endif
+ }
+
+ inline point_iterator
+ find(const_key_reference);
+
+ inline const_point_iterator
+ find(const_key_reference) const;
+
+ inline bool
+ erase(const_key_reference);
+
+ inline iterator
+ erase(iterator it);
+
+ inline reverse_iterator
+ erase(reverse_iterator);
+
+ template<typename Pred>
+ inline size_type
+ erase_if(Pred);
+
+ void
+ join(PB_DS_CLASS_C_DEC&);
+
+ void
+ split(const_key_reference, PB_DS_CLASS_C_DEC&);
+
+ private:
+ inline std::pair<point_iterator, bool>
+ insert_leaf_imp(const_reference);
+
+ inline node_pointer
+ find_imp(const_key_reference);
+
+ inline const node_pointer
+ find_imp(const_key_reference) const;
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid() const;
+
+ void
+ assert_special_imp(const node_pointer) const;
+#endif
+
+ void
+ splay(node_pointer);
+
+ inline void
+ splay_zig_zag_left(node_pointer, node_pointer, node_pointer);
+
+ inline void
+ splay_zig_zag_right(node_pointer, node_pointer, node_pointer);
+
+ inline void
+ splay_zig_zig_left(node_pointer, node_pointer, node_pointer);
+
+ inline void
+ splay_zig_zig_right(node_pointer, node_pointer, node_pointer);
+
+ inline void
+ splay_zz_start(node_pointer, node_pointer, node_pointer);
+
+ inline void
+ splay_zz_end(node_pointer, node_pointer, node_pointer);
+
+ inline node_pointer
+ leftmost(node_pointer);
+
+ void
+ erase_node(node_pointer);
+ };
+
+#include <ext/pb_ds/detail/splay_tree_/constructors_destructor_fn_imps.hpp>
+#include <ext/pb_ds/detail/splay_tree_/insert_fn_imps.hpp>
+#include <ext/pb_ds/detail/splay_tree_/splay_fn_imps.hpp>
+#include <ext/pb_ds/detail/splay_tree_/erase_fn_imps.hpp>
+#include <ext/pb_ds/detail/splay_tree_/find_fn_imps.hpp>
+#include <ext/pb_ds/detail/splay_tree_/debug_fn_imps.hpp>
+#include <ext/pb_ds/detail/splay_tree_/split_join_fn_imps.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_CLASS_NAME
+#undef PB_DS_BASE_CLASS_NAME
+#undef PB_DS_BASE_C_DEC
+#undef PB_DS_V2F
+#undef PB_DS_EP2VP
+#undef PB_DS_V2S
+ } // namespace detail
+} // namespace __gnu_pbds
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/split_join_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/split_join_fn_imps.hpp
new file mode 100644
index 0000000..7f0b2cb
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/split_join_fn_imps.hpp
@@ -0,0 +1,112 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file split_join_fn_imps.hpp
+ * Contains an implementation class for splay_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+join(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ if (base_type::join_prep(other) == false)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ return;
+ }
+
+ node_pointer p_target_r = other.leftmost(other.m_p_head);
+ _GLIBCXX_DEBUG_ASSERT(p_target_r != NULL);
+ other.splay(p_target_r);
+
+ _GLIBCXX_DEBUG_ASSERT(p_target_r == other.m_p_head->m_p_parent);
+ _GLIBCXX_DEBUG_ASSERT(p_target_r->m_p_left == NULL);
+
+ p_target_r->m_p_left = base_type::m_p_head->m_p_parent;
+
+ _GLIBCXX_DEBUG_ASSERT(p_target_r->m_p_left != NULL);
+ p_target_r->m_p_left->m_p_parent = p_target_r;
+
+ base_type::m_p_head->m_p_parent = p_target_r;
+ p_target_r->m_p_parent = base_type::m_p_head;
+ apply_update(p_target_r, (node_update* )this);
+
+ base_type::join_finish(other);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+split(const_key_reference r_key, PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid());
+
+ if (base_type::split_prep(r_key, other) == false)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid());
+ return;
+ }
+
+ node_pointer p_upper_bound = upper_bound(r_key).m_p_nd;
+ _GLIBCXX_DEBUG_ASSERT(p_upper_bound != NULL);
+
+ splay(p_upper_bound);
+ _GLIBCXX_DEBUG_ASSERT(p_upper_bound->m_p_parent == this->m_p_head);
+
+ node_pointer p_new_root = p_upper_bound->m_p_left;
+ _GLIBCXX_DEBUG_ASSERT(p_new_root != NULL);
+
+ base_type::m_p_head->m_p_parent = p_new_root;
+ p_new_root->m_p_parent = base_type::m_p_head;
+ other.m_p_head->m_p_parent = p_upper_bound;
+ p_upper_bound->m_p_parent = other.m_p_head;
+ p_upper_bound->m_p_left = NULL;
+ apply_update(p_upper_bound, (node_update* )this);
+ base_type::split_finish(other);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid());
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/traits.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/traits.hpp
new file mode 100644
index 0000000..cfedc35
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/splay_tree_/traits.hpp
@@ -0,0 +1,113 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file traits.hpp
+ * Contains an implementation for splay_tree_.
+ */
+
+#ifndef PB_DS_SPLAY_TREE_NODE_AND_IT_TRAITS_HPP
+#define PB_DS_SPLAY_TREE_NODE_AND_IT_TRAITS_HPP
+
+#include <ext/pb_ds/detail/splay_tree_/node.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+ template<typename Key,
+ typename Mapped,
+ class Cmp_Fn,
+ template<typename Const_Node_Iterator,
+ class Node_Iterator,
+ class Cmp_Fn_,
+ class Allocator_>
+ class Node_Update,
+ class Allocator>
+ struct tree_traits<
+ Key,
+ Mapped,
+ Cmp_Fn,
+ Node_Update,
+ splay_tree_tag,
+ Allocator> : public bin_search_tree_traits<
+ Key,
+ Mapped,
+ Cmp_Fn,
+ Node_Update,
+ splay_tree_node_<
+ typename types_traits<
+ Key,
+ Mapped,
+ Allocator,
+ false>::value_type,
+ typename tree_node_metadata_selector<
+ Key,
+ Mapped,
+ Cmp_Fn,
+ Node_Update,
+ Allocator>::type,
+ Allocator>,
+ Allocator>
+ { };
+
+ template<typename Key,
+ class Cmp_Fn,
+ template<typename Const_Node_Iterator,
+ class Node_Iterator,
+ class Cmp_Fn_,
+ class Allocator_>
+ class Node_Update,
+ class Allocator>
+ struct tree_traits<Key, null_mapped_type, Cmp_Fn, Node_Update,
+ splay_tree_tag, Allocator>
+ : public bin_search_tree_traits<Key, null_mapped_type, Cmp_Fn,
+ Node_Update,
+ splay_tree_node_<typename types_traits<Key, null_mapped_type, Allocator, false>::value_type,
+ typename tree_node_metadata_selector<
+ Key,
+ null_mapped_type,
+ Cmp_Fn,
+ Node_Update,
+ Allocator>::type,
+ Allocator>,
+ Allocator>
+ { };
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_SPLAY_TREE_NODE_AND_IT_TRAITS_HPP
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/standard_policies.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/standard_policies.hpp
new file mode 100644
index 0000000..cfbfbb0
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/standard_policies.hpp
@@ -0,0 +1,136 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file standard_policies.hpp
+ * Contains standard policies for containers.
+ */
+
+#ifndef PB_DS_STANDARD_POLICIES_HPP
+#define PB_DS_STANDARD_POLICIES_HPP
+
+#include <memory>
+#include <ext/pb_ds/hash_policy.hpp>
+#include <ext/pb_ds/list_update_policy.hpp>
+#include <ext/pb_ds/tree_policy.hpp>
+#include <ext/pb_ds/detail/basic_tree_policy/null_node_metadata.hpp>
+#include <ext/pb_ds/trie_policy.hpp>
+#include <ext/pb_ds/tag_and_trait.hpp>
+#include <tr1/functional>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ template<typename Key>
+ struct default_hash_fn
+ {
+ typedef std::tr1::hash<Key> type;
+ };
+
+ template<typename Key>
+ struct default_eq_fn
+ {
+ typedef std::equal_to<Key> type;
+ };
+
+ enum
+ {
+ default_store_hash = false
+ };
+
+ struct default_comb_hash_fn
+ {
+ typedef __gnu_pbds::direct_mask_range_hashing<> type;
+ };
+
+ template<typename Comb_Hash_Fn>
+ struct default_resize_policy
+ {
+ private:
+ typedef typename Comb_Hash_Fn::size_type size_type;
+
+ typedef __gnu_pbds::direct_mask_range_hashing<size_type> default_fn;
+ typedef is_same<default_fn, Comb_Hash_Fn> same_type;
+ typedef __gnu_pbds::hash_exponential_size_policy<size_type> iftrue;
+ typedef __gnu_pbds::hash_prime_size_policy iffalse;
+ typedef __conditional_type<same_type::value, iftrue, iffalse> cond_type;
+ typedef typename cond_type::__type size_policy_type;
+
+ typedef __gnu_pbds::hash_load_check_resize_trigger<false, size_type> trigger;
+
+ public:
+ typedef __gnu_pbds::hash_standard_resize_policy<size_policy_type, trigger, false, size_type> type;
+ };
+
+ struct default_update_policy
+ {
+ typedef __gnu_pbds::move_to_front_lu_policy<> type;
+ };
+
+ template<typename Comb_Probe_Fn>
+ struct default_probe_fn
+ {
+ private:
+ typedef typename Comb_Probe_Fn::size_type size_type;
+
+ typedef __gnu_pbds::direct_mask_range_hashing<size_type> default_fn;
+ typedef is_same<default_fn, Comb_Probe_Fn> same_type;
+ typedef __gnu_pbds::linear_probe_fn<size_type> iftrue;
+ typedef __gnu_pbds::quadratic_probe_fn<size_type> iffalse;
+ typedef __conditional_type<same_type::value, iftrue, iffalse> cond_type;
+
+ public:
+ typedef typename cond_type::__type type;
+ };
+
+ template<typename Key>
+ struct default_trie_e_access_traits;
+
+ template<typename Char, class Char_Traits>
+ struct default_trie_e_access_traits<std::basic_string<Char, Char_Traits, std::allocator<char> > >
+ {
+ private:
+ typedef std::basic_string<Char, Char_Traits, std::allocator<char> > string_type;
+
+ public:
+ typedef __gnu_pbds::string_trie_e_access_traits<string_type> type;
+ };
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_STANDARD_POLICIES_HPP
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/thin_heap_/constructors_destructor_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/thin_heap_/constructors_destructor_fn_imps.hpp
new file mode 100644
index 0000000..4d2c45c
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/thin_heap_/constructors_destructor_fn_imps.hpp
@@ -0,0 +1,106 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructors_destructor_fn_imps.hpp
+ * Contains an implementation for thin_heap_.
+ */
+
+PB_DS_CLASS_T_DEC
+template<typename It>
+void
+PB_DS_CLASS_C_DEC::
+copy_from_range(It first_it, It last_it)
+{
+ while (first_it != last_it)
+ push(*(first_it++));
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+thin_heap_() :
+ m_p_max(NULL)
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+thin_heap_(const Cmp_Fn& r_cmp_fn) :
+ PB_DS_BASE_C_DEC(r_cmp_fn),
+ m_p_max(NULL)
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+thin_heap_(const PB_DS_CLASS_C_DEC& other) :
+ PB_DS_BASE_C_DEC(other)
+{
+ initialize();
+ m_p_max = base_type::m_p_root;
+ for (node_pointer p_nd = base_type::m_p_root; p_nd != NULL; p_nd = p_nd->m_p_next_sibling)
+ if (Cmp_Fn::operator()(m_p_max->m_value, p_nd->m_value))
+ m_p_max = p_nd;
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ base_type::swap(other);
+ std::swap(m_p_max, other.m_p_max);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+~thin_heap_()
+{ }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+initialize()
+{ std::fill(m_a_aux, m_a_aux + max_rank, static_cast<node_pointer>(NULL)); }
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/thin_heap_/debug_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/thin_heap_/debug_fn_imps.hpp
new file mode 100644
index 0000000..f7abe35
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/thin_heap_/debug_fn_imps.hpp
@@ -0,0 +1,112 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_fn_imps.hpp
+ * Contains an implementation for thin_heap_.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_valid() const
+{
+ base_type::assert_valid();
+ assert_node_consistent(base_type::m_p_root, true);
+ assert_max();
+ assert_aux_null();
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_aux_null() const
+{
+ for (size_type i = 0; i < max_rank; ++i)
+ _GLIBCXX_DEBUG_ASSERT(m_a_aux[i] == NULL);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_max() const
+{
+ if (m_p_max == NULL)
+ {
+ _GLIBCXX_DEBUG_ASSERT(base_type::empty());
+ return;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(!base_type::empty());
+ _GLIBCXX_DEBUG_ASSERT(base_type::parent(m_p_max) == NULL);
+ _GLIBCXX_DEBUG_ASSERT(m_p_max->m_p_prev_or_parent == NULL);
+ for (const_iterator it = base_type::begin(); it != base_type::end(); ++it)
+ _GLIBCXX_DEBUG_ASSERT(!Cmp_Fn::operator()(m_p_max->m_value, it.m_p_nd->m_value));
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_node_consistent(const_node_pointer p_nd, bool root) const
+{
+ base_type::assert_node_consistent(p_nd, root);
+ if (p_nd == NULL)
+ return;
+
+ assert_node_consistent(p_nd->m_p_next_sibling, root);
+ assert_node_consistent(p_nd->m_p_l_child, false);
+ if (!root)
+ {
+ if (p_nd->m_metadata == 0)
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_next_sibling == NULL);
+ else
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_metadata == p_nd->m_p_next_sibling->m_metadata + 1);
+ }
+
+ if (p_nd->m_p_l_child != NULL)
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_l_child->m_metadata + 1 == base_type::degree(p_nd));
+
+ const bool unmarked_valid =(p_nd->m_p_l_child == NULL&& p_nd->m_metadata == 0) ||(p_nd->m_p_l_child != NULL&& p_nd->m_metadata == p_nd->m_p_l_child->m_metadata + 1);
+
+ const bool marked_valid =(p_nd->m_p_l_child == NULL&& p_nd->m_metadata == 1) ||(p_nd->m_p_l_child != NULL&& p_nd->m_metadata == p_nd->m_p_l_child->m_metadata + 2);
+
+ _GLIBCXX_DEBUG_ASSERT(unmarked_valid || marked_valid);
+ if (root)
+ _GLIBCXX_DEBUG_ASSERT(unmarked_valid);
+}
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/thin_heap_/erase_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/thin_heap_/erase_fn_imps.hpp
new file mode 100644
index 0000000..69afcd3
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/thin_heap_/erase_fn_imps.hpp
@@ -0,0 +1,296 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file erase_fn_imps.hpp
+ * Contains an implementation for thin_heap_.
+ */
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+pop()
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ASSERT(!base_type::empty());
+
+ _GLIBCXX_DEBUG_ASSERT(m_p_max != NULL);
+
+ node_pointer p_nd = m_p_max;
+
+ remove_max_node();
+
+ base_type::actual_erase_node(p_nd);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+remove_max_node()
+{
+ to_aux_except_max();
+
+ make_from_aux();
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+to_aux_except_max()
+{
+ node_pointer p_add = base_type::m_p_root;
+
+ while (p_add != m_p_max)
+ {
+ node_pointer p_next_add = p_add->m_p_next_sibling;
+
+ add_to_aux(p_add);
+
+ p_add = p_next_add;
+ }
+
+ p_add = m_p_max->m_p_l_child;
+
+ while (p_add != NULL)
+ {
+ node_pointer p_next_add = p_add->m_p_next_sibling;
+
+ p_add->m_metadata = p_add->m_p_l_child == NULL?
+ 0 :
+ p_add->m_p_l_child->m_metadata + 1;
+
+ add_to_aux(p_add);
+
+ p_add = p_next_add;
+ }
+
+ p_add = m_p_max->m_p_next_sibling;
+
+ while (p_add != NULL)
+ {
+ node_pointer p_next_add = p_add->m_p_next_sibling;
+
+ add_to_aux(p_add);
+
+ p_add = p_next_add;
+ }
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+add_to_aux(node_pointer p_nd)
+{
+ size_type r = p_nd->m_metadata;
+
+ while (m_a_aux[r] != NULL)
+ {
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_metadata < rank_bound());
+
+ if (Cmp_Fn::operator()(m_a_aux[r]->m_value, p_nd->m_value))
+ make_child_of(m_a_aux[r], p_nd);
+ else
+ {
+ make_child_of(p_nd, m_a_aux[r]);
+
+ p_nd = m_a_aux[r];
+ }
+
+ m_a_aux[r] = NULL;
+
+ ++r;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_metadata < rank_bound());
+
+ m_a_aux[r] = p_nd;
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+make_child_of(node_pointer p_nd, node_pointer p_new_parent)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_metadata == p_new_parent->m_metadata);
+ _GLIBCXX_DEBUG_ASSERT(m_a_aux[p_nd->m_metadata] == p_nd ||
+ m_a_aux[p_nd->m_metadata] == p_new_parent);
+
+ ++p_new_parent->m_metadata;
+
+ base_type::make_child_of(p_nd, p_new_parent);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+make_from_aux()
+{
+ base_type::m_p_root = m_p_max = NULL;
+
+ const size_type rnk_bnd = rank_bound();
+
+ size_type i = 0;
+
+ while (i < rnk_bnd)
+ {
+ if (m_a_aux[i] != NULL)
+ {
+ make_root_and_link(m_a_aux[i]);
+
+ m_a_aux[i] = NULL;
+ }
+
+ ++i;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(assert_aux_null();)
+ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+remove_node(node_pointer p_nd)
+{
+ node_pointer p_parent = p_nd;
+ while (base_type::parent(p_parent) != NULL)
+ p_parent = base_type::parent(p_parent);
+
+ base_type::bubble_to_top(p_nd);
+
+ m_p_max = p_nd;
+
+ node_pointer p_fix = base_type::m_p_root;
+ while (p_fix != NULL&& p_fix->m_p_next_sibling != p_parent)
+ p_fix = p_fix->m_p_next_sibling;
+
+ if (p_fix != NULL)
+ p_fix->m_p_next_sibling = p_nd;
+
+ remove_max_node();
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+clear()
+{
+ base_type::clear();
+
+ m_p_max = NULL;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+erase(point_iterator it)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ASSERT(!base_type::empty());
+
+ node_pointer p_nd = it.m_p_nd;
+
+ remove_node(p_nd);
+
+ base_type::actual_erase_node(p_nd);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+erase_if(Pred pred)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ if (base_type::empty())
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ return 0;
+ }
+
+ base_type::to_linked_list();
+
+ node_pointer p_out = base_type::prune(pred);
+
+ size_type ersd = 0;
+
+ while (p_out != NULL)
+ {
+ ++ersd;
+
+ node_pointer p_next = p_out->m_p_next_sibling;
+
+ base_type::actual_erase_node(p_out);
+
+ p_out = p_next;
+ }
+
+ node_pointer p_cur = base_type::m_p_root;
+
+ m_p_max = base_type::m_p_root = NULL;
+
+ while (p_cur != NULL)
+ {
+ node_pointer p_next = p_cur->m_p_next_sibling;
+
+ make_root_and_link(p_cur);
+
+ p_cur = p_next;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ return ersd;
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+rank_bound()
+{
+ const std::size_t* const p_upper =
+ std::upper_bound( g_a_rank_bounds, g_a_rank_bounds + num_distinct_rank_bounds, base_type::m_size);
+
+ if (p_upper == g_a_rank_bounds + num_distinct_rank_bounds)
+ return max_rank;
+
+ return (p_upper - g_a_rank_bounds);
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/thin_heap_/find_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/thin_heap_/find_fn_imps.hpp
new file mode 100644
index 0000000..52407e6
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/thin_heap_/find_fn_imps.hpp
@@ -0,0 +1,51 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file find_fn_imps.hpp
+ * Contains an implementation for thin_heap_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_reference
+PB_DS_CLASS_C_DEC::
+top() const
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ASSERT(!base_type::empty());
+
+ _GLIBCXX_DEBUG_ASSERT(m_p_max != NULL);
+ return m_p_max->m_value;
+}
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/thin_heap_/insert_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/thin_heap_/insert_fn_imps.hpp
new file mode 100644
index 0000000..7a6952f
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/thin_heap_/insert_fn_imps.hpp
@@ -0,0 +1,326 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file insert_fn_imps.hpp
+ * Contains an implementation for thin_heap_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::point_iterator
+PB_DS_CLASS_C_DEC::
+push(const_reference r_val)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ node_pointer p_nd = base_type::get_new_node_for_insert(r_val);
+
+ p_nd->m_metadata = 0;
+
+ p_nd->m_p_prev_or_parent = p_nd->m_p_l_child = NULL;
+
+ if (base_type::m_p_root == NULL)
+ {
+ p_nd->m_p_next_sibling = NULL;
+
+ m_p_max = base_type::m_p_root = p_nd;
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ return point_iterator(p_nd);
+ }
+
+ p_nd->m_p_next_sibling = base_type::m_p_root;
+
+ base_type::m_p_root->m_p_prev_or_parent = NULL;
+
+ base_type::m_p_root = p_nd;
+
+ update_max(p_nd);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ return point_iterator(p_nd);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+make_root(node_pointer p_nd)
+{
+ p_nd->m_metadata =
+ p_nd->m_p_l_child == NULL?
+ 0 :
+ 1 + p_nd->m_p_l_child->m_metadata;
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+make_root_and_link(node_pointer p_nd)
+{
+ make_root(p_nd);
+
+ p_nd->m_p_prev_or_parent = NULL;
+
+ p_nd->m_p_next_sibling = base_type::m_p_root;
+
+ if (base_type::m_p_root != NULL)
+ base_type::m_p_root->m_p_prev_or_parent = NULL;
+
+ base_type::m_p_root = p_nd;
+
+ update_max(p_nd);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+fix(node_pointer p_y)
+{
+ while (true)
+ {
+ if (p_y->m_p_prev_or_parent == NULL)
+ {
+ fix_root(p_y);
+
+ return;
+ }
+ else if (p_y->m_metadata == 1&& p_y->m_p_next_sibling == NULL)
+ {
+ if (p_y->m_p_l_child != NULL)
+ {
+ fix_sibling_rank_1_unmarked(p_y);
+
+ return;
+ }
+
+ fix_sibling_rank_1_marked(p_y);
+
+ p_y = p_y->m_p_prev_or_parent;
+ }
+ else if (p_y->m_metadata > p_y->m_p_next_sibling->m_metadata + 1)
+ {
+ _GLIBCXX_DEBUG_ASSERT(p_y->m_p_l_child != NULL);
+
+ if (p_y->m_metadata != p_y->m_p_l_child->m_metadata + 2)
+ {
+ fix_sibling_general_unmarked(p_y);
+
+ return;
+ }
+
+ fix_sibling_general_marked(p_y);
+
+ p_y = p_y->m_p_prev_or_parent;
+ }
+ else if ((p_y->m_p_l_child == NULL&&
+ p_y->m_metadata == 2) ||(p_y->m_p_l_child != NULL&&
+ p_y->m_metadata == p_y->m_p_l_child->m_metadata + 3))
+ {
+ node_pointer p_z = p_y->m_p_prev_or_parent;
+
+ fix_child(p_y);
+
+ p_y = p_z;
+ }
+ else
+ return;
+ }
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+fix_root(node_pointer p_y)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_y->m_p_prev_or_parent == NULL);
+
+ make_root(p_y);
+
+ _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_y, true);)
+ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+fix_sibling_rank_1_unmarked(node_pointer p_y)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_y->m_p_prev_or_parent != NULL);
+
+ _GLIBCXX_DEBUG_ONLY(node_pointer p_w = p_y->m_p_l_child;)
+ _GLIBCXX_DEBUG_ASSERT(p_w != NULL);
+ _GLIBCXX_DEBUG_ASSERT(p_w->m_p_next_sibling == NULL);
+ _GLIBCXX_DEBUG_ASSERT(p_y->m_p_next_sibling == NULL);
+
+ p_y->m_p_next_sibling = p_y->m_p_l_child;
+
+ p_y->m_p_next_sibling->m_p_prev_or_parent = p_y;
+
+ p_y->m_p_l_child = NULL;
+
+ _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_y, false);)
+ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+fix_sibling_rank_1_marked(node_pointer p_y)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_y->m_p_prev_or_parent != NULL);
+ _GLIBCXX_DEBUG_ASSERT(p_y->m_p_l_child == NULL);
+
+ p_y->m_metadata = 0;
+
+ _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_y, false);)
+ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+fix_sibling_general_unmarked(node_pointer p_y)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_y->m_p_prev_or_parent != NULL);
+
+ node_pointer p_w = p_y->m_p_l_child;
+ _GLIBCXX_DEBUG_ASSERT(p_w != NULL);
+ _GLIBCXX_DEBUG_ASSERT(p_w->m_p_next_sibling != NULL);
+
+ p_y->m_p_l_child = p_w->m_p_next_sibling;
+ p_w->m_p_next_sibling->m_p_prev_or_parent = p_y;
+
+ p_w->m_p_next_sibling = p_y->m_p_next_sibling;
+ _GLIBCXX_DEBUG_ASSERT(p_w->m_p_next_sibling != NULL);
+ p_w->m_p_next_sibling->m_p_prev_or_parent = p_w;
+
+ p_y->m_p_next_sibling = p_w;
+ p_w->m_p_prev_or_parent = p_y;
+
+ _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_y, false);)
+ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+fix_sibling_general_marked(node_pointer p_y)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_y->m_p_prev_or_parent != NULL);
+
+ --p_y->m_metadata;
+
+ _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_y, false);)
+ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+fix_child(node_pointer p_y)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_y->m_p_prev_or_parent != NULL);
+
+ if (p_y->m_p_next_sibling != NULL)
+ p_y->m_p_next_sibling->m_p_prev_or_parent = p_y->m_p_prev_or_parent;
+
+ if (p_y->m_p_prev_or_parent->m_p_l_child == p_y)
+ p_y->m_p_prev_or_parent->m_p_l_child = p_y->m_p_next_sibling;
+ else
+ p_y->m_p_prev_or_parent->m_p_next_sibling = p_y->m_p_next_sibling;
+
+ make_root_and_link(p_y);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+modify(point_iterator it, const_reference r_new_val)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ node_pointer p_nd = it.m_p_nd;
+
+ _GLIBCXX_DEBUG_ASSERT(p_nd != NULL);
+
+ const bool smaller = Cmp_Fn::operator()(r_new_val, p_nd->m_value);
+
+ p_nd->m_value = r_new_val;
+
+ if (smaller)
+ {
+ remove_node(p_nd);
+
+ p_nd->m_p_l_child = NULL;
+
+ make_root_and_link(p_nd);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ return;
+ }
+
+ if (p_nd->m_p_prev_or_parent == NULL)
+ {
+ update_max(p_nd);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ return;
+ }
+
+ node_pointer p_y = p_nd->m_p_prev_or_parent;
+ _GLIBCXX_DEBUG_ASSERT(p_y != NULL);
+
+ if (p_nd->m_p_next_sibling != NULL)
+ p_nd->m_p_next_sibling->m_p_prev_or_parent = p_y;
+
+ if (p_y->m_p_l_child == p_nd)
+ p_y->m_p_l_child = p_nd->m_p_next_sibling;
+ else
+ p_y->m_p_next_sibling = p_nd->m_p_next_sibling;
+
+ fix(p_y);
+
+ make_root_and_link(p_nd);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+update_max(node_pointer p_nd)
+{
+ if (m_p_max == NULL || Cmp_Fn::operator()(m_p_max->m_value, p_nd->m_value))
+ m_p_max = p_nd;
+}
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/thin_heap_/split_join_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/thin_heap_/split_join_fn_imps.hpp
new file mode 100644
index 0000000..6acb7bd
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/thin_heap_/split_join_fn_imps.hpp
@@ -0,0 +1,126 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file split_join_fn_imps.hpp
+ * Contains an implementation for thin_heap_.
+ */
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+void
+PB_DS_CLASS_C_DEC::
+split(Pred pred, PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+
+ other.clear();
+
+ if (base_type::empty())
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+
+ return;
+ }
+
+ base_type::to_linked_list();
+
+ node_pointer p_out = base_type::prune(pred);
+
+ while (p_out != NULL)
+ {
+ _GLIBCXX_DEBUG_ASSERT(base_type::m_size > 0);
+ --base_type::m_size;
+
+ ++other.m_size;
+
+ node_pointer p_next = p_out->m_p_next_sibling;
+
+ other.make_root_and_link(p_out);
+
+ p_out = p_next;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+
+ node_pointer p_cur = base_type::m_p_root;
+
+ m_p_max = NULL;
+
+ base_type::m_p_root = NULL;
+
+ while (p_cur != NULL)
+ {
+ node_pointer p_next = p_cur->m_p_next_sibling;
+
+ make_root_and_link(p_cur);
+
+ p_cur = p_next;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+join(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+
+ node_pointer p_other = other.m_p_root;
+
+ while (p_other != NULL)
+ {
+ node_pointer p_next = p_other->m_p_next_sibling;
+
+ make_root_and_link(p_other);
+
+ p_other = p_next;
+ }
+
+ base_type::m_size += other.m_size;
+
+ other.m_p_root = NULL;
+ other.m_size = 0;
+ other.m_p_max = NULL;
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ }
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/thin_heap_/thin_heap_.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/thin_heap_/thin_heap_.hpp
new file mode 100644
index 0000000..88fa04b
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/thin_heap_/thin_heap_.hpp
@@ -0,0 +1,351 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file thin_heap_.hpp
+ * Contains an implementation class for a thin heap.
+ */
+
+#ifndef PB_DS_THIN_HEAP_HPP
+#define PB_DS_THIN_HEAP_HPP
+
+/*
+ * Thin heaps.
+ * Tarjan and Kaplan.
+ */
+
+#include <algorithm>
+#include <ext/pb_ds/detail/cond_dealtor.hpp>
+#include <ext/pb_ds/detail/type_utils.hpp>
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp>
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/null_metadata.hpp>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Value_Type, class Cmp_Fn, class Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ thin_heap_<Value_Type, Cmp_Fn, Allocator>
+
+#ifdef _GLIBCXX_DEBUG
+#define PB_DS_BASE_C_DEC \
+ left_child_next_sibling_heap_<Value_Type, Cmp_Fn, \
+ typename Allocator::size_type, Allocator, true>
+#else
+#define PB_DS_BASE_C_DEC \
+ left_child_next_sibling_heap_<Value_Type, Cmp_Fn, \
+ typename Allocator::size_type, Allocator>
+#endif
+
+ /**
+ * class description = "t|-|i|\| h34p">
+ **/
+ template<typename Value_Type, class Cmp_Fn, class Allocator>
+ class thin_heap_ : public PB_DS_BASE_C_DEC
+ {
+
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ protected:
+ typedef typename base_type::node node;
+
+ typedef typename base_type::node_pointer node_pointer;
+
+ typedef typename base_type::const_node_pointer const_node_pointer;
+
+ public:
+
+ typedef typename Allocator::size_type size_type;
+
+ typedef typename Allocator::difference_type difference_type;
+
+ typedef Value_Type value_type;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::pointer
+ pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::const_pointer
+ const_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::reference
+ reference;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::const_reference
+ const_reference;
+
+ typedef
+ typename PB_DS_BASE_C_DEC::const_point_iterator
+ const_point_iterator;
+
+ typedef typename PB_DS_BASE_C_DEC::point_iterator point_iterator;
+
+ typedef typename PB_DS_BASE_C_DEC::const_iterator const_iterator;
+
+ typedef typename PB_DS_BASE_C_DEC::iterator iterator;
+
+ typedef Cmp_Fn cmp_fn;
+
+ typedef Allocator allocator_type;
+
+ public:
+
+ inline point_iterator
+ push(const_reference r_val);
+
+ void
+ modify(point_iterator it, const_reference r_new_val);
+
+ inline const_reference
+ top() const;
+
+ void
+ pop();
+
+ void
+ erase(point_iterator it);
+
+ inline void
+ clear();
+
+ template<typename Pred>
+ size_type
+ erase_if(Pred pred);
+
+ template<typename Pred>
+ void
+ split(Pred pred, PB_DS_CLASS_C_DEC& other);
+
+ void
+ join(PB_DS_CLASS_C_DEC& other);
+
+ protected:
+
+ thin_heap_();
+
+ thin_heap_(const Cmp_Fn& r_cmp_fn);
+
+ thin_heap_(const PB_DS_CLASS_C_DEC& other);
+
+ void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ ~thin_heap_();
+
+ template<typename It>
+ void
+ copy_from_range(It first_it, It last_it);
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid() const;
+
+ void
+ assert_max() const;
+#endif
+
+#ifdef PB_DS_THIN_HEAP_TRACE_
+ void
+ trace() const;
+#endif
+
+ private:
+ enum
+ {
+ max_rank = (sizeof(size_type) << 4) + 2
+ };
+
+ private:
+
+ void
+ initialize();
+
+ inline void
+ update_max(node_pointer p_nd);
+
+ inline void
+ fix(node_pointer p_nd);
+
+ inline void
+ fix_root(node_pointer p_y);
+
+ inline void
+ fix_sibling_rank_1_unmarked(node_pointer p_y);
+
+ inline void
+ fix_sibling_rank_1_marked(node_pointer p_y);
+
+ inline void
+ fix_sibling_general_unmarked(node_pointer p_y);
+
+ inline void
+ fix_sibling_general_marked(node_pointer p_y);
+
+ inline void
+ fix_child(node_pointer p_y);
+
+ inline static void
+ make_root(node_pointer p_nd);
+
+ inline void
+ make_root_and_link(node_pointer p_nd);
+
+ inline void
+ remove_max_node();
+
+ void
+ to_aux_except_max();
+
+ inline void
+ add_to_aux(node_pointer p_nd);
+
+ inline void
+ make_from_aux();
+
+ inline size_type
+ rank_bound();
+
+ inline void
+ make_child_of(node_pointer p_nd, node_pointer p_new_parent);
+
+ inline void
+ remove_node(node_pointer p_nd);
+
+ inline node_pointer
+ join(node_pointer p_lhs, node_pointer p_rhs) const;
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_node_consistent(const_node_pointer p_nd, bool root) const;
+
+ void
+ assert_aux_null() const;
+#endif
+
+ private:
+ node_pointer m_p_max;
+
+ node_pointer m_a_aux[max_rank];
+ };
+
+ enum
+ {
+ num_distinct_rank_bounds = 48
+ };
+
+ // Taken from the SGI implementation; acknowledged in the docs.
+ static const std::size_t g_a_rank_bounds[num_distinct_rank_bounds] =
+ {
+ /* Dealing cards... */
+ /* 0 */ 0ul,
+ /* 1 */ 1ul,
+ /* 2 */ 1ul,
+ /* 3 */ 2ul,
+ /* 4 */ 4ul,
+ /* 5 */ 6ul,
+ /* 6 */ 11ul,
+ /* 7 */ 17ul,
+ /* 8 */ 29ul,
+ /* 9 */ 46ul,
+ /* 10 */ 76ul,
+ /* 11 */ 122ul,
+ /* 12 */ 199ul,
+ /* 13 */ 321ul,
+ /* 14 */ 521ul,
+ /* 15 */ 842ul,
+ /* 16 */ 1364ul,
+ /* 17 */ 2206ul,
+ /* 18 */ 3571ul,
+ /* 19 */ 5777ul,
+ /* 20 */ 9349ul,
+ /* 21 */ 15126ul,
+ /* 22 */ 24476ul,
+ /* 23 */ 39602ul,
+ /* 24 */ 64079ul,
+ /* 25 */ 103681ul,
+ /* 26 */ 167761ul,
+ /* 27 */ 271442ul,
+ /* 28 */ 439204ul,
+ /* 29 */ 710646ul,
+ /* 30 */ 1149851ul,
+ /* 31 */ 1860497ul,
+ /* 32 */ 3010349ul,
+ /* 33 */ 4870846ul,
+ /* 34 */ 7881196ul,
+ /* 35 */ 12752042ul,
+ /* 36 */ 20633239ul,
+ /* 37 */ 33385282ul,
+ /* 38 */ 54018521ul,
+ /* 39 */ 87403803ul,
+ /* 40 */ 141422324ul,
+ /* 41 */ 228826127ul,
+ /* 42 */ 370248451ul,
+ /* 43 */ 599074578ul,
+ /* 44 */ 969323029ul,
+ /* 45 */ 1568397607ul,
+ /* 46 */ 2537720636ul,
+ /* 47 */ 4106118243ul
+ /* Pot's good, let's play */
+ };
+
+#include <ext/pb_ds/detail/thin_heap_/constructors_destructor_fn_imps.hpp>
+#include <ext/pb_ds/detail/thin_heap_/debug_fn_imps.hpp>
+#include <ext/pb_ds/detail/thin_heap_/trace_fn_imps.hpp>
+#include <ext/pb_ds/detail/thin_heap_/find_fn_imps.hpp>
+#include <ext/pb_ds/detail/thin_heap_/insert_fn_imps.hpp>
+#include <ext/pb_ds/detail/thin_heap_/erase_fn_imps.hpp>
+#include <ext/pb_ds/detail/thin_heap_/split_join_fn_imps.hpp>
+
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_BASE_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/thin_heap_/trace_fn_imps.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/thin_heap_/trace_fn_imps.hpp
new file mode 100644
index 0000000..fc309d5
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/thin_heap_/trace_fn_imps.hpp
@@ -0,0 +1,55 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file trace_fn_imps.hpp
+ * Contains an implementation class for left_child_next_sibling_heap_.
+ */
+
+#ifdef PB_DS_THIN_HEAP_TRACE_
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+trace() const
+{
+ std::cerr << std::endl;
+
+ std::cerr << "m_p_max " << m_p_max << std::endl;
+
+ base_type::trace();
+}
+
+#endif // #ifdef PB_DS_THIN_HEAP_TRACE_
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/tree_policy/node_metadata_selector.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/tree_policy/node_metadata_selector.hpp
new file mode 100644
index 0000000..c182886
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/tree_policy/node_metadata_selector.hpp
@@ -0,0 +1,116 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file node_metadata_selector.hpp
+ * Contains an implementation class for trees.
+ */
+
+#ifndef PB_DS_TREE_NODE_METADATA_SELECTOR_HPP
+#define PB_DS_TREE_NODE_METADATA_SELECTOR_HPP
+
+#include <ext/pb_ds/detail/basic_tree_policy/null_node_metadata.hpp>
+#include <ext/pb_ds/detail/types_traits.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+ template<typename Node_Update, bool Null>
+ struct tree_metadata_helper
+ {
+ typedef typename Node_Update::metadata_type type;
+ };
+
+ template<typename Node_Update>
+ struct tree_metadata_helper<
+ Node_Update,
+ true>
+ {
+ typedef null_node_metadata type;
+ };
+
+ template<typename Key,
+ typename Data,
+ class Cmp_Fn,
+ template<typename Const_Node_Iterator,
+ class Const_Iterator,
+ class Cmp_Fn_,
+ class Allocator_>
+ class Node_Update,
+ class Allocator>
+ struct tree_node_metadata_selector
+ {
+ private:
+ typedef
+ dumconst_node_iterator<
+ Key,
+ Data,
+ Allocator>
+ dumconst_node_it;
+
+ enum
+ {
+ null_update =
+ is_same<
+ Node_Update<
+ dumconst_node_it,
+ dumconst_node_it,
+ Cmp_Fn,
+ Allocator>,
+ null_tree_node_update<
+ dumconst_node_it,
+ dumconst_node_it,
+ Cmp_Fn,
+ Allocator> >::value
+ };
+
+ public:
+ typedef
+ typename tree_metadata_helper<
+ Node_Update<
+ dumconst_node_it,
+ dumconst_node_it,
+ Cmp_Fn,
+ Allocator>,
+ null_update>::type
+ type;
+ };
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_TREE_NODE_METADATA_SELECTOR_HPP
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/tree_policy/null_node_update_imp.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/tree_policy/null_node_update_imp.hpp
new file mode 100644
index 0000000..006a3eb
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/tree_policy/null_node_update_imp.hpp
@@ -0,0 +1,50 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file null_node_update_imp.hpp
+ * Contains an implementation of null_node_update.
+ */
+
+PB_DS_CLASS_T_DEC
+template<typename Const_Node_Iterator_,
+ typename Node_Iterator_,
+ class Cmp_Fn_,
+ typename Allocator_>
+inline void
+PB_DS_CLASS_C_DEC::
+swap(null_tree_node_update< Const_Node_Iterator_, Node_Iterator_, Cmp_Fn_, Allocator_>& /*other*/)
+{ }
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/tree_policy/order_statistics_imp.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/tree_policy/order_statistics_imp.hpp
new file mode 100644
index 0000000..1d33767
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/tree_policy/order_statistics_imp.hpp
@@ -0,0 +1,141 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file order_statistics_imp.hpp
+ * Contains forward declarations for order_statistics_key
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+find_by_order(size_type order)
+{
+ node_iterator it = node_begin();
+
+ node_iterator end_it = node_end();
+
+ while (it != end_it)
+ {
+ node_iterator l_it = it.get_l_child();
+
+ const size_type o = (l_it == end_it)?
+ 0 :
+ l_it.get_metadata();
+
+ if (order == o)
+ return (*it);
+ else if (order < o)
+ it = l_it;
+ else
+ {
+ order -= o + 1;
+
+ it = it.get_r_child();
+ }
+ }
+
+ return (PB_DS_BASE_C_DEC::end_iterator());
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+find_by_order(size_type order) const
+{
+ return (const_cast<PB_DS_CLASS_C_DEC* >(this)->find_by_order(order));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+order_of_key(const_key_reference r_key) const
+{
+ const_node_iterator it = node_begin();
+
+ const_node_iterator end_it = node_end();
+
+ const cmp_fn& r_cmp_fn =
+ const_cast<PB_DS_CLASS_C_DEC* >(this)->get_cmp_fn();
+
+ size_type ord = 0;
+
+ while (it != end_it)
+ {
+ const_node_iterator l_it = it.get_l_child();
+
+ if (r_cmp_fn(r_key, extract_key(*(*it))))
+ it = l_it;
+ else if (r_cmp_fn(extract_key(*(*it)), r_key))
+ {
+
+ ord += (l_it == end_it)?
+ 1 :
+ 1 + l_it.get_metadata();
+
+ it = it.get_r_child();
+ }
+ else
+ {
+ ord += (l_it == end_it)?
+ 0 :
+ l_it.get_metadata();
+
+ it = end_it;
+ }
+ }
+
+ return (ord);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+operator()(node_iterator node_it, const_node_iterator end_nd_it) const
+{
+ node_iterator l_child_it = node_it.get_l_child();
+ const size_type l_rank =(l_child_it == end_nd_it)? 0 : l_child_it.get_metadata();
+
+ node_iterator r_child_it = node_it.get_r_child();
+ const size_type r_rank =(r_child_it == end_nd_it)? 0 : r_child_it.get_metadata();
+
+ const_cast<metadata_reference>(node_it.get_metadata())=
+ 1 + l_rank + r_rank;
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+~tree_order_statistics_node_update()
+{ }
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/tree_policy/sample_tree_node_update.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/tree_policy/sample_tree_node_update.hpp
new file mode 100644
index 0000000..6ea6899
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/tree_policy/sample_tree_node_update.hpp
@@ -0,0 +1,72 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file sample_tree_node_update.hpp
+ * Contains a samle node update functor.
+ */
+
+#ifndef PB_DS_SAMPLE_TREE_NODE_UPDATOR_HPP
+#define PB_DS_SAMPLE_TREE_NODE_UPDATOR_HPP
+
+// A sample node updator.
+template<typename Const_Node_Iterator,
+
+ class Node_Iterator,
+
+ class Cmp_Fn,
+
+ class Allocator
+ >
+class sample_tree_node_update
+{
+
+public:
+
+ // Metadata type.
+ typedef size_t metadata_type;
+
+protected:
+
+ // Default constructor.
+ sample_tree_node_update();
+
+ // Updates the rank of a node through a node_iterator node_it; end_nd_it is the end node iterator.
+ inline void
+ operator()(node_iterator node_it, const_node_iterator end_nd_it) const;
+
+};
+
+#endif // #ifndef PB_DS_SAMPLE_TREE_NODE_UPDATOR_HPP
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/tree_trace_base.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/tree_trace_base.hpp
new file mode 100644
index 0000000..e4bd656
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/tree_trace_base.hpp
@@ -0,0 +1,209 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file tree_trace_base.hpp
+ * Contains tree-related policies.
+ */
+
+#ifndef PB_DS_TREE_TRACE_BASE_HPP
+#define PB_DS_TREE_TRACE_BASE_HPP
+
+#ifdef PB_DS_TREE_TRACE
+
+#include <ext/pb_ds/detail/basic_tree_policy/basic_tree_policy_base.hpp>
+#include <ext/pb_ds/detail/basic_tree_policy/null_node_metadata.hpp>
+
+namespace __gnu_pbds
+{
+
+ namespace detail
+ {
+
+#ifdef PB_DS_TREE_TRACE
+
+#define PB_DS_CLASS_T_DEC \
+ template< \
+ class Const_Node_Iterator, \
+ class Node_Iterator, \
+ class Cmp_Fn, \
+ bool Node_Based, \
+ class Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ tree_trace_base< \
+ Const_Node_Iterator, \
+ Node_Iterator, \
+ Cmp_Fn, \
+ Node_Based, \
+ Allocator>
+
+#define PB_DS_BASE_C_DEC \
+ basic_tree_policy_base< \
+ Const_Node_Iterator, \
+ Node_Iterator, \
+ Allocator>
+
+ template<typename Const_Node_Iterator,
+ class Node_Iterator,
+ class Cmp_Fn,
+ bool Node_Based,
+ class Allocator>
+ class tree_trace_base : private PB_DS_BASE_C_DEC
+ {
+ public:
+ void
+ trace() const;
+
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ typedef Const_Node_Iterator const_node_iterator;
+
+ typedef typename Allocator::size_type size_type;
+
+ private:
+ void
+ trace_node(const_node_iterator nd_it, size_type level) const;
+
+ virtual bool
+ empty() const = 0;
+
+ virtual const_node_iterator
+ node_begin() const = 0;
+
+ virtual const_node_iterator
+ node_end() const = 0;
+
+ static void
+ print_node_pointer(Const_Node_Iterator nd_it, integral_constant<int,true>);
+
+ static void
+ print_node_pointer(Const_Node_Iterator nd_it, integral_constant<int,false>);
+
+ template<typename Metadata_>
+ static void
+ trace_it_metadata(Const_Node_Iterator nd_it, type_to_type<Metadata_>);
+
+ static void
+ trace_it_metadata(Const_Node_Iterator, type_to_type<null_node_metadata>);
+ };
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ trace() const
+ {
+ if (empty())
+ return;
+
+ trace_node(node_begin(), 0);
+ }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ trace_node(const_node_iterator nd_it, size_type level) const
+ {
+ if (nd_it.get_r_child() != node_end())
+ trace_node(nd_it.get_r_child(), level + 1);
+
+ for (size_type i = 0; i < level; ++i)
+ std::cerr << ' ';
+
+ print_node_pointer(nd_it, integral_constant<int,Node_Based>());
+ std::cerr << base_type::extract_key(*(*nd_it));
+
+ typedef
+ type_to_type<
+ typename const_node_iterator::metadata_type>
+ m_type_ind_t;
+
+ trace_it_metadata(nd_it, m_type_ind_t());
+
+ std::cerr << std::endl;
+
+ if (nd_it.get_l_child() != node_end())
+ trace_node(nd_it.get_l_child(), level + 1);
+ }
+
+ PB_DS_CLASS_T_DEC
+ template<typename Metadata_>
+ void
+ PB_DS_CLASS_C_DEC::
+ trace_it_metadata(Const_Node_Iterator nd_it, type_to_type<Metadata_>)
+ {
+ std::cerr << " (" <<
+ static_cast<unsigned long>(nd_it.get_metadata()) << ") ";
+ }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ trace_it_metadata(Const_Node_Iterator, type_to_type<null_node_metadata>)
+ { }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ print_node_pointer(Const_Node_Iterator nd_it, integral_constant<int,true>)
+ {
+ std::cerr << nd_it.m_p_nd << " ";
+ }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ print_node_pointer(Const_Node_Iterator nd_it, integral_constant<int,false>)
+ {
+ std::cerr <<* nd_it << " ";
+ }
+
+#undef PB_DS_CLASS_T_DEC
+
+#undef PB_DS_CLASS_C_DEC
+
+#undef PB_DS_BASE_C_DEC
+
+#endif // #ifdef PB_DS_TREE_TRACE
+
+ } // namespace detail
+
+} // namespace __gnu_pbds
+
+#endif // #ifdef PB_DS_TREE_TRACE
+
+#endif // #ifndef PB_DS_TREE_TRACE_BASE_HPP
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/trie_policy/node_metadata_selector.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/trie_policy/node_metadata_selector.hpp
new file mode 100644
index 0000000..b4de31f
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/trie_policy/node_metadata_selector.hpp
@@ -0,0 +1,116 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file node_metadata_selector.hpp
+ * Contains an implementation class for tries.
+ */
+
+#ifndef PB_DS_TRIE_NODE_METADATA_SELECTOR_HPP
+#define PB_DS_TRIE_NODE_METADATA_SELECTOR_HPP
+
+#include <ext/pb_ds/detail/basic_tree_policy/null_node_metadata.hpp>
+#include <ext/pb_ds/detail/types_traits.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+ template<typename Node_Update, bool Null>
+ struct trie_metadata_helper
+ {
+ typedef typename Node_Update::metadata_type type;
+ };
+
+ template<typename Node_Update>
+ struct trie_metadata_helper<
+ Node_Update,
+ true>
+ {
+ typedef null_node_metadata type;
+ };
+
+ template<typename Key,
+ typename Data,
+ class Cmp_Fn,
+ template<typename Const_Node_Iterator,
+ class Const_Iterator,
+ class Cmp_Fn_,
+ class Allocator_>
+ class Node_Update,
+ class Allocator>
+ struct trie_node_metadata_selector
+ {
+ private:
+ typedef
+ dumconst_node_iterator<
+ Key,
+ Data,
+ Allocator>
+ dumconst_node_it;
+
+ enum
+ {
+ null_update =
+ is_same<
+ Node_Update<
+ dumconst_node_it,
+ dumconst_node_it,
+ Cmp_Fn,
+ Allocator>,
+ null_trie_node_update<
+ dumconst_node_it,
+ dumconst_node_it,
+ Cmp_Fn,
+ Allocator> >::value
+ };
+
+ public:
+ typedef
+ typename trie_metadata_helper<
+ Node_Update<
+ dumconst_node_it,
+ dumconst_node_it,
+ Cmp_Fn,
+ Allocator>,
+ null_update>::type
+ type;
+ };
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_TRIE_NODE_METADATA_SELECTOR_HPP
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/trie_policy/null_node_update_imp.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/trie_policy/null_node_update_imp.hpp
new file mode 100644
index 0000000..65245e9
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/trie_policy/null_node_update_imp.hpp
@@ -0,0 +1,50 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file null_node_update_imp.hpp
+ * Contains an implementation of null_node_update.
+ */
+
+PB_DS_CLASS_T_DEC
+template<typename Const_Node_Iterator_,
+ typename Node_Iterator_,
+ class E_Access_Traits_,
+ typename Allocator_>
+inline void
+PB_DS_CLASS_C_DEC::
+swap(null_trie_node_update< Const_Node_Iterator_, Node_Iterator_, E_Access_Traits_, Allocator_>& /*other*/)
+{ }
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/trie_policy/order_statistics_imp.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/trie_policy/order_statistics_imp.hpp
new file mode 100644
index 0000000..4e27ac2
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/trie_policy/order_statistics_imp.hpp
@@ -0,0 +1,183 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file order_statistics_imp.hpp
+ * Contains forward declarations for order_statistics_key
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+find_by_order(size_type order)
+{
+ if (empty())
+ return (end());
+
+ ++order;
+
+ node_iterator nd_it = node_begin();
+
+ node_iterator end_nd_it = node_end();
+
+ while (true)
+ {
+ if (order > nd_it.get_metadata())
+ return (++base_type::rightmost_it(nd_it));
+
+ const size_type num_children = nd_it.num_children();
+
+ if (num_children == 0)
+ return (*nd_it);
+
+ for (size_type i = 0; i < num_children; ++i)
+ {
+ node_iterator child_nd_it = nd_it.get_child(i);
+
+ if (order <= child_nd_it.get_metadata())
+ {
+ i = num_children;
+
+ nd_it = child_nd_it;
+ }
+ else
+ order -= child_nd_it.get_metadata();
+ }
+ }
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+find_by_order(size_type order) const
+{
+ return (const_cast<PB_DS_CLASS_C_DEC* >(this)->find_by_order(order));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+order_of_key(const_key_reference r_key) const
+{
+ const E_Access_Traits& r_traits =
+ const_cast<PB_DS_CLASS_C_DEC* >(this)->get_e_access_traits();
+
+ return (order_of_prefix(
+ r_traits.begin(r_key),
+ r_traits.end(r_key)));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+order_of_prefix(typename e_access_traits::const_iterator b, typename e_access_traits::const_iterator e) const
+{
+ if (empty())
+ return (0);
+
+ const E_Access_Traits& r_traits =
+ const_cast<PB_DS_CLASS_C_DEC* >(this)->get_e_access_traits();
+
+ const_node_iterator nd_it = node_begin();
+
+ const_node_iterator end_nd_it = node_end();
+
+ size_type ord = 0;
+
+ while (true)
+ {
+ const size_type num_children = nd_it.num_children();
+
+ if (num_children == 0)
+ {
+ const_key_reference r_key =
+ base_type::extract_key(*(*nd_it));
+
+ typename e_access_traits::const_iterator key_b =
+ r_traits.begin(r_key);
+
+ typename e_access_traits::const_iterator key_e =
+ r_traits.end(r_key);
+
+ return ((base_type::less( key_b, key_e, b, e, r_traits))?
+ ord + 1 :
+ ord);
+ }
+
+ const_node_iterator next_nd_it = end_nd_it;
+
+ size_type i = num_children - 1;
+
+ do
+ {
+ const_node_iterator child_nd_it = nd_it.get_child(i);
+
+ if (next_nd_it != end_nd_it)
+ ord += child_nd_it.get_metadata();
+ else if (!base_type::less(
+ b, e,
+ child_nd_it.valid_prefix().first,
+ child_nd_it.valid_prefix().second,
+ r_traits))
+ next_nd_it = child_nd_it;
+ }
+ while (i-- > 0);
+
+ if (next_nd_it == end_nd_it)
+ return (ord);
+
+ nd_it = next_nd_it;
+ }
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+operator()(node_iterator nd_it, const_node_iterator /*end_nd_it*/) const
+{
+ const size_type num_children = nd_it.num_children();
+
+ size_type children_rank = 0;
+
+ for (size_type i = 0; i < num_children; ++i)
+ children_rank += nd_it.get_child(i).get_metadata();
+
+ const_cast<size_type& >(nd_it.get_metadata()) =(num_children == 0)? 1 : children_rank;
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+~trie_order_statistics_node_update()
+{ }
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/trie_policy/prefix_search_node_update_imp.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/trie_policy/prefix_search_node_update_imp.hpp
new file mode 100644
index 0000000..cdd8989
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/trie_policy/prefix_search_node_update_imp.hpp
@@ -0,0 +1,151 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file prefix_search_node_update_imp.hpp
+ * Contains an implementation of prefix_search_node_update.
+ */
+
+PB_DS_CLASS_T_DEC
+std::pair<
+ typename PB_DS_CLASS_C_DEC::const_iterator,
+ typename PB_DS_CLASS_C_DEC::const_iterator>
+PB_DS_CLASS_C_DEC::
+prefix_range(const_key_reference r_key) const
+{
+ const e_access_traits& r_traits = get_e_access_traits();
+
+ return (prefix_range(
+ r_traits.begin(r_key),
+ r_traits.end(r_key)));
+}
+
+PB_DS_CLASS_T_DEC
+std::pair<
+ typename PB_DS_CLASS_C_DEC::iterator,
+ typename PB_DS_CLASS_C_DEC::iterator>
+PB_DS_CLASS_C_DEC::
+prefix_range(const_key_reference r_key)
+{
+ return (prefix_range(
+ get_e_access_traits().begin(r_key),
+ get_e_access_traits().end(r_key)));
+}
+
+PB_DS_CLASS_T_DEC
+std::pair<
+ typename PB_DS_CLASS_C_DEC::const_iterator,
+ typename PB_DS_CLASS_C_DEC::const_iterator>
+PB_DS_CLASS_C_DEC::
+prefix_range(typename e_access_traits::const_iterator b, typename e_access_traits::const_iterator e) const
+{
+ const std::pair<iterator, iterator> non_const_ret =
+ const_cast<PB_DS_CLASS_C_DEC* >(this)->prefix_range(b, e);
+
+ return (std::make_pair(
+ const_iterator(non_const_ret.first),
+ const_iterator(non_const_ret.second)));
+}
+
+PB_DS_CLASS_T_DEC
+std::pair<
+ typename PB_DS_CLASS_C_DEC::iterator,
+ typename PB_DS_CLASS_C_DEC::iterator>
+PB_DS_CLASS_C_DEC::
+prefix_range(typename e_access_traits::const_iterator b, typename e_access_traits::const_iterator e)
+{
+ Node_Iterator nd_it = node_begin();
+ Node_Iterator end_nd_it = node_end();
+
+ const e_access_traits& r_traits =
+ get_e_access_traits();
+
+ const size_type given_range_length = std::distance(b, e);
+
+ while (true)
+ {
+ if (nd_it == end_nd_it)
+ return (std::make_pair(end(), end()));
+
+ const size_type common_range_length =
+ PB_DS_BASE_C_DEC::common_prefix_len(nd_it, b, e, r_traits);
+
+ if (common_range_length >= given_range_length)
+ {
+ iterator ret_b = leftmost_it(nd_it);
+
+ iterator ret_e = rightmost_it(nd_it);
+
+ return (std::make_pair(ret_b, ++ret_e));
+ }
+
+ nd_it = next_child(nd_it, b, e, end_nd_it, r_traits);
+ }
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::node_iterator
+PB_DS_CLASS_C_DEC::
+next_child(node_iterator nd_it, typename e_access_traits::const_iterator b, typename e_access_traits::const_iterator e, node_iterator end_nd_it, const e_access_traits& r_traits)
+{
+ const size_type num_children = nd_it.num_children();
+
+ node_iterator ret = end_nd_it;
+
+ size_type max_length = 0;
+
+ for (size_type i = 0; i < num_children; ++i)
+ {
+ node_iterator pot = nd_it.get_child(i);
+
+ const size_type common_range_length =
+ PB_DS_BASE_C_DEC::common_prefix_len( pot, b, e, r_traits);
+
+ if (common_range_length > max_length)
+ {
+ ret = pot;
+
+ max_length = common_range_length;
+ }
+ }
+
+ return (ret);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+operator()(node_iterator /*nd_it*/, const_node_iterator /*end_nd_it*/) const
+{ }
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/trie_policy/sample_trie_e_access_traits.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/trie_policy/sample_trie_e_access_traits.hpp
new file mode 100644
index 0000000..34fbe0c
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/trie_policy/sample_trie_e_access_traits.hpp
@@ -0,0 +1,89 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file sample_trie_e_access_traits.hpp
+ * Contains a sample probe policy.
+ */
+
+#ifndef PB_DS_SAMPLE_TRIE_E_ACCESS_TRAITS_HPP
+#define PB_DS_SAMPLE_TRIE_E_ACCESS_TRAITS_HPP
+
+// A sample trie element-access traits.
+class sample_trie_e_access_traits
+{
+
+public:
+
+ // Size type.
+ typedef size_t size_type;
+
+ // Key type.
+ typedef std::string key_type;
+
+ // Const key reference type.
+ typedef
+ typename Allocator::template rebind<
+ key_type>::other::const_reference
+ const_key_reference;
+
+ // Element const iterator type.
+ typedef std::string::const_iterator const_iterator;
+
+ // Element type.
+ typedef char e_type;
+
+ enum
+ {
+ max_size = 4
+ };
+
+public:
+
+ // Returns a const_iterator to the first element of r_key.
+ inline static const_iterator
+ begin(const_key_reference r_key);
+
+ // Returns a const_iterator to the after-last element of r_key.
+ inline static const_iterator
+ end(const_key_reference r_key);
+
+ // Maps an element to a position.
+ inline static size_type
+ e_pos(e_type e);
+
+};
+
+#endif // #ifndef PB_DS_SAMPLE_TRIE_E_ACCESS_TRAITS_HPP
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/trie_policy/sample_trie_node_update.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/trie_policy/sample_trie_node_update.hpp
new file mode 100644
index 0000000..55fd997
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/trie_policy/sample_trie_node_update.hpp
@@ -0,0 +1,72 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file sample_trie_node_update.hpp
+ * Contains a samle node update functor.
+ */
+
+#ifndef PB_DS_SAMPLE_TRIE_NODE_UPDATOR_HPP
+#define PB_DS_SAMPLE_TRIE_NODE_UPDATOR_HPP
+
+// A sample node updator.
+template<typename Const_Node_Iterator,
+
+ class Node_Iterator,
+
+ class E_Access_Traits,
+
+ class Allocator
+ >
+class sample_trie_node_update
+{
+
+public:
+
+ // Metadata type.
+ typedef size_t metadata_type;
+
+protected:
+
+ // Default constructor.
+ sample_trie_node_update();
+
+ // Updates the rank of a node through a node_iterator node_it; end_nd_it is the end node iterator.
+ inline void
+ operator()(node_iterator node_it, const_node_iterator end_nd_it) const;
+
+};
+
+#endif // #ifndef PB_DS_SAMPLE_TRIE_NODE_UPDATOR_HPP
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/trie_policy/string_trie_e_access_traits_imp.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/trie_policy/string_trie_e_access_traits_imp.hpp
new file mode 100644
index 0000000..228a4a5
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/trie_policy/string_trie_e_access_traits_imp.hpp
@@ -0,0 +1,99 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file string_trie_e_access_traits_imp.hpp
+ * Contains a policy for extracting character positions from
+ * a string for a vector-based PATRICIA tree
+ */
+
+PB_DS_CLASS_T_DEC
+detail::integral_constant<int, Reverse> PB_DS_CLASS_C_DEC::s_rev_ind;
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+e_pos(e_type e)
+{
+ return (static_cast<size_type>(e - min_e_val));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+begin(const_key_reference r_key)
+{
+ return (begin_imp(r_key, s_rev_ind));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+end(const_key_reference r_key)
+{
+ return (end_imp(r_key, s_rev_ind));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+begin_imp(const_key_reference r_key, detail::false_type)
+{
+ return (r_key.begin());
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+begin_imp(const_key_reference r_key, detail::true_type)
+{
+ return (r_key.rbegin());
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+end_imp(const_key_reference r_key, detail::false_type)
+{
+ return (r_key.end());
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+end_imp(const_key_reference r_key, detail::true_type)
+{
+ return (r_key.rend());
+}
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/trie_policy/trie_policy_base.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/trie_policy/trie_policy_base.hpp
new file mode 100644
index 0000000..db912a0
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/trie_policy/trie_policy_base.hpp
@@ -0,0 +1,249 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file trie_policy_base.hpp
+ * Contains an implementation of trie_policy_base.
+ */
+
+#ifndef PB_DS_TRIE_POLICY_BASE_HPP
+#define PB_DS_TRIE_POLICY_BASE_HPP
+
+#include <ext/pb_ds/detail/basic_tree_policy/basic_tree_policy_base.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_CLASS_T_DEC \
+ template< \
+ class Const_Node_Iterator, \
+ class Node_Iterator, \
+ class E_Access_Traits, \
+ typename Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ trie_policy_base< \
+ Const_Node_Iterator, \
+ Node_Iterator, \
+ E_Access_Traits, \
+ Allocator>
+
+#define PB_DS_BASE_C_DEC \
+ basic_tree_policy_base< \
+ Const_Node_Iterator, \
+ Node_Iterator, \
+ Allocator>
+
+ template<typename Const_Node_Iterator,
+ class Node_Iterator,
+ class E_Access_Traits,
+ class Allocator>
+ class trie_policy_base : public PB_DS_BASE_C_DEC
+ {
+
+ public:
+
+ typedef E_Access_Traits e_access_traits;
+
+ typedef Allocator allocator_type;
+
+ typedef typename allocator_type::size_type size_type;
+
+ typedef null_node_metadata metadata_type;
+
+ typedef Const_Node_Iterator const_node_iterator;
+
+ typedef Node_Iterator node_iterator;
+
+ typedef typename const_node_iterator::value_type const_iterator;
+
+ typedef typename node_iterator::value_type iterator;
+
+ public:
+
+ typedef typename PB_DS_BASE_C_DEC::key_type key_type;
+
+ typedef
+ typename PB_DS_BASE_C_DEC::const_key_reference
+ const_key_reference;
+
+ protected:
+
+ virtual const_iterator
+ end() const = 0;
+
+ virtual iterator
+ end() = 0;
+
+ virtual const_node_iterator
+ node_begin() const = 0;
+
+ virtual node_iterator
+ node_begin() = 0;
+
+ virtual const_node_iterator
+ node_end() const = 0;
+
+ virtual node_iterator
+ node_end() = 0;
+
+ virtual const e_access_traits&
+ get_e_access_traits() const = 0;
+
+ private:
+ typedef
+ std::pair<
+ typename e_access_traits::const_iterator,
+ typename e_access_traits::const_iterator>
+ prefix_range_t;
+
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ protected:
+ static size_type
+ common_prefix_len(node_iterator nd_it, typename e_access_traits::const_iterator b_r, typename e_access_traits::const_iterator e_r, const e_access_traits& r_traits);
+
+ static iterator
+ leftmost_it(node_iterator nd_it);
+
+ static iterator
+ rightmost_it(node_iterator nd_it);
+
+ static bool
+ less(typename e_access_traits::const_iterator b_l, typename e_access_traits::const_iterator e_l, typename e_access_traits::const_iterator b_r, typename e_access_traits::const_iterator e_r, const e_access_traits& r_traits);
+ };
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::size_type
+ PB_DS_CLASS_C_DEC::
+ common_prefix_len(node_iterator nd_it, typename e_access_traits::const_iterator b_r, typename e_access_traits::const_iterator e_r, const e_access_traits& r_traits)
+ {
+ prefix_range_t pref_range = nd_it.valid_prefix();
+
+ typename e_access_traits::const_iterator b_l = pref_range.first;
+ typename e_access_traits::const_iterator e_l = pref_range.second;
+
+ const size_type range_length_l =
+ std::distance(b_l, e_l);
+
+ const size_type range_length_r =
+ std::distance(b_r, e_r);
+
+ if (range_length_r < range_length_l)
+ {
+ std::swap(b_l, b_r);
+
+ std::swap(e_l, e_r);
+ }
+
+ size_type ret = 0;
+
+ while (b_l != e_l)
+ {
+ if (r_traits.e_pos(*b_l) != r_traits.e_pos(*b_r))
+ return (ret);
+
+ ++ret;
+
+ ++b_l;
+
+ ++b_r;
+ }
+
+ return (ret);
+ }
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::iterator
+ PB_DS_CLASS_C_DEC::
+ leftmost_it(node_iterator nd_it)
+ {
+ if (nd_it.num_children() == 0)
+ return (*nd_it);
+
+ return (leftmost_it(nd_it.get_child(0)));
+ }
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::iterator
+ PB_DS_CLASS_C_DEC::
+ rightmost_it(node_iterator nd_it)
+ {
+ const size_type num_children = nd_it.num_children();
+
+ if (num_children == 0)
+ return (*nd_it);
+
+ return (rightmost_it(nd_it.get_child(num_children - 1)));
+ }
+
+ PB_DS_CLASS_T_DEC
+ bool
+ PB_DS_CLASS_C_DEC::
+ less(typename e_access_traits::const_iterator b_l, typename e_access_traits::const_iterator e_l, typename e_access_traits::const_iterator b_r, typename e_access_traits::const_iterator e_r, const e_access_traits& r_traits)
+ {
+ while (b_l != e_l)
+ {
+ if (b_r == e_r)
+ return (false);
+
+ size_type l_pos =
+ r_traits.e_pos(*b_l);
+ size_type r_pos =
+ r_traits.e_pos(*b_r);
+
+ if (l_pos != r_pos)
+ return (l_pos < r_pos);
+
+ ++b_l;
+ ++b_r;
+ }
+
+ return (b_r != e_r);
+ }
+
+#undef PB_DS_CLASS_T_DEC
+
+#undef PB_DS_CLASS_C_DEC
+
+#undef PB_DS_BASE_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_TRIE_POLICY_BASE_HPP
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/type_utils.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/type_utils.hpp
new file mode 100644
index 0000000..55f349a
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/type_utils.hpp
@@ -0,0 +1,167 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file type_utils.hpp
+ * Contains utilities for handnling types. All of these classes are based on
+ * "Modern C++" by Andrei Alxandrescu.
+ */
+
+#ifndef PB_DS_TYPE_UTILS_HPP
+#define PB_DS_TYPE_UTILS_HPP
+
+#include <cstddef>
+#include <utility>
+#include <tr1/type_traits>
+#include <ext/type_traits.h>
+#include <ext/numeric_traits.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ using std::tr1::is_same;
+ using std::tr1::is_const;
+ using std::tr1::is_pointer;
+ using std::tr1::is_reference;
+ using std::tr1::is_fundamental;
+ using std::tr1::is_member_object_pointer;
+ using std::tr1::is_member_pointer;
+ using std::tr1::is_base_of;
+ using std::tr1::remove_const;
+ using std::tr1::remove_reference;
+
+ // Need integral_const<bool, true> <-> integral_const<int, 1>, so
+ // because of this use the following typedefs instead of importing
+ // std::tr1's.
+ using std::tr1::integral_constant;
+ typedef std::tr1::integral_constant<int, 1> true_type;
+ typedef std::tr1::integral_constant<int, 0> false_type;
+
+ using __gnu_cxx::__conditional_type;
+ using __gnu_cxx::__numeric_traits;
+
+ template<typename T>
+ struct is_const_pointer
+ {
+ enum
+ {
+ value = is_const<T>::value && is_pointer<T>::value
+ };
+ };
+
+ template<typename T>
+ struct is_const_reference
+ {
+ enum
+ {
+ value = is_const<T>::value && is_reference<T>::value
+ };
+ };
+
+ template<typename T>
+ struct is_simple
+ {
+ enum
+ {
+ value = is_fundamental<typename remove_const<T>::type>::value
+ || is_pointer<typename remove_const<T>::type>::value
+ || is_member_pointer<T>::value
+ };
+ };
+
+ template<typename T>
+ class is_pair
+ {
+ private:
+ template<typename U>
+ struct is_pair_imp
+ {
+ enum
+ {
+ value = 0
+ };
+ };
+
+ template<typename U, typename V>
+ struct is_pair_imp<std::pair<U,V> >
+ {
+ enum
+ {
+ value = 1
+ };
+ };
+
+ public:
+ enum
+ {
+ value = is_pair_imp<T>::value
+ };
+ };
+
+ // Use C++0x's static_assert if possible.
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#define PB_DS_STATIC_ASSERT(UNIQUE, E) static_assert(E, #UNIQUE)
+#else
+ template<bool>
+ struct __static_assert;
+
+ template<>
+ struct __static_assert<true>
+ { };
+
+ template<int>
+ struct __static_assert_dumclass
+ {
+ enum
+ {
+ v = 1
+ };
+ };
+
+#define PB_DS_STATIC_ASSERT(UNIQUE, E) \
+ typedef __gnu_pbds::detail::__static_assert_dumclass<sizeof(__gnu_pbds::detail::__static_assert<bool(E)>)> UNIQUE##__static_assert_type
+
+#endif
+
+ template<typename Type>
+ struct type_to_type
+ {
+ typedef Type type;
+ };
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/types_traits.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/types_traits.hpp
new file mode 100644
index 0000000..6d5a078
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/types_traits.hpp
@@ -0,0 +1,82 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file types_traits.hpp
+ * Contains a traits class of types used by containers.
+ */
+
+#ifndef PB_DS_TYPES_TRAITS_HPP
+#define PB_DS_TYPES_TRAITS_HPP
+
+#include <ext/pb_ds/detail/basic_types.hpp>
+#include <ext/pb_ds/detail/type_utils.hpp>
+#include <utility>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ template<typename Key, typename Mapped, typename Alloc, bool Store_Extra>
+ struct vt_base_selector
+ {
+ typedef value_type_base<Key, Mapped, Alloc, Store_Extra> type;
+ };
+
+ template<typename Key, typename Mapped, typename Alloc, bool Store_Extra>
+ struct types_traits
+ : public vt_base_selector<Key, Mapped, Alloc, Store_Extra>::type
+ {
+ typedef typename Alloc::template rebind<Key>::other key_allocator;
+ typedef typename key_allocator::value_type key_type;
+ typedef typename key_allocator::pointer key_pointer;
+ typedef typename key_allocator::const_pointer const_key_pointer;
+ typedef typename key_allocator::reference key_reference;
+ typedef typename key_allocator::const_reference const_key_reference;
+ typedef typename Alloc::size_type size_type;
+
+ // Extra value (used when the extra value is stored with each value).
+ typedef std::pair<size_type, size_type> comp_hash;
+
+ typedef integral_constant<int, Store_Extra> store_extra;
+ store_extra m_store_extra_indicator;
+
+ typedef typename no_throw_copies<Key, Mapped>::indicator no_throw_copies;
+ no_throw_copies m_no_throw_copies_indicator;
+ };
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/unordered_iterator/const_iterator.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/unordered_iterator/const_iterator.hpp
new file mode 100644
index 0000000..38d4eb1
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/unordered_iterator/const_iterator.hpp
@@ -0,0 +1,129 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file const_iterator.hpp
+ * Contains an iterator class used for const ranging over the elements of the
+ * table.
+ */
+
+// Const range-type iterator.
+class const_iterator_ :
+ public const_point_iterator_
+
+{
+
+public:
+
+ // Category.
+ typedef std::forward_iterator_tag iterator_category;
+
+ // Difference type.
+ typedef typename Allocator::difference_type difference_type;
+
+ // Iterator's value type.
+ typedef value_type_ value_type;
+
+ // Iterator's pointer type.
+ typedef pointer_ pointer;
+
+ // Iterator's const pointer type.
+ typedef const_pointer_ const_pointer;
+
+ // Iterator's reference type.
+ typedef reference_ reference;
+
+ // Iterator's const reference type.
+ typedef const_reference_ const_reference;
+
+public:
+
+ // Default constructor.
+ inline
+ const_iterator_()
+
+ : m_p_tbl(NULL)
+ { }
+
+ // Increments.
+ inline const_iterator_&
+ operator++()
+ {
+ m_p_tbl->inc_it_state(base_type::m_p_value, m_pos);
+
+ return (*this);
+ }
+
+ // Increments.
+ inline const_iterator_
+ operator++(int)
+ {
+ const_iterator_ ret =* this;
+
+ m_p_tbl->inc_it_state(base_type::m_p_value, m_pos);
+
+ return (ret);
+ }
+
+protected:
+
+ typedef const_point_iterator_ base_type;
+
+protected:
+
+ /**
+ * Constructor used by the table to initiate the generalized
+ * pointer and position (e.g., this is called from within a find()
+ * of a table.
+ * */
+ inline
+ const_iterator_(const_pointer_ p_value, PB_DS_GEN_POS pos, const PB_DS_CLASS_C_DEC* p_tbl) : const_point_iterator_(p_value),
+ m_p_tbl(p_tbl),
+ m_pos(pos)
+ { }
+
+protected:
+
+ /**
+ * Pointer to the table object which created the iterator (used for
+ * incrementing its position.
+ * */
+ const PB_DS_CLASS_C_DEC* m_p_tbl;
+
+ PB_DS_GEN_POS m_pos;
+
+ friend class PB_DS_CLASS_C_DEC;
+};
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/unordered_iterator/const_point_iterator.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/unordered_iterator/const_point_iterator.hpp
new file mode 100644
index 0000000..bc0b2ad
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/unordered_iterator/const_point_iterator.hpp
@@ -0,0 +1,151 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file const_point_iterator.hpp
+ * Contains an iterator class returned by the tables' const find and insert
+ * methods.
+ */
+
+class point_iterator_;
+
+// Const point-type iterator.
+class const_point_iterator_
+{
+
+public:
+
+ // Category.
+ typedef trivial_iterator_tag iterator_category;
+
+ // Difference type.
+ typedef trivial_iterator_difference_type difference_type;
+
+ // Iterator's value type.
+ typedef value_type_ value_type;
+
+ // Iterator's pointer type.
+ typedef pointer_ pointer;
+
+ // Iterator's const pointer type.
+ typedef const_pointer_ const_pointer;
+
+ // Iterator's reference type.
+ typedef reference_ reference;
+
+ // Iterator's const reference type.
+ typedef const_reference_ const_reference;
+
+public:
+
+ inline
+ const_point_iterator_(const_pointer p_value) : m_p_value(p_value)
+ { }
+
+ // Default constructor.
+ inline
+ const_point_iterator_()
+
+ : m_p_value(NULL)
+ { }
+
+ // Copy constructor.
+ inline
+ const_point_iterator_(const const_point_iterator_& other)
+
+ : m_p_value(other.m_p_value)
+ { }
+
+ // Copy constructor.
+ inline
+ const_point_iterator_(const point_iterator_& other)
+
+ : m_p_value(other.m_p_value)
+ { }
+
+ // Access.
+ inline const_pointer
+ operator->() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_value != NULL);
+
+ return (m_p_value);
+ }
+
+ // Access.
+ inline const_reference
+ operator*() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_value != NULL);
+
+ return (*m_p_value);
+ }
+
+ // Compares content to a different iterator object.
+ inline bool
+ operator==(const point_iterator_& other) const
+ {
+ return (m_p_value == other.m_p_value);
+ }
+
+ // Compares content to a different iterator object.
+ inline bool
+ operator==(const const_point_iterator_& other) const
+ {
+ return (m_p_value == other.m_p_value);
+ }
+
+ // Compares content (negatively) to a different iterator object.
+ inline bool
+ operator!=(const point_iterator_& other) const
+ {
+ return (m_p_value != other.m_p_value);
+ }
+
+ // Compares content (negatively) to a different iterator object.
+ inline bool
+ operator!=(const const_point_iterator_& other) const
+ {
+ return (m_p_value != other.m_p_value);
+ }
+
+protected:
+ const_pointer m_p_value;
+
+ friend class point_iterator_;
+
+ friend class PB_DS_CLASS_C_DEC;
+};
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/unordered_iterator/iterator.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/unordered_iterator/iterator.hpp
new file mode 100644
index 0000000..3e21aba
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/unordered_iterator/iterator.hpp
@@ -0,0 +1,150 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file iterator.hpp
+ * Contains an iterator_ class used for ranging over the elements of the
+ * table.
+ */
+
+// Range-type iterator.
+class iterator_ :
+ public const_iterator_
+
+{
+
+public:
+
+ // Category.
+ typedef std::forward_iterator_tag iterator_category;
+
+ // Difference type.
+ typedef typename Allocator::difference_type difference_type;
+
+ // Iterator's value type.
+ typedef value_type_ value_type;
+
+ // Iterator's pointer type.
+ typedef pointer_ pointer;
+
+ // Iterator's const pointer type.
+ typedef const_pointer_ const_pointer;
+
+ // Iterator's reference type.
+ typedef reference_ reference;
+
+ // Iterator's const reference type.
+ typedef const_reference_ const_reference;
+
+public:
+
+ // Default constructor.
+ inline
+ iterator_()
+
+ : const_iterator_(NULL, PB_DS_GEN_POS(), NULL)
+ { }
+
+ // Conversion to a point-type iterator.
+ inline
+ operator point_iterator_()
+ {
+ return (point_iterator_(
+ const_cast<pointer>(const_iterator_::m_p_value)));
+ }
+
+ // Conversion to a point-type iterator.
+ inline
+ operator const point_iterator_() const
+ {
+ return (point_iterator_(
+ const_cast<pointer>(const_iterator_::m_p_value)));
+ }
+
+ // Access.
+ inline pointer
+ operator->() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(base_type::m_p_value != NULL);
+
+ return (const_cast<pointer>(base_type::m_p_value));
+ }
+
+ // Access.
+ inline reference
+ operator*() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(base_type::m_p_value != NULL);
+
+ return (const_cast<reference>(*base_type::m_p_value));
+ }
+
+ // Increments.
+ inline iterator_&
+ operator++()
+ {
+ base_type::m_p_tbl->inc_it_state(base_type::m_p_value, base_type::m_pos);
+
+ return (*this);
+ }
+
+ // Increments.
+ inline iterator_
+ operator++(int)
+ {
+ iterator_ ret =* this;
+
+ base_type::m_p_tbl->inc_it_state(base_type::m_p_value, base_type::m_pos);
+
+ return (ret);
+ }
+
+protected:
+ typedef const_iterator_ base_type;
+
+protected:
+
+ /**
+ * Constructor used by the table to initiate the generalized
+ * pointer and position (e.g., this is called from within a find()
+ * of a table.
+ * */
+ inline
+ iterator_(pointer p_value, PB_DS_GEN_POS pos, PB_DS_CLASS_C_DEC* p_tbl) : const_iterator_(p_value, pos, p_tbl)
+ { }
+
+ friend class PB_DS_CLASS_C_DEC;
+};
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/unordered_iterator/point_iterator.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/unordered_iterator/point_iterator.hpp
new file mode 100644
index 0000000..37ce900
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/detail/unordered_iterator/point_iterator.hpp
@@ -0,0 +1,143 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file point_iterator.hpp
+ * Contains an iterator class returned by the tables' find and insert
+ * methods.
+ */
+
+// Find type iterator.
+class point_iterator_
+{
+
+public:
+
+ // Category.
+ typedef trivial_iterator_tag iterator_category;
+
+ // Difference type.
+ typedef trivial_iterator_difference_type difference_type;
+
+ // Iterator's value type.
+ typedef value_type_ value_type;
+
+ // Iterator's pointer type.
+ typedef pointer_ pointer;
+
+ // Iterator's const pointer type.
+ typedef const_pointer_ const_pointer;
+
+ // Iterator's reference type.
+ typedef reference_ reference;
+
+ // Iterator's const reference type.
+ typedef const_reference_ const_reference;
+
+public:
+
+ // Default constructor.
+ inline
+ point_iterator_()
+
+ : m_p_value(NULL)
+ { }
+
+ // Copy constructor.
+ inline
+ point_iterator_(const point_iterator_& other)
+
+ : m_p_value(other.m_p_value)
+ { }
+
+ // Access.
+ inline pointer
+ operator->() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_value != NULL);
+
+ return (m_p_value);
+ }
+
+ // Access.
+ inline reference
+ operator*() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_value != NULL);
+
+ return (*m_p_value);
+ }
+
+ // Compares content to a different iterator object.
+ inline bool
+ operator==(const point_iterator_& other) const
+ {
+ return (m_p_value == other.m_p_value);
+ }
+
+ // Compares content to a different iterator object.
+ inline bool
+ operator==(const const_point_iterator_& other) const
+ {
+ return (m_p_value == other.m_p_value);
+ }
+
+ // Compares content to a different iterator object.
+ inline bool
+ operator!=(const point_iterator_& other) const
+ {
+ return (m_p_value != other.m_p_value);
+ }
+
+ // Compares content (negatively) to a different iterator object.
+ inline bool
+ operator!=(const const_point_iterator_& other) const
+ {
+ return (m_p_value != other.m_p_value);
+ }
+
+ inline
+ point_iterator_(pointer p_value) : m_p_value(p_value)
+ { }
+
+protected:
+ friend class const_point_iterator_;
+
+ friend class PB_DS_CLASS_C_DEC;
+
+protected:
+ pointer m_p_value;
+};
+
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/exception.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/exception.hpp
new file mode 100644
index 0000000..4f796b1
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/exception.hpp
@@ -0,0 +1,103 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file exception.hpp
+ * Contains exception classes.
+ */
+
+#ifndef PB_DS_EXCEPTION_HPP
+#define PB_DS_EXCEPTION_HPP
+
+#include <stdexcept>
+#include <cstdlib>
+
+namespace __gnu_pbds
+{
+ // Base class for exceptions.
+ struct container_error : public std::logic_error
+ {
+ container_error()
+ : std::logic_error(__N("__gnu_pbds::container_error")) { }
+ };
+
+ // An entry cannot be inserted into a container object for logical
+ // reasons (not, e.g., if memory is unabvailable, in which case
+ // the allocator_type's exception will be thrown).
+ struct insert_error : public container_error { };
+
+ // A join cannot be performed logical reasons (i.e., the ranges of
+ // the two container objects being joined overlaps.
+ struct join_error : public container_error { };
+
+ // A container cannot be resized.
+ struct resize_error : public container_error { };
+
+#if __EXCEPTIONS
+ inline void
+ __throw_container_error(void)
+ { throw container_error(); }
+
+ inline void
+ __throw_insert_error(void)
+ { throw insert_error(); }
+
+ inline void
+ __throw_join_error(void)
+ { throw join_error(); }
+
+ inline void
+ __throw_resize_error(void)
+ { throw resize_error(); }
+#else
+ inline void
+ __throw_container_error(void)
+ { std::abort(); }
+
+ inline void
+ __throw_insert_error(void)
+ { std::abort(); }
+
+ inline void
+ __throw_join_error(void)
+ { std::abort(); }
+
+ inline void
+ __throw_resize_error(void)
+ { std::abort(); }
+#endif
+} // namespace __gnu_pbds
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/hash_policy.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/hash_policy.hpp
new file mode 100644
index 0000000..24c0c45
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/hash_policy.hpp
@@ -0,0 +1,604 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file hash_policy.hpp
+ * Contains hash-related policies.
+ */
+
+#ifndef PB_DS_HASH_POLICY_HPP
+#define PB_DS_HASH_POLICY_HPP
+
+#include <algorithm>
+#include <vector>
+#include <cmath>
+#include <ext/pb_ds/exception.hpp>
+#include <ext/pb_ds/detail/type_utils.hpp>
+#include <ext/pb_ds/detail/hash_fn/mask_based_range_hashing.hpp>
+#include <ext/pb_ds/detail/hash_fn/mod_based_range_hashing.hpp>
+#include <ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_size_base.hpp>
+
+namespace __gnu_pbds
+{
+ // A null hash function, indicating that the combining hash function
+ // is actually a ranged hash function.
+ struct null_hash_fn
+ { };
+
+ // A null probe function, indicating that the combining probe
+ // function is actually a ranged probe function.
+ struct null_probe_fn
+ { };
+
+#define PB_DS_CLASS_T_DEC template<typename Size_Type>
+#define PB_DS_CLASS_C_DEC linear_probe_fn<Size_Type>
+
+ // A probe sequence policy using fixed increments.
+ template<typename Size_Type = size_t>
+ class linear_probe_fn
+ {
+ public:
+ typedef Size_Type size_type;
+
+ void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ protected:
+ // Returns the i-th offset from the hash value.
+ inline size_type
+ operator()(size_type i) const;
+ };
+
+#include <ext/pb_ds/detail/hash_fn/linear_probe_fn_imp.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+#define PB_DS_CLASS_T_DEC template<typename Size_Type>
+#define PB_DS_CLASS_C_DEC quadratic_probe_fn<Size_Type>
+
+ // A probe sequence policy using square increments.
+ template<typename Size_Type = size_t>
+ class quadratic_probe_fn
+ {
+ public:
+ typedef Size_Type size_type;
+
+ void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ protected:
+ // Returns the i-th offset from the hash value.
+ inline size_type
+ operator()(size_type i) const;
+ };
+
+#include <ext/pb_ds/detail/hash_fn/quadratic_probe_fn_imp.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+#define PB_DS_CLASS_T_DEC template<typename Size_Type>
+#define PB_DS_CLASS_C_DEC direct_mask_range_hashing<Size_Type>
+
+ // A mask range-hashing class (uses a bit-mask).
+ template<typename Size_Type = size_t>
+ class direct_mask_range_hashing
+ : public detail::mask_based_range_hashing<Size_Type>
+ {
+ private:
+ typedef detail::mask_based_range_hashing<Size_Type> mask_based_base;
+
+ public:
+ typedef Size_Type size_type;
+
+ void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ protected:
+ void
+ notify_resized(size_type size);
+
+ // Transforms the __hash value hash into a ranged-hash value
+ // (using a bit-mask).
+ inline size_type
+ operator()(size_type hash) const;
+ };
+
+#include <ext/pb_ds/detail/hash_fn/direct_mask_range_hashing_imp.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+#define PB_DS_CLASS_T_DEC template<typename Size_Type>
+#define PB_DS_CLASS_C_DEC direct_mod_range_hashing<Size_Type>
+
+ // A mod range-hashing class (uses the modulo function).
+ template<typename Size_Type = size_t>
+ class direct_mod_range_hashing
+ : public detail::mod_based_range_hashing<Size_Type>
+ {
+ public:
+ typedef Size_Type size_type;
+
+ void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ protected:
+ void
+ notify_resized(size_type size);
+
+ // Transforms the __hash value hash into a ranged-hash value
+ // (using a modulo operation).
+ inline size_type
+ operator()(size_type hash) const;
+
+ private:
+ typedef detail::mod_based_range_hashing<size_type> mod_based_base;
+ };
+
+#include <ext/pb_ds/detail/hash_fn/direct_mod_range_hashing_imp.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+#define PB_DS_CLASS_T_DEC template<bool External_Load_Access, typename Size_Type>
+#define PB_DS_CLASS_C_DEC hash_load_check_resize_trigger<External_Load_Access, Size_Type>
+#define PB_DS_SIZE_BASE_C_DEC detail::hash_load_check_resize_trigger_size_base<Size_Type, External_Load_Access>
+
+ // A resize trigger policy based on a load check. It keeps the
+ // load factor between some load factors load_min and load_max.
+ template<bool External_Load_Access = false, typename Size_Type = size_t>
+ class hash_load_check_resize_trigger : private PB_DS_SIZE_BASE_C_DEC
+ {
+ public:
+ typedef Size_Type size_type;
+
+ enum
+ {
+ external_load_access = External_Load_Access
+ };
+
+ // Default constructor, or constructor taking load_min and
+ // load_max load factors between which this policy will keep the
+ // actual load.
+ hash_load_check_resize_trigger(float load_min = 0.125,
+ float load_max = 0.5);
+
+ void
+ swap(hash_load_check_resize_trigger& other);
+
+ virtual
+ ~hash_load_check_resize_trigger();
+
+ // Returns a pair of the minimal and maximal loads, respectively.
+ inline std::pair<float, float>
+ get_loads() const;
+
+ // Sets the loads through a pair of the minimal and maximal
+ // loads, respectively.
+ void
+ set_loads(std::pair<float, float> load_pair);
+
+ protected:
+ inline void
+ notify_insert_search_start();
+
+ inline void
+ notify_insert_search_collision();
+
+ inline void
+ notify_insert_search_end();
+
+ inline void
+ notify_find_search_start();
+
+ inline void
+ notify_find_search_collision();
+
+ inline void
+ notify_find_search_end();
+
+ inline void
+ notify_erase_search_start();
+
+ inline void
+ notify_erase_search_collision();
+
+ inline void
+ notify_erase_search_end();
+
+ // Notifies an element was inserted. The total number of entries
+ // in the table is num_entries.
+ inline void
+ notify_inserted(size_type num_entries);
+
+ inline void
+ notify_erased(size_type num_entries);
+
+ // Notifies the table was cleared.
+ void
+ notify_cleared();
+
+ // Notifies the table was resized as a result of this object's
+ // signifying that a resize is needed.
+ void
+ notify_resized(size_type new_size);
+
+ void
+ notify_externally_resized(size_type new_size);
+
+ inline bool
+ is_resize_needed() const;
+
+ inline bool
+ is_grow_needed(size_type size, size_type num_entries) const;
+
+ private:
+ virtual void
+ do_resize(size_type new_size);
+
+ typedef PB_DS_SIZE_BASE_C_DEC size_base;
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid() const;
+#endif
+
+ float m_load_min;
+ float m_load_max;
+ size_type m_next_shrink_size;
+ size_type m_next_grow_size;
+ bool m_resize_needed;
+ };
+
+#include <ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_imp.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_SIZE_BASE_C_DEC
+
+#define PB_DS_CLASS_T_DEC template<bool External_Load_Access, typename Size_Type>
+#define PB_DS_CLASS_C_DEC cc_hash_max_collision_check_resize_trigger<External_Load_Access, Size_Type>
+
+ // A resize trigger policy based on collision checks. It keeps the
+ // simulated load factor lower than some given load factor.
+ template<bool External_Load_Access = false, typename Size_Type = size_t>
+ class cc_hash_max_collision_check_resize_trigger
+ {
+ public:
+ typedef Size_Type size_type;
+
+ enum
+ {
+ external_load_access = External_Load_Access
+ };
+
+ // Default constructor, or constructor taking load, a __load
+ // factor which it will attempt to maintain.
+ cc_hash_max_collision_check_resize_trigger(float load = 0.5);
+
+ void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ // Returns the current load.
+ inline float
+ get_load() const;
+
+ // Sets the load; does not resize the container.
+ void
+ set_load(float load);
+
+ protected:
+ inline void
+ notify_insert_search_start();
+
+ inline void
+ notify_insert_search_collision();
+
+ inline void
+ notify_insert_search_end();
+
+ inline void
+ notify_find_search_start();
+
+ inline void
+ notify_find_search_collision();
+
+ inline void
+ notify_find_search_end();
+
+ inline void
+ notify_erase_search_start();
+
+ inline void
+ notify_erase_search_collision();
+
+ inline void
+ notify_erase_search_end();
+
+ inline void
+ notify_inserted(size_type num_entries);
+
+ inline void
+ notify_erased(size_type num_entries);
+
+ void
+ notify_cleared();
+
+ // Notifies the table was resized as a result of this object's
+ // signifying that a resize is needed.
+ void
+ notify_resized(size_type new_size);
+
+ void
+ notify_externally_resized(size_type new_size);
+
+ inline bool
+ is_resize_needed() const;
+
+ inline bool
+ is_grow_needed(size_type size, size_type num_entries) const;
+
+ private:
+ void
+ calc_max_num_coll();
+
+ inline void
+ calc_resize_needed();
+
+ float m_load;
+ size_type m_size;
+ size_type m_num_col;
+ size_type m_max_col;
+ bool m_resize_needed;
+ };
+
+#include <ext/pb_ds/detail/resize_policy/cc_hash_max_collision_check_resize_trigger_imp.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+#define PB_DS_CLASS_T_DEC template<typename Size_Type>
+#define PB_DS_CLASS_C_DEC hash_exponential_size_policy<Size_Type>
+
+ // A size policy whose sequence of sizes form an exponential
+ // sequence (typically powers of 2.
+ template<typename Size_Type = size_t>
+ class hash_exponential_size_policy
+ {
+ public:
+ typedef Size_Type size_type;
+
+ // Default constructor, or onstructor taking a start_size, or
+ // constructor taking a start size and grow_factor. The policy
+ // will use the sequence of sizes start_size, start_size*
+ // grow_factor, start_size* grow_factor^2, ...
+ hash_exponential_size_policy(size_type start_size = 8,
+ size_type grow_factor = 2);
+
+ void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ protected:
+ size_type
+ get_nearest_larger_size(size_type size) const;
+
+ size_type
+ get_nearest_smaller_size(size_type size) const;
+
+ private:
+ size_type m_start_size;
+ size_type m_grow_factor;
+ };
+
+#include <ext/pb_ds/detail/resize_policy/hash_exponential_size_policy_imp.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+#define PB_DS_CLASS_T_DEC
+#define PB_DS_CLASS_C_DEC hash_prime_size_policy
+
+ // A size policy whose sequence of sizes form a nearly-exponential
+ // sequence of primes.
+ class hash_prime_size_policy
+ {
+ public:
+ // Size type.
+ typedef size_t size_type;
+
+ // Default constructor, or onstructor taking a start_size The
+ // policy will use the sequence of sizes approximately
+ // start_size, start_size* 2, start_size* 2^2, ...
+ hash_prime_size_policy(size_type start_size = 8);
+
+ inline void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ protected:
+ size_type
+ get_nearest_larger_size(size_type size) const;
+
+ size_type
+ get_nearest_smaller_size(size_type size) const;
+
+ private:
+ size_type m_start_size;
+ };
+
+#include <ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+#define PB_DS_CLASS_T_DEC template<typename Size_Policy, typename Trigger_Policy, bool External_Size_Access, typename Size_Type>
+
+#define PB_DS_CLASS_C_DEC hash_standard_resize_policy<Size_Policy, Trigger_Policy, External_Size_Access, Size_Type>
+
+ // A resize policy which delegates operations to size and trigger policies.
+ template<typename Size_Policy = hash_exponential_size_policy<>,
+ typename Trigger_Policy = hash_load_check_resize_trigger<>,
+ bool External_Size_Access = false,
+ typename Size_Type = size_t>
+ class hash_standard_resize_policy
+ : public Size_Policy, public Trigger_Policy
+ {
+ public:
+ typedef Size_Type size_type;
+ typedef Trigger_Policy trigger_policy;
+ typedef Size_Policy size_policy;
+
+ enum
+ {
+ external_size_access = External_Size_Access
+ };
+
+ // Default constructor.
+ hash_standard_resize_policy();
+
+ // constructor taking some policies r_size_policy will be copied
+ // by the Size_Policy object of this object.
+ hash_standard_resize_policy(const Size_Policy& r_size_policy);
+
+ // constructor taking some policies. r_size_policy will be
+ // copied by the Size_Policy object of this
+ // object. r_trigger_policy will be copied by the Trigger_Policy
+ // object of this object.
+ hash_standard_resize_policy(const Size_Policy& r_size_policy,
+ const Trigger_Policy& r_trigger_policy);
+
+ virtual
+ ~hash_standard_resize_policy();
+
+ inline void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ // Access to the Size_Policy object used.
+ Size_Policy&
+ get_size_policy();
+
+ // Const access to the Size_Policy object used.
+ const Size_Policy&
+ get_size_policy() const;
+
+ // Access to the Trigger_Policy object used.
+ Trigger_Policy&
+ get_trigger_policy();
+
+ // Access to the Trigger_Policy object used.
+ const Trigger_Policy&
+ get_trigger_policy() const;
+
+ // Returns the actual size of the container.
+ inline size_type
+ get_actual_size() const;
+
+ // Resizes the container to suggested_new_size, a suggested size
+ // (the actual size will be determined by the Size_Policy
+ // object).
+ void
+ resize(size_type suggested_new_size);
+
+ protected:
+ inline void
+ notify_insert_search_start();
+
+ inline void
+ notify_insert_search_collision();
+
+ inline void
+ notify_insert_search_end();
+
+ inline void
+ notify_find_search_start();
+
+ inline void
+ notify_find_search_collision();
+
+ inline void
+ notify_find_search_end();
+
+ inline void
+ notify_erase_search_start();
+
+ inline void
+ notify_erase_search_collision();
+
+ inline void
+ notify_erase_search_end();
+
+ inline void
+ notify_inserted(size_type num_e);
+
+ inline void
+ notify_erased(size_type num_e);
+
+ void
+ notify_cleared();
+
+ void
+ notify_resized(size_type new_size);
+
+ inline bool
+ is_resize_needed() const;
+
+ // Queries what the new size should be, when the container is
+ // resized naturally. The current __size of the container is
+ // size, and the number of used entries within the container is
+ // num_used_e.
+ size_type
+ get_new_size(size_type size, size_type num_used_e) const;
+
+ private:
+ // Resizes to new_size.
+ virtual void
+ do_resize(size_type new_size);
+
+ typedef Trigger_Policy trigger_policy_base;
+
+ typedef Size_Policy size_policy_base;
+
+ size_type m_size;
+ };
+
+#include <ext/pb_ds/detail/resize_policy/hash_standard_resize_policy_imp.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+} // namespace __gnu_pbds
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/list_update_policy.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/list_update_policy.hpp
new file mode 100644
index 0000000..ec05b69
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/list_update_policy.hpp
@@ -0,0 +1,136 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file list_update_policy.hpp
+ * Contains policies for list update containers.
+ */
+
+#ifndef PB_DS_LU_POLICY_HPP
+#define PB_DS_LU_POLICY_HPP
+
+#include <cstdlib>
+#include <ext/pb_ds/detail/list_update_policy/counter_lu_metadata.hpp>
+
+namespace __gnu_pbds
+{
+ // A null type that means that each link in a list-based container
+ // does not actually need metadata.
+ struct null_lu_metadata
+ { };
+
+#define PB_DS_CLASS_T_DEC template<typename Allocator>
+#define PB_DS_CLASS_C_DEC move_to_front_lu_policy<Allocator>
+
+ // A list-update policy that unconditionally moves elements to the
+ // front of the list.
+ template<typename Allocator = std::allocator<char> >
+ class move_to_front_lu_policy
+ {
+ public:
+ typedef Allocator allocator_type;
+
+ // Metadata on which this functor operates.
+ typedef null_lu_metadata metadata_type;
+
+ // Reference to metadata on which this functor operates.
+ typedef typename allocator_type::template rebind<metadata_type>::other metadata_rebind;
+ typedef typename metadata_rebind::reference metadata_reference;
+
+ // Creates a metadata object.
+ metadata_type
+ operator()() const;
+
+ // Decides whether a metadata object should be moved to the front
+ // of the list.
+ inline bool
+ operator()(metadata_reference r_metadata) const;
+
+ private:
+ static null_lu_metadata s_metadata;
+ };
+
+#include <ext/pb_ds/detail/list_update_policy/mtf_lu_policy_imp.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+#define PB_DS_CLASS_T_DEC template<size_t Max_Count, class Allocator>
+#define PB_DS_CLASS_C_DEC counter_lu_policy<Max_Count, Allocator>
+
+ // A list-update policy that moves elements to the front of the list
+ // based on the counter algorithm.
+ template<size_t Max_Count = 5, typename Allocator = std::allocator<char> >
+ class counter_lu_policy
+ : private detail::counter_lu_policy_base<typename Allocator::size_type>
+ {
+ public:
+ typedef Allocator allocator_type;
+
+ enum
+ {
+ max_count = Max_Count
+ };
+
+ typedef typename allocator_type::size_type size_type;
+
+ // Metadata on which this functor operates.
+ typedef detail::counter_lu_metadata<size_type> metadata_type;
+
+ // Reference to metadata on which this functor operates.
+ typedef typename Allocator::template rebind<metadata_type>::other metadata_rebind;
+ typedef typename metadata_rebind::reference metadata_reference;
+
+ // Creates a metadata object.
+ metadata_type
+ operator()() const;
+
+ // Decides whether a metadata object should be moved to the front
+ // of the list.
+ bool
+ operator()(metadata_reference r_metadata) const;
+
+ private:
+ typedef detail::counter_lu_policy_base<typename Allocator::size_type> base_type;
+ };
+
+#include <ext/pb_ds/detail/list_update_policy/counter_lu_policy_imp.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+} // namespace __gnu_pbds
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/priority_queue.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/priority_queue.hpp
new file mode 100644
index 0000000..531f70c
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/priority_queue.hpp
@@ -0,0 +1,125 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file priority_queue.hpp
+ * Contains priority_queues.
+ */
+
+#ifndef PB_DS_PRIORITY_QUEUE_HPP
+#define PB_DS_PRIORITY_QUEUE_HPP
+
+#include <ext/pb_ds/tag_and_trait.hpp>
+#include <ext/pb_ds/detail/priority_queue_base_dispatch.hpp>
+#include <ext/pb_ds/detail/standard_policies.hpp>
+
+namespace __gnu_pbds
+{
+ // A priority queue.
+ template<typename Value_Type,
+ typename Cmp_Fn = std::less<Value_Type>,
+ typename Tag = pairing_heap_tag,
+ typename Allocator = std::allocator<char> >
+ class priority_queue
+ : public detail::priority_queue_base_dispatch<Value_Type,Cmp_Fn,Tag,Allocator>::type
+ {
+ private:
+ typedef typename detail::priority_queue_base_dispatch<Value_Type,Cmp_Fn,Tag,Allocator>::type base_type;
+
+ public:
+ typedef Value_Type value_type;
+ typedef Cmp_Fn cmp_fn;
+ typedef Tag container_category;
+ typedef Allocator allocator_type;
+ typedef typename allocator_type::size_type size_type;
+ typedef typename allocator_type::difference_type difference_type;
+
+ typedef typename allocator_type::template rebind<value_type>::other value_rebind;
+ typedef typename value_rebind::reference reference;
+ typedef typename value_rebind::const_reference const_reference;
+ typedef typename value_rebind::pointer pointer;
+ typedef typename value_rebind::const_pointer const_pointer;
+
+ typedef typename base_type::const_point_iterator const_point_iterator;
+ typedef typename base_type::point_iterator point_iterator;
+ typedef typename base_type::const_iterator const_iterator;
+ typedef typename base_type::iterator iterator;
+
+ priority_queue() { }
+
+ // Constructor taking some policy objects. r_cmp_fn will be copied
+ // by the Cmp_Fn object of the container object.
+ priority_queue(const cmp_fn& r_cmp_fn) : base_type(r_cmp_fn) { }
+
+ // Constructor taking __iterators to a range of value_types. The
+ // value_types between first_it and last_it will be inserted into
+ // the container object.
+ template<typename It>
+ priority_queue(It first_it, It last_it)
+ { base_type::copy_from_range(first_it, last_it); }
+
+ // Constructor taking __iterators to a range of value_types and
+ // some policy objects The value_types between first_it and
+ // last_it will be inserted into the container object. r_cmp_fn
+ // will be copied by the cmp_fn object of the container object.
+ template<typename It>
+ priority_queue(It first_it, It last_it, const cmp_fn& r_cmp_fn)
+ : base_type(r_cmp_fn)
+ { base_type::copy_from_range(first_it, last_it); }
+
+ priority_queue(const priority_queue& other)
+ : base_type((const base_type& )other) { }
+
+ virtual
+ ~priority_queue() { }
+
+ priority_queue&
+ operator=(const priority_queue& other)
+ {
+ if (this != &other)
+ {
+ priority_queue tmp(other);
+ swap(tmp);
+ }
+ return *this;
+ }
+
+ void
+ swap(priority_queue& other)
+ { base_type::swap(other); }
+ };
+} // namespace __gnu_pbds
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/tag_and_trait.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/tag_and_trait.hpp
new file mode 100644
index 0000000..ccd2533
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/tag_and_trait.hpp
@@ -0,0 +1,363 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file tag_and_trait.hpp
+ * Contains tags and traits, e.g., ones describing underlying
+ * data structures.
+ */
+
+#ifndef PB_DS_TAG_AND_TRAIT_HPP
+#define PB_DS_TAG_AND_TRAIT_HPP
+
+#include <ext/pb_ds/detail/type_utils.hpp>
+
+/**
+ * @namespace __gnu_pbds
+ * @brief GNU extensions for policy-based data structures for public use.
+ */
+namespace __gnu_pbds
+{
+ // A trivial iterator tag. Signifies that the iterators has none of
+ // the STL's movement abilities.
+ struct trivial_iterator_tag
+ { };
+
+ // Prohibit moving trivial iterators.
+ typedef void trivial_iterator_difference_type;
+
+
+ // Signifies a basic invalidation guarantee that any iterator,
+ // pointer, or reference to a container object's mapped value type
+ // is valid as long as the container is not modified.
+ struct basic_invalidation_guarantee
+ { };
+
+ // Signifies an invalidation guarantee that includes all those of
+ // its base, and additionally, that any point-type iterator,
+ // pointer, or reference to a container object's mapped value type
+ // is valid as long as its corresponding entry has not be erased,
+ // regardless of modifications to the container object.
+ struct point_invalidation_guarantee : public basic_invalidation_guarantee
+ { };
+
+ // Signifies an invalidation guarantee that includes all those of
+ // its base, and additionally, that any range-type iterator
+ // (including the returns of begin() and end()) is in the correct
+ // relative positions to other range-type iterators as long as its
+ // corresponding entry has not be erased, regardless of
+ // modifications to the container object.
+ struct range_invalidation_guarantee : public point_invalidation_guarantee
+ { };
+
+
+ /// A mapped-policy indicating that an associative container is a set.
+ // XXX should this be a trait of the form is_set<T> ??
+ struct null_mapped_type { };
+
+
+ /// Base data structure tag.
+ struct container_tag
+ { };
+
+ /// Basic string container, inclusive of strings, ropes, etc.
+ struct string_tag : public container_tag { };
+
+ /// Basic sequence.
+ struct sequence_tag : public container_tag { };
+
+ /// Basic associative-container.
+ struct associative_container_tag : public container_tag { };
+
+ /// Basic hash.
+ struct basic_hash_tag : public associative_container_tag { };
+
+ /// Collision-chaining hash.
+ struct cc_hash_tag : public basic_hash_tag { };
+
+ /// General-probing hash.
+ struct gp_hash_tag : public basic_hash_tag { };
+
+ /// Basic tree.
+ struct basic_tree_tag : public associative_container_tag { };
+
+ /// tree.
+ struct tree_tag : public basic_tree_tag { };
+
+ /// Red-black tree.
+ struct rb_tree_tag : public tree_tag { };
+
+ /// Splay tree.
+ struct splay_tree_tag : public tree_tag { };
+
+ /// Ordered-vector tree.
+ struct ov_tree_tag : public tree_tag { };
+
+ /// trie.
+ struct trie_tag : public basic_tree_tag { };
+
+ /// PATRICIA trie.
+ struct pat_trie_tag : public trie_tag { };
+
+ /// List-update.
+ struct list_update_tag : public associative_container_tag { };
+
+ /// Basic priority-queue.
+ struct priority_queue_tag : public container_tag { };
+
+ /// Pairing-heap.
+ struct pairing_heap_tag : public priority_queue_tag { };
+
+ /// Binomial-heap.
+ struct binomial_heap_tag : public priority_queue_tag { };
+
+ /// Redundant-counter binomial-heap.
+ struct rc_binomial_heap_tag : public priority_queue_tag { };
+
+ /// Binary-heap (array-based).
+ struct binary_heap_tag : public priority_queue_tag { };
+
+ /// Thin heap.
+ struct thin_heap_tag : public priority_queue_tag { };
+
+
+ /// Base traits type for containers.
+ template<typename Tag>
+ struct container_traits_base;
+
+ template<>
+ struct container_traits_base<cc_hash_tag>
+ {
+ typedef cc_hash_tag container_category;
+ typedef point_invalidation_guarantee invalidation_guarantee;
+
+ enum
+ {
+ order_preserving = false,
+ erase_can_throw = false,
+ split_join_can_throw = false,
+ reverse_iteration = false
+ };
+ };
+
+ template<>
+ struct container_traits_base<gp_hash_tag>
+ {
+ typedef gp_hash_tag container_category;
+ typedef basic_invalidation_guarantee invalidation_guarantee;
+
+ enum
+ {
+ order_preserving = false,
+ erase_can_throw = false,
+ split_join_can_throw = false,
+ reverse_iteration = false
+ };
+ };
+
+ template<>
+ struct container_traits_base<rb_tree_tag>
+ {
+ typedef rb_tree_tag container_category;
+ typedef range_invalidation_guarantee invalidation_guarantee;
+
+ enum
+ {
+ order_preserving = true,
+ erase_can_throw = false,
+ split_join_can_throw = false,
+ reverse_iteration = true
+ };
+ };
+
+ template<>
+ struct container_traits_base<splay_tree_tag>
+ {
+ typedef splay_tree_tag container_category;
+ typedef range_invalidation_guarantee invalidation_guarantee;
+
+ enum
+ {
+ order_preserving = true,
+ erase_can_throw = false,
+ split_join_can_throw = false,
+ reverse_iteration = true
+ };
+ };
+
+ template<>
+ struct container_traits_base<ov_tree_tag>
+ {
+ typedef ov_tree_tag container_category;
+ typedef basic_invalidation_guarantee invalidation_guarantee;
+
+ enum
+ {
+ order_preserving = true,
+ erase_can_throw = true,
+ split_join_can_throw = true,
+ reverse_iteration = false
+ };
+ };
+
+ template<>
+ struct container_traits_base<pat_trie_tag>
+ {
+ typedef pat_trie_tag container_category;
+ typedef range_invalidation_guarantee invalidation_guarantee;
+
+ enum
+ {
+ order_preserving = true,
+ erase_can_throw = false,
+ split_join_can_throw = true,
+ reverse_iteration = true
+ };
+ };
+
+ template<>
+ struct container_traits_base<list_update_tag>
+ {
+ typedef list_update_tag container_category;
+ typedef point_invalidation_guarantee invalidation_guarantee;
+
+ enum
+ {
+ order_preserving = false,
+ erase_can_throw = false,
+ split_join_can_throw = false,
+ reverse_iteration = false
+ };
+ };
+
+
+ template<>
+ struct container_traits_base<pairing_heap_tag>
+ {
+ typedef pairing_heap_tag container_category;
+ typedef point_invalidation_guarantee invalidation_guarantee;
+
+ enum
+ {
+ order_preserving = false,
+ erase_can_throw = false,
+ split_join_can_throw = false,
+ reverse_iteration = false
+ };
+ };
+
+ template<>
+ struct container_traits_base<thin_heap_tag>
+ {
+ typedef thin_heap_tag container_category;
+ typedef point_invalidation_guarantee invalidation_guarantee;
+
+ enum
+ {
+ order_preserving = false,
+ erase_can_throw = false,
+ split_join_can_throw = false,
+ reverse_iteration = false
+ };
+ };
+
+ template<>
+ struct container_traits_base<binomial_heap_tag>
+ {
+ typedef binomial_heap_tag container_category;
+ typedef point_invalidation_guarantee invalidation_guarantee;
+
+ enum
+ {
+ order_preserving = false,
+ erase_can_throw = false,
+ split_join_can_throw = false,
+ reverse_iteration = false
+ };
+ };
+
+ template<>
+ struct container_traits_base<rc_binomial_heap_tag>
+ {
+ typedef rc_binomial_heap_tag container_category;
+ typedef point_invalidation_guarantee invalidation_guarantee;
+
+ enum
+ {
+ order_preserving = false,
+ erase_can_throw = false,
+ split_join_can_throw = false,
+ reverse_iteration = false
+ };
+ };
+
+ template<>
+ struct container_traits_base<binary_heap_tag>
+ {
+ typedef binary_heap_tag container_category;
+ typedef basic_invalidation_guarantee invalidation_guarantee;
+
+ enum
+ {
+ order_preserving = false,
+ erase_can_throw = false,
+ split_join_can_throw = true,
+ reverse_iteration = false
+ };
+ };
+
+
+ /// container_traits
+ // See Matt Austern for the name, S. Meyers MEFC++ #2, others.
+ template<typename Cntnr>
+ struct container_traits
+ : public container_traits_base<typename Cntnr::container_category>
+ {
+ typedef Cntnr container_type;
+ typedef typename Cntnr::container_category container_category;
+ typedef container_traits_base<container_category> base_type;
+ typedef typename base_type::invalidation_guarantee invalidation_guarantee;
+
+ enum
+ {
+ order_preserving = base_type::order_preserving,
+ erase_can_throw = base_type::erase_can_throw,
+ split_join_can_throw = base_type::split_join_can_throw,
+ reverse_iteration = base_type::reverse_iteration
+ };
+ };
+} // namespace __gnu_pbds
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/tree_policy.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/tree_policy.hpp
new file mode 100644
index 0000000..990860e
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/tree_policy.hpp
@@ -0,0 +1,162 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file tree_policy.hpp
+ * Contains tree-related policies.
+ */
+
+#ifndef PB_DS_TREE_POLICY_HPP
+#define PB_DS_TREE_POLICY_HPP
+
+#include <iterator>
+#include <ext/pb_ds/detail/type_utils.hpp>
+#include <ext/pb_ds/detail/basic_tree_policy/basic_tree_policy_base.hpp>
+
+namespace __gnu_pbds
+{
+ // A null node updator, indicating that no node updates are required.
+ template<typename Const_Node_Iterator,
+ typename Node_Iterator,
+ typename Cmp_Fn,
+ typename Allocator>
+ struct null_tree_node_update
+ { };
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Const_Node_Iterator, class Node_Iterator, class Cmp_Fn, class Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ tree_order_statistics_node_update<Const_Node_Iterator, Node_Iterator, Cmp_Fn, Allocator>
+
+#define PB_DS_BASE_C_DEC \
+ detail::basic_tree_policy_base<Const_Node_Iterator, Node_Iterator, Allocator>
+
+ // Functor updating ranks of entrees.
+ template<typename Const_Node_Iterator, typename Node_Iterator,
+ typename Cmp_Fn, typename Allocator>
+ class tree_order_statistics_node_update : private PB_DS_BASE_C_DEC
+ {
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ public:
+ typedef Cmp_Fn cmp_fn;
+ typedef Allocator allocator_type;
+ typedef typename allocator_type::size_type size_type;
+ typedef typename base_type::key_type key_type;
+ typedef typename base_type::const_key_reference const_key_reference;
+
+ typedef size_type metadata_type;
+ typedef Const_Node_Iterator const_node_iterator;
+ typedef Node_Iterator node_iterator;
+ typedef typename const_node_iterator::value_type const_iterator;
+ typedef typename node_iterator::value_type iterator;
+
+ // Finds an entry by __order. Returns a const_iterator to the
+ // entry with the __order order, or a const_iterator to the
+ // container object's end if order is at least the size of the
+ // container object.
+ inline const_iterator
+ find_by_order(size_type order) const;
+
+ // Finds an entry by __order. Returns an iterator to the entry
+ // with the __order order, or an iterator to the container
+ // object's end if order is at least the size of the container
+ // object.
+ inline iterator
+ find_by_order(size_type order);
+
+ // Returns the order of a key within a sequence. For exapmle, if
+ // r_key is the smallest key, this method will return 0; if r_key
+ // is a key between the smallest and next key, this method will
+ // return 1; if r_key is a key larger than the largest key, this
+ // method will return the size of r_c.
+ inline size_type
+ order_of_key(const_key_reference r_key) const;
+
+ private:
+ // Const reference to the container's value-type.
+ typedef typename base_type::const_reference const_reference;
+
+ // Const pointer to the container's value-type.
+ typedef typename base_type::const_pointer const_pointer;
+
+ typedef typename allocator_type::template rebind<metadata_type>::other metadata_rebind;
+ // Const metadata reference.
+ typedef typename metadata_rebind::const_reference const_metadata_reference;
+
+ // Metadata reference.
+ typedef typename metadata_rebind::reference metadata_reference;
+
+ // Returns the const_node_iterator associated with the tree's root node.
+ virtual const_node_iterator
+ node_begin() const = 0;
+
+ // Returns the node_iterator associated with the tree's root node.
+ virtual node_iterator
+ node_begin() = 0;
+
+ // Returns the const_node_iterator associated with a just-after leaf node.
+ virtual const_node_iterator
+ node_end() const = 0;
+
+ // Returns the node_iterator associated with a just-after leaf node.
+ virtual node_iterator
+ node_end() = 0;
+
+ // Access to the cmp_fn object.
+ virtual cmp_fn&
+ get_cmp_fn() = 0;
+
+ protected:
+ // Updates the rank of a node through a node_iterator node_it;
+ // end_nd_it is the end node iterator.
+ inline void
+ operator()(node_iterator node_it, const_node_iterator end_nd_it) const;
+
+ virtual
+ ~tree_order_statistics_node_update();
+ };
+
+#include <ext/pb_ds/detail/tree_policy/order_statistics_imp.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_BASE_C_DEC
+
+} // namespace __gnu_pbds
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pb_ds/trie_policy.hpp b/i686-linux/include/c++/4.4.3/ext/pb_ds/trie_policy.hpp
new file mode 100644
index 0000000..c10591b
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pb_ds/trie_policy.hpp
@@ -0,0 +1,355 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file trie_policy.hpp
+ * Contains trie-related policies.
+ */
+
+#ifndef PB_DS_TRIE_POLICY_HPP
+#define PB_DS_TRIE_POLICY_HPP
+
+#include <string>
+#include <ext/pb_ds/detail/type_utils.hpp>
+#include <ext/pb_ds/detail/trie_policy/trie_policy_base.hpp>
+
+namespace __gnu_pbds
+{
+ // A null node updator, indicating that no node updates are required.
+ template<typename Const_Node_Iterator,
+ typename Node_Iterator,
+ typename E_Access_Traits,
+ typename Allocator>
+ struct null_trie_node_update
+ { };
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename String, typename String::value_type Min_E_Val, typename String::value_type Max_E_Val, bool Reverse, typename Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ string_trie_e_access_traits<String, Min_E_Val,Max_E_Val,Reverse,Allocator>
+
+ // Element access traits for string types.
+ template<typename String = std::string,
+ typename String::value_type Min_E_Val = detail::__numeric_traits<typename String::value_type>::__min,
+ typename String::value_type Max_E_Val = detail::__numeric_traits<typename String::value_type>::__max,
+ bool Reverse = false,
+ typename Allocator = std::allocator<char> >
+ struct string_trie_e_access_traits
+ {
+ public:
+ typedef typename Allocator::size_type size_type;
+ typedef String key_type;
+ typedef typename Allocator::template rebind<key_type>::other key_rebind;
+ typedef typename key_rebind::const_reference const_key_reference;
+
+ enum
+ {
+ reverse = Reverse
+ };
+
+ // Element const iterator type.
+ typedef typename detail::__conditional_type<Reverse, typename String::const_reverse_iterator, typename String::const_iterator>::__type const_iterator;
+
+ // Element type.
+ typedef typename std::iterator_traits<const_iterator>::value_type e_type;
+
+ enum
+ {
+ min_e_val = Min_E_Val,
+ max_e_val = Max_E_Val,
+ max_size = max_e_val - min_e_val + 1
+ };
+ PB_DS_STATIC_ASSERT(min_max_size, max_size >= 2);
+
+ // Returns a const_iterator to the first element of
+ // const_key_reference agumnet.
+ inline static const_iterator
+ begin(const_key_reference);
+
+ // Returns a const_iterator to the after-last element of
+ // const_key_reference argument.
+ inline static const_iterator
+ end(const_key_reference);
+
+ // Maps an element to a position.
+ inline static size_type
+ e_pos(e_type e);
+
+ private:
+
+ inline static const_iterator
+ begin_imp(const_key_reference, detail::false_type);
+
+ inline static const_iterator
+ begin_imp(const_key_reference, detail::true_type);
+
+ inline static const_iterator
+ end_imp(const_key_reference, detail::false_type);
+
+ inline static const_iterator
+ end_imp(const_key_reference, detail::true_type);
+
+ static detail::integral_constant<int, Reverse> s_rev_ind;
+ };
+
+#include <ext/pb_ds/detail/trie_policy/string_trie_e_access_traits_imp.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Const_Node_Iterator,typename Node_Iterator,class E_Access_Traits, typename Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ trie_prefix_search_node_update<Const_Node_Iterator, Node_Iterator, E_Access_Traits,Allocator>
+
+#define PB_DS_BASE_C_DEC \
+ detail::trie_policy_base<Const_Node_Iterator,Node_Iterator,E_Access_Traits, Allocator>
+
+ // A node updator that allows tries to be searched for the range of
+ // values that match a certain prefix.
+ template<typename Const_Node_Iterator,
+ typename Node_Iterator,
+ typename E_Access_Traits,
+ typename Allocator>
+ class trie_prefix_search_node_update : private PB_DS_BASE_C_DEC
+ {
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ public:
+ typedef typename base_type::key_type key_type;
+ typedef typename base_type::const_key_reference const_key_reference;
+
+ // Element access traits.
+ typedef E_Access_Traits e_access_traits;
+
+ // Const element iterator.
+ typedef typename e_access_traits::const_iterator const_e_iterator;
+
+ // Allocator type.
+ typedef Allocator allocator_type;
+
+ // Size type.
+ typedef typename allocator_type::size_type size_type;
+ typedef detail::null_node_metadata metadata_type;
+ typedef Const_Node_Iterator const_node_iterator;
+ typedef Node_Iterator node_iterator;
+ typedef typename const_node_iterator::value_type const_iterator;
+ typedef typename node_iterator::value_type iterator;
+
+ // Finds the const iterator range corresponding to all values
+ // whose prefixes match r_key.
+ std::pair<const_iterator, const_iterator>
+ prefix_range(const_key_reference) const;
+
+ // Finds the iterator range corresponding to all values whose
+ // prefixes match r_key.
+ std::pair<iterator, iterator>
+ prefix_range(const_key_reference);
+
+ // Finds the const iterator range corresponding to all values
+ // whose prefixes match [b, e).
+ std::pair<const_iterator, const_iterator>
+ prefix_range(const_e_iterator, const_e_iterator) const;
+
+ // Finds the iterator range corresponding to all values whose
+ // prefixes match [b, e).
+ std::pair<iterator, iterator>
+ prefix_range(const_e_iterator, const_e_iterator);
+
+ protected:
+ // Called to update a node's metadata.
+ inline void
+ operator()(node_iterator node_it, const_node_iterator end_nd_it) const;
+
+ private:
+ // Returns the const iterator associated with the just-after last element.
+ virtual const_iterator
+ end() const = 0;
+
+ // Returns the iterator associated with the just-after last element.
+ virtual iterator
+ end() = 0;
+
+ // Returns the const_node_iterator associated with the trie's root node.
+ virtual const_node_iterator
+ node_begin() const = 0;
+
+ // Returns the node_iterator associated with the trie's root node.
+ virtual node_iterator
+ node_begin() = 0;
+
+ // Returns the const_node_iterator associated with a just-after leaf node.
+ virtual const_node_iterator
+ node_end() const = 0;
+
+ // Returns the node_iterator associated with a just-after leaf node.
+ virtual node_iterator
+ node_end() = 0;
+
+ // Access to the cmp_fn object.
+ virtual const e_access_traits&
+ get_e_access_traits() const = 0;
+
+ node_iterator
+ next_child(node_iterator, const_e_iterator, const_e_iterator,
+ node_iterator, const e_access_traits&);
+ };
+
+#include <ext/pb_ds/detail/trie_policy/prefix_search_node_update_imp.hpp>
+
+#undef PB_DS_CLASS_C_DEC
+
+#define PB_DS_CLASS_C_DEC \
+ trie_order_statistics_node_update<Const_Node_Iterator, Node_Iterator,E_Access_Traits, Allocator>
+
+ // Functor updating ranks of entrees.
+ template<typename Const_Node_Iterator,
+ typename Node_Iterator,
+ typename E_Access_Traits,
+ typename Allocator>
+ class trie_order_statistics_node_update : private PB_DS_BASE_C_DEC
+ {
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ public:
+ typedef E_Access_Traits e_access_traits;
+ typedef typename e_access_traits::const_iterator const_e_iterator;
+ typedef Allocator allocator_type;
+ typedef typename allocator_type::size_type size_type;
+ typedef typename base_type::key_type key_type;
+ typedef typename base_type::const_key_reference const_key_reference;
+
+ typedef size_type metadata_type;
+ typedef Const_Node_Iterator const_node_iterator;
+ typedef Node_Iterator node_iterator;
+ typedef typename const_node_iterator::value_type const_iterator;
+ typedef typename node_iterator::value_type iterator;
+
+ // Finds an entry by __order. Returns a const_iterator to the
+ // entry with the __order order, or a const_iterator to the
+ // container object's end if order is at least the size of the
+ // container object.
+ inline const_iterator
+ find_by_order(size_type) const;
+
+ // Finds an entry by __order. Returns an iterator to the entry
+ // with the __order order, or an iterator to the container
+ // object's end if order is at least the size of the container
+ // object.
+ inline iterator
+ find_by_order(size_type);
+
+ // Returns the order of a key within a sequence. For exapmle, if
+ // r_key is the smallest key, this method will return 0; if r_key
+ // is a key between the smallest and next key, this method will
+ // return 1; if r_key is a key larger than the largest key, this
+ // method will return the size of r_c.
+ inline size_type
+ order_of_key(const_key_reference) const;
+
+ // Returns the order of a prefix within a sequence. For exapmle,
+ // if [b, e] is the smallest prefix, this method will return 0; if
+ // r_key is a key between the smallest and next key, this method
+ // will return 1; if r_key is a key larger than the largest key,
+ // this method will return the size of r_c.
+ inline size_type
+ order_of_prefix(const_e_iterator, const_e_iterator) const;
+
+ private:
+ typedef typename base_type::const_reference const_reference;
+ typedef typename base_type::const_pointer const_pointer;
+
+ typedef typename Allocator::template rebind<metadata_type>::other metadata_rebind;
+ typedef typename metadata_rebind::const_reference const_metadata_reference;
+ typedef typename metadata_rebind::reference metadata_reference;
+
+ // Returns true if the container is empty.
+ virtual bool
+ empty() const = 0;
+
+ // Returns the iterator associated with the trie's first element.
+ virtual iterator
+ begin() = 0;
+
+ // Returns the iterator associated with the trie's
+ // just-after-last element.
+ virtual iterator
+ end() = 0;
+
+ // Returns the const_node_iterator associated with the trie's root node.
+ virtual const_node_iterator
+ node_begin() const = 0;
+
+ // Returns the node_iterator associated with the trie's root node.
+ virtual node_iterator
+ node_begin() = 0;
+
+ // Returns the const_node_iterator associated with a just-after
+ // leaf node.
+ virtual const_node_iterator
+ node_end() const = 0;
+
+ // Returns the node_iterator associated with a just-after leaf node.
+ virtual node_iterator
+ node_end() = 0;
+
+ // Access to the cmp_fn object.
+ virtual e_access_traits&
+ get_e_access_traits() = 0;
+
+ protected:
+ // Updates the rank of a node through a node_iterator node_it;
+ // end_nd_it is the end node iterator.
+ inline void
+ operator()(node_iterator, const_node_iterator) const;
+
+ // Destructor.
+ virtual
+ ~trie_order_statistics_node_update();
+ };
+
+#include <ext/pb_ds/detail/trie_policy/order_statistics_imp.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_BASE_C_DEC
+
+} // namespace __gnu_pbds
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pod_char_traits.h b/i686-linux/include/c++/4.4.3/ext/pod_char_traits.h
new file mode 100644
index 0000000..2797c1b
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pod_char_traits.h
@@ -0,0 +1,182 @@
+// POD character, std::char_traits specialization -*- C++ -*-
+
+// Copyright (C) 2002, 2003, 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ext/pod_char_traits.h
+ * This file is a GNU extension to the Standard C++ Library.
+ */
+
+// Gabriel Dos Reis <gdr@integrable-solutions.net>
+// Benjamin Kosnik <bkoz@redhat.com>
+
+#ifndef _POD_CHAR_TRAITS_H
+#define _POD_CHAR_TRAITS_H 1
+
+#include <string>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ // POD character abstraction.
+ // NB: The char_type parameter is a subset of int_type, as to allow
+ // int_type to properly hold the full range of char_type values as
+ // well as EOF.
+ /// @brief A POD class that serves as a character abstraction class.
+ template<typename V, typename I, typename S = std::mbstate_t>
+ struct character
+ {
+ typedef V value_type;
+ typedef I int_type;
+ typedef S state_type;
+ typedef character<V, I, S> char_type;
+
+ value_type value;
+
+ template<typename V2>
+ static char_type
+ from(const V2& v)
+ {
+ char_type ret = { static_cast<value_type>(v) };
+ return ret;
+ }
+
+ template<typename V2>
+ static V2
+ to(const char_type& c)
+ {
+ V2 ret = { static_cast<V2>(c.value) };
+ return ret;
+ }
+
+ };
+
+ template<typename V, typename I, typename S>
+ inline bool
+ operator==(const character<V, I, S>& lhs, const character<V, I, S>& rhs)
+ { return lhs.value == rhs.value; }
+
+ template<typename V, typename I, typename S>
+ inline bool
+ operator<(const character<V, I, S>& lhs, const character<V, I, S>& rhs)
+ { return lhs.value < rhs.value; }
+
+_GLIBCXX_END_NAMESPACE
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /// char_traits<__gnu_cxx::character> specialization.
+ template<typename V, typename I, typename S>
+ struct char_traits<__gnu_cxx::character<V, I, S> >
+ {
+ typedef __gnu_cxx::character<V, I, S> char_type;
+ typedef typename char_type::int_type int_type;
+ typedef typename char_type::state_type state_type;
+ typedef fpos<state_type> pos_type;
+ typedef streamoff off_type;
+
+ static void
+ assign(char_type& __c1, const char_type& __c2)
+ { __c1 = __c2; }
+
+ static bool
+ eq(const char_type& __c1, const char_type& __c2)
+ { return __c1 == __c2; }
+
+ static bool
+ lt(const char_type& __c1, const char_type& __c2)
+ { return __c1 < __c2; }
+
+ static int
+ compare(const char_type* __s1, const char_type* __s2, size_t __n)
+ {
+ for (size_t __i = 0; __i < __n; ++__i)
+ if (!eq(__s1[__i], __s2[__i]))
+ return lt(__s1[__i], __s2[__i]) ? -1 : 1;
+ return 0;
+ }
+
+ static size_t
+ length(const char_type* __s)
+ {
+ const char_type* __p = __s;
+ while (__p->value)
+ ++__p;
+ return (__p - __s);
+ }
+
+ static const char_type*
+ find(const char_type* __s, size_t __n, const char_type& __a)
+ {
+ for (const char_type* __p = __s; size_t(__p - __s) < __n; ++__p)
+ if (*__p == __a)
+ return __p;
+ return 0;
+ }
+
+ static char_type*
+ move(char_type* __s1, const char_type* __s2, size_t __n)
+ {
+ return static_cast<char_type*>
+ (__builtin_memmove(__s1, __s2, __n * sizeof(char_type)));
+ }
+
+ static char_type*
+ copy(char_type* __s1, const char_type* __s2, size_t __n)
+ {
+ std::copy(__s2, __s2 + __n, __s1);
+ return __s1;
+ }
+
+ static char_type*
+ assign(char_type* __s, size_t __n, char_type __a)
+ {
+ std::fill_n(__s, __n, __a);
+ return __s;
+ }
+
+ static char_type
+ to_char_type(const int_type& __i)
+ { return char_type::template from(__i); }
+
+ static int_type
+ to_int_type(const char_type& __c)
+ { return char_type::template to<int_type>(__c); }
+
+ static bool
+ eq_int_type(const int_type& __c1, const int_type& __c2)
+ { return __c1 == __c2; }
+
+ static int_type
+ eof()
+ {
+ int_type __r = { -1 };
+ return __r;
+ }
+
+ static int_type
+ not_eof(const int_type& __c)
+ { return eq_int_type(__c, eof()) ? int_type() : __c; }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/pointer.h b/i686-linux/include/c++/4.4.3/ext/pointer.h
new file mode 100644
index 0000000..5aac7f1
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pointer.h
@@ -0,0 +1,551 @@
+// Custom pointer adapter and sample storage policies
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/**
+ * @file ext/pointer.h
+ * @author Bob Walters
+ *
+ * Provides reusable _Pointer_adapter for assisting in the development of
+ * custom pointer types that can be used with the standard containers via
+ * the allocator::pointer and allocator::const_pointer typedefs.
+ */
+
+#ifndef _POINTER_H
+#define _POINTER_H 1
+
+#include <iosfwd>
+#include <bits/stl_iterator_base_types.h>
+#include <ext/cast.h>
+#include <ext/type_traits.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ /**
+ * @brief A storage policy for use with _Pointer_adapter<> which yields a
+ * standard pointer.
+ *
+ * A _Storage_policy is required to provide 4 things:
+ * 1) A get() API for returning the stored pointer value.
+ * 2) An set() API for storing a pointer value.
+ * 3) An element_type typedef to define the type this points to.
+ * 4) An operator<() to support pointer comparison.
+ * 5) An operator==() to support pointer comparison.
+ */
+ template<typename _Tp>
+ class _Std_pointer_impl
+ {
+ public:
+ // the type this pointer points to.
+ typedef _Tp element_type;
+
+ // A method to fetch the pointer value as a standard T* value;
+ inline _Tp*
+ get() const
+ { return _M_value; }
+
+ // A method to set the pointer value, from a standard T* value;
+ inline void
+ set(element_type* __arg)
+ { _M_value = __arg; }
+
+ // Comparison of pointers
+ inline bool
+ operator<(const _Std_pointer_impl& __rarg) const
+ { return (_M_value < __rarg._M_value); }
+
+ inline bool
+ operator==(const _Std_pointer_impl& __rarg) const
+ { return (_M_value == __rarg._M_value); }
+
+ private:
+ element_type* _M_value;
+ };
+
+ /**
+ * @brief A storage policy for use with _Pointer_adapter<> which stores
+ * the pointer's address as an offset value which is relative to
+ * its own address.
+ *
+ * This is intended for pointers
+ * within shared memory regions which might be mapped at different
+ * addresses by different processes. For null pointers, a value of 1 is
+ * used. (0 is legitimate sometimes for nodes in circularly linked lists)
+ * This value was chosen as the least likely to generate an incorrect null,
+ * As there is no reason why any normal pointer would point 1 byte into
+ * its own pointer address.
+ */
+ template<typename _Tp>
+ class _Relative_pointer_impl
+ {
+ public:
+ typedef _Tp element_type;
+
+ _Tp*
+ get() const
+ {
+ if (_M_diff == 1)
+ return 0;
+ else
+ return reinterpret_cast<_Tp*>(reinterpret_cast<_UIntPtrType>(this)
+ + _M_diff);
+ }
+
+ void
+ set(_Tp* __arg)
+ {
+ if (!__arg)
+ _M_diff = 1;
+ else
+ _M_diff = reinterpret_cast<_UIntPtrType>(__arg)
+ - reinterpret_cast<_UIntPtrType>(this);
+ }
+
+ // Comparison of pointers
+ inline bool
+ operator<(const _Relative_pointer_impl& __rarg) const
+ { return (reinterpret_cast<_UIntPtrType>(this->get())
+ < reinterpret_cast<_UIntPtrType>(__rarg.get())); }
+
+ inline bool
+ operator==(const _Relative_pointer_impl& __rarg) const
+ { return (reinterpret_cast<_UIntPtrType>(this->get())
+ == reinterpret_cast<_UIntPtrType>(__rarg.get())); }
+
+ private:
+ typedef __gnu_cxx::__conditional_type<
+ (sizeof(unsigned long) >= sizeof(void*)),
+ unsigned long, unsigned long long>::__type _UIntPtrType;
+ _UIntPtrType _M_diff;
+ };
+
+ /**
+ * Relative_pointer_impl needs a specialization for const T because of
+ * the casting done during pointer arithmetic.
+ */
+ template<typename _Tp>
+ class _Relative_pointer_impl<const _Tp>
+ {
+ public:
+ typedef const _Tp element_type;
+
+ const _Tp*
+ get() const
+ {
+ if (_M_diff == 1)
+ return 0;
+ else
+ return reinterpret_cast<const _Tp*>
+ (reinterpret_cast<_UIntPtrType>(this) + _M_diff);
+ }
+
+ void
+ set(const _Tp* __arg)
+ {
+ if (!__arg)
+ _M_diff = 1;
+ else
+ _M_diff = reinterpret_cast<_UIntPtrType>(__arg)
+ - reinterpret_cast<_UIntPtrType>(this);
+ }
+
+ // Comparison of pointers
+ inline bool
+ operator<(const _Relative_pointer_impl& __rarg) const
+ { return (reinterpret_cast<_UIntPtrType>(this->get())
+ < reinterpret_cast<_UIntPtrType>(__rarg.get())); }
+
+ inline bool
+ operator==(const _Relative_pointer_impl& __rarg) const
+ { return (reinterpret_cast<_UIntPtrType>(this->get())
+ == reinterpret_cast<_UIntPtrType>(__rarg.get())); }
+
+ private:
+ typedef __gnu_cxx::__conditional_type
+ <(sizeof(unsigned long) >= sizeof(void*)),
+ unsigned long, unsigned long long>::__type _UIntPtrType;
+ _UIntPtrType _M_diff;
+ };
+
+ /**
+ * The specialization on this type helps resolve the problem of
+ * reference to void, and eliminates the need to specialize _Pointer_adapter
+ * for cases of void*, const void*, and so on.
+ */
+ struct _Invalid_type { };
+
+ template<typename _Tp>
+ struct _Reference_type
+ { typedef _Tp& reference; };
+
+ template<>
+ struct _Reference_type<void>
+ { typedef _Invalid_type& reference; };
+
+ template<>
+ struct _Reference_type<const void>
+ { typedef const _Invalid_type& reference; };
+
+ template<>
+ struct _Reference_type<volatile void>
+ { typedef volatile _Invalid_type& reference; };
+
+ template<>
+ struct _Reference_type<volatile const void>
+ { typedef const volatile _Invalid_type& reference; };
+
+ /**
+ * This structure accomodates the way in which std::iterator_traits<>
+ * is normally specialized for const T*, so that value_type is still T.
+ */
+ template<typename _Tp>
+ struct _Unqualified_type
+ { typedef _Tp type; };
+
+ template<typename _Tp>
+ struct _Unqualified_type<const _Tp>
+ { typedef _Tp type; };
+
+ template<typename _Tp>
+ struct _Unqualified_type<volatile _Tp>
+ { typedef volatile _Tp type; };
+
+ template<typename _Tp>
+ struct _Unqualified_type<volatile const _Tp>
+ { typedef volatile _Tp type; };
+
+ /**
+ * The following provides an 'alternative pointer' that works with the
+ * containers when specified as the pointer typedef of the allocator.
+ *
+ * The pointer type used with the containers doesn't have to be this class,
+ * but it must support the implicit conversions, pointer arithmetic,
+ * comparison operators, etc. that are supported by this class, and avoid
+ * raising compile-time ambiguities. Because creating a working pointer can
+ * be challenging, this pointer template was designed to wrapper an
+ * easier storage policy type, so that it becomes reusable for creating
+ * other pointer types.
+ *
+ * A key point of this class is also that it allows container writers to
+ * 'assume' Alocator::pointer is a typedef for a normal pointer. This class
+ * supports most of the conventions of a true pointer, and can, for instance
+ * handle implicit conversion to const and base class pointer types. The
+ * only impositions on container writers to support extended pointers are:
+ * 1) use the Allocator::pointer typedef appropriately for pointer types.
+ * 2) if you need pointer casting, use the __pointer_cast<> functions
+ * from ext/cast.h. This allows pointer cast operations to be overloaded
+ * is necessary by custom pointers.
+ *
+ * Note: The const qualifier works with this pointer adapter as follows:
+ *
+ * _Tp* == _Pointer_adapter<_Std_pointer_impl<_Tp> >;
+ * const _Tp* == _Pointer_adapter<_Std_pointer_impl<const _Tp> >;
+ * _Tp* const == const _Pointer_adapter<_Std_pointer_impl<_Tp> >;
+ * const _Tp* const == const _Pointer_adapter<_Std_pointer_impl<const _Tp> >;
+ */
+ template<typename _Storage_policy>
+ class _Pointer_adapter : public _Storage_policy
+ {
+ public:
+ typedef typename _Storage_policy::element_type element_type;
+
+ // These are needed for iterator_traits
+ typedef std::random_access_iterator_tag iterator_category;
+ typedef typename _Unqualified_type<element_type>::type value_type;
+ typedef std::ptrdiff_t difference_type;
+ typedef _Pointer_adapter pointer;
+ typedef typename _Reference_type<element_type>::reference reference;
+
+ // Reminder: 'const' methods mean that the method is valid when the
+ // pointer is immutable, and has nothing to do with whether the
+ // 'pointee' is const.
+
+ // Default Constructor (Convert from element_type*)
+ _Pointer_adapter(element_type* __arg = 0)
+ { _Storage_policy::set(__arg); }
+
+ // Copy constructor from _Pointer_adapter of same type.
+ _Pointer_adapter(const _Pointer_adapter& __arg)
+ { _Storage_policy::set(__arg.get()); }
+
+ // Convert from _Up* if conversion to element_type* is valid.
+ template<typename _Up>
+ _Pointer_adapter(_Up* __arg)
+ { _Storage_policy::set(__arg); }
+
+ // Conversion from another _Pointer_adapter if _Up if static cast is
+ // valid.
+ template<typename _Up>
+ _Pointer_adapter(const _Pointer_adapter<_Up>& __arg)
+ { _Storage_policy::set(__arg.get()); }
+
+ // Destructor
+ ~_Pointer_adapter() { }
+
+ // Assignment operator
+ _Pointer_adapter&
+ operator=(const _Pointer_adapter& __arg)
+ {
+ _Storage_policy::set(__arg.get());
+ return *this;
+ }
+
+ template<typename _Up>
+ _Pointer_adapter&
+ operator=(const _Pointer_adapter<_Up>& __arg)
+ {
+ _Storage_policy::set(__arg.get());
+ return *this;
+ }
+
+ template<typename _Up>
+ _Pointer_adapter&
+ operator=(_Up* __arg)
+ {
+ _Storage_policy::set(__arg);
+ return *this;
+ }
+
+ // Operator*, returns element_type&
+ inline reference
+ operator*() const
+ { return *(_Storage_policy::get()); }
+
+ // Operator->, returns element_type*
+ inline element_type*
+ operator->() const
+ { return _Storage_policy::get(); }
+
+ // Operator[], returns a element_type& to the item at that loc.
+ inline reference
+ operator[](std::ptrdiff_t __index) const
+ { return _Storage_policy::get()[__index]; }
+
+ // To allow implicit conversion to "bool", for "if (ptr)..."
+ private:
+ typedef element_type*(_Pointer_adapter::*__unspecified_bool_type)() const;
+
+ public:
+ operator __unspecified_bool_type() const
+ {
+ return _Storage_policy::get() == 0 ? 0 :
+ &_Pointer_adapter::operator->;
+ }
+
+ // ! operator (for: if (!ptr)...)
+ inline bool
+ operator!() const
+ { return (_Storage_policy::get() == 0); }
+
+ // Pointer differences
+ inline friend std::ptrdiff_t
+ operator-(const _Pointer_adapter& __lhs, element_type* __rhs)
+ { return (__lhs.get() - __rhs); }
+
+ inline friend std::ptrdiff_t
+ operator-(element_type* __lhs, const _Pointer_adapter& __rhs)
+ { return (__lhs - __rhs.get()); }
+
+ template<typename _Up>
+ inline friend std::ptrdiff_t
+ operator-(const _Pointer_adapter& __lhs, _Up* __rhs)
+ { return (__lhs.get() - __rhs); }
+
+ template<typename _Up>
+ inline friend std::ptrdiff_t
+ operator-(_Up* __lhs, const _Pointer_adapter& __rhs)
+ { return (__lhs - __rhs.get()); }
+
+ template<typename _Up>
+ inline std::ptrdiff_t
+ operator-(const _Pointer_adapter<_Up>& __rhs) const
+ { return (_Storage_policy::get() - __rhs.get()); }
+
+ // Pointer math
+ // Note: There is a reason for all this overloading based on different
+ // integer types. In some libstdc++-v3 test cases, a templated
+ // operator+ is declared which can match any types. This operator
+ // tends to "steal" the recognition of _Pointer_adapter's own operator+
+ // unless the integer type matches perfectly.
+
+#define _CXX_POINTER_ARITH_OPERATOR_SET(INT_TYPE) \
+ inline friend _Pointer_adapter \
+ operator+(const _Pointer_adapter& __lhs, INT_TYPE __offset) \
+ { return _Pointer_adapter(__lhs.get() + __offset); } \
+\
+ inline friend _Pointer_adapter \
+ operator+(INT_TYPE __offset, const _Pointer_adapter& __rhs) \
+ { return _Pointer_adapter(__rhs.get() + __offset); } \
+\
+ inline friend _Pointer_adapter \
+ operator-(const _Pointer_adapter& __lhs, INT_TYPE __offset) \
+ { return _Pointer_adapter(__lhs.get() - __offset); } \
+\
+ inline _Pointer_adapter& \
+ operator+=(INT_TYPE __offset) \
+ { \
+ _Storage_policy::set(_Storage_policy::get() + __offset); \
+ return *this; \
+ } \
+\
+ inline _Pointer_adapter& \
+ operator-=(INT_TYPE __offset) \
+ { \
+ _Storage_policy::set(_Storage_policy::get() - __offset); \
+ return *this; \
+ } \
+// END of _CXX_POINTER_ARITH_OPERATOR_SET macro
+
+ // Expand into the various pointer arithmatic operators needed.
+ _CXX_POINTER_ARITH_OPERATOR_SET(short);
+ _CXX_POINTER_ARITH_OPERATOR_SET(unsigned short);
+ _CXX_POINTER_ARITH_OPERATOR_SET(int);
+ _CXX_POINTER_ARITH_OPERATOR_SET(unsigned int);
+ _CXX_POINTER_ARITH_OPERATOR_SET(long);
+ _CXX_POINTER_ARITH_OPERATOR_SET(unsigned long);
+
+ // Mathematical Manipulators
+ inline _Pointer_adapter&
+ operator++()
+ {
+ _Storage_policy::set(_Storage_policy::get() + 1);
+ return *this;
+ }
+
+ inline _Pointer_adapter
+ operator++(int __unused)
+ {
+ _Pointer_adapter tmp(*this);
+ _Storage_policy::set(_Storage_policy::get() + 1);
+ return tmp;
+ }
+
+ inline _Pointer_adapter&
+ operator--()
+ {
+ _Storage_policy::set(_Storage_policy::get() - 1);
+ return *this;
+ }
+
+ inline _Pointer_adapter
+ operator--(int)
+ {
+ _Pointer_adapter tmp(*this);
+ _Storage_policy::set(_Storage_policy::get() - 1);
+ return tmp;
+ }
+
+ }; // class _Pointer_adapter
+
+
+#define _GCC_CXX_POINTER_COMPARISON_OPERATION_SET(OPERATOR,BLANK) \
+ template<typename _Tp1, typename _Tp2> \
+ inline bool \
+ operator OPERATOR##BLANK (const _Pointer_adapter<_Tp1>& __lhs, _Tp2 __rhs) \
+ { return __lhs.get() OPERATOR##BLANK __rhs; } \
+\
+ template<typename _Tp1, typename _Tp2> \
+ inline bool \
+ operator OPERATOR##BLANK (_Tp1 __lhs, const _Pointer_adapter<_Tp2>& __rhs) \
+ { return __lhs OPERATOR##BLANK __rhs.get(); } \
+\
+ template<typename _Tp1, typename _Tp2> \
+ inline bool \
+ operator OPERATOR##BLANK (const _Pointer_adapter<_Tp1>& __lhs, \
+ const _Pointer_adapter<_Tp2>& __rhs) \
+ { return __lhs.get() OPERATOR##BLANK __rhs.get(); } \
+\
+// End GCC_CXX_POINTER_COMPARISON_OPERATION_SET Macro
+
+ // Expand into the various comparison operators needed.
+ _GCC_CXX_POINTER_COMPARISON_OPERATION_SET(==,);
+ _GCC_CXX_POINTER_COMPARISON_OPERATION_SET(!=,);
+ _GCC_CXX_POINTER_COMPARISON_OPERATION_SET(<,);
+ _GCC_CXX_POINTER_COMPARISON_OPERATION_SET(<=,);
+ _GCC_CXX_POINTER_COMPARISON_OPERATION_SET(>,);
+ _GCC_CXX_POINTER_COMPARISON_OPERATION_SET(>=,);
+
+ // These are here for expressions like "ptr == 0", "ptr != 0"
+ template<typename _Tp>
+ inline bool
+ operator==(const _Pointer_adapter<_Tp>& __lhs, int __rhs)
+ { return __lhs.get() == reinterpret_cast<void*>(__rhs); }
+
+ template<typename _Tp>
+ inline bool
+ operator==(int __lhs, const _Pointer_adapter<_Tp>& __rhs)
+ { return __rhs.get() == reinterpret_cast<void*>(__lhs); }
+
+ template<typename _Tp>
+ inline bool
+ operator!=(const _Pointer_adapter<_Tp>& __lhs, int __rhs)
+ { return __lhs.get() != reinterpret_cast<void*>(__rhs); }
+
+ template<typename _Tp>
+ inline bool
+ operator!=(int __lhs, const _Pointer_adapter<_Tp>& __rhs)
+ { return __rhs.get() != reinterpret_cast<void*>(__lhs); }
+
+ /**
+ * Comparison operators for _Pointer_adapter defer to the base class'es
+ * comparison operators, when possible.
+ */
+ template<typename _Tp>
+ inline bool
+ operator==(const _Pointer_adapter<_Tp>& __lhs,
+ const _Pointer_adapter<_Tp>& __rhs)
+ { return __lhs._Tp::operator==(__rhs); }
+
+ template<typename _Tp>
+ inline bool
+ operator<=(const _Pointer_adapter<_Tp>& __lhs,
+ const _Pointer_adapter<_Tp>& __rhs)
+ { return __lhs._Tp::operator<(__rhs) || __lhs._Tp::operator==(__rhs); }
+
+ template<typename _Tp>
+ inline bool
+ operator!=(const _Pointer_adapter<_Tp>& __lhs,
+ const _Pointer_adapter<_Tp>& __rhs)
+ { return !(__lhs._Tp::operator==(__rhs)); }
+
+ template<typename _Tp>
+ inline bool
+ operator>(const _Pointer_adapter<_Tp>& __lhs,
+ const _Pointer_adapter<_Tp>& __rhs)
+ { return !(__lhs._Tp::operator<(__rhs) || __lhs._Tp::operator==(__rhs)); }
+
+ template<typename _Tp>
+ inline bool
+ operator>=(const _Pointer_adapter<_Tp>& __lhs,
+ const _Pointer_adapter<_Tp>& __rhs)
+ { return !(__lhs._Tp::operator<(__rhs)); }
+
+ template<typename _CharT, typename _Traits, typename _StoreT>
+ inline std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const _Pointer_adapter<_StoreT>& __p)
+ { return (__os << __p.get()); }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif // _POINTER_H
diff --git a/i686-linux/include/c++/4.4.3/ext/pool_allocator.h b/i686-linux/include/c++/4.4.3/ext/pool_allocator.h
new file mode 100644
index 0000000..87d145d
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/pool_allocator.h
@@ -0,0 +1,263 @@
+// Allocators -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1996-1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file ext/pool_allocator.h
+ * This file is a GNU extension to the Standard C++ Library.
+ */
+
+#ifndef _POOL_ALLOCATOR_H
+#define _POOL_ALLOCATOR_H 1
+
+#include <bits/c++config.h>
+#include <cstdlib>
+#include <new>
+#include <bits/functexcept.h>
+#include <ext/atomicity.h>
+#include <ext/concurrence.h>
+#include <bits/move.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::size_t;
+ using std::ptrdiff_t;
+
+ /**
+ * @brief Base class for __pool_alloc.
+ *
+ * Uses various allocators to fulfill underlying requests (and makes as
+ * few requests as possible when in default high-speed pool mode).
+ *
+ * Important implementation properties:
+ * 0. If globally mandated, then allocate objects from new
+ * 1. If the clients request an object of size > _S_max_bytes, the resulting
+ * object will be obtained directly from new
+ * 2. In all other cases, we allocate an object of size exactly
+ * _S_round_up(requested_size). Thus the client has enough size
+ * information that we can return the object to the proper free list
+ * without permanently losing part of the object.
+ */
+ class __pool_alloc_base
+ {
+ protected:
+
+ enum { _S_align = 8 };
+ enum { _S_max_bytes = 128 };
+ enum { _S_free_list_size = (size_t)_S_max_bytes / (size_t)_S_align };
+
+ union _Obj
+ {
+ union _Obj* _M_free_list_link;
+ char _M_client_data[1]; // The client sees this.
+ };
+
+ static _Obj* volatile _S_free_list[_S_free_list_size];
+
+ // Chunk allocation state.
+ static char* _S_start_free;
+ static char* _S_end_free;
+ static size_t _S_heap_size;
+
+ size_t
+ _M_round_up(size_t __bytes)
+ { return ((__bytes + (size_t)_S_align - 1) & ~((size_t)_S_align - 1)); }
+
+ _Obj* volatile*
+ _M_get_free_list(size_t __bytes);
+
+ __mutex&
+ _M_get_mutex();
+
+ // Returns an object of size __n, and optionally adds to size __n
+ // free list.
+ void*
+ _M_refill(size_t __n);
+
+ // Allocates a chunk for nobjs of size size. nobjs may be reduced
+ // if it is inconvenient to allocate the requested number.
+ char*
+ _M_allocate_chunk(size_t __n, int& __nobjs);
+ };
+
+
+ /**
+ * @brief Allocator using a memory pool with a single lock.
+ * @ingroup allocators
+ */
+ template<typename _Tp>
+ class __pool_alloc : private __pool_alloc_base
+ {
+ private:
+ static _Atomic_word _S_force_new;
+
+ public:
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Tp* pointer;
+ typedef const _Tp* const_pointer;
+ typedef _Tp& reference;
+ typedef const _Tp& const_reference;
+ typedef _Tp value_type;
+
+ template<typename _Tp1>
+ struct rebind
+ { typedef __pool_alloc<_Tp1> other; };
+
+ __pool_alloc() throw() { }
+
+ __pool_alloc(const __pool_alloc&) throw() { }
+
+ template<typename _Tp1>
+ __pool_alloc(const __pool_alloc<_Tp1>&) throw() { }
+
+ ~__pool_alloc() throw() { }
+
+ pointer
+ address(reference __x) const { return &__x; }
+
+ const_pointer
+ address(const_reference __x) const { return &__x; }
+
+ size_type
+ max_size() const throw()
+ { return size_t(-1) / sizeof(_Tp); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 402. wrong new expression in [some_] allocator::construct
+ void
+ construct(pointer __p, const _Tp& __val)
+ { ::new((void *)__p) _Tp(__val); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename... _Args>
+ void
+ construct(pointer __p, _Args&&... __args)
+ { ::new((void *)__p) _Tp(std::forward<_Args>(__args)...); }
+#endif
+
+ void
+ destroy(pointer __p) { __p->~_Tp(); }
+
+ pointer
+ allocate(size_type __n, const void* = 0);
+
+ void
+ deallocate(pointer __p, size_type __n);
+ };
+
+ template<typename _Tp>
+ inline bool
+ operator==(const __pool_alloc<_Tp>&, const __pool_alloc<_Tp>&)
+ { return true; }
+
+ template<typename _Tp>
+ inline bool
+ operator!=(const __pool_alloc<_Tp>&, const __pool_alloc<_Tp>&)
+ { return false; }
+
+ template<typename _Tp>
+ _Atomic_word
+ __pool_alloc<_Tp>::_S_force_new;
+
+ template<typename _Tp>
+ _Tp*
+ __pool_alloc<_Tp>::allocate(size_type __n, const void*)
+ {
+ pointer __ret = 0;
+ if (__builtin_expect(__n != 0, true))
+ {
+ if (__builtin_expect(__n > this->max_size(), false))
+ std::__throw_bad_alloc();
+
+ // If there is a race through here, assume answer from getenv
+ // will resolve in same direction. Inspired by techniques
+ // to efficiently support threading found in basic_string.h.
+ if (_S_force_new == 0)
+ {
+ if (std::getenv("GLIBCXX_FORCE_NEW"))
+ __atomic_add_dispatch(&_S_force_new, 1);
+ else
+ __atomic_add_dispatch(&_S_force_new, -1);
+ }
+
+ const size_t __bytes = __n * sizeof(_Tp);
+ if (__bytes > size_t(_S_max_bytes) || _S_force_new > 0)
+ __ret = static_cast<_Tp*>(::operator new(__bytes));
+ else
+ {
+ _Obj* volatile* __free_list = _M_get_free_list(__bytes);
+
+ __scoped_lock sentry(_M_get_mutex());
+ _Obj* __restrict__ __result = *__free_list;
+ if (__builtin_expect(__result == 0, 0))
+ __ret = static_cast<_Tp*>(_M_refill(_M_round_up(__bytes)));
+ else
+ {
+ *__free_list = __result->_M_free_list_link;
+ __ret = reinterpret_cast<_Tp*>(__result);
+ }
+ if (__builtin_expect(__ret == 0, 0))
+ std::__throw_bad_alloc();
+ }
+ }
+ return __ret;
+ }
+
+ template<typename _Tp>
+ void
+ __pool_alloc<_Tp>::deallocate(pointer __p, size_type __n)
+ {
+ if (__builtin_expect(__n != 0 && __p != 0, true))
+ {
+ const size_t __bytes = __n * sizeof(_Tp);
+ if (__bytes > static_cast<size_t>(_S_max_bytes) || _S_force_new > 0)
+ ::operator delete(__p);
+ else
+ {
+ _Obj* volatile* __free_list = _M_get_free_list(__bytes);
+ _Obj* __q = reinterpret_cast<_Obj*>(__p);
+
+ __scoped_lock sentry(_M_get_mutex());
+ __q ->_M_free_list_link = *__free_list;
+ *__free_list = __q;
+ }
+ }
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/rb_tree b/i686-linux/include/c++/4.4.3/ext/rb_tree
new file mode 100644
index 0000000..185d02e
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/rb_tree
@@ -0,0 +1,93 @@
+// rb_tree extension -*- C++ -*-
+
+// Copyright (C) 2002, 2003, 2004, 2005, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file ext/rb_tree
+ * This file is a GNU extension to the Standard C++ Library (possibly
+ * containing extensions from the HP/SGI STL subset).
+ */
+
+#ifndef _RB_TREE
+#define _RB_TREE 1
+
+#pragma GCC system_header
+
+#include <bits/stl_tree.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::_Rb_tree;
+ using std::allocator;
+
+ // Class rb_tree is not part of the C++ standard. It is provided for
+ // compatibility with the HP STL.
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template <class _Key, class _Value, class _KeyOfValue, class _Compare,
+ class _Alloc = allocator<_Value> >
+ struct rb_tree
+ : public _Rb_tree<_Key, _Value, _KeyOfValue, _Compare, _Alloc>
+ {
+ typedef _Rb_tree<_Key, _Value, _KeyOfValue, _Compare, _Alloc> _Base;
+ typedef typename _Base::allocator_type allocator_type;
+
+ rb_tree(const _Compare& __comp = _Compare(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__comp, __a) { }
+
+ ~rb_tree() { }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/rc_string_base.h b/i686-linux/include/c++/4.4.3/ext/rc_string_base.h
new file mode 100644
index 0000000..dce5e06
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/rc_string_base.h
@@ -0,0 +1,718 @@
+// Reference-counted versatile string base -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ext/rc_string_base.h
+ * This file is a GNU extension to the Standard C++ Library.
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _RC_STRING_BASE_H
+#define _RC_STRING_BASE_H 1
+
+#include <ext/atomicity.h>
+#include <bits/stl_iterator_base_funcs.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ /**
+ * Documentation? What's that?
+ * Nathan Myers <ncm@cantrip.org>.
+ *
+ * A string looks like this:
+ *
+ * @code
+ * [_Rep]
+ * _M_length
+ * [__rc_string_base<char_type>] _M_capacity
+ * _M_dataplus _M_refcount
+ * _M_p ----------------> unnamed array of char_type
+ * @endcode
+ *
+ * Where the _M_p points to the first character in the string, and
+ * you cast it to a pointer-to-_Rep and subtract 1 to get a
+ * pointer to the header.
+ *
+ * This approach has the enormous advantage that a string object
+ * requires only one allocation. All the ugliness is confined
+ * within a single pair of inline functions, which each compile to
+ * a single "add" instruction: _Rep::_M_refdata(), and
+ * __rc_string_base::_M_rep(); and the allocation function which gets a
+ * block of raw bytes and with room enough and constructs a _Rep
+ * object at the front.
+ *
+ * The reason you want _M_data pointing to the character array and
+ * not the _Rep is so that the debugger can see the string
+ * contents. (Probably we should add a non-inline member to get
+ * the _Rep for the debugger to use, so users can check the actual
+ * string length.)
+ *
+ * Note that the _Rep object is a POD so that you can have a
+ * static "empty string" _Rep object already "constructed" before
+ * static constructors have run. The reference-count encoding is
+ * chosen so that a 0 indicates one reference, so you never try to
+ * destroy the empty-string _Rep object.
+ *
+ * All but the last paragraph is considered pretty conventional
+ * for a C++ string implementation.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ class __rc_string_base
+ : protected __vstring_utility<_CharT, _Traits, _Alloc>
+ {
+ public:
+ typedef _Traits traits_type;
+ typedef typename _Traits::char_type value_type;
+ typedef _Alloc allocator_type;
+
+ typedef __vstring_utility<_CharT, _Traits, _Alloc> _Util_Base;
+ typedef typename _Util_Base::_CharT_alloc_type _CharT_alloc_type;
+ typedef typename _CharT_alloc_type::size_type size_type;
+
+ private:
+ // _Rep: string representation
+ // Invariants:
+ // 1. String really contains _M_length + 1 characters: due to 21.3.4
+ // must be kept null-terminated.
+ // 2. _M_capacity >= _M_length
+ // Allocated memory is always (_M_capacity + 1) * sizeof(_CharT).
+ // 3. _M_refcount has three states:
+ // -1: leaked, one reference, no ref-copies allowed, non-const.
+ // 0: one reference, non-const.
+ // n>0: n + 1 references, operations require a lock, const.
+ // 4. All fields == 0 is an empty string, given the extra storage
+ // beyond-the-end for a null terminator; thus, the shared
+ // empty string representation needs no constructor.
+ struct _Rep
+ {
+ union
+ {
+ struct
+ {
+ size_type _M_length;
+ size_type _M_capacity;
+ _Atomic_word _M_refcount;
+ } _M_info;
+
+ // Only for alignment purposes.
+ _CharT _M_align;
+ };
+
+ typedef typename _Alloc::template rebind<_Rep>::other _Rep_alloc_type;
+
+ _CharT*
+ _M_refdata() throw()
+ { return reinterpret_cast<_CharT*>(this + 1); }
+
+ _CharT*
+ _M_refcopy() throw()
+ {
+ __atomic_add_dispatch(&_M_info._M_refcount, 1);
+ return _M_refdata();
+ } // XXX MT
+
+ void
+ _M_set_length(size_type __n)
+ {
+ _M_info._M_refcount = 0; // One reference.
+ _M_info._M_length = __n;
+ // grrr. (per 21.3.4)
+ // You cannot leave those LWG people alone for a second.
+ traits_type::assign(_M_refdata()[__n], _CharT());
+ }
+
+ // Create & Destroy
+ static _Rep*
+ _S_create(size_type, size_type, const _Alloc&);
+
+ void
+ _M_destroy(const _Alloc&) throw();
+
+ _CharT*
+ _M_clone(const _Alloc&, size_type __res = 0);
+ };
+
+ struct _Rep_empty
+ : public _Rep
+ {
+ _CharT _M_terminal;
+ };
+
+ static _Rep_empty _S_empty_rep;
+
+ // The maximum number of individual char_type elements of an
+ // individual string is determined by _S_max_size. This is the
+ // value that will be returned by max_size(). (Whereas npos
+ // is the maximum number of bytes the allocator can allocate.)
+ // If one was to divvy up the theoretical largest size string,
+ // with a terminating character and m _CharT elements, it'd
+ // look like this:
+ // npos = sizeof(_Rep) + (m * sizeof(_CharT)) + sizeof(_CharT)
+ // + sizeof(_Rep) - 1
+ // (NB: last two terms for rounding reasons, see _M_create below)
+ // Solving for m:
+ // m = ((npos - 2 * sizeof(_Rep) + 1) / sizeof(_CharT)) - 1
+ // In addition, this implementation halves this amount.
+ enum { _S_max_size = (((static_cast<size_type>(-1) - 2 * sizeof(_Rep)
+ + 1) / sizeof(_CharT)) - 1) / 2 };
+
+ // Data Member (private):
+ mutable typename _Util_Base::template _Alloc_hider<_Alloc> _M_dataplus;
+
+ void
+ _M_data(_CharT* __p)
+ { _M_dataplus._M_p = __p; }
+
+ _Rep*
+ _M_rep() const
+ { return &((reinterpret_cast<_Rep*>(_M_data()))[-1]); }
+
+ _CharT*
+ _M_grab(const _Alloc& __alloc) const
+ {
+ return (!_M_is_leaked() && _M_get_allocator() == __alloc)
+ ? _M_rep()->_M_refcopy() : _M_rep()->_M_clone(__alloc);
+ }
+
+ void
+ _M_dispose()
+ {
+ if (__exchange_and_add_dispatch(&_M_rep()->_M_info._M_refcount,
+ -1) <= 0)
+ _M_rep()->_M_destroy(_M_get_allocator());
+ } // XXX MT
+
+ bool
+ _M_is_leaked() const
+ { return _M_rep()->_M_info._M_refcount < 0; }
+
+ void
+ _M_set_sharable()
+ { _M_rep()->_M_info._M_refcount = 0; }
+
+ void
+ _M_leak_hard();
+
+ // _S_construct_aux is used to implement the 21.3.1 para 15 which
+ // requires special behaviour if _InIterator is an integral type
+ template<typename _InIterator>
+ static _CharT*
+ _S_construct_aux(_InIterator __beg, _InIterator __end,
+ const _Alloc& __a, std::__false_type)
+ {
+ typedef typename iterator_traits<_InIterator>::iterator_category _Tag;
+ return _S_construct(__beg, __end, __a, _Tag());
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 438. Ambiguity in the "do the right thing" clause
+ template<typename _Integer>
+ static _CharT*
+ _S_construct_aux(_Integer __beg, _Integer __end,
+ const _Alloc& __a, std::__true_type)
+ { return _S_construct(static_cast<size_type>(__beg), __end, __a); }
+
+ template<typename _InIterator>
+ static _CharT*
+ _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a)
+ {
+ typedef typename std::__is_integer<_InIterator>::__type _Integral;
+ return _S_construct_aux(__beg, __end, __a, _Integral());
+ }
+
+ // For Input Iterators, used in istreambuf_iterators, etc.
+ template<typename _InIterator>
+ static _CharT*
+ _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a,
+ std::input_iterator_tag);
+
+ // For forward_iterators up to random_access_iterators, used for
+ // string::iterator, _CharT*, etc.
+ template<typename _FwdIterator>
+ static _CharT*
+ _S_construct(_FwdIterator __beg, _FwdIterator __end, const _Alloc& __a,
+ std::forward_iterator_tag);
+
+ static _CharT*
+ _S_construct(size_type __req, _CharT __c, const _Alloc& __a);
+
+ public:
+ size_type
+ _M_max_size() const
+ { return size_type(_S_max_size); }
+
+ _CharT*
+ _M_data() const
+ { return _M_dataplus._M_p; }
+
+ size_type
+ _M_length() const
+ { return _M_rep()->_M_info._M_length; }
+
+ size_type
+ _M_capacity() const
+ { return _M_rep()->_M_info._M_capacity; }
+
+ bool
+ _M_is_shared() const
+ { return _M_rep()->_M_info._M_refcount > 0; }
+
+ void
+ _M_set_leaked()
+ { _M_rep()->_M_info._M_refcount = -1; }
+
+ void
+ _M_leak() // for use in begin() & non-const op[]
+ {
+ if (!_M_is_leaked())
+ _M_leak_hard();
+ }
+
+ void
+ _M_set_length(size_type __n)
+ { _M_rep()->_M_set_length(__n); }
+
+ __rc_string_base()
+ : _M_dataplus(_S_empty_rep._M_refcopy()) { }
+
+ __rc_string_base(const _Alloc& __a);
+
+ __rc_string_base(const __rc_string_base& __rcs);
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ __rc_string_base(__rc_string_base&& __rcs)
+ : _M_dataplus(__rcs._M_get_allocator(), __rcs._M_data())
+ { __rcs._M_data(_S_empty_rep._M_refcopy()); }
+#endif
+
+ __rc_string_base(size_type __n, _CharT __c, const _Alloc& __a);
+
+ template<typename _InputIterator>
+ __rc_string_base(_InputIterator __beg, _InputIterator __end,
+ const _Alloc& __a);
+
+ ~__rc_string_base()
+ { _M_dispose(); }
+
+ allocator_type&
+ _M_get_allocator()
+ { return _M_dataplus; }
+
+ const allocator_type&
+ _M_get_allocator() const
+ { return _M_dataplus; }
+
+ void
+ _M_swap(__rc_string_base& __rcs);
+
+ void
+ _M_assign(const __rc_string_base& __rcs);
+
+ void
+ _M_reserve(size_type __res);
+
+ void
+ _M_mutate(size_type __pos, size_type __len1, const _CharT* __s,
+ size_type __len2);
+
+ void
+ _M_erase(size_type __pos, size_type __n);
+
+ void
+ _M_clear()
+ { _M_erase(size_type(0), _M_length()); }
+
+ bool
+ _M_compare(const __rc_string_base&) const
+ { return false; }
+ };
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename __rc_string_base<_CharT, _Traits, _Alloc>::_Rep_empty
+ __rc_string_base<_CharT, _Traits, _Alloc>::_S_empty_rep;
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename __rc_string_base<_CharT, _Traits, _Alloc>::_Rep*
+ __rc_string_base<_CharT, _Traits, _Alloc>::_Rep::
+ _S_create(size_type __capacity, size_type __old_capacity,
+ const _Alloc& __alloc)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 83. String::npos vs. string::max_size()
+ if (__capacity > size_type(_S_max_size))
+ std::__throw_length_error(__N("__rc_string_base::_Rep::_S_create"));
+
+ // The standard places no restriction on allocating more memory
+ // than is strictly needed within this layer at the moment or as
+ // requested by an explicit application call to reserve().
+
+ // Many malloc implementations perform quite poorly when an
+ // application attempts to allocate memory in a stepwise fashion
+ // growing each allocation size by only 1 char. Additionally,
+ // it makes little sense to allocate less linear memory than the
+ // natural blocking size of the malloc implementation.
+ // Unfortunately, we would need a somewhat low-level calculation
+ // with tuned parameters to get this perfect for any particular
+ // malloc implementation. Fortunately, generalizations about
+ // common features seen among implementations seems to suffice.
+
+ // __pagesize need not match the actual VM page size for good
+ // results in practice, thus we pick a common value on the low
+ // side. __malloc_header_size is an estimate of the amount of
+ // overhead per memory allocation (in practice seen N * sizeof
+ // (void*) where N is 0, 2 or 4). According to folklore,
+ // picking this value on the high side is better than
+ // low-balling it (especially when this algorithm is used with
+ // malloc implementations that allocate memory blocks rounded up
+ // to a size which is a power of 2).
+ const size_type __pagesize = 4096;
+ const size_type __malloc_header_size = 4 * sizeof(void*);
+
+ // The below implements an exponential growth policy, necessary to
+ // meet amortized linear time requirements of the library: see
+ // http://gcc.gnu.org/ml/libstdc++/2001-07/msg00085.html.
+ if (__capacity > __old_capacity && __capacity < 2 * __old_capacity)
+ {
+ __capacity = 2 * __old_capacity;
+ // Never allocate a string bigger than _S_max_size.
+ if (__capacity > size_type(_S_max_size))
+ __capacity = size_type(_S_max_size);
+ }
+
+ // NB: Need an array of char_type[__capacity], plus a terminating
+ // null char_type() element, plus enough for the _Rep data structure,
+ // plus sizeof(_Rep) - 1 to upper round to a size multiple of
+ // sizeof(_Rep).
+ // Whew. Seemingly so needy, yet so elemental.
+ size_type __size = ((__capacity + 1) * sizeof(_CharT)
+ + 2 * sizeof(_Rep) - 1);
+
+ const size_type __adj_size = __size + __malloc_header_size;
+ if (__adj_size > __pagesize && __capacity > __old_capacity)
+ {
+ const size_type __extra = __pagesize - __adj_size % __pagesize;
+ __capacity += __extra / sizeof(_CharT);
+ if (__capacity > size_type(_S_max_size))
+ __capacity = size_type(_S_max_size);
+ __size = (__capacity + 1) * sizeof(_CharT) + 2 * sizeof(_Rep) - 1;
+ }
+
+ // NB: Might throw, but no worries about a leak, mate: _Rep()
+ // does not throw.
+ _Rep* __place = _Rep_alloc_type(__alloc).allocate(__size / sizeof(_Rep));
+ _Rep* __p = new (__place) _Rep;
+ __p->_M_info._M_capacity = __capacity;
+ return __p;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ __rc_string_base<_CharT, _Traits, _Alloc>::_Rep::
+ _M_destroy(const _Alloc& __a) throw ()
+ {
+ const size_type __size = ((_M_info._M_capacity + 1) * sizeof(_CharT)
+ + 2 * sizeof(_Rep) - 1);
+ _Rep_alloc_type(__a).deallocate(this, __size / sizeof(_Rep));
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ _CharT*
+ __rc_string_base<_CharT, _Traits, _Alloc>::_Rep::
+ _M_clone(const _Alloc& __alloc, size_type __res)
+ {
+ // Requested capacity of the clone.
+ const size_type __requested_cap = _M_info._M_length + __res;
+ _Rep* __r = _Rep::_S_create(__requested_cap, _M_info._M_capacity,
+ __alloc);
+
+ if (_M_info._M_length)
+ _S_copy(__r->_M_refdata(), _M_refdata(), _M_info._M_length);
+
+ __r->_M_set_length(_M_info._M_length);
+ return __r->_M_refdata();
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ __rc_string_base<_CharT, _Traits, _Alloc>::
+ __rc_string_base(const _Alloc& __a)
+ : _M_dataplus(__a, _S_construct(size_type(), _CharT(), __a)) { }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ __rc_string_base<_CharT, _Traits, _Alloc>::
+ __rc_string_base(const __rc_string_base& __rcs)
+ : _M_dataplus(__rcs._M_get_allocator(),
+ __rcs._M_grab(__rcs._M_get_allocator())) { }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ __rc_string_base<_CharT, _Traits, _Alloc>::
+ __rc_string_base(size_type __n, _CharT __c, const _Alloc& __a)
+ : _M_dataplus(__a, _S_construct(__n, __c, __a)) { }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ template<typename _InputIterator>
+ __rc_string_base<_CharT, _Traits, _Alloc>::
+ __rc_string_base(_InputIterator __beg, _InputIterator __end,
+ const _Alloc& __a)
+ : _M_dataplus(__a, _S_construct(__beg, __end, __a)) { }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ __rc_string_base<_CharT, _Traits, _Alloc>::
+ _M_leak_hard()
+ {
+ if (_M_is_shared())
+ _M_erase(0, 0);
+ _M_set_leaked();
+ }
+
+ // NB: This is the special case for Input Iterators, used in
+ // istreambuf_iterators, etc.
+ // Input Iterators have a cost structure very different from
+ // pointers, calling for a different coding style.
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ template<typename _InIterator>
+ _CharT*
+ __rc_string_base<_CharT, _Traits, _Alloc>::
+ _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a,
+ std::input_iterator_tag)
+ {
+ if (__beg == __end && __a == _Alloc())
+ return _S_empty_rep._M_refcopy();
+
+ // Avoid reallocation for common case.
+ _CharT __buf[128];
+ size_type __len = 0;
+ while (__beg != __end && __len < sizeof(__buf) / sizeof(_CharT))
+ {
+ __buf[__len++] = *__beg;
+ ++__beg;
+ }
+ _Rep* __r = _Rep::_S_create(__len, size_type(0), __a);
+ _S_copy(__r->_M_refdata(), __buf, __len);
+ __try
+ {
+ while (__beg != __end)
+ {
+ if (__len == __r->_M_info._M_capacity)
+ {
+ // Allocate more space.
+ _Rep* __another = _Rep::_S_create(__len + 1, __len, __a);
+ _S_copy(__another->_M_refdata(), __r->_M_refdata(), __len);
+ __r->_M_destroy(__a);
+ __r = __another;
+ }
+ __r->_M_refdata()[__len++] = *__beg;
+ ++__beg;
+ }
+ }
+ __catch(...)
+ {
+ __r->_M_destroy(__a);
+ __throw_exception_again;
+ }
+ __r->_M_set_length(__len);
+ return __r->_M_refdata();
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ template<typename _InIterator>
+ _CharT*
+ __rc_string_base<_CharT, _Traits, _Alloc>::
+ _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a,
+ std::forward_iterator_tag)
+ {
+ if (__beg == __end && __a == _Alloc())
+ return _S_empty_rep._M_refcopy();
+
+ // NB: Not required, but considered best practice.
+ if (__builtin_expect(__is_null_pointer(__beg) && __beg != __end, 0))
+ std::__throw_logic_error(__N("__rc_string_base::"
+ "_S_construct NULL not valid"));
+
+ const size_type __dnew = static_cast<size_type>(std::distance(__beg,
+ __end));
+ // Check for out_of_range and length_error exceptions.
+ _Rep* __r = _Rep::_S_create(__dnew, size_type(0), __a);
+ __try
+ { _S_copy_chars(__r->_M_refdata(), __beg, __end); }
+ __catch(...)
+ {
+ __r->_M_destroy(__a);
+ __throw_exception_again;
+ }
+ __r->_M_set_length(__dnew);
+ return __r->_M_refdata();
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ _CharT*
+ __rc_string_base<_CharT, _Traits, _Alloc>::
+ _S_construct(size_type __n, _CharT __c, const _Alloc& __a)
+ {
+ if (__n == 0 && __a == _Alloc())
+ return _S_empty_rep._M_refcopy();
+
+ // Check for out_of_range and length_error exceptions.
+ _Rep* __r = _Rep::_S_create(__n, size_type(0), __a);
+ if (__n)
+ _S_assign(__r->_M_refdata(), __n, __c);
+
+ __r->_M_set_length(__n);
+ return __r->_M_refdata();
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ __rc_string_base<_CharT, _Traits, _Alloc>::
+ _M_swap(__rc_string_base& __rcs)
+ {
+ if (_M_is_leaked())
+ _M_set_sharable();
+ if (__rcs._M_is_leaked())
+ __rcs._M_set_sharable();
+
+ _CharT* __tmp = _M_data();
+ _M_data(__rcs._M_data());
+ __rcs._M_data(__tmp);
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 431. Swapping containers with unequal allocators.
+ std::__alloc_swap<allocator_type>::_S_do_it(_M_get_allocator(),
+ __rcs._M_get_allocator());
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ __rc_string_base<_CharT, _Traits, _Alloc>::
+ _M_assign(const __rc_string_base& __rcs)
+ {
+ if (_M_rep() != __rcs._M_rep())
+ {
+ _CharT* __tmp = __rcs._M_grab(_M_get_allocator());
+ _M_dispose();
+ _M_data(__tmp);
+ }
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ __rc_string_base<_CharT, _Traits, _Alloc>::
+ _M_reserve(size_type __res)
+ {
+ // Make sure we don't shrink below the current size.
+ if (__res < _M_length())
+ __res = _M_length();
+
+ if (__res != _M_capacity() || _M_is_shared())
+ {
+ _CharT* __tmp = _M_rep()->_M_clone(_M_get_allocator(),
+ __res - _M_length());
+ _M_dispose();
+ _M_data(__tmp);
+ }
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ __rc_string_base<_CharT, _Traits, _Alloc>::
+ _M_mutate(size_type __pos, size_type __len1, const _CharT* __s,
+ size_type __len2)
+ {
+ const size_type __how_much = _M_length() - __pos - __len1;
+
+ _Rep* __r = _Rep::_S_create(_M_length() + __len2 - __len1,
+ _M_capacity(), _M_get_allocator());
+
+ if (__pos)
+ _S_copy(__r->_M_refdata(), _M_data(), __pos);
+ if (__s && __len2)
+ _S_copy(__r->_M_refdata() + __pos, __s, __len2);
+ if (__how_much)
+ _S_copy(__r->_M_refdata() + __pos + __len2,
+ _M_data() + __pos + __len1, __how_much);
+
+ _M_dispose();
+ _M_data(__r->_M_refdata());
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ __rc_string_base<_CharT, _Traits, _Alloc>::
+ _M_erase(size_type __pos, size_type __n)
+ {
+ const size_type __new_size = _M_length() - __n;
+ const size_type __how_much = _M_length() - __pos - __n;
+
+ if (_M_is_shared())
+ {
+ // Must reallocate.
+ _Rep* __r = _Rep::_S_create(__new_size, _M_capacity(),
+ _M_get_allocator());
+
+ if (__pos)
+ _S_copy(__r->_M_refdata(), _M_data(), __pos);
+ if (__how_much)
+ _S_copy(__r->_M_refdata() + __pos,
+ _M_data() + __pos + __n, __how_much);
+
+ _M_dispose();
+ _M_data(__r->_M_refdata());
+ }
+ else if (__how_much && __n)
+ {
+ // Work in-place.
+ _S_move(_M_data() + __pos,
+ _M_data() + __pos + __n, __how_much);
+ }
+
+ _M_rep()->_M_set_length(__new_size);
+ }
+
+ template<>
+ inline bool
+ __rc_string_base<char, std::char_traits<char>,
+ std::allocator<char> >::
+ _M_compare(const __rc_string_base& __rcs) const
+ {
+ if (_M_rep() == __rcs._M_rep())
+ return true;
+ return false;
+ }
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template<>
+ inline bool
+ __rc_string_base<wchar_t, std::char_traits<wchar_t>,
+ std::allocator<wchar_t> >::
+ _M_compare(const __rc_string_base& __rcs) const
+ {
+ if (_M_rep() == __rcs._M_rep())
+ return true;
+ return false;
+ }
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _RC_STRING_BASE_H */
diff --git a/i686-linux/include/c++/4.4.3/ext/rope b/i686-linux/include/c++/4.4.3/ext/rope
new file mode 100644
index 0000000..462c8f5
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/rope
@@ -0,0 +1,2958 @@
+// SGI's rope class -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file ext/rope
+ * This file is a GNU extension to the Standard C++ Library (possibly
+ * containing extensions from the HP/SGI STL subset).
+ */
+
+#ifndef _ROPE
+#define _ROPE 1
+
+#include <algorithm>
+#include <iosfwd>
+#include <bits/stl_construct.h>
+#include <bits/stl_uninitialized.h>
+#include <bits/stl_function.h>
+#include <bits/stl_numeric.h>
+#include <bits/allocator.h>
+#include <bits/gthr.h>
+#include <tr1/functional>
+
+# ifdef __GC
+# define __GC_CONST const
+# else
+# define __GC_CONST // constant except for deallocation
+# endif
+
+#include <ext/memory> // For uninitialized_copy_n
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ namespace __detail
+ {
+ enum { _S_max_rope_depth = 45 };
+ enum _Tag {_S_leaf, _S_concat, _S_substringfn, _S_function};
+ } // namespace __detail
+
+ using std::size_t;
+ using std::ptrdiff_t;
+ using std::allocator;
+ using std::_Destroy;
+
+ // See libstdc++/36832.
+ template<typename _ForwardIterator, typename _Allocator>
+ void
+ _Destroy_const(_ForwardIterator __first,
+ _ForwardIterator __last, _Allocator __alloc)
+ {
+ for (; __first != __last; ++__first)
+ __alloc.destroy(&*__first);
+ }
+
+ template<typename _ForwardIterator, typename _Tp>
+ inline void
+ _Destroy_const(_ForwardIterator __first,
+ _ForwardIterator __last, allocator<_Tp>)
+ { _Destroy(__first, __last); }
+
+ // The _S_eos function is used for those functions that
+ // convert to/from C-like strings to detect the end of the string.
+
+ // The end-of-C-string character.
+ // This is what the draft standard says it should be.
+ template <class _CharT>
+ inline _CharT
+ _S_eos(_CharT*)
+ { return _CharT(); }
+
+ // Test for basic character types.
+ // For basic character types leaves having a trailing eos.
+ template <class _CharT>
+ inline bool
+ _S_is_basic_char_type(_CharT*)
+ { return false; }
+
+ template <class _CharT>
+ inline bool
+ _S_is_one_byte_char_type(_CharT*)
+ { return false; }
+
+ inline bool
+ _S_is_basic_char_type(char*)
+ { return true; }
+
+ inline bool
+ _S_is_one_byte_char_type(char*)
+ { return true; }
+
+ inline bool
+ _S_is_basic_char_type(wchar_t*)
+ { return true; }
+
+ // Store an eos iff _CharT is a basic character type.
+ // Do not reference _S_eos if it isn't.
+ template <class _CharT>
+ inline void
+ _S_cond_store_eos(_CharT&) { }
+
+ inline void
+ _S_cond_store_eos(char& __c)
+ { __c = 0; }
+
+ inline void
+ _S_cond_store_eos(wchar_t& __c)
+ { __c = 0; }
+
+ // char_producers are logically functions that generate a section of
+ // a string. These can be converted to ropes. The resulting rope
+ // invokes the char_producer on demand. This allows, for example,
+ // files to be viewed as ropes without reading the entire file.
+ template <class _CharT>
+ class char_producer
+ {
+ public:
+ virtual ~char_producer() { };
+
+ virtual void
+ operator()(size_t __start_pos, size_t __len,
+ _CharT* __buffer) = 0;
+ // Buffer should really be an arbitrary output iterator.
+ // That way we could flatten directly into an ostream, etc.
+ // This is thoroughly impossible, since iterator types don't
+ // have runtime descriptions.
+ };
+
+ // Sequence buffers:
+ //
+ // Sequence must provide an append operation that appends an
+ // array to the sequence. Sequence buffers are useful only if
+ // appending an entire array is cheaper than appending element by element.
+ // This is true for many string representations.
+ // This should perhaps inherit from ostream<sequence::value_type>
+ // and be implemented correspondingly, so that they can be used
+ // for formatted. For the sake of portability, we don't do this yet.
+ //
+ // For now, sequence buffers behave as output iterators. But they also
+ // behave a little like basic_ostringstream<sequence::value_type> and a
+ // little like containers.
+
+ template<class _Sequence, size_t _Buf_sz = 100>
+ class sequence_buffer
+ : public std::iterator<std::output_iterator_tag, void, void, void, void>
+ {
+ public:
+ typedef typename _Sequence::value_type value_type;
+ protected:
+ _Sequence* _M_prefix;
+ value_type _M_buffer[_Buf_sz];
+ size_t _M_buf_count;
+ public:
+
+ void
+ flush()
+ {
+ _M_prefix->append(_M_buffer, _M_buffer + _M_buf_count);
+ _M_buf_count = 0;
+ }
+
+ ~sequence_buffer()
+ { flush(); }
+
+ sequence_buffer()
+ : _M_prefix(0), _M_buf_count(0) { }
+
+ sequence_buffer(const sequence_buffer& __x)
+ {
+ _M_prefix = __x._M_prefix;
+ _M_buf_count = __x._M_buf_count;
+ std::copy(__x._M_buffer, __x._M_buffer + __x._M_buf_count, _M_buffer);
+ }
+
+ sequence_buffer(sequence_buffer& __x)
+ {
+ __x.flush();
+ _M_prefix = __x._M_prefix;
+ _M_buf_count = 0;
+ }
+
+ sequence_buffer(_Sequence& __s)
+ : _M_prefix(&__s), _M_buf_count(0) { }
+
+ sequence_buffer&
+ operator=(sequence_buffer& __x)
+ {
+ __x.flush();
+ _M_prefix = __x._M_prefix;
+ _M_buf_count = 0;
+ return *this;
+ }
+
+ sequence_buffer&
+ operator=(const sequence_buffer& __x)
+ {
+ _M_prefix = __x._M_prefix;
+ _M_buf_count = __x._M_buf_count;
+ std::copy(__x._M_buffer, __x._M_buffer + __x._M_buf_count, _M_buffer);
+ return *this;
+ }
+
+ void
+ push_back(value_type __x)
+ {
+ if (_M_buf_count < _Buf_sz)
+ {
+ _M_buffer[_M_buf_count] = __x;
+ ++_M_buf_count;
+ }
+ else
+ {
+ flush();
+ _M_buffer[0] = __x;
+ _M_buf_count = 1;
+ }
+ }
+
+ void
+ append(value_type* __s, size_t __len)
+ {
+ if (__len + _M_buf_count <= _Buf_sz)
+ {
+ size_t __i = _M_buf_count;
+ for (size_t __j = 0; __j < __len; __i++, __j++)
+ _M_buffer[__i] = __s[__j];
+ _M_buf_count += __len;
+ }
+ else if (0 == _M_buf_count)
+ _M_prefix->append(__s, __s + __len);
+ else
+ {
+ flush();
+ append(__s, __len);
+ }
+ }
+
+ sequence_buffer&
+ write(value_type* __s, size_t __len)
+ {
+ append(__s, __len);
+ return *this;
+ }
+
+ sequence_buffer&
+ put(value_type __x)
+ {
+ push_back(__x);
+ return *this;
+ }
+
+ sequence_buffer&
+ operator=(const value_type& __rhs)
+ {
+ push_back(__rhs);
+ return *this;
+ }
+
+ sequence_buffer&
+ operator*()
+ { return *this; }
+
+ sequence_buffer&
+ operator++()
+ { return *this; }
+
+ sequence_buffer
+ operator++(int)
+ { return *this; }
+ };
+
+ // The following should be treated as private, at least for now.
+ template<class _CharT>
+ class _Rope_char_consumer
+ {
+ public:
+ // If we had member templates, these should not be virtual.
+ // For now we need to use run-time parametrization where
+ // compile-time would do. Hence this should all be private
+ // for now.
+ // The symmetry with char_producer is accidental and temporary.
+ virtual ~_Rope_char_consumer() { };
+
+ virtual bool
+ operator()(const _CharT* __buffer, size_t __len) = 0;
+ };
+
+ // First a lot of forward declarations. The standard seems to require
+ // much stricter "declaration before use" than many of the implementations
+ // that preceded it.
+ template<class _CharT, class _Alloc = allocator<_CharT> >
+ class rope;
+
+ template<class _CharT, class _Alloc>
+ struct _Rope_RopeConcatenation;
+
+ template<class _CharT, class _Alloc>
+ struct _Rope_RopeLeaf;
+
+ template<class _CharT, class _Alloc>
+ struct _Rope_RopeFunction;
+
+ template<class _CharT, class _Alloc>
+ struct _Rope_RopeSubstring;
+
+ template<class _CharT, class _Alloc>
+ class _Rope_iterator;
+
+ template<class _CharT, class _Alloc>
+ class _Rope_const_iterator;
+
+ template<class _CharT, class _Alloc>
+ class _Rope_char_ref_proxy;
+
+ template<class _CharT, class _Alloc>
+ class _Rope_char_ptr_proxy;
+
+ template<class _CharT, class _Alloc>
+ bool
+ operator==(const _Rope_char_ptr_proxy<_CharT, _Alloc>& __x,
+ const _Rope_char_ptr_proxy<_CharT, _Alloc>& __y);
+
+ template<class _CharT, class _Alloc>
+ _Rope_const_iterator<_CharT, _Alloc>
+ operator-(const _Rope_const_iterator<_CharT, _Alloc>& __x,
+ ptrdiff_t __n);
+
+ template<class _CharT, class _Alloc>
+ _Rope_const_iterator<_CharT, _Alloc>
+ operator+(const _Rope_const_iterator<_CharT, _Alloc>& __x,
+ ptrdiff_t __n);
+
+ template<class _CharT, class _Alloc>
+ _Rope_const_iterator<_CharT, _Alloc>
+ operator+(ptrdiff_t __n,
+ const _Rope_const_iterator<_CharT, _Alloc>& __x);
+
+ template<class _CharT, class _Alloc>
+ bool
+ operator==(const _Rope_const_iterator<_CharT, _Alloc>& __x,
+ const _Rope_const_iterator<_CharT, _Alloc>& __y);
+
+ template<class _CharT, class _Alloc>
+ bool
+ operator<(const _Rope_const_iterator<_CharT, _Alloc>& __x,
+ const _Rope_const_iterator<_CharT, _Alloc>& __y);
+
+ template<class _CharT, class _Alloc>
+ ptrdiff_t
+ operator-(const _Rope_const_iterator<_CharT, _Alloc>& __x,
+ const _Rope_const_iterator<_CharT, _Alloc>& __y);
+
+ template<class _CharT, class _Alloc>
+ _Rope_iterator<_CharT, _Alloc>
+ operator-(const _Rope_iterator<_CharT, _Alloc>& __x, ptrdiff_t __n);
+
+ template<class _CharT, class _Alloc>
+ _Rope_iterator<_CharT, _Alloc>
+ operator+(const _Rope_iterator<_CharT, _Alloc>& __x, ptrdiff_t __n);
+
+ template<class _CharT, class _Alloc>
+ _Rope_iterator<_CharT, _Alloc>
+ operator+(ptrdiff_t __n, const _Rope_iterator<_CharT, _Alloc>& __x);
+
+ template<class _CharT, class _Alloc>
+ bool
+ operator==(const _Rope_iterator<_CharT, _Alloc>& __x,
+ const _Rope_iterator<_CharT, _Alloc>& __y);
+
+ template<class _CharT, class _Alloc>
+ bool
+ operator<(const _Rope_iterator<_CharT, _Alloc>& __x,
+ const _Rope_iterator<_CharT, _Alloc>& __y);
+
+ template<class _CharT, class _Alloc>
+ ptrdiff_t
+ operator-(const _Rope_iterator<_CharT, _Alloc>& __x,
+ const _Rope_iterator<_CharT, _Alloc>& __y);
+
+ template<class _CharT, class _Alloc>
+ rope<_CharT, _Alloc>
+ operator+(const rope<_CharT, _Alloc>& __left,
+ const rope<_CharT, _Alloc>& __right);
+
+ template<class _CharT, class _Alloc>
+ rope<_CharT, _Alloc>
+ operator+(const rope<_CharT, _Alloc>& __left, const _CharT* __right);
+
+ template<class _CharT, class _Alloc>
+ rope<_CharT, _Alloc>
+ operator+(const rope<_CharT, _Alloc>& __left, _CharT __right);
+
+ // Some helpers, so we can use power on ropes.
+ // See below for why this isn't local to the implementation.
+
+ // This uses a nonstandard refcount convention.
+ // The result has refcount 0.
+ template<class _CharT, class _Alloc>
+ struct _Rope_Concat_fn
+ : public std::binary_function<rope<_CharT, _Alloc>, rope<_CharT, _Alloc>,
+ rope<_CharT, _Alloc> >
+ {
+ rope<_CharT, _Alloc>
+ operator()(const rope<_CharT, _Alloc>& __x,
+ const rope<_CharT, _Alloc>& __y)
+ { return __x + __y; }
+ };
+
+ template <class _CharT, class _Alloc>
+ inline rope<_CharT, _Alloc>
+ identity_element(_Rope_Concat_fn<_CharT, _Alloc>)
+ { return rope<_CharT, _Alloc>(); }
+
+ // Class _Refcount_Base provides a type, _RC_t, a data member,
+ // _M_ref_count, and member functions _M_incr and _M_decr, which perform
+ // atomic preincrement/predecrement. The constructor initializes
+ // _M_ref_count.
+ struct _Refcount_Base
+ {
+ // The type _RC_t
+ typedef size_t _RC_t;
+
+ // The data member _M_ref_count
+ volatile _RC_t _M_ref_count;
+
+ // Constructor
+ __gthread_mutex_t _M_ref_count_lock;
+
+ _Refcount_Base(_RC_t __n) : _M_ref_count(__n), _M_ref_count_lock()
+ {
+#ifdef __GTHREAD_MUTEX_INIT
+ __gthread_mutex_t __tmp = __GTHREAD_MUTEX_INIT;
+ _M_ref_count_lock = __tmp;
+#elif defined(__GTHREAD_MUTEX_INIT_FUNCTION)
+ __GTHREAD_MUTEX_INIT_FUNCTION (&_M_ref_count_lock);
+#else
+#error __GTHREAD_MUTEX_INIT or __GTHREAD_MUTEX_INIT_FUNCTION should be defined by gthr.h abstraction layer, report problem to libstdc++@gcc.gnu.org.
+#endif
+ }
+
+ void
+ _M_incr()
+ {
+ __gthread_mutex_lock(&_M_ref_count_lock);
+ ++_M_ref_count;
+ __gthread_mutex_unlock(&_M_ref_count_lock);
+ }
+
+ _RC_t
+ _M_decr()
+ {
+ __gthread_mutex_lock(&_M_ref_count_lock);
+ volatile _RC_t __tmp = --_M_ref_count;
+ __gthread_mutex_unlock(&_M_ref_count_lock);
+ return __tmp;
+ }
+ };
+
+ //
+ // What follows should really be local to rope. Unfortunately,
+ // that doesn't work, since it makes it impossible to define generic
+ // equality on rope iterators. According to the draft standard, the
+ // template parameters for such an equality operator cannot be inferred
+ // from the occurrence of a member class as a parameter.
+ // (SGI compilers in fact allow this, but the __result wouldn't be
+ // portable.)
+ // Similarly, some of the static member functions are member functions
+ // only to avoid polluting the global namespace, and to circumvent
+ // restrictions on type inference for template functions.
+ //
+
+ //
+ // The internal data structure for representing a rope. This is
+ // private to the implementation. A rope is really just a pointer
+ // to one of these.
+ //
+ // A few basic functions for manipulating this data structure
+ // are members of _RopeRep. Most of the more complex algorithms
+ // are implemented as rope members.
+ //
+ // Some of the static member functions of _RopeRep have identically
+ // named functions in rope that simply invoke the _RopeRep versions.
+
+#define __ROPE_DEFINE_ALLOCS(__a) \
+ __ROPE_DEFINE_ALLOC(_CharT,_Data) /* character data */ \
+ typedef _Rope_RopeConcatenation<_CharT,__a> __C; \
+ __ROPE_DEFINE_ALLOC(__C,_C) \
+ typedef _Rope_RopeLeaf<_CharT,__a> __L; \
+ __ROPE_DEFINE_ALLOC(__L,_L) \
+ typedef _Rope_RopeFunction<_CharT,__a> __F; \
+ __ROPE_DEFINE_ALLOC(__F,_F) \
+ typedef _Rope_RopeSubstring<_CharT,__a> __S; \
+ __ROPE_DEFINE_ALLOC(__S,_S)
+
+ // Internal rope nodes potentially store a copy of the allocator
+ // instance used to allocate them. This is mostly redundant.
+ // But the alternative would be to pass allocator instances around
+ // in some form to nearly all internal functions, since any pointer
+ // assignment may result in a zero reference count and thus require
+ // deallocation.
+
+#define __STATIC_IF_SGI_ALLOC /* not static */
+
+ template <class _CharT, class _Alloc>
+ struct _Rope_rep_base
+ : public _Alloc
+ {
+ typedef _Alloc allocator_type;
+
+ allocator_type
+ get_allocator() const
+ { return *static_cast<const _Alloc*>(this); }
+
+ allocator_type&
+ _M_get_allocator()
+ { return *static_cast<_Alloc*>(this); }
+
+ const allocator_type&
+ _M_get_allocator() const
+ { return *static_cast<const _Alloc*>(this); }
+
+ _Rope_rep_base(size_t __size, const allocator_type&)
+ : _M_size(__size) { }
+
+ size_t _M_size;
+
+# define __ROPE_DEFINE_ALLOC(_Tp, __name) \
+ typedef typename \
+ _Alloc::template rebind<_Tp>::other __name##Alloc; \
+ static _Tp* __name##_allocate(size_t __n) \
+ { return __name##Alloc().allocate(__n); } \
+ static void __name##_deallocate(_Tp *__p, size_t __n) \
+ { __name##Alloc().deallocate(__p, __n); }
+ __ROPE_DEFINE_ALLOCS(_Alloc)
+# undef __ROPE_DEFINE_ALLOC
+ };
+
+ template<class _CharT, class _Alloc>
+ struct _Rope_RopeRep
+ : public _Rope_rep_base<_CharT, _Alloc>
+# ifndef __GC
+ , _Refcount_Base
+# endif
+ {
+ public:
+ __detail::_Tag _M_tag:8;
+ bool _M_is_balanced:8;
+ unsigned char _M_depth;
+ __GC_CONST _CharT* _M_c_string;
+ __gthread_mutex_t _M_c_string_lock;
+ /* Flattened version of string, if needed. */
+ /* typically 0. */
+ /* If it's not 0, then the memory is owned */
+ /* by this node. */
+ /* In the case of a leaf, this may point to */
+ /* the same memory as the data field. */
+ typedef typename _Rope_rep_base<_CharT, _Alloc>::allocator_type
+ allocator_type;
+
+ using _Rope_rep_base<_CharT, _Alloc>::get_allocator;
+ using _Rope_rep_base<_CharT, _Alloc>::_M_get_allocator;
+
+ _Rope_RopeRep(__detail::_Tag __t, int __d, bool __b, size_t __size,
+ const allocator_type& __a)
+ : _Rope_rep_base<_CharT, _Alloc>(__size, __a),
+#ifndef __GC
+ _Refcount_Base(1),
+#endif
+ _M_tag(__t), _M_is_balanced(__b), _M_depth(__d), _M_c_string(0)
+#ifdef __GTHREAD_MUTEX_INIT
+ {
+ // Do not copy a POSIX/gthr mutex once in use. However, bits are bits.
+ __gthread_mutex_t __tmp = __GTHREAD_MUTEX_INIT;
+ _M_c_string_lock = __tmp;
+ }
+#else
+ { __GTHREAD_MUTEX_INIT_FUNCTION (&_M_c_string_lock); }
+#endif
+#ifdef __GC
+ void
+ _M_incr () { }
+#endif
+ static void
+ _S_free_string(__GC_CONST _CharT*, size_t __len,
+ allocator_type& __a);
+#define __STL_FREE_STRING(__s, __l, __a) _S_free_string(__s, __l, __a);
+ // Deallocate data section of a leaf.
+ // This shouldn't be a member function.
+ // But its hard to do anything else at the
+ // moment, because it's templatized w.r.t.
+ // an allocator.
+ // Does nothing if __GC is defined.
+#ifndef __GC
+ void _M_free_c_string();
+ void _M_free_tree();
+ // Deallocate t. Assumes t is not 0.
+ void
+ _M_unref_nonnil()
+ {
+ if (0 == _M_decr())
+ _M_free_tree();
+ }
+
+ void
+ _M_ref_nonnil()
+ { _M_incr(); }
+
+ static void
+ _S_unref(_Rope_RopeRep* __t)
+ {
+ if (0 != __t)
+ __t->_M_unref_nonnil();
+ }
+
+ static void
+ _S_ref(_Rope_RopeRep* __t)
+ {
+ if (0 != __t)
+ __t->_M_incr();
+ }
+
+ static void
+ _S_free_if_unref(_Rope_RopeRep* __t)
+ {
+ if (0 != __t && 0 == __t->_M_ref_count)
+ __t->_M_free_tree();
+ }
+# else /* __GC */
+ void _M_unref_nonnil() { }
+ void _M_ref_nonnil() { }
+ static void _S_unref(_Rope_RopeRep*) { }
+ static void _S_ref(_Rope_RopeRep*) { }
+ static void _S_free_if_unref(_Rope_RopeRep*) { }
+# endif
+protected:
+ _Rope_RopeRep&
+ operator=(const _Rope_RopeRep&);
+
+ _Rope_RopeRep(const _Rope_RopeRep&);
+ };
+
+ template<class _CharT, class _Alloc>
+ struct _Rope_RopeLeaf
+ : public _Rope_RopeRep<_CharT, _Alloc>
+ {
+ public:
+ // Apparently needed by VC++
+ // The data fields of leaves are allocated with some
+ // extra space, to accommodate future growth and for basic
+ // character types, to hold a trailing eos character.
+ enum { _S_alloc_granularity = 8 };
+
+ static size_t
+ _S_rounded_up_size(size_t __n)
+ {
+ size_t __size_with_eos;
+
+ if (_S_is_basic_char_type((_CharT*)0))
+ __size_with_eos = __n + 1;
+ else
+ __size_with_eos = __n;
+#ifdef __GC
+ return __size_with_eos;
+#else
+ // Allow slop for in-place expansion.
+ return ((__size_with_eos + size_t(_S_alloc_granularity) - 1)
+ &~ (size_t(_S_alloc_granularity) - 1));
+#endif
+ }
+ __GC_CONST _CharT* _M_data; /* Not necessarily 0 terminated. */
+ /* The allocated size is */
+ /* _S_rounded_up_size(size), except */
+ /* in the GC case, in which it */
+ /* doesn't matter. */
+ typedef typename _Rope_rep_base<_CharT,_Alloc>::allocator_type
+ allocator_type;
+
+ _Rope_RopeLeaf(__GC_CONST _CharT* __d, size_t __size,
+ const allocator_type& __a)
+ : _Rope_RopeRep<_CharT, _Alloc>(__detail::_S_leaf, 0, true,
+ __size, __a), _M_data(__d)
+ {
+ if (_S_is_basic_char_type((_CharT *)0))
+ {
+ // already eos terminated.
+ this->_M_c_string = __d;
+ }
+ }
+ // The constructor assumes that d has been allocated with
+ // the proper allocator and the properly padded size.
+ // In contrast, the destructor deallocates the data:
+#ifndef __GC
+ ~_Rope_RopeLeaf() throw()
+ {
+ if (_M_data != this->_M_c_string)
+ this->_M_free_c_string();
+
+ __STL_FREE_STRING(_M_data, this->_M_size, this->_M_get_allocator());
+ }
+#endif
+protected:
+ _Rope_RopeLeaf&
+ operator=(const _Rope_RopeLeaf&);
+
+ _Rope_RopeLeaf(const _Rope_RopeLeaf&);
+ };
+
+ template<class _CharT, class _Alloc>
+ struct _Rope_RopeConcatenation
+ : public _Rope_RopeRep<_CharT, _Alloc>
+ {
+ public:
+ _Rope_RopeRep<_CharT, _Alloc>* _M_left;
+ _Rope_RopeRep<_CharT, _Alloc>* _M_right;
+
+ typedef typename _Rope_rep_base<_CharT, _Alloc>::allocator_type
+ allocator_type;
+
+ _Rope_RopeConcatenation(_Rope_RopeRep<_CharT, _Alloc>* __l,
+ _Rope_RopeRep<_CharT, _Alloc>* __r,
+ const allocator_type& __a)
+ : _Rope_RopeRep<_CharT, _Alloc>(__detail::_S_concat,
+ std::max(__l->_M_depth,
+ __r->_M_depth) + 1,
+ false,
+ __l->_M_size + __r->_M_size, __a),
+ _M_left(__l), _M_right(__r)
+ { }
+#ifndef __GC
+ ~_Rope_RopeConcatenation() throw()
+ {
+ this->_M_free_c_string();
+ _M_left->_M_unref_nonnil();
+ _M_right->_M_unref_nonnil();
+ }
+#endif
+protected:
+ _Rope_RopeConcatenation&
+ operator=(const _Rope_RopeConcatenation&);
+
+ _Rope_RopeConcatenation(const _Rope_RopeConcatenation&);
+ };
+
+ template<class _CharT, class _Alloc>
+ struct _Rope_RopeFunction
+ : public _Rope_RopeRep<_CharT, _Alloc>
+ {
+ public:
+ char_producer<_CharT>* _M_fn;
+#ifndef __GC
+ bool _M_delete_when_done; // Char_producer is owned by the
+ // rope and should be explicitly
+ // deleted when the rope becomes
+ // inaccessible.
+#else
+ // In the GC case, we either register the rope for
+ // finalization, or not. Thus the field is unnecessary;
+ // the information is stored in the collector data structures.
+ // We do need a finalization procedure to be invoked by the
+ // collector.
+ static void
+ _S_fn_finalization_proc(void * __tree, void *)
+ { delete ((_Rope_RopeFunction *)__tree) -> _M_fn; }
+#endif
+ typedef typename _Rope_rep_base<_CharT, _Alloc>::allocator_type
+ allocator_type;
+
+ _Rope_RopeFunction(char_producer<_CharT>* __f, size_t __size,
+ bool __d, const allocator_type& __a)
+ : _Rope_RopeRep<_CharT, _Alloc>(__detail::_S_function, 0, true, __size, __a)
+ , _M_fn(__f)
+#ifndef __GC
+ , _M_delete_when_done(__d)
+#endif
+ {
+#ifdef __GC
+ if (__d)
+ {
+ GC_REGISTER_FINALIZER(this, _Rope_RopeFunction::
+ _S_fn_finalization_proc, 0, 0, 0);
+ }
+#endif
+ }
+#ifndef __GC
+ ~_Rope_RopeFunction() throw()
+ {
+ this->_M_free_c_string();
+ if (_M_delete_when_done)
+ delete _M_fn;
+ }
+# endif
+ protected:
+ _Rope_RopeFunction&
+ operator=(const _Rope_RopeFunction&);
+
+ _Rope_RopeFunction(const _Rope_RopeFunction&);
+ };
+ // Substring results are usually represented using just
+ // concatenation nodes. But in the case of very long flat ropes
+ // or ropes with a functional representation that isn't practical.
+ // In that case, we represent the __result as a special case of
+ // RopeFunction, whose char_producer points back to the rope itself.
+ // In all cases except repeated substring operations and
+ // deallocation, we treat the __result as a RopeFunction.
+ template<class _CharT, class _Alloc>
+ struct _Rope_RopeSubstring
+ : public _Rope_RopeFunction<_CharT, _Alloc>,
+ public char_producer<_CharT>
+ {
+ public:
+ // XXX this whole class should be rewritten.
+ _Rope_RopeRep<_CharT,_Alloc>* _M_base; // not 0
+ size_t _M_start;
+
+ virtual void
+ operator()(size_t __start_pos, size_t __req_len,
+ _CharT* __buffer)
+ {
+ switch(_M_base->_M_tag)
+ {
+ case __detail::_S_function:
+ case __detail::_S_substringfn:
+ {
+ char_producer<_CharT>* __fn =
+ ((_Rope_RopeFunction<_CharT,_Alloc>*)_M_base)->_M_fn;
+ (*__fn)(__start_pos + _M_start, __req_len, __buffer);
+ }
+ break;
+ case __detail::_S_leaf:
+ {
+ __GC_CONST _CharT* __s =
+ ((_Rope_RopeLeaf<_CharT,_Alloc>*)_M_base)->_M_data;
+ uninitialized_copy_n(__s + __start_pos + _M_start, __req_len,
+ __buffer);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ typedef typename _Rope_rep_base<_CharT, _Alloc>::allocator_type
+ allocator_type;
+
+ _Rope_RopeSubstring(_Rope_RopeRep<_CharT, _Alloc>* __b, size_t __s,
+ size_t __l, const allocator_type& __a)
+ : _Rope_RopeFunction<_CharT, _Alloc>(this, __l, false, __a),
+ char_producer<_CharT>(), _M_base(__b), _M_start(__s)
+ {
+#ifndef __GC
+ _M_base->_M_ref_nonnil();
+#endif
+ this->_M_tag = __detail::_S_substringfn;
+ }
+ virtual ~_Rope_RopeSubstring() throw()
+ {
+#ifndef __GC
+ _M_base->_M_unref_nonnil();
+ // _M_free_c_string(); -- done by parent class
+#endif
+ }
+ };
+
+ // Self-destructing pointers to Rope_rep.
+ // These are not conventional smart pointers. Their
+ // only purpose in life is to ensure that unref is called
+ // on the pointer either at normal exit or if an exception
+ // is raised. It is the caller's responsibility to
+ // adjust reference counts when these pointers are initialized
+ // or assigned to. (This convention significantly reduces
+ // the number of potentially expensive reference count
+ // updates.)
+#ifndef __GC
+ template<class _CharT, class _Alloc>
+ struct _Rope_self_destruct_ptr
+ {
+ _Rope_RopeRep<_CharT, _Alloc>* _M_ptr;
+
+ ~_Rope_self_destruct_ptr()
+ { _Rope_RopeRep<_CharT, _Alloc>::_S_unref(_M_ptr); }
+#ifdef __EXCEPTIONS
+ _Rope_self_destruct_ptr() : _M_ptr(0) { };
+#else
+ _Rope_self_destruct_ptr() { };
+#endif
+ _Rope_self_destruct_ptr(_Rope_RopeRep<_CharT, _Alloc>* __p)
+ : _M_ptr(__p) { }
+
+ _Rope_RopeRep<_CharT, _Alloc>&
+ operator*()
+ { return *_M_ptr; }
+
+ _Rope_RopeRep<_CharT, _Alloc>*
+ operator->()
+ { return _M_ptr; }
+
+ operator _Rope_RopeRep<_CharT, _Alloc>*()
+ { return _M_ptr; }
+
+ _Rope_self_destruct_ptr&
+ operator=(_Rope_RopeRep<_CharT, _Alloc>* __x)
+ { _M_ptr = __x; return *this; }
+ };
+#endif
+
+ // Dereferencing a nonconst iterator has to return something
+ // that behaves almost like a reference. It's not possible to
+ // return an actual reference since assignment requires extra
+ // work. And we would get into the same problems as with the
+ // CD2 version of basic_string.
+ template<class _CharT, class _Alloc>
+ class _Rope_char_ref_proxy
+ {
+ friend class rope<_CharT, _Alloc>;
+ friend class _Rope_iterator<_CharT, _Alloc>;
+ friend class _Rope_char_ptr_proxy<_CharT, _Alloc>;
+#ifdef __GC
+ typedef _Rope_RopeRep<_CharT, _Alloc>* _Self_destruct_ptr;
+#else
+ typedef _Rope_self_destruct_ptr<_CharT, _Alloc> _Self_destruct_ptr;
+#endif
+ typedef _Rope_RopeRep<_CharT, _Alloc> _RopeRep;
+ typedef rope<_CharT, _Alloc> _My_rope;
+ size_t _M_pos;
+ _CharT _M_current;
+ bool _M_current_valid;
+ _My_rope* _M_root; // The whole rope.
+ public:
+ _Rope_char_ref_proxy(_My_rope* __r, size_t __p)
+ : _M_pos(__p), _M_current(), _M_current_valid(false), _M_root(__r) { }
+
+ _Rope_char_ref_proxy(const _Rope_char_ref_proxy& __x)
+ : _M_pos(__x._M_pos), _M_current(__x._M_current),
+ _M_current_valid(false), _M_root(__x._M_root) { }
+
+ // Don't preserve cache if the reference can outlive the
+ // expression. We claim that's not possible without calling
+ // a copy constructor or generating reference to a proxy
+ // reference. We declare the latter to have undefined semantics.
+ _Rope_char_ref_proxy(_My_rope* __r, size_t __p, _CharT __c)
+ : _M_pos(__p), _M_current(__c), _M_current_valid(true), _M_root(__r) { }
+
+ inline operator _CharT () const;
+
+ _Rope_char_ref_proxy&
+ operator=(_CharT __c);
+
+ _Rope_char_ptr_proxy<_CharT, _Alloc> operator&() const;
+
+ _Rope_char_ref_proxy&
+ operator=(const _Rope_char_ref_proxy& __c)
+ { return operator=((_CharT)__c); }
+ };
+
+ template<class _CharT, class __Alloc>
+ inline void
+ swap(_Rope_char_ref_proxy <_CharT, __Alloc > __a,
+ _Rope_char_ref_proxy <_CharT, __Alloc > __b)
+ {
+ _CharT __tmp = __a;
+ __a = __b;
+ __b = __tmp;
+ }
+
+ template<class _CharT, class _Alloc>
+ class _Rope_char_ptr_proxy
+ {
+ // XXX this class should be rewritten.
+ friend class _Rope_char_ref_proxy<_CharT, _Alloc>;
+ size_t _M_pos;
+ rope<_CharT,_Alloc>* _M_root; // The whole rope.
+ public:
+ _Rope_char_ptr_proxy(const _Rope_char_ref_proxy<_CharT,_Alloc>& __x)
+ : _M_pos(__x._M_pos), _M_root(__x._M_root) { }
+
+ _Rope_char_ptr_proxy(const _Rope_char_ptr_proxy& __x)
+ : _M_pos(__x._M_pos), _M_root(__x._M_root) { }
+
+ _Rope_char_ptr_proxy() { }
+
+ _Rope_char_ptr_proxy(_CharT* __x)
+ : _M_root(0), _M_pos(0) { }
+
+ _Rope_char_ptr_proxy&
+ operator=(const _Rope_char_ptr_proxy& __x)
+ {
+ _M_pos = __x._M_pos;
+ _M_root = __x._M_root;
+ return *this;
+ }
+
+ template<class _CharT2, class _Alloc2>
+ friend bool
+ operator==(const _Rope_char_ptr_proxy<_CharT2, _Alloc2>& __x,
+ const _Rope_char_ptr_proxy<_CharT2, _Alloc2>& __y);
+
+ _Rope_char_ref_proxy<_CharT, _Alloc> operator*() const
+ { return _Rope_char_ref_proxy<_CharT, _Alloc>(_M_root, _M_pos); }
+ };
+
+ // Rope iterators:
+ // Unlike in the C version, we cache only part of the stack
+ // for rope iterators, since they must be efficiently copyable.
+ // When we run out of cache, we have to reconstruct the iterator
+ // value.
+ // Pointers from iterators are not included in reference counts.
+ // Iterators are assumed to be thread private. Ropes can
+ // be shared.
+
+ template<class _CharT, class _Alloc>
+ class _Rope_iterator_base
+ : public std::iterator<std::random_access_iterator_tag, _CharT>
+ {
+ friend class rope<_CharT, _Alloc>;
+ public:
+ typedef _Alloc _allocator_type; // used in _Rope_rotate, VC++ workaround
+ typedef _Rope_RopeRep<_CharT, _Alloc> _RopeRep;
+ // Borland doesn't want this to be protected.
+ protected:
+ enum { _S_path_cache_len = 4 }; // Must be <= 9.
+ enum { _S_iterator_buf_len = 15 };
+ size_t _M_current_pos;
+ _RopeRep* _M_root; // The whole rope.
+ size_t _M_leaf_pos; // Starting position for current leaf
+ __GC_CONST _CharT* _M_buf_start;
+ // Buffer possibly
+ // containing current char.
+ __GC_CONST _CharT* _M_buf_ptr;
+ // Pointer to current char in buffer.
+ // != 0 ==> buffer valid.
+ __GC_CONST _CharT* _M_buf_end;
+ // One past __last valid char in buffer.
+ // What follows is the path cache. We go out of our
+ // way to make this compact.
+ // Path_end contains the bottom section of the path from
+ // the root to the current leaf.
+ const _RopeRep* _M_path_end[_S_path_cache_len];
+ int _M_leaf_index; // Last valid __pos in path_end;
+ // _M_path_end[0] ... _M_path_end[leaf_index-1]
+ // point to concatenation nodes.
+ unsigned char _M_path_directions;
+ // (path_directions >> __i) & 1 is 1
+ // iff we got from _M_path_end[leaf_index - __i - 1]
+ // to _M_path_end[leaf_index - __i] by going to the
+ // __right. Assumes path_cache_len <= 9.
+ _CharT _M_tmp_buf[_S_iterator_buf_len];
+ // Short buffer for surrounding chars.
+ // This is useful primarily for
+ // RopeFunctions. We put the buffer
+ // here to avoid locking in the
+ // multithreaded case.
+ // The cached path is generally assumed to be valid
+ // only if the buffer is valid.
+ static void _S_setbuf(_Rope_iterator_base& __x);
+ // Set buffer contents given
+ // path cache.
+ static void _S_setcache(_Rope_iterator_base& __x);
+ // Set buffer contents and
+ // path cache.
+ static void _S_setcache_for_incr(_Rope_iterator_base& __x);
+ // As above, but assumes path
+ // cache is valid for previous posn.
+ _Rope_iterator_base() { }
+
+ _Rope_iterator_base(_RopeRep* __root, size_t __pos)
+ : _M_current_pos(__pos), _M_root(__root), _M_buf_ptr(0) { }
+
+ void _M_incr(size_t __n);
+ void _M_decr(size_t __n);
+ public:
+ size_t
+ index() const
+ { return _M_current_pos; }
+
+ _Rope_iterator_base(const _Rope_iterator_base& __x)
+ {
+ if (0 != __x._M_buf_ptr)
+ *this = __x;
+ else
+ {
+ _M_current_pos = __x._M_current_pos;
+ _M_root = __x._M_root;
+ _M_buf_ptr = 0;
+ }
+ }
+ };
+
+ template<class _CharT, class _Alloc>
+ class _Rope_iterator;
+
+ template<class _CharT, class _Alloc>
+ class _Rope_const_iterator
+ : public _Rope_iterator_base<_CharT, _Alloc>
+ {
+ friend class rope<_CharT, _Alloc>;
+ protected:
+ typedef _Rope_RopeRep<_CharT, _Alloc> _RopeRep;
+ // The one from the base class may not be directly visible.
+ _Rope_const_iterator(const _RopeRep* __root, size_t __pos)
+ : _Rope_iterator_base<_CharT, _Alloc>(const_cast<_RopeRep*>(__root),
+ __pos)
+ // Only nonconst iterators modify root ref count
+ { }
+ public:
+ typedef _CharT reference; // Really a value. Returning a reference
+ // Would be a mess, since it would have
+ // to be included in refcount.
+ typedef const _CharT* pointer;
+
+ public:
+ _Rope_const_iterator() { };
+
+ _Rope_const_iterator(const _Rope_const_iterator& __x)
+ : _Rope_iterator_base<_CharT,_Alloc>(__x) { }
+
+ _Rope_const_iterator(const _Rope_iterator<_CharT,_Alloc>& __x);
+
+ _Rope_const_iterator(const rope<_CharT, _Alloc>& __r, size_t __pos)
+ : _Rope_iterator_base<_CharT,_Alloc>(__r._M_tree_ptr, __pos) { }
+
+ _Rope_const_iterator&
+ operator=(const _Rope_const_iterator& __x)
+ {
+ if (0 != __x._M_buf_ptr)
+ *(static_cast<_Rope_iterator_base<_CharT, _Alloc>*>(this)) = __x;
+ else
+ {
+ this->_M_current_pos = __x._M_current_pos;
+ this->_M_root = __x._M_root;
+ this->_M_buf_ptr = 0;
+ }
+ return(*this);
+ }
+
+ reference
+ operator*()
+ {
+ if (0 == this->_M_buf_ptr)
+ _S_setcache(*this);
+ return *this->_M_buf_ptr;
+ }
+
+ // Without this const version, Rope iterators do not meet the
+ // requirements of an Input Iterator.
+ reference
+ operator*() const
+ {
+ return *const_cast<_Rope_const_iterator&>(*this);
+ }
+
+ _Rope_const_iterator&
+ operator++()
+ {
+ __GC_CONST _CharT* __next;
+ if (0 != this->_M_buf_ptr
+ && (__next = this->_M_buf_ptr + 1) < this->_M_buf_end)
+ {
+ this->_M_buf_ptr = __next;
+ ++this->_M_current_pos;
+ }
+ else
+ this->_M_incr(1);
+ return *this;
+ }
+
+ _Rope_const_iterator&
+ operator+=(ptrdiff_t __n)
+ {
+ if (__n >= 0)
+ this->_M_incr(__n);
+ else
+ this->_M_decr(-__n);
+ return *this;
+ }
+
+ _Rope_const_iterator&
+ operator--()
+ {
+ this->_M_decr(1);
+ return *this;
+ }
+
+ _Rope_const_iterator&
+ operator-=(ptrdiff_t __n)
+ {
+ if (__n >= 0)
+ this->_M_decr(__n);
+ else
+ this->_M_incr(-__n);
+ return *this;
+ }
+
+ _Rope_const_iterator
+ operator++(int)
+ {
+ size_t __old_pos = this->_M_current_pos;
+ this->_M_incr(1);
+ return _Rope_const_iterator<_CharT,_Alloc>(this->_M_root, __old_pos);
+ // This makes a subsequent dereference expensive.
+ // Perhaps we should instead copy the iterator
+ // if it has a valid cache?
+ }
+
+ _Rope_const_iterator
+ operator--(int)
+ {
+ size_t __old_pos = this->_M_current_pos;
+ this->_M_decr(1);
+ return _Rope_const_iterator<_CharT,_Alloc>(this->_M_root, __old_pos);
+ }
+
+ template<class _CharT2, class _Alloc2>
+ friend _Rope_const_iterator<_CharT2, _Alloc2>
+ operator-(const _Rope_const_iterator<_CharT2, _Alloc2>& __x,
+ ptrdiff_t __n);
+
+ template<class _CharT2, class _Alloc2>
+ friend _Rope_const_iterator<_CharT2, _Alloc2>
+ operator+(const _Rope_const_iterator<_CharT2, _Alloc2>& __x,
+ ptrdiff_t __n);
+
+ template<class _CharT2, class _Alloc2>
+ friend _Rope_const_iterator<_CharT2, _Alloc2>
+ operator+(ptrdiff_t __n,
+ const _Rope_const_iterator<_CharT2, _Alloc2>& __x);
+
+ reference
+ operator[](size_t __n)
+ { return rope<_CharT, _Alloc>::_S_fetch(this->_M_root,
+ this->_M_current_pos + __n); }
+
+ template<class _CharT2, class _Alloc2>
+ friend bool
+ operator==(const _Rope_const_iterator<_CharT2, _Alloc2>& __x,
+ const _Rope_const_iterator<_CharT2, _Alloc2>& __y);
+
+ template<class _CharT2, class _Alloc2>
+ friend bool
+ operator<(const _Rope_const_iterator<_CharT2, _Alloc2>& __x,
+ const _Rope_const_iterator<_CharT2, _Alloc2>& __y);
+
+ template<class _CharT2, class _Alloc2>
+ friend ptrdiff_t
+ operator-(const _Rope_const_iterator<_CharT2, _Alloc2>& __x,
+ const _Rope_const_iterator<_CharT2, _Alloc2>& __y);
+ };
+
+ template<class _CharT, class _Alloc>
+ class _Rope_iterator
+ : public _Rope_iterator_base<_CharT, _Alloc>
+ {
+ friend class rope<_CharT, _Alloc>;
+ protected:
+ typedef typename _Rope_iterator_base<_CharT, _Alloc>::_RopeRep _RopeRep;
+ rope<_CharT, _Alloc>* _M_root_rope;
+
+ // root is treated as a cached version of this, and is used to
+ // detect changes to the underlying rope.
+
+ // Root is included in the reference count. This is necessary
+ // so that we can detect changes reliably. Unfortunately, it
+ // requires careful bookkeeping for the nonGC case.
+ _Rope_iterator(rope<_CharT, _Alloc>* __r, size_t __pos)
+ : _Rope_iterator_base<_CharT, _Alloc>(__r->_M_tree_ptr, __pos),
+ _M_root_rope(__r)
+ { _RopeRep::_S_ref(this->_M_root);
+ if (!(__r -> empty()))
+ _S_setcache(*this);
+ }
+
+ void _M_check();
+ public:
+ typedef _Rope_char_ref_proxy<_CharT, _Alloc> reference;
+ typedef _Rope_char_ref_proxy<_CharT, _Alloc>* pointer;
+
+ rope<_CharT, _Alloc>&
+ container()
+ { return *_M_root_rope; }
+
+ _Rope_iterator()
+ {
+ this->_M_root = 0; // Needed for reference counting.
+ };
+
+ _Rope_iterator(const _Rope_iterator& __x)
+ : _Rope_iterator_base<_CharT, _Alloc>(__x)
+ {
+ _M_root_rope = __x._M_root_rope;
+ _RopeRep::_S_ref(this->_M_root);
+ }
+
+ _Rope_iterator(rope<_CharT, _Alloc>& __r, size_t __pos);
+
+ ~_Rope_iterator()
+ { _RopeRep::_S_unref(this->_M_root); }
+
+ _Rope_iterator&
+ operator=(const _Rope_iterator& __x)
+ {
+ _RopeRep* __old = this->_M_root;
+
+ _RopeRep::_S_ref(__x._M_root);
+ if (0 != __x._M_buf_ptr)
+ {
+ _M_root_rope = __x._M_root_rope;
+ *(static_cast<_Rope_iterator_base<_CharT, _Alloc>*>(this)) = __x;
+ }
+ else
+ {
+ this->_M_current_pos = __x._M_current_pos;
+ this->_M_root = __x._M_root;
+ _M_root_rope = __x._M_root_rope;
+ this->_M_buf_ptr = 0;
+ }
+ _RopeRep::_S_unref(__old);
+ return(*this);
+ }
+
+ reference
+ operator*()
+ {
+ _M_check();
+ if (0 == this->_M_buf_ptr)
+ return _Rope_char_ref_proxy<_CharT, _Alloc>(_M_root_rope,
+ this->_M_current_pos);
+ else
+ return _Rope_char_ref_proxy<_CharT, _Alloc>(_M_root_rope,
+ this->_M_current_pos,
+ *this->_M_buf_ptr);
+ }
+
+ // See above comment.
+ reference
+ operator*() const
+ {
+ return *const_cast<_Rope_iterator&>(*this);
+ }
+
+ _Rope_iterator&
+ operator++()
+ {
+ this->_M_incr(1);
+ return *this;
+ }
+
+ _Rope_iterator&
+ operator+=(ptrdiff_t __n)
+ {
+ if (__n >= 0)
+ this->_M_incr(__n);
+ else
+ this->_M_decr(-__n);
+ return *this;
+ }
+
+ _Rope_iterator&
+ operator--()
+ {
+ this->_M_decr(1);
+ return *this;
+ }
+
+ _Rope_iterator&
+ operator-=(ptrdiff_t __n)
+ {
+ if (__n >= 0)
+ this->_M_decr(__n);
+ else
+ this->_M_incr(-__n);
+ return *this;
+ }
+
+ _Rope_iterator
+ operator++(int)
+ {
+ size_t __old_pos = this->_M_current_pos;
+ this->_M_incr(1);
+ return _Rope_iterator<_CharT,_Alloc>(_M_root_rope, __old_pos);
+ }
+
+ _Rope_iterator
+ operator--(int)
+ {
+ size_t __old_pos = this->_M_current_pos;
+ this->_M_decr(1);
+ return _Rope_iterator<_CharT,_Alloc>(_M_root_rope, __old_pos);
+ }
+
+ reference
+ operator[](ptrdiff_t __n)
+ { return _Rope_char_ref_proxy<_CharT, _Alloc>(_M_root_rope,
+ this->_M_current_pos
+ + __n); }
+
+ template<class _CharT2, class _Alloc2>
+ friend bool
+ operator==(const _Rope_iterator<_CharT2, _Alloc2>& __x,
+ const _Rope_iterator<_CharT2, _Alloc2>& __y);
+
+ template<class _CharT2, class _Alloc2>
+ friend bool
+ operator<(const _Rope_iterator<_CharT2, _Alloc2>& __x,
+ const _Rope_iterator<_CharT2, _Alloc2>& __y);
+
+ template<class _CharT2, class _Alloc2>
+ friend ptrdiff_t
+ operator-(const _Rope_iterator<_CharT2, _Alloc2>& __x,
+ const _Rope_iterator<_CharT2, _Alloc2>& __y);
+
+ template<class _CharT2, class _Alloc2>
+ friend _Rope_iterator<_CharT2, _Alloc2>
+ operator-(const _Rope_iterator<_CharT2, _Alloc2>& __x, ptrdiff_t __n);
+
+ template<class _CharT2, class _Alloc2>
+ friend _Rope_iterator<_CharT2, _Alloc2>
+ operator+(const _Rope_iterator<_CharT2, _Alloc2>& __x, ptrdiff_t __n);
+
+ template<class _CharT2, class _Alloc2>
+ friend _Rope_iterator<_CharT2, _Alloc2>
+ operator+(ptrdiff_t __n, const _Rope_iterator<_CharT2, _Alloc2>& __x);
+ };
+
+
+ template <class _CharT, class _Alloc>
+ struct _Rope_base
+ : public _Alloc
+ {
+ typedef _Alloc allocator_type;
+
+ allocator_type
+ get_allocator() const
+ { return *static_cast<const _Alloc*>(this); }
+
+ allocator_type&
+ _M_get_allocator()
+ { return *static_cast<_Alloc*>(this); }
+
+ const allocator_type&
+ _M_get_allocator() const
+ { return *static_cast<const _Alloc*>(this); }
+
+ typedef _Rope_RopeRep<_CharT, _Alloc> _RopeRep;
+ // The one in _Base may not be visible due to template rules.
+
+ _Rope_base(_RopeRep* __t, const allocator_type&)
+ : _M_tree_ptr(__t) { }
+
+ _Rope_base(const allocator_type&) { }
+
+ // The only data member of a rope:
+ _RopeRep *_M_tree_ptr;
+
+#define __ROPE_DEFINE_ALLOC(_Tp, __name) \
+ typedef typename \
+ _Alloc::template rebind<_Tp>::other __name##Alloc; \
+ static _Tp* __name##_allocate(size_t __n) \
+ { return __name##Alloc().allocate(__n); } \
+ static void __name##_deallocate(_Tp *__p, size_t __n) \
+ { __name##Alloc().deallocate(__p, __n); }
+ __ROPE_DEFINE_ALLOCS(_Alloc)
+#undef __ROPE_DEFINE_ALLOC
+
+ protected:
+ _Rope_base&
+ operator=(const _Rope_base&);
+
+ _Rope_base(const _Rope_base&);
+ };
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template <class _CharT, class _Alloc>
+ class rope : public _Rope_base<_CharT, _Alloc>
+ {
+ public:
+ typedef _CharT value_type;
+ typedef ptrdiff_t difference_type;
+ typedef size_t size_type;
+ typedef _CharT const_reference;
+ typedef const _CharT* const_pointer;
+ typedef _Rope_iterator<_CharT, _Alloc> iterator;
+ typedef _Rope_const_iterator<_CharT, _Alloc> const_iterator;
+ typedef _Rope_char_ref_proxy<_CharT, _Alloc> reference;
+ typedef _Rope_char_ptr_proxy<_CharT, _Alloc> pointer;
+
+ friend class _Rope_iterator<_CharT, _Alloc>;
+ friend class _Rope_const_iterator<_CharT, _Alloc>;
+ friend struct _Rope_RopeRep<_CharT, _Alloc>;
+ friend class _Rope_iterator_base<_CharT, _Alloc>;
+ friend class _Rope_char_ptr_proxy<_CharT, _Alloc>;
+ friend class _Rope_char_ref_proxy<_CharT, _Alloc>;
+ friend struct _Rope_RopeSubstring<_CharT, _Alloc>;
+
+ protected:
+ typedef _Rope_base<_CharT, _Alloc> _Base;
+ typedef typename _Base::allocator_type allocator_type;
+ using _Base::_M_tree_ptr;
+ using _Base::get_allocator;
+ using _Base::_M_get_allocator;
+ typedef __GC_CONST _CharT* _Cstrptr;
+
+ static _CharT _S_empty_c_str[1];
+
+ static bool
+ _S_is0(_CharT __c)
+ { return __c == _S_eos((_CharT*)0); }
+
+ enum { _S_copy_max = 23 };
+ // For strings shorter than _S_copy_max, we copy to
+ // concatenate.
+
+ typedef _Rope_RopeRep<_CharT, _Alloc> _RopeRep;
+ typedef _Rope_RopeConcatenation<_CharT, _Alloc> _RopeConcatenation;
+ typedef _Rope_RopeLeaf<_CharT, _Alloc> _RopeLeaf;
+ typedef _Rope_RopeFunction<_CharT, _Alloc> _RopeFunction;
+ typedef _Rope_RopeSubstring<_CharT, _Alloc> _RopeSubstring;
+
+ // Retrieve a character at the indicated position.
+ static _CharT _S_fetch(_RopeRep* __r, size_type __pos);
+
+#ifndef __GC
+ // Obtain a pointer to the character at the indicated position.
+ // The pointer can be used to change the character.
+ // If such a pointer cannot be produced, as is frequently the
+ // case, 0 is returned instead.
+ // (Returns nonzero only if all nodes in the path have a refcount
+ // of 1.)
+ static _CharT* _S_fetch_ptr(_RopeRep* __r, size_type __pos);
+#endif
+
+ static bool
+ _S_apply_to_pieces(// should be template parameter
+ _Rope_char_consumer<_CharT>& __c,
+ const _RopeRep* __r,
+ size_t __begin, size_t __end);
+ // begin and end are assumed to be in range.
+
+#ifndef __GC
+ static void
+ _S_unref(_RopeRep* __t)
+ { _RopeRep::_S_unref(__t); }
+
+ static void
+ _S_ref(_RopeRep* __t)
+ { _RopeRep::_S_ref(__t); }
+
+#else /* __GC */
+ static void _S_unref(_RopeRep*) { }
+ static void _S_ref(_RopeRep*) { }
+#endif
+
+#ifdef __GC
+ typedef _Rope_RopeRep<_CharT, _Alloc>* _Self_destruct_ptr;
+#else
+ typedef _Rope_self_destruct_ptr<_CharT, _Alloc> _Self_destruct_ptr;
+#endif
+
+ // _Result is counted in refcount.
+ static _RopeRep* _S_substring(_RopeRep* __base,
+ size_t __start, size_t __endp1);
+
+ static _RopeRep* _S_concat_char_iter(_RopeRep* __r,
+ const _CharT* __iter, size_t __slen);
+ // Concatenate rope and char ptr, copying __s.
+ // Should really take an arbitrary iterator.
+ // Result is counted in refcount.
+ static _RopeRep* _S_destr_concat_char_iter(_RopeRep* __r,
+ const _CharT* __iter,
+ size_t __slen)
+ // As above, but one reference to __r is about to be
+ // destroyed. Thus the pieces may be recycled if all
+ // relevant reference counts are 1.
+#ifdef __GC
+ // We can't really do anything since refcounts are unavailable.
+ { return _S_concat_char_iter(__r, __iter, __slen); }
+#else
+ ;
+#endif
+
+ static _RopeRep* _S_concat(_RopeRep* __left, _RopeRep* __right);
+ // General concatenation on _RopeRep. _Result
+ // has refcount of 1. Adjusts argument refcounts.
+
+ public:
+ void
+ apply_to_pieces(size_t __begin, size_t __end,
+ _Rope_char_consumer<_CharT>& __c) const
+ { _S_apply_to_pieces(__c, this->_M_tree_ptr, __begin, __end); }
+
+ protected:
+
+ static size_t
+ _S_rounded_up_size(size_t __n)
+ { return _RopeLeaf::_S_rounded_up_size(__n); }
+
+ static size_t
+ _S_allocated_capacity(size_t __n)
+ {
+ if (_S_is_basic_char_type((_CharT*)0))
+ return _S_rounded_up_size(__n) - 1;
+ else
+ return _S_rounded_up_size(__n);
+
+ }
+
+ // Allocate and construct a RopeLeaf using the supplied allocator
+ // Takes ownership of s instead of copying.
+ static _RopeLeaf*
+ _S_new_RopeLeaf(__GC_CONST _CharT *__s,
+ size_t __size, allocator_type& __a)
+ {
+ _RopeLeaf* __space = typename _Base::_LAlloc(__a).allocate(1);
+ return new(__space) _RopeLeaf(__s, __size, __a);
+ }
+
+ static _RopeConcatenation*
+ _S_new_RopeConcatenation(_RopeRep* __left, _RopeRep* __right,
+ allocator_type& __a)
+ {
+ _RopeConcatenation* __space = typename _Base::_CAlloc(__a).allocate(1);
+ return new(__space) _RopeConcatenation(__left, __right, __a);
+ }
+
+ static _RopeFunction*
+ _S_new_RopeFunction(char_producer<_CharT>* __f,
+ size_t __size, bool __d, allocator_type& __a)
+ {
+ _RopeFunction* __space = typename _Base::_FAlloc(__a).allocate(1);
+ return new(__space) _RopeFunction(__f, __size, __d, __a);
+ }
+
+ static _RopeSubstring*
+ _S_new_RopeSubstring(_Rope_RopeRep<_CharT,_Alloc>* __b, size_t __s,
+ size_t __l, allocator_type& __a)
+ {
+ _RopeSubstring* __space = typename _Base::_SAlloc(__a).allocate(1);
+ return new(__space) _RopeSubstring(__b, __s, __l, __a);
+ }
+
+ static _RopeLeaf*
+ _S_RopeLeaf_from_unowned_char_ptr(const _CharT *__s,
+ size_t __size, allocator_type& __a)
+#define __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __size, __a) \
+ _S_RopeLeaf_from_unowned_char_ptr(__s, __size, __a)
+ {
+ if (0 == __size)
+ return 0;
+ _CharT* __buf = __a.allocate(_S_rounded_up_size(__size));
+
+ __uninitialized_copy_n_a(__s, __size, __buf, __a);
+ _S_cond_store_eos(__buf[__size]);
+ __try
+ { return _S_new_RopeLeaf(__buf, __size, __a); }
+ __catch(...)
+ {
+ _RopeRep::__STL_FREE_STRING(__buf, __size, __a);
+ __throw_exception_again;
+ }
+ }
+
+ // Concatenation of nonempty strings.
+ // Always builds a concatenation node.
+ // Rebalances if the result is too deep.
+ // Result has refcount 1.
+ // Does not increment left and right ref counts even though
+ // they are referenced.
+ static _RopeRep*
+ _S_tree_concat(_RopeRep* __left, _RopeRep* __right);
+
+ // Concatenation helper functions
+ static _RopeLeaf*
+ _S_leaf_concat_char_iter(_RopeLeaf* __r,
+ const _CharT* __iter, size_t __slen);
+ // Concatenate by copying leaf.
+ // should take an arbitrary iterator
+ // result has refcount 1.
+#ifndef __GC
+ static _RopeLeaf*
+ _S_destr_leaf_concat_char_iter(_RopeLeaf* __r,
+ const _CharT* __iter, size_t __slen);
+ // A version that potentially clobbers __r if __r->_M_ref_count == 1.
+#endif
+
+ private:
+
+ static size_t _S_char_ptr_len(const _CharT* __s);
+ // slightly generalized strlen
+
+ rope(_RopeRep* __t, const allocator_type& __a = allocator_type())
+ : _Base(__t, __a) { }
+
+
+ // Copy __r to the _CharT buffer.
+ // Returns __buffer + __r->_M_size.
+ // Assumes that buffer is uninitialized.
+ static _CharT* _S_flatten(_RopeRep* __r, _CharT* __buffer);
+
+ // Again, with explicit starting position and length.
+ // Assumes that buffer is uninitialized.
+ static _CharT* _S_flatten(_RopeRep* __r,
+ size_t __start, size_t __len,
+ _CharT* __buffer);
+
+ static const unsigned long
+ _S_min_len[__detail::_S_max_rope_depth + 1];
+
+ static bool
+ _S_is_balanced(_RopeRep* __r)
+ { return (__r->_M_size >= _S_min_len[__r->_M_depth]); }
+
+ static bool
+ _S_is_almost_balanced(_RopeRep* __r)
+ { return (__r->_M_depth == 0
+ || __r->_M_size >= _S_min_len[__r->_M_depth - 1]); }
+
+ static bool
+ _S_is_roughly_balanced(_RopeRep* __r)
+ { return (__r->_M_depth <= 1
+ || __r->_M_size >= _S_min_len[__r->_M_depth - 2]); }
+
+ // Assumes the result is not empty.
+ static _RopeRep*
+ _S_concat_and_set_balanced(_RopeRep* __left, _RopeRep* __right)
+ {
+ _RopeRep* __result = _S_concat(__left, __right);
+ if (_S_is_balanced(__result))
+ __result->_M_is_balanced = true;
+ return __result;
+ }
+
+ // The basic rebalancing operation. Logically copies the
+ // rope. The result has refcount of 1. The client will
+ // usually decrement the reference count of __r.
+ // The result is within height 2 of balanced by the above
+ // definition.
+ static _RopeRep* _S_balance(_RopeRep* __r);
+
+ // Add all unbalanced subtrees to the forest of balanced trees.
+ // Used only by balance.
+ static void _S_add_to_forest(_RopeRep*__r, _RopeRep** __forest);
+
+ // Add __r to forest, assuming __r is already balanced.
+ static void _S_add_leaf_to_forest(_RopeRep* __r, _RopeRep** __forest);
+
+ // Print to stdout, exposing structure
+ static void _S_dump(_RopeRep* __r, int __indent = 0);
+
+ // Return -1, 0, or 1 if __x < __y, __x == __y, or __x > __y resp.
+ static int _S_compare(const _RopeRep* __x, const _RopeRep* __y);
+
+ public:
+ bool
+ empty() const
+ { return 0 == this->_M_tree_ptr; }
+
+ // Comparison member function. This is public only for those
+ // clients that need a ternary comparison. Others
+ // should use the comparison operators below.
+ int
+ compare(const rope& __y) const
+ { return _S_compare(this->_M_tree_ptr, __y._M_tree_ptr); }
+
+ rope(const _CharT* __s, const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ {
+ this->_M_tree_ptr =
+ __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, _S_char_ptr_len(__s),
+ _M_get_allocator());
+ }
+
+ rope(const _CharT* __s, size_t __len,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ {
+ this->_M_tree_ptr =
+ __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __len, _M_get_allocator());
+ }
+
+ // Should perhaps be templatized with respect to the iterator type
+ // and use Sequence_buffer. (It should perhaps use sequence_buffer
+ // even now.)
+ rope(const _CharT* __s, const _CharT* __e,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ {
+ this->_M_tree_ptr =
+ __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __e - __s, _M_get_allocator());
+ }
+
+ rope(const const_iterator& __s, const const_iterator& __e,
+ const allocator_type& __a = allocator_type())
+ : _Base(_S_substring(__s._M_root, __s._M_current_pos,
+ __e._M_current_pos), __a)
+ { }
+
+ rope(const iterator& __s, const iterator& __e,
+ const allocator_type& __a = allocator_type())
+ : _Base(_S_substring(__s._M_root, __s._M_current_pos,
+ __e._M_current_pos), __a)
+ { }
+
+ rope(_CharT __c, const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ {
+ _CharT* __buf = this->_Data_allocate(_S_rounded_up_size(1));
+
+ _M_get_allocator().construct(__buf, __c);
+ __try
+ {
+ this->_M_tree_ptr = _S_new_RopeLeaf(__buf, 1,
+ _M_get_allocator());
+ }
+ __catch(...)
+ {
+ _RopeRep::__STL_FREE_STRING(__buf, 1, _M_get_allocator());
+ __throw_exception_again;
+ }
+ }
+
+ rope(size_t __n, _CharT __c,
+ const allocator_type& __a = allocator_type());
+
+ rope(const allocator_type& __a = allocator_type())
+ : _Base(0, __a) { }
+
+ // Construct a rope from a function that can compute its members
+ rope(char_producer<_CharT> *__fn, size_t __len, bool __delete_fn,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ {
+ this->_M_tree_ptr = (0 == __len) ?
+ 0 : _S_new_RopeFunction(__fn, __len, __delete_fn, __a);
+ }
+
+ rope(const rope& __x, const allocator_type& __a = allocator_type())
+ : _Base(__x._M_tree_ptr, __a)
+ { _S_ref(this->_M_tree_ptr); }
+
+ ~rope() throw()
+ { _S_unref(this->_M_tree_ptr); }
+
+ rope&
+ operator=(const rope& __x)
+ {
+ _RopeRep* __old = this->_M_tree_ptr;
+ this->_M_tree_ptr = __x._M_tree_ptr;
+ _S_ref(this->_M_tree_ptr);
+ _S_unref(__old);
+ return *this;
+ }
+
+ void
+ clear()
+ {
+ _S_unref(this->_M_tree_ptr);
+ this->_M_tree_ptr = 0;
+ }
+
+ void
+ push_back(_CharT __x)
+ {
+ _RopeRep* __old = this->_M_tree_ptr;
+ this->_M_tree_ptr
+ = _S_destr_concat_char_iter(this->_M_tree_ptr, &__x, 1);
+ _S_unref(__old);
+ }
+
+ void
+ pop_back()
+ {
+ _RopeRep* __old = this->_M_tree_ptr;
+ this->_M_tree_ptr = _S_substring(this->_M_tree_ptr,
+ 0, this->_M_tree_ptr->_M_size - 1);
+ _S_unref(__old);
+ }
+
+ _CharT
+ back() const
+ { return _S_fetch(this->_M_tree_ptr, this->_M_tree_ptr->_M_size - 1); }
+
+ void
+ push_front(_CharT __x)
+ {
+ _RopeRep* __old = this->_M_tree_ptr;
+ _RopeRep* __left =
+ __STL_ROPE_FROM_UNOWNED_CHAR_PTR(&__x, 1, _M_get_allocator());
+ __try
+ {
+ this->_M_tree_ptr = _S_concat(__left, this->_M_tree_ptr);
+ _S_unref(__old);
+ _S_unref(__left);
+ }
+ __catch(...)
+ {
+ _S_unref(__left);
+ __throw_exception_again;
+ }
+ }
+
+ void
+ pop_front()
+ {
+ _RopeRep* __old = this->_M_tree_ptr;
+ this->_M_tree_ptr
+ = _S_substring(this->_M_tree_ptr, 1, this->_M_tree_ptr->_M_size);
+ _S_unref(__old);
+ }
+
+ _CharT
+ front() const
+ { return _S_fetch(this->_M_tree_ptr, 0); }
+
+ void
+ balance()
+ {
+ _RopeRep* __old = this->_M_tree_ptr;
+ this->_M_tree_ptr = _S_balance(this->_M_tree_ptr);
+ _S_unref(__old);
+ }
+
+ void
+ copy(_CharT* __buffer) const
+ {
+ _Destroy_const(__buffer, __buffer + size(), _M_get_allocator());
+ _S_flatten(this->_M_tree_ptr, __buffer);
+ }
+
+ // This is the copy function from the standard, but
+ // with the arguments reordered to make it consistent with the
+ // rest of the interface.
+ // Note that this guaranteed not to compile if the draft standard
+ // order is assumed.
+ size_type
+ copy(size_type __pos, size_type __n, _CharT* __buffer) const
+ {
+ size_t __size = size();
+ size_t __len = (__pos + __n > __size? __size - __pos : __n);
+
+ _Destroy_const(__buffer, __buffer + __len, _M_get_allocator());
+ _S_flatten(this->_M_tree_ptr, __pos, __len, __buffer);
+ return __len;
+ }
+
+ // Print to stdout, exposing structure. May be useful for
+ // performance debugging.
+ void
+ dump()
+ { _S_dump(this->_M_tree_ptr); }
+
+ // Convert to 0 terminated string in new allocated memory.
+ // Embedded 0s in the input do not terminate the copy.
+ const _CharT* c_str() const;
+
+ // As above, but also use the flattened representation as
+ // the new rope representation.
+ const _CharT* replace_with_c_str();
+
+ // Reclaim memory for the c_str generated flattened string.
+ // Intentionally undocumented, since it's hard to say when this
+ // is safe for multiple threads.
+ void
+ delete_c_str ()
+ {
+ if (0 == this->_M_tree_ptr)
+ return;
+ if (__detail::_S_leaf == this->_M_tree_ptr->_M_tag &&
+ ((_RopeLeaf*)this->_M_tree_ptr)->_M_data ==
+ this->_M_tree_ptr->_M_c_string)
+ {
+ // Representation shared
+ return;
+ }
+#ifndef __GC
+ this->_M_tree_ptr->_M_free_c_string();
+#endif
+ this->_M_tree_ptr->_M_c_string = 0;
+ }
+
+ _CharT
+ operator[] (size_type __pos) const
+ { return _S_fetch(this->_M_tree_ptr, __pos); }
+
+ _CharT
+ at(size_type __pos) const
+ {
+ // if (__pos >= size()) throw out_of_range; // XXX
+ return (*this)[__pos];
+ }
+
+ const_iterator
+ begin() const
+ { return(const_iterator(this->_M_tree_ptr, 0)); }
+
+ // An easy way to get a const iterator from a non-const container.
+ const_iterator
+ const_begin() const
+ { return(const_iterator(this->_M_tree_ptr, 0)); }
+
+ const_iterator
+ end() const
+ { return(const_iterator(this->_M_tree_ptr, size())); }
+
+ const_iterator
+ const_end() const
+ { return(const_iterator(this->_M_tree_ptr, size())); }
+
+ size_type
+ size() const
+ { return(0 == this->_M_tree_ptr? 0 : this->_M_tree_ptr->_M_size); }
+
+ size_type
+ length() const
+ { return size(); }
+
+ size_type
+ max_size() const
+ {
+ return _S_min_len[int(__detail::_S_max_rope_depth) - 1] - 1;
+ // Guarantees that the result can be sufficiently
+ // balanced. Longer ropes will probably still work,
+ // but it's harder to make guarantees.
+ }
+
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(end()); }
+
+ const_reverse_iterator
+ const_rbegin() const
+ { return const_reverse_iterator(end()); }
+
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(begin()); }
+
+ const_reverse_iterator
+ const_rend() const
+ { return const_reverse_iterator(begin()); }
+
+ template<class _CharT2, class _Alloc2>
+ friend rope<_CharT2, _Alloc2>
+ operator+(const rope<_CharT2, _Alloc2>& __left,
+ const rope<_CharT2, _Alloc2>& __right);
+
+ template<class _CharT2, class _Alloc2>
+ friend rope<_CharT2, _Alloc2>
+ operator+(const rope<_CharT2, _Alloc2>& __left, const _CharT2* __right);
+
+ template<class _CharT2, class _Alloc2>
+ friend rope<_CharT2, _Alloc2>
+ operator+(const rope<_CharT2, _Alloc2>& __left, _CharT2 __right);
+
+ // The symmetric cases are intentionally omitted, since they're
+ // presumed to be less common, and we don't handle them as well.
+
+ // The following should really be templatized. The first
+ // argument should be an input iterator or forward iterator with
+ // value_type _CharT.
+ rope&
+ append(const _CharT* __iter, size_t __n)
+ {
+ _RopeRep* __result =
+ _S_destr_concat_char_iter(this->_M_tree_ptr, __iter, __n);
+ _S_unref(this->_M_tree_ptr);
+ this->_M_tree_ptr = __result;
+ return *this;
+ }
+
+ rope&
+ append(const _CharT* __c_string)
+ {
+ size_t __len = _S_char_ptr_len(__c_string);
+ append(__c_string, __len);
+ return(*this);
+ }
+
+ rope&
+ append(const _CharT* __s, const _CharT* __e)
+ {
+ _RopeRep* __result =
+ _S_destr_concat_char_iter(this->_M_tree_ptr, __s, __e - __s);
+ _S_unref(this->_M_tree_ptr);
+ this->_M_tree_ptr = __result;
+ return *this;
+ }
+
+ rope&
+ append(const_iterator __s, const_iterator __e)
+ {
+ _Self_destruct_ptr __appendee(_S_substring(__s._M_root,
+ __s._M_current_pos,
+ __e._M_current_pos));
+ _RopeRep* __result = _S_concat(this->_M_tree_ptr,
+ (_RopeRep*)__appendee);
+ _S_unref(this->_M_tree_ptr);
+ this->_M_tree_ptr = __result;
+ return *this;
+ }
+
+ rope&
+ append(_CharT __c)
+ {
+ _RopeRep* __result =
+ _S_destr_concat_char_iter(this->_M_tree_ptr, &__c, 1);
+ _S_unref(this->_M_tree_ptr);
+ this->_M_tree_ptr = __result;
+ return *this;
+ }
+
+ rope&
+ append()
+ { return append(_CharT()); } // XXX why?
+
+ rope&
+ append(const rope& __y)
+ {
+ _RopeRep* __result = _S_concat(this->_M_tree_ptr, __y._M_tree_ptr);
+ _S_unref(this->_M_tree_ptr);
+ this->_M_tree_ptr = __result;
+ return *this;
+ }
+
+ rope&
+ append(size_t __n, _CharT __c)
+ {
+ rope<_CharT,_Alloc> __last(__n, __c);
+ return append(__last);
+ }
+
+ void
+ swap(rope& __b)
+ {
+ _RopeRep* __tmp = this->_M_tree_ptr;
+ this->_M_tree_ptr = __b._M_tree_ptr;
+ __b._M_tree_ptr = __tmp;
+ }
+
+ protected:
+ // Result is included in refcount.
+ static _RopeRep*
+ replace(_RopeRep* __old, size_t __pos1,
+ size_t __pos2, _RopeRep* __r)
+ {
+ if (0 == __old)
+ {
+ _S_ref(__r);
+ return __r;
+ }
+ _Self_destruct_ptr __left(_S_substring(__old, 0, __pos1));
+ _Self_destruct_ptr __right(_S_substring(__old, __pos2, __old->_M_size));
+ _RopeRep* __result;
+
+ if (0 == __r)
+ __result = _S_concat(__left, __right);
+ else
+ {
+ _Self_destruct_ptr __left_result(_S_concat(__left, __r));
+ __result = _S_concat(__left_result, __right);
+ }
+ return __result;
+ }
+
+ public:
+ void
+ insert(size_t __p, const rope& __r)
+ {
+ _RopeRep* __result =
+ replace(this->_M_tree_ptr, __p, __p, __r._M_tree_ptr);
+ _S_unref(this->_M_tree_ptr);
+ this->_M_tree_ptr = __result;
+ }
+
+ void
+ insert(size_t __p, size_t __n, _CharT __c)
+ {
+ rope<_CharT,_Alloc> __r(__n,__c);
+ insert(__p, __r);
+ }
+
+ void
+ insert(size_t __p, const _CharT* __i, size_t __n)
+ {
+ _Self_destruct_ptr __left(_S_substring(this->_M_tree_ptr, 0, __p));
+ _Self_destruct_ptr __right(_S_substring(this->_M_tree_ptr,
+ __p, size()));
+ _Self_destruct_ptr __left_result(_S_concat_char_iter(__left, __i, __n));
+ // _S_ destr_concat_char_iter should be safe here.
+ // But as it stands it's probably not a win, since __left
+ // is likely to have additional references.
+ _RopeRep* __result = _S_concat(__left_result, __right);
+ _S_unref(this->_M_tree_ptr);
+ this->_M_tree_ptr = __result;
+ }
+
+ void
+ insert(size_t __p, const _CharT* __c_string)
+ { insert(__p, __c_string, _S_char_ptr_len(__c_string)); }
+
+ void
+ insert(size_t __p, _CharT __c)
+ { insert(__p, &__c, 1); }
+
+ void
+ insert(size_t __p)
+ {
+ _CharT __c = _CharT();
+ insert(__p, &__c, 1);
+ }
+
+ void
+ insert(size_t __p, const _CharT* __i, const _CharT* __j)
+ {
+ rope __r(__i, __j);
+ insert(__p, __r);
+ }
+
+ void
+ insert(size_t __p, const const_iterator& __i,
+ const const_iterator& __j)
+ {
+ rope __r(__i, __j);
+ insert(__p, __r);
+ }
+
+ void
+ insert(size_t __p, const iterator& __i,
+ const iterator& __j)
+ {
+ rope __r(__i, __j);
+ insert(__p, __r);
+ }
+
+ // (position, length) versions of replace operations:
+
+ void
+ replace(size_t __p, size_t __n, const rope& __r)
+ {
+ _RopeRep* __result =
+ replace(this->_M_tree_ptr, __p, __p + __n, __r._M_tree_ptr);
+ _S_unref(this->_M_tree_ptr);
+ this->_M_tree_ptr = __result;
+ }
+
+ void
+ replace(size_t __p, size_t __n,
+ const _CharT* __i, size_t __i_len)
+ {
+ rope __r(__i, __i_len);
+ replace(__p, __n, __r);
+ }
+
+ void
+ replace(size_t __p, size_t __n, _CharT __c)
+ {
+ rope __r(__c);
+ replace(__p, __n, __r);
+ }
+
+ void
+ replace(size_t __p, size_t __n, const _CharT* __c_string)
+ {
+ rope __r(__c_string);
+ replace(__p, __n, __r);
+ }
+
+ void
+ replace(size_t __p, size_t __n,
+ const _CharT* __i, const _CharT* __j)
+ {
+ rope __r(__i, __j);
+ replace(__p, __n, __r);
+ }
+
+ void
+ replace(size_t __p, size_t __n,
+ const const_iterator& __i, const const_iterator& __j)
+ {
+ rope __r(__i, __j);
+ replace(__p, __n, __r);
+ }
+
+ void
+ replace(size_t __p, size_t __n,
+ const iterator& __i, const iterator& __j)
+ {
+ rope __r(__i, __j);
+ replace(__p, __n, __r);
+ }
+
+ // Single character variants:
+ void
+ replace(size_t __p, _CharT __c)
+ {
+ iterator __i(this, __p);
+ *__i = __c;
+ }
+
+ void
+ replace(size_t __p, const rope& __r)
+ { replace(__p, 1, __r); }
+
+ void
+ replace(size_t __p, const _CharT* __i, size_t __i_len)
+ { replace(__p, 1, __i, __i_len); }
+
+ void
+ replace(size_t __p, const _CharT* __c_string)
+ { replace(__p, 1, __c_string); }
+
+ void
+ replace(size_t __p, const _CharT* __i, const _CharT* __j)
+ { replace(__p, 1, __i, __j); }
+
+ void
+ replace(size_t __p, const const_iterator& __i,
+ const const_iterator& __j)
+ { replace(__p, 1, __i, __j); }
+
+ void
+ replace(size_t __p, const iterator& __i,
+ const iterator& __j)
+ { replace(__p, 1, __i, __j); }
+
+ // Erase, (position, size) variant.
+ void
+ erase(size_t __p, size_t __n)
+ {
+ _RopeRep* __result = replace(this->_M_tree_ptr, __p,
+ __p + __n, 0);
+ _S_unref(this->_M_tree_ptr);
+ this->_M_tree_ptr = __result;
+ }
+
+ // Erase, single character
+ void
+ erase(size_t __p)
+ { erase(__p, __p + 1); }
+
+ // Insert, iterator variants.
+ iterator
+ insert(const iterator& __p, const rope& __r)
+ {
+ insert(__p.index(), __r);
+ return __p;
+ }
+
+ iterator
+ insert(const iterator& __p, size_t __n, _CharT __c)
+ {
+ insert(__p.index(), __n, __c);
+ return __p;
+ }
+
+ iterator insert(const iterator& __p, _CharT __c)
+ {
+ insert(__p.index(), __c);
+ return __p;
+ }
+
+ iterator
+ insert(const iterator& __p )
+ {
+ insert(__p.index());
+ return __p;
+ }
+
+ iterator
+ insert(const iterator& __p, const _CharT* c_string)
+ {
+ insert(__p.index(), c_string);
+ return __p;
+ }
+
+ iterator
+ insert(const iterator& __p, const _CharT* __i, size_t __n)
+ {
+ insert(__p.index(), __i, __n);
+ return __p;
+ }
+
+ iterator
+ insert(const iterator& __p, const _CharT* __i,
+ const _CharT* __j)
+ {
+ insert(__p.index(), __i, __j);
+ return __p;
+ }
+
+ iterator
+ insert(const iterator& __p,
+ const const_iterator& __i, const const_iterator& __j)
+ {
+ insert(__p.index(), __i, __j);
+ return __p;
+ }
+
+ iterator
+ insert(const iterator& __p,
+ const iterator& __i, const iterator& __j)
+ {
+ insert(__p.index(), __i, __j);
+ return __p;
+ }
+
+ // Replace, range variants.
+ void
+ replace(const iterator& __p, const iterator& __q, const rope& __r)
+ { replace(__p.index(), __q.index() - __p.index(), __r); }
+
+ void
+ replace(const iterator& __p, const iterator& __q, _CharT __c)
+ { replace(__p.index(), __q.index() - __p.index(), __c); }
+
+ void
+ replace(const iterator& __p, const iterator& __q,
+ const _CharT* __c_string)
+ { replace(__p.index(), __q.index() - __p.index(), __c_string); }
+
+ void
+ replace(const iterator& __p, const iterator& __q,
+ const _CharT* __i, size_t __n)
+ { replace(__p.index(), __q.index() - __p.index(), __i, __n); }
+
+ void
+ replace(const iterator& __p, const iterator& __q,
+ const _CharT* __i, const _CharT* __j)
+ { replace(__p.index(), __q.index() - __p.index(), __i, __j); }
+
+ void
+ replace(const iterator& __p, const iterator& __q,
+ const const_iterator& __i, const const_iterator& __j)
+ { replace(__p.index(), __q.index() - __p.index(), __i, __j); }
+
+ void
+ replace(const iterator& __p, const iterator& __q,
+ const iterator& __i, const iterator& __j)
+ { replace(__p.index(), __q.index() - __p.index(), __i, __j); }
+
+ // Replace, iterator variants.
+ void
+ replace(const iterator& __p, const rope& __r)
+ { replace(__p.index(), __r); }
+
+ void
+ replace(const iterator& __p, _CharT __c)
+ { replace(__p.index(), __c); }
+
+ void
+ replace(const iterator& __p, const _CharT* __c_string)
+ { replace(__p.index(), __c_string); }
+
+ void
+ replace(const iterator& __p, const _CharT* __i, size_t __n)
+ { replace(__p.index(), __i, __n); }
+
+ void
+ replace(const iterator& __p, const _CharT* __i, const _CharT* __j)
+ { replace(__p.index(), __i, __j); }
+
+ void
+ replace(const iterator& __p, const_iterator __i, const_iterator __j)
+ { replace(__p.index(), __i, __j); }
+
+ void
+ replace(const iterator& __p, iterator __i, iterator __j)
+ { replace(__p.index(), __i, __j); }
+
+ // Iterator and range variants of erase
+ iterator
+ erase(const iterator& __p, const iterator& __q)
+ {
+ size_t __p_index = __p.index();
+ erase(__p_index, __q.index() - __p_index);
+ return iterator(this, __p_index);
+ }
+
+ iterator
+ erase(const iterator& __p)
+ {
+ size_t __p_index = __p.index();
+ erase(__p_index, 1);
+ return iterator(this, __p_index);
+ }
+
+ rope
+ substr(size_t __start, size_t __len = 1) const
+ {
+ return rope<_CharT, _Alloc>(_S_substring(this->_M_tree_ptr,
+ __start,
+ __start + __len));
+ }
+
+ rope
+ substr(iterator __start, iterator __end) const
+ {
+ return rope<_CharT, _Alloc>(_S_substring(this->_M_tree_ptr,
+ __start.index(),
+ __end.index()));
+ }
+
+ rope
+ substr(iterator __start) const
+ {
+ size_t __pos = __start.index();
+ return rope<_CharT, _Alloc>(_S_substring(this->_M_tree_ptr,
+ __pos, __pos + 1));
+ }
+
+ rope
+ substr(const_iterator __start, const_iterator __end) const
+ {
+ // This might eventually take advantage of the cache in the
+ // iterator.
+ return rope<_CharT, _Alloc>(_S_substring(this->_M_tree_ptr,
+ __start.index(),
+ __end.index()));
+ }
+
+ rope<_CharT, _Alloc>
+ substr(const_iterator __start)
+ {
+ size_t __pos = __start.index();
+ return rope<_CharT, _Alloc>(_S_substring(this->_M_tree_ptr,
+ __pos, __pos + 1));
+ }
+
+ static const size_type npos;
+
+ size_type find(_CharT __c, size_type __pos = 0) const;
+
+ size_type
+ find(const _CharT* __s, size_type __pos = 0) const
+ {
+ size_type __result_pos;
+ const_iterator __result =
+ std::search(const_begin() + __pos, const_end(),
+ __s, __s + _S_char_ptr_len(__s));
+ __result_pos = __result.index();
+#ifndef __STL_OLD_ROPE_SEMANTICS
+ if (__result_pos == size())
+ __result_pos = npos;
+#endif
+ return __result_pos;
+ }
+
+ iterator
+ mutable_begin()
+ { return(iterator(this, 0)); }
+
+ iterator
+ mutable_end()
+ { return(iterator(this, size())); }
+
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+
+ reverse_iterator
+ mutable_rbegin()
+ { return reverse_iterator(mutable_end()); }
+
+ reverse_iterator
+ mutable_rend()
+ { return reverse_iterator(mutable_begin()); }
+
+ reference
+ mutable_reference_at(size_type __pos)
+ { return reference(this, __pos); }
+
+#ifdef __STD_STUFF
+ reference
+ operator[] (size_type __pos)
+ { return _char_ref_proxy(this, __pos); }
+
+ reference
+ at(size_type __pos)
+ {
+ // if (__pos >= size()) throw out_of_range; // XXX
+ return (*this)[__pos];
+ }
+
+ void resize(size_type __n, _CharT __c) { }
+ void resize(size_type __n) { }
+ void reserve(size_type __res_arg = 0) { }
+
+ size_type
+ capacity() const
+ { return max_size(); }
+
+ // Stuff below this line is dangerous because it's error prone.
+ // I would really like to get rid of it.
+ // copy function with funny arg ordering.
+ size_type
+ copy(_CharT* __buffer, size_type __n,
+ size_type __pos = 0) const
+ { return copy(__pos, __n, __buffer); }
+
+ iterator
+ end()
+ { return mutable_end(); }
+
+ iterator
+ begin()
+ { return mutable_begin(); }
+
+ reverse_iterator
+ rend()
+ { return mutable_rend(); }
+
+ reverse_iterator
+ rbegin()
+ { return mutable_rbegin(); }
+
+#else
+ const_iterator
+ end()
+ { return const_end(); }
+
+ const_iterator
+ begin()
+ { return const_begin(); }
+
+ const_reverse_iterator
+ rend()
+ { return const_rend(); }
+
+ const_reverse_iterator
+ rbegin()
+ { return const_rbegin(); }
+
+#endif
+ };
+
+ template <class _CharT, class _Alloc>
+ const typename rope<_CharT, _Alloc>::size_type
+ rope<_CharT, _Alloc>::npos = (size_type)(-1);
+
+ template <class _CharT, class _Alloc>
+ inline bool operator==(const _Rope_const_iterator<_CharT, _Alloc>& __x,
+ const _Rope_const_iterator<_CharT, _Alloc>& __y)
+ { return (__x._M_current_pos == __y._M_current_pos
+ && __x._M_root == __y._M_root); }
+
+ template <class _CharT, class _Alloc>
+ inline bool operator<(const _Rope_const_iterator<_CharT, _Alloc>& __x,
+ const _Rope_const_iterator<_CharT, _Alloc>& __y)
+ { return (__x._M_current_pos < __y._M_current_pos); }
+
+ template <class _CharT, class _Alloc>
+ inline bool operator!=(const _Rope_const_iterator<_CharT, _Alloc>& __x,
+ const _Rope_const_iterator<_CharT, _Alloc>& __y)
+ { return !(__x == __y); }
+
+ template <class _CharT, class _Alloc>
+ inline bool operator>(const _Rope_const_iterator<_CharT, _Alloc>& __x,
+ const _Rope_const_iterator<_CharT, _Alloc>& __y)
+ { return __y < __x; }
+
+ template <class _CharT, class _Alloc>
+ inline bool
+ operator<=(const _Rope_const_iterator<_CharT, _Alloc>& __x,
+ const _Rope_const_iterator<_CharT, _Alloc>& __y)
+ { return !(__y < __x); }
+
+ template <class _CharT, class _Alloc>
+ inline bool
+ operator>=(const _Rope_const_iterator<_CharT, _Alloc>& __x,
+ const _Rope_const_iterator<_CharT, _Alloc>& __y)
+ { return !(__x < __y); }
+
+ template <class _CharT, class _Alloc>
+ inline ptrdiff_t
+ operator-(const _Rope_const_iterator<_CharT, _Alloc>& __x,
+ const _Rope_const_iterator<_CharT, _Alloc>& __y)
+ { return (ptrdiff_t)__x._M_current_pos - (ptrdiff_t)__y._M_current_pos; }
+
+ template <class _CharT, class _Alloc>
+ inline _Rope_const_iterator<_CharT, _Alloc>
+ operator-(const _Rope_const_iterator<_CharT, _Alloc>& __x, ptrdiff_t __n)
+ { return _Rope_const_iterator<_CharT, _Alloc>(__x._M_root,
+ __x._M_current_pos - __n); }
+
+ template <class _CharT, class _Alloc>
+ inline _Rope_const_iterator<_CharT, _Alloc>
+ operator+(const _Rope_const_iterator<_CharT, _Alloc>& __x, ptrdiff_t __n)
+ { return _Rope_const_iterator<_CharT, _Alloc>(__x._M_root,
+ __x._M_current_pos + __n); }
+
+ template <class _CharT, class _Alloc>
+ inline _Rope_const_iterator<_CharT, _Alloc>
+ operator+(ptrdiff_t __n, const _Rope_const_iterator<_CharT, _Alloc>& __x)
+ { return _Rope_const_iterator<_CharT, _Alloc>(__x._M_root,
+ __x._M_current_pos + __n); }
+
+ template <class _CharT, class _Alloc>
+ inline bool
+ operator==(const _Rope_iterator<_CharT, _Alloc>& __x,
+ const _Rope_iterator<_CharT, _Alloc>& __y)
+ {return (__x._M_current_pos == __y._M_current_pos
+ && __x._M_root_rope == __y._M_root_rope); }
+
+ template <class _CharT, class _Alloc>
+ inline bool
+ operator<(const _Rope_iterator<_CharT, _Alloc>& __x,
+ const _Rope_iterator<_CharT, _Alloc>& __y)
+ { return (__x._M_current_pos < __y._M_current_pos); }
+
+ template <class _CharT, class _Alloc>
+ inline bool
+ operator!=(const _Rope_iterator<_CharT, _Alloc>& __x,
+ const _Rope_iterator<_CharT, _Alloc>& __y)
+ { return !(__x == __y); }
+
+ template <class _CharT, class _Alloc>
+ inline bool
+ operator>(const _Rope_iterator<_CharT, _Alloc>& __x,
+ const _Rope_iterator<_CharT, _Alloc>& __y)
+ { return __y < __x; }
+
+ template <class _CharT, class _Alloc>
+ inline bool
+ operator<=(const _Rope_iterator<_CharT, _Alloc>& __x,
+ const _Rope_iterator<_CharT, _Alloc>& __y)
+ { return !(__y < __x); }
+
+ template <class _CharT, class _Alloc>
+ inline bool
+ operator>=(const _Rope_iterator<_CharT, _Alloc>& __x,
+ const _Rope_iterator<_CharT, _Alloc>& __y)
+ { return !(__x < __y); }
+
+ template <class _CharT, class _Alloc>
+ inline ptrdiff_t
+ operator-(const _Rope_iterator<_CharT, _Alloc>& __x,
+ const _Rope_iterator<_CharT, _Alloc>& __y)
+ { return ((ptrdiff_t)__x._M_current_pos
+ - (ptrdiff_t)__y._M_current_pos); }
+
+ template <class _CharT, class _Alloc>
+ inline _Rope_iterator<_CharT, _Alloc>
+ operator-(const _Rope_iterator<_CharT, _Alloc>& __x,
+ ptrdiff_t __n)
+ { return _Rope_iterator<_CharT, _Alloc>(__x._M_root_rope,
+ __x._M_current_pos - __n); }
+
+ template <class _CharT, class _Alloc>
+ inline _Rope_iterator<_CharT, _Alloc>
+ operator+(const _Rope_iterator<_CharT, _Alloc>& __x, ptrdiff_t __n)
+ { return _Rope_iterator<_CharT, _Alloc>(__x._M_root_rope,
+ __x._M_current_pos + __n); }
+
+ template <class _CharT, class _Alloc>
+ inline _Rope_iterator<_CharT, _Alloc>
+ operator+(ptrdiff_t __n, const _Rope_iterator<_CharT, _Alloc>& __x)
+ { return _Rope_iterator<_CharT, _Alloc>(__x._M_root_rope,
+ __x._M_current_pos + __n); }
+
+ template <class _CharT, class _Alloc>
+ inline rope<_CharT, _Alloc>
+ operator+(const rope<_CharT, _Alloc>& __left,
+ const rope<_CharT, _Alloc>& __right)
+ {
+ // Inlining this should make it possible to keep __left and
+ // __right in registers.
+ typedef rope<_CharT, _Alloc> rope_type;
+ return rope_type(rope_type::_S_concat(__left._M_tree_ptr,
+ __right._M_tree_ptr));
+ }
+
+ template <class _CharT, class _Alloc>
+ inline rope<_CharT, _Alloc>&
+ operator+=(rope<_CharT, _Alloc>& __left,
+ const rope<_CharT, _Alloc>& __right)
+ {
+ __left.append(__right);
+ return __left;
+ }
+
+ template <class _CharT, class _Alloc>
+ inline rope<_CharT, _Alloc>
+ operator+(const rope<_CharT, _Alloc>& __left,
+ const _CharT* __right)
+ {
+ typedef rope<_CharT, _Alloc> rope_type;
+ size_t __rlen = rope_type::_S_char_ptr_len(__right);
+ return rope_type(rope_type::_S_concat_char_iter(__left._M_tree_ptr,
+ __right, __rlen));
+ }
+
+ template <class _CharT, class _Alloc>
+ inline rope<_CharT, _Alloc>&
+ operator+=(rope<_CharT, _Alloc>& __left,
+ const _CharT* __right)
+ {
+ __left.append(__right);
+ return __left;
+ }
+
+ template <class _CharT, class _Alloc>
+ inline rope<_CharT, _Alloc>
+ operator+(const rope<_CharT, _Alloc>& __left, _CharT __right)
+ {
+ typedef rope<_CharT, _Alloc> rope_type;
+ return rope_type(rope_type::_S_concat_char_iter(__left._M_tree_ptr,
+ &__right, 1));
+ }
+
+ template <class _CharT, class _Alloc>
+ inline rope<_CharT, _Alloc>&
+ operator+=(rope<_CharT, _Alloc>& __left, _CharT __right)
+ {
+ __left.append(__right);
+ return __left;
+ }
+
+ template <class _CharT, class _Alloc>
+ bool
+ operator<(const rope<_CharT, _Alloc>& __left,
+ const rope<_CharT, _Alloc>& __right)
+ { return __left.compare(__right) < 0; }
+
+ template <class _CharT, class _Alloc>
+ bool
+ operator==(const rope<_CharT, _Alloc>& __left,
+ const rope<_CharT, _Alloc>& __right)
+ { return __left.compare(__right) == 0; }
+
+ template <class _CharT, class _Alloc>
+ inline bool
+ operator==(const _Rope_char_ptr_proxy<_CharT, _Alloc>& __x,
+ const _Rope_char_ptr_proxy<_CharT, _Alloc>& __y)
+ { return (__x._M_pos == __y._M_pos && __x._M_root == __y._M_root); }
+
+ template <class _CharT, class _Alloc>
+ inline bool
+ operator!=(const rope<_CharT, _Alloc>& __x,
+ const rope<_CharT, _Alloc>& __y)
+ { return !(__x == __y); }
+
+ template <class _CharT, class _Alloc>
+ inline bool
+ operator>(const rope<_CharT, _Alloc>& __x,
+ const rope<_CharT, _Alloc>& __y)
+ { return __y < __x; }
+
+ template <class _CharT, class _Alloc>
+ inline bool
+ operator<=(const rope<_CharT, _Alloc>& __x,
+ const rope<_CharT, _Alloc>& __y)
+ { return !(__y < __x); }
+
+ template <class _CharT, class _Alloc>
+ inline bool
+ operator>=(const rope<_CharT, _Alloc>& __x,
+ const rope<_CharT, _Alloc>& __y)
+ { return !(__x < __y); }
+
+ template <class _CharT, class _Alloc>
+ inline bool
+ operator!=(const _Rope_char_ptr_proxy<_CharT, _Alloc>& __x,
+ const _Rope_char_ptr_proxy<_CharT, _Alloc>& __y)
+ { return !(__x == __y); }
+
+ template<class _CharT, class _Traits, class _Alloc>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __o,
+ const rope<_CharT, _Alloc>& __r);
+
+ typedef rope<char> crope;
+ typedef rope<wchar_t> wrope;
+
+ inline crope::reference
+ __mutable_reference_at(crope& __c, size_t __i)
+ { return __c.mutable_reference_at(__i); }
+
+ inline wrope::reference
+ __mutable_reference_at(wrope& __c, size_t __i)
+ { return __c.mutable_reference_at(__i); }
+
+ template <class _CharT, class _Alloc>
+ inline void
+ swap(rope<_CharT, _Alloc>& __x, rope<_CharT, _Alloc>& __y)
+ { __x.swap(__y); }
+
+_GLIBCXX_END_NAMESPACE
+
+
+namespace std
+{
+namespace tr1
+{
+ template<>
+ struct hash<__gnu_cxx::crope>
+ {
+ size_t
+ operator()(const __gnu_cxx::crope& __str) const
+ {
+ size_t __size = __str.size();
+ if (0 == __size)
+ return 0;
+ return 13 * __str[0] + 5 * __str[__size - 1] + __size;
+ }
+ };
+
+
+ template<>
+ struct hash<__gnu_cxx::wrope>
+ {
+ size_t
+ operator()(const __gnu_cxx::wrope& __str) const
+ {
+ size_t __size = __str.size();
+ if (0 == __size)
+ return 0;
+ return 13 * __str[0] + 5 * __str[__size - 1] + __size;
+ }
+ };
+} // namespace tr1
+} // namespace std
+
+# include <ext/ropeimpl.h>
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/ropeimpl.h b/i686-linux/include/c++/4.4.3/ext/ropeimpl.h
new file mode 100644
index 0000000..e79bca4
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/ropeimpl.h
@@ -0,0 +1,1701 @@
+// SGI's rope class implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file ropeimpl.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#include <cstdio>
+#include <ostream>
+#include <bits/functexcept.h>
+
+#include <ext/algorithm> // For copy_n and lexicographical_compare_3way
+#include <ext/memory> // For uninitialized_copy_n
+#include <ext/numeric> // For power
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::size_t;
+ using std::printf;
+ using std::basic_ostream;
+ using std::__throw_length_error;
+ using std::_Destroy;
+ using std::uninitialized_fill_n;
+
+ // Set buf_start, buf_end, and buf_ptr appropriately, filling tmp_buf
+ // if necessary. Assumes _M_path_end[leaf_index] and leaf_pos are correct.
+ // Results in a valid buf_ptr if the iterator can be legitimately
+ // dereferenced.
+ template <class _CharT, class _Alloc>
+ void
+ _Rope_iterator_base<_CharT, _Alloc>::
+ _S_setbuf(_Rope_iterator_base<_CharT, _Alloc>& __x)
+ {
+ const _RopeRep* __leaf = __x._M_path_end[__x._M_leaf_index];
+ size_t __leaf_pos = __x._M_leaf_pos;
+ size_t __pos = __x._M_current_pos;
+
+ switch(__leaf->_M_tag)
+ {
+ case __detail::_S_leaf:
+ __x._M_buf_start = ((_Rope_RopeLeaf<_CharT, _Alloc>*)__leaf)->_M_data;
+ __x._M_buf_ptr = __x._M_buf_start + (__pos - __leaf_pos);
+ __x._M_buf_end = __x._M_buf_start + __leaf->_M_size;
+ break;
+ case __detail::_S_function:
+ case __detail::_S_substringfn:
+ {
+ size_t __len = _S_iterator_buf_len;
+ size_t __buf_start_pos = __leaf_pos;
+ size_t __leaf_end = __leaf_pos + __leaf->_M_size;
+ char_producer<_CharT>* __fn = ((_Rope_RopeFunction<_CharT,
+ _Alloc>*)__leaf)->_M_fn;
+ if (__buf_start_pos + __len <= __pos)
+ {
+ __buf_start_pos = __pos - __len / 4;
+ if (__buf_start_pos + __len > __leaf_end)
+ __buf_start_pos = __leaf_end - __len;
+ }
+ if (__buf_start_pos + __len > __leaf_end)
+ __len = __leaf_end - __buf_start_pos;
+ (*__fn)(__buf_start_pos - __leaf_pos, __len, __x._M_tmp_buf);
+ __x._M_buf_ptr = __x._M_tmp_buf + (__pos - __buf_start_pos);
+ __x._M_buf_start = __x._M_tmp_buf;
+ __x._M_buf_end = __x._M_tmp_buf + __len;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ // Set path and buffer inside a rope iterator. We assume that
+ // pos and root are already set.
+ template <class _CharT, class _Alloc>
+ void
+ _Rope_iterator_base<_CharT, _Alloc>::
+ _S_setcache(_Rope_iterator_base<_CharT, _Alloc>& __x)
+ {
+ const _RopeRep* __path[int(__detail::_S_max_rope_depth) + 1];
+ const _RopeRep* __curr_rope;
+ int __curr_depth = -1; /* index into path */
+ size_t __curr_start_pos = 0;
+ size_t __pos = __x._M_current_pos;
+ unsigned char __dirns = 0; // Bit vector marking right turns in the path
+
+ if (__pos >= __x._M_root->_M_size)
+ {
+ __x._M_buf_ptr = 0;
+ return;
+ }
+ __curr_rope = __x._M_root;
+ if (0 != __curr_rope->_M_c_string)
+ {
+ /* Treat the root as a leaf. */
+ __x._M_buf_start = __curr_rope->_M_c_string;
+ __x._M_buf_end = __curr_rope->_M_c_string + __curr_rope->_M_size;
+ __x._M_buf_ptr = __curr_rope->_M_c_string + __pos;
+ __x._M_path_end[0] = __curr_rope;
+ __x._M_leaf_index = 0;
+ __x._M_leaf_pos = 0;
+ return;
+ }
+ for(;;)
+ {
+ ++__curr_depth;
+ __path[__curr_depth] = __curr_rope;
+ switch(__curr_rope->_M_tag)
+ {
+ case __detail::_S_leaf:
+ case __detail::_S_function:
+ case __detail::_S_substringfn:
+ __x._M_leaf_pos = __curr_start_pos;
+ goto done;
+ case __detail::_S_concat:
+ {
+ _Rope_RopeConcatenation<_CharT, _Alloc>* __c =
+ (_Rope_RopeConcatenation<_CharT, _Alloc>*)__curr_rope;
+ _RopeRep* __left = __c->_M_left;
+ size_t __left_len = __left->_M_size;
+
+ __dirns <<= 1;
+ if (__pos >= __curr_start_pos + __left_len)
+ {
+ __dirns |= 1;
+ __curr_rope = __c->_M_right;
+ __curr_start_pos += __left_len;
+ }
+ else
+ __curr_rope = __left;
+ }
+ break;
+ }
+ }
+ done:
+ // Copy last section of path into _M_path_end.
+ {
+ int __i = -1;
+ int __j = __curr_depth + 1 - int(_S_path_cache_len);
+
+ if (__j < 0) __j = 0;
+ while (__j <= __curr_depth)
+ __x._M_path_end[++__i] = __path[__j++];
+ __x._M_leaf_index = __i;
+ }
+ __x._M_path_directions = __dirns;
+ _S_setbuf(__x);
+ }
+
+ // Specialized version of the above. Assumes that
+ // the path cache is valid for the previous position.
+ template <class _CharT, class _Alloc>
+ void
+ _Rope_iterator_base<_CharT, _Alloc>::
+ _S_setcache_for_incr(_Rope_iterator_base<_CharT, _Alloc>& __x)
+ {
+ int __current_index = __x._M_leaf_index;
+ const _RopeRep* __current_node = __x._M_path_end[__current_index];
+ size_t __len = __current_node->_M_size;
+ size_t __node_start_pos = __x._M_leaf_pos;
+ unsigned char __dirns = __x._M_path_directions;
+ _Rope_RopeConcatenation<_CharT, _Alloc>* __c;
+
+ if (__x._M_current_pos - __node_start_pos < __len)
+ {
+ /* More stuff in this leaf, we just didn't cache it. */
+ _S_setbuf(__x);
+ return;
+ }
+ // node_start_pos is starting position of last_node.
+ while (--__current_index >= 0)
+ {
+ if (!(__dirns & 1) /* Path turned left */)
+ break;
+ __current_node = __x._M_path_end[__current_index];
+ __c = (_Rope_RopeConcatenation<_CharT, _Alloc>*)__current_node;
+ // Otherwise we were in the right child. Thus we should pop
+ // the concatenation node.
+ __node_start_pos -= __c->_M_left->_M_size;
+ __dirns >>= 1;
+ }
+ if (__current_index < 0)
+ {
+ // We underflowed the cache. Punt.
+ _S_setcache(__x);
+ return;
+ }
+ __current_node = __x._M_path_end[__current_index];
+ __c = (_Rope_RopeConcatenation<_CharT, _Alloc>*)__current_node;
+ // current_node is a concatenation node. We are positioned on the first
+ // character in its right child.
+ // node_start_pos is starting position of current_node.
+ __node_start_pos += __c->_M_left->_M_size;
+ __current_node = __c->_M_right;
+ __x._M_path_end[++__current_index] = __current_node;
+ __dirns |= 1;
+ while (__detail::_S_concat == __current_node->_M_tag)
+ {
+ ++__current_index;
+ if (int(_S_path_cache_len) == __current_index)
+ {
+ int __i;
+ for (__i = 0; __i < int(_S_path_cache_len) - 1; __i++)
+ __x._M_path_end[__i] = __x._M_path_end[__i+1];
+ --__current_index;
+ }
+ __current_node =
+ ((_Rope_RopeConcatenation<_CharT, _Alloc>*)__current_node)->_M_left;
+ __x._M_path_end[__current_index] = __current_node;
+ __dirns <<= 1;
+ // node_start_pos is unchanged.
+ }
+ __x._M_leaf_index = __current_index;
+ __x._M_leaf_pos = __node_start_pos;
+ __x._M_path_directions = __dirns;
+ _S_setbuf(__x);
+ }
+
+ template <class _CharT, class _Alloc>
+ void
+ _Rope_iterator_base<_CharT, _Alloc>::
+ _M_incr(size_t __n)
+ {
+ _M_current_pos += __n;
+ if (0 != _M_buf_ptr)
+ {
+ size_t __chars_left = _M_buf_end - _M_buf_ptr;
+ if (__chars_left > __n)
+ _M_buf_ptr += __n;
+ else if (__chars_left == __n)
+ {
+ _M_buf_ptr += __n;
+ _S_setcache_for_incr(*this);
+ }
+ else
+ _M_buf_ptr = 0;
+ }
+ }
+
+ template <class _CharT, class _Alloc>
+ void
+ _Rope_iterator_base<_CharT, _Alloc>::
+ _M_decr(size_t __n)
+ {
+ if (0 != _M_buf_ptr)
+ {
+ size_t __chars_left = _M_buf_ptr - _M_buf_start;
+ if (__chars_left >= __n)
+ _M_buf_ptr -= __n;
+ else
+ _M_buf_ptr = 0;
+ }
+ _M_current_pos -= __n;
+ }
+
+ template <class _CharT, class _Alloc>
+ void
+ _Rope_iterator<_CharT, _Alloc>::
+ _M_check()
+ {
+ if (_M_root_rope->_M_tree_ptr != this->_M_root)
+ {
+ // _Rope was modified. Get things fixed up.
+ _RopeRep::_S_unref(this->_M_root);
+ this->_M_root = _M_root_rope->_M_tree_ptr;
+ _RopeRep::_S_ref(this->_M_root);
+ this->_M_buf_ptr = 0;
+ }
+ }
+
+ template <class _CharT, class _Alloc>
+ inline
+ _Rope_const_iterator<_CharT, _Alloc>::
+ _Rope_const_iterator(const _Rope_iterator<_CharT, _Alloc>& __x)
+ : _Rope_iterator_base<_CharT, _Alloc>(__x)
+ { }
+
+ template <class _CharT, class _Alloc>
+ inline
+ _Rope_iterator<_CharT, _Alloc>::
+ _Rope_iterator(rope<_CharT, _Alloc>& __r, size_t __pos)
+ : _Rope_iterator_base<_CharT,_Alloc>(__r._M_tree_ptr, __pos),
+ _M_root_rope(&__r)
+ { _RopeRep::_S_ref(this->_M_root); }
+
+ template <class _CharT, class _Alloc>
+ inline size_t
+ rope<_CharT, _Alloc>::
+ _S_char_ptr_len(const _CharT* __s)
+ {
+ const _CharT* __p = __s;
+
+ while (!_S_is0(*__p))
+ ++__p;
+ return (__p - __s);
+ }
+
+
+#ifndef __GC
+
+ template <class _CharT, class _Alloc>
+ inline void
+ _Rope_RopeRep<_CharT, _Alloc>::
+ _M_free_c_string()
+ {
+ _CharT* __cstr = _M_c_string;
+ if (0 != __cstr)
+ {
+ size_t __size = this->_M_size + 1;
+ _Destroy(__cstr, __cstr + __size, _M_get_allocator());
+ this->_Data_deallocate(__cstr, __size);
+ }
+ }
+
+ template <class _CharT, class _Alloc>
+ inline void
+ _Rope_RopeRep<_CharT, _Alloc>::
+ _S_free_string(_CharT* __s, size_t __n, allocator_type& __a)
+ {
+ if (!_S_is_basic_char_type((_CharT*)0))
+ _Destroy(__s, __s + __n, __a);
+
+ // This has to be a static member, so this gets a bit messy
+ __a.deallocate(__s,
+ _Rope_RopeLeaf<_CharT, _Alloc>::_S_rounded_up_size(__n));
+ }
+
+ // There are several reasons for not doing this with virtual destructors
+ // and a class specific delete operator:
+ // - A class specific delete operator can't easily get access to
+ // allocator instances if we need them.
+ // - Any virtual function would need a 4 or byte vtable pointer;
+ // this only requires a one byte tag per object.
+ template <class _CharT, class _Alloc>
+ void
+ _Rope_RopeRep<_CharT, _Alloc>::
+ _M_free_tree()
+ {
+ switch(_M_tag)
+ {
+ case __detail::_S_leaf:
+ {
+ _Rope_RopeLeaf<_CharT, _Alloc>* __l
+ = (_Rope_RopeLeaf<_CharT, _Alloc>*)this;
+ __l->_Rope_RopeLeaf<_CharT, _Alloc>::~_Rope_RopeLeaf();
+ _L_deallocate(__l, 1);
+ break;
+ }
+ case __detail::_S_concat:
+ {
+ _Rope_RopeConcatenation<_CharT,_Alloc>* __c
+ = (_Rope_RopeConcatenation<_CharT, _Alloc>*)this;
+ __c->_Rope_RopeConcatenation<_CharT, _Alloc>::
+ ~_Rope_RopeConcatenation();
+ _C_deallocate(__c, 1);
+ break;
+ }
+ case __detail::_S_function:
+ {
+ _Rope_RopeFunction<_CharT, _Alloc>* __f
+ = (_Rope_RopeFunction<_CharT, _Alloc>*)this;
+ __f->_Rope_RopeFunction<_CharT, _Alloc>::~_Rope_RopeFunction();
+ _F_deallocate(__f, 1);
+ break;
+ }
+ case __detail::_S_substringfn:
+ {
+ _Rope_RopeSubstring<_CharT, _Alloc>* __ss =
+ (_Rope_RopeSubstring<_CharT, _Alloc>*)this;
+ __ss->_Rope_RopeSubstring<_CharT, _Alloc>::
+ ~_Rope_RopeSubstring();
+ _S_deallocate(__ss, 1);
+ break;
+ }
+ }
+ }
+#else
+
+ template <class _CharT, class _Alloc>
+ inline void
+ _Rope_RopeRep<_CharT, _Alloc>::
+ _S_free_string(const _CharT*, size_t, allocator_type)
+ { }
+
+#endif
+
+ // Concatenate a C string onto a leaf rope by copying the rope data.
+ // Used for short ropes.
+ template <class _CharT, class _Alloc>
+ typename rope<_CharT, _Alloc>::_RopeLeaf*
+ rope<_CharT, _Alloc>::
+ _S_leaf_concat_char_iter(_RopeLeaf* __r, const _CharT* __iter, size_t __len)
+ {
+ size_t __old_len = __r->_M_size;
+ _CharT* __new_data = (_CharT*)
+ _Data_allocate(_S_rounded_up_size(__old_len + __len));
+ _RopeLeaf* __result;
+
+ uninitialized_copy_n(__r->_M_data, __old_len, __new_data);
+ uninitialized_copy_n(__iter, __len, __new_data + __old_len);
+ _S_cond_store_eos(__new_data[__old_len + __len]);
+ __try
+ {
+ __result = _S_new_RopeLeaf(__new_data, __old_len + __len,
+ __r->_M_get_allocator());
+ }
+ __catch(...)
+ {
+ _RopeRep::__STL_FREE_STRING(__new_data, __old_len + __len,
+ __r->_M_get_allocator());
+ __throw_exception_again;
+ }
+ return __result;
+ }
+
+#ifndef __GC
+ // As above, but it's OK to clobber original if refcount is 1
+ template <class _CharT, class _Alloc>
+ typename rope<_CharT,_Alloc>::_RopeLeaf*
+ rope<_CharT, _Alloc>::
+ _S_destr_leaf_concat_char_iter(_RopeLeaf* __r, const _CharT* __iter,
+ size_t __len)
+ {
+ if (__r->_M_ref_count > 1)
+ return _S_leaf_concat_char_iter(__r, __iter, __len);
+ size_t __old_len = __r->_M_size;
+ if (_S_allocated_capacity(__old_len) >= __old_len + __len)
+ {
+ // The space has been partially initialized for the standard
+ // character types. But that doesn't matter for those types.
+ uninitialized_copy_n(__iter, __len, __r->_M_data + __old_len);
+ if (_S_is_basic_char_type((_CharT*)0))
+ _S_cond_store_eos(__r->_M_data[__old_len + __len]);
+ else if (__r->_M_c_string != __r->_M_data && 0 != __r->_M_c_string)
+ {
+ __r->_M_free_c_string();
+ __r->_M_c_string = 0;
+ }
+ __r->_M_size = __old_len + __len;
+ __r->_M_ref_count = 2;
+ return __r;
+ }
+ else
+ {
+ _RopeLeaf* __result = _S_leaf_concat_char_iter(__r, __iter, __len);
+ return __result;
+ }
+ }
+#endif
+
+ // Assumes left and right are not 0.
+ // Does not increment (nor decrement on exception) child reference counts.
+ // Result has ref count 1.
+ template <class _CharT, class _Alloc>
+ typename rope<_CharT, _Alloc>::_RopeRep*
+ rope<_CharT, _Alloc>::
+ _S_tree_concat(_RopeRep* __left, _RopeRep* __right)
+ {
+ _RopeConcatenation* __result = _S_new_RopeConcatenation(__left, __right,
+ __left->
+ _M_get_allocator());
+ size_t __depth = __result->_M_depth;
+
+ if (__depth > 20
+ && (__result->_M_size < 1000
+ || __depth > size_t(__detail::_S_max_rope_depth)))
+ {
+ _RopeRep* __balanced;
+
+ __try
+ {
+ __balanced = _S_balance(__result);
+ __result->_M_unref_nonnil();
+ }
+ __catch(...)
+ {
+ _C_deallocate(__result,1);
+ __throw_exception_again;
+ }
+ // In case of exception, we need to deallocate
+ // otherwise dangling result node. But caller
+ // still owns its children. Thus unref is
+ // inappropriate.
+ return __balanced;
+ }
+ else
+ return __result;
+ }
+
+ template <class _CharT, class _Alloc>
+ typename rope<_CharT, _Alloc>::_RopeRep*
+ rope<_CharT, _Alloc>::
+ _S_concat_char_iter(_RopeRep* __r, const _CharT*__s, size_t __slen)
+ {
+ _RopeRep* __result;
+ if (0 == __slen)
+ {
+ _S_ref(__r);
+ return __r;
+ }
+ if (0 == __r)
+ return __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen,
+ __r->_M_get_allocator());
+ if (__r->_M_tag == __detail::_S_leaf
+ && __r->_M_size + __slen <= size_t(_S_copy_max))
+ {
+ __result = _S_leaf_concat_char_iter((_RopeLeaf*)__r, __s, __slen);
+ return __result;
+ }
+ if (__detail::_S_concat == __r->_M_tag
+ && __detail::_S_leaf == ((_RopeConcatenation*) __r)->_M_right->_M_tag)
+ {
+ _RopeLeaf* __right =
+ (_RopeLeaf* )(((_RopeConcatenation* )__r)->_M_right);
+ if (__right->_M_size + __slen <= size_t(_S_copy_max))
+ {
+ _RopeRep* __left = ((_RopeConcatenation*)__r)->_M_left;
+ _RopeRep* __nright =
+ _S_leaf_concat_char_iter((_RopeLeaf*)__right, __s, __slen);
+ __left->_M_ref_nonnil();
+ __try
+ { __result = _S_tree_concat(__left, __nright); }
+ __catch(...)
+ {
+ _S_unref(__left);
+ _S_unref(__nright);
+ __throw_exception_again;
+ }
+ return __result;
+ }
+ }
+ _RopeRep* __nright =
+ __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen, __r->_M_get_allocator());
+ __try
+ {
+ __r->_M_ref_nonnil();
+ __result = _S_tree_concat(__r, __nright);
+ }
+ __catch(...)
+ {
+ _S_unref(__r);
+ _S_unref(__nright);
+ __throw_exception_again;
+ }
+ return __result;
+ }
+
+#ifndef __GC
+ template <class _CharT, class _Alloc>
+ typename rope<_CharT,_Alloc>::_RopeRep*
+ rope<_CharT,_Alloc>::
+ _S_destr_concat_char_iter(_RopeRep* __r, const _CharT* __s, size_t __slen)
+ {
+ _RopeRep* __result;
+ if (0 == __r)
+ return __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen,
+ __r->_M_get_allocator());
+ size_t __count = __r->_M_ref_count;
+ size_t __orig_size = __r->_M_size;
+ if (__count > 1)
+ return _S_concat_char_iter(__r, __s, __slen);
+ if (0 == __slen)
+ {
+ __r->_M_ref_count = 2; // One more than before
+ return __r;
+ }
+ if (__orig_size + __slen <= size_t(_S_copy_max)
+ && __detail::_S_leaf == __r->_M_tag)
+ {
+ __result = _S_destr_leaf_concat_char_iter((_RopeLeaf*)__r, __s,
+ __slen);
+ return __result;
+ }
+ if (__detail::_S_concat == __r->_M_tag)
+ {
+ _RopeLeaf* __right = (_RopeLeaf*)(((_RopeConcatenation*)
+ __r)->_M_right);
+ if (__detail::_S_leaf == __right->_M_tag
+ && __right->_M_size + __slen <= size_t(_S_copy_max))
+ {
+ _RopeRep* __new_right =
+ _S_destr_leaf_concat_char_iter(__right, __s, __slen);
+ if (__right == __new_right)
+ __new_right->_M_ref_count = 1;
+ else
+ __right->_M_unref_nonnil();
+ __r->_M_ref_count = 2; // One more than before.
+ ((_RopeConcatenation*)__r)->_M_right = __new_right;
+ __r->_M_size = __orig_size + __slen;
+ if (0 != __r->_M_c_string)
+ {
+ __r->_M_free_c_string();
+ __r->_M_c_string = 0;
+ }
+ return __r;
+ }
+ }
+ _RopeRep* __right =
+ __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen, __r->_M_get_allocator());
+ __r->_M_ref_nonnil();
+ __try
+ { __result = _S_tree_concat(__r, __right); }
+ __catch(...)
+ {
+ _S_unref(__r);
+ _S_unref(__right);
+ __throw_exception_again;
+ }
+ return __result;
+ }
+#endif /* !__GC */
+
+ template <class _CharT, class _Alloc>
+ typename rope<_CharT, _Alloc>::_RopeRep*
+ rope<_CharT, _Alloc>::
+ _S_concat(_RopeRep* __left, _RopeRep* __right)
+ {
+ if (0 == __left)
+ {
+ _S_ref(__right);
+ return __right;
+ }
+ if (0 == __right)
+ {
+ __left->_M_ref_nonnil();
+ return __left;
+ }
+ if (__detail::_S_leaf == __right->_M_tag)
+ {
+ if (__detail::_S_leaf == __left->_M_tag)
+ {
+ if (__right->_M_size + __left->_M_size <= size_t(_S_copy_max))
+ return _S_leaf_concat_char_iter((_RopeLeaf*)__left,
+ ((_RopeLeaf*)__right)->_M_data,
+ __right->_M_size);
+ }
+ else if (__detail::_S_concat == __left->_M_tag
+ && __detail::_S_leaf == ((_RopeConcatenation*)
+ __left)->_M_right->_M_tag)
+ {
+ _RopeLeaf* __leftright =
+ (_RopeLeaf*)(((_RopeConcatenation*)__left)->_M_right);
+ if (__leftright->_M_size
+ + __right->_M_size <= size_t(_S_copy_max))
+ {
+ _RopeRep* __leftleft = ((_RopeConcatenation*)__left)->_M_left;
+ _RopeRep* __rest = _S_leaf_concat_char_iter(__leftright,
+ ((_RopeLeaf*)
+ __right)->
+ _M_data,
+ __right->_M_size);
+ __leftleft->_M_ref_nonnil();
+ __try
+ { return(_S_tree_concat(__leftleft, __rest)); }
+ __catch(...)
+ {
+ _S_unref(__leftleft);
+ _S_unref(__rest);
+ __throw_exception_again;
+ }
+ }
+ }
+ }
+ __left->_M_ref_nonnil();
+ __right->_M_ref_nonnil();
+ __try
+ { return(_S_tree_concat(__left, __right)); }
+ __catch(...)
+ {
+ _S_unref(__left);
+ _S_unref(__right);
+ __throw_exception_again;
+ }
+ }
+
+ template <class _CharT, class _Alloc>
+ typename rope<_CharT, _Alloc>::_RopeRep*
+ rope<_CharT, _Alloc>::
+ _S_substring(_RopeRep* __base, size_t __start, size_t __endp1)
+ {
+ if (0 == __base)
+ return 0;
+ size_t __len = __base->_M_size;
+ size_t __adj_endp1;
+ const size_t __lazy_threshold = 128;
+
+ if (__endp1 >= __len)
+ {
+ if (0 == __start)
+ {
+ __base->_M_ref_nonnil();
+ return __base;
+ }
+ else
+ __adj_endp1 = __len;
+
+ }
+ else
+ __adj_endp1 = __endp1;
+
+ switch(__base->_M_tag)
+ {
+ case __detail::_S_concat:
+ {
+ _RopeConcatenation* __c = (_RopeConcatenation*)__base;
+ _RopeRep* __left = __c->_M_left;
+ _RopeRep* __right = __c->_M_right;
+ size_t __left_len = __left->_M_size;
+ _RopeRep* __result;
+
+ if (__adj_endp1 <= __left_len)
+ return _S_substring(__left, __start, __endp1);
+ else if (__start >= __left_len)
+ return _S_substring(__right, __start - __left_len,
+ __adj_endp1 - __left_len);
+ _Self_destruct_ptr __left_result(_S_substring(__left,
+ __start,
+ __left_len));
+ _Self_destruct_ptr __right_result(_S_substring(__right, 0,
+ __endp1
+ - __left_len));
+ __result = _S_concat(__left_result, __right_result);
+ return __result;
+ }
+ case __detail::_S_leaf:
+ {
+ _RopeLeaf* __l = (_RopeLeaf*)__base;
+ _RopeLeaf* __result;
+ size_t __result_len;
+ if (__start >= __adj_endp1)
+ return 0;
+ __result_len = __adj_endp1 - __start;
+ if (__result_len > __lazy_threshold)
+ goto lazy;
+#ifdef __GC
+ const _CharT* __section = __l->_M_data + __start;
+ __result = _S_new_RopeLeaf(__section, __result_len,
+ __base->_M_get_allocator());
+ __result->_M_c_string = 0; // Not eos terminated.
+#else
+ // We should sometimes create substring node instead.
+ __result = __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__l->_M_data + __start,
+ __result_len,
+ __base->
+ _M_get_allocator());
+#endif
+ return __result;
+ }
+ case __detail::_S_substringfn:
+ // Avoid introducing multiple layers of substring nodes.
+ {
+ _RopeSubstring* __old = (_RopeSubstring*)__base;
+ size_t __result_len;
+ if (__start >= __adj_endp1)
+ return 0;
+ __result_len = __adj_endp1 - __start;
+ if (__result_len > __lazy_threshold)
+ {
+ _RopeSubstring* __result =
+ _S_new_RopeSubstring(__old->_M_base,
+ __start + __old->_M_start,
+ __adj_endp1 - __start,
+ __base->_M_get_allocator());
+ return __result;
+
+ } // *** else fall through: ***
+ }
+ case __detail::_S_function:
+ {
+ _RopeFunction* __f = (_RopeFunction*)__base;
+ _CharT* __section;
+ size_t __result_len;
+ if (__start >= __adj_endp1)
+ return 0;
+ __result_len = __adj_endp1 - __start;
+
+ if (__result_len > __lazy_threshold)
+ goto lazy;
+ __section = (_CharT*)
+ _Data_allocate(_S_rounded_up_size(__result_len));
+ __try
+ { (*(__f->_M_fn))(__start, __result_len, __section); }
+ __catch(...)
+ {
+ _RopeRep::__STL_FREE_STRING(__section, __result_len,
+ __base->_M_get_allocator());
+ __throw_exception_again;
+ }
+ _S_cond_store_eos(__section[__result_len]);
+ return _S_new_RopeLeaf(__section, __result_len,
+ __base->_M_get_allocator());
+ }
+ }
+ lazy:
+ {
+ // Create substring node.
+ return _S_new_RopeSubstring(__base, __start, __adj_endp1 - __start,
+ __base->_M_get_allocator());
+ }
+ }
+
+ template<class _CharT>
+ class _Rope_flatten_char_consumer
+ : public _Rope_char_consumer<_CharT>
+ {
+ private:
+ _CharT* _M_buf_ptr;
+ public:
+
+ _Rope_flatten_char_consumer(_CharT* __buffer)
+ { _M_buf_ptr = __buffer; };
+
+ ~_Rope_flatten_char_consumer() {}
+
+ bool
+ operator()(const _CharT* __leaf, size_t __n)
+ {
+ uninitialized_copy_n(__leaf, __n, _M_buf_ptr);
+ _M_buf_ptr += __n;
+ return true;
+ }
+ };
+
+ template<class _CharT>
+ class _Rope_find_char_char_consumer
+ : public _Rope_char_consumer<_CharT>
+ {
+ private:
+ _CharT _M_pattern;
+ public:
+ size_t _M_count; // Number of nonmatching characters
+
+ _Rope_find_char_char_consumer(_CharT __p)
+ : _M_pattern(__p), _M_count(0) {}
+
+ ~_Rope_find_char_char_consumer() {}
+
+ bool
+ operator()(const _CharT* __leaf, size_t __n)
+ {
+ size_t __i;
+ for (__i = 0; __i < __n; __i++)
+ {
+ if (__leaf[__i] == _M_pattern)
+ {
+ _M_count += __i;
+ return false;
+ }
+ }
+ _M_count += __n; return true;
+ }
+ };
+
+ template<class _CharT, class _Traits>
+ // Here _CharT is both the stream and rope character type.
+ class _Rope_insert_char_consumer
+ : public _Rope_char_consumer<_CharT>
+ {
+ private:
+ typedef basic_ostream<_CharT,_Traits> _Insert_ostream;
+ _Insert_ostream& _M_o;
+ public:
+ _Rope_insert_char_consumer(_Insert_ostream& __writer)
+ : _M_o(__writer) {};
+ ~_Rope_insert_char_consumer() { };
+ // Caller is presumed to own the ostream
+ bool operator() (const _CharT* __leaf, size_t __n);
+ // Returns true to continue traversal.
+ };
+
+ template<class _CharT, class _Traits>
+ bool
+ _Rope_insert_char_consumer<_CharT, _Traits>::
+ operator()(const _CharT* __leaf, size_t __n)
+ {
+ size_t __i;
+ // We assume that formatting is set up correctly for each element.
+ for (__i = 0; __i < __n; __i++)
+ _M_o.put(__leaf[__i]);
+ return true;
+ }
+
+ template <class _CharT, class _Alloc>
+ bool
+ rope<_CharT, _Alloc>::
+ _S_apply_to_pieces(_Rope_char_consumer<_CharT>& __c,
+ const _RopeRep* __r, size_t __begin, size_t __end)
+ {
+ if (0 == __r)
+ return true;
+ switch(__r->_M_tag)
+ {
+ case __detail::_S_concat:
+ {
+ _RopeConcatenation* __conc = (_RopeConcatenation*)__r;
+ _RopeRep* __left = __conc->_M_left;
+ size_t __left_len = __left->_M_size;
+ if (__begin < __left_len)
+ {
+ size_t __left_end = std::min(__left_len, __end);
+ if (!_S_apply_to_pieces(__c, __left, __begin, __left_end))
+ return false;
+ }
+ if (__end > __left_len)
+ {
+ _RopeRep* __right = __conc->_M_right;
+ size_t __right_start = std::max(__left_len, __begin);
+ if (!_S_apply_to_pieces(__c, __right,
+ __right_start - __left_len,
+ __end - __left_len))
+ return false;
+ }
+ }
+ return true;
+ case __detail::_S_leaf:
+ {
+ _RopeLeaf* __l = (_RopeLeaf*)__r;
+ return __c(__l->_M_data + __begin, __end - __begin);
+ }
+ case __detail::_S_function:
+ case __detail::_S_substringfn:
+ {
+ _RopeFunction* __f = (_RopeFunction*)__r;
+ size_t __len = __end - __begin;
+ bool __result;
+ _CharT* __buffer =
+ (_CharT*)_Alloc().allocate(__len * sizeof(_CharT));
+ __try
+ {
+ (*(__f->_M_fn))(__begin, __len, __buffer);
+ __result = __c(__buffer, __len);
+ _Alloc().deallocate(__buffer, __len * sizeof(_CharT));
+ }
+ __catch(...)
+ {
+ _Alloc().deallocate(__buffer, __len * sizeof(_CharT));
+ __throw_exception_again;
+ }
+ return __result;
+ }
+ default:
+ return false;
+ }
+ }
+
+ template<class _CharT, class _Traits>
+ inline void
+ _Rope_fill(basic_ostream<_CharT, _Traits>& __o, size_t __n)
+ {
+ char __f = __o.fill();
+ size_t __i;
+
+ for (__i = 0; __i < __n; __i++)
+ __o.put(__f);
+ }
+
+
+ template <class _CharT>
+ inline bool
+ _Rope_is_simple(_CharT*)
+ { return false; }
+
+ inline bool
+ _Rope_is_simple(char*)
+ { return true; }
+
+ inline bool
+ _Rope_is_simple(wchar_t*)
+ { return true; }
+
+ template<class _CharT, class _Traits, class _Alloc>
+ basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __o,
+ const rope<_CharT, _Alloc>& __r)
+ {
+ size_t __w = __o.width();
+ bool __left = bool(__o.flags() & std::ios::left);
+ size_t __pad_len;
+ size_t __rope_len = __r.size();
+ _Rope_insert_char_consumer<_CharT, _Traits> __c(__o);
+ bool __is_simple = _Rope_is_simple((_CharT*)0);
+
+ if (__rope_len < __w)
+ __pad_len = __w - __rope_len;
+ else
+ __pad_len = 0;
+
+ if (!__is_simple)
+ __o.width(__w / __rope_len);
+ __try
+ {
+ if (__is_simple && !__left && __pad_len > 0)
+ _Rope_fill(__o, __pad_len);
+ __r.apply_to_pieces(0, __r.size(), __c);
+ if (__is_simple && __left && __pad_len > 0)
+ _Rope_fill(__o, __pad_len);
+ if (!__is_simple)
+ __o.width(__w);
+ }
+ __catch(...)
+ {
+ if (!__is_simple)
+ __o.width(__w);
+ __throw_exception_again;
+ }
+ return __o;
+ }
+
+ template <class _CharT, class _Alloc>
+ _CharT*
+ rope<_CharT, _Alloc>::
+ _S_flatten(_RopeRep* __r, size_t __start, size_t __len,
+ _CharT* __buffer)
+ {
+ _Rope_flatten_char_consumer<_CharT> __c(__buffer);
+ _S_apply_to_pieces(__c, __r, __start, __start + __len);
+ return(__buffer + __len);
+ }
+
+ template <class _CharT, class _Alloc>
+ size_t
+ rope<_CharT, _Alloc>::
+ find(_CharT __pattern, size_t __start) const
+ {
+ _Rope_find_char_char_consumer<_CharT> __c(__pattern);
+ _S_apply_to_pieces(__c, this->_M_tree_ptr, __start, size());
+ size_type __result_pos = __start + __c._M_count;
+#ifndef __STL_OLD_ROPE_SEMANTICS
+ if (__result_pos == size())
+ __result_pos = npos;
+#endif
+ return __result_pos;
+ }
+
+ template <class _CharT, class _Alloc>
+ _CharT*
+ rope<_CharT, _Alloc>::
+ _S_flatten(_RopeRep* __r, _CharT* __buffer)
+ {
+ if (0 == __r)
+ return __buffer;
+ switch(__r->_M_tag)
+ {
+ case __detail::_S_concat:
+ {
+ _RopeConcatenation* __c = (_RopeConcatenation*)__r;
+ _RopeRep* __left = __c->_M_left;
+ _RopeRep* __right = __c->_M_right;
+ _CharT* __rest = _S_flatten(__left, __buffer);
+ return _S_flatten(__right, __rest);
+ }
+ case __detail::_S_leaf:
+ {
+ _RopeLeaf* __l = (_RopeLeaf*)__r;
+ return copy_n(__l->_M_data, __l->_M_size, __buffer).second;
+ }
+ case __detail::_S_function:
+ case __detail::_S_substringfn:
+ // We don't yet do anything with substring nodes.
+ // This needs to be fixed before ropefiles will work well.
+ {
+ _RopeFunction* __f = (_RopeFunction*)__r;
+ (*(__f->_M_fn))(0, __f->_M_size, __buffer);
+ return __buffer + __f->_M_size;
+ }
+ default:
+ return 0;
+ }
+ }
+
+ // This needs work for _CharT != char
+ template <class _CharT, class _Alloc>
+ void
+ rope<_CharT, _Alloc>::
+ _S_dump(_RopeRep* __r, int __indent)
+ {
+ for (int __i = 0; __i < __indent; __i++)
+ putchar(' ');
+ if (0 == __r)
+ {
+ printf("NULL\n");
+ return;
+ }
+ if (_S_concat == __r->_M_tag)
+ {
+ _RopeConcatenation* __c = (_RopeConcatenation*)__r;
+ _RopeRep* __left = __c->_M_left;
+ _RopeRep* __right = __c->_M_right;
+
+#ifdef __GC
+ printf("Concatenation %p (depth = %d, len = %ld, %s balanced)\n",
+ __r, __r->_M_depth, __r->_M_size,
+ __r->_M_is_balanced? "" : "not");
+#else
+ printf("Concatenation %p (rc = %ld, depth = %d, "
+ "len = %ld, %s balanced)\n",
+ __r, __r->_M_ref_count, __r->_M_depth, __r->_M_size,
+ __r->_M_is_balanced? "" : "not");
+#endif
+ _S_dump(__left, __indent + 2);
+ _S_dump(__right, __indent + 2);
+ return;
+ }
+ else
+ {
+ char* __kind;
+
+ switch (__r->_M_tag)
+ {
+ case __detail::_S_leaf:
+ __kind = "Leaf";
+ break;
+ case __detail::_S_function:
+ __kind = "Function";
+ break;
+ case __detail::_S_substringfn:
+ __kind = "Function representing substring";
+ break;
+ default:
+ __kind = "(corrupted kind field!)";
+ }
+#ifdef __GC
+ printf("%s %p (depth = %d, len = %ld) ",
+ __kind, __r, __r->_M_depth, __r->_M_size);
+#else
+ printf("%s %p (rc = %ld, depth = %d, len = %ld) ",
+ __kind, __r, __r->_M_ref_count, __r->_M_depth, __r->_M_size);
+#endif
+ if (_S_is_one_byte_char_type((_CharT*)0))
+ {
+ const int __max_len = 40;
+ _Self_destruct_ptr __prefix(_S_substring(__r, 0, __max_len));
+ _CharT __buffer[__max_len + 1];
+ bool __too_big = __r->_M_size > __prefix->_M_size;
+
+ _S_flatten(__prefix, __buffer);
+ __buffer[__prefix->_M_size] = _S_eos((_CharT*)0);
+ printf("%s%s\n", (char*)__buffer,
+ __too_big? "...\n" : "\n");
+ }
+ else
+ printf("\n");
+ }
+ }
+
+ template <class _CharT, class _Alloc>
+ const unsigned long
+ rope<_CharT, _Alloc>::
+ _S_min_len[int(__detail::_S_max_rope_depth) + 1] = {
+ /* 0 */1, /* 1 */2, /* 2 */3, /* 3 */5, /* 4 */8, /* 5 */13, /* 6 */21,
+ /* 7 */34, /* 8 */55, /* 9 */89, /* 10 */144, /* 11 */233, /* 12 */377,
+ /* 13 */610, /* 14 */987, /* 15 */1597, /* 16 */2584, /* 17 */4181,
+ /* 18 */6765, /* 19 */10946, /* 20 */17711, /* 21 */28657, /* 22 */46368,
+ /* 23 */75025, /* 24 */121393, /* 25 */196418, /* 26 */317811,
+ /* 27 */514229, /* 28 */832040, /* 29 */1346269, /* 30 */2178309,
+ /* 31 */3524578, /* 32 */5702887, /* 33 */9227465, /* 34 */14930352,
+ /* 35 */24157817, /* 36 */39088169, /* 37 */63245986, /* 38 */102334155,
+ /* 39 */165580141, /* 40 */267914296, /* 41 */433494437,
+ /* 42 */701408733, /* 43 */1134903170, /* 44 */1836311903,
+ /* 45 */2971215073u };
+ // These are Fibonacci numbers < 2**32.
+
+ template <class _CharT, class _Alloc>
+ typename rope<_CharT, _Alloc>::_RopeRep*
+ rope<_CharT, _Alloc>::
+ _S_balance(_RopeRep* __r)
+ {
+ _RopeRep* __forest[int(__detail::_S_max_rope_depth) + 1];
+ _RopeRep* __result = 0;
+ int __i;
+ // Invariant:
+ // The concatenation of forest in descending order is equal to __r.
+ // __forest[__i]._M_size >= _S_min_len[__i]
+ // __forest[__i]._M_depth = __i
+ // References from forest are included in refcount.
+
+ for (__i = 0; __i <= int(__detail::_S_max_rope_depth); ++__i)
+ __forest[__i] = 0;
+ __try
+ {
+ _S_add_to_forest(__r, __forest);
+ for (__i = 0; __i <= int(__detail::_S_max_rope_depth); ++__i)
+ if (0 != __forest[__i])
+ {
+#ifndef __GC
+ _Self_destruct_ptr __old(__result);
+#endif
+ __result = _S_concat(__forest[__i], __result);
+ __forest[__i]->_M_unref_nonnil();
+#if !defined(__GC) && defined(__EXCEPTIONS)
+ __forest[__i] = 0;
+#endif
+ }
+ }
+ __catch(...)
+ {
+ for(__i = 0; __i <= int(__detail::_S_max_rope_depth); __i++)
+ _S_unref(__forest[__i]);
+ __throw_exception_again;
+ }
+
+ if (__result->_M_depth > int(__detail::_S_max_rope_depth))
+ __throw_length_error(__N("rope::_S_balance"));
+ return(__result);
+ }
+
+ template <class _CharT, class _Alloc>
+ void
+ rope<_CharT, _Alloc>::
+ _S_add_to_forest(_RopeRep* __r, _RopeRep** __forest)
+ {
+ if (__r->_M_is_balanced)
+ {
+ _S_add_leaf_to_forest(__r, __forest);
+ return;
+ }
+
+ {
+ _RopeConcatenation* __c = (_RopeConcatenation*)__r;
+
+ _S_add_to_forest(__c->_M_left, __forest);
+ _S_add_to_forest(__c->_M_right, __forest);
+ }
+ }
+
+
+ template <class _CharT, class _Alloc>
+ void
+ rope<_CharT, _Alloc>::
+ _S_add_leaf_to_forest(_RopeRep* __r, _RopeRep** __forest)
+ {
+ _RopeRep* __insertee; // included in refcount
+ _RopeRep* __too_tiny = 0; // included in refcount
+ int __i; // forest[0..__i-1] is empty
+ size_t __s = __r->_M_size;
+
+ for (__i = 0; __s >= _S_min_len[__i+1]/* not this bucket */; ++__i)
+ {
+ if (0 != __forest[__i])
+ {
+#ifndef __GC
+ _Self_destruct_ptr __old(__too_tiny);
+#endif
+ __too_tiny = _S_concat_and_set_balanced(__forest[__i],
+ __too_tiny);
+ __forest[__i]->_M_unref_nonnil();
+ __forest[__i] = 0;
+ }
+ }
+ {
+#ifndef __GC
+ _Self_destruct_ptr __old(__too_tiny);
+#endif
+ __insertee = _S_concat_and_set_balanced(__too_tiny, __r);
+ }
+ // Too_tiny dead, and no longer included in refcount.
+ // Insertee is live and included.
+ for (;; ++__i)
+ {
+ if (0 != __forest[__i])
+ {
+#ifndef __GC
+ _Self_destruct_ptr __old(__insertee);
+#endif
+ __insertee = _S_concat_and_set_balanced(__forest[__i],
+ __insertee);
+ __forest[__i]->_M_unref_nonnil();
+ __forest[__i] = 0;
+ }
+ if (__i == int(__detail::_S_max_rope_depth)
+ || __insertee->_M_size < _S_min_len[__i+1])
+ {
+ __forest[__i] = __insertee;
+ // refcount is OK since __insertee is now dead.
+ return;
+ }
+ }
+ }
+
+ template <class _CharT, class _Alloc>
+ _CharT
+ rope<_CharT, _Alloc>::
+ _S_fetch(_RopeRep* __r, size_type __i)
+ {
+ __GC_CONST _CharT* __cstr = __r->_M_c_string;
+
+ if (0 != __cstr)
+ return __cstr[__i];
+ for(;;)
+ {
+ switch(__r->_M_tag)
+ {
+ case __detail::_S_concat:
+ {
+ _RopeConcatenation* __c = (_RopeConcatenation*)__r;
+ _RopeRep* __left = __c->_M_left;
+ size_t __left_len = __left->_M_size;
+
+ if (__i >= __left_len)
+ {
+ __i -= __left_len;
+ __r = __c->_M_right;
+ }
+ else
+ __r = __left;
+ }
+ break;
+ case __detail::_S_leaf:
+ {
+ _RopeLeaf* __l = (_RopeLeaf*)__r;
+ return __l->_M_data[__i];
+ }
+ case __detail::_S_function:
+ case __detail::_S_substringfn:
+ {
+ _RopeFunction* __f = (_RopeFunction*)__r;
+ _CharT __result;
+
+ (*(__f->_M_fn))(__i, 1, &__result);
+ return __result;
+ }
+ }
+ }
+ }
+
+#ifndef __GC
+ // Return a uniquely referenced character slot for the given
+ // position, or 0 if that's not possible.
+ template <class _CharT, class _Alloc>
+ _CharT*
+ rope<_CharT, _Alloc>::
+ _S_fetch_ptr(_RopeRep* __r, size_type __i)
+ {
+ _RopeRep* __clrstack[__detail::_S_max_rope_depth];
+ size_t __csptr = 0;
+
+ for(;;)
+ {
+ if (__r->_M_ref_count > 1)
+ return 0;
+ switch(__r->_M_tag)
+ {
+ case __detail::_S_concat:
+ {
+ _RopeConcatenation* __c = (_RopeConcatenation*)__r;
+ _RopeRep* __left = __c->_M_left;
+ size_t __left_len = __left->_M_size;
+
+ if (__c->_M_c_string != 0)
+ __clrstack[__csptr++] = __c;
+ if (__i >= __left_len)
+ {
+ __i -= __left_len;
+ __r = __c->_M_right;
+ }
+ else
+ __r = __left;
+ }
+ break;
+ case __detail::_S_leaf:
+ {
+ _RopeLeaf* __l = (_RopeLeaf*)__r;
+ if (__l->_M_c_string != __l->_M_data && __l->_M_c_string != 0)
+ __clrstack[__csptr++] = __l;
+ while (__csptr > 0)
+ {
+ -- __csptr;
+ _RopeRep* __d = __clrstack[__csptr];
+ __d->_M_free_c_string();
+ __d->_M_c_string = 0;
+ }
+ return __l->_M_data + __i;
+ }
+ case __detail::_S_function:
+ case __detail::_S_substringfn:
+ return 0;
+ }
+ }
+ }
+#endif /* __GC */
+
+ // The following could be implemented trivially using
+ // lexicographical_compare_3way.
+ // We do a little more work to avoid dealing with rope iterators for
+ // flat strings.
+ template <class _CharT, class _Alloc>
+ int
+ rope<_CharT, _Alloc>::
+ _S_compare (const _RopeRep* __left, const _RopeRep* __right)
+ {
+ size_t __left_len;
+ size_t __right_len;
+
+ if (0 == __right)
+ return 0 != __left;
+ if (0 == __left)
+ return -1;
+ __left_len = __left->_M_size;
+ __right_len = __right->_M_size;
+ if (__detail::_S_leaf == __left->_M_tag)
+ {
+ _RopeLeaf* __l = (_RopeLeaf*) __left;
+ if (__detail::_S_leaf == __right->_M_tag)
+ {
+ _RopeLeaf* __r = (_RopeLeaf*) __right;
+ return lexicographical_compare_3way(__l->_M_data,
+ __l->_M_data + __left_len,
+ __r->_M_data, __r->_M_data
+ + __right_len);
+ }
+ else
+ {
+ const_iterator __rstart(__right, 0);
+ const_iterator __rend(__right, __right_len);
+ return lexicographical_compare_3way(__l->_M_data, __l->_M_data
+ + __left_len,
+ __rstart, __rend);
+ }
+ }
+ else
+ {
+ const_iterator __lstart(__left, 0);
+ const_iterator __lend(__left, __left_len);
+ if (__detail::_S_leaf == __right->_M_tag)
+ {
+ _RopeLeaf* __r = (_RopeLeaf*) __right;
+ return lexicographical_compare_3way(__lstart, __lend,
+ __r->_M_data, __r->_M_data
+ + __right_len);
+ }
+ else
+ {
+ const_iterator __rstart(__right, 0);
+ const_iterator __rend(__right, __right_len);
+ return lexicographical_compare_3way(__lstart, __lend,
+ __rstart, __rend);
+ }
+ }
+ }
+
+ // Assignment to reference proxies.
+ template <class _CharT, class _Alloc>
+ _Rope_char_ref_proxy<_CharT, _Alloc>&
+ _Rope_char_ref_proxy<_CharT, _Alloc>::
+ operator=(_CharT __c)
+ {
+ _RopeRep* __old = _M_root->_M_tree_ptr;
+#ifndef __GC
+ // First check for the case in which everything is uniquely
+ // referenced. In that case we can do this destructively.
+ _CharT* __ptr = _My_rope::_S_fetch_ptr(__old, _M_pos);
+ if (0 != __ptr)
+ {
+ *__ptr = __c;
+ return *this;
+ }
+#endif
+ _Self_destruct_ptr __left(_My_rope::_S_substring(__old, 0, _M_pos));
+ _Self_destruct_ptr __right(_My_rope::_S_substring(__old, _M_pos + 1,
+ __old->_M_size));
+ _Self_destruct_ptr __result_left(_My_rope::
+ _S_destr_concat_char_iter(__left,
+ &__c, 1));
+
+ _RopeRep* __result = _My_rope::_S_concat(__result_left, __right);
+#ifndef __GC
+ _RopeRep::_S_unref(__old);
+#endif
+ _M_root->_M_tree_ptr = __result;
+ return *this;
+ }
+
+ template <class _CharT, class _Alloc>
+ inline _Rope_char_ref_proxy<_CharT, _Alloc>::
+ operator _CharT() const
+ {
+ if (_M_current_valid)
+ return _M_current;
+ else
+ return _My_rope::_S_fetch(_M_root->_M_tree_ptr, _M_pos);
+ }
+
+ template <class _CharT, class _Alloc>
+ _Rope_char_ptr_proxy<_CharT, _Alloc>
+ _Rope_char_ref_proxy<_CharT, _Alloc>::
+ operator&() const
+ { return _Rope_char_ptr_proxy<_CharT, _Alloc>(*this); }
+
+ template <class _CharT, class _Alloc>
+ rope<_CharT, _Alloc>::
+ rope(size_t __n, _CharT __c, const allocator_type& __a)
+ : _Base(__a)
+ {
+ rope<_CharT,_Alloc> __result;
+ const size_t __exponentiate_threshold = 32;
+ size_t __exponent;
+ size_t __rest;
+ _CharT* __rest_buffer;
+ _RopeRep* __remainder;
+ rope<_CharT, _Alloc> __remainder_rope;
+
+ if (0 == __n)
+ return;
+
+ __exponent = __n / __exponentiate_threshold;
+ __rest = __n % __exponentiate_threshold;
+ if (0 == __rest)
+ __remainder = 0;
+ else
+ {
+ __rest_buffer = this->_Data_allocate(_S_rounded_up_size(__rest));
+ __uninitialized_fill_n_a(__rest_buffer, __rest, __c,
+ _M_get_allocator());
+ _S_cond_store_eos(__rest_buffer[__rest]);
+ __try
+ { __remainder = _S_new_RopeLeaf(__rest_buffer, __rest,
+ _M_get_allocator()); }
+ __catch(...)
+ {
+ _RopeRep::__STL_FREE_STRING(__rest_buffer, __rest,
+ _M_get_allocator());
+ __throw_exception_again;
+ }
+ }
+ __remainder_rope._M_tree_ptr = __remainder;
+ if (__exponent != 0)
+ {
+ _CharT* __base_buffer =
+ this->_Data_allocate(_S_rounded_up_size(__exponentiate_threshold));
+ _RopeLeaf* __base_leaf;
+ rope __base_rope;
+ __uninitialized_fill_n_a(__base_buffer, __exponentiate_threshold, __c,
+ _M_get_allocator());
+ _S_cond_store_eos(__base_buffer[__exponentiate_threshold]);
+ __try
+ {
+ __base_leaf = _S_new_RopeLeaf(__base_buffer,
+ __exponentiate_threshold,
+ _M_get_allocator());
+ }
+ __catch(...)
+ {
+ _RopeRep::__STL_FREE_STRING(__base_buffer,
+ __exponentiate_threshold,
+ _M_get_allocator());
+ __throw_exception_again;
+ }
+ __base_rope._M_tree_ptr = __base_leaf;
+ if (1 == __exponent)
+ __result = __base_rope;
+ else
+ __result = power(__base_rope, __exponent,
+ _Rope_Concat_fn<_CharT, _Alloc>());
+
+ if (0 != __remainder)
+ __result += __remainder_rope;
+ }
+ else
+ __result = __remainder_rope;
+
+ this->_M_tree_ptr = __result._M_tree_ptr;
+ this->_M_tree_ptr->_M_ref_nonnil();
+ }
+
+ template<class _CharT, class _Alloc>
+ _CharT
+ rope<_CharT, _Alloc>::_S_empty_c_str[1];
+
+ template<class _CharT, class _Alloc>
+ const _CharT*
+ rope<_CharT, _Alloc>::
+ c_str() const
+ {
+ if (0 == this->_M_tree_ptr)
+ {
+ _S_empty_c_str[0] = _S_eos((_CharT*)0); // Possibly redundant,
+ // but probably fast.
+ return _S_empty_c_str;
+ }
+ __gthread_mutex_lock (&this->_M_tree_ptr->_M_c_string_lock);
+ __GC_CONST _CharT* __result = this->_M_tree_ptr->_M_c_string;
+ if (0 == __result)
+ {
+ size_t __s = size();
+ __result = this->_Data_allocate(__s + 1);
+ _S_flatten(this->_M_tree_ptr, __result);
+ __result[__s] = _S_eos((_CharT*)0);
+ this->_M_tree_ptr->_M_c_string = __result;
+ }
+ __gthread_mutex_unlock (&this->_M_tree_ptr->_M_c_string_lock);
+ return(__result);
+ }
+
+ template<class _CharT, class _Alloc>
+ const _CharT* rope<_CharT, _Alloc>::
+ replace_with_c_str()
+ {
+ if (0 == this->_M_tree_ptr)
+ {
+ _S_empty_c_str[0] = _S_eos((_CharT*)0);
+ return _S_empty_c_str;
+ }
+ __GC_CONST _CharT* __old_c_string = this->_M_tree_ptr->_M_c_string;
+ if (__detail::_S_leaf == this->_M_tree_ptr->_M_tag
+ && 0 != __old_c_string)
+ return(__old_c_string);
+ size_t __s = size();
+ _CharT* __result = this->_Data_allocate(_S_rounded_up_size(__s));
+ _S_flatten(this->_M_tree_ptr, __result);
+ __result[__s] = _S_eos((_CharT*)0);
+ this->_M_tree_ptr->_M_unref_nonnil();
+ this->_M_tree_ptr = _S_new_RopeLeaf(__result, __s,
+ this->_M_get_allocator());
+ return(__result);
+ }
+
+ // Algorithm specializations. More should be added.
+
+ template<class _Rope_iterator> // was templated on CharT and Alloc
+ void // VC++ workaround
+ _Rope_rotate(_Rope_iterator __first,
+ _Rope_iterator __middle,
+ _Rope_iterator __last)
+ {
+ typedef typename _Rope_iterator::value_type _CharT;
+ typedef typename _Rope_iterator::_allocator_type _Alloc;
+
+ rope<_CharT, _Alloc>& __r(__first.container());
+ rope<_CharT, _Alloc> __prefix = __r.substr(0, __first.index());
+ rope<_CharT, _Alloc> __suffix =
+ __r.substr(__last.index(), __r.size() - __last.index());
+ rope<_CharT, _Alloc> __part1 =
+ __r.substr(__middle.index(), __last.index() - __middle.index());
+ rope<_CharT, _Alloc> __part2 =
+ __r.substr(__first.index(), __middle.index() - __first.index());
+ __r = __prefix;
+ __r += __part1;
+ __r += __part2;
+ __r += __suffix;
+ }
+
+#if !defined(__GNUC__)
+ // Appears to confuse g++
+ inline void
+ rotate(_Rope_iterator<char, __STL_DEFAULT_ALLOCATOR(char)> __first,
+ _Rope_iterator<char, __STL_DEFAULT_ALLOCATOR(char)> __middle,
+ _Rope_iterator<char, __STL_DEFAULT_ALLOCATOR(char)> __last)
+ { _Rope_rotate(__first, __middle, __last); }
+#endif
+
+# if 0
+ // Probably not useful for several reasons:
+ // - for SGIs 7.1 compiler and probably some others,
+ // this forces lots of rope<wchar_t, ...> instantiations, creating a
+ // code bloat and compile time problem. (Fixed in 7.2.)
+ // - wchar_t is 4 bytes wide on most UNIX platforms, making it
+ // unattractive for unicode strings. Unsigned short may be a better
+ // character type.
+ inline void
+ rotate(_Rope_iterator<wchar_t, __STL_DEFAULT_ALLOCATOR(char)> __first,
+ _Rope_iterator<wchar_t, __STL_DEFAULT_ALLOCATOR(char)> __middle,
+ _Rope_iterator<wchar_t, __STL_DEFAULT_ALLOCATOR(char)> __last)
+ { _Rope_rotate(__first, __middle, __last); }
+# endif
+
+_GLIBCXX_END_NAMESPACE
diff --git a/i686-linux/include/c++/4.4.3/ext/slist b/i686-linux/include/c++/4.4.3/ext/slist
new file mode 100644
index 0000000..a34e36e
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/slist
@@ -0,0 +1,1077 @@
+// Singly-linked list implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2004, 2005, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ */
+
+/** @file ext/slist
+ * This file is a GNU extension to the Standard C++ Library (possibly
+ * containing extensions from the HP/SGI STL subset).
+ */
+
+#ifndef _SLIST
+#define _SLIST 1
+
+#include <algorithm>
+#include <bits/allocator.h>
+#include <bits/stl_construct.h>
+#include <bits/stl_uninitialized.h>
+#include <bits/concept_check.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::size_t;
+ using std::ptrdiff_t;
+ using std::_Construct;
+ using std::_Destroy;
+ using std::allocator;
+ using std::__true_type;
+ using std::__false_type;
+
+ struct _Slist_node_base
+ {
+ _Slist_node_base* _M_next;
+ };
+
+ inline _Slist_node_base*
+ __slist_make_link(_Slist_node_base* __prev_node,
+ _Slist_node_base* __new_node)
+ {
+ __new_node->_M_next = __prev_node->_M_next;
+ __prev_node->_M_next = __new_node;
+ return __new_node;
+ }
+
+ inline _Slist_node_base*
+ __slist_previous(_Slist_node_base* __head,
+ const _Slist_node_base* __node)
+ {
+ while (__head && __head->_M_next != __node)
+ __head = __head->_M_next;
+ return __head;
+ }
+
+ inline const _Slist_node_base*
+ __slist_previous(const _Slist_node_base* __head,
+ const _Slist_node_base* __node)
+ {
+ while (__head && __head->_M_next != __node)
+ __head = __head->_M_next;
+ return __head;
+ }
+
+ inline void
+ __slist_splice_after(_Slist_node_base* __pos,
+ _Slist_node_base* __before_first,
+ _Slist_node_base* __before_last)
+ {
+ if (__pos != __before_first && __pos != __before_last)
+ {
+ _Slist_node_base* __first = __before_first->_M_next;
+ _Slist_node_base* __after = __pos->_M_next;
+ __before_first->_M_next = __before_last->_M_next;
+ __pos->_M_next = __first;
+ __before_last->_M_next = __after;
+ }
+ }
+
+ inline void
+ __slist_splice_after(_Slist_node_base* __pos, _Slist_node_base* __head)
+ {
+ _Slist_node_base* __before_last = __slist_previous(__head, 0);
+ if (__before_last != __head)
+ {
+ _Slist_node_base* __after = __pos->_M_next;
+ __pos->_M_next = __head->_M_next;
+ __head->_M_next = 0;
+ __before_last->_M_next = __after;
+ }
+ }
+
+ inline _Slist_node_base*
+ __slist_reverse(_Slist_node_base* __node)
+ {
+ _Slist_node_base* __result = __node;
+ __node = __node->_M_next;
+ __result->_M_next = 0;
+ while(__node)
+ {
+ _Slist_node_base* __next = __node->_M_next;
+ __node->_M_next = __result;
+ __result = __node;
+ __node = __next;
+ }
+ return __result;
+ }
+
+ inline size_t
+ __slist_size(_Slist_node_base* __node)
+ {
+ size_t __result = 0;
+ for (; __node != 0; __node = __node->_M_next)
+ ++__result;
+ return __result;
+ }
+
+ template <class _Tp>
+ struct _Slist_node : public _Slist_node_base
+ {
+ _Tp _M_data;
+ };
+
+ struct _Slist_iterator_base
+ {
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef std::forward_iterator_tag iterator_category;
+
+ _Slist_node_base* _M_node;
+
+ _Slist_iterator_base(_Slist_node_base* __x)
+ : _M_node(__x) {}
+
+ void
+ _M_incr()
+ { _M_node = _M_node->_M_next; }
+
+ bool
+ operator==(const _Slist_iterator_base& __x) const
+ { return _M_node == __x._M_node; }
+
+ bool
+ operator!=(const _Slist_iterator_base& __x) const
+ { return _M_node != __x._M_node; }
+ };
+
+ template <class _Tp, class _Ref, class _Ptr>
+ struct _Slist_iterator : public _Slist_iterator_base
+ {
+ typedef _Slist_iterator<_Tp, _Tp&, _Tp*> iterator;
+ typedef _Slist_iterator<_Tp, const _Tp&, const _Tp*> const_iterator;
+ typedef _Slist_iterator<_Tp, _Ref, _Ptr> _Self;
+
+ typedef _Tp value_type;
+ typedef _Ptr pointer;
+ typedef _Ref reference;
+ typedef _Slist_node<_Tp> _Node;
+
+ explicit
+ _Slist_iterator(_Node* __x)
+ : _Slist_iterator_base(__x) {}
+
+ _Slist_iterator()
+ : _Slist_iterator_base(0) {}
+
+ _Slist_iterator(const iterator& __x)
+ : _Slist_iterator_base(__x._M_node) {}
+
+ reference
+ operator*() const
+ { return ((_Node*) _M_node)->_M_data; }
+
+ pointer
+ operator->() const
+ { return &(operator*()); }
+
+ _Self&
+ operator++()
+ {
+ _M_incr();
+ return *this;
+ }
+
+ _Self
+ operator++(int)
+ {
+ _Self __tmp = *this;
+ _M_incr();
+ return __tmp;
+ }
+ };
+
+ template <class _Tp, class _Alloc>
+ struct _Slist_base
+ : public _Alloc::template rebind<_Slist_node<_Tp> >::other
+ {
+ typedef typename _Alloc::template rebind<_Slist_node<_Tp> >::other
+ _Node_alloc;
+ typedef _Alloc allocator_type;
+
+ allocator_type
+ get_allocator() const
+ { return *static_cast<const _Node_alloc*>(this); }
+
+ _Slist_base(const allocator_type& __a)
+ : _Node_alloc(__a)
+ { this->_M_head._M_next = 0; }
+
+ ~_Slist_base()
+ { _M_erase_after(&this->_M_head, 0); }
+
+ protected:
+ _Slist_node_base _M_head;
+
+ _Slist_node<_Tp>*
+ _M_get_node()
+ { return _Node_alloc::allocate(1); }
+
+ void
+ _M_put_node(_Slist_node<_Tp>* __p)
+ { _Node_alloc::deallocate(__p, 1); }
+
+ protected:
+ _Slist_node_base* _M_erase_after(_Slist_node_base* __pos)
+ {
+ _Slist_node<_Tp>* __next = (_Slist_node<_Tp>*) (__pos->_M_next);
+ _Slist_node_base* __next_next = __next->_M_next;
+ __pos->_M_next = __next_next;
+ get_allocator().destroy(&__next->_M_data);
+ _M_put_node(__next);
+ return __next_next;
+ }
+ _Slist_node_base* _M_erase_after(_Slist_node_base*, _Slist_node_base*);
+ };
+
+ template <class _Tp, class _Alloc>
+ _Slist_node_base*
+ _Slist_base<_Tp,_Alloc>::_M_erase_after(_Slist_node_base* __before_first,
+ _Slist_node_base* __last_node)
+ {
+ _Slist_node<_Tp>* __cur = (_Slist_node<_Tp>*) (__before_first->_M_next);
+ while (__cur != __last_node)
+ {
+ _Slist_node<_Tp>* __tmp = __cur;
+ __cur = (_Slist_node<_Tp>*) __cur->_M_next;
+ get_allocator().destroy(&__tmp->_M_data);
+ _M_put_node(__tmp);
+ }
+ __before_first->_M_next = __last_node;
+ return __last_node;
+ }
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template <class _Tp, class _Alloc = allocator<_Tp> >
+ class slist : private _Slist_base<_Tp,_Alloc>
+ {
+ // concept requirements
+ __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
+
+ private:
+ typedef _Slist_base<_Tp,_Alloc> _Base;
+
+ public:
+ typedef _Tp value_type;
+ typedef value_type* pointer;
+ typedef const value_type* const_pointer;
+ typedef value_type& reference;
+ typedef const value_type& const_reference;
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+
+ typedef _Slist_iterator<_Tp, _Tp&, _Tp*> iterator;
+ typedef _Slist_iterator<_Tp, const _Tp&, const _Tp*> const_iterator;
+
+ typedef typename _Base::allocator_type allocator_type;
+
+ allocator_type
+ get_allocator() const
+ { return _Base::get_allocator(); }
+
+ private:
+ typedef _Slist_node<_Tp> _Node;
+ typedef _Slist_node_base _Node_base;
+ typedef _Slist_iterator_base _Iterator_base;
+
+ _Node*
+ _M_create_node(const value_type& __x)
+ {
+ _Node* __node = this->_M_get_node();
+ __try
+ {
+ get_allocator().construct(&__node->_M_data, __x);
+ __node->_M_next = 0;
+ }
+ __catch(...)
+ {
+ this->_M_put_node(__node);
+ __throw_exception_again;
+ }
+ return __node;
+ }
+
+ _Node*
+ _M_create_node()
+ {
+ _Node* __node = this->_M_get_node();
+ __try
+ {
+ get_allocator().construct(&__node->_M_data, value_type());
+ __node->_M_next = 0;
+ }
+ __catch(...)
+ {
+ this->_M_put_node(__node);
+ __throw_exception_again;
+ }
+ return __node;
+ }
+
+ public:
+ explicit
+ slist(const allocator_type& __a = allocator_type())
+ : _Base(__a) {}
+
+ slist(size_type __n, const value_type& __x,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ { _M_insert_after_fill(&this->_M_head, __n, __x); }
+
+ explicit
+ slist(size_type __n)
+ : _Base(allocator_type())
+ { _M_insert_after_fill(&this->_M_head, __n, value_type()); }
+
+ // We don't need any dispatching tricks here, because
+ // _M_insert_after_range already does them.
+ template <class _InputIterator>
+ slist(_InputIterator __first, _InputIterator __last,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ { _M_insert_after_range(&this->_M_head, __first, __last); }
+
+ slist(const slist& __x)
+ : _Base(__x.get_allocator())
+ { _M_insert_after_range(&this->_M_head, __x.begin(), __x.end()); }
+
+ slist&
+ operator= (const slist& __x);
+
+ ~slist() {}
+
+ public:
+ // assign(), a generalized assignment member function. Two
+ // versions: one that takes a count, and one that takes a range.
+ // The range version is a member template, so we dispatch on whether
+ // or not the type is an integer.
+
+ void
+ assign(size_type __n, const _Tp& __val)
+ { _M_fill_assign(__n, __val); }
+
+ void
+ _M_fill_assign(size_type __n, const _Tp& __val);
+
+ template <class _InputIterator>
+ void
+ assign(_InputIterator __first, _InputIterator __last)
+ {
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ _M_assign_dispatch(__first, __last, _Integral());
+ }
+
+ template <class _Integer>
+ void
+ _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
+ { _M_fill_assign((size_type) __n, (_Tp) __val); }
+
+ template <class _InputIterator>
+ void
+ _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
+ __false_type);
+
+ public:
+
+ iterator
+ begin()
+ { return iterator((_Node*)this->_M_head._M_next); }
+
+ const_iterator
+ begin() const
+ { return const_iterator((_Node*)this->_M_head._M_next);}
+
+ iterator
+ end()
+ { return iterator(0); }
+
+ const_iterator
+ end() const
+ { return const_iterator(0); }
+
+ // Experimental new feature: before_begin() returns a
+ // non-dereferenceable iterator that, when incremented, yields
+ // begin(). This iterator may be used as the argument to
+ // insert_after, erase_after, etc. Note that even for an empty
+ // slist, before_begin() is not the same iterator as end(). It
+ // is always necessary to increment before_begin() at least once to
+ // obtain end().
+ iterator
+ before_begin()
+ { return iterator((_Node*) &this->_M_head); }
+
+ const_iterator
+ before_begin() const
+ { return const_iterator((_Node*) &this->_M_head); }
+
+ size_type
+ size() const
+ { return __slist_size(this->_M_head._M_next); }
+
+ size_type
+ max_size() const
+ { return size_type(-1); }
+
+ bool
+ empty() const
+ { return this->_M_head._M_next == 0; }
+
+ void
+ swap(slist& __x)
+ { std::swap(this->_M_head._M_next, __x._M_head._M_next); }
+
+ public:
+
+ reference
+ front()
+ { return ((_Node*) this->_M_head._M_next)->_M_data; }
+
+ const_reference
+ front() const
+ { return ((_Node*) this->_M_head._M_next)->_M_data; }
+
+ void
+ push_front(const value_type& __x)
+ { __slist_make_link(&this->_M_head, _M_create_node(__x)); }
+
+ void
+ push_front()
+ { __slist_make_link(&this->_M_head, _M_create_node()); }
+
+ void
+ pop_front()
+ {
+ _Node* __node = (_Node*) this->_M_head._M_next;
+ this->_M_head._M_next = __node->_M_next;
+ get_allocator().destroy(&__node->_M_data);
+ this->_M_put_node(__node);
+ }
+
+ iterator
+ previous(const_iterator __pos)
+ { return iterator((_Node*) __slist_previous(&this->_M_head,
+ __pos._M_node)); }
+
+ const_iterator
+ previous(const_iterator __pos) const
+ { return const_iterator((_Node*) __slist_previous(&this->_M_head,
+ __pos._M_node)); }
+
+ private:
+ _Node*
+ _M_insert_after(_Node_base* __pos, const value_type& __x)
+ { return (_Node*) (__slist_make_link(__pos, _M_create_node(__x))); }
+
+ _Node*
+ _M_insert_after(_Node_base* __pos)
+ { return (_Node*) (__slist_make_link(__pos, _M_create_node())); }
+
+ void
+ _M_insert_after_fill(_Node_base* __pos,
+ size_type __n, const value_type& __x)
+ {
+ for (size_type __i = 0; __i < __n; ++__i)
+ __pos = __slist_make_link(__pos, _M_create_node(__x));
+ }
+
+ // Check whether it's an integral type. If so, it's not an iterator.
+ template <class _InIterator>
+ void
+ _M_insert_after_range(_Node_base* __pos,
+ _InIterator __first, _InIterator __last)
+ {
+ typedef typename std::__is_integer<_InIterator>::__type _Integral;
+ _M_insert_after_range(__pos, __first, __last, _Integral());
+ }
+
+ template <class _Integer>
+ void
+ _M_insert_after_range(_Node_base* __pos, _Integer __n, _Integer __x,
+ __true_type)
+ { _M_insert_after_fill(__pos, __n, __x); }
+
+ template <class _InIterator>
+ void
+ _M_insert_after_range(_Node_base* __pos,
+ _InIterator __first, _InIterator __last,
+ __false_type)
+ {
+ while (__first != __last)
+ {
+ __pos = __slist_make_link(__pos, _M_create_node(*__first));
+ ++__first;
+ }
+ }
+
+ public:
+ iterator
+ insert_after(iterator __pos, const value_type& __x)
+ { return iterator(_M_insert_after(__pos._M_node, __x)); }
+
+ iterator
+ insert_after(iterator __pos)
+ { return insert_after(__pos, value_type()); }
+
+ void
+ insert_after(iterator __pos, size_type __n, const value_type& __x)
+ { _M_insert_after_fill(__pos._M_node, __n, __x); }
+
+ // We don't need any dispatching tricks here, because
+ // _M_insert_after_range already does them.
+ template <class _InIterator>
+ void
+ insert_after(iterator __pos, _InIterator __first, _InIterator __last)
+ { _M_insert_after_range(__pos._M_node, __first, __last); }
+
+ iterator
+ insert(iterator __pos, const value_type& __x)
+ { return iterator(_M_insert_after(__slist_previous(&this->_M_head,
+ __pos._M_node),
+ __x)); }
+
+ iterator
+ insert(iterator __pos)
+ { return iterator(_M_insert_after(__slist_previous(&this->_M_head,
+ __pos._M_node),
+ value_type())); }
+
+ void
+ insert(iterator __pos, size_type __n, const value_type& __x)
+ { _M_insert_after_fill(__slist_previous(&this->_M_head, __pos._M_node),
+ __n, __x); }
+
+ // We don't need any dispatching tricks here, because
+ // _M_insert_after_range already does them.
+ template <class _InIterator>
+ void
+ insert(iterator __pos, _InIterator __first, _InIterator __last)
+ { _M_insert_after_range(__slist_previous(&this->_M_head, __pos._M_node),
+ __first, __last); }
+
+ public:
+ iterator
+ erase_after(iterator __pos)
+ { return iterator((_Node*) this->_M_erase_after(__pos._M_node)); }
+
+ iterator
+ erase_after(iterator __before_first, iterator __last)
+ {
+ return iterator((_Node*) this->_M_erase_after(__before_first._M_node,
+ __last._M_node));
+ }
+
+ iterator
+ erase(iterator __pos)
+ {
+ return iterator((_Node*) this->_M_erase_after
+ (__slist_previous(&this->_M_head, __pos._M_node)));
+ }
+
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ return iterator((_Node*) this->_M_erase_after
+ (__slist_previous(&this->_M_head, __first._M_node),
+ __last._M_node));
+ }
+
+ void
+ resize(size_type new_size, const _Tp& __x);
+
+ void
+ resize(size_type new_size)
+ { resize(new_size, _Tp()); }
+
+ void
+ clear()
+ { this->_M_erase_after(&this->_M_head, 0); }
+
+ public:
+ // Moves the range [__before_first + 1, __before_last + 1) to *this,
+ // inserting it immediately after __pos. This is constant time.
+ void
+ splice_after(iterator __pos,
+ iterator __before_first, iterator __before_last)
+ {
+ if (__before_first != __before_last)
+ __slist_splice_after(__pos._M_node, __before_first._M_node,
+ __before_last._M_node);
+ }
+
+ // Moves the element that follows __prev to *this, inserting it
+ // immediately after __pos. This is constant time.
+ void
+ splice_after(iterator __pos, iterator __prev)
+ { __slist_splice_after(__pos._M_node,
+ __prev._M_node, __prev._M_node->_M_next); }
+
+ // Removes all of the elements from the list __x to *this, inserting
+ // them immediately after __pos. __x must not be *this. Complexity:
+ // linear in __x.size().
+ void
+ splice_after(iterator __pos, slist& __x)
+ { __slist_splice_after(__pos._M_node, &__x._M_head); }
+
+ // Linear in distance(begin(), __pos), and linear in __x.size().
+ void
+ splice(iterator __pos, slist& __x)
+ {
+ if (__x._M_head._M_next)
+ __slist_splice_after(__slist_previous(&this->_M_head, __pos._M_node),
+ &__x._M_head,
+ __slist_previous(&__x._M_head, 0)); }
+
+ // Linear in distance(begin(), __pos), and in distance(__x.begin(), __i).
+ void
+ splice(iterator __pos, slist& __x, iterator __i)
+ { __slist_splice_after(__slist_previous(&this->_M_head, __pos._M_node),
+ __slist_previous(&__x._M_head, __i._M_node),
+ __i._M_node); }
+
+ // Linear in distance(begin(), __pos), in distance(__x.begin(), __first),
+ // and in distance(__first, __last).
+ void
+ splice(iterator __pos, slist& __x, iterator __first, iterator __last)
+ {
+ if (__first != __last)
+ __slist_splice_after(__slist_previous(&this->_M_head, __pos._M_node),
+ __slist_previous(&__x._M_head, __first._M_node),
+ __slist_previous(__first._M_node,
+ __last._M_node));
+ }
+
+ public:
+ void
+ reverse()
+ {
+ if (this->_M_head._M_next)
+ this->_M_head._M_next = __slist_reverse(this->_M_head._M_next);
+ }
+
+ void
+ remove(const _Tp& __val);
+
+ void
+ unique();
+
+ void
+ merge(slist& __x);
+
+ void
+ sort();
+
+ template <class _Predicate>
+ void
+ remove_if(_Predicate __pred);
+
+ template <class _BinaryPredicate>
+ void
+ unique(_BinaryPredicate __pred);
+
+ template <class _StrictWeakOrdering>
+ void
+ merge(slist&, _StrictWeakOrdering);
+
+ template <class _StrictWeakOrdering>
+ void
+ sort(_StrictWeakOrdering __comp);
+ };
+
+ template <class _Tp, class _Alloc>
+ slist<_Tp, _Alloc>&
+ slist<_Tp, _Alloc>::operator=(const slist<_Tp, _Alloc>& __x)
+ {
+ if (&__x != this)
+ {
+ _Node_base* __p1 = &this->_M_head;
+ _Node* __n1 = (_Node*) this->_M_head._M_next;
+ const _Node* __n2 = (const _Node*) __x._M_head._M_next;
+ while (__n1 && __n2)
+ {
+ __n1->_M_data = __n2->_M_data;
+ __p1 = __n1;
+ __n1 = (_Node*) __n1->_M_next;
+ __n2 = (const _Node*) __n2->_M_next;
+ }
+ if (__n2 == 0)
+ this->_M_erase_after(__p1, 0);
+ else
+ _M_insert_after_range(__p1, const_iterator((_Node*)__n2),
+ const_iterator(0));
+ }
+ return *this;
+ }
+
+ template <class _Tp, class _Alloc>
+ void
+ slist<_Tp, _Alloc>::_M_fill_assign(size_type __n, const _Tp& __val)
+ {
+ _Node_base* __prev = &this->_M_head;
+ _Node* __node = (_Node*) this->_M_head._M_next;
+ for (; __node != 0 && __n > 0; --__n)
+ {
+ __node->_M_data = __val;
+ __prev = __node;
+ __node = (_Node*) __node->_M_next;
+ }
+ if (__n > 0)
+ _M_insert_after_fill(__prev, __n, __val);
+ else
+ this->_M_erase_after(__prev, 0);
+ }
+
+ template <class _Tp, class _Alloc>
+ template <class _InputIterator>
+ void
+ slist<_Tp, _Alloc>::_M_assign_dispatch(_InputIterator __first,
+ _InputIterator __last,
+ __false_type)
+ {
+ _Node_base* __prev = &this->_M_head;
+ _Node* __node = (_Node*) this->_M_head._M_next;
+ while (__node != 0 && __first != __last)
+ {
+ __node->_M_data = *__first;
+ __prev = __node;
+ __node = (_Node*) __node->_M_next;
+ ++__first;
+ }
+ if (__first != __last)
+ _M_insert_after_range(__prev, __first, __last);
+ else
+ this->_M_erase_after(__prev, 0);
+ }
+
+ template <class _Tp, class _Alloc>
+ inline bool
+ operator==(const slist<_Tp, _Alloc>& _SL1, const slist<_Tp, _Alloc>& _SL2)
+ {
+ typedef typename slist<_Tp,_Alloc>::const_iterator const_iterator;
+ const_iterator __end1 = _SL1.end();
+ const_iterator __end2 = _SL2.end();
+
+ const_iterator __i1 = _SL1.begin();
+ const_iterator __i2 = _SL2.begin();
+ while (__i1 != __end1 && __i2 != __end2 && *__i1 == *__i2)
+ {
+ ++__i1;
+ ++__i2;
+ }
+ return __i1 == __end1 && __i2 == __end2;
+ }
+
+
+ template <class _Tp, class _Alloc>
+ inline bool
+ operator<(const slist<_Tp, _Alloc>& _SL1, const slist<_Tp, _Alloc>& _SL2)
+ { return std::lexicographical_compare(_SL1.begin(), _SL1.end(),
+ _SL2.begin(), _SL2.end()); }
+
+ template <class _Tp, class _Alloc>
+ inline bool
+ operator!=(const slist<_Tp, _Alloc>& _SL1, const slist<_Tp, _Alloc>& _SL2)
+ { return !(_SL1 == _SL2); }
+
+ template <class _Tp, class _Alloc>
+ inline bool
+ operator>(const slist<_Tp, _Alloc>& _SL1, const slist<_Tp, _Alloc>& _SL2)
+ { return _SL2 < _SL1; }
+
+ template <class _Tp, class _Alloc>
+ inline bool
+ operator<=(const slist<_Tp, _Alloc>& _SL1, const slist<_Tp, _Alloc>& _SL2)
+ { return !(_SL2 < _SL1); }
+
+ template <class _Tp, class _Alloc>
+ inline bool
+ operator>=(const slist<_Tp, _Alloc>& _SL1, const slist<_Tp, _Alloc>& _SL2)
+ { return !(_SL1 < _SL2); }
+
+ template <class _Tp, class _Alloc>
+ inline void
+ swap(slist<_Tp, _Alloc>& __x, slist<_Tp, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template <class _Tp, class _Alloc>
+ void
+ slist<_Tp, _Alloc>::resize(size_type __len, const _Tp& __x)
+ {
+ _Node_base* __cur = &this->_M_head;
+ while (__cur->_M_next != 0 && __len > 0)
+ {
+ --__len;
+ __cur = __cur->_M_next;
+ }
+ if (__cur->_M_next)
+ this->_M_erase_after(__cur, 0);
+ else
+ _M_insert_after_fill(__cur, __len, __x);
+ }
+
+ template <class _Tp, class _Alloc>
+ void
+ slist<_Tp, _Alloc>::remove(const _Tp& __val)
+ {
+ _Node_base* __cur = &this->_M_head;
+ while (__cur && __cur->_M_next)
+ {
+ if (((_Node*) __cur->_M_next)->_M_data == __val)
+ this->_M_erase_after(__cur);
+ else
+ __cur = __cur->_M_next;
+ }
+ }
+
+ template <class _Tp, class _Alloc>
+ void
+ slist<_Tp, _Alloc>::unique()
+ {
+ _Node_base* __cur = this->_M_head._M_next;
+ if (__cur)
+ {
+ while (__cur->_M_next)
+ {
+ if (((_Node*)__cur)->_M_data
+ == ((_Node*)(__cur->_M_next))->_M_data)
+ this->_M_erase_after(__cur);
+ else
+ __cur = __cur->_M_next;
+ }
+ }
+ }
+
+ template <class _Tp, class _Alloc>
+ void
+ slist<_Tp, _Alloc>::merge(slist<_Tp, _Alloc>& __x)
+ {
+ _Node_base* __n1 = &this->_M_head;
+ while (__n1->_M_next && __x._M_head._M_next)
+ {
+ if (((_Node*) __x._M_head._M_next)->_M_data
+ < ((_Node*) __n1->_M_next)->_M_data)
+ __slist_splice_after(__n1, &__x._M_head, __x._M_head._M_next);
+ __n1 = __n1->_M_next;
+ }
+ if (__x._M_head._M_next)
+ {
+ __n1->_M_next = __x._M_head._M_next;
+ __x._M_head._M_next = 0;
+ }
+ }
+
+ template <class _Tp, class _Alloc>
+ void
+ slist<_Tp, _Alloc>::sort()
+ {
+ if (this->_M_head._M_next && this->_M_head._M_next->_M_next)
+ {
+ slist __carry;
+ slist __counter[64];
+ int __fill = 0;
+ while (!empty())
+ {
+ __slist_splice_after(&__carry._M_head,
+ &this->_M_head, this->_M_head._M_next);
+ int __i = 0;
+ while (__i < __fill && !__counter[__i].empty())
+ {
+ __counter[__i].merge(__carry);
+ __carry.swap(__counter[__i]);
+ ++__i;
+ }
+ __carry.swap(__counter[__i]);
+ if (__i == __fill)
+ ++__fill;
+ }
+
+ for (int __i = 1; __i < __fill; ++__i)
+ __counter[__i].merge(__counter[__i-1]);
+ this->swap(__counter[__fill-1]);
+ }
+ }
+
+ template <class _Tp, class _Alloc>
+ template <class _Predicate>
+ void slist<_Tp, _Alloc>::remove_if(_Predicate __pred)
+ {
+ _Node_base* __cur = &this->_M_head;
+ while (__cur->_M_next)
+ {
+ if (__pred(((_Node*) __cur->_M_next)->_M_data))
+ this->_M_erase_after(__cur);
+ else
+ __cur = __cur->_M_next;
+ }
+ }
+
+ template <class _Tp, class _Alloc>
+ template <class _BinaryPredicate>
+ void
+ slist<_Tp, _Alloc>::unique(_BinaryPredicate __pred)
+ {
+ _Node* __cur = (_Node*) this->_M_head._M_next;
+ if (__cur)
+ {
+ while (__cur->_M_next)
+ {
+ if (__pred(((_Node*)__cur)->_M_data,
+ ((_Node*)(__cur->_M_next))->_M_data))
+ this->_M_erase_after(__cur);
+ else
+ __cur = (_Node*) __cur->_M_next;
+ }
+ }
+ }
+
+ template <class _Tp, class _Alloc>
+ template <class _StrictWeakOrdering>
+ void
+ slist<_Tp, _Alloc>::merge(slist<_Tp, _Alloc>& __x,
+ _StrictWeakOrdering __comp)
+ {
+ _Node_base* __n1 = &this->_M_head;
+ while (__n1->_M_next && __x._M_head._M_next)
+ {
+ if (__comp(((_Node*) __x._M_head._M_next)->_M_data,
+ ((_Node*) __n1->_M_next)->_M_data))
+ __slist_splice_after(__n1, &__x._M_head, __x._M_head._M_next);
+ __n1 = __n1->_M_next;
+ }
+ if (__x._M_head._M_next)
+ {
+ __n1->_M_next = __x._M_head._M_next;
+ __x._M_head._M_next = 0;
+ }
+ }
+
+ template <class _Tp, class _Alloc>
+ template <class _StrictWeakOrdering>
+ void
+ slist<_Tp, _Alloc>::sort(_StrictWeakOrdering __comp)
+ {
+ if (this->_M_head._M_next && this->_M_head._M_next->_M_next)
+ {
+ slist __carry;
+ slist __counter[64];
+ int __fill = 0;
+ while (!empty())
+ {
+ __slist_splice_after(&__carry._M_head,
+ &this->_M_head, this->_M_head._M_next);
+ int __i = 0;
+ while (__i < __fill && !__counter[__i].empty())
+ {
+ __counter[__i].merge(__carry, __comp);
+ __carry.swap(__counter[__i]);
+ ++__i;
+ }
+ __carry.swap(__counter[__i]);
+ if (__i == __fill)
+ ++__fill;
+ }
+
+ for (int __i = 1; __i < __fill; ++__i)
+ __counter[__i].merge(__counter[__i-1], __comp);
+ this->swap(__counter[__fill-1]);
+ }
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // Specialization of insert_iterator so that insertions will be constant
+ // time rather than linear time.
+ template <class _Tp, class _Alloc>
+ class insert_iterator<__gnu_cxx::slist<_Tp, _Alloc> >
+ {
+ protected:
+ typedef __gnu_cxx::slist<_Tp, _Alloc> _Container;
+ _Container* container;
+ typename _Container::iterator iter;
+
+ public:
+ typedef _Container container_type;
+ typedef output_iterator_tag iterator_category;
+ typedef void value_type;
+ typedef void difference_type;
+ typedef void pointer;
+ typedef void reference;
+
+ insert_iterator(_Container& __x, typename _Container::iterator __i)
+ : container(&__x)
+ {
+ if (__i == __x.begin())
+ iter = __x.before_begin();
+ else
+ iter = __x.previous(__i);
+ }
+
+ insert_iterator<_Container>&
+ operator=(const typename _Container::value_type& __value)
+ {
+ iter = container->insert_after(iter, __value);
+ return *this;
+ }
+
+ insert_iterator<_Container>&
+ operator*()
+ { return *this; }
+
+ insert_iterator<_Container>&
+ operator++()
+ { return *this; }
+
+ insert_iterator<_Container>&
+ operator++(int)
+ { return *this; }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/sso_string_base.h b/i686-linux/include/c++/4.4.3/ext/sso_string_base.h
new file mode 100644
index 0000000..c329609
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/sso_string_base.h
@@ -0,0 +1,592 @@
+// Short-string-optimized versatile string base -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ext/sso_string_base.h
+ * This file is a GNU extension to the Standard C++ Library.
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _SSO_STRING_BASE_H
+#define _SSO_STRING_BASE_H 1
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ class __sso_string_base
+ : protected __vstring_utility<_CharT, _Traits, _Alloc>
+ {
+ public:
+ typedef _Traits traits_type;
+ typedef typename _Traits::char_type value_type;
+
+ typedef __vstring_utility<_CharT, _Traits, _Alloc> _Util_Base;
+ typedef typename _Util_Base::_CharT_alloc_type _CharT_alloc_type;
+ typedef typename _CharT_alloc_type::size_type size_type;
+
+ private:
+ // Data Members:
+ typename _Util_Base::template _Alloc_hider<_CharT_alloc_type>
+ _M_dataplus;
+ size_type _M_string_length;
+
+ enum { _S_local_capacity = 15 };
+
+ union
+ {
+ _CharT _M_local_data[_S_local_capacity + 1];
+ size_type _M_allocated_capacity;
+ };
+
+ void
+ _M_data(_CharT* __p)
+ { _M_dataplus._M_p = __p; }
+
+ void
+ _M_length(size_type __length)
+ { _M_string_length = __length; }
+
+ void
+ _M_capacity(size_type __capacity)
+ { _M_allocated_capacity = __capacity; }
+
+ bool
+ _M_is_local() const
+ { return _M_data() == _M_local_data; }
+
+ // Create & Destroy
+ _CharT*
+ _M_create(size_type&, size_type);
+
+ void
+ _M_dispose()
+ {
+ if (!_M_is_local())
+ _M_destroy(_M_allocated_capacity);
+#if __google_stl_debug_string_dangling
+ else {
+ // Wipe local storage for destructed string with 0xCD.
+ // This mimics what DebugAllocation does to free()d memory.
+ __builtin_memset(_M_local_data, 0xcd, sizeof(_M_local_data));
+ }
+#endif
+ }
+
+ void
+ _M_destroy(size_type __size) throw()
+ { _M_get_allocator().deallocate(_M_data(), __size + 1); }
+
+ // _M_construct_aux is used to implement the 21.3.1 para 15 which
+ // requires special behaviour if _InIterator is an integral type
+ template<typename _InIterator>
+ void
+ _M_construct_aux(_InIterator __beg, _InIterator __end,
+ std::__false_type)
+ {
+ typedef typename iterator_traits<_InIterator>::iterator_category _Tag;
+ _M_construct(__beg, __end, _Tag());
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 438. Ambiguity in the "do the right thing" clause
+ template<typename _Integer>
+ void
+ _M_construct_aux(_Integer __beg, _Integer __end, std::__true_type)
+ { _M_construct(static_cast<size_type>(__beg), __end); }
+
+ template<typename _InIterator>
+ void
+ _M_construct(_InIterator __beg, _InIterator __end)
+ {
+ typedef typename std::__is_integer<_InIterator>::__type _Integral;
+ _M_construct_aux(__beg, __end, _Integral());
+ }
+
+ // For Input Iterators, used in istreambuf_iterators, etc.
+ template<typename _InIterator>
+ void
+ _M_construct(_InIterator __beg, _InIterator __end,
+ std::input_iterator_tag);
+
+ // For forward_iterators up to random_access_iterators, used for
+ // string::iterator, _CharT*, etc.
+ template<typename _FwdIterator>
+ void
+ _M_construct(_FwdIterator __beg, _FwdIterator __end,
+ std::forward_iterator_tag);
+
+ void
+ _M_construct(size_type __req, _CharT __c);
+
+ public:
+ size_type
+ _M_max_size() const
+ { return (_M_get_allocator().max_size() - 1) / 2; }
+
+ _CharT*
+ _M_data() const
+ { return _M_dataplus._M_p; }
+
+ size_type
+ _M_length() const
+ { return _M_string_length; }
+
+ size_type
+ _M_capacity() const
+ {
+ return _M_is_local() ? size_type(_S_local_capacity)
+ : _M_allocated_capacity;
+ }
+
+ bool
+ _M_is_shared() const
+ { return false; }
+
+ void
+ _M_set_leaked() { }
+
+ void
+ _M_leak() { }
+
+ void
+ _M_set_length_no_wipe(size_type __n)
+ {
+ _M_length(__n);
+ traits_type::assign(_M_data()[__n], _CharT());
+ }
+
+ void
+ _M_set_length(size_type __n)
+ {
+#if __google_stl_debug_string_dangling
+ if (__n + 1 < _M_length())
+ {
+ // Wipe the storage with 0xCD.
+ // Also wipes the old NUL terminator.
+ __builtin_memset(_M_data() + __n + 1, 0xcd, _M_length() - __n);
+ }
+#endif
+ _M_set_length_no_wipe(__n);
+ }
+
+ __sso_string_base()
+ : _M_dataplus(_M_local_data)
+ { _M_set_length_no_wipe(0); }
+
+ __sso_string_base(const _Alloc& __a);
+
+ __sso_string_base(const __sso_string_base& __rcs);
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ __sso_string_base(__sso_string_base&& __rcs);
+#endif
+
+ __sso_string_base(size_type __n, _CharT __c, const _Alloc& __a);
+
+ template<typename _InputIterator>
+ __sso_string_base(_InputIterator __beg, _InputIterator __end,
+ const _Alloc& __a);
+
+ ~__sso_string_base()
+ { _M_dispose(); }
+
+ _CharT_alloc_type&
+ _M_get_allocator()
+ { return _M_dataplus; }
+
+ const _CharT_alloc_type&
+ _M_get_allocator() const
+ { return _M_dataplus; }
+
+ void
+ _M_swap(__sso_string_base& __rcs);
+
+ void
+ _M_assign(const __sso_string_base& __rcs);
+
+ void
+ _M_reserve(size_type __res);
+
+ void
+ _M_mutate(size_type __pos, size_type __len1, const _CharT* __s,
+ size_type __len2);
+
+ void
+ _M_erase(size_type __pos, size_type __n);
+
+ void
+ _M_clear()
+ { _M_set_length(0); }
+
+ bool
+ _M_compare(const __sso_string_base&) const
+ { return false; }
+ };
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ __sso_string_base<_CharT, _Traits, _Alloc>::
+ _M_swap(__sso_string_base& __rcs)
+ {
+ if (this == &__rcs)
+ return;
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 431. Swapping containers with unequal allocators.
+ std::__alloc_swap<_CharT_alloc_type>::_S_do_it(_M_get_allocator(),
+ __rcs._M_get_allocator());
+
+ if (_M_is_local())
+ if (__rcs._M_is_local())
+ {
+ if (_M_length() && __rcs._M_length())
+ {
+ _CharT __tmp_data[_S_local_capacity + 1];
+ traits_type::copy(__tmp_data, __rcs._M_local_data,
+ _S_local_capacity + 1);
+ traits_type::copy(__rcs._M_local_data, _M_local_data,
+ _S_local_capacity + 1);
+ traits_type::copy(_M_local_data, __tmp_data,
+ _S_local_capacity + 1);
+ }
+ else if (__rcs._M_length())
+ {
+ traits_type::copy(_M_local_data, __rcs._M_local_data,
+ _S_local_capacity + 1);
+ _M_length(__rcs._M_length());
+ __rcs._M_set_length(0);
+ return;
+ }
+ else if (_M_length())
+ {
+ traits_type::copy(__rcs._M_local_data, _M_local_data,
+ _S_local_capacity + 1);
+ __rcs._M_length(_M_length());
+ _M_set_length(0);
+ return;
+ }
+ }
+ else
+ {
+ const size_type __tmp_capacity = __rcs._M_allocated_capacity;
+ traits_type::copy(__rcs._M_local_data, _M_local_data,
+ _S_local_capacity + 1);
+ _M_data(__rcs._M_data());
+ __rcs._M_data(__rcs._M_local_data);
+ _M_capacity(__tmp_capacity);
+ }
+ else
+ {
+ const size_type __tmp_capacity = _M_allocated_capacity;
+ if (__rcs._M_is_local())
+ {
+ traits_type::copy(_M_local_data, __rcs._M_local_data,
+ _S_local_capacity + 1);
+ __rcs._M_data(_M_data());
+ _M_data(_M_local_data);
+ }
+ else
+ {
+ _CharT* __tmp_ptr = _M_data();
+ _M_data(__rcs._M_data());
+ __rcs._M_data(__tmp_ptr);
+ _M_capacity(__rcs._M_allocated_capacity);
+ }
+ __rcs._M_capacity(__tmp_capacity);
+ }
+
+ const size_type __tmp_length = _M_length();
+ _M_length(__rcs._M_length());
+ __rcs._M_length(__tmp_length);
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ _CharT*
+ __sso_string_base<_CharT, _Traits, _Alloc>::
+ _M_create(size_type& __capacity, size_type __old_capacity)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 83. String::npos vs. string::max_size()
+ if (__capacity > _M_max_size())
+ std::__throw_length_error(__N("__sso_string_base::_M_create"));
+
+ // The below implements an exponential growth policy, necessary to
+ // meet amortized linear time requirements of the library: see
+ // http://gcc.gnu.org/ml/libstdc++/2001-07/msg00085.html.
+ if (__capacity > __old_capacity && __capacity < 2 * __old_capacity)
+ {
+ __capacity = 2 * __old_capacity;
+ // Never allocate a string bigger than max_size.
+ if (__capacity > _M_max_size())
+ __capacity = _M_max_size();
+ }
+
+ // NB: Need an array of char_type[__capacity], plus a terminating
+ // null char_type() element.
+ return _M_get_allocator().allocate(__capacity + 1);
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ __sso_string_base<_CharT, _Traits, _Alloc>::
+ __sso_string_base(const _Alloc& __a)
+ : _M_dataplus(__a, _M_local_data)
+ { _M_set_length_no_wipe(0); }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ __sso_string_base<_CharT, _Traits, _Alloc>::
+ __sso_string_base(const __sso_string_base& __rcs)
+ : _M_dataplus(__rcs._M_get_allocator(), _M_local_data)
+ { _M_construct(__rcs._M_data(), __rcs._M_data() + __rcs._M_length()); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ __sso_string_base<_CharT, _Traits, _Alloc>::
+ __sso_string_base(__sso_string_base&& __rcs)
+ : _M_dataplus(__rcs._M_get_allocator(), _M_local_data)
+ {
+ if (__rcs._M_is_local())
+ {
+ if (__rcs._M_length())
+ traits_type::copy(_M_local_data, __rcs._M_local_data,
+ _S_local_capacity + 1);
+ }
+ else
+ {
+ _M_data(__rcs._M_data());
+ _M_capacity(__rcs._M_allocated_capacity);
+ }
+
+ _M_length(__rcs._M_length());
+ __rcs._M_length(0);
+ __rcs._M_data(__rcs._M_local_data);
+ }
+#endif
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ __sso_string_base<_CharT, _Traits, _Alloc>::
+ __sso_string_base(size_type __n, _CharT __c, const _Alloc& __a)
+ : _M_dataplus(__a, _M_local_data)
+ { _M_construct(__n, __c); }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ template<typename _InputIterator>
+ __sso_string_base<_CharT, _Traits, _Alloc>::
+ __sso_string_base(_InputIterator __beg, _InputIterator __end,
+ const _Alloc& __a)
+ : _M_dataplus(__a, _M_local_data)
+ { _M_construct(__beg, __end); }
+
+ // NB: This is the special case for Input Iterators, used in
+ // istreambuf_iterators, etc.
+ // Input Iterators have a cost structure very different from
+ // pointers, calling for a different coding style.
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ template<typename _InIterator>
+ void
+ __sso_string_base<_CharT, _Traits, _Alloc>::
+ _M_construct(_InIterator __beg, _InIterator __end,
+ std::input_iterator_tag)
+ {
+ size_type __len = 0;
+ size_type __capacity = size_type(_S_local_capacity);
+
+ while (__beg != __end && __len < __capacity)
+ {
+ _M_data()[__len++] = *__beg;
+ ++__beg;
+ }
+
+ __try
+ {
+ while (__beg != __end)
+ {
+ if (__len == __capacity)
+ {
+ // Allocate more space.
+ __capacity = __len + 1;
+ _CharT* __another = _M_create(__capacity, __len);
+ this->_S_copy(__another, _M_data(), __len);
+ _M_dispose();
+ _M_data(__another);
+ _M_capacity(__capacity);
+ }
+ _M_data()[__len++] = *__beg;
+ ++__beg;
+ }
+ }
+ __catch(...)
+ {
+ _M_dispose();
+ __throw_exception_again;
+ }
+
+ _M_set_length_no_wipe(__len);
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ template<typename _InIterator>
+ void
+ __sso_string_base<_CharT, _Traits, _Alloc>::
+ _M_construct(_InIterator __beg, _InIterator __end,
+ std::forward_iterator_tag)
+ {
+ // NB: Not required, but considered best practice.
+ if (__builtin_expect(__is_null_pointer(__beg) && __beg != __end, 0))
+ std::__throw_logic_error(__N("__sso_string_base::"
+ "_M_construct NULL not valid"));
+
+ size_type __dnew = static_cast<size_type>(std::distance(__beg, __end));
+
+ if (__dnew > size_type(_S_local_capacity))
+ {
+ _M_data(_M_create(__dnew, size_type(0)));
+ _M_capacity(__dnew);
+ }
+
+ // Check for out_of_range and length_error exceptions.
+ __try
+ { this->_S_copy_chars(_M_data(), __beg, __end); }
+ __catch(...)
+ {
+ _M_dispose();
+ __throw_exception_again;
+ }
+
+ _M_set_length_no_wipe(__dnew);
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ __sso_string_base<_CharT, _Traits, _Alloc>::
+ _M_construct(size_type __n, _CharT __c)
+ {
+ if (__n > size_type(_S_local_capacity))
+ {
+ _M_data(_M_create(__n, size_type(0)));
+ _M_capacity(__n);
+ }
+
+ if (__n)
+ this->_S_assign(_M_data(), __n, __c);
+
+ _M_set_length_no_wipe(__n);
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ __sso_string_base<_CharT, _Traits, _Alloc>::
+ _M_assign(const __sso_string_base& __rcs)
+ {
+ if (this != &__rcs)
+ {
+ const size_type __rsize = __rcs._M_length();
+ const size_type __capacity = _M_capacity();
+
+ if (__rsize > __capacity)
+ {
+ size_type __new_capacity = __rsize;
+ _CharT* __tmp = _M_create(__new_capacity, __capacity);
+ _M_dispose();
+ _M_data(__tmp);
+ _M_capacity(__new_capacity);
+ }
+
+ if (__rsize)
+ this->_S_copy(_M_data(), __rcs._M_data(), __rsize);
+
+ _M_set_length(__rsize);
+ }
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ __sso_string_base<_CharT, _Traits, _Alloc>::
+ _M_reserve(size_type __res)
+ {
+ // Make sure we don't shrink below the current size.
+ if (__res < _M_length())
+ __res = _M_length();
+
+ const size_type __capacity = _M_capacity();
+ if (__res != __capacity)
+ {
+ if (__res > __capacity
+ || __res > size_type(_S_local_capacity))
+ {
+ _CharT* __tmp = _M_create(__res, __capacity);
+ this->_S_copy(__tmp, _M_data(), _M_length() + 1);
+ _M_dispose();
+ _M_data(__tmp);
+ _M_capacity(__res);
+ }
+ else if (!_M_is_local())
+ {
+ this->_S_copy(_M_local_data, _M_data(), _M_length() + 1);
+ _M_destroy(__capacity);
+ _M_data(_M_local_data);
+ }
+ }
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ __sso_string_base<_CharT, _Traits, _Alloc>::
+ _M_mutate(size_type __pos, size_type __len1, const _CharT* __s,
+ const size_type __len2)
+ {
+ const size_type __how_much = _M_length() - __pos - __len1;
+
+ size_type __new_capacity = _M_length() + __len2 - __len1;
+ _CharT* __r = _M_create(__new_capacity, _M_capacity());
+
+ if (__pos)
+ this->_S_copy(__r, _M_data(), __pos);
+ if (__s && __len2)
+ this->_S_copy(__r + __pos, __s, __len2);
+ if (__how_much)
+ this->_S_copy(__r + __pos + __len2,
+ _M_data() + __pos + __len1, __how_much);
+
+ _M_dispose();
+ _M_data(__r);
+ _M_capacity(__new_capacity);
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ __sso_string_base<_CharT, _Traits, _Alloc>::
+ _M_erase(size_type __pos, size_type __n)
+ {
+ const size_type __how_much = _M_length() - __pos - __n;
+
+ if (__how_much && __n)
+ this->_S_move(_M_data() + __pos, _M_data() + __pos + __n,
+ __how_much);
+
+ _M_set_length(_M_length() - __n);
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _SSO_STRING_BASE_H */
diff --git a/i686-linux/include/c++/4.4.3/ext/stdio_filebuf.h b/i686-linux/include/c++/4.4.3/ext/stdio_filebuf.h
new file mode 100644
index 0000000..6efe4ea
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/stdio_filebuf.h
@@ -0,0 +1,157 @@
+// File descriptor layer for filebuf -*- C++ -*-
+
+// Copyright (C) 2002, 2003, 2004, 2005, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ext/stdio_filebuf.h
+ * This file is a GNU extension to the Standard C++ Library.
+ */
+
+#ifndef _STDIO_FILEBUF_H
+#define _STDIO_FILEBUF_H 1
+
+#pragma GCC system_header
+
+#include <fstream>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ /**
+ * @brief Provides a layer of compatibility for C/POSIX.
+ *
+ * This GNU extension provides extensions for working with standard C
+ * FILE*'s and POSIX file descriptors. It must be instantiated by the
+ * user with the type of character used in the file stream, e.g.,
+ * stdio_filebuf<char>.
+ */
+ template<typename _CharT, typename _Traits = std::char_traits<_CharT> >
+ class stdio_filebuf : public std::basic_filebuf<_CharT, _Traits>
+ {
+ public:
+ // Types:
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ typedef typename traits_type::int_type int_type;
+ typedef typename traits_type::pos_type pos_type;
+ typedef typename traits_type::off_type off_type;
+ typedef std::size_t size_t;
+
+ public:
+ /**
+ * deferred initialization
+ */
+ stdio_filebuf() : std::basic_filebuf<_CharT, _Traits>() {}
+
+ /**
+ * @param fd An open file descriptor.
+ * @param mode Same meaning as in a standard filebuf.
+ * @param size Optimal or preferred size of internal buffer, in chars.
+ *
+ * This constructor associates a file stream buffer with an open
+ * POSIX file descriptor. The file descriptor will be automatically
+ * closed when the stdio_filebuf is closed/destroyed.
+ */
+ stdio_filebuf(int __fd, std::ios_base::openmode __mode,
+ size_t __size = static_cast<size_t>(BUFSIZ));
+
+ /**
+ * @param f An open @c FILE*.
+ * @param mode Same meaning as in a standard filebuf.
+ * @param size Optimal or preferred size of internal buffer, in chars.
+ * Defaults to system's @c BUFSIZ.
+ *
+ * This constructor associates a file stream buffer with an open
+ * C @c FILE*. The @c FILE* will not be automatically closed when the
+ * stdio_filebuf is closed/destroyed.
+ */
+ stdio_filebuf(std::__c_file* __f, std::ios_base::openmode __mode,
+ size_t __size = static_cast<size_t>(BUFSIZ));
+
+ /**
+ * Closes the external data stream if the file descriptor constructor
+ * was used.
+ */
+ virtual
+ ~stdio_filebuf();
+
+ /**
+ * @return The underlying file descriptor.
+ *
+ * Once associated with an external data stream, this function can be
+ * used to access the underlying POSIX file descriptor. Note that
+ * there is no way for the library to track what you do with the
+ * descriptor, so be careful.
+ */
+ int
+ fd() { return this->_M_file.fd(); }
+
+ /**
+ * @return The underlying FILE*.
+ *
+ * This function can be used to access the underlying "C" file pointer.
+ * Note that there is no way for the library to track what you do
+ * with the file, so be careful.
+ */
+ std::__c_file*
+ file() { return this->_M_file.file(); }
+ };
+
+ template<typename _CharT, typename _Traits>
+ stdio_filebuf<_CharT, _Traits>::~stdio_filebuf()
+ { }
+
+ template<typename _CharT, typename _Traits>
+ stdio_filebuf<_CharT, _Traits>::
+ stdio_filebuf(int __fd, std::ios_base::openmode __mode, size_t __size)
+ {
+ this->_M_file.sys_open(__fd, __mode);
+ if (this->is_open())
+ {
+ this->_M_mode = __mode;
+ this->_M_buf_size = __size;
+ this->_M_allocate_internal_buffer();
+ this->_M_reading = false;
+ this->_M_writing = false;
+ this->_M_set_buffer(-1);
+ }
+ }
+
+ template<typename _CharT, typename _Traits>
+ stdio_filebuf<_CharT, _Traits>::
+ stdio_filebuf(std::__c_file* __f, std::ios_base::openmode __mode,
+ size_t __size)
+ {
+ this->_M_file.sys_open(__f, __mode);
+ if (this->is_open())
+ {
+ this->_M_mode = __mode;
+ this->_M_buf_size = __size;
+ this->_M_allocate_internal_buffer();
+ this->_M_reading = false;
+ this->_M_writing = false;
+ this->_M_set_buffer(-1);
+ }
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/stdio_sync_filebuf.h b/i686-linux/include/c++/4.4.3/ext/stdio_sync_filebuf.h
new file mode 100644
index 0000000..9407e96
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/stdio_sync_filebuf.h
@@ -0,0 +1,279 @@
+// Iostreams wrapper for stdio FILE* -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ext/stdio_sync_filebuf.h
+ * This file is a GNU extension to the Standard C++ Library.
+ */
+
+#ifndef _STDIO_SYNC_FILEBUF_H
+#define _STDIO_SYNC_FILEBUF_H 1
+
+#pragma GCC system_header
+
+#include <streambuf>
+#include <unistd.h>
+#include <cstdio>
+#include <bits/c++io.h> // For __c_file
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+#include <cwchar>
+#endif
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ /// class stdio_sync_filebuf.
+ template<typename _CharT, typename _Traits = std::char_traits<_CharT> >
+ class stdio_sync_filebuf : public std::basic_streambuf<_CharT, _Traits>
+ {
+ public:
+ // Types:
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ typedef typename traits_type::int_type int_type;
+ typedef typename traits_type::pos_type pos_type;
+ typedef typename traits_type::off_type off_type;
+
+ private:
+ // Underlying stdio FILE
+ std::__c_file* const _M_file;
+
+ // Last character gotten. This is used when pbackfail is
+ // called from basic_streambuf::sungetc()
+ int_type _M_unget_buf;
+
+ public:
+ explicit
+ stdio_sync_filebuf(std::__c_file* __f)
+ : _M_file(__f), _M_unget_buf(traits_type::eof())
+ { }
+
+ /**
+ * @return The underlying FILE*.
+ *
+ * This function can be used to access the underlying "C" file pointer.
+ * Note that there is no way for the library to track what you do
+ * with the file, so be careful.
+ */
+ std::__c_file* const
+ file() { return this->_M_file; }
+
+ protected:
+ int_type
+ syncgetc();
+
+ int_type
+ syncungetc(int_type __c);
+
+ int_type
+ syncputc(int_type __c);
+
+ virtual int_type
+ underflow()
+ {
+ int_type __c = this->syncgetc();
+ return this->syncungetc(__c);
+ }
+
+ virtual int_type
+ uflow()
+ {
+ // Store the gotten character in case we need to unget it.
+ _M_unget_buf = this->syncgetc();
+ return _M_unget_buf;
+ }
+
+ virtual int_type
+ pbackfail(int_type __c = traits_type::eof())
+ {
+ int_type __ret;
+ const int_type __eof = traits_type::eof();
+
+ // Check if the unget or putback was requested
+ if (traits_type::eq_int_type(__c, __eof)) // unget
+ {
+ if (!traits_type::eq_int_type(_M_unget_buf, __eof))
+ __ret = this->syncungetc(_M_unget_buf);
+ else // buffer invalid, fail.
+ __ret = __eof;
+ }
+ else // putback
+ __ret = this->syncungetc(__c);
+
+ // The buffered character is no longer valid, discard it.
+ _M_unget_buf = __eof;
+ return __ret;
+ }
+
+ virtual std::streamsize
+ xsgetn(char_type* __s, std::streamsize __n);
+
+ virtual int_type
+ overflow(int_type __c = traits_type::eof())
+ {
+ int_type __ret;
+ if (traits_type::eq_int_type(__c, traits_type::eof()))
+ {
+ if (std::fflush(_M_file))
+ __ret = traits_type::eof();
+ else
+ __ret = traits_type::not_eof(__c);
+ }
+ else
+ __ret = this->syncputc(__c);
+ return __ret;
+ }
+
+ virtual std::streamsize
+ xsputn(const char_type* __s, std::streamsize __n);
+
+ virtual int
+ sync()
+ { return std::fflush(_M_file); }
+
+ virtual std::streampos
+ seekoff(std::streamoff __off, std::ios_base::seekdir __dir,
+ std::ios_base::openmode = std::ios_base::in | std::ios_base::out)
+ {
+ std::streampos __ret(std::streamoff(-1));
+ int __whence;
+ if (__dir == std::ios_base::beg)
+ __whence = SEEK_SET;
+ else if (__dir == std::ios_base::cur)
+ __whence = SEEK_CUR;
+ else
+ __whence = SEEK_END;
+#ifdef _GLIBCXX_USE_LFS
+ if (!fseeko64(_M_file, __off, __whence))
+ __ret = std::streampos(ftello64(_M_file));
+#else
+ if (!fseek(_M_file, __off, __whence))
+ __ret = std::streampos(std::ftell(_M_file));
+#endif
+ return __ret;
+ }
+
+ virtual std::streampos
+ seekpos(std::streampos __pos,
+ std::ios_base::openmode __mode =
+ std::ios_base::in | std::ios_base::out)
+ { return seekoff(std::streamoff(__pos), std::ios_base::beg, __mode); }
+ };
+
+ template<>
+ inline stdio_sync_filebuf<char>::int_type
+ stdio_sync_filebuf<char>::syncgetc()
+ { return std::getc(_M_file); }
+
+ template<>
+ inline stdio_sync_filebuf<char>::int_type
+ stdio_sync_filebuf<char>::syncungetc(int_type __c)
+ { return std::ungetc(__c, _M_file); }
+
+ template<>
+ inline stdio_sync_filebuf<char>::int_type
+ stdio_sync_filebuf<char>::syncputc(int_type __c)
+ { return std::putc(__c, _M_file); }
+
+ template<>
+ inline std::streamsize
+ stdio_sync_filebuf<char>::xsgetn(char* __s, std::streamsize __n)
+ {
+ std::streamsize __ret = std::fread(__s, 1, __n, _M_file);
+ if (__ret > 0)
+ _M_unget_buf = traits_type::to_int_type(__s[__ret - 1]);
+ else
+ _M_unget_buf = traits_type::eof();
+ return __ret;
+ }
+
+ template<>
+ inline std::streamsize
+ stdio_sync_filebuf<char>::xsputn(const char* __s, std::streamsize __n)
+ { return std::fwrite(__s, 1, __n, _M_file); }
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template<>
+ inline stdio_sync_filebuf<wchar_t>::int_type
+ stdio_sync_filebuf<wchar_t>::syncgetc()
+ { return std::getwc(_M_file); }
+
+ template<>
+ inline stdio_sync_filebuf<wchar_t>::int_type
+ stdio_sync_filebuf<wchar_t>::syncungetc(int_type __c)
+ { return std::ungetwc(__c, _M_file); }
+
+ template<>
+ inline stdio_sync_filebuf<wchar_t>::int_type
+ stdio_sync_filebuf<wchar_t>::syncputc(int_type __c)
+ { return std::putwc(__c, _M_file); }
+
+ template<>
+ inline std::streamsize
+ stdio_sync_filebuf<wchar_t>::xsgetn(wchar_t* __s, std::streamsize __n)
+ {
+ std::streamsize __ret = 0;
+ const int_type __eof = traits_type::eof();
+ while (__n--)
+ {
+ int_type __c = this->syncgetc();
+ if (traits_type::eq_int_type(__c, __eof))
+ break;
+ __s[__ret] = traits_type::to_char_type(__c);
+ ++__ret;
+ }
+
+ if (__ret > 0)
+ _M_unget_buf = traits_type::to_int_type(__s[__ret - 1]);
+ else
+ _M_unget_buf = traits_type::eof();
+ return __ret;
+ }
+
+ template<>
+ inline std::streamsize
+ stdio_sync_filebuf<wchar_t>::xsputn(const wchar_t* __s,
+ std::streamsize __n)
+ {
+ std::streamsize __ret = 0;
+ const int_type __eof = traits_type::eof();
+ while (__n--)
+ {
+ if (traits_type::eq_int_type(this->syncputc(*__s++), __eof))
+ break;
+ ++__ret;
+ }
+ return __ret;
+ }
+#endif
+
+#if _GLIBCXX_EXTERN_TEMPLATE
+ extern template class stdio_sync_filebuf<char>;
+#ifdef _GLIBCXX_USE_WCHAR_T
+ extern template class stdio_sync_filebuf<wchar_t>;
+#endif
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/string_conversions.h b/i686-linux/include/c++/4.4.3/ext/string_conversions.h
new file mode 100644
index 0000000..36c19e0
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/string_conversions.h
@@ -0,0 +1,94 @@
+// String Conversions -*- C++ -*-
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+#ifndef _STRING_CONVERSIONS_H
+#define _STRING_CONVERSIONS_H 1
+
+#pragma GCC system_header
+
+#include <ext/numeric_traits.h>
+#include <bits/functexcept.h>
+#include <cstddef>
+#include <cstdlib>
+#include <cwchar>
+#include <cstdio>
+#include <cerrno>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ // Helper for all the sto* functions.
+ template<typename _TRet, typename _Ret = _TRet, typename _CharT,
+ typename... _Base>
+ _Ret
+ __stoa(_TRet (*__convf) (const _CharT*, _CharT**, _Base...),
+ const char* __name, const _CharT* __str, std::size_t* __idx,
+ _Base... __base)
+ {
+ _Ret __ret;
+
+ _CharT* __endptr;
+ errno = 0;
+ const _TRet __tmp = __convf(__str, &__endptr, __base...);
+
+ if (__endptr == __str)
+ std::__throw_invalid_argument(__name);
+ else if (errno == ERANGE
+ || (std::__are_same<_Ret, int>::__value
+ && (__tmp < __numeric_traits<int>::__min
+ || __tmp > __numeric_traits<int>::__max)))
+ std::__throw_out_of_range(__name);
+ else
+ __ret = __tmp;
+
+ if (__idx)
+ *__idx = __endptr - __str;
+
+ return __ret;
+ }
+
+ // Helper for the to_string / to_wstring functions.
+ template<typename _String, typename _CharT = typename _String::value_type>
+ _String
+ __to_xstring(int (*__convf) (_CharT*, std::size_t, const _CharT*,
+ __builtin_va_list), std::size_t __n,
+ const _CharT* __fmt, ...)
+ {
+ // XXX Eventually the result will be constructed in place in
+ // the C++0x string, likely with the help of internal hooks.
+ _CharT* __s = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+ * __n));
+
+ __builtin_va_list __args;
+ __builtin_va_start(__args, __fmt);
+
+ const int __len = __convf(__s, __n, __fmt, __args);
+
+ __builtin_va_end(__args);
+
+ return _String(__s, __s + __len);
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif // _STRING_CONVERSIONS_H
diff --git a/i686-linux/include/c++/4.4.3/ext/throw_allocator.h b/i686-linux/include/c++/4.4.3/ext/throw_allocator.h
new file mode 100644
index 0000000..c87408f
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/throw_allocator.h
@@ -0,0 +1,448 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/** @file ext/throw_allocator.h
+ * This file is a GNU extension to the Standard C++ Library.
+ *
+ * Contains an exception-throwing allocator, useful for testing
+ * exception safety. In addition, allocation addresses are stored and
+ * sanity checked.
+ */
+
+#ifndef _THROW_ALLOCATOR_H
+#define _THROW_ALLOCATOR_H 1
+
+#include <cmath>
+#include <ctime>
+#include <map>
+#include <set>
+#include <string>
+#include <ostream>
+#include <stdexcept>
+#include <utility>
+#include <tr1/random>
+#include <bits/functexcept.h>
+#include <bits/move.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ class twister_rand_gen
+ {
+ private:
+ std::tr1::mt19937 _M_generator;
+
+ public:
+ twister_rand_gen(unsigned int s = static_cast<unsigned int>(std::time(0)));
+
+ void
+ init(unsigned int);
+
+ double
+ get_prob();
+ };
+
+ /**
+ * @brief Thown by throw_allocator.
+ * @ingroup exceptions
+ */
+ struct forced_exception_error : public std::exception
+ { };
+
+ // Substitute for concurrence_error object in the case of -fno-exceptions.
+ inline void
+ __throw_forced_exception_error()
+ {
+#if __EXCEPTIONS
+ throw forced_exception_error();
+#else
+ __builtin_abort();
+#endif
+ }
+
+ /// Base class.
+ class throw_allocator_base
+ {
+ public:
+ void
+ init(unsigned long seed);
+
+ static void
+ set_throw_prob(double throw_prob);
+
+ static double
+ get_throw_prob();
+
+ static void
+ set_label(size_t l);
+
+ static bool
+ empty();
+
+ struct group_throw_prob_adjustor
+ {
+ group_throw_prob_adjustor(size_t size) : _M_throw_prob_orig(_S_throw_prob)
+ {
+ _S_throw_prob =
+ 1 - std::pow(double(1 - _S_throw_prob), double(0.5 / (size + 1)));
+ }
+
+ ~group_throw_prob_adjustor()
+ { _S_throw_prob = _M_throw_prob_orig; }
+
+ private:
+ const double _M_throw_prob_orig;
+ };
+
+ struct zero_throw_prob_adjustor
+ {
+ zero_throw_prob_adjustor() : _M_throw_prob_orig(_S_throw_prob)
+ { _S_throw_prob = 0; }
+
+ ~zero_throw_prob_adjustor()
+ { _S_throw_prob = _M_throw_prob_orig; }
+
+ private:
+ const double _M_throw_prob_orig;
+ };
+
+ protected:
+ static void
+ insert(void*, size_t);
+
+ static void
+ erase(void*, size_t);
+
+ static void
+ throw_conditionally();
+
+ // See if a particular address and size has been allocated by this
+ // allocator.
+ static void
+ check_allocated(void*, size_t);
+
+ // See if a given label has been allocated by this allocator.
+ static void
+ check_allocated(size_t);
+
+ private:
+ typedef std::pair<size_t, size_t> alloc_data_type;
+ typedef std::map<void*, alloc_data_type> map_type;
+ typedef map_type::value_type entry_type;
+ typedef map_type::const_iterator const_iterator;
+ typedef map_type::const_reference const_reference;
+
+ friend std::ostream&
+ operator<<(std::ostream&, const throw_allocator_base&);
+
+ static entry_type
+ make_entry(void*, size_t);
+
+ static void
+ print_to_string(std::string&);
+
+ static void
+ print_to_string(std::string&, const_reference);
+
+ static twister_rand_gen _S_g;
+ static map_type _S_map;
+ static double _S_throw_prob;
+ static size_t _S_label;
+ };
+
+ /**
+ * @brief Allocator class with logging and exception control.
+ * @ingroup allocators
+ */
+ template<typename T>
+ class throw_allocator : public throw_allocator_base
+ {
+ public:
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef T value_type;
+ typedef value_type* pointer;
+ typedef const value_type* const_pointer;
+ typedef value_type& reference;
+ typedef const value_type& const_reference;
+
+
+ template<typename U>
+ struct rebind
+ {
+ typedef throw_allocator<U> other;
+ };
+
+ throw_allocator() throw() { }
+
+ throw_allocator(const throw_allocator&) throw() { }
+
+ template<typename U>
+ throw_allocator(const throw_allocator<U>&) throw() { }
+
+ ~throw_allocator() throw() { }
+
+ size_type
+ max_size() const throw()
+ { return std::allocator<value_type>().max_size(); }
+
+ pointer
+ allocate(size_type __n, std::allocator<void>::const_pointer hint = 0)
+ {
+ if (__builtin_expect(__n > this->max_size(), false))
+ std::__throw_bad_alloc();
+
+ throw_conditionally();
+ value_type* const a = std::allocator<value_type>().allocate(__n, hint);
+ insert(a, sizeof(value_type) * __n);
+ return a;
+ }
+
+ void
+ construct(pointer __p, const T& val)
+ { return std::allocator<value_type>().construct(__p, val); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename... _Args>
+ void
+ construct(pointer __p, _Args&&... __args)
+ {
+ return std::allocator<value_type>().
+ construct(__p, std::forward<_Args>(__args)...);
+ }
+#endif
+
+ void
+ destroy(pointer __p)
+ { std::allocator<value_type>().destroy(__p); }
+
+ void
+ deallocate(pointer __p, size_type __n)
+ {
+ erase(__p, sizeof(value_type) * __n);
+ std::allocator<value_type>().deallocate(__p, __n);
+ }
+
+ void
+ check_allocated(pointer __p, size_type __n)
+ { throw_allocator_base::check_allocated(__p, sizeof(value_type) * __n); }
+
+ void
+ check_allocated(size_type label)
+ { throw_allocator_base::check_allocated(label); }
+ };
+
+ template<typename T>
+ inline bool
+ operator==(const throw_allocator<T>&, const throw_allocator<T>&)
+ { return true; }
+
+ template<typename T>
+ inline bool
+ operator!=(const throw_allocator<T>&, const throw_allocator<T>&)
+ { return false; }
+
+ std::ostream&
+ operator<<(std::ostream& os, const throw_allocator_base& alloc)
+ {
+ std::string error;
+ throw_allocator_base::print_to_string(error);
+ os << error;
+ return os;
+ }
+
+ // XXX Should be in .cc.
+ twister_rand_gen::
+ twister_rand_gen(unsigned int seed) : _M_generator(seed) { }
+
+ void
+ twister_rand_gen::
+ init(unsigned int seed)
+ { _M_generator.seed(seed); }
+
+ double
+ twister_rand_gen::
+ get_prob()
+ {
+ const double min = _M_generator.min();
+ const double res = static_cast<const double>(_M_generator() - min);
+ const double range = static_cast<const double>(_M_generator.max() - min);
+ const double ret = res / range;
+ _GLIBCXX_DEBUG_ASSERT(ret >= 0 && ret <= 1);
+ return ret;
+ }
+
+ twister_rand_gen throw_allocator_base::_S_g;
+
+ throw_allocator_base::map_type
+ throw_allocator_base::_S_map;
+
+ double throw_allocator_base::_S_throw_prob;
+
+ size_t throw_allocator_base::_S_label = 0;
+
+ throw_allocator_base::entry_type
+ throw_allocator_base::make_entry(void* p, size_t size)
+ { return std::make_pair(p, alloc_data_type(_S_label, size)); }
+
+ void
+ throw_allocator_base::init(unsigned long seed)
+ { _S_g.init(seed); }
+
+ void
+ throw_allocator_base::set_throw_prob(double throw_prob)
+ { _S_throw_prob = throw_prob; }
+
+ double
+ throw_allocator_base::get_throw_prob()
+ { return _S_throw_prob; }
+
+ void
+ throw_allocator_base::set_label(size_t l)
+ { _S_label = l; }
+
+ void
+ throw_allocator_base::insert(void* p, size_t size)
+ {
+ const_iterator found_it = _S_map.find(p);
+ if (found_it != _S_map.end())
+ {
+ std::string error("throw_allocator_base::insert");
+ error += "double insert!";
+ error += '\n';
+ print_to_string(error, make_entry(p, size));
+ print_to_string(error, *found_it);
+ std::__throw_logic_error(error.c_str());
+ }
+ _S_map.insert(make_entry(p, size));
+ }
+
+ bool
+ throw_allocator_base::empty()
+ { return _S_map.empty(); }
+
+ void
+ throw_allocator_base::erase(void* p, size_t size)
+ {
+ check_allocated(p, size);
+ _S_map.erase(p);
+ }
+
+ void
+ throw_allocator_base::check_allocated(void* p, size_t size)
+ {
+ const_iterator found_it = _S_map.find(p);
+ if (found_it == _S_map.end())
+ {
+ std::string error("throw_allocator_base::check_allocated by value ");
+ error += "null erase!";
+ error += '\n';
+ print_to_string(error, make_entry(p, size));
+ std::__throw_logic_error(error.c_str());
+ }
+
+ if (found_it->second.second != size)
+ {
+ std::string error("throw_allocator_base::check_allocated by value ");
+ error += "wrong-size erase!";
+ error += '\n';
+ print_to_string(error, make_entry(p, size));
+ print_to_string(error, *found_it);
+ std::__throw_logic_error(error.c_str());
+ }
+ }
+
+ void
+ throw_allocator_base::check_allocated(size_t label)
+ {
+ std::string found;
+ const_iterator it = _S_map.begin();
+ while (it != _S_map.end())
+ {
+ if (it->second.first == label)
+ {
+ print_to_string(found, *it);
+ }
+ ++it;
+ }
+
+ if (!found.empty())
+ {
+ std::string error("throw_allocator_base::check_allocated by label ");
+ error += '\n';
+ error += found;
+ std::__throw_logic_error(error.c_str());
+ }
+ }
+
+ void
+ throw_allocator_base::throw_conditionally()
+ {
+ if (_S_g.get_prob() < _S_throw_prob)
+ __throw_forced_exception_error();
+ }
+
+ void
+ throw_allocator_base::print_to_string(std::string& s)
+ {
+ const_iterator begin = throw_allocator_base::_S_map.begin();
+ const_iterator end = throw_allocator_base::_S_map.end();
+ for (; begin != end; ++begin)
+ print_to_string(s, *begin);
+ }
+
+ void
+ throw_allocator_base::print_to_string(std::string& s, const_reference ref)
+ {
+ char buf[40];
+ const char tab('\t');
+ s += "address: ";
+ __builtin_sprintf(buf, "%p", ref.first);
+ s += buf;
+ s += tab;
+ s += "label: ";
+ unsigned long l = static_cast<unsigned long>(ref.second.first);
+ __builtin_sprintf(buf, "%lu", l);
+ s += buf;
+ s += tab;
+ s += "size: ";
+ l = static_cast<unsigned long>(ref.second.second);
+ __builtin_sprintf(buf, "%lu", l);
+ s += buf;
+ s += '\n';
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/type_traits.h b/i686-linux/include/c++/4.4.3/ext/type_traits.h
new file mode 100644
index 0000000..b24ce4e
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/type_traits.h
@@ -0,0 +1,204 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ext/type_traits.h
+ * This file is a GNU extension to the Standard C++ Library.
+ */
+
+#ifndef _EXT_TYPE_TRAITS
+#define _EXT_TYPE_TRAITS 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <bits/cpp_type_traits.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ // Define a nested type if some predicate holds.
+ template<bool, typename>
+ struct __enable_if
+ { };
+
+ template<typename _Tp>
+ struct __enable_if<true, _Tp>
+ { typedef _Tp __type; };
+
+
+ // Conditional expression for types. If true, first, if false, second.
+ template<bool _Cond, typename _Iftrue, typename _Iffalse>
+ struct __conditional_type
+ { typedef _Iftrue __type; };
+
+ template<typename _Iftrue, typename _Iffalse>
+ struct __conditional_type<false, _Iftrue, _Iffalse>
+ { typedef _Iffalse __type; };
+
+
+ // Given an integral builtin type, return the corresponding unsigned type.
+ template<typename _Tp>
+ struct __add_unsigned
+ {
+ private:
+ typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
+
+ public:
+ typedef typename __if_type::__type __type;
+ };
+
+ template<>
+ struct __add_unsigned<char>
+ { typedef unsigned char __type; };
+
+ template<>
+ struct __add_unsigned<signed char>
+ { typedef unsigned char __type; };
+
+ template<>
+ struct __add_unsigned<short>
+ { typedef unsigned short __type; };
+
+ template<>
+ struct __add_unsigned<int>
+ { typedef unsigned int __type; };
+
+ template<>
+ struct __add_unsigned<long>
+ { typedef unsigned long __type; };
+
+ template<>
+ struct __add_unsigned<long long>
+ { typedef unsigned long long __type; };
+
+ // Declare but don't define.
+ template<>
+ struct __add_unsigned<bool>;
+
+ template<>
+ struct __add_unsigned<wchar_t>;
+
+
+ // Given an integral builtin type, return the corresponding signed type.
+ template<typename _Tp>
+ struct __remove_unsigned
+ {
+ private:
+ typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
+
+ public:
+ typedef typename __if_type::__type __type;
+ };
+
+ template<>
+ struct __remove_unsigned<char>
+ { typedef signed char __type; };
+
+ template<>
+ struct __remove_unsigned<unsigned char>
+ { typedef signed char __type; };
+
+ template<>
+ struct __remove_unsigned<unsigned short>
+ { typedef short __type; };
+
+ template<>
+ struct __remove_unsigned<unsigned int>
+ { typedef int __type; };
+
+ template<>
+ struct __remove_unsigned<unsigned long>
+ { typedef long __type; };
+
+ template<>
+ struct __remove_unsigned<unsigned long long>
+ { typedef long long __type; };
+
+ // Declare but don't define.
+ template<>
+ struct __remove_unsigned<bool>;
+
+ template<>
+ struct __remove_unsigned<wchar_t>;
+
+
+ // For use in string and vstring.
+ template<typename _Type>
+ inline bool
+ __is_null_pointer(_Type* __ptr)
+ { return __ptr == 0; }
+
+ template<typename _Type>
+ inline bool
+ __is_null_pointer(_Type)
+ { return false; }
+
+
+ // For complex and cmath
+ template<typename _Tp, bool = std::__is_integer<_Tp>::__value>
+ struct __promote
+ { typedef double __type; };
+
+ template<typename _Tp>
+ struct __promote<_Tp, false>
+ { typedef _Tp __type; };
+
+ template<typename _Tp, typename _Up>
+ struct __promote_2
+ {
+ private:
+ typedef typename __promote<_Tp>::__type __type1;
+ typedef typename __promote<_Up>::__type __type2;
+
+ public:
+ typedef __typeof__(__type1() + __type2()) __type;
+ };
+
+ template<typename _Tp, typename _Up, typename _Vp>
+ struct __promote_3
+ {
+ private:
+ typedef typename __promote<_Tp>::__type __type1;
+ typedef typename __promote<_Up>::__type __type2;
+ typedef typename __promote<_Vp>::__type __type3;
+
+ public:
+ typedef __typeof__(__type1() + __type2() + __type3()) __type;
+ };
+
+ template<typename _Tp, typename _Up, typename _Vp, typename _Wp>
+ struct __promote_4
+ {
+ private:
+ typedef typename __promote<_Tp>::__type __type1;
+ typedef typename __promote<_Up>::__type __type2;
+ typedef typename __promote<_Vp>::__type __type3;
+ typedef typename __promote<_Wp>::__type __type4;
+
+ public:
+ typedef __typeof__(__type1() + __type2() + __type3() + __type4()) __type;
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/ext/typelist.h b/i686-linux/include/c++/4.4.3/ext/typelist.h
new file mode 100644
index 0000000..ff1cac7
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/typelist.h
@@ -0,0 +1,544 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice and
+// this permission notice appear in supporting documentation. None of
+// the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied warranty.
+
+/**
+ * @file typelist.h
+ * Contains typelist_chain definitions.
+ * Typelists are an idea by Andrei Alexandrescu.
+ */
+
+#ifndef _TYPELIST_H
+#define _TYPELIST_H 1
+
+#include <ext/type_traits.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+/** @namespace __gnu_cxx::typelist
+ * @brief GNU typelist extensions for public compile-time use.
+*/
+namespace typelist
+{
+ struct null_type { };
+
+ template<typename Root>
+ struct node
+ {
+ typedef Root root;
+ };
+
+ // Forward declarations of functors.
+ template<typename Hd, typename Typelist>
+ struct chain
+ {
+ typedef Hd head;
+ typedef Typelist tail;
+ };
+
+ // Apply all typelist types to unary functor.
+ template<typename Fn, typename Typelist>
+ void
+ apply(Fn&, Typelist);
+
+ /// Apply all typelist types to generator functor.
+ template<typename Gn, typename Typelist>
+ void
+ apply_generator(Gn&, Typelist);
+
+ // Apply all typelist types and values to generator functor.
+ template<typename Gn, typename TypelistT, typename TypelistV>
+ void
+ apply_generator(Gn&, TypelistT, TypelistV);
+
+ template<typename Typelist0, typename Typelist1>
+ struct append;
+
+ template<typename Typelist_Typelist>
+ struct append_typelist;
+
+ template<typename Typelist, typename T>
+ struct contains;
+
+ template<typename Typelist, template<typename T> class Pred>
+ struct filter;
+
+ template<typename Typelist, int i>
+ struct at_index;
+
+ template<typename Typelist, template<typename T> class Transform>
+ struct transform;
+
+ template<typename Typelist_Typelist>
+ struct flatten;
+
+ template<typename Typelist>
+ struct from_first;
+
+ template<typename T1>
+ struct create1;
+
+ template<typename T1, typename T2>
+ struct create2;
+
+ template<typename T1, typename T2, typename T3>
+ struct create3;
+
+ template<typename T1, typename T2, typename T3, typename T4>
+ struct create4;
+
+ template<typename T1, typename T2, typename T3, typename T4, typename T5>
+ struct create5;
+
+ template<typename T1, typename T2, typename T3,
+ typename T4, typename T5, typename T6>
+ struct create6;
+} // namespace typelist
+
+_GLIBCXX_END_NAMESPACE
+
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+namespace typelist
+{
+namespace detail
+{
+ template<typename Fn, typename Typelist_Chain>
+ struct apply_;
+
+ template<typename Fn, typename Hd, typename Tl>
+ struct apply_<Fn, chain<Hd, Tl> >
+ {
+ void
+ operator()(Fn& f)
+ {
+ f.operator()(Hd());
+ apply_<Fn, Tl> next;
+ next(f);
+ }
+ };
+
+ template<typename Fn>
+ struct apply_<Fn, null_type>
+ {
+ void
+ operator()(Fn&) { }
+ };
+
+ template<typename Gn, typename Typelist_Chain>
+ struct apply_generator1_;
+
+ template<typename Gn, typename Hd, typename Tl>
+ struct apply_generator1_<Gn, chain<Hd, Tl> >
+ {
+ void
+ operator()(Gn& g)
+ {
+ g.template operator()<Hd>();
+ apply_generator1_<Gn, Tl> next;
+ next(g);
+ }
+ };
+
+ template<typename Gn>
+ struct apply_generator1_<Gn, null_type>
+ {
+ void
+ operator()(Gn&) { }
+ };
+
+ template<typename Gn, typename TypelistT_Chain, typename TypelistV_Chain>
+ struct apply_generator2_;
+
+ template<typename Gn, typename Hd1, typename TlT, typename Hd2, typename TlV>
+ struct apply_generator2_<Gn, chain<Hd1, TlT>, chain<Hd2, TlV> >
+ {
+ void
+ operator()(Gn& g)
+ {
+ g.template operator()<Hd1, Hd2>();
+ apply_generator2_<Gn, TlT, TlV> next;
+ next(g);
+ }
+ };
+
+ template<typename Gn>
+ struct apply_generator2_<Gn, null_type, null_type>
+ {
+ void
+ operator()(Gn&) { }
+ };
+
+ template<typename Typelist_Chain0, typename Typelist_Chain1>
+ struct append_;
+
+ template<typename Hd, typename Tl, typename Typelist_Chain>
+ struct append_<chain<Hd, Tl>, Typelist_Chain>
+ {
+ private:
+ typedef append_<Tl, Typelist_Chain> append_type;
+
+ public:
+ typedef chain<Hd, typename append_type::type> type;
+ };
+
+ template<typename Typelist_Chain>
+ struct append_<null_type, Typelist_Chain>
+ {
+ typedef Typelist_Chain type;
+ };
+
+ template<typename Typelist_Chain>
+ struct append_<Typelist_Chain, null_type>
+ {
+ typedef Typelist_Chain type;
+ };
+
+ template<>
+ struct append_<null_type, null_type>
+ {
+ typedef null_type type;
+ };
+
+ template<typename Typelist_Typelist_Chain>
+ struct append_typelist_;
+
+ template<typename Hd>
+ struct append_typelist_<chain<Hd, null_type> >
+ {
+ typedef chain<Hd, null_type> type;
+ };
+
+ template<typename Hd, typename Tl>
+ struct append_typelist_<chain< Hd, Tl> >
+ {
+ private:
+ typedef typename append_typelist_<Tl>::type rest_type;
+
+ public:
+ typedef typename append<Hd, node<rest_type> >::type::root type;
+ };
+
+ template<typename Typelist_Chain, typename T>
+ struct contains_;
+
+ template<typename T>
+ struct contains_<null_type, T>
+ {
+ enum
+ {
+ value = false
+ };
+ };
+
+ template<typename Hd, typename Tl, typename T>
+ struct contains_<chain<Hd, Tl>, T>
+ {
+ enum
+ {
+ value = contains_<Tl, T>::value
+ };
+ };
+
+ template<typename Tl, typename T>
+ struct contains_<chain<T, Tl>, T>
+ {
+ enum
+ {
+ value = true
+ };
+ };
+
+ template<typename Typelist_Chain, template<typename T> class Pred>
+ struct chain_filter_;
+
+ template<template<typename T> class Pred>
+ struct chain_filter_<null_type, Pred>
+ {
+ typedef null_type type;
+ };
+
+ template<typename Hd, typename Tl, template<typename T> class Pred>
+ struct chain_filter_<chain<Hd, Tl>, Pred>
+ {
+ private:
+ enum
+ {
+ include_hd = Pred<Hd>::value
+ };
+
+ typedef typename chain_filter_<Tl, Pred>::type rest_type;
+ typedef chain<Hd, rest_type> chain_type;
+
+ public:
+ typedef typename __conditional_type<include_hd, chain_type, rest_type>::__type type;
+ };
+
+ template<typename Typelist_Chain, int i>
+ struct chain_at_index_;
+
+ template<typename Hd, typename Tl>
+ struct chain_at_index_<chain<Hd, Tl>, 0>
+ {
+ typedef Hd type;
+ };
+
+ template<typename Hd, typename Tl, int i>
+ struct chain_at_index_<chain<Hd, Tl>, i>
+ {
+ typedef typename chain_at_index_<Tl, i - 1>::type type;
+ };
+
+ template<class Typelist_Chain, template<typename T> class Transform>
+ struct chain_transform_;
+
+ template<template<typename T> class Transform>
+ struct chain_transform_<null_type, Transform>
+ {
+ typedef null_type type;
+ };
+
+ template<class Hd, class Tl, template<typename T> class Transform>
+ struct chain_transform_<chain<Hd, Tl>, Transform>
+ {
+ private:
+ typedef typename chain_transform_<Tl, Transform>::type rest_type;
+ typedef typename Transform<Hd>::type transform_type;
+
+ public:
+ typedef chain<transform_type, rest_type> type;
+ };
+
+ template<typename Typelist_Typelist_Chain>
+ struct chain_flatten_;
+
+ template<typename Hd_Tl>
+ struct chain_flatten_<chain<Hd_Tl, null_type> >
+ {
+ typedef typename Hd_Tl::root type;
+ };
+
+ template<typename Hd_Typelist, class Tl_Typelist>
+ struct chain_flatten_<chain<Hd_Typelist, Tl_Typelist> >
+ {
+ private:
+ typedef typename chain_flatten_<Tl_Typelist>::type rest_type;
+ typedef append<Hd_Typelist, node<rest_type> > append_type;
+ public:
+ typedef typename append_type::type::root type;
+ };
+} // namespace detail
+} // namespace typelist
+
+_GLIBCXX_END_NAMESPACE
+
+#define _GLIBCXX_TYPELIST_CHAIN1(X0) __gnu_cxx::typelist::chain<X0, __gnu_cxx::typelist::null_type>
+#define _GLIBCXX_TYPELIST_CHAIN2(X0, X1) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN1(X1) >
+#define _GLIBCXX_TYPELIST_CHAIN3(X0, X1, X2) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN2(X1, X2) >
+#define _GLIBCXX_TYPELIST_CHAIN4(X0, X1, X2, X3) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN3(X1, X2, X3) >
+#define _GLIBCXX_TYPELIST_CHAIN5(X0, X1, X2, X3, X4) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN4(X1, X2, X3, X4) >
+#define _GLIBCXX_TYPELIST_CHAIN6(X0, X1, X2, X3, X4, X5) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN5(X1, X2, X3, X4, X5) >
+#define _GLIBCXX_TYPELIST_CHAIN7(X0, X1, X2, X3, X4, X5, X6) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN6(X1, X2, X3, X4, X5, X6) >
+#define _GLIBCXX_TYPELIST_CHAIN8(X0, X1, X2, X3, X4, X5, X6, X7) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN7(X1, X2, X3, X4, X5, X6, X7) >
+#define _GLIBCXX_TYPELIST_CHAIN9(X0, X1, X2, X3, X4, X5, X6, X7, X8) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN8(X1, X2, X3, X4, X5, X6, X7, X8) >
+#define _GLIBCXX_TYPELIST_CHAIN10(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN9(X1, X2, X3, X4, X5, X6, X7, X8, X9) >
+#define _GLIBCXX_TYPELIST_CHAIN11(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN10(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10) >
+#define _GLIBCXX_TYPELIST_CHAIN12(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN11(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11) >
+#define _GLIBCXX_TYPELIST_CHAIN13(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN12(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12) >
+#define _GLIBCXX_TYPELIST_CHAIN14(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN13(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13) >
+#define _GLIBCXX_TYPELIST_CHAIN15(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN14(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14) >
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+namespace typelist
+{
+ template<typename Fn, typename Typelist>
+ void
+ apply(Fn& fn, Typelist)
+ {
+ detail::apply_<Fn, typename Typelist::root> a;
+ a(fn);
+ }
+
+ template<typename Fn, typename Typelist>
+ void
+ apply_generator(Fn& fn, Typelist)
+ {
+ detail::apply_generator1_<Fn, typename Typelist::root> a;
+ a(fn);
+ }
+
+ template<typename Fn, typename TypelistT, typename TypelistV>
+ void
+ apply_generator(Fn& fn, TypelistT, TypelistV)
+ {
+ typedef typename TypelistT::root rootT;
+ typedef typename TypelistV::root rootV;
+ detail::apply_generator2_<Fn, rootT, rootV> a;
+ a(fn);
+ }
+
+ template<typename Typelist0, typename Typelist1>
+ struct append
+ {
+ private:
+ typedef typename Typelist0::root root0_type;
+ typedef typename Typelist1::root root1_type;
+ typedef detail::append_<root0_type, root1_type> append_type;
+
+ public:
+ typedef node<typename append_type::type> type;
+ };
+
+ template<typename Typelist_Typelist>
+ struct append_typelist
+ {
+ private:
+ typedef typename Typelist_Typelist::root root_type;
+ typedef detail::append_typelist_<root_type> append_type;
+
+ public:
+ typedef node<typename append_type::type> type;
+ };
+
+ template<typename Typelist, typename T>
+ struct contains
+ {
+ private:
+ typedef typename Typelist::root root_type;
+
+ public:
+ enum
+ {
+ value = detail::contains_<root_type, T>::value
+ };
+ };
+
+ template<typename Typelist, template<typename T> class Pred>
+ struct filter
+ {
+ private:
+ typedef typename Typelist::root root_type;
+ typedef detail::chain_filter_<root_type, Pred> filter_type;
+
+ public:
+ typedef node<typename filter_type::type> type;
+ };
+
+ template<typename Typelist, int i>
+ struct at_index
+ {
+ private:
+ typedef typename Typelist::root root_type;
+ typedef detail::chain_at_index_<root_type, i> index_type;
+
+ public:
+ typedef typename index_type::type type;
+ };
+
+ template<typename Typelist, template<typename T> class Transform>
+ struct transform
+ {
+ private:
+ typedef typename Typelist::root root_type;
+ typedef detail::chain_transform_<root_type, Transform> transform_type;
+
+ public:
+ typedef node<typename transform_type::type> type;
+ };
+
+ template<typename Typelist_Typelist>
+ struct flatten
+ {
+ private:
+ typedef typename Typelist_Typelist::root root_type;
+ typedef typename detail::chain_flatten_<root_type>::type flatten_type;
+
+ public:
+ typedef node<flatten_type> type;
+ };
+
+ template<typename Typelist>
+ struct from_first
+ {
+ private:
+ typedef typename at_index<Typelist, 0>::type first_type;
+
+ public:
+ typedef node<chain<first_type, null_type> > type;
+ };
+
+ template<typename T1>
+ struct create1
+ {
+ typedef node<_GLIBCXX_TYPELIST_CHAIN1(T1)> type;
+ };
+
+ template<typename T1, typename T2>
+ struct create2
+ {
+ typedef node<_GLIBCXX_TYPELIST_CHAIN2(T1,T2)> type;
+ };
+
+ template<typename T1, typename T2, typename T3>
+ struct create3
+ {
+ typedef node<_GLIBCXX_TYPELIST_CHAIN3(T1,T2,T3)> type;
+ };
+
+ template<typename T1, typename T2, typename T3, typename T4>
+ struct create4
+ {
+ typedef node<_GLIBCXX_TYPELIST_CHAIN4(T1,T2,T3,T4)> type;
+ };
+
+ template<typename T1, typename T2, typename T3,
+ typename T4, typename T5>
+ struct create5
+ {
+ typedef node<_GLIBCXX_TYPELIST_CHAIN5(T1,T2,T3,T4,T5)> type;
+ };
+
+ template<typename T1, typename T2, typename T3,
+ typename T4, typename T5, typename T6>
+ struct create6
+ {
+ typedef node<_GLIBCXX_TYPELIST_CHAIN6(T1,T2,T3,T4,T5,T6)> type;
+ };
+} // namespace typelist
+_GLIBCXX_END_NAMESPACE
+
+
+#endif
+
diff --git a/i686-linux/include/c++/4.4.3/ext/vstring.h b/i686-linux/include/c++/4.4.3/ext/vstring.h
new file mode 100644
index 0000000..6377ca5
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/vstring.h
@@ -0,0 +1,2598 @@
+// Versatile string -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ext/vstring.h
+ * This file is a GNU extension to the Standard C++ Library.
+ */
+
+#ifndef _VSTRING_H
+#define _VSTRING_H 1
+
+#pragma GCC system_header
+
+#include <initializer_list>
+#include <ext/vstring_util.h>
+#include <ext/rc_string_base.h>
+#include <ext/sso_string_base.h>
+
+#if __google_stl_debug_string && !defined(_GLIBCXX_DEBUG)
+# undef _GLIBCXX_DEBUG_ASSERT
+# undef _GLIBCXX_DEBUG_PEDASSERT
+// Perform additional checks (but only in this file).
+# define _GLIBCXX_DEBUG_ASSERT(_Condition) \
+ if (! (_Condition)) { \
+ char buf[512]; \
+ __builtin_snprintf(buf, sizeof(buf), \
+ "%s:%d: %s: Assertion '%s' failed.\n", \
+ __FILE__, __LINE__, __func__, # _Condition); \
+ std::__throw_runtime_error(buf); \
+ }
+# define _GLIBCXX_DEBUG_PEDASSERT(_Condition) _GLIBCXX_DEBUG_ASSERT(_Condition)
+#endif
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ /**
+ * @class __versa_string vstring.h
+ * @brief Managing sequences of characters and character-like objects.
+ */
+
+ // Template class __versa_string
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ class __versa_string
+ : private _Base<_CharT, _Traits, _Alloc>
+ {
+ typedef _Base<_CharT, _Traits, _Alloc> __vstring_base;
+ typedef typename __vstring_base::_CharT_alloc_type _CharT_alloc_type;
+
+ // Types:
+ public:
+ typedef _Traits traits_type;
+ typedef typename _Traits::char_type value_type;
+ typedef _Alloc allocator_type;
+ typedef typename _CharT_alloc_type::size_type size_type;
+ typedef typename _CharT_alloc_type::difference_type difference_type;
+ typedef typename _CharT_alloc_type::reference reference;
+ typedef typename _CharT_alloc_type::const_reference const_reference;
+ typedef typename _CharT_alloc_type::pointer pointer;
+ typedef typename _CharT_alloc_type::const_pointer const_pointer;
+ typedef __gnu_cxx::__normal_iterator<pointer, __versa_string> iterator;
+ typedef __gnu_cxx::__normal_iterator<const_pointer, __versa_string>
+ const_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+
+ // Data Member (public):
+ /// Value returned by various member functions when they fail.
+ static const size_type npos = static_cast<size_type>(-1);
+
+ private:
+ size_type
+ _M_check(size_type __pos, const char* __s) const
+ {
+ if (__pos > this->size())
+ std::__throw_out_of_range(__N(__s));
+ return __pos;
+ }
+
+ void
+ _M_check_length(size_type __n1, size_type __n2, const char* __s) const
+ {
+ if (this->max_size() - (this->size() - __n1) < __n2)
+ std::__throw_length_error(__N(__s));
+ }
+
+ // NB: _M_limit doesn't check for a bad __pos value.
+ size_type
+ _M_limit(size_type __pos, size_type __off) const
+ {
+ const bool __testoff = __off < this->size() - __pos;
+ return __testoff ? __off : this->size() - __pos;
+ }
+
+ // True if _Rep and source do not overlap.
+ bool
+ _M_disjunct(const _CharT* __s) const
+ {
+ return (std::less<const _CharT*>()(__s, this->_M_data())
+ || std::less<const _CharT*>()(this->_M_data()
+ + this->size(), __s));
+ }
+
+ // For the internal use we have functions similar to `begin'/`end'
+ // but they do not call _M_leak.
+ iterator
+ _M_ibegin() const
+ { return iterator(this->_M_data()); }
+
+ iterator
+ _M_iend() const
+ { return iterator(this->_M_data() + this->_M_length()); }
+
+ public:
+ // Construct/copy/destroy:
+ // NB: We overload ctors in some cases instead of using default
+ // arguments, per 17.4.4.4 para. 2 item 2.
+
+ /**
+ * @brief Default constructor creates an empty string.
+ */
+ __versa_string()
+ : __vstring_base() { }
+
+ /**
+ * @brief Construct an empty string using allocator @a a.
+ */
+ explicit
+ __versa_string(const _Alloc& __a)
+ : __vstring_base(__a) { }
+
+ // NB: per LWG issue 42, semantics different from IS:
+ /**
+ * @brief Construct string with copy of value of @a str.
+ * @param __str Source string.
+ */
+ __versa_string(const __versa_string& __str)
+ : __vstring_base(__str) { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief String move constructor.
+ * @param __str Source string.
+ *
+ * The newly-constructed %string contains the exact contents of
+ * @a str. The contents of @a str are a valid, but unspecified
+ * string.
+ */
+ __versa_string(__versa_string&& __str)
+ : __vstring_base(std::forward<__vstring_base>(__str)) { }
+
+ /**
+ * @brief Construct string from an initializer list.
+ * @param __l std::initializer_list of characters.
+ * @param __a Allocator to use (default is default allocator).
+ */
+ __versa_string(std::initializer_list<_CharT> __l,
+ const _Alloc& __a = _Alloc())
+ : __vstring_base(__l.begin(), __l.end(), __a) { }
+#endif
+
+ /**
+ * @brief Construct string as copy of a substring.
+ * @param __str Source string.
+ * @param __pos Index of first character to copy from.
+ * @param __n Number of characters to copy (default remainder).
+ */
+ __versa_string(const __versa_string& __str, size_type __pos,
+ size_type __n = npos)
+ : __vstring_base(__str._M_data()
+ + __str._M_check(__pos,
+ "__versa_string::__versa_string"),
+ __str._M_data() + __str._M_limit(__pos, __n)
+ + __pos, _Alloc()) { }
+
+ /**
+ * @brief Construct string as copy of a substring.
+ * @param __str Source string.
+ * @param __pos Index of first character to copy from.
+ * @param __n Number of characters to copy.
+ * @param __a Allocator to use.
+ */
+ __versa_string(const __versa_string& __str, size_type __pos,
+ size_type __n, const _Alloc& __a)
+ : __vstring_base(__str._M_data()
+ + __str._M_check(__pos,
+ "__versa_string::__versa_string"),
+ __str._M_data() + __str._M_limit(__pos, __n)
+ + __pos, __a) { }
+
+ /**
+ * @brief Construct string initialized by a character array.
+ * @param __s Source character array.
+ * @param __n Number of characters to copy.
+ * @param __a Allocator to use (default is default allocator).
+ *
+ * NB: @a __s must have at least @a __n characters, '\\0' has no special
+ * meaning.
+ */
+ __versa_string(const _CharT* __s, size_type __n,
+ const _Alloc& __a = _Alloc())
+ : __vstring_base(__s, __s + __n, __a) { }
+
+ /**
+ * @brief Construct string as copy of a C string.
+ * @param __s Source C string.
+ * @param __a Allocator to use (default is default allocator).
+ */
+ __versa_string(const _CharT* __s, const _Alloc& __a = _Alloc())
+ : __vstring_base(__s, __s ? __s + traits_type::length(__s) :
+ __s + npos, __a) { }
+
+ /**
+ * @brief Construct string as multiple characters.
+ * @param __n Number of characters.
+ * @param __c Character to use.
+ * @param __a Allocator to use (default is default allocator).
+ */
+ __versa_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc())
+ : __vstring_base(__n, __c, __a) { }
+
+ /**
+ * @brief Construct string as copy of a range.
+ * @param __beg Start of range.
+ * @param __end End of range.
+ * @param __a Allocator to use (default is default allocator).
+ */
+ template<class _InputIterator>
+ __versa_string(_InputIterator __beg, _InputIterator __end,
+ const _Alloc& __a = _Alloc())
+ : __vstring_base(__beg, __end, __a) { }
+
+ /**
+ * @brief Destroy the string instance.
+ */
+ ~__versa_string() { }
+
+ /**
+ * @brief Assign the value of @a str to this string.
+ * @param __str Source string.
+ */
+ __versa_string&
+ operator=(const __versa_string& __str)
+ { return this->assign(__str); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief String move assignment operator.
+ * @param __str Source string.
+ *
+ * The contents of @a __str are moved into this string (without
+ * copying). @a __str is a valid, but unspecified string.
+ */
+ __versa_string&
+ operator=(__versa_string&& __str)
+ {
+ if (this != &__str)
+ this->swap(__str);
+ return *this;
+ }
+
+ /**
+ * @brief Set value to string constructed from initializer list.
+ * @param __l std::initializer_list.
+ */
+ __versa_string&
+ operator=(std::initializer_list<_CharT> __l)
+ {
+ this->assign(__l.begin(), __l.end());
+ return *this;
+ }
+#endif
+
+ /**
+ * @brief Copy contents of @a __s into this string.
+ * @param __s Source null-terminated string.
+ */
+ __versa_string&
+ operator=(const _CharT* __s)
+ { return this->assign(__s); }
+
+ /**
+ * @brief Set value to string of length 1.
+ * @param __c Source character.
+ *
+ * Assigning to a character makes this string length 1 and
+ * (*this)[0] == @a __c.
+ */
+ __versa_string&
+ operator=(_CharT __c)
+ {
+ this->assign(1, __c);
+ return *this;
+ }
+
+ // Iterators:
+ /**
+ * Returns a read/write iterator that points to the first character in
+ * the %string. Unshares the string.
+ */
+ iterator
+ begin()
+ {
+ this->_M_leak();
+ return iterator(this->_M_data());
+ }
+
+ /**
+ * Returns a read-only (constant) iterator that points to the first
+ * character in the %string.
+ */
+ const_iterator
+ begin() const
+ { return const_iterator(this->_M_data()); }
+
+ /**
+ * Returns a read/write iterator that points one past the last
+ * character in the %string. Unshares the string.
+ */
+ iterator
+ end()
+ {
+ this->_M_leak();
+ return iterator(this->_M_data() + this->size());
+ }
+
+ /**
+ * Returns a read-only (constant) iterator that points one past the
+ * last character in the %string.
+ */
+ const_iterator
+ end() const
+ { return const_iterator(this->_M_data() + this->size()); }
+
+ /**
+ * Returns a read/write reverse iterator that points to the last
+ * character in the %string. Iteration is done in reverse element
+ * order. Unshares the string.
+ */
+ reverse_iterator
+ rbegin()
+ { return reverse_iterator(this->end()); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points
+ * to the last character in the %string. Iteration is done in
+ * reverse element order.
+ */
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(this->end()); }
+
+ /**
+ * Returns a read/write reverse iterator that points to one before the
+ * first character in the %string. Iteration is done in reverse
+ * element order. Unshares the string.
+ */
+ reverse_iterator
+ rend()
+ { return reverse_iterator(this->begin()); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points
+ * to one before the first character in the %string. Iteration
+ * is done in reverse element order.
+ */
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(this->begin()); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * Returns a read-only (constant) iterator that points to the first
+ * character in the %string.
+ */
+ const_iterator
+ cbegin() const
+ { return const_iterator(this->_M_data()); }
+
+ /**
+ * Returns a read-only (constant) iterator that points one past the
+ * last character in the %string.
+ */
+ const_iterator
+ cend() const
+ { return const_iterator(this->_M_data() + this->size()); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points
+ * to the last character in the %string. Iteration is done in
+ * reverse element order.
+ */
+ const_reverse_iterator
+ crbegin() const
+ { return const_reverse_iterator(this->end()); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points
+ * to one before the first character in the %string. Iteration
+ * is done in reverse element order.
+ */
+ const_reverse_iterator
+ crend() const
+ { return const_reverse_iterator(this->begin()); }
+#endif
+
+ public:
+ // Capacity:
+ /// Returns the number of characters in the string, not including any
+ /// null-termination.
+ size_type
+ size() const
+ { return this->_M_length(); }
+
+ /// Returns the number of characters in the string, not including any
+ /// null-termination.
+ size_type
+ length() const
+ { return this->_M_length(); }
+
+ /// Returns the size() of the largest possible %string.
+ size_type
+ max_size() const
+ { return this->_M_max_size(); }
+
+ /**
+ * @brief Resizes the %string to the specified number of characters.
+ * @param __n Number of characters the %string should contain.
+ * @param __c Character to fill any new elements.
+ *
+ * This function will %resize the %string to the specified
+ * number of characters. If the number is smaller than the
+ * %string's current size the %string is truncated, otherwise
+ * the %string is extended and new elements are set to @a __c.
+ */
+ void
+ resize(size_type __n, _CharT __c);
+
+ /**
+ * @brief Resizes the %string to the specified number of characters.
+ * @param __n Number of characters the %string should contain.
+ *
+ * This function will resize the %string to the specified
+ * length. If the new size is smaller than the %string's
+ * current size the %string is truncated, otherwise the %string
+ * is extended and new characters are default-constructed. For
+ * basic types such as char, this means setting them to 0.
+ */
+ void
+ resize(size_type __n)
+ { this->resize(__n, _CharT()); }
+
+ /**
+ * Returns the total number of characters that the %string can
+ * hold before needing to allocate more memory.
+ */
+ size_type
+ capacity() const
+ { return this->_M_capacity(); }
+
+ /**
+ * @brief Attempt to preallocate enough memory for specified number of
+ * characters.
+ * @param __res_arg Number of characters required.
+ * @throw std::length_error If @a __res_arg exceeds @c max_size().
+ *
+ * This function attempts to reserve enough memory for the
+ * %string to hold the specified number of characters. If the
+ * number requested is more than max_size(), length_error is
+ * thrown.
+ *
+ * The advantage of this function is that if optimal code is a
+ * necessity and the user can determine the string length that
+ * will be required, the user can reserve the memory in
+ * %advance, and thus prevent a possible reallocation of memory
+ * and copying of %string data.
+ */
+ void
+ reserve(size_type __res_arg = 0)
+ { this->_M_reserve(__res_arg); }
+
+ /**
+ * Erases the string, making it empty.
+ */
+ void
+ clear()
+ { this->_M_clear(); }
+
+ /**
+ * Returns true if the %string is empty. Equivalent to *this == "".
+ */
+ bool
+ empty() const
+ { return this->size() == 0; }
+
+ // Element access:
+ /**
+ * @brief Subscript access to the data contained in the %string.
+ * @param __pos The index of the character to access.
+ * @return Read-only (constant) reference to the character.
+ *
+ * This operator allows for easy, array-style, data access.
+ * Note that data access with this operator is unchecked and
+ * out_of_range lookups are not defined. (For checked lookups
+ * see at().)
+ */
+ const_reference
+ operator[] (size_type __pos) const
+ {
+ _GLIBCXX_DEBUG_ASSERT(__pos <= this->size());
+ return this->_M_data()[__pos];
+ }
+
+ /**
+ * @brief Subscript access to the data contained in the %string.
+ * @param __pos The index of the character to access.
+ * @return Read/write reference to the character.
+ *
+ * This operator allows for easy, array-style, data access.
+ * Note that data access with this operator is unchecked and
+ * out_of_range lookups are not defined. (For checked lookups
+ * see at().) Unshares the string.
+ */
+ reference
+ operator[](size_type __pos)
+ {
+ // allow pos == size() as v3 extension:
+ _GLIBCXX_DEBUG_ASSERT(__pos <= this->size());
+ // but be strict in pedantic mode:
+ _GLIBCXX_DEBUG_PEDASSERT(__pos < this->size());
+ this->_M_leak();
+ return this->_M_data()[__pos];
+ }
+
+ /**
+ * @brief Provides access to the data contained in the %string.
+ * @param __n The index of the character to access.
+ * @return Read-only (const) reference to the character.
+ * @throw std::out_of_range If @a __n is an invalid index.
+ *
+ * This function provides for safer data access. The parameter
+ * is first checked that it is in the range of the string. The
+ * function throws out_of_range if the check fails.
+ */
+ const_reference
+ at(size_type __n) const
+ {
+ if (__n >= this->size())
+ std::__throw_out_of_range(__N("__versa_string::at"));
+ return this->_M_data()[__n];
+ }
+
+ /**
+ * @brief Provides access to the data contained in the %string.
+ * @param __n The index of the character to access.
+ * @return Read/write reference to the character.
+ * @throw std::out_of_range If @a __n is an invalid index.
+ *
+ * This function provides for safer data access. The parameter
+ * is first checked that it is in the range of the string. The
+ * function throws out_of_range if the check fails. Success
+ * results in unsharing the string.
+ */
+ reference
+ at(size_type __n)
+ {
+ if (__n >= this->size())
+ std::__throw_out_of_range(__N("__versa_string::at"));
+ this->_M_leak();
+ return this->_M_data()[__n];
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * Returns a read/write reference to the data at the first
+ * element of the %string.
+ */
+ reference
+ front()
+ { return *begin(); }
+
+ /**
+ * Returns a read-only (constant) reference to the data at the first
+ * element of the %string.
+ */
+ const_reference
+ front() const
+ { return *begin(); }
+
+ /**
+ * Returns a read/write reference to the data at the last
+ * element of the %string.
+ */
+ reference
+ back()
+ { return *(end() - 1); }
+
+ /**
+ * Returns a read-only (constant) reference to the data at the
+ * last element of the %string.
+ */
+ const_reference
+ back() const
+ { return *(end() - 1); }
+#endif
+
+ // Modifiers:
+ /**
+ * @brief Append a string to this string.
+ * @param __str The string to append.
+ * @return Reference to this string.
+ */
+ __versa_string&
+ operator+=(const __versa_string& __str)
+ { return this->append(__str); }
+
+ /**
+ * @brief Append a C string.
+ * @param __s The C string to append.
+ * @return Reference to this string.
+ */
+ __versa_string&
+ operator+=(const _CharT* __s)
+ { return this->append(__s); }
+
+ /**
+ * @brief Append a character.
+ * @param __c The character to append.
+ * @return Reference to this string.
+ */
+ __versa_string&
+ operator+=(_CharT __c)
+ {
+ this->push_back(__c);
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Append an initializer_list of characters.
+ * @param __l The initializer_list of characters to be appended.
+ * @return Reference to this string.
+ */
+ __versa_string&
+ operator+=(std::initializer_list<_CharT> __l)
+ { return this->append(__l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+ /**
+ * @brief Append a string to this string.
+ * @param __str The string to append.
+ * @return Reference to this string.
+ */
+ __versa_string&
+ append(const __versa_string& __str)
+ { return _M_append(__str._M_data(), __str.size()); }
+
+ /**
+ * @brief Append a substring.
+ * @param __str The string to append.
+ * @param __pos Index of the first character of str to append.
+ * @param __n The number of characters to append.
+ * @return Reference to this string.
+ * @throw std::out_of_range if @a pos is not a valid index.
+ *
+ * This function appends @a __n characters from @a __str
+ * starting at @a __pos to this string. If @a __n is is larger
+ * than the number of available characters in @a __str, the
+ * remainder of @a __str is appended.
+ */
+ __versa_string&
+ append(const __versa_string& __str, size_type __pos, size_type __n)
+ { return _M_append(__str._M_data()
+ + __str._M_check(__pos, "__versa_string::append"),
+ __str._M_limit(__pos, __n)); }
+
+ /**
+ * @brief Append a C substring.
+ * @param __s The C string to append.
+ * @param __n The number of characters to append.
+ * @return Reference to this string.
+ */
+ __versa_string&
+ append(const _CharT* __s, size_type __n)
+ {
+ __glibcxx_requires_string_len(__s, __n);
+ _M_check_length(size_type(0), __n, "__versa_string::append");
+ return _M_append(__s, __n);
+ }
+
+ /**
+ * @brief Append a C string.
+ * @param __s The C string to append.
+ * @return Reference to this string.
+ */
+ __versa_string&
+ append(const _CharT* __s)
+ {
+ __glibcxx_requires_string(__s);
+ const size_type __n = traits_type::length(__s);
+ _M_check_length(size_type(0), __n, "__versa_string::append");
+ return _M_append(__s, __n);
+ }
+
+ /**
+ * @brief Append multiple characters.
+ * @param __n The number of characters to append.
+ * @param __c The character to use.
+ * @return Reference to this string.
+ *
+ * Appends n copies of c to this string.
+ */
+ __versa_string&
+ append(size_type __n, _CharT __c)
+ { return _M_replace_aux(this->size(), size_type(0), __n, __c); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Append an initializer_list of characters.
+ * @param __l The initializer_list of characters to append.
+ * @return Reference to this string.
+ */
+ __versa_string&
+ append(std::initializer_list<_CharT> __l)
+ { return this->append(__l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+ /**
+ * @brief Append a range of characters.
+ * @param __first Iterator referencing the first character to append.
+ * @param __last Iterator marking the end of the range.
+ * @return Reference to this string.
+ *
+ * Appends characters in the range [first,last) to this string.
+ */
+ template<class _InputIterator>
+ __versa_string&
+ append(_InputIterator __first, _InputIterator __last)
+ { return this->replace(_M_iend(), _M_iend(), __first, __last); }
+
+ /**
+ * @brief Append a single character.
+ * @param __c Character to append.
+ */
+ void
+ push_back(_CharT __c)
+ {
+ const size_type __size = this->size();
+ if (__size + 1 > this->capacity() || this->_M_is_shared())
+ this->_M_mutate(__size, size_type(0), 0, size_type(1));
+ traits_type::assign(this->_M_data()[__size], __c);
+ this->_M_set_length(__size + 1);
+ }
+
+ /**
+ * @brief Set value to contents of another string.
+ * @param __str Source string to use.
+ * @return Reference to this string.
+ */
+ __versa_string&
+ assign(const __versa_string& __str)
+ {
+ this->_M_assign(__str);
+ return *this;
+ }
+
+ /**
+ * @brief Set value to a substring of a string.
+ * @param __str The string to use.
+ * @param __pos Index of the first character of str.
+ * @param __n Number of characters to use.
+ * @return Reference to this string.
+ * @throw std::out_of_range if @a __pos is not a valid index.
+ *
+ * This function sets this string to the substring of @a __str
+ * consisting of @a __n characters at @a __pos. If @a __n is
+ * is larger than the number of available characters in @a
+ * __str, the remainder of @a __str is used.
+ */
+ __versa_string&
+ assign(const __versa_string& __str, size_type __pos, size_type __n)
+ { return _M_replace(size_type(0), this->size(), __str._M_data()
+ + __str._M_check(__pos, "__versa_string::assign"),
+ __str._M_limit(__pos, __n)); }
+
+ /**
+ * @brief Set value to a C substring.
+ * @param __s The C string to use.
+ * @param __n Number of characters to use.
+ * @return Reference to this string.
+ *
+ * This function sets the value of this string to the first @a
+ * __n characters of @a __s. If @a __n is is larger than the
+ * number of available characters in @a __s, the remainder of
+ * @a __s is used.
+ */
+ __versa_string&
+ assign(const _CharT* __s, size_type __n)
+ {
+ __glibcxx_requires_string_len(__s, __n);
+ return _M_replace(size_type(0), this->size(), __s, __n);
+ }
+
+ /**
+ * @brief Set value to contents of a C string.
+ * @param __s The C string to use.
+ * @return Reference to this string.
+ *
+ * This function sets the value of this string to the value of
+ * @a __s. The data is copied, so there is no dependence on @a
+ * __s once the function returns.
+ */
+ __versa_string&
+ assign(const _CharT* __s)
+ {
+ __glibcxx_requires_string(__s);
+ return _M_replace(size_type(0), this->size(), __s,
+ traits_type::length(__s));
+ }
+
+ /**
+ * @brief Set value to multiple characters.
+ * @param __n Length of the resulting string.
+ * @param __c The character to use.
+ * @return Reference to this string.
+ *
+ * This function sets the value of this string to @a __n copies of
+ * character @a __c.
+ */
+ __versa_string&
+ assign(size_type __n, _CharT __c)
+ { return _M_replace_aux(size_type(0), this->size(), __n, __c); }
+
+ /**
+ * @brief Set value to a range of characters.
+ * @param __first Iterator referencing the first character to append.
+ * @param __last Iterator marking the end of the range.
+ * @return Reference to this string.
+ *
+ * Sets value of string to characters in the range
+ * [first,last).
+ */
+ template<class _InputIterator>
+ __versa_string&
+ assign(_InputIterator __first, _InputIterator __last)
+ { return this->replace(_M_ibegin(), _M_iend(), __first, __last); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Set value to an initializer_list of characters.
+ * @param __l The initializer_list of characters to assign.
+ * @return Reference to this string.
+ */
+ __versa_string&
+ assign(std::initializer_list<_CharT> __l)
+ { return this->assign(__l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+ /**
+ * @brief Insert multiple characters.
+ * @param __p Iterator referencing location in string to insert at.
+ * @param __n Number of characters to insert
+ * @param __c The character to insert.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Inserts @a __n copies of character @a __c starting at the
+ * position referenced by iterator @a __p. If adding
+ * characters causes the length to exceed max_size(),
+ * length_error is thrown. The value of the string doesn't
+ * change if an error is thrown.
+ */
+ void
+ insert(iterator __p, size_type __n, _CharT __c)
+ { this->replace(__p, __p, __n, __c); }
+
+ /**
+ * @brief Insert a range of characters.
+ * @param __p Iterator referencing location in string to insert at.
+ * @param __beg Start of range.
+ * @param __end End of range.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Inserts characters in range [beg,end). If adding characters
+ * causes the length to exceed max_size(), length_error is
+ * thrown. The value of the string doesn't change if an error
+ * is thrown.
+ */
+ template<class _InputIterator>
+ void
+ insert(iterator __p, _InputIterator __beg, _InputIterator __end)
+ { this->replace(__p, __p, __beg, __end); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Insert an initializer_list of characters.
+ * @param __p Iterator referencing location in string to insert at.
+ * @param __l The initializer_list of characters to insert.
+ * @throw std::length_error If new length exceeds @c max_size().
+ */
+ void
+ insert(iterator __p, std::initializer_list<_CharT> __l)
+ { this->insert(__p, __l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+ /**
+ * @brief Insert value of a string.
+ * @param __pos1 Iterator referencing location in string to insert at.
+ * @param __str The string to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Inserts value of @a __str starting at @a __pos1. If adding
+ * characters causes the length to exceed max_size(),
+ * length_error is thrown. The value of the string doesn't
+ * change if an error is thrown.
+ */
+ __versa_string&
+ insert(size_type __pos1, const __versa_string& __str)
+ { return this->replace(__pos1, size_type(0),
+ __str._M_data(), __str.size()); }
+
+ /**
+ * @brief Insert a substring.
+ * @param __pos1 Iterator referencing location in string to insert at.
+ * @param __str The string to insert.
+ * @param __pos2 Start of characters in str to insert.
+ * @param __n Number of characters to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ * @throw std::out_of_range If @a __pos1 > size() or
+ * @a __pos2 > @a __str.size().
+ *
+ * Starting at @a __pos1, insert @a __n character of @a __str
+ * beginning with @a __pos2. If adding characters causes the
+ * length to exceed max_size(), length_error is thrown. If @a
+ * __pos1 is beyond the end of this string or @a __pos2 is
+ * beyond the end of @a __str, out_of_range is thrown. The
+ * value of the string doesn't change if an error is thrown.
+ */
+ __versa_string&
+ insert(size_type __pos1, const __versa_string& __str,
+ size_type __pos2, size_type __n)
+ { return this->replace(__pos1, size_type(0), __str._M_data()
+ + __str._M_check(__pos2, "__versa_string::insert"),
+ __str._M_limit(__pos2, __n)); }
+
+ /**
+ * @brief Insert a C substring.
+ * @param __pos Iterator referencing location in string to insert at.
+ * @param __s The C string to insert.
+ * @param __n The number of characters to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ * @throw std::out_of_range If @a __pos is beyond the end of this
+ * string.
+ *
+ * Inserts the first @a __n characters of @a __s starting at @a
+ * __pos. If adding characters causes the length to exceed
+ * max_size(), length_error is thrown. If @a __pos is beyond
+ * end(), out_of_range is thrown. The value of the string
+ * doesn't change if an error is thrown.
+ */
+ __versa_string&
+ insert(size_type __pos, const _CharT* __s, size_type __n)
+ { return this->replace(__pos, size_type(0), __s, __n); }
+
+ /**
+ * @brief Insert a C string.
+ * @param __pos Iterator referencing location in string to insert at.
+ * @param __s The C string to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ * @throw std::out_of_range If @a __pos is beyond the end of this
+ * string.
+ *
+ * Inserts the first @a __n characters of @a __s starting at @a
+ * __pos. If adding characters causes the length to exceed
+ * max_size(), length_error is thrown. If @a __pos is beyond
+ * end(), out_of_range is thrown. The value of the string
+ * doesn't change if an error is thrown.
+ */
+ __versa_string&
+ insert(size_type __pos, const _CharT* __s)
+ {
+ __glibcxx_requires_string(__s);
+ return this->replace(__pos, size_type(0), __s,
+ traits_type::length(__s));
+ }
+
+ /**
+ * @brief Insert multiple characters.
+ * @param __pos Index in string to insert at.
+ * @param __n Number of characters to insert
+ * @param __c The character to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ * @throw std::out_of_range If @a __pos is beyond the end of this
+ * string.
+ *
+ * Inserts @a __n copies of character @a __c starting at index
+ * @a __pos. If adding characters causes the length to exceed
+ * max_size(), length_error is thrown. If @a __pos > length(),
+ * out_of_range is thrown. The value of the string doesn't
+ * change if an error is thrown.
+ */
+ __versa_string&
+ insert(size_type __pos, size_type __n, _CharT __c)
+ { return _M_replace_aux(_M_check(__pos, "__versa_string::insert"),
+ size_type(0), __n, __c); }
+
+ /**
+ * @brief Insert one character.
+ * @param __p Iterator referencing position in string to insert at.
+ * @param __c The character to insert.
+ * @return Iterator referencing newly inserted char.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Inserts character @a __c at position referenced by @a __p.
+ * If adding character causes the length to exceed max_size(),
+ * length_error is thrown. If @a __p is beyond end of string,
+ * out_of_range is thrown. The value of the string doesn't
+ * change if an error is thrown.
+ */
+ iterator
+ insert(iterator __p, _CharT __c)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(__p >= _M_ibegin() && __p <= _M_iend());
+ const size_type __pos = __p - _M_ibegin();
+ _M_replace_aux(__pos, size_type(0), size_type(1), __c);
+ this->_M_set_leaked();
+ return iterator(this->_M_data() + __pos);
+ }
+
+ /**
+ * @brief Remove characters.
+ * @param __pos Index of first character to remove (default 0).
+ * @param __n Number of characters to remove (default remainder).
+ * @return Reference to this string.
+ * @throw std::out_of_range If @a __pos is beyond the end of this
+ * string.
+ *
+ * Removes @a __n characters from this string starting at @a
+ * __pos. The length of the string is reduced by @a __n. If
+ * there are < @a __n characters to remove, the remainder of
+ * the string is truncated. If @a __p is beyond end of string,
+ * out_of_range is thrown. The value of the string doesn't
+ * change if an error is thrown.
+ */
+ __versa_string&
+ erase(size_type __pos = 0, size_type __n = npos)
+ {
+ this->_M_erase(_M_check(__pos, "__versa_string::erase"),
+ _M_limit(__pos, __n));
+ return *this;
+ }
+
+ /**
+ * @brief Remove one character.
+ * @param __position Iterator referencing the character to remove.
+ * @return iterator referencing same location after removal.
+ *
+ * Removes the character at @a __position from this string. The
+ * value of the string doesn't change if an error is thrown.
+ */
+ iterator
+ erase(iterator __position)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(__position >= _M_ibegin()
+ && __position < _M_iend());
+ const size_type __pos = __position - _M_ibegin();
+ this->_M_erase(__pos, size_type(1));
+ this->_M_set_leaked();
+ return iterator(this->_M_data() + __pos);
+ }
+
+ /**
+ * @brief Remove a range of characters.
+ * @param __first Iterator referencing the first character to remove.
+ * @param __last Iterator referencing the end of the range.
+ * @return Iterator referencing location of first after removal.
+ *
+ * Removes the characters in the range [first,last) from this
+ * string. The value of the string doesn't change if an error
+ * is thrown.
+ */
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(__first >= _M_ibegin() && __first <= __last
+ && __last <= _M_iend());
+ const size_type __pos = __first - _M_ibegin();
+ this->_M_erase(__pos, __last - __first);
+ this->_M_set_leaked();
+ return iterator(this->_M_data() + __pos);
+ }
+
+ /**
+ * @brief Replace characters with value from another string.
+ * @param __pos Index of first character to replace.
+ * @param __n Number of characters to be replaced.
+ * @param __str String to insert.
+ * @return Reference to this string.
+ * @throw std::out_of_range If @a __pos is beyond the end of this
+ * string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [pos,pos+n) from this
+ * string. In place, the value of @a __str is inserted. If @a
+ * __pos is beyond end of string, out_of_range is thrown. If
+ * the length of the result exceeds max_size(), length_error is
+ * thrown. The value of the string doesn't change if an error
+ * is thrown.
+ */
+ __versa_string&
+ replace(size_type __pos, size_type __n, const __versa_string& __str)
+ { return this->replace(__pos, __n, __str._M_data(), __str.size()); }
+
+ /**
+ * @brief Replace characters with value from another string.
+ * @param __pos1 Index of first character to replace.
+ * @param __n1 Number of characters to be replaced.
+ * @param __str String to insert.
+ * @param __pos2 Index of first character of str to use.
+ * @param __n2 Number of characters from str to use.
+ * @return Reference to this string.
+ * @throw std::out_of_range If @a __pos1 > size() or @a __pos2 >
+ * str.size().
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [pos1,pos1 + n) from
+ * this string. In place, the value of @a __str is inserted.
+ * If @a __pos is beyond end of string, out_of_range is thrown.
+ * If the length of the result exceeds max_size(), length_error
+ * is thrown. The value of the string doesn't change if an
+ * error is thrown.
+ */
+ __versa_string&
+ replace(size_type __pos1, size_type __n1, const __versa_string& __str,
+ size_type __pos2, size_type __n2)
+ {
+ return this->replace(__pos1, __n1, __str._M_data()
+ + __str._M_check(__pos2,
+ "__versa_string::replace"),
+ __str._M_limit(__pos2, __n2));
+ }
+
+ /**
+ * @brief Replace characters with value of a C substring.
+ * @param __pos Index of first character to replace.
+ * @param __n1 Number of characters to be replaced.
+ * @param __s C string to insert.
+ * @param __n2 Number of characters from @a __s to use.
+ * @return Reference to this string.
+ * @throw std::out_of_range If @a __pos1 > size().
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [pos,pos + n1) from this
+ * string. In place, the first @a __n2 characters of @a __s
+ * are inserted, or all of @a __s if @a __n2 is too large. If
+ * @a __pos is beyond end of string, out_of_range is thrown.
+ * If the length of result exceeds max_size(), length_error is
+ * thrown. The value of the string doesn't change if an error
+ * is thrown.
+ */
+ __versa_string&
+ replace(size_type __pos, size_type __n1, const _CharT* __s,
+ size_type __n2)
+ {
+ __glibcxx_requires_string_len(__s, __n2);
+ return _M_replace(_M_check(__pos, "__versa_string::replace"),
+ _M_limit(__pos, __n1), __s, __n2);
+ }
+
+ /**
+ * @brief Replace characters with value of a C string.
+ * @param __pos Index of first character to replace.
+ * @param __n1 Number of characters to be replaced.
+ * @param __s C string to insert.
+ * @return Reference to this string.
+ * @throw std::out_of_range If @a __pos > size().
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [pos,pos + n1) from this
+ * string. In place, the first @a __n characters of @a __s are
+ * inserted. If @a pos is beyond end of string, out_of_range
+ * is thrown. If the length of result exceeds max_size(),
+ * length_error is thrown. The value of the string doesn't
+ * change if an error is thrown.
+ */
+ __versa_string&
+ replace(size_type __pos, size_type __n1, const _CharT* __s)
+ {
+ __glibcxx_requires_string(__s);
+ return this->replace(__pos, __n1, __s, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Replace characters with multiple characters.
+ * @param __pos Index of first character to replace.
+ * @param __n1 Number of characters to be replaced.
+ * @param __n2 Number of characters to insert.
+ * @param __c Character to insert.
+ * @return Reference to this string.
+ * @throw std::out_of_range If @a __pos > size().
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [pos,pos + n1) from this
+ * string. In place, @a __n2 copies of @a __c are inserted.
+ * If @a __pos is beyond end of string, out_of_range is thrown.
+ * If the length of result exceeds max_size(), length_error is
+ * thrown. The value of the string doesn't change if an error
+ * is thrown.
+ */
+ __versa_string&
+ replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c)
+ { return _M_replace_aux(_M_check(__pos, "__versa_string::replace"),
+ _M_limit(__pos, __n1), __n2, __c); }
+
+ /**
+ * @brief Replace range of characters with string.
+ * @param __i1 Iterator referencing start of range to replace.
+ * @param __i2 Iterator referencing end of range to replace.
+ * @param __str String value to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [i1,i2). In place, the
+ * value of @a __str is inserted. If the length of result
+ * exceeds max_size(), length_error is thrown. The value of
+ * the string doesn't change if an error is thrown.
+ */
+ __versa_string&
+ replace(iterator __i1, iterator __i2, const __versa_string& __str)
+ { return this->replace(__i1, __i2, __str._M_data(), __str.size()); }
+
+ /**
+ * @brief Replace range of characters with C substring.
+ * @param __i1 Iterator referencing start of range to replace.
+ * @param __i2 Iterator referencing end of range to replace.
+ * @param __s C string value to insert.
+ * @param __n Number of characters from s to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [i1,i2). In place, the
+ * first @a n characters of @a __s are inserted. If the length
+ * of result exceeds max_size(), length_error is thrown. The
+ * value of the string doesn't change if an error is thrown.
+ */
+ __versa_string&
+ replace(iterator __i1, iterator __i2, const _CharT* __s, size_type __n)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+ && __i2 <= _M_iend());
+ return this->replace(__i1 - _M_ibegin(), __i2 - __i1, __s, __n);
+ }
+
+ /**
+ * @brief Replace range of characters with C string.
+ * @param __i1 Iterator referencing start of range to replace.
+ * @param __i2 Iterator referencing end of range to replace.
+ * @param __s C string value to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [i1,i2). In place, the
+ * characters of @a __s are inserted. If the length of result
+ * exceeds max_size(), length_error is thrown. The value of
+ * the string doesn't change if an error is thrown.
+ */
+ __versa_string&
+ replace(iterator __i1, iterator __i2, const _CharT* __s)
+ {
+ __glibcxx_requires_string(__s);
+ return this->replace(__i1, __i2, __s, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Replace range of characters with multiple characters
+ * @param __i1 Iterator referencing start of range to replace.
+ * @param __i2 Iterator referencing end of range to replace.
+ * @param __n Number of characters to insert.
+ * @param __c Character to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [i1,i2). In place, @a
+ * __n copies of @a __c are inserted. If the length of result
+ * exceeds max_size(), length_error is thrown. The value of
+ * the string doesn't change if an error is thrown.
+ */
+ __versa_string&
+ replace(iterator __i1, iterator __i2, size_type __n, _CharT __c)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+ && __i2 <= _M_iend());
+ return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __c);
+ }
+
+ /**
+ * @brief Replace range of characters with range.
+ * @param __i1 Iterator referencing start of range to replace.
+ * @param __i2 Iterator referencing end of range to replace.
+ * @param __k1 Iterator referencing start of range to insert.
+ * @param __k2 Iterator referencing end of range to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [i1,i2). In place,
+ * characters in the range [k1,k2) are inserted. If the length
+ * of result exceeds max_size(), length_error is thrown. The
+ * value of the string doesn't change if an error is thrown.
+ */
+ template<class _InputIterator>
+ __versa_string&
+ replace(iterator __i1, iterator __i2,
+ _InputIterator __k1, _InputIterator __k2)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+ && __i2 <= _M_iend());
+ __glibcxx_requires_valid_range(__k1, __k2);
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ return this->_M_replace_dispatch(__i1, __i2, __k1, __k2, _Integral());
+ }
+
+ // Specializations for the common case of pointer and iterator:
+ // useful to avoid the overhead of temporary buffering in _M_replace.
+ __versa_string&
+ replace(iterator __i1, iterator __i2, _CharT* __k1, _CharT* __k2)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+ && __i2 <= _M_iend());
+ __glibcxx_requires_valid_range(__k1, __k2);
+ return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
+ __k1, __k2 - __k1);
+ }
+
+ __versa_string&
+ replace(iterator __i1, iterator __i2,
+ const _CharT* __k1, const _CharT* __k2)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+ && __i2 <= _M_iend());
+ __glibcxx_requires_valid_range(__k1, __k2);
+ return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
+ __k1, __k2 - __k1);
+ }
+
+ __versa_string&
+ replace(iterator __i1, iterator __i2, iterator __k1, iterator __k2)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+ && __i2 <= _M_iend());
+ __glibcxx_requires_valid_range(__k1, __k2);
+ return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
+ __k1.base(), __k2 - __k1);
+ }
+
+ __versa_string&
+ replace(iterator __i1, iterator __i2,
+ const_iterator __k1, const_iterator __k2)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+ && __i2 <= _M_iend());
+ __glibcxx_requires_valid_range(__k1, __k2);
+ return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
+ __k1.base(), __k2 - __k1);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Replace range of characters with initializer_list.
+ * @param __i1 Iterator referencing start of range to replace.
+ * @param __i2 Iterator referencing end of range to replace.
+ * @param __l The initializer_list of characters to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [i1,i2). In place,
+ * characters in the range [k1,k2) are inserted. If the length
+ * of result exceeds max_size(), length_error is thrown. The
+ * value of the string doesn't change if an error is thrown.
+ */
+ __versa_string& replace(iterator __i1, iterator __i2,
+ std::initializer_list<_CharT> __l)
+ { return this->replace(__i1, __i2, __l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+ private:
+ template<class _Integer>
+ __versa_string&
+ _M_replace_dispatch(iterator __i1, iterator __i2, _Integer __n,
+ _Integer __val, std::__true_type)
+ { return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __val); }
+
+ template<class _InputIterator>
+ __versa_string&
+ _M_replace_dispatch(iterator __i1, iterator __i2, _InputIterator __k1,
+ _InputIterator __k2, std::__false_type);
+
+ __versa_string&
+ _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2,
+ _CharT __c);
+
+ __versa_string&
+ _M_replace(size_type __pos, size_type __len1, const _CharT* __s,
+ const size_type __len2);
+
+ __versa_string&
+ _M_append(const _CharT* __s, size_type __n);
+
+ public:
+
+ /**
+ * @brief Copy substring into C string.
+ * @param __s C string to copy value into.
+ * @param __n Number of characters to copy.
+ * @param __pos Index of first character to copy.
+ * @return Number of characters actually copied
+ * @throw std::out_of_range If pos > size().
+ *
+ * Copies up to @a __n characters starting at @a __pos into the
+ * C string @a s. If @a __pos is greater than size(),
+ * out_of_range is thrown.
+ */
+ size_type
+ copy(_CharT* __s, size_type __n, size_type __pos = 0) const;
+
+ /**
+ * @brief Swap contents with another string.
+ * @param __s String to swap with.
+ *
+ * Exchanges the contents of this string with that of @a __s in
+ * constant time.
+ */
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(__versa_string&& __s)
+#else
+ swap(__versa_string& __s)
+#endif
+ { this->_M_swap(__s); }
+
+ // String operations:
+ /**
+ * @brief Return const pointer to null-terminated contents.
+ *
+ * This is a handle to internal data. Do not modify or dire things may
+ * happen.
+ */
+ const _CharT*
+ c_str() const
+ { return this->_M_data(); }
+
+ /**
+ * @brief Return const pointer to contents.
+ *
+ * This is a handle to internal data. Do not modify or dire things may
+ * happen.
+ */
+ const _CharT*
+ data() const
+ { return this->_M_data(); }
+
+ /**
+ * @brief Return copy of allocator used to construct this string.
+ */
+ allocator_type
+ get_allocator() const
+ { return allocator_type(this->_M_get_allocator()); }
+
+ /**
+ * @brief Find position of a C substring.
+ * @param __s C string to locate.
+ * @param __pos Index of character to search from.
+ * @param __n Number of characters from @a __s to search for.
+ * @return Index of start of first occurrence.
+ *
+ * Starting from @a __pos, searches forward for the first @a
+ * __n characters in @a __s within this string. If found,
+ * returns the index where it begins. If not found, returns
+ * npos.
+ */
+ size_type
+ find(const _CharT* __s, size_type __pos, size_type __n) const;
+
+ /**
+ * @brief Find position of a string.
+ * @param __str String to locate.
+ * @param __pos Index of character to search from (default 0).
+ * @return Index of start of first occurrence.
+ *
+ * Starting from @a __pos, searches forward for value of @a
+ * __str within this string. If found, returns the index where
+ * it begins. If not found, returns npos.
+ */
+ size_type
+ find(const __versa_string& __str, size_type __pos = 0) const
+ { return this->find(__str.data(), __pos, __str.size()); }
+
+ /**
+ * @brief Find position of a C string.
+ * @param __s C string to locate.
+ * @param __pos Index of character to search from (default 0).
+ * @return Index of start of first occurrence.
+ *
+ * Starting from @a __pos, searches forward for the value of @a
+ * __s within this string. If found, returns the index where
+ * it begins. If not found, returns npos.
+ */
+ size_type
+ find(const _CharT* __s, size_type __pos = 0) const
+ {
+ __glibcxx_requires_string(__s);
+ return this->find(__s, __pos, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Find position of a character.
+ * @param __c Character to locate.
+ * @param __pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a __pos, searches forward for @a __c within
+ * this string. If found, returns the index where it was
+ * found. If not found, returns npos.
+ */
+ size_type
+ find(_CharT __c, size_type __pos = 0) const;
+
+ /**
+ * @brief Find last position of a string.
+ * @param __str String to locate.
+ * @param __pos Index of character to search back from (default end).
+ * @return Index of start of last occurrence.
+ *
+ * Starting from @a __pos, searches backward for value of @a
+ * __str within this string. If found, returns the index where
+ * it begins. If not found, returns npos.
+ */
+ size_type
+ rfind(const __versa_string& __str, size_type __pos = npos) const
+ { return this->rfind(__str.data(), __pos, __str.size()); }
+
+ /**
+ * @brief Find last position of a C substring.
+ * @param __s C string to locate.
+ * @param __pos Index of character to search back from.
+ * @param __n Number of characters from s to search for.
+ * @return Index of start of last occurrence.
+ *
+ * Starting from @a __pos, searches backward for the first @a
+ * __n characters in @a __s within this string. If found,
+ * returns the index where it begins. If not found, returns
+ * npos.
+ */
+ size_type
+ rfind(const _CharT* __s, size_type __pos, size_type __n) const;
+
+ /**
+ * @brief Find last position of a C string.
+ * @param __s C string to locate.
+ * @param __pos Index of character to start search at (default end).
+ * @return Index of start of last occurrence.
+ *
+ * Starting from @a __pos, searches backward for the value of
+ * @a __s within this string. If found, returns the index
+ * where it begins. If not found, returns npos.
+ */
+ size_type
+ rfind(const _CharT* __s, size_type __pos = npos) const
+ {
+ __glibcxx_requires_string(__s);
+ return this->rfind(__s, __pos, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Find last position of a character.
+ * @param __c Character to locate.
+ * @param __pos Index of character to search back from (default end).
+ * @return Index of last occurrence.
+ *
+ * Starting from @a __pos, searches backward for @a __c within
+ * this string. If found, returns the index where it was
+ * found. If not found, returns npos.
+ */
+ size_type
+ rfind(_CharT __c, size_type __pos = npos) const;
+
+ /**
+ * @brief Find position of a character of string.
+ * @param __str String containing characters to locate.
+ * @param __pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a __pos, searches forward for one of the characters of
+ * @a __str within this string. If found, returns the index where it was
+ * found. If not found, returns npos.
+ */
+ size_type
+ find_first_of(const __versa_string& __str, size_type __pos = 0) const
+ { return this->find_first_of(__str.data(), __pos, __str.size()); }
+
+ /**
+ * @brief Find position of a character of C substring.
+ * @param __s String containing characters to locate.
+ * @param __pos Index of character to search from.
+ * @param __n Number of characters from s to search for.
+ * @return Index of first occurrence.
+ *
+ * Starting from @a __pos, searches forward for one of the
+ * first @a __n characters of @a __s within this string. If
+ * found, returns the index where it was found. If not found,
+ * returns npos.
+ */
+ size_type
+ find_first_of(const _CharT* __s, size_type __pos, size_type __n) const;
+
+ /**
+ * @brief Find position of a character of C string.
+ * @param __s String containing characters to locate.
+ * @param __pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a __pos, searches forward for one of the
+ * characters of @a __s within this string. If found, returns
+ * the index where it was found. If not found, returns npos.
+ */
+ size_type
+ find_first_of(const _CharT* __s, size_type __pos = 0) const
+ {
+ __glibcxx_requires_string(__s);
+ return this->find_first_of(__s, __pos, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Find position of a character.
+ * @param __c Character to locate.
+ * @param __pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a __pos, searches forward for the character
+ * @a __c within this string. If found, returns the index
+ * where it was found. If not found, returns npos.
+ *
+ * Note: equivalent to find(c, pos).
+ */
+ size_type
+ find_first_of(_CharT __c, size_type __pos = 0) const
+ { return this->find(__c, __pos); }
+
+ /**
+ * @brief Find last position of a character of string.
+ * @param __str String containing characters to locate.
+ * @param __pos Index of character to search back from (default end).
+ * @return Index of last occurrence.
+ *
+ * Starting from @a __pos, searches backward for one of the
+ * characters of @a __str within this string. If found,
+ * returns the index where it was found. If not found, returns
+ * npos.
+ */
+ size_type
+ find_last_of(const __versa_string& __str, size_type __pos = npos) const
+ { return this->find_last_of(__str.data(), __pos, __str.size()); }
+
+ /**
+ * @brief Find last position of a character of C substring.
+ * @param __s C string containing characters to locate.
+ * @param __pos Index of character to search back from.
+ * @param __n Number of characters from s to search for.
+ * @return Index of last occurrence.
+ *
+ * Starting from @a __pos, searches backward for one of the
+ * first @a __n characters of @a __s within this string. If
+ * found, returns the index where it was found. If not found,
+ * returns npos.
+ */
+ size_type
+ find_last_of(const _CharT* __s, size_type __pos, size_type __n) const;
+
+ /**
+ * @brief Find last position of a character of C string.
+ * @param __s C string containing characters to locate.
+ * @param __pos Index of character to search back from (default end).
+ * @return Index of last occurrence.
+ *
+ * Starting from @a __pos, searches backward for one of the
+ * characters of @a __s within this string. If found, returns
+ * the index where it was found. If not found, returns npos.
+ */
+ size_type
+ find_last_of(const _CharT* __s, size_type __pos = npos) const
+ {
+ __glibcxx_requires_string(__s);
+ return this->find_last_of(__s, __pos, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Find last position of a character.
+ * @param __c Character to locate.
+ * @param __pos Index of character to search back from (default end).
+ * @return Index of last occurrence.
+ *
+ * Starting from @a __pos, searches backward for @a __c within
+ * this string. If found, returns the index where it was
+ * found. If not found, returns npos.
+ *
+ * Note: equivalent to rfind(c, pos).
+ */
+ size_type
+ find_last_of(_CharT __c, size_type __pos = npos) const
+ { return this->rfind(__c, __pos); }
+
+ /**
+ * @brief Find position of a character not in string.
+ * @param __str String containing characters to avoid.
+ * @param __pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a __pos, searches forward for a character not
+ * contained in @a __str within this string. If found, returns
+ * the index where it was found. If not found, returns npos.
+ */
+ size_type
+ find_first_not_of(const __versa_string& __str, size_type __pos = 0) const
+ { return this->find_first_not_of(__str.data(), __pos, __str.size()); }
+
+ /**
+ * @brief Find position of a character not in C substring.
+ * @param __s C string containing characters to avoid.
+ * @param __pos Index of character to search from.
+ * @param __n Number of characters from s to consider.
+ * @return Index of first occurrence.
+ *
+ * Starting from @a __pos, searches forward for a character not
+ * contained in the first @a __n characters of @a __s within
+ * this string. If found, returns the index where it was
+ * found. If not found, returns npos.
+ */
+ size_type
+ find_first_not_of(const _CharT* __s, size_type __pos,
+ size_type __n) const;
+
+ /**
+ * @brief Find position of a character not in C string.
+ * @param __s C string containing characters to avoid.
+ * @param __pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a __pos, searches forward for a character not
+ * contained in @a __s within this string. If found, returns
+ * the index where it was found. If not found, returns npos.
+ */
+ size_type
+ find_first_not_of(const _CharT* __s, size_type __pos = 0) const
+ {
+ __glibcxx_requires_string(__s);
+ return this->find_first_not_of(__s, __pos, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Find position of a different character.
+ * @param __c Character to avoid.
+ * @param __pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a __pos, searches forward for a character
+ * other than @a __c within this string. If found, returns the
+ * index where it was found. If not found, returns npos.
+ */
+ size_type
+ find_first_not_of(_CharT __c, size_type __pos = 0) const;
+
+ /**
+ * @brief Find last position of a character not in string.
+ * @param __str String containing characters to avoid.
+ * @param __pos Index of character to search back from (default end).
+ * @return Index of last occurrence.
+ *
+ * Starting from @a __pos, searches backward for a character
+ * not contained in @a __str within this string. If found,
+ * returns the index where it was found. If not found, returns
+ * npos.
+ */
+ size_type
+ find_last_not_of(const __versa_string& __str,
+ size_type __pos = npos) const
+ { return this->find_last_not_of(__str.data(), __pos, __str.size()); }
+
+ /**
+ * @brief Find last position of a character not in C substring.
+ * @param __s C string containing characters to avoid.
+ * @param __pos Index of character to search back from.
+ * @param __n Number of characters from s to consider.
+ * @return Index of last occurrence.
+ *
+ * Starting from @a __pos, searches backward for a character
+ * not contained in the first @a __n characters of @a __s
+ * within this string. If found, returns the index where it
+ * was found. If not found, returns npos.
+ */
+ size_type
+ find_last_not_of(const _CharT* __s, size_type __pos,
+ size_type __n) const;
+ /**
+ * @brief Find last position of a character not in C string.
+ * @param __s C string containing characters to avoid.
+ * @param __pos Index of character to search back from (default end).
+ * @return Index of last occurrence.
+ *
+ * Starting from @a __pos, searches backward for a character
+ * not contained in @a __s within this string. If found,
+ * returns the index where it was found. If not found, returns
+ * npos.
+ */
+ size_type
+ find_last_not_of(const _CharT* __s, size_type __pos = npos) const
+ {
+ __glibcxx_requires_string(__s);
+ return this->find_last_not_of(__s, __pos, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Find last position of a different character.
+ * @param __c Character to avoid.
+ * @param __pos Index of character to search back from (default end).
+ * @return Index of last occurrence.
+ *
+ * Starting from @a __pos, searches backward for a character
+ * other than @a __c within this string. If found, returns the
+ * index where it was found. If not found, returns npos.
+ */
+ size_type
+ find_last_not_of(_CharT __c, size_type __pos = npos) const;
+
+ /**
+ * @brief Get a substring.
+ * @param __pos Index of first character (default 0).
+ * @param __n Number of characters in substring (default remainder).
+ * @return The new string.
+ * @throw std::out_of_range If pos > size().
+ *
+ * Construct and return a new string using the @a __n
+ * characters starting at @a __pos. If the string is too
+ * short, use the remainder of the characters. If @a __pos is
+ * beyond the end of the string, out_of_range is thrown.
+ */
+ __versa_string
+ substr(size_type __pos = 0, size_type __n = npos) const
+ {
+ return __versa_string(*this, _M_check(__pos, "__versa_string::substr"),
+ __n);
+ }
+
+ /**
+ * @brief Compare to a string.
+ * @param __str String to compare against.
+ * @return Integer < 0, 0, or > 0.
+ *
+ * Returns an integer < 0 if this string is ordered before @a
+ * __str, 0 if their values are equivalent, or > 0 if this
+ * string is ordered after @a __str. Determines the effective
+ * length rlen of the strings to compare as the smallest of
+ * size() and str.size(). The function then compares the two
+ * strings by calling traits::compare(data(), str.data(),rlen).
+ * If the result of the comparison is nonzero returns it,
+ * otherwise the shorter one is ordered first.
+ */
+ int
+ compare(const __versa_string& __str) const
+ {
+ if (this->_M_compare(__str))
+ return 0;
+
+ const size_type __size = this->size();
+ const size_type __osize = __str.size();
+ const size_type __len = std::min(__size, __osize);
+
+ int __r = traits_type::compare(this->_M_data(), __str.data(), __len);
+ if (!__r)
+ __r = this->_S_compare(__size, __osize);
+ return __r;
+ }
+
+ /**
+ * @brief Compare substring to a string.
+ * @param __pos Index of first character of substring.
+ * @param __n Number of characters in substring.
+ * @param __str String to compare against.
+ * @return Integer < 0, 0, or > 0.
+ *
+ * Form the substring of this string from the @a __n characters
+ * starting at @a __pos. Returns an integer < 0 if the
+ * substring is ordered before @a __str, 0 if their values are
+ * equivalent, or > 0 if the substring is ordered after @a
+ * __str. Determines the effective length rlen of the strings
+ * to compare as the smallest of the length of the substring
+ * and @a __str.size(). The function then compares the two
+ * strings by calling
+ * traits::compare(substring.data(),str.data(),rlen). If the
+ * result of the comparison is nonzero returns it, otherwise
+ * the shorter one is ordered first.
+ */
+ int
+ compare(size_type __pos, size_type __n,
+ const __versa_string& __str) const;
+
+ /**
+ * @brief Compare substring to a substring.
+ * @param __pos1 Index of first character of substring.
+ * @param __n1 Number of characters in substring.
+ * @param __str String to compare against.
+ * @param __pos2 Index of first character of substring of str.
+ * @param __n2 Number of characters in substring of str.
+ * @return Integer < 0, 0, or > 0.
+ *
+ * Form the substring of this string from the @a __n1
+ * characters starting at @a __pos1. Form the substring of @a
+ * __str from the @a __n2 characters starting at @a __pos2.
+ * Returns an integer < 0 if this substring is ordered before
+ * the substring of @a __str, 0 if their values are equivalent,
+ * or > 0 if this substring is ordered after the substring of
+ * @a __str. Determines the effective length rlen of the
+ * strings to compare as the smallest of the lengths of the
+ * substrings. The function then compares the two strings by
+ * calling
+ * traits::compare(substring.data(),str.substr(pos2,n2).data(),rlen).
+ * If the result of the comparison is nonzero returns it,
+ * otherwise the shorter one is ordered first.
+ */
+ int
+ compare(size_type __pos1, size_type __n1, const __versa_string& __str,
+ size_type __pos2, size_type __n2) const;
+
+ /**
+ * @brief Compare to a C string.
+ * @param __s C string to compare against.
+ * @return Integer < 0, 0, or > 0.
+ *
+ * Returns an integer < 0 if this string is ordered before @a
+ * __s, 0 if their values are equivalent, or > 0 if this string
+ * is ordered after @a __s. Determines the effective length
+ * rlen of the strings to compare as the smallest of size() and
+ * the length of a string constructed from @a __s. The
+ * function then compares the two strings by calling
+ * traits::compare(data(),s,rlen). If the result of the
+ * comparison is nonzero returns it, otherwise the shorter one
+ * is ordered first.
+ */
+ int
+ compare(const _CharT* __s) const;
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 5 String::compare specification questionable
+ /**
+ * @brief Compare substring to a C string.
+ * @param __pos Index of first character of substring.
+ * @param __n1 Number of characters in substring.
+ * @param __s C string to compare against.
+ * @return Integer < 0, 0, or > 0.
+ *
+ * Form the substring of this string from the @a __n1
+ * characters starting at @a __pos. Returns an integer < 0 if
+ * the substring is ordered before @a __s, 0 if their values
+ * are equivalent, or > 0 if the substring is ordered after @a
+ * __s. Determines the effective length rlen of the strings to
+ * compare as the smallest of the length of the substring and
+ * the length of a string constructed from @a __s. The
+ * function then compares the two string by calling
+ * traits::compare(substring.data(),s,rlen). If the result of
+ * the comparison is nonzero returns it, otherwise the shorter
+ * one is ordered first.
+ */
+ int
+ compare(size_type __pos, size_type __n1, const _CharT* __s) const;
+
+ /**
+ * @brief Compare substring against a character array.
+ * @param __pos1 Index of first character of substring.
+ * @param __n1 Number of characters in substring.
+ * @param __s character array to compare against.
+ * @param __n2 Number of characters of s.
+ * @return Integer < 0, 0, or > 0.
+ *
+ * Form the substring of this string from the @a __n1
+ * characters starting at @a __pos1. Form a string from the
+ * first @a __n2 characters of @a __s. Returns an integer < 0
+ * if this substring is ordered before the string from @a __s,
+ * 0 if their values are equivalent, or > 0 if this substring
+ * is ordered after the string from @a __s. Determines the
+ * effective length rlen of the strings to compare as the
+ * smallest of the length of the substring and @a __n2. The
+ * function then compares the two strings by calling
+ * traits::compare(substring.data(),s,rlen). If the result of
+ * the comparison is nonzero returns it, otherwise the shorter
+ * one is ordered first.
+ *
+ * NB: s must have at least n2 characters, '\\0' has no special
+ * meaning.
+ */
+ int
+ compare(size_type __pos, size_type __n1, const _CharT* __s,
+ size_type __n2) const;
+ };
+
+ // operator+
+ /**
+ * @brief Concatenate two strings.
+ * @param __lhs First string.
+ * @param __rhs Last string.
+ * @return New string with value of @a __lhs followed by @a __rhs.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ __versa_string<_CharT, _Traits, _Alloc, _Base>
+ operator+(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs);
+
+ /**
+ * @brief Concatenate C string and string.
+ * @param __lhs First string.
+ * @param __rhs Last string.
+ * @return New string with value of @a __lhs followed by @a __rhs.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ __versa_string<_CharT, _Traits, _Alloc, _Base>
+ operator+(const _CharT* __lhs,
+ const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs);
+
+ /**
+ * @brief Concatenate character and string.
+ * @param __lhs First string.
+ * @param __rhs Last string.
+ * @return New string with @a __lhs followed by @a __rhs.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ __versa_string<_CharT, _Traits, _Alloc, _Base>
+ operator+(_CharT __lhs,
+ const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs);
+
+ /**
+ * @brief Concatenate string and C string.
+ * @param __lhs First string.
+ * @param __rhs Last string.
+ * @return New string with @a __lhs followed by @a __rhs.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ __versa_string<_CharT, _Traits, _Alloc, _Base>
+ operator+(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ const _CharT* __rhs);
+
+ /**
+ * @brief Concatenate string and character.
+ * @param __lhs First string.
+ * @param __rhs Last string.
+ * @return New string with @a __lhs followed by @a __rhs.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ __versa_string<_CharT, _Traits, _Alloc, _Base>
+ operator+(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ _CharT __rhs);
+
+ // operator ==
+ /**
+ * @brief Test equivalence of two strings.
+ * @param __lhs First string.
+ * @param __rhs Second string.
+ * @return True if @a __lhs.compare(@a __rhs) == 0. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline bool
+ operator==(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
+ { return __lhs.compare(__rhs) == 0; }
+
+ template<typename _CharT,
+ template <typename, typename, typename> class _Base>
+ inline typename __enable_if<std::__is_char<_CharT>::__value, bool>::__type
+ operator==(const __versa_string<_CharT, std::char_traits<_CharT>,
+ std::allocator<_CharT>, _Base>& __lhs,
+ const __versa_string<_CharT, std::char_traits<_CharT>,
+ std::allocator<_CharT>, _Base>& __rhs)
+ { return (__lhs.size() == __rhs.size()
+ && !std::char_traits<_CharT>::compare(__lhs.data(), __rhs.data(),
+ __lhs.size())); }
+
+ /**
+ * @brief Test equivalence of C string and string.
+ * @param __lhs C string.
+ * @param __rhs String.
+ * @return True if @a __rhs.compare(@a __lhs) == 0. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline bool
+ operator==(const _CharT* __lhs,
+ const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
+ { return __rhs.compare(__lhs) == 0; }
+
+ /**
+ * @brief Test equivalence of string and C string.
+ * @param __lhs String.
+ * @param __rhs C string.
+ * @return True if @a __lhs.compare(@a __rhs) == 0. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline bool
+ operator==(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ const _CharT* __rhs)
+ { return __lhs.compare(__rhs) == 0; }
+
+ // operator !=
+ /**
+ * @brief Test difference of two strings.
+ * @param __lhs First string.
+ * @param __rhs Second string.
+ * @return True if @a __lhs.compare(@a __rhs) != 0. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline bool
+ operator!=(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
+ { return !(__lhs == __rhs); }
+
+ /**
+ * @brief Test difference of C string and string.
+ * @param __lhs C string.
+ * @param __rhs String.
+ * @return True if @a __rhs.compare(@a __lhs) != 0. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline bool
+ operator!=(const _CharT* __lhs,
+ const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
+ { return !(__lhs == __rhs); }
+
+ /**
+ * @brief Test difference of string and C string.
+ * @param __lhs String.
+ * @param __rhs C string.
+ * @return True if @a __lhs.compare(@a __rhs) != 0. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline bool
+ operator!=(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ const _CharT* __rhs)
+ { return !(__lhs == __rhs); }
+
+ // operator <
+ /**
+ * @brief Test if string precedes string.
+ * @param __lhs First string.
+ * @param __rhs Second string.
+ * @return True if @a __lhs precedes @a __rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline bool
+ operator<(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
+ { return __lhs.compare(__rhs) < 0; }
+
+ /**
+ * @brief Test if string precedes C string.
+ * @param __lhs String.
+ * @param __rhs C string.
+ * @return True if @a __lhs precedes @a __rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline bool
+ operator<(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ const _CharT* __rhs)
+ { return __lhs.compare(__rhs) < 0; }
+
+ /**
+ * @brief Test if C string precedes string.
+ * @param __lhs C string.
+ * @param __rhs String.
+ * @return True if @a __lhs precedes @a __rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline bool
+ operator<(const _CharT* __lhs,
+ const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
+ { return __rhs.compare(__lhs) > 0; }
+
+ // operator >
+ /**
+ * @brief Test if string follows string.
+ * @param __lhs First string.
+ * @param __rhs Second string.
+ * @return True if @a __lhs follows @a __rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline bool
+ operator>(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
+ { return __lhs.compare(__rhs) > 0; }
+
+ /**
+ * @brief Test if string follows C string.
+ * @param __lhs String.
+ * @param __rhs C string.
+ * @return True if @a __lhs follows @a __rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline bool
+ operator>(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ const _CharT* __rhs)
+ { return __lhs.compare(__rhs) > 0; }
+
+ /**
+ * @brief Test if C string follows string.
+ * @param __lhs C string.
+ * @param __rhs String.
+ * @return True if @a __lhs follows @a __rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline bool
+ operator>(const _CharT* __lhs,
+ const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
+ { return __rhs.compare(__lhs) < 0; }
+
+ // operator <=
+ /**
+ * @brief Test if string doesn't follow string.
+ * @param __lhs First string.
+ * @param __rhs Second string.
+ * @return True if @a __lhs doesn't follow @a __rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline bool
+ operator<=(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
+ { return __lhs.compare(__rhs) <= 0; }
+
+ /**
+ * @brief Test if string doesn't follow C string.
+ * @param __lhs String.
+ * @param __rhs C string.
+ * @return True if @a __lhs doesn't follow @a __rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline bool
+ operator<=(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ const _CharT* __rhs)
+ { return __lhs.compare(__rhs) <= 0; }
+
+ /**
+ * @brief Test if C string doesn't follow string.
+ * @param __lhs C string.
+ * @param __rhs String.
+ * @return True if @a __lhs doesn't follow @a __rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline bool
+ operator<=(const _CharT* __lhs,
+ const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
+ { return __rhs.compare(__lhs) >= 0; }
+
+ // operator >=
+ /**
+ * @brief Test if string doesn't precede string.
+ * @param __lhs First string.
+ * @param __rhs Second string.
+ * @return True if @a __lhs doesn't precede @a __rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline bool
+ operator>=(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
+ { return __lhs.compare(__rhs) >= 0; }
+
+ /**
+ * @brief Test if string doesn't precede C string.
+ * @param __lhs String.
+ * @param __rhs C string.
+ * @return True if @a __lhs doesn't precede @a __rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline bool
+ operator>=(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ const _CharT* __rhs)
+ { return __lhs.compare(__rhs) >= 0; }
+
+ /**
+ * @brief Test if C string doesn't precede string.
+ * @param __lhs C string.
+ * @param __rhs String.
+ * @return True if @a __lhs doesn't precede @a __rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline bool
+ operator>=(const _CharT* __lhs,
+ const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
+ { return __rhs.compare(__lhs) <= 0; }
+
+ /**
+ * @brief Swap contents of two strings.
+ * @param __lhs First string.
+ * @param __rhs Second string.
+ *
+ * Exchanges the contents of @a __lhs and @a __rhs in constant time.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline void
+ swap(__versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
+ { __lhs.swap(__rhs); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline void
+ swap(__versa_string<_CharT, _Traits, _Alloc, _Base>&& __lhs,
+ __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
+ { __lhs.swap(__rhs); }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline void
+ swap(__versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ __versa_string<_CharT, _Traits, _Alloc, _Base>&& __rhs)
+ { __lhs.swap(__rhs); }
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @brief Read stream into a string.
+ * @param __is Input stream.
+ * @param __str Buffer to store into.
+ * @return Reference to the input stream.
+ *
+ * Stores characters from @a __is into @a __str until whitespace is
+ * found, the end of the stream is encountered, or str.max_size()
+ * is reached. If is.width() is non-zero, that is the limit on the
+ * number of characters stored into @a __str. Any previous
+ * contents of @a __str are erased.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __is,
+ __gnu_cxx::__versa_string<_CharT, _Traits,
+ _Alloc, _Base>& __str);
+
+ /**
+ * @brief Write string to a stream.
+ * @param __os Output stream.
+ * @param __str String to write out.
+ * @return Reference to the output stream.
+ *
+ * Output characters of @a __str into os following the same rules as for
+ * writing a C string.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __os,
+ const __gnu_cxx::__versa_string<_CharT, _Traits, _Alloc,
+ _Base>& __str)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 586. string inserter not a formatted function
+ return __ostream_insert(__os, __str.data(), __str.size());
+ }
+
+ /**
+ * @brief Read a line from stream into a string.
+ * @param __is Input stream.
+ * @param __str Buffer to store into.
+ * @param __delim Character marking end of line.
+ * @return Reference to the input stream.
+ *
+ * Stores characters from @a __is into @a __str until @a __delim is
+ * found, the end of the stream is encountered, or str.max_size()
+ * is reached. If is.width() is non-zero, that is the limit on the
+ * number of characters stored into @a __str. Any previous
+ * contents of @a __str are erased. If @a delim was encountered,
+ * it is extracted but not stored into @a __str.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ basic_istream<_CharT, _Traits>&
+ getline(basic_istream<_CharT, _Traits>& __is,
+ __gnu_cxx::__versa_string<_CharT, _Traits, _Alloc, _Base>& __str,
+ _CharT __delim);
+
+ /**
+ * @brief Read a line from stream into a string.
+ * @param __is Input stream.
+ * @param __str Buffer to store into.
+ * @return Reference to the input stream.
+ *
+ * Stores characters from is into @a __str until '\n' is found, the
+ * end of the stream is encountered, or str.max_size() is reached.
+ * If is.width() is non-zero, that is the limit on the number of
+ * characters stored into @a __str. Any previous contents of @a
+ * __str are erased. If end of line was encountered, it is
+ * extracted but not stored into @a __str.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline basic_istream<_CharT, _Traits>&
+ getline(basic_istream<_CharT, _Traits>& __is,
+ __gnu_cxx::__versa_string<_CharT, _Traits, _Alloc, _Base>& __str)
+ { return getline(__is, __str, __is.widen('\n')); }
+
+_GLIBCXX_END_NAMESPACE
+
+#if (defined(__GXX_EXPERIMENTAL_CXX0X__) && defined(_GLIBCXX_USE_C99))
+
+#include <ext/string_conversions.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ // 21.4 Numeric Conversions [string.conversions].
+ inline int
+ stoi(const __vstring& __str, std::size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa<long, int>(&std::strtol, "stoi", __str.c_str(),
+ __idx, __base); }
+
+ inline long
+ stol(const __vstring& __str, std::size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa(&std::strtol, "stol", __str.c_str(),
+ __idx, __base); }
+
+ inline unsigned long
+ stoul(const __vstring& __str, std::size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa(&std::strtoul, "stoul", __str.c_str(),
+ __idx, __base); }
+
+ inline long long
+ stoll(const __vstring& __str, std::size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa(&std::strtoll, "stoll", __str.c_str(),
+ __idx, __base); }
+
+ inline unsigned long long
+ stoull(const __vstring& __str, std::size_t* __idx, int __base = 10)
+ { return __gnu_cxx::__stoa(&std::strtoull, "stoull", __str.c_str(),
+ __idx, __base); }
+
+ // NB: strtof vs strtod.
+ inline float
+ stof(const __vstring& __str, std::size_t* __idx = 0)
+ { return __gnu_cxx::__stoa(&std::strtof, "stof", __str.c_str(), __idx); }
+
+ inline double
+ stod(const __vstring& __str, std::size_t* __idx = 0)
+ { return __gnu_cxx::__stoa(&std::strtod, "stod", __str.c_str(), __idx); }
+
+ inline long double
+ stold(const __vstring& __str, std::size_t* __idx = 0)
+ { return __gnu_cxx::__stoa(&std::strtold, "stold", __str.c_str(), __idx); }
+
+ // NB: (v)snprintf vs sprintf.
+ inline __vstring
+ to_string(long long __val)
+ { return __gnu_cxx::__to_xstring<__vstring>(&std::vsnprintf,
+ 4 * sizeof(long long),
+ "%lld", __val); }
+
+ inline __vstring
+ to_string(unsigned long long __val)
+ { return __gnu_cxx::__to_xstring<__vstring>(&std::vsnprintf,
+ 4 * sizeof(unsigned long long),
+ "%llu", __val); }
+
+ inline __vstring
+ to_string(long double __val)
+ {
+ const int __n = __numeric_traits<long double>::__max_exponent10 + 20;
+ return __gnu_cxx::__to_xstring<__vstring>(&std::vsnprintf, __n,
+ "%Lf", __val);
+ }
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ inline int
+ stoi(const __wvstring& __str, std::size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa<long, int>(&std::wcstol, "stoi", __str.c_str(),
+ __idx, __base); }
+
+ inline long
+ stol(const __wvstring& __str, std::size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa(&std::wcstol, "stol", __str.c_str(),
+ __idx, __base); }
+
+ inline unsigned long
+ stoul(const __wvstring& __str, std::size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa(&std::wcstoul, "stoul", __str.c_str(),
+ __idx, __base); }
+
+ inline long long
+ stoll(const __wvstring& __str, std::size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa(&std::wcstoll, "stoll", __str.c_str(),
+ __idx, __base); }
+
+ inline unsigned long long
+ stoull(const __wvstring& __str, std::size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa(&std::wcstoull, "stoull", __str.c_str(),
+ __idx, __base); }
+
+ // NB: wcstof vs wcstod.
+ inline float
+ stof(const __wvstring& __str, std::size_t* __idx = 0)
+ { return __gnu_cxx::__stoa(&std::wcstof, "stof", __str.c_str(), __idx); }
+
+ inline double
+ stod(const __wvstring& __str, std::size_t* __idx = 0)
+ { return __gnu_cxx::__stoa(&std::wcstod, "stod", __str.c_str(), __idx); }
+
+ inline long double
+ stold(const __wvstring& __str, std::size_t* __idx = 0)
+ { return __gnu_cxx::__stoa(&std::wcstold, "stold", __str.c_str(), __idx); }
+
+ inline __wvstring
+ to_wstring(long long __val)
+ { return __gnu_cxx::__to_xstring<__wvstring>(&std::vswprintf,
+ 4 * sizeof(long long),
+ L"%lld", __val); }
+
+ inline __wvstring
+ to_wstring(unsigned long long __val)
+ { return __gnu_cxx::__to_xstring<__wvstring>(&std::vswprintf,
+ 4 * sizeof(unsigned long long),
+ L"%llu", __val); }
+
+ inline __wvstring
+ to_wstring(long double __val)
+ {
+ const int __n = __numeric_traits<long double>::__max_exponent10 + 20;
+ return __gnu_cxx::__to_xstring<__wvstring>(&std::vswprintf, __n,
+ L"%Lf", __val);
+ }
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
+
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include "vstring.tcc"
+#endif
+
+#if __google_stl_debug_string && !defined(_GLIBCXX_DEBUG)
+// Undo our defines, so they don't affect anything else.
+# undef _GLIBCXX_DEBUG_ASSERT
+# undef _GLIBCXX_DEBUG_PEDASSERT
+# define _GLIBCXX_DEBUG_ASSERT(_Condition)
+# define _GLIBCXX_DEBUG_PEDASSERT(_Condition)
+#endif
+
+#endif /* _VSTRING_H */
diff --git a/i686-linux/include/c++/4.4.3/ext/vstring.tcc b/i686-linux/include/c++/4.4.3/ext/vstring.tcc
new file mode 100644
index 0000000..2c3a8e2
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/vstring.tcc
@@ -0,0 +1,696 @@
+// Versatile string -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ext/vstring.tcc
+ * This file is a GNU extension to the Standard C++ Library.
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _VSTRING_TCC
+#define _VSTRING_TCC 1
+
+#pragma GCC system_header
+
+#include <cxxabi-forced.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ const typename __versa_string<_CharT, _Traits, _Alloc, _Base>::size_type
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::npos;
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ void
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ resize(size_type __n, _CharT __c)
+ {
+ const size_type __size = this->size();
+ if (__size < __n)
+ this->append(__n - __size, __c);
+ else if (__n < __size)
+ this->_M_erase(__n, __size - __n);
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ __versa_string<_CharT, _Traits, _Alloc, _Base>&
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ _M_append(const _CharT* __s, size_type __n)
+ {
+ const size_type __len = __n + this->size();
+
+ if (__len <= this->capacity() && !this->_M_is_shared())
+ {
+ if (__n)
+ this->_S_copy(this->_M_data() + this->size(), __s, __n);
+ }
+ else
+ this->_M_mutate(this->size(), size_type(0), __s, __n);
+
+ this->_M_set_length(__len);
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ template<typename _InputIterator>
+ __versa_string<_CharT, _Traits, _Alloc, _Base>&
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ _M_replace_dispatch(iterator __i1, iterator __i2, _InputIterator __k1,
+ _InputIterator __k2, std::__false_type)
+ {
+ const __versa_string __s(__k1, __k2);
+ const size_type __n1 = __i2 - __i1;
+ return _M_replace(__i1 - _M_ibegin(), __n1, __s._M_data(),
+ __s.size());
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ __versa_string<_CharT, _Traits, _Alloc, _Base>&
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2,
+ _CharT __c)
+ {
+ _M_check_length(__n1, __n2, "__versa_string::_M_replace_aux");
+
+ const size_type __old_size = this->size();
+ const size_type __new_size = __old_size + __n2 - __n1;
+
+ if (__new_size <= this->capacity() && !this->_M_is_shared())
+ {
+ _CharT* __p = this->_M_data() + __pos1;
+
+ const size_type __how_much = __old_size - __pos1 - __n1;
+ if (__how_much && __n1 != __n2)
+ this->_S_move(__p + __n2, __p + __n1, __how_much);
+ }
+ else
+ this->_M_mutate(__pos1, __n1, 0, __n2);
+
+ if (__n2)
+ this->_S_assign(this->_M_data() + __pos1, __n2, __c);
+
+ this->_M_set_length(__new_size);
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ __versa_string<_CharT, _Traits, _Alloc, _Base>&
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ _M_replace(size_type __pos, size_type __len1, const _CharT* __s,
+ const size_type __len2)
+ {
+ _M_check_length(__len1, __len2, "__versa_string::_M_replace");
+
+ const size_type __old_size = this->size();
+ const size_type __new_size = __old_size + __len2 - __len1;
+
+ if (__new_size <= this->capacity() && !this->_M_is_shared())
+ {
+ _CharT* __p = this->_M_data() + __pos;
+
+ const size_type __how_much = __old_size - __pos - __len1;
+ if (_M_disjunct(__s))
+ {
+ if (__how_much && __len1 != __len2)
+ this->_S_move(__p + __len2, __p + __len1, __how_much);
+ if (__len2)
+ this->_S_copy(__p, __s, __len2);
+ }
+ else
+ {
+ // Work in-place.
+ if (__len2 && __len2 <= __len1)
+ this->_S_move(__p, __s, __len2);
+ if (__how_much && __len1 != __len2)
+ this->_S_move(__p + __len2, __p + __len1, __how_much);
+ if (__len2 > __len1)
+ {
+ if (__s + __len2 <= __p + __len1)
+ this->_S_move(__p, __s, __len2);
+ else if (__s >= __p + __len1)
+ this->_S_copy(__p, __s + __len2 - __len1, __len2);
+ else
+ {
+ const size_type __nleft = (__p + __len1) - __s;
+ this->_S_move(__p, __s, __nleft);
+ this->_S_copy(__p + __nleft, __p + __len2,
+ __len2 - __nleft);
+ }
+ }
+ }
+ }
+ else
+ this->_M_mutate(__pos, __len1, __s, __len2);
+
+ this->_M_set_length(__new_size);
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ __versa_string<_CharT, _Traits, _Alloc, _Base>
+ operator+(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
+ {
+ __versa_string<_CharT, _Traits, _Alloc, _Base> __str;
+ __str.reserve(__lhs.size() + __rhs.size());
+ __str.append(__lhs);
+ __str.append(__rhs);
+ return __str;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ __versa_string<_CharT, _Traits, _Alloc, _Base>
+ operator+(const _CharT* __lhs,
+ const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
+ {
+ __glibcxx_requires_string(__lhs);
+ typedef __versa_string<_CharT, _Traits, _Alloc, _Base> __string_type;
+ typedef typename __string_type::size_type __size_type;
+ const __size_type __len = _Traits::length(__lhs);
+ __string_type __str;
+ __str.reserve(__len + __rhs.size());
+ __str.append(__lhs, __len);
+ __str.append(__rhs);
+ return __str;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ __versa_string<_CharT, _Traits, _Alloc, _Base>
+ operator+(_CharT __lhs,
+ const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
+ {
+ __versa_string<_CharT, _Traits, _Alloc, _Base> __str;
+ __str.reserve(__rhs.size() + 1);
+ __str.push_back(__lhs);
+ __str.append(__rhs);
+ return __str;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ __versa_string<_CharT, _Traits, _Alloc, _Base>
+ operator+(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ const _CharT* __rhs)
+ {
+ __glibcxx_requires_string(__rhs);
+ typedef __versa_string<_CharT, _Traits, _Alloc, _Base> __string_type;
+ typedef typename __string_type::size_type __size_type;
+ const __size_type __len = _Traits::length(__rhs);
+ __string_type __str;
+ __str.reserve(__lhs.size() + __len);
+ __str.append(__lhs);
+ __str.append(__rhs, __len);
+ return __str;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ __versa_string<_CharT, _Traits, _Alloc, _Base>
+ operator+(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ _CharT __rhs)
+ {
+ __versa_string<_CharT, _Traits, _Alloc, _Base> __str;
+ __str.reserve(__lhs.size() + 1);
+ __str.append(__lhs);
+ __str.push_back(__rhs);
+ return __str;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ typename __versa_string<_CharT, _Traits, _Alloc, _Base>::size_type
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ copy(_CharT* __s, size_type __n, size_type __pos) const
+ {
+ _M_check(__pos, "__versa_string::copy");
+ __n = _M_limit(__pos, __n);
+ __glibcxx_requires_string_len(__s, __n);
+ if (__n)
+ this->_S_copy(__s, this->_M_data() + __pos, __n);
+ // 21.3.5.7 par 3: do not append null. (good.)
+ return __n;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ typename __versa_string<_CharT, _Traits, _Alloc, _Base>::size_type
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ find(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_requires_string_len(__s, __n);
+ const size_type __size = this->size();
+ const _CharT* __data = this->_M_data();
+
+ if (__n == 0)
+ return __pos <= __size ? __pos : npos;
+
+ if (__n <= __size)
+ {
+ for (; __pos <= __size - __n; ++__pos)
+ if (traits_type::eq(__data[__pos], __s[0])
+ && traits_type::compare(__data + __pos + 1,
+ __s + 1, __n - 1) == 0)
+ return __pos;
+ }
+ return npos;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ typename __versa_string<_CharT, _Traits, _Alloc, _Base>::size_type
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ find(_CharT __c, size_type __pos) const
+ {
+ size_type __ret = npos;
+ const size_type __size = this->size();
+ if (__pos < __size)
+ {
+ const _CharT* __data = this->_M_data();
+ const size_type __n = __size - __pos;
+ const _CharT* __p = traits_type::find(__data + __pos, __n, __c);
+ if (__p)
+ __ret = __p - __data;
+ }
+ return __ret;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ typename __versa_string<_CharT, _Traits, _Alloc, _Base>::size_type
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ rfind(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_requires_string_len(__s, __n);
+ const size_type __size = this->size();
+ if (__n <= __size)
+ {
+ __pos = std::min(size_type(__size - __n), __pos);
+ const _CharT* __data = this->_M_data();
+ do
+ {
+ if (traits_type::compare(__data + __pos, __s, __n) == 0)
+ return __pos;
+ }
+ while (__pos-- > 0);
+ }
+ return npos;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ typename __versa_string<_CharT, _Traits, _Alloc, _Base>::size_type
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ rfind(_CharT __c, size_type __pos) const
+ {
+ size_type __size = this->size();
+ if (__size)
+ {
+ if (--__size > __pos)
+ __size = __pos;
+ for (++__size; __size-- > 0; )
+ if (traits_type::eq(this->_M_data()[__size], __c))
+ return __size;
+ }
+ return npos;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ typename __versa_string<_CharT, _Traits, _Alloc, _Base>::size_type
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ find_first_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_requires_string_len(__s, __n);
+ for (; __n && __pos < this->size(); ++__pos)
+ {
+ const _CharT* __p = traits_type::find(__s, __n,
+ this->_M_data()[__pos]);
+ if (__p)
+ return __pos;
+ }
+ return npos;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ typename __versa_string<_CharT, _Traits, _Alloc, _Base>::size_type
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ find_last_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_requires_string_len(__s, __n);
+ size_type __size = this->size();
+ if (__size && __n)
+ {
+ if (--__size > __pos)
+ __size = __pos;
+ do
+ {
+ if (traits_type::find(__s, __n, this->_M_data()[__size]))
+ return __size;
+ }
+ while (__size-- != 0);
+ }
+ return npos;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ typename __versa_string<_CharT, _Traits, _Alloc, _Base>::size_type
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_requires_string_len(__s, __n);
+ for (; __pos < this->size(); ++__pos)
+ if (!traits_type::find(__s, __n, this->_M_data()[__pos]))
+ return __pos;
+ return npos;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ typename __versa_string<_CharT, _Traits, _Alloc, _Base>::size_type
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ find_first_not_of(_CharT __c, size_type __pos) const
+ {
+ for (; __pos < this->size(); ++__pos)
+ if (!traits_type::eq(this->_M_data()[__pos], __c))
+ return __pos;
+ return npos;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ typename __versa_string<_CharT, _Traits, _Alloc, _Base>::size_type
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_requires_string_len(__s, __n);
+ size_type __size = this->size();
+ if (__size)
+ {
+ if (--__size > __pos)
+ __size = __pos;
+ do
+ {
+ if (!traits_type::find(__s, __n, this->_M_data()[__size]))
+ return __size;
+ }
+ while (__size--);
+ }
+ return npos;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ typename __versa_string<_CharT, _Traits, _Alloc, _Base>::size_type
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ find_last_not_of(_CharT __c, size_type __pos) const
+ {
+ size_type __size = this->size();
+ if (__size)
+ {
+ if (--__size > __pos)
+ __size = __pos;
+ do
+ {
+ if (!traits_type::eq(this->_M_data()[__size], __c))
+ return __size;
+ }
+ while (__size--);
+ }
+ return npos;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ int
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ compare(size_type __pos, size_type __n, const __versa_string& __str) const
+ {
+ _M_check(__pos, "__versa_string::compare");
+ __n = _M_limit(__pos, __n);
+ const size_type __osize = __str.size();
+ const size_type __len = std::min(__n, __osize);
+ int __r = traits_type::compare(this->_M_data() + __pos,
+ __str.data(), __len);
+ if (!__r)
+ __r = this->_S_compare(__n, __osize);
+ return __r;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ int
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ compare(size_type __pos1, size_type __n1, const __versa_string& __str,
+ size_type __pos2, size_type __n2) const
+ {
+ _M_check(__pos1, "__versa_string::compare");
+ __str._M_check(__pos2, "__versa_string::compare");
+ __n1 = _M_limit(__pos1, __n1);
+ __n2 = __str._M_limit(__pos2, __n2);
+ const size_type __len = std::min(__n1, __n2);
+ int __r = traits_type::compare(this->_M_data() + __pos1,
+ __str.data() + __pos2, __len);
+ if (!__r)
+ __r = this->_S_compare(__n1, __n2);
+ return __r;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ int
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ compare(const _CharT* __s) const
+ {
+ __glibcxx_requires_string(__s);
+ const size_type __size = this->size();
+ const size_type __osize = traits_type::length(__s);
+ const size_type __len = std::min(__size, __osize);
+ int __r = traits_type::compare(this->_M_data(), __s, __len);
+ if (!__r)
+ __r = this->_S_compare(__size, __osize);
+ return __r;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ int
+ __versa_string <_CharT, _Traits, _Alloc, _Base>::
+ compare(size_type __pos, size_type __n1, const _CharT* __s) const
+ {
+ __glibcxx_requires_string(__s);
+ _M_check(__pos, "__versa_string::compare");
+ __n1 = _M_limit(__pos, __n1);
+ const size_type __osize = traits_type::length(__s);
+ const size_type __len = std::min(__n1, __osize);
+ int __r = traits_type::compare(this->_M_data() + __pos, __s, __len);
+ if (!__r)
+ __r = this->_S_compare(__n1, __osize);
+ return __r;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ int
+ __versa_string <_CharT, _Traits, _Alloc, _Base>::
+ compare(size_type __pos, size_type __n1, const _CharT* __s,
+ size_type __n2) const
+ {
+ __glibcxx_requires_string_len(__s, __n2);
+ _M_check(__pos, "__versa_string::compare");
+ __n1 = _M_limit(__pos, __n1);
+ const size_type __len = std::min(__n1, __n2);
+ int __r = traits_type::compare(this->_M_data() + __pos, __s, __len);
+ if (!__r)
+ __r = this->_S_compare(__n1, __n2);
+ return __r;
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __in,
+ __gnu_cxx::__versa_string<_CharT, _Traits,
+ _Alloc, _Base>& __str)
+ {
+ typedef basic_istream<_CharT, _Traits> __istream_type;
+ typedef typename __istream_type::ios_base __ios_base;
+ typedef __gnu_cxx::__versa_string<_CharT, _Traits, _Alloc, _Base>
+ __string_type;
+ typedef typename __istream_type::int_type __int_type;
+ typedef typename __string_type::size_type __size_type;
+ typedef ctype<_CharT> __ctype_type;
+ typedef typename __ctype_type::ctype_base __ctype_base;
+
+ __size_type __extracted = 0;
+ typename __ios_base::iostate __err = __ios_base::goodbit;
+ typename __istream_type::sentry __cerb(__in, false);
+ if (__cerb)
+ {
+ __try
+ {
+ // Avoid reallocation for common case.
+ __str.erase();
+ _CharT __buf[128];
+ __size_type __len = 0;
+ const streamsize __w = __in.width();
+ const __size_type __n = __w > 0 ? static_cast<__size_type>(__w)
+ : __str.max_size();
+ const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc());
+ const __int_type __eof = _Traits::eof();
+ __int_type __c = __in.rdbuf()->sgetc();
+
+ while (__extracted < __n
+ && !_Traits::eq_int_type(__c, __eof)
+ && !__ct.is(__ctype_base::space,
+ _Traits::to_char_type(__c)))
+ {
+ if (__len == sizeof(__buf) / sizeof(_CharT))
+ {
+ __str.append(__buf, sizeof(__buf) / sizeof(_CharT));
+ __len = 0;
+ }
+ __buf[__len++] = _Traits::to_char_type(__c);
+ ++__extracted;
+ __c = __in.rdbuf()->snextc();
+ }
+ __str.append(__buf, __len);
+
+ if (_Traits::eq_int_type(__c, __eof))
+ __err |= __ios_base::eofbit;
+ __in.width(0);
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ __in._M_setstate(__ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 91. Description of operator>> and getline() for string<>
+ // might cause endless loop
+ __in._M_setstate(__ios_base::badbit);
+ }
+ }
+ // 211. operator>>(istream&, string&) doesn't set failbit
+ if (!__extracted)
+ __err |= __ios_base::failbit;
+ if (__err)
+ __in.setstate(__err);
+ return __in;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ basic_istream<_CharT, _Traits>&
+ getline(basic_istream<_CharT, _Traits>& __in,
+ __gnu_cxx::__versa_string<_CharT, _Traits, _Alloc, _Base>& __str,
+ _CharT __delim)
+ {
+ typedef basic_istream<_CharT, _Traits> __istream_type;
+ typedef typename __istream_type::ios_base __ios_base;
+ typedef __gnu_cxx::__versa_string<_CharT, _Traits, _Alloc, _Base>
+ __string_type;
+ typedef typename __istream_type::int_type __int_type;
+ typedef typename __string_type::size_type __size_type;
+
+ __size_type __extracted = 0;
+ const __size_type __n = __str.max_size();
+ typename __ios_base::iostate __err = __ios_base::goodbit;
+ typename __istream_type::sentry __cerb(__in, true);
+ if (__cerb)
+ {
+ __try
+ {
+ // Avoid reallocation for common case.
+ __str.erase();
+ _CharT __buf[128];
+ __size_type __len = 0;
+ const __int_type __idelim = _Traits::to_int_type(__delim);
+ const __int_type __eof = _Traits::eof();
+ __int_type __c = __in.rdbuf()->sgetc();
+
+ while (__extracted < __n
+ && !_Traits::eq_int_type(__c, __eof)
+ && !_Traits::eq_int_type(__c, __idelim))
+ {
+ if (__len == sizeof(__buf) / sizeof(_CharT))
+ {
+ __str.append(__buf, sizeof(__buf) / sizeof(_CharT));
+ __len = 0;
+ }
+ __buf[__len++] = _Traits::to_char_type(__c);
+ ++__extracted;
+ __c = __in.rdbuf()->snextc();
+ }
+ __str.append(__buf, __len);
+
+ if (_Traits::eq_int_type(__c, __eof))
+ __err |= __ios_base::eofbit;
+ else if (_Traits::eq_int_type(__c, __idelim))
+ {
+ ++__extracted;
+ __in.rdbuf()->sbumpc();
+ }
+ else
+ __err |= __ios_base::failbit;
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ __in._M_setstate(__ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 91. Description of operator>> and getline() for string<>
+ // might cause endless loop
+ __in._M_setstate(__ios_base::badbit);
+ }
+ }
+ if (!__extracted)
+ __err |= __ios_base::failbit;
+ if (__err)
+ __in.setstate(__err);
+ return __in;
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif // _VSTRING_TCC
diff --git a/i686-linux/include/c++/4.4.3/ext/vstring_fwd.h b/i686-linux/include/c++/4.4.3/ext/vstring_fwd.h
new file mode 100644
index 0000000..c2a31d4
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/vstring_fwd.h
@@ -0,0 +1,87 @@
+// Versatile string forward -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ext/vstring_fwd.h
+ * This file is a GNU extension to the Standard C++ Library.
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _VSTRING_FWD_H
+#define _VSTRING_FWD_H 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <bits/char_traits.h>
+#include <bits/allocator.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ class __sso_string_base;
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ class __rc_string_base;
+
+ template<typename _CharT, typename _Traits = std::char_traits<_CharT>,
+ typename _Alloc = std::allocator<_CharT>,
+ template
+ <typename, typename, typename> class _Base = __sso_string_base>
+ class __versa_string;
+
+ typedef __versa_string<char> __vstring;
+ typedef __vstring __sso_string;
+ typedef
+ __versa_string<char, std::char_traits<char>,
+ std::allocator<char>, __rc_string_base> __rc_string;
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ typedef __versa_string<wchar_t> __wvstring;
+ typedef __wvstring __wsso_string;
+ typedef
+ __versa_string<wchar_t, std::char_traits<wchar_t>,
+ std::allocator<wchar_t>, __rc_string_base> __wrc_string;
+#endif
+
+#if (defined(__GXX_EXPERIMENTAL_CXX0X__) \
+ && defined(_GLIBCXX_USE_C99_STDINT_TR1))
+
+ typedef __versa_string<char16_t> __u16vstring;
+ typedef __u16vstring __u16sso_string;
+ typedef
+ __versa_string<char16_t, std::char_traits<char16_t>,
+ std::allocator<char16_t>, __rc_string_base> __u16rc_string;
+
+ typedef __versa_string<char32_t> __u32vstring;
+ typedef __u32vstring __u32sso_string;
+ typedef
+ __versa_string<char32_t, std::char_traits<char32_t>,
+ std::allocator<char32_t>, __rc_string_base> __u32rc_string;
+
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _VSTRING_FWD_H */
diff --git a/i686-linux/include/c++/4.4.3/ext/vstring_util.h b/i686-linux/include/c++/4.4.3/ext/vstring_util.h
new file mode 100644
index 0000000..4042f70
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ext/vstring_util.h
@@ -0,0 +1,180 @@
+// Versatile string utility -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ext/vstring_util.h
+ * This file is a GNU extension to the Standard C++ Library.
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _VSTRING_UTIL_H
+#define _VSTRING_UTIL_H 1
+
+#pragma GCC system_header
+
+#include <ext/vstring_fwd.h>
+#include <debug/debug.h>
+#include <bits/stl_function.h> // For less
+#include <bits/functexcept.h>
+#include <bits/localefwd.h>
+#include <bits/ostream_insert.h>
+#include <bits/stl_iterator.h>
+#include <ext/numeric_traits.h>
+#include <bits/move.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ struct __vstring_utility
+ {
+ typedef typename _Alloc::template rebind<_CharT>::other _CharT_alloc_type;
+
+ typedef _Traits traits_type;
+ typedef typename _Traits::char_type value_type;
+ typedef typename _CharT_alloc_type::size_type size_type;
+ typedef typename _CharT_alloc_type::difference_type difference_type;
+ typedef typename _CharT_alloc_type::pointer pointer;
+ typedef typename _CharT_alloc_type::const_pointer const_pointer;
+
+ // For __sso_string.
+ typedef __gnu_cxx::
+ __normal_iterator<pointer, __gnu_cxx::
+ __versa_string<_CharT, _Traits, _Alloc,
+ __sso_string_base> >
+ __sso_iterator;
+ typedef __gnu_cxx::
+ __normal_iterator<const_pointer, __gnu_cxx::
+ __versa_string<_CharT, _Traits, _Alloc,
+ __sso_string_base> >
+ __const_sso_iterator;
+
+ // For __rc_string.
+ typedef __gnu_cxx::
+ __normal_iterator<pointer, __gnu_cxx::
+ __versa_string<_CharT, _Traits, _Alloc,
+ __rc_string_base> >
+ __rc_iterator;
+ typedef __gnu_cxx::
+ __normal_iterator<const_pointer, __gnu_cxx::
+ __versa_string<_CharT, _Traits, _Alloc,
+ __rc_string_base> >
+ __const_rc_iterator;
+
+ // NB: When the allocator is empty, deriving from it saves space
+ // (http://www.cantrip.org/emptyopt.html).
+ template<typename _Alloc1>
+ struct _Alloc_hider
+ : public _Alloc1
+ {
+ _Alloc_hider(_CharT* __ptr)
+ : _Alloc1(), _M_p(__ptr) { }
+
+ _Alloc_hider(const _Alloc1& __a, _CharT* __ptr)
+ : _Alloc1(__a), _M_p(__ptr) { }
+
+ _CharT* _M_p; // The actual data.
+ };
+
+ // When __n = 1 way faster than the general multichar
+ // traits_type::copy/move/assign.
+ static void
+ _S_copy(_CharT* __d, const _CharT* __s, size_type __n)
+ {
+ if (__n == 1)
+ traits_type::assign(*__d, *__s);
+ else
+ traits_type::copy(__d, __s, __n);
+ }
+
+ static void
+ _S_move(_CharT* __d, const _CharT* __s, size_type __n)
+ {
+ if (__n == 1)
+ traits_type::assign(*__d, *__s);
+ else
+ traits_type::move(__d, __s, __n);
+ }
+
+ static void
+ _S_assign(_CharT* __d, size_type __n, _CharT __c)
+ {
+ if (__n == 1)
+ traits_type::assign(*__d, __c);
+ else
+ traits_type::assign(__d, __n, __c);
+ }
+
+ // _S_copy_chars is a separate template to permit specialization
+ // to optimize for the common case of pointers as iterators.
+ template<typename _Iterator>
+ static void
+ _S_copy_chars(_CharT* __p, _Iterator __k1, _Iterator __k2)
+ {
+ for (; __k1 != __k2; ++__k1, ++__p)
+ traits_type::assign(*__p, *__k1); // These types are off.
+ }
+
+ static void
+ _S_copy_chars(_CharT* __p, __sso_iterator __k1, __sso_iterator __k2)
+ { _S_copy_chars(__p, __k1.base(), __k2.base()); }
+
+ static void
+ _S_copy_chars(_CharT* __p, __const_sso_iterator __k1,
+ __const_sso_iterator __k2)
+ { _S_copy_chars(__p, __k1.base(), __k2.base()); }
+
+ static void
+ _S_copy_chars(_CharT* __p, __rc_iterator __k1, __rc_iterator __k2)
+ { _S_copy_chars(__p, __k1.base(), __k2.base()); }
+
+ static void
+ _S_copy_chars(_CharT* __p, __const_rc_iterator __k1,
+ __const_rc_iterator __k2)
+ { _S_copy_chars(__p, __k1.base(), __k2.base()); }
+
+ static void
+ _S_copy_chars(_CharT* __p, _CharT* __k1, _CharT* __k2)
+ { _S_copy(__p, __k1, __k2 - __k1); }
+
+ static void
+ _S_copy_chars(_CharT* __p, const _CharT* __k1, const _CharT* __k2)
+ { _S_copy(__p, __k1, __k2 - __k1); }
+
+ static int
+ _S_compare(size_type __n1, size_type __n2)
+ {
+ const difference_type __d = difference_type(__n1 - __n2);
+
+ if (__d > __numeric_traits_integer<int>::__max)
+ return __numeric_traits_integer<int>::__max;
+ else if (__d < __numeric_traits_integer<int>::__min)
+ return __numeric_traits_integer<int>::__min;
+ else
+ return int(__d);
+ }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _VSTRING_UTIL_H */
diff --git a/i686-linux/include/c++/4.4.3/fenv.h b/i686-linux/include/c++/4.4.3/fenv.h
new file mode 100644
index 0000000..5db6d9d
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/fenv.h
@@ -0,0 +1,58 @@
+// -*- C++ -*- compatibility header.
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file fenv.h
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_FENV_H
+#define _GLIBCXX_FENV_H 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#if _GLIBCXX_HAVE_FENV_H
+# include_next <fenv.h>
+#endif
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+# endif
+# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/cfenv>
+# else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/cfenv>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+# endif
+#endif
+
+#endif // _GLIBCXX_FENV_H
diff --git a/i686-linux/include/c++/4.4.3/forward_list b/i686-linux/include/c++/4.4.3/forward_list
new file mode 100644
index 0000000..40a0812
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/forward_list
@@ -0,0 +1,46 @@
+// <forward_list> -*- C++ -*-
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file forward_list
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_FORWARD_LIST
+#define _GLIBCXX_FORWARD_LIST 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#else
+
+#include <bits/forward_list.h>
+
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <bits/forward_list.tcc>
+#endif
+
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+#endif // _GLIBCXX_FORWARD_LIST
diff --git a/i686-linux/include/c++/4.4.3/fstream b/i686-linux/include/c++/4.4.3/fstream
new file mode 100644
index 0000000..88c1d14
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/fstream
@@ -0,0 +1,918 @@
+// File based streams -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file fstream
+ * This is a Standard C++ Library header.
+ */
+
+//
+// ISO C++ 14882: 27.8 File-based streams
+//
+
+#ifndef _GLIBCXX_FSTREAM
+#define _GLIBCXX_FSTREAM 1
+
+#pragma GCC system_header
+
+#include <istream>
+#include <ostream>
+#include <bits/codecvt.h>
+#include <cstdio> // For BUFSIZ
+#include <bits/basic_file.h> // For __basic_file, __c_lock
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#include <string> // For std::string overloads.
+#endif
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // [27.8.1.1] template class basic_filebuf
+ /**
+ * @brief The actual work of input and output (for files).
+ * @ingroup io
+ *
+ * This class associates both its input and output sequence with an
+ * external disk file, and maintains a joint file position for both
+ * sequences. Many of its semantics are described in terms of similar
+ * behavior in the Standard C Library's @c FILE streams.
+ */
+ // Requirements on traits_type, specific to this class:
+ // traits_type::pos_type must be fpos<traits_type::state_type>
+ // traits_type::off_type must be streamoff
+ // traits_type::state_type must be Assignable and DefaultConstructible,
+ // and traits_type::state_type() must be the initial state for codecvt.
+ template<typename _CharT, typename _Traits>
+ class basic_filebuf : public basic_streambuf<_CharT, _Traits>
+ {
+ public:
+ // Types:
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ typedef typename traits_type::int_type int_type;
+ typedef typename traits_type::pos_type pos_type;
+ typedef typename traits_type::off_type off_type;
+
+ typedef basic_streambuf<char_type, traits_type> __streambuf_type;
+ typedef basic_filebuf<char_type, traits_type> __filebuf_type;
+ typedef __basic_file<char> __file_type;
+ typedef typename traits_type::state_type __state_type;
+ typedef codecvt<char_type, char, __state_type> __codecvt_type;
+
+ friend class ios_base; // For sync_with_stdio.
+
+ protected:
+ // Data Members:
+ // MT lock inherited from libio or other low-level io library.
+ __c_lock _M_lock;
+
+ // External buffer.
+ __file_type _M_file;
+
+ /// Place to stash in || out || in | out settings for current filebuf.
+ ios_base::openmode _M_mode;
+
+ // Beginning state type for codecvt.
+ __state_type _M_state_beg;
+
+ // During output, the state that corresponds to pptr(),
+ // during input, the state that corresponds to egptr() and
+ // _M_ext_next.
+ __state_type _M_state_cur;
+
+ // Not used for output. During input, the state that corresponds
+ // to eback() and _M_ext_buf.
+ __state_type _M_state_last;
+
+ /// Pointer to the beginning of internal buffer.
+ char_type* _M_buf;
+
+ /**
+ * Actual size of internal buffer. This number is equal to the size
+ * of the put area + 1 position, reserved for the overflow char of
+ * a full area.
+ */
+ size_t _M_buf_size;
+
+ // Set iff _M_buf is allocated memory from _M_allocate_internal_buffer.
+ bool _M_buf_allocated;
+
+ /**
+ * _M_reading == false && _M_writing == false for 'uncommitted' mode;
+ * _M_reading == true for 'read' mode;
+ * _M_writing == true for 'write' mode;
+ *
+ * NB: _M_reading == true && _M_writing == true is unused.
+ */
+ bool _M_reading;
+ bool _M_writing;
+
+ //@{
+ /**
+ * Necessary bits for putback buffer management.
+ *
+ * @note pbacks of over one character are not currently supported.
+ */
+ char_type _M_pback;
+ char_type* _M_pback_cur_save;
+ char_type* _M_pback_end_save;
+ bool _M_pback_init;
+ //@}
+
+ // Cached codecvt facet.
+ const __codecvt_type* _M_codecvt;
+
+ /**
+ * Buffer for external characters. Used for input when
+ * codecvt::always_noconv() == false. When valid, this corresponds
+ * to eback().
+ */
+ char* _M_ext_buf;
+
+ /**
+ * Size of buffer held by _M_ext_buf.
+ */
+ streamsize _M_ext_buf_size;
+
+ /**
+ * Pointers into the buffer held by _M_ext_buf that delimit a
+ * subsequence of bytes that have been read but not yet converted.
+ * When valid, _M_ext_next corresponds to egptr().
+ */
+ const char* _M_ext_next;
+ char* _M_ext_end;
+
+ /**
+ * Initializes pback buffers, and moves normal buffers to safety.
+ * Assumptions:
+ * _M_in_cur has already been moved back
+ */
+ void
+ _M_create_pback()
+ {
+ if (!_M_pback_init)
+ {
+ _M_pback_cur_save = this->gptr();
+ _M_pback_end_save = this->egptr();
+ this->setg(&_M_pback, &_M_pback, &_M_pback + 1);
+ _M_pback_init = true;
+ }
+ }
+
+ /**
+ * Deactivates pback buffer contents, and restores normal buffer.
+ * Assumptions:
+ * The pback buffer has only moved forward.
+ */
+ void
+ _M_destroy_pback() throw()
+ {
+ if (_M_pback_init)
+ {
+ // Length _M_in_cur moved in the pback buffer.
+ _M_pback_cur_save += this->gptr() != this->eback();
+ this->setg(_M_buf, _M_pback_cur_save, _M_pback_end_save);
+ _M_pback_init = false;
+ }
+ }
+
+ public:
+ // Constructors/destructor:
+ /**
+ * @brief Does not open any files.
+ *
+ * The default constructor initializes the parent class using its
+ * own default ctor.
+ */
+ basic_filebuf();
+
+ /**
+ * @brief The destructor closes the file first.
+ */
+ virtual
+ ~basic_filebuf()
+ { this->close(); }
+
+ // Members:
+ /**
+ * @brief Returns true if the external file is open.
+ */
+ bool
+ is_open() const throw()
+ { return _M_file.is_open(); }
+
+ /**
+ * @brief Opens an external file.
+ * @param s The name of the file.
+ * @param mode The open mode flags.
+ * @return @c this on success, NULL on failure
+ *
+ * If a file is already open, this function immediately fails.
+ * Otherwise it tries to open the file named @a s using the flags
+ * given in @a mode.
+ *
+ * Table 92, adapted here, gives the relation between openmode
+ * combinations and the equivalent fopen() flags.
+ * (NB: lines app, in|out|app, in|app, binary|app, binary|in|out|app,
+ * and binary|in|app per DR 596)
+ * +---------------------------------------------------------+
+ * | ios_base Flag combination stdio equivalent |
+ * |binary in out trunc app |
+ * +---------------------------------------------------------+
+ * | + "w" |
+ * | + + "a" |
+ * | + "a" |
+ * | + + "w" |
+ * | + "r" |
+ * | + + "r+" |
+ * | + + + "w+" |
+ * | + + + "a+" |
+ * | + + "a+" |
+ * +---------------------------------------------------------+
+ * | + + "wb" |
+ * | + + + "ab" |
+ * | + + "ab" |
+ * | + + + "wb" |
+ * | + + "rb" |
+ * | + + + "r+b" |
+ * | + + + + "w+b" |
+ * | + + + + "a+b" |
+ * | + + + "a+b" |
+ * +---------------------------------------------------------+
+ */
+ __filebuf_type*
+ open(const char* __s, ios_base::openmode __mode);
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Opens an external file.
+ * @param s The name of the file.
+ * @param mode The open mode flags.
+ * @return @c this on success, NULL on failure
+ */
+ __filebuf_type*
+ open(const std::string& __s, ios_base::openmode __mode)
+ { return open(__s.c_str(), __mode); }
+#endif
+
+ /**
+ * @brief Closes the currently associated file.
+ * @return @c this on success, NULL on failure
+ *
+ * If no file is currently open, this function immediately fails.
+ *
+ * If a "put buffer area" exists, @c overflow(eof) is called to flush
+ * all the characters. The file is then closed.
+ *
+ * If any operations fail, this function also fails.
+ */
+ __filebuf_type*
+ close();
+
+ protected:
+ void
+ _M_allocate_internal_buffer();
+
+ void
+ _M_destroy_internal_buffer() throw();
+
+ // [27.8.1.4] overridden virtual functions
+ virtual streamsize
+ showmanyc();
+
+ // Stroustrup, 1998, p. 628
+ // underflow() and uflow() functions are called to get the next
+ // character from the real input source when the buffer is empty.
+ // Buffered input uses underflow()
+
+ virtual int_type
+ underflow();
+
+ virtual int_type
+ pbackfail(int_type __c = _Traits::eof());
+
+ // Stroustrup, 1998, p 648
+ // The overflow() function is called to transfer characters to the
+ // real output destination when the buffer is full. A call to
+ // overflow(c) outputs the contents of the buffer plus the
+ // character c.
+ // 27.5.2.4.5
+ // Consume some sequence of the characters in the pending sequence.
+ virtual int_type
+ overflow(int_type __c = _Traits::eof());
+
+ // Convert internal byte sequence to external, char-based
+ // sequence via codecvt.
+ bool
+ _M_convert_to_external(char_type*, streamsize);
+
+ /**
+ * @brief Manipulates the buffer.
+ * @param s Pointer to a buffer area.
+ * @param n Size of @a s.
+ * @return @c this
+ *
+ * If no file has been opened, and both @a s and @a n are zero, then
+ * the stream becomes unbuffered. Otherwise, @c s is used as a
+ * buffer; see
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt11ch25s02.html
+ * for more.
+ */
+ virtual __streambuf_type*
+ setbuf(char_type* __s, streamsize __n);
+
+ virtual pos_type
+ seekoff(off_type __off, ios_base::seekdir __way,
+ ios_base::openmode __mode = ios_base::in | ios_base::out);
+
+ virtual pos_type
+ seekpos(pos_type __pos,
+ ios_base::openmode __mode = ios_base::in | ios_base::out);
+
+ // Common code for seekoff and seekpos
+ pos_type
+ _M_seek(off_type __off, ios_base::seekdir __way, __state_type __state);
+
+ virtual int
+ sync();
+
+ virtual void
+ imbue(const locale& __loc);
+
+ virtual streamsize
+ xsgetn(char_type* __s, streamsize __n);
+
+ virtual streamsize
+ xsputn(const char_type* __s, streamsize __n);
+
+ // Flushes output buffer, then writes unshift sequence.
+ bool
+ _M_terminate_output();
+
+ /**
+ * This function sets the pointers of the internal buffer, both get
+ * and put areas. Typically:
+ *
+ * __off == egptr() - eback() upon underflow/uflow ('read' mode);
+ * __off == 0 upon overflow ('write' mode);
+ * __off == -1 upon open, setbuf, seekoff/pos ('uncommitted' mode).
+ *
+ * NB: epptr() - pbase() == _M_buf_size - 1, since _M_buf_size
+ * reflects the actual allocated memory and the last cell is reserved
+ * for the overflow char of a full put area.
+ */
+ void
+ _M_set_buffer(streamsize __off)
+ {
+ const bool __testin = _M_mode & ios_base::in;
+ const bool __testout = _M_mode & ios_base::out;
+
+ if (__testin && __off > 0)
+ this->setg(_M_buf, _M_buf, _M_buf + __off);
+ else
+ this->setg(_M_buf, _M_buf, _M_buf);
+
+ if (__testout && __off == 0 && _M_buf_size > 1 )
+ this->setp(_M_buf, _M_buf + _M_buf_size - 1);
+ else
+ this->setp(NULL, NULL);
+ }
+ };
+
+ // [27.8.1.5] Template class basic_ifstream
+ /**
+ * @brief Controlling input for files.
+ * @ingroup io
+ *
+ * This class supports reading from named files, using the inherited
+ * functions from std::basic_istream. To control the associated
+ * sequence, an instance of std::basic_filebuf is used, which this page
+ * refers to as @c sb.
+ */
+ template<typename _CharT, typename _Traits>
+ class basic_ifstream : public basic_istream<_CharT, _Traits>
+ {
+ public:
+ // Types:
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ typedef typename traits_type::int_type int_type;
+ typedef typename traits_type::pos_type pos_type;
+ typedef typename traits_type::off_type off_type;
+
+ // Non-standard types:
+ typedef basic_filebuf<char_type, traits_type> __filebuf_type;
+ typedef basic_istream<char_type, traits_type> __istream_type;
+
+ private:
+ __filebuf_type _M_filebuf;
+
+ public:
+ // Constructors/Destructors:
+ /**
+ * @brief Default constructor.
+ *
+ * Initializes @c sb using its default constructor, and passes
+ * @c &sb to the base class initializer. Does not open any files
+ * (you haven't given it a filename to open).
+ */
+ basic_ifstream() : __istream_type(), _M_filebuf()
+ { this->init(&_M_filebuf); }
+
+ /**
+ * @brief Create an input file stream.
+ * @param s Null terminated string specifying the filename.
+ * @param mode Open file in specified mode (see std::ios_base).
+ *
+ * @c ios_base::in is automatically included in @a mode.
+ *
+ * Tip: When using std::string to hold the filename, you must use
+ * .c_str() before passing it to this constructor.
+ */
+ explicit
+ basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in)
+ : __istream_type(), _M_filebuf()
+ {
+ this->init(&_M_filebuf);
+ this->open(__s, __mode);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Create an input file stream.
+ * @param s std::string specifying the filename.
+ * @param mode Open file in specified mode (see std::ios_base).
+ *
+ * @c ios_base::in is automatically included in @a mode.
+ */
+ explicit
+ basic_ifstream(const std::string& __s,
+ ios_base::openmode __mode = ios_base::in)
+ : __istream_type(), _M_filebuf()
+ {
+ this->init(&_M_filebuf);
+ this->open(__s, __mode);
+ }
+#endif
+
+ /**
+ * @brief The destructor does nothing.
+ *
+ * The file is closed by the filebuf object, not the formatting
+ * stream.
+ */
+ ~basic_ifstream()
+ { }
+
+ // Members:
+ /**
+ * @brief Accessing the underlying buffer.
+ * @return The current basic_filebuf buffer.
+ *
+ * This hides both signatures of std::basic_ios::rdbuf().
+ */
+ __filebuf_type*
+ rdbuf() const
+ { return const_cast<__filebuf_type*>(&_M_filebuf); }
+
+ /**
+ * @brief Wrapper to test for an open file.
+ * @return @c rdbuf()->is_open()
+ */
+ bool
+ is_open()
+ { return _M_filebuf.is_open(); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 365. Lack of const-qualification in clause 27
+ bool
+ is_open() const
+ { return _M_filebuf.is_open(); }
+
+ /**
+ * @brief Opens an external file.
+ * @param s The name of the file.
+ * @param mode The open mode flags.
+ *
+ * Calls @c std::basic_filebuf::open(s,mode|in). If that function
+ * fails, @c failbit is set in the stream's error state.
+ *
+ * Tip: When using std::string to hold the filename, you must use
+ * .c_str() before passing it to this constructor.
+ */
+ void
+ open(const char* __s, ios_base::openmode __mode = ios_base::in)
+ {
+ if (!_M_filebuf.open(__s, __mode | ios_base::in))
+ this->setstate(ios_base::failbit);
+ else
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 409. Closing an fstream should clear error state
+ this->clear();
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Opens an external file.
+ * @param s The name of the file.
+ * @param mode The open mode flags.
+ *
+ * Calls @c std::basic_filebuf::open(s,mode|in). If that function
+ * fails, @c failbit is set in the stream's error state.
+ */
+ void
+ open(const std::string& __s, ios_base::openmode __mode = ios_base::in)
+ {
+ if (!_M_filebuf.open(__s, __mode | ios_base::in))
+ this->setstate(ios_base::failbit);
+ else
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 409. Closing an fstream should clear error state
+ this->clear();
+ }
+#endif
+
+ /**
+ * @brief Close the file.
+ *
+ * Calls @c std::basic_filebuf::close(). If that function
+ * fails, @c failbit is set in the stream's error state.
+ */
+ void
+ close()
+ {
+ if (!_M_filebuf.close())
+ this->setstate(ios_base::failbit);
+ }
+ };
+
+
+ // [27.8.1.8] Template class basic_ofstream
+ /**
+ * @brief Controlling output for files.
+ * @ingroup io
+ *
+ * This class supports reading from named files, using the inherited
+ * functions from std::basic_ostream. To control the associated
+ * sequence, an instance of std::basic_filebuf is used, which this page
+ * refers to as @c sb.
+ */
+ template<typename _CharT, typename _Traits>
+ class basic_ofstream : public basic_ostream<_CharT,_Traits>
+ {
+ public:
+ // Types:
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ typedef typename traits_type::int_type int_type;
+ typedef typename traits_type::pos_type pos_type;
+ typedef typename traits_type::off_type off_type;
+
+ // Non-standard types:
+ typedef basic_filebuf<char_type, traits_type> __filebuf_type;
+ typedef basic_ostream<char_type, traits_type> __ostream_type;
+
+ private:
+ __filebuf_type _M_filebuf;
+
+ public:
+ // Constructors:
+ /**
+ * @brief Default constructor.
+ *
+ * Initializes @c sb using its default constructor, and passes
+ * @c &sb to the base class initializer. Does not open any files
+ * (you haven't given it a filename to open).
+ */
+ basic_ofstream(): __ostream_type(), _M_filebuf()
+ { this->init(&_M_filebuf); }
+
+ /**
+ * @brief Create an output file stream.
+ * @param s Null terminated string specifying the filename.
+ * @param mode Open file in specified mode (see std::ios_base).
+ *
+ * @c ios_base::out|ios_base::trunc is automatically included in
+ * @a mode.
+ *
+ * Tip: When using std::string to hold the filename, you must use
+ * .c_str() before passing it to this constructor.
+ */
+ explicit
+ basic_ofstream(const char* __s,
+ ios_base::openmode __mode = ios_base::out|ios_base::trunc)
+ : __ostream_type(), _M_filebuf()
+ {
+ this->init(&_M_filebuf);
+ this->open(__s, __mode);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Create an output file stream.
+ * @param s std::string specifying the filename.
+ * @param mode Open file in specified mode (see std::ios_base).
+ *
+ * @c ios_base::out|ios_base::trunc is automatically included in
+ * @a mode.
+ */
+ explicit
+ basic_ofstream(const std::string& __s,
+ ios_base::openmode __mode = ios_base::out|ios_base::trunc)
+ : __ostream_type(), _M_filebuf()
+ {
+ this->init(&_M_filebuf);
+ this->open(__s, __mode);
+ }
+#endif
+
+ /**
+ * @brief The destructor does nothing.
+ *
+ * The file is closed by the filebuf object, not the formatting
+ * stream.
+ */
+ ~basic_ofstream()
+ { }
+
+ // Members:
+ /**
+ * @brief Accessing the underlying buffer.
+ * @return The current basic_filebuf buffer.
+ *
+ * This hides both signatures of std::basic_ios::rdbuf().
+ */
+ __filebuf_type*
+ rdbuf() const
+ { return const_cast<__filebuf_type*>(&_M_filebuf); }
+
+ /**
+ * @brief Wrapper to test for an open file.
+ * @return @c rdbuf()->is_open()
+ */
+ bool
+ is_open()
+ { return _M_filebuf.is_open(); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 365. Lack of const-qualification in clause 27
+ bool
+ is_open() const
+ { return _M_filebuf.is_open(); }
+
+ /**
+ * @brief Opens an external file.
+ * @param s The name of the file.
+ * @param mode The open mode flags.
+ *
+ * Calls @c std::basic_filebuf::open(s,mode|out|trunc). If that
+ * function fails, @c failbit is set in the stream's error state.
+ *
+ * Tip: When using std::string to hold the filename, you must use
+ * .c_str() before passing it to this constructor.
+ */
+ void
+ open(const char* __s,
+ ios_base::openmode __mode = ios_base::out | ios_base::trunc)
+ {
+ if (!_M_filebuf.open(__s, __mode | ios_base::out))
+ this->setstate(ios_base::failbit);
+ else
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 409. Closing an fstream should clear error state
+ this->clear();
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Opens an external file.
+ * @param s The name of the file.
+ * @param mode The open mode flags.
+ *
+ * Calls @c std::basic_filebuf::open(s,mode|out|trunc). If that
+ * function fails, @c failbit is set in the stream's error state.
+ */
+ void
+ open(const std::string& __s,
+ ios_base::openmode __mode = ios_base::out | ios_base::trunc)
+ {
+ if (!_M_filebuf.open(__s, __mode | ios_base::out))
+ this->setstate(ios_base::failbit);
+ else
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 409. Closing an fstream should clear error state
+ this->clear();
+ }
+#endif
+
+ /**
+ * @brief Close the file.
+ *
+ * Calls @c std::basic_filebuf::close(). If that function
+ * fails, @c failbit is set in the stream's error state.
+ */
+ void
+ close()
+ {
+ if (!_M_filebuf.close())
+ this->setstate(ios_base::failbit);
+ }
+ };
+
+
+ // [27.8.1.11] Template class basic_fstream
+ /**
+ * @brief Controlling input and output for files.
+ * @ingroup io
+ *
+ * This class supports reading from and writing to named files, using
+ * the inherited functions from std::basic_iostream. To control the
+ * associated sequence, an instance of std::basic_filebuf is used, which
+ * this page refers to as @c sb.
+ */
+ template<typename _CharT, typename _Traits>
+ class basic_fstream : public basic_iostream<_CharT, _Traits>
+ {
+ public:
+ // Types:
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ typedef typename traits_type::int_type int_type;
+ typedef typename traits_type::pos_type pos_type;
+ typedef typename traits_type::off_type off_type;
+
+ // Non-standard types:
+ typedef basic_filebuf<char_type, traits_type> __filebuf_type;
+ typedef basic_ios<char_type, traits_type> __ios_type;
+ typedef basic_iostream<char_type, traits_type> __iostream_type;
+
+ private:
+ __filebuf_type _M_filebuf;
+
+ public:
+ // Constructors/destructor:
+ /**
+ * @brief Default constructor.
+ *
+ * Initializes @c sb using its default constructor, and passes
+ * @c &sb to the base class initializer. Does not open any files
+ * (you haven't given it a filename to open).
+ */
+ basic_fstream()
+ : __iostream_type(), _M_filebuf()
+ { this->init(&_M_filebuf); }
+
+ /**
+ * @brief Create an input/output file stream.
+ * @param s Null terminated string specifying the filename.
+ * @param mode Open file in specified mode (see std::ios_base).
+ *
+ * Tip: When using std::string to hold the filename, you must use
+ * .c_str() before passing it to this constructor.
+ */
+ explicit
+ basic_fstream(const char* __s,
+ ios_base::openmode __mode = ios_base::in | ios_base::out)
+ : __iostream_type(NULL), _M_filebuf()
+ {
+ this->init(&_M_filebuf);
+ this->open(__s, __mode);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Create an input/output file stream.
+ * @param s Null terminated string specifying the filename.
+ * @param mode Open file in specified mode (see std::ios_base).
+ */
+ explicit
+ basic_fstream(const std::string& __s,
+ ios_base::openmode __mode = ios_base::in | ios_base::out)
+ : __iostream_type(NULL), _M_filebuf()
+ {
+ this->init(&_M_filebuf);
+ this->open(__s, __mode);
+ }
+#endif
+
+ /**
+ * @brief The destructor does nothing.
+ *
+ * The file is closed by the filebuf object, not the formatting
+ * stream.
+ */
+ ~basic_fstream()
+ { }
+
+ // Members:
+ /**
+ * @brief Accessing the underlying buffer.
+ * @return The current basic_filebuf buffer.
+ *
+ * This hides both signatures of std::basic_ios::rdbuf().
+ */
+ __filebuf_type*
+ rdbuf() const
+ { return const_cast<__filebuf_type*>(&_M_filebuf); }
+
+ /**
+ * @brief Wrapper to test for an open file.
+ * @return @c rdbuf()->is_open()
+ */
+ bool
+ is_open()
+ { return _M_filebuf.is_open(); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 365. Lack of const-qualification in clause 27
+ bool
+ is_open() const
+ { return _M_filebuf.is_open(); }
+
+ /**
+ * @brief Opens an external file.
+ * @param s The name of the file.
+ * @param mode The open mode flags.
+ *
+ * Calls @c std::basic_filebuf::open(s,mode). If that
+ * function fails, @c failbit is set in the stream's error state.
+ *
+ * Tip: When using std::string to hold the filename, you must use
+ * .c_str() before passing it to this constructor.
+ */
+ void
+ open(const char* __s,
+ ios_base::openmode __mode = ios_base::in | ios_base::out)
+ {
+ if (!_M_filebuf.open(__s, __mode))
+ this->setstate(ios_base::failbit);
+ else
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 409. Closing an fstream should clear error state
+ this->clear();
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Opens an external file.
+ * @param s The name of the file.
+ * @param mode The open mode flags.
+ *
+ * Calls @c std::basic_filebuf::open(s,mode). If that
+ * function fails, @c failbit is set in the stream's error state.
+ */
+ void
+ open(const std::string& __s,
+ ios_base::openmode __mode = ios_base::in | ios_base::out)
+ {
+ if (!_M_filebuf.open(__s, __mode))
+ this->setstate(ios_base::failbit);
+ else
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 409. Closing an fstream should clear error state
+ this->clear();
+ }
+#endif
+
+ /**
+ * @brief Close the file.
+ *
+ * Calls @c std::basic_filebuf::close(). If that function
+ * fails, @c failbit is set in the stream's error state.
+ */
+ void
+ close()
+ {
+ if (!_M_filebuf.close())
+ this->setstate(ios_base::failbit);
+ }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <bits/fstream.tcc>
+#endif
+
+#endif /* _GLIBCXX_FSTREAM */
diff --git a/i686-linux/include/c++/4.4.3/functional b/i686-linux/include/c++/4.4.3/functional
new file mode 100644
index 0000000..8f4f42c
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/functional
@@ -0,0 +1,78 @@
+// <functional> -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ */
+
+/** @file include/functional
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_FUNCTIONAL
+#define _GLIBCXX_FUNCTIONAL 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <bits/stl_function.h>
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+# endif
+# include <typeinfo>
+# include <new>
+# include <tuple>
+# include <type_traits>
+# include <bits/stringfwd.h>
+# include <bits/functional_hash.h>
+# include <ext/type_traits.h>
+# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/functional>
+# else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/functional>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+# endif
+#endif
+
+#endif // _GLIBCXX_FUNCTIONAL
diff --git a/i686-linux/include/c++/4.4.3/i686-linux/bits/atomic_word.h b/i686-linux/include/c++/4.4.3/i686-linux/bits/atomic_word.h
new file mode 100644
index 0000000..f2bdbbc
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/i686-linux/bits/atomic_word.h
@@ -0,0 +1,47 @@
+// Low-level type for atomic operations -*- C++ -*-
+
+// Copyright (C) 2004, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file atomic_word.h
+ * This file is a GNU extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_ATOMIC_WORD_H
+#define _GLIBCXX_ATOMIC_WORD_H 1
+
+typedef int _Atomic_word;
+
+// Define these two macros using the appropriate memory barrier for the target.
+// The commented out versions below are the defaults.
+// See ia64/atomic_word.h for an alternative approach.
+
+// This one prevents loads from being hoisted across the barrier;
+// in other words, this is a Load-Load acquire barrier.
+// This is necessary iff TARGET_RELAXED_ORDERING is defined in tm.h.
+// #define _GLIBCXX_READ_MEM_BARRIER __asm __volatile ("":::"memory")
+
+// This one prevents stores from being sunk across the barrier; in other
+// words, a Store-Store release barrier.
+// #define _GLIBCXX_WRITE_MEM_BARRIER __asm __volatile ("":::"memory")
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/i686-linux/bits/basic_file.h b/i686-linux/include/c++/4.4.3/i686-linux/bits/basic_file.h
new file mode 100644
index 0000000..eedb73b
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/i686-linux/bits/basic_file.h
@@ -0,0 +1,108 @@
+// Wrapper of C-language FILE struct -*- C++ -*-
+
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+//
+// ISO C++ 14882: 27.8 File-based streams
+//
+
+/** @file basic_file.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _GLIBCXX_BASIC_FILE_STDIO_H
+#define _GLIBCXX_BASIC_FILE_STDIO_H 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <bits/c++io.h> // for __c_lock and __c_file
+#include <ios>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // Generic declaration.
+ template<typename _CharT>
+ class __basic_file;
+
+ // Specialization.
+ template<>
+ class __basic_file<char>
+ {
+ // Underlying data source/sink.
+ __c_file* _M_cfile;
+
+ // True iff we opened _M_cfile, and thus must close it ourselves.
+ bool _M_cfile_created;
+
+ public:
+ __basic_file(__c_lock* __lock = 0);
+
+ __basic_file*
+ open(const char* __name, ios_base::openmode __mode, int __prot = 0664);
+
+ __basic_file*
+ sys_open(__c_file* __file, ios_base::openmode);
+
+ __basic_file*
+ sys_open(int __fd, ios_base::openmode __mode);
+
+ __basic_file*
+ close();
+
+ bool
+ is_open() const;
+
+ int
+ fd();
+
+ __c_file*
+ file();
+
+ ~__basic_file();
+
+ streamsize
+ xsputn(const char* __s, streamsize __n);
+
+ streamsize
+ xsputn_2(const char* __s1, streamsize __n1,
+ const char* __s2, streamsize __n2);
+
+ streamsize
+ xsgetn(char* __s, streamsize __n);
+
+ streamoff
+ seekoff(streamoff __off, ios_base::seekdir __way);
+
+ int
+ sync();
+
+ streamsize
+ showmanyc();
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/i686-linux/bits/c++allocator.h b/i686-linux/include/c++/4.4.3/i686-linux/bits/c++allocator.h
new file mode 100644
index 0000000..c33a124
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/i686-linux/bits/c++allocator.h
@@ -0,0 +1,37 @@
+// Base to std::allocator -*- C++ -*-
+
+// Copyright (C) 2004, 2005, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file c++allocator.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _GLIBCXX_CXX_ALLOCATOR_H
+#define _GLIBCXX_CXX_ALLOCATOR_H 1
+
+// Define new_allocator as the base class to std::allocator.
+#include <ext/new_allocator.h>
+#define __glibcxx_base_allocator __gnu_cxx::new_allocator
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/i686-linux/bits/c++config.h b/i686-linux/include/c++/4.4.3/i686-linux/bits/c++config.h
new file mode 100644
index 0000000..21b344c
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/i686-linux/bits/c++config.h
@@ -0,0 +1,1431 @@
+// Predefined symbols and macros -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file c++config.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _GLIBCXX_CXX_CONFIG_H
+#define _GLIBCXX_CXX_CONFIG_H 1
+
+// The current version of the C++ library in compressed ISO date format.
+#define __GLIBCXX__ 20100121
+
+// Macros for visibility.
+// _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
+// _GLIBCXX_VISIBILITY_ATTR
+# define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY 1
+
+#if _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
+# define _GLIBCXX_VISIBILITY_ATTR(V) __attribute__ ((__visibility__ (#V)))
+#else
+# define _GLIBCXX_VISIBILITY_ATTR(V)
+#endif
+
+// Macros for deprecated.
+// _GLIBCXX_DEPRECATED
+// _GLIBCXX_DEPRECATED_ATTR
+#ifndef _GLIBCXX_DEPRECATED
+# define _GLIBCXX_DEPRECATED 1
+#endif
+
+#if defined(__DEPRECATED) && defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define _GLIBCXX_DEPRECATED_ATTR __attribute__ ((__deprecated__))
+#else
+# define _GLIBCXX_DEPRECATED_ATTR
+#endif
+
+// Macros for activating various namespace association modes.
+// _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
+// _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL
+// _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
+
+// Guide to libstdc++ namespaces.
+/*
+ namespace std
+ {
+ namespace __debug { }
+ namespace __parallel { }
+ namespace __norm { } // __normative, __shadow, __replaced
+ namespace __cxx1998 { }
+
+ namespace tr1 { }
+ }
+*/
+#if __cplusplus
+
+#ifdef _GLIBCXX_DEBUG
+# define _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG 1
+#endif
+
+#ifdef _GLIBCXX_PARALLEL
+# define _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL 1
+#endif
+
+# define _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION 0
+
+// Defined if any namespace association modes are active.
+#if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG \
+ || _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL \
+ || _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
+# define _GLIBCXX_USE_NAMESPACE_ASSOCIATION 1
+#endif
+
+// Macros for namespace scope. Either namespace std:: or the name
+// of some nested namespace within it.
+// _GLIBCXX_STD
+// _GLIBCXX_STD_D
+// _GLIBCXX_STD_P
+//
+// Macros for enclosing namespaces and possibly nested namespaces.
+// _GLIBCXX_BEGIN_NAMESPACE
+// _GLIBCXX_END_NAMESPACE
+// _GLIBCXX_BEGIN_NESTED_NAMESPACE
+// _GLIBCXX_END_NESTED_NAMESPACE
+#ifndef _GLIBCXX_USE_NAMESPACE_ASSOCIATION
+# define _GLIBCXX_STD_D _GLIBCXX_STD
+# define _GLIBCXX_STD_P _GLIBCXX_STD
+# define _GLIBCXX_STD std
+# define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y) _GLIBCXX_BEGIN_NAMESPACE(X)
+# define _GLIBCXX_END_NESTED_NAMESPACE _GLIBCXX_END_NAMESPACE
+# define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) {
+# define _GLIBCXX_END_NAMESPACE }
+#else
+
+# if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION // && not anything else
+# define _GLIBCXX_STD_D _GLIBCXX_STD
+# define _GLIBCXX_STD_P _GLIBCXX_STD
+# define _GLIBCXX_STD _6
+# define _GLIBCXX_BEGIN_NAMESPACE(X) _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, _6)
+# define _GLIBCXX_END_NAMESPACE _GLIBCXX_END_NESTED_NAMESPACE
+# endif
+
+// debug
+# if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG && !_GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL
+# define _GLIBCXX_STD_D __norm
+# define _GLIBCXX_STD_P _GLIBCXX_STD
+# define _GLIBCXX_STD __cxx1998
+# define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) {
+# define _GLIBCXX_END_NAMESPACE }
+# define _GLIBCXX_EXTERN_TEMPLATE -1
+# endif
+
+// parallel
+# if _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL && !_GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
+# define _GLIBCXX_STD_D _GLIBCXX_STD
+# define _GLIBCXX_STD_P __norm
+# define _GLIBCXX_STD __cxx1998
+# define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) {
+# define _GLIBCXX_END_NAMESPACE }
+# define _GLIBCXX_EXTERN_TEMPLATE -1
+# endif
+
+// debug + parallel
+# if _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL && _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
+# define _GLIBCXX_STD_D __norm
+# define _GLIBCXX_STD_P __norm
+# define _GLIBCXX_STD __cxx1998
+# define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) {
+# define _GLIBCXX_END_NAMESPACE }
+# define _GLIBCXX_EXTERN_TEMPLATE -1
+# endif
+
+# if __NO_INLINE__ && !__GXX_WEAK__
+# warning currently using namespace associated mode which may fail \
+ without inlining due to lack of weak symbols
+# endif
+
+# define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y) namespace X { namespace Y _GLIBCXX_VISIBILITY_ATTR(default) {
+# define _GLIBCXX_END_NESTED_NAMESPACE } }
+#endif
+
+// Namespace associations for debug mode.
+#if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
+namespace std
+{
+ namespace __norm { }
+ inline namespace __debug { }
+ inline namespace __cxx1998 { }
+}
+#endif
+
+// Namespace associations for parallel mode.
+#if _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL
+namespace std
+{
+ namespace __norm { }
+ inline namespace __parallel { }
+ inline namespace __cxx1998 { }
+}
+#endif
+
+// Namespace associations for versioning mode.
+#if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
+namespace std
+{
+ inline namespace _6 { }
+}
+
+namespace __gnu_cxx
+{
+ inline namespace _6 { }
+}
+
+namespace std
+{
+ namespace tr1
+ {
+ inline namespace _6 { }
+ }
+}
+#endif
+
+// XXX GLIBCXX_ABI Deprecated
+// Define if compatibility should be provided for -mlong-double-64
+#undef _GLIBCXX_LONG_DOUBLE_COMPAT
+
+// Namespace associations for long double 128 mode.
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
+namespace std
+{
+ inline namespace __gnu_cxx_ldbl128 { }
+}
+# define _GLIBCXX_LDBL_NAMESPACE __gnu_cxx_ldbl128::
+# define _GLIBCXX_BEGIN_LDBL_NAMESPACE namespace __gnu_cxx_ldbl128 {
+# define _GLIBCXX_END_LDBL_NAMESPACE }
+#else
+# define _GLIBCXX_LDBL_NAMESPACE
+# define _GLIBCXX_BEGIN_LDBL_NAMESPACE
+# define _GLIBCXX_END_LDBL_NAMESPACE
+#endif
+
+
+// Defines for C compatibility. In particular, define extern "C"
+// linkage only when using C++.
+# define _GLIBCXX_BEGIN_EXTERN_C extern "C" {
+# define _GLIBCXX_END_EXTERN_C }
+
+#else // !__cplusplus
+# undef _GLIBCXX_BEGIN_NAMESPACE
+# undef _GLIBCXX_END_NAMESPACE
+# define _GLIBCXX_BEGIN_NAMESPACE(X)
+# define _GLIBCXX_END_NAMESPACE
+# define _GLIBCXX_BEGIN_EXTERN_C
+# define _GLIBCXX_END_EXTERN_C
+#endif
+
+// First includes.
+
+// Pick up any OS-specific definitions.
+#include <bits/os_defines.h>
+
+// Pick up any CPU-specific definitions.
+#include <bits/cpu_defines.h>
+
+// Allow use of "export template." This is currently not a feature
+// that g++ supports.
+// #define _GLIBCXX_EXPORT_TEMPLATE 1
+
+// Allow use of the GNU syntax extension, "extern template." This
+// extension is fully documented in the g++ manual, but in a nutshell,
+// it inhibits all implicit instantiations and is used throughout the
+// library to avoid multiple weak definitions for required types that
+// are already explicitly instantiated in the library binary. This
+// substantially reduces the binary size of resulting executables.
+#ifndef _GLIBCXX_EXTERN_TEMPLATE
+# define _GLIBCXX_EXTERN_TEMPLATE 1
+#endif
+
+// Certain function definitions that are meant to be overridable from
+// user code are decorated with this macro. For some targets, this
+// macro causes these definitions to be weak.
+#ifndef _GLIBCXX_WEAK_DEFINITION
+# define _GLIBCXX_WEAK_DEFINITION
+#endif
+
+// Assert.
+// Avoid the use of assert, because we're trying to keep the <cassert>
+// include out of the mix.
+#if !defined(_GLIBCXX_DEBUG) && !defined(_GLIBCXX_PARALLEL)
+#define __glibcxx_assert(_Condition)
+#else
+_GLIBCXX_BEGIN_NAMESPACE(std)
+ // Avoid the use of assert, because we're trying to keep the <cassert>
+ // include out of the mix.
+ inline void
+ __replacement_assert(const char* __file, int __line,
+ const char* __function, const char* __condition)
+ {
+ __builtin_printf("%s:%d: %s: Assertion '%s' failed.\n", __file, __line,
+ __function, __condition);
+ __builtin_abort();
+ }
+_GLIBCXX_END_NAMESPACE
+
+#define __glibcxx_assert(_Condition) \
+ do \
+ { \
+ if (! (_Condition)) \
+ std::__replacement_assert(__FILE__, __LINE__, \
+ __PRETTY_FUNCTION__, #_Condition); \
+ } while (false)
+#endif
+
+// The remainder of the prewritten config is automatic; all the
+// user hooks are listed above.
+
+// Create a boolean flag to be used to determine if --fast-math is set.
+#ifdef __FAST_MATH__
+# define _GLIBCXX_FAST_MATH 1
+#else
+# define _GLIBCXX_FAST_MATH 0
+#endif
+
+// This marks string literals in header files to be extracted for eventual
+// translation. It is primarily used for messages in thrown exceptions; see
+// src/functexcept.cc. We use __N because the more traditional _N is used
+// for something else under certain OSes (see BADNAMES).
+#define __N(msgid) (msgid)
+
+// For example, <windows.h> is known to #define min and max as macros...
+#undef min
+#undef max
+
+// End of prewritten config; the discovered settings follow.
+/* config.h. Generated by configure. */
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define to 1 if you have the `acosf' function. */
+#define _GLIBCXX_HAVE_ACOSF 1
+
+/* Define to 1 if you have the `acosl' function. */
+#define _GLIBCXX_HAVE_ACOSL 1
+
+/* Define to 1 if you have the `asinf' function. */
+#define _GLIBCXX_HAVE_ASINF 1
+
+/* Define to 1 if you have the `asinl' function. */
+#define _GLIBCXX_HAVE_ASINL 1
+
+/* Define to 1 if the target assembler supports .symver directive. */
+#define _GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE 1
+
+/* Define to 1 if you have the `atan2f' function. */
+#define _GLIBCXX_HAVE_ATAN2F 1
+
+/* Define to 1 if you have the `atan2l' function. */
+#define _GLIBCXX_HAVE_ATAN2L 1
+
+/* Define to 1 if you have the `atanf' function. */
+#define _GLIBCXX_HAVE_ATANF 1
+
+/* Define to 1 if you have the `atanl' function. */
+#define _GLIBCXX_HAVE_ATANL 1
+
+/* Define to 1 if the target assembler supports thread-local storage. */
+/* #undef _GLIBCXX_HAVE_CC_TLS */
+
+/* Define to 1 if you have the `ceilf' function. */
+#define _GLIBCXX_HAVE_CEILF 1
+
+/* Define to 1 if you have the `ceill' function. */
+#define _GLIBCXX_HAVE_CEILL 1
+
+/* Define to 1 if you have the <complex.h> header file. */
+#define _GLIBCXX_HAVE_COMPLEX_H 1
+
+/* Define to 1 if you have the `cosf' function. */
+#define _GLIBCXX_HAVE_COSF 1
+
+/* Define to 1 if you have the `coshf' function. */
+#define _GLIBCXX_HAVE_COSHF 1
+
+/* Define to 1 if you have the `coshl' function. */
+#define _GLIBCXX_HAVE_COSHL 1
+
+/* Define to 1 if you have the `cosl' function. */
+#define _GLIBCXX_HAVE_COSL 1
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define _GLIBCXX_HAVE_DLFCN_H 1
+
+/* Define if EBADMSG exists. */
+#define _GLIBCXX_HAVE_EBADMSG 1
+
+/* Define if ECANCELED exists. */
+#define _GLIBCXX_HAVE_ECANCELED 1
+
+/* Define if EIDRM exists. */
+#define _GLIBCXX_HAVE_EIDRM 1
+
+/* Define to 1 if you have the <endian.h> header file. */
+#define _GLIBCXX_HAVE_ENDIAN_H 1
+
+/* Define if ENODATA exists. */
+#define _GLIBCXX_HAVE_ENODATA 1
+
+/* Define if ENOLINK exists. */
+#define _GLIBCXX_HAVE_ENOLINK 1
+
+/* Define if ENOSR exists. */
+#define _GLIBCXX_HAVE_ENOSR 1
+
+/* Define if ENOSTR exists. */
+#define _GLIBCXX_HAVE_ENOSTR 1
+
+/* Define if ENOTRECOVERABLE exists. */
+#define _GLIBCXX_HAVE_ENOTRECOVERABLE 1
+
+/* Define if ENOTSUP exists. */
+#define _GLIBCXX_HAVE_ENOTSUP 1
+
+/* Define if EOVERFLOW exists. */
+#define _GLIBCXX_HAVE_EOVERFLOW 1
+
+/* Define if EOWNERDEAD exists. */
+#define _GLIBCXX_HAVE_EOWNERDEAD 1
+
+/* Define if EPROTO exists. */
+#define _GLIBCXX_HAVE_EPROTO 1
+
+/* Define if ETIME exists. */
+#define _GLIBCXX_HAVE_ETIME 1
+
+/* Define if ETXTBSY exists. */
+#define _GLIBCXX_HAVE_ETXTBSY 1
+
+/* Define to 1 if you have the `expf' function. */
+#define _GLIBCXX_HAVE_EXPF 1
+
+/* Define to 1 if you have the `expl' function. */
+#define _GLIBCXX_HAVE_EXPL 1
+
+/* Define to 1 if you have the `fabsf' function. */
+#define _GLIBCXX_HAVE_FABSF 1
+
+/* Define to 1 if you have the `fabsl' function. */
+#define _GLIBCXX_HAVE_FABSL 1
+
+/* Define to 1 if you have the <fenv.h> header file. */
+#define _GLIBCXX_HAVE_FENV_H 1
+
+/* Define to 1 if you have the `finite' function. */
+#define _GLIBCXX_HAVE_FINITE 1
+
+/* Define to 1 if you have the `finitef' function. */
+#define _GLIBCXX_HAVE_FINITEF 1
+
+/* Define to 1 if you have the `finitel' function. */
+#define _GLIBCXX_HAVE_FINITEL 1
+
+/* Define to 1 if you have the <float.h> header file. */
+#define _GLIBCXX_HAVE_FLOAT_H 1
+
+/* Define to 1 if you have the `floorf' function. */
+#define _GLIBCXX_HAVE_FLOORF 1
+
+/* Define to 1 if you have the `floorl' function. */
+#define _GLIBCXX_HAVE_FLOORL 1
+
+/* Define to 1 if you have the `fmodf' function. */
+#define _GLIBCXX_HAVE_FMODF 1
+
+/* Define to 1 if you have the `fmodl' function. */
+#define _GLIBCXX_HAVE_FMODL 1
+
+/* Define to 1 if you have the `fpclass' function. */
+/* #undef _GLIBCXX_HAVE_FPCLASS */
+
+/* Define to 1 if you have the <fp.h> header file. */
+/* #undef _GLIBCXX_HAVE_FP_H */
+
+/* Define to 1 if you have the `frexpf' function. */
+#define _GLIBCXX_HAVE_FREXPF 1
+
+/* Define to 1 if you have the `frexpl' function. */
+#define _GLIBCXX_HAVE_FREXPL 1
+
+/* Define if _Unwind_GetIPInfo is available. */
+#define _GLIBCXX_HAVE_GETIPINFO 1
+
+/* Define if gthr-default.h exists (meaning that threading support is
+ enabled). */
+#define _GLIBCXX_HAVE_GTHR_DEFAULT 1
+
+/* Define to 1 if you have the `hypot' function. */
+#define _GLIBCXX_HAVE_HYPOT 1
+
+/* Define to 1 if you have the `hypotf' function. */
+#define _GLIBCXX_HAVE_HYPOTF 1
+
+/* Define to 1 if you have the `hypotl' function. */
+#define _GLIBCXX_HAVE_HYPOTL 1
+
+/* Define if you have the iconv() function. */
+#define _GLIBCXX_HAVE_ICONV 1
+
+/* Define to 1 if you have the <ieeefp.h> header file. */
+/* #undef _GLIBCXX_HAVE_IEEEFP_H */
+
+/* Define if int64_t is available in <stdint.h>. */
+#define _GLIBCXX_HAVE_INT64_T 1
+
+/* Define if int64_t is a long. */
+/* #undef _GLIBCXX_HAVE_INT64_T_LONG */
+
+/* Define if int64_t is a long long. */
+#define _GLIBCXX_HAVE_INT64_T_LONG_LONG 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define _GLIBCXX_HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the `isinf' function. */
+#define _GLIBCXX_HAVE_ISINF 1
+
+/* Define to 1 if you have the `isinff' function. */
+#define _GLIBCXX_HAVE_ISINFF 1
+
+/* Define to 1 if you have the `isinfl' function. */
+#define _GLIBCXX_HAVE_ISINFL 1
+
+/* Define to 1 if you have the `isnan' function. */
+#define _GLIBCXX_HAVE_ISNAN 1
+
+/* Define to 1 if you have the `isnanf' function. */
+#define _GLIBCXX_HAVE_ISNANF 1
+
+/* Define to 1 if you have the `isnanl' function. */
+#define _GLIBCXX_HAVE_ISNANL 1
+
+/* Defined if iswblank exists. */
+#define _GLIBCXX_HAVE_ISWBLANK 1
+
+/* Define if LC_MESSAGES is available in <locale.h>. */
+#define _GLIBCXX_HAVE_LC_MESSAGES 1
+
+/* Define to 1 if you have the `ldexpf' function. */
+#define _GLIBCXX_HAVE_LDEXPF 1
+
+/* Define to 1 if you have the `ldexpl' function. */
+#define _GLIBCXX_HAVE_LDEXPL 1
+
+/* Define to 1 if you have the <libintl.h> header file. */
+/* #undef _GLIBCXX_HAVE_LIBINTL_H */
+
+/* Only used in build directory testsuite_hooks.h. */
+/* #undef _GLIBCXX_HAVE_LIMIT_AS */
+
+/* Only used in build directory testsuite_hooks.h. */
+/* #undef _GLIBCXX_HAVE_LIMIT_DATA */
+
+/* Only used in build directory testsuite_hooks.h. */
+/* #undef _GLIBCXX_HAVE_LIMIT_FSIZE */
+
+/* Only used in build directory testsuite_hooks.h. */
+/* #undef _GLIBCXX_HAVE_LIMIT_RSS */
+
+/* Only used in build directory testsuite_hooks.h. */
+/* #undef _GLIBCXX_HAVE_LIMIT_VMEM */
+
+/* Define if futex syscall is available. */
+#define _GLIBCXX_HAVE_LINUX_FUTEX 1
+
+/* Define to 1 if you have the <locale.h> header file. */
+#define _GLIBCXX_HAVE_LOCALE_H 1
+
+/* Define to 1 if you have the `log10f' function. */
+#define _GLIBCXX_HAVE_LOG10F 1
+
+/* Define to 1 if you have the `log10l' function. */
+#define _GLIBCXX_HAVE_LOG10L 1
+
+/* Define to 1 if you have the `logf' function. */
+#define _GLIBCXX_HAVE_LOGF 1
+
+/* Define to 1 if you have the `logl' function. */
+#define _GLIBCXX_HAVE_LOGL 1
+
+/* Define to 1 if you have the <machine/endian.h> header file. */
+/* #undef _GLIBCXX_HAVE_MACHINE_ENDIAN_H */
+
+/* Define to 1 if you have the <machine/param.h> header file. */
+/* #undef _GLIBCXX_HAVE_MACHINE_PARAM_H */
+
+/* Define if mbstate_t exists in wchar.h. */
+#define _GLIBCXX_HAVE_MBSTATE_T 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define _GLIBCXX_HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `modf' function. */
+#define _GLIBCXX_HAVE_MODF 1
+
+/* Define to 1 if you have the `modff' function. */
+#define _GLIBCXX_HAVE_MODFF 1
+
+/* Define to 1 if you have the `modfl' function. */
+#define _GLIBCXX_HAVE_MODFL 1
+
+/* Define to 1 if you have the <nan.h> header file. */
+/* #undef _GLIBCXX_HAVE_NAN_H */
+
+/* Define if poll is available in <poll.h>. */
+#define _GLIBCXX_HAVE_POLL 1
+
+/* Define to 1 if you have the `powf' function. */
+#define _GLIBCXX_HAVE_POWF 1
+
+/* Define to 1 if you have the `powl' function. */
+#define _GLIBCXX_HAVE_POWL 1
+
+/* Define to 1 if you have the `qfpclass' function. */
+/* #undef _GLIBCXX_HAVE_QFPCLASS */
+
+/* Define to 1 if you have the `setenv' function. */
+/* #undef _GLIBCXX_HAVE_SETENV */
+
+/* Define to 1 if you have the `sincos' function. */
+#define _GLIBCXX_HAVE_SINCOS 1
+
+/* Define to 1 if you have the `sincosf' function. */
+#define _GLIBCXX_HAVE_SINCOSF 1
+
+/* Define to 1 if you have the `sincosl' function. */
+#define _GLIBCXX_HAVE_SINCOSL 1
+
+/* Define to 1 if you have the `sinf' function. */
+#define _GLIBCXX_HAVE_SINF 1
+
+/* Define to 1 if you have the `sinhf' function. */
+#define _GLIBCXX_HAVE_SINHF 1
+
+/* Define to 1 if you have the `sinhl' function. */
+#define _GLIBCXX_HAVE_SINHL 1
+
+/* Define to 1 if you have the `sinl' function. */
+#define _GLIBCXX_HAVE_SINL 1
+
+/* Define to 1 if you have the `sqrtf' function. */
+#define _GLIBCXX_HAVE_SQRTF 1
+
+/* Define to 1 if you have the `sqrtl' function. */
+#define _GLIBCXX_HAVE_SQRTL 1
+
+/* Define to 1 if you have the <stdbool.h> header file. */
+#define _GLIBCXX_HAVE_STDBOOL_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define _GLIBCXX_HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define _GLIBCXX_HAVE_STDLIB_H 1
+
+/* Define if strerror_l is available in <string.h>. */
+#define _GLIBCXX_HAVE_STRERROR_L 1
+
+/* Define if strerror_r is available in <string.h>. */
+#define _GLIBCXX_HAVE_STRERROR_R 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define _GLIBCXX_HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define _GLIBCXX_HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strtof' function. */
+#define _GLIBCXX_HAVE_STRTOF 1
+
+/* Define to 1 if you have the `strtold' function. */
+#define _GLIBCXX_HAVE_STRTOLD 1
+
+/* Define if strxfrm_l is available in <string.h>. */
+#define _GLIBCXX_HAVE_STRXFRM_L 1
+
+/* Define to 1 if you have the <sys/filio.h> header file. */
+/* #undef _GLIBCXX_HAVE_SYS_FILIO_H */
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#define _GLIBCXX_HAVE_SYS_IOCTL_H 1
+
+/* Define to 1 if you have the <sys/ipc.h> header file. */
+#define _GLIBCXX_HAVE_SYS_IPC_H 1
+
+/* Define to 1 if you have the <sys/isa_defs.h> header file. */
+/* #undef _GLIBCXX_HAVE_SYS_ISA_DEFS_H */
+
+/* Define to 1 if you have the <sys/machine.h> header file. */
+/* #undef _GLIBCXX_HAVE_SYS_MACHINE_H */
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#define _GLIBCXX_HAVE_SYS_PARAM_H 1
+
+/* Define to 1 if you have the <sys/resource.h> header file. */
+#define _GLIBCXX_HAVE_SYS_RESOURCE_H 1
+
+/* Define to 1 if you have the <sys/sem.h> header file. */
+#define _GLIBCXX_HAVE_SYS_SEM_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define _GLIBCXX_HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#define _GLIBCXX_HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define _GLIBCXX_HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <sys/uio.h> header file. */
+#define _GLIBCXX_HAVE_SYS_UIO_H 1
+
+/* Define if S_IFREG is available in <sys/stat.h>. */
+/* #undef _GLIBCXX_HAVE_S_IFREG */
+
+/* Define if S_IFREG is available in <sys/stat.h>. */
+#define _GLIBCXX_HAVE_S_ISREG 1
+
+/* Define to 1 if you have the `tanf' function. */
+#define _GLIBCXX_HAVE_TANF 1
+
+/* Define to 1 if you have the `tanhf' function. */
+#define _GLIBCXX_HAVE_TANHF 1
+
+/* Define to 1 if you have the `tanhl' function. */
+#define _GLIBCXX_HAVE_TANHL 1
+
+/* Define to 1 if you have the `tanl' function. */
+#define _GLIBCXX_HAVE_TANL 1
+
+/* Define to 1 if you have the <tgmath.h> header file. */
+#define _GLIBCXX_HAVE_TGMATH_H 1
+
+/* Define to 1 if the target supports thread-local storage. */
+#define _GLIBCXX_HAVE_TLS 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define _GLIBCXX_HAVE_UNISTD_H 1
+
+/* Defined if vfwscanf exists. */
+#define _GLIBCXX_HAVE_VFWSCANF 1
+
+/* Defined if vswscanf exists. */
+#define _GLIBCXX_HAVE_VSWSCANF 1
+
+/* Defined if vwscanf exists. */
+#define _GLIBCXX_HAVE_VWSCANF 1
+
+/* Define to 1 if you have the <wchar.h> header file. */
+#define _GLIBCXX_HAVE_WCHAR_H 1
+
+/* Defined if wcstof exists. */
+#define _GLIBCXX_HAVE_WCSTOF 1
+
+/* Define to 1 if you have the <wctype.h> header file. */
+#define _GLIBCXX_HAVE_WCTYPE_H 1
+
+/* Define if writev is available in <sys/uio.h>. */
+#define _GLIBCXX_HAVE_WRITEV 1
+
+/* Define to 1 if you have the `_acosf' function. */
+/* #undef _GLIBCXX_HAVE__ACOSF */
+
+/* Define to 1 if you have the `_acosl' function. */
+/* #undef _GLIBCXX_HAVE__ACOSL */
+
+/* Define to 1 if you have the `_asinf' function. */
+/* #undef _GLIBCXX_HAVE__ASINF */
+
+/* Define to 1 if you have the `_asinl' function. */
+/* #undef _GLIBCXX_HAVE__ASINL */
+
+/* Define to 1 if you have the `_atan2f' function. */
+/* #undef _GLIBCXX_HAVE__ATAN2F */
+
+/* Define to 1 if you have the `_atan2l' function. */
+/* #undef _GLIBCXX_HAVE__ATAN2L */
+
+/* Define to 1 if you have the `_atanf' function. */
+/* #undef _GLIBCXX_HAVE__ATANF */
+
+/* Define to 1 if you have the `_atanl' function. */
+/* #undef _GLIBCXX_HAVE__ATANL */
+
+/* Define to 1 if you have the `_ceilf' function. */
+/* #undef _GLIBCXX_HAVE__CEILF */
+
+/* Define to 1 if you have the `_ceill' function. */
+/* #undef _GLIBCXX_HAVE__CEILL */
+
+/* Define to 1 if you have the `_cosf' function. */
+/* #undef _GLIBCXX_HAVE__COSF */
+
+/* Define to 1 if you have the `_coshf' function. */
+/* #undef _GLIBCXX_HAVE__COSHF */
+
+/* Define to 1 if you have the `_coshl' function. */
+/* #undef _GLIBCXX_HAVE__COSHL */
+
+/* Define to 1 if you have the `_cosl' function. */
+/* #undef _GLIBCXX_HAVE__COSL */
+
+/* Define to 1 if you have the `_expf' function. */
+/* #undef _GLIBCXX_HAVE__EXPF */
+
+/* Define to 1 if you have the `_expl' function. */
+/* #undef _GLIBCXX_HAVE__EXPL */
+
+/* Define to 1 if you have the `_fabsf' function. */
+/* #undef _GLIBCXX_HAVE__FABSF */
+
+/* Define to 1 if you have the `_fabsl' function. */
+/* #undef _GLIBCXX_HAVE__FABSL */
+
+/* Define to 1 if you have the `_finite' function. */
+/* #undef _GLIBCXX_HAVE__FINITE */
+
+/* Define to 1 if you have the `_finitef' function. */
+/* #undef _GLIBCXX_HAVE__FINITEF */
+
+/* Define to 1 if you have the `_finitel' function. */
+/* #undef _GLIBCXX_HAVE__FINITEL */
+
+/* Define to 1 if you have the `_floorf' function. */
+/* #undef _GLIBCXX_HAVE__FLOORF */
+
+/* Define to 1 if you have the `_floorl' function. */
+/* #undef _GLIBCXX_HAVE__FLOORL */
+
+/* Define to 1 if you have the `_fmodf' function. */
+/* #undef _GLIBCXX_HAVE__FMODF */
+
+/* Define to 1 if you have the `_fmodl' function. */
+/* #undef _GLIBCXX_HAVE__FMODL */
+
+/* Define to 1 if you have the `_fpclass' function. */
+/* #undef _GLIBCXX_HAVE__FPCLASS */
+
+/* Define to 1 if you have the `_frexpf' function. */
+/* #undef _GLIBCXX_HAVE__FREXPF */
+
+/* Define to 1 if you have the `_frexpl' function. */
+/* #undef _GLIBCXX_HAVE__FREXPL */
+
+/* Define to 1 if you have the `_hypot' function. */
+/* #undef _GLIBCXX_HAVE__HYPOT */
+
+/* Define to 1 if you have the `_hypotf' function. */
+/* #undef _GLIBCXX_HAVE__HYPOTF */
+
+/* Define to 1 if you have the `_hypotl' function. */
+/* #undef _GLIBCXX_HAVE__HYPOTL */
+
+/* Define to 1 if you have the `_isinf' function. */
+/* #undef _GLIBCXX_HAVE__ISINF */
+
+/* Define to 1 if you have the `_isinff' function. */
+/* #undef _GLIBCXX_HAVE__ISINFF */
+
+/* Define to 1 if you have the `_isinfl' function. */
+/* #undef _GLIBCXX_HAVE__ISINFL */
+
+/* Define to 1 if you have the `_isnan' function. */
+/* #undef _GLIBCXX_HAVE__ISNAN */
+
+/* Define to 1 if you have the `_isnanf' function. */
+/* #undef _GLIBCXX_HAVE__ISNANF */
+
+/* Define to 1 if you have the `_isnanl' function. */
+/* #undef _GLIBCXX_HAVE__ISNANL */
+
+/* Define to 1 if you have the `_ldexpf' function. */
+/* #undef _GLIBCXX_HAVE__LDEXPF */
+
+/* Define to 1 if you have the `_ldexpl' function. */
+/* #undef _GLIBCXX_HAVE__LDEXPL */
+
+/* Define to 1 if you have the `_log10f' function. */
+/* #undef _GLIBCXX_HAVE__LOG10F */
+
+/* Define to 1 if you have the `_log10l' function. */
+/* #undef _GLIBCXX_HAVE__LOG10L */
+
+/* Define to 1 if you have the `_logf' function. */
+/* #undef _GLIBCXX_HAVE__LOGF */
+
+/* Define to 1 if you have the `_logl' function. */
+/* #undef _GLIBCXX_HAVE__LOGL */
+
+/* Define to 1 if you have the `_modf' function. */
+/* #undef _GLIBCXX_HAVE__MODF */
+
+/* Define to 1 if you have the `_modff' function. */
+/* #undef _GLIBCXX_HAVE__MODFF */
+
+/* Define to 1 if you have the `_modfl' function. */
+/* #undef _GLIBCXX_HAVE__MODFL */
+
+/* Define to 1 if you have the `_powf' function. */
+/* #undef _GLIBCXX_HAVE__POWF */
+
+/* Define to 1 if you have the `_powl' function. */
+/* #undef _GLIBCXX_HAVE__POWL */
+
+/* Define to 1 if you have the `_qfpclass' function. */
+/* #undef _GLIBCXX_HAVE__QFPCLASS */
+
+/* Define to 1 if you have the `_sincos' function. */
+/* #undef _GLIBCXX_HAVE__SINCOS */
+
+/* Define to 1 if you have the `_sincosf' function. */
+/* #undef _GLIBCXX_HAVE__SINCOSF */
+
+/* Define to 1 if you have the `_sincosl' function. */
+/* #undef _GLIBCXX_HAVE__SINCOSL */
+
+/* Define to 1 if you have the `_sinf' function. */
+/* #undef _GLIBCXX_HAVE__SINF */
+
+/* Define to 1 if you have the `_sinhf' function. */
+/* #undef _GLIBCXX_HAVE__SINHF */
+
+/* Define to 1 if you have the `_sinhl' function. */
+/* #undef _GLIBCXX_HAVE__SINHL */
+
+/* Define to 1 if you have the `_sinl' function. */
+/* #undef _GLIBCXX_HAVE__SINL */
+
+/* Define to 1 if you have the `_sqrtf' function. */
+/* #undef _GLIBCXX_HAVE__SQRTF */
+
+/* Define to 1 if you have the `_sqrtl' function. */
+/* #undef _GLIBCXX_HAVE__SQRTL */
+
+/* Define to 1 if you have the `_tanf' function. */
+/* #undef _GLIBCXX_HAVE__TANF */
+
+/* Define to 1 if you have the `_tanhf' function. */
+/* #undef _GLIBCXX_HAVE__TANHF */
+
+/* Define to 1 if you have the `_tanhl' function. */
+/* #undef _GLIBCXX_HAVE__TANHL */
+
+/* Define to 1 if you have the `_tanl' function. */
+/* #undef _GLIBCXX_HAVE__TANL */
+
+/* Define as const if the declaration of iconv() needs const. */
+#define _GLIBCXX_ICONV_CONST
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#define LT_OBJDIR ".libs/"
+
+/* Name of package */
+/* #undef _GLIBCXX_PACKAGE */
+
+/* Define to the address where bug reports for this package should be sent. */
+#define _GLIBCXX_PACKAGE_BUGREPORT ""
+
+/* Define to the full name of this package. */
+#define _GLIBCXX_PACKAGE_NAME "package-unused"
+
+/* Define to the full name and version of this package. */
+#define _GLIBCXX_PACKAGE_STRING "package-unused version-unused"
+
+/* Define to the one symbol short name of this package. */
+#define _GLIBCXX_PACKAGE_TARNAME "libstdc++"
+
+/* Define to the version of this package. */
+#define _GLIBCXX_PACKAGE__GLIBCXX_VERSION "version-unused"
+
+/* The size of a `char', as computed by sizeof. */
+/* #undef SIZEOF_CHAR */
+
+/* The size of a `int', as computed by sizeof. */
+/* #undef SIZEOF_INT */
+
+/* The size of a `long', as computed by sizeof. */
+/* #undef SIZEOF_LONG */
+
+/* The size of a `short', as computed by sizeof. */
+/* #undef SIZEOF_SHORT */
+
+/* The size of a `void *', as computed by sizeof. */
+/* #undef SIZEOF_VOID_P */
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Version number of package */
+/* #undef _GLIBCXX_VERSION */
+
+/* Define if builtin atomic operations for bool are supported on this host. */
+/* #undef _GLIBCXX_ATOMIC_BUILTINS_1 */
+
+/* Define if builtin atomic operations for short are supported on this host.
+ */
+/* #undef _GLIBCXX_ATOMIC_BUILTINS_2 */
+
+/* Define if builtin atomic operations for int are supported on this host. */
+/* #undef _GLIBCXX_ATOMIC_BUILTINS_4 */
+
+/* Define if builtin atomic operations for long long are supported on this
+ host. */
+/* #undef _GLIBCXX_ATOMIC_BUILTINS_8 */
+
+/* Define to use concept checking code from the boost libraries. */
+/* #undef _GLIBCXX_CONCEPT_CHECKS */
+
+/* Define if a fully dynamic basic_string is wanted. */
+/* #undef _GLIBCXX_FULLY_DYNAMIC_STRING */
+
+/* Define if gthreads library is available. */
+#define _GLIBCXX_HAS_GTHREADS 1
+
+/* Define to 1 if a full hosted library is built, or 0 if freestanding. */
+#define _GLIBCXX_HOSTED 1
+
+/* Define if compatibility should be provided for -mlong-double-64. */
+
+/* Define if ptrdiff_t is int. */
+#define _GLIBCXX_PTRDIFF_T_IS_INT 1
+
+/* Define if using setrlimit to set resource limits during "make check" */
+/* #undef _GLIBCXX_RES_LIMITS */
+
+/* Define if size_t is unsigned int. */
+#define _GLIBCXX_SIZE_T_IS_UINT 1
+
+/* Define if the compiler is configured for setjmp/longjmp exceptions. */
+/* #undef _GLIBCXX_SJLJ_EXCEPTIONS */
+
+/* Define if EOF == -1, SEEK_CUR == 1, SEEK_END == 2. */
+#define _GLIBCXX_STDIO_MACROS 1
+
+/* Define to use symbol versioning in the shared library. */
+#define _GLIBCXX_SYMVER 1
+
+/* Define to use darwin versioning in the shared library. */
+/* #undef _GLIBCXX_SYMVER_DARWIN */
+
+/* Define to use GNU versioning in the shared library. */
+#define _GLIBCXX_SYMVER_GNU 1
+
+/* Define to use GNU namespace versioning in the shared library. */
+/* #undef _GLIBCXX_SYMVER_GNU_NAMESPACE */
+
+/* Define if C99 functions or macros from <wchar.h>, <math.h>, <complex.h>,
+ <stdio.h>, and <stdlib.h> can be used or exposed. */
+#define _GLIBCXX_USE_C99 1
+
+/* Define if C99 functions in <complex.h> should be used in <complex>. Using
+ compiler builtins for these functions requires corresponding C99 library
+ functions to be present. */
+#define _GLIBCXX_USE_C99_COMPLEX 1
+
+/* Define if C99 functions in <complex.h> should be used in <tr1/complex>.
+ Using compiler builtins for these functions requires corresponding C99
+ library functions to be present. */
+#define _GLIBCXX_USE_C99_COMPLEX_TR1 1
+
+/* Define if C99 functions in <ctype.h> should be imported in <tr1/cctype> in
+ namespace std::tr1. */
+#define _GLIBCXX_USE_C99_CTYPE_TR1 1
+
+/* Define if C99 functions in <fenv.h> should be imported in <tr1/cfenv> in
+ namespace std::tr1. */
+#define _GLIBCXX_USE_C99_FENV_TR1 1
+
+/* Define if C99 functions in <inttypes.h> should be imported in
+ <tr1/cinttypes> in namespace std::tr1. */
+#define _GLIBCXX_USE_C99_INTTYPES_TR1 1
+
+/* Define if wchar_t C99 functions in <inttypes.h> should be imported in
+ <tr1/cinttypes> in namespace std::tr1. */
+#define _GLIBCXX_USE_C99_INTTYPES_WCHAR_T_TR1 1
+
+/* Define if C99 functions or macros in <math.h> should be imported in <cmath>
+ in namespace std. */
+#define _GLIBCXX_USE_C99_MATH 1
+
+/* Define if C99 functions or macros in <math.h> should be imported in
+ <tr1/cmath> in namespace std::tr1. */
+#define _GLIBCXX_USE_C99_MATH_TR1 1
+
+/* Define if C99 types in <stdint.h> should be imported in <tr1/cstdint> in
+ namespace std::tr1. */
+#define _GLIBCXX_USE_C99_STDINT_TR1 1
+
+/* Defined if clock_gettime has monotonic clock support. */
+/* #undef _GLIBCXX_USE_CLOCK_MONOTONIC */
+
+/* Defined if clock_gettime has realtime clock support. */
+/* #undef _GLIBCXX_USE_CLOCK_REALTIME */
+
+/* Defined if gettimeofday is available. */
+#define _GLIBCXX_USE_GETTIMEOFDAY 1
+
+/* Define if LFS support is available. */
+#define _GLIBCXX_USE_LFS 1
+
+/* Define if code specialized for long long should be used. */
+#define _GLIBCXX_USE_LONG_LONG 1
+
+/* Defined if nanosleep is available. */
+/* #undef _GLIBCXX_USE_NANOSLEEP */
+
+/* Define if NLS translations are to be used. */
+/* #undef _GLIBCXX_USE_NLS */
+
+/* Define if /dev/random and /dev/urandom are available for the random_device
+ of TR1 (Chapter 5.1). */
+#define _GLIBCXX_USE_RANDOM_TR1 1
+
+/* Defined if sched_yield is available. */
+/* #undef _GLIBCXX_USE_SCHED_YIELD */
+
+/* Define if code specialized for wchar_t should be used. */
+#define _GLIBCXX_USE_WCHAR_T 1
+
+#if defined (_GLIBCXX_HAVE__ACOSF) && ! defined (_GLIBCXX_HAVE_ACOSF)
+# define _GLIBCXX_HAVE_ACOSF 1
+# define acosf _acosf
+#endif
+
+#if defined (_GLIBCXX_HAVE__ACOSL) && ! defined (_GLIBCXX_HAVE_ACOSL)
+# define _GLIBCXX_HAVE_ACOSL 1
+# define acosl _acosl
+#endif
+
+#if defined (_GLIBCXX_HAVE__ASINF) && ! defined (_GLIBCXX_HAVE_ASINF)
+# define _GLIBCXX_HAVE_ASINF 1
+# define asinf _asinf
+#endif
+
+#if defined (_GLIBCXX_HAVE__ASINL) && ! defined (_GLIBCXX_HAVE_ASINL)
+# define _GLIBCXX_HAVE_ASINL 1
+# define asinl _asinl
+#endif
+
+#if defined (_GLIBCXX_HAVE__ATAN2F) && ! defined (_GLIBCXX_HAVE_ATAN2F)
+# define _GLIBCXX_HAVE_ATAN2F 1
+# define atan2f _atan2f
+#endif
+
+#if defined (_GLIBCXX_HAVE__ATAN2L) && ! defined (_GLIBCXX_HAVE_ATAN2L)
+# define _GLIBCXX_HAVE_ATAN2L 1
+# define atan2l _atan2l
+#endif
+
+#if defined (_GLIBCXX_HAVE__ATANF) && ! defined (_GLIBCXX_HAVE_ATANF)
+# define _GLIBCXX_HAVE_ATANF 1
+# define atanf _atanf
+#endif
+
+#if defined (_GLIBCXX_HAVE__ATANL) && ! defined (_GLIBCXX_HAVE_ATANL)
+# define _GLIBCXX_HAVE_ATANL 1
+# define atanl _atanl
+#endif
+
+#if defined (_GLIBCXX_HAVE__CEILF) && ! defined (_GLIBCXX_HAVE_CEILF)
+# define _GLIBCXX_HAVE_CEILF 1
+# define ceilf _ceilf
+#endif
+
+#if defined (_GLIBCXX_HAVE__CEILL) && ! defined (_GLIBCXX_HAVE_CEILL)
+# define _GLIBCXX_HAVE_CEILL 1
+# define ceill _ceill
+#endif
+
+#if defined (_GLIBCXX_HAVE__COSF) && ! defined (_GLIBCXX_HAVE_COSF)
+# define _GLIBCXX_HAVE_COSF 1
+# define cosf _cosf
+#endif
+
+#if defined (_GLIBCXX_HAVE__COSHF) && ! defined (_GLIBCXX_HAVE_COSHF)
+# define _GLIBCXX_HAVE_COSHF 1
+# define coshf _coshf
+#endif
+
+#if defined (_GLIBCXX_HAVE__COSHL) && ! defined (_GLIBCXX_HAVE_COSHL)
+# define _GLIBCXX_HAVE_COSHL 1
+# define coshl _coshl
+#endif
+
+#if defined (_GLIBCXX_HAVE__COSL) && ! defined (_GLIBCXX_HAVE_COSL)
+# define _GLIBCXX_HAVE_COSL 1
+# define cosl _cosl
+#endif
+
+#if defined (_GLIBCXX_HAVE__EXPF) && ! defined (_GLIBCXX_HAVE_EXPF)
+# define _GLIBCXX_HAVE_EXPF 1
+# define expf _expf
+#endif
+
+#if defined (_GLIBCXX_HAVE__EXPL) && ! defined (_GLIBCXX_HAVE_EXPL)
+# define _GLIBCXX_HAVE_EXPL 1
+# define expl _expl
+#endif
+
+#if defined (_GLIBCXX_HAVE__FABSF) && ! defined (_GLIBCXX_HAVE_FABSF)
+# define _GLIBCXX_HAVE_FABSF 1
+# define fabsf _fabsf
+#endif
+
+#if defined (_GLIBCXX_HAVE__FABSL) && ! defined (_GLIBCXX_HAVE_FABSL)
+# define _GLIBCXX_HAVE_FABSL 1
+# define fabsl _fabsl
+#endif
+
+#if defined (_GLIBCXX_HAVE__FINITE) && ! defined (_GLIBCXX_HAVE_FINITE)
+# define _GLIBCXX_HAVE_FINITE 1
+# define finite _finite
+#endif
+
+#if defined (_GLIBCXX_HAVE__FINITEF) && ! defined (_GLIBCXX_HAVE_FINITEF)
+# define _GLIBCXX_HAVE_FINITEF 1
+# define finitef _finitef
+#endif
+
+#if defined (_GLIBCXX_HAVE__FINITEL) && ! defined (_GLIBCXX_HAVE_FINITEL)
+# define _GLIBCXX_HAVE_FINITEL 1
+# define finitel _finitel
+#endif
+
+#if defined (_GLIBCXX_HAVE__FLOORF) && ! defined (_GLIBCXX_HAVE_FLOORF)
+# define _GLIBCXX_HAVE_FLOORF 1
+# define floorf _floorf
+#endif
+
+#if defined (_GLIBCXX_HAVE__FLOORL) && ! defined (_GLIBCXX_HAVE_FLOORL)
+# define _GLIBCXX_HAVE_FLOORL 1
+# define floorl _floorl
+#endif
+
+#if defined (_GLIBCXX_HAVE__FMODF) && ! defined (_GLIBCXX_HAVE_FMODF)
+# define _GLIBCXX_HAVE_FMODF 1
+# define fmodf _fmodf
+#endif
+
+#if defined (_GLIBCXX_HAVE__FMODL) && ! defined (_GLIBCXX_HAVE_FMODL)
+# define _GLIBCXX_HAVE_FMODL 1
+# define fmodl _fmodl
+#endif
+
+#if defined (_GLIBCXX_HAVE__FPCLASS) && ! defined (_GLIBCXX_HAVE_FPCLASS)
+# define _GLIBCXX_HAVE_FPCLASS 1
+# define fpclass _fpclass
+#endif
+
+#if defined (_GLIBCXX_HAVE__FREXPF) && ! defined (_GLIBCXX_HAVE_FREXPF)
+# define _GLIBCXX_HAVE_FREXPF 1
+# define frexpf _frexpf
+#endif
+
+#if defined (_GLIBCXX_HAVE__FREXPL) && ! defined (_GLIBCXX_HAVE_FREXPL)
+# define _GLIBCXX_HAVE_FREXPL 1
+# define frexpl _frexpl
+#endif
+
+#if defined (_GLIBCXX_HAVE__HYPOT) && ! defined (_GLIBCXX_HAVE_HYPOT)
+# define _GLIBCXX_HAVE_HYPOT 1
+# define hypot _hypot
+#endif
+
+#if defined (_GLIBCXX_HAVE__HYPOTF) && ! defined (_GLIBCXX_HAVE_HYPOTF)
+# define _GLIBCXX_HAVE_HYPOTF 1
+# define hypotf _hypotf
+#endif
+
+#if defined (_GLIBCXX_HAVE__HYPOTL) && ! defined (_GLIBCXX_HAVE_HYPOTL)
+# define _GLIBCXX_HAVE_HYPOTL 1
+# define hypotl _hypotl
+#endif
+
+#if defined (_GLIBCXX_HAVE__ISINF) && ! defined (_GLIBCXX_HAVE_ISINF)
+# define _GLIBCXX_HAVE_ISINF 1
+# define isinf _isinf
+#endif
+
+#if defined (_GLIBCXX_HAVE__ISINFF) && ! defined (_GLIBCXX_HAVE_ISINFF)
+# define _GLIBCXX_HAVE_ISINFF 1
+# define isinff _isinff
+#endif
+
+#if defined (_GLIBCXX_HAVE__ISINFL) && ! defined (_GLIBCXX_HAVE_ISINFL)
+# define _GLIBCXX_HAVE_ISINFL 1
+# define isinfl _isinfl
+#endif
+
+#if defined (_GLIBCXX_HAVE__ISNAN) && ! defined (_GLIBCXX_HAVE_ISNAN)
+# define _GLIBCXX_HAVE_ISNAN 1
+# define isnan _isnan
+#endif
+
+#if defined (_GLIBCXX_HAVE__ISNANF) && ! defined (_GLIBCXX_HAVE_ISNANF)
+# define _GLIBCXX_HAVE_ISNANF 1
+# define isnanf _isnanf
+#endif
+
+#if defined (_GLIBCXX_HAVE__ISNANL) && ! defined (_GLIBCXX_HAVE_ISNANL)
+# define _GLIBCXX_HAVE_ISNANL 1
+# define isnanl _isnanl
+#endif
+
+#if defined (_GLIBCXX_HAVE__LDEXPF) && ! defined (_GLIBCXX_HAVE_LDEXPF)
+# define _GLIBCXX_HAVE_LDEXPF 1
+# define ldexpf _ldexpf
+#endif
+
+#if defined (_GLIBCXX_HAVE__LDEXPL) && ! defined (_GLIBCXX_HAVE_LDEXPL)
+# define _GLIBCXX_HAVE_LDEXPL 1
+# define ldexpl _ldexpl
+#endif
+
+#if defined (_GLIBCXX_HAVE__LOG10F) && ! defined (_GLIBCXX_HAVE_LOG10F)
+# define _GLIBCXX_HAVE_LOG10F 1
+# define log10f _log10f
+#endif
+
+#if defined (_GLIBCXX_HAVE__LOG10L) && ! defined (_GLIBCXX_HAVE_LOG10L)
+# define _GLIBCXX_HAVE_LOG10L 1
+# define log10l _log10l
+#endif
+
+#if defined (_GLIBCXX_HAVE__LOGF) && ! defined (_GLIBCXX_HAVE_LOGF)
+# define _GLIBCXX_HAVE_LOGF 1
+# define logf _logf
+#endif
+
+#if defined (_GLIBCXX_HAVE__LOGL) && ! defined (_GLIBCXX_HAVE_LOGL)
+# define _GLIBCXX_HAVE_LOGL 1
+# define logl _logl
+#endif
+
+#if defined (_GLIBCXX_HAVE__MODF) && ! defined (_GLIBCXX_HAVE_MODF)
+# define _GLIBCXX_HAVE_MODF 1
+# define modf _modf
+#endif
+
+#if defined (_GLIBCXX_HAVE__MODFF) && ! defined (_GLIBCXX_HAVE_MODFF)
+# define _GLIBCXX_HAVE_MODFF 1
+# define modff _modff
+#endif
+
+#if defined (_GLIBCXX_HAVE__MODFL) && ! defined (_GLIBCXX_HAVE_MODFL)
+# define _GLIBCXX_HAVE_MODFL 1
+# define modfl _modfl
+#endif
+
+#if defined (_GLIBCXX_HAVE__POWF) && ! defined (_GLIBCXX_HAVE_POWF)
+# define _GLIBCXX_HAVE_POWF 1
+# define powf _powf
+#endif
+
+#if defined (_GLIBCXX_HAVE__POWL) && ! defined (_GLIBCXX_HAVE_POWL)
+# define _GLIBCXX_HAVE_POWL 1
+# define powl _powl
+#endif
+
+#if defined (_GLIBCXX_HAVE__QFPCLASS) && ! defined (_GLIBCXX_HAVE_QFPCLASS)
+# define _GLIBCXX_HAVE_QFPCLASS 1
+# define qfpclass _qfpclass
+#endif
+
+#if defined (_GLIBCXX_HAVE__SINCOS) && ! defined (_GLIBCXX_HAVE_SINCOS)
+# define _GLIBCXX_HAVE_SINCOS 1
+# define sincos _sincos
+#endif
+
+#if defined (_GLIBCXX_HAVE__SINCOSF) && ! defined (_GLIBCXX_HAVE_SINCOSF)
+# define _GLIBCXX_HAVE_SINCOSF 1
+# define sincosf _sincosf
+#endif
+
+#if defined (_GLIBCXX_HAVE__SINCOSL) && ! defined (_GLIBCXX_HAVE_SINCOSL)
+# define _GLIBCXX_HAVE_SINCOSL 1
+# define sincosl _sincosl
+#endif
+
+#if defined (_GLIBCXX_HAVE__SINF) && ! defined (_GLIBCXX_HAVE_SINF)
+# define _GLIBCXX_HAVE_SINF 1
+# define sinf _sinf
+#endif
+
+#if defined (_GLIBCXX_HAVE__SINHF) && ! defined (_GLIBCXX_HAVE_SINHF)
+# define _GLIBCXX_HAVE_SINHF 1
+# define sinhf _sinhf
+#endif
+
+#if defined (_GLIBCXX_HAVE__SINHL) && ! defined (_GLIBCXX_HAVE_SINHL)
+# define _GLIBCXX_HAVE_SINHL 1
+# define sinhl _sinhl
+#endif
+
+#if defined (_GLIBCXX_HAVE__SINL) && ! defined (_GLIBCXX_HAVE_SINL)
+# define _GLIBCXX_HAVE_SINL 1
+# define sinl _sinl
+#endif
+
+#if defined (_GLIBCXX_HAVE__SQRTF) && ! defined (_GLIBCXX_HAVE_SQRTF)
+# define _GLIBCXX_HAVE_SQRTF 1
+# define sqrtf _sqrtf
+#endif
+
+#if defined (_GLIBCXX_HAVE__SQRTL) && ! defined (_GLIBCXX_HAVE_SQRTL)
+# define _GLIBCXX_HAVE_SQRTL 1
+# define sqrtl _sqrtl
+#endif
+
+#if defined (_GLIBCXX_HAVE__STRTOF) && ! defined (_GLIBCXX_HAVE_STRTOF)
+# define _GLIBCXX_HAVE_STRTOF 1
+# define strtof _strtof
+#endif
+
+#if defined (_GLIBCXX_HAVE__STRTOLD) && ! defined (_GLIBCXX_HAVE_STRTOLD)
+# define _GLIBCXX_HAVE_STRTOLD 1
+# define strtold _strtold
+#endif
+
+#if defined (_GLIBCXX_HAVE__TANF) && ! defined (_GLIBCXX_HAVE_TANF)
+# define _GLIBCXX_HAVE_TANF 1
+# define tanf _tanf
+#endif
+
+#if defined (_GLIBCXX_HAVE__TANHF) && ! defined (_GLIBCXX_HAVE_TANHF)
+# define _GLIBCXX_HAVE_TANHF 1
+# define tanhf _tanhf
+#endif
+
+#if defined (_GLIBCXX_HAVE__TANHL) && ! defined (_GLIBCXX_HAVE_TANHL)
+# define _GLIBCXX_HAVE_TANHL 1
+# define tanhl _tanhl
+#endif
+
+#if defined (_GLIBCXX_HAVE__TANL) && ! defined (_GLIBCXX_HAVE_TANL)
+# define _GLIBCXX_HAVE_TANL 1
+# define tanl _tanl
+#endif
+
+#endif // _GLIBCXX_CXX_CONFIG_H
diff --git a/i686-linux/include/c++/4.4.3/i686-linux/bits/c++io.h b/i686-linux/include/c++/4.4.3/i686-linux/bits/c++io.h
new file mode 100644
index 0000000..86ca53b
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/i686-linux/bits/c++io.h
@@ -0,0 +1,49 @@
+// Underlying io library details -*- C++ -*-
+
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file c++io.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+// c_io_stdio.h - Defines for using "C" stdio.h
+
+#ifndef _GLIBCXX_CXX_IO_H
+#define _GLIBCXX_CXX_IO_H 1
+
+#include <cstdio>
+#include <cstddef>
+#include <bits/gthr.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ typedef __gthread_mutex_t __c_lock;
+
+ // for basic_file.h
+ typedef FILE __c_file;
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/i686-linux/bits/c++locale.h b/i686-linux/include/c++/4.4.3/i686-linux/bits/c++locale.h
new file mode 100644
index 0000000..e27a9cd
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/i686-linux/bits/c++locale.h
@@ -0,0 +1,91 @@
+// Wrapper for underlying C-language localization -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file c++locale.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 22.8 Standard locale categories.
+//
+
+// Written by Benjamin Kosnik <bkoz@redhat.com>
+
+#ifndef _GLIBCXX_CXX_LOCALE_H
+#define _GLIBCXX_CXX_LOCALE_H 1
+
+#pragma GCC system_header
+
+#include <clocale>
+#include <cstddef>
+
+#define _GLIBCXX_NUM_CATEGORIES 0
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ typedef int* __c_locale;
+
+ // Convert numeric value of type double and long double to string and
+ // return length of string. If vsnprintf is available use it, otherwise
+ // fall back to the unsafe vsprintf which, in general, can be dangerous
+ // and should be avoided.
+ inline int
+ __convert_from_v(const __c_locale&, char* __out,
+ const int __size __attribute__((__unused__)),
+ const char* __fmt, ...)
+ {
+ char* __old = std::setlocale(LC_NUMERIC, NULL);
+ char* __sav = NULL;
+ if (__old != NULL && __builtin_strcmp(__old, "C"))
+ {
+ const size_t __len = __builtin_strlen(__old) + 1;
+ __sav = new char[__len];
+ __builtin_memcpy(__sav, __old, __len);
+ std::setlocale(LC_NUMERIC, "C");
+ }
+
+ __builtin_va_list __args;
+ __builtin_va_start(__args, __fmt);
+
+#ifdef _GLIBCXX_USE_C99
+ const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
+#else
+ const int __ret = __builtin_vsprintf(__out, __fmt, __args);
+#endif
+
+ __builtin_va_end(__args);
+
+ if (__sav)
+ {
+ std::setlocale(LC_NUMERIC, __sav);
+ delete [] __sav;
+ }
+ return __ret;
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/i686-linux/bits/cpu_defines.h b/i686-linux/include/c++/4.4.3/i686-linux/bits/cpu_defines.h
new file mode 100644
index 0000000..faf97e1
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/i686-linux/bits/cpu_defines.h
@@ -0,0 +1,33 @@
+// Specific definitions for generic platforms -*- C++ -*-
+
+// Copyright (C) 2005, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file cpu_defines.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _GLIBCXX_CPU_DEFINES
+#define _GLIBCXX_CPU_DEFINES 1
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/i686-linux/bits/ctype_base.h b/i686-linux/include/c++/4.4.3/i686-linux/bits/ctype_base.h
new file mode 100644
index 0000000..ff1f157
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/i686-linux/bits/ctype_base.h
@@ -0,0 +1,61 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+//
+// ISO C++ 14882: 22.1 Locales
+//
+
+/** @file ctype_base.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+// Information as gleaned from /usr/include/ctype.h
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /// @brief Base class for ctype.
+ struct ctype_base
+ {
+ // Non-standard typedefs.
+ typedef const int* __to_type;
+
+ // NB: Offsets into ctype<char>::_M_table force a particular size
+ // on the mask type. Because of this, we don't use an enum.
+ typedef unsigned short mask;
+ static const mask upper = _ISupper;
+ static const mask lower = _ISlower;
+ static const mask alpha = _ISalpha;
+ static const mask digit = _ISdigit;
+ static const mask xdigit = _ISxdigit;
+ static const mask space = _ISspace;
+ static const mask print = _ISprint;
+ static const mask graph = _ISalpha | _ISdigit | _ISpunct;
+ static const mask cntrl = _IScntrl;
+ static const mask punct = _ISpunct;
+ static const mask alnum = _ISalpha | _ISdigit;
+ };
+
+_GLIBCXX_END_NAMESPACE
diff --git a/i686-linux/include/c++/4.4.3/i686-linux/bits/ctype_inline.h b/i686-linux/include/c++/4.4.3/i686-linux/bits/ctype_inline.h
new file mode 100644
index 0000000..8ae8229
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/i686-linux/bits/ctype_inline.h
@@ -0,0 +1,73 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2000, 2002, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ctype_inline.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 22.1 Locales
+//
+
+// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
+// functions go in ctype.cc
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ bool
+ ctype<char>::
+ is(mask __m, char __c) const
+ { return _M_table[static_cast<unsigned char>(__c)] & __m; }
+
+ const char*
+ ctype<char>::
+ is(const char* __low, const char* __high, mask* __vec) const
+ {
+ while (__low < __high)
+ *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
+ return __high;
+ }
+
+ const char*
+ ctype<char>::
+ scan_is(mask __m, const char* __low, const char* __high) const
+ {
+ while (__low < __high
+ && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
+ ++__low;
+ return __low;
+ }
+
+ const char*
+ ctype<char>::
+ scan_not(mask __m, const char* __low, const char* __high) const
+ {
+ while (__low < __high
+ && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
+ ++__low;
+ return __low;
+ }
+
+_GLIBCXX_END_NAMESPACE
diff --git a/i686-linux/include/c++/4.4.3/i686-linux/bits/ctype_noninline.h b/i686-linux/include/c++/4.4.3/i686-linux/bits/ctype_noninline.h
new file mode 100644
index 0000000..4fc47a9
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/i686-linux/bits/ctype_noninline.h
@@ -0,0 +1,190 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ctype_noninline.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 22.1 Locales
+//
+
+// Information as gleaned from /usr/include/ctype.h
+
+#if _GLIBCXX_C_LOCALE_GNU
+ const ctype_base::mask*
+ ctype<char>::classic_table() throw()
+ { return _S_get_c_locale()->__ctype_b; }
+#else
+ const ctype_base::mask*
+ ctype<char>::classic_table() throw()
+ {
+ const ctype_base::mask* __ret;
+ char* __old = setlocale(LC_CTYPE, NULL);
+ char* __sav = NULL;
+ if (__builtin_strcmp(__old, "C"))
+ {
+ const size_t __len = __builtin_strlen(__old) + 1;
+ __sav = new char[__len];
+ __builtin_memcpy(__sav, __old, __len);
+ setlocale(LC_CTYPE, "C");
+ }
+#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
+ __ret = *__ctype_b_loc();
+#else
+ __ret = __ctype_b;
+#endif
+ if (__sav)
+ {
+ setlocale(LC_CTYPE, __sav);
+ delete [] __sav;
+ }
+ return __ret;
+ }
+#endif
+
+#if _GLIBCXX_C_LOCALE_GNU
+ ctype<char>::ctype(__c_locale __cloc, const mask* __table, bool __del,
+ size_t __refs)
+ : facet(__refs), _M_c_locale_ctype(_S_clone_c_locale(__cloc)),
+ _M_del(__table != 0 && __del),
+ _M_toupper(_M_c_locale_ctype->__ctype_toupper),
+ _M_tolower(_M_c_locale_ctype->__ctype_tolower),
+ _M_table(__table ? __table : _M_c_locale_ctype->__ctype_b),
+ _M_widen_ok(0), _M_narrow_ok(0)
+ {
+ __builtin_memset(_M_widen, 0, sizeof(_M_widen));
+ __builtin_memset(_M_narrow, 0, sizeof(_M_narrow));
+ }
+#else
+ ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
+ size_t __refs)
+ : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()),
+ _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
+ {
+ char* __old = setlocale(LC_CTYPE, NULL);
+ char* __sav = NULL;
+ if (__builtin_strcmp(__old, "C"))
+ {
+ const size_t __len = __builtin_strlen(__old) + 1;
+ __sav = new char[__len];
+ __builtin_memcpy(__sav, __old, __len);
+ setlocale(LC_CTYPE, "C");
+ }
+#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
+ _M_toupper = *__ctype_toupper_loc();
+ _M_tolower = *__ctype_tolower_loc();
+ _M_table = __table ? __table : *__ctype_b_loc();
+#else
+ _M_toupper = __ctype_toupper;
+ _M_tolower = __ctype_tolower;
+ _M_table = __table ? __table : __ctype_b;
+#endif
+ if (__sav)
+ {
+ setlocale(LC_CTYPE, __sav);
+ delete [] __sav;
+ }
+ __builtin_memset(_M_widen, 0, sizeof(_M_widen));
+ __builtin_memset(_M_narrow, 0, sizeof(_M_narrow));
+ }
+#endif
+
+#if _GLIBCXX_C_LOCALE_GNU
+ ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
+ : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()),
+ _M_del(__table != 0 && __del),
+ _M_toupper(_M_c_locale_ctype->__ctype_toupper),
+ _M_tolower(_M_c_locale_ctype->__ctype_tolower),
+ _M_table(__table ? __table : _M_c_locale_ctype->__ctype_b),
+ _M_widen_ok(0), _M_narrow_ok(0)
+ {
+ __builtin_memset(_M_widen, 0, sizeof(_M_widen));
+ __builtin_memset(_M_narrow, 0, sizeof(_M_narrow));
+ }
+#else
+ ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
+ : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()),
+ _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
+ {
+ char* __old = setlocale(LC_CTYPE, NULL);
+ char* __sav = NULL;
+ if (__builtin_strcmp(__old, "C"))
+ {
+ const size_t __len = __builtin_strlen(__old) + 1;
+ __sav = new char[__len];
+ __builtin_memcpy(__sav, __old, __len);
+ setlocale(LC_CTYPE, "C");
+ }
+#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
+ _M_toupper = *__ctype_toupper_loc();
+ _M_tolower = *__ctype_tolower_loc();
+ _M_table = __table ? __table : *__ctype_b_loc();
+#else
+ _M_toupper = __ctype_toupper;
+ _M_tolower = __ctype_tolower;
+ _M_table = __table ? __table : __ctype_b;
+#endif
+ if (__sav)
+ {
+ setlocale(LC_CTYPE, __sav);
+ delete [] __sav;
+ }
+ __builtin_memset(_M_widen, 0, sizeof(_M_widen));
+ __builtin_memset(_M_narrow, 0, sizeof(_M_narrow));
+ }
+#endif
+
+ char
+ ctype<char>::do_toupper(char __c) const
+ { return _M_toupper[static_cast<unsigned char>(__c)]; }
+
+ const char*
+ ctype<char>::do_toupper(char* __low, const char* __high) const
+ {
+ while (__low < __high)
+ {
+ *__low = _M_toupper[static_cast<unsigned char>(*__low)];
+ ++__low;
+ }
+ return __high;
+ }
+
+ char
+ ctype<char>::do_tolower(char __c) const
+ { return _M_tolower[static_cast<unsigned char>(__c)]; }
+
+ const char*
+ ctype<char>::do_tolower(char* __low, const char* __high) const
+ {
+ while (__low < __high)
+ {
+ *__low = _M_tolower[static_cast<unsigned char>(*__low)];
+ ++__low;
+ }
+ return __high;
+ }
diff --git a/i686-linux/include/c++/4.4.3/i686-linux/bits/cxxabi_tweaks.h b/i686-linux/include/c++/4.4.3/i686-linux/bits/cxxabi_tweaks.h
new file mode 100644
index 0000000..8354691
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/i686-linux/bits/cxxabi_tweaks.h
@@ -0,0 +1,58 @@
+// Control various target specific ABI tweaks. Generic version.
+
+// Copyright (C) 2004, 2006, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file cxxabi_tweaks.h
+ * The header provides an CPU-variable interface to the C++ ABI.
+ */
+
+#ifndef _CXXABI_TWEAKS_H
+#define _CXXABI_TWEAKS_H 1
+
+#ifdef __cplusplus
+namespace __cxxabiv1
+{
+ extern "C"
+ {
+#endif
+
+ // The generic ABI uses the first byte of a 64-bit guard variable.
+#define _GLIBCXX_GUARD_TEST(x) (*(char *) (x) != 0)
+#define _GLIBCXX_GUARD_SET(x) *(char *) (x) = 1
+#define _GLIBCXX_GUARD_BIT __guard_test_bit (0, 1)
+#define _GLIBCXX_GUARD_PENDING_BIT __guard_test_bit (1, 1)
+#define _GLIBCXX_GUARD_WAITING_BIT __guard_test_bit (2, 1)
+ __extension__ typedef int __guard __attribute__((mode (__DI__)));
+
+ // __cxa_vec_ctor has void return type.
+ typedef void __cxa_vec_ctor_return_type;
+#define _GLIBCXX_CXA_VEC_CTOR_RETURN(x) return
+ // Constructors and destructors do not return a value.
+ typedef void __cxa_cdtor_return_type;
+
+#ifdef __cplusplus
+ }
+} // namespace __cxxabiv1
+#endif
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/i686-linux/bits/error_constants.h b/i686-linux/include/c++/4.4.3/i686-linux/bits/error_constants.h
new file mode 100644
index 0000000..61c0349
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/i686-linux/bits/error_constants.h
@@ -0,0 +1,175 @@
+// Specific definitions for generic platforms -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file error_constants.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _GLIBCXX_ERROR_CONSTANTS
+#define _GLIBCXX_ERROR_CONSTANTS 1
+
+#include <bits/c++config.h>
+#include <cerrno>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ enum class errc
+ {
+ address_family_not_supported = EAFNOSUPPORT,
+ address_in_use = EADDRINUSE,
+ address_not_available = EADDRNOTAVAIL,
+ already_connected = EISCONN,
+ argument_list_too_long = E2BIG,
+ argument_out_of_domain = EDOM,
+ bad_address = EFAULT,
+ bad_file_descriptor = EBADF,
+
+#ifdef _GLIBCXX_HAVE_EBADMSG
+ bad_message = EBADMSG,
+#endif
+
+ broken_pipe = EPIPE,
+ connection_aborted = ECONNABORTED,
+ connection_already_in_progress = EALREADY,
+ connection_refused = ECONNREFUSED,
+ connection_reset = ECONNRESET,
+ cross_device_link = EXDEV,
+ destination_address_required = EDESTADDRREQ,
+ device_or_resource_busy = EBUSY,
+ directory_not_empty = ENOTEMPTY,
+ executable_format_error = ENOEXEC,
+ file_exists = EEXIST,
+ file_too_large = EFBIG,
+ filename_too_long = ENAMETOOLONG,
+ function_not_supported = ENOSYS,
+ host_unreachable = EHOSTUNREACH,
+
+#ifdef _GLIBCXX_HAVE_EIDRM
+ identifier_removed = EIDRM,
+#endif
+
+ illegal_byte_sequence = EILSEQ,
+ inappropriate_io_control_operation = ENOTTY,
+ interrupted = EINTR,
+ invalid_argument = EINVAL,
+ invalid_seek = ESPIPE,
+ io_error = EIO,
+ is_a_directory = EISDIR,
+ message_size = EMSGSIZE,
+ network_down = ENETDOWN,
+ network_reset = ENETRESET,
+ network_unreachable = ENETUNREACH,
+ no_buffer_space = ENOBUFS,
+ no_child_process = ECHILD,
+
+#ifdef _GLIBCXX_HAVE_ENOLINK
+ no_link = ENOLINK,
+#endif
+
+ no_lock_available = ENOLCK,
+
+#ifdef _GLIBCXX_HAVE_ENODATA
+ no_message_available = ENODATA,
+#endif
+
+ no_message = ENOMSG,
+ no_protocol_option = ENOPROTOOPT,
+ no_space_on_device = ENOSPC,
+
+#ifdef _GLIBCXX_HAVE_ENOSR
+ no_stream_resources = ENOSR,
+#endif
+
+ no_such_device_or_address = ENXIO,
+ no_such_device = ENODEV,
+ no_such_file_or_directory = ENOENT,
+ no_such_process = ESRCH,
+ not_a_directory = ENOTDIR,
+ not_a_socket = ENOTSOCK,
+
+#ifdef _GLIBCXX_HAVE_ENOSTR
+ not_a_stream = ENOSTR,
+#endif
+
+ not_connected = ENOTCONN,
+ not_enough_memory = ENOMEM,
+
+#ifdef _GLIBCXX_HAVE_ENOTSUP
+ not_supported = ENOTSUP,
+#endif
+
+#ifdef _GLIBCXX_HAVE_ECANCELED
+ operation_canceled = ECANCELED,
+#endif
+
+ operation_in_progress = EINPROGRESS,
+ operation_not_permitted = EPERM,
+ operation_not_supported = EOPNOTSUPP,
+ operation_would_block = EWOULDBLOCK,
+
+#ifdef _GLIBCXX_HAVE_EOWNERDEAD
+ owner_dead = EOWNERDEAD,
+#endif
+
+ permission_denied = EACCES,
+
+#ifdef _GLIBCXX_HAVE_EPROTO
+ protocol_error = EPROTO,
+#endif
+
+ protocol_not_supported = EPROTONOSUPPORT,
+ read_only_file_system = EROFS,
+ resource_deadlock_would_occur = EDEADLK,
+ resource_unavailable_try_again = EAGAIN,
+ result_out_of_range = ERANGE,
+
+#ifdef _GLIBCXX_HAVE_ENOTRECOVERABLE
+ state_not_recoverable = ENOTRECOVERABLE,
+#endif
+
+#ifdef _GLIBCXX_HAVE_ETIME
+ stream_timeout = ETIME,
+#endif
+
+#ifdef _GLIBCXX_HAVE_ETXTBSY
+ text_file_busy = ETXTBSY,
+#endif
+
+ timed_out = ETIMEDOUT,
+ too_many_files_open_in_system = ENFILE,
+ too_many_files_open = EMFILE,
+ too_many_links = EMLINK,
+ too_many_symbolic_link_levels = ELOOP,
+
+#ifdef _GLIBCXX_HAVE_EOVERFLOW
+ value_too_large = EOVERFLOW,
+#endif
+
+ wrong_protocol_type = EPROTOTYPE
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/i686-linux/bits/extc++.h b/i686-linux/include/c++/4.4.3/i686-linux/bits/extc++.h
new file mode 100644
index 0000000..f0ccc42
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/i686-linux/bits/extc++.h
@@ -0,0 +1,69 @@
+// C++ includes used for precompiling extensions -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file extc++.h
+ * This is an implementation file for a precompiled header.
+ */
+
+#include <bits/stdtr1c++.h>
+
+#include <ext/algorithm>
+#include <ext/array_allocator.h>
+#include <ext/atomicity.h>
+#include <ext/bitmap_allocator.h>
+#include <ext/cast.h>
+#include <ext/concurrence.h>
+#include <ext/debug_allocator.h>
+#include <ext/extptr_allocator.h>
+#include <ext/functional>
+#include <ext/iterator>
+#include <ext/malloc_allocator.h>
+#include <ext/memory>
+#include <ext/mt_allocator.h>
+#include <ext/new_allocator.h>
+#include <ext/numeric>
+#include <ext/pod_char_traits.h>
+#include <ext/pointer.h>
+#include <ext/pool_allocator.h>
+#include <ext/rb_tree>
+#include <ext/rope>
+#include <ext/slist>
+#include <ext/stdio_filebuf.h>
+#include <ext/stdio_sync_filebuf.h>
+#include <ext/throw_allocator.h>
+#include <ext/typelist.h>
+#include <ext/type_traits.h>
+#include <ext/vstring.h>
+#include <ext/pb_ds/assoc_container.hpp>
+#include <ext/pb_ds/priority_queue.hpp>
+#include <ext/pb_ds/exception.hpp>
+#include <ext/pb_ds/hash_policy.hpp>
+#include <ext/pb_ds/list_update_policy.hpp>
+#include <ext/pb_ds/tree_policy.hpp>
+#include <ext/pb_ds/trie_policy.hpp>
+
+#ifdef _GLIBCXX_HAVE_ICONV
+ #include <ext/codecvt_specializations.h>
+ #include <ext/enc_filebuf.h>
+#endif
diff --git a/i686-linux/include/c++/4.4.3/i686-linux/bits/gthr-default.h b/i686-linux/include/c++/4.4.3/i686-linux/bits/gthr-default.h
new file mode 100644
index 0000000..363a6e7
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/i686-linux/bits/gthr-default.h
@@ -0,0 +1,905 @@
+/* Threads compatibility routines for libgcc2 and libobjc. */
+/* Compile this one with gcc. */
+/* Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+ 2008, 2009 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+#ifndef _GLIBCXX_GCC_GTHR_POSIX_H
+#define _GLIBCXX_GCC_GTHR_POSIX_H
+
+/* POSIX threads specific definitions.
+ Easy, since the interface is just one-to-one mapping. */
+
+#define __GTHREADS 1
+#define __GTHREADS_CXX0X 1
+
+/* Some implementations of <pthread.h> require this to be defined. */
+#if !defined(_REENTRANT) && defined(__osf__)
+#define _REENTRANT 1
+#endif
+
+#include <pthread.h>
+#include <unistd.h>
+
+typedef pthread_t __gthread_t;
+typedef pthread_key_t __gthread_key_t;
+typedef pthread_once_t __gthread_once_t;
+typedef pthread_mutex_t __gthread_mutex_t;
+typedef pthread_mutex_t __gthread_recursive_mutex_t;
+typedef pthread_cond_t __gthread_cond_t;
+typedef struct timespec __gthread_time_t;
+
+/* POSIX like conditional variables are supported. Please look at comments
+ in gthr.h for details. */
+#define __GTHREAD_HAS_COND 1
+
+#define __GTHREAD_MUTEX_INIT PTHREAD_MUTEX_INITIALIZER
+#define __GTHREAD_ONCE_INIT PTHREAD_ONCE_INIT
+#if defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER)
+#define __GTHREAD_RECURSIVE_MUTEX_INIT PTHREAD_RECURSIVE_MUTEX_INITIALIZER
+#elif defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP)
+#define __GTHREAD_RECURSIVE_MUTEX_INIT PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+#else
+#define __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION __gthread_recursive_mutex_init_function
+#endif
+#define __GTHREAD_COND_INIT PTHREAD_COND_INITIALIZER
+#define __GTHREAD_TIME_INIT {0,0}
+
+#if __GXX_WEAK__ && _GLIBCXX_GTHREAD_USE_WEAK
+# ifndef __gthrw_pragma
+# define __gthrw_pragma(pragma)
+# endif
+# define __gthrw2(name,name2,type) \
+ static __typeof(type) name __attribute__ ((__weakref__(#name2))); \
+ __gthrw_pragma(weak type)
+# define __gthrw_(name) __gthrw_ ## name
+#else
+# define __gthrw2(name,name2,type)
+# define __gthrw_(name) name
+#endif
+
+/* Typically, __gthrw_foo is a weak reference to symbol foo. */
+#define __gthrw(name) __gthrw2(__gthrw_ ## name,name,name)
+
+/* On Tru64, /usr/include/pthread.h uses #pragma extern_prefix "__" to
+ map a subset of the POSIX pthread API to mangled versions of their
+ names. */
+#if defined(__osf__) && defined(_PTHREAD_USE_MANGLED_NAMES_)
+#define __gthrw3(name) __gthrw2(__gthrw_ ## name, __ ## name, name)
+__gthrw3(pthread_once)
+__gthrw3(pthread_getspecific)
+__gthrw3(pthread_setspecific)
+
+__gthrw3(pthread_create)
+__gthrw3(pthread_join)
+__gthrw3(pthread_detach)
+__gthrw3(pthread_equal)
+__gthrw3(pthread_self)
+__gthrw3(pthread_cancel)
+__gthrw3(sched_yield)
+
+__gthrw3(pthread_mutex_lock)
+__gthrw3(pthread_mutex_trylock)
+#ifdef _POSIX_TIMEOUTS
+#if _POSIX_TIMEOUTS >= 0
+__gthrw3(pthread_mutex_timedlock)
+#endif
+#endif /* _POSIX_TIMEOUTS */
+__gthrw3(pthread_mutex_unlock)
+__gthrw3(pthread_mutex_init)
+__gthrw3(pthread_mutex_destroy)
+
+__gthrw3(pthread_cond_broadcast)
+__gthrw3(pthread_cond_signal)
+__gthrw3(pthread_cond_wait)
+__gthrw3(pthread_cond_timedwait)
+__gthrw3(pthread_cond_destroy)
+#else
+__gthrw(pthread_once)
+__gthrw(pthread_getspecific)
+__gthrw(pthread_setspecific)
+
+__gthrw(pthread_create)
+__gthrw(pthread_join)
+__gthrw(pthread_equal)
+__gthrw(pthread_self)
+__gthrw(pthread_detach)
+#ifndef __BIONIC__
+__gthrw(pthread_cancel)
+#endif
+__gthrw(sched_yield)
+
+__gthrw(pthread_mutex_lock)
+__gthrw(pthread_mutex_trylock)
+#ifdef _POSIX_TIMEOUTS
+#if _POSIX_TIMEOUTS >= 0
+__gthrw(pthread_mutex_timedlock)
+#endif
+#endif /* _POSIX_TIMEOUTS */
+__gthrw(pthread_mutex_unlock)
+__gthrw(pthread_mutex_init)
+__gthrw(pthread_mutex_destroy)
+
+__gthrw(pthread_cond_broadcast)
+__gthrw(pthread_cond_signal)
+__gthrw(pthread_cond_wait)
+__gthrw(pthread_cond_timedwait)
+__gthrw(pthread_cond_destroy)
+#endif
+
+__gthrw(pthread_key_create)
+__gthrw(pthread_key_delete)
+__gthrw(pthread_mutexattr_init)
+__gthrw(pthread_mutexattr_settype)
+__gthrw(pthread_mutexattr_destroy)
+
+
+#if defined(_LIBOBJC) || defined(_LIBOBJC_WEAK)
+/* Objective-C. */
+#if defined(__osf__) && defined(_PTHREAD_USE_MANGLED_NAMES_)
+__gthrw3(pthread_cond_init)
+__gthrw3(pthread_exit)
+#else
+__gthrw(pthread_cond_init)
+__gthrw(pthread_exit)
+#endif /* __osf__ && _PTHREAD_USE_MANGLED_NAMES_ */
+#ifdef _POSIX_PRIORITY_SCHEDULING
+#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
+__gthrw(sched_get_priority_max)
+__gthrw(sched_get_priority_min)
+#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
+#endif /* _POSIX_PRIORITY_SCHEDULING */
+__gthrw(pthread_attr_destroy)
+__gthrw(pthread_attr_init)
+__gthrw(pthread_attr_setdetachstate)
+#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
+__gthrw(pthread_getschedparam)
+__gthrw(pthread_setschedparam)
+#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
+#endif /* _LIBOBJC || _LIBOBJC_WEAK */
+
+#if __GXX_WEAK__ && _GLIBCXX_GTHREAD_USE_WEAK
+
+/* On Solaris 2.6 up to 9, the libc exposes a POSIX threads interface even if
+ -pthreads is not specified. The functions are dummies and most return an
+ error value. However pthread_once returns 0 without invoking the routine
+ it is passed so we cannot pretend that the interface is active if -pthreads
+ is not specified. On Solaris 2.5.1, the interface is not exposed at all so
+ we need to play the usual game with weak symbols. On Solaris 10 and up, a
+ working interface is always exposed. On FreeBSD 6 and later, libc also
+ exposes a dummy POSIX threads interface, similar to what Solaris 2.6 up
+ to 9 does. FreeBSD >= 700014 even provides a pthread_cancel stub in libc,
+ which means the alternate __gthread_active_p below cannot be used there. */
+
+#if defined(__FreeBSD__) || (defined(__sun) && defined(__svr4__))
+
+static volatile int __gthread_active = -1;
+
+static void
+__gthread_trigger (void)
+{
+ __gthread_active = 1;
+}
+
+static inline int
+__gthread_active_p (void)
+{
+ static pthread_mutex_t __gthread_active_mutex = PTHREAD_MUTEX_INITIALIZER;
+ static pthread_once_t __gthread_active_once = PTHREAD_ONCE_INIT;
+
+ /* Avoid reading __gthread_active twice on the main code path. */
+ int __gthread_active_latest_value = __gthread_active;
+
+ /* This test is not protected to avoid taking a lock on the main code
+ path so every update of __gthread_active in a threaded program must
+ be atomic with regard to the result of the test. */
+ if (__builtin_expect (__gthread_active_latest_value < 0, 0))
+ {
+ if (__gthrw_(pthread_once))
+ {
+ /* If this really is a threaded program, then we must ensure that
+ __gthread_active has been set to 1 before exiting this block. */
+ __gthrw_(pthread_mutex_lock) (&__gthread_active_mutex);
+ __gthrw_(pthread_once) (&__gthread_active_once, __gthread_trigger);
+ __gthrw_(pthread_mutex_unlock) (&__gthread_active_mutex);
+ }
+
+ /* Make sure we'll never enter this block again. */
+ if (__gthread_active < 0)
+ __gthread_active = 0;
+
+ __gthread_active_latest_value = __gthread_active;
+ }
+
+ return __gthread_active_latest_value != 0;
+}
+
+#else /* neither FreeBSD nor Solaris */
+
+static inline int
+__gthread_active_p (void)
+{
+ static void *const __gthread_active_ptr
+ = __extension__ (void *) &__gthrw_(
+/* Android's C library does not provide pthread_cancel, check for
+ `pthread_create' instead. */
+#ifndef __BIONIC__
+ pthread_cancel
+#else
+ pthread_create
+#endif
+ );
+ return __gthread_active_ptr != 0;
+}
+
+#endif /* FreeBSD or Solaris */
+
+#else /* not __GXX_WEAK__ */
+
+/* Similar to Solaris, HP-UX 11 for PA-RISC provides stubs for pthread
+ calls in shared flavors of the HP-UX C library. Most of the stubs
+ have no functionality. The details are described in the "libc cumulative
+ patch" for each subversion of HP-UX 11. There are two special interfaces
+ provided for checking whether an application is linked to a pthread
+ library or not. However, these interfaces aren't available in early
+ libc versions. We also can't use pthread_once as some libc versions
+ call the init function. So, we use pthread_create to check whether it
+ is possible to create a thread or not. The stub implementation returns
+ the error number ENOSYS. */
+
+#if defined(__hppa__) && defined(__hpux__)
+
+#include <errno.h>
+
+static volatile int __gthread_active = -1;
+
+static void *
+__gthread_start (void *__arg __attribute__((unused)))
+{
+ return NULL;
+}
+
+static void __gthread_active_init (void) __attribute__((noinline));
+static void
+__gthread_active_init (void)
+{
+ static pthread_mutex_t __gthread_active_mutex = PTHREAD_MUTEX_INITIALIZER;
+ pthread_t __t;
+ pthread_attr_t __a;
+ int __result;
+
+ __gthrw_(pthread_mutex_lock) (&__gthread_active_mutex);
+ if (__gthread_active < 0)
+ {
+ __gthrw_(pthread_attr_init) (&__a);
+ __gthrw_(pthread_attr_setdetachstate) (&__a, PTHREAD_CREATE_DETACHED);
+ __result = __gthrw_(pthread_create) (&__t, &__a, __gthread_start, NULL);
+ if (__result != ENOSYS)
+ __gthread_active = 1;
+ else
+ __gthread_active = 0;
+ __gthrw_(pthread_attr_destroy) (&__a);
+ }
+ __gthrw_(pthread_mutex_unlock) (&__gthread_active_mutex);
+}
+
+static inline int
+__gthread_active_p (void)
+{
+ /* Avoid reading __gthread_active twice on the main code path. */
+ int __gthread_active_latest_value = __gthread_active;
+
+ /* This test is not protected to avoid taking a lock on the main code
+ path so every update of __gthread_active in a threaded program must
+ be atomic with regard to the result of the test. */
+ if (__builtin_expect (__gthread_active_latest_value < 0, 0))
+ {
+ __gthread_active_init ();
+ __gthread_active_latest_value = __gthread_active;
+ }
+
+ return __gthread_active_latest_value != 0;
+}
+
+#else /* not hppa-hpux */
+
+static inline int
+__gthread_active_p (void)
+{
+ return 1;
+}
+
+#endif /* hppa-hpux */
+
+#endif /* __GXX_WEAK__ */
+
+#ifdef _LIBOBJC
+
+/* This is the config.h file in libobjc/ */
+#include <config.h>
+
+#ifdef HAVE_SCHED_H
+# include <sched.h>
+#endif
+
+/* Key structure for maintaining thread specific storage */
+static pthread_key_t _objc_thread_storage;
+static pthread_attr_t _objc_thread_attribs;
+
+/* Thread local storage for a single thread */
+static void *thread_local_storage = NULL;
+
+/* Backend initialization functions */
+
+/* Initialize the threads subsystem. */
+static inline int
+__gthread_objc_init_thread_system (void)
+{
+ if (__gthread_active_p ())
+ {
+ /* Initialize the thread storage key. */
+ if (__gthrw_(pthread_key_create) (&_objc_thread_storage, NULL) == 0)
+ {
+ /* The normal default detach state for threads is
+ * PTHREAD_CREATE_JOINABLE which causes threads to not die
+ * when you think they should. */
+ if (__gthrw_(pthread_attr_init) (&_objc_thread_attribs) == 0
+ && __gthrw_(pthread_attr_setdetachstate) (&_objc_thread_attribs,
+ PTHREAD_CREATE_DETACHED) == 0)
+ return 0;
+ }
+ }
+
+ return -1;
+}
+
+/* Close the threads subsystem. */
+static inline int
+__gthread_objc_close_thread_system (void)
+{
+ if (__gthread_active_p ()
+ && __gthrw_(pthread_key_delete) (_objc_thread_storage) == 0
+ && __gthrw_(pthread_attr_destroy) (&_objc_thread_attribs) == 0)
+ return 0;
+
+ return -1;
+}
+
+/* Backend thread functions */
+
+/* Create a new thread of execution. */
+static inline objc_thread_t
+__gthread_objc_thread_detach (void (*func)(void *), void *arg)
+{
+ objc_thread_t thread_id;
+ pthread_t new_thread_handle;
+
+ if (!__gthread_active_p ())
+ return NULL;
+
+ if (!(__gthrw_(pthread_create) (&new_thread_handle, NULL, (void *) func, arg)))
+ thread_id = (objc_thread_t) new_thread_handle;
+ else
+ thread_id = NULL;
+
+ return thread_id;
+}
+
+/* Set the current thread's priority. */
+static inline int
+__gthread_objc_thread_set_priority (int priority)
+{
+ if (!__gthread_active_p ())
+ return -1;
+ else
+ {
+#ifdef _POSIX_PRIORITY_SCHEDULING
+#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
+ pthread_t thread_id = __gthrw_(pthread_self) ();
+ int policy;
+ struct sched_param params;
+ int priority_min, priority_max;
+
+ if (__gthrw_(pthread_getschedparam) (thread_id, &policy, &params) == 0)
+ {
+ if ((priority_max = __gthrw_(sched_get_priority_max) (policy)) == -1)
+ return -1;
+
+ if ((priority_min = __gthrw_(sched_get_priority_min) (policy)) == -1)
+ return -1;
+
+ if (priority > priority_max)
+ priority = priority_max;
+ else if (priority < priority_min)
+ priority = priority_min;
+ params.sched_priority = priority;
+
+ /*
+ * The solaris 7 and several other man pages incorrectly state that
+ * this should be a pointer to policy but pthread.h is universally
+ * at odds with this.
+ */
+ if (__gthrw_(pthread_setschedparam) (thread_id, policy, &params) == 0)
+ return 0;
+ }
+#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
+#endif /* _POSIX_PRIORITY_SCHEDULING */
+ return -1;
+ }
+}
+
+/* Return the current thread's priority. */
+static inline int
+__gthread_objc_thread_get_priority (void)
+{
+#ifdef _POSIX_PRIORITY_SCHEDULING
+#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
+ if (__gthread_active_p ())
+ {
+ int policy;
+ struct sched_param params;
+
+ if (__gthrw_(pthread_getschedparam) (__gthrw_(pthread_self) (), &policy, &params) == 0)
+ return params.sched_priority;
+ else
+ return -1;
+ }
+ else
+#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
+#endif /* _POSIX_PRIORITY_SCHEDULING */
+ return OBJC_THREAD_INTERACTIVE_PRIORITY;
+}
+
+/* Yield our process time to another thread. */
+static inline void
+__gthread_objc_thread_yield (void)
+{
+ if (__gthread_active_p ())
+ __gthrw_(sched_yield) ();
+}
+
+/* Terminate the current thread. */
+static inline int
+__gthread_objc_thread_exit (void)
+{
+ if (__gthread_active_p ())
+ /* exit the thread */
+ __gthrw_(pthread_exit) (&__objc_thread_exit_status);
+
+ /* Failed if we reached here */
+ return -1;
+}
+
+/* Returns an integer value which uniquely describes a thread. */
+static inline objc_thread_t
+__gthread_objc_thread_id (void)
+{
+ if (__gthread_active_p ())
+ return (objc_thread_t) __gthrw_(pthread_self) ();
+ else
+ return (objc_thread_t) 1;
+}
+
+/* Sets the thread's local storage pointer. */
+static inline int
+__gthread_objc_thread_set_data (void *value)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_setspecific) (_objc_thread_storage, value);
+ else
+ {
+ thread_local_storage = value;
+ return 0;
+ }
+}
+
+/* Returns the thread's local storage pointer. */
+static inline void *
+__gthread_objc_thread_get_data (void)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_getspecific) (_objc_thread_storage);
+ else
+ return thread_local_storage;
+}
+
+/* Backend mutex functions */
+
+/* Allocate a mutex. */
+static inline int
+__gthread_objc_mutex_allocate (objc_mutex_t mutex)
+{
+ if (__gthread_active_p ())
+ {
+ mutex->backend = objc_malloc (sizeof (pthread_mutex_t));
+
+ if (__gthrw_(pthread_mutex_init) ((pthread_mutex_t *) mutex->backend, NULL))
+ {
+ objc_free (mutex->backend);
+ mutex->backend = NULL;
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+/* Deallocate a mutex. */
+static inline int
+__gthread_objc_mutex_deallocate (objc_mutex_t mutex)
+{
+ if (__gthread_active_p ())
+ {
+ int count;
+
+ /*
+ * Posix Threads specifically require that the thread be unlocked
+ * for __gthrw_(pthread_mutex_destroy) to work.
+ */
+
+ do
+ {
+ count = __gthrw_(pthread_mutex_unlock) ((pthread_mutex_t *) mutex->backend);
+ if (count < 0)
+ return -1;
+ }
+ while (count);
+
+ if (__gthrw_(pthread_mutex_destroy) ((pthread_mutex_t *) mutex->backend))
+ return -1;
+
+ objc_free (mutex->backend);
+ mutex->backend = NULL;
+ }
+ return 0;
+}
+
+/* Grab a lock on a mutex. */
+static inline int
+__gthread_objc_mutex_lock (objc_mutex_t mutex)
+{
+ if (__gthread_active_p ()
+ && __gthrw_(pthread_mutex_lock) ((pthread_mutex_t *) mutex->backend) != 0)
+ {
+ return -1;
+ }
+
+ return 0;
+}
+
+/* Try to grab a lock on a mutex. */
+static inline int
+__gthread_objc_mutex_trylock (objc_mutex_t mutex)
+{
+ if (__gthread_active_p ()
+ && __gthrw_(pthread_mutex_trylock) ((pthread_mutex_t *) mutex->backend) != 0)
+ {
+ return -1;
+ }
+
+ return 0;
+}
+
+/* Unlock the mutex */
+static inline int
+__gthread_objc_mutex_unlock (objc_mutex_t mutex)
+{
+ if (__gthread_active_p ()
+ && __gthrw_(pthread_mutex_unlock) ((pthread_mutex_t *) mutex->backend) != 0)
+ {
+ return -1;
+ }
+
+ return 0;
+}
+
+/* Backend condition mutex functions */
+
+/* Allocate a condition. */
+static inline int
+__gthread_objc_condition_allocate (objc_condition_t condition)
+{
+ if (__gthread_active_p ())
+ {
+ condition->backend = objc_malloc (sizeof (pthread_cond_t));
+
+ if (__gthrw_(pthread_cond_init) ((pthread_cond_t *) condition->backend, NULL))
+ {
+ objc_free (condition->backend);
+ condition->backend = NULL;
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+/* Deallocate a condition. */
+static inline int
+__gthread_objc_condition_deallocate (objc_condition_t condition)
+{
+ if (__gthread_active_p ())
+ {
+ if (__gthrw_(pthread_cond_destroy) ((pthread_cond_t *) condition->backend))
+ return -1;
+
+ objc_free (condition->backend);
+ condition->backend = NULL;
+ }
+ return 0;
+}
+
+/* Wait on the condition */
+static inline int
+__gthread_objc_condition_wait (objc_condition_t condition, objc_mutex_t mutex)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_cond_wait) ((pthread_cond_t *) condition->backend,
+ (pthread_mutex_t *) mutex->backend);
+ else
+ return 0;
+}
+
+/* Wake up all threads waiting on this condition. */
+static inline int
+__gthread_objc_condition_broadcast (objc_condition_t condition)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_cond_broadcast) ((pthread_cond_t *) condition->backend);
+ else
+ return 0;
+}
+
+/* Wake up one thread waiting on this condition. */
+static inline int
+__gthread_objc_condition_signal (objc_condition_t condition)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_cond_signal) ((pthread_cond_t *) condition->backend);
+ else
+ return 0;
+}
+
+#else /* _LIBOBJC */
+
+static inline int
+__gthread_create (__gthread_t *__threadid, void *(*__func) (void*),
+ void *__args)
+{
+ return __gthrw_(pthread_create) (__threadid, NULL, __func, __args);
+}
+
+static inline int
+__gthread_join (__gthread_t __threadid, void **__value_ptr)
+{
+ return __gthrw_(pthread_join) (__threadid, __value_ptr);
+}
+
+static inline int
+__gthread_detach (__gthread_t __threadid)
+{
+ return __gthrw_(pthread_detach) (__threadid);
+}
+
+static inline int
+__gthread_equal (__gthread_t __t1, __gthread_t __t2)
+{
+ return __gthrw_(pthread_equal) (__t1, __t2);
+}
+
+static inline __gthread_t
+__gthread_self (void)
+{
+ return __gthrw_(pthread_self) ();
+}
+
+static inline int
+__gthread_yield (void)
+{
+ return __gthrw_(sched_yield) ();
+}
+
+static inline int
+__gthread_once (__gthread_once_t *__once, void (*__func) (void))
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_once) (__once, __func);
+ else
+ return -1;
+}
+
+static inline int
+__gthread_key_create (__gthread_key_t *__key, void (*__dtor) (void *))
+{
+ return __gthrw_(pthread_key_create) (__key, __dtor);
+}
+
+static inline int
+__gthread_key_delete (__gthread_key_t __key)
+{
+ return __gthrw_(pthread_key_delete) (__key);
+}
+
+static inline void *
+__gthread_getspecific (__gthread_key_t __key)
+{
+ return __gthrw_(pthread_getspecific) (__key);
+}
+
+static inline int
+__gthread_setspecific (__gthread_key_t __key, const void *__ptr)
+{
+ return __gthrw_(pthread_setspecific) (__key, __ptr);
+}
+
+static inline int
+__gthread_mutex_destroy (__gthread_mutex_t *__mutex)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_mutex_destroy) (__mutex);
+ else
+ return 0;
+}
+
+static inline int
+__gthread_mutex_lock (__gthread_mutex_t *__mutex)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_mutex_lock) (__mutex);
+ else
+ return 0;
+}
+
+static inline int
+__gthread_mutex_trylock (__gthread_mutex_t *__mutex)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_mutex_trylock) (__mutex);
+ else
+ return 0;
+}
+
+#ifdef _POSIX_TIMEOUTS
+#if _POSIX_TIMEOUTS >= 0
+static inline int
+__gthread_mutex_timedlock (__gthread_mutex_t *__mutex,
+ const __gthread_time_t *__abs_timeout)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_mutex_timedlock) (__mutex, __abs_timeout);
+ else
+ return 0;
+}
+#endif
+#endif
+
+static inline int
+__gthread_mutex_unlock (__gthread_mutex_t *__mutex)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_mutex_unlock) (__mutex);
+ else
+ return 0;
+}
+
+#ifndef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+static inline int
+__gthread_recursive_mutex_init_function (__gthread_recursive_mutex_t *__mutex)
+{
+ if (__gthread_active_p ())
+ {
+ pthread_mutexattr_t __attr;
+ int __r;
+
+ __r = __gthrw_(pthread_mutexattr_init) (&__attr);
+ if (!__r)
+ __r = __gthrw_(pthread_mutexattr_settype) (&__attr,
+ PTHREAD_MUTEX_RECURSIVE);
+ if (!__r)
+ __r = __gthrw_(pthread_mutex_init) (__mutex, &__attr);
+ if (!__r)
+ __r = __gthrw_(pthread_mutexattr_destroy) (&__attr);
+ return __r;
+ }
+ return 0;
+}
+#endif
+
+static inline int
+__gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *__mutex)
+{
+ return __gthread_mutex_lock (__mutex);
+}
+
+static inline int
+__gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *__mutex)
+{
+ return __gthread_mutex_trylock (__mutex);
+}
+
+#ifdef _POSIX_TIMEOUTS
+#if _POSIX_TIMEOUTS >= 0
+static inline int
+__gthread_recursive_mutex_timedlock (__gthread_recursive_mutex_t *__mutex,
+ const __gthread_time_t *__abs_timeout)
+{
+ return __gthread_mutex_timedlock (__mutex, __abs_timeout);
+}
+#endif
+#endif
+
+static inline int
+__gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *__mutex)
+{
+ return __gthread_mutex_unlock (__mutex);
+}
+
+static inline int
+__gthread_cond_broadcast (__gthread_cond_t *__cond)
+{
+ return __gthrw_(pthread_cond_broadcast) (__cond);
+}
+
+static inline int
+__gthread_cond_signal (__gthread_cond_t *__cond)
+{
+ return __gthrw_(pthread_cond_signal) (__cond);
+}
+
+static inline int
+__gthread_cond_wait (__gthread_cond_t *__cond, __gthread_mutex_t *__mutex)
+{
+ return __gthrw_(pthread_cond_wait) (__cond, __mutex);
+}
+
+static inline int
+__gthread_cond_timedwait (__gthread_cond_t *__cond, __gthread_mutex_t *__mutex,
+ const __gthread_time_t *__abs_timeout)
+{
+ return __gthrw_(pthread_cond_timedwait) (__cond, __mutex, __abs_timeout);
+}
+
+static inline int
+__gthread_cond_wait_recursive (__gthread_cond_t *__cond,
+ __gthread_recursive_mutex_t *__mutex)
+{
+ return __gthread_cond_wait (__cond, __mutex);
+}
+
+static inline int
+__gthread_cond_timedwait_recursive (__gthread_cond_t *__cond,
+ __gthread_recursive_mutex_t *__mutex,
+ const __gthread_time_t *__abs_timeout)
+{
+ return __gthread_cond_timedwait (__cond, __mutex, __abs_timeout);
+}
+
+static inline int
+__gthread_cond_destroy (__gthread_cond_t* __cond)
+{
+ return __gthrw_(pthread_cond_destroy) (__cond);
+}
+
+#endif /* _LIBOBJC */
+
+#endif /* ! _GLIBCXX_GCC_GTHR_POSIX_H */
diff --git a/i686-linux/include/c++/4.4.3/i686-linux/bits/gthr-posix.h b/i686-linux/include/c++/4.4.3/i686-linux/bits/gthr-posix.h
new file mode 100644
index 0000000..363a6e7
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/i686-linux/bits/gthr-posix.h
@@ -0,0 +1,905 @@
+/* Threads compatibility routines for libgcc2 and libobjc. */
+/* Compile this one with gcc. */
+/* Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+ 2008, 2009 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+#ifndef _GLIBCXX_GCC_GTHR_POSIX_H
+#define _GLIBCXX_GCC_GTHR_POSIX_H
+
+/* POSIX threads specific definitions.
+ Easy, since the interface is just one-to-one mapping. */
+
+#define __GTHREADS 1
+#define __GTHREADS_CXX0X 1
+
+/* Some implementations of <pthread.h> require this to be defined. */
+#if !defined(_REENTRANT) && defined(__osf__)
+#define _REENTRANT 1
+#endif
+
+#include <pthread.h>
+#include <unistd.h>
+
+typedef pthread_t __gthread_t;
+typedef pthread_key_t __gthread_key_t;
+typedef pthread_once_t __gthread_once_t;
+typedef pthread_mutex_t __gthread_mutex_t;
+typedef pthread_mutex_t __gthread_recursive_mutex_t;
+typedef pthread_cond_t __gthread_cond_t;
+typedef struct timespec __gthread_time_t;
+
+/* POSIX like conditional variables are supported. Please look at comments
+ in gthr.h for details. */
+#define __GTHREAD_HAS_COND 1
+
+#define __GTHREAD_MUTEX_INIT PTHREAD_MUTEX_INITIALIZER
+#define __GTHREAD_ONCE_INIT PTHREAD_ONCE_INIT
+#if defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER)
+#define __GTHREAD_RECURSIVE_MUTEX_INIT PTHREAD_RECURSIVE_MUTEX_INITIALIZER
+#elif defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP)
+#define __GTHREAD_RECURSIVE_MUTEX_INIT PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+#else
+#define __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION __gthread_recursive_mutex_init_function
+#endif
+#define __GTHREAD_COND_INIT PTHREAD_COND_INITIALIZER
+#define __GTHREAD_TIME_INIT {0,0}
+
+#if __GXX_WEAK__ && _GLIBCXX_GTHREAD_USE_WEAK
+# ifndef __gthrw_pragma
+# define __gthrw_pragma(pragma)
+# endif
+# define __gthrw2(name,name2,type) \
+ static __typeof(type) name __attribute__ ((__weakref__(#name2))); \
+ __gthrw_pragma(weak type)
+# define __gthrw_(name) __gthrw_ ## name
+#else
+# define __gthrw2(name,name2,type)
+# define __gthrw_(name) name
+#endif
+
+/* Typically, __gthrw_foo is a weak reference to symbol foo. */
+#define __gthrw(name) __gthrw2(__gthrw_ ## name,name,name)
+
+/* On Tru64, /usr/include/pthread.h uses #pragma extern_prefix "__" to
+ map a subset of the POSIX pthread API to mangled versions of their
+ names. */
+#if defined(__osf__) && defined(_PTHREAD_USE_MANGLED_NAMES_)
+#define __gthrw3(name) __gthrw2(__gthrw_ ## name, __ ## name, name)
+__gthrw3(pthread_once)
+__gthrw3(pthread_getspecific)
+__gthrw3(pthread_setspecific)
+
+__gthrw3(pthread_create)
+__gthrw3(pthread_join)
+__gthrw3(pthread_detach)
+__gthrw3(pthread_equal)
+__gthrw3(pthread_self)
+__gthrw3(pthread_cancel)
+__gthrw3(sched_yield)
+
+__gthrw3(pthread_mutex_lock)
+__gthrw3(pthread_mutex_trylock)
+#ifdef _POSIX_TIMEOUTS
+#if _POSIX_TIMEOUTS >= 0
+__gthrw3(pthread_mutex_timedlock)
+#endif
+#endif /* _POSIX_TIMEOUTS */
+__gthrw3(pthread_mutex_unlock)
+__gthrw3(pthread_mutex_init)
+__gthrw3(pthread_mutex_destroy)
+
+__gthrw3(pthread_cond_broadcast)
+__gthrw3(pthread_cond_signal)
+__gthrw3(pthread_cond_wait)
+__gthrw3(pthread_cond_timedwait)
+__gthrw3(pthread_cond_destroy)
+#else
+__gthrw(pthread_once)
+__gthrw(pthread_getspecific)
+__gthrw(pthread_setspecific)
+
+__gthrw(pthread_create)
+__gthrw(pthread_join)
+__gthrw(pthread_equal)
+__gthrw(pthread_self)
+__gthrw(pthread_detach)
+#ifndef __BIONIC__
+__gthrw(pthread_cancel)
+#endif
+__gthrw(sched_yield)
+
+__gthrw(pthread_mutex_lock)
+__gthrw(pthread_mutex_trylock)
+#ifdef _POSIX_TIMEOUTS
+#if _POSIX_TIMEOUTS >= 0
+__gthrw(pthread_mutex_timedlock)
+#endif
+#endif /* _POSIX_TIMEOUTS */
+__gthrw(pthread_mutex_unlock)
+__gthrw(pthread_mutex_init)
+__gthrw(pthread_mutex_destroy)
+
+__gthrw(pthread_cond_broadcast)
+__gthrw(pthread_cond_signal)
+__gthrw(pthread_cond_wait)
+__gthrw(pthread_cond_timedwait)
+__gthrw(pthread_cond_destroy)
+#endif
+
+__gthrw(pthread_key_create)
+__gthrw(pthread_key_delete)
+__gthrw(pthread_mutexattr_init)
+__gthrw(pthread_mutexattr_settype)
+__gthrw(pthread_mutexattr_destroy)
+
+
+#if defined(_LIBOBJC) || defined(_LIBOBJC_WEAK)
+/* Objective-C. */
+#if defined(__osf__) && defined(_PTHREAD_USE_MANGLED_NAMES_)
+__gthrw3(pthread_cond_init)
+__gthrw3(pthread_exit)
+#else
+__gthrw(pthread_cond_init)
+__gthrw(pthread_exit)
+#endif /* __osf__ && _PTHREAD_USE_MANGLED_NAMES_ */
+#ifdef _POSIX_PRIORITY_SCHEDULING
+#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
+__gthrw(sched_get_priority_max)
+__gthrw(sched_get_priority_min)
+#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
+#endif /* _POSIX_PRIORITY_SCHEDULING */
+__gthrw(pthread_attr_destroy)
+__gthrw(pthread_attr_init)
+__gthrw(pthread_attr_setdetachstate)
+#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
+__gthrw(pthread_getschedparam)
+__gthrw(pthread_setschedparam)
+#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
+#endif /* _LIBOBJC || _LIBOBJC_WEAK */
+
+#if __GXX_WEAK__ && _GLIBCXX_GTHREAD_USE_WEAK
+
+/* On Solaris 2.6 up to 9, the libc exposes a POSIX threads interface even if
+ -pthreads is not specified. The functions are dummies and most return an
+ error value. However pthread_once returns 0 without invoking the routine
+ it is passed so we cannot pretend that the interface is active if -pthreads
+ is not specified. On Solaris 2.5.1, the interface is not exposed at all so
+ we need to play the usual game with weak symbols. On Solaris 10 and up, a
+ working interface is always exposed. On FreeBSD 6 and later, libc also
+ exposes a dummy POSIX threads interface, similar to what Solaris 2.6 up
+ to 9 does. FreeBSD >= 700014 even provides a pthread_cancel stub in libc,
+ which means the alternate __gthread_active_p below cannot be used there. */
+
+#if defined(__FreeBSD__) || (defined(__sun) && defined(__svr4__))
+
+static volatile int __gthread_active = -1;
+
+static void
+__gthread_trigger (void)
+{
+ __gthread_active = 1;
+}
+
+static inline int
+__gthread_active_p (void)
+{
+ static pthread_mutex_t __gthread_active_mutex = PTHREAD_MUTEX_INITIALIZER;
+ static pthread_once_t __gthread_active_once = PTHREAD_ONCE_INIT;
+
+ /* Avoid reading __gthread_active twice on the main code path. */
+ int __gthread_active_latest_value = __gthread_active;
+
+ /* This test is not protected to avoid taking a lock on the main code
+ path so every update of __gthread_active in a threaded program must
+ be atomic with regard to the result of the test. */
+ if (__builtin_expect (__gthread_active_latest_value < 0, 0))
+ {
+ if (__gthrw_(pthread_once))
+ {
+ /* If this really is a threaded program, then we must ensure that
+ __gthread_active has been set to 1 before exiting this block. */
+ __gthrw_(pthread_mutex_lock) (&__gthread_active_mutex);
+ __gthrw_(pthread_once) (&__gthread_active_once, __gthread_trigger);
+ __gthrw_(pthread_mutex_unlock) (&__gthread_active_mutex);
+ }
+
+ /* Make sure we'll never enter this block again. */
+ if (__gthread_active < 0)
+ __gthread_active = 0;
+
+ __gthread_active_latest_value = __gthread_active;
+ }
+
+ return __gthread_active_latest_value != 0;
+}
+
+#else /* neither FreeBSD nor Solaris */
+
+static inline int
+__gthread_active_p (void)
+{
+ static void *const __gthread_active_ptr
+ = __extension__ (void *) &__gthrw_(
+/* Android's C library does not provide pthread_cancel, check for
+ `pthread_create' instead. */
+#ifndef __BIONIC__
+ pthread_cancel
+#else
+ pthread_create
+#endif
+ );
+ return __gthread_active_ptr != 0;
+}
+
+#endif /* FreeBSD or Solaris */
+
+#else /* not __GXX_WEAK__ */
+
+/* Similar to Solaris, HP-UX 11 for PA-RISC provides stubs for pthread
+ calls in shared flavors of the HP-UX C library. Most of the stubs
+ have no functionality. The details are described in the "libc cumulative
+ patch" for each subversion of HP-UX 11. There are two special interfaces
+ provided for checking whether an application is linked to a pthread
+ library or not. However, these interfaces aren't available in early
+ libc versions. We also can't use pthread_once as some libc versions
+ call the init function. So, we use pthread_create to check whether it
+ is possible to create a thread or not. The stub implementation returns
+ the error number ENOSYS. */
+
+#if defined(__hppa__) && defined(__hpux__)
+
+#include <errno.h>
+
+static volatile int __gthread_active = -1;
+
+static void *
+__gthread_start (void *__arg __attribute__((unused)))
+{
+ return NULL;
+}
+
+static void __gthread_active_init (void) __attribute__((noinline));
+static void
+__gthread_active_init (void)
+{
+ static pthread_mutex_t __gthread_active_mutex = PTHREAD_MUTEX_INITIALIZER;
+ pthread_t __t;
+ pthread_attr_t __a;
+ int __result;
+
+ __gthrw_(pthread_mutex_lock) (&__gthread_active_mutex);
+ if (__gthread_active < 0)
+ {
+ __gthrw_(pthread_attr_init) (&__a);
+ __gthrw_(pthread_attr_setdetachstate) (&__a, PTHREAD_CREATE_DETACHED);
+ __result = __gthrw_(pthread_create) (&__t, &__a, __gthread_start, NULL);
+ if (__result != ENOSYS)
+ __gthread_active = 1;
+ else
+ __gthread_active = 0;
+ __gthrw_(pthread_attr_destroy) (&__a);
+ }
+ __gthrw_(pthread_mutex_unlock) (&__gthread_active_mutex);
+}
+
+static inline int
+__gthread_active_p (void)
+{
+ /* Avoid reading __gthread_active twice on the main code path. */
+ int __gthread_active_latest_value = __gthread_active;
+
+ /* This test is not protected to avoid taking a lock on the main code
+ path so every update of __gthread_active in a threaded program must
+ be atomic with regard to the result of the test. */
+ if (__builtin_expect (__gthread_active_latest_value < 0, 0))
+ {
+ __gthread_active_init ();
+ __gthread_active_latest_value = __gthread_active;
+ }
+
+ return __gthread_active_latest_value != 0;
+}
+
+#else /* not hppa-hpux */
+
+static inline int
+__gthread_active_p (void)
+{
+ return 1;
+}
+
+#endif /* hppa-hpux */
+
+#endif /* __GXX_WEAK__ */
+
+#ifdef _LIBOBJC
+
+/* This is the config.h file in libobjc/ */
+#include <config.h>
+
+#ifdef HAVE_SCHED_H
+# include <sched.h>
+#endif
+
+/* Key structure for maintaining thread specific storage */
+static pthread_key_t _objc_thread_storage;
+static pthread_attr_t _objc_thread_attribs;
+
+/* Thread local storage for a single thread */
+static void *thread_local_storage = NULL;
+
+/* Backend initialization functions */
+
+/* Initialize the threads subsystem. */
+static inline int
+__gthread_objc_init_thread_system (void)
+{
+ if (__gthread_active_p ())
+ {
+ /* Initialize the thread storage key. */
+ if (__gthrw_(pthread_key_create) (&_objc_thread_storage, NULL) == 0)
+ {
+ /* The normal default detach state for threads is
+ * PTHREAD_CREATE_JOINABLE which causes threads to not die
+ * when you think they should. */
+ if (__gthrw_(pthread_attr_init) (&_objc_thread_attribs) == 0
+ && __gthrw_(pthread_attr_setdetachstate) (&_objc_thread_attribs,
+ PTHREAD_CREATE_DETACHED) == 0)
+ return 0;
+ }
+ }
+
+ return -1;
+}
+
+/* Close the threads subsystem. */
+static inline int
+__gthread_objc_close_thread_system (void)
+{
+ if (__gthread_active_p ()
+ && __gthrw_(pthread_key_delete) (_objc_thread_storage) == 0
+ && __gthrw_(pthread_attr_destroy) (&_objc_thread_attribs) == 0)
+ return 0;
+
+ return -1;
+}
+
+/* Backend thread functions */
+
+/* Create a new thread of execution. */
+static inline objc_thread_t
+__gthread_objc_thread_detach (void (*func)(void *), void *arg)
+{
+ objc_thread_t thread_id;
+ pthread_t new_thread_handle;
+
+ if (!__gthread_active_p ())
+ return NULL;
+
+ if (!(__gthrw_(pthread_create) (&new_thread_handle, NULL, (void *) func, arg)))
+ thread_id = (objc_thread_t) new_thread_handle;
+ else
+ thread_id = NULL;
+
+ return thread_id;
+}
+
+/* Set the current thread's priority. */
+static inline int
+__gthread_objc_thread_set_priority (int priority)
+{
+ if (!__gthread_active_p ())
+ return -1;
+ else
+ {
+#ifdef _POSIX_PRIORITY_SCHEDULING
+#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
+ pthread_t thread_id = __gthrw_(pthread_self) ();
+ int policy;
+ struct sched_param params;
+ int priority_min, priority_max;
+
+ if (__gthrw_(pthread_getschedparam) (thread_id, &policy, &params) == 0)
+ {
+ if ((priority_max = __gthrw_(sched_get_priority_max) (policy)) == -1)
+ return -1;
+
+ if ((priority_min = __gthrw_(sched_get_priority_min) (policy)) == -1)
+ return -1;
+
+ if (priority > priority_max)
+ priority = priority_max;
+ else if (priority < priority_min)
+ priority = priority_min;
+ params.sched_priority = priority;
+
+ /*
+ * The solaris 7 and several other man pages incorrectly state that
+ * this should be a pointer to policy but pthread.h is universally
+ * at odds with this.
+ */
+ if (__gthrw_(pthread_setschedparam) (thread_id, policy, &params) == 0)
+ return 0;
+ }
+#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
+#endif /* _POSIX_PRIORITY_SCHEDULING */
+ return -1;
+ }
+}
+
+/* Return the current thread's priority. */
+static inline int
+__gthread_objc_thread_get_priority (void)
+{
+#ifdef _POSIX_PRIORITY_SCHEDULING
+#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
+ if (__gthread_active_p ())
+ {
+ int policy;
+ struct sched_param params;
+
+ if (__gthrw_(pthread_getschedparam) (__gthrw_(pthread_self) (), &policy, &params) == 0)
+ return params.sched_priority;
+ else
+ return -1;
+ }
+ else
+#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
+#endif /* _POSIX_PRIORITY_SCHEDULING */
+ return OBJC_THREAD_INTERACTIVE_PRIORITY;
+}
+
+/* Yield our process time to another thread. */
+static inline void
+__gthread_objc_thread_yield (void)
+{
+ if (__gthread_active_p ())
+ __gthrw_(sched_yield) ();
+}
+
+/* Terminate the current thread. */
+static inline int
+__gthread_objc_thread_exit (void)
+{
+ if (__gthread_active_p ())
+ /* exit the thread */
+ __gthrw_(pthread_exit) (&__objc_thread_exit_status);
+
+ /* Failed if we reached here */
+ return -1;
+}
+
+/* Returns an integer value which uniquely describes a thread. */
+static inline objc_thread_t
+__gthread_objc_thread_id (void)
+{
+ if (__gthread_active_p ())
+ return (objc_thread_t) __gthrw_(pthread_self) ();
+ else
+ return (objc_thread_t) 1;
+}
+
+/* Sets the thread's local storage pointer. */
+static inline int
+__gthread_objc_thread_set_data (void *value)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_setspecific) (_objc_thread_storage, value);
+ else
+ {
+ thread_local_storage = value;
+ return 0;
+ }
+}
+
+/* Returns the thread's local storage pointer. */
+static inline void *
+__gthread_objc_thread_get_data (void)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_getspecific) (_objc_thread_storage);
+ else
+ return thread_local_storage;
+}
+
+/* Backend mutex functions */
+
+/* Allocate a mutex. */
+static inline int
+__gthread_objc_mutex_allocate (objc_mutex_t mutex)
+{
+ if (__gthread_active_p ())
+ {
+ mutex->backend = objc_malloc (sizeof (pthread_mutex_t));
+
+ if (__gthrw_(pthread_mutex_init) ((pthread_mutex_t *) mutex->backend, NULL))
+ {
+ objc_free (mutex->backend);
+ mutex->backend = NULL;
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+/* Deallocate a mutex. */
+static inline int
+__gthread_objc_mutex_deallocate (objc_mutex_t mutex)
+{
+ if (__gthread_active_p ())
+ {
+ int count;
+
+ /*
+ * Posix Threads specifically require that the thread be unlocked
+ * for __gthrw_(pthread_mutex_destroy) to work.
+ */
+
+ do
+ {
+ count = __gthrw_(pthread_mutex_unlock) ((pthread_mutex_t *) mutex->backend);
+ if (count < 0)
+ return -1;
+ }
+ while (count);
+
+ if (__gthrw_(pthread_mutex_destroy) ((pthread_mutex_t *) mutex->backend))
+ return -1;
+
+ objc_free (mutex->backend);
+ mutex->backend = NULL;
+ }
+ return 0;
+}
+
+/* Grab a lock on a mutex. */
+static inline int
+__gthread_objc_mutex_lock (objc_mutex_t mutex)
+{
+ if (__gthread_active_p ()
+ && __gthrw_(pthread_mutex_lock) ((pthread_mutex_t *) mutex->backend) != 0)
+ {
+ return -1;
+ }
+
+ return 0;
+}
+
+/* Try to grab a lock on a mutex. */
+static inline int
+__gthread_objc_mutex_trylock (objc_mutex_t mutex)
+{
+ if (__gthread_active_p ()
+ && __gthrw_(pthread_mutex_trylock) ((pthread_mutex_t *) mutex->backend) != 0)
+ {
+ return -1;
+ }
+
+ return 0;
+}
+
+/* Unlock the mutex */
+static inline int
+__gthread_objc_mutex_unlock (objc_mutex_t mutex)
+{
+ if (__gthread_active_p ()
+ && __gthrw_(pthread_mutex_unlock) ((pthread_mutex_t *) mutex->backend) != 0)
+ {
+ return -1;
+ }
+
+ return 0;
+}
+
+/* Backend condition mutex functions */
+
+/* Allocate a condition. */
+static inline int
+__gthread_objc_condition_allocate (objc_condition_t condition)
+{
+ if (__gthread_active_p ())
+ {
+ condition->backend = objc_malloc (sizeof (pthread_cond_t));
+
+ if (__gthrw_(pthread_cond_init) ((pthread_cond_t *) condition->backend, NULL))
+ {
+ objc_free (condition->backend);
+ condition->backend = NULL;
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+/* Deallocate a condition. */
+static inline int
+__gthread_objc_condition_deallocate (objc_condition_t condition)
+{
+ if (__gthread_active_p ())
+ {
+ if (__gthrw_(pthread_cond_destroy) ((pthread_cond_t *) condition->backend))
+ return -1;
+
+ objc_free (condition->backend);
+ condition->backend = NULL;
+ }
+ return 0;
+}
+
+/* Wait on the condition */
+static inline int
+__gthread_objc_condition_wait (objc_condition_t condition, objc_mutex_t mutex)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_cond_wait) ((pthread_cond_t *) condition->backend,
+ (pthread_mutex_t *) mutex->backend);
+ else
+ return 0;
+}
+
+/* Wake up all threads waiting on this condition. */
+static inline int
+__gthread_objc_condition_broadcast (objc_condition_t condition)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_cond_broadcast) ((pthread_cond_t *) condition->backend);
+ else
+ return 0;
+}
+
+/* Wake up one thread waiting on this condition. */
+static inline int
+__gthread_objc_condition_signal (objc_condition_t condition)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_cond_signal) ((pthread_cond_t *) condition->backend);
+ else
+ return 0;
+}
+
+#else /* _LIBOBJC */
+
+static inline int
+__gthread_create (__gthread_t *__threadid, void *(*__func) (void*),
+ void *__args)
+{
+ return __gthrw_(pthread_create) (__threadid, NULL, __func, __args);
+}
+
+static inline int
+__gthread_join (__gthread_t __threadid, void **__value_ptr)
+{
+ return __gthrw_(pthread_join) (__threadid, __value_ptr);
+}
+
+static inline int
+__gthread_detach (__gthread_t __threadid)
+{
+ return __gthrw_(pthread_detach) (__threadid);
+}
+
+static inline int
+__gthread_equal (__gthread_t __t1, __gthread_t __t2)
+{
+ return __gthrw_(pthread_equal) (__t1, __t2);
+}
+
+static inline __gthread_t
+__gthread_self (void)
+{
+ return __gthrw_(pthread_self) ();
+}
+
+static inline int
+__gthread_yield (void)
+{
+ return __gthrw_(sched_yield) ();
+}
+
+static inline int
+__gthread_once (__gthread_once_t *__once, void (*__func) (void))
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_once) (__once, __func);
+ else
+ return -1;
+}
+
+static inline int
+__gthread_key_create (__gthread_key_t *__key, void (*__dtor) (void *))
+{
+ return __gthrw_(pthread_key_create) (__key, __dtor);
+}
+
+static inline int
+__gthread_key_delete (__gthread_key_t __key)
+{
+ return __gthrw_(pthread_key_delete) (__key);
+}
+
+static inline void *
+__gthread_getspecific (__gthread_key_t __key)
+{
+ return __gthrw_(pthread_getspecific) (__key);
+}
+
+static inline int
+__gthread_setspecific (__gthread_key_t __key, const void *__ptr)
+{
+ return __gthrw_(pthread_setspecific) (__key, __ptr);
+}
+
+static inline int
+__gthread_mutex_destroy (__gthread_mutex_t *__mutex)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_mutex_destroy) (__mutex);
+ else
+ return 0;
+}
+
+static inline int
+__gthread_mutex_lock (__gthread_mutex_t *__mutex)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_mutex_lock) (__mutex);
+ else
+ return 0;
+}
+
+static inline int
+__gthread_mutex_trylock (__gthread_mutex_t *__mutex)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_mutex_trylock) (__mutex);
+ else
+ return 0;
+}
+
+#ifdef _POSIX_TIMEOUTS
+#if _POSIX_TIMEOUTS >= 0
+static inline int
+__gthread_mutex_timedlock (__gthread_mutex_t *__mutex,
+ const __gthread_time_t *__abs_timeout)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_mutex_timedlock) (__mutex, __abs_timeout);
+ else
+ return 0;
+}
+#endif
+#endif
+
+static inline int
+__gthread_mutex_unlock (__gthread_mutex_t *__mutex)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_mutex_unlock) (__mutex);
+ else
+ return 0;
+}
+
+#ifndef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+static inline int
+__gthread_recursive_mutex_init_function (__gthread_recursive_mutex_t *__mutex)
+{
+ if (__gthread_active_p ())
+ {
+ pthread_mutexattr_t __attr;
+ int __r;
+
+ __r = __gthrw_(pthread_mutexattr_init) (&__attr);
+ if (!__r)
+ __r = __gthrw_(pthread_mutexattr_settype) (&__attr,
+ PTHREAD_MUTEX_RECURSIVE);
+ if (!__r)
+ __r = __gthrw_(pthread_mutex_init) (__mutex, &__attr);
+ if (!__r)
+ __r = __gthrw_(pthread_mutexattr_destroy) (&__attr);
+ return __r;
+ }
+ return 0;
+}
+#endif
+
+static inline int
+__gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *__mutex)
+{
+ return __gthread_mutex_lock (__mutex);
+}
+
+static inline int
+__gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *__mutex)
+{
+ return __gthread_mutex_trylock (__mutex);
+}
+
+#ifdef _POSIX_TIMEOUTS
+#if _POSIX_TIMEOUTS >= 0
+static inline int
+__gthread_recursive_mutex_timedlock (__gthread_recursive_mutex_t *__mutex,
+ const __gthread_time_t *__abs_timeout)
+{
+ return __gthread_mutex_timedlock (__mutex, __abs_timeout);
+}
+#endif
+#endif
+
+static inline int
+__gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *__mutex)
+{
+ return __gthread_mutex_unlock (__mutex);
+}
+
+static inline int
+__gthread_cond_broadcast (__gthread_cond_t *__cond)
+{
+ return __gthrw_(pthread_cond_broadcast) (__cond);
+}
+
+static inline int
+__gthread_cond_signal (__gthread_cond_t *__cond)
+{
+ return __gthrw_(pthread_cond_signal) (__cond);
+}
+
+static inline int
+__gthread_cond_wait (__gthread_cond_t *__cond, __gthread_mutex_t *__mutex)
+{
+ return __gthrw_(pthread_cond_wait) (__cond, __mutex);
+}
+
+static inline int
+__gthread_cond_timedwait (__gthread_cond_t *__cond, __gthread_mutex_t *__mutex,
+ const __gthread_time_t *__abs_timeout)
+{
+ return __gthrw_(pthread_cond_timedwait) (__cond, __mutex, __abs_timeout);
+}
+
+static inline int
+__gthread_cond_wait_recursive (__gthread_cond_t *__cond,
+ __gthread_recursive_mutex_t *__mutex)
+{
+ return __gthread_cond_wait (__cond, __mutex);
+}
+
+static inline int
+__gthread_cond_timedwait_recursive (__gthread_cond_t *__cond,
+ __gthread_recursive_mutex_t *__mutex,
+ const __gthread_time_t *__abs_timeout)
+{
+ return __gthread_cond_timedwait (__cond, __mutex, __abs_timeout);
+}
+
+static inline int
+__gthread_cond_destroy (__gthread_cond_t* __cond)
+{
+ return __gthrw_(pthread_cond_destroy) (__cond);
+}
+
+#endif /* _LIBOBJC */
+
+#endif /* ! _GLIBCXX_GCC_GTHR_POSIX_H */
diff --git a/i686-linux/include/c++/4.4.3/i686-linux/bits/gthr-single.h b/i686-linux/include/c++/4.4.3/i686-linux/bits/gthr-single.h
new file mode 100644
index 0000000..f2b132a
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/i686-linux/bits/gthr-single.h
@@ -0,0 +1,292 @@
+/* Threads compatibility routines for libgcc2 and libobjc. */
+/* Compile this one with gcc. */
+/* Copyright (C) 1997, 1999, 2000, 2004, 2008, 2009
+ Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+#ifndef _GLIBCXX_GCC_GTHR_SINGLE_H
+#define _GLIBCXX_GCC_GTHR_SINGLE_H
+
+/* Just provide compatibility for mutex handling. */
+
+typedef int __gthread_key_t;
+typedef int __gthread_once_t;
+typedef int __gthread_mutex_t;
+typedef int __gthread_recursive_mutex_t;
+
+#define __GTHREAD_ONCE_INIT 0
+#define __GTHREAD_MUTEX_INIT 0
+#define __GTHREAD_RECURSIVE_MUTEX_INIT 0
+
+#define _GLIBCXX_UNUSED __attribute__((unused))
+
+#ifdef _LIBOBJC
+
+/* Thread local storage for a single thread */
+static void *thread_local_storage = NULL;
+
+/* Backend initialization functions */
+
+/* Initialize the threads subsystem. */
+static inline int
+__gthread_objc_init_thread_system (void)
+{
+ /* No thread support available */
+ return -1;
+}
+
+/* Close the threads subsystem. */
+static inline int
+__gthread_objc_close_thread_system (void)
+{
+ /* No thread support available */
+ return -1;
+}
+
+/* Backend thread functions */
+
+/* Create a new thread of execution. */
+static inline objc_thread_t
+__gthread_objc_thread_detach (void (* func)(void *), void * arg _GLIBCXX_UNUSED)
+{
+ /* No thread support available */
+ return NULL;
+}
+
+/* Set the current thread's priority. */
+static inline int
+__gthread_objc_thread_set_priority (int priority _GLIBCXX_UNUSED)
+{
+ /* No thread support available */
+ return -1;
+}
+
+/* Return the current thread's priority. */
+static inline int
+__gthread_objc_thread_get_priority (void)
+{
+ return OBJC_THREAD_INTERACTIVE_PRIORITY;
+}
+
+/* Yield our process time to another thread. */
+static inline void
+__gthread_objc_thread_yield (void)
+{
+ return;
+}
+
+/* Terminate the current thread. */
+static inline int
+__gthread_objc_thread_exit (void)
+{
+ /* No thread support available */
+ /* Should we really exit the program */
+ /* exit (&__objc_thread_exit_status); */
+ return -1;
+}
+
+/* Returns an integer value which uniquely describes a thread. */
+static inline objc_thread_t
+__gthread_objc_thread_id (void)
+{
+ /* No thread support, use 1. */
+ return (objc_thread_t) 1;
+}
+
+/* Sets the thread's local storage pointer. */
+static inline int
+__gthread_objc_thread_set_data (void *value)
+{
+ thread_local_storage = value;
+ return 0;
+}
+
+/* Returns the thread's local storage pointer. */
+static inline void *
+__gthread_objc_thread_get_data (void)
+{
+ return thread_local_storage;
+}
+
+/* Backend mutex functions */
+
+/* Allocate a mutex. */
+static inline int
+__gthread_objc_mutex_allocate (objc_mutex_t mutex _GLIBCXX_UNUSED)
+{
+ return 0;
+}
+
+/* Deallocate a mutex. */
+static inline int
+__gthread_objc_mutex_deallocate (objc_mutex_t mutex _GLIBCXX_UNUSED)
+{
+ return 0;
+}
+
+/* Grab a lock on a mutex. */
+static inline int
+__gthread_objc_mutex_lock (objc_mutex_t mutex _GLIBCXX_UNUSED)
+{
+ /* There can only be one thread, so we always get the lock */
+ return 0;
+}
+
+/* Try to grab a lock on a mutex. */
+static inline int
+__gthread_objc_mutex_trylock (objc_mutex_t mutex _GLIBCXX_UNUSED)
+{
+ /* There can only be one thread, so we always get the lock */
+ return 0;
+}
+
+/* Unlock the mutex */
+static inline int
+__gthread_objc_mutex_unlock (objc_mutex_t mutex _GLIBCXX_UNUSED)
+{
+ return 0;
+}
+
+/* Backend condition mutex functions */
+
+/* Allocate a condition. */
+static inline int
+__gthread_objc_condition_allocate (objc_condition_t condition _GLIBCXX_UNUSED)
+{
+ return 0;
+}
+
+/* Deallocate a condition. */
+static inline int
+__gthread_objc_condition_deallocate (objc_condition_t condition _GLIBCXX_UNUSED)
+{
+ return 0;
+}
+
+/* Wait on the condition */
+static inline int
+__gthread_objc_condition_wait (objc_condition_t condition _GLIBCXX_UNUSED,
+ objc_mutex_t mutex _GLIBCXX_UNUSED)
+{
+ return 0;
+}
+
+/* Wake up all threads waiting on this condition. */
+static inline int
+__gthread_objc_condition_broadcast (objc_condition_t condition _GLIBCXX_UNUSED)
+{
+ return 0;
+}
+
+/* Wake up one thread waiting on this condition. */
+static inline int
+__gthread_objc_condition_signal (objc_condition_t condition _GLIBCXX_UNUSED)
+{
+ return 0;
+}
+
+#else /* _LIBOBJC */
+
+static inline int
+__gthread_active_p (void)
+{
+ return 0;
+}
+
+static inline int
+__gthread_once (__gthread_once_t *__once _GLIBCXX_UNUSED, void (*__func) (void) _GLIBCXX_UNUSED)
+{
+ return 0;
+}
+
+static inline int _GLIBCXX_UNUSED
+__gthread_key_create (__gthread_key_t *__key _GLIBCXX_UNUSED, void (*__func) (void *) _GLIBCXX_UNUSED)
+{
+ return 0;
+}
+
+static int _GLIBCXX_UNUSED
+__gthread_key_delete (__gthread_key_t __key _GLIBCXX_UNUSED)
+{
+ return 0;
+}
+
+static inline void *
+__gthread_getspecific (__gthread_key_t __key _GLIBCXX_UNUSED)
+{
+ return 0;
+}
+
+static inline int
+__gthread_setspecific (__gthread_key_t __key _GLIBCXX_UNUSED, const void *__v _GLIBCXX_UNUSED)
+{
+ return 0;
+}
+
+static inline int
+__gthread_mutex_destroy (__gthread_mutex_t *__mutex _GLIBCXX_UNUSED)
+{
+ return 0;
+}
+
+static inline int
+__gthread_mutex_lock (__gthread_mutex_t *__mutex _GLIBCXX_UNUSED)
+{
+ return 0;
+}
+
+static inline int
+__gthread_mutex_trylock (__gthread_mutex_t *__mutex _GLIBCXX_UNUSED)
+{
+ return 0;
+}
+
+static inline int
+__gthread_mutex_unlock (__gthread_mutex_t *__mutex _GLIBCXX_UNUSED)
+{
+ return 0;
+}
+
+static inline int
+__gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *__mutex)
+{
+ return __gthread_mutex_lock (__mutex);
+}
+
+static inline int
+__gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *__mutex)
+{
+ return __gthread_mutex_trylock (__mutex);
+}
+
+static inline int
+__gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *__mutex)
+{
+ return __gthread_mutex_unlock (__mutex);
+}
+
+#endif /* _LIBOBJC */
+
+#undef _GLIBCXX_UNUSED
+
+#endif /* ! _GLIBCXX_GCC_GTHR_SINGLE_H */
diff --git a/i686-linux/include/c++/4.4.3/i686-linux/bits/gthr-tpf.h b/i686-linux/include/c++/4.4.3/i686-linux/bits/gthr-tpf.h
new file mode 100644
index 0000000..eb619e0
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/i686-linux/bits/gthr-tpf.h
@@ -0,0 +1,229 @@
+/* Threads compatibility routines for libgcc2 and libobjc.
+ Compile this one with gcc.
+ Copyright (C) 2004, 2005, 2008, 2009 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+/* TPF needs its own version of gthr-*.h because TPF always links to
+ the thread library. However, for performance reasons we still do not
+ want to issue thread api calls unless a check is made to see that we
+ are running as a thread. */
+
+#ifndef _GLIBCXX_GCC_GTHR_TPF_H
+#define _GLIBCXX_GCC_GTHR_TPF_H
+
+/* POSIX threads specific definitions.
+ Easy, since the interface is just one-to-one mapping. */
+
+#define __GTHREADS 1
+
+/* Some implementations of <pthread.h> require this to be defined. */
+#ifndef _REENTRANT
+#define _REENTRANT 1
+#endif
+
+#include <pthread.h>
+#include <unistd.h>
+
+typedef pthread_key_t __gthread_key_t;
+typedef pthread_once_t __gthread_once_t;
+typedef pthread_mutex_t __gthread_mutex_t;
+typedef pthread_mutex_t __gthread_recursive_mutex_t;
+
+#if defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER)
+#define __GTHREAD_RECURSIVE_MUTEX_INIT PTHREAD_RECURSIVE_MUTEX_INITIALIZER
+#elif defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP)
+#define __GTHREAD_RECURSIVE_MUTEX_INIT PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+#endif
+
+#define __GTHREAD_MUTEX_INIT PTHREAD_MUTEX_INITIALIZER
+#define __GTHREAD_ONCE_INIT PTHREAD_ONCE_INIT
+#define __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION __gthread_recursive_mutex_init_function
+
+#define NOTATHREAD 00
+#define ECBBASEPTR (unsigned long int) *(unsigned int *)0x00000514u
+#define ECBPG2PTR ECBBASEPTR + 0x1000
+#define CE2THRCPTR *((unsigned char *)(ECBPG2PTR + 16))
+#define __tpf_pthread_active() (CE2THRCPTR != NOTATHREAD)
+
+#if __GXX_WEAK__ && _GLIBCXX_GTHREAD_USE_WEAK
+# define __gthrw(name) \
+ static __typeof(name) __gthrw_ ## name __attribute__ ((__weakref__(#name)));
+# define __gthrw_(name) __gthrw_ ## name
+#else
+# define __gthrw(name)
+# define __gthrw_(name) name
+#endif
+
+__gthrw(pthread_once)
+__gthrw(pthread_key_create)
+__gthrw(pthread_key_delete)
+__gthrw(pthread_getspecific)
+__gthrw(pthread_setspecific)
+__gthrw(pthread_create)
+
+__gthrw(pthread_mutex_lock)
+__gthrw(pthread_mutex_trylock)
+__gthrw(pthread_mutex_unlock)
+__gthrw(pthread_mutexattr_init)
+__gthrw(pthread_mutexattr_settype)
+__gthrw(pthread_mutexattr_destroy)
+__gthrw(pthread_mutex_init)
+__gthrw(pthread_mutex_destroy)
+
+static inline int
+__gthread_active_p (void)
+{
+ return 1;
+}
+
+static inline int
+__gthread_once (__gthread_once_t *__once, void (*__func) (void))
+{
+ if (__tpf_pthread_active ())
+ return __gthrw_(pthread_once) (__once, __func);
+ else
+ return -1;
+}
+
+static inline int
+__gthread_key_create (__gthread_key_t *__key, void (*__dtor) (void *))
+{
+ if (__tpf_pthread_active ())
+ return __gthrw_(pthread_key_create) (__key, __dtor);
+ else
+ return -1;
+}
+
+static inline int
+__gthread_key_delete (__gthread_key_t __key)
+{
+ if (__tpf_pthread_active ())
+ return __gthrw_(pthread_key_delete) (__key);
+ else
+ return -1;
+}
+
+static inline void *
+__gthread_getspecific (__gthread_key_t __key)
+{
+ if (__tpf_pthread_active ())
+ return __gthrw_(pthread_getspecific) (__key);
+ else
+ return NULL;
+}
+
+static inline int
+__gthread_setspecific (__gthread_key_t __key, const void *__ptr)
+{
+ if (__tpf_pthread_active ())
+ return __gthrw_(pthread_setspecific) (__key, __ptr);
+ else
+ return -1;
+}
+
+static inline int
+__gthread_mutex_destroy (__gthread_mutex_t *__mutex)
+{
+ if (__tpf_pthread_active ())
+ return __gthrw_(pthread_mutex_destroy) (__mutex);
+ else
+ return 0;
+}
+
+static inline int
+__gthread_mutex_lock (__gthread_mutex_t *__mutex)
+{
+ if (__tpf_pthread_active ())
+ return __gthrw_(pthread_mutex_lock) (__mutex);
+ else
+ return 0;
+}
+
+static inline int
+__gthread_mutex_trylock (__gthread_mutex_t *__mutex)
+{
+ if (__tpf_pthread_active ())
+ return __gthrw_(pthread_mutex_trylock) (__mutex);
+ else
+ return 0;
+}
+
+static inline int
+__gthread_mutex_unlock (__gthread_mutex_t *__mutex)
+{
+ if (__tpf_pthread_active ())
+ return __gthrw_(pthread_mutex_unlock) (__mutex);
+ else
+ return 0;
+}
+
+static inline int
+__gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *__mutex)
+{
+ if (__tpf_pthread_active ())
+ return __gthread_mutex_lock (__mutex);
+ else
+ return 0;
+}
+
+static inline int
+__gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *__mutex)
+{
+ if (__tpf_pthread_active ())
+ return __gthread_mutex_trylock (__mutex);
+ else
+ return 0;
+}
+
+static inline int
+__gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *__mutex)
+{
+ if (__tpf_pthread_active ())
+ return __gthread_mutex_unlock (__mutex);
+ else
+ return 0;
+}
+
+static inline int
+__gthread_recursive_mutex_init_function (__gthread_recursive_mutex_t *__mutex)
+{
+ if (__tpf_pthread_active ())
+ {
+ pthread_mutexattr_t __attr;
+ int __r;
+
+ __r = __gthrw_(pthread_mutexattr_init) (&__attr);
+ if (!__r)
+ __r = __gthrw_(pthread_mutexattr_settype) (&__attr,
+ PTHREAD_MUTEX_RECURSIVE);
+ if (!__r)
+ __r = __gthrw_(pthread_mutex_init) (__mutex, &__attr);
+ if (!__r)
+ __r = __gthrw_(pthread_mutexattr_destroy) (&__attr);
+ return __r;
+ }
+ return 0;
+}
+
+
+#endif /* ! _GLIBCXX_GCC_GTHR_TPF_H */
diff --git a/i686-linux/include/c++/4.4.3/i686-linux/bits/gthr.h b/i686-linux/include/c++/4.4.3/i686-linux/bits/gthr.h
new file mode 100644
index 0000000..35d9b7e
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/i686-linux/bits/gthr.h
@@ -0,0 +1,173 @@
+/* Threads compatibility routines for libgcc2. */
+/* Compile this one with gcc. */
+/* Copyright (C) 1997, 1998, 2004, 2008, 2009 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+#ifndef _GLIBCXX_GCC_GTHR_H
+#define _GLIBCXX_GCC_GTHR_H
+
+#ifndef _GLIBCXX_HIDE_EXPORTS
+#pragma GCC visibility push(default)
+#endif
+
+/* If this file is compiled with threads support, it must
+ #define __GTHREADS 1
+ to indicate that threads support is present. Also it has define
+ function
+ int __gthread_active_p ()
+ that returns 1 if thread system is active, 0 if not.
+
+ The threads interface must define the following types:
+ __gthread_key_t
+ __gthread_once_t
+ __gthread_mutex_t
+ __gthread_recursive_mutex_t
+
+ The threads interface must define the following macros:
+
+ __GTHREAD_ONCE_INIT
+ to initialize __gthread_once_t
+ __GTHREAD_MUTEX_INIT
+ to initialize __gthread_mutex_t to get a fast
+ non-recursive mutex.
+ __GTHREAD_MUTEX_INIT_FUNCTION
+ some systems can't initialize a mutex without a
+ function call. On such systems, define this to a
+ function which looks like this:
+ void __GTHREAD_MUTEX_INIT_FUNCTION (__gthread_mutex_t *)
+ Don't define __GTHREAD_MUTEX_INIT in this case
+ __GTHREAD_RECURSIVE_MUTEX_INIT
+ __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION
+ as above, but for a recursive mutex.
+
+ The threads interface must define the following static functions:
+
+ int __gthread_once (__gthread_once_t *once, void (*func) ())
+
+ int __gthread_key_create (__gthread_key_t *keyp, void (*dtor) (void *))
+ int __gthread_key_delete (__gthread_key_t key)
+
+ void *__gthread_getspecific (__gthread_key_t key)
+ int __gthread_setspecific (__gthread_key_t key, const void *ptr)
+
+ int __gthread_mutex_destroy (__gthread_mutex_t *mutex);
+
+ int __gthread_mutex_lock (__gthread_mutex_t *mutex);
+ int __gthread_mutex_trylock (__gthread_mutex_t *mutex);
+ int __gthread_mutex_unlock (__gthread_mutex_t *mutex);
+
+ int __gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *mutex);
+ int __gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *mutex);
+ int __gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *mutex);
+
+ The following are supported in POSIX threads only. They are required to
+ fix a deadlock in static initialization inside libsupc++. The header file
+ gthr-posix.h defines a symbol __GTHREAD_HAS_COND to signify that these extra
+ features are supported.
+
+ Types:
+ __gthread_cond_t
+
+ Macros:
+ __GTHREAD_COND_INIT
+ __GTHREAD_COND_INIT_FUNCTION
+
+ Interface:
+ int __gthread_cond_broadcast (__gthread_cond_t *cond);
+ int __gthread_cond_wait (__gthread_cond_t *cond, __gthread_mutex_t *mutex);
+ int __gthread_cond_wait_recursive (__gthread_cond_t *cond,
+ __gthread_recursive_mutex_t *mutex);
+
+ All functions returning int should return zero on success or the error
+ number. If the operation is not supported, -1 is returned.
+
+ If the following are also defined, you should
+ #define __GTHREADS_CXX0X 1
+ to enable the c++0x thread library.
+
+ Types:
+ __gthread_t
+ __gthread_time_t
+
+ Interface:
+ int __gthread_create (__gthread_t *thread, void *(*func) (void*),
+ void *args);
+ int __gthread_join (__gthread_t thread, void **value_ptr);
+ int __gthread_detach (__gthread_t thread);
+ int __gthread_equal (__gthread_t t1, __gthread_t t2);
+ __gthread_t __gthread_self (void);
+ int __gthread_yield (void);
+
+ int __gthread_mutex_timedlock (__gthread_mutex_t *m,
+ const __gthread_time_t *abs_timeout);
+ int __gthread_recursive_mutex_timedlock (__gthread_recursive_mutex_t *m,
+ const __gthread_time_t *abs_time);
+
+ int __gthread_cond_signal (__gthread_cond_t *cond);
+ int __gthread_cond_timedwait (__gthread_cond_t *cond,
+ __gthread_mutex_t *mutex,
+ const __gthread_time_t *abs_timeout);
+ int __gthread_cond_timedwait_recursive (__gthread_cond_t *cond,
+ __gthread_recursive_mutex_t *mutex,
+ const __gthread_time_t *abs_time)
+
+ Currently supported threads packages are
+ TPF threads with -D__tpf__
+ POSIX/Unix98 threads with -D_PTHREADS
+ POSIX/Unix95 threads with -D_PTHREADS95
+ DCE threads with -D_DCE_THREADS
+ Solaris/UI threads with -D_SOLARIS_THREADS
+
+*/
+
+/* Check first for thread specific defines. */
+#if defined (_GLIBCXX___tpf_GLIBCXX___)
+#include <bits/gthr-tpf.h>
+#elif _GLIBCXX__PTHREADS
+#include <bits/gthr-posix.h>
+#elif _GLIBCXX__PTHREADS95
+#include <bits/gthr-posix95.h>
+#elif _GLIBCXX__DCE_THREADS
+#include <bits/gthr-dce.h>
+#elif _GLIBCXX__SOLARIS_THREADS
+#include <bits/gthr-solaris.h>
+
+/* Include GTHREAD_FILE if one is defined. */
+#elif defined(_GLIBCXX_HAVE_GTHR_DEFAULT)
+#if __GXX_WEAK__
+#ifndef _GLIBCXX_GTHREAD_USE_WEAK
+#define _GLIBCXX_GTHREAD_USE_WEAK 1
+#endif
+#endif
+#include <bits/gthr-default.h>
+
+/* Fallback to single thread definitions. */
+#else
+#include <bits/gthr-single.h>
+#endif
+
+#ifndef _GLIBCXX_HIDE_EXPORTS
+#pragma GCC visibility pop
+#endif
+
+#endif /* ! _GLIBCXX_GCC_GTHR_H */
diff --git a/i686-linux/include/c++/4.4.3/i686-linux/bits/messages_members.h b/i686-linux/include/c++/4.4.3/i686-linux/bits/messages_members.h
new file mode 100644
index 0000000..a149950
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/i686-linux/bits/messages_members.h
@@ -0,0 +1,90 @@
+// std::messages implementation details, generic version -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file messages_members.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 22.2.7.1.2 messages virtual functions
+//
+
+// Written by Benjamin Kosnik <bkoz@redhat.com>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // Non-virtual member functions.
+ template<typename _CharT>
+ messages<_CharT>::messages(size_t __refs)
+ : facet(__refs)
+ { _M_c_locale_messages = _S_get_c_locale(); }
+
+ template<typename _CharT>
+ messages<_CharT>::messages(__c_locale, const char*, size_t __refs)
+ : facet(__refs)
+ { _M_c_locale_messages = _S_get_c_locale(); }
+
+ template<typename _CharT>
+ typename messages<_CharT>::catalog
+ messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
+ const char*) const
+ { return this->do_open(__s, __loc); }
+
+ // Virtual member functions.
+ template<typename _CharT>
+ messages<_CharT>::~messages()
+ { _S_destroy_c_locale(_M_c_locale_messages); }
+
+ template<typename _CharT>
+ typename messages<_CharT>::catalog
+ messages<_CharT>::do_open(const basic_string<char>&, const locale&) const
+ { return 0; }
+
+ template<typename _CharT>
+ typename messages<_CharT>::string_type
+ messages<_CharT>::do_get(catalog, int, int,
+ const string_type& __dfault) const
+ { return __dfault; }
+
+ template<typename _CharT>
+ void
+ messages<_CharT>::do_close(catalog) const
+ { }
+
+ // messages_byname
+ template<typename _CharT>
+ messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
+ : messages<_CharT>(__refs)
+ {
+ if (__builtin_strcmp(__s, "C") != 0
+ && __builtin_strcmp(__s, "POSIX") != 0)
+ {
+ this->_S_destroy_c_locale(this->_M_c_locale_messages);
+ this->_S_create_c_locale(this->_M_c_locale_messages, __s);
+ }
+ }
+
+_GLIBCXX_END_NAMESPACE
diff --git a/i686-linux/include/c++/4.4.3/i686-linux/bits/os_defines.h b/i686-linux/include/c++/4.4.3/i686-linux/bits/os_defines.h
new file mode 100644
index 0000000..9c42b3a
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/i686-linux/bits/os_defines.h
@@ -0,0 +1,41 @@
+// Specific definitions for GNU/Linux -*- C++ -*-
+
+// Copyright (C) 2000, 2001, 2002, 2003, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file os_defines.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _GLIBCXX_OS_DEFINES
+#define _GLIBCXX_OS_DEFINES 1
+
+// System-specific #define, typedefs, corrections, etc, go here. This
+// file will come before all others.
+
+// This keeps isanum, et al from being propagated as macros.
+#define __NO_CTYPE 1
+
+#include <features.h>
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/i686-linux/bits/stdc++.h b/i686-linux/include/c++/4.4.3/i686-linux/bits/stdc++.h
new file mode 100644
index 0000000..5782fa3
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/i686-linux/bits/stdc++.h
@@ -0,0 +1,111 @@
+// C++ includes used for precompiling -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file stdc++.h
+ * This is an implementation file for a precompiled header.
+ */
+
+// 17.4.1.2 Headers
+
+// C
+#include <cassert>
+#include <cctype>
+#include <cerrno>
+#include <cfloat>
+#include <ciso646>
+#include <climits>
+#include <clocale>
+#include <cmath>
+#include <csetjmp>
+#include <csignal>
+#include <cstdarg>
+#include <cstddef>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <ctime>
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#include <ccomplex>
+#include <cfenv>
+#include <cinttypes>
+#include <cstdatomic>
+#include <cstdbool>
+#include <cstdint>
+#include <ctgmath>
+#include <cwchar>
+#include <cwctype>
+#endif
+
+// C++
+#include <algorithm>
+#include <bitset>
+#include <complex>
+#include <deque>
+#include <exception>
+#include <fstream>
+#include <functional>
+#include <iomanip>
+#include <ios>
+#include <iosfwd>
+#include <iostream>
+#include <istream>
+#include <iterator>
+#include <limits>
+#include <list>
+#include <locale>
+#include <map>
+#include <memory>
+#include <new>
+#include <numeric>
+#include <ostream>
+#include <queue>
+#include <set>
+#include <sstream>
+#include <stack>
+#include <stdexcept>
+#include <streambuf>
+#include <string>
+#include <typeinfo>
+#include <utility>
+#include <valarray>
+#include <vector>
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#include <array>
+#include <chrono>
+#include <condition_variable>
+#include <forward_list>
+#include <mutex>
+#include <random>
+#include <ratio>
+#include <regex>
+#include <system_error>
+#include <thread>
+#include <tuple>
+#include <type_traits>
+#include <unordered_map>
+#include <unordered_set>
+#endif
diff --git a/i686-linux/include/c++/4.4.3/i686-linux/bits/stdtr1c++.h b/i686-linux/include/c++/4.4.3/i686-linux/bits/stdtr1c++.h
new file mode 100644
index 0000000..8ed9cb6
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/i686-linux/bits/stdtr1c++.h
@@ -0,0 +1,53 @@
+// C++ includes used for precompiling TR1 -*- C++ -*-
+
+// Copyright (C) 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file stdtr1c++.h
+ * This is an implementation file for a precompiled header.
+ */
+
+#include <bits/stdc++.h>
+
+#include <tr1/array>
+#include <tr1/cctype>
+#include <tr1/cfenv>
+#include <tr1/cfloat>
+#include <tr1/cinttypes>
+#include <tr1/climits>
+#include <tr1/cmath>
+#include <tr1/complex>
+#include <tr1/cstdarg>
+#include <tr1/cstdbool>
+#include <tr1/cstdint>
+#include <tr1/cstdio>
+#include <tr1/cstdlib>
+#include <tr1/ctgmath>
+#include <tr1/ctime>
+#include <tr1/cwchar>
+#include <tr1/cwctype>
+#include <tr1/functional>
+#include <tr1/random>
+#include <tr1/tuple>
+#include <tr1/unordered_map>
+#include <tr1/unordered_set>
+#include <tr1/utility>
diff --git a/i686-linux/include/c++/4.4.3/i686-linux/bits/time_members.h b/i686-linux/include/c++/4.4.3/i686-linux/bits/time_members.h
new file mode 100644
index 0000000..d06faf4
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/i686-linux/bits/time_members.h
@@ -0,0 +1,90 @@
+// std::time_get, std::time_put implementation, generic version -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file time_members.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 22.2.5.1.2 - time_get functions
+// ISO C++ 14882: 22.2.5.3.2 - time_put functions
+//
+
+// Written by Benjamin Kosnik <bkoz@redhat.com>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _CharT>
+ __timepunct<_CharT>::__timepunct(size_t __refs)
+ : facet(__refs), _M_data(NULL)
+ {
+ _M_name_timepunct = _S_get_c_name();
+ _M_initialize_timepunct();
+ }
+
+ template<typename _CharT>
+ __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
+ : facet(__refs), _M_data(__cache)
+ {
+ _M_name_timepunct = _S_get_c_name();
+ _M_initialize_timepunct();
+ }
+
+ template<typename _CharT>
+ __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
+ size_t __refs)
+ : facet(__refs), _M_data(NULL)
+ {
+ if (__builtin_strcmp(__s, _S_get_c_name()) != 0)
+ {
+ const size_t __len = __builtin_strlen(__s) + 1;
+ char* __tmp = new char[__len];
+ __builtin_memcpy(__tmp, __s, __len);
+ _M_name_timepunct = __tmp;
+ }
+ else
+ _M_name_timepunct = _S_get_c_name();
+
+ __try
+ { _M_initialize_timepunct(__cloc); }
+ __catch(...)
+ {
+ if (_M_name_timepunct != _S_get_c_name())
+ delete [] _M_name_timepunct;
+ __throw_exception_again;
+ }
+ }
+
+ template<typename _CharT>
+ __timepunct<_CharT>::~__timepunct()
+ {
+ if (_M_name_timepunct != _S_get_c_name())
+ delete [] _M_name_timepunct;
+ delete _M_data;
+ _S_destroy_c_locale(_M_c_locale_timepunct);
+ }
+
+_GLIBCXX_END_NAMESPACE
diff --git a/i686-linux/include/c++/4.4.3/initializer_list b/i686-linux/include/c++/4.4.3/initializer_list
new file mode 100644
index 0000000..6b8a202
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/initializer_list
@@ -0,0 +1,72 @@
+// std::initializer_list support -*- C++ -*-
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of GCC.
+//
+// GCC is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// GCC is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file initializer_list
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef __CXX_INITIALIZER_LIST
+#define __CXX_INITIALIZER_LIST
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+
+#pragma GCC visibility push(default)
+
+#include <cstddef>
+
+namespace std
+{
+ /// initializer_list
+ template<class _E>
+ class initializer_list
+ {
+ const _E* __array;
+ size_t __len;
+
+ // The compiler can call a private constructor.
+ initializer_list(const _E* __a, size_t __l)
+ : __array(__a), __len(__l) { }
+
+ public:
+ initializer_list()
+ : __array(NULL), __len(0) { }
+
+ // Number of elements.
+ size_t size() const
+ { return __len; }
+
+ // First element.
+ const _E* begin() const
+ { return __array; }
+
+ // One past the last element.
+ const _E* end() const
+ { return begin() + size(); }
+ };
+}
+
+#pragma GCC visibility pop
+#endif // C++0x
+#endif // __CXX_INITIALIZER_LIST
diff --git a/i686-linux/include/c++/4.4.3/iomanip b/i686-linux/include/c++/4.4.3/iomanip
new file mode 100644
index 0000000..873c76f
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/iomanip
@@ -0,0 +1,296 @@
+// Standard stream manipulators -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+// 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file iomanip
+ * This is a Standard C++ Library header.
+ */
+
+//
+// ISO C++ 14882: 27.6.3 Standard manipulators
+//
+
+#ifndef _GLIBCXX_IOMANIP
+#define _GLIBCXX_IOMANIP 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <iosfwd>
+#include <bits/ios_base.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // [27.6.3] standard manipulators
+ // Also see DR 183.
+
+ struct _Resetiosflags { ios_base::fmtflags _M_mask; };
+
+ /**
+ * @brief Manipulator for @c setf.
+ * @param mask A format flags mask.
+ *
+ * Sent to a stream object, this manipulator resets the specified flags,
+ * via @e stream.setf(0,mask).
+ */
+ inline _Resetiosflags
+ resetiosflags(ios_base::fmtflags __mask)
+ {
+ _Resetiosflags __x;
+ __x._M_mask = __mask;
+ return __x;
+ }
+
+ template<typename _CharT, typename _Traits>
+ inline basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __is, _Resetiosflags __f)
+ {
+ __is.setf(ios_base::fmtflags(0), __f._M_mask);
+ return __is;
+ }
+
+ template<typename _CharT, typename _Traits>
+ inline basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __os, _Resetiosflags __f)
+ {
+ __os.setf(ios_base::fmtflags(0), __f._M_mask);
+ return __os;
+ }
+
+
+ struct _Setiosflags { ios_base::fmtflags _M_mask; };
+
+ /**
+ * @brief Manipulator for @c setf.
+ * @param mask A format flags mask.
+ *
+ * Sent to a stream object, this manipulator sets the format flags
+ * to @a mask.
+ */
+ inline _Setiosflags
+ setiosflags(ios_base::fmtflags __mask)
+ {
+ _Setiosflags __x;
+ __x._M_mask = __mask;
+ return __x;
+ }
+
+ template<typename _CharT, typename _Traits>
+ inline basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __is, _Setiosflags __f)
+ {
+ __is.setf(__f._M_mask);
+ return __is;
+ }
+
+ template<typename _CharT, typename _Traits>
+ inline basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __os, _Setiosflags __f)
+ {
+ __os.setf(__f._M_mask);
+ return __os;
+ }
+
+
+ struct _Setbase { int _M_base; };
+
+ /**
+ * @brief Manipulator for @c setf.
+ * @param base A numeric base.
+ *
+ * Sent to a stream object, this manipulator changes the
+ * @c ios_base::basefield flags to @c oct, @c dec, or @c hex when @a base
+ * is 8, 10, or 16, accordingly, and to 0 if @a base is any other value.
+ */
+ inline _Setbase
+ setbase(int __base)
+ {
+ _Setbase __x;
+ __x._M_base = __base;
+ return __x;
+ }
+
+ template<typename _CharT, typename _Traits>
+ inline basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __is, _Setbase __f)
+ {
+ __is.setf(__f._M_base == 8 ? ios_base::oct :
+ __f._M_base == 10 ? ios_base::dec :
+ __f._M_base == 16 ? ios_base::hex :
+ ios_base::fmtflags(0), ios_base::basefield);
+ return __is;
+ }
+
+ template<typename _CharT, typename _Traits>
+ inline basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __os, _Setbase __f)
+ {
+ __os.setf(__f._M_base == 8 ? ios_base::oct :
+ __f._M_base == 10 ? ios_base::dec :
+ __f._M_base == 16 ? ios_base::hex :
+ ios_base::fmtflags(0), ios_base::basefield);
+ return __os;
+ }
+
+
+ template<typename _CharT>
+ struct _Setfill { _CharT _M_c; };
+
+ /**
+ * @brief Manipulator for @c fill.
+ * @param c The new fill character.
+ *
+ * Sent to a stream object, this manipulator calls @c fill(c) for that
+ * object.
+ */
+ template<typename _CharT>
+ inline _Setfill<_CharT>
+ setfill(_CharT __c)
+ {
+ _Setfill<_CharT> __x;
+ __x._M_c = __c;
+ return __x;
+ }
+
+ template<typename _CharT, typename _Traits>
+ inline basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __is, _Setfill<_CharT> __f)
+ {
+ __is.fill(__f._M_c);
+ return __is;
+ }
+
+ template<typename _CharT, typename _Traits>
+ inline basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __os, _Setfill<_CharT> __f)
+ {
+ __os.fill(__f._M_c);
+ return __os;
+ }
+
+
+ struct _Setprecision { int _M_n; };
+
+ /**
+ * @brief Manipulator for @c precision.
+ * @param n The new precision.
+ *
+ * Sent to a stream object, this manipulator calls @c precision(n) for
+ * that object.
+ */
+ inline _Setprecision
+ setprecision(int __n)
+ {
+ _Setprecision __x;
+ __x._M_n = __n;
+ return __x;
+ }
+
+ template<typename _CharT, typename _Traits>
+ inline basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __is, _Setprecision __f)
+ {
+ __is.precision(__f._M_n);
+ return __is;
+ }
+
+ template<typename _CharT, typename _Traits>
+ inline basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __os, _Setprecision __f)
+ {
+ __os.precision(__f._M_n);
+ return __os;
+ }
+
+
+ struct _Setw { int _M_n; };
+
+ /**
+ * @brief Manipulator for @c width.
+ * @param n The new width.
+ *
+ * Sent to a stream object, this manipulator calls @c width(n) for
+ * that object.
+ */
+ inline _Setw
+ setw(int __n)
+ {
+ _Setw __x;
+ __x._M_n = __n;
+ return __x;
+ }
+
+ template<typename _CharT, typename _Traits>
+ inline basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __is, _Setw __f)
+ {
+ __is.width(__f._M_n);
+ return __is;
+ }
+
+ template<typename _CharT, typename _Traits>
+ inline basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __os, _Setw __f)
+ {
+ __os.width(__f._M_n);
+ return __os;
+ }
+
+ // Inhibit implicit instantiations for required instantiations,
+ // which are defined via explicit instantiations elsewhere.
+ // NB: This syntax is a GNU extension.
+#if _GLIBCXX_EXTERN_TEMPLATE
+ extern template ostream& operator<<(ostream&, _Setfill<char>);
+ extern template ostream& operator<<(ostream&, _Setiosflags);
+ extern template ostream& operator<<(ostream&, _Resetiosflags);
+ extern template ostream& operator<<(ostream&, _Setbase);
+ extern template ostream& operator<<(ostream&, _Setprecision);
+ extern template ostream& operator<<(ostream&, _Setw);
+ extern template istream& operator>>(istream&, _Setfill<char>);
+ extern template istream& operator>>(istream&, _Setiosflags);
+ extern template istream& operator>>(istream&, _Resetiosflags);
+ extern template istream& operator>>(istream&, _Setbase);
+ extern template istream& operator>>(istream&, _Setprecision);
+ extern template istream& operator>>(istream&, _Setw);
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ extern template wostream& operator<<(wostream&, _Setfill<wchar_t>);
+ extern template wostream& operator<<(wostream&, _Setiosflags);
+ extern template wostream& operator<<(wostream&, _Resetiosflags);
+ extern template wostream& operator<<(wostream&, _Setbase);
+ extern template wostream& operator<<(wostream&, _Setprecision);
+ extern template wostream& operator<<(wostream&, _Setw);
+ extern template wistream& operator>>(wistream&, _Setfill<wchar_t>);
+ extern template wistream& operator>>(wistream&, _Setiosflags);
+ extern template wistream& operator>>(wistream&, _Resetiosflags);
+ extern template wistream& operator>>(wistream&, _Setbase);
+ extern template wistream& operator>>(wistream&, _Setprecision);
+ extern template wistream& operator>>(wistream&, _Setw);
+#endif
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _GLIBCXX_IOMANIP */
diff --git a/i686-linux/include/c++/4.4.3/ios b/i686-linux/include/c++/4.4.3/ios
new file mode 100644
index 0000000..d561ac6
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ios
@@ -0,0 +1,47 @@
+// Iostreams base classes -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+// 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ios
+ * This is a Standard C++ Library header.
+ */
+
+//
+// ISO C++ 14882: 27.4 Iostreams base classes
+//
+
+#ifndef _GLIBCXX_IOS
+#define _GLIBCXX_IOS 1
+
+#pragma GCC system_header
+
+#include <iosfwd>
+#include <exception> // For ios_base::failure
+#include <bits/char_traits.h> // For char_traits, streamoff, streamsize, fpos
+#include <bits/localefwd.h> // For class locale
+#include <bits/ios_base.h> // For ios_base declarations.
+#include <streambuf>
+#include <bits/basic_ios.h>
+
+#endif /* _GLIBCXX_IOS */
diff --git a/i686-linux/include/c++/4.4.3/iosfwd b/i686-linux/include/c++/4.4.3/iosfwd
new file mode 100644
index 0000000..9bba0ab
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/iosfwd
@@ -0,0 +1,160 @@
+// Forwarding declarations -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file iosfwd
+ * This is a Standard C++ Library header.
+ */
+
+//
+// ISO C++ 14882: 27.2 Forward declarations
+//
+
+#ifndef _GLIBCXX_IOSFWD
+#define _GLIBCXX_IOSFWD 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <bits/stringfwd.h> // For string forward declarations.
+#include <bits/postypes.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _CharT, typename _Traits = char_traits<_CharT> >
+ class basic_ios;
+
+ template<typename _CharT, typename _Traits = char_traits<_CharT> >
+ class basic_streambuf;
+
+ template<typename _CharT, typename _Traits = char_traits<_CharT> >
+ class basic_istream;
+
+ template<typename _CharT, typename _Traits = char_traits<_CharT> >
+ class basic_ostream;
+
+ template<typename _CharT, typename _Traits = char_traits<_CharT> >
+ class basic_iostream;
+
+ template<typename _CharT, typename _Traits = char_traits<_CharT>,
+ typename _Alloc = allocator<_CharT> >
+ class basic_stringbuf;
+
+ template<typename _CharT, typename _Traits = char_traits<_CharT>,
+ typename _Alloc = allocator<_CharT> >
+ class basic_istringstream;
+
+ template<typename _CharT, typename _Traits = char_traits<_CharT>,
+ typename _Alloc = allocator<_CharT> >
+ class basic_ostringstream;
+
+ template<typename _CharT, typename _Traits = char_traits<_CharT>,
+ typename _Alloc = allocator<_CharT> >
+ class basic_stringstream;
+
+ template<typename _CharT, typename _Traits = char_traits<_CharT> >
+ class basic_filebuf;
+
+ template<typename _CharT, typename _Traits = char_traits<_CharT> >
+ class basic_ifstream;
+
+ template<typename _CharT, typename _Traits = char_traits<_CharT> >
+ class basic_ofstream;
+
+ template<typename _CharT, typename _Traits = char_traits<_CharT> >
+ class basic_fstream;
+
+ template<typename _CharT, typename _Traits = char_traits<_CharT> >
+ class istreambuf_iterator;
+
+ template<typename _CharT, typename _Traits = char_traits<_CharT> >
+ class ostreambuf_iterator;
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // Not included. (??? Apparently no LWG number?)
+ class ios_base;
+
+ /**
+ * @defgroup io I/O
+ *
+ * Nearly all of the I/O classes are parameterized on the type of
+ * characters they read and write. (The major exception is ios_base at
+ * the top of the hierarchy.) This is a change from pre-Standard
+ * streams, which were not templates.
+ *
+ * For ease of use and compatibility, all of the basic_* I/O-related
+ * classes are given typedef names for both of the builtin character
+ * widths (wide and narrow). The typedefs are the same as the
+ * pre-Standard names, for example:
+ *
+ * @code
+ * typedef basic_ifstream<char> ifstream;
+ * @endcode
+ *
+ * Because properly forward-declaring these classes can be difficult, you
+ * should not do it yourself. Instead, include the &lt;iosfwd&gt;
+ * header, which contains only declarations of all the I/O classes as
+ * well as the typedefs. Trying to forward-declare the typedefs
+ * themselves (e.g., "class ostream;") is not valid ISO C++.
+ *
+ * For more specific declarations, see
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt11ch24.html
+ *
+ * @{
+ */
+ typedef basic_ios<char> ios; ///< @isiosfwd
+ typedef basic_streambuf<char> streambuf; ///< @isiosfwd
+ typedef basic_istream<char> istream; ///< @isiosfwd
+ typedef basic_ostream<char> ostream; ///< @isiosfwd
+ typedef basic_iostream<char> iostream; ///< @isiosfwd
+ typedef basic_stringbuf<char> stringbuf; ///< @isiosfwd
+ typedef basic_istringstream<char> istringstream; ///< @isiosfwd
+ typedef basic_ostringstream<char> ostringstream; ///< @isiosfwd
+ typedef basic_stringstream<char> stringstream; ///< @isiosfwd
+ typedef basic_filebuf<char> filebuf; ///< @isiosfwd
+ typedef basic_ifstream<char> ifstream; ///< @isiosfwd
+ typedef basic_ofstream<char> ofstream; ///< @isiosfwd
+ typedef basic_fstream<char> fstream; ///< @isiosfwd
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ typedef basic_ios<wchar_t> wios; ///< @isiosfwd
+ typedef basic_streambuf<wchar_t> wstreambuf; ///< @isiosfwd
+ typedef basic_istream<wchar_t> wistream; ///< @isiosfwd
+ typedef basic_ostream<wchar_t> wostream; ///< @isiosfwd
+ typedef basic_iostream<wchar_t> wiostream; ///< @isiosfwd
+ typedef basic_stringbuf<wchar_t> wstringbuf; ///< @isiosfwd
+ typedef basic_istringstream<wchar_t> wistringstream; ///< @isiosfwd
+ typedef basic_ostringstream<wchar_t> wostringstream; ///< @isiosfwd
+ typedef basic_stringstream<wchar_t> wstringstream; ///< @isiosfwd
+ typedef basic_filebuf<wchar_t> wfilebuf; ///< @isiosfwd
+ typedef basic_ifstream<wchar_t> wifstream; ///< @isiosfwd
+ typedef basic_ofstream<wchar_t> wofstream; ///< @isiosfwd
+ typedef basic_fstream<wchar_t> wfstream; ///< @isiosfwd
+#endif
+ /** @} */
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _GLIBCXX_IOSFWD */
diff --git a/i686-linux/include/c++/4.4.3/iostream b/i686-linux/include/c++/4.4.3/iostream
new file mode 100644
index 0000000..e14c4f3
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/iostream
@@ -0,0 +1,76 @@
+// Standard iostream objects -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2001, 2002, 2005, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file iostream
+ * This is a Standard C++ Library header.
+ */
+
+//
+// ISO C++ 14882: 27.3 Standard iostream objects
+//
+
+#ifndef _GLIBCXX_IOSTREAM
+#define _GLIBCXX_IOSTREAM 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <ostream>
+#include <istream>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @name Standard Stream Objects
+ *
+ * The &lt;iostream&gt; header declares the eight <em>standard stream
+ * objects</em>. For other declarations, see
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt11ch24.html
+ * and the @link iosfwd I/O forward declarations @endlink
+ *
+ * They are required by default to cooperate with the global C library's
+ * @c FILE streams, and to be available during program startup and
+ * termination. For more information, see the HOWTO linked to above.
+ */
+ //@{
+ extern istream cin; ///< Linked to standard input
+ extern ostream cout; ///< Linked to standard output
+ extern ostream cerr; ///< Linked to standard error (unbuffered)
+ extern ostream clog; ///< Linked to standard error (buffered)
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ extern wistream wcin; ///< Linked to standard input
+ extern wostream wcout; ///< Linked to standard output
+ extern wostream wcerr; ///< Linked to standard error (unbuffered)
+ extern wostream wclog; ///< Linked to standard error (buffered)
+#endif
+ //@}
+
+ // For construction of filebuffers for cout, cin, cerr, clog et. al.
+ static ios_base::Init __ioinit;
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _GLIBCXX_IOSTREAM */
diff --git a/i686-linux/include/c++/4.4.3/istream b/i686-linux/include/c++/4.4.3/istream
new file mode 100644
index 0000000..521be7f
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/istream
@@ -0,0 +1,833 @@
+// Input streams -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+//
+// ISO C++ 14882: 27.6.1 Input streams
+//
+
+/** @file istream
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_ISTREAM
+#define _GLIBCXX_ISTREAM 1
+
+#pragma GCC system_header
+
+#include <ios>
+#include <ostream>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // [27.6.1.1] Template class basic_istream
+ /**
+ * @brief Controlling input.
+ * @ingroup io
+ *
+ * This is the base class for all input streams. It provides text
+ * formatting of all builtin types, and communicates with any class
+ * derived from basic_streambuf to do the actual input.
+ */
+ template<typename _CharT, typename _Traits>
+ class basic_istream : virtual public basic_ios<_CharT, _Traits>
+ {
+ public:
+ // Types (inherited from basic_ios (27.4.4)):
+ typedef _CharT char_type;
+ typedef typename _Traits::int_type int_type;
+ typedef typename _Traits::pos_type pos_type;
+ typedef typename _Traits::off_type off_type;
+ typedef _Traits traits_type;
+
+ // Non-standard Types:
+ typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
+ typedef basic_ios<_CharT, _Traits> __ios_type;
+ typedef basic_istream<_CharT, _Traits> __istream_type;
+ typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> >
+ __num_get_type;
+ typedef ctype<_CharT> __ctype_type;
+
+ protected:
+ // Data Members:
+ /**
+ * The number of characters extracted in the previous unformatted
+ * function; see gcount().
+ */
+ streamsize _M_gcount;
+
+ public:
+ // [27.6.1.1.1] constructor/destructor
+ /**
+ * @brief Base constructor.
+ *
+ * This ctor is almost never called by the user directly, rather from
+ * derived classes' initialization lists, which pass a pointer to
+ * their own stream buffer.
+ */
+ explicit
+ basic_istream(__streambuf_type* __sb)
+ : _M_gcount(streamsize(0))
+ { this->init(__sb); }
+
+ /**
+ * @brief Base destructor.
+ *
+ * This does very little apart from providing a virtual base dtor.
+ */
+ virtual
+ ~basic_istream()
+ { _M_gcount = streamsize(0); }
+
+ // [27.6.1.1.2] prefix/suffix
+ class sentry;
+ friend class sentry;
+
+ // [27.6.1.2] formatted input
+ // [27.6.1.2.3] basic_istream::operator>>
+ //@{
+ /**
+ * @brief Interface for manipulators.
+ *
+ * Manipulators such as @c std::ws and @c std::dec use these
+ * functions in constructs like "std::cin >> std::ws". For more
+ * information, see the iomanip header.
+ */
+ __istream_type&
+ operator>>(__istream_type& (*__pf)(__istream_type&))
+ { return __pf(*this); }
+
+ __istream_type&
+ operator>>(__ios_type& (*__pf)(__ios_type&))
+ {
+ __pf(*this);
+ return *this;
+ }
+
+ __istream_type&
+ operator>>(ios_base& (*__pf)(ios_base&))
+ {
+ __pf(*this);
+ return *this;
+ }
+ //@}
+
+ // [27.6.1.2.2] arithmetic extractors
+ /**
+ * @name Arithmetic Extractors
+ *
+ * All the @c operator>> functions (aka <em>formatted input
+ * functions</em>) have some common behavior. Each starts by
+ * constructing a temporary object of type std::basic_istream::sentry
+ * with the second argument (noskipws) set to false. This has several
+ * effects, concluding with the setting of a status flag; see the
+ * sentry documentation for more.
+ *
+ * If the sentry status is good, the function tries to extract
+ * whatever data is appropriate for the type of the argument.
+ *
+ * If an exception is thrown during extraction, ios_base::badbit
+ * will be turned on in the stream's error state without causing an
+ * ios_base::failure to be thrown. The original exception will then
+ * be rethrown.
+ */
+ //@{
+ /**
+ * @brief Basic arithmetic extractors
+ * @param A variable of builtin type.
+ * @return @c *this if successful
+ *
+ * These functions use the stream's current locale (specifically, the
+ * @c num_get facet) to parse the input data.
+ */
+ __istream_type&
+ operator>>(bool& __n)
+ { return _M_extract(__n); }
+
+ __istream_type&
+ operator>>(short& __n);
+
+ __istream_type&
+ operator>>(unsigned short& __n)
+ { return _M_extract(__n); }
+
+ __istream_type&
+ operator>>(int& __n);
+
+ __istream_type&
+ operator>>(unsigned int& __n)
+ { return _M_extract(__n); }
+
+ __istream_type&
+ operator>>(long& __n)
+ { return _M_extract(__n); }
+
+ __istream_type&
+ operator>>(unsigned long& __n)
+ { return _M_extract(__n); }
+
+#ifdef _GLIBCXX_USE_LONG_LONG
+ __istream_type&
+ operator>>(long long& __n)
+ { return _M_extract(__n); }
+
+ __istream_type&
+ operator>>(unsigned long long& __n)
+ { return _M_extract(__n); }
+#endif
+
+ __istream_type&
+ operator>>(float& __f)
+ { return _M_extract(__f); }
+
+ __istream_type&
+ operator>>(double& __f)
+ { return _M_extract(__f); }
+
+ __istream_type&
+ operator>>(long double& __f)
+ { return _M_extract(__f); }
+
+ __istream_type&
+ operator>>(void*& __p)
+ { return _M_extract(__p); }
+
+ /**
+ * @brief Extracting into another streambuf.
+ * @param sb A pointer to a streambuf
+ *
+ * This function behaves like one of the basic arithmetic extractors,
+ * in that it also constructs a sentry object and has the same error
+ * handling behavior.
+ *
+ * If @a sb is NULL, the stream will set failbit in its error state.
+ *
+ * Characters are extracted from this stream and inserted into the
+ * @a sb streambuf until one of the following occurs:
+ *
+ * - the input stream reaches end-of-file,
+ * - insertion into the output buffer fails (in this case, the
+ * character that would have been inserted is not extracted), or
+ * - an exception occurs (and in this case is caught)
+ *
+ * If the function inserts no characters, failbit is set.
+ */
+ __istream_type&
+ operator>>(__streambuf_type* __sb);
+ //@}
+
+ // [27.6.1.3] unformatted input
+ /**
+ * @brief Character counting
+ * @return The number of characters extracted by the previous
+ * unformatted input function dispatched for this stream.
+ */
+ streamsize
+ gcount() const
+ { return _M_gcount; }
+
+ /**
+ * @name Unformatted Input Functions
+ *
+ * All the unformatted input functions have some common behavior.
+ * Each starts by constructing a temporary object of type
+ * std::basic_istream::sentry with the second argument (noskipws)
+ * set to true. This has several effects, concluding with the
+ * setting of a status flag; see the sentry documentation for more.
+ *
+ * If the sentry status is good, the function tries to extract
+ * whatever data is appropriate for the type of the argument.
+ *
+ * The number of characters extracted is stored for later retrieval
+ * by gcount().
+ *
+ * If an exception is thrown during extraction, ios_base::badbit
+ * will be turned on in the stream's error state without causing an
+ * ios_base::failure to be thrown. The original exception will then
+ * be rethrown.
+ */
+ //@{
+ /**
+ * @brief Simple extraction.
+ * @return A character, or eof().
+ *
+ * Tries to extract a character. If none are available, sets failbit
+ * and returns traits::eof().
+ */
+ int_type
+ get();
+
+ /**
+ * @brief Simple extraction.
+ * @param c The character in which to store data.
+ * @return *this
+ *
+ * Tries to extract a character and store it in @a c. If none are
+ * available, sets failbit and returns traits::eof().
+ *
+ * @note This function is not overloaded on signed char and
+ * unsigned char.
+ */
+ __istream_type&
+ get(char_type& __c);
+
+ /**
+ * @brief Simple multiple-character extraction.
+ * @param s Pointer to an array.
+ * @param n Maximum number of characters to store in @a s.
+ * @param delim A "stop" character.
+ * @return *this
+ *
+ * Characters are extracted and stored into @a s until one of the
+ * following happens:
+ *
+ * - @c n-1 characters are stored
+ * - the input sequence reaches EOF
+ * - the next character equals @a delim, in which case the character
+ * is not extracted
+ *
+ * If no characters are stored, failbit is set in the stream's error
+ * state.
+ *
+ * In any case, a null character is stored into the next location in
+ * the array.
+ *
+ * @note This function is not overloaded on signed char and
+ * unsigned char.
+ */
+ __istream_type&
+ get(char_type* __s, streamsize __n, char_type __delim);
+
+ /**
+ * @brief Simple multiple-character extraction.
+ * @param s Pointer to an array.
+ * @param n Maximum number of characters to store in @a s.
+ * @return *this
+ *
+ * Returns @c get(s,n,widen('\n')).
+ */
+ __istream_type&
+ get(char_type* __s, streamsize __n)
+ { return this->get(__s, __n, this->widen('\n')); }
+
+ /**
+ * @brief Extraction into another streambuf.
+ * @param sb A streambuf in which to store data.
+ * @param delim A "stop" character.
+ * @return *this
+ *
+ * Characters are extracted and inserted into @a sb until one of the
+ * following happens:
+ *
+ * - the input sequence reaches EOF
+ * - insertion into the output buffer fails (in this case, the
+ * character that would have been inserted is not extracted)
+ * - the next character equals @a delim (in this case, the character
+ * is not extracted)
+ * - an exception occurs (and in this case is caught)
+ *
+ * If no characters are stored, failbit is set in the stream's error
+ * state.
+ */
+ __istream_type&
+ get(__streambuf_type& __sb, char_type __delim);
+
+ /**
+ * @brief Extraction into another streambuf.
+ * @param sb A streambuf in which to store data.
+ * @return *this
+ *
+ * Returns @c get(sb,widen('\n')).
+ */
+ __istream_type&
+ get(__streambuf_type& __sb)
+ { return this->get(__sb, this->widen('\n')); }
+
+ /**
+ * @brief String extraction.
+ * @param s A character array in which to store the data.
+ * @param n Maximum number of characters to extract.
+ * @param delim A "stop" character.
+ * @return *this
+ *
+ * Extracts and stores characters into @a s until one of the
+ * following happens. Note that these criteria are required to be
+ * tested in the order listed here, to allow an input line to exactly
+ * fill the @a s array without setting failbit.
+ *
+ * -# the input sequence reaches end-of-file, in which case eofbit
+ * is set in the stream error state
+ * -# the next character equals @c delim, in which case the character
+ * is extracted (and therefore counted in @c gcount()) but not stored
+ * -# @c n-1 characters are stored, in which case failbit is set
+ * in the stream error state
+ *
+ * If no characters are extracted, failbit is set. (An empty line of
+ * input should therefore not cause failbit to be set.)
+ *
+ * In any case, a null character is stored in the next location in
+ * the array.
+ */
+ __istream_type&
+ getline(char_type* __s, streamsize __n, char_type __delim);
+
+ /**
+ * @brief String extraction.
+ * @param s A character array in which to store the data.
+ * @param n Maximum number of characters to extract.
+ * @return *this
+ *
+ * Returns @c getline(s,n,widen('\n')).
+ */
+ __istream_type&
+ getline(char_type* __s, streamsize __n)
+ { return this->getline(__s, __n, this->widen('\n')); }
+
+ /**
+ * @brief Discarding characters
+ * @param n Number of characters to discard.
+ * @param delim A "stop" character.
+ * @return *this
+ *
+ * Extracts characters and throws them away until one of the
+ * following happens:
+ * - if @a n @c != @c std::numeric_limits<int>::max(), @a n
+ * characters are extracted
+ * - the input sequence reaches end-of-file
+ * - the next character equals @a delim (in this case, the character
+ * is extracted); note that this condition will never occur if
+ * @a delim equals @c traits::eof().
+ *
+ * NB: Provide three overloads, instead of the single function
+ * (with defaults) mandated by the Standard: this leads to a
+ * better performing implementation, while still conforming to
+ * the Standard.
+ */
+ __istream_type&
+ ignore();
+
+ __istream_type&
+ ignore(streamsize __n);
+
+ __istream_type&
+ ignore(streamsize __n, int_type __delim);
+
+ /**
+ * @brief Looking ahead in the stream
+ * @return The next character, or eof().
+ *
+ * If, after constructing the sentry object, @c good() is false,
+ * returns @c traits::eof(). Otherwise reads but does not extract
+ * the next input character.
+ */
+ int_type
+ peek();
+
+ /**
+ * @brief Extraction without delimiters.
+ * @param s A character array.
+ * @param n Maximum number of characters to store.
+ * @return *this
+ *
+ * If the stream state is @c good(), extracts characters and stores
+ * them into @a s until one of the following happens:
+ * - @a n characters are stored
+ * - the input sequence reaches end-of-file, in which case the error
+ * state is set to @c failbit|eofbit.
+ *
+ * @note This function is not overloaded on signed char and
+ * unsigned char.
+ */
+ __istream_type&
+ read(char_type* __s, streamsize __n);
+
+ /**
+ * @brief Extraction until the buffer is exhausted, but no more.
+ * @param s A character array.
+ * @param n Maximum number of characters to store.
+ * @return The number of characters extracted.
+ *
+ * Extracts characters and stores them into @a s depending on the
+ * number of characters remaining in the streambuf's buffer,
+ * @c rdbuf()->in_avail(), called @c A here:
+ * - if @c A @c == @c -1, sets eofbit and extracts no characters
+ * - if @c A @c == @c 0, extracts no characters
+ * - if @c A @c > @c 0, extracts @c min(A,n)
+ *
+ * The goal is to empty the current buffer, and to not request any
+ * more from the external input sequence controlled by the streambuf.
+ */
+ streamsize
+ readsome(char_type* __s, streamsize __n);
+
+ /**
+ * @brief Unextracting a single character.
+ * @param c The character to push back into the input stream.
+ * @return *this
+ *
+ * If @c rdbuf() is not null, calls @c rdbuf()->sputbackc(c).
+ *
+ * If @c rdbuf() is null or if @c sputbackc() fails, sets badbit in
+ * the error state.
+ *
+ * @note Since no characters are extracted, the next call to
+ * @c gcount() will return 0, as required by DR 60.
+ */
+ __istream_type&
+ putback(char_type __c);
+
+ /**
+ * @brief Unextracting the previous character.
+ * @return *this
+ *
+ * If @c rdbuf() is not null, calls @c rdbuf()->sungetc(c).
+ *
+ * If @c rdbuf() is null or if @c sungetc() fails, sets badbit in
+ * the error state.
+ *
+ * @note Since no characters are extracted, the next call to
+ * @c gcount() will return 0, as required by DR 60.
+ */
+ __istream_type&
+ unget();
+
+ /**
+ * @brief Synchronizing the stream buffer.
+ * @return 0 on success, -1 on failure
+ *
+ * If @c rdbuf() is a null pointer, returns -1.
+ *
+ * Otherwise, calls @c rdbuf()->pubsync(), and if that returns -1,
+ * sets badbit and returns -1.
+ *
+ * Otherwise, returns 0.
+ *
+ * @note This function does not count the number of characters
+ * extracted, if any, and therefore does not affect the next
+ * call to @c gcount().
+ */
+ int
+ sync();
+
+ /**
+ * @brief Getting the current read position.
+ * @return A file position object.
+ *
+ * If @c fail() is not false, returns @c pos_type(-1) to indicate
+ * failure. Otherwise returns @c rdbuf()->pubseekoff(0,cur,in).
+ *
+ * @note This function does not count the number of characters
+ * extracted, if any, and therefore does not affect the next
+ * call to @c gcount().
+ */
+ pos_type
+ tellg();
+
+ /**
+ * @brief Changing the current read position.
+ * @param pos A file position object.
+ * @return *this
+ *
+ * If @c fail() is not true, calls @c rdbuf()->pubseekpos(pos). If
+ * that function fails, sets failbit.
+ *
+ * @note This function does not count the number of characters
+ * extracted, if any, and therefore does not affect the next
+ * call to @c gcount().
+ */
+ __istream_type&
+ seekg(pos_type);
+
+ /**
+ * @brief Changing the current read position.
+ * @param off A file offset object.
+ * @param dir The direction in which to seek.
+ * @return *this
+ *
+ * If @c fail() is not true, calls @c rdbuf()->pubseekoff(off,dir).
+ * If that function fails, sets failbit.
+ *
+ * @note This function does not count the number of characters
+ * extracted, if any, and therefore does not affect the next
+ * call to @c gcount().
+ */
+ __istream_type&
+ seekg(off_type, ios_base::seekdir);
+ //@}
+
+ protected:
+ basic_istream()
+ : _M_gcount(streamsize(0))
+ { this->init(0); }
+
+ template<typename _ValueT>
+ __istream_type&
+ _M_extract(_ValueT& __v);
+ };
+
+ // Explicit specialization declarations, defined in src/istream.cc.
+ template<>
+ basic_istream<char>&
+ basic_istream<char>::
+ getline(char_type* __s, streamsize __n, char_type __delim);
+
+ template<>
+ basic_istream<char>&
+ basic_istream<char>::
+ ignore(streamsize __n);
+
+ template<>
+ basic_istream<char>&
+ basic_istream<char>::
+ ignore(streamsize __n, int_type __delim);
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template<>
+ basic_istream<wchar_t>&
+ basic_istream<wchar_t>::
+ getline(char_type* __s, streamsize __n, char_type __delim);
+
+ template<>
+ basic_istream<wchar_t>&
+ basic_istream<wchar_t>::
+ ignore(streamsize __n);
+
+ template<>
+ basic_istream<wchar_t>&
+ basic_istream<wchar_t>::
+ ignore(streamsize __n, int_type __delim);
+#endif
+
+ /**
+ * @brief Performs setup work for input streams.
+ *
+ * Objects of this class are created before all of the standard
+ * extractors are run. It is responsible for "exception-safe prefix and
+ * suffix operations," although only prefix actions are currently required
+ * by the standard.
+ */
+ template<typename _CharT, typename _Traits>
+ class basic_istream<_CharT, _Traits>::sentry
+ {
+ public:
+ /// Easy access to dependant types.
+ typedef _Traits traits_type;
+ typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
+ typedef basic_istream<_CharT, _Traits> __istream_type;
+ typedef typename __istream_type::__ctype_type __ctype_type;
+ typedef typename _Traits::int_type __int_type;
+
+ /**
+ * @brief The constructor performs all the work.
+ * @param is The input stream to guard.
+ * @param noskipws Whether to consume whitespace or not.
+ *
+ * If the stream state is good (@a is.good() is true), then the
+ * following actions are performed, otherwise the sentry state is
+ * false ("not okay") and failbit is set in the stream state.
+ *
+ * The sentry's preparatory actions are:
+ *
+ * -# if the stream is tied to an output stream, @c is.tie()->flush()
+ * is called to synchronize the output sequence
+ * -# if @a noskipws is false, and @c ios_base::skipws is set in
+ * @c is.flags(), the sentry extracts and discards whitespace
+ * characters from the stream. The currently imbued locale is
+ * used to determine whether each character is whitespace.
+ *
+ * If the stream state is still good, then the sentry state becomes
+ * true ("okay").
+ */
+ explicit
+ sentry(basic_istream<_CharT, _Traits>& __is, bool __noskipws = false);
+
+ /**
+ * @brief Quick status checking.
+ * @return The sentry state.
+ *
+ * For ease of use, sentries may be converted to booleans. The
+ * return value is that of the sentry state (true == okay).
+ */
+ operator bool() const
+ { return _M_ok; }
+
+ private:
+ bool _M_ok;
+ };
+
+ // [27.6.1.2.3] character extraction templates
+ //@{
+ /**
+ * @brief Character extractors
+ * @param in An input stream.
+ * @param c A character reference.
+ * @return in
+ *
+ * Behaves like one of the formatted arithmetic extractors described in
+ * std::basic_istream. After constructing a sentry object with good
+ * status, this function extracts a character (if one is available) and
+ * stores it in @a c. Otherwise, sets failbit in the input stream.
+ */
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c);
+
+ template<class _Traits>
+ inline basic_istream<char, _Traits>&
+ operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
+ { return (__in >> reinterpret_cast<char&>(__c)); }
+
+ template<class _Traits>
+ inline basic_istream<char, _Traits>&
+ operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
+ { return (__in >> reinterpret_cast<char&>(__c)); }
+ //@}
+
+ //@{
+ /**
+ * @brief Character string extractors
+ * @param in An input stream.
+ * @param s A pointer to a character array.
+ * @return in
+ *
+ * Behaves like one of the formatted arithmetic extractors described in
+ * std::basic_istream. After constructing a sentry object with good
+ * status, this function extracts up to @c n characters and stores them
+ * into the array starting at @a s. @c n is defined as:
+ *
+ * - if @c width() is greater than zero, @c n is width()
+ * - otherwise @c n is "the number of elements of the largest array of
+ * @c char_type that can store a terminating @c eos." [27.6.1.2.3]/6
+ *
+ * Characters are extracted and stored until one of the following happens:
+ * - @c n-1 characters are stored
+ * - EOF is reached
+ * - the next character is whitespace according to the current locale
+ * - the next character is a null byte (i.e., @c charT() )
+ *
+ * @c width(0) is then called for the input stream.
+ *
+ * If no characters are extracted, sets failbit.
+ */
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s);
+
+ // Explicit specialization declaration, defined in src/istream.cc.
+ template<>
+ basic_istream<char>&
+ operator>>(basic_istream<char>& __in, char* __s);
+
+ template<class _Traits>
+ inline basic_istream<char, _Traits>&
+ operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
+ { return (__in >> reinterpret_cast<char*>(__s)); }
+
+ template<class _Traits>
+ inline basic_istream<char, _Traits>&
+ operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
+ { return (__in >> reinterpret_cast<char*>(__s)); }
+ //@}
+
+ // 27.6.1.5 Template class basic_iostream
+ /**
+ * @brief Merging istream and ostream capabilities.
+ * @ingroup io
+ *
+ * This class multiply inherits from the input and output stream classes
+ * simply to provide a single interface.
+ */
+ template<typename _CharT, typename _Traits>
+ class basic_iostream
+ : public basic_istream<_CharT, _Traits>,
+ public basic_ostream<_CharT, _Traits>
+ {
+ public:
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 271. basic_iostream missing typedefs
+ // Types (inherited):
+ typedef _CharT char_type;
+ typedef typename _Traits::int_type int_type;
+ typedef typename _Traits::pos_type pos_type;
+ typedef typename _Traits::off_type off_type;
+ typedef _Traits traits_type;
+
+ // Non-standard Types:
+ typedef basic_istream<_CharT, _Traits> __istream_type;
+ typedef basic_ostream<_CharT, _Traits> __ostream_type;
+
+ /**
+ * @brief Constructor does nothing.
+ *
+ * Both of the parent classes are initialized with the same
+ * streambuf pointer passed to this constructor.
+ */
+ explicit
+ basic_iostream(basic_streambuf<_CharT, _Traits>* __sb)
+ : __istream_type(__sb), __ostream_type(__sb) { }
+
+ /**
+ * @brief Destructor does nothing.
+ */
+ virtual
+ ~basic_iostream() { }
+
+ protected:
+ basic_iostream()
+ : __istream_type(), __ostream_type() { }
+ };
+
+ // [27.6.1.4] standard basic_istream manipulators
+ /**
+ * @brief Quick and easy way to eat whitespace
+ *
+ * This manipulator extracts whitespace characters, stopping when the
+ * next character is non-whitespace, or when the input sequence is empty.
+ * If the sequence is empty, @c eofbit is set in the stream, but not
+ * @c failbit.
+ *
+ * The current locale is used to distinguish whitespace characters.
+ *
+ * Example:
+ * @code
+ * MyClass mc;
+ *
+ * std::cin >> std::ws >> mc;
+ * @endcode
+ * will skip leading whitespace before calling operator>> on cin and your
+ * object. Note that the same effect can be achieved by creating a
+ * std::basic_istream::sentry inside your definition of operator>>.
+ */
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ ws(basic_istream<_CharT, _Traits>& __is);
+
+_GLIBCXX_END_NAMESPACE
+
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <bits/istream.tcc>
+#endif
+
+#endif /* _GLIBCXX_ISTREAM */
diff --git a/i686-linux/include/c++/4.4.3/iterator b/i686-linux/include/c++/4.4.3/iterator
new file mode 100644
index 0000000..a15bdf9
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/iterator
@@ -0,0 +1,70 @@
+// <iterator> -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file include/iterator
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_ITERATOR
+#define _GLIBCXX_ITERATOR 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <cstddef>
+#include <bits/stl_iterator_base_types.h>
+#include <bits/stl_iterator_base_funcs.h>
+#include <bits/stl_iterator.h>
+#include <ostream>
+#include <istream>
+#include <bits/stream_iterator.h>
+#include <bits/streambuf_iterator.h>
+
+#endif /* _GLIBCXX_ITERATOR */
diff --git a/i686-linux/include/c++/4.4.3/limits b/i686-linux/include/c++/4.4.3/limits
new file mode 100644
index 0000000..41bf806
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/limits
@@ -0,0 +1,1256 @@
+// The template and inlines for the numeric_limits classes. -*- C++ -*-
+
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+// 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file limits
+ * This is a Standard C++ Library header.
+ */
+
+// Note: this is not a conforming implementation.
+// Written by Gabriel Dos Reis <gdr@codesourcery.com>
+
+//
+// ISO 14882:1998
+// 18.2.1
+//
+
+#ifndef _GLIBCXX_NUMERIC_LIMITS
+#define _GLIBCXX_NUMERIC_LIMITS 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+
+//
+// The numeric_limits<> traits document implementation-defined aspects
+// of fundamental arithmetic data types (integers and floating points).
+// From Standard C++ point of view, there are 13 such types:
+// * integers
+// bool (1)
+// char, signed char, unsigned char (3)
+// short, unsigned short (2)
+// int, unsigned (2)
+// long, unsigned long (2)
+//
+// * floating points
+// float (1)
+// double (1)
+// long double (1)
+//
+// GNU C++ understands (where supported by the host C-library)
+// * integer
+// long long, unsigned long long (2)
+//
+// which brings us to 15 fundamental arithmetic data types in GNU C++.
+//
+//
+// Since a numeric_limits<> is a bit tricky to get right, we rely on
+// an interface composed of macros which should be defined in config/os
+// or config/cpu when they differ from the generic (read arbitrary)
+// definitions given here.
+//
+
+// These values can be overridden in the target configuration file.
+// The default values are appropriate for many 32-bit targets.
+
+// GCC only intrinsically supports modulo integral types. The only remaining
+// integral exceptional values is division by zero. Only targets that do not
+// signal division by zero in some "hard to ignore" way should use false.
+#ifndef __glibcxx_integral_traps
+# define __glibcxx_integral_traps true
+#endif
+
+// float
+//
+
+// Default values. Should be overridden in configuration files if necessary.
+
+#ifndef __glibcxx_float_has_denorm_loss
+# define __glibcxx_float_has_denorm_loss false
+#endif
+#ifndef __glibcxx_float_traps
+# define __glibcxx_float_traps false
+#endif
+#ifndef __glibcxx_float_tinyness_before
+# define __glibcxx_float_tinyness_before false
+#endif
+
+// double
+
+// Default values. Should be overridden in configuration files if necessary.
+
+#ifndef __glibcxx_double_has_denorm_loss
+# define __glibcxx_double_has_denorm_loss false
+#endif
+#ifndef __glibcxx_double_traps
+# define __glibcxx_double_traps false
+#endif
+#ifndef __glibcxx_double_tinyness_before
+# define __glibcxx_double_tinyness_before false
+#endif
+
+// long double
+
+// Default values. Should be overridden in configuration files if necessary.
+
+#ifndef __glibcxx_long_double_has_denorm_loss
+# define __glibcxx_long_double_has_denorm_loss false
+#endif
+#ifndef __glibcxx_long_double_traps
+# define __glibcxx_long_double_traps false
+#endif
+#ifndef __glibcxx_long_double_tinyness_before
+# define __glibcxx_long_double_tinyness_before false
+#endif
+
+// You should not need to define any macros below this point.
+
+#define __glibcxx_signed(T) ((T)(-1) < 0)
+
+#define __glibcxx_min(T) \
+ (__glibcxx_signed (T) ? (T)1 << __glibcxx_digits (T) : (T)0)
+
+#define __glibcxx_max(T) \
+ (__glibcxx_signed (T) ? \
+ (((((T)1 << (__glibcxx_digits (T) - 1)) - 1) << 1) + 1) : ~(T)0)
+
+#define __glibcxx_digits(T) \
+ (sizeof(T) * __CHAR_BIT__ - __glibcxx_signed (T))
+
+// The fraction 643/2136 approximates log10(2) to 7 significant digits.
+#define __glibcxx_digits10(T) \
+ (__glibcxx_digits (T) * 643 / 2136)
+
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @brief Describes the rounding style for floating-point types.
+ *
+ * This is used in the std::numeric_limits class.
+ */
+ enum float_round_style
+ {
+ round_indeterminate = -1, ///< Self-explanatory.
+ round_toward_zero = 0, ///< Self-explanatory.
+ round_to_nearest = 1, ///< To the nearest representable value.
+ round_toward_infinity = 2, ///< Self-explanatory.
+ round_toward_neg_infinity = 3 ///< Self-explanatory.
+ };
+
+ /**
+ * @brief Describes the denormalization for floating-point types.
+ *
+ * These values represent the presence or absence of a variable number
+ * of exponent bits. This type is used in the std::numeric_limits class.
+ */
+ enum float_denorm_style
+ {
+ /// Indeterminate at compile time whether denormalized values are allowed.
+ denorm_indeterminate = -1,
+ /// The type does not allow denormalized values.
+ denorm_absent = 0,
+ /// The type allows denormalized values.
+ denorm_present = 1
+ };
+
+ /**
+ * @brief Part of std::numeric_limits.
+ *
+ * The @c static @c const members are usable as integral constant
+ * expressions.
+ *
+ * @note This is a separate class for purposes of efficiency; you
+ * should only access these members as part of an instantiation
+ * of the std::numeric_limits class.
+ */
+ struct __numeric_limits_base
+ {
+ /** This will be true for all fundamental types (which have
+ specializations), and false for everything else. */
+ static const bool is_specialized = false;
+
+ /** The number of @c radix digits that be represented without change: for
+ integer types, the number of non-sign bits in the mantissa; for
+ floating types, the number of @c radix digits in the mantissa. */
+ static const int digits = 0;
+ /** The number of base 10 digits that can be represented without change. */
+ static const int digits10 = 0;
+ /** True if the type is signed. */
+ static const bool is_signed = false;
+ /** True if the type is integer.
+ * Is this supposed to be "if the type is integral"?
+ */
+ static const bool is_integer = false;
+ /** True if the type uses an exact representation. "All integer types are
+ exact, but not all exact types are integer. For example, rational and
+ fixed-exponent representations are exact but not integer."
+ [18.2.1.2]/15 */
+ static const bool is_exact = false;
+ /** For integer types, specifies the base of the representation. For
+ floating types, specifies the base of the exponent representation. */
+ static const int radix = 0;
+
+ /** The minimum negative integer such that @c radix raised to the power of
+ (one less than that integer) is a normalized floating point number. */
+ static const int min_exponent = 0;
+ /** The minimum negative integer such that 10 raised to that power is in
+ the range of normalized floating point numbers. */
+ static const int min_exponent10 = 0;
+ /** The maximum positive integer such that @c radix raised to the power of
+ (one less than that integer) is a representable finite floating point
+ number. */
+ static const int max_exponent = 0;
+ /** The maximum positive integer such that 10 raised to that power is in
+ the range of representable finite floating point numbers. */
+ static const int max_exponent10 = 0;
+
+ /** True if the type has a representation for positive infinity. */
+ static const bool has_infinity = false;
+ /** True if the type has a representation for a quiet (non-signaling)
+ "Not a Number." */
+ static const bool has_quiet_NaN = false;
+ /** True if the type has a representation for a signaling
+ "Not a Number." */
+ static const bool has_signaling_NaN = false;
+ /** See std::float_denorm_style for more information. */
+ static const float_denorm_style has_denorm = denorm_absent;
+ /** "True if loss of accuracy is detected as a denormalization loss,
+ rather than as an inexact result." [18.2.1.2]/42 */
+ static const bool has_denorm_loss = false;
+
+ /** True if-and-only-if the type adheres to the IEC 559 standard, also
+ known as IEEE 754. (Only makes sense for floating point types.) */
+ static const bool is_iec559 = false;
+ /** "True if the set of values representable by the type is finite. All
+ built-in types are bounded, this member would be false for arbitrary
+ precision types." [18.2.1.2]/54 */
+ static const bool is_bounded = false;
+ /** True if the type is @e modulo, that is, if it is possible to add two
+ positive numbers and have a result that wraps around to a third number
+ that is less. Typically false for floating types, true for unsigned
+ integers, and true for signed integers. */
+ static const bool is_modulo = false;
+
+ /** True if trapping is implemented for this type. */
+ static const bool traps = false;
+ /** True if tininess is detected before rounding. (see IEC 559) */
+ static const bool tinyness_before = false;
+ /** See std::float_round_style for more information. This is only
+ meaningful for floating types; integer types will all be
+ round_toward_zero. */
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+ /**
+ * @brief Properties of fundamental types.
+ *
+ * This class allows a program to obtain information about the
+ * representation of a fundamental type on a given platform. For
+ * non-fundamental types, the functions will return 0 and the data
+ * members will all be @c false.
+ *
+ * _GLIBCXX_RESOLVE_LIB_DEFECTS: DRs 201 and 184 (hi Gaby!) are
+ * noted, but not incorporated in this documented (yet).
+ */
+ template<typename _Tp>
+ struct numeric_limits : public __numeric_limits_base
+ {
+ /** The minimum finite value, or for floating types with
+ denormalization, the minimum positive normalized value. */
+ static _Tp min() throw() { return static_cast<_Tp>(0); }
+ /** The maximum finite value. */
+ static _Tp max() throw() { return static_cast<_Tp>(0); }
+ /** The @e machine @e epsilon: the difference between 1 and the least
+ value greater than 1 that is representable. */
+ static _Tp epsilon() throw() { return static_cast<_Tp>(0); }
+ /** The maximum rounding error measurement (see LIA-1). */
+ static _Tp round_error() throw() { return static_cast<_Tp>(0); }
+ /** The representation of positive infinity, if @c has_infinity. */
+ static _Tp infinity() throw() { return static_cast<_Tp>(0); }
+ /** The representation of a quiet "Not a Number," if @c has_quiet_NaN. */
+ static _Tp quiet_NaN() throw() { return static_cast<_Tp>(0); }
+ /** The representation of a signaling "Not a Number," if
+ @c has_signaling_NaN. */
+ static _Tp signaling_NaN() throw() { return static_cast<_Tp>(0); }
+ /** The minimum positive denormalized value. For types where
+ @c has_denorm is false, this is the minimum positive normalized
+ value. */
+ static _Tp denorm_min() throw() { return static_cast<_Tp>(0); }
+ };
+
+ // Now there follow 15 explicit specializations. Yes, 15. Make sure
+ // you get the count right.
+
+ /// numeric_limits<bool> specialization.
+ template<>
+ struct numeric_limits<bool>
+ {
+ static const bool is_specialized = true;
+
+ static bool min() throw()
+ { return false; }
+ static bool max() throw()
+ { return true; }
+
+ static const int digits = 1;
+ static const int digits10 = 0;
+ static const bool is_signed = false;
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static bool epsilon() throw()
+ { return false; }
+ static bool round_error() throw()
+ { return false; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static bool infinity() throw()
+ { return false; }
+ static bool quiet_NaN() throw()
+ { return false; }
+ static bool signaling_NaN() throw()
+ { return false; }
+ static bool denorm_min() throw()
+ { return false; }
+
+ static const bool is_iec559 = false;
+ static const bool is_bounded = true;
+ static const bool is_modulo = false;
+
+ // It is not clear what it means for a boolean type to trap.
+ // This is a DR on the LWG issue list. Here, I use integer
+ // promotion semantics.
+ static const bool traps = __glibcxx_integral_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+ /// numeric_limits<char> specialization.
+ template<>
+ struct numeric_limits<char>
+ {
+ static const bool is_specialized = true;
+
+ static char min() throw()
+ { return __glibcxx_min(char); }
+ static char max() throw()
+ { return __glibcxx_max(char); }
+
+ static const int digits = __glibcxx_digits (char);
+ static const int digits10 = __glibcxx_digits10 (char);
+ static const bool is_signed = __glibcxx_signed (char);
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static char epsilon() throw()
+ { return 0; }
+ static char round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static char infinity() throw()
+ { return char(); }
+ static char quiet_NaN() throw()
+ { return char(); }
+ static char signaling_NaN() throw()
+ { return char(); }
+ static char denorm_min() throw()
+ { return static_cast<char>(0); }
+
+ static const bool is_iec559 = false;
+ static const bool is_bounded = true;
+ static const bool is_modulo = true;
+
+ static const bool traps = __glibcxx_integral_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+ /// numeric_limits<signed char> specialization.
+ template<>
+ struct numeric_limits<signed char>
+ {
+ static const bool is_specialized = true;
+
+ static signed char min() throw()
+ { return -__SCHAR_MAX__ - 1; }
+ static signed char max() throw()
+ { return __SCHAR_MAX__; }
+
+ static const int digits = __glibcxx_digits (signed char);
+ static const int digits10 = __glibcxx_digits10 (signed char);
+ static const bool is_signed = true;
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static signed char epsilon() throw()
+ { return 0; }
+ static signed char round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static signed char infinity() throw()
+ { return static_cast<signed char>(0); }
+ static signed char quiet_NaN() throw()
+ { return static_cast<signed char>(0); }
+ static signed char signaling_NaN() throw()
+ { return static_cast<signed char>(0); }
+ static signed char denorm_min() throw()
+ { return static_cast<signed char>(0); }
+
+ static const bool is_iec559 = false;
+ static const bool is_bounded = true;
+ static const bool is_modulo = true;
+
+ static const bool traps = __glibcxx_integral_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+ /// numeric_limits<unsigned char> specialization.
+ template<>
+ struct numeric_limits<unsigned char>
+ {
+ static const bool is_specialized = true;
+
+ static unsigned char min() throw()
+ { return 0; }
+ static unsigned char max() throw()
+ { return __SCHAR_MAX__ * 2U + 1; }
+
+ static const int digits = __glibcxx_digits (unsigned char);
+ static const int digits10 = __glibcxx_digits10 (unsigned char);
+ static const bool is_signed = false;
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static unsigned char epsilon() throw()
+ { return 0; }
+ static unsigned char round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static unsigned char infinity() throw()
+ { return static_cast<unsigned char>(0); }
+ static unsigned char quiet_NaN() throw()
+ { return static_cast<unsigned char>(0); }
+ static unsigned char signaling_NaN() throw()
+ { return static_cast<unsigned char>(0); }
+ static unsigned char denorm_min() throw()
+ { return static_cast<unsigned char>(0); }
+
+ static const bool is_iec559 = false;
+ static const bool is_bounded = true;
+ static const bool is_modulo = true;
+
+ static const bool traps = __glibcxx_integral_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+ /// numeric_limits<wchar_t> specialization.
+ template<>
+ struct numeric_limits<wchar_t>
+ {
+ static const bool is_specialized = true;
+
+ static wchar_t min() throw()
+ { return __glibcxx_min (wchar_t); }
+ static wchar_t max() throw()
+ { return __glibcxx_max (wchar_t); }
+
+ static const int digits = __glibcxx_digits (wchar_t);
+ static const int digits10 = __glibcxx_digits10 (wchar_t);
+ static const bool is_signed = __glibcxx_signed (wchar_t);
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static wchar_t epsilon() throw()
+ { return 0; }
+ static wchar_t round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static wchar_t infinity() throw()
+ { return wchar_t(); }
+ static wchar_t quiet_NaN() throw()
+ { return wchar_t(); }
+ static wchar_t signaling_NaN() throw()
+ { return wchar_t(); }
+ static wchar_t denorm_min() throw()
+ { return wchar_t(); }
+
+ static const bool is_iec559 = false;
+ static const bool is_bounded = true;
+ static const bool is_modulo = true;
+
+ static const bool traps = __glibcxx_integral_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /// numeric_limits<char16_t> specialization.
+ template<>
+ struct numeric_limits<char16_t>
+ {
+ static const bool is_specialized = true;
+
+ static char16_t min() throw()
+ { return __glibcxx_min (char16_t); }
+ static char16_t max() throw()
+ { return __glibcxx_max (char16_t); }
+
+ static const int digits = __glibcxx_digits (char16_t);
+ static const int digits10 = __glibcxx_digits10 (char16_t);
+ static const bool is_signed = __glibcxx_signed (char16_t);
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static char16_t epsilon() throw()
+ { return 0; }
+ static char16_t round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static char16_t infinity() throw()
+ { return char16_t(); }
+ static char16_t quiet_NaN() throw()
+ { return char16_t(); }
+ static char16_t signaling_NaN() throw()
+ { return char16_t(); }
+ static char16_t denorm_min() throw()
+ { return char16_t(); }
+
+ static const bool is_iec559 = false;
+ static const bool is_bounded = true;
+ static const bool is_modulo = true;
+
+ static const bool traps = __glibcxx_integral_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+ /// numeric_limits<char32_t> specialization.
+ template<>
+ struct numeric_limits<char32_t>
+ {
+ static const bool is_specialized = true;
+
+ static char32_t min() throw()
+ { return __glibcxx_min (char32_t); }
+ static char32_t max() throw()
+ { return __glibcxx_max (char32_t); }
+
+ static const int digits = __glibcxx_digits (char32_t);
+ static const int digits10 = __glibcxx_digits10 (char32_t);
+ static const bool is_signed = __glibcxx_signed (char32_t);
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static char32_t epsilon() throw()
+ { return 0; }
+ static char32_t round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static char32_t infinity() throw()
+ { return char32_t(); }
+ static char32_t quiet_NaN() throw()
+ { return char32_t(); }
+ static char32_t signaling_NaN() throw()
+ { return char32_t(); }
+ static char32_t denorm_min() throw()
+ { return char32_t(); }
+
+ static const bool is_iec559 = false;
+ static const bool is_bounded = true;
+ static const bool is_modulo = true;
+
+ static const bool traps = __glibcxx_integral_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+#endif
+
+ /// numeric_limits<short> specialization.
+ template<>
+ struct numeric_limits<short>
+ {
+ static const bool is_specialized = true;
+
+ static short min() throw()
+ { return -__SHRT_MAX__ - 1; }
+ static short max() throw()
+ { return __SHRT_MAX__; }
+
+ static const int digits = __glibcxx_digits (short);
+ static const int digits10 = __glibcxx_digits10 (short);
+ static const bool is_signed = true;
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static short epsilon() throw()
+ { return 0; }
+ static short round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static short infinity() throw()
+ { return short(); }
+ static short quiet_NaN() throw()
+ { return short(); }
+ static short signaling_NaN() throw()
+ { return short(); }
+ static short denorm_min() throw()
+ { return short(); }
+
+ static const bool is_iec559 = false;
+ static const bool is_bounded = true;
+ static const bool is_modulo = true;
+
+ static const bool traps = __glibcxx_integral_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+ /// numeric_limits<unsigned short> specialization.
+ template<>
+ struct numeric_limits<unsigned short>
+ {
+ static const bool is_specialized = true;
+
+ static unsigned short min() throw()
+ { return 0; }
+ static unsigned short max() throw()
+ { return __SHRT_MAX__ * 2U + 1; }
+
+ static const int digits = __glibcxx_digits (unsigned short);
+ static const int digits10 = __glibcxx_digits10 (unsigned short);
+ static const bool is_signed = false;
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static unsigned short epsilon() throw()
+ { return 0; }
+ static unsigned short round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static unsigned short infinity() throw()
+ { return static_cast<unsigned short>(0); }
+ static unsigned short quiet_NaN() throw()
+ { return static_cast<unsigned short>(0); }
+ static unsigned short signaling_NaN() throw()
+ { return static_cast<unsigned short>(0); }
+ static unsigned short denorm_min() throw()
+ { return static_cast<unsigned short>(0); }
+
+ static const bool is_iec559 = false;
+ static const bool is_bounded = true;
+ static const bool is_modulo = true;
+
+ static const bool traps = __glibcxx_integral_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+ /// numeric_limits<int> specialization.
+ template<>
+ struct numeric_limits<int>
+ {
+ static const bool is_specialized = true;
+
+ static int min() throw()
+ { return -__INT_MAX__ - 1; }
+ static int max() throw()
+ { return __INT_MAX__; }
+
+ static const int digits = __glibcxx_digits (int);
+ static const int digits10 = __glibcxx_digits10 (int);
+ static const bool is_signed = true;
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static int epsilon() throw()
+ { return 0; }
+ static int round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static int infinity() throw()
+ { return static_cast<int>(0); }
+ static int quiet_NaN() throw()
+ { return static_cast<int>(0); }
+ static int signaling_NaN() throw()
+ { return static_cast<int>(0); }
+ static int denorm_min() throw()
+ { return static_cast<int>(0); }
+
+ static const bool is_iec559 = false;
+ static const bool is_bounded = true;
+ static const bool is_modulo = true;
+
+ static const bool traps = __glibcxx_integral_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+ /// numeric_limits<unsigned int> specialization.
+ template<>
+ struct numeric_limits<unsigned int>
+ {
+ static const bool is_specialized = true;
+
+ static unsigned int min() throw()
+ { return 0; }
+ static unsigned int max() throw()
+ { return __INT_MAX__ * 2U + 1; }
+
+ static const int digits = __glibcxx_digits (unsigned int);
+ static const int digits10 = __glibcxx_digits10 (unsigned int);
+ static const bool is_signed = false;
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static unsigned int epsilon() throw()
+ { return 0; }
+ static unsigned int round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static unsigned int infinity() throw()
+ { return static_cast<unsigned int>(0); }
+ static unsigned int quiet_NaN() throw()
+ { return static_cast<unsigned int>(0); }
+ static unsigned int signaling_NaN() throw()
+ { return static_cast<unsigned int>(0); }
+ static unsigned int denorm_min() throw()
+ { return static_cast<unsigned int>(0); }
+
+ static const bool is_iec559 = false;
+ static const bool is_bounded = true;
+ static const bool is_modulo = true;
+
+ static const bool traps = __glibcxx_integral_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+ /// numeric_limits<long> specialization.
+ template<>
+ struct numeric_limits<long>
+ {
+ static const bool is_specialized = true;
+
+ static long min() throw()
+ { return -__LONG_MAX__ - 1; }
+ static long max() throw()
+ { return __LONG_MAX__; }
+
+ static const int digits = __glibcxx_digits (long);
+ static const int digits10 = __glibcxx_digits10 (long);
+ static const bool is_signed = true;
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static long epsilon() throw()
+ { return 0; }
+ static long round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static long infinity() throw()
+ { return static_cast<long>(0); }
+ static long quiet_NaN() throw()
+ { return static_cast<long>(0); }
+ static long signaling_NaN() throw()
+ { return static_cast<long>(0); }
+ static long denorm_min() throw()
+ { return static_cast<long>(0); }
+
+ static const bool is_iec559 = false;
+ static const bool is_bounded = true;
+ static const bool is_modulo = true;
+
+ static const bool traps = __glibcxx_integral_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+ /// numeric_limits<unsigned long> specialization.
+ template<>
+ struct numeric_limits<unsigned long>
+ {
+ static const bool is_specialized = true;
+
+ static unsigned long min() throw()
+ { return 0; }
+ static unsigned long max() throw()
+ { return __LONG_MAX__ * 2UL + 1; }
+
+ static const int digits = __glibcxx_digits (unsigned long);
+ static const int digits10 = __glibcxx_digits10 (unsigned long);
+ static const bool is_signed = false;
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static unsigned long epsilon() throw()
+ { return 0; }
+ static unsigned long round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static unsigned long infinity() throw()
+ { return static_cast<unsigned long>(0); }
+ static unsigned long quiet_NaN() throw()
+ { return static_cast<unsigned long>(0); }
+ static unsigned long signaling_NaN() throw()
+ { return static_cast<unsigned long>(0); }
+ static unsigned long denorm_min() throw()
+ { return static_cast<unsigned long>(0); }
+
+ static const bool is_iec559 = false;
+ static const bool is_bounded = true;
+ static const bool is_modulo = true;
+
+ static const bool traps = __glibcxx_integral_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+ /// numeric_limits<long long> specialization.
+ template<>
+ struct numeric_limits<long long>
+ {
+ static const bool is_specialized = true;
+
+ static long long min() throw()
+ { return -__LONG_LONG_MAX__ - 1; }
+ static long long max() throw()
+ { return __LONG_LONG_MAX__; }
+
+ static const int digits = __glibcxx_digits (long long);
+ static const int digits10 = __glibcxx_digits10 (long long);
+ static const bool is_signed = true;
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static long long epsilon() throw()
+ { return 0; }
+ static long long round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static long long infinity() throw()
+ { return static_cast<long long>(0); }
+ static long long quiet_NaN() throw()
+ { return static_cast<long long>(0); }
+ static long long signaling_NaN() throw()
+ { return static_cast<long long>(0); }
+ static long long denorm_min() throw()
+ { return static_cast<long long>(0); }
+
+ static const bool is_iec559 = false;
+ static const bool is_bounded = true;
+ static const bool is_modulo = true;
+
+ static const bool traps = __glibcxx_integral_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+ /// numeric_limits<unsigned long long> specialization.
+ template<>
+ struct numeric_limits<unsigned long long>
+ {
+ static const bool is_specialized = true;
+
+ static unsigned long long min() throw()
+ { return 0; }
+ static unsigned long long max() throw()
+ { return __LONG_LONG_MAX__ * 2ULL + 1; }
+
+ static const int digits = __glibcxx_digits (unsigned long long);
+ static const int digits10 = __glibcxx_digits10 (unsigned long long);
+ static const bool is_signed = false;
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static unsigned long long epsilon() throw()
+ { return 0; }
+ static unsigned long long round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static unsigned long long infinity() throw()
+ { return static_cast<unsigned long long>(0); }
+ static unsigned long long quiet_NaN() throw()
+ { return static_cast<unsigned long long>(0); }
+ static unsigned long long signaling_NaN() throw()
+ { return static_cast<unsigned long long>(0); }
+ static unsigned long long denorm_min() throw()
+ { return static_cast<unsigned long long>(0); }
+
+ static const bool is_iec559 = false;
+ static const bool is_bounded = true;
+ static const bool is_modulo = true;
+
+ static const bool traps = __glibcxx_integral_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+ /// numeric_limits<float> specialization.
+ template<>
+ struct numeric_limits<float>
+ {
+ static const bool is_specialized = true;
+
+ static float min() throw()
+ { return __FLT_MIN__; }
+ static float max() throw()
+ { return __FLT_MAX__; }
+
+ static const int digits = __FLT_MANT_DIG__;
+ static const int digits10 = __FLT_DIG__;
+ static const bool is_signed = true;
+ static const bool is_integer = false;
+ static const bool is_exact = false;
+ static const int radix = __FLT_RADIX__;
+ static float epsilon() throw()
+ { return __FLT_EPSILON__; }
+ static float round_error() throw()
+ { return 0.5F; }
+
+ static const int min_exponent = __FLT_MIN_EXP__;
+ static const int min_exponent10 = __FLT_MIN_10_EXP__;
+ static const int max_exponent = __FLT_MAX_EXP__;
+ static const int max_exponent10 = __FLT_MAX_10_EXP__;
+
+ static const bool has_infinity = __FLT_HAS_INFINITY__;
+ static const bool has_quiet_NaN = __FLT_HAS_QUIET_NAN__;
+ static const bool has_signaling_NaN = has_quiet_NaN;
+ static const float_denorm_style has_denorm
+ = bool(__FLT_HAS_DENORM__) ? denorm_present : denorm_absent;
+ static const bool has_denorm_loss = __glibcxx_float_has_denorm_loss;
+
+ static float infinity() throw()
+ { return __builtin_huge_valf (); }
+ static float quiet_NaN() throw()
+ { return __builtin_nanf (""); }
+ static float signaling_NaN() throw()
+ { return __builtin_nansf (""); }
+ static float denorm_min() throw()
+ { return __FLT_DENORM_MIN__; }
+
+ static const bool is_iec559
+ = has_infinity && has_quiet_NaN && has_denorm == denorm_present;
+ static const bool is_bounded = true;
+ static const bool is_modulo = false;
+
+ static const bool traps = __glibcxx_float_traps;
+ static const bool tinyness_before = __glibcxx_float_tinyness_before;
+ static const float_round_style round_style = round_to_nearest;
+ };
+
+#undef __glibcxx_float_has_denorm_loss
+#undef __glibcxx_float_traps
+#undef __glibcxx_float_tinyness_before
+
+ /// numeric_limits<double> specialization.
+ template<>
+ struct numeric_limits<double>
+ {
+ static const bool is_specialized = true;
+
+ static double min() throw()
+ { return __DBL_MIN__; }
+ static double max() throw()
+ { return __DBL_MAX__; }
+
+ static const int digits = __DBL_MANT_DIG__;
+ static const int digits10 = __DBL_DIG__;
+ static const bool is_signed = true;
+ static const bool is_integer = false;
+ static const bool is_exact = false;
+ static const int radix = __FLT_RADIX__;
+ static double epsilon() throw()
+ { return __DBL_EPSILON__; }
+ static double round_error() throw()
+ { return 0.5; }
+
+ static const int min_exponent = __DBL_MIN_EXP__;
+ static const int min_exponent10 = __DBL_MIN_10_EXP__;
+ static const int max_exponent = __DBL_MAX_EXP__;
+ static const int max_exponent10 = __DBL_MAX_10_EXP__;
+
+ static const bool has_infinity = __DBL_HAS_INFINITY__;
+ static const bool has_quiet_NaN = __DBL_HAS_QUIET_NAN__;
+ static const bool has_signaling_NaN = has_quiet_NaN;
+ static const float_denorm_style has_denorm
+ = bool(__DBL_HAS_DENORM__) ? denorm_present : denorm_absent;
+ static const bool has_denorm_loss = __glibcxx_double_has_denorm_loss;
+
+ static double infinity() throw()
+ { return __builtin_huge_val(); }
+ static double quiet_NaN() throw()
+ { return __builtin_nan (""); }
+ static double signaling_NaN() throw()
+ { return __builtin_nans (""); }
+ static double denorm_min() throw()
+ { return __DBL_DENORM_MIN__; }
+
+ static const bool is_iec559
+ = has_infinity && has_quiet_NaN && has_denorm == denorm_present;
+ static const bool is_bounded = true;
+ static const bool is_modulo = false;
+
+ static const bool traps = __glibcxx_double_traps;
+ static const bool tinyness_before = __glibcxx_double_tinyness_before;
+ static const float_round_style round_style = round_to_nearest;
+ };
+
+#undef __glibcxx_double_has_denorm_loss
+#undef __glibcxx_double_traps
+#undef __glibcxx_double_tinyness_before
+
+ /// numeric_limits<long double> specialization.
+ template<>
+ struct numeric_limits<long double>
+ {
+ static const bool is_specialized = true;
+
+ static long double min() throw()
+ { return __LDBL_MIN__; }
+ static long double max() throw()
+ { return __LDBL_MAX__; }
+
+ static const int digits = __LDBL_MANT_DIG__;
+ static const int digits10 = __LDBL_DIG__;
+ static const bool is_signed = true;
+ static const bool is_integer = false;
+ static const bool is_exact = false;
+ static const int radix = __FLT_RADIX__;
+ static long double epsilon() throw()
+ { return __LDBL_EPSILON__; }
+ static long double round_error() throw()
+ { return 0.5L; }
+
+ static const int min_exponent = __LDBL_MIN_EXP__;
+ static const int min_exponent10 = __LDBL_MIN_10_EXP__;
+ static const int max_exponent = __LDBL_MAX_EXP__;
+ static const int max_exponent10 = __LDBL_MAX_10_EXP__;
+
+ static const bool has_infinity = __LDBL_HAS_INFINITY__;
+ static const bool has_quiet_NaN = __LDBL_HAS_QUIET_NAN__;
+ static const bool has_signaling_NaN = has_quiet_NaN;
+ static const float_denorm_style has_denorm
+ = bool(__LDBL_HAS_DENORM__) ? denorm_present : denorm_absent;
+ static const bool has_denorm_loss
+ = __glibcxx_long_double_has_denorm_loss;
+
+ static long double infinity() throw()
+ { return __builtin_huge_vall (); }
+ static long double quiet_NaN() throw()
+ { return __builtin_nanl (""); }
+ static long double signaling_NaN() throw()
+ { return __builtin_nansl (""); }
+ static long double denorm_min() throw()
+ { return __LDBL_DENORM_MIN__; }
+
+ static const bool is_iec559
+ = has_infinity && has_quiet_NaN && has_denorm == denorm_present;
+ static const bool is_bounded = true;
+ static const bool is_modulo = false;
+
+ static const bool traps = __glibcxx_long_double_traps;
+ static const bool tinyness_before = __glibcxx_long_double_tinyness_before;
+ static const float_round_style round_style = round_to_nearest;
+ };
+
+#undef __glibcxx_long_double_has_denorm_loss
+#undef __glibcxx_long_double_traps
+#undef __glibcxx_long_double_tinyness_before
+
+_GLIBCXX_END_NAMESPACE
+
+#undef __glibcxx_signed
+#undef __glibcxx_min
+#undef __glibcxx_max
+#undef __glibcxx_digits
+#undef __glibcxx_digits10
+
+#endif // _GLIBCXX_NUMERIC_LIMITS
diff --git a/i686-linux/include/c++/4.4.3/list b/i686-linux/include/c++/4.4.3/list
new file mode 100644
index 0000000..d199802
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/list
@@ -0,0 +1,74 @@
+// <list> -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file include/list
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_LIST
+#define _GLIBCXX_LIST 1
+
+#pragma GCC system_header
+
+#include <bits/stl_algobase.h>
+#include <bits/allocator.h>
+#include <bits/stl_list.h>
+
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <bits/list.tcc>
+#endif
+
+#ifdef _GLIBCXX_DEBUG
+# include <debug/list>
+#endif
+
+#endif /* _GLIBCXX_LIST */
+
diff --git a/i686-linux/include/c++/4.4.3/locale b/i686-linux/include/c++/4.4.3/locale
new file mode 100644
index 0000000..3504b77
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/locale
@@ -0,0 +1,45 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+// 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+//
+// ISO C++ 14882: 22.1 Locales
+//
+
+/** @file locale
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_LOCALE
+#define _GLIBCXX_LOCALE 1
+
+#pragma GCC system_header
+
+#include <bits/localefwd.h>
+#include <bits/locale_classes.h>
+#include <bits/locale_facets.h>
+#include <bits/locale_facets_nonio.h>
+
+#endif /* _GLIBCXX_LOCALE */
diff --git a/i686-linux/include/c++/4.4.3/map b/i686-linux/include/c++/4.4.3/map
new file mode 100644
index 0000000..159bfb3
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/map
@@ -0,0 +1,68 @@
+// <map> -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file include/map
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_MAP
+#define _GLIBCXX_MAP 1
+
+#pragma GCC system_header
+
+#include <bits/stl_tree.h>
+#include <bits/stl_map.h>
+#include <bits/stl_multimap.h>
+
+#ifdef _GLIBCXX_DEBUG
+# include <debug/map>
+#endif
+
+#endif /* _GLIBCXX_MAP */
diff --git a/i686-linux/include/c++/4.4.3/memory b/i686-linux/include/c++/4.4.3/memory
new file mode 100644
index 0000000..9defd48
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/memory
@@ -0,0 +1,100 @@
+// <memory> -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1997-1999
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ */
+
+/** @file include/memory
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_MEMORY
+#define _GLIBCXX_MEMORY 1
+
+#pragma GCC system_header
+
+#include <bits/stl_algobase.h>
+#include <bits/allocator.h>
+#include <bits/stl_construct.h>
+#include <bits/stl_uninitialized.h>
+#include <bits/stl_tempbuf.h>
+#include <bits/stl_raw_storage_iter.h>
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+# endif
+# include <exception> // std::exception
+# include <typeinfo> // std::type_info in get_deleter
+# include <iosfwd> // std::basic_ostream
+# include <ext/atomicity.h>
+# include <ext/concurrence.h>
+# include <bits/functexcept.h>
+# include <bits/stl_function.h> // std::less
+# include <bits/unique_ptr.h>
+# include <debug/debug.h>
+# include <type_traits>
+# include <functional>
+# if _GLIBCXX_DEPRECATED
+# include <backward/auto_ptr.h>
+# endif
+# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/boost_sp_counted_base.h>
+# include <bits/shared_ptr.h>
+# else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/boost_sp_counted_base.h>
+# include <bits/shared_ptr.h>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+# endif
+#else
+# include <backward/auto_ptr.h>
+#endif
+
+/**
+ * @defgroup memory Memory
+ * @ingroup utilities
+ *
+ * Components for memory allocation, deallocation, and management.
+ */
+
+#endif /* _GLIBCXX_MEMORY */
diff --git a/i686-linux/include/c++/4.4.3/mutex b/i686-linux/include/c++/4.4.3/mutex
new file mode 100644
index 0000000..62b314b
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/mutex
@@ -0,0 +1,774 @@
+// <mutex> -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file mutex
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_MUTEX
+#define _GLIBCXX_MUTEX 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#else
+
+#include <tuple>
+#include <cstddef>
+#include <chrono>
+#include <exception>
+#include <type_traits>
+#include <functional>
+#include <system_error>
+#include <bits/functexcept.h>
+#include <bits/gthr.h>
+#include <bits/move.h> // for std::swap
+
+#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
+
+namespace std
+{
+ /**
+ * @defgroup mutexes Mutexes
+ * @ingroup concurrency
+ *
+ * Classes for mutex support.
+ * @{
+ */
+
+ /// mutex
+ class mutex
+ {
+ typedef __gthread_mutex_t __native_type;
+ __native_type _M_mutex;
+
+ public:
+ typedef __native_type* native_handle_type;
+
+ mutex()
+ {
+ // XXX EAGAIN, ENOMEM, EPERM, EBUSY(may), EINVAL(may)
+#ifdef __GTHREAD_MUTEX_INIT
+ __native_type __tmp = __GTHREAD_MUTEX_INIT;
+ _M_mutex = __tmp;
+#else
+ __GTHREAD_MUTEX_INIT_FUNCTION(&_M_mutex);
+#endif
+ }
+
+ mutex(const mutex&) = delete;
+ mutex& operator=(const mutex&) = delete;
+
+ void
+ lock()
+ {
+ int __e = __gthread_mutex_lock(&_M_mutex);
+
+ // EINVAL, EAGAIN, EBUSY, EINVAL, EDEADLK(may)
+ if (__e)
+ __throw_system_error(__e);
+ }
+
+ bool
+ try_lock()
+ {
+ // XXX EINVAL, EAGAIN, EBUSY
+ return !__gthread_mutex_trylock(&_M_mutex);
+ }
+
+ void
+ unlock()
+ {
+ // XXX EINVAL, EAGAIN, EPERM
+ __gthread_mutex_unlock(&_M_mutex);
+ }
+
+ native_handle_type
+ native_handle()
+ { return &_M_mutex; }
+ };
+
+ /// recursive_mutex
+ class recursive_mutex
+ {
+ typedef __gthread_recursive_mutex_t __native_type;
+ __native_type _M_mutex;
+
+ public:
+ typedef __native_type* native_handle_type;
+
+ recursive_mutex()
+ {
+ // XXX EAGAIN, ENOMEM, EPERM, EBUSY(may), EINVAL(may)
+#ifdef __GTHREAD_RECURSIVE_MUTEX_INIT
+ __native_type __tmp = __GTHREAD_RECURSIVE_MUTEX_INIT;
+ _M_mutex = __tmp;
+#else
+ __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION(&_M_mutex);
+#endif
+ }
+
+ recursive_mutex(const recursive_mutex&) = delete;
+ recursive_mutex& operator=(const recursive_mutex&) = delete;
+
+ void
+ lock()
+ {
+ int __e = __gthread_recursive_mutex_lock(&_M_mutex);
+
+ // EINVAL, EAGAIN, EBUSY, EINVAL, EDEADLK(may)
+ if (__e)
+ __throw_system_error(__e);
+ }
+
+ bool
+ try_lock()
+ {
+ // XXX EINVAL, EAGAIN, EBUSY
+ return !__gthread_recursive_mutex_trylock(&_M_mutex);
+ }
+
+ void
+ unlock()
+ {
+ // XXX EINVAL, EAGAIN, EBUSY
+ __gthread_recursive_mutex_unlock(&_M_mutex);
+ }
+
+ native_handle_type
+ native_handle()
+ { return &_M_mutex; }
+ };
+
+ /// timed_mutex
+ class timed_mutex
+ {
+ typedef __gthread_mutex_t __native_type;
+
+#ifdef _GLIBCXX_USE_CLOCK_MONOTONIC
+ typedef chrono::monotonic_clock __clock_t;
+#else
+ typedef chrono::high_resolution_clock __clock_t;
+#endif
+
+ __native_type _M_mutex;
+
+ public:
+ typedef __native_type* native_handle_type;
+
+ timed_mutex()
+ {
+#ifdef __GTHREAD_MUTEX_INIT
+ __native_type __tmp = __GTHREAD_MUTEX_INIT;
+ _M_mutex = __tmp;
+#else
+ __GTHREAD_MUTEX_INIT_FUNCTION(&_M_mutex);
+#endif
+ }
+
+ timed_mutex(const timed_mutex&) = delete;
+ timed_mutex& operator=(const timed_mutex&) = delete;
+
+ void
+ lock()
+ {
+ int __e = __gthread_mutex_lock(&_M_mutex);
+
+ // EINVAL, EAGAIN, EBUSY, EINVAL, EDEADLK(may)
+ if (__e)
+ __throw_system_error(__e);
+ }
+
+ bool
+ try_lock()
+ {
+ // XXX EINVAL, EAGAIN, EBUSY
+ return !__gthread_mutex_trylock(&_M_mutex);
+ }
+
+ template <class _Rep, class _Period>
+ bool
+ try_lock_for(const chrono::duration<_Rep, _Period>& __rtime)
+ { return __try_lock_for_impl(__rtime); }
+
+ template <class _Clock, class _Duration>
+ bool
+ try_lock_until(const chrono::time_point<_Clock, _Duration>& __atime)
+ {
+ chrono::time_point<_Clock, chrono::seconds> __s =
+ chrono::time_point_cast<chrono::seconds>(__atime);
+
+ chrono::nanoseconds __ns =
+ chrono::duration_cast<chrono::nanoseconds>(__atime - __s);
+
+ __gthread_time_t __ts = {
+ static_cast<std::time_t>(__s.time_since_epoch().count()),
+ static_cast<long>(__ns.count())
+ };
+
+ return !__gthread_mutex_timedlock(&_M_mutex, &__ts);
+ }
+
+ void
+ unlock()
+ {
+ // XXX EINVAL, EAGAIN, EBUSY
+ __gthread_mutex_unlock(&_M_mutex);
+ }
+
+ native_handle_type
+ native_handle()
+ { return &_M_mutex; }
+
+ private:
+ template<typename _Rep, typename _Period>
+ typename enable_if<
+ ratio_less_equal<__clock_t::period, _Period>::value, bool>::type
+ __try_lock_for_impl(const chrono::duration<_Rep, _Period>& __rtime)
+ {
+ __clock_t::time_point __atime = __clock_t::now()
+ + chrono::duration_cast<__clock_t::duration>(__rtime);
+
+ return try_lock_until(__atime);
+ }
+
+ template <typename _Rep, typename _Period>
+ typename enable_if<
+ !ratio_less_equal<__clock_t::period, _Period>::value, bool>::type
+ __try_lock_for_impl(const chrono::duration<_Rep, _Period>& __rtime)
+ {
+ __clock_t::time_point __atime = __clock_t::now()
+ + ++chrono::duration_cast<__clock_t::duration>(__rtime);
+
+ return try_lock_until(__atime);
+ }
+ };
+
+ /// recursive_timed_mutex
+ class recursive_timed_mutex
+ {
+ typedef __gthread_recursive_mutex_t __native_type;
+
+#ifdef _GLIBCXX_USE_CLOCK_MONOTONIC
+ typedef chrono::monotonic_clock __clock_t;
+#else
+ typedef chrono::high_resolution_clock __clock_t;
+#endif
+
+ __native_type _M_mutex;
+
+ public:
+ typedef __native_type* native_handle_type;
+
+ recursive_timed_mutex()
+ {
+ // XXX EAGAIN, ENOMEM, EPERM, EBUSY(may), EINVAL(may)
+#ifdef __GTHREAD_RECURSIVE_MUTEX_INIT
+ __native_type __tmp = __GTHREAD_RECURSIVE_MUTEX_INIT;
+ _M_mutex = __tmp;
+#else
+ __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION(&_M_mutex);
+#endif
+ }
+
+ recursive_timed_mutex(const recursive_timed_mutex&) = delete;
+ recursive_timed_mutex& operator=(const recursive_timed_mutex&) = delete;
+
+ void
+ lock()
+ {
+ int __e = __gthread_recursive_mutex_lock(&_M_mutex);
+
+ // EINVAL, EAGAIN, EBUSY, EINVAL, EDEADLK(may)
+ if (__e)
+ __throw_system_error(__e);
+ }
+
+ bool
+ try_lock()
+ {
+ // XXX EINVAL, EAGAIN, EBUSY
+ return !__gthread_recursive_mutex_trylock(&_M_mutex);
+ }
+
+ template <class _Rep, class _Period>
+ bool
+ try_lock_for(const chrono::duration<_Rep, _Period>& __rtime)
+ { return __try_lock_for_impl(__rtime); }
+
+ template <class _Clock, class _Duration>
+ bool
+ try_lock_until(const chrono::time_point<_Clock, _Duration>& __atime)
+ {
+ chrono::time_point<_Clock, chrono::seconds> __s =
+ chrono::time_point_cast<chrono::seconds>(__atime);
+
+ chrono::nanoseconds __ns =
+ chrono::duration_cast<chrono::nanoseconds>(__atime - __s);
+
+ __gthread_time_t __ts = {
+ static_cast<std::time_t>(__s.time_since_epoch().count()),
+ static_cast<long>(__ns.count())
+ };
+
+ return !__gthread_recursive_mutex_timedlock(&_M_mutex, &__ts);
+ }
+
+ void
+ unlock()
+ {
+ // XXX EINVAL, EAGAIN, EBUSY
+ __gthread_recursive_mutex_unlock(&_M_mutex);
+ }
+
+ native_handle_type
+ native_handle()
+ { return &_M_mutex; }
+
+ private:
+ template<typename _Rep, typename _Period>
+ typename enable_if<
+ ratio_less_equal<__clock_t::period, _Period>::value, bool>::type
+ __try_lock_for_impl(const chrono::duration<_Rep, _Period>& __rtime)
+ {
+ __clock_t::time_point __atime = __clock_t::now()
+ + chrono::duration_cast<__clock_t::duration>(__rtime);
+
+ return try_lock_until(__atime);
+ }
+
+ template <typename _Rep, typename _Period>
+ typename enable_if<
+ !ratio_less_equal<__clock_t::period, _Period>::value, bool>::type
+ __try_lock_for_impl(const chrono::duration<_Rep, _Period>& __rtime)
+ {
+ __clock_t::time_point __atime = __clock_t::now()
+ + ++chrono::duration_cast<__clock_t::duration>(__rtime);
+
+ return try_lock_until(__atime);
+ }
+ };
+
+ /// Do not acquire ownership of the mutex.
+ struct defer_lock_t { };
+
+ /// Try to acquire ownership of the mutex without blocking.
+ struct try_to_lock_t { };
+
+ /// Assume the calling thread has already obtained mutex ownership
+ /// and manage it.
+ struct adopt_lock_t { };
+
+ extern const defer_lock_t defer_lock;
+ extern const try_to_lock_t try_to_lock;
+ extern const adopt_lock_t adopt_lock;
+
+ /**
+ * @brief Thrown to indicate errors with lock operations.
+ *
+ * @ingroup exceptions
+ */
+ class lock_error : public exception
+ {
+ public:
+ virtual const char*
+ what() const throw();
+ };
+
+ /// @brief Scoped lock idiom.
+ // Acquire the mutex here with a constructor call, then release with
+ // the destructor call in accordance with RAII style.
+ template<typename _Mutex>
+ class lock_guard
+ {
+ public:
+ typedef _Mutex mutex_type;
+
+ explicit lock_guard(mutex_type& __m) : _M_device(__m)
+ { _M_device.lock(); }
+
+ lock_guard(mutex_type& __m, adopt_lock_t __a) : _M_device(__m)
+ { _M_device.lock(); }
+
+ ~lock_guard()
+ { _M_device.unlock(); }
+
+ lock_guard(const lock_guard&) = delete;
+ lock_guard& operator=(const lock_guard&) = delete;
+
+ private:
+ mutex_type& _M_device;
+ };
+
+ /// unique_lock
+ template<typename _Mutex>
+ class unique_lock
+ {
+ public:
+ typedef _Mutex mutex_type;
+
+ unique_lock()
+ : _M_device(0), _M_owns(false)
+ { }
+
+ explicit unique_lock(mutex_type& __m)
+ : _M_device(&__m), _M_owns(false)
+ {
+ lock();
+ _M_owns = true;
+ }
+
+ unique_lock(mutex_type& __m, defer_lock_t)
+ : _M_device(&__m), _M_owns(false)
+ { }
+
+ unique_lock(mutex_type& __m, try_to_lock_t)
+ : _M_device(&__m), _M_owns(_M_device->try_lock())
+ { }
+
+ unique_lock(mutex_type& __m, adopt_lock_t)
+ : _M_device(&__m), _M_owns(true)
+ {
+ // XXX calling thread owns mutex
+ }
+
+ template<typename _Clock, typename _Duration>
+ unique_lock(mutex_type& __m,
+ const chrono::time_point<_Clock, _Duration>& __atime)
+ : _M_device(&__m), _M_owns(_M_device->try_lock_until(__atime))
+ { }
+
+ template<typename _Rep, typename _Period>
+ unique_lock(mutex_type& __m,
+ const chrono::duration<_Rep, _Period>& __rtime)
+ : _M_device(&__m), _M_owns(_M_device->try_lock_for(__rtime))
+ { }
+
+ ~unique_lock()
+ {
+ if (_M_owns)
+ unlock();
+ }
+
+ unique_lock(const unique_lock&) = delete;
+ unique_lock& operator=(const unique_lock&) = delete;
+
+ unique_lock(unique_lock&& __u)
+ : _M_device(__u._M_device), _M_owns(__u._M_owns)
+ {
+ __u._M_device = 0;
+ __u._M_owns = false;
+ }
+
+ unique_lock& operator=(unique_lock&& __u)
+ {
+ if(_M_owns)
+ unlock();
+
+ unique_lock(std::move(__u)).swap(*this);
+
+ __u._M_device = 0;
+ __u._M_owns = false;
+
+ return *this;
+ }
+
+ void
+ lock()
+ {
+ if (!_M_device)
+ __throw_system_error(int(errc::operation_not_permitted));
+ else if (_M_owns)
+ __throw_system_error(int(errc::resource_deadlock_would_occur));
+ else
+ {
+ _M_device->lock();
+ _M_owns = true;
+ }
+ }
+
+ bool
+ try_lock()
+ {
+ if (!_M_device)
+ __throw_system_error(int(errc::operation_not_permitted));
+ else if (_M_owns)
+ __throw_system_error(int(errc::resource_deadlock_would_occur));
+ else
+ {
+ _M_owns = _M_device->try_lock();
+ return _M_owns;
+ }
+ }
+
+ template<typename _Clock, typename _Duration>
+ bool
+ try_lock_until(const chrono::time_point<_Clock, _Duration>& __atime)
+ {
+ if (!_M_device)
+ __throw_system_error(int(errc::operation_not_permitted));
+ else if (_M_owns)
+ __throw_system_error(int(errc::resource_deadlock_would_occur));
+ else
+ {
+ _M_owns = _M_device->try_lock_until(__atime);
+ return _M_owns;
+ }
+ }
+
+ template<typename _Rep, typename _Period>
+ bool
+ try_lock_for(const chrono::duration<_Rep, _Period>& __rtime)
+ {
+ if (!_M_device)
+ __throw_system_error(int(errc::operation_not_permitted));
+ else if (_M_owns)
+ __throw_system_error(int(errc::resource_deadlock_would_occur));
+ else
+ {
+ _M_owns = _M_device->try_lock_for(__rtime);
+ return _M_owns;
+ }
+ }
+
+ void
+ unlock()
+ {
+ if (!_M_owns)
+ __throw_system_error(int(errc::operation_not_permitted));
+ else if (_M_device)
+ {
+ _M_device->unlock();
+ _M_owns = false;
+ }
+ }
+
+ void
+ swap(unique_lock&& __u)
+ {
+ std::swap(_M_device, __u._M_device);
+ std::swap(_M_owns, __u._M_owns);
+ }
+
+ mutex_type*
+ release()
+ {
+ mutex_type* __ret = _M_device;
+ _M_device = 0;
+ _M_owns = false;
+ return __ret;
+ }
+
+ bool
+ owns_lock() const
+ { return _M_owns; }
+
+ /* explicit */ operator bool () const
+ { return owns_lock(); }
+
+ mutex_type*
+ mutex() const
+ { return _M_device; }
+
+ private:
+ mutex_type* _M_device;
+ bool _M_owns; // XXX use atomic_bool
+ };
+
+ template<typename _Mutex>
+ inline void
+ swap(unique_lock<_Mutex>& __x, unique_lock<_Mutex>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Mutex>
+ inline void
+ swap(unique_lock<_Mutex>&& __x, unique_lock<_Mutex>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Mutex>
+ inline void
+ swap(unique_lock<_Mutex>& __x, unique_lock<_Mutex>&& __y)
+ { __x.swap(__y); }
+
+ template<int _Idx>
+ struct __unlock_impl
+ {
+ template<typename... _Lock>
+ static void
+ __do_unlock(tuple<_Lock&...>& __locks)
+ {
+ std::get<_Idx>(__locks).unlock();
+ __unlock_impl<_Idx - 1>::__do_unlock(__locks);
+ }
+ };
+
+ template<>
+ struct __unlock_impl<-1>
+ {
+ template<typename... _Lock>
+ static void
+ __do_unlock(tuple<_Lock&...>&)
+ { }
+ };
+
+ template<int _Idx, bool _Continue = true>
+ struct __try_lock_impl
+ {
+ template<typename... _Lock>
+ static int
+ __do_try_lock(tuple<_Lock&...>& __locks)
+ {
+ if(std::get<_Idx>(__locks).try_lock())
+ {
+ return __try_lock_impl<_Idx + 1,
+ _Idx + 2 < sizeof...(_Lock)>::__do_try_lock(__locks);
+ }
+ else
+ {
+ __unlock_impl<_Idx>::__do_unlock(__locks);
+ return _Idx;
+ }
+ }
+ };
+
+ template<int _Idx>
+ struct __try_lock_impl<_Idx, false>
+ {
+ template<typename... _Lock>
+ static int
+ __do_try_lock(tuple<_Lock&...>& __locks)
+ {
+ if(std::get<_Idx>(__locks).try_lock())
+ return -1;
+ else
+ {
+ __unlock_impl<_Idx>::__do_unlock(__locks);
+ return _Idx;
+ }
+ }
+ };
+
+ /** @brief Generic try_lock.
+ * @param __l1 Meets Mutex requirements (try_lock() may throw).
+ * @param __l2 Meets Mutex requirements (try_lock() may throw).
+ * @param __l3 Meets Mutex requirements (try_lock() may throw).
+ * @return Returns -1 if all try_lock() calls return true. Otherwise returns
+ * a 0-based index corresponding to the argument that returned false.
+ * @post Either all arguments are locked, or none will be.
+ *
+ * Sequentially calls try_lock() on each argument.
+ */
+ template<typename _Lock1, typename _Lock2, typename... _Lock3>
+ int
+ try_lock(_Lock1& __l1, _Lock2& __l2, _Lock3&... __l3)
+ {
+ tuple<_Lock1&, _Lock2&, _Lock3&...> __locks(__l1, __l2, __l3...);
+ return __try_lock_impl<0>::__do_try_lock(__locks);
+ }
+
+ /// lock
+ template<typename _L1, typename _L2, typename ..._L3>
+ void
+ lock(_L1&, _L2&, _L3&...);
+
+ /// once_flag
+ struct once_flag
+ {
+ private:
+ typedef __gthread_once_t __native_type;
+ __native_type _M_once;
+
+ public:
+ once_flag()
+ {
+ __native_type __tmp = __GTHREAD_ONCE_INIT;
+ _M_once = __tmp;
+ }
+
+ once_flag(const once_flag&) = delete;
+ once_flag& operator=(const once_flag&) = delete;
+
+ template<typename _Callable, typename... _Args>
+ friend void
+ call_once(once_flag& __once, _Callable __f, _Args&&... __args);
+ };
+
+#ifdef _GLIBCXX_HAVE_TLS
+ extern __thread void* __once_callable;
+ extern __thread void (*__once_call)();
+
+ template<typename _Callable>
+ inline void
+ __once_call_impl()
+ {
+ (*(_Callable*)__once_callable)();
+ }
+#else
+ extern function<void()> __once_functor;
+
+ extern void
+ __set_once_functor_lock_ptr(unique_lock<mutex>*);
+
+ extern mutex&
+ __get_once_mutex();
+#endif
+
+ extern "C" void __once_proxy();
+
+ /// call_once
+ template<typename _Callable, typename... _Args>
+ void
+ call_once(once_flag& __once, _Callable __f, _Args&&... __args)
+ {
+#ifdef _GLIBCXX_HAVE_TLS
+ auto __bound_functor = bind(__f, __args...);
+ __once_callable = &__bound_functor;
+ __once_call = &__once_call_impl<decltype(__bound_functor)>;
+#else
+ unique_lock<mutex> __functor_lock(__get_once_mutex());
+ __once_functor = bind(__f, __args...);
+ __set_once_functor_lock_ptr(&__functor_lock);
+#endif
+
+ int __e = __gthread_once(&(__once._M_once), &__once_proxy);
+
+#ifndef _GLIBCXX_HAVE_TLS
+ if (__functor_lock)
+ __set_once_functor_lock_ptr(0);
+#endif
+
+ if (__e)
+ __throw_system_error(__e);
+ }
+
+ // @} group mutexes
+}
+
+#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1
+
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+#endif // _GLIBCXX_MUTEX
diff --git a/i686-linux/include/c++/4.4.3/new b/i686-linux/include/c++/4.4.3/new
new file mode 100644
index 0000000..d411502
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/new
@@ -0,0 +1,112 @@
+// The -*- C++ -*- dynamic memory management header.
+
+// Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+// 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation
+
+// This file is part of GCC.
+//
+// GCC is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// GCC is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file new
+ * This is a Standard C++ Library header.
+ *
+ * The header @c new defines several functions to manage dynamic memory and
+ * handling memory allocation errors; see
+ * http://gcc.gnu.org/onlinedocs/libstdc++/18_support/howto.html#4 for more.
+ */
+
+#ifndef _NEW
+#define _NEW
+
+#include <cstddef>
+#include <exception>
+
+#pragma GCC visibility push(default)
+
+extern "C++" {
+
+namespace std
+{
+ /**
+ * @brief Exception possibly thrown by @c new.
+ * @ingroup exceptions
+ *
+ * @c bad_alloc (or classes derived from it) is used to report allocation
+ * errors from the throwing forms of @c new. */
+ class bad_alloc : public exception
+ {
+ public:
+ bad_alloc() throw() { }
+
+ // This declaration is not useless:
+ // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118
+ virtual ~bad_alloc() throw();
+
+ // See comment in eh_exception.cc.
+ virtual const char* what() const throw();
+ };
+
+ struct nothrow_t { };
+
+ extern const nothrow_t nothrow;
+
+ /** If you write your own error handler to be called by @c new, it must
+ * be of this type. */
+ typedef void (*new_handler)();
+
+ /// Takes a replacement handler as the argument, returns the
+ /// previous handler.
+ new_handler set_new_handler(new_handler) throw();
+} // namespace std
+
+//@{
+/** These are replaceable signatures:
+ * - normal single new and delete (no arguments, throw @c bad_alloc on error)
+ * - normal array new and delete (same)
+ * - @c nothrow single new and delete (take a @c nothrow argument, return
+ * @c NULL on error)
+ * - @c nothrow array new and delete (same)
+ *
+ * Placement new and delete signatures (take a memory address argument,
+ * does nothing) may not be replaced by a user's program.
+*/
+void* operator new(std::size_t) throw (std::bad_alloc);
+void* operator new[](std::size_t) throw (std::bad_alloc);
+void operator delete(void*) throw();
+void operator delete[](void*) throw();
+void* operator new(std::size_t, const std::nothrow_t&) throw();
+void* operator new[](std::size_t, const std::nothrow_t&) throw();
+void operator delete(void*, const std::nothrow_t&) throw();
+void operator delete[](void*, const std::nothrow_t&) throw();
+
+// Default placement versions of operator new.
+inline void* operator new(std::size_t, void* __p) throw() { return __p; }
+inline void* operator new[](std::size_t, void* __p) throw() { return __p; }
+
+// Default placement versions of operator delete.
+inline void operator delete (void*, void*) throw() { }
+inline void operator delete[](void*, void*) throw() { }
+//@}
+} // extern "C++"
+
+#pragma GCC visibility pop
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/numeric b/i686-linux/include/c++/4.4.3/numeric
new file mode 100644
index 0000000..43d76d9
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/numeric
@@ -0,0 +1,78 @@
+// <numeric> -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file include/numeric
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_NUMERIC
+#define _GLIBCXX_NUMERIC 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <cstddef>
+#include <bits/stl_iterator_base_types.h>
+#include <bits/stl_numeric.h>
+
+#ifdef _GLIBCXX_PARALLEL
+# include <parallel/numeric>
+#endif
+
+/**
+ * @defgroup numerics Numerics
+ *
+ * Components for performing numeric operations. Includes support for
+ * for complex number types, random number generation, numeric
+ * (n-at-a-time) arrays, generalized numeric algorithms, and special
+ * math functions.
+ */
+
+#endif /* _GLIBCXX_NUMERIC */
diff --git a/i686-linux/include/c++/4.4.3/ostream b/i686-linux/include/c++/4.4.3/ostream
new file mode 100644
index 0000000..c49b36f
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ostream
@@ -0,0 +1,568 @@
+// Output streams -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ostream
+ * This is a Standard C++ Library header.
+ */
+
+//
+// ISO C++ 14882: 27.6.2 Output streams
+//
+
+#ifndef _GLIBCXX_OSTREAM
+#define _GLIBCXX_OSTREAM 1
+
+#pragma GCC system_header
+
+#include <ios>
+#include <bits/ostream_insert.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // [27.6.2.1] Template class basic_ostream
+ /**
+ * @brief Controlling output.
+ * @ingroup io
+ *
+ * This is the base class for all output streams. It provides text
+ * formatting of all builtin types, and communicates with any class
+ * derived from basic_streambuf to do the actual output.
+ */
+ template<typename _CharT, typename _Traits>
+ class basic_ostream : virtual public basic_ios<_CharT, _Traits>
+ {
+ public:
+ // Types (inherited from basic_ios (27.4.4)):
+ typedef _CharT char_type;
+ typedef typename _Traits::int_type int_type;
+ typedef typename _Traits::pos_type pos_type;
+ typedef typename _Traits::off_type off_type;
+ typedef _Traits traits_type;
+
+ // Non-standard Types:
+ typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
+ typedef basic_ios<_CharT, _Traits> __ios_type;
+ typedef basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> >
+ __num_put_type;
+ typedef ctype<_CharT> __ctype_type;
+
+ // [27.6.2.2] constructor/destructor
+ /**
+ * @brief Base constructor.
+ *
+ * This ctor is almost never called by the user directly, rather from
+ * derived classes' initialization lists, which pass a pointer to
+ * their own stream buffer.
+ */
+ explicit
+ basic_ostream(__streambuf_type* __sb)
+ { this->init(__sb); }
+
+ /**
+ * @brief Base destructor.
+ *
+ * This does very little apart from providing a virtual base dtor.
+ */
+ virtual
+ ~basic_ostream() { }
+
+ // [27.6.2.3] prefix/suffix
+ class sentry;
+ friend class sentry;
+
+ // [27.6.2.5] formatted output
+ // [27.6.2.5.3] basic_ostream::operator<<
+ //@{
+ /**
+ * @brief Interface for manipulators.
+ *
+ * Manipulators such as @c std::endl and @c std::hex use these
+ * functions in constructs like "std::cout << std::endl". For more
+ * information, see the iomanip header.
+ */
+ __ostream_type&
+ operator<<(__ostream_type& (*__pf)(__ostream_type&))
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 60. What is a formatted input function?
+ // The inserters for manipulators are *not* formatted output functions.
+ return __pf(*this);
+ }
+
+ __ostream_type&
+ operator<<(__ios_type& (*__pf)(__ios_type&))
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 60. What is a formatted input function?
+ // The inserters for manipulators are *not* formatted output functions.
+ __pf(*this);
+ return *this;
+ }
+
+ __ostream_type&
+ operator<<(ios_base& (*__pf) (ios_base&))
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 60. What is a formatted input function?
+ // The inserters for manipulators are *not* formatted output functions.
+ __pf(*this);
+ return *this;
+ }
+ //@}
+
+ // [27.6.2.5.2] arithmetic inserters
+ /**
+ * @name Arithmetic Inserters
+ *
+ * All the @c operator<< functions (aka <em>formatted output
+ * functions</em>) have some common behavior. Each starts by
+ * constructing a temporary object of type std::basic_ostream::sentry.
+ * This can have several effects, concluding with the setting of a
+ * status flag; see the sentry documentation for more.
+ *
+ * If the sentry status is good, the function tries to generate
+ * whatever data is appropriate for the type of the argument.
+ *
+ * If an exception is thrown during insertion, ios_base::badbit
+ * will be turned on in the stream's error state without causing an
+ * ios_base::failure to be thrown. The original exception will then
+ * be rethrown.
+ */
+ //@{
+ /**
+ * @brief Basic arithmetic inserters
+ * @param A variable of builtin type.
+ * @return @c *this if successful
+ *
+ * These functions use the stream's current locale (specifically, the
+ * @c num_get facet) to perform numeric formatting.
+ */
+ __ostream_type&
+ operator<<(long __n)
+ { return _M_insert(__n); }
+
+ __ostream_type&
+ operator<<(unsigned long __n)
+ { return _M_insert(__n); }
+
+ __ostream_type&
+ operator<<(bool __n)
+ { return _M_insert(__n); }
+
+ __ostream_type&
+ operator<<(short __n);
+
+ __ostream_type&
+ operator<<(unsigned short __n)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 117. basic_ostream uses nonexistent num_put member functions.
+ return _M_insert(static_cast<unsigned long>(__n));
+ }
+
+ __ostream_type&
+ operator<<(int __n);
+
+ __ostream_type&
+ operator<<(unsigned int __n)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 117. basic_ostream uses nonexistent num_put member functions.
+ return _M_insert(static_cast<unsigned long>(__n));
+ }
+
+#ifdef _GLIBCXX_USE_LONG_LONG
+ __ostream_type&
+ operator<<(long long __n)
+ { return _M_insert(__n); }
+
+ __ostream_type&
+ operator<<(unsigned long long __n)
+ { return _M_insert(__n); }
+#endif
+
+ __ostream_type&
+ operator<<(double __f)
+ { return _M_insert(__f); }
+
+ __ostream_type&
+ operator<<(float __f)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 117. basic_ostream uses nonexistent num_put member functions.
+ return _M_insert(static_cast<double>(__f));
+ }
+
+ __ostream_type&
+ operator<<(long double __f)
+ { return _M_insert(__f); }
+
+ __ostream_type&
+ operator<<(const void* __p)
+ { return _M_insert(__p); }
+
+ /**
+ * @brief Extracting from another streambuf.
+ * @param sb A pointer to a streambuf
+ *
+ * This function behaves like one of the basic arithmetic extractors,
+ * in that it also constructs a sentry object and has the same error
+ * handling behavior.
+ *
+ * If @a sb is NULL, the stream will set failbit in its error state.
+ *
+ * Characters are extracted from @a sb and inserted into @c *this
+ * until one of the following occurs:
+ *
+ * - the input stream reaches end-of-file,
+ * - insertion into the output sequence fails (in this case, the
+ * character that would have been inserted is not extracted), or
+ * - an exception occurs while getting a character from @a sb, which
+ * sets failbit in the error state
+ *
+ * If the function inserts no characters, failbit is set.
+ */
+ __ostream_type&
+ operator<<(__streambuf_type* __sb);
+ //@}
+
+ // [27.6.2.6] unformatted output functions
+ /**
+ * @name Unformatted Output Functions
+ *
+ * All the unformatted output functions have some common behavior.
+ * Each starts by constructing a temporary object of type
+ * std::basic_ostream::sentry. This has several effects, concluding
+ * with the setting of a status flag; see the sentry documentation
+ * for more.
+ *
+ * If the sentry status is good, the function tries to generate
+ * whatever data is appropriate for the type of the argument.
+ *
+ * If an exception is thrown during insertion, ios_base::badbit
+ * will be turned on in the stream's error state. If badbit is on in
+ * the stream's exceptions mask, the exception will be rethrown
+ * without completing its actions.
+ */
+ //@{
+ /**
+ * @brief Simple insertion.
+ * @param c The character to insert.
+ * @return *this
+ *
+ * Tries to insert @a c.
+ *
+ * @note This function is not overloaded on signed char and
+ * unsigned char.
+ */
+ __ostream_type&
+ put(char_type __c);
+
+ // Core write functionality, without sentry.
+ void
+ _M_write(const char_type* __s, streamsize __n)
+ {
+ const streamsize __put = this->rdbuf()->sputn(__s, __n);
+ if (__put != __n)
+ this->setstate(ios_base::badbit);
+ }
+
+ /**
+ * @brief Character string insertion.
+ * @param s The array to insert.
+ * @param n Maximum number of characters to insert.
+ * @return *this
+ *
+ * Characters are copied from @a s and inserted into the stream until
+ * one of the following happens:
+ *
+ * - @a n characters are inserted
+ * - inserting into the output sequence fails (in this case, badbit
+ * will be set in the stream's error state)
+ *
+ * @note This function is not overloaded on signed char and
+ * unsigned char.
+ */
+ __ostream_type&
+ write(const char_type* __s, streamsize __n);
+ //@}
+
+ /**
+ * @brief Synchronizing the stream buffer.
+ * @return *this
+ *
+ * If @c rdbuf() is a null pointer, changes nothing.
+ *
+ * Otherwise, calls @c rdbuf()->pubsync(), and if that returns -1,
+ * sets badbit.
+ */
+ __ostream_type&
+ flush();
+
+ // [27.6.2.4] seek members
+ /**
+ * @brief Getting the current write position.
+ * @return A file position object.
+ *
+ * If @c fail() is not false, returns @c pos_type(-1) to indicate
+ * failure. Otherwise returns @c rdbuf()->pubseekoff(0,cur,out).
+ */
+ pos_type
+ tellp();
+
+ /**
+ * @brief Changing the current write position.
+ * @param pos A file position object.
+ * @return *this
+ *
+ * If @c fail() is not true, calls @c rdbuf()->pubseekpos(pos). If
+ * that function fails, sets failbit.
+ */
+ __ostream_type&
+ seekp(pos_type);
+
+ /**
+ * @brief Changing the current write position.
+ * @param off A file offset object.
+ * @param dir The direction in which to seek.
+ * @return *this
+ *
+ * If @c fail() is not true, calls @c rdbuf()->pubseekoff(off,dir).
+ * If that function fails, sets failbit.
+ */
+ __ostream_type&
+ seekp(off_type, ios_base::seekdir);
+
+ protected:
+ basic_ostream()
+ { this->init(0); }
+
+ template<typename _ValueT>
+ __ostream_type&
+ _M_insert(_ValueT __v);
+ };
+
+ /**
+ * @brief Performs setup work for output streams.
+ *
+ * Objects of this class are created before all of the standard
+ * inserters are run. It is responsible for "exception-safe prefix and
+ * suffix operations."
+ */
+ template <typename _CharT, typename _Traits>
+ class basic_ostream<_CharT, _Traits>::sentry
+ {
+ // Data Members:
+ bool _M_ok;
+ basic_ostream<_CharT, _Traits>& _M_os;
+
+ public:
+ /**
+ * @brief The constructor performs preparatory work.
+ * @param os The output stream to guard.
+ *
+ * If the stream state is good (@a os.good() is true), then if the
+ * stream is tied to another output stream, @c is.tie()->flush()
+ * is called to synchronize the output sequences.
+ *
+ * If the stream state is still good, then the sentry state becomes
+ * true ("okay").
+ */
+ explicit
+ sentry(basic_ostream<_CharT, _Traits>& __os);
+
+ /**
+ * @brief Possibly flushes the stream.
+ *
+ * If @c ios_base::unitbuf is set in @c os.flags(), and
+ * @c std::uncaught_exception() is true, the sentry destructor calls
+ * @c flush() on the output stream.
+ */
+ ~sentry()
+ {
+ // XXX MT
+ if (bool(_M_os.flags() & ios_base::unitbuf) && !uncaught_exception())
+ {
+ // Can't call flush directly or else will get into recursive lock.
+ if (_M_os.rdbuf() && _M_os.rdbuf()->pubsync() == -1)
+ _M_os.setstate(ios_base::badbit);
+ }
+ }
+
+ /**
+ * @brief Quick status checking.
+ * @return The sentry state.
+ *
+ * For ease of use, sentries may be converted to booleans. The
+ * return value is that of the sentry state (true == okay).
+ */
+ operator bool() const
+ { return _M_ok; }
+ };
+
+ // [27.6.2.5.4] character insertion templates
+ //@{
+ /**
+ * @brief Character inserters
+ * @param out An output stream.
+ * @param c A character.
+ * @return out
+ *
+ * Behaves like one of the formatted arithmetic inserters described in
+ * std::basic_ostream. After constructing a sentry object with good
+ * status, this function inserts a single character and any required
+ * padding (as determined by [22.2.2.2.2]). @c out.width(0) is then
+ * called.
+ *
+ * If @a c is of type @c char and the character type of the stream is not
+ * @c char, the character is widened before insertion.
+ */
+ template<typename _CharT, typename _Traits>
+ inline basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
+ { return __ostream_insert(__out, &__c, 1); }
+
+ template<typename _CharT, typename _Traits>
+ inline basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
+ { return (__out << __out.widen(__c)); }
+
+ // Specialization
+ template <class _Traits>
+ inline basic_ostream<char, _Traits>&
+ operator<<(basic_ostream<char, _Traits>& __out, char __c)
+ { return __ostream_insert(__out, &__c, 1); }
+
+ // Signed and unsigned
+ template<class _Traits>
+ inline basic_ostream<char, _Traits>&
+ operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
+ { return (__out << static_cast<char>(__c)); }
+
+ template<class _Traits>
+ inline basic_ostream<char, _Traits>&
+ operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
+ { return (__out << static_cast<char>(__c)); }
+ //@}
+
+ //@{
+ /**
+ * @brief String inserters
+ * @param out An output stream.
+ * @param s A character string.
+ * @return out
+ * @pre @a s must be a non-NULL pointer
+ *
+ * Behaves like one of the formatted arithmetic inserters described in
+ * std::basic_ostream. After constructing a sentry object with good
+ * status, this function inserts @c traits::length(s) characters starting
+ * at @a s, widened if necessary, followed by any required padding (as
+ * determined by [22.2.2.2.2]). @c out.width(0) is then called.
+ */
+ template<typename _CharT, typename _Traits>
+ inline basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
+ {
+ if (!__s)
+ __out.setstate(ios_base::badbit);
+ else
+ __ostream_insert(__out, __s,
+ static_cast<streamsize>(_Traits::length(__s)));
+ return __out;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits> &
+ operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s);
+
+ // Partial specializations
+ template<class _Traits>
+ inline basic_ostream<char, _Traits>&
+ operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
+ {
+ if (!__s)
+ __out.setstate(ios_base::badbit);
+ else
+ __ostream_insert(__out, __s,
+ static_cast<streamsize>(_Traits::length(__s)));
+ return __out;
+ }
+
+ // Signed and unsigned
+ template<class _Traits>
+ inline basic_ostream<char, _Traits>&
+ operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
+ { return (__out << reinterpret_cast<const char*>(__s)); }
+
+ template<class _Traits>
+ inline basic_ostream<char, _Traits> &
+ operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
+ { return (__out << reinterpret_cast<const char*>(__s)); }
+ //@}
+
+ // [27.6.2.7] standard basic_ostream manipulators
+ /**
+ * @brief Write a newline and flush the stream.
+ *
+ * This manipulator is often mistakenly used when a simple newline is
+ * desired, leading to poor buffering performance. See
+ * http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#2 for more
+ * on this subject.
+ */
+ template<typename _CharT, typename _Traits>
+ inline basic_ostream<_CharT, _Traits>&
+ endl(basic_ostream<_CharT, _Traits>& __os)
+ { return flush(__os.put(__os.widen('\n'))); }
+
+ /**
+ * @brief Write a null character into the output sequence.
+ *
+ * "Null character" is @c CharT() by definition. For CharT of @c char,
+ * this correctly writes the ASCII @c NUL character string terminator.
+ */
+ template<typename _CharT, typename _Traits>
+ inline basic_ostream<_CharT, _Traits>&
+ ends(basic_ostream<_CharT, _Traits>& __os)
+ { return __os.put(_CharT()); }
+
+ /**
+ * @brief Flushes the output stream.
+ *
+ * This manipulator simply calls the stream's @c flush() member function.
+ */
+ template<typename _CharT, typename _Traits>
+ inline basic_ostream<_CharT, _Traits>&
+ flush(basic_ostream<_CharT, _Traits>& __os)
+ { return __os.flush(); }
+
+_GLIBCXX_END_NAMESPACE
+
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <bits/ostream.tcc>
+#endif
+
+#endif /* _GLIBCXX_OSTREAM */
diff --git a/i686-linux/include/c++/4.4.3/parallel/algo.h b/i686-linux/include/c++/4.4.3/parallel/algo.h
new file mode 100644
index 0000000..a0fbd8d
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/algo.h
@@ -0,0 +1,2364 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/algo.h
+ * @brief Parallel STL function calls corresponding to the stl_algo.h header.
+ *
+ * The functions defined here mainly do case switches and
+ * call the actual parallelized versions in other files.
+ * Inlining policy: Functions that basically only contain one function call,
+ * are declared inline.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler and Felix Putze.
+
+#ifndef _GLIBCXX_PARALLEL_ALGO_H
+#define _GLIBCXX_PARALLEL_ALGO_H 1
+
+#include <parallel/algorithmfwd.h>
+#include <bits/stl_algobase.h>
+#include <bits/stl_algo.h>
+#include <parallel/iterator.h>
+#include <parallel/base.h>
+#include <parallel/sort.h>
+#include <parallel/workstealing.h>
+#include <parallel/par_loop.h>
+#include <parallel/omp_loop.h>
+#include <parallel/omp_loop_static.h>
+#include <parallel/for_each_selectors.h>
+#include <parallel/for_each.h>
+#include <parallel/find.h>
+#include <parallel/find_selectors.h>
+#include <parallel/search.h>
+#include <parallel/random_shuffle.h>
+#include <parallel/partition.h>
+#include <parallel/merge.h>
+#include <parallel/unique_copy.h>
+#include <parallel/set_operations.h>
+
+namespace std
+{
+namespace __parallel
+{
+ // Sequential fallback
+ template<typename InputIterator, typename Function>
+ inline Function
+ for_each(InputIterator begin, InputIterator end, Function f,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::for_each(begin, end, f); }
+
+
+ // Sequential fallback for input iterator case
+ template<typename InputIterator, typename Function, typename IteratorTag>
+ inline Function
+ for_each_switch(InputIterator begin, InputIterator end, Function f,
+ IteratorTag)
+ { return for_each(begin, end, f, __gnu_parallel::sequential_tag()); }
+
+ // Parallel algorithm for random access iterators
+ template<typename RandomAccessIterator, typename Function>
+ Function
+ for_each_switch(RandomAccessIterator begin, RandomAccessIterator end,
+ Function f, random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism_tag
+ = __gnu_parallel::parallel_balanced)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end - begin)
+ >= __gnu_parallel::_Settings::get().for_each_minimal_n
+ && __gnu_parallel::is_parallel(parallelism_tag)))
+ {
+ bool dummy;
+ __gnu_parallel::for_each_selector<RandomAccessIterator> functionality;
+
+ return __gnu_parallel::
+ for_each_template_random_access(begin, end, f, functionality,
+ __gnu_parallel::dummy_reduct(),
+ true, dummy, -1, parallelism_tag);
+ }
+ else
+ return for_each(begin, end, f, __gnu_parallel::sequential_tag());
+ }
+
+ // Public interface
+ template<typename Iterator, typename Function>
+ inline Function
+ for_each(Iterator begin, Iterator end, Function f,
+ __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef std::iterator_traits<Iterator> iterator_traits;
+ typedef typename iterator_traits::iterator_category iterator_category;
+ return for_each_switch(begin, end, f, iterator_category(),
+ parallelism_tag);
+ }
+
+ template<typename Iterator, typename Function>
+ inline Function
+ for_each(Iterator begin, Iterator end, Function f)
+ {
+ typedef std::iterator_traits<Iterator> iterator_traits;
+ typedef typename iterator_traits::iterator_category iterator_category;
+ return for_each_switch(begin, end, f, iterator_category());
+ }
+
+
+ // Sequential fallback
+ template<typename InputIterator, typename T>
+ inline InputIterator
+ find(InputIterator begin, InputIterator end, const T& val,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::find(begin, end, val); }
+
+ // Sequential fallback for input iterator case
+ template<typename InputIterator, typename T, typename IteratorTag>
+ inline InputIterator
+ find_switch(InputIterator begin, InputIterator end, const T& val,
+ IteratorTag)
+ { return _GLIBCXX_STD_P::find(begin, end, val); }
+
+ // Parallel find for random access iterators
+ template<typename RandomAccessIterator, typename T>
+ RandomAccessIterator
+ find_switch(RandomAccessIterator begin, RandomAccessIterator end,
+ const T& val, random_access_iterator_tag)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+
+ if (_GLIBCXX_PARALLEL_CONDITION(true))
+ {
+ binder2nd<__gnu_parallel::equal_to<value_type, const T&> >
+ comp(__gnu_parallel::equal_to<value_type, const T&>(), val);
+ return __gnu_parallel::find_template(begin, end, begin, comp,
+ __gnu_parallel::
+ find_if_selector()).first;
+ }
+ else
+ return _GLIBCXX_STD_P::find(begin, end, val);
+ }
+
+ // Public interface
+ template<typename InputIterator, typename T>
+ inline InputIterator
+ find(InputIterator begin, InputIterator end, const T& val)
+ {
+ typedef std::iterator_traits<InputIterator> iterator_traits;
+ typedef typename iterator_traits::iterator_category iterator_category;
+ return find_switch(begin, end, val, iterator_category());
+ }
+
+ // Sequential fallback
+ template<typename InputIterator, typename Predicate>
+ inline InputIterator
+ find_if(InputIterator begin, InputIterator end, Predicate pred,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::find_if(begin, end, pred); }
+
+ // Sequential fallback for input iterator case
+ template<typename InputIterator, typename Predicate, typename IteratorTag>
+ inline InputIterator
+ find_if_switch(InputIterator begin, InputIterator end, Predicate pred,
+ IteratorTag)
+ { return _GLIBCXX_STD_P::find_if(begin, end, pred); }
+
+ // Parallel find_if for random access iterators
+ template<typename RandomAccessIterator, typename Predicate>
+ RandomAccessIterator
+ find_if_switch(RandomAccessIterator begin, RandomAccessIterator end,
+ Predicate pred, random_access_iterator_tag)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(true))
+ return __gnu_parallel::find_template(begin, end, begin, pred,
+ __gnu_parallel::
+ find_if_selector()).first;
+ else
+ return _GLIBCXX_STD_P::find_if(begin, end, pred);
+ }
+
+ // Public interface
+ template<typename InputIterator, typename Predicate>
+ inline InputIterator
+ find_if(InputIterator begin, InputIterator end, Predicate pred)
+ {
+ typedef std::iterator_traits<InputIterator> iterator_traits;
+ typedef typename iterator_traits::iterator_category iterator_category;
+ return find_if_switch(begin, end, pred, iterator_category());
+ }
+
+ // Sequential fallback
+ template<typename InputIterator, typename ForwardIterator>
+ inline InputIterator
+ find_first_of(InputIterator begin1, InputIterator end1,
+ ForwardIterator begin2, ForwardIterator end2,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::find_first_of(begin1, end1, begin2, end2); }
+
+ // Sequential fallback
+ template<typename InputIterator, typename ForwardIterator,
+ typename BinaryPredicate>
+ inline InputIterator
+ find_first_of(InputIterator begin1, InputIterator end1,
+ ForwardIterator begin2, ForwardIterator end2,
+ BinaryPredicate comp, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::find_first_of(begin1, end1, begin2, end2, comp); }
+
+ // Sequential fallback for input iterator type
+ template<typename InputIterator, typename ForwardIterator,
+ typename IteratorTag1, typename IteratorTag2>
+ inline InputIterator
+ find_first_of_switch(InputIterator begin1, InputIterator end1,
+ ForwardIterator begin2, ForwardIterator end2,
+ IteratorTag1, IteratorTag2)
+ { return find_first_of(begin1, end1, begin2, end2,
+ __gnu_parallel::sequential_tag()); }
+
+ // Parallel algorithm for random access iterators
+ template<typename RandomAccessIterator, typename ForwardIterator,
+ typename BinaryPredicate, typename IteratorTag>
+ inline RandomAccessIterator
+ find_first_of_switch(RandomAccessIterator begin1,
+ RandomAccessIterator end1,
+ ForwardIterator begin2, ForwardIterator end2,
+ BinaryPredicate comp, random_access_iterator_tag,
+ IteratorTag)
+ {
+ return __gnu_parallel::
+ find_template(begin1, end1, begin1, comp,
+ __gnu_parallel::find_first_of_selector
+ <ForwardIterator>(begin2, end2)).first;
+ }
+
+ // Sequential fallback for input iterator type
+ template<typename InputIterator, typename ForwardIterator,
+ typename BinaryPredicate, typename IteratorTag1,
+ typename IteratorTag2>
+ inline InputIterator
+ find_first_of_switch(InputIterator begin1, InputIterator end1,
+ ForwardIterator begin2, ForwardIterator end2,
+ BinaryPredicate comp, IteratorTag1, IteratorTag2)
+ { return find_first_of(begin1, end1, begin2, end2, comp,
+ __gnu_parallel::sequential_tag()); }
+
+ // Public interface
+ template<typename InputIterator, typename ForwardIterator,
+ typename BinaryPredicate>
+ inline InputIterator
+ find_first_of(InputIterator begin1, InputIterator end1,
+ ForwardIterator begin2, ForwardIterator end2,
+ BinaryPredicate comp)
+ {
+ typedef std::iterator_traits<InputIterator> iteratori_traits;
+ typedef std::iterator_traits<ForwardIterator> iteratorf_traits;
+ typedef typename iteratori_traits::iterator_category iteratori_category;
+ typedef typename iteratorf_traits::iterator_category iteratorf_category;
+
+ return find_first_of_switch(begin1, end1, begin2, end2, comp,
+ iteratori_category(), iteratorf_category());
+ }
+
+ // Public interface, insert default comparator
+ template<typename InputIterator, typename ForwardIterator>
+ inline InputIterator
+ find_first_of(InputIterator begin1, InputIterator end1,
+ ForwardIterator begin2, ForwardIterator end2)
+ {
+ typedef std::iterator_traits<InputIterator> iteratori_traits;
+ typedef std::iterator_traits<ForwardIterator> iteratorf_traits;
+ typedef typename iteratori_traits::value_type valuei_type;
+ typedef typename iteratorf_traits::value_type valuef_type;
+
+ return find_first_of(begin1, end1, begin2, end2, __gnu_parallel::
+ equal_to<valuei_type, valuef_type>());
+ }
+
+ // Sequential fallback
+ template<typename InputIterator, typename OutputIterator>
+ inline OutputIterator
+ unique_copy(InputIterator begin1, InputIterator end1, OutputIterator out,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::unique_copy(begin1, end1, out); }
+
+ // Sequential fallback
+ template<typename InputIterator, typename OutputIterator,
+ typename Predicate>
+ inline OutputIterator
+ unique_copy(InputIterator begin1, InputIterator end1, OutputIterator out,
+ Predicate pred, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::unique_copy(begin1, end1, out, pred); }
+
+ // Sequential fallback for input iterator case
+ template<typename InputIterator, typename OutputIterator,
+ typename Predicate, typename IteratorTag1, typename IteratorTag2>
+ inline OutputIterator
+ unique_copy_switch(InputIterator begin, InputIterator last,
+ OutputIterator out, Predicate pred,
+ IteratorTag1, IteratorTag2)
+ { return _GLIBCXX_STD_P::unique_copy(begin, last, out, pred); }
+
+ // Parallel unique_copy for random access iterators
+ template<typename RandomAccessIterator, typename RandomAccessOutputIterator,
+ typename Predicate>
+ RandomAccessOutputIterator
+ unique_copy_switch(RandomAccessIterator begin, RandomAccessIterator last,
+ RandomAccessOutputIterator out, Predicate pred,
+ random_access_iterator_tag, random_access_iterator_tag)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(last - begin)
+ > __gnu_parallel::_Settings::get().unique_copy_minimal_n))
+ return __gnu_parallel::parallel_unique_copy(begin, last, out, pred);
+ else
+ return _GLIBCXX_STD_P::unique_copy(begin, last, out, pred);
+ }
+
+ // Public interface
+ template<typename InputIterator, typename OutputIterator>
+ inline OutputIterator
+ unique_copy(InputIterator begin1, InputIterator end1, OutputIterator out)
+ {
+ typedef std::iterator_traits<InputIterator> iteratori_traits;
+ typedef std::iterator_traits<OutputIterator> iteratoro_traits;
+ typedef typename iteratori_traits::iterator_category iteratori_category;
+ typedef typename iteratori_traits::value_type value_type;
+ typedef typename iteratoro_traits::iterator_category iteratoro_category;
+
+ return unique_copy_switch(begin1, end1, out, equal_to<value_type>(),
+ iteratori_category(), iteratoro_category());
+ }
+
+ // Public interface
+ template<typename InputIterator, typename OutputIterator, typename Predicate>
+ inline OutputIterator
+ unique_copy(InputIterator begin1, InputIterator end1, OutputIterator out,
+ Predicate pred)
+ {
+ typedef std::iterator_traits<InputIterator> iteratori_traits;
+ typedef std::iterator_traits<OutputIterator> iteratoro_traits;
+ typedef typename iteratori_traits::iterator_category iteratori_category;
+ typedef typename iteratoro_traits::iterator_category iteratoro_category;
+
+ return unique_copy_switch(begin1, end1, out, pred, iteratori_category(),
+ iteratoro_category());
+ }
+
+ // Sequential fallback
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator>
+ inline OutputIterator
+ set_union(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator out, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::set_union(begin1, end1, begin2, end2, out); }
+
+ // Sequential fallback
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator, typename Predicate>
+ inline OutputIterator
+ set_union(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator out, Predicate pred,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::set_union(begin1, end1,
+ begin2, end2, out, pred); }
+
+ // Sequential fallback for input iterator case
+ template<typename InputIterator1, typename InputIterator2,
+ typename Predicate, typename OutputIterator,
+ typename IteratorTag1, typename IteratorTag2, typename IteratorTag3>
+ inline OutputIterator
+ set_union_switch(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator result, Predicate pred, IteratorTag1,
+ IteratorTag2, IteratorTag3)
+ { return _GLIBCXX_STD_P::set_union(begin1, end1,
+ begin2, end2, result, pred); }
+
+ // Parallel set_union for random access iterators
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename OutputRandomAccessIterator, typename Predicate>
+ OutputRandomAccessIterator
+ set_union_switch(RandomAccessIterator1 begin1, RandomAccessIterator1 end1,
+ RandomAccessIterator2 begin2, RandomAccessIterator2 end2,
+ OutputRandomAccessIterator result, Predicate pred,
+ random_access_iterator_tag, random_access_iterator_tag,
+ random_access_iterator_tag)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end1 - begin1)
+ >= __gnu_parallel::_Settings::get().set_union_minimal_n
+ || static_cast<__gnu_parallel::sequence_index_t>(end2 - begin2)
+ >= __gnu_parallel::_Settings::get().set_union_minimal_n))
+ return __gnu_parallel::parallel_set_union(begin1, end1,
+ begin2, end2, result, pred);
+ else
+ return _GLIBCXX_STD_P::set_union(begin1, end1,
+ begin2, end2, result, pred);
+ }
+
+ // Public interface
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator>
+ inline OutputIterator
+ set_union(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2, OutputIterator out)
+ {
+ typedef std::iterator_traits<InputIterator1> iteratori1_traits;
+ typedef std::iterator_traits<InputIterator2> iteratori2_traits;
+ typedef std::iterator_traits<OutputIterator> iteratoro_traits;
+ typedef typename iteratori1_traits::iterator_category
+ iteratori1_category;
+ typedef typename iteratori2_traits::iterator_category
+ iteratori2_category;
+ typedef typename iteratoro_traits::iterator_category iteratoro_category;
+ typedef typename iteratori1_traits::value_type value1_type;
+ typedef typename iteratori2_traits::value_type value2_type;
+
+ return set_union_switch(begin1, end1, begin2, end2, out,
+ __gnu_parallel::less<value1_type, value2_type>(),
+ iteratori1_category(), iteratori2_category(),
+ iteratoro_category());
+ }
+
+ // Public interface
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator, typename Predicate>
+ inline OutputIterator
+ set_union(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator out, Predicate pred)
+ {
+ typedef std::iterator_traits<InputIterator1> iteratori1_traits;
+ typedef std::iterator_traits<InputIterator2> iteratori2_traits;
+ typedef std::iterator_traits<OutputIterator> iteratoro_traits;
+ typedef typename iteratori1_traits::iterator_category
+ iteratori1_category;
+ typedef typename iteratori2_traits::iterator_category
+ iteratori2_category;
+ typedef typename iteratoro_traits::iterator_category iteratoro_category;
+
+ return set_union_switch(begin1, end1, begin2, end2, out, pred,
+ iteratori1_category(), iteratori2_category(),
+ iteratoro_category());
+ }
+
+ // Sequential fallback.
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator>
+ inline OutputIterator
+ set_intersection(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator out, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::set_intersection(begin1, end1,
+ begin2, end2, out); }
+
+ // Sequential fallback.
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator, typename Predicate>
+ inline OutputIterator
+ set_intersection(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator out, Predicate pred,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::set_intersection(begin1, end1, begin2, end2,
+ out, pred); }
+
+ // Sequential fallback for input iterator case
+ template<typename InputIterator1, typename InputIterator2,
+ typename Predicate, typename OutputIterator,
+ typename IteratorTag1, typename IteratorTag2,
+ typename IteratorTag3>
+ inline OutputIterator
+ set_intersection_switch(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator result, Predicate pred,
+ IteratorTag1, IteratorTag2, IteratorTag3)
+ { return _GLIBCXX_STD_P::set_intersection(begin1, end1, begin2,
+ end2, result, pred); }
+
+ // Parallel set_intersection for random access iterators
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename OutputRandomAccessIterator, typename Predicate>
+ OutputRandomAccessIterator
+ set_intersection_switch(RandomAccessIterator1 begin1,
+ RandomAccessIterator1 end1,
+ RandomAccessIterator2 begin2,
+ RandomAccessIterator2 end2,
+ OutputRandomAccessIterator result,
+ Predicate pred,
+ random_access_iterator_tag,
+ random_access_iterator_tag,
+ random_access_iterator_tag)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end1 - begin1)
+ >= __gnu_parallel::_Settings::get().set_union_minimal_n
+ || static_cast<__gnu_parallel::sequence_index_t>(end2 - begin2)
+ >= __gnu_parallel::_Settings::get().set_union_minimal_n))
+ return __gnu_parallel::parallel_set_intersection(begin1, end1, begin2,
+ end2, result, pred);
+ else
+ return _GLIBCXX_STD_P::set_intersection(begin1, end1, begin2,
+ end2, result, pred);
+ }
+
+ // Public interface
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator>
+ inline OutputIterator
+ set_intersection(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator out)
+ {
+ typedef std::iterator_traits<InputIterator1> iteratori1_traits;
+ typedef std::iterator_traits<InputIterator2> iteratori2_traits;
+ typedef std::iterator_traits<OutputIterator> iteratoro_traits;
+ typedef typename iteratori1_traits::iterator_category
+ iteratori1_category;
+ typedef typename iteratori2_traits::iterator_category
+ iteratori2_category;
+ typedef typename iteratoro_traits::iterator_category iteratoro_category;
+ typedef typename iteratori1_traits::value_type value1_type;
+ typedef typename iteratori2_traits::value_type value2_type;
+
+ return set_intersection_switch(begin1, end1, begin2, end2, out,
+ __gnu_parallel::
+ less<value1_type, value2_type>(),
+ iteratori1_category(),
+ iteratori2_category(),
+ iteratoro_category());
+ }
+
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator, typename Predicate>
+ inline OutputIterator
+ set_intersection(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator out, Predicate pred)
+ {
+ typedef std::iterator_traits<InputIterator1> iteratori1_traits;
+ typedef std::iterator_traits<InputIterator2> iteratori2_traits;
+ typedef std::iterator_traits<OutputIterator> iteratoro_traits;
+ typedef typename iteratori1_traits::iterator_category
+ iteratori1_category;
+ typedef typename iteratori2_traits::iterator_category
+ iteratori2_category;
+ typedef typename iteratoro_traits::iterator_category iteratoro_category;
+
+ return set_intersection_switch(begin1, end1, begin2, end2, out, pred,
+ iteratori1_category(),
+ iteratori2_category(),
+ iteratoro_category());
+ }
+
+ // Sequential fallback
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator>
+ inline OutputIterator
+ set_symmetric_difference(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator out,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::set_symmetric_difference(begin1,end1,
+ begin2, end2, out); }
+
+ // Sequential fallback
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator, typename Predicate>
+ inline OutputIterator
+ set_symmetric_difference(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator out, Predicate pred,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::set_symmetric_difference(begin1, end1, begin2,
+ end2, out, pred); }
+
+ // Sequential fallback for input iterator case
+ template<typename InputIterator1, typename InputIterator2,
+ typename Predicate, typename OutputIterator,
+ typename IteratorTag1, typename IteratorTag2,
+ typename IteratorTag3>
+ inline OutputIterator
+ set_symmetric_difference_switch(InputIterator1 begin1,
+ InputIterator1 end1,
+ InputIterator2 begin2,
+ InputIterator2 end2,
+ OutputIterator result, Predicate pred,
+ IteratorTag1, IteratorTag2, IteratorTag3)
+ { return _GLIBCXX_STD_P::set_symmetric_difference(begin1, end1,
+ begin2, end2,
+ result, pred); }
+
+ // Parallel set_symmetric_difference for random access iterators
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename OutputRandomAccessIterator, typename Predicate>
+ OutputRandomAccessIterator
+ set_symmetric_difference_switch(RandomAccessIterator1 begin1,
+ RandomAccessIterator1 end1,
+ RandomAccessIterator2 begin2,
+ RandomAccessIterator2 end2,
+ OutputRandomAccessIterator result,
+ Predicate pred,
+ random_access_iterator_tag,
+ random_access_iterator_tag,
+ random_access_iterator_tag)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end1 - begin1)
+ >= __gnu_parallel::_Settings::get().set_symmetric_difference_minimal_n
+ || static_cast<__gnu_parallel::sequence_index_t>(end2 - begin2)
+ >= __gnu_parallel::_Settings::get().set_symmetric_difference_minimal_n))
+ return __gnu_parallel::parallel_set_symmetric_difference(begin1, end1,
+ begin2, end2,
+ result, pred);
+ else
+ return _GLIBCXX_STD_P::set_symmetric_difference(begin1, end1,
+ begin2, end2,
+ result, pred);
+ }
+
+ // Public interface.
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator>
+ inline OutputIterator
+ set_symmetric_difference(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator out)
+ {
+ typedef std::iterator_traits<InputIterator1> iteratori1_traits;
+ typedef std::iterator_traits<InputIterator2> iteratori2_traits;
+ typedef std::iterator_traits<OutputIterator> iteratoro_traits;
+ typedef typename iteratori1_traits::iterator_category
+ iteratori1_category;
+ typedef typename iteratori2_traits::iterator_category
+ iteratori2_category;
+ typedef typename iteratoro_traits::iterator_category iteratoro_category;
+ typedef typename iteratori1_traits::value_type value1_type;
+ typedef typename iteratori2_traits::value_type value2_type;
+
+ return set_symmetric_difference_switch(begin1, end1, begin2, end2, out,
+ __gnu_parallel::
+ less<value1_type, value2_type>(),
+ iteratori1_category(),
+ iteratori2_category(),
+ iteratoro_category());
+ }
+
+ // Public interface.
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator, typename Predicate>
+ inline OutputIterator
+ set_symmetric_difference(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator out, Predicate pred)
+ {
+ typedef std::iterator_traits<InputIterator1> iteratori1_traits;
+ typedef std::iterator_traits<InputIterator2> iteratori2_traits;
+ typedef std::iterator_traits<OutputIterator> iteratoro_traits;
+ typedef typename iteratori1_traits::iterator_category
+ iteratori1_category;
+ typedef typename iteratori2_traits::iterator_category
+ iteratori2_category;
+ typedef typename iteratoro_traits::iterator_category iteratoro_category;
+
+ return set_symmetric_difference_switch(begin1, end1, begin2, end2, out,
+ pred, iteratori1_category(),
+ iteratori2_category(),
+ iteratoro_category());
+ }
+
+ // Sequential fallback.
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator>
+ inline OutputIterator
+ set_difference(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator out, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::set_difference(begin1,end1, begin2, end2, out); }
+
+ // Sequential fallback.
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator, typename Predicate>
+ inline OutputIterator
+ set_difference(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator out, Predicate pred,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::set_difference(begin1, end1,
+ begin2, end2, out, pred); }
+
+ // Sequential fallback for input iterator case.
+ template<typename InputIterator1, typename InputIterator2,
+ typename Predicate, typename OutputIterator,
+ typename IteratorTag1, typename IteratorTag2, typename IteratorTag3>
+ inline OutputIterator
+ set_difference_switch(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator result, Predicate pred,
+ IteratorTag1, IteratorTag2, IteratorTag3)
+ { return _GLIBCXX_STD_P::set_difference(begin1, end1,
+ begin2, end2, result, pred); }
+
+ // Parallel set_difference for random access iterators
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename OutputRandomAccessIterator, typename Predicate>
+ OutputRandomAccessIterator
+ set_difference_switch(RandomAccessIterator1 begin1,
+ RandomAccessIterator1 end1,
+ RandomAccessIterator2 begin2,
+ RandomAccessIterator2 end2,
+ OutputRandomAccessIterator result, Predicate pred,
+ random_access_iterator_tag,
+ random_access_iterator_tag,
+ random_access_iterator_tag)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end1 - begin1)
+ >= __gnu_parallel::_Settings::get().set_difference_minimal_n
+ || static_cast<__gnu_parallel::sequence_index_t>(end2 - begin2)
+ >= __gnu_parallel::_Settings::get().set_difference_minimal_n))
+ return __gnu_parallel::parallel_set_difference(begin1, end1,
+ begin2, end2,
+ result, pred);
+ else
+ return _GLIBCXX_STD_P::set_difference(begin1, end1,
+ begin2, end2, result, pred);
+ }
+
+ // Public interface
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator>
+ inline OutputIterator
+ set_difference(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator out)
+ {
+ typedef std::iterator_traits<InputIterator1> iteratori1_traits;
+ typedef std::iterator_traits<InputIterator2> iteratori2_traits;
+ typedef std::iterator_traits<OutputIterator> iteratoro_traits;
+ typedef typename iteratori1_traits::iterator_category
+ iteratori1_category;
+ typedef typename iteratori2_traits::iterator_category
+ iteratori2_category;
+ typedef typename iteratoro_traits::iterator_category iteratoro_category;
+ typedef typename iteratori1_traits::value_type value1_type;
+ typedef typename iteratori2_traits::value_type value2_type;
+
+ return set_difference_switch(begin1, end1, begin2, end2, out,
+ __gnu_parallel::
+ less<value1_type, value2_type>(),
+ iteratori1_category(),
+ iteratori2_category(),
+ iteratoro_category());
+ }
+
+ // Public interface
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator, typename Predicate>
+ inline OutputIterator
+ set_difference(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator out, Predicate pred)
+ {
+ typedef std::iterator_traits<InputIterator1> iteratori1_traits;
+ typedef std::iterator_traits<InputIterator2> iteratori2_traits;
+ typedef std::iterator_traits<OutputIterator> iteratoro_traits;
+ typedef typename iteratori1_traits::iterator_category
+ iteratori1_category;
+ typedef typename iteratori2_traits::iterator_category
+ iteratori2_category;
+ typedef typename iteratoro_traits::iterator_category iteratoro_category;
+
+ return set_difference_switch(begin1, end1, begin2, end2, out, pred,
+ iteratori1_category(),
+ iteratori2_category(),
+ iteratoro_category());
+ }
+
+ // Sequential fallback
+ template<typename ForwardIterator>
+ inline ForwardIterator
+ adjacent_find(ForwardIterator begin, ForwardIterator end,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::adjacent_find(begin, end); }
+
+ // Sequential fallback
+ template<typename ForwardIterator, typename BinaryPredicate>
+ inline ForwardIterator
+ adjacent_find(ForwardIterator begin, ForwardIterator end,
+ BinaryPredicate binary_pred, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::adjacent_find(begin, end, binary_pred); }
+
+ // Parallel algorithm for random access iterators
+ template<typename RandomAccessIterator>
+ RandomAccessIterator
+ adjacent_find_switch(RandomAccessIterator begin, RandomAccessIterator end,
+ random_access_iterator_tag)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+
+ if (_GLIBCXX_PARALLEL_CONDITION(true))
+ {
+ RandomAccessIterator spot = __gnu_parallel::
+ find_template(begin, end - 1, begin, equal_to<value_type>(),
+ __gnu_parallel::adjacent_find_selector()).first;
+ if (spot == (end - 1))
+ return end;
+ else
+ return spot;
+ }
+ else
+ return adjacent_find(begin, end, __gnu_parallel::sequential_tag());
+ }
+
+ // Sequential fallback for input iterator case
+ template<typename ForwardIterator, typename IteratorTag>
+ inline ForwardIterator
+ adjacent_find_switch(ForwardIterator begin, ForwardIterator end,
+ IteratorTag)
+ { return adjacent_find(begin, end, __gnu_parallel::sequential_tag()); }
+
+ // Public interface
+ template<typename ForwardIterator>
+ inline ForwardIterator
+ adjacent_find(ForwardIterator begin, ForwardIterator end)
+ {
+ typedef iterator_traits<ForwardIterator> traits_type;
+ typedef typename traits_type::iterator_category iterator_category;
+ return adjacent_find_switch(begin, end, iterator_category());
+ }
+
+ // Sequential fallback for input iterator case
+ template<typename ForwardIterator, typename BinaryPredicate,
+ typename IteratorTag>
+ inline ForwardIterator
+ adjacent_find_switch(ForwardIterator begin, ForwardIterator end,
+ BinaryPredicate pred, IteratorTag)
+ { return adjacent_find(begin, end, pred,
+ __gnu_parallel::sequential_tag()); }
+
+ // Parallel algorithm for random access iterators
+ template<typename RandomAccessIterator, typename BinaryPredicate>
+ RandomAccessIterator
+ adjacent_find_switch(RandomAccessIterator begin, RandomAccessIterator end,
+ BinaryPredicate pred, random_access_iterator_tag)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(true))
+ return __gnu_parallel::find_template(begin, end, begin, pred,
+ __gnu_parallel::
+ adjacent_find_selector()).first;
+ else
+ return adjacent_find(begin, end, pred,
+ __gnu_parallel::sequential_tag());
+ }
+
+ // Public interface
+ template<typename ForwardIterator, typename BinaryPredicate>
+ inline ForwardIterator
+ adjacent_find(ForwardIterator begin, ForwardIterator end,
+ BinaryPredicate pred)
+ {
+ typedef iterator_traits<ForwardIterator> traits_type;
+ typedef typename traits_type::iterator_category iterator_category;
+ return adjacent_find_switch(begin, end, pred, iterator_category());
+ }
+
+ // Sequential fallback
+ template<typename InputIterator, typename T>
+ inline typename iterator_traits<InputIterator>::difference_type
+ count(InputIterator begin, InputIterator end, const T& value,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::count(begin, end, value); }
+
+ // Parallel code for random access iterators
+ template<typename RandomAccessIterator, typename T>
+ typename iterator_traits<RandomAccessIterator>::difference_type
+ count_switch(RandomAccessIterator begin, RandomAccessIterator end,
+ const T& value, random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism_tag
+ = __gnu_parallel::parallel_unbalanced)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+ typedef __gnu_parallel::sequence_index_t sequence_index_t;
+
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<sequence_index_t>(end - begin)
+ >= __gnu_parallel::_Settings::get().count_minimal_n
+ && __gnu_parallel::is_parallel(parallelism_tag)))
+ {
+ __gnu_parallel::count_selector<RandomAccessIterator, difference_type>
+ functionality;
+ difference_type res = 0;
+ __gnu_parallel::
+ for_each_template_random_access(begin, end, value,
+ functionality,
+ std::plus<sequence_index_t>(),
+ res, res, -1, parallelism_tag);
+ return res;
+ }
+ else
+ return count(begin, end, value, __gnu_parallel::sequential_tag());
+ }
+
+ // Sequential fallback for input iterator case.
+ template<typename InputIterator, typename T, typename IteratorTag>
+ inline typename iterator_traits<InputIterator>::difference_type
+ count_switch(InputIterator begin, InputIterator end, const T& value,
+ IteratorTag)
+ { return count(begin, end, value, __gnu_parallel::sequential_tag()); }
+
+ // Public interface.
+ template<typename InputIterator, typename T>
+ inline typename iterator_traits<InputIterator>::difference_type
+ count(InputIterator begin, InputIterator end, const T& value,
+ __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef iterator_traits<InputIterator> traits_type;
+ typedef typename traits_type::iterator_category iterator_category;
+ return count_switch(begin, end, value, iterator_category(),
+ parallelism_tag);
+ }
+
+ template<typename InputIterator, typename T>
+ inline typename iterator_traits<InputIterator>::difference_type
+ count(InputIterator begin, InputIterator end, const T& value)
+ {
+ typedef iterator_traits<InputIterator> traits_type;
+ typedef typename traits_type::iterator_category iterator_category;
+ return count_switch(begin, end, value, iterator_category());
+ }
+
+
+ // Sequential fallback.
+ template<typename InputIterator, typename Predicate>
+ inline typename iterator_traits<InputIterator>::difference_type
+ count_if(InputIterator begin, InputIterator end, Predicate pred,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::count_if(begin, end, pred); }
+
+ // Parallel count_if for random access iterators
+ template<typename RandomAccessIterator, typename Predicate>
+ typename iterator_traits<RandomAccessIterator>::difference_type
+ count_if_switch(RandomAccessIterator begin, RandomAccessIterator end,
+ Predicate pred, random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism_tag
+ = __gnu_parallel::parallel_unbalanced)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+ typedef __gnu_parallel::sequence_index_t sequence_index_t;
+
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<sequence_index_t>(end - begin)
+ >= __gnu_parallel::_Settings::get().count_minimal_n
+ && __gnu_parallel::is_parallel(parallelism_tag)))
+ {
+ difference_type res = 0;
+ __gnu_parallel::
+ count_if_selector<RandomAccessIterator, difference_type>
+ functionality;
+ __gnu_parallel::
+ for_each_template_random_access(begin, end, pred,
+ functionality,
+ std::plus<sequence_index_t>(),
+ res, res, -1, parallelism_tag);
+ return res;
+ }
+ else
+ return count_if(begin, end, pred, __gnu_parallel::sequential_tag());
+ }
+
+ // Sequential fallback for input iterator case.
+ template<typename InputIterator, typename Predicate, typename IteratorTag>
+ inline typename iterator_traits<InputIterator>::difference_type
+ count_if_switch(InputIterator begin, InputIterator end, Predicate pred,
+ IteratorTag)
+ { return count_if(begin, end, pred, __gnu_parallel::sequential_tag()); }
+
+ // Public interface.
+ template<typename InputIterator, typename Predicate>
+ inline typename iterator_traits<InputIterator>::difference_type
+ count_if(InputIterator begin, InputIterator end, Predicate pred,
+ __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef iterator_traits<InputIterator> traits_type;
+ typedef typename traits_type::iterator_category iterator_category;
+ return count_if_switch(begin, end, pred, iterator_category(),
+ parallelism_tag);
+ }
+
+ template<typename InputIterator, typename Predicate>
+ inline typename iterator_traits<InputIterator>::difference_type
+ count_if(InputIterator begin, InputIterator end, Predicate pred)
+ {
+ typedef iterator_traits<InputIterator> traits_type;
+ typedef typename traits_type::iterator_category iterator_category;
+ return count_if_switch(begin, end, pred, iterator_category());
+ }
+
+
+ // Sequential fallback.
+ template<typename ForwardIterator1, typename ForwardIterator2>
+ inline ForwardIterator1
+ search(ForwardIterator1 begin1, ForwardIterator1 end1,
+ ForwardIterator2 begin2, ForwardIterator2 end2,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::search(begin1, end1, begin2, end2); }
+
+ // Parallel algorithm for random access iterator
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2>
+ RandomAccessIterator1
+ search_switch(RandomAccessIterator1 begin1, RandomAccessIterator1 end1,
+ RandomAccessIterator2 begin2, RandomAccessIterator2 end2,
+ random_access_iterator_tag, random_access_iterator_tag)
+ {
+ typedef std::iterator_traits<RandomAccessIterator1> iterator1_traits;
+ typedef typename iterator1_traits::value_type value1_type;
+ typedef std::iterator_traits<RandomAccessIterator2> iterator2_traits;
+ typedef typename iterator2_traits::value_type value2_type;
+
+ if (_GLIBCXX_PARALLEL_CONDITION(true))
+ return __gnu_parallel::
+ search_template(begin1, end1, begin2, end2, __gnu_parallel::
+ equal_to<value1_type, value2_type>());
+ else
+ return search(begin1, end1, begin2, end2,
+ __gnu_parallel::sequential_tag());
+ }
+
+ // Sequential fallback for input iterator case
+ template<typename ForwardIterator1, typename ForwardIterator2,
+ typename IteratorTag1, typename IteratorTag2>
+ inline ForwardIterator1
+ search_switch(ForwardIterator1 begin1, ForwardIterator1 end1,
+ ForwardIterator2 begin2, ForwardIterator2 end2,
+ IteratorTag1, IteratorTag2)
+ { return search(begin1, end1, begin2, end2,
+ __gnu_parallel::sequential_tag()); }
+
+ // Public interface.
+ template<typename ForwardIterator1, typename ForwardIterator2>
+ inline ForwardIterator1
+ search(ForwardIterator1 begin1, ForwardIterator1 end1,
+ ForwardIterator2 begin2, ForwardIterator2 end2)
+ {
+ typedef std::iterator_traits<ForwardIterator1> iterator1_traits;
+ typedef typename iterator1_traits::iterator_category iterator1_category;
+ typedef std::iterator_traits<ForwardIterator2> iterator2_traits;
+ typedef typename iterator2_traits::iterator_category iterator2_category;
+
+ return search_switch(begin1, end1, begin2, end2,
+ iterator1_category(), iterator2_category());
+ }
+
+ // Public interface.
+ template<typename ForwardIterator1, typename ForwardIterator2,
+ typename BinaryPredicate>
+ inline ForwardIterator1
+ search(ForwardIterator1 begin1, ForwardIterator1 end1,
+ ForwardIterator2 begin2, ForwardIterator2 end2,
+ BinaryPredicate pred, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::search(begin1, end1, begin2, end2, pred); }
+
+ // Parallel algorithm for random access iterator.
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename BinaryPredicate>
+ RandomAccessIterator1
+ search_switch(RandomAccessIterator1 begin1, RandomAccessIterator1 end1,
+ RandomAccessIterator2 begin2, RandomAccessIterator2 end2,
+ BinaryPredicate pred,
+ random_access_iterator_tag, random_access_iterator_tag)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(true))
+ return __gnu_parallel::search_template(begin1, end1,
+ begin2, end2, pred);
+ else
+ return search(begin1, end1, begin2, end2, pred,
+ __gnu_parallel::sequential_tag());
+ }
+
+ // Sequential fallback for input iterator case
+ template<typename ForwardIterator1, typename ForwardIterator2,
+ typename BinaryPredicate, typename IteratorTag1,
+ typename IteratorTag2>
+ inline ForwardIterator1
+ search_switch(ForwardIterator1 begin1, ForwardIterator1 end1,
+ ForwardIterator2 begin2, ForwardIterator2 end2,
+ BinaryPredicate pred, IteratorTag1, IteratorTag2)
+ { return search(begin1, end1, begin2, end2, pred,
+ __gnu_parallel::sequential_tag()); }
+
+ // Public interface
+ template<typename ForwardIterator1, typename ForwardIterator2,
+ typename BinaryPredicate>
+ inline ForwardIterator1
+ search(ForwardIterator1 begin1, ForwardIterator1 end1,
+ ForwardIterator2 begin2, ForwardIterator2 end2,
+ BinaryPredicate pred)
+ {
+ typedef std::iterator_traits<ForwardIterator1> iterator1_traits;
+ typedef typename iterator1_traits::iterator_category iterator1_category;
+ typedef std::iterator_traits<ForwardIterator2> iterator2_traits;
+ typedef typename iterator2_traits::iterator_category iterator2_category;
+ return search_switch(begin1, end1, begin2, end2, pred,
+ iterator1_category(), iterator2_category());
+ }
+
+ // Sequential fallback
+ template<typename ForwardIterator, typename Integer, typename T>
+ inline ForwardIterator
+ search_n(ForwardIterator begin, ForwardIterator end, Integer count,
+ const T& val, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::search_n(begin, end, count, val); }
+
+ // Sequential fallback
+ template<typename ForwardIterator, typename Integer, typename T,
+ typename BinaryPredicate>
+ inline ForwardIterator
+ search_n(ForwardIterator begin, ForwardIterator end, Integer count,
+ const T& val, BinaryPredicate binary_pred,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::search_n(begin, end, count, val, binary_pred); }
+
+ // Public interface.
+ template<typename ForwardIterator, typename Integer, typename T>
+ inline ForwardIterator
+ search_n(ForwardIterator begin, ForwardIterator end, Integer count,
+ const T& val)
+ {
+ typedef typename iterator_traits<ForwardIterator>::value_type value_type;
+ return search_n(begin, end, count, val,
+ __gnu_parallel::equal_to<value_type, T>());
+ }
+
+ // Parallel algorithm for random access iterators.
+ template<typename RandomAccessIterator, typename Integer,
+ typename T, typename BinaryPredicate>
+ RandomAccessIterator
+ search_n_switch(RandomAccessIterator begin, RandomAccessIterator end,
+ Integer count, const T& val, BinaryPredicate binary_pred,
+ random_access_iterator_tag)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(true))
+ {
+ __gnu_parallel::pseudo_sequence<T, Integer> ps(val, count);
+ return __gnu_parallel::search_template(begin, end, ps.begin(),
+ ps.end(), binary_pred);
+ }
+ else
+ return std::__search_n(begin, end, count, val,
+ binary_pred, random_access_iterator_tag());
+ }
+
+ // Sequential fallback for input iterator case.
+ template<typename ForwardIterator, typename Integer, typename T,
+ typename BinaryPredicate, typename IteratorTag>
+ inline ForwardIterator
+ search_n_switch(ForwardIterator begin, ForwardIterator end, Integer count,
+ const T& val, BinaryPredicate binary_pred, IteratorTag)
+ { return __search_n(begin, end, count, val, binary_pred, IteratorTag()); }
+
+ // Public interface.
+ template<typename ForwardIterator, typename Integer, typename T,
+ typename BinaryPredicate>
+ inline ForwardIterator
+ search_n(ForwardIterator begin, ForwardIterator end, Integer count,
+ const T& val, BinaryPredicate binary_pred)
+ {
+ return search_n_switch(begin, end, count, val, binary_pred,
+ typename std::iterator_traits<ForwardIterator>::
+ iterator_category());
+ }
+
+
+ // Sequential fallback.
+ template<typename InputIterator, typename OutputIterator,
+ typename UnaryOperation>
+ inline OutputIterator
+ transform(InputIterator begin, InputIterator end, OutputIterator result,
+ UnaryOperation unary_op, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::transform(begin, end, result, unary_op); }
+
+ // Parallel unary transform for random access iterators.
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename UnaryOperation>
+ RandomAccessIterator2
+ transform1_switch(RandomAccessIterator1 begin, RandomAccessIterator1 end,
+ RandomAccessIterator2 result, UnaryOperation unary_op,
+ random_access_iterator_tag, random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism_tag
+ = __gnu_parallel::parallel_balanced)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end - begin)
+ >= __gnu_parallel::_Settings::get().transform_minimal_n
+ && __gnu_parallel::is_parallel(parallelism_tag)))
+ {
+ bool dummy = true;
+ typedef __gnu_parallel::iterator_pair<RandomAccessIterator1,
+ RandomAccessIterator2, random_access_iterator_tag> ip;
+ ip begin_pair(begin, result), end_pair(end, result + (end - begin));
+ __gnu_parallel::transform1_selector<ip> functionality;
+ __gnu_parallel::
+ for_each_template_random_access(begin_pair, end_pair,
+ unary_op, functionality,
+ __gnu_parallel::dummy_reduct(),
+ dummy, dummy, -1, parallelism_tag);
+ return functionality.finish_iterator;
+ }
+ else
+ return transform(begin, end, result, unary_op,
+ __gnu_parallel::sequential_tag());
+ }
+
+ // Sequential fallback for input iterator case.
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename UnaryOperation, typename IteratorTag1,
+ typename IteratorTag2>
+ inline RandomAccessIterator2
+ transform1_switch(RandomAccessIterator1 begin, RandomAccessIterator1 end,
+ RandomAccessIterator2 result, UnaryOperation unary_op,
+ IteratorTag1, IteratorTag2)
+ { return transform(begin, end, result, unary_op,
+ __gnu_parallel::sequential_tag()); }
+
+ // Public interface.
+ template<typename InputIterator, typename OutputIterator,
+ typename UnaryOperation>
+ inline OutputIterator
+ transform(InputIterator begin, InputIterator end, OutputIterator result,
+ UnaryOperation unary_op,
+ __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef std::iterator_traits<InputIterator> iteratori_traits;
+ typedef std::iterator_traits<OutputIterator> iteratoro_traits;
+ typedef typename iteratori_traits::iterator_category iteratori_category;
+ typedef typename iteratoro_traits::iterator_category iteratoro_category;
+
+ return transform1_switch(begin, end, result, unary_op,
+ iteratori_category(), iteratoro_category(),
+ parallelism_tag);
+ }
+
+ template<typename InputIterator, typename OutputIterator,
+ typename UnaryOperation>
+ inline OutputIterator
+ transform(InputIterator begin, InputIterator end, OutputIterator result,
+ UnaryOperation unary_op)
+ {
+ typedef std::iterator_traits<InputIterator> iteratori_traits;
+ typedef std::iterator_traits<OutputIterator> iteratoro_traits;
+ typedef typename iteratori_traits::iterator_category iteratori_category;
+ typedef typename iteratoro_traits::iterator_category iteratoro_category;
+
+ return transform1_switch(begin, end, result, unary_op,
+ iteratori_category(), iteratoro_category());
+ }
+
+
+ // Sequential fallback
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator, typename BinaryOperation>
+ inline OutputIterator
+ transform(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, OutputIterator result,
+ BinaryOperation binary_op, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::transform(begin1, end1,
+ begin2, result, binary_op); }
+
+ // Parallel binary transform for random access iterators.
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename RandomAccessIterator3, typename BinaryOperation>
+ RandomAccessIterator3
+ transform2_switch(RandomAccessIterator1 begin1, RandomAccessIterator1 end1,
+ RandomAccessIterator2 begin2,
+ RandomAccessIterator3 result, BinaryOperation binary_op,
+ random_access_iterator_tag, random_access_iterator_tag,
+ random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism_tag
+ = __gnu_parallel::parallel_balanced)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ (end1 - begin1) >=
+ __gnu_parallel::_Settings::get().transform_minimal_n
+ && __gnu_parallel::is_parallel(parallelism_tag)))
+ {
+ bool dummy = true;
+ typedef __gnu_parallel::iterator_triple<RandomAccessIterator1,
+ RandomAccessIterator2, RandomAccessIterator3,
+ random_access_iterator_tag> ip;
+ ip begin_triple(begin1, begin2, result),
+ end_triple(end1, begin2 + (end1 - begin1),
+ result + (end1 - begin1));
+ __gnu_parallel::transform2_selector<ip> functionality;
+ __gnu_parallel::
+ for_each_template_random_access(begin_triple, end_triple,
+ binary_op, functionality,
+ __gnu_parallel::dummy_reduct(),
+ dummy, dummy, -1,
+ parallelism_tag);
+ return functionality.finish_iterator;
+ }
+ else
+ return transform(begin1, end1, begin2, result, binary_op,
+ __gnu_parallel::sequential_tag());
+ }
+
+ // Sequential fallback for input iterator case.
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator, typename BinaryOperation,
+ typename tag1, typename tag2, typename tag3>
+ inline OutputIterator
+ transform2_switch(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, OutputIterator result,
+ BinaryOperation binary_op, tag1, tag2, tag3)
+ { return transform(begin1, end1, begin2, result, binary_op,
+ __gnu_parallel::sequential_tag()); }
+
+ // Public interface.
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator, typename BinaryOperation>
+ inline OutputIterator
+ transform(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, OutputIterator result,
+ BinaryOperation binary_op,
+ __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef std::iterator_traits<InputIterator1> iteratori1_traits;
+ typedef typename iteratori1_traits::iterator_category
+ iteratori1_category;
+ typedef std::iterator_traits<InputIterator2> iteratori2_traits;
+ typedef typename iteratori2_traits::iterator_category
+ iteratori2_category;
+ typedef std::iterator_traits<OutputIterator> iteratoro_traits;
+ typedef typename iteratoro_traits::iterator_category iteratoro_category;
+
+ return transform2_switch(begin1, end1, begin2, result, binary_op,
+ iteratori1_category(), iteratori2_category(),
+ iteratoro_category(), parallelism_tag);
+ }
+
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator, typename BinaryOperation>
+ inline OutputIterator
+ transform(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, OutputIterator result,
+ BinaryOperation binary_op)
+ {
+ typedef std::iterator_traits<InputIterator1> iteratori1_traits;
+ typedef typename iteratori1_traits::iterator_category
+ iteratori1_category;
+ typedef std::iterator_traits<InputIterator2> iteratori2_traits;
+ typedef typename iteratori2_traits::iterator_category
+ iteratori2_category;
+ typedef std::iterator_traits<OutputIterator> iteratoro_traits;
+ typedef typename iteratoro_traits::iterator_category iteratoro_category;
+
+ return transform2_switch(begin1, end1, begin2, result, binary_op,
+ iteratori1_category(), iteratori2_category(),
+ iteratoro_category());
+ }
+
+ // Sequential fallback
+ template<typename ForwardIterator, typename T>
+ inline void
+ replace(ForwardIterator begin, ForwardIterator end, const T& old_value,
+ const T& new_value, __gnu_parallel::sequential_tag)
+ { _GLIBCXX_STD_P::replace(begin, end, old_value, new_value); }
+
+ // Sequential fallback for input iterator case
+ template<typename ForwardIterator, typename T, typename IteratorTag>
+ inline void
+ replace_switch(ForwardIterator begin, ForwardIterator end,
+ const T& old_value, const T& new_value, IteratorTag)
+ { replace(begin, end, old_value, new_value,
+ __gnu_parallel::sequential_tag()); }
+
+ // Parallel replace for random access iterators
+ template<typename RandomAccessIterator, typename T>
+ inline void
+ replace_switch(RandomAccessIterator begin, RandomAccessIterator end,
+ const T& old_value, const T& new_value,
+ random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism_tag
+ = __gnu_parallel::parallel_balanced)
+ {
+ // XXX parallel version is where?
+ replace(begin, end, old_value, new_value,
+ __gnu_parallel::sequential_tag());
+ }
+
+ // Public interface
+ template<typename ForwardIterator, typename T>
+ inline void
+ replace(ForwardIterator begin, ForwardIterator end, const T& old_value,
+ const T& new_value, __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef iterator_traits<ForwardIterator> traits_type;
+ typedef typename traits_type::iterator_category iterator_category;
+ replace_switch(begin, end, old_value, new_value, iterator_category(),
+ parallelism_tag);
+ }
+
+ template<typename ForwardIterator, typename T>
+ inline void
+ replace(ForwardIterator begin, ForwardIterator end, const T& old_value,
+ const T& new_value)
+ {
+ typedef iterator_traits<ForwardIterator> traits_type;
+ typedef typename traits_type::iterator_category iterator_category;
+ replace_switch(begin, end, old_value, new_value, iterator_category());
+ }
+
+
+ // Sequential fallback
+ template<typename ForwardIterator, typename Predicate, typename T>
+ inline void
+ replace_if(ForwardIterator begin, ForwardIterator end, Predicate pred,
+ const T& new_value, __gnu_parallel::sequential_tag)
+ { _GLIBCXX_STD_P::replace_if(begin, end, pred, new_value); }
+
+ // Sequential fallback for input iterator case
+ template<typename ForwardIterator, typename Predicate, typename T,
+ typename IteratorTag>
+ inline void
+ replace_if_switch(ForwardIterator begin, ForwardIterator end,
+ Predicate pred, const T& new_value, IteratorTag)
+ { replace_if(begin, end, pred, new_value,
+ __gnu_parallel::sequential_tag()); }
+
+ // Parallel algorithm for random access iterators.
+ template<typename RandomAccessIterator, typename Predicate, typename T>
+ void
+ replace_if_switch(RandomAccessIterator begin, RandomAccessIterator end,
+ Predicate pred, const T& new_value,
+ random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism_tag
+ = __gnu_parallel::parallel_balanced)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end - begin)
+ >= __gnu_parallel::_Settings::get().replace_minimal_n
+ && __gnu_parallel::is_parallel(parallelism_tag)))
+ {
+ bool dummy;
+ __gnu_parallel::
+ replace_if_selector<RandomAccessIterator, Predicate, T>
+ functionality(new_value);
+ __gnu_parallel::
+ for_each_template_random_access(begin, end, pred,
+ functionality,
+ __gnu_parallel::dummy_reduct(),
+ true, dummy, -1, parallelism_tag);
+ }
+ else
+ replace_if(begin, end, pred, new_value,
+ __gnu_parallel::sequential_tag());
+ }
+
+ // Public interface.
+ template<typename ForwardIterator, typename Predicate, typename T>
+ inline void
+ replace_if(ForwardIterator begin, ForwardIterator end,
+ Predicate pred, const T& new_value,
+ __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef std::iterator_traits<ForwardIterator> iterator_traits;
+ typedef typename iterator_traits::iterator_category iterator_category;
+ replace_if_switch(begin, end, pred, new_value, iterator_category(),
+ parallelism_tag);
+ }
+
+ template<typename ForwardIterator, typename Predicate, typename T>
+ inline void
+ replace_if(ForwardIterator begin, ForwardIterator end,
+ Predicate pred, const T& new_value)
+ {
+ typedef std::iterator_traits<ForwardIterator> iterator_traits;
+ typedef typename iterator_traits::iterator_category iterator_category;
+ replace_if_switch(begin, end, pred, new_value, iterator_category());
+ }
+
+ // Sequential fallback
+ template<typename ForwardIterator, typename Generator>
+ inline void
+ generate(ForwardIterator begin, ForwardIterator end, Generator gen,
+ __gnu_parallel::sequential_tag)
+ { _GLIBCXX_STD_P::generate(begin, end, gen); }
+
+ // Sequential fallback for input iterator case.
+ template<typename ForwardIterator, typename Generator, typename IteratorTag>
+ inline void
+ generate_switch(ForwardIterator begin, ForwardIterator end, Generator gen,
+ IteratorTag)
+ { generate(begin, end, gen, __gnu_parallel::sequential_tag()); }
+
+ // Parallel algorithm for random access iterators.
+ template<typename RandomAccessIterator, typename Generator>
+ void
+ generate_switch(RandomAccessIterator begin, RandomAccessIterator end,
+ Generator gen, random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism_tag
+ = __gnu_parallel::parallel_balanced)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end - begin)
+ >= __gnu_parallel::_Settings::get().generate_minimal_n
+ && __gnu_parallel::is_parallel(parallelism_tag)))
+ {
+ bool dummy;
+ __gnu_parallel::generate_selector<RandomAccessIterator>
+ functionality;
+ __gnu_parallel::
+ for_each_template_random_access(begin, end, gen, functionality,
+ __gnu_parallel::dummy_reduct(),
+ true, dummy, -1, parallelism_tag);
+ }
+ else
+ generate(begin, end, gen, __gnu_parallel::sequential_tag());
+ }
+
+ // Public interface.
+ template<typename ForwardIterator, typename Generator>
+ inline void
+ generate(ForwardIterator begin, ForwardIterator end,
+ Generator gen, __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef std::iterator_traits<ForwardIterator> iterator_traits;
+ typedef typename iterator_traits::iterator_category iterator_category;
+ generate_switch(begin, end, gen, iterator_category(), parallelism_tag);
+ }
+
+ template<typename ForwardIterator, typename Generator>
+ inline void
+ generate(ForwardIterator begin, ForwardIterator end, Generator gen)
+ {
+ typedef std::iterator_traits<ForwardIterator> iterator_traits;
+ typedef typename iterator_traits::iterator_category iterator_category;
+ generate_switch(begin, end, gen, iterator_category());
+ }
+
+
+ // Sequential fallback.
+ template<typename OutputIterator, typename Size, typename Generator>
+ inline OutputIterator
+ generate_n(OutputIterator begin, Size n, Generator gen,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::generate_n(begin, n, gen); }
+
+ // Sequential fallback for input iterator case.
+ template<typename OutputIterator, typename Size, typename Generator,
+ typename IteratorTag>
+ inline OutputIterator
+ generate_n_switch(OutputIterator begin, Size n, Generator gen, IteratorTag)
+ { return generate_n(begin, n, gen, __gnu_parallel::sequential_tag()); }
+
+ // Parallel algorithm for random access iterators.
+ template<typename RandomAccessIterator, typename Size, typename Generator>
+ inline RandomAccessIterator
+ generate_n_switch(RandomAccessIterator begin, Size n, Generator gen,
+ random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism_tag
+ = __gnu_parallel::parallel_balanced)
+ {
+ // XXX parallel version is where?
+ return generate_n(begin, n, gen, __gnu_parallel::sequential_tag());
+ }
+
+ // Public interface.
+ template<typename OutputIterator, typename Size, typename Generator>
+ inline OutputIterator
+ generate_n(OutputIterator begin, Size n, Generator gen,
+ __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef std::iterator_traits<OutputIterator> iterator_traits;
+ typedef typename iterator_traits::iterator_category iterator_category;
+ return generate_n_switch(begin, n, gen, iterator_category(),
+ parallelism_tag);
+ }
+
+ template<typename OutputIterator, typename Size, typename Generator>
+ inline OutputIterator
+ generate_n(OutputIterator begin, Size n, Generator gen)
+ {
+ typedef std::iterator_traits<OutputIterator> iterator_traits;
+ typedef typename iterator_traits::iterator_category iterator_category;
+ return generate_n_switch(begin, n, gen, iterator_category());
+ }
+
+
+ // Sequential fallback.
+ template<typename RandomAccessIterator>
+ inline void
+ random_shuffle(RandomAccessIterator begin, RandomAccessIterator end,
+ __gnu_parallel::sequential_tag)
+ { _GLIBCXX_STD_P::random_shuffle(begin, end); }
+
+ // Sequential fallback.
+ template<typename RandomAccessIterator, typename RandomNumberGenerator>
+ inline void
+ random_shuffle(RandomAccessIterator begin, RandomAccessIterator end,
+ RandomNumberGenerator& rand, __gnu_parallel::sequential_tag)
+ { _GLIBCXX_STD_P::random_shuffle(begin, end, rand); }
+
+
+ /** @brief Functor wrapper for std::rand(). */
+ template<typename must_be_int = int>
+ struct c_rand_number
+ {
+ int
+ operator()(int limit)
+ { return rand() % limit; }
+ };
+
+ // Fill in random number generator.
+ template<typename RandomAccessIterator>
+ inline void
+ random_shuffle(RandomAccessIterator begin, RandomAccessIterator end)
+ {
+ c_rand_number<> r;
+ // Parallelization still possible.
+ __gnu_parallel::random_shuffle(begin, end, r);
+ }
+
+ // Parallel algorithm for random access iterators.
+ template<typename RandomAccessIterator, typename RandomNumberGenerator>
+ void
+ random_shuffle(RandomAccessIterator begin, RandomAccessIterator end,
+ RandomNumberGenerator& rand)
+ {
+ if (begin == end)
+ return;
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end - begin)
+ >= __gnu_parallel::_Settings::get().random_shuffle_minimal_n))
+ __gnu_parallel::parallel_random_shuffle(begin, end, rand);
+ else
+ __gnu_parallel::sequential_random_shuffle(begin, end, rand);
+ }
+
+ // Sequential fallback.
+ template<typename ForwardIterator, typename Predicate>
+ inline ForwardIterator
+ partition(ForwardIterator begin, ForwardIterator end,
+ Predicate pred, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::partition(begin, end, pred); }
+
+ // Sequential fallback for input iterator case.
+ template<typename ForwardIterator, typename Predicate, typename IteratorTag>
+ inline ForwardIterator
+ partition_switch(ForwardIterator begin, ForwardIterator end,
+ Predicate pred, IteratorTag)
+ { return partition(begin, end, pred, __gnu_parallel::sequential_tag()); }
+
+ // Parallel algorithm for random access iterators.
+ template<typename RandomAccessIterator, typename Predicate>
+ RandomAccessIterator
+ partition_switch(RandomAccessIterator begin, RandomAccessIterator end,
+ Predicate pred, random_access_iterator_tag)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end - begin)
+ >= __gnu_parallel::_Settings::get().partition_minimal_n))
+ {
+ typedef typename std::iterator_traits<RandomAccessIterator>::
+ difference_type difference_type;
+ difference_type middle = __gnu_parallel::
+ parallel_partition(begin, end, pred,
+ __gnu_parallel::get_max_threads());
+ return begin + middle;
+ }
+ else
+ return partition(begin, end, pred, __gnu_parallel::sequential_tag());
+ }
+
+ // Public interface.
+ template<typename ForwardIterator, typename Predicate>
+ inline ForwardIterator
+ partition(ForwardIterator begin, ForwardIterator end, Predicate pred)
+ {
+ typedef iterator_traits<ForwardIterator> traits_type;
+ typedef typename traits_type::iterator_category iterator_category;
+ return partition_switch(begin, end, pred, iterator_category());
+ }
+
+ // sort interface
+
+ // Sequential fallback
+ template<typename RandomAccessIterator>
+ inline void
+ sort(RandomAccessIterator begin, RandomAccessIterator end,
+ __gnu_parallel::sequential_tag)
+ { _GLIBCXX_STD_P::sort(begin, end); }
+
+ // Sequential fallback
+ template<typename RandomAccessIterator, typename Comparator>
+ inline void
+ sort(RandomAccessIterator begin, RandomAccessIterator end, Comparator comp,
+ __gnu_parallel::sequential_tag)
+ { _GLIBCXX_STD_P::sort<RandomAccessIterator, Comparator>(begin, end,
+ comp); }
+
+ // Public interface
+ template<typename RandomAccessIterator, typename Comparator,
+ typename Parallelism>
+ void
+ sort(RandomAccessIterator begin, RandomAccessIterator end, Comparator comp,
+ Parallelism parallelism)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+
+ if (begin != end)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end - begin) >=
+ __gnu_parallel::_Settings::get().sort_minimal_n))
+ __gnu_parallel::parallel_sort<false>(begin, end, comp, parallelism);
+ else
+ sort(begin, end, comp, __gnu_parallel::sequential_tag());
+ }
+ }
+
+ // Public interface, insert default comparator
+ template<typename RandomAccessIterator>
+ inline void
+ sort(RandomAccessIterator begin, RandomAccessIterator end)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ sort(begin, end, std::less<value_type>(),
+ __gnu_parallel::default_parallel_tag());
+ }
+
+ // Public interface, insert default comparator
+ template<typename RandomAccessIterator>
+ inline void
+ sort(RandomAccessIterator begin, RandomAccessIterator end,
+ __gnu_parallel::default_parallel_tag parallelism)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ sort(begin, end, std::less<value_type>(), parallelism);
+ }
+
+ // Public interface, insert default comparator
+ template<typename RandomAccessIterator>
+ inline void
+ sort(RandomAccessIterator begin, RandomAccessIterator end,
+ __gnu_parallel::parallel_tag parallelism)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ sort(begin, end, std::less<value_type>(), parallelism);
+ }
+
+ // Public interface, insert default comparator
+ template<typename RandomAccessIterator>
+ inline void
+ sort(RandomAccessIterator begin, RandomAccessIterator end,
+ __gnu_parallel::multiway_mergesort_tag parallelism)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ sort(begin, end, std::less<value_type>(), parallelism);
+ }
+
+ // Public interface, insert default comparator
+ template<typename RandomAccessIterator>
+ inline void
+ sort(RandomAccessIterator begin, RandomAccessIterator end,
+ __gnu_parallel::multiway_mergesort_sampling_tag parallelism)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ sort(begin, end, std::less<value_type>(), parallelism);
+ }
+
+ // Public interface, insert default comparator
+ template<typename RandomAccessIterator>
+ inline void
+ sort(RandomAccessIterator begin, RandomAccessIterator end,
+ __gnu_parallel::multiway_mergesort_exact_tag parallelism)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ sort(begin, end, std::less<value_type>(), parallelism);
+ }
+
+ // Public interface, insert default comparator
+ template<typename RandomAccessIterator>
+ inline void
+ sort(RandomAccessIterator begin, RandomAccessIterator end,
+ __gnu_parallel::quicksort_tag parallelism)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ sort(begin, end, std::less<value_type>(), parallelism);
+ }
+
+ // Public interface, insert default comparator
+ template<typename RandomAccessIterator>
+ inline void
+ sort(RandomAccessIterator begin, RandomAccessIterator end,
+ __gnu_parallel::balanced_quicksort_tag parallelism)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ sort(begin, end, std::less<value_type>(), parallelism);
+ }
+
+ // Public interface
+ template<typename RandomAccessIterator, typename Comparator>
+ void
+ sort(RandomAccessIterator begin, RandomAccessIterator end, Comparator comp)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ sort(begin, end, comp, __gnu_parallel::default_parallel_tag());
+ }
+
+
+ // stable_sort interface
+
+
+ // Sequential fallback
+ template<typename RandomAccessIterator>
+ inline void
+ stable_sort(RandomAccessIterator begin, RandomAccessIterator end,
+ __gnu_parallel::sequential_tag)
+ { _GLIBCXX_STD_P::stable_sort(begin, end); }
+
+ // Sequential fallback
+ template<typename RandomAccessIterator, typename Comparator>
+ inline void
+ stable_sort(RandomAccessIterator begin, RandomAccessIterator end,
+ Comparator comp, __gnu_parallel::sequential_tag)
+ { _GLIBCXX_STD_P::stable_sort<RandomAccessIterator, Comparator>(
+ begin, end, comp); }
+
+ // Public interface
+ template<typename RandomAccessIterator, typename Comparator,
+ typename Parallelism>
+ void
+ stable_sort(RandomAccessIterator begin, RandomAccessIterator end,
+ Comparator comp, Parallelism parallelism)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+
+ if (begin != end)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end - begin) >=
+ __gnu_parallel::_Settings::get().sort_minimal_n))
+ __gnu_parallel::parallel_sort<true>(begin, end, comp, parallelism);
+ else
+ stable_sort(begin, end, comp, __gnu_parallel::sequential_tag());
+ }
+ }
+
+ // Public interface, insert default comparator
+ template<typename RandomAccessIterator>
+ inline void
+ stable_sort(RandomAccessIterator begin, RandomAccessIterator end)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ stable_sort(begin, end, std::less<value_type>(),
+ __gnu_parallel::default_parallel_tag());
+ }
+
+ // Public interface, insert default comparator
+ template<typename RandomAccessIterator>
+ inline void
+ stable_sort(RandomAccessIterator begin, RandomAccessIterator end,
+ __gnu_parallel::default_parallel_tag parallelism)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ stable_sort(begin, end, std::less<value_type>(), parallelism);
+ }
+
+ // Public interface, insert default comparator
+ template<typename RandomAccessIterator>
+ inline void
+ stable_sort(RandomAccessIterator begin, RandomAccessIterator end,
+ __gnu_parallel::parallel_tag parallelism)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ stable_sort(begin, end, std::less<value_type>(), parallelism);
+ }
+
+ // Public interface, insert default comparator
+ template<typename RandomAccessIterator>
+ inline void
+ stable_sort(RandomAccessIterator begin, RandomAccessIterator end,
+ __gnu_parallel::multiway_mergesort_tag parallelism)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ stable_sort(begin, end, std::less<value_type>(), parallelism);
+ }
+
+ // Public interface, insert default comparator
+ template<typename RandomAccessIterator>
+ inline void
+ stable_sort(RandomAccessIterator begin, RandomAccessIterator end,
+ __gnu_parallel::quicksort_tag parallelism)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ stable_sort(begin, end, std::less<value_type>(), parallelism);
+ }
+
+ // Public interface, insert default comparator
+ template<typename RandomAccessIterator>
+ inline void
+ stable_sort(RandomAccessIterator begin, RandomAccessIterator end,
+ __gnu_parallel::balanced_quicksort_tag parallelism)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ stable_sort(begin, end, std::less<value_type>(), parallelism);
+ }
+
+ // Public interface
+ template<typename RandomAccessIterator, typename Comparator>
+ void
+ stable_sort(RandomAccessIterator begin, RandomAccessIterator end,
+ Comparator comp)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ stable_sort(begin, end, comp, __gnu_parallel::default_parallel_tag());
+ }
+
+
+// // Sequential fallback
+// template<typename RandomAccessIterator>
+// inline void
+// stable_sort(RandomAccessIterator begin, RandomAccessIterator end,
+// __gnu_parallel::sequential_tag)
+// { return _GLIBCXX_STD_P::stable_sort(begin, end); }
+//
+// // Sequential fallback
+// template<typename RandomAccessIterator, typename Comparator>
+// inline void
+// stable_sort(RandomAccessIterator begin, RandomAccessIterator end,
+// Comparator comp, __gnu_parallel::sequential_tag)
+// { return _GLIBCXX_STD_P::stable_sort(begin, end, comp); }
+//
+// template<typename RandomAccessIterator>
+// void
+// stable_sort(RandomAccessIterator begin, RandomAccessIterator end)
+// {
+// typedef iterator_traits<RandomAccessIterator> traits_type;
+// typedef typename traits_type::value_type value_type;
+// stable_sort(begin, end, std::less<value_type>());
+// }
+//
+// // Parallel algorithm for random access iterators
+// template<typename RandomAccessIterator, typename Comparator>
+// void
+// stable_sort(RandomAccessIterator begin, RandomAccessIterator end,
+// Comparator comp)
+// {
+// if (begin != end)
+// {
+// if (_GLIBCXX_PARALLEL_CONDITION(
+// static_cast<__gnu_parallel::sequence_index_t>(end - begin) >=
+// __gnu_parallel::_Settings::get().sort_minimal_n))
+// __gnu_parallel::parallel_sort(begin, end, comp,
+// __gnu_parallel::parallel_tag());
+// else
+// stable_sort(begin, end, comp, __gnu_parallel::sequential_tag());
+// }
+// }
+
+ // Sequential fallback
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator>
+ inline OutputIterator
+ merge(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2,
+ InputIterator2 end2, OutputIterator result,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::merge(begin1, end1, begin2, end2, result); }
+
+ // Sequential fallback
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator, typename Comparator>
+ inline OutputIterator
+ merge(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2,
+ InputIterator2 end2, OutputIterator result, Comparator comp,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::merge(begin1, end1, begin2, end2, result, comp); }
+
+ // Sequential fallback for input iterator case
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator, typename Comparator,
+ typename IteratorTag1, typename IteratorTag2, typename IteratorTag3>
+ inline OutputIterator
+ merge_switch(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator result, Comparator comp,
+ IteratorTag1, IteratorTag2, IteratorTag3)
+ { return _GLIBCXX_STD_P::merge(begin1, end1, begin2, end2,
+ result, comp); }
+
+ // Parallel algorithm for random access iterators
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator, typename Comparator>
+ OutputIterator
+ merge_switch(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator result, Comparator comp,
+ random_access_iterator_tag, random_access_iterator_tag,
+ random_access_iterator_tag)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ (static_cast<__gnu_parallel::sequence_index_t>(end1 - begin1)
+ >= __gnu_parallel::_Settings::get().merge_minimal_n
+ || static_cast<__gnu_parallel::sequence_index_t>(end2 - begin2)
+ >= __gnu_parallel::_Settings::get().merge_minimal_n)))
+ return __gnu_parallel::parallel_merge_advance(begin1, end1,
+ begin2, end2,
+ result, (end1 - begin1)
+ + (end2 - begin2), comp);
+ else
+ return __gnu_parallel::merge_advance(begin1, end1, begin2, end2,
+ result, (end1 - begin1)
+ + (end2 - begin2), comp);
+ }
+
+ // Public interface
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator, typename Comparator>
+ inline OutputIterator
+ merge(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2,
+ InputIterator2 end2, OutputIterator result, Comparator comp)
+ {
+ typedef typename iterator_traits<InputIterator1>::value_type value_type;
+
+ typedef std::iterator_traits<InputIterator1> iteratori1_traits;
+ typedef std::iterator_traits<InputIterator2> iteratori2_traits;
+ typedef std::iterator_traits<OutputIterator> iteratoro_traits;
+ typedef typename iteratori1_traits::iterator_category
+ iteratori1_category;
+ typedef typename iteratori2_traits::iterator_category
+ iteratori2_category;
+ typedef typename iteratoro_traits::iterator_category iteratoro_category;
+
+ return merge_switch(begin1, end1, begin2, end2, result, comp,
+ iteratori1_category(), iteratori2_category(),
+ iteratoro_category());
+ }
+
+
+ // Public interface, insert default comparator
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator>
+ inline OutputIterator
+ merge(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2,
+ InputIterator2 end2, OutputIterator result)
+ {
+ typedef std::iterator_traits<InputIterator1> iterator1_traits;
+ typedef std::iterator_traits<InputIterator2> iterator2_traits;
+ typedef typename iterator1_traits::value_type value1_type;
+ typedef typename iterator2_traits::value_type value2_type;
+
+ return merge(begin1, end1, begin2, end2, result,
+ __gnu_parallel::less<value1_type, value2_type>());
+ }
+
+ // Sequential fallback
+ template<typename RandomAccessIterator>
+ inline void
+ nth_element(RandomAccessIterator begin, RandomAccessIterator nth,
+ RandomAccessIterator end, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::nth_element(begin, nth, end); }
+
+ // Sequential fallback
+ template<typename RandomAccessIterator, typename Comparator>
+ inline void
+ nth_element(RandomAccessIterator begin, RandomAccessIterator nth,
+ RandomAccessIterator end, Comparator comp,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::nth_element(begin, nth, end, comp); }
+
+ // Public interface
+ template<typename RandomAccessIterator, typename Comparator>
+ inline void
+ nth_element(RandomAccessIterator begin, RandomAccessIterator nth,
+ RandomAccessIterator end, Comparator comp)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end - begin)
+ >= __gnu_parallel::_Settings::get().nth_element_minimal_n))
+ __gnu_parallel::parallel_nth_element(begin, nth, end, comp);
+ else
+ nth_element(begin, nth, end, comp, __gnu_parallel::sequential_tag());
+ }
+
+ // Public interface, insert default comparator
+ template<typename RandomAccessIterator>
+ inline void
+ nth_element(RandomAccessIterator begin, RandomAccessIterator nth,
+ RandomAccessIterator end)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ nth_element(begin, nth, end, std::less<value_type>());
+ }
+
+ // Sequential fallback
+ template<typename RandomAccessIterator, typename _Compare>
+ inline void
+ partial_sort(RandomAccessIterator begin, RandomAccessIterator middle,
+ RandomAccessIterator end, _Compare comp,
+ __gnu_parallel::sequential_tag)
+ { _GLIBCXX_STD_P::partial_sort(begin, middle, end, comp); }
+
+ // Sequential fallback
+ template<typename RandomAccessIterator>
+ inline void
+ partial_sort(RandomAccessIterator begin, RandomAccessIterator middle,
+ RandomAccessIterator end, __gnu_parallel::sequential_tag)
+ { _GLIBCXX_STD_P::partial_sort(begin, middle, end); }
+
+ // Public interface, parallel algorithm for random access iterators
+ template<typename RandomAccessIterator, typename _Compare>
+ void
+ partial_sort(RandomAccessIterator begin, RandomAccessIterator middle,
+ RandomAccessIterator end, _Compare comp)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end - begin)
+ >= __gnu_parallel::_Settings::get().partial_sort_minimal_n))
+ __gnu_parallel::parallel_partial_sort(begin, middle, end, comp);
+ else
+ partial_sort(begin, middle, end, comp,
+ __gnu_parallel::sequential_tag());
+ }
+
+ // Public interface, insert default comparator
+ template<typename RandomAccessIterator>
+ inline void
+ partial_sort(RandomAccessIterator begin, RandomAccessIterator middle,
+ RandomAccessIterator end)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ partial_sort(begin, middle, end, std::less<value_type>());
+ }
+
+ // Sequential fallback
+ template<typename ForwardIterator>
+ inline ForwardIterator
+ max_element(ForwardIterator begin, ForwardIterator end,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::max_element(begin, end); }
+
+ // Sequential fallback
+ template<typename ForwardIterator, typename Comparator>
+ inline ForwardIterator
+ max_element(ForwardIterator begin, ForwardIterator end, Comparator comp,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::max_element(begin, end, comp); }
+
+ // Sequential fallback for input iterator case
+ template<typename ForwardIterator, typename Comparator, typename IteratorTag>
+ inline ForwardIterator
+ max_element_switch(ForwardIterator begin, ForwardIterator end,
+ Comparator comp, IteratorTag)
+ { return max_element(begin, end, comp, __gnu_parallel::sequential_tag()); }
+
+ // Parallel algorithm for random access iterators
+ template<typename RandomAccessIterator, typename Comparator>
+ RandomAccessIterator
+ max_element_switch(RandomAccessIterator begin, RandomAccessIterator end,
+ Comparator comp, random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism_tag
+ = __gnu_parallel::parallel_balanced)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end - begin)
+ >= __gnu_parallel::_Settings::get().max_element_minimal_n
+ && __gnu_parallel::is_parallel(parallelism_tag)))
+ {
+ RandomAccessIterator res(begin);
+ __gnu_parallel::identity_selector<RandomAccessIterator>
+ functionality;
+ __gnu_parallel::
+ for_each_template_random_access(begin, end,
+ __gnu_parallel::nothing(),
+ functionality,
+ __gnu_parallel::
+ max_element_reduct<Comparator,
+ RandomAccessIterator>(comp),
+ res, res, -1, parallelism_tag);
+ return res;
+ }
+ else
+ return max_element(begin, end, comp, __gnu_parallel::sequential_tag());
+ }
+
+ // Public interface, insert default comparator
+ template<typename ForwardIterator>
+ inline ForwardIterator
+ max_element(ForwardIterator begin, ForwardIterator end,
+ __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef typename iterator_traits<ForwardIterator>::value_type value_type;
+ return max_element(begin, end, std::less<value_type>(), parallelism_tag);
+ }
+
+ template<typename ForwardIterator>
+ inline ForwardIterator
+ max_element(ForwardIterator begin, ForwardIterator end)
+ {
+ typedef typename iterator_traits<ForwardIterator>::value_type value_type;
+ return max_element(begin, end, std::less<value_type>());
+ }
+
+ // Public interface
+ template<typename ForwardIterator, typename Comparator>
+ inline ForwardIterator
+ max_element(ForwardIterator begin, ForwardIterator end, Comparator comp,
+ __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef iterator_traits<ForwardIterator> traits_type;
+ typedef typename traits_type::iterator_category iterator_category;
+ return max_element_switch(begin, end, comp, iterator_category(),
+ parallelism_tag);
+ }
+
+ template<typename ForwardIterator, typename Comparator>
+ inline ForwardIterator
+ max_element(ForwardIterator begin, ForwardIterator end, Comparator comp)
+ {
+ typedef iterator_traits<ForwardIterator> traits_type;
+ typedef typename traits_type::iterator_category iterator_category;
+ return max_element_switch(begin, end, comp, iterator_category());
+ }
+
+
+ // Sequential fallback
+ template<typename ForwardIterator>
+ inline ForwardIterator
+ min_element(ForwardIterator begin, ForwardIterator end,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::min_element(begin, end); }
+
+ // Sequential fallback
+ template<typename ForwardIterator, typename Comparator>
+ inline ForwardIterator
+ min_element(ForwardIterator begin, ForwardIterator end, Comparator comp,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::min_element(begin, end, comp); }
+
+ // Sequential fallback for input iterator case
+ template<typename ForwardIterator, typename Comparator, typename IteratorTag>
+ inline ForwardIterator
+ min_element_switch(ForwardIterator begin, ForwardIterator end,
+ Comparator comp, IteratorTag)
+ { return min_element(begin, end, comp, __gnu_parallel::sequential_tag()); }
+
+ // Parallel algorithm for random access iterators
+ template<typename RandomAccessIterator, typename Comparator>
+ RandomAccessIterator
+ min_element_switch(RandomAccessIterator begin, RandomAccessIterator end,
+ Comparator comp, random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism_tag
+ = __gnu_parallel::parallel_balanced)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end - begin)
+ >= __gnu_parallel::_Settings::get().min_element_minimal_n
+ && __gnu_parallel::is_parallel(parallelism_tag)))
+ {
+ RandomAccessIterator res(begin);
+ __gnu_parallel::identity_selector<RandomAccessIterator>
+ functionality;
+ __gnu_parallel::
+ for_each_template_random_access(begin, end,
+ __gnu_parallel::nothing(),
+ functionality,
+ __gnu_parallel::
+ min_element_reduct<Comparator,
+ RandomAccessIterator>(comp),
+ res, res, -1, parallelism_tag);
+ return res;
+ }
+ else
+ return min_element(begin, end, comp, __gnu_parallel::sequential_tag());
+ }
+
+ // Public interface, insert default comparator
+ template<typename ForwardIterator>
+ inline ForwardIterator
+ min_element(ForwardIterator begin, ForwardIterator end,
+ __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef typename iterator_traits<ForwardIterator>::value_type value_type;
+ return min_element(begin, end, std::less<value_type>(), parallelism_tag);
+ }
+
+ template<typename ForwardIterator>
+ inline ForwardIterator
+ min_element(ForwardIterator begin, ForwardIterator end)
+ {
+ typedef typename iterator_traits<ForwardIterator>::value_type value_type;
+ return min_element(begin, end, std::less<value_type>());
+ }
+
+ // Public interface
+ template<typename ForwardIterator, typename Comparator>
+ inline ForwardIterator
+ min_element(ForwardIterator begin, ForwardIterator end, Comparator comp,
+ __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef iterator_traits<ForwardIterator> traits_type;
+ typedef typename traits_type::iterator_category iterator_category;
+ return min_element_switch(begin, end, comp, iterator_category(),
+ parallelism_tag);
+ }
+
+ template<typename ForwardIterator, typename Comparator>
+ inline ForwardIterator
+ min_element(ForwardIterator begin, ForwardIterator end, Comparator comp)
+ {
+ typedef iterator_traits<ForwardIterator> traits_type;
+ typedef typename traits_type::iterator_category iterator_category;
+ return min_element_switch(begin, end, comp, iterator_category());
+ }
+} // end namespace
+} // end namespace
+
+#endif /* _GLIBCXX_PARALLEL_ALGO_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/algobase.h b/i686-linux/include/c++/4.4.3/parallel/algobase.h
new file mode 100644
index 0000000..aaffb3e
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/algobase.h
@@ -0,0 +1,281 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/algobase.h
+ * @brief Parallel STL function calls corresponding to the
+ * stl_algobase.h header. The functions defined here mainly do case
+ * switches and call the actual parallelized versions in other files.
+ * Inlining policy: Functions that basically only contain one
+ * function call, are declared inline.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler and Felix Putze.
+
+#ifndef _GLIBCXX_PARALLEL_ALGOBASE_H
+#define _GLIBCXX_PARALLEL_ALGOBASE_H 1
+
+#include <bits/stl_algobase.h>
+#include <parallel/base.h>
+#include <parallel/tags.h>
+#include <parallel/settings.h>
+#include <parallel/find.h>
+#include <parallel/find_selectors.h>
+
+namespace std
+{
+namespace __parallel
+{
+ // NB: equal and lexicographical_compare require mismatch.
+
+ // Sequential fallback
+ template<typename InputIterator1, typename InputIterator2>
+ inline pair<InputIterator1, InputIterator2>
+ mismatch(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::mismatch(begin1, end1, begin2); }
+
+ // Sequential fallback
+ template<typename InputIterator1, typename InputIterator2,
+ typename Predicate>
+ inline pair<InputIterator1, InputIterator2>
+ mismatch(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2,
+ Predicate pred, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::mismatch(begin1, end1, begin2, pred); }
+
+ // Sequential fallback for input iterator case
+ template<typename InputIterator1, typename InputIterator2,
+ typename Predicate, typename IteratorTag1, typename IteratorTag2>
+ inline pair<InputIterator1, InputIterator2>
+ mismatch_switch(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, Predicate pred, IteratorTag1,
+ IteratorTag2)
+ { return _GLIBCXX_STD_P::mismatch(begin1, end1, begin2, pred); }
+
+ // Parallel mismatch for random access iterators
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename Predicate>
+ pair<RandomAccessIterator1, RandomAccessIterator2>
+ mismatch_switch(RandomAccessIterator1 begin1, RandomAccessIterator1 end1,
+ RandomAccessIterator2 begin2, Predicate pred,
+ random_access_iterator_tag, random_access_iterator_tag)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(true))
+ {
+ RandomAccessIterator1 res =
+ __gnu_parallel::find_template(begin1, end1, begin2, pred,
+ __gnu_parallel::
+ mismatch_selector()).first;
+ return make_pair(res , begin2 + (res - begin1));
+ }
+ else
+ return _GLIBCXX_STD_P::mismatch(begin1, end1, begin2, pred);
+ }
+
+ // Public interface
+ template<typename InputIterator1, typename InputIterator2>
+ inline pair<InputIterator1, InputIterator2>
+ mismatch(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2)
+ {
+ typedef std::iterator_traits<InputIterator1> iterator1_traits;
+ typedef std::iterator_traits<InputIterator2> iterator2_traits;
+ typedef typename iterator1_traits::value_type value1_type;
+ typedef typename iterator2_traits::value_type value2_type;
+ typedef typename iterator1_traits::iterator_category iterator1_category;
+ typedef typename iterator2_traits::iterator_category iterator2_category;
+
+ typedef __gnu_parallel::equal_to<value1_type, value2_type> equal_to_type;
+
+ return mismatch_switch(begin1, end1, begin2, equal_to_type(),
+ iterator1_category(), iterator2_category());
+ }
+
+ // Public interface
+ template<typename InputIterator1, typename InputIterator2,
+ typename Predicate>
+ inline pair<InputIterator1, InputIterator2>
+ mismatch(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2,
+ Predicate pred)
+ {
+ typedef std::iterator_traits<InputIterator1> iterator1_traits;
+ typedef std::iterator_traits<InputIterator2> iterator2_traits;
+ typedef typename iterator1_traits::iterator_category iterator1_category;
+ typedef typename iterator2_traits::iterator_category iterator2_category;
+
+ return mismatch_switch(begin1, end1, begin2, pred, iterator1_category(),
+ iterator2_category());
+ }
+
+ // Sequential fallback
+ template<typename InputIterator1, typename InputIterator2>
+ inline bool
+ equal(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::equal(begin1, end1, begin2); }
+
+ // Sequential fallback
+ template<typename InputIterator1, typename InputIterator2,
+ typename Predicate>
+ inline bool
+ equal(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2,
+ Predicate pred, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::equal(begin1, end1, begin2, pred); }
+
+ // Public interface
+ template<typename InputIterator1, typename InputIterator2>
+ inline bool
+ equal(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2)
+ { return mismatch(begin1, end1, begin2).first == end1; }
+
+ // Public interface
+ template<typename InputIterator1, typename InputIterator2,
+ typename Predicate>
+ inline bool
+ equal(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2,
+ Predicate pred)
+ { return mismatch(begin1, end1, begin2, pred).first == end1; }
+
+ // Sequential fallback
+ template<typename InputIterator1, typename InputIterator2>
+ inline bool
+ lexicographical_compare(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::lexicographical_compare(begin1, end1,
+ begin2, end2); }
+
+ // Sequential fallback
+ template<typename InputIterator1, typename InputIterator2,
+ typename Predicate>
+ inline bool
+ lexicographical_compare(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ Predicate pred, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::lexicographical_compare(begin1, end1,
+ begin2, end2, pred); }
+
+ // Sequential fallback for input iterator case
+ template<typename InputIterator1, typename InputIterator2,
+ typename Predicate, typename IteratorTag1, typename IteratorTag2>
+ inline bool
+ lexicographical_compare_switch(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ Predicate pred, IteratorTag1, IteratorTag2)
+ { return _GLIBCXX_STD_P::lexicographical_compare(begin1, end1,
+ begin2, end2, pred); }
+
+ // Parallel lexicographical_compare for random access iterators
+ // Limitation: Both valuetypes must be the same
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename Predicate>
+ bool
+ lexicographical_compare_switch(RandomAccessIterator1 begin1,
+ RandomAccessIterator1 end1,
+ RandomAccessIterator2 begin2,
+ RandomAccessIterator2 end2, Predicate pred,
+ random_access_iterator_tag,
+ random_access_iterator_tag)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(true))
+ {
+ typedef iterator_traits<RandomAccessIterator1> traits1_type;
+ typedef typename traits1_type::value_type value1_type;
+
+ typedef iterator_traits<RandomAccessIterator2> traits2_type;
+ typedef typename traits2_type::value_type value2_type;
+
+ typedef __gnu_parallel::equal_from_less<Predicate, value1_type,
+ value2_type> equal_type;
+
+ // Longer sequence in first place.
+ if ((end1 - begin1) < (end2 - begin2))
+ {
+ typedef pair<RandomAccessIterator1, RandomAccessIterator2>
+ pair_type;
+ pair_type mm = mismatch_switch(begin1, end1, begin2,
+ equal_type(pred),
+ random_access_iterator_tag(),
+ random_access_iterator_tag());
+
+ return (mm.first == end1) || bool(pred(*mm.first, *mm.second));
+ }
+ else
+ {
+ typedef pair<RandomAccessIterator2, RandomAccessIterator1>
+ pair_type;
+ pair_type mm = mismatch_switch(begin2, end2, begin1,
+ equal_type(pred),
+ random_access_iterator_tag(),
+ random_access_iterator_tag());
+
+ return (mm.first != end2) && bool(pred(*mm.second, *mm.first));
+ }
+ }
+ else
+ return _GLIBCXX_STD_P::lexicographical_compare(begin1, end1,
+ begin2, end2, pred);
+ }
+
+ // Public interface
+ template<typename InputIterator1, typename InputIterator2>
+ inline bool
+ lexicographical_compare(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2)
+ {
+ typedef iterator_traits<InputIterator1> traits1_type;
+ typedef typename traits1_type::value_type value1_type;
+ typedef typename traits1_type::iterator_category iterator1_category;
+
+ typedef iterator_traits<InputIterator2> traits2_type;
+ typedef typename traits2_type::value_type value2_type;
+ typedef typename traits2_type::iterator_category iterator2_category;
+ typedef __gnu_parallel::less<value1_type, value2_type> less_type;
+
+ return lexicographical_compare_switch(begin1, end1, begin2, end2,
+ less_type(), iterator1_category(),
+ iterator2_category());
+ }
+
+ // Public interface
+ template<typename InputIterator1, typename InputIterator2,
+ typename Predicate>
+ inline bool
+ lexicographical_compare(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ Predicate pred)
+ {
+ typedef iterator_traits<InputIterator1> traits1_type;
+ typedef typename traits1_type::iterator_category iterator1_category;
+
+ typedef iterator_traits<InputIterator2> traits2_type;
+ typedef typename traits2_type::iterator_category iterator2_category;
+
+ return lexicographical_compare_switch(begin1, end1, begin2, end2, pred,
+ iterator1_category(),
+ iterator2_category());
+ }
+} // end namespace
+} // end namespace
+
+#endif /* _GLIBCXX_PARALLEL_ALGOBASE_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/algorithm b/i686-linux/include/c++/4.4.3/parallel/algorithm
new file mode 100644
index 0000000..3c93d5b
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/algorithm
@@ -0,0 +1,40 @@
+// Algorithm extensions -*- C++ -*-
+
+// Copyright (C) 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/algorithm
+ * This file is a GNU extension to the Standard C++ Library.
+ */
+
+#ifndef _PARALLEL_ALGORITHM
+#define _PARALLEL_ALGORITHM 1
+
+#pragma GCC system_header
+
+#include <algorithm>
+#include <parallel/algorithmfwd.h>
+#include <parallel/algobase.h>
+#include <parallel/algo.h>
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/parallel/algorithmfwd.h b/i686-linux/include/c++/4.4.3/parallel/algorithmfwd.h
new file mode 100644
index 0000000..7c3b3f2
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/algorithmfwd.h
@@ -0,0 +1,898 @@
+// <algorithm> parallel extensions -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/algorithmfwd.h
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_PARALLEL_ALGORITHMFWD_H
+#define _GLIBCXX_PARALLEL_ALGORITHMFWD_H 1
+
+#pragma GCC system_header
+
+#include <parallel/tags.h>
+#include <parallel/settings.h>
+
+namespace std
+{
+namespace __parallel
+{
+ template<typename _FIter>
+ _FIter
+ adjacent_find(_FIter, _FIter);
+
+ template<typename _FIter>
+ _FIter
+ adjacent_find(_FIter, _FIter, __gnu_parallel::sequential_tag);
+
+ template<typename _FIter, typename _IterTag>
+ _FIter
+ adjacent_find_switch(_FIter, _FIter, _IterTag);
+
+ template<typename _RAIter>
+ _RAIter
+ adjacent_find_switch(_RAIter, _RAIter, random_access_iterator_tag);
+
+
+ template<typename _FIter, typename _BiPredicate>
+ _FIter
+ adjacent_find(_FIter, _FIter, _BiPredicate);
+
+ template<typename _FIter, typename _BiPredicate>
+ _FIter
+ adjacent_find(_FIter, _FIter, _BiPredicate,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _FIter, typename _BiPredicate, typename _IterTag>
+ _FIter
+ adjacent_find_switch(_FIter, _FIter, _BiPredicate, _IterTag);
+
+ template<typename _RAIter, typename _BiPredicate>
+ _RAIter
+ adjacent_find_switch(_RAIter, _RAIter, _BiPredicate,
+ random_access_iterator_tag);
+
+
+ template<typename _IIter, typename _Tp>
+ typename iterator_traits<_IIter>::difference_type
+ count(_IIter, _IIter, const _Tp&);
+
+ template<typename _IIter, typename _Tp>
+ typename iterator_traits<_IIter>::difference_type
+ count(_IIter, _IIter, const _Tp&, __gnu_parallel::sequential_tag);
+
+ template<typename _IIter, typename _Tp>
+ typename iterator_traits<_IIter>::difference_type
+ count(_IIter, _IIter, const _Tp&, __gnu_parallel::_Parallelism);
+
+ template<typename _IIter, typename _Tp, typename _IterTag>
+ typename iterator_traits<_IIter>::difference_type
+ count_switch(_IIter, _IIter, const _Tp&, _IterTag);
+
+ template<typename _RAIter, typename _Tp>
+ typename iterator_traits<_RAIter>::difference_type
+ count_switch(_RAIter, _RAIter, const _Tp&, random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism
+ = __gnu_parallel::parallel_unbalanced);
+
+
+ template<typename _IIter, typename _Predicate>
+ typename iterator_traits<_IIter>::difference_type
+ count_if(_IIter, _IIter, _Predicate);
+
+ template<typename _IIter, typename _Predicate>
+ typename iterator_traits<_IIter>::difference_type
+ count_if(_IIter, _IIter, _Predicate, __gnu_parallel::sequential_tag);
+
+ template<typename _IIter, typename _Predicate>
+ typename iterator_traits<_IIter>::difference_type
+ count_if(_IIter, _IIter, _Predicate, __gnu_parallel::_Parallelism);
+
+ template<typename _IIter, typename _Predicate, typename _IterTag>
+ typename iterator_traits<_IIter>::difference_type
+ count_if_switch(_IIter, _IIter, _Predicate, _IterTag);
+
+ template<typename _RAIter, typename _Predicate>
+ typename iterator_traits<_RAIter>::difference_type
+ count_if_switch(_RAIter, _RAIter, _Predicate, random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism
+ = __gnu_parallel::parallel_unbalanced);
+
+ // algobase.h
+ template<typename _IIter1, typename _IIter2>
+ bool
+ equal(_IIter1, _IIter1, _IIter2, __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2, typename Predicate>
+ bool
+ equal(_IIter1, _IIter1, _IIter2, Predicate,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2>
+ bool
+ equal(_IIter1, _IIter1, _IIter2);
+
+ template<typename _IIter1, typename _IIter2, typename Predicate>
+ bool
+ equal(_IIter1, _IIter1, _IIter2, Predicate);
+
+ template<typename _IIter, typename _Tp>
+ _IIter
+ find(_IIter, _IIter, const _Tp&, __gnu_parallel::sequential_tag);
+
+ template<typename _IIter, typename _Tp>
+ _IIter
+ find(_IIter, _IIter, const _Tp& val);
+
+ template<typename _IIter, typename _Tp, typename _IterTag>
+ _IIter
+ find_switch(_IIter, _IIter, const _Tp&, _IterTag);
+
+ template<typename _RAIter, typename _Tp>
+ _RAIter
+ find_switch(_RAIter, _RAIter, const _Tp&, random_access_iterator_tag);
+
+ template<typename _IIter, typename _Predicate>
+ _IIter
+ find_if(_IIter, _IIter, _Predicate, __gnu_parallel::sequential_tag);
+
+ template<typename _IIter, typename _Predicate>
+ _IIter
+ find_if(_IIter, _IIter, _Predicate);
+
+ template<typename _IIter, typename _Predicate, typename _IterTag>
+ _IIter
+ find_if_switch(_IIter, _IIter, _Predicate, _IterTag);
+
+ template<typename _RAIter, typename _Predicate>
+ _RAIter
+ find_if_switch(_RAIter, _RAIter, _Predicate, random_access_iterator_tag);
+
+ template<typename _IIter, typename _FIter>
+ _IIter
+ find_first_of(_IIter, _IIter, _FIter, _FIter,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter, typename _FIter, typename _BiPredicate>
+ _IIter
+ find_first_of(_IIter, _IIter, _FIter, _FIter, _BiPredicate,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter, typename _FIter, typename _BiPredicate>
+ _IIter
+ find_first_of(_IIter, _IIter, _FIter, _FIter, _BiPredicate);
+
+ template<typename _IIter, typename _FIter>
+ _IIter
+ find_first_of(_IIter, _IIter, _FIter, _FIter);
+
+ template<typename _IIter, typename _FIter,
+ typename _IterTag1, typename _IterTag2>
+ _IIter
+ find_first_of_switch(_IIter, _IIter, _FIter, _FIter, _IterTag1, _IterTag2);
+
+ template<typename _RAIter, typename _FIter, typename _BiPredicate,
+ typename _IterTag>
+ _RAIter
+ find_first_of_switch(_RAIter, _RAIter, _FIter, _FIter, _BiPredicate,
+ random_access_iterator_tag, _IterTag);
+
+ template<typename _IIter, typename _FIter, typename _BiPredicate,
+ typename _IterTag1, typename _IterTag2>
+ _IIter
+ find_first_of_switch(_IIter, _IIter, _FIter, _FIter, _BiPredicate,
+ _IterTag1, _IterTag2);
+
+
+ template<typename _IIter, typename _Function>
+ _Function
+ for_each(_IIter, _IIter, _Function);
+
+ template<typename _IIter, typename _Function>
+ _Function
+ for_each(_IIter, _IIter, _Function, __gnu_parallel::sequential_tag);
+
+ template<typename _Iterator, typename _Function>
+ _Function
+ for_each(_Iterator, _Iterator, _Function, __gnu_parallel::_Parallelism);
+
+ template<typename _IIter, typename _Function, typename _IterTag>
+ _Function
+ for_each_switch(_IIter, _IIter, _Function, _IterTag);
+
+ template<typename _RAIter, typename _Function>
+ _Function
+ for_each_switch(_RAIter, _RAIter, _Function, random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism
+ = __gnu_parallel::parallel_balanced);
+
+
+ template<typename _FIter, typename _Generator>
+ void
+ generate(_FIter, _FIter, _Generator);
+
+ template<typename _FIter, typename _Generator>
+ void
+ generate(_FIter, _FIter, _Generator, __gnu_parallel::sequential_tag);
+
+ template<typename _FIter, typename _Generator>
+ void
+ generate(_FIter, _FIter, _Generator, __gnu_parallel::_Parallelism);
+
+ template<typename _FIter, typename _Generator, typename _IterTag>
+ void
+ generate_switch(_FIter, _FIter, _Generator, _IterTag);
+
+ template<typename _RAIter, typename _Generator>
+ void
+ generate_switch(_RAIter, _RAIter, _Generator, random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism
+ = __gnu_parallel::parallel_balanced);
+
+ template<typename _OIter, typename _Size, typename _Generator>
+ _OIter
+ generate_n(_OIter, _Size, _Generator);
+
+ template<typename _OIter, typename _Size, typename _Generator>
+ _OIter
+ generate_n(_OIter, _Size, _Generator, __gnu_parallel::sequential_tag);
+
+ template<typename _OIter, typename _Size, typename _Generator>
+ _OIter
+ generate_n(_OIter, _Size, _Generator, __gnu_parallel::_Parallelism);
+
+ template<typename _OIter, typename _Size, typename _Generator,
+ typename _IterTag>
+ _OIter
+ generate_n_switch(_OIter, _Size, _Generator, _IterTag);
+
+ template<typename _RAIter, typename _Size, typename _Generator>
+ _RAIter
+ generate_n_switch(_RAIter, _Size, _Generator, random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism
+ = __gnu_parallel::parallel_balanced);
+
+ template<typename _IIter1, typename _IIter2>
+ bool
+ lexicographical_compare(_IIter1, _IIter1, _IIter2, _IIter2,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2, typename _Predicate>
+ bool
+ lexicographical_compare(_IIter1, _IIter1, _IIter2, _IIter2, _Predicate,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2>
+ bool
+ lexicographical_compare(_IIter1, _IIter1, _IIter2, _IIter2);
+
+ template<typename _IIter1, typename _IIter2, typename _Predicate>
+ bool
+ lexicographical_compare(_IIter1, _IIter1, _IIter2, _IIter2, _Predicate);
+
+ template<typename _IIter1, typename _IIter2,
+ typename _Predicate, typename _IterTag1, typename _IterTag2>
+ bool
+ lexicographical_compare_switch(_IIter1, _IIter1, _IIter2, _IIter2,
+ _Predicate, _IterTag1, _IterTag2);
+
+ template<typename _RAIter1, typename _RAIter2, typename _Predicate>
+ bool
+ lexicographical_compare_switch(_RAIter1, _RAIter1, _RAIter2, _RAIter2,
+ _Predicate, random_access_iterator_tag,
+ random_access_iterator_tag);
+
+ // algo.h
+ template<typename _IIter1, typename _IIter2>
+ pair<_IIter1, _IIter2>
+ mismatch(_IIter1, _IIter1, _IIter2, __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2, typename _Predicate>
+ pair<_IIter1, _IIter2>
+ mismatch(_IIter1, _IIter1, _IIter2, _Predicate,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2>
+ pair<_IIter1, _IIter2>
+ mismatch(_IIter1, _IIter1, _IIter2);
+
+ template<typename _IIter1, typename _IIter2, typename _Predicate>
+ pair<_IIter1, _IIter2>
+ mismatch(_IIter1, _IIter1, _IIter2, _Predicate);
+
+ template<typename _IIter1, typename _IIter2, typename _Predicate,
+ typename _IterTag1, typename _IterTag2>
+ pair<_IIter1, _IIter2>
+ mismatch_switch(_IIter1, _IIter1, _IIter2, _Predicate,
+ _IterTag1, _IterTag2);
+
+ template<typename _RAIter1, typename _RAIter2, typename _Predicate>
+ pair<_RAIter1, _RAIter2>
+ mismatch_switch(_RAIter1, _RAIter1, _RAIter2, _Predicate,
+ random_access_iterator_tag, random_access_iterator_tag);
+
+ template<typename _FIter1, typename _FIter2>
+ _FIter1
+ search(_FIter1, _FIter1, _FIter2, _FIter2, __gnu_parallel::sequential_tag);
+
+ template<typename _FIter1, typename _FIter2>
+ _FIter1
+ search(_FIter1, _FIter1, _FIter2, _FIter2);
+
+ template<typename _FIter1, typename _FIter2, typename _BiPredicate>
+ _FIter1
+ search(_FIter1, _FIter1, _FIter2, _FIter2, _BiPredicate,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _FIter1, typename _FIter2, typename _BiPredicate>
+ _FIter1
+ search(_FIter1, _FIter1, _FIter2, _FIter2, _BiPredicate);
+
+ template<typename _RAIter1, typename _RAIter2>
+ _RAIter1
+ search_switch(_RAIter1, _RAIter1, _RAIter2, _RAIter2,
+ random_access_iterator_tag, random_access_iterator_tag);
+
+ template<typename _FIter1, typename _FIter2, typename _IterTag1,
+ typename _IterTag2>
+ _FIter1
+ search_switch(_FIter1, _FIter1, _FIter2, _FIter2, _IterTag1, _IterTag2);
+
+ template<typename _RAIter1, typename _RAIter2, typename _BiPredicate>
+ _RAIter1
+ search_switch(_RAIter1, _RAIter1, _RAIter2, _RAIter2, _BiPredicate,
+ random_access_iterator_tag, random_access_iterator_tag);
+
+ template<typename _FIter1, typename _FIter2, typename _BiPredicate,
+ typename _IterTag1, typename _IterTag2>
+ _FIter1
+ search_switch(_FIter1, _FIter1, _FIter2, _FIter2, _BiPredicate,
+ _IterTag1, _IterTag2);
+
+ template<typename _FIter, typename _Integer, typename _Tp>
+ _FIter
+ search_n(_FIter, _FIter, _Integer, const _Tp&,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _FIter, typename _Integer, typename _Tp,
+ typename _BiPredicate>
+ _FIter
+ search_n(_FIter, _FIter, _Integer, const _Tp&, _BiPredicate,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _FIter, typename _Integer, typename _Tp>
+ _FIter
+ search_n(_FIter, _FIter, _Integer, const _Tp&);
+
+ template<typename _FIter, typename _Integer, typename _Tp,
+ typename _BiPredicate>
+ _FIter
+ search_n(_FIter, _FIter, _Integer, const _Tp&, _BiPredicate);
+
+ template<typename _RAIter, typename _Integer, typename _Tp,
+ typename _BiPredicate>
+ _RAIter
+ search_n_switch(_RAIter, _RAIter, _Integer, const _Tp&,
+ _BiPredicate, random_access_iterator_tag);
+
+ template<typename _FIter, typename _Integer, typename _Tp,
+ typename _BiPredicate, typename _IterTag>
+ _FIter
+ search_n_switch(_FIter, _FIter, _Integer, const _Tp&,
+ _BiPredicate, _IterTag);
+
+
+ template<typename _IIter, typename _OIter, typename UnaryOperation>
+ _OIter
+ transform(_IIter, _IIter, _OIter, UnaryOperation);
+
+ template<typename _IIter, typename _OIter, typename UnaryOperation>
+ _OIter
+ transform(_IIter, _IIter, _OIter, UnaryOperation,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter, typename _OIter, typename UnaryOperation>
+ _OIter
+ transform(_IIter, _IIter, _OIter, UnaryOperation,
+ __gnu_parallel::_Parallelism);
+
+ template<typename _IIter, typename _OIter, typename UnaryOperation,
+ typename _IterTag1, typename _IterTag2>
+ _OIter
+ transform1_switch(_IIter, _IIter, _OIter, UnaryOperation,
+ _IterTag1, _IterTag2);
+
+
+ template<typename _RAIIter, typename _RAOIter, typename UnaryOperation>
+ _RAOIter
+ transform1_switch(_RAIIter, _RAIIter, _RAOIter, UnaryOperation,
+ random_access_iterator_tag, random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism
+ = __gnu_parallel::parallel_balanced);
+
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _BiOperation>
+ _OIter
+ transform(_IIter1, _IIter1, _IIter2, _OIter, _BiOperation);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _BiOperation>
+ _OIter
+ transform(_IIter1, _IIter1, _IIter2, _OIter, _BiOperation,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _BiOperation>
+ _OIter
+ transform(_IIter1, _IIter1, _IIter2, _OIter, _BiOperation,
+ __gnu_parallel::_Parallelism);
+
+ template<typename _RAIter1, typename _RAIter2, typename _RAIter3,
+ typename _BiOperation>
+ _RAIter3
+ transform2_switch(_RAIter1, _RAIter1, _RAIter2, _RAIter3, _BiOperation,
+ random_access_iterator_tag, random_access_iterator_tag,
+ random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism
+ = __gnu_parallel::parallel_balanced);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _BiOperation, typename _Tag1,
+ typename _Tag2, typename _Tag3>
+ _OIter
+ transform2_switch(_IIter1, _IIter1, _IIter2, _OIter, _BiOperation,
+ _Tag1, _Tag2, _Tag3);
+
+
+ template<typename _FIter, typename _Tp>
+ void
+ replace(_FIter, _FIter, const _Tp&, const _Tp&);
+
+ template<typename _FIter, typename _Tp>
+ void
+ replace(_FIter, _FIter, const _Tp&, const _Tp&,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _FIter, typename _Tp>
+ void
+ replace(_FIter, _FIter, const _Tp&, const _Tp&,
+ __gnu_parallel::_Parallelism);
+
+ template<typename _FIter, typename _Tp, typename _IterTag>
+ void
+ replace_switch(_FIter, _FIter, const _Tp&, const _Tp&, _IterTag);
+
+ template<typename _RAIter, typename _Tp>
+ void
+ replace_switch(_RAIter, _RAIter, const _Tp&, const _Tp&,
+ random_access_iterator_tag, __gnu_parallel::_Parallelism);
+
+
+ template<typename _FIter, typename _Predicate, typename _Tp>
+ void
+ replace_if(_FIter, _FIter, _Predicate, const _Tp&);
+
+ template<typename _FIter, typename _Predicate, typename _Tp>
+ void
+ replace_if(_FIter, _FIter, _Predicate, const _Tp&,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _FIter, typename _Predicate, typename _Tp>
+ void
+ replace_if(_FIter, _FIter, _Predicate, const _Tp&,
+ __gnu_parallel::_Parallelism);
+
+ template<typename _FIter, typename _Predicate, typename _Tp,
+ typename _IterTag>
+ void
+ replace_if_switch(_FIter, _FIter, _Predicate, const _Tp&, _IterTag);
+
+ template<typename _RAIter, typename _Predicate, typename _Tp>
+ void
+ replace_if_switch(_RAIter, _RAIter, _Predicate, const _Tp&,
+ random_access_iterator_tag,
+ __gnu_parallel::_Parallelism);
+
+
+ template<typename _FIter>
+ _FIter
+ max_element(_FIter, _FIter);
+
+ template<typename _FIter>
+ _FIter
+ max_element(_FIter, _FIter, __gnu_parallel::sequential_tag);
+
+ template<typename _FIter>
+ _FIter
+ max_element(_FIter, _FIter, __gnu_parallel::_Parallelism);
+
+ template<typename _FIter, typename _Compare>
+ _FIter
+ max_element(_FIter, _FIter, _Compare);
+
+ template<typename _FIter, typename _Compare>
+ _FIter
+ max_element(_FIter, _FIter, _Compare, __gnu_parallel::sequential_tag);
+
+ template<typename _FIter, typename _Compare>
+ _FIter
+ max_element(_FIter, _FIter, _Compare, __gnu_parallel::_Parallelism);
+
+ template<typename _FIter, typename _Compare, typename _IterTag>
+ _FIter
+ max_element_switch(_FIter, _FIter, _Compare, _IterTag);
+
+ template<typename _RAIter, typename _Compare>
+ _RAIter
+ max_element_switch(_RAIter, _RAIter, _Compare, random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism
+ = __gnu_parallel::parallel_balanced);
+
+
+ template<typename _IIter1, typename _IIter2, typename _OIter>
+ _OIter
+ merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _Compare>
+ _OIter
+ merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _Compare>
+ _OIter
+ merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter>
+ _OIter
+ merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _Compare, typename _IterTag1, typename _IterTag2,
+ typename _IterTag3>
+ _OIter
+ merge_switch(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare,
+ _IterTag1, _IterTag2, _IterTag3);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _Compare>
+ _OIter
+ merge_switch(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare,
+ random_access_iterator_tag, random_access_iterator_tag,
+ random_access_iterator_tag);
+
+
+ template<typename _FIter>
+ _FIter
+ min_element(_FIter, _FIter);
+
+ template<typename _FIter>
+ _FIter
+ min_element(_FIter, _FIter, __gnu_parallel::sequential_tag);
+
+ template<typename _FIter>
+ _FIter
+ min_element(_FIter, _FIter, __gnu_parallel::_Parallelism parallelism_tag);
+
+ template<typename _FIter, typename _Compare>
+ _FIter
+ min_element(_FIter, _FIter, _Compare);
+
+ template<typename _FIter, typename _Compare>
+ _FIter
+ min_element(_FIter, _FIter, _Compare, __gnu_parallel::sequential_tag);
+
+ template<typename _FIter, typename _Compare>
+ _FIter
+ min_element(_FIter, _FIter, _Compare, __gnu_parallel::_Parallelism);
+
+ template<typename _FIter, typename _Compare, typename _IterTag>
+ _FIter
+ min_element_switch(_FIter, _FIter, _Compare, _IterTag);
+
+ template<typename _RAIter, typename _Compare>
+ _RAIter
+ min_element_switch(_RAIter, _RAIter, _Compare, random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism
+ = __gnu_parallel::parallel_balanced);
+
+ template<typename _RAIter>
+ void
+ nth_element(_RAIter, _RAIter, _RAIter, __gnu_parallel::sequential_tag);
+
+ template<typename _RAIter, typename _Compare>
+ void
+ nth_element(_RAIter, _RAIter, _RAIter, _Compare,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _RAIter, typename _Compare>
+ void
+ nth_element(_RAIter, _RAIter, _RAIter, _Compare);
+
+ template<typename _RAIter>
+ void
+ nth_element(_RAIter, _RAIter, _RAIter);
+
+ template<typename _RAIter, typename _Compare>
+ void
+ partial_sort(_RAIter, _RAIter, _RAIter, _Compare,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _RAIter>
+ void
+ partial_sort(_RAIter, _RAIter, _RAIter, __gnu_parallel::sequential_tag);
+
+ template<typename _RAIter, typename _Compare>
+ void
+ partial_sort(_RAIter, _RAIter, _RAIter, _Compare);
+
+ template<typename _RAIter>
+ void
+ partial_sort(_RAIter, _RAIter, _RAIter);
+
+ template<typename _FIter, typename Predicate>
+ _FIter
+ partition(_FIter, _FIter, Predicate, __gnu_parallel::sequential_tag);
+
+ template<typename _FIter, typename Predicate>
+ _FIter
+ partition(_FIter, _FIter, Predicate);
+
+ template<typename _FIter, typename Predicate, typename _IterTag>
+ _FIter
+ partition_switch(_FIter, _FIter, Predicate, _IterTag);
+
+ template<typename _RAIter, typename Predicate>
+ _RAIter
+ partition_switch(_RAIter, _RAIter, Predicate, random_access_iterator_tag);
+
+ template<typename _RAIter>
+ void
+ random_shuffle(_RAIter, _RAIter, __gnu_parallel::sequential_tag);
+
+ template<typename _RAIter, typename _RandomNumberGenerator>
+ void
+ random_shuffle(_RAIter, _RAIter, _RandomNumberGenerator&,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _RAIter>
+ void
+ random_shuffle(_RAIter, _RAIter);
+
+ template<typename _RAIter, typename _RandomNumberGenerator>
+ void
+ random_shuffle(_RAIter, _RAIter, _RandomNumberGenerator&);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter>
+ _OIter
+ set_union(_IIter1, _IIter1, _IIter2, _IIter2, _OIter,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename Predicate>
+ _OIter
+ set_union(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, Predicate,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter>
+ _OIter
+ set_union(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _Predicate>
+ _OIter
+ set_union(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Predicate);
+
+ template<typename _IIter1, typename _IIter2, typename _Predicate,
+ typename _OIter, typename _IterTag1, typename _IterTag2,
+ typename _IterTag3>
+ _OIter
+ set_union_switch(_IIter1, _IIter1, _IIter2, _IIter2, _OIter,
+ _Predicate, _IterTag1, _IterTag2, _IterTag3);
+
+ template<typename _RAIter1, typename _RAIter2, typename _Output_RAIter,
+ typename _Predicate>
+ _Output_RAIter
+ set_union_switch(_RAIter1, _RAIter1, _RAIter2, _RAIter2, _Output_RAIter,
+ _Predicate, random_access_iterator_tag,
+ random_access_iterator_tag, random_access_iterator_tag);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter>
+ _OIter
+ set_intersection(_IIter1, _IIter1, _IIter2, _IIter2, _OIter,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _Predicate>
+ _OIter
+ set_intersection(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Predicate,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter>
+ _OIter
+ set_intersection(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _Predicate>
+ _OIter
+ set_intersection(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Predicate);
+
+ template<typename _IIter1, typename _IIter2, typename _Predicate,
+ typename _OIter, typename _IterTag1, typename _IterTag2,
+ typename _IterTag3>
+ _OIter
+ set_intersection_switch(_IIter1, _IIter1, _IIter2, _IIter2, _OIter,
+ _Predicate, _IterTag1, _IterTag2, _IterTag3);
+
+ template<typename _RAIter1, typename _RAIter2, typename _Output_RAIter,
+ typename _Predicate>
+ _Output_RAIter
+ set_intersection_switch(_RAIter1, _RAIter1, _RAIter2, _RAIter2,
+ _Output_RAIter, _Predicate,
+ random_access_iterator_tag,
+ random_access_iterator_tag,
+ random_access_iterator_tag);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter>
+ _OIter
+ set_symmetric_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _Predicate>
+ _OIter
+ set_symmetric_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter,
+ _Predicate, __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter>
+ _OIter
+ set_symmetric_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _Predicate>
+ _OIter
+ set_symmetric_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter,
+ _Predicate);
+
+ template<typename _IIter1, typename _IIter2, typename _Predicate,
+ typename _OIter, typename _IterTag1, typename _IterTag2,
+ typename _IterTag3>
+ _OIter
+ set_symmetric_difference_switch(_IIter1, _IIter1, _IIter2, _IIter2,
+ _OIter, _Predicate, _IterTag1, _IterTag2,
+ _IterTag3);
+
+ template<typename _RAIter1, typename _RAIter2, typename _Output_RAIter,
+ typename _Predicate>
+ _Output_RAIter
+ set_symmetric_difference_switch(_RAIter1, _RAIter1, _RAIter2, _RAIter2,
+ _Output_RAIter, _Predicate,
+ random_access_iterator_tag,
+ random_access_iterator_tag,
+ random_access_iterator_tag);
+
+
+ template<typename _IIter1, typename _IIter2, typename _OIter>
+ _OIter
+ set_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _Predicate>
+ _OIter
+ set_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Predicate,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter>
+ _OIter
+ set_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _Predicate>
+ _OIter
+ set_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Predicate);
+
+ template<typename _IIter1, typename _IIter2, typename _Predicate,
+ typename _OIter, typename _IterTag1, typename _IterTag2,
+ typename _IterTag3>
+ _OIter
+ set_difference_switch(_IIter1, _IIter1, _IIter2, _IIter2, _OIter,
+ _Predicate, _IterTag1, _IterTag2, _IterTag3);
+
+ template<typename _RAIter1, typename _RAIter2, typename _Output_RAIter,
+ typename _Predicate>
+ _Output_RAIter
+ set_difference_switch(_RAIter1, _RAIter1, _RAIter2, _RAIter2,
+ _Output_RAIter, _Predicate,
+ random_access_iterator_tag,
+ random_access_iterator_tag,
+ random_access_iterator_tag);
+
+
+ template<typename _RAIter>
+ void
+ sort(_RAIter, _RAIter, __gnu_parallel::sequential_tag);
+
+ template<typename _RAIter, typename _Compare>
+ void
+ sort(_RAIter, _RAIter, _Compare, __gnu_parallel::sequential_tag);
+
+ template<typename _RAIter>
+ void
+ sort(_RAIter, _RAIter);
+
+ template<typename _RAIter, typename _Compare>
+ void
+ sort(_RAIter, _RAIter, _Compare);
+
+ template<typename _RAIter>
+ void
+ stable_sort(_RAIter, _RAIter, __gnu_parallel::sequential_tag);
+
+ template<typename _RAIter, typename _Compare>
+ void
+ stable_sort(_RAIter, _RAIter, _Compare, __gnu_parallel::sequential_tag);
+
+ template<typename _RAIter>
+ void
+ stable_sort(_RAIter, _RAIter);
+
+ template<typename _RAIter, typename _Compare>
+ void
+ stable_sort(_RAIter, _RAIter, _Compare);
+
+ template<typename _IIter, typename _OIter>
+ _OIter
+ unique_copy(_IIter, _IIter, _OIter, __gnu_parallel::sequential_tag);
+
+ template<typename _IIter, typename _OIter, typename _Predicate>
+ _OIter
+ unique_copy(_IIter, _IIter, _OIter, _Predicate,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter, typename _OIter>
+ _OIter
+ unique_copy(_IIter, _IIter, _OIter);
+
+ template<typename _IIter, typename _OIter, typename _Predicate>
+ _OIter
+ unique_copy(_IIter, _IIter, _OIter, _Predicate);
+
+ template<typename _IIter, typename _OIter, typename _Predicate,
+ typename _IterTag1, typename _IterTag2>
+ _OIter
+ unique_copy_switch(_IIter, _IIter, _OIter, _Predicate,
+ _IterTag1, _IterTag2);
+
+ template<typename _RAIter, typename _RandomAccess_OIter, typename _Predicate>
+ _RandomAccess_OIter
+ unique_copy_switch(_RAIter, _RAIter, _RandomAccess_OIter, _Predicate,
+ random_access_iterator_tag, random_access_iterator_tag);
+} // end namespace __parallel
+} // end namespace std
+
+#endif /* _GLIBCXX_PARALLEL_ALGORITHMFWD_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/balanced_quicksort.h b/i686-linux/include/c++/4.4.3/parallel/balanced_quicksort.h
new file mode 100644
index 0000000..2310110
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/balanced_quicksort.h
@@ -0,0 +1,477 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/balanced_quicksort.h
+ * @brief Implementation of a dynamically load-balanced parallel quicksort.
+ *
+ * It works in-place and needs only logarithmic extra memory.
+ * The algorithm is similar to the one proposed in
+ *
+ * P. Tsigas and Y. Zhang.
+ * A simple, fast parallel implementation of quicksort and
+ * its performance evaluation on SUN enterprise 10000.
+ * In 11th Euromicro Conference on Parallel, Distributed and
+ * Network-Based Processing, page 372, 2003.
+ *
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_BALANCED_QUICKSORT_H
+#define _GLIBCXX_PARALLEL_BALANCED_QUICKSORT_H 1
+
+#include <parallel/basic_iterator.h>
+#include <bits/stl_algo.h>
+
+#include <parallel/settings.h>
+#include <parallel/partition.h>
+#include <parallel/random_number.h>
+#include <parallel/queue.h>
+#include <functional>
+
+#if _GLIBCXX_ASSERTIONS
+#include <parallel/checkers.h>
+#endif
+
+namespace __gnu_parallel
+{
+/** @brief Information local to one thread in the parallel quicksort run. */
+template<typename RandomAccessIterator>
+ struct QSBThreadLocal
+ {
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ /** @brief Continuous part of the sequence, described by an
+ iterator pair. */
+ typedef std::pair<RandomAccessIterator, RandomAccessIterator> Piece;
+
+ /** @brief Initial piece to work on. */
+ Piece initial;
+
+ /** @brief Work-stealing queue. */
+ RestrictedBoundedConcurrentQueue<Piece> leftover_parts;
+
+ /** @brief Number of threads involved in this algorithm. */
+ thread_index_t num_threads;
+
+ /** @brief Pointer to a counter of elements left over to sort. */
+ volatile difference_type* elements_leftover;
+
+ /** @brief The complete sequence to sort. */
+ Piece global;
+
+ /** @brief Constructor.
+ * @param queue_size Size of the work-stealing queue. */
+ QSBThreadLocal(int queue_size) : leftover_parts(queue_size) { }
+ };
+
+/** @brief Balanced quicksort divide step.
+ * @param begin Begin iterator of subsequence.
+ * @param end End iterator of subsequence.
+ * @param comp Comparator.
+ * @param num_threads Number of threads that are allowed to work on
+ * this part.
+ * @pre @c (end-begin)>=1 */
+template<typename RandomAccessIterator, typename Comparator>
+ typename std::iterator_traits<RandomAccessIterator>::difference_type
+ qsb_divide(RandomAccessIterator begin, RandomAccessIterator end,
+ Comparator comp, thread_index_t num_threads)
+ {
+ _GLIBCXX_PARALLEL_ASSERT(num_threads > 0);
+
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ RandomAccessIterator pivot_pos =
+ median_of_three_iterators(begin, begin + (end - begin) / 2,
+ end - 1, comp);
+
+#if defined(_GLIBCXX_ASSERTIONS)
+ // Must be in between somewhere.
+ difference_type n = end - begin;
+
+ _GLIBCXX_PARALLEL_ASSERT(
+ (!comp(*pivot_pos, *begin) && !comp(*(begin + n / 2), *pivot_pos))
+ || (!comp(*pivot_pos, *begin) && !comp(*(end - 1), *pivot_pos))
+ || (!comp(*pivot_pos, *(begin + n / 2)) && !comp(*begin, *pivot_pos))
+ || (!comp(*pivot_pos, *(begin + n / 2)) && !comp(*(end - 1), *pivot_pos))
+ || (!comp(*pivot_pos, *(end - 1)) && !comp(*begin, *pivot_pos))
+ || (!comp(*pivot_pos, *(end - 1)) && !comp(*(begin + n / 2), *pivot_pos)));
+#endif
+
+ // Swap pivot value to end.
+ if (pivot_pos != (end - 1))
+ std::swap(*pivot_pos, *(end - 1));
+ pivot_pos = end - 1;
+
+ __gnu_parallel::binder2nd<Comparator, value_type, value_type, bool>
+ pred(comp, *pivot_pos);
+
+ // Divide, returning end - begin - 1 in the worst case.
+ difference_type split_pos = parallel_partition(
+ begin, end - 1, pred, num_threads);
+
+ // Swap back pivot to middle.
+ std::swap(*(begin + split_pos), *pivot_pos);
+ pivot_pos = begin + split_pos;
+
+#if _GLIBCXX_ASSERTIONS
+ RandomAccessIterator r;
+ for (r = begin; r != pivot_pos; ++r)
+ _GLIBCXX_PARALLEL_ASSERT(comp(*r, *pivot_pos));
+ for (; r != end; ++r)
+ _GLIBCXX_PARALLEL_ASSERT(!comp(*r, *pivot_pos));
+#endif
+
+ return split_pos;
+ }
+
+/** @brief Quicksort conquer step.
+ * @param tls Array of thread-local storages.
+ * @param begin Begin iterator of subsequence.
+ * @param end End iterator of subsequence.
+ * @param comp Comparator.
+ * @param iam Number of the thread processing this function.
+ * @param num_threads
+ * Number of threads that are allowed to work on this part. */
+template<typename RandomAccessIterator, typename Comparator>
+ void
+ qsb_conquer(QSBThreadLocal<RandomAccessIterator>** tls,
+ RandomAccessIterator begin, RandomAccessIterator end,
+ Comparator comp,
+ thread_index_t iam, thread_index_t num_threads,
+ bool parent_wait)
+ {
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ difference_type n = end - begin;
+
+ if (num_threads <= 1 || n <= 1)
+ {
+ tls[iam]->initial.first = begin;
+ tls[iam]->initial.second = end;
+
+ qsb_local_sort_with_helping(tls, comp, iam, parent_wait);
+
+ return;
+ }
+
+ // Divide step.
+ difference_type split_pos = qsb_divide(begin, end, comp, num_threads);
+
+#if _GLIBCXX_ASSERTIONS
+ _GLIBCXX_PARALLEL_ASSERT(0 <= split_pos && split_pos < (end - begin));
+#endif
+
+ thread_index_t num_threads_leftside =
+ std::max<thread_index_t>(1, std::min<thread_index_t>(
+ num_threads - 1, split_pos * num_threads / n));
+
+# pragma omp atomic
+ *tls[iam]->elements_leftover -= (difference_type)1;
+
+ // Conquer step.
+# pragma omp parallel num_threads(2)
+ {
+ bool wait;
+ if(omp_get_num_threads() < 2)
+ wait = false;
+ else
+ wait = parent_wait;
+
+# pragma omp sections
+ {
+# pragma omp section
+ {
+ qsb_conquer(tls, begin, begin + split_pos, comp,
+ iam,
+ num_threads_leftside,
+ wait);
+ wait = parent_wait;
+ }
+ // The pivot_pos is left in place, to ensure termination.
+# pragma omp section
+ {
+ qsb_conquer(tls, begin + split_pos + 1, end, comp,
+ iam + num_threads_leftside,
+ num_threads - num_threads_leftside,
+ wait);
+ wait = parent_wait;
+ }
+ }
+ }
+ }
+
+/**
+ * @brief Quicksort step doing load-balanced local sort.
+ * @param tls Array of thread-local storages.
+ * @param comp Comparator.
+ * @param iam Number of the thread processing this function.
+ */
+template<typename RandomAccessIterator, typename Comparator>
+ void
+ qsb_local_sort_with_helping(QSBThreadLocal<RandomAccessIterator>** tls,
+ Comparator& comp, int iam, bool wait)
+ {
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+ typedef std::pair<RandomAccessIterator, RandomAccessIterator> Piece;
+
+ QSBThreadLocal<RandomAccessIterator>& tl = *tls[iam];
+
+ difference_type base_case_n =
+ _Settings::get().sort_qsb_base_case_maximal_n;
+ if (base_case_n < 2)
+ base_case_n = 2;
+ thread_index_t num_threads = tl.num_threads;
+
+ // Every thread has its own random number generator.
+ random_number rng(iam + 1);
+
+ Piece current = tl.initial;
+
+ difference_type elements_done = 0;
+#if _GLIBCXX_ASSERTIONS
+ difference_type total_elements_done = 0;
+#endif
+
+ for (;;)
+ {
+ // Invariant: current must be a valid (maybe empty) range.
+ RandomAccessIterator begin = current.first, end = current.second;
+ difference_type n = end - begin;
+
+ if (n > base_case_n)
+ {
+ // Divide.
+ RandomAccessIterator pivot_pos = begin + rng(n);
+
+ // Swap pivot_pos value to end.
+ if (pivot_pos != (end - 1))
+ std::swap(*pivot_pos, *(end - 1));
+ pivot_pos = end - 1;
+
+ __gnu_parallel::binder2nd
+ <Comparator, value_type, value_type, bool>
+ pred(comp, *pivot_pos);
+
+ // Divide, leave pivot unchanged in last place.
+ RandomAccessIterator split_pos1, split_pos2;
+ split_pos1 = __gnu_sequential::partition(begin, end - 1, pred);
+
+ // Left side: < pivot_pos; right side: >= pivot_pos.
+#if _GLIBCXX_ASSERTIONS
+ _GLIBCXX_PARALLEL_ASSERT(begin <= split_pos1 && split_pos1 < end);
+#endif
+ // Swap pivot back to middle.
+ if (split_pos1 != pivot_pos)
+ std::swap(*split_pos1, *pivot_pos);
+ pivot_pos = split_pos1;
+
+ // In case all elements are equal, split_pos1 == 0.
+ if ((split_pos1 + 1 - begin) < (n >> 7)
+ || (end - split_pos1) < (n >> 7))
+ {
+ // Very unequal split, one part smaller than one 128th
+ // elements not strictly larger than the pivot.
+ __gnu_parallel::unary_negate<__gnu_parallel::binder1st
+ <Comparator, value_type, value_type, bool>, value_type>
+ pred(__gnu_parallel::binder1st
+ <Comparator, value_type, value_type, bool>(comp,
+ *pivot_pos));
+
+ // Find other end of pivot-equal range.
+ split_pos2 = __gnu_sequential::partition(split_pos1 + 1,
+ end, pred);
+ }
+ else
+ // Only skip the pivot.
+ split_pos2 = split_pos1 + 1;
+
+ // Elements equal to pivot are done.
+ elements_done += (split_pos2 - split_pos1);
+#if _GLIBCXX_ASSERTIONS
+ total_elements_done += (split_pos2 - split_pos1);
+#endif
+ // Always push larger part onto stack.
+ if (((split_pos1 + 1) - begin) < (end - (split_pos2)))
+ {
+ // Right side larger.
+ if ((split_pos2) != end)
+ tl.leftover_parts.push_front(std::make_pair(split_pos2,
+ end));
+
+ //current.first = begin; //already set anyway
+ current.second = split_pos1;
+ continue;
+ }
+ else
+ {
+ // Left side larger.
+ if (begin != split_pos1)
+ tl.leftover_parts.push_front(std::make_pair(begin,
+ split_pos1));
+
+ current.first = split_pos2;
+ //current.second = end; //already set anyway
+ continue;
+ }
+ }
+ else
+ {
+ __gnu_sequential::sort(begin, end, comp);
+ elements_done += n;
+#if _GLIBCXX_ASSERTIONS
+ total_elements_done += n;
+#endif
+
+ // Prefer own stack, small pieces.
+ if (tl.leftover_parts.pop_front(current))
+ continue;
+
+# pragma omp atomic
+ *tl.elements_leftover -= elements_done;
+
+ elements_done = 0;
+
+#if _GLIBCXX_ASSERTIONS
+ double search_start = omp_get_wtime();
+#endif
+
+ // Look for new work.
+ bool successfully_stolen = false;
+ while (wait && *tl.elements_leftover > 0 && !successfully_stolen
+#if _GLIBCXX_ASSERTIONS
+ // Possible dead-lock.
+ && (omp_get_wtime() < (search_start + 1.0))
+#endif
+ )
+ {
+ thread_index_t victim;
+ victim = rng(num_threads);
+
+ // Large pieces.
+ successfully_stolen = (victim != iam)
+ && tls[victim]->leftover_parts.pop_back(current);
+ if (!successfully_stolen)
+ yield();
+#if !defined(__ICC) && !defined(__ECC)
+# pragma omp flush
+#endif
+ }
+
+#if _GLIBCXX_ASSERTIONS
+ if (omp_get_wtime() >= (search_start + 1.0))
+ {
+ sleep(1);
+ _GLIBCXX_PARALLEL_ASSERT(omp_get_wtime()
+ < (search_start + 1.0));
+ }
+#endif
+ if (!successfully_stolen)
+ {
+#if _GLIBCXX_ASSERTIONS
+ _GLIBCXX_PARALLEL_ASSERT(*tl.elements_leftover == 0);
+#endif
+ return;
+ }
+ }
+ }
+ }
+
+/** @brief Top-level quicksort routine.
+ * @param begin Begin iterator of sequence.
+ * @param end End iterator of sequence.
+ * @param comp Comparator.
+ * @param num_threads Number of threads that are allowed to work on
+ * this part.
+ */
+template<typename RandomAccessIterator, typename Comparator>
+ void
+ parallel_sort_qsb(RandomAccessIterator begin, RandomAccessIterator end,
+ Comparator comp,
+ thread_index_t num_threads)
+ {
+ _GLIBCXX_CALL(end - begin)
+
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+ typedef std::pair<RandomAccessIterator, RandomAccessIterator> Piece;
+
+ typedef QSBThreadLocal<RandomAccessIterator> tls_type;
+
+ difference_type n = end - begin;
+
+ if (n <= 1)
+ return;
+
+ // At least one element per processor.
+ if (num_threads > n)
+ num_threads = static_cast<thread_index_t>(n);
+
+ // Initialize thread local storage
+ tls_type** tls = new tls_type*[num_threads];
+ difference_type queue_size = num_threads * (thread_index_t)(log2(n) + 1);
+ for (thread_index_t t = 0; t < num_threads; ++t)
+ tls[t] = new QSBThreadLocal<RandomAccessIterator>(queue_size);
+
+ // There can never be more than ceil(log2(n)) ranges on the stack, because
+ // 1. Only one processor pushes onto the stack
+ // 2. The largest range has at most length n
+ // 3. Each range is larger than half of the range remaining
+ volatile difference_type elements_leftover = n;
+ for (int i = 0; i < num_threads; ++i)
+ {
+ tls[i]->elements_leftover = &elements_leftover;
+ tls[i]->num_threads = num_threads;
+ tls[i]->global = std::make_pair(begin, end);
+
+ // Just in case nothing is left to assign.
+ tls[i]->initial = std::make_pair(end, end);
+ }
+
+ // Main recursion call.
+ qsb_conquer(tls, begin, begin + n, comp, 0, num_threads, true);
+
+#if _GLIBCXX_ASSERTIONS
+ // All stack must be empty.
+ Piece dummy;
+ for (int i = 1; i < num_threads; ++i)
+ _GLIBCXX_PARALLEL_ASSERT(!tls[i]->leftover_parts.pop_back(dummy));
+#endif
+
+ for (int i = 0; i < num_threads; ++i)
+ delete tls[i];
+ delete[] tls;
+ }
+} // namespace __gnu_parallel
+
+#endif /* _GLIBCXX_PARALLEL_BALANCED_QUICKSORT_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/base.h b/i686-linux/include/c++/4.4.3/parallel/base.h
new file mode 100644
index 0000000..7f855df
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/base.h
@@ -0,0 +1,471 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/base.h
+ * @brief Sequential helper functions.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_BASE_H
+#define _GLIBCXX_PARALLEL_BASE_H 1
+
+#include <functional>
+#include <omp.h>
+#include <parallel/features.h>
+#include <parallel/basic_iterator.h>
+#include <parallel/parallel.h>
+
+
+// Parallel mode namespaces.
+
+/**
+ * @namespace std::__parallel
+ * @brief GNU parallel code, replaces standard behavior with parallel behavior.
+ */
+namespace std
+{
+ namespace __parallel { }
+}
+
+/**
+ * @namespace __gnu_parallel
+ * @brief GNU parallel code for public use.
+ */
+namespace __gnu_parallel
+{
+ // Import all the parallel versions of components in namespace std.
+ using namespace std::__parallel;
+}
+
+/**
+ * @namespace __gnu_sequential
+ * @brief GNU sequential classes for public use.
+ */
+namespace __gnu_sequential
+{
+ // Import whatever is the serial version.
+#ifdef _GLIBCXX_PARALLEL
+ using namespace std::__norm;
+#else
+ using namespace std;
+#endif
+}
+
+
+namespace __gnu_parallel
+{
+ // NB: Including this file cannot produce (unresolved) symbols from
+ // the OpenMP runtime unless the parallel mode is actually invoked
+ // and active, which imples that the OpenMP runtime is actually
+ // going to be linked in.
+ inline int
+ get_max_threads()
+ {
+ int __i = omp_get_max_threads();
+ return __i > 1 ? __i : 1;
+ }
+
+
+ inline bool
+ is_parallel(const _Parallelism __p) { return __p != sequential; }
+
+
+ // XXX remove std::duplicates from here if possible,
+ // XXX but keep minimal dependencies.
+
+/** @brief Calculates the rounded-down logarithm of @c n for base 2.
+ * @param n Argument.
+ * @return Returns 0 for any argument <1.
+ */
+template<typename Size>
+ inline Size
+ __log2(Size n)
+ {
+ Size k;
+ for (k = 0; n > 1; n >>= 1)
+ ++k;
+ return k;
+ }
+
+/** @brief Encode two integers into one __gnu_parallel::lcas_t.
+ * @param a First integer, to be encoded in the most-significant @c
+ * lcas_t_bits/2 bits.
+ * @param b Second integer, to be encoded in the least-significant
+ * @c lcas_t_bits/2 bits.
+ * @return __gnu_parallel::lcas_t value encoding @c a and @c b.
+ * @see decode2
+ */
+inline lcas_t
+encode2(int a, int b) //must all be non-negative, actually
+{
+ return (((lcas_t)a) << (lcas_t_bits / 2)) | (((lcas_t)b) << 0);
+}
+
+/** @brief Decode two integers from one __gnu_parallel::lcas_t.
+ * @param x __gnu_parallel::lcas_t to decode integers from.
+ * @param a First integer, to be decoded from the most-significant
+ * @c lcas_t_bits/2 bits of @c x.
+ * @param b Second integer, to be encoded in the least-significant
+ * @c lcas_t_bits/2 bits of @c x.
+ * @see encode2
+ */
+inline void
+decode2(lcas_t x, int& a, int& b)
+{
+ a = (int)((x >> (lcas_t_bits / 2)) & lcas_t_mask);
+ b = (int)((x >> 0 ) & lcas_t_mask);
+}
+
+/** @brief Equivalent to std::min. */
+template<typename T>
+ const T&
+ min(const T& a, const T& b)
+ { return (a < b) ? a : b; }
+
+/** @brief Equivalent to std::max. */
+template<typename T>
+ const T&
+ max(const T& a, const T& b)
+ { return (a > b) ? a : b; }
+
+/** @brief Constructs predicate for equality from strict weak
+ * ordering predicate
+ */
+// XXX comparator at the end, as per others
+template<typename Comparator, typename T1, typename T2>
+ class equal_from_less : public std::binary_function<T1, T2, bool>
+ {
+ private:
+ Comparator& comp;
+
+ public:
+ equal_from_less(Comparator& _comp) : comp(_comp) { }
+
+ bool operator()(const T1& a, const T2& b)
+ {
+ return !comp(a, b) && !comp(b, a);
+ }
+ };
+
+
+/** @brief Similar to std::binder1st,
+ * but giving the argument types explicitly. */
+template<typename _Predicate, typename argument_type>
+ class unary_negate
+ : public std::unary_function<argument_type, bool>
+ {
+ protected:
+ _Predicate _M_pred;
+
+ public:
+ explicit
+ unary_negate(const _Predicate& __x) : _M_pred(__x) { }
+
+ bool
+ operator()(const argument_type& __x)
+ { return !_M_pred(__x); }
+ };
+
+/** @brief Similar to std::binder1st,
+ * but giving the argument types explicitly. */
+template<typename _Operation, typename first_argument_type,
+ typename second_argument_type, typename result_type>
+ class binder1st
+ : public std::unary_function<second_argument_type, result_type>
+ {
+ protected:
+ _Operation op;
+ first_argument_type value;
+
+ public:
+ binder1st(const _Operation& __x,
+ const first_argument_type& __y)
+ : op(__x), value(__y) { }
+
+ result_type
+ operator()(const second_argument_type& __x)
+ { return op(value, __x); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 109. Missing binders for non-const sequence elements
+ result_type
+ operator()(second_argument_type& __x) const
+ { return op(value, __x); }
+ };
+
+/**
+ * @brief Similar to std::binder2nd, but giving the argument types
+ * explicitly.
+ */
+template<typename _Operation, typename first_argument_type,
+ typename second_argument_type, typename result_type>
+ class binder2nd
+ : public std::unary_function<first_argument_type, result_type>
+ {
+ protected:
+ _Operation op;
+ second_argument_type value;
+
+ public:
+ binder2nd(const _Operation& __x,
+ const second_argument_type& __y)
+ : op(__x), value(__y) { }
+
+ result_type
+ operator()(const first_argument_type& __x) const
+ { return op(__x, value); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 109. Missing binders for non-const sequence elements
+ result_type
+ operator()(first_argument_type& __x)
+ { return op(__x, value); }
+ };
+
+/** @brief Similar to std::equal_to, but allows two different types. */
+template<typename T1, typename T2>
+ struct equal_to : std::binary_function<T1, T2, bool>
+ {
+ bool operator()(const T1& t1, const T2& t2) const
+ { return t1 == t2; }
+ };
+
+/** @brief Similar to std::less, but allows two different types. */
+template<typename T1, typename T2>
+ struct less : std::binary_function<T1, T2, bool>
+ {
+ bool
+ operator()(const T1& t1, const T2& t2) const
+ { return t1 < t2; }
+
+ bool
+ operator()(const T2& t2, const T1& t1) const
+ { return t2 < t1; }
+ };
+
+// Partial specialization for one type. Same as std::less.
+template<typename _Tp>
+struct less<_Tp, _Tp> : public std::binary_function<_Tp, _Tp, bool>
+ {
+ bool
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x < __y; }
+ };
+
+
+ /** @brief Similar to std::plus, but allows two different types. */
+template<typename _Tp1, typename _Tp2>
+ struct plus : public std::binary_function<_Tp1, _Tp2, _Tp1>
+ {
+ typedef __typeof__(*static_cast<_Tp1*>(NULL)
+ + *static_cast<_Tp2*>(NULL)) result;
+
+ result
+ operator()(const _Tp1& __x, const _Tp2& __y) const
+ { return __x + __y; }
+ };
+
+// Partial specialization for one type. Same as std::plus.
+template<typename _Tp>
+ struct plus<_Tp, _Tp> : public std::binary_function<_Tp, _Tp, _Tp>
+ {
+ typedef __typeof__(*static_cast<_Tp*>(NULL)
+ + *static_cast<_Tp*>(NULL)) result;
+
+ result
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x + __y; }
+ };
+
+
+/** @brief Similar to std::multiplies, but allows two different types. */
+template<typename _Tp1, typename _Tp2>
+ struct multiplies : public std::binary_function<_Tp1, _Tp2, _Tp1>
+ {
+ typedef __typeof__(*static_cast<_Tp1*>(NULL)
+ * *static_cast<_Tp2*>(NULL)) result;
+
+ result
+ operator()(const _Tp1& __x, const _Tp2& __y) const
+ { return __x * __y; }
+ };
+
+// Partial specialization for one type. Same as std::multiplies.
+template<typename _Tp>
+ struct multiplies<_Tp, _Tp> : public std::binary_function<_Tp, _Tp, _Tp>
+ {
+ typedef __typeof__(*static_cast<_Tp*>(NULL)
+ * *static_cast<_Tp*>(NULL)) result;
+
+ result
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x * __y; }
+ };
+
+
+template<typename T, typename _DifferenceTp>
+ class pseudo_sequence;
+
+/** @brief Iterator associated with __gnu_parallel::pseudo_sequence.
+ * If features the usual random-access iterator functionality.
+ * @param T Sequence value type.
+ * @param difference_type Sequence difference type.
+ */
+template<typename T, typename _DifferenceTp>
+ class pseudo_sequence_iterator
+ {
+ public:
+ typedef _DifferenceTp difference_type;
+
+ private:
+ typedef pseudo_sequence_iterator<T, _DifferenceTp> type;
+
+ const T& val;
+ difference_type pos;
+
+ public:
+ pseudo_sequence_iterator(const T& val, difference_type pos)
+ : val(val), pos(pos) { }
+
+ // Pre-increment operator.
+ type&
+ operator++()
+ {
+ ++pos;
+ return *this;
+ }
+
+ // Post-increment operator.
+ const type
+ operator++(int)
+ { return type(pos++); }
+
+ const T&
+ operator*() const
+ { return val; }
+
+ const T&
+ operator[](difference_type) const
+ { return val; }
+
+ bool
+ operator==(const type& i2)
+ { return pos == i2.pos; }
+
+ difference_type
+ operator!=(const type& i2)
+ { return pos != i2.pos; }
+
+ difference_type
+ operator-(const type& i2)
+ { return pos - i2.pos; }
+ };
+
+/** @brief Sequence that conceptually consists of multiple copies of
+ the same element.
+ * The copies are not stored explicitly, of course.
+ * @param T Sequence value type.
+ * @param difference_type Sequence difference type.
+ */
+template<typename T, typename _DifferenceTp>
+ class pseudo_sequence
+ {
+ typedef pseudo_sequence<T, _DifferenceTp> type;
+
+ public:
+ typedef _DifferenceTp difference_type;
+
+ // Better case down to uint64, than up to _DifferenceTp.
+ typedef pseudo_sequence_iterator<T, uint64> iterator;
+
+ /** @brief Constructor.
+ * @param val Element of the sequence.
+ * @param count Number of (virtual) copies.
+ */
+ pseudo_sequence(const T& val, difference_type count)
+ : val(val), count(count) { }
+
+ /** @brief Begin iterator. */
+ iterator
+ begin() const
+ { return iterator(val, 0); }
+
+ /** @brief End iterator. */
+ iterator
+ end() const
+ { return iterator(val, count); }
+
+ private:
+ const T& val;
+ difference_type count;
+ };
+
+/** @brief Functor that does nothing */
+template<typename _ValueTp>
+ class void_functor
+ {
+ inline void
+ operator()(const _ValueTp& v) const { }
+ };
+
+/** @brief Compute the median of three referenced elements,
+ according to @c comp.
+ * @param a First iterator.
+ * @param b Second iterator.
+ * @param c Third iterator.
+ * @param comp Comparator.
+ */
+template<typename RandomAccessIterator, typename Comparator>
+ RandomAccessIterator
+ median_of_three_iterators(RandomAccessIterator a, RandomAccessIterator b,
+ RandomAccessIterator c, Comparator& comp)
+ {
+ if (comp(*a, *b))
+ if (comp(*b, *c))
+ return b;
+ else
+ if (comp(*a, *c))
+ return c;
+ else
+ return a;
+ else
+ {
+ // Just swap a and b.
+ if (comp(*a, *c))
+ return a;
+ else
+ if (comp(*b, *c))
+ return c;
+ else
+ return b;
+ }
+ }
+
+#define _GLIBCXX_PARALLEL_ASSERT(_Condition) __glibcxx_assert(_Condition)
+
+} //namespace __gnu_parallel
+
+#endif /* _GLIBCXX_PARALLEL_BASE_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/basic_iterator.h b/i686-linux/include/c++/4.4.3/parallel/basic_iterator.h
new file mode 100644
index 0000000..c5c067a
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/basic_iterator.h
@@ -0,0 +1,42 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/basic_iterator.h
+ * @brief Includes the original header files concerned with iterators
+ * except for stream iterators.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_BASIC_ITERATOR_H
+#define _GLIBCXX_PARALLEL_BASIC_ITERATOR_H 1
+
+#include <bits/c++config.h>
+#include <cstddef>
+#include <bits/stl_iterator_base_types.h>
+#include <bits/stl_iterator_base_funcs.h>
+#include <bits/stl_iterator.h>
+
+#endif /* _GLIBCXX_PARALLEL_BASIC_ITERATOR_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/checkers.h b/i686-linux/include/c++/4.4.3/parallel/checkers.h
new file mode 100644
index 0000000..819e8ad
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/checkers.h
@@ -0,0 +1,154 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/checkers.h
+ * @brief Routines for checking the correctness of algorithm results.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_CHECKERS_H
+#define _GLIBCXX_PARALLEL_CHECKERS_H 1
+
+#include <functional>
+#include <cstdio>
+#include <bits/stl_algobase.h>
+
+namespace __gnu_parallel
+{
+ /**
+ * @brief Check whether @c [begin, @c end) is sorted according to @c comp.
+ * @param begin Begin iterator of sequence.
+ * @param end End iterator of sequence.
+ * @param comp Comparator.
+ * @return @c true if sorted, @c false otherwise.
+ */
+ // XXX Comparator default template argument
+ template<typename InputIterator, typename Comparator>
+ bool
+ is_sorted(InputIterator begin, InputIterator end,
+ Comparator comp
+ = std::less<typename std::iterator_traits<InputIterator>::
+ value_type>())
+ {
+ if (begin == end)
+ return true;
+
+ InputIterator current(begin), recent(begin);
+
+ unsigned long long position = 1;
+ for (current++; current != end; current++)
+ {
+ if (comp(*current, *recent))
+ {
+ printf("is_sorted: check failed before position %i.\n",
+ position);
+ return false;
+ }
+ recent = current;
+ position++;
+ }
+
+ return true;
+ }
+
+ /**
+ * @brief Check whether @c [begin, @c end) is sorted according to @c comp.
+ * Prints the position in case an unordered pair is found.
+ * @param begin Begin iterator of sequence.
+ * @param end End iterator of sequence.
+ * @param first_failure The first failure is returned in this variable.
+ * @param comp Comparator.
+ * @return @c true if sorted, @c false otherwise.
+ */
+ // XXX Comparator default template argument
+ template<typename InputIterator, typename Comparator>
+ bool
+ is_sorted_failure(InputIterator begin, InputIterator end,
+ InputIterator& first_failure,
+ Comparator comp
+ = std::less<typename std::iterator_traits<InputIterator>::
+ value_type>())
+ {
+ if (begin == end)
+ return true;
+
+ InputIterator current(begin), recent(begin);
+
+ unsigned long long position = 1;
+ for (current++; current != end; current++)
+ {
+ if (comp(*current, *recent))
+ {
+ first_failure = current;
+ printf("is_sorted: check failed before position %lld.\n",
+ position);
+ return false;
+ }
+ recent = current;
+ position++;
+ }
+
+ first_failure = end;
+ return true;
+ }
+
+ /**
+ * @brief Check whether @c [begin, @c end) is sorted according to @c comp.
+ * Prints all unordered pair, including the surrounding two elements.
+ * @param begin Begin iterator of sequence.
+ * @param end End iterator of sequence.
+ * @param comp Comparator.
+ * @return @c true if sorted, @c false otherwise.
+ */
+ template<typename InputIterator, typename Comparator>
+ bool
+ // XXX Comparator default template argument
+ is_sorted_print_failures(InputIterator begin, InputIterator end,
+ Comparator comp
+ = std::less<typename std::iterator_traits
+ <InputIterator>::value_type>())
+ {
+ if (begin == end)
+ return true;
+
+ InputIterator recent(begin);
+ bool ok = true;
+
+ for (InputIterator pos(begin + 1); pos != end; pos++)
+ {
+ if (comp(*pos, *recent))
+ {
+ printf("%ld: %d %d %d %d\n", pos - begin, *(pos - 2),
+ *(pos- 1), *pos, *(pos + 1));
+ ok = false;
+ }
+ recent = pos;
+ }
+ return ok;
+ }
+}
+
+#endif /* _GLIBCXX_PARALLEL_CHECKERS_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/compatibility.h b/i686-linux/include/c++/4.4.3/parallel/compatibility.h
new file mode 100644
index 0000000..a5726dd
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/compatibility.h
@@ -0,0 +1,350 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/compatibility.h
+ * @brief Compatibility layer, mostly concerned with atomic operations.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Felix Putze.
+
+#ifndef _GLIBCXX_PARALLEL_COMPATIBILITY_H
+#define _GLIBCXX_PARALLEL_COMPATIBILITY_H 1
+
+#include <parallel/types.h>
+#include <parallel/base.h>
+
+#if defined(__SUNPRO_CC) && defined(__sparc)
+#include <sys/atomic.h>
+#endif
+
+#if !defined(_WIN32) || defined (__CYGWIN__)
+#include <sched.h>
+#endif
+
+#if defined(_MSC_VER)
+#include <Windows.h>
+#include <intrin.h>
+#undef max
+#undef min
+#endif
+
+#ifdef __MINGW32__
+// Including <windows.h> will drag in all the windows32 names. Since
+// that can cause user code portability problems, we just declare the
+// one needed function here.
+extern "C"
+__attribute((dllimport)) void __attribute__((stdcall)) Sleep (unsigned long);
+#endif
+
+namespace __gnu_parallel
+{
+#if defined(__ICC)
+ template<typename must_be_int = int>
+ int32 faa32(int32* x, int32 inc)
+ {
+ asm volatile("lock xadd %0,%1"
+ : "=r" (inc), "=m" (*x)
+ : "0" (inc)
+ : "memory");
+ return inc;
+ }
+#if defined(__x86_64)
+ template<typename must_be_int = int>
+ int64 faa64(int64* x, int64 inc)
+ {
+ asm volatile("lock xadd %0,%1"
+ : "=r" (inc), "=m" (*x)
+ : "0" (inc)
+ : "memory");
+ return inc;
+ }
+#endif
+#endif
+
+ // atomic functions only work on integers
+
+ /** @brief Add a value to a variable, atomically.
+ *
+ * Implementation is heavily platform-dependent.
+ * @param ptr Pointer to a 32-bit signed integer.
+ * @param addend Value to add.
+ */
+ inline int32
+ fetch_and_add_32(volatile int32* ptr, int32 addend)
+ {
+#if defined(__ICC) //x86 version
+ return _InterlockedExchangeAdd((void*)ptr, addend);
+#elif defined(__ECC) //IA-64 version
+ return _InterlockedExchangeAdd((void*)ptr, addend);
+#elif defined(__ICL) || defined(_MSC_VER)
+ return _InterlockedExchangeAdd(reinterpret_cast<volatile long*>(ptr),
+ addend);
+#elif defined(__GNUC__)
+ return __sync_fetch_and_add(ptr, addend);
+#elif defined(__SUNPRO_CC) && defined(__sparc)
+ volatile int32 before, after;
+ do
+ {
+ before = *ptr;
+ after = before + addend;
+ } while (atomic_cas_32((volatile unsigned int*)ptr, before,
+ after) != before);
+ return before;
+#else //fallback, slow
+#pragma message("slow fetch_and_add_32")
+ int32 res;
+#pragma omp critical
+ {
+ res = *ptr;
+ *(ptr) += addend;
+ }
+ return res;
+#endif
+ }
+
+ /** @brief Add a value to a variable, atomically.
+ *
+ * Implementation is heavily platform-dependent.
+ * @param ptr Pointer to a 64-bit signed integer.
+ * @param addend Value to add.
+ */
+ inline int64
+ fetch_and_add_64(volatile int64* ptr, int64 addend)
+ {
+#if defined(__ICC) && defined(__x86_64) //x86 version
+ return faa64<int>((int64*)ptr, addend);
+#elif defined(__ECC) //IA-64 version
+ return _InterlockedExchangeAdd64((void*)ptr, addend);
+#elif defined(__ICL) || defined(_MSC_VER)
+#ifndef _WIN64
+ _GLIBCXX_PARALLEL_ASSERT(false); //not available in this case
+ return 0;
+#else
+ return _InterlockedExchangeAdd64(ptr, addend);
+#endif
+#elif defined(__GNUC__) && defined(__x86_64)
+ return __sync_fetch_and_add(ptr, addend);
+#elif defined(__GNUC__) && defined(__i386) && \
+ (defined(__i686) || defined(__pentium4) || defined(__athlon))
+ return __sync_fetch_and_add(ptr, addend);
+#elif defined(__SUNPRO_CC) && defined(__sparc)
+ volatile int64 before, after;
+ do
+ {
+ before = *ptr;
+ after = before + addend;
+ } while (atomic_cas_64((volatile unsigned long long*)ptr, before,
+ after) != before);
+ return before;
+#else //fallback, slow
+#if defined(__GNUC__) && defined(__i386)
+ // XXX doesn't work with -march=native
+ //#warning "please compile with -march=i686 or better"
+#endif
+#pragma message("slow fetch_and_add_64")
+ int64 res;
+#pragma omp critical
+ {
+ res = *ptr;
+ *(ptr) += addend;
+ }
+ return res;
+#endif
+ }
+
+ /** @brief Add a value to a variable, atomically.
+ *
+ * Implementation is heavily platform-dependent.
+ * @param ptr Pointer to a signed integer.
+ * @param addend Value to add.
+ */
+ template<typename T>
+ inline T
+ fetch_and_add(volatile T* ptr, T addend)
+ {
+ if (sizeof(T) == sizeof(int32))
+ return (T)fetch_and_add_32((volatile int32*) ptr, (int32)addend);
+ else if (sizeof(T) == sizeof(int64))
+ return (T)fetch_and_add_64((volatile int64*) ptr, (int64)addend);
+ else
+ _GLIBCXX_PARALLEL_ASSERT(false);
+ }
+
+
+#if defined(__ICC)
+
+ template<typename must_be_int = int>
+ inline int32
+ cas32(volatile int32* ptr, int32 old, int32 nw)
+ {
+ int32 before;
+ __asm__ __volatile__("lock; cmpxchgl %1,%2"
+ : "=a"(before)
+ : "q"(nw), "m"(*(volatile long long*)(ptr)), "0"(old)
+ : "memory");
+ return before;
+ }
+
+#if defined(__x86_64)
+ template<typename must_be_int = int>
+ inline int64
+ cas64(volatile int64 *ptr, int64 old, int64 nw)
+ {
+ int64 before;
+ __asm__ __volatile__("lock; cmpxchgq %1,%2"
+ : "=a"(before)
+ : "q"(nw), "m"(*(volatile long long*)(ptr)), "0"(old)
+ : "memory");
+ return before;
+ }
+#endif
+
+#endif
+
+ /** @brief Compare @c *ptr and @c comparand. If equal, let @c
+ * *ptr=replacement and return @c true, return @c false otherwise.
+ *
+ * Implementation is heavily platform-dependent.
+ * @param ptr Pointer to 32-bit signed integer.
+ * @param comparand Compare value.
+ * @param replacement Replacement value.
+ */
+ inline bool
+ compare_and_swap_32(volatile int32* ptr, int32 comparand, int32 replacement)
+ {
+#if defined(__ICC) //x86 version
+ return _InterlockedCompareExchange((void*)ptr, replacement,
+ comparand) == comparand;
+#elif defined(__ECC) //IA-64 version
+ return _InterlockedCompareExchange((void*)ptr, replacement,
+ comparand) == comparand;
+#elif defined(__ICL) || defined(_MSC_VER)
+ return _InterlockedCompareExchange(reinterpret_cast<volatile long*>(ptr),
+ replacement, comparand) == comparand;
+#elif defined(__GNUC__)
+ return __sync_bool_compare_and_swap(ptr, comparand, replacement);
+#elif defined(__SUNPRO_CC) && defined(__sparc)
+ return atomic_cas_32((volatile unsigned int*)ptr, comparand,
+ replacement) == comparand;
+#else
+#pragma message("slow compare_and_swap_32")
+ bool res = false;
+#pragma omp critical
+ {
+ if (*ptr == comparand)
+ {
+ *ptr = replacement;
+ res = true;
+ }
+ }
+ return res;
+#endif
+ }
+
+ /** @brief Compare @c *ptr and @c comparand. If equal, let @c
+ * *ptr=replacement and return @c true, return @c false otherwise.
+ *
+ * Implementation is heavily platform-dependent.
+ * @param ptr Pointer to 64-bit signed integer.
+ * @param comparand Compare value.
+ * @param replacement Replacement value.
+ */
+ inline bool
+ compare_and_swap_64(volatile int64* ptr, int64 comparand, int64 replacement)
+ {
+#if defined(__ICC) && defined(__x86_64) //x86 version
+ return cas64<int>(ptr, comparand, replacement) == comparand;
+#elif defined(__ECC) //IA-64 version
+ return _InterlockedCompareExchange64((void*)ptr, replacement,
+ comparand) == comparand;
+#elif defined(__ICL) || defined(_MSC_VER)
+#ifndef _WIN64
+ _GLIBCXX_PARALLEL_ASSERT(false); //not available in this case
+ return 0;
+#else
+ return _InterlockedCompareExchange64(ptr, replacement,
+ comparand) == comparand;
+#endif
+
+#elif defined(__GNUC__) && defined(__x86_64)
+ return __sync_bool_compare_and_swap(ptr, comparand, replacement);
+#elif defined(__GNUC__) && defined(__i386) && \
+ (defined(__i686) || defined(__pentium4) || defined(__athlon))
+ return __sync_bool_compare_and_swap(ptr, comparand, replacement);
+#elif defined(__SUNPRO_CC) && defined(__sparc)
+ return atomic_cas_64((volatile unsigned long long*)ptr,
+ comparand, replacement) == comparand;
+#else
+#if defined(__GNUC__) && defined(__i386)
+ // XXX -march=native
+ //#warning "please compile with -march=i686 or better"
+#endif
+#pragma message("slow compare_and_swap_64")
+ bool res = false;
+#pragma omp critical
+ {
+ if (*ptr == comparand)
+ {
+ *ptr = replacement;
+ res = true;
+ }
+ }
+ return res;
+#endif
+ }
+
+ /** @brief Compare @c *ptr and @c comparand. If equal, let @c
+ * *ptr=replacement and return @c true, return @c false otherwise.
+ *
+ * Implementation is heavily platform-dependent.
+ * @param ptr Pointer to signed integer.
+ * @param comparand Compare value.
+ * @param replacement Replacement value. */
+ template<typename T>
+ inline bool
+ compare_and_swap(volatile T* ptr, T comparand, T replacement)
+ {
+ if (sizeof(T) == sizeof(int32))
+ return compare_and_swap_32((volatile int32*) ptr, (int32)comparand, (int32)replacement);
+ else if (sizeof(T) == sizeof(int64))
+ return compare_and_swap_64((volatile int64*) ptr, (int64)comparand, (int64)replacement);
+ else
+ _GLIBCXX_PARALLEL_ASSERT(false);
+ }
+
+ /** @brief Yield the control to another thread, without waiting for
+ the end to the time slice. */
+ inline void
+ yield()
+ {
+#if defined (_WIN32) && !defined (__CYGWIN__)
+ Sleep(0);
+#else
+ sched_yield();
+#endif
+ }
+} // end namespace
+
+#endif /* _GLIBCXX_PARALLEL_COMPATIBILITY_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/compiletime_settings.h b/i686-linux/include/c++/4.4.3/parallel/compiletime_settings.h
new file mode 100644
index 0000000..e7e31d0
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/compiletime_settings.h
@@ -0,0 +1,75 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/compiletime_settings.h
+ * @brief Defines on options concerning debugging and performance, at
+ * compile-time.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler.
+
+#include <cstdio>
+
+/** @brief Determine verbosity level of the parallel mode.
+ * Level 1 prints a message each time a parallel-mode function is entered. */
+#define _GLIBCXX_VERBOSE_LEVEL 0
+
+/** @def _GLIBCXX_CALL
+ * @brief Macro to produce log message when entering a function.
+ * @param n Input size.
+ * @see _GLIBCXX_VERBOSE_LEVEL */
+#if (_GLIBCXX_VERBOSE_LEVEL == 0)
+#define _GLIBCXX_CALL(n)
+#endif
+#if (_GLIBCXX_VERBOSE_LEVEL == 1)
+#define _GLIBCXX_CALL(n) \
+ printf(" %s:\niam = %d, n = %ld, num_threads = %d\n", \
+ __PRETTY_FUNCTION__, omp_get_thread_num(), (n), get_max_threads());
+#endif
+
+#ifndef _GLIBCXX_SCALE_DOWN_FPU
+/** @brief Use floating-point scaling instead of modulo for mapping
+ * random numbers to a range. This can be faster on certain CPUs. */
+#define _GLIBCXX_SCALE_DOWN_FPU 0
+#endif
+
+#ifndef _GLIBCXX_ASSERTIONS
+/** @brief Switch on many _GLIBCXX_PARALLEL_ASSERTions in parallel code.
+ * Should be switched on only locally. */
+#define _GLIBCXX_ASSERTIONS 0
+#endif
+
+#ifndef _GLIBCXX_RANDOM_SHUFFLE_CONSIDER_L1
+/** @brief Switch on many _GLIBCXX_PARALLEL_ASSERTions in parallel code.
+ * Consider the size of the L1 cache for
+ * __gnu_parallel::parallel_random_shuffle(). */
+#define _GLIBCXX_RANDOM_SHUFFLE_CONSIDER_L1 0
+#endif
+#ifndef _GLIBCXX_RANDOM_SHUFFLE_CONSIDER_TLB
+/** @brief Switch on many _GLIBCXX_PARALLEL_ASSERTions in parallel code.
+ * Consider the size of the TLB for
+ * __gnu_parallel::parallel_random_shuffle(). */
+#define _GLIBCXX_RANDOM_SHUFFLE_CONSIDER_TLB 0
+#endif
diff --git a/i686-linux/include/c++/4.4.3/parallel/equally_split.h b/i686-linux/include/c++/4.4.3/parallel/equally_split.h
new file mode 100644
index 0000000..ee4bfee
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/equally_split.h
@@ -0,0 +1,87 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/equally_split.h
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_EQUALLY_SPLIT_H
+#define _GLIBCXX_PARALLEL_EQUALLY_SPLIT_H 1
+
+namespace __gnu_parallel
+{
+/** @brief Function to split a sequence into parts of almost equal size.
+ *
+ * The resulting sequence s of length num_threads+1 contains the splitting
+ * positions when splitting the range [0,n) into parts of almost
+ * equal size (plus minus 1). The first entry is 0, the last one
+ * n. There may result empty parts.
+ * @param n Number of elements
+ * @param num_threads Number of parts
+ * @param s Splitters
+ * @returns End of splitter sequence, i. e. @c s+num_threads+1 */
+template<typename difference_type, typename OutputIterator>
+ OutputIterator
+ equally_split(difference_type n, thread_index_t num_threads, OutputIterator s)
+ {
+ difference_type chunk_length = n / num_threads;
+ difference_type num_longer_chunks = n % num_threads;
+ difference_type pos = 0;
+ for (thread_index_t i = 0; i < num_threads; ++i)
+ {
+ *s++ = pos;
+ pos += (i < num_longer_chunks) ? (chunk_length + 1) : chunk_length;
+ }
+ *s++ = n;
+ return s;
+ }
+
+
+/** @brief Function to split a sequence into parts of almost equal size.
+ *
+ * Returns the position of the splitting point between
+ * thread number thread_no (included) and
+ * thread number thread_no+1 (excluded).
+ * @param n Number of elements
+ * @param num_threads Number of parts
+ * @returns _SplittingAlgorithm point */
+template<typename difference_type>
+ difference_type
+ equally_split_point(difference_type n,
+ thread_index_t num_threads,
+ thread_index_t thread_no)
+ {
+ difference_type chunk_length = n / num_threads;
+ difference_type num_longer_chunks = n % num_threads;
+ if (thread_no < num_longer_chunks)
+ return thread_no * (chunk_length + 1);
+ else
+ return num_longer_chunks * (chunk_length + 1)
+ + (thread_no - num_longer_chunks) * chunk_length;
+ }
+}
+
+#endif /* _GLIBCXX_PARALLEL_EQUALLY_SPLIT_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/features.h b/i686-linux/include/c++/4.4.3/parallel/features.h
new file mode 100644
index 0000000..417606e
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/features.h
@@ -0,0 +1,104 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/features.h
+ * @brief Defines on whether to include algorithm variants.
+ *
+ * Less variants reduce executable size and compile time.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_FEATURES_H
+#define _GLIBCXX_PARALLEL_FEATURES_H 1
+
+#ifndef _GLIBCXX_MERGESORT
+/** @def _GLIBCXX_MERGESORT
+ * @brief Include parallel multi-way mergesort.
+ * @see __gnu_parallel::_Settings::sort_algorithm */
+#define _GLIBCXX_MERGESORT 1
+#endif
+
+#ifndef _GLIBCXX_QUICKSORT
+/** @def _GLIBCXX_QUICKSORT
+ * @brief Include parallel unbalanced quicksort.
+ * @see __gnu_parallel::_Settings::sort_algorithm */
+#define _GLIBCXX_QUICKSORT 1
+#endif
+
+#ifndef _GLIBCXX_BAL_QUICKSORT
+/** @def _GLIBCXX_BAL_QUICKSORT
+ * @brief Include parallel dynamically load-balanced quicksort.
+ * @see __gnu_parallel::_Settings::sort_algorithm */
+#define _GLIBCXX_BAL_QUICKSORT 1
+#endif
+
+#ifndef _GLIBCXX_FIND_GROWING_BLOCKS
+/** @brief Include the growing blocks variant for std::find.
+ * @see __gnu_parallel::_Settings::find_algorithm */
+#define _GLIBCXX_FIND_GROWING_BLOCKS 1
+#endif
+
+#ifndef _GLIBCXX_FIND_CONSTANT_SIZE_BLOCKS
+/** @brief Include the equal-sized blocks variant for std::find.
+ * @see __gnu_parallel::_Settings::find_algorithm */
+#define _GLIBCXX_FIND_CONSTANT_SIZE_BLOCKS 1
+#endif
+
+#ifndef _GLIBCXX_FIND_EQUAL_SPLIT
+/** @def _GLIBCXX_FIND_EQUAL_SPLIT
+ * @brief Include the equal splitting variant for std::find.
+ * @see __gnu_parallel::_Settings::find_algorithm */
+#define _GLIBCXX_FIND_EQUAL_SPLIT 1
+#endif
+
+
+#ifndef _GLIBCXX_TREE_INITIAL_SPLITTING
+/** @def _GLIBCXX_TREE_INITIAL_SPLITTING
+ * @brief Include the initial splitting variant for
+ * _Rb_tree::insert_unique(InputIterator beg, InputIterator end).
+ * @see __gnu_parallel::_Rb_tree */
+#define _GLIBCXX_TREE_INITIAL_SPLITTING 1
+#endif
+
+#ifndef _GLIBCXX_TREE_DYNAMIC_BALANCING
+/** @def _GLIBCXX_TREE_DYNAMIC_BALANCING
+ * @brief Include the dynamic balancing variant for
+ * _Rb_tree::insert_unique(InputIterator beg, InputIterator end).
+ * @see __gnu_parallel::_Rb_tree */
+#define _GLIBCXX_TREE_DYNAMIC_BALANCING 1
+#endif
+
+#ifndef _GLIBCXX_TREE_FULL_COPY
+/** @def _GLIBCXX_TREE_FULL_COPY
+ * @brief In order to sort the input sequence of
+ * _Rb_tree::insert_unique(InputIterator beg, InputIterator end) a
+ * full copy of the input elements is done.
+ * @see __gnu_parallel::_Rb_tree */
+#define _GLIBCXX_TREE_FULL_COPY 1
+#endif
+
+
+#endif /* _GLIBCXX_PARALLEL_FEATURES_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/find.h b/i686-linux/include/c++/4.4.3/parallel/find.h
new file mode 100644
index 0000000..0597cc5
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/find.h
@@ -0,0 +1,401 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/find.h
+ * @brief Parallel implementation base for std::find(), std::equal()
+ * and related functions.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Felix Putze and Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_FIND_H
+#define _GLIBCXX_PARALLEL_FIND_H 1
+
+#include <bits/stl_algobase.h>
+
+#include <parallel/features.h>
+#include <parallel/parallel.h>
+#include <parallel/compatibility.h>
+#include <parallel/equally_split.h>
+
+namespace __gnu_parallel
+{
+/**
+ * @brief Parallel std::find, switch for different algorithms.
+ * @param begin1 Begin iterator of first sequence.
+ * @param end1 End iterator of first sequence.
+ * @param begin2 Begin iterator of second sequence. Must have same
+ * length as first sequence.
+ * @param pred Find predicate.
+ * @param selector Functionality (e. g. std::find_if (), std::equal(),...)
+ * @return Place of finding in both sequences.
+ */
+template<typename RandomAccessIterator1,
+ typename RandomAccessIterator2,
+ typename Pred,
+ typename Selector>
+ inline std::pair<RandomAccessIterator1, RandomAccessIterator2>
+ find_template(RandomAccessIterator1 begin1, RandomAccessIterator1 end1,
+ RandomAccessIterator2 begin2, Pred pred, Selector selector)
+ {
+ switch (_Settings::get().find_algorithm)
+ {
+ case GROWING_BLOCKS:
+ return find_template(begin1, end1, begin2, pred, selector,
+ growing_blocks_tag());
+ case CONSTANT_SIZE_BLOCKS:
+ return find_template(begin1, end1, begin2, pred, selector,
+ constant_size_blocks_tag());
+ case EQUAL_SPLIT:
+ return find_template(begin1, end1, begin2, pred, selector,
+ equal_split_tag());
+ default:
+ _GLIBCXX_PARALLEL_ASSERT(false);
+ return std::make_pair(begin1, begin2);
+ }
+ }
+
+#if _GLIBCXX_FIND_EQUAL_SPLIT
+
+/**
+ * @brief Parallel std::find, equal splitting variant.
+ * @param begin1 Begin iterator of first sequence.
+ * @param end1 End iterator of first sequence.
+ * @param begin2 Begin iterator of second sequence. Second sequence
+ * must have same length as first sequence.
+ * @param pred Find predicate.
+ * @param selector Functionality (e. g. std::find_if (), std::equal(),...)
+ * @return Place of finding in both sequences.
+ */
+template<typename RandomAccessIterator1,
+ typename RandomAccessIterator2,
+ typename Pred,
+ typename Selector>
+ std::pair<RandomAccessIterator1, RandomAccessIterator2>
+ find_template(RandomAccessIterator1 begin1,
+ RandomAccessIterator1 end1,
+ RandomAccessIterator2 begin2,
+ Pred pred,
+ Selector selector,
+ equal_split_tag)
+ {
+ _GLIBCXX_CALL(end1 - begin1)
+
+ typedef std::iterator_traits<RandomAccessIterator1> traits_type;
+ typedef typename traits_type::difference_type difference_type;
+ typedef typename traits_type::value_type value_type;
+
+ difference_type length = end1 - begin1;
+ difference_type result = length;
+ difference_type* borders;
+
+ omp_lock_t result_lock;
+ omp_init_lock(&result_lock);
+
+ thread_index_t num_threads = get_max_threads();
+# pragma omp parallel num_threads(num_threads)
+ {
+# pragma omp single
+ {
+ num_threads = omp_get_num_threads();
+ borders = new difference_type[num_threads + 1];
+ equally_split(length, num_threads, borders);
+ } //single
+
+ thread_index_t iam = omp_get_thread_num();
+ difference_type start = borders[iam], stop = borders[iam + 1];
+
+ RandomAccessIterator1 i1 = begin1 + start;
+ RandomAccessIterator2 i2 = begin2 + start;
+ for (difference_type pos = start; pos < stop; ++pos)
+ {
+ #pragma omp flush(result)
+ // Result has been set to something lower.
+ if (result < pos)
+ break;
+
+ if (selector(i1, i2, pred))
+ {
+ omp_set_lock(&result_lock);
+ if (pos < result)
+ result = pos;
+ omp_unset_lock(&result_lock);
+ break;
+ }
+ ++i1;
+ ++i2;
+ }
+ } //parallel
+
+ omp_destroy_lock(&result_lock);
+ delete[] borders;
+
+ return
+ std::pair<RandomAccessIterator1, RandomAccessIterator2>(begin1 + result,
+ begin2 + result);
+ }
+
+#endif
+
+#if _GLIBCXX_FIND_GROWING_BLOCKS
+
+/**
+ * @brief Parallel std::find, growing block size variant.
+ * @param begin1 Begin iterator of first sequence.
+ * @param end1 End iterator of first sequence.
+ * @param begin2 Begin iterator of second sequence. Second sequence
+ * must have same length as first sequence.
+ * @param pred Find predicate.
+ * @param selector Functionality (e. g. std::find_if (), std::equal(),...)
+ * @return Place of finding in both sequences.
+ * @see __gnu_parallel::_Settings::find_sequential_search_size
+ * @see __gnu_parallel::_Settings::find_initial_block_size
+ * @see __gnu_parallel::_Settings::find_maximum_block_size
+ * @see __gnu_parallel::_Settings::find_increasing_factor
+ *
+ * There are two main differences between the growing blocks and
+ * the constant-size blocks variants.
+ * 1. For GB, the block size grows; for CSB, the block size is fixed.
+
+ * 2. For GB, the blocks are allocated dynamically;
+ * for CSB, the blocks are allocated in a predetermined manner,
+ * namely spacial round-robin.
+ */
+template<typename RandomAccessIterator1,
+ typename RandomAccessIterator2,
+ typename Pred,
+ typename Selector>
+ std::pair<RandomAccessIterator1, RandomAccessIterator2>
+ find_template(RandomAccessIterator1 begin1, RandomAccessIterator1 end1,
+ RandomAccessIterator2 begin2, Pred pred, Selector selector,
+ growing_blocks_tag)
+ {
+ _GLIBCXX_CALL(end1 - begin1)
+
+ typedef std::iterator_traits<RandomAccessIterator1> traits_type;
+ typedef typename traits_type::difference_type difference_type;
+ typedef typename traits_type::value_type value_type;
+
+ const _Settings& __s = _Settings::get();
+
+ difference_type length = end1 - begin1;
+
+ difference_type sequential_search_size =
+ std::min<difference_type>(length, __s.find_sequential_search_size);
+
+ // Try it sequentially first.
+ std::pair<RandomAccessIterator1, RandomAccessIterator2> find_seq_result =
+ selector.sequential_algorithm(
+ begin1, begin1 + sequential_search_size, begin2, pred);
+
+ if (find_seq_result.first != (begin1 + sequential_search_size))
+ return find_seq_result;
+
+ // Index of beginning of next free block (after sequential find).
+ difference_type next_block_start = sequential_search_size;
+ difference_type result = length;
+
+ omp_lock_t result_lock;
+ omp_init_lock(&result_lock);
+
+ thread_index_t num_threads = get_max_threads();
+# pragma omp parallel shared(result) num_threads(num_threads)
+ {
+# pragma omp single
+ num_threads = omp_get_num_threads();
+
+ // Not within first k elements -> start parallel.
+ thread_index_t iam = omp_get_thread_num();
+
+ difference_type block_size = __s.find_initial_block_size;
+ difference_type start =
+ fetch_and_add<difference_type>(&next_block_start, block_size);
+
+ // Get new block, update pointer to next block.
+ difference_type stop =
+ std::min<difference_type>(length, start + block_size);
+
+ std::pair<RandomAccessIterator1, RandomAccessIterator2> local_result;
+
+ while (start < length)
+ {
+# pragma omp flush(result)
+ // Get new value of result.
+ if (result < start)
+ {
+ // No chance to find first element.
+ break;
+ }
+
+ local_result = selector.sequential_algorithm(
+ begin1 + start, begin1 + stop, begin2 + start, pred);
+ if (local_result.first != (begin1 + stop))
+ {
+ omp_set_lock(&result_lock);
+ if ((local_result.first - begin1) < result)
+ {
+ result = local_result.first - begin1;
+
+ // Result cannot be in future blocks, stop algorithm.
+ fetch_and_add<difference_type>(&next_block_start, length);
+ }
+ omp_unset_lock(&result_lock);
+ }
+
+ block_size =
+ std::min<difference_type>(block_size * __s.find_increasing_factor,
+ __s.find_maximum_block_size);
+
+ // Get new block, update pointer to next block.
+ start =
+ fetch_and_add<difference_type>(&next_block_start, block_size);
+ stop = ((length < (start + block_size))
+ ? length : (start + block_size));
+ }
+ } //parallel
+
+ omp_destroy_lock(&result_lock);
+
+ // Return iterator on found element.
+ return
+ std::pair<RandomAccessIterator1, RandomAccessIterator2>(begin1 + result,
+ begin2 + result);
+ }
+
+#endif
+
+#if _GLIBCXX_FIND_CONSTANT_SIZE_BLOCKS
+
+/**
+ * @brief Parallel std::find, constant block size variant.
+ * @param begin1 Begin iterator of first sequence.
+ * @param end1 End iterator of first sequence.
+ * @param begin2 Begin iterator of second sequence. Second sequence
+ * must have same length as first sequence.
+ * @param pred Find predicate.
+ * @param selector Functionality (e. g. std::find_if (), std::equal(),...)
+ * @return Place of finding in both sequences.
+ * @see __gnu_parallel::_Settings::find_sequential_search_size
+ * @see __gnu_parallel::_Settings::find_block_size
+ * There are two main differences between the growing blocks and the
+ * constant-size blocks variants.
+ * 1. For GB, the block size grows; for CSB, the block size is fixed.
+ * 2. For GB, the blocks are allocated dynamically; for CSB, the
+ * blocks are allocated in a predetermined manner, namely spacial
+ * round-robin.
+ */
+template<typename RandomAccessIterator1,
+ typename RandomAccessIterator2,
+ typename Pred,
+ typename Selector>
+ std::pair<RandomAccessIterator1, RandomAccessIterator2>
+ find_template(RandomAccessIterator1 begin1, RandomAccessIterator1 end1,
+ RandomAccessIterator2 begin2, Pred pred, Selector selector,
+ constant_size_blocks_tag)
+ {
+ _GLIBCXX_CALL(end1 - begin1)
+ typedef std::iterator_traits<RandomAccessIterator1> traits_type;
+ typedef typename traits_type::difference_type difference_type;
+ typedef typename traits_type::value_type value_type;
+
+ const _Settings& __s = _Settings::get();
+
+ difference_type length = end1 - begin1;
+
+ difference_type sequential_search_size = std::min<difference_type>(
+ length, __s.find_sequential_search_size);
+
+ // Try it sequentially first.
+ std::pair<RandomAccessIterator1, RandomAccessIterator2> find_seq_result =
+ selector.sequential_algorithm(begin1, begin1 + sequential_search_size,
+ begin2, pred);
+
+ if (find_seq_result.first != (begin1 + sequential_search_size))
+ return find_seq_result;
+
+ difference_type result = length;
+ omp_lock_t result_lock;
+ omp_init_lock(&result_lock);
+
+ // Not within first sequential_search_size elements -> start parallel.
+
+ thread_index_t num_threads = get_max_threads();
+# pragma omp parallel shared(result) num_threads(num_threads)
+ {
+# pragma omp single
+ num_threads = omp_get_num_threads();
+
+ thread_index_t iam = omp_get_thread_num();
+ difference_type block_size = __s.find_initial_block_size;
+
+ // First element of thread's current iteration.
+ difference_type iteration_start = sequential_search_size;
+
+ // Where to work (initialization).
+ difference_type start = iteration_start + iam * block_size;
+ difference_type stop =
+ std::min<difference_type>(length, start + block_size);
+
+ std::pair<RandomAccessIterator1, RandomAccessIterator2> local_result;
+
+ while (start < length)
+ {
+ // Get new value of result.
+# pragma omp flush(result)
+ // No chance to find first element.
+ if (result < start)
+ break;
+ local_result = selector.sequential_algorithm(
+ begin1 + start, begin1 + stop,
+ begin2 + start, pred);
+ if (local_result.first != (begin1 + stop))
+ {
+ omp_set_lock(&result_lock);
+ if ((local_result.first - begin1) < result)
+ result = local_result.first - begin1;
+ omp_unset_lock(&result_lock);
+ // Will not find better value in its interval.
+ break;
+ }
+
+ iteration_start += num_threads * block_size;
+
+ // Where to work.
+ start = iteration_start + iam * block_size;
+ stop = std::min<difference_type>(length, start + block_size);
+ }
+ } //parallel
+
+ omp_destroy_lock(&result_lock);
+
+ // Return iterator on found element.
+ return
+ std::pair<RandomAccessIterator1, RandomAccessIterator2>(begin1 + result,
+ begin2 + result);
+ }
+#endif
+} // end namespace
+
+#endif /* _GLIBCXX_PARALLEL_FIND_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/find_selectors.h b/i686-linux/include/c++/4.4.3/parallel/find_selectors.h
new file mode 100644
index 0000000..3cbc1b8
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/find_selectors.h
@@ -0,0 +1,192 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/find_selectors.h
+ * @brief Function objects representing different tasks to be plugged
+ * into the parallel find algorithm.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Felix Putze.
+
+#ifndef _GLIBCXX_PARALLEL_FIND_SELECTORS_H
+#define _GLIBCXX_PARALLEL_FIND_SELECTORS_H 1
+
+#include <parallel/tags.h>
+#include <parallel/basic_iterator.h>
+#include <bits/stl_pair.h>
+
+namespace __gnu_parallel
+{
+ /** @brief Base class of all __gnu_parallel::find_template selectors. */
+ struct generic_find_selector
+ { };
+
+ /**
+ * @brief Test predicate on a single element, used for std::find()
+ * and std::find_if ().
+ */
+ struct find_if_selector : public generic_find_selector
+ {
+ /** @brief Test on one position.
+ * @param i1 Iterator on first sequence.
+ * @param i2 Iterator on second sequence (unused).
+ * @param pred Find predicate.
+ */
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename Pred>
+ bool
+ operator()(RandomAccessIterator1 i1, RandomAccessIterator2 i2, Pred pred)
+ { return pred(*i1); }
+
+ /** @brief Corresponding sequential algorithm on a sequence.
+ * @param begin1 Begin iterator of first sequence.
+ * @param end1 End iterator of first sequence.
+ * @param begin2 Begin iterator of second sequence.
+ * @param pred Find predicate.
+ */
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename Pred>
+ std::pair<RandomAccessIterator1, RandomAccessIterator2>
+ sequential_algorithm(RandomAccessIterator1 begin1,
+ RandomAccessIterator1 end1,
+ RandomAccessIterator2 begin2, Pred pred)
+ { return std::make_pair(find_if(begin1, end1, pred,
+ sequential_tag()), begin2); }
+ };
+
+ /** @brief Test predicate on two adjacent elements. */
+ struct adjacent_find_selector : public generic_find_selector
+ {
+ /** @brief Test on one position.
+ * @param i1 Iterator on first sequence.
+ * @param i2 Iterator on second sequence (unused).
+ * @param pred Find predicate.
+ */
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename Pred>
+ bool
+ operator()(RandomAccessIterator1 i1, RandomAccessIterator2 i2, Pred pred)
+ {
+ // Passed end iterator is one short.
+ return pred(*i1, *(i1 + 1));
+ }
+
+ /** @brief Corresponding sequential algorithm on a sequence.
+ * @param begin1 Begin iterator of first sequence.
+ * @param end1 End iterator of first sequence.
+ * @param begin2 Begin iterator of second sequence.
+ * @param pred Find predicate.
+ */
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename Pred>
+ std::pair<RandomAccessIterator1, RandomAccessIterator2>
+ sequential_algorithm(RandomAccessIterator1 begin1,
+ RandomAccessIterator1 end1,
+ RandomAccessIterator2 begin2, Pred pred)
+ {
+ // Passed end iterator is one short.
+ RandomAccessIterator1 spot = adjacent_find(begin1, end1 + 1,
+ pred, sequential_tag());
+ if (spot == (end1 + 1))
+ spot = end1;
+ return std::make_pair(spot, begin2);
+ }
+ };
+
+ /** @brief Test inverted predicate on a single element. */
+ struct mismatch_selector : public generic_find_selector
+ {
+ /**
+ * @brief Test on one position.
+ * @param i1 Iterator on first sequence.
+ * @param i2 Iterator on second sequence (unused).
+ * @param pred Find predicate.
+ */
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename Pred>
+ bool
+ operator()(RandomAccessIterator1 i1, RandomAccessIterator2 i2, Pred pred)
+ { return !pred(*i1, *i2); }
+
+ /**
+ * @brief Corresponding sequential algorithm on a sequence.
+ * @param begin1 Begin iterator of first sequence.
+ * @param end1 End iterator of first sequence.
+ * @param begin2 Begin iterator of second sequence.
+ * @param pred Find predicate.
+ */
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename Pred>
+ std::pair<RandomAccessIterator1, RandomAccessIterator2>
+ sequential_algorithm(RandomAccessIterator1 begin1,
+ RandomAccessIterator1 end1,
+ RandomAccessIterator2 begin2, Pred pred)
+ { return mismatch(begin1, end1, begin2, pred, sequential_tag()); }
+ };
+
+
+ /** @brief Test predicate on several elements. */
+ template<typename ForwardIterator>
+ struct find_first_of_selector : public generic_find_selector
+ {
+ ForwardIterator begin;
+ ForwardIterator end;
+
+ explicit find_first_of_selector(ForwardIterator begin, ForwardIterator end)
+ : begin(begin), end(end) { }
+
+ /** @brief Test on one position.
+ * @param i1 Iterator on first sequence.
+ * @param i2 Iterator on second sequence (unused).
+ * @param pred Find predicate. */
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename Pred>
+ bool
+ operator()(RandomAccessIterator1 i1, RandomAccessIterator2 i2, Pred pred)
+ {
+ for (ForwardIterator pos_in_candidates = begin;
+ pos_in_candidates != end; ++pos_in_candidates)
+ if (pred(*i1, *pos_in_candidates))
+ return true;
+ return false;
+ }
+
+ /** @brief Corresponding sequential algorithm on a sequence.
+ * @param begin1 Begin iterator of first sequence.
+ * @param end1 End iterator of first sequence.
+ * @param begin2 Begin iterator of second sequence.
+ * @param pred Find predicate. */
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename Pred>
+ std::pair<RandomAccessIterator1, RandomAccessIterator2>
+ sequential_algorithm(RandomAccessIterator1 begin1,
+ RandomAccessIterator1 end1,
+ RandomAccessIterator2 begin2, Pred pred)
+ { return std::make_pair(find_first_of(begin1, end1, begin, end, pred,
+ sequential_tag()), begin2); }
+ };
+}
+
+#endif /* _GLIBCXX_PARALLEL_FIND_SELECTORS_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/for_each.h b/i686-linux/include/c++/4.4.3/parallel/for_each.h
new file mode 100644
index 0000000..61158f8
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/for_each.h
@@ -0,0 +1,97 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/for_each.h
+ * @brief Main interface for embarrassingly parallel functions.
+ *
+ * The explicit implementation are in other header files, like
+ * workstealing.h, par_loop.h, omp_loop.h, and omp_loop_static.h.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Felix Putze.
+
+#ifndef _GLIBCXX_PARALLEL_FOR_EACH_H
+#define _GLIBCXX_PARALLEL_FOR_EACH_H 1
+
+#include <parallel/settings.h>
+#include <parallel/par_loop.h>
+#include <parallel/omp_loop.h>
+#include <parallel/workstealing.h>
+
+namespace __gnu_parallel
+{
+ /** @brief Chose the desired algorithm by evaluating @c parallelism_tag.
+ * @param begin Begin iterator of input sequence.
+ * @param end End iterator of input sequence.
+ * @param user_op A user-specified functor (comparator, predicate,
+ * associative operator,...)
+ * @param functionality functor to "process" an element with
+ * user_op (depends on desired functionality, e. g. accumulate,
+ * for_each,...
+ * @param reduction Reduction functor.
+ * @param reduction_start Initial value for reduction.
+ * @param output Output iterator.
+ * @param bound Maximum number of elements processed.
+ * @param parallelism_tag Parallelization method */
+ template<typename InputIterator, typename UserOp,
+ typename Functionality, typename Red, typename Result>
+ UserOp
+ for_each_template_random_access(InputIterator begin, InputIterator end,
+ UserOp user_op,
+ Functionality& functionality,
+ Red reduction, Result reduction_start,
+ Result& output, typename
+ std::iterator_traits<InputIterator>::
+ difference_type bound,
+ _Parallelism parallelism_tag)
+ {
+ if (parallelism_tag == parallel_unbalanced)
+ return for_each_template_random_access_ed(begin, end, user_op,
+ functionality, reduction,
+ reduction_start,
+ output, bound);
+ else if (parallelism_tag == parallel_omp_loop)
+ return for_each_template_random_access_omp_loop(begin, end, user_op,
+ functionality,
+ reduction,
+ reduction_start,
+ output, bound);
+ else if (parallelism_tag == parallel_omp_loop_static)
+ return for_each_template_random_access_omp_loop(begin, end, user_op,
+ functionality,
+ reduction,
+ reduction_start,
+ output, bound);
+ else //e. g. parallel_balanced
+ return for_each_template_random_access_workstealing(begin, end,
+ user_op,
+ functionality,
+ reduction,
+ reduction_start,
+ output, bound);
+ }
+}
+
+#endif /* _GLIBCXX_PARALLEL_FOR_EACH_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/for_each_selectors.h b/i686-linux/include/c++/4.4.3/parallel/for_each_selectors.h
new file mode 100644
index 0000000..b46d30f
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/for_each_selectors.h
@@ -0,0 +1,360 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/for_each_selectors.h
+ * @brief Functors representing different tasks to be plugged into the
+ * generic parallelization methods for embarrassingly parallel functions.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Felix Putze.
+
+#ifndef _GLIBCXX_PARALLEL_FOR_EACH_SELECTORS_H
+#define _GLIBCXX_PARALLEL_FOR_EACH_SELECTORS_H 1
+
+#include <parallel/basic_iterator.h>
+
+namespace __gnu_parallel
+{
+
+ /** @brief Generic selector for embarrassingly parallel functions. */
+ template<typename It>
+ struct generic_for_each_selector
+ {
+ /** @brief Iterator on last element processed; needed for some
+ * algorithms (e. g. std::transform()).
+ */
+ It finish_iterator;
+ };
+
+
+ /** @brief std::for_each() selector. */
+ template<typename It>
+ struct for_each_selector : public generic_for_each_selector<It>
+ {
+ /** @brief Functor execution.
+ * @param o Operator.
+ * @param i Iterator referencing object. */
+ template<typename Op>
+ bool
+ operator()(Op& o, It i)
+ {
+ o(*i);
+ return true;
+ }
+ };
+
+ /** @brief std::generate() selector. */
+ template<typename It>
+ struct generate_selector : public generic_for_each_selector<It>
+ {
+ /** @brief Functor execution.
+ * @param o Operator.
+ * @param i Iterator referencing object. */
+ template<typename Op>
+ bool
+ operator()(Op& o, It i)
+ {
+ *i = o();
+ return true;
+ }
+ };
+
+ /** @brief std::fill() selector. */
+ template<typename It>
+ struct fill_selector : public generic_for_each_selector<It>
+ {
+ /** @brief Functor execution.
+ * @param v Current value.
+ * @param i Iterator referencing object. */
+ template<typename Val>
+ bool
+ operator()(Val& v, It i)
+ {
+ *i = v;
+ return true;
+ }
+ };
+
+ /** @brief std::transform() selector, one input sequence variant. */
+ template<typename It>
+ struct transform1_selector : public generic_for_each_selector<It>
+ {
+ /** @brief Functor execution.
+ * @param o Operator.
+ * @param i Iterator referencing object. */
+ template<typename Op>
+ bool
+ operator()(Op& o, It i)
+ {
+ *i.second = o(*i.first);
+ return true;
+ }
+ };
+
+ /** @brief std::transform() selector, two input sequences variant. */
+ template<typename It>
+ struct transform2_selector : public generic_for_each_selector<It>
+ {
+ /** @brief Functor execution.
+ * @param o Operator.
+ * @param i Iterator referencing object. */
+ template<typename Op>
+ bool
+ operator()(Op& o, It i)
+ {
+ *i.third = o(*i.first, *i.second);
+ return true;
+ }
+ };
+
+ /** @brief std::replace() selector. */
+ template<typename It, typename T>
+ struct replace_selector : public generic_for_each_selector<It>
+ {
+ /** @brief Value to replace with. */
+ const T& new_val;
+
+ /** @brief Constructor
+ * @param new_val Value to replace with. */
+ explicit
+ replace_selector(const T &new_val) : new_val(new_val) {}
+
+ /** @brief Functor execution.
+ * @param v Current value.
+ * @param i Iterator referencing object. */
+ bool
+ operator()(T& v, It i)
+ {
+ if (*i == v)
+ *i = new_val;
+ return true;
+ }
+ };
+
+ /** @brief std::replace() selector. */
+ template<typename It, typename Op, typename T>
+ struct replace_if_selector : public generic_for_each_selector<It>
+ {
+ /** @brief Value to replace with. */
+ const T& new_val;
+
+ /** @brief Constructor.
+ * @param new_val Value to replace with. */
+ explicit
+ replace_if_selector(const T &new_val) : new_val(new_val) { }
+
+ /** @brief Functor execution.
+ * @param o Operator.
+ * @param i Iterator referencing object. */
+ bool
+ operator()(Op& o, It i)
+ {
+ if (o(*i))
+ *i = new_val;
+ return true;
+ }
+ };
+
+ /** @brief std::count() selector. */
+ template<typename It, typename Diff>
+ struct count_selector : public generic_for_each_selector<It>
+ {
+ /** @brief Functor execution.
+ * @param v Current value.
+ * @param i Iterator referencing object.
+ * @return 1 if count, 0 if does not count. */
+ template<typename Val>
+ Diff
+ operator()(Val& v, It i)
+ { return (v == *i) ? 1 : 0; }
+ };
+
+ /** @brief std::count_if () selector. */
+ template<typename It, typename Diff>
+ struct count_if_selector : public generic_for_each_selector<It>
+ {
+ /** @brief Functor execution.
+ * @param o Operator.
+ * @param i Iterator referencing object.
+ * @return 1 if count, 0 if does not count. */
+ template<typename Op>
+ Diff
+ operator()(Op& o, It i)
+ { return (o(*i)) ? 1 : 0; }
+ };
+
+ /** @brief std::accumulate() selector. */
+ template<typename It>
+ struct accumulate_selector : public generic_for_each_selector<It>
+ {
+ /** @brief Functor execution.
+ * @param o Operator (unused).
+ * @param i Iterator referencing object.
+ * @return The current value. */
+ template<typename Op>
+ typename std::iterator_traits<It>::value_type operator()(Op o, It i)
+ { return *i; }
+ };
+
+ /** @brief std::inner_product() selector. */
+ template<typename It, typename It2, typename T>
+ struct inner_product_selector : public generic_for_each_selector<It>
+ {
+ /** @brief Begin iterator of first sequence. */
+ It begin1_iterator;
+
+ /** @brief Begin iterator of second sequence. */
+ It2 begin2_iterator;
+
+ /** @brief Constructor.
+ * @param b1 Begin iterator of first sequence.
+ * @param b2 Begin iterator of second sequence. */
+ explicit
+ inner_product_selector(It b1, It2 b2)
+ : begin1_iterator(b1), begin2_iterator(b2) { }
+
+ /** @brief Functor execution.
+ * @param mult Multiplication functor.
+ * @param current Iterator referencing object.
+ * @return Inner product elemental result. */
+ template<typename Op>
+ T
+ operator()(Op mult, It current)
+ {
+ typename std::iterator_traits<It>::difference_type position
+ = current - begin1_iterator;
+ return mult(*current, *(begin2_iterator + position));
+ }
+ };
+
+ /** @brief Selector that just returns the passed iterator. */
+ template<typename It>
+ struct identity_selector : public generic_for_each_selector<It>
+ {
+ /** @brief Functor execution.
+ * @param o Operator (unused).
+ * @param i Iterator referencing object.
+ * @return Passed iterator. */
+ template<typename Op>
+ It
+ operator()(Op o, It i)
+ { return i; }
+ };
+
+ /** @brief Selector that returns the difference between two adjacent
+ * elements.
+ */
+ template<typename It>
+ struct adjacent_difference_selector : public generic_for_each_selector<It>
+ {
+ template<typename Op>
+ bool
+ operator()(Op& o, It i)
+ {
+ typename It::first_type go_back_one = i.first;
+ --go_back_one;
+ *i.second = o(*i.first, *go_back_one);
+ return true;
+ }
+ };
+
+ // XXX move into type_traits?
+ /** @brief Functor doing nothing
+ *
+ * For some reduction tasks (this is not a function object, but is
+ * passed as selector dummy parameter.
+ */
+ struct nothing
+ {
+ /** @brief Functor execution.
+ * @param i Iterator referencing object. */
+ template<typename It>
+ void
+ operator()(It i) { }
+ };
+
+ /** @brief Reduction function doing nothing. */
+ struct dummy_reduct
+ {
+ bool
+ operator()(bool /*x*/, bool /*y*/) const
+ { return true; }
+ };
+
+ /** @brief Reduction for finding the maximum element, using a comparator. */
+ template<typename Comp, typename It>
+ struct min_element_reduct
+ {
+ Comp& comp;
+
+ explicit
+ min_element_reduct(Comp &c) : comp(c) { }
+
+ It
+ operator()(It x, It y)
+ {
+ if (comp(*x, *y))
+ return x;
+ else
+ return y;
+ }
+ };
+
+ /** @brief Reduction for finding the maximum element, using a comparator. */
+ template<typename Comp, typename It>
+ struct max_element_reduct
+ {
+ Comp& comp;
+
+ explicit
+ max_element_reduct(Comp& c) : comp(c) { }
+
+ It
+ operator()(It x, It y)
+ {
+ if (comp(*x, *y))
+ return y;
+ else
+ return x;
+ }
+ };
+
+ /** @brief General reduction, using a binary operator. */
+ template<typename BinOp>
+ struct accumulate_binop_reduct
+ {
+ BinOp& binop;
+
+ explicit
+ accumulate_binop_reduct(BinOp& b) : binop(b) { }
+
+ template<typename Result, typename Addend>
+ Result
+ operator()(const Result& x, const Addend& y)
+ { return binop(x, y); }
+ };
+}
+
+#endif /* _GLIBCXX_PARALLEL_FOR_EACH_SELECTORS_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/iterator.h b/i686-linux/include/c++/4.4.3/parallel/iterator.h
new file mode 100644
index 0000000..c9bfd5a
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/iterator.h
@@ -0,0 +1,200 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/iterator.h
+ * @brief Helper iterator classes for the std::transform() functions.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_ITERATOR_H
+#define _GLIBCXX_PARALLEL_ITERATOR_H 1
+
+#include <parallel/basic_iterator.h>
+#include <bits/stl_pair.h>
+
+namespace __gnu_parallel
+{
+ /** @brief A pair of iterators. The usual iterator operations are
+ * applied to both child iterators.
+ */
+ template<typename Iterator1, typename Iterator2, typename IteratorCategory>
+ class iterator_pair : public std::pair<Iterator1, Iterator2>
+ {
+ private:
+ typedef iterator_pair<Iterator1, Iterator2, IteratorCategory> type;
+ typedef std::pair<Iterator1, Iterator2> base_type;
+
+ public:
+ typedef IteratorCategory iterator_category;
+ typedef void value_type;
+
+ typedef std::iterator_traits<Iterator1> traits_type;
+ typedef typename traits_type::difference_type difference_type;
+ typedef type* pointer;
+ typedef type& reference;
+
+ iterator_pair() { }
+
+ iterator_pair(const Iterator1& first, const Iterator2& second)
+ : base_type(first, second) { }
+
+ // Pre-increment operator.
+ type&
+ operator++()
+ {
+ ++base_type::first;
+ ++base_type::second;
+ return *this;
+ }
+
+ // Post-increment operator.
+ const type
+ operator++(int)
+ { return type(base_type::first++, base_type::second++); }
+
+ // Pre-decrement operator.
+ type&
+ operator--()
+ {
+ --base_type::first;
+ --base_type::second;
+ return *this;
+ }
+
+ // Post-decrement operator.
+ const type
+ operator--(int)
+ { return type(base_type::first--, base_type::second--); }
+
+ // Type conversion.
+ operator Iterator2() const
+ { return base_type::second; }
+
+ type&
+ operator=(const type& other)
+ {
+ base_type::first = other.first;
+ base_type::second = other.second;
+ return *this;
+ }
+
+ type
+ operator+(difference_type delta) const
+ { return type(base_type::first + delta, base_type::second + delta); }
+
+ difference_type
+ operator-(const type& other) const
+ { return base_type::first - other.first; }
+ };
+
+
+ /** @brief A triple of iterators. The usual iterator operations are
+ applied to all three child iterators.
+ */
+ template<typename Iterator1, typename Iterator2, typename Iterator3,
+ typename IteratorCategory>
+ class iterator_triple
+ {
+ private:
+ typedef iterator_triple<Iterator1, Iterator2, Iterator3,
+ IteratorCategory> type;
+
+ public:
+ typedef IteratorCategory iterator_category;
+ typedef void value_type;
+ typedef typename std::iterator_traits<Iterator1>::difference_type
+ difference_type;
+ typedef type* pointer;
+ typedef type& reference;
+
+ Iterator1 first;
+ Iterator2 second;
+ Iterator3 third;
+
+ iterator_triple() { }
+
+ iterator_triple(const Iterator1& _first, const Iterator2& _second,
+ const Iterator3& _third)
+ {
+ first = _first;
+ second = _second;
+ third = _third;
+ }
+
+ // Pre-increment operator.
+ type&
+ operator++()
+ {
+ ++first;
+ ++second;
+ ++third;
+ return *this;
+ }
+
+ // Post-increment operator.
+ const type
+ operator++(int)
+ { return type(first++, second++, third++); }
+
+ // Pre-decrement operator.
+ type&
+ operator--()
+ {
+ --first;
+ --second;
+ --third;
+ return *this;
+ }
+
+ // Post-decrement operator.
+ const type
+ operator--(int)
+ { return type(first--, second--, third--); }
+
+ // Type conversion.
+ operator Iterator3() const
+ { return third; }
+
+ type&
+ operator=(const type& other)
+ {
+ first = other.first;
+ second = other.second;
+ third = other.third;
+ return *this;
+ }
+
+ type
+ operator+(difference_type delta) const
+ { return type(first + delta, second + delta, third + delta); }
+
+ difference_type
+ operator-(const type& other) const
+ { return first - other.first; }
+ };
+}
+
+#endif /* _GLIBCXX_PARALLEL_ITERATOR_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/list_partition.h b/i686-linux/include/c++/4.4.3/parallel/list_partition.h
new file mode 100644
index 0000000..a359a3f
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/list_partition.h
@@ -0,0 +1,176 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/list_partition.h
+ * @brief Functionality to split sequence referenced by only input
+ * iterators.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Leonor Frias Moya and Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_LIST_PARTITION_H
+#define _GLIBCXX_PARALLEL_LIST_PARTITION_H 1
+
+#include <parallel/parallel.h>
+#include <vector>
+
+namespace __gnu_parallel
+{
+ /** @brief Shrinks and doubles the ranges.
+ * @param os_starts Start positions worked on (oversampled).
+ * @param count_to_two Counts up to 2.
+ * @param range_length Current length of a chunk.
+ * @param make_twice Whether the @c os_starts is allowed to be
+ * grown or not
+ */
+ template<typename InputIterator>
+ void
+ shrink_and_double(std::vector<InputIterator>& os_starts,
+ size_t& count_to_two, size_t& range_length,
+ const bool make_twice)
+ {
+ ++count_to_two;
+ if (not make_twice or count_to_two < 2)
+ shrink(os_starts, count_to_two, range_length);
+ else
+ {
+ os_starts.resize((os_starts.size() - 1) * 2 + 1);
+ count_to_two = 0;
+ }
+ }
+
+ /** @brief Combines two ranges into one and thus halves the number of ranges.
+ * @param os_starts Start positions worked on (oversampled).
+ * @param count_to_two Counts up to 2.
+ * @param range_length Current length of a chunk. */
+ template<typename InputIterator>
+ void
+ shrink(std::vector<InputIterator>& os_starts, size_t& count_to_two,
+ size_t& range_length)
+ {
+ for (typename std::vector<InputIterator>::size_type i = 0;
+ i <= (os_starts.size() / 2); ++i)
+ os_starts[i] = os_starts[i * 2];
+ range_length *= 2;
+ }
+
+ /** @brief Splits a sequence given by input iterators into parts of
+ * almost equal size
+ *
+ * The function needs only one pass over the sequence.
+ * @param begin Begin iterator of input sequence.
+ * @param end End iterator of input sequence.
+ * @param starts Start iterators for the resulting parts, dimension
+ * @c num_parts+1. For convenience, @c starts @c [num_parts]
+ * contains the end iterator of the sequence.
+ * @param lengths Length of the resulting parts.
+ * @param num_parts Number of parts to split the sequence into.
+ * @param f Functor to be applied to each element by traversing it
+ * @param oversampling Oversampling factor. If 0, then the
+ * partitions will differ in at most @f$ \sqrt{\mathrm{end} -
+ * \mathrm{begin}} @f$ elements. Otherwise, the ratio between the
+ * longest and the shortest part is bounded by @f$
+ * 1/(\mathrm{oversampling} \cdot \mathrm{num\_parts}) @f$.
+ * @return Length of the whole sequence.
+ */
+ template<typename InputIterator, typename FunctorType>
+ size_t
+ list_partition(const InputIterator begin, const InputIterator end,
+ InputIterator* starts, size_t* lengths, const int num_parts,
+ FunctorType& f, int oversampling = 0)
+ {
+ bool make_twice = false;
+
+ // The resizing algorithm is chosen according to the oversampling factor.
+ if (oversampling == 0)
+ {
+ make_twice = true;
+ oversampling = 1;
+ }
+
+ std::vector<InputIterator> os_starts(2 * oversampling * num_parts + 1);
+
+ os_starts[0]= begin;
+ InputIterator prev = begin, it = begin;
+ size_t dist_limit = 0, dist = 0;
+ size_t cur = 1, next = 1;
+ size_t range_length = 1;
+ size_t count_to_two = 0;
+ while (it != end)
+ {
+ cur = next;
+ for (; cur < os_starts.size() and it != end; ++cur)
+ {
+ for (dist_limit += range_length;
+ dist < dist_limit and it != end; ++dist)
+ {
+ f(it);
+ ++it;
+ }
+ os_starts[cur] = it;
+ }
+
+ // Must compare for end and not cur < os_starts.size() , because
+ // cur could be == os_starts.size() as well
+ if (it == end)
+ break;
+
+ shrink_and_double(os_starts, count_to_two, range_length, make_twice);
+ next = os_starts.size() / 2 + 1;
+ }
+
+ // Calculation of the parts (one must be extracted from current
+ // because the partition beginning at end, consists only of
+ // itself).
+ size_t size_part = (cur - 1) / num_parts;
+ int size_greater = static_cast<int>((cur - 1) % num_parts);
+ starts[0] = os_starts[0];
+
+ size_t index = 0;
+
+ // Smallest partitions.
+ for (int i = 1; i < (num_parts + 1 - size_greater); ++i)
+ {
+ lengths[i - 1] = size_part * range_length;
+ index += size_part;
+ starts[i] = os_starts[index];
+ }
+
+ // Biggest partitions.
+ for (int i = num_parts + 1 - size_greater; i <= num_parts; ++i)
+ {
+ lengths[i - 1] = (size_part+1) * range_length;
+ index += (size_part+1);
+ starts[i] = os_starts[index];
+ }
+
+ // Correction of the end size (the end iteration has not finished).
+ lengths[num_parts - 1] -= (dist_limit - dist);
+
+ return dist;
+ }
+}
+
+#endif /* _GLIBCXX_PARALLEL_LIST_PARTITION_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/losertree.h b/i686-linux/include/c++/4.4.3/parallel/losertree.h
new file mode 100644
index 0000000..6dbd592
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/losertree.h
@@ -0,0 +1,1021 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/losertree.h
+* @brief Many generic loser tree variants.
+* This file is a GNU parallel extension to the Standard C++ Library.
+*/
+
+// Written by Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_LOSERTREE_H
+#define _GLIBCXX_PARALLEL_LOSERTREE_H 1
+
+#include <functional>
+
+#include <bits/stl_algobase.h>
+#include <parallel/features.h>
+#include <parallel/base.h>
+
+namespace __gnu_parallel
+{
+
+/**
+ * @brief Guarded loser/tournament tree.
+ *
+ * The smallest element is at the top.
+ *
+ * Guarding is done explicitly through one flag sup per element,
+ * inf is not needed due to a better initialization routine. This
+ * is a well-performing variant.
+ *
+ * @param T the element type
+ * @param Comparator the comparator to use, defaults to std::less<T>
+ */
+template<typename T, typename Comparator>
+class LoserTreeBase
+{
+protected:
+ /** @brief Internal representation of a LoserTree element. */
+ struct Loser
+ {
+ /** @brief flag, true iff this is a "maximum" sentinel. */
+ bool sup;
+ /** @brief index of the source sequence. */
+ int source;
+ /** @brief key of the element in the LoserTree. */
+ T key;
+ };
+
+ unsigned int ik, k, offset;
+
+ /** log_2{k} */
+ unsigned int _M_log_k;
+
+ /** @brief LoserTree elements. */
+ Loser* losers;
+
+ /** @brief Comparator to use. */
+ Comparator comp;
+
+ /**
+ * @brief State flag that determines whether the LoserTree is empty.
+ *
+ * Only used for building the LoserTree.
+ */
+ bool first_insert;
+
+public:
+ /**
+ * @brief The constructor.
+ *
+ * @param _k The number of sequences to merge.
+ * @param _comp The comparator to use.
+ */
+ LoserTreeBase(unsigned int _k, Comparator _comp)
+ : comp(_comp)
+ {
+ ik = _k;
+
+ // Compute log_2{k} for the Loser Tree
+ _M_log_k = __log2(ik - 1) + 1;
+
+ // Next greater power of 2.
+ k = 1 << _M_log_k;
+ offset = k;
+
+ // Avoid default-constructing losers[].key
+ losers = static_cast<Loser*>(::operator new(2 * k * sizeof(Loser)));
+ for (unsigned int i = ik - 1; i < k; ++i)
+ losers[i + k].sup = true;
+
+ first_insert = true;
+ }
+
+ /**
+ * @brief The destructor.
+ */
+ ~LoserTreeBase()
+ { ::operator delete(losers); }
+
+ /**
+ * @brief Initializes the sequence "source" with the element "key".
+ *
+ * @param key the element to insert
+ * @param source index of the source sequence
+ * @param sup flag that determines whether the value to insert is an
+ * explicit supremum.
+ */
+ inline void
+ insert_start(const T& key, int source, bool sup)
+ {
+ unsigned int pos = k + source;
+
+ if(first_insert)
+ {
+ // Construct all keys, so we can easily deconstruct them.
+ for (unsigned int i = 0; i < (2 * k); ++i)
+ new(&(losers[i].key)) T(key);
+ first_insert = false;
+ }
+ else
+ new(&(losers[pos].key)) T(key);
+
+ losers[pos].sup = sup;
+ losers[pos].source = source;
+ }
+
+ /**
+ * @return the index of the sequence with the smallest element.
+ */
+ int get_min_source()
+ { return losers[0].source; }
+};
+
+/**
+ * @brief Stable LoserTree variant.
+ *
+ * Provides the stable implementations of insert_start, init_winner,
+ * init and delete_min_insert.
+ *
+ * Unstable variant is done using partial specialisation below.
+ */
+template<bool stable/* default == true */, typename T, typename Comparator>
+class LoserTree : public LoserTreeBase<T, Comparator>
+{
+ typedef LoserTreeBase<T, Comparator> Base;
+ using Base::k;
+ using Base::losers;
+ using Base::first_insert;
+
+public:
+ LoserTree(unsigned int _k, Comparator _comp)
+ : Base::LoserTreeBase(_k, _comp)
+ {}
+
+ unsigned int
+ init_winner(unsigned int root)
+ {
+ if (root >= k)
+ {
+ return root;
+ }
+ else
+ {
+ unsigned int left = init_winner (2 * root);
+ unsigned int right = init_winner (2 * root + 1);
+ if (losers[right].sup
+ || (!losers[left].sup
+ && !comp(losers[right].key, losers[left].key)))
+ {
+ // Left one is less or equal.
+ losers[root] = losers[right];
+ return left;
+ }
+ else
+ {
+ // Right one is less.
+ losers[root] = losers[left];
+ return right;
+ }
+ }
+ }
+
+ void init()
+ { losers[0] = losers[init_winner(1)]; }
+
+ /**
+ * @brief Delete the smallest element and insert a new element from
+ * the previously smallest element's sequence.
+ *
+ * This implementation is stable.
+ */
+ // Do not pass a const reference since key will be used as local variable.
+ void delete_min_insert(T key, bool sup)
+ {
+#if _GLIBCXX_ASSERTIONS
+ // no dummy sequence can ever be at the top!
+ _GLIBCXX_PARALLEL_ASSERT(losers[0].source != -1);
+#endif
+
+ int source = losers[0].source;
+ for (unsigned int pos = (k + source) / 2; pos > 0; pos /= 2)
+ {
+ // The smaller one gets promoted, ties are broken by source.
+ if ((sup && (!losers[pos].sup || losers[pos].source < source))
+ || (!sup && !losers[pos].sup
+ && ((comp(losers[pos].key, key))
+ || (!comp(key, losers[pos].key)
+ && losers[pos].source < source))))
+ {
+ // The other one is smaller.
+ std::swap(losers[pos].sup, sup);
+ std::swap(losers[pos].source, source);
+ std::swap(losers[pos].key, key);
+ }
+ }
+
+ losers[0].sup = sup;
+ losers[0].source = source;
+ losers[0].key = key;
+ }
+};
+
+/**
+ * @brief Unstable LoserTree variant.
+ *
+ * Stability (non-stable here) is selected with partial specialization.
+ */
+template<typename T, typename Comparator>
+class LoserTree</* stable == */false, T, Comparator> :
+ public LoserTreeBase<T, Comparator>
+{
+ typedef LoserTreeBase<T, Comparator> Base;
+ using Base::_M_log_k;
+ using Base::k;
+ using Base::losers;
+ using Base::first_insert;
+
+public:
+ LoserTree(unsigned int _k, Comparator _comp)
+ : Base::LoserTreeBase(_k, _comp)
+ {}
+
+ /**
+ * Computes the winner of the competition at position "root".
+ *
+ * Called recursively (starting at 0) to build the initial tree.
+ *
+ * @param root index of the "game" to start.
+ */
+ unsigned int
+ init_winner (unsigned int root)
+ {
+ if (root >= k)
+ {
+ return root;
+ }
+ else
+ {
+ unsigned int left = init_winner (2 * root);
+ unsigned int right = init_winner (2 * root + 1);
+ if (losers[right].sup ||
+ (!losers[left].sup
+ && !comp(losers[right].key, losers[left].key)))
+ {
+ // Left one is less or equal.
+ losers[root] = losers[right];
+ return left;
+ }
+ else
+ {
+ // Right one is less.
+ losers[root] = losers[left];
+ return right;
+ }
+ }
+ }
+
+ inline void
+ init()
+ { losers[0] = losers[init_winner(1)]; }
+
+ /**
+ * Delete the key smallest element and insert the element key instead.
+ *
+ * @param key the key to insert
+ * @param sup true iff key is an explicitly marked supremum
+ */
+ // Do not pass a const reference since key will be used as local variable.
+ inline void
+ delete_min_insert(T key, bool sup)
+ {
+#if _GLIBCXX_ASSERTIONS
+ // no dummy sequence can ever be at the top!
+ _GLIBCXX_PARALLEL_ASSERT(losers[0].source != -1);
+#endif
+
+ int source = losers[0].source;
+ for (unsigned int pos = (k + source) / 2; pos > 0; pos /= 2)
+ {
+ // The smaller one gets promoted.
+ if (sup || (!losers[pos].sup && comp(losers[pos].key, key)))
+ {
+ // The other one is smaller.
+ std::swap(losers[pos].sup, sup);
+ std::swap(losers[pos].source, source);
+ std::swap(losers[pos].key, key);
+ }
+ }
+
+ losers[0].sup = sup;
+ losers[0].source = source;
+ losers[0].key = key;
+ }
+};
+
+
+/**
+ * @brief Base class of Loser Tree implementation using pointers.
+ */
+template<typename T, typename Comparator>
+class LoserTreePointerBase
+{
+protected:
+ /** @brief Internal representation of LoserTree elements. */
+ struct Loser
+ {
+ bool sup;
+ int source;
+ const T* keyp;
+ };
+
+ unsigned int ik, k, offset;
+ Loser* losers;
+ Comparator comp;
+
+public:
+ LoserTreePointerBase(unsigned int _k, Comparator _comp = std::less<T>())
+ : comp(_comp)
+ {
+ ik = _k;
+
+ // Next greater power of 2.
+ k = 1 << (__log2(ik - 1) + 1);
+ offset = k;
+ losers = new Loser[k * 2];
+ for (unsigned int i = ik - 1; i < k; i++)
+ losers[i + k].sup = true;
+ }
+
+ ~LoserTreePointerBase()
+ { ::operator delete[](losers); }
+
+ int get_min_source()
+ { return losers[0].source; }
+
+ void insert_start(const T& key, int source, bool sup)
+ {
+ unsigned int pos = k + source;
+
+ losers[pos].sup = sup;
+ losers[pos].source = source;
+ losers[pos].keyp = &key;
+ }
+};
+
+/**
+ * @brief Stable LoserTree implementation.
+ *
+ * The unstable variant is implemented using partial instantiation below.
+ */
+template<bool stable/* default == true */, typename T, typename Comparator>
+class LoserTreePointer : public LoserTreePointerBase<T, Comparator>
+{
+ typedef LoserTreePointerBase<T, Comparator> Base;
+ using Base::k;
+ using Base::losers;
+
+public:
+ LoserTreePointer(unsigned int _k, Comparator _comp = std::less<T>())
+ : Base::LoserTreePointerBase(_k, _comp)
+ {}
+
+ unsigned int
+ init_winner(unsigned int root)
+ {
+ if (root >= k)
+ {
+ return root;
+ }
+ else
+ {
+ unsigned int left = init_winner (2 * root);
+ unsigned int right = init_winner (2 * root + 1);
+ if (losers[right].sup
+ || (!losers[left].sup && !comp(*losers[right].keyp,
+ *losers[left].keyp)))
+ {
+ // Left one is less or equal.
+ losers[root] = losers[right];
+ return left;
+ }
+ else
+ {
+ // Right one is less.
+ losers[root] = losers[left];
+ return right;
+ }
+ }
+ }
+
+ void init()
+ { losers[0] = losers[init_winner(1)]; }
+
+ void delete_min_insert(const T& key, bool sup)
+ {
+#if _GLIBCXX_ASSERTIONS
+ // no dummy sequence can ever be at the top!
+ _GLIBCXX_PARALLEL_ASSERT(losers[0].source != -1);
+#endif
+
+ const T* keyp = &key;
+ int source = losers[0].source;
+ for (unsigned int pos = (k + source) / 2; pos > 0; pos /= 2)
+ {
+ // The smaller one gets promoted, ties are broken by source.
+ if ((sup && (!losers[pos].sup || losers[pos].source < source)) ||
+ (!sup && !losers[pos].sup &&
+ ((comp(*losers[pos].keyp, *keyp)) ||
+ (!comp(*keyp, *losers[pos].keyp)
+ && losers[pos].source < source))))
+ {
+ // The other one is smaller.
+ std::swap(losers[pos].sup, sup);
+ std::swap(losers[pos].source, source);
+ std::swap(losers[pos].keyp, keyp);
+ }
+ }
+
+ losers[0].sup = sup;
+ losers[0].source = source;
+ losers[0].keyp = keyp;
+ }
+};
+
+/**
+ * @brief Unstable LoserTree implementation.
+ *
+ * The stable variant is above.
+ */
+template<typename T, typename Comparator>
+class LoserTreePointer</* stable == */false, T, Comparator> :
+ public LoserTreePointerBase<T, Comparator>
+{
+ typedef LoserTreePointerBase<T, Comparator> Base;
+ using Base::k;
+ using Base::losers;
+
+public:
+ LoserTreePointer(unsigned int _k, Comparator _comp = std::less<T>())
+ : Base::LoserTreePointerBase(_k, _comp)
+ {}
+
+ unsigned int
+ init_winner(unsigned int root)
+ {
+ if (root >= k)
+ {
+ return root;
+ }
+ else
+ {
+ unsigned int left = init_winner (2 * root);
+ unsigned int right = init_winner (2 * root + 1);
+ if (losers[right].sup
+ || (!losers[left].sup
+ && !comp(*losers[right].keyp, *losers[left].keyp)))
+ {
+ // Left one is less or equal.
+ losers[root] = losers[right];
+ return left;
+ }
+ else
+ {
+ // Right one is less.
+ losers[root] = losers[left];
+ return right;
+ }
+ }
+ }
+
+ void init()
+ { losers[0] = losers[init_winner(1)]; }
+
+ void delete_min_insert(const T& key, bool sup)
+ {
+#if _GLIBCXX_ASSERTIONS
+ // no dummy sequence can ever be at the top!
+ _GLIBCXX_PARALLEL_ASSERT(losers[0].source != -1);
+#endif
+
+ const T* keyp = &key;
+ int source = losers[0].source;
+ for (unsigned int pos = (k + source) / 2; pos > 0; pos /= 2)
+ {
+ // The smaller one gets promoted.
+ if (sup || (!losers[pos].sup && comp(*losers[pos].keyp, *keyp)))
+ {
+ // The other one is smaller.
+ std::swap(losers[pos].sup, sup);
+ std::swap(losers[pos].source, source);
+ std::swap(losers[pos].keyp, keyp);
+ }
+ }
+
+ losers[0].sup = sup;
+ losers[0].source = source;
+ losers[0].keyp = keyp;
+ }
+};
+
+/** @brief Base class for unguarded LoserTree implementation.
+ *
+ * The whole element is copied into the tree structure.
+ *
+ * No guarding is done, therefore not a single input sequence must
+ * run empty. Unused sequence heads are marked with a sentinel which
+ * is &gt; all elements that are to be merged.
+ *
+ * This is a very fast variant.
+ */
+template<typename T, typename Comparator>
+class LoserTreeUnguardedBase
+{
+protected:
+ struct Loser
+ {
+ int source;
+ T key;
+ };
+
+ unsigned int ik, k, offset;
+ Loser* losers;
+ Comparator comp;
+
+public:
+ inline
+ LoserTreeUnguardedBase(unsigned int _k, const T _sentinel,
+ Comparator _comp = std::less<T>())
+ : comp(_comp)
+ {
+ ik = _k;
+
+ // Next greater power of 2.
+ k = 1 << (__log2(ik - 1) + 1);
+ offset = k;
+ // Avoid default-constructing losers[].key
+ losers = static_cast<Loser*>(::operator new(2 * k * sizeof(Loser)));
+
+ for (unsigned int i = k + ik - 1; i < (2 * k); ++i)
+ {
+ losers[i].key = _sentinel;
+ losers[i].source = -1;
+ }
+ }
+
+ inline ~LoserTreeUnguardedBase()
+ { ::operator delete(losers); }
+
+ inline int
+ get_min_source()
+ {
+#if _GLIBCXX_ASSERTIONS
+ // no dummy sequence can ever be at the top!
+ _GLIBCXX_PARALLEL_ASSERT(losers[0].source != -1);
+#endif
+ return losers[0].source;
+ }
+
+ inline void
+ insert_start(const T& key, int source, bool)
+ {
+ unsigned int pos = k + source;
+
+ new(&(losers[pos].key)) T(key);
+ losers[pos].source = source;
+ }
+};
+
+/**
+ * @brief Stable implementation of unguarded LoserTree.
+ *
+ * Unstable variant is selected below with partial specialization.
+ */
+template<bool stable/* default == true */, typename T, typename Comparator>
+class LoserTreeUnguarded : public LoserTreeUnguardedBase<T, Comparator>
+{
+ typedef LoserTreeUnguardedBase<T, Comparator> Base;
+ using Base::k;
+ using Base::losers;
+
+public:
+ LoserTreeUnguarded(unsigned int _k, const T _sentinel,
+ Comparator _comp = std::less<T>())
+ : Base::LoserTreeUnguardedBase(_k, _sentinel, _comp)
+ {}
+
+ unsigned int
+ init_winner(unsigned int root)
+ {
+ if (root >= k)
+ {
+ return root;
+ }
+ else
+ {
+ unsigned int left = init_winner (2 * root);
+ unsigned int right = init_winner (2 * root + 1);
+ if (!comp(losers[right].key, losers[left].key))
+ {
+ // Left one is less or equal.
+ losers[root] = losers[right];
+ return left;
+ }
+ else
+ {
+ // Right one is less.
+ losers[root] = losers[left];
+ return right;
+ }
+ }
+ }
+
+ inline void
+ init()
+ {
+ losers[0] = losers[init_winner(1)];
+
+#if _GLIBCXX_ASSERTIONS
+ // no dummy sequence can ever be at the top at the beginning (0 sequences!)
+ _GLIBCXX_PARALLEL_ASSERT(losers[0].source != -1);
+#endif
+ }
+
+ // Do not pass a const reference since key will be used as local variable.
+ inline void
+ delete_min_insert(T key, bool)
+ {
+#if _GLIBCXX_ASSERTIONS
+ // no dummy sequence can ever be at the top!
+ _GLIBCXX_PARALLEL_ASSERT(losers[0].source != -1);
+#endif
+
+ int source = losers[0].source;
+ for (unsigned int pos = (k + source) / 2; pos > 0; pos /= 2)
+ {
+ // The smaller one gets promoted, ties are broken by source.
+ if (comp(losers[pos].key, key)
+ || (!comp(key, losers[pos].key) && losers[pos].source < source))
+ {
+ // The other one is smaller.
+ std::swap(losers[pos].source, source);
+ std::swap(losers[pos].key, key);
+ }
+ }
+
+ losers[0].source = source;
+ losers[0].key = key;
+ }
+};
+
+/**
+ * @brief Non-Stable implementation of unguarded LoserTree.
+ *
+ * Stable implementation is above.
+ */
+template<typename T, typename Comparator>
+class LoserTreeUnguarded</* stable == */false, T, Comparator> :
+ public LoserTreeUnguardedBase<T, Comparator>
+{
+ typedef LoserTreeUnguardedBase<T, Comparator> Base;
+ using Base::k;
+ using Base::losers;
+
+public:
+ LoserTreeUnguarded(unsigned int _k, const T _sentinel,
+ Comparator _comp = std::less<T>())
+ : Base::LoserTreeUnguardedBase(_k, _sentinel, _comp)
+ {}
+
+ unsigned int
+ init_winner (unsigned int root)
+ {
+ if (root >= k)
+ {
+ return root;
+ }
+ else
+ {
+ unsigned int left = init_winner (2 * root);
+ unsigned int right = init_winner (2 * root + 1);
+
+#if _GLIBCXX_ASSERTIONS
+ // If left one is sentinel then right one must be, too.
+ if (losers[left].source == -1)
+ _GLIBCXX_PARALLEL_ASSERT(losers[right].source == -1);
+#endif
+
+ if (!comp(losers[right].key, losers[left].key))
+ {
+ // Left one is less or equal.
+ losers[root] = losers[right];
+ return left;
+ }
+ else
+ {
+ // Right one is less.
+ losers[root] = losers[left];
+ return right;
+ }
+ }
+ }
+
+ inline void
+ init()
+ {
+ losers[0] = losers[init_winner(1)];
+
+#if _GLIBCXX_ASSERTIONS
+ // no dummy sequence can ever be at the top at the beginning (0 sequences!)
+ _GLIBCXX_PARALLEL_ASSERT(losers[0].source != -1);
+#endif
+ }
+
+ // Do not pass a const reference since key will be used as local variable.
+ inline void
+ delete_min_insert(T key, bool)
+ {
+#if _GLIBCXX_ASSERTIONS
+ // no dummy sequence can ever be at the top!
+ _GLIBCXX_PARALLEL_ASSERT(losers[0].source != -1);
+#endif
+
+ int source = losers[0].source;
+ for (unsigned int pos = (k + source) / 2; pos > 0; pos /= 2)
+ {
+ // The smaller one gets promoted.
+ if (comp(losers[pos].key, key))
+ {
+ // The other one is smaller.
+ std::swap(losers[pos].source, source);
+ std::swap(losers[pos].key, key);
+ }
+ }
+
+ losers[0].source = source;
+ losers[0].key = key;
+ }
+};
+
+/** @brief Unguarded loser tree, keeping only pointers to the
+* elements in the tree structure.
+*
+* No guarding is done, therefore not a single input sequence must
+* run empty. This is a very fast variant.
+*/
+template<typename T, typename Comparator>
+class LoserTreePointerUnguardedBase
+{
+protected:
+ struct Loser
+ {
+ int source;
+ const T* keyp;
+ };
+
+ unsigned int ik, k, offset;
+ Loser* losers;
+ Comparator comp;
+
+public:
+
+ inline
+ LoserTreePointerUnguardedBase(unsigned int _k, const T& _sentinel,
+ Comparator _comp = std::less<T>())
+ : comp(_comp)
+ {
+ ik = _k;
+
+ // Next greater power of 2.
+ k = 1 << (__log2(ik - 1) + 1);
+ offset = k;
+ // Avoid default-constructing losers[].key
+ losers = new Loser[2 * k];
+
+ for (unsigned int i = k + ik - 1; i < (2 * k); ++i)
+ {
+ losers[i].keyp = &_sentinel;
+ losers[i].source = -1;
+ }
+ }
+
+ inline ~LoserTreePointerUnguardedBase()
+ { delete[] losers; }
+
+ inline int
+ get_min_source()
+ {
+#if _GLIBCXX_ASSERTIONS
+ // no dummy sequence can ever be at the top!
+ _GLIBCXX_PARALLEL_ASSERT(losers[0].source != -1);
+#endif
+ return losers[0].source;
+ }
+
+ inline void
+ insert_start(const T& key, int source, bool)
+ {
+ unsigned int pos = k + source;
+
+ losers[pos].keyp = &key;
+ losers[pos].source = source;
+ }
+};
+
+/**
+ * @brief Stable unguarded LoserTree variant storing pointers.
+ *
+ * Unstable variant is implemented below using partial specialization.
+ */
+template<bool stable/* default == true */, typename T, typename Comparator>
+class LoserTreePointerUnguarded :
+ public LoserTreePointerUnguardedBase<T, Comparator>
+{
+ typedef LoserTreePointerUnguardedBase<T, Comparator> Base;
+ using Base::k;
+ using Base::losers;
+
+public:
+ LoserTreePointerUnguarded(unsigned int _k, const T& _sentinel,
+ Comparator _comp = std::less<T>())
+ : Base::LoserTreePointerUnguardedBase(_k, _sentinel, _comp)
+ {}
+
+ unsigned int
+ init_winner(unsigned int root)
+ {
+ if (root >= k)
+ {
+ return root;
+ }
+ else
+ {
+ unsigned int left = init_winner (2 * root);
+ unsigned int right = init_winner (2 * root + 1);
+ if (!comp(*losers[right].keyp, *losers[left].keyp))
+ {
+ // Left one is less or equal.
+ losers[root] = losers[right];
+ return left;
+ }
+ else
+ {
+ // Right one is less.
+ losers[root] = losers[left];
+ return right;
+ }
+ }
+ }
+
+ inline void
+ init()
+ {
+ losers[0] = losers[init_winner(1)];
+
+#if _GLIBCXX_ASSERTIONS
+ // no dummy sequence can ever be at the top at the beginning (0 sequences!)
+ _GLIBCXX_PARALLEL_ASSERT(losers[0].source != -1);
+#endif
+ }
+
+ inline void
+ delete_min_insert(const T& key, bool sup)
+ {
+#if _GLIBCXX_ASSERTIONS
+ // no dummy sequence can ever be at the top!
+ _GLIBCXX_PARALLEL_ASSERT(losers[0].source != -1);
+#endif
+
+ const T* keyp = &key;
+ int source = losers[0].source;
+ for (unsigned int pos = (k + source) / 2; pos > 0; pos /= 2)
+ {
+ // The smaller one gets promoted, ties are broken by source.
+ if (comp(*losers[pos].keyp, *keyp)
+ || (!comp(*keyp, *losers[pos].keyp) && losers[pos].source < source))
+ {
+ // The other one is smaller.
+ std::swap(losers[pos].source, source);
+ std::swap(losers[pos].keyp, keyp);
+ }
+ }
+
+ losers[0].source = source;
+ losers[0].keyp = keyp;
+ }
+};
+
+/**
+ * @brief Unstable unguarded LoserTree variant storing pointers.
+ *
+ * Stable variant is above.
+ */
+template<typename T, typename Comparator>
+class LoserTreePointerUnguarded</* stable == */false, T, Comparator> :
+ public LoserTreePointerUnguardedBase<T, Comparator>
+{
+ typedef LoserTreePointerUnguardedBase<T, Comparator> Base;
+ using Base::k;
+ using Base::losers;
+
+public:
+ LoserTreePointerUnguarded(unsigned int _k, const T& _sentinel,
+ Comparator _comp = std::less<T>())
+ : Base::LoserTreePointerUnguardedBase(_k, _sentinel, _comp)
+ {}
+
+ unsigned int
+ init_winner(unsigned int root)
+ {
+ if (root >= k)
+ {
+ return root;
+ }
+ else
+ {
+ unsigned int left = init_winner (2 * root);
+ unsigned int right = init_winner (2 * root + 1);
+
+#if _GLIBCXX_ASSERTIONS
+ // If left one is sentinel then right one must be, too.
+ if (losers[left].source == -1)
+ _GLIBCXX_PARALLEL_ASSERT(losers[right].source == -1);
+#endif
+
+ if (!comp(*losers[right].keyp, *losers[left].keyp))
+ {
+ // Left one is less or equal.
+ losers[root] = losers[right];
+ return left;
+ }
+ else
+ {
+ // Right one is less.
+ losers[root] = losers[left];
+ return right;
+ }
+ }
+ }
+
+ inline void
+ init()
+ {
+ losers[0] = losers[init_winner(1)];
+
+#if _GLIBCXX_ASSERTIONS
+ // no dummy sequence can ever be at the top at the beginning (0 sequences!)
+ _GLIBCXX_PARALLEL_ASSERT(losers[0].source != -1);
+#endif
+ }
+
+ inline void
+ delete_min_insert(const T& key, bool sup)
+ {
+#if _GLIBCXX_ASSERTIONS
+ // no dummy sequence can ever be at the top!
+ _GLIBCXX_PARALLEL_ASSERT(losers[0].source != -1);
+#endif
+
+ const T* keyp = &key;
+ int source = losers[0].source;
+ for (unsigned int pos = (k + source) / 2; pos > 0; pos /= 2)
+ {
+ // The smaller one gets promoted.
+ if (comp(*(losers[pos].keyp), *keyp))
+ {
+ // The other one is smaller.
+ std::swap(losers[pos].source, source);
+ std::swap(losers[pos].keyp, keyp);
+ }
+ }
+
+ losers[0].source = source;
+ losers[0].keyp = keyp;
+ }
+};
+
+} // namespace __gnu_parallel
+
+#endif /* _GLIBCXX_PARALLEL_LOSERTREE_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/merge.h b/i686-linux/include/c++/4.4.3/parallel/merge.h
new file mode 100644
index 0000000..d947e25
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/merge.h
@@ -0,0 +1,261 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/merge.h
+ * @brief Parallel implementation of std::merge().
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_MERGE_H
+#define _GLIBCXX_PARALLEL_MERGE_H 1
+
+#include <parallel/basic_iterator.h>
+#include <bits/stl_algo.h>
+
+namespace __gnu_parallel
+{
+ /** @brief Merge routine being able to merge only the @c max_length
+ * smallest elements.
+ *
+ * The @c begin iterators are advanced accordingly, they might not
+ * reach @c end, in contrast to the usual variant.
+ * @param begin1 Begin iterator of first sequence.
+ * @param end1 End iterator of first sequence.
+ * @param begin2 Begin iterator of second sequence.
+ * @param end2 End iterator of second sequence.
+ * @param target Target begin iterator.
+ * @param max_length Maximum number of elements to merge.
+ * @param comp Comparator.
+ * @return Output end iterator. */
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename OutputIterator, typename _DifferenceTp,
+ typename Comparator>
+ OutputIterator
+ merge_advance_usual(RandomAccessIterator1& begin1,
+ RandomAccessIterator1 end1,
+ RandomAccessIterator2& begin2,
+ RandomAccessIterator2 end2, OutputIterator target,
+ _DifferenceTp max_length, Comparator comp)
+ {
+ typedef _DifferenceTp difference_type;
+ while (begin1 != end1 && begin2 != end2 && max_length > 0)
+ {
+ // array1[i1] < array0[i0]
+ if (comp(*begin2, *begin1))
+ *target++ = *begin2++;
+ else
+ *target++ = *begin1++;
+ --max_length;
+ }
+
+ if (begin1 != end1)
+ {
+ target = std::copy(begin1, begin1 + max_length, target);
+ begin1 += max_length;
+ }
+ else
+ {
+ target = std::copy(begin2, begin2 + max_length, target);
+ begin2 += max_length;
+ }
+ return target;
+ }
+
+ /** @brief Merge routine being able to merge only the @c max_length
+ * smallest elements.
+ *
+ * The @c begin iterators are advanced accordingly, they might not
+ * reach @c end, in contrast to the usual variant.
+ * Specially designed code should allow the compiler to generate
+ * conditional moves instead of branches.
+ * @param begin1 Begin iterator of first sequence.
+ * @param end1 End iterator of first sequence.
+ * @param begin2 Begin iterator of second sequence.
+ * @param end2 End iterator of second sequence.
+ * @param target Target begin iterator.
+ * @param max_length Maximum number of elements to merge.
+ * @param comp Comparator.
+ * @return Output end iterator. */
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename OutputIterator, typename _DifferenceTp,
+ typename Comparator>
+ OutputIterator
+ merge_advance_movc(RandomAccessIterator1& begin1,
+ RandomAccessIterator1 end1,
+ RandomAccessIterator2& begin2,
+ RandomAccessIterator2 end2,
+ OutputIterator target,
+ _DifferenceTp max_length, Comparator comp)
+ {
+ typedef _DifferenceTp difference_type;
+ typedef typename std::iterator_traits<RandomAccessIterator1>::value_type
+ value_type1;
+ typedef typename std::iterator_traits<RandomAccessIterator2>::value_type
+ value_type2;
+
+#if _GLIBCXX_ASSERTIONS
+ _GLIBCXX_PARALLEL_ASSERT(max_length >= 0);
+#endif
+
+ while (begin1 != end1 && begin2 != end2 && max_length > 0)
+ {
+ RandomAccessIterator1 next1 = begin1 + 1;
+ RandomAccessIterator2 next2 = begin2 + 1;
+ value_type1 element1 = *begin1;
+ value_type2 element2 = *begin2;
+
+ if (comp(element2, element1))
+ {
+ element1 = element2;
+ begin2 = next2;
+ }
+ else
+ begin1 = next1;
+
+ *target = element1;
+
+ ++target;
+ --max_length;
+ }
+ if (begin1 != end1)
+ {
+ target = std::copy(begin1, begin1 + max_length, target);
+ begin1 += max_length;
+ }
+ else
+ {
+ target = std::copy(begin2, begin2 + max_length, target);
+ begin2 += max_length;
+ }
+ return target;
+ }
+
+ /** @brief Merge routine being able to merge only the @c max_length
+ * smallest elements.
+ *
+ * The @c begin iterators are advanced accordingly, they might not
+ * reach @c end, in contrast to the usual variant.
+ * Static switch on whether to use the conditional-move variant.
+ * @param begin1 Begin iterator of first sequence.
+ * @param end1 End iterator of first sequence.
+ * @param begin2 Begin iterator of second sequence.
+ * @param end2 End iterator of second sequence.
+ * @param target Target begin iterator.
+ * @param max_length Maximum number of elements to merge.
+ * @param comp Comparator.
+ * @return Output end iterator. */
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename OutputIterator, typename _DifferenceTp,
+ typename Comparator>
+ inline OutputIterator
+ merge_advance(RandomAccessIterator1& begin1, RandomAccessIterator1 end1,
+ RandomAccessIterator2& begin2, RandomAccessIterator2 end2,
+ OutputIterator target, _DifferenceTp max_length,
+ Comparator comp)
+ {
+ _GLIBCXX_CALL(max_length)
+
+ return merge_advance_movc(begin1, end1, begin2, end2, target,
+ max_length, comp);
+ }
+
+ /** @brief Merge routine fallback to sequential in case the
+ iterators of the two input sequences are of different type.
+ * @param begin1 Begin iterator of first sequence.
+ * @param end1 End iterator of first sequence.
+ * @param begin2 Begin iterator of second sequence.
+ * @param end2 End iterator of second sequence.
+ * @param target Target begin iterator.
+ * @param max_length Maximum number of elements to merge.
+ * @param comp Comparator.
+ * @return Output end iterator. */
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename RandomAccessIterator3, typename Comparator>
+ inline RandomAccessIterator3
+ parallel_merge_advance(RandomAccessIterator1& begin1,
+ RandomAccessIterator1 end1,
+ RandomAccessIterator2& begin2,
+ // different iterators, parallel implementation
+ // not available
+ RandomAccessIterator2 end2,
+ RandomAccessIterator3 target, typename
+ std::iterator_traits<RandomAccessIterator1>::
+ difference_type max_length, Comparator comp)
+ { return merge_advance(begin1, end1, begin2, end2, target,
+ max_length, comp); }
+
+ /** @brief Parallel merge routine being able to merge only the @c
+ * max_length smallest elements.
+ *
+ * The @c begin iterators are advanced accordingly, they might not
+ * reach @c end, in contrast to the usual variant.
+ * The functionality is projected onto parallel_multiway_merge.
+ * @param begin1 Begin iterator of first sequence.
+ * @param end1 End iterator of first sequence.
+ * @param begin2 Begin iterator of second sequence.
+ * @param end2 End iterator of second sequence.
+ * @param target Target begin iterator.
+ * @param max_length Maximum number of elements to merge.
+ * @param comp Comparator.
+ * @return Output end iterator.
+ */
+ template<typename RandomAccessIterator1, typename RandomAccessIterator3,
+ typename Comparator>
+ inline RandomAccessIterator3
+ parallel_merge_advance(RandomAccessIterator1& begin1,
+ RandomAccessIterator1 end1,
+ RandomAccessIterator1& begin2,
+ RandomAccessIterator1 end2,
+ RandomAccessIterator3 target, typename
+ std::iterator_traits<RandomAccessIterator1>::
+ difference_type max_length, Comparator comp)
+ {
+ typedef typename
+ std::iterator_traits<RandomAccessIterator1>::value_type value_type;
+ typedef typename std::iterator_traits<RandomAccessIterator1>::
+ difference_type difference_type1 /* == difference_type2 */;
+ typedef typename std::iterator_traits<RandomAccessIterator3>::
+ difference_type difference_type3;
+ typedef typename std::pair<RandomAccessIterator1, RandomAccessIterator1>
+ iterator_pair;
+
+ iterator_pair
+ seqs[2] = { std::make_pair(begin1, end1),
+ std::make_pair(begin2, end2) };
+ RandomAccessIterator3
+ target_end = parallel_multiway_merge
+ < /* stable = */ true, /* sentinels = */ false>(
+ seqs, seqs + 2, target,
+ multiway_merge_exact_splitting
+ < /* stable = */ true, iterator_pair*,
+ Comparator, difference_type1>,
+ max_length, comp, omp_get_max_threads());
+
+ return target_end;
+ }
+} //namespace __gnu_parallel
+
+#endif /* _GLIBCXX_PARALLEL_MERGE_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/multiseq_selection.h b/i686-linux/include/c++/4.4.3/parallel/multiseq_selection.h
new file mode 100644
index 0000000..279e298
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/multiseq_selection.h
@@ -0,0 +1,619 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/multiseq_selection.h
+ * @brief Functions to find elements of a certain global rank in
+ * multiple sorted sequences. Also serves for splitting such
+ * sequence sets.
+ *
+ * The algorithm description can be found in
+ *
+ * P. J. Varman, S. D. Scheufler, B. R. Iyer, and G. R. Ricard.
+ * Merging Multiple Lists on Hierarchical-Memory Multiprocessors.
+ * Journal of Parallel and Distributed Computing, 12(2):171–177, 1991.
+ *
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_MULTISEQ_SELECTION_H
+#define _GLIBCXX_PARALLEL_MULTISEQ_SELECTION_H 1
+
+#include <vector>
+#include <queue>
+
+#include <bits/stl_algo.h>
+
+#include <parallel/sort.h>
+
+namespace __gnu_parallel
+{
+ /** @brief Compare a pair of types lexicographically, ascending. */
+ template<typename T1, typename T2, typename Comparator>
+ class lexicographic
+ : public std::binary_function<std::pair<T1, T2>, std::pair<T1, T2>, bool>
+ {
+ private:
+ Comparator& comp;
+
+ public:
+ lexicographic(Comparator& _comp) : comp(_comp) { }
+
+ bool
+ operator()(const std::pair<T1, T2>& p1,
+ const std::pair<T1, T2>& p2) const
+ {
+ if (comp(p1.first, p2.first))
+ return true;
+
+ if (comp(p2.first, p1.first))
+ return false;
+
+ // Firsts are equal.
+ return p1.second < p2.second;
+ }
+ };
+
+ /** @brief Compare a pair of types lexicographically, descending. */
+ template<typename T1, typename T2, typename Comparator>
+ class lexicographic_reverse : public std::binary_function<T1, T2, bool>
+ {
+ private:
+ Comparator& comp;
+
+ public:
+ lexicographic_reverse(Comparator& _comp) : comp(_comp) { }
+
+ bool
+ operator()(const std::pair<T1, T2>& p1,
+ const std::pair<T1, T2>& p2) const
+ {
+ if (comp(p2.first, p1.first))
+ return true;
+
+ if (comp(p1.first, p2.first))
+ return false;
+
+ // Firsts are equal.
+ return p2.second < p1.second;
+ }
+ };
+
+ /**
+ * @brief Splits several sorted sequences at a certain global rank,
+ * resulting in a splitting point for each sequence.
+ * The sequences are passed via a sequence of random-access
+ * iterator pairs, none of the sequences may be empty. If there
+ * are several equal elements across the split, the ones on the
+ * left side will be chosen from sequences with smaller number.
+ * @param begin_seqs Begin of the sequence of iterator pairs.
+ * @param end_seqs End of the sequence of iterator pairs.
+ * @param rank The global rank to partition at.
+ * @param begin_offsets A random-access sequence begin where the
+ * result will be stored in. Each element of the sequence is an
+ * iterator that points to the first element on the greater part of
+ * the respective sequence.
+ * @param comp The ordering functor, defaults to std::less<T>.
+ */
+ template<typename RanSeqs, typename RankType, typename RankIterator,
+ typename Comparator>
+ void
+ multiseq_partition(RanSeqs begin_seqs, RanSeqs end_seqs,
+ RankType rank,
+ RankIterator begin_offsets,
+ Comparator comp = std::less<
+ typename std::iterator_traits<typename
+ std::iterator_traits<RanSeqs>::value_type::
+ first_type>::value_type>()) // std::less<T>
+ {
+ _GLIBCXX_CALL(end_seqs - begin_seqs)
+
+ typedef typename std::iterator_traits<RanSeqs>::value_type::first_type
+ It;
+ typedef typename std::iterator_traits<It>::difference_type
+ difference_type;
+ typedef typename std::iterator_traits<It>::value_type value_type;
+
+ lexicographic<value_type, int, Comparator> lcomp(comp);
+ lexicographic_reverse<value_type, int, Comparator> lrcomp(comp);
+
+ // Number of sequences, number of elements in total (possibly
+ // including padding).
+ difference_type m = std::distance(begin_seqs, end_seqs), N = 0,
+ nmax, n, r;
+
+ for (int i = 0; i < m; i++)
+ {
+ N += std::distance(begin_seqs[i].first, begin_seqs[i].second);
+ _GLIBCXX_PARALLEL_ASSERT(
+ std::distance(begin_seqs[i].first, begin_seqs[i].second) > 0);
+ }
+
+ if (rank == N)
+ {
+ for (int i = 0; i < m; i++)
+ begin_offsets[i] = begin_seqs[i].second; // Very end.
+ // Return m - 1;
+ return;
+ }
+
+ _GLIBCXX_PARALLEL_ASSERT(m != 0);
+ _GLIBCXX_PARALLEL_ASSERT(N != 0);
+ _GLIBCXX_PARALLEL_ASSERT(rank >= 0);
+ _GLIBCXX_PARALLEL_ASSERT(rank < N);
+
+ difference_type* ns = new difference_type[m];
+ difference_type* a = new difference_type[m];
+ difference_type* b = new difference_type[m];
+ difference_type l;
+
+ ns[0] = std::distance(begin_seqs[0].first, begin_seqs[0].second);
+ nmax = ns[0];
+ for (int i = 0; i < m; i++)
+ {
+ ns[i] = std::distance(begin_seqs[i].first, begin_seqs[i].second);
+ nmax = std::max(nmax, ns[i]);
+ }
+
+ r = __log2(nmax) + 1;
+
+ // Pad all lists to this length, at least as long as any ns[i],
+ // equality iff nmax = 2^k - 1.
+ l = (1ULL << r) - 1;
+
+ for (int i = 0; i < m; i++)
+ {
+ a[i] = 0;
+ b[i] = l;
+ }
+ n = l / 2;
+
+ // Invariants:
+ // 0 <= a[i] <= ns[i], 0 <= b[i] <= l
+
+#define S(i) (begin_seqs[i].first)
+
+ // Initial partition.
+ std::vector<std::pair<value_type, int> > sample;
+
+ for (int i = 0; i < m; i++)
+ if (n < ns[i]) //sequence long enough
+ sample.push_back(std::make_pair(S(i)[n], i));
+ __gnu_sequential::sort(sample.begin(), sample.end(), lcomp);
+
+ for (int i = 0; i < m; i++) //conceptual infinity
+ if (n >= ns[i]) //sequence too short, conceptual infinity
+ sample.push_back(std::make_pair(S(i)[0] /*dummy element*/, i));
+
+ difference_type localrank = rank / l;
+
+ int j;
+ for (j = 0; j < localrank && ((n + 1) <= ns[sample[j].second]); ++j)
+ a[sample[j].second] += n + 1;
+ for (; j < m; j++)
+ b[sample[j].second] -= n + 1;
+
+ // Further refinement.
+ while (n > 0)
+ {
+ n /= 2;
+
+ int lmax_seq = -1; // to avoid warning
+ const value_type* lmax = NULL; // impossible to avoid the warning?
+ for (int i = 0; i < m; i++)
+ {
+ if (a[i] > 0)
+ {
+ if (!lmax)
+ {
+ lmax = &(S(i)[a[i] - 1]);
+ lmax_seq = i;
+ }
+ else
+ {
+ // Max, favor rear sequences.
+ if (!comp(S(i)[a[i] - 1], *lmax))
+ {
+ lmax = &(S(i)[a[i] - 1]);
+ lmax_seq = i;
+ }
+ }
+ }
+ }
+
+ int i;
+ for (i = 0; i < m; i++)
+ {
+ difference_type middle = (b[i] + a[i]) / 2;
+ if (lmax && middle < ns[i] &&
+ lcomp(std::make_pair(S(i)[middle], i),
+ std::make_pair(*lmax, lmax_seq)))
+ a[i] = std::min(a[i] + n + 1, ns[i]);
+ else
+ b[i] -= n + 1;
+ }
+
+ difference_type leftsize = 0;
+ for (int i = 0; i < m; i++)
+ leftsize += a[i] / (n + 1);
+
+ difference_type skew = rank / (n + 1) - leftsize;
+
+ if (skew > 0)
+ {
+ // Move to the left, find smallest.
+ std::priority_queue<std::pair<value_type, int>,
+ std::vector<std::pair<value_type, int> >,
+ lexicographic_reverse<value_type, int, Comparator> >
+ pq(lrcomp);
+
+ for (int i = 0; i < m; i++)
+ if (b[i] < ns[i])
+ pq.push(std::make_pair(S(i)[b[i]], i));
+
+ for (; skew != 0 && !pq.empty(); --skew)
+ {
+ int source = pq.top().second;
+ pq.pop();
+
+ a[source] = std::min(a[source] + n + 1, ns[source]);
+ b[source] += n + 1;
+
+ if (b[source] < ns[source])
+ pq.push(std::make_pair(S(source)[b[source]], source));
+ }
+ }
+ else if (skew < 0)
+ {
+ // Move to the right, find greatest.
+ std::priority_queue<std::pair<value_type, int>,
+ std::vector<std::pair<value_type, int> >,
+ lexicographic<value_type, int, Comparator> > pq(lcomp);
+
+ for (int i = 0; i < m; i++)
+ if (a[i] > 0)
+ pq.push(std::make_pair(S(i)[a[i] - 1], i));
+
+ for (; skew != 0; ++skew)
+ {
+ int source = pq.top().second;
+ pq.pop();
+
+ a[source] -= n + 1;
+ b[source] -= n + 1;
+
+ if (a[source] > 0)
+ pq.push(std::make_pair(S(source)[a[source] - 1], source));
+ }
+ }
+ }
+
+ // Postconditions:
+ // a[i] == b[i] in most cases, except when a[i] has been clamped
+ // because of having reached the boundary
+
+ // Now return the result, calculate the offset.
+
+ // Compare the keys on both edges of the border.
+
+ // Maximum of left edge, minimum of right edge.
+ value_type* maxleft = NULL;
+ value_type* minright = NULL;
+ for (int i = 0; i < m; i++)
+ {
+ if (a[i] > 0)
+ {
+ if (!maxleft)
+ maxleft = &(S(i)[a[i] - 1]);
+ else
+ {
+ // Max, favor rear sequences.
+ if (!comp(S(i)[a[i] - 1], *maxleft))
+ maxleft = &(S(i)[a[i] - 1]);
+ }
+ }
+ if (b[i] < ns[i])
+ {
+ if (!minright)
+ minright = &(S(i)[b[i]]);
+ else
+ {
+ // Min, favor fore sequences.
+ if (comp(S(i)[b[i]], *minright))
+ minright = &(S(i)[b[i]]);
+ }
+ }
+ }
+
+ int seq = 0;
+ for (int i = 0; i < m; i++)
+ begin_offsets[i] = S(i) + a[i];
+
+ delete[] ns;
+ delete[] a;
+ delete[] b;
+ }
+
+
+ /**
+ * @brief Selects the element at a certain global rank from several
+ * sorted sequences.
+ *
+ * The sequences are passed via a sequence of random-access
+ * iterator pairs, none of the sequences may be empty.
+ * @param begin_seqs Begin of the sequence of iterator pairs.
+ * @param end_seqs End of the sequence of iterator pairs.
+ * @param rank The global rank to partition at.
+ * @param offset The rank of the selected element in the global
+ * subsequence of elements equal to the selected element. If the
+ * selected element is unique, this number is 0.
+ * @param comp The ordering functor, defaults to std::less.
+ */
+ template<typename T, typename RanSeqs, typename RankType,
+ typename Comparator>
+ T
+ multiseq_selection(RanSeqs begin_seqs, RanSeqs end_seqs, RankType rank,
+ RankType& offset, Comparator comp = std::less<T>())
+ {
+ _GLIBCXX_CALL(end_seqs - begin_seqs)
+
+ typedef typename std::iterator_traits<RanSeqs>::value_type::first_type
+ It;
+ typedef typename std::iterator_traits<It>::difference_type
+ difference_type;
+
+ lexicographic<T, int, Comparator> lcomp(comp);
+ lexicographic_reverse<T, int, Comparator> lrcomp(comp);
+
+ // Number of sequences, number of elements in total (possibly
+ // including padding).
+ difference_type m = std::distance(begin_seqs, end_seqs);
+ difference_type N = 0;
+ difference_type nmax, n, r;
+
+ for (int i = 0; i < m; i++)
+ N += std::distance(begin_seqs[i].first, begin_seqs[i].second);
+
+ if (m == 0 || N == 0 || rank < 0 || rank >= N)
+ {
+ // Result undefined when there is no data or rank is outside bounds.
+ throw std::exception();
+ }
+
+
+ difference_type* ns = new difference_type[m];
+ difference_type* a = new difference_type[m];
+ difference_type* b = new difference_type[m];
+ difference_type l;
+
+ ns[0] = std::distance(begin_seqs[0].first, begin_seqs[0].second);
+ nmax = ns[0];
+ for (int i = 0; i < m; ++i)
+ {
+ ns[i] = std::distance(begin_seqs[i].first, begin_seqs[i].second);
+ nmax = std::max(nmax, ns[i]);
+ }
+
+ r = __log2(nmax) + 1;
+
+ // Pad all lists to this length, at least as long as any ns[i],
+ // equality iff nmax = 2^k - 1
+ l = pow2(r) - 1;
+
+ for (int i = 0; i < m; ++i)
+ {
+ a[i] = 0;
+ b[i] = l;
+ }
+ n = l / 2;
+
+ // Invariants:
+ // 0 <= a[i] <= ns[i], 0 <= b[i] <= l
+
+#define S(i) (begin_seqs[i].first)
+
+ // Initial partition.
+ std::vector<std::pair<T, int> > sample;
+
+ for (int i = 0; i < m; i++)
+ if (n < ns[i])
+ sample.push_back(std::make_pair(S(i)[n], i));
+ __gnu_sequential::sort(sample.begin(), sample.end(),
+ lcomp, sequential_tag());
+
+ // Conceptual infinity.
+ for (int i = 0; i < m; i++)
+ if (n >= ns[i])
+ sample.push_back(std::make_pair(S(i)[0] /*dummy element*/, i));
+
+ difference_type localrank = rank / l;
+
+ int j;
+ for (j = 0; j < localrank && ((n + 1) <= ns[sample[j].second]); ++j)
+ a[sample[j].second] += n + 1;
+ for (; j < m; ++j)
+ b[sample[j].second] -= n + 1;
+
+ // Further refinement.
+ while (n > 0)
+ {
+ n /= 2;
+
+ const T* lmax = NULL;
+ for (int i = 0; i < m; ++i)
+ {
+ if (a[i] > 0)
+ {
+ if (!lmax)
+ lmax = &(S(i)[a[i] - 1]);
+ else
+ {
+ if (comp(*lmax, S(i)[a[i] - 1])) //max
+ lmax = &(S(i)[a[i] - 1]);
+ }
+ }
+ }
+
+ int i;
+ for (i = 0; i < m; i++)
+ {
+ difference_type middle = (b[i] + a[i]) / 2;
+ if (lmax && middle < ns[i] && comp(S(i)[middle], *lmax))
+ a[i] = std::min(a[i] + n + 1, ns[i]);
+ else
+ b[i] -= n + 1;
+ }
+
+ difference_type leftsize = 0;
+ for (int i = 0; i < m; ++i)
+ leftsize += a[i] / (n + 1);
+
+ difference_type skew = rank / (n + 1) - leftsize;
+
+ if (skew > 0)
+ {
+ // Move to the left, find smallest.
+ std::priority_queue<std::pair<T, int>,
+ std::vector<std::pair<T, int> >,
+ lexicographic_reverse<T, int, Comparator> > pq(lrcomp);
+
+ for (int i = 0; i < m; ++i)
+ if (b[i] < ns[i])
+ pq.push(std::make_pair(S(i)[b[i]], i));
+
+ for (; skew != 0 && !pq.empty(); --skew)
+ {
+ int source = pq.top().second;
+ pq.pop();
+
+ a[source] = std::min(a[source] + n + 1, ns[source]);
+ b[source] += n + 1;
+
+ if (b[source] < ns[source])
+ pq.push(std::make_pair(S(source)[b[source]], source));
+ }
+ }
+ else if (skew < 0)
+ {
+ // Move to the right, find greatest.
+ std::priority_queue<std::pair<T, int>,
+ std::vector<std::pair<T, int> >,
+ lexicographic<T, int, Comparator> > pq(lcomp);
+
+ for (int i = 0; i < m; ++i)
+ if (a[i] > 0)
+ pq.push(std::make_pair(S(i)[a[i] - 1], i));
+
+ for (; skew != 0; ++skew)
+ {
+ int source = pq.top().second;
+ pq.pop();
+
+ a[source] -= n + 1;
+ b[source] -= n + 1;
+
+ if (a[source] > 0)
+ pq.push(std::make_pair(S(source)[a[source] - 1], source));
+ }
+ }
+ }
+
+ // Postconditions:
+ // a[i] == b[i] in most cases, except when a[i] has been clamped
+ // because of having reached the boundary
+
+ // Now return the result, calculate the offset.
+
+ // Compare the keys on both edges of the border.
+
+ // Maximum of left edge, minimum of right edge.
+ bool maxleftset = false, minrightset = false;
+
+ // Impossible to avoid the warning?
+ T maxleft, minright;
+ for (int i = 0; i < m; ++i)
+ {
+ if (a[i] > 0)
+ {
+ if (!maxleftset)
+ {
+ maxleft = S(i)[a[i] - 1];
+ maxleftset = true;
+ }
+ else
+ {
+ // Max.
+ if (comp(maxleft, S(i)[a[i] - 1]))
+ maxleft = S(i)[a[i] - 1];
+ }
+ }
+ if (b[i] < ns[i])
+ {
+ if (!minrightset)
+ {
+ minright = S(i)[b[i]];
+ minrightset = true;
+ }
+ else
+ {
+ // Min.
+ if (comp(S(i)[b[i]], minright))
+ minright = S(i)[b[i]];
+ }
+ }
+ }
+
+ // Minright is the splitter, in any case.
+
+ if (!maxleftset || comp(minright, maxleft))
+ {
+ // Good luck, everything is split unambiguously.
+ offset = 0;
+ }
+ else
+ {
+ // We have to calculate an offset.
+ offset = 0;
+
+ for (int i = 0; i < m; ++i)
+ {
+ difference_type lb = std::lower_bound(S(i), S(i) + ns[i],
+ minright,
+ comp) - S(i);
+ offset += a[i] - lb;
+ }
+ }
+
+ delete[] ns;
+ delete[] a;
+ delete[] b;
+
+ return minright;
+ }
+}
+
+#undef S
+
+#endif /* _GLIBCXX_PARALLEL_MULTISEQ_SELECTION_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/multiway_merge.h b/i686-linux/include/c++/4.4.3/parallel/multiway_merge.h
new file mode 100644
index 0000000..fe32053
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/multiway_merge.h
@@ -0,0 +1,2140 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/multiway_merge.h
+* @brief Implementation of sequential and parallel multiway merge.
+*
+* Explanations on the high-speed merging routines in the appendix of
+*
+* P. Sanders.
+* Fast priority queues for cached memory.
+* ACM Journal of Experimental Algorithmics, 5, 2000.
+*
+* This file is a GNU parallel extension to the Standard C++ Library.
+*/
+
+// Written by Johannes Singler and Manuel Holtgrewe.
+
+#ifndef _GLIBCXX_PARALLEL_MULTIWAY_MERGE_H
+#define _GLIBCXX_PARALLEL_MULTIWAY_MERGE_H
+
+#include <vector>
+
+#include <bits/stl_algo.h>
+#include <parallel/features.h>
+#include <parallel/parallel.h>
+#include <parallel/losertree.h>
+#if _GLIBCXX_ASSERTIONS
+#include <parallel/checkers.h>
+#endif
+
+/** @brief Length of a sequence described by a pair of iterators. */
+#define _GLIBCXX_PARALLEL_LENGTH(s) ((s).second - (s).first)
+
+namespace __gnu_parallel
+{
+
+// Announce guarded and unguarded iterator.
+
+template<typename RandomAccessIterator, typename Comparator>
+ class guarded_iterator;
+
+// Making the arguments const references seems to dangerous,
+// the user-defined comparator might not be const.
+template<typename RandomAccessIterator, typename Comparator>
+ inline bool
+ operator<(guarded_iterator<RandomAccessIterator, Comparator>& bi1,
+ guarded_iterator<RandomAccessIterator, Comparator>& bi2);
+
+template<typename RandomAccessIterator, typename Comparator>
+ inline bool
+ operator<=(guarded_iterator<RandomAccessIterator, Comparator>& bi1,
+ guarded_iterator<RandomAccessIterator, Comparator>& bi2);
+
+/** @brief Iterator wrapper supporting an implicit supremum at the end
+ * of the sequence, dominating all comparisons.
+ *
+ * The implicit supremum comes with a performance cost.
+ *
+ * Deriving from RandomAccessIterator is not possible since
+ * RandomAccessIterator need not be a class.
+ */
+template<typename RandomAccessIterator, typename Comparator>
+ class guarded_iterator
+ {
+ private:
+ /** @brief Current iterator position. */
+ RandomAccessIterator current;
+
+ /** @brief End iterator of the sequence. */
+ RandomAccessIterator end;
+
+ /** @brief Comparator. */
+ Comparator& comp;
+
+ public:
+ /** @brief Constructor. Sets iterator to beginning of sequence.
+ * @param begin Begin iterator of sequence.
+ * @param end End iterator of sequence.
+ * @param comp Comparator provided for associated overloaded
+ * compare operators. */
+ guarded_iterator(RandomAccessIterator begin,
+ RandomAccessIterator end, Comparator& comp)
+ : current(begin), end(end), comp(comp)
+ { }
+
+ /** @brief Pre-increment operator.
+ * @return This. */
+ guarded_iterator<RandomAccessIterator, Comparator>&
+ operator++()
+ {
+ ++current;
+ return *this;
+ }
+
+ /** @brief Dereference operator.
+ * @return Referenced element. */
+ typename std::iterator_traits<RandomAccessIterator>::value_type&
+ operator*()
+ { return *current; }
+
+ /** @brief Convert to wrapped iterator.
+ * @return Wrapped iterator. */
+ operator RandomAccessIterator()
+ { return current; }
+
+ friend bool
+ operator< <RandomAccessIterator, Comparator>(
+ guarded_iterator<RandomAccessIterator, Comparator>& bi1,
+ guarded_iterator<RandomAccessIterator, Comparator>& bi2);
+
+ friend bool
+ operator<= <RandomAccessIterator, Comparator>(
+ guarded_iterator<RandomAccessIterator, Comparator>& bi1,
+ guarded_iterator<RandomAccessIterator, Comparator>& bi2);
+ };
+
+/** @brief Compare two elements referenced by guarded iterators.
+ * @param bi1 First iterator.
+ * @param bi2 Second iterator.
+ * @return @c True if less. */
+template<typename RandomAccessIterator, typename Comparator>
+ inline bool
+ operator<(guarded_iterator<RandomAccessIterator, Comparator>& bi1,
+ guarded_iterator<RandomAccessIterator, Comparator>& bi2)
+ {
+ if (bi1.current == bi1.end) //bi1 is sup
+ return bi2.current == bi2.end; //bi2 is not sup
+ if (bi2.current == bi2.end) //bi2 is sup
+ return true;
+ return (bi1.comp)(*bi1, *bi2); //normal compare
+ }
+
+/** @brief Compare two elements referenced by guarded iterators.
+ * @param bi1 First iterator.
+ * @param bi2 Second iterator.
+ * @return @c True if less equal. */
+template<typename RandomAccessIterator, typename Comparator>
+ inline bool
+ operator<=(guarded_iterator<RandomAccessIterator, Comparator>& bi1,
+ guarded_iterator<RandomAccessIterator, Comparator>& bi2)
+ {
+ if (bi2.current == bi2.end) //bi1 is sup
+ return bi1.current != bi1.end; //bi2 is not sup
+ if (bi1.current == bi1.end) //bi2 is sup
+ return false;
+ return !(bi1.comp)(*bi2, *bi1); //normal compare
+ }
+
+template<typename RandomAccessIterator, typename Comparator>
+ class unguarded_iterator;
+
+template<typename RandomAccessIterator, typename Comparator>
+ inline bool
+ operator<(unguarded_iterator<RandomAccessIterator, Comparator>& bi1,
+ unguarded_iterator<RandomAccessIterator, Comparator>& bi2);
+
+template<typename RandomAccessIterator, typename Comparator>
+ inline bool
+ operator<=(unguarded_iterator<RandomAccessIterator, Comparator>& bi1,
+ unguarded_iterator<RandomAccessIterator, Comparator>& bi2);
+
+template<typename RandomAccessIterator, typename Comparator>
+ class unguarded_iterator
+ {
+ private:
+ /** @brief Current iterator position. */
+ RandomAccessIterator current;
+ /** @brief Comparator. */
+ mutable Comparator& comp;
+
+ public:
+ /** @brief Constructor. Sets iterator to beginning of sequence.
+ * @param begin Begin iterator of sequence.
+ * @param end Unused, only for compatibility.
+ * @param comp Unused, only for compatibility. */
+ unguarded_iterator(RandomAccessIterator begin,
+ RandomAccessIterator end, Comparator& comp)
+ : current(begin), comp(comp)
+ { }
+
+ /** @brief Pre-increment operator.
+ * @return This. */
+ unguarded_iterator<RandomAccessIterator, Comparator>&
+ operator++()
+ {
+ ++current;
+ return *this;
+ }
+
+ /** @brief Dereference operator.
+ * @return Referenced element. */
+ typename std::iterator_traits<RandomAccessIterator>::value_type&
+ operator*()
+ { return *current; }
+
+ /** @brief Convert to wrapped iterator.
+ * @return Wrapped iterator. */
+ operator RandomAccessIterator()
+ { return current; }
+
+ friend bool
+ operator< <RandomAccessIterator, Comparator>(
+ unguarded_iterator<RandomAccessIterator, Comparator>& bi1,
+ unguarded_iterator<RandomAccessIterator, Comparator>& bi2);
+
+ friend bool
+ operator<= <RandomAccessIterator, Comparator>(
+ unguarded_iterator<RandomAccessIterator, Comparator>& bi1,
+ unguarded_iterator<RandomAccessIterator, Comparator>& bi2);
+ };
+
+/** @brief Compare two elements referenced by unguarded iterators.
+ * @param bi1 First iterator.
+ * @param bi2 Second iterator.
+ * @return @c True if less. */
+template<typename RandomAccessIterator, typename Comparator>
+ inline bool
+ operator<(unguarded_iterator<RandomAccessIterator, Comparator>& bi1,
+ unguarded_iterator<RandomAccessIterator, Comparator>& bi2)
+ {
+ // Normal compare.
+ return (bi1.comp)(*bi1, *bi2);
+ }
+
+/** @brief Compare two elements referenced by unguarded iterators.
+ * @param bi1 First iterator.
+ * @param bi2 Second iterator.
+ * @return @c True if less equal. */
+template<typename RandomAccessIterator, typename Comparator>
+ inline bool
+ operator<=(unguarded_iterator<RandomAccessIterator, Comparator>& bi1,
+ unguarded_iterator<RandomAccessIterator, Comparator>& bi2)
+ {
+ // Normal compare.
+ return !(bi1.comp)(*bi2, *bi1);
+ }
+
+/** @brief Highly efficient 3-way merging procedure.
+ *
+ * Merging is done with the algorithm implementation described by Peter
+ * Sanders. Basically, the idea is to minimize the number of necessary
+ * comparison after merging out an element. The implementation trick
+ * that makes this fast is that the order of the sequences is stored
+ * in the instruction pointer (translated into labels in C++).
+ *
+ * This works well for merging up to 4 sequences.
+ *
+ * Note that making the merging stable does <em>not</em> come at a
+ * performance hit.
+ *
+ * Whether the merging is done guarded or unguarded is selected by the
+ * used iterator class.
+ *
+ * @param seqs_begin Begin iterator of iterator pair input sequence.
+ * @param seqs_end End iterator of iterator pair input sequence.
+ * @param target Begin iterator out output sequence.
+ * @param comp Comparator.
+ * @param length Maximum length to merge, less equal than the
+ * total number of elements available.
+ *
+ * @return End iterator of output sequence.
+ */
+template<template<typename RAI, typename C> class iterator,
+ typename RandomAccessIteratorIterator,
+ typename RandomAccessIterator3,
+ typename _DifferenceTp,
+ typename Comparator>
+ RandomAccessIterator3
+ multiway_merge_3_variant(
+ RandomAccessIteratorIterator seqs_begin,
+ RandomAccessIteratorIterator seqs_end,
+ RandomAccessIterator3 target,
+ _DifferenceTp length, Comparator comp)
+ {
+ _GLIBCXX_CALL(length);
+
+ typedef _DifferenceTp difference_type;
+
+ typedef typename std::iterator_traits<RandomAccessIteratorIterator>
+ ::value_type::first_type
+ RandomAccessIterator1;
+ typedef typename std::iterator_traits<RandomAccessIterator1>::value_type
+ value_type;
+
+ if (length == 0)
+ return target;
+
+#if _GLIBCXX_ASSERTIONS
+ _DifferenceTp orig_length = length;
+#endif
+
+ iterator<RandomAccessIterator1, Comparator>
+ seq0(seqs_begin[0].first, seqs_begin[0].second, comp),
+ seq1(seqs_begin[1].first, seqs_begin[1].second, comp),
+ seq2(seqs_begin[2].first, seqs_begin[2].second, comp);
+
+ if (seq0 <= seq1)
+ {
+ if (seq1 <= seq2)
+ goto s012;
+ else
+ if (seq2 < seq0)
+ goto s201;
+ else
+ goto s021;
+ }
+ else
+ {
+ if (seq1 <= seq2)
+ {
+ if (seq0 <= seq2)
+ goto s102;
+ else
+ goto s120;
+ }
+ else
+ goto s210;
+ }
+#define _GLIBCXX_PARALLEL_MERGE_3_CASE(a,b,c,c0,c1) \
+ s ## a ## b ## c : \
+ *target = *seq ## a; \
+ ++target; \
+ --length; \
+ ++seq ## a; \
+ if (length == 0) goto finish; \
+ if (seq ## a c0 seq ## b) goto s ## a ## b ## c; \
+ if (seq ## a c1 seq ## c) goto s ## b ## a ## c; \
+ goto s ## b ## c ## a;
+
+ _GLIBCXX_PARALLEL_MERGE_3_CASE(0, 1, 2, <=, <=);
+ _GLIBCXX_PARALLEL_MERGE_3_CASE(1, 2, 0, <=, < );
+ _GLIBCXX_PARALLEL_MERGE_3_CASE(2, 0, 1, < , < );
+ _GLIBCXX_PARALLEL_MERGE_3_CASE(1, 0, 2, < , <=);
+ _GLIBCXX_PARALLEL_MERGE_3_CASE(0, 2, 1, <=, <=);
+ _GLIBCXX_PARALLEL_MERGE_3_CASE(2, 1, 0, < , < );
+
+#undef _GLIBCXX_PARALLEL_MERGE_3_CASE
+
+ finish:
+ ;
+
+#if _GLIBCXX_ASSERTIONS
+ _GLIBCXX_PARALLEL_ASSERT(
+ ((RandomAccessIterator1)seq0 - seqs_begin[0].first) +
+ ((RandomAccessIterator1)seq1 - seqs_begin[1].first) +
+ ((RandomAccessIterator1)seq2 - seqs_begin[2].first)
+ == orig_length);
+#endif
+
+ seqs_begin[0].first = seq0;
+ seqs_begin[1].first = seq1;
+ seqs_begin[2].first = seq2;
+
+ return target;
+ }
+
+/**
+ * @brief Highly efficient 4-way merging procedure.
+ *
+ * Merging is done with the algorithm implementation described by Peter
+ * Sanders. Basically, the idea is to minimize the number of necessary
+ * comparison after merging out an element. The implementation trick
+ * that makes this fast is that the order of the sequences is stored
+ * in the instruction pointer (translated into goto labels in C++).
+ *
+ * This works well for merging up to 4 sequences.
+ *
+ * Note that making the merging stable does <em>not</em> come at a
+ * performance hit.
+ *
+ * Whether the merging is done guarded or unguarded is selected by the
+ * used iterator class.
+ *
+ * @param seqs_begin Begin iterator of iterator pair input sequence.
+ * @param seqs_end End iterator of iterator pair input sequence.
+ * @param target Begin iterator out output sequence.
+ * @param comp Comparator.
+ * @param length Maximum length to merge, less equal than the
+ * total number of elements available.
+ *
+ * @return End iterator of output sequence.
+ */
+template<template<typename RAI, typename C> class iterator,
+ typename RandomAccessIteratorIterator,
+ typename RandomAccessIterator3,
+ typename _DifferenceTp,
+ typename Comparator>
+ RandomAccessIterator3
+ multiway_merge_4_variant(RandomAccessIteratorIterator seqs_begin,
+ RandomAccessIteratorIterator seqs_end,
+ RandomAccessIterator3 target,
+ _DifferenceTp length, Comparator comp)
+ {
+ _GLIBCXX_CALL(length);
+ typedef _DifferenceTp difference_type;
+
+ typedef typename std::iterator_traits<RandomAccessIteratorIterator>
+ ::value_type::first_type
+ RandomAccessIterator1;
+ typedef typename std::iterator_traits<RandomAccessIterator1>::value_type
+ value_type;
+
+ iterator<RandomAccessIterator1, Comparator>
+ seq0(seqs_begin[0].first, seqs_begin[0].second, comp),
+ seq1(seqs_begin[1].first, seqs_begin[1].second, comp),
+ seq2(seqs_begin[2].first, seqs_begin[2].second, comp),
+ seq3(seqs_begin[3].first, seqs_begin[3].second, comp);
+
+#define _GLIBCXX_PARALLEL_DECISION(a,b,c,d) { \
+ if (seq ## d < seq ## a) goto s ## d ## a ## b ## c; \
+ if (seq ## d < seq ## b) goto s ## a ## d ## b ## c; \
+ if (seq ## d < seq ## c) goto s ## a ## b ## d ## c; \
+ goto s ## a ## b ## c ## d; }
+
+ if (seq0 <= seq1)
+ {
+ if (seq1 <= seq2)
+ _GLIBCXX_PARALLEL_DECISION(0,1,2,3)
+ else
+ if (seq2 < seq0)
+ _GLIBCXX_PARALLEL_DECISION(2,0,1,3)
+ else
+ _GLIBCXX_PARALLEL_DECISION(0,2,1,3)
+ }
+ else
+ {
+ if (seq1 <= seq2)
+ {
+ if (seq0 <= seq2)
+ _GLIBCXX_PARALLEL_DECISION(1,0,2,3)
+ else
+ _GLIBCXX_PARALLEL_DECISION(1,2,0,3)
+ }
+ else
+ _GLIBCXX_PARALLEL_DECISION(2,1,0,3)
+ }
+
+#define _GLIBCXX_PARALLEL_MERGE_4_CASE(a,b,c,d,c0,c1,c2) \
+ s ## a ## b ## c ## d: \
+ if (length == 0) goto finish; \
+ *target = *seq ## a; \
+ ++target; \
+ --length; \
+ ++seq ## a; \
+ if (seq ## a c0 seq ## b) goto s ## a ## b ## c ## d; \
+ if (seq ## a c1 seq ## c) goto s ## b ## a ## c ## d; \
+ if (seq ## a c2 seq ## d) goto s ## b ## c ## a ## d; \
+ goto s ## b ## c ## d ## a;
+
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(0, 1, 2, 3, <=, <=, <=);
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(0, 1, 3, 2, <=, <=, <=);
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(0, 2, 1, 3, <=, <=, <=);
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(0, 2, 3, 1, <=, <=, <=);
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(0, 3, 1, 2, <=, <=, <=);
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(0, 3, 2, 1, <=, <=, <=);
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(1, 0, 2, 3, < , <=, <=);
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(1, 0, 3, 2, < , <=, <=);
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(1, 2, 0, 3, <=, < , <=);
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(1, 2, 3, 0, <=, <=, < );
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(1, 3, 0, 2, <=, < , <=);
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(1, 3, 2, 0, <=, <=, < );
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(2, 0, 1, 3, < , < , <=);
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(2, 0, 3, 1, < , <=, < );
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(2, 1, 0, 3, < , < , <=);
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(2, 1, 3, 0, < , <=, < );
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(2, 3, 0, 1, <=, < , < );
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(2, 3, 1, 0, <=, < , < );
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(3, 0, 1, 2, < , < , < );
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(3, 0, 2, 1, < , < , < );
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(3, 1, 0, 2, < , < , < );
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(3, 1, 2, 0, < , < , < );
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(3, 2, 0, 1, < , < , < );
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(3, 2, 1, 0, < , < , < );
+
+#undef _GLIBCXX_PARALLEL_MERGE_4_CASE
+#undef _GLIBCXX_PARALLEL_DECISION
+
+ finish:
+ ;
+
+ seqs_begin[0].first = seq0;
+ seqs_begin[1].first = seq1;
+ seqs_begin[2].first = seq2;
+ seqs_begin[3].first = seq3;
+
+ return target;
+ }
+
+/** @brief Multi-way merging procedure for a high branching factor,
+ * guarded case.
+ *
+ * This merging variant uses a LoserTree class as selected by <tt>LT</tt>.
+ *
+ * Stability is selected through the used LoserTree class <tt>LT</tt>.
+ *
+ * At least one non-empty sequence is required.
+ *
+ * @param seqs_begin Begin iterator of iterator pair input sequence.
+ * @param seqs_end End iterator of iterator pair input sequence.
+ * @param target Begin iterator out output sequence.
+ * @param comp Comparator.
+ * @param length Maximum length to merge, less equal than the
+ * total number of elements available.
+ *
+ * @return End iterator of output sequence.
+ */
+template<typename LT,
+ typename RandomAccessIteratorIterator,
+ typename RandomAccessIterator3,
+ typename _DifferenceTp,
+ typename Comparator>
+ RandomAccessIterator3
+ multiway_merge_loser_tree(RandomAccessIteratorIterator seqs_begin,
+ RandomAccessIteratorIterator seqs_end,
+ RandomAccessIterator3 target,
+ _DifferenceTp length, Comparator comp)
+ {
+ _GLIBCXX_CALL(length)
+
+ typedef _DifferenceTp difference_type;
+ typedef typename std::iterator_traits<RandomAccessIteratorIterator>
+ ::value_type::first_type
+ RandomAccessIterator1;
+ typedef typename std::iterator_traits<RandomAccessIterator1>::value_type
+ value_type;
+
+ int k = static_cast<int>(seqs_end - seqs_begin);
+
+ LT lt(k, comp);
+
+ // Default value for potentially non-default-constructible types.
+ value_type* arbitrary_element = NULL;
+
+ for (int t = 0; t < k; ++t)
+ {
+ if(arbitrary_element == NULL
+ && _GLIBCXX_PARALLEL_LENGTH(seqs_begin[t]) > 0)
+ arbitrary_element = &(*seqs_begin[t].first);
+ }
+
+ for (int t = 0; t < k; ++t)
+ {
+ if (seqs_begin[t].first == seqs_begin[t].second)
+ lt.insert_start(*arbitrary_element, t, true);
+ else
+ lt.insert_start(*seqs_begin[t].first, t, false);
+ }
+
+ lt.init();
+
+ int source;
+
+ for (difference_type i = 0; i < length; ++i)
+ {
+ //take out
+ source = lt.get_min_source();
+
+ *(target++) = *(seqs_begin[source].first++);
+
+ // Feed.
+ if (seqs_begin[source].first == seqs_begin[source].second)
+ lt.delete_min_insert(*arbitrary_element, true);
+ else
+ // Replace from same source.
+ lt.delete_min_insert(*seqs_begin[source].first, false);
+ }
+
+ return target;
+ }
+
+/** @brief Multi-way merging procedure for a high branching factor,
+ * unguarded case.
+ *
+ * Merging is done using the LoserTree class <tt>LT</tt>.
+ *
+ * Stability is selected by the used LoserTrees.
+ *
+ * @pre No input will run out of elements during the merge.
+ *
+ * @param seqs_begin Begin iterator of iterator pair input sequence.
+ * @param seqs_end End iterator of iterator pair input sequence.
+ * @param target Begin iterator out output sequence.
+ * @param comp Comparator.
+ * @param length Maximum length to merge, less equal than the
+ * total number of elements available.
+ *
+ * @return End iterator of output sequence.
+ */
+template<typename LT,
+ typename RandomAccessIteratorIterator,
+ typename RandomAccessIterator3,
+ typename _DifferenceTp, typename Comparator>
+ RandomAccessIterator3
+ multiway_merge_loser_tree_unguarded(
+ RandomAccessIteratorIterator seqs_begin,
+ RandomAccessIteratorIterator seqs_end,
+ RandomAccessIterator3 target,
+ const typename std::iterator_traits<typename std::iterator_traits<
+ RandomAccessIteratorIterator>::value_type::first_type>::value_type&
+ sentinel,
+ _DifferenceTp length,
+ Comparator comp)
+ {
+ _GLIBCXX_CALL(length)
+ typedef _DifferenceTp difference_type;
+
+ typedef typename std::iterator_traits<RandomAccessIteratorIterator>
+ ::value_type::first_type
+ RandomAccessIterator1;
+ typedef typename std::iterator_traits<RandomAccessIterator1>::value_type
+ value_type;
+
+ int k = seqs_end - seqs_begin;
+
+ LT lt(k, sentinel, comp);
+
+ for (int t = 0; t < k; ++t)
+ {
+#if _GLIBCXX_ASSERTIONS
+ _GLIBCXX_PARALLEL_ASSERT(seqs_begin[t].first != seqs_begin[t].second);
+#endif
+ lt.insert_start(*seqs_begin[t].first, t, false);
+ }
+
+ lt.init();
+
+ int source;
+
+#if _GLIBCXX_ASSERTIONS
+ difference_type i = 0;
+#endif
+
+ RandomAccessIterator3 target_end = target + length;
+ while (target < target_end)
+ {
+ // Take out.
+ source = lt.get_min_source();
+
+#if _GLIBCXX_ASSERTIONS
+ _GLIBCXX_PARALLEL_ASSERT(0 <= source && source < k);
+ _GLIBCXX_PARALLEL_ASSERT(i == 0
+ || !comp(*(seqs_begin[source].first), *(target - 1)));
+#endif
+
+ // Feed.
+ *(target++) = *(seqs_begin[source].first++);
+
+#if _GLIBCXX_ASSERTIONS
+ ++i;
+#endif
+ // Replace from same source.
+ lt.delete_min_insert(*seqs_begin[source].first, false);
+ }
+
+ return target;
+ }
+
+
+/** @brief Multi-way merging procedure for a high branching factor,
+ * requiring sentinels to exist.
+ *
+ * @param stable The value must the same as for the used LoserTrees.
+ * @param UnguardedLoserTree Loser Tree variant to use for the unguarded
+ * merging.
+ * @param GuardedLoserTree Loser Tree variant to use for the guarded
+ * merging.
+ *
+ * @param seqs_begin Begin iterator of iterator pair input sequence.
+ * @param seqs_end End iterator of iterator pair input sequence.
+ * @param target Begin iterator out output sequence.
+ * @param comp Comparator.
+ * @param length Maximum length to merge, less equal than the
+ * total number of elements available.
+ *
+ * @return End iterator of output sequence.
+ */
+template<
+ typename UnguardedLoserTree,
+ typename RandomAccessIteratorIterator,
+ typename RandomAccessIterator3,
+ typename _DifferenceTp,
+ typename Comparator>
+ RandomAccessIterator3
+ multiway_merge_loser_tree_sentinel(
+ RandomAccessIteratorIterator seqs_begin,
+ RandomAccessIteratorIterator seqs_end,
+ RandomAccessIterator3 target,
+ const typename std::iterator_traits<typename std::iterator_traits<
+ RandomAccessIteratorIterator>::value_type::first_type>::value_type&
+ sentinel,
+ _DifferenceTp length,
+ Comparator comp)
+ {
+ _GLIBCXX_CALL(length)
+
+ typedef _DifferenceTp difference_type;
+ typedef std::iterator_traits<RandomAccessIteratorIterator> traits_type;
+ typedef typename std::iterator_traits<RandomAccessIteratorIterator>
+ ::value_type::first_type
+ RandomAccessIterator1;
+ typedef typename std::iterator_traits<RandomAccessIterator1>::value_type
+ value_type;
+
+ RandomAccessIterator3 target_end;
+
+ for (RandomAccessIteratorIterator s = seqs_begin; s != seqs_end; ++s)
+ // Move the sequends end behind the sentinel spots. This has the
+ // effect that the sentinel appears to be within the sequence. Then,
+ // we can use the unguarded variant if we merge out as many
+ // non-sentinel elements as we have.
+ ++((*s).second);
+
+ target_end = multiway_merge_loser_tree_unguarded
+ <UnguardedLoserTree>
+ (seqs_begin, seqs_end, target, sentinel, length, comp);
+
+#if _GLIBCXX_ASSERTIONS
+ _GLIBCXX_PARALLEL_ASSERT(target_end == target + length);
+ _GLIBCXX_PARALLEL_ASSERT(is_sorted(target, target_end, comp));
+#endif
+
+ // Restore the sequence ends so the sentinels are not contained in the
+ // sequence any more (see comment in loop above).
+ for (RandomAccessIteratorIterator s = seqs_begin; s != seqs_end; ++s)
+ --((*s).second);
+
+ return target_end;
+ }
+
+/**
+ * @brief Traits for determining whether the loser tree should
+ * use pointers or copies.
+ *
+ * The field "use_pointer" is used to determine whether to use pointers in
+ * the loser trees or whether to copy the values into the loser tree.
+ *
+ * The default behavior is to use pointers if the data type is 4 times as
+ * big as the pointer to it.
+ *
+ * Specialize for your data type to customize the behavior.
+ *
+ * Example:
+ *
+ * template<>
+ * struct loser_tree_traits<int>
+ * { static const bool use_pointer = false; };
+ *
+ * template<>
+ * struct loser_tree_traits<heavyweight_type>
+ * { static const bool use_pointer = true; };
+ *
+ * @param T type to give the loser tree traits for.
+ */
+template <typename T>
+struct loser_tree_traits
+{
+ /**
+ * @brief True iff to use pointers instead of values in loser trees.
+ *
+ * The default behavior is to use pointers if the data type is four
+ * times as big as the pointer to it.
+ */
+ static const bool use_pointer = (sizeof(T) > 4 * sizeof(T*));
+};
+
+/**
+ * @brief Switch for 3-way merging with sentinels turned off.
+ *
+ * Note that 3-way merging is always stable!
+ */
+template<
+ bool sentinels /*default == false*/,
+ typename RandomAccessIteratorIterator,
+ typename RandomAccessIterator3,
+ typename _DifferenceTp,
+ typename Comparator>
+struct multiway_merge_3_variant_sentinel_switch
+{
+ RandomAccessIterator3 operator()(
+ RandomAccessIteratorIterator seqs_begin,
+ RandomAccessIteratorIterator seqs_end,
+ RandomAccessIterator3 target,
+ _DifferenceTp length, Comparator comp)
+ {
+ return multiway_merge_3_variant<guarded_iterator>(
+ seqs_begin, seqs_end, target, length, comp);
+ }
+};
+
+/**
+ * @brief Switch for 3-way merging with sentinels turned on.
+ *
+ * Note that 3-way merging is always stable!
+ */
+template<
+ typename RandomAccessIteratorIterator,
+ typename RandomAccessIterator3,
+ typename _DifferenceTp,
+ typename Comparator>
+struct multiway_merge_3_variant_sentinel_switch
+ <true, RandomAccessIteratorIterator, RandomAccessIterator3,
+ _DifferenceTp, Comparator>
+{
+ RandomAccessIterator3 operator()(
+ RandomAccessIteratorIterator seqs_begin,
+ RandomAccessIteratorIterator seqs_end,
+ RandomAccessIterator3 target,
+ _DifferenceTp length, Comparator comp)
+ {
+ return multiway_merge_3_variant<unguarded_iterator>(
+ seqs_begin, seqs_end, target, length, comp);
+ }
+};
+
+/**
+ * @brief Switch for 4-way merging with sentinels turned off.
+ *
+ * Note that 4-way merging is always stable!
+ */
+template<
+ bool sentinels /*default == false*/,
+ typename RandomAccessIteratorIterator,
+ typename RandomAccessIterator3,
+ typename _DifferenceTp,
+ typename Comparator>
+struct multiway_merge_4_variant_sentinel_switch
+{
+ RandomAccessIterator3 operator()(
+ RandomAccessIteratorIterator seqs_begin,
+ RandomAccessIteratorIterator seqs_end,
+ RandomAccessIterator3 target,
+ _DifferenceTp length, Comparator comp)
+ {
+ return multiway_merge_4_variant<guarded_iterator>(
+ seqs_begin, seqs_end, target, length, comp);
+ }
+};
+
+/**
+ * @brief Switch for 4-way merging with sentinels turned on.
+ *
+ * Note that 4-way merging is always stable!
+ */
+template<
+ typename RandomAccessIteratorIterator,
+ typename RandomAccessIterator3,
+ typename _DifferenceTp,
+ typename Comparator>
+struct multiway_merge_4_variant_sentinel_switch
+ <true, RandomAccessIteratorIterator, RandomAccessIterator3,
+ _DifferenceTp, Comparator>
+{
+ RandomAccessIterator3 operator()(
+ RandomAccessIteratorIterator seqs_begin,
+ RandomAccessIteratorIterator seqs_end,
+ RandomAccessIterator3 target,
+ _DifferenceTp length, Comparator comp)
+ {
+ return multiway_merge_4_variant<unguarded_iterator>(
+ seqs_begin, seqs_end, target, length, comp);
+ }
+};
+
+/**
+ * @brief Switch for k-way merging with sentinels turned on.
+ */
+template<
+ bool sentinels,
+ bool stable,
+ typename RandomAccessIteratorIterator,
+ typename RandomAccessIterator3,
+ typename _DifferenceTp,
+ typename Comparator>
+struct multiway_merge_k_variant_sentinel_switch
+{
+ RandomAccessIterator3 operator()(
+ RandomAccessIteratorIterator seqs_begin,
+ RandomAccessIteratorIterator seqs_end,
+ RandomAccessIterator3 target,
+ const typename std::iterator_traits<typename std::iterator_traits<
+ RandomAccessIteratorIterator>::value_type::first_type>::value_type&
+ sentinel,
+ _DifferenceTp length, Comparator comp)
+ {
+ typedef typename std::iterator_traits<RandomAccessIteratorIterator>
+ ::value_type::first_type
+ RandomAccessIterator1;
+ typedef typename std::iterator_traits<RandomAccessIterator1>::value_type
+ value_type;
+
+ return multiway_merge_loser_tree_sentinel<
+ typename __gnu_cxx::__conditional_type<
+ loser_tree_traits<value_type>::use_pointer
+ , LoserTreePointerUnguarded<stable, value_type, Comparator>
+ , LoserTreeUnguarded<stable, value_type, Comparator>
+ >::__type>(seqs_begin, seqs_end, target, sentinel, length, comp);
+ }
+};
+
+/**
+ * @brief Switch for k-way merging with sentinels turned off.
+ */
+template<
+ bool stable,
+ typename RandomAccessIteratorIterator,
+ typename RandomAccessIterator3,
+ typename _DifferenceTp,
+ typename Comparator>
+struct multiway_merge_k_variant_sentinel_switch
+ <false, stable, RandomAccessIteratorIterator, RandomAccessIterator3,
+ _DifferenceTp, Comparator>
+{
+ RandomAccessIterator3 operator()(
+ RandomAccessIteratorIterator seqs_begin,
+ RandomAccessIteratorIterator seqs_end,
+ RandomAccessIterator3 target,
+ const typename std::iterator_traits<typename std::iterator_traits<
+ RandomAccessIteratorIterator>::value_type::first_type>::value_type&
+ sentinel,
+ _DifferenceTp length, Comparator comp)
+ {
+ typedef typename std::iterator_traits<RandomAccessIteratorIterator>
+ ::value_type::first_type
+ RandomAccessIterator1;
+ typedef typename std::iterator_traits<RandomAccessIterator1>::value_type
+ value_type;
+
+ return multiway_merge_loser_tree<
+ typename __gnu_cxx::__conditional_type<
+ loser_tree_traits<value_type>::use_pointer
+ , LoserTreePointer<stable, value_type, Comparator>
+ , LoserTree<stable, value_type, Comparator>
+ >::__type >(seqs_begin, seqs_end, target, length, comp);
+ }
+};
+
+/** @brief Sequential multi-way merging switch.
+ *
+ * The _GLIBCXX_PARALLEL_DECISION is based on the branching factor and
+ * runtime settings.
+ * @param seqs_begin Begin iterator of iterator pair input sequence.
+ * @param seqs_end End iterator of iterator pair input sequence.
+ * @param target Begin iterator out output sequence.
+ * @param comp Comparator.
+ * @param length Maximum length to merge, possibly larger than the
+ * number of elements available.
+ * @param stable Stable merging incurs a performance penalty.
+ * @param sentinel The sequences have a sentinel element.
+ * @return End iterator of output sequence. */
+template<
+ bool stable,
+ bool sentinels,
+ typename RandomAccessIteratorIterator,
+ typename RandomAccessIterator3,
+ typename _DifferenceTp,
+ typename Comparator>
+ RandomAccessIterator3
+ sequential_multiway_merge(
+ RandomAccessIteratorIterator seqs_begin,
+ RandomAccessIteratorIterator seqs_end,
+ RandomAccessIterator3 target,
+ const typename std::iterator_traits<typename std::iterator_traits<
+ RandomAccessIteratorIterator>::value_type::first_type>::value_type&
+ sentinel,
+ _DifferenceTp length, Comparator comp)
+ {
+ _GLIBCXX_CALL(length)
+
+ typedef _DifferenceTp difference_type;
+ typedef typename std::iterator_traits<RandomAccessIteratorIterator>
+ ::value_type::first_type
+ RandomAccessIterator1;
+ typedef typename std::iterator_traits<RandomAccessIterator1>::value_type
+ value_type;
+
+#if _GLIBCXX_ASSERTIONS
+ for (RandomAccessIteratorIterator s = seqs_begin; s != seqs_end; ++s)
+ {
+ _GLIBCXX_PARALLEL_ASSERT(is_sorted((*s).first, (*s).second, comp));
+ }
+#endif
+
+ _DifferenceTp total_length = 0;
+ for (RandomAccessIteratorIterator s = seqs_begin; s != seqs_end; ++s)
+ total_length += _GLIBCXX_PARALLEL_LENGTH(*s);
+
+ length = std::min<_DifferenceTp>(length, total_length);
+
+ if(length == 0)
+ return target;
+
+ RandomAccessIterator3 return_target = target;
+ int k = static_cast<int>(seqs_end - seqs_begin);
+
+ switch (k)
+ {
+ case 0:
+ break;
+ case 1:
+ return_target = std::copy(seqs_begin[0].first,
+ seqs_begin[0].first + length,
+ target);
+ seqs_begin[0].first += length;
+ break;
+ case 2:
+ return_target = merge_advance(seqs_begin[0].first,
+ seqs_begin[0].second,
+ seqs_begin[1].first,
+ seqs_begin[1].second,
+ target, length, comp);
+ break;
+ case 3:
+ return_target = multiway_merge_3_variant_sentinel_switch<
+ sentinels
+ , RandomAccessIteratorIterator
+ , RandomAccessIterator3
+ , _DifferenceTp
+ , Comparator>()(seqs_begin, seqs_end, target, length, comp);
+ break;
+ case 4:
+ return_target = multiway_merge_4_variant_sentinel_switch<
+ sentinels
+ , RandomAccessIteratorIterator
+ , RandomAccessIterator3
+ , _DifferenceTp
+ , Comparator>()(seqs_begin, seqs_end, target, length, comp);
+ break;
+ default:
+ return_target = multiway_merge_k_variant_sentinel_switch<
+ sentinels
+ , stable
+ , RandomAccessIteratorIterator
+ , RandomAccessIterator3
+ , _DifferenceTp
+ , Comparator>()(seqs_begin, seqs_end, target, sentinel, length, comp);
+ break;
+ }
+#if _GLIBCXX_ASSERTIONS
+ _GLIBCXX_PARALLEL_ASSERT(is_sorted(target, target + length, comp));
+#endif
+
+ return return_target;
+ }
+
+/**
+ * @brief Stable sorting functor.
+ *
+ * Used to reduce code instanciation in multiway_merge_sampling_splitting.
+ */
+template<bool stable, class RandomAccessIterator, class StrictWeakOrdering>
+struct sampling_sorter
+{
+ void operator()(RandomAccessIterator first, RandomAccessIterator last,
+ StrictWeakOrdering comp)
+ { __gnu_sequential::stable_sort(first, last, comp); }
+};
+
+/**
+ * @brief Non-stable sorting functor.
+ *
+ * Used to reduce code instantiation in multiway_merge_sampling_splitting.
+ */
+template<class RandomAccessIterator, class StrictWeakOrdering>
+struct sampling_sorter<false, RandomAccessIterator, StrictWeakOrdering>
+{
+ void operator()(RandomAccessIterator first, RandomAccessIterator last,
+ StrictWeakOrdering comp)
+ { __gnu_sequential::sort(first, last, comp); }
+};
+
+/**
+ * @brief Sampling based splitting for parallel multiway-merge routine.
+ */
+template<
+ bool stable
+ , typename RandomAccessIteratorIterator
+ , typename Comparator
+ , typename difference_type>
+void multiway_merge_sampling_splitting(
+ RandomAccessIteratorIterator seqs_begin,
+ RandomAccessIteratorIterator seqs_end,
+ difference_type length, difference_type total_length, Comparator comp,
+ std::vector<std::pair<difference_type, difference_type> > *pieces)
+{
+ typedef typename std::iterator_traits<RandomAccessIteratorIterator>
+ ::value_type::first_type
+ RandomAccessIterator1;
+ typedef typename std::iterator_traits<RandomAccessIterator1>::value_type
+ value_type;
+
+ // k sequences.
+ int k = static_cast<int>(seqs_end - seqs_begin);
+
+ int num_threads = omp_get_num_threads();
+
+ difference_type num_samples =
+ __gnu_parallel::_Settings::get().merge_oversampling * num_threads;
+
+ value_type* samples = static_cast<value_type*>(
+ ::operator new(sizeof(value_type) * k * num_samples));
+ // Sample.
+ for (int s = 0; s < k; ++s)
+ for (difference_type i = 0; i < num_samples; ++i)
+ {
+ difference_type sample_index =
+ static_cast<difference_type>(
+ _GLIBCXX_PARALLEL_LENGTH(seqs_begin[s])
+ * (double(i + 1) / (num_samples + 1))
+ * (double(length) / total_length));
+ new(&(samples[s * num_samples + i]))
+ value_type(seqs_begin[s].first[sample_index]);
+ }
+
+ // Sort stable or non-stable, depending on value of template parameter
+ // "stable".
+ sampling_sorter<stable, value_type*, Comparator>()(
+ samples, samples + (num_samples * k), comp);
+
+ for (int slab = 0; slab < num_threads; ++slab)
+ // For each slab / processor.
+ for (int seq = 0; seq < k; ++seq)
+ {
+ // For each sequence.
+ if (slab > 0)
+ pieces[slab][seq].first =
+ std::upper_bound(
+ seqs_begin[seq].first,
+ seqs_begin[seq].second,
+ samples[num_samples * k * slab / num_threads],
+ comp)
+ - seqs_begin[seq].first;
+ else
+ // Absolute beginning.
+ pieces[slab][seq].first = 0;
+ if ((slab + 1) < num_threads)
+ pieces[slab][seq].second =
+ std::upper_bound(
+ seqs_begin[seq].first,
+ seqs_begin[seq].second,
+ samples[num_samples * k * (slab + 1) /
+ num_threads], comp)
+ - seqs_begin[seq].first;
+ else
+ // Absolute end.
+ pieces[slab][seq].second = _GLIBCXX_PARALLEL_LENGTH(seqs_begin[seq]);
+ }
+ ::operator delete(samples);
+}
+
+/**
+ * @brief Exact splitting for parallel multiway-merge routine.
+ *
+ * None of the passed sequences may be empty.
+ */
+template<
+ bool stable
+ , typename RandomAccessIteratorIterator
+ , typename Comparator
+ , typename difference_type>
+void multiway_merge_exact_splitting(
+ RandomAccessIteratorIterator seqs_begin,
+ RandomAccessIteratorIterator seqs_end,
+ difference_type length, difference_type total_length, Comparator comp,
+ std::vector<std::pair<difference_type, difference_type> > *pieces)
+{
+ typedef typename std::iterator_traits<RandomAccessIteratorIterator>
+ ::value_type::first_type
+ RandomAccessIterator1;
+
+ const bool tight = (total_length == length);
+
+ // k sequences.
+ const int k = static_cast<int>(seqs_end - seqs_begin);
+
+ const int num_threads = omp_get_num_threads();
+
+ // (Settings::multiway_merge_splitting == __gnu_parallel::_Settings::EXACT).
+ std::vector<RandomAccessIterator1>* offsets =
+ new std::vector<RandomAccessIterator1>[num_threads];
+ std::vector<
+ std::pair<RandomAccessIterator1, RandomAccessIterator1>
+ > se(k);
+
+ copy(seqs_begin, seqs_end, se.begin());
+
+ difference_type* borders =
+ new difference_type[num_threads + 1];
+ equally_split(length, num_threads, borders);
+
+ for (int s = 0; s < (num_threads - 1); ++s)
+ {
+ offsets[s].resize(k);
+ multiseq_partition(
+ se.begin(), se.end(), borders[s + 1],
+ offsets[s].begin(), comp);
+
+ // Last one also needed and available.
+ if (!tight)
+ {
+ offsets[num_threads - 1].resize(k);
+ multiseq_partition(se.begin(), se.end(),
+ difference_type(length),
+ offsets[num_threads - 1].begin(), comp);
+ }
+ }
+ delete[] borders;
+
+ for (int slab = 0; slab < num_threads; ++slab)
+ {
+ // For each slab / processor.
+ for (int seq = 0; seq < k; ++seq)
+ {
+ // For each sequence.
+ if (slab == 0)
+ {
+ // Absolute beginning.
+ pieces[slab][seq].first = 0;
+ }
+ else
+ pieces[slab][seq].first =
+ pieces[slab - 1][seq].second;
+ if (!tight || slab < (num_threads - 1))
+ pieces[slab][seq].second =
+ offsets[slab][seq] - seqs_begin[seq].first;
+ else
+ {
+ // slab == num_threads - 1
+ pieces[slab][seq].second =
+ _GLIBCXX_PARALLEL_LENGTH(seqs_begin[seq]);
+ }
+ }
+ }
+ delete[] offsets;
+}
+
+/** @brief Parallel multi-way merge routine.
+ *
+ * The _GLIBCXX_PARALLEL_DECISION is based on the branching factor
+ * and runtime settings.
+ *
+ * Must not be called if the number of sequences is 1.
+ *
+ * @param Splitter functor to split input (either exact or sampling based)
+ *
+ * @param seqs_begin Begin iterator of iterator pair input sequence.
+ * @param seqs_end End iterator of iterator pair input sequence.
+ * @param target Begin iterator out output sequence.
+ * @param comp Comparator.
+ * @param length Maximum length to merge, possibly larger than the
+ * number of elements available.
+ * @param stable Stable merging incurs a performance penalty.
+ * @param sentinel Ignored.
+ * @return End iterator of output sequence.
+ */
+template<
+ bool stable,
+ bool sentinels,
+ typename RandomAccessIteratorIterator,
+ typename RandomAccessIterator3,
+ typename _DifferenceTp,
+ typename Splitter,
+ typename Comparator
+ >
+ RandomAccessIterator3
+ parallel_multiway_merge(RandomAccessIteratorIterator seqs_begin,
+ RandomAccessIteratorIterator seqs_end,
+ RandomAccessIterator3 target,
+ Splitter splitter,
+ _DifferenceTp length,
+ Comparator comp,
+ thread_index_t num_threads)
+ {
+#if _GLIBCXX_ASSERTIONS
+ _GLIBCXX_PARALLEL_ASSERT(seqs_end - seqs_begin > 1);
+#endif
+
+ _GLIBCXX_CALL(length)
+
+ typedef _DifferenceTp difference_type;
+ typedef typename std::iterator_traits<RandomAccessIteratorIterator>
+ ::value_type::first_type
+ RandomAccessIterator1;
+ typedef typename
+ std::iterator_traits<RandomAccessIterator1>::value_type value_type;
+
+ // Leave only non-empty sequences.
+ typedef std::pair<RandomAccessIterator1, RandomAccessIterator1> seq_type;
+ seq_type* ne_seqs = new seq_type[seqs_end - seqs_begin];
+ int k = 0;
+ difference_type total_length = 0;
+ for (RandomAccessIteratorIterator raii = seqs_begin;
+ raii != seqs_end; ++raii)
+ {
+ _DifferenceTp seq_length = _GLIBCXX_PARALLEL_LENGTH(*raii);
+ if(seq_length > 0)
+ {
+ total_length += seq_length;
+ ne_seqs[k++] = *raii;
+ }
+ }
+
+ _GLIBCXX_CALL(total_length)
+
+ length = std::min<_DifferenceTp>(length, total_length);
+
+ if (total_length == 0 || k == 0)
+ {
+ delete[] ne_seqs;
+ return target;
+ }
+
+ std::vector<std::pair<difference_type, difference_type> >* pieces;
+
+ num_threads = static_cast<thread_index_t>
+ (std::min<difference_type>(num_threads, total_length));
+
+# pragma omp parallel num_threads (num_threads)
+ {
+# pragma omp single
+ {
+ num_threads = omp_get_num_threads();
+ // Thread t will have to merge pieces[iam][0..k - 1]
+ pieces = new std::vector<
+ std::pair<difference_type, difference_type> >[num_threads];
+ for (int s = 0; s < num_threads; ++s)
+ pieces[s].resize(k);
+
+ difference_type num_samples =
+ __gnu_parallel::_Settings::get().merge_oversampling *
+ num_threads;
+
+ splitter(ne_seqs, ne_seqs + k, length, total_length,
+ comp, pieces);
+ } //single
+
+ thread_index_t iam = omp_get_thread_num();
+
+ difference_type target_position = 0;
+
+ for (int c = 0; c < k; ++c)
+ target_position += pieces[iam][c].first;
+
+ seq_type* chunks = new seq_type[k];
+
+ for (int s = 0; s < k; ++s)
+ {
+ chunks[s] = std::make_pair(
+ ne_seqs[s].first + pieces[iam][s].first,
+ ne_seqs[s].first + pieces[iam][s].second);
+ }
+
+ if(length > target_position)
+ sequential_multiway_merge<stable, sentinels>(
+ chunks, chunks + k, target + target_position,
+ *(seqs_begin->second), length - target_position, comp);
+
+ delete[] chunks;
+ } // parallel
+
+#if _GLIBCXX_ASSERTIONS
+ _GLIBCXX_PARALLEL_ASSERT(is_sorted(target, target + length, comp));
+#endif
+
+ k = 0;
+ // Update ends of sequences.
+ for (RandomAccessIteratorIterator raii = seqs_begin;
+ raii != seqs_end; ++raii)
+ {
+ _DifferenceTp length = _GLIBCXX_PARALLEL_LENGTH(*raii);
+ if(length > 0)
+ (*raii).first += pieces[num_threads - 1][k++].second;
+ }
+
+ delete[] pieces;
+ delete[] ne_seqs;
+
+ return target + length;
+ }
+
+/**
+ * @brief Multiway Merge Frontend.
+ *
+ * Merge the sequences specified by seqs_begin and seqs_end into
+ * target. seqs_begin and seqs_end must point to a sequence of
+ * pairs. These pairs must contain an iterator to the beginning
+ * of a sequence in their first entry and an iterator the end of
+ * the same sequence in their second entry.
+ *
+ * Ties are broken arbitrarily. See stable_multiway_merge for a variant
+ * that breaks ties by sequence number but is slower.
+ *
+ * The first entries of the pairs (i.e. the begin iterators) will be moved
+ * forward.
+ *
+ * The output sequence has to provide enough space for all elements
+ * that are written to it.
+ *
+ * This function will merge the input sequences:
+ *
+ * - not stable
+ * - parallel, depending on the input size and Settings
+ * - using sampling for splitting
+ * - not using sentinels
+ *
+ * Example:
+ *
+ * <pre>
+ * int sequences[10][10];
+ * for (int i = 0; i < 10; ++i)
+ * for (int j = 0; i < 10; ++j)
+ * sequences[i][j] = j;
+ *
+ * int out[33];
+ * std::vector<std::pair<int*> > seqs;
+ * for (int i = 0; i < 10; ++i)
+ * { seqs.push(std::make_pair<int*>(sequences[i], sequences[i] + 10)) }
+ *
+ * multiway_merge(seqs.begin(), seqs.end(), target, std::less<int>(), 33);
+ * </pre>
+ *
+ * @see stable_multiway_merge
+ *
+ * @pre All input sequences must be sorted.
+ * @pre Target must provide enough space to merge out length elements or
+ * the number of elements in all sequences, whichever is smaller.
+ *
+ * @post [target, return value) contains merged elements from the
+ * input sequences.
+ * @post return value - target = min(length, number of elements in all
+ * sequences).
+ *
+ * @param RandomAccessIteratorPairIterator iterator over sequence
+ * of pairs of iterators
+ * @param RandomAccessIteratorOut iterator over target sequence
+ * @param _DifferenceTp difference type for the sequence
+ * @param Comparator strict weak ordering type to compare elements
+ * in sequences
+ *
+ * @param seqs_begin begin of sequence sequence
+ * @param seqs_end end of sequence sequence
+ * @param target target sequence to merge to.
+ * @param comp strict weak ordering to use for element comparison.
+ * @param length Maximum length to merge, possibly larger than the
+ * number of elements available.
+ *
+ * @return end iterator of output sequence
+ */
+// multiway_merge
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+multiway_merge(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , __gnu_parallel::sequential_tag)
+{
+ typedef _DifferenceTp difference_type;
+ _GLIBCXX_CALL(seqs_end - seqs_begin)
+
+ // catch special case: no sequences
+ if (seqs_begin == seqs_end)
+ return target;
+
+ // Execute multiway merge *sequentially*.
+ return sequential_multiway_merge
+ </* stable = */ false, /* sentinels = */ false>
+ (seqs_begin, seqs_end, target, *(seqs_begin->second), length, comp);
+}
+
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+multiway_merge(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , __gnu_parallel::exact_tag tag)
+{
+ typedef _DifferenceTp difference_type;
+ _GLIBCXX_CALL(seqs_end - seqs_begin)
+
+ // catch special case: no sequences
+ if (seqs_begin == seqs_end)
+ return target;
+
+ // Execute merge; maybe parallel, depending on the number of merged
+ // elements and the number of sequences and global thresholds in
+ // Settings.
+ if ((seqs_end - seqs_begin > 1) &&
+ _GLIBCXX_PARALLEL_CONDITION(
+ ((seqs_end - seqs_begin) >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_k)
+ && ((sequence_index_t)length >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_n)))
+ return parallel_multiway_merge
+ </* stable = */ false, /* sentinels = */ false>(
+ seqs_begin, seqs_end, target,
+ multiway_merge_exact_splitting</* stable = */ false,
+ typename std::iterator_traits<RandomAccessIteratorPairIterator>
+ ::value_type*, Comparator, _DifferenceTp>,
+ static_cast<difference_type>(length), comp, tag.get_num_threads());
+ else
+ return sequential_multiway_merge
+ </* stable = */ false, /* sentinels = */ false>(
+ seqs_begin, seqs_end, target, *(seqs_begin->second), length, comp);
+}
+
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+multiway_merge(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , __gnu_parallel::sampling_tag tag)
+{
+ typedef _DifferenceTp difference_type;
+ _GLIBCXX_CALL(seqs_end - seqs_begin)
+
+ // catch special case: no sequences
+ if (seqs_begin == seqs_end)
+ return target;
+
+ // Execute merge; maybe parallel, depending on the number of merged
+ // elements and the number of sequences and global thresholds in
+ // Settings.
+ if ((seqs_end - seqs_begin > 1) &&
+ _GLIBCXX_PARALLEL_CONDITION(
+ ((seqs_end - seqs_begin) >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_k)
+ && ((sequence_index_t)length >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_n)))
+ return parallel_multiway_merge
+ </* stable = */ false, /* sentinels = */ false>(
+ seqs_begin, seqs_end,
+ target,
+ multiway_merge_exact_splitting</* stable = */ false,
+ typename std::iterator_traits<RandomAccessIteratorPairIterator>
+ ::value_type*, Comparator, _DifferenceTp>,
+ static_cast<difference_type>(length), comp, tag.get_num_threads());
+ else
+ return sequential_multiway_merge
+ </* stable = */ false, /* sentinels = */ false>(
+ seqs_begin, seqs_end,
+ target, *(seqs_begin->second), length, comp);
+}
+
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+multiway_merge(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , parallel_tag tag = parallel_tag(0))
+{
+ return multiway_merge(seqs_begin, seqs_end, target, length, comp,
+ exact_tag(tag.get_num_threads()));
+}
+
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+multiway_merge(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , default_parallel_tag tag)
+{
+ return multiway_merge(seqs_begin, seqs_end, target, length, comp,
+ exact_tag(tag.get_num_threads()));
+}
+
+// stable_multiway_merge
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+stable_multiway_merge(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , __gnu_parallel::sequential_tag)
+{
+ typedef _DifferenceTp difference_type;
+ _GLIBCXX_CALL(seqs_end - seqs_begin)
+
+ // catch special case: no sequences
+ if (seqs_begin == seqs_end)
+ return target;
+
+ // Execute multiway merge *sequentially*.
+ return sequential_multiway_merge
+ </* stable = */ true, /* sentinels = */ false>
+ (seqs_begin, seqs_end, target, *(seqs_begin->second), length, comp);
+}
+
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+stable_multiway_merge(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , __gnu_parallel::exact_tag tag)
+{
+ typedef _DifferenceTp difference_type;
+ _GLIBCXX_CALL(seqs_end - seqs_begin)
+
+ // catch special case: no sequences
+ if (seqs_begin == seqs_end)
+ return target;
+
+ // Execute merge; maybe parallel, depending on the number of merged
+ // elements and the number of sequences and global thresholds in
+ // Settings.
+ if ((seqs_end - seqs_begin > 1) &&
+ _GLIBCXX_PARALLEL_CONDITION(
+ ((seqs_end - seqs_begin) >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_k)
+ && ((sequence_index_t)length >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_n)))
+ return parallel_multiway_merge
+ </* stable = */ true, /* sentinels = */ false>(
+ seqs_begin, seqs_end,
+ target,
+ multiway_merge_exact_splitting</* stable = */ true,
+ typename std::iterator_traits<RandomAccessIteratorPairIterator>
+ ::value_type*, Comparator, _DifferenceTp>,
+ static_cast<difference_type>(length), comp, tag.get_num_threads());
+ else
+ return sequential_multiway_merge</* stable = */ true,
+ /* sentinels = */ false>(
+ seqs_begin, seqs_end,
+ target, *(seqs_begin->second), length, comp);
+}
+
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+stable_multiway_merge(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , sampling_tag tag)
+{
+ typedef _DifferenceTp difference_type;
+ _GLIBCXX_CALL(seqs_end - seqs_begin)
+
+ // catch special case: no sequences
+ if (seqs_begin == seqs_end)
+ return target;
+
+ // Execute merge; maybe parallel, depending on the number of merged
+ // elements and the number of sequences and global thresholds in
+ // Settings.
+ if ((seqs_end - seqs_begin > 1) &&
+ _GLIBCXX_PARALLEL_CONDITION(
+ ((seqs_end - seqs_begin) >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_k)
+ && ((sequence_index_t)length >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_n)))
+ return parallel_multiway_merge
+ </* stable = */ true, /* sentinels = */ false>(
+ seqs_begin, seqs_end,
+ target,
+ multiway_merge_sampling_splitting</* stable = */ true,
+ typename std::iterator_traits<RandomAccessIteratorPairIterator>
+ ::value_type*, Comparator, _DifferenceTp>,
+ static_cast<difference_type>(length), comp, tag.get_num_threads());
+ else
+ return sequential_multiway_merge
+ </* stable = */ true, /* sentinels = */ false>(
+ seqs_begin, seqs_end,
+ target, *(seqs_begin->second), length, comp);
+}
+
+
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+stable_multiway_merge(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , parallel_tag tag = parallel_tag(0))
+{
+ return stable_multiway_merge(seqs_begin, seqs_end, target, length, comp,
+ exact_tag(tag.get_num_threads()));
+}
+
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+stable_multiway_merge(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , default_parallel_tag tag)
+{
+ return stable_multiway_merge(seqs_begin, seqs_end, target, length, comp,
+ exact_tag(tag.get_num_threads()));
+}
+
+/**
+ * @brief Multiway Merge Frontend.
+ *
+ * Merge the sequences specified by seqs_begin and seqs_end into
+ * target. seqs_begin and seqs_end must point to a sequence of
+ * pairs. These pairs must contain an iterator to the beginning
+ * of a sequence in their first entry and an iterator the end of
+ * the same sequence in their second entry.
+ *
+ * Ties are broken arbitrarily. See stable_multiway_merge for a variant
+ * that breaks ties by sequence number but is slower.
+ *
+ * The first entries of the pairs (i.e. the begin iterators) will be moved
+ * forward accordingly.
+ *
+ * The output sequence has to provide enough space for all elements
+ * that are written to it.
+ *
+ * This function will merge the input sequences:
+ *
+ * - not stable
+ * - parallel, depending on the input size and Settings
+ * - using sampling for splitting
+ * - using sentinels
+ *
+ * You have to take care that the element the end iterator points to is
+ * readable and contains a value that is greater than any other non-sentinel
+ * value in all sequences.
+ *
+ * Example:
+ *
+ * <pre>
+ * int sequences[10][11];
+ * for (int i = 0; i < 10; ++i)
+ * for (int j = 0; i < 11; ++j)
+ * sequences[i][j] = j; // last one is sentinel!
+ *
+ * int out[33];
+ * std::vector<std::pair<int*> > seqs;
+ * for (int i = 0; i < 10; ++i)
+ * { seqs.push(std::make_pair<int*>(sequences[i], sequences[i] + 10)) }
+ *
+ * multiway_merge(seqs.begin(), seqs.end(), target, std::less<int>(), 33);
+ * </pre>
+ *
+ * @pre All input sequences must be sorted.
+ * @pre Target must provide enough space to merge out length elements or
+ * the number of elements in all sequences, whichever is smaller.
+ * @pre For each @c i, @c seqs_begin[i].second must be the end
+ * marker of the sequence, but also reference the one more sentinel
+ * element.
+ *
+ * @post [target, return value) contains merged elements from the
+ * input sequences.
+ * @post return value - target = min(length, number of elements in all
+ * sequences).
+ *
+ * @see stable_multiway_merge_sentinels
+ *
+ * @param RandomAccessIteratorPairIterator iterator over sequence
+ * of pairs of iterators
+ * @param RandomAccessIteratorOut iterator over target sequence
+ * @param _DifferenceTp difference type for the sequence
+ * @param Comparator strict weak ordering type to compare elements
+ * in sequences
+ *
+ * @param seqs_begin begin of sequence sequence
+ * @param seqs_end end of sequence sequence
+ * @param target target sequence to merge to.
+ * @param comp strict weak ordering to use for element comparison.
+ * @param length Maximum length to merge, possibly larger than the
+ * number of elements available.
+ *
+ * @return end iterator of output sequence
+ */
+// multiway_merge_sentinels
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+multiway_merge_sentinels(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , __gnu_parallel::sequential_tag)
+{
+ typedef _DifferenceTp difference_type;
+ _GLIBCXX_CALL(seqs_end - seqs_begin)
+
+ // catch special case: no sequences
+ if (seqs_begin == seqs_end)
+ return target;
+
+ // Execute multiway merge *sequentially*.
+ return sequential_multiway_merge
+ </* stable = */ false, /* sentinels = */ true>
+ (seqs_begin, seqs_end,
+ target, *(seqs_begin->second), length, comp);
+}
+
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+multiway_merge_sentinels(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , __gnu_parallel::exact_tag tag)
+{
+ typedef _DifferenceTp difference_type;
+ _GLIBCXX_CALL(seqs_end - seqs_begin)
+
+ // catch special case: no sequences
+ if (seqs_begin == seqs_end)
+ return target;
+
+ // Execute merge; maybe parallel, depending on the number of merged
+ // elements and the number of sequences and global thresholds in
+ // Settings.
+ if ((seqs_end - seqs_begin > 1) &&
+ _GLIBCXX_PARALLEL_CONDITION(
+ ((seqs_end - seqs_begin) >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_k)
+ && ((sequence_index_t)length >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_n)))
+ return parallel_multiway_merge
+ </* stable = */ false, /* sentinels = */ true>(
+ seqs_begin, seqs_end,
+ target,
+ multiway_merge_exact_splitting</* stable = */ false,
+ typename std::iterator_traits<RandomAccessIteratorPairIterator>
+ ::value_type*, Comparator, _DifferenceTp>,
+ static_cast<difference_type>(length), comp, tag.get_num_threads());
+ else
+ return sequential_multiway_merge
+ </* stable = */ false, /* sentinels = */ true>(
+ seqs_begin, seqs_end,
+ target, *(seqs_begin->second), length, comp);
+}
+
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+multiway_merge_sentinels(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , sampling_tag tag)
+{
+ typedef _DifferenceTp difference_type;
+ _GLIBCXX_CALL(seqs_end - seqs_begin)
+
+ // catch special case: no sequences
+ if (seqs_begin == seqs_end)
+ return target;
+
+ // Execute merge; maybe parallel, depending on the number of merged
+ // elements and the number of sequences and global thresholds in
+ // Settings.
+ if ((seqs_end - seqs_begin > 1) &&
+ _GLIBCXX_PARALLEL_CONDITION(
+ ((seqs_end - seqs_begin) >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_k)
+ && ((sequence_index_t)length >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_n)))
+ return parallel_multiway_merge
+ </* stable = */ false, /* sentinels = */ true>
+ (seqs_begin, seqs_end, target,
+ multiway_merge_sampling_splitting</* stable = */ false,
+ typename std::iterator_traits<RandomAccessIteratorPairIterator>
+ ::value_type*, Comparator, _DifferenceTp>,
+ static_cast<difference_type>(length), comp, tag.get_num_threads());
+ else
+ return sequential_multiway_merge
+ </* stable = */false, /* sentinels = */ true>(
+ seqs_begin, seqs_end,
+ target, *(seqs_begin->second), length, comp);
+}
+
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+multiway_merge_sentinels(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , parallel_tag tag = parallel_tag(0))
+{
+ return multiway_merge_sentinels(seqs_begin, seqs_end, target, length, comp,
+ exact_tag(tag.get_num_threads()));
+}
+
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+multiway_merge_sentinels(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , default_parallel_tag tag)
+{
+ return multiway_merge_sentinels(seqs_begin, seqs_end, target, length, comp,
+ exact_tag(tag.get_num_threads()));
+}
+
+// stable_multiway_merge_sentinels
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+stable_multiway_merge_sentinels(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , __gnu_parallel::sequential_tag)
+{
+ typedef _DifferenceTp difference_type;
+ _GLIBCXX_CALL(seqs_end - seqs_begin)
+
+ // catch special case: no sequences
+ if (seqs_begin == seqs_end)
+ return target;
+
+ // Execute multiway merge *sequentially*.
+ return sequential_multiway_merge
+ </* stable = */ true, /* sentinels = */ true>
+ (seqs_begin, seqs_end, target, *(seqs_begin->second), length, comp);
+}
+
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+stable_multiway_merge_sentinels(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , __gnu_parallel::exact_tag tag)
+{
+ typedef _DifferenceTp difference_type;
+ _GLIBCXX_CALL(seqs_end - seqs_begin)
+
+ // catch special case: no sequences
+ if (seqs_begin == seqs_end)
+ return target;
+
+ // Execute merge; maybe parallel, depending on the number of merged
+ // elements and the number of sequences and global thresholds in
+ // Settings.
+ if ((seqs_end - seqs_begin > 1) &&
+ _GLIBCXX_PARALLEL_CONDITION(
+ ((seqs_end - seqs_begin) >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_k)
+ && ((sequence_index_t)length >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_n)))
+ return parallel_multiway_merge
+ </* stable = */ true, /* sentinels = */ true>(
+ seqs_begin, seqs_end,
+ target,
+ multiway_merge_exact_splitting</* stable = */ true,
+ typename std::iterator_traits<RandomAccessIteratorPairIterator>
+ ::value_type*, Comparator, _DifferenceTp>,
+ static_cast<difference_type>(length), comp, tag.get_num_threads());
+ else
+ return sequential_multiway_merge
+ </* stable = */ true, /* sentinels = */ true>(
+ seqs_begin, seqs_end, target, *(seqs_begin->second), length, comp);
+}
+
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+stable_multiway_merge_sentinels(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , sampling_tag tag)
+{
+ typedef _DifferenceTp difference_type;
+ _GLIBCXX_CALL(seqs_end - seqs_begin)
+
+ // catch special case: no sequences
+ if (seqs_begin == seqs_end)
+ return target;
+
+ // Execute merge; maybe parallel, depending on the number of merged
+ // elements and the number of sequences and global thresholds in
+ // Settings.
+ if ((seqs_end - seqs_begin > 1) &&
+ _GLIBCXX_PARALLEL_CONDITION(
+ ((seqs_end - seqs_begin) >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_k)
+ && ((sequence_index_t)length >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_n)))
+ return parallel_multiway_merge
+ </* stable = */ true, /* sentinels = */ true>(
+ seqs_begin, seqs_end,
+ target,
+ multiway_merge_sampling_splitting</* stable = */ true,
+ typename std::iterator_traits<RandomAccessIteratorPairIterator>
+ ::value_type*, Comparator, _DifferenceTp>,
+ static_cast<difference_type>(length), comp, tag.get_num_threads());
+ else
+ return sequential_multiway_merge
+ </* stable = */ true, /* sentinels = */ true>(
+ seqs_begin, seqs_end,
+ target, *(seqs_begin->second), length, comp);
+}
+
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+stable_multiway_merge_sentinels(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , parallel_tag tag = parallel_tag(0))
+{
+ return stable_multiway_merge_sentinels(seqs_begin, seqs_end, target, length, comp,
+ exact_tag(tag.get_num_threads()));
+}
+
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+stable_multiway_merge_sentinels(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , default_parallel_tag tag)
+{
+ return stable_multiway_merge_sentinels(seqs_begin, seqs_end, target, length, comp,
+ exact_tag(tag.get_num_threads()));
+}
+
+}; // namespace __gnu_parallel
+
+#endif /* _GLIBCXX_PARALLEL_MULTIWAY_MERGE_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/multiway_mergesort.h b/i686-linux/include/c++/4.4.3/parallel/multiway_mergesort.h
new file mode 100644
index 0000000..11dd885
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/multiway_mergesort.h
@@ -0,0 +1,475 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/multiway_mergesort.h
+ * @brief Parallel multiway merge sort.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_MULTIWAY_MERGESORT_H
+#define _GLIBCXX_PARALLEL_MULTIWAY_MERGESORT_H 1
+
+#include <vector>
+
+#include <parallel/basic_iterator.h>
+#include <bits/stl_algo.h>
+#include <parallel/parallel.h>
+#include <parallel/multiway_merge.h>
+
+namespace __gnu_parallel
+{
+
+/** @brief Subsequence description. */
+template<typename _DifferenceTp>
+ struct Piece
+ {
+ typedef _DifferenceTp difference_type;
+
+ /** @brief Begin of subsequence. */
+ difference_type begin;
+
+ /** @brief End of subsequence. */
+ difference_type end;
+ };
+
+/** @brief Data accessed by all threads.
+ *
+ * PMWMS = parallel multiway mergesort */
+template<typename RandomAccessIterator>
+ struct PMWMSSortingData
+ {
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ /** @brief Number of threads involved. */
+ thread_index_t num_threads;
+
+ /** @brief Input begin. */
+ RandomAccessIterator source;
+
+ /** @brief Start indices, per thread. */
+ difference_type* starts;
+
+ /** @brief Storage in which to sort. */
+ value_type** temporary;
+
+ /** @brief Samples. */
+ value_type* samples;
+
+ /** @brief Offsets to add to the found positions. */
+ difference_type* offsets;
+
+ /** @brief Pieces of data to merge @c [thread][sequence] */
+ std::vector<Piece<difference_type> >* pieces;
+};
+
+/**
+ * @brief Select samples from a sequence.
+ * @param sd Pointer to algorithm data. Result will be placed in
+ * @c sd->samples.
+ * @param num_samples Number of samples to select.
+ */
+template<typename RandomAccessIterator, typename _DifferenceTp>
+ void
+ determine_samples(PMWMSSortingData<RandomAccessIterator>* sd,
+ _DifferenceTp num_samples)
+ {
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef _DifferenceTp difference_type;
+
+ thread_index_t iam = omp_get_thread_num();
+
+ difference_type* es = new difference_type[num_samples + 2];
+
+ equally_split(sd->starts[iam + 1] - sd->starts[iam],
+ num_samples + 1, es);
+
+ for (difference_type i = 0; i < num_samples; ++i)
+ ::new(&(sd->samples[iam * num_samples + i]))
+ value_type(sd->source[sd->starts[iam] + es[i + 1]]);
+
+ delete[] es;
+ }
+
+/** @brief Split consistently. */
+template<bool exact, typename RandomAccessIterator,
+ typename Comparator, typename SortingPlacesIterator>
+ struct split_consistently
+ {
+ };
+
+/** @brief Split by exact splitting. */
+template<typename RandomAccessIterator, typename Comparator,
+ typename SortingPlacesIterator>
+ struct split_consistently
+ <true, RandomAccessIterator, Comparator, SortingPlacesIterator>
+ {
+ void operator()(
+ const thread_index_t iam,
+ PMWMSSortingData<RandomAccessIterator>* sd,
+ Comparator& comp,
+ const typename
+ std::iterator_traits<RandomAccessIterator>::difference_type
+ num_samples)
+ const
+ {
+# pragma omp barrier
+
+ std::vector<std::pair<SortingPlacesIterator, SortingPlacesIterator> >
+ seqs(sd->num_threads);
+ for (thread_index_t s = 0; s < sd->num_threads; s++)
+ seqs[s] = std::make_pair(sd->temporary[s],
+ sd->temporary[s]
+ + (sd->starts[s + 1] - sd->starts[s]));
+
+ std::vector<SortingPlacesIterator> offsets(sd->num_threads);
+
+ // if not last thread
+ if (iam < sd->num_threads - 1)
+ multiseq_partition(seqs.begin(), seqs.end(),
+ sd->starts[iam + 1], offsets.begin(), comp);
+
+ for (int seq = 0; seq < sd->num_threads; seq++)
+ {
+ // for each sequence
+ if (iam < (sd->num_threads - 1))
+ sd->pieces[iam][seq].end = offsets[seq] - seqs[seq].first;
+ else
+ // very end of this sequence
+ sd->pieces[iam][seq].end =
+ sd->starts[seq + 1] - sd->starts[seq];
+ }
+
+# pragma omp barrier
+
+ for (thread_index_t seq = 0; seq < sd->num_threads; seq++)
+ {
+ // For each sequence.
+ if (iam > 0)
+ sd->pieces[iam][seq].begin = sd->pieces[iam - 1][seq].end;
+ else
+ // Absolute beginning.
+ sd->pieces[iam][seq].begin = 0;
+ }
+ }
+ };
+
+/** @brief Split by sampling. */
+template<typename RandomAccessIterator, typename Comparator,
+ typename SortingPlacesIterator>
+ struct split_consistently<false, RandomAccessIterator, Comparator,
+ SortingPlacesIterator>
+ {
+ void operator()(
+ const thread_index_t iam,
+ PMWMSSortingData<RandomAccessIterator>* sd,
+ Comparator& comp,
+ const typename
+ std::iterator_traits<RandomAccessIterator>::difference_type
+ num_samples)
+ const
+ {
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ determine_samples(sd, num_samples);
+
+# pragma omp barrier
+
+# pragma omp single
+ __gnu_sequential::sort(sd->samples,
+ sd->samples + (num_samples * sd->num_threads),
+ comp);
+
+# pragma omp barrier
+
+ for (thread_index_t s = 0; s < sd->num_threads; ++s)
+ {
+ // For each sequence.
+ if (num_samples * iam > 0)
+ sd->pieces[iam][s].begin =
+ std::lower_bound(sd->temporary[s],
+ sd->temporary[s]
+ + (sd->starts[s + 1] - sd->starts[s]),
+ sd->samples[num_samples * iam],
+ comp)
+ - sd->temporary[s];
+ else
+ // Absolute beginning.
+ sd->pieces[iam][s].begin = 0;
+
+ if ((num_samples * (iam + 1)) < (num_samples * sd->num_threads))
+ sd->pieces[iam][s].end =
+ std::lower_bound(sd->temporary[s],
+ sd->temporary[s]
+ + (sd->starts[s + 1] - sd->starts[s]),
+ sd->samples[num_samples * (iam + 1)],
+ comp)
+ - sd->temporary[s];
+ else
+ // Absolute end.
+ sd->pieces[iam][s].end = sd->starts[s + 1] - sd->starts[s];
+ }
+ }
+ };
+
+template<bool stable, typename RandomAccessIterator, typename Comparator>
+ struct possibly_stable_sort
+ {
+ };
+
+template<typename RandomAccessIterator, typename Comparator>
+ struct possibly_stable_sort<true, RandomAccessIterator, Comparator>
+ {
+ void operator()(const RandomAccessIterator& begin,
+ const RandomAccessIterator& end, Comparator& comp) const
+ {
+ __gnu_sequential::stable_sort(begin, end, comp);
+ }
+ };
+
+template<typename RandomAccessIterator, typename Comparator>
+ struct possibly_stable_sort<false, RandomAccessIterator, Comparator>
+ {
+ void operator()(const RandomAccessIterator begin,
+ const RandomAccessIterator end, Comparator& comp) const
+ {
+ __gnu_sequential::sort(begin, end, comp);
+ }
+ };
+
+template<bool stable, typename SeqRandomAccessIterator,
+ typename RandomAccessIterator, typename Comparator,
+ typename DiffType>
+ struct possibly_stable_multiway_merge
+ {
+ };
+
+template<typename SeqRandomAccessIterator, typename RandomAccessIterator,
+ typename Comparator, typename DiffType>
+ struct possibly_stable_multiway_merge
+ <true, SeqRandomAccessIterator, RandomAccessIterator, Comparator,
+ DiffType>
+ {
+ void operator()(const SeqRandomAccessIterator& seqs_begin,
+ const SeqRandomAccessIterator& seqs_end,
+ const RandomAccessIterator& target,
+ Comparator& comp,
+ DiffType length_am) const
+ {
+ stable_multiway_merge(seqs_begin, seqs_end, target, length_am, comp,
+ sequential_tag());
+ }
+ };
+
+template<typename SeqRandomAccessIterator, typename RandomAccessIterator,
+ typename Comparator, typename DiffType>
+ struct possibly_stable_multiway_merge
+ <false, SeqRandomAccessIterator, RandomAccessIterator, Comparator,
+ DiffType>
+ {
+ void operator()(const SeqRandomAccessIterator& seqs_begin,
+ const SeqRandomAccessIterator& seqs_end,
+ const RandomAccessIterator& target,
+ Comparator& comp,
+ DiffType length_am) const
+ {
+ multiway_merge(seqs_begin, seqs_end, target, length_am, comp,
+ sequential_tag());
+ }
+ };
+
+/** @brief PMWMS code executed by each thread.
+ * @param sd Pointer to algorithm data.
+ * @param comp Comparator.
+ */
+template<bool stable, bool exact, typename RandomAccessIterator,
+ typename Comparator>
+ void
+ parallel_sort_mwms_pu(PMWMSSortingData<RandomAccessIterator>* sd,
+ Comparator& comp)
+ {
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ thread_index_t iam = omp_get_thread_num();
+
+ // Length of this thread's chunk, before merging.
+ difference_type length_local = sd->starts[iam + 1] - sd->starts[iam];
+
+ // Sort in temporary storage, leave space for sentinel.
+
+ typedef value_type* SortingPlacesIterator;
+
+ sd->temporary[iam] =
+ static_cast<value_type*>(
+ ::operator new(sizeof(value_type) * (length_local + 1)));
+
+ // Copy there.
+ std::uninitialized_copy(sd->source + sd->starts[iam],
+ sd->source + sd->starts[iam] + length_local,
+ sd->temporary[iam]);
+
+ possibly_stable_sort<stable, SortingPlacesIterator, Comparator>()
+ (sd->temporary[iam], sd->temporary[iam] + length_local, comp);
+
+ // Invariant: locally sorted subsequence in sd->temporary[iam],
+ // sd->temporary[iam] + length_local.
+
+ // No barrier here: Synchronization is done by the splitting routine.
+
+ difference_type num_samples =
+ _Settings::get().sort_mwms_oversampling * sd->num_threads - 1;
+ split_consistently
+ <exact, RandomAccessIterator, Comparator, SortingPlacesIterator>()
+ (iam, sd, comp, num_samples);
+
+ // Offset from target begin, length after merging.
+ difference_type offset = 0, length_am = 0;
+ for (thread_index_t s = 0; s < sd->num_threads; s++)
+ {
+ length_am += sd->pieces[iam][s].end - sd->pieces[iam][s].begin;
+ offset += sd->pieces[iam][s].begin;
+ }
+
+ typedef std::vector<
+ std::pair<SortingPlacesIterator, SortingPlacesIterator> >
+ seq_vector_type;
+ seq_vector_type seqs(sd->num_threads);
+
+ for (int s = 0; s < sd->num_threads; ++s)
+ {
+ seqs[s] =
+ std::make_pair(sd->temporary[s] + sd->pieces[iam][s].begin,
+ sd->temporary[s] + sd->pieces[iam][s].end);
+ }
+
+ possibly_stable_multiway_merge<
+ stable,
+ typename seq_vector_type::iterator,
+ RandomAccessIterator,
+ Comparator, difference_type>()
+ (seqs.begin(), seqs.end(),
+ sd->source + offset, comp,
+ length_am);
+
+# pragma omp barrier
+
+ ::operator delete(sd->temporary[iam]);
+ }
+
+/** @brief PMWMS main call.
+ * @param begin Begin iterator of sequence.
+ * @param end End iterator of sequence.
+ * @param comp Comparator.
+ * @param n Length of sequence.
+ * @param num_threads Number of threads to use.
+ */
+template<bool stable, bool exact, typename RandomAccessIterator,
+ typename Comparator>
+ void
+ parallel_sort_mwms(RandomAccessIterator begin, RandomAccessIterator end,
+ Comparator comp,
+ thread_index_t num_threads)
+ {
+ _GLIBCXX_CALL(end - begin)
+
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ difference_type n = end - begin;
+
+ if (n <= 1)
+ return;
+
+ // at least one element per thread
+ if (num_threads > n)
+ num_threads = static_cast<thread_index_t>(n);
+
+ // shared variables
+ PMWMSSortingData<RandomAccessIterator> sd;
+ difference_type* starts;
+
+# pragma omp parallel num_threads(num_threads)
+ {
+ num_threads = omp_get_num_threads(); //no more threads than requested
+
+# pragma omp single
+ {
+ sd.num_threads = num_threads;
+ sd.source = begin;
+
+ sd.temporary = new value_type*[num_threads];
+
+ if (!exact)
+ {
+ difference_type size =
+ (_Settings::get().sort_mwms_oversampling * num_threads - 1)
+ * num_threads;
+ sd.samples = static_cast<value_type*>(
+ ::operator new(size * sizeof(value_type)));
+ }
+ else
+ sd.samples = NULL;
+
+ sd.offsets = new difference_type[num_threads - 1];
+ sd.pieces = new std::vector<Piece<difference_type> >[num_threads];
+ for (int s = 0; s < num_threads; ++s)
+ sd.pieces[s].resize(num_threads);
+ starts = sd.starts = new difference_type[num_threads + 1];
+
+ difference_type chunk_length = n / num_threads;
+ difference_type split = n % num_threads;
+ difference_type pos = 0;
+ for (int i = 0; i < num_threads; ++i)
+ {
+ starts[i] = pos;
+ pos += (i < split) ? (chunk_length + 1) : chunk_length;
+ }
+ starts[num_threads] = pos;
+ } //single
+
+ // Now sort in parallel.
+ parallel_sort_mwms_pu<stable, exact>(&sd, comp);
+ } //parallel
+
+ delete[] starts;
+ delete[] sd.temporary;
+
+ if (!exact)
+ ::operator delete(sd.samples);
+
+ delete[] sd.offsets;
+ delete[] sd.pieces;
+ }
+} //namespace __gnu_parallel
+
+#endif /* _GLIBCXX_PARALLEL_MULTIWAY_MERGESORT_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/numeric b/i686-linux/include/c++/4.4.3/parallel/numeric
new file mode 100644
index 0000000..33b1411
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/numeric
@@ -0,0 +1,500 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/**
+ * @file parallel/numeric
+*
+ * @brief Parallel STL function calls corresponding to stl_numeric.h.
+ * The functions defined here mainly do case switches and
+ * call the actual parallelized versions in other files.
+ * Inlining policy: Functions that basically only contain one function call,
+ * are declared inline.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler and Felix Putze.
+
+#ifndef _GLIBCXX_PARALLEL_NUMERIC_H
+#define _GLIBCXX_PARALLEL_NUMERIC_H 1
+
+#include <numeric>
+#include <functional>
+#include <parallel/numericfwd.h>
+#include <parallel/iterator.h>
+#include <parallel/for_each.h>
+#include <parallel/for_each_selectors.h>
+#include <parallel/partial_sum.h>
+
+namespace std
+{
+namespace __parallel
+{
+ // Sequential fallback.
+ template<typename InputIterator, typename T>
+ inline T
+ accumulate(InputIterator begin, InputIterator end, T init,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::accumulate(begin, end, init); }
+
+ template<typename InputIterator, typename T, typename BinaryOperation>
+ inline T
+ accumulate(InputIterator begin, InputIterator end, T init,
+ BinaryOperation binary_op, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::accumulate(begin, end, init, binary_op); }
+
+ // Sequential fallback for input iterator case.
+ template<typename InputIterator, typename T, typename IteratorTag>
+ inline T
+ accumulate_switch(InputIterator begin, InputIterator end,
+ T init, IteratorTag)
+ { return accumulate(begin, end, init, __gnu_parallel::sequential_tag()); }
+
+ template<typename InputIterator, typename T, typename BinaryOperation,
+ typename IteratorTag>
+ inline T
+ accumulate_switch(InputIterator begin, InputIterator end, T init,
+ BinaryOperation binary_op, IteratorTag)
+ { return accumulate(begin, end, init, binary_op,
+ __gnu_parallel::sequential_tag()); }
+
+ // Parallel algorithm for random access iterators.
+ template<typename _RandomAccessIterator, typename T,
+ typename BinaryOperation>
+ T
+ accumulate_switch(_RandomAccessIterator begin, _RandomAccessIterator end,
+ T init, BinaryOperation binary_op,
+ random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism_tag
+ = __gnu_parallel::parallel_unbalanced)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end - begin)
+ >= __gnu_parallel::_Settings::get().accumulate_minimal_n
+ && __gnu_parallel::is_parallel(parallelism_tag)))
+ {
+ T res = init;
+ __gnu_parallel::accumulate_selector<_RandomAccessIterator>
+ my_selector;
+ __gnu_parallel::
+ for_each_template_random_access_ed(begin, end,
+ __gnu_parallel::nothing(),
+ my_selector,
+ __gnu_parallel::
+ accumulate_binop_reduct
+ <BinaryOperation>(binary_op),
+ res, res, -1);
+ return res;
+ }
+ else
+ return accumulate(begin, end, init, binary_op,
+ __gnu_parallel::sequential_tag());
+ }
+
+ // Public interface.
+ template<typename InputIterator, typename T>
+ inline T
+ accumulate(InputIterator begin, InputIterator end, T init,
+ __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef std::iterator_traits<InputIterator> iterator_traits;
+ typedef typename iterator_traits::value_type value_type;
+ typedef typename iterator_traits::iterator_category iterator_category;
+
+ return accumulate_switch(begin, end, init,
+ __gnu_parallel::plus<T, value_type>(),
+ iterator_category(), parallelism_tag);
+ }
+
+ template<typename InputIterator, typename T>
+ inline T
+ accumulate(InputIterator begin, InputIterator end, T init)
+ {
+ typedef std::iterator_traits<InputIterator> iterator_traits;
+ typedef typename iterator_traits::value_type value_type;
+ typedef typename iterator_traits::iterator_category iterator_category;
+
+ return accumulate_switch(begin, end, init,
+ __gnu_parallel::plus<T, value_type>(),
+ iterator_category());
+ }
+
+ template<typename InputIterator, typename T, typename BinaryOperation>
+ inline T
+ accumulate(InputIterator begin, InputIterator end, T init,
+ BinaryOperation binary_op,
+ __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef iterator_traits<InputIterator> iterator_traits;
+ typedef typename iterator_traits::iterator_category iterator_category;
+ return accumulate_switch(begin, end, init, binary_op,
+ iterator_category(), parallelism_tag);
+ }
+
+ template<typename InputIterator, typename T, typename BinaryOperation>
+ inline T
+ accumulate(InputIterator begin, InputIterator end, T init,
+ BinaryOperation binary_op)
+ {
+ typedef iterator_traits<InputIterator> iterator_traits;
+ typedef typename iterator_traits::iterator_category iterator_category;
+ return accumulate_switch(begin, end, init, binary_op,
+ iterator_category());
+ }
+
+
+ // Sequential fallback.
+ template<typename InputIterator1, typename InputIterator2, typename T>
+ inline T
+ inner_product(InputIterator1 first1, InputIterator1 last1,
+ InputIterator2 first2, T init,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::inner_product(first1, last1, first2, init); }
+
+ template<typename InputIterator1, typename InputIterator2, typename T,
+ typename BinaryFunction1, typename BinaryFunction2>
+ inline T
+ inner_product(InputIterator1 first1, InputIterator1 last1,
+ InputIterator2 first2, T init, BinaryFunction1 binary_op1,
+ BinaryFunction2 binary_op2, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::inner_product(first1, last1, first2, init,
+ binary_op1, binary_op2); }
+
+ // Parallel algorithm for random access iterators.
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename T, typename BinaryFunction1, typename BinaryFunction2>
+ T
+ inner_product_switch(RandomAccessIterator1 first1,
+ RandomAccessIterator1 last1,
+ RandomAccessIterator2 first2, T init,
+ BinaryFunction1 binary_op1,
+ BinaryFunction2 binary_op2,
+ random_access_iterator_tag,
+ random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism_tag
+ = __gnu_parallel::parallel_unbalanced)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION((last1 - first1)
+ >= __gnu_parallel::_Settings::get().
+ accumulate_minimal_n
+ && __gnu_parallel::
+ is_parallel(parallelism_tag)))
+ {
+ T res = init;
+ __gnu_parallel::
+ inner_product_selector<RandomAccessIterator1,
+ RandomAccessIterator2, T> my_selector(first1, first2);
+ __gnu_parallel::
+ for_each_template_random_access_ed(first1, last1, binary_op2,
+ my_selector, binary_op1,
+ res, res, -1);
+ return res;
+ }
+ else
+ return inner_product(first1, last1, first2, init,
+ __gnu_parallel::sequential_tag());
+ }
+
+ // No parallelism for input iterators.
+ template<typename InputIterator1, typename InputIterator2, typename T,
+ typename BinaryFunction1, typename BinaryFunction2,
+ typename IteratorTag1, typename IteratorTag2>
+ inline T
+ inner_product_switch(InputIterator1 first1, InputIterator1 last1,
+ InputIterator2 first2, T init,
+ BinaryFunction1 binary_op1,
+ BinaryFunction2 binary_op2,
+ IteratorTag1, IteratorTag2)
+ { return inner_product(first1, last1, first2, init,
+ binary_op1, binary_op2,
+ __gnu_parallel::sequential_tag()); }
+
+ template<typename InputIterator1, typename InputIterator2, typename T,
+ typename BinaryFunction1, typename BinaryFunction2>
+ inline T
+ inner_product(InputIterator1 first1, InputIterator1 last1,
+ InputIterator2 first2, T init, BinaryFunction1 binary_op1,
+ BinaryFunction2 binary_op2,
+ __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef iterator_traits<InputIterator1> traits1_type;
+ typedef typename traits1_type::iterator_category iterator1_category;
+
+ typedef iterator_traits<InputIterator2> traits2_type;
+ typedef typename traits2_type::iterator_category iterator2_category;
+
+ return inner_product_switch(first1, last1, first2, init, binary_op1,
+ binary_op2, iterator1_category(),
+ iterator2_category(), parallelism_tag);
+ }
+
+ template<typename InputIterator1, typename InputIterator2, typename T,
+ typename BinaryFunction1, typename BinaryFunction2>
+ inline T
+ inner_product(InputIterator1 first1, InputIterator1 last1,
+ InputIterator2 first2, T init, BinaryFunction1 binary_op1,
+ BinaryFunction2 binary_op2)
+ {
+ typedef iterator_traits<InputIterator1> traits1_type;
+ typedef typename traits1_type::iterator_category iterator1_category;
+
+ typedef iterator_traits<InputIterator2> traits2_type;
+ typedef typename traits2_type::iterator_category iterator2_category;
+
+ return inner_product_switch(first1, last1, first2, init, binary_op1,
+ binary_op2, iterator1_category(),
+ iterator2_category());
+ }
+
+ template<typename InputIterator1, typename InputIterator2, typename T>
+ inline T
+ inner_product(InputIterator1 first1, InputIterator1 last1,
+ InputIterator2 first2, T init,
+ __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef iterator_traits<InputIterator1> traits_type1;
+ typedef typename traits_type1::value_type value_type1;
+ typedef iterator_traits<InputIterator2> traits_type2;
+ typedef typename traits_type2::value_type value_type2;
+
+ typedef typename
+ __gnu_parallel::multiplies<value_type1, value_type2>::result
+ multiplies_result_type;
+ return inner_product(first1, last1, first2, init,
+ __gnu_parallel::plus<T, multiplies_result_type>(),
+ __gnu_parallel::
+ multiplies<value_type1, value_type2>(),
+ parallelism_tag);
+ }
+
+ template<typename InputIterator1, typename InputIterator2, typename T>
+ inline T
+ inner_product(InputIterator1 first1, InputIterator1 last1,
+ InputIterator2 first2, T init)
+ {
+ typedef iterator_traits<InputIterator1> traits_type1;
+ typedef typename traits_type1::value_type value_type1;
+ typedef iterator_traits<InputIterator2> traits_type2;
+ typedef typename traits_type2::value_type value_type2;
+
+ typedef typename
+ __gnu_parallel::multiplies<value_type1, value_type2>::result
+ multiplies_result_type;
+ return inner_product(first1, last1, first2, init,
+ __gnu_parallel::plus<T, multiplies_result_type>(),
+ __gnu_parallel::
+ multiplies<value_type1, value_type2>());
+ }
+
+ // Sequential fallback.
+ template<typename InputIterator, typename OutputIterator>
+ inline OutputIterator
+ partial_sum(InputIterator begin, InputIterator end, OutputIterator result,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::partial_sum(begin, end, result); }
+
+ // Sequential fallback.
+ template<typename InputIterator, typename OutputIterator,
+ typename BinaryOperation>
+ inline OutputIterator
+ partial_sum(InputIterator begin, InputIterator end, OutputIterator result,
+ BinaryOperation bin_op, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::partial_sum(begin, end, result, bin_op); }
+
+ // Sequential fallback for input iterator case.
+ template<typename InputIterator, typename OutputIterator,
+ typename BinaryOperation, typename IteratorTag1,
+ typename IteratorTag2>
+ inline OutputIterator
+ partial_sum_switch(InputIterator begin, InputIterator end,
+ OutputIterator result, BinaryOperation bin_op,
+ IteratorTag1, IteratorTag2)
+ { return _GLIBCXX_STD_P::partial_sum(begin, end, result, bin_op); }
+
+ // Parallel algorithm for random access iterators.
+ template<typename InputIterator, typename OutputIterator,
+ typename BinaryOperation>
+ OutputIterator
+ partial_sum_switch(InputIterator begin, InputIterator end,
+ OutputIterator result, BinaryOperation bin_op,
+ random_access_iterator_tag, random_access_iterator_tag)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end - begin)
+ >= __gnu_parallel::_Settings::get().partial_sum_minimal_n))
+ return __gnu_parallel::parallel_partial_sum(begin, end,
+ result, bin_op);
+ else
+ return partial_sum(begin, end, result, bin_op,
+ __gnu_parallel::sequential_tag());
+ }
+
+ // Public interface.
+ template<typename InputIterator, typename OutputIterator>
+ inline OutputIterator
+ partial_sum(InputIterator begin, InputIterator end, OutputIterator result)
+ {
+ typedef typename iterator_traits<InputIterator>::value_type value_type;
+ return partial_sum(begin, end, result, std::plus<value_type>());
+ }
+
+ // Public interface
+ template<typename InputIterator, typename OutputIterator,
+ typename BinaryOperation>
+ inline OutputIterator
+ partial_sum(InputIterator begin, InputIterator end, OutputIterator result,
+ BinaryOperation binary_op)
+ {
+ typedef iterator_traits<InputIterator> traitsi_type;
+ typedef typename traitsi_type::iterator_category iteratori_category;
+
+ typedef iterator_traits<OutputIterator> traitso_type;
+ typedef typename traitso_type::iterator_category iteratoro_category;
+
+ return partial_sum_switch(begin, end, result, binary_op,
+ iteratori_category(), iteratoro_category());
+ }
+
+ // Sequential fallback.
+ template<typename InputIterator, typename OutputIterator>
+ inline OutputIterator
+ adjacent_difference(InputIterator begin, InputIterator end,
+ OutputIterator result, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::adjacent_difference(begin, end, result); }
+
+ // Sequential fallback.
+ template<typename InputIterator, typename OutputIterator,
+ typename BinaryOperation>
+ inline OutputIterator
+ adjacent_difference(InputIterator begin, InputIterator end,
+ OutputIterator result, BinaryOperation bin_op,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::adjacent_difference(begin, end, result, bin_op); }
+
+ // Sequential fallback for input iterator case.
+ template<typename InputIterator, typename OutputIterator,
+ typename BinaryOperation, typename IteratorTag1,
+ typename IteratorTag2>
+ inline OutputIterator
+ adjacent_difference_switch(InputIterator begin, InputIterator end,
+ OutputIterator result, BinaryOperation bin_op,
+ IteratorTag1, IteratorTag2)
+ { return adjacent_difference(begin, end, result, bin_op,
+ __gnu_parallel::sequential_tag()); }
+
+ // Parallel algorithm for random access iterators.
+ template<typename InputIterator, typename OutputIterator,
+ typename BinaryOperation>
+ OutputIterator
+ adjacent_difference_switch(InputIterator begin, InputIterator end,
+ OutputIterator result, BinaryOperation bin_op,
+ random_access_iterator_tag,
+ random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism_tag
+ = __gnu_parallel::parallel_balanced)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end - begin)
+ >= __gnu_parallel::_Settings::get().adjacent_difference_minimal_n
+ && __gnu_parallel::is_parallel(parallelism_tag)))
+ {
+ bool dummy = true;
+ typedef __gnu_parallel::iterator_pair<InputIterator, OutputIterator,
+ random_access_iterator_tag> ip;
+ *result = *begin;
+ ip begin_pair(begin + 1, result + 1),
+ end_pair(end, result + (end - begin));
+ __gnu_parallel::adjacent_difference_selector<ip> functionality;
+ __gnu_parallel::
+ for_each_template_random_access_ed(begin_pair, end_pair, bin_op,
+ functionality,
+ __gnu_parallel::dummy_reduct(),
+ dummy, dummy, -1);
+ return functionality.finish_iterator;
+ }
+ else
+ return adjacent_difference(begin, end, result, bin_op,
+ __gnu_parallel::sequential_tag());
+ }
+
+ // Public interface.
+ template<typename InputIterator, typename OutputIterator>
+ inline OutputIterator
+ adjacent_difference(InputIterator begin, InputIterator end,
+ OutputIterator result,
+ __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef iterator_traits<InputIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ return adjacent_difference(begin, end, result, std::minus<value_type>(),
+ parallelism_tag);
+ }
+
+ template<typename InputIterator, typename OutputIterator>
+ inline OutputIterator
+ adjacent_difference(InputIterator begin, InputIterator end,
+ OutputIterator result)
+ {
+ typedef iterator_traits<InputIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ return adjacent_difference(begin, end, result, std::minus<value_type>());
+ }
+
+ template<typename InputIterator, typename OutputIterator,
+ typename BinaryOperation>
+ inline OutputIterator
+ adjacent_difference(InputIterator begin, InputIterator end,
+ OutputIterator result, BinaryOperation binary_op,
+ __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef iterator_traits<InputIterator> traitsi_type;
+ typedef typename traitsi_type::iterator_category iteratori_category;
+
+ typedef iterator_traits<OutputIterator> traitso_type;
+ typedef typename traitso_type::iterator_category iteratoro_category;
+
+ return adjacent_difference_switch(begin, end, result, binary_op,
+ iteratori_category(),
+ iteratoro_category(), parallelism_tag);
+ }
+
+ template<typename InputIterator, typename OutputIterator,
+ typename BinaryOperation>
+ inline OutputIterator
+ adjacent_difference(InputIterator begin, InputIterator end,
+ OutputIterator result, BinaryOperation binary_op)
+ {
+ typedef iterator_traits<InputIterator> traitsi_type;
+ typedef typename traitsi_type::iterator_category iteratori_category;
+
+ typedef iterator_traits<OutputIterator> traitso_type;
+ typedef typename traitso_type::iterator_category iteratoro_category;
+
+ return adjacent_difference_switch(begin, end, result, binary_op,
+ iteratori_category(),
+ iteratoro_category());
+ }
+} // end namespace
+} // end namespace
+
+#endif /* _GLIBCXX_NUMERIC_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/numericfwd.h b/i686-linux/include/c++/4.4.3/parallel/numericfwd.h
new file mode 100644
index 0000000..af2d041
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/numericfwd.h
@@ -0,0 +1,203 @@
+// <numeric> parallel extensions -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/numericfwd.h
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_PARALLEL_NUMERICFWD_H
+#define _GLIBCXX_PARALLEL_NUMERICFWD_H 1
+
+#pragma GCC system_header
+
+#include <parallel/tags.h>
+#include <parallel/settings.h>
+
+namespace std
+{
+namespace __parallel
+{
+ template<typename _IIter, typename _Tp>
+ _Tp
+ accumulate(_IIter, _IIter, _Tp);
+
+ template<typename _IIter, typename _Tp>
+ _Tp
+ accumulate(_IIter, _IIter, _Tp, __gnu_parallel::sequential_tag);
+
+ template<typename _IIter, typename _Tp>
+ _Tp
+ accumulate(_IIter, _IIter, _Tp, __gnu_parallel::_Parallelism);
+
+ template<typename _IIter, typename _Tp, typename _Tag>
+ _Tp
+ accumulate_switch(_IIter, _IIter, _Tp, _Tag);
+
+ template<typename _IIter, typename _Tp, typename _BinaryOper>
+ _Tp
+ accumulate(_IIter, _IIter, _Tp, _BinaryOper);
+
+ template<typename _IIter, typename _Tp, typename _BinaryOper>
+ _Tp
+ accumulate(_IIter, _IIter, _Tp, _BinaryOper,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter, typename _Tp, typename _BinaryOper>
+ _Tp
+ accumulate(_IIter, _IIter, _Tp, _BinaryOper,
+ __gnu_parallel::_Parallelism);
+
+ template<typename _IIter, typename _Tp, typename _BinaryOper,
+ typename _Tag>
+ _Tp
+ accumulate_switch(_IIter, _IIter, _Tp, _BinaryOper, _Tag);
+
+ template<typename _RAIter, typename _Tp, typename _BinaryOper>
+ _Tp
+ accumulate_switch(_RAIter, _RAIter, _Tp, _BinaryOper,
+ random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism
+ = __gnu_parallel::parallel_unbalanced);
+
+ template<typename _IIter, typename _OIter>
+ _OIter
+ adjacent_difference(_IIter, _IIter, _OIter);
+
+ template<typename _IIter, typename _OIter, typename _BinaryOper>
+ _OIter
+ adjacent_difference(_IIter, _IIter, _OIter, _BinaryOper);
+
+ template<typename _IIter, typename _OIter>
+ _OIter
+ adjacent_difference(_IIter, _IIter, _OIter,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter, typename _OIter, typename _BinaryOper>
+ _OIter
+ adjacent_difference(_IIter, _IIter, _OIter, _BinaryOper,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter, typename _OIter>
+ _OIter
+ adjacent_difference(_IIter, _IIter, _OIter,
+ __gnu_parallel::_Parallelism);
+
+ template<typename _IIter, typename _OIter, typename _BinaryOper>
+ _OIter
+ adjacent_difference(_IIter, _IIter, _OIter, _BinaryOper,
+ __gnu_parallel::_Parallelism);
+
+ template<typename _IIter, typename _OIter, typename _BinaryOper,
+ typename _Tag1, typename _Tag2>
+ _OIter
+ adjacent_difference_switch(_IIter, _IIter, _OIter, _BinaryOper,
+ _Tag1, _Tag2);
+
+ template<typename _IIter, typename _OIter, typename _BinaryOper>
+ _OIter
+ adjacent_difference_switch(_IIter, _IIter, _OIter, _BinaryOper,
+ random_access_iterator_tag,
+ random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism
+ = __gnu_parallel::parallel_unbalanced);
+
+ template<typename _IIter1, typename _IIter2, typename _Tp>
+ _Tp
+ inner_product(_IIter1, _IIter1, _IIter2, _Tp);
+
+ template<typename _IIter1, typename _IIter2, typename _Tp>
+ _Tp
+ inner_product(_IIter1, _IIter1, _IIter2, _Tp,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2, typename _Tp>
+ _Tp
+ inner_product(_IIter1, _IIter1, _IIter2, _Tp,
+ __gnu_parallel::_Parallelism);
+
+ template<typename _IIter1, typename _IIter2, typename _Tp,
+ typename _BinaryFunction1, typename _BinaryFunction2>
+ _Tp
+ inner_product(_IIter1, _IIter1, _IIter2, _Tp,
+ _BinaryFunction1, _BinaryFunction2);
+
+ template<typename _IIter1, typename _IIter2, typename _Tp,
+ typename _BinaryFunction1, typename _BinaryFunction2>
+ _Tp
+ inner_product(_IIter1, _IIter1, _IIter2, _Tp, _BinaryFunction1,
+ _BinaryFunction2, __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2, typename _Tp,
+ typename BinaryFunction1, typename BinaryFunction2>
+ _Tp
+ inner_product(_IIter1, _IIter1, _IIter2, _Tp, BinaryFunction1,
+ BinaryFunction2, __gnu_parallel::_Parallelism);
+
+ template<typename _RAIter1, typename _RAIter2, typename _Tp,
+ typename BinaryFunction1, typename BinaryFunction2>
+ _Tp
+ inner_product_switch(_RAIter1, _RAIter1, _RAIter2, _Tp, BinaryFunction1,
+ BinaryFunction2, random_access_iterator_tag,
+ random_access_iterator_tag,
+ __gnu_parallel::_Parallelism
+ = __gnu_parallel::parallel_unbalanced);
+
+ template<typename _IIter1, typename _IIter2, typename _Tp,
+ typename _BinaryFunction1, typename _BinaryFunction2,
+ typename _Tag1, typename _Tag2>
+ _Tp
+ inner_product_switch(_IIter1, _IIter1, _IIter2, _Tp, _BinaryFunction1,
+ _BinaryFunction2, _Tag1, _Tag2);
+
+
+ template<typename _IIter, typename _OIter>
+ _OIter
+ partial_sum(_IIter, _IIter, _OIter, __gnu_parallel::sequential_tag);
+
+ template<typename _IIter, typename _OIter, typename _BinaryOper>
+ _OIter
+ partial_sum(_IIter, _IIter, _OIter, _BinaryOper,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter, typename _OIter>
+ _OIter
+ partial_sum(_IIter, _IIter, _OIter result);
+
+ template<typename _IIter, typename _OIter, typename _BinaryOper>
+ _OIter
+ partial_sum(_IIter, _IIter, _OIter, _BinaryOper);
+
+ template<typename _IIter, typename _OIter, typename _BinaryOper,
+ typename _Tag1, typename _Tag2>
+ _OIter
+ partial_sum_switch(_IIter, _IIter, _OIter, _BinaryOper, _Tag1, _Tag2);
+
+ template<typename _IIter, typename _OIter, typename _BinaryOper>
+ _OIter
+ partial_sum_switch(_IIter, _IIter, _OIter, _BinaryOper,
+ random_access_iterator_tag, random_access_iterator_tag);
+} // end namespace
+} // end namespace
+
+#endif /* _GLIBCXX_PARALLEL_NUMERICFWD_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/omp_loop.h b/i686-linux/include/c++/4.4.3/parallel/omp_loop.h
new file mode 100644
index 0000000..66f6d44
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/omp_loop.h
@@ -0,0 +1,118 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/omp_loop.h
+ * @brief Parallelization of embarrassingly parallel execution by
+ * means of an OpenMP for loop.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Felix Putze.
+
+#ifndef _GLIBCXX_PARALLEL_OMP_LOOP_H
+#define _GLIBCXX_PARALLEL_OMP_LOOP_H 1
+
+#include <omp.h>
+
+#include <parallel/settings.h>
+#include <parallel/basic_iterator.h>
+#include <parallel/base.h>
+
+namespace __gnu_parallel
+{
+/** @brief Embarrassingly parallel algorithm for random access
+ * iterators, using an OpenMP for loop.
+ *
+ * @param begin Begin iterator of element sequence.
+ * @param end End iterator of element sequence.
+ * @param o User-supplied functor (comparator, predicate, adding
+ * functor, etc.).
+ * @param f Functor to "process" an element with op (depends on
+ * desired functionality, e. g. for std::for_each(), ...).
+ * @param r Functor to "add" a single result to the already
+ * processed elements (depends on functionality).
+ * @param base Base value for reduction.
+ * @param output Pointer to position where final result is written to
+ * @param bound Maximum number of elements processed (e. g. for
+ * std::count_n()).
+ * @return User-supplied functor (that may contain a part of the result).
+ */
+template<typename RandomAccessIterator,
+ typename Op,
+ typename Fu,
+ typename Red,
+ typename Result>
+ Op
+ for_each_template_random_access_omp_loop(RandomAccessIterator begin,
+ RandomAccessIterator end,
+ Op o, Fu& f, Red r, Result base,
+ Result& output,
+ typename std::iterator_traits
+ <RandomAccessIterator>::
+ difference_type bound)
+ {
+ typedef typename
+ std::iterator_traits<RandomAccessIterator>::difference_type
+ difference_type;
+
+ difference_type length = end - begin;
+ thread_index_t num_threads =
+ __gnu_parallel::min<difference_type>(get_max_threads(), length);
+
+ Result *thread_results;
+
+# pragma omp parallel num_threads(num_threads)
+ {
+# pragma omp single
+ {
+ num_threads = omp_get_num_threads();
+ thread_results = new Result[num_threads];
+
+ for (thread_index_t i = 0; i < num_threads; ++i)
+ thread_results[i] = Result();
+ }
+
+ thread_index_t iam = omp_get_thread_num();
+
+# pragma omp for schedule(dynamic, _Settings::get().workstealing_chunk_size)
+ for (difference_type pos = 0; pos < length; ++pos)
+ thread_results[iam] =
+ r(thread_results[iam], f(o, begin+pos));
+ } //parallel
+
+ for (thread_index_t i = 0; i < num_threads; ++i)
+ output = r(output, thread_results[i]);
+
+ delete [] thread_results;
+
+ // Points to last element processed (needed as return value for
+ // some algorithms like transform).
+ f.finish_iterator = begin + length;
+
+ return o;
+ }
+
+} // end namespace
+
+#endif /* _GLIBCXX_PARALLEL_OMP_LOOP_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/omp_loop_static.h b/i686-linux/include/c++/4.4.3/parallel/omp_loop_static.h
new file mode 100644
index 0000000..5236183
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/omp_loop_static.h
@@ -0,0 +1,117 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/omp_loop_static.h
+ * @brief Parallelization of embarrassingly parallel execution by
+ * means of an OpenMP for loop with static scheduling.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Felix Putze.
+
+#ifndef _GLIBCXX_PARALLEL_OMP_LOOP_STATIC_H
+#define _GLIBCXX_PARALLEL_OMP_LOOP_STATIC_H 1
+
+#include <omp.h>
+
+#include <parallel/settings.h>
+#include <parallel/basic_iterator.h>
+
+namespace __gnu_parallel
+{
+
+ /** @brief Embarrassingly parallel algorithm for random access
+ * iterators, using an OpenMP for loop with static scheduling.
+ *
+ * @param begin Begin iterator of element sequence.
+ * @param end End iterator of element sequence.
+ * @param o User-supplied functor (comparator, predicate, adding
+ * functor, ...).
+ * @param f Functor to "process" an element with op (depends on
+ * desired functionality, e. g. for std::for_each(), ...).
+ * @param r Functor to "add" a single result to the already processed
+ * elements (depends on functionality).
+ * @param base Base value for reduction.
+ * @param output Pointer to position where final result is written to
+ * @param bound Maximum number of elements processed (e. g. for
+ * std::count_n()).
+ * @return User-supplied functor (that may contain a part of the result).
+ */
+template<typename RandomAccessIterator,
+ typename Op,
+ typename Fu,
+ typename Red,
+ typename Result>
+ Op
+ for_each_template_random_access_omp_loop_static(RandomAccessIterator begin,
+ RandomAccessIterator end,
+ Op o, Fu& f, Red r,
+ Result base, Result& output,
+ typename std::iterator_traits
+ <RandomAccessIterator>::
+ difference_type bound)
+ {
+ typedef typename
+ std::iterator_traits<RandomAccessIterator>::difference_type
+ difference_type;
+
+ difference_type length = end - begin;
+ thread_index_t num_threads =
+ std::min<difference_type>(get_max_threads(), length);
+
+ Result *thread_results;
+
+# pragma omp parallel num_threads(num_threads)
+ {
+# pragma omp single
+ {
+ num_threads = omp_get_num_threads();
+ thread_results = new Result[num_threads];
+
+ for (thread_index_t i = 0; i < num_threads; ++i)
+ thread_results[i] = Result();
+ }
+
+ thread_index_t iam = omp_get_thread_num();
+
+# pragma omp for schedule(static, _Settings::get().workstealing_chunk_size)
+ for (difference_type pos = 0; pos < length; ++pos)
+ thread_results[iam] = r(thread_results[iam], f(o, begin+pos));
+ } //parallel
+
+ for (thread_index_t i = 0; i < num_threads; ++i)
+ output = r(output, thread_results[i]);
+
+ delete [] thread_results;
+
+ // Points to last element processed (needed as return value for
+ // some algorithms like transform).
+ f.finish_iterator = begin + length;
+
+ return o;
+ }
+
+} // end namespace
+
+#endif /* _GLIBCXX_PARALLEL_OMP_LOOP_STATIC_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/par_loop.h b/i686-linux/include/c++/4.4.3/parallel/par_loop.h
new file mode 100644
index 0000000..be61d4c
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/par_loop.h
@@ -0,0 +1,135 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/par_loop.h
+ * @brief Parallelization of embarrassingly parallel execution by
+ * means of equal splitting.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Felix Putze.
+
+#ifndef _GLIBCXX_PARALLEL_PAR_LOOP_H
+#define _GLIBCXX_PARALLEL_PAR_LOOP_H 1
+
+#include <omp.h>
+#include <parallel/settings.h>
+#include <parallel/base.h>
+#include <parallel/equally_split.h>
+
+namespace __gnu_parallel
+{
+
+/** @brief Embarrassingly parallel algorithm for random access
+ * iterators, using hand-crafted parallelization by equal splitting
+ * the work.
+ *
+ * @param begin Begin iterator of element sequence.
+ * @param end End iterator of element sequence.
+ * @param o User-supplied functor (comparator, predicate, adding
+ * functor, ...)
+ * @param f Functor to "process" an element with op (depends on
+ * desired functionality, e. g. for std::for_each(), ...).
+ * @param r Functor to "add" a single result to the already
+ * processed elements (depends on functionality).
+ * @param base Base value for reduction.
+ * @param output Pointer to position where final result is written to
+ * @param bound Maximum number of elements processed (e. g. for
+ * std::count_n()).
+ * @return User-supplied functor (that may contain a part of the result).
+ */
+template<typename RandomAccessIterator,
+ typename Op,
+ typename Fu,
+ typename Red,
+ typename Result>
+ Op
+ for_each_template_random_access_ed(RandomAccessIterator begin,
+ RandomAccessIterator end,
+ Op o, Fu& f, Red r, Result base,
+ Result& output,
+ typename std::iterator_traits
+ <RandomAccessIterator>::
+ difference_type bound)
+ {
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::difference_type difference_type;
+ const difference_type length = end - begin;
+ Result *thread_results;
+ bool* constructed;
+
+ thread_index_t num_threads =
+ __gnu_parallel::min<difference_type>(get_max_threads(), length);
+
+# pragma omp parallel num_threads(num_threads)
+ {
+# pragma omp single
+ {
+ num_threads = omp_get_num_threads();
+ thread_results = static_cast<Result*>(
+ ::operator new(num_threads * sizeof(Result)));
+ constructed = new bool[num_threads];
+ }
+
+ thread_index_t iam = omp_get_thread_num();
+
+ // Neutral element.
+ Result* reduct = static_cast<Result*>(::operator new(sizeof(Result)));
+
+ difference_type
+ start = equally_split_point(length, num_threads, iam),
+ stop = equally_split_point(length, num_threads, iam + 1);
+
+ if (start < stop)
+ {
+ new(reduct) Result(f(o, begin + start));
+ ++start;
+ constructed[iam] = true;
+ }
+ else
+ constructed[iam] = false;
+
+ for (; start < stop; ++start)
+ *reduct = r(*reduct, f(o, begin + start));
+
+ thread_results[iam] = *reduct;
+ } //parallel
+
+ for (thread_index_t i = 0; i < num_threads; ++i)
+ if (constructed[i])
+ output = r(output, thread_results[i]);
+
+ // Points to last element processed (needed as return value for
+ // some algorithms like transform).
+ f.finish_iterator = begin + length;
+
+ delete[] thread_results;
+ delete[] constructed;
+
+ return o;
+ }
+
+} // end namespace
+
+#endif /* _GLIBCXX_PARALLEL_PAR_LOOP_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/parallel.h b/i686-linux/include/c++/4.4.3/parallel/parallel.h
new file mode 100644
index 0000000..c4bfc05
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/parallel.h
@@ -0,0 +1,42 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/parallel.h
+ * @brief End-user include file. Provides advanced settings and
+ * tuning options.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Felix Putze and Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_PARALLEL_H
+#define _GLIBCXX_PARALLEL_PARALLEL_H 1
+
+#include <parallel/features.h>
+#include <parallel/compiletime_settings.h>
+#include <parallel/types.h>
+#include <parallel/tags.h>
+#include <parallel/settings.h>
+
+#endif /* _GLIBCXX_PARALLEL_PARALLEL_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/partial_sum.h b/i686-linux/include/c++/4.4.3/parallel/partial_sum.h
new file mode 100644
index 0000000..9263093
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/partial_sum.h
@@ -0,0 +1,220 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/partial_sum.h
+ * @brief Parallel implementation of std::partial_sum(), i. e. prefix
+ * sums.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_PARTIAL_SUM_H
+#define _GLIBCXX_PARALLEL_PARTIAL_SUM_H 1
+
+#include <omp.h>
+#include <new>
+#include <bits/stl_algobase.h>
+#include <parallel/parallel.h>
+#include <parallel/numericfwd.h>
+
+namespace __gnu_parallel
+{
+ // Problem: there is no 0-element given.
+
+/** @brief Base case prefix sum routine.
+ * @param begin Begin iterator of input sequence.
+ * @param end End iterator of input sequence.
+ * @param result Begin iterator of output sequence.
+ * @param bin_op Associative binary function.
+ * @param value Start value. Must be passed since the neutral
+ * element is unknown in general.
+ * @return End iterator of output sequence. */
+template<typename InputIterator,
+ typename OutputIterator,
+ typename BinaryOperation>
+ OutputIterator
+ parallel_partial_sum_basecase(InputIterator begin, InputIterator end,
+ OutputIterator result, BinaryOperation bin_op,
+ typename std::iterator_traits
+ <InputIterator>::value_type value)
+ {
+ if (begin == end)
+ return result;
+
+ while (begin != end)
+ {
+ value = bin_op(value, *begin);
+ *result = value;
+ ++result;
+ ++begin;
+ }
+ return result;
+ }
+
+/** @brief Parallel partial sum implementation, two-phase approach,
+ no recursion.
+ * @param begin Begin iterator of input sequence.
+ * @param end End iterator of input sequence.
+ * @param result Begin iterator of output sequence.
+ * @param bin_op Associative binary function.
+ * @param n Length of sequence.
+ * @param num_threads Number of threads to use.
+ * @return End iterator of output sequence.
+ */
+template<typename InputIterator,
+ typename OutputIterator,
+ typename BinaryOperation>
+ OutputIterator
+ parallel_partial_sum_linear(InputIterator begin, InputIterator end,
+ OutputIterator result, BinaryOperation bin_op,
+ typename std::iterator_traits
+ <InputIterator>::difference_type n)
+ {
+ typedef std::iterator_traits<InputIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ if (begin == end)
+ return result;
+
+ thread_index_t num_threads =
+ std::min<difference_type>(get_max_threads(), n - 1);
+
+ if (num_threads < 2)
+ {
+ *result = *begin;
+ return parallel_partial_sum_basecase(
+ begin + 1, end, result + 1, bin_op, *begin);
+ }
+
+ difference_type* borders;
+ value_type* sums;
+
+ const _Settings& __s = _Settings::get();
+
+# pragma omp parallel num_threads(num_threads)
+ {
+# pragma omp single
+ {
+ num_threads = omp_get_num_threads();
+
+ borders = new difference_type[num_threads + 2];
+
+ if (__s.partial_sum_dilation == 1.0f)
+ equally_split(n, num_threads + 1, borders);
+ else
+ {
+ difference_type chunk_length =
+ ((double)n
+ / ((double)num_threads + __s.partial_sum_dilation)),
+ borderstart = n - num_threads * chunk_length;
+ borders[0] = 0;
+ for (int i = 1; i < (num_threads + 1); ++i)
+ {
+ borders[i] = borderstart;
+ borderstart += chunk_length;
+ }
+ borders[num_threads + 1] = n;
+ }
+
+ sums = static_cast<value_type*>(::operator new(sizeof(value_type)
+ * num_threads));
+ OutputIterator target_end;
+ } //single
+
+ thread_index_t iam = omp_get_thread_num();
+ if (iam == 0)
+ {
+ *result = *begin;
+ parallel_partial_sum_basecase(begin + 1, begin + borders[1],
+ result + 1, bin_op, *begin);
+ ::new(&(sums[iam])) value_type(*(result + borders[1] - 1));
+ }
+ else
+ {
+ ::new(&(sums[iam]))
+ value_type(std::accumulate(begin + borders[iam] + 1,
+ begin + borders[iam + 1],
+ *(begin + borders[iam]),
+ bin_op,
+ __gnu_parallel::sequential_tag()));
+ }
+
+# pragma omp barrier
+
+# pragma omp single
+ parallel_partial_sum_basecase(
+ sums + 1, sums + num_threads, sums + 1, bin_op, sums[0]);
+
+# pragma omp barrier
+
+ // Still same team.
+ parallel_partial_sum_basecase(begin + borders[iam + 1],
+ begin + borders[iam + 2],
+ result + borders[iam + 1], bin_op,
+ sums[iam]);
+ } //parallel
+
+ ::operator delete(sums);
+ delete[] borders;
+
+ return result + n;
+ }
+
+/** @brief Parallel partial sum front-end.
+ * @param begin Begin iterator of input sequence.
+ * @param end End iterator of input sequence.
+ * @param result Begin iterator of output sequence.
+ * @param bin_op Associative binary function.
+ * @return End iterator of output sequence. */
+template<typename InputIterator,
+ typename OutputIterator,
+ typename BinaryOperation>
+ OutputIterator
+ parallel_partial_sum(InputIterator begin, InputIterator end,
+ OutputIterator result, BinaryOperation bin_op)
+ {
+ _GLIBCXX_CALL(begin - end)
+
+ typedef std::iterator_traits<InputIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ difference_type n = end - begin;
+
+ switch (_Settings::get().partial_sum_algorithm)
+ {
+ case LINEAR:
+ // Need an initial offset.
+ return parallel_partial_sum_linear(begin, end, result, bin_op, n);
+ default:
+ // Partial_sum algorithm not implemented.
+ _GLIBCXX_PARALLEL_ASSERT(0);
+ return result + n;
+ }
+ }
+}
+
+#endif /* _GLIBCXX_PARALLEL_PARTIAL_SUM_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/partition.h b/i686-linux/include/c++/4.4.3/parallel/partition.h
new file mode 100644
index 0000000..bc31347
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/partition.h
@@ -0,0 +1,430 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/partition.h
+ * @brief Parallel implementation of std::partition(),
+ * std::nth_element(), and std::partial_sort().
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler and Felix Putze.
+
+#ifndef _GLIBCXX_PARALLEL_PARTITION_H
+#define _GLIBCXX_PARALLEL_PARTITION_H 1
+
+#include <parallel/basic_iterator.h>
+#include <parallel/sort.h>
+#include <parallel/random_number.h>
+#include <bits/stl_algo.h>
+#include <parallel/parallel.h>
+
+/** @brief Decide whether to declare certain variables volatile. */
+#define _GLIBCXX_VOLATILE volatile
+
+namespace __gnu_parallel
+{
+/** @brief Parallel implementation of std::partition.
+ * @param begin Begin iterator of input sequence to split.
+ * @param end End iterator of input sequence to split.
+ * @param pred Partition predicate, possibly including some kind of pivot.
+ * @param num_threads Maximum number of threads to use for this task.
+ * @return Number of elements not fulfilling the predicate. */
+template<typename RandomAccessIterator, typename Predicate>
+ typename std::iterator_traits<RandomAccessIterator>::difference_type
+ parallel_partition(RandomAccessIterator begin, RandomAccessIterator end,
+ Predicate pred, thread_index_t num_threads)
+ {
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ difference_type n = end - begin;
+
+ _GLIBCXX_CALL(n)
+
+ const _Settings& __s = _Settings::get();
+
+ // Shared.
+ _GLIBCXX_VOLATILE difference_type left = 0, right = n - 1;
+ _GLIBCXX_VOLATILE difference_type leftover_left, leftover_right;
+ _GLIBCXX_VOLATILE difference_type leftnew, rightnew;
+
+ bool* reserved_left = NULL, * reserved_right = NULL;
+
+ difference_type chunk_size = __s.partition_chunk_size;
+
+ omp_lock_t result_lock;
+ omp_init_lock(&result_lock);
+
+ //at least two chunks per thread
+ if(right - left + 1 >= 2 * num_threads * chunk_size)
+# pragma omp parallel num_threads(num_threads)
+ {
+# pragma omp single
+ {
+ num_threads = omp_get_num_threads();
+ reserved_left = new bool[num_threads];
+ reserved_right = new bool[num_threads];
+
+ if (__s.partition_chunk_share > 0.0)
+ chunk_size = std::max<difference_type>(__s.partition_chunk_size,
+ (double)n * __s.partition_chunk_share
+ / (double)num_threads);
+ else
+ chunk_size = __s.partition_chunk_size;
+ }
+
+ while (right - left + 1 >= 2 * num_threads * chunk_size)
+ {
+# pragma omp single
+ {
+ difference_type num_chunks = (right - left + 1) / chunk_size;
+
+ for (int r = 0; r < num_threads; ++r)
+ {
+ reserved_left[r] = false;
+ reserved_right[r] = false;
+ }
+ leftover_left = 0;
+ leftover_right = 0;
+ } //implicit barrier
+
+ // Private.
+ difference_type thread_left, thread_left_border,
+ thread_right, thread_right_border;
+ thread_left = left + 1;
+
+ // Just to satisfy the condition below.
+ thread_left_border = thread_left - 1;
+ thread_right = n - 1;
+ thread_right_border = thread_right + 1;
+
+ bool iam_finished = false;
+ while (!iam_finished)
+ {
+ if (thread_left > thread_left_border)
+ {
+ omp_set_lock(&result_lock);
+ if (left + (chunk_size - 1) > right)
+ iam_finished = true;
+ else
+ {
+ thread_left = left;
+ thread_left_border = left + (chunk_size - 1);
+ left += chunk_size;
+ }
+ omp_unset_lock(&result_lock);
+ }
+
+ if (thread_right < thread_right_border)
+ {
+ omp_set_lock(&result_lock);
+ if (left > right - (chunk_size - 1))
+ iam_finished = true;
+ else
+ {
+ thread_right = right;
+ thread_right_border = right - (chunk_size - 1);
+ right -= chunk_size;
+ }
+ omp_unset_lock(&result_lock);
+ }
+
+ if (iam_finished)
+ break;
+
+ // Swap as usual.
+ while (thread_left < thread_right)
+ {
+ while (pred(begin[thread_left])
+ && thread_left <= thread_left_border)
+ ++thread_left;
+ while (!pred(begin[thread_right])
+ && thread_right >= thread_right_border)
+ --thread_right;
+
+ if (thread_left > thread_left_border
+ || thread_right < thread_right_border)
+ // Fetch new chunk(s).
+ break;
+
+ std::swap(begin[thread_left], begin[thread_right]);
+ ++thread_left;
+ --thread_right;
+ }
+ }
+
+ // Now swap the leftover chunks to the right places.
+ if (thread_left <= thread_left_border)
+# pragma omp atomic
+ ++leftover_left;
+ if (thread_right >= thread_right_border)
+# pragma omp atomic
+ ++leftover_right;
+
+# pragma omp barrier
+
+# pragma omp single
+ {
+ leftnew = left - leftover_left * chunk_size;
+ rightnew = right + leftover_right * chunk_size;
+ }
+
+# pragma omp barrier
+
+ // <=> thread_left_border + (chunk_size - 1) >= leftnew
+ if (thread_left <= thread_left_border
+ && thread_left_border >= leftnew)
+ {
+ // Chunk already in place, reserve spot.
+ reserved_left[(left - (thread_left_border + 1)) / chunk_size]
+ = true;
+ }
+
+ // <=> thread_right_border - (chunk_size - 1) <= rightnew
+ if (thread_right >= thread_right_border
+ && thread_right_border <= rightnew)
+ {
+ // Chunk already in place, reserve spot.
+ reserved_right[((thread_right_border - 1) - right)
+ / chunk_size] = true;
+ }
+
+# pragma omp barrier
+
+ if (thread_left <= thread_left_border
+ && thread_left_border < leftnew)
+ {
+ // Find spot and swap.
+ difference_type swapstart = -1;
+ omp_set_lock(&result_lock);
+ for (int r = 0; r < leftover_left; ++r)
+ if (!reserved_left[r])
+ {
+ reserved_left[r] = true;
+ swapstart = left - (r + 1) * chunk_size;
+ break;
+ }
+ omp_unset_lock(&result_lock);
+
+#if _GLIBCXX_ASSERTIONS
+ _GLIBCXX_PARALLEL_ASSERT(swapstart != -1);
+#endif
+
+ std::swap_ranges(begin + thread_left_border
+ - (chunk_size - 1),
+ begin + thread_left_border + 1,
+ begin + swapstart);
+ }
+
+ if (thread_right >= thread_right_border
+ && thread_right_border > rightnew)
+ {
+ // Find spot and swap
+ difference_type swapstart = -1;
+ omp_set_lock(&result_lock);
+ for (int r = 0; r < leftover_right; ++r)
+ if (!reserved_right[r])
+ {
+ reserved_right[r] = true;
+ swapstart = right + r * chunk_size + 1;
+ break;
+ }
+ omp_unset_lock(&result_lock);
+
+#if _GLIBCXX_ASSERTIONS
+ _GLIBCXX_PARALLEL_ASSERT(swapstart != -1);
+#endif
+
+ std::swap_ranges(begin + thread_right_border,
+ begin + thread_right_border + chunk_size,
+ begin + swapstart);
+ }
+#if _GLIBCXX_ASSERTIONS
+# pragma omp barrier
+
+# pragma omp single
+ {
+ for (int r = 0; r < leftover_left; ++r)
+ _GLIBCXX_PARALLEL_ASSERT(reserved_left[r]);
+ for (int r = 0; r < leftover_right; ++r)
+ _GLIBCXX_PARALLEL_ASSERT(reserved_right[r]);
+ }
+
+# pragma omp barrier
+#endif
+
+# pragma omp barrier
+
+ left = leftnew;
+ right = rightnew;
+ }
+# pragma omp flush(left, right)
+ } // end "recursion" //parallel
+
+ difference_type final_left = left, final_right = right;
+
+ while (final_left < final_right)
+ {
+ // Go right until key is geq than pivot.
+ while (pred(begin[final_left]) && final_left < final_right)
+ ++final_left;
+
+ // Go left until key is less than pivot.
+ while (!pred(begin[final_right]) && final_left < final_right)
+ --final_right;
+
+ if (final_left == final_right)
+ break;
+ std::swap(begin[final_left], begin[final_right]);
+ ++final_left;
+ --final_right;
+ }
+
+ // All elements on the left side are < piv, all elements on the
+ // right are >= piv
+ delete[] reserved_left;
+ delete[] reserved_right;
+
+ omp_destroy_lock(&result_lock);
+
+ // Element "between" final_left and final_right might not have
+ // been regarded yet
+ if (final_left < n && !pred(begin[final_left]))
+ // Really swapped.
+ return final_left;
+ else
+ return final_left + 1;
+ }
+
+/**
+ * @brief Parallel implementation of std::nth_element().
+ * @param begin Begin iterator of input sequence.
+ * @param nth Iterator of element that must be in position afterwards.
+ * @param end End iterator of input sequence.
+ * @param comp Comparator.
+ */
+template<typename RandomAccessIterator, typename Comparator>
+ void
+ parallel_nth_element(RandomAccessIterator begin, RandomAccessIterator nth,
+ RandomAccessIterator end, Comparator comp)
+ {
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ _GLIBCXX_CALL(end - begin)
+
+ RandomAccessIterator split;
+ random_number rng;
+
+ const _Settings& __s = _Settings::get();
+ difference_type minimum_length = std::max<difference_type>(2,
+ std::max(__s.nth_element_minimal_n, __s.partition_minimal_n));
+
+ // Break if input range to small.
+ while (static_cast<sequence_index_t>(end - begin) >= minimum_length)
+ {
+ difference_type n = end - begin;
+
+ RandomAccessIterator pivot_pos = begin + rng(n);
+
+ // Swap pivot_pos value to end.
+ if (pivot_pos != (end - 1))
+ std::swap(*pivot_pos, *(end - 1));
+ pivot_pos = end - 1;
+
+ // XXX Comparator must have first_value_type, second_value_type,
+ // result_type
+ // Comparator == __gnu_parallel::lexicographic<S, int,
+ // __gnu_parallel::less<S, S> >
+ // pivot_pos == std::pair<S, int>*
+ // XXX binder2nd only for RandomAccessIterators??
+ __gnu_parallel::binder2nd<Comparator, value_type, value_type, bool>
+ pred(comp, *pivot_pos);
+
+ // Divide, leave pivot unchanged in last place.
+ RandomAccessIterator split_pos1, split_pos2;
+ split_pos1 = begin + parallel_partition(begin, end - 1, pred,
+ get_max_threads());
+
+ // Left side: < pivot_pos; right side: >= pivot_pos
+
+ // Swap pivot back to middle.
+ if (split_pos1 != pivot_pos)
+ std::swap(*split_pos1, *pivot_pos);
+ pivot_pos = split_pos1;
+
+ // In case all elements are equal, split_pos1 == 0
+ if ((split_pos1 + 1 - begin) < (n >> 7)
+ || (end - split_pos1) < (n >> 7))
+ {
+ // Very unequal split, one part smaller than one 128th
+ // elements not strictly larger than the pivot.
+ __gnu_parallel::unary_negate<__gnu_parallel::
+ binder1st<Comparator, value_type, value_type, bool>, value_type>
+ pred(__gnu_parallel::binder1st<Comparator, value_type,
+ value_type, bool>(comp, *pivot_pos));
+
+ // Find other end of pivot-equal range.
+ split_pos2 = __gnu_sequential::partition(split_pos1 + 1,
+ end, pred);
+ }
+ else
+ // Only skip the pivot.
+ split_pos2 = split_pos1 + 1;
+
+ // Compare iterators.
+ if (split_pos2 <= nth)
+ begin = split_pos2;
+ else if (nth < split_pos1)
+ end = split_pos1;
+ else
+ break;
+ }
+
+ // Only at most _Settings::partition_minimal_n elements left.
+ __gnu_sequential::nth_element(begin, nth, end, comp);
+ }
+
+/** @brief Parallel implementation of std::partial_sort().
+* @param begin Begin iterator of input sequence.
+* @param middle Sort until this position.
+* @param end End iterator of input sequence.
+* @param comp Comparator. */
+template<typename RandomAccessIterator, typename Comparator>
+ void
+ parallel_partial_sort(RandomAccessIterator begin,
+ RandomAccessIterator middle,
+ RandomAccessIterator end, Comparator comp)
+ {
+ parallel_nth_element(begin, middle, end, comp);
+ std::sort(begin, middle, comp);
+ }
+
+} //namespace __gnu_parallel
+
+#undef _GLIBCXX_VOLATILE
+
+#endif /* _GLIBCXX_PARALLEL_PARTITION_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/queue.h b/i686-linux/include/c++/4.4.3/parallel/queue.h
new file mode 100644
index 0000000..9686a9a
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/queue.h
@@ -0,0 +1,149 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/queue.h
+ * @brief Lock-free double-ended queue.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_QUEUE_H
+#define _GLIBCXX_PARALLEL_QUEUE_H 1
+
+#include <parallel/types.h>
+#include <parallel/base.h>
+#include <parallel/compatibility.h>
+
+/** @brief Decide whether to declare certain variable volatile in this file. */
+#define _GLIBCXX_VOLATILE volatile
+
+namespace __gnu_parallel
+{
+ /**@brief Double-ended queue of bounded size, allowing lock-free
+ * atomic access. push_front() and pop_front() must not be called
+ * concurrently to each other, while pop_back() can be called
+ * concurrently at all times.
+ * @c empty(), @c size(), and @c top() are intentionally not provided.
+ * Calling them would not make sense in a concurrent setting.
+ * @param T Contained element type. */
+ template<typename T>
+ class RestrictedBoundedConcurrentQueue
+ {
+ private:
+ /** @brief Array of elements, seen as cyclic buffer. */
+ T* base;
+
+ /** @brief Maximal number of elements contained at the same time. */
+ sequence_index_t max_size;
+
+ /** @brief Cyclic begin and end pointers contained in one
+ atomically changeable value. */
+ _GLIBCXX_VOLATILE lcas_t borders;
+
+ public:
+ /** @brief Constructor. Not to be called concurrent, of course.
+ * @param max_size Maximal number of elements to be contained. */
+ RestrictedBoundedConcurrentQueue(sequence_index_t max_size)
+ {
+ this->max_size = max_size;
+ base = new T[max_size];
+ borders = encode2(0, 0);
+#pragma omp flush
+ }
+
+ /** @brief Destructor. Not to be called concurrent, of course. */
+ ~RestrictedBoundedConcurrentQueue()
+ { delete[] base; }
+
+ /** @brief Pushes one element into the queue at the front end.
+ * Must not be called concurrently with pop_front(). */
+ void
+ push_front(const T& t)
+ {
+ lcas_t former_borders = borders;
+ int former_front, former_back;
+ decode2(former_borders, former_front, former_back);
+ *(base + former_front % max_size) = t;
+#if _GLIBCXX_ASSERTIONS
+ // Otherwise: front - back > max_size eventually.
+ _GLIBCXX_PARALLEL_ASSERT(((former_front + 1) - former_back)
+ <= max_size);
+#endif
+ fetch_and_add(&borders, encode2(1, 0));
+ }
+
+ /** @brief Pops one element from the queue at the front end.
+ * Must not be called concurrently with pop_front(). */
+ bool
+ pop_front(T& t)
+ {
+ int former_front, former_back;
+#pragma omp flush
+ decode2(borders, former_front, former_back);
+ while (former_front > former_back)
+ {
+ // Chance.
+ lcas_t former_borders = encode2(former_front, former_back);
+ lcas_t new_borders = encode2(former_front - 1, former_back);
+ if (compare_and_swap(&borders, former_borders, new_borders))
+ {
+ t = *(base + (former_front - 1) % max_size);
+ return true;
+ }
+#pragma omp flush
+ decode2(borders, former_front, former_back);
+ }
+ return false;
+ }
+
+ /** @brief Pops one element from the queue at the front end.
+ * Must not be called concurrently with pop_front(). */
+ bool
+ pop_back(T& t) //queue behavior
+ {
+ int former_front, former_back;
+#pragma omp flush
+ decode2(borders, former_front, former_back);
+ while (former_front > former_back)
+ {
+ // Chance.
+ lcas_t former_borders = encode2(former_front, former_back);
+ lcas_t new_borders = encode2(former_front, former_back + 1);
+ if (compare_and_swap(&borders, former_borders, new_borders))
+ {
+ t = *(base + former_back % max_size);
+ return true;
+ }
+#pragma omp flush
+ decode2(borders, former_front, former_back);
+ }
+ return false;
+ }
+ };
+} //namespace __gnu_parallel
+
+#undef _GLIBCXX_VOLATILE
+
+#endif /* _GLIBCXX_PARALLEL_QUEUE_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/quicksort.h b/i686-linux/include/c++/4.4.3/parallel/quicksort.h
new file mode 100644
index 0000000..712b479
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/quicksort.h
@@ -0,0 +1,179 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/quicksort.h
+ * @brief Implementation of a unbalanced parallel quicksort (in-place).
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_QUICKSORT_H
+#define _GLIBCXX_PARALLEL_QUICKSORT_H 1
+
+#include <parallel/parallel.h>
+#include <parallel/partition.h>
+
+namespace __gnu_parallel
+{
+ /** @brief Unbalanced quicksort divide step.
+ * @param begin Begin iterator of subsequence.
+ * @param end End iterator of subsequence.
+ * @param comp Comparator.
+ * @param pivot_rank Desired rank of the pivot.
+ * @param num_samples Choose pivot from that many samples.
+ * @param num_threads Number of threads that are allowed to work on
+ * this part.
+ */
+ template<typename RandomAccessIterator, typename Comparator>
+ typename std::iterator_traits<RandomAccessIterator>::difference_type
+ parallel_sort_qs_divide(RandomAccessIterator begin,
+ RandomAccessIterator end,
+ Comparator comp, typename std::iterator_traits
+ <RandomAccessIterator>::difference_type pivot_rank,
+ typename std::iterator_traits
+ <RandomAccessIterator>::difference_type
+ num_samples, thread_index_t num_threads)
+ {
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ difference_type n = end - begin;
+ num_samples = std::min(num_samples, n);
+
+ // Allocate uninitialized, to avoid default constructor.
+ value_type* samples =
+ static_cast<value_type*>(::operator new(num_samples
+ * sizeof(value_type)));
+
+ for (difference_type s = 0; s < num_samples; ++s)
+ {
+ const unsigned long long index = static_cast<unsigned long long>(s)
+ * n / num_samples;
+ ::new(&(samples[s])) value_type(begin[index]);
+ }
+
+ __gnu_sequential::sort(samples, samples + num_samples, comp);
+
+ value_type& pivot = samples[pivot_rank * num_samples / n];
+
+ __gnu_parallel::binder2nd<Comparator, value_type, value_type, bool>
+ pred(comp, pivot);
+ difference_type split =
+ parallel_partition(begin, end, pred, num_threads);
+
+ ::operator delete(samples);
+
+ return split;
+ }
+
+ /** @brief Unbalanced quicksort conquer step.
+ * @param begin Begin iterator of subsequence.
+ * @param end End iterator of subsequence.
+ * @param comp Comparator.
+ * @param num_threads Number of threads that are allowed to work on
+ * this part.
+ */
+ template<typename RandomAccessIterator, typename Comparator>
+ void
+ parallel_sort_qs_conquer(RandomAccessIterator begin,
+ RandomAccessIterator end,
+ Comparator comp,
+ thread_index_t num_threads)
+ {
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ if (num_threads <= 1)
+ {
+ __gnu_sequential::sort(begin, end, comp);
+ return;
+ }
+
+ difference_type n = end - begin, pivot_rank;
+
+ if (n <= 1)
+ return;
+
+ thread_index_t num_threads_left;
+
+ if ((num_threads % 2) == 1)
+ num_threads_left = num_threads / 2 + 1;
+ else
+ num_threads_left = num_threads / 2;
+
+ pivot_rank = n * num_threads_left / num_threads;
+
+ difference_type split =
+ parallel_sort_qs_divide(begin, end, comp, pivot_rank,
+ _Settings::get().sort_qs_num_samples_preset,
+ num_threads);
+
+#pragma omp parallel sections num_threads(2)
+ {
+#pragma omp section
+ parallel_sort_qs_conquer(begin, begin + split,
+ comp, num_threads_left);
+#pragma omp section
+ parallel_sort_qs_conquer(begin + split, end,
+ comp, num_threads - num_threads_left);
+ }
+ }
+
+
+
+ /** @brief Unbalanced quicksort main call.
+ * @param begin Begin iterator of input sequence.
+ * @param end End iterator input sequence, ignored.
+ * @param comp Comparator.
+ * @param num_threads Number of threads that are allowed to work on
+ * this part.
+ */
+ template<typename RandomAccessIterator, typename Comparator>
+ void
+ parallel_sort_qs(RandomAccessIterator begin,
+ RandomAccessIterator end,
+ Comparator comp,
+ thread_index_t num_threads)
+ {
+ _GLIBCXX_CALL(n)
+
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ difference_type n = end - begin;
+
+ // At least one element per processor.
+ if (num_threads > n)
+ num_threads = static_cast<thread_index_t>(n);
+
+ parallel_sort_qs_conquer(begin, begin + n, comp, num_threads);
+ }
+
+} //namespace __gnu_parallel
+
+#endif /* _GLIBCXX_PARALLEL_QUICKSORT_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/random_number.h b/i686-linux/include/c++/4.4.3/parallel/random_number.h
new file mode 100644
index 0000000..7e821a4
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/random_number.h
@@ -0,0 +1,124 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/random_number.h
+ * @brief Random number generator based on the Mersenne twister.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_RANDOM_NUMBER_H
+#define _GLIBCXX_PARALLEL_RANDOM_NUMBER_H 1
+
+#include <parallel/types.h>
+#include <tr1/random>
+
+namespace __gnu_parallel
+{
+ /** @brief Random number generator, based on the Mersenne twister. */
+ class random_number
+ {
+ private:
+ std::tr1::mt19937 mt;
+ uint64 supremum;
+ uint64 RAND_SUP;
+ double supremum_reciprocal;
+ double RAND_SUP_REC;
+
+ // Assumed to be twice as long as the usual random number.
+ uint64 cache;
+
+ // Bit results.
+ int bits_left;
+
+ static uint32
+ scale_down(uint64 x,
+#if _GLIBCXX_SCALE_DOWN_FPU
+ uint64 /*supremum*/, double supremum_reciprocal)
+#else
+ uint64 supremum, double /*supremum_reciprocal*/)
+#endif
+ {
+#if _GLIBCXX_SCALE_DOWN_FPU
+ return uint32(x * supremum_reciprocal);
+#else
+ return static_cast<uint32>(x % supremum);
+#endif
+ }
+
+ public:
+ /** @brief Default constructor. Seed with 0. */
+ random_number()
+ : mt(0), supremum(0x100000000ULL),
+ RAND_SUP(1ULL << (sizeof(uint32) * 8)),
+ supremum_reciprocal(double(supremum) / double(RAND_SUP)),
+ RAND_SUP_REC(1.0 / double(RAND_SUP)),
+ cache(0), bits_left(0) { }
+
+ /** @brief Constructor.
+ * @param seed Random seed.
+ * @param supremum Generate integer random numbers in the
+ * interval @c [0,supremum). */
+ random_number(uint32 seed, uint64 supremum = 0x100000000ULL)
+ : mt(seed), supremum(supremum),
+ RAND_SUP(1ULL << (sizeof(uint32) * 8)),
+ supremum_reciprocal(double(supremum) / double(RAND_SUP)),
+ RAND_SUP_REC(1.0 / double(RAND_SUP)),
+ cache(0), bits_left(0) { }
+
+ /** @brief Generate unsigned random 32-bit integer. */
+ uint32
+ operator()()
+ { return scale_down(mt(), supremum, supremum_reciprocal); }
+
+ /** @brief Generate unsigned random 32-bit integer in the
+ interval @c [0,local_supremum). */
+ uint32
+ operator()(uint64 local_supremum)
+ {
+ return scale_down(mt(), local_supremum,
+ double(local_supremum * RAND_SUP_REC));
+ }
+
+ /** @brief Generate a number of random bits, run-time parameter.
+ * @param bits Number of bits to generate. */
+ unsigned long
+ genrand_bits(int bits)
+ {
+ unsigned long res = cache & ((1 << bits) - 1);
+ cache = cache >> bits;
+ bits_left -= bits;
+ if (bits_left < 32)
+ {
+ cache |= ((uint64(mt())) << bits_left);
+ bits_left += 32;
+ }
+ return res;
+ }
+};
+
+} // namespace __gnu_parallel
+
+#endif /* _GLIBCXX_PARALLEL_RANDOM_NUMBER_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/random_shuffle.h b/i686-linux/include/c++/4.4.3/parallel/random_shuffle.h
new file mode 100644
index 0000000..6e0ebef
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/random_shuffle.h
@@ -0,0 +1,519 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/random_shuffle.h
+ * @brief Parallel implementation of std::random_shuffle().
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_RANDOM_SHUFFLE_H
+#define _GLIBCXX_PARALLEL_RANDOM_SHUFFLE_H 1
+
+#include <limits>
+#include <bits/stl_numeric.h>
+#include <parallel/parallel.h>
+#include <parallel/random_number.h>
+
+namespace __gnu_parallel
+{
+/** @brief Type to hold the index of a bin.
+ *
+ * Since many variables of this type are allocated, it should be
+ * chosen as small as possible.
+ */
+typedef unsigned short bin_index;
+
+/** @brief Data known to every thread participating in
+ __gnu_parallel::parallel_random_shuffle(). */
+template<typename RandomAccessIterator>
+ struct DRandomShufflingGlobalData
+ {
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ /** @brief Begin iterator of the source. */
+ RandomAccessIterator& source;
+
+ /** @brief Temporary arrays for each thread. */
+ value_type** temporaries;
+
+ /** @brief Two-dimensional array to hold the thread-bin distribution.
+ *
+ * Dimensions (num_threads + 1) x (num_bins + 1). */
+ difference_type** dist;
+
+ /** @brief Start indexes of the threads' chunks. */
+ difference_type* starts;
+
+ /** @brief Number of the thread that will further process the
+ corresponding bin. */
+ thread_index_t* bin_proc;
+
+ /** @brief Number of bins to distribute to. */
+ int num_bins;
+
+ /** @brief Number of bits needed to address the bins. */
+ int num_bits;
+
+ /** @brief Constructor. */
+ DRandomShufflingGlobalData(RandomAccessIterator& _source)
+ : source(_source) { }
+ };
+
+/** @brief Local data for a thread participating in
+ __gnu_parallel::parallel_random_shuffle().
+ */
+template<typename RandomAccessIterator, typename RandomNumberGenerator>
+ struct DRSSorterPU
+ {
+ /** @brief Number of threads participating in total. */
+ int num_threads;
+
+ /** @brief Begin index for bins taken care of by this thread. */
+ bin_index bins_begin;
+
+ /** @brief End index for bins taken care of by this thread. */
+ bin_index bins_end;
+
+ /** @brief Random seed for this thread. */
+ uint32 seed;
+
+ /** @brief Pointer to global data. */
+ DRandomShufflingGlobalData<RandomAccessIterator>* sd;
+ };
+
+/** @brief Generate a random number in @c [0,2^logp).
+ * @param logp Logarithm (basis 2) of the upper range bound.
+ * @param rng Random number generator to use.
+ */
+template<typename RandomNumberGenerator>
+ inline int
+ random_number_pow2(int logp, RandomNumberGenerator& rng)
+ { return rng.genrand_bits(logp); }
+
+/** @brief Random shuffle code executed by each thread.
+ * @param pus Array of thread-local data records. */
+template<typename RandomAccessIterator, typename RandomNumberGenerator>
+ void
+ parallel_random_shuffle_drs_pu(DRSSorterPU<RandomAccessIterator,
+ RandomNumberGenerator>* pus)
+ {
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ thread_index_t iam = omp_get_thread_num();
+ DRSSorterPU<RandomAccessIterator, RandomNumberGenerator>* d = &pus[iam];
+ DRandomShufflingGlobalData<RandomAccessIterator>* sd = d->sd;
+
+ // Indexing: dist[bin][processor]
+ difference_type length = sd->starts[iam + 1] - sd->starts[iam];
+ bin_index* oracles = new bin_index[length];
+ difference_type* dist = new difference_type[sd->num_bins + 1];
+ bin_index* bin_proc = new bin_index[sd->num_bins];
+ value_type** temporaries = new value_type*[d->num_threads];
+
+ // Compute oracles and count appearances.
+ for (bin_index b = 0; b < sd->num_bins + 1; ++b)
+ dist[b] = 0;
+ int num_bits = sd->num_bits;
+
+ random_number rng(d->seed);
+
+ // First main loop.
+ for (difference_type i = 0; i < length; ++i)
+ {
+ bin_index oracle = random_number_pow2(num_bits, rng);
+ oracles[i] = oracle;
+
+ // To allow prefix (partial) sum.
+ ++(dist[oracle + 1]);
+ }
+
+ for (bin_index b = 0; b < sd->num_bins + 1; ++b)
+ sd->dist[b][iam + 1] = dist[b];
+
+# pragma omp barrier
+
+# pragma omp single
+ {
+ // Sum up bins, sd->dist[s + 1][d->num_threads] now contains the
+ // total number of items in bin s
+ for (bin_index s = 0; s < sd->num_bins; ++s)
+ __gnu_sequential::partial_sum(sd->dist[s + 1],
+ sd->dist[s + 1] + d->num_threads + 1,
+ sd->dist[s + 1]);
+ }
+
+# pragma omp barrier
+
+ sequence_index_t offset = 0, global_offset = 0;
+ for (bin_index s = 0; s < d->bins_begin; ++s)
+ global_offset += sd->dist[s + 1][d->num_threads];
+
+# pragma omp barrier
+
+ for (bin_index s = d->bins_begin; s < d->bins_end; ++s)
+ {
+ for (int t = 0; t < d->num_threads + 1; ++t)
+ sd->dist[s + 1][t] += offset;
+ offset = sd->dist[s + 1][d->num_threads];
+ }
+
+ sd->temporaries[iam] = static_cast<value_type*>(
+ ::operator new(sizeof(value_type) * offset));
+
+# pragma omp barrier
+
+ // Draw local copies to avoid false sharing.
+ for (bin_index b = 0; b < sd->num_bins + 1; ++b)
+ dist[b] = sd->dist[b][iam];
+ for (bin_index b = 0; b < sd->num_bins; ++b)
+ bin_proc[b] = sd->bin_proc[b];
+ for (thread_index_t t = 0; t < d->num_threads; ++t)
+ temporaries[t] = sd->temporaries[t];
+
+ RandomAccessIterator source = sd->source;
+ difference_type start = sd->starts[iam];
+
+ // Distribute according to oracles, second main loop.
+ for (difference_type i = 0; i < length; ++i)
+ {
+ bin_index target_bin = oracles[i];
+ thread_index_t target_p = bin_proc[target_bin];
+
+ // Last column [d->num_threads] stays unchanged.
+ ::new(&(temporaries[target_p][dist[target_bin + 1]++]))
+ value_type(*(source + i + start));
+ }
+
+ delete[] oracles;
+ delete[] dist;
+ delete[] bin_proc;
+ delete[] temporaries;
+
+# pragma omp barrier
+
+ // Shuffle bins internally.
+ for (bin_index b = d->bins_begin; b < d->bins_end; ++b)
+ {
+ value_type* begin =
+ sd->temporaries[iam] +
+ ((b == d->bins_begin) ? 0 : sd->dist[b][d->num_threads]),
+ * end =
+ sd->temporaries[iam] + sd->dist[b + 1][d->num_threads];
+ sequential_random_shuffle(begin, end, rng);
+ std::copy(begin, end, sd->source + global_offset +
+ ((b == d->bins_begin) ? 0 : sd->dist[b][d->num_threads]));
+ }
+
+ ::operator delete(sd->temporaries[iam]);
+ }
+
+/** @brief Round up to the next greater power of 2.
+ * @param x Integer to round up */
+template<typename T>
+ T
+ round_up_to_pow2(T x)
+ {
+ if (x <= 1)
+ return 1;
+ else
+ return (T)1 << (__log2(x - 1) + 1);
+ }
+
+/** @brief Main parallel random shuffle step.
+ * @param begin Begin iterator of sequence.
+ * @param end End iterator of sequence.
+ * @param n Length of sequence.
+ * @param num_threads Number of threads to use.
+ * @param rng Random number generator to use.
+ */
+template<typename RandomAccessIterator, typename RandomNumberGenerator>
+ void
+ parallel_random_shuffle_drs(RandomAccessIterator begin,
+ RandomAccessIterator end,
+ typename std::iterator_traits
+ <RandomAccessIterator>::difference_type n,
+ thread_index_t num_threads,
+ RandomNumberGenerator& rng)
+ {
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ _GLIBCXX_CALL(n)
+
+ const _Settings& __s = _Settings::get();
+
+ if (num_threads > n)
+ num_threads = static_cast<thread_index_t>(n);
+
+ bin_index num_bins, num_bins_cache;
+
+#if _GLIBCXX_RANDOM_SHUFFLE_CONSIDER_L1
+ // Try the L1 cache first.
+
+ // Must fit into L1.
+ num_bins_cache = std::max<difference_type>(
+ 1, n / (__s.L1_cache_size_lb / sizeof(value_type)));
+ num_bins_cache = round_up_to_pow2(num_bins_cache);
+
+ // No more buckets than TLB entries, power of 2
+ // Power of 2 and at least one element per bin, at most the TLB size.
+ num_bins = std::min<difference_type>(n, num_bins_cache);
+
+#if _GLIBCXX_RANDOM_SHUFFLE_CONSIDER_TLB
+ // 2 TLB entries needed per bin.
+ num_bins = std::min<difference_type>(__s.TLB_size / 2, num_bins);
+#endif
+ num_bins = round_up_to_pow2(num_bins);
+
+ if (num_bins < num_bins_cache)
+ {
+#endif
+ // Now try the L2 cache
+ // Must fit into L2
+ num_bins_cache = static_cast<bin_index>(std::max<difference_type>(
+ 1, n / (__s.L2_cache_size / sizeof(value_type))));
+ num_bins_cache = round_up_to_pow2(num_bins_cache);
+
+ // No more buckets than TLB entries, power of 2.
+ num_bins = static_cast<bin_index>(
+ std::min(n, static_cast<difference_type>(num_bins_cache)));
+ // Power of 2 and at least one element per bin, at most the TLB size.
+#if _GLIBCXX_RANDOM_SHUFFLE_CONSIDER_TLB
+ // 2 TLB entries needed per bin.
+ num_bins = std::min(
+ static_cast<difference_type>(__s.TLB_size / 2), num_bins);
+#endif
+ num_bins = round_up_to_pow2(num_bins);
+#if _GLIBCXX_RANDOM_SHUFFLE_CONSIDER_L1
+ }
+#endif
+
+ num_threads = std::min<bin_index>(num_threads, num_bins);
+
+ if (num_threads <= 1)
+ return sequential_random_shuffle(begin, end, rng);
+
+ DRandomShufflingGlobalData<RandomAccessIterator> sd(begin);
+ DRSSorterPU<RandomAccessIterator, random_number >* pus;
+ difference_type* starts;
+
+# pragma omp parallel num_threads(num_threads)
+ {
+ thread_index_t num_threads = omp_get_num_threads();
+# pragma omp single
+ {
+ pus = new DRSSorterPU<RandomAccessIterator, random_number>
+ [num_threads];
+
+ sd.temporaries = new value_type*[num_threads];
+ sd.dist = new difference_type*[num_bins + 1];
+ sd.bin_proc = new thread_index_t[num_bins];
+ for (bin_index b = 0; b < num_bins + 1; ++b)
+ sd.dist[b] = new difference_type[num_threads + 1];
+ for (bin_index b = 0; b < (num_bins + 1); ++b)
+ {
+ sd.dist[0][0] = 0;
+ sd.dist[b][0] = 0;
+ }
+ starts = sd.starts = new difference_type[num_threads + 1];
+ int bin_cursor = 0;
+ sd.num_bins = num_bins;
+ sd.num_bits = __log2(num_bins);
+
+ difference_type chunk_length = n / num_threads,
+ split = n % num_threads, start = 0;
+ difference_type bin_chunk_length = num_bins / num_threads,
+ bin_split = num_bins % num_threads;
+ for (thread_index_t i = 0; i < num_threads; ++i)
+ {
+ starts[i] = start;
+ start += (i < split) ? (chunk_length + 1) : chunk_length;
+ int j = pus[i].bins_begin = bin_cursor;
+
+ // Range of bins for this processor.
+ bin_cursor += (i < bin_split) ?
+ (bin_chunk_length + 1) : bin_chunk_length;
+ pus[i].bins_end = bin_cursor;
+ for (; j < bin_cursor; ++j)
+ sd.bin_proc[j] = i;
+ pus[i].num_threads = num_threads;
+ pus[i].seed = rng(std::numeric_limits<uint32>::max());
+ pus[i].sd = &sd;
+ }
+ starts[num_threads] = start;
+ } //single
+ // Now shuffle in parallel.
+ parallel_random_shuffle_drs_pu(pus);
+ } // parallel
+
+ delete[] starts;
+ delete[] sd.bin_proc;
+ for (int s = 0; s < (num_bins + 1); ++s)
+ delete[] sd.dist[s];
+ delete[] sd.dist;
+ delete[] sd.temporaries;
+
+ delete[] pus;
+ }
+
+/** @brief Sequential cache-efficient random shuffle.
+ * @param begin Begin iterator of sequence.
+ * @param end End iterator of sequence.
+ * @param rng Random number generator to use.
+ */
+template<typename RandomAccessIterator, typename RandomNumberGenerator>
+ void
+ sequential_random_shuffle(RandomAccessIterator begin,
+ RandomAccessIterator end,
+ RandomNumberGenerator& rng)
+ {
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ difference_type n = end - begin;
+ const _Settings& __s = _Settings::get();
+
+ bin_index num_bins, num_bins_cache;
+
+#if _GLIBCXX_RANDOM_SHUFFLE_CONSIDER_L1
+ // Try the L1 cache first, must fit into L1.
+ num_bins_cache =
+ std::max<difference_type>
+ (1, n / (__s.L1_cache_size_lb / sizeof(value_type)));
+ num_bins_cache = round_up_to_pow2(num_bins_cache);
+
+ // No more buckets than TLB entries, power of 2
+ // Power of 2 and at least one element per bin, at most the TLB size
+ num_bins = std::min(n, (difference_type)num_bins_cache);
+#if _GLIBCXX_RANDOM_SHUFFLE_CONSIDER_TLB
+ // 2 TLB entries needed per bin
+ num_bins = std::min((difference_type)__s.TLB_size / 2, num_bins);
+#endif
+ num_bins = round_up_to_pow2(num_bins);
+
+ if (num_bins < num_bins_cache)
+ {
+#endif
+ // Now try the L2 cache, must fit into L2.
+ num_bins_cache =
+ static_cast<bin_index>(std::max<difference_type>(
+ 1, n / (__s.L2_cache_size / sizeof(value_type))));
+ num_bins_cache = round_up_to_pow2(num_bins_cache);
+
+ // No more buckets than TLB entries, power of 2
+ // Power of 2 and at least one element per bin, at most the TLB size.
+ num_bins = static_cast<bin_index>
+ (std::min(n, static_cast<difference_type>(num_bins_cache)));
+
+#if _GLIBCXX_RANDOM_SHUFFLE_CONSIDER_TLB
+ // 2 TLB entries needed per bin
+ num_bins =
+ std::min<difference_type>(__s.TLB_size / 2, num_bins);
+#endif
+ num_bins = round_up_to_pow2(num_bins);
+#if _GLIBCXX_RANDOM_SHUFFLE_CONSIDER_L1
+ }
+#endif
+
+ int num_bits = __log2(num_bins);
+
+ if (num_bins > 1)
+ {
+ value_type* target = static_cast<value_type*>(
+ ::operator new(sizeof(value_type) * n));
+ bin_index* oracles = new bin_index[n];
+ difference_type* dist0 = new difference_type[num_bins + 1],
+ * dist1 = new difference_type[num_bins + 1];
+
+ for (int b = 0; b < num_bins + 1; ++b)
+ dist0[b] = 0;
+
+ random_number bitrng(rng(0xFFFFFFFF));
+
+ for (difference_type i = 0; i < n; ++i)
+ {
+ bin_index oracle = random_number_pow2(num_bits, bitrng);
+ oracles[i] = oracle;
+
+ // To allow prefix (partial) sum.
+ ++(dist0[oracle + 1]);
+ }
+
+ // Sum up bins.
+ __gnu_sequential::partial_sum(dist0, dist0 + num_bins + 1, dist0);
+
+ for (int b = 0; b < num_bins + 1; ++b)
+ dist1[b] = dist0[b];
+
+ // Distribute according to oracles.
+ for (difference_type i = 0; i < n; ++i)
+ ::new(&(target[(dist0[oracles[i]])++])) value_type(*(begin + i));
+
+ for (int b = 0; b < num_bins; ++b)
+ {
+ sequential_random_shuffle(target + dist1[b],
+ target + dist1[b + 1],
+ rng);
+ }
+
+ // Copy elements back.
+ std::copy(target, target + n, begin);
+
+ delete[] dist0;
+ delete[] dist1;
+ delete[] oracles;
+ ::operator delete(target);
+ }
+ else
+ __gnu_sequential::random_shuffle(begin, end, rng);
+ }
+
+/** @brief Parallel random public call.
+ * @param begin Begin iterator of sequence.
+ * @param end End iterator of sequence.
+ * @param rng Random number generator to use.
+ */
+template<typename RandomAccessIterator, typename RandomNumberGenerator>
+ inline void
+ parallel_random_shuffle(RandomAccessIterator begin,
+ RandomAccessIterator end,
+ RandomNumberGenerator rng = random_number())
+ {
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::difference_type difference_type;
+ difference_type n = end - begin;
+ parallel_random_shuffle_drs(begin, end, n, get_max_threads(), rng) ;
+ }
+
+}
+
+#endif /* _GLIBCXX_PARALLEL_RANDOM_SHUFFLE_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/search.h b/i686-linux/include/c++/4.4.3/parallel/search.h
new file mode 100644
index 0000000..31a8534
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/search.h
@@ -0,0 +1,172 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/search.h
+ * @brief Parallel implementation base for std::search() and
+ * std::search_n().
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Felix Putze.
+
+#ifndef _GLIBCXX_PARALLEL_SEARCH_H
+#define _GLIBCXX_PARALLEL_SEARCH_H 1
+
+#include <bits/stl_algobase.h>
+
+#include <parallel/parallel.h>
+#include <parallel/equally_split.h>
+
+
+namespace __gnu_parallel
+{
+ /**
+ * @brief Precalculate advances for Knuth-Morris-Pratt algorithm.
+ * @param elements Begin iterator of sequence to search for.
+ * @param length Length of sequence to search for.
+ * @param advances Returned offsets.
+ */
+template<typename RandomAccessIterator, typename _DifferenceTp>
+ void
+ calc_borders(RandomAccessIterator elements, _DifferenceTp length,
+ _DifferenceTp* off)
+ {
+ typedef _DifferenceTp difference_type;
+
+ off[0] = -1;
+ if (length > 1)
+ off[1] = 0;
+ difference_type k = 0;
+ for (difference_type j = 2; j <= length; j++)
+ {
+ while ((k >= 0) && !(elements[k] == elements[j-1]))
+ k = off[k];
+ off[j] = ++k;
+ }
+ }
+
+ // Generic parallel find algorithm (requires random access iterator).
+
+ /** @brief Parallel std::search.
+ * @param begin1 Begin iterator of first sequence.
+ * @param end1 End iterator of first sequence.
+ * @param begin2 Begin iterator of second sequence.
+ * @param end2 End iterator of second sequence.
+ * @param pred Find predicate.
+ * @return Place of finding in first sequences. */
+template<typename _RandomAccessIterator1,
+ typename _RandomAccessIterator2,
+ typename Pred>
+ _RandomAccessIterator1
+ search_template(_RandomAccessIterator1 begin1, _RandomAccessIterator1 end1,
+ _RandomAccessIterator2 begin2, _RandomAccessIterator2 end2,
+ Pred pred)
+ {
+ typedef std::iterator_traits<_RandomAccessIterator1> traits_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ _GLIBCXX_CALL((end1 - begin1) + (end2 - begin2));
+
+ difference_type pattern_length = end2 - begin2;
+
+ // Pattern too short.
+ if(pattern_length <= 0)
+ return end1;
+
+ // Last point to start search.
+ difference_type input_length = (end1 - begin1) - pattern_length;
+
+ // Where is first occurrence of pattern? defaults to end.
+ difference_type result = (end1 - begin1);
+ difference_type *splitters;
+
+ // Pattern too long.
+ if (input_length < 0)
+ return end1;
+
+ omp_lock_t result_lock;
+ omp_init_lock(&result_lock);
+
+ thread_index_t num_threads =
+ std::max<difference_type>(1,
+ std::min<difference_type>(input_length, get_max_threads()));
+
+ difference_type advances[pattern_length];
+ calc_borders(begin2, pattern_length, advances);
+
+# pragma omp parallel num_threads(num_threads)
+ {
+# pragma omp single
+ {
+ num_threads = omp_get_num_threads();
+ splitters = new difference_type[num_threads + 1];
+ equally_split(input_length, num_threads, splitters);
+ }
+
+ thread_index_t iam = omp_get_thread_num();
+
+ difference_type start = splitters[iam], stop = splitters[iam + 1];
+
+ difference_type pos_in_pattern = 0;
+ bool found_pattern = false;
+
+ while (start <= stop && !found_pattern)
+ {
+ // Get new value of result.
+ #pragma omp flush(result)
+ // No chance for this thread to find first occurrence.
+ if (result < start)
+ break;
+ while (pred(begin1[start + pos_in_pattern],
+ begin2[pos_in_pattern]))
+ {
+ ++pos_in_pattern;
+ if (pos_in_pattern == pattern_length)
+ {
+ // Found new candidate for result.
+ omp_set_lock(&result_lock);
+ result = std::min(result, start);
+ omp_unset_lock(&result_lock);
+
+ found_pattern = true;
+ break;
+ }
+ }
+ // Make safe jump.
+ start += (pos_in_pattern - advances[pos_in_pattern]);
+ pos_in_pattern =
+ (advances[pos_in_pattern] < 0) ? 0 : advances[pos_in_pattern];
+ }
+ } //parallel
+
+ omp_destroy_lock(&result_lock);
+
+ delete[] splitters;
+
+ // Return iterator on found element.
+ return (begin1 + result);
+ }
+} // end namespace
+
+#endif /* _GLIBCXX_PARALLEL_SEARCH_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/set_operations.h b/i686-linux/include/c++/4.4.3/parallel/set_operations.h
new file mode 100644
index 0000000..2800819
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/set_operations.h
@@ -0,0 +1,524 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/**
+ * @file parallel/set_operations.h
+ * @brief Parallel implementations of set operations for random-access
+ * iterators.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Marius Elvert and Felix Bondarenko.
+
+#ifndef _GLIBCXX_PARALLEL_SET_OPERATIONS_H
+#define _GLIBCXX_PARALLEL_SET_OPERATIONS_H 1
+
+#include <omp.h>
+
+#include <parallel/settings.h>
+#include <parallel/multiseq_selection.h>
+
+namespace __gnu_parallel
+{
+template<typename InputIterator, typename OutputIterator>
+ OutputIterator
+ copy_tail(std::pair<InputIterator, InputIterator> b,
+ std::pair<InputIterator, InputIterator> e, OutputIterator r)
+ {
+ if (b.first != e.first)
+ {
+ do
+ {
+ *r++ = *b.first++;
+ }
+ while (b.first != e.first);
+ }
+ else
+ {
+ while (b.second != e.second)
+ *r++ = *b.second++;
+ }
+ return r;
+ }
+
+template<typename InputIterator,
+ typename OutputIterator,
+ typename Comparator>
+ struct symmetric_difference_func
+ {
+ typedef std::iterator_traits<InputIterator> traits_type;
+ typedef typename traits_type::difference_type difference_type;
+ typedef typename std::pair<InputIterator, InputIterator> iterator_pair;
+
+ symmetric_difference_func(Comparator c) : comp(c) {}
+
+ Comparator comp;
+
+ OutputIterator
+ invoke(InputIterator a, InputIterator b,
+ InputIterator c, InputIterator d,
+ OutputIterator r) const
+ {
+ while (a != b && c != d)
+ {
+ if (comp(*a, *c))
+ {
+ *r = *a;
+ ++a;
+ ++r;
+ }
+ else if (comp(*c, *a))
+ {
+ *r = *c;
+ ++c;
+ ++r;
+ }
+ else
+ {
+ ++a;
+ ++c;
+ }
+ }
+ return std::copy(c, d, std::copy(a, b, r));
+ }
+
+ difference_type
+ count(InputIterator a, InputIterator b,
+ InputIterator c, InputIterator d) const
+ {
+ difference_type counter = 0;
+
+ while (a != b && c != d)
+ {
+ if (comp(*a, *c))
+ {
+ ++a;
+ ++counter;
+ }
+ else if (comp(*c, *a))
+ {
+ ++c;
+ ++counter;
+ }
+ else
+ {
+ ++a;
+ ++c;
+ }
+ }
+
+ return counter + (b - a) + (d - c);
+ }
+
+ OutputIterator
+ first_empty(InputIterator c, InputIterator d, OutputIterator out) const
+ { return std::copy(c, d, out); }
+
+ OutputIterator
+ second_empty(InputIterator a, InputIterator b, OutputIterator out) const
+ { return std::copy(a, b, out); }
+ };
+
+
+template<typename InputIterator,
+ typename OutputIterator,
+ typename Comparator>
+ struct difference_func
+ {
+ typedef std::iterator_traits<InputIterator> traits_type;
+ typedef typename traits_type::difference_type difference_type;
+ typedef typename std::pair<InputIterator, InputIterator> iterator_pair;
+
+ difference_func(Comparator c) : comp(c) {}
+
+ Comparator comp;
+
+ OutputIterator
+ invoke(InputIterator a, InputIterator b, InputIterator c, InputIterator d,
+ OutputIterator r) const
+ {
+ while (a != b && c != d)
+ {
+ if (comp(*a, *c))
+ {
+ *r = *a;
+ ++a;
+ ++r;
+ }
+ else if (comp(*c, *a))
+ { ++c; }
+ else
+ {
+ ++a;
+ ++c;
+ }
+ }
+ return std::copy(a, b, r);
+ }
+
+ difference_type
+ count(InputIterator a, InputIterator b,
+ InputIterator c, InputIterator d) const
+ {
+ difference_type counter = 0;
+
+ while (a != b && c != d)
+ {
+ if (comp(*a, *c))
+ {
+ ++a;
+ ++counter;
+ }
+ else if (comp(*c, *a))
+ { ++c; }
+ else
+ { ++a; ++c; }
+ }
+
+ return counter + (b - a);
+ }
+
+ inline OutputIterator
+ first_empty(InputIterator c, InputIterator d, OutputIterator out) const
+ { return out; }
+
+ inline OutputIterator
+ second_empty(InputIterator a, InputIterator b, OutputIterator out) const
+ { return std::copy(a, b, out); }
+ };
+
+
+template<typename InputIterator,
+ typename OutputIterator,
+ typename Comparator>
+ struct intersection_func
+ {
+ typedef std::iterator_traits<InputIterator> traits_type;
+ typedef typename traits_type::difference_type difference_type;
+ typedef typename std::pair<InputIterator, InputIterator> iterator_pair;
+
+ intersection_func(Comparator c) : comp(c) {}
+
+ Comparator comp;
+
+ OutputIterator
+ invoke(InputIterator a, InputIterator b, InputIterator c, InputIterator d,
+ OutputIterator r) const
+ {
+ while (a != b && c != d)
+ {
+ if (comp(*a, *c))
+ { ++a; }
+ else if (comp(*c, *a))
+ { ++c; }
+ else
+ {
+ *r = *a;
+ ++a;
+ ++c;
+ ++r;
+ }
+ }
+
+ return r;
+ }
+
+ difference_type
+ count(InputIterator a, InputIterator b,
+ InputIterator c, InputIterator d) const
+ {
+ difference_type counter = 0;
+
+ while (a != b && c != d)
+ {
+ if (comp(*a, *c))
+ { ++a; }
+ else if (comp(*c, *a))
+ { ++c; }
+ else
+ {
+ ++a;
+ ++c;
+ ++counter;
+ }
+ }
+
+ return counter;
+ }
+
+ inline OutputIterator
+ first_empty(InputIterator c, InputIterator d, OutputIterator out) const
+ { return out; }
+
+ inline OutputIterator
+ second_empty(InputIterator a, InputIterator b, OutputIterator out) const
+ { return out; }
+ };
+
+template<class InputIterator, class OutputIterator, class Comparator>
+ struct union_func
+ {
+ typedef typename std::iterator_traits<InputIterator>::difference_type
+ difference_type;
+
+ union_func(Comparator c) : comp(c) {}
+
+ Comparator comp;
+
+ OutputIterator
+ invoke(InputIterator a, const InputIterator b, InputIterator c,
+ const InputIterator d, OutputIterator r) const
+ {
+ while (a != b && c != d)
+ {
+ if (comp(*a, *c))
+ {
+ *r = *a;
+ ++a;
+ }
+ else if (comp(*c, *a))
+ {
+ *r = *c;
+ ++c;
+ }
+ else
+ {
+ *r = *a;
+ ++a;
+ ++c;
+ }
+ ++r;
+ }
+ return std::copy(c, d, std::copy(a, b, r));
+ }
+
+ difference_type
+ count(InputIterator a, InputIterator b,
+ InputIterator c, InputIterator d) const
+ {
+ difference_type counter = 0;
+
+ while (a != b && c != d)
+ {
+ if (comp(*a, *c))
+ { ++a; }
+ else if (comp(*c, *a))
+ { ++c; }
+ else
+ {
+ ++a;
+ ++c;
+ }
+ ++counter;
+ }
+
+ counter += (b - a);
+ counter += (d - c);
+ return counter;
+ }
+
+ inline OutputIterator
+ first_empty(InputIterator c, InputIterator d, OutputIterator out) const
+ { return std::copy(c, d, out); }
+
+ inline OutputIterator
+ second_empty(InputIterator a, InputIterator b, OutputIterator out) const
+ { return std::copy(a, b, out); }
+ };
+
+template<typename InputIterator,
+ typename OutputIterator,
+ typename Operation>
+ OutputIterator
+ parallel_set_operation(InputIterator begin1, InputIterator end1,
+ InputIterator begin2, InputIterator end2,
+ OutputIterator result, Operation op)
+ {
+ _GLIBCXX_CALL((end1 - begin1) + (end2 - begin2))
+
+ typedef std::iterator_traits<InputIterator> traits_type;
+ typedef typename traits_type::difference_type difference_type;
+ typedef typename std::pair<InputIterator, InputIterator> iterator_pair;
+
+ if (begin1 == end1)
+ return op.first_empty(begin2, end2, result);
+
+ if (begin2 == end2)
+ return op.second_empty(begin1, end1, result);
+
+ const difference_type size = (end1 - begin1) + (end2 - begin2);
+
+ const iterator_pair sequence[ 2 ] =
+ { std::make_pair(begin1, end1), std::make_pair(begin2, end2) } ;
+ OutputIterator return_value = result;
+ difference_type *borders;
+ iterator_pair *block_begins;
+ difference_type* lengths;
+
+ thread_index_t num_threads =
+ std::min<difference_type>(get_max_threads(),
+ std::min(end1 - begin1, end2 - begin2));
+
+# pragma omp parallel num_threads(num_threads)
+ {
+# pragma omp single
+ {
+ num_threads = omp_get_num_threads();
+
+ borders = new difference_type[num_threads + 2];
+ equally_split(size, num_threads + 1, borders);
+ block_begins = new iterator_pair[num_threads + 1];
+ // Very start.
+ block_begins[0] = std::make_pair(begin1, begin2);
+ lengths = new difference_type[num_threads];
+ } //single
+
+ thread_index_t iam = omp_get_thread_num();
+
+ // Result from multiseq_partition.
+ InputIterator offset[2];
+ const difference_type rank = borders[iam + 1];
+
+ multiseq_partition(sequence, sequence + 2, rank, offset, op.comp);
+
+ // allowed to read?
+ // together
+ // *(offset[ 0 ] - 1) == *offset[ 1 ]
+ if (offset[ 0 ] != begin1 && offset[ 1 ] != end2
+ && !op.comp(*(offset[ 0 ] - 1), *offset[ 1 ])
+ && !op.comp(*offset[ 1 ], *(offset[ 0 ] - 1)))
+ {
+ // Avoid split between globally equal elements: move one to
+ // front in first sequence.
+ --offset[ 0 ];
+ }
+
+ iterator_pair block_end = block_begins[ iam + 1 ] =
+ iterator_pair(offset[ 0 ], offset[ 1 ]);
+
+ // Make sure all threads have their block_begin result written out.
+# pragma omp barrier
+
+ iterator_pair block_begin = block_begins[ iam ];
+
+ // Begin working for the first block, while the others except
+ // the last start to count.
+ if (iam == 0)
+ {
+ // The first thread can copy already.
+ lengths[ iam ] = op.invoke(block_begin.first, block_end.first,
+ block_begin.second, block_end.second,
+ result)
+ - result;
+ }
+ else
+ {
+ lengths[ iam ] = op.count(block_begin.first, block_end.first,
+ block_begin.second, block_end.second);
+ }
+
+ // Make sure everyone wrote their lengths.
+# pragma omp barrier
+
+ OutputIterator r = result;
+
+ if (iam == 0)
+ {
+ // Do the last block.
+ for (int i = 0; i < num_threads; ++i)
+ r += lengths[i];
+
+ block_begin = block_begins[num_threads];
+
+ // Return the result iterator of the last block.
+ return_value = op.invoke(
+ block_begin.first, end1, block_begin.second, end2, r);
+
+ }
+ else
+ {
+ for (int i = 0; i < iam; ++i)
+ r += lengths[ i ];
+
+ // Reset begins for copy pass.
+ op.invoke(block_begin.first, block_end.first,
+ block_begin.second, block_end.second, r);
+ }
+ }
+ return return_value;
+ }
+
+
+template<typename InputIterator,
+ typename OutputIterator,
+ typename Comparator>
+ inline OutputIterator
+ parallel_set_union(InputIterator begin1, InputIterator end1,
+ InputIterator begin2, InputIterator end2,
+ OutputIterator result, Comparator comp)
+ {
+ return parallel_set_operation(begin1, end1, begin2, end2, result,
+ union_func< InputIterator, OutputIterator, Comparator>(comp));
+ }
+
+template<typename InputIterator,
+ typename OutputIterator,
+ typename Comparator>
+ inline OutputIterator
+ parallel_set_intersection(InputIterator begin1, InputIterator end1,
+ InputIterator begin2, InputIterator end2,
+ OutputIterator result, Comparator comp)
+ {
+ return parallel_set_operation(begin1, end1, begin2, end2, result,
+ intersection_func<InputIterator, OutputIterator, Comparator>(comp));
+ }
+
+template<typename InputIterator,
+ typename OutputIterator,
+ typename Comparator>
+ inline OutputIterator
+ parallel_set_difference(InputIterator begin1, InputIterator end1,
+ InputIterator begin2, InputIterator end2,
+ OutputIterator result, Comparator comp)
+ {
+ return parallel_set_operation(begin1, end1, begin2, end2, result,
+ difference_func<InputIterator, OutputIterator, Comparator>(comp));
+ }
+
+template<typename InputIterator,
+ typename OutputIterator,
+ typename Comparator>
+ inline OutputIterator
+ parallel_set_symmetric_difference(InputIterator begin1, InputIterator end1,
+ InputIterator begin2, InputIterator end2,
+ OutputIterator result, Comparator comp)
+ {
+ return parallel_set_operation(begin1, end1, begin2, end2, result,
+ symmetric_difference_func<InputIterator, OutputIterator, Comparator>
+ (comp));
+ }
+
+}
+
+#endif /* _GLIBCXX_PARALLEL_SET_OPERATIONS_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/settings.h b/i686-linux/include/c++/4.4.3/parallel/settings.h
new file mode 100644
index 0000000..946e39c
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/settings.h
@@ -0,0 +1,281 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/settings.h
+ * @brief Runtime settings and tuning parameters, heuristics to decide
+ * whether to use parallelized algorithms.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ *
+ * @section parallelization_decision
+ * The decision whether to run an algorithm in parallel.
+ *
+ * There are several ways the user can switch on and off the parallel
+ * execution of an algorithm, both at compile- and run-time.
+ *
+ * Only sequential execution can be forced at compile-time. This
+ * reduces code size and protects code parts that have
+ * non-thread-safe side effects.
+ *
+ * Ultimately, forcing parallel execution at compile-time makes
+ * sense. Often, the sequential algorithm implementation is used as
+ * a subroutine, so no reduction in code size can be achieved. Also,
+ * the machine the program is run on might have only one processor
+ * core, so to avoid overhead, the algorithm is executed
+ * sequentially.
+ *
+ * To force sequential execution of an algorithm ultimately at
+ * compile-time, the user must add the tag
+ * __gnu_parallel::sequential_tag() to the end of the parameter list,
+ * e. g.
+ *
+ * \code
+ * std::sort(v.begin(), v.end(), __gnu_parallel::sequential_tag());
+ * \endcode
+ *
+ * This is compatible with all overloaded algorithm variants. No
+ * additional code will be instantiated, at all. The same holds for
+ * most algorithm calls with iterators not providing random access.
+ *
+ * If the algorithm call is not forced to be executed sequentially
+ * at compile-time, the decision is made at run-time.
+ * The global variable __gnu_parallel::_Settings::algorithm_strategy
+ * is checked. It is a tristate variable corresponding to:
+ *
+ * a. force_sequential, meaning the sequential algorithm is executed.
+ * b. force_parallel, meaning the parallel algorithm is executed.
+ * c. heuristic
+ *
+ * For heuristic, the parallel algorithm implementation is called
+ * only if the input size is sufficiently large. For most
+ * algorithms, the input size is the (combined) length of the input
+ * sequence(s). The threshold can be set by the user, individually
+ * for each algorithm. The according variables are called
+ * __gnu_parallel::_Settings::[algorithm]_minimal_n .
+ *
+ * For some of the algorithms, there are even more tuning options,
+ * e. g. the ability to choose from multiple algorithm variants. See
+ * below for details.
+ */
+
+// Written by Johannes Singler and Felix Putze.
+
+#ifndef _GLIBCXX_PARALLEL_SETTINGS_H
+#define _GLIBCXX_PARALLEL_SETTINGS_H 1
+
+#include <parallel/types.h>
+
+/**
+ * @brief Determine at compile(?)-time if the parallel variant of an
+ * algorithm should be called.
+ * @param c A condition that is convertible to bool that is overruled by
+ * __gnu_parallel::_Settings::algorithm_strategy. Usually a decision
+ * based on the input size.
+ */
+#define _GLIBCXX_PARALLEL_CONDITION(c) (__gnu_parallel::_Settings::get().algorithm_strategy != __gnu_parallel::force_sequential && ((__gnu_parallel::get_max_threads() > 1 && (c)) || __gnu_parallel::_Settings::get().algorithm_strategy == __gnu_parallel::force_parallel))
+
+/*
+inline bool
+parallel_condition(bool c)
+{
+ bool ret = false;
+ const _Settings& s = _Settings::get();
+ if (s.algorithm_strategy != force_seqential)
+ {
+ if (s.algorithm_strategy == force_parallel)
+ ret = true;
+ else
+ ret = get_max_threads() > 1 && c;
+ }
+ return ret;
+}
+*/
+
+namespace __gnu_parallel
+{
+ /// class _Settings
+ /// Run-time settings for the parallel mode, including all tunable parameters.
+ struct _Settings
+ {
+ _AlgorithmStrategy algorithm_strategy;
+
+ _SortAlgorithm sort_algorithm;
+ _PartialSumAlgorithm partial_sum_algorithm;
+ _MultiwayMergeAlgorithm multiway_merge_algorithm;
+ _FindAlgorithm find_algorithm;
+
+ _SplittingAlgorithm sort_splitting;
+ _SplittingAlgorithm merge_splitting;
+ _SplittingAlgorithm multiway_merge_splitting;
+
+ // Per-algorithm settings.
+
+ /// Minimal input size for accumulate.
+ sequence_index_t accumulate_minimal_n;
+
+ /// Minimal input size for adjacent_difference.
+ unsigned int adjacent_difference_minimal_n;
+
+ /// Minimal input size for count and count_if.
+ sequence_index_t count_minimal_n;
+
+ /// Minimal input size for fill.
+ sequence_index_t fill_minimal_n;
+
+ /// Block size increase factor for find.
+ double find_increasing_factor;
+
+ /// Initial block size for find.
+ sequence_index_t find_initial_block_size;
+
+ /// Maximal block size for find.
+ sequence_index_t find_maximum_block_size;
+
+ /// Start with looking for this many elements sequentially, for find.
+ sequence_index_t find_sequential_search_size;
+
+ /// Minimal input size for for_each.
+ sequence_index_t for_each_minimal_n;
+
+ /// Minimal input size for generate.
+ sequence_index_t generate_minimal_n;
+
+ /// Minimal input size for max_element.
+ sequence_index_t max_element_minimal_n;
+
+ /// Minimal input size for merge.
+ sequence_index_t merge_minimal_n;
+
+ /// Oversampling factor for merge.
+ unsigned int merge_oversampling;
+
+ /// Minimal input size for min_element.
+ sequence_index_t min_element_minimal_n;
+
+ /// Minimal input size for multiway_merge.
+ sequence_index_t multiway_merge_minimal_n;
+
+ /// Oversampling factor for multiway_merge.
+ int multiway_merge_minimal_k;
+
+ /// Oversampling factor for multiway_merge.
+ unsigned int multiway_merge_oversampling;
+
+ /// Minimal input size for nth_element.
+ sequence_index_t nth_element_minimal_n;
+
+ /// Chunk size for partition.
+ sequence_index_t partition_chunk_size;
+
+ /// Chunk size for partition, relative to input size. If > 0.0,
+ /// this value overrides partition_chunk_size.
+ double partition_chunk_share;
+
+ /// Minimal input size for partition.
+ sequence_index_t partition_minimal_n;
+
+ /// Minimal input size for partial_sort.
+ sequence_index_t partial_sort_minimal_n;
+
+ /// Ratio for partial_sum. Assume "sum and write result" to be
+ /// this factor slower than just "sum".
+ float partial_sum_dilation;
+
+ /// Minimal input size for partial_sum.
+ unsigned int partial_sum_minimal_n;
+
+ /// Minimal input size for random_shuffle.
+ unsigned int random_shuffle_minimal_n;
+
+ /// Minimal input size for replace and replace_if.
+ sequence_index_t replace_minimal_n;
+
+ /// Minimal input size for set_difference.
+ sequence_index_t set_difference_minimal_n;
+
+ /// Minimal input size for set_intersection.
+ sequence_index_t set_intersection_minimal_n;
+
+ /// Minimal input size for set_symmetric_difference.
+ sequence_index_t set_symmetric_difference_minimal_n;
+
+ /// Minimal input size for set_union.
+ sequence_index_t set_union_minimal_n;
+
+ /// Minimal input size for parallel sorting.
+ sequence_index_t sort_minimal_n;
+
+ /// Oversampling factor for parallel std::sort (MWMS).
+ unsigned int sort_mwms_oversampling;
+
+ /// Such many samples to take to find a good pivot (quicksort).
+ unsigned int sort_qs_num_samples_preset;
+
+ /// Maximal subsequence length to switch to unbalanced base case.
+ /// Applies to std::sort with dynamically load-balanced quicksort.
+ sequence_index_t sort_qsb_base_case_maximal_n;
+
+ /// Minimal input size for parallel std::transform.
+ sequence_index_t transform_minimal_n;
+
+ /// Minimal input size for unique_copy.
+ sequence_index_t unique_copy_minimal_n;
+
+ sequence_index_t workstealing_chunk_size;
+
+ // Hardware dependent tuning parameters.
+
+ /// Size of the L1 cache in bytes (underestimation).
+ unsigned long long L1_cache_size;
+
+ /// Size of the L2 cache in bytes (underestimation).
+ unsigned long long L2_cache_size;
+
+ /// Size of the Translation Lookaside Buffer (underestimation).
+ unsigned int TLB_size;
+
+ /// Overestimation of cache line size. Used to avoid false
+ /// sharing, i. e. elements of different threads are at least this
+ /// amount apart.
+ unsigned int cache_line_size;
+
+ // Statistics.
+
+ /// The number of stolen ranges in load-balanced quicksort.
+ sequence_index_t qsb_steals;
+
+ /// Get the global settings.
+ static const _Settings&
+ get() throw();
+
+ /// Set the global settings.
+ static void
+ set(_Settings&) throw();
+
+ explicit
+ _Settings() : algorithm_strategy(heuristic), sort_algorithm(MWMS), partial_sum_algorithm(LINEAR), multiway_merge_algorithm(LOSER_TREE), find_algorithm(CONSTANT_SIZE_BLOCKS), sort_splitting(EXACT), merge_splitting(EXACT), multiway_merge_splitting(EXACT), accumulate_minimal_n(1000), adjacent_difference_minimal_n(1000), count_minimal_n(1000), fill_minimal_n(1000), find_increasing_factor(2.0), find_initial_block_size(256), find_maximum_block_size(8192), find_sequential_search_size(256), for_each_minimal_n(1000), generate_minimal_n(1000), max_element_minimal_n(1000), merge_minimal_n(1000), merge_oversampling(10), min_element_minimal_n(1000), multiway_merge_minimal_n(1000), multiway_merge_minimal_k(2), multiway_merge_oversampling(10), nth_element_minimal_n(1000), partition_chunk_size(1000), partition_chunk_share(0.0), partition_minimal_n(1000), partial_sort_minimal_n(1000), partial_sum_dilation(1.0f), partial_sum_minimal_n(1000), random_shuffle_minimal_n(1000), replace_minimal_n(1000), set_difference_minimal_n(1000), set_intersection_minimal_n(1000), set_symmetric_difference_minimal_n(1000), set_union_minimal_n(1000), sort_minimal_n(1000), sort_mwms_oversampling(10), sort_qs_num_samples_preset(100), sort_qsb_base_case_maximal_n(100), transform_minimal_n(1000), unique_copy_minimal_n(10000), workstealing_chunk_size(100), L1_cache_size(16 << 10), L2_cache_size(256 << 10), TLB_size(128), cache_line_size(64), qsb_steals(0)
+ { }
+ };
+}
+
+#endif /* _GLIBCXX_PARALLEL_SETTINGS_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/sort.h b/i686-linux/include/c++/4.4.3/parallel/sort.h
new file mode 100644
index 0000000..de226e8
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/sort.h
@@ -0,0 +1,229 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/sort.h
+ * @brief Parallel sorting algorithm switch.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_SORT_H
+#define _GLIBCXX_PARALLEL_SORT_H 1
+
+#include <parallel/basic_iterator.h>
+#include <parallel/features.h>
+#include <parallel/parallel.h>
+
+#if _GLIBCXX_ASSERTIONS
+#include <parallel/checkers.h>
+#endif
+
+#if _GLIBCXX_MERGESORT
+#include <parallel/multiway_mergesort.h>
+#endif
+
+#if _GLIBCXX_QUICKSORT
+#include <parallel/quicksort.h>
+#endif
+
+#if _GLIBCXX_BAL_QUICKSORT
+#include <parallel/balanced_quicksort.h>
+#endif
+
+namespace __gnu_parallel
+{
+ //prototype
+ template<bool stable, typename RandomAccessIterator,
+ typename Comparator, typename Parallelism>
+ void
+ parallel_sort(RandomAccessIterator begin, RandomAccessIterator end,
+ Comparator comp, Parallelism parallelism);
+
+ /**
+ * @brief Choose multiway mergesort, splitting variant at run-time,
+ * for parallel sorting.
+ * @param begin Begin iterator of input sequence.
+ * @param end End iterator of input sequence.
+ * @param comp Comparator.
+ * @callgraph
+ */
+ template<bool stable, typename RandomAccessIterator, typename Comparator>
+ inline void
+ parallel_sort(RandomAccessIterator begin, RandomAccessIterator end,
+ Comparator comp, multiway_mergesort_tag parallelism)
+ {
+ _GLIBCXX_CALL(end - begin)
+
+ if(_Settings::get().sort_splitting == EXACT)
+ parallel_sort_mwms<stable, true>
+ (begin, end, comp, parallelism.get_num_threads());
+ else
+ parallel_sort_mwms<stable, false>
+ (begin, end, comp, parallelism.get_num_threads());
+ }
+
+ /**
+ * @brief Choose multiway mergesort with exact splitting,
+ * for parallel sorting.
+ * @param begin Begin iterator of input sequence.
+ * @param end End iterator of input sequence.
+ * @param comp Comparator.
+ * @callgraph
+ */
+ template<bool stable, typename RandomAccessIterator, typename Comparator>
+ inline void
+ parallel_sort(RandomAccessIterator begin, RandomAccessIterator end,
+ Comparator comp, multiway_mergesort_exact_tag parallelism)
+ {
+ _GLIBCXX_CALL(end - begin)
+
+ parallel_sort_mwms<stable, true>
+ (begin, end, comp, parallelism.get_num_threads());
+ }
+
+ /**
+ * @brief Choose multiway mergesort with splitting by sampling,
+ * for parallel sorting.
+ * @param begin Begin iterator of input sequence.
+ * @param end End iterator of input sequence.
+ * @param comp Comparator.
+ * @callgraph
+ */
+ template<bool stable, typename RandomAccessIterator, typename Comparator>
+ inline void
+ parallel_sort(RandomAccessIterator begin, RandomAccessIterator end,
+ Comparator comp, multiway_mergesort_sampling_tag parallelism)
+ {
+ _GLIBCXX_CALL(end - begin)
+
+ parallel_sort_mwms<stable, false>
+ (begin, end, comp, parallelism.get_num_threads());
+ }
+
+ /**
+ * @brief Choose quicksort for parallel sorting.
+ * @param begin Begin iterator of input sequence.
+ * @param end End iterator of input sequence.
+ * @param comp Comparator.
+ * @callgraph
+ */
+ template<bool stable, typename RandomAccessIterator, typename Comparator>
+ inline void
+ parallel_sort(RandomAccessIterator begin, RandomAccessIterator end,
+ Comparator comp, quicksort_tag parallelism)
+ {
+ _GLIBCXX_CALL(end - begin)
+
+ _GLIBCXX_PARALLEL_ASSERT(stable == false);
+
+ parallel_sort_qs(begin, end, comp, parallelism.get_num_threads());
+ }
+
+ /**
+ * @brief Choose balanced quicksort for parallel sorting.
+ * @param begin Begin iterator of input sequence.
+ * @param end End iterator of input sequence.
+ * @param comp Comparator.
+ * @param stable Sort stable.
+ * @callgraph
+ */
+ template<bool stable, typename RandomAccessIterator, typename Comparator>
+ inline void
+ parallel_sort(RandomAccessIterator begin, RandomAccessIterator end,
+ Comparator comp, balanced_quicksort_tag parallelism)
+ {
+ _GLIBCXX_CALL(end - begin)
+
+ _GLIBCXX_PARALLEL_ASSERT(stable == false);
+
+ parallel_sort_qsb(begin, end, comp, parallelism.get_num_threads());
+ }
+
+
+ /**
+ * @brief Choose multiway mergesort with exact splitting,
+ * for parallel sorting.
+ * @param begin Begin iterator of input sequence.
+ * @param end End iterator of input sequence.
+ * @param comp Comparator.
+ * @callgraph
+ */
+ template<bool stable, typename RandomAccessIterator, typename Comparator>
+ inline void
+ parallel_sort(RandomAccessIterator begin, RandomAccessIterator end,
+ Comparator comp, default_parallel_tag parallelism)
+ {
+ _GLIBCXX_CALL(end - begin)
+
+ parallel_sort<stable>
+ (begin, end, comp,
+ multiway_mergesort_exact_tag(parallelism.get_num_threads()));
+ }
+
+
+ /**
+ * @brief Choose a parallel sorting algorithm.
+ * @param begin Begin iterator of input sequence.
+ * @param end End iterator of input sequence.
+ * @param comp Comparator.
+ * @param stable Sort stable.
+ * @callgraph
+ */
+ template<bool stable, typename RandomAccessIterator, typename Comparator>
+ inline void
+ parallel_sort(RandomAccessIterator begin, RandomAccessIterator end,
+ Comparator comp, parallel_tag parallelism)
+ {
+ _GLIBCXX_CALL(end - begin)
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ if (false) ;
+#if _GLIBCXX_MERGESORT
+ else if (stable || _Settings::get().sort_algorithm == MWMS)
+ {
+ if(_Settings::get().sort_splitting == EXACT)
+ parallel_sort_mwms<stable, true>
+ (begin, end, comp, parallelism.get_num_threads());
+ else
+ parallel_sort_mwms<false, false>
+ (begin, end, comp, parallelism.get_num_threads());
+ }
+#endif
+#if _GLIBCXX_QUICKSORT
+ else if (_Settings::get().sort_algorithm == QS)
+ parallel_sort_qs(begin, end, comp, parallelism.get_num_threads());
+#endif
+#if _GLIBCXX_BAL_QUICKSORT
+ else if (_Settings::get().sort_algorithm == QS_BALANCED)
+ parallel_sort_qsb(begin, end, comp, parallelism.get_num_threads());
+#endif
+ else
+ __gnu_sequential::sort(begin, end, comp);
+ }
+} // end namespace __gnu_parallel
+
+#endif /* _GLIBCXX_PARALLEL_SORT_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/tags.h b/i686-linux/include/c++/4.4.3/parallel/tags.h
new file mode 100644
index 0000000..bc1a7e5
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/tags.h
@@ -0,0 +1,191 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/**
+ * @file parallel/tags.h
+ * @brief Tags for compile-time selection.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler and Felix Putze.
+
+#ifndef _GLIBCXX_PARALLEL_TAGS_H
+#define _GLIBCXX_PARALLEL_TAGS_H 1
+
+#include <omp.h>
+#include <parallel/types.h>
+
+namespace __gnu_parallel
+{
+ /** @brief Forces sequential execution at compile time. */
+ struct sequential_tag { };
+
+ /** @brief Recommends parallel execution at compile time,
+ * optionally using a user-specified number of threads. */
+ struct parallel_tag
+ {
+ private:
+ thread_index_t num_threads;
+
+ public:
+ /** @brief Default constructor. Use default number of threads. */
+ parallel_tag()
+ {
+ this->num_threads = 0;
+ }
+
+ /** @brief Default constructor. Recommend number of threads to use.
+ * @param num_threads Desired number of threads. */
+ parallel_tag(thread_index_t num_threads)
+ {
+ this->num_threads = num_threads;
+ }
+
+ /** @brief Find out desired number of threads.
+ * @return Desired number of threads. */
+ inline thread_index_t get_num_threads()
+ {
+ if(num_threads == 0)
+ return omp_get_max_threads();
+ else
+ return num_threads;
+ }
+
+ /** @brief Set the desired number of threads.
+ * @param num_threads Desired number of threads. */
+ inline void set_num_threads(thread_index_t num_threads)
+ {
+ this->num_threads = num_threads;
+ }
+ };
+
+ /** @brief Recommends parallel execution using the
+ default parallel algorithm. */
+ struct default_parallel_tag : public parallel_tag
+ {
+ default_parallel_tag() { }
+ default_parallel_tag(thread_index_t num_threads)
+ : parallel_tag(num_threads) { }
+ };
+
+ /** @brief Recommends parallel execution using dynamic
+ load-balancing at compile time. */
+ struct balanced_tag : public parallel_tag { };
+
+ /** @brief Recommends parallel execution using static
+ load-balancing at compile time. */
+ struct unbalanced_tag : public parallel_tag { };
+
+ /** @brief Recommends parallel execution using OpenMP dynamic
+ load-balancing at compile time. */
+ struct omp_loop_tag : public parallel_tag { };
+
+ /** @brief Recommends parallel execution using OpenMP static
+ load-balancing at compile time. */
+ struct omp_loop_static_tag : public parallel_tag { };
+
+
+ /** @brief Base class for for std::find() variants. */
+ struct find_tag { };
+
+
+ /** @brief Forces parallel merging
+ * with exact splitting, at compile time. */
+ struct exact_tag : public parallel_tag
+ {
+ exact_tag() { }
+ exact_tag(thread_index_t num_threads)
+ : parallel_tag(num_threads) { }
+ };
+
+ /** @brief Forces parallel merging
+ * with exact splitting, at compile time. */
+ struct sampling_tag : public parallel_tag
+ {
+ sampling_tag() { }
+ sampling_tag(thread_index_t num_threads)
+ : parallel_tag(num_threads) { }
+ };
+
+
+ /** @brief Forces parallel sorting using multiway mergesort
+ * at compile time. */
+ struct multiway_mergesort_tag : public parallel_tag
+ {
+ multiway_mergesort_tag() { }
+ multiway_mergesort_tag(thread_index_t num_threads)
+ : parallel_tag(num_threads) { }
+ };
+
+ /** @brief Forces parallel sorting using multiway mergesort
+ * with exact splitting at compile time. */
+ struct multiway_mergesort_exact_tag : public parallel_tag
+ {
+ multiway_mergesort_exact_tag() { }
+ multiway_mergesort_exact_tag(thread_index_t num_threads)
+ : parallel_tag(num_threads) { }
+ };
+
+ /** @brief Forces parallel sorting using multiway mergesort
+ * with splitting by sampling at compile time. */
+ struct multiway_mergesort_sampling_tag : public parallel_tag
+ {
+ multiway_mergesort_sampling_tag() { }
+ multiway_mergesort_sampling_tag(thread_index_t num_threads)
+ : parallel_tag(num_threads) { }
+ };
+
+ /** @brief Forces parallel sorting using unbalanced quicksort
+ * at compile time. */
+ struct quicksort_tag : public parallel_tag
+ {
+ quicksort_tag() { }
+ quicksort_tag(thread_index_t num_threads)
+ : parallel_tag(num_threads) { }
+ };
+
+ /** @brief Forces parallel sorting using balanced quicksort
+ * at compile time. */
+ struct balanced_quicksort_tag : public parallel_tag
+ {
+ balanced_quicksort_tag() { }
+ balanced_quicksort_tag(thread_index_t num_threads)
+ : parallel_tag(num_threads) { }
+ };
+
+
+ /** @brief Selects the growing block size variant for std::find().
+ @see _GLIBCXX_FIND_GROWING_BLOCKS */
+ struct growing_blocks_tag : public find_tag { };
+
+ /** @brief Selects the constant block size variant for std::find().
+ @see _GLIBCXX_FIND_CONSTANT_SIZE_BLOCKS */
+ struct constant_size_blocks_tag : public find_tag { };
+
+ /** @brief Selects the equal splitting variant for std::find().
+ @see _GLIBCXX_FIND_EQUAL_SPLIT */
+ struct equal_split_tag : public find_tag { };
+}
+
+#endif /* _GLIBCXX_PARALLEL_TAGS_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/types.h b/i686-linux/include/c++/4.4.3/parallel/types.h
new file mode 100644
index 0000000..053dfff
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/types.h
@@ -0,0 +1,155 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/types.h
+ * @brief Basic types and typedefs.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler and Felix Putze.
+
+#ifndef _GLIBCXX_PARALLEL_TYPES_H
+#define _GLIBCXX_PARALLEL_TYPES_H 1
+
+#include <cstdlib>
+
+namespace __gnu_parallel
+{
+ // Enumerated types.
+
+ /// Run-time equivalents for the compile-time tags.
+ enum _Parallelism
+ {
+ /// Not parallel.
+ sequential,
+
+ /// Parallel unbalanced (equal-sized chunks).
+ parallel_unbalanced,
+
+ /// Parallel balanced (work-stealing).
+ parallel_balanced,
+
+ /// Parallel with OpenMP dynamic load-balancing.
+ parallel_omp_loop,
+
+ /// Parallel with OpenMP static load-balancing.
+ parallel_omp_loop_static,
+
+ /// Parallel with OpenMP taskqueue construct.
+ parallel_taskqueue
+ };
+
+ /// Strategies for run-time algorithm selection:
+ // force_sequential, force_parallel, heuristic.
+ enum _AlgorithmStrategy
+ {
+ heuristic,
+ force_sequential,
+ force_parallel
+ };
+
+ /// Sorting algorithms:
+ // multi-way mergesort, quicksort, load-balanced quicksort.
+ enum _SortAlgorithm
+ {
+ MWMS,
+ QS,
+ QS_BALANCED
+ };
+
+ /// Merging algorithms:
+ // bubblesort-alike, loser-tree variants, enum sentinel.
+ enum _MultiwayMergeAlgorithm
+ {
+ LOSER_TREE
+ };
+
+ /// Partial sum algorithms: recursive, linear.
+ enum _PartialSumAlgorithm
+ {
+ RECURSIVE,
+ LINEAR
+ };
+
+ /// Sorting/merging algorithms: sampling, exact.
+ enum _SplittingAlgorithm
+ {
+ SAMPLING,
+ EXACT
+ };
+
+ /// Find algorithms:
+ // growing blocks, equal-sized blocks, equal splitting.
+ enum _FindAlgorithm
+ {
+ GROWING_BLOCKS,
+ CONSTANT_SIZE_BLOCKS,
+ EQUAL_SPLIT
+ };
+
+ /// Integer Types.
+ // XXX need to use <cstdint>
+ /** @brief 16-bit signed integer. */
+ typedef short int16;
+
+ /** @brief 16-bit unsigned integer. */
+ typedef unsigned short uint16;
+
+ /** @brief 32-bit signed integer. */
+ typedef int int32;
+
+ /** @brief 32-bit unsigned integer. */
+ typedef unsigned int uint32;
+
+ /** @brief 64-bit signed integer. */
+ typedef long long int64;
+
+ /** @brief 64-bit unsigned integer. */
+ typedef unsigned long long uint64;
+
+ /**
+ * @brief Unsigned integer to index elements.
+ * The total number of elements for each algorithm must fit into this type.
+ */
+ typedef uint64 sequence_index_t;
+
+ /**
+ * @brief Unsigned integer to index a thread number.
+ * The maximum thread number (for each processor) must fit into this type.
+ */
+ typedef uint16 thread_index_t;
+
+ // XXX atomics interface?
+ /// Longest compare-and-swappable integer type on this platform.
+ typedef int64 lcas_t;
+
+ // XXX numeric_limits::digits?
+ /// Number of bits of ::lcas_t.
+ static const int lcas_t_bits = sizeof(lcas_t) * 8;
+
+ /// ::lcas_t with the right half of bits set to 1.
+ static const lcas_t lcas_t_mask = ((lcas_t(1) << (lcas_t_bits / 2)) - 1);
+}
+
+#endif /* _GLIBCXX_PARALLEL_TYPES_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/unique_copy.h b/i686-linux/include/c++/4.4.3/parallel/unique_copy.h
new file mode 100644
index 0000000..a83c2c0
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/unique_copy.h
@@ -0,0 +1,192 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/unique_copy.h
+ * @brief Parallel implementations of std::unique_copy().
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Robert Geisberger and Robin Dapp.
+
+#ifndef _GLIBCXX_PARALLEL_UNIQUE_COPY_H
+#define _GLIBCXX_PARALLEL_UNIQUE_COPY_H 1
+
+#include <parallel/parallel.h>
+#include <parallel/multiseq_selection.h>
+
+namespace __gnu_parallel
+{
+
+/** @brief Parallel std::unique_copy(), w/o explicit equality predicate.
+ * @param first Begin iterator of input sequence.
+ * @param last End iterator of input sequence.
+ * @param result Begin iterator of result sequence.
+ * @param binary_pred Equality predicate.
+ * @return End iterator of result sequence. */
+template<typename InputIterator,
+ class OutputIterator,
+ class BinaryPredicate>
+ OutputIterator
+ parallel_unique_copy(InputIterator first, InputIterator last,
+ OutputIterator result, BinaryPredicate binary_pred)
+ {
+ _GLIBCXX_CALL(last - first)
+
+ typedef std::iterator_traits<InputIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ difference_type size = last - first;
+
+ if (size == 0)
+ return result;
+
+ // Let the first thread process two parts.
+ difference_type *counter;
+ difference_type *borders;
+
+ thread_index_t num_threads = get_max_threads();
+ // First part contains at least one element.
+# pragma omp parallel num_threads(num_threads)
+ {
+# pragma omp single
+ {
+ num_threads = omp_get_num_threads();
+ borders = new difference_type[num_threads + 2];
+ equally_split(size, num_threads + 1, borders);
+ counter = new difference_type[num_threads + 1];
+ }
+
+ thread_index_t iam = omp_get_thread_num();
+
+ difference_type begin, end;
+
+ // Check for length without duplicates
+ // Needed for position in output
+ difference_type i = 0;
+ OutputIterator out = result;
+
+ if (iam == 0)
+ {
+ begin = borders[0] + 1; // == 1
+ end = borders[iam + 1];
+
+ ++i;
+ *out++ = *first;
+
+ for (InputIterator iter = first + begin; iter < first + end; ++iter)
+ {
+ if (!binary_pred(*iter, *(iter-1)))
+ {
+ ++i;
+ *out++ = *iter;
+ }
+ }
+ }
+ else
+ {
+ begin = borders[iam]; //one part
+ end = borders[iam + 1];
+
+ for (InputIterator iter = first + begin; iter < first + end; ++iter)
+ {
+ if (!binary_pred(*iter, *(iter - 1)))
+ ++i;
+ }
+ }
+ counter[iam] = i;
+
+ // Last part still untouched.
+ difference_type begin_output;
+
+# pragma omp barrier
+
+ // Store result in output on calculated positions.
+ begin_output = 0;
+
+ if (iam == 0)
+ {
+ for (int t = 0; t < num_threads; ++t)
+ begin_output += counter[t];
+
+ i = 0;
+
+ OutputIterator iter_out = result + begin_output;
+
+ begin = borders[num_threads];
+ end = size;
+
+ for (InputIterator iter = first + begin; iter < first + end; ++iter)
+ {
+ if (iter == first || !binary_pred(*iter, *(iter - 1)))
+ {
+ ++i;
+ *iter_out++ = *iter;
+ }
+ }
+
+ counter[num_threads] = i;
+ }
+ else
+ {
+ for (int t = 0; t < iam; t++)
+ begin_output += counter[t];
+
+ OutputIterator iter_out = result + begin_output;
+ for (InputIterator iter = first + begin; iter < first + end; ++iter)
+ {
+ if (!binary_pred(*iter, *(iter-1)))
+ *iter_out++ = *iter;
+ }
+ }
+ }
+
+ difference_type end_output = 0;
+ for (int t = 0; t < num_threads + 1; t++)
+ end_output += counter[t];
+
+ delete[] borders;
+
+ return result + end_output;
+ }
+
+/** @brief Parallel std::unique_copy(), without explicit equality predicate
+ * @param first Begin iterator of input sequence.
+ * @param last End iterator of input sequence.
+ * @param result Begin iterator of result sequence.
+ * @return End iterator of result sequence. */
+template<typename InputIterator, class OutputIterator>
+ inline OutputIterator
+ parallel_unique_copy(InputIterator first, InputIterator last,
+ OutputIterator result)
+ {
+ typedef typename std::iterator_traits<InputIterator>::value_type
+ value_type;
+ return parallel_unique_copy(first, last, result,
+ std::equal_to<value_type>());
+ }
+
+}//namespace __gnu_parallel
+
+#endif /* _GLIBCXX_PARALLEL_UNIQUE_COPY_H */
diff --git a/i686-linux/include/c++/4.4.3/parallel/workstealing.h b/i686-linux/include/c++/4.4.3/parallel/workstealing.h
new file mode 100644
index 0000000..b82fe7c
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/parallel/workstealing.h
@@ -0,0 +1,306 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/workstealing.h
+ * @brief Parallelization of embarrassingly parallel execution by
+ * means of work-stealing.
+ *
+ * Work stealing is described in
+ *
+ * R. D. Blumofe and C. E. Leiserson.
+ * Scheduling multithreaded computations by work stealing.
+ * Journal of the ACM, 46(5):720–748, 1999.
+ *
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Felix Putze.
+
+#ifndef _GLIBCXX_PARALLEL_WORKSTEALING_H
+#define _GLIBCXX_PARALLEL_WORKSTEALING_H 1
+
+#include <parallel/parallel.h>
+#include <parallel/random_number.h>
+#include <parallel/compatibility.h>
+
+namespace __gnu_parallel
+{
+
+#define _GLIBCXX_JOB_VOLATILE volatile
+
+/** @brief One job for a certain thread. */
+template<typename _DifferenceTp>
+ struct Job
+ {
+ typedef _DifferenceTp difference_type;
+
+ /** @brief First element.
+ *
+ * Changed by owning and stealing thread. By stealing thread,
+ * always incremented. */
+ _GLIBCXX_JOB_VOLATILE difference_type first;
+
+ /** @brief Last element.
+ *
+ * Changed by owning thread only. */
+ _GLIBCXX_JOB_VOLATILE difference_type last;
+
+ /** @brief Number of elements, i. e. @c last-first+1.
+ *
+ * Changed by owning thread only. */
+ _GLIBCXX_JOB_VOLATILE difference_type load;
+ };
+
+/** @brief Work stealing algorithm for random access iterators.
+ *
+ * Uses O(1) additional memory. Synchronization at job lists is
+ * done with atomic operations.
+ * @param begin Begin iterator of element sequence.
+ * @param end End iterator of element sequence.
+ * @param op User-supplied functor (comparator, predicate, adding
+ * functor, ...).
+ * @param f Functor to "process" an element with op (depends on
+ * desired functionality, e. g. for std::for_each(), ...).
+ * @param r Functor to "add" a single result to the already
+ * processed elements (depends on functionality).
+ * @param base Base value for reduction.
+ * @param output Pointer to position where final result is written to
+ * @param bound Maximum number of elements processed (e. g. for
+ * std::count_n()).
+ * @return User-supplied functor (that may contain a part of the result).
+ */
+template<typename RandomAccessIterator,
+ typename Op,
+ typename Fu,
+ typename Red,
+ typename Result>
+ Op
+ for_each_template_random_access_workstealing(RandomAccessIterator begin,
+ RandomAccessIterator end,
+ Op op, Fu& f, Red r,
+ Result base, Result& output,
+ typename std::iterator_traits
+ <RandomAccessIterator>::
+ difference_type bound)
+ {
+ _GLIBCXX_CALL(end - begin)
+
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ const _Settings& __s = _Settings::get();
+
+ difference_type chunk_size = static_cast<difference_type>(__s.workstealing_chunk_size);
+
+ // How many jobs?
+ difference_type length = (bound < 0) ? (end - begin) : bound;
+
+ // To avoid false sharing in a cache line.
+ const int stride = __s.cache_line_size * 10 / sizeof(Job<difference_type>) + 1;
+
+ // Total number of threads currently working.
+ thread_index_t busy = 0;
+
+ Job<difference_type> *job;
+
+ omp_lock_t output_lock;
+ omp_init_lock(&output_lock);
+
+ // Write base value to output.
+ output = base;
+
+ // No more threads than jobs, at least one thread.
+ thread_index_t num_threads =
+ __gnu_parallel::max<thread_index_t>(1,
+ __gnu_parallel::min<difference_type>(length, get_max_threads()));
+
+# pragma omp parallel shared(busy) num_threads(num_threads)
+ {
+
+# pragma omp single
+ {
+ num_threads = omp_get_num_threads();
+
+ // Create job description array.
+ job = new Job<difference_type>[num_threads * stride];
+ }
+
+ // Initialization phase.
+
+ // Flags for every thread if it is doing productive work.
+ bool iam_working = false;
+
+ // Thread id.
+ thread_index_t iam = omp_get_thread_num();
+
+ // This job.
+ Job<difference_type>& my_job = job[iam * stride];
+
+ // Random number (for work stealing).
+ thread_index_t victim;
+
+ // Local value for reduction.
+ Result result = Result();
+
+ // Number of elements to steal in one attempt.
+ difference_type steal;
+
+ // Every thread has its own random number generator
+ // (modulo num_threads).
+ random_number rand_gen(iam, num_threads);
+
+ // This thread is currently working.
+# pragma omp atomic
+ ++busy;
+
+ iam_working = true;
+
+ // How many jobs per thread? last thread gets the rest.
+ my_job.first =
+ static_cast<difference_type>(iam * (length / num_threads));
+
+ my_job.last = (iam == (num_threads - 1)) ?
+ (length - 1) : ((iam + 1) * (length / num_threads) - 1);
+ my_job.load = my_job.last - my_job.first + 1;
+
+ // Init result with first value (to have a base value for reduction).
+ if (my_job.first <= my_job.last)
+ {
+ // Cannot use volatile variable directly.
+ difference_type my_first = my_job.first;
+ result = f(op, begin + my_first);
+ ++my_job.first;
+ --my_job.load;
+ }
+
+ RandomAccessIterator current;
+
+# pragma omp barrier
+
+ // Actual work phase
+ // Work on own or stolen start
+ while (busy > 0)
+ {
+ // Work until no productive thread left.
+# pragma omp flush(busy)
+
+ // Thread has own work to do
+ while (my_job.first <= my_job.last)
+ {
+ // fetch-and-add call
+ // Reserve current job block (size chunk_size) in my queue.
+ difference_type current_job =
+ fetch_and_add<difference_type>(&(my_job.first), chunk_size);
+
+ // Update load, to make the three values consistent,
+ // first might have been changed in the meantime
+ my_job.load = my_job.last - my_job.first + 1;
+ for (difference_type job_counter = 0;
+ job_counter < chunk_size && current_job <= my_job.last;
+ ++job_counter)
+ {
+ // Yes: process it!
+ current = begin + current_job;
+ ++current_job;
+
+ // Do actual work.
+ result = r(result, f(op, current));
+ }
+
+# pragma omp flush(busy)
+ }
+
+ // After reaching this point, a thread's job list is empty.
+ if (iam_working)
+ {
+ // This thread no longer has work.
+# pragma omp atomic
+ --busy;
+
+ iam_working = false;
+ }
+
+ difference_type supposed_first, supposed_last, supposed_load;
+ do
+ {
+ // Find random nonempty deque (not own), do consistency check.
+ yield();
+# pragma omp flush(busy)
+ victim = rand_gen();
+ supposed_first = job[victim * stride].first;
+ supposed_last = job[victim * stride].last;
+ supposed_load = job[victim * stride].load;
+ }
+ while (busy > 0
+ && ((supposed_load <= 0)
+ || ((supposed_first + supposed_load - 1) != supposed_last)));
+
+ if (busy == 0)
+ break;
+
+ if (supposed_load > 0)
+ {
+ // Has work and work to do.
+ // Number of elements to steal (at least one).
+ steal = (supposed_load < 2) ? 1 : supposed_load / 2;
+
+ // Push victim's start forward.
+ difference_type stolen_first =
+ fetch_and_add<difference_type>(
+ &(job[victim * stride].first), steal);
+ difference_type stolen_try =
+ stolen_first + steal - difference_type(1);
+
+ my_job.first = stolen_first;
+ my_job.last = __gnu_parallel::min(stolen_try, supposed_last);
+ my_job.load = my_job.last - my_job.first + 1;
+
+ // Has potential work again.
+# pragma omp atomic
+ ++busy;
+ iam_working = true;
+
+# pragma omp flush(busy)
+ }
+# pragma omp flush(busy)
+ } // end while busy > 0
+ // Add accumulated result to output.
+ omp_set_lock(&output_lock);
+ output = r(output, result);
+ omp_unset_lock(&output_lock);
+ }
+
+ delete[] job;
+
+ // Points to last element processed (needed as return value for
+ // some algorithms like transform)
+ f.finish_iterator = begin + length;
+
+ omp_destroy_lock(&output_lock);
+
+ return op;
+ }
+} // end namespace
+
+#endif /* _GLIBCXX_PARALLEL_WORKSTEALING_H */
diff --git a/i686-linux/include/c++/4.4.3/queue b/i686-linux/include/c++/4.4.3/queue
new file mode 100644
index 0000000..abf9842
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/queue
@@ -0,0 +1,67 @@
+// <queue> -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file include/queue
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_QUEUE
+#define _GLIBCXX_QUEUE 1
+
+#pragma GCC system_header
+
+#include <deque>
+#include <vector>
+#include <bits/stl_heap.h>
+#include <bits/stl_function.h>
+#include <bits/stl_queue.h>
+
+#endif /* _GLIBCXX_QUEUE */
diff --git a/i686-linux/include/c++/4.4.3/random b/i686-linux/include/c++/4.4.3/random
new file mode 100644
index 0000000..1cb968c
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/random
@@ -0,0 +1,70 @@
+// <random> -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/random
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_RANDOM
+#define _GLIBCXX_RANDOM 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#else
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+#endif
+
+#include <cmath>
+#include <cstdio>
+#include <cstdlib>
+#include <string>
+#include <iosfwd>
+#include <limits>
+#include <ext/type_traits.h>
+#include <ext/numeric_traits.h>
+#include <bits/concept_check.h>
+#include <debug/debug.h>
+#include <type_traits>
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/random>
+#else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/random>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+#endif
+
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+#endif // _GLIBCXX_RANDOM
diff --git a/i686-linux/include/c++/4.4.3/ratio b/i686-linux/include/c++/4.4.3/ratio
new file mode 100644
index 0000000..f0e8831
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/ratio
@@ -0,0 +1,303 @@
+// ratio -*- C++ -*-
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ratio
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_RATIO
+#define _GLIBCXX_RATIO 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#else
+
+#include <type_traits>
+#include <cstdint>
+
+#ifdef _GLIBCXX_USE_C99_STDINT_TR1
+
+namespace std
+{
+ /**
+ * @defgroup ratio Rational Arithmetic
+ * @ingroup utilities
+ *
+ * Compile time representation of fininte rational numbers.
+ * @{
+ */
+
+ template<intmax_t _Pn>
+ struct __static_sign
+ : integral_constant<intmax_t, (_Pn < 0) ? -1 : 1>
+ { };
+
+ template<intmax_t _Pn>
+ struct __static_abs
+ : integral_constant<intmax_t, _Pn * __static_sign<_Pn>::value>
+ { };
+
+ template<intmax_t _Pn, intmax_t _Qn>
+ struct __static_gcd;
+
+ template<intmax_t _Pn, intmax_t _Qn>
+ struct __static_gcd
+ : __static_gcd<_Qn, (_Pn % _Qn)>
+ { };
+
+ template<intmax_t _Pn>
+ struct __static_gcd<_Pn, 0>
+ : integral_constant<intmax_t, __static_abs<_Pn>::value>
+ { };
+
+ template<intmax_t _Qn>
+ struct __static_gcd<0, _Qn>
+ : integral_constant<intmax_t, __static_abs<_Qn>::value>
+ { };
+
+ // Let c = 2^(half # of bits in an intmax_t)
+ // then we find a1, a0, b1, b0 s.t. N = a1*c + a0, M = b1*c + b0
+ // The multiplication of N and M becomes,
+ // N * M = (a1 * b1)c^2 + (a0 * b1 + b0 * a1)c + a0 * b0
+ // Multiplication is safe if each term and the sum of the terms
+ // is representable by intmax_t.
+ template<intmax_t _Pn, intmax_t _Qn>
+ struct __safe_multiply
+ {
+ private:
+ static const uintmax_t __c = uintmax_t(1) << (sizeof(intmax_t) * 4);
+
+ static const uintmax_t __a0 = __static_abs<_Pn>::value % __c;
+ static const uintmax_t __a1 = __static_abs<_Pn>::value / __c;
+ static const uintmax_t __b0 = __static_abs<_Qn>::value % __c;
+ static const uintmax_t __b1 = __static_abs<_Qn>::value / __c;
+
+ static_assert(__a1 == 0 || __b1 == 0,
+ "overflow in multiplication");
+ static_assert(__a0 * __b1 + __b0 * __a1 < (__c >> 1),
+ "overflow in multiplication");
+ static_assert(__b0 * __a0 <= __INTMAX_MAX__,
+ "overflow in multiplication");
+ static_assert((__a0 * __b1 + __b0 * __a1) * __c <=
+ __INTMAX_MAX__ - __b0 * __a0, "overflow in multiplication");
+
+ public:
+ static const intmax_t value = _Pn * _Qn;
+ };
+
+ // Helpers for __safe_add
+ template<intmax_t _Pn, intmax_t _Qn, bool>
+ struct __add_overflow_check_impl
+ : integral_constant<bool, (_Pn <= __INTMAX_MAX__ - _Qn)>
+ { };
+
+ template<intmax_t _Pn, intmax_t _Qn>
+ struct __add_overflow_check_impl<_Pn, _Qn, false>
+ : integral_constant<bool, (_Pn >= -__INTMAX_MAX__ - _Qn)>
+ { };
+
+ template<intmax_t _Pn, intmax_t _Qn>
+ struct __add_overflow_check
+ : __add_overflow_check_impl<_Pn, _Qn, (_Qn >= 0)>
+ { };
+
+ template<intmax_t _Pn, intmax_t _Qn>
+ struct __safe_add
+ {
+ static_assert(__add_overflow_check<_Pn, _Qn>::value != 0,
+ "overflow in addition");
+
+ static const intmax_t value = _Pn + _Qn;
+ };
+
+ /**
+ * @brief Provides compile-time rational arithmetic.
+ *
+ * This class template represents any finite rational number with a
+ * numerator and denominator representable by compile-time constants of
+ * type intmax_t. The ratio is simplified when instantiated.
+ *
+ * For example:
+ * @code
+ * std::ratio<7,-21>::num == -1;
+ * std::ratio<7,-21>::den == 3;
+ * @endcode
+ *
+ */
+ template<intmax_t _Num, intmax_t _Den = 1>
+ struct ratio
+ {
+ static_assert(_Den != 0, "denominator cannot be zero");
+ static_assert(_Num >= -__INTMAX_MAX__ && _Den >= -__INTMAX_MAX__,
+ "out of range");
+
+ // Note: sign(N) * abs(N) == N
+ static const intmax_t num =
+ _Num * __static_sign<_Den>::value / __static_gcd<_Num, _Den>::value;
+
+ static const intmax_t den =
+ __static_abs<_Den>::value / __static_gcd<_Num, _Den>::value;
+ };
+
+ template<intmax_t _Num, intmax_t _Den>
+ const intmax_t ratio<_Num, _Den>::num;
+
+ template<intmax_t _Num, intmax_t _Den>
+ const intmax_t ratio<_Num, _Den>::den;
+
+ /// ratio_add
+ template<typename _R1, typename _R2>
+ struct ratio_add
+ {
+ private:
+ static const intmax_t __gcd =
+ __static_gcd<_R1::den, _R2::den>::value;
+
+ public:
+ typedef ratio<
+ __safe_add<
+ __safe_multiply<_R1::num, (_R2::den / __gcd)>::value,
+ __safe_multiply<_R2::num, (_R1::den / __gcd)>::value>::value,
+ __safe_multiply<_R1::den, (_R2::den / __gcd)>::value> type;
+ };
+
+ /// ratio_subtract
+ template<typename _R1, typename _R2>
+ struct ratio_subtract
+ {
+ typedef typename ratio_add<
+ _R1,
+ ratio<-_R2::num, _R2::den>>::type type;
+ };
+
+ /// ratio_multiply
+ template<typename _R1, typename _R2>
+ struct ratio_multiply
+ {
+ private:
+ static const intmax_t __gcd1 =
+ __static_gcd<_R1::num, _R2::den>::value;
+ static const intmax_t __gcd2 =
+ __static_gcd<_R2::num, _R1::den>::value;
+
+ public:
+ typedef ratio<
+ __safe_multiply<(_R1::num / __gcd1),
+ (_R2::num / __gcd2)>::value,
+ __safe_multiply<(_R1::den / __gcd2),
+ (_R2::den / __gcd1)>::value> type;
+ };
+
+ /// ratio_divide
+ template<typename _R1, typename _R2>
+ struct ratio_divide
+ {
+ static_assert(_R2::num != 0, "division by 0");
+
+ typedef typename ratio_multiply<
+ _R1,
+ ratio<_R2::den, _R2::num>>::type type;
+ };
+
+ /// ratio_equal
+ template<typename _R1, typename _R2>
+ struct ratio_equal
+ : integral_constant<bool, _R1::num == _R2::num && _R1::den == _R2::den>
+ { };
+
+ /// ratio_not_equal
+ template<typename _R1, typename _R2>
+ struct ratio_not_equal
+ : integral_constant<bool, !ratio_equal<_R1, _R2>::value>
+ { };
+
+ template<typename _R1, typename _R2>
+ struct __ratio_less_simple_impl
+ : integral_constant<bool,
+ (__safe_multiply<_R1::num, _R2::den>::value
+ < __safe_multiply<_R2::num, _R1::den>::value)>
+ { };
+
+ // If the denominators are equal or the signs differ, we can just compare
+ // numerators, otherwise fallback to the simple cross-multiply method.
+ template<typename _R1, typename _R2>
+ struct __ratio_less_impl
+ : conditional<(_R1::den == _R2::den
+ || (__static_sign<_R1::num>::value
+ != __static_sign<_R2::num>::value)),
+ integral_constant<bool, (_R1::num < _R2::num)>,
+ __ratio_less_simple_impl<_R1, _R2>>::type
+ { };
+
+ /// ratio_less
+ template<typename _R1, typename _R2>
+ struct ratio_less
+ : __ratio_less_impl<_R1, _R2>::type
+ { };
+
+ /// ratio_less_equal
+ template<typename _R1, typename _R2>
+ struct ratio_less_equal
+ : integral_constant<bool, !ratio_less<_R2, _R1>::value>
+ { };
+
+ /// ratio_greater
+ template<typename _R1, typename _R2>
+ struct ratio_greater
+ : integral_constant<bool, ratio_less<_R2, _R1>::value>
+ { };
+
+ /// ratio_greater_equal
+ template<typename _R1, typename _R2>
+ struct ratio_greater_equal
+ : integral_constant<bool, !ratio_less<_R1, _R2>::value>
+ { };
+
+ typedef ratio<1, 1000000000000000000> atto;
+ typedef ratio<1, 1000000000000000> femto;
+ typedef ratio<1, 1000000000000> pico;
+ typedef ratio<1, 1000000000> nano;
+ typedef ratio<1, 1000000> micro;
+ typedef ratio<1, 1000> milli;
+ typedef ratio<1, 100> centi;
+ typedef ratio<1, 10> deci;
+ typedef ratio< 10, 1> deca;
+ typedef ratio< 100, 1> hecto;
+ typedef ratio< 1000, 1> kilo;
+ typedef ratio< 1000000, 1> mega;
+ typedef ratio< 1000000000, 1> giga;
+ typedef ratio< 1000000000000, 1> tera;
+ typedef ratio< 1000000000000000, 1> peta;
+ typedef ratio< 1000000000000000000, 1> exa;
+
+ // @} group ratio
+}
+
+#endif //_GLIBCXX_USE_C99_STDINT_TR1
+
+#endif //__GXX_EXPERIMENTAL_CXX0X__
+
+#endif //_GLIBCXX_RATIO
diff --git a/i686-linux/include/c++/4.4.3/regex b/i686-linux/include/c++/4.4.3/regex
new file mode 100644
index 0000000..3b25044
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/regex
@@ -0,0 +1,68 @@
+// <regex> -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/regex
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_REGEX
+#define _GLIBCXX_REGEX 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#else
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+#endif
+
+#include <algorithm>
+#include <bitset>
+#include <iterator>
+#include <locale>
+#include <stdexcept>
+#include <string>
+#include <vector>
+#include <utility>
+#include <sstream>
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/regex>
+#else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/regex>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+#endif
+
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+#endif // _GLIBCXX_REGEX
diff --git a/i686-linux/include/c++/4.4.3/set b/i686-linux/include/c++/4.4.3/set
new file mode 100644
index 0000000..21e3f5a
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/set
@@ -0,0 +1,68 @@
+// <set> -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file include/set
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_SET
+#define _GLIBCXX_SET 1
+
+#pragma GCC system_header
+
+#include <bits/stl_tree.h>
+#include <bits/stl_set.h>
+#include <bits/stl_multiset.h>
+
+#ifdef _GLIBCXX_DEBUG
+# include <debug/set>
+#endif
+
+#endif /* _GLIBCXX_SET */
diff --git a/i686-linux/include/c++/4.4.3/sstream b/i686-linux/include/c++/4.4.3/sstream
new file mode 100644
index 0000000..f5e3191
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/sstream
@@ -0,0 +1,576 @@
+// String based streams -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file sstream
+ * This is a Standard C++ Library header.
+ */
+
+//
+// ISO C++ 14882: 27.7 String-based streams
+//
+
+#ifndef _GLIBCXX_SSTREAM
+#define _GLIBCXX_SSTREAM 1
+
+#pragma GCC system_header
+
+#include <istream>
+#include <ostream>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // [27.7.1] template class basic_stringbuf
+ /**
+ * @brief The actual work of input and output (for std::string).
+ * @ingroup io
+ *
+ * This class associates either or both of its input and output sequences
+ * with a sequence of characters, which can be initialized from, or made
+ * available as, a @c std::basic_string. (Paraphrased from [27.7.1]/1.)
+ *
+ * For this class, open modes (of type @c ios_base::openmode) have
+ * @c in set if the input sequence can be read, and @c out set if the
+ * output sequence can be written.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ class basic_stringbuf : public basic_streambuf<_CharT, _Traits>
+ {
+ public:
+ // Types:
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 251. basic_stringbuf missing allocator_type
+ typedef _Alloc allocator_type;
+ typedef typename traits_type::int_type int_type;
+ typedef typename traits_type::pos_type pos_type;
+ typedef typename traits_type::off_type off_type;
+
+ typedef basic_streambuf<char_type, traits_type> __streambuf_type;
+ typedef basic_string<char_type, _Traits, _Alloc> __string_type;
+ typedef typename __string_type::size_type __size_type;
+
+ protected:
+ /// Place to stash in || out || in | out settings for current stringbuf.
+ ios_base::openmode _M_mode;
+
+ // Data Members:
+ __string_type _M_string;
+
+ public:
+ // Constructors:
+ /**
+ * @brief Starts with an empty string buffer.
+ * @param mode Whether the buffer can read, or write, or both.
+ *
+ * The default constructor initializes the parent class using its
+ * own default ctor.
+ */
+ explicit
+ basic_stringbuf(ios_base::openmode __mode = ios_base::in | ios_base::out)
+ : __streambuf_type(), _M_mode(__mode), _M_string()
+ { }
+
+ /**
+ * @brief Starts with an existing string buffer.
+ * @param str A string to copy as a starting buffer.
+ * @param mode Whether the buffer can read, or write, or both.
+ *
+ * This constructor initializes the parent class using its
+ * own default ctor.
+ */
+ explicit
+ basic_stringbuf(const __string_type& __str,
+ ios_base::openmode __mode = ios_base::in | ios_base::out)
+ : __streambuf_type(), _M_mode(), _M_string(__str.data(), __str.size())
+ { _M_stringbuf_init(__mode); }
+
+ // Get and set:
+ /**
+ * @brief Copying out the string buffer.
+ * @return A copy of one of the underlying sequences.
+ *
+ * "If the buffer is only created in input mode, the underlying
+ * character sequence is equal to the input sequence; otherwise, it
+ * is equal to the output sequence." [27.7.1.2]/1
+ */
+ __string_type
+ str() const
+ {
+ __string_type __ret;
+ if (this->pptr())
+ {
+ // The current egptr() may not be the actual string end.
+ if (this->pptr() > this->egptr())
+ __ret = __string_type(this->pbase(), this->pptr());
+ else
+ __ret = __string_type(this->pbase(), this->egptr());
+ }
+ else
+ __ret = _M_string;
+ return __ret;
+ }
+
+ /**
+ * @brief Setting a new buffer.
+ * @param s The string to use as a new sequence.
+ *
+ * Deallocates any previous stored sequence, then copies @a s to
+ * use as a new one.
+ */
+ void
+ str(const __string_type& __s)
+ {
+ // Cannot use _M_string = __s, since v3 strings are COW.
+ _M_string.assign(__s.data(), __s.size());
+ _M_stringbuf_init(_M_mode);
+ }
+
+ protected:
+ // Common initialization code goes here.
+ void
+ _M_stringbuf_init(ios_base::openmode __mode)
+ {
+ _M_mode = __mode;
+ __size_type __len = 0;
+ if (_M_mode & (ios_base::ate | ios_base::app))
+ __len = _M_string.size();
+ _M_sync(const_cast<char_type*>(_M_string.data()), 0, __len);
+ }
+
+ virtual streamsize
+ showmanyc()
+ {
+ streamsize __ret = -1;
+ if (_M_mode & ios_base::in)
+ {
+ _M_update_egptr();
+ __ret = this->egptr() - this->gptr();
+ }
+ return __ret;
+ }
+
+ virtual int_type
+ underflow();
+
+ virtual int_type
+ pbackfail(int_type __c = traits_type::eof());
+
+ virtual int_type
+ overflow(int_type __c = traits_type::eof());
+
+ /**
+ * @brief Manipulates the buffer.
+ * @param s Pointer to a buffer area.
+ * @param n Size of @a s.
+ * @return @c this
+ *
+ * If no buffer has already been created, and both @a s and @a n are
+ * non-zero, then @c s is used as a buffer; see
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt11ch25s02.html
+ * for more.
+ */
+ virtual __streambuf_type*
+ setbuf(char_type* __s, streamsize __n)
+ {
+ if (__s && __n >= 0)
+ {
+ // This is implementation-defined behavior, and assumes
+ // that an external char_type array of length __n exists
+ // and has been pre-allocated. If this is not the case,
+ // things will quickly blow up.
+
+ // Step 1: Destroy the current internal array.
+ _M_string.clear();
+
+ // Step 2: Use the external array.
+ _M_sync(__s, __n, 0);
+ }
+ return this;
+ }
+
+ virtual pos_type
+ seekoff(off_type __off, ios_base::seekdir __way,
+ ios_base::openmode __mode = ios_base::in | ios_base::out);
+
+ virtual pos_type
+ seekpos(pos_type __sp,
+ ios_base::openmode __mode = ios_base::in | ios_base::out);
+
+ // Internal function for correctly updating the internal buffer
+ // for a particular _M_string, due to initialization or re-sizing
+ // of an existing _M_string.
+ void
+ _M_sync(char_type* __base, __size_type __i, __size_type __o);
+
+ // Internal function for correctly updating egptr() to the actual
+ // string end.
+ void
+ _M_update_egptr()
+ {
+ const bool __testin = _M_mode & ios_base::in;
+ if (this->pptr() && this->pptr() > this->egptr())
+ {
+ if (__testin)
+ this->setg(this->eback(), this->gptr(), this->pptr());
+ else
+ this->setg(this->pptr(), this->pptr(), this->pptr());
+ }
+ }
+ };
+
+
+ // [27.7.2] Template class basic_istringstream
+ /**
+ * @brief Controlling input for std::string.
+ * @ingroup io
+ *
+ * This class supports reading from objects of type std::basic_string,
+ * using the inherited functions from std::basic_istream. To control
+ * the associated sequence, an instance of std::basic_stringbuf is used,
+ * which this page refers to as @c sb.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ class basic_istringstream : public basic_istream<_CharT, _Traits>
+ {
+ public:
+ // Types:
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 251. basic_stringbuf missing allocator_type
+ typedef _Alloc allocator_type;
+ typedef typename traits_type::int_type int_type;
+ typedef typename traits_type::pos_type pos_type;
+ typedef typename traits_type::off_type off_type;
+
+ // Non-standard types:
+ typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
+ typedef basic_stringbuf<_CharT, _Traits, _Alloc> __stringbuf_type;
+ typedef basic_istream<char_type, traits_type> __istream_type;
+
+ private:
+ __stringbuf_type _M_stringbuf;
+
+ public:
+ // Constructors:
+ /**
+ * @brief Default constructor starts with an empty string buffer.
+ * @param mode Whether the buffer can read, or write, or both.
+ *
+ * @c ios_base::in is automatically included in @a mode.
+ *
+ * Initializes @c sb using @c mode|in, and passes @c &sb to the base
+ * class initializer. Does not allocate any buffer.
+ *
+ * That's a lie. We initialize the base class with NULL, because the
+ * string class does its own memory management.
+ */
+ explicit
+ basic_istringstream(ios_base::openmode __mode = ios_base::in)
+ : __istream_type(), _M_stringbuf(__mode | ios_base::in)
+ { this->init(&_M_stringbuf); }
+
+ /**
+ * @brief Starts with an existing string buffer.
+ * @param str A string to copy as a starting buffer.
+ * @param mode Whether the buffer can read, or write, or both.
+ *
+ * @c ios_base::in is automatically included in @a mode.
+ *
+ * Initializes @c sb using @a str and @c mode|in, and passes @c &sb
+ * to the base class initializer.
+ *
+ * That's a lie. We initialize the base class with NULL, because the
+ * string class does its own memory management.
+ */
+ explicit
+ basic_istringstream(const __string_type& __str,
+ ios_base::openmode __mode = ios_base::in)
+ : __istream_type(), _M_stringbuf(__str, __mode | ios_base::in)
+ { this->init(&_M_stringbuf); }
+
+ /**
+ * @brief The destructor does nothing.
+ *
+ * The buffer is deallocated by the stringbuf object, not the
+ * formatting stream.
+ */
+ ~basic_istringstream()
+ { }
+
+ // Members:
+ /**
+ * @brief Accessing the underlying buffer.
+ * @return The current basic_stringbuf buffer.
+ *
+ * This hides both signatures of std::basic_ios::rdbuf().
+ */
+ __stringbuf_type*
+ rdbuf() const
+ { return const_cast<__stringbuf_type*>(&_M_stringbuf); }
+
+ /**
+ * @brief Copying out the string buffer.
+ * @return @c rdbuf()->str()
+ */
+ __string_type
+ str() const
+ { return _M_stringbuf.str(); }
+
+ /**
+ * @brief Setting a new buffer.
+ * @param s The string to use as a new sequence.
+ *
+ * Calls @c rdbuf()->str(s).
+ */
+ void
+ str(const __string_type& __s)
+ { _M_stringbuf.str(__s); }
+ };
+
+
+ // [27.7.3] Template class basic_ostringstream
+ /**
+ * @brief Controlling output for std::string.
+ * @ingroup io
+ *
+ * This class supports writing to objects of type std::basic_string,
+ * using the inherited functions from std::basic_ostream. To control
+ * the associated sequence, an instance of std::basic_stringbuf is used,
+ * which this page refers to as @c sb.
+ */
+ template <typename _CharT, typename _Traits, typename _Alloc>
+ class basic_ostringstream : public basic_ostream<_CharT, _Traits>
+ {
+ public:
+ // Types:
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 251. basic_stringbuf missing allocator_type
+ typedef _Alloc allocator_type;
+ typedef typename traits_type::int_type int_type;
+ typedef typename traits_type::pos_type pos_type;
+ typedef typename traits_type::off_type off_type;
+
+ // Non-standard types:
+ typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
+ typedef basic_stringbuf<_CharT, _Traits, _Alloc> __stringbuf_type;
+ typedef basic_ostream<char_type, traits_type> __ostream_type;
+
+ private:
+ __stringbuf_type _M_stringbuf;
+
+ public:
+ // Constructors/destructor:
+ /**
+ * @brief Default constructor starts with an empty string buffer.
+ * @param mode Whether the buffer can read, or write, or both.
+ *
+ * @c ios_base::out is automatically included in @a mode.
+ *
+ * Initializes @c sb using @c mode|out, and passes @c &sb to the base
+ * class initializer. Does not allocate any buffer.
+ *
+ * That's a lie. We initialize the base class with NULL, because the
+ * string class does its own memory management.
+ */
+ explicit
+ basic_ostringstream(ios_base::openmode __mode = ios_base::out)
+ : __ostream_type(), _M_stringbuf(__mode | ios_base::out)
+ { this->init(&_M_stringbuf); }
+
+ /**
+ * @brief Starts with an existing string buffer.
+ * @param str A string to copy as a starting buffer.
+ * @param mode Whether the buffer can read, or write, or both.
+ *
+ * @c ios_base::out is automatically included in @a mode.
+ *
+ * Initializes @c sb using @a str and @c mode|out, and passes @c &sb
+ * to the base class initializer.
+ *
+ * That's a lie. We initialize the base class with NULL, because the
+ * string class does its own memory management.
+ */
+ explicit
+ basic_ostringstream(const __string_type& __str,
+ ios_base::openmode __mode = ios_base::out)
+ : __ostream_type(), _M_stringbuf(__str, __mode | ios_base::out)
+ { this->init(&_M_stringbuf); }
+
+ /**
+ * @brief The destructor does nothing.
+ *
+ * The buffer is deallocated by the stringbuf object, not the
+ * formatting stream.
+ */
+ ~basic_ostringstream()
+ { }
+
+ // Members:
+ /**
+ * @brief Accessing the underlying buffer.
+ * @return The current basic_stringbuf buffer.
+ *
+ * This hides both signatures of std::basic_ios::rdbuf().
+ */
+ __stringbuf_type*
+ rdbuf() const
+ { return const_cast<__stringbuf_type*>(&_M_stringbuf); }
+
+ /**
+ * @brief Copying out the string buffer.
+ * @return @c rdbuf()->str()
+ */
+ __string_type
+ str() const
+ { return _M_stringbuf.str(); }
+
+ /**
+ * @brief Setting a new buffer.
+ * @param s The string to use as a new sequence.
+ *
+ * Calls @c rdbuf()->str(s).
+ */
+ void
+ str(const __string_type& __s)
+ { _M_stringbuf.str(__s); }
+ };
+
+
+ // [27.7.4] Template class basic_stringstream
+ /**
+ * @brief Controlling input and output for std::string.
+ * @ingroup io
+ *
+ * This class supports reading from and writing to objects of type
+ * std::basic_string, using the inherited functions from
+ * std::basic_iostream. To control the associated sequence, an instance
+ * of std::basic_stringbuf is used, which this page refers to as @c sb.
+ */
+ template <typename _CharT, typename _Traits, typename _Alloc>
+ class basic_stringstream : public basic_iostream<_CharT, _Traits>
+ {
+ public:
+ // Types:
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 251. basic_stringbuf missing allocator_type
+ typedef _Alloc allocator_type;
+ typedef typename traits_type::int_type int_type;
+ typedef typename traits_type::pos_type pos_type;
+ typedef typename traits_type::off_type off_type;
+
+ // Non-standard Types:
+ typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
+ typedef basic_stringbuf<_CharT, _Traits, _Alloc> __stringbuf_type;
+ typedef basic_iostream<char_type, traits_type> __iostream_type;
+
+ private:
+ __stringbuf_type _M_stringbuf;
+
+ public:
+ // Constructors/destructors
+ /**
+ * @brief Default constructor starts with an empty string buffer.
+ * @param mode Whether the buffer can read, or write, or both.
+ *
+ * Initializes @c sb using @c mode, and passes @c &sb to the base
+ * class initializer. Does not allocate any buffer.
+ *
+ * That's a lie. We initialize the base class with NULL, because the
+ * string class does its own memory management.
+ */
+ explicit
+ basic_stringstream(ios_base::openmode __m = ios_base::out | ios_base::in)
+ : __iostream_type(), _M_stringbuf(__m)
+ { this->init(&_M_stringbuf); }
+
+ /**
+ * @brief Starts with an existing string buffer.
+ * @param str A string to copy as a starting buffer.
+ * @param mode Whether the buffer can read, or write, or both.
+ *
+ * Initializes @c sb using @a str and @c mode, and passes @c &sb
+ * to the base class initializer.
+ *
+ * That's a lie. We initialize the base class with NULL, because the
+ * string class does its own memory management.
+ */
+ explicit
+ basic_stringstream(const __string_type& __str,
+ ios_base::openmode __m = ios_base::out | ios_base::in)
+ : __iostream_type(), _M_stringbuf(__str, __m)
+ { this->init(&_M_stringbuf); }
+
+ /**
+ * @brief The destructor does nothing.
+ *
+ * The buffer is deallocated by the stringbuf object, not the
+ * formatting stream.
+ */
+ ~basic_stringstream()
+ { }
+
+ // Members:
+ /**
+ * @brief Accessing the underlying buffer.
+ * @return The current basic_stringbuf buffer.
+ *
+ * This hides both signatures of std::basic_ios::rdbuf().
+ */
+ __stringbuf_type*
+ rdbuf() const
+ { return const_cast<__stringbuf_type*>(&_M_stringbuf); }
+
+ /**
+ * @brief Copying out the string buffer.
+ * @return @c rdbuf()->str()
+ */
+ __string_type
+ str() const
+ { return _M_stringbuf.str(); }
+
+ /**
+ * @brief Setting a new buffer.
+ * @param s The string to use as a new sequence.
+ *
+ * Calls @c rdbuf()->str(s).
+ */
+ void
+ str(const __string_type& __s)
+ { _M_stringbuf.str(__s); }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <bits/sstream.tcc>
+#endif
+
+#endif /* _GLIBCXX_SSTREAM */
diff --git a/i686-linux/include/c++/4.4.3/stack b/i686-linux/include/c++/4.4.3/stack
new file mode 100644
index 0000000..4ee2c72
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/stack
@@ -0,0 +1,64 @@
+// <stack> -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file include/stack
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_STACK
+#define _GLIBCXX_STACK 1
+
+#pragma GCC system_header
+
+#include <deque>
+#include <bits/stl_stack.h>
+
+#endif /* _GLIBCXX_STACK */
diff --git a/i686-linux/include/c++/4.4.3/stdatomic.h b/i686-linux/include/c++/4.4.3/stdatomic.h
new file mode 100644
index 0000000..ecbacc9
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/stdatomic.h
@@ -0,0 +1,221 @@
+// -*- C++ -*- compatibility header.
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file stdatomic.h
+ * This is a Standard C++ Library header.
+ */
+
+#include <bits/c++config.h>
+#include <stddef.h>
+#include <stdbool.h> // XXX need to define bool w/o stdbool.h in tr1/cstdbool
+
+#ifndef _GLIBCXX_STDATOMIC_H
+#define _GLIBCXX_STDATOMIC_H 1
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+_GLIBCXX_BEGIN_EXTERN_C
+
+ /**
+ * @defgroup atomics Atomics
+ *
+ * Components for performing atomic operations.
+ * @{
+ */
+
+ /// Enumeration for memory_order
+ typedef enum memory_order
+ {
+ memory_order_relaxed,
+ memory_order_consume,
+ memory_order_acquire,
+ memory_order_release,
+ memory_order_acq_rel,
+ memory_order_seq_cst
+ } memory_order;
+
+ // Base for atomic_flag.
+ typedef struct __atomic_flag_base
+ {
+ bool _M_i;
+ } __atomic_flag_base;
+
+#define ATOMIC_FLAG_INIT { false }
+
+ /// 29.2 Lock-free Property
+#if defined(_GLIBCXX_ATOMIC_BUILTINS_1) && defined(_GLIBCXX_ATOMIC_BUILTINS_2) \
+ && defined(_GLIBCXX_ATOMIC_BUILTINS_4) && defined(_GLIBCXX_ATOMIC_BUILTINS_8)
+# define _GLIBCXX_ATOMIC_PROPERTY 2
+# define _GLIBCXX_ATOMIC_NAMESPACE __atomic2
+#elif defined(_GLIBCXX_ATOMIC_BUILTINS_1)
+# define _GLIBCXX_ATOMIC_PROPERTY 1
+# define _GLIBCXX_ATOMIC_NAMESPACE __atomic1
+#else
+# define _GLIBCXX_ATOMIC_PROPERTY 0
+# define _GLIBCXX_ATOMIC_NAMESPACE __atomic0
+#endif
+
+#define ATOMIC_INTEGRAL_LOCK_FREE _GLIBCXX_ATOMIC_PROPERTY
+#define ATOMIC_ADDRESS_LOCK_FREE _GLIBCXX_ATOMIC_PROPERTY
+
+ // Switch atomic integral base types based on C or C++. In
+ // addition, for "C" only provide type-generic macros for atomic
+ // operations. (As C++ accomplishes the same thing with sets of
+ // overloaded functions.
+#ifdef __cplusplus
+ inline namespace _GLIBCXX_ATOMIC_NAMESPACE { }
+# include <bits/atomicfwd_cxx.h>
+#else
+# include <bits/atomicfwd_c.h>
+#endif
+
+ // Typedefs for other atomic integral types.
+ typedef atomic_schar atomic_int_least8_t;
+ typedef atomic_uchar atomic_uint_least8_t;
+ typedef atomic_short atomic_int_least16_t;
+ typedef atomic_ushort atomic_uint_least16_t;
+ typedef atomic_int atomic_int_least32_t;
+ typedef atomic_uint atomic_uint_least32_t;
+ typedef atomic_llong atomic_int_least64_t;
+ typedef atomic_ullong atomic_uint_least64_t;
+
+ typedef atomic_schar atomic_int_fast8_t;
+ typedef atomic_uchar atomic_uint_fast8_t;
+ typedef atomic_short atomic_int_fast16_t;
+ typedef atomic_ushort atomic_uint_fast16_t;
+ typedef atomic_int atomic_int_fast32_t;
+ typedef atomic_uint atomic_uint_fast32_t;
+ typedef atomic_llong atomic_int_fast64_t;
+ typedef atomic_ullong atomic_uint_fast64_t;
+
+ typedef atomic_long atomic_intptr_t;
+ typedef atomic_ulong atomic_uintptr_t;
+
+ typedef atomic_long atomic_ssize_t;
+ typedef atomic_ulong atomic_size_t;
+
+ typedef atomic_llong atomic_intmax_t;
+ typedef atomic_ullong atomic_uintmax_t;
+
+ typedef atomic_long atomic_ptrdiff_t;
+
+ // Accessor functions for base atomic_flag type.
+ bool
+ atomic_flag_test_and_set_explicit(volatile __atomic_flag_base*, memory_order);
+
+ inline bool
+ atomic_flag_test_and_set(volatile __atomic_flag_base* __a)
+ { return atomic_flag_test_and_set_explicit(__a, memory_order_seq_cst); }
+
+ void
+ atomic_flag_clear_explicit(volatile __atomic_flag_base*, memory_order);
+
+ inline void
+ atomic_flag_clear(volatile __atomic_flag_base* __a)
+ { atomic_flag_clear_explicit(__a, memory_order_seq_cst); }
+
+ void
+ __atomic_flag_wait_explicit(volatile __atomic_flag_base*, memory_order);
+
+ volatile __atomic_flag_base*
+ __atomic_flag_for_address(const volatile void* __z) __attribute__((const));
+
+ // Implementation specific defines.
+#define _ATOMIC_LOAD_(__a, __x) \
+ ({ volatile __typeof__ _ATOMIC_MEMBER_* __p = &_ATOMIC_MEMBER_; \
+ volatile atomic_flag* __g = __atomic_flag_for_address(__p); \
+ __atomic_flag_wait_explicit(__g, __x); \
+ __typeof__ _ATOMIC_MEMBER_ __r = *__p; \
+ atomic_flag_clear_explicit(__g, __x); \
+ __r; })
+
+#define _ATOMIC_STORE_(__a, __m, __x) \
+ ({ volatile __typeof__ _ATOMIC_MEMBER_* __p = &_ATOMIC_MEMBER_; \
+ __typeof__(__m) __v = (__m); \
+ volatile atomic_flag* __g = __atomic_flag_for_address(__p); \
+ __atomic_flag_wait_explicit(__g, __x); \
+ *__p = __v; \
+ atomic_flag_clear_explicit(__g, __x); \
+ __v; })
+
+#define _ATOMIC_MODIFY_(__a, __o, __m, __x) \
+ ({ volatile __typeof__ _ATOMIC_MEMBER_* __p = &_ATOMIC_MEMBER_; \
+ __typeof__(__m) __v = (__m); \
+ volatile atomic_flag* __g = __atomic_flag_for_address(__p); \
+ __atomic_flag_wait_explicit(__g, __x); \
+ __typeof__ _ATOMIC_MEMBER_ __r = *__p; \
+ *__p __o __v; \
+ atomic_flag_clear_explicit(__g, __x); \
+ __r; })
+
+#define _ATOMIC_CMPEXCHNG_(__a, __e, __m, __x) \
+ ({ volatile __typeof__ _ATOMIC_MEMBER_* __p = &_ATOMIC_MEMBER_; \
+ __typeof__(__e) __q = (__e); \
+ __typeof__(__m) __v = (__m); \
+ bool __r; \
+ volatile atomic_flag* __g = __atomic_flag_for_address(__p); \
+ __atomic_flag_wait_explicit(__g, __x); \
+ __typeof__ _ATOMIC_MEMBER_ __t__ = *__p; \
+ if (__t__ == *__q) { *__p = __v; __r = true; } \
+ else { *__q = __t__; __r = false; } \
+ atomic_flag_clear_explicit(__g, __x); \
+ __r; })
+
+ // @} group atomics
+
+_GLIBCXX_END_EXTERN_C
+_GLIBCXX_END_NAMESPACE
+
+// Inject into global namespace.
+#ifdef __cplusplus
+
+#include <cstdatomic>
+
+using std::memory_order;
+using std::memory_order_relaxed;
+using std::memory_order_consume;
+using std::memory_order_acquire;
+using std::memory_order_release;
+using std::memory_order_acq_rel;
+using std::memory_order_seq_cst;
+using std::atomic_flag;
+using std::atomic_bool;
+using std::atomic_char;
+using std::atomic_schar;
+using std::atomic_uchar;
+using std::atomic_short;
+using std::atomic_ushort;
+using std::atomic_int;
+using std::atomic_uint;
+using std::atomic_long;
+using std::atomic_ulong;
+using std::atomic_llong;
+using std::atomic_ullong;
+using std::atomic_wchar_t;
+using std::atomic_char16_t;
+using std::atomic_char32_t;
+using std::atomic_address;
+using std::atomic;
+#endif
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/stdexcept b/i686-linux/include/c++/4.4.3/stdexcept
new file mode 100644
index 0000000..9f5c976
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/stdexcept
@@ -0,0 +1,150 @@
+// Standard exception classes -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2005, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file stdexcept
+ * This is a Standard C++ Library header.
+ */
+
+//
+// ISO C++ 19.1 Exception classes
+//
+
+#ifndef _GLIBCXX_STDEXCEPT
+#define _GLIBCXX_STDEXCEPT 1
+
+#pragma GCC system_header
+
+#include <exception>
+#include <string>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @addtogroup exceptions
+ * @{
+ */
+
+ /** Logic errors represent problems in the internal logic of a program;
+ * in theory, these are preventable, and even detectable before the
+ * program runs (e.g., violations of class invariants).
+ * @brief One of two subclasses of exception.
+ */
+ class logic_error : public exception
+ {
+ string _M_msg;
+
+ public:
+ /** Takes a character string describing the error. */
+ explicit
+ logic_error(const string& __arg);
+
+ virtual
+ ~logic_error() throw();
+
+ /** Returns a C-style character string describing the general cause of
+ * the current error (the same string passed to the ctor). */
+ virtual const char*
+ what() const throw();
+ };
+
+ /** Thrown by the library, or by you, to report domain errors (domain in
+ * the mathematical sense). */
+ class domain_error : public logic_error
+ {
+ public:
+ explicit domain_error(const string& __arg);
+ };
+
+ /** Thrown to report invalid arguments to functions. */
+ class invalid_argument : public logic_error
+ {
+ public:
+ explicit invalid_argument(const string& __arg);
+ };
+
+ /** Thrown when an object is constructed that would exceed its maximum
+ * permitted size (e.g., a basic_string instance). */
+ class length_error : public logic_error
+ {
+ public:
+ explicit length_error(const string& __arg);
+ };
+
+ /** This represents an argument whose value is not within the expected
+ * range (e.g., boundary checks in basic_string). */
+ class out_of_range : public logic_error
+ {
+ public:
+ explicit out_of_range(const string& __arg);
+ };
+
+ /** Runtime errors represent problems outside the scope of a program;
+ * they cannot be easily predicted and can generally only be caught as
+ * the program executes.
+ * @brief One of two subclasses of exception.
+ */
+ class runtime_error : public exception
+ {
+ string _M_msg;
+
+ public:
+ /** Takes a character string describing the error. */
+ explicit
+ runtime_error(const string& __arg);
+
+ virtual
+ ~runtime_error() throw();
+
+ /** Returns a C-style character string describing the general cause of
+ * the current error (the same string passed to the ctor). */
+ virtual const char*
+ what() const throw();
+ };
+
+ /** Thrown to indicate range errors in internal computations. */
+ class range_error : public runtime_error
+ {
+ public:
+ explicit range_error(const string& __arg);
+ };
+
+ /** Thrown to indicate arithmetic overflow. */
+ class overflow_error : public runtime_error
+ {
+ public:
+ explicit overflow_error(const string& __arg);
+ };
+
+ /** Thrown to indicate arithmetic underflow. */
+ class underflow_error : public runtime_error
+ {
+ public:
+ explicit underflow_error(const string& __arg);
+ };
+
+ // @} group exceptions
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _GLIBCXX_STDEXCEPT */
diff --git a/i686-linux/include/c++/4.4.3/streambuf b/i686-linux/include/c++/4.4.3/streambuf
new file mode 100644
index 0000000..790be0e
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/streambuf
@@ -0,0 +1,799 @@
+// Stream buffer classes -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file streambuf
+ * This is a Standard C++ Library header.
+ */
+
+//
+// ISO C++ 14882: 27.5 Stream buffers
+//
+
+#ifndef _GLIBXX_STREAMBUF
+#define _GLIBXX_STREAMBUF 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <iosfwd>
+#include <bits/localefwd.h>
+#include <bits/ios_base.h>
+#include <bits/cpp_type_traits.h>
+#include <ext/type_traits.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _CharT, typename _Traits>
+ streamsize
+ __copy_streambufs_eof(basic_streambuf<_CharT, _Traits>*,
+ basic_streambuf<_CharT, _Traits>*, bool&);
+
+ /**
+ * @brief The actual work of input and output (interface).
+ *
+ * This is a base class. Derived stream buffers each control a
+ * pair of character sequences: one for input, and one for output.
+ *
+ * Section [27.5.1] of the standard describes the requirements and
+ * behavior of stream buffer classes. That section (three paragraphs)
+ * is reproduced here, for simplicity and accuracy.
+ *
+ * -# Stream buffers can impose various constraints on the sequences
+ * they control. Some constraints are:
+ * - The controlled input sequence can be not readable.
+ * - The controlled output sequence can be not writable.
+ * - The controlled sequences can be associated with the contents of
+ * other representations for character sequences, such as external
+ * files.
+ * - The controlled sequences can support operations @e directly to or
+ * from associated sequences.
+ * - The controlled sequences can impose limitations on how the
+ * program can read characters from a sequence, write characters to
+ * a sequence, put characters back into an input sequence, or alter
+ * the stream position.
+ * .
+ * -# Each sequence is characterized by three pointers which, if non-null,
+ * all point into the same @c charT array object. The array object
+ * represents, at any moment, a (sub)sequence of characters from the
+ * sequence. Operations performed on a sequence alter the values
+ * stored in these pointers, perform reads and writes directly to or
+ * from associated sequences, and alter "the stream position" and
+ * conversion state as needed to maintain this subsequence relationship.
+ * The three pointers are:
+ * - the <em>beginning pointer</em>, or lowest element address in the
+ * array (called @e xbeg here);
+ * - the <em>next pointer</em>, or next element address that is a
+ * current candidate for reading or writing (called @e xnext here);
+ * - the <em>end pointer</em>, or first element address beyond the
+ * end of the array (called @e xend here).
+ * .
+ * -# The following semantic constraints shall always apply for any set
+ * of three pointers for a sequence, using the pointer names given
+ * immediately above:
+ * - If @e xnext is not a null pointer, then @e xbeg and @e xend shall
+ * also be non-null pointers into the same @c charT array, as
+ * described above; otherwise, @e xbeg and @e xend shall also be null.
+ * - If @e xnext is not a null pointer and @e xnext < @e xend for an
+ * output sequence, then a <em>write position</em> is available.
+ * In this case, @e *xnext shall be assignable as the next element
+ * to write (to put, or to store a character value, into the sequence).
+ * - If @e xnext is not a null pointer and @e xbeg < @e xnext for an
+ * input sequence, then a <em>putback position</em> is available.
+ * In this case, @e xnext[-1] shall have a defined value and is the
+ * next (preceding) element to store a character that is put back
+ * into the input sequence.
+ * - If @e xnext is not a null pointer and @e xnext< @e xend for an
+ * input sequence, then a <em>read position</em> is available.
+ * In this case, @e *xnext shall have a defined value and is the
+ * next element to read (to get, or to obtain a character value,
+ * from the sequence).
+ */
+ template<typename _CharT, typename _Traits>
+ class basic_streambuf
+ {
+ public:
+ //@{
+ /**
+ * These are standard types. They permit a standardized way of
+ * referring to names of (or names dependant on) the template
+ * parameters, which are specific to the implementation.
+ */
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ typedef typename traits_type::int_type int_type;
+ typedef typename traits_type::pos_type pos_type;
+ typedef typename traits_type::off_type off_type;
+ //@}
+
+ //@{
+ /// This is a non-standard type.
+ typedef basic_streambuf<char_type, traits_type> __streambuf_type;
+ //@}
+
+ friend class basic_ios<char_type, traits_type>;
+ friend class basic_istream<char_type, traits_type>;
+ friend class basic_ostream<char_type, traits_type>;
+ friend class istreambuf_iterator<char_type, traits_type>;
+ friend class ostreambuf_iterator<char_type, traits_type>;
+
+ friend streamsize
+ __copy_streambufs_eof<>(__streambuf_type*, __streambuf_type*, bool&);
+
+ template<bool _IsMove, typename _CharT2>
+ friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
+ _CharT2*>::__type
+ __copy_move_a2(istreambuf_iterator<_CharT2>,
+ istreambuf_iterator<_CharT2>, _CharT2*);
+
+ template<typename _CharT2>
+ friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
+ istreambuf_iterator<_CharT2> >::__type
+ find(istreambuf_iterator<_CharT2>, istreambuf_iterator<_CharT2>,
+ const _CharT2&);
+
+ template<typename _CharT2, typename _Traits2>
+ friend basic_istream<_CharT2, _Traits2>&
+ operator>>(basic_istream<_CharT2, _Traits2>&, _CharT2*);
+
+ template<typename _CharT2, typename _Traits2, typename _Alloc>
+ friend basic_istream<_CharT2, _Traits2>&
+ operator>>(basic_istream<_CharT2, _Traits2>&,
+ basic_string<_CharT2, _Traits2, _Alloc>&);
+
+ template<typename _CharT2, typename _Traits2, typename _Alloc>
+ friend basic_istream<_CharT2, _Traits2>&
+ getline(basic_istream<_CharT2, _Traits2>&,
+ basic_string<_CharT2, _Traits2, _Alloc>&, _CharT2);
+
+ protected:
+ //@{
+ /**
+ * This is based on _IO_FILE, just reordered to be more consistent,
+ * and is intended to be the most minimal abstraction for an
+ * internal buffer.
+ * - get == input == read
+ * - put == output == write
+ */
+ char_type* _M_in_beg; // Start of get area.
+ char_type* _M_in_cur; // Current read area.
+ char_type* _M_in_end; // End of get area.
+ char_type* _M_out_beg; // Start of put area.
+ char_type* _M_out_cur; // Current put area.
+ char_type* _M_out_end; // End of put area.
+
+ /// Current locale setting.
+ locale _M_buf_locale;
+
+ public:
+ /// Destructor deallocates no buffer space.
+ virtual
+ ~basic_streambuf()
+ { }
+
+ // [27.5.2.2.1] locales
+ /**
+ * @brief Entry point for imbue().
+ * @param loc The new locale.
+ * @return The previous locale.
+ *
+ * Calls the derived imbue(loc).
+ */
+ locale
+ pubimbue(const locale &__loc)
+ {
+ locale __tmp(this->getloc());
+ this->imbue(__loc);
+ _M_buf_locale = __loc;
+ return __tmp;
+ }
+
+ /**
+ * @brief Locale access.
+ * @return The current locale in effect.
+ *
+ * If pubimbue(loc) has been called, then the most recent @c loc
+ * is returned. Otherwise the global locale in effect at the time
+ * of construction is returned.
+ */
+ locale
+ getloc() const
+ { return _M_buf_locale; }
+
+ // [27.5.2.2.2] buffer management and positioning
+ //@{
+ /**
+ * @brief Entry points for derived buffer functions.
+ *
+ * The public versions of @c pubfoo dispatch to the protected
+ * derived @c foo member functions, passing the arguments (if any)
+ * and returning the result unchanged.
+ */
+ __streambuf_type*
+ pubsetbuf(char_type* __s, streamsize __n)
+ { return this->setbuf(__s, __n); }
+
+ pos_type
+ pubseekoff(off_type __off, ios_base::seekdir __way,
+ ios_base::openmode __mode = ios_base::in | ios_base::out)
+ { return this->seekoff(__off, __way, __mode); }
+
+ pos_type
+ pubseekpos(pos_type __sp,
+ ios_base::openmode __mode = ios_base::in | ios_base::out)
+ { return this->seekpos(__sp, __mode); }
+
+ int
+ pubsync() { return this->sync(); }
+ //@}
+
+ // [27.5.2.2.3] get area
+ /**
+ * @brief Looking ahead into the stream.
+ * @return The number of characters available.
+ *
+ * If a read position is available, returns the number of characters
+ * available for reading before the buffer must be refilled.
+ * Otherwise returns the derived @c showmanyc().
+ */
+ streamsize
+ in_avail()
+ {
+ const streamsize __ret = this->egptr() - this->gptr();
+ return __ret ? __ret : this->showmanyc();
+ }
+
+ /**
+ * @brief Getting the next character.
+ * @return The next character, or eof.
+ *
+ * Calls @c sbumpc(), and if that function returns
+ * @c traits::eof(), so does this function. Otherwise, @c sgetc().
+ */
+ int_type
+ snextc()
+ {
+ int_type __ret = traits_type::eof();
+ if (__builtin_expect(!traits_type::eq_int_type(this->sbumpc(),
+ __ret), true))
+ __ret = this->sgetc();
+ return __ret;
+ }
+
+ /**
+ * @brief Getting the next character.
+ * @return The next character, or eof.
+ *
+ * If the input read position is available, returns that character
+ * and increments the read pointer, otherwise calls and returns
+ * @c uflow().
+ */
+ int_type
+ sbumpc()
+ {
+ int_type __ret;
+ if (__builtin_expect(this->gptr() < this->egptr(), true))
+ {
+ __ret = traits_type::to_int_type(*this->gptr());
+ this->gbump(1);
+ }
+ else
+ __ret = this->uflow();
+ return __ret;
+ }
+
+ /**
+ * @brief Getting the next character.
+ * @return The next character, or eof.
+ *
+ * If the input read position is available, returns that character,
+ * otherwise calls and returns @c underflow(). Does not move the
+ * read position after fetching the character.
+ */
+ int_type
+ sgetc()
+ {
+ int_type __ret;
+ if (__builtin_expect(this->gptr() < this->egptr(), true))
+ __ret = traits_type::to_int_type(*this->gptr());
+ else
+ __ret = this->underflow();
+ return __ret;
+ }
+
+ /**
+ * @brief Entry point for xsgetn.
+ * @param s A buffer area.
+ * @param n A count.
+ *
+ * Returns xsgetn(s,n). The effect is to fill @a s[0] through
+ * @a s[n-1] with characters from the input sequence, if possible.
+ */
+ streamsize
+ sgetn(char_type* __s, streamsize __n)
+ { return this->xsgetn(__s, __n); }
+
+ // [27.5.2.2.4] putback
+ /**
+ * @brief Pushing characters back into the input stream.
+ * @param c The character to push back.
+ * @return The previous character, if possible.
+ *
+ * Similar to sungetc(), but @a c is pushed onto the stream instead
+ * of "the previous character". If successful, the next character
+ * fetched from the input stream will be @a c.
+ */
+ int_type
+ sputbackc(char_type __c)
+ {
+ int_type __ret;
+ const bool __testpos = this->eback() < this->gptr();
+ if (__builtin_expect(!__testpos ||
+ !traits_type::eq(__c, this->gptr()[-1]), false))
+ __ret = this->pbackfail(traits_type::to_int_type(__c));
+ else
+ {
+ this->gbump(-1);
+ __ret = traits_type::to_int_type(*this->gptr());
+ }
+ return __ret;
+ }
+
+ /**
+ * @brief Moving backwards in the input stream.
+ * @return The previous character, if possible.
+ *
+ * If a putback position is available, this function decrements the
+ * input pointer and returns that character. Otherwise, calls and
+ * returns pbackfail(). The effect is to "unget" the last character
+ * "gotten".
+ */
+ int_type
+ sungetc()
+ {
+ int_type __ret;
+ if (__builtin_expect(this->eback() < this->gptr(), true))
+ {
+ this->gbump(-1);
+ __ret = traits_type::to_int_type(*this->gptr());
+ }
+ else
+ __ret = this->pbackfail();
+ return __ret;
+ }
+
+ // [27.5.2.2.5] put area
+ /**
+ * @brief Entry point for all single-character output functions.
+ * @param c A character to output.
+ * @return @a c, if possible.
+ *
+ * One of two public output functions.
+ *
+ * If a write position is available for the output sequence (i.e.,
+ * the buffer is not full), stores @a c in that position, increments
+ * the position, and returns @c traits::to_int_type(c). If a write
+ * position is not available, returns @c overflow(c).
+ */
+ int_type
+ sputc(char_type __c)
+ {
+ int_type __ret;
+ if (__builtin_expect(this->pptr() < this->epptr(), true))
+ {
+ *this->pptr() = __c;
+ this->pbump(1);
+ __ret = traits_type::to_int_type(__c);
+ }
+ else
+ __ret = this->overflow(traits_type::to_int_type(__c));
+ return __ret;
+ }
+
+ /**
+ * @brief Entry point for all single-character output functions.
+ * @param s A buffer read area.
+ * @param n A count.
+ *
+ * One of two public output functions.
+ *
+ *
+ * Returns xsputn(s,n). The effect is to write @a s[0] through
+ * @a s[n-1] to the output sequence, if possible.
+ */
+ streamsize
+ sputn(const char_type* __s, streamsize __n)
+ { return this->xsputn(__s, __n); }
+
+ protected:
+ /**
+ * @brief Base constructor.
+ *
+ * Only called from derived constructors, and sets up all the
+ * buffer data to zero, including the pointers described in the
+ * basic_streambuf class description. Note that, as a result,
+ * - the class starts with no read nor write positions available,
+ * - this is not an error
+ */
+ basic_streambuf()
+ : _M_in_beg(0), _M_in_cur(0), _M_in_end(0),
+ _M_out_beg(0), _M_out_cur(0), _M_out_end(0),
+ _M_buf_locale(locale())
+ { }
+
+ // [27.5.2.3.1] get area access
+ //@{
+ /**
+ * @brief Access to the get area.
+ *
+ * These functions are only available to other protected functions,
+ * including derived classes.
+ *
+ * - eback() returns the beginning pointer for the input sequence
+ * - gptr() returns the next pointer for the input sequence
+ * - egptr() returns the end pointer for the input sequence
+ */
+ char_type*
+ eback() const { return _M_in_beg; }
+
+ char_type*
+ gptr() const { return _M_in_cur; }
+
+ char_type*
+ egptr() const { return _M_in_end; }
+ //@}
+
+ /**
+ * @brief Moving the read position.
+ * @param n The delta by which to move.
+ *
+ * This just advances the read position without returning any data.
+ */
+ void
+ gbump(int __n) { _M_in_cur += __n; }
+
+ /**
+ * @brief Setting the three read area pointers.
+ * @param gbeg A pointer.
+ * @param gnext A pointer.
+ * @param gend A pointer.
+ * @post @a gbeg == @c eback(), @a gnext == @c gptr(), and
+ * @a gend == @c egptr()
+ */
+ void
+ setg(char_type* __gbeg, char_type* __gnext, char_type* __gend)
+ {
+ _M_in_beg = __gbeg;
+ _M_in_cur = __gnext;
+ _M_in_end = __gend;
+ }
+
+ // [27.5.2.3.2] put area access
+ //@{
+ /**
+ * @brief Access to the put area.
+ *
+ * These functions are only available to other protected functions,
+ * including derived classes.
+ *
+ * - pbase() returns the beginning pointer for the output sequence
+ * - pptr() returns the next pointer for the output sequence
+ * - epptr() returns the end pointer for the output sequence
+ */
+ char_type*
+ pbase() const { return _M_out_beg; }
+
+ char_type*
+ pptr() const { return _M_out_cur; }
+
+ char_type*
+ epptr() const { return _M_out_end; }
+ //@}
+
+ /**
+ * @brief Moving the write position.
+ * @param n The delta by which to move.
+ *
+ * This just advances the write position without returning any data.
+ */
+ void
+ pbump(int __n) { _M_out_cur += __n; }
+
+ /**
+ * @brief Setting the three write area pointers.
+ * @param pbeg A pointer.
+ * @param pend A pointer.
+ * @post @a pbeg == @c pbase(), @a pbeg == @c pptr(), and
+ * @a pend == @c epptr()
+ */
+ void
+ setp(char_type* __pbeg, char_type* __pend)
+ {
+ _M_out_beg = _M_out_cur = __pbeg;
+ _M_out_end = __pend;
+ }
+
+ // [27.5.2.4] virtual functions
+ // [27.5.2.4.1] locales
+ /**
+ * @brief Changes translations.
+ * @param loc A new locale.
+ *
+ * Translations done during I/O which depend on the current locale
+ * are changed by this call. The standard adds, "Between invocations
+ * of this function a class derived from streambuf can safely cache
+ * results of calls to locale functions and to members of facets
+ * so obtained."
+ *
+ * @note Base class version does nothing.
+ */
+ virtual void
+ imbue(const locale&)
+ { }
+
+ // [27.5.2.4.2] buffer management and positioning
+ /**
+ * @brief Manipulates the buffer.
+ *
+ * Each derived class provides its own appropriate behavior. See
+ * the next-to-last paragraph of
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt11ch25s02.html
+ * for more on this function.
+ *
+ * @note Base class version does nothing, returns @c this.
+ */
+ virtual basic_streambuf<char_type,_Traits>*
+ setbuf(char_type*, streamsize)
+ { return this; }
+
+ /**
+ * @brief Alters the stream positions.
+ *
+ * Each derived class provides its own appropriate behavior.
+ * @note Base class version does nothing, returns a @c pos_type
+ * that represents an invalid stream position.
+ */
+ virtual pos_type
+ seekoff(off_type, ios_base::seekdir,
+ ios_base::openmode /*__mode*/ = ios_base::in | ios_base::out)
+ { return pos_type(off_type(-1)); }
+
+ /**
+ * @brief Alters the stream positions.
+ *
+ * Each derived class provides its own appropriate behavior.
+ * @note Base class version does nothing, returns a @c pos_type
+ * that represents an invalid stream position.
+ */
+ virtual pos_type
+ seekpos(pos_type,
+ ios_base::openmode /*__mode*/ = ios_base::in | ios_base::out)
+ { return pos_type(off_type(-1)); }
+
+ /**
+ * @brief Synchronizes the buffer arrays with the controlled sequences.
+ * @return -1 on failure.
+ *
+ * Each derived class provides its own appropriate behavior,
+ * including the definition of "failure".
+ * @note Base class version does nothing, returns zero.
+ */
+ virtual int
+ sync() { return 0; }
+
+ // [27.5.2.4.3] get area
+ /**
+ * @brief Investigating the data available.
+ * @return An estimate of the number of characters available in the
+ * input sequence, or -1.
+ *
+ * "If it returns a positive value, then successive calls to
+ * @c underflow() will not return @c traits::eof() until at least that
+ * number of characters have been supplied. If @c showmanyc()
+ * returns -1, then calls to @c underflow() or @c uflow() will fail."
+ * [27.5.2.4.3]/1
+ *
+ * @note Base class version does nothing, returns zero.
+ * @note The standard adds that "the intention is not only that the
+ * calls [to underflow or uflow] will not return @c eof() but
+ * that they will return "immediately".
+ * @note The standard adds that "the morphemes of @c showmanyc are
+ * "es-how-many-see", not "show-manic".
+ */
+ virtual streamsize
+ showmanyc() { return 0; }
+
+ /**
+ * @brief Multiple character extraction.
+ * @param s A buffer area.
+ * @param n Maximum number of characters to assign.
+ * @return The number of characters assigned.
+ *
+ * Fills @a s[0] through @a s[n-1] with characters from the input
+ * sequence, as if by @c sbumpc(). Stops when either @a n characters
+ * have been copied, or when @c traits::eof() would be copied.
+ *
+ * It is expected that derived classes provide a more efficient
+ * implementation by overriding this definition.
+ */
+ virtual streamsize
+ xsgetn(char_type* __s, streamsize __n);
+
+ /**
+ * @brief Fetches more data from the controlled sequence.
+ * @return The first character from the <em>pending sequence</em>.
+ *
+ * Informally, this function is called when the input buffer is
+ * exhausted (or does not exist, as buffering need not actually be
+ * done). If a buffer exists, it is "refilled". In either case, the
+ * next available character is returned, or @c traits::eof() to
+ * indicate a null pending sequence.
+ *
+ * For a formal definition of the pending sequence, see a good text
+ * such as Langer & Kreft, or [27.5.2.4.3]/7-14.
+ *
+ * A functioning input streambuf can be created by overriding only
+ * this function (no buffer area will be used). For an example, see
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt11ch25.html
+ *
+ * @note Base class version does nothing, returns eof().
+ */
+ virtual int_type
+ underflow()
+ { return traits_type::eof(); }
+
+ /**
+ * @brief Fetches more data from the controlled sequence.
+ * @return The first character from the <em>pending sequence</em>.
+ *
+ * Informally, this function does the same thing as @c underflow(),
+ * and in fact is required to call that function. It also returns
+ * the new character, like @c underflow() does. However, this
+ * function also moves the read position forward by one.
+ */
+ virtual int_type
+ uflow()
+ {
+ int_type __ret = traits_type::eof();
+ const bool __testeof = traits_type::eq_int_type(this->underflow(),
+ __ret);
+ if (!__testeof)
+ {
+ __ret = traits_type::to_int_type(*this->gptr());
+ this->gbump(1);
+ }
+ return __ret;
+ }
+
+ // [27.5.2.4.4] putback
+ /**
+ * @brief Tries to back up the input sequence.
+ * @param c The character to be inserted back into the sequence.
+ * @return eof() on failure, "some other value" on success
+ * @post The constraints of @c gptr(), @c eback(), and @c pptr()
+ * are the same as for @c underflow().
+ *
+ * @note Base class version does nothing, returns eof().
+ */
+ virtual int_type
+ pbackfail(int_type /* __c */ = traits_type::eof())
+ { return traits_type::eof(); }
+
+ // Put area:
+ /**
+ * @brief Multiple character insertion.
+ * @param s A buffer area.
+ * @param n Maximum number of characters to write.
+ * @return The number of characters written.
+ *
+ * Writes @a s[0] through @a s[n-1] to the output sequence, as if
+ * by @c sputc(). Stops when either @a n characters have been
+ * copied, or when @c sputc() would return @c traits::eof().
+ *
+ * It is expected that derived classes provide a more efficient
+ * implementation by overriding this definition.
+ */
+ virtual streamsize
+ xsputn(const char_type* __s, streamsize __n);
+
+ /**
+ * @brief Consumes data from the buffer; writes to the
+ * controlled sequence.
+ * @param c An additional character to consume.
+ * @return eof() to indicate failure, something else (usually
+ * @a c, or not_eof())
+ *
+ * Informally, this function is called when the output buffer is full
+ * (or does not exist, as buffering need not actually be done). If a
+ * buffer exists, it is "consumed", with "some effect" on the
+ * controlled sequence. (Typically, the buffer is written out to the
+ * sequence verbatim.) In either case, the character @a c is also
+ * written out, if @a c is not @c eof().
+ *
+ * For a formal definition of this function, see a good text
+ * such as Langer & Kreft, or [27.5.2.4.5]/3-7.
+ *
+ * A functioning output streambuf can be created by overriding only
+ * this function (no buffer area will be used).
+ *
+ * @note Base class version does nothing, returns eof().
+ */
+ virtual int_type
+ overflow(int_type /* __c */ = traits_type::eof())
+ { return traits_type::eof(); }
+
+#if _GLIBCXX_DEPRECATED
+ // Annex D.6
+ public:
+ /**
+ * @brief Tosses a character.
+ *
+ * Advances the read pointer, ignoring the character that would have
+ * been read.
+ *
+ * See http://gcc.gnu.org/ml/libstdc++/2002-05/msg00168.html
+ */
+ void
+ stossc()
+ {
+ if (this->gptr() < this->egptr())
+ this->gbump(1);
+ else
+ this->uflow();
+ }
+#endif
+
+ private:
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // Side effect of DR 50.
+ basic_streambuf(const __streambuf_type& __sb)
+ : _M_in_beg(__sb._M_in_beg), _M_in_cur(__sb._M_in_cur),
+ _M_in_end(__sb._M_in_end), _M_out_beg(__sb._M_out_beg),
+ _M_out_cur(__sb._M_out_cur), _M_out_end(__sb._M_out_cur),
+ _M_buf_locale(__sb._M_buf_locale)
+ { }
+
+ __streambuf_type&
+ operator=(const __streambuf_type&) { return *this; };
+ };
+
+ // Explicit specialization declarations, defined in src/streambuf.cc.
+ template<>
+ streamsize
+ __copy_streambufs_eof(basic_streambuf<char>* __sbin,
+ basic_streambuf<char>* __sbout, bool& __ineof);
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template<>
+ streamsize
+ __copy_streambufs_eof(basic_streambuf<wchar_t>* __sbin,
+ basic_streambuf<wchar_t>* __sbout, bool& __ineof);
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <bits/streambuf.tcc>
+#endif
+
+#endif /* _GLIBCXX_STREAMBUF */
diff --git a/i686-linux/include/c++/4.4.3/string b/i686-linux/include/c++/4.4.3/string
new file mode 100644
index 0000000..8c5949f
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/string
@@ -0,0 +1,59 @@
+// Components for manipulating sequences of characters -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+// 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/string
+ * This is a Standard C++ Library header.
+ */
+
+//
+// ISO C++ 14882: 21 Strings library
+//
+
+#ifndef _GLIBCXX_STRING
+#define _GLIBCXX_STRING 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <bits/stringfwd.h>
+#include <bits/char_traits.h> // NB: In turn includes stl_algobase.h
+#include <bits/allocator.h>
+#include <bits/cpp_type_traits.h>
+#include <bits/localefwd.h> // For operators >>, <<, and getline.
+#include <bits/ostream_insert.h>
+#include <bits/stl_iterator_base_types.h>
+#include <bits/stl_iterator_base_funcs.h>
+#include <bits/stl_iterator.h>
+#include <bits/stl_function.h> // For less
+#include <ext/numeric_traits.h>
+#include <bits/stl_algobase.h>
+#include <bits/basic_string.h>
+
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <bits/basic_string.tcc>
+#endif
+
+#endif /* _GLIBCXX_STRING */
diff --git a/i686-linux/include/c++/4.4.3/system_error b/i686-linux/include/c++/4.4.3/system_error
new file mode 100644
index 0000000..02dd2df
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/system_error
@@ -0,0 +1,353 @@
+// <system_error> -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file system_error
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_SYSTEM_ERROR
+#define _GLIBCXX_SYSTEM_ERROR 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#else
+
+#include <bits/c++config.h>
+#include <bits/error_constants.h>
+#include <iosfwd>
+#include <stdexcept>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ class error_code;
+ class error_condition;
+ class error_category;
+ class system_error;
+
+ /// is_error_code_enum
+ template<typename _Tp>
+ struct is_error_code_enum : public false_type { };
+
+ /// is_error_condition_enum
+ template<typename _Tp>
+ struct is_error_condition_enum : public false_type { };
+
+ template<>
+ struct is_error_condition_enum<errc>
+ : public true_type { };
+
+
+ /// error_category
+ class error_category
+ {
+ protected:
+ error_category() = default;
+
+ public:
+ virtual ~error_category() { }
+
+ error_category(const error_category&) = delete;
+ error_category& operator=(const error_category&) = delete;
+
+ virtual const char*
+ name() const = 0;
+
+ virtual string
+ message(int) const = 0;
+
+ virtual error_condition
+ default_error_condition(int __i) const;
+
+ virtual bool
+ equivalent(int __i, const error_condition& __cond) const;
+
+ virtual bool
+ equivalent(const error_code& __code, int __i) const;
+
+ bool
+ operator<(const error_category& __other) const
+ { return less<const error_category*>()(this, &__other); }
+
+ bool
+ operator==(const error_category& __other) const
+ { return this == &__other; }
+
+ bool
+ operator!=(const error_category& __other) const
+ { return this != &__other; }
+ };
+
+ // DR 890.
+ const error_category& system_category();
+ const error_category& generic_category();
+
+ error_code make_error_code(errc);
+
+ /// error_code
+ // Implementation-specific error identification
+ struct error_code
+ {
+ error_code()
+ : _M_value(0), _M_cat(&system_category()) { }
+
+ error_code(int __v, const error_category& __cat)
+ : _M_value(__v), _M_cat(&__cat) { }
+
+ template<typename _ErrorCodeEnum>
+ error_code(_ErrorCodeEnum __e,
+ typename enable_if<is_error_code_enum<_ErrorCodeEnum>::value>::type* = 0)
+ { *this = make_error_code(__e); }
+
+ void
+ assign(int __v, const error_category& __cat)
+ {
+ _M_value = __v;
+ _M_cat = &__cat;
+ }
+
+ void
+ clear()
+ { assign(0, system_category()); }
+
+ // DR 804.
+ template<typename _ErrorCodeEnum>
+ typename enable_if<is_error_code_enum<_ErrorCodeEnum>::value,
+ error_code&>::type
+ operator=(_ErrorCodeEnum __e)
+ { return *this = make_error_code(__e); }
+
+ int
+ value() const { return _M_value; }
+
+ const error_category&
+ category() const { return *_M_cat; }
+
+ error_condition
+ default_error_condition() const;
+
+ string
+ message() const
+ { return category().message(value()); }
+
+ // Safe bool idiom.
+ // explicit operator bool() const throw()
+ // { return _M_value != 0; }
+ typedef void (*__bool_type)();
+
+ static void __not_bool_type() { }
+
+ operator __bool_type() const
+ { return _M_value != 0 ? &__not_bool_type : false; }
+
+ // DR 804.
+ private:
+ int _M_value;
+ const error_category* _M_cat;
+ };
+
+ // 19.4.2.6 non-member functions
+ inline error_code
+ make_error_code(errc __e)
+ { return error_code(static_cast<int>(__e), generic_category()); }
+
+ inline bool
+ operator<(const error_code& __lhs, const error_code& __rhs)
+ {
+ return (__lhs.category() < __rhs.category()
+ || (__lhs.category() == __rhs.category()
+ && __lhs.value() < __rhs.value()));
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
+ { return (__os << __e.category().name() << ':' << __e.value()); }
+
+ error_condition make_error_condition(errc);
+
+ /// error_condition
+ // Portable error identification
+ struct error_condition
+ {
+ error_condition()
+ : _M_value(0), _M_cat(&generic_category()) { }
+
+ error_condition(int __v, const error_category& __cat)
+ : _M_value(__v), _M_cat(&__cat) { }
+
+ template<typename _ErrorConditionEnum>
+ error_condition(_ErrorConditionEnum __e,
+ typename enable_if<is_error_condition_enum
+ <_ErrorConditionEnum>::value>::type* = 0)
+ { *this = make_error_condition(__e); }
+
+ void
+ assign(int __v, const error_category& __cat)
+ {
+ _M_value = __v;
+ _M_cat = &__cat;
+ }
+
+ // DR 804.
+ template<typename _ErrorConditionEnum>
+ typename enable_if<is_error_condition_enum
+ <_ErrorConditionEnum>::value, error_condition&>::type
+ operator=(_ErrorConditionEnum __e)
+ { return *this = make_error_condition(__e); }
+
+ void
+ clear()
+ { assign(0, generic_category()); }
+
+ // 19.4.3.4 observers
+ int
+ value() const { return _M_value; }
+
+ const error_category&
+ category() const { return *_M_cat; }
+
+ string
+ message() const
+ { return category().message(value()); }
+
+ // Safe bool idiom.
+ // explicit operator bool() const throw()
+ // { return _M_value != 0; }
+ typedef void (*__bool_type)();
+
+ static void __not_bool_type() { }
+
+ operator __bool_type() const
+ { return _M_value != 0 ? &__not_bool_type : false; }
+
+ // DR 804.
+ private:
+ int _M_value;
+ const error_category* _M_cat;
+ };
+
+ // 19.4.3.6 non-member functions
+ inline error_condition
+ make_error_condition(errc __e)
+ { return error_condition(static_cast<int>(__e), generic_category()); }
+
+ inline bool
+ operator<(const error_condition& __lhs, const error_condition& __rhs)
+ {
+ return (__lhs.category() < __rhs.category()
+ || (__lhs.category() == __rhs.category()
+ && __lhs.value() < __rhs.value()));
+ }
+
+ // 19.4.4 Comparison operators
+ inline bool
+ operator==(const error_code& __lhs, const error_code& __rhs)
+ { return (__lhs.category() == __rhs.category()
+ && __lhs.value() == __rhs.value()); }
+
+ inline bool
+ operator==(const error_code& __lhs, const error_condition& __rhs)
+ {
+ return (__lhs.category().equivalent(__lhs.value(), __rhs)
+ || __rhs.category().equivalent(__lhs, __rhs.value()));
+ }
+
+ inline bool
+ operator==(const error_condition& __lhs, const error_code& __rhs)
+ {
+ return (__rhs.category().equivalent(__rhs.value(), __lhs)
+ || __lhs.category().equivalent(__rhs, __lhs.value()));
+ }
+
+ inline bool
+ operator==(const error_condition& __lhs, const error_condition& __rhs)
+ {
+ return (__lhs.category() == __rhs.category()
+ && __lhs.value() == __rhs.value());
+ }
+
+ inline bool
+ operator!=(const error_code& __lhs, const error_code& __rhs)
+ { return !(__lhs == __rhs); }
+
+ inline bool
+ operator!=(const error_code& __lhs, const error_condition& __rhs)
+ { return !(__lhs == __rhs); }
+
+ inline bool
+ operator!=(const error_condition& __lhs, const error_code& __rhs)
+ { return !(__lhs == __rhs); }
+
+ inline bool
+ operator!=(const error_condition& __lhs, const error_condition& __rhs)
+ { return !(__lhs == __rhs); }
+
+
+ /**
+ * @brief Thrown to indicate error code of underlying system.
+ *
+ * @ingroup exceptions
+ */
+ class system_error : public std::runtime_error
+ {
+ private:
+ error_code _M_code;
+
+ public:
+ system_error(error_code __ec = error_code())
+ : runtime_error(""), _M_code(__ec) { }
+
+ system_error(error_code __ec, const string& __what)
+ : runtime_error(__what), _M_code(__ec) { }
+
+ /*
+ * TODO: Add const char* ctors to all exceptions.
+ *
+ * system_error(error_code __ec, const char* __what)
+ * : runtime_error(__what), _M_code(__ec) { }
+ *
+ * system_error(int __v, const error_category& __ecat, const char* __what)
+ * : runtime_error(__what), _M_code(error_code(__v, __ecat)) { }
+ */
+
+ system_error(int __v, const error_category& __ecat)
+ : runtime_error(""), _M_code(error_code(__v, __ecat)) { }
+
+ system_error(int __v, const error_category& __ecat, const string& __what)
+ : runtime_error(__what), _M_code(error_code(__v, __ecat)) { }
+
+ virtual ~system_error() throw();
+
+ const error_code&
+ code() const throw() { return _M_code; }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+#endif // _GLIBCXX_SYSTEM_ERROR
+
diff --git a/i686-linux/include/c++/4.4.3/tgmath.h b/i686-linux/include/c++/4.4.3/tgmath.h
new file mode 100644
index 0000000..3d84d37
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tgmath.h
@@ -0,0 +1,42 @@
+// -*- C++ -*- compatibility header.
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tgmath.h
+ * This is a Standard C++ Library header.
+ */
+
+#include <bits/c++config.h>
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# include <ctgmath>
+#else
+# if _GLIBCXX_HAVE_TGMATH_H
+# include_next <tgmath.h>
+# endif
+#endif
+
+#ifndef _GLIBCXX_TGMATH_H
+#define _GLIBCXX_TGMATH_H 1
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/thread b/i686-linux/include/c++/4.4.3/thread
new file mode 100644
index 0000000..6f735a0
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/thread
@@ -0,0 +1,284 @@
+// <thread> -*- C++ -*-
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file thread
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_THREAD
+#define _GLIBCXX_THREAD 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#else
+
+#include <chrono>
+#include <functional>
+#include <memory>
+#include <mutex>
+#include <condition_variable>
+#include <cstddef>
+#include <bits/functexcept.h>
+#include <bits/gthr.h>
+
+#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
+
+namespace std
+{
+ /**
+ * @defgroup threads Threads
+ * @ingroup concurrency
+ *
+ * Classes for thread support.
+ * @{
+ */
+
+ /// thread
+ class thread
+ {
+ public:
+ typedef __gthread_t native_handle_type;
+ struct _Impl_base;
+ typedef shared_ptr<_Impl_base> __shared_base_type;
+
+ /// thread::id
+ class id
+ {
+ native_handle_type _M_thread;
+
+ public:
+ id() : _M_thread() { }
+
+ explicit
+ id(native_handle_type __id) : _M_thread(__id) { }
+
+ private:
+ friend class thread;
+
+ friend bool
+ operator==(thread::id __x, thread::id __y)
+ { return __gthread_equal(__x._M_thread, __y._M_thread); }
+
+ friend bool
+ operator<(thread::id __x, thread::id __y)
+ { return __x._M_thread < __y._M_thread; }
+
+ template<class _CharT, class _Traits>
+ friend basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>&& __out, thread::id __id);
+ };
+
+ // Simple base type that the templatized, derived class containing
+ // an arbitrary functor can be converted to and called.
+ struct _Impl_base
+ {
+ __shared_base_type _M_this_ptr;
+
+ virtual ~_Impl_base() = default;
+
+ virtual void _M_run() = 0;
+ };
+
+ template<typename _Callable>
+ struct _Impl : public _Impl_base
+ {
+ _Callable _M_func;
+
+ _Impl(_Callable&& __f) : _M_func(std::forward<_Callable>(__f))
+ { }
+
+ void
+ _M_run() { _M_func(); }
+ };
+
+ private:
+ id _M_id;
+
+ public:
+ thread() = default;
+ thread(const thread&) = delete;
+
+ thread(thread&& __t)
+ { swap(__t); }
+
+ template<typename _Callable>
+ explicit thread(_Callable __f)
+ { _M_start_thread(_M_make_routine<_Callable>(__f)); }
+
+ template<typename _Callable, typename... _Args>
+ thread(_Callable&& __f, _Args&&... __args)
+ { _M_start_thread(_M_make_routine(std::bind(__f, __args...))); }
+
+ ~thread()
+ {
+ if (joinable())
+ std::terminate();
+ }
+
+ thread& operator=(const thread&) = delete;
+
+ thread& operator=(thread&& __t)
+ {
+ if (joinable())
+ std::terminate();
+ swap(__t);
+ return *this;
+ }
+
+ void
+ swap(thread&& __t)
+ { std::swap(_M_id, __t._M_id); }
+
+ bool
+ joinable() const
+ { return !(_M_id == id()); }
+
+ void
+ join();
+
+ void
+ detach();
+
+ thread::id
+ get_id() const
+ { return _M_id; }
+
+ /** @pre thread is joinable
+ */
+ native_handle_type
+ native_handle()
+ { return _M_id._M_thread; }
+
+ // Returns a value that hints at the number of hardware thread contexts.
+ static unsigned int
+ hardware_concurrency()
+ { return 0; }
+
+ private:
+ void
+ _M_start_thread(__shared_base_type);
+
+ template<typename _Callable>
+ shared_ptr<_Impl<_Callable>>
+ _M_make_routine(_Callable&& __f)
+ {
+ // Create and allocate full data structure, not base.
+ return make_shared<_Impl<_Callable>>(std::forward<_Callable>(__f));
+ }
+ };
+
+ inline void
+ swap(thread& __x, thread& __y)
+ { __x.swap(__y); }
+
+ inline void
+ swap(thread&& __x, thread& __y)
+ { __x.swap(__y); }
+
+ inline void
+ swap(thread& __x, thread&& __y)
+ { __x.swap(__y); }
+
+ inline bool
+ operator!=(thread::id __x, thread::id __y)
+ { return !(__x == __y); }
+
+ inline bool
+ operator<=(thread::id __x, thread::id __y)
+ { return !(__y < __x); }
+
+ inline bool
+ operator>(thread::id __x, thread::id __y)
+ { return __y < __x; }
+
+ inline bool
+ operator>=(thread::id __x, thread::id __y)
+ { return !(__x < __y); }
+
+ template<class _CharT, class _Traits>
+ inline basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>&& __out, thread::id __id)
+ {
+ if (__id == thread::id())
+ return __out << "thread::id of a non-executing thread";
+ else
+ return __out << __id._M_thread;
+ }
+
+ /** @namespace std::this_thread
+ * @brief ISO C++ 0x entities sub namespace for thread.
+ * 30.2.2 Namespace this_thread.
+ */
+ namespace this_thread
+ {
+ /// get_id
+ inline thread::id
+ get_id() { return thread::id(__gthread_self()); }
+
+#ifdef _GLIBCXX_USE_SCHED_YIELD
+ /// yield
+ inline void
+ yield()
+ { __gthread_yield(); }
+#endif
+
+#ifdef _GLIBCXX_USE_NANOSLEEP
+ /// sleep_until
+ template<typename _Clock, typename _Duration>
+ inline void
+ sleep_until(const chrono::time_point<_Clock, _Duration>& __atime)
+ { sleep_for(__atime - _Clock::now()); }
+
+ /// sleep_for
+ template<typename _Rep, typename _Period>
+ inline void
+ sleep_for(const chrono::duration<_Rep, _Period>& __rtime)
+ {
+ chrono::seconds __s =
+ chrono::duration_cast<chrono::seconds>(__rtime);
+
+ chrono::nanoseconds __ns =
+ chrono::duration_cast<chrono::nanoseconds>(__rtime - __s);
+
+ __gthread_time_t __ts =
+ {
+ static_cast<std::time_t>(__s.count()),
+ static_cast<long>(__ns.count())
+ };
+
+ ::nanosleep(&__ts, 0);
+ }
+#endif
+ }
+
+ // @} group threads
+}
+
+#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1
+
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+#endif // _GLIBCXX_THREAD
diff --git a/i686-linux/include/c++/4.4.3/tr1/array b/i686-linux/include/c++/4.4.3/tr1/array
new file mode 100644
index 0000000..17cf5d2
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/array
@@ -0,0 +1,54 @@
+// class template array -*- C++ -*-
+
+// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/array
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_ARRAY
+#define _GLIBCXX_TR1_ARRAY 1
+
+#pragma GCC system_header
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+#include <bits/stl_algobase.h>
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/array>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/array>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+#endif // _GLIBCXX_TR1_ARRAY
diff --git a/i686-linux/include/c++/4.4.3/tr1/bessel_function.tcc b/i686-linux/include/c++/4.4.3/tr1/bessel_function.tcc
new file mode 100644
index 0000000..2510215
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/bessel_function.tcc
@@ -0,0 +1,627 @@
+// Special functions -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/bessel_function.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882 TR1: 5.2 Special functions
+//
+
+// Written by Edward Smith-Rowland.
+//
+// References:
+// (1) Handbook of Mathematical Functions,
+// ed. Milton Abramowitz and Irene A. Stegun,
+// Dover Publications,
+// Section 9, pp. 355-434, Section 10 pp. 435-478
+// (2) The Gnu Scientific Library, http://www.gnu.org/software/gsl
+// (3) Numerical Recipes in C, by W. H. Press, S. A. Teukolsky,
+// W. T. Vetterling, B. P. Flannery, Cambridge University Press (1992),
+// 2nd ed, pp. 240-245
+
+#ifndef _GLIBCXX_TR1_BESSEL_FUNCTION_TCC
+#define _GLIBCXX_TR1_BESSEL_FUNCTION_TCC 1
+
+#include "special_function_util.h"
+
+namespace std
+{
+namespace tr1
+{
+
+ // [5.2] Special functions
+
+ // Implementation-space details.
+ namespace __detail
+ {
+
+ /**
+ * @brief Compute the gamma functions required by the Temme series
+ * expansions of @f$ N_\nu(x) @f$ and @f$ K_\nu(x) @f$.
+ * @f[
+ * \Gamma_1 = \frac{1}{2\mu}
+ * [\frac{1}{\Gamma(1 - \mu)} - \frac{1}{\Gamma(1 + \mu)}]
+ * @f]
+ * and
+ * @f[
+ * \Gamma_2 = \frac{1}{2}
+ * [\frac{1}{\Gamma(1 - \mu)} + \frac{1}{\Gamma(1 + \mu)}]
+ * @f]
+ * where @f$ -1/2 <= \mu <= 1/2 @f$ is @f$ \mu = \nu - N @f$ and @f$ N @f$.
+ * is the nearest integer to @f$ \nu @f$.
+ * The values of \f$ \Gamma(1 + \mu) \f$ and \f$ \Gamma(1 - \mu) \f$
+ * are returned as well.
+ *
+ * The accuracy requirements on this are exquisite.
+ *
+ * @param __mu The input parameter of the gamma functions.
+ * @param __gam1 The output function \f$ \Gamma_1(\mu) \f$
+ * @param __gam2 The output function \f$ \Gamma_2(\mu) \f$
+ * @param __gampl The output function \f$ \Gamma(1 + \mu) \f$
+ * @param __gammi The output function \f$ \Gamma(1 - \mu) \f$
+ */
+ template <typename _Tp>
+ void
+ __gamma_temme(const _Tp __mu,
+ _Tp & __gam1, _Tp & __gam2, _Tp & __gampl, _Tp & __gammi)
+ {
+#if _GLIBCXX_USE_C99_MATH_TR1
+ __gampl = _Tp(1) / std::tr1::tgamma(_Tp(1) + __mu);
+ __gammi = _Tp(1) / std::tr1::tgamma(_Tp(1) - __mu);
+#else
+ __gampl = _Tp(1) / __gamma(_Tp(1) + __mu);
+ __gammi = _Tp(1) / __gamma(_Tp(1) - __mu);
+#endif
+
+ if (std::abs(__mu) < std::numeric_limits<_Tp>::epsilon())
+ __gam1 = -_Tp(__numeric_constants<_Tp>::__gamma_e());
+ else
+ __gam1 = (__gammi - __gampl) / (_Tp(2) * __mu);
+
+ __gam2 = (__gammi + __gampl) / (_Tp(2));
+
+ return;
+ }
+
+
+ /**
+ * @brief Compute the Bessel @f$ J_\nu(x) @f$ and Neumann
+ * @f$ N_\nu(x) @f$ functions and their first derivatives
+ * @f$ J'_\nu(x) @f$ and @f$ N'_\nu(x) @f$ respectively.
+ * These four functions are computed together for numerical
+ * stability.
+ *
+ * @param __nu The order of the Bessel functions.
+ * @param __x The argument of the Bessel functions.
+ * @param __Jnu The output Bessel function of the first kind.
+ * @param __Nnu The output Neumann function (Bessel function of the second kind).
+ * @param __Jpnu The output derivative of the Bessel function of the first kind.
+ * @param __Npnu The output derivative of the Neumann function.
+ */
+ template <typename _Tp>
+ void
+ __bessel_jn(const _Tp __nu, const _Tp __x,
+ _Tp & __Jnu, _Tp & __Nnu, _Tp & __Jpnu, _Tp & __Npnu)
+ {
+ if (__x == _Tp(0))
+ {
+ if (__nu == _Tp(0))
+ {
+ __Jnu = _Tp(1);
+ __Jpnu = _Tp(0);
+ }
+ else if (__nu == _Tp(1))
+ {
+ __Jnu = _Tp(0);
+ __Jpnu = _Tp(0.5L);
+ }
+ else
+ {
+ __Jnu = _Tp(0);
+ __Jpnu = _Tp(0);
+ }
+ __Nnu = -std::numeric_limits<_Tp>::infinity();
+ __Npnu = std::numeric_limits<_Tp>::infinity();
+ return;
+ }
+
+ const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
+ // When the multiplier is N i.e.
+ // fp_min = N * min()
+ // Then J_0 and N_0 tank at x = 8 * N (J_0 = 0 and N_0 = nan)!
+ //const _Tp __fp_min = _Tp(20) * std::numeric_limits<_Tp>::min();
+ const _Tp __fp_min = std::sqrt(std::numeric_limits<_Tp>::min());
+ const int __max_iter = 15000;
+ const _Tp __x_min = _Tp(2);
+
+ const int __nl = (__x < __x_min
+ ? static_cast<int>(__nu + _Tp(0.5L))
+ : std::max(0, static_cast<int>(__nu - __x + _Tp(1.5L))));
+
+ const _Tp __mu = __nu - __nl;
+ const _Tp __mu2 = __mu * __mu;
+ const _Tp __xi = _Tp(1) / __x;
+ const _Tp __xi2 = _Tp(2) * __xi;
+ _Tp __w = __xi2 / __numeric_constants<_Tp>::__pi();
+ int __isign = 1;
+ _Tp __h = __nu * __xi;
+ if (__h < __fp_min)
+ __h = __fp_min;
+ _Tp __b = __xi2 * __nu;
+ _Tp __d = _Tp(0);
+ _Tp __c = __h;
+ int __i;
+ for (__i = 1; __i <= __max_iter; ++__i)
+ {
+ __b += __xi2;
+ __d = __b - __d;
+ if (std::abs(__d) < __fp_min)
+ __d = __fp_min;
+ __c = __b - _Tp(1) / __c;
+ if (std::abs(__c) < __fp_min)
+ __c = __fp_min;
+ __d = _Tp(1) / __d;
+ const _Tp __del = __c * __d;
+ __h *= __del;
+ if (__d < _Tp(0))
+ __isign = -__isign;
+ if (std::abs(__del - _Tp(1)) < __eps)
+ break;
+ }
+ if (__i > __max_iter)
+ std::__throw_runtime_error(__N("Argument x too large in __bessel_jn; "
+ "try asymptotic expansion."));
+ _Tp __Jnul = __isign * __fp_min;
+ _Tp __Jpnul = __h * __Jnul;
+ _Tp __Jnul1 = __Jnul;
+ _Tp __Jpnu1 = __Jpnul;
+ _Tp __fact = __nu * __xi;
+ for ( int __l = __nl; __l >= 1; --__l )
+ {
+ const _Tp __Jnutemp = __fact * __Jnul + __Jpnul;
+ __fact -= __xi;
+ __Jpnul = __fact * __Jnutemp - __Jnul;
+ __Jnul = __Jnutemp;
+ }
+ if (__Jnul == _Tp(0))
+ __Jnul = __eps;
+ _Tp __f= __Jpnul / __Jnul;
+ _Tp __Nmu, __Nnu1, __Npmu, __Jmu;
+ if (__x < __x_min)
+ {
+ const _Tp __x2 = __x / _Tp(2);
+ const _Tp __pimu = __numeric_constants<_Tp>::__pi() * __mu;
+ _Tp __fact = (std::abs(__pimu) < __eps
+ ? _Tp(1) : __pimu / std::sin(__pimu));
+ _Tp __d = -std::log(__x2);
+ _Tp __e = __mu * __d;
+ _Tp __fact2 = (std::abs(__e) < __eps
+ ? _Tp(1) : std::sinh(__e) / __e);
+ _Tp __gam1, __gam2, __gampl, __gammi;
+ __gamma_temme(__mu, __gam1, __gam2, __gampl, __gammi);
+ _Tp __ff = (_Tp(2) / __numeric_constants<_Tp>::__pi())
+ * __fact * (__gam1 * std::cosh(__e) + __gam2 * __fact2 * __d);
+ __e = std::exp(__e);
+ _Tp __p = __e / (__numeric_constants<_Tp>::__pi() * __gampl);
+ _Tp __q = _Tp(1) / (__e * __numeric_constants<_Tp>::__pi() * __gammi);
+ const _Tp __pimu2 = __pimu / _Tp(2);
+ _Tp __fact3 = (std::abs(__pimu2) < __eps
+ ? _Tp(1) : std::sin(__pimu2) / __pimu2 );
+ _Tp __r = __numeric_constants<_Tp>::__pi() * __pimu2 * __fact3 * __fact3;
+ _Tp __c = _Tp(1);
+ __d = -__x2 * __x2;
+ _Tp __sum = __ff + __r * __q;
+ _Tp __sum1 = __p;
+ for (__i = 1; __i <= __max_iter; ++__i)
+ {
+ __ff = (__i * __ff + __p + __q) / (__i * __i - __mu2);
+ __c *= __d / _Tp(__i);
+ __p /= _Tp(__i) - __mu;
+ __q /= _Tp(__i) + __mu;
+ const _Tp __del = __c * (__ff + __r * __q);
+ __sum += __del;
+ const _Tp __del1 = __c * __p - __i * __del;
+ __sum1 += __del1;
+ if ( std::abs(__del) < __eps * (_Tp(1) + std::abs(__sum)) )
+ break;
+ }
+ if ( __i > __max_iter )
+ std::__throw_runtime_error(__N("Bessel y series failed to converge "
+ "in __bessel_jn."));
+ __Nmu = -__sum;
+ __Nnu1 = -__sum1 * __xi2;
+ __Npmu = __mu * __xi * __Nmu - __Nnu1;
+ __Jmu = __w / (__Npmu - __f * __Nmu);
+ }
+ else
+ {
+ _Tp __a = _Tp(0.25L) - __mu2;
+ _Tp __q = _Tp(1);
+ _Tp __p = -__xi / _Tp(2);
+ _Tp __br = _Tp(2) * __x;
+ _Tp __bi = _Tp(2);
+ _Tp __fact = __a * __xi / (__p * __p + __q * __q);
+ _Tp __cr = __br + __q * __fact;
+ _Tp __ci = __bi + __p * __fact;
+ _Tp __den = __br * __br + __bi * __bi;
+ _Tp __dr = __br / __den;
+ _Tp __di = -__bi / __den;
+ _Tp __dlr = __cr * __dr - __ci * __di;
+ _Tp __dli = __cr * __di + __ci * __dr;
+ _Tp __temp = __p * __dlr - __q * __dli;
+ __q = __p * __dli + __q * __dlr;
+ __p = __temp;
+ int __i;
+ for (__i = 2; __i <= __max_iter; ++__i)
+ {
+ __a += _Tp(2 * (__i - 1));
+ __bi += _Tp(2);
+ __dr = __a * __dr + __br;
+ __di = __a * __di + __bi;
+ if (std::abs(__dr) + std::abs(__di) < __fp_min)
+ __dr = __fp_min;
+ __fact = __a / (__cr * __cr + __ci * __ci);
+ __cr = __br + __cr * __fact;
+ __ci = __bi - __ci * __fact;
+ if (std::abs(__cr) + std::abs(__ci) < __fp_min)
+ __cr = __fp_min;
+ __den = __dr * __dr + __di * __di;
+ __dr /= __den;
+ __di /= -__den;
+ __dlr = __cr * __dr - __ci * __di;
+ __dli = __cr * __di + __ci * __dr;
+ __temp = __p * __dlr - __q * __dli;
+ __q = __p * __dli + __q * __dlr;
+ __p = __temp;
+ if (std::abs(__dlr - _Tp(1)) + std::abs(__dli) < __eps)
+ break;
+ }
+ if (__i > __max_iter)
+ std::__throw_runtime_error(__N("Lentz's method failed "
+ "in __bessel_jn."));
+ const _Tp __gam = (__p - __f) / __q;
+ __Jmu = std::sqrt(__w / ((__p - __f) * __gam + __q));
+#if _GLIBCXX_USE_C99_MATH_TR1
+ __Jmu = std::tr1::copysign(__Jmu, __Jnul);
+#else
+ if (__Jmu * __Jnul < _Tp(0))
+ __Jmu = -__Jmu;
+#endif
+ __Nmu = __gam * __Jmu;
+ __Npmu = (__p + __q / __gam) * __Nmu;
+ __Nnu1 = __mu * __xi * __Nmu - __Npmu;
+ }
+ __fact = __Jmu / __Jnul;
+ __Jnu = __fact * __Jnul1;
+ __Jpnu = __fact * __Jpnu1;
+ for (__i = 1; __i <= __nl; ++__i)
+ {
+ const _Tp __Nnutemp = (__mu + __i) * __xi2 * __Nnu1 - __Nmu;
+ __Nmu = __Nnu1;
+ __Nnu1 = __Nnutemp;
+ }
+ __Nnu = __Nmu;
+ __Npnu = __nu * __xi * __Nmu - __Nnu1;
+
+ return;
+ }
+
+
+ /**
+ * @brief This routine computes the asymptotic cylindrical Bessel
+ * and Neumann functions of order nu: \f$ J_{\nu} \f$,
+ * \f$ N_{\nu} \f$.
+ *
+ * References:
+ * (1) Handbook of Mathematical Functions,
+ * ed. Milton Abramowitz and Irene A. Stegun,
+ * Dover Publications,
+ * Section 9 p. 364, Equations 9.2.5-9.2.10
+ *
+ * @param __nu The order of the Bessel functions.
+ * @param __x The argument of the Bessel functions.
+ * @param __Jnu The output Bessel function of the first kind.
+ * @param __Nnu The output Neumann function (Bessel function of the second kind).
+ */
+ template <typename _Tp>
+ void
+ __cyl_bessel_jn_asymp(const _Tp __nu, const _Tp __x,
+ _Tp & __Jnu, _Tp & __Nnu)
+ {
+ const _Tp __coef = std::sqrt(_Tp(2)
+ / (__numeric_constants<_Tp>::__pi() * __x));
+ const _Tp __mu = _Tp(4) * __nu * __nu;
+ const _Tp __mum1 = __mu - _Tp(1);
+ const _Tp __mum9 = __mu - _Tp(9);
+ const _Tp __mum25 = __mu - _Tp(25);
+ const _Tp __mum49 = __mu - _Tp(49);
+ const _Tp __xx = _Tp(64) * __x * __x;
+ const _Tp __P = _Tp(1) - __mum1 * __mum9 / (_Tp(2) * __xx)
+ * (_Tp(1) - __mum25 * __mum49 / (_Tp(12) * __xx));
+ const _Tp __Q = __mum1 / (_Tp(8) * __x)
+ * (_Tp(1) - __mum9 * __mum25 / (_Tp(6) * __xx));
+
+ const _Tp __chi = __x - (__nu + _Tp(0.5L))
+ * __numeric_constants<_Tp>::__pi_2();
+ const _Tp __c = std::cos(__chi);
+ const _Tp __s = std::sin(__chi);
+
+ __Jnu = __coef * (__c * __P - __s * __Q);
+ __Nnu = __coef * (__s * __P + __c * __Q);
+
+ return;
+ }
+
+
+ /**
+ * @brief This routine returns the cylindrical Bessel functions
+ * of order \f$ \nu \f$: \f$ J_{\nu} \f$ or \f$ I_{\nu} \f$
+ * by series expansion.
+ *
+ * The modified cylindrical Bessel function is:
+ * @f[
+ * Z_{\nu}(x) = \sum_{k=0}^{\infty}
+ * \frac{\sigma^k (x/2)^{\nu + 2k}}{k!\Gamma(\nu+k+1)}
+ * @f]
+ * where \f$ \sigma = +1 \f$ or\f$ -1 \f$ for
+ * \f$ Z = I \f$ or \f$ J \f$ respectively.
+ *
+ * See Abramowitz & Stegun, 9.1.10
+ * Abramowitz & Stegun, 9.6.7
+ * (1) Handbook of Mathematical Functions,
+ * ed. Milton Abramowitz and Irene A. Stegun,
+ * Dover Publications,
+ * Equation 9.1.10 p. 360 and Equation 9.6.10 p. 375
+ *
+ * @param __nu The order of the Bessel function.
+ * @param __x The argument of the Bessel function.
+ * @param __sgn The sign of the alternate terms
+ * -1 for the Bessel function of the first kind.
+ * +1 for the modified Bessel function of the first kind.
+ * @return The output Bessel function.
+ */
+ template <typename _Tp>
+ _Tp
+ __cyl_bessel_ij_series(const _Tp __nu, const _Tp __x, const _Tp __sgn,
+ const unsigned int __max_iter)
+ {
+
+ const _Tp __x2 = __x / _Tp(2);
+ _Tp __fact = __nu * std::log(__x2);
+#if _GLIBCXX_USE_C99_MATH_TR1
+ __fact -= std::tr1::lgamma(__nu + _Tp(1));
+#else
+ __fact -= __log_gamma(__nu + _Tp(1));
+#endif
+ __fact = std::exp(__fact);
+ const _Tp __xx4 = __sgn * __x2 * __x2;
+ _Tp __Jn = _Tp(1);
+ _Tp __term = _Tp(1);
+
+ for (unsigned int __i = 1; __i < __max_iter; ++__i)
+ {
+ __term *= __xx4 / (_Tp(__i) * (__nu + _Tp(__i)));
+ __Jn += __term;
+ if (std::abs(__term / __Jn) < std::numeric_limits<_Tp>::epsilon())
+ break;
+ }
+
+ return __fact * __Jn;
+ }
+
+
+ /**
+ * @brief Return the Bessel function of order \f$ \nu \f$:
+ * \f$ J_{\nu}(x) \f$.
+ *
+ * The cylindrical Bessel function is:
+ * @f[
+ * J_{\nu}(x) = \sum_{k=0}^{\infty}
+ * \frac{(-1)^k (x/2)^{\nu + 2k}}{k!\Gamma(\nu+k+1)}
+ * @f]
+ *
+ * @param __nu The order of the Bessel function.
+ * @param __x The argument of the Bessel function.
+ * @return The output Bessel function.
+ */
+ template<typename _Tp>
+ _Tp
+ __cyl_bessel_j(const _Tp __nu, const _Tp __x)
+ {
+ if (__nu < _Tp(0) || __x < _Tp(0))
+ std::__throw_domain_error(__N("Bad argument "
+ "in __cyl_bessel_j."));
+ else if (__isnan(__nu) || __isnan(__x))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (__x * __x < _Tp(10) * (__nu + _Tp(1)))
+ return __cyl_bessel_ij_series(__nu, __x, -_Tp(1), 200);
+ else if (__x > _Tp(1000))
+ {
+ _Tp __J_nu, __N_nu;
+ __cyl_bessel_jn_asymp(__nu, __x, __J_nu, __N_nu);
+ return __J_nu;
+ }
+ else
+ {
+ _Tp __J_nu, __N_nu, __Jp_nu, __Np_nu;
+ __bessel_jn(__nu, __x, __J_nu, __N_nu, __Jp_nu, __Np_nu);
+ return __J_nu;
+ }
+ }
+
+
+ /**
+ * @brief Return the Neumann function of order \f$ \nu \f$:
+ * \f$ N_{\nu}(x) \f$.
+ *
+ * The Neumann function is defined by:
+ * @f[
+ * N_{\nu}(x) = \frac{J_{\nu}(x) \cos \nu\pi - J_{-\nu}(x)}
+ * {\sin \nu\pi}
+ * @f]
+ * where for integral \f$ \nu = n \f$ a limit is taken:
+ * \f$ lim_{\nu \to n} \f$.
+ *
+ * @param __nu The order of the Neumann function.
+ * @param __x The argument of the Neumann function.
+ * @return The output Neumann function.
+ */
+ template<typename _Tp>
+ _Tp
+ __cyl_neumann_n(const _Tp __nu, const _Tp __x)
+ {
+ if (__nu < _Tp(0) || __x < _Tp(0))
+ std::__throw_domain_error(__N("Bad argument "
+ "in __cyl_neumann_n."));
+ else if (__isnan(__nu) || __isnan(__x))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (__x > _Tp(1000))
+ {
+ _Tp __J_nu, __N_nu;
+ __cyl_bessel_jn_asymp(__nu, __x, __J_nu, __N_nu);
+ return __N_nu;
+ }
+ else
+ {
+ _Tp __J_nu, __N_nu, __Jp_nu, __Np_nu;
+ __bessel_jn(__nu, __x, __J_nu, __N_nu, __Jp_nu, __Np_nu);
+ return __N_nu;
+ }
+ }
+
+
+ /**
+ * @brief Compute the spherical Bessel @f$ j_n(x) @f$
+ * and Neumann @f$ n_n(x) @f$ functions and their first
+ * derivatives @f$ j'_n(x) @f$ and @f$ n'_n(x) @f$
+ * respectively.
+ *
+ * @param __n The order of the spherical Bessel function.
+ * @param __x The argument of the spherical Bessel function.
+ * @param __j_n The output spherical Bessel function.
+ * @param __n_n The output spherical Neumann function.
+ * @param __jp_n The output derivative of the spherical Bessel function.
+ * @param __np_n The output derivative of the spherical Neumann function.
+ */
+ template <typename _Tp>
+ void
+ __sph_bessel_jn(const unsigned int __n, const _Tp __x,
+ _Tp & __j_n, _Tp & __n_n, _Tp & __jp_n, _Tp & __np_n)
+ {
+ const _Tp __nu = _Tp(__n) + _Tp(0.5L);
+
+ _Tp __J_nu, __N_nu, __Jp_nu, __Np_nu;
+ __bessel_jn(__nu, __x, __J_nu, __N_nu, __Jp_nu, __Np_nu);
+
+ const _Tp __factor = __numeric_constants<_Tp>::__sqrtpio2()
+ / std::sqrt(__x);
+
+ __j_n = __factor * __J_nu;
+ __n_n = __factor * __N_nu;
+ __jp_n = __factor * __Jp_nu - __j_n / (_Tp(2) * __x);
+ __np_n = __factor * __Np_nu - __n_n / (_Tp(2) * __x);
+
+ return;
+ }
+
+
+ /**
+ * @brief Return the spherical Bessel function
+ * @f$ j_n(x) @f$ of order n.
+ *
+ * The spherical Bessel function is defined by:
+ * @f[
+ * j_n(x) = \left( \frac{\pi}{2x} \right) ^{1/2} J_{n+1/2}(x)
+ * @f]
+ *
+ * @param __n The order of the spherical Bessel function.
+ * @param __x The argument of the spherical Bessel function.
+ * @return The output spherical Bessel function.
+ */
+ template <typename _Tp>
+ _Tp
+ __sph_bessel(const unsigned int __n, const _Tp __x)
+ {
+ if (__x < _Tp(0))
+ std::__throw_domain_error(__N("Bad argument "
+ "in __sph_bessel."));
+ else if (__isnan(__x))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (__x == _Tp(0))
+ {
+ if (__n == 0)
+ return _Tp(1);
+ else
+ return _Tp(0);
+ }
+ else
+ {
+ _Tp __j_n, __n_n, __jp_n, __np_n;
+ __sph_bessel_jn(__n, __x, __j_n, __n_n, __jp_n, __np_n);
+ return __j_n;
+ }
+ }
+
+
+ /**
+ * @brief Return the spherical Neumann function
+ * @f$ n_n(x) @f$.
+ *
+ * The spherical Neumann function is defined by:
+ * @f[
+ * n_n(x) = \left( \frac{\pi}{2x} \right) ^{1/2} N_{n+1/2}(x)
+ * @f]
+ *
+ * @param __n The order of the spherical Neumann function.
+ * @param __x The argument of the spherical Neumann function.
+ * @return The output spherical Neumann function.
+ */
+ template <typename _Tp>
+ _Tp
+ __sph_neumann(const unsigned int __n, const _Tp __x)
+ {
+ if (__x < _Tp(0))
+ std::__throw_domain_error(__N("Bad argument "
+ "in __sph_neumann."));
+ else if (__isnan(__x))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (__x == _Tp(0))
+ return -std::numeric_limits<_Tp>::infinity();
+ else
+ {
+ _Tp __j_n, __n_n, __jp_n, __np_n;
+ __sph_bessel_jn(__n, __x, __j_n, __n_n, __jp_n, __np_n);
+ return __n_n;
+ }
+ }
+
+ } // namespace std::tr1::__detail
+}
+}
+
+#endif // _GLIBCXX_TR1_BESSEL_FUNCTION_TCC
diff --git a/i686-linux/include/c++/4.4.3/tr1/beta_function.tcc b/i686-linux/include/c++/4.4.3/tr1/beta_function.tcc
new file mode 100644
index 0000000..f9d1860
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/beta_function.tcc
@@ -0,0 +1,197 @@
+// Special functions -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/beta_function.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882 TR1: 5.2 Special functions
+//
+
+// Written by Edward Smith-Rowland based on:
+// (1) Handbook of Mathematical Functions,
+// ed. Milton Abramowitz and Irene A. Stegun,
+// Dover Publications,
+// Section 6, pp. 253-266
+// (2) The Gnu Scientific Library, http://www.gnu.org/software/gsl
+// (3) Numerical Recipes in C, by W. H. Press, S. A. Teukolsky,
+// W. T. Vetterling, B. P. Flannery, Cambridge University Press (1992),
+// 2nd ed, pp. 213-216
+// (4) Gamma, Exploring Euler's Constant, Julian Havil,
+// Princeton, 2003.
+
+#ifndef _GLIBCXX_TR1_BETA_FUNCTION_TCC
+#define _GLIBCXX_TR1_BETA_FUNCTION_TCC 1
+
+namespace std
+{
+namespace tr1
+{
+
+ // [5.2] Special functions
+
+ // Implementation-space details.
+ namespace __detail
+ {
+
+ /**
+ * @brief Return the beta function: \f$B(x,y)\f$.
+ *
+ * The beta function is defined by
+ * @f[
+ * B(x,y) = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)}
+ * @f]
+ *
+ * @param __x The first argument of the beta function.
+ * @param __y The second argument of the beta function.
+ * @return The beta function.
+ */
+ template<typename _Tp>
+ _Tp
+ __beta_gamma(_Tp __x, _Tp __y)
+ {
+
+ _Tp __bet;
+#if _GLIBCXX_USE_C99_MATH_TR1
+ if (__x > __y)
+ {
+ __bet = std::tr1::tgamma(__x)
+ / std::tr1::tgamma(__x + __y);
+ __bet *= std::tr1::tgamma(__y);
+ }
+ else
+ {
+ __bet = std::tr1::tgamma(__y)
+ / std::tr1::tgamma(__x + __y);
+ __bet *= std::tr1::tgamma(__x);
+ }
+#else
+ if (__x > __y)
+ {
+ __bet = __gamma(__x) / __gamma(__x + __y);
+ __bet *= __gamma(__y);
+ }
+ else
+ {
+ __bet = __gamma(__y) / __gamma(__x + __y);
+ __bet *= __gamma(__x);
+ }
+#endif
+
+ return __bet;
+ }
+
+ /**
+ * @brief Return the beta function \f$B(x,y)\f$ using
+ * the log gamma functions.
+ *
+ * The beta function is defined by
+ * @f[
+ * B(x,y) = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)}
+ * @f]
+ *
+ * @param __x The first argument of the beta function.
+ * @param __y The second argument of the beta function.
+ * @return The beta function.
+ */
+ template<typename _Tp>
+ _Tp
+ __beta_lgamma(_Tp __x, _Tp __y)
+ {
+#if _GLIBCXX_USE_C99_MATH_TR1
+ _Tp __bet = std::tr1::lgamma(__x)
+ + std::tr1::lgamma(__y)
+ - std::tr1::lgamma(__x + __y);
+#else
+ _Tp __bet = __log_gamma(__x)
+ + __log_gamma(__y)
+ - __log_gamma(__x + __y);
+#endif
+ __bet = std::exp(__bet);
+ return __bet;
+ }
+
+
+ /**
+ * @brief Return the beta function \f$B(x,y)\f$ using
+ * the product form.
+ *
+ * The beta function is defined by
+ * @f[
+ * B(x,y) = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)}
+ * @f]
+ *
+ * @param __x The first argument of the beta function.
+ * @param __y The second argument of the beta function.
+ * @return The beta function.
+ */
+ template<typename _Tp>
+ _Tp
+ __beta_product(_Tp __x, _Tp __y)
+ {
+
+ _Tp __bet = (__x + __y) / (__x * __y);
+
+ unsigned int __max_iter = 1000000;
+ for (unsigned int __k = 1; __k < __max_iter; ++__k)
+ {
+ _Tp __term = (_Tp(1) + (__x + __y) / __k)
+ / ((_Tp(1) + __x / __k) * (_Tp(1) + __y / __k));
+ __bet *= __term;
+ }
+
+ return __bet;
+ }
+
+
+ /**
+ * @brief Return the beta function \f$ B(x,y) \f$.
+ *
+ * The beta function is defined by
+ * @f[
+ * B(x,y) = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)}
+ * @f]
+ *
+ * @param __x The first argument of the beta function.
+ * @param __y The second argument of the beta function.
+ * @return The beta function.
+ */
+ template<typename _Tp>
+ inline _Tp
+ __beta(_Tp __x, _Tp __y)
+ {
+ if (__isnan(__x) || __isnan(__y))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else
+ return __beta_lgamma(__x, __y);
+ }
+
+ } // namespace std::tr1::__detail
+}
+}
+
+#endif // __GLIBCXX_TR1_BETA_FUNCTION_TCC
diff --git a/i686-linux/include/c++/4.4.3/tr1/ccomplex b/i686-linux/include/c++/4.4.3/tr1/ccomplex
new file mode 100644
index 0000000..a0ae33e
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/ccomplex
@@ -0,0 +1,34 @@
+// TR1 ccomplex -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/ccomplex
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_CCOMPLEX
+#define _GLIBCXX_TR1_CCOMPLEX 1
+
+#include <tr1/complex>
+
+#endif // _GLIBCXX_TR1_CCOMPLEX
diff --git a/i686-linux/include/c++/4.4.3/tr1/cctype b/i686-linux/include/c++/4.4.3/tr1/cctype
new file mode 100644
index 0000000..93e864e
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/cctype
@@ -0,0 +1,49 @@
+// TR1 cctype -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/cctype
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_CCTYPE
+#define _GLIBCXX_TR1_CCTYPE 1
+
+#include <bits/c++config.h>
+#include <cctype>
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/cctype>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/cctype>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+#endif // _GLIBCXX_TR1_CCTYPE
diff --git a/i686-linux/include/c++/4.4.3/tr1/cfenv b/i686-linux/include/c++/4.4.3/tr1/cfenv
new file mode 100644
index 0000000..e4c4fac
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/cfenv
@@ -0,0 +1,53 @@
+// TR1 cfenv -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/cfenv
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_CFENV
+#define _GLIBCXX_TR1_CFENV 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#if _GLIBCXX_HAVE_FENV_H
+# include <fenv.h>
+#endif
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/cfenv>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/cfenv>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+#endif // _GLIBCXX_TR1_CFENV
diff --git a/i686-linux/include/c++/4.4.3/tr1/cfloat b/i686-linux/include/c++/4.4.3/tr1/cfloat
new file mode 100644
index 0000000..801cfc3
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/cfloat
@@ -0,0 +1,42 @@
+// TR1 cfloat -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/cfloat
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_CFLOAT
+#define _GLIBCXX_TR1_CFLOAT 1
+
+#include <cfloat>
+
+#ifndef DECIMAL_DIG
+#define DECIMAL_DIG __DECIMAL_DIG__
+#endif
+
+#ifndef FLT_EVAL_METHOD
+#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
+#endif
+
+#endif //_GLIBCXX_TR1_CFLOAT
diff --git a/i686-linux/include/c++/4.4.3/tr1/cinttypes b/i686-linux/include/c++/4.4.3/tr1/cinttypes
new file mode 100644
index 0000000..71fd545
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/cinttypes
@@ -0,0 +1,63 @@
+// TR1 cinttypes -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/cinttypes
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_CINTTYPES
+#define _GLIBCXX_TR1_CINTTYPES 1
+
+#pragma GCC system_header
+
+#include <tr1/cstdint>
+
+// For 8.11.1/1 (see C99, Note 184)
+#if _GLIBCXX_HAVE_INTTYPES_H
+# ifndef __STDC_FORMAT_MACROS
+# define _UNDEF__STDC_FORMAT_MACROS
+# define __STDC_FORMAT_MACROS
+# endif
+# include <inttypes.h>
+# ifdef _UNDEF__STDC_FORMAT_MACROS
+# undef __STDC_FORMAT_MACROS
+# undef _UNDEF__STDC_FORMAT_MACROS
+# endif
+#endif
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/cinttypes>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/cinttypes>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+#endif // _GLIBCXX_TR1_CINTTYPES
diff --git a/i686-linux/include/c++/4.4.3/tr1/climits b/i686-linux/include/c++/4.4.3/tr1/climits
new file mode 100644
index 0000000..91af96b
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/climits
@@ -0,0 +1,46 @@
+// TR1 climits -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/climits
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_CLIMITS
+#define _GLIBCXX_TR1_CLIMITS 1
+
+#include <climits>
+
+#ifndef LLONG_MIN
+#define LLONG_MIN (-__LONG_LONG_MAX__ - 1)
+#endif
+
+#ifndef LLONG_MAX
+#define LLONG_MAX __LONG_LONG_MAX__
+#endif
+
+#ifndef ULLONG_MAX
+#define ULLONG_MAX (__LONG_LONG_MAX__ * 2ULL + 1)
+#endif
+
+#endif // _GLIBCXX_TR1_CLIMITS
diff --git a/i686-linux/include/c++/4.4.3/tr1/cmath b/i686-linux/include/c++/4.4.3/tr1/cmath
new file mode 100644
index 0000000..a9fbf2b
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/cmath
@@ -0,0 +1,507 @@
+// TR1 cmath -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/cmath
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_CMATH
+#define _GLIBCXX_TR1_CMATH 1
+
+#pragma GCC system_header
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+#include <cmath>
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/cmath>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/cmath>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+namespace std
+{
+namespace tr1
+{
+ // DR 550. What should the return type of pow(float,int) be?
+ // NB: C++0x and TR1 != C++03.
+ inline double
+ pow(double __x, double __y)
+ { return std::pow(__x, __y); }
+
+ inline float
+ pow(float __x, float __y)
+ { return std::pow(__x, __y); }
+
+ inline long double
+ pow(long double __x, long double __y)
+ { return std::pow(__x, __y); }
+
+ template<typename _Tp, typename _Up>
+ inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+ pow(_Tp __x, _Up __y)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+ return std::pow(__type(__x), __type(__y));
+ }
+}
+}
+
+#include <bits/stl_algobase.h>
+#include <limits>
+#include <tr1/type_traits>
+
+#include <tr1/gamma.tcc>
+#include <tr1/bessel_function.tcc>
+#include <tr1/beta_function.tcc>
+#include <tr1/ell_integral.tcc>
+#include <tr1/exp_integral.tcc>
+#include <tr1/hypergeometric.tcc>
+#include <tr1/legendre_function.tcc>
+#include <tr1/modified_bessel_func.tcc>
+#include <tr1/poly_hermite.tcc>
+#include <tr1/poly_laguerre.tcc>
+#include <tr1/riemann_zeta.tcc>
+
+namespace std
+{
+namespace tr1
+{
+ /**
+ * @defgroup tr1_math_spec_func Mathematical Special Functions
+ * @ingroup numerics
+ *
+ * A collection of advanced mathematical special functions.
+ * @{
+ */
+
+ inline float
+ assoc_laguerref(unsigned int __n, unsigned int __m, float __x)
+ { return __detail::__assoc_laguerre<float>(__n, __m, __x); }
+
+ inline long double
+ assoc_laguerrel(unsigned int __n, unsigned int __m, long double __x)
+ {
+ return __detail::__assoc_laguerre<long double>(__n, __m, __x);
+ }
+
+ /// 5.2.1.1 Associated Laguerre polynomials.
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ assoc_laguerre(unsigned int __n, unsigned int __m, _Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __detail::__assoc_laguerre<__type>(__n, __m, __x);
+ }
+
+ inline float
+ assoc_legendref(unsigned int __l, unsigned int __m, float __x)
+ { return __detail::__assoc_legendre_p<float>(__l, __m, __x); }
+
+ inline long double
+ assoc_legendrel(unsigned int __l, unsigned int __m, long double __x)
+ { return __detail::__assoc_legendre_p<long double>(__l, __m, __x); }
+
+ /// 5.2.1.2 Associated Legendre functions.
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ assoc_legendre(unsigned int __l, unsigned int __m, _Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __detail::__assoc_legendre_p<__type>(__l, __m, __x);
+ }
+
+ inline float
+ betaf(float __x, float __y)
+ { return __detail::__beta<float>(__x, __y); }
+
+ inline long double
+ betal(long double __x, long double __y)
+ { return __detail::__beta<long double>(__x, __y); }
+
+ /// 5.2.1.3 Beta functions.
+ template<typename _Tpx, typename _Tpy>
+ inline typename __gnu_cxx::__promote_2<_Tpx, _Tpy>::__type
+ beta(_Tpx __x, _Tpy __y)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tpx, _Tpy>::__type __type;
+ return __detail::__beta<__type>(__x, __y);
+ }
+
+ inline float
+ comp_ellint_1f(float __k)
+ { return __detail::__comp_ellint_1<float>(__k); }
+
+ inline long double
+ comp_ellint_1l(long double __k)
+ { return __detail::__comp_ellint_1<long double>(__k); }
+
+ /// 5.2.1.4 Complete elliptic integrals of the first kind.
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ comp_ellint_1(_Tp __k)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __detail::__comp_ellint_1<__type>(__k);
+ }
+
+ inline float
+ comp_ellint_2f(float __k)
+ { return __detail::__comp_ellint_2<float>(__k); }
+
+ inline long double
+ comp_ellint_2l(long double __k)
+ { return __detail::__comp_ellint_2<long double>(__k); }
+
+ /// 5.2.1.5 Complete elliptic integrals of the second kind.
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ comp_ellint_2(_Tp __k)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __detail::__comp_ellint_2<__type>(__k);
+ }
+
+ inline float
+ comp_ellint_3f(float __k, float __nu)
+ { return __detail::__comp_ellint_3<float>(__k, __nu); }
+
+ inline long double
+ comp_ellint_3l(long double __k, long double __nu)
+ { return __detail::__comp_ellint_3<long double>(__k, __nu); }
+
+ /// 5.2.1.6 Complete elliptic integrals of the third kind.
+ template<typename _Tp, typename _Tpn>
+ inline typename __gnu_cxx::__promote_2<_Tp, _Tpn>::__type
+ comp_ellint_3(_Tp __k, _Tpn __nu)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tp, _Tpn>::__type __type;
+ return __detail::__comp_ellint_3<__type>(__k, __nu);
+ }
+
+ inline float
+ conf_hypergf(float __a, float __c, float __x)
+ { return __detail::__conf_hyperg<float>(__a, __c, __x); }
+
+ inline long double
+ conf_hypergl(long double __a, long double __c, long double __x)
+ { return __detail::__conf_hyperg<long double>(__a, __c, __x); }
+
+ /// 5.2.1.7 Confluent hypergeometric functions.
+ template<typename _Tpa, typename _Tpc, typename _Tp>
+ inline typename __gnu_cxx::__promote_3<_Tpa, _Tpc, _Tp>::__type
+ conf_hyperg(_Tpa __a, _Tpc __c, _Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote_3<_Tpa, _Tpc, _Tp>::__type __type;
+ return __detail::__conf_hyperg<__type>(__a, __c, __x);
+ }
+
+ inline float
+ cyl_bessel_if(float __nu, float __x)
+ { return __detail::__cyl_bessel_i<float>(__nu, __x); }
+
+ inline long double
+ cyl_bessel_il(long double __nu, long double __x)
+ { return __detail::__cyl_bessel_i<long double>(__nu, __x); }
+
+ /// 5.2.1.8 Regular modified cylindrical Bessel functions.
+ template<typename _Tpnu, typename _Tp>
+ inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type
+ cyl_bessel_i(_Tpnu __nu, _Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type;
+ return __detail::__cyl_bessel_i<__type>(__nu, __x);
+ }
+
+ inline float
+ cyl_bessel_jf(float __nu, float __x)
+ { return __detail::__cyl_bessel_j<float>(__nu, __x); }
+
+ inline long double
+ cyl_bessel_jl(long double __nu, long double __x)
+ { return __detail::__cyl_bessel_j<long double>(__nu, __x); }
+
+ /// 5.2.1.9 Cylindrical Bessel functions (of the first kind).
+ template<typename _Tpnu, typename _Tp>
+ inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type
+ cyl_bessel_j(_Tpnu __nu, _Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type;
+ return __detail::__cyl_bessel_j<__type>(__nu, __x);
+ }
+
+ inline float
+ cyl_bessel_kf(float __nu, float __x)
+ { return __detail::__cyl_bessel_k<float>(__nu, __x); }
+
+ inline long double
+ cyl_bessel_kl(long double __nu, long double __x)
+ { return __detail::__cyl_bessel_k<long double>(__nu, __x); }
+
+ /// 5.2.1.10 Irregular modified cylindrical Bessel functions.
+ template<typename _Tpnu, typename _Tp>
+ inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type
+ cyl_bessel_k(_Tpnu __nu, _Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type;
+ return __detail::__cyl_bessel_k<__type>(__nu, __x);
+ }
+
+ inline float
+ cyl_neumannf(float __nu, float __x)
+ { return __detail::__cyl_neumann_n<float>(__nu, __x); }
+
+ inline long double
+ cyl_neumannl(long double __nu, long double __x)
+ { return __detail::__cyl_neumann_n<long double>(__nu, __x); }
+
+ /// 5.2.1.11 Cylindrical Neumann functions.
+ template<typename _Tpnu, typename _Tp>
+ inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type
+ cyl_neumann(_Tpnu __nu, _Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type;
+ return __detail::__cyl_neumann_n<__type>(__nu, __x);
+ }
+
+ inline float
+ ellint_1f(float __k, float __phi)
+ { return __detail::__ellint_1<float>(__k, __phi); }
+
+ inline long double
+ ellint_1l(long double __k, long double __phi)
+ { return __detail::__ellint_1<long double>(__k, __phi); }
+
+ /// 5.2.1.12 Incomplete elliptic integrals of the first kind.
+ template<typename _Tp, typename _Tpp>
+ inline typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type
+ ellint_1(_Tp __k, _Tpp __phi)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type __type;
+ return __detail::__ellint_1<__type>(__k, __phi);
+ }
+
+ inline float
+ ellint_2f(float __k, float __phi)
+ { return __detail::__ellint_2<float>(__k, __phi); }
+
+ inline long double
+ ellint_2l(long double __k, long double __phi)
+ { return __detail::__ellint_2<long double>(__k, __phi); }
+
+ /// 5.2.1.13 Incomplete elliptic integrals of the second kind.
+ template<typename _Tp, typename _Tpp>
+ inline typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type
+ ellint_2(_Tp __k, _Tpp __phi)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type __type;
+ return __detail::__ellint_2<__type>(__k, __phi);
+ }
+
+ inline float
+ ellint_3f(float __k, float __nu, float __phi)
+ { return __detail::__ellint_3<float>(__k, __nu, __phi); }
+
+ inline long double
+ ellint_3l(long double __k, long double __nu, long double __phi)
+ { return __detail::__ellint_3<long double>(__k, __nu, __phi); }
+
+ /// 5.2.1.14 Incomplete elliptic integrals of the third kind.
+ template<typename _Tp, typename _Tpn, typename _Tpp>
+ inline typename __gnu_cxx::__promote_3<_Tp, _Tpn, _Tpp>::__type
+ ellint_3(_Tp __k, _Tpn __nu, _Tpp __phi)
+ {
+ typedef typename __gnu_cxx::__promote_3<_Tp, _Tpn, _Tpp>::__type __type;
+ return __detail::__ellint_3<__type>(__k, __nu, __phi);
+ }
+
+ inline float
+ expintf(float __x)
+ { return __detail::__expint<float>(__x); }
+
+ inline long double
+ expintl(long double __x)
+ { return __detail::__expint<long double>(__x); }
+
+ /// 5.2.1.15 Exponential integrals.
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ expint(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __detail::__expint<__type>(__x);
+ }
+
+ inline float
+ hermitef(unsigned int __n, float __x)
+ { return __detail::__poly_hermite<float>(__n, __x); }
+
+ inline long double
+ hermitel(unsigned int __n, long double __x)
+ { return __detail::__poly_hermite<long double>(__n, __x); }
+
+ /// 5.2.1.16 Hermite polynomials.
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ hermite(unsigned int __n, _Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __detail::__poly_hermite<__type>(__n, __x);
+ }
+
+ inline float
+ hypergf(float __a, float __b, float __c, float __x)
+ { return __detail::__hyperg<float>(__a, __b, __c, __x); }
+
+ inline long double
+ hypergl(long double __a, long double __b, long double __c, long double __x)
+ { return __detail::__hyperg<long double>(__a, __b, __c, __x); }
+
+ /// 5.2.1.17 Hypergeometric functions.
+ template<typename _Tpa, typename _Tpb, typename _Tpc, typename _Tp>
+ inline typename __gnu_cxx::__promote_4<_Tpa, _Tpb, _Tpc, _Tp>::__type
+ hyperg(_Tpa __a, _Tpb __b, _Tpc __c, _Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote_4<_Tpa, _Tpb, _Tpc, _Tp>::__type __type;
+ return __detail::__hyperg<__type>(__a, __b, __c, __x);
+ }
+
+ inline float
+ laguerref(unsigned int __n, float __x)
+ { return __detail::__laguerre<float>(__n, __x); }
+
+ inline long double
+ laguerrel(unsigned int __n, long double __x)
+ { return __detail::__laguerre<long double>(__n, __x); }
+
+ /// 5.2.1.18 Laguerre polynomials.
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ laguerre(unsigned int __n, _Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __detail::__laguerre<__type>(__n, __x);
+ }
+
+ inline float
+ legendref(unsigned int __n, float __x)
+ { return __detail::__poly_legendre_p<float>(__n, __x); }
+
+ inline long double
+ legendrel(unsigned int __n, long double __x)
+ { return __detail::__poly_legendre_p<long double>(__n, __x); }
+
+ /// 5.2.1.19 Legendre polynomials.
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ legendre(unsigned int __n, _Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __detail::__poly_legendre_p<__type>(__n, __x);
+ }
+
+ inline float
+ riemann_zetaf(float __x)
+ { return __detail::__riemann_zeta<float>(__x); }
+
+ inline long double
+ riemann_zetal(long double __x)
+ { return __detail::__riemann_zeta<long double>(__x); }
+
+ /// 5.2.1.20 Riemann zeta function.
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ riemann_zeta(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __detail::__riemann_zeta<__type>(__x);
+ }
+
+ inline float
+ sph_besself(unsigned int __n, float __x)
+ { return __detail::__sph_bessel<float>(__n, __x); }
+
+ inline long double
+ sph_bessell(unsigned int __n, long double __x)
+ { return __detail::__sph_bessel<long double>(__n, __x); }
+
+ /// 5.2.1.21 Spherical Bessel functions.
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ sph_bessel(unsigned int __n, _Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __detail::__sph_bessel<__type>(__n, __x);
+ }
+
+ inline float
+ sph_legendref(unsigned int __l, unsigned int __m, float __theta)
+ { return __detail::__sph_legendre<float>(__l, __m, __theta); }
+
+ inline long double
+ sph_legendrel(unsigned int __l, unsigned int __m, long double __theta)
+ { return __detail::__sph_legendre<long double>(__l, __m, __theta); }
+
+ /// 5.2.1.22 Spherical associated Legendre functions.
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ sph_legendre(unsigned int __l, unsigned int __m, _Tp __theta)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __detail::__sph_legendre<__type>(__l, __m, __theta);
+ }
+
+ inline float
+ sph_neumannf(unsigned int __n, float __x)
+ { return __detail::__sph_neumann<float>(__n, __x); }
+
+ inline long double
+ sph_neumannl(unsigned int __n, long double __x)
+ { return __detail::__sph_neumann<long double>(__n, __x); }
+
+ /// 5.2.1.23 Spherical Neumann functions.
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ sph_neumann(unsigned int __n, _Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __detail::__sph_neumann<__type>(__n, __x);
+ }
+
+ /* @} */ // tr1_math_spec_func
+}
+}
+
+#endif // _GLIBCXX_TR1_CMATH
diff --git a/i686-linux/include/c++/4.4.3/tr1/complex b/i686-linux/include/c++/4.4.3/tr1/complex
new file mode 100644
index 0000000..3ed1eb9
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/complex
@@ -0,0 +1,91 @@
+// TR1 complex -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/complex
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_COMPLEX
+#define _GLIBCXX_TR1_COMPLEX 1
+
+#pragma GCC system_header
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+#include <complex>
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/complex>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/complex>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+namespace std
+{
+namespace tr1
+{
+ using std::arg;
+ using std::conj;
+ using std::imag;
+ using std::norm;
+ using std::polar;
+
+ template<typename _Tp, typename _Up>
+ inline std::complex<typename __gnu_cxx::__promote_2<_Tp, _Up>::__type>
+ polar(const _Tp& __rho, const _Up& __theta)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+ return std::polar(__type(__rho), __type(__theta));
+ }
+
+ using std::real;
+
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ pow(const std::complex<_Tp>& __x, const _Tp& __y)
+ { return std::pow(__x, __y); }
+
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ pow(const _Tp& __x, const std::complex<_Tp>& __y)
+ { return std::pow(__x, __y); }
+
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ pow(const std::complex<_Tp>& __x, const std::complex<_Tp>& __y)
+ { return std::pow(__x, __y); }
+}
+}
+
+#endif // _GLIBCXX_TR1_COMPLEX
diff --git a/i686-linux/include/c++/4.4.3/tr1/complex.h b/i686-linux/include/c++/4.4.3/tr1/complex.h
new file mode 100644
index 0000000..0f28810
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/complex.h
@@ -0,0 +1,34 @@
+// TR1 complex.h -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/complex.h
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_COMPLEX_H
+#define _GLIBCXX_TR1_COMPLEX_H 1
+
+#include <tr1/ccomplex>
+
+#endif // _GLIBCXX_TR1_COMPLEX_H
diff --git a/i686-linux/include/c++/4.4.3/tr1/cstdarg b/i686-linux/include/c++/4.4.3/tr1/cstdarg
new file mode 100644
index 0000000..bc2e881
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/cstdarg
@@ -0,0 +1,34 @@
+// TR1 cstdarg -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/cstdarg
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_CSTDARG
+#define _GLIBCXX_TR1_CSTDARG 1
+
+#include <cstdarg>
+
+#endif // _GLIBCXX_TR1_CSTDARG
diff --git a/i686-linux/include/c++/4.4.3/tr1/cstdbool b/i686-linux/include/c++/4.4.3/tr1/cstdbool
new file mode 100644
index 0000000..d68e4b8
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/cstdbool
@@ -0,0 +1,40 @@
+// TR1 cstdbool -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/cstdbool
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_CSTDBOOL
+#define _GLIBCXX_TR1_CSTDBOOL 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+
+#if _GLIBCXX_HAVE_STDBOOL_H
+#include <stdbool.h>
+#endif
+
+#endif // _GLIBCXX_TR1_CSTDBOOL
diff --git a/i686-linux/include/c++/4.4.3/tr1/cstdint b/i686-linux/include/c++/4.4.3/tr1/cstdint
new file mode 100644
index 0000000..1e6cc37
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/cstdint
@@ -0,0 +1,76 @@
+// TR1 cstdint -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/cstdint
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_CSTDINT
+#define _GLIBCXX_TR1_CSTDINT 1
+
+#pragma GCC system_header
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+#include <bits/c++config.h>
+
+// For 8.22.1/1 (see C99, Notes 219, 220, 222)
+# if _GLIBCXX_HAVE_STDINT_H
+# ifndef __STDC_LIMIT_MACROS
+# define _UNDEF__STDC_LIMIT_MACROS
+# define __STDC_LIMIT_MACROS
+# endif
+# ifndef __STDC_CONSTANT_MACROS
+# define _UNDEF__STDC_CONSTANT_MACROS
+# define __STDC_CONSTANT_MACROS
+# endif
+# include <stdint.h>
+# ifdef _UNDEF__STDC_LIMIT_MACROS
+# undef __STDC_LIMIT_MACROS
+# undef _UNDEF__STDC_LIMIT_MACROS
+# endif
+# ifdef _UNDEF__STDC_CONSTANT_MACROS
+# undef __STDC_CONSTANT_MACROS
+# undef _UNDEF__STDC_CONSTANT_MACROS
+# endif
+# endif
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/cstdint>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/cstdint>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+#endif // _GLIBCXX_TR1_CSTDINT
+
diff --git a/i686-linux/include/c++/4.4.3/tr1/cstdio b/i686-linux/include/c++/4.4.3/tr1/cstdio
new file mode 100644
index 0000000..cfcf31a
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/cstdio
@@ -0,0 +1,54 @@
+// TR1 cstdio -*- C++ -*-
+
+// Copyright (C) 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/cstdio
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_CSTDIO
+#define _GLIBCXX_TR1_CSTDIO 1
+
+#pragma GCC system_header
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+#include <cstdio>
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/cstdio>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/cstdio>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+#endif // _GLIBCXX_TR1_CSTDIO
diff --git a/i686-linux/include/c++/4.4.3/tr1/cstdlib b/i686-linux/include/c++/4.4.3/tr1/cstdlib
new file mode 100644
index 0000000..c9fab20
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/cstdlib
@@ -0,0 +1,54 @@
+// TR1 cstdlib -*- C++ -*-
+
+// Copyright (C) 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/cstdlib
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_CSTDLIB
+#define _GLIBCXX_TR1_CSTDLIB 1
+
+#pragma GCC system_header
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+#include <cstdlib>
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/cstdlib>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/cstdlib>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+#endif // _GLIBCXX_TR1_CSTDLIB
diff --git a/i686-linux/include/c++/4.4.3/tr1/ctgmath b/i686-linux/include/c++/4.4.3/tr1/ctgmath
new file mode 100644
index 0000000..e82a9a1
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/ctgmath
@@ -0,0 +1,34 @@
+// TR1 ctgmath -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/ctgmath
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_CTGMATH
+#define _GLIBCXX_TR1_CTGMATH 1
+
+#include <tr1/cmath>
+
+#endif // _GLIBCXX_TR1_CTGMATH
diff --git a/i686-linux/include/c++/4.4.3/tr1/ctime b/i686-linux/include/c++/4.4.3/tr1/ctime
new file mode 100644
index 0000000..bf76337
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/ctime
@@ -0,0 +1,34 @@
+// TR1 ctime -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/ctime
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_CTIME
+#define _GLIBCXX_TR1_CTIME 1
+
+#include <ctime>
+
+#endif // _GLIBCXX_TR1_CTIME
diff --git a/i686-linux/include/c++/4.4.3/tr1/ctype.h b/i686-linux/include/c++/4.4.3/tr1/ctype.h
new file mode 100644
index 0000000..712bedb
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/ctype.h
@@ -0,0 +1,34 @@
+// TR1 ctype.h -*- C++ -*-
+
+// Copyright (C) 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/ctype.h
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _TR1_CTYPE_H
+#define _TR1_CTYPE_H 1
+
+#include <tr1/cctype>
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/tr1/cwchar b/i686-linux/include/c++/4.4.3/tr1/cwchar
new file mode 100644
index 0000000..a27ebc3
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/cwchar
@@ -0,0 +1,54 @@
+// TR1 cwchar -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/cwchar
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_CWCHAR
+#define _GLIBCXX_TR1_CWCHAR 1
+
+#pragma GCC system_header
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+#include <cwchar>
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/cwchar>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/cwchar>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+#endif // _GLIBCXX_TR1_CWCHAR
diff --git a/i686-linux/include/c++/4.4.3/tr1/cwctype b/i686-linux/include/c++/4.4.3/tr1/cwctype
new file mode 100644
index 0000000..77cbb14
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/cwctype
@@ -0,0 +1,54 @@
+// TR1 cwctype -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/cwctype
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_CWCTYPE
+#define _GLIBCXX_TR1_CWCTYPE 1
+
+#pragma GCC system_header
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+#include <cwctype>
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/cwctype>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/cwctype>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+#endif // _GLIBCXX_TR1_CWCTYPE
diff --git a/i686-linux/include/c++/4.4.3/tr1/ell_integral.tcc b/i686-linux/include/c++/4.4.3/tr1/ell_integral.tcc
new file mode 100644
index 0000000..09bda9a
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/ell_integral.tcc
@@ -0,0 +1,750 @@
+// Special functions -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/ell_integral.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882 TR1: 5.2 Special functions
+//
+
+// Written by Edward Smith-Rowland based on:
+// (1) B. C. Carlson Numer. Math. 33, 1 (1979)
+// (2) B. C. Carlson, Special Functions of Applied Mathematics (1977)
+// (3) The Gnu Scientific Library, http://www.gnu.org/software/gsl
+// (4) Numerical Recipes in C, 2nd ed, by W. H. Press, S. A. Teukolsky,
+// W. T. Vetterling, B. P. Flannery, Cambridge University Press
+// (1992), pp. 261-269
+
+#ifndef _GLIBCXX_TR1_ELL_INTEGRAL_TCC
+#define _GLIBCXX_TR1_ELL_INTEGRAL_TCC 1
+
+namespace std
+{
+namespace tr1
+{
+
+ // [5.2] Special functions
+
+ // Implementation-space details.
+ namespace __detail
+ {
+
+ /**
+ * @brief Return the Carlson elliptic function @f$ R_F(x,y,z) @f$
+ * of the first kind.
+ *
+ * The Carlson elliptic function of the first kind is defined by:
+ * @f[
+ * R_F(x,y,z) = \frac{1}{2} \int_0^\infty
+ * \frac{dt}{(t + x)^{1/2}(t + y)^{1/2}(t + z)^{1/2}}
+ * @f]
+ *
+ * @param __x The first of three symmetric arguments.
+ * @param __y The second of three symmetric arguments.
+ * @param __z The third of three symmetric arguments.
+ * @return The Carlson elliptic function of the first kind.
+ */
+ template<typename _Tp>
+ _Tp
+ __ellint_rf(const _Tp __x, const _Tp __y, const _Tp __z)
+ {
+ const _Tp __min = std::numeric_limits<_Tp>::min();
+ const _Tp __max = std::numeric_limits<_Tp>::max();
+ const _Tp __lolim = _Tp(5) * __min;
+ const _Tp __uplim = __max / _Tp(5);
+
+ if (__x < _Tp(0) || __y < _Tp(0) || __z < _Tp(0))
+ std::__throw_domain_error(__N("Argument less than zero "
+ "in __ellint_rf."));
+ else if (__x + __y < __lolim || __x + __z < __lolim
+ || __y + __z < __lolim)
+ std::__throw_domain_error(__N("Argument too small in __ellint_rf"));
+ else
+ {
+ const _Tp __c0 = _Tp(1) / _Tp(4);
+ const _Tp __c1 = _Tp(1) / _Tp(24);
+ const _Tp __c2 = _Tp(1) / _Tp(10);
+ const _Tp __c3 = _Tp(3) / _Tp(44);
+ const _Tp __c4 = _Tp(1) / _Tp(14);
+
+ _Tp __xn = __x;
+ _Tp __yn = __y;
+ _Tp __zn = __z;
+
+ const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
+ const _Tp __errtol = std::pow(__eps, _Tp(1) / _Tp(6));
+ _Tp __mu;
+ _Tp __xndev, __yndev, __zndev;
+
+ const unsigned int __max_iter = 100;
+ for (unsigned int __iter = 0; __iter < __max_iter; ++__iter)
+ {
+ __mu = (__xn + __yn + __zn) / _Tp(3);
+ __xndev = 2 - (__mu + __xn) / __mu;
+ __yndev = 2 - (__mu + __yn) / __mu;
+ __zndev = 2 - (__mu + __zn) / __mu;
+ _Tp __epsilon = std::max(std::abs(__xndev), std::abs(__yndev));
+ __epsilon = std::max(__epsilon, std::abs(__zndev));
+ if (__epsilon < __errtol)
+ break;
+ const _Tp __xnroot = std::sqrt(__xn);
+ const _Tp __ynroot = std::sqrt(__yn);
+ const _Tp __znroot = std::sqrt(__zn);
+ const _Tp __lambda = __xnroot * (__ynroot + __znroot)
+ + __ynroot * __znroot;
+ __xn = __c0 * (__xn + __lambda);
+ __yn = __c0 * (__yn + __lambda);
+ __zn = __c0 * (__zn + __lambda);
+ }
+
+ const _Tp __e2 = __xndev * __yndev - __zndev * __zndev;
+ const _Tp __e3 = __xndev * __yndev * __zndev;
+ const _Tp __s = _Tp(1) + (__c1 * __e2 - __c2 - __c3 * __e3) * __e2
+ + __c4 * __e3;
+
+ return __s / std::sqrt(__mu);
+ }
+ }
+
+
+ /**
+ * @brief Return the complete elliptic integral of the first kind
+ * @f$ K(k) @f$ by series expansion.
+ *
+ * The complete elliptic integral of the first kind is defined as
+ * @f[
+ * K(k) = F(k,\pi/2) = \int_0^{\pi/2}\frac{d\theta}
+ * {\sqrt{1 - k^2sin^2\theta}}
+ * @f]
+ *
+ * This routine is not bad as long as |k| is somewhat smaller than 1
+ * but is not is good as the Carlson elliptic integral formulation.
+ *
+ * @param __k The argument of the complete elliptic function.
+ * @return The complete elliptic function of the first kind.
+ */
+ template<typename _Tp>
+ _Tp
+ __comp_ellint_1_series(const _Tp __k)
+ {
+
+ const _Tp __kk = __k * __k;
+
+ _Tp __term = __kk / _Tp(4);
+ _Tp __sum = _Tp(1) + __term;
+
+ const unsigned int __max_iter = 1000;
+ for (unsigned int __i = 2; __i < __max_iter; ++__i)
+ {
+ __term *= (2 * __i - 1) * __kk / (2 * __i);
+ if (__term < std::numeric_limits<_Tp>::epsilon())
+ break;
+ __sum += __term;
+ }
+
+ return __numeric_constants<_Tp>::__pi_2() * __sum;
+ }
+
+
+ /**
+ * @brief Return the complete elliptic integral of the first kind
+ * @f$ K(k) @f$ using the Carlson formulation.
+ *
+ * The complete elliptic integral of the first kind is defined as
+ * @f[
+ * K(k) = F(k,\pi/2) = \int_0^{\pi/2}\frac{d\theta}
+ * {\sqrt{1 - k^2 sin^2\theta}}
+ * @f]
+ * where @f$ F(k,\phi) @f$ is the incomplete elliptic integral of the
+ * first kind.
+ *
+ * @param __k The argument of the complete elliptic function.
+ * @return The complete elliptic function of the first kind.
+ */
+ template<typename _Tp>
+ _Tp
+ __comp_ellint_1(const _Tp __k)
+ {
+
+ if (__isnan(__k))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (std::abs(__k) >= _Tp(1))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else
+ return __ellint_rf(_Tp(0), _Tp(1) - __k * __k, _Tp(1));
+ }
+
+
+ /**
+ * @brief Return the incomplete elliptic integral of the first kind
+ * @f$ F(k,\phi) @f$ using the Carlson formulation.
+ *
+ * The incomplete elliptic integral of the first kind is defined as
+ * @f[
+ * F(k,\phi) = \int_0^{\phi}\frac{d\theta}
+ * {\sqrt{1 - k^2 sin^2\theta}}
+ * @f]
+ *
+ * @param __k The argument of the elliptic function.
+ * @param __phi The integral limit argument of the elliptic function.
+ * @return The elliptic function of the first kind.
+ */
+ template<typename _Tp>
+ _Tp
+ __ellint_1(const _Tp __k, const _Tp __phi)
+ {
+
+ if (__isnan(__k) || __isnan(__phi))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (std::abs(__k) > _Tp(1))
+ std::__throw_domain_error(__N("Bad argument in __ellint_1."));
+ else
+ {
+ // Reduce phi to -pi/2 < phi < +pi/2.
+ const int __n = std::floor(__phi / __numeric_constants<_Tp>::__pi()
+ + _Tp(0.5L));
+ const _Tp __phi_red = __phi
+ - __n * __numeric_constants<_Tp>::__pi();
+
+ const _Tp __s = std::sin(__phi_red);
+ const _Tp __c = std::cos(__phi_red);
+
+ const _Tp __F = __s
+ * __ellint_rf(__c * __c,
+ _Tp(1) - __k * __k * __s * __s, _Tp(1));
+
+ if (__n == 0)
+ return __F;
+ else
+ return __F + _Tp(2) * __n * __comp_ellint_1(__k);
+ }
+ }
+
+
+ /**
+ * @brief Return the complete elliptic integral of the second kind
+ * @f$ E(k) @f$ by series expansion.
+ *
+ * The complete elliptic integral of the second kind is defined as
+ * @f[
+ * E(k,\pi/2) = \int_0^{\pi/2}\sqrt{1 - k^2 sin^2\theta}
+ * @f]
+ *
+ * This routine is not bad as long as |k| is somewhat smaller than 1
+ * but is not is good as the Carlson elliptic integral formulation.
+ *
+ * @param __k The argument of the complete elliptic function.
+ * @return The complete elliptic function of the second kind.
+ */
+ template<typename _Tp>
+ _Tp
+ __comp_ellint_2_series(const _Tp __k)
+ {
+
+ const _Tp __kk = __k * __k;
+
+ _Tp __term = __kk;
+ _Tp __sum = __term;
+
+ const unsigned int __max_iter = 1000;
+ for (unsigned int __i = 2; __i < __max_iter; ++__i)
+ {
+ const _Tp __i2m = 2 * __i - 1;
+ const _Tp __i2 = 2 * __i;
+ __term *= __i2m * __i2m * __kk / (__i2 * __i2);
+ if (__term < std::numeric_limits<_Tp>::epsilon())
+ break;
+ __sum += __term / __i2m;
+ }
+
+ return __numeric_constants<_Tp>::__pi_2() * (_Tp(1) - __sum);
+ }
+
+
+ /**
+ * @brief Return the Carlson elliptic function of the second kind
+ * @f$ R_D(x,y,z) = R_J(x,y,z,z) @f$ where
+ * @f$ R_J(x,y,z,p) @f$ is the Carlson elliptic function
+ * of the third kind.
+ *
+ * The Carlson elliptic function of the second kind is defined by:
+ * @f[
+ * R_D(x,y,z) = \frac{3}{2} \int_0^\infty
+ * \frac{dt}{(t + x)^{1/2}(t + y)^{1/2}(t + z)^{3/2}}
+ * @f]
+ *
+ * Based on Carlson's algorithms:
+ * - B. C. Carlson Numer. Math. 33, 1 (1979)
+ * - B. C. Carlson, Special Functions of Applied Mathematics (1977)
+ * - Numerical Recipes in C, 2nd ed, pp. 261-269,
+ * by Press, Teukolsky, Vetterling, Flannery (1992)
+ *
+ * @param __x The first of two symmetric arguments.
+ * @param __y The second of two symmetric arguments.
+ * @param __z The third argument.
+ * @return The Carlson elliptic function of the second kind.
+ */
+ template<typename _Tp>
+ _Tp
+ __ellint_rd(const _Tp __x, const _Tp __y, const _Tp __z)
+ {
+ const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
+ const _Tp __errtol = std::pow(__eps / _Tp(8), _Tp(1) / _Tp(6));
+ const _Tp __min = std::numeric_limits<_Tp>::min();
+ const _Tp __max = std::numeric_limits<_Tp>::max();
+ const _Tp __lolim = _Tp(2) / std::pow(__max, _Tp(2) / _Tp(3));
+ const _Tp __uplim = std::pow(_Tp(0.1L) * __errtol / __min, _Tp(2) / _Tp(3));
+
+ if (__x < _Tp(0) || __y < _Tp(0))
+ std::__throw_domain_error(__N("Argument less than zero "
+ "in __ellint_rd."));
+ else if (__x + __y < __lolim || __z < __lolim)
+ std::__throw_domain_error(__N("Argument too small "
+ "in __ellint_rd."));
+ else
+ {
+ const _Tp __c0 = _Tp(1) / _Tp(4);
+ const _Tp __c1 = _Tp(3) / _Tp(14);
+ const _Tp __c2 = _Tp(1) / _Tp(6);
+ const _Tp __c3 = _Tp(9) / _Tp(22);
+ const _Tp __c4 = _Tp(3) / _Tp(26);
+
+ _Tp __xn = __x;
+ _Tp __yn = __y;
+ _Tp __zn = __z;
+ _Tp __sigma = _Tp(0);
+ _Tp __power4 = _Tp(1);
+
+ _Tp __mu;
+ _Tp __xndev, __yndev, __zndev;
+
+ const unsigned int __max_iter = 100;
+ for (unsigned int __iter = 0; __iter < __max_iter; ++__iter)
+ {
+ __mu = (__xn + __yn + _Tp(3) * __zn) / _Tp(5);
+ __xndev = (__mu - __xn) / __mu;
+ __yndev = (__mu - __yn) / __mu;
+ __zndev = (__mu - __zn) / __mu;
+ _Tp __epsilon = std::max(std::abs(__xndev), std::abs(__yndev));
+ __epsilon = std::max(__epsilon, std::abs(__zndev));
+ if (__epsilon < __errtol)
+ break;
+ _Tp __xnroot = std::sqrt(__xn);
+ _Tp __ynroot = std::sqrt(__yn);
+ _Tp __znroot = std::sqrt(__zn);
+ _Tp __lambda = __xnroot * (__ynroot + __znroot)
+ + __ynroot * __znroot;
+ __sigma += __power4 / (__znroot * (__zn + __lambda));
+ __power4 *= __c0;
+ __xn = __c0 * (__xn + __lambda);
+ __yn = __c0 * (__yn + __lambda);
+ __zn = __c0 * (__zn + __lambda);
+ }
+
+ // Note: __ea is an SPU badname.
+ _Tp __eaa = __xndev * __yndev;
+ _Tp __eb = __zndev * __zndev;
+ _Tp __ec = __eaa - __eb;
+ _Tp __ed = __eaa - _Tp(6) * __eb;
+ _Tp __ef = __ed + __ec + __ec;
+ _Tp __s1 = __ed * (-__c1 + __c3 * __ed
+ / _Tp(3) - _Tp(3) * __c4 * __zndev * __ef
+ / _Tp(2));
+ _Tp __s2 = __zndev
+ * (__c2 * __ef
+ + __zndev * (-__c3 * __ec - __zndev * __c4 - __eaa));
+
+ return _Tp(3) * __sigma + __power4 * (_Tp(1) + __s1 + __s2)
+ / (__mu * std::sqrt(__mu));
+ }
+ }
+
+
+ /**
+ * @brief Return the complete elliptic integral of the second kind
+ * @f$ E(k) @f$ using the Carlson formulation.
+ *
+ * The complete elliptic integral of the second kind is defined as
+ * @f[
+ * E(k,\pi/2) = \int_0^{\pi/2}\sqrt{1 - k^2 sin^2\theta}
+ * @f]
+ *
+ * @param __k The argument of the complete elliptic function.
+ * @return The complete elliptic function of the second kind.
+ */
+ template<typename _Tp>
+ _Tp
+ __comp_ellint_2(const _Tp __k)
+ {
+
+ if (__isnan(__k))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (std::abs(__k) == 1)
+ return _Tp(1);
+ else if (std::abs(__k) > _Tp(1))
+ std::__throw_domain_error(__N("Bad argument in __comp_ellint_2."));
+ else
+ {
+ const _Tp __kk = __k * __k;
+
+ return __ellint_rf(_Tp(0), _Tp(1) - __kk, _Tp(1))
+ - __kk * __ellint_rd(_Tp(0), _Tp(1) - __kk, _Tp(1)) / _Tp(3);
+ }
+ }
+
+
+ /**
+ * @brief Return the incomplete elliptic integral of the second kind
+ * @f$ E(k,\phi) @f$ using the Carlson formulation.
+ *
+ * The incomplete elliptic integral of the second kind is defined as
+ * @f[
+ * E(k,\phi) = \int_0^{\phi} \sqrt{1 - k^2 sin^2\theta}
+ * @f]
+ *
+ * @param __k The argument of the elliptic function.
+ * @param __phi The integral limit argument of the elliptic function.
+ * @return The elliptic function of the second kind.
+ */
+ template<typename _Tp>
+ _Tp
+ __ellint_2(const _Tp __k, const _Tp __phi)
+ {
+
+ if (__isnan(__k) || __isnan(__phi))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (std::abs(__k) > _Tp(1))
+ std::__throw_domain_error(__N("Bad argument in __ellint_2."));
+ else
+ {
+ // Reduce phi to -pi/2 < phi < +pi/2.
+ const int __n = std::floor(__phi / __numeric_constants<_Tp>::__pi()
+ + _Tp(0.5L));
+ const _Tp __phi_red = __phi
+ - __n * __numeric_constants<_Tp>::__pi();
+
+ const _Tp __kk = __k * __k;
+ const _Tp __s = std::sin(__phi_red);
+ const _Tp __ss = __s * __s;
+ const _Tp __sss = __ss * __s;
+ const _Tp __c = std::cos(__phi_red);
+ const _Tp __cc = __c * __c;
+
+ const _Tp __E = __s
+ * __ellint_rf(__cc, _Tp(1) - __kk * __ss, _Tp(1))
+ - __kk * __sss
+ * __ellint_rd(__cc, _Tp(1) - __kk * __ss, _Tp(1))
+ / _Tp(3);
+
+ if (__n == 0)
+ return __E;
+ else
+ return __E + _Tp(2) * __n * __comp_ellint_2(__k);
+ }
+ }
+
+
+ /**
+ * @brief Return the Carlson elliptic function
+ * @f$ R_C(x,y) = R_F(x,y,y) @f$ where @f$ R_F(x,y,z) @f$
+ * is the Carlson elliptic function of the first kind.
+ *
+ * The Carlson elliptic function is defined by:
+ * @f[
+ * R_C(x,y) = \frac{1}{2} \int_0^\infty
+ * \frac{dt}{(t + x)^{1/2}(t + y)}
+ * @f]
+ *
+ * Based on Carlson's algorithms:
+ * - B. C. Carlson Numer. Math. 33, 1 (1979)
+ * - B. C. Carlson, Special Functions of Applied Mathematics (1977)
+ * - Numerical Recipes in C, 2nd ed, pp. 261-269,
+ * by Press, Teukolsky, Vetterling, Flannery (1992)
+ *
+ * @param __x The first argument.
+ * @param __y The second argument.
+ * @return The Carlson elliptic function.
+ */
+ template<typename _Tp>
+ _Tp
+ __ellint_rc(const _Tp __x, const _Tp __y)
+ {
+ const _Tp __min = std::numeric_limits<_Tp>::min();
+ const _Tp __max = std::numeric_limits<_Tp>::max();
+ const _Tp __lolim = _Tp(5) * __min;
+ const _Tp __uplim = __max / _Tp(5);
+
+ if (__x < _Tp(0) || __y < _Tp(0) || __x + __y < __lolim)
+ std::__throw_domain_error(__N("Argument less than zero "
+ "in __ellint_rc."));
+ else
+ {
+ const _Tp __c0 = _Tp(1) / _Tp(4);
+ const _Tp __c1 = _Tp(1) / _Tp(7);
+ const _Tp __c2 = _Tp(9) / _Tp(22);
+ const _Tp __c3 = _Tp(3) / _Tp(10);
+ const _Tp __c4 = _Tp(3) / _Tp(8);
+
+ _Tp __xn = __x;
+ _Tp __yn = __y;
+
+ const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
+ const _Tp __errtol = std::pow(__eps / _Tp(30), _Tp(1) / _Tp(6));
+ _Tp __mu;
+ _Tp __sn;
+
+ const unsigned int __max_iter = 100;
+ for (unsigned int __iter = 0; __iter < __max_iter; ++__iter)
+ {
+ __mu = (__xn + _Tp(2) * __yn) / _Tp(3);
+ __sn = (__yn + __mu) / __mu - _Tp(2);
+ if (std::abs(__sn) < __errtol)
+ break;
+ const _Tp __lambda = _Tp(2) * std::sqrt(__xn) * std::sqrt(__yn)
+ + __yn;
+ __xn = __c0 * (__xn + __lambda);
+ __yn = __c0 * (__yn + __lambda);
+ }
+
+ _Tp __s = __sn * __sn
+ * (__c3 + __sn*(__c1 + __sn * (__c4 + __sn * __c2)));
+
+ return (_Tp(1) + __s) / std::sqrt(__mu);
+ }
+ }
+
+
+ /**
+ * @brief Return the Carlson elliptic function @f$ R_J(x,y,z,p) @f$
+ * of the third kind.
+ *
+ * The Carlson elliptic function of the third kind is defined by:
+ * @f[
+ * R_J(x,y,z,p) = \frac{3}{2} \int_0^\infty
+ * \frac{dt}{(t + x)^{1/2}(t + y)^{1/2}(t + z)^{1/2}(t + p)}
+ * @f]
+ *
+ * Based on Carlson's algorithms:
+ * - B. C. Carlson Numer. Math. 33, 1 (1979)
+ * - B. C. Carlson, Special Functions of Applied Mathematics (1977)
+ * - Numerical Recipes in C, 2nd ed, pp. 261-269,
+ * by Press, Teukolsky, Vetterling, Flannery (1992)
+ *
+ * @param __x The first of three symmetric arguments.
+ * @param __y The second of three symmetric arguments.
+ * @param __z The third of three symmetric arguments.
+ * @param __p The fourth argument.
+ * @return The Carlson elliptic function of the fourth kind.
+ */
+ template<typename _Tp>
+ _Tp
+ __ellint_rj(const _Tp __x, const _Tp __y, const _Tp __z, const _Tp __p)
+ {
+ const _Tp __min = std::numeric_limits<_Tp>::min();
+ const _Tp __max = std::numeric_limits<_Tp>::max();
+ const _Tp __lolim = std::pow(_Tp(5) * __min, _Tp(1)/_Tp(3));
+ const _Tp __uplim = _Tp(0.3L)
+ * std::pow(_Tp(0.2L) * __max, _Tp(1)/_Tp(3));
+
+ if (__x < _Tp(0) || __y < _Tp(0) || __z < _Tp(0))
+ std::__throw_domain_error(__N("Argument less than zero "
+ "in __ellint_rj."));
+ else if (__x + __y < __lolim || __x + __z < __lolim
+ || __y + __z < __lolim || __p < __lolim)
+ std::__throw_domain_error(__N("Argument too small "
+ "in __ellint_rj"));
+ else
+ {
+ const _Tp __c0 = _Tp(1) / _Tp(4);
+ const _Tp __c1 = _Tp(3) / _Tp(14);
+ const _Tp __c2 = _Tp(1) / _Tp(3);
+ const _Tp __c3 = _Tp(3) / _Tp(22);
+ const _Tp __c4 = _Tp(3) / _Tp(26);
+
+ _Tp __xn = __x;
+ _Tp __yn = __y;
+ _Tp __zn = __z;
+ _Tp __pn = __p;
+ _Tp __sigma = _Tp(0);
+ _Tp __power4 = _Tp(1);
+
+ const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
+ const _Tp __errtol = std::pow(__eps / _Tp(8), _Tp(1) / _Tp(6));
+
+ _Tp __lambda, __mu;
+ _Tp __xndev, __yndev, __zndev, __pndev;
+
+ const unsigned int __max_iter = 100;
+ for (unsigned int __iter = 0; __iter < __max_iter; ++__iter)
+ {
+ __mu = (__xn + __yn + __zn + _Tp(2) * __pn) / _Tp(5);
+ __xndev = (__mu - __xn) / __mu;
+ __yndev = (__mu - __yn) / __mu;
+ __zndev = (__mu - __zn) / __mu;
+ __pndev = (__mu - __pn) / __mu;
+ _Tp __epsilon = std::max(std::abs(__xndev), std::abs(__yndev));
+ __epsilon = std::max(__epsilon, std::abs(__zndev));
+ __epsilon = std::max(__epsilon, std::abs(__pndev));
+ if (__epsilon < __errtol)
+ break;
+ const _Tp __xnroot = std::sqrt(__xn);
+ const _Tp __ynroot = std::sqrt(__yn);
+ const _Tp __znroot = std::sqrt(__zn);
+ const _Tp __lambda = __xnroot * (__ynroot + __znroot)
+ + __ynroot * __znroot;
+ const _Tp __alpha1 = __pn * (__xnroot + __ynroot + __znroot)
+ + __xnroot * __ynroot * __znroot;
+ const _Tp __alpha2 = __alpha1 * __alpha1;
+ const _Tp __beta = __pn * (__pn + __lambda)
+ * (__pn + __lambda);
+ __sigma += __power4 * __ellint_rc(__alpha2, __beta);
+ __power4 *= __c0;
+ __xn = __c0 * (__xn + __lambda);
+ __yn = __c0 * (__yn + __lambda);
+ __zn = __c0 * (__zn + __lambda);
+ __pn = __c0 * (__pn + __lambda);
+ }
+
+ // Note: __ea is an SPU badname.
+ _Tp __eaa = __xndev * (__yndev + __zndev) + __yndev * __zndev;
+ _Tp __eb = __xndev * __yndev * __zndev;
+ _Tp __ec = __pndev * __pndev;
+ _Tp __e2 = __eaa - _Tp(3) * __ec;
+ _Tp __e3 = __eb + _Tp(2) * __pndev * (__eaa - __ec);
+ _Tp __s1 = _Tp(1) + __e2 * (-__c1 + _Tp(3) * __c3 * __e2 / _Tp(4)
+ - _Tp(3) * __c4 * __e3 / _Tp(2));
+ _Tp __s2 = __eb * (__c2 / _Tp(2)
+ + __pndev * (-__c3 - __c3 + __pndev * __c4));
+ _Tp __s3 = __pndev * __eaa * (__c2 - __pndev * __c3)
+ - __c2 * __pndev * __ec;
+
+ return _Tp(3) * __sigma + __power4 * (__s1 + __s2 + __s3)
+ / (__mu * std::sqrt(__mu));
+ }
+ }
+
+
+ /**
+ * @brief Return the complete elliptic integral of the third kind
+ * @f$ \Pi(k,\nu) = \Pi(k,\nu,\pi/2) @f$ using the
+ * Carlson formulation.
+ *
+ * The complete elliptic integral of the third kind is defined as
+ * @f[
+ * \Pi(k,\nu) = \int_0^{\pi/2}
+ * \frac{d\theta}
+ * {(1 - \nu \sin^2\theta)\sqrt{1 - k^2 \sin^2\theta}}
+ * @f]
+ *
+ * @param __k The argument of the elliptic function.
+ * @param __nu The second argument of the elliptic function.
+ * @return The complete elliptic function of the third kind.
+ */
+ template<typename _Tp>
+ _Tp
+ __comp_ellint_3(const _Tp __k, const _Tp __nu)
+ {
+
+ if (__isnan(__k) || __isnan(__nu))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (__nu == _Tp(1))
+ return std::numeric_limits<_Tp>::infinity();
+ else if (std::abs(__k) > _Tp(1))
+ std::__throw_domain_error(__N("Bad argument in __comp_ellint_3."));
+ else
+ {
+ const _Tp __kk = __k * __k;
+
+ return __ellint_rf(_Tp(0), _Tp(1) - __kk, _Tp(1))
+ - __nu
+ * __ellint_rj(_Tp(0), _Tp(1) - __kk, _Tp(1), _Tp(1) + __nu)
+ / _Tp(3);
+ }
+ }
+
+
+ /**
+ * @brief Return the incomplete elliptic integral of the third kind
+ * @f$ \Pi(k,\nu,\phi) @f$ using the Carlson formulation.
+ *
+ * The incomplete elliptic integral of the third kind is defined as
+ * @f[
+ * \Pi(k,\nu,\phi) = \int_0^{\phi}
+ * \frac{d\theta}
+ * {(1 - \nu \sin^2\theta)
+ * \sqrt{1 - k^2 \sin^2\theta}}
+ * @f]
+ *
+ * @param __k The argument of the elliptic function.
+ * @param __nu The second argument of the elliptic function.
+ * @param __phi The integral limit argument of the elliptic function.
+ * @return The elliptic function of the third kind.
+ */
+ template<typename _Tp>
+ _Tp
+ __ellint_3(const _Tp __k, const _Tp __nu, const _Tp __phi)
+ {
+
+ if (__isnan(__k) || __isnan(__nu) || __isnan(__phi))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (std::abs(__k) > _Tp(1))
+ std::__throw_domain_error(__N("Bad argument in __ellint_3."));
+ else
+ {
+ // Reduce phi to -pi/2 < phi < +pi/2.
+ const int __n = std::floor(__phi / __numeric_constants<_Tp>::__pi()
+ + _Tp(0.5L));
+ const _Tp __phi_red = __phi
+ - __n * __numeric_constants<_Tp>::__pi();
+
+ const _Tp __kk = __k * __k;
+ const _Tp __s = std::sin(__phi_red);
+ const _Tp __ss = __s * __s;
+ const _Tp __sss = __ss * __s;
+ const _Tp __c = std::cos(__phi_red);
+ const _Tp __cc = __c * __c;
+
+ const _Tp __Pi = __s
+ * __ellint_rf(__cc, _Tp(1) - __kk * __ss, _Tp(1))
+ - __nu * __sss
+ * __ellint_rj(__cc, _Tp(1) - __kk * __ss, _Tp(1),
+ _Tp(1) + __nu * __ss) / _Tp(3);
+
+ if (__n == 0)
+ return __Pi;
+ else
+ return __Pi + _Tp(2) * __n * __comp_ellint_3(__k, __nu);
+ }
+ }
+
+ } // namespace std::tr1::__detail
+}
+}
+
+#endif // _GLIBCXX_TR1_ELL_INTEGRAL_TCC
+
diff --git a/i686-linux/include/c++/4.4.3/tr1/exp_integral.tcc b/i686-linux/include/c++/4.4.3/tr1/exp_integral.tcc
new file mode 100644
index 0000000..5b3af5d
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/exp_integral.tcc
@@ -0,0 +1,524 @@
+// Special functions -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/exp_integral.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882 TR1: 5.2 Special functions
+//
+
+// Written by Edward Smith-Rowland based on:
+//
+// (1) Handbook of Mathematical Functions,
+// Ed. by Milton Abramowitz and Irene A. Stegun,
+// Dover Publications, New-York, Section 5, pp. 228-251.
+// (2) The Gnu Scientific Library, http://www.gnu.org/software/gsl
+// (3) Numerical Recipes in C, by W. H. Press, S. A. Teukolsky,
+// W. T. Vetterling, B. P. Flannery, Cambridge University Press (1992),
+// 2nd ed, pp. 222-225.
+//
+
+#ifndef _GLIBCXX_TR1_EXP_INTEGRAL_TCC
+#define _GLIBCXX_TR1_EXP_INTEGRAL_TCC 1
+
+#include "special_function_util.h"
+
+namespace std
+{
+namespace tr1
+{
+
+ // [5.2] Special functions
+
+ // Implementation-space details.
+ namespace __detail
+ {
+
+ /**
+ * @brief Return the exponential integral @f$ E_1(x) @f$
+ * by series summation. This should be good
+ * for @f$ x < 1 @f$.
+ *
+ * The exponential integral is given by
+ * \f[
+ * E_1(x) = \int_{1}^{\infty} \frac{e^{-xt}}{t} dt
+ * \f]
+ *
+ * @param __x The argument of the exponential integral function.
+ * @return The exponential integral.
+ */
+ template<typename _Tp>
+ _Tp
+ __expint_E1_series(const _Tp __x)
+ {
+ const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
+ _Tp __term = _Tp(1);
+ _Tp __esum = _Tp(0);
+ _Tp __osum = _Tp(0);
+ const unsigned int __max_iter = 100;
+ for (unsigned int __i = 1; __i < __max_iter; ++__i)
+ {
+ __term *= - __x / __i;
+ if (std::abs(__term) < __eps)
+ break;
+ if (__term >= _Tp(0))
+ __esum += __term / __i;
+ else
+ __osum += __term / __i;
+ }
+
+ return - __esum - __osum
+ - __numeric_constants<_Tp>::__gamma_e() - std::log(__x);
+ }
+
+
+ /**
+ * @brief Return the exponential integral @f$ E_1(x) @f$
+ * by asymptotic expansion.
+ *
+ * The exponential integral is given by
+ * \f[
+ * E_1(x) = \int_{1}^\infty \frac{e^{-xt}}{t} dt
+ * \f]
+ *
+ * @param __x The argument of the exponential integral function.
+ * @return The exponential integral.
+ */
+ template<typename _Tp>
+ _Tp
+ __expint_E1_asymp(const _Tp __x)
+ {
+ _Tp __term = _Tp(1);
+ _Tp __esum = _Tp(1);
+ _Tp __osum = _Tp(0);
+ const unsigned int __max_iter = 1000;
+ for (unsigned int __i = 1; __i < __max_iter; ++__i)
+ {
+ _Tp __prev = __term;
+ __term *= - __i / __x;
+ if (std::abs(__term) > std::abs(__prev))
+ break;
+ if (__term >= _Tp(0))
+ __esum += __term;
+ else
+ __osum += __term;
+ }
+
+ return std::exp(- __x) * (__esum + __osum) / __x;
+ }
+
+
+ /**
+ * @brief Return the exponential integral @f$ E_n(x) @f$
+ * by series summation.
+ *
+ * The exponential integral is given by
+ * \f[
+ * E_n(x) = \int_{1}^\infty \frac{e^{-xt}}{t^n} dt
+ * \f]
+ *
+ * @param __n The order of the exponential integral function.
+ * @param __x The argument of the exponential integral function.
+ * @return The exponential integral.
+ */
+ template<typename _Tp>
+ _Tp
+ __expint_En_series(const unsigned int __n, const _Tp __x)
+ {
+ const unsigned int __max_iter = 100;
+ const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
+ const int __nm1 = __n - 1;
+ _Tp __ans = (__nm1 != 0
+ ? _Tp(1) / __nm1 : -std::log(__x)
+ - __numeric_constants<_Tp>::__gamma_e());
+ _Tp __fact = _Tp(1);
+ for (int __i = 1; __i <= __max_iter; ++__i)
+ {
+ __fact *= -__x / _Tp(__i);
+ _Tp __del;
+ if ( __i != __nm1 )
+ __del = -__fact / _Tp(__i - __nm1);
+ else
+ {
+ _Tp __psi = -_TR1_GAMMA_TCC;
+ for (int __ii = 1; __ii <= __nm1; ++__ii)
+ __psi += _Tp(1) / _Tp(__ii);
+ __del = __fact * (__psi - std::log(__x));
+ }
+ __ans += __del;
+ if (std::abs(__del) < __eps * std::abs(__ans))
+ return __ans;
+ }
+ std::__throw_runtime_error(__N("Series summation failed "
+ "in __expint_En_series."));
+ }
+
+
+ /**
+ * @brief Return the exponential integral @f$ E_n(x) @f$
+ * by continued fractions.
+ *
+ * The exponential integral is given by
+ * \f[
+ * E_n(x) = \int_{1}^\infty \frac{e^{-xt}}{t^n} dt
+ * \f]
+ *
+ * @param __n The order of the exponential integral function.
+ * @param __x The argument of the exponential integral function.
+ * @return The exponential integral.
+ */
+ template<typename _Tp>
+ _Tp
+ __expint_En_cont_frac(const unsigned int __n, const _Tp __x)
+ {
+ const unsigned int __max_iter = 100;
+ const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
+ const _Tp __fp_min = std::numeric_limits<_Tp>::min();
+ const int __nm1 = __n - 1;
+ _Tp __b = __x + _Tp(__n);
+ _Tp __c = _Tp(1) / __fp_min;
+ _Tp __d = _Tp(1) / __b;
+ _Tp __h = __d;
+ for ( unsigned int __i = 1; __i <= __max_iter; ++__i )
+ {
+ _Tp __a = -_Tp(__i * (__nm1 + __i));
+ __b += _Tp(2);
+ __d = _Tp(1) / (__a * __d + __b);
+ __c = __b + __a / __c;
+ const _Tp __del = __c * __d;
+ __h *= __del;
+ if (std::abs(__del - _Tp(1)) < __eps)
+ {
+ const _Tp __ans = __h * std::exp(-__x);
+ return __ans;
+ }
+ }
+ std::__throw_runtime_error(__N("Continued fraction failed "
+ "in __expint_En_cont_frac."));
+ }
+
+
+ /**
+ * @brief Return the exponential integral @f$ E_n(x) @f$
+ * by recursion. Use upward recursion for @f$ x < n @f$
+ * and downward recursion (Miller's algorithm) otherwise.
+ *
+ * The exponential integral is given by
+ * \f[
+ * E_n(x) = \int_{1}^\infty \frac{e^{-xt}}{t^n} dt
+ * \f]
+ *
+ * @param __n The order of the exponential integral function.
+ * @param __x The argument of the exponential integral function.
+ * @return The exponential integral.
+ */
+ template<typename _Tp>
+ _Tp
+ __expint_En_recursion(const unsigned int __n, const _Tp __x)
+ {
+ _Tp __En;
+ _Tp __E1 = __expint_E1(__x);
+ if (__x < _Tp(__n))
+ {
+ // Forward recursion is stable only for n < x.
+ __En = __E1;
+ for (unsigned int __j = 2; __j < __n; ++__j)
+ __En = (std::exp(-__x) - __x * __En) / _Tp(__j - 1);
+ }
+ else
+ {
+ // Backward recursion is stable only for n >= x.
+ __En = _Tp(1);
+ const int __N = __n + 20; // TODO: Check this starting number.
+ _Tp __save = _Tp(0);
+ for (int __j = __N; __j > 0; --__j)
+ {
+ __En = (std::exp(-__x) - __j * __En) / __x;
+ if (__j == __n)
+ __save = __En;
+ }
+ _Tp __norm = __En / __E1;
+ __En /= __norm;
+ }
+
+ return __En;
+ }
+
+ /**
+ * @brief Return the exponential integral @f$ Ei(x) @f$
+ * by series summation.
+ *
+ * The exponential integral is given by
+ * \f[
+ * Ei(x) = -\int_{-x}^\infty \frac{e^t}{t} dt
+ * \f]
+ *
+ * @param __x The argument of the exponential integral function.
+ * @return The exponential integral.
+ */
+ template<typename _Tp>
+ _Tp
+ __expint_Ei_series(const _Tp __x)
+ {
+ _Tp __term = _Tp(1);
+ _Tp __sum = _Tp(0);
+ const unsigned int __max_iter = 1000;
+ for (unsigned int __i = 1; __i < __max_iter; ++__i)
+ {
+ __term *= __x / __i;
+ __sum += __term / __i;
+ if (__term < std::numeric_limits<_Tp>::epsilon() * __sum)
+ break;
+ }
+
+ return __numeric_constants<_Tp>::__gamma_e() + __sum + std::log(__x);
+ }
+
+
+ /**
+ * @brief Return the exponential integral @f$ Ei(x) @f$
+ * by asymptotic expansion.
+ *
+ * The exponential integral is given by
+ * \f[
+ * Ei(x) = -\int_{-x}^\infty \frac{e^t}{t} dt
+ * \f]
+ *
+ * @param __x The argument of the exponential integral function.
+ * @return The exponential integral.
+ */
+ template<typename _Tp>
+ _Tp
+ __expint_Ei_asymp(const _Tp __x)
+ {
+ _Tp __term = _Tp(1);
+ _Tp __sum = _Tp(1);
+ const unsigned int __max_iter = 1000;
+ for (unsigned int __i = 1; __i < __max_iter; ++__i)
+ {
+ _Tp __prev = __term;
+ __term *= __i / __x;
+ if (__term < std::numeric_limits<_Tp>::epsilon())
+ break;
+ if (__term >= __prev)
+ break;
+ __sum += __term;
+ }
+
+ return std::exp(__x) * __sum / __x;
+ }
+
+
+ /**
+ * @brief Return the exponential integral @f$ Ei(x) @f$.
+ *
+ * The exponential integral is given by
+ * \f[
+ * Ei(x) = -\int_{-x}^\infty \frac{e^t}{t} dt
+ * \f]
+ *
+ * @param __x The argument of the exponential integral function.
+ * @return The exponential integral.
+ */
+ template<typename _Tp>
+ _Tp
+ __expint_Ei(const _Tp __x)
+ {
+ if (__x < _Tp(0))
+ return -__expint_E1(-__x);
+ else if (__x < -std::log(std::numeric_limits<_Tp>::epsilon()))
+ return __expint_Ei_series(__x);
+ else
+ return __expint_Ei_asymp(__x);
+ }
+
+
+ /**
+ * @brief Return the exponential integral @f$ E_1(x) @f$.
+ *
+ * The exponential integral is given by
+ * \f[
+ * E_1(x) = \int_{1}^\infty \frac{e^{-xt}}{t} dt
+ * \f]
+ *
+ * @param __x The argument of the exponential integral function.
+ * @return The exponential integral.
+ */
+ template<typename _Tp>
+ _Tp
+ __expint_E1(const _Tp __x)
+ {
+ if (__x < _Tp(0))
+ return -__expint_Ei(-__x);
+ else if (__x < _Tp(1))
+ return __expint_E1_series(__x);
+ else if (__x < _Tp(100)) // TODO: Find a good asymptotic switch point.
+ return __expint_En_cont_frac(1, __x);
+ else
+ return __expint_E1_asymp(__x);
+ }
+
+
+ /**
+ * @brief Return the exponential integral @f$ E_n(x) @f$
+ * for large argument.
+ *
+ * The exponential integral is given by
+ * \f[
+ * E_n(x) = \int_{1}^\infty \frac{e^{-xt}}{t^n} dt
+ * \f]
+ *
+ * This is something of an extension.
+ *
+ * @param __n The order of the exponential integral function.
+ * @param __x The argument of the exponential integral function.
+ * @return The exponential integral.
+ */
+ template<typename _Tp>
+ _Tp
+ __expint_asymp(const unsigned int __n, const _Tp __x)
+ {
+ _Tp __term = _Tp(1);
+ _Tp __sum = _Tp(1);
+ for (unsigned int __i = 1; __i <= __n; ++__i)
+ {
+ _Tp __prev = __term;
+ __term *= -(__n - __i + 1) / __x;
+ if (std::abs(__term) > std::abs(__prev))
+ break;
+ __sum += __term;
+ }
+
+ return std::exp(-__x) * __sum / __x;
+ }
+
+
+ /**
+ * @brief Return the exponential integral @f$ E_n(x) @f$
+ * for large order.
+ *
+ * The exponential integral is given by
+ * \f[
+ * E_n(x) = \int_{1}^\infty \frac{e^{-xt}}{t^n} dt
+ * \f]
+ *
+ * This is something of an extension.
+ *
+ * @param __n The order of the exponential integral function.
+ * @param __x The argument of the exponential integral function.
+ * @return The exponential integral.
+ */
+ template<typename _Tp>
+ _Tp
+ __expint_large_n(const unsigned int __n, const _Tp __x)
+ {
+ const _Tp __xpn = __x + __n;
+ const _Tp __xpn2 = __xpn * __xpn;
+ _Tp __term = _Tp(1);
+ _Tp __sum = _Tp(1);
+ for (unsigned int __i = 1; __i <= __n; ++__i)
+ {
+ _Tp __prev = __term;
+ __term *= (__n - 2 * (__i - 1) * __x) / __xpn2;
+ if (std::abs(__term) < std::numeric_limits<_Tp>::epsilon())
+ break;
+ __sum += __term;
+ }
+
+ return std::exp(-__x) * __sum / __xpn;
+ }
+
+
+ /**
+ * @brief Return the exponential integral @f$ E_n(x) @f$.
+ *
+ * The exponential integral is given by
+ * \f[
+ * E_n(x) = \int_{1}^\infty \frac{e^{-xt}}{t^n} dt
+ * \f]
+ * This is something of an extension.
+ *
+ * @param __n The order of the exponential integral function.
+ * @param __x The argument of the exponential integral function.
+ * @return The exponential integral.
+ */
+ template<typename _Tp>
+ _Tp
+ __expint(const unsigned int __n, const _Tp __x)
+ {
+ // Return NaN on NaN input.
+ if (__isnan(__x))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (__n <= 1 && __x == _Tp(0))
+ return std::numeric_limits<_Tp>::infinity();
+ else
+ {
+ _Tp __E0 = std::exp(__x) / __x;
+ if (__n == 0)
+ return __E0;
+
+ _Tp __E1 = __expint_E1(__x);
+ if (__n == 1)
+ return __E1;
+
+ if (__x == _Tp(0))
+ return _Tp(1) / static_cast<_Tp>(__n - 1);
+
+ _Tp __En = __expint_En_recursion(__n, __x);
+
+ return __En;
+ }
+ }
+
+
+ /**
+ * @brief Return the exponential integral @f$ Ei(x) @f$.
+ *
+ * The exponential integral is given by
+ * \f[
+ * Ei(x) = -\int_{-x}^\infty \frac{e^t}{t} dt
+ * \f]
+ *
+ * @param __x The argument of the exponential integral function.
+ * @return The exponential integral.
+ */
+ template<typename _Tp>
+ inline _Tp
+ __expint(const _Tp __x)
+ {
+ if (__isnan(__x))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else
+ return __expint_Ei(__x);
+ }
+
+ } // namespace std::tr1::__detail
+}
+}
+
+#endif // _GLIBCXX_TR1_EXP_INTEGRAL_TCC
diff --git a/i686-linux/include/c++/4.4.3/tr1/fenv.h b/i686-linux/include/c++/4.4.3/tr1/fenv.h
new file mode 100644
index 0000000..118630e
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/fenv.h
@@ -0,0 +1,34 @@
+// TR1 fenv.h -*- C++ -*-
+
+// Copyright (C) 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/fenv.h
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _TR1_FENV_H
+#define _TR1_FENV_H 1
+
+#include <tr1/cfenv>
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/tr1/float.h b/i686-linux/include/c++/4.4.3/tr1/float.h
new file mode 100644
index 0000000..bbeff6e
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/float.h
@@ -0,0 +1,34 @@
+// TR1 float.h -*- C++ -*-
+
+// Copyright (C) 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/float.h
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _TR1_FLOAT_H
+#define _TR1_FLOAT_H 1
+
+#include <tr1/cfloat>
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/tr1/functional b/i686-linux/include/c++/4.4.3/tr1/functional
new file mode 100644
index 0000000..3deaa5e
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/functional
@@ -0,0 +1,63 @@
+// TR1 functional header -*- C++ -*-
+
+// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/functional
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_FUNCTIONAL
+#define _GLIBCXX_TR1_FUNCTIONAL 1
+
+#pragma GCC system_header
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+#include <bits/c++config.h>
+#include <bits/stl_function.h>
+
+#include <typeinfo>
+#include <new>
+#include <tr1/tuple>
+#include <tr1/type_traits>
+#include <bits/stringfwd.h>
+#include <tr1/functional_hash.h>
+#include <ext/type_traits.h>
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/functional>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/functional>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+#endif // _GLIBCXX_TR1_FUNCTIONAL
diff --git a/i686-linux/include/c++/4.4.3/tr1/functional_hash.h b/i686-linux/include/c++/4.4.3/tr1/functional_hash.h
new file mode 100644
index 0000000..933ded9
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/functional_hash.h
@@ -0,0 +1,53 @@
+// TR1 functional_hash.h header -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/functional_hash.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _GLIBCXX_TR1_FUNCTIONAL_HASH_H
+#define _GLIBCXX_TR1_FUNCTIONAL_HASH_H 1
+
+#pragma GCC system_header
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/functional_hash.h>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/functional_hash.h>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+#endif // _GLIBCXX_TR1_FUNCTIONAL_HASH_H
diff --git a/i686-linux/include/c++/4.4.3/tr1/gamma.tcc b/i686-linux/include/c++/4.4.3/tr1/gamma.tcc
new file mode 100644
index 0000000..f456da3
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/gamma.tcc
@@ -0,0 +1,471 @@
+// Special functions -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/gamma.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882 TR1: 5.2 Special functions
+//
+
+// Written by Edward Smith-Rowland based on:
+// (1) Handbook of Mathematical Functions,
+// ed. Milton Abramowitz and Irene A. Stegun,
+// Dover Publications,
+// Section 6, pp. 253-266
+// (2) The Gnu Scientific Library, http://www.gnu.org/software/gsl
+// (3) Numerical Recipes in C, by W. H. Press, S. A. Teukolsky,
+// W. T. Vetterling, B. P. Flannery, Cambridge University Press (1992),
+// 2nd ed, pp. 213-216
+// (4) Gamma, Exploring Euler's Constant, Julian Havil,
+// Princeton, 2003.
+
+#ifndef _TR1_GAMMA_TCC
+#define _TR1_GAMMA_TCC 1
+
+#include "special_function_util.h"
+
+namespace std
+{
+namespace tr1
+{
+ // Implementation-space details.
+ namespace __detail
+ {
+
+ /**
+ * @brief This returns Bernoulli numbers from a table or by summation
+ * for larger values.
+ *
+ * Recursion is unstable.
+ *
+ * @param __n the order n of the Bernoulli number.
+ * @return The Bernoulli number of order n.
+ */
+ template <typename _Tp>
+ _Tp __bernoulli_series(unsigned int __n)
+ {
+
+ static const _Tp __num[28] = {
+ _Tp(1UL), -_Tp(1UL) / _Tp(2UL),
+ _Tp(1UL) / _Tp(6UL), _Tp(0UL),
+ -_Tp(1UL) / _Tp(30UL), _Tp(0UL),
+ _Tp(1UL) / _Tp(42UL), _Tp(0UL),
+ -_Tp(1UL) / _Tp(30UL), _Tp(0UL),
+ _Tp(5UL) / _Tp(66UL), _Tp(0UL),
+ -_Tp(691UL) / _Tp(2730UL), _Tp(0UL),
+ _Tp(7UL) / _Tp(6UL), _Tp(0UL),
+ -_Tp(3617UL) / _Tp(510UL), _Tp(0UL),
+ _Tp(43867UL) / _Tp(798UL), _Tp(0UL),
+ -_Tp(174611) / _Tp(330UL), _Tp(0UL),
+ _Tp(854513UL) / _Tp(138UL), _Tp(0UL),
+ -_Tp(236364091UL) / _Tp(2730UL), _Tp(0UL),
+ _Tp(8553103UL) / _Tp(6UL), _Tp(0UL)
+ };
+
+ if (__n == 0)
+ return _Tp(1);
+
+ if (__n == 1)
+ return -_Tp(1) / _Tp(2);
+
+ // Take care of the rest of the odd ones.
+ if (__n % 2 == 1)
+ return _Tp(0);
+
+ // Take care of some small evens that are painful for the series.
+ if (__n < 28)
+ return __num[__n];
+
+
+ _Tp __fact = _Tp(1);
+ if ((__n / 2) % 2 == 0)
+ __fact *= _Tp(-1);
+ for (unsigned int __k = 1; __k <= __n; ++__k)
+ __fact *= __k / (_Tp(2) * __numeric_constants<_Tp>::__pi());
+ __fact *= _Tp(2);
+
+ _Tp __sum = _Tp(0);
+ for (unsigned int __i = 1; __i < 1000; ++__i)
+ {
+ _Tp __term = std::pow(_Tp(__i), -_Tp(__n));
+ if (__term < std::numeric_limits<_Tp>::epsilon())
+ break;
+ __sum += __term;
+ }
+
+ return __fact * __sum;
+ }
+
+
+ /**
+ * @brief This returns Bernoulli number \f$B_n\f$.
+ *
+ * @param __n the order n of the Bernoulli number.
+ * @return The Bernoulli number of order n.
+ */
+ template<typename _Tp>
+ inline _Tp
+ __bernoulli(const int __n)
+ {
+ return __bernoulli_series<_Tp>(__n);
+ }
+
+
+ /**
+ * @brief Return \f$log(\Gamma(x))\f$ by asymptotic expansion
+ * with Bernoulli number coefficients. This is like
+ * Sterling's approximation.
+ *
+ * @param __x The argument of the log of the gamma function.
+ * @return The logarithm of the gamma function.
+ */
+ template<typename _Tp>
+ _Tp
+ __log_gamma_bernoulli(const _Tp __x)
+ {
+ _Tp __lg = (__x - _Tp(0.5L)) * std::log(__x) - __x
+ + _Tp(0.5L) * std::log(_Tp(2)
+ * __numeric_constants<_Tp>::__pi());
+
+ const _Tp __xx = __x * __x;
+ _Tp __help = _Tp(1) / __x;
+ for ( unsigned int __i = 1; __i < 20; ++__i )
+ {
+ const _Tp __2i = _Tp(2 * __i);
+ __help /= __2i * (__2i - _Tp(1)) * __xx;
+ __lg += __bernoulli<_Tp>(2 * __i) * __help;
+ }
+
+ return __lg;
+ }
+
+
+ /**
+ * @brief Return \f$log(\Gamma(x))\f$ by the Lanczos method.
+ * This method dominates all others on the positive axis I think.
+ *
+ * @param __x The argument of the log of the gamma function.
+ * @return The logarithm of the gamma function.
+ */
+ template<typename _Tp>
+ _Tp
+ __log_gamma_lanczos(const _Tp __x)
+ {
+ const _Tp __xm1 = __x - _Tp(1);
+
+ static const _Tp __lanczos_cheb_7[9] = {
+ _Tp( 0.99999999999980993227684700473478L),
+ _Tp( 676.520368121885098567009190444019L),
+ _Tp(-1259.13921672240287047156078755283L),
+ _Tp( 771.3234287776530788486528258894L),
+ _Tp(-176.61502916214059906584551354L),
+ _Tp( 12.507343278686904814458936853L),
+ _Tp(-0.13857109526572011689554707L),
+ _Tp( 9.984369578019570859563e-6L),
+ _Tp( 1.50563273514931155834e-7L)
+ };
+
+ static const _Tp __LOGROOT2PI
+ = _Tp(0.9189385332046727417803297364056176L);
+
+ _Tp __sum = __lanczos_cheb_7[0];
+ for(unsigned int __k = 1; __k < 9; ++__k)
+ __sum += __lanczos_cheb_7[__k] / (__xm1 + __k);
+
+ const _Tp __term1 = (__xm1 + _Tp(0.5L))
+ * std::log((__xm1 + _Tp(7.5L))
+ / __numeric_constants<_Tp>::__euler());
+ const _Tp __term2 = __LOGROOT2PI + std::log(__sum);
+ const _Tp __result = __term1 + (__term2 - _Tp(7));
+
+ return __result;
+ }
+
+
+ /**
+ * @brief Return \f$ log(|\Gamma(x)|) \f$.
+ * This will return values even for \f$ x < 0 \f$.
+ * To recover the sign of \f$ \Gamma(x) \f$ for
+ * any argument use @a __log_gamma_sign.
+ *
+ * @param __x The argument of the log of the gamma function.
+ * @return The logarithm of the gamma function.
+ */
+ template<typename _Tp>
+ _Tp
+ __log_gamma(const _Tp __x)
+ {
+ if (__x > _Tp(0.5L))
+ return __log_gamma_lanczos(__x);
+ else
+ {
+ const _Tp __sin_fact
+ = std::abs(std::sin(__numeric_constants<_Tp>::__pi() * __x));
+ if (__sin_fact == _Tp(0))
+ std::__throw_domain_error(__N("Argument is nonpositive integer "
+ "in __log_gamma"));
+ return __numeric_constants<_Tp>::__lnpi()
+ - std::log(__sin_fact)
+ - __log_gamma_lanczos(_Tp(1) - __x);
+ }
+ }
+
+
+ /**
+ * @brief Return the sign of \f$ \Gamma(x) \f$.
+ * At nonpositive integers zero is returned.
+ *
+ * @param __x The argument of the gamma function.
+ * @return The sign of the gamma function.
+ */
+ template<typename _Tp>
+ _Tp
+ __log_gamma_sign(const _Tp __x)
+ {
+ if (__x > _Tp(0))
+ return _Tp(1);
+ else
+ {
+ const _Tp __sin_fact
+ = std::sin(__numeric_constants<_Tp>::__pi() * __x);
+ if (__sin_fact > _Tp(0))
+ return (1);
+ else if (__sin_fact < _Tp(0))
+ return -_Tp(1);
+ else
+ return _Tp(0);
+ }
+ }
+
+
+ /**
+ * @brief Return the logarithm of the binomial coefficient.
+ * The binomial coefficient is given by:
+ * @f[
+ * \left( \right) = \frac{n!}{(n-k)! k!}
+ * @f]
+ *
+ * @param __n The first argument of the binomial coefficient.
+ * @param __k The second argument of the binomial coefficient.
+ * @return The binomial coefficient.
+ */
+ template<typename _Tp>
+ _Tp
+ __log_bincoef(const unsigned int __n, const unsigned int __k)
+ {
+ // Max e exponent before overflow.
+ static const _Tp __max_bincoeff
+ = std::numeric_limits<_Tp>::max_exponent10
+ * std::log(_Tp(10)) - _Tp(1);
+#if _GLIBCXX_USE_C99_MATH_TR1
+ _Tp __coeff = std::tr1::lgamma(_Tp(1 + __n))
+ - std::tr1::lgamma(_Tp(1 + __k))
+ - std::tr1::lgamma(_Tp(1 + __n - __k));
+#else
+ _Tp __coeff = __log_gamma(_Tp(1 + __n))
+ - __log_gamma(_Tp(1 + __k))
+ - __log_gamma(_Tp(1 + __n - __k));
+#endif
+ }
+
+
+ /**
+ * @brief Return the binomial coefficient.
+ * The binomial coefficient is given by:
+ * @f[
+ * \left( \right) = \frac{n!}{(n-k)! k!}
+ * @f]
+ *
+ * @param __n The first argument of the binomial coefficient.
+ * @param __k The second argument of the binomial coefficient.
+ * @return The binomial coefficient.
+ */
+ template<typename _Tp>
+ _Tp
+ __bincoef(const unsigned int __n, const unsigned int __k)
+ {
+ // Max e exponent before overflow.
+ static const _Tp __max_bincoeff
+ = std::numeric_limits<_Tp>::max_exponent10
+ * std::log(_Tp(10)) - _Tp(1);
+
+ const _Tp __log_coeff = __log_bincoef<_Tp>(__n, __k);
+ if (__log_coeff > __max_bincoeff)
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else
+ return std::exp(__log_coeff);
+ }
+
+
+ /**
+ * @brief Return \f$ \Gamma(x) \f$.
+ *
+ * @param __x The argument of the gamma function.
+ * @return The gamma function.
+ */
+ template<typename _Tp>
+ inline _Tp
+ __gamma(const _Tp __x)
+ {
+ return std::exp(__log_gamma(__x));
+ }
+
+
+ /**
+ * @brief Return the digamma function by series expansion.
+ * The digamma or @f$ \psi(x) @f$ function is defined by
+ * @f[
+ * \psi(x) = \frac{\Gamma'(x)}{\Gamma(x)}
+ * @f]
+ *
+ * The series is given by:
+ * @f[
+ * \psi(x) = -\gamma_E - \frac{1}{x}
+ * \sum_{k=1}^{\infty} \frac{x}{k(x + k)}
+ * @f]
+ */
+ template<typename _Tp>
+ _Tp
+ __psi_series(const _Tp __x)
+ {
+ _Tp __sum = -__numeric_constants<_Tp>::__gamma_e() - _Tp(1) / __x;
+ const unsigned int __max_iter = 100000;
+ for (unsigned int __k = 1; __k < __max_iter; ++__k)
+ {
+ const _Tp __term = __x / (__k * (__k + __x));
+ __sum += __term;
+ if (std::abs(__term / __sum) < std::numeric_limits<_Tp>::epsilon())
+ break;
+ }
+ return __sum;
+ }
+
+
+ /**
+ * @brief Return the digamma function for large argument.
+ * The digamma or @f$ \psi(x) @f$ function is defined by
+ * @f[
+ * \psi(x) = \frac{\Gamma'(x)}{\Gamma(x)}
+ * @f]
+ *
+ * The asymptotic series is given by:
+ * @f[
+ * \psi(x) = \ln(x) - \frac{1}{2x}
+ * - \sum_{n=1}^{\infty} \frac{B_{2n}}{2 n x^{2n}}
+ * @f]
+ */
+ template<typename _Tp>
+ _Tp
+ __psi_asymp(const _Tp __x)
+ {
+ _Tp __sum = std::log(__x) - _Tp(0.5L) / __x;
+ const _Tp __xx = __x * __x;
+ _Tp __xp = __xx;
+ const unsigned int __max_iter = 100;
+ for (unsigned int __k = 1; __k < __max_iter; ++__k)
+ {
+ const _Tp __term = __bernoulli<_Tp>(2 * __k) / (2 * __k * __xp);
+ __sum -= __term;
+ if (std::abs(__term / __sum) < std::numeric_limits<_Tp>::epsilon())
+ break;
+ __xp *= __xx;
+ }
+ return __sum;
+ }
+
+
+ /**
+ * @brief Return the digamma function.
+ * The digamma or @f$ \psi(x) @f$ function is defined by
+ * @f[
+ * \psi(x) = \frac{\Gamma'(x)}{\Gamma(x)}
+ * @f]
+ * For negative argument the reflection formula is used:
+ * @f[
+ * \psi(x) = \psi(1-x) - \pi \cot(\pi x)
+ * @f]
+ */
+ template<typename _Tp>
+ _Tp
+ __psi(const _Tp __x)
+ {
+ const int __n = static_cast<int>(__x + 0.5L);
+ const _Tp __eps = _Tp(4) * std::numeric_limits<_Tp>::epsilon();
+ if (__n <= 0 && std::abs(__x - _Tp(__n)) < __eps)
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (__x < _Tp(0))
+ {
+ const _Tp __pi = __numeric_constants<_Tp>::__pi();
+ return __psi(_Tp(1) - __x)
+ - __pi * std::cos(__pi * __x) / std::sin(__pi * __x);
+ }
+ else if (__x > _Tp(100))
+ return __psi_asymp(__x);
+ else
+ return __psi_series(__x);
+ }
+
+
+ /**
+ * @brief Return the polygamma function @f$ \psi^{(n)}(x) @f$.
+ *
+ * The polygamma function is related to the Hurwitz zeta function:
+ * @f[
+ * \psi^{(n)}(x) = (-1)^{n+1} m! \zeta(m+1,x)
+ * @f]
+ */
+ template<typename _Tp>
+ _Tp
+ __psi(const unsigned int __n, const _Tp __x)
+ {
+ if (__x <= _Tp(0))
+ std::__throw_domain_error(__N("Argument out of range "
+ "in __psi"));
+ else if (__n == 0)
+ return __psi(__x);
+ else
+ {
+ const _Tp __hzeta = __hurwitz_zeta(_Tp(__n + 1), __x);
+#if _GLIBCXX_USE_C99_MATH_TR1
+ const _Tp __ln_nfact = std::tr1::lgamma(_Tp(__n + 1));
+#else
+ const _Tp __ln_nfact = __log_gamma(_Tp(__n + 1));
+#endif
+ _Tp __result = std::exp(__ln_nfact) * __hzeta;
+ if (__n % 2 == 1)
+ __result = -__result;
+ return __result;
+ }
+ }
+
+ } // namespace std::tr1::__detail
+}
+}
+
+#endif // _TR1_GAMMA_TCC
+
diff --git a/i686-linux/include/c++/4.4.3/tr1/hashtable.h b/i686-linux/include/c++/4.4.3/tr1/hashtable.h
new file mode 100644
index 0000000..22fdbff
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/hashtable.h
@@ -0,0 +1,53 @@
+// TR1 hashtable.h header -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/hashtable.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _GLIBCXX_TR1_HASHTABLE_H
+#define _GLIBCXX_TR1_HASHTABLE_H 1
+
+#pragma GCC system_header
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/hashtable>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/hashtable>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+#endif // _GLIBCXX_TR1_HASHTABLE_H
diff --git a/i686-linux/include/c++/4.4.3/tr1/hypergeometric.tcc b/i686-linux/include/c++/4.4.3/tr1/hypergeometric.tcc
new file mode 100644
index 0000000..c975afa
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/hypergeometric.tcc
@@ -0,0 +1,774 @@
+// Special functions -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/hypergeometric.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882 TR1: 5.2 Special functions
+//
+
+// Written by Edward Smith-Rowland based:
+// (1) Handbook of Mathematical Functions,
+// ed. Milton Abramowitz and Irene A. Stegun,
+// Dover Publications,
+// Section 6, pp. 555-566
+// (2) The Gnu Scientific Library, http://www.gnu.org/software/gsl
+
+#ifndef _GLIBCXX_TR1_HYPERGEOMETRIC_TCC
+#define _GLIBCXX_TR1_HYPERGEOMETRIC_TCC 1
+
+namespace std
+{
+namespace tr1
+{
+
+ // [5.2] Special functions
+
+ // Implementation-space details.
+ namespace __detail
+ {
+
+ /**
+ * @brief This routine returns the confluent hypergeometric function
+ * by series expansion.
+ *
+ * @f[
+ * _1F_1(a;c;x) = \frac{\Gamma(c)}{\Gamma(a)}
+ * \sum_{n=0}^{\infty}
+ * \frac{\Gamma(a+n)}{\Gamma(c+n)}
+ * \frac{x^n}{n!}
+ * @f]
+ *
+ * If a and b are integers and a < 0 and either b > 0 or b < a then the
+ * series is a polynomial with a finite number of terms. If b is an integer
+ * and b <= 0 the confluent hypergeometric function is undefined.
+ *
+ * @param __a The "numerator" parameter.
+ * @param __c The "denominator" parameter.
+ * @param __x The argument of the confluent hypergeometric function.
+ * @return The confluent hypergeometric function.
+ */
+ template<typename _Tp>
+ _Tp
+ __conf_hyperg_series(const _Tp __a, const _Tp __c, const _Tp __x)
+ {
+ const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
+
+ _Tp __term = _Tp(1);
+ _Tp __Fac = _Tp(1);
+ const unsigned int __max_iter = 100000;
+ unsigned int __i;
+ for (__i = 0; __i < __max_iter; ++__i)
+ {
+ __term *= (__a + _Tp(__i)) * __x
+ / ((__c + _Tp(__i)) * _Tp(1 + __i));
+ if (std::abs(__term) < __eps)
+ {
+ break;
+ }
+ __Fac += __term;
+ }
+ if (__i == __max_iter)
+ std::__throw_runtime_error(__N("Series failed to converge "
+ "in __conf_hyperg_series."));
+
+ return __Fac;
+ }
+
+
+ /**
+ * @brief Return the hypogeometric function @f$ _2F_1(a,b;c;x) @f$
+ * by an iterative procedure described in
+ * Luke, Algorithms for the Computation of Mathematical Functions.
+ *
+ * Like the case of the 2F1 rational approximations, these are
+ * probably guaranteed to converge for x < 0, barring gross
+ * numerical instability in the pre-asymptotic regime.
+ */
+ template<typename _Tp>
+ _Tp
+ __conf_hyperg_luke(const _Tp __a, const _Tp __c, const _Tp __xin)
+ {
+ const _Tp __big = std::pow(std::numeric_limits<_Tp>::max(), _Tp(0.16L));
+ const int __nmax = 20000;
+ const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
+ const _Tp __x = -__xin;
+ const _Tp __x3 = __x * __x * __x;
+ const _Tp __t0 = __a / __c;
+ const _Tp __t1 = (__a + _Tp(1)) / (_Tp(2) * __c);
+ const _Tp __t2 = (__a + _Tp(2)) / (_Tp(2) * (__c + _Tp(1)));
+ _Tp __F = _Tp(1);
+ _Tp __prec;
+
+ _Tp __Bnm3 = _Tp(1);
+ _Tp __Bnm2 = _Tp(1) + __t1 * __x;
+ _Tp __Bnm1 = _Tp(1) + __t2 * __x * (_Tp(1) + __t1 / _Tp(3) * __x);
+
+ _Tp __Anm3 = _Tp(1);
+ _Tp __Anm2 = __Bnm2 - __t0 * __x;
+ _Tp __Anm1 = __Bnm1 - __t0 * (_Tp(1) + __t2 * __x) * __x
+ + __t0 * __t1 * (__c / (__c + _Tp(1))) * __x * __x;
+
+ int __n = 3;
+ while(1)
+ {
+ _Tp __npam1 = _Tp(__n - 1) + __a;
+ _Tp __npcm1 = _Tp(__n - 1) + __c;
+ _Tp __npam2 = _Tp(__n - 2) + __a;
+ _Tp __npcm2 = _Tp(__n - 2) + __c;
+ _Tp __tnm1 = _Tp(2 * __n - 1);
+ _Tp __tnm3 = _Tp(2 * __n - 3);
+ _Tp __tnm5 = _Tp(2 * __n - 5);
+ _Tp __F1 = (_Tp(__n - 2) - __a) / (_Tp(2) * __tnm3 * __npcm1);
+ _Tp __F2 = (_Tp(__n) + __a) * __npam1
+ / (_Tp(4) * __tnm1 * __tnm3 * __npcm2 * __npcm1);
+ _Tp __F3 = -__npam2 * __npam1 * (_Tp(__n - 2) - __a)
+ / (_Tp(8) * __tnm3 * __tnm3 * __tnm5
+ * (_Tp(__n - 3) + __c) * __npcm2 * __npcm1);
+ _Tp __E = -__npam1 * (_Tp(__n - 1) - __c)
+ / (_Tp(2) * __tnm3 * __npcm2 * __npcm1);
+
+ _Tp __An = (_Tp(1) + __F1 * __x) * __Anm1
+ + (__E + __F2 * __x) * __x * __Anm2 + __F3 * __x3 * __Anm3;
+ _Tp __Bn = (_Tp(1) + __F1 * __x) * __Bnm1
+ + (__E + __F2 * __x) * __x * __Bnm2 + __F3 * __x3 * __Bnm3;
+ _Tp __r = __An / __Bn;
+
+ __prec = std::abs((__F - __r) / __F);
+ __F = __r;
+
+ if (__prec < __eps || __n > __nmax)
+ break;
+
+ if (std::abs(__An) > __big || std::abs(__Bn) > __big)
+ {
+ __An /= __big;
+ __Bn /= __big;
+ __Anm1 /= __big;
+ __Bnm1 /= __big;
+ __Anm2 /= __big;
+ __Bnm2 /= __big;
+ __Anm3 /= __big;
+ __Bnm3 /= __big;
+ }
+ else if (std::abs(__An) < _Tp(1) / __big
+ || std::abs(__Bn) < _Tp(1) / __big)
+ {
+ __An *= __big;
+ __Bn *= __big;
+ __Anm1 *= __big;
+ __Bnm1 *= __big;
+ __Anm2 *= __big;
+ __Bnm2 *= __big;
+ __Anm3 *= __big;
+ __Bnm3 *= __big;
+ }
+
+ ++__n;
+ __Bnm3 = __Bnm2;
+ __Bnm2 = __Bnm1;
+ __Bnm1 = __Bn;
+ __Anm3 = __Anm2;
+ __Anm2 = __Anm1;
+ __Anm1 = __An;
+ }
+
+ if (__n >= __nmax)
+ std::__throw_runtime_error(__N("Iteration failed to converge "
+ "in __conf_hyperg_luke."));
+
+ return __F;
+ }
+
+
+ /**
+ * @brief Return the confluent hypogeometric function
+ * @f$ _1F_1(a;c;x) @f$.
+ *
+ * @todo Handle b == nonpositive integer blowup - return NaN.
+ *
+ * @param __a The "numerator" parameter.
+ * @param __c The "denominator" parameter.
+ * @param __x The argument of the confluent hypergeometric function.
+ * @return The confluent hypergeometric function.
+ */
+ template<typename _Tp>
+ inline _Tp
+ __conf_hyperg(const _Tp __a, const _Tp __c, const _Tp __x)
+ {
+#if _GLIBCXX_USE_C99_MATH_TR1
+ const _Tp __c_nint = std::tr1::nearbyint(__c);
+#else
+ const _Tp __c_nint = static_cast<int>(__c + _Tp(0.5L));
+#endif
+ if (__isnan(__a) || __isnan(__c) || __isnan(__x))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (__c_nint == __c && __c_nint <= 0)
+ return std::numeric_limits<_Tp>::infinity();
+ else if (__a == _Tp(0))
+ return _Tp(1);
+ else if (__c == __a)
+ return std::exp(__x);
+ else if (__x < _Tp(0))
+ return __conf_hyperg_luke(__a, __c, __x);
+ else
+ return __conf_hyperg_series(__a, __c, __x);
+ }
+
+
+ /**
+ * @brief Return the hypogeometric function @f$ _2F_1(a,b;c;x) @f$
+ * by series expansion.
+ *
+ * The hypogeometric function is defined by
+ * @f[
+ * _2F_1(a,b;c;x) = \frac{\Gamma(c)}{\Gamma(a)\Gamma(b)}
+ * \sum_{n=0}^{\infty}
+ * \frac{\Gamma(a+n)\Gamma(b+n)}{\Gamma(c+n)}
+ * \frac{x^n}{n!}
+ * @f]
+ *
+ * This works and it's pretty fast.
+ *
+ * @param __a The first "numerator" parameter.
+ * @param __a The second "numerator" parameter.
+ * @param __c The "denominator" parameter.
+ * @param __x The argument of the confluent hypergeometric function.
+ * @return The confluent hypergeometric function.
+ */
+ template<typename _Tp>
+ _Tp
+ __hyperg_series(const _Tp __a, const _Tp __b,
+ const _Tp __c, const _Tp __x)
+ {
+ const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
+
+ _Tp __term = _Tp(1);
+ _Tp __Fabc = _Tp(1);
+ const unsigned int __max_iter = 100000;
+ unsigned int __i;
+ for (__i = 0; __i < __max_iter; ++__i)
+ {
+ __term *= (__a + _Tp(__i)) * (__b + _Tp(__i)) * __x
+ / ((__c + _Tp(__i)) * _Tp(1 + __i));
+ if (std::abs(__term) < __eps)
+ {
+ break;
+ }
+ __Fabc += __term;
+ }
+ if (__i == __max_iter)
+ std::__throw_runtime_error(__N("Series failed to converge "
+ "in __hyperg_series."));
+
+ return __Fabc;
+ }
+
+
+ /**
+ * @brief Return the hypogeometric function @f$ _2F_1(a,b;c;x) @f$
+ * by an iterative procedure described in
+ * Luke, Algorithms for the Computation of Mathematical Functions.
+ */
+ template<typename _Tp>
+ _Tp
+ __hyperg_luke(const _Tp __a, const _Tp __b, const _Tp __c,
+ const _Tp __xin)
+ {
+ const _Tp __big = std::pow(std::numeric_limits<_Tp>::max(), _Tp(0.16L));
+ const int __nmax = 20000;
+ const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
+ const _Tp __x = -__xin;
+ const _Tp __x3 = __x * __x * __x;
+ const _Tp __t0 = __a * __b / __c;
+ const _Tp __t1 = (__a + _Tp(1)) * (__b + _Tp(1)) / (_Tp(2) * __c);
+ const _Tp __t2 = (__a + _Tp(2)) * (__b + _Tp(2))
+ / (_Tp(2) * (__c + _Tp(1)));
+
+ _Tp __F = _Tp(1);
+
+ _Tp __Bnm3 = _Tp(1);
+ _Tp __Bnm2 = _Tp(1) + __t1 * __x;
+ _Tp __Bnm1 = _Tp(1) + __t2 * __x * (_Tp(1) + __t1 / _Tp(3) * __x);
+
+ _Tp __Anm3 = _Tp(1);
+ _Tp __Anm2 = __Bnm2 - __t0 * __x;
+ _Tp __Anm1 = __Bnm1 - __t0 * (_Tp(1) + __t2 * __x) * __x
+ + __t0 * __t1 * (__c / (__c + _Tp(1))) * __x * __x;
+
+ int __n = 3;
+ while (1)
+ {
+ const _Tp __npam1 = _Tp(__n - 1) + __a;
+ const _Tp __npbm1 = _Tp(__n - 1) + __b;
+ const _Tp __npcm1 = _Tp(__n - 1) + __c;
+ const _Tp __npam2 = _Tp(__n - 2) + __a;
+ const _Tp __npbm2 = _Tp(__n - 2) + __b;
+ const _Tp __npcm2 = _Tp(__n - 2) + __c;
+ const _Tp __tnm1 = _Tp(2 * __n - 1);
+ const _Tp __tnm3 = _Tp(2 * __n - 3);
+ const _Tp __tnm5 = _Tp(2 * __n - 5);
+ const _Tp __n2 = __n * __n;
+ const _Tp __F1 = (_Tp(3) * __n2 + (__a + __b - _Tp(6)) * __n
+ + _Tp(2) - __a * __b - _Tp(2) * (__a + __b))
+ / (_Tp(2) * __tnm3 * __npcm1);
+ const _Tp __F2 = -(_Tp(3) * __n2 - (__a + __b + _Tp(6)) * __n
+ + _Tp(2) - __a * __b) * __npam1 * __npbm1
+ / (_Tp(4) * __tnm1 * __tnm3 * __npcm2 * __npcm1);
+ const _Tp __F3 = (__npam2 * __npam1 * __npbm2 * __npbm1
+ * (_Tp(__n - 2) - __a) * (_Tp(__n - 2) - __b))
+ / (_Tp(8) * __tnm3 * __tnm3 * __tnm5
+ * (_Tp(__n - 3) + __c) * __npcm2 * __npcm1);
+ const _Tp __E = -__npam1 * __npbm1 * (_Tp(__n - 1) - __c)
+ / (_Tp(2) * __tnm3 * __npcm2 * __npcm1);
+
+ _Tp __An = (_Tp(1) + __F1 * __x) * __Anm1
+ + (__E + __F2 * __x) * __x * __Anm2 + __F3 * __x3 * __Anm3;
+ _Tp __Bn = (_Tp(1) + __F1 * __x) * __Bnm1
+ + (__E + __F2 * __x) * __x * __Bnm2 + __F3 * __x3 * __Bnm3;
+ const _Tp __r = __An / __Bn;
+
+ const _Tp __prec = std::abs((__F - __r) / __F);
+ __F = __r;
+
+ if (__prec < __eps || __n > __nmax)
+ break;
+
+ if (std::abs(__An) > __big || std::abs(__Bn) > __big)
+ {
+ __An /= __big;
+ __Bn /= __big;
+ __Anm1 /= __big;
+ __Bnm1 /= __big;
+ __Anm2 /= __big;
+ __Bnm2 /= __big;
+ __Anm3 /= __big;
+ __Bnm3 /= __big;
+ }
+ else if (std::abs(__An) < _Tp(1) / __big
+ || std::abs(__Bn) < _Tp(1) / __big)
+ {
+ __An *= __big;
+ __Bn *= __big;
+ __Anm1 *= __big;
+ __Bnm1 *= __big;
+ __Anm2 *= __big;
+ __Bnm2 *= __big;
+ __Anm3 *= __big;
+ __Bnm3 *= __big;
+ }
+
+ ++__n;
+ __Bnm3 = __Bnm2;
+ __Bnm2 = __Bnm1;
+ __Bnm1 = __Bn;
+ __Anm3 = __Anm2;
+ __Anm2 = __Anm1;
+ __Anm1 = __An;
+ }
+
+ if (__n >= __nmax)
+ std::__throw_runtime_error(__N("Iteration failed to converge "
+ "in __hyperg_luke."));
+
+ return __F;
+ }
+
+
+ /**
+ * @brief Return the hypogeometric function @f$ _2F_1(a,b;c;x) @f$ by the reflection
+ * formulae in Abramowitz & Stegun formula 15.3.6 for d = c - a - b not integral
+ * and formula 15.3.11 for d = c - a - b integral.
+ * This assumes a, b, c != negative integer.
+ *
+ * The hypogeometric function is defined by
+ * @f[
+ * _2F_1(a,b;c;x) = \frac{\Gamma(c)}{\Gamma(a)\Gamma(b)}
+ * \sum_{n=0}^{\infty}
+ * \frac{\Gamma(a+n)\Gamma(b+n)}{\Gamma(c+n)}
+ * \frac{x^n}{n!}
+ * @f]
+ *
+ * The reflection formula for nonintegral @f$ d = c - a - b @f$ is:
+ * @f[
+ * _2F_1(a,b;c;x) = \frac{\Gamma(c)\Gamma(d)}{\Gamma(c-a)\Gamma(c-b)}
+ * _2F_1(a,b;1-d;1-x)
+ * + \frac{\Gamma(c)\Gamma(-d)}{\Gamma(a)\Gamma(b)}
+ * _2F_1(c-a,c-b;1+d;1-x)
+ * @f]
+ *
+ * The reflection formula for integral @f$ m = c - a - b @f$ is:
+ * @f[
+ * _2F_1(a,b;a+b+m;x) = \frac{\Gamma(m)\Gamma(a+b+m)}{\Gamma(a+m)\Gamma(b+m)}
+ * \sum_{k=0}^{m-1} \frac{(m+a)_k(m+b)_k}{k!(1-m)_k}
+ * -
+ * @f]
+ */
+ template<typename _Tp>
+ _Tp
+ __hyperg_reflect(const _Tp __a, const _Tp __b, const _Tp __c,
+ const _Tp __x)
+ {
+ const _Tp __d = __c - __a - __b;
+ const int __intd = std::floor(__d + _Tp(0.5L));
+ const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
+ const _Tp __toler = _Tp(1000) * __eps;
+ const _Tp __log_max = std::log(std::numeric_limits<_Tp>::max());
+ const bool __d_integer = (std::abs(__d - __intd) < __toler);
+
+ if (__d_integer)
+ {
+ const _Tp __ln_omx = std::log(_Tp(1) - __x);
+ const _Tp __ad = std::abs(__d);
+ _Tp __F1, __F2;
+
+ _Tp __d1, __d2;
+ if (__d >= _Tp(0))
+ {
+ __d1 = __d;
+ __d2 = _Tp(0);
+ }
+ else
+ {
+ __d1 = _Tp(0);
+ __d2 = __d;
+ }
+
+ const _Tp __lng_c = __log_gamma(__c);
+
+ // Evaluate F1.
+ if (__ad < __eps)
+ {
+ // d = c - a - b = 0.
+ __F1 = _Tp(0);
+ }
+ else
+ {
+
+ bool __ok_d1 = true;
+ _Tp __lng_ad, __lng_ad1, __lng_bd1;
+ __try
+ {
+ __lng_ad = __log_gamma(__ad);
+ __lng_ad1 = __log_gamma(__a + __d1);
+ __lng_bd1 = __log_gamma(__b + __d1);
+ }
+ __catch(...)
+ {
+ __ok_d1 = false;
+ }
+
+ if (__ok_d1)
+ {
+ /* Gamma functions in the denominator are ok.
+ * Proceed with evaluation.
+ */
+ _Tp __sum1 = _Tp(1);
+ _Tp __term = _Tp(1);
+ _Tp __ln_pre1 = __lng_ad + __lng_c + __d2 * __ln_omx
+ - __lng_ad1 - __lng_bd1;
+
+ /* Do F1 sum.
+ */
+ for (int __i = 1; __i < __ad; ++__i)
+ {
+ const int __j = __i - 1;
+ __term *= (__a + __d2 + __j) * (__b + __d2 + __j)
+ / (_Tp(1) + __d2 + __j) / __i * (_Tp(1) - __x);
+ __sum1 += __term;
+ }
+
+ if (__ln_pre1 > __log_max)
+ std::__throw_runtime_error(__N("Overflow of gamma functions "
+ "in __hyperg_luke."));
+ else
+ __F1 = std::exp(__ln_pre1) * __sum1;
+ }
+ else
+ {
+ // Gamma functions in the denominator were not ok.
+ // So the F1 term is zero.
+ __F1 = _Tp(0);
+ }
+ } // end F1 evaluation
+
+ // Evaluate F2.
+ bool __ok_d2 = true;
+ _Tp __lng_ad2, __lng_bd2;
+ __try
+ {
+ __lng_ad2 = __log_gamma(__a + __d2);
+ __lng_bd2 = __log_gamma(__b + __d2);
+ }
+ __catch(...)
+ {
+ __ok_d2 = false;
+ }
+
+ if (__ok_d2)
+ {
+ // Gamma functions in the denominator are ok.
+ // Proceed with evaluation.
+ const int __maxiter = 2000;
+ const _Tp __psi_1 = -__numeric_constants<_Tp>::__gamma_e();
+ const _Tp __psi_1pd = __psi(_Tp(1) + __ad);
+ const _Tp __psi_apd1 = __psi(__a + __d1);
+ const _Tp __psi_bpd1 = __psi(__b + __d1);
+
+ _Tp __psi_term = __psi_1 + __psi_1pd - __psi_apd1
+ - __psi_bpd1 - __ln_omx;
+ _Tp __fact = _Tp(1);
+ _Tp __sum2 = __psi_term;
+ _Tp __ln_pre2 = __lng_c + __d1 * __ln_omx
+ - __lng_ad2 - __lng_bd2;
+
+ // Do F2 sum.
+ int __j;
+ for (__j = 1; __j < __maxiter; ++__j)
+ {
+ // Values for psi functions use recurrence; Abramowitz & Stegun 6.3.5
+ const _Tp __term1 = _Tp(1) / _Tp(__j)
+ + _Tp(1) / (__ad + __j);
+ const _Tp __term2 = _Tp(1) / (__a + __d1 + _Tp(__j - 1))
+ + _Tp(1) / (__b + __d1 + _Tp(__j - 1));
+ __psi_term += __term1 - __term2;
+ __fact *= (__a + __d1 + _Tp(__j - 1))
+ * (__b + __d1 + _Tp(__j - 1))
+ / ((__ad + __j) * __j) * (_Tp(1) - __x);
+ const _Tp __delta = __fact * __psi_term;
+ __sum2 += __delta;
+ if (std::abs(__delta) < __eps * std::abs(__sum2))
+ break;
+ }
+ if (__j == __maxiter)
+ std::__throw_runtime_error(__N("Sum F2 failed to converge "
+ "in __hyperg_reflect"));
+
+ if (__sum2 == _Tp(0))
+ __F2 = _Tp(0);
+ else
+ __F2 = std::exp(__ln_pre2) * __sum2;
+ }
+ else
+ {
+ // Gamma functions in the denominator not ok.
+ // So the F2 term is zero.
+ __F2 = _Tp(0);
+ } // end F2 evaluation
+
+ const _Tp __sgn_2 = (__intd % 2 == 1 ? -_Tp(1) : _Tp(1));
+ const _Tp __F = __F1 + __sgn_2 * __F2;
+
+ return __F;
+ }
+ else
+ {
+ // d = c - a - b not an integer.
+
+ // These gamma functions appear in the denominator, so we
+ // catch their harmless domain errors and set the terms to zero.
+ bool __ok1 = true;
+ _Tp __sgn_g1ca = _Tp(0), __ln_g1ca = _Tp(0);
+ _Tp __sgn_g1cb = _Tp(0), __ln_g1cb = _Tp(0);
+ __try
+ {
+ __sgn_g1ca = __log_gamma_sign(__c - __a);
+ __ln_g1ca = __log_gamma(__c - __a);
+ __sgn_g1cb = __log_gamma_sign(__c - __b);
+ __ln_g1cb = __log_gamma(__c - __b);
+ }
+ __catch(...)
+ {
+ __ok1 = false;
+ }
+
+ bool __ok2 = true;
+ _Tp __sgn_g2a = _Tp(0), __ln_g2a = _Tp(0);
+ _Tp __sgn_g2b = _Tp(0), __ln_g2b = _Tp(0);
+ __try
+ {
+ __sgn_g2a = __log_gamma_sign(__a);
+ __ln_g2a = __log_gamma(__a);
+ __sgn_g2b = __log_gamma_sign(__b);
+ __ln_g2b = __log_gamma(__b);
+ }
+ __catch(...)
+ {
+ __ok2 = false;
+ }
+
+ const _Tp __sgn_gc = __log_gamma_sign(__c);
+ const _Tp __ln_gc = __log_gamma(__c);
+ const _Tp __sgn_gd = __log_gamma_sign(__d);
+ const _Tp __ln_gd = __log_gamma(__d);
+ const _Tp __sgn_gmd = __log_gamma_sign(-__d);
+ const _Tp __ln_gmd = __log_gamma(-__d);
+
+ const _Tp __sgn1 = __sgn_gc * __sgn_gd * __sgn_g1ca * __sgn_g1cb;
+ const _Tp __sgn2 = __sgn_gc * __sgn_gmd * __sgn_g2a * __sgn_g2b;
+
+ _Tp __pre1, __pre2;
+ if (__ok1 && __ok2)
+ {
+ _Tp __ln_pre1 = __ln_gc + __ln_gd - __ln_g1ca - __ln_g1cb;
+ _Tp __ln_pre2 = __ln_gc + __ln_gmd - __ln_g2a - __ln_g2b
+ + __d * std::log(_Tp(1) - __x);
+ if (__ln_pre1 < __log_max && __ln_pre2 < __log_max)
+ {
+ __pre1 = std::exp(__ln_pre1);
+ __pre2 = std::exp(__ln_pre2);
+ __pre1 *= __sgn1;
+ __pre2 *= __sgn2;
+ }
+ else
+ {
+ std::__throw_runtime_error(__N("Overflow of gamma functions "
+ "in __hyperg_reflect"));
+ }
+ }
+ else if (__ok1 && !__ok2)
+ {
+ _Tp __ln_pre1 = __ln_gc + __ln_gd - __ln_g1ca - __ln_g1cb;
+ if (__ln_pre1 < __log_max)
+ {
+ __pre1 = std::exp(__ln_pre1);
+ __pre1 *= __sgn1;
+ __pre2 = _Tp(0);
+ }
+ else
+ {
+ std::__throw_runtime_error(__N("Overflow of gamma functions "
+ "in __hyperg_reflect"));
+ }
+ }
+ else if (!__ok1 && __ok2)
+ {
+ _Tp __ln_pre2 = __ln_gc + __ln_gmd - __ln_g2a - __ln_g2b
+ + __d * std::log(_Tp(1) - __x);
+ if (__ln_pre2 < __log_max)
+ {
+ __pre1 = _Tp(0);
+ __pre2 = std::exp(__ln_pre2);
+ __pre2 *= __sgn2;
+ }
+ else
+ {
+ std::__throw_runtime_error(__N("Overflow of gamma functions "
+ "in __hyperg_reflect"));
+ }
+ }
+ else
+ {
+ __pre1 = _Tp(0);
+ __pre2 = _Tp(0);
+ std::__throw_runtime_error(__N("Underflow of gamma functions "
+ "in __hyperg_reflect"));
+ }
+
+ const _Tp __F1 = __hyperg_series(__a, __b, _Tp(1) - __d,
+ _Tp(1) - __x);
+ const _Tp __F2 = __hyperg_series(__c - __a, __c - __b, _Tp(1) + __d,
+ _Tp(1) - __x);
+
+ const _Tp __F = __pre1 * __F1 + __pre2 * __F2;
+
+ return __F;
+ }
+ }
+
+
+ /**
+ * @brief Return the hypogeometric function @f$ _2F_1(a,b;c;x) @f$.
+ *
+ * The hypogeometric function is defined by
+ * @f[
+ * _2F_1(a,b;c;x) = \frac{\Gamma(c)}{\Gamma(a)\Gamma(b)}
+ * \sum_{n=0}^{\infty}
+ * \frac{\Gamma(a+n)\Gamma(b+n)}{\Gamma(c+n)}
+ * \frac{x^n}{n!}
+ * @f]
+ *
+ * @param __a The first "numerator" parameter.
+ * @param __a The second "numerator" parameter.
+ * @param __c The "denominator" parameter.
+ * @param __x The argument of the confluent hypergeometric function.
+ * @return The confluent hypergeometric function.
+ */
+ template<typename _Tp>
+ inline _Tp
+ __hyperg(const _Tp __a, const _Tp __b, const _Tp __c, const _Tp __x)
+ {
+#if _GLIBCXX_USE_C99_MATH_TR1
+ const _Tp __a_nint = std::tr1::nearbyint(__a);
+ const _Tp __b_nint = std::tr1::nearbyint(__b);
+ const _Tp __c_nint = std::tr1::nearbyint(__c);
+#else
+ const _Tp __a_nint = static_cast<int>(__a + _Tp(0.5L));
+ const _Tp __b_nint = static_cast<int>(__b + _Tp(0.5L));
+ const _Tp __c_nint = static_cast<int>(__c + _Tp(0.5L));
+#endif
+ const _Tp __toler = _Tp(1000) * std::numeric_limits<_Tp>::epsilon();
+ if (std::abs(__x) >= _Tp(1))
+ std::__throw_domain_error(__N("Argument outside unit circle "
+ "in __hyperg."));
+ else if (__isnan(__a) || __isnan(__b)
+ || __isnan(__c) || __isnan(__x))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (__c_nint == __c && __c_nint <= _Tp(0))
+ return std::numeric_limits<_Tp>::infinity();
+ else if (std::abs(__c - __b) < __toler || std::abs(__c - __a) < __toler)
+ return std::pow(_Tp(1) - __x, __c - __a - __b);
+ else if (__a >= _Tp(0) && __b >= _Tp(0) && __c >= _Tp(0)
+ && __x >= _Tp(0) && __x < _Tp(0.995L))
+ return __hyperg_series(__a, __b, __c, __x);
+ else if (std::abs(__a) < _Tp(10) && std::abs(__b) < _Tp(10))
+ {
+ // For integer a and b the hypergeometric function is a finite polynomial.
+ if (__a < _Tp(0) && std::abs(__a - __a_nint) < __toler)
+ return __hyperg_series(__a_nint, __b, __c, __x);
+ else if (__b < _Tp(0) && std::abs(__b - __b_nint) < __toler)
+ return __hyperg_series(__a, __b_nint, __c, __x);
+ else if (__x < -_Tp(0.25L))
+ return __hyperg_luke(__a, __b, __c, __x);
+ else if (__x < _Tp(0.5L))
+ return __hyperg_series(__a, __b, __c, __x);
+ else
+ if (std::abs(__c) > _Tp(10))
+ return __hyperg_series(__a, __b, __c, __x);
+ else
+ return __hyperg_reflect(__a, __b, __c, __x);
+ }
+ else
+ return __hyperg_luke(__a, __b, __c, __x);
+ }
+
+ } // namespace std::tr1::__detail
+}
+}
+
+#endif // _GLIBCXX_TR1_HYPERGEOMETRIC_TCC
diff --git a/i686-linux/include/c++/4.4.3/tr1/inttypes.h b/i686-linux/include/c++/4.4.3/tr1/inttypes.h
new file mode 100644
index 0000000..4c8fd45
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/inttypes.h
@@ -0,0 +1,34 @@
+// TR1 inttypes.h -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/inttypes.h
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_INTTYPES_H
+#define _GLIBCXX_TR1_INTTYPES_H 1
+
+#include <tr1/cinttypes>
+
+#endif // _GLIBCXX_TR1_INTTYPES_H
diff --git a/i686-linux/include/c++/4.4.3/tr1/legendre_function.tcc b/i686-linux/include/c++/4.4.3/tr1/legendre_function.tcc
new file mode 100644
index 0000000..8b59814
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/legendre_function.tcc
@@ -0,0 +1,305 @@
+// Special functions -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/legendre_function.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882 TR1: 5.2 Special functions
+//
+
+// Written by Edward Smith-Rowland based on:
+// (1) Handbook of Mathematical Functions,
+// ed. Milton Abramowitz and Irene A. Stegun,
+// Dover Publications,
+// Section 8, pp. 331-341
+// (2) The Gnu Scientific Library, http://www.gnu.org/software/gsl
+// (3) Numerical Recipes in C, by W. H. Press, S. A. Teukolsky,
+// W. T. Vetterling, B. P. Flannery, Cambridge University Press (1992),
+// 2nd ed, pp. 252-254
+
+#ifndef _GLIBCXX_TR1_LEGENDRE_FUNCTION_TCC
+#define _GLIBCXX_TR1_LEGENDRE_FUNCTION_TCC 1
+
+#include "special_function_util.h"
+
+namespace std
+{
+namespace tr1
+{
+
+ // [5.2] Special functions
+
+ // Implementation-space details.
+ namespace __detail
+ {
+
+ /**
+ * @brief Return the Legendre polynomial by recursion on order
+ * @f$ l @f$.
+ *
+ * The Legendre function of @f$ l @f$ and @f$ x @f$,
+ * @f$ P_l(x) @f$, is defined by:
+ * @f[
+ * P_l(x) = \frac{1}{2^l l!}\frac{d^l}{dx^l}(x^2 - 1)^{l}
+ * @f]
+ *
+ * @param l The order of the Legendre polynomial. @f$l >= 0@f$.
+ * @param x The argument of the Legendre polynomial. @f$|x| <= 1@f$.
+ */
+ template<typename _Tp>
+ _Tp
+ __poly_legendre_p(const unsigned int __l, const _Tp __x)
+ {
+
+ if ((__x < _Tp(-1)) || (__x > _Tp(+1)))
+ std::__throw_domain_error(__N("Argument out of range"
+ " in __poly_legendre_p."));
+ else if (__isnan(__x))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (__x == +_Tp(1))
+ return +_Tp(1);
+ else if (__x == -_Tp(1))
+ return (__l % 2 == 1 ? -_Tp(1) : +_Tp(1));
+ else
+ {
+ _Tp __p_lm2 = _Tp(1);
+ if (__l == 0)
+ return __p_lm2;
+
+ _Tp __p_lm1 = __x;
+ if (__l == 1)
+ return __p_lm1;
+
+ _Tp __p_l = 0;
+ for (unsigned int __ll = 2; __ll <= __l; ++__ll)
+ {
+ // This arrangement is supposed to be better for roundoff
+ // protection, Arfken, 2nd Ed, Eq 12.17a.
+ __p_l = _Tp(2) * __x * __p_lm1 - __p_lm2
+ - (__x * __p_lm1 - __p_lm2) / _Tp(__ll);
+ __p_lm2 = __p_lm1;
+ __p_lm1 = __p_l;
+ }
+
+ return __p_l;
+ }
+ }
+
+
+ /**
+ * @brief Return the associated Legendre function by recursion
+ * on @f$ l @f$.
+ *
+ * The associated Legendre function is derived from the Legendre function
+ * @f$ P_l(x) @f$ by the Rodrigues formula:
+ * @f[
+ * P_l^m(x) = (1 - x^2)^{m/2}\frac{d^m}{dx^m}P_l(x)
+ * @f]
+ *
+ * @param l The order of the associated Legendre function.
+ * @f$ l >= 0 @f$.
+ * @param m The order of the associated Legendre function.
+ * @f$ m <= l @f$.
+ * @param x The argument of the associated Legendre function.
+ * @f$ |x| <= 1 @f$.
+ */
+ template<typename _Tp>
+ _Tp
+ __assoc_legendre_p(const unsigned int __l, const unsigned int __m,
+ const _Tp __x)
+ {
+
+ if (__x < _Tp(-1) || __x > _Tp(+1))
+ std::__throw_domain_error(__N("Argument out of range"
+ " in __assoc_legendre_p."));
+ else if (__m > __l)
+ std::__throw_domain_error(__N("Degree out of range"
+ " in __assoc_legendre_p."));
+ else if (__isnan(__x))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (__m == 0)
+ return __poly_legendre_p(__l, __x);
+ else
+ {
+ _Tp __p_mm = _Tp(1);
+ if (__m > 0)
+ {
+ // Two square roots seem more accurate more of the time
+ // than just one.
+ _Tp __root = std::sqrt(_Tp(1) - __x) * std::sqrt(_Tp(1) + __x);
+ _Tp __fact = _Tp(1);
+ for (unsigned int __i = 1; __i <= __m; ++__i)
+ {
+ __p_mm *= -__fact * __root;
+ __fact += _Tp(2);
+ }
+ }
+ if (__l == __m)
+ return __p_mm;
+
+ _Tp __p_mp1m = _Tp(2 * __m + 1) * __x * __p_mm;
+ if (__l == __m + 1)
+ return __p_mp1m;
+
+ _Tp __p_lm2m = __p_mm;
+ _Tp __P_lm1m = __p_mp1m;
+ _Tp __p_lm = _Tp(0);
+ for (unsigned int __j = __m + 2; __j <= __l; ++__j)
+ {
+ __p_lm = (_Tp(2 * __j - 1) * __x * __P_lm1m
+ - _Tp(__j + __m - 1) * __p_lm2m) / _Tp(__j - __m);
+ __p_lm2m = __P_lm1m;
+ __P_lm1m = __p_lm;
+ }
+
+ return __p_lm;
+ }
+ }
+
+
+ /**
+ * @brief Return the spherical associated Legendre function.
+ *
+ * The spherical associated Legendre function of @f$ l @f$, @f$ m @f$,
+ * and @f$ \theta @f$ is defined as @f$ Y_l^m(\theta,0) @f$ where
+ * @f[
+ * Y_l^m(\theta,\phi) = (-1)^m[\frac{(2l+1)}{4\pi}
+ * \frac{(l-m)!}{(l+m)!}]
+ * P_l^m(\cos\theta) \exp^{im\phi}
+ * @f]
+ * is the spherical harmonic function and @f$ P_l^m(x) @f$ is the
+ * associated Legendre function.
+ *
+ * This function differs from the associated Legendre function by
+ * argument (@f$x = \cos(\theta)@f$) and by a normalization factor
+ * but this factor is rather large for large @f$ l @f$ and @f$ m @f$
+ * and so this function is stable for larger differences of @f$ l @f$
+ * and @f$ m @f$.
+ *
+ * @param l The order of the spherical associated Legendre function.
+ * @f$ l >= 0 @f$.
+ * @param m The order of the spherical associated Legendre function.
+ * @f$ m <= l @f$.
+ * @param theta The radian angle argument of the spherical associated
+ * Legendre function.
+ */
+ template <typename _Tp>
+ _Tp
+ __sph_legendre(const unsigned int __l, const unsigned int __m,
+ const _Tp __theta)
+ {
+ if (__isnan(__theta))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+
+ const _Tp __x = std::cos(__theta);
+
+ if (__l < __m)
+ {
+ std::__throw_domain_error(__N("Bad argument "
+ "in __sph_legendre."));
+ }
+ else if (__m == 0)
+ {
+ _Tp __P = __poly_legendre_p(__l, __x);
+ _Tp __fact = std::sqrt(_Tp(2 * __l + 1)
+ / (_Tp(4) * __numeric_constants<_Tp>::__pi()));
+ __P *= __fact;
+ return __P;
+ }
+ else if (__x == _Tp(1) || __x == -_Tp(1))
+ {
+ // m > 0 here
+ return _Tp(0);
+ }
+ else
+ {
+ // m > 0 and |x| < 1 here
+
+ // Starting value for recursion.
+ // Y_m^m(x) = sqrt( (2m+1)/(4pi m) gamma(m+1/2)/gamma(m) )
+ // (-1)^m (1-x^2)^(m/2) / pi^(1/4)
+ const _Tp __sgn = ( __m % 2 == 1 ? -_Tp(1) : _Tp(1));
+ const _Tp __y_mp1m_factor = __x * std::sqrt(_Tp(2 * __m + 3));
+#if _GLIBCXX_USE_C99_MATH_TR1
+ const _Tp __lncirc = std::tr1::log1p(-__x * __x);
+#else
+ const _Tp __lncirc = std::log(_Tp(1) - __x * __x);
+#endif
+ // Gamma(m+1/2) / Gamma(m)
+#if _GLIBCXX_USE_C99_MATH_TR1
+ const _Tp __lnpoch = std::tr1::lgamma(_Tp(__m + _Tp(0.5L)))
+ - std::tr1::lgamma(_Tp(__m));
+#else
+ const _Tp __lnpoch = __log_gamma(_Tp(__m + _Tp(0.5L)))
+ - __log_gamma(_Tp(__m));
+#endif
+ const _Tp __lnpre_val =
+ -_Tp(0.25L) * __numeric_constants<_Tp>::__lnpi()
+ + _Tp(0.5L) * (__lnpoch + __m * __lncirc);
+ _Tp __sr = std::sqrt((_Tp(2) + _Tp(1) / __m)
+ / (_Tp(4) * __numeric_constants<_Tp>::__pi()));
+ _Tp __y_mm = __sgn * __sr * std::exp(__lnpre_val);
+ _Tp __y_mp1m = __y_mp1m_factor * __y_mm;
+
+ if (__l == __m)
+ {
+ return __y_mm;
+ }
+ else if (__l == __m + 1)
+ {
+ return __y_mp1m;
+ }
+ else
+ {
+ _Tp __y_lm = _Tp(0);
+
+ // Compute Y_l^m, l > m+1, upward recursion on l.
+ for ( int __ll = __m + 2; __ll <= __l; ++__ll)
+ {
+ const _Tp __rat1 = _Tp(__ll - __m) / _Tp(__ll + __m);
+ const _Tp __rat2 = _Tp(__ll - __m - 1) / _Tp(__ll + __m - 1);
+ const _Tp __fact1 = std::sqrt(__rat1 * _Tp(2 * __ll + 1)
+ * _Tp(2 * __ll - 1));
+ const _Tp __fact2 = std::sqrt(__rat1 * __rat2 * _Tp(2 * __ll + 1)
+ / _Tp(2 * __ll - 3));
+ __y_lm = (__x * __y_mp1m * __fact1
+ - (__ll + __m - 1) * __y_mm * __fact2) / _Tp(__ll - __m);
+ __y_mm = __y_mp1m;
+ __y_mp1m = __y_lm;
+ }
+
+ return __y_lm;
+ }
+ }
+ }
+
+ } // namespace std::tr1::__detail
+}
+}
+
+#endif // _GLIBCXX_TR1_LEGENDRE_FUNCTION_TCC
diff --git a/i686-linux/include/c++/4.4.3/tr1/limits.h b/i686-linux/include/c++/4.4.3/tr1/limits.h
new file mode 100644
index 0000000..d95d360
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/limits.h
@@ -0,0 +1,34 @@
+// TR1 limits.h -*- C++ -*-
+
+// Copyright (C) 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/limits.h
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _TR1_LIMITS_H
+#define _TR1_LIMITS_H 1
+
+#include <tr1/climits>
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/tr1/math.h b/i686-linux/include/c++/4.4.3/tr1/math.h
new file mode 100644
index 0000000..15d6d64
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/math.h
@@ -0,0 +1,186 @@
+// TR1 math.h -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/math.h
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_MATH_H
+#define _GLIBCXX_TR1_MATH_H 1
+
+#include <tr1/cmath>
+
+#if _GLIBCXX_USE_C99_MATH_TR1
+
+using std::tr1::acos;
+using std::tr1::acosh;
+using std::tr1::asin;
+using std::tr1::asinh;
+using std::tr1::atan;
+using std::tr1::atan2;
+using std::tr1::atanh;
+using std::tr1::cbrt;
+using std::tr1::ceil;
+using std::tr1::copysign;
+using std::tr1::cos;
+using std::tr1::cosh;
+using std::tr1::erf;
+using std::tr1::erfc;
+using std::tr1::exp;
+using std::tr1::exp2;
+using std::tr1::expm1;
+using std::tr1::fabs;
+using std::tr1::fdim;
+using std::tr1::floor;
+using std::tr1::fma;
+using std::tr1::fmax;
+using std::tr1::fmin;
+using std::tr1::fmod;
+using std::tr1::frexp;
+using std::tr1::hypot;
+using std::tr1::ilogb;
+using std::tr1::ldexp;
+using std::tr1::lgamma;
+using std::tr1::llrint;
+using std::tr1::llround;
+using std::tr1::log;
+using std::tr1::log10;
+using std::tr1::log1p;
+using std::tr1::log2;
+using std::tr1::logb;
+using std::tr1::lrint;
+using std::tr1::lround;
+using std::tr1::nearbyint;
+using std::tr1::nextafter;
+using std::tr1::nexttoward;
+using std::tr1::pow;
+using std::tr1::remainder;
+using std::tr1::remquo;
+using std::tr1::rint;
+using std::tr1::round;
+using std::tr1::scalbln;
+using std::tr1::scalbn;
+using std::tr1::sin;
+using std::tr1::sinh;
+using std::tr1::sqrt;
+using std::tr1::tan;
+using std::tr1::tanh;
+using std::tr1::tgamma;
+using std::tr1::trunc;
+
+#endif
+
+using std::tr1::assoc_laguerref;
+using std::tr1::assoc_laguerre;
+using std::tr1::assoc_laguerrel;
+
+using std::tr1::assoc_legendref;
+using std::tr1::assoc_legendre;
+using std::tr1::assoc_legendrel;
+
+using std::tr1::betaf;
+using std::tr1::beta;
+using std::tr1::betal;
+
+using std::tr1::comp_ellint_1f;
+using std::tr1::comp_ellint_1;
+using std::tr1::comp_ellint_1l;
+
+using std::tr1::comp_ellint_2f;
+using std::tr1::comp_ellint_2;
+using std::tr1::comp_ellint_2l;
+
+using std::tr1::comp_ellint_3f;
+using std::tr1::comp_ellint_3;
+using std::tr1::comp_ellint_3l;
+
+using std::tr1::conf_hypergf;
+using std::tr1::conf_hyperg;
+using std::tr1::conf_hypergl;
+
+using std::tr1::cyl_bessel_if;
+using std::tr1::cyl_bessel_i;
+using std::tr1::cyl_bessel_il;
+
+using std::tr1::cyl_bessel_jf;
+using std::tr1::cyl_bessel_j;
+using std::tr1::cyl_bessel_jl;
+
+using std::tr1::cyl_bessel_kf;
+using std::tr1::cyl_bessel_k;
+using std::tr1::cyl_bessel_kl;
+
+using std::tr1::cyl_neumannf;
+using std::tr1::cyl_neumann;
+using std::tr1::cyl_neumannl;
+
+using std::tr1::ellint_1f;
+using std::tr1::ellint_1;
+using std::tr1::ellint_1l;
+
+using std::tr1::ellint_2f;
+using std::tr1::ellint_2;
+using std::tr1::ellint_2l;
+
+using std::tr1::ellint_3f;
+using std::tr1::ellint_3;
+using std::tr1::ellint_3l;
+
+using std::tr1::expintf;
+using std::tr1::expint;
+using std::tr1::expintl;
+
+using std::tr1::hermitef;
+using std::tr1::hermite;
+using std::tr1::hermitel;
+
+using std::tr1::hypergf;
+using std::tr1::hyperg;
+using std::tr1::hypergl;
+
+using std::tr1::laguerref;
+using std::tr1::laguerre;
+using std::tr1::laguerrel;
+
+using std::tr1::legendref;
+using std::tr1::legendre;
+using std::tr1::legendrel;
+
+using std::tr1::riemann_zetaf;
+using std::tr1::riemann_zeta;
+using std::tr1::riemann_zetal;
+
+using std::tr1::sph_besself;
+using std::tr1::sph_bessel;
+using std::tr1::sph_bessell;
+
+using std::tr1::sph_legendref;
+using std::tr1::sph_legendre;
+using std::tr1::sph_legendrel;
+
+using std::tr1::sph_neumannf;
+using std::tr1::sph_neumann;
+using std::tr1::sph_neumannl;
+
+#endif // _GLIBCXX_TR1_MATH_H
diff --git a/i686-linux/include/c++/4.4.3/tr1/memory b/i686-linux/include/c++/4.4.3/tr1/memory
new file mode 100644
index 0000000..8b021a1
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/memory
@@ -0,0 +1,67 @@
+// <tr1/memory> -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/**
+ * @file tr1/memory
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_MEMORY
+#define _GLIBCXX_TR1_MEMORY 1
+
+#pragma GCC system_header
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+#include <memory>
+#include <exception> // std::exception
+#include <typeinfo> // std::type_info in get_deleter
+#include <bits/stl_algobase.h> // std::swap
+#include <iosfwd> // std::basic_ostream
+#include <ext/atomicity.h>
+#include <ext/concurrence.h>
+#include <bits/functexcept.h>
+#include <bits/stl_function.h> // std::less
+#include <debug/debug.h>
+#include <tr1/type_traits>
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/boost_sp_counted_base.h>
+# include <tr1/shared_ptr.h>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/boost_sp_counted_base.h>
+# include <tr1/shared_ptr.h>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+#endif // _GLIBCXX_TR1_MEMORY
diff --git a/i686-linux/include/c++/4.4.3/tr1/modified_bessel_func.tcc b/i686-linux/include/c++/4.4.3/tr1/modified_bessel_func.tcc
new file mode 100644
index 0000000..7b8aebc
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/modified_bessel_func.tcc
@@ -0,0 +1,436 @@
+// Special functions -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/modified_bessel_func.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882 TR1: 5.2 Special functions
+//
+
+// Written by Edward Smith-Rowland.
+//
+// References:
+// (1) Handbook of Mathematical Functions,
+// Ed. Milton Abramowitz and Irene A. Stegun,
+// Dover Publications,
+// Section 9, pp. 355-434, Section 10 pp. 435-478
+// (2) The Gnu Scientific Library, http://www.gnu.org/software/gsl
+// (3) Numerical Recipes in C, by W. H. Press, S. A. Teukolsky,
+// W. T. Vetterling, B. P. Flannery, Cambridge University Press (1992),
+// 2nd ed, pp. 246-249.
+
+#ifndef _GLIBCXX_TR1_MODIFIED_BESSEL_FUNC_TCC
+#define _GLIBCXX_TR1_MODIFIED_BESSEL_FUNC_TCC 1
+
+#include "special_function_util.h"
+
+namespace std
+{
+namespace tr1
+{
+
+ // [5.2] Special functions
+
+ // Implementation-space details.
+ namespace __detail
+ {
+
+ /**
+ * @brief Compute the modified Bessel functions @f$ I_\nu(x) @f$ and
+ * @f$ K_\nu(x) @f$ and their first derivatives
+ * @f$ I'_\nu(x) @f$ and @f$ K'_\nu(x) @f$ respectively.
+ * These four functions are computed together for numerical
+ * stability.
+ *
+ * @param __nu The order of the Bessel functions.
+ * @param __x The argument of the Bessel functions.
+ * @param __Inu The output regular modified Bessel function.
+ * @param __Knu The output irregular modified Bessel function.
+ * @param __Ipnu The output derivative of the regular
+ * modified Bessel function.
+ * @param __Kpnu The output derivative of the irregular
+ * modified Bessel function.
+ */
+ template <typename _Tp>
+ void
+ __bessel_ik(const _Tp __nu, const _Tp __x,
+ _Tp & __Inu, _Tp & __Knu, _Tp & __Ipnu, _Tp & __Kpnu)
+ {
+ if (__x == _Tp(0))
+ {
+ if (__nu == _Tp(0))
+ {
+ __Inu = _Tp(1);
+ __Ipnu = _Tp(0);
+ }
+ else if (__nu == _Tp(1))
+ {
+ __Inu = _Tp(0);
+ __Ipnu = _Tp(0.5L);
+ }
+ else
+ {
+ __Inu = _Tp(0);
+ __Ipnu = _Tp(0);
+ }
+ __Knu = std::numeric_limits<_Tp>::infinity();
+ __Kpnu = -std::numeric_limits<_Tp>::infinity();
+ return;
+ }
+
+ const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
+ const _Tp __fp_min = _Tp(10) * std::numeric_limits<_Tp>::epsilon();
+ const int __max_iter = 15000;
+ const _Tp __x_min = _Tp(2);
+
+ const int __nl = static_cast<int>(__nu + _Tp(0.5L));
+
+ const _Tp __mu = __nu - __nl;
+ const _Tp __mu2 = __mu * __mu;
+ const _Tp __xi = _Tp(1) / __x;
+ const _Tp __xi2 = _Tp(2) * __xi;
+ _Tp __h = __nu * __xi;
+ if ( __h < __fp_min )
+ __h = __fp_min;
+ _Tp __b = __xi2 * __nu;
+ _Tp __d = _Tp(0);
+ _Tp __c = __h;
+ int __i;
+ for ( __i = 1; __i <= __max_iter; ++__i )
+ {
+ __b += __xi2;
+ __d = _Tp(1) / (__b + __d);
+ __c = __b + _Tp(1) / __c;
+ const _Tp __del = __c * __d;
+ __h *= __del;
+ if (std::abs(__del - _Tp(1)) < __eps)
+ break;
+ }
+ if (__i > __max_iter)
+ std::__throw_runtime_error(__N("Argument x too large "
+ "in __bessel_jn; "
+ "try asymptotic expansion."));
+ _Tp __Inul = __fp_min;
+ _Tp __Ipnul = __h * __Inul;
+ _Tp __Inul1 = __Inul;
+ _Tp __Ipnu1 = __Ipnul;
+ _Tp __fact = __nu * __xi;
+ for (int __l = __nl; __l >= 1; --__l)
+ {
+ const _Tp __Inutemp = __fact * __Inul + __Ipnul;
+ __fact -= __xi;
+ __Ipnul = __fact * __Inutemp + __Inul;
+ __Inul = __Inutemp;
+ }
+ _Tp __f = __Ipnul / __Inul;
+ _Tp __Kmu, __Knu1;
+ if (__x < __x_min)
+ {
+ const _Tp __x2 = __x / _Tp(2);
+ const _Tp __pimu = __numeric_constants<_Tp>::__pi() * __mu;
+ const _Tp __fact = (std::abs(__pimu) < __eps
+ ? _Tp(1) : __pimu / std::sin(__pimu));
+ _Tp __d = -std::log(__x2);
+ _Tp __e = __mu * __d;
+ const _Tp __fact2 = (std::abs(__e) < __eps
+ ? _Tp(1) : std::sinh(__e) / __e);
+ _Tp __gam1, __gam2, __gampl, __gammi;
+ __gamma_temme(__mu, __gam1, __gam2, __gampl, __gammi);
+ _Tp __ff = __fact
+ * (__gam1 * std::cosh(__e) + __gam2 * __fact2 * __d);
+ _Tp __sum = __ff;
+ __e = std::exp(__e);
+ _Tp __p = __e / (_Tp(2) * __gampl);
+ _Tp __q = _Tp(1) / (_Tp(2) * __e * __gammi);
+ _Tp __c = _Tp(1);
+ __d = __x2 * __x2;
+ _Tp __sum1 = __p;
+ int __i;
+ for (__i = 1; __i <= __max_iter; ++__i)
+ {
+ __ff = (__i * __ff + __p + __q) / (__i * __i - __mu2);
+ __c *= __d / __i;
+ __p /= __i - __mu;
+ __q /= __i + __mu;
+ const _Tp __del = __c * __ff;
+ __sum += __del;
+ const _Tp __del1 = __c * (__p - __i * __ff);
+ __sum1 += __del1;
+ if (std::abs(__del) < __eps * std::abs(__sum))
+ break;
+ }
+ if (__i > __max_iter)
+ std::__throw_runtime_error(__N("Bessel k series failed to converge "
+ "in __bessel_jn."));
+ __Kmu = __sum;
+ __Knu1 = __sum1 * __xi2;
+ }
+ else
+ {
+ _Tp __b = _Tp(2) * (_Tp(1) + __x);
+ _Tp __d = _Tp(1) / __b;
+ _Tp __delh = __d;
+ _Tp __h = __delh;
+ _Tp __q1 = _Tp(0);
+ _Tp __q2 = _Tp(1);
+ _Tp __a1 = _Tp(0.25L) - __mu2;
+ _Tp __q = __c = __a1;
+ _Tp __a = -__a1;
+ _Tp __s = _Tp(1) + __q * __delh;
+ int __i;
+ for (__i = 2; __i <= __max_iter; ++__i)
+ {
+ __a -= 2 * (__i - 1);
+ __c = -__a * __c / __i;
+ const _Tp __qnew = (__q1 - __b * __q2) / __a;
+ __q1 = __q2;
+ __q2 = __qnew;
+ __q += __c * __qnew;
+ __b += _Tp(2);
+ __d = _Tp(1) / (__b + __a * __d);
+ __delh = (__b * __d - _Tp(1)) * __delh;
+ __h += __delh;
+ const _Tp __dels = __q * __delh;
+ __s += __dels;
+ if ( std::abs(__dels / __s) < __eps )
+ break;
+ }
+ if (__i > __max_iter)
+ std::__throw_runtime_error(__N("Steed's method failed "
+ "in __bessel_jn."));
+ __h = __a1 * __h;
+ __Kmu = std::sqrt(__numeric_constants<_Tp>::__pi() / (_Tp(2) * __x))
+ * std::exp(-__x) / __s;
+ __Knu1 = __Kmu * (__mu + __x + _Tp(0.5L) - __h) * __xi;
+ }
+
+ _Tp __Kpmu = __mu * __xi * __Kmu - __Knu1;
+ _Tp __Inumu = __xi / (__f * __Kmu - __Kpmu);
+ __Inu = __Inumu * __Inul1 / __Inul;
+ __Ipnu = __Inumu * __Ipnu1 / __Inul;
+ for ( __i = 1; __i <= __nl; ++__i )
+ {
+ const _Tp __Knutemp = (__mu + __i) * __xi2 * __Knu1 + __Kmu;
+ __Kmu = __Knu1;
+ __Knu1 = __Knutemp;
+ }
+ __Knu = __Kmu;
+ __Kpnu = __nu * __xi * __Kmu - __Knu1;
+
+ return;
+ }
+
+
+ /**
+ * @brief Return the regular modified Bessel function of order
+ * \f$ \nu \f$: \f$ I_{\nu}(x) \f$.
+ *
+ * The regular modified cylindrical Bessel function is:
+ * @f[
+ * I_{\nu}(x) = \sum_{k=0}^{\infty}
+ * \frac{(x/2)^{\nu + 2k}}{k!\Gamma(\nu+k+1)}
+ * @f]
+ *
+ * @param __nu The order of the regular modified Bessel function.
+ * @param __x The argument of the regular modified Bessel function.
+ * @return The output regular modified Bessel function.
+ */
+ template<typename _Tp>
+ _Tp
+ __cyl_bessel_i(const _Tp __nu, const _Tp __x)
+ {
+ if (__nu < _Tp(0) || __x < _Tp(0))
+ std::__throw_domain_error(__N("Bad argument "
+ "in __cyl_bessel_i."));
+ else if (__isnan(__nu) || __isnan(__x))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (__x * __x < _Tp(10) * (__nu + _Tp(1)))
+ return __cyl_bessel_ij_series(__nu, __x, +_Tp(1), 200);
+ else
+ {
+ _Tp __I_nu, __K_nu, __Ip_nu, __Kp_nu;
+ __bessel_ik(__nu, __x, __I_nu, __K_nu, __Ip_nu, __Kp_nu);
+ return __I_nu;
+ }
+ }
+
+
+ /**
+ * @brief Return the irregular modified Bessel function
+ * \f$ K_{\nu}(x) \f$ of order \f$ \nu \f$.
+ *
+ * The irregular modified Bessel function is defined by:
+ * @f[
+ * K_{\nu}(x) = \frac{\pi}{2}
+ * \frac{I_{-\nu}(x) - I_{\nu}(x)}{\sin \nu\pi}
+ * @f]
+ * where for integral \f$ \nu = n \f$ a limit is taken:
+ * \f$ lim_{\nu \to n} \f$.
+ *
+ * @param __nu The order of the irregular modified Bessel function.
+ * @param __x The argument of the irregular modified Bessel function.
+ * @return The output irregular modified Bessel function.
+ */
+ template<typename _Tp>
+ _Tp
+ __cyl_bessel_k(const _Tp __nu, const _Tp __x)
+ {
+ if (__nu < _Tp(0) || __x < _Tp(0))
+ std::__throw_domain_error(__N("Bad argument "
+ "in __cyl_bessel_k."));
+ else if (__isnan(__nu) || __isnan(__x))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else
+ {
+ _Tp __I_nu, __K_nu, __Ip_nu, __Kp_nu;
+ __bessel_ik(__nu, __x, __I_nu, __K_nu, __Ip_nu, __Kp_nu);
+ return __K_nu;
+ }
+ }
+
+
+ /**
+ * @brief Compute the spherical modified Bessel functions
+ * @f$ i_n(x) @f$ and @f$ k_n(x) @f$ and their first
+ * derivatives @f$ i'_n(x) @f$ and @f$ k'_n(x) @f$
+ * respectively.
+ *
+ * @param __n The order of the modified spherical Bessel function.
+ * @param __x The argument of the modified spherical Bessel function.
+ * @param __i_n The output regular modified spherical Bessel function.
+ * @param __k_n The output irregular modified spherical
+ * Bessel function.
+ * @param __ip_n The output derivative of the regular modified
+ * spherical Bessel function.
+ * @param __kp_n The output derivative of the irregular modified
+ * spherical Bessel function.
+ */
+ template <typename _Tp>
+ void
+ __sph_bessel_ik(const unsigned int __n, const _Tp __x,
+ _Tp & __i_n, _Tp & __k_n, _Tp & __ip_n, _Tp & __kp_n)
+ {
+ const _Tp __nu = _Tp(__n) + _Tp(0.5L);
+
+ _Tp __I_nu, __Ip_nu, __K_nu, __Kp_nu;
+ __bessel_ik(__nu, __x, __I_nu, __K_nu, __Ip_nu, __Kp_nu);
+
+ const _Tp __factor = __numeric_constants<_Tp>::__sqrtpio2()
+ / std::sqrt(__x);
+
+ __i_n = __factor * __I_nu;
+ __k_n = __factor * __K_nu;
+ __ip_n = __factor * __Ip_nu - __i_n / (_Tp(2) * __x);
+ __kp_n = __factor * __Kp_nu - __k_n / (_Tp(2) * __x);
+
+ return;
+ }
+
+
+ /**
+ * @brief Compute the Airy functions
+ * @f$ Ai(x) @f$ and @f$ Bi(x) @f$ and their first
+ * derivatives @f$ Ai'(x) @f$ and @f$ Bi(x) @f$
+ * respectively.
+ *
+ * @param __n The order of the Airy functions.
+ * @param __x The argument of the Airy functions.
+ * @param __i_n The output Airy function.
+ * @param __k_n The output Airy function.
+ * @param __ip_n The output derivative of the Airy function.
+ * @param __kp_n The output derivative of the Airy function.
+ */
+ template <typename _Tp>
+ void
+ __airy(const _Tp __x,
+ _Tp & __Ai, _Tp & __Bi, _Tp & __Aip, _Tp & __Bip)
+ {
+ const _Tp __absx = std::abs(__x);
+ const _Tp __rootx = std::sqrt(__absx);
+ const _Tp __z = _Tp(2) * __absx * __rootx / _Tp(3);
+
+ if (__isnan(__x))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (__x > _Tp(0))
+ {
+ _Tp __I_nu, __Ip_nu, __K_nu, __Kp_nu;
+
+ __bessel_ik(_Tp(1) / _Tp(3), __z, __I_nu, __K_nu, __Ip_nu, __Kp_nu);
+ __Ai = __rootx * __K_nu
+ / (__numeric_constants<_Tp>::__sqrt3()
+ * __numeric_constants<_Tp>::__pi());
+ __Bi = __rootx * (__K_nu / __numeric_constants<_Tp>::__pi()
+ + _Tp(2) * __I_nu / __numeric_constants<_Tp>::__sqrt3());
+
+ __bessel_ik(_Tp(2) / _Tp(3), __z, __I_nu, __K_nu, __Ip_nu, __Kp_nu);
+ __Aip = -__x * __K_nu
+ / (__numeric_constants<_Tp>::__sqrt3()
+ * __numeric_constants<_Tp>::__pi());
+ __Bip = __x * (__K_nu / __numeric_constants<_Tp>::__pi()
+ + _Tp(2) * __I_nu
+ / __numeric_constants<_Tp>::__sqrt3());
+ }
+ else if (__x < _Tp(0))
+ {
+ _Tp __J_nu, __Jp_nu, __N_nu, __Np_nu;
+
+ __bessel_jn(_Tp(1) / _Tp(3), __z, __J_nu, __N_nu, __Jp_nu, __Np_nu);
+ __Ai = __rootx * (__J_nu
+ - __N_nu / __numeric_constants<_Tp>::__sqrt3()) / _Tp(2);
+ __Bi = -__rootx * (__N_nu
+ + __J_nu / __numeric_constants<_Tp>::__sqrt3()) / _Tp(2);
+
+ __bessel_jn(_Tp(2) / _Tp(3), __z, __J_nu, __N_nu, __Jp_nu, __Np_nu);
+ __Aip = __absx * (__N_nu / __numeric_constants<_Tp>::__sqrt3()
+ + __J_nu) / _Tp(2);
+ __Bip = __absx * (__J_nu / __numeric_constants<_Tp>::__sqrt3()
+ - __N_nu) / _Tp(2);
+ }
+ else
+ {
+ // Reference:
+ // Abramowitz & Stegun, page 446 section 10.4.4 on Airy functions.
+ // The number is Ai(0) = 3^{-2/3}/\Gamma(2/3).
+ __Ai = _Tp(0.35502805388781723926L);
+ __Bi = __Ai * __numeric_constants<_Tp>::__sqrt3();
+
+ // Reference:
+ // Abramowitz & Stegun, page 446 section 10.4.5 on Airy functions.
+ // The number is Ai'(0) = -3^{-1/3}/\Gamma(1/3).
+ __Aip = -_Tp(0.25881940379280679840L);
+ __Bip = -__Aip * __numeric_constants<_Tp>::__sqrt3();
+ }
+
+ return;
+ }
+
+ } // namespace std::tr1::__detail
+}
+}
+
+#endif // _GLIBCXX_TR1_MODIFIED_BESSEL_FUNC_TCC
diff --git a/i686-linux/include/c++/4.4.3/tr1/poly_hermite.tcc b/i686-linux/include/c++/4.4.3/tr1/poly_hermite.tcc
new file mode 100644
index 0000000..d4825a3
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/poly_hermite.tcc
@@ -0,0 +1,124 @@
+// Special functions -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/poly_hermite.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882 TR1: 5.2 Special functions
+//
+
+// Written by Edward Smith-Rowland based on:
+// (1) Handbook of Mathematical Functions,
+// Ed. Milton Abramowitz and Irene A. Stegun,
+// Dover Publications, Section 22 pp. 773-802
+
+#ifndef _GLIBCXX_TR1_POLY_HERMITE_TCC
+#define _GLIBCXX_TR1_POLY_HERMITE_TCC 1
+
+namespace std
+{
+namespace tr1
+{
+
+ // [5.2] Special functions
+
+ // Implementation-space details.
+ namespace __detail
+ {
+
+ /**
+ * @brief This routine returns the Hermite polynomial
+ * of order n: \f$ H_n(x) \f$ by recursion on n.
+ *
+ * The Hermite polynomial is defined by:
+ * @f[
+ * H_n(x) = (-1)^n e^{x^2} \frac{d^n}{dx^n} e^{-x^2}
+ * @f]
+ *
+ * @param __n The order of the Hermite polynomial.
+ * @param __x The argument of the Hermite polynomial.
+ * @return The value of the Hermite polynomial of order n
+ * and argument x.
+ */
+ template<typename _Tp>
+ _Tp
+ __poly_hermite_recursion(const unsigned int __n, const _Tp __x)
+ {
+ // Compute H_0.
+ _Tp __H_0 = 1;
+ if (__n == 0)
+ return __H_0;
+
+ // Compute H_1.
+ _Tp __H_1 = 2 * __x;
+ if (__n == 1)
+ return __H_1;
+
+ // Compute H_n.
+ _Tp __H_n, __H_nm1, __H_nm2;
+ unsigned int __i;
+ for (__H_nm2 = __H_0, __H_nm1 = __H_1, __i = 2; __i <= __n; ++__i)
+ {
+ __H_n = 2 * (__x * __H_nm1 + (__i - 1) * __H_nm2);
+ __H_nm2 = __H_nm1;
+ __H_nm1 = __H_n;
+ }
+
+ return __H_n;
+ }
+
+
+ /**
+ * @brief This routine returns the Hermite polynomial
+ * of order n: \f$ H_n(x) \f$.
+ *
+ * The Hermite polynomial is defined by:
+ * @f[
+ * H_n(x) = (-1)^n e^{x^2} \frac{d^n}{dx^n} e^{-x^2}
+ * @f]
+ *
+ * @param __n The order of the Hermite polynomial.
+ * @param __x The argument of the Hermite polynomial.
+ * @return The value of the Hermite polynomial of order n
+ * and argument x.
+ */
+ template<typename _Tp>
+ inline _Tp
+ __poly_hermite(const unsigned int __n, const _Tp __x)
+ {
+ if (__isnan(__x))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else
+ return __poly_hermite_recursion(__n, __x);
+ }
+
+ } // namespace std::tr1::__detail
+}
+}
+
+#endif // _GLIBCXX_TR1_POLY_HERMITE_TCC
diff --git a/i686-linux/include/c++/4.4.3/tr1/poly_laguerre.tcc b/i686-linux/include/c++/4.4.3/tr1/poly_laguerre.tcc
new file mode 100644
index 0000000..9c999db
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/poly_laguerre.tcc
@@ -0,0 +1,329 @@
+// Special functions -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/poly_laguerre.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882 TR1: 5.2 Special functions
+//
+
+// Written by Edward Smith-Rowland based on:
+// (1) Handbook of Mathematical Functions,
+// Ed. Milton Abramowitz and Irene A. Stegun,
+// Dover Publications,
+// Section 13, pp. 509-510, Section 22 pp. 773-802
+// (2) The Gnu Scientific Library, http://www.gnu.org/software/gsl
+
+#ifndef _GLIBCXX_TR1_POLY_LAGUERRE_TCC
+#define _GLIBCXX_TR1_POLY_LAGUERRE_TCC 1
+
+namespace std
+{
+namespace tr1
+{
+
+ // [5.2] Special functions
+
+ // Implementation-space details.
+ namespace __detail
+ {
+
+
+ /**
+ * @brief This routine returns the associated Laguerre polynomial
+ * of order @f$ n @f$, degree @f$ \alpha @f$ for large n.
+ * Abramowitz & Stegun, 13.5.21
+ *
+ * @param __n The order of the Laguerre function.
+ * @param __alpha The degree of the Laguerre function.
+ * @param __x The argument of the Laguerre function.
+ * @return The value of the Laguerre function of order n,
+ * degree @f$ \alpha @f$, and argument x.
+ *
+ * This is from the GNU Scientific Library.
+ */
+ template<typename _Tpa, typename _Tp>
+ _Tp
+ __poly_laguerre_large_n(const unsigned __n, const _Tpa __alpha1,
+ const _Tp __x)
+ {
+ const _Tp __a = -_Tp(__n);
+ const _Tp __b = _Tp(__alpha1) + _Tp(1);
+ const _Tp __eta = _Tp(2) * __b - _Tp(4) * __a;
+ const _Tp __cos2th = __x / __eta;
+ const _Tp __sin2th = _Tp(1) - __cos2th;
+ const _Tp __th = std::acos(std::sqrt(__cos2th));
+ const _Tp __pre_h = __numeric_constants<_Tp>::__pi_2()
+ * __numeric_constants<_Tp>::__pi_2()
+ * __eta * __eta * __cos2th * __sin2th;
+
+#if _GLIBCXX_USE_C99_MATH_TR1
+ const _Tp __lg_b = std::tr1::lgamma(_Tp(__n) + __b);
+ const _Tp __lnfact = std::tr1::lgamma(_Tp(__n + 1));
+#else
+ const _Tp __lg_b = __log_gamma(_Tp(__n) + __b);
+ const _Tp __lnfact = __log_gamma(_Tp(__n + 1));
+#endif
+
+ _Tp __pre_term1 = _Tp(0.5L) * (_Tp(1) - __b)
+ * std::log(_Tp(0.25L) * __x * __eta);
+ _Tp __pre_term2 = _Tp(0.25L) * std::log(__pre_h);
+ _Tp __lnpre = __lg_b - __lnfact + _Tp(0.5L) * __x
+ + __pre_term1 - __pre_term2;
+ _Tp __ser_term1 = std::sin(__a * __numeric_constants<_Tp>::__pi());
+ _Tp __ser_term2 = std::sin(_Tp(0.25L) * __eta
+ * (_Tp(2) * __th
+ - std::sin(_Tp(2) * __th))
+ + __numeric_constants<_Tp>::__pi_4());
+ _Tp __ser = __ser_term1 + __ser_term2;
+
+ return std::exp(__lnpre) * __ser;
+ }
+
+
+ /**
+ * @brief Evaluate the polynomial based on the confluent hypergeometric
+ * function in a safe way, with no restriction on the arguments.
+ *
+ * The associated Laguerre function is defined by
+ * @f[
+ * L_n^\alpha(x) = \frac{(\alpha + 1)_n}{n!}
+ * _1F_1(-n; \alpha + 1; x)
+ * @f]
+ * where @f$ (\alpha)_n @f$ is the Pochhammer symbol and
+ * @f$ _1F_1(a; c; x) @f$ is the confluent hypergeometric function.
+ *
+ * This function assumes x != 0.
+ *
+ * This is from the GNU Scientific Library.
+ */
+ template<typename _Tpa, typename _Tp>
+ _Tp
+ __poly_laguerre_hyperg(const unsigned int __n, const _Tpa __alpha1,
+ const _Tp __x)
+ {
+ const _Tp __b = _Tp(__alpha1) + _Tp(1);
+ const _Tp __mx = -__x;
+ const _Tp __tc_sgn = (__x < _Tp(0) ? _Tp(1)
+ : ((__n % 2 == 1) ? -_Tp(1) : _Tp(1)));
+ // Get |x|^n/n!
+ _Tp __tc = _Tp(1);
+ const _Tp __ax = std::abs(__x);
+ for (unsigned int __k = 1; __k <= __n; ++__k)
+ __tc *= (__ax / __k);
+
+ _Tp __term = __tc * __tc_sgn;
+ _Tp __sum = __term;
+ for (int __k = int(__n) - 1; __k >= 0; --__k)
+ {
+ __term *= ((__b + _Tp(__k)) / _Tp(int(__n) - __k))
+ * _Tp(__k + 1) / __mx;
+ __sum += __term;
+ }
+
+ return __sum;
+ }
+
+
+ /**
+ * @brief This routine returns the associated Laguerre polynomial
+ * of order @f$ n @f$, degree @f$ \alpha @f$: @f$ L_n^\alpha(x) @f$
+ * by recursion.
+ *
+ * The associated Laguerre function is defined by
+ * @f[
+ * L_n^\alpha(x) = \frac{(\alpha + 1)_n}{n!}
+ * _1F_1(-n; \alpha + 1; x)
+ * @f]
+ * where @f$ (\alpha)_n @f$ is the Pochhammer symbol and
+ * @f$ _1F_1(a; c; x) @f$ is the confluent hypergeometric function.
+ *
+ * The associated Laguerre polynomial is defined for integral
+ * @f$ \alpha = m @f$ by:
+ * @f[
+ * L_n^m(x) = (-1)^m \frac{d^m}{dx^m} L_{n + m}(x)
+ * @f]
+ * where the Laguerre polynomial is defined by:
+ * @f[
+ * L_n(x) = \frac{e^x}{n!} \frac{d^n}{dx^n} (x^ne^{-x})
+ * @f]
+ *
+ * @param __n The order of the Laguerre function.
+ * @param __alpha The degree of the Laguerre function.
+ * @param __x The argument of the Laguerre function.
+ * @return The value of the Laguerre function of order n,
+ * degree @f$ \alpha @f$, and argument x.
+ */
+ template<typename _Tpa, typename _Tp>
+ _Tp
+ __poly_laguerre_recursion(const unsigned int __n,
+ const _Tpa __alpha1, const _Tp __x)
+ {
+ // Compute l_0.
+ _Tp __l_0 = _Tp(1);
+ if (__n == 0)
+ return __l_0;
+
+ // Compute l_1^alpha.
+ _Tp __l_1 = -__x + _Tp(1) + _Tp(__alpha1);
+ if (__n == 1)
+ return __l_1;
+
+ // Compute l_n^alpha by recursion on n.
+ _Tp __l_n2 = __l_0;
+ _Tp __l_n1 = __l_1;
+ _Tp __l_n = _Tp(0);
+ for (unsigned int __nn = 2; __nn <= __n; ++__nn)
+ {
+ __l_n = (_Tp(2 * __nn - 1) + _Tp(__alpha1) - __x)
+ * __l_n1 / _Tp(__nn)
+ - (_Tp(__nn - 1) + _Tp(__alpha1)) * __l_n2 / _Tp(__nn);
+ __l_n2 = __l_n1;
+ __l_n1 = __l_n;
+ }
+
+ return __l_n;
+ }
+
+
+ /**
+ * @brief This routine returns the associated Laguerre polynomial
+ * of order n, degree @f$ \alpha @f$: @f$ L_n^alpha(x) @f$.
+ *
+ * The associated Laguerre function is defined by
+ * @f[
+ * L_n^\alpha(x) = \frac{(\alpha + 1)_n}{n!}
+ * _1F_1(-n; \alpha + 1; x)
+ * @f]
+ * where @f$ (\alpha)_n @f$ is the Pochhammer symbol and
+ * @f$ _1F_1(a; c; x) @f$ is the confluent hypergeometric function.
+ *
+ * The associated Laguerre polynomial is defined for integral
+ * @f$ \alpha = m @f$ by:
+ * @f[
+ * L_n^m(x) = (-1)^m \frac{d^m}{dx^m} L_{n + m}(x)
+ * @f]
+ * where the Laguerre polynomial is defined by:
+ * @f[
+ * L_n(x) = \frac{e^x}{n!} \frac{d^n}{dx^n} (x^ne^{-x})
+ * @f]
+ *
+ * @param __n The order of the Laguerre function.
+ * @param __alpha The degree of the Laguerre function.
+ * @param __x The argument of the Laguerre function.
+ * @return The value of the Laguerre function of order n,
+ * degree @f$ \alpha @f$, and argument x.
+ */
+ template<typename _Tpa, typename _Tp>
+ inline _Tp
+ __poly_laguerre(const unsigned int __n, const _Tpa __alpha1,
+ const _Tp __x)
+ {
+ if (__x < _Tp(0))
+ std::__throw_domain_error(__N("Negative argument "
+ "in __poly_laguerre."));
+ // Return NaN on NaN input.
+ else if (__isnan(__x))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (__n == 0)
+ return _Tp(1);
+ else if (__n == 1)
+ return _Tp(1) + _Tp(__alpha1) - __x;
+ else if (__x == _Tp(0))
+ {
+ _Tp __prod = _Tp(__alpha1) + _Tp(1);
+ for (unsigned int __k = 2; __k <= __n; ++__k)
+ __prod *= (_Tp(__alpha1) + _Tp(__k)) / _Tp(__k);
+ return __prod;
+ }
+ else if (__n > 10000000 && _Tp(__alpha1) > -_Tp(1)
+ && __x < _Tp(2) * (_Tp(__alpha1) + _Tp(1)) + _Tp(4 * __n))
+ return __poly_laguerre_large_n(__n, __alpha1, __x);
+ else if (_Tp(__alpha1) >= _Tp(0)
+ || (__x > _Tp(0) && _Tp(__alpha1) < -_Tp(__n + 1)))
+ return __poly_laguerre_recursion(__n, __alpha1, __x);
+ else
+ return __poly_laguerre_hyperg(__n, __alpha1, __x);
+ }
+
+
+ /**
+ * @brief This routine returns the associated Laguerre polynomial
+ * of order n, degree m: @f$ L_n^m(x) @f$.
+ *
+ * The associated Laguerre polynomial is defined for integral
+ * @f$ \alpha = m @f$ by:
+ * @f[
+ * L_n^m(x) = (-1)^m \frac{d^m}{dx^m} L_{n + m}(x)
+ * @f]
+ * where the Laguerre polynomial is defined by:
+ * @f[
+ * L_n(x) = \frac{e^x}{n!} \frac{d^n}{dx^n} (x^ne^{-x})
+ * @f]
+ *
+ * @param __n The order of the Laguerre polynomial.
+ * @param __m The degree of the Laguerre polynomial.
+ * @param __x The argument of the Laguerre polynomial.
+ * @return The value of the associated Laguerre polynomial of order n,
+ * degree m, and argument x.
+ */
+ template<typename _Tp>
+ inline _Tp
+ __assoc_laguerre(const unsigned int __n, const unsigned int __m,
+ const _Tp __x)
+ {
+ return __poly_laguerre<unsigned int, _Tp>(__n, __m, __x);
+ }
+
+
+ /**
+ * @brief This routine returns the Laguerre polynomial
+ * of order n: @f$ L_n(x) @f$.
+ *
+ * The Laguerre polynomial is defined by:
+ * @f[
+ * L_n(x) = \frac{e^x}{n!} \frac{d^n}{dx^n} (x^ne^{-x})
+ * @f]
+ *
+ * @param __n The order of the Laguerre polynomial.
+ * @param __x The argument of the Laguerre polynomial.
+ * @return The value of the Laguerre polynomial of order n
+ * and argument x.
+ */
+ template<typename _Tp>
+ inline _Tp
+ __laguerre(const unsigned int __n, const _Tp __x)
+ {
+ return __poly_laguerre<unsigned int, _Tp>(__n, 0, __x);
+ }
+
+ } // namespace std::tr1::__detail
+}
+}
+
+#endif // _GLIBCXX_TR1_POLY_LAGUERRE_TCC
diff --git a/i686-linux/include/c++/4.4.3/tr1/random b/i686-linux/include/c++/4.4.3/tr1/random
new file mode 100644
index 0000000..a23519c
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/random
@@ -0,0 +1,66 @@
+// random number generation -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/**
+ * @file tr1/random
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_RANDOM
+#define _GLIBCXX_TR1_RANDOM 1
+
+#pragma GCC system_header
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+#include <cmath>
+#include <cstdio>
+#include <cstdlib>
+#include <string>
+#include <iosfwd>
+#include <limits>
+#include <ext/type_traits.h>
+#include <ext/numeric_traits.h>
+#include <bits/concept_check.h>
+#include <debug/debug.h>
+#include <tr1/type_traits>
+#include <tr1/cmath>
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/random>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/random>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+#endif // _GLIBCXX_TR1_RANDOM
diff --git a/i686-linux/include/c++/4.4.3/tr1/regex b/i686-linux/include/c++/4.4.3/tr1/regex
new file mode 100644
index 0000000..b7e2cdf
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/regex
@@ -0,0 +1,64 @@
+// class template regex -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/**
+ * @file tr1/regex
+ * @author Stephen M. Webb <stephen.webb@bregmasoft.ca>
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_REGEX
+#define _GLIBCXX_TR1_REGEX 1
+
+#pragma GCC system_header
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+#include <algorithm>
+#include <bitset>
+#include <iterator>
+#include <locale>
+#include <stdexcept>
+#include <string>
+#include <vector>
+#include <utility>
+#include <sstream>
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/regex>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/regex>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+#endif // _GLIBCXX_TR1_REGEX
diff --git a/i686-linux/include/c++/4.4.3/tr1/riemann_zeta.tcc b/i686-linux/include/c++/4.4.3/tr1/riemann_zeta.tcc
new file mode 100644
index 0000000..c646c2e
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/riemann_zeta.tcc
@@ -0,0 +1,435 @@
+// Special functions -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/riemann_zeta.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882 TR1: 5.2 Special functions
+//
+
+// Written by Edward Smith-Rowland based on:
+// (1) Handbook of Mathematical Functions,
+// Ed. by Milton Abramowitz and Irene A. Stegun,
+// Dover Publications, New-York, Section 5, pp. 807-808.
+// (2) The Gnu Scientific Library, http://www.gnu.org/software/gsl
+// (3) Gamma, Exploring Euler's Constant, Julian Havil,
+// Princeton, 2003.
+
+#ifndef _GLIBCXX_TR1_RIEMANN_ZETA_TCC
+#define _GLIBCXX_TR1_RIEMANN_ZETA_TCC 1
+
+#include "special_function_util.h"
+
+namespace std
+{
+namespace tr1
+{
+
+ // [5.2] Special functions
+
+ // Implementation-space details.
+ namespace __detail
+ {
+
+ /**
+ * @brief Compute the Riemann zeta function @f$ \zeta(s) @f$
+ * by summation for s > 1.
+ *
+ * The Riemann zeta function is defined by:
+ * \f[
+ * \zeta(s) = \sum_{k=1}^{\infty} \frac{1}{k^{s}} for s > 1
+ * \f]
+ * For s < 1 use the reflection formula:
+ * \f[
+ * \zeta(s) = 2^s \pi^{s-1} \Gamma(1-s) \zeta(1-s)
+ * \f]
+ */
+ template<typename _Tp>
+ _Tp
+ __riemann_zeta_sum(const _Tp __s)
+ {
+ // A user shouldn't get to this.
+ if (__s < _Tp(1))
+ std::__throw_domain_error(__N("Bad argument in zeta sum."));
+
+ const unsigned int max_iter = 10000;
+ _Tp __zeta = _Tp(0);
+ for (unsigned int __k = 1; __k < max_iter; ++__k)
+ {
+ _Tp __term = std::pow(static_cast<_Tp>(__k), -__s);
+ if (__term < std::numeric_limits<_Tp>::epsilon())
+ {
+ break;
+ }
+ __zeta += __term;
+ }
+
+ return __zeta;
+ }
+
+
+ /**
+ * @brief Evaluate the Riemann zeta function @f$ \zeta(s) @f$
+ * by an alternate series for s > 0.
+ *
+ * The Riemann zeta function is defined by:
+ * \f[
+ * \zeta(s) = \sum_{k=1}^{\infty} \frac{1}{k^{s}} for s > 1
+ * \f]
+ * For s < 1 use the reflection formula:
+ * \f[
+ * \zeta(s) = 2^s \pi^{s-1} \Gamma(1-s) \zeta(1-s)
+ * \f]
+ */
+ template<typename _Tp>
+ _Tp
+ __riemann_zeta_alt(const _Tp __s)
+ {
+ _Tp __sgn = _Tp(1);
+ _Tp __zeta = _Tp(0);
+ for (unsigned int __i = 1; __i < 10000000; ++__i)
+ {
+ _Tp __term = __sgn / std::pow(__i, __s);
+ if (std::abs(__term) < std::numeric_limits<_Tp>::epsilon())
+ break;
+ __zeta += __term;
+ __sgn *= _Tp(-1);
+ }
+ __zeta /= _Tp(1) - std::pow(_Tp(2), _Tp(1) - __s);
+
+ return __zeta;
+ }
+
+
+ /**
+ * @brief Evaluate the Riemann zeta function by series for all s != 1.
+ * Convergence is great until largish negative numbers.
+ * Then the convergence of the > 0 sum gets better.
+ *
+ * The series is:
+ * \f[
+ * \zeta(s) = \frac{1}{1-2^{1-s}}
+ * \sum_{n=0}^{\infty} \frac{1}{2^{n+1}}
+ * \sum_{k=0}^{n} (-1)^k \frac{n!}{(n-k)!k!} (k+1)^{-s}
+ * \f]
+ * Havil 2003, p. 206.
+ *
+ * The Riemann zeta function is defined by:
+ * \f[
+ * \zeta(s) = \sum_{k=1}^{\infty} \frac{1}{k^{s}} for s > 1
+ * \f]
+ * For s < 1 use the reflection formula:
+ * \f[
+ * \zeta(s) = 2^s \pi^{s-1} \Gamma(1-s) \zeta(1-s)
+ * \f]
+ */
+ template<typename _Tp>
+ _Tp
+ __riemann_zeta_glob(const _Tp __s)
+ {
+ _Tp __zeta = _Tp(0);
+
+ const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
+ // Max e exponent before overflow.
+ const _Tp __max_bincoeff = std::numeric_limits<_Tp>::max_exponent10
+ * std::log(_Tp(10)) - _Tp(1);
+
+ // This series works until the binomial coefficient blows up
+ // so use reflection.
+ if (__s < _Tp(0))
+ {
+#if _GLIBCXX_USE_C99_MATH_TR1
+ if (std::tr1::fmod(__s,_Tp(2)) == _Tp(0))
+ return _Tp(0);
+ else
+#endif
+ {
+ _Tp __zeta = __riemann_zeta_glob(_Tp(1) - __s);
+ __zeta *= std::pow(_Tp(2)
+ * __numeric_constants<_Tp>::__pi(), __s)
+ * std::sin(__numeric_constants<_Tp>::__pi_2() * __s)
+#if _GLIBCXX_USE_C99_MATH_TR1
+ * std::exp(std::tr1::lgamma(_Tp(1) - __s))
+#else
+ * std::exp(__log_gamma(_Tp(1) - __s))
+#endif
+ / __numeric_constants<_Tp>::__pi();
+ return __zeta;
+ }
+ }
+
+ _Tp __num = _Tp(0.5L);
+ const unsigned int __maxit = 10000;
+ for (unsigned int __i = 0; __i < __maxit; ++__i)
+ {
+ bool __punt = false;
+ _Tp __sgn = _Tp(1);
+ _Tp __term = _Tp(0);
+ for (unsigned int __j = 0; __j <= __i; ++__j)
+ {
+#if _GLIBCXX_USE_C99_MATH_TR1
+ _Tp __bincoeff = std::tr1::lgamma(_Tp(1 + __i))
+ - std::tr1::lgamma(_Tp(1 + __j))
+ - std::tr1::lgamma(_Tp(1 + __i - __j));
+#else
+ _Tp __bincoeff = __log_gamma(_Tp(1 + __i))
+ - __log_gamma(_Tp(1 + __j))
+ - __log_gamma(_Tp(1 + __i - __j));
+#endif
+ if (__bincoeff > __max_bincoeff)
+ {
+ // This only gets hit for x << 0.
+ __punt = true;
+ break;
+ }
+ __bincoeff = std::exp(__bincoeff);
+ __term += __sgn * __bincoeff * std::pow(_Tp(1 + __j), -__s);
+ __sgn *= _Tp(-1);
+ }
+ if (__punt)
+ break;
+ __term *= __num;
+ __zeta += __term;
+ if (std::abs(__term/__zeta) < __eps)
+ break;
+ __num *= _Tp(0.5L);
+ }
+
+ __zeta /= _Tp(1) - std::pow(_Tp(2), _Tp(1) - __s);
+
+ return __zeta;
+ }
+
+
+ /**
+ * @brief Compute the Riemann zeta function @f$ \zeta(s) @f$
+ * using the product over prime factors.
+ * \f[
+ * \zeta(s) = \Pi_{i=1}^\infty \frac{1}{1 - p_i^{-s}}
+ * \f]
+ * where @f$ {p_i} @f$ are the prime numbers.
+ *
+ * The Riemann zeta function is defined by:
+ * \f[
+ * \zeta(s) = \sum_{k=1}^{\infty} \frac{1}{k^{s}} for s > 1
+ * \f]
+ * For s < 1 use the reflection formula:
+ * \f[
+ * \zeta(s) = 2^s \pi^{s-1} \Gamma(1-s) \zeta(1-s)
+ * \f]
+ */
+ template<typename _Tp>
+ _Tp
+ __riemann_zeta_product(const _Tp __s)
+ {
+ static const _Tp __prime[] = {
+ _Tp(2), _Tp(3), _Tp(5), _Tp(7), _Tp(11), _Tp(13), _Tp(17), _Tp(19),
+ _Tp(23), _Tp(29), _Tp(31), _Tp(37), _Tp(41), _Tp(43), _Tp(47),
+ _Tp(53), _Tp(59), _Tp(61), _Tp(67), _Tp(71), _Tp(73), _Tp(79),
+ _Tp(83), _Tp(89), _Tp(97), _Tp(101), _Tp(103), _Tp(107), _Tp(109)
+ };
+ static const unsigned int __num_primes = sizeof(__prime) / sizeof(_Tp);
+
+ _Tp __zeta = _Tp(1);
+ for (unsigned int __i = 0; __i < __num_primes; ++__i)
+ {
+ const _Tp __fact = _Tp(1) - std::pow(__prime[__i], -__s);
+ __zeta *= __fact;
+ if (_Tp(1) - __fact < std::numeric_limits<_Tp>::epsilon())
+ break;
+ }
+
+ __zeta = _Tp(1) / __zeta;
+
+ return __zeta;
+ }
+
+
+ /**
+ * @brief Return the Riemann zeta function @f$ \zeta(s) @f$.
+ *
+ * The Riemann zeta function is defined by:
+ * \f[
+ * \zeta(s) = \sum_{k=1}^{\infty} k^{-s} for s > 1
+ * \frac{(2\pi)^s}{pi} sin(\frac{\pi s}{2})
+ * \Gamma (1 - s) \zeta (1 - s) for s < 1
+ * \f]
+ * For s < 1 use the reflection formula:
+ * \f[
+ * \zeta(s) = 2^s \pi^{s-1} \Gamma(1-s) \zeta(1-s)
+ * \f]
+ */
+ template<typename _Tp>
+ _Tp
+ __riemann_zeta(const _Tp __s)
+ {
+ if (__isnan(__s))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (__s == _Tp(1))
+ return std::numeric_limits<_Tp>::infinity();
+ else if (__s < -_Tp(19))
+ {
+ _Tp __zeta = __riemann_zeta_product(_Tp(1) - __s);
+ __zeta *= std::pow(_Tp(2) * __numeric_constants<_Tp>::__pi(), __s)
+ * std::sin(__numeric_constants<_Tp>::__pi_2() * __s)
+#if _GLIBCXX_USE_C99_MATH_TR1
+ * std::exp(std::tr1::lgamma(_Tp(1) - __s))
+#else
+ * std::exp(__log_gamma(_Tp(1) - __s))
+#endif
+ / __numeric_constants<_Tp>::__pi();
+ return __zeta;
+ }
+ else if (__s < _Tp(20))
+ {
+ // Global double sum or McLaurin?
+ bool __glob = true;
+ if (__glob)
+ return __riemann_zeta_glob(__s);
+ else
+ {
+ if (__s > _Tp(1))
+ return __riemann_zeta_sum(__s);
+ else
+ {
+ _Tp __zeta = std::pow(_Tp(2)
+ * __numeric_constants<_Tp>::__pi(), __s)
+ * std::sin(__numeric_constants<_Tp>::__pi_2() * __s)
+#if _GLIBCXX_USE_C99_MATH_TR1
+ * std::tr1::tgamma(_Tp(1) - __s)
+#else
+ * std::exp(__log_gamma(_Tp(1) - __s))
+#endif
+ * __riemann_zeta_sum(_Tp(1) - __s);
+ return __zeta;
+ }
+ }
+ }
+ else
+ return __riemann_zeta_product(__s);
+ }
+
+
+ /**
+ * @brief Return the Hurwitz zeta function @f$ \zeta(x,s) @f$
+ * for all s != 1 and x > -1.
+ *
+ * The Hurwitz zeta function is defined by:
+ * @f[
+ * \zeta(x,s) = \sum_{n=0}^{\infty} \frac{1}{(n + x)^s}
+ * @f]
+ * The Riemann zeta function is a special case:
+ * @f[
+ * \zeta(s) = \zeta(1,s)
+ * @f]
+ *
+ * This functions uses the double sum that converges for s != 1
+ * and x > -1:
+ * @f[
+ * \zeta(x,s) = \frac{1}{s-1}
+ * \sum_{n=0}^{\infty} \frac{1}{n + 1}
+ * \sum_{k=0}^{n} (-1)^k \frac{n!}{(n-k)!k!} (x+k)^{-s}
+ * @f]
+ */
+ template<typename _Tp>
+ _Tp
+ __hurwitz_zeta_glob(const _Tp __a, const _Tp __s)
+ {
+ _Tp __zeta = _Tp(0);
+
+ const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
+ // Max e exponent before overflow.
+ const _Tp __max_bincoeff = std::numeric_limits<_Tp>::max_exponent10
+ * std::log(_Tp(10)) - _Tp(1);
+
+ const unsigned int __maxit = 10000;
+ for (unsigned int __i = 0; __i < __maxit; ++__i)
+ {
+ bool __punt = false;
+ _Tp __sgn = _Tp(1);
+ _Tp __term = _Tp(0);
+ for (unsigned int __j = 0; __j <= __i; ++__j)
+ {
+#if _GLIBCXX_USE_C99_MATH_TR1
+ _Tp __bincoeff = std::tr1::lgamma(_Tp(1 + __i))
+ - std::tr1::lgamma(_Tp(1 + __j))
+ - std::tr1::lgamma(_Tp(1 + __i - __j));
+#else
+ _Tp __bincoeff = __log_gamma(_Tp(1 + __i))
+ - __log_gamma(_Tp(1 + __j))
+ - __log_gamma(_Tp(1 + __i - __j));
+#endif
+ if (__bincoeff > __max_bincoeff)
+ {
+ // This only gets hit for x << 0.
+ __punt = true;
+ break;
+ }
+ __bincoeff = std::exp(__bincoeff);
+ __term += __sgn * __bincoeff * std::pow(_Tp(__a + __j), -__s);
+ __sgn *= _Tp(-1);
+ }
+ if (__punt)
+ break;
+ __term /= _Tp(__i + 1);
+ if (std::abs(__term / __zeta) < __eps)
+ break;
+ __zeta += __term;
+ }
+
+ __zeta /= __s - _Tp(1);
+
+ return __zeta;
+ }
+
+
+ /**
+ * @brief Return the Hurwitz zeta function @f$ \zeta(x,s) @f$
+ * for all s != 1 and x > -1.
+ *
+ * The Hurwitz zeta function is defined by:
+ * @f[
+ * \zeta(x,s) = \sum_{n=0}^{\infty} \frac{1}{(n + x)^s}
+ * @f]
+ * The Riemann zeta function is a special case:
+ * @f[
+ * \zeta(s) = \zeta(1,s)
+ * @f]
+ */
+ template<typename _Tp>
+ inline _Tp
+ __hurwitz_zeta(const _Tp __a, const _Tp __s)
+ {
+ return __hurwitz_zeta_glob(__a, __s);
+ }
+
+ } // namespace std::tr1::__detail
+}
+}
+
+#endif // _GLIBCXX_TR1_RIEMANN_ZETA_TCC
diff --git a/i686-linux/include/c++/4.4.3/tr1/shared_ptr.h b/i686-linux/include/c++/4.4.3/tr1/shared_ptr.h
new file mode 100644
index 0000000..0afce01
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/shared_ptr.h
@@ -0,0 +1,1020 @@
+// <tr1/shared_ptr.h> -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// shared_count.hpp
+// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd.
+
+// shared_ptr.hpp
+// Copyright (C) 1998, 1999 Greg Colvin and Beman Dawes.
+// Copyright (C) 2001, 2002, 2003 Peter Dimov
+
+// weak_ptr.hpp
+// Copyright (C) 2001, 2002, 2003 Peter Dimov
+
+// enable_shared_from_this.hpp
+// Copyright (C) 2002 Peter Dimov
+
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// GCC Note: based on version 1.32.0 of the Boost library.
+
+/** @file tr1/shared_ptr.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _TR1_SHARED_PTR_H
+#define _TR1_SHARED_PTR_H 1
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+namespace std
+{
+namespace tr1
+{
+
+ template<typename _Ptr, typename _Deleter, _Lock_policy _Lp>
+ class _Sp_counted_base_impl
+ : public _Sp_counted_base<_Lp>
+ {
+ public:
+ /**
+ * @brief
+ * @pre __d(__p) must not throw.
+ */
+ _Sp_counted_base_impl(_Ptr __p, _Deleter __d)
+ : _M_ptr(__p), _M_del(__d) { }
+
+ virtual void
+ _M_dispose() // nothrow
+ { _M_del(_M_ptr); }
+
+ virtual void*
+ _M_get_deleter(const std::type_info& __ti)
+ { return __ti == typeid(_Deleter) ? &_M_del : 0; }
+
+ private:
+ _Sp_counted_base_impl(const _Sp_counted_base_impl&);
+ _Sp_counted_base_impl& operator=(const _Sp_counted_base_impl&);
+
+ _Ptr _M_ptr; // copy constructor must not throw
+ _Deleter _M_del; // copy constructor must not throw
+ };
+
+ template<_Lock_policy _Lp = __default_lock_policy>
+ class __weak_count;
+
+ template<typename _Tp>
+ struct _Sp_deleter
+ {
+ typedef void result_type;
+ typedef _Tp* argument_type;
+ void operator()(_Tp* __p) const { delete __p; }
+ };
+
+ template<_Lock_policy _Lp = __default_lock_policy>
+ class __shared_count
+ {
+ public:
+ __shared_count()
+ : _M_pi(0) // nothrow
+ { }
+
+ template<typename _Ptr>
+ __shared_count(_Ptr __p) : _M_pi(0)
+ {
+ __try
+ {
+ typedef typename std::tr1::remove_pointer<_Ptr>::type _Tp;
+ _M_pi = new _Sp_counted_base_impl<_Ptr, _Sp_deleter<_Tp>, _Lp>(
+ __p, _Sp_deleter<_Tp>());
+ }
+ __catch(...)
+ {
+ delete __p;
+ __throw_exception_again;
+ }
+ }
+
+ template<typename _Ptr, typename _Deleter>
+ __shared_count(_Ptr __p, _Deleter __d) : _M_pi(0)
+ {
+ __try
+ {
+ _M_pi = new _Sp_counted_base_impl<_Ptr, _Deleter, _Lp>(__p, __d);
+ }
+ __catch(...)
+ {
+ __d(__p); // Call _Deleter on __p.
+ __throw_exception_again;
+ }
+ }
+
+ // Special case for auto_ptr<_Tp> to provide the strong guarantee.
+ template<typename _Tp>
+ explicit
+ __shared_count(std::auto_ptr<_Tp>& __r)
+ : _M_pi(new _Sp_counted_base_impl<_Tp*,
+ _Sp_deleter<_Tp>, _Lp >(__r.get(), _Sp_deleter<_Tp>()))
+ { __r.release(); }
+
+ // Throw bad_weak_ptr when __r._M_get_use_count() == 0.
+ explicit
+ __shared_count(const __weak_count<_Lp>& __r);
+
+ ~__shared_count() // nothrow
+ {
+ if (_M_pi != 0)
+ _M_pi->_M_release();
+ }
+
+ __shared_count(const __shared_count& __r)
+ : _M_pi(__r._M_pi) // nothrow
+ {
+ if (_M_pi != 0)
+ _M_pi->_M_add_ref_copy();
+ }
+
+ __shared_count&
+ operator=(const __shared_count& __r) // nothrow
+ {
+ _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
+ if (__tmp != _M_pi)
+ {
+ if (__tmp != 0)
+ __tmp->_M_add_ref_copy();
+ if (_M_pi != 0)
+ _M_pi->_M_release();
+ _M_pi = __tmp;
+ }
+ return *this;
+ }
+
+ void
+ _M_swap(__shared_count& __r) // nothrow
+ {
+ _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
+ __r._M_pi = _M_pi;
+ _M_pi = __tmp;
+ }
+
+ long
+ _M_get_use_count() const // nothrow
+ { return _M_pi != 0 ? _M_pi->_M_get_use_count() : 0; }
+
+ bool
+ _M_unique() const // nothrow
+ { return this->_M_get_use_count() == 1; }
+
+ friend inline bool
+ operator==(const __shared_count& __a, const __shared_count& __b)
+ { return __a._M_pi == __b._M_pi; }
+
+ friend inline bool
+ operator<(const __shared_count& __a, const __shared_count& __b)
+ { return std::less<_Sp_counted_base<_Lp>*>()(__a._M_pi, __b._M_pi); }
+
+ void*
+ _M_get_deleter(const std::type_info& __ti) const
+ { return _M_pi ? _M_pi->_M_get_deleter(__ti) : 0; }
+
+ private:
+ friend class __weak_count<_Lp>;
+
+ _Sp_counted_base<_Lp>* _M_pi;
+ };
+
+
+ template<_Lock_policy _Lp>
+ class __weak_count
+ {
+ public:
+ __weak_count()
+ : _M_pi(0) // nothrow
+ { }
+
+ __weak_count(const __shared_count<_Lp>& __r)
+ : _M_pi(__r._M_pi) // nothrow
+ {
+ if (_M_pi != 0)
+ _M_pi->_M_weak_add_ref();
+ }
+
+ __weak_count(const __weak_count<_Lp>& __r)
+ : _M_pi(__r._M_pi) // nothrow
+ {
+ if (_M_pi != 0)
+ _M_pi->_M_weak_add_ref();
+ }
+
+ ~__weak_count() // nothrow
+ {
+ if (_M_pi != 0)
+ _M_pi->_M_weak_release();
+ }
+
+ __weak_count<_Lp>&
+ operator=(const __shared_count<_Lp>& __r) // nothrow
+ {
+ _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
+ if (__tmp != 0)
+ __tmp->_M_weak_add_ref();
+ if (_M_pi != 0)
+ _M_pi->_M_weak_release();
+ _M_pi = __tmp;
+ return *this;
+ }
+
+ __weak_count<_Lp>&
+ operator=(const __weak_count<_Lp>& __r) // nothrow
+ {
+ _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
+ if (__tmp != 0)
+ __tmp->_M_weak_add_ref();
+ if (_M_pi != 0)
+ _M_pi->_M_weak_release();
+ _M_pi = __tmp;
+ return *this;
+ }
+
+ void
+ _M_swap(__weak_count<_Lp>& __r) // nothrow
+ {
+ _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
+ __r._M_pi = _M_pi;
+ _M_pi = __tmp;
+ }
+
+ long
+ _M_get_use_count() const // nothrow
+ { return _M_pi != 0 ? _M_pi->_M_get_use_count() : 0; }
+
+ friend inline bool
+ operator==(const __weak_count<_Lp>& __a, const __weak_count<_Lp>& __b)
+ { return __a._M_pi == __b._M_pi; }
+
+ friend inline bool
+ operator<(const __weak_count<_Lp>& __a, const __weak_count<_Lp>& __b)
+ { return std::less<_Sp_counted_base<_Lp>*>()(__a._M_pi, __b._M_pi); }
+
+ private:
+ friend class __shared_count<_Lp>;
+
+ _Sp_counted_base<_Lp>* _M_pi;
+ };
+
+ // now that __weak_count is defined we can define this constructor:
+ template<_Lock_policy _Lp>
+ inline
+ __shared_count<_Lp>::
+ __shared_count(const __weak_count<_Lp>& __r)
+ : _M_pi(__r._M_pi)
+ {
+ if (_M_pi != 0)
+ _M_pi->_M_add_ref_lock();
+ else
+ __throw_bad_weak_ptr();
+ }
+
+ // Forward declarations.
+ template<typename _Tp, _Lock_policy _Lp = __default_lock_policy>
+ class __shared_ptr;
+
+ template<typename _Tp, _Lock_policy _Lp = __default_lock_policy>
+ class __weak_ptr;
+
+ template<typename _Tp, _Lock_policy _Lp = __default_lock_policy>
+ class __enable_shared_from_this;
+
+ template<typename _Tp>
+ class shared_ptr;
+
+ template<typename _Tp>
+ class weak_ptr;
+
+ template<typename _Tp>
+ class enable_shared_from_this;
+
+ // Support for enable_shared_from_this.
+
+ // Friend of __enable_shared_from_this.
+ template<_Lock_policy _Lp, typename _Tp1, typename _Tp2>
+ void
+ __enable_shared_from_this_helper(const __shared_count<_Lp>&,
+ const __enable_shared_from_this<_Tp1,
+ _Lp>*, const _Tp2*);
+
+ // Friend of enable_shared_from_this.
+ template<typename _Tp1, typename _Tp2>
+ void
+ __enable_shared_from_this_helper(const __shared_count<>&,
+ const enable_shared_from_this<_Tp1>*,
+ const _Tp2*);
+
+ template<_Lock_policy _Lp>
+ inline void
+ __enable_shared_from_this_helper(const __shared_count<_Lp>&, ...)
+ { }
+
+
+ struct __static_cast_tag { };
+ struct __const_cast_tag { };
+ struct __dynamic_cast_tag { };
+
+ /**
+ * @class __shared_ptr
+ *
+ * A smart pointer with reference-counted copy semantics.
+ * The object pointed to is deleted when the last shared_ptr pointing to
+ * it is destroyed or reset.
+ */
+ template<typename _Tp, _Lock_policy _Lp>
+ class __shared_ptr
+ {
+ public:
+ typedef _Tp element_type;
+
+ /** @brief Construct an empty %__shared_ptr.
+ * @post use_count()==0 && get()==0
+ */
+ __shared_ptr()
+ : _M_ptr(0), _M_refcount() // never throws
+ { }
+
+ /** @brief Construct a %__shared_ptr that owns the pointer @a __p.
+ * @param __p A pointer that is convertible to element_type*.
+ * @post use_count() == 1 && get() == __p
+ * @throw std::bad_alloc, in which case @c delete @a __p is called.
+ */
+ template<typename _Tp1>
+ explicit
+ __shared_ptr(_Tp1* __p)
+ : _M_ptr(__p), _M_refcount(__p)
+ {
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
+ // __glibcxx_function_requires(_CompleteConcept<_Tp1*>)
+ __enable_shared_from_this_helper(_M_refcount, __p, __p);
+ }
+
+ //
+ // Requirements: _Deleter's copy constructor and destructor must
+ // not throw
+ //
+ // __shared_ptr will release __p by calling __d(__p)
+ //
+ /** @brief Construct a %__shared_ptr that owns the pointer @a __p
+ * and the deleter @a __d.
+ * @param __p A pointer.
+ * @param __d A deleter.
+ * @post use_count() == 1 && get() == __p
+ * @throw std::bad_alloc, in which case @a __d(__p) is called.
+ */
+ template<typename _Tp1, typename _Deleter>
+ __shared_ptr(_Tp1* __p, _Deleter __d)
+ : _M_ptr(__p), _M_refcount(__p, __d)
+ {
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
+ // TODO requires _Deleter CopyConstructible and __d(__p) well-formed
+ __enable_shared_from_this_helper(_M_refcount, __p, __p);
+ }
+
+ // generated copy constructor, assignment, destructor are fine.
+
+ /** @brief If @a __r is empty, constructs an empty %__shared_ptr;
+ * otherwise construct a %__shared_ptr that shares ownership
+ * with @a __r.
+ * @param __r A %__shared_ptr.
+ * @post get() == __r.get() && use_count() == __r.use_count()
+ */
+ template<typename _Tp1>
+ __shared_ptr(const __shared_ptr<_Tp1, _Lp>& __r)
+ : _M_ptr(__r._M_ptr), _M_refcount(__r._M_refcount) // never throws
+ { __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>) }
+
+ /** @brief Constructs a %__shared_ptr that shares ownership with @a __r
+ * and stores a copy of the pointer stored in @a __r.
+ * @param __r A weak_ptr.
+ * @post use_count() == __r.use_count()
+ * @throw bad_weak_ptr when __r.expired(),
+ * in which case the constructor has no effect.
+ */
+ template<typename _Tp1>
+ explicit
+ __shared_ptr(const __weak_ptr<_Tp1, _Lp>& __r)
+ : _M_refcount(__r._M_refcount) // may throw
+ {
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
+ // It is now safe to copy __r._M_ptr, as _M_refcount(__r._M_refcount)
+ // did not throw.
+ _M_ptr = __r._M_ptr;
+ }
+
+#if !defined(__GXX_EXPERIMENTAL_CXX0X__) || _GLIBCXX_DEPRECATED
+ /**
+ * @post use_count() == 1 and __r.get() == 0
+ */
+ template<typename _Tp1>
+ explicit
+ __shared_ptr(std::auto_ptr<_Tp1>& __r)
+ : _M_ptr(__r.get()), _M_refcount()
+ {
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
+ // TODO requires _Tp1 is complete, delete __r.release() well-formed
+ _Tp1* __tmp = __r.get();
+ _M_refcount = __shared_count<_Lp>(__r);
+ __enable_shared_from_this_helper(_M_refcount, __tmp, __tmp);
+ }
+
+#endif
+
+ template<typename _Tp1>
+ __shared_ptr(const __shared_ptr<_Tp1, _Lp>& __r, __static_cast_tag)
+ : _M_ptr(static_cast<element_type*>(__r._M_ptr)),
+ _M_refcount(__r._M_refcount)
+ { }
+
+ template<typename _Tp1>
+ __shared_ptr(const __shared_ptr<_Tp1, _Lp>& __r, __const_cast_tag)
+ : _M_ptr(const_cast<element_type*>(__r._M_ptr)),
+ _M_refcount(__r._M_refcount)
+ { }
+
+ template<typename _Tp1>
+ __shared_ptr(const __shared_ptr<_Tp1, _Lp>& __r, __dynamic_cast_tag)
+ : _M_ptr(dynamic_cast<element_type*>(__r._M_ptr)),
+ _M_refcount(__r._M_refcount)
+ {
+ if (_M_ptr == 0) // need to allocate new counter -- the cast failed
+ _M_refcount = __shared_count<_Lp>();
+ }
+
+ template<typename _Tp1>
+ __shared_ptr&
+ operator=(const __shared_ptr<_Tp1, _Lp>& __r) // never throws
+ {
+ _M_ptr = __r._M_ptr;
+ _M_refcount = __r._M_refcount; // __shared_count::op= doesn't throw
+ return *this;
+ }
+
+#if !defined(__GXX_EXPERIMENTAL_CXX0X__) || _GLIBCXX_DEPRECATED
+ template<typename _Tp1>
+ __shared_ptr&
+ operator=(std::auto_ptr<_Tp1>& __r)
+ {
+ __shared_ptr(__r).swap(*this);
+ return *this;
+ }
+#endif
+
+ void
+ reset() // never throws
+ { __shared_ptr().swap(*this); }
+
+ template<typename _Tp1>
+ void
+ reset(_Tp1* __p) // _Tp1 must be complete.
+ {
+ // Catch self-reset errors.
+ _GLIBCXX_DEBUG_ASSERT(__p == 0 || __p != _M_ptr);
+ __shared_ptr(__p).swap(*this);
+ }
+
+ template<typename _Tp1, typename _Deleter>
+ void
+ reset(_Tp1* __p, _Deleter __d)
+ { __shared_ptr(__p, __d).swap(*this); }
+
+ // Allow class instantiation when _Tp is [cv-qual] void.
+ typename std::tr1::add_reference<_Tp>::type
+ operator*() const // never throws
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_ptr != 0);
+ return *_M_ptr;
+ }
+
+ _Tp*
+ operator->() const // never throws
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_ptr != 0);
+ return _M_ptr;
+ }
+
+ _Tp*
+ get() const // never throws
+ { return _M_ptr; }
+
+ // Implicit conversion to "bool"
+ private:
+ typedef _Tp* __shared_ptr::*__unspecified_bool_type;
+
+ public:
+ operator __unspecified_bool_type() const // never throws
+ { return _M_ptr == 0 ? 0 : &__shared_ptr::_M_ptr; }
+
+ bool
+ unique() const // never throws
+ { return _M_refcount._M_unique(); }
+
+ long
+ use_count() const // never throws
+ { return _M_refcount._M_get_use_count(); }
+
+ void
+ swap(__shared_ptr<_Tp, _Lp>& __other) // never throws
+ {
+ std::swap(_M_ptr, __other._M_ptr);
+ _M_refcount._M_swap(__other._M_refcount);
+ }
+
+ private:
+ void*
+ _M_get_deleter(const std::type_info& __ti) const
+ { return _M_refcount._M_get_deleter(__ti); }
+
+ template<typename _Tp1, _Lock_policy _Lp1>
+ bool
+ _M_less(const __shared_ptr<_Tp1, _Lp1>& __rhs) const
+ { return _M_refcount < __rhs._M_refcount; }
+
+ template<typename _Tp1, _Lock_policy _Lp1> friend class __shared_ptr;
+ template<typename _Tp1, _Lock_policy _Lp1> friend class __weak_ptr;
+
+ template<typename _Del, typename _Tp1, _Lock_policy _Lp1>
+ friend _Del* get_deleter(const __shared_ptr<_Tp1, _Lp1>&);
+
+ // Friends injected into enclosing namespace and found by ADL:
+ template<typename _Tp1>
+ friend inline bool
+ operator==(const __shared_ptr& __a, const __shared_ptr<_Tp1, _Lp>& __b)
+ { return __a.get() == __b.get(); }
+
+ template<typename _Tp1>
+ friend inline bool
+ operator!=(const __shared_ptr& __a, const __shared_ptr<_Tp1, _Lp>& __b)
+ { return __a.get() != __b.get(); }
+
+ template<typename _Tp1>
+ friend inline bool
+ operator<(const __shared_ptr& __a, const __shared_ptr<_Tp1, _Lp>& __b)
+ { return __a._M_less(__b); }
+
+ _Tp* _M_ptr; // Contained pointer.
+ __shared_count<_Lp> _M_refcount; // Reference counter.
+ };
+
+ // 2.2.3.8 shared_ptr specialized algorithms.
+ template<typename _Tp, _Lock_policy _Lp>
+ inline void
+ swap(__shared_ptr<_Tp, _Lp>& __a, __shared_ptr<_Tp, _Lp>& __b)
+ { __a.swap(__b); }
+
+ // 2.2.3.9 shared_ptr casts
+ /** @warning The seemingly equivalent
+ * <code>shared_ptr<_Tp, _Lp>(static_cast<_Tp*>(__r.get()))</code>
+ * will eventually result in undefined behaviour,
+ * attempting to delete the same object twice.
+ */
+ template<typename _Tp, typename _Tp1, _Lock_policy _Lp>
+ inline __shared_ptr<_Tp, _Lp>
+ static_pointer_cast(const __shared_ptr<_Tp1, _Lp>& __r)
+ { return __shared_ptr<_Tp, _Lp>(__r, __static_cast_tag()); }
+
+ /** @warning The seemingly equivalent
+ * <code>shared_ptr<_Tp, _Lp>(const_cast<_Tp*>(__r.get()))</code>
+ * will eventually result in undefined behaviour,
+ * attempting to delete the same object twice.
+ */
+ template<typename _Tp, typename _Tp1, _Lock_policy _Lp>
+ inline __shared_ptr<_Tp, _Lp>
+ const_pointer_cast(const __shared_ptr<_Tp1, _Lp>& __r)
+ { return __shared_ptr<_Tp, _Lp>(__r, __const_cast_tag()); }
+
+ /** @warning The seemingly equivalent
+ * <code>shared_ptr<_Tp, _Lp>(dynamic_cast<_Tp*>(__r.get()))</code>
+ * will eventually result in undefined behaviour,
+ * attempting to delete the same object twice.
+ */
+ template<typename _Tp, typename _Tp1, _Lock_policy _Lp>
+ inline __shared_ptr<_Tp, _Lp>
+ dynamic_pointer_cast(const __shared_ptr<_Tp1, _Lp>& __r)
+ { return __shared_ptr<_Tp, _Lp>(__r, __dynamic_cast_tag()); }
+
+ // 2.2.3.7 shared_ptr I/O
+ template<typename _Ch, typename _Tr, typename _Tp, _Lock_policy _Lp>
+ std::basic_ostream<_Ch, _Tr>&
+ operator<<(std::basic_ostream<_Ch, _Tr>& __os,
+ const __shared_ptr<_Tp, _Lp>& __p)
+ {
+ __os << __p.get();
+ return __os;
+ }
+
+ // 2.2.3.10 shared_ptr get_deleter (experimental)
+ template<typename _Del, typename _Tp, _Lock_policy _Lp>
+ inline _Del*
+ get_deleter(const __shared_ptr<_Tp, _Lp>& __p)
+ { return static_cast<_Del*>(__p._M_get_deleter(typeid(_Del))); }
+
+
+ template<typename _Tp, _Lock_policy _Lp>
+ class __weak_ptr
+ {
+ public:
+ typedef _Tp element_type;
+
+ __weak_ptr()
+ : _M_ptr(0), _M_refcount() // never throws
+ { }
+
+ // Generated copy constructor, assignment, destructor are fine.
+
+ // The "obvious" converting constructor implementation:
+ //
+ // template<typename _Tp1>
+ // __weak_ptr(const __weak_ptr<_Tp1, _Lp>& __r)
+ // : _M_ptr(__r._M_ptr), _M_refcount(__r._M_refcount) // never throws
+ // { }
+ //
+ // has a serious problem.
+ //
+ // __r._M_ptr may already have been invalidated. The _M_ptr(__r._M_ptr)
+ // conversion may require access to *__r._M_ptr (virtual inheritance).
+ //
+ // It is not possible to avoid spurious access violations since
+ // in multithreaded programs __r._M_ptr may be invalidated at any point.
+ template<typename _Tp1>
+ __weak_ptr(const __weak_ptr<_Tp1, _Lp>& __r)
+ : _M_refcount(__r._M_refcount) // never throws
+ {
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
+ _M_ptr = __r.lock().get();
+ }
+
+ template<typename _Tp1>
+ __weak_ptr(const __shared_ptr<_Tp1, _Lp>& __r)
+ : _M_ptr(__r._M_ptr), _M_refcount(__r._M_refcount) // never throws
+ { __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>) }
+
+ template<typename _Tp1>
+ __weak_ptr&
+ operator=(const __weak_ptr<_Tp1, _Lp>& __r) // never throws
+ {
+ _M_ptr = __r.lock().get();
+ _M_refcount = __r._M_refcount;
+ return *this;
+ }
+
+ template<typename _Tp1>
+ __weak_ptr&
+ operator=(const __shared_ptr<_Tp1, _Lp>& __r) // never throws
+ {
+ _M_ptr = __r._M_ptr;
+ _M_refcount = __r._M_refcount;
+ return *this;
+ }
+
+ __shared_ptr<_Tp, _Lp>
+ lock() const // never throws
+ {
+#ifdef __GTHREADS
+ // Optimization: avoid throw overhead.
+ if (expired())
+ return __shared_ptr<element_type, _Lp>();
+
+ __try
+ {
+ return __shared_ptr<element_type, _Lp>(*this);
+ }
+ __catch(const bad_weak_ptr&)
+ {
+ // Q: How can we get here?
+ // A: Another thread may have invalidated r after the
+ // use_count test above.
+ return __shared_ptr<element_type, _Lp>();
+ }
+
+#else
+ // Optimization: avoid try/catch overhead when single threaded.
+ return expired() ? __shared_ptr<element_type, _Lp>()
+ : __shared_ptr<element_type, _Lp>(*this);
+
+#endif
+ } // XXX MT
+
+ long
+ use_count() const // never throws
+ { return _M_refcount._M_get_use_count(); }
+
+ bool
+ expired() const // never throws
+ { return _M_refcount._M_get_use_count() == 0; }
+
+ void
+ reset() // never throws
+ { __weak_ptr().swap(*this); }
+
+ void
+ swap(__weak_ptr& __s) // never throws
+ {
+ std::swap(_M_ptr, __s._M_ptr);
+ _M_refcount._M_swap(__s._M_refcount);
+ }
+
+ private:
+ // Used by __enable_shared_from_this.
+ void
+ _M_assign(_Tp* __ptr, const __shared_count<_Lp>& __refcount)
+ {
+ _M_ptr = __ptr;
+ _M_refcount = __refcount;
+ }
+
+ template<typename _Tp1>
+ bool
+ _M_less(const __weak_ptr<_Tp1, _Lp>& __rhs) const
+ { return _M_refcount < __rhs._M_refcount; }
+
+ template<typename _Tp1, _Lock_policy _Lp1> friend class __shared_ptr;
+ template<typename _Tp1, _Lock_policy _Lp1> friend class __weak_ptr;
+ friend class __enable_shared_from_this<_Tp, _Lp>;
+ friend class enable_shared_from_this<_Tp>;
+
+ // Friend injected into namespace and found by ADL.
+ template<typename _Tp1>
+ friend inline bool
+ operator<(const __weak_ptr& __lhs, const __weak_ptr<_Tp1, _Lp>& __rhs)
+ { return __lhs._M_less(__rhs); }
+
+ _Tp* _M_ptr; // Contained pointer.
+ __weak_count<_Lp> _M_refcount; // Reference counter.
+ };
+
+ // 2.2.4.7 weak_ptr specialized algorithms.
+ template<typename _Tp, _Lock_policy _Lp>
+ inline void
+ swap(__weak_ptr<_Tp, _Lp>& __a, __weak_ptr<_Tp, _Lp>& __b)
+ { __a.swap(__b); }
+
+
+ template<typename _Tp, _Lock_policy _Lp>
+ class __enable_shared_from_this
+ {
+ protected:
+ __enable_shared_from_this() { }
+
+ __enable_shared_from_this(const __enable_shared_from_this&) { }
+
+ __enable_shared_from_this&
+ operator=(const __enable_shared_from_this&)
+ { return *this; }
+
+ ~__enable_shared_from_this() { }
+
+ public:
+ __shared_ptr<_Tp, _Lp>
+ shared_from_this()
+ { return __shared_ptr<_Tp, _Lp>(this->_M_weak_this); }
+
+ __shared_ptr<const _Tp, _Lp>
+ shared_from_this() const
+ { return __shared_ptr<const _Tp, _Lp>(this->_M_weak_this); }
+
+ private:
+ template<typename _Tp1>
+ void
+ _M_weak_assign(_Tp1* __p, const __shared_count<_Lp>& __n) const
+ { _M_weak_this._M_assign(__p, __n); }
+
+ template<typename _Tp1>
+ friend void
+ __enable_shared_from_this_helper(const __shared_count<_Lp>& __pn,
+ const __enable_shared_from_this* __pe,
+ const _Tp1* __px)
+ {
+ if (__pe != 0)
+ __pe->_M_weak_assign(const_cast<_Tp1*>(__px), __pn);
+ }
+
+ mutable __weak_ptr<_Tp, _Lp> _M_weak_this;
+ };
+
+
+ /// shared_ptr
+ // The actual shared_ptr, with forwarding constructors and
+ // assignment operators.
+ template<typename _Tp>
+ class shared_ptr
+ : public __shared_ptr<_Tp>
+ {
+ public:
+ shared_ptr()
+ : __shared_ptr<_Tp>() { }
+
+ template<typename _Tp1>
+ explicit
+ shared_ptr(_Tp1* __p)
+ : __shared_ptr<_Tp>(__p) { }
+
+ template<typename _Tp1, typename _Deleter>
+ shared_ptr(_Tp1* __p, _Deleter __d)
+ : __shared_ptr<_Tp>(__p, __d) { }
+
+ template<typename _Tp1>
+ shared_ptr(const shared_ptr<_Tp1>& __r)
+ : __shared_ptr<_Tp>(__r) { }
+
+ template<typename _Tp1>
+ explicit
+ shared_ptr(const weak_ptr<_Tp1>& __r)
+ : __shared_ptr<_Tp>(__r) { }
+
+#if !defined(__GXX_EXPERIMENTAL_CXX0X__) || _GLIBCXX_DEPRECATED
+ template<typename _Tp1>
+ explicit
+ shared_ptr(std::auto_ptr<_Tp1>& __r)
+ : __shared_ptr<_Tp>(__r) { }
+#endif
+
+ template<typename _Tp1>
+ shared_ptr(const shared_ptr<_Tp1>& __r, __static_cast_tag)
+ : __shared_ptr<_Tp>(__r, __static_cast_tag()) { }
+
+ template<typename _Tp1>
+ shared_ptr(const shared_ptr<_Tp1>& __r, __const_cast_tag)
+ : __shared_ptr<_Tp>(__r, __const_cast_tag()) { }
+
+ template<typename _Tp1>
+ shared_ptr(const shared_ptr<_Tp1>& __r, __dynamic_cast_tag)
+ : __shared_ptr<_Tp>(__r, __dynamic_cast_tag()) { }
+
+ template<typename _Tp1>
+ shared_ptr&
+ operator=(const shared_ptr<_Tp1>& __r) // never throws
+ {
+ this->__shared_ptr<_Tp>::operator=(__r);
+ return *this;
+ }
+
+#if !defined(__GXX_EXPERIMENTAL_CXX0X__) || _GLIBCXX_DEPRECATED
+ template<typename _Tp1>
+ shared_ptr&
+ operator=(std::auto_ptr<_Tp1>& __r)
+ {
+ this->__shared_ptr<_Tp>::operator=(__r);
+ return *this;
+ }
+#endif
+ };
+
+ // 2.2.3.8 shared_ptr specialized algorithms.
+ template<typename _Tp>
+ inline void
+ swap(__shared_ptr<_Tp>& __a, __shared_ptr<_Tp>& __b)
+ { __a.swap(__b); }
+
+ template<typename _Tp, typename _Tp1>
+ inline shared_ptr<_Tp>
+ static_pointer_cast(const shared_ptr<_Tp1>& __r)
+ { return shared_ptr<_Tp>(__r, __static_cast_tag()); }
+
+ template<typename _Tp, typename _Tp1>
+ inline shared_ptr<_Tp>
+ const_pointer_cast(const shared_ptr<_Tp1>& __r)
+ { return shared_ptr<_Tp>(__r, __const_cast_tag()); }
+
+ template<typename _Tp, typename _Tp1>
+ inline shared_ptr<_Tp>
+ dynamic_pointer_cast(const shared_ptr<_Tp1>& __r)
+ { return shared_ptr<_Tp>(__r, __dynamic_cast_tag()); }
+
+
+ /// weak_ptr
+ // The actual weak_ptr, with forwarding constructors and
+ // assignment operators.
+ template<typename _Tp>
+ class weak_ptr
+ : public __weak_ptr<_Tp>
+ {
+ public:
+ weak_ptr()
+ : __weak_ptr<_Tp>() { }
+
+ template<typename _Tp1>
+ weak_ptr(const weak_ptr<_Tp1>& __r)
+ : __weak_ptr<_Tp>(__r) { }
+
+ template<typename _Tp1>
+ weak_ptr(const shared_ptr<_Tp1>& __r)
+ : __weak_ptr<_Tp>(__r) { }
+
+ template<typename _Tp1>
+ weak_ptr&
+ operator=(const weak_ptr<_Tp1>& __r) // never throws
+ {
+ this->__weak_ptr<_Tp>::operator=(__r);
+ return *this;
+ }
+
+ template<typename _Tp1>
+ weak_ptr&
+ operator=(const shared_ptr<_Tp1>& __r) // never throws
+ {
+ this->__weak_ptr<_Tp>::operator=(__r);
+ return *this;
+ }
+
+ shared_ptr<_Tp>
+ lock() const // never throws
+ {
+#ifdef __GTHREADS
+ if (this->expired())
+ return shared_ptr<_Tp>();
+
+ __try
+ {
+ return shared_ptr<_Tp>(*this);
+ }
+ __catch(const bad_weak_ptr&)
+ {
+ return shared_ptr<_Tp>();
+ }
+#else
+ return this->expired() ? shared_ptr<_Tp>()
+ : shared_ptr<_Tp>(*this);
+#endif
+ }
+ };
+
+ /// enable_shared_from_this
+ template<typename _Tp>
+ class enable_shared_from_this
+ {
+ protected:
+ enable_shared_from_this() { }
+
+ enable_shared_from_this(const enable_shared_from_this&) { }
+
+ enable_shared_from_this&
+ operator=(const enable_shared_from_this&)
+ { return *this; }
+
+ ~enable_shared_from_this() { }
+
+ public:
+ shared_ptr<_Tp>
+ shared_from_this()
+ { return shared_ptr<_Tp>(this->_M_weak_this); }
+
+ shared_ptr<const _Tp>
+ shared_from_this() const
+ { return shared_ptr<const _Tp>(this->_M_weak_this); }
+
+ private:
+ template<typename _Tp1>
+ void
+ _M_weak_assign(_Tp1* __p, const __shared_count<>& __n) const
+ { _M_weak_this._M_assign(__p, __n); }
+
+ template<typename _Tp1>
+ friend void
+ __enable_shared_from_this_helper(const __shared_count<>& __pn,
+ const enable_shared_from_this* __pe,
+ const _Tp1* __px)
+ {
+ if (__pe != 0)
+ __pe->_M_weak_assign(const_cast<_Tp1*>(__px), __pn);
+ }
+
+ mutable weak_ptr<_Tp> _M_weak_this;
+ };
+
+}
+}
+
+#endif // _TR1_SHARED_PTR_H
diff --git a/i686-linux/include/c++/4.4.3/tr1/special_function_util.h b/i686-linux/include/c++/4.4.3/tr1/special_function_util.h
new file mode 100644
index 0000000..d2699bd
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/special_function_util.h
@@ -0,0 +1,144 @@
+// Special functions -*- C++ -*-
+
+// Copyright (C) 2006, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/special_function_util.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882 TR1: 5.2 Special functions
+//
+
+// Written by Edward Smith-Rowland based on numerous mathematics books.
+
+#ifndef _GLIBCXX_TR1_SPECIAL_FUNCTION_UTIL_H
+#define _GLIBCXX_TR1_SPECIAL_FUNCTION_UTIL_H 1
+
+namespace std
+{
+namespace tr1
+{
+
+ namespace __detail
+ {
+
+ /// A class to encapsulate type dependent floating point
+ /// constants. Not everything will be able to be expressed as
+ /// type logic.
+ template<typename _Tp>
+ struct __floating_point_constant
+ {
+ static const _Tp __value;
+ };
+
+
+ /// A structure for numeric constants.
+ template<typename _Tp>
+ struct __numeric_constants
+ {
+ /// Constant @f$ \pi @f$.
+ static _Tp __pi() throw()
+ { return static_cast<_Tp>(3.1415926535897932384626433832795029L); }
+ /// Constant @f$ \pi / 2 @f$.
+ static _Tp __pi_2() throw()
+ { return static_cast<_Tp>(1.5707963267948966192313216916397514L); }
+ /// Constant @f$ \pi / 3 @f$.
+ static _Tp __pi_3() throw()
+ { return static_cast<_Tp>(1.0471975511965977461542144610931676L); }
+ /// Constant @f$ \pi / 4 @f$.
+ static _Tp __pi_4() throw()
+ { return static_cast<_Tp>(0.7853981633974483096156608458198757L); }
+ /// Constant @f$ 1 / \pi @f$.
+ static _Tp __1_pi() throw()
+ { return static_cast<_Tp>(0.3183098861837906715377675267450287L); }
+ /// Constant @f$ 2 / \sqrt(\pi) @f$.
+ static _Tp __2_sqrtpi() throw()
+ { return static_cast<_Tp>(1.1283791670955125738961589031215452L); }
+ /// Constant @f$ \sqrt(2) @f$.
+ static _Tp __sqrt2() throw()
+ { return static_cast<_Tp>(1.4142135623730950488016887242096981L); }
+ /// Constant @f$ \sqrt(3) @f$.
+ static _Tp __sqrt3() throw()
+ { return static_cast<_Tp>(1.7320508075688772935274463415058723L); }
+ /// Constant @f$ \sqrt(\pi/2) @f$.
+ static _Tp __sqrtpio2() throw()
+ { return static_cast<_Tp>(1.2533141373155002512078826424055226L); }
+ /// Constant @f$ 1 / sqrt(2) @f$.
+ static _Tp __sqrt1_2() throw()
+ { return static_cast<_Tp>(0.7071067811865475244008443621048490L); }
+ /// Constant @f$ \log(\pi) @f$.
+ static _Tp __lnpi() throw()
+ { return static_cast<_Tp>(1.1447298858494001741434273513530587L); }
+ /// Constant Euler's constant @f$ \gamma_E @f$.
+ static _Tp __gamma_e() throw()
+ { return static_cast<_Tp>(0.5772156649015328606065120900824024L); }
+ /// Constant Euler-Mascheroni @f$ e @f$
+ static _Tp __euler() throw()
+ { return static_cast<_Tp>(2.7182818284590452353602874713526625L); }
+ };
+
+
+#if _GLIBCXX_USE_C99_MATH && !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
+
+ /// This is a wrapper for the isnan function. Otherwise, for NaN,
+ /// all comparisons result in false. If/when we build a std::isnan
+ /// out of intrinsics, this will disappear completely in favor of
+ /// std::isnan.
+ template<typename _Tp>
+ inline bool __isnan(const _Tp __x)
+ {
+ return std::isnan(__x);
+ }
+
+#else
+
+ template<typename _Tp>
+ inline bool __isnan(const _Tp __x)
+ {
+ return __builtin_isnan(__x);
+ }
+
+ template<>
+ inline bool __isnan<float>(const float __x)
+ {
+ return __builtin_isnanf(__x);
+ }
+
+ template<>
+ inline bool __isnan<long double>(const long double __x)
+ {
+ return __builtin_isnanl(__x);
+ }
+
+#endif
+
+ } // namespace __detail
+
+}
+}
+
+#endif // _GLIBCXX_TR1_SPECIAL_FUNCTION_UTIL_H
+
diff --git a/i686-linux/include/c++/4.4.3/tr1/stdarg.h b/i686-linux/include/c++/4.4.3/tr1/stdarg.h
new file mode 100644
index 0000000..41173e8
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/stdarg.h
@@ -0,0 +1,34 @@
+// TR1 stdarg.h -*- C++ -*-
+
+// Copyright (C) 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/stdarg.h
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _TR1_STDARG_H
+#define _TR1_STDARG_H 1
+
+#include <tr1/cstdarg>
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/tr1/stdbool.h b/i686-linux/include/c++/4.4.3/tr1/stdbool.h
new file mode 100644
index 0000000..3861e44
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/stdbool.h
@@ -0,0 +1,34 @@
+// TR1 stdbool.h -*- C++ -*-
+
+// Copyright (C) 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/stdbool.h
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _TR1_STDBOOL_H
+#define _TR1_STDBOOL_H 1
+
+#include <tr1/cstdbool>
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/tr1/stdint.h b/i686-linux/include/c++/4.4.3/tr1/stdint.h
new file mode 100644
index 0000000..8113fa5
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/stdint.h
@@ -0,0 +1,34 @@
+// TR1 stdint.h -*- C++ -*-
+
+// Copyright (C) 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/stdint.h
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _TR1_STDINT_H
+#define _TR1_STDINT_H 1
+
+#include <tr1/cstdint>
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/tr1/stdio.h b/i686-linux/include/c++/4.4.3/tr1/stdio.h
new file mode 100644
index 0000000..f1edf83
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/stdio.h
@@ -0,0 +1,34 @@
+// TR1 stdio.h -*- C++ -*-
+
+// Copyright (C) 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/stdio.h
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _TR1_STDIO_H
+#define _TR1_STDIO_H 1
+
+#include <tr1/cstdio>
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/tr1/stdlib.h b/i686-linux/include/c++/4.4.3/tr1/stdlib.h
new file mode 100644
index 0000000..5e57aec
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/stdlib.h
@@ -0,0 +1,52 @@
+// TR1 stdlib.h -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/stdlib.h
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_STDLIB_H
+#define _GLIBCXX_TR1_STDLIB_H 1
+
+#include <tr1/cstdlib>
+
+#if _GLIBCXX_HOSTED
+
+#if _GLIBCXX_USE_C99
+
+using std::tr1::atoll;
+using std::tr1::strtoll;
+using std::tr1::strtoull;
+
+using std::tr1::abs;
+#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
+using std::tr1::div;
+#endif
+
+#endif
+
+#endif
+
+#endif // _GLIBCXX_TR1_STDLIB_H
+
diff --git a/i686-linux/include/c++/4.4.3/tr1/tgmath.h b/i686-linux/include/c++/4.4.3/tr1/tgmath.h
new file mode 100644
index 0000000..c807031
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/tgmath.h
@@ -0,0 +1,34 @@
+// TR1 tgmath.h -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/tgmath.h
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_TGMATH_H
+#define _GLIBCXX_TR1_TGMATH_H 1
+
+#include <tr1/ctgmath>
+
+#endif // _GLIBCXX_TR1_TGMATH_H
diff --git a/i686-linux/include/c++/4.4.3/tr1/tuple b/i686-linux/include/c++/4.4.3/tr1/tuple
new file mode 100644
index 0000000..ff9f220
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/tuple
@@ -0,0 +1,422 @@
+// class template tuple -*- C++ -*-
+
+// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/tuple
+* This is a TR1 C++ Library header.
+*/
+
+// Chris Jefferson <chris@bubblescope.net>
+// Variadic Templates support by Douglas Gregor <doug.gregor@gmail.com>
+
+#ifndef _GLIBCXX_TR1_TUPLE
+#define _GLIBCXX_TR1_TUPLE 1
+
+#pragma GCC system_header
+
+#include <utility>
+
+namespace std
+{
+namespace tr1
+{
+ // Adds a const reference to a non-reference type.
+ template<typename _Tp>
+ struct __add_c_ref
+ { typedef const _Tp& type; };
+
+ template<typename _Tp>
+ struct __add_c_ref<_Tp&>
+ { typedef _Tp& type; };
+
+ // Adds a reference to a non-reference type.
+ template<typename _Tp>
+ struct __add_ref
+ { typedef _Tp& type; };
+
+ template<typename _Tp>
+ struct __add_ref<_Tp&>
+ { typedef _Tp& type; };
+
+ /**
+ * Contains the actual implementation of the @c tuple template, stored
+ * as a recursive inheritance hierarchy from the first element (most
+ * derived class) to the last (least derived class). The @c Idx
+ * parameter gives the 0-based index of the element stored at this
+ * point in the hierarchy; we use it to implement a constant-time
+ * get() operation.
+ */
+ template<int _Idx, typename... _Elements>
+ struct _Tuple_impl;
+
+ /**
+ * Zero-element tuple implementation. This is the basis case for the
+ * inheritance recursion.
+ */
+ template<int _Idx>
+ struct _Tuple_impl<_Idx> { };
+
+ /**
+ * Recursive tuple implementation. Here we store the @c Head element
+ * and derive from a @c Tuple_impl containing the remaining elements
+ * (which contains the @c Tail).
+ */
+ template<int _Idx, typename _Head, typename... _Tail>
+ struct _Tuple_impl<_Idx, _Head, _Tail...>
+ : public _Tuple_impl<_Idx + 1, _Tail...>
+ {
+ typedef _Tuple_impl<_Idx + 1, _Tail...> _Inherited;
+
+ _Head _M_head;
+
+ _Inherited& _M_tail() { return *this; }
+ const _Inherited& _M_tail() const { return *this; }
+
+ _Tuple_impl() : _Inherited(), _M_head() { }
+
+ explicit
+ _Tuple_impl(typename __add_c_ref<_Head>::type __head,
+ typename __add_c_ref<_Tail>::type... __tail)
+ : _Inherited(__tail...), _M_head(__head) { }
+
+ template<typename... _UElements>
+ _Tuple_impl(const _Tuple_impl<_Idx, _UElements...>& __in)
+ : _Inherited(__in._M_tail()), _M_head(__in._M_head) { }
+
+ _Tuple_impl(const _Tuple_impl& __in)
+ : _Inherited(__in._M_tail()), _M_head(__in._M_head) { }
+
+ template<typename... _UElements>
+ _Tuple_impl&
+ operator=(const _Tuple_impl<_Idx, _UElements...>& __in)
+ {
+ _M_head = __in._M_head;
+ _M_tail() = __in._M_tail();
+ return *this;
+ }
+
+ _Tuple_impl&
+ operator=(const _Tuple_impl& __in)
+ {
+ _M_head = __in._M_head;
+ _M_tail() = __in._M_tail();
+ return *this;
+ }
+ };
+
+ template<typename... _Elements>
+ class tuple : public _Tuple_impl<0, _Elements...>
+ {
+ typedef _Tuple_impl<0, _Elements...> _Inherited;
+
+ public:
+ tuple() : _Inherited() { }
+
+ explicit
+ tuple(typename __add_c_ref<_Elements>::type... __elements)
+ : _Inherited(__elements...) { }
+
+ template<typename... _UElements>
+ tuple(const tuple<_UElements...>& __in)
+ : _Inherited(__in) { }
+
+ tuple(const tuple& __in)
+ : _Inherited(__in) { }
+
+ template<typename... _UElements>
+ tuple&
+ operator=(const tuple<_UElements...>& __in)
+ {
+ static_cast<_Inherited&>(*this) = __in;
+ return *this;
+ }
+
+ tuple&
+ operator=(const tuple& __in)
+ {
+ static_cast<_Inherited&>(*this) = __in;
+ return *this;
+ }
+ };
+
+ template<> class tuple<> { };
+
+ // 2-element tuple, with construction and assignment from a pair.
+ template<typename _T1, typename _T2>
+ class tuple<_T1, _T2> : public _Tuple_impl<0, _T1, _T2>
+ {
+ typedef _Tuple_impl<0, _T1, _T2> _Inherited;
+
+ public:
+ tuple() : _Inherited() { }
+
+ explicit
+ tuple(typename __add_c_ref<_T1>::type __a1,
+ typename __add_c_ref<_T2>::type __a2)
+ : _Inherited(__a1, __a2) { }
+
+ template<typename _U1, typename _U2>
+ tuple(const tuple<_U1, _U2>& __in)
+ : _Inherited(__in) { }
+
+ tuple(const tuple& __in)
+ : _Inherited(__in) { }
+
+ template<typename _U1, typename _U2>
+ tuple(const pair<_U1, _U2>& __in)
+ : _Inherited(_Tuple_impl<0,
+ typename __add_c_ref<_U1>::type,
+ typename __add_c_ref<_U2>::type>(__in.first,
+ __in.second))
+ { }
+
+ template<typename _U1, typename _U2>
+ tuple&
+ operator=(const tuple<_U1, _U2>& __in)
+ {
+ static_cast<_Inherited&>(*this) = __in;
+ return *this;
+ }
+
+ tuple&
+ operator=(const tuple& __in)
+ {
+ static_cast<_Inherited&>(*this) = __in;
+ return *this;
+ }
+
+ template<typename _U1, typename _U2>
+ tuple&
+ operator=(const pair<_U1, _U2>& __in)
+ {
+ this->_M_head = __in.first;
+ this->_M_tail()._M_head = __in.second;
+ return *this;
+ }
+ };
+
+
+ /// Gives the type of the ith element of a given tuple type.
+ template<int __i, typename _Tp>
+ struct tuple_element;
+
+ /**
+ * Recursive case for tuple_element: strip off the first element in
+ * the tuple and retrieve the (i-1)th element of the remaining tuple.
+ */
+ template<int __i, typename _Head, typename... _Tail>
+ struct tuple_element<__i, tuple<_Head, _Tail...> >
+ : tuple_element<__i - 1, tuple<_Tail...> > { };
+
+ /**
+ * Basis case for tuple_element: The first element is the one we're seeking.
+ */
+ template<typename _Head, typename... _Tail>
+ struct tuple_element<0, tuple<_Head, _Tail...> >
+ {
+ typedef _Head type;
+ };
+
+ /// Finds the size of a given tuple type.
+ template<typename _Tp>
+ struct tuple_size;
+
+ /// class tuple_size
+ template<typename... _Elements>
+ struct tuple_size<tuple<_Elements...> >
+ {
+ static const int value = sizeof...(_Elements);
+ };
+
+ template<typename... _Elements>
+ const int tuple_size<tuple<_Elements...> >::value;
+
+ template<int __i, typename _Head, typename... _Tail>
+ inline typename __add_ref<_Head>::type
+ __get_helper(_Tuple_impl<__i, _Head, _Tail...>& __t)
+ {
+ return __t._M_head;
+ }
+
+ template<int __i, typename _Head, typename... _Tail>
+ inline typename __add_c_ref<_Head>::type
+ __get_helper(const _Tuple_impl<__i, _Head, _Tail...>& __t)
+ {
+ return __t._M_head;
+ }
+
+ // Return a reference (const reference) to the ith element of a tuple.
+ // Any const or non-const ref elements are returned with their original type.
+ template<int __i, typename... _Elements>
+ inline typename __add_ref<
+ typename tuple_element<__i, tuple<_Elements...> >::type
+ >::type
+ get(tuple<_Elements...>& __t)
+ {
+ return __get_helper<__i>(__t);
+ }
+
+ template<int __i, typename... _Elements>
+ inline typename __add_c_ref<
+ typename tuple_element<__i, tuple<_Elements...> >::type
+ >::type
+ get(const tuple<_Elements...>& __t)
+ {
+ return __get_helper<__i>(__t);
+ }
+
+ // This class helps construct the various comparison operations on tuples
+ template<int __check_equal_size, int __i, int __j,
+ typename _Tp, typename _Up>
+ struct __tuple_compare;
+
+ template<int __i, int __j, typename _Tp, typename _Up>
+ struct __tuple_compare<0, __i, __j, _Tp, _Up>
+ {
+ static bool __eq(const _Tp& __t, const _Up& __u)
+ {
+ return (get<__i>(__t) == get<__i>(__u) &&
+ __tuple_compare<0, __i+1, __j, _Tp, _Up>::__eq(__t, __u));
+ }
+
+ static bool __less(const _Tp& __t, const _Up& __u)
+ {
+ return ((get<__i>(__t) < get<__i>(__u))
+ || !(get<__i>(__u) < get<__i>(__t)) &&
+ __tuple_compare<0, __i+1, __j, _Tp, _Up>::__less(__t, __u));
+ }
+ };
+
+ template<int __i, typename _Tp, typename _Up>
+ struct __tuple_compare<0, __i, __i, _Tp, _Up>
+ {
+ static bool __eq(const _Tp&, const _Up&)
+ { return true; }
+
+ static bool __less(const _Tp&, const _Up&)
+ { return false; }
+ };
+
+ template<typename... _TElements, typename... _UElements>
+ bool
+ operator==(const tuple<_TElements...>& __t,
+ const tuple<_UElements...>& __u)
+ {
+ typedef tuple<_TElements...> _Tp;
+ typedef tuple<_UElements...> _Up;
+ return (__tuple_compare<tuple_size<_Tp>::value - tuple_size<_Up>::value,
+ 0, tuple_size<_Tp>::value, _Tp, _Up>::__eq(__t, __u));
+ }
+
+ template<typename... _TElements, typename... _UElements>
+ bool
+ operator<(const tuple<_TElements...>& __t,
+ const tuple<_UElements...>& __u)
+ {
+ typedef tuple<_TElements...> _Tp;
+ typedef tuple<_UElements...> _Up;
+ return (__tuple_compare<tuple_size<_Tp>::value - tuple_size<_Up>::value,
+ 0, tuple_size<_Tp>::value, _Tp, _Up>::__less(__t, __u));
+ }
+
+ template<typename... _TElements, typename... _UElements>
+ inline bool
+ operator!=(const tuple<_TElements...>& __t,
+ const tuple<_UElements...>& __u)
+ { return !(__t == __u); }
+
+ template<typename... _TElements, typename... _UElements>
+ inline bool
+ operator>(const tuple<_TElements...>& __t,
+ const tuple<_UElements...>& __u)
+ { return __u < __t; }
+
+ template<typename... _TElements, typename... _UElements>
+ inline bool
+ operator<=(const tuple<_TElements...>& __t,
+ const tuple<_UElements...>& __u)
+ { return !(__u < __t); }
+
+ template<typename... _TElements, typename... _UElements>
+ inline bool
+ operator>=(const tuple<_TElements...>& __t,
+ const tuple<_UElements...>& __u)
+ { return !(__t < __u); }
+
+ template<typename _Tp>
+ class reference_wrapper;
+
+ // Helper which adds a reference to a type when given a reference_wrapper
+ template<typename _Tp>
+ struct __strip_reference_wrapper
+ {
+ typedef _Tp __type;
+ };
+
+ template<typename _Tp>
+ struct __strip_reference_wrapper<reference_wrapper<_Tp> >
+ {
+ typedef _Tp& __type;
+ };
+
+ template<typename _Tp>
+ struct __strip_reference_wrapper<const reference_wrapper<_Tp> >
+ {
+ typedef _Tp& __type;
+ };
+
+ template<typename... _Elements>
+ inline tuple<typename __strip_reference_wrapper<_Elements>::__type...>
+ make_tuple(_Elements... __args)
+ {
+ typedef tuple<typename __strip_reference_wrapper<_Elements>::__type...>
+ __result_type;
+ return __result_type(__args...);
+ }
+
+ template<typename... _Elements>
+ inline tuple<_Elements&...>
+ tie(_Elements&... __args)
+ {
+ return tuple<_Elements&...>(__args...);
+ }
+
+ // A class (and instance) which can be used in 'tie' when an element
+ // of a tuple is not required
+ struct _Swallow_assign
+ {
+ template<class _Tp>
+ _Swallow_assign&
+ operator=(const _Tp&)
+ { return *this; }
+ };
+
+ // TODO: Put this in some kind of shared file.
+ namespace
+ {
+ _Swallow_assign ignore;
+ }; // anonymous namespace
+}
+}
+
+#endif // _GLIBCXX_TR1_TUPLE
diff --git a/i686-linux/include/c++/4.4.3/tr1/type_traits b/i686-linux/include/c++/4.4.3/tr1/type_traits
new file mode 100644
index 0000000..fe28f84
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/type_traits
@@ -0,0 +1,249 @@
+// TR1 type_traits -*- C++ -*-
+
+// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/type_traits
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_TYPE_TRAITS
+#define _GLIBCXX_TR1_TYPE_TRAITS 1
+
+#pragma GCC system_header
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+#include <cstddef>
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/type_traits>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/type_traits>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+namespace std
+{
+namespace tr1
+{
+#define _DEFINE_SPEC(_Trait, _Type) \
+ template<> \
+ struct _Trait<_Type> \
+ : public true_type { };
+
+ template<typename>
+ struct is_reference
+ : public false_type { };
+
+ template<typename _Tp>
+ struct is_reference<_Tp&>
+ : public true_type { };
+
+ template<typename _Tp>
+ struct is_pod
+ : public integral_constant<bool, __is_pod(_Tp) || is_void<_Tp>::value>
+ { };
+
+ template<typename _Tp>
+ struct has_trivial_constructor
+ : public integral_constant<bool, is_pod<_Tp>::value>
+ { };
+
+ template<typename _Tp>
+ struct has_trivial_copy
+ : public integral_constant<bool, is_pod<_Tp>::value>
+ { };
+
+ template<typename _Tp>
+ struct has_trivial_assign
+ : public integral_constant<bool, is_pod<_Tp>::value>
+ { };
+
+ template<typename _Tp>
+ struct has_trivial_destructor
+ : public integral_constant<bool, is_pod<_Tp>::value>
+ { };
+
+ template<typename _Tp>
+ struct has_nothrow_constructor
+ : public integral_constant<bool, is_pod<_Tp>::value>
+ { };
+
+ template<typename _Tp>
+ struct has_nothrow_copy
+ : public integral_constant<bool, is_pod<_Tp>::value>
+ { };
+
+ template<typename _Tp>
+ struct has_nothrow_assign
+ : public integral_constant<bool, is_pod<_Tp>::value>
+ { };
+
+ template<typename>
+ struct __is_signed_helper
+ : public false_type { };
+ _DEFINE_SPEC(__is_signed_helper, signed char)
+ _DEFINE_SPEC(__is_signed_helper, short)
+ _DEFINE_SPEC(__is_signed_helper, int)
+ _DEFINE_SPEC(__is_signed_helper, long)
+ _DEFINE_SPEC(__is_signed_helper, long long)
+
+ template<typename _Tp>
+ struct is_signed
+ : public integral_constant<bool, (__is_signed_helper<typename
+ remove_cv<_Tp>::type>::value)>
+ { };
+
+ template<typename>
+ struct __is_unsigned_helper
+ : public false_type { };
+ _DEFINE_SPEC(__is_unsigned_helper, unsigned char)
+ _DEFINE_SPEC(__is_unsigned_helper, unsigned short)
+ _DEFINE_SPEC(__is_unsigned_helper, unsigned int)
+ _DEFINE_SPEC(__is_unsigned_helper, unsigned long)
+ _DEFINE_SPEC(__is_unsigned_helper, unsigned long long)
+
+ template<typename _Tp>
+ struct is_unsigned
+ : public integral_constant<bool, (__is_unsigned_helper<typename
+ remove_cv<_Tp>::type>::value)>
+ { };
+
+ template<typename _Base, typename _Derived>
+ struct __is_base_of_helper
+ {
+ typedef typename remove_cv<_Base>::type _NoCv_Base;
+ typedef typename remove_cv<_Derived>::type _NoCv_Derived;
+ static const bool __value = (is_same<_Base, _Derived>::value
+ || (__is_base_of(_Base, _Derived)
+ && !is_same<_NoCv_Base,
+ _NoCv_Derived>::value));
+ };
+
+ template<typename _Base, typename _Derived>
+ struct is_base_of
+ : public integral_constant<bool,
+ __is_base_of_helper<_Base, _Derived>::__value>
+ { };
+
+ template<typename _From, typename _To>
+ struct __is_convertible_simple
+ : public __sfinae_types
+ {
+ private:
+ static __one __test(_To);
+ static __two __test(...);
+ static _From __makeFrom();
+
+ public:
+ static const bool __value = sizeof(__test(__makeFrom())) == 1;
+ };
+
+ template<typename _Tp>
+ struct add_reference;
+
+ template<typename _Tp>
+ struct __is_int_or_cref
+ {
+ typedef typename remove_reference<_Tp>::type __rr_Tp;
+ static const bool __value = (is_integral<_Tp>::value
+ || (is_integral<__rr_Tp>::value
+ && is_const<__rr_Tp>::value
+ && !is_volatile<__rr_Tp>::value));
+ };
+
+ template<typename _From, typename _To,
+ bool = (is_void<_From>::value || is_void<_To>::value
+ || is_function<_To>::value || is_array<_To>::value
+ // This special case is here only to avoid warnings.
+ || (is_floating_point<typename
+ remove_reference<_From>::type>::value
+ && __is_int_or_cref<_To>::__value))>
+ struct __is_convertible_helper
+ {
+ // "An imaginary lvalue of type From...".
+ static const bool __value = (__is_convertible_simple<typename
+ add_reference<_From>::type, _To>::__value);
+ };
+
+ template<typename _From, typename _To>
+ struct __is_convertible_helper<_From, _To, true>
+ { static const bool __value = (is_void<_To>::value
+ || (__is_int_or_cref<_To>::__value
+ && !is_void<_From>::value)); };
+
+ template<typename _From, typename _To>
+ struct is_convertible
+ : public integral_constant<bool,
+ __is_convertible_helper<_From, _To>::__value>
+ { };
+
+ // reference modifications [4.7.2].
+ template<typename _Tp>
+ struct remove_reference
+ { typedef _Tp type; };
+
+ template<typename _Tp>
+ struct remove_reference<_Tp&>
+ { typedef _Tp type; };
+
+ // NB: Careful with reference to void.
+ template<typename _Tp, bool = (is_void<_Tp>::value
+ || is_reference<_Tp>::value)>
+ struct __add_reference_helper
+ { typedef _Tp& type; };
+
+ template<typename _Tp>
+ struct __add_reference_helper<_Tp, true>
+ { typedef _Tp type; };
+
+ template<typename _Tp>
+ struct add_reference
+ : public __add_reference_helper<_Tp>
+ { };
+
+ // other transformations [4.8].
+ template<std::size_t _Len, std::size_t _Align>
+ struct aligned_storage
+ {
+ union type
+ {
+ unsigned char __data[_Len];
+ struct __attribute__((__aligned__((_Align)))) { } __align;
+ };
+ };
+
+#undef _DEFINE_SPEC
+}
+}
+
+#endif // _GLIBCXX_TR1_TYPE_TRAITS
diff --git a/i686-linux/include/c++/4.4.3/tr1/unordered_map b/i686-linux/include/c++/4.4.3/tr1/unordered_map
new file mode 100644
index 0000000..316630f
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/unordered_map
@@ -0,0 +1,61 @@
+// TR1 unordered_map -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/unordered_map
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_UNORDERED_MAP
+#define _GLIBCXX_TR1_UNORDERED_MAP 1
+
+#pragma GCC system_header
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+#include <utility>
+#include <bits/stl_algobase.h>
+#include <bits/allocator.h>
+#include <bits/stl_function.h> // equal_to, _Identity, _Select1st
+#include <bits/stringfwd.h>
+#include <tr1/type_traits>
+#include <tr1/functional_hash.h>
+#include <tr1/hashtable.h>
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/unordered_map>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/unordered_map>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+#endif // _GLIBCXX_TR1_UNORDERED_MAP
diff --git a/i686-linux/include/c++/4.4.3/tr1/unordered_set b/i686-linux/include/c++/4.4.3/tr1/unordered_set
new file mode 100644
index 0000000..3bd0944
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/unordered_set
@@ -0,0 +1,61 @@
+// TR1 unordered_set -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/unordered_set
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_UNORDERED_SET
+#define _GLIBCXX_TR1_UNORDERED_SET 1
+
+#pragma GCC system_header
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+#include <utility>
+#include <bits/stl_algobase.h>
+#include <bits/allocator.h>
+#include <bits/stl_function.h> // equal_to, _Identity, _Select1st
+#include <bits/stringfwd.h>
+#include <tr1/type_traits>
+#include <tr1/functional_hash.h>
+#include <tr1/hashtable.h>
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/unordered_set>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/unordered_set>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+#endif // _GLIBCXX_TR1_UNORDERED_SET
diff --git a/i686-linux/include/c++/4.4.3/tr1/utility b/i686-linux/include/c++/4.4.3/tr1/utility
new file mode 100644
index 0000000..0aac2b2
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/utility
@@ -0,0 +1,56 @@
+// TR1 utility -*- C++ -*-
+
+// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/utility
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_UTILITY
+#define _GLIBCXX_TR1_UTILITY 1
+
+#pragma GCC system_header
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+#include <bits/c++config.h>
+#include <bits/stl_relops.h>
+#include <bits/stl_pair.h>
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/utility>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/utility>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+#endif // _GLIBCXX_TR1_UTILITY
diff --git a/i686-linux/include/c++/4.4.3/tr1/wchar.h b/i686-linux/include/c++/4.4.3/tr1/wchar.h
new file mode 100644
index 0000000..5996048
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/wchar.h
@@ -0,0 +1,34 @@
+// TR1 wchar.h -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/wchar.h
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_WCHAR_H
+#define _GLIBCXX_TR1_WCHAR_H 1
+
+#include <tr1/cwchar>
+
+#endif // _GLIBCXX_TR1_WCHAR_H
diff --git a/i686-linux/include/c++/4.4.3/tr1/wctype.h b/i686-linux/include/c++/4.4.3/tr1/wctype.h
new file mode 100644
index 0000000..604948a
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1/wctype.h
@@ -0,0 +1,34 @@
+// TR1 wctype.h -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/wctype.h
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_WCTYPE_H
+#define _GLIBCXX_TR1_WCTYPE_H 1
+
+#include <tr1/cwctype>
+
+#endif // _GLIBCXX_TR1_WCTYPE_H
diff --git a/i686-linux/include/c++/4.4.3/tr1_impl/array b/i686-linux/include/c++/4.4.3/tr1_impl/array
new file mode 100644
index 0000000..c0bd240
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1_impl/array
@@ -0,0 +1,287 @@
+// class template array -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/array
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+ /**
+ * @brief A standard container for storing a fixed size sequence of elements.
+ *
+ * @ingroup sequences
+ *
+ * Meets the requirements of a <a href="tables.html#65">container</a>, a
+ * <a href="tables.html#66">reversible container</a>, and a
+ * <a href="tables.html#67">sequence</a>.
+ *
+ * Sets support random access iterators.
+ *
+ * @param Tp Type of element. Required to be a complete type.
+ * @param N Number of elements.
+ */
+ template<typename _Tp, std::size_t _Nm>
+ struct array
+ {
+ typedef _Tp value_type;
+ typedef value_type& reference;
+ typedef const value_type& const_reference;
+ typedef value_type* iterator;
+ typedef const value_type* const_iterator;
+ typedef std::size_t size_type;
+ typedef std::ptrdiff_t difference_type;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+
+ // Support for zero-sized arrays mandatory.
+ value_type _M_instance[_Nm ? _Nm : 1];
+
+ // No explicit construct/copy/destroy for aggregate type.
+
+ void
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ // DR 776.
+ fill(const value_type& __u)
+#else
+ assign(const value_type& __u)
+#endif
+ { std::fill_n(begin(), size(), __u); }
+
+ void
+ swap(array& __other)
+ { std::swap_ranges(begin(), end(), __other.begin()); }
+
+ // Iterators.
+ iterator
+ begin()
+ { return iterator(&_M_instance[0]); }
+
+ const_iterator
+ begin() const
+ { return const_iterator(&_M_instance[0]); }
+
+ iterator
+ end()
+ { return iterator(&_M_instance[_Nm]); }
+
+ const_iterator
+ end() const
+ { return const_iterator(&_M_instance[_Nm]); }
+
+ reverse_iterator
+ rbegin()
+ { return reverse_iterator(end()); }
+
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(end()); }
+
+ reverse_iterator
+ rend()
+ { return reverse_iterator(begin()); }
+
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(begin()); }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ const_iterator
+ cbegin() const
+ { return const_iterator(&_M_instance[0]); }
+
+ const_iterator
+ cend() const
+ { return const_iterator(&_M_instance[_Nm]); }
+
+ const_reverse_iterator
+ crbegin() const
+ { return const_reverse_iterator(end()); }
+
+ const_reverse_iterator
+ crend() const
+ { return const_reverse_iterator(begin()); }
+#endif
+
+ // Capacity.
+ size_type
+ size() const { return _Nm; }
+
+ size_type
+ max_size() const { return _Nm; }
+
+ bool
+ empty() const { return size() == 0; }
+
+ // Element access.
+ reference
+ operator[](size_type __n)
+ { return _M_instance[__n]; }
+
+ const_reference
+ operator[](size_type __n) const
+ { return _M_instance[__n]; }
+
+ reference
+ at(size_type __n)
+ {
+ if (__builtin_expect(__n >= _Nm, false))
+ std::__throw_out_of_range(__N("array::at"));
+ return _M_instance[__n];
+ }
+
+ const_reference
+ at(size_type __n) const
+ {
+ if (__builtin_expect(__n >= _Nm, false))
+ std::__throw_out_of_range(__N("array::at"));
+ return _M_instance[__n];
+ }
+
+ reference
+ front()
+ { return *begin(); }
+
+ const_reference
+ front() const
+ { return *begin(); }
+
+ reference
+ back()
+ { return _Nm ? *(end() - 1) : *end(); }
+
+ const_reference
+ back() const
+ { return _Nm ? *(end() - 1) : *end(); }
+
+ _Tp*
+ data()
+ { return &_M_instance[0]; }
+
+ const _Tp*
+ data() const
+ { return &_M_instance[0]; }
+ };
+
+ // Array comparisons.
+ template<typename _Tp, std::size_t _Nm>
+ inline bool
+ operator==(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
+ { return std::equal(__one.begin(), __one.end(), __two.begin()); }
+
+ template<typename _Tp, std::size_t _Nm>
+ inline bool
+ operator!=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
+ { return !(__one == __two); }
+
+ template<typename _Tp, std::size_t _Nm>
+ inline bool
+ operator<(const array<_Tp, _Nm>& __a, const array<_Tp, _Nm>& __b)
+ {
+ return std::lexicographical_compare(__a.begin(), __a.end(),
+ __b.begin(), __b.end());
+ }
+
+ template<typename _Tp, std::size_t _Nm>
+ inline bool
+ operator>(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
+ { return __two < __one; }
+
+ template<typename _Tp, std::size_t _Nm>
+ inline bool
+ operator<=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
+ { return !(__one > __two); }
+
+ template<typename _Tp, std::size_t _Nm>
+ inline bool
+ operator>=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
+ { return !(__one < __two); }
+
+ // Specialized algorithms [6.2.2.2].
+ template<typename _Tp, std::size_t _Nm>
+ inline void
+ swap(array<_Tp, _Nm>& __one, array<_Tp, _Nm>& __two)
+ { std::swap_ranges(__one.begin(), __one.end(), __two.begin()); }
+
+ // Tuple interface to class template array [6.2.2.5].
+
+ /// tuple_size
+ template<typename _Tp>
+ class tuple_size;
+
+ /// tuple_element
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ template<std::size_t _Int, typename _Tp>
+#else
+ template<int _Int, typename _Tp>
+#endif
+ class tuple_element;
+
+ template<typename _Tp, std::size_t _Nm>
+ struct tuple_size<array<_Tp, _Nm> >
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ { static const std::size_t value = _Nm; };
+#else
+ { static const int value = _Nm; };
+#endif
+
+ template<typename _Tp, std::size_t _Nm>
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ const std::size_t
+#else
+ const int
+#endif
+ tuple_size<array<_Tp, _Nm> >::value;
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ template<std::size_t _Int, typename _Tp, std::size_t _Nm>
+#else
+ template<int _Int, typename _Tp, std::size_t _Nm>
+#endif
+ struct tuple_element<_Int, array<_Tp, _Nm> >
+ { typedef _Tp type; };
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ template<std::size_t _Int, typename _Tp, std::size_t _Nm>
+#else
+ template<int _Int, typename _Tp, std::size_t _Nm>
+#endif
+ inline _Tp&
+ get(array<_Tp, _Nm>& __arr)
+ { return __arr[_Int]; }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ template<std::size_t _Int, typename _Tp, std::size_t _Nm>
+#else
+ template<int _Int, typename _Tp, std::size_t _Nm>
+#endif
+ inline const _Tp&
+ get(const array<_Tp, _Nm>& __arr)
+ { return __arr[_Int]; }
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
diff --git a/i686-linux/include/c++/4.4.3/tr1_impl/boost_sp_counted_base.h b/i686-linux/include/c++/4.4.3/tr1_impl/boost_sp_counted_base.h
new file mode 100644
index 0000000..48e601f
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1_impl/boost_sp_counted_base.h
@@ -0,0 +1,239 @@
+// <tr1_impl/boost_sp_counted_base.h> -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// shared_count.hpp
+// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd.
+
+// shared_ptr.hpp
+// Copyright (C) 1998, 1999 Greg Colvin and Beman Dawes.
+// Copyright (C) 2001, 2002, 2003 Peter Dimov
+
+// weak_ptr.hpp
+// Copyright (C) 2001, 2002, 2003 Peter Dimov
+
+// enable_shared_from_this.hpp
+// Copyright (C) 2002 Peter Dimov
+
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// GCC Note: based on version 1.32.0 of the Boost library.
+
+/** @file tr1_impl/boost_sp_counted_base.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+ class bad_weak_ptr : public std::exception
+ {
+ public:
+ virtual char const*
+ what() const throw()
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ { return "std::bad_weak_ptr"; }
+#else
+ { return "tr1::bad_weak_ptr"; }
+#endif
+ };
+
+ // Substitute for bad_weak_ptr object in the case of -fno-exceptions.
+ inline void
+ __throw_bad_weak_ptr()
+ {
+#if __EXCEPTIONS
+ throw bad_weak_ptr();
+#else
+ __builtin_abort();
+#endif
+ }
+
+ using __gnu_cxx::_Lock_policy;
+ using __gnu_cxx::__default_lock_policy;
+ using __gnu_cxx::_S_single;
+ using __gnu_cxx::_S_mutex;
+ using __gnu_cxx::_S_atomic;
+
+ // Empty helper class except when the template argument is _S_mutex.
+ template<_Lock_policy _Lp>
+ class _Mutex_base
+ {
+ protected:
+ // The atomic policy uses fully-fenced builtins, single doesn't care.
+ enum { _S_need_barriers = 0 };
+ };
+
+ template<>
+ class _Mutex_base<_S_mutex>
+ : public __gnu_cxx::__mutex
+ {
+ protected:
+ // This policy is used when atomic builtins are not available.
+ // The replacement atomic operations might not have the necessary
+ // memory barriers.
+ enum { _S_need_barriers = 1 };
+ };
+
+ template<_Lock_policy _Lp = __default_lock_policy>
+ class _Sp_counted_base
+ : public _Mutex_base<_Lp>
+ {
+ public:
+ _Sp_counted_base()
+ : _M_use_count(1), _M_weak_count(1) { }
+
+ virtual
+ ~_Sp_counted_base() // nothrow
+ { }
+
+ // Called when _M_use_count drops to zero, to release the resources
+ // managed by *this.
+ virtual void
+ _M_dispose() = 0; // nothrow
+
+ // Called when _M_weak_count drops to zero.
+ virtual void
+ _M_destroy() // nothrow
+ { delete this; }
+
+ virtual void*
+ _M_get_deleter(const std::type_info&) = 0;
+
+ void
+ _M_add_ref_copy()
+ { __gnu_cxx::__atomic_add_dispatch(&_M_use_count, 1); }
+
+ void
+ _M_add_ref_lock();
+
+ void
+ _M_release() // nothrow
+ {
+ if (__gnu_cxx::__exchange_and_add_dispatch(&_M_use_count, -1) == 1)
+ {
+ _M_dispose();
+ // There must be a memory barrier between dispose() and destroy()
+ // to ensure that the effects of dispose() are observed in the
+ // thread that runs destroy().
+ // See http://gcc.gnu.org/ml/libstdc++/2005-11/msg00136.html
+ if (_Mutex_base<_Lp>::_S_need_barriers)
+ {
+ _GLIBCXX_READ_MEM_BARRIER;
+ _GLIBCXX_WRITE_MEM_BARRIER;
+ }
+
+ if (__gnu_cxx::__exchange_and_add_dispatch(&_M_weak_count,
+ -1) == 1)
+ _M_destroy();
+ }
+ }
+
+ void
+ _M_weak_add_ref() // nothrow
+ { __gnu_cxx::__atomic_add_dispatch(&_M_weak_count, 1); }
+
+ void
+ _M_weak_release() // nothrow
+ {
+ if (__gnu_cxx::__exchange_and_add_dispatch(&_M_weak_count, -1) == 1)
+ {
+ if (_Mutex_base<_Lp>::_S_need_barriers)
+ {
+ // See _M_release(),
+ // destroy() must observe results of dispose()
+ _GLIBCXX_READ_MEM_BARRIER;
+ _GLIBCXX_WRITE_MEM_BARRIER;
+ }
+ _M_destroy();
+ }
+ }
+
+ long
+ _M_get_use_count() const // nothrow
+ {
+ // No memory barrier is used here so there is no synchronization
+ // with other threads.
+ return const_cast<const volatile _Atomic_word&>(_M_use_count);
+ }
+
+ private:
+ _Sp_counted_base(_Sp_counted_base const&);
+ _Sp_counted_base& operator=(_Sp_counted_base const&);
+
+ _Atomic_word _M_use_count; // #shared
+ _Atomic_word _M_weak_count; // #weak + (#shared != 0)
+ };
+
+ template<>
+ inline void
+ _Sp_counted_base<_S_single>::
+ _M_add_ref_lock()
+ {
+ if (__gnu_cxx::__exchange_and_add_dispatch(&_M_use_count, 1) == 0)
+ {
+ _M_use_count = 0;
+ __throw_bad_weak_ptr();
+ }
+ }
+
+ template<>
+ inline void
+ _Sp_counted_base<_S_mutex>::
+ _M_add_ref_lock()
+ {
+ __gnu_cxx::__scoped_lock sentry(*this);
+ if (__gnu_cxx::__exchange_and_add_dispatch(&_M_use_count, 1) == 0)
+ {
+ _M_use_count = 0;
+ __throw_bad_weak_ptr();
+ }
+ }
+
+ template<>
+ inline void
+ _Sp_counted_base<_S_atomic>::
+ _M_add_ref_lock()
+ {
+ // Perform lock-free add-if-not-zero operation.
+ _Atomic_word __count;
+ do
+ {
+ __count = _M_use_count;
+ if (__count == 0)
+ __throw_bad_weak_ptr();
+
+ // Replace the current counter value with the old value + 1, as
+ // long as it's not changed meanwhile.
+ }
+ while (!__sync_bool_compare_and_swap(&_M_use_count, __count,
+ __count + 1));
+ }
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
diff --git a/i686-linux/include/c++/4.4.3/tr1_impl/cctype b/i686-linux/include/c++/4.4.3/tr1_impl/cctype
new file mode 100644
index 0000000..c76d38c
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1_impl/cctype
@@ -0,0 +1,43 @@
+// TR1 cctype -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/cctype
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#if _GLIBCXX_USE_C99_CTYPE_TR1
+
+#undef isblank
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+ using ::isblank;
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/tr1_impl/cfenv b/i686-linux/include/c++/4.4.3/tr1_impl/cfenv
new file mode 100644
index 0000000..3078c7d
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1_impl/cfenv
@@ -0,0 +1,70 @@
+// TR1 cfenv -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/cfenv
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#if _GLIBCXX_USE_C99_FENV_TR1
+
+#undef feclearexcept
+#undef fegetexceptflag
+#undef feraiseexcept
+#undef fesetexceptflag
+#undef fetestexcept
+#undef fegetround
+#undef fesetround
+#undef fegetenv
+#undef feholdexcept
+#undef fesetenv
+#undef feupdateenv
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+ // types
+ using ::fenv_t;
+ using ::fexcept_t;
+
+ // functions
+ using ::feclearexcept;
+ using ::fegetexceptflag;
+ using ::feraiseexcept;
+ using ::fesetexceptflag;
+ using ::fetestexcept;
+
+ using ::fegetround;
+ using ::fesetround;
+
+ using ::fegetenv;
+ using ::feholdexcept;
+ using ::fesetenv;
+ using ::feupdateenv;
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/tr1_impl/cinttypes b/i686-linux/include/c++/4.4.3/tr1_impl/cinttypes
new file mode 100644
index 0000000..4a0f9f1
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1_impl/cinttypes
@@ -0,0 +1,64 @@
+// TR1 cinttypes -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/cinttypes
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#if _GLIBCXX_USE_C99_INTTYPES_TR1
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+ // types
+ using ::imaxdiv_t;
+
+ // functions
+ using ::imaxabs;
+
+ // May collide with _Longlong abs(_Longlong), and is not described
+ // anywhere outside the synopsis. Likely, a defect.
+ //
+ // intmax_t abs(intmax_t)
+
+ using ::imaxdiv;
+
+ // Likewise, with lldiv_t div(_Longlong, _Longlong).
+ //
+ // imaxdiv_t div(intmax_t, intmax_t)
+
+ using ::strtoimax;
+ using ::strtoumax;
+
+#if defined(_GLIBCXX_USE_WCHAR_T) && _GLIBCXX_USE_C99_INTTYPES_WCHAR_T_TR1
+ using ::wcstoimax;
+ using ::wcstoumax;
+#endif
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/tr1_impl/cmath b/i686-linux/include/c++/4.4.3/tr1_impl/cmath
new file mode 100644
index 0000000..5807380
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1_impl/cmath
@@ -0,0 +1,902 @@
+// TR1 cmath -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/cmath
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#if _GLIBCXX_USE_C99_MATH_TR1
+
+#undef acosh
+#undef acoshf
+#undef acoshl
+#undef asinh
+#undef asinhf
+#undef asinhl
+#undef atanh
+#undef atanhf
+#undef atanhl
+#undef cbrt
+#undef cbrtf
+#undef cbrtl
+#undef copysign
+#undef copysignf
+#undef copysignl
+#undef erf
+#undef erff
+#undef erfl
+#undef erfc
+#undef erfcf
+#undef erfcl
+#undef exp2
+#undef exp2f
+#undef exp2l
+#undef expm1
+#undef expm1f
+#undef expm1l
+#undef fdim
+#undef fdimf
+#undef fdiml
+#undef fma
+#undef fmaf
+#undef fmal
+#undef fmax
+#undef fmaxf
+#undef fmaxl
+#undef fmin
+#undef fminf
+#undef fminl
+#undef hypot
+#undef hypotf
+#undef hypotl
+#undef ilogb
+#undef ilogbf
+#undef ilogbl
+#undef lgamma
+#undef lgammaf
+#undef lgammal
+#undef llrint
+#undef llrintf
+#undef llrintl
+#undef llround
+#undef llroundf
+#undef llroundl
+#undef log1p
+#undef log1pf
+#undef log1pl
+#undef log2
+#undef log2f
+#undef log2l
+#undef logb
+#undef logbf
+#undef logbl
+#undef lrint
+#undef lrintf
+#undef lrintl
+#undef lround
+#undef lroundf
+#undef lroundl
+#undef nan
+#undef nanf
+#undef nanl
+#undef nearbyint
+#undef nearbyintf
+#undef nearbyintl
+#undef nextafter
+#undef nextafterf
+#undef nextafterl
+#undef nexttoward
+#undef nexttowardf
+#undef nexttowardl
+#undef remainder
+#undef remainderf
+#undef remainderl
+#undef remquo
+#undef remquof
+#undef remquol
+#undef rint
+#undef rintf
+#undef rintl
+#undef round
+#undef roundf
+#undef roundl
+#undef scalbln
+#undef scalblnf
+#undef scalblnl
+#undef scalbn
+#undef scalbnf
+#undef scalbnl
+#undef tgamma
+#undef tgammaf
+#undef tgammal
+#undef trunc
+#undef truncf
+#undef truncl
+
+#endif
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+#if _GLIBCXX_USE_C99_MATH_TR1
+
+ // types
+ using ::double_t;
+ using ::float_t;
+
+ // functions
+ using ::acosh;
+ using ::acoshf;
+ using ::acoshl;
+
+ using ::asinh;
+ using ::asinhf;
+ using ::asinhl;
+
+ using ::atanh;
+ using ::atanhf;
+ using ::atanhl;
+
+ using ::cbrt;
+ using ::cbrtf;
+ using ::cbrtl;
+
+ using ::copysign;
+ using ::copysignf;
+ using ::copysignl;
+
+ using ::erf;
+ using ::erff;
+ using ::erfl;
+
+ using ::erfc;
+ using ::erfcf;
+ using ::erfcl;
+
+ using ::exp2;
+ using ::exp2f;
+ using ::exp2l;
+
+ using ::expm1;
+ using ::expm1f;
+ using ::expm1l;
+
+ using ::fdim;
+ using ::fdimf;
+ using ::fdiml;
+
+ using ::fma;
+ using ::fmaf;
+ using ::fmal;
+
+ using ::fmax;
+ using ::fmaxf;
+ using ::fmaxl;
+
+ using ::fmin;
+ using ::fminf;
+ using ::fminl;
+
+ using ::hypot;
+ using ::hypotf;
+ using ::hypotl;
+
+ using ::ilogb;
+ using ::ilogbf;
+ using ::ilogbl;
+
+ using ::lgamma;
+ using ::lgammaf;
+ using ::lgammal;
+
+ using ::llrint;
+ using ::llrintf;
+ using ::llrintl;
+
+ using ::llround;
+ using ::llroundf;
+ using ::llroundl;
+
+ using ::log1p;
+ using ::log1pf;
+ using ::log1pl;
+
+ using ::log2;
+ using ::log2f;
+ using ::log2l;
+
+ using ::logb;
+ using ::logbf;
+ using ::logbl;
+
+ using ::lrint;
+ using ::lrintf;
+ using ::lrintl;
+
+ using ::lround;
+ using ::lroundf;
+ using ::lroundl;
+
+ using ::nan;
+ using ::nanf;
+ using ::nanl;
+
+ using ::nearbyint;
+ using ::nearbyintf;
+ using ::nearbyintl;
+
+ using ::nextafter;
+ using ::nextafterf;
+ using ::nextafterl;
+
+ using ::nexttoward;
+ using ::nexttowardf;
+ using ::nexttowardl;
+
+ using ::remainder;
+ using ::remainderf;
+ using ::remainderl;
+
+ using ::remquo;
+ using ::remquof;
+ using ::remquol;
+
+ using ::rint;
+ using ::rintf;
+ using ::rintl;
+
+ using ::round;
+ using ::roundf;
+ using ::roundl;
+
+ using ::scalbln;
+ using ::scalblnf;
+ using ::scalblnl;
+
+ using ::scalbn;
+ using ::scalbnf;
+ using ::scalbnl;
+
+ using ::tgamma;
+ using ::tgammaf;
+ using ::tgammal;
+
+ using ::trunc;
+ using ::truncf;
+ using ::truncl;
+
+#endif
+
+#if _GLIBCXX_USE_C99_MATH
+#if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
+
+ /// Function template definitions [8.16.3].
+ using std::signbit;
+
+ using std::fpclassify;
+
+ using std::isfinite;
+ using std::isinf;
+ using std::isnan;
+ using std::isnormal;
+
+ using std::isgreater;
+ using std::isgreaterequal;
+ using std::isless;
+ using std::islessequal;
+ using std::islessgreater;
+ using std::isunordered;
+#endif
+#endif
+
+#if _GLIBCXX_USE_C99_MATH_TR1
+
+ /// Additional overloads [8.16.4].
+ using std::acos;
+
+ inline float
+ acosh(float __x)
+ { return __builtin_acoshf(__x); }
+
+ inline long double
+ acosh(long double __x)
+ { return __builtin_acoshl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ acosh(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return acosh(__type(__x));
+ }
+
+ using std::asin;
+
+ inline float
+ asinh(float __x)
+ { return __builtin_asinhf(__x); }
+
+ inline long double
+ asinh(long double __x)
+ { return __builtin_asinhl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ asinh(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return asinh(__type(__x));
+ }
+
+ using std::atan;
+ using std::atan2;
+
+ inline float
+ atanh(float __x)
+ { return __builtin_atanhf(__x); }
+
+ inline long double
+ atanh(long double __x)
+ { return __builtin_atanhl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ atanh(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return atanh(__type(__x));
+ }
+
+ inline float
+ cbrt(float __x)
+ { return __builtin_cbrtf(__x); }
+
+ inline long double
+ cbrt(long double __x)
+ { return __builtin_cbrtl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ cbrt(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return cbrt(__type(__x));
+ }
+
+ using std::ceil;
+
+ inline float
+ copysign(float __x, float __y)
+ { return __builtin_copysignf(__x, __y); }
+
+ inline long double
+ copysign(long double __x, long double __y)
+ { return __builtin_copysignl(__x, __y); }
+
+ template<typename _Tp, typename _Up>
+ inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+ copysign(_Tp __x, _Up __y)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+ return copysign(__type(__x), __type(__y));
+ }
+
+ using std::cos;
+ using std::cosh;
+
+ inline float
+ erf(float __x)
+ { return __builtin_erff(__x); }
+
+ inline long double
+ erf(long double __x)
+ { return __builtin_erfl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ erf(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return erf(__type(__x));
+ }
+
+ inline float
+ erfc(float __x)
+ { return __builtin_erfcf(__x); }
+
+ inline long double
+ erfc(long double __x)
+ { return __builtin_erfcl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ erfc(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return erfc(__type(__x));
+ }
+
+ using std::exp;
+
+ inline float
+ exp2(float __x)
+ { return __builtin_exp2f(__x); }
+
+ inline long double
+ exp2(long double __x)
+ { return __builtin_exp2l(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ exp2(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return exp2(__type(__x));
+ }
+
+ inline float
+ expm1(float __x)
+ { return __builtin_expm1f(__x); }
+
+ inline long double
+ expm1(long double __x)
+ { return __builtin_expm1l(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ expm1(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return expm1(__type(__x));
+ }
+
+ using std::fabs;
+
+ inline float
+ fdim(float __x, float __y)
+ { return __builtin_fdimf(__x, __y); }
+
+ inline long double
+ fdim(long double __x, long double __y)
+ { return __builtin_fdiml(__x, __y); }
+
+ template<typename _Tp, typename _Up>
+ inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+ fdim(_Tp __x, _Up __y)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+ return fdim(__type(__x), __type(__y));
+ }
+
+ using std::floor;
+
+ inline float
+ fma(float __x, float __y, float __z)
+ { return __builtin_fmaf(__x, __y, __z); }
+
+ inline long double
+ fma(long double __x, long double __y, long double __z)
+ { return __builtin_fmal(__x, __y, __z); }
+
+ template<typename _Tp, typename _Up, typename _Vp>
+ inline typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type
+ fma(_Tp __x, _Up __y, _Vp __z)
+ {
+ typedef typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type __type;
+ return fma(__type(__x), __type(__y), __type(__z));
+ }
+
+ inline float
+ fmax(float __x, float __y)
+ { return __builtin_fmaxf(__x, __y); }
+
+ inline long double
+ fmax(long double __x, long double __y)
+ { return __builtin_fmaxl(__x, __y); }
+
+ template<typename _Tp, typename _Up>
+ inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+ fmax(_Tp __x, _Up __y)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+ return fmax(__type(__x), __type(__y));
+ }
+
+ inline float
+ fmin(float __x, float __y)
+ { return __builtin_fminf(__x, __y); }
+
+ inline long double
+ fmin(long double __x, long double __y)
+ { return __builtin_fminl(__x, __y); }
+
+ template<typename _Tp, typename _Up>
+ inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+ fmin(_Tp __x, _Up __y)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+ return fmin(__type(__x), __type(__y));
+ }
+
+ using std::fmod;
+ using std::frexp;
+
+ inline float
+ hypot(float __x, float __y)
+ { return __builtin_hypotf(__x, __y); }
+
+ inline long double
+ hypot(long double __x, long double __y)
+ { return __builtin_hypotl(__x, __y); }
+
+ template<typename _Tp, typename _Up>
+ inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+ hypot(_Tp __x, _Up __y)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+ return hypot(__type(__x), __type(__y));
+ }
+
+ inline int
+ ilogb(float __x)
+ { return __builtin_ilogbf(__x); }
+
+ inline int
+ ilogb(long double __x)
+ { return __builtin_ilogbl(__x); }
+
+ template<typename _Tp>
+ inline int
+ ilogb(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return ilogb(__type(__x));
+ }
+
+ using std::ldexp;
+
+ inline float
+ lgamma(float __x)
+ { return __builtin_lgammaf(__x); }
+
+ inline long double
+ lgamma(long double __x)
+ { return __builtin_lgammal(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ lgamma(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return lgamma(__type(__x));
+ }
+
+ inline long long
+ llrint(float __x)
+ { return __builtin_llrintf(__x); }
+
+ inline long long
+ llrint(long double __x)
+ { return __builtin_llrintl(__x); }
+
+ template<typename _Tp>
+ inline long long
+ llrint(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return llrint(__type(__x));
+ }
+
+ inline long long
+ llround(float __x)
+ { return __builtin_llroundf(__x); }
+
+ inline long long
+ llround(long double __x)
+ { return __builtin_llroundl(__x); }
+
+ template<typename _Tp>
+ inline long long
+ llround(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return llround(__type(__x));
+ }
+
+ using std::log;
+ using std::log10;
+
+ inline float
+ log1p(float __x)
+ { return __builtin_log1pf(__x); }
+
+ inline long double
+ log1p(long double __x)
+ { return __builtin_log1pl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ log1p(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return log1p(__type(__x));
+ }
+
+ // DR 568.
+ inline float
+ log2(float __x)
+ { return __builtin_log2f(__x); }
+
+ inline long double
+ log2(long double __x)
+ { return __builtin_log2l(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ log2(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return log2(__type(__x));
+ }
+
+ inline float
+ logb(float __x)
+ { return __builtin_logbf(__x); }
+
+ inline long double
+ logb(long double __x)
+ { return __builtin_logbl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ logb(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return logb(__type(__x));
+ }
+
+ inline long
+ lrint(float __x)
+ { return __builtin_lrintf(__x); }
+
+ inline long
+ lrint(long double __x)
+ { return __builtin_lrintl(__x); }
+
+ template<typename _Tp>
+ inline long
+ lrint(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return lrint(__type(__x));
+ }
+
+ inline long
+ lround(float __x)
+ { return __builtin_lroundf(__x); }
+
+ inline long
+ lround(long double __x)
+ { return __builtin_lroundl(__x); }
+
+ template<typename _Tp>
+ inline long
+ lround(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return lround(__type(__x));
+ }
+
+ inline float
+ nearbyint(float __x)
+ { return __builtin_nearbyintf(__x); }
+
+ inline long double
+ nearbyint(long double __x)
+ { return __builtin_nearbyintl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ nearbyint(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return nearbyint(__type(__x));
+ }
+
+ inline float
+ nextafter(float __x, float __y)
+ { return __builtin_nextafterf(__x, __y); }
+
+ inline long double
+ nextafter(long double __x, long double __y)
+ { return __builtin_nextafterl(__x, __y); }
+
+ template<typename _Tp, typename _Up>
+ inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+ nextafter(_Tp __x, _Up __y)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+ return nextafter(__type(__x), __type(__y));
+ }
+
+ inline float
+ nexttoward(float __x, long double __y)
+ { return __builtin_nexttowardf(__x, __y); }
+
+ inline long double
+ nexttoward(long double __x, long double __y)
+ { return __builtin_nexttowardl(__x, __y); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ nexttoward(_Tp __x, long double __y)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return nexttoward(__type(__x), __y);
+ }
+
+ // DR 550. What should the return type of pow(float,int) be?
+ // NB: C++0x and TR1 != C++03.
+ // using std::pow;
+
+ inline float
+ remainder(float __x, float __y)
+ { return __builtin_remainderf(__x, __y); }
+
+ inline long double
+ remainder(long double __x, long double __y)
+ { return __builtin_remainderl(__x, __y); }
+
+ template<typename _Tp, typename _Up>
+ inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+ remainder(_Tp __x, _Up __y)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+ return remainder(__type(__x), __type(__y));
+ }
+
+ inline float
+ remquo(float __x, float __y, int* __pquo)
+ { return __builtin_remquof(__x, __y, __pquo); }
+
+ inline long double
+ remquo(long double __x, long double __y, int* __pquo)
+ { return __builtin_remquol(__x, __y, __pquo); }
+
+ template<typename _Tp, typename _Up>
+ inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+ remquo(_Tp __x, _Up __y, int* __pquo)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+ return remquo(__type(__x), __type(__y), __pquo);
+ }
+
+ inline float
+ rint(float __x)
+ { return __builtin_rintf(__x); }
+
+ inline long double
+ rint(long double __x)
+ { return __builtin_rintl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ rint(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return rint(__type(__x));
+ }
+
+ inline float
+ round(float __x)
+ { return __builtin_roundf(__x); }
+
+ inline long double
+ round(long double __x)
+ { return __builtin_roundl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ round(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return round(__type(__x));
+ }
+
+ inline float
+ scalbln(float __x, long __ex)
+ { return __builtin_scalblnf(__x, __ex); }
+
+ inline long double
+ scalbln(long double __x, long __ex)
+ { return __builtin_scalblnl(__x, __ex); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ scalbln(_Tp __x, long __ex)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return scalbln(__type(__x), __ex);
+ }
+
+ inline float
+ scalbn(float __x, int __ex)
+ { return __builtin_scalbnf(__x, __ex); }
+
+ inline long double
+ scalbn(long double __x, int __ex)
+ { return __builtin_scalbnl(__x, __ex); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ scalbn(_Tp __x, int __ex)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return scalbn(__type(__x), __ex);
+ }
+
+ using std::sin;
+ using std::sinh;
+ using std::sqrt;
+ using std::tan;
+ using std::tanh;
+
+ inline float
+ tgamma(float __x)
+ { return __builtin_tgammaf(__x); }
+
+ inline long double
+ tgamma(long double __x)
+ { return __builtin_tgammal(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ tgamma(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return tgamma(__type(__x));
+ }
+
+ inline float
+ trunc(float __x)
+ { return __builtin_truncf(__x); }
+
+ inline long double
+ trunc(long double __x)
+ { return __builtin_truncl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ trunc(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return trunc(__type(__x));
+ }
+
+#endif
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
diff --git a/i686-linux/include/c++/4.4.3/tr1_impl/complex b/i686-linux/include/c++/4.4.3/tr1_impl/complex
new file mode 100644
index 0000000..615fe18
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1_impl/complex
@@ -0,0 +1,370 @@
+// TR1 complex -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/complex
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+ /**
+ * @addtogroup complex_numbers
+ * @{
+ */
+
+ // Forward declarations.
+ template<typename _Tp> std::complex<_Tp> acos(const std::complex<_Tp>&);
+ template<typename _Tp> std::complex<_Tp> asin(const std::complex<_Tp>&);
+ template<typename _Tp> std::complex<_Tp> atan(const std::complex<_Tp>&);
+
+ template<typename _Tp> std::complex<_Tp> acosh(const std::complex<_Tp>&);
+ template<typename _Tp> std::complex<_Tp> asinh(const std::complex<_Tp>&);
+ template<typename _Tp> std::complex<_Tp> atanh(const std::complex<_Tp>&);
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ // DR 595.
+ template<typename _Tp> _Tp fabs(const std::complex<_Tp>&);
+#else
+ template<typename _Tp> std::complex<_Tp> fabs(const std::complex<_Tp>&);
+#endif
+
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ __complex_acos(const std::complex<_Tp>& __z)
+ {
+ const std::complex<_Tp> __t = std::_GLIBCXX_TR1 asin(__z);
+ const _Tp __pi_2 = 1.5707963267948966192313216916397514L;
+ return std::complex<_Tp>(__pi_2 - __t.real(), -__t.imag());
+ }
+
+#if _GLIBCXX_USE_C99_COMPLEX_TR1
+ inline __complex__ float
+ __complex_acos(__complex__ float __z)
+ { return __builtin_cacosf(__z); }
+
+ inline __complex__ double
+ __complex_acos(__complex__ double __z)
+ { return __builtin_cacos(__z); }
+
+ inline __complex__ long double
+ __complex_acos(const __complex__ long double& __z)
+ { return __builtin_cacosl(__z); }
+
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ acos(const std::complex<_Tp>& __z)
+ { return __complex_acos(__z.__rep()); }
+#else
+ /// acos(__z) [8.1.2].
+ // Effects: Behaves the same as C99 function cacos, defined
+ // in subclause 7.3.5.1.
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ acos(const std::complex<_Tp>& __z)
+ { return __complex_acos(__z); }
+#endif
+
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ __complex_asin(const std::complex<_Tp>& __z)
+ {
+ std::complex<_Tp> __t(-__z.imag(), __z.real());
+ __t = std::_GLIBCXX_TR1 asinh(__t);
+ return std::complex<_Tp>(__t.imag(), -__t.real());
+ }
+
+#if _GLIBCXX_USE_C99_COMPLEX_TR1
+ inline __complex__ float
+ __complex_asin(__complex__ float __z)
+ { return __builtin_casinf(__z); }
+
+ inline __complex__ double
+ __complex_asin(__complex__ double __z)
+ { return __builtin_casin(__z); }
+
+ inline __complex__ long double
+ __complex_asin(const __complex__ long double& __z)
+ { return __builtin_casinl(__z); }
+
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ asin(const std::complex<_Tp>& __z)
+ { return __complex_asin(__z.__rep()); }
+#else
+ /// asin(__z) [8.1.3].
+ // Effects: Behaves the same as C99 function casin, defined
+ // in subclause 7.3.5.2.
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ asin(const std::complex<_Tp>& __z)
+ { return __complex_asin(__z); }
+#endif
+
+ template<typename _Tp>
+ std::complex<_Tp>
+ __complex_atan(const std::complex<_Tp>& __z)
+ {
+ const _Tp __r2 = __z.real() * __z.real();
+ const _Tp __x = _Tp(1.0) - __r2 - __z.imag() * __z.imag();
+
+ _Tp __num = __z.imag() + _Tp(1.0);
+ _Tp __den = __z.imag() - _Tp(1.0);
+
+ __num = __r2 + __num * __num;
+ __den = __r2 + __den * __den;
+
+ return std::complex<_Tp>(_Tp(0.5) * atan2(_Tp(2.0) * __z.real(), __x),
+ _Tp(0.25) * log(__num / __den));
+ }
+
+#if _GLIBCXX_USE_C99_COMPLEX_TR1
+ inline __complex__ float
+ __complex_atan(__complex__ float __z)
+ { return __builtin_catanf(__z); }
+
+ inline __complex__ double
+ __complex_atan(__complex__ double __z)
+ { return __builtin_catan(__z); }
+
+ inline __complex__ long double
+ __complex_atan(const __complex__ long double& __z)
+ { return __builtin_catanl(__z); }
+
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ atan(const std::complex<_Tp>& __z)
+ { return __complex_atan(__z.__rep()); }
+#else
+ /// atan(__z) [8.1.4].
+ // Effects: Behaves the same as C99 function catan, defined
+ // in subclause 7.3.5.3.
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ atan(const std::complex<_Tp>& __z)
+ { return __complex_atan(__z); }
+#endif
+
+ template<typename _Tp>
+ std::complex<_Tp>
+ __complex_acosh(const std::complex<_Tp>& __z)
+ {
+ std::complex<_Tp> __t((__z.real() - __z.imag())
+ * (__z.real() + __z.imag()) - _Tp(1.0),
+ _Tp(2.0) * __z.real() * __z.imag());
+ __t = std::sqrt(__t);
+
+ return std::log(__t + __z);
+ }
+
+#if _GLIBCXX_USE_C99_COMPLEX_TR1
+ inline __complex__ float
+ __complex_acosh(__complex__ float __z)
+ { return __builtin_cacoshf(__z); }
+
+ inline __complex__ double
+ __complex_acosh(__complex__ double __z)
+ { return __builtin_cacosh(__z); }
+
+ inline __complex__ long double
+ __complex_acosh(const __complex__ long double& __z)
+ { return __builtin_cacoshl(__z); }
+
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ acosh(const std::complex<_Tp>& __z)
+ { return __complex_acosh(__z.__rep()); }
+#else
+ /// acosh(__z) [8.1.5].
+ // Effects: Behaves the same as C99 function cacosh, defined
+ // in subclause 7.3.6.1.
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ acosh(const std::complex<_Tp>& __z)
+ { return __complex_acosh(__z); }
+#endif
+
+ template<typename _Tp>
+ std::complex<_Tp>
+ __complex_asinh(const std::complex<_Tp>& __z)
+ {
+ std::complex<_Tp> __t((__z.real() - __z.imag())
+ * (__z.real() + __z.imag()) + _Tp(1.0),
+ _Tp(2.0) * __z.real() * __z.imag());
+ __t = std::sqrt(__t);
+
+ return std::log(__t + __z);
+ }
+
+#if _GLIBCXX_USE_C99_COMPLEX_TR1
+ inline __complex__ float
+ __complex_asinh(__complex__ float __z)
+ { return __builtin_casinhf(__z); }
+
+ inline __complex__ double
+ __complex_asinh(__complex__ double __z)
+ { return __builtin_casinh(__z); }
+
+ inline __complex__ long double
+ __complex_asinh(const __complex__ long double& __z)
+ { return __builtin_casinhl(__z); }
+
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ asinh(const std::complex<_Tp>& __z)
+ { return __complex_asinh(__z.__rep()); }
+#else
+ /// asinh(__z) [8.1.6].
+ // Effects: Behaves the same as C99 function casin, defined
+ // in subclause 7.3.6.2.
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ asinh(const std::complex<_Tp>& __z)
+ { return __complex_asinh(__z); }
+#endif
+
+ template<typename _Tp>
+ std::complex<_Tp>
+ __complex_atanh(const std::complex<_Tp>& __z)
+ {
+ const _Tp __i2 = __z.imag() * __z.imag();
+ const _Tp __x = _Tp(1.0) - __i2 - __z.real() * __z.real();
+
+ _Tp __num = _Tp(1.0) + __z.real();
+ _Tp __den = _Tp(1.0) - __z.real();
+
+ __num = __i2 + __num * __num;
+ __den = __i2 + __den * __den;
+
+ return std::complex<_Tp>(_Tp(0.25) * (log(__num) - log(__den)),
+ _Tp(0.5) * atan2(_Tp(2.0) * __z.imag(), __x));
+ }
+
+#if _GLIBCXX_USE_C99_COMPLEX_TR1
+ inline __complex__ float
+ __complex_atanh(__complex__ float __z)
+ { return __builtin_catanhf(__z); }
+
+ inline __complex__ double
+ __complex_atanh(__complex__ double __z)
+ { return __builtin_catanh(__z); }
+
+ inline __complex__ long double
+ __complex_atanh(const __complex__ long double& __z)
+ { return __builtin_catanhl(__z); }
+
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ atanh(const std::complex<_Tp>& __z)
+ { return __complex_atanh(__z.__rep()); }
+#else
+ /// atanh(__z) [8.1.7].
+ // Effects: Behaves the same as C99 function catanh, defined
+ // in subclause 7.3.6.3.
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ atanh(const std::complex<_Tp>& __z)
+ { return __complex_atanh(__z); }
+#endif
+
+ template<typename _Tp>
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ inline _Tp
+#else
+ inline std::complex<_Tp>
+#endif
+ /// fabs(__z) [8.1.8].
+ // Effects: Behaves the same as C99 function cabs, defined
+ // in subclause 7.3.8.1.
+ fabs(const std::complex<_Tp>& __z)
+ { return std::abs(__z); }
+
+ /// Additional overloads [8.1.9].
+#if (defined(_GLIBCXX_INCLUDE_AS_CXX0X) \
+ || (defined(_GLIBCXX_INCLUDE_AS_TR1) \
+ && !defined(__GXX_EXPERIMENTAL_CXX0X__)))
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ arg(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return std::arg(std::complex<__type>(__x));
+ }
+
+ template<typename _Tp>
+ inline std::complex<typename __gnu_cxx::__promote<_Tp>::__type>
+ conj(_Tp __x)
+ { return __x; }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ imag(_Tp)
+ { return _Tp(); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ norm(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __type(__x) * __type(__x);
+ }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ real(_Tp __x)
+ { return __x; }
+
+#endif
+
+ template<typename _Tp, typename _Up>
+ inline std::complex<typename __gnu_cxx::__promote_2<_Tp, _Up>::__type>
+ pow(const std::complex<_Tp>& __x, const _Up& __y)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+ return std::pow(std::complex<__type>(__x), __type(__y));
+ }
+
+ template<typename _Tp, typename _Up>
+ inline std::complex<typename __gnu_cxx::__promote_2<_Tp, _Up>::__type>
+ pow(const _Tp& __x, const std::complex<_Up>& __y)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+ return std::pow(__type(__x), std::complex<__type>(__y));
+ }
+
+ template<typename _Tp, typename _Up>
+ inline std::complex<typename __gnu_cxx::__promote_2<_Tp, _Up>::__type>
+ pow(const std::complex<_Tp>& __x, const std::complex<_Up>& __y)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+ return std::pow(std::complex<__type>(__x),
+ std::complex<__type>(__y));
+ }
+
+ // @} group complex_numbers
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
diff --git a/i686-linux/include/c++/4.4.3/tr1_impl/cstdint b/i686-linux/include/c++/4.4.3/tr1_impl/cstdint
new file mode 100644
index 0000000..d140388
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1_impl/cstdint
@@ -0,0 +1,75 @@
+// TR1 cstdint -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/cstdint
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#if _GLIBCXX_USE_C99_STDINT_TR1
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+ using ::int8_t;
+ using ::int16_t;
+ using ::int32_t;
+ using ::int64_t;
+
+ using ::int_fast8_t;
+ using ::int_fast16_t;
+ using ::int_fast32_t;
+ using ::int_fast64_t;
+
+ using ::int_least8_t;
+ using ::int_least16_t;
+ using ::int_least32_t;
+ using ::int_least64_t;
+
+ using ::intmax_t;
+ using ::intptr_t;
+
+ using ::uint8_t;
+ using ::uint16_t;
+ using ::uint32_t;
+ using ::uint64_t;
+
+ using ::uint_fast8_t;
+ using ::uint_fast16_t;
+ using ::uint_fast32_t;
+ using ::uint_fast64_t;
+
+ using ::uint_least8_t;
+ using ::uint_least16_t;
+ using ::uint_least32_t;
+ using ::uint_least64_t;
+
+ using ::uintmax_t;
+ using ::uintptr_t;
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/tr1_impl/cstdio b/i686-linux/include/c++/4.4.3/tr1_impl/cstdio
new file mode 100644
index 0000000..8b100cc
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1_impl/cstdio
@@ -0,0 +1,44 @@
+// TR1 cstdio -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/cstdio
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+#if _GLIBCXX_USE_C99
+ using std::snprintf;
+ using std::vsnprintf;
+
+ using std::vfscanf;
+ using std::vscanf;
+ using std::vsscanf;
+#endif
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
diff --git a/i686-linux/include/c++/4.4.3/tr1_impl/cstdlib b/i686-linux/include/c++/4.4.3/tr1_impl/cstdlib
new file mode 100644
index 0000000..e9a590f
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1_impl/cstdlib
@@ -0,0 +1,65 @@
+// TR1 cstdlib -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/cstdlib
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#if _GLIBCXX_HOSTED
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+#if _GLIBCXX_USE_C99
+
+#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
+ // types
+ using std::lldiv_t;
+
+ // functions
+ using std::llabs;
+ using std::lldiv;
+#endif
+
+ using std::atoll;
+ using std::strtoll;
+ using std::strtoull;
+
+ using std::strtof;
+ using std::strtold;
+
+ // overloads
+ using std::abs;
+#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
+ using std::div;
+#endif
+
+#endif
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/tr1_impl/cwchar b/i686-linux/include/c++/4.4.3/tr1_impl/cwchar
new file mode 100644
index 0000000..2a9004d
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1_impl/cwchar
@@ -0,0 +1,58 @@
+// TR1 cwchar -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/cwchar
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#if _GLIBCXX_USE_WCHAR_T
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+#if _GLIBCXX_HAVE_WCSTOF
+ using std::wcstof;
+#endif
+#if _GLIBCXX_HAVE_VFWSCANF
+ using std::vfwscanf;
+#endif
+#if _GLIBCXX_HAVE_VSWSCANF
+ using std::vswscanf;
+#endif
+#if _GLIBCXX_HAVE_VWSCANF
+ using std::vwscanf;
+#endif
+
+#if _GLIBCXX_USE_C99
+ using std::wcstold;
+ using std::wcstoll;
+ using std::wcstoull;
+#endif
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/tr1_impl/cwctype b/i686-linux/include/c++/4.4.3/tr1_impl/cwctype
new file mode 100644
index 0000000..3135d36
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1_impl/cwctype
@@ -0,0 +1,43 @@
+// TR1 cwctype -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/cwctype
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#if _GLIBCXX_USE_WCHAR_T
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+#if _GLIBCXX_HAVE_ISWBLANK
+ using std::iswblank;
+#endif
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
+
+#endif
diff --git a/i686-linux/include/c++/4.4.3/tr1_impl/functional b/i686-linux/include/c++/4.4.3/tr1_impl/functional
new file mode 100644
index 0000000..7e6eaeb
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1_impl/functional
@@ -0,0 +1,2130 @@
+// TR1 functional header -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/functional
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+ template<typename _MemberPointer>
+ class _Mem_fn;
+
+ /**
+ * Actual implementation of _Has_result_type, which uses SFINAE to
+ * determine if the type _Tp has a publicly-accessible member type
+ * result_type.
+ */
+ template<typename _Tp>
+ class _Has_result_type_helper : __sfinae_types
+ {
+ template<typename _Up>
+ struct _Wrap_type
+ { };
+
+ template<typename _Up>
+ static __one __test(_Wrap_type<typename _Up::result_type>*);
+
+ template<typename _Up>
+ static __two __test(...);
+
+ public:
+ static const bool value = sizeof(__test<_Tp>(0)) == 1;
+ };
+
+ template<typename _Tp>
+ struct _Has_result_type
+ : integral_constant<bool,
+ _Has_result_type_helper<typename remove_cv<_Tp>::type>::value>
+ { };
+
+ /**
+ *
+ */
+ /// If we have found a result_type, extract it.
+ template<bool _Has_result_type, typename _Functor>
+ struct _Maybe_get_result_type
+ { };
+
+ template<typename _Functor>
+ struct _Maybe_get_result_type<true, _Functor>
+ {
+ typedef typename _Functor::result_type result_type;
+ };
+
+ /**
+ * Base class for any function object that has a weak result type, as
+ * defined in 3.3/3 of TR1.
+ */
+ template<typename _Functor>
+ struct _Weak_result_type_impl
+ : _Maybe_get_result_type<_Has_result_type<_Functor>::value, _Functor>
+ {
+ };
+
+ /// Retrieve the result type for a function type.
+ template<typename _Res, typename... _ArgTypes>
+ struct _Weak_result_type_impl<_Res(_ArgTypes...)>
+ {
+ typedef _Res result_type;
+ };
+
+ /// Retrieve the result type for a function reference.
+ template<typename _Res, typename... _ArgTypes>
+ struct _Weak_result_type_impl<_Res(&)(_ArgTypes...)>
+ {
+ typedef _Res result_type;
+ };
+
+ /// Retrieve the result type for a function pointer.
+ template<typename _Res, typename... _ArgTypes>
+ struct _Weak_result_type_impl<_Res(*)(_ArgTypes...)>
+ {
+ typedef _Res result_type;
+ };
+
+ /// Retrieve result type for a member function pointer.
+ template<typename _Res, typename _Class, typename... _ArgTypes>
+ struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes...)>
+ {
+ typedef _Res result_type;
+ };
+
+ /// Retrieve result type for a const member function pointer.
+ template<typename _Res, typename _Class, typename... _ArgTypes>
+ struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes...) const>
+ {
+ typedef _Res result_type;
+ };
+
+ /// Retrieve result type for a volatile member function pointer.
+ template<typename _Res, typename _Class, typename... _ArgTypes>
+ struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes...) volatile>
+ {
+ typedef _Res result_type;
+ };
+
+ /// Retrieve result type for a const volatile member function pointer.
+ template<typename _Res, typename _Class, typename... _ArgTypes>
+ struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes...)const volatile>
+ {
+ typedef _Res result_type;
+ };
+
+ /**
+ * Strip top-level cv-qualifiers from the function object and let
+ * _Weak_result_type_impl perform the real work.
+ */
+ template<typename _Functor>
+ struct _Weak_result_type
+ : _Weak_result_type_impl<typename remove_cv<_Functor>::type>
+ {
+ };
+
+ template<typename _Signature>
+ class result_of;
+
+ /**
+ * Actual implementation of result_of. When _Has_result_type is
+ * true, gets its result from _Weak_result_type. Otherwise, uses
+ * the function object's member template result to extract the
+ * result type.
+ */
+ template<bool _Has_result_type, typename _Signature>
+ struct _Result_of_impl;
+
+ // Handle member data pointers using _Mem_fn's logic
+ template<typename _Res, typename _Class, typename _T1>
+ struct _Result_of_impl<false, _Res _Class::*(_T1)>
+ {
+ typedef typename _Mem_fn<_Res _Class::*>
+ ::template _Result_type<_T1>::type type;
+ };
+
+ /**
+ * Determine whether we can determine a result type from @c Functor
+ * alone.
+ */
+ template<typename _Functor, typename... _ArgTypes>
+ class result_of<_Functor(_ArgTypes...)>
+ : public _Result_of_impl<
+ _Has_result_type<_Weak_result_type<_Functor> >::value,
+ _Functor(_ArgTypes...)>
+ {
+ };
+
+ /// We already know the result type for @c Functor; use it.
+ template<typename _Functor, typename... _ArgTypes>
+ struct _Result_of_impl<true, _Functor(_ArgTypes...)>
+ {
+ typedef typename _Weak_result_type<_Functor>::result_type type;
+ };
+
+ /**
+ * We need to compute the result type for this invocation the hard
+ * way.
+ */
+ template<typename _Functor, typename... _ArgTypes>
+ struct _Result_of_impl<false, _Functor(_ArgTypes...)>
+ {
+ typedef typename _Functor
+ ::template result<_Functor(_ArgTypes...)>::type type;
+ };
+
+ /**
+ * It is unsafe to access ::result when there are zero arguments, so we
+ * return @c void instead.
+ */
+ template<typename _Functor>
+ struct _Result_of_impl<false, _Functor()>
+ {
+ typedef void type;
+ };
+
+ /// Determines if the type _Tp derives from unary_function.
+ template<typename _Tp>
+ struct _Derives_from_unary_function : __sfinae_types
+ {
+ private:
+ template<typename _T1, typename _Res>
+ static __one __test(const volatile unary_function<_T1, _Res>*);
+
+ // It's tempting to change "..." to const volatile void*, but
+ // that fails when _Tp is a function type.
+ static __two __test(...);
+
+ public:
+ static const bool value = sizeof(__test((_Tp*)0)) == 1;
+ };
+
+ /// Determines if the type _Tp derives from binary_function.
+ template<typename _Tp>
+ struct _Derives_from_binary_function : __sfinae_types
+ {
+ private:
+ template<typename _T1, typename _T2, typename _Res>
+ static __one __test(const volatile binary_function<_T1, _T2, _Res>*);
+
+ // It's tempting to change "..." to const volatile void*, but
+ // that fails when _Tp is a function type.
+ static __two __test(...);
+
+ public:
+ static const bool value = sizeof(__test((_Tp*)0)) == 1;
+ };
+
+ /// Turns a function type into a function pointer type
+ template<typename _Tp, bool _IsFunctionType = is_function<_Tp>::value>
+ struct _Function_to_function_pointer
+ {
+ typedef _Tp type;
+ };
+
+ template<typename _Tp>
+ struct _Function_to_function_pointer<_Tp, true>
+ {
+ typedef _Tp* type;
+ };
+
+ /**
+ * Invoke a function object, which may be either a member pointer or a
+ * function object. The first parameter will tell which.
+ */
+ template<typename _Functor, typename... _Args>
+ inline
+ typename __gnu_cxx::__enable_if<
+ (!is_member_pointer<_Functor>::value
+ && !is_function<_Functor>::value
+ && !is_function<typename remove_pointer<_Functor>::type>::value),
+ typename result_of<_Functor(_Args...)>::type
+ >::__type
+ __invoke(_Functor& __f, _Args&... __args)
+ {
+ return __f(__args...);
+ }
+
+ template<typename _Functor, typename... _Args>
+ inline
+ typename __gnu_cxx::__enable_if<
+ (is_member_pointer<_Functor>::value
+ && !is_function<_Functor>::value
+ && !is_function<typename remove_pointer<_Functor>::type>::value),
+ typename result_of<_Functor(_Args...)>::type
+ >::__type
+ __invoke(_Functor& __f, _Args&... __args)
+ {
+ return mem_fn(__f)(__args...);
+ }
+
+ // To pick up function references (that will become function pointers)
+ template<typename _Functor, typename... _Args>
+ inline
+ typename __gnu_cxx::__enable_if<
+ (is_pointer<_Functor>::value
+ && is_function<typename remove_pointer<_Functor>::type>::value),
+ typename result_of<_Functor(_Args...)>::type
+ >::__type
+ __invoke(_Functor __f, _Args&... __args)
+ {
+ return __f(__args...);
+ }
+
+ /**
+ * Knowing which of unary_function and binary_function _Tp derives
+ * from, derives from the same and ensures that reference_wrapper
+ * will have a weak result type. See cases below.
+ */
+ template<bool _Unary, bool _Binary, typename _Tp>
+ struct _Reference_wrapper_base_impl;
+
+ // Not a unary_function or binary_function, so try a weak result type.
+ template<typename _Tp>
+ struct _Reference_wrapper_base_impl<false, false, _Tp>
+ : _Weak_result_type<_Tp>
+ { };
+
+ // unary_function but not binary_function
+ template<typename _Tp>
+ struct _Reference_wrapper_base_impl<true, false, _Tp>
+ : unary_function<typename _Tp::argument_type,
+ typename _Tp::result_type>
+ { };
+
+ // binary_function but not unary_function
+ template<typename _Tp>
+ struct _Reference_wrapper_base_impl<false, true, _Tp>
+ : binary_function<typename _Tp::first_argument_type,
+ typename _Tp::second_argument_type,
+ typename _Tp::result_type>
+ { };
+
+ // Both unary_function and binary_function. Import result_type to
+ // avoid conflicts.
+ template<typename _Tp>
+ struct _Reference_wrapper_base_impl<true, true, _Tp>
+ : unary_function<typename _Tp::argument_type,
+ typename _Tp::result_type>,
+ binary_function<typename _Tp::first_argument_type,
+ typename _Tp::second_argument_type,
+ typename _Tp::result_type>
+ {
+ typedef typename _Tp::result_type result_type;
+ };
+
+ /**
+ * Derives from unary_function or binary_function when it
+ * can. Specializations handle all of the easy cases. The primary
+ * template determines what to do with a class type, which may
+ * derive from both unary_function and binary_function.
+ */
+ template<typename _Tp>
+ struct _Reference_wrapper_base
+ : _Reference_wrapper_base_impl<
+ _Derives_from_unary_function<_Tp>::value,
+ _Derives_from_binary_function<_Tp>::value,
+ _Tp>
+ { };
+
+ // - a function type (unary)
+ template<typename _Res, typename _T1>
+ struct _Reference_wrapper_base<_Res(_T1)>
+ : unary_function<_T1, _Res>
+ { };
+
+ // - a function type (binary)
+ template<typename _Res, typename _T1, typename _T2>
+ struct _Reference_wrapper_base<_Res(_T1, _T2)>
+ : binary_function<_T1, _T2, _Res>
+ { };
+
+ // - a function pointer type (unary)
+ template<typename _Res, typename _T1>
+ struct _Reference_wrapper_base<_Res(*)(_T1)>
+ : unary_function<_T1, _Res>
+ { };
+
+ // - a function pointer type (binary)
+ template<typename _Res, typename _T1, typename _T2>
+ struct _Reference_wrapper_base<_Res(*)(_T1, _T2)>
+ : binary_function<_T1, _T2, _Res>
+ { };
+
+ // - a pointer to member function type (unary, no qualifiers)
+ template<typename _Res, typename _T1>
+ struct _Reference_wrapper_base<_Res (_T1::*)()>
+ : unary_function<_T1*, _Res>
+ { };
+
+ // - a pointer to member function type (binary, no qualifiers)
+ template<typename _Res, typename _T1, typename _T2>
+ struct _Reference_wrapper_base<_Res (_T1::*)(_T2)>
+ : binary_function<_T1*, _T2, _Res>
+ { };
+
+ // - a pointer to member function type (unary, const)
+ template<typename _Res, typename _T1>
+ struct _Reference_wrapper_base<_Res (_T1::*)() const>
+ : unary_function<const _T1*, _Res>
+ { };
+
+ // - a pointer to member function type (binary, const)
+ template<typename _Res, typename _T1, typename _T2>
+ struct _Reference_wrapper_base<_Res (_T1::*)(_T2) const>
+ : binary_function<const _T1*, _T2, _Res>
+ { };
+
+ // - a pointer to member function type (unary, volatile)
+ template<typename _Res, typename _T1>
+ struct _Reference_wrapper_base<_Res (_T1::*)() volatile>
+ : unary_function<volatile _T1*, _Res>
+ { };
+
+ // - a pointer to member function type (binary, volatile)
+ template<typename _Res, typename _T1, typename _T2>
+ struct _Reference_wrapper_base<_Res (_T1::*)(_T2) volatile>
+ : binary_function<volatile _T1*, _T2, _Res>
+ { };
+
+ // - a pointer to member function type (unary, const volatile)
+ template<typename _Res, typename _T1>
+ struct _Reference_wrapper_base<_Res (_T1::*)() const volatile>
+ : unary_function<const volatile _T1*, _Res>
+ { };
+
+ // - a pointer to member function type (binary, const volatile)
+ template<typename _Res, typename _T1, typename _T2>
+ struct _Reference_wrapper_base<_Res (_T1::*)(_T2) const volatile>
+ : binary_function<const volatile _T1*, _T2, _Res>
+ { };
+
+ /// reference_wrapper
+ template<typename _Tp>
+ class reference_wrapper
+ : public _Reference_wrapper_base<typename remove_cv<_Tp>::type>
+ {
+ // If _Tp is a function type, we can't form result_of<_Tp(...)>,
+ // so turn it into a function pointer type.
+ typedef typename _Function_to_function_pointer<_Tp>::type
+ _M_func_type;
+
+ _Tp* _M_data;
+ public:
+ typedef _Tp type;
+
+ explicit
+ reference_wrapper(_Tp& __indata): _M_data(&__indata)
+ { }
+
+ reference_wrapper(const reference_wrapper<_Tp>& __inref):
+ _M_data(__inref._M_data)
+ { }
+
+ reference_wrapper&
+ operator=(const reference_wrapper<_Tp>& __inref)
+ {
+ _M_data = __inref._M_data;
+ return *this;
+ }
+
+ operator _Tp&() const
+ { return this->get(); }
+
+ _Tp&
+ get() const
+ { return *_M_data; }
+
+ template<typename... _Args>
+ typename result_of<_M_func_type(_Args...)>::type
+ operator()(_Args&... __args) const
+ {
+ return __invoke(get(), __args...);
+ }
+ };
+
+
+ // Denotes a reference should be taken to a variable.
+ template<typename _Tp>
+ inline reference_wrapper<_Tp>
+ ref(_Tp& __t)
+ { return reference_wrapper<_Tp>(__t); }
+
+ // Denotes a const reference should be taken to a variable.
+ template<typename _Tp>
+ inline reference_wrapper<const _Tp>
+ cref(const _Tp& __t)
+ { return reference_wrapper<const _Tp>(__t); }
+
+ template<typename _Tp>
+ inline reference_wrapper<_Tp>
+ ref(reference_wrapper<_Tp> __t)
+ { return ref(__t.get()); }
+
+ template<typename _Tp>
+ inline reference_wrapper<const _Tp>
+ cref(reference_wrapper<_Tp> __t)
+ { return cref(__t.get()); }
+
+ template<typename _Tp, bool>
+ struct _Mem_fn_const_or_non
+ {
+ typedef const _Tp& type;
+ };
+
+ template<typename _Tp>
+ struct _Mem_fn_const_or_non<_Tp, false>
+ {
+ typedef _Tp& type;
+ };
+
+ /**
+ * Derives from @c unary_function or @c binary_function, or perhaps
+ * nothing, depending on the number of arguments provided. The
+ * primary template is the basis case, which derives nothing.
+ */
+ template<typename _Res, typename... _ArgTypes>
+ struct _Maybe_unary_or_binary_function { };
+
+ /// Derives from @c unary_function, as appropriate.
+ template<typename _Res, typename _T1>
+ struct _Maybe_unary_or_binary_function<_Res, _T1>
+ : std::unary_function<_T1, _Res> { };
+
+ /// Derives from @c binary_function, as appropriate.
+ template<typename _Res, typename _T1, typename _T2>
+ struct _Maybe_unary_or_binary_function<_Res, _T1, _T2>
+ : std::binary_function<_T1, _T2, _Res> { };
+
+ /// Implementation of @c mem_fn for member function pointers.
+ template<typename _Res, typename _Class, typename... _ArgTypes>
+ class _Mem_fn<_Res (_Class::*)(_ArgTypes...)>
+ : public _Maybe_unary_or_binary_function<_Res, _Class*, _ArgTypes...>
+ {
+ typedef _Res (_Class::*_Functor)(_ArgTypes...);
+
+ template<typename _Tp>
+ _Res
+ _M_call(_Tp& __object, const volatile _Class *,
+ _ArgTypes... __args) const
+ { return (__object.*__pmf)(__args...); }
+
+ template<typename _Tp>
+ _Res
+ _M_call(_Tp& __ptr, const volatile void *, _ArgTypes... __args) const
+ { return ((*__ptr).*__pmf)(__args...); }
+
+ public:
+ typedef _Res result_type;
+
+ explicit _Mem_fn(_Functor __pmf) : __pmf(__pmf) { }
+
+ // Handle objects
+ _Res
+ operator()(_Class& __object, _ArgTypes... __args) const
+ { return (__object.*__pmf)(__args...); }
+
+ // Handle pointers
+ _Res
+ operator()(_Class* __object, _ArgTypes... __args) const
+ { return (__object->*__pmf)(__args...); }
+
+ // Handle smart pointers, references and pointers to derived
+ template<typename _Tp>
+ _Res
+ operator()(_Tp& __object, _ArgTypes... __args) const
+ { return _M_call(__object, &__object, __args...); }
+
+ private:
+ _Functor __pmf;
+ };
+
+ /// Implementation of @c mem_fn for const member function pointers.
+ template<typename _Res, typename _Class, typename... _ArgTypes>
+ class _Mem_fn<_Res (_Class::*)(_ArgTypes...) const>
+ : public _Maybe_unary_or_binary_function<_Res, const _Class*,
+ _ArgTypes...>
+ {
+ typedef _Res (_Class::*_Functor)(_ArgTypes...) const;
+
+ template<typename _Tp>
+ _Res
+ _M_call(_Tp& __object, const volatile _Class *,
+ _ArgTypes... __args) const
+ { return (__object.*__pmf)(__args...); }
+
+ template<typename _Tp>
+ _Res
+ _M_call(_Tp& __ptr, const volatile void *, _ArgTypes... __args) const
+ { return ((*__ptr).*__pmf)(__args...); }
+
+ public:
+ typedef _Res result_type;
+
+ explicit _Mem_fn(_Functor __pmf) : __pmf(__pmf) { }
+
+ // Handle objects
+ _Res
+ operator()(const _Class& __object, _ArgTypes... __args) const
+ { return (__object.*__pmf)(__args...); }
+
+ // Handle pointers
+ _Res
+ operator()(const _Class* __object, _ArgTypes... __args) const
+ { return (__object->*__pmf)(__args...); }
+
+ // Handle smart pointers, references and pointers to derived
+ template<typename _Tp>
+ _Res operator()(_Tp& __object, _ArgTypes... __args) const
+ { return _M_call(__object, &__object, __args...); }
+
+ private:
+ _Functor __pmf;
+ };
+
+ /// Implementation of @c mem_fn for volatile member function pointers.
+ template<typename _Res, typename _Class, typename... _ArgTypes>
+ class _Mem_fn<_Res (_Class::*)(_ArgTypes...) volatile>
+ : public _Maybe_unary_or_binary_function<_Res, volatile _Class*,
+ _ArgTypes...>
+ {
+ typedef _Res (_Class::*_Functor)(_ArgTypes...) volatile;
+
+ template<typename _Tp>
+ _Res
+ _M_call(_Tp& __object, const volatile _Class *,
+ _ArgTypes... __args) const
+ { return (__object.*__pmf)(__args...); }
+
+ template<typename _Tp>
+ _Res
+ _M_call(_Tp& __ptr, const volatile void *, _ArgTypes... __args) const
+ { return ((*__ptr).*__pmf)(__args...); }
+
+ public:
+ typedef _Res result_type;
+
+ explicit _Mem_fn(_Functor __pmf) : __pmf(__pmf) { }
+
+ // Handle objects
+ _Res
+ operator()(volatile _Class& __object, _ArgTypes... __args) const
+ { return (__object.*__pmf)(__args...); }
+
+ // Handle pointers
+ _Res
+ operator()(volatile _Class* __object, _ArgTypes... __args) const
+ { return (__object->*__pmf)(__args...); }
+
+ // Handle smart pointers, references and pointers to derived
+ template<typename _Tp>
+ _Res
+ operator()(_Tp& __object, _ArgTypes... __args) const
+ { return _M_call(__object, &__object, __args...); }
+
+ private:
+ _Functor __pmf;
+ };
+
+ /// Implementation of @c mem_fn for const volatile member function pointers.
+ template<typename _Res, typename _Class, typename... _ArgTypes>
+ class _Mem_fn<_Res (_Class::*)(_ArgTypes...) const volatile>
+ : public _Maybe_unary_or_binary_function<_Res, const volatile _Class*,
+ _ArgTypes...>
+ {
+ typedef _Res (_Class::*_Functor)(_ArgTypes...) const volatile;
+
+ template<typename _Tp>
+ _Res
+ _M_call(_Tp& __object, const volatile _Class *,
+ _ArgTypes... __args) const
+ { return (__object.*__pmf)(__args...); }
+
+ template<typename _Tp>
+ _Res
+ _M_call(_Tp& __ptr, const volatile void *, _ArgTypes... __args) const
+ { return ((*__ptr).*__pmf)(__args...); }
+
+ public:
+ typedef _Res result_type;
+
+ explicit _Mem_fn(_Functor __pmf) : __pmf(__pmf) { }
+
+ // Handle objects
+ _Res
+ operator()(const volatile _Class& __object, _ArgTypes... __args) const
+ { return (__object.*__pmf)(__args...); }
+
+ // Handle pointers
+ _Res
+ operator()(const volatile _Class* __object, _ArgTypes... __args) const
+ { return (__object->*__pmf)(__args...); }
+
+ // Handle smart pointers, references and pointers to derived
+ template<typename _Tp>
+ _Res operator()(_Tp& __object, _ArgTypes... __args) const
+ { return _M_call(__object, &__object, __args...); }
+
+ private:
+ _Functor __pmf;
+ };
+
+
+ template<typename _Res, typename _Class>
+ class _Mem_fn<_Res _Class::*>
+ {
+ // This bit of genius is due to Peter Dimov, improved slightly by
+ // Douglas Gregor.
+ template<typename _Tp>
+ _Res&
+ _M_call(_Tp& __object, _Class *) const
+ { return __object.*__pm; }
+
+ template<typename _Tp, typename _Up>
+ _Res&
+ _M_call(_Tp& __object, _Up * const *) const
+ { return (*__object).*__pm; }
+
+ template<typename _Tp, typename _Up>
+ const _Res&
+ _M_call(_Tp& __object, const _Up * const *) const
+ { return (*__object).*__pm; }
+
+ template<typename _Tp>
+ const _Res&
+ _M_call(_Tp& __object, const _Class *) const
+ { return __object.*__pm; }
+
+ template<typename _Tp>
+ const _Res&
+ _M_call(_Tp& __ptr, const volatile void*) const
+ { return (*__ptr).*__pm; }
+
+ template<typename _Tp> static _Tp& __get_ref();
+
+ template<typename _Tp>
+ static __sfinae_types::__one __check_const(_Tp&, _Class*);
+ template<typename _Tp, typename _Up>
+ static __sfinae_types::__one __check_const(_Tp&, _Up * const *);
+ template<typename _Tp, typename _Up>
+ static __sfinae_types::__two __check_const(_Tp&, const _Up * const *);
+ template<typename _Tp>
+ static __sfinae_types::__two __check_const(_Tp&, const _Class*);
+ template<typename _Tp>
+ static __sfinae_types::__two __check_const(_Tp&, const volatile void*);
+
+ public:
+ template<typename _Tp>
+ struct _Result_type
+ : _Mem_fn_const_or_non<_Res,
+ (sizeof(__sfinae_types::__two)
+ == sizeof(__check_const<_Tp>(__get_ref<_Tp>(), (_Tp*)0)))>
+ { };
+
+ template<typename _Signature>
+ struct result;
+
+ template<typename _CVMem, typename _Tp>
+ struct result<_CVMem(_Tp)>
+ : public _Result_type<_Tp> { };
+
+ template<typename _CVMem, typename _Tp>
+ struct result<_CVMem(_Tp&)>
+ : public _Result_type<_Tp> { };
+
+ explicit
+ _Mem_fn(_Res _Class::*__pm) : __pm(__pm) { }
+
+ // Handle objects
+ _Res&
+ operator()(_Class& __object) const
+ { return __object.*__pm; }
+
+ const _Res&
+ operator()(const _Class& __object) const
+ { return __object.*__pm; }
+
+ // Handle pointers
+ _Res&
+ operator()(_Class* __object) const
+ { return __object->*__pm; }
+
+ const _Res&
+ operator()(const _Class* __object) const
+ { return __object->*__pm; }
+
+ // Handle smart pointers and derived
+ template<typename _Tp>
+ typename _Result_type<_Tp>::type
+ operator()(_Tp& __unknown) const
+ { return _M_call(__unknown, &__unknown); }
+
+ private:
+ _Res _Class::*__pm;
+ };
+
+ /**
+ * @brief Returns a function object that forwards to the member
+ * pointer @a pm.
+ */
+ template<typename _Tp, typename _Class>
+ inline _Mem_fn<_Tp _Class::*>
+ mem_fn(_Tp _Class::* __pm)
+ {
+ return _Mem_fn<_Tp _Class::*>(__pm);
+ }
+
+ /**
+ * @brief Determines if the given type _Tp is a function object
+ * should be treated as a subexpression when evaluating calls to
+ * function objects returned by bind(). [TR1 3.6.1]
+ */
+ template<typename _Tp>
+ struct is_bind_expression
+ { static const bool value = false; };
+
+ template<typename _Tp>
+ const bool is_bind_expression<_Tp>::value;
+
+ /**
+ * @brief Determines if the given type _Tp is a placeholder in a
+ * bind() expression and, if so, which placeholder it is. [TR1 3.6.2]
+ */
+ template<typename _Tp>
+ struct is_placeholder
+ { static const int value = 0; };
+
+ template<typename _Tp>
+ const int is_placeholder<_Tp>::value;
+
+ /// The type of placeholder objects defined by libstdc++.
+ template<int _Num> struct _Placeholder { };
+
+ /** @namespace std::placeholders
+ * @brief ISO C++ 0x entities sub namespace for functional.
+ *
+ * Define a large number of placeholders. There is no way to
+ * simplify this with variadic templates, because we're introducing
+ * unique names for each.
+ */
+ namespace placeholders
+ {
+ namespace
+ {
+ _Placeholder<1> _1;
+ _Placeholder<2> _2;
+ _Placeholder<3> _3;
+ _Placeholder<4> _4;
+ _Placeholder<5> _5;
+ _Placeholder<6> _6;
+ _Placeholder<7> _7;
+ _Placeholder<8> _8;
+ _Placeholder<9> _9;
+ _Placeholder<10> _10;
+ _Placeholder<11> _11;
+ _Placeholder<12> _12;
+ _Placeholder<13> _13;
+ _Placeholder<14> _14;
+ _Placeholder<15> _15;
+ _Placeholder<16> _16;
+ _Placeholder<17> _17;
+ _Placeholder<18> _18;
+ _Placeholder<19> _19;
+ _Placeholder<20> _20;
+ _Placeholder<21> _21;
+ _Placeholder<22> _22;
+ _Placeholder<23> _23;
+ _Placeholder<24> _24;
+ _Placeholder<25> _25;
+ _Placeholder<26> _26;
+ _Placeholder<27> _27;
+ _Placeholder<28> _28;
+ _Placeholder<29> _29;
+ }
+ }
+
+ /**
+ * Partial specialization of is_placeholder that provides the placeholder
+ * number for the placeholder objects defined by libstdc++.
+ */
+ template<int _Num>
+ struct is_placeholder<_Placeholder<_Num> >
+ { static const int value = _Num; };
+
+ template<int _Num>
+ const int is_placeholder<_Placeholder<_Num> >::value;
+
+ /**
+ * Stores a tuple of indices. Used by bind() to extract the elements
+ * in a tuple.
+ */
+ template<int... _Indexes>
+ struct _Index_tuple { };
+
+ /// Builds an _Index_tuple<0, 1, 2, ..., _Num-1>.
+ template<std::size_t _Num, typename _Tuple = _Index_tuple<> >
+ struct _Build_index_tuple;
+
+ template<std::size_t _Num, int... _Indexes>
+ struct _Build_index_tuple<_Num, _Index_tuple<_Indexes...> >
+ : _Build_index_tuple<_Num - 1,
+ _Index_tuple<_Indexes..., sizeof...(_Indexes)> >
+ {
+ };
+
+ template<int... _Indexes>
+ struct _Build_index_tuple<0, _Index_tuple<_Indexes...> >
+ {
+ typedef _Index_tuple<_Indexes...> __type;
+ };
+
+ /**
+ * Used by _Safe_tuple_element to indicate that there is no tuple
+ * element at this position.
+ */
+ struct _No_tuple_element;
+
+ /**
+ * Implementation helper for _Safe_tuple_element. This primary
+ * template handles the case where it is safe to use @c
+ * tuple_element.
+ */
+ template<int __i, typename _Tuple, bool _IsSafe>
+ struct _Safe_tuple_element_impl
+ : tuple_element<__i, _Tuple> { };
+
+ /**
+ * Implementation helper for _Safe_tuple_element. This partial
+ * specialization handles the case where it is not safe to use @c
+ * tuple_element. We just return @c _No_tuple_element.
+ */
+ template<int __i, typename _Tuple>
+ struct _Safe_tuple_element_impl<__i, _Tuple, false>
+ {
+ typedef _No_tuple_element type;
+ };
+
+ /**
+ * Like tuple_element, but returns @c _No_tuple_element when
+ * tuple_element would return an error.
+ */
+ template<int __i, typename _Tuple>
+ struct _Safe_tuple_element
+ : _Safe_tuple_element_impl<__i, _Tuple,
+ (__i >= 0 && __i < tuple_size<_Tuple>::value)>
+ {
+ };
+
+ /**
+ * Maps an argument to bind() into an actual argument to the bound
+ * function object [TR1 3.6.3/5]. Only the first parameter should
+ * be specified: the rest are used to determine among the various
+ * implementations. Note that, although this class is a function
+ * object, it isn't entirely normal because it takes only two
+ * parameters regardless of the number of parameters passed to the
+ * bind expression. The first parameter is the bound argument and
+ * the second parameter is a tuple containing references to the
+ * rest of the arguments.
+ */
+ template<typename _Arg,
+ bool _IsBindExp = is_bind_expression<_Arg>::value,
+ bool _IsPlaceholder = (is_placeholder<_Arg>::value > 0)>
+ class _Mu;
+
+ /**
+ * If the argument is reference_wrapper<_Tp>, returns the
+ * underlying reference. [TR1 3.6.3/5 bullet 1]
+ */
+ template<typename _Tp>
+ class _Mu<reference_wrapper<_Tp>, false, false>
+ {
+ public:
+ typedef _Tp& result_type;
+
+ /* Note: This won't actually work for const volatile
+ * reference_wrappers, because reference_wrapper::get() is const
+ * but not volatile-qualified. This might be a defect in the TR.
+ */
+ template<typename _CVRef, typename _Tuple>
+ result_type
+ operator()(_CVRef& __arg, const _Tuple&) const volatile
+ { return __arg.get(); }
+ };
+
+ /**
+ * If the argument is a bind expression, we invoke the underlying
+ * function object with the same cv-qualifiers as we are given and
+ * pass along all of our arguments (unwrapped). [TR1 3.6.3/5 bullet 2]
+ */
+ template<typename _Arg>
+ class _Mu<_Arg, true, false>
+ {
+ public:
+ template<typename _Signature> class result;
+
+ // Determine the result type when we pass the arguments along. This
+ // involves passing along the cv-qualifiers placed on _Mu and
+ // unwrapping the argument bundle.
+ template<typename _CVMu, typename _CVArg, typename... _Args>
+ class result<_CVMu(_CVArg, tuple<_Args...>)>
+ : public result_of<_CVArg(_Args...)> { };
+
+ template<typename _CVArg, typename... _Args>
+ typename result_of<_CVArg(_Args...)>::type
+ operator()(_CVArg& __arg,
+ const tuple<_Args...>& __tuple) const volatile
+ {
+ // Construct an index tuple and forward to __call
+ typedef typename _Build_index_tuple<sizeof...(_Args)>::__type
+ _Indexes;
+ return this->__call(__arg, __tuple, _Indexes());
+ }
+
+ private:
+ // Invokes the underlying function object __arg by unpacking all
+ // of the arguments in the tuple.
+ template<typename _CVArg, typename... _Args, int... _Indexes>
+ typename result_of<_CVArg(_Args...)>::type
+ __call(_CVArg& __arg, const tuple<_Args...>& __tuple,
+ const _Index_tuple<_Indexes...>&) const volatile
+ {
+ return __arg(_GLIBCXX_TR1 get<_Indexes>(__tuple)...);
+ }
+ };
+
+ /**
+ * If the argument is a placeholder for the Nth argument, returns
+ * a reference to the Nth argument to the bind function object.
+ * [TR1 3.6.3/5 bullet 3]
+ */
+ template<typename _Arg>
+ class _Mu<_Arg, false, true>
+ {
+ public:
+ template<typename _Signature> class result;
+
+ template<typename _CVMu, typename _CVArg, typename _Tuple>
+ class result<_CVMu(_CVArg, _Tuple)>
+ {
+ // Add a reference, if it hasn't already been done for us.
+ // This allows us to be a little bit sloppy in constructing
+ // the tuple that we pass to result_of<...>.
+ typedef typename _Safe_tuple_element<(is_placeholder<_Arg>::value
+ - 1), _Tuple>::type
+ __base_type;
+
+ public:
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ typedef typename add_lvalue_reference<__base_type>::type type;
+#else
+ typedef typename add_reference<__base_type>::type type;
+#endif
+ };
+
+ template<typename _Tuple>
+ typename result<_Mu(_Arg, _Tuple)>::type
+ operator()(const volatile _Arg&, const _Tuple& __tuple) const volatile
+ {
+ return ::std::_GLIBCXX_TR1 get<(is_placeholder<_Arg>::value
+ - 1)>(__tuple);
+ }
+ };
+
+ /**
+ * If the argument is just a value, returns a reference to that
+ * value. The cv-qualifiers on the reference are the same as the
+ * cv-qualifiers on the _Mu object. [TR1 3.6.3/5 bullet 4]
+ */
+ template<typename _Arg>
+ class _Mu<_Arg, false, false>
+ {
+ public:
+ template<typename _Signature> struct result;
+
+ template<typename _CVMu, typename _CVArg, typename _Tuple>
+ struct result<_CVMu(_CVArg, _Tuple)>
+ {
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ typedef typename add_lvalue_reference<_CVArg>::type type;
+#else
+ typedef typename add_reference<_CVArg>::type type;
+#endif
+ };
+
+ // Pick up the cv-qualifiers of the argument
+ template<typename _CVArg, typename _Tuple>
+ _CVArg&
+ operator()(_CVArg& __arg, const _Tuple&) const volatile
+ { return __arg; }
+ };
+
+ /**
+ * Maps member pointers into instances of _Mem_fn but leaves all
+ * other function objects untouched. Used by tr1::bind(). The
+ * primary template handles the non--member-pointer case.
+ */
+ template<typename _Tp>
+ struct _Maybe_wrap_member_pointer
+ {
+ typedef _Tp type;
+
+ static const _Tp&
+ __do_wrap(const _Tp& __x)
+ { return __x; }
+ };
+
+ /**
+ * Maps member pointers into instances of _Mem_fn but leaves all
+ * other function objects untouched. Used by tr1::bind(). This
+ * partial specialization handles the member pointer case.
+ */
+ template<typename _Tp, typename _Class>
+ struct _Maybe_wrap_member_pointer<_Tp _Class::*>
+ {
+ typedef _Mem_fn<_Tp _Class::*> type;
+
+ static type
+ __do_wrap(_Tp _Class::* __pm)
+ { return type(__pm); }
+ };
+
+ /// Type of the function object returned from bind().
+ template<typename _Signature>
+ struct _Bind;
+
+ template<typename _Functor, typename... _Bound_args>
+ class _Bind<_Functor(_Bound_args...)>
+ : public _Weak_result_type<_Functor>
+ {
+ typedef _Bind __self_type;
+ typedef typename _Build_index_tuple<sizeof...(_Bound_args)>::__type
+ _Bound_indexes;
+
+ _Functor _M_f;
+ tuple<_Bound_args...> _M_bound_args;
+
+ // Call unqualified
+ template<typename... _Args, int... _Indexes>
+ typename result_of<
+ _Functor(typename result_of<_Mu<_Bound_args>
+ (_Bound_args, tuple<_Args...>)>::type...)
+ >::type
+ __call(const tuple<_Args...>& __args, _Index_tuple<_Indexes...>)
+ {
+ return _M_f(_Mu<_Bound_args>()
+ (_GLIBCXX_TR1 get<_Indexes>(_M_bound_args), __args)...);
+ }
+
+ // Call as const
+ template<typename... _Args, int... _Indexes>
+ typename result_of<
+ const _Functor(typename result_of<_Mu<_Bound_args>
+ (const _Bound_args, tuple<_Args...>)
+ >::type...)>::type
+ __call(const tuple<_Args...>& __args, _Index_tuple<_Indexes...>) const
+ {
+ return _M_f(_Mu<_Bound_args>()
+ (_GLIBCXX_TR1 get<_Indexes>(_M_bound_args), __args)...);
+ }
+
+ // Call as volatile
+ template<typename... _Args, int... _Indexes>
+ typename result_of<
+ volatile _Functor(typename result_of<_Mu<_Bound_args>
+ (volatile _Bound_args, tuple<_Args...>)
+ >::type...)>::type
+ __call(const tuple<_Args...>& __args,
+ _Index_tuple<_Indexes...>) volatile
+ {
+ return _M_f(_Mu<_Bound_args>()
+ (_GLIBCXX_TR1 get<_Indexes>(_M_bound_args), __args)...);
+ }
+
+ // Call as const volatile
+ template<typename... _Args, int... _Indexes>
+ typename result_of<
+ const volatile _Functor(typename result_of<_Mu<_Bound_args>
+ (const volatile _Bound_args,
+ tuple<_Args...>)
+ >::type...)>::type
+ __call(const tuple<_Args...>& __args,
+ _Index_tuple<_Indexes...>) const volatile
+ {
+ return _M_f(_Mu<_Bound_args>()
+ (_GLIBCXX_TR1 get<_Indexes>(_M_bound_args), __args)...);
+ }
+
+ public:
+ explicit _Bind(_Functor __f, _Bound_args... __bound_args)
+ : _M_f(__f), _M_bound_args(__bound_args...) { }
+
+ // Call unqualified
+ template<typename... _Args>
+ typename result_of<
+ _Functor(typename result_of<_Mu<_Bound_args>
+ (_Bound_args, tuple<_Args...>)>::type...)
+ >::type
+ operator()(_Args&... __args)
+ {
+ return this->__call(_GLIBCXX_TR1 tie(__args...), _Bound_indexes());
+ }
+
+ // Call as const
+ template<typename... _Args>
+ typename result_of<
+ const _Functor(typename result_of<_Mu<_Bound_args>
+ (const _Bound_args, tuple<_Args...>)>::type...)
+ >::type
+ operator()(_Args&... __args) const
+ {
+ return this->__call(_GLIBCXX_TR1 tie(__args...), _Bound_indexes());
+ }
+
+
+ // Call as volatile
+ template<typename... _Args>
+ typename result_of<
+ volatile _Functor(typename result_of<_Mu<_Bound_args>
+ (volatile _Bound_args, tuple<_Args...>)>::type...)
+ >::type
+ operator()(_Args&... __args) volatile
+ {
+ return this->__call(_GLIBCXX_TR1 tie(__args...), _Bound_indexes());
+ }
+
+
+ // Call as const volatile
+ template<typename... _Args>
+ typename result_of<
+ const volatile _Functor(typename result_of<_Mu<_Bound_args>
+ (const volatile _Bound_args,
+ tuple<_Args...>)>::type...)
+ >::type
+ operator()(_Args&... __args) const volatile
+ {
+ return this->__call(_GLIBCXX_TR1 tie(__args...), _Bound_indexes());
+ }
+ };
+
+ /// Type of the function object returned from bind<R>().
+ template<typename _Result, typename _Signature>
+ struct _Bind_result;
+
+ template<typename _Result, typename _Functor, typename... _Bound_args>
+ class _Bind_result<_Result, _Functor(_Bound_args...)>
+ {
+ typedef _Bind_result __self_type;
+ typedef typename _Build_index_tuple<sizeof...(_Bound_args)>::__type
+ _Bound_indexes;
+
+ _Functor _M_f;
+ tuple<_Bound_args...> _M_bound_args;
+
+ // Call unqualified
+ template<typename... _Args, int... _Indexes>
+ _Result
+ __call(const tuple<_Args...>& __args, _Index_tuple<_Indexes...>)
+ {
+ return _M_f(_Mu<_Bound_args>()
+ (_GLIBCXX_TR1 get<_Indexes>(_M_bound_args), __args)...);
+ }
+
+ // Call as const
+ template<typename... _Args, int... _Indexes>
+ _Result
+ __call(const tuple<_Args...>& __args, _Index_tuple<_Indexes...>) const
+ {
+ return _M_f(_Mu<_Bound_args>()
+ (_GLIBCXX_TR1 get<_Indexes>(_M_bound_args), __args)...);
+ }
+
+ // Call as volatile
+ template<typename... _Args, int... _Indexes>
+ _Result
+ __call(const tuple<_Args...>& __args,
+ _Index_tuple<_Indexes...>) volatile
+ {
+ return _M_f(_Mu<_Bound_args>()
+ (_GLIBCXX_TR1 get<_Indexes>(_M_bound_args), __args)...);
+ }
+
+ // Call as const volatile
+ template<typename... _Args, int... _Indexes>
+ _Result
+ __call(const tuple<_Args...>& __args,
+ _Index_tuple<_Indexes...>) const volatile
+ {
+ return _M_f(_Mu<_Bound_args>()
+ (_GLIBCXX_TR1 get<_Indexes>(_M_bound_args), __args)...);
+ }
+
+ public:
+ typedef _Result result_type;
+
+ explicit
+ _Bind_result(_Functor __f, _Bound_args... __bound_args)
+ : _M_f(__f), _M_bound_args(__bound_args...) { }
+
+ // Call unqualified
+ template<typename... _Args>
+ result_type
+ operator()(_Args&... __args)
+ {
+ return this->__call(_GLIBCXX_TR1 tie(__args...), _Bound_indexes());
+ }
+
+ // Call as const
+ template<typename... _Args>
+ result_type
+ operator()(_Args&... __args) const
+ {
+ return this->__call(_GLIBCXX_TR1 tie(__args...), _Bound_indexes());
+ }
+
+ // Call as volatile
+ template<typename... _Args>
+ result_type
+ operator()(_Args&... __args) volatile
+ {
+ return this->__call(_GLIBCXX_TR1 tie(__args...), _Bound_indexes());
+ }
+
+ // Call as const volatile
+ template<typename... _Args>
+ result_type
+ operator()(_Args&... __args) const volatile
+ {
+ return this->__call(_GLIBCXX_TR1 tie(__args...), _Bound_indexes());
+ }
+ };
+
+ /// Class template _Bind is always a bind expression.
+ template<typename _Signature>
+ struct is_bind_expression<_Bind<_Signature> >
+ { static const bool value = true; };
+
+ template<typename _Signature>
+ const bool is_bind_expression<_Bind<_Signature> >::value;
+
+ /// Class template _Bind_result is always a bind expression.
+ template<typename _Result, typename _Signature>
+ struct is_bind_expression<_Bind_result<_Result, _Signature> >
+ { static const bool value = true; };
+
+ template<typename _Result, typename _Signature>
+ const bool is_bind_expression<_Bind_result<_Result, _Signature> >::value;
+
+ /// bind
+ template<typename _Functor, typename... _ArgTypes>
+ inline
+ _Bind<typename _Maybe_wrap_member_pointer<_Functor>::type(_ArgTypes...)>
+ bind(_Functor __f, _ArgTypes... __args)
+ {
+ typedef _Maybe_wrap_member_pointer<_Functor> __maybe_type;
+ typedef typename __maybe_type::type __functor_type;
+ typedef _Bind<__functor_type(_ArgTypes...)> __result_type;
+ return __result_type(__maybe_type::__do_wrap(__f), __args...);
+ }
+
+ template<typename _Result, typename _Functor, typename... _ArgTypes>
+ inline
+ _Bind_result<_Result,
+ typename _Maybe_wrap_member_pointer<_Functor>::type
+ (_ArgTypes...)>
+ bind(_Functor __f, _ArgTypes... __args)
+ {
+ typedef _Maybe_wrap_member_pointer<_Functor> __maybe_type;
+ typedef typename __maybe_type::type __functor_type;
+ typedef _Bind_result<_Result, __functor_type(_ArgTypes...)>
+ __result_type;
+ return __result_type(__maybe_type::__do_wrap(__f), __args...);
+ }
+
+ /**
+ * @brief Exception class thrown when class template function's
+ * operator() is called with an empty target.
+ *
+ */
+ class bad_function_call : public std::exception { };
+
+ /**
+ * The integral constant expression 0 can be converted into a
+ * pointer to this type. It is used by the function template to
+ * accept NULL pointers.
+ */
+ struct _M_clear_type;
+
+ /**
+ * Trait identifying "location-invariant" types, meaning that the
+ * address of the object (or any of its members) will not escape.
+ * Also implies a trivial copy constructor and assignment operator.
+ */
+ template<typename _Tp>
+ struct __is_location_invariant
+ : integral_constant<bool,
+ (is_pointer<_Tp>::value
+ || is_member_pointer<_Tp>::value)>
+ {
+ };
+
+ class _Undefined_class;
+
+ union _Nocopy_types
+ {
+ void* _M_object;
+ const void* _M_const_object;
+ void (*_M_function_pointer)();
+ void (_Undefined_class::*_M_member_pointer)();
+ };
+
+ union _Any_data
+ {
+ void* _M_access() { return &_M_pod_data[0]; }
+ const void* _M_access() const { return &_M_pod_data[0]; }
+
+ template<typename _Tp>
+ _Tp&
+ _M_access()
+ { return *static_cast<_Tp*>(_M_access()); }
+
+ template<typename _Tp>
+ const _Tp&
+ _M_access() const
+ { return *static_cast<const _Tp*>(_M_access()); }
+
+ _Nocopy_types _M_unused;
+ char _M_pod_data[sizeof(_Nocopy_types)];
+ };
+
+ enum _Manager_operation
+ {
+ __get_type_info,
+ __get_functor_ptr,
+ __clone_functor,
+ __destroy_functor
+ };
+
+ // Simple type wrapper that helps avoid annoying const problems
+ // when casting between void pointers and pointers-to-pointers.
+ template<typename _Tp>
+ struct _Simple_type_wrapper
+ {
+ _Simple_type_wrapper(_Tp __value) : __value(__value) { }
+
+ _Tp __value;
+ };
+
+ template<typename _Tp>
+ struct __is_location_invariant<_Simple_type_wrapper<_Tp> >
+ : __is_location_invariant<_Tp>
+ {
+ };
+
+ // Converts a reference to a function object into a callable
+ // function object.
+ template<typename _Functor>
+ inline _Functor&
+ __callable_functor(_Functor& __f)
+ { return __f; }
+
+ template<typename _Member, typename _Class>
+ inline _Mem_fn<_Member _Class::*>
+ __callable_functor(_Member _Class::* &__p)
+ { return mem_fn(__p); }
+
+ template<typename _Member, typename _Class>
+ inline _Mem_fn<_Member _Class::*>
+ __callable_functor(_Member _Class::* const &__p)
+ { return mem_fn(__p); }
+
+ template<typename _Signature>
+ class function;
+
+ /// Base class of all polymorphic function object wrappers.
+ class _Function_base
+ {
+ public:
+ static const std::size_t _M_max_size = sizeof(_Nocopy_types);
+ static const std::size_t _M_max_align = __alignof__(_Nocopy_types);
+
+ template<typename _Functor>
+ class _Base_manager
+ {
+ protected:
+ static const bool __stored_locally =
+ (__is_location_invariant<_Functor>::value
+ && sizeof(_Functor) <= _M_max_size
+ && __alignof__(_Functor) <= _M_max_align
+ && (_M_max_align % __alignof__(_Functor) == 0));
+
+ typedef integral_constant<bool, __stored_locally> _Local_storage;
+
+ // Retrieve a pointer to the function object
+ static _Functor*
+ _M_get_pointer(const _Any_data& __source)
+ {
+ const _Functor* __ptr =
+ __stored_locally? &__source._M_access<_Functor>()
+ /* have stored a pointer */ : __source._M_access<_Functor*>();
+ return const_cast<_Functor*>(__ptr);
+ }
+
+ // Clone a location-invariant function object that fits within
+ // an _Any_data structure.
+ static void
+ _M_clone(_Any_data& __dest, const _Any_data& __source, true_type)
+ {
+ new (__dest._M_access()) _Functor(__source._M_access<_Functor>());
+ }
+
+ // Clone a function object that is not location-invariant or
+ // that cannot fit into an _Any_data structure.
+ static void
+ _M_clone(_Any_data& __dest, const _Any_data& __source, false_type)
+ {
+ __dest._M_access<_Functor*>() =
+ new _Functor(*__source._M_access<_Functor*>());
+ }
+
+ // Destroying a location-invariant object may still require
+ // destruction.
+ static void
+ _M_destroy(_Any_data& __victim, true_type)
+ {
+ __victim._M_access<_Functor>().~_Functor();
+ }
+
+ // Destroying an object located on the heap.
+ static void
+ _M_destroy(_Any_data& __victim, false_type)
+ {
+ delete __victim._M_access<_Functor*>();
+ }
+
+ public:
+ static bool
+ _M_manager(_Any_data& __dest, const _Any_data& __source,
+ _Manager_operation __op)
+ {
+ switch (__op)
+ {
+#ifdef __GXX_RTTI
+ case __get_type_info:
+ __dest._M_access<const type_info*>() = &typeid(_Functor);
+ break;
+#endif
+ case __get_functor_ptr:
+ __dest._M_access<_Functor*>() = _M_get_pointer(__source);
+ break;
+
+ case __clone_functor:
+ _M_clone(__dest, __source, _Local_storage());
+ break;
+
+ case __destroy_functor:
+ _M_destroy(__dest, _Local_storage());
+ break;
+ }
+ return false;
+ }
+
+ static void
+ _M_init_functor(_Any_data& __functor, const _Functor& __f)
+ { _M_init_functor(__functor, __f, _Local_storage()); }
+
+ template<typename _Signature>
+ static bool
+ _M_not_empty_function(const function<_Signature>& __f)
+ { return __f; }
+
+ template<typename _Tp>
+ static bool
+ _M_not_empty_function(const _Tp*& __fp)
+ { return __fp; }
+
+ template<typename _Class, typename _Tp>
+ static bool
+ _M_not_empty_function(_Tp _Class::* const& __mp)
+ { return __mp; }
+
+ template<typename _Tp>
+ static bool
+ _M_not_empty_function(const _Tp&)
+ { return true; }
+
+ private:
+ static void
+ _M_init_functor(_Any_data& __functor, const _Functor& __f, true_type)
+ { new (__functor._M_access()) _Functor(__f); }
+
+ static void
+ _M_init_functor(_Any_data& __functor, const _Functor& __f, false_type)
+ { __functor._M_access<_Functor*>() = new _Functor(__f); }
+ };
+
+ template<typename _Functor>
+ class _Ref_manager : public _Base_manager<_Functor*>
+ {
+ typedef _Function_base::_Base_manager<_Functor*> _Base;
+
+ public:
+ static bool
+ _M_manager(_Any_data& __dest, const _Any_data& __source,
+ _Manager_operation __op)
+ {
+ switch (__op)
+ {
+#ifdef __GXX_RTTI
+ case __get_type_info:
+ __dest._M_access<const type_info*>() = &typeid(_Functor);
+ break;
+#endif
+ case __get_functor_ptr:
+ __dest._M_access<_Functor*>() = *_Base::_M_get_pointer(__source);
+ return is_const<_Functor>::value;
+ break;
+
+ default:
+ _Base::_M_manager(__dest, __source, __op);
+ }
+ return false;
+ }
+
+ static void
+ _M_init_functor(_Any_data& __functor, reference_wrapper<_Functor> __f)
+ {
+ // TBD: Use address_of function instead.
+ _Base::_M_init_functor(__functor, &__f.get());
+ }
+ };
+
+ _Function_base() : _M_manager(0) { }
+
+ ~_Function_base()
+ {
+ if (_M_manager)
+ _M_manager(_M_functor, _M_functor, __destroy_functor);
+ }
+
+
+ bool _M_empty() const { return !_M_manager; }
+
+ typedef bool (*_Manager_type)(_Any_data&, const _Any_data&,
+ _Manager_operation);
+
+ _Any_data _M_functor;
+ _Manager_type _M_manager;
+ };
+
+ template<typename _Signature, typename _Functor>
+ class _Function_handler;
+
+ template<typename _Res, typename _Functor, typename... _ArgTypes>
+ class _Function_handler<_Res(_ArgTypes...), _Functor>
+ : public _Function_base::_Base_manager<_Functor>
+ {
+ typedef _Function_base::_Base_manager<_Functor> _Base;
+
+ public:
+ static _Res
+ _M_invoke(const _Any_data& __functor, _ArgTypes... __args)
+ {
+ return (*_Base::_M_get_pointer(__functor))(__args...);
+ }
+ };
+
+ template<typename _Functor, typename... _ArgTypes>
+ class _Function_handler<void(_ArgTypes...), _Functor>
+ : public _Function_base::_Base_manager<_Functor>
+ {
+ typedef _Function_base::_Base_manager<_Functor> _Base;
+
+ public:
+ static void
+ _M_invoke(const _Any_data& __functor, _ArgTypes... __args)
+ {
+ (*_Base::_M_get_pointer(__functor))(__args...);
+ }
+ };
+
+ template<typename _Res, typename _Functor, typename... _ArgTypes>
+ class _Function_handler<_Res(_ArgTypes...), reference_wrapper<_Functor> >
+ : public _Function_base::_Ref_manager<_Functor>
+ {
+ typedef _Function_base::_Ref_manager<_Functor> _Base;
+
+ public:
+ static _Res
+ _M_invoke(const _Any_data& __functor, _ArgTypes... __args)
+ {
+ return
+ __callable_functor(**_Base::_M_get_pointer(__functor))(__args...);
+ }
+ };
+
+ template<typename _Functor, typename... _ArgTypes>
+ class _Function_handler<void(_ArgTypes...), reference_wrapper<_Functor> >
+ : public _Function_base::_Ref_manager<_Functor>
+ {
+ typedef _Function_base::_Ref_manager<_Functor> _Base;
+
+ public:
+ static void
+ _M_invoke(const _Any_data& __functor, _ArgTypes... __args)
+ {
+ __callable_functor(**_Base::_M_get_pointer(__functor))(__args...);
+ }
+ };
+
+ template<typename _Class, typename _Member, typename _Res,
+ typename... _ArgTypes>
+ class _Function_handler<_Res(_ArgTypes...), _Member _Class::*>
+ : public _Function_handler<void(_ArgTypes...), _Member _Class::*>
+ {
+ typedef _Function_handler<void(_ArgTypes...), _Member _Class::*>
+ _Base;
+
+ public:
+ static _Res
+ _M_invoke(const _Any_data& __functor, _ArgTypes... __args)
+ {
+ return _GLIBCXX_TR1
+ mem_fn(_Base::_M_get_pointer(__functor)->__value)(__args...);
+ }
+ };
+
+ template<typename _Class, typename _Member, typename... _ArgTypes>
+ class _Function_handler<void(_ArgTypes...), _Member _Class::*>
+ : public _Function_base::_Base_manager<
+ _Simple_type_wrapper< _Member _Class::* > >
+ {
+ typedef _Member _Class::* _Functor;
+ typedef _Simple_type_wrapper<_Functor> _Wrapper;
+ typedef _Function_base::_Base_manager<_Wrapper> _Base;
+
+ public:
+ static bool
+ _M_manager(_Any_data& __dest, const _Any_data& __source,
+ _Manager_operation __op)
+ {
+ switch (__op)
+ {
+#ifdef __GXX_RTTI
+ case __get_type_info:
+ __dest._M_access<const type_info*>() = &typeid(_Functor);
+ break;
+#endif
+ case __get_functor_ptr:
+ __dest._M_access<_Functor*>() =
+ &_Base::_M_get_pointer(__source)->__value;
+ break;
+
+ default:
+ _Base::_M_manager(__dest, __source, __op);
+ }
+ return false;
+ }
+
+ static void
+ _M_invoke(const _Any_data& __functor, _ArgTypes... __args)
+ {
+ _GLIBCXX_TR1
+ mem_fn(_Base::_M_get_pointer(__functor)->__value)(__args...);
+ }
+ };
+
+ /// class function
+ template<typename _Res, typename... _ArgTypes>
+ class function<_Res(_ArgTypes...)>
+ : public _Maybe_unary_or_binary_function<_Res, _ArgTypes...>,
+ private _Function_base
+ {
+ /// This class is used to implement the safe_bool idiom.
+ struct _Hidden_type
+ {
+ _Hidden_type* _M_bool;
+ };
+
+ /// This typedef is used to implement the safe_bool idiom.
+ typedef _Hidden_type* _Hidden_type::* _Safe_bool;
+
+ typedef _Res _Signature_type(_ArgTypes...);
+
+ struct _Useless { };
+
+ public:
+ typedef _Res result_type;
+
+ // [3.7.2.1] construct/copy/destroy
+
+ /**
+ * @brief Default construct creates an empty function call wrapper.
+ * @post @c !(bool)*this
+ */
+ function() : _Function_base() { }
+
+ /**
+ * @brief Default construct creates an empty function call wrapper.
+ * @post @c !(bool)*this
+ */
+ function(_M_clear_type*) : _Function_base() { }
+
+ /**
+ * @brief %Function copy constructor.
+ * @param x A %function object with identical call signature.
+ * @pre @c (bool)*this == (bool)x
+ *
+ * The newly-created %function contains a copy of the target of @a
+ * x (if it has one).
+ */
+ function(const function& __x);
+
+ /**
+ * @brief Builds a %function that targets a copy of the incoming
+ * function object.
+ * @param f A %function object that is callable with parameters of
+ * type @c T1, @c T2, ..., @c TN and returns a value convertible
+ * to @c Res.
+ *
+ * The newly-created %function object will target a copy of @a
+ * f. If @a f is @c reference_wrapper<F>, then this function
+ * object will contain a reference to the function object @c
+ * f.get(). If @a f is a NULL function pointer or NULL
+ * pointer-to-member, the newly-created object will be empty.
+ *
+ * If @a f is a non-NULL function pointer or an object of type @c
+ * reference_wrapper<F>, this function will not throw.
+ */
+ template<typename _Functor>
+ function(_Functor __f,
+ typename __gnu_cxx::__enable_if<
+ !is_integral<_Functor>::value, _Useless>::__type
+ = _Useless());
+
+ /**
+ * @brief %Function assignment operator.
+ * @param x A %function with identical call signature.
+ * @post @c (bool)*this == (bool)x
+ * @returns @c *this
+ *
+ * The target of @a x is copied to @c *this. If @a x has no
+ * target, then @c *this will be empty.
+ *
+ * If @a x targets a function pointer or a reference to a function
+ * object, then this operation will not throw an exception.
+ */
+ function&
+ operator=(const function& __x)
+ {
+ function(__x).swap(*this);
+ return *this;
+ }
+
+ /**
+ * @brief %Function assignment to zero.
+ * @post @c !(bool)*this
+ * @returns @c *this
+ *
+ * The target of @a *this is deallocated, leaving it empty.
+ */
+ function&
+ operator=(_M_clear_type*)
+ {
+ if (_M_manager)
+ {
+ _M_manager(_M_functor, _M_functor, __destroy_functor);
+ _M_manager = 0;
+ _M_invoker = 0;
+ }
+ return *this;
+ }
+
+ /**
+ * @brief %Function assignment to a new target.
+ * @param f A %function object that is callable with parameters of
+ * type @c T1, @c T2, ..., @c TN and returns a value convertible
+ * to @c Res.
+ * @return @c *this
+ *
+ * This %function object wrapper will target a copy of @a
+ * f. If @a f is @c reference_wrapper<F>, then this function
+ * object will contain a reference to the function object @c
+ * f.get(). If @a f is a NULL function pointer or NULL
+ * pointer-to-member, @c this object will be empty.
+ *
+ * If @a f is a non-NULL function pointer or an object of type @c
+ * reference_wrapper<F>, this function will not throw.
+ */
+ template<typename _Functor>
+ typename __gnu_cxx::__enable_if<!is_integral<_Functor>::value,
+ function&>::__type
+ operator=(_Functor __f)
+ {
+ function(__f).swap(*this);
+ return *this;
+ }
+
+ // [3.7.2.2] function modifiers
+
+ /**
+ * @brief Swap the targets of two %function objects.
+ * @param f A %function with identical call signature.
+ *
+ * Swap the targets of @c this function object and @a f. This
+ * function will not throw an exception.
+ */
+ void swap(function& __x)
+ {
+ _Any_data __old_functor = _M_functor;
+ _M_functor = __x._M_functor;
+ __x._M_functor = __old_functor;
+ _Manager_type __old_manager = _M_manager;
+ _M_manager = __x._M_manager;
+ __x._M_manager = __old_manager;
+ _Invoker_type __old_invoker = _M_invoker;
+ _M_invoker = __x._M_invoker;
+ __x._M_invoker = __old_invoker;
+ }
+
+ // [3.7.2.3] function capacity
+
+ /**
+ * @brief Determine if the %function wrapper has a target.
+ *
+ * @return @c true when this %function object contains a target,
+ * or @c false when it is empty.
+ *
+ * This function will not throw an exception.
+ */
+ operator _Safe_bool() const
+ {
+ if (_M_empty())
+ return 0;
+ else
+ return &_Hidden_type::_M_bool;
+ }
+
+ // [3.7.2.4] function invocation
+
+ /**
+ * @brief Invokes the function targeted by @c *this.
+ * @returns the result of the target.
+ * @throws bad_function_call when @c !(bool)*this
+ *
+ * The function call operator invokes the target function object
+ * stored by @c this.
+ */
+ _Res operator()(_ArgTypes... __args) const;
+
+#ifdef __GXX_RTTI
+ // [3.7.2.5] function target access
+ /**
+ * @brief Determine the type of the target of this function object
+ * wrapper.
+ *
+ * @returns the type identifier of the target function object, or
+ * @c typeid(void) if @c !(bool)*this.
+ *
+ * This function will not throw an exception.
+ */
+ const type_info& target_type() const;
+
+ /**
+ * @brief Access the stored target function object.
+ *
+ * @return Returns a pointer to the stored target function object,
+ * if @c typeid(Functor).equals(target_type()); otherwise, a NULL
+ * pointer.
+ *
+ * This function will not throw an exception.
+ */
+ template<typename _Functor> _Functor* target();
+
+ /// @overload
+ template<typename _Functor> const _Functor* target() const;
+#endif
+
+ private:
+ // [3.7.2.6] undefined operators
+ template<typename _Function>
+ void operator==(const function<_Function>&) const;
+ template<typename _Function>
+ void operator!=(const function<_Function>&) const;
+
+ typedef _Res (*_Invoker_type)(const _Any_data&, _ArgTypes...);
+ _Invoker_type _M_invoker;
+ };
+
+ template<typename _Res, typename... _ArgTypes>
+ function<_Res(_ArgTypes...)>::
+ function(const function& __x)
+ : _Function_base()
+ {
+ if (__x)
+ {
+ _M_invoker = __x._M_invoker;
+ _M_manager = __x._M_manager;
+ __x._M_manager(_M_functor, __x._M_functor, __clone_functor);
+ }
+ }
+
+ template<typename _Res, typename... _ArgTypes>
+ template<typename _Functor>
+ function<_Res(_ArgTypes...)>::
+ function(_Functor __f,
+ typename __gnu_cxx::__enable_if<
+ !is_integral<_Functor>::value, _Useless>::__type)
+ : _Function_base()
+ {
+ typedef _Function_handler<_Signature_type, _Functor> _My_handler;
+
+ if (_My_handler::_M_not_empty_function(__f))
+ {
+ _M_invoker = &_My_handler::_M_invoke;
+ _M_manager = &_My_handler::_M_manager;
+ _My_handler::_M_init_functor(_M_functor, __f);
+ }
+ }
+
+ template<typename _Res, typename... _ArgTypes>
+ _Res
+ function<_Res(_ArgTypes...)>::
+ operator()(_ArgTypes... __args) const
+ {
+ if (_M_empty())
+ {
+#if __EXCEPTIONS
+ throw bad_function_call();
+#else
+ __builtin_abort();
+#endif
+ }
+ return _M_invoker(_M_functor, __args...);
+ }
+
+#ifdef __GXX_RTTI
+ template<typename _Res, typename... _ArgTypes>
+ const type_info&
+ function<_Res(_ArgTypes...)>::
+ target_type() const
+ {
+ if (_M_manager)
+ {
+ _Any_data __typeinfo_result;
+ _M_manager(__typeinfo_result, _M_functor, __get_type_info);
+ return *__typeinfo_result._M_access<const type_info*>();
+ }
+ else
+ return typeid(void);
+ }
+
+ template<typename _Res, typename... _ArgTypes>
+ template<typename _Functor>
+ _Functor*
+ function<_Res(_ArgTypes...)>::
+ target()
+ {
+ if (typeid(_Functor) == target_type() && _M_manager)
+ {
+ _Any_data __ptr;
+ if (_M_manager(__ptr, _M_functor, __get_functor_ptr)
+ && !is_const<_Functor>::value)
+ return 0;
+ else
+ return __ptr._M_access<_Functor*>();
+ }
+ else
+ return 0;
+ }
+
+ template<typename _Res, typename... _ArgTypes>
+ template<typename _Functor>
+ const _Functor*
+ function<_Res(_ArgTypes...)>::
+ target() const
+ {
+ if (typeid(_Functor) == target_type() && _M_manager)
+ {
+ _Any_data __ptr;
+ _M_manager(__ptr, _M_functor, __get_functor_ptr);
+ return __ptr._M_access<const _Functor*>();
+ }
+ else
+ return 0;
+ }
+#endif
+
+ // [3.7.2.7] null pointer comparisons
+
+ /**
+ * @brief Compares a polymorphic function object wrapper against 0
+ * (the NULL pointer).
+ * @returns @c true if the wrapper has no target, @c false otherwise
+ *
+ * This function will not throw an exception.
+ */
+ template<typename _Signature>
+ inline bool
+ operator==(const function<_Signature>& __f, _M_clear_type*)
+ { return !__f; }
+
+ /// @overload
+ template<typename _Signature>
+ inline bool
+ operator==(_M_clear_type*, const function<_Signature>& __f)
+ { return !__f; }
+
+ /**
+ * @brief Compares a polymorphic function object wrapper against 0
+ * (the NULL pointer).
+ * @returns @c false if the wrapper has no target, @c true otherwise
+ *
+ * This function will not throw an exception.
+ */
+ template<typename _Signature>
+ inline bool
+ operator!=(const function<_Signature>& __f, _M_clear_type*)
+ { return __f; }
+
+ /// @overload
+ template<typename _Signature>
+ inline bool
+ operator!=(_M_clear_type*, const function<_Signature>& __f)
+ { return __f; }
+
+ // [3.7.2.8] specialized algorithms
+
+ /**
+ * @brief Swap the targets of two polymorphic function object wrappers.
+ *
+ * This function will not throw an exception.
+ */
+ template<typename _Signature>
+ inline void
+ swap(function<_Signature>& __x, function<_Signature>& __y)
+ { __x.swap(__y); }
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
diff --git a/i686-linux/include/c++/4.4.3/tr1_impl/functional_hash.h b/i686-linux/include/c++/4.4.3/tr1_impl/functional_hash.h
new file mode 100644
index 0000000..665168c
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1_impl/functional_hash.h
@@ -0,0 +1,183 @@
+// TR1 functional -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/functional_hash.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+ /// Class template hash.
+ // Declaration of default hash functor std::tr1::hash. The types for
+ // which std::tr1::hash<T> is well-defined is in clause 6.3.3. of the PDTR.
+ template<typename _Tp>
+ struct hash : public std::unary_function<_Tp, size_t>
+ {
+ size_t
+ operator()(_Tp __val) const;
+ };
+
+ /// Partial specializations for pointer types.
+ template<typename _Tp>
+ struct hash<_Tp*> : public std::unary_function<_Tp*, size_t>
+ {
+ size_t
+ operator()(_Tp* __p) const
+ { return reinterpret_cast<size_t>(__p); }
+ };
+
+ /// Explicit specializations for integer types.
+#define _TR1_hashtable_define_trivial_hash(_Tp) \
+ template<> \
+ inline size_t \
+ hash<_Tp>::operator()(_Tp __val) const \
+ { return static_cast<size_t>(__val); }
+
+ _TR1_hashtable_define_trivial_hash(bool);
+ _TR1_hashtable_define_trivial_hash(char);
+ _TR1_hashtable_define_trivial_hash(signed char);
+ _TR1_hashtable_define_trivial_hash(unsigned char);
+ _TR1_hashtable_define_trivial_hash(wchar_t);
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ _TR1_hashtable_define_trivial_hash(char16_t);
+ _TR1_hashtable_define_trivial_hash(char32_t);
+#endif
+ _TR1_hashtable_define_trivial_hash(short);
+ _TR1_hashtable_define_trivial_hash(int);
+ _TR1_hashtable_define_trivial_hash(long);
+ _TR1_hashtable_define_trivial_hash(long long);
+ _TR1_hashtable_define_trivial_hash(unsigned short);
+ _TR1_hashtable_define_trivial_hash(unsigned int);
+ _TR1_hashtable_define_trivial_hash(unsigned long);
+ _TR1_hashtable_define_trivial_hash(unsigned long long);
+
+#undef _TR1_hashtable_define_trivial_hash
+
+ // Fowler / Noll / Vo (FNV) Hash (type FNV-1a)
+ // (Used by the next specializations of std::tr1::hash.)
+
+ /// Dummy generic implementation (for sizeof(size_t) != 4, 8).
+ template<size_t = sizeof(size_t)>
+ struct _Fnv_hash
+ {
+ static size_t
+ hash(const char* __first, size_t __length)
+ {
+ size_t __result = 0;
+ for (; __length > 0; --__length)
+ __result = (__result * 131) + *__first++;
+ return __result;
+ }
+ };
+
+ template<>
+ struct _Fnv_hash<4>
+ {
+ static size_t
+ hash(const char* __first, size_t __length)
+ {
+ size_t __result = static_cast<size_t>(2166136261UL);
+ for (; __length > 0; --__length)
+ {
+ __result ^= static_cast<size_t>(*__first++);
+ __result *= static_cast<size_t>(16777619UL);
+ }
+ return __result;
+ }
+ };
+
+ template<>
+ struct _Fnv_hash<8>
+ {
+ static size_t
+ hash(const char* __first, size_t __length)
+ {
+ size_t __result =
+ static_cast<size_t>(14695981039346656037ULL);
+ for (; __length > 0; --__length)
+ {
+ __result ^= static_cast<size_t>(*__first++);
+ __result *= static_cast<size_t>(1099511628211ULL);
+ }
+ return __result;
+ }
+ };
+
+ /// Explicit specializations for float.
+ template<>
+ inline size_t
+ hash<float>::operator()(float __val) const
+ {
+ size_t __result = 0;
+
+ // 0 and -0 both hash to zero.
+ if (__val != 0.0f)
+ __result = _Fnv_hash<>::hash(reinterpret_cast<const char*>(&__val),
+ sizeof(__val));
+ return __result;
+ };
+
+ /// Explicit specializations for double.
+ template<>
+ inline size_t
+ hash<double>::operator()(double __val) const
+ {
+ size_t __result = 0;
+
+ // 0 and -0 both hash to zero.
+ if (__val != 0.0)
+ __result = _Fnv_hash<>::hash(reinterpret_cast<const char*>(&__val),
+ sizeof(__val));
+ return __result;
+ };
+
+ /// Explicit specializations for long double.
+ template<>
+ size_t
+ hash<long double>::operator()(long double __val) const;
+
+ /// Explicit specialization of member operator for non-builtin types.
+ template<>
+ size_t
+ hash<string>::operator()(string) const;
+
+ template<>
+ size_t
+ hash<const string&>::operator()(const string&) const;
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template<>
+ size_t
+ hash<wstring>::operator()(wstring) const;
+
+ template<>
+ size_t
+ hash<const wstring&>::operator()(const wstring&) const;
+#endif
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
diff --git a/i686-linux/include/c++/4.4.3/tr1_impl/hashtable b/i686-linux/include/c++/4.4.3/tr1_impl/hashtable
new file mode 100644
index 0000000..7c90983
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1_impl/hashtable
@@ -0,0 +1,1266 @@
+// Internal header for TR1 unordered_set and unordered_map -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/hashtable
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+// This header file defines std::tr1::hashtable, which is used to
+// implement std::tr1::unordered_set, std::tr1::unordered_map,
+// std::tr1::unordered_multiset, and std::tr1::unordered_multimap.
+// hashtable has many template parameters, partly to accommodate
+// the differences between those four classes and partly to
+// accommodate policy choices that go beyond TR1 specifications.
+
+// Class template hashtable attempts to encapsulate all reasonable
+// variation among hash tables that use chaining. It does not handle
+// open addressing.
+
+// References:
+// M. Austern, "A Proposal to Add Hash Tables to the Standard
+// Library (revision 4)," WG21 Document N1456=03-0039, 2003.
+// D. E. Knuth, The Art of Computer Programming, v. 3, Sorting and Searching.
+// A. Tavori and V. Dreizin, "Policy-Based Data Structures", 2004.
+// http://gcc.gnu.org/onlinedocs/libstdc++/ext/pb_ds/index.html
+
+#include <tr1_impl/hashtable_policy.h>
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+ // Class template _Hashtable, class definition.
+
+ // Meaning of class template _Hashtable's template parameters
+
+ // _Key and _Value: arbitrary CopyConstructible types.
+
+ // _Allocator: an allocator type ([lib.allocator.requirements]) whose
+ // value type is Value. As a conforming extension, we allow for
+ // value type != Value.
+
+ // _ExtractKey: function object that takes a object of type Value
+ // and returns a value of type _Key.
+
+ // _Equal: function object that takes two objects of type k and returns
+ // a bool-like value that is true if the two objects are considered equal.
+
+ // _H1: the hash function. A unary function object with argument type
+ // Key and result type size_t. Return values should be distributed
+ // over the entire range [0, numeric_limits<size_t>:::max()].
+
+ // _H2: the range-hashing function (in the terminology of Tavori and
+ // Dreizin). A binary function object whose argument types and result
+ // type are all size_t. Given arguments r and N, the return value is
+ // in the range [0, N).
+
+ // _Hash: the ranged hash function (Tavori and Dreizin). A binary function
+ // whose argument types are _Key and size_t and whose result type is
+ // size_t. Given arguments k and N, the return value is in the range
+ // [0, N). Default: hash(k, N) = h2(h1(k), N). If _Hash is anything other
+ // than the default, _H1 and _H2 are ignored.
+
+ // _RehashPolicy: Policy class with three members, all of which govern
+ // the bucket count. _M_next_bkt(n) returns a bucket count no smaller
+ // than n. _M_bkt_for_elements(n) returns a bucket count appropriate
+ // for an element count of n. _M_need_rehash(n_bkt, n_elt, n_ins)
+ // determines whether, if the current bucket count is n_bkt and the
+ // current element count is n_elt, we need to increase the bucket
+ // count. If so, returns make_pair(true, n), where n is the new
+ // bucket count. If not, returns make_pair(false, <anything>).
+
+ // ??? Right now it is hard-wired that the number of buckets never
+ // shrinks. Should we allow _RehashPolicy to change that?
+
+ // __cache_hash_code: bool. true if we store the value of the hash
+ // function along with the value. This is a time-space tradeoff.
+ // Storing it may improve lookup speed by reducing the number of times
+ // we need to call the Equal function.
+
+ // __constant_iterators: bool. true if iterator and const_iterator are
+ // both constant iterator types. This is true for unordered_set and
+ // unordered_multiset, false for unordered_map and unordered_multimap.
+
+ // __unique_keys: bool. true if the return value of _Hashtable::count(k)
+ // is always at most one, false if it may be an arbitrary number. This
+ // true for unordered_set and unordered_map, false for unordered_multiset
+ // and unordered_multimap.
+
+ template<typename _Key, typename _Value, typename _Allocator,
+ typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash,
+ typename _RehashPolicy,
+ bool __cache_hash_code,
+ bool __constant_iterators,
+ bool __unique_keys>
+ class _Hashtable
+ : public __detail::_Rehash_base<_RehashPolicy,
+ _Hashtable<_Key, _Value, _Allocator,
+ _ExtractKey,
+ _Equal, _H1, _H2, _Hash,
+ _RehashPolicy,
+ __cache_hash_code,
+ __constant_iterators,
+ __unique_keys> >,
+ public __detail::_Hash_code_base<_Key, _Value, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, __cache_hash_code>,
+ public __detail::_Map_base<_Key, _Value, _ExtractKey, __unique_keys,
+ _Hashtable<_Key, _Value, _Allocator,
+ _ExtractKey,
+ _Equal, _H1, _H2, _Hash,
+ _RehashPolicy,
+ __cache_hash_code,
+ __constant_iterators,
+ __unique_keys> >
+ {
+ public:
+ typedef _Allocator allocator_type;
+ typedef _Value value_type;
+ typedef _Key key_type;
+ typedef _Equal key_equal;
+ // mapped_type, if present, comes from _Map_base.
+ // hasher, if present, comes from _Hash_code_base.
+ typedef typename _Allocator::difference_type difference_type;
+ typedef typename _Allocator::size_type size_type;
+ typedef typename _Allocator::pointer pointer;
+ typedef typename _Allocator::const_pointer const_pointer;
+ typedef typename _Allocator::reference reference;
+ typedef typename _Allocator::const_reference const_reference;
+
+ typedef __detail::_Node_iterator<value_type, __constant_iterators,
+ __cache_hash_code>
+ local_iterator;
+ typedef __detail::_Node_const_iterator<value_type,
+ __constant_iterators,
+ __cache_hash_code>
+ const_local_iterator;
+
+ typedef __detail::_Hashtable_iterator<value_type, __constant_iterators,
+ __cache_hash_code>
+ iterator;
+ typedef __detail::_Hashtable_const_iterator<value_type,
+ __constant_iterators,
+ __cache_hash_code>
+ const_iterator;
+
+ template<typename _Key2, typename _Value2, typename _Ex2, bool __unique2,
+ typename _Hashtable2>
+ friend struct __detail::_Map_base;
+
+ private:
+ typedef __detail::_Hash_node<_Value, __cache_hash_code> _Node;
+ typedef typename _Allocator::template rebind<_Node>::other
+ _Node_allocator_type;
+ typedef typename _Allocator::template rebind<_Node*>::other
+ _Bucket_allocator_type;
+
+ typedef typename _Allocator::template rebind<_Value>::other
+ _Value_allocator_type;
+
+ _Node_allocator_type _M_node_allocator;
+ _Node** _M_buckets;
+ size_type _M_bucket_count;
+ size_type _M_element_count;
+ _RehashPolicy _M_rehash_policy;
+
+ _Node*
+ _M_allocate_node(const value_type& __v);
+
+ void
+ _M_deallocate_node(_Node* __n);
+
+ void
+ _M_deallocate_nodes(_Node**, size_type);
+
+ _Node**
+ _M_allocate_buckets(size_type __n);
+
+ void
+ _M_deallocate_buckets(_Node**, size_type __n);
+
+ public:
+ // Constructor, destructor, assignment, swap
+ _Hashtable(size_type __bucket_hint,
+ const _H1&, const _H2&, const _Hash&,
+ const _Equal&, const _ExtractKey&,
+ const allocator_type&);
+
+ template<typename _InputIterator>
+ _Hashtable(_InputIterator __first, _InputIterator __last,
+ size_type __bucket_hint,
+ const _H1&, const _H2&, const _Hash&,
+ const _Equal&, const _ExtractKey&,
+ const allocator_type&);
+
+ _Hashtable(const _Hashtable&);
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ _Hashtable(_Hashtable&&);
+#endif
+
+ _Hashtable&
+ operator=(const _Hashtable&);
+
+ ~_Hashtable();
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ void swap(_Hashtable&&);
+#else
+ void swap(_Hashtable&);
+#endif
+
+ // Basic container operations
+ iterator
+ begin()
+ {
+ iterator __i(_M_buckets);
+ if (!__i._M_cur_node)
+ __i._M_incr_bucket();
+ return __i;
+ }
+
+ const_iterator
+ begin() const
+ {
+ const_iterator __i(_M_buckets);
+ if (!__i._M_cur_node)
+ __i._M_incr_bucket();
+ return __i;
+ }
+
+ iterator
+ end()
+ { return iterator(_M_buckets + _M_bucket_count); }
+
+ const_iterator
+ end() const
+ { return const_iterator(_M_buckets + _M_bucket_count); }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ const_iterator
+ cbegin() const
+ {
+ const_iterator __i(_M_buckets);
+ if (!__i._M_cur_node)
+ __i._M_incr_bucket();
+ return __i;
+ }
+
+ const_iterator
+ cend() const
+ { return const_iterator(_M_buckets + _M_bucket_count); }
+#endif
+
+ size_type
+ size() const
+ { return _M_element_count; }
+
+ bool
+ empty() const
+ { return size() == 0; }
+
+ allocator_type
+ get_allocator() const
+ { return allocator_type(_M_node_allocator); }
+
+ _Value_allocator_type
+ _M_get_Value_allocator() const
+ { return _Value_allocator_type(_M_node_allocator); }
+
+ size_type
+ max_size() const
+ { return _M_node_allocator.max_size(); }
+
+ // Observers
+ key_equal
+ key_eq() const
+ { return this->_M_eq; }
+
+ // hash_function, if present, comes from _Hash_code_base.
+
+ // Bucket operations
+ size_type
+ bucket_count() const
+ { return _M_bucket_count; }
+
+ size_type
+ max_bucket_count() const
+ { return max_size(); }
+
+ size_type
+ bucket_size(size_type __n) const
+ { return std::distance(begin(__n), end(__n)); }
+
+ size_type
+ bucket(const key_type& __k) const
+ {
+ return this->_M_bucket_index(__k, this->_M_hash_code(__k),
+ bucket_count());
+ }
+
+ local_iterator
+ begin(size_type __n)
+ { return local_iterator(_M_buckets[__n]); }
+
+ local_iterator
+ end(size_type)
+ { return local_iterator(0); }
+
+ const_local_iterator
+ begin(size_type __n) const
+ { return const_local_iterator(_M_buckets[__n]); }
+
+ const_local_iterator
+ end(size_type) const
+ { return const_local_iterator(0); }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ // DR 691.
+ const_local_iterator
+ cbegin(size_type __n) const
+ { return const_local_iterator(_M_buckets[__n]); }
+
+ const_local_iterator
+ cend(size_type) const
+ { return const_local_iterator(0); }
+#endif
+
+ float
+ load_factor() const
+ {
+ return static_cast<float>(size()) / static_cast<float>(bucket_count());
+ }
+
+ // max_load_factor, if present, comes from _Rehash_base.
+
+ // Generalization of max_load_factor. Extension, not found in TR1. Only
+ // useful if _RehashPolicy is something other than the default.
+ const _RehashPolicy&
+ __rehash_policy() const
+ { return _M_rehash_policy; }
+
+ void
+ __rehash_policy(const _RehashPolicy&);
+
+ // Lookup.
+ iterator
+ find(const key_type& __k);
+
+ const_iterator
+ find(const key_type& __k) const;
+
+ size_type
+ count(const key_type& __k) const;
+
+ std::pair<iterator, iterator>
+ equal_range(const key_type& __k);
+
+ std::pair<const_iterator, const_iterator>
+ equal_range(const key_type& __k) const;
+
+ private: // Find, insert and erase helper functions
+ // ??? This dispatching is a workaround for the fact that we don't
+ // have partial specialization of member templates; it would be
+ // better to just specialize insert on __unique_keys. There may be a
+ // cleaner workaround.
+ typedef typename __gnu_cxx::__conditional_type<__unique_keys,
+ std::pair<iterator, bool>, iterator>::__type
+ _Insert_Return_Type;
+
+ typedef typename __gnu_cxx::__conditional_type<__unique_keys,
+ std::_Select1st<_Insert_Return_Type>,
+ std::_Identity<_Insert_Return_Type>
+ >::__type
+ _Insert_Conv_Type;
+
+ _Node*
+ _M_find_node(_Node*, const key_type&,
+ typename _Hashtable::_Hash_code_type) const;
+
+ iterator
+ _M_insert_bucket(const value_type&, size_type,
+ typename _Hashtable::_Hash_code_type);
+
+ std::pair<iterator, bool>
+ _M_insert(const value_type&, std::_GLIBCXX_TR1 true_type);
+
+ iterator
+ _M_insert(const value_type&, std::_GLIBCXX_TR1 false_type);
+
+ void
+ _M_erase_node(_Node*, _Node**);
+
+ public:
+ // Insert and erase
+ _Insert_Return_Type
+ insert(const value_type& __v)
+ { return _M_insert(__v, std::_GLIBCXX_TR1 integral_constant<bool,
+ __unique_keys>()); }
+
+ iterator
+ insert(iterator, const value_type& __v)
+ { return iterator(_Insert_Conv_Type()(this->insert(__v))); }
+
+ const_iterator
+ insert(const_iterator, const value_type& __v)
+ { return const_iterator(_Insert_Conv_Type()(this->insert(__v))); }
+
+ template<typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last);
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ void
+ insert(initializer_list<value_type> __l)
+ { this->insert(__l.begin(), __l.end()); }
+#endif
+
+ iterator
+ erase(iterator);
+
+ const_iterator
+ erase(const_iterator);
+
+ size_type
+ erase(const key_type&);
+
+ iterator
+ erase(iterator, iterator);
+
+ const_iterator
+ erase(const_iterator, const_iterator);
+
+ void
+ clear();
+
+ // Set number of buckets to be appropriate for container of n element.
+ void rehash(size_type __n);
+
+ private:
+ // Unconditionally change size of bucket array to n.
+ void _M_rehash(size_type __n);
+ };
+
+
+ // Definitions of class template _Hashtable's out-of-line member functions.
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ typename _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy,
+ __chc, __cit, __uk>::_Node*
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ _M_allocate_node(const value_type& __v)
+ {
+ _Node* __n = _M_node_allocator.allocate(1);
+ __try
+ {
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ _M_node_allocator.construct(__n, __v);
+#else
+ _M_get_Value_allocator().construct(&__n->_M_v, __v);
+#endif
+ __n->_M_next = 0;
+ return __n;
+ }
+ __catch(...)
+ {
+ _M_node_allocator.deallocate(__n, 1);
+ __throw_exception_again;
+ }
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ void
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ _M_deallocate_node(_Node* __n)
+ {
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ _M_node_allocator.destroy(__n);
+#else
+ _M_get_Value_allocator().destroy(&__n->_M_v);
+#endif
+ _M_node_allocator.deallocate(__n, 1);
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ void
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ _M_deallocate_nodes(_Node** __array, size_type __n)
+ {
+ for (size_type __i = 0; __i < __n; ++__i)
+ {
+ _Node* __p = __array[__i];
+ while (__p)
+ {
+ _Node* __tmp = __p;
+ __p = __p->_M_next;
+ _M_deallocate_node(__tmp);
+ }
+ __array[__i] = 0;
+ }
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ typename _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy,
+ __chc, __cit, __uk>::_Node**
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ _M_allocate_buckets(size_type __n)
+ {
+ _Bucket_allocator_type __alloc(_M_node_allocator);
+
+ // We allocate one extra bucket to hold a sentinel, an arbitrary
+ // non-null pointer. Iterator increment relies on this.
+ _Node** __p = __alloc.allocate(__n + 1);
+ std::fill(__p, __p + __n, (_Node*) 0);
+ __p[__n] = reinterpret_cast<_Node*>(0x1000);
+ return __p;
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ void
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ _M_deallocate_buckets(_Node** __p, size_type __n)
+ {
+ _Bucket_allocator_type __alloc(_M_node_allocator);
+ __alloc.deallocate(__p, __n + 1);
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ _Hashtable(size_type __bucket_hint,
+ const _H1& __h1, const _H2& __h2, const _Hash& __h,
+ const _Equal& __eq, const _ExtractKey& __exk,
+ const allocator_type& __a)
+ : __detail::_Rehash_base<_RehashPolicy, _Hashtable>(),
+ __detail::_Hash_code_base<_Key, _Value, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, __chc>(__exk, __eq,
+ __h1, __h2, __h),
+ __detail::_Map_base<_Key, _Value, _ExtractKey, __uk, _Hashtable>(),
+ _M_node_allocator(__a),
+ _M_bucket_count(0),
+ _M_element_count(0),
+ _M_rehash_policy()
+ {
+ _M_bucket_count = _M_rehash_policy._M_next_bkt(__bucket_hint);
+ _M_buckets = _M_allocate_buckets(_M_bucket_count);
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ template<typename _InputIterator>
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ _Hashtable(_InputIterator __f, _InputIterator __l,
+ size_type __bucket_hint,
+ const _H1& __h1, const _H2& __h2, const _Hash& __h,
+ const _Equal& __eq, const _ExtractKey& __exk,
+ const allocator_type& __a)
+ : __detail::_Rehash_base<_RehashPolicy, _Hashtable>(),
+ __detail::_Hash_code_base<_Key, _Value, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, __chc>(__exk, __eq,
+ __h1, __h2, __h),
+ __detail::_Map_base<_Key, _Value, _ExtractKey, __uk, _Hashtable>(),
+ _M_node_allocator(__a),
+ _M_bucket_count(0),
+ _M_element_count(0),
+ _M_rehash_policy()
+ {
+ _M_bucket_count = std::max(_M_rehash_policy._M_next_bkt(__bucket_hint),
+ _M_rehash_policy.
+ _M_bkt_for_elements(__detail::
+ __distance_fw(__f,
+ __l)));
+ _M_buckets = _M_allocate_buckets(_M_bucket_count);
+ __try
+ {
+ for (; __f != __l; ++__f)
+ this->insert(*__f);
+ }
+ __catch(...)
+ {
+ clear();
+ _M_deallocate_buckets(_M_buckets, _M_bucket_count);
+ __throw_exception_again;
+ }
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ _Hashtable(const _Hashtable& __ht)
+ : __detail::_Rehash_base<_RehashPolicy, _Hashtable>(__ht),
+ __detail::_Hash_code_base<_Key, _Value, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, __chc>(__ht),
+ __detail::_Map_base<_Key, _Value, _ExtractKey, __uk, _Hashtable>(__ht),
+ _M_node_allocator(__ht._M_node_allocator),
+ _M_bucket_count(__ht._M_bucket_count),
+ _M_element_count(__ht._M_element_count),
+ _M_rehash_policy(__ht._M_rehash_policy)
+ {
+ _M_buckets = _M_allocate_buckets(_M_bucket_count);
+ __try
+ {
+ for (size_type __i = 0; __i < __ht._M_bucket_count; ++__i)
+ {
+ _Node* __n = __ht._M_buckets[__i];
+ _Node** __tail = _M_buckets + __i;
+ while (__n)
+ {
+ *__tail = _M_allocate_node(__n->_M_v);
+ this->_M_copy_code(*__tail, __n);
+ __tail = &((*__tail)->_M_next);
+ __n = __n->_M_next;
+ }
+ }
+ }
+ __catch(...)
+ {
+ clear();
+ _M_deallocate_buckets(_M_buckets, _M_bucket_count);
+ __throw_exception_again;
+ }
+ }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ _Hashtable(_Hashtable&& __ht)
+ : __detail::_Rehash_base<_RehashPolicy, _Hashtable>(__ht),
+ __detail::_Hash_code_base<_Key, _Value, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, __chc>(__ht),
+ __detail::_Map_base<_Key, _Value, _ExtractKey, __uk, _Hashtable>(__ht),
+ _M_node_allocator(__ht._M_node_allocator),
+ _M_bucket_count(__ht._M_bucket_count),
+ _M_element_count(__ht._M_element_count),
+ _M_rehash_policy(__ht._M_rehash_policy),
+ _M_buckets(__ht._M_buckets)
+ {
+ size_type __n_bkt = __ht._M_rehash_policy._M_next_bkt(0);
+ __ht._M_buckets = __ht._M_allocate_buckets(__n_bkt);
+ __ht._M_bucket_count = __n_bkt;
+ __ht._M_element_count = 0;
+ __ht._M_rehash_policy = _RehashPolicy();
+ }
+#endif
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>&
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ operator=(const _Hashtable& __ht)
+ {
+ _Hashtable __tmp(__ht);
+ this->swap(__tmp);
+ return *this;
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ ~_Hashtable()
+ {
+ clear();
+ _M_deallocate_buckets(_M_buckets, _M_bucket_count);
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ void
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ swap(_Hashtable&& __x)
+#else
+ swap(_Hashtable& __x)
+#endif
+ {
+ // The only base class with member variables is hash_code_base. We
+ // define _Hash_code_base::_M_swap because different specializations
+ // have different members.
+ __detail::_Hash_code_base<_Key, _Value, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, __chc>::_M_swap(__x);
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 431. Swapping containers with unequal allocators.
+ std::__alloc_swap<_Node_allocator_type>::_S_do_it(_M_node_allocator,
+ __x._M_node_allocator);
+
+ std::swap(_M_rehash_policy, __x._M_rehash_policy);
+ std::swap(_M_buckets, __x._M_buckets);
+ std::swap(_M_bucket_count, __x._M_bucket_count);
+ std::swap(_M_element_count, __x._M_element_count);
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ void
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ __rehash_policy(const _RehashPolicy& __pol)
+ {
+ _M_rehash_policy = __pol;
+ size_type __n_bkt = __pol._M_bkt_for_elements(_M_element_count);
+ if (__n_bkt > _M_bucket_count)
+ _M_rehash(__n_bkt);
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ typename _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy,
+ __chc, __cit, __uk>::iterator
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ find(const key_type& __k)
+ {
+ typename _Hashtable::_Hash_code_type __code = this->_M_hash_code(__k);
+ std::size_t __n = this->_M_bucket_index(__k, __code, _M_bucket_count);
+ _Node* __p = _M_find_node(_M_buckets[__n], __k, __code);
+ return __p ? iterator(__p, _M_buckets + __n) : this->end();
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ typename _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy,
+ __chc, __cit, __uk>::const_iterator
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ find(const key_type& __k) const
+ {
+ typename _Hashtable::_Hash_code_type __code = this->_M_hash_code(__k);
+ std::size_t __n = this->_M_bucket_index(__k, __code, _M_bucket_count);
+ _Node* __p = _M_find_node(_M_buckets[__n], __k, __code);
+ return __p ? const_iterator(__p, _M_buckets + __n) : this->end();
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ typename _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy,
+ __chc, __cit, __uk>::size_type
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ count(const key_type& __k) const
+ {
+ typename _Hashtable::_Hash_code_type __code = this->_M_hash_code(__k);
+ std::size_t __n = this->_M_bucket_index(__k, __code, _M_bucket_count);
+ std::size_t __result = 0;
+ for (_Node* __p = _M_buckets[__n]; __p; __p = __p->_M_next)
+ if (this->_M_compare(__k, __code, __p))
+ ++__result;
+ return __result;
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ std::pair<typename _Hashtable<_Key, _Value, _Allocator,
+ _ExtractKey, _Equal, _H1,
+ _H2, _Hash, _RehashPolicy,
+ __chc, __cit, __uk>::iterator,
+ typename _Hashtable<_Key, _Value, _Allocator,
+ _ExtractKey, _Equal, _H1,
+ _H2, _Hash, _RehashPolicy,
+ __chc, __cit, __uk>::iterator>
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ equal_range(const key_type& __k)
+ {
+ typename _Hashtable::_Hash_code_type __code = this->_M_hash_code(__k);
+ std::size_t __n = this->_M_bucket_index(__k, __code, _M_bucket_count);
+ _Node** __head = _M_buckets + __n;
+ _Node* __p = _M_find_node(*__head, __k, __code);
+
+ if (__p)
+ {
+ _Node* __p1 = __p->_M_next;
+ for (; __p1; __p1 = __p1->_M_next)
+ if (!this->_M_compare(__k, __code, __p1))
+ break;
+
+ iterator __first(__p, __head);
+ iterator __last(__p1, __head);
+ if (!__p1)
+ __last._M_incr_bucket();
+ return std::make_pair(__first, __last);
+ }
+ else
+ return std::make_pair(this->end(), this->end());
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ std::pair<typename _Hashtable<_Key, _Value, _Allocator,
+ _ExtractKey, _Equal, _H1,
+ _H2, _Hash, _RehashPolicy,
+ __chc, __cit, __uk>::const_iterator,
+ typename _Hashtable<_Key, _Value, _Allocator,
+ _ExtractKey, _Equal, _H1,
+ _H2, _Hash, _RehashPolicy,
+ __chc, __cit, __uk>::const_iterator>
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ equal_range(const key_type& __k) const
+ {
+ typename _Hashtable::_Hash_code_type __code = this->_M_hash_code(__k);
+ std::size_t __n = this->_M_bucket_index(__k, __code, _M_bucket_count);
+ _Node** __head = _M_buckets + __n;
+ _Node* __p = _M_find_node(*__head, __k, __code);
+
+ if (__p)
+ {
+ _Node* __p1 = __p->_M_next;
+ for (; __p1; __p1 = __p1->_M_next)
+ if (!this->_M_compare(__k, __code, __p1))
+ break;
+
+ const_iterator __first(__p, __head);
+ const_iterator __last(__p1, __head);
+ if (!__p1)
+ __last._M_incr_bucket();
+ return std::make_pair(__first, __last);
+ }
+ else
+ return std::make_pair(this->end(), this->end());
+ }
+
+ // Find the node whose key compares equal to k, beginning the search
+ // at p (usually the head of a bucket). Return nil if no node is found.
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ typename _Hashtable<_Key, _Value, _Allocator, _ExtractKey,
+ _Equal, _H1, _H2, _Hash, _RehashPolicy,
+ __chc, __cit, __uk>::_Node*
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ _M_find_node(_Node* __p, const key_type& __k,
+ typename _Hashtable::_Hash_code_type __code) const
+ {
+ for (; __p; __p = __p->_M_next)
+ if (this->_M_compare(__k, __code, __p))
+ return __p;
+ return false;
+ }
+
+ // Insert v in bucket n (assumes no element with its key already present).
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ typename _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy,
+ __chc, __cit, __uk>::iterator
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ _M_insert_bucket(const value_type& __v, size_type __n,
+ typename _Hashtable::_Hash_code_type __code)
+ {
+ std::pair<bool, std::size_t> __do_rehash
+ = _M_rehash_policy._M_need_rehash(_M_bucket_count,
+ _M_element_count, 1);
+
+ // Allocate the new node before doing the rehash so that we don't
+ // do a rehash if the allocation throws.
+ _Node* __new_node = _M_allocate_node(__v);
+
+ __try
+ {
+ if (__do_rehash.first)
+ {
+ const key_type& __k = this->_M_extract(__v);
+ __n = this->_M_bucket_index(__k, __code, __do_rehash.second);
+ _M_rehash(__do_rehash.second);
+ }
+
+ __new_node->_M_next = _M_buckets[__n];
+ this->_M_store_code(__new_node, __code);
+ _M_buckets[__n] = __new_node;
+ ++_M_element_count;
+ return iterator(__new_node, _M_buckets + __n);
+ }
+ __catch(...)
+ {
+ _M_deallocate_node(__new_node);
+ __throw_exception_again;
+ }
+ }
+
+ // Insert v if no element with its key is already present.
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ std::pair<typename _Hashtable<_Key, _Value, _Allocator,
+ _ExtractKey, _Equal, _H1,
+ _H2, _Hash, _RehashPolicy,
+ __chc, __cit, __uk>::iterator, bool>
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ _M_insert(const value_type& __v, std::_GLIBCXX_TR1 true_type)
+ {
+ const key_type& __k = this->_M_extract(__v);
+ typename _Hashtable::_Hash_code_type __code = this->_M_hash_code(__k);
+ size_type __n = this->_M_bucket_index(__k, __code, _M_bucket_count);
+
+ if (_Node* __p = _M_find_node(_M_buckets[__n], __k, __code))
+ return std::make_pair(iterator(__p, _M_buckets + __n), false);
+ return std::make_pair(_M_insert_bucket(__v, __n, __code), true);
+ }
+
+ // Insert v unconditionally.
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ typename _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy,
+ __chc, __cit, __uk>::iterator
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ _M_insert(const value_type& __v, std::_GLIBCXX_TR1 false_type)
+ {
+ std::pair<bool, std::size_t> __do_rehash
+ = _M_rehash_policy._M_need_rehash(_M_bucket_count,
+ _M_element_count, 1);
+ if (__do_rehash.first)
+ _M_rehash(__do_rehash.second);
+
+ const key_type& __k = this->_M_extract(__v);
+ typename _Hashtable::_Hash_code_type __code = this->_M_hash_code(__k);
+ size_type __n = this->_M_bucket_index(__k, __code, _M_bucket_count);
+
+ // First find the node, avoid leaking new_node if compare throws.
+ _Node* __prev = _M_find_node(_M_buckets[__n], __k, __code);
+ _Node* __new_node = _M_allocate_node(__v);
+
+ if (__prev)
+ {
+ __new_node->_M_next = __prev->_M_next;
+ __prev->_M_next = __new_node;
+ }
+ else
+ {
+ __new_node->_M_next = _M_buckets[__n];
+ _M_buckets[__n] = __new_node;
+ }
+ this->_M_store_code(__new_node, __code);
+
+ ++_M_element_count;
+ return iterator(__new_node, _M_buckets + __n);
+ }
+
+ // For erase(iterator) and erase(const_iterator).
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ void
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ _M_erase_node(_Node* __p, _Node** __b)
+ {
+ _Node* __cur = *__b;
+ if (__cur == __p)
+ *__b = __cur->_M_next;
+ else
+ {
+ _Node* __next = __cur->_M_next;
+ while (__next != __p)
+ {
+ __cur = __next;
+ __next = __cur->_M_next;
+ }
+ __cur->_M_next = __next->_M_next;
+ }
+
+ _M_deallocate_node(__p);
+ --_M_element_count;
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ template<typename _InputIterator>
+ void
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ insert(_InputIterator __first, _InputIterator __last)
+ {
+ size_type __n_elt = __detail::__distance_fw(__first, __last);
+ std::pair<bool, std::size_t> __do_rehash
+ = _M_rehash_policy._M_need_rehash(_M_bucket_count,
+ _M_element_count, __n_elt);
+ if (__do_rehash.first)
+ _M_rehash(__do_rehash.second);
+
+ for (; __first != __last; ++__first)
+ this->insert(*__first);
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ typename _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy,
+ __chc, __cit, __uk>::iterator
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ erase(iterator __it)
+ {
+ iterator __result = __it;
+ ++__result;
+ _M_erase_node(__it._M_cur_node, __it._M_cur_bucket);
+ return __result;
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ typename _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy,
+ __chc, __cit, __uk>::const_iterator
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ erase(const_iterator __it)
+ {
+ const_iterator __result = __it;
+ ++__result;
+ _M_erase_node(__it._M_cur_node, __it._M_cur_bucket);
+ return __result;
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ typename _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy,
+ __chc, __cit, __uk>::size_type
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ erase(const key_type& __k)
+ {
+ typename _Hashtable::_Hash_code_type __code = this->_M_hash_code(__k);
+ std::size_t __n = this->_M_bucket_index(__k, __code, _M_bucket_count);
+ size_type __result = 0;
+
+ _Node** __slot = _M_buckets + __n;
+ while (*__slot && !this->_M_compare(__k, __code, *__slot))
+ __slot = &((*__slot)->_M_next);
+
+ _Node** __saved_slot = 0;
+ while (*__slot && this->_M_compare(__k, __code, *__slot))
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 526. Is it undefined if a function in the standard changes
+ // in parameters?
+ if (&this->_M_extract((*__slot)->_M_v) != &__k)
+ {
+ _Node* __p = *__slot;
+ *__slot = __p->_M_next;
+ _M_deallocate_node(__p);
+ --_M_element_count;
+ ++__result;
+ }
+ else
+ {
+ __saved_slot = __slot;
+ __slot = &((*__slot)->_M_next);
+ }
+ }
+
+ if (__saved_slot)
+ {
+ _Node* __p = *__saved_slot;
+ *__saved_slot = __p->_M_next;
+ _M_deallocate_node(__p);
+ --_M_element_count;
+ ++__result;
+ }
+
+ return __result;
+ }
+
+ // ??? This could be optimized by taking advantage of the bucket
+ // structure, but it's not clear that it's worth doing. It probably
+ // wouldn't even be an optimization unless the load factor is large.
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ typename _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy,
+ __chc, __cit, __uk>::iterator
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ erase(iterator __first, iterator __last)
+ {
+ while (__first != __last)
+ __first = this->erase(__first);
+ return __last;
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ typename _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy,
+ __chc, __cit, __uk>::const_iterator
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ erase(const_iterator __first, const_iterator __last)
+ {
+ while (__first != __last)
+ __first = this->erase(__first);
+ return __last;
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ void
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ clear()
+ {
+ _M_deallocate_nodes(_M_buckets, _M_bucket_count);
+ _M_element_count = 0;
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ void
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ rehash(size_type __n)
+ {
+ _M_rehash(std::max(_M_rehash_policy._M_next_bkt(__n),
+ _M_rehash_policy._M_bkt_for_elements(_M_element_count
+ + 1)));
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ void
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ _M_rehash(size_type __n)
+ {
+ _Node** __new_array = _M_allocate_buckets(__n);
+ __try
+ {
+ for (size_type __i = 0; __i < _M_bucket_count; ++__i)
+ while (_Node* __p = _M_buckets[__i])
+ {
+ std::size_t __new_index = this->_M_bucket_index(__p, __n);
+ _M_buckets[__i] = __p->_M_next;
+ __p->_M_next = __new_array[__new_index];
+ __new_array[__new_index] = __p;
+ }
+ _M_deallocate_buckets(_M_buckets, _M_bucket_count);
+ _M_bucket_count = __n;
+ _M_buckets = __new_array;
+ }
+ __catch(...)
+ {
+ // A failure here means that a hash function threw an exception.
+ // We can't restore the previous state without calling the hash
+ // function again, so the only sensible recovery is to delete
+ // everything.
+ _M_deallocate_nodes(__new_array, __n);
+ _M_deallocate_buckets(__new_array, __n);
+ _M_deallocate_nodes(_M_buckets, _M_bucket_count);
+ _M_element_count = 0;
+ __throw_exception_again;
+ }
+ }
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
diff --git a/i686-linux/include/c++/4.4.3/tr1_impl/hashtable_policy.h b/i686-linux/include/c++/4.4.3/tr1_impl/hashtable_policy.h
new file mode 100644
index 0000000..8996d04
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1_impl/hashtable_policy.h
@@ -0,0 +1,865 @@
+// Internal policy header for TR1 unordered_set and unordered_map -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/hashtable_policy.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+namespace __detail
+{
+ // Helper function: return distance(first, last) for forward
+ // iterators, or 0 for input iterators.
+ template<class _Iterator>
+ inline typename std::iterator_traits<_Iterator>::difference_type
+ __distance_fw(_Iterator __first, _Iterator __last,
+ std::input_iterator_tag)
+ { return 0; }
+
+ template<class _Iterator>
+ inline typename std::iterator_traits<_Iterator>::difference_type
+ __distance_fw(_Iterator __first, _Iterator __last,
+ std::forward_iterator_tag)
+ { return std::distance(__first, __last); }
+
+ template<class _Iterator>
+ inline typename std::iterator_traits<_Iterator>::difference_type
+ __distance_fw(_Iterator __first, _Iterator __last)
+ {
+ typedef typename std::iterator_traits<_Iterator>::iterator_category _Tag;
+ return __distance_fw(__first, __last, _Tag());
+ }
+
+ template<typename _RAIter, typename _Tp>
+ _RAIter
+ __lower_bound(_RAIter __first, _RAIter __last, const _Tp& __val)
+ {
+ typedef typename std::iterator_traits<_RAIter>::difference_type _DType;
+
+ _DType __len = __last - __first;
+ while (__len > 0)
+ {
+ _DType __half = __len >> 1;
+ _RAIter __middle = __first + __half;
+ if (*__middle < __val)
+ {
+ __first = __middle;
+ ++__first;
+ __len = __len - __half - 1;
+ }
+ else
+ __len = __half;
+ }
+ return __first;
+ }
+
+ // Auxiliary types used for all instantiations of _Hashtable: nodes
+ // and iterators.
+
+ // Nodes, used to wrap elements stored in the hash table. A policy
+ // template parameter of class template _Hashtable controls whether
+ // nodes also store a hash code. In some cases (e.g. strings) this
+ // may be a performance win.
+ template<typename _Value, bool __cache_hash_code>
+ struct _Hash_node;
+
+ template<typename _Value>
+ struct _Hash_node<_Value, true>
+ {
+ _Value _M_v;
+ std::size_t _M_hash_code;
+ _Hash_node* _M_next;
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ template<typename... _Args>
+ _Hash_node(_Args&&... __args)
+ : _M_v(std::forward<_Args>(__args)...),
+ _M_hash_code(), _M_next() { }
+#endif
+ };
+
+ template<typename _Value>
+ struct _Hash_node<_Value, false>
+ {
+ _Value _M_v;
+ _Hash_node* _M_next;
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ template<typename... _Args>
+ _Hash_node(_Args&&... __args)
+ : _M_v(std::forward<_Args>(__args)...),
+ _M_next() { }
+#endif
+ };
+
+ // Local iterators, used to iterate within a bucket but not between
+ // buckets.
+ template<typename _Value, bool __cache>
+ struct _Node_iterator_base
+ {
+ _Node_iterator_base(_Hash_node<_Value, __cache>* __p)
+ : _M_cur(__p) { }
+
+ void
+ _M_incr()
+ { _M_cur = _M_cur->_M_next; }
+
+ _Hash_node<_Value, __cache>* _M_cur;
+ };
+
+ template<typename _Value, bool __cache>
+ inline bool
+ operator==(const _Node_iterator_base<_Value, __cache>& __x,
+ const _Node_iterator_base<_Value, __cache>& __y)
+ { return __x._M_cur == __y._M_cur; }
+
+ template<typename _Value, bool __cache>
+ inline bool
+ operator!=(const _Node_iterator_base<_Value, __cache>& __x,
+ const _Node_iterator_base<_Value, __cache>& __y)
+ { return __x._M_cur != __y._M_cur; }
+
+ template<typename _Value, bool __constant_iterators, bool __cache>
+ struct _Node_iterator
+ : public _Node_iterator_base<_Value, __cache>
+ {
+ typedef _Value value_type;
+ typedef typename
+ __gnu_cxx::__conditional_type<__constant_iterators,
+ const _Value*, _Value*>::__type
+ pointer;
+ typedef typename
+ __gnu_cxx::__conditional_type<__constant_iterators,
+ const _Value&, _Value&>::__type
+ reference;
+ typedef std::ptrdiff_t difference_type;
+ typedef std::forward_iterator_tag iterator_category;
+
+ _Node_iterator()
+ : _Node_iterator_base<_Value, __cache>(0) { }
+
+ explicit
+ _Node_iterator(_Hash_node<_Value, __cache>* __p)
+ : _Node_iterator_base<_Value, __cache>(__p) { }
+
+ reference
+ operator*() const
+ { return this->_M_cur->_M_v; }
+
+ pointer
+ operator->() const
+ { return &this->_M_cur->_M_v; }
+
+ _Node_iterator&
+ operator++()
+ {
+ this->_M_incr();
+ return *this;
+ }
+
+ _Node_iterator
+ operator++(int)
+ {
+ _Node_iterator __tmp(*this);
+ this->_M_incr();
+ return __tmp;
+ }
+ };
+
+ template<typename _Value, bool __constant_iterators, bool __cache>
+ struct _Node_const_iterator
+ : public _Node_iterator_base<_Value, __cache>
+ {
+ typedef _Value value_type;
+ typedef const _Value* pointer;
+ typedef const _Value& reference;
+ typedef std::ptrdiff_t difference_type;
+ typedef std::forward_iterator_tag iterator_category;
+
+ _Node_const_iterator()
+ : _Node_iterator_base<_Value, __cache>(0) { }
+
+ explicit
+ _Node_const_iterator(_Hash_node<_Value, __cache>* __p)
+ : _Node_iterator_base<_Value, __cache>(__p) { }
+
+ _Node_const_iterator(const _Node_iterator<_Value, __constant_iterators,
+ __cache>& __x)
+ : _Node_iterator_base<_Value, __cache>(__x._M_cur) { }
+
+ reference
+ operator*() const
+ { return this->_M_cur->_M_v; }
+
+ pointer
+ operator->() const
+ { return &this->_M_cur->_M_v; }
+
+ _Node_const_iterator&
+ operator++()
+ {
+ this->_M_incr();
+ return *this;
+ }
+
+ _Node_const_iterator
+ operator++(int)
+ {
+ _Node_const_iterator __tmp(*this);
+ this->_M_incr();
+ return __tmp;
+ }
+ };
+
+ template<typename _Value, bool __cache>
+ struct _Hashtable_iterator_base
+ {
+ _Hashtable_iterator_base(_Hash_node<_Value, __cache>* __node,
+ _Hash_node<_Value, __cache>** __bucket)
+ : _M_cur_node(__node), _M_cur_bucket(__bucket) { }
+
+ void
+ _M_incr()
+ {
+ _M_cur_node = _M_cur_node->_M_next;
+ if (!_M_cur_node)
+ _M_incr_bucket();
+ }
+
+ void
+ _M_incr_bucket();
+
+ _Hash_node<_Value, __cache>* _M_cur_node;
+ _Hash_node<_Value, __cache>** _M_cur_bucket;
+ };
+
+ // Global iterators, used for arbitrary iteration within a hash
+ // table. Larger and more expensive than local iterators.
+ template<typename _Value, bool __cache>
+ void
+ _Hashtable_iterator_base<_Value, __cache>::
+ _M_incr_bucket()
+ {
+ ++_M_cur_bucket;
+
+ // This loop requires the bucket array to have a non-null sentinel.
+ while (!*_M_cur_bucket)
+ ++_M_cur_bucket;
+ _M_cur_node = *_M_cur_bucket;
+ }
+
+ template<typename _Value, bool __cache>
+ inline bool
+ operator==(const _Hashtable_iterator_base<_Value, __cache>& __x,
+ const _Hashtable_iterator_base<_Value, __cache>& __y)
+ { return __x._M_cur_node == __y._M_cur_node; }
+
+ template<typename _Value, bool __cache>
+ inline bool
+ operator!=(const _Hashtable_iterator_base<_Value, __cache>& __x,
+ const _Hashtable_iterator_base<_Value, __cache>& __y)
+ { return __x._M_cur_node != __y._M_cur_node; }
+
+ template<typename _Value, bool __constant_iterators, bool __cache>
+ struct _Hashtable_iterator
+ : public _Hashtable_iterator_base<_Value, __cache>
+ {
+ typedef _Value value_type;
+ typedef typename
+ __gnu_cxx::__conditional_type<__constant_iterators,
+ const _Value*, _Value*>::__type
+ pointer;
+ typedef typename
+ __gnu_cxx::__conditional_type<__constant_iterators,
+ const _Value&, _Value&>::__type
+ reference;
+ typedef std::ptrdiff_t difference_type;
+ typedef std::forward_iterator_tag iterator_category;
+
+ _Hashtable_iterator()
+ : _Hashtable_iterator_base<_Value, __cache>(0, 0) { }
+
+ _Hashtable_iterator(_Hash_node<_Value, __cache>* __p,
+ _Hash_node<_Value, __cache>** __b)
+ : _Hashtable_iterator_base<_Value, __cache>(__p, __b) { }
+
+ explicit
+ _Hashtable_iterator(_Hash_node<_Value, __cache>** __b)
+ : _Hashtable_iterator_base<_Value, __cache>(*__b, __b) { }
+
+ reference
+ operator*() const
+ { return this->_M_cur_node->_M_v; }
+
+ pointer
+ operator->() const
+ { return &this->_M_cur_node->_M_v; }
+
+ _Hashtable_iterator&
+ operator++()
+ {
+ this->_M_incr();
+ return *this;
+ }
+
+ _Hashtable_iterator
+ operator++(int)
+ {
+ _Hashtable_iterator __tmp(*this);
+ this->_M_incr();
+ return __tmp;
+ }
+ };
+
+ template<typename _Value, bool __constant_iterators, bool __cache>
+ struct _Hashtable_const_iterator
+ : public _Hashtable_iterator_base<_Value, __cache>
+ {
+ typedef _Value value_type;
+ typedef const _Value* pointer;
+ typedef const _Value& reference;
+ typedef std::ptrdiff_t difference_type;
+ typedef std::forward_iterator_tag iterator_category;
+
+ _Hashtable_const_iterator()
+ : _Hashtable_iterator_base<_Value, __cache>(0, 0) { }
+
+ _Hashtable_const_iterator(_Hash_node<_Value, __cache>* __p,
+ _Hash_node<_Value, __cache>** __b)
+ : _Hashtable_iterator_base<_Value, __cache>(__p, __b) { }
+
+ explicit
+ _Hashtable_const_iterator(_Hash_node<_Value, __cache>** __b)
+ : _Hashtable_iterator_base<_Value, __cache>(*__b, __b) { }
+
+ _Hashtable_const_iterator(const _Hashtable_iterator<_Value,
+ __constant_iterators, __cache>& __x)
+ : _Hashtable_iterator_base<_Value, __cache>(__x._M_cur_node,
+ __x._M_cur_bucket) { }
+
+ reference
+ operator*() const
+ { return this->_M_cur_node->_M_v; }
+
+ pointer
+ operator->() const
+ { return &this->_M_cur_node->_M_v; }
+
+ _Hashtable_const_iterator&
+ operator++()
+ {
+ this->_M_incr();
+ return *this;
+ }
+
+ _Hashtable_const_iterator
+ operator++(int)
+ {
+ _Hashtable_const_iterator __tmp(*this);
+ this->_M_incr();
+ return __tmp;
+ }
+ };
+
+
+ // Many of class template _Hashtable's template parameters are policy
+ // classes. These are defaults for the policies.
+
+ // Default range hashing function: use division to fold a large number
+ // into the range [0, N).
+ struct _Mod_range_hashing
+ {
+ typedef std::size_t first_argument_type;
+ typedef std::size_t second_argument_type;
+ typedef std::size_t result_type;
+
+ result_type
+ operator()(first_argument_type __num, second_argument_type __den) const
+ { return __num % __den; }
+ };
+
+ // Default ranged hash function H. In principle it should be a
+ // function object composed from objects of type H1 and H2 such that
+ // h(k, N) = h2(h1(k), N), but that would mean making extra copies of
+ // h1 and h2. So instead we'll just use a tag to tell class template
+ // hashtable to do that composition.
+ struct _Default_ranged_hash { };
+
+ // Default value for rehash policy. Bucket size is (usually) the
+ // smallest prime that keeps the load factor small enough.
+ struct _Prime_rehash_policy
+ {
+ _Prime_rehash_policy(float __z = 1.0)
+ : _M_max_load_factor(__z), _M_growth_factor(2.f), _M_next_resize(0) { }
+
+ float
+ max_load_factor() const
+ { return _M_max_load_factor; }
+
+ // Return a bucket size no smaller than n.
+ std::size_t
+ _M_next_bkt(std::size_t __n) const;
+
+ // Return a bucket count appropriate for n elements
+ std::size_t
+ _M_bkt_for_elements(std::size_t __n) const;
+
+ // __n_bkt is current bucket count, __n_elt is current element count,
+ // and __n_ins is number of elements to be inserted. Do we need to
+ // increase bucket count? If so, return make_pair(true, n), where n
+ // is the new bucket count. If not, return make_pair(false, 0).
+ std::pair<bool, std::size_t>
+ _M_need_rehash(std::size_t __n_bkt, std::size_t __n_elt,
+ std::size_t __n_ins) const;
+
+ enum { _S_n_primes = sizeof(unsigned long) != 8 ? 256 : 256 + 48 };
+
+ float _M_max_load_factor;
+ float _M_growth_factor;
+ mutable std::size_t _M_next_resize;
+ };
+
+ extern const unsigned long __prime_list[];
+
+ // XXX This is a hack. There's no good reason for any of
+ // _Prime_rehash_policy's member functions to be inline.
+
+ // Return a prime no smaller than n.
+ inline std::size_t
+ _Prime_rehash_policy::
+ _M_next_bkt(std::size_t __n) const
+ {
+ const unsigned long* __p = __lower_bound(__prime_list, __prime_list
+ + _S_n_primes, __n);
+ _M_next_resize =
+ static_cast<std::size_t>(__builtin_ceil(*__p * _M_max_load_factor));
+ return *__p;
+ }
+
+ // Return the smallest prime p such that alpha p >= n, where alpha
+ // is the load factor.
+ inline std::size_t
+ _Prime_rehash_policy::
+ _M_bkt_for_elements(std::size_t __n) const
+ {
+ const float __min_bkts = __n / _M_max_load_factor;
+ const unsigned long* __p = __lower_bound(__prime_list, __prime_list
+ + _S_n_primes, __min_bkts);
+ _M_next_resize =
+ static_cast<std::size_t>(__builtin_ceil(*__p * _M_max_load_factor));
+ return *__p;
+ }
+
+ // Finds the smallest prime p such that alpha p > __n_elt + __n_ins.
+ // If p > __n_bkt, return make_pair(true, p); otherwise return
+ // make_pair(false, 0). In principle this isn't very different from
+ // _M_bkt_for_elements.
+
+ // The only tricky part is that we're caching the element count at
+ // which we need to rehash, so we don't have to do a floating-point
+ // multiply for every insertion.
+
+ inline std::pair<bool, std::size_t>
+ _Prime_rehash_policy::
+ _M_need_rehash(std::size_t __n_bkt, std::size_t __n_elt,
+ std::size_t __n_ins) const
+ {
+ if (__n_elt + __n_ins > _M_next_resize)
+ {
+ float __min_bkts = ((float(__n_ins) + float(__n_elt))
+ / _M_max_load_factor);
+ if (__min_bkts > __n_bkt)
+ {
+ __min_bkts = std::max(__min_bkts, _M_growth_factor * __n_bkt);
+ const unsigned long* __p =
+ __lower_bound(__prime_list, __prime_list + _S_n_primes,
+ __min_bkts);
+ _M_next_resize = static_cast<std::size_t>
+ (__builtin_ceil(*__p * _M_max_load_factor));
+ return std::make_pair(true, *__p);
+ }
+ else
+ {
+ _M_next_resize = static_cast<std::size_t>
+ (__builtin_ceil(__n_bkt * _M_max_load_factor));
+ return std::make_pair(false, 0);
+ }
+ }
+ else
+ return std::make_pair(false, 0);
+ }
+
+ // Base classes for std::tr1::_Hashtable. We define these base
+ // classes because in some cases we want to do different things
+ // depending on the value of a policy class. In some cases the
+ // policy class affects which member functions and nested typedefs
+ // are defined; we handle that by specializing base class templates.
+ // Several of the base class templates need to access other members
+ // of class template _Hashtable, so we use the "curiously recurring
+ // template pattern" for them.
+
+ // class template _Map_base. If the hashtable has a value type of the
+ // form pair<T1, T2> and a key extraction policy that returns the
+ // first part of the pair, the hashtable gets a mapped_type typedef.
+ // If it satisfies those criteria and also has unique keys, then it
+ // also gets an operator[].
+ template<typename _Key, typename _Value, typename _Ex, bool __unique,
+ typename _Hashtable>
+ struct _Map_base { };
+
+ template<typename _Key, typename _Pair, typename _Hashtable>
+ struct _Map_base<_Key, _Pair, std::_Select1st<_Pair>, false, _Hashtable>
+ {
+ typedef typename _Pair::second_type mapped_type;
+ };
+
+ template<typename _Key, typename _Pair, typename _Hashtable>
+ struct _Map_base<_Key, _Pair, std::_Select1st<_Pair>, true, _Hashtable>
+ {
+ typedef typename _Pair::second_type mapped_type;
+
+ mapped_type&
+ operator[](const _Key& __k);
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 761. unordered_map needs an at() member function.
+ mapped_type&
+ at(const _Key& __k);
+
+ const mapped_type&
+ at(const _Key& __k) const;
+#endif
+ };
+
+ template<typename _Key, typename _Pair, typename _Hashtable>
+ typename _Map_base<_Key, _Pair, std::_Select1st<_Pair>,
+ true, _Hashtable>::mapped_type&
+ _Map_base<_Key, _Pair, std::_Select1st<_Pair>, true, _Hashtable>::
+ operator[](const _Key& __k)
+ {
+ _Hashtable* __h = static_cast<_Hashtable*>(this);
+ typename _Hashtable::_Hash_code_type __code = __h->_M_hash_code(__k);
+ std::size_t __n = __h->_M_bucket_index(__k, __code,
+ __h->_M_bucket_count);
+
+ typename _Hashtable::_Node* __p =
+ __h->_M_find_node(__h->_M_buckets[__n], __k, __code);
+ if (!__p)
+ return __h->_M_insert_bucket(std::make_pair(__k, mapped_type()),
+ __n, __code)->second;
+ return (__p->_M_v).second;
+ }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ template<typename _Key, typename _Pair, typename _Hashtable>
+ typename _Map_base<_Key, _Pair, std::_Select1st<_Pair>,
+ true, _Hashtable>::mapped_type&
+ _Map_base<_Key, _Pair, std::_Select1st<_Pair>, true, _Hashtable>::
+ at(const _Key& __k)
+ {
+ _Hashtable* __h = static_cast<_Hashtable*>(this);
+ typename _Hashtable::_Hash_code_type __code = __h->_M_hash_code(__k);
+ std::size_t __n = __h->_M_bucket_index(__k, __code,
+ __h->_M_bucket_count);
+
+ typename _Hashtable::_Node* __p =
+ __h->_M_find_node(__h->_M_buckets[__n], __k, __code);
+ if (!__p)
+ __throw_out_of_range(__N("_Map_base::at"));
+ return (__p->_M_v).second;
+ }
+
+ template<typename _Key, typename _Pair, typename _Hashtable>
+ const typename _Map_base<_Key, _Pair, std::_Select1st<_Pair>,
+ true, _Hashtable>::mapped_type&
+ _Map_base<_Key, _Pair, std::_Select1st<_Pair>, true, _Hashtable>::
+ at(const _Key& __k) const
+ {
+ const _Hashtable* __h = static_cast<const _Hashtable*>(this);
+ typename _Hashtable::_Hash_code_type __code = __h->_M_hash_code(__k);
+ std::size_t __n = __h->_M_bucket_index(__k, __code,
+ __h->_M_bucket_count);
+
+ typename _Hashtable::_Node* __p =
+ __h->_M_find_node(__h->_M_buckets[__n], __k, __code);
+ if (!__p)
+ __throw_out_of_range(__N("_Map_base::at"));
+ return (__p->_M_v).second;
+ }
+#endif
+
+ // class template _Rehash_base. Give hashtable the max_load_factor
+ // functions iff the rehash policy is _Prime_rehash_policy.
+ template<typename _RehashPolicy, typename _Hashtable>
+ struct _Rehash_base { };
+
+ template<typename _Hashtable>
+ struct _Rehash_base<_Prime_rehash_policy, _Hashtable>
+ {
+ float
+ max_load_factor() const
+ {
+ const _Hashtable* __this = static_cast<const _Hashtable*>(this);
+ return __this->__rehash_policy().max_load_factor();
+ }
+
+ void
+ max_load_factor(float __z)
+ {
+ _Hashtable* __this = static_cast<_Hashtable*>(this);
+ __this->__rehash_policy(_Prime_rehash_policy(__z));
+ }
+ };
+
+ // Class template _Hash_code_base. Encapsulates two policy issues that
+ // aren't quite orthogonal.
+ // (1) the difference between using a ranged hash function and using
+ // the combination of a hash function and a range-hashing function.
+ // In the former case we don't have such things as hash codes, so
+ // we have a dummy type as placeholder.
+ // (2) Whether or not we cache hash codes. Caching hash codes is
+ // meaningless if we have a ranged hash function.
+ // We also put the key extraction and equality comparison function
+ // objects here, for convenience.
+
+ // Primary template: unused except as a hook for specializations.
+ template<typename _Key, typename _Value,
+ typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash,
+ bool __cache_hash_code>
+ struct _Hash_code_base;
+
+ // Specialization: ranged hash function, no caching hash codes. H1
+ // and H2 are provided but ignored. We define a dummy hash code type.
+ template<typename _Key, typename _Value,
+ typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash>
+ struct _Hash_code_base<_Key, _Value, _ExtractKey, _Equal, _H1, _H2,
+ _Hash, false>
+ {
+ protected:
+ _Hash_code_base(const _ExtractKey& __ex, const _Equal& __eq,
+ const _H1&, const _H2&, const _Hash& __h)
+ : _M_extract(__ex), _M_eq(__eq), _M_ranged_hash(__h) { }
+
+ typedef void* _Hash_code_type;
+
+ _Hash_code_type
+ _M_hash_code(const _Key& __key) const
+ { return 0; }
+
+ std::size_t
+ _M_bucket_index(const _Key& __k, _Hash_code_type,
+ std::size_t __n) const
+ { return _M_ranged_hash(__k, __n); }
+
+ std::size_t
+ _M_bucket_index(const _Hash_node<_Value, false>* __p,
+ std::size_t __n) const
+ { return _M_ranged_hash(_M_extract(__p->_M_v), __n); }
+
+ bool
+ _M_compare(const _Key& __k, _Hash_code_type,
+ _Hash_node<_Value, false>* __n) const
+ { return _M_eq(__k, _M_extract(__n->_M_v)); }
+
+ void
+ _M_store_code(_Hash_node<_Value, false>*, _Hash_code_type) const
+ { }
+
+ void
+ _M_copy_code(_Hash_node<_Value, false>*,
+ const _Hash_node<_Value, false>*) const
+ { }
+
+ void
+ _M_swap(_Hash_code_base& __x)
+ {
+ std::swap(_M_extract, __x._M_extract);
+ std::swap(_M_eq, __x._M_eq);
+ std::swap(_M_ranged_hash, __x._M_ranged_hash);
+ }
+
+ protected:
+ _ExtractKey _M_extract;
+ _Equal _M_eq;
+ _Hash _M_ranged_hash;
+ };
+
+
+ // No specialization for ranged hash function while caching hash codes.
+ // That combination is meaningless, and trying to do it is an error.
+
+
+ // Specialization: ranged hash function, cache hash codes. This
+ // combination is meaningless, so we provide only a declaration
+ // and no definition.
+ template<typename _Key, typename _Value,
+ typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash>
+ struct _Hash_code_base<_Key, _Value, _ExtractKey, _Equal, _H1, _H2,
+ _Hash, true>;
+
+ // Specialization: hash function and range-hashing function, no
+ // caching of hash codes. H is provided but ignored. Provides
+ // typedef and accessor required by TR1.
+ template<typename _Key, typename _Value,
+ typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2>
+ struct _Hash_code_base<_Key, _Value, _ExtractKey, _Equal, _H1, _H2,
+ _Default_ranged_hash, false>
+ {
+ typedef _H1 hasher;
+
+ hasher
+ hash_function() const
+ { return _M_h1; }
+
+ protected:
+ _Hash_code_base(const _ExtractKey& __ex, const _Equal& __eq,
+ const _H1& __h1, const _H2& __h2,
+ const _Default_ranged_hash&)
+ : _M_extract(__ex), _M_eq(__eq), _M_h1(__h1), _M_h2(__h2) { }
+
+ typedef std::size_t _Hash_code_type;
+
+ _Hash_code_type
+ _M_hash_code(const _Key& __k) const
+ { return _M_h1(__k); }
+
+ std::size_t
+ _M_bucket_index(const _Key&, _Hash_code_type __c,
+ std::size_t __n) const
+ { return _M_h2(__c, __n); }
+
+ std::size_t
+ _M_bucket_index(const _Hash_node<_Value, false>* __p,
+ std::size_t __n) const
+ { return _M_h2(_M_h1(_M_extract(__p->_M_v)), __n); }
+
+ bool
+ _M_compare(const _Key& __k, _Hash_code_type,
+ _Hash_node<_Value, false>* __n) const
+ { return _M_eq(__k, _M_extract(__n->_M_v)); }
+
+ void
+ _M_store_code(_Hash_node<_Value, false>*, _Hash_code_type) const
+ { }
+
+ void
+ _M_copy_code(_Hash_node<_Value, false>*,
+ const _Hash_node<_Value, false>*) const
+ { }
+
+ void
+ _M_swap(_Hash_code_base& __x)
+ {
+ std::swap(_M_extract, __x._M_extract);
+ std::swap(_M_eq, __x._M_eq);
+ std::swap(_M_h1, __x._M_h1);
+ std::swap(_M_h2, __x._M_h2);
+ }
+
+ protected:
+ _ExtractKey _M_extract;
+ _Equal _M_eq;
+ _H1 _M_h1;
+ _H2 _M_h2;
+ };
+
+ // Specialization: hash function and range-hashing function,
+ // caching hash codes. H is provided but ignored. Provides
+ // typedef and accessor required by TR1.
+ template<typename _Key, typename _Value,
+ typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2>
+ struct _Hash_code_base<_Key, _Value, _ExtractKey, _Equal, _H1, _H2,
+ _Default_ranged_hash, true>
+ {
+ typedef _H1 hasher;
+
+ hasher
+ hash_function() const
+ { return _M_h1; }
+
+ protected:
+ _Hash_code_base(const _ExtractKey& __ex, const _Equal& __eq,
+ const _H1& __h1, const _H2& __h2,
+ const _Default_ranged_hash&)
+ : _M_extract(__ex), _M_eq(__eq), _M_h1(__h1), _M_h2(__h2) { }
+
+ typedef std::size_t _Hash_code_type;
+
+ _Hash_code_type
+ _M_hash_code(const _Key& __k) const
+ { return _M_h1(__k); }
+
+ std::size_t
+ _M_bucket_index(const _Key&, _Hash_code_type __c,
+ std::size_t __n) const
+ { return _M_h2(__c, __n); }
+
+ std::size_t
+ _M_bucket_index(const _Hash_node<_Value, true>* __p,
+ std::size_t __n) const
+ { return _M_h2(__p->_M_hash_code, __n); }
+
+ bool
+ _M_compare(const _Key& __k, _Hash_code_type __c,
+ _Hash_node<_Value, true>* __n) const
+ { return __c == __n->_M_hash_code && _M_eq(__k, _M_extract(__n->_M_v)); }
+
+ void
+ _M_store_code(_Hash_node<_Value, true>* __n, _Hash_code_type __c) const
+ { __n->_M_hash_code = __c; }
+
+ void
+ _M_copy_code(_Hash_node<_Value, true>* __to,
+ const _Hash_node<_Value, true>* __from) const
+ { __to->_M_hash_code = __from->_M_hash_code; }
+
+ void
+ _M_swap(_Hash_code_base& __x)
+ {
+ std::swap(_M_extract, __x._M_extract);
+ std::swap(_M_eq, __x._M_eq);
+ std::swap(_M_h1, __x._M_h1);
+ std::swap(_M_h2, __x._M_h2);
+ }
+
+ protected:
+ _ExtractKey _M_extract;
+ _Equal _M_eq;
+ _H1 _M_h1;
+ _H2 _M_h2;
+ };
+} // namespace __detail
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
diff --git a/i686-linux/include/c++/4.4.3/tr1_impl/random b/i686-linux/include/c++/4.4.3/tr1_impl/random
new file mode 100644
index 0000000..0cf4dc4
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1_impl/random
@@ -0,0 +1,2407 @@
+// random number generation -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/**
+ * @file tr1_impl/random
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+ // [5.1] Random number generation
+
+ /**
+ * @defgroup tr1_random Random Number Generation
+ * @ingroup numerics
+ * A facility for generating random numbers on selected distributions.
+ * @{
+ */
+
+ /*
+ * Implementation-space details.
+ */
+ namespace __detail
+ {
+ template<typename _UIntType, int __w,
+ bool = __w < std::numeric_limits<_UIntType>::digits>
+ struct _Shift
+ { static const _UIntType __value = 0; };
+
+ template<typename _UIntType, int __w>
+ struct _Shift<_UIntType, __w, true>
+ { static const _UIntType __value = _UIntType(1) << __w; };
+
+ template<typename _Tp, _Tp __a, _Tp __c, _Tp __m, bool>
+ struct _Mod;
+
+ // Dispatch based on modulus value to prevent divide-by-zero compile-time
+ // errors when m == 0.
+ template<typename _Tp, _Tp __a, _Tp __c, _Tp __m>
+ inline _Tp
+ __mod(_Tp __x)
+ { return _Mod<_Tp, __a, __c, __m, __m == 0>::__calc(__x); }
+
+ typedef __gnu_cxx::__conditional_type<(sizeof(unsigned) == 4),
+ unsigned, unsigned long>::__type _UInt32Type;
+
+ /*
+ * An adaptor class for converting the output of any Generator into
+ * the input for a specific Distribution.
+ */
+ template<typename _Engine, typename _Distribution>
+ struct _Adaptor
+ {
+ typedef typename remove_reference<_Engine>::type _BEngine;
+ typedef typename _BEngine::result_type _Engine_result_type;
+ typedef typename _Distribution::input_type result_type;
+
+ public:
+ _Adaptor(const _Engine& __g)
+ : _M_g(__g) { }
+
+ result_type
+ min() const
+ {
+ result_type __return_value;
+ if (is_integral<_Engine_result_type>::value
+ && is_integral<result_type>::value)
+ __return_value = _M_g.min();
+ else
+ __return_value = result_type(0);
+ return __return_value;
+ }
+
+ result_type
+ max() const
+ {
+ result_type __return_value;
+ if (is_integral<_Engine_result_type>::value
+ && is_integral<result_type>::value)
+ __return_value = _M_g.max();
+ else if (!is_integral<result_type>::value)
+ __return_value = result_type(1);
+ else
+ __return_value = std::numeric_limits<result_type>::max() - 1;
+ return __return_value;
+ }
+
+ /*
+ * Converts a value generated by the adapted random number generator
+ * into a value in the input domain for the dependent random number
+ * distribution.
+ *
+ * Because the type traits are compile time constants only the
+ * appropriate clause of the if statements will actually be emitted
+ * by the compiler.
+ */
+ result_type
+ operator()()
+ {
+ result_type __return_value;
+ if (is_integral<_Engine_result_type>::value
+ && is_integral<result_type>::value)
+ __return_value = _M_g();
+ else if (!is_integral<_Engine_result_type>::value
+ && !is_integral<result_type>::value)
+ __return_value = result_type(_M_g() - _M_g.min())
+ / result_type(_M_g.max() - _M_g.min());
+ else if (is_integral<_Engine_result_type>::value
+ && !is_integral<result_type>::value)
+ __return_value = result_type(_M_g() - _M_g.min())
+ / result_type(_M_g.max() - _M_g.min() + result_type(1));
+ else
+ __return_value = (((_M_g() - _M_g.min())
+ / (_M_g.max() - _M_g.min()))
+ * std::numeric_limits<result_type>::max());
+ return __return_value;
+ }
+
+ private:
+ _Engine _M_g;
+ };
+
+ // Specialization for _Engine*.
+ template<typename _Engine, typename _Distribution>
+ struct _Adaptor<_Engine*, _Distribution>
+ {
+ typedef typename _Engine::result_type _Engine_result_type;
+ typedef typename _Distribution::input_type result_type;
+
+ public:
+ _Adaptor(_Engine* __g)
+ : _M_g(__g) { }
+
+ result_type
+ min() const
+ {
+ result_type __return_value;
+ if (is_integral<_Engine_result_type>::value
+ && is_integral<result_type>::value)
+ __return_value = _M_g->min();
+ else
+ __return_value = result_type(0);
+ return __return_value;
+ }
+
+ result_type
+ max() const
+ {
+ result_type __return_value;
+ if (is_integral<_Engine_result_type>::value
+ && is_integral<result_type>::value)
+ __return_value = _M_g->max();
+ else if (!is_integral<result_type>::value)
+ __return_value = result_type(1);
+ else
+ __return_value = std::numeric_limits<result_type>::max() - 1;
+ return __return_value;
+ }
+
+ result_type
+ operator()()
+ {
+ result_type __return_value;
+ if (is_integral<_Engine_result_type>::value
+ && is_integral<result_type>::value)
+ __return_value = (*_M_g)();
+ else if (!is_integral<_Engine_result_type>::value
+ && !is_integral<result_type>::value)
+ __return_value = result_type((*_M_g)() - _M_g->min())
+ / result_type(_M_g->max() - _M_g->min());
+ else if (is_integral<_Engine_result_type>::value
+ && !is_integral<result_type>::value)
+ __return_value = result_type((*_M_g)() - _M_g->min())
+ / result_type(_M_g->max() - _M_g->min() + result_type(1));
+ else
+ __return_value = ((((*_M_g)() - _M_g->min())
+ / (_M_g->max() - _M_g->min()))
+ * std::numeric_limits<result_type>::max());
+ return __return_value;
+ }
+
+ private:
+ _Engine* _M_g;
+ };
+ } // namespace __detail
+
+ /**
+ * Produces random numbers on a given distribution function using a
+ * non-uniform random number generation engine.
+ *
+ * @todo the engine_value_type needs to be studied more carefully.
+ */
+ template<typename _Engine, typename _Dist>
+ class variate_generator
+ {
+ // Concept requirements.
+ __glibcxx_class_requires(_Engine, _CopyConstructibleConcept)
+ // __glibcxx_class_requires(_Engine, _EngineConcept)
+ // __glibcxx_class_requires(_Dist, _EngineConcept)
+
+ public:
+ typedef _Engine engine_type;
+ typedef __detail::_Adaptor<_Engine, _Dist> engine_value_type;
+ typedef _Dist distribution_type;
+ typedef typename _Dist::result_type result_type;
+
+ // tr1:5.1.1 table 5.1 requirement
+ typedef typename __gnu_cxx::__enable_if<
+ is_arithmetic<result_type>::value, result_type>::__type _IsValidType;
+
+ /**
+ * Constructs a variate generator with the uniform random number
+ * generator @p __eng for the random distribution @p __dist.
+ *
+ * @throws Any exceptions which may thrown by the copy constructors of
+ * the @p _Engine or @p _Dist objects.
+ */
+ variate_generator(engine_type __eng, distribution_type __dist)
+ : _M_engine(__eng), _M_dist(__dist) { }
+
+ /**
+ * Gets the next generated value on the distribution.
+ */
+ result_type
+ operator()()
+ { return _M_dist(_M_engine); }
+
+ /**
+ * WTF?
+ */
+ template<typename _Tp>
+ result_type
+ operator()(_Tp __value)
+ { return _M_dist(_M_engine, __value); }
+
+ /**
+ * Gets a reference to the underlying uniform random number generator
+ * object.
+ */
+ engine_value_type&
+ engine()
+ { return _M_engine; }
+
+ /**
+ * Gets a const reference to the underlying uniform random number
+ * generator object.
+ */
+ const engine_value_type&
+ engine() const
+ { return _M_engine; }
+
+ /**
+ * Gets a reference to the underlying random distribution.
+ */
+ distribution_type&
+ distribution()
+ { return _M_dist; }
+
+ /**
+ * Gets a const reference to the underlying random distribution.
+ */
+ const distribution_type&
+ distribution() const
+ { return _M_dist; }
+
+ /**
+ * Gets the closed lower bound of the distribution interval.
+ */
+ result_type
+ min() const
+ { return this->distribution().min(); }
+
+ /**
+ * Gets the closed upper bound of the distribution interval.
+ */
+ result_type
+ max() const
+ { return this->distribution().max(); }
+
+ private:
+ engine_value_type _M_engine;
+ distribution_type _M_dist;
+ };
+
+
+ /**
+ * @defgroup tr1_random_generators Random Number Generators
+ * @ingroup tr1_random
+ *
+ * These classes define objects which provide random or pseudorandom
+ * numbers, either from a discrete or a continuous interval. The
+ * random number generator supplied as a part of this library are
+ * all uniform random number generators which provide a sequence of
+ * random number uniformly distributed over their range.
+ *
+ * A number generator is a function object with an operator() that
+ * takes zero arguments and returns a number.
+ *
+ * A compliant random number generator must satisfy the following
+ * requirements. <table border=1 cellpadding=10 cellspacing=0>
+ * <caption align=top>Random Number Generator Requirements</caption>
+ * <tr><td>To be documented.</td></tr> </table>
+ *
+ * @{
+ */
+
+ /**
+ * @brief A model of a linear congruential random number generator.
+ *
+ * A random number generator that produces pseudorandom numbers using the
+ * linear function @f$x_{i+1}\leftarrow(ax_{i} + c) \bmod m @f$.
+ *
+ * The template parameter @p _UIntType must be an unsigned integral type
+ * large enough to store values up to (__m-1). If the template parameter
+ * @p __m is 0, the modulus @p __m used is
+ * std::numeric_limits<_UIntType>::max() plus 1. Otherwise, the template
+ * parameters @p __a and @p __c must be less than @p __m.
+ *
+ * The size of the state is @f$ 1 @f$.
+ */
+ template<class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
+ class linear_congruential
+ {
+ __glibcxx_class_requires(_UIntType, _UnsignedIntegerConcept)
+ // __glibcpp_class_requires(__a < __m && __c < __m)
+
+ public:
+ /** The type of the generated random value. */
+ typedef _UIntType result_type;
+
+ /** The multiplier. */
+ static const _UIntType multiplier = __a;
+ /** An increment. */
+ static const _UIntType increment = __c;
+ /** The modulus. */
+ static const _UIntType modulus = __m;
+
+ /**
+ * Constructs a %linear_congruential random number generator engine with
+ * seed @p __s. The default seed value is 1.
+ *
+ * @param __s The initial seed value.
+ */
+ explicit
+ linear_congruential(unsigned long __x0 = 1)
+ { this->seed(__x0); }
+
+ /**
+ * Constructs a %linear_congruential random number generator engine
+ * seeded from the generator function @p __g.
+ *
+ * @param __g The seed generator function.
+ */
+ template<class _Gen>
+ linear_congruential(_Gen& __g)
+ { this->seed(__g); }
+
+ /**
+ * Reseeds the %linear_congruential random number generator engine
+ * sequence to the seed @g __s.
+ *
+ * @param __s The new seed.
+ */
+ void
+ seed(unsigned long __s = 1);
+
+ /**
+ * Reseeds the %linear_congruential random number generator engine
+ * sequence using values from the generator function @p __g.
+ *
+ * @param __g the seed generator function.
+ */
+ template<class _Gen>
+ void
+ seed(_Gen& __g)
+ { seed(__g, typename is_fundamental<_Gen>::type()); }
+
+ /**
+ * Gets the smallest possible value in the output range.
+ *
+ * The minimum depends on the @p __c parameter: if it is zero, the
+ * minimum generated must be > 0, otherwise 0 is allowed.
+ */
+ result_type
+ min() const
+ { return (__detail::__mod<_UIntType, 1, 0, __m>(__c) == 0) ? 1 : 0; }
+
+ /**
+ * Gets the largest possible value in the output range.
+ */
+ result_type
+ max() const
+ { return __m - 1; }
+
+ /**
+ * Gets the next random number in the sequence.
+ */
+ result_type
+ operator()();
+
+ /**
+ * Compares two linear congruential random number generator
+ * objects of the same type for equality.
+ *
+ * @param __lhs A linear congruential random number generator object.
+ * @param __rhs Another linear congruential random number generator obj.
+ *
+ * @returns true if the two objects are equal, false otherwise.
+ */
+ friend bool
+ operator==(const linear_congruential& __lhs,
+ const linear_congruential& __rhs)
+ { return __lhs._M_x == __rhs._M_x; }
+
+ /**
+ * Compares two linear congruential random number generator
+ * objects of the same type for inequality.
+ *
+ * @param __lhs A linear congruential random number generator object.
+ * @param __rhs Another linear congruential random number generator obj.
+ *
+ * @returns true if the two objects are not equal, false otherwise.
+ */
+ friend bool
+ operator!=(const linear_congruential& __lhs,
+ const linear_congruential& __rhs)
+ { return !(__lhs == __rhs); }
+
+ /**
+ * Writes the textual representation of the state x(i) of x to @p __os.
+ *
+ * @param __os The output stream.
+ * @param __lcr A % linear_congruential random number generator.
+ * @returns __os.
+ */
+ template<class _UIntType1, _UIntType1 __a1, _UIntType1 __c1,
+ _UIntType1 __m1,
+ typename _CharT, typename _Traits>
+ friend std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const linear_congruential<_UIntType1, __a1, __c1,
+ __m1>& __lcr);
+
+ /**
+ * Sets the state of the engine by reading its textual
+ * representation from @p __is.
+ *
+ * The textual representation must have been previously written using an
+ * output stream whose imbued locale and whose type's template
+ * specialization arguments _CharT and _Traits were the same as those of
+ * @p __is.
+ *
+ * @param __is The input stream.
+ * @param __lcr A % linear_congruential random number generator.
+ * @returns __is.
+ */
+ template<class _UIntType1, _UIntType1 __a1, _UIntType1 __c1,
+ _UIntType1 __m1,
+ typename _CharT, typename _Traits>
+ friend std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ linear_congruential<_UIntType1, __a1, __c1, __m1>& __lcr);
+
+ private:
+ template<class _Gen>
+ void
+ seed(_Gen& __g, true_type)
+ { return seed(static_cast<unsigned long>(__g)); }
+
+ template<class _Gen>
+ void
+ seed(_Gen& __g, false_type);
+
+ _UIntType _M_x;
+ };
+
+ /**
+ * The classic Minimum Standard rand0 of Lewis, Goodman, and Miller.
+ */
+ typedef linear_congruential<unsigned long, 16807, 0, 2147483647> minstd_rand0;
+
+ /**
+ * An alternative LCR (Lehmer Generator function) .
+ */
+ typedef linear_congruential<unsigned long, 48271, 0, 2147483647> minstd_rand;
+
+
+ /**
+ * A generalized feedback shift register discrete random number generator.
+ *
+ * This algorithm avoids multiplication and division and is designed to be
+ * friendly to a pipelined architecture. If the parameters are chosen
+ * correctly, this generator will produce numbers with a very long period and
+ * fairly good apparent entropy, although still not cryptographically strong.
+ *
+ * The best way to use this generator is with the predefined mt19937 class.
+ *
+ * This algorithm was originally invented by Makoto Matsumoto and
+ * Takuji Nishimura.
+ *
+ * @var word_size The number of bits in each element of the state vector.
+ * @var state_size The degree of recursion.
+ * @var shift_size The period parameter.
+ * @var mask_bits The separation point bit index.
+ * @var parameter_a The last row of the twist matrix.
+ * @var output_u The first right-shift tempering matrix parameter.
+ * @var output_s The first left-shift tempering matrix parameter.
+ * @var output_b The first left-shift tempering matrix mask.
+ * @var output_t The second left-shift tempering matrix parameter.
+ * @var output_c The second left-shift tempering matrix mask.
+ * @var output_l The second right-shift tempering matrix parameter.
+ */
+ template<class _UIntType, int __w, int __n, int __m, int __r,
+ _UIntType __a, int __u, int __s, _UIntType __b, int __t,
+ _UIntType __c, int __l>
+ class mersenne_twister
+ {
+ __glibcxx_class_requires(_UIntType, _UnsignedIntegerConcept)
+
+ public:
+ // types
+ typedef _UIntType result_type;
+
+ // parameter values
+ static const int word_size = __w;
+ static const int state_size = __n;
+ static const int shift_size = __m;
+ static const int mask_bits = __r;
+ static const _UIntType parameter_a = __a;
+ static const int output_u = __u;
+ static const int output_s = __s;
+ static const _UIntType output_b = __b;
+ static const int output_t = __t;
+ static const _UIntType output_c = __c;
+ static const int output_l = __l;
+
+ // constructors and member function
+ mersenne_twister()
+ { seed(); }
+
+ explicit
+ mersenne_twister(unsigned long __value)
+ { seed(__value); }
+
+ template<class _Gen>
+ mersenne_twister(_Gen& __g)
+ { seed(__g); }
+
+ void
+ seed()
+ { seed(5489UL); }
+
+ void
+ seed(unsigned long __value);
+
+ template<class _Gen>
+ void
+ seed(_Gen& __g)
+ { seed(__g, typename is_fundamental<_Gen>::type()); }
+
+ result_type
+ min() const
+ { return 0; };
+
+ result_type
+ max() const
+ { return __detail::_Shift<_UIntType, __w>::__value - 1; }
+
+ result_type
+ operator()();
+
+ /**
+ * Compares two % mersenne_twister random number generator objects of
+ * the same type for equality.
+ *
+ * @param __lhs A % mersenne_twister random number generator object.
+ * @param __rhs Another % mersenne_twister random number generator
+ * object.
+ *
+ * @returns true if the two objects are equal, false otherwise.
+ */
+ friend bool
+ operator==(const mersenne_twister& __lhs,
+ const mersenne_twister& __rhs)
+ { return std::equal(__lhs._M_x, __lhs._M_x + state_size, __rhs._M_x); }
+
+ /**
+ * Compares two % mersenne_twister random number generator objects of
+ * the same type for inequality.
+ *
+ * @param __lhs A % mersenne_twister random number generator object.
+ * @param __rhs Another % mersenne_twister random number generator
+ * object.
+ *
+ * @returns true if the two objects are not equal, false otherwise.
+ */
+ friend bool
+ operator!=(const mersenne_twister& __lhs,
+ const mersenne_twister& __rhs)
+ { return !(__lhs == __rhs); }
+
+ /**
+ * Inserts the current state of a % mersenne_twister random number
+ * generator engine @p __x into the output stream @p __os.
+ *
+ * @param __os An output stream.
+ * @param __x A % mersenne_twister random number generator engine.
+ *
+ * @returns The output stream with the state of @p __x inserted or in
+ * an error state.
+ */
+ template<class _UIntType1, int __w1, int __n1, int __m1, int __r1,
+ _UIntType1 __a1, int __u1, int __s1, _UIntType1 __b1, int __t1,
+ _UIntType1 __c1, int __l1,
+ typename _CharT, typename _Traits>
+ friend std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const mersenne_twister<_UIntType1, __w1, __n1, __m1, __r1,
+ __a1, __u1, __s1, __b1, __t1, __c1, __l1>& __x);
+
+ /**
+ * Extracts the current state of a % mersenne_twister random number
+ * generator engine @p __x from the input stream @p __is.
+ *
+ * @param __is An input stream.
+ * @param __x A % mersenne_twister random number generator engine.
+ *
+ * @returns The input stream with the state of @p __x extracted or in
+ * an error state.
+ */
+ template<class _UIntType1, int __w1, int __n1, int __m1, int __r1,
+ _UIntType1 __a1, int __u1, int __s1, _UIntType1 __b1, int __t1,
+ _UIntType1 __c1, int __l1,
+ typename _CharT, typename _Traits>
+ friend std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ mersenne_twister<_UIntType1, __w1, __n1, __m1, __r1,
+ __a1, __u1, __s1, __b1, __t1, __c1, __l1>& __x);
+
+ private:
+ template<class _Gen>
+ void
+ seed(_Gen& __g, true_type)
+ { return seed(static_cast<unsigned long>(__g)); }
+
+ template<class _Gen>
+ void
+ seed(_Gen& __g, false_type);
+
+ _UIntType _M_x[state_size];
+ int _M_p;
+ };
+
+ /**
+ * The classic Mersenne Twister.
+ *
+ * Reference:
+ * M. Matsumoto and T. Nishimura, "Mersenne Twister: A 623-Dimensionally
+ * Equidistributed Uniform Pseudo-Random Number Generator", ACM Transactions
+ * on Modeling and Computer Simulation, Vol. 8, No. 1, January 1998, pp 3-30.
+ */
+ typedef mersenne_twister<
+ unsigned long, 32, 624, 397, 31,
+ 0x9908b0dful, 11, 7,
+ 0x9d2c5680ul, 15,
+ 0xefc60000ul, 18
+ > mt19937;
+
+
+ /**
+ * @brief The Marsaglia-Zaman generator.
+ *
+ * This is a model of a Generalized Fibonacci discrete random number
+ * generator, sometimes referred to as the SWC generator.
+ *
+ * A discrete random number generator that produces pseudorandom
+ * numbers using @f$x_{i}\leftarrow(x_{i - s} - x_{i - r} -
+ * carry_{i-1}) \bmod m @f$.
+ *
+ * The size of the state is @f$ r @f$
+ * and the maximum period of the generator is @f$ m^r - m^s -1 @f$.
+ *
+ * N1688[4.13] says "the template parameter _IntType shall denote an integral
+ * type large enough to store values up to m."
+ *
+ * @var _M_x The state of the generator. This is a ring buffer.
+ * @var _M_carry The carry.
+ * @var _M_p Current index of x(i - r).
+ */
+ template<typename _IntType, _IntType __m, int __s, int __r>
+ class subtract_with_carry
+ {
+ __glibcxx_class_requires(_IntType, _IntegerConcept)
+
+ public:
+ /** The type of the generated random value. */
+ typedef _IntType result_type;
+
+ // parameter values
+ static const _IntType modulus = __m;
+ static const int long_lag = __r;
+ static const int short_lag = __s;
+
+ /**
+ * Constructs a default-initialized % subtract_with_carry random number
+ * generator.
+ */
+ subtract_with_carry()
+ { this->seed(); }
+
+ /**
+ * Constructs an explicitly seeded % subtract_with_carry random number
+ * generator.
+ */
+ explicit
+ subtract_with_carry(unsigned long __value)
+ { this->seed(__value); }
+
+ /**
+ * Constructs a %subtract_with_carry random number generator engine
+ * seeded from the generator function @p __g.
+ *
+ * @param __g The seed generator function.
+ */
+ template<class _Gen>
+ subtract_with_carry(_Gen& __g)
+ { this->seed(__g); }
+
+ /**
+ * Seeds the initial state @f$ x_0 @f$ of the random number generator.
+ *
+ * N1688[4.19] modifies this as follows. If @p __value == 0,
+ * sets value to 19780503. In any case, with a linear
+ * congruential generator lcg(i) having parameters @f$ m_{lcg} =
+ * 2147483563, a_{lcg} = 40014, c_{lcg} = 0, and lcg(0) = value
+ * @f$, sets @f$ x_{-r} \dots x_{-1} @f$ to @f$ lcg(1) \bmod m
+ * \dots lcg(r) \bmod m @f$ respectively. If @f$ x_{-1} = 0 @f$
+ * set carry to 1, otherwise sets carry to 0.
+ */
+ void
+ seed(unsigned long __value = 19780503);
+
+ /**
+ * Seeds the initial state @f$ x_0 @f$ of the % subtract_with_carry
+ * random number generator.
+ */
+ template<class _Gen>
+ void
+ seed(_Gen& __g)
+ { seed(__g, typename is_fundamental<_Gen>::type()); }
+
+ /**
+ * Gets the inclusive minimum value of the range of random integers
+ * returned by this generator.
+ */
+ result_type
+ min() const
+ { return 0; }
+
+ /**
+ * Gets the inclusive maximum value of the range of random integers
+ * returned by this generator.
+ */
+ result_type
+ max() const
+ { return this->modulus - 1; }
+
+ /**
+ * Gets the next random number in the sequence.
+ */
+ result_type
+ operator()();
+
+ /**
+ * Compares two % subtract_with_carry random number generator objects of
+ * the same type for equality.
+ *
+ * @param __lhs A % subtract_with_carry random number generator object.
+ * @param __rhs Another % subtract_with_carry random number generator
+ * object.
+ *
+ * @returns true if the two objects are equal, false otherwise.
+ */
+ friend bool
+ operator==(const subtract_with_carry& __lhs,
+ const subtract_with_carry& __rhs)
+ { return std::equal(__lhs._M_x, __lhs._M_x + long_lag, __rhs._M_x); }
+
+ /**
+ * Compares two % subtract_with_carry random number generator objects of
+ * the same type for inequality.
+ *
+ * @param __lhs A % subtract_with_carry random number generator object.
+ * @param __rhs Another % subtract_with_carry random number generator
+ * object.
+ *
+ * @returns true if the two objects are not equal, false otherwise.
+ */
+ friend bool
+ operator!=(const subtract_with_carry& __lhs,
+ const subtract_with_carry& __rhs)
+ { return !(__lhs == __rhs); }
+
+ /**
+ * Inserts the current state of a % subtract_with_carry random number
+ * generator engine @p __x into the output stream @p __os.
+ *
+ * @param __os An output stream.
+ * @param __x A % subtract_with_carry random number generator engine.
+ *
+ * @returns The output stream with the state of @p __x inserted or in
+ * an error state.
+ */
+ template<typename _IntType1, _IntType1 __m1, int __s1, int __r1,
+ typename _CharT, typename _Traits>
+ friend std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const subtract_with_carry<_IntType1, __m1, __s1,
+ __r1>& __x);
+
+ /**
+ * Extracts the current state of a % subtract_with_carry random number
+ * generator engine @p __x from the input stream @p __is.
+ *
+ * @param __is An input stream.
+ * @param __x A % subtract_with_carry random number generator engine.
+ *
+ * @returns The input stream with the state of @p __x extracted or in
+ * an error state.
+ */
+ template<typename _IntType1, _IntType1 __m1, int __s1, int __r1,
+ typename _CharT, typename _Traits>
+ friend std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ subtract_with_carry<_IntType1, __m1, __s1, __r1>& __x);
+
+ private:
+ template<class _Gen>
+ void
+ seed(_Gen& __g, true_type)
+ { return seed(static_cast<unsigned long>(__g)); }
+
+ template<class _Gen>
+ void
+ seed(_Gen& __g, false_type);
+
+ typedef typename __gnu_cxx::__add_unsigned<_IntType>::__type _UIntType;
+
+ _UIntType _M_x[long_lag];
+ _UIntType _M_carry;
+ int _M_p;
+ };
+
+
+ /**
+ * @brief The Marsaglia-Zaman generator (floats version).
+ *
+ * @var _M_x The state of the generator. This is a ring buffer.
+ * @var _M_carry The carry.
+ * @var _M_p Current index of x(i - r).
+ * @var _M_npows Precomputed negative powers of 2.
+ */
+ template<typename _RealType, int __w, int __s, int __r>
+ class subtract_with_carry_01
+ {
+ public:
+ /** The type of the generated random value. */
+ typedef _RealType result_type;
+
+ // parameter values
+ static const int word_size = __w;
+ static const int long_lag = __r;
+ static const int short_lag = __s;
+
+ /**
+ * Constructs a default-initialized % subtract_with_carry_01 random
+ * number generator.
+ */
+ subtract_with_carry_01()
+ {
+ this->seed();
+ _M_initialize_npows();
+ }
+
+ /**
+ * Constructs an explicitly seeded % subtract_with_carry_01 random number
+ * generator.
+ */
+ explicit
+ subtract_with_carry_01(unsigned long __value)
+ {
+ this->seed(__value);
+ _M_initialize_npows();
+ }
+
+ /**
+ * Constructs a % subtract_with_carry_01 random number generator engine
+ * seeded from the generator function @p __g.
+ *
+ * @param __g The seed generator function.
+ */
+ template<class _Gen>
+ subtract_with_carry_01(_Gen& __g)
+ {
+ this->seed(__g);
+ _M_initialize_npows();
+ }
+
+ /**
+ * Seeds the initial state @f$ x_0 @f$ of the random number generator.
+ */
+ void
+ seed(unsigned long __value = 19780503);
+
+ /**
+ * Seeds the initial state @f$ x_0 @f$ of the % subtract_with_carry_01
+ * random number generator.
+ */
+ template<class _Gen>
+ void
+ seed(_Gen& __g)
+ { seed(__g, typename is_fundamental<_Gen>::type()); }
+
+ /**
+ * Gets the minimum value of the range of random floats
+ * returned by this generator.
+ */
+ result_type
+ min() const
+ { return 0.0; }
+
+ /**
+ * Gets the maximum value of the range of random floats
+ * returned by this generator.
+ */
+ result_type
+ max() const
+ { return 1.0; }
+
+ /**
+ * Gets the next random number in the sequence.
+ */
+ result_type
+ operator()();
+
+ /**
+ * Compares two % subtract_with_carry_01 random number generator objects
+ * of the same type for equality.
+ *
+ * @param __lhs A % subtract_with_carry_01 random number
+ * generator object.
+ * @param __rhs Another % subtract_with_carry_01 random number generator
+ * object.
+ *
+ * @returns true if the two objects are equal, false otherwise.
+ */
+ friend bool
+ operator==(const subtract_with_carry_01& __lhs,
+ const subtract_with_carry_01& __rhs)
+ {
+ for (int __i = 0; __i < long_lag; ++__i)
+ if (!std::equal(__lhs._M_x[__i], __lhs._M_x[__i] + __n,
+ __rhs._M_x[__i]))
+ return false;
+ return true;
+ }
+
+ /**
+ * Compares two % subtract_with_carry_01 random number generator objects
+ * of the same type for inequality.
+ *
+ * @param __lhs A % subtract_with_carry_01 random number
+ * generator object.
+ *
+ * @param __rhs Another % subtract_with_carry_01 random number generator
+ * object.
+ *
+ * @returns true if the two objects are not equal, false otherwise.
+ */
+ friend bool
+ operator!=(const subtract_with_carry_01& __lhs,
+ const subtract_with_carry_01& __rhs)
+ { return !(__lhs == __rhs); }
+
+ /**
+ * Inserts the current state of a % subtract_with_carry_01 random number
+ * generator engine @p __x into the output stream @p __os.
+ *
+ * @param __os An output stream.
+ * @param __x A % subtract_with_carry_01 random number generator engine.
+ *
+ * @returns The output stream with the state of @p __x inserted or in
+ * an error state.
+ */
+ template<typename _RealType1, int __w1, int __s1, int __r1,
+ typename _CharT, typename _Traits>
+ friend std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const subtract_with_carry_01<_RealType1, __w1, __s1,
+ __r1>& __x);
+
+ /**
+ * Extracts the current state of a % subtract_with_carry_01 random number
+ * generator engine @p __x from the input stream @p __is.
+ *
+ * @param __is An input stream.
+ * @param __x A % subtract_with_carry_01 random number generator engine.
+ *
+ * @returns The input stream with the state of @p __x extracted or in
+ * an error state.
+ */
+ template<typename _RealType1, int __w1, int __s1, int __r1,
+ typename _CharT, typename _Traits>
+ friend std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ subtract_with_carry_01<_RealType1, __w1, __s1, __r1>& __x);
+
+ private:
+ template<class _Gen>
+ void
+ seed(_Gen& __g, true_type)
+ { return seed(static_cast<unsigned long>(__g)); }
+
+ template<class _Gen>
+ void
+ seed(_Gen& __g, false_type);
+
+ void
+ _M_initialize_npows();
+
+ static const int __n = (__w + 31) / 32;
+
+ typedef __detail::_UInt32Type _UInt32Type;
+ _UInt32Type _M_x[long_lag][__n];
+ _RealType _M_npows[__n];
+ _UInt32Type _M_carry;
+ int _M_p;
+ };
+
+ typedef subtract_with_carry_01<float, 24, 10, 24> ranlux_base_01;
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 508. Bad parameters for ranlux64_base_01.
+ typedef subtract_with_carry_01<double, 48, 5, 12> ranlux64_base_01;
+
+
+ /**
+ * Produces random numbers from some base engine by discarding blocks of
+ * data.
+ *
+ * 0 <= @p __r <= @p __p
+ */
+ template<class _UniformRandomNumberGenerator, int __p, int __r>
+ class discard_block
+ {
+ // __glibcxx_class_requires(typename base_type::result_type,
+ // ArithmeticTypeConcept)
+
+ public:
+ /** The type of the underlying generator engine. */
+ typedef _UniformRandomNumberGenerator base_type;
+ /** The type of the generated random value. */
+ typedef typename base_type::result_type result_type;
+
+ // parameter values
+ static const int block_size = __p;
+ static const int used_block = __r;
+
+ /**
+ * Constructs a default %discard_block engine.
+ *
+ * The underlying engine is default constructed as well.
+ */
+ discard_block()
+ : _M_n(0) { }
+
+ /**
+ * Copy constructs a %discard_block engine.
+ *
+ * Copies an existing base class random number generator.
+ * @param rng An existing (base class) engine object.
+ */
+ explicit
+ discard_block(const base_type& __rng)
+ : _M_b(__rng), _M_n(0) { }
+
+ /**
+ * Seed constructs a %discard_block engine.
+ *
+ * Constructs the underlying generator engine seeded with @p __s.
+ * @param __s A seed value for the base class engine.
+ */
+ explicit
+ discard_block(unsigned long __s)
+ : _M_b(__s), _M_n(0) { }
+
+ /**
+ * Generator construct a %discard_block engine.
+ *
+ * @param __g A seed generator function.
+ */
+ template<class _Gen>
+ discard_block(_Gen& __g)
+ : _M_b(__g), _M_n(0) { }
+
+ /**
+ * Reseeds the %discard_block object with the default seed for the
+ * underlying base class generator engine.
+ */
+ void seed()
+ {
+ _M_b.seed();
+ _M_n = 0;
+ }
+
+ /**
+ * Reseeds the %discard_block object with the given seed generator
+ * function.
+ * @param __g A seed generator function.
+ */
+ template<class _Gen>
+ void seed(_Gen& __g)
+ {
+ _M_b.seed(__g);
+ _M_n = 0;
+ }
+
+ /**
+ * Gets a const reference to the underlying generator engine object.
+ */
+ const base_type&
+ base() const
+ { return _M_b; }
+
+ /**
+ * Gets the minimum value in the generated random number range.
+ */
+ result_type
+ min() const
+ { return _M_b.min(); }
+
+ /**
+ * Gets the maximum value in the generated random number range.
+ */
+ result_type
+ max() const
+ { return _M_b.max(); }
+
+ /**
+ * Gets the next value in the generated random number sequence.
+ */
+ result_type
+ operator()();
+
+ /**
+ * Compares two %discard_block random number generator objects of
+ * the same type for equality.
+ *
+ * @param __lhs A %discard_block random number generator object.
+ * @param __rhs Another %discard_block random number generator
+ * object.
+ *
+ * @returns true if the two objects are equal, false otherwise.
+ */
+ friend bool
+ operator==(const discard_block& __lhs, const discard_block& __rhs)
+ { return (__lhs._M_b == __rhs._M_b) && (__lhs._M_n == __rhs._M_n); }
+
+ /**
+ * Compares two %discard_block random number generator objects of
+ * the same type for inequality.
+ *
+ * @param __lhs A %discard_block random number generator object.
+ * @param __rhs Another %discard_block random number generator
+ * object.
+ *
+ * @returns true if the two objects are not equal, false otherwise.
+ */
+ friend bool
+ operator!=(const discard_block& __lhs, const discard_block& __rhs)
+ { return !(__lhs == __rhs); }
+
+ /**
+ * Inserts the current state of a %discard_block random number
+ * generator engine @p __x into the output stream @p __os.
+ *
+ * @param __os An output stream.
+ * @param __x A %discard_block random number generator engine.
+ *
+ * @returns The output stream with the state of @p __x inserted or in
+ * an error state.
+ */
+ template<class _UniformRandomNumberGenerator1, int __p1, int __r1,
+ typename _CharT, typename _Traits>
+ friend std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const discard_block<_UniformRandomNumberGenerator1,
+ __p1, __r1>& __x);
+
+ /**
+ * Extracts the current state of a % subtract_with_carry random number
+ * generator engine @p __x from the input stream @p __is.
+ *
+ * @param __is An input stream.
+ * @param __x A %discard_block random number generator engine.
+ *
+ * @returns The input stream with the state of @p __x extracted or in
+ * an error state.
+ */
+ template<class _UniformRandomNumberGenerator1, int __p1, int __r1,
+ typename _CharT, typename _Traits>
+ friend std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ discard_block<_UniformRandomNumberGenerator1,
+ __p1, __r1>& __x);
+
+ private:
+ base_type _M_b;
+ int _M_n;
+ };
+
+
+ /**
+ * James's luxury-level-3 integer adaptation of Luescher's generator.
+ */
+ typedef discard_block<
+ subtract_with_carry<unsigned long, (1UL << 24), 10, 24>,
+ 223,
+ 24
+ > ranlux3;
+
+ /**
+ * James's luxury-level-4 integer adaptation of Luescher's generator.
+ */
+ typedef discard_block<
+ subtract_with_carry<unsigned long, (1UL << 24), 10, 24>,
+ 389,
+ 24
+ > ranlux4;
+
+ typedef discard_block<
+ subtract_with_carry_01<float, 24, 10, 24>,
+ 223,
+ 24
+ > ranlux3_01;
+
+ typedef discard_block<
+ subtract_with_carry_01<float, 24, 10, 24>,
+ 389,
+ 24
+ > ranlux4_01;
+
+
+ /**
+ * A random number generator adaptor class that combines two random number
+ * generator engines into a single output sequence.
+ */
+ template<class _UniformRandomNumberGenerator1, int __s1,
+ class _UniformRandomNumberGenerator2, int __s2>
+ class xor_combine
+ {
+ // __glibcxx_class_requires(typename _UniformRandomNumberGenerator1::
+ // result_type, ArithmeticTypeConcept)
+ // __glibcxx_class_requires(typename _UniformRandomNumberGenerator2::
+ // result_type, ArithmeticTypeConcept)
+
+ public:
+ /** The type of the first underlying generator engine. */
+ typedef _UniformRandomNumberGenerator1 base1_type;
+ /** The type of the second underlying generator engine. */
+ typedef _UniformRandomNumberGenerator2 base2_type;
+
+ private:
+ typedef typename base1_type::result_type _Result_type1;
+ typedef typename base2_type::result_type _Result_type2;
+
+ public:
+ /** The type of the generated random value. */
+ typedef typename __gnu_cxx::__conditional_type<(sizeof(_Result_type1)
+ > sizeof(_Result_type2)),
+ _Result_type1, _Result_type2>::__type result_type;
+
+ // parameter values
+ static const int shift1 = __s1;
+ static const int shift2 = __s2;
+
+ // constructors and member function
+ xor_combine()
+ : _M_b1(), _M_b2()
+ { _M_initialize_max(); }
+
+ xor_combine(const base1_type& __rng1, const base2_type& __rng2)
+ : _M_b1(__rng1), _M_b2(__rng2)
+ { _M_initialize_max(); }
+
+ xor_combine(unsigned long __s)
+ : _M_b1(__s), _M_b2(__s + 1)
+ { _M_initialize_max(); }
+
+ template<class _Gen>
+ xor_combine(_Gen& __g)
+ : _M_b1(__g), _M_b2(__g)
+ { _M_initialize_max(); }
+
+ void
+ seed()
+ {
+ _M_b1.seed();
+ _M_b2.seed();
+ }
+
+ template<class _Gen>
+ void
+ seed(_Gen& __g)
+ {
+ _M_b1.seed(__g);
+ _M_b2.seed(__g);
+ }
+
+ const base1_type&
+ base1() const
+ { return _M_b1; }
+
+ const base2_type&
+ base2() const
+ { return _M_b2; }
+
+ result_type
+ min() const
+ { return 0; }
+
+ result_type
+ max() const
+ { return _M_max; }
+
+ /**
+ * Gets the next random number in the sequence.
+ */
+ // NB: Not exactly the TR1 formula, per N2079 instead.
+ result_type
+ operator()()
+ {
+ return ((result_type(_M_b1() - _M_b1.min()) << shift1)
+ ^ (result_type(_M_b2() - _M_b2.min()) << shift2));
+ }
+
+ /**
+ * Compares two %xor_combine random number generator objects of
+ * the same type for equality.
+ *
+ * @param __lhs A %xor_combine random number generator object.
+ * @param __rhs Another %xor_combine random number generator
+ * object.
+ *
+ * @returns true if the two objects are equal, false otherwise.
+ */
+ friend bool
+ operator==(const xor_combine& __lhs, const xor_combine& __rhs)
+ {
+ return (__lhs.base1() == __rhs.base1())
+ && (__lhs.base2() == __rhs.base2());
+ }
+
+ /**
+ * Compares two %xor_combine random number generator objects of
+ * the same type for inequality.
+ *
+ * @param __lhs A %xor_combine random number generator object.
+ * @param __rhs Another %xor_combine random number generator
+ * object.
+ *
+ * @returns true if the two objects are not equal, false otherwise.
+ */
+ friend bool
+ operator!=(const xor_combine& __lhs, const xor_combine& __rhs)
+ { return !(__lhs == __rhs); }
+
+ /**
+ * Inserts the current state of a %xor_combine random number
+ * generator engine @p __x into the output stream @p __os.
+ *
+ * @param __os An output stream.
+ * @param __x A %xor_combine random number generator engine.
+ *
+ * @returns The output stream with the state of @p __x inserted or in
+ * an error state.
+ */
+ template<class _UniformRandomNumberGenerator11, int __s11,
+ class _UniformRandomNumberGenerator21, int __s21,
+ typename _CharT, typename _Traits>
+ friend std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const xor_combine<_UniformRandomNumberGenerator11, __s11,
+ _UniformRandomNumberGenerator21, __s21>& __x);
+
+ /**
+ * Extracts the current state of a %xor_combine random number
+ * generator engine @p __x from the input stream @p __is.
+ *
+ * @param __is An input stream.
+ * @param __x A %xor_combine random number generator engine.
+ *
+ * @returns The input stream with the state of @p __x extracted or in
+ * an error state.
+ */
+ template<class _UniformRandomNumberGenerator11, int __s11,
+ class _UniformRandomNumberGenerator21, int __s21,
+ typename _CharT, typename _Traits>
+ friend std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ xor_combine<_UniformRandomNumberGenerator11, __s11,
+ _UniformRandomNumberGenerator21, __s21>& __x);
+
+ private:
+ void
+ _M_initialize_max();
+
+ result_type
+ _M_initialize_max_aux(result_type, result_type, int);
+
+ base1_type _M_b1;
+ base2_type _M_b2;
+ result_type _M_max;
+ };
+
+
+ /**
+ * A standard interface to a platform-specific non-deterministic
+ * random number generator (if any are available).
+ */
+ class random_device
+ {
+ public:
+ // types
+ typedef unsigned int result_type;
+
+ // constructors, destructors and member functions
+
+#ifdef _GLIBCXX_USE_RANDOM_TR1
+
+ explicit
+ random_device(const std::string& __token = "/dev/urandom")
+ {
+ if ((__token != "/dev/urandom" && __token != "/dev/random")
+ || !(_M_file = std::fopen(__token.c_str(), "rb")))
+ std::__throw_runtime_error(__N("random_device::"
+ "random_device(const std::string&)"));
+ }
+
+ ~random_device()
+ { std::fclose(_M_file); }
+
+#else
+
+ explicit
+ random_device(const std::string& __token = "mt19937")
+ : _M_mt(_M_strtoul(__token)) { }
+
+ private:
+ static unsigned long
+ _M_strtoul(const std::string& __str)
+ {
+ unsigned long __ret = 5489UL;
+ if (__str != "mt19937")
+ {
+ const char* __nptr = __str.c_str();
+ char* __endptr;
+ __ret = std::strtoul(__nptr, &__endptr, 0);
+ if (*__nptr == '\0' || *__endptr != '\0')
+ std::__throw_runtime_error(__N("random_device::_M_strtoul"
+ "(const std::string&)"));
+ }
+ return __ret;
+ }
+
+ public:
+
+#endif
+
+ result_type
+ min() const
+ { return std::numeric_limits<result_type>::min(); }
+
+ result_type
+ max() const
+ { return std::numeric_limits<result_type>::max(); }
+
+ double
+ entropy() const
+ { return 0.0; }
+
+ result_type
+ operator()()
+ {
+#ifdef _GLIBCXX_USE_RANDOM_TR1
+ result_type __ret;
+ std::fread(reinterpret_cast<void*>(&__ret), sizeof(result_type),
+ 1, _M_file);
+ return __ret;
+#else
+ return _M_mt();
+#endif
+ }
+
+ private:
+ random_device(const random_device&);
+ void operator=(const random_device&);
+
+#ifdef _GLIBCXX_USE_RANDOM_TR1
+ FILE* _M_file;
+#else
+ mt19937 _M_mt;
+#endif
+ };
+
+ /* @} */ // group tr1_random_generators
+
+ /**
+ * @defgroup tr1_random_distributions Random Number Distributions
+ * @ingroup tr1_random
+ * @{
+ */
+
+ /**
+ * @defgroup tr1_random_distributions_discrete Discrete Distributions
+ * @ingroup tr1_random_distributions
+ * @{
+ */
+
+ /**
+ * @brief Uniform discrete distribution for random numbers.
+ * A discrete random distribution on the range @f$[min, max]@f$ with equal
+ * probability throughout the range.
+ */
+ template<typename _IntType = int>
+ class uniform_int
+ {
+ __glibcxx_class_requires(_IntType, _IntegerConcept)
+
+ public:
+ /** The type of the parameters of the distribution. */
+ typedef _IntType input_type;
+ /** The type of the range of the distribution. */
+ typedef _IntType result_type;
+
+ public:
+ /**
+ * Constructs a uniform distribution object.
+ */
+ explicit
+ uniform_int(_IntType __min = 0, _IntType __max = 9)
+ : _M_min(__min), _M_max(__max)
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_min <= _M_max);
+ }
+
+ /**
+ * Gets the inclusive lower bound of the distribution range.
+ */
+ result_type
+ min() const
+ { return _M_min; }
+
+ /**
+ * Gets the inclusive upper bound of the distribution range.
+ */
+ result_type
+ max() const
+ { return _M_max; }
+
+ /**
+ * Resets the distribution state.
+ *
+ * Does nothing for the uniform integer distribution.
+ */
+ void
+ reset() { }
+
+ /**
+ * Gets a uniformly distributed random number in the range
+ * @f$(min, max)@f$.
+ */
+ template<typename _UniformRandomNumberGenerator>
+ result_type
+ operator()(_UniformRandomNumberGenerator& __urng)
+ {
+ typedef typename _UniformRandomNumberGenerator::result_type
+ _UResult_type;
+ return _M_call(__urng, _M_min, _M_max,
+ typename is_integral<_UResult_type>::type());
+ }
+
+ /**
+ * Gets a uniform random number in the range @f$[0, n)@f$.
+ *
+ * This function is aimed at use with std::random_shuffle.
+ */
+ template<typename _UniformRandomNumberGenerator>
+ result_type
+ operator()(_UniformRandomNumberGenerator& __urng, result_type __n)
+ {
+ typedef typename _UniformRandomNumberGenerator::result_type
+ _UResult_type;
+ return _M_call(__urng, 0, __n - 1,
+ typename is_integral<_UResult_type>::type());
+ }
+
+ /**
+ * Inserts a %uniform_int random number distribution @p __x into the
+ * output stream @p os.
+ *
+ * @param __os An output stream.
+ * @param __x A %uniform_int random number distribution.
+ *
+ * @returns The output stream with the state of @p __x inserted or in
+ * an error state.
+ */
+ template<typename _IntType1, typename _CharT, typename _Traits>
+ friend std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const uniform_int<_IntType1>& __x);
+
+ /**
+ * Extracts a %uniform_int random number distribution
+ * @p __x from the input stream @p __is.
+ *
+ * @param __is An input stream.
+ * @param __x A %uniform_int random number generator engine.
+ *
+ * @returns The input stream with @p __x extracted or in an error state.
+ */
+ template<typename _IntType1, typename _CharT, typename _Traits>
+ friend std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ uniform_int<_IntType1>& __x);
+
+ private:
+ template<typename _UniformRandomNumberGenerator>
+ result_type
+ _M_call(_UniformRandomNumberGenerator& __urng,
+ result_type __min, result_type __max, true_type);
+
+ template<typename _UniformRandomNumberGenerator>
+ result_type
+ _M_call(_UniformRandomNumberGenerator& __urng,
+ result_type __min, result_type __max, false_type)
+ {
+ return result_type((__urng() - __urng.min())
+ / (__urng.max() - __urng.min())
+ * (__max - __min + 1)) + __min;
+ }
+
+ _IntType _M_min;
+ _IntType _M_max;
+ };
+
+
+ /**
+ * @brief A Bernoulli random number distribution.
+ *
+ * Generates a sequence of true and false values with likelihood @f$ p @f$
+ * that true will come up and @f$ (1 - p) @f$ that false will appear.
+ */
+ class bernoulli_distribution
+ {
+ public:
+ typedef int input_type;
+ typedef bool result_type;
+
+ public:
+ /**
+ * Constructs a Bernoulli distribution with likelihood @p p.
+ *
+ * @param __p [IN] The likelihood of a true result being returned. Must
+ * be in the interval @f$ [0, 1] @f$.
+ */
+ explicit
+ bernoulli_distribution(double __p = 0.5)
+ : _M_p(__p)
+ {
+ _GLIBCXX_DEBUG_ASSERT((_M_p >= 0.0) && (_M_p <= 1.0));
+ }
+
+ /**
+ * Gets the @p p parameter of the distribution.
+ */
+ double
+ p() const
+ { return _M_p; }
+
+ /**
+ * Resets the distribution state.
+ *
+ * Does nothing for a Bernoulli distribution.
+ */
+ void
+ reset() { }
+
+ /**
+ * Gets the next value in the Bernoullian sequence.
+ */
+ template<class _UniformRandomNumberGenerator>
+ result_type
+ operator()(_UniformRandomNumberGenerator& __urng)
+ {
+ if ((__urng() - __urng.min()) < _M_p * (__urng.max() - __urng.min()))
+ return true;
+ return false;
+ }
+
+ /**
+ * Inserts a %bernoulli_distribution random number distribution
+ * @p __x into the output stream @p __os.
+ *
+ * @param __os An output stream.
+ * @param __x A %bernoulli_distribution random number distribution.
+ *
+ * @returns The output stream with the state of @p __x inserted or in
+ * an error state.
+ */
+ template<typename _CharT, typename _Traits>
+ friend std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const bernoulli_distribution& __x);
+
+ /**
+ * Extracts a %bernoulli_distribution random number distribution
+ * @p __x from the input stream @p __is.
+ *
+ * @param __is An input stream.
+ * @param __x A %bernoulli_distribution random number generator engine.
+ *
+ * @returns The input stream with @p __x extracted or in an error state.
+ */
+ template<typename _CharT, typename _Traits>
+ friend std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ bernoulli_distribution& __x)
+ { return __is >> __x._M_p; }
+
+ private:
+ double _M_p;
+ };
+
+
+ /**
+ * @brief A discrete geometric random number distribution.
+ *
+ * The formula for the geometric probability mass function is
+ * @f$ p(i) = (1 - p)p^{i-1} @f$ where @f$ p @f$ is the parameter of the
+ * distribution.
+ */
+ template<typename _IntType = int, typename _RealType = double>
+ class geometric_distribution
+ {
+ public:
+ // types
+ typedef _RealType input_type;
+ typedef _IntType result_type;
+
+ // constructors and member function
+ explicit
+ geometric_distribution(const _RealType& __p = _RealType(0.5))
+ : _M_p(__p)
+ {
+ _GLIBCXX_DEBUG_ASSERT((_M_p > 0.0) && (_M_p < 1.0));
+ _M_initialize();
+ }
+
+ /**
+ * Gets the distribution parameter @p p.
+ */
+ _RealType
+ p() const
+ { return _M_p; }
+
+ void
+ reset() { }
+
+ template<class _UniformRandomNumberGenerator>
+ result_type
+ operator()(_UniformRandomNumberGenerator& __urng);
+
+ /**
+ * Inserts a %geometric_distribution random number distribution
+ * @p __x into the output stream @p __os.
+ *
+ * @param __os An output stream.
+ * @param __x A %geometric_distribution random number distribution.
+ *
+ * @returns The output stream with the state of @p __x inserted or in
+ * an error state.
+ */
+ template<typename _IntType1, typename _RealType1,
+ typename _CharT, typename _Traits>
+ friend std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const geometric_distribution<_IntType1, _RealType1>& __x);
+
+ /**
+ * Extracts a %geometric_distribution random number distribution
+ * @p __x from the input stream @p __is.
+ *
+ * @param __is An input stream.
+ * @param __x A %geometric_distribution random number generator engine.
+ *
+ * @returns The input stream with @p __x extracted or in an error state.
+ */
+ template<typename _CharT, typename _Traits>
+ friend std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ geometric_distribution& __x)
+ {
+ __is >> __x._M_p;
+ __x._M_initialize();
+ return __is;
+ }
+
+ private:
+ void
+ _M_initialize()
+ { _M_log_p = std::log(_M_p); }
+
+ _RealType _M_p;
+ _RealType _M_log_p;
+ };
+
+
+ template<typename _RealType>
+ class normal_distribution;
+
+ /**
+ * @brief A discrete Poisson random number distribution.
+ *
+ * The formula for the Poisson probability mass function is
+ * @f$ p(i) = \frac{mean^i}{i!} e^{-mean} @f$ where @f$ mean @f$ is the
+ * parameter of the distribution.
+ */
+ template<typename _IntType = int, typename _RealType = double>
+ class poisson_distribution
+ {
+ public:
+ // types
+ typedef _RealType input_type;
+ typedef _IntType result_type;
+
+ // constructors and member function
+ explicit
+ poisson_distribution(const _RealType& __mean = _RealType(1))
+ : _M_mean(__mean), _M_nd()
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_mean > 0.0);
+ _M_initialize();
+ }
+
+ /**
+ * Gets the distribution parameter @p mean.
+ */
+ _RealType
+ mean() const
+ { return _M_mean; }
+
+ void
+ reset()
+ { _M_nd.reset(); }
+
+ template<class _UniformRandomNumberGenerator>
+ result_type
+ operator()(_UniformRandomNumberGenerator& __urng);
+
+ /**
+ * Inserts a %poisson_distribution random number distribution
+ * @p __x into the output stream @p __os.
+ *
+ * @param __os An output stream.
+ * @param __x A %poisson_distribution random number distribution.
+ *
+ * @returns The output stream with the state of @p __x inserted or in
+ * an error state.
+ */
+ template<typename _IntType1, typename _RealType1,
+ typename _CharT, typename _Traits>
+ friend std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const poisson_distribution<_IntType1, _RealType1>& __x);
+
+ /**
+ * Extracts a %poisson_distribution random number distribution
+ * @p __x from the input stream @p __is.
+ *
+ * @param __is An input stream.
+ * @param __x A %poisson_distribution random number generator engine.
+ *
+ * @returns The input stream with @p __x extracted or in an error state.
+ */
+ template<typename _IntType1, typename _RealType1,
+ typename _CharT, typename _Traits>
+ friend std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ poisson_distribution<_IntType1, _RealType1>& __x);
+
+ private:
+ void
+ _M_initialize();
+
+ // NB: Unused when _GLIBCXX_USE_C99_MATH_TR1 is undefined.
+ normal_distribution<_RealType> _M_nd;
+
+ _RealType _M_mean;
+
+ // Hosts either log(mean) or the threshold of the simple method.
+ _RealType _M_lm_thr;
+#if _GLIBCXX_USE_C99_MATH_TR1
+ _RealType _M_lfm, _M_sm, _M_d, _M_scx, _M_1cx, _M_c2b, _M_cb;
+#endif
+ };
+
+
+ /**
+ * @brief A discrete binomial random number distribution.
+ *
+ * The formula for the binomial probability mass function is
+ * @f$ p(i) = \binom{n}{i} p^i (1 - p)^{t - i} @f$ where @f$ t @f$
+ * and @f$ p @f$ are the parameters of the distribution.
+ */
+ template<typename _IntType = int, typename _RealType = double>
+ class binomial_distribution
+ {
+ public:
+ // types
+ typedef _RealType input_type;
+ typedef _IntType result_type;
+
+ // constructors and member function
+ explicit
+ binomial_distribution(_IntType __t = 1,
+ const _RealType& __p = _RealType(0.5))
+ : _M_t(__t), _M_p(__p), _M_nd()
+ {
+ _GLIBCXX_DEBUG_ASSERT((_M_t >= 0) && (_M_p >= 0.0) && (_M_p <= 1.0));
+ _M_initialize();
+ }
+
+ /**
+ * Gets the distribution @p t parameter.
+ */
+ _IntType
+ t() const
+ { return _M_t; }
+
+ /**
+ * Gets the distribution @p p parameter.
+ */
+ _RealType
+ p() const
+ { return _M_p; }
+
+ void
+ reset()
+ { _M_nd.reset(); }
+
+ template<class _UniformRandomNumberGenerator>
+ result_type
+ operator()(_UniformRandomNumberGenerator& __urng);
+
+ /**
+ * Inserts a %binomial_distribution random number distribution
+ * @p __x into the output stream @p __os.
+ *
+ * @param __os An output stream.
+ * @param __x A %binomial_distribution random number distribution.
+ *
+ * @returns The output stream with the state of @p __x inserted or in
+ * an error state.
+ */
+ template<typename _IntType1, typename _RealType1,
+ typename _CharT, typename _Traits>
+ friend std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const binomial_distribution<_IntType1, _RealType1>& __x);
+
+ /**
+ * Extracts a %binomial_distribution random number distribution
+ * @p __x from the input stream @p __is.
+ *
+ * @param __is An input stream.
+ * @param __x A %binomial_distribution random number generator engine.
+ *
+ * @returns The input stream with @p __x extracted or in an error state.
+ */
+ template<typename _IntType1, typename _RealType1,
+ typename _CharT, typename _Traits>
+ friend std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ binomial_distribution<_IntType1, _RealType1>& __x);
+
+ private:
+ void
+ _M_initialize();
+
+ template<class _UniformRandomNumberGenerator>
+ result_type
+ _M_waiting(_UniformRandomNumberGenerator& __urng, _IntType __t);
+
+ // NB: Unused when _GLIBCXX_USE_C99_MATH_TR1 is undefined.
+ normal_distribution<_RealType> _M_nd;
+
+ _RealType _M_q;
+#if _GLIBCXX_USE_C99_MATH_TR1
+ _RealType _M_d1, _M_d2, _M_s1, _M_s2, _M_c,
+ _M_a1, _M_a123, _M_s, _M_lf, _M_lp1p;
+#endif
+ _RealType _M_p;
+ _IntType _M_t;
+
+ bool _M_easy;
+ };
+
+ /* @} */ // group tr1_random_distributions_discrete
+
+ /**
+ * @defgroup tr1_random_distributions_continuous Continuous Distributions
+ * @ingroup tr1_random_distributions
+ * @{
+ */
+
+ /**
+ * @brief Uniform continuous distribution for random numbers.
+ *
+ * A continuous random distribution on the range [min, max) with equal
+ * probability throughout the range. The URNG should be real-valued and
+ * deliver number in the range [0, 1).
+ */
+ template<typename _RealType = double>
+ class uniform_real
+ {
+ public:
+ // types
+ typedef _RealType input_type;
+ typedef _RealType result_type;
+
+ public:
+ /**
+ * Constructs a uniform_real object.
+ *
+ * @param __min [IN] The lower bound of the distribution.
+ * @param __max [IN] The upper bound of the distribution.
+ */
+ explicit
+ uniform_real(_RealType __min = _RealType(0),
+ _RealType __max = _RealType(1))
+ : _M_min(__min), _M_max(__max)
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_min <= _M_max);
+ }
+
+ result_type
+ min() const
+ { return _M_min; }
+
+ result_type
+ max() const
+ { return _M_max; }
+
+ void
+ reset() { }
+
+ template<class _UniformRandomNumberGenerator>
+ result_type
+ operator()(_UniformRandomNumberGenerator& __urng)
+ { return (__urng() * (_M_max - _M_min)) + _M_min; }
+
+ /**
+ * Inserts a %uniform_real random number distribution @p __x into the
+ * output stream @p __os.
+ *
+ * @param __os An output stream.
+ * @param __x A %uniform_real random number distribution.
+ *
+ * @returns The output stream with the state of @p __x inserted or in
+ * an error state.
+ */
+ template<typename _RealType1, typename _CharT, typename _Traits>
+ friend std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const uniform_real<_RealType1>& __x);
+
+ /**
+ * Extracts a %uniform_real random number distribution
+ * @p __x from the input stream @p __is.
+ *
+ * @param __is An input stream.
+ * @param __x A %uniform_real random number generator engine.
+ *
+ * @returns The input stream with @p __x extracted or in an error state.
+ */
+ template<typename _RealType1, typename _CharT, typename _Traits>
+ friend std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ uniform_real<_RealType1>& __x);
+
+ private:
+ _RealType _M_min;
+ _RealType _M_max;
+ };
+
+
+ /**
+ * @brief An exponential continuous distribution for random numbers.
+ *
+ * The formula for the exponential probability mass function is
+ * @f$ p(x) = \lambda e^{-\lambda x} @f$.
+ *
+ * <table border=1 cellpadding=10 cellspacing=0>
+ * <caption align=top>Distribution Statistics</caption>
+ * <tr><td>Mean</td><td>@f$ \frac{1}{\lambda} @f$</td></tr>
+ * <tr><td>Median</td><td>@f$ \frac{\ln 2}{\lambda} @f$</td></tr>
+ * <tr><td>Mode</td><td>@f$ zero @f$</td></tr>
+ * <tr><td>Range</td><td>@f$[0, \infty]@f$</td></tr>
+ * <tr><td>Standard Deviation</td><td>@f$ \frac{1}{\lambda} @f$</td></tr>
+ * </table>
+ */
+ template<typename _RealType = double>
+ class exponential_distribution
+ {
+ public:
+ // types
+ typedef _RealType input_type;
+ typedef _RealType result_type;
+
+ public:
+ /**
+ * Constructs an exponential distribution with inverse scale parameter
+ * @f$ \lambda @f$.
+ */
+ explicit
+ exponential_distribution(const result_type& __lambda = result_type(1))
+ : _M_lambda(__lambda)
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_lambda > 0);
+ }
+
+ /**
+ * Gets the inverse scale parameter of the distribution.
+ */
+ _RealType
+ lambda() const
+ { return _M_lambda; }
+
+ /**
+ * Resets the distribution.
+ *
+ * Has no effect on exponential distributions.
+ */
+ void
+ reset() { }
+
+ template<class _UniformRandomNumberGenerator>
+ result_type
+ operator()(_UniformRandomNumberGenerator& __urng)
+ { return -std::log(__urng()) / _M_lambda; }
+
+ /**
+ * Inserts a %exponential_distribution random number distribution
+ * @p __x into the output stream @p __os.
+ *
+ * @param __os An output stream.
+ * @param __x A %exponential_distribution random number distribution.
+ *
+ * @returns The output stream with the state of @p __x inserted or in
+ * an error state.
+ */
+ template<typename _RealType1, typename _CharT, typename _Traits>
+ friend std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const exponential_distribution<_RealType1>& __x);
+
+ /**
+ * Extracts a %exponential_distribution random number distribution
+ * @p __x from the input stream @p __is.
+ *
+ * @param __is An input stream.
+ * @param __x A %exponential_distribution random number
+ * generator engine.
+ *
+ * @returns The input stream with @p __x extracted or in an error state.
+ */
+ template<typename _CharT, typename _Traits>
+ friend std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ exponential_distribution& __x)
+ { return __is >> __x._M_lambda; }
+
+ private:
+ result_type _M_lambda;
+ };
+
+
+ /**
+ * @brief A normal continuous distribution for random numbers.
+ *
+ * The formula for the normal probability mass function is
+ * @f$ p(x) = \frac{1}{\sigma \sqrt{2 \pi}}
+ * e^{- \frac{{x - mean}^ {2}}{2 \sigma ^ {2}} } @f$.
+ */
+ template<typename _RealType = double>
+ class normal_distribution
+ {
+ public:
+ // types
+ typedef _RealType input_type;
+ typedef _RealType result_type;
+
+ public:
+ /**
+ * Constructs a normal distribution with parameters @f$ mean @f$ and
+ * @f$ \sigma @f$.
+ */
+ explicit
+ normal_distribution(const result_type& __mean = result_type(0),
+ const result_type& __sigma = result_type(1))
+ : _M_mean(__mean), _M_sigma(__sigma), _M_saved_available(false)
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_sigma > 0);
+ }
+
+ /**
+ * Gets the mean of the distribution.
+ */
+ _RealType
+ mean() const
+ { return _M_mean; }
+
+ /**
+ * Gets the @f$ \sigma @f$ of the distribution.
+ */
+ _RealType
+ sigma() const
+ { return _M_sigma; }
+
+ /**
+ * Resets the distribution.
+ */
+ void
+ reset()
+ { _M_saved_available = false; }
+
+ template<class _UniformRandomNumberGenerator>
+ result_type
+ operator()(_UniformRandomNumberGenerator& __urng);
+
+ /**
+ * Inserts a %normal_distribution random number distribution
+ * @p __x into the output stream @p __os.
+ *
+ * @param __os An output stream.
+ * @param __x A %normal_distribution random number distribution.
+ *
+ * @returns The output stream with the state of @p __x inserted or in
+ * an error state.
+ */
+ template<typename _RealType1, typename _CharT, typename _Traits>
+ friend std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const normal_distribution<_RealType1>& __x);
+
+ /**
+ * Extracts a %normal_distribution random number distribution
+ * @p __x from the input stream @p __is.
+ *
+ * @param __is An input stream.
+ * @param __x A %normal_distribution random number generator engine.
+ *
+ * @returns The input stream with @p __x extracted or in an error state.
+ */
+ template<typename _RealType1, typename _CharT, typename _Traits>
+ friend std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ normal_distribution<_RealType1>& __x);
+
+ private:
+ result_type _M_mean;
+ result_type _M_sigma;
+ result_type _M_saved;
+ bool _M_saved_available;
+ };
+
+
+ /**
+ * @brief A gamma continuous distribution for random numbers.
+ *
+ * The formula for the gamma probability mass function is
+ * @f$ p(x) = \frac{1}{\Gamma(\alpha)} x^{\alpha - 1} e^{-x} @f$.
+ */
+ template<typename _RealType = double>
+ class gamma_distribution
+ {
+ public:
+ // types
+ typedef _RealType input_type;
+ typedef _RealType result_type;
+
+ public:
+ /**
+ * Constructs a gamma distribution with parameters @f$ \alpha @f$.
+ */
+ explicit
+ gamma_distribution(const result_type& __alpha_val = result_type(1))
+ : _M_alpha(__alpha_val)
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_alpha > 0);
+ _M_initialize();
+ }
+
+ /**
+ * Gets the @f$ \alpha @f$ of the distribution.
+ */
+ _RealType
+ alpha() const
+ { return _M_alpha; }
+
+ /**
+ * Resets the distribution.
+ */
+ void
+ reset() { }
+
+ template<class _UniformRandomNumberGenerator>
+ result_type
+ operator()(_UniformRandomNumberGenerator& __urng);
+
+ /**
+ * Inserts a %gamma_distribution random number distribution
+ * @p __x into the output stream @p __os.
+ *
+ * @param __os An output stream.
+ * @param __x A %gamma_distribution random number distribution.
+ *
+ * @returns The output stream with the state of @p __x inserted or in
+ * an error state.
+ */
+ template<typename _RealType1, typename _CharT, typename _Traits>
+ friend std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const gamma_distribution<_RealType1>& __x);
+
+ /**
+ * Extracts a %gamma_distribution random number distribution
+ * @p __x from the input stream @p __is.
+ *
+ * @param __is An input stream.
+ * @param __x A %gamma_distribution random number generator engine.
+ *
+ * @returns The input stream with @p __x extracted or in an error state.
+ */
+ template<typename _CharT, typename _Traits>
+ friend std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ gamma_distribution& __x)
+ {
+ __is >> __x._M_alpha;
+ __x._M_initialize();
+ return __is;
+ }
+
+ private:
+ void
+ _M_initialize();
+
+ result_type _M_alpha;
+
+ // Hosts either lambda of GB or d of modified Vaduva's.
+ result_type _M_l_d;
+ };
+
+ /* @} */ // group tr1_random_distributions_continuous
+ /* @} */ // group tr1_random_distributions
+ /* @} */ // group tr1_random
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
+
+#include <tr1_impl/random.tcc>
diff --git a/i686-linux/include/c++/4.4.3/tr1_impl/random.tcc b/i686-linux/include/c++/4.4.3/tr1_impl/random.tcc
new file mode 100644
index 0000000..4c78ce6
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1_impl/random.tcc
@@ -0,0 +1,1577 @@
+// random number generation (out of line) -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/random.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+ /*
+ * (Further) implementation-space details.
+ */
+ namespace __detail
+ {
+ // General case for x = (ax + c) mod m -- use Schrage's algorithm to avoid
+ // integer overflow.
+ //
+ // Because a and c are compile-time integral constants the compiler kindly
+ // elides any unreachable paths.
+ //
+ // Preconditions: a > 0, m > 0.
+ //
+ template<typename _Tp, _Tp __a, _Tp __c, _Tp __m, bool>
+ struct _Mod
+ {
+ static _Tp
+ __calc(_Tp __x)
+ {
+ if (__a == 1)
+ __x %= __m;
+ else
+ {
+ static const _Tp __q = __m / __a;
+ static const _Tp __r = __m % __a;
+
+ _Tp __t1 = __a * (__x % __q);
+ _Tp __t2 = __r * (__x / __q);
+ if (__t1 >= __t2)
+ __x = __t1 - __t2;
+ else
+ __x = __m - __t2 + __t1;
+ }
+
+ if (__c != 0)
+ {
+ const _Tp __d = __m - __x;
+ if (__d > __c)
+ __x += __c;
+ else
+ __x = __c - __d;
+ }
+ return __x;
+ }
+ };
+
+ // Special case for m == 0 -- use unsigned integer overflow as modulo
+ // operator.
+ template<typename _Tp, _Tp __a, _Tp __c, _Tp __m>
+ struct _Mod<_Tp, __a, __c, __m, true>
+ {
+ static _Tp
+ __calc(_Tp __x)
+ { return __a * __x + __c; }
+ };
+ } // namespace __detail
+
+ /**
+ * Seeds the LCR with integral value @p __x0, adjusted so that the
+ * ring identity is never a member of the convergence set.
+ */
+ template<class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
+ void
+ linear_congruential<_UIntType, __a, __c, __m>::
+ seed(unsigned long __x0)
+ {
+ if ((__detail::__mod<_UIntType, 1, 0, __m>(__c) == 0)
+ && (__detail::__mod<_UIntType, 1, 0, __m>(__x0) == 0))
+ _M_x = __detail::__mod<_UIntType, 1, 0, __m>(1);
+ else
+ _M_x = __detail::__mod<_UIntType, 1, 0, __m>(__x0);
+ }
+
+ /**
+ * Seeds the LCR engine with a value generated by @p __g.
+ */
+ template<class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
+ template<class _Gen>
+ void
+ linear_congruential<_UIntType, __a, __c, __m>::
+ seed(_Gen& __g, false_type)
+ {
+ _UIntType __x0 = __g();
+ if ((__detail::__mod<_UIntType, 1, 0, __m>(__c) == 0)
+ && (__detail::__mod<_UIntType, 1, 0, __m>(__x0) == 0))
+ _M_x = __detail::__mod<_UIntType, 1, 0, __m>(1);
+ else
+ _M_x = __detail::__mod<_UIntType, 1, 0, __m>(__x0);
+ }
+
+ /**
+ * Gets the next generated value in sequence.
+ */
+ template<class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
+ typename linear_congruential<_UIntType, __a, __c, __m>::result_type
+ linear_congruential<_UIntType, __a, __c, __m>::
+ operator()()
+ {
+ _M_x = __detail::__mod<_UIntType, __a, __c, __m>(_M_x);
+ return _M_x;
+ }
+
+ template<class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m,
+ typename _CharT, typename _Traits>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const linear_congruential<_UIntType, __a, __c, __m>& __lcr)
+ {
+ typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __os.flags();
+ const _CharT __fill = __os.fill();
+ __os.flags(__ios_base::dec | __ios_base::fixed | __ios_base::left);
+ __os.fill(__os.widen(' '));
+
+ __os << __lcr._M_x;
+
+ __os.flags(__flags);
+ __os.fill(__fill);
+ return __os;
+ }
+
+ template<class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m,
+ typename _CharT, typename _Traits>
+ std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ linear_congruential<_UIntType, __a, __c, __m>& __lcr)
+ {
+ typedef std::basic_istream<_CharT, _Traits> __istream_type;
+ typedef typename __istream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __is.flags();
+ __is.flags(__ios_base::dec);
+
+ __is >> __lcr._M_x;
+
+ __is.flags(__flags);
+ return __is;
+ }
+
+
+ template<class _UIntType, int __w, int __n, int __m, int __r,
+ _UIntType __a, int __u, int __s,
+ _UIntType __b, int __t, _UIntType __c, int __l>
+ void
+ mersenne_twister<_UIntType, __w, __n, __m, __r, __a, __u, __s,
+ __b, __t, __c, __l>::
+ seed(unsigned long __value)
+ {
+ _M_x[0] = __detail::__mod<_UIntType, 1, 0,
+ __detail::_Shift<_UIntType, __w>::__value>(__value);
+
+ for (int __i = 1; __i < state_size; ++__i)
+ {
+ _UIntType __x = _M_x[__i - 1];
+ __x ^= __x >> (__w - 2);
+ __x *= 1812433253ul;
+ __x += __i;
+ _M_x[__i] = __detail::__mod<_UIntType, 1, 0,
+ __detail::_Shift<_UIntType, __w>::__value>(__x);
+ }
+ _M_p = state_size;
+ }
+
+ template<class _UIntType, int __w, int __n, int __m, int __r,
+ _UIntType __a, int __u, int __s,
+ _UIntType __b, int __t, _UIntType __c, int __l>
+ template<class _Gen>
+ void
+ mersenne_twister<_UIntType, __w, __n, __m, __r, __a, __u, __s,
+ __b, __t, __c, __l>::
+ seed(_Gen& __gen, false_type)
+ {
+ for (int __i = 0; __i < state_size; ++__i)
+ _M_x[__i] = __detail::__mod<_UIntType, 1, 0,
+ __detail::_Shift<_UIntType, __w>::__value>(__gen());
+ _M_p = state_size;
+ }
+
+ template<class _UIntType, int __w, int __n, int __m, int __r,
+ _UIntType __a, int __u, int __s,
+ _UIntType __b, int __t, _UIntType __c, int __l>
+ typename
+ mersenne_twister<_UIntType, __w, __n, __m, __r, __a, __u, __s,
+ __b, __t, __c, __l>::result_type
+ mersenne_twister<_UIntType, __w, __n, __m, __r, __a, __u, __s,
+ __b, __t, __c, __l>::
+ operator()()
+ {
+ // Reload the vector - cost is O(n) amortized over n calls.
+ if (_M_p >= state_size)
+ {
+ const _UIntType __upper_mask = (~_UIntType()) << __r;
+ const _UIntType __lower_mask = ~__upper_mask;
+
+ for (int __k = 0; __k < (__n - __m); ++__k)
+ {
+ _UIntType __y = ((_M_x[__k] & __upper_mask)
+ | (_M_x[__k + 1] & __lower_mask));
+ _M_x[__k] = (_M_x[__k + __m] ^ (__y >> 1)
+ ^ ((__y & 0x01) ? __a : 0));
+ }
+
+ for (int __k = (__n - __m); __k < (__n - 1); ++__k)
+ {
+ _UIntType __y = ((_M_x[__k] & __upper_mask)
+ | (_M_x[__k + 1] & __lower_mask));
+ _M_x[__k] = (_M_x[__k + (__m - __n)] ^ (__y >> 1)
+ ^ ((__y & 0x01) ? __a : 0));
+ }
+
+ _UIntType __y = ((_M_x[__n - 1] & __upper_mask)
+ | (_M_x[0] & __lower_mask));
+ _M_x[__n - 1] = (_M_x[__m - 1] ^ (__y >> 1)
+ ^ ((__y & 0x01) ? __a : 0));
+ _M_p = 0;
+ }
+
+ // Calculate o(x(i)).
+ result_type __z = _M_x[_M_p++];
+ __z ^= (__z >> __u);
+ __z ^= (__z << __s) & __b;
+ __z ^= (__z << __t) & __c;
+ __z ^= (__z >> __l);
+
+ return __z;
+ }
+
+ template<class _UIntType, int __w, int __n, int __m, int __r,
+ _UIntType __a, int __u, int __s, _UIntType __b, int __t,
+ _UIntType __c, int __l,
+ typename _CharT, typename _Traits>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const mersenne_twister<_UIntType, __w, __n, __m,
+ __r, __a, __u, __s, __b, __t, __c, __l>& __x)
+ {
+ typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __os.flags();
+ const _CharT __fill = __os.fill();
+ const _CharT __space = __os.widen(' ');
+ __os.flags(__ios_base::dec | __ios_base::fixed | __ios_base::left);
+ __os.fill(__space);
+
+ for (int __i = 0; __i < __n - 1; ++__i)
+ __os << __x._M_x[__i] << __space;
+ __os << __x._M_x[__n - 1];
+
+ __os.flags(__flags);
+ __os.fill(__fill);
+ return __os;
+ }
+
+ template<class _UIntType, int __w, int __n, int __m, int __r,
+ _UIntType __a, int __u, int __s, _UIntType __b, int __t,
+ _UIntType __c, int __l,
+ typename _CharT, typename _Traits>
+ std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ mersenne_twister<_UIntType, __w, __n, __m,
+ __r, __a, __u, __s, __b, __t, __c, __l>& __x)
+ {
+ typedef std::basic_istream<_CharT, _Traits> __istream_type;
+ typedef typename __istream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __is.flags();
+ __is.flags(__ios_base::dec | __ios_base::skipws);
+
+ for (int __i = 0; __i < __n; ++__i)
+ __is >> __x._M_x[__i];
+
+ __is.flags(__flags);
+ return __is;
+ }
+
+
+ template<typename _IntType, _IntType __m, int __s, int __r>
+ void
+ subtract_with_carry<_IntType, __m, __s, __r>::
+ seed(unsigned long __value)
+ {
+ if (__value == 0)
+ __value = 19780503;
+
+ std::_GLIBCXX_TR1 linear_congruential<unsigned long, 40014, 0, 2147483563>
+ __lcg(__value);
+
+ for (int __i = 0; __i < long_lag; ++__i)
+ _M_x[__i] = __detail::__mod<_UIntType, 1, 0, modulus>(__lcg());
+
+ _M_carry = (_M_x[long_lag - 1] == 0) ? 1 : 0;
+ _M_p = 0;
+ }
+
+ template<typename _IntType, _IntType __m, int __s, int __r>
+ template<class _Gen>
+ void
+ subtract_with_carry<_IntType, __m, __s, __r>::
+ seed(_Gen& __gen, false_type)
+ {
+ const int __n = (std::numeric_limits<_UIntType>::digits + 31) / 32;
+
+ for (int __i = 0; __i < long_lag; ++__i)
+ {
+ _UIntType __tmp = 0;
+ _UIntType __factor = 1;
+ for (int __j = 0; __j < __n; ++__j)
+ {
+ __tmp += __detail::__mod<__detail::_UInt32Type, 1, 0, 0>
+ (__gen()) * __factor;
+ __factor *= __detail::_Shift<_UIntType, 32>::__value;
+ }
+ _M_x[__i] = __detail::__mod<_UIntType, 1, 0, modulus>(__tmp);
+ }
+ _M_carry = (_M_x[long_lag - 1] == 0) ? 1 : 0;
+ _M_p = 0;
+ }
+
+ template<typename _IntType, _IntType __m, int __s, int __r>
+ typename subtract_with_carry<_IntType, __m, __s, __r>::result_type
+ subtract_with_carry<_IntType, __m, __s, __r>::
+ operator()()
+ {
+ // Derive short lag index from current index.
+ int __ps = _M_p - short_lag;
+ if (__ps < 0)
+ __ps += long_lag;
+
+ // Calculate new x(i) without overflow or division.
+ // NB: Thanks to the requirements for _IntType, _M_x[_M_p] + _M_carry
+ // cannot overflow.
+ _UIntType __xi;
+ if (_M_x[__ps] >= _M_x[_M_p] + _M_carry)
+ {
+ __xi = _M_x[__ps] - _M_x[_M_p] - _M_carry;
+ _M_carry = 0;
+ }
+ else
+ {
+ __xi = modulus - _M_x[_M_p] - _M_carry + _M_x[__ps];
+ _M_carry = 1;
+ }
+ _M_x[_M_p] = __xi;
+
+ // Adjust current index to loop around in ring buffer.
+ if (++_M_p >= long_lag)
+ _M_p = 0;
+
+ return __xi;
+ }
+
+ template<typename _IntType, _IntType __m, int __s, int __r,
+ typename _CharT, typename _Traits>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const subtract_with_carry<_IntType, __m, __s, __r>& __x)
+ {
+ typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __os.flags();
+ const _CharT __fill = __os.fill();
+ const _CharT __space = __os.widen(' ');
+ __os.flags(__ios_base::dec | __ios_base::fixed | __ios_base::left);
+ __os.fill(__space);
+
+ for (int __i = 0; __i < __r; ++__i)
+ __os << __x._M_x[__i] << __space;
+ __os << __x._M_carry;
+
+ __os.flags(__flags);
+ __os.fill(__fill);
+ return __os;
+ }
+
+ template<typename _IntType, _IntType __m, int __s, int __r,
+ typename _CharT, typename _Traits>
+ std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ subtract_with_carry<_IntType, __m, __s, __r>& __x)
+ {
+ typedef std::basic_ostream<_CharT, _Traits> __istream_type;
+ typedef typename __istream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __is.flags();
+ __is.flags(__ios_base::dec | __ios_base::skipws);
+
+ for (int __i = 0; __i < __r; ++__i)
+ __is >> __x._M_x[__i];
+ __is >> __x._M_carry;
+
+ __is.flags(__flags);
+ return __is;
+ }
+
+
+ template<typename _RealType, int __w, int __s, int __r>
+ void
+ subtract_with_carry_01<_RealType, __w, __s, __r>::
+ _M_initialize_npows()
+ {
+ for (int __j = 0; __j < __n; ++__j)
+#if _GLIBCXX_USE_C99_MATH_TR1
+ _M_npows[__j] = std::_GLIBCXX_TR1 ldexp(_RealType(1), -__w + __j * 32);
+#else
+ _M_npows[__j] = std::pow(_RealType(2), -__w + __j * 32);
+#endif
+ }
+
+ template<typename _RealType, int __w, int __s, int __r>
+ void
+ subtract_with_carry_01<_RealType, __w, __s, __r>::
+ seed(unsigned long __value)
+ {
+ if (__value == 0)
+ __value = 19780503;
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 512. Seeding subtract_with_carry_01 from a single unsigned long.
+ std::_GLIBCXX_TR1 linear_congruential<unsigned long, 40014, 0, 2147483563>
+ __lcg(__value);
+
+ this->seed(__lcg);
+ }
+
+ template<typename _RealType, int __w, int __s, int __r>
+ template<class _Gen>
+ void
+ subtract_with_carry_01<_RealType, __w, __s, __r>::
+ seed(_Gen& __gen, false_type)
+ {
+ for (int __i = 0; __i < long_lag; ++__i)
+ {
+ for (int __j = 0; __j < __n - 1; ++__j)
+ _M_x[__i][__j] = __detail::__mod<_UInt32Type, 1, 0, 0>(__gen());
+ _M_x[__i][__n - 1] = __detail::__mod<_UInt32Type, 1, 0,
+ __detail::_Shift<_UInt32Type, __w % 32>::__value>(__gen());
+ }
+
+ _M_carry = 1;
+ for (int __j = 0; __j < __n; ++__j)
+ if (_M_x[long_lag - 1][__j] != 0)
+ {
+ _M_carry = 0;
+ break;
+ }
+
+ _M_p = 0;
+ }
+
+ template<typename _RealType, int __w, int __s, int __r>
+ typename subtract_with_carry_01<_RealType, __w, __s, __r>::result_type
+ subtract_with_carry_01<_RealType, __w, __s, __r>::
+ operator()()
+ {
+ // Derive short lag index from current index.
+ int __ps = _M_p - short_lag;
+ if (__ps < 0)
+ __ps += long_lag;
+
+ _UInt32Type __new_carry;
+ for (int __j = 0; __j < __n - 1; ++__j)
+ {
+ if (_M_x[__ps][__j] > _M_x[_M_p][__j]
+ || (_M_x[__ps][__j] == _M_x[_M_p][__j] && _M_carry == 0))
+ __new_carry = 0;
+ else
+ __new_carry = 1;
+
+ _M_x[_M_p][__j] = _M_x[__ps][__j] - _M_x[_M_p][__j] - _M_carry;
+ _M_carry = __new_carry;
+ }
+
+ if (_M_x[__ps][__n - 1] > _M_x[_M_p][__n - 1]
+ || (_M_x[__ps][__n - 1] == _M_x[_M_p][__n - 1] && _M_carry == 0))
+ __new_carry = 0;
+ else
+ __new_carry = 1;
+
+ _M_x[_M_p][__n - 1] = __detail::__mod<_UInt32Type, 1, 0,
+ __detail::_Shift<_UInt32Type, __w % 32>::__value>
+ (_M_x[__ps][__n - 1] - _M_x[_M_p][__n - 1] - _M_carry);
+ _M_carry = __new_carry;
+
+ result_type __ret = 0.0;
+ for (int __j = 0; __j < __n; ++__j)
+ __ret += _M_x[_M_p][__j] * _M_npows[__j];
+
+ // Adjust current index to loop around in ring buffer.
+ if (++_M_p >= long_lag)
+ _M_p = 0;
+
+ return __ret;
+ }
+
+ template<typename _RealType, int __w, int __s, int __r,
+ typename _CharT, typename _Traits>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const subtract_with_carry_01<_RealType, __w, __s, __r>& __x)
+ {
+ typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __os.flags();
+ const _CharT __fill = __os.fill();
+ const _CharT __space = __os.widen(' ');
+ __os.flags(__ios_base::dec | __ios_base::fixed | __ios_base::left);
+ __os.fill(__space);
+
+ for (int __i = 0; __i < __r; ++__i)
+ for (int __j = 0; __j < __x.__n; ++__j)
+ __os << __x._M_x[__i][__j] << __space;
+ __os << __x._M_carry;
+
+ __os.flags(__flags);
+ __os.fill(__fill);
+ return __os;
+ }
+
+ template<typename _RealType, int __w, int __s, int __r,
+ typename _CharT, typename _Traits>
+ std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ subtract_with_carry_01<_RealType, __w, __s, __r>& __x)
+ {
+ typedef std::basic_istream<_CharT, _Traits> __istream_type;
+ typedef typename __istream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __is.flags();
+ __is.flags(__ios_base::dec | __ios_base::skipws);
+
+ for (int __i = 0; __i < __r; ++__i)
+ for (int __j = 0; __j < __x.__n; ++__j)
+ __is >> __x._M_x[__i][__j];
+ __is >> __x._M_carry;
+
+ __is.flags(__flags);
+ return __is;
+ }
+
+
+ template<class _UniformRandomNumberGenerator, int __p, int __r>
+ typename discard_block<_UniformRandomNumberGenerator,
+ __p, __r>::result_type
+ discard_block<_UniformRandomNumberGenerator, __p, __r>::
+ operator()()
+ {
+ if (_M_n >= used_block)
+ {
+ while (_M_n < block_size)
+ {
+ _M_b();
+ ++_M_n;
+ }
+ _M_n = 0;
+ }
+ ++_M_n;
+ return _M_b();
+ }
+
+ template<class _UniformRandomNumberGenerator, int __p, int __r,
+ typename _CharT, typename _Traits>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const discard_block<_UniformRandomNumberGenerator,
+ __p, __r>& __x)
+ {
+ typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __os.flags();
+ const _CharT __fill = __os.fill();
+ const _CharT __space = __os.widen(' ');
+ __os.flags(__ios_base::dec | __ios_base::fixed
+ | __ios_base::left);
+ __os.fill(__space);
+
+ __os << __x._M_b << __space << __x._M_n;
+
+ __os.flags(__flags);
+ __os.fill(__fill);
+ return __os;
+ }
+
+ template<class _UniformRandomNumberGenerator, int __p, int __r,
+ typename _CharT, typename _Traits>
+ std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ discard_block<_UniformRandomNumberGenerator, __p, __r>& __x)
+ {
+ typedef std::basic_istream<_CharT, _Traits> __istream_type;
+ typedef typename __istream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __is.flags();
+ __is.flags(__ios_base::dec | __ios_base::skipws);
+
+ __is >> __x._M_b >> __x._M_n;
+
+ __is.flags(__flags);
+ return __is;
+ }
+
+
+ template<class _UniformRandomNumberGenerator1, int __s1,
+ class _UniformRandomNumberGenerator2, int __s2>
+ void
+ xor_combine<_UniformRandomNumberGenerator1, __s1,
+ _UniformRandomNumberGenerator2, __s2>::
+ _M_initialize_max()
+ {
+ const int __w = std::numeric_limits<result_type>::digits;
+
+ const result_type __m1 =
+ std::min(result_type(_M_b1.max() - _M_b1.min()),
+ __detail::_Shift<result_type, __w - __s1>::__value - 1);
+
+ const result_type __m2 =
+ std::min(result_type(_M_b2.max() - _M_b2.min()),
+ __detail::_Shift<result_type, __w - __s2>::__value - 1);
+
+ // NB: In TR1 s1 is not required to be >= s2.
+ if (__s1 < __s2)
+ _M_max = _M_initialize_max_aux(__m2, __m1, __s2 - __s1) << __s1;
+ else
+ _M_max = _M_initialize_max_aux(__m1, __m2, __s1 - __s2) << __s2;
+ }
+
+ template<class _UniformRandomNumberGenerator1, int __s1,
+ class _UniformRandomNumberGenerator2, int __s2>
+ typename xor_combine<_UniformRandomNumberGenerator1, __s1,
+ _UniformRandomNumberGenerator2, __s2>::result_type
+ xor_combine<_UniformRandomNumberGenerator1, __s1,
+ _UniformRandomNumberGenerator2, __s2>::
+ _M_initialize_max_aux(result_type __a, result_type __b, int __d)
+ {
+ const result_type __two2d = result_type(1) << __d;
+ const result_type __c = __a * __two2d;
+
+ if (__a == 0 || __b < __two2d)
+ return __c + __b;
+
+ const result_type __t = std::max(__c, __b);
+ const result_type __u = std::min(__c, __b);
+
+ result_type __ub = __u;
+ result_type __p;
+ for (__p = 0; __ub != 1; __ub >>= 1)
+ ++__p;
+
+ const result_type __two2p = result_type(1) << __p;
+ const result_type __k = __t / __two2p;
+
+ if (__k & 1)
+ return (__k + 1) * __two2p - 1;
+
+ if (__c >= __b)
+ return (__k + 1) * __two2p + _M_initialize_max_aux((__t % __two2p)
+ / __two2d,
+ __u % __two2p, __d);
+ else
+ return (__k + 1) * __two2p + _M_initialize_max_aux((__u % __two2p)
+ / __two2d,
+ __t % __two2p, __d);
+ }
+
+ template<class _UniformRandomNumberGenerator1, int __s1,
+ class _UniformRandomNumberGenerator2, int __s2,
+ typename _CharT, typename _Traits>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const xor_combine<_UniformRandomNumberGenerator1, __s1,
+ _UniformRandomNumberGenerator2, __s2>& __x)
+ {
+ typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __os.flags();
+ const _CharT __fill = __os.fill();
+ const _CharT __space = __os.widen(' ');
+ __os.flags(__ios_base::dec | __ios_base::fixed | __ios_base::left);
+ __os.fill(__space);
+
+ __os << __x.base1() << __space << __x.base2();
+
+ __os.flags(__flags);
+ __os.fill(__fill);
+ return __os;
+ }
+
+ template<class _UniformRandomNumberGenerator1, int __s1,
+ class _UniformRandomNumberGenerator2, int __s2,
+ typename _CharT, typename _Traits>
+ std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ xor_combine<_UniformRandomNumberGenerator1, __s1,
+ _UniformRandomNumberGenerator2, __s2>& __x)
+ {
+ typedef std::basic_istream<_CharT, _Traits> __istream_type;
+ typedef typename __istream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __is.flags();
+ __is.flags(__ios_base::skipws);
+
+ __is >> __x._M_b1 >> __x._M_b2;
+
+ __is.flags(__flags);
+ return __is;
+ }
+
+
+ template<typename _IntType>
+ template<typename _UniformRandomNumberGenerator>
+ typename uniform_int<_IntType>::result_type
+ uniform_int<_IntType>::
+ _M_call(_UniformRandomNumberGenerator& __urng,
+ result_type __min, result_type __max, true_type)
+ {
+ // XXX Must be fixed to work well for *arbitrary* __urng.max(),
+ // __urng.min(), __max, __min. Currently works fine only in the
+ // most common case __urng.max() - __urng.min() >= __max - __min,
+ // with __urng.max() > __urng.min() >= 0.
+ typedef typename __gnu_cxx::__add_unsigned<typename
+ _UniformRandomNumberGenerator::result_type>::__type __urntype;
+ typedef typename __gnu_cxx::__add_unsigned<result_type>::__type
+ __utype;
+ typedef typename __gnu_cxx::__conditional_type<(sizeof(__urntype)
+ > sizeof(__utype)),
+ __urntype, __utype>::__type __uctype;
+
+ result_type __ret;
+
+ const __urntype __urnmin = __urng.min();
+ const __urntype __urnmax = __urng.max();
+ const __urntype __urnrange = __urnmax - __urnmin;
+ const __uctype __urange = __max - __min;
+ const __uctype __udenom = (__urnrange <= __urange
+ ? 1 : __urnrange / (__urange + 1));
+ do
+ __ret = (__urntype(__urng()) - __urnmin) / __udenom;
+ while (__ret > __max - __min);
+
+ return __ret + __min;
+ }
+
+ template<typename _IntType, typename _CharT, typename _Traits>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const uniform_int<_IntType>& __x)
+ {
+ typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __os.flags();
+ const _CharT __fill = __os.fill();
+ const _CharT __space = __os.widen(' ');
+ __os.flags(__ios_base::scientific | __ios_base::left);
+ __os.fill(__space);
+
+ __os << __x.min() << __space << __x.max();
+
+ __os.flags(__flags);
+ __os.fill(__fill);
+ return __os;
+ }
+
+ template<typename _IntType, typename _CharT, typename _Traits>
+ std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ uniform_int<_IntType>& __x)
+ {
+ typedef std::basic_istream<_CharT, _Traits> __istream_type;
+ typedef typename __istream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __is.flags();
+ __is.flags(__ios_base::dec | __ios_base::skipws);
+
+ __is >> __x._M_min >> __x._M_max;
+
+ __is.flags(__flags);
+ return __is;
+ }
+
+
+ template<typename _CharT, typename _Traits>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const bernoulli_distribution& __x)
+ {
+ typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __os.flags();
+ const _CharT __fill = __os.fill();
+ const std::streamsize __precision = __os.precision();
+ __os.flags(__ios_base::scientific | __ios_base::left);
+ __os.fill(__os.widen(' '));
+ __os.precision(__gnu_cxx::__numeric_traits<double>::__max_digits10);
+
+ __os << __x.p();
+
+ __os.flags(__flags);
+ __os.fill(__fill);
+ __os.precision(__precision);
+ return __os;
+ }
+
+
+ template<typename _IntType, typename _RealType>
+ template<class _UniformRandomNumberGenerator>
+ typename geometric_distribution<_IntType, _RealType>::result_type
+ geometric_distribution<_IntType, _RealType>::
+ operator()(_UniformRandomNumberGenerator& __urng)
+ {
+ // About the epsilon thing see this thread:
+ // http://gcc.gnu.org/ml/gcc-patches/2006-10/msg00971.html
+ const _RealType __naf =
+ (1 - std::numeric_limits<_RealType>::epsilon()) / 2;
+ // The largest _RealType convertible to _IntType.
+ const _RealType __thr =
+ std::numeric_limits<_IntType>::max() + __naf;
+
+ _RealType __cand;
+ do
+ __cand = std::ceil(std::log(__urng()) / _M_log_p);
+ while (__cand >= __thr);
+
+ return result_type(__cand + __naf);
+ }
+
+ template<typename _IntType, typename _RealType,
+ typename _CharT, typename _Traits>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const geometric_distribution<_IntType, _RealType>& __x)
+ {
+ typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __os.flags();
+ const _CharT __fill = __os.fill();
+ const std::streamsize __precision = __os.precision();
+ __os.flags(__ios_base::scientific | __ios_base::left);
+ __os.fill(__os.widen(' '));
+ __os.precision(__gnu_cxx::__numeric_traits<_RealType>::__max_digits10);
+
+ __os << __x.p();
+
+ __os.flags(__flags);
+ __os.fill(__fill);
+ __os.precision(__precision);
+ return __os;
+ }
+
+
+ template<typename _IntType, typename _RealType>
+ void
+ poisson_distribution<_IntType, _RealType>::
+ _M_initialize()
+ {
+#if _GLIBCXX_USE_C99_MATH_TR1
+ if (_M_mean >= 12)
+ {
+ const _RealType __m = std::floor(_M_mean);
+ _M_lm_thr = std::log(_M_mean);
+ _M_lfm = std::_GLIBCXX_TR1 lgamma(__m + 1);
+ _M_sm = std::sqrt(__m);
+
+ const _RealType __pi_4 = 0.7853981633974483096156608458198757L;
+ const _RealType __dx = std::sqrt(2 * __m * std::log(32 * __m
+ / __pi_4));
+ _M_d = std::_GLIBCXX_TR1 round(std::max(_RealType(6),
+ std::min(__m, __dx)));
+ const _RealType __cx = 2 * __m + _M_d;
+ _M_scx = std::sqrt(__cx / 2);
+ _M_1cx = 1 / __cx;
+
+ _M_c2b = std::sqrt(__pi_4 * __cx) * std::exp(_M_1cx);
+ _M_cb = 2 * __cx * std::exp(-_M_d * _M_1cx * (1 + _M_d / 2)) / _M_d;
+ }
+ else
+#endif
+ _M_lm_thr = std::exp(-_M_mean);
+ }
+
+ /**
+ * A rejection algorithm when mean >= 12 and a simple method based
+ * upon the multiplication of uniform random variates otherwise.
+ * NB: The former is available only if _GLIBCXX_USE_C99_MATH_TR1
+ * is defined.
+ *
+ * Reference:
+ * Devroye, L. "Non-Uniform Random Variates Generation." Springer-Verlag,
+ * New York, 1986, Ch. X, Sects. 3.3 & 3.4 (+ Errata!).
+ */
+ template<typename _IntType, typename _RealType>
+ template<class _UniformRandomNumberGenerator>
+ typename poisson_distribution<_IntType, _RealType>::result_type
+ poisson_distribution<_IntType, _RealType>::
+ operator()(_UniformRandomNumberGenerator& __urng)
+ {
+#if _GLIBCXX_USE_C99_MATH_TR1
+ if (_M_mean >= 12)
+ {
+ _RealType __x;
+
+ // See comments above...
+ const _RealType __naf =
+ (1 - std::numeric_limits<_RealType>::epsilon()) / 2;
+ const _RealType __thr =
+ std::numeric_limits<_IntType>::max() + __naf;
+
+ const _RealType __m = std::floor(_M_mean);
+ // sqrt(pi / 2)
+ const _RealType __spi_2 = 1.2533141373155002512078826424055226L;
+ const _RealType __c1 = _M_sm * __spi_2;
+ const _RealType __c2 = _M_c2b + __c1;
+ const _RealType __c3 = __c2 + 1;
+ const _RealType __c4 = __c3 + 1;
+ // e^(1 / 78)
+ const _RealType __e178 = 1.0129030479320018583185514777512983L;
+ const _RealType __c5 = __c4 + __e178;
+ const _RealType __c = _M_cb + __c5;
+ const _RealType __2cx = 2 * (2 * __m + _M_d);
+
+ bool __reject = true;
+ do
+ {
+ const _RealType __u = __c * __urng();
+ const _RealType __e = -std::log(__urng());
+
+ _RealType __w = 0.0;
+
+ if (__u <= __c1)
+ {
+ const _RealType __n = _M_nd(__urng);
+ const _RealType __y = -std::abs(__n) * _M_sm - 1;
+ __x = std::floor(__y);
+ __w = -__n * __n / 2;
+ if (__x < -__m)
+ continue;
+ }
+ else if (__u <= __c2)
+ {
+ const _RealType __n = _M_nd(__urng);
+ const _RealType __y = 1 + std::abs(__n) * _M_scx;
+ __x = std::ceil(__y);
+ __w = __y * (2 - __y) * _M_1cx;
+ if (__x > _M_d)
+ continue;
+ }
+ else if (__u <= __c3)
+ // NB: This case not in the book, nor in the Errata,
+ // but should be ok...
+ __x = -1;
+ else if (__u <= __c4)
+ __x = 0;
+ else if (__u <= __c5)
+ __x = 1;
+ else
+ {
+ const _RealType __v = -std::log(__urng());
+ const _RealType __y = _M_d + __v * __2cx / _M_d;
+ __x = std::ceil(__y);
+ __w = -_M_d * _M_1cx * (1 + __y / 2);
+ }
+
+ __reject = (__w - __e - __x * _M_lm_thr
+ > _M_lfm - std::_GLIBCXX_TR1 lgamma(__x + __m + 1));
+
+ __reject |= __x + __m >= __thr;
+
+ } while (__reject);
+
+ return result_type(__x + __m + __naf);
+ }
+ else
+#endif
+ {
+ _IntType __x = 0;
+ _RealType __prod = 1.0;
+
+ do
+ {
+ __prod *= __urng();
+ __x += 1;
+ }
+ while (__prod > _M_lm_thr);
+
+ return __x - 1;
+ }
+ }
+
+ template<typename _IntType, typename _RealType,
+ typename _CharT, typename _Traits>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const poisson_distribution<_IntType, _RealType>& __x)
+ {
+ typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __os.flags();
+ const _CharT __fill = __os.fill();
+ const std::streamsize __precision = __os.precision();
+ const _CharT __space = __os.widen(' ');
+ __os.flags(__ios_base::scientific | __ios_base::left);
+ __os.fill(__space);
+ __os.precision(__gnu_cxx::__numeric_traits<_RealType>::__max_digits10);
+
+ __os << __x.mean() << __space << __x._M_nd;
+
+ __os.flags(__flags);
+ __os.fill(__fill);
+ __os.precision(__precision);
+ return __os;
+ }
+
+ template<typename _IntType, typename _RealType,
+ typename _CharT, typename _Traits>
+ std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ poisson_distribution<_IntType, _RealType>& __x)
+ {
+ typedef std::basic_istream<_CharT, _Traits> __istream_type;
+ typedef typename __istream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __is.flags();
+ __is.flags(__ios_base::skipws);
+
+ __is >> __x._M_mean >> __x._M_nd;
+ __x._M_initialize();
+
+ __is.flags(__flags);
+ return __is;
+ }
+
+
+ template<typename _IntType, typename _RealType>
+ void
+ binomial_distribution<_IntType, _RealType>::
+ _M_initialize()
+ {
+ const _RealType __p12 = _M_p <= 0.5 ? _M_p : 1.0 - _M_p;
+
+ _M_easy = true;
+
+#if _GLIBCXX_USE_C99_MATH_TR1
+ if (_M_t * __p12 >= 8)
+ {
+ _M_easy = false;
+ const _RealType __np = std::floor(_M_t * __p12);
+ const _RealType __pa = __np / _M_t;
+ const _RealType __1p = 1 - __pa;
+
+ const _RealType __pi_4 = 0.7853981633974483096156608458198757L;
+ const _RealType __d1x =
+ std::sqrt(__np * __1p * std::log(32 * __np
+ / (81 * __pi_4 * __1p)));
+ _M_d1 = std::_GLIBCXX_TR1 round(std::max(_RealType(1), __d1x));
+ const _RealType __d2x =
+ std::sqrt(__np * __1p * std::log(32 * _M_t * __1p
+ / (__pi_4 * __pa)));
+ _M_d2 = std::_GLIBCXX_TR1 round(std::max(_RealType(1), __d2x));
+
+ // sqrt(pi / 2)
+ const _RealType __spi_2 = 1.2533141373155002512078826424055226L;
+ _M_s1 = std::sqrt(__np * __1p) * (1 + _M_d1 / (4 * __np));
+ _M_s2 = std::sqrt(__np * __1p) * (1 + _M_d2 / (4 * _M_t * __1p));
+ _M_c = 2 * _M_d1 / __np;
+ _M_a1 = std::exp(_M_c) * _M_s1 * __spi_2;
+ const _RealType __a12 = _M_a1 + _M_s2 * __spi_2;
+ const _RealType __s1s = _M_s1 * _M_s1;
+ _M_a123 = __a12 + (std::exp(_M_d1 / (_M_t * __1p))
+ * 2 * __s1s / _M_d1
+ * std::exp(-_M_d1 * _M_d1 / (2 * __s1s)));
+ const _RealType __s2s = _M_s2 * _M_s2;
+ _M_s = (_M_a123 + 2 * __s2s / _M_d2
+ * std::exp(-_M_d2 * _M_d2 / (2 * __s2s)));
+ _M_lf = (std::_GLIBCXX_TR1 lgamma(__np + 1)
+ + std::_GLIBCXX_TR1 lgamma(_M_t - __np + 1));
+ _M_lp1p = std::log(__pa / __1p);
+
+ _M_q = -std::log(1 - (__p12 - __pa) / __1p);
+ }
+ else
+#endif
+ _M_q = -std::log(1 - __p12);
+ }
+
+ template<typename _IntType, typename _RealType>
+ template<class _UniformRandomNumberGenerator>
+ typename binomial_distribution<_IntType, _RealType>::result_type
+ binomial_distribution<_IntType, _RealType>::
+ _M_waiting(_UniformRandomNumberGenerator& __urng, _IntType __t)
+ {
+ _IntType __x = 0;
+ _RealType __sum = 0;
+
+ do
+ {
+ const _RealType __e = -std::log(__urng());
+ __sum += __e / (__t - __x);
+ __x += 1;
+ }
+ while (__sum <= _M_q);
+
+ return __x - 1;
+ }
+
+ /**
+ * A rejection algorithm when t * p >= 8 and a simple waiting time
+ * method - the second in the referenced book - otherwise.
+ * NB: The former is available only if _GLIBCXX_USE_C99_MATH_TR1
+ * is defined.
+ *
+ * Reference:
+ * Devroye, L. "Non-Uniform Random Variates Generation." Springer-Verlag,
+ * New York, 1986, Ch. X, Sect. 4 (+ Errata!).
+ */
+ template<typename _IntType, typename _RealType>
+ template<class _UniformRandomNumberGenerator>
+ typename binomial_distribution<_IntType, _RealType>::result_type
+ binomial_distribution<_IntType, _RealType>::
+ operator()(_UniformRandomNumberGenerator& __urng)
+ {
+ result_type __ret;
+ const _RealType __p12 = _M_p <= 0.5 ? _M_p : 1.0 - _M_p;
+
+#if _GLIBCXX_USE_C99_MATH_TR1
+ if (!_M_easy)
+ {
+ _RealType __x;
+
+ // See comments above...
+ const _RealType __naf =
+ (1 - std::numeric_limits<_RealType>::epsilon()) / 2;
+ const _RealType __thr =
+ std::numeric_limits<_IntType>::max() + __naf;
+
+ const _RealType __np = std::floor(_M_t * __p12);
+ const _RealType __pa = __np / _M_t;
+
+ // sqrt(pi / 2)
+ const _RealType __spi_2 = 1.2533141373155002512078826424055226L;
+ const _RealType __a1 = _M_a1;
+ const _RealType __a12 = __a1 + _M_s2 * __spi_2;
+ const _RealType __a123 = _M_a123;
+ const _RealType __s1s = _M_s1 * _M_s1;
+ const _RealType __s2s = _M_s2 * _M_s2;
+
+ bool __reject;
+ do
+ {
+ const _RealType __u = _M_s * __urng();
+
+ _RealType __v;
+
+ if (__u <= __a1)
+ {
+ const _RealType __n = _M_nd(__urng);
+ const _RealType __y = _M_s1 * std::abs(__n);
+ __reject = __y >= _M_d1;
+ if (!__reject)
+ {
+ const _RealType __e = -std::log(__urng());
+ __x = std::floor(__y);
+ __v = -__e - __n * __n / 2 + _M_c;
+ }
+ }
+ else if (__u <= __a12)
+ {
+ const _RealType __n = _M_nd(__urng);
+ const _RealType __y = _M_s2 * std::abs(__n);
+ __reject = __y >= _M_d2;
+ if (!__reject)
+ {
+ const _RealType __e = -std::log(__urng());
+ __x = std::floor(-__y);
+ __v = -__e - __n * __n / 2;
+ }
+ }
+ else if (__u <= __a123)
+ {
+ const _RealType __e1 = -std::log(__urng());
+ const _RealType __e2 = -std::log(__urng());
+
+ const _RealType __y = _M_d1 + 2 * __s1s * __e1 / _M_d1;
+ __x = std::floor(__y);
+ __v = (-__e2 + _M_d1 * (1 / (_M_t - __np)
+ -__y / (2 * __s1s)));
+ __reject = false;
+ }
+ else
+ {
+ const _RealType __e1 = -std::log(__urng());
+ const _RealType __e2 = -std::log(__urng());
+
+ const _RealType __y = _M_d2 + 2 * __s2s * __e1 / _M_d2;
+ __x = std::floor(-__y);
+ __v = -__e2 - _M_d2 * __y / (2 * __s2s);
+ __reject = false;
+ }
+
+ __reject = __reject || __x < -__np || __x > _M_t - __np;
+ if (!__reject)
+ {
+ const _RealType __lfx =
+ std::_GLIBCXX_TR1 lgamma(__np + __x + 1)
+ + std::_GLIBCXX_TR1 lgamma(_M_t - (__np + __x) + 1);
+ __reject = __v > _M_lf - __lfx + __x * _M_lp1p;
+ }
+
+ __reject |= __x + __np >= __thr;
+ }
+ while (__reject);
+
+ __x += __np + __naf;
+
+ const _IntType __z = _M_waiting(__urng, _M_t - _IntType(__x));
+ __ret = _IntType(__x) + __z;
+ }
+ else
+#endif
+ __ret = _M_waiting(__urng, _M_t);
+
+ if (__p12 != _M_p)
+ __ret = _M_t - __ret;
+ return __ret;
+ }
+
+ template<typename _IntType, typename _RealType,
+ typename _CharT, typename _Traits>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const binomial_distribution<_IntType, _RealType>& __x)
+ {
+ typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __os.flags();
+ const _CharT __fill = __os.fill();
+ const std::streamsize __precision = __os.precision();
+ const _CharT __space = __os.widen(' ');
+ __os.flags(__ios_base::scientific | __ios_base::left);
+ __os.fill(__space);
+ __os.precision(__gnu_cxx::__numeric_traits<_RealType>::__max_digits10);
+
+ __os << __x.t() << __space << __x.p()
+ << __space << __x._M_nd;
+
+ __os.flags(__flags);
+ __os.fill(__fill);
+ __os.precision(__precision);
+ return __os;
+ }
+
+ template<typename _IntType, typename _RealType,
+ typename _CharT, typename _Traits>
+ std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ binomial_distribution<_IntType, _RealType>& __x)
+ {
+ typedef std::basic_istream<_CharT, _Traits> __istream_type;
+ typedef typename __istream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __is.flags();
+ __is.flags(__ios_base::dec | __ios_base::skipws);
+
+ __is >> __x._M_t >> __x._M_p >> __x._M_nd;
+ __x._M_initialize();
+
+ __is.flags(__flags);
+ return __is;
+ }
+
+
+ template<typename _RealType, typename _CharT, typename _Traits>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const uniform_real<_RealType>& __x)
+ {
+ typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __os.flags();
+ const _CharT __fill = __os.fill();
+ const std::streamsize __precision = __os.precision();
+ const _CharT __space = __os.widen(' ');
+ __os.flags(__ios_base::scientific | __ios_base::left);
+ __os.fill(__space);
+ __os.precision(__gnu_cxx::__numeric_traits<_RealType>::__max_digits10);
+
+ __os << __x.min() << __space << __x.max();
+
+ __os.flags(__flags);
+ __os.fill(__fill);
+ __os.precision(__precision);
+ return __os;
+ }
+
+ template<typename _RealType, typename _CharT, typename _Traits>
+ std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ uniform_real<_RealType>& __x)
+ {
+ typedef std::basic_istream<_CharT, _Traits> __istream_type;
+ typedef typename __istream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __is.flags();
+ __is.flags(__ios_base::skipws);
+
+ __is >> __x._M_min >> __x._M_max;
+
+ __is.flags(__flags);
+ return __is;
+ }
+
+
+ template<typename _RealType, typename _CharT, typename _Traits>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const exponential_distribution<_RealType>& __x)
+ {
+ typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __os.flags();
+ const _CharT __fill = __os.fill();
+ const std::streamsize __precision = __os.precision();
+ __os.flags(__ios_base::scientific | __ios_base::left);
+ __os.fill(__os.widen(' '));
+ __os.precision(__gnu_cxx::__numeric_traits<_RealType>::__max_digits10);
+
+ __os << __x.lambda();
+
+ __os.flags(__flags);
+ __os.fill(__fill);
+ __os.precision(__precision);
+ return __os;
+ }
+
+
+ /**
+ * Polar method due to Marsaglia.
+ *
+ * Devroye, L. "Non-Uniform Random Variates Generation." Springer-Verlag,
+ * New York, 1986, Ch. V, Sect. 4.4.
+ */
+ template<typename _RealType>
+ template<class _UniformRandomNumberGenerator>
+ typename normal_distribution<_RealType>::result_type
+ normal_distribution<_RealType>::
+ operator()(_UniformRandomNumberGenerator& __urng)
+ {
+ result_type __ret;
+
+ if (_M_saved_available)
+ {
+ _M_saved_available = false;
+ __ret = _M_saved;
+ }
+ else
+ {
+ result_type __x, __y, __r2;
+ do
+ {
+ __x = result_type(2.0) * __urng() - 1.0;
+ __y = result_type(2.0) * __urng() - 1.0;
+ __r2 = __x * __x + __y * __y;
+ }
+ while (__r2 > 1.0 || __r2 == 0.0);
+
+ const result_type __mult = std::sqrt(-2 * std::log(__r2) / __r2);
+ _M_saved = __x * __mult;
+ _M_saved_available = true;
+ __ret = __y * __mult;
+ }
+
+ __ret = __ret * _M_sigma + _M_mean;
+ return __ret;
+ }
+
+ template<typename _RealType, typename _CharT, typename _Traits>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const normal_distribution<_RealType>& __x)
+ {
+ typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __os.flags();
+ const _CharT __fill = __os.fill();
+ const std::streamsize __precision = __os.precision();
+ const _CharT __space = __os.widen(' ');
+ __os.flags(__ios_base::scientific | __ios_base::left);
+ __os.fill(__space);
+ __os.precision(__gnu_cxx::__numeric_traits<_RealType>::__max_digits10);
+
+ __os << __x._M_saved_available << __space
+ << __x.mean() << __space
+ << __x.sigma();
+ if (__x._M_saved_available)
+ __os << __space << __x._M_saved;
+
+ __os.flags(__flags);
+ __os.fill(__fill);
+ __os.precision(__precision);
+ return __os;
+ }
+
+ template<typename _RealType, typename _CharT, typename _Traits>
+ std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ normal_distribution<_RealType>& __x)
+ {
+ typedef std::basic_istream<_CharT, _Traits> __istream_type;
+ typedef typename __istream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __is.flags();
+ __is.flags(__ios_base::dec | __ios_base::skipws);
+
+ __is >> __x._M_saved_available >> __x._M_mean
+ >> __x._M_sigma;
+ if (__x._M_saved_available)
+ __is >> __x._M_saved;
+
+ __is.flags(__flags);
+ return __is;
+ }
+
+
+ template<typename _RealType>
+ void
+ gamma_distribution<_RealType>::
+ _M_initialize()
+ {
+ if (_M_alpha >= 1)
+ _M_l_d = std::sqrt(2 * _M_alpha - 1);
+ else
+ _M_l_d = (std::pow(_M_alpha, _M_alpha / (1 - _M_alpha))
+ * (1 - _M_alpha));
+ }
+
+ /**
+ * Cheng's rejection algorithm GB for alpha >= 1 and a modification
+ * of Vaduva's rejection from Weibull algorithm due to Devroye for
+ * alpha < 1.
+ *
+ * References:
+ * Cheng, R. C. "The Generation of Gamma Random Variables with Non-integral
+ * Shape Parameter." Applied Statistics, 26, 71-75, 1977.
+ *
+ * Vaduva, I. "Computer Generation of Gamma Gandom Variables by Rejection
+ * and Composition Procedures." Math. Operationsforschung and Statistik,
+ * Series in Statistics, 8, 545-576, 1977.
+ *
+ * Devroye, L. "Non-Uniform Random Variates Generation." Springer-Verlag,
+ * New York, 1986, Ch. IX, Sect. 3.4 (+ Errata!).
+ */
+ template<typename _RealType>
+ template<class _UniformRandomNumberGenerator>
+ typename gamma_distribution<_RealType>::result_type
+ gamma_distribution<_RealType>::
+ operator()(_UniformRandomNumberGenerator& __urng)
+ {
+ result_type __x;
+
+ bool __reject;
+ if (_M_alpha >= 1)
+ {
+ // alpha - log(4)
+ const result_type __b = _M_alpha
+ - result_type(1.3862943611198906188344642429163531L);
+ const result_type __c = _M_alpha + _M_l_d;
+ const result_type __1l = 1 / _M_l_d;
+
+ // 1 + log(9 / 2)
+ const result_type __k = 2.5040773967762740733732583523868748L;
+
+ do
+ {
+ const result_type __u = __urng();
+ const result_type __v = __urng();
+
+ const result_type __y = __1l * std::log(__v / (1 - __v));
+ __x = _M_alpha * std::exp(__y);
+
+ const result_type __z = __u * __v * __v;
+ const result_type __r = __b + __c * __y - __x;
+
+ __reject = __r < result_type(4.5) * __z - __k;
+ if (__reject)
+ __reject = __r < std::log(__z);
+ }
+ while (__reject);
+ }
+ else
+ {
+ const result_type __c = 1 / _M_alpha;
+
+ do
+ {
+ const result_type __z = -std::log(__urng());
+ const result_type __e = -std::log(__urng());
+
+ __x = std::pow(__z, __c);
+
+ __reject = __z + __e < _M_l_d + __x;
+ }
+ while (__reject);
+ }
+
+ return __x;
+ }
+
+ template<typename _RealType, typename _CharT, typename _Traits>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const gamma_distribution<_RealType>& __x)
+ {
+ typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __os.flags();
+ const _CharT __fill = __os.fill();
+ const std::streamsize __precision = __os.precision();
+ __os.flags(__ios_base::scientific | __ios_base::left);
+ __os.fill(__os.widen(' '));
+ __os.precision(__gnu_cxx::__numeric_traits<_RealType>::__max_digits10);
+
+ __os << __x.alpha();
+
+ __os.flags(__flags);
+ __os.fill(__fill);
+ __os.precision(__precision);
+ return __os;
+ }
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
diff --git a/i686-linux/include/c++/4.4.3/tr1_impl/regex b/i686-linux/include/c++/4.4.3/tr1_impl/regex
new file mode 100644
index 0000000..9352bc1
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1_impl/regex
@@ -0,0 +1,2708 @@
+// class template regex -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/**
+ * @file tr1_impl/regex
+ * @brief The common implementation file for tr1 and std regular expressions.
+ *
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+/**
+ * @defgroup tr1_regex Regular Expressions
+ * A facility for performing regular expression pattern matching.
+ */
+ //@{
+
+/** @namespace std::regex_constants
+ * @brief ISO C++ 0x entities sub namespace for regex.
+ */
+namespace regex_constants
+{
+ /**
+ * @name 5.1 Regular Expression Syntax Options
+ */
+ //@{
+ enum __syntax_option
+ {
+ _S_icase,
+ _S_nosubs,
+ _S_optimize,
+ _S_collate,
+ _S_ECMAScript,
+ _S_basic,
+ _S_extended,
+ _S_awk,
+ _S_grep,
+ _S_egrep,
+ _S_syntax_last
+ };
+
+ /**
+ * @brief This is a bitmask type indicating how to interpret the regex.
+ *
+ * The @c syntax_option_type is implementation defined but it is valid to
+ * perform bitwise operations on these values and expect the right thing to
+ * happen.
+ *
+ * A valid value of type syntax_option_type shall have exactly one of the
+ * elements @c ECMAScript, @c basic, @c extended, @c awk, @c grep, @c egrep
+ * %set.
+ */
+ typedef unsigned int syntax_option_type;
+
+ /**
+ * Specifies that the matching of regular expressions against a character
+ * sequence shall be performed without regard to case.
+ */
+ static const syntax_option_type icase = 1 << _S_icase;
+
+ /**
+ * Specifies that when a regular expression is matched against a character
+ * container sequence, no sub-expression matches are to be stored in the
+ * supplied match_results structure.
+ */
+ static const syntax_option_type nosubs = 1 << _S_nosubs;
+
+ /**
+ * Specifies that the regular expression engine should pay more attention to
+ * the speed with which regular expressions are matched, and less to the
+ * speed with which regular expression objects are constructed. Otherwise
+ * it has no detectable effect on the program output.
+ */
+ static const syntax_option_type optimize = 1 << _S_optimize;
+
+ /**
+ * Specifies that character ranges of the form [a-b] should be locale
+ * sensitive.
+ */
+ static const syntax_option_type collate = 1 << _S_collate;
+
+ /**
+ * Specifies that the grammar recognized by the regular expression engine is
+ * that used by ECMAScript in ECMA-262 [Ecma International, ECMAScript
+ * Language Specification, Standard Ecma-262, third edition, 1999], as
+ * modified in tr1 section [7.13]. This grammar is similar to that defined
+ * in the PERL scripting language but extended with elements found in the
+ * POSIX regular expression grammar.
+ */
+ static const syntax_option_type ECMAScript = 1 << _S_ECMAScript;
+
+ /**
+ * Specifies that the grammar recognized by the regular expression engine is
+ * that used by POSIX basic regular expressions in IEEE Std 1003.1-2001,
+ * Portable Operating System Interface (POSIX), Base Definitions and
+ * Headers, Section 9, Regular Expressions [IEEE, Information Technology --
+ * Portable Operating System Interface (POSIX), IEEE Standard 1003.1-2001].
+ */
+ static const syntax_option_type basic = 1 << _S_basic;
+
+ /**
+ * Specifies that the grammar recognized by the regular expression engine is
+ * that used by POSIX extended regular expressions in IEEE Std 1003.1-2001,
+ * Portable Operating System Interface (POSIX), Base Definitions and Headers,
+ * Section 9, Regular Expressions.
+ */
+ static const syntax_option_type extended = 1 << _S_extended;
+
+ /**
+ * Specifies that the grammar recognized by the regular expression engine is
+ * that used by POSIX utility awk in IEEE Std 1003.1-2001. This option is
+ * identical to syntax_option_type extended, except that C-style escape
+ * sequences are supported. These sequences are, explicitly, "\\", "\a",
+ * "\b", "\f", "\n", "\r", "\t" , "\v", "\"", "'",
+ * and "\ddd" (where ddd is one, two, or three octal digits).
+ */
+ static const syntax_option_type awk = 1 << _S_awk;
+
+ /**
+ * Specifies that the grammar recognized by the regular expression engine is
+ * that used by POSIX utility grep in IEEE Std 1003.1-2001. This option is
+ * identical to syntax_option_type basic, except that newlines are treated
+ * as whitespace.
+ */
+ static const syntax_option_type grep = 1 << _S_grep;
+
+ /**
+ * Specifies that the grammar recognized by the regular expression engine is
+ * that used by POSIX utility grep when given the -E option in
+ * IEEE Std 1003.1-2001. This option is identical to syntax_option_type
+ * extended, except that newlines are treated as whitespace.
+ */
+ static const syntax_option_type egrep = 1 << _S_egrep;
+
+ //@}
+
+ /**
+ * @name 5.2 Matching Rules
+ *
+ * Matching a regular expression against a sequence of characters [first,
+ * last) proceeds according to the rules of the grammar specified for the
+ * regular expression object, modified according to the effects listed
+ * below for any bitmask elements set.
+ *
+ */
+ //@{
+
+ enum __match_flag
+ {
+ _S_not_bol,
+ _S_not_eol,
+ _S_not_bow,
+ _S_not_eow,
+ _S_any,
+ _S_not_null,
+ _S_continuous,
+ _S_prev_avail,
+ _S_sed,
+ _S_no_copy,
+ _S_first_only,
+ _S_match_flag_last
+ };
+
+ /**
+ * @brief This is a bitmask type indicating regex matching rules.
+ *
+ * The @c match_flag_type is implementation defined but it is valid to
+ * perform bitwise operations on these values and expect the right thing to
+ * happen.
+ */
+ typedef std::bitset<_S_match_flag_last> match_flag_type;
+
+ /**
+ * The default matching rules.
+ */
+ static const match_flag_type match_default = 0;
+
+ /**
+ * The first character in the sequence [first, last) is treated as though it
+ * is not at the beginning of a line, so the character "^" in the regular
+ * expression shall not match [first, first).
+ */
+ static const match_flag_type match_not_bol = 1 << _S_not_bol;
+
+ /**
+ * The last character in the sequence [first, last) is treated as though it
+ * is not at the end of a line, so the character "$" in the regular
+ * expression shall not match [last, last).
+ */
+ static const match_flag_type match_not_eol = 1 << _S_not_eol;
+
+ /**
+ * The expression "\b" is not matched against the sub-sequence
+ * [first,first).
+ */
+ static const match_flag_type match_not_bow = 1 << _S_not_bow;
+
+ /**
+ * The expression "\b" should not be matched against the sub-sequence
+ * [last,last).
+ */
+ static const match_flag_type match_not_eow = 1 << _S_not_eow;
+
+ /**
+ * If more than one match is possible then any match is an acceptable
+ * result.
+ */
+ static const match_flag_type match_any = 1 << _S_any;
+
+ /**
+ * The expression does not match an empty sequence.
+ */
+ static const match_flag_type match_not_null = 1 << _S_not_null;
+
+ /**
+ * The expression only matches a sub-sequence that begins at first .
+ */
+ static const match_flag_type match_continuous = 1 << _S_continuous;
+
+ /**
+ * --first is a valid iterator position. When this flag is set then the
+ * flags match_not_bol and match_not_bow are ignored by the regular
+ * expression algorithms 7.11 and iterators 7.12.
+ */
+ static const match_flag_type match_prev_avail = 1 << _S_prev_avail;
+
+ /**
+ * When a regular expression match is to be replaced by a new string, the
+ * new string is constructed using the rules used by the ECMAScript replace
+ * function in ECMA- 262 [Ecma International, ECMAScript Language
+ * Specification, Standard Ecma-262, third edition, 1999], part 15.5.4.11
+ * String.prototype.replace. In addition, during search and replace
+ * operations all non-overlapping occurrences of the regular expression
+ * are located and replaced, and sections of the input that did not match
+ * the expression are copied unchanged to the output string.
+ *
+ * Format strings (from ECMA-262 [15.5.4.11]):
+ * @li $$ The dollar-sign itself ($)
+ * @li $& The matched substring.
+ * @li $` The portion of <em>string</em> that precedes the matched substring.
+ * This would be match_results::prefix().
+ * @li $' The portion of <em>string</em> that follows the matched substring.
+ * This would be match_results::suffix().
+ * @li $n The nth capture, where n is in [1,9] and $n is not followed by a
+ * decimal digit. If n <= match_results::size() and the nth capture
+ * is undefined, use the empty string instead. If n >
+ * match_results::size(), the result is implementation-defined.
+ * @li $nn The nnth capture, where nn is a two-digit decimal number on
+ * [01, 99]. If nn <= match_results::size() and the nth capture is
+ * undefined, use the empty string instead. If
+ * nn > match_results::size(), the result is implementation-defined.
+ */
+ static const match_flag_type format_default = 0;
+
+ /**
+ * When a regular expression match is to be replaced by a new string, the
+ * new string is constructed using the rules used by the POSIX sed utility
+ * in IEEE Std 1003.1- 2001 [IEEE, Information Technology -- Portable
+ * Operating System Interface (POSIX), IEEE Standard 1003.1-2001].
+ */
+ static const match_flag_type format_sed = 1 << _S_sed;
+
+ /**
+ * During a search and replace operation, sections of the character
+ * container sequence being searched that do not match the regular
+ * expression shall not be copied to the output string.
+ */
+ static const match_flag_type format_no_copy = 1 << _S_no_copy;
+
+ /**
+ * When specified during a search and replace operation, only the first
+ * occurrence of the regular expression shall be replaced.
+ */
+ static const match_flag_type format_first_only = 1 << _S_first_only;
+
+ //@}
+
+ /**
+ * @name 5.3 Error Types
+ */
+ //@{
+
+ enum error_type
+ {
+ _S_error_collate,
+ _S_error_ctype,
+ _S_error_escape,
+ _S_error_backref,
+ _S_error_brack,
+ _S_error_paren,
+ _S_error_brace,
+ _S_error_badbrace,
+ _S_error_range,
+ _S_error_space,
+ _S_error_badrepeat,
+ _S_error_complexity,
+ _S_error_stack,
+ _S_error_last
+ };
+
+ /** The expression contained an invalid collating element name. */
+ static const error_type error_collate(_S_error_collate);
+
+ /** The expression contained an invalid character class name. */
+ static const error_type error_ctype(_S_error_ctype);
+
+ /**
+ * The expression contained an invalid escaped character, or a trailing
+ * escape.
+ */
+ static const error_type error_escape(_S_error_escape);
+
+ /** The expression contained an invalid back reference. */
+ static const error_type error_backref(_S_error_backref);
+
+ /** The expression contained mismatched [ and ]. */
+ static const error_type error_brack(_S_error_brack);
+
+ /** The expression contained mismatched ( and ). */
+ static const error_type error_paren(_S_error_paren);
+
+ /** The expression contained mismatched { and } */
+ static const error_type error_brace(_S_error_brace);
+
+ /** The expression contained an invalid range in a {} expression. */
+ static const error_type error_badbrace(_S_error_badbrace);
+
+ /**
+ * The expression contained an invalid character range,
+ * such as [b-a] in most encodings.
+ */
+ static const error_type error_range(_S_error_range);
+
+ /**
+ * There was insufficient memory to convert the expression into a
+ * finite state machine.
+ */
+ static const error_type error_space(_S_error_space);
+
+ /**
+ * One of "*?+{" was not preceded by a valid regular expression.
+ */
+ static const error_type error_badrepeat(_S_error_badrepeat);
+
+ /**
+ * The complexity of an attempted match against a regular expression
+ * exceeded a pre-set level.
+ */
+ static const error_type error_complexity(_S_error_complexity);
+
+ /**
+ * There was insufficient memory to determine whether the
+ * regular expression could match the specified character sequence.
+ */
+ static const error_type error_stack(_S_error_stack);
+
+ //@}
+}
+
+
+ // [7.8] Class regex_error
+ /**
+ * @brief A regular expression exception class.
+ * @ingroup exceptions
+ *
+ * The regular expression library throws objects of this class on error.
+ */
+ class regex_error
+ : public std::runtime_error
+ {
+ public:
+ /**
+ * @brief Constructs a regex_error object.
+ *
+ * @param ecode the regex error code.
+ */
+ explicit
+ regex_error(regex_constants::error_type __ecode)
+ : std::runtime_error("regex_error"), _M_code(__ecode)
+ { }
+
+ /**
+ * @brief Gets the regex error code.
+ *
+ * @returns the regex error code.
+ */
+ regex_constants::error_type
+ code() const
+ { return _M_code; }
+
+ protected:
+ regex_constants::error_type _M_code;
+ };
+
+ // [7.7] Class regex_traits
+ /**
+ * @brief Describes aspects of a regular expression.
+ *
+ * A regular expression traits class that satisfies the requirements of tr1
+ * section [7.2].
+ *
+ * The class %regex is parameterized around a set of related types and
+ * functions used to complete the definition of its semantics. This class
+ * satisfies the requirements of such a traits class.
+ */
+ template<typename _Ch_type>
+ struct regex_traits
+ {
+ public:
+ typedef _Ch_type char_type;
+ typedef std::basic_string<char_type> string_type;
+ typedef std::locale locale_type;
+ typedef std::ctype_base::mask char_class_type;
+
+ public:
+ /**
+ * @brief Constructs a default traits object.
+ */
+ regex_traits()
+ { }
+
+ /**
+ * @brief Gives the length of a C-style string starting at @p __p.
+ *
+ * @param __p a pointer to the start of a character sequence.
+ *
+ * @returns the number of characters between @p *__p and the first
+ * default-initialized value of type @p char_type. In other words, uses
+ * the C-string algorithm for determining the length of a sequence of
+ * characters.
+ */
+ static std::size_t
+ length(const char_type* __p)
+ { return string_type::traits_type::length(__p); }
+
+ /**
+ * @brief Performs the identity translation.
+ *
+ * @param c A character to the locale-specific character set.
+ *
+ * @returns c.
+ */
+ char_type
+ translate(char_type __c) const
+ { return __c; }
+
+ /**
+ * @brief Translates a character into a case-insensitive equivalent.
+ *
+ * @param c A character to the locale-specific character set.
+ *
+ * @returns the locale-specific lower-case equivalent of c.
+ * @throws std::bad_cast if the imbued locale does not support the ctype
+ * facet.
+ */
+ char_type
+ translate_nocase(char_type __c) const
+ {
+ using std::ctype;
+ using std::use_facet;
+ return use_facet<ctype<char_type> >(_M_locale).tolower(__c);
+ }
+
+ /**
+ * @brief Gets a sort key for a character sequence.
+ *
+ * @param first beginning of the character sequence.
+ * @param last one-past-the-end of the character sequence.
+ *
+ * Returns a sort key for the character sequence designated by the
+ * iterator range [F1, F2) such that if the character sequence [G1, G2)
+ * sorts before the character sequence [H1, H2) then
+ * v.transform(G1, G2) < v.transform(H1, H2).
+ *
+ * What this really does is provide a more efficient way to compare a
+ * string to multiple other strings in locales with fancy collation
+ * rules and equivalence classes.
+ *
+ * @returns a locale-specific sort key equivalent to the input range.
+ *
+ * @throws std::bad_cast if the current locale does not have a collate
+ * facet.
+ */
+ template<typename _Fwd_iter>
+ string_type
+ transform(_Fwd_iter __first, _Fwd_iter __last) const
+ {
+ using std::collate;
+ using std::use_facet;
+ const collate<_Ch_type>& __c(use_facet<
+ collate<_Ch_type> >(_M_locale));
+ string_type __s(__first, __last);
+ return __c.transform(__s.data(), __s.data() + __s.size());
+ }
+
+ /**
+ * @brief Dunno.
+ *
+ * @param first beginning of the character sequence.
+ * @param last one-past-the-end of the character sequence.
+ *
+ * Effects: if typeid(use_facet<collate<_Ch_type> >) ==
+ * typeid(collate_byname<_Ch_type>) and the form of the sort key
+ * returned by collate_byname<_Ch_type>::transform(first, last) is known
+ * and can be converted into a primary sort key then returns that key,
+ * otherwise returns an empty string. WTF??
+ *
+ * @todo Implement this function.
+ */
+ template<typename _Fwd_iter>
+ string_type
+ transform_primary(_Fwd_iter __first, _Fwd_iter __last) const;
+
+ /**
+ * @brief Gets a collation element by name.
+ *
+ * @param first beginning of the collation element name.
+ * @param last one-past-the-end of the collation element name.
+ *
+ * @returns a sequence of one or more characters that represents the
+ * collating element consisting of the character sequence designated by
+ * the iterator range [first, last). Returns an empty string if the
+ * character sequence is not a valid collating element.
+ *
+ * @todo Implement this function.
+ */
+ template<typename _Fwd_iter>
+ string_type
+ lookup_collatename(_Fwd_iter __first, _Fwd_iter __last) const;
+
+ /**
+ * @brief Maps one or more characters to a named character
+ * classification.
+ *
+ * @param first beginning of the character sequence.
+ * @param last one-past-the-end of the character sequence.
+ *
+ * @returns an unspecified value that represents the character
+ * classification named by the character sequence designated by the
+ * iterator range [first, last). The value returned shall be independent
+ * of the case of the characters in the character sequence. If the name
+ * is not recognized then returns a value that compares equal to 0.
+ *
+ * At least the following names (or their wide-character equivalent) are
+ * supported.
+ * - d
+ * - w
+ * - s
+ * - alnum
+ * - alpha
+ * - blank
+ * - cntrl
+ * - digit
+ * - graph
+ * - lower
+ * - print
+ * - punct
+ * - space
+ * - upper
+ * - xdigit
+ *
+ * @todo Implement this function.
+ */
+ template<typename _Fwd_iter>
+ char_class_type
+ lookup_classname(_Fwd_iter __first, _Fwd_iter __last) const;
+
+ /**
+ * @brief Determines if @p c is a member of an identified class.
+ *
+ * @param c a character.
+ * @param f a class type (as returned from lookup_classname).
+ *
+ * @returns true if the character @p c is a member of the classification
+ * represented by @p f, false otherwise.
+ *
+ * @throws std::bad_cast if the current locale does not have a ctype
+ * facet.
+ */
+ bool
+ isctype(_Ch_type __c, char_class_type __f) const;
+
+ /**
+ * @brief Converts a digit to an int.
+ *
+ * @param ch a character representing a digit.
+ * @param radix the radix if the numeric conversion (limited to 8, 10,
+ * or 16).
+ *
+ * @returns the value represented by the digit ch in base radix if the
+ * character ch is a valid digit in base radix; otherwise returns -1.
+ */
+ int
+ value(_Ch_type __ch, int __radix) const;
+
+ /**
+ * @brief Imbues the regex_traits object with a copy of a new locale.
+ *
+ * @param loc A locale.
+ *
+ * @returns a copy of the previous locale in use by the regex_traits
+ * object.
+ *
+ * @note Calling imbue with a different locale than the one currently in
+ * use invalidates all cached data held by *this.
+ */
+ locale_type
+ imbue(locale_type __loc)
+ {
+ std::swap(_M_locale, __loc);
+ return __loc;
+ }
+
+ /**
+ * @brief Gets a copy of the current locale in use by the regex_traits
+ * object.
+ */
+ locale_type
+ getloc() const
+ { return _M_locale; }
+
+ protected:
+ locale_type _M_locale;
+ };
+
+ template<typename _Ch_type>
+ bool regex_traits<_Ch_type>::
+ isctype(_Ch_type __c, char_class_type __f) const
+ {
+ using std::ctype;
+ using std::use_facet;
+ const ctype<_Ch_type>& __ctype(use_facet<
+ ctype<_Ch_type> >(_M_locale));
+
+ if (__ctype.is(__c, __f))
+ return true;
+
+ // special case of underscore in [[:w:]]
+ if (__c == __ctype.widen('_'))
+ {
+ const char* const __wb[] = "w";
+ char_class_type __wt = this->lookup_classname(__wb,
+ __wb + sizeof(__wb));
+ if (__f | __wt)
+ return true;
+ }
+
+ // special case of [[:space:]] in [[:blank:]]
+ if (__c == __ctype.isspace(__c))
+ {
+ const char* const __bb[] = "blank";
+ char_class_type __bt = this->lookup_classname(__bb,
+ __bb + sizeof(__bb));
+ if (__f | __bt)
+ return true;
+ }
+
+ return false;
+ }
+
+ template<typename _Ch_type>
+ int regex_traits<_Ch_type>::
+ value(_Ch_type __ch, int __radix) const
+ {
+ std::basic_istringstream<_Ch_type> __is(string_type(1, __ch));
+ int __v = -1;
+ if (__radix == 8)
+ __is >> std::oct;
+ else if (__radix == 16)
+ __is >> std::hex;
+ __is >> __v;
+ return __v;
+ }
+
+ // [7.8] Class basic_regex
+ /**
+ * Objects of specializations of this class represent regular expressions
+ * constructed from sequences of character type @p _Ch_type.
+ *
+ * Storage for the regular expression is allocated and deallocated as
+ * necessary by the member functions of this class.
+ */
+ template<typename _Ch_type, typename _Rx_traits = regex_traits<_Ch_type> >
+ class basic_regex
+ {
+ public:
+ // types:
+ typedef _Ch_type value_type;
+ typedef regex_constants::syntax_option_type flag_type;
+ typedef typename _Rx_traits::locale_type locale_type;
+ typedef typename _Rx_traits::string_type string_type;
+
+ /**
+ * @name Constants
+ * tr1 [7.8.1] std [28.8.1]
+ */
+ //@{
+ static const regex_constants::syntax_option_type icase
+ = regex_constants::icase;
+ static const regex_constants::syntax_option_type nosubs
+ = regex_constants::nosubs;
+ static const regex_constants::syntax_option_type optimize
+ = regex_constants::optimize;
+ static const regex_constants::syntax_option_type collate
+ = regex_constants::collate;
+ static const regex_constants::syntax_option_type ECMAScript
+ = regex_constants::ECMAScript;
+ static const regex_constants::syntax_option_type basic
+ = regex_constants::basic;
+ static const regex_constants::syntax_option_type extended
+ = regex_constants::extended;
+ static const regex_constants::syntax_option_type awk
+ = regex_constants::awk;
+ static const regex_constants::syntax_option_type grep
+ = regex_constants::grep;
+ static const regex_constants::syntax_option_type egrep
+ = regex_constants::egrep;
+ //@}
+
+ // [7.8.2] construct/copy/destroy
+ /**
+ * Constructs a basic regular expression that does not match any
+ * character sequence.
+ */
+ basic_regex()
+ : _M_flags(regex_constants::ECMAScript), _M_pattern(), _M_mark_count(0)
+ { _M_compile(); }
+
+ /**
+ * @brief Constructs a basic regular expression from the sequence
+ * [p, p + char_traits<_Ch_type>::length(p)) interpreted according to the
+ * flags in @p f.
+ *
+ * @param p A pointer to the start of a C-style null-terminated string
+ * containing a regular expression.
+ * @param f Flags indicating the syntax rules and options.
+ *
+ * @throws regex_error if @p p is not a valid regular expression.
+ */
+ explicit
+ basic_regex(const _Ch_type* __p,
+ flag_type __f = regex_constants::ECMAScript)
+ : _M_flags(__f), _M_pattern(__p), _M_mark_count(0)
+ { _M_compile(); }
+
+ /**
+ * @brief Constructs a basic regular expression from the sequence
+ * [p, p + len) interpreted according to the flags in @p f.
+ *
+ * @param p A pointer to the start of a string containing a regular
+ * expression.
+ * @param len The length of the string containing the regular expression.
+ * @param f Flags indicating the syntax rules and options.
+ *
+ * @throws regex_error if @p p is not a valid regular expression.
+ */
+ basic_regex(const _Ch_type* __p, std::size_t __len, flag_type __f)
+ : _M_flags(__f) , _M_pattern(__p, __len), _M_mark_count(0)
+ { _M_compile(); }
+
+ /**
+ * @brief Copy-constructs a basic regular expression.
+ *
+ * @param rhs A @p regex object.
+ */
+ basic_regex(const basic_regex& __rhs)
+ : _M_flags(__rhs._M_flags), _M_pattern(__rhs._M_pattern),
+ _M_mark_count(__rhs._M_mark_count)
+ { _M_compile(); }
+
+ /**
+ * @brief Constructs a basic regular expression from the string
+ * @p s interpreted according to the flags in @p f.
+ *
+ * @param s A string containing a regular expression.
+ * @param f Flags indicating the syntax rules and options.
+ *
+ * @throws regex_error if @p s is not a valid regular expression.
+ */
+ template<typename _Ch_traits, typename _Ch_alloc>
+ explicit
+ basic_regex(const basic_string<_Ch_type, _Ch_traits, _Ch_alloc>& __s,
+ flag_type __f = regex_constants::ECMAScript)
+ : _M_flags(__f), _M_pattern(__s.begin(), __s.end()), _M_mark_count(0)
+ { _M_compile(); }
+
+ /**
+ * @brief Constructs a basic regular expression from the range
+ * [first, last) interpreted according to the flags in @p f.
+ *
+ * @param first The start of a range containing a valid regular
+ * expression.
+ * @param last The end of a range containing a valid regular
+ * expression.
+ * @param f The format flags of the regular expression.
+ *
+ * @throws regex_error if @p [first, last) is not a valid regular
+ * expression.
+ */
+ template<typename _InputIterator>
+ basic_regex(_InputIterator __first, _InputIterator __last,
+ flag_type __f = regex_constants::ECMAScript)
+ : _M_flags(__f), _M_pattern(__first, __last), _M_mark_count(0)
+ { _M_compile(); }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ /**
+ * @brief Constructs a basic regular expression from an initializer list.
+ *
+ * @param l The initializer list.
+ * @param f The format flags of the regular expression.
+ *
+ * @throws regex_error if @p l is not a valid regular expression.
+ */
+ basic_regex(initializer_list<_Ch_type> __l,
+ flag_type __f = regex_constants::ECMAScript)
+ : _M_flags(__f), _M_pattern(__l.begin(), __l.end()), _M_mark_count(0)
+ { _M_compile(); }
+#endif
+
+ /**
+ * @brief Destroys a basic regular expression.
+ */
+ ~basic_regex()
+ { }
+
+ /**
+ * @brief Assigns one regular expression to another.
+ */
+ basic_regex&
+ operator=(const basic_regex& __rhs)
+ { return this->assign(__rhs); }
+
+ /**
+ * @brief Replaces a regular expression with a new one constructed from
+ * a C-style null-terminated string.
+ *
+ * @param A pointer to the start of a null-terminated C-style string
+ * containing a regular expression.
+ */
+ basic_regex&
+ operator=(const _Ch_type* __p)
+ { return this->assign(__p, flags()); }
+
+ /**
+ * @brief Replaces a regular expression with a new one constructed from
+ * a string.
+ *
+ * @param A pointer to a string containing a regular expression.
+ */
+ template<typename _Ch_typeraits, typename _Allocator>
+ basic_regex&
+ operator=(const basic_string<_Ch_type, _Ch_typeraits, _Allocator>& __s)
+ { return this->assign(__s, flags()); }
+
+ // [7.8.3] assign
+ /**
+ * @brief the real assignment operator.
+ *
+ * @param that Another regular expression object.
+ */
+ basic_regex&
+ assign(const basic_regex& __that)
+ {
+ basic_regex __tmp(__that);
+ this->swap(__tmp);
+ return *this;
+ }
+
+ /**
+ * @brief Assigns a new regular expression to a regex object from a
+ * C-style null-terminated string containing a regular expression
+ * pattern.
+ *
+ * @param p A pointer to a C-style null-terminated string containing
+ * a regular expression pattern.
+ * @param flags Syntax option flags.
+ *
+ * @throws regex_error if p does not contain a valid regular expression
+ * pattern interpreted according to @p flags. If regex_error is thrown,
+ * *this remains unchanged.
+ */
+ basic_regex&
+ assign(const _Ch_type* __p,
+ flag_type __flags = regex_constants::ECMAScript)
+ { return this->assign(string_type(__p), __flags); }
+
+ /**
+ * @brief Assigns a new regular expression to a regex object from a
+ * C-style string containing a regular expression pattern.
+ *
+ * @param p A pointer to a C-style string containing a
+ * regular expression pattern.
+ * @param len The length of the regular expression pattern string.
+ * @param flags Syntax option flags.
+ *
+ * @throws regex_error if p does not contain a valid regular expression
+ * pattern interpreted according to @p flags. If regex_error is thrown,
+ * *this remains unchanged.
+ */
+ basic_regex&
+ assign(const _Ch_type* __p, std::size_t __len, flag_type __flags)
+ { return this->assign(string_type(__p, __len), __flags); }
+
+ /**
+ * @brief Assigns a new regular expression to a regex object from a
+ * string containing a regular expression pattern.
+ *
+ * @param s A string containing a regular expression pattern.
+ * @param flags Syntax option flags.
+ *
+ * @throws regex_error if p does not contain a valid regular expression
+ * pattern interpreted according to @p flags. If regex_error is thrown,
+ * *this remains unchanged.
+ */
+ template<typename _Ch_typeraits, typename _Allocator>
+ basic_regex&
+ assign(const basic_string<_Ch_type, _Ch_typeraits, _Allocator>& __s,
+ flag_type __f = regex_constants::ECMAScript)
+ {
+ basic_regex __tmp(__s, __f);
+ this->swap(__tmp);
+ return *this;
+ }
+
+ /**
+ * @brief Assigns a new regular expression to a regex object.
+ *
+ * @param first The start of a range containing a valid regular
+ * expression.
+ * @param last The end of a range containing a valid regular
+ * expression.
+ * @param flags Syntax option flags.
+ *
+ * @throws regex_error if p does not contain a valid regular expression
+ * pattern interpreted according to @p flags. If regex_error is thrown,
+ * the object remains unchanged.
+ */
+ template<typename _InputIterator>
+ basic_regex&
+ assign(_InputIterator __first, _InputIterator __last,
+ flag_type __flags = regex_constants::ECMAScript)
+ { return this->assign(string_type(__first, __last), __flags); }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ /**
+ * @brief Assigns a new regular expression to a regex object.
+ *
+ * @param l An initializer list representing a regular expression.
+ * @param flags Syntax option flags.
+ *
+ * @throws regex_error if @p l does not contain a valid regular
+ * expression pattern interpreted according to @p flags. If regex_error
+ * is thrown, the object remains unchanged.
+ */
+ basic_regex&
+ assign(initializer_list<_Ch_type> __l,
+ flag_type __f = regex_constants::ECMAScript)
+ { return this->assign(__l.begin(), __l.end(), __f); }
+#endif
+
+ // [7.8.4] const operations
+ /**
+ * @brief Gets the number of marked subexpressions within the regular
+ * expression.
+ */
+ unsigned int
+ mark_count() const
+ { return _M_mark_count; }
+
+ /**
+ * @brief Gets the flags used to construct the regular expression
+ * or in the last call to assign().
+ */
+ flag_type
+ flags() const
+ { return _M_flags; }
+
+ // [7.8.5] locale
+ /**
+ * @brief Imbues the regular expression object with the given locale.
+ *
+ * @param loc A locale.
+ */
+ locale_type
+ imbue(locale_type __loc)
+ { return _M_traits.imbue(__loc); }
+
+ /**
+ * @brief Gets the locale currently imbued in the regular expression
+ * object.
+ */
+ locale_type
+ getloc() const
+ { return _M_traits.getloc(); }
+
+ // [7.8.6] swap
+ /**
+ * @brief Swaps the contents of two regular expression objects.
+ *
+ * @param rhs Another regular expression object.
+ */
+ void
+ swap(basic_regex& __rhs)
+ {
+ std::swap(_M_flags, __rhs._M_flags);
+ std::swap(_M_pattern, __rhs._M_pattern);
+ std::swap(_M_mark_count, __rhs._M_mark_count);
+ std::swap(_M_traits, __rhs._M_traits);
+ }
+
+ private:
+ /**
+ * @brief Compiles a regular expression pattern into a NFA.
+ * @todo Implement this function.
+ */
+ void _M_compile();
+
+ protected:
+ flag_type _M_flags;
+ string_type _M_pattern;
+ unsigned int _M_mark_count;
+ _Rx_traits _M_traits;
+ };
+
+ /** @brief Standard regular expressions. */
+ typedef basic_regex<char> regex;
+#ifdef _GLIBCXX_USE_WCHAR_T
+ /** @brief Standard wide-character regular expressions. */
+ typedef basic_regex<wchar_t> wregex;
+#endif
+
+
+ // [7.8.6] basic_regex swap
+ /**
+ * @brief Swaps the contents of two regular expression objects.
+ * @param lhs First regular expression.
+ * @param rhs Second regular expression.
+ */
+ template<typename _Ch_type, typename _Rx_traits>
+ inline void
+ swap(basic_regex<_Ch_type, _Rx_traits>& __lhs,
+ basic_regex<_Ch_type, _Rx_traits>& __rhs)
+ { __lhs.swap(__rhs); }
+
+
+ // [7.9] Class template sub_match
+ /**
+ * A sequence of characters matched by a particular marked sub-expression.
+ *
+ * An object of this class is essentially a pair of iterators marking a
+ * matched subexpression within a regular expression pattern match. Such
+ * objects can be converted to and compared with std::basic_string objects
+ * of a similar base character type as the pattern matched by the regular
+ * expression.
+ *
+ * The iterators that make up the pair are the usual half-open interval
+ * referencing the actual original pattern matched.
+ */
+ template<typename _BiIter>
+ class sub_match : public std::pair<_BiIter, _BiIter>
+ {
+ public:
+ typedef typename iterator_traits<_BiIter>::value_type value_type;
+ typedef typename iterator_traits<_BiIter>::difference_type
+ difference_type;
+ typedef _BiIter iterator;
+
+ public:
+ bool matched;
+
+ /**
+ * Gets the length of the matching sequence.
+ */
+ difference_type
+ length() const
+ { return this->matched ? std::distance(this->first, this->second) : 0; }
+
+ /**
+ * @brief Gets the matching sequence as a string.
+ *
+ * @returns the matching sequence as a string.
+ *
+ * This is the implicit conversion operator. It is identical to the
+ * str() member function except that it will want to pop up in
+ * unexpected places and cause a great deal of confusion and cursing
+ * from the unwary.
+ */
+ operator basic_string<value_type>() const
+ {
+ return this->matched
+ ? std::basic_string<value_type>(this->first, this->second)
+ : std::basic_string<value_type>();
+ }
+
+ /**
+ * @brief Gets the matching sequence as a string.
+ *
+ * @returns the matching sequence as a string.
+ */
+ basic_string<value_type>
+ str() const
+ {
+ return this->matched
+ ? std::basic_string<value_type>(this->first, this->second)
+ : std::basic_string<value_type>();
+ }
+
+ /**
+ * @brief Compares this and another matched sequence.
+ *
+ * @param s Another matched sequence to compare to this one.
+ *
+ * @retval <0 this matched sequence will collate before @p s.
+ * @retval =0 this matched sequence is equivalent to @p s.
+ * @retval <0 this matched sequence will collate after @p s.
+ */
+ int
+ compare(const sub_match& __s) const
+ { return this->str().compare(__s.str()); }
+
+ /**
+ * @brief Compares this sub_match to a string.
+ *
+ * @param s A string to compare to this sub_match.
+ *
+ * @retval <0 this matched sequence will collate before @p s.
+ * @retval =0 this matched sequence is equivalent to @p s.
+ * @retval <0 this matched sequence will collate after @p s.
+ */
+ int
+ compare(const basic_string<value_type>& __s) const
+ { return this->str().compare(__s); }
+
+ /**
+ * @brief Compares this sub_match to a C-style string.
+ *
+ * @param s A C-style string to compare to this sub_match.
+ *
+ * @retval <0 this matched sequence will collate before @p s.
+ * @retval =0 this matched sequence is equivalent to @p s.
+ * @retval <0 this matched sequence will collate after @p s.
+ */
+ int
+ compare(const value_type* __s) const
+ { return this->str().compare(__s); }
+ };
+
+
+ /** @brief Standard regex submatch over a C-style null-terminated string. */
+ typedef sub_match<const char*> csub_match;
+ /** @brief Standard regex submatch over a standard string. */
+ typedef sub_match<string::const_iterator> ssub_match;
+#ifdef _GLIBCXX_USE_WCHAR_T
+ /** @brief Regex submatch over a C-style null-terminated wide string. */
+ typedef sub_match<const wchar_t*> wcsub_match;
+ /** @brief Regex submatch over a standard wide string. */
+ typedef sub_match<wstring::const_iterator> wssub_match;
+#endif
+
+ // [7.9.2] sub_match non-member operators
+
+ /**
+ * @brief Tests the equivalence of two regular expression submatches.
+ * @param lhs First regular expression submatch.
+ * @param rhs Second regular expression submatch.
+ * @returns true if @a lhs is equivalent to @a rhs, false otherwise.
+ */
+ template<typename _BiIter>
+ inline bool
+ operator==(const sub_match<_BiIter>& __lhs,
+ const sub_match<_BiIter>& __rhs)
+ { return __lhs.compare(__rhs) == 0; }
+
+ /**
+ * @brief Tests the inequivalence of two regular expression submatches.
+ * @param lhs First regular expression submatch.
+ * @param rhs Second regular expression submatch.
+ * @returns true if @a lhs is not equivalent to @a rhs, false otherwise.
+ */
+ template<typename _BiIter>
+ inline bool
+ operator!=(const sub_match<_BiIter>& __lhs,
+ const sub_match<_BiIter>& __rhs)
+ { return __lhs.compare(__rhs) != 0; }
+
+ /**
+ * @brief Tests the ordering of two regular expression submatches.
+ * @param lhs First regular expression submatch.
+ * @param rhs Second regular expression submatch.
+ * @returns true if @a lhs precedes @a rhs, false otherwise.
+ */
+ template<typename _BiIter>
+ inline bool
+ operator<(const sub_match<_BiIter>& __lhs,
+ const sub_match<_BiIter>& __rhs)
+ { return __lhs.compare(__rhs) < 0; }
+
+ /**
+ * @brief Tests the ordering of two regular expression submatches.
+ * @param lhs First regular expression submatch.
+ * @param rhs Second regular expression submatch.
+ * @returns true if @a lhs does not succeed @a rhs, false otherwise.
+ */
+ template<typename _BiIter>
+ inline bool
+ operator<=(const sub_match<_BiIter>& __lhs,
+ const sub_match<_BiIter>& __rhs)
+ { return __lhs.compare(__rhs) <= 0; }
+
+ /**
+ * @brief Tests the ordering of two regular expression submatches.
+ * @param lhs First regular expression submatch.
+ * @param rhs Second regular expression submatch.
+ * @returns true if @a lhs does not precede @a rhs, false otherwise.
+ */
+ template<typename _BiIter>
+ inline bool
+ operator>=(const sub_match<_BiIter>& __lhs,
+ const sub_match<_BiIter>& __rhs)
+ { return __lhs.compare(__rhs) >= 0; }
+
+ /**
+ * @brief Tests the ordering of two regular expression submatches.
+ * @param lhs First regular expression submatch.
+ * @param rhs Second regular expression submatch.
+ * @returns true if @a lhs succeeds @a rhs, false otherwise.
+ */
+ template<typename _BiIter>
+ inline bool
+ operator>(const sub_match<_BiIter>& __lhs,
+ const sub_match<_BiIter>& __rhs)
+ { return __lhs.compare(__rhs) > 0; }
+
+ /**
+ * @brief Tests the equivalence of a string and a regular expression
+ * submatch.
+ * @param lhs A string.
+ * @param rhs A regular expression submatch.
+ * @returns true if @a lhs is equivalent to @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter, typename _Ch_traits, typename _Ch_alloc>
+ inline bool
+ operator==(const basic_string<
+ typename iterator_traits<_Bi_iter>::value_type,
+ _Ch_traits, _Ch_alloc>& __lhs,
+ const sub_match<_Bi_iter>& __rhs)
+ { return __lhs == __rhs.str(); }
+
+ /**
+ * @brief Tests the inequivalence of a string and a regular expression
+ * submatch.
+ * @param lhs A string.
+ * @param rhs A regular expression submatch.
+ * @returns true if @a lhs is not equivalent to @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter, typename _Ch_traits, typename _Ch_alloc>
+ inline bool
+ operator!=(const basic_string<
+ typename iterator_traits<_Bi_iter>::value_type,
+ _Ch_traits, _Ch_alloc>& __lhs, const sub_match<_Bi_iter>& __rhs)
+ { return __lhs != __rhs.str(); }
+
+ /**
+ * @brief Tests the ordering of a string and a regular expression submatch.
+ * @param lhs A string.
+ * @param rhs A regular expression submatch.
+ * @returns true if @a lhs precedes @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter, typename _Ch_traits, typename _Ch_alloc>
+ inline bool
+ operator<(const basic_string<
+ typename iterator_traits<_Bi_iter>::value_type,
+ _Ch_traits, _Ch_alloc>& __lhs, const sub_match<_Bi_iter>& __rhs)
+ { return __lhs < __rhs.str(); }
+
+ /**
+ * @brief Tests the ordering of a string and a regular expression submatch.
+ * @param lhs A string.
+ * @param rhs A regular expression submatch.
+ * @returns true if @a lhs succeeds @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter, typename _Ch_traits, typename _Ch_alloc>
+ inline bool
+ operator>(const basic_string<
+ typename iterator_traits<_Bi_iter>::value_type,
+ _Ch_traits, _Ch_alloc>& __lhs, const sub_match<_Bi_iter>& __rhs)
+ { return __lhs > __rhs.str(); }
+
+ /**
+ * @brief Tests the ordering of a string and a regular expression submatch.
+ * @param lhs A string.
+ * @param rhs A regular expression submatch.
+ * @returns true if @a lhs does not precede @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter, typename _Ch_traits, typename _Ch_alloc>
+ inline bool
+ operator>=(const basic_string<
+ typename iterator_traits<_Bi_iter>::value_type,
+ _Ch_traits, _Ch_alloc>& __lhs, const sub_match<_Bi_iter>& __rhs)
+ { return __lhs >= __rhs.str(); }
+
+ /**
+ * @brief Tests the ordering of a string and a regular expression submatch.
+ * @param lhs A string.
+ * @param rhs A regular expression submatch.
+ * @returns true if @a lhs does not succeed @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter, typename _Ch_traits, typename _Ch_alloc>
+ inline bool
+ operator<=(const basic_string<
+ typename iterator_traits<_Bi_iter>::value_type,
+ _Ch_traits, _Ch_alloc>& __lhs, const sub_match<_Bi_iter>& __rhs)
+ { return __lhs <= __rhs.str(); }
+
+ /**
+ * @brief Tests the equivalence of a regular expression submatch and a
+ * string.
+ * @param lhs A regular expression submatch.
+ * @param rhs A string.
+ * @returns true if @a lhs is equivalent to @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter, typename _Ch_traits, typename _Ch_alloc>
+ inline bool
+ operator==(const sub_match<_Bi_iter>& __lhs,
+ const basic_string<
+ typename iterator_traits<_Bi_iter>::value_type,
+ _Ch_traits, _Ch_alloc>& __rhs)
+ { return __lhs.str() == __rhs; }
+
+ /**
+ * @brief Tests the inequivalence of a regular expression submatch and a
+ * string.
+ * @param lhs A regular expression submatch.
+ * @param rhs A string.
+ * @returns true if @a lhs is not equivalent to @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter, typename _Ch_traits, typename _Ch_alloc>
+ inline bool
+ operator!=(const sub_match<_Bi_iter>& __lhs,
+ const basic_string<
+ typename iterator_traits<_Bi_iter>::value_type,
+ _Ch_traits, _Ch_alloc>& __rhs)
+ { return __lhs.str() != __rhs; }
+
+ /**
+ * @brief Tests the ordering of a regular expression submatch and a string.
+ * @param lhs A regular expression submatch.
+ * @param rhs A string.
+ * @returns true if @a lhs precedes @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter, class _Ch_traits, class _Ch_alloc>
+ inline bool
+ operator<(const sub_match<_Bi_iter>& __lhs,
+ const basic_string<
+ typename iterator_traits<_Bi_iter>::value_type,
+ _Ch_traits, _Ch_alloc>& __rhs)
+ { return __lhs.str() < __rhs; }
+
+ /**
+ * @brief Tests the ordering of a regular expression submatch and a string.
+ * @param lhs A regular expression submatch.
+ * @param rhs A string.
+ * @returns true if @a lhs succeeds @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter, class _Ch_traits, class _Ch_alloc>
+ inline bool
+ operator>(const sub_match<_Bi_iter>& __lhs,
+ const basic_string<
+ typename iterator_traits<_Bi_iter>::value_type,
+ _Ch_traits, _Ch_alloc>& __rhs)
+ { return __lhs.str() > __rhs; }
+
+ /**
+ * @brief Tests the ordering of a regular expression submatch and a string.
+ * @param lhs A regular expression submatch.
+ * @param rhs A string.
+ * @returns true if @a lhs does not precede @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter, class _Ch_traits, class _Ch_alloc>
+ inline bool
+ operator>=(const sub_match<_Bi_iter>& __lhs,
+ const basic_string<
+ typename iterator_traits<_Bi_iter>::value_type,
+ _Ch_traits, _Ch_alloc>& __rhs)
+ { return __lhs.str() >= __rhs; }
+
+ /**
+ * @brief Tests the ordering of a regular expression submatch and a string.
+ * @param lhs A regular expression submatch.
+ * @param rhs A string.
+ * @returns true if @a lhs does not succeed @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter, class _Ch_traits, class _Ch_alloc>
+ inline bool
+ operator<=(const sub_match<_Bi_iter>& __lhs,
+ const basic_string<
+ typename iterator_traits<_Bi_iter>::value_type,
+ _Ch_traits, _Ch_alloc>& __rhs)
+ { return __lhs.str() <= __rhs; }
+
+ /**
+ * @brief Tests the equivalence of a C string and a regular expression
+ * submatch.
+ * @param lhs A C string.
+ * @param rhs A regular expression submatch.
+ * @returns true if @a lhs is equivalent to @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator==(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
+ const sub_match<_Bi_iter>& __rhs)
+ { return __lhs == __rhs.str(); }
+
+ /**
+ * @brief Tests the inequivalence of an iterator value and a regular
+ * expression submatch.
+ * @param lhs A regular expression submatch.
+ * @param rhs A string.
+ * @returns true if @a lhs is not equivalent to @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator!=(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
+ const sub_match<_Bi_iter>& __rhs)
+ { return __lhs != __rhs.str(); }
+
+ /**
+ * @brief Tests the ordering of a string and a regular expression submatch.
+ * @param lhs A string.
+ * @param rhs A regular expression submatch.
+ * @returns true if @a lhs precedes @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
+ const sub_match<_Bi_iter>& __rhs)
+ { return __lhs < __rhs.str(); }
+
+ /**
+ * @brief Tests the ordering of a string and a regular expression submatch.
+ * @param lhs A string.
+ * @param rhs A regular expression submatch.
+ * @returns true if @a lhs succeeds @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator>(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
+ const sub_match<_Bi_iter>& __rhs)
+ { return __lhs > __rhs.str(); }
+
+ /**
+ * @brief Tests the ordering of a string and a regular expression submatch.
+ * @param lhs A string.
+ * @param rhs A regular expression submatch.
+ * @returns true if @a lhs does not precede @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator>=(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
+ const sub_match<_Bi_iter>& __rhs)
+ { return __lhs >= __rhs.str(); }
+
+ /**
+ * @brief Tests the ordering of a string and a regular expression submatch.
+ * @param lhs A string.
+ * @param rhs A regular expression submatch.
+ * @returns true if @a lhs does not succeed @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator<=(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
+ const sub_match<_Bi_iter>& __rhs)
+ { return __lhs <= __rhs.str(); }
+
+ /**
+ * @brief Tests the equivalence of a regular expression submatch and a
+ * string.
+ * @param lhs A regular expression submatch.
+ * @param rhs A pointer to a string?
+ * @returns true if @a lhs is equivalent to @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator==(const sub_match<_Bi_iter>& __lhs,
+ typename iterator_traits<_Bi_iter>::value_type const* __rhs)
+ { return __lhs.str() == __rhs; }
+
+ /**
+ * @brief Tests the inequivalence of a regular expression submatch and a
+ * string.
+ * @param lhs A regular expression submatch.
+ * @param rhs A pointer to a string.
+ * @returns true if @a lhs is not equivalent to @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator!=(const sub_match<_Bi_iter>& __lhs,
+ typename iterator_traits<_Bi_iter>::value_type const* __rhs)
+ { return __lhs.str() != __rhs; }
+
+ /**
+ * @brief Tests the ordering of a regular expression submatch and a string.
+ * @param lhs A regular expression submatch.
+ * @param rhs A string.
+ * @returns true if @a lhs precedes @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator<(const sub_match<_Bi_iter>& __lhs,
+ typename iterator_traits<_Bi_iter>::value_type const* __rhs)
+ { return __lhs.str() < __rhs; }
+
+ /**
+ * @brief Tests the ordering of a regular expression submatch and a string.
+ * @param lhs A regular expression submatch.
+ * @param rhs A string.
+ * @returns true if @a lhs succeeds @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator>(const sub_match<_Bi_iter>& __lhs,
+ typename iterator_traits<_Bi_iter>::value_type const* __rhs)
+ { return __lhs.str() > __rhs; }
+
+ /**
+ * @brief Tests the ordering of a regular expression submatch and a string.
+ * @param lhs A regular expression submatch.
+ * @param rhs A string.
+ * @returns true if @a lhs does not precede @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator>=(const sub_match<_Bi_iter>& __lhs,
+ typename iterator_traits<_Bi_iter>::value_type const* __rhs)
+ { return __lhs.str() >= __rhs; }
+
+ /**
+ * @brief Tests the ordering of a regular expression submatch and a string.
+ * @param lhs A regular expression submatch.
+ * @param rhs A string.
+ * @returns true if @a lhs does not succeed @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator<=(const sub_match<_Bi_iter>& __lhs,
+ typename iterator_traits<_Bi_iter>::value_type const* __rhs)
+ { return __lhs.str() <= __rhs; }
+
+ /**
+ * @brief Tests the equivalence of a string and a regular expression
+ * submatch.
+ * @param lhs A string.
+ * @param rhs A regular expression submatch.
+ * @returns true if @a lhs is equivalent to @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator==(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
+ const sub_match<_Bi_iter>& __rhs)
+ { return __lhs == __rhs.str(); }
+
+ /**
+ * @brief Tests the inequivalence of a string and a regular expression
+ * submatch.
+ * @param lhs A string.
+ * @param rhs A regular expression submatch.
+ * @returns true if @a lhs is not equivalent to @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator!=(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
+ const sub_match<_Bi_iter>& __rhs)
+ { return __lhs != __rhs.str(); }
+
+ /**
+ * @brief Tests the ordering of a string and a regular expression submatch.
+ * @param lhs A string.
+ * @param rhs A regular expression submatch.
+ * @returns true if @a lhs precedes @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
+ const sub_match<_Bi_iter>& __rhs)
+ { return __lhs < __rhs.str(); }
+
+ /**
+ * @brief Tests the ordering of a string and a regular expression submatch.
+ * @param lhs A string.
+ * @param rhs A regular expression submatch.
+ * @returns true if @a lhs succeeds @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator>(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
+ const sub_match<_Bi_iter>& __rhs)
+ { return __lhs > __rhs.str(); }
+
+ /**
+ * @brief Tests the ordering of a string and a regular expression submatch.
+ * @param lhs A string.
+ * @param rhs A regular expression submatch.
+ * @returns true if @a lhs does not precede @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator>=(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
+ const sub_match<_Bi_iter>& __rhs)
+ { return __lhs >= __rhs.str(); }
+
+ /**
+ * @brief Tests the ordering of a string and a regular expression submatch.
+ * @param lhs A string.
+ * @param rhs A regular expression submatch.
+ * @returns true if @a lhs does not succeed @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator<=(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
+ const sub_match<_Bi_iter>& __rhs)
+ { return __lhs <= __rhs.str(); }
+
+ /**
+ * @brief Tests the equivalence of a regular expression submatch and a
+ * string.
+ * @param lhs A regular expression submatch.
+ * @param rhs A const string reference.
+ * @returns true if @a lhs is equivalent to @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator==(const sub_match<_Bi_iter>& __lhs,
+ typename iterator_traits<_Bi_iter>::value_type const& __rhs)
+ { return __lhs.str() == __rhs; }
+
+ /**
+ * @brief Tests the inequivalence of a regular expression submatch and a
+ * string.
+ * @param lhs A regular expression submatch.
+ * @param rhs A const string reference.
+ * @returns true if @a lhs is not equivalent to @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator!=(const sub_match<_Bi_iter>& __lhs,
+ typename iterator_traits<_Bi_iter>::value_type const& __rhs)
+ { return __lhs.str() != __rhs; }
+
+ /**
+ * @brief Tests the ordering of a regular expression submatch and a string.
+ * @param lhs A regular expression submatch.
+ * @param rhs A const string reference.
+ * @returns true if @a lhs precedes @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator<(const sub_match<_Bi_iter>& __lhs,
+ typename iterator_traits<_Bi_iter>::value_type const& __rhs)
+ { return __lhs.str() < __rhs; }
+
+ /**
+ * @brief Tests the ordering of a regular expression submatch and a string.
+ * @param lhs A regular expression submatch.
+ * @param rhs A const string reference.
+ * @returns true if @a lhs succeeds @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator>(const sub_match<_Bi_iter>& __lhs,
+ typename iterator_traits<_Bi_iter>::value_type const& __rhs)
+ { return __lhs.str() > __rhs; }
+
+ /**
+ * @brief Tests the ordering of a regular expression submatch and a string.
+ * @param lhs A regular expression submatch.
+ * @param rhs A const string reference.
+ * @returns true if @a lhs does not precede @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator>=(const sub_match<_Bi_iter>& __lhs,
+ typename iterator_traits<_Bi_iter>::value_type const& __rhs)
+ { return __lhs.str() >= __rhs; }
+
+ /**
+ * @brief Tests the ordering of a regular expression submatch and a string.
+ * @param lhs A regular expression submatch.
+ * @param rhs A const string reference.
+ * @returns true if @a lhs does not succeed @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator<=(const sub_match<_Bi_iter>& __lhs,
+ typename iterator_traits<_Bi_iter>::value_type const& __rhs)
+ { return __lhs.str() <= __rhs; }
+
+ /**
+ * @brief Inserts a matched string into an output stream.
+ *
+ * @param os The output stream.
+ * @param m A submatch string.
+ *
+ * @returns the output stream with the submatch string inserted.
+ */
+ template<typename _Ch_type, typename _Ch_traits, typename _Bi_iter>
+ inline
+ basic_ostream<_Ch_type, _Ch_traits>&
+ operator<<(basic_ostream<_Ch_type, _Ch_traits>& __os,
+ const sub_match<_Bi_iter>& __m)
+ { return __os << __m.str(); }
+
+ // [7.10] Class template match_results
+ /**
+ * @brief The results of a match or search operation.
+ *
+ * A collection of character sequences representing the result of a regular
+ * expression match. Storage for the collection is allocated and freed as
+ * necessary by the member functions of class template match_results.
+ *
+ * This class satisfies the Sequence requirements, with the exception that
+ * only the operations defined for a const-qualified Sequence are supported.
+ *
+ * The sub_match object stored at index 0 represents sub-expression 0, i.e.
+ * the whole match. In this case the sub_match member matched is always true.
+ * The sub_match object stored at index n denotes what matched the marked
+ * sub-expression n within the matched expression. If the sub-expression n
+ * participated in a regular expression match then the sub_match member
+ * matched evaluates to true, and members first and second denote the range
+ * of characters [first, second) which formed that match. Otherwise matched
+ * is false, and members first and second point to the end of the sequence
+ * that was searched.
+ *
+ * @nosubgrouping
+ */
+ template<typename _Bi_iter,
+ typename _Allocator = allocator<sub_match<_Bi_iter> > >
+ class match_results
+ : private std::vector<std::_GLIBCXX_TR1 sub_match<_Bi_iter>, _Allocator>
+ {
+ private:
+ typedef std::vector<std::_GLIBCXX_TR1 sub_match<_Bi_iter>, _Allocator>
+ _Base_type;
+
+ public:
+ /**
+ * @name 10.? Public Types
+ */
+ //@{
+ typedef sub_match<_Bi_iter> value_type;
+ typedef typename _Allocator::const_reference const_reference;
+ typedef const_reference reference;
+ typedef typename _Base_type::const_iterator const_iterator;
+ typedef const_iterator iterator;
+ typedef typename iterator_traits<_Bi_iter>::difference_type
+ difference_type;
+ typedef typename _Allocator::size_type size_type;
+ typedef _Allocator allocator_type;
+ typedef typename iterator_traits<_Bi_iter>::value_type char_type;
+ typedef basic_string<char_type> string_type;
+ //@}
+
+ public:
+ /**
+ * @name 10.1 Construction, Copying, and Destruction
+ */
+ //@{
+
+ /**
+ * @brief Constructs a default %match_results container.
+ * @post size() returns 0 and str() returns an empty string.
+ */
+ explicit
+ match_results(const _Allocator& __a = _Allocator())
+ : _Base_type(__a), _M_matched(false)
+ { }
+
+ /**
+ * @brief Copy constructs a %match_results.
+ */
+ match_results(const match_results& __rhs)
+ : _Base_type(__rhs), _M_matched(__rhs._M_matched),
+ _M_prefix(__rhs._M_prefix), _M_suffix(__rhs._M_suffix)
+ { }
+
+ /**
+ * @brief Assigns rhs to *this.
+ */
+ match_results&
+ operator=(const match_results& __rhs)
+ {
+ match_results __tmp(__rhs);
+ this->swap(__tmp);
+ return *this;
+ }
+
+ /**
+ * @brief Destroys a %match_results object.
+ */
+ ~match_results()
+ { }
+
+ //@}
+
+ /**
+ * @name 10.2 Size
+ */
+ //@{
+
+ /**
+ * @brief Gets the number of matches and submatches.
+ *
+ * The number of matches for a given regular expression will be either 0
+ * if there was no match or mark_count() + 1 if a match was successful.
+ * Some matches may be empty.
+ *
+ * @returns the number of matches found.
+ */
+ size_type
+ size() const
+ { return _M_matched ? _Base_type::size() + 1 : 0; }
+
+ //size_type
+ //max_size() const;
+ using _Base_type::max_size;
+
+ /**
+ * @brief Indicates if the %match_results contains no results.
+ * @retval true The %match_results object is empty.
+ * @retval false The %match_results object is not empty.
+ */
+ bool
+ empty() const
+ { return size() == 0; }
+
+ //@}
+
+ /**
+ * @name 10.3 Element Access
+ */
+ //@{
+
+ /**
+ * @brief Gets the length of the indicated submatch.
+ * @param sub indicates the submatch.
+ *
+ * This function returns the length of the indicated submatch, or the
+ * length of the entire match if @p sub is zero (the default).
+ */
+ difference_type
+ length(size_type __sub = 0) const
+ { return _M_matched ? this->str(__sub).length() : 0; }
+
+ /**
+ * @brief Gets the offset of the beginning of the indicated submatch.
+ * @param sub indicates the submatch.
+ *
+ * This function returns the offset from the beginning of the target
+ * sequence to the beginning of the submatch, unless the value of @p sub
+ * is zero (the default), in which case this function returns the offset
+ * from the beginning of the target sequence to the beginning of the
+ * match.
+ */
+ difference_type
+ position(size_type __sub = 0) const
+ {
+ return _M_matched ? std::distance(this->prefix().first,
+ (*this)[__sub].first) : 0;
+ }
+
+ /**
+ * @brief Gets the match or submatch converted to a string type.
+ * @param sub indicates the submatch.
+ *
+ * This function gets the submatch (or match, if @p sub is zero) extracted
+ * from the target range and converted to the associated string type.
+ */
+ string_type
+ str(size_type __sub = 0) const
+ { return _M_matched ? (*this)[__sub].str() : string_type(); }
+
+ /**
+ * @brief Gets a %sub_match reference for the match or submatch.
+ * @param sub indicates the submatch.
+ *
+ * This function gets a reference to the indicated submatch, or the entire
+ * match if @p sub is zero.
+ *
+ * If @p sub >= size() then this function returns a %sub_match with a
+ * special value indicating no submatch.
+ */
+ const_reference
+ operator[](size_type __sub) const
+ { return _Base_type::operator[](__sub); }
+
+ /**
+ * @brief Gets a %sub_match representing the match prefix.
+ *
+ * This function gets a reference to a %sub_match object representing the
+ * part of the target range between the start of the target range and the
+ * start of the match.
+ */
+ const_reference
+ prefix() const
+ { return _M_prefix; }
+
+ /**
+ * @brief Gets a %sub_match representing the match suffix.
+ *
+ * This function gets a reference to a %sub_match object representing the
+ * part of the target range between the end of the match and the end of
+ * the target range.
+ */
+ const_reference
+ suffix() const
+ { return _M_suffix; }
+
+ /**
+ * @brief Gets an iterator to the start of the %sub_match collection.
+ */
+ const_iterator
+ begin() const
+ { return _Base_type::begin(); }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ /**
+ * @brief Gets an iterator to the start of the %sub_match collection.
+ */
+ const_iterator
+ cbegin() const
+ { return _Base_type::begin(); }
+#endif
+
+ /**
+ * @brief Gets an iterator to one-past-the-end of the collection.
+ */
+ const_iterator
+ end() const
+ { return _Base_type::end(); }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ /**
+ * @brief Gets an iterator to one-past-the-end of the collection.
+ */
+ const_iterator
+ cend() const
+ { return _Base_type::end(); }
+#endif
+
+ //@}
+
+ /**
+ * @name 10.4 Formatting
+ *
+ * These functions perform formatted substitution of the matched character
+ * sequences into their target. The format specifiers and escape sequences
+ * accepted by these functions are determined by their @p flags parameter
+ * as documented above.
+ */
+ //@{
+
+ /**
+ * @todo Implement this function.
+ */
+ template<typename _Out_iter>
+ _Out_iter
+ format(_Out_iter __out, const string_type& __fmt,
+ regex_constants::match_flag_type __flags
+ = regex_constants::format_default) const;
+
+ /**
+ * @todo Implement this function.
+ */
+ string_type
+ format(const string_type& __fmt,
+ regex_constants::match_flag_type __flags
+ = regex_constants::format_default) const;
+
+ //@}
+
+ /**
+ * @name 10.5 Allocator
+ */
+ //@{
+
+ /**
+ * @brief Gets a copy of the allocator.
+ */
+ //allocator_type
+ //get_allocator() const;
+ using _Base_type::get_allocator;
+
+ //@}
+
+ /**
+ * @name 10.6 Swap
+ */
+ //@{
+
+ /**
+ * @brief Swaps the contents of two match_results.
+ */
+ void
+ swap(match_results& __that)
+ {
+ _Base_type::swap(__that);
+ std::swap(_M_matched, __that._M_matched);
+ std::swap(_M_prefix, __that._M_prefix);
+ std::swap(_M_suffix, __that._M_suffix);
+ }
+ //@}
+
+ private:
+ bool _M_matched;
+ value_type _M_prefix;
+ value_type _M_suffix;
+ };
+
+ typedef match_results<const char*> cmatch;
+ typedef match_results<string::const_iterator> smatch;
+#ifdef _GLIBCXX_USE_WCHAR_T
+ typedef match_results<const wchar_t*> wcmatch;
+ typedef match_results<wstring::const_iterator> wsmatch;
+#endif
+
+ // match_results comparisons
+ /**
+ * @brief Compares two match_results for equality.
+ * @returns true if the two objects refer to the same match,
+ * false otherwise.
+ * @todo Implement this function.
+ */
+ template<typename _Bi_iter, typename _Allocator>
+ inline bool
+ operator==(const match_results<_Bi_iter, _Allocator>& __m1,
+ const match_results<_Bi_iter, _Allocator>& __m2);
+
+ /**
+ * @brief Compares two match_results for inequality.
+ * @returns true if the two objects do not refer to the same match,
+ * false otherwise.
+ */
+ template<typename _Bi_iter, class _Allocator>
+ inline bool
+ operator!=(const match_results<_Bi_iter, _Allocator>& __m1,
+ const match_results<_Bi_iter, _Allocator>& __m2)
+ { return !(__m1 == __m2); }
+
+ // [7.10.6] match_results swap
+ /**
+ * @brief Swaps two match results.
+ * @param lhs A match result.
+ * @param rhs A match result.
+ *
+ * The contents of the two match_results objects are swapped.
+ */
+ template<typename _Bi_iter, typename _Allocator>
+ inline void
+ swap(match_results<_Bi_iter, _Allocator>& __lhs,
+ match_results<_Bi_iter, _Allocator>& __rhs)
+ { __lhs.swap(__rhs); }
+
+ // [7.11.2] Function template regex_match
+ /**
+ * @name Matching, Searching, and Replacing
+ */
+ //@{
+
+ /**
+ * @brief Determines if there is a match between the regular expression @p e
+ * and all of the character sequence [first, last).
+ *
+ * @param first Beginning of the character sequence to match.
+ * @param last One-past-the-end of the character sequence to match.
+ * @param m The match results.
+ * @param re The regular expression.
+ * @param flags Controls how the regular expression is matched.
+ *
+ * @retval true A match exists.
+ * @retval false Otherwise.
+ *
+ * @throws an exception of type regex_error.
+ *
+ * @todo Implement this function.
+ */
+ template<typename _Bi_iter, typename _Allocator,
+ typename _Ch_type, typename _Rx_traits>
+ bool
+ regex_match(_Bi_iter __first, _Bi_iter __last,
+ match_results<_Bi_iter, _Allocator>& __m,
+ const basic_regex<_Ch_type, _Rx_traits>& __re,
+ regex_constants::match_flag_type __flags
+ = regex_constants::match_default);
+
+ /**
+ * @brief Indicates if there is a match between the regular expression @p e
+ * and all of the character sequence [first, last).
+ *
+ * @param first Beginning of the character sequence to match.
+ * @param last One-past-the-end of the character sequence to match.
+ * @param re The regular expression.
+ * @param flags Controls how the regular expression is matched.
+ *
+ * @retval true A match exists.
+ * @retval false Otherwise.
+ *
+ * @throws an exception of type regex_error.
+ */
+ template<typename _Bi_iter, typename _Ch_type, typename _Rx_traits>
+ bool
+ regex_match(_Bi_iter __first, _Bi_iter __last,
+ const basic_regex<_Ch_type, _Rx_traits>& __re,
+ regex_constants::match_flag_type __flags
+ = regex_constants::match_default)
+ {
+ match_results<_Bi_iter> __what;
+ return regex_match(__first, __last, __what, __re, __flags);
+ }
+
+ /**
+ * @brief Determines if there is a match between the regular expression @p e
+ * and a C-style null-terminated string.
+ *
+ * @param s The C-style null-terminated string to match.
+ * @param m The match results.
+ * @param re The regular expression.
+ * @param f Controls how the regular expression is matched.
+ *
+ * @retval true A match exists.
+ * @retval false Otherwise.
+ *
+ * @throws an exception of type regex_error.
+ */
+ template<typename _Ch_type, typename _Allocator, typename _Rx_traits>
+ inline bool
+ regex_match(const _Ch_type* __s,
+ match_results<const _Ch_type*, _Allocator>& __m,
+ const basic_regex<_Ch_type, _Rx_traits>& __re,
+ regex_constants::match_flag_type __f
+ = regex_constants::match_default)
+ { return regex_match(__s, __s + _Rx_traits::length(__s), __m, __re, __f); }
+
+ /**
+ * @brief Determines if there is a match between the regular expression @p e
+ * and a string.
+ *
+ * @param s The string to match.
+ * @param m The match results.
+ * @param re The regular expression.
+ * @param flags Controls how the regular expression is matched.
+ *
+ * @retval true A match exists.
+ * @retval false Otherwise.
+ *
+ * @throws an exception of type regex_error.
+ */
+ template<typename _Ch_traits, typename _Ch_alloc,
+ typename _Allocator, typename _Ch_type, typename _Rx_traits>
+ inline bool
+ regex_match(const basic_string<_Ch_type, _Ch_traits, _Ch_alloc>& __s,
+ match_results<typename basic_string<_Ch_type,
+ _Ch_traits, _Ch_alloc>::const_iterator, _Allocator>& __m,
+ const basic_regex<_Ch_type, _Rx_traits>& __re,
+ regex_constants::match_flag_type __flags
+ = regex_constants::match_default)
+ { return regex_match(__s.begin(), __s.end(), __m, __re, __flags); }
+
+ /**
+ * @brief Indicates if there is a match between the regular expression @p e
+ * and a C-style null-terminated string.
+ *
+ * @param s The C-style null-terminated string to match.
+ * @param re The regular expression.
+ * @param f Controls how the regular expression is matched.
+ *
+ * @retval true A match exists.
+ * @retval false Otherwise.
+ *
+ * @throws an exception of type regex_error.
+ */
+ template<typename _Ch_type, class _Rx_traits>
+ inline bool
+ regex_match(const _Ch_type* __s,
+ const basic_regex<_Ch_type, _Rx_traits>& __re,
+ regex_constants::match_flag_type __f
+ = regex_constants::match_default)
+ { return regex_match(__s, __s + _Rx_traits::length(__s), __re, __f); }
+
+ /**
+ * @brief Indicates if there is a match between the regular expression @p e
+ * and a string.
+ *
+ * @param s [IN] The string to match.
+ * @param re [IN] The regular expression.
+ * @param flags [IN] Controls how the regular expression is matched.
+ *
+ * @retval true A match exists.
+ * @retval false Otherwise.
+ *
+ * @throws an exception of type regex_error.
+ */
+ template<typename _Ch_traits, typename _Str_allocator,
+ typename _Ch_type, typename _Rx_traits>
+ inline bool
+ regex_match(const basic_string<_Ch_type, _Ch_traits, _Str_allocator>& __s,
+ const basic_regex<_Ch_type, _Rx_traits>& __re,
+ regex_constants::match_flag_type __flags
+ = regex_constants::match_default)
+ { return regex_match(__s.begin(), __s.end(), __re, __flags); }
+
+ // [7.11.3] Function template regex_search
+ /**
+ * Searches for a regular expression within a range.
+ * @param first [IN] The start of the string to search.
+ * @param last [IN] One-past-the-end of the string to search.
+ * @param m [OUT] The match results.
+ * @param re [IN] The regular expression to search for.
+ * @param flags [IN] Search policy flags.
+ * @retval true A match was found within the string.
+ * @retval false No match was found within the string, the content of %m is
+ * undefined.
+ *
+ * @throws an exception of type regex_error.
+ *
+ * @todo Implement this function.
+ */
+ template<typename _Bi_iter, typename _Allocator,
+ typename _Ch_type, typename _Rx_traits>
+ inline bool
+ regex_search(_Bi_iter __first, _Bi_iter __last,
+ match_results<_Bi_iter, _Allocator>& __m,
+ const basic_regex<_Ch_type, _Rx_traits>& __re,
+ regex_constants::match_flag_type __flags
+ = regex_constants::match_default);
+
+ /**
+ * Searches for a regular expression within a range.
+ * @param first [IN] The start of the string to search.
+ * @param last [IN] One-past-the-end of the string to search.
+ * @param re [IN] The regular expression to search for.
+ * @param flags [IN] Search policy flags.
+ * @retval true A match was found within the string.
+ * @retval false No match was found within the string.
+ * @doctodo
+ *
+ * @throws an exception of type regex_error.
+ */
+ template<typename _Bi_iter, typename _Ch_type, typename _Rx_traits>
+ inline bool
+ regex_search(_Bi_iter __first, _Bi_iter __last,
+ const basic_regex<_Ch_type, _Rx_traits>& __re,
+ regex_constants::match_flag_type __flags
+ = regex_constants::match_default)
+ {
+ match_results<_Bi_iter> __what;
+ return regex_search(__first, __last, __what, __re, __flags);
+ }
+
+ /**
+ * @brief Searches for a regular expression within a C-string.
+ * @param s [IN] A C-string to search for the regex.
+ * @param m [OUT] The set of regex matches.
+ * @param e [IN] The regex to search for in @p s.
+ * @param f [IN] The search flags.
+ * @retval true A match was found within the string.
+ * @retval false No match was found within the string, the content of %m is
+ * undefined.
+ * @doctodo
+ *
+ * @throws an exception of type regex_error.
+ */
+ template<typename _Ch_type, class _Allocator, class _Rx_traits>
+ inline bool
+ regex_search(const _Ch_type* __s,
+ match_results<const _Ch_type*, _Allocator>& __m,
+ const basic_regex<_Ch_type, _Rx_traits>& __e,
+ regex_constants::match_flag_type __f
+ = regex_constants::match_default)
+ { return regex_search(__s, __s + _Rx_traits::length(__s), __m, __e, __f); }
+
+ /**
+ * @brief Searches for a regular expression within a C-string.
+ * @param s [IN] The C-string to search.
+ * @param e [IN] The regular expression to search for.
+ * @param f [IN] Search policy flags.
+ * @retval true A match was found within the string.
+ * @retval false No match was found within the string.
+ * @doctodo
+ *
+ * @throws an exception of type regex_error.
+ */
+ template<typename _Ch_type, typename _Rx_traits>
+ inline bool
+ regex_search(const _Ch_type* __s,
+ const basic_regex<_Ch_type, _Rx_traits>& __e,
+ regex_constants::match_flag_type __f
+ = regex_constants::match_default)
+ { return regex_search(__s, __s + _Rx_traits::length(__s), __e, __f); }
+
+ /**
+ * @brief Searches for a regular expression within a string.
+ * @param s [IN] The string to search.
+ * @param e [IN] The regular expression to search for.
+ * @param flags [IN] Search policy flags.
+ * @retval true A match was found within the string.
+ * @retval false No match was found within the string.
+ * @doctodo
+ *
+ * @throws an exception of type regex_error.
+ */
+ template<typename _Ch_traits, typename _String_allocator,
+ typename _Ch_type, typename _Rx_traits>
+ inline bool
+ regex_search(const basic_string<_Ch_type, _Ch_traits,
+ _String_allocator>& __s,
+ const basic_regex<_Ch_type, _Rx_traits>& __e,
+ regex_constants::match_flag_type __flags
+ = regex_constants::match_default)
+ { return regex_search(__s.begin(), __s.end(), __e, __flags); }
+
+ /**
+ * @brief Searches for a regular expression within a string.
+ * @param s [IN] A C++ string to search for the regex.
+ * @param m [OUT] The set of regex matches.
+ * @param e [IN] The regex to search for in @p s.
+ * @param f [IN] The search flags.
+ * @retval true A match was found within the string.
+ * @retval false No match was found within the string, the content of %m is
+ * undefined.
+ *
+ * @throws an exception of type regex_error.
+ */
+ template<typename _Ch_traits, typename _Ch_alloc,
+ typename _Allocator, typename _Ch_type,
+ typename _Rx_traits>
+ inline bool
+ regex_search(const basic_string<_Ch_type, _Ch_traits, _Ch_alloc>& __s,
+ match_results<typename basic_string<_Ch_type,
+ _Ch_traits, _Ch_alloc>::const_iterator, _Allocator>& __m,
+ const basic_regex<_Ch_type, _Rx_traits>& __e,
+ regex_constants::match_flag_type __f
+ = regex_constants::match_default)
+ { return regex_search(__s.begin(), __s.end(), __m, __e, __f); }
+
+ // tr1 [7.11.4] std [28.11.4] Function template regex_replace
+ /**
+ * @doctodo
+ * @param out
+ * @param first
+ * @param last
+ * @param e
+ * @param fmt
+ * @param flags
+ *
+ * @returns out
+ * @throws an exception of type regex_error.
+ *
+ * @todo Implement this function.
+ */
+ template<typename _Out_iter, typename _Bi_iter,
+ typename _Rx_traits, typename _Ch_type>
+ inline _Out_iter
+ regex_replace(_Out_iter __out, _Bi_iter __first, _Bi_iter __last,
+ const basic_regex<_Ch_type, _Rx_traits>& __e,
+ const basic_string<_Ch_type>& __fmt,
+ regex_constants::match_flag_type __flags
+ = regex_constants::match_default);
+
+ /**
+ * @doctodo
+ * @param s
+ * @param e
+ * @param fmt
+ * @param flags
+ *
+ * @returns a copy of string @p s with replacements.
+ *
+ * @throws an exception of type regex_error.
+ */
+ template<typename _Rx_traits, typename _Ch_type>
+ inline basic_string<_Ch_type>
+ regex_replace(const basic_string<_Ch_type>& __s,
+ const basic_regex<_Ch_type, _Rx_traits>& __e,
+ const basic_string<_Ch_type>& __fmt,
+ regex_constants::match_flag_type __flags
+ = regex_constants::match_default)
+ {
+ std::string __result;
+ regex_replace(std::back_inserter(__result),
+ __s.begin(), __s.end(), __e, __fmt, __flags);
+ return __result;
+ }
+
+ //@}
+
+ // tr1 [7.12.1] std [28.12] Class template regex_iterator
+ /**
+ * An iterator adaptor that will provide repeated calls of regex_search over
+ * a range until no more matches remain.
+ */
+ template<typename _Bi_iter,
+ typename _Ch_type = typename iterator_traits<_Bi_iter>::value_type,
+ typename _Rx_traits = regex_traits<_Ch_type> >
+ class regex_iterator
+ {
+ public:
+ typedef basic_regex<_Ch_type, _Rx_traits> regex_type;
+ typedef match_results<_Bi_iter> value_type;
+ typedef std::ptrdiff_t difference_type;
+ typedef const value_type* pointer;
+ typedef const value_type& reference;
+ typedef std::forward_iterator_tag iterator_category;
+
+ public:
+ /**
+ * @brief Provides a singular iterator, useful for indicating
+ * one-past-the-end of a range.
+ * @todo Implement this function.
+ * @doctodo
+ */
+ regex_iterator();
+
+ /**
+ * Constructs a %regex_iterator...
+ * @param a [IN] The start of a text range to search.
+ * @param b [IN] One-past-the-end of the text range to search.
+ * @param re [IN] The regular expression to match.
+ * @param m [IN] Policy flags for match rules.
+ * @todo Implement this function.
+ * @doctodo
+ */
+ regex_iterator(_Bi_iter __a, _Bi_iter __b, const regex_type& __re,
+ regex_constants::match_flag_type __m
+ = regex_constants::match_default);
+
+ /**
+ * Copy constructs a %regex_iterator.
+ * @todo Implement this function.
+ * @doctodo
+ */
+ regex_iterator(const regex_iterator& __rhs);
+
+ /**
+ * @todo Implement this function.
+ * @doctodo
+ */
+ regex_iterator&
+ operator=(const regex_iterator& __rhs);
+
+ /**
+ * @todo Implement this function.
+ * @doctodo
+ */
+ bool
+ operator==(const regex_iterator& __rhs);
+
+ /**
+ * @todo Implement this function.
+ * @doctodo
+ */
+ bool
+ operator!=(const regex_iterator& __rhs);
+
+ /**
+ * @todo Implement this function.
+ * @doctodo
+ */
+ const value_type&
+ operator*();
+
+ /**
+ * @todo Implement this function.
+ * @doctodo
+ */
+ const value_type*
+ operator->();
+
+ /**
+ * @todo Implement this function.
+ * @doctodo
+ */
+ regex_iterator&
+ operator++();
+
+ /**
+ * @todo Implement this function.
+ * @doctodo
+ */
+ regex_iterator
+ operator++(int);
+
+ private:
+ // these members are shown for exposition only:
+ _Bi_iter begin;
+ _Bi_iter end;
+ const regex_type* pregex;
+ regex_constants::match_flag_type flags;
+ match_results<_Bi_iter> match;
+ };
+
+ typedef regex_iterator<const char*> cregex_iterator;
+ typedef regex_iterator<string::const_iterator> sregex_iterator;
+#ifdef _GLIBCXX_USE_WCHAR_T
+ typedef regex_iterator<const wchar_t*> wcregex_iterator;
+ typedef regex_iterator<wstring::const_iterator> wsregex_iterator;
+#endif
+
+ // [7.12.2] Class template regex_token_iterator
+ /**
+ * Iterates over submatches in a range (or "splits" a text string).
+ *
+ * The purpose of this iterator is to enumerate all, or all specified,
+ * matches of a regular expression within a text range. The dereferenced
+ * value of an iterator of this class is a std::tr1::sub_match object.
+ */
+ template<typename _Bi_iter,
+ typename _Ch_type = typename iterator_traits<_Bi_iter>::value_type,
+ typename _Rx_traits = regex_traits<_Ch_type> >
+ class regex_token_iterator
+ {
+ public:
+ typedef basic_regex<_Ch_type, _Rx_traits> regex_type;
+ typedef sub_match<_Bi_iter> value_type;
+ typedef std::ptrdiff_t difference_type;
+ typedef const value_type* pointer;
+ typedef const value_type& reference;
+ typedef std::forward_iterator_tag iterator_category;
+
+ public:
+ /**
+ * @brief Default constructs a %regex_token_iterator.
+ * @todo Implement this function.
+ *
+ * A default-constructed %regex_token_iterator is a singular iterator
+ * that will compare equal to the one-past-the-end value for any
+ * iterator of the same type.
+ */
+ regex_token_iterator();
+
+ /**
+ * Constructs a %regex_token_iterator...
+ * @param a [IN] The start of the text to search.
+ * @param b [IN] One-past-the-end of the text to search.
+ * @param re [IN] The regular expression to search for.
+ * @param submatch [IN] Which submatch to return. There are some
+ * special values for this parameter:
+ * - -1 each enumerated subexpression does NOT
+ * match the regular expression (aka field
+ * splitting)
+ * - 0 the entire string matching the
+ * subexpression is returned for each match
+ * within the text.
+ * - >0 enumerates only the indicated
+ * subexpression from a match within the text.
+ * @param m [IN] Policy flags for match rules.
+ *
+ * @todo Implement this function.
+ * @doctodo
+ */
+ regex_token_iterator(_Bi_iter __a, _Bi_iter __b, const regex_type& __re,
+ int __submatch = 0,
+ regex_constants::match_flag_type __m
+ = regex_constants::match_default);
+
+ /**
+ * Constructs a %regex_token_iterator...
+ * @param a [IN] The start of the text to search.
+ * @param b [IN] One-past-the-end of the text to search.
+ * @param re [IN] The regular expression to search for.
+ * @param submatches [IN] A list of subexpressions to return for each
+ * regular expression match within the text.
+ * @param m [IN] Policy flags for match rules.
+ *
+ * @todo Implement this function.
+ * @doctodo
+ */
+ regex_token_iterator(_Bi_iter __a, _Bi_iter __b,
+ const regex_type& __re,
+ const std::vector<int>& __submatches,
+ regex_constants::match_flag_type __m
+ = regex_constants::match_default);
+
+ /**
+ * Constructs a %regex_token_iterator...
+ * @param a [IN] The start of the text to search.
+ * @param b [IN] One-past-the-end of the text to search.
+ * @param re [IN] The regular expression to search for.
+ * @param submatches [IN] A list of subexpressions to return for each
+ * regular expression match within the text.
+ * @param m [IN] Policy flags for match rules.
+
+ * @todo Implement this function.
+ * @doctodo
+ */
+ template<std::size_t _Nm>
+ regex_token_iterator(_Bi_iter __a, _Bi_iter __b,
+ const regex_type& __re,
+ const int (&__submatches)[_Nm],
+ regex_constants::match_flag_type __m
+ = regex_constants::match_default);
+
+ /**
+ * @brief Copy constructs a %regex_token_iterator.
+ * @param rhs [IN] A %regex_token_iterator to copy.
+ * @todo Implement this function.
+ */
+ regex_token_iterator(const regex_token_iterator& __rhs);
+
+ /**
+ * @brief Assigns a %regex_token_iterator to another.
+ * @param rhs [IN] A %regex_token_iterator to copy.
+ * @todo Implement this function.
+ */
+ regex_token_iterator&
+ operator=(const regex_token_iterator& __rhs);
+
+ /**
+ * @brief Compares a %regex_token_iterator to another for equality.
+ * @todo Implement this function.
+ */
+ bool
+ operator==(const regex_token_iterator& __rhs);
+
+ /**
+ * @brief Compares a %regex_token_iterator to another for inequality.
+ * @todo Implement this function.
+ */
+ bool
+ operator!=(const regex_token_iterator& __rhs);
+
+ /**
+ * @brief Dereferences a %regex_token_iterator.
+ * @todo Implement this function.
+ */
+ const value_type&
+ operator*();
+
+ /**
+ * @brief Selects a %regex_token_iterator member.
+ * @todo Implement this function.
+ */
+ const value_type*
+ operator->();
+
+ /**
+ * @brief Increments a %regex_token_iterator.
+ * @todo Implement this function.
+ */
+ regex_token_iterator&
+ operator++();
+
+ /**
+ * @brief Postincrements a %regex_token_iterator.
+ * @todo Implement this function.
+ */
+ regex_token_iterator
+ operator++(int);
+
+ private: // data members for exposition only:
+ typedef regex_iterator<_Bi_iter, _Ch_type, _Rx_traits> position_iterator;
+
+ position_iterator __position;
+ const value_type* __result;
+ value_type __suffix;
+ std::size_t __n;
+ std::vector<int> __subs;
+ };
+
+ /** @brief Token iterator for C-style NULL-terminated strings. */
+ typedef regex_token_iterator<const char*> cregex_token_iterator;
+ /** @brief Token iterator for standard strings. */
+ typedef regex_token_iterator<string::const_iterator> sregex_token_iterator;
+#ifdef _GLIBCXX_USE_WCHAR_T
+ /** @brief Token iterator for C-style NULL-terminated wide strings. */
+ typedef regex_token_iterator<const wchar_t*> wcregex_token_iterator;
+ /** @brief Token iterator for standard wide-character strings. */
+ typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
+#endif
+
+ //@}
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
diff --git a/i686-linux/include/c++/4.4.3/tr1_impl/type_traits b/i686-linux/include/c++/4.4.3/tr1_impl/type_traits
new file mode 100644
index 0000000..75b85ea
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1_impl/type_traits
@@ -0,0 +1,501 @@
+// TR1 type_traits -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/type_traits
+* This is an internal header file, included by other library headers.
+* You should not attempt to use it directly.
+*/
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+ /**
+ * @defgroup metaprogramming Type Traits
+ * @ingroup utilities
+ *
+ * Compile time type transformation and information.
+ * @{
+ */
+
+ // For use in __is_convertible_simple.
+ struct __sfinae_types
+ {
+ typedef char __one;
+ typedef struct { char __arr[2]; } __two;
+ };
+
+#define _DEFINE_SPEC_0_HELPER \
+ template<>
+
+#define _DEFINE_SPEC_1_HELPER \
+ template<typename _Tp>
+
+#define _DEFINE_SPEC_2_HELPER \
+ template<typename _Tp, typename _Cp>
+
+#define _DEFINE_SPEC(_Order, _Trait, _Type, _Value) \
+ _DEFINE_SPEC_##_Order##_HELPER \
+ struct _Trait<_Type> \
+ : public integral_constant<bool, _Value> { };
+
+ // helper classes [4.3].
+
+ /// integral_constant
+ template<typename _Tp, _Tp __v>
+ struct integral_constant
+ {
+ static const _Tp value = __v;
+ typedef _Tp value_type;
+ typedef integral_constant<_Tp, __v> type;
+ };
+
+ /// typedef for true_type
+ typedef integral_constant<bool, true> true_type;
+
+ /// typedef for false_type
+ typedef integral_constant<bool, false> false_type;
+
+ template<typename _Tp, _Tp __v>
+ const _Tp integral_constant<_Tp, __v>::value;
+
+ /// remove_cv
+ template<typename>
+ struct remove_cv;
+
+ template<typename>
+ struct __is_void_helper
+ : public false_type { };
+ _DEFINE_SPEC(0, __is_void_helper, void, true)
+
+ // primary type categories [4.5.1].
+
+ /// is_void
+ template<typename _Tp>
+ struct is_void
+ : public integral_constant<bool, (__is_void_helper<typename
+ remove_cv<_Tp>::type>::value)>
+ { };
+
+ template<typename>
+ struct __is_integral_helper
+ : public false_type { };
+ _DEFINE_SPEC(0, __is_integral_helper, bool, true)
+ _DEFINE_SPEC(0, __is_integral_helper, char, true)
+ _DEFINE_SPEC(0, __is_integral_helper, signed char, true)
+ _DEFINE_SPEC(0, __is_integral_helper, unsigned char, true)
+#ifdef _GLIBCXX_USE_WCHAR_T
+ _DEFINE_SPEC(0, __is_integral_helper, wchar_t, true)
+#endif
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ _DEFINE_SPEC(0, __is_integral_helper, char16_t, true)
+ _DEFINE_SPEC(0, __is_integral_helper, char32_t, true)
+#endif
+ _DEFINE_SPEC(0, __is_integral_helper, short, true)
+ _DEFINE_SPEC(0, __is_integral_helper, unsigned short, true)
+ _DEFINE_SPEC(0, __is_integral_helper, int, true)
+ _DEFINE_SPEC(0, __is_integral_helper, unsigned int, true)
+ _DEFINE_SPEC(0, __is_integral_helper, long, true)
+ _DEFINE_SPEC(0, __is_integral_helper, unsigned long, true)
+ _DEFINE_SPEC(0, __is_integral_helper, long long, true)
+ _DEFINE_SPEC(0, __is_integral_helper, unsigned long long, true)
+
+ /// is_integral
+ template<typename _Tp>
+ struct is_integral
+ : public integral_constant<bool, (__is_integral_helper<typename
+ remove_cv<_Tp>::type>::value)>
+ { };
+
+ template<typename>
+ struct __is_floating_point_helper
+ : public false_type { };
+ _DEFINE_SPEC(0, __is_floating_point_helper, float, true)
+ _DEFINE_SPEC(0, __is_floating_point_helper, double, true)
+ _DEFINE_SPEC(0, __is_floating_point_helper, long double, true)
+
+ /// is_floating_point
+ template<typename _Tp>
+ struct is_floating_point
+ : public integral_constant<bool, (__is_floating_point_helper<typename
+ remove_cv<_Tp>::type>::value)>
+ { };
+
+ /// is_array
+ template<typename>
+ struct is_array
+ : public false_type { };
+
+ template<typename _Tp, std::size_t _Size>
+ struct is_array<_Tp[_Size]>
+ : public true_type { };
+
+ template<typename _Tp>
+ struct is_array<_Tp[]>
+ : public true_type { };
+
+ template<typename>
+ struct __is_pointer_helper
+ : public false_type { };
+ _DEFINE_SPEC(1, __is_pointer_helper, _Tp*, true)
+
+ /// is_pointer
+ template<typename _Tp>
+ struct is_pointer
+ : public integral_constant<bool, (__is_pointer_helper<typename
+ remove_cv<_Tp>::type>::value)>
+ { };
+
+ /// is_reference
+ template<typename _Tp>
+ struct is_reference;
+
+ /// is_function
+ template<typename _Tp>
+ struct is_function;
+
+ template<typename>
+ struct __is_member_object_pointer_helper
+ : public false_type { };
+ _DEFINE_SPEC(2, __is_member_object_pointer_helper, _Tp _Cp::*,
+ !is_function<_Tp>::value)
+
+ /// is_member_object_pointer
+ template<typename _Tp>
+ struct is_member_object_pointer
+ : public integral_constant<bool, (__is_member_object_pointer_helper<
+ typename remove_cv<_Tp>::type>::value)>
+ { };
+
+ template<typename>
+ struct __is_member_function_pointer_helper
+ : public false_type { };
+ _DEFINE_SPEC(2, __is_member_function_pointer_helper, _Tp _Cp::*,
+ is_function<_Tp>::value)
+
+ /// is_member_function_pointer
+ template<typename _Tp>
+ struct is_member_function_pointer
+ : public integral_constant<bool, (__is_member_function_pointer_helper<
+ typename remove_cv<_Tp>::type>::value)>
+ { };
+
+ /// is_enum
+ template<typename _Tp>
+ struct is_enum
+ : public integral_constant<bool, __is_enum(_Tp)>
+ { };
+
+ /// is_union
+ template<typename _Tp>
+ struct is_union
+ : public integral_constant<bool, __is_union(_Tp)>
+ { };
+
+ /// is_class
+ template<typename _Tp>
+ struct is_class
+ : public integral_constant<bool, __is_class(_Tp)>
+ { };
+
+ /// is_function
+ template<typename>
+ struct is_function
+ : public false_type { };
+ template<typename _Res, typename... _ArgTypes>
+ struct is_function<_Res(_ArgTypes...)>
+ : public true_type { };
+ template<typename _Res, typename... _ArgTypes>
+ struct is_function<_Res(_ArgTypes......)>
+ : public true_type { };
+ template<typename _Res, typename... _ArgTypes>
+ struct is_function<_Res(_ArgTypes...) const>
+ : public true_type { };
+ template<typename _Res, typename... _ArgTypes>
+ struct is_function<_Res(_ArgTypes......) const>
+ : public true_type { };
+ template<typename _Res, typename... _ArgTypes>
+ struct is_function<_Res(_ArgTypes...) volatile>
+ : public true_type { };
+ template<typename _Res, typename... _ArgTypes>
+ struct is_function<_Res(_ArgTypes......) volatile>
+ : public true_type { };
+ template<typename _Res, typename... _ArgTypes>
+ struct is_function<_Res(_ArgTypes...) const volatile>
+ : public true_type { };
+ template<typename _Res, typename... _ArgTypes>
+ struct is_function<_Res(_ArgTypes......) const volatile>
+ : public true_type { };
+
+ // composite type traits [4.5.2].
+
+ /// is_arithmetic
+ template<typename _Tp>
+ struct is_arithmetic
+ : public integral_constant<bool, (is_integral<_Tp>::value
+ || is_floating_point<_Tp>::value)>
+ { };
+
+ /// is_fundamental
+ template<typename _Tp>
+ struct is_fundamental
+ : public integral_constant<bool, (is_arithmetic<_Tp>::value
+ || is_void<_Tp>::value)>
+ { };
+
+ /// is_object
+ template<typename _Tp>
+ struct is_object
+ : public integral_constant<bool, !(is_function<_Tp>::value
+ || is_reference<_Tp>::value
+ || is_void<_Tp>::value)>
+ { };
+
+ /// is_member_pointer
+ template<typename _Tp>
+ struct is_member_pointer;
+
+ /// is_scalar
+ template<typename _Tp>
+ struct is_scalar
+ : public integral_constant<bool, (is_arithmetic<_Tp>::value
+ || is_enum<_Tp>::value
+ || is_pointer<_Tp>::value
+ || is_member_pointer<_Tp>::value)>
+ { };
+
+ /// is_compound
+ template<typename _Tp>
+ struct is_compound
+ : public integral_constant<bool, !is_fundamental<_Tp>::value> { };
+
+ /// is_member_pointer
+ template<typename _Tp>
+ struct __is_member_pointer_helper
+ : public false_type { };
+ _DEFINE_SPEC(2, __is_member_pointer_helper, _Tp _Cp::*, true)
+
+ template<typename _Tp>
+ struct is_member_pointer
+ : public integral_constant<bool, (__is_member_pointer_helper<
+ typename remove_cv<_Tp>::type>::value)>
+ { };
+
+ // type properties [4.5.3].
+ /// is_const
+ template<typename>
+ struct is_const
+ : public false_type { };
+
+ template<typename _Tp>
+ struct is_const<_Tp const>
+ : public true_type { };
+
+ /// is_volatile
+ template<typename>
+ struct is_volatile
+ : public false_type { };
+
+ template<typename _Tp>
+ struct is_volatile<_Tp volatile>
+ : public true_type { };
+
+ /// is_empty
+ template<typename _Tp>
+ struct is_empty
+ : public integral_constant<bool, __is_empty(_Tp)>
+ { };
+
+ /// is_polymorphic
+ template<typename _Tp>
+ struct is_polymorphic
+ : public integral_constant<bool, __is_polymorphic(_Tp)>
+ { };
+
+ /// is_abstract
+ template<typename _Tp>
+ struct is_abstract
+ : public integral_constant<bool, __is_abstract(_Tp)>
+ { };
+
+ /// has_virtual_destructor
+ template<typename _Tp>
+ struct has_virtual_destructor
+ : public integral_constant<bool, __has_virtual_destructor(_Tp)>
+ { };
+
+ /// alignment_of
+ template<typename _Tp>
+ struct alignment_of
+ : public integral_constant<std::size_t, __alignof__(_Tp)> { };
+
+ /// rank
+ template<typename>
+ struct rank
+ : public integral_constant<std::size_t, 0> { };
+
+ template<typename _Tp, std::size_t _Size>
+ struct rank<_Tp[_Size]>
+ : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
+
+ template<typename _Tp>
+ struct rank<_Tp[]>
+ : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
+
+ /// extent
+ template<typename, unsigned _Uint = 0>
+ struct extent
+ : public integral_constant<std::size_t, 0> { };
+
+ template<typename _Tp, unsigned _Uint, std::size_t _Size>
+ struct extent<_Tp[_Size], _Uint>
+ : public integral_constant<std::size_t,
+ _Uint == 0 ? _Size : extent<_Tp,
+ _Uint - 1>::value>
+ { };
+
+ template<typename _Tp, unsigned _Uint>
+ struct extent<_Tp[], _Uint>
+ : public integral_constant<std::size_t,
+ _Uint == 0 ? 0 : extent<_Tp,
+ _Uint - 1>::value>
+ { };
+
+ // relationships between types [4.6].
+
+ /// is_same
+ template<typename, typename>
+ struct is_same
+ : public false_type { };
+
+ template<typename _Tp>
+ struct is_same<_Tp, _Tp>
+ : public true_type { };
+
+ // const-volatile modifications [4.7.1].
+
+ /// remove_const
+ template<typename _Tp>
+ struct remove_const
+ { typedef _Tp type; };
+
+ template<typename _Tp>
+ struct remove_const<_Tp const>
+ { typedef _Tp type; };
+
+ /// remove_volatile
+ template<typename _Tp>
+ struct remove_volatile
+ { typedef _Tp type; };
+
+ template<typename _Tp>
+ struct remove_volatile<_Tp volatile>
+ { typedef _Tp type; };
+
+ /// remove_cv
+ template<typename _Tp>
+ struct remove_cv
+ {
+ typedef typename
+ remove_const<typename remove_volatile<_Tp>::type>::type type;
+ };
+
+ /// add_const
+ template<typename _Tp>
+ struct add_const
+ { typedef _Tp const type; };
+
+ /// add_volatile
+ template<typename _Tp>
+ struct add_volatile
+ { typedef _Tp volatile type; };
+
+ /// add_cv
+ template<typename _Tp>
+ struct add_cv
+ {
+ typedef typename
+ add_const<typename add_volatile<_Tp>::type>::type type;
+ };
+
+ // array modifications [4.7.3].
+
+ /// remove_extent
+ template<typename _Tp>
+ struct remove_extent
+ { typedef _Tp type; };
+
+ template<typename _Tp, std::size_t _Size>
+ struct remove_extent<_Tp[_Size]>
+ { typedef _Tp type; };
+
+ template<typename _Tp>
+ struct remove_extent<_Tp[]>
+ { typedef _Tp type; };
+
+ /// remove_all_extents
+ template<typename _Tp>
+ struct remove_all_extents
+ { typedef _Tp type; };
+
+ template<typename _Tp, std::size_t _Size>
+ struct remove_all_extents<_Tp[_Size]>
+ { typedef typename remove_all_extents<_Tp>::type type; };
+
+ template<typename _Tp>
+ struct remove_all_extents<_Tp[]>
+ { typedef typename remove_all_extents<_Tp>::type type; };
+
+ // pointer modifications [4.7.4].
+
+ template<typename _Tp, typename>
+ struct __remove_pointer_helper
+ { typedef _Tp type; };
+
+ template<typename _Tp, typename _Up>
+ struct __remove_pointer_helper<_Tp, _Up*>
+ { typedef _Up type; };
+
+ /// remove_pointer
+ template<typename _Tp>
+ struct remove_pointer
+ : public __remove_pointer_helper<_Tp, typename remove_cv<_Tp>::type>
+ { };
+
+ template<typename>
+ struct remove_reference;
+
+ /// add_pointer
+ template<typename _Tp>
+ struct add_pointer
+ { typedef typename remove_reference<_Tp>::type* type; };
+
+#undef _DEFINE_SPEC_0_HELPER
+#undef _DEFINE_SPEC_1_HELPER
+#undef _DEFINE_SPEC_2_HELPER
+#undef _DEFINE_SPEC
+
+ // @} group metaprogramming
+_GLIBCXX_END_NAMESPACE_TR1
+}
diff --git a/i686-linux/include/c++/4.4.3/tr1_impl/unordered_map b/i686-linux/include/c++/4.4.3/tr1_impl/unordered_map
new file mode 100644
index 0000000..cef6490
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1_impl/unordered_map
@@ -0,0 +1,370 @@
+// TR1 unordered_map -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/unordered_map
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+ // XXX When we get typedef templates these class definitions
+ // will be unnecessary.
+ template<class _Key, class _Tp,
+ class _Hash = hash<_Key>,
+ class _Pred = std::equal_to<_Key>,
+ class _Alloc = std::allocator<std::pair<const _Key, _Tp> >,
+ bool __cache_hash_code = false>
+ class __unordered_map
+ : public _Hashtable<_Key, std::pair<const _Key, _Tp>, _Alloc,
+ std::_Select1st<std::pair<const _Key, _Tp> >, _Pred,
+ _Hash, __detail::_Mod_range_hashing,
+ __detail::_Default_ranged_hash,
+ __detail::_Prime_rehash_policy,
+ __cache_hash_code, false, true>
+ {
+ typedef _Hashtable<_Key, std::pair<const _Key, _Tp>, _Alloc,
+ std::_Select1st<std::pair<const _Key, _Tp> >, _Pred,
+ _Hash, __detail::_Mod_range_hashing,
+ __detail::_Default_ranged_hash,
+ __detail::_Prime_rehash_policy,
+ __cache_hash_code, false, true>
+ _Base;
+
+ public:
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::hasher hasher;
+ typedef typename _Base::key_equal key_equal;
+ typedef typename _Base::allocator_type allocator_type;
+
+ explicit
+ __unordered_map(size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__n, __hf, __detail::_Mod_range_hashing(),
+ __detail::_Default_ranged_hash(),
+ __eql, std::_Select1st<std::pair<const _Key, _Tp> >(), __a)
+ { }
+
+ template<typename _InputIterator>
+ __unordered_map(_InputIterator __f, _InputIterator __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__f, __l, __n, __hf, __detail::_Mod_range_hashing(),
+ __detail::_Default_ranged_hash(),
+ __eql, std::_Select1st<std::pair<const _Key, _Tp> >(), __a)
+ { }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ __unordered_map(__unordered_map&& __x)
+ : _Base(std::forward<_Base>(__x)) { }
+#endif
+ };
+
+ template<class _Key, class _Tp,
+ class _Hash = hash<_Key>,
+ class _Pred = std::equal_to<_Key>,
+ class _Alloc = std::allocator<std::pair<const _Key, _Tp> >,
+ bool __cache_hash_code = false>
+ class __unordered_multimap
+ : public _Hashtable<_Key, std::pair<const _Key, _Tp>,
+ _Alloc,
+ std::_Select1st<std::pair<const _Key, _Tp> >, _Pred,
+ _Hash, __detail::_Mod_range_hashing,
+ __detail::_Default_ranged_hash,
+ __detail::_Prime_rehash_policy,
+ __cache_hash_code, false, false>
+ {
+ typedef _Hashtable<_Key, std::pair<const _Key, _Tp>,
+ _Alloc,
+ std::_Select1st<std::pair<const _Key, _Tp> >, _Pred,
+ _Hash, __detail::_Mod_range_hashing,
+ __detail::_Default_ranged_hash,
+ __detail::_Prime_rehash_policy,
+ __cache_hash_code, false, false>
+ _Base;
+
+ public:
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::hasher hasher;
+ typedef typename _Base::key_equal key_equal;
+ typedef typename _Base::allocator_type allocator_type;
+
+ explicit
+ __unordered_multimap(size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__n, __hf, __detail::_Mod_range_hashing(),
+ __detail::_Default_ranged_hash(),
+ __eql, std::_Select1st<std::pair<const _Key, _Tp> >(), __a)
+ { }
+
+
+ template<typename _InputIterator>
+ __unordered_multimap(_InputIterator __f, _InputIterator __l,
+ typename _Base::size_type __n = 0,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__f, __l, __n, __hf, __detail::_Mod_range_hashing(),
+ __detail::_Default_ranged_hash(),
+ __eql, std::_Select1st<std::pair<const _Key, _Tp> >(), __a)
+ { }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ __unordered_multimap(__unordered_multimap&& __x)
+ : _Base(std::forward<_Base>(__x)) { }
+#endif
+ };
+
+ template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc,
+ bool __cache_hash_code>
+ inline void
+ swap(__unordered_map<_Key, _Tp, _Hash, _Pred,
+ _Alloc, __cache_hash_code>& __x,
+ __unordered_map<_Key, _Tp, _Hash, _Pred,
+ _Alloc, __cache_hash_code>& __y)
+ { __x.swap(__y); }
+
+ template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc,
+ bool __cache_hash_code>
+ inline void
+ swap(__unordered_multimap<_Key, _Tp, _Hash, _Pred,
+ _Alloc, __cache_hash_code>& __x,
+ __unordered_multimap<_Key, _Tp, _Hash, _Pred,
+ _Alloc, __cache_hash_code>& __y)
+ { __x.swap(__y); }
+
+
+ /**
+ * @brief A standard container composed of unique keys (containing
+ * at most one of each key value) that associates values of another type
+ * with the keys.
+ *
+ * @ingroup unordered_associative_containers
+ *
+ * Meets the requirements of a <a href="tables.html#65">container</a>, and
+ * <a href="tables.html#xx">unordered associative container</a>
+ *
+ * @param Key Type of key objects.
+ * @param Tp Type of mapped objects.
+ * @param Hash Hashing function object type, defaults to hash<Value>.
+ * @param Pred Predicate function object type, defaults to equal_to<Value>.
+ * @param Alloc Allocator type, defaults to allocator<Key>.
+ *
+ * The resulting value type of the container is std::pair<const Key, Tp>.
+ */
+ template<class _Key, class _Tp,
+ class _Hash = hash<_Key>,
+ class _Pred = std::equal_to<_Key>,
+ class _Alloc = std::allocator<std::pair<const _Key, _Tp> > >
+ class unordered_map
+ : public __unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>
+ {
+ typedef __unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc> _Base;
+
+ public:
+ typedef typename _Base::value_type value_type;
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::hasher hasher;
+ typedef typename _Base::key_equal key_equal;
+ typedef typename _Base::allocator_type allocator_type;
+
+ explicit
+ unordered_map(size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__n, __hf, __eql, __a)
+ { }
+
+ template<typename _InputIterator>
+ unordered_map(_InputIterator __f, _InputIterator __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__f, __l, __n, __hf, __eql, __a)
+ { }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ unordered_map(unordered_map&& __x)
+ : _Base(std::forward<_Base>(__x)) { }
+
+ unordered_map(initializer_list<value_type> __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__l.begin(), __l.end(), __n, __hf, __eql, __a)
+ { }
+
+ unordered_map&
+ operator=(unordered_map&& __x)
+ {
+ // NB: DR 675.
+ this->clear();
+ this->swap(__x);
+ return *this;
+ }
+
+ unordered_map&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l.begin(), __l.end());
+ return *this;
+ }
+#endif
+ };
+
+ /**
+ * @brief A standard container composed of equivalent keys
+ * (possibly containing multiple of each key value) that associates
+ * values of another type with the keys.
+ *
+ * @ingroup unordered_associative_containers
+ *
+ * Meets the requirements of a <a href="tables.html#65">container</a>, and
+ * <a href="tables.html#xx">unordered associative container</a>
+ *
+ * @param Key Type of key objects.
+ * @param Tp Type of mapped objects.
+ * @param Hash Hashing function object type, defaults to hash<Value>.
+ * @param Pred Predicate function object type, defaults to equal_to<Value>.
+ * @param Alloc Allocator type, defaults to allocator<Key>.
+ *
+ * The resulting value type of the container is std::pair<const Key, Tp>.
+ */
+ template<class _Key, class _Tp,
+ class _Hash = hash<_Key>,
+ class _Pred = std::equal_to<_Key>,
+ class _Alloc = std::allocator<std::pair<const _Key, _Tp> > >
+ class unordered_multimap
+ : public __unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>
+ {
+ typedef __unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc> _Base;
+
+ public:
+ typedef typename _Base::value_type value_type;
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::hasher hasher;
+ typedef typename _Base::key_equal key_equal;
+ typedef typename _Base::allocator_type allocator_type;
+
+ explicit
+ unordered_multimap(size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__n, __hf, __eql, __a)
+ { }
+
+
+ template<typename _InputIterator>
+ unordered_multimap(_InputIterator __f, _InputIterator __l,
+ typename _Base::size_type __n = 0,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__f, __l, __n, __hf, __eql, __a)
+ { }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ unordered_multimap(unordered_multimap&& __x)
+ : _Base(std::forward<_Base>(__x)) { }
+
+ unordered_multimap(initializer_list<value_type> __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__l.begin(), __l.end(), __n, __hf, __eql, __a)
+ { }
+
+ unordered_multimap&
+ operator=(unordered_multimap&& __x)
+ {
+ // NB: DR 675.
+ this->clear();
+ this->swap(__x);
+ return *this;
+ }
+
+ unordered_multimap&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l.begin(), __l.end());
+ return *this;
+ }
+#endif
+ };
+
+ template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
+ inline void
+ swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
+ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
+ inline void
+ swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
+ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
+ { __x.swap(__y); }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
+ inline void
+ swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&& __x,
+ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
+ inline void
+ swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
+ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&& __y)
+ { __x.swap(__y); }
+
+ template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
+ inline void
+ swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>&& __x,
+ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
+ inline void
+ swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
+ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>&& __y)
+ { __x.swap(__y); }
+#endif
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
diff --git a/i686-linux/include/c++/4.4.3/tr1_impl/unordered_set b/i686-linux/include/c++/4.4.3/tr1_impl/unordered_set
new file mode 100644
index 0000000..fc2ce2b
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1_impl/unordered_set
@@ -0,0 +1,360 @@
+// TR1 unordered_set -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/unordered_set
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+ // XXX When we get typedef templates these class definitions
+ // will be unnecessary.
+ template<class _Value,
+ class _Hash = hash<_Value>,
+ class _Pred = std::equal_to<_Value>,
+ class _Alloc = std::allocator<_Value>,
+ bool __cache_hash_code = false>
+ class __unordered_set
+ : public _Hashtable<_Value, _Value, _Alloc,
+ std::_Identity<_Value>, _Pred,
+ _Hash, __detail::_Mod_range_hashing,
+ __detail::_Default_ranged_hash,
+ __detail::_Prime_rehash_policy,
+ __cache_hash_code, true, true>
+ {
+ typedef _Hashtable<_Value, _Value, _Alloc,
+ std::_Identity<_Value>, _Pred,
+ _Hash, __detail::_Mod_range_hashing,
+ __detail::_Default_ranged_hash,
+ __detail::_Prime_rehash_policy,
+ __cache_hash_code, true, true>
+ _Base;
+
+ public:
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::hasher hasher;
+ typedef typename _Base::key_equal key_equal;
+ typedef typename _Base::allocator_type allocator_type;
+
+ explicit
+ __unordered_set(size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__n, __hf, __detail::_Mod_range_hashing(),
+ __detail::_Default_ranged_hash(), __eql,
+ std::_Identity<_Value>(), __a)
+ { }
+
+ template<typename _InputIterator>
+ __unordered_set(_InputIterator __f, _InputIterator __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__f, __l, __n, __hf, __detail::_Mod_range_hashing(),
+ __detail::_Default_ranged_hash(), __eql,
+ std::_Identity<_Value>(), __a)
+ { }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ __unordered_set(__unordered_set&& __x)
+ : _Base(std::forward<_Base>(__x)) { }
+#endif
+ };
+
+ template<class _Value,
+ class _Hash = hash<_Value>,
+ class _Pred = std::equal_to<_Value>,
+ class _Alloc = std::allocator<_Value>,
+ bool __cache_hash_code = false>
+ class __unordered_multiset
+ : public _Hashtable<_Value, _Value, _Alloc,
+ std::_Identity<_Value>, _Pred,
+ _Hash, __detail::_Mod_range_hashing,
+ __detail::_Default_ranged_hash,
+ __detail::_Prime_rehash_policy,
+ __cache_hash_code, true, false>
+ {
+ typedef _Hashtable<_Value, _Value, _Alloc,
+ std::_Identity<_Value>, _Pred,
+ _Hash, __detail::_Mod_range_hashing,
+ __detail::_Default_ranged_hash,
+ __detail::_Prime_rehash_policy,
+ __cache_hash_code, true, false>
+ _Base;
+
+ public:
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::hasher hasher;
+ typedef typename _Base::key_equal key_equal;
+ typedef typename _Base::allocator_type allocator_type;
+
+ explicit
+ __unordered_multiset(size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__n, __hf, __detail::_Mod_range_hashing(),
+ __detail::_Default_ranged_hash(), __eql,
+ std::_Identity<_Value>(), __a)
+ { }
+
+
+ template<typename _InputIterator>
+ __unordered_multiset(_InputIterator __f, _InputIterator __l,
+ typename _Base::size_type __n = 0,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__f, __l, __n, __hf, __detail::_Mod_range_hashing(),
+ __detail::_Default_ranged_hash(), __eql,
+ std::_Identity<_Value>(), __a)
+ { }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ __unordered_multiset(__unordered_multiset&& __x)
+ : _Base(std::forward<_Base>(__x)) { }
+#endif
+ };
+
+ template<class _Value, class _Hash, class _Pred, class _Alloc,
+ bool __cache_hash_code>
+ inline void
+ swap(__unordered_set<_Value, _Hash, _Pred, _Alloc, __cache_hash_code>& __x,
+ __unordered_set<_Value, _Hash, _Pred, _Alloc, __cache_hash_code>& __y)
+ { __x.swap(__y); }
+
+ template<class _Value, class _Hash, class _Pred, class _Alloc,
+ bool __cache_hash_code>
+ inline void
+ swap(__unordered_multiset<_Value, _Hash, _Pred,
+ _Alloc, __cache_hash_code>& __x,
+ __unordered_multiset<_Value, _Hash, _Pred,
+ _Alloc, __cache_hash_code>& __y)
+ { __x.swap(__y); }
+
+
+ /**
+ * @brief A standard container composed of unique keys (containing
+ * at most one of each key value) in which the elements' keys are
+ * the elements themselves.
+ *
+ * @ingroup unordered_associative_containers
+ *
+ * Meets the requirements of a <a href="tables.html#65">container</a>, and
+ * <a href="tables.html#xx">unordered associative container</a>
+ *
+ * @param Value Type of key objects.
+ * @param Hash Hashing function object type, defaults to hash<Value>.
+ * @param Pred Predicate function object type, defaults to equal_to<Value>.
+ * @param Alloc Allocator type, defaults to allocator<Key>.
+ */
+ template<class _Value,
+ class _Hash = hash<_Value>,
+ class _Pred = std::equal_to<_Value>,
+ class _Alloc = std::allocator<_Value> >
+ class unordered_set
+ : public __unordered_set<_Value, _Hash, _Pred, _Alloc>
+ {
+ typedef __unordered_set<_Value, _Hash, _Pred, _Alloc> _Base;
+
+ public:
+ typedef typename _Base::value_type value_type;
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::hasher hasher;
+ typedef typename _Base::key_equal key_equal;
+ typedef typename _Base::allocator_type allocator_type;
+
+ explicit
+ unordered_set(size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__n, __hf, __eql, __a)
+ { }
+
+ template<typename _InputIterator>
+ unordered_set(_InputIterator __f, _InputIterator __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__f, __l, __n, __hf, __eql, __a)
+ { }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ unordered_set(unordered_set&& __x)
+ : _Base(std::forward<_Base>(__x)) { }
+
+ unordered_set(initializer_list<value_type> __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__l.begin(), __l.end(), __n, __hf, __eql, __a)
+ { }
+
+ unordered_set&
+ operator=(unordered_set&& __x)
+ {
+ // NB: DR 675.
+ this->clear();
+ this->swap(__x);
+ return *this;
+ }
+
+ unordered_set&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l.begin(), __l.end());
+ return *this;
+ }
+#endif
+ };
+
+ /**
+ * @brief A standard container composed of equivalent keys
+ * (possibly containing multiple of each key value) in which the
+ * elements' keys are the elements themselves.
+ *
+ * @ingroup unordered_associative_containers
+ *
+ * Meets the requirements of a <a href="tables.html#65">container</a>, and
+ * <a href="tables.html#xx">unordered associative container</a>
+ *
+ * @param Value Type of key objects.
+ * @param Hash Hashing function object type, defaults to hash<Value>.
+ * @param Pred Predicate function object type, defaults to equal_to<Value>.
+ * @param Alloc Allocator type, defaults to allocator<Key>.
+ */
+ template<class _Value,
+ class _Hash = hash<_Value>,
+ class _Pred = std::equal_to<_Value>,
+ class _Alloc = std::allocator<_Value> >
+ class unordered_multiset
+ : public __unordered_multiset<_Value, _Hash, _Pred, _Alloc>
+ {
+ typedef __unordered_multiset<_Value, _Hash, _Pred, _Alloc> _Base;
+
+ public:
+ typedef typename _Base::value_type value_type;
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::hasher hasher;
+ typedef typename _Base::key_equal key_equal;
+ typedef typename _Base::allocator_type allocator_type;
+
+ explicit
+ unordered_multiset(size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__n, __hf, __eql, __a)
+ { }
+
+
+ template<typename _InputIterator>
+ unordered_multiset(_InputIterator __f, _InputIterator __l,
+ typename _Base::size_type __n = 0,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__f, __l, __n, __hf, __eql, __a)
+ { }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ unordered_multiset(unordered_multiset&& __x)
+ : _Base(std::forward<_Base>(__x)) { }
+
+ unordered_multiset(initializer_list<value_type> __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__l.begin(), __l.end(), __n, __hf, __eql, __a)
+ { }
+
+ unordered_multiset&
+ operator=(unordered_multiset&& __x)
+ {
+ // NB: DR 675.
+ this->clear();
+ this->swap(__x);
+ return *this;
+ }
+
+ unordered_multiset&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l.begin(), __l.end());
+ return *this;
+ }
+#endif
+ };
+
+ template<class _Value, class _Hash, class _Pred, class _Alloc>
+ inline void
+ swap(unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
+ unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<class _Value, class _Hash, class _Pred, class _Alloc>
+ inline void
+ swap(unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
+ unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
+ { __x.swap(__y); }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ template<class _Value, class _Hash, class _Pred, class _Alloc>
+ inline void
+ swap(unordered_set<_Value, _Hash, _Pred, _Alloc>&& __x,
+ unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<class _Value, class _Hash, class _Pred, class _Alloc>
+ inline void
+ swap(unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
+ unordered_set<_Value, _Hash, _Pred, _Alloc>&& __y)
+ { __x.swap(__y); }
+
+ template<class _Value, class _Hash, class _Pred, class _Alloc>
+ inline void
+ swap(unordered_multiset<_Value, _Hash, _Pred, _Alloc>&& __x,
+ unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<class _Value, class _Hash, class _Pred, class _Alloc>
+ inline void
+ swap(unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
+ unordered_multiset<_Value, _Hash, _Pred, _Alloc>&& __y)
+ { __x.swap(__y); }
+#endif
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
diff --git a/i686-linux/include/c++/4.4.3/tr1_impl/utility b/i686-linux/include/c++/4.4.3/tr1_impl/utility
new file mode 100644
index 0000000..a31c4da
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tr1_impl/utility
@@ -0,0 +1,120 @@
+// TR1 utility -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/utility
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+ template<class _Tp>
+ class tuple_size;
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ template<std::size_t _Int, class _Tp>
+#else
+ template<int _Int, class _Tp>
+#endif
+ class tuple_element;
+
+ // Various functions which give std::pair a tuple-like interface.
+ template<class _Tp1, class _Tp2>
+ struct tuple_size<std::pair<_Tp1, _Tp2> >
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ { static const std::size_t value = 2; };
+#else
+ { static const int value = 2; };
+#endif
+
+ template<class _Tp1, class _Tp2>
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ const std::size_t
+#else
+ const int
+#endif
+ tuple_size<std::pair<_Tp1, _Tp2> >::value;
+
+ template<class _Tp1, class _Tp2>
+ struct tuple_element<0, std::pair<_Tp1, _Tp2> >
+ { typedef _Tp1 type; };
+
+ template<class _Tp1, class _Tp2>
+ struct tuple_element<1, std::pair<_Tp1, _Tp2> >
+ { typedef _Tp2 type; };
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ template<std::size_t _Int>
+#else
+ template<int _Int>
+#endif
+ struct __pair_get;
+
+ template<>
+ struct __pair_get<0>
+ {
+ template<typename _Tp1, typename _Tp2>
+ static _Tp1& __get(std::pair<_Tp1, _Tp2>& __pair)
+ { return __pair.first; }
+
+ template<typename _Tp1, typename _Tp2>
+ static const _Tp1& __const_get(const std::pair<_Tp1, _Tp2>& __pair)
+ { return __pair.first; }
+ };
+
+ template<>
+ struct __pair_get<1>
+ {
+ template<typename _Tp1, typename _Tp2>
+ static _Tp2& __get(std::pair<_Tp1, _Tp2>& __pair)
+ { return __pair.second; }
+
+ template<typename _Tp1, typename _Tp2>
+ static const _Tp2& __const_get(const std::pair<_Tp1, _Tp2>& __pair)
+ { return __pair.second; }
+ };
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ template<std::size_t _Int, class _Tp1, class _Tp2>
+#else
+ template<int _Int, class _Tp1, class _Tp2>
+#endif
+ inline typename tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&
+ get(std::pair<_Tp1, _Tp2>& __in)
+ { return __pair_get<_Int>::__get(__in); }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ template<std::size_t _Int, class _Tp1, class _Tp2>
+#else
+ template<int _Int, class _Tp1, class _Tp2>
+#endif
+ inline const typename tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&
+ get(const std::pair<_Tp1, _Tp2>& __in)
+ { return __pair_get<_Int>::__const_get(__in); }
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
+
diff --git a/i686-linux/include/c++/4.4.3/tuple b/i686-linux/include/c++/4.4.3/tuple
new file mode 100644
index 0000000..c5dbe6b
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/tuple
@@ -0,0 +1,697 @@
+// <tuple> -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/tuple
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TUPLE
+#define _GLIBCXX_TUPLE 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#else
+
+#include <utility>
+
+namespace std
+{
+ // Adds a const reference to a non-reference type.
+ template<typename _Tp>
+ struct __add_c_ref
+ { typedef const _Tp& type; };
+
+ template<typename _Tp>
+ struct __add_c_ref<_Tp&>
+ { typedef _Tp& type; };
+
+ // Adds a reference to a non-reference type.
+ template<typename _Tp>
+ struct __add_ref
+ { typedef _Tp& type; };
+
+ template<typename _Tp>
+ struct __add_ref<_Tp&>
+ { typedef _Tp& type; };
+
+ template<std::size_t _Idx, typename _Head, bool _IsEmpty>
+ struct _Head_base;
+
+ template<std::size_t _Idx, typename _Head>
+ struct _Head_base<_Idx, _Head, true>
+ : public _Head
+ {
+ _Head_base()
+ : _Head() { }
+
+ _Head_base(const _Head& __h)
+ : _Head(__h) { }
+
+ template<typename _UHead>
+ _Head_base(_UHead&& __h)
+ : _Head(std::forward<_UHead>(__h)) { }
+
+ _Head& _M_head() { return *this; }
+ const _Head& _M_head() const { return *this; }
+
+ void _M_swap_impl(_Head&&) { /* no-op */ }
+ };
+
+ template<std::size_t _Idx, typename _Head>
+ struct _Head_base<_Idx, _Head, false>
+ {
+ _Head_base()
+ : _M_head_impl() { }
+
+ _Head_base(const _Head& __h)
+ : _M_head_impl(__h) { }
+
+ template<typename _UHead>
+ _Head_base(_UHead&& __h)
+ : _M_head_impl(std::forward<_UHead>(__h)) { }
+
+ _Head& _M_head() { return _M_head_impl; }
+ const _Head& _M_head() const { return _M_head_impl; }
+
+ void
+ _M_swap_impl(_Head&& __h)
+ {
+ using std::swap;
+ swap(__h, _M_head_impl);
+ }
+
+ _Head _M_head_impl;
+ };
+
+ /**
+ * Contains the actual implementation of the @c tuple template, stored
+ * as a recursive inheritance hierarchy from the first element (most
+ * derived class) to the last (least derived class). The @c Idx
+ * parameter gives the 0-based index of the element stored at this
+ * point in the hierarchy; we use it to implement a constant-time
+ * get() operation.
+ */
+ template<std::size_t _Idx, typename... _Elements>
+ struct _Tuple_impl;
+
+ /**
+ * Zero-element tuple implementation. This is the basis case for the
+ * inheritance recursion.
+ */
+ template<std::size_t _Idx>
+ struct _Tuple_impl<_Idx>
+ {
+ protected:
+ void _M_swap_impl(_Tuple_impl&&) { /* no-op */ }
+ };
+
+ /**
+ * Recursive tuple implementation. Here we store the @c Head element
+ * and derive from a @c Tuple_impl containing the remaining elements
+ * (which contains the @c Tail).
+ */
+ template<std::size_t _Idx, typename _Head, typename... _Tail>
+ struct _Tuple_impl<_Idx, _Head, _Tail...>
+ : public _Tuple_impl<_Idx + 1, _Tail...>,
+ private _Head_base<_Idx, _Head, std::is_empty<_Head>::value>
+ {
+ typedef _Tuple_impl<_Idx + 1, _Tail...> _Inherited;
+ typedef _Head_base<_Idx, _Head, std::is_empty<_Head>::value> _Base;
+
+ _Head& _M_head() { return _Base::_M_head(); }
+ const _Head& _M_head() const { return _Base::_M_head(); }
+
+ _Inherited& _M_tail() { return *this; }
+ const _Inherited& _M_tail() const { return *this; }
+
+ _Tuple_impl()
+ : _Inherited(), _Base() { }
+
+ explicit
+ _Tuple_impl(const _Head& __head, const _Tail&... __tail)
+ : _Inherited(__tail...), _Base(__head) { }
+
+ template<typename _UHead, typename... _UTail>
+ explicit
+ _Tuple_impl(_UHead&& __head, _UTail&&... __tail)
+ : _Inherited(std::forward<_UTail>(__tail)...),
+ _Base(std::forward<_UHead>(__head)) { }
+
+ _Tuple_impl(const _Tuple_impl& __in)
+ : _Inherited(__in._M_tail()), _Base(__in._M_head()) { }
+
+ _Tuple_impl(_Tuple_impl&& __in)
+ : _Inherited(std::move<_Inherited&&>(__in._M_tail())),
+ _Base(std::forward<_Head>(__in._M_head())) { }
+
+ template<typename... _UElements>
+ _Tuple_impl(const _Tuple_impl<_Idx, _UElements...>& __in)
+ : _Inherited(__in._M_tail()), _Base(__in._M_head()) { }
+
+ template<typename... _UElements>
+ _Tuple_impl(_Tuple_impl<_Idx, _UElements...>&& __in)
+ : _Inherited(std::move<typename _Tuple_impl<_Idx, _UElements...>::
+ _Inherited&&>(__in._M_tail())),
+ _Base(std::forward<typename _Tuple_impl<_Idx, _UElements...>::
+ _Base>(__in._M_head())) { }
+
+ _Tuple_impl&
+ operator=(const _Tuple_impl& __in)
+ {
+ _M_head() = __in._M_head();
+ _M_tail() = __in._M_tail();
+ return *this;
+ }
+
+ _Tuple_impl&
+ operator=(_Tuple_impl&& __in)
+ {
+ _M_head() = std::move(__in._M_head());
+ _M_tail() = std::move(__in._M_tail());
+ return *this;
+ }
+
+ template<typename... _UElements>
+ _Tuple_impl&
+ operator=(const _Tuple_impl<_Idx, _UElements...>& __in)
+ {
+ _M_head() = __in._M_head();
+ _M_tail() = __in._M_tail();
+ return *this;
+ }
+
+ template<typename... _UElements>
+ _Tuple_impl&
+ operator=(_Tuple_impl<_Idx, _UElements...>&& __in)
+ {
+ _M_head() = std::move(__in._M_head());
+ _M_tail() = std::move(__in._M_tail());
+ return *this;
+ }
+
+ protected:
+ void
+ _M_swap_impl(_Tuple_impl&& __in)
+ {
+ _Base::_M_swap_impl(__in._M_head());
+ _Inherited::_M_swap_impl(__in._M_tail());
+ }
+ };
+
+ /// tuple
+ template<typename... _Elements>
+ class tuple : public _Tuple_impl<0, _Elements...>
+ {
+ typedef _Tuple_impl<0, _Elements...> _Inherited;
+
+ public:
+ tuple()
+ : _Inherited() { }
+
+ explicit
+ tuple(const _Elements&... __elements)
+ : _Inherited(__elements...) { }
+
+ template<typename... _UElements>
+ explicit
+ tuple(_UElements&&... __elements)
+ : _Inherited(std::forward<_UElements>(__elements)...) { }
+
+ tuple(const tuple& __in)
+ : _Inherited(static_cast<const _Inherited&>(__in)) { }
+
+ tuple(tuple&& __in)
+ : _Inherited(std::move<_Inherited>(__in)) { }
+
+ template<typename... _UElements>
+ tuple(const tuple<_UElements...>& __in)
+ : _Inherited(static_cast<const _Tuple_impl<0, _UElements...>&>(__in))
+ { }
+
+ template<typename... _UElements>
+ tuple(tuple<_UElements...>&& __in)
+ : _Inherited(std::move<_Tuple_impl<0, _UElements...> >(__in)) { }
+
+ // XXX http://gcc.gnu.org/ml/libstdc++/2008-02/msg00047.html
+ template<typename... _UElements>
+ tuple(tuple<_UElements...>& __in)
+ : _Inherited(static_cast<const _Tuple_impl<0, _UElements...>&>(__in))
+ { }
+
+ tuple&
+ operator=(const tuple& __in)
+ {
+ static_cast<_Inherited&>(*this) = __in;
+ return *this;
+ }
+
+ tuple&
+ operator=(tuple&& __in)
+ {
+ static_cast<_Inherited&>(*this) = std::move(__in);
+ return *this;
+ }
+
+ template<typename... _UElements>
+ tuple&
+ operator=(const tuple<_UElements...>& __in)
+ {
+ static_cast<_Inherited&>(*this) = __in;
+ return *this;
+ }
+
+ template<typename... _UElements>
+ tuple&
+ operator=(tuple<_UElements...>&& __in)
+ {
+ static_cast<_Inherited&>(*this) = std::move(__in);
+ return *this;
+ }
+
+ void
+ swap(tuple&& __in)
+ { _Inherited::_M_swap_impl(__in); }
+ };
+
+
+ template<>
+ class tuple<>
+ {
+ public:
+ void swap(tuple&&) { /* no-op */ }
+ };
+
+ /// tuple (2-element), with construction and assignment from a pair.
+ template<typename _T1, typename _T2>
+ class tuple<_T1, _T2> : public _Tuple_impl<0, _T1, _T2>
+ {
+ typedef _Tuple_impl<0, _T1, _T2> _Inherited;
+
+ public:
+ tuple()
+ : _Inherited() { }
+
+ explicit
+ tuple(const _T1& __a1, const _T2& __a2)
+ : _Inherited(__a1, __a2) { }
+
+ template<typename _U1, typename _U2>
+ explicit
+ tuple(_U1&& __a1, _U2&& __a2)
+ : _Inherited(std::forward<_U1>(__a1), std::forward<_U2>(__a2)) { }
+
+ tuple(const tuple& __in)
+ : _Inherited(static_cast<const _Inherited&>(__in)) { }
+
+ tuple(tuple&& __in)
+ : _Inherited(std::move<_Inherited>(__in)) { }
+
+ template<typename _U1, typename _U2>
+ tuple(const tuple<_U1, _U2>& __in)
+ : _Inherited(static_cast<const _Tuple_impl<0, _U1, _U2>&>(__in)) { }
+
+ template<typename _U1, typename _U2>
+ tuple(tuple<_U1, _U2>&& __in)
+ : _Inherited(std::move<_Tuple_impl<0, _U1, _U2> >(__in)) { }
+
+ template<typename _U1, typename _U2>
+ tuple(const pair<_U1, _U2>& __in)
+ : _Inherited(__in.first, __in.second) { }
+
+ template<typename _U1, typename _U2>
+ tuple(pair<_U1, _U2>&& __in)
+ : _Inherited(std::move(__in.first), std::move(__in.second)) { }
+
+ tuple&
+ operator=(const tuple& __in)
+ {
+ static_cast<_Inherited&>(*this) = __in;
+ return *this;
+ }
+
+ tuple&
+ operator=(tuple&& __in)
+ {
+ static_cast<_Inherited&>(*this) = std::move(__in);
+ return *this;
+ }
+
+ template<typename _U1, typename _U2>
+ tuple&
+ operator=(const tuple<_U1, _U2>& __in)
+ {
+ static_cast<_Inherited&>(*this) = __in;
+ return *this;
+ }
+
+ template<typename _U1, typename _U2>
+ tuple&
+ operator=(tuple<_U1, _U2>&& __in)
+ {
+ static_cast<_Inherited&>(*this) = std::move(__in);
+ return *this;
+ }
+
+ template<typename _U1, typename _U2>
+ tuple&
+ operator=(const pair<_U1, _U2>& __in)
+ {
+ this->_M_head() = __in.first;
+ this->_M_tail()._M_head() = __in.second;
+ return *this;
+ }
+
+ template<typename _U1, typename _U2>
+ tuple&
+ operator=(pair<_U1, _U2>&& __in)
+ {
+ this->_M_head() = std::move(__in.first);
+ this->_M_tail()._M_head() = std::move(__in.second);
+ return *this;
+ }
+
+ void
+ swap(tuple&& __in)
+ {
+ using std::swap;
+ swap(this->_M_head(), __in._M_head());
+ swap(this->_M_tail()._M_head(), __in._M_tail()._M_head());
+ }
+ };
+
+
+ /// Gives the type of the ith element of a given tuple type.
+ template<std::size_t __i, typename _Tp>
+ struct tuple_element;
+
+ /**
+ * Recursive case for tuple_element: strip off the first element in
+ * the tuple and retrieve the (i-1)th element of the remaining tuple.
+ */
+ template<std::size_t __i, typename _Head, typename... _Tail>
+ struct tuple_element<__i, tuple<_Head, _Tail...> >
+ : tuple_element<__i - 1, tuple<_Tail...> > { };
+
+ /**
+ * Basis case for tuple_element: The first element is the one we're seeking.
+ */
+ template<typename _Head, typename... _Tail>
+ struct tuple_element<0, tuple<_Head, _Tail...> >
+ {
+ typedef _Head type;
+ };
+
+ /// Finds the size of a given tuple type.
+ template<typename _Tp>
+ struct tuple_size;
+
+ /// class tuple_size
+ template<typename... _Elements>
+ struct tuple_size<tuple<_Elements...> >
+ {
+ static const std::size_t value = sizeof...(_Elements);
+ };
+
+ template<typename... _Elements>
+ const std::size_t tuple_size<tuple<_Elements...> >::value;
+
+ template<std::size_t __i, typename _Head, typename... _Tail>
+ inline typename __add_ref<_Head>::type
+ __get_helper(_Tuple_impl<__i, _Head, _Tail...>& __t)
+ { return __t._M_head(); }
+
+ template<std::size_t __i, typename _Head, typename... _Tail>
+ inline typename __add_c_ref<_Head>::type
+ __get_helper(const _Tuple_impl<__i, _Head, _Tail...>& __t)
+ { return __t._M_head(); }
+
+ // Return a reference (const reference) to the ith element of a tuple.
+ // Any const or non-const ref elements are returned with their original type.
+ template<std::size_t __i, typename... _Elements>
+ inline typename __add_ref<
+ typename tuple_element<__i, tuple<_Elements...> >::type
+ >::type
+ get(tuple<_Elements...>& __t)
+ { return __get_helper<__i>(__t); }
+
+ template<std::size_t __i, typename... _Elements>
+ inline typename __add_c_ref<
+ typename tuple_element<__i, tuple<_Elements...> >::type
+ >::type
+ get(const tuple<_Elements...>& __t)
+ { return __get_helper<__i>(__t); }
+
+ // This class helps construct the various comparison operations on tuples
+ template<std::size_t __check_equal_size, std::size_t __i, std::size_t __j,
+ typename _Tp, typename _Up>
+ struct __tuple_compare;
+
+ template<std::size_t __i, std::size_t __j, typename _Tp, typename _Up>
+ struct __tuple_compare<0, __i, __j, _Tp, _Up>
+ {
+ static bool __eq(const _Tp& __t, const _Up& __u)
+ {
+ return (get<__i>(__t) == get<__i>(__u) &&
+ __tuple_compare<0, __i + 1, __j, _Tp, _Up>::__eq(__t, __u));
+ }
+
+ static bool __less(const _Tp& __t, const _Up& __u)
+ {
+ return ((get<__i>(__t) < get<__i>(__u))
+ || !(get<__i>(__u) < get<__i>(__t)) &&
+ __tuple_compare<0, __i + 1, __j, _Tp, _Up>::__less(__t, __u));
+ }
+ };
+
+ template<std::size_t __i, typename _Tp, typename _Up>
+ struct __tuple_compare<0, __i, __i, _Tp, _Up>
+ {
+ static bool __eq(const _Tp&, const _Up&)
+ { return true; }
+
+ static bool __less(const _Tp&, const _Up&)
+ { return false; }
+ };
+
+ template<typename... _TElements, typename... _UElements>
+ bool
+ operator==(const tuple<_TElements...>& __t,
+ const tuple<_UElements...>& __u)
+ {
+ typedef tuple<_TElements...> _Tp;
+ typedef tuple<_UElements...> _Up;
+ return (__tuple_compare<tuple_size<_Tp>::value - tuple_size<_Up>::value,
+ 0, tuple_size<_Tp>::value, _Tp, _Up>::__eq(__t, __u));
+ }
+
+ template<typename... _TElements, typename... _UElements>
+ bool
+ operator<(const tuple<_TElements...>& __t,
+ const tuple<_UElements...>& __u)
+ {
+ typedef tuple<_TElements...> _Tp;
+ typedef tuple<_UElements...> _Up;
+ return (__tuple_compare<tuple_size<_Tp>::value - tuple_size<_Up>::value,
+ 0, tuple_size<_Tp>::value, _Tp, _Up>::__less(__t, __u));
+ }
+
+ template<typename... _TElements, typename... _UElements>
+ inline bool
+ operator!=(const tuple<_TElements...>& __t,
+ const tuple<_UElements...>& __u)
+ { return !(__t == __u); }
+
+ template<typename... _TElements, typename... _UElements>
+ inline bool
+ operator>(const tuple<_TElements...>& __t,
+ const tuple<_UElements...>& __u)
+ { return __u < __t; }
+
+ template<typename... _TElements, typename... _UElements>
+ inline bool
+ operator<=(const tuple<_TElements...>& __t,
+ const tuple<_UElements...>& __u)
+ { return !(__u < __t); }
+
+ template<typename... _TElements, typename... _UElements>
+ inline bool
+ operator>=(const tuple<_TElements...>& __t,
+ const tuple<_UElements...>& __u)
+ { return !(__t < __u); }
+
+ // NB: DR 705.
+ template<typename... _Elements>
+ inline tuple<typename __decay_and_strip<_Elements>::__type...>
+ make_tuple(_Elements&&... __args)
+ {
+ typedef tuple<typename __decay_and_strip<_Elements>::__type...>
+ __result_type;
+ return __result_type(std::forward<_Elements>(__args)...);
+ }
+
+ template<std::size_t...> struct __index_holder { };
+
+ template<std::size_t __i, typename _IdxHolder, typename... _Elements>
+ struct __index_holder_impl;
+
+ template<std::size_t __i, std::size_t... _Indexes, typename _IdxHolder,
+ typename... _Elements>
+ struct __index_holder_impl<__i, __index_holder<_Indexes...>,
+ _IdxHolder, _Elements...>
+ {
+ typedef typename __index_holder_impl<__i + 1,
+ __index_holder<_Indexes..., __i>,
+ _Elements...>::type type;
+ };
+
+ template<std::size_t __i, std::size_t... _Indexes>
+ struct __index_holder_impl<__i, __index_holder<_Indexes...> >
+ { typedef __index_holder<_Indexes...> type; };
+
+ template<typename... _Elements>
+ struct __make_index_holder
+ : __index_holder_impl<0, __index_holder<>, _Elements...> { };
+
+ template<typename... _TElements, std::size_t... _TIdx,
+ typename... _UElements, std::size_t... _UIdx>
+ inline tuple<_TElements..., _UElements...>
+ __tuple_cat_helper(const tuple<_TElements...>& __t,
+ const __index_holder<_TIdx...>&,
+ const tuple<_UElements...>& __u,
+ const __index_holder<_UIdx...>&)
+ { return tuple<_TElements..., _UElements...>(get<_TIdx>(__t)...,
+ get<_UIdx>(__u)...); }
+
+ template<typename... _TElements, std::size_t... _TIdx,
+ typename... _UElements, std::size_t... _UIdx>
+ inline tuple<_TElements..., _UElements...>
+ __tuple_cat_helper(tuple<_TElements...>&& __t,
+ const __index_holder<_TIdx...>&,
+ const tuple<_UElements...>& __u,
+ const __index_holder<_UIdx...>&)
+ { return tuple<_TElements..., _UElements...>
+ (std::move(get<_TIdx>(__t))..., get<_UIdx>(__u)...); }
+
+ template<typename... _TElements, std::size_t... _TIdx,
+ typename... _UElements, std::size_t... _UIdx>
+ inline tuple<_TElements..., _UElements...>
+ __tuple_cat_helper(const tuple<_TElements...>& __t,
+ const __index_holder<_TIdx...>&,
+ tuple<_UElements...>&& __u,
+ const __index_holder<_UIdx...>&)
+ { return tuple<_TElements..., _UElements...>
+ (get<_TIdx>(__t)..., std::move(get<_UIdx>(__u))...); }
+
+ template<typename... _TElements, std::size_t... _TIdx,
+ typename... _UElements, std::size_t... _UIdx>
+ inline tuple<_TElements..., _UElements...>
+ __tuple_cat_helper(tuple<_TElements...>&& __t,
+ const __index_holder<_TIdx...>&,
+ tuple<_UElements...>&& __u,
+ const __index_holder<_UIdx...>&)
+ { return tuple<_TElements..., _UElements...>
+ (std::move(get<_TIdx>(__t))..., std::move(get<_UIdx>(__u))...); }
+
+ template<typename... _TElements, typename... _UElements>
+ inline tuple<_TElements..., _UElements...>
+ tuple_cat(const tuple<_TElements...>& __t, const tuple<_UElements...>& __u)
+ {
+ return __tuple_cat_helper(__t, typename
+ __make_index_holder<_TElements...>::type(),
+ __u, typename
+ __make_index_holder<_UElements...>::type());
+ }
+
+ template<typename... _TElements, typename... _UElements>
+ inline tuple<_TElements..., _UElements...>
+ tuple_cat(tuple<_TElements...>&& __t, const tuple<_UElements...>& __u)
+ {
+ return __tuple_cat_helper(std::move(__t), typename
+ __make_index_holder<_TElements...>::type(),
+ __u, typename
+ __make_index_holder<_UElements...>::type());
+ }
+
+ template<typename... _TElements, typename... _UElements>
+ inline tuple<_TElements..., _UElements...>
+ tuple_cat(const tuple<_TElements...>& __t, tuple<_UElements...>&& __u)
+ {
+ return __tuple_cat_helper(__t, typename
+ __make_index_holder<_TElements...>::type(),
+ std::move(__u), typename
+ __make_index_holder<_UElements...>::type());
+ }
+
+ template<typename... _TElements, typename... _UElements>
+ inline tuple<_TElements..., _UElements...>
+ tuple_cat(tuple<_TElements...>&& __t, tuple<_UElements...>&& __u)
+ {
+ return __tuple_cat_helper(std::move(__t), typename
+ __make_index_holder<_TElements...>::type(),
+ std::move(__u), typename
+ __make_index_holder<_UElements...>::type());
+ }
+
+ template<typename... _Elements>
+ inline tuple<_Elements&...>
+ tie(_Elements&... __args)
+ { return tuple<_Elements&...>(__args...); }
+
+ template<typename... _Elements>
+ inline void
+ swap(tuple<_Elements...>& __x, tuple<_Elements...>& __y)
+ { __x.swap(__y); }
+
+ template<typename... _Elements>
+ inline void
+ swap(tuple<_Elements...>&& __x, tuple<_Elements...>& __y)
+ { __x.swap(__y); }
+
+ template<typename... _Elements>
+ inline void
+ swap(tuple<_Elements...>& __x, tuple<_Elements...>&& __y)
+ { __x.swap(__y); }
+
+ // A class (and instance) which can be used in 'tie' when an element
+ // of a tuple is not required
+ struct _Swallow_assign
+ {
+ template<class _Tp>
+ _Swallow_assign&
+ operator=(const _Tp&)
+ { return *this; }
+ };
+
+ // TODO: Put this in some kind of shared file.
+ namespace
+ {
+ _Swallow_assign ignore;
+ }; // anonymous namespace
+}
+
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+#endif // _GLIBCXX_TUPLE
diff --git a/i686-linux/include/c++/4.4.3/type_traits b/i686-linux/include/c++/4.4.3/type_traits
new file mode 100644
index 0000000..ce9ee1b
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/type_traits
@@ -0,0 +1,605 @@
+// C++0x type_traits -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/type_traits
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TYPE_TRAITS
+#define _GLIBCXX_TYPE_TRAITS 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#else
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+#endif
+
+#include <cstddef>
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/type_traits>
+#else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/type_traits>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+#endif
+
+namespace std
+{
+ /** @addtogroup metaprogramming
+ * @{
+ */
+
+ // Primary classification traits.
+
+ /// is_lvalue_reference
+ template<typename>
+ struct is_lvalue_reference
+ : public false_type { };
+
+ template<typename _Tp>
+ struct is_lvalue_reference<_Tp&>
+ : public true_type { };
+
+ /// is_rvalue_reference
+ template<typename>
+ struct is_rvalue_reference
+ : public false_type { };
+
+ template<typename _Tp>
+ struct is_rvalue_reference<_Tp&&>
+ : public true_type { };
+
+ // Secondary classification traits.
+
+ /// is_reference
+ template<typename _Tp>
+ struct is_reference
+ : public integral_constant<bool, (is_lvalue_reference<_Tp>::value
+ || is_rvalue_reference<_Tp>::value)>
+ { };
+
+ // Reference transformations.
+
+ /// remove_reference
+ template<typename _Tp>
+ struct remove_reference
+ { typedef _Tp type; };
+
+ template<typename _Tp>
+ struct remove_reference<_Tp&>
+ { typedef _Tp type; };
+
+ template<typename _Tp>
+ struct remove_reference<_Tp&&>
+ { typedef _Tp type; };
+
+ template<typename _Tp,
+ bool = !is_reference<_Tp>::value && !is_void<_Tp>::value,
+ bool = is_rvalue_reference<_Tp>::value>
+ struct __add_lvalue_reference_helper
+ { typedef _Tp type; };
+
+ template<typename _Tp>
+ struct __add_lvalue_reference_helper<_Tp, true, false>
+ { typedef _Tp& type; };
+
+ template<typename _Tp>
+ struct __add_lvalue_reference_helper<_Tp, false, true>
+ { typedef typename remove_reference<_Tp>::type& type; };
+
+ /// add_lvalue_reference
+ template<typename _Tp>
+ struct add_lvalue_reference
+ : public __add_lvalue_reference_helper<_Tp>
+ { };
+
+ template<typename _Tp,
+ bool = !is_reference<_Tp>::value && !is_void<_Tp>::value>
+ struct __add_rvalue_reference_helper
+ { typedef _Tp type; };
+
+ template<typename _Tp>
+ struct __add_rvalue_reference_helper<_Tp, true>
+ { typedef _Tp&& type; };
+
+ /// add_rvalue_reference
+ template<typename _Tp>
+ struct add_rvalue_reference
+ : public __add_rvalue_reference_helper<_Tp>
+ { };
+
+ // Scalar properties and transformations.
+
+ template<typename _Tp,
+ bool = is_integral<_Tp>::value,
+ bool = is_floating_point<_Tp>::value>
+ struct __is_signed_helper
+ : public false_type { };
+
+ template<typename _Tp>
+ struct __is_signed_helper<_Tp, false, true>
+ : public true_type { };
+
+ template<typename _Tp>
+ struct __is_signed_helper<_Tp, true, false>
+ : public integral_constant<bool, _Tp(-1) < _Tp(0)>
+ { };
+
+ /// is_signed
+ template<typename _Tp>
+ struct is_signed
+ : public integral_constant<bool, __is_signed_helper<_Tp>::value>
+ { };
+
+ /// is_unsigned
+ template<typename _Tp>
+ struct is_unsigned
+ : public integral_constant<bool, (is_arithmetic<_Tp>::value
+ && !is_signed<_Tp>::value)>
+ { };
+
+ // Member introspection.
+
+ /// is_pod
+ template<typename _Tp>
+ struct is_pod
+ : public integral_constant<bool, __is_pod(_Tp)>
+ { };
+
+ /// has_trivial_default_constructor
+ template<typename _Tp>
+ struct has_trivial_default_constructor
+ : public integral_constant<bool, __has_trivial_constructor(_Tp)>
+ { };
+
+ /// has_trivial_copy_constructor
+ template<typename _Tp>
+ struct has_trivial_copy_constructor
+ : public integral_constant<bool, __has_trivial_copy(_Tp)>
+ { };
+
+ /// has_trivial_assign
+ template<typename _Tp>
+ struct has_trivial_assign
+ : public integral_constant<bool, __has_trivial_assign(_Tp)>
+ { };
+
+ /// has_trivial_destructor
+ template<typename _Tp>
+ struct has_trivial_destructor
+ : public integral_constant<bool, __has_trivial_destructor(_Tp)>
+ { };
+
+ /// has_nothrow_default_constructor
+ template<typename _Tp>
+ struct has_nothrow_default_constructor
+ : public integral_constant<bool, __has_nothrow_constructor(_Tp)>
+ { };
+
+ /// has_nothrow_copy_constructor
+ template<typename _Tp>
+ struct has_nothrow_copy_constructor
+ : public integral_constant<bool, __has_nothrow_copy(_Tp)>
+ { };
+
+ /// has_nothrow_assign
+ template<typename _Tp>
+ struct has_nothrow_assign
+ : public integral_constant<bool, __has_nothrow_assign(_Tp)>
+ { };
+
+ /// is_base_of
+ template<typename _Base, typename _Derived>
+ struct is_base_of
+ : public integral_constant<bool, __is_base_of(_Base, _Derived)>
+ { };
+
+ // Relationships between types.
+ template<typename _From, typename _To>
+ struct __is_convertible_simple
+ : public __sfinae_types
+ {
+ private:
+ static __one __test(_To);
+ static __two __test(...);
+ static _From __makeFrom();
+
+ public:
+ static const bool __value = sizeof(__test(__makeFrom())) == 1;
+ };
+
+ template<typename _Tp>
+ struct __is_int_or_cref
+ {
+ typedef typename remove_reference<_Tp>::type __rr_Tp;
+ static const bool __value = (is_integral<_Tp>::value
+ || (is_integral<__rr_Tp>::value
+ && is_const<__rr_Tp>::value
+ && !is_volatile<__rr_Tp>::value));
+ };
+
+ template<typename _From, typename _To,
+ bool = (is_void<_From>::value || is_void<_To>::value
+ || is_function<_To>::value || is_array<_To>::value
+ // This special case is here only to avoid warnings.
+ || (is_floating_point<typename
+ remove_reference<_From>::type>::value
+ && __is_int_or_cref<_To>::__value))>
+ struct __is_convertible_helper
+ {
+ // "An imaginary lvalue of type From...".
+ static const bool __value = (__is_convertible_simple<typename
+ add_lvalue_reference<_From>::type,
+ _To>::__value);
+ };
+
+ template<typename _From, typename _To>
+ struct __is_convertible_helper<_From, _To, true>
+ { static const bool __value = (is_void<_To>::value
+ || (__is_int_or_cref<_To>::__value
+ && !is_void<_From>::value)); };
+
+ // XXX FIXME
+ // The C++0x specifications are different, see N2255.
+ /// is_convertible
+ template<typename _From, typename _To>
+ struct is_convertible
+ : public integral_constant<bool,
+ __is_convertible_helper<_From, _To>::__value>
+ { };
+
+ template<std::size_t _Len>
+ struct __aligned_storage_msa
+ {
+ union __type
+ {
+ unsigned char __data[_Len];
+ struct __attribute__((__aligned__)) { } __align;
+ };
+ };
+
+ /**
+ * @brief Alignment type.
+ *
+ * The value of _Align is a default-alignment which shall be the
+ * most stringent alignment requirement for any C++ object type
+ * whose size is no greater than _Len (3.9). The member typedef
+ * type shall be a POD type suitable for use as uninitialized
+ * storage for any object whose size is at most _Len and whose
+ * alignment is a divisor of _Align.
+ */
+ template<std::size_t _Len, std::size_t _Align =
+ __alignof__(typename __aligned_storage_msa<_Len>::__type)>
+ struct aligned_storage
+ {
+ union type
+ {
+ unsigned char __data[_Len];
+ struct __attribute__((__aligned__((_Align)))) { } __align;
+ };
+ };
+
+
+ // Define a nested type if some predicate holds.
+ // Primary template.
+ /// enable_if
+ template<bool, typename _Tp = void>
+ struct enable_if
+ { };
+
+ // Partial specialization for true.
+ template<typename _Tp>
+ struct enable_if<true, _Tp>
+ { typedef _Tp type; };
+
+
+ // A conditional expression, but for types. If true, first, if false, second.
+ // Primary template.
+ /// conditional
+ template<bool _Cond, typename _Iftrue, typename _Iffalse>
+ struct conditional
+ { typedef _Iftrue type; };
+
+ // Partial specialization for false.
+ template<typename _Iftrue, typename _Iffalse>
+ struct conditional<false, _Iftrue, _Iffalse>
+ { typedef _Iffalse type; };
+
+
+ // Decay trait for arrays and functions, used for perfect forwarding
+ // in make_pair, make_tuple, etc.
+ template<typename _Up,
+ bool _IsArray = is_array<_Up>::value,
+ bool _IsFunction = is_function<_Up>::value>
+ struct __decay_selector;
+
+ // NB: DR 705.
+ template<typename _Up>
+ struct __decay_selector<_Up, false, false>
+ { typedef typename remove_cv<_Up>::type __type; };
+
+ template<typename _Up>
+ struct __decay_selector<_Up, true, false>
+ { typedef typename remove_extent<_Up>::type* __type; };
+
+ template<typename _Up>
+ struct __decay_selector<_Up, false, true>
+ { typedef typename add_pointer<_Up>::type __type; };
+
+ /// decay
+ template<typename _Tp>
+ struct decay
+ {
+ private:
+ typedef typename remove_reference<_Tp>::type __remove_type;
+
+ public:
+ typedef typename __decay_selector<__remove_type>::__type type;
+ };
+
+
+ // Utility for constructing identically cv-qualified types.
+ template<typename _Unqualified, bool _IsConst, bool _IsVol>
+ struct __cv_selector;
+
+ template<typename _Unqualified>
+ struct __cv_selector<_Unqualified, false, false>
+ { typedef _Unqualified __type; };
+
+ template<typename _Unqualified>
+ struct __cv_selector<_Unqualified, false, true>
+ { typedef volatile _Unqualified __type; };
+
+ template<typename _Unqualified>
+ struct __cv_selector<_Unqualified, true, false>
+ { typedef const _Unqualified __type; };
+
+ template<typename _Unqualified>
+ struct __cv_selector<_Unqualified, true, true>
+ { typedef const volatile _Unqualified __type; };
+
+ template<typename _Qualified, typename _Unqualified,
+ bool _IsConst = is_const<_Qualified>::value,
+ bool _IsVol = is_volatile<_Qualified>::value>
+ struct __match_cv_qualifiers
+ {
+ private:
+ typedef __cv_selector<_Unqualified, _IsConst, _IsVol> __match;
+
+ public:
+ typedef typename __match::__type __type;
+ };
+
+
+ // Utility for finding the unsigned versions of signed integral types.
+ template<typename _Tp>
+ struct __make_unsigned
+ { typedef _Tp __type; };
+
+ template<>
+ struct __make_unsigned<char>
+ { typedef unsigned char __type; };
+
+ template<>
+ struct __make_unsigned<signed char>
+ { typedef unsigned char __type; };
+
+ template<>
+ struct __make_unsigned<short>
+ { typedef unsigned short __type; };
+
+ template<>
+ struct __make_unsigned<int>
+ { typedef unsigned int __type; };
+
+ template<>
+ struct __make_unsigned<long>
+ { typedef unsigned long __type; };
+
+ template<>
+ struct __make_unsigned<long long>
+ { typedef unsigned long long __type; };
+
+
+ // Select between integral and enum: not possible to be both.
+ template<typename _Tp,
+ bool _IsInt = is_integral<_Tp>::value,
+ bool _IsEnum = is_enum<_Tp>::value>
+ struct __make_unsigned_selector;
+
+ template<typename _Tp>
+ struct __make_unsigned_selector<_Tp, true, false>
+ {
+ private:
+ typedef __make_unsigned<typename remove_cv<_Tp>::type> __unsignedt;
+ typedef typename __unsignedt::__type __unsigned_type;
+ typedef __match_cv_qualifiers<_Tp, __unsigned_type> __cv_unsigned;
+
+ public:
+ typedef typename __cv_unsigned::__type __type;
+ };
+
+ template<typename _Tp>
+ struct __make_unsigned_selector<_Tp, false, true>
+ {
+ private:
+ // With -fshort-enums, an enum may be as small as a char.
+ typedef unsigned char __smallest;
+ static const bool __b0 = sizeof(_Tp) <= sizeof(__smallest);
+ static const bool __b1 = sizeof(_Tp) <= sizeof(unsigned short);
+ static const bool __b2 = sizeof(_Tp) <= sizeof(unsigned int);
+ typedef conditional<__b2, unsigned int, unsigned long> __cond2;
+ typedef typename __cond2::type __cond2_type;
+ typedef conditional<__b1, unsigned short, __cond2_type> __cond1;
+ typedef typename __cond1::type __cond1_type;
+
+ public:
+ typedef typename conditional<__b0, __smallest, __cond1_type>::type __type;
+ };
+
+ // Given an integral/enum type, return the corresponding unsigned
+ // integer type.
+ // Primary template.
+ /// make_unsigned
+ template<typename _Tp>
+ struct make_unsigned
+ { typedef typename __make_unsigned_selector<_Tp>::__type type; };
+
+ // Integral, but don't define.
+ template<>
+ struct make_unsigned<bool>;
+
+
+ // Utility for finding the signed versions of unsigned integral types.
+ template<typename _Tp>
+ struct __make_signed
+ { typedef _Tp __type; };
+
+ template<>
+ struct __make_signed<char>
+ { typedef signed char __type; };
+
+ template<>
+ struct __make_signed<unsigned char>
+ { typedef signed char __type; };
+
+ template<>
+ struct __make_signed<unsigned short>
+ { typedef signed short __type; };
+
+ template<>
+ struct __make_signed<unsigned int>
+ { typedef signed int __type; };
+
+ template<>
+ struct __make_signed<unsigned long>
+ { typedef signed long __type; };
+
+ template<>
+ struct __make_signed<unsigned long long>
+ { typedef signed long long __type; };
+
+
+ // Select between integral and enum: not possible to be both.
+ template<typename _Tp,
+ bool _IsInt = is_integral<_Tp>::value,
+ bool _IsEnum = is_enum<_Tp>::value>
+ struct __make_signed_selector;
+
+ template<typename _Tp>
+ struct __make_signed_selector<_Tp, true, false>
+ {
+ private:
+ typedef __make_signed<typename remove_cv<_Tp>::type> __signedt;
+ typedef typename __signedt::__type __signed_type;
+ typedef __match_cv_qualifiers<_Tp, __signed_type> __cv_signed;
+
+ public:
+ typedef typename __cv_signed::__type __type;
+ };
+
+ template<typename _Tp>
+ struct __make_signed_selector<_Tp, false, true>
+ {
+ private:
+ // With -fshort-enums, an enum may be as small as a char.
+ typedef signed char __smallest;
+ static const bool __b0 = sizeof(_Tp) <= sizeof(__smallest);
+ static const bool __b1 = sizeof(_Tp) <= sizeof(signed short);
+ static const bool __b2 = sizeof(_Tp) <= sizeof(signed int);
+ typedef conditional<__b2, signed int, signed long> __cond2;
+ typedef typename __cond2::type __cond2_type;
+ typedef conditional<__b1, signed short, __cond2_type> __cond1;
+ typedef typename __cond1::type __cond1_type;
+
+ public:
+ typedef typename conditional<__b0, __smallest, __cond1_type>::type __type;
+ };
+
+ // Given an integral/enum type, return the corresponding signed
+ // integer type.
+ // Primary template.
+ /// make_signed
+ template<typename _Tp>
+ struct make_signed
+ { typedef typename __make_signed_selector<_Tp>::__type type; };
+
+ // Integral, but don't define.
+ template<>
+ struct make_signed<bool>;
+
+ /// common_type
+ template<typename... _Tp>
+ struct common_type;
+
+ template<typename _Tp>
+ struct common_type<_Tp>
+ {
+ static_assert(sizeof(_Tp) > 0, "must be complete type");
+ typedef _Tp type;
+ };
+
+ template<typename _Tp, typename _Up>
+ class common_type<_Tp, _Up>
+ {
+ static_assert(sizeof(_Tp) > 0, "must be complete type");
+ static_assert(sizeof(_Up) > 0, "must be complete type");
+
+ static _Tp&& __t();
+ static _Up&& __u();
+
+ // HACK: Prevents optimization of ?: in the decltype
+ // expression when the condition is the literal, "true".
+ // See, PR36628.
+ static bool __true_or_false();
+
+ public:
+ typedef decltype(__true_or_false() ? __t() : __u()) type;
+ };
+
+ template<typename _Tp, typename _Up, typename... _Vp>
+ struct common_type<_Tp, _Up, _Vp...>
+ {
+ typedef typename
+ common_type<typename common_type<_Tp, _Up>::type, _Vp...>::type type;
+ };
+
+ // @} group metaprogramming
+}
+
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+#endif // _GLIBCXX_TYPE_TRAITS
+
diff --git a/i686-linux/include/c++/4.4.3/typeinfo b/i686-linux/include/c++/4.4.3/typeinfo
new file mode 100644
index 0000000..eea38e7
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/typeinfo
@@ -0,0 +1,196 @@
+// RTTI support for -*- C++ -*-
+// Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+// 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation
+//
+// This file is part of GCC.
+//
+// GCC is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// GCC is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file typeinfo
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _TYPEINFO
+#define _TYPEINFO
+
+#include <exception>
+
+#pragma GCC visibility push(default)
+
+extern "C++" {
+
+namespace __cxxabiv1
+{
+ class __class_type_info;
+} // namespace __cxxabiv1
+
+// Determine whether typeinfo names for the same type are merged (in which
+// case comparison can just compare pointers) or not (in which case
+// strings must be compared and g++.dg/abi/local1.C will fail), and
+// whether comparison is to be implemented inline or not. By default we
+// use inline pointer comparison if weak symbols are available, and
+// out-of-line strcmp if not. Out-of-line pointer comparison is used
+// where the object files are to be portable to multiple systems, some of
+// which may not be able to use pointer comparison, but the particular
+// system for which libstdc++ is being built can use pointer comparison;
+// in particular for most ARM EABI systems, where the ABI specifies
+// out-of-line comparison. Inline strcmp is not currently supported. The
+// compiler's target configuration can override the defaults by defining
+// __GXX_TYPEINFO_EQUALITY_INLINE to 1 or 0 to indicate whether or not
+// comparison is inline, and __GXX_MERGED_TYPEINFO_NAMES to 1 or 0 to
+// indicate whether or not pointer comparison can be used.
+
+#ifndef __GXX_MERGED_TYPEINFO_NAMES
+ #if !__GXX_WEAK__
+ // If weak symbols are not supported, typeinfo names are not merged.
+ #define __GXX_MERGED_TYPEINFO_NAMES 0
+ #else
+ // On platforms that support weak symbols, typeinfo names are merged.
+ #define __GXX_MERGED_TYPEINFO_NAMES 1
+ #endif
+#endif
+
+// By default follow the same rules as for __GXX_MERGED_TYPEINFO_NAMES.
+#ifndef __GXX_TYPEINFO_EQUALITY_INLINE
+ #if !__GXX_WEAK__
+ #define __GXX_TYPEINFO_EQUALITY_INLINE 0
+ #else
+ #define __GXX_TYPEINFO_EQUALITY_INLINE 1
+ #endif
+#endif
+
+namespace std
+{
+ /**
+ * @brief Part of RTTI.
+ *
+ * The @c type_info class describes type information generated by
+ * an implementation.
+ */
+ class type_info
+ {
+ public:
+ /** Destructor first. Being the first non-inline virtual function, this
+ * controls in which translation unit the vtable is emitted. The
+ * compiler makes use of that information to know where to emit
+ * the runtime-mandated type_info structures in the new-abi. */
+ virtual ~type_info();
+
+ /** Returns an @e implementation-defined byte string; this is not
+ * portable between compilers! */
+ const char* name() const
+ { return __name; }
+
+#if !__GXX_TYPEINFO_EQUALITY_INLINE
+ bool before(const type_info& __arg) const;
+
+ // In old abi, or when weak symbols are not supported, there can
+ // be multiple instances of a type_info object for one
+ // type. Uniqueness must use the _name value, not object address.
+ bool operator==(const type_info& __arg) const;
+#else
+ #if !__GXX_MERGED_TYPEINFO_NAMES
+ #error "Inline implementation of type_info comparision requires merging of type_info objects"
+ #endif
+ /** Returns true if @c *this precedes @c __arg in the implementation's
+ * collation order. */
+ // In new abi we can rely on type_info's NTBS being unique,
+ // and therefore address comparisons are sufficient.
+ bool before(const type_info& __arg) const
+ { return __name < __arg.__name; }
+
+ bool operator==(const type_info& __arg) const
+ { return __name == __arg.__name; }
+#endif
+ bool operator!=(const type_info& __arg) const
+ { return !operator==(__arg); }
+
+ // Return true if this is a pointer type of some kind
+ virtual bool __is_pointer_p() const;
+
+ // Return true if this is a function type
+ virtual bool __is_function_p() const;
+
+ // Try and catch a thrown type. Store an adjusted pointer to the
+ // caught type in THR_OBJ. If THR_TYPE is not a pointer type, then
+ // THR_OBJ points to the thrown object. If THR_TYPE is a pointer
+ // type, then THR_OBJ is the pointer itself. OUTER indicates the
+ // number of outer pointers, and whether they were const
+ // qualified.
+ virtual bool __do_catch(const type_info *__thr_type, void **__thr_obj,
+ unsigned __outer) const;
+
+ // Internally used during catch matching
+ virtual bool __do_upcast(const __cxxabiv1::__class_type_info *__target,
+ void **__obj_ptr) const;
+
+ protected:
+ const char *__name;
+
+ explicit type_info(const char *__n): __name(__n) { }
+
+ private:
+ /// Assigning type_info is not supported.
+ type_info& operator=(const type_info&);
+ type_info(const type_info&);
+ };
+
+ /**
+ * @brief Thrown during incorrect typecasting.
+ * @ingroup exceptions
+ *
+ * If you attempt an invalid @c dynamic_cast expression, an instance of
+ * this class (or something derived from this class) is thrown. */
+ class bad_cast : public exception
+ {
+ public:
+ bad_cast() throw() { }
+
+ // This declaration is not useless:
+ // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118
+ virtual ~bad_cast() throw();
+
+ // See comment in eh_exception.cc.
+ virtual const char* what() const throw();
+ };
+
+ /**
+ * @brief Thrown when a NULL pointer in a @c typeid expression is used.
+ * @ingroup exceptions
+ */
+ class bad_typeid : public exception
+ {
+ public:
+ bad_typeid () throw() { }
+
+ // This declaration is not useless:
+ // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118
+ virtual ~bad_typeid() throw();
+
+ // See comment in eh_exception.cc.
+ virtual const char* what() const throw();
+ };
+} // namespace std
+
+#pragma GCC visibility pop
+
+} // extern "C++"
+#endif
diff --git a/i686-linux/include/c++/4.4.3/unordered_map b/i686-linux/include/c++/4.4.3/unordered_map
new file mode 100644
index 0000000..56906d2
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/unordered_map
@@ -0,0 +1,78 @@
+// <unordered_map> -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/unordered_map
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_UNORDERED_MAP
+#define _GLIBCXX_UNORDERED_MAP 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#else
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+#endif
+
+#include <utility>
+#include <type_traits>
+#include <initializer_list>
+#include <bits/stl_algobase.h>
+#include <bits/allocator.h>
+#include <bits/stl_function.h> // equal_to, _Identity, _Select1st
+#include <bits/stringfwd.h>
+#include <bits/functional_hash.h>
+#include <bits/hashtable.h>
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/unordered_map>
+#else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+#if defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_PARALLEL)
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace _GLIBCXX_STD_D {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 _GLIBCXX_STD_D
+#else
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+#endif
+# include <tr1_impl/unordered_map>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+#endif
+
+#ifdef _GLIBCXX_DEBUG
+# include <debug/unordered_map>
+#endif
+
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+#endif // _GLIBCXX_UNORDERED_MAP
diff --git a/i686-linux/include/c++/4.4.3/unordered_set b/i686-linux/include/c++/4.4.3/unordered_set
new file mode 100644
index 0000000..880f3be
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/unordered_set
@@ -0,0 +1,78 @@
+// <unordered_set> -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/unordered_set
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_UNORDERED_SET
+#define _GLIBCXX_UNORDERED_SET 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#else
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+#endif
+
+#include <utility>
+#include <type_traits>
+#include <initializer_list>
+#include <bits/stl_algobase.h>
+#include <bits/allocator.h>
+#include <bits/stl_function.h> // equal_to, _Identity, _Select1st
+#include <bits/stringfwd.h>
+#include <bits/functional_hash.h>
+#include <bits/hashtable.h>
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/unordered_set>
+#else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+#if defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_PARALLEL)
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace _GLIBCXX_STD_D {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 _GLIBCXX_STD_D
+#else
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+#endif
+# include <tr1_impl/unordered_set>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+#endif
+
+#ifdef _GLIBCXX_DEBUG
+# include <debug/unordered_set>
+#endif
+
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+#endif // _GLIBCXX_UNORDERED_SET
diff --git a/i686-linux/include/c++/4.4.3/utility b/i686-linux/include/c++/4.4.3/utility
new file mode 100644
index 0000000..1a6d0b1
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/utility
@@ -0,0 +1,94 @@
+// <utility> -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file include/utility
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_UTILITY
+#define _GLIBCXX_UTILITY 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <bits/stl_relops.h>
+#include <bits/stl_pair.h>
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+# endif
+# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/utility>
+# else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/utility>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+# endif
+# include <bits/move.h>
+# include <initializer_list>
+#endif
+
+/**
+ * @defgroup utilities Utilities
+ *
+ * Components deemed generally useful. Includes pair, tuple,
+ * forward/move helpers, ratio, function object, metaprogramming and
+ * type traits, time, date, and memory functions.
+ */
+
+#endif /* _GLIBCXX_UTILITY */
diff --git a/i686-linux/include/c++/4.4.3/valarray b/i686-linux/include/c++/4.4.3/valarray
new file mode 100644
index 0000000..43e8d20
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/valarray
@@ -0,0 +1,1087 @@
+// The template and inlines for the -*- C++ -*- valarray class.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file valarray
+ * This is a Standard C++ Library header.
+ */
+
+// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
+
+#ifndef _GLIBCXX_VALARRAY
+#define _GLIBCXX_VALARRAY 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <cstddef>
+#include <cmath>
+#include <algorithm>
+#include <debug/debug.h>
+#include <initializer_list>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<class _Clos, typename _Tp>
+ class _Expr;
+
+ template<typename _Tp1, typename _Tp2>
+ class _ValArray;
+
+ template<class _Oper, template<class, class> class _Meta, class _Dom>
+ struct _UnClos;
+
+ template<class _Oper,
+ template<class, class> class _Meta1,
+ template<class, class> class _Meta2,
+ class _Dom1, class _Dom2>
+ class _BinClos;
+
+ template<template<class, class> class _Meta, class _Dom>
+ class _SClos;
+
+ template<template<class, class> class _Meta, class _Dom>
+ class _GClos;
+
+ template<template<class, class> class _Meta, class _Dom>
+ class _IClos;
+
+ template<template<class, class> class _Meta, class _Dom>
+ class _ValFunClos;
+
+ template<template<class, class> class _Meta, class _Dom>
+ class _RefFunClos;
+
+ template<class _Tp> class valarray; // An array of type _Tp
+ class slice; // BLAS-like slice out of an array
+ template<class _Tp> class slice_array;
+ class gslice; // generalized slice out of an array
+ template<class _Tp> class gslice_array;
+ template<class _Tp> class mask_array; // masked array
+ template<class _Tp> class indirect_array; // indirected array
+
+_GLIBCXX_END_NAMESPACE
+
+#include <bits/valarray_array.h>
+#include <bits/valarray_before.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @defgroup numeric_arrays Numeric Arrays
+ * @ingroup numerics
+ *
+ * Classes and functions for representing and manipulating arrays of elements.
+ * @{
+ */
+
+ /**
+ * @brief Smart array designed to support numeric processing.
+ *
+ * A valarray is an array that provides constraints intended to allow for
+ * effective optimization of numeric array processing by reducing the
+ * aliasing that can result from pointer representations. It represents a
+ * one-dimensional array from which different multidimensional subsets can
+ * be accessed and modified.
+ *
+ * @param Tp Type of object in the array.
+ */
+ template<class _Tp>
+ class valarray
+ {
+ template<class _Op>
+ struct _UnaryOp
+ {
+ typedef typename __fun<_Op, _Tp>::result_type __rt;
+ typedef _Expr<_UnClos<_Op, _ValArray, _Tp>, __rt> _Rt;
+ };
+ public:
+ typedef _Tp value_type;
+
+ // _lib.valarray.cons_ construct/destroy:
+ /// Construct an empty array.
+ valarray();
+
+ /// Construct an array with @a n elements.
+ explicit valarray(size_t);
+
+ /// Construct an array with @a n elements initialized to @a t.
+ valarray(const _Tp&, size_t);
+
+ /// Construct an array initialized to the first @a n elements of @a t.
+ valarray(const _Tp* __restrict__, size_t);
+
+ /// Copy constructor.
+ valarray(const valarray&);
+
+ /// Construct an array with the same size and values in @a sa.
+ valarray(const slice_array<_Tp>&);
+
+ /// Construct an array with the same size and values in @a ga.
+ valarray(const gslice_array<_Tp>&);
+
+ /// Construct an array with the same size and values in @a ma.
+ valarray(const mask_array<_Tp>&);
+
+ /// Construct an array with the same size and values in @a ia.
+ valarray(const indirect_array<_Tp>&);
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /// Construct an array with an initializer_list of values.
+ valarray(initializer_list<_Tp>);
+#endif
+
+ template<class _Dom>
+ valarray(const _Expr<_Dom, _Tp>& __e);
+
+ ~valarray();
+
+ // _lib.valarray.assign_ assignment:
+ /**
+ * @brief Assign elements to an array.
+ *
+ * Assign elements of array to values in @a v. Results are undefined
+ * if @a v does not have the same size as this array.
+ *
+ * @param v Valarray to get values from.
+ */
+ valarray<_Tp>& operator=(const valarray<_Tp>&);
+
+ /**
+ * @brief Assign elements to a value.
+ *
+ * Assign all elements of array to @a t.
+ *
+ * @param t Value for elements.
+ */
+ valarray<_Tp>& operator=(const _Tp&);
+
+ /**
+ * @brief Assign elements to an array subset.
+ *
+ * Assign elements of array to values in @a sa. Results are undefined
+ * if @a sa does not have the same size as this array.
+ *
+ * @param sa Array slice to get values from.
+ */
+ valarray<_Tp>& operator=(const slice_array<_Tp>&);
+
+ /**
+ * @brief Assign elements to an array subset.
+ *
+ * Assign elements of array to values in @a ga. Results are undefined
+ * if @a ga does not have the same size as this array.
+ *
+ * @param ga Array slice to get values from.
+ */
+ valarray<_Tp>& operator=(const gslice_array<_Tp>&);
+
+ /**
+ * @brief Assign elements to an array subset.
+ *
+ * Assign elements of array to values in @a ma. Results are undefined
+ * if @a ma does not have the same size as this array.
+ *
+ * @param ma Array slice to get values from.
+ */
+ valarray<_Tp>& operator=(const mask_array<_Tp>&);
+
+ /**
+ * @brief Assign elements to an array subset.
+ *
+ * Assign elements of array to values in @a ia. Results are undefined
+ * if @a ia does not have the same size as this array.
+ *
+ * @param ia Array slice to get values from.
+ */
+ valarray<_Tp>& operator=(const indirect_array<_Tp>&);
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Assign elements to an initializer_list.
+ *
+ * Assign elements of array to values in @a l. Results are undefined
+ * if @a l does not have the same size as this array.
+ *
+ * @param l initializer_list to get values from.
+ */
+ valarray& operator=(initializer_list<_Tp>);
+#endif
+
+ template<class _Dom> valarray<_Tp>&
+ operator= (const _Expr<_Dom, _Tp>&);
+
+ // _lib.valarray.access_ element access:
+ /**
+ * Return a reference to the i'th array element.
+ *
+ * @param i Index of element to return.
+ * @return Reference to the i'th element.
+ */
+ _Tp& operator[](size_t);
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 389. Const overload of valarray::operator[] returns by value.
+ const _Tp& operator[](size_t) const;
+
+ // _lib.valarray.sub_ subset operations:
+ /**
+ * @brief Return an array subset.
+ *
+ * Returns a new valarray containing the elements of the array
+ * indicated by the slice argument. The new valarray has the same size
+ * as the input slice. @see slice.
+ *
+ * @param s The source slice.
+ * @return New valarray containing elements in @a s.
+ */
+ _Expr<_SClos<_ValArray, _Tp>, _Tp> operator[](slice) const;
+
+ /**
+ * @brief Return a reference to an array subset.
+ *
+ * Returns a new valarray containing the elements of the array
+ * indicated by the slice argument. The new valarray has the same size
+ * as the input slice. @see slice.
+ *
+ * @param s The source slice.
+ * @return New valarray containing elements in @a s.
+ */
+ slice_array<_Tp> operator[](slice);
+
+ /**
+ * @brief Return an array subset.
+ *
+ * Returns a slice_array referencing the elements of the array
+ * indicated by the slice argument. @see gslice.
+ *
+ * @param s The source slice.
+ * @return Slice_array referencing elements indicated by @a s.
+ */
+ _Expr<_GClos<_ValArray, _Tp>, _Tp> operator[](const gslice&) const;
+
+ /**
+ * @brief Return a reference to an array subset.
+ *
+ * Returns a new valarray containing the elements of the array
+ * indicated by the gslice argument. The new valarray has
+ * the same size as the input gslice. @see gslice.
+ *
+ * @param s The source gslice.
+ * @return New valarray containing elements in @a s.
+ */
+ gslice_array<_Tp> operator[](const gslice&);
+
+ /**
+ * @brief Return an array subset.
+ *
+ * Returns a new valarray containing the elements of the array
+ * indicated by the argument. The input is a valarray of bool which
+ * represents a bitmask indicating which elements should be copied into
+ * the new valarray. Each element of the array is added to the return
+ * valarray if the corresponding element of the argument is true.
+ *
+ * @param m The valarray bitmask.
+ * @return New valarray containing elements indicated by @a m.
+ */
+ valarray<_Tp> operator[](const valarray<bool>&) const;
+
+ /**
+ * @brief Return a reference to an array subset.
+ *
+ * Returns a new mask_array referencing the elements of the array
+ * indicated by the argument. The input is a valarray of bool which
+ * represents a bitmask indicating which elements are part of the
+ * subset. Elements of the array are part of the subset if the
+ * corresponding element of the argument is true.
+ *
+ * @param m The valarray bitmask.
+ * @return New valarray containing elements indicated by @a m.
+ */
+ mask_array<_Tp> operator[](const valarray<bool>&);
+
+ /**
+ * @brief Return an array subset.
+ *
+ * Returns a new valarray containing the elements of the array
+ * indicated by the argument. The elements in the argument are
+ * interpreted as the indices of elements of this valarray to copy to
+ * the return valarray.
+ *
+ * @param i The valarray element index list.
+ * @return New valarray containing elements in @a s.
+ */
+ _Expr<_IClos<_ValArray, _Tp>, _Tp>
+ operator[](const valarray<size_t>&) const;
+
+ /**
+ * @brief Return a reference to an array subset.
+ *
+ * Returns an indirect_array referencing the elements of the array
+ * indicated by the argument. The elements in the argument are
+ * interpreted as the indices of elements of this valarray to include
+ * in the subset. The returned indirect_array refers to these
+ * elements.
+ *
+ * @param i The valarray element index list.
+ * @return Indirect_array referencing elements in @a i.
+ */
+ indirect_array<_Tp> operator[](const valarray<size_t>&);
+
+ // _lib.valarray.unary_ unary operators:
+ /// Return a new valarray by applying unary + to each element.
+ typename _UnaryOp<__unary_plus>::_Rt operator+() const;
+
+ /// Return a new valarray by applying unary - to each element.
+ typename _UnaryOp<__negate>::_Rt operator-() const;
+
+ /// Return a new valarray by applying unary ~ to each element.
+ typename _UnaryOp<__bitwise_not>::_Rt operator~() const;
+
+ /// Return a new valarray by applying unary ! to each element.
+ typename _UnaryOp<__logical_not>::_Rt operator!() const;
+
+ // _lib.valarray.cassign_ computed assignment:
+ /// Multiply each element of array by @a t.
+ valarray<_Tp>& operator*=(const _Tp&);
+
+ /// Divide each element of array by @a t.
+ valarray<_Tp>& operator/=(const _Tp&);
+
+ /// Set each element e of array to e % @a t.
+ valarray<_Tp>& operator%=(const _Tp&);
+
+ /// Add @a t to each element of array.
+ valarray<_Tp>& operator+=(const _Tp&);
+
+ /// Subtract @a t to each element of array.
+ valarray<_Tp>& operator-=(const _Tp&);
+
+ /// Set each element e of array to e ^ @a t.
+ valarray<_Tp>& operator^=(const _Tp&);
+
+ /// Set each element e of array to e & @a t.
+ valarray<_Tp>& operator&=(const _Tp&);
+
+ /// Set each element e of array to e | @a t.
+ valarray<_Tp>& operator|=(const _Tp&);
+
+ /// Left shift each element e of array by @a t bits.
+ valarray<_Tp>& operator<<=(const _Tp&);
+
+ /// Right shift each element e of array by @a t bits.
+ valarray<_Tp>& operator>>=(const _Tp&);
+
+ /// Multiply elements of array by corresponding elements of @a v.
+ valarray<_Tp>& operator*=(const valarray<_Tp>&);
+
+ /// Divide elements of array by corresponding elements of @a v.
+ valarray<_Tp>& operator/=(const valarray<_Tp>&);
+
+ /// Modulo elements of array by corresponding elements of @a v.
+ valarray<_Tp>& operator%=(const valarray<_Tp>&);
+
+ /// Add corresponding elements of @a v to elements of array.
+ valarray<_Tp>& operator+=(const valarray<_Tp>&);
+
+ /// Subtract corresponding elements of @a v from elements of array.
+ valarray<_Tp>& operator-=(const valarray<_Tp>&);
+
+ /// Logical xor corresponding elements of @a v with elements of array.
+ valarray<_Tp>& operator^=(const valarray<_Tp>&);
+
+ /// Logical or corresponding elements of @a v with elements of array.
+ valarray<_Tp>& operator|=(const valarray<_Tp>&);
+
+ /// Logical and corresponding elements of @a v with elements of array.
+ valarray<_Tp>& operator&=(const valarray<_Tp>&);
+
+ /// Left shift elements of array by corresponding elements of @a v.
+ valarray<_Tp>& operator<<=(const valarray<_Tp>&);
+
+ /// Right shift elements of array by corresponding elements of @a v.
+ valarray<_Tp>& operator>>=(const valarray<_Tp>&);
+
+ template<class _Dom>
+ valarray<_Tp>& operator*=(const _Expr<_Dom, _Tp>&);
+ template<class _Dom>
+ valarray<_Tp>& operator/=(const _Expr<_Dom, _Tp>&);
+ template<class _Dom>
+ valarray<_Tp>& operator%=(const _Expr<_Dom, _Tp>&);
+ template<class _Dom>
+ valarray<_Tp>& operator+=(const _Expr<_Dom, _Tp>&);
+ template<class _Dom>
+ valarray<_Tp>& operator-=(const _Expr<_Dom, _Tp>&);
+ template<class _Dom>
+ valarray<_Tp>& operator^=(const _Expr<_Dom, _Tp>&);
+ template<class _Dom>
+ valarray<_Tp>& operator|=(const _Expr<_Dom, _Tp>&);
+ template<class _Dom>
+ valarray<_Tp>& operator&=(const _Expr<_Dom, _Tp>&);
+ template<class _Dom>
+ valarray<_Tp>& operator<<=(const _Expr<_Dom, _Tp>&);
+ template<class _Dom>
+ valarray<_Tp>& operator>>=(const _Expr<_Dom, _Tp>&);
+
+ // _lib.valarray.members_ member functions:
+ /// Return the number of elements in array.
+ size_t size() const;
+
+ /**
+ * @brief Return the sum of all elements in the array.
+ *
+ * Accumulates the sum of all elements into a Tp using +=. The order
+ * of adding the elements is unspecified.
+ */
+ _Tp sum() const;
+
+ /// Return the minimum element using operator<().
+ _Tp min() const;
+
+ /// Return the maximum element using operator<().
+ _Tp max() const;
+
+ /**
+ * @brief Return a shifted array.
+ *
+ * A new valarray is constructed as a copy of this array with elements
+ * in shifted positions. For an element with index i, the new position
+ * is i - n. The new valarray has the same size as the current one.
+ * New elements without a value are set to 0. Elements whose new
+ * position is outside the bounds of the array are discarded.
+ *
+ * Positive arguments shift toward index 0, discarding elements [0, n).
+ * Negative arguments discard elements from the top of the array.
+ *
+ * @param n Number of element positions to shift.
+ * @return New valarray with elements in shifted positions.
+ */
+ valarray<_Tp> shift (int) const;
+
+ /**
+ * @brief Return a rotated array.
+ *
+ * A new valarray is constructed as a copy of this array with elements
+ * in shifted positions. For an element with index i, the new position
+ * is (i - n) % size(). The new valarray has the same size as the
+ * current one. Elements that are shifted beyond the array bounds are
+ * shifted into the other end of the array. No elements are lost.
+ *
+ * Positive arguments shift toward index 0, wrapping around the top.
+ * Negative arguments shift towards the top, wrapping around to 0.
+ *
+ * @param n Number of element positions to rotate.
+ * @return New valarray with elements in shifted positions.
+ */
+ valarray<_Tp> cshift(int) const;
+
+ /**
+ * @brief Apply a function to the array.
+ *
+ * Returns a new valarray with elements assigned to the result of
+ * applying func to the corresponding element of this array. The new
+ * array has the same size as this one.
+ *
+ * @param func Function of Tp returning Tp to apply.
+ * @return New valarray with transformed elements.
+ */
+ _Expr<_ValFunClos<_ValArray, _Tp>, _Tp> apply(_Tp func(_Tp)) const;
+
+ /**
+ * @brief Apply a function to the array.
+ *
+ * Returns a new valarray with elements assigned to the result of
+ * applying func to the corresponding element of this array. The new
+ * array has the same size as this one.
+ *
+ * @param func Function of const Tp& returning Tp to apply.
+ * @return New valarray with transformed elements.
+ */
+ _Expr<_RefFunClos<_ValArray, _Tp>, _Tp> apply(_Tp func(const _Tp&)) const;
+
+ /**
+ * @brief Resize array.
+ *
+ * Resize this array to @a size and set all elements to @a c. All
+ * references and iterators are invalidated.
+ *
+ * @param size New array size.
+ * @param c New value for all elements.
+ */
+ void resize(size_t __size, _Tp __c = _Tp());
+
+ private:
+ size_t _M_size;
+ _Tp* __restrict__ _M_data;
+
+ friend class _Array<_Tp>;
+ };
+
+ template<typename _Tp>
+ inline const _Tp&
+ valarray<_Tp>::operator[](size_t __i) const
+ {
+ __glibcxx_requires_subscript(__i);
+ return _M_data[__i];
+ }
+
+ template<typename _Tp>
+ inline _Tp&
+ valarray<_Tp>::operator[](size_t __i)
+ {
+ __glibcxx_requires_subscript(__i);
+ return _M_data[__i];
+ }
+
+ // @} group numeric_arrays
+
+_GLIBCXX_END_NAMESPACE
+
+#include <bits/valarray_after.h>
+#include <bits/slice_array.h>
+#include <bits/gslice.h>
+#include <bits/gslice_array.h>
+#include <bits/mask_array.h>
+#include <bits/indirect_array.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @addtogroup numeric_arrays
+ * @{
+ */
+
+ template<typename _Tp>
+ inline
+ valarray<_Tp>::valarray() : _M_size(0), _M_data(0) {}
+
+ template<typename _Tp>
+ inline
+ valarray<_Tp>::valarray(size_t __n)
+ : _M_size(__n), _M_data(__valarray_get_storage<_Tp>(__n))
+ { std::__valarray_default_construct(_M_data, _M_data + __n); }
+
+ template<typename _Tp>
+ inline
+ valarray<_Tp>::valarray(const _Tp& __t, size_t __n)
+ : _M_size(__n), _M_data(__valarray_get_storage<_Tp>(__n))
+ { std::__valarray_fill_construct(_M_data, _M_data + __n, __t); }
+
+ template<typename _Tp>
+ inline
+ valarray<_Tp>::valarray(const _Tp* __restrict__ __p, size_t __n)
+ : _M_size(__n), _M_data(__valarray_get_storage<_Tp>(__n))
+ {
+ _GLIBCXX_DEBUG_ASSERT(__p != 0 || __n == 0);
+ std::__valarray_copy_construct(__p, __p + __n, _M_data);
+ }
+
+ template<typename _Tp>
+ inline
+ valarray<_Tp>::valarray(const valarray<_Tp>& __v)
+ : _M_size(__v._M_size), _M_data(__valarray_get_storage<_Tp>(__v._M_size))
+ { std::__valarray_copy_construct(__v._M_data, __v._M_data + _M_size,
+ _M_data); }
+
+ template<typename _Tp>
+ inline
+ valarray<_Tp>::valarray(const slice_array<_Tp>& __sa)
+ : _M_size(__sa._M_sz), _M_data(__valarray_get_storage<_Tp>(__sa._M_sz))
+ {
+ std::__valarray_copy_construct
+ (__sa._M_array, __sa._M_sz, __sa._M_stride, _Array<_Tp>(_M_data));
+ }
+
+ template<typename _Tp>
+ inline
+ valarray<_Tp>::valarray(const gslice_array<_Tp>& __ga)
+ : _M_size(__ga._M_index.size()),
+ _M_data(__valarray_get_storage<_Tp>(_M_size))
+ {
+ std::__valarray_copy_construct
+ (__ga._M_array, _Array<size_t>(__ga._M_index),
+ _Array<_Tp>(_M_data), _M_size);
+ }
+
+ template<typename _Tp>
+ inline
+ valarray<_Tp>::valarray(const mask_array<_Tp>& __ma)
+ : _M_size(__ma._M_sz), _M_data(__valarray_get_storage<_Tp>(__ma._M_sz))
+ {
+ std::__valarray_copy_construct
+ (__ma._M_array, __ma._M_mask, _Array<_Tp>(_M_data), _M_size);
+ }
+
+ template<typename _Tp>
+ inline
+ valarray<_Tp>::valarray(const indirect_array<_Tp>& __ia)
+ : _M_size(__ia._M_sz), _M_data(__valarray_get_storage<_Tp>(__ia._M_sz))
+ {
+ std::__valarray_copy_construct
+ (__ia._M_array, __ia._M_index, _Array<_Tp>(_M_data), _M_size);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp>
+ inline
+ valarray<_Tp>::valarray(initializer_list<_Tp> __l)
+ : _M_size(__l.size()), _M_data(__valarray_get_storage<_Tp>(__l.size()))
+ { std::__valarray_copy_construct (__l.begin(), __l.end(), _M_data); }
+#endif
+
+ template<typename _Tp> template<class _Dom>
+ inline
+ valarray<_Tp>::valarray(const _Expr<_Dom, _Tp>& __e)
+ : _M_size(__e.size()), _M_data(__valarray_get_storage<_Tp>(_M_size))
+ { std::__valarray_copy_construct(__e, _M_size, _Array<_Tp>(_M_data)); }
+
+ template<typename _Tp>
+ inline
+ valarray<_Tp>::~valarray()
+ {
+ std::__valarray_destroy_elements(_M_data, _M_data + _M_size);
+ std::__valarray_release_memory(_M_data);
+ }
+
+ template<typename _Tp>
+ inline valarray<_Tp>&
+ valarray<_Tp>::operator=(const valarray<_Tp>& __v)
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_size == __v._M_size);
+ std::__valarray_copy(__v._M_data, _M_size, _M_data);
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp>
+ inline valarray<_Tp>&
+ valarray<_Tp>::operator=(initializer_list<_Tp> __l)
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_size == __l.size());
+ std::__valarray_copy(__l.begin(), __l.size(), _M_data);
+ return *this;
+ }
+#endif
+
+ template<typename _Tp>
+ inline valarray<_Tp>&
+ valarray<_Tp>::operator=(const _Tp& __t)
+ {
+ std::__valarray_fill(_M_data, _M_size, __t);
+ return *this;
+ }
+
+ template<typename _Tp>
+ inline valarray<_Tp>&
+ valarray<_Tp>::operator=(const slice_array<_Tp>& __sa)
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_size == __sa._M_sz);
+ std::__valarray_copy(__sa._M_array, __sa._M_sz,
+ __sa._M_stride, _Array<_Tp>(_M_data));
+ return *this;
+ }
+
+ template<typename _Tp>
+ inline valarray<_Tp>&
+ valarray<_Tp>::operator=(const gslice_array<_Tp>& __ga)
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_size == __ga._M_index.size());
+ std::__valarray_copy(__ga._M_array, _Array<size_t>(__ga._M_index),
+ _Array<_Tp>(_M_data), _M_size);
+ return *this;
+ }
+
+ template<typename _Tp>
+ inline valarray<_Tp>&
+ valarray<_Tp>::operator=(const mask_array<_Tp>& __ma)
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_size == __ma._M_sz);
+ std::__valarray_copy(__ma._M_array, __ma._M_mask,
+ _Array<_Tp>(_M_data), _M_size);
+ return *this;
+ }
+
+ template<typename _Tp>
+ inline valarray<_Tp>&
+ valarray<_Tp>::operator=(const indirect_array<_Tp>& __ia)
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_size == __ia._M_sz);
+ std::__valarray_copy(__ia._M_array, __ia._M_index,
+ _Array<_Tp>(_M_data), _M_size);
+ return *this;
+ }
+
+ template<typename _Tp> template<class _Dom>
+ inline valarray<_Tp>&
+ valarray<_Tp>::operator=(const _Expr<_Dom, _Tp>& __e)
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_size == __e.size());
+ std::__valarray_copy(__e, _M_size, _Array<_Tp>(_M_data));
+ return *this;
+ }
+
+ template<typename _Tp>
+ inline _Expr<_SClos<_ValArray,_Tp>, _Tp>
+ valarray<_Tp>::operator[](slice __s) const
+ {
+ typedef _SClos<_ValArray,_Tp> _Closure;
+ return _Expr<_Closure, _Tp>(_Closure (_Array<_Tp>(_M_data), __s));
+ }
+
+ template<typename _Tp>
+ inline slice_array<_Tp>
+ valarray<_Tp>::operator[](slice __s)
+ { return slice_array<_Tp>(_Array<_Tp>(_M_data), __s); }
+
+ template<typename _Tp>
+ inline _Expr<_GClos<_ValArray,_Tp>, _Tp>
+ valarray<_Tp>::operator[](const gslice& __gs) const
+ {
+ typedef _GClos<_ValArray,_Tp> _Closure;
+ return _Expr<_Closure, _Tp>
+ (_Closure(_Array<_Tp>(_M_data), __gs._M_index->_M_index));
+ }
+
+ template<typename _Tp>
+ inline gslice_array<_Tp>
+ valarray<_Tp>::operator[](const gslice& __gs)
+ {
+ return gslice_array<_Tp>
+ (_Array<_Tp>(_M_data), __gs._M_index->_M_index);
+ }
+
+ template<typename _Tp>
+ inline valarray<_Tp>
+ valarray<_Tp>::operator[](const valarray<bool>& __m) const
+ {
+ size_t __s = 0;
+ size_t __e = __m.size();
+ for (size_t __i=0; __i<__e; ++__i)
+ if (__m[__i]) ++__s;
+ return valarray<_Tp>(mask_array<_Tp>(_Array<_Tp>(_M_data), __s,
+ _Array<bool> (__m)));
+ }
+
+ template<typename _Tp>
+ inline mask_array<_Tp>
+ valarray<_Tp>::operator[](const valarray<bool>& __m)
+ {
+ size_t __s = 0;
+ size_t __e = __m.size();
+ for (size_t __i=0; __i<__e; ++__i)
+ if (__m[__i]) ++__s;
+ return mask_array<_Tp>(_Array<_Tp>(_M_data), __s, _Array<bool>(__m));
+ }
+
+ template<typename _Tp>
+ inline _Expr<_IClos<_ValArray,_Tp>, _Tp>
+ valarray<_Tp>::operator[](const valarray<size_t>& __i) const
+ {
+ typedef _IClos<_ValArray,_Tp> _Closure;
+ return _Expr<_Closure, _Tp>(_Closure(*this, __i));
+ }
+
+ template<typename _Tp>
+ inline indirect_array<_Tp>
+ valarray<_Tp>::operator[](const valarray<size_t>& __i)
+ {
+ return indirect_array<_Tp>(_Array<_Tp>(_M_data), __i.size(),
+ _Array<size_t>(__i));
+ }
+
+ template<class _Tp>
+ inline size_t
+ valarray<_Tp>::size() const
+ { return _M_size; }
+
+ template<class _Tp>
+ inline _Tp
+ valarray<_Tp>::sum() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_size > 0);
+ return std::__valarray_sum(_M_data, _M_data + _M_size);
+ }
+
+ template<class _Tp>
+ inline valarray<_Tp>
+ valarray<_Tp>::shift(int __n) const
+ {
+ valarray<_Tp> __ret;
+
+ if (_M_size == 0)
+ return __ret;
+
+ _Tp* __restrict__ __tmp_M_data =
+ std::__valarray_get_storage<_Tp>(_M_size);
+
+ if (__n == 0)
+ std::__valarray_copy_construct(_M_data,
+ _M_data + _M_size, __tmp_M_data);
+ else if (__n > 0) // shift left
+ {
+ if (size_t(__n) > _M_size)
+ __n = int(_M_size);
+
+ std::__valarray_copy_construct(_M_data + __n,
+ _M_data + _M_size, __tmp_M_data);
+ std::__valarray_default_construct(__tmp_M_data + _M_size - __n,
+ __tmp_M_data + _M_size);
+ }
+ else // shift right
+ {
+ if (-size_t(__n) > _M_size)
+ __n = -int(_M_size);
+
+ std::__valarray_copy_construct(_M_data, _M_data + _M_size + __n,
+ __tmp_M_data - __n);
+ std::__valarray_default_construct(__tmp_M_data,
+ __tmp_M_data - __n);
+ }
+
+ __ret._M_size = _M_size;
+ __ret._M_data = __tmp_M_data;
+ return __ret;
+ }
+
+ template<class _Tp>
+ inline valarray<_Tp>
+ valarray<_Tp>::cshift(int __n) const
+ {
+ valarray<_Tp> __ret;
+
+ if (_M_size == 0)
+ return __ret;
+
+ _Tp* __restrict__ __tmp_M_data =
+ std::__valarray_get_storage<_Tp>(_M_size);
+
+ if (__n == 0)
+ std::__valarray_copy_construct(_M_data,
+ _M_data + _M_size, __tmp_M_data);
+ else if (__n > 0) // cshift left
+ {
+ if (size_t(__n) > _M_size)
+ __n = int(__n % _M_size);
+
+ std::__valarray_copy_construct(_M_data, _M_data + __n,
+ __tmp_M_data + _M_size - __n);
+ std::__valarray_copy_construct(_M_data + __n, _M_data + _M_size,
+ __tmp_M_data);
+ }
+ else // cshift right
+ {
+ if (-size_t(__n) > _M_size)
+ __n = -int(-size_t(__n) % _M_size);
+
+ std::__valarray_copy_construct(_M_data + _M_size + __n,
+ _M_data + _M_size, __tmp_M_data);
+ std::__valarray_copy_construct(_M_data, _M_data + _M_size + __n,
+ __tmp_M_data - __n);
+ }
+
+ __ret._M_size = _M_size;
+ __ret._M_data = __tmp_M_data;
+ return __ret;
+ }
+
+ template<class _Tp>
+ inline void
+ valarray<_Tp>::resize(size_t __n, _Tp __c)
+ {
+ // This complication is so to make valarray<valarray<T> > work
+ // even though it is not required by the standard. Nobody should
+ // be saying valarray<valarray<T> > anyway. See the specs.
+ std::__valarray_destroy_elements(_M_data, _M_data + _M_size);
+ if (_M_size != __n)
+ {
+ std::__valarray_release_memory(_M_data);
+ _M_size = __n;
+ _M_data = __valarray_get_storage<_Tp>(__n);
+ }
+ std::__valarray_fill_construct(_M_data, _M_data + __n, __c);
+ }
+
+ template<typename _Tp>
+ inline _Tp
+ valarray<_Tp>::min() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_size > 0);
+ return *std::min_element(_M_data, _M_data + _M_size);
+ }
+
+ template<typename _Tp>
+ inline _Tp
+ valarray<_Tp>::max() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_size > 0);
+ return *std::max_element(_M_data, _M_data + _M_size);
+ }
+
+ template<class _Tp>
+ inline _Expr<_ValFunClos<_ValArray, _Tp>, _Tp>
+ valarray<_Tp>::apply(_Tp func(_Tp)) const
+ {
+ typedef _ValFunClos<_ValArray, _Tp> _Closure;
+ return _Expr<_Closure, _Tp>(_Closure(*this, func));
+ }
+
+ template<class _Tp>
+ inline _Expr<_RefFunClos<_ValArray, _Tp>, _Tp>
+ valarray<_Tp>::apply(_Tp func(const _Tp &)) const
+ {
+ typedef _RefFunClos<_ValArray, _Tp> _Closure;
+ return _Expr<_Closure, _Tp>(_Closure(*this, func));
+ }
+
+#define _DEFINE_VALARRAY_UNARY_OPERATOR(_Op, _Name) \
+ template<typename _Tp> \
+ inline typename valarray<_Tp>::template _UnaryOp<_Name>::_Rt \
+ valarray<_Tp>::operator _Op() const \
+ { \
+ typedef _UnClos<_Name, _ValArray, _Tp> _Closure; \
+ typedef typename __fun<_Name, _Tp>::result_type _Rt; \
+ return _Expr<_Closure, _Rt>(_Closure(*this)); \
+ }
+
+ _DEFINE_VALARRAY_UNARY_OPERATOR(+, __unary_plus)
+ _DEFINE_VALARRAY_UNARY_OPERATOR(-, __negate)
+ _DEFINE_VALARRAY_UNARY_OPERATOR(~, __bitwise_not)
+ _DEFINE_VALARRAY_UNARY_OPERATOR (!, __logical_not)
+
+#undef _DEFINE_VALARRAY_UNARY_OPERATOR
+
+#define _DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(_Op, _Name) \
+ template<class _Tp> \
+ inline valarray<_Tp>& \
+ valarray<_Tp>::operator _Op##=(const _Tp &__t) \
+ { \
+ _Array_augmented_##_Name(_Array<_Tp>(_M_data), _M_size, __t); \
+ return *this; \
+ } \
+ \
+ template<class _Tp> \
+ inline valarray<_Tp>& \
+ valarray<_Tp>::operator _Op##=(const valarray<_Tp> &__v) \
+ { \
+ _GLIBCXX_DEBUG_ASSERT(_M_size == __v._M_size); \
+ _Array_augmented_##_Name(_Array<_Tp>(_M_data), _M_size, \
+ _Array<_Tp>(__v._M_data)); \
+ return *this; \
+ }
+
+_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(+, __plus)
+_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(-, __minus)
+_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(*, __multiplies)
+_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(/, __divides)
+_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(%, __modulus)
+_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(^, __bitwise_xor)
+_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(&, __bitwise_and)
+_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(|, __bitwise_or)
+_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(<<, __shift_left)
+_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(>>, __shift_right)
+
+#undef _DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT
+
+#define _DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(_Op, _Name) \
+ template<class _Tp> template<class _Dom> \
+ inline valarray<_Tp>& \
+ valarray<_Tp>::operator _Op##=(const _Expr<_Dom, _Tp>& __e) \
+ { \
+ _Array_augmented_##_Name(_Array<_Tp>(_M_data), __e, _M_size); \
+ return *this; \
+ }
+
+_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(+, __plus)
+_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(-, __minus)
+_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(*, __multiplies)
+_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(/, __divides)
+_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(%, __modulus)
+_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(^, __bitwise_xor)
+_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(&, __bitwise_and)
+_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(|, __bitwise_or)
+_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(<<, __shift_left)
+_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(>>, __shift_right)
+
+#undef _DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT
+
+
+#define _DEFINE_BINARY_OPERATOR(_Op, _Name) \
+ template<typename _Tp> \
+ inline _Expr<_BinClos<_Name, _ValArray, _ValArray, _Tp, _Tp>, \
+ typename __fun<_Name, _Tp>::result_type> \
+ operator _Op(const valarray<_Tp>& __v, const valarray<_Tp>& __w) \
+ { \
+ _GLIBCXX_DEBUG_ASSERT(__v.size() == __w.size()); \
+ typedef _BinClos<_Name, _ValArray, _ValArray, _Tp, _Tp> _Closure; \
+ typedef typename __fun<_Name, _Tp>::result_type _Rt; \
+ return _Expr<_Closure, _Rt>(_Closure(__v, __w)); \
+ } \
+ \
+ template<typename _Tp> \
+ inline _Expr<_BinClos<_Name, _ValArray,_Constant, _Tp, _Tp>, \
+ typename __fun<_Name, _Tp>::result_type> \
+ operator _Op(const valarray<_Tp>& __v, const _Tp& __t) \
+ { \
+ typedef _BinClos<_Name, _ValArray, _Constant, _Tp, _Tp> _Closure; \
+ typedef typename __fun<_Name, _Tp>::result_type _Rt; \
+ return _Expr<_Closure, _Rt>(_Closure(__v, __t)); \
+ } \
+ \
+ template<typename _Tp> \
+ inline _Expr<_BinClos<_Name, _Constant, _ValArray, _Tp, _Tp>, \
+ typename __fun<_Name, _Tp>::result_type> \
+ operator _Op(const _Tp& __t, const valarray<_Tp>& __v) \
+ { \
+ typedef _BinClos<_Name, _Constant, _ValArray, _Tp, _Tp> _Closure; \
+ typedef typename __fun<_Name, _Tp>::result_type _Rt; \
+ return _Expr<_Closure, _Rt>(_Closure(__t, __v)); \
+ }
+
+_DEFINE_BINARY_OPERATOR(+, __plus)
+_DEFINE_BINARY_OPERATOR(-, __minus)
+_DEFINE_BINARY_OPERATOR(*, __multiplies)
+_DEFINE_BINARY_OPERATOR(/, __divides)
+_DEFINE_BINARY_OPERATOR(%, __modulus)
+_DEFINE_BINARY_OPERATOR(^, __bitwise_xor)
+_DEFINE_BINARY_OPERATOR(&, __bitwise_and)
+_DEFINE_BINARY_OPERATOR(|, __bitwise_or)
+_DEFINE_BINARY_OPERATOR(<<, __shift_left)
+_DEFINE_BINARY_OPERATOR(>>, __shift_right)
+_DEFINE_BINARY_OPERATOR(&&, __logical_and)
+_DEFINE_BINARY_OPERATOR(||, __logical_or)
+_DEFINE_BINARY_OPERATOR(==, __equal_to)
+_DEFINE_BINARY_OPERATOR(!=, __not_equal_to)
+_DEFINE_BINARY_OPERATOR(<, __less)
+_DEFINE_BINARY_OPERATOR(>, __greater)
+_DEFINE_BINARY_OPERATOR(<=, __less_equal)
+_DEFINE_BINARY_OPERATOR(>=, __greater_equal)
+
+#undef _DEFINE_BINARY_OPERATOR
+
+ // @} group numeric_arrays
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _GLIBCXX_VALARRAY */
diff --git a/i686-linux/include/c++/4.4.3/vector b/i686-linux/include/c++/4.4.3/vector
new file mode 100644
index 0000000..114665b
--- /dev/null
+++ b/i686-linux/include/c++/4.4.3/vector
@@ -0,0 +1,77 @@
+// <vector> -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file include/vector
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_VECTOR
+#define _GLIBCXX_VECTOR 1
+
+#pragma GCC system_header
+
+#include <bits/stl_algobase.h>
+#include <bits/allocator.h>
+#include <bits/stl_construct.h>
+#include <bits/stl_uninitialized.h>
+#include <bits/stl_vector.h>
+#include <bits/stl_bvector.h>
+
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <bits/vector.tcc>
+#endif
+
+#ifdef _GLIBCXX_DEBUG
+# include <debug/vector>
+#endif
+
+#endif /* _GLIBCXX_VECTOR */
+
diff --git a/i686-linux/lib/ldscripts/elf_i386.x b/i686-linux/lib/ldscripts/elf_i386.x
new file mode 100644
index 0000000..9d6bb8c
--- /dev/null
+++ b/i686-linux/lib/ldscripts/elf_i386.x
@@ -0,0 +1,195 @@
+/* Default linker script, for normal executables */
+OUTPUT_FORMAT("elf32-i386", "elf32-i386",
+ "elf32-i386")
+OUTPUT_ARCH(i386)
+ENTRY(_start)
+SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ PROVIDE (__executable_start = 0x08048000); . = 0x08048000 + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
+ .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rel.plt : { *(.rel.plt) }
+ .rela.plt : { *(.rela.plt) }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0x90909090
+ .plt : { *(.plt) }
+ .text :
+ {
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ } =0x90909090
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0x90909090
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ .dynamic : { *(.dynamic) }
+ .got : { *(.got) }
+ . = DATA_SEGMENT_RELRO_END (12, .);
+ .got.plt : { *(.got.plt) }
+ .data :
+ {
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }
+}
diff --git a/i686-linux/lib/ldscripts/elf_i386.xbn b/i686-linux/lib/ldscripts/elf_i386.xbn
new file mode 100644
index 0000000..dce7b90
--- /dev/null
+++ b/i686-linux/lib/ldscripts/elf_i386.xbn
@@ -0,0 +1,193 @@
+/* Script for -N: mix text and data on same page; don't align data */
+OUTPUT_FORMAT("elf32-i386", "elf32-i386",
+ "elf32-i386")
+OUTPUT_ARCH(i386)
+ENTRY(_start)
+SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ PROVIDE (__executable_start = 0x08048000); . = 0x08048000 + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
+ .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rel.plt : { *(.rel.plt) }
+ .rela.plt : { *(.rela.plt) }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0x90909090
+ .plt : { *(.plt) }
+ .text :
+ {
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ } =0x90909090
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0x90909090
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = .;
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ .dynamic : { *(.dynamic) }
+ .got : { *(.got) }
+ .got.plt : { *(.got.plt) }
+ .data :
+ {
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }
+}
diff --git a/i686-linux/lib/ldscripts/elf_i386.xc b/i686-linux/lib/ldscripts/elf_i386.xc
new file mode 100644
index 0000000..356c009
--- /dev/null
+++ b/i686-linux/lib/ldscripts/elf_i386.xc
@@ -0,0 +1,200 @@
+/* Script for -z combreloc: combine and sort reloc sections */
+OUTPUT_FORMAT("elf32-i386", "elf32-i386",
+ "elf32-i386")
+OUTPUT_ARCH(i386)
+ENTRY(_start)
+SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ PROVIDE (__executable_start = 0x08048000); . = 0x08048000 + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ }
+ .rel.plt : { *(.rel.plt) }
+ .rela.plt : { *(.rela.plt) }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0x90909090
+ .plt : { *(.plt) }
+ .text :
+ {
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ } =0x90909090
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0x90909090
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ .dynamic : { *(.dynamic) }
+ .got : { *(.got) }
+ . = DATA_SEGMENT_RELRO_END (12, .);
+ .got.plt : { *(.got.plt) }
+ .data :
+ {
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }
+}
diff --git a/i686-linux/lib/ldscripts/elf_i386.xd b/i686-linux/lib/ldscripts/elf_i386.xd
new file mode 100644
index 0000000..c84faa6
--- /dev/null
+++ b/i686-linux/lib/ldscripts/elf_i386.xd
@@ -0,0 +1,195 @@
+/* Script for ld -pie: link position independent executable */
+OUTPUT_FORMAT("elf32-i386", "elf32-i386",
+ "elf32-i386")
+OUTPUT_ARCH(i386)
+ENTRY(_start)
+SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = 0 + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
+ .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rel.plt : { *(.rel.plt) }
+ .rela.plt : { *(.rela.plt) }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0x90909090
+ .plt : { *(.plt) }
+ .text :
+ {
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ } =0x90909090
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0x90909090
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ .dynamic : { *(.dynamic) }
+ .got : { *(.got) }
+ . = DATA_SEGMENT_RELRO_END (12, .);
+ .got.plt : { *(.got.plt) }
+ .data :
+ {
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }
+}
diff --git a/i686-linux/lib/ldscripts/elf_i386.xdc b/i686-linux/lib/ldscripts/elf_i386.xdc
new file mode 100644
index 0000000..357f6e6
--- /dev/null
+++ b/i686-linux/lib/ldscripts/elf_i386.xdc
@@ -0,0 +1,200 @@
+/* Script for -pie -z combreloc: position independent executable, combine & sort relocs */
+OUTPUT_FORMAT("elf32-i386", "elf32-i386",
+ "elf32-i386")
+OUTPUT_ARCH(i386)
+ENTRY(_start)
+SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = 0 + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ }
+ .rel.plt : { *(.rel.plt) }
+ .rela.plt : { *(.rela.plt) }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0x90909090
+ .plt : { *(.plt) }
+ .text :
+ {
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ } =0x90909090
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0x90909090
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ .dynamic : { *(.dynamic) }
+ .got : { *(.got) }
+ . = DATA_SEGMENT_RELRO_END (12, .);
+ .got.plt : { *(.got.plt) }
+ .data :
+ {
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }
+}
diff --git a/i686-linux/lib/ldscripts/elf_i386.xdw b/i686-linux/lib/ldscripts/elf_i386.xdw
new file mode 100644
index 0000000..5e63449
--- /dev/null
+++ b/i686-linux/lib/ldscripts/elf_i386.xdw
@@ -0,0 +1,199 @@
+/* Script for -pie -z combreloc -z now -z relro: position independent executable, combine & sort relocs */
+OUTPUT_FORMAT("elf32-i386", "elf32-i386",
+ "elf32-i386")
+OUTPUT_ARCH(i386)
+ENTRY(_start)
+SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = 0 + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ }
+ .rel.plt : { *(.rel.plt) }
+ .rela.plt : { *(.rela.plt) }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0x90909090
+ .plt : { *(.plt) }
+ .text :
+ {
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ } =0x90909090
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0x90909090
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ .dynamic : { *(.dynamic) }
+ .got : { *(.got.plt) *(.got) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }
+}
diff --git a/i686-linux/lib/ldscripts/elf_i386.xn b/i686-linux/lib/ldscripts/elf_i386.xn
new file mode 100644
index 0000000..78d8faa
--- /dev/null
+++ b/i686-linux/lib/ldscripts/elf_i386.xn
@@ -0,0 +1,195 @@
+/* Script for -n: mix text and data on same page */
+OUTPUT_FORMAT("elf32-i386", "elf32-i386",
+ "elf32-i386")
+OUTPUT_ARCH(i386)
+ENTRY(_start)
+SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ PROVIDE (__executable_start = 0x08048000); . = 0x08048000 + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
+ .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rel.plt : { *(.rel.plt) }
+ .rela.plt : { *(.rela.plt) }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0x90909090
+ .plt : { *(.plt) }
+ .text :
+ {
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ } =0x90909090
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0x90909090
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ .dynamic : { *(.dynamic) }
+ .got : { *(.got) }
+ . = DATA_SEGMENT_RELRO_END (12, .);
+ .got.plt : { *(.got.plt) }
+ .data :
+ {
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }
+}
diff --git a/i686-linux/lib/ldscripts/elf_i386.xr b/i686-linux/lib/ldscripts/elf_i386.xr
new file mode 100644
index 0000000..069d420
--- /dev/null
+++ b/i686-linux/lib/ldscripts/elf_i386.xr
@@ -0,0 +1,146 @@
+/* Script for ld -r: link without relocation */
+OUTPUT_FORMAT("elf32-i386", "elf32-i386",
+ "elf32-i386")
+OUTPUT_ARCH(i386)
+ /* For some reason, the Solaris linker makes bad executables
+ if gld -r is used and the intermediate file has sections starting
+ at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
+ bug. But for now assigning the zero vmas works. */
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ .interp 0 : { *(.interp) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .hash 0 : { *(.hash) }
+ .gnu.hash 0 : { *(.gnu.hash) }
+ .dynsym 0 : { *(.dynsym) }
+ .dynstr 0 : { *(.dynstr) }
+ .gnu.version 0 : { *(.gnu.version) }
+ .gnu.version_d 0: { *(.gnu.version_d) }
+ .gnu.version_r 0: { *(.gnu.version_r) }
+ .rel.init 0 : { *(.rel.init) }
+ .rela.init 0 : { *(.rela.init) }
+ .rel.text 0 : { *(.rel.text) }
+ .rela.text 0 : { *(.rela.text) }
+ .rel.fini 0 : { *(.rel.fini) }
+ .rela.fini 0 : { *(.rela.fini) }
+ .rel.rodata 0 : { *(.rel.rodata) }
+ .rela.rodata 0 : { *(.rela.rodata) }
+ .rel.data.rel.ro 0 : { *(.rel.data.rel.ro) }
+ .rela.data.rel.ro 0 : { *(.rela.data.rel.ro) }
+ .rel.data 0 : { *(.rel.data) }
+ .rela.data 0 : { *(.rela.data) }
+ .rel.tdata 0 : { *(.rel.tdata) }
+ .rela.tdata 0 : { *(.rela.tdata) }
+ .rel.tbss 0 : { *(.rel.tbss) }
+ .rela.tbss 0 : { *(.rela.tbss) }
+ .rel.ctors 0 : { *(.rel.ctors) }
+ .rela.ctors 0 : { *(.rela.ctors) }
+ .rel.dtors 0 : { *(.rel.dtors) }
+ .rela.dtors 0 : { *(.rela.dtors) }
+ .rel.got 0 : { *(.rel.got) }
+ .rela.got 0 : { *(.rela.got) }
+ .rel.bss 0 : { *(.rel.bss) }
+ .rela.bss 0 : { *(.rela.bss) }
+ .rel.plt 0 : { *(.rel.plt) }
+ .rela.plt 0 : { *(.rela.plt) }
+ .init 0 :
+ {
+ KEEP (*(.init))
+ } =0x90909090
+ .plt 0 : { *(.plt) }
+ .text 0 :
+ {
+ *(.text .stub)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ } =0x90909090
+ .fini 0 :
+ {
+ KEEP (*(.fini))
+ } =0x90909090
+ .rodata 0 : { *(.rodata) }
+ .rodata1 0 : { *(.rodata1) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame 0 : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table 0 : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ /* Exception handling */
+ .eh_frame 0 : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table 0 : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata 0 : { *(.tdata) }
+ .tbss 0 : { *(.tbss) }
+ .preinit_array 0 :
+ {
+ KEEP (*(.preinit_array))
+ }
+ .init_array 0 :
+ {
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ }
+ .fini_array 0 :
+ {
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ }
+ .jcr 0 : { KEEP (*(.jcr)) }
+ .dynamic 0 : { *(.dynamic) }
+ .got 0 : { *(.got) }
+ .got.plt 0 : { *(.got.plt) }
+ .data 0 :
+ {
+ *(.data)
+ }
+ .data1 0 : { *(.data1) }
+ .bss 0 :
+ {
+ *(.dynbss)
+ *(.bss)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ }
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+}
diff --git a/i686-linux/lib/ldscripts/elf_i386.xs b/i686-linux/lib/ldscripts/elf_i386.xs
new file mode 100644
index 0000000..1378b5b
--- /dev/null
+++ b/i686-linux/lib/ldscripts/elf_i386.xs
@@ -0,0 +1,188 @@
+/* Script for ld --shared: link shared library */
+OUTPUT_FORMAT("elf32-i386", "elf32-i386",
+ "elf32-i386")
+OUTPUT_ARCH(i386)
+ENTRY(_start)
+SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = 0 + SIZEOF_HEADERS;
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
+ .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rel.plt : { *(.rel.plt) }
+ .rela.plt : { *(.rela.plt) }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0x90909090
+ .plt : { *(.plt) }
+ .text :
+ {
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ } =0x90909090
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0x90909090
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ KEEP (*(.preinit_array))
+ }
+ .init_array :
+ {
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ }
+ .fini_array :
+ {
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ .dynamic : { *(.dynamic) }
+ .got : { *(.got) }
+ . = DATA_SEGMENT_RELRO_END (12, .);
+ .got.plt : { *(.got.plt) }
+ .data :
+ {
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }
+}
diff --git a/i686-linux/lib/ldscripts/elf_i386.xsc b/i686-linux/lib/ldscripts/elf_i386.xsc
new file mode 100644
index 0000000..f6818e2
--- /dev/null
+++ b/i686-linux/lib/ldscripts/elf_i386.xsc
@@ -0,0 +1,193 @@
+/* Script for --shared -z combreloc: shared library, combine & sort relocs */
+OUTPUT_FORMAT("elf32-i386", "elf32-i386",
+ "elf32-i386")
+OUTPUT_ARCH(i386)
+ENTRY(_start)
+SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = 0 + SIZEOF_HEADERS;
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ }
+ .rel.plt : { *(.rel.plt) }
+ .rela.plt : { *(.rela.plt) }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0x90909090
+ .plt : { *(.plt) }
+ .text :
+ {
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ } =0x90909090
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0x90909090
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ KEEP (*(.preinit_array))
+ }
+ .init_array :
+ {
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ }
+ .fini_array :
+ {
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ .dynamic : { *(.dynamic) }
+ .got : { *(.got) }
+ . = DATA_SEGMENT_RELRO_END (12, .);
+ .got.plt : { *(.got.plt) }
+ .data :
+ {
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }
+}
diff --git a/i686-linux/lib/ldscripts/elf_i386.xsw b/i686-linux/lib/ldscripts/elf_i386.xsw
new file mode 100644
index 0000000..5495184
--- /dev/null
+++ b/i686-linux/lib/ldscripts/elf_i386.xsw
@@ -0,0 +1,192 @@
+/* Script for --shared -z combreloc -z now -z relro: shared library, combine & sort relocs */
+OUTPUT_FORMAT("elf32-i386", "elf32-i386",
+ "elf32-i386")
+OUTPUT_ARCH(i386)
+ENTRY(_start)
+SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = 0 + SIZEOF_HEADERS;
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ }
+ .rel.plt : { *(.rel.plt) }
+ .rela.plt : { *(.rela.plt) }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0x90909090
+ .plt : { *(.plt) }
+ .text :
+ {
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ } =0x90909090
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0x90909090
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ KEEP (*(.preinit_array))
+ }
+ .init_array :
+ {
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ }
+ .fini_array :
+ {
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ .dynamic : { *(.dynamic) }
+ .got : { *(.got.plt) *(.got) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }
+}
diff --git a/i686-linux/lib/ldscripts/elf_i386.xu b/i686-linux/lib/ldscripts/elf_i386.xu
new file mode 100644
index 0000000..c51ac02
--- /dev/null
+++ b/i686-linux/lib/ldscripts/elf_i386.xu
@@ -0,0 +1,147 @@
+/* Script for ld -Ur: link w/out relocation, do create constructors */
+OUTPUT_FORMAT("elf32-i386", "elf32-i386",
+ "elf32-i386")
+OUTPUT_ARCH(i386)
+ /* For some reason, the Solaris linker makes bad executables
+ if gld -r is used and the intermediate file has sections starting
+ at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
+ bug. But for now assigning the zero vmas works. */
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ .interp 0 : { *(.interp) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .hash 0 : { *(.hash) }
+ .gnu.hash 0 : { *(.gnu.hash) }
+ .dynsym 0 : { *(.dynsym) }
+ .dynstr 0 : { *(.dynstr) }
+ .gnu.version 0 : { *(.gnu.version) }
+ .gnu.version_d 0: { *(.gnu.version_d) }
+ .gnu.version_r 0: { *(.gnu.version_r) }
+ .rel.init 0 : { *(.rel.init) }
+ .rela.init 0 : { *(.rela.init) }
+ .rel.text 0 : { *(.rel.text) }
+ .rela.text 0 : { *(.rela.text) }
+ .rel.fini 0 : { *(.rel.fini) }
+ .rela.fini 0 : { *(.rela.fini) }
+ .rel.rodata 0 : { *(.rel.rodata) }
+ .rela.rodata 0 : { *(.rela.rodata) }
+ .rel.data.rel.ro 0 : { *(.rel.data.rel.ro) }
+ .rela.data.rel.ro 0 : { *(.rela.data.rel.ro) }
+ .rel.data 0 : { *(.rel.data) }
+ .rela.data 0 : { *(.rela.data) }
+ .rel.tdata 0 : { *(.rel.tdata) }
+ .rela.tdata 0 : { *(.rela.tdata) }
+ .rel.tbss 0 : { *(.rel.tbss) }
+ .rela.tbss 0 : { *(.rela.tbss) }
+ .rel.ctors 0 : { *(.rel.ctors) }
+ .rela.ctors 0 : { *(.rela.ctors) }
+ .rel.dtors 0 : { *(.rel.dtors) }
+ .rela.dtors 0 : { *(.rela.dtors) }
+ .rel.got 0 : { *(.rel.got) }
+ .rela.got 0 : { *(.rela.got) }
+ .rel.bss 0 : { *(.rel.bss) }
+ .rela.bss 0 : { *(.rela.bss) }
+ .rel.plt 0 : { *(.rel.plt) }
+ .rela.plt 0 : { *(.rela.plt) }
+ .init 0 :
+ {
+ KEEP (*(.init))
+ } =0x90909090
+ .plt 0 : { *(.plt) }
+ .text 0 :
+ {
+ *(.text .stub)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ } =0x90909090
+ .fini 0 :
+ {
+ KEEP (*(.fini))
+ } =0x90909090
+ .rodata 0 : { *(.rodata) }
+ .rodata1 0 : { *(.rodata1) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame 0 : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table 0 : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ /* Exception handling */
+ .eh_frame 0 : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table 0 : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata 0 : { *(.tdata) }
+ .tbss 0 : { *(.tbss) }
+ .preinit_array 0 :
+ {
+ KEEP (*(.preinit_array))
+ }
+ .init_array 0 :
+ {
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ }
+ .fini_array 0 :
+ {
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ }
+ .jcr 0 : { KEEP (*(.jcr)) }
+ .dynamic 0 : { *(.dynamic) }
+ .got 0 : { *(.got) }
+ .got.plt 0 : { *(.got.plt) }
+ .data 0 :
+ {
+ *(.data)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 0 : { *(.data1) }
+ .bss 0 :
+ {
+ *(.dynbss)
+ *(.bss)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ }
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+}
diff --git a/i686-linux/lib/ldscripts/elf_i386.xw b/i686-linux/lib/ldscripts/elf_i386.xw
new file mode 100644
index 0000000..215caf2
--- /dev/null
+++ b/i686-linux/lib/ldscripts/elf_i386.xw
@@ -0,0 +1,199 @@
+/* Script for -z combreloc -z now -z relro: combine and sort reloc sections */
+OUTPUT_FORMAT("elf32-i386", "elf32-i386",
+ "elf32-i386")
+OUTPUT_ARCH(i386)
+ENTRY(_start)
+SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ PROVIDE (__executable_start = 0x08048000); . = 0x08048000 + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ }
+ .rel.plt : { *(.rel.plt) }
+ .rela.plt : { *(.rela.plt) }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0x90909090
+ .plt : { *(.plt) }
+ .text :
+ {
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ } =0x90909090
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0x90909090
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ .dynamic : { *(.dynamic) }
+ .got : { *(.got.plt) *(.got) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }
+}
diff --git a/i686-linux/lib/ldscripts/i386linux.x b/i686-linux/lib/ldscripts/i386linux.x
new file mode 100644
index 0000000..2f85627
--- /dev/null
+++ b/i686-linux/lib/ldscripts/i386linux.x
@@ -0,0 +1,46 @@
+/* Default linker script, for normal executables */
+OUTPUT_FORMAT("a.out-i386-linux", "a.out-i386-linux",
+ "a.out-i386-linux")
+OUTPUT_ARCH(i386)
+PROVIDE (__stack = 0);
+SECTIONS
+{
+ . = 0x1020;
+ .text :
+ {
+ CREATE_OBJECT_SYMBOLS
+ *(.text)
+ /* The next six sections are for SunOS dynamic linking. The order
+ is important. */
+ *(.dynrel)
+ *(.hash)
+ *(.dynsym)
+ *(.dynstr)
+ *(.rules)
+ *(.need)
+ _etext = .;
+ __etext = .;
+ }
+ . = ALIGN(0x1000);
+ .data :
+ {
+ /* The first three sections are for SunOS dynamic linking. */
+ *(.dynamic)
+ *(.got)
+ *(.plt)
+ *(.data)
+ *(.linux-dynamic) /* For Linux dynamic linking. */
+ CONSTRUCTORS
+ _edata = .;
+ __edata = .;
+ }
+ .bss :
+ {
+ __bss_start = .;
+ *(.bss)
+ *(COMMON)
+ . = ALIGN(4);
+ _end = . ;
+ __end = . ;
+ }
+}
diff --git a/i686-linux/lib/ldscripts/i386linux.xbn b/i686-linux/lib/ldscripts/i386linux.xbn
new file mode 100644
index 0000000..91b1e91
--- /dev/null
+++ b/i686-linux/lib/ldscripts/i386linux.xbn
@@ -0,0 +1,46 @@
+/* Script for -N: mix text and data on same page; don't align data */
+OUTPUT_FORMAT("a.out-i386-linux", "a.out-i386-linux",
+ "a.out-i386-linux")
+OUTPUT_ARCH(i386)
+PROVIDE (__stack = 0);
+SECTIONS
+{
+ . = 0;
+ .text :
+ {
+ CREATE_OBJECT_SYMBOLS
+ *(.text)
+ /* The next six sections are for SunOS dynamic linking. The order
+ is important. */
+ *(.dynrel)
+ *(.hash)
+ *(.dynsym)
+ *(.dynstr)
+ *(.rules)
+ *(.need)
+ _etext = .;
+ __etext = .;
+ }
+ . = .;
+ .data :
+ {
+ /* The first three sections are for SunOS dynamic linking. */
+ *(.dynamic)
+ *(.got)
+ *(.plt)
+ *(.data)
+ *(.linux-dynamic) /* For Linux dynamic linking. */
+ CONSTRUCTORS
+ _edata = .;
+ __edata = .;
+ }
+ .bss :
+ {
+ __bss_start = .;
+ *(.bss)
+ *(COMMON)
+ . = ALIGN(4);
+ _end = . ;
+ __end = . ;
+ }
+}
diff --git a/i686-linux/lib/ldscripts/i386linux.xn b/i686-linux/lib/ldscripts/i386linux.xn
new file mode 100644
index 0000000..6185656
--- /dev/null
+++ b/i686-linux/lib/ldscripts/i386linux.xn
@@ -0,0 +1,46 @@
+/* Script for -n: mix text and data on same page */
+OUTPUT_FORMAT("a.out-i386-linux", "a.out-i386-linux",
+ "a.out-i386-linux")
+OUTPUT_ARCH(i386)
+PROVIDE (__stack = 0);
+SECTIONS
+{
+ . = 0;
+ .text :
+ {
+ CREATE_OBJECT_SYMBOLS
+ *(.text)
+ /* The next six sections are for SunOS dynamic linking. The order
+ is important. */
+ *(.dynrel)
+ *(.hash)
+ *(.dynsym)
+ *(.dynstr)
+ *(.rules)
+ *(.need)
+ _etext = .;
+ __etext = .;
+ }
+ . = ALIGN(0x1000);
+ .data :
+ {
+ /* The first three sections are for SunOS dynamic linking. */
+ *(.dynamic)
+ *(.got)
+ *(.plt)
+ *(.data)
+ *(.linux-dynamic) /* For Linux dynamic linking. */
+ CONSTRUCTORS
+ _edata = .;
+ __edata = .;
+ }
+ .bss :
+ {
+ __bss_start = .;
+ *(.bss)
+ *(COMMON)
+ . = ALIGN(4);
+ _end = . ;
+ __end = . ;
+ }
+}
diff --git a/i686-linux/lib/ldscripts/i386linux.xr b/i686-linux/lib/ldscripts/i386linux.xr
new file mode 100644
index 0000000..8a33f28
--- /dev/null
+++ b/i686-linux/lib/ldscripts/i386linux.xr
@@ -0,0 +1,37 @@
+/* Script for ld -r: link without relocation */
+OUTPUT_FORMAT("a.out-i386-linux", "a.out-i386-linux",
+ "a.out-i386-linux")
+OUTPUT_ARCH(i386)
+SECTIONS
+{
+ .text :
+ {
+ CREATE_OBJECT_SYMBOLS
+ *(.text)
+ /* The next six sections are for SunOS dynamic linking. The order
+ is important. */
+ *(.dynrel)
+ *(.hash)
+ *(.dynsym)
+ *(.dynstr)
+ *(.rules)
+ *(.need)
+ }
+ .data :
+ {
+ /* The first three sections are for SunOS dynamic linking. */
+ *(.dynamic)
+ *(.got)
+ *(.plt)
+ *(.data)
+ *(.linux-dynamic) /* For Linux dynamic linking. */
+ }
+ .bss :
+ {
+ ;
+ *(.bss)
+ *(COMMON)
+ ;
+ ;
+ }
+}
diff --git a/i686-linux/lib/ldscripts/i386linux.xu b/i686-linux/lib/ldscripts/i386linux.xu
new file mode 100644
index 0000000..6847100
--- /dev/null
+++ b/i686-linux/lib/ldscripts/i386linux.xu
@@ -0,0 +1,38 @@
+/* Script for ld -Ur: link w/out relocation, do create constructors */
+OUTPUT_FORMAT("a.out-i386-linux", "a.out-i386-linux",
+ "a.out-i386-linux")
+OUTPUT_ARCH(i386)
+SECTIONS
+{
+ .text :
+ {
+ CREATE_OBJECT_SYMBOLS
+ *(.text)
+ /* The next six sections are for SunOS dynamic linking. The order
+ is important. */
+ *(.dynrel)
+ *(.hash)
+ *(.dynsym)
+ *(.dynstr)
+ *(.rules)
+ *(.need)
+ }
+ .data :
+ {
+ /* The first three sections are for SunOS dynamic linking. */
+ *(.dynamic)
+ *(.got)
+ *(.plt)
+ *(.data)
+ *(.linux-dynamic) /* For Linux dynamic linking. */
+ CONSTRUCTORS
+ }
+ .bss :
+ {
+ ;
+ *(.bss)
+ *(COMMON)
+ ;
+ ;
+ }
+}
diff --git a/i686-linux/lib/libgcc_s.so b/i686-linux/lib/libgcc_s.so
new file mode 120000
index 0000000..83033f7
--- /dev/null
+++ b/i686-linux/lib/libgcc_s.so
@@ -0,0 +1 @@
+libgcc_s.so.1 \ No newline at end of file
diff --git a/i686-linux/lib/libgcc_s.so.1 b/i686-linux/lib/libgcc_s.so.1
new file mode 100644
index 0000000..a8cc48b
--- /dev/null
+++ b/i686-linux/lib/libgcc_s.so.1
Binary files differ
diff --git a/i686-linux/lib/libgomp.a b/i686-linux/lib/libgomp.a
new file mode 100644
index 0000000..d26ea5e
--- /dev/null
+++ b/i686-linux/lib/libgomp.a
Binary files differ
diff --git a/i686-linux/lib/libgomp.la b/i686-linux/lib/libgomp.la
new file mode 100755
index 0000000..dc63a07
--- /dev/null
+++ b/i686-linux/lib/libgomp.la
@@ -0,0 +1,41 @@
+# libgomp.la - a libtool library file
+# Generated by ltmain.sh (GNU libtool) 2.2.6
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='libgomp.so.1'
+
+# Names of this library.
+library_names='libgomp.so.1.0.0 libgomp.so.1 libgomp.so'
+
+# The name of the static archive.
+old_library='libgomp.a'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags=''
+
+# Libraries that this one depends upon.
+dependency_libs=' -lrt'
+
+# Names of additional weak libraries provided by this library
+weak_library_names=''
+
+# Version information for libgomp.
+current=1
+age=0
+revision=0
+
+# Is this an already installed library?
+installed=yes
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=no
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir='/tmp/gcc32/1/i686-linux-glibc2.7-4.4.3/i686-linux/lib'
diff --git a/i686-linux/lib/libgomp.so b/i686-linux/lib/libgomp.so
new file mode 120000
index 0000000..c5be39e
--- /dev/null
+++ b/i686-linux/lib/libgomp.so
@@ -0,0 +1 @@
+libgomp.so.1.0.0 \ No newline at end of file
diff --git a/i686-linux/lib/libgomp.so.1 b/i686-linux/lib/libgomp.so.1
new file mode 120000
index 0000000..c5be39e
--- /dev/null
+++ b/i686-linux/lib/libgomp.so.1
@@ -0,0 +1 @@
+libgomp.so.1.0.0 \ No newline at end of file
diff --git a/i686-linux/lib/libgomp.so.1.0.0 b/i686-linux/lib/libgomp.so.1.0.0
new file mode 100755
index 0000000..b65aebd
--- /dev/null
+++ b/i686-linux/lib/libgomp.so.1.0.0
Binary files differ
diff --git a/i686-linux/lib/libgomp.spec b/i686-linux/lib/libgomp.spec
new file mode 100644
index 0000000..71136b8
--- /dev/null
+++ b/i686-linux/lib/libgomp.spec
@@ -0,0 +1,3 @@
+# This spec file is read by gcc when linking. It is used to specify the
+# standard libraries we need in order to link with -fopenmp.
+*link_gomp: -lgomp %{static: -lrt }
diff --git a/i686-linux/lib/libiberty.a b/i686-linux/lib/libiberty.a
new file mode 100644
index 0000000..0c00492
--- /dev/null
+++ b/i686-linux/lib/libiberty.a
Binary files differ
diff --git a/i686-linux/lib/libmudflap.a b/i686-linux/lib/libmudflap.a
new file mode 100644
index 0000000..3cd53d5
--- /dev/null
+++ b/i686-linux/lib/libmudflap.a
Binary files differ
diff --git a/i686-linux/lib/libmudflap.la b/i686-linux/lib/libmudflap.la
new file mode 100755
index 0000000..bc9f8d2
--- /dev/null
+++ b/i686-linux/lib/libmudflap.la
@@ -0,0 +1,41 @@
+# libmudflap.la - a libtool library file
+# Generated by ltmain.sh (GNU libtool) 2.2.6
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='libmudflap.so.0'
+
+# Names of this library.
+library_names='libmudflap.so.0.0.0 libmudflap.so.0 libmudflap.so'
+
+# The name of the static archive.
+old_library='libmudflap.a'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags=''
+
+# Libraries that this one depends upon.
+dependency_libs=' -ldl'
+
+# Names of additional weak libraries provided by this library
+weak_library_names=''
+
+# Version information for libmudflap.
+current=0
+age=0
+revision=0
+
+# Is this an already installed library?
+installed=yes
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=no
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir='/tmp/gcc32/1/i686-linux-glibc2.7-4.4.3/i686-linux/lib'
diff --git a/i686-linux/lib/libmudflap.so b/i686-linux/lib/libmudflap.so
new file mode 120000
index 0000000..7e6932a
--- /dev/null
+++ b/i686-linux/lib/libmudflap.so
@@ -0,0 +1 @@
+libmudflap.so.0.0.0 \ No newline at end of file
diff --git a/i686-linux/lib/libmudflap.so.0 b/i686-linux/lib/libmudflap.so.0
new file mode 120000
index 0000000..7e6932a
--- /dev/null
+++ b/i686-linux/lib/libmudflap.so.0
@@ -0,0 +1 @@
+libmudflap.so.0.0.0 \ No newline at end of file
diff --git a/i686-linux/lib/libmudflap.so.0.0.0 b/i686-linux/lib/libmudflap.so.0.0.0
new file mode 100755
index 0000000..0907434
--- /dev/null
+++ b/i686-linux/lib/libmudflap.so.0.0.0
Binary files differ
diff --git a/i686-linux/lib/libmudflapth.a b/i686-linux/lib/libmudflapth.a
new file mode 100644
index 0000000..1d141c1
--- /dev/null
+++ b/i686-linux/lib/libmudflapth.a
Binary files differ
diff --git a/i686-linux/lib/libmudflapth.la b/i686-linux/lib/libmudflapth.la
new file mode 100755
index 0000000..be6b3f8
--- /dev/null
+++ b/i686-linux/lib/libmudflapth.la
@@ -0,0 +1,41 @@
+# libmudflapth.la - a libtool library file
+# Generated by ltmain.sh (GNU libtool) 2.2.6
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='libmudflapth.so.0'
+
+# Names of this library.
+library_names='libmudflapth.so.0.0.0 libmudflapth.so.0 libmudflapth.so'
+
+# The name of the static archive.
+old_library='libmudflapth.a'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags=''
+
+# Libraries that this one depends upon.
+dependency_libs=' -ldl'
+
+# Names of additional weak libraries provided by this library
+weak_library_names=''
+
+# Version information for libmudflapth.
+current=0
+age=0
+revision=0
+
+# Is this an already installed library?
+installed=yes
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=no
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir='/tmp/gcc32/1/i686-linux-glibc2.7-4.4.3/i686-linux/lib'
diff --git a/i686-linux/lib/libmudflapth.so b/i686-linux/lib/libmudflapth.so
new file mode 120000
index 0000000..2857f7e
--- /dev/null
+++ b/i686-linux/lib/libmudflapth.so
@@ -0,0 +1 @@
+libmudflapth.so.0.0.0 \ No newline at end of file
diff --git a/i686-linux/lib/libmudflapth.so.0 b/i686-linux/lib/libmudflapth.so.0
new file mode 120000
index 0000000..2857f7e
--- /dev/null
+++ b/i686-linux/lib/libmudflapth.so.0
@@ -0,0 +1 @@
+libmudflapth.so.0.0.0 \ No newline at end of file
diff --git a/i686-linux/lib/libmudflapth.so.0.0.0 b/i686-linux/lib/libmudflapth.so.0.0.0
new file mode 100755
index 0000000..e1683d3
--- /dev/null
+++ b/i686-linux/lib/libmudflapth.so.0.0.0
Binary files differ
diff --git a/i686-linux/lib/libssp.a b/i686-linux/lib/libssp.a
new file mode 100644
index 0000000..12cd052
--- /dev/null
+++ b/i686-linux/lib/libssp.a
Binary files differ
diff --git a/i686-linux/lib/libssp.la b/i686-linux/lib/libssp.la
new file mode 100755
index 0000000..cbbfeed
--- /dev/null
+++ b/i686-linux/lib/libssp.la
@@ -0,0 +1,41 @@
+# libssp.la - a libtool library file
+# Generated by ltmain.sh (GNU libtool) 2.2.6
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='libssp.so.0'
+
+# Names of this library.
+library_names='libssp.so.0.0.0 libssp.so.0 libssp.so'
+
+# The name of the static archive.
+old_library='libssp.a'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags=''
+
+# Libraries that this one depends upon.
+dependency_libs=''
+
+# Names of additional weak libraries provided by this library
+weak_library_names=''
+
+# Version information for libssp.
+current=0
+age=0
+revision=0
+
+# Is this an already installed library?
+installed=yes
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=no
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir='/tmp/gcc32/1/i686-linux-glibc2.7-4.4.3/i686-linux/lib'
diff --git a/i686-linux/lib/libssp.so b/i686-linux/lib/libssp.so
new file mode 120000
index 0000000..6765084
--- /dev/null
+++ b/i686-linux/lib/libssp.so
@@ -0,0 +1 @@
+libssp.so.0.0.0 \ No newline at end of file
diff --git a/i686-linux/lib/libssp.so.0 b/i686-linux/lib/libssp.so.0
new file mode 120000
index 0000000..6765084
--- /dev/null
+++ b/i686-linux/lib/libssp.so.0
@@ -0,0 +1 @@
+libssp.so.0.0.0 \ No newline at end of file
diff --git a/i686-linux/lib/libssp.so.0.0.0 b/i686-linux/lib/libssp.so.0.0.0
new file mode 100755
index 0000000..12824c3
--- /dev/null
+++ b/i686-linux/lib/libssp.so.0.0.0
Binary files differ
diff --git a/i686-linux/lib/libssp_nonshared.a b/i686-linux/lib/libssp_nonshared.a
new file mode 100644
index 0000000..1ffa42b
--- /dev/null
+++ b/i686-linux/lib/libssp_nonshared.a
Binary files differ
diff --git a/i686-linux/lib/libssp_nonshared.la b/i686-linux/lib/libssp_nonshared.la
new file mode 100755
index 0000000..21268f3
--- /dev/null
+++ b/i686-linux/lib/libssp_nonshared.la
@@ -0,0 +1,41 @@
+# libssp_nonshared.la - a libtool library file
+# Generated by ltmain.sh (GNU libtool) 2.2.6
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname=''
+
+# Names of this library.
+library_names=''
+
+# The name of the static archive.
+old_library='libssp_nonshared.a'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags=''
+
+# Libraries that this one depends upon.
+dependency_libs=''
+
+# Names of additional weak libraries provided by this library
+weak_library_names=''
+
+# Version information for libssp_nonshared.
+current=0
+age=0
+revision=0
+
+# Is this an already installed library?
+installed=yes
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=no
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir='/tmp/gcc32/1/i686-linux-glibc2.7-4.4.3/i686-linux/lib'
diff --git a/i686-linux/lib/libstdc++.a b/i686-linux/lib/libstdc++.a
new file mode 100644
index 0000000..8dab888
--- /dev/null
+++ b/i686-linux/lib/libstdc++.a
Binary files differ
diff --git a/i686-linux/lib/libstdc++.la b/i686-linux/lib/libstdc++.la
new file mode 100755
index 0000000..3f92d97
--- /dev/null
+++ b/i686-linux/lib/libstdc++.la
@@ -0,0 +1,41 @@
+# libstdc++.la - a libtool library file
+# Generated by ltmain.sh (GNU libtool) 2.2.6
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='libstdc++.so.6'
+
+# Names of this library.
+library_names='libstdc++.so.6.0.13 libstdc++.so.6 libstdc++.so'
+
+# The name of the static archive.
+old_library='libstdc++.a'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags=''
+
+# Libraries that this one depends upon.
+dependency_libs=' -lm'
+
+# Names of additional weak libraries provided by this library
+weak_library_names=''
+
+# Version information for libstdc++.
+current=6
+age=0
+revision=13
+
+# Is this an already installed library?
+installed=yes
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=no
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir='/tmp/gcc32/1/i686-linux-glibc2.7-4.4.3/i686-linux/lib'
diff --git a/i686-linux/lib/libstdc++.so b/i686-linux/lib/libstdc++.so
new file mode 120000
index 0000000..a9430f1
--- /dev/null
+++ b/i686-linux/lib/libstdc++.so
@@ -0,0 +1 @@
+libstdc++.so.6.0.13 \ No newline at end of file
diff --git a/i686-linux/lib/libstdc++.so.6 b/i686-linux/lib/libstdc++.so.6
new file mode 120000
index 0000000..a9430f1
--- /dev/null
+++ b/i686-linux/lib/libstdc++.so.6
@@ -0,0 +1 @@
+libstdc++.so.6.0.13 \ No newline at end of file
diff --git a/i686-linux/lib/libstdc++.so.6.0.13 b/i686-linux/lib/libstdc++.so.6.0.13
new file mode 100755
index 0000000..f0c69fb
--- /dev/null
+++ b/i686-linux/lib/libstdc++.so.6.0.13
Binary files differ
diff --git a/i686-linux/lib/libsupc++.a b/i686-linux/lib/libsupc++.a
new file mode 100644
index 0000000..7e7a495
--- /dev/null
+++ b/i686-linux/lib/libsupc++.a
Binary files differ
diff --git a/i686-linux/lib/libsupc++.la b/i686-linux/lib/libsupc++.la
new file mode 100755
index 0000000..12320a1
--- /dev/null
+++ b/i686-linux/lib/libsupc++.la
@@ -0,0 +1,41 @@
+# libsupc++.la - a libtool library file
+# Generated by ltmain.sh (GNU libtool) 2.2.6
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname=''
+
+# Names of this library.
+library_names=''
+
+# The name of the static archive.
+old_library='libsupc++.a'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags=''
+
+# Libraries that this one depends upon.
+dependency_libs=''
+
+# Names of additional weak libraries provided by this library
+weak_library_names=''
+
+# Version information for libsupc++.
+current=0
+age=0
+revision=0
+
+# Is this an already installed library?
+installed=yes
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=no
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir='/tmp/gcc32/1/i686-linux-glibc2.7-4.4.3/i686-linux/lib'
diff --git a/include/gmp.h b/include/gmp.h
new file mode 100644
index 0000000..6f7d6b3
--- /dev/null
+++ b/include/gmp.h
@@ -0,0 +1,2183 @@
+/* Definitions for GNU multiple precision functions. -*- mode: c -*-
+
+Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003,
+2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
+
+#ifndef __GMP_H__
+
+#if defined (__cplusplus)
+#include <iosfwd> /* for std::istream, std::ostream, std::string */
+#include <cstdio>
+#endif
+
+
+/* Instantiated by configure. */
+#if ! defined (__GMP_WITHIN_CONFIGURE)
+#define __GMP_BITS_PER_MP_LIMB 32
+#define __GMP_HAVE_HOST_CPU_FAMILY_power 0
+#define __GMP_HAVE_HOST_CPU_FAMILY_powerpc 0
+#define GMP_LIMB_BITS 32
+#define GMP_NAIL_BITS 0
+#endif
+#define GMP_NUMB_BITS (GMP_LIMB_BITS - GMP_NAIL_BITS)
+#define GMP_NUMB_MASK ((~ __GMP_CAST (mp_limb_t, 0)) >> GMP_NAIL_BITS)
+#define GMP_NUMB_MAX GMP_NUMB_MASK
+#define GMP_NAIL_MASK (~ GMP_NUMB_MASK)
+
+
+/* The following (everything under ifndef __GNU_MP__) must be identical in
+ gmp.h and mp.h to allow both to be included in an application or during
+ the library build. */
+#ifndef __GNU_MP__
+#define __GNU_MP__ 4
+
+#define __need_size_t /* tell gcc stddef.h we only want size_t */
+#if defined (__cplusplus)
+#include <cstddef> /* for size_t */
+#else
+#include <stddef.h> /* for size_t */
+#endif
+#undef __need_size_t
+
+/* Instantiated by configure. */
+#if ! defined (__GMP_WITHIN_CONFIGURE)
+/* #undef _LONG_LONG_LIMB */
+#define __GMP_LIBGMP_DLL 0
+#endif
+
+
+/* __STDC__ - some ANSI compilers define this only to 0, hence the use of
+ "defined" and not "__STDC__-0". In particular Sun workshop C 5.0
+ sets __STDC__ to 0, but requires "##" for token pasting.
+
+ _AIX - gnu ansidecl.h asserts that all known AIX compilers are ANSI but
+ don't always define __STDC__.
+
+ __DECC - current versions of DEC C (5.9 for instance) for alpha are ANSI,
+ but don't define __STDC__ in their default mode. Don't know if old
+ versions might have been K&R, but let's not worry about that unless
+ someone is still using one.
+
+ _mips - gnu ansidecl.h says the RISC/OS MIPS compiler is ANSI in SVR4
+ mode, but doesn't define __STDC__.
+
+ _MSC_VER - Microsoft C is ANSI, but __STDC__ is undefined unless the /Za
+ option is given (in which case it's 1).
+
+ _WIN32 - tested for by gnu ansidecl.h, no doubt on the assumption that
+ all w32 compilers are ansi.
+
+ Note: This same set of tests is used by gen-psqr.c and
+ demos/expr/expr-impl.h, so if anything needs adding, then be sure to
+ update those too. */
+
+#if defined (__STDC__) \
+ || defined (__cplusplus) \
+ || defined (_AIX) \
+ || defined (__DECC) \
+ || (defined (__mips) && defined (_SYSTYPE_SVR4)) \
+ || defined (_MSC_VER) \
+ || defined (_WIN32)
+#define __GMP_HAVE_CONST 1
+#define __GMP_HAVE_PROTOTYPES 1
+#define __GMP_HAVE_TOKEN_PASTE 1
+#else
+#define __GMP_HAVE_CONST 0
+#define __GMP_HAVE_PROTOTYPES 0
+#define __GMP_HAVE_TOKEN_PASTE 0
+#endif
+
+
+#if __GMP_HAVE_CONST
+#define __gmp_const const
+#define __gmp_signed signed
+#else
+#define __gmp_const
+#define __gmp_signed
+#endif
+
+
+/* __GMP_DECLSPEC supports Windows DLL versions of libgmp, and is empty in
+ all other circumstances.
+
+ When compiling objects for libgmp, __GMP_DECLSPEC is an export directive,
+ or when compiling for an application it's an import directive. The two
+ cases are differentiated by __GMP_WITHIN_GMP defined by the GMP Makefiles
+ (and not defined from an application).
+
+ __GMP_DECLSPEC_XX is similarly used for libgmpxx. __GMP_WITHIN_GMPXX
+ indicates when building libgmpxx, and in that case libgmpxx functions are
+ exports, but libgmp functions which might get called are imports.
+
+ libmp.la uses __GMP_DECLSPEC, just as if it were libgmp.la. libgmp and
+ libmp don't call each other, so there's no conflict or confusion.
+
+ Libtool DLL_EXPORT define is not used.
+
+ There's no attempt to support GMP built both static and DLL. Doing so
+ would mean applications would have to tell us which of the two is going
+ to be used when linking, and that seems very tedious and error prone if
+ using GMP by hand, and equally tedious from a package since autoconf and
+ automake don't give much help.
+
+ __GMP_DECLSPEC is required on all documented global functions and
+ variables, the various internals in gmp-impl.h etc can be left unadorned.
+ But internals used by the test programs or speed measuring programs
+ should have __GMP_DECLSPEC, and certainly constants or variables must
+ have it or the wrong address will be resolved.
+
+ In gcc __declspec can go at either the start or end of a prototype.
+
+ In Microsoft C __declspec must go at the start, or after the type like
+ void __declspec(...) *foo()". There's no __dllexport or anything to
+ guard against someone foolish #defining dllexport. _export used to be
+ available, but no longer.
+
+ In Borland C _export still exists, but needs to go after the type, like
+ "void _export foo();". Would have to change the __GMP_DECLSPEC syntax to
+ make use of that. Probably more trouble than it's worth. */
+
+#if defined (__GNUC__)
+#define __GMP_DECLSPEC_EXPORT __declspec(__dllexport__)
+#define __GMP_DECLSPEC_IMPORT __declspec(__dllimport__)
+#endif
+#if defined (_MSC_VER) || defined (__BORLANDC__)
+#define __GMP_DECLSPEC_EXPORT __declspec(dllexport)
+#define __GMP_DECLSPEC_IMPORT __declspec(dllimport)
+#endif
+#ifdef __WATCOMC__
+#define __GMP_DECLSPEC_EXPORT __export
+#define __GMP_DECLSPEC_IMPORT __import
+#endif
+#ifdef __IBMC__
+#define __GMP_DECLSPEC_EXPORT _Export
+#define __GMP_DECLSPEC_IMPORT _Import
+#endif
+
+#if __GMP_LIBGMP_DLL
+#if __GMP_WITHIN_GMP
+/* compiling to go into a DLL libgmp */
+#define __GMP_DECLSPEC __GMP_DECLSPEC_EXPORT
+#else
+/* compiling to go into an application which will link to a DLL libgmp */
+#define __GMP_DECLSPEC __GMP_DECLSPEC_IMPORT
+#endif
+#else
+/* all other cases */
+#define __GMP_DECLSPEC
+#endif
+
+
+#ifdef __GMP_SHORT_LIMB
+typedef unsigned int mp_limb_t;
+typedef int mp_limb_signed_t;
+#else
+#ifdef _LONG_LONG_LIMB
+typedef unsigned long long int mp_limb_t;
+typedef long long int mp_limb_signed_t;
+#else
+typedef unsigned long int mp_limb_t;
+typedef long int mp_limb_signed_t;
+#endif
+#endif
+
+/* For reference, note that the name __mpz_struct gets into C++ mangled
+ function names, which means although the "__" suggests an internal, we
+ must leave this name for binary compatibility. */
+typedef struct
+{
+ int _mp_alloc; /* Number of *limbs* allocated and pointed
+ to by the _mp_d field. */
+ int _mp_size; /* abs(_mp_size) is the number of limbs the
+ last field points to. If _mp_size is
+ negative this is a negative number. */
+ mp_limb_t *_mp_d; /* Pointer to the limbs. */
+} __mpz_struct;
+
+#endif /* __GNU_MP__ */
+
+
+typedef __mpz_struct MP_INT; /* gmp 1 source compatibility */
+typedef __mpz_struct mpz_t[1];
+
+typedef mp_limb_t * mp_ptr;
+typedef __gmp_const mp_limb_t * mp_srcptr;
+#if defined (_CRAY) && ! defined (_CRAYMPP)
+/* plain `int' is much faster (48 bits) */
+#define __GMP_MP_SIZE_T_INT 1
+typedef int mp_size_t;
+typedef int mp_exp_t;
+#else
+#define __GMP_MP_SIZE_T_INT 0
+typedef long int mp_size_t;
+typedef long int mp_exp_t;
+#endif
+
+typedef struct
+{
+ __mpz_struct _mp_num;
+ __mpz_struct _mp_den;
+} __mpq_struct;
+
+typedef __mpq_struct MP_RAT; /* gmp 1 source compatibility */
+typedef __mpq_struct mpq_t[1];
+
+typedef struct
+{
+ int _mp_prec; /* Max precision, in number of `mp_limb_t's.
+ Set by mpf_init and modified by
+ mpf_set_prec. The area pointed to by the
+ _mp_d field contains `prec' + 1 limbs. */
+ int _mp_size; /* abs(_mp_size) is the number of limbs the
+ last field points to. If _mp_size is
+ negative this is a negative number. */
+ mp_exp_t _mp_exp; /* Exponent, in the base of `mp_limb_t'. */
+ mp_limb_t *_mp_d; /* Pointer to the limbs. */
+} __mpf_struct;
+
+/* typedef __mpf_struct MP_FLOAT; */
+typedef __mpf_struct mpf_t[1];
+
+/* Available random number generation algorithms. */
+typedef enum
+{
+ GMP_RAND_ALG_DEFAULT = 0,
+ GMP_RAND_ALG_LC = GMP_RAND_ALG_DEFAULT /* Linear congruential. */
+} gmp_randalg_t;
+
+/* Random state struct. */
+typedef struct
+{
+ mpz_t _mp_seed; /* _mp_d member points to state of the generator. */
+ gmp_randalg_t _mp_alg; /* Currently unused. */
+ union {
+ void *_mp_lc; /* Pointer to function pointers structure. */
+ } _mp_algdata;
+} __gmp_randstate_struct;
+typedef __gmp_randstate_struct gmp_randstate_t[1];
+
+/* Types for function declarations in gmp files. */
+/* ??? Should not pollute user name space with these ??? */
+typedef __gmp_const __mpz_struct *mpz_srcptr;
+typedef __mpz_struct *mpz_ptr;
+typedef __gmp_const __mpf_struct *mpf_srcptr;
+typedef __mpf_struct *mpf_ptr;
+typedef __gmp_const __mpq_struct *mpq_srcptr;
+typedef __mpq_struct *mpq_ptr;
+
+
+/* This is not wanted in mp.h, so put it outside the __GNU_MP__ common
+ section. */
+#if __GMP_LIBGMP_DLL
+#if __GMP_WITHIN_GMPXX
+/* compiling to go into a DLL libgmpxx */
+#define __GMP_DECLSPEC_XX __GMP_DECLSPEC_EXPORT
+#else
+/* compiling to go into a application which will link to a DLL libgmpxx */
+#define __GMP_DECLSPEC_XX __GMP_DECLSPEC_IMPORT
+#endif
+#else
+/* all other cases */
+#define __GMP_DECLSPEC_XX
+#endif
+
+
+#if __GMP_HAVE_PROTOTYPES
+#define __GMP_PROTO(x) x
+#else
+#define __GMP_PROTO(x) ()
+#endif
+
+#ifndef __MPN
+#if __GMP_HAVE_TOKEN_PASTE
+#define __MPN(x) __gmpn_##x
+#else
+#define __MPN(x) __gmpn_/**/x
+#endif
+#endif
+
+/* For reference, "defined(EOF)" cannot be used here. In g++ 2.95.4,
+ <iostream> defines EOF but not FILE. */
+#if defined (FILE) \
+ || defined (H_STDIO) \
+ || defined (_H_STDIO) /* AIX */ \
+ || defined (_STDIO_H) /* glibc, Sun, SCO */ \
+ || defined (_STDIO_H_) /* BSD, OSF */ \
+ || defined (__STDIO_H) /* Borland */ \
+ || defined (__STDIO_H__) /* IRIX */ \
+ || defined (_STDIO_INCLUDED) /* HPUX */ \
+ || defined (__dj_include_stdio_h_) /* DJGPP */ \
+ || defined (_FILE_DEFINED) /* Microsoft */ \
+ || defined (__STDIO__) /* Apple MPW MrC */ \
+ || defined (_MSL_STDIO_H) /* Metrowerks */ \
+ || defined (_STDIO_H_INCLUDED) /* QNX4 */ \
+ || defined (_ISO_STDIO_ISO_H) /* Sun C++ */
+#define _GMP_H_HAVE_FILE 1
+#endif
+
+/* In ISO C, if a prototype involving "struct obstack *" is given without
+ that structure defined, then the struct is scoped down to just the
+ prototype, causing a conflict if it's subsequently defined for real. So
+ only give prototypes if we've got obstack.h. */
+#if defined (_OBSTACK_H) /* glibc <obstack.h> */
+#define _GMP_H_HAVE_OBSTACK 1
+#endif
+
+/* The prototypes for gmp_vprintf etc are provided only if va_list is
+ available, via an application having included <stdarg.h> or <varargs.h>.
+ Usually va_list is a typedef so can't be tested directly, but C99
+ specifies that va_start is a macro (and it was normally a macro on past
+ systems too), so look for that.
+
+ <stdio.h> will define some sort of va_list for vprintf and vfprintf, but
+ let's not bother trying to use that since it's not standard and since
+ application uses for gmp_vprintf etc will almost certainly require the
+ whole <stdarg.h> or <varargs.h> anyway. */
+
+#ifdef va_start
+#define _GMP_H_HAVE_VA_LIST 1
+#endif
+
+/* Test for gcc >= maj.min, as per __GNUC_PREREQ in glibc */
+#if defined (__GNUC__) && defined (__GNUC_MINOR__)
+#define __GMP_GNUC_PREREQ(maj, min) \
+ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
+#else
+#define __GMP_GNUC_PREREQ(maj, min) 0
+#endif
+
+/* "pure" is in gcc 2.96 and up, see "(gcc)Function Attributes". Basically
+ it means a function does nothing but examine its arguments and memory
+ (global or via arguments) to generate a return value, but changes nothing
+ and has no side-effects. __GMP_NO_ATTRIBUTE_CONST_PURE lets
+ tune/common.c etc turn this off when trying to write timing loops. */
+#if __GMP_GNUC_PREREQ (2,96) && ! defined (__GMP_NO_ATTRIBUTE_CONST_PURE)
+#define __GMP_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#else
+#define __GMP_ATTRIBUTE_PURE
+#endif
+
+
+/* __GMP_CAST allows us to use static_cast in C++, so our macros are clean
+ to "g++ -Wold-style-cast".
+
+ Casts in "extern inline" code within an extern "C" block don't induce
+ these warnings, so __GMP_CAST only needs to be used on documented
+ macros. */
+
+#ifdef __cplusplus
+#define __GMP_CAST(type, expr) (static_cast<type> (expr))
+#else
+#define __GMP_CAST(type, expr) ((type) (expr))
+#endif
+
+
+/* An empty "throw ()" means the function doesn't throw any C++ exceptions,
+ this can save some stack frame info in applications.
+
+ Currently it's given only on functions which never divide-by-zero etc,
+ don't allocate memory, and are expected to never need to allocate memory.
+ This leaves open the possibility of a C++ throw from a future GMP
+ exceptions scheme.
+
+ mpz_set_ui etc are omitted to leave open the lazy allocation scheme
+ described in doc/tasks.html. mpz_get_d etc are omitted to leave open
+ exceptions for float overflows.
+
+ Note that __GMP_NOTHROW must be given on any inlines the same as on their
+ prototypes (for g++ at least, where they're used together). Note also
+ that g++ 3.0 demands that __GMP_NOTHROW is before other attributes like
+ __GMP_ATTRIBUTE_PURE. */
+
+#if defined (__cplusplus)
+#define __GMP_NOTHROW throw ()
+#else
+#define __GMP_NOTHROW
+#endif
+
+
+/* PORTME: What other compilers have a useful "extern inline"? "static
+ inline" would be an acceptable substitute if the compiler (or linker)
+ discards unused statics. */
+
+ /* gcc has __inline__ in all modes, including strict ansi. Give a prototype
+ for an inline too, so as to correctly specify "dllimport" on windows, in
+ case the function is called rather than inlined.
+ GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
+ inline semantics, unless -fgnu89-inline is used. */
+#ifdef __GNUC__
+#if (defined __GNUC_STDC_INLINE__) || (__GNUC__ == 4 && __GNUC_MINOR__ == 2)
+#define __GMP_EXTERN_INLINE extern __inline__ __attribute__ ((__gnu_inline__))
+#else
+#define __GMP_EXTERN_INLINE extern __inline__
+#endif
+#define __GMP_INLINE_PROTOTYPES 1
+#endif
+
+/* DEC C (eg. version 5.9) supports "static __inline foo()", even in -std1
+ strict ANSI mode. Inlining is done even when not optimizing (ie. -O0
+ mode, which is the default), but an unnecessary local copy of foo is
+ emitted unless -O is used. "extern __inline" is accepted, but the
+ "extern" appears to be ignored, ie. it becomes a plain global function
+ but which is inlined within its file. Don't know if all old versions of
+ DEC C supported __inline, but as a start let's do the right thing for
+ current versions. */
+#ifdef __DECC
+#define __GMP_EXTERN_INLINE static __inline
+#endif
+
+/* SCO OpenUNIX 8 cc supports "static inline foo()" but not in -Xc strict
+ ANSI mode (__STDC__ is 1 in that mode). Inlining only actually takes
+ place under -O. Without -O "foo" seems to be emitted whether it's used
+ or not, which is wasteful. "extern inline foo()" isn't useful, the
+ "extern" is apparently ignored, so foo is inlined if possible but also
+ emitted as a global, which causes multiple definition errors when
+ building a shared libgmp. */
+#ifdef __SCO_VERSION__
+#if __SCO_VERSION__ > 400000000 && __STDC__ != 1 \
+ && ! defined (__GMP_EXTERN_INLINE)
+#define __GMP_EXTERN_INLINE static inline
+#endif
+#endif
+
+/* C++ always has "inline" and since it's a normal feature the linker should
+ discard duplicate non-inlined copies, or if it doesn't then that's a
+ problem for everyone, not just GMP. */
+#if defined (__cplusplus) && ! defined (__GMP_EXTERN_INLINE)
+#define __GMP_EXTERN_INLINE inline
+#endif
+
+/* Don't do any inlining within a configure run, since if the compiler ends
+ up emitting copies of the code into the object file it can end up
+ demanding the various support routines (like mpn_popcount) for linking,
+ making the "alloca" test and perhaps others fail. And on hppa ia64 a
+ pre-release gcc 3.2 was seen not respecting the "extern" in "extern
+ __inline__", triggering this problem too. */
+#if defined (__GMP_WITHIN_CONFIGURE) && ! __GMP_WITHIN_CONFIGURE_INLINE
+#undef __GMP_EXTERN_INLINE
+#endif
+
+/* By default, don't give a prototype when there's going to be an inline
+ version. Note in particular that Cray C++ objects to the combination of
+ prototype and inline. */
+#ifdef __GMP_EXTERN_INLINE
+#ifndef __GMP_INLINE_PROTOTYPES
+#define __GMP_INLINE_PROTOTYPES 0
+#endif
+#else
+#define __GMP_INLINE_PROTOTYPES 1
+#endif
+
+
+#define __GMP_ABS(x) ((x) >= 0 ? (x) : -(x))
+#define __GMP_MAX(h,i) ((h) > (i) ? (h) : (i))
+
+/* __GMP_USHRT_MAX is not "~ (unsigned short) 0" because short is promoted
+ to int by "~". */
+#define __GMP_UINT_MAX (~ (unsigned) 0)
+#define __GMP_ULONG_MAX (~ (unsigned long) 0)
+#define __GMP_USHRT_MAX ((unsigned short) ~0)
+
+
+/* __builtin_expect is in gcc 3.0, and not in 2.95. */
+#if __GMP_GNUC_PREREQ (3,0)
+#define __GMP_LIKELY(cond) __builtin_expect ((cond) != 0, 1)
+#define __GMP_UNLIKELY(cond) __builtin_expect ((cond) != 0, 0)
+#else
+#define __GMP_LIKELY(cond) (cond)
+#define __GMP_UNLIKELY(cond) (cond)
+#endif
+
+#ifdef _CRAY
+#define __GMP_CRAY_Pragma(str) _Pragma (str)
+#else
+#define __GMP_CRAY_Pragma(str)
+#endif
+
+
+/* Allow direct user access to numerator and denominator of a mpq_t object. */
+#define mpq_numref(Q) (&((Q)->_mp_num))
+#define mpq_denref(Q) (&((Q)->_mp_den))
+
+
+#if defined (__cplusplus)
+extern "C" {
+using std::FILE;
+#endif
+
+#define mp_set_memory_functions __gmp_set_memory_functions
+__GMP_DECLSPEC void mp_set_memory_functions __GMP_PROTO ((void *(*) (size_t),
+ void *(*) (void *, size_t, size_t),
+ void (*) (void *, size_t))) __GMP_NOTHROW;
+
+#define mp_get_memory_functions __gmp_get_memory_functions
+__GMP_DECLSPEC void mp_get_memory_functions __GMP_PROTO ((void *(**) (size_t),
+ void *(**) (void *, size_t, size_t),
+ void (**) (void *, size_t))) __GMP_NOTHROW;
+
+#define mp_bits_per_limb __gmp_bits_per_limb
+__GMP_DECLSPEC extern __gmp_const int mp_bits_per_limb;
+
+#define gmp_errno __gmp_errno
+__GMP_DECLSPEC extern int gmp_errno;
+
+#define gmp_version __gmp_version
+__GMP_DECLSPEC extern __gmp_const char * __gmp_const gmp_version;
+
+
+/**************** Random number routines. ****************/
+
+/* obsolete */
+#define gmp_randinit __gmp_randinit
+__GMP_DECLSPEC void gmp_randinit __GMP_PROTO ((gmp_randstate_t, gmp_randalg_t, ...));
+
+#define gmp_randinit_default __gmp_randinit_default
+__GMP_DECLSPEC void gmp_randinit_default __GMP_PROTO ((gmp_randstate_t));
+
+#define gmp_randinit_lc_2exp __gmp_randinit_lc_2exp
+__GMP_DECLSPEC void gmp_randinit_lc_2exp __GMP_PROTO ((gmp_randstate_t,
+ mpz_srcptr, unsigned long int,
+ unsigned long int));
+
+#define gmp_randinit_lc_2exp_size __gmp_randinit_lc_2exp_size
+__GMP_DECLSPEC int gmp_randinit_lc_2exp_size __GMP_PROTO ((gmp_randstate_t, unsigned long));
+
+#define gmp_randinit_mt __gmp_randinit_mt
+__GMP_DECLSPEC void gmp_randinit_mt __GMP_PROTO ((gmp_randstate_t));
+
+#define gmp_randinit_set __gmp_randinit_set
+void gmp_randinit_set __GMP_PROTO ((gmp_randstate_t, __gmp_const __gmp_randstate_struct *));
+
+#define gmp_randseed __gmp_randseed
+__GMP_DECLSPEC void gmp_randseed __GMP_PROTO ((gmp_randstate_t, mpz_srcptr));
+
+#define gmp_randseed_ui __gmp_randseed_ui
+__GMP_DECLSPEC void gmp_randseed_ui __GMP_PROTO ((gmp_randstate_t, unsigned long int));
+
+#define gmp_randclear __gmp_randclear
+__GMP_DECLSPEC void gmp_randclear __GMP_PROTO ((gmp_randstate_t));
+
+#define gmp_urandomb_ui __gmp_urandomb_ui
+unsigned long gmp_urandomb_ui __GMP_PROTO ((gmp_randstate_t, unsigned long));
+
+#define gmp_urandomm_ui __gmp_urandomm_ui
+unsigned long gmp_urandomm_ui __GMP_PROTO ((gmp_randstate_t, unsigned long));
+
+
+/**************** Formatted output routines. ****************/
+
+#define gmp_asprintf __gmp_asprintf
+__GMP_DECLSPEC int gmp_asprintf __GMP_PROTO ((char **, __gmp_const char *, ...));
+
+#define gmp_fprintf __gmp_fprintf
+#ifdef _GMP_H_HAVE_FILE
+__GMP_DECLSPEC int gmp_fprintf __GMP_PROTO ((FILE *, __gmp_const char *, ...));
+#endif
+
+#define gmp_obstack_printf __gmp_obstack_printf
+#if defined (_GMP_H_HAVE_OBSTACK)
+__GMP_DECLSPEC int gmp_obstack_printf __GMP_PROTO ((struct obstack *, __gmp_const char *, ...));
+#endif
+
+#define gmp_obstack_vprintf __gmp_obstack_vprintf
+#if defined (_GMP_H_HAVE_OBSTACK) && defined (_GMP_H_HAVE_VA_LIST)
+__GMP_DECLSPEC int gmp_obstack_vprintf __GMP_PROTO ((struct obstack *, __gmp_const char *, va_list));
+#endif
+
+#define gmp_printf __gmp_printf
+__GMP_DECLSPEC int gmp_printf __GMP_PROTO ((__gmp_const char *, ...));
+
+#define gmp_snprintf __gmp_snprintf
+__GMP_DECLSPEC int gmp_snprintf __GMP_PROTO ((char *, size_t, __gmp_const char *, ...));
+
+#define gmp_sprintf __gmp_sprintf
+__GMP_DECLSPEC int gmp_sprintf __GMP_PROTO ((char *, __gmp_const char *, ...));
+
+#define gmp_vasprintf __gmp_vasprintf
+#if defined (_GMP_H_HAVE_VA_LIST)
+__GMP_DECLSPEC int gmp_vasprintf __GMP_PROTO ((char **, __gmp_const char *, va_list));
+#endif
+
+#define gmp_vfprintf __gmp_vfprintf
+#if defined (_GMP_H_HAVE_FILE) && defined (_GMP_H_HAVE_VA_LIST)
+__GMP_DECLSPEC int gmp_vfprintf __GMP_PROTO ((FILE *, __gmp_const char *, va_list));
+#endif
+
+#define gmp_vprintf __gmp_vprintf
+#if defined (_GMP_H_HAVE_VA_LIST)
+__GMP_DECLSPEC int gmp_vprintf __GMP_PROTO ((__gmp_const char *, va_list));
+#endif
+
+#define gmp_vsnprintf __gmp_vsnprintf
+#if defined (_GMP_H_HAVE_VA_LIST)
+__GMP_DECLSPEC int gmp_vsnprintf __GMP_PROTO ((char *, size_t, __gmp_const char *, va_list));
+#endif
+
+#define gmp_vsprintf __gmp_vsprintf
+#if defined (_GMP_H_HAVE_VA_LIST)
+__GMP_DECLSPEC int gmp_vsprintf __GMP_PROTO ((char *, __gmp_const char *, va_list));
+#endif
+
+
+/**************** Formatted input routines. ****************/
+
+#define gmp_fscanf __gmp_fscanf
+#ifdef _GMP_H_HAVE_FILE
+__GMP_DECLSPEC int gmp_fscanf __GMP_PROTO ((FILE *, __gmp_const char *, ...));
+#endif
+
+#define gmp_scanf __gmp_scanf
+__GMP_DECLSPEC int gmp_scanf __GMP_PROTO ((__gmp_const char *, ...));
+
+#define gmp_sscanf __gmp_sscanf
+__GMP_DECLSPEC int gmp_sscanf __GMP_PROTO ((__gmp_const char *, __gmp_const char *, ...));
+
+#define gmp_vfscanf __gmp_vfscanf
+#if defined (_GMP_H_HAVE_FILE) && defined (_GMP_H_HAVE_VA_LIST)
+__GMP_DECLSPEC int gmp_vfscanf __GMP_PROTO ((FILE *, __gmp_const char *, va_list));
+#endif
+
+#define gmp_vscanf __gmp_vscanf
+#if defined (_GMP_H_HAVE_VA_LIST)
+__GMP_DECLSPEC int gmp_vscanf __GMP_PROTO ((__gmp_const char *, va_list));
+#endif
+
+#define gmp_vsscanf __gmp_vsscanf
+#if defined (_GMP_H_HAVE_VA_LIST)
+__GMP_DECLSPEC int gmp_vsscanf __GMP_PROTO ((__gmp_const char *, __gmp_const char *, va_list));
+#endif
+
+
+/**************** Integer (i.e. Z) routines. ****************/
+
+#define _mpz_realloc __gmpz_realloc
+#define mpz_realloc __gmpz_realloc
+__GMP_DECLSPEC void *_mpz_realloc __GMP_PROTO ((mpz_ptr, mp_size_t));
+
+#define mpz_abs __gmpz_abs
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpz_abs)
+__GMP_DECLSPEC void mpz_abs __GMP_PROTO ((mpz_ptr, mpz_srcptr));
+#endif
+
+#define mpz_add __gmpz_add
+__GMP_DECLSPEC void mpz_add __GMP_PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
+
+#define mpz_add_ui __gmpz_add_ui
+__GMP_DECLSPEC void mpz_add_ui __GMP_PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
+
+#define mpz_addmul __gmpz_addmul
+__GMP_DECLSPEC void mpz_addmul __GMP_PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
+
+#define mpz_addmul_ui __gmpz_addmul_ui
+__GMP_DECLSPEC void mpz_addmul_ui __GMP_PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
+
+#define mpz_and __gmpz_and
+__GMP_DECLSPEC void mpz_and __GMP_PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
+
+#define mpz_array_init __gmpz_array_init
+__GMP_DECLSPEC void mpz_array_init __GMP_PROTO ((mpz_ptr, mp_size_t, mp_size_t));
+
+#define mpz_bin_ui __gmpz_bin_ui
+__GMP_DECLSPEC void mpz_bin_ui __GMP_PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
+
+#define mpz_bin_uiui __gmpz_bin_uiui
+__GMP_DECLSPEC void mpz_bin_uiui __GMP_PROTO ((mpz_ptr, unsigned long int, unsigned long int));
+
+#define mpz_cdiv_q __gmpz_cdiv_q
+__GMP_DECLSPEC void mpz_cdiv_q __GMP_PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
+
+#define mpz_cdiv_q_2exp __gmpz_cdiv_q_2exp
+__GMP_DECLSPEC void mpz_cdiv_q_2exp __GMP_PROTO ((mpz_ptr, mpz_srcptr, unsigned long));
+
+#define mpz_cdiv_q_ui __gmpz_cdiv_q_ui
+__GMP_DECLSPEC unsigned long int mpz_cdiv_q_ui __GMP_PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
+
+#define mpz_cdiv_qr __gmpz_cdiv_qr
+__GMP_DECLSPEC void mpz_cdiv_qr __GMP_PROTO ((mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr));
+
+#define mpz_cdiv_qr_ui __gmpz_cdiv_qr_ui
+__GMP_DECLSPEC unsigned long int mpz_cdiv_qr_ui __GMP_PROTO ((mpz_ptr, mpz_ptr, mpz_srcptr, unsigned long int));
+
+#define mpz_cdiv_r __gmpz_cdiv_r
+__GMP_DECLSPEC void mpz_cdiv_r __GMP_PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
+
+#define mpz_cdiv_r_2exp __gmpz_cdiv_r_2exp
+__GMP_DECLSPEC void mpz_cdiv_r_2exp __GMP_PROTO ((mpz_ptr, mpz_srcptr, unsigned long));
+
+#define mpz_cdiv_r_ui __gmpz_cdiv_r_ui
+__GMP_DECLSPEC unsigned long int mpz_cdiv_r_ui __GMP_PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
+
+#define mpz_cdiv_ui __gmpz_cdiv_ui
+__GMP_DECLSPEC unsigned long int mpz_cdiv_ui __GMP_PROTO ((mpz_srcptr, unsigned long int)) __GMP_ATTRIBUTE_PURE;
+
+#define mpz_clear __gmpz_clear
+__GMP_DECLSPEC void mpz_clear __GMP_PROTO ((mpz_ptr));
+
+#define mpz_clrbit __gmpz_clrbit
+__GMP_DECLSPEC void mpz_clrbit __GMP_PROTO ((mpz_ptr, unsigned long int));
+
+#define mpz_cmp __gmpz_cmp
+__GMP_DECLSPEC int mpz_cmp __GMP_PROTO ((mpz_srcptr, mpz_srcptr)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpz_cmp_d __gmpz_cmp_d
+__GMP_DECLSPEC int mpz_cmp_d __GMP_PROTO ((mpz_srcptr, double)) __GMP_ATTRIBUTE_PURE;
+
+#define _mpz_cmp_si __gmpz_cmp_si
+__GMP_DECLSPEC int _mpz_cmp_si __GMP_PROTO ((mpz_srcptr, signed long int)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define _mpz_cmp_ui __gmpz_cmp_ui
+__GMP_DECLSPEC int _mpz_cmp_ui __GMP_PROTO ((mpz_srcptr, unsigned long int)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpz_cmpabs __gmpz_cmpabs
+__GMP_DECLSPEC int mpz_cmpabs __GMP_PROTO ((mpz_srcptr, mpz_srcptr)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpz_cmpabs_d __gmpz_cmpabs_d
+__GMP_DECLSPEC int mpz_cmpabs_d __GMP_PROTO ((mpz_srcptr, double)) __GMP_ATTRIBUTE_PURE;
+
+#define mpz_cmpabs_ui __gmpz_cmpabs_ui
+__GMP_DECLSPEC int mpz_cmpabs_ui __GMP_PROTO ((mpz_srcptr, unsigned long int)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpz_com __gmpz_com
+__GMP_DECLSPEC void mpz_com __GMP_PROTO ((mpz_ptr, mpz_srcptr));
+
+#define mpz_combit __gmpz_combit
+__GMP_DECLSPEC void mpz_combit __GMP_PROTO ((mpz_ptr, unsigned long int));
+
+#define mpz_congruent_p __gmpz_congruent_p
+__GMP_DECLSPEC int mpz_congruent_p __GMP_PROTO ((mpz_srcptr, mpz_srcptr, mpz_srcptr)) __GMP_ATTRIBUTE_PURE;
+
+#define mpz_congruent_2exp_p __gmpz_congruent_2exp_p
+__GMP_DECLSPEC int mpz_congruent_2exp_p __GMP_PROTO ((mpz_srcptr, mpz_srcptr, unsigned long)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpz_congruent_ui_p __gmpz_congruent_ui_p
+__GMP_DECLSPEC int mpz_congruent_ui_p __GMP_PROTO ((mpz_srcptr, unsigned long, unsigned long)) __GMP_ATTRIBUTE_PURE;
+
+#define mpz_divexact __gmpz_divexact
+__GMP_DECLSPEC void mpz_divexact __GMP_PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
+
+#define mpz_divexact_ui __gmpz_divexact_ui
+__GMP_DECLSPEC void mpz_divexact_ui __GMP_PROTO ((mpz_ptr, mpz_srcptr, unsigned long));
+
+#define mpz_divisible_p __gmpz_divisible_p
+__GMP_DECLSPEC int mpz_divisible_p __GMP_PROTO ((mpz_srcptr, mpz_srcptr)) __GMP_ATTRIBUTE_PURE;
+
+#define mpz_divisible_ui_p __gmpz_divisible_ui_p
+__GMP_DECLSPEC int mpz_divisible_ui_p __GMP_PROTO ((mpz_srcptr, unsigned long)) __GMP_ATTRIBUTE_PURE;
+
+#define mpz_divisible_2exp_p __gmpz_divisible_2exp_p
+__GMP_DECLSPEC int mpz_divisible_2exp_p __GMP_PROTO ((mpz_srcptr, unsigned long)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpz_dump __gmpz_dump
+__GMP_DECLSPEC void mpz_dump __GMP_PROTO ((mpz_srcptr));
+
+#define mpz_export __gmpz_export
+__GMP_DECLSPEC void *mpz_export __GMP_PROTO ((void *, size_t *, int, size_t, int, size_t, mpz_srcptr));
+
+#define mpz_fac_ui __gmpz_fac_ui
+__GMP_DECLSPEC void mpz_fac_ui __GMP_PROTO ((mpz_ptr, unsigned long int));
+
+#define mpz_fdiv_q __gmpz_fdiv_q
+__GMP_DECLSPEC void mpz_fdiv_q __GMP_PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
+
+#define mpz_fdiv_q_2exp __gmpz_fdiv_q_2exp
+__GMP_DECLSPEC void mpz_fdiv_q_2exp __GMP_PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
+
+#define mpz_fdiv_q_ui __gmpz_fdiv_q_ui
+__GMP_DECLSPEC unsigned long int mpz_fdiv_q_ui __GMP_PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
+
+#define mpz_fdiv_qr __gmpz_fdiv_qr
+__GMP_DECLSPEC void mpz_fdiv_qr __GMP_PROTO ((mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr));
+
+#define mpz_fdiv_qr_ui __gmpz_fdiv_qr_ui
+__GMP_DECLSPEC unsigned long int mpz_fdiv_qr_ui __GMP_PROTO ((mpz_ptr, mpz_ptr, mpz_srcptr, unsigned long int));
+
+#define mpz_fdiv_r __gmpz_fdiv_r
+__GMP_DECLSPEC void mpz_fdiv_r __GMP_PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
+
+#define mpz_fdiv_r_2exp __gmpz_fdiv_r_2exp
+__GMP_DECLSPEC void mpz_fdiv_r_2exp __GMP_PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
+
+#define mpz_fdiv_r_ui __gmpz_fdiv_r_ui
+__GMP_DECLSPEC unsigned long int mpz_fdiv_r_ui __GMP_PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
+
+#define mpz_fdiv_ui __gmpz_fdiv_ui
+__GMP_DECLSPEC unsigned long int mpz_fdiv_ui __GMP_PROTO ((mpz_srcptr, unsigned long int)) __GMP_ATTRIBUTE_PURE;
+
+#define mpz_fib_ui __gmpz_fib_ui
+__GMP_DECLSPEC void mpz_fib_ui __GMP_PROTO ((mpz_ptr, unsigned long int));
+
+#define mpz_fib2_ui __gmpz_fib2_ui
+__GMP_DECLSPEC void mpz_fib2_ui __GMP_PROTO ((mpz_ptr, mpz_ptr, unsigned long int));
+
+#define mpz_fits_sint_p __gmpz_fits_sint_p
+__GMP_DECLSPEC int mpz_fits_sint_p __GMP_PROTO ((mpz_srcptr)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpz_fits_slong_p __gmpz_fits_slong_p
+__GMP_DECLSPEC int mpz_fits_slong_p __GMP_PROTO ((mpz_srcptr)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpz_fits_sshort_p __gmpz_fits_sshort_p
+__GMP_DECLSPEC int mpz_fits_sshort_p __GMP_PROTO ((mpz_srcptr)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpz_fits_uint_p __gmpz_fits_uint_p
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpz_fits_uint_p)
+__GMP_DECLSPEC int mpz_fits_uint_p __GMP_PROTO ((mpz_srcptr)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+#endif
+
+#define mpz_fits_ulong_p __gmpz_fits_ulong_p
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpz_fits_ulong_p)
+__GMP_DECLSPEC int mpz_fits_ulong_p __GMP_PROTO ((mpz_srcptr)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+#endif
+
+#define mpz_fits_ushort_p __gmpz_fits_ushort_p
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpz_fits_ushort_p)
+__GMP_DECLSPEC int mpz_fits_ushort_p __GMP_PROTO ((mpz_srcptr)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+#endif
+
+#define mpz_gcd __gmpz_gcd
+__GMP_DECLSPEC void mpz_gcd __GMP_PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
+
+#define mpz_gcd_ui __gmpz_gcd_ui
+__GMP_DECLSPEC unsigned long int mpz_gcd_ui __GMP_PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
+
+#define mpz_gcdext __gmpz_gcdext
+__GMP_DECLSPEC void mpz_gcdext __GMP_PROTO ((mpz_ptr, mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr));
+
+#define mpz_get_d __gmpz_get_d
+__GMP_DECLSPEC double mpz_get_d __GMP_PROTO ((mpz_srcptr)) __GMP_ATTRIBUTE_PURE;
+
+#define mpz_get_d_2exp __gmpz_get_d_2exp
+__GMP_DECLSPEC double mpz_get_d_2exp __GMP_PROTO ((signed long int *, mpz_srcptr));
+
+#define mpz_get_si __gmpz_get_si
+__GMP_DECLSPEC /* signed */ long int mpz_get_si __GMP_PROTO ((mpz_srcptr)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpz_get_str __gmpz_get_str
+__GMP_DECLSPEC char *mpz_get_str __GMP_PROTO ((char *, int, mpz_srcptr));
+
+#define mpz_get_ui __gmpz_get_ui
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpz_get_ui)
+__GMP_DECLSPEC unsigned long int mpz_get_ui __GMP_PROTO ((mpz_srcptr)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+#endif
+
+#define mpz_getlimbn __gmpz_getlimbn
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpz_getlimbn)
+__GMP_DECLSPEC mp_limb_t mpz_getlimbn __GMP_PROTO ((mpz_srcptr, mp_size_t)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+#endif
+
+#define mpz_hamdist __gmpz_hamdist
+__GMP_DECLSPEC unsigned long int mpz_hamdist __GMP_PROTO ((mpz_srcptr, mpz_srcptr)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpz_import __gmpz_import
+__GMP_DECLSPEC void mpz_import __GMP_PROTO ((mpz_ptr, size_t, int, size_t, int, size_t, __gmp_const void *));
+
+#define mpz_init __gmpz_init
+__GMP_DECLSPEC void mpz_init __GMP_PROTO ((mpz_ptr));
+
+#define mpz_init2 __gmpz_init2
+__GMP_DECLSPEC void mpz_init2 __GMP_PROTO ((mpz_ptr, unsigned long));
+
+#define mpz_init_set __gmpz_init_set
+__GMP_DECLSPEC void mpz_init_set __GMP_PROTO ((mpz_ptr, mpz_srcptr));
+
+#define mpz_init_set_d __gmpz_init_set_d
+__GMP_DECLSPEC void mpz_init_set_d __GMP_PROTO ((mpz_ptr, double));
+
+#define mpz_init_set_si __gmpz_init_set_si
+__GMP_DECLSPEC void mpz_init_set_si __GMP_PROTO ((mpz_ptr, signed long int));
+
+#define mpz_init_set_str __gmpz_init_set_str
+__GMP_DECLSPEC int mpz_init_set_str __GMP_PROTO ((mpz_ptr, __gmp_const char *, int));
+
+#define mpz_init_set_ui __gmpz_init_set_ui
+__GMP_DECLSPEC void mpz_init_set_ui __GMP_PROTO ((mpz_ptr, unsigned long int));
+
+#define mpz_inp_raw __gmpz_inp_raw
+#ifdef _GMP_H_HAVE_FILE
+__GMP_DECLSPEC size_t mpz_inp_raw __GMP_PROTO ((mpz_ptr, FILE *));
+#endif
+
+#define mpz_inp_str __gmpz_inp_str
+#ifdef _GMP_H_HAVE_FILE
+__GMP_DECLSPEC size_t mpz_inp_str __GMP_PROTO ((mpz_ptr, FILE *, int));
+#endif
+
+#define mpz_invert __gmpz_invert
+__GMP_DECLSPEC int mpz_invert __GMP_PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
+
+#define mpz_ior __gmpz_ior
+__GMP_DECLSPEC void mpz_ior __GMP_PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
+
+#define mpz_jacobi __gmpz_jacobi
+__GMP_DECLSPEC int mpz_jacobi __GMP_PROTO ((mpz_srcptr, mpz_srcptr)) __GMP_ATTRIBUTE_PURE;
+
+#define mpz_kronecker mpz_jacobi /* alias */
+
+#define mpz_kronecker_si __gmpz_kronecker_si
+__GMP_DECLSPEC int mpz_kronecker_si __GMP_PROTO ((mpz_srcptr, long)) __GMP_ATTRIBUTE_PURE;
+
+#define mpz_kronecker_ui __gmpz_kronecker_ui
+__GMP_DECLSPEC int mpz_kronecker_ui __GMP_PROTO ((mpz_srcptr, unsigned long)) __GMP_ATTRIBUTE_PURE;
+
+#define mpz_si_kronecker __gmpz_si_kronecker
+__GMP_DECLSPEC int mpz_si_kronecker __GMP_PROTO ((long, mpz_srcptr)) __GMP_ATTRIBUTE_PURE;
+
+#define mpz_ui_kronecker __gmpz_ui_kronecker
+__GMP_DECLSPEC int mpz_ui_kronecker __GMP_PROTO ((unsigned long, mpz_srcptr)) __GMP_ATTRIBUTE_PURE;
+
+#define mpz_lcm __gmpz_lcm
+__GMP_DECLSPEC void mpz_lcm __GMP_PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
+
+#define mpz_lcm_ui __gmpz_lcm_ui
+__GMP_DECLSPEC void mpz_lcm_ui __GMP_PROTO ((mpz_ptr, mpz_srcptr, unsigned long));
+
+#define mpz_legendre mpz_jacobi /* alias */
+
+#define mpz_lucnum_ui __gmpz_lucnum_ui
+__GMP_DECLSPEC void mpz_lucnum_ui __GMP_PROTO ((mpz_ptr, unsigned long int));
+
+#define mpz_lucnum2_ui __gmpz_lucnum2_ui
+__GMP_DECLSPEC void mpz_lucnum2_ui __GMP_PROTO ((mpz_ptr, mpz_ptr, unsigned long int));
+
+#define mpz_millerrabin __gmpz_millerrabin
+__GMP_DECLSPEC int mpz_millerrabin __GMP_PROTO ((mpz_srcptr, int)) __GMP_ATTRIBUTE_PURE;
+
+#define mpz_mod __gmpz_mod
+__GMP_DECLSPEC void mpz_mod __GMP_PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
+
+#define mpz_mod_ui mpz_fdiv_r_ui /* same as fdiv_r because divisor unsigned */
+
+#define mpz_mul __gmpz_mul
+__GMP_DECLSPEC void mpz_mul __GMP_PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
+
+#define mpz_mul_2exp __gmpz_mul_2exp
+__GMP_DECLSPEC void mpz_mul_2exp __GMP_PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
+
+#define mpz_mul_si __gmpz_mul_si
+__GMP_DECLSPEC void mpz_mul_si __GMP_PROTO ((mpz_ptr, mpz_srcptr, long int));
+
+#define mpz_mul_ui __gmpz_mul_ui
+__GMP_DECLSPEC void mpz_mul_ui __GMP_PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
+
+#define mpz_neg __gmpz_neg
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpz_neg)
+__GMP_DECLSPEC void mpz_neg __GMP_PROTO ((mpz_ptr, mpz_srcptr));
+#endif
+
+#define mpz_nextprime __gmpz_nextprime
+__GMP_DECLSPEC void mpz_nextprime __GMP_PROTO ((mpz_ptr, mpz_srcptr));
+
+#define mpz_out_raw __gmpz_out_raw
+#ifdef _GMP_H_HAVE_FILE
+__GMP_DECLSPEC size_t mpz_out_raw __GMP_PROTO ((FILE *, mpz_srcptr));
+#endif
+
+#define mpz_out_str __gmpz_out_str
+#ifdef _GMP_H_HAVE_FILE
+__GMP_DECLSPEC size_t mpz_out_str __GMP_PROTO ((FILE *, int, mpz_srcptr));
+#endif
+
+#define mpz_perfect_power_p __gmpz_perfect_power_p
+__GMP_DECLSPEC int mpz_perfect_power_p __GMP_PROTO ((mpz_srcptr)) __GMP_ATTRIBUTE_PURE;
+
+#define mpz_perfect_square_p __gmpz_perfect_square_p
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpz_perfect_square_p)
+__GMP_DECLSPEC int mpz_perfect_square_p __GMP_PROTO ((mpz_srcptr)) __GMP_ATTRIBUTE_PURE;
+#endif
+
+#define mpz_popcount __gmpz_popcount
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpz_popcount)
+__GMP_DECLSPEC unsigned long int mpz_popcount __GMP_PROTO ((mpz_srcptr)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+#endif
+
+#define mpz_pow_ui __gmpz_pow_ui
+__GMP_DECLSPEC void mpz_pow_ui __GMP_PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
+
+#define mpz_powm __gmpz_powm
+__GMP_DECLSPEC void mpz_powm __GMP_PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr, mpz_srcptr));
+
+#define mpz_powm_ui __gmpz_powm_ui
+__GMP_DECLSPEC void mpz_powm_ui __GMP_PROTO ((mpz_ptr, mpz_srcptr, unsigned long int, mpz_srcptr));
+
+#define mpz_probab_prime_p __gmpz_probab_prime_p
+__GMP_DECLSPEC int mpz_probab_prime_p __GMP_PROTO ((mpz_srcptr, int)) __GMP_ATTRIBUTE_PURE;
+
+#define mpz_random __gmpz_random
+__GMP_DECLSPEC void mpz_random __GMP_PROTO ((mpz_ptr, mp_size_t));
+
+#define mpz_random2 __gmpz_random2
+__GMP_DECLSPEC void mpz_random2 __GMP_PROTO ((mpz_ptr, mp_size_t));
+
+#define mpz_realloc2 __gmpz_realloc2
+__GMP_DECLSPEC void mpz_realloc2 __GMP_PROTO ((mpz_ptr, unsigned long));
+
+#define mpz_remove __gmpz_remove
+__GMP_DECLSPEC unsigned long int mpz_remove __GMP_PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
+
+#define mpz_root __gmpz_root
+__GMP_DECLSPEC int mpz_root __GMP_PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
+
+#define mpz_rootrem __gmpz_rootrem
+__GMP_DECLSPEC void mpz_rootrem __GMP_PROTO ((mpz_ptr,mpz_ptr, mpz_srcptr, unsigned long int));
+
+#define mpz_rrandomb __gmpz_rrandomb
+__GMP_DECLSPEC void mpz_rrandomb __GMP_PROTO ((mpz_ptr, gmp_randstate_t, unsigned long int));
+
+#define mpz_scan0 __gmpz_scan0
+__GMP_DECLSPEC unsigned long int mpz_scan0 __GMP_PROTO ((mpz_srcptr, unsigned long int)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpz_scan1 __gmpz_scan1
+__GMP_DECLSPEC unsigned long int mpz_scan1 __GMP_PROTO ((mpz_srcptr, unsigned long int)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpz_set __gmpz_set
+__GMP_DECLSPEC void mpz_set __GMP_PROTO ((mpz_ptr, mpz_srcptr));
+
+#define mpz_set_d __gmpz_set_d
+__GMP_DECLSPEC void mpz_set_d __GMP_PROTO ((mpz_ptr, double));
+
+#define mpz_set_f __gmpz_set_f
+__GMP_DECLSPEC void mpz_set_f __GMP_PROTO ((mpz_ptr, mpf_srcptr));
+
+#define mpz_set_q __gmpz_set_q
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpz_set_q)
+__GMP_DECLSPEC void mpz_set_q __GMP_PROTO ((mpz_ptr, mpq_srcptr));
+#endif
+
+#define mpz_set_si __gmpz_set_si
+__GMP_DECLSPEC void mpz_set_si __GMP_PROTO ((mpz_ptr, signed long int));
+
+#define mpz_set_str __gmpz_set_str
+__GMP_DECLSPEC int mpz_set_str __GMP_PROTO ((mpz_ptr, __gmp_const char *, int));
+
+#define mpz_set_ui __gmpz_set_ui
+__GMP_DECLSPEC void mpz_set_ui __GMP_PROTO ((mpz_ptr, unsigned long int));
+
+#define mpz_setbit __gmpz_setbit
+__GMP_DECLSPEC void mpz_setbit __GMP_PROTO ((mpz_ptr, unsigned long int));
+
+#define mpz_size __gmpz_size
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpz_size)
+__GMP_DECLSPEC size_t mpz_size __GMP_PROTO ((mpz_srcptr)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+#endif
+
+#define mpz_sizeinbase __gmpz_sizeinbase
+__GMP_DECLSPEC size_t mpz_sizeinbase __GMP_PROTO ((mpz_srcptr, int)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpz_sqrt __gmpz_sqrt
+__GMP_DECLSPEC void mpz_sqrt __GMP_PROTO ((mpz_ptr, mpz_srcptr));
+
+#define mpz_sqrtrem __gmpz_sqrtrem
+__GMP_DECLSPEC void mpz_sqrtrem __GMP_PROTO ((mpz_ptr, mpz_ptr, mpz_srcptr));
+
+#define mpz_sub __gmpz_sub
+__GMP_DECLSPEC void mpz_sub __GMP_PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
+
+#define mpz_sub_ui __gmpz_sub_ui
+__GMP_DECLSPEC void mpz_sub_ui __GMP_PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
+
+#define mpz_ui_sub __gmpz_ui_sub
+__GMP_DECLSPEC void mpz_ui_sub __GMP_PROTO ((mpz_ptr, unsigned long int, mpz_srcptr));
+
+#define mpz_submul __gmpz_submul
+__GMP_DECLSPEC void mpz_submul __GMP_PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
+
+#define mpz_submul_ui __gmpz_submul_ui
+__GMP_DECLSPEC void mpz_submul_ui __GMP_PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
+
+#define mpz_swap __gmpz_swap
+__GMP_DECLSPEC void mpz_swap __GMP_PROTO ((mpz_ptr, mpz_ptr)) __GMP_NOTHROW;
+
+#define mpz_tdiv_ui __gmpz_tdiv_ui
+__GMP_DECLSPEC unsigned long int mpz_tdiv_ui __GMP_PROTO ((mpz_srcptr, unsigned long int)) __GMP_ATTRIBUTE_PURE;
+
+#define mpz_tdiv_q __gmpz_tdiv_q
+__GMP_DECLSPEC void mpz_tdiv_q __GMP_PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
+
+#define mpz_tdiv_q_2exp __gmpz_tdiv_q_2exp
+__GMP_DECLSPEC void mpz_tdiv_q_2exp __GMP_PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
+
+#define mpz_tdiv_q_ui __gmpz_tdiv_q_ui
+__GMP_DECLSPEC unsigned long int mpz_tdiv_q_ui __GMP_PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
+
+#define mpz_tdiv_qr __gmpz_tdiv_qr
+__GMP_DECLSPEC void mpz_tdiv_qr __GMP_PROTO ((mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr));
+
+#define mpz_tdiv_qr_ui __gmpz_tdiv_qr_ui
+__GMP_DECLSPEC unsigned long int mpz_tdiv_qr_ui __GMP_PROTO ((mpz_ptr, mpz_ptr, mpz_srcptr, unsigned long int));
+
+#define mpz_tdiv_r __gmpz_tdiv_r
+__GMP_DECLSPEC void mpz_tdiv_r __GMP_PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
+
+#define mpz_tdiv_r_2exp __gmpz_tdiv_r_2exp
+__GMP_DECLSPEC void mpz_tdiv_r_2exp __GMP_PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
+
+#define mpz_tdiv_r_ui __gmpz_tdiv_r_ui
+__GMP_DECLSPEC unsigned long int mpz_tdiv_r_ui __GMP_PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
+
+#define mpz_tstbit __gmpz_tstbit
+__GMP_DECLSPEC int mpz_tstbit __GMP_PROTO ((mpz_srcptr, unsigned long int)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpz_ui_pow_ui __gmpz_ui_pow_ui
+__GMP_DECLSPEC void mpz_ui_pow_ui __GMP_PROTO ((mpz_ptr, unsigned long int, unsigned long int));
+
+#define mpz_urandomb __gmpz_urandomb
+__GMP_DECLSPEC void mpz_urandomb __GMP_PROTO ((mpz_ptr, gmp_randstate_t, unsigned long int));
+
+#define mpz_urandomm __gmpz_urandomm
+__GMP_DECLSPEC void mpz_urandomm __GMP_PROTO ((mpz_ptr, gmp_randstate_t, mpz_srcptr));
+
+#define mpz_xor __gmpz_xor
+#define mpz_eor __gmpz_xor
+__GMP_DECLSPEC void mpz_xor __GMP_PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
+
+
+/**************** Rational (i.e. Q) routines. ****************/
+
+#define mpq_abs __gmpq_abs
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpq_abs)
+__GMP_DECLSPEC void mpq_abs __GMP_PROTO ((mpq_ptr, mpq_srcptr));
+#endif
+
+#define mpq_add __gmpq_add
+__GMP_DECLSPEC void mpq_add __GMP_PROTO ((mpq_ptr, mpq_srcptr, mpq_srcptr));
+
+#define mpq_canonicalize __gmpq_canonicalize
+__GMP_DECLSPEC void mpq_canonicalize __GMP_PROTO ((mpq_ptr));
+
+#define mpq_clear __gmpq_clear
+__GMP_DECLSPEC void mpq_clear __GMP_PROTO ((mpq_ptr));
+
+#define mpq_cmp __gmpq_cmp
+__GMP_DECLSPEC int mpq_cmp __GMP_PROTO ((mpq_srcptr, mpq_srcptr)) __GMP_ATTRIBUTE_PURE;
+
+#define _mpq_cmp_si __gmpq_cmp_si
+__GMP_DECLSPEC int _mpq_cmp_si __GMP_PROTO ((mpq_srcptr, long, unsigned long)) __GMP_ATTRIBUTE_PURE;
+
+#define _mpq_cmp_ui __gmpq_cmp_ui
+__GMP_DECLSPEC int _mpq_cmp_ui __GMP_PROTO ((mpq_srcptr, unsigned long int, unsigned long int)) __GMP_ATTRIBUTE_PURE;
+
+#define mpq_div __gmpq_div
+__GMP_DECLSPEC void mpq_div __GMP_PROTO ((mpq_ptr, mpq_srcptr, mpq_srcptr));
+
+#define mpq_div_2exp __gmpq_div_2exp
+__GMP_DECLSPEC void mpq_div_2exp __GMP_PROTO ((mpq_ptr, mpq_srcptr, unsigned long));
+
+#define mpq_equal __gmpq_equal
+__GMP_DECLSPEC int mpq_equal __GMP_PROTO ((mpq_srcptr, mpq_srcptr)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpq_get_num __gmpq_get_num
+__GMP_DECLSPEC void mpq_get_num __GMP_PROTO ((mpz_ptr, mpq_srcptr));
+
+#define mpq_get_den __gmpq_get_den
+__GMP_DECLSPEC void mpq_get_den __GMP_PROTO ((mpz_ptr, mpq_srcptr));
+
+#define mpq_get_d __gmpq_get_d
+__GMP_DECLSPEC double mpq_get_d __GMP_PROTO ((mpq_srcptr)) __GMP_ATTRIBUTE_PURE;
+
+#define mpq_get_str __gmpq_get_str
+__GMP_DECLSPEC char *mpq_get_str __GMP_PROTO ((char *, int, mpq_srcptr));
+
+#define mpq_init __gmpq_init
+__GMP_DECLSPEC void mpq_init __GMP_PROTO ((mpq_ptr));
+
+#define mpq_inp_str __gmpq_inp_str
+#ifdef _GMP_H_HAVE_FILE
+__GMP_DECLSPEC size_t mpq_inp_str __GMP_PROTO ((mpq_ptr, FILE *, int));
+#endif
+
+#define mpq_inv __gmpq_inv
+__GMP_DECLSPEC void mpq_inv __GMP_PROTO ((mpq_ptr, mpq_srcptr));
+
+#define mpq_mul __gmpq_mul
+__GMP_DECLSPEC void mpq_mul __GMP_PROTO ((mpq_ptr, mpq_srcptr, mpq_srcptr));
+
+#define mpq_mul_2exp __gmpq_mul_2exp
+__GMP_DECLSPEC void mpq_mul_2exp __GMP_PROTO ((mpq_ptr, mpq_srcptr, unsigned long));
+
+#define mpq_neg __gmpq_neg
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpq_neg)
+__GMP_DECLSPEC void mpq_neg __GMP_PROTO ((mpq_ptr, mpq_srcptr));
+#endif
+
+#define mpq_out_str __gmpq_out_str
+#ifdef _GMP_H_HAVE_FILE
+__GMP_DECLSPEC size_t mpq_out_str __GMP_PROTO ((FILE *, int, mpq_srcptr));
+#endif
+
+#define mpq_set __gmpq_set
+__GMP_DECLSPEC void mpq_set __GMP_PROTO ((mpq_ptr, mpq_srcptr));
+
+#define mpq_set_d __gmpq_set_d
+__GMP_DECLSPEC void mpq_set_d __GMP_PROTO ((mpq_ptr, double));
+
+#define mpq_set_den __gmpq_set_den
+__GMP_DECLSPEC void mpq_set_den __GMP_PROTO ((mpq_ptr, mpz_srcptr));
+
+#define mpq_set_f __gmpq_set_f
+__GMP_DECLSPEC void mpq_set_f __GMP_PROTO ((mpq_ptr, mpf_srcptr));
+
+#define mpq_set_num __gmpq_set_num
+__GMP_DECLSPEC void mpq_set_num __GMP_PROTO ((mpq_ptr, mpz_srcptr));
+
+#define mpq_set_si __gmpq_set_si
+__GMP_DECLSPEC void mpq_set_si __GMP_PROTO ((mpq_ptr, signed long int, unsigned long int));
+
+#define mpq_set_str __gmpq_set_str
+__GMP_DECLSPEC int mpq_set_str __GMP_PROTO ((mpq_ptr, __gmp_const char *, int));
+
+#define mpq_set_ui __gmpq_set_ui
+__GMP_DECLSPEC void mpq_set_ui __GMP_PROTO ((mpq_ptr, unsigned long int, unsigned long int));
+
+#define mpq_set_z __gmpq_set_z
+__GMP_DECLSPEC void mpq_set_z __GMP_PROTO ((mpq_ptr, mpz_srcptr));
+
+#define mpq_sub __gmpq_sub
+__GMP_DECLSPEC void mpq_sub __GMP_PROTO ((mpq_ptr, mpq_srcptr, mpq_srcptr));
+
+#define mpq_swap __gmpq_swap
+__GMP_DECLSPEC void mpq_swap __GMP_PROTO ((mpq_ptr, mpq_ptr)) __GMP_NOTHROW;
+
+
+/**************** Float (i.e. F) routines. ****************/
+
+#define mpf_abs __gmpf_abs
+__GMP_DECLSPEC void mpf_abs __GMP_PROTO ((mpf_ptr, mpf_srcptr));
+
+#define mpf_add __gmpf_add
+__GMP_DECLSPEC void mpf_add __GMP_PROTO ((mpf_ptr, mpf_srcptr, mpf_srcptr));
+
+#define mpf_add_ui __gmpf_add_ui
+__GMP_DECLSPEC void mpf_add_ui __GMP_PROTO ((mpf_ptr, mpf_srcptr, unsigned long int));
+#define mpf_ceil __gmpf_ceil
+__GMP_DECLSPEC void mpf_ceil __GMP_PROTO ((mpf_ptr, mpf_srcptr));
+
+#define mpf_clear __gmpf_clear
+__GMP_DECLSPEC void mpf_clear __GMP_PROTO ((mpf_ptr));
+
+#define mpf_cmp __gmpf_cmp
+__GMP_DECLSPEC int mpf_cmp __GMP_PROTO ((mpf_srcptr, mpf_srcptr)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpf_cmp_d __gmpf_cmp_d
+__GMP_DECLSPEC int mpf_cmp_d __GMP_PROTO ((mpf_srcptr, double)) __GMP_ATTRIBUTE_PURE;
+
+#define mpf_cmp_si __gmpf_cmp_si
+__GMP_DECLSPEC int mpf_cmp_si __GMP_PROTO ((mpf_srcptr, signed long int)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpf_cmp_ui __gmpf_cmp_ui
+__GMP_DECLSPEC int mpf_cmp_ui __GMP_PROTO ((mpf_srcptr, unsigned long int)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpf_div __gmpf_div
+__GMP_DECLSPEC void mpf_div __GMP_PROTO ((mpf_ptr, mpf_srcptr, mpf_srcptr));
+
+#define mpf_div_2exp __gmpf_div_2exp
+__GMP_DECLSPEC void mpf_div_2exp __GMP_PROTO ((mpf_ptr, mpf_srcptr, unsigned long int));
+
+#define mpf_div_ui __gmpf_div_ui
+__GMP_DECLSPEC void mpf_div_ui __GMP_PROTO ((mpf_ptr, mpf_srcptr, unsigned long int));
+
+#define mpf_dump __gmpf_dump
+__GMP_DECLSPEC void mpf_dump __GMP_PROTO ((mpf_srcptr));
+
+#define mpf_eq __gmpf_eq
+__GMP_DECLSPEC int mpf_eq __GMP_PROTO ((mpf_srcptr, mpf_srcptr, unsigned long int)) __GMP_ATTRIBUTE_PURE;
+
+#define mpf_fits_sint_p __gmpf_fits_sint_p
+__GMP_DECLSPEC int mpf_fits_sint_p __GMP_PROTO ((mpf_srcptr)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpf_fits_slong_p __gmpf_fits_slong_p
+__GMP_DECLSPEC int mpf_fits_slong_p __GMP_PROTO ((mpf_srcptr)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpf_fits_sshort_p __gmpf_fits_sshort_p
+__GMP_DECLSPEC int mpf_fits_sshort_p __GMP_PROTO ((mpf_srcptr)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpf_fits_uint_p __gmpf_fits_uint_p
+__GMP_DECLSPEC int mpf_fits_uint_p __GMP_PROTO ((mpf_srcptr)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpf_fits_ulong_p __gmpf_fits_ulong_p
+__GMP_DECLSPEC int mpf_fits_ulong_p __GMP_PROTO ((mpf_srcptr)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpf_fits_ushort_p __gmpf_fits_ushort_p
+__GMP_DECLSPEC int mpf_fits_ushort_p __GMP_PROTO ((mpf_srcptr)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpf_floor __gmpf_floor
+__GMP_DECLSPEC void mpf_floor __GMP_PROTO ((mpf_ptr, mpf_srcptr));
+
+#define mpf_get_d __gmpf_get_d
+__GMP_DECLSPEC double mpf_get_d __GMP_PROTO ((mpf_srcptr)) __GMP_ATTRIBUTE_PURE;
+
+#define mpf_get_d_2exp __gmpf_get_d_2exp
+__GMP_DECLSPEC double mpf_get_d_2exp __GMP_PROTO ((signed long int *, mpf_srcptr));
+
+#define mpf_get_default_prec __gmpf_get_default_prec
+__GMP_DECLSPEC unsigned long int mpf_get_default_prec __GMP_PROTO ((void)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpf_get_prec __gmpf_get_prec
+__GMP_DECLSPEC unsigned long int mpf_get_prec __GMP_PROTO ((mpf_srcptr)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpf_get_si __gmpf_get_si
+__GMP_DECLSPEC long mpf_get_si __GMP_PROTO ((mpf_srcptr)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpf_get_str __gmpf_get_str
+__GMP_DECLSPEC char *mpf_get_str __GMP_PROTO ((char *, mp_exp_t *, int, size_t, mpf_srcptr));
+
+#define mpf_get_ui __gmpf_get_ui
+__GMP_DECLSPEC unsigned long mpf_get_ui __GMP_PROTO ((mpf_srcptr)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpf_init __gmpf_init
+__GMP_DECLSPEC void mpf_init __GMP_PROTO ((mpf_ptr));
+
+#define mpf_init2 __gmpf_init2
+__GMP_DECLSPEC void mpf_init2 __GMP_PROTO ((mpf_ptr, unsigned long int));
+
+#define mpf_init_set __gmpf_init_set
+__GMP_DECLSPEC void mpf_init_set __GMP_PROTO ((mpf_ptr, mpf_srcptr));
+
+#define mpf_init_set_d __gmpf_init_set_d
+__GMP_DECLSPEC void mpf_init_set_d __GMP_PROTO ((mpf_ptr, double));
+
+#define mpf_init_set_si __gmpf_init_set_si
+__GMP_DECLSPEC void mpf_init_set_si __GMP_PROTO ((mpf_ptr, signed long int));
+
+#define mpf_init_set_str __gmpf_init_set_str
+__GMP_DECLSPEC int mpf_init_set_str __GMP_PROTO ((mpf_ptr, __gmp_const char *, int));
+
+#define mpf_init_set_ui __gmpf_init_set_ui
+__GMP_DECLSPEC void mpf_init_set_ui __GMP_PROTO ((mpf_ptr, unsigned long int));
+
+#define mpf_inp_str __gmpf_inp_str
+#ifdef _GMP_H_HAVE_FILE
+__GMP_DECLSPEC size_t mpf_inp_str __GMP_PROTO ((mpf_ptr, FILE *, int));
+#endif
+
+#define mpf_integer_p __gmpf_integer_p
+__GMP_DECLSPEC int mpf_integer_p __GMP_PROTO ((mpf_srcptr)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpf_mul __gmpf_mul
+__GMP_DECLSPEC void mpf_mul __GMP_PROTO ((mpf_ptr, mpf_srcptr, mpf_srcptr));
+
+#define mpf_mul_2exp __gmpf_mul_2exp
+__GMP_DECLSPEC void mpf_mul_2exp __GMP_PROTO ((mpf_ptr, mpf_srcptr, unsigned long int));
+
+#define mpf_mul_ui __gmpf_mul_ui
+__GMP_DECLSPEC void mpf_mul_ui __GMP_PROTO ((mpf_ptr, mpf_srcptr, unsigned long int));
+
+#define mpf_neg __gmpf_neg
+__GMP_DECLSPEC void mpf_neg __GMP_PROTO ((mpf_ptr, mpf_srcptr));
+
+#define mpf_out_str __gmpf_out_str
+#ifdef _GMP_H_HAVE_FILE
+__GMP_DECLSPEC size_t mpf_out_str __GMP_PROTO ((FILE *, int, size_t, mpf_srcptr));
+#endif
+
+#define mpf_pow_ui __gmpf_pow_ui
+__GMP_DECLSPEC void mpf_pow_ui __GMP_PROTO ((mpf_ptr, mpf_srcptr, unsigned long int));
+
+#define mpf_random2 __gmpf_random2
+__GMP_DECLSPEC void mpf_random2 __GMP_PROTO ((mpf_ptr, mp_size_t, mp_exp_t));
+
+#define mpf_reldiff __gmpf_reldiff
+__GMP_DECLSPEC void mpf_reldiff __GMP_PROTO ((mpf_ptr, mpf_srcptr, mpf_srcptr));
+
+#define mpf_set __gmpf_set
+__GMP_DECLSPEC void mpf_set __GMP_PROTO ((mpf_ptr, mpf_srcptr));
+
+#define mpf_set_d __gmpf_set_d
+__GMP_DECLSPEC void mpf_set_d __GMP_PROTO ((mpf_ptr, double));
+
+#define mpf_set_default_prec __gmpf_set_default_prec
+__GMP_DECLSPEC void mpf_set_default_prec __GMP_PROTO ((unsigned long int)) __GMP_NOTHROW;
+
+#define mpf_set_prec __gmpf_set_prec
+__GMP_DECLSPEC void mpf_set_prec __GMP_PROTO ((mpf_ptr, unsigned long int));
+
+#define mpf_set_prec_raw __gmpf_set_prec_raw
+__GMP_DECLSPEC void mpf_set_prec_raw __GMP_PROTO ((mpf_ptr, unsigned long int)) __GMP_NOTHROW;
+
+#define mpf_set_q __gmpf_set_q
+__GMP_DECLSPEC void mpf_set_q __GMP_PROTO ((mpf_ptr, mpq_srcptr));
+
+#define mpf_set_si __gmpf_set_si
+__GMP_DECLSPEC void mpf_set_si __GMP_PROTO ((mpf_ptr, signed long int));
+
+#define mpf_set_str __gmpf_set_str
+__GMP_DECLSPEC int mpf_set_str __GMP_PROTO ((mpf_ptr, __gmp_const char *, int));
+
+#define mpf_set_ui __gmpf_set_ui
+__GMP_DECLSPEC void mpf_set_ui __GMP_PROTO ((mpf_ptr, unsigned long int));
+
+#define mpf_set_z __gmpf_set_z
+__GMP_DECLSPEC void mpf_set_z __GMP_PROTO ((mpf_ptr, mpz_srcptr));
+
+#define mpf_size __gmpf_size
+__GMP_DECLSPEC size_t mpf_size __GMP_PROTO ((mpf_srcptr)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpf_sqrt __gmpf_sqrt
+__GMP_DECLSPEC void mpf_sqrt __GMP_PROTO ((mpf_ptr, mpf_srcptr));
+
+#define mpf_sqrt_ui __gmpf_sqrt_ui
+__GMP_DECLSPEC void mpf_sqrt_ui __GMP_PROTO ((mpf_ptr, unsigned long int));
+
+#define mpf_sub __gmpf_sub
+__GMP_DECLSPEC void mpf_sub __GMP_PROTO ((mpf_ptr, mpf_srcptr, mpf_srcptr));
+
+#define mpf_sub_ui __gmpf_sub_ui
+__GMP_DECLSPEC void mpf_sub_ui __GMP_PROTO ((mpf_ptr, mpf_srcptr, unsigned long int));
+
+#define mpf_swap __gmpf_swap
+__GMP_DECLSPEC void mpf_swap __GMP_PROTO ((mpf_ptr, mpf_ptr)) __GMP_NOTHROW;
+
+#define mpf_trunc __gmpf_trunc
+__GMP_DECLSPEC void mpf_trunc __GMP_PROTO ((mpf_ptr, mpf_srcptr));
+
+#define mpf_ui_div __gmpf_ui_div
+__GMP_DECLSPEC void mpf_ui_div __GMP_PROTO ((mpf_ptr, unsigned long int, mpf_srcptr));
+
+#define mpf_ui_sub __gmpf_ui_sub
+__GMP_DECLSPEC void mpf_ui_sub __GMP_PROTO ((mpf_ptr, unsigned long int, mpf_srcptr));
+
+#define mpf_urandomb __gmpf_urandomb
+__GMP_DECLSPEC void mpf_urandomb __GMP_PROTO ((mpf_t, gmp_randstate_t, unsigned long int));
+
+
+/************ Low level positive-integer (i.e. N) routines. ************/
+
+/* This is ugly, but we need to make user calls reach the prefixed function. */
+
+#define mpn_add __MPN(add)
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpn_add)
+__GMP_DECLSPEC mp_limb_t mpn_add __GMP_PROTO ((mp_ptr, mp_srcptr, mp_size_t, mp_srcptr,mp_size_t));
+#endif
+
+#define mpn_add_1 __MPN(add_1)
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpn_add_1)
+__GMP_DECLSPEC mp_limb_t mpn_add_1 __GMP_PROTO ((mp_ptr, mp_srcptr, mp_size_t, mp_limb_t)) __GMP_NOTHROW;
+#endif
+
+#define mpn_add_n __MPN(add_n)
+__GMP_DECLSPEC mp_limb_t mpn_add_n __GMP_PROTO ((mp_ptr, mp_srcptr, mp_srcptr, mp_size_t));
+
+#define mpn_addmul_1 __MPN(addmul_1)
+__GMP_DECLSPEC mp_limb_t mpn_addmul_1 __GMP_PROTO ((mp_ptr, mp_srcptr, mp_size_t, mp_limb_t));
+
+#define mpn_bdivmod __MPN(bdivmod)
+__GMP_DECLSPEC mp_limb_t mpn_bdivmod __GMP_PROTO ((mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, unsigned long int));
+
+#define mpn_cmp __MPN(cmp)
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpn_cmp)
+__GMP_DECLSPEC int mpn_cmp __GMP_PROTO ((mp_srcptr, mp_srcptr, mp_size_t)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+#endif
+
+#define mpn_divexact_by3(dst,src,size) \
+ mpn_divexact_by3c (dst, src, size, __GMP_CAST (mp_limb_t, 0))
+
+#define mpn_divexact_by3c __MPN(divexact_by3c)
+__GMP_DECLSPEC mp_limb_t mpn_divexact_by3c __GMP_PROTO ((mp_ptr, mp_srcptr, mp_size_t, mp_limb_t));
+
+#define mpn_divmod_1(qp,np,nsize,dlimb) \
+ mpn_divrem_1 (qp, __GMP_CAST (mp_size_t, 0), np, nsize, dlimb)
+
+#define mpn_divrem __MPN(divrem)
+__GMP_DECLSPEC mp_limb_t mpn_divrem __GMP_PROTO ((mp_ptr, mp_size_t, mp_ptr, mp_size_t, mp_srcptr, mp_size_t));
+
+#define mpn_divrem_1 __MPN(divrem_1)
+__GMP_DECLSPEC mp_limb_t mpn_divrem_1 __GMP_PROTO ((mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_limb_t));
+
+#define mpn_divrem_2 __MPN(divrem_2)
+__GMP_DECLSPEC mp_limb_t mpn_divrem_2 __GMP_PROTO ((mp_ptr, mp_size_t, mp_ptr, mp_size_t, mp_srcptr));
+
+#define mpn_gcd __MPN(gcd)
+__GMP_DECLSPEC mp_size_t mpn_gcd __GMP_PROTO ((mp_ptr, mp_ptr, mp_size_t, mp_ptr, mp_size_t));
+
+#define mpn_gcd_1 __MPN(gcd_1)
+__GMP_DECLSPEC mp_limb_t mpn_gcd_1 __GMP_PROTO ((mp_srcptr, mp_size_t, mp_limb_t)) __GMP_ATTRIBUTE_PURE;
+
+#define mpn_gcdext __MPN(gcdext)
+__GMP_DECLSPEC mp_size_t mpn_gcdext __GMP_PROTO ((mp_ptr, mp_ptr, mp_size_t *, mp_ptr, mp_size_t, mp_ptr, mp_size_t));
+
+#define mpn_get_str __MPN(get_str)
+__GMP_DECLSPEC size_t mpn_get_str __GMP_PROTO ((unsigned char *, int, mp_ptr, mp_size_t));
+
+#define mpn_hamdist __MPN(hamdist)
+__GMP_DECLSPEC unsigned long int mpn_hamdist __GMP_PROTO ((mp_srcptr, mp_srcptr, mp_size_t)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpn_lshift __MPN(lshift)
+__GMP_DECLSPEC mp_limb_t mpn_lshift __GMP_PROTO ((mp_ptr, mp_srcptr, mp_size_t, unsigned int));
+
+#define mpn_mod_1 __MPN(mod_1)
+__GMP_DECLSPEC mp_limb_t mpn_mod_1 __GMP_PROTO ((mp_srcptr, mp_size_t, mp_limb_t)) __GMP_ATTRIBUTE_PURE;
+
+#define mpn_mul __MPN(mul)
+__GMP_DECLSPEC mp_limb_t mpn_mul __GMP_PROTO ((mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t));
+
+#define mpn_mul_1 __MPN(mul_1)
+__GMP_DECLSPEC mp_limb_t mpn_mul_1 __GMP_PROTO ((mp_ptr, mp_srcptr, mp_size_t, mp_limb_t));
+
+#define mpn_mul_n __MPN(mul_n)
+__GMP_DECLSPEC void mpn_mul_n __GMP_PROTO ((mp_ptr, mp_srcptr, mp_srcptr, mp_size_t));
+
+#define mpn_perfect_square_p __MPN(perfect_square_p)
+__GMP_DECLSPEC int mpn_perfect_square_p __GMP_PROTO ((mp_srcptr, mp_size_t)) __GMP_ATTRIBUTE_PURE;
+
+#define mpn_popcount __MPN(popcount)
+__GMP_DECLSPEC unsigned long int mpn_popcount __GMP_PROTO ((mp_srcptr, mp_size_t)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpn_pow_1 __MPN(pow_1)
+__GMP_DECLSPEC mp_size_t mpn_pow_1 __GMP_PROTO ((mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_ptr));
+
+/* undocumented now, but retained here for upward compatibility */
+#define mpn_preinv_mod_1 __MPN(preinv_mod_1)
+__GMP_DECLSPEC mp_limb_t mpn_preinv_mod_1 __GMP_PROTO ((mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t)) __GMP_ATTRIBUTE_PURE;
+
+#define mpn_random __MPN(random)
+__GMP_DECLSPEC void mpn_random __GMP_PROTO ((mp_ptr, mp_size_t));
+
+#define mpn_random2 __MPN(random2)
+__GMP_DECLSPEC void mpn_random2 __GMP_PROTO ((mp_ptr, mp_size_t));
+
+#define mpn_rshift __MPN(rshift)
+__GMP_DECLSPEC mp_limb_t mpn_rshift __GMP_PROTO ((mp_ptr, mp_srcptr, mp_size_t, unsigned int));
+
+#define mpn_scan0 __MPN(scan0)
+__GMP_DECLSPEC unsigned long int mpn_scan0 __GMP_PROTO ((mp_srcptr, unsigned long int)) __GMP_ATTRIBUTE_PURE;
+
+#define mpn_scan1 __MPN(scan1)
+__GMP_DECLSPEC unsigned long int mpn_scan1 __GMP_PROTO ((mp_srcptr, unsigned long int)) __GMP_ATTRIBUTE_PURE;
+
+#define mpn_set_str __MPN(set_str)
+__GMP_DECLSPEC mp_size_t mpn_set_str __GMP_PROTO ((mp_ptr, __gmp_const unsigned char *, size_t, int));
+
+#define mpn_sqrtrem __MPN(sqrtrem)
+__GMP_DECLSPEC mp_size_t mpn_sqrtrem __GMP_PROTO ((mp_ptr, mp_ptr, mp_srcptr, mp_size_t));
+
+#define mpn_sub __MPN(sub)
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpn_sub)
+__GMP_DECLSPEC mp_limb_t mpn_sub __GMP_PROTO ((mp_ptr, mp_srcptr, mp_size_t, mp_srcptr,mp_size_t));
+#endif
+
+#define mpn_sub_1 __MPN(sub_1)
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpn_sub_1)
+__GMP_DECLSPEC mp_limb_t mpn_sub_1 __GMP_PROTO ((mp_ptr, mp_srcptr, mp_size_t, mp_limb_t)) __GMP_NOTHROW;
+#endif
+
+#define mpn_sub_n __MPN(sub_n)
+__GMP_DECLSPEC mp_limb_t mpn_sub_n __GMP_PROTO ((mp_ptr, mp_srcptr, mp_srcptr, mp_size_t));
+
+#define mpn_submul_1 __MPN(submul_1)
+__GMP_DECLSPEC mp_limb_t mpn_submul_1 __GMP_PROTO ((mp_ptr, mp_srcptr, mp_size_t, mp_limb_t));
+
+#define mpn_tdiv_qr __MPN(tdiv_qr)
+__GMP_DECLSPEC void mpn_tdiv_qr __GMP_PROTO ((mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t));
+
+
+/**************** mpz inlines ****************/
+
+/* The following are provided as inlines where possible, but always exist as
+ library functions too, for binary compatibility.
+
+ Within gmp itself this inlining generally isn't relied on, since it
+ doesn't get done for all compilers, whereas if something is worth
+ inlining then it's worth arranging always.
+
+ There are two styles of inlining here. When the same bit of code is
+ wanted for the inline as for the library version, then __GMP_FORCE_foo
+ arranges for that code to be emitted and the __GMP_EXTERN_INLINE
+ directive suppressed, eg. mpz_fits_uint_p. When a different bit of code
+ is wanted for the inline than for the library version, then
+ __GMP_FORCE_foo arranges the inline to be suppressed, eg. mpz_abs. */
+
+#if defined (__GMP_EXTERN_INLINE) && ! defined (__GMP_FORCE_mpz_abs)
+__GMP_EXTERN_INLINE void
+mpz_abs (mpz_ptr __gmp_w, mpz_srcptr __gmp_u)
+{
+ if (__gmp_w != __gmp_u)
+ mpz_set (__gmp_w, __gmp_u);
+ __gmp_w->_mp_size = __GMP_ABS (__gmp_w->_mp_size);
+}
+#endif
+
+#if GMP_NAIL_BITS == 0
+#define __GMPZ_FITS_UTYPE_P(z,maxval) \
+ mp_size_t __gmp_n = z->_mp_size; \
+ mp_ptr __gmp_p = z->_mp_d; \
+ return (__gmp_n == 0 || (__gmp_n == 1 && __gmp_p[0] <= maxval));
+#else
+#define __GMPZ_FITS_UTYPE_P(z,maxval) \
+ mp_size_t __gmp_n = z->_mp_size; \
+ mp_ptr __gmp_p = z->_mp_d; \
+ return (__gmp_n == 0 || (__gmp_n == 1 && __gmp_p[0] <= maxval) \
+ || (__gmp_n == 2 && __gmp_p[1] <= ((mp_limb_t) maxval >> GMP_NUMB_BITS)));
+#endif
+
+#if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpz_fits_uint_p)
+#if ! defined (__GMP_FORCE_mpz_fits_uint_p)
+__GMP_EXTERN_INLINE
+#endif
+int
+mpz_fits_uint_p (mpz_srcptr __gmp_z) __GMP_NOTHROW
+{
+ __GMPZ_FITS_UTYPE_P (__gmp_z, __GMP_UINT_MAX);
+}
+#endif
+
+#if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpz_fits_ulong_p)
+#if ! defined (__GMP_FORCE_mpz_fits_ulong_p)
+__GMP_EXTERN_INLINE
+#endif
+int
+mpz_fits_ulong_p (mpz_srcptr __gmp_z) __GMP_NOTHROW
+{
+ __GMPZ_FITS_UTYPE_P (__gmp_z, __GMP_ULONG_MAX);
+}
+#endif
+
+#if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpz_fits_ushort_p)
+#if ! defined (__GMP_FORCE_mpz_fits_ushort_p)
+__GMP_EXTERN_INLINE
+#endif
+int
+mpz_fits_ushort_p (mpz_srcptr __gmp_z) __GMP_NOTHROW
+{
+ __GMPZ_FITS_UTYPE_P (__gmp_z, __GMP_USHRT_MAX);
+}
+#endif
+
+#if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpz_get_ui)
+#if ! defined (__GMP_FORCE_mpz_get_ui)
+__GMP_EXTERN_INLINE
+#endif
+unsigned long
+mpz_get_ui (mpz_srcptr __gmp_z) __GMP_NOTHROW
+{
+ mp_ptr __gmp_p = __gmp_z->_mp_d;
+ mp_size_t __gmp_n = __gmp_z->_mp_size;
+ mp_limb_t __gmp_l = __gmp_p[0];
+ /* This is a "#if" rather than a plain "if" so as to avoid gcc warnings
+ about "<< GMP_NUMB_BITS" exceeding the type size, and to avoid Borland
+ C++ 6.0 warnings about condition always true for something like
+ "__GMP_ULONG_MAX < GMP_NUMB_MASK". */
+#if GMP_NAIL_BITS == 0 || defined (_LONG_LONG_LIMB)
+ /* limb==long and no nails, or limb==longlong, one limb is enough */
+ return (__gmp_n != 0 ? __gmp_l : 0);
+#else
+ /* limb==long and nails, need two limbs when available */
+ __gmp_n = __GMP_ABS (__gmp_n);
+ if (__gmp_n <= 1)
+ return (__gmp_n != 0 ? __gmp_l : 0);
+ else
+ return __gmp_l + (__gmp_p[1] << GMP_NUMB_BITS);
+#endif
+}
+#endif
+
+#if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpz_getlimbn)
+#if ! defined (__GMP_FORCE_mpz_getlimbn)
+__GMP_EXTERN_INLINE
+#endif
+mp_limb_t
+mpz_getlimbn (mpz_srcptr __gmp_z, mp_size_t __gmp_n) __GMP_NOTHROW
+{
+ mp_limb_t __gmp_result = 0;
+ if (__GMP_LIKELY (__gmp_n >= 0 && __gmp_n < __GMP_ABS (__gmp_z->_mp_size)))
+ __gmp_result = __gmp_z->_mp_d[__gmp_n];
+ return __gmp_result;
+}
+#endif
+
+#if defined (__GMP_EXTERN_INLINE) && ! defined (__GMP_FORCE_mpz_neg)
+__GMP_EXTERN_INLINE void
+mpz_neg (mpz_ptr __gmp_w, mpz_srcptr __gmp_u)
+{
+ if (__gmp_w != __gmp_u)
+ mpz_set (__gmp_w, __gmp_u);
+ __gmp_w->_mp_size = - __gmp_w->_mp_size;
+}
+#endif
+
+#if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpz_perfect_square_p)
+#if ! defined (__GMP_FORCE_mpz_perfect_square_p)
+__GMP_EXTERN_INLINE
+#endif
+int
+mpz_perfect_square_p (mpz_srcptr __gmp_a)
+{
+ mp_size_t __gmp_asize;
+ int __gmp_result;
+
+ __gmp_asize = __gmp_a->_mp_size;
+ __gmp_result = (__gmp_asize >= 0); /* zero is a square, negatives are not */
+ if (__GMP_LIKELY (__gmp_asize > 0))
+ __gmp_result = mpn_perfect_square_p (__gmp_a->_mp_d, __gmp_asize);
+ return __gmp_result;
+}
+#endif
+
+#if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpz_popcount)
+#if ! defined (__GMP_FORCE_mpz_popcount)
+__GMP_EXTERN_INLINE
+#endif
+unsigned long
+mpz_popcount (mpz_srcptr __gmp_u) __GMP_NOTHROW
+{
+ mp_size_t __gmp_usize;
+ unsigned long __gmp_result;
+
+ __gmp_usize = __gmp_u->_mp_size;
+ __gmp_result = (__gmp_usize < 0 ? __GMP_ULONG_MAX : 0);
+ if (__GMP_LIKELY (__gmp_usize > 0))
+ __gmp_result = mpn_popcount (__gmp_u->_mp_d, __gmp_usize);
+ return __gmp_result;
+}
+#endif
+
+#if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpz_set_q)
+#if ! defined (__GMP_FORCE_mpz_set_q)
+__GMP_EXTERN_INLINE
+#endif
+void
+mpz_set_q (mpz_ptr __gmp_w, mpq_srcptr __gmp_u)
+{
+ mpz_tdiv_q (__gmp_w, mpq_numref (__gmp_u), mpq_denref (__gmp_u));
+}
+#endif
+
+#if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpz_size)
+#if ! defined (__GMP_FORCE_mpz_size)
+__GMP_EXTERN_INLINE
+#endif
+size_t
+mpz_size (mpz_srcptr __gmp_z) __GMP_NOTHROW
+{
+ return __GMP_ABS (__gmp_z->_mp_size);
+}
+#endif
+
+
+/**************** mpq inlines ****************/
+
+#if defined (__GMP_EXTERN_INLINE) && ! defined (__GMP_FORCE_mpq_abs)
+__GMP_EXTERN_INLINE void
+mpq_abs (mpq_ptr __gmp_w, mpq_srcptr __gmp_u)
+{
+ if (__gmp_w != __gmp_u)
+ mpq_set (__gmp_w, __gmp_u);
+ __gmp_w->_mp_num._mp_size = __GMP_ABS (__gmp_w->_mp_num._mp_size);
+}
+#endif
+
+#if defined (__GMP_EXTERN_INLINE) && ! defined (__GMP_FORCE_mpq_neg)
+__GMP_EXTERN_INLINE void
+mpq_neg (mpq_ptr __gmp_w, mpq_srcptr __gmp_u)
+{
+ if (__gmp_w != __gmp_u)
+ mpq_set (__gmp_w, __gmp_u);
+ __gmp_w->_mp_num._mp_size = - __gmp_w->_mp_num._mp_size;
+}
+#endif
+
+
+/**************** mpn inlines ****************/
+
+/* The comments with __GMPN_ADD_1 below apply here too.
+
+ The test for FUNCTION returning 0 should predict well. If it's assumed
+ {yp,ysize} will usually have a random number of bits then the high limb
+ won't be full and a carry out will occur a good deal less than 50% of the
+ time.
+
+ ysize==0 isn't a documented feature, but is used internally in a few
+ places.
+
+ Producing cout last stops it using up a register during the main part of
+ the calculation, though gcc (as of 3.0) on an "if (mpn_add (...))"
+ doesn't seem able to move the true and false legs of the conditional up
+ to the two places cout is generated. */
+
+#define __GMPN_AORS(cout, wp, xp, xsize, yp, ysize, FUNCTION, TEST) \
+ do { \
+ mp_size_t __gmp_i; \
+ mp_limb_t __gmp_x; \
+ \
+ /* ASSERT ((ysize) >= 0); */ \
+ /* ASSERT ((xsize) >= (ysize)); */ \
+ /* ASSERT (MPN_SAME_OR_SEPARATE2_P (wp, xsize, xp, xsize)); */ \
+ /* ASSERT (MPN_SAME_OR_SEPARATE2_P (wp, xsize, yp, ysize)); */ \
+ \
+ __gmp_i = (ysize); \
+ if (__gmp_i != 0) \
+ { \
+ if (FUNCTION (wp, xp, yp, __gmp_i)) \
+ { \
+ do \
+ { \
+ if (__gmp_i >= (xsize)) \
+ { \
+ (cout) = 1; \
+ goto __gmp_done; \
+ } \
+ __gmp_x = (xp)[__gmp_i]; \
+ } \
+ while (TEST); \
+ } \
+ } \
+ if ((wp) != (xp)) \
+ __GMPN_COPY_REST (wp, xp, xsize, __gmp_i); \
+ (cout) = 0; \
+ __gmp_done: \
+ ; \
+ } while (0)
+
+#define __GMPN_ADD(cout, wp, xp, xsize, yp, ysize) \
+ __GMPN_AORS (cout, wp, xp, xsize, yp, ysize, mpn_add_n, \
+ (((wp)[__gmp_i++] = (__gmp_x + 1) & GMP_NUMB_MASK) == 0))
+#define __GMPN_SUB(cout, wp, xp, xsize, yp, ysize) \
+ __GMPN_AORS (cout, wp, xp, xsize, yp, ysize, mpn_sub_n, \
+ (((wp)[__gmp_i++] = (__gmp_x - 1) & GMP_NUMB_MASK), __gmp_x == 0))
+
+
+/* The use of __gmp_i indexing is designed to ensure a compile time src==dst
+ remains nice and clear to the compiler, so that __GMPN_COPY_REST can
+ disappear, and the load/add/store gets a chance to become a
+ read-modify-write on CISC CPUs.
+
+ Alternatives:
+
+ Using a pair of pointers instead of indexing would be possible, but gcc
+ isn't able to recognise compile-time src==dst in that case, even when the
+ pointers are incremented more or less together. Other compilers would
+ very likely have similar difficulty.
+
+ gcc could use "if (__builtin_constant_p(src==dst) && src==dst)" or
+ similar to detect a compile-time src==dst. This works nicely on gcc
+ 2.95.x, it's not good on gcc 3.0 where __builtin_constant_p(p==p) seems
+ to be always false, for a pointer p. But the current code form seems
+ good enough for src==dst anyway.
+
+ gcc on x86 as usual doesn't give particularly good flags handling for the
+ carry/borrow detection. It's tempting to want some multi instruction asm
+ blocks to help it, and this was tried, but in truth there's only a few
+ instructions to save and any gain is all too easily lost by register
+ juggling setting up for the asm. */
+
+#if GMP_NAIL_BITS == 0
+#define __GMPN_AORS_1(cout, dst, src, n, v, OP, CB) \
+ do { \
+ mp_size_t __gmp_i; \
+ mp_limb_t __gmp_x, __gmp_r; \
+ \
+ /* ASSERT ((n) >= 1); */ \
+ /* ASSERT (MPN_SAME_OR_SEPARATE_P (dst, src, n)); */ \
+ \
+ __gmp_x = (src)[0]; \
+ __gmp_r = __gmp_x OP (v); \
+ (dst)[0] = __gmp_r; \
+ if (CB (__gmp_r, __gmp_x, (v))) \
+ { \
+ (cout) = 1; \
+ for (__gmp_i = 1; __gmp_i < (n);) \
+ { \
+ __gmp_x = (src)[__gmp_i]; \
+ __gmp_r = __gmp_x OP 1; \
+ (dst)[__gmp_i] = __gmp_r; \
+ ++__gmp_i; \
+ if (!CB (__gmp_r, __gmp_x, 1)) \
+ { \
+ if ((src) != (dst)) \
+ __GMPN_COPY_REST (dst, src, n, __gmp_i); \
+ (cout) = 0; \
+ break; \
+ } \
+ } \
+ } \
+ else \
+ { \
+ if ((src) != (dst)) \
+ __GMPN_COPY_REST (dst, src, n, 1); \
+ (cout) = 0; \
+ } \
+ } while (0)
+#endif
+
+#if GMP_NAIL_BITS >= 1
+#define __GMPN_AORS_1(cout, dst, src, n, v, OP, CB) \
+ do { \
+ mp_size_t __gmp_i; \
+ mp_limb_t __gmp_x, __gmp_r; \
+ \
+ /* ASSERT ((n) >= 1); */ \
+ /* ASSERT (MPN_SAME_OR_SEPARATE_P (dst, src, n)); */ \
+ \
+ __gmp_x = (src)[0]; \
+ __gmp_r = __gmp_x OP (v); \
+ (dst)[0] = __gmp_r & GMP_NUMB_MASK; \
+ if (__gmp_r >> GMP_NUMB_BITS != 0) \
+ { \
+ (cout) = 1; \
+ for (__gmp_i = 1; __gmp_i < (n);) \
+ { \
+ __gmp_x = (src)[__gmp_i]; \
+ __gmp_r = __gmp_x OP 1; \
+ (dst)[__gmp_i] = __gmp_r & GMP_NUMB_MASK; \
+ ++__gmp_i; \
+ if (__gmp_r >> GMP_NUMB_BITS == 0) \
+ { \
+ if ((src) != (dst)) \
+ __GMPN_COPY_REST (dst, src, n, __gmp_i); \
+ (cout) = 0; \
+ break; \
+ } \
+ } \
+ } \
+ else \
+ { \
+ if ((src) != (dst)) \
+ __GMPN_COPY_REST (dst, src, n, 1); \
+ (cout) = 0; \
+ } \
+ } while (0)
+#endif
+
+#define __GMPN_ADDCB(r,x,y) ((r) < (y))
+#define __GMPN_SUBCB(r,x,y) ((x) < (y))
+
+#define __GMPN_ADD_1(cout, dst, src, n, v) \
+ __GMPN_AORS_1(cout, dst, src, n, v, +, __GMPN_ADDCB)
+#define __GMPN_SUB_1(cout, dst, src, n, v) \
+ __GMPN_AORS_1(cout, dst, src, n, v, -, __GMPN_SUBCB)
+
+
+/* Compare {xp,size} and {yp,size}, setting "result" to positive, zero or
+ negative. size==0 is allowed. On random data usually only one limb will
+ need to be examined to get a result, so it's worth having it inline. */
+#define __GMPN_CMP(result, xp, yp, size) \
+ do { \
+ mp_size_t __gmp_i; \
+ mp_limb_t __gmp_x, __gmp_y; \
+ \
+ /* ASSERT ((size) >= 0); */ \
+ \
+ (result) = 0; \
+ __gmp_i = (size); \
+ while (--__gmp_i >= 0) \
+ { \
+ __gmp_x = (xp)[__gmp_i]; \
+ __gmp_y = (yp)[__gmp_i]; \
+ if (__gmp_x != __gmp_y) \
+ { \
+ /* Cannot use __gmp_x - __gmp_y, may overflow an "int" */ \
+ (result) = (__gmp_x > __gmp_y ? 1 : -1); \
+ break; \
+ } \
+ } \
+ } while (0)
+
+
+#if defined (__GMPN_COPY) && ! defined (__GMPN_COPY_REST)
+#define __GMPN_COPY_REST(dst, src, size, start) \
+ do { \
+ /* ASSERT ((start) >= 0); */ \
+ /* ASSERT ((start) <= (size)); */ \
+ __GMPN_COPY ((dst)+(start), (src)+(start), (size)-(start)); \
+ } while (0)
+#endif
+
+/* Copy {src,size} to {dst,size}, starting at "start". This is designed to
+ keep the indexing dst[j] and src[j] nice and simple for __GMPN_ADD_1,
+ __GMPN_ADD, etc. */
+#if ! defined (__GMPN_COPY_REST)
+#define __GMPN_COPY_REST(dst, src, size, start) \
+ do { \
+ mp_size_t __gmp_j; \
+ /* ASSERT ((size) >= 0); */ \
+ /* ASSERT ((start) >= 0); */ \
+ /* ASSERT ((start) <= (size)); */ \
+ /* ASSERT (MPN_SAME_OR_SEPARATE_P (dst, src, size)); */ \
+ __GMP_CRAY_Pragma ("_CRI ivdep"); \
+ for (__gmp_j = (start); __gmp_j < (size); __gmp_j++) \
+ (dst)[__gmp_j] = (src)[__gmp_j]; \
+ } while (0)
+#endif
+
+/* Enhancement: Use some of the smarter code from gmp-impl.h. Maybe use
+ mpn_copyi if there's a native version, and if we don't mind demanding
+ binary compatibility for it (on targets which use it). */
+
+#if ! defined (__GMPN_COPY)
+#define __GMPN_COPY(dst, src, size) __GMPN_COPY_REST (dst, src, size, 0)
+#endif
+
+
+#if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpn_add)
+#if ! defined (__GMP_FORCE_mpn_add)
+__GMP_EXTERN_INLINE
+#endif
+mp_limb_t
+mpn_add (mp_ptr __gmp_wp, mp_srcptr __gmp_xp, mp_size_t __gmp_xsize, mp_srcptr __gmp_yp, mp_size_t __gmp_ysize)
+{
+ mp_limb_t __gmp_c;
+ __GMPN_ADD (__gmp_c, __gmp_wp, __gmp_xp, __gmp_xsize, __gmp_yp, __gmp_ysize);
+ return __gmp_c;
+}
+#endif
+
+#if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpn_add_1)
+#if ! defined (__GMP_FORCE_mpn_add_1)
+__GMP_EXTERN_INLINE
+#endif
+mp_limb_t
+mpn_add_1 (mp_ptr __gmp_dst, mp_srcptr __gmp_src, mp_size_t __gmp_size, mp_limb_t __gmp_n) __GMP_NOTHROW
+{
+ mp_limb_t __gmp_c;
+ __GMPN_ADD_1 (__gmp_c, __gmp_dst, __gmp_src, __gmp_size, __gmp_n);
+ return __gmp_c;
+}
+#endif
+
+#if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpn_cmp)
+#if ! defined (__GMP_FORCE_mpn_cmp)
+__GMP_EXTERN_INLINE
+#endif
+int
+mpn_cmp (mp_srcptr __gmp_xp, mp_srcptr __gmp_yp, mp_size_t __gmp_size) __GMP_NOTHROW
+{
+ int __gmp_result;
+ __GMPN_CMP (__gmp_result, __gmp_xp, __gmp_yp, __gmp_size);
+ return __gmp_result;
+}
+#endif
+
+#if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpn_sub)
+#if ! defined (__GMP_FORCE_mpn_sub)
+__GMP_EXTERN_INLINE
+#endif
+mp_limb_t
+mpn_sub (mp_ptr __gmp_wp, mp_srcptr __gmp_xp, mp_size_t __gmp_xsize, mp_srcptr __gmp_yp, mp_size_t __gmp_ysize)
+{
+ mp_limb_t __gmp_c;
+ __GMPN_SUB (__gmp_c, __gmp_wp, __gmp_xp, __gmp_xsize, __gmp_yp, __gmp_ysize);
+ return __gmp_c;
+}
+#endif
+
+#if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpn_sub_1)
+#if ! defined (__GMP_FORCE_mpn_sub_1)
+__GMP_EXTERN_INLINE
+#endif
+mp_limb_t
+mpn_sub_1 (mp_ptr __gmp_dst, mp_srcptr __gmp_src, mp_size_t __gmp_size, mp_limb_t __gmp_n) __GMP_NOTHROW
+{
+ mp_limb_t __gmp_c;
+ __GMPN_SUB_1 (__gmp_c, __gmp_dst, __gmp_src, __gmp_size, __gmp_n);
+ return __gmp_c;
+}
+#endif
+
+#if defined (__cplusplus)
+}
+#endif
+
+
+/* Allow faster testing for negative, zero, and positive. */
+#define mpz_sgn(Z) ((Z)->_mp_size < 0 ? -1 : (Z)->_mp_size > 0)
+#define mpf_sgn(F) ((F)->_mp_size < 0 ? -1 : (F)->_mp_size > 0)
+#define mpq_sgn(Q) ((Q)->_mp_num._mp_size < 0 ? -1 : (Q)->_mp_num._mp_size > 0)
+
+/* When using GCC, optimize certain common comparisons. */
+#if defined (__GNUC__)
+#define mpz_cmp_ui(Z,UI) \
+ (__builtin_constant_p (UI) && (UI) == 0 \
+ ? mpz_sgn (Z) : _mpz_cmp_ui (Z,UI))
+#define mpz_cmp_si(Z,SI) \
+ (__builtin_constant_p (SI) && (SI) == 0 ? mpz_sgn (Z) \
+ : __builtin_constant_p (SI) && (SI) > 0 \
+ ? _mpz_cmp_ui (Z, __GMP_CAST (unsigned long int, SI)) \
+ : _mpz_cmp_si (Z,SI))
+#define mpq_cmp_ui(Q,NUI,DUI) \
+ (__builtin_constant_p (NUI) && (NUI) == 0 \
+ ? mpq_sgn (Q) : _mpq_cmp_ui (Q,NUI,DUI))
+#define mpq_cmp_si(q,n,d) \
+ (__builtin_constant_p ((n) >= 0) && (n) >= 0 \
+ ? mpq_cmp_ui (q, __GMP_CAST (unsigned long, n), d) \
+ : _mpq_cmp_si (q, n, d))
+#else
+#define mpz_cmp_ui(Z,UI) _mpz_cmp_ui (Z,UI)
+#define mpz_cmp_si(Z,UI) _mpz_cmp_si (Z,UI)
+#define mpq_cmp_ui(Q,NUI,DUI) _mpq_cmp_ui (Q,NUI,DUI)
+#define mpq_cmp_si(q,n,d) _mpq_cmp_si(q,n,d)
+#endif
+
+
+/* Using "&" rather than "&&" means these can come out branch-free. Every
+ mpz_t has at least one limb allocated, so fetching the low limb is always
+ allowed. */
+#define mpz_odd_p(z) (((z)->_mp_size != 0) & __GMP_CAST (int, (z)->_mp_d[0]))
+#define mpz_even_p(z) (! mpz_odd_p (z))
+
+
+/**************** C++ routines ****************/
+
+#ifdef __cplusplus
+__GMP_DECLSPEC_XX std::ostream& operator<< (std::ostream &, mpz_srcptr);
+__GMP_DECLSPEC_XX std::ostream& operator<< (std::ostream &, mpq_srcptr);
+__GMP_DECLSPEC_XX std::ostream& operator<< (std::ostream &, mpf_srcptr);
+__GMP_DECLSPEC_XX std::istream& operator>> (std::istream &, mpz_ptr);
+__GMP_DECLSPEC_XX std::istream& operator>> (std::istream &, mpq_ptr);
+__GMP_DECLSPEC_XX std::istream& operator>> (std::istream &, mpf_ptr);
+#endif
+
+
+/* Source-level compatibility with GMP 2 and earlier. */
+#define mpn_divmod(qp,np,nsize,dp,dsize) \
+ mpn_divrem (qp, __GMP_CAST (mp_size_t, 0), np, nsize, dp, dsize)
+
+/* Source-level compatibility with GMP 1. */
+#define mpz_mdiv mpz_fdiv_q
+#define mpz_mdivmod mpz_fdiv_qr
+#define mpz_mmod mpz_fdiv_r
+#define mpz_mdiv_ui mpz_fdiv_q_ui
+#define mpz_mdivmod_ui(q,r,n,d) \
+ (((r) == 0) ? mpz_fdiv_q_ui (q,n,d) : mpz_fdiv_qr_ui (q,r,n,d))
+#define mpz_mmod_ui(r,n,d) \
+ (((r) == 0) ? mpz_fdiv_ui (n,d) : mpz_fdiv_r_ui (r,n,d))
+
+/* Useful synonyms, but not quite compatible with GMP 1. */
+#define mpz_div mpz_fdiv_q
+#define mpz_divmod mpz_fdiv_qr
+#define mpz_div_ui mpz_fdiv_q_ui
+#define mpz_divmod_ui mpz_fdiv_qr_ui
+#define mpz_div_2exp mpz_fdiv_q_2exp
+#define mpz_mod_2exp mpz_fdiv_r_2exp
+
+enum
+{
+ GMP_ERROR_NONE = 0,
+ GMP_ERROR_UNSUPPORTED_ARGUMENT = 1,
+ GMP_ERROR_DIVISION_BY_ZERO = 2,
+ GMP_ERROR_SQRT_OF_NEGATIVE = 4,
+ GMP_ERROR_INVALID_ARGUMENT = 8
+};
+
+/* Define CC and CFLAGS which were used to build this version of GMP */
+#define __GMP_CC "ccache gcc -m32"
+#define __GMP_CFLAGS "-m32 -O2 -fomit-frame-pointer -mtune=i386 -march=i386"
+
+/* Major version number is the value of __GNU_MP__ too, above and in mp.h. */
+#define __GNU_MP_VERSION 4
+#define __GNU_MP_VERSION_MINOR 2
+#define __GNU_MP_VERSION_PATCHLEVEL 4
+
+#define __GMP_H__
+#endif /* __GMP_H__ */
diff --git a/include/mpf2mpfr.h b/include/mpf2mpfr.h
new file mode 100644
index 0000000..0b89eef
--- /dev/null
+++ b/include/mpf2mpfr.h
@@ -0,0 +1,172 @@
+/* mpf2mpfr.h -- Compatibility include file with mpf.
+
+Copyright 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+Contributed by the Arenaire and Cacao projects, INRIA.
+
+This file is part of the GNU MPFR Library.
+
+The GNU MPFR Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License, or (at your
+option) any later version.
+
+The GNU MPFR Library is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with the GNU MPFR Library; see the file COPYING.LIB. If not, write to
+the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+MA 02110-1301, USA. */
+
+#ifndef __MPFR_FROM_MPF__
+#define __MPFR_FROM_MFF__
+
+/* types */
+#define mpf_t mpfr_t
+#define mpf_srcptr mpfr_srcptr
+#define mpf_ptr mpfr_ptr
+
+/* Get current Rounding Mode */
+#ifndef MPFR_DEFAULT_RND
+# define MPFR_DEFAULT_RND mpfr_get_default_rounding_mode ()
+#endif
+
+/* mpf_init initalizes at 0 */
+#undef mpf_init
+#define mpf_init(x) mpfr_init_set_ui ((x), 0, MPFR_DEFAULT_RND)
+#undef mpf_init2
+#define mpf_init2(x,p) (mpfr_init2((x),(p)), mpfr_set_ui ((x), 0, MPFR_DEFAULT_RND))
+
+/* functions which don't take as argument the rounding mode */
+#undef mpf_ceil
+#define mpf_ceil mpfr_ceil
+#undef mpf_clear
+#define mpf_clear mpfr_clear
+#undef mpf_cmp
+#define mpf_cmp mpfr_cmp
+#undef mpf_cmp_si
+#define mpf_cmp_si mpfr_cmp_si
+#undef mpf_cmp_ui
+#define mpf_cmp_ui mpfr_cmp_ui
+#undef mpf_cmp_d
+#define mpf_cmp_d mpfr_cmp_d
+#undef mpf_eq
+#define mpf_eq mpfr_eq
+#undef mpf_floor
+#define mpf_floor mpfr_floor
+#undef mpf_get_prec
+#define mpf_get_prec mpfr_get_prec
+#undef mpf_integer_p
+#define mpf_integer_p mpfr_integer_p
+#undef mpf_random2
+#define mpf_random2 mpfr_random2
+#undef mpf_set_default_prec
+#define mpf_set_default_prec mpfr_set_default_prec
+#undef mpf_get_default_prec
+#define mpf_get_default_prec mpfr_get_default_prec
+#undef mpf_set_prec
+#define mpf_set_prec mpfr_set_prec
+#undef mpf_set_prec_raw
+#define mpf_set_prec_raw(x,p) mpfr_prec_round(x,p,MPFR_DEFAULT_RND)
+#undef mpf_trunc
+#define mpf_trunc mpfr_trunc
+#undef mpf_sgn
+#define mpf_sgn mpfr_sgn
+#undef mpf_swap
+#define mpf_swap mpfr_swap
+#undef mpf_dump
+#define mpf_dump mpfr_dump
+
+/* functions which take as argument the rounding mode */
+#undef mpf_abs
+#define mpf_abs(x,y) mpfr_abs(x,y,MPFR_DEFAULT_RND)
+#undef mpf_add
+#define mpf_add(x,y,z) mpfr_add(x,y,z,MPFR_DEFAULT_RND)
+#undef mpf_add_ui
+#define mpf_add_ui(x,y,z) mpfr_add_ui(x,y,z,MPFR_DEFAULT_RND)
+#undef mpf_div
+#define mpf_div(x,y,z) mpfr_div(x,y,z,MPFR_DEFAULT_RND)
+#undef mpf_div_ui
+#define mpf_div_ui(x,y,z) mpfr_div_ui(x,y,z,MPFR_DEFAULT_RND)
+#undef mpf_div_2exp
+#define mpf_div_2exp(x,y,z) mpfr_div_2exp(x,y,z,MPFR_DEFAULT_RND)
+#undef mpf_fits_slong_p
+#define mpf_fits_slong_p(x) mpfr_fits_ulong_p(x,MPFR_DEFAULT_RND)
+#undef mpf_fits_ulong_p
+#define mpf_fits_ulong_p(x) mpfr_fits_ulong_p(x,MPFR_DEFAULT_RND)
+#undef mpf_fits_sint_p
+#define mpf_fits_sint_p(x) mpfr_fits_uint_p(x,MPFR_DEFAULT_RND)
+#undef mpf_fits_uint_p
+#define mpf_fits_uint_p(x) mpfr_fits_uint_p(x,MPFR_DEFAULT_RND)
+#undef mpf_fits_sshort_p
+#define mpf_fits_sshort_p(x) mpfr_fits_ushort_p(x,MPFR_DEFAULT_RND)
+#undef mpf_fits_ushort_p
+#define mpf_fits_ushort_p(x) mpfr_fits_ushort_p(x,MPFR_DEFAULT_RND)
+#undef mpf_get_str
+#define mpf_get_str(x,y,z,t,u) mpfr_get_str(x,y,z,t,u,MPFR_DEFAULT_RND)
+#undef mpf_get_d
+#define mpf_get_d(x) mpfr_get_d(x,MPFR_DEFAULT_RND)
+#undef mpf_get_d_2exp
+#define mpf_get_d_2exp(e,x) mpfr_get_d_2exp(e,x,MPFR_DEFAULT_RND)
+#undef mpf_get_ui
+#define mpf_get_ui(x) mpfr_get_ui(x,MPFR_DEFAULT_RND)
+#undef mpf_get_si
+#define mpf_get_si(x) mpfr_get_ui(x,MPFR_DEFAULT_RND)
+#undef mpf_inp_str
+#define mpf_inp_str(x,y,z) mpfr_inp_str(x,y,z,MPFR_DEFAULT_RND)
+#undef mpf_set_str
+#define mpf_set_str(x,y,z) mpfr_set_str(x,y,z,MPFR_DEFAULT_RND)
+#undef mpf_init_set
+#define mpf_init_set(x,y) mpfr_init_set(x,y,MPFR_DEFAULT_RND)
+#undef mpf_init_set_d
+#define mpf_init_set_d(x,y) mpfr_init_set_d(x,y,MPFR_DEFAULT_RND)
+#undef mpf_init_set_si
+#define mpf_init_set_si(x,y) mpfr_init_set_si(x,y,MPFR_DEFAULT_RND)
+#undef mpf_init_set_str
+#define mpf_init_set_str(x,y,z) mpfr_init_set_str(x,y,z,MPFR_DEFAULT_RND)
+#undef mpf_init_set_ui
+#define mpf_init_set_ui(x,y) mpfr_init_set_ui(x,y,MPFR_DEFAULT_RND)
+#undef mpf_mul
+#define mpf_mul(x,y,z) mpfr_mul(x,y,z,MPFR_DEFAULT_RND)
+#undef mpf_mul_2exp
+#define mpf_mul_2exp(x,y,z) mpfr_mul_2exp(x,y,z,MPFR_DEFAULT_RND)
+#undef mpf_mul_ui
+#define mpf_mul_ui(x,y,z) mpfr_mul_ui(x,y,z,MPFR_DEFAULT_RND)
+#undef mpf_neg
+#define mpf_neg(x,y) mpfr_neg(x,y,MPFR_DEFAULT_RND)
+#undef mpf_out_str
+#define mpf_out_str(x,y,z,t) mpfr_out_str(x,y,z,t,MPFR_DEFAULT_RND)
+#undef mpf_pow_ui
+#define mpf_pow_ui(x,y,z) mpfr_pow_ui(x,y,z,MPFR_DEFAULT_RND)
+#undef mpf_reldiff
+#define mpf_reldiff(x,y,z) mpfr_reldiff(x,y,z,MPFR_DEFAULT_RND)
+#undef mpf_set
+#define mpf_set(x,y) mpfr_set(x,y,MPFR_DEFAULT_RND)
+#undef mpf_set_d
+#define mpf_set_d(x,y) mpfr_set_d(x,y,MPFR_DEFAULT_RND)
+#undef mpf_set_q
+#define mpf_set_q(x,y) mpfr_set_q(x,y,MPFR_DEFAULT_RND)
+#undef mpf_set_si
+#define mpf_set_si(x,y) mpfr_set_si(x,y,MPFR_DEFAULT_RND)
+#undef mpf_set_ui
+#define mpf_set_ui(x,y) mpfr_set_ui(x,y,MPFR_DEFAULT_RND)
+#undef mpf_set_z
+#define mpf_set_z(x,y) mpfr_set_z(x,y,MPFR_DEFAULT_RND)
+#undef mpf_sqrt
+#define mpf_sqrt(x,y) mpfr_sqrt(x,y,MPFR_DEFAULT_RND)
+#undef mpf_sqrt_ui
+#define mpf_sqrt_ui(x,y) mpfr_sqrt_ui(x,y,MPFR_DEFAULT_RND)
+#undef mpf_sub
+#define mpf_sub(x,y,z) mpfr_sub(x,y,z,MPFR_DEFAULT_RND)
+#undef mpf_sub_ui
+#define mpf_sub_ui(x,y,z) mpfr_sub_ui(x,y,z,MPFR_DEFAULT_RND)
+#undef mpf_ui_div
+#define mpf_ui_div(x,y,z) mpfr_ui_div(x,y,z,MPFR_DEFAULT_RND)
+#undef mpf_ui_sub
+#define mpf_ui_sub(x,y,z) mpfr_ui_sub(x,y,z,MPFR_DEFAULT_RND)
+#undef mpf_urandomb
+#define mpf_urandomb(x,y,n) mpfr_urandomb(x,y)
+
+#endif
diff --git a/include/mpfr.h b/include/mpfr.h
new file mode 100644
index 0000000..1ae958f
--- /dev/null
+++ b/include/mpfr.h
@@ -0,0 +1,839 @@
+/* mpfr.h -- Include file for mpfr.
+
+Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+Contributed by the Arenaire and Cacao projects, INRIA.
+
+This file is part of the GNU MPFR Library.
+
+The GNU MPFR Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License, or (at your
+option) any later version.
+
+The GNU MPFR Library is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with the GNU MPFR Library; see the file COPYING.LIB. If not, write to
+the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+MA 02110-1301, USA. */
+
+#ifndef __MPFR_H
+#define __MPFR_H
+
+/* Define MPFR version number */
+#define MPFR_VERSION_MAJOR 2
+#define MPFR_VERSION_MINOR 4
+#define MPFR_VERSION_PATCHLEVEL 1
+#define MPFR_VERSION_STRING "2.4.1"
+
+/* Macros dealing with MPFR VERSION */
+#define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+#define MPFR_VERSION \
+MPFR_VERSION_NUM(MPFR_VERSION_MAJOR,MPFR_VERSION_MINOR,MPFR_VERSION_PATCHLEVEL)
+
+/* Check if GMP is included, and try to include it (Works with local GMP) */
+#ifndef __GMP_H__
+# include <gmp.h>
+#endif
+
+/* Check if stdio.h is included or if the user wants FILE */
+#if defined (_GMP_H_HAVE_FILE) || defined (MPFR_USE_FILE)
+# define _MPFR_H_HAVE_FILE 1
+#endif
+
+#if defined (_GMP_H_HAVE_VA_LIST)
+# define _MPFR_H_HAVE_VA_LIST 1
+#endif
+
+/* Check if stdint.h/inttypes.h is included or if the user wants intmax_t */
+#if (defined (INTMAX_C) && defined (UINTMAX_C)) || defined (MPFR_USE_INTMAX_T)
+# define _MPFR_H_HAVE_INTMAX_T 1
+#endif
+
+/* Definition of rounding modes (DON'T USE GMP_RNDNA!)
+ Warning! Changing the contents of this enum should be seen as an
+ interface change since the old and the new types are not compatible
+ (the integer type compatible with the enumerated type can even change,
+ see ISO C99, 6.7.2.2#4), and in Makefile.am, AGE should be set to 0. */
+typedef enum {
+ GMP_RNDN=0, GMP_RNDZ, GMP_RNDU, GMP_RNDD, GMP_RND_MAX,
+ GMP_RNDNA=-1
+} mpfr_rnd_t;
+
+/* Define precision : 1 (short), 2 (int) or 3 (long) (DON'T USE IT!)*/
+#ifndef _MPFR_PREC_FORMAT
+# if __GMP_MP_SIZE_T_INT == 1
+# define _MPFR_PREC_FORMAT 2
+# else
+# define _MPFR_PREC_FORMAT 3
+# endif
+#endif
+
+#if _MPFR_PREC_FORMAT == 1
+typedef unsigned short mpfr_prec_t;
+#elif _MPFR_PREC_FORMAT == 2
+typedef unsigned int mpfr_prec_t;
+#elif _MPFR_PREC_FORMAT == 3
+typedef unsigned long mpfr_prec_t;
+#else
+# error "Invalid MPFR Prec format"
+#endif
+
+/* Definition of precision limits */
+#define MPFR_PREC_MIN 2
+#define MPFR_PREC_MAX ((mpfr_prec_t)((mpfr_prec_t)(~(mpfr_prec_t)0)>>1))
+
+/* Definition of sign */
+typedef int mpfr_sign_t;
+
+/* Definition of the standard exponent limits */
+#define MPFR_EMAX_DEFAULT ((mp_exp_t) (((unsigned long) 1 << 30) - 1))
+#define MPFR_EMIN_DEFAULT (-(MPFR_EMAX_DEFAULT))
+
+/* Definition of the main structure */
+typedef struct {
+ mpfr_prec_t _mpfr_prec;
+ mpfr_sign_t _mpfr_sign;
+ mp_exp_t _mpfr_exp;
+ mp_limb_t *_mpfr_d;
+} __mpfr_struct;
+
+/* Compatibility with previous types of MPFR */
+#ifndef mp_rnd_t
+# define mp_rnd_t mpfr_rnd_t
+#endif
+#ifndef mp_prec_t
+# define mp_prec_t mpfr_prec_t
+#endif
+
+/*
+ The represented number is
+ _sign*(_d[k-1]/B+_d[k-2]/B^2+...+_d[0]/B^k)*2^_exp
+ where k=ceil(_mp_prec/BITS_PER_MP_LIMB) and B=2^BITS_PER_MP_LIMB.
+
+ For the msb (most significant bit) normalized representation, we must have
+ _d[k-1]>=B/2, unless the number is singular.
+
+ We must also have the last k*BITS_PER_MP_LIMB-_prec bits set to zero.
+*/
+
+typedef __mpfr_struct mpfr_t[1];
+typedef __mpfr_struct *mpfr_ptr;
+typedef __gmp_const __mpfr_struct *mpfr_srcptr;
+
+/* For those who need a direct and fast access to the sign field.
+ However it is not in the API, thus use it at your own risk: it might
+ not be supported, or change name, in further versions!
+ Unfortunately, it must be defined here (instead of MPFR's internal
+ header file mpfr-impl.h) because it is used by some macros below.
+*/
+#define MPFR_SIGN(x) ((x)->_mpfr_sign)
+
+/* Stack interface */
+typedef enum {
+ MPFR_NAN_KIND = 0,
+ MPFR_INF_KIND = 1, MPFR_ZERO_KIND = 2, MPFR_REGULAR_KIND = 3
+} mpfr_kind_t;
+
+/* GMP defines:
+ + size_t: Standard size_t
+ + __GMP_ATTRIBUTE_PURE Attribute for math functions.
+ + __GMP_NOTHROW For C++: can't throw .
+ + __GMP_EXTERN_INLINE Attribute for inline function.
+ * __gmp_const const (Supports for K&R compiler only for mpfr.h).
+ + __GMP_DECLSPEC_EXPORT compiling to go into a DLL
+ + __GMP_DECLSPEC_IMPORT compiling to go into a application
+*/
+/* Extra MPFR defines */
+#define __MPFR_SENTINEL_ATTR
+#if defined (__GNUC__)
+# if __GNUC__ >= 4
+# undef __MPFR_SENTINEL_ATTR
+# define __MPFR_SENTINEL_ATTR __attribute__ ((sentinel))
+# endif
+#endif
+
+/* Prototypes: Support of K&R compiler */
+#if defined (__GMP_PROTO)
+# define _MPFR_PROTO __GMP_PROTO
+#elif defined (__STDC__) || defined (__cplusplus)
+# define _MPFR_PROTO(x) x
+#else
+# define _MPFR_PROTO(x) ()
+#endif
+/* Support for WINDOWS Dll:
+ Check if we are inside a MPFR build, and if so export the functions.
+ Otherwise does the same thing as GMP */
+#if defined(__MPFR_WITHIN_MPFR) && __GMP_LIBGMP_DLL
+# define __MPFR_DECLSPEC __GMP_DECLSPEC_EXPORT
+#else
+# define __MPFR_DECLSPEC __GMP_DECLSPEC
+#endif
+
+/* Note: some functions need that a specific system header is included before
+ mpfr.h to be defined. If the user forgets to include the header, the mpfr
+ function prototype in the user object file is not correct. In order to
+ raise a linker error in that case, we change their internal name in the
+ GNU mpfr library (prefixed by __gmpfr instead of mpfr)*/
+#if defined (__cplusplus)
+extern "C" {
+#endif
+
+__MPFR_DECLSPEC __gmp_const char * mpfr_get_version _MPFR_PROTO ((void));
+__MPFR_DECLSPEC __gmp_const char * mpfr_get_patches _MPFR_PROTO ((void));
+
+__MPFR_DECLSPEC mp_exp_t mpfr_get_emin _MPFR_PROTO ((void));
+__MPFR_DECLSPEC int mpfr_set_emin _MPFR_PROTO ((mp_exp_t));
+__MPFR_DECLSPEC mp_exp_t mpfr_get_emin_min _MPFR_PROTO ((void));
+__MPFR_DECLSPEC mp_exp_t mpfr_get_emin_max _MPFR_PROTO ((void));
+__MPFR_DECLSPEC mp_exp_t mpfr_get_emax _MPFR_PROTO ((void));
+__MPFR_DECLSPEC int mpfr_set_emax _MPFR_PROTO ((mp_exp_t));
+__MPFR_DECLSPEC mp_exp_t mpfr_get_emax_min _MPFR_PROTO ((void));
+__MPFR_DECLSPEC mp_exp_t mpfr_get_emax_max _MPFR_PROTO ((void));
+
+__MPFR_DECLSPEC void mpfr_set_default_rounding_mode _MPFR_PROTO((mpfr_rnd_t));
+__MPFR_DECLSPEC mp_rnd_t mpfr_get_default_rounding_mode _MPFR_PROTO((void));
+__MPFR_DECLSPEC __gmp_const char *
+ mpfr_print_rnd_mode _MPFR_PROTO((mpfr_rnd_t));
+
+__MPFR_DECLSPEC void mpfr_clear_flags _MPFR_PROTO ((void));
+__MPFR_DECLSPEC void mpfr_clear_underflow _MPFR_PROTO ((void));
+__MPFR_DECLSPEC void mpfr_clear_overflow _MPFR_PROTO ((void));
+__MPFR_DECLSPEC void mpfr_clear_nanflag _MPFR_PROTO ((void));
+__MPFR_DECLSPEC void mpfr_clear_inexflag _MPFR_PROTO ((void));
+__MPFR_DECLSPEC void mpfr_clear_erangeflag _MPFR_PROTO ((void));
+
+__MPFR_DECLSPEC void mpfr_set_underflow _MPFR_PROTO ((void));
+__MPFR_DECLSPEC void mpfr_set_overflow _MPFR_PROTO ((void));
+__MPFR_DECLSPEC void mpfr_set_nanflag _MPFR_PROTO ((void));
+__MPFR_DECLSPEC void mpfr_set_inexflag _MPFR_PROTO ((void));
+__MPFR_DECLSPEC void mpfr_set_erangeflag _MPFR_PROTO ((void));
+
+__MPFR_DECLSPEC int mpfr_underflow_p _MPFR_PROTO ((void));
+__MPFR_DECLSPEC int mpfr_overflow_p _MPFR_PROTO ((void));
+__MPFR_DECLSPEC int mpfr_nanflag_p _MPFR_PROTO ((void));
+__MPFR_DECLSPEC int mpfr_inexflag_p _MPFR_PROTO ((void));
+__MPFR_DECLSPEC int mpfr_erangeflag_p _MPFR_PROTO ((void));
+
+__MPFR_DECLSPEC int
+ mpfr_check_range _MPFR_PROTO ((mpfr_ptr, int, mpfr_rnd_t));
+
+__MPFR_DECLSPEC void mpfr_init2 _MPFR_PROTO ((mpfr_ptr, mpfr_prec_t));
+__MPFR_DECLSPEC void mpfr_init _MPFR_PROTO ((mpfr_ptr));
+__MPFR_DECLSPEC void mpfr_clear _MPFR_PROTO ((mpfr_ptr));
+
+__MPFR_DECLSPEC void
+ mpfr_inits2 _MPFR_PROTO ((mp_prec_t, mpfr_ptr, ...)) __MPFR_SENTINEL_ATTR;
+__MPFR_DECLSPEC void
+ mpfr_inits _MPFR_PROTO ((mpfr_ptr, ...)) __MPFR_SENTINEL_ATTR;
+__MPFR_DECLSPEC void
+ mpfr_clears _MPFR_PROTO ((mpfr_ptr, ...)) __MPFR_SENTINEL_ATTR;
+
+__MPFR_DECLSPEC int
+ mpfr_prec_round _MPFR_PROTO ((mpfr_ptr, mpfr_prec_t, mpfr_rnd_t));
+__MPFR_DECLSPEC int
+ mpfr_can_round _MPFR_PROTO ((mpfr_srcptr, mp_exp_t, mpfr_rnd_t, mpfr_rnd_t,
+ mpfr_prec_t));
+
+__MPFR_DECLSPEC mp_exp_t mpfr_get_exp _MPFR_PROTO ((mpfr_srcptr));
+__MPFR_DECLSPEC int mpfr_set_exp _MPFR_PROTO ((mpfr_ptr, mp_exp_t));
+__MPFR_DECLSPEC mp_prec_t mpfr_get_prec _MPFR_PROTO((mpfr_srcptr));
+__MPFR_DECLSPEC void mpfr_set_prec _MPFR_PROTO((mpfr_ptr, mpfr_prec_t));
+__MPFR_DECLSPEC void mpfr_set_prec_raw _MPFR_PROTO((mpfr_ptr, mpfr_prec_t));
+__MPFR_DECLSPEC void mpfr_set_default_prec _MPFR_PROTO((mpfr_prec_t));
+__MPFR_DECLSPEC mp_prec_t mpfr_get_default_prec _MPFR_PROTO((void));
+
+__MPFR_DECLSPEC int mpfr_set_d _MPFR_PROTO ((mpfr_ptr, double, mpfr_rnd_t));
+#ifdef MPFR_WANT_DECIMAL_FLOATS
+__MPFR_DECLSPEC int mpfr_set_decimal64 _MPFR_PROTO ((mpfr_ptr, _Decimal64,
+ mp_rnd_t));
+#endif
+__MPFR_DECLSPEC int
+ mpfr_set_ld _MPFR_PROTO ((mpfr_ptr, long double, mpfr_rnd_t));
+__MPFR_DECLSPEC int
+ mpfr_set_z _MPFR_PROTO ((mpfr_ptr, mpz_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC void mpfr_set_nan _MPFR_PROTO ((mpfr_ptr));
+__MPFR_DECLSPEC void mpfr_set_inf _MPFR_PROTO ((mpfr_ptr, int));
+__MPFR_DECLSPEC int
+ mpfr_set_f _MPFR_PROTO ((mpfr_ptr, mpf_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int
+ mpfr_get_f _MPFR_PROTO ((mpf_ptr, mpfr_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_set_si _MPFR_PROTO ((mpfr_ptr, long, mpfr_rnd_t));
+__MPFR_DECLSPEC int
+ mpfr_set_ui _MPFR_PROTO ((mpfr_ptr, unsigned long, mpfr_rnd_t));
+__MPFR_DECLSPEC int
+ mpfr_set_si_2exp _MPFR_PROTO ((mpfr_ptr, long, mp_exp_t, mpfr_rnd_t));
+__MPFR_DECLSPEC int
+ mpfr_set_ui_2exp _MPFR_PROTO ((mpfr_ptr,unsigned long,mp_exp_t,mpfr_rnd_t));
+__MPFR_DECLSPEC int
+ mpfr_set_q _MPFR_PROTO ((mpfr_ptr, mpq_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int
+ mpfr_set_str _MPFR_PROTO ((mpfr_ptr, __gmp_const char *, int, mpfr_rnd_t));
+__MPFR_DECLSPEC int
+ mpfr_init_set_str _MPFR_PROTO ((mpfr_ptr, __gmp_const char *, int,
+ mpfr_rnd_t));
+__MPFR_DECLSPEC int
+ mpfr_set4 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_rnd_t, int));
+__MPFR_DECLSPEC int
+ mpfr_abs _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int
+ mpfr_set _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_neg _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_signbit _MPFR_PROTO ((mpfr_srcptr));
+__MPFR_DECLSPEC int
+ mpfr_setsign _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, int, mpfr_rnd_t));
+__MPFR_DECLSPEC int
+ mpfr_copysign _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mpfr_rnd_t));
+
+#ifdef _MPFR_H_HAVE_INTMAX_T
+#define mpfr_set_sj __gmpfr_set_sj
+#define mpfr_set_sj_2exp __gmpfr_set_sj_2exp
+#define mpfr_set_uj __gmpfr_set_uj
+#define mpfr_set_uj_2exp __gmpfr_set_uj_2exp
+#define mpfr_get_sj __gmpfr_mpfr_get_sj
+#define mpfr_get_uj __gmpfr_mpfr_get_uj
+__MPFR_DECLSPEC int mpfr_set_sj _MPFR_PROTO ((mpfr_t, intmax_t, mpfr_rnd_t));
+__MPFR_DECLSPEC int
+ mpfr_set_sj_2exp _MPFR_PROTO ((mpfr_t, intmax_t, intmax_t, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_set_uj _MPFR_PROTO ((mpfr_t, uintmax_t, mpfr_rnd_t));
+__MPFR_DECLSPEC int
+ mpfr_set_uj_2exp _MPFR_PROTO ((mpfr_t, uintmax_t, intmax_t, mpfr_rnd_t));
+__MPFR_DECLSPEC intmax_t mpfr_get_sj _MPFR_PROTO ((mpfr_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC uintmax_t mpfr_get_uj _MPFR_PROTO ((mpfr_srcptr, mpfr_rnd_t));
+#endif
+
+__MPFR_DECLSPEC mp_exp_t mpfr_get_z_exp _MPFR_PROTO ((mpz_ptr, mpfr_srcptr));
+__MPFR_DECLSPEC double mpfr_get_d _MPFR_PROTO ((mpfr_srcptr, mpfr_rnd_t));
+#ifdef MPFR_WANT_DECIMAL_FLOATS
+__MPFR_DECLSPEC _Decimal64 mpfr_get_decimal64 _MPFR_PROTO ((mpfr_srcptr,
+ mp_rnd_t));
+#endif
+__MPFR_DECLSPEC long double mpfr_get_ld _MPFR_PROTO ((mpfr_srcptr,
+ mpfr_rnd_t));
+__MPFR_DECLSPEC double mpfr_get_d1 _MPFR_PROTO ((mpfr_srcptr));
+__MPFR_DECLSPEC double mpfr_get_d_2exp _MPFR_PROTO ((long*, mpfr_srcptr,
+ mpfr_rnd_t));
+__MPFR_DECLSPEC long double mpfr_get_ld_2exp _MPFR_PROTO ((long*, mpfr_srcptr,
+ mpfr_rnd_t));
+__MPFR_DECLSPEC long mpfr_get_si _MPFR_PROTO ((mpfr_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC unsigned long mpfr_get_ui _MPFR_PROTO ((mpfr_srcptr,
+ mpfr_rnd_t));
+__MPFR_DECLSPEC char*mpfr_get_str _MPFR_PROTO ((char*, mp_exp_t*, int, size_t,
+ mpfr_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC void mpfr_get_z _MPFR_PROTO ((mpz_ptr z, mpfr_srcptr f,
+ mpfr_rnd_t));
+
+__MPFR_DECLSPEC void mpfr_free_str _MPFR_PROTO ((char *));
+
+
+__MPFR_DECLSPEC void mpfr_random _MPFR_PROTO ((mpfr_ptr));
+__MPFR_DECLSPEC void mpfr_random2 _MPFR_PROTO ((mpfr_ptr,mp_size_t,mp_exp_t));
+__MPFR_DECLSPEC int mpfr_urandomb _MPFR_PROTO ((mpfr_ptr, gmp_randstate_t));
+
+__MPFR_DECLSPEC void mpfr_nextabove _MPFR_PROTO ((mpfr_ptr));
+__MPFR_DECLSPEC void mpfr_nextbelow _MPFR_PROTO ((mpfr_ptr));
+__MPFR_DECLSPEC void mpfr_nexttoward _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr));
+
+#ifdef _MPFR_H_HAVE_FILE
+#define mpfr_inp_str __gmpfr_inp_str
+#define mpfr_out_str __gmpfr_out_str
+__MPFR_DECLSPEC size_t mpfr_inp_str _MPFR_PROTO ((mpfr_ptr, FILE*, int,
+ mpfr_rnd_t));
+__MPFR_DECLSPEC size_t mpfr_out_str _MPFR_PROTO ((FILE*, int, size_t,
+ mpfr_srcptr, mpfr_rnd_t));
+#define mpfr_fprintf __gmpfr_fprintf
+__MPFR_DECLSPEC int mpfr_fprintf _MPFR_PROTO ((FILE*, __gmp_const char*,
+ ...));
+#endif
+__MPFR_DECLSPEC int mpfr_printf _MPFR_PROTO ((__gmp_const char*, ...));
+__MPFR_DECLSPEC int mpfr_asprintf _MPFR_PROTO ((char**, __gmp_const char*,
+ ...));
+__MPFR_DECLSPEC int mpfr_sprintf _MPFR_PROTO ((char*, __gmp_const char*,
+ ...));
+__MPFR_DECLSPEC int mpfr_snprintf _MPFR_PROTO ((char*, size_t,
+ __gmp_const char*, ...));
+
+#ifdef _MPFR_H_HAVE_VA_LIST
+#ifdef _MPFR_H_HAVE_FILE
+#define mpfr_vfprintf __gmpfr_vfprintf
+__MPFR_DECLSPEC int mpfr_vfprintf _MPFR_PROTO ((FILE*, __gmp_const char*,
+ va_list));
+#endif /* _MPFR_H_HAVE_FILE */
+#define mpfr_vprintf __gmpfr_vprintf
+#define mpfr_vasprintf __gmpfr_vasprintf
+#define mpfr_vsprintf __gmpfr_vsprintf
+#define mpfr_vsnprintf __gmpfr_vsnprintf
+__MPFR_DECLSPEC int mpfr_vprintf _MPFR_PROTO ((__gmp_const char*, va_list));
+__MPFR_DECLSPEC int mpfr_vasprintf _MPFR_PROTO ((char**, __gmp_const char*,
+ va_list));
+__MPFR_DECLSPEC int mpfr_vsprintf _MPFR_PROTO ((char*, __gmp_const char*,
+ va_list));
+__MPFR_DECLSPEC int mpfr_vsnprintf _MPFR_PROTO ((char*, size_t,
+ __gmp_const char*, va_list));
+#endif /* _MPFR_H_HAVE_VA_LIST */
+
+__MPFR_DECLSPEC int mpfr_pow _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ mpfr_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_pow_si _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ long int, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_pow_ui _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ unsigned long int, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_ui_pow_ui _MPFR_PROTO ((mpfr_ptr, unsigned long int,
+ unsigned long int, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_ui_pow _MPFR_PROTO ((mpfr_ptr, unsigned long int,
+ mpfr_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_pow_z _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ mpz_srcptr, mpfr_rnd_t));
+
+__MPFR_DECLSPEC int mpfr_sqrt _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_sqrt_ui _MPFR_PROTO ((mpfr_ptr, unsigned long,
+ mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_rec_sqrt _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ mpfr_rnd_t));
+
+__MPFR_DECLSPEC int mpfr_add _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ mpfr_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_sub _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ mpfr_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_mul _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ mpfr_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_div _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ mpfr_srcptr, mpfr_rnd_t));
+
+__MPFR_DECLSPEC int mpfr_add_ui _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ unsigned long, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_sub_ui _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ unsigned long, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_ui_sub _MPFR_PROTO ((mpfr_ptr, unsigned long,
+ mpfr_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_mul_ui _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ unsigned long, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_div_ui _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ unsigned long, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_ui_div _MPFR_PROTO ((mpfr_ptr, unsigned long,
+ mpfr_srcptr, mpfr_rnd_t));
+
+__MPFR_DECLSPEC int mpfr_add_si _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ long int, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_sub_si _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ long int, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_si_sub _MPFR_PROTO ((mpfr_ptr, long int,
+ mpfr_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_mul_si _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ long int, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_div_si _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ long int, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_si_div _MPFR_PROTO ((mpfr_ptr, long int,
+ mpfr_srcptr, mpfr_rnd_t));
+
+__MPFR_DECLSPEC int mpfr_add_d _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ double, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_sub_d _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ double, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_d_sub _MPFR_PROTO ((mpfr_ptr, double,
+ mpfr_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_mul_d _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ double, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_div_d _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ double, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_d_div _MPFR_PROTO ((mpfr_ptr, double,
+ mpfr_srcptr, mpfr_rnd_t));
+
+__MPFR_DECLSPEC int mpfr_sqr _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
+
+__MPFR_DECLSPEC int mpfr_const_pi _MPFR_PROTO ((mpfr_ptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_const_log2 _MPFR_PROTO ((mpfr_ptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_const_euler _MPFR_PROTO ((mpfr_ptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_const_catalan _MPFR_PROTO ((mpfr_ptr, mpfr_rnd_t));
+
+__MPFR_DECLSPEC int mpfr_agm _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_srcptr,
+ mpfr_rnd_t));
+
+__MPFR_DECLSPEC int mpfr_log _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_log2 _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_log10 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_log1p _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ mpfr_rnd_t));
+
+__MPFR_DECLSPEC int mpfr_exp _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_exp2 _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_exp10 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_expm1 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_eint _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_li2 _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
+
+__MPFR_DECLSPEC int mpfr_cmp _MPFR_PROTO ((mpfr_srcptr, mpfr_srcptr));
+__MPFR_DECLSPEC int mpfr_cmp3 _MPFR_PROTO ((mpfr_srcptr, mpfr_srcptr, int));
+__MPFR_DECLSPEC int mpfr_cmp_d _MPFR_PROTO ((mpfr_srcptr, double));
+__MPFR_DECLSPEC int mpfr_cmp_ld _MPFR_PROTO ((mpfr_srcptr, long double));
+__MPFR_DECLSPEC int mpfr_cmpabs _MPFR_PROTO ((mpfr_srcptr, mpfr_srcptr));
+__MPFR_DECLSPEC int mpfr_cmp_ui _MPFR_PROTO ((mpfr_srcptr, unsigned long));
+__MPFR_DECLSPEC int mpfr_cmp_si _MPFR_PROTO ((mpfr_srcptr, long));
+__MPFR_DECLSPEC int mpfr_cmp_ui_2exp _MPFR_PROTO ((mpfr_srcptr, unsigned long,
+ mp_exp_t));
+__MPFR_DECLSPEC int mpfr_cmp_si_2exp _MPFR_PROTO ((mpfr_srcptr, long,
+ mp_exp_t));
+__MPFR_DECLSPEC void mpfr_reldiff _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ mpfr_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_eq _MPFR_PROTO((mpfr_srcptr, mpfr_srcptr,
+ unsigned long));
+__MPFR_DECLSPEC int mpfr_sgn _MPFR_PROTO ((mpfr_srcptr));
+
+__MPFR_DECLSPEC int mpfr_mul_2exp _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ unsigned long, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_div_2exp _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ unsigned long, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_mul_2ui _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ unsigned long, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_div_2ui _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ unsigned long, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_mul_2si _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ long, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_div_2si _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ long, mpfr_rnd_t));
+
+__MPFR_DECLSPEC int mpfr_rint _MPFR_PROTO((mpfr_ptr,mpfr_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_round _MPFR_PROTO((mpfr_ptr, mpfr_srcptr));
+__MPFR_DECLSPEC int mpfr_trunc _MPFR_PROTO((mpfr_ptr, mpfr_srcptr));
+__MPFR_DECLSPEC int mpfr_ceil _MPFR_PROTO((mpfr_ptr, mpfr_srcptr));
+__MPFR_DECLSPEC int mpfr_floor _MPFR_PROTO((mpfr_ptr, mpfr_srcptr));
+__MPFR_DECLSPEC int mpfr_rint_round _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_rint_trunc _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_rint_ceil _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_rint_floor _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_frac _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_modf _MPFR_PROTO ((mpfr_ptr, mpfr_ptr, mpfr_srcptr,
+ mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_remquo _MPFR_PROTO ((mpfr_ptr, long*, mpfr_srcptr,
+ mpfr_srcptr, mp_rnd_t));
+__MPFR_DECLSPEC int mpfr_remainder _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ mpfr_srcptr, mp_rnd_t));
+__MPFR_DECLSPEC int mpfr_fmod _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ mpfr_srcptr, mp_rnd_t));
+
+__MPFR_DECLSPEC int mpfr_fits_ulong_p _MPFR_PROTO((mpfr_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_fits_slong_p _MPFR_PROTO((mpfr_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_fits_uint_p _MPFR_PROTO((mpfr_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_fits_sint_p _MPFR_PROTO((mpfr_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_fits_ushort_p _MPFR_PROTO((mpfr_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_fits_sshort_p _MPFR_PROTO((mpfr_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_fits_uintmax_p _MPFR_PROTO((mpfr_srcptr,mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_fits_intmax_p _MPFR_PROTO((mpfr_srcptr, mpfr_rnd_t));
+
+__MPFR_DECLSPEC void mpfr_extract _MPFR_PROTO ((mpz_ptr, mpfr_srcptr,
+ unsigned int));
+__MPFR_DECLSPEC void mpfr_swap _MPFR_PROTO ((mpfr_ptr, mpfr_ptr));
+__MPFR_DECLSPEC void mpfr_dump _MPFR_PROTO ((mpfr_srcptr));
+
+__MPFR_DECLSPEC int mpfr_nan_p _MPFR_PROTO((mpfr_srcptr));
+__MPFR_DECLSPEC int mpfr_inf_p _MPFR_PROTO((mpfr_srcptr));
+__MPFR_DECLSPEC int mpfr_number_p _MPFR_PROTO((mpfr_srcptr));
+__MPFR_DECLSPEC int mpfr_integer_p _MPFR_PROTO ((mpfr_srcptr));
+__MPFR_DECLSPEC int mpfr_zero_p _MPFR_PROTO ((mpfr_srcptr));
+
+__MPFR_DECLSPEC int mpfr_greater_p _MPFR_PROTO ((mpfr_srcptr, mpfr_srcptr));
+__MPFR_DECLSPEC int mpfr_greaterequal_p _MPFR_PROTO ((mpfr_srcptr,
+ mpfr_srcptr));
+__MPFR_DECLSPEC int mpfr_less_p _MPFR_PROTO ((mpfr_srcptr, mpfr_srcptr));
+__MPFR_DECLSPEC int mpfr_lessequal_p _MPFR_PROTO ((mpfr_srcptr, mpfr_srcptr));
+__MPFR_DECLSPEC int mpfr_lessgreater_p _MPFR_PROTO((mpfr_srcptr,mpfr_srcptr));
+__MPFR_DECLSPEC int mpfr_equal_p _MPFR_PROTO ((mpfr_srcptr, mpfr_srcptr));
+__MPFR_DECLSPEC int mpfr_unordered_p _MPFR_PROTO ((mpfr_srcptr, mpfr_srcptr));
+
+__MPFR_DECLSPEC int mpfr_atanh _MPFR_PROTO((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_acosh _MPFR_PROTO((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_asinh _MPFR_PROTO((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_cosh _MPFR_PROTO((mpfr_ptr,mpfr_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_sinh _MPFR_PROTO((mpfr_ptr,mpfr_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_tanh _MPFR_PROTO((mpfr_ptr,mpfr_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_sinh_cosh _MPFR_PROTO ((mpfr_ptr, mpfr_ptr,
+ mpfr_srcptr, mpfr_rnd_t));
+
+__MPFR_DECLSPEC int mpfr_sech _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_csch _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_coth _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
+
+__MPFR_DECLSPEC int mpfr_acos _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_asin _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_atan _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_sin _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_sin_cos _MPFR_PROTO ((mpfr_ptr, mpfr_ptr,
+ mpfr_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_cos _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_tan _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_atan2 _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_srcptr,
+ mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_sec _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_csc _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_cot _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
+
+__MPFR_DECLSPEC int mpfr_hypot _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ mpfr_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_erf _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_erfc _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_cbrt _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_root _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,unsigned long,mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_gamma _MPFR_PROTO((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_lngamma _MPFR_PROTO((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_lgamma _MPFR_PROTO((mpfr_ptr,int*,mpfr_srcptr,mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_zeta _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_zeta_ui _MPFR_PROTO ((mpfr_ptr,unsigned long,mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_fac_ui _MPFR_PROTO ((mpfr_ptr, unsigned long int,
+ mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_j0 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_j1 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_jn _MPFR_PROTO ((mpfr_ptr, long, mpfr_srcptr,
+ mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_y0 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_y1 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_yn _MPFR_PROTO ((mpfr_ptr, long, mpfr_srcptr,
+ mpfr_rnd_t));
+
+__MPFR_DECLSPEC int mpfr_min _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_srcptr,
+ mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_max _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_srcptr,
+ mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_dim _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_srcptr,
+ mpfr_rnd_t));
+
+__MPFR_DECLSPEC int mpfr_mul_z _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ mpz_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_div_z _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ mpz_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_add_z _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ mpz_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_sub_z _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ mpz_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_cmp_z _MPFR_PROTO ((mpfr_srcptr, mpz_srcptr));
+
+__MPFR_DECLSPEC int mpfr_mul_q _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ mpq_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_div_q _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ mpq_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_add_q _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ mpq_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_sub_q _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
+ mpq_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_cmp_q _MPFR_PROTO ((mpfr_srcptr, mpq_srcptr));
+
+__MPFR_DECLSPEC int mpfr_cmp_f _MPFR_PROTO ((mpfr_srcptr, mpf_srcptr));
+
+__MPFR_DECLSPEC int mpfr_fma _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_srcptr,
+ mpfr_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_fms _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_srcptr,
+ mpfr_srcptr, mpfr_rnd_t));
+__MPFR_DECLSPEC int mpfr_sum _MPFR_PROTO ((mpfr_ptr, mpfr_ptr *__gmp_const,
+ unsigned long, mpfr_rnd_t));
+
+__MPFR_DECLSPEC void mpfr_free_cache _MPFR_PROTO ((void));
+
+__MPFR_DECLSPEC int mpfr_subnormalize _MPFR_PROTO ((mpfr_ptr, int,
+ mp_rnd_t));
+
+__MPFR_DECLSPEC int mpfr_strtofr _MPFR_PROTO ((mpfr_ptr, __gmp_const char *,
+ char **, int, mpfr_rnd_t));
+
+__MPFR_DECLSPEC size_t mpfr_custom_get_size _MPFR_PROTO ((mp_prec_t));
+__MPFR_DECLSPEC void mpfr_custom_init _MPFR_PROTO ((void *, mp_prec_t));
+__MPFR_DECLSPEC void * mpfr_custom_get_mantissa _MPFR_PROTO ((mpfr_srcptr));
+__MPFR_DECLSPEC mp_exp_t mpfr_custom_get_exp _MPFR_PROTO ((mpfr_srcptr));
+__MPFR_DECLSPEC void mpfr_custom_move _MPFR_PROTO ((mpfr_ptr, void *));
+__MPFR_DECLSPEC void mpfr_custom_init_set _MPFR_PROTO ((mpfr_ptr, int,
+ mp_exp_t, mp_prec_t, void *));
+__MPFR_DECLSPEC int mpfr_custom_get_kind _MPFR_PROTO ((mpfr_srcptr));
+
+#if defined (__cplusplus)
+}
+#endif
+
+/* DON'T USE THIS! (For MPFR-public macros only, see below.)
+ The mpfr_sgn macro uses the fact that __MPFR_EXP_NAN and __MPFR_EXP_ZERO
+ are the smallest values. */
+#if __GMP_MP_SIZE_T_INT
+#define __MPFR_EXP_NAN ((mp_exp_t)((~((~(unsigned int)0)>>1))+2))
+#define __MPFR_EXP_ZERO ((mp_exp_t)((~((~(unsigned int)0)>>1))+1))
+#define __MPFR_EXP_INF ((mp_exp_t)((~((~(unsigned int)0)>>1))+3))
+#else
+#define __MPFR_EXP_NAN ((mp_exp_t)((~((~(unsigned long)0)>>1))+2))
+#define __MPFR_EXP_ZERO ((mp_exp_t)((~((~(unsigned long)0)>>1))+1))
+#define __MPFR_EXP_INF ((mp_exp_t)((~((~(unsigned long)0)>>1))+3))
+#endif
+
+/* Define MPFR_USE_EXTENSION to avoid "gcc -pedantic" warnings. */
+#ifndef MPFR_EXTENSION
+# if defined(MPFR_USE_EXTENSION)
+# define MPFR_EXTENSION __extension__
+# else
+# define MPFR_EXTENSION
+# endif
+#endif
+
+/* Warning! This macro doesn't work with K&R C and shouldn't be used
+ internally. For public use only, but see the MPFR manual. */
+#define MPFR_DECL_INIT(_x, _p) \
+ MPFR_EXTENSION mp_limb_t __gmpfr_local_tab_##_x[((_p)-1)/GMP_NUMB_BITS+1]; \
+ MPFR_EXTENSION mpfr_t _x = {{(_p),1,__MPFR_EXP_NAN,__gmpfr_local_tab_##_x}}
+
+/* Fast access macros to replace function interface.
+ If the USER don't want to use the macro interface, let him make happy
+ even if it produces faster and smaller code. */
+#ifndef MPFR_USE_NO_MACRO
+
+/* Inlining theses functions is both faster and smaller */
+#define mpfr_nan_p(_x) ((_x)->_mpfr_exp == __MPFR_EXP_NAN)
+#define mpfr_inf_p(_x) ((_x)->_mpfr_exp == __MPFR_EXP_INF)
+#define mpfr_zero_p(_x) ((_x)->_mpfr_exp == __MPFR_EXP_ZERO)
+#define mpfr_sgn(_x) \
+ ((_x)->_mpfr_exp < __MPFR_EXP_INF ? \
+ (mpfr_nan_p (_x) ? mpfr_set_erangeflag () : (void) 0), 0 : \
+ MPFR_SIGN (_x))
+
+/* Prevent them from using as lvalues */
+#define mpfr_get_prec(_x) ((_x)->_mpfr_prec + 0)
+#define mpfr_get_exp(_x) ((_x)->_mpfr_exp + 0)
+
+#define mpfr_round(a,b) mpfr_rint((a), (b), GMP_RNDNA)
+#define mpfr_trunc(a,b) mpfr_rint((a), (b), GMP_RNDZ)
+#define mpfr_ceil(a,b) mpfr_rint((a), (b), GMP_RNDU)
+#define mpfr_floor(a,b) mpfr_rint((a), (b), GMP_RNDD)
+
+#define mpfr_cmp_ui(b,i) mpfr_cmp_ui_2exp((b),(i),0)
+#define mpfr_cmp_si(b,i) mpfr_cmp_si_2exp((b),(i),0)
+#define mpfr_set(a,b,r) mpfr_set4(a,b,r,MPFR_SIGN(b))
+#define mpfr_abs(a,b,r) mpfr_set4(a,b,r,1)
+#define mpfr_copysign(a,b,c,r) mpfr_set4(a,b,r,MPFR_SIGN(c))
+#define mpfr_setsign(a,b,s,r) mpfr_set4(a,b,r,(s) ? -1 : 1)
+#define mpfr_signbit(x) (MPFR_SIGN(x) < 0)
+#define mpfr_cmp(b, c) mpfr_cmp3(b, c, 1)
+#define mpfr_mul_2exp(y,x,n,r) mpfr_mul_2ui((y),(x),(n),(r))
+#define mpfr_div_2exp(y,x,n,r) mpfr_div_2ui((y),(x),(n),(r))
+
+
+/* When using GCC, optimize certain common comparisons and affectations.
+ + Remove ICC since it defines __GNUC__ but produces a
+ huge number of warnings if you use this code.
+ VL: I couldn't reproduce a single warning when enabling these macros
+ with icc 10.1 20080212 on Itanium. But with this version, __ICC isn't
+ defined (__INTEL_COMPILER is, though), so that these macros are enabled
+ anyway. Checking with other ICC versions is needed. Possibly detect
+ whether warnings are produced or not with a configure test.
+ + Remove C++ too, since it complains too much. */
+#if defined (__GNUC__) && !defined(__ICC) && !defined(__cplusplus)
+#if (__GNUC__ >= 2)
+#undef mpfr_cmp_ui
+/* We use the fact that mpfr_sgn on NaN sets the erange flag and returns 0. */
+#define mpfr_cmp_ui(_f,_u) \
+ (__builtin_constant_p (_u) && (_u) == 0 ? \
+ mpfr_sgn (_f) : \
+ mpfr_cmp_ui_2exp ((_f),(_u),0))
+#undef mpfr_cmp_si
+#define mpfr_cmp_si(_f,_s) \
+ (__builtin_constant_p (_s) && (_s) >= 0 ? \
+ mpfr_cmp_ui ((_f), (_s)) : \
+ mpfr_cmp_si_2exp ((_f), (_s), 0))
+#if __GNUC__ > 2 || __GNUC_MINOR__ >= 95
+#undef mpfr_set_ui
+#define mpfr_set_ui(_f,_u,_r) \
+ (__builtin_constant_p (_u) && (_u) == 0 ? \
+ __extension__ ({ \
+ mpfr_ptr _p = (_f); \
+ _p->_mpfr_sign = 1; \
+ _p->_mpfr_exp = __MPFR_EXP_ZERO; \
+ (void) (_r); 0; }) : \
+ mpfr_set_ui_2exp ((_f), (_u), 0, (_r)))
+#endif
+#undef mpfr_set_si
+#define mpfr_set_si(_f,_s,_r) \
+ (__builtin_constant_p (_s) && (_s) >= 0 ? \
+ mpfr_set_ui ((_f), (_s), (_r)) : \
+ mpfr_set_si_2exp ((_f), (_s), 0, (_r)))
+#endif
+#endif
+
+/* Macro version of mpfr_stack interface for fast access */
+#define mpfr_custom_get_size(p) ((size_t) \
+ (((p)+GMP_NUMB_BITS-1)/GMP_NUMB_BITS*sizeof (mp_limb_t)))
+#define mpfr_custom_init(m,p) do {} while (0)
+#define mpfr_custom_get_mantissa(x) ((void*)((x)->_mpfr_d))
+#define mpfr_custom_get_exp(x) ((x)->_mpfr_exp)
+#define mpfr_custom_move(x,m) do { ((x)->_mpfr_d = (mp_limb_t*)(m)); } while (0)
+#define mpfr_custom_init_set(x,k,e,p,m) do { \
+ mpfr_ptr _x = (x); \
+ mp_exp_t _e; \
+ mpfr_kind_t _t; \
+ int _s, _k; \
+ _k = (k); \
+ if (_k >= 0) { \
+ _t = (mpfr_kind_t) _k; \
+ _s = 1; \
+ } else { \
+ _t = (mpfr_kind_t) -k; \
+ _s = -1; \
+ } \
+ _e = _t == MPFR_REGULAR_KIND ? (e) : \
+ _t == MPFR_NAN_KIND ? __MPFR_EXP_NAN : \
+ _t == MPFR_INF_KIND ? __MPFR_EXP_INF : __MPFR_EXP_ZERO; \
+ _x->_mpfr_prec = (p); \
+ _x->_mpfr_sign = _s; \
+ _x->_mpfr_exp = _e; \
+ _x->_mpfr_d = (mp_limb_t*) (m); \
+ } while (0)
+#define mpfr_custom_get_kind(x) \
+ ( (x)->_mpfr_exp > __MPFR_EXP_INF ? (int)MPFR_REGULAR_KIND*MPFR_SIGN (x) \
+ : (x)->_mpfr_exp == __MPFR_EXP_INF ? (int)MPFR_INF_KIND*MPFR_SIGN (x) \
+ : (x)->_mpfr_exp == __MPFR_EXP_NAN ? (int)MPFR_NAN_KIND \
+ : (int) MPFR_ZERO_KIND * MPFR_SIGN (x) )
+
+
+#endif /* MPFR_USE_NO_MACRO */
+
+/* Theses are defined to be macros */
+#define mpfr_init_set_si(x, i, rnd) \
+ ( mpfr_init(x), mpfr_set_si((x), (i), (rnd)) )
+#define mpfr_init_set_ui(x, i, rnd) \
+ ( mpfr_init(x), mpfr_set_ui((x), (i), (rnd)) )
+#define mpfr_init_set_d(x, d, rnd) \
+ ( mpfr_init(x), mpfr_set_d((x), (d), (rnd)) )
+#define mpfr_init_set_ld(x, d, rnd) \
+ ( mpfr_init(x), mpfr_set_ld((x), (d), (rnd)) )
+#define mpfr_init_set_z(x, i, rnd) \
+ ( mpfr_init(x), mpfr_set_z((x), (i), (rnd)) )
+#define mpfr_init_set_q(x, i, rnd) \
+ ( mpfr_init(x), mpfr_set_q((x), (i), (rnd)) )
+#define mpfr_init_set(x, y, rnd) \
+ ( mpfr_init(x), mpfr_set((x), (y), (rnd)) )
+#define mpfr_init_set_f(x, y, rnd) \
+ ( mpfr_init(x), mpfr_set_f((x), (y), (rnd)) )
+
+/* Compatibility layer -- obsolete functions and macros */
+#define mpfr_cmp_abs mpfr_cmpabs
+#define mpfr_round_prec(x,r,p) mpfr_prec_round(x,p,r)
+#define __gmp_default_rounding_mode (mpfr_get_default_rounding_mode())
+#define __mpfr_emin (mpfr_get_emin())
+#define __mpfr_emax (mpfr_get_emax())
+#define __mpfr_default_fp_bit_precision (mpfr_get_default_fp_bit_precision())
+#define MPFR_EMIN_MIN mpfr_get_emin_min()
+#define MPFR_EMIN_MAX mpfr_get_emin_max()
+#define MPFR_EMAX_MIN mpfr_get_emax_min()
+#define MPFR_EMAX_MAX mpfr_get_emax_max()
+#define mpfr_version (mpfr_get_version())
+#ifndef mpz_set_fr
+# define mpz_set_fr mpfr_get_z
+#endif
+#define mpfr_add_one_ulp(x,r) \
+ (mpfr_sgn (x) > 0 ? mpfr_nextabove (x) : mpfr_nextbelow (x))
+#define mpfr_sub_one_ulp(x,r) \
+ (mpfr_sgn (x) > 0 ? mpfr_nextbelow (x) : mpfr_nextabove (x))
+
+#endif /* __MPFR_H*/
diff --git a/lib/gcc/i686-linux/4.4.3/crtbegin.o b/lib/gcc/i686-linux/4.4.3/crtbegin.o
new file mode 100644
index 0000000..d8469ed
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/crtbegin.o
Binary files differ
diff --git a/lib/gcc/i686-linux/4.4.3/crtbeginS.o b/lib/gcc/i686-linux/4.4.3/crtbeginS.o
new file mode 100644
index 0000000..de453f2
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/crtbeginS.o
Binary files differ
diff --git a/lib/gcc/i686-linux/4.4.3/crtbeginT.o b/lib/gcc/i686-linux/4.4.3/crtbeginT.o
new file mode 100644
index 0000000..db4ea29
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/crtbeginT.o
Binary files differ
diff --git a/lib/gcc/i686-linux/4.4.3/crtend.o b/lib/gcc/i686-linux/4.4.3/crtend.o
new file mode 100644
index 0000000..0f45bee
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/crtend.o
Binary files differ
diff --git a/lib/gcc/i686-linux/4.4.3/crtendS.o b/lib/gcc/i686-linux/4.4.3/crtendS.o
new file mode 100644
index 0000000..eebdeaf
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/crtendS.o
Binary files differ
diff --git a/lib/gcc/i686-linux/4.4.3/crtfastmath.o b/lib/gcc/i686-linux/4.4.3/crtfastmath.o
new file mode 100644
index 0000000..e8287a7
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/crtfastmath.o
Binary files differ
diff --git a/lib/gcc/i686-linux/4.4.3/crtprec32.o b/lib/gcc/i686-linux/4.4.3/crtprec32.o
new file mode 100644
index 0000000..14cc445
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/crtprec32.o
Binary files differ
diff --git a/lib/gcc/i686-linux/4.4.3/crtprec64.o b/lib/gcc/i686-linux/4.4.3/crtprec64.o
new file mode 100644
index 0000000..6e2abc1
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/crtprec64.o
Binary files differ
diff --git a/lib/gcc/i686-linux/4.4.3/crtprec80.o b/lib/gcc/i686-linux/4.4.3/crtprec80.o
new file mode 100644
index 0000000..d5a01a3
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/crtprec80.o
Binary files differ
diff --git a/lib/gcc/i686-linux/4.4.3/include-fixed/README b/lib/gcc/i686-linux/4.4.3/include-fixed/README
new file mode 100644
index 0000000..7086a77
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include-fixed/README
@@ -0,0 +1,14 @@
+This README file is copied into the directory for GCC-only header files
+when fixincludes is run by the makefile for GCC.
+
+Many of the files in this directory were automatically edited from the
+standard system header files by the fixincludes process. They are
+system-specific, and will not work on any other kind of system. They
+are also not part of GCC. The reason we have to do this is because
+GCC requires ANSI C headers and many vendors supply ANSI-incompatible
+headers.
+
+Because this is an automated process, sometimes headers get "fixed"
+that do not, strictly speaking, need a fix. As long as nothing is broken
+by the process, it is just an unfortunate collateral inconvenience.
+We would like to rectify it, if it is not "too inconvenient".
diff --git a/lib/gcc/i686-linux/4.4.3/include-fixed/X11/Xos.h b/lib/gcc/i686-linux/4.4.3/include-fixed/X11/Xos.h
new file mode 100644
index 0000000..267e653
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include-fixed/X11/Xos.h
@@ -0,0 +1,305 @@
+/* DO NOT EDIT THIS FILE.
+
+ It has been auto-edited by fixincludes from:
+
+ "/tmp/gcc32/1/i686-linux-glibc2.7-4.4.3/sysroot/usr/include/X11/Xos.h"
+
+ This had to be done to correct non-standard usages in the
+ original, manufacturer supplied header file. */
+
+/*
+ * $XdotOrg: proto/X11/Xos.h,v 1.8 2005/11/08 06:33:25 jkj Exp $
+ * $Xorg: Xos.h,v 1.6 2001/02/09 02:03:22 xorgcvs Exp $
+ *
+ *
+Copyright 1987, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+ *
+ * The X Window System is a Trademark of The Open Group.
+ *
+ */
+/* $XFree86: xc/include/Xos.h,v 3.41tsi Exp $ */
+
+/* This is a collection of things to try and minimize system dependencies
+ * in a "significant" number of source files.
+ */
+
+#ifndef _XOS_H_
+#define _XOS_H_
+
+#include <X11/Xosdefs.h>
+
+/*
+ * Get major data types (esp. caddr_t)
+ */
+
+#ifdef USG
+#ifndef __TYPES__
+#ifdef CRAY
+#define word word_t
+#endif /* CRAY */
+#include <sys/types.h> /* forgot to protect it... */
+#define __TYPES__
+#endif /* __TYPES__ */
+#else /* USG */
+#if defined(_POSIX_SOURCE) && defined(MOTOROLA)
+#undef _POSIX_SOURCE
+#include <sys/types.h>
+#define _POSIX_SOURCE
+#else
+# include <sys/types.h>
+#endif
+#endif /* USG */
+
+#ifndef sgi
+#if defined(__SCO__) || defined(__UNIXWARE__)
+#include <stdint.h>
+#endif
+#endif
+
+#ifdef _SEQUENT_
+/*
+ * in_systm.h compatibility between SysV and BSD types u_char u_short u_long
+ * select.h for typedef of args to select, fd_set, may use SVR4 later
+ */
+#include <netinet/in_systm.h>
+#include <sys/select.h>
+#endif /* _SEQUENT_ */
+
+/*
+ * Just about everyone needs the strings routines. We provide both forms here,
+ * index/rindex and strchr/strrchr, so any systems that don't provide them all
+ * need to have #defines here.
+ *
+ * These macros are defined this way, rather than, e.g.:
+ * #defined index(s,c) strchr(s,c)
+ * because someone might be using them as function pointers, and such
+ * a change would break compatibility for anyone who's relying on them
+ * being the way they currently are. So we're stuck with them this way,
+ * which can be really inconvenient. :-(
+ */
+
+#ifndef X_NOT_STDC_ENV
+
+#include <string.h>
+#if defined(__SCO__) || defined(__UNIXWARE__)
+#include <strings.h>
+#else
+#if (defined(sun) && defined(__SVR4))
+#include <strings.h>
+#endif
+#ifdef __STDC__
+#ifndef index
+#define index(s,c) (strchr((s),(c)))
+#endif
+#ifndef rindex
+#define rindex(s,c) (strrchr((s),(c)))
+#endif
+#else
+#ifndef index
+#define index strchr
+#endif
+#ifndef rindex
+#define rindex strrchr
+#endif
+#endif
+#endif
+
+#else
+
+#ifdef SYSV
+#if defined(clipper) || defined(__clipper__)
+#include <malloc.h>
+#endif
+#include <string.h>
+#define index strchr
+#define rindex strrchr
+#else
+#include <strings.h>
+#define strchr index
+#define strrchr rindex
+#endif
+
+#endif /* X_NOT_STDC_ENV */
+
+/*
+ * strerror()
+ */
+#if (defined(X_NOT_STDC_ENV) || (defined(sun) && !defined(SVR4)) || defined(macII)) && !defined(__GLIBC__)
+#ifndef strerror
+extern char *sys_errlist[];
+extern int sys_nerr;
+#define strerror(n) \
+ (((n) >= 0 && (n) < sys_nerr) ? sys_errlist[n] : "unknown error")
+#endif
+#endif
+
+/*
+ * Get open(2) constants
+ */
+#if defined(X_NOT_POSIX)
+#include <fcntl.h>
+#if defined(USL) || defined(CRAY) || defined(MOTOROLA) || (defined(__i386__) && (defined(SYSV) || defined(SVR4))) || defined(__sxg__)
+#include <unistd.h>
+#endif
+#ifdef WIN32
+#include <X11/Xw32defs.h>
+#else
+#include <sys/file.h>
+#endif
+#else /* X_NOT_POSIX */
+#if !defined(_POSIX_SOURCE) && defined(macII)
+#define _POSIX_SOURCE
+#include <fcntl.h>
+#include <unistd.h>
+#undef _POSIX_SOURCE
+#else
+#include <fcntl.h>
+#include <unistd.h>
+#endif
+#endif /* X_NOT_POSIX else */
+
+/*
+ * Get struct timeval and struct tm
+ */
+
+#if defined(SYSV) && !defined(_SEQUENT_)
+
+#ifndef USL
+#include <sys/time.h>
+#endif
+#include <time.h>
+#ifdef CRAY
+#undef word
+#endif /* CRAY */
+#if defined(USG) && !defined(CRAY) && !defined(MOTOROLA) && !defined(uniosu) && !defined(__sxg__) && !defined(clipper) && !defined(__clipper__)
+struct timeval {
+ long tv_sec;
+ long tv_usec;
+};
+#ifndef USL_SHARELIB
+struct timezone {
+ int tz_minuteswest;
+ int tz_dsttime;
+};
+#endif /* USL_SHARELIB */
+#endif /* USG */
+
+#ifdef _SEQUENT_
+struct timezone {
+ int tz_minuteswest;
+ int tz_dsttime;
+};
+#endif /* _SEQUENT_ */
+
+#else /* not SYSV */
+
+#if defined(_POSIX_SOURCE) && defined(SVR4)
+/* need to omit _POSIX_SOURCE in order to get what we want in SVR4 */
+#undef _POSIX_SOURCE
+#include <sys/time.h>
+#define _POSIX_SOURCE
+#elif defined(WIN32)
+#include <time.h>
+#if !defined(_WINSOCKAPI_) && !defined(_WILLWINSOCK_) && !defined(_TIMEVAL_DEFINED) && !defined(_STRUCT_TIMEVAL)
+struct timeval {
+ long tv_sec; /* seconds */
+ long tv_usec; /* and microseconds */
+};
+#define _TIMEVAL_DEFINED
+#endif
+#include <sys/timeb.h>
+#define gettimeofday(t) \
+{ \
+ struct _timeb _gtodtmp; \
+ _ftime (&_gtodtmp); \
+ (t)->tv_sec = _gtodtmp.time; \
+ (t)->tv_usec = _gtodtmp.millitm * 1000; \
+}
+#elif defined(_SEQUENT_) || defined(Lynx)
+#include <time.h>
+#elif defined (__QNX__)
+typedef unsigned long fd_mask;
+/* Make sure we get 256 bit select masks */
+#define FD_SETSIZE 256
+#include <sys/select.h>
+#include <sys/time.h>
+#include <time.h>
+#else
+#include <sys/time.h>
+#include <time.h>
+#endif /* defined(_POSIX_SOURCE) && defined(SVR4) */
+
+#endif /* SYSV */
+
+/* define X_GETTIMEOFDAY macro, a portable gettimeofday() */
+#if defined(_XOPEN_XPG4) || defined(_XOPEN_UNIX) /* _XOPEN_UNIX is XPG4.2 */
+#define X_GETTIMEOFDAY(t) gettimeofday(t, (struct timezone*)0)
+#else
+#if defined(SVR4) || defined(VMS) || defined(WIN32)
+#define X_GETTIMEOFDAY(t) gettimeofday(t)
+#else
+#define X_GETTIMEOFDAY(t) gettimeofday(t, (struct timezone*)0)
+#endif
+#endif /* XPG4 else */
+
+#ifdef __UNIXOS2__
+typedef unsigned long fd_mask;
+#include <limits.h>
+#define MAX_PATH _POSIX_PATH_MAX
+#endif
+
+#ifdef __GNU__
+#define PATH_MAX 4096
+#define MAXPATHLEN 4096
+#define OPEN_MAX 256 /* We define a reasonable limit. */
+#endif
+
+/* use POSIX name for signal */
+#if defined(X_NOT_POSIX) && defined(SYSV) && !defined(SIGCHLD) && !defined(ISC)
+#define SIGCHLD SIGCLD
+#endif
+
+#ifdef ISC
+#include <sys/bsdtypes.h>
+#include <sys/limits.h>
+#define NGROUPS 16
+#endif
+
+#if defined(ISC) || defined(__UNIXOS2__) || \
+ (defined(__linux__) && !defined(__GLIBC__)) || \
+ (defined(__QNX__) && !defined(UNIXCONN))
+/*
+ * Some OS's may not have this
+ */
+
+#define X_NO_SYS_UN 1
+
+struct sockaddr_un {
+ short sun_family;
+ char sun_path[108];
+};
+#endif
+
+#include <X11/Xarch.h>
+
+#endif /* _XOS_H_ */
diff --git a/lib/gcc/i686-linux/4.4.3/include-fixed/X11/Xos_r.h b/lib/gcc/i686-linux/4.4.3/include-fixed/X11/Xos_r.h
new file mode 100644
index 0000000..ce99af3
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include-fixed/X11/Xos_r.h
@@ -0,0 +1,1169 @@
+/* DO NOT EDIT THIS FILE.
+
+ It has been auto-edited by fixincludes from:
+
+ "/tmp/gcc32/1/i686-linux-glibc2.7-4.4.3/sysroot/usr/include/X11/Xos_r.h"
+
+ This had to be done to correct non-standard usages in the
+ original, manufacturer supplied header file. */
+
+/* $Xorg: Xos_r.h,v 1.4 2001/02/09 02:03:22 xorgcvs Exp $ */
+/* $XdotOrg: proto/X11/Xos_r.h,v 1.5 2005/07/13 07:23:56 keithp Exp $ */
+/*
+Copyright 1996, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+*/
+/* $XFree86: xc/include/Xos_r.h,v 1.18tsi Exp $ */
+
+/*
+ * Various and sundry Thread-Safe functions used by X11, Motif, and CDE.
+ *
+ * Use this file in MT-safe code where you would have included
+ * <dirent.h> for readdir()
+ * <grp.h> for getgrgid() or getgrnam()
+ * <netdb.h> for gethostbyname(), gethostbyaddr(), or getservbyname()
+ * <pwd.h> for getpwnam() or getpwuid()
+ * <string.h> for strtok()
+ * <time.h> for asctime(), ctime(), localtime(), or gmtime()
+ * <unistd.h> for getlogin() or ttyname()
+ * or their thread-safe analogs.
+ *
+ * If you are on a platform that defines XTHREADS but does not have
+ * MT-safe system API (e.g. UnixWare) you must define _Xos_processLock
+ * and _Xos_processUnlock macros before including this header. If
+ * you are on OSF/1 V3.2 and plan to use readdir(), you must also define
+ * _Xos_isThreadInitialized. For convenience XOS_USE_XLIB_LOCKING or
+ * XOS_USE_XT_LOCKING may be defined to obtain either Xlib-only or
+ * Xt-based versions of these macros. These macros won't result in
+ * truly thread-safe calls, but they are better than nothing. If you
+ * do not want locking in this situation define XOS_USE_NO_LOCKING.
+ *
+ * NOTE: On systems lacking appropriate _r functions Gethostbyname(),
+ * Gethostbyaddr(), and Getservbyname() do NOT copy the host or
+ * protocol lists!
+ *
+ * NOTE: On systems lacking appropriate _r functions Getgrgid() and
+ * Getgrnam() do NOT copy the list of group members!
+ *
+ * This header is nominally intended to simplify porting X11, Motif, and
+ * CDE; it may be useful to other people too. The structure below is
+ * complicated, mostly because P1003.1c (the IEEE POSIX Threads spec)
+ * went through lots of drafts, and some vendors shipped systems based
+ * on draft API that were changed later. Unfortunately POSIX did not
+ * provide a feature-test macro for distinguishing each of the drafts.
+ */
+
+/*
+ * This header has several parts. Search for "Effective prototypes"
+ * to locate the beginning of a section.
+ */
+
+/* This header can be included multiple times with different defines! */
+#ifndef _XOS_R_H_
+# define _XOS_R_H_
+
+# include <X11/Xos.h>
+# include <X11/Xfuncs.h>
+
+# ifndef X_NOT_POSIX
+# ifdef _POSIX_SOURCE
+# include <limits.h>
+# else
+# define _POSIX_SOURCE
+# include <limits.h>
+# undef _POSIX_SOURCE
+# endif
+# ifndef LINE_MAX
+# define X_LINE_MAX 2048
+# else
+# define X_LINE_MAX LINE_MAX
+# endif
+# endif
+#endif /* _XOS_R_H */
+
+#ifndef WIN32
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# if defined(XOS_USE_XLIB_LOCKING)
+# ifndef XAllocIDs /* Xlibint.h does not have multiple include protection */
+typedef struct _LockInfoRec *LockInfoPtr;
+extern LockInfoPtr _Xglobal_lock;
+# endif
+# ifndef _Xos_isThreadInitialized
+# define _Xos_isThreadInitialized (_Xglobal_lock)
+# endif
+# if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
+# ifndef XAllocIDs /* Xlibint.h does not have multiple include protection */
+# include <X11/Xfuncproto.h> /* for NeedFunctionPrototypes */
+extern void (*_XLockMutex_fn)(
+# if NeedFunctionPrototypes
+ LockInfoPtr /* lock */, char * /* file */, int /* line */
+# endif
+);
+extern void (*_XUnlockMutex_fn)(
+# if NeedFunctionPrototypes
+ LockInfoPtr /* lock */, char * /* file */, int /* line */
+# endif
+);
+# endif
+# ifndef _Xos_processLock
+# define _Xos_processLock \
+ (_XLockMutex_fn ? (*_XLockMutex_fn)(_Xglobal_lock,__FILE__,__LINE__) : 0)
+# endif
+# ifndef _Xos_processUnlock
+# define _Xos_processUnlock \
+ (_XUnlockMutex_fn ? (*_XUnlockMutex_fn)(_Xglobal_lock,__FILE__,__LINE__) : 0)
+# endif
+# else
+# ifndef XAllocIDs /* Xlibint.h does not have multiple include protection */
+# include <X11/Xfuncproto.h> /* for NeedFunctionPrototypes */
+extern void (*_XLockMutex_fn)(
+# if NeedFunctionPrototypes
+ LockInfoPtr /* lock */
+# endif
+);
+extern void (*_XUnlockMutex_fn)(
+# if NeedFunctionPrototypes
+ LockInfoPtr /* lock */
+# endif
+);
+# endif
+# ifndef _Xos_processLock
+# define _Xos_processLock \
+ (_XLockMutex_fn ? ((*_XLockMutex_fn)(_Xglobal_lock), 0) : 0)
+# endif
+# ifndef _Xos_processUnlock
+# define _Xos_processUnlock \
+ (_XUnlockMutex_fn ? ((*_XUnlockMutex_fn)(_Xglobal_lock), 0) : 0)
+# endif
+# endif
+# elif defined(XOS_USE_XT_LOCKING)
+# ifndef _XtThreadsI_h
+extern void (*_XtProcessLock)(void);
+# endif
+# ifndef _XtintrinsicP_h
+# include <X11/Xfuncproto.h> /* for NeedFunctionPrototypes */
+extern void XtProcessLock(
+# if NeedFunctionPrototypes
+ void
+# endif
+);
+extern void XtProcessUnlock(
+# if NeedFunctionPrototypes
+ void
+# endif
+);
+# endif
+# ifndef _Xos_isThreadInitialized
+# define _Xos_isThreadInitialized _XtProcessLock
+# endif
+# ifndef _Xos_processLock
+# define _Xos_processLock XtProcessLock()
+# endif
+# ifndef _Xos_processUnlock
+# define _Xos_processUnlock XtProcessUnlock()
+# endif
+# elif defined(XOS_USE_NO_LOCKING)
+# ifndef _Xos_isThreadInitialized
+# define _Xos_isThreadInitialized 0
+# endif
+# ifndef _Xos_processLock
+# define _Xos_processLock 0
+# endif
+# ifndef _Xos_processUnlock
+# define _Xos_processUnlock 0
+# endif
+# endif
+
+#endif /* !defined WIN32 */
+
+/*
+ * Solaris defines the POSIX thread-safe feature test macro, but
+ * uses the older SVR4 thread-safe functions unless the POSIX ones
+ * are specifically requested. Fix the feature test macro.
+ */
+#if defined(sun) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && \
+ (_POSIX_C_SOURCE - 0 < 199506L) && !defined(_POSIX_PTHREAD_SEMANTICS)
+# undef _POSIX_THREAD_SAFE_FUNCTIONS
+#endif
+
+/*
+ * LynxOS 3.1 defines _POSIX_THREAD_SAFE_FUNCTIONS but
+ * getpwuid_r has different semantics than defined by POSIX
+ */
+#if defined(Lynx) && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
+# undef _POSIX_THREAD_SAFE_FUNCTIONS
+#endif
+
+
+/***** <pwd.h> wrappers *****/
+
+/*
+ * Effective prototypes for <pwd.h> wrappers:
+ *
+ * #define X_INCLUDE_PWD_H
+ * #define XOS_USE_..._LOCKING
+ * #include <X11/Xos_r.h>
+ *
+ * typedef ... _Xgetpwparams;
+ *
+ * struct passwd* _XGetpwnam(const char *name, _Xgetpwparams);
+ * struct passwd* _XGetpwuid(uid_t uid, _Xgetpwparams);
+ */
+
+#if defined(X_INCLUDE_PWD_H) && !defined(_XOS_INCLUDED_PWD_H)
+# include <pwd.h>
+# if defined(XUSE_MTSAFE_API) || defined(XUSE_MTSAFE_PWDAPI)
+# define XOS_USE_MTSAFE_PWDAPI 1
+# endif
+#endif
+
+#undef X_NEEDS_PWPARAMS
+#if !defined(X_INCLUDE_PWD_H) || defined(_XOS_INCLUDED_PWD_H)
+/* Do nothing */
+
+#elif !defined(XTHREADS) && !defined(X_FORCE_USE_MTSAFE_API)
+/* Use regular, unsafe API. */
+# if defined(X_NOT_POSIX) && !defined(__i386__) && !defined(SYSV)
+extern struct passwd *getpwuid(), *getpwnam();
+# endif
+typedef int _Xgetpwparams; /* dummy */
+# define _XGetpwuid(u,p) getpwuid((u))
+# define _XGetpwnam(u,p) getpwnam((u))
+
+#elif !defined(XOS_USE_MTSAFE_PWDAPI) || defined(XNO_MTSAFE_PWDAPI)
+/* UnixWare 2.0, or other systems with thread support but no _r API. */
+# define X_NEEDS_PWPARAMS
+typedef struct {
+ struct passwd pws;
+ char pwbuf[1024];
+ struct passwd* pwp;
+ size_t len;
+} _Xgetpwparams;
+
+/*
+ * NetBSD and FreeBSD, at least, are missing several of the unixware passwd
+ * fields.
+ */
+
+#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || \
+ defined(__APPLE__) || defined(__DragonFly__)
+static __inline__ void _Xpw_copyPasswd(_Xgetpwparams p)
+{
+ memcpy(&(p).pws, (p).pwp, sizeof(struct passwd));
+
+ (p).pws.pw_name = (p).pwbuf;
+ (p).len = strlen((p).pwp->pw_name);
+ strcpy((p).pws.pw_name, (p).pwp->pw_name);
+
+ (p).pws.pw_passwd = (p).pws.pw_name + (p).len + 1;
+ (p).len = strlen((p).pwp->pw_passwd);
+ strcpy((p).pws.pw_passwd,(p).pwp->pw_passwd);
+
+ (p).pws.pw_class = (p).pws.pw_passwd + (p).len + 1;
+ (p).len = strlen((p).pwp->pw_class);
+ strcpy((p).pws.pw_class, (p).pwp->pw_class);
+
+ (p).pws.pw_gecos = (p).pws.pw_class + (p).len + 1;
+ (p).len = strlen((p).pwp->pw_gecos);
+ strcpy((p).pws.pw_gecos, (p).pwp->pw_gecos);
+
+ (p).pws.pw_dir = (p).pws.pw_gecos + (p).len + 1;
+ (p).len = strlen((p).pwp->pw_dir);
+ strcpy((p).pws.pw_dir, (p).pwp->pw_dir);
+
+ (p).pws.pw_shell = (p).pws.pw_dir + (p).len + 1;
+ (p).len = strlen((p).pwp->pw_shell);
+ strcpy((p).pws.pw_shell, (p).pwp->pw_shell);
+
+ (p).pwp = &(p).pws;
+}
+
+#else
+# define _Xpw_copyPasswd(p) \
+ (memcpy(&(p).pws, (p).pwp, sizeof(struct passwd)), \
+ ((p).pws.pw_name = (p).pwbuf), \
+ ((p).len = strlen((p).pwp->pw_name)), \
+ strcpy((p).pws.pw_name, (p).pwp->pw_name), \
+ ((p).pws.pw_passwd = (p).pws.pw_name + (p).len + 1), \
+ ((p).len = strlen((p).pwp->pw_passwd)), \
+ strcpy((p).pws.pw_passwd,(p).pwp->pw_passwd), \
+ ((p).pws.pw_age = (p).pws.pw_passwd + (p).len + 1), \
+ ((p).len = strlen((p).pwp->pw_age)), \
+ strcpy((p).pws.pw_age, (p).pwp->pw_age), \
+ ((p).pws.pw_comment = (p).pws.pw_age + (p).len + 1), \
+ ((p).len = strlen((p).pwp->pw_comment)), \
+ strcpy((p).pws.pw_comment, (p).pwp->pw_comment), \
+ ((p).pws.pw_gecos = (p).pws.pw_comment + (p).len + 1), \
+ ((p).len = strlen((p).pwp->pw_gecos)), \
+ strcpy((p).pws.pw_gecos, (p).pwp->pw_gecos), \
+ ((p).pws.pw_dir = (p).pws.pw_comment + (p).len + 1), \
+ ((p).len = strlen((p).pwp->pw_dir)), \
+ strcpy((p).pws.pw_dir, (p).pwp->pw_dir), \
+ ((p).pws.pw_shell = (p).pws.pw_dir + (p).len + 1), \
+ ((p).len = strlen((p).pwp->pw_shell)), \
+ strcpy((p).pws.pw_shell, (p).pwp->pw_shell), \
+ ((p).pwp = &(p).pws), \
+ 0 )
+#endif
+# define _XGetpwuid(u,p) \
+( (_Xos_processLock), \
+ (((p).pwp = getpwuid((u))) ? _Xpw_copyPasswd(p), 0 : 0), \
+ (_Xos_processUnlock), \
+ (p).pwp )
+# define _XGetpwnam(u,p) \
+( (_Xos_processLock), \
+ (((p).pwp = getpwnam((u))) ? _Xpw_copyPasswd(p), 0 : 0), \
+ (_Xos_processUnlock), \
+ (p).pwp )
+
+#elif !defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(__APPLE__)
+/* SVR4 threads, AIX 4.2.0 and earlier and OSF/1 3.2 and earlier pthreads */
+# define X_NEEDS_PWPARAMS
+typedef struct {
+ struct passwd pws;
+ char pwbuf[X_LINE_MAX];
+} _Xgetpwparams;
+# if defined(_POSIX_REENTRANT_FUNCTIONS) || !defined(SVR4) || defined(Lynx)
+# ifndef Lynx
+# define _XGetpwuid(u,p) \
+((getpwuid_r((u),&(p).pws,(p).pwbuf,sizeof((p).pwbuf)) == -1) ? NULL : &(p).pws)
+# define _XGetpwnam(u,p) \
+((getpwnam_r((u),&(p).pws,(p).pwbuf,sizeof((p).pwbuf)) == -1) ? NULL : &(p).pws)
+# else /* Lynx */
+# define _XGetpwuid(u,p) \
+((getpwuid_r(&(p).pws,(u),(p).pwbuf,sizeof((p).pwbuf)) == -1) ? NULL : &(p).pws)
+# define _XGetpwnam(u,p) \
+((getpwnam_r(&(p).pws,(u),(p).pwbuf,sizeof((p).pwbuf)) == -1) ? NULL : &(p).pws)
+# endif
+# else /* SVR4 */
+# define _XGetpwuid(u,p) \
+((getpwuid_r((u),&(p).pws,(p).pwbuf,sizeof((p).pwbuf)) == NULL) ? NULL : &(p).pws)
+# define _XGetpwnam(u,p) \
+((getpwnam_r((u),&(p).pws,(p).pwbuf,sizeof((p).pwbuf)) == NULL) ? NULL : &(p).pws)
+# endif /* SVR4 */
+
+#else /* _POSIX_THREAD_SAFE_FUNCTIONS */
+/* Digital UNIX 4.0, but not (beta) T4.0-1 */
+# if defined(__osf__)
+/* OSF/1 V4.0 <pwd.h> doesn't declare the _P routines, breaking under C++. */
+extern int _Pgetpwuid_r(uid_t, struct passwd *, char *, size_t, struct passwd **);
+extern int _Pgetpwnam_r(const char *, struct passwd *, char *, size_t, struct passwd **);
+# endif
+# define X_NEEDS_PWPARAMS
+typedef struct {
+ struct passwd pws;
+ char pwbuf[X_LINE_MAX];
+ struct passwd* pwp;
+} _Xgetpwparams;
+typedef int _Xgetpwret;
+# define _XGetpwuid(u,p) \
+((getpwuid_r((u),&(p).pws,(p).pwbuf,sizeof((p).pwbuf),&(p).pwp) == 0) ? \
+ (p).pwp : NULL)
+# define _XGetpwnam(u,p) \
+((getpwnam_r((u),&(p).pws,(p).pwbuf,sizeof((p).pwbuf),&(p).pwp) == 0) ? \
+ (p).pwp : NULL)
+#endif /* X_INCLUDE_PWD_H */
+
+#if defined(X_INCLUDE_PWD_H) && !defined(_XOS_INCLUDED_PWD_H)
+# define _XOS_INCLUDED_PWD_H
+#endif
+
+
+/***** <netdb.h> wrappers *****/
+
+/*
+ * Effective prototypes for <netdb.h> wrappers:
+ *
+ * NOTE: On systems lacking the appropriate _r functions Gethostbyname(),
+ * Gethostbyaddr(), and Getservbyname() do NOT copy the host or
+ * protocol lists!
+ *
+ * #define X_INCLUDE_NETDB_H
+ * #define XOS_USE_..._LOCKING
+ * #include <X11/Xos_r.h>
+ *
+ * typedef ... _Xgethostbynameparams;
+ * typedef ... _Xgetservbynameparams;
+ *
+ * struct hostent* _XGethostbyname(const char* name,_Xgethostbynameparams);
+ * struct hostent* _XGethostbyaddr(const char* addr, int len, int type,
+ * _Xgethostbynameparams);
+ * struct servent* _XGetservbyname(const char* name, const char* proto,
+ * _Xgetservbynameparams);
+ */
+
+#undef XTHREADS_NEEDS_BYNAMEPARAMS
+#if defined(X_INCLUDE_NETDB_H) && !defined(_XOS_INCLUDED_NETDB_H) \
+ && !defined(WIN32)
+# include <netdb.h>
+# if defined(XUSE_MTSAFE_API) || defined(XUSE_MTSAFE_NETDBAPI)
+# define XOS_USE_MTSAFE_NETDBAPI 1
+# endif
+#endif
+
+#if !defined(X_INCLUDE_NETDB_H) || defined(_XOS_INCLUDED_NETDB_H)
+/* Do nothing. */
+
+#elif !defined(XTHREADS) && !defined(X_FORCE_USE_MTSAFE_API)
+/* Use regular, unsafe API. */
+typedef int _Xgethostbynameparams; /* dummy */
+typedef int _Xgetservbynameparams; /* dummy */
+# define _XGethostbyname(h,hp) gethostbyname((h))
+# define _XGethostbyaddr(a,al,t,hp) gethostbyaddr((a),(al),(t))
+# define _XGetservbyname(s,p,sp) getservbyname((s),(p))
+
+#elif !defined(XOS_USE_MTSAFE_NETDBAPI) || defined(XNO_MTSAFE_NETDBAPI)
+/* UnixWare 2.0, or other systems with thread support but no _r API. */
+/* WARNING: The h_addr_list and s_aliases values are *not* copied! */
+
+#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
+#include <sys/param.h>
+#endif
+
+typedef struct {
+ struct hostent hent;
+ char h_name[MAXHOSTNAMELEN];
+ struct hostent *hptr;
+} _Xgethostbynameparams;
+typedef struct {
+ struct servent sent;
+ char s_name[255];
+ char s_proto[255];
+ struct servent *sptr;
+} _Xgetservbynameparams;
+
+# define XTHREADS_NEEDS_BYNAMEPARAMS
+
+# define _Xg_copyHostent(hp) \
+ (memcpy(&(hp).hent, (hp).hptr, sizeof(struct hostent)), \
+ strcpy((hp).h_name, (hp).hptr->h_name), \
+ ((hp).hent.h_name = (hp).h_name), \
+ ((hp).hptr = &(hp).hent), \
+ 0 )
+# define _Xg_copyServent(sp) \
+ (memcpy(&(sp).sent, (sp).sptr, sizeof(struct servent)), \
+ strcpy((sp).s_name, (sp).sptr->s_name), \
+ ((sp).sent.s_name = (sp).s_name), \
+ strcpy((sp).s_proto, (sp).sptr->s_proto), \
+ ((sp).sent.s_proto = (sp).s_proto), \
+ ((sp).sptr = &(sp).sent), \
+ 0 )
+# define _XGethostbyname(h,hp) \
+ ((_Xos_processLock), \
+ (((hp).hptr = gethostbyname((h))) ? _Xg_copyHostent(hp) : 0), \
+ (_Xos_processUnlock), \
+ (hp).hptr )
+# define _XGethostbyaddr(a,al,t,hp) \
+ ((_Xos_processLock), \
+ (((hp).hptr = gethostbyaddr((a),(al),(t))) ? _Xg_copyHostent(hp) : 0), \
+ (_Xos_processUnlock), \
+ (hp).hptr )
+# define _XGetservbyname(s,p,sp) \
+ ((_Xos_processLock), \
+ (((sp).sptr = getservbyname((s),(p))) ? _Xg_copyServent(sp) : 0), \
+ (_Xos_processUnlock), \
+ (sp).sptr )
+
+#elif defined(XUSE_NETDB_R_API)
+/*
+ * POSIX does not specify _r equivalents for <netdb.h> API, but some
+ * vendors provide them anyway. Use them only when explicitly asked.
+ */
+# ifdef _POSIX_REENTRANT_FUNCTIONS
+# ifndef _POSIX_THREAD_SAFE_FUNCTIONS
+# if defined(AIXV3) || defined(AIXV4) || defined(__osf__)
+# define X_POSIX_THREAD_SAFE_FUNCTIONS 1
+# endif
+# endif
+# endif
+# ifdef _POSIX_THREAD_SAFE_FUNCTIONS
+# define X_POSIX_THREAD_SAFE_FUNCTIONS 1
+# endif
+
+# define XTHREADS_NEEDS_BYNAMEPARAMS
+
+# ifndef X_POSIX_THREAD_SAFE_FUNCTIONS
+typedef struct {
+ struct hostent hent;
+ char hbuf[X_LINE_MAX];
+ int herr;
+} _Xgethostbynameparams;
+typedef struct {
+ struct servent sent;
+ char sbuf[X_LINE_MAX];
+} _Xgetservbynameparams;
+# define _XGethostbyname(h,hp) \
+ gethostbyname_r((h),&(hp).hent,(hp).hbuf,sizeof((hp).hbuf),&(hp).herr)
+# define _XGethostbyaddr(a,al,t,hp) \
+ gethostbyaddr_r((a),(al),(t),&(hp).hent,(hp).hbuf,sizeof((hp).hbuf),&(hp).herr)
+# define _XGetservbyname(s,p,sp) \
+ getservbyname_r((s),(p),&(sp).sent,(sp).sbuf,sizeof((sp).sbuf))
+# else
+typedef struct {
+ struct hostent hent;
+ struct hostent_data hdata;
+} _Xgethostbynameparams;
+typedef struct {
+ struct servent sent;
+ struct servent_data sdata;
+} _Xgetservbynameparams;
+# define _XGethostbyname(h,hp) \
+ (bzero((char*)&(hp).hdata,sizeof((hp).hdata)), \
+ ((gethostbyname_r((h),&(hp).hent,&(hp).hdata) == -1) ? NULL : &(hp).hent))
+# define _XGethostbyaddr(a,al,t,hp) \
+ (bzero((char*)&(hp).hdata,sizeof((hp).hdata)), \
+ ((gethostbyaddr_r((a),(al),(t),&(hp).hent,&(hp).hdata) == -1) ? NULL : &(hp).hent))
+# define _XGetservbyname(s,p,sp) \
+ (bzero((char*)&(sp).sdata,sizeof((sp).sdata)), \
+ ((getservbyname_r((s),(p),&(sp).sent,&(sp).sdata) == -1) ? NULL : &(sp).sent) )
+# endif
+# ifdef X_POSIX_THREAD_SAFE_FUNCTIONS
+# undef X_POSIX_THREAD_SAFE_FUNCTIONS
+# endif
+
+#else
+/* The regular API is assumed to be MT-safe under POSIX. */
+typedef int _Xgethostbynameparams; /* dummy */
+typedef int _Xgetservbynameparams; /* dummy */
+# define _XGethostbyname(h,hp) gethostbyname((h))
+# define _XGethostbyaddr(a,al,t,hp) gethostbyaddr((a),(al),(t))
+# define _XGetservbyname(s,p,sp) getservbyname((s),(p))
+#endif /* X_INCLUDE_NETDB_H */
+
+#if defined(X_INCLUDE_NETDB_H) && !defined(_XOS_INCLUDED_NETDB_H)
+# define _XOS_INCLUDED_NETDB_H
+#endif
+
+
+/***** <dirent.h> wrappers *****/
+
+/*
+ * Effective prototypes for <dirent.h> wrappers:
+ *
+ * #define X_INCLUDE_DIRENT_H
+ * #define XOS_USE_..._LOCKING
+ * #include <X11/Xos_r.h>
+ *
+ * typedef ... _Xreaddirparams;
+ *
+ * struct dirent *_XReaddir(DIR *dir_pointer, _Xreaddirparams);
+ */
+
+#if defined(X_INCLUDE_DIRENT_H) && !defined(_XOS_INCLUDED_DIRENT_H)
+# include <sys/types.h>
+# if !defined(X_NOT_POSIX) || defined(SYSV) || defined(USG)
+# include <dirent.h>
+# else
+# include <sys/dir.h>
+# ifndef dirent
+# define dirent direct
+# endif
+# endif
+# if defined(XUSE_MTSAFE_API) || defined(XUSE_MTSAFE_DIRENTAPI)
+# define XOS_USE_MTSAFE_DIRENTAPI 1
+# endif
+#endif
+
+#if !defined(X_INCLUDE_DIRENT_H) || defined(_XOS_INCLUDED_DIRENT_H)
+/* Do nothing. */
+
+#elif !defined(XTHREADS) && !defined(X_FORCE_USE_MTSAFE_API)
+/* Use regular, unsafe API. */
+typedef int _Xreaddirparams; /* dummy */
+# define _XReaddir(d,p) readdir(d)
+
+#elif !defined(XOS_USE_MTSAFE_DIRENTAPI) || defined(XNO_MTSAFE_DIRENTAPI)
+/* Systems with thread support but no _r API. */
+typedef struct {
+ struct dirent *result;
+ struct dirent dir_entry;
+# ifdef _POSIX_PATH_MAX
+ char buf[_POSIX_PATH_MAX];
+# elif defined(NAME_MAX)
+ char buf[NAME_MAX];
+# else
+ char buf[255];
+# endif
+} _Xreaddirparams;
+
+# define _XReaddir(d,p) \
+ ( (_Xos_processLock), \
+ (((p).result = readdir((d))) ? \
+ (memcpy(&((p).dir_entry), (p).result, (p).result->d_reclen), \
+ ((p).result = &(p).dir_entry), 0) : \
+ 0), \
+ (_Xos_processUnlock), \
+ (p).result )
+
+#else
+typedef struct {
+ struct dirent *result;
+ struct dirent dir_entry;
+# ifdef _POSIX_PATH_MAX
+ char buf[_POSIX_PATH_MAX];
+# elif defined(NAME_MAX)
+ char buf[NAME_MAX];
+# else
+ char buf[255];
+# endif
+} _Xreaddirparams;
+
+# if defined(_POSIX_THREAD_SAFE_FUNCTIONS) || defined(AIXV3) || \
+ defined(AIXV4) || defined(__APPLE__)
+/* AIX defines the draft POSIX symbol, but uses the final API. */
+/* POSIX final API, returns (int)0 on success. */
+# if defined(__osf__)
+/* OSF/1 V4.0 <dirent.h> doesn't declare _Preaddir_r, breaking under C++. */
+extern int _Preaddir_r(DIR *, struct dirent *, struct dirent **);
+# endif
+# define _XReaddir(d,p) \
+ (readdir_r((d), &((p).dir_entry), &((p).result)) ? NULL : (p).result)
+# elif defined(_POSIX_REENTRANT_FUNCTIONS) && defined(__osf__)
+/*
+ * OSF/1 V3.2 readdir_r() will SEGV if the main program is not
+ * explicitly linked with -lc_r. The library REQUIREDLIBS don't help.
+ * Assume that if threads have been initialized we're linked properly.
+ */
+# define _XReaddir(d,p) \
+ ( (_Xos_isThreadInitialized) ? \
+ (readdir_r((d), &((p).dir_entry)) ? NULL : &((p).dir_entry)) : \
+ ((_Xos_processLock), \
+ (((p).result = readdir((d))) ? \
+ (memcpy(&((p).dir_entry), (p).result, (p).result->d_reclen), \
+ ((p).result = &(p).dir_entry), 0) : \
+ 0), \
+ (_Xos_processUnlock), \
+ (p).result) )
+# elif defined(_POSIX_REENTRANT_FUNCTIONS)
+/* POSIX draft API, returns (int)0 on success. */
+# define _XReaddir(d,p) \
+ (readdir_r((d),&((p).dir_entry)) ? NULL : &((p).dir_entry))
+# elif defined(SVR4)
+/* Pre-POSIX API, returns non-NULL on success. */
+# define _XReaddir(d,p) (readdir_r((d), &(p).dir_entry))
+# else
+/* We have no idea what is going on. Fake it all using process locks. */
+# define _XReaddir(d,p) \
+ ( (_Xos_processLock), \
+ (((p).result = readdir((d))) ? \
+ (memcpy(&((p).dir_entry), (p).result, (p).result->d_reclen), \
+ ((p).result = &(p).dir_entry), 0) : \
+ 0), \
+ (_Xos_processUnlock), \
+ (p).result )
+# endif
+#endif /* X_INCLUDE_DIRENT_H */
+
+#if defined(X_INCLUDE_DIRENT_H) && !defined(_XOS_INCLUDED_DIRENT_H)
+# define _XOS_INCLUDED_DIRENT_H
+#endif
+
+
+/***** <unistd.h> wrappers *****/
+
+/*
+ * Effective prototypes for <unistd.h> wrappers:
+ *
+ * #define X_INCLUDE_UNISTD_H
+ * #define XOS_USE_..._LOCKING
+ * #include <X11/Xos_r.h>
+ *
+ * typedef ... _Xgetloginparams;
+ * typedef ... _Xttynameparams;
+ *
+ * char *_XGetlogin(_Xgetloginparams);
+ * char *_XTtyname(int, _Xttynameparams);
+ */
+
+#if defined(X_INCLUDE_UNISTD_H) && !defined(_XOS_INCLUDED_UNISTD_H)
+/* <unistd.h> already included by <X11/Xos.h> */
+# if defined(XUSE_MTSAFE_API) || defined(XUSE_MTSAFE_UNISTDAPI)
+# define XOS_USE_MTSAFE_UNISTDAPI 1
+# endif
+#endif
+
+#if !defined(X_INCLUDE_UNISTD_H) || defined(_XOS_INCLUDED_UNISTD_H)
+/* Do nothing. */
+
+#elif !defined(XTHREADS) && !defined(X_FORCE_USE_MTSAFE_API)
+/* Use regular, unsafe API. */
+typedef int _Xgetloginparams; /* dummy */
+typedef int _Xttynameparams; /* dummy */
+# define _XGetlogin(p) getlogin()
+# define _XTtyname(f) ttyname((f))
+
+#elif !defined(XOS_USE_MTSAFE_UNISTDAPI) || defined(XNO_MTSAFE_UNISTDAPI)
+/* Systems with thread support but no _r API. */
+typedef struct {
+ char *result;
+# if defined(MAXLOGNAME)
+ char buf[MAXLOGNAME];
+# elif defined(LOGIN_NAME_MAX)
+ char buf[LOGIN_NAME_MAX];
+# else
+ char buf[64];
+# endif
+} _Xgetloginparams;
+typedef struct {
+ char *result;
+# ifdef TTY_NAME_MAX
+ char buf[TTY_NAME_MAX];
+# elif defined(_POSIX_TTY_NAME_MAX)
+ char buf[_POSIX_TTY_NAME_MAX];
+# elif defined(_POSIX_PATH_MAX)
+ char buf[_POSIX_PATH_MAX];
+# else
+ char buf[256];
+# endif
+} _Xttynameparams;
+
+# define _XGetlogin(p) \
+ ( (_Xos_processLock), \
+ (((p).result = getlogin()) ? \
+ (strncpy((p).buf, (p).result, sizeof((p).buf)), \
+ ((p).buf[sizeof((p).buf)-1] = '\0'), \
+ ((p).result = (p).buf), 0) : 0), \
+ (_Xos_processUnlock), \
+ (p).result )
+#define _XTtyname(f,p) \
+ ( (_Xos_processLock), \
+ (((p).result = ttyname(f)) ? \
+ (strncpy((p).buf, (p).result, sizeof((p).buf)), \
+ ((p).buf[sizeof((p).buf)-1] = '\0'), \
+ ((p).result = (p).buf), 0) : 0), \
+ (_Xos_processUnlock), \
+ (p).result )
+
+#elif defined(_POSIX_THREAD_SAFE_FUNCTIONS) || defined(_POSIX_REENTRANT_FUNCTIONS)
+/* POSIX API.
+ *
+ * extern int getlogin_r(char *, size_t);
+ * extern int ttyname_r(int, char *, size_t);
+ */
+typedef struct {
+# if defined(MAXLOGNAME)
+ char buf[MAXLOGNAME];
+# elif defined(LOGIN_NAME_MAX)
+ char buf[LOGIN_NAME_MAX];
+# else
+ char buf[64];
+# endif
+} _Xgetloginparams;
+typedef struct {
+# ifdef TTY_NAME_MAX
+ char buf[TTY_NAME_MAX];
+# elif defined(_POSIX_TTY_NAME_MAX)
+ char buf[_POSIX_TTY_NAME_MAX];
+# elif defined(_POSIX_PATH_MAX)
+ char buf[_POSIX_PATH_MAX];
+# else
+ char buf[256];
+# endif
+} _Xttynameparams;
+
+# define _XGetlogin(p) (getlogin_r((p).buf, sizeof((p).buf)) ? NULL : (p).buf)
+# define _XTtyname(f,p) \
+ (ttyname_r((f), (p).buf, sizeof((p).buf)) ? NULL : (p).buf)
+
+#else
+/* Pre-POSIX API.
+ *
+ * extern char *getlogin_r(char *, size_t);
+ * extern char *ttyname_r(int, char *, size_t);
+ */
+typedef struct {
+# if defined(MAXLOGNAME)
+ char buf[MAXLOGNAME];
+# elif defined(LOGIN_NAME_MAX)
+ char buf[LOGIN_NAME_MAX];
+# else
+ char buf[64];
+# endif
+} _Xgetloginparams;
+typedef struct {
+# ifdef TTY_NAME_MAX
+ char buf[TTY_NAME_MAX];
+# elif defined(_POSIX_TTY_NAME_MAX)
+ char buf[_POSIX_TTY_NAME_MAX];
+# elif defined(_POSIX_PATH_MAX)
+ char buf[_POSIX_PATH_MAX];
+# else
+ char buf[256];
+# endif
+} _Xttynameparams;
+
+# define _XGetlogin(p) getlogin_r((p).buf, sizeof((p).buf))
+# define _XTtyname(f,p) ttyname_r((f), (p).buf, sizeof((p).buf))
+#endif /* X_INCLUDE_UNISTD_H */
+
+#if defined(X_INCLUDE_UNISTD_H) && !defined(_XOS_INCLUDED_UNISTD_H)
+# define _XOS_INCLUDED_UNISTD_H
+#endif
+
+
+/***** <string.h> wrappers *****/
+
+/*
+ * Effective prototypes for <string.h> wrappers:
+ *
+ * #define X_INCLUDE_STRING_H
+ * #define XOS_USE_..._LOCKING
+ * #include <X11/Xos_r.h>
+ *
+ * typedef ... _Xstrtokparams;
+ *
+ * char *_XStrtok(char *, const char*, _Xstrtokparams);
+ */
+
+#if defined(X_INCLUDE_STRING_H) && !defined(_XOS_INCLUDED_STRING_H)
+/* <string.h> has already been included by <X11/Xos.h> */
+# if defined(XUSE_MTSAFE_API) || defined(XUSE_MTSAFE_STRINGAPI)
+# define XOS_USE_MTSAFE_STRINGAPI 1
+# endif
+#endif
+
+#if !defined(X_INCLUDE_STRING_H) || defined(_XOS_INCLUDED_STRING_H)
+/* Do nothing. */
+
+#elif !defined(XTHREADS) && !defined(X_FORCE_USE_MTSAFE_API)
+/* Use regular, unsafe API. */
+typedef int _Xstrtokparams; /* dummy */
+# define _XStrtok(s1,s2,p) \
+ ( p = 0, (void)p, strtok((s1),(s2)) )
+
+#elif !defined(XOS_USE_MTSAFE_STRINGAPI) || defined(XNO_MTSAFE_STRINGAPI)
+/* Systems with thread support but no _r API. */
+typedef char *_Xstrtokparams;
+# define _XStrtok(s1,s2,p) \
+ ( (_Xos_processLock), \
+ ((p) = strtok((s1),(s2))), \
+ (_Xos_processUnlock), \
+ (p) )
+
+#else
+/* POSIX or pre-POSIX API. */
+typedef char * _Xstrtokparams;
+# define _XStrtok(s1,s2,p) strtok_r((s1),(s2),&(p))
+#endif /* X_INCLUDE_STRING_H */
+
+
+/***** <time.h> wrappers *****/
+
+/*
+ * Effective prototypes for <time.h> wrappers:
+ *
+ * #define X_INCLUDE_TIME_H
+ * #define XOS_USE_..._LOCKING
+ * #include <X11/Xos_r.h>
+ *
+ * typedef ... _Xatimeparams;
+ * typedef ... _Xctimeparams;
+ * typedef ... _Xgtimeparams;
+ * typedef ... _Xltimeparams;
+ *
+ * char *_XAsctime(const struct tm *, _Xatimeparams);
+ * char *_XCtime(const time_t *, _Xctimeparams);
+ * struct tm *_XGmtime(const time_t *, _Xgtimeparams);
+ * struct tm *_XLocaltime(const time_t *, _Xltimeparams);
+ */
+
+#if defined(X_INCLUDE_TIME_H) && !defined(_XOS_INCLUDED_TIME_H)
+# include <time.h>
+# if defined(XUSE_MTSAFE_API) || defined(XUSE_MTSAFE_TIMEAPI)
+# define XOS_USE_MTSAFE_TIMEAPI 1
+# endif
+#endif
+
+#if !defined(X_INCLUDE_TIME_H) || defined(_XOS_INCLUDED_TIME_H)
+/* Do nothing. */
+
+#elif !defined(XTHREADS) && !defined(X_FORCE_USE_MTSAFE_API)
+/* Use regular, unsafe API. */
+typedef int _Xatimeparams; /* dummy */
+# define _XAsctime(t,p) asctime((t))
+typedef int _Xctimeparams; /* dummy */
+# define _XCtime(t,p) ctime((t))
+typedef int _Xgtimeparams; /* dummy */
+# define _XGmtime(t,p) gmtime((t))
+typedef int _Xltimeparams; /* dummy */
+# define _XLocaltime(t,p) localtime((t))
+
+#elif !defined(XOS_USE_MTSAFE_TIMEAPI) || defined(XNO_MTSAFE_TIMEAPI)
+/* Systems with thread support but no _r API. */
+typedef struct {
+# ifdef TIMELEN
+ char buf[TIMELEN];
+# else
+ char buf[26];
+# endif
+ char *result;
+} _Xctimeparams, _Xatimeparams;
+typedef struct {
+ struct tm buf;
+ struct tm *result;
+} _Xgtimeparams, _Xltimeparams;
+# define _XAsctime(t,p) \
+ ( (_Xos_processLock), \
+ (((p).result = asctime((t))) ? \
+ (strncpy((p).buf, (p).result, sizeof((p).buf)), (p).result = &(p).buf) : \
+ 0), \
+ (_Xos_processUnlock), \
+ (p).result )
+# define _XCtime(t,p) \
+ ( (_Xos_processLock), \
+ (((p).result = ctime((t))) ? \
+ (strncpy((p).buf, (p).result, sizeof((p).buf)), (p).result = &(p).buf) : \
+ 0), \
+ (_Xos_processUnlock), \
+ (p).result )
+# define _XGmtime(t,p) \
+ ( (_Xos_processLock), \
+ (((p).result = gmtime(t)) ? \
+ (memcpy(&(p).buf, (p).result, sizeof((p).buf)), (p).result = &(p).buf) : \
+ 0), \
+ (_Xos_processUnlock), \
+ (p).result )
+# define _XLocaltime(t,p) \
+ ( (_Xos_processLock), \
+ (((p).result = localtime(t)) ? \
+ (memcpy(&(p).buf, (p).result, sizeof((p).buf)), (p).result = &(p).buf) : \
+ 0), \
+ (_Xos_processUnlock), \
+ (p).result )
+
+#elif !defined(_POSIX_THREAD_SAFE_FUNCTIONS) && (defined(__osf__) || defined(hpV4))
+/* Returns (int)0 on success. OSF/1 v3.2, HP/UX 10
+ *
+ * extern int asctime_r(const struct tm *timeptr, char *buffer, int buflen);
+ * extern int ctime_r(const time_t *timer, char *buffer, int buflen);
+ * extern int gmtime_r(const time_t *timer, struct tm *result);
+ * extern int localtime_r(const time_t *timer, struct tm *result);
+ */
+# ifdef TIMELEN
+typedef char _Xatimeparams[TIMELEN];
+typedef char _Xctimeparams[TIMELEN];
+# else
+typedef char _Xatimeparams[26];
+typedef char _Xctimeparams[26];
+# endif
+typedef struct tm _Xgtimeparams;
+typedef struct tm _Xltimeparams;
+# define _XAsctime(t,p) (asctime_r((t),(p),sizeof((p))) ? NULL : (p))
+# define _XCtime(t,p) (ctime_r((t),(p),sizeof((p))) ? NULL : (p))
+# define _XGmtime(t,p) (gmtime_r((t),&(p)) ? NULL : &(p))
+# define _XLocaltime(t,p) (localtime_r((t),&(p)) ? NULL : &(p))
+
+#elif !defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(sun)
+/* Returns NULL on failure. Solaris 2.5
+ *
+ * extern char *asctime_r(const struct tm *tm,char *buf, int buflen);
+ * extern char *ctime_r(const time_t *clock, char *buf, int buflen);
+ * extern struct tm *gmtime_r(const time_t *clock, struct tm *res);
+ * extern struct tm *localtime_r(const time_t *clock, struct tm *res);
+ */
+# ifdef TIMELEN
+typedef char _Xatimeparams[TIMELEN];
+typedef char _Xctimeparams[TIMELEN];
+# else
+typedef char _Xatimeparams[26];
+typedef char _Xctimeparams[26];
+# endif
+typedef struct tm _Xgtimeparams;
+typedef struct tm _Xltimeparams;
+# define _XAsctime(t,p) asctime_r((t),(p),sizeof((p)))
+# define _XCtime(t,p) ctime_r((t),(p),sizeof((p)))
+# define _XGmtime(t,p) gmtime_r((t),&(p))
+# define _XLocaltime(t,p) localtime_r((t),&(p))
+
+#else /* defined(_POSIX_THREAD_SAFE_FUNCTIONS) */
+/* POSIX final API. OSF/1 v4.0, AIX, etc.
+ *
+ * extern char *asctime_r(const struct tm *timeptr, char *buffer);
+ * extern char *ctime_r(const time_t *timer, char *buffer);
+ * extern struct tm *gmtime_r(const time_t *timer, struct tm *result);
+ * extern struct tm *localtime_r(const time_t *timer, struct tm *result);
+ */
+# if defined(__osf__)
+/* OSF/1 V4.0 <time.h> doesn't declare the _P routines, breaking under C++. */
+extern char *_Pasctime_r(const struct tm *, char *);
+extern char *_Pctime_r(const time_t *, char *);
+extern struct tm *_Plocaltime_r(const time_t *, struct tm *);
+# endif
+# ifdef TIMELEN
+typedef char _Xatimeparams[TIMELEN];
+typedef char _Xctimeparams[TIMELEN];
+# else
+typedef char _Xatimeparams[26];
+typedef char _Xctimeparams[26];
+# endif
+typedef struct tm _Xgtimeparams;
+typedef struct tm _Xltimeparams;
+# define _XAsctime(t,p) asctime_r((t),(p))
+# define _XCtime(t,p) ctime_r((t),(p))
+# define _XGmtime(t,p) gmtime_r((t),&(p))
+# define _XLocaltime(t,p) localtime_r((t),&(p))
+#endif /* X_INCLUDE_TIME_H */
+
+#if defined(X_INCLUDE_TIME_H) && !defined(_XOS_INCLUDED_TIME_H)
+# define _XOS_INCLUDED_TIME_H
+#endif
+
+
+/***** <grp.h> wrappers *****/
+
+/*
+ * Effective prototypes for <grp.h> wrappers:
+ *
+ * NOTE: On systems lacking appropriate _r functions Getgrgid() and
+ * Getgrnam() do NOT copy the list of group members!
+ *
+ * Remember that fgetgrent(), setgrent(), getgrent(), and endgrent()
+ * are not included in POSIX.
+ *
+ * #define X_INCLUDE_GRP_H
+ * #define XOS_USE_..._LOCKING
+ * #include <X11/Xos_r.h>
+ *
+ * typedef ... _Xgetgrparams;
+ *
+ * struct group *_XGetgrgid(gid_t, _Xgetgrparams);
+ * struct group *_XGetgrnam(const char *, _Xgetgrparams);
+ */
+
+#if defined(X_INCLUDE_GRP_H) && !defined(_XOS_INCLUDED_GRP_H)
+# include <grp.h>
+# if defined(XUSE_MTSAFE_API) || defined(XUSE_MTSAFE_GRPAPI)
+# define XOS_USE_MTSAFE_GRPAPI 1
+# endif
+#endif
+
+#if !defined(X_INCLUDE_GRP_H) || defined(_XOS_INCLUDED_GRP_H)
+/* Do nothing. */
+
+#elif !defined(XTHREADS) && !defined(X_FORCE_USE_MTSAFE_API)
+/* Use regular, unsafe API. */
+typedef int _Xgetgrparams; /* dummy */
+#define _XGetgrgid(g,p) getgrgid((g))
+#define _XGetgrnam(n,p) getgrnam((n))
+
+#elif !defined(XOS_USE_MTSAFE_GRPAPI) || defined(XNO_MTSAFE_GRPAPI)
+/* Systems with thread support but no _r API. UnixWare 2.0. */
+typedef struct {
+ struct group grp;
+ char buf[X_LINE_MAX]; /* Should be sysconf(_SC_GETGR_R_SIZE_MAX)? */
+ struct group *pgrp;
+ size_t len;
+} _Xgetgrparams;
+#ifdef SVR4
+/* Copy the gr_passwd field too. */
+# define _Xgrp_copyGroup(p) \
+ ( memcpy(&(p).grp, (p).pgrp, sizeof(struct group)), \
+ ((p).grp.gr_name = (p).buf), \
+ ((p).len = strlen((p).pgrp->gr_name)), \
+ strcpy((p).grp.gr_name, (p).pgrp->gr_name), \
+ ((p).grp.gr_passwd = (p).grp.gr_name + (p).len + 1), \
+ ((p).pgrp = &(p).grp), \
+ 0 )
+#else
+# define _Xgrp_copyGroup(p) \
+ ( memcpy(&(p).grp, (p).pgrp, sizeof(struct group)), \
+ ((p).grp.gr_name = (p).buf), \
+ strcpy((p).grp.gr_name, (p).pgrp->gr_name), \
+ ((p).pgrp = &(p).grp), \
+ 0 )
+#endif
+#define _XGetgrgid(g,p) \
+ ( (_Xos_processLock), \
+ (((p).pgrp = getgrgid((g))) ? _Xgrp_copyGroup(p) : 0), \
+ (_Xos_processUnlock), \
+ (p).pgrp )
+#define _XGetgrnam(n,p) \
+ ( (_Xos_processLock), \
+ (((p).pgrp = getgrnam((n))) ? _Xgrp_copyGroup(p) : 0), \
+ (_Xos_processUnlock), \
+ (p).pgrp )
+
+#elif !defined(_POSIX_THREAD_SAFE_FUNCTIONS) && (defined(sun) || defined(__osf__))
+/* Non-POSIX API. Solaris, DEC v3.2.
+ *
+ * extern struct group *getgrgid_r(gid_t, struct group *, char *, int);
+ * extern struct group *getgrnam_r(const char *, struct group *, char *, int);
+ */
+typedef struct {
+ struct group grp;
+ char buf[X_LINE_MAX]; /* Should be sysconf(_SC_GETGR_R_SIZE_MAX)? */
+} _Xgetgrparams;
+#define _XGetgrgid(g,p) getgrgid_r((g), &(p).grp, (p).buf, sizeof((p).buf))
+#define _XGetgrnam(n,p) getgrnam_r((n), &(p).grp, (p).buf, sizeof((p).buf))
+
+#elif !defined(_POSIX_THREAD_SAFE_FUNCTIONS)
+/* Non-POSIX API. HP/UX 10, AIX 4.
+ *
+ * extern int getgrgid_r(gid_t, struct group *, char *, int);
+ * extern int getgrnam_r(const char *, struct group *, char *, int);
+ */
+typedef struct {
+ struct group grp;
+ char buf[X_LINE_MAX]; /* Should be sysconf(_SC_GETGR_R_SIZE_MAX)? */
+} _Xgetgrparams;
+#define _XGetgrgid(g,p) \
+ ((getgrgid_r((g), &(p).grp, (p).buf, sizeof((p).buf)) ? NULL : &(p).grp))
+#define _XGetgrnam(n,p) \
+ ((getgrnam_r((n), &(p).grp, (p).buf, sizeof((p).buf)) ? NULL : &(p).grp))
+
+#else
+/* POSIX final API. DEC v4.0, IRIX 6.2.
+ *
+ * int getgrgid_r(gid_t, struct group *, char *, size_t, struct group **);
+ * int getgrnam_r(const char *, struct group *, char *, size_t, struct group **);
+ */
+# if defined(__osf__)
+/* OSF/1 V4.0 <grp.h> doesn't declare the _P routines, breaking under C++. */
+extern int _Pgetgrgid_r(gid_t, struct group *, char *, size_t, struct group **);
+extern int _Pgetgrnam_r(const char *, struct group *, char *, size_t, struct group **);
+# endif
+typedef struct {
+ struct group grp;
+ char buf[X_LINE_MAX]; /* Should be sysconf(_SC_GETGR_R_SIZE_MAX)? */
+ struct group *result;
+} _Xgetgrparams;
+
+#define _XGetgrgid(g,p) \
+ ((getgrgid_r((g), &(p).grp, (p).buf, sizeof((p).buf), &(p).result) ? \
+ NULL : (p).result))
+#define _XGetgrnam(n,p) \
+ ((getgrnam_r((n), &(p).grp, (p).buf, sizeof((p).buf), &(p).result) ? \
+ NULL : (p).result))
+#endif
+
+#if defined(X_INCLUDE_GRP_H) && !defined(_XOS_INCLUDED_GRP_H)
+# define _XOS_INCLUDED_GRP_H
+#endif
+
+
+#ifdef __cplusplus
+} /* Close scope of 'extern "C"' declaration which encloses file. */
+#endif
diff --git a/lib/gcc/i686-linux/4.4.3/include-fixed/X11/Xosdefs.h b/lib/gcc/i686-linux/4.4.3/include-fixed/X11/Xosdefs.h
new file mode 100644
index 0000000..f63e0d5
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include-fixed/X11/Xosdefs.h
@@ -0,0 +1,175 @@
+/* DO NOT EDIT THIS FILE.
+
+ It has been auto-edited by fixincludes from:
+
+ "/tmp/gcc32/1/i686-linux-glibc2.7-4.4.3/sysroot/usr/include/X11/Xosdefs.h"
+
+ This had to be done to correct non-standard usages in the
+ original, manufacturer supplied header file. */
+
+/*
+ * O/S-dependent (mis)feature macro definitions
+ *
+ * $XdotOrg: xc/include/Xosdefs.h,v 1.3 2005/04/28 22:04:12 alanc Exp $
+ * $Xorg: Xosdefs.h,v 1.5 2001/02/09 02:03:23 xorgcvs Exp $
+ *
+Copyright 1991, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+ */
+/* $XFree86: xc/include/Xosdefs.h,v 3.20 2002/05/31 18:45:39 dawes Exp $ */
+
+#ifndef _XOSDEFS_H_
+#define _XOSDEFS_H_
+
+/*
+ * X_NOT_STDC_ENV means does not have ANSI C header files. Lack of this
+ * symbol does NOT mean that the system has stdarg.h.
+ *
+ * X_NOT_POSIX means does not have POSIX header files. Lack of this
+ * symbol does NOT mean that the POSIX environment is the default.
+ * You may still have to define _POSIX_SOURCE to get it.
+ */
+
+#ifdef NOSTDHDRS
+#define X_NOT_POSIX
+#define X_NOT_STDC_ENV
+#endif
+
+#ifdef sony
+#if !defined(SYSTYPE_SYSV) && !defined(_SYSTYPE_SYSV)
+#define X_NOT_POSIX
+#endif
+#endif
+
+#ifdef UTEK
+#define X_NOT_POSIX
+#define X_NOT_STDC_ENV
+#endif
+
+#ifdef vax
+#ifndef ultrix /* assume vanilla BSD */
+#define X_NOT_POSIX
+#define X_NOT_STDC_ENV
+#endif
+#endif
+
+#ifdef luna
+#define X_NOT_POSIX
+#define X_NOT_STDC_ENV
+#endif
+
+#ifdef Mips
+#define X_NOT_POSIX
+#define X_NOT_STDC_ENV
+#endif
+
+#ifdef USL
+#ifdef SYSV /* (release 3.2) */
+#define X_NOT_POSIX
+#define X_NOT_STDC_ENV
+#endif
+#endif
+
+#ifdef _SCO_DS
+#ifndef __SCO__
+#define __SCO__
+#endif
+#endif
+
+#ifdef __i386__
+#ifdef SYSV
+#if !defined(ISC) && !defined(__SCO__) && !defined(_SEQUENT_) && \
+ !defined(__UNIXWARE__) && !defined(sun)
+#if !defined(_POSIX_SOURCE)
+#define X_NOT_POSIX
+#endif
+#define X_NOT_STDC_ENV
+#endif
+#endif
+#endif
+
+#ifdef MOTOROLA
+#ifdef SYSV
+#define X_NOT_STDC_ENV
+#endif
+#endif
+
+#ifdef sun
+/* Imake configs define SVR4 on Solaris, but cc & gcc only define __SVR4
+ * This check allows non-Imake configured programs to build correctly.
+ */
+#if defined(__SVR4) && !defined(SVR4)
+#define SVR4 1
+#endif
+#ifdef SVR4
+/* define this to whatever it needs to be */
+#define X_POSIX_C_SOURCE 199300L
+#endif
+#endif
+
+#ifdef WIN32
+#ifndef _POSIX_
+#define X_NOT_POSIX
+#endif
+#endif
+
+#if defined(nec_ews_svr2) || defined(SX) || defined(PC_UX)
+#define X_NOT_POSIX
+#define X_NOT_STDC_ENV
+#endif
+
+#ifdef __UNIXOS2__
+#define USGISH
+#define NULL_NOT_ZERO
+#endif
+
+#ifdef __DARWIN__
+#define NULL_NOT_ZERO
+#endif
+
+#ifdef __GNU__
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 4096
+#endif
+#endif
+
+#if defined(__SCO__) || defined(__UNIXWARE__)
+# ifndef PATH_MAX
+# define PATH_MAX 1024
+# endif
+# ifndef MAXPATHLEN
+# define MAXPATHLEN 1024
+# endif
+#endif
+
+#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) \
+ || defined(__Darwin__) || defined(__DragonFly__)
+# ifndef CSRG_BASED
+# define CSRG_BASED
+# endif
+#endif
+
+#endif /* _XOSDEFS_H_ */
+
diff --git a/lib/gcc/i686-linux/4.4.3/include-fixed/X11/Xw32defs.h b/lib/gcc/i686-linux/4.4.3/include-fixed/X11/Xw32defs.h
new file mode 100644
index 0000000..ec02aba
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include-fixed/X11/Xw32defs.h
@@ -0,0 +1,90 @@
+/* DO NOT EDIT THIS FILE.
+
+ It has been auto-edited by fixincludes from:
+
+ "/tmp/gcc32/1/i686-linux-glibc2.7-4.4.3/sysroot/usr/include/X11/Xw32defs.h"
+
+ This had to be done to correct non-standard usages in the
+ original, manufacturer supplied header file. */
+
+/* $Xorg: Xw32defs.h,v 1.3 2000/08/18 04:05:44 coskrey Exp $ */
+
+#ifndef _XW32DEFS_H
+#define _XW32DEFS_H
+
+#ifdef __GNUC__ /* mingw is more close to __unix__ than msvc */
+#if !defined(__daddr_t_defined)
+typedef char *caddr_t;
+#endif
+#define lstat stat
+
+#else
+typedef char *caddr_t;
+
+#define access _access
+#define alloca _alloca
+#define chdir _chdir
+#define chmod _chmod
+#define close _close
+#define creat _creat
+#define dup _dup
+#define dup2 _dup2
+#define environ _environ
+#define execl _execl
+#define execle _execle
+#define execlp _execlp
+#define execlpe _execlpe
+#define execv _execv
+#define execve _execve
+#define execvp _execvp
+#define execvpe _execvpe
+#define fdopen _fdopen
+#define fileno _fileno
+#define fstat _fstat
+#define getcwd _getcwd
+#define getpid _getpid
+#define hypot _hypot
+#define isascii __isascii
+#define isatty _isatty
+#define lseek _lseek
+#define mkdir _mkdir
+#define mktemp _mktemp
+#define open _open
+#define putenv _putenv
+#define read _read
+#define rmdir _rmdir
+#define sleep(x) _sleep((x) * 1000)
+#define stat _stat
+#define sys_errlist _sys_errlist
+#define sys_nerr _sys_nerr
+#define umask _umask
+#define unlink _unlink
+#define write _write
+#define random rand
+#define srandom srand
+
+#define O_RDONLY _O_RDONLY
+#define O_WRONLY _O_WRONLY
+#define O_RDWR _O_RDWR
+#define O_APPEND _O_APPEND
+#define O_CREAT _O_CREAT
+#define O_TRUNC _O_TRUNC
+#define O_EXCL _O_EXCL
+#define O_TEXT _O_TEXT
+#define O_BINARY _O_BINARY
+#define O_RAW _O_BINARY
+
+#define S_IFMT _S_IFMT
+#define S_IFDIR _S_IFDIR
+#define S_IFCHR _S_IFCHR
+#define S_IFREG _S_IFREG
+#define S_IREAD _S_IREAD
+#define S_IWRITE _S_IWRITE
+#define S_IEXEC _S_IEXEC
+
+#define F_OK 0
+#define X_OK 1
+#define W_OK 2
+#define R_OK 4
+#endif /* __GNUC__ */
+#endif
diff --git a/lib/gcc/i686-linux/4.4.3/include-fixed/limits.h b/lib/gcc/i686-linux/4.4.3/include-fixed/limits.h
new file mode 100644
index 0000000..30e08a7
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include-fixed/limits.h
@@ -0,0 +1,125 @@
+/* This administrivia gets added to the beginning of limits.h
+ if the system has its own version of limits.h. */
+
+/* We use _GCC_LIMITS_H_ because we want this not to match
+ any macros that the system's limits.h uses for its own purposes. */
+#ifndef _GCC_LIMITS_H_ /* Terminated in limity.h. */
+#define _GCC_LIMITS_H_
+
+#ifndef _LIBC_LIMITS_H_
+/* Use "..." so that we find syslimits.h only in this same directory. */
+#include "syslimits.h"
+#endif
+#ifndef _LIMITS_H___
+#define _LIMITS_H___
+
+/* Number of bits in a `char'. */
+#undef CHAR_BIT
+#define CHAR_BIT __CHAR_BIT__
+
+/* Maximum length of a multibyte character. */
+#ifndef MB_LEN_MAX
+#define MB_LEN_MAX 1
+#endif
+
+/* Minimum and maximum values a `signed char' can hold. */
+#undef SCHAR_MIN
+#define SCHAR_MIN (-SCHAR_MAX - 1)
+#undef SCHAR_MAX
+#define SCHAR_MAX __SCHAR_MAX__
+
+/* Maximum value an `unsigned char' can hold. (Minimum is 0). */
+#undef UCHAR_MAX
+#if __SCHAR_MAX__ == __INT_MAX__
+# define UCHAR_MAX (SCHAR_MAX * 2U + 1U)
+#else
+# define UCHAR_MAX (SCHAR_MAX * 2 + 1)
+#endif
+
+/* Minimum and maximum values a `char' can hold. */
+#ifdef __CHAR_UNSIGNED__
+# undef CHAR_MIN
+# if __SCHAR_MAX__ == __INT_MAX__
+# define CHAR_MIN 0U
+# else
+# define CHAR_MIN 0
+# endif
+# undef CHAR_MAX
+# define CHAR_MAX UCHAR_MAX
+#else
+# undef CHAR_MIN
+# define CHAR_MIN SCHAR_MIN
+# undef CHAR_MAX
+# define CHAR_MAX SCHAR_MAX
+#endif
+
+/* Minimum and maximum values a `signed short int' can hold. */
+#undef SHRT_MIN
+#define SHRT_MIN (-SHRT_MAX - 1)
+#undef SHRT_MAX
+#define SHRT_MAX __SHRT_MAX__
+
+/* Maximum value an `unsigned short int' can hold. (Minimum is 0). */
+#undef USHRT_MAX
+#if __SHRT_MAX__ == __INT_MAX__
+# define USHRT_MAX (SHRT_MAX * 2U + 1U)
+#else
+# define USHRT_MAX (SHRT_MAX * 2 + 1)
+#endif
+
+/* Minimum and maximum values a `signed int' can hold. */
+#undef INT_MIN
+#define INT_MIN (-INT_MAX - 1)
+#undef INT_MAX
+#define INT_MAX __INT_MAX__
+
+/* Maximum value an `unsigned int' can hold. (Minimum is 0). */
+#undef UINT_MAX
+#define UINT_MAX (INT_MAX * 2U + 1U)
+
+/* Minimum and maximum values a `signed long int' can hold.
+ (Same as `int'). */
+#undef LONG_MIN
+#define LONG_MIN (-LONG_MAX - 1L)
+#undef LONG_MAX
+#define LONG_MAX __LONG_MAX__
+
+/* Maximum value an `unsigned long int' can hold. (Minimum is 0). */
+#undef ULONG_MAX
+#define ULONG_MAX (LONG_MAX * 2UL + 1UL)
+
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+/* Minimum and maximum values a `signed long long int' can hold. */
+# undef LLONG_MIN
+# define LLONG_MIN (-LLONG_MAX - 1LL)
+# undef LLONG_MAX
+# define LLONG_MAX __LONG_LONG_MAX__
+
+/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
+# undef ULLONG_MAX
+# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
+#endif
+
+#if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined (__STRICT_ANSI__)
+/* Minimum and maximum values a `signed long long int' can hold. */
+# undef LONG_LONG_MIN
+# define LONG_LONG_MIN (-LONG_LONG_MAX - 1LL)
+# undef LONG_LONG_MAX
+# define LONG_LONG_MAX __LONG_LONG_MAX__
+
+/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
+# undef ULONG_LONG_MAX
+# define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1ULL)
+#endif
+
+#endif /* _LIMITS_H___ */
+/* This administrivia gets added to the end of limits.h
+ if the system has its own version of limits.h. */
+
+#else /* not _GCC_LIMITS_H_ */
+
+#ifdef _GCC_NEXT_LIMITS_H
+#include_next <limits.h> /* recurse down to the real one */
+#endif
+
+#endif /* not _GCC_LIMITS_H_ */
diff --git a/lib/gcc/i686-linux/4.4.3/include-fixed/linux/a.out.h b/lib/gcc/i686-linux/4.4.3/include-fixed/linux/a.out.h
new file mode 100644
index 0000000..1fa8fb9
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include-fixed/linux/a.out.h
@@ -0,0 +1,277 @@
+/* DO NOT EDIT THIS FILE.
+
+ It has been auto-edited by fixincludes from:
+
+ "/tmp/gcc32/1/i686-linux-glibc2.7-4.4.3/sysroot/usr/include/linux/a.out.h"
+
+ This had to be done to correct non-standard usages in the
+ original, manufacturer supplied header file. */
+
+#ifndef __A_OUT_GNU_H__
+#define __A_OUT_GNU_H__
+
+#define __GNU_EXEC_MACROS__
+
+#ifndef __STRUCT_EXEC_OVERRIDE__
+
+#include <asm/a.out.h>
+
+#endif /* __STRUCT_EXEC_OVERRIDE__ */
+
+/* these go in the N_MACHTYPE field */
+enum machine_type {
+#if defined (M_OLDSUN2)
+ M__OLDSUN2 = M_OLDSUN2,
+#else
+ M_OLDSUN2 = 0,
+#endif
+#if defined (M_68010)
+ M__68010 = M_68010,
+#else
+ M_68010 = 1,
+#endif
+#if defined (M_68020)
+ M__68020 = M_68020,
+#else
+ M_68020 = 2,
+#endif
+#if defined (M_SPARC)
+ M__SPARC = M_SPARC,
+#else
+ M_SPARC = 3,
+#endif
+ /* skip a bunch so we don't run into any of sun's numbers */
+ M_386 = 100,
+ M_MIPS1 = 151, /* MIPS R3000/R3000 binary */
+ M_MIPS2 = 152 /* MIPS R6000/R4000 binary */
+};
+
+#if !defined (N_MAGIC)
+#define N_MAGIC(exec) ((exec).a_info & 0xffff)
+#endif
+#define N_MACHTYPE(exec) ((enum machine_type)(((exec).a_info >> 16) & 0xff))
+#define N_FLAGS(exec) (((exec).a_info >> 24) & 0xff)
+#define N_SET_INFO(exec, magic, type, flags) \
+ ((exec).a_info = ((magic) & 0xffff) \
+ | (((int)(type) & 0xff) << 16) \
+ | (((flags) & 0xff) << 24))
+#define N_SET_MAGIC(exec, magic) \
+ ((exec).a_info = (((exec).a_info & 0xffff0000) | ((magic) & 0xffff)))
+
+#define N_SET_MACHTYPE(exec, machtype) \
+ ((exec).a_info = \
+ ((exec).a_info&0xff00ffff) | ((((int)(machtype))&0xff) << 16))
+
+#define N_SET_FLAGS(exec, flags) \
+ ((exec).a_info = \
+ ((exec).a_info&0x00ffffff) | (((flags) & 0xff) << 24))
+
+/* Code indicating object file or impure executable. */
+#define OMAGIC 0407
+/* Code indicating pure executable. */
+#define NMAGIC 0410
+/* Code indicating demand-paged executable. */
+#define ZMAGIC 0413
+/* This indicates a demand-paged executable with the header in the text.
+ The first page is unmapped to help trap NULL pointer references */
+#define QMAGIC 0314
+
+/* Code indicating core file. */
+#define CMAGIC 0421
+
+#if !defined (N_BADMAG)
+#define N_BADMAG(x) (N_MAGIC(x) != OMAGIC \
+ && N_MAGIC(x) != NMAGIC \
+ && N_MAGIC(x) != ZMAGIC \
+ && N_MAGIC(x) != QMAGIC)
+#endif
+
+#define _N_HDROFF(x) (1024 - sizeof (struct exec))
+
+#if !defined (N_TXTOFF)
+#define N_TXTOFF(x) \
+ (N_MAGIC(x) == ZMAGIC ? _N_HDROFF((x)) + sizeof (struct exec) : \
+ (N_MAGIC(x) == QMAGIC ? 0 : sizeof (struct exec)))
+#endif
+
+#if !defined (N_DATOFF)
+#define N_DATOFF(x) (N_TXTOFF(x) + (x).a_text)
+#endif
+
+#if !defined (N_TRELOFF)
+#define N_TRELOFF(x) (N_DATOFF(x) + (x).a_data)
+#endif
+
+#if !defined (N_DRELOFF)
+#define N_DRELOFF(x) (N_TRELOFF(x) + N_TRSIZE(x))
+#endif
+
+#if !defined (N_SYMOFF)
+#define N_SYMOFF(x) (N_DRELOFF(x) + N_DRSIZE(x))
+#endif
+
+#if !defined (N_STROFF)
+#define N_STROFF(x) (N_SYMOFF(x) + N_SYMSIZE(x))
+#endif
+
+/* Address of text segment in memory after it is loaded. */
+#if !defined (N_TXTADDR)
+#define N_TXTADDR(x) (N_MAGIC(x) == QMAGIC ? PAGE_SIZE : 0)
+#endif
+
+/* Address of data segment in memory after it is loaded.
+ Note that it is up to you to define SEGMENT_SIZE
+ on machines not listed here. */
+#if defined(vax) || defined(hp300) || defined(pyr)
+#define SEGMENT_SIZE page_size
+#endif
+#ifdef sony
+#define SEGMENT_SIZE 0x2000
+#endif /* Sony. */
+#ifdef is68k
+#define SEGMENT_SIZE 0x20000
+#endif
+#if defined(m68k) && defined(PORTAR)
+#define PAGE_SIZE 0x400
+#define SEGMENT_SIZE PAGE_SIZE
+#endif
+
+#ifdef __linux__
+#include <asm/page.h>
+#if defined(__i386__) || defined(__mc68000__)
+#define SEGMENT_SIZE 1024
+#else
+#ifndef SEGMENT_SIZE
+#define SEGMENT_SIZE PAGE_SIZE
+#endif
+#endif
+#endif
+
+#define _N_SEGMENT_ROUND(x) ALIGN(x, SEGMENT_SIZE)
+
+#define _N_TXTENDADDR(x) (N_TXTADDR(x)+(x).a_text)
+
+#ifndef N_DATADDR
+#define N_DATADDR(x) \
+ (N_MAGIC(x)==OMAGIC? (_N_TXTENDADDR(x)) \
+ : (_N_SEGMENT_ROUND (_N_TXTENDADDR(x))))
+#endif
+
+/* Address of bss segment in memory after it is loaded. */
+#if !defined (N_BSSADDR)
+#define N_BSSADDR(x) (N_DATADDR(x) + (x).a_data)
+#endif
+
+#if !defined (N_NLIST_DECLARED)
+struct nlist {
+ union {
+ char *n_name;
+ struct nlist *n_next;
+ long n_strx;
+ } n_un;
+ unsigned char n_type;
+ char n_other;
+ short n_desc;
+ unsigned long n_value;
+};
+#endif /* no N_NLIST_DECLARED. */
+
+#if !defined (N_UNDF)
+#define N_UNDF 0
+#endif
+#if !defined (N_ABS)
+#define N_ABS 2
+#endif
+#if !defined (N_TEXT)
+#define N_TEXT 4
+#endif
+#if !defined (N_DATA)
+#define N_DATA 6
+#endif
+#if !defined (N_BSS)
+#define N_BSS 8
+#endif
+#if !defined (N_FN)
+#define N_FN 15
+#endif
+
+#if !defined (N_EXT)
+#define N_EXT 1
+#endif
+#if !defined (N_TYPE)
+#define N_TYPE 036
+#endif
+#if !defined (N_STAB)
+#define N_STAB 0340
+#endif
+
+/* The following type indicates the definition of a symbol as being
+ an indirect reference to another symbol. The other symbol
+ appears as an undefined reference, immediately following this symbol.
+
+ Indirection is asymmetrical. The other symbol's value will be used
+ to satisfy requests for the indirect symbol, but not vice versa.
+ If the other symbol does not have a definition, libraries will
+ be searched to find a definition. */
+#define N_INDR 0xa
+
+/* The following symbols refer to set elements.
+ All the N_SET[ATDB] symbols with the same name form one set.
+ Space is allocated for the set in the text section, and each set
+ element's value is stored into one word of the space.
+ The first word of the space is the length of the set (number of elements).
+
+ The address of the set is made into an N_SETV symbol
+ whose name is the same as the name of the set.
+ This symbol acts like a N_DATA global symbol
+ in that it can satisfy undefined external references. */
+
+/* These appear as input to LD, in a .o file. */
+#define N_SETA 0x14 /* Absolute set element symbol */
+#define N_SETT 0x16 /* Text set element symbol */
+#define N_SETD 0x18 /* Data set element symbol */
+#define N_SETB 0x1A /* Bss set element symbol */
+
+/* This is output from LD. */
+#define N_SETV 0x1C /* Pointer to set vector in data area. */
+
+#if !defined (N_RELOCATION_INFO_DECLARED)
+/* This structure describes a single relocation to be performed.
+ The text-relocation section of the file is a vector of these structures,
+ all of which apply to the text section.
+ Likewise, the data-relocation section applies to the data section. */
+
+struct relocation_info
+{
+ /* Address (within segment) to be relocated. */
+ int r_address;
+ /* The meaning of r_symbolnum depends on r_extern. */
+ unsigned int r_symbolnum:24;
+ /* Nonzero means value is a pc-relative offset
+ and it should be relocated for changes in its own address
+ as well as for changes in the symbol or section specified. */
+ unsigned int r_pcrel:1;
+ /* Length (as exponent of 2) of the field to be relocated.
+ Thus, a value of 2 indicates 1<<2 bytes. */
+ unsigned int r_length:2;
+ /* 1 => relocate with value of symbol.
+ r_symbolnum is the index of the symbol
+ in file's the symbol table.
+ 0 => relocate with the address of a segment.
+ r_symbolnum is N_TEXT, N_DATA, N_BSS or N_ABS
+ (the N_EXT bit may be set also, but signifies nothing). */
+ unsigned int r_extern:1;
+ /* Four bits that aren't used, but when writing an object file
+ it is desirable to clear them. */
+#ifdef NS32K
+ unsigned r_bsr:1;
+ unsigned r_disp:1;
+ unsigned r_pad:2;
+#else
+ unsigned int r_pad:4;
+#endif
+};
+#endif /* no N_RELOCATION_INFO_DECLARED. */
+
+
+#endif /* __A_OUT_GNU_H__ */
diff --git a/lib/gcc/i686-linux/4.4.3/include-fixed/syslimits.h b/lib/gcc/i686-linux/4.4.3/include-fixed/syslimits.h
new file mode 100644
index 0000000..a362802
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include-fixed/syslimits.h
@@ -0,0 +1,8 @@
+/* syslimits.h stands for the system's own limits.h file.
+ If we can use it ok unmodified, then we install this text.
+ If fixincludes fixes it, then the fixed version is installed
+ instead of this text. */
+
+#define _GCC_NEXT_LIMITS_H /* tell gcc's limits.h to recurse */
+#include_next <limits.h>
+#undef _GCC_NEXT_LIMITS_H
diff --git a/lib/gcc/i686-linux/4.4.3/include/ammintrin.h b/lib/gcc/i686-linux/4.4.3/include/ammintrin.h
new file mode 100644
index 0000000..3647b31
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include/ammintrin.h
@@ -0,0 +1,88 @@
+/* Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ GCC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* Implemented from the specification included in the AMD Programmers
+ Manual Update, version 2.x */
+
+#ifndef _AMMINTRIN_H_INCLUDED
+#define _AMMINTRIN_H_INCLUDED
+
+#ifndef __SSE4A__
+# error "SSE4A instruction set not enabled"
+#else
+
+/* We need definitions from the SSE3, SSE2 and SSE header files*/
+#include <pmmintrin.h>
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_stream_sd (double * __P, __m128d __Y)
+{
+ __builtin_ia32_movntsd (__P, (__v2df) __Y);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_stream_ss (float * __P, __m128 __Y)
+{
+ __builtin_ia32_movntss (__P, (__v4sf) __Y);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_extract_si64 (__m128i __X, __m128i __Y)
+{
+ return (__m128i) __builtin_ia32_extrq ((__v2di) __X, (__v16qi) __Y);
+}
+
+#ifdef __OPTIMIZE__
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_extracti_si64 (__m128i __X, unsigned const int __I, unsigned const int __L)
+{
+ return (__m128i) __builtin_ia32_extrqi ((__v2di) __X, __I, __L);
+}
+#else
+#define _mm_extracti_si64(X, I, L) \
+ ((__m128i) __builtin_ia32_extrqi ((__v2di)(__m128i)(X), \
+ (unsigned int)(I), (unsigned int)(L)))
+#endif
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_insert_si64 (__m128i __X,__m128i __Y)
+{
+ return (__m128i) __builtin_ia32_insertq ((__v2di)__X, (__v2di)__Y);
+}
+
+#ifdef __OPTIMIZE__
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_inserti_si64(__m128i __X, __m128i __Y, unsigned const int __I, unsigned const int __L)
+{
+ return (__m128i) __builtin_ia32_insertqi ((__v2di)__X, (__v2di)__Y, __I, __L);
+}
+#else
+#define _mm_inserti_si64(X, Y, I, L) \
+ ((__m128i) __builtin_ia32_insertqi ((__v2di)(__m128i)(X), \
+ (__v2di)(__m128i)(Y), \
+ (unsigned int)(I), (unsigned int)(L)))
+#endif
+
+#endif /* __SSE4A__ */
+
+#endif /* _AMMINTRIN_H_INCLUDED */
diff --git a/lib/gcc/i686-linux/4.4.3/include/avxintrin.h b/lib/gcc/i686-linux/4.4.3/include/avxintrin.h
new file mode 100644
index 0000000..26925fd
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include/avxintrin.h
@@ -0,0 +1,1426 @@
+/* Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ GCC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* Implemented from the specification included in the Intel C++ Compiler
+ User Guide and Reference, version 11.0. */
+
+#ifndef _IMMINTRIN_H_INCLUDED
+# error "Never use <avxintrin.h> directly; include <immintrin.h> instead."
+#endif
+
+/* Internal data types for implementing the intrinsics. */
+typedef double __v4df __attribute__ ((__vector_size__ (32)));
+typedef float __v8sf __attribute__ ((__vector_size__ (32)));
+typedef long long __v4di __attribute__ ((__vector_size__ (32)));
+typedef int __v8si __attribute__ ((__vector_size__ (32)));
+typedef short __v16hi __attribute__ ((__vector_size__ (32)));
+typedef char __v32qi __attribute__ ((__vector_size__ (32)));
+
+/* The Intel API is flexible enough that we must allow aliasing with other
+ vector types, and their scalar components. */
+typedef float __m256 __attribute__ ((__vector_size__ (32),
+ __may_alias__));
+typedef long long __m256i __attribute__ ((__vector_size__ (32),
+ __may_alias__));
+typedef double __m256d __attribute__ ((__vector_size__ (32),
+ __may_alias__));
+
+/* Compare predicates for scalar and packed compare intrinsics. */
+
+/* Equal (ordered, non-signaling) */
+#define _CMP_EQ_OQ 0x00
+/* Less-than (ordered, signaling) */
+#define _CMP_LT_OS 0x01
+/* Less-than-or-equal (ordered, signaling) */
+#define _CMP_LE_OS 0x02
+/* Unordered (non-signaling) */
+#define _CMP_UNORD_Q 0x03
+/* Not-equal (unordered, non-signaling) */
+#define _CMP_NEQ_UQ 0x04
+/* Not-less-than (unordered, signaling) */
+#define _CMP_NLT_US 0x05
+/* Not-less-than-or-equal (unordered, signaling) */
+#define _CMP_NLE_US 0x06
+/* Ordered (nonsignaling) */
+#define _CMP_ORD_Q 0x07
+/* Equal (unordered, non-signaling) */
+#define _CMP_EQ_UQ 0x08
+/* Not-greater-than-or-equal (unordered, signaling) */
+#define _CMP_NGE_US 0x09
+/* Not-greater-than (unordered, signaling) */
+#define _CMP_NGT_US 0x0a
+/* False (ordered, non-signaling) */
+#define _CMP_FALSE_OQ 0x0b
+/* Not-equal (ordered, non-signaling) */
+#define _CMP_NEQ_OQ 0x0c
+/* Greater-than-or-equal (ordered, signaling) */
+#define _CMP_GE_OS 0x0d
+/* Greater-than (ordered, signaling) */
+#define _CMP_GT_OS 0x0e
+/* True (unordered, non-signaling) */
+#define _CMP_TRUE_UQ 0x0f
+/* Equal (ordered, signaling) */
+#define _CMP_EQ_OS 0x10
+/* Less-than (ordered, non-signaling) */
+#define _CMP_LT_OQ 0x11
+/* Less-than-or-equal (ordered, non-signaling) */
+#define _CMP_LE_OQ 0x12
+/* Unordered (signaling) */
+#define _CMP_UNORD_S 0x13
+/* Not-equal (unordered, signaling) */
+#define _CMP_NEQ_US 0x14
+/* Not-less-than (unordered, non-signaling) */
+#define _CMP_NLT_UQ 0x15
+/* Not-less-than-or-equal (unordered, non-signaling) */
+#define _CMP_NLE_UQ 0x16
+/* Ordered (signaling) */
+#define _CMP_ORD_S 0x17
+/* Equal (unordered, signaling) */
+#define _CMP_EQ_US 0x18
+/* Not-greater-than-or-equal (unordered, non-signaling) */
+#define _CMP_NGE_UQ 0x19
+/* Not-greater-than (unordered, non-signaling) */
+#define _CMP_NGT_UQ 0x1a
+/* False (ordered, signaling) */
+#define _CMP_FALSE_OS 0x1b
+/* Not-equal (ordered, signaling) */
+#define _CMP_NEQ_OS 0x1c
+/* Greater-than-or-equal (ordered, non-signaling) */
+#define _CMP_GE_OQ 0x1d
+/* Greater-than (ordered, non-signaling) */
+#define _CMP_GT_OQ 0x1e
+/* True (unordered, signaling) */
+#define _CMP_TRUE_US 0x1f
+
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_add_pd (__m256d __A, __m256d __B)
+{
+ return (__m256d) __builtin_ia32_addpd256 ((__v4df)__A, (__v4df)__B);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_add_ps (__m256 __A, __m256 __B)
+{
+ return (__m256) __builtin_ia32_addps256 ((__v8sf)__A, (__v8sf)__B);
+}
+
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_addsub_pd (__m256d __A, __m256d __B)
+{
+ return (__m256d) __builtin_ia32_addsubpd256 ((__v4df)__A, (__v4df)__B);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_addsub_ps (__m256 __A, __m256 __B)
+{
+ return (__m256) __builtin_ia32_addsubps256 ((__v8sf)__A, (__v8sf)__B);
+}
+
+
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_and_pd (__m256d __A, __m256d __B)
+{
+ return (__m256d) __builtin_ia32_andpd256 ((__v4df)__A, (__v4df)__B);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_and_ps (__m256 __A, __m256 __B)
+{
+ return (__m256) __builtin_ia32_andps256 ((__v8sf)__A, (__v8sf)__B);
+}
+
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_andnot_pd (__m256d __A, __m256d __B)
+{
+ return (__m256d) __builtin_ia32_andnpd256 ((__v4df)__A, (__v4df)__B);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_andnot_ps (__m256 __A, __m256 __B)
+{
+ return (__m256) __builtin_ia32_andnps256 ((__v8sf)__A, (__v8sf)__B);
+}
+
+/* Double/single precision floating point blend instructions - select
+ data from 2 sources using constant/variable mask. */
+
+#ifdef __OPTIMIZE__
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_blend_pd (__m256d __X, __m256d __Y, const int __M)
+{
+ return (__m256d) __builtin_ia32_blendpd256 ((__v4df)__X,
+ (__v4df)__Y,
+ __M);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_blend_ps (__m256 __X, __m256 __Y, const int __M)
+{
+ return (__m256) __builtin_ia32_blendps256 ((__v8sf)__X,
+ (__v8sf)__Y,
+ __M);
+}
+#else
+#define _mm256_blend_pd(X, Y, M) \
+ ((__m256d) __builtin_ia32_blendpd256 ((__v4df)(__m256d)(X), \
+ (__v4df)(__m256d)(Y), (int)(M)))
+
+#define _mm256_blend_ps(X, Y, M) \
+ ((__m256) __builtin_ia32_blendps256 ((__v8sf)(__m256)(X), \
+ (__v8sf)(__m256)(Y), (int)(M)))
+#endif
+
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_blendv_pd (__m256d __X, __m256d __Y, __m256d __M)
+{
+ return (__m256d) __builtin_ia32_blendvpd256 ((__v4df)__X,
+ (__v4df)__Y,
+ (__v4df)__M);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_blendv_ps (__m256 __X, __m256 __Y, __m256 __M)
+{
+ return (__m256) __builtin_ia32_blendvps256 ((__v8sf)__X,
+ (__v8sf)__Y,
+ (__v8sf)__M);
+}
+
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_div_pd (__m256d __A, __m256d __B)
+{
+ return (__m256d) __builtin_ia32_divpd256 ((__v4df)__A, (__v4df)__B);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_div_ps (__m256 __A, __m256 __B)
+{
+ return (__m256) __builtin_ia32_divps256 ((__v8sf)__A, (__v8sf)__B);
+}
+
+/* Dot product instructions with mask-defined summing and zeroing parts
+ of result. */
+
+#ifdef __OPTIMIZE__
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_dp_ps (__m256 __X, __m256 __Y, const int __M)
+{
+ return (__m256) __builtin_ia32_dpps256 ((__v8sf)__X,
+ (__v8sf)__Y,
+ __M);
+}
+#else
+#define _mm256_dp_ps(X, Y, M) \
+ ((__m256) __builtin_ia32_dpps256 ((__v8sf)(__m256)(X), \
+ (__v8sf)(__m256)(Y), (int)(M)))
+#endif
+
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_hadd_pd (__m256d __X, __m256d __Y)
+{
+ return (__m256d) __builtin_ia32_haddpd256 ((__v4df)__X, (__v4df)__Y);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_hadd_ps (__m256 __X, __m256 __Y)
+{
+ return (__m256) __builtin_ia32_haddps256 ((__v8sf)__X, (__v8sf)__Y);
+}
+
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_hsub_pd (__m256d __X, __m256d __Y)
+{
+ return (__m256d) __builtin_ia32_hsubpd256 ((__v4df)__X, (__v4df)__Y);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_hsub_ps (__m256 __X, __m256 __Y)
+{
+ return (__m256) __builtin_ia32_hsubps256 ((__v8sf)__X, (__v8sf)__Y);
+}
+
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_max_pd (__m256d __A, __m256d __B)
+{
+ return (__m256d) __builtin_ia32_maxpd256 ((__v4df)__A, (__v4df)__B);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_max_ps (__m256 __A, __m256 __B)
+{
+ return (__m256) __builtin_ia32_maxps256 ((__v8sf)__A, (__v8sf)__B);
+}
+
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_min_pd (__m256d __A, __m256d __B)
+{
+ return (__m256d) __builtin_ia32_minpd256 ((__v4df)__A, (__v4df)__B);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_min_ps (__m256 __A, __m256 __B)
+{
+ return (__m256) __builtin_ia32_minps256 ((__v8sf)__A, (__v8sf)__B);
+}
+
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_mul_pd (__m256d __A, __m256d __B)
+{
+ return (__m256d) __builtin_ia32_mulpd256 ((__v4df)__A, (__v4df)__B);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_mul_ps (__m256 __A, __m256 __B)
+{
+ return (__m256) __builtin_ia32_mulps256 ((__v8sf)__A, (__v8sf)__B);
+}
+
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_or_pd (__m256d __A, __m256d __B)
+{
+ return (__m256d) __builtin_ia32_orpd256 ((__v4df)__A, (__v4df)__B);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_or_ps (__m256 __A, __m256 __B)
+{
+ return (__m256) __builtin_ia32_orps256 ((__v8sf)__A, (__v8sf)__B);
+}
+
+#ifdef __OPTIMIZE__
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_shuffle_pd (__m256d __A, __m256d __B, const int __mask)
+{
+ return (__m256d) __builtin_ia32_shufpd256 ((__v4df)__A, (__v4df)__B,
+ __mask);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_shuffle_ps (__m256 __A, __m256 __B, const int __mask)
+{
+ return (__m256) __builtin_ia32_shufps256 ((__v8sf)__A, (__v8sf)__B,
+ __mask);
+}
+#else
+#define _mm256_shuffle_pd(A, B, N) \
+ ((__m256d)__builtin_ia32_shufpd256 ((__v4df)(__m256d)(A), \
+ (__v4df)(__m256d)(B), (int)(N)))
+
+#define _mm256_shuffle_ps(A, B, N) \
+ ((__m256) __builtin_ia32_shufps256 ((__v8sf)(__m256)(A), \
+ (__v8sf)(__m256)(B), (int)(N)))
+#endif
+
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_sub_pd (__m256d __A, __m256d __B)
+{
+ return (__m256d) __builtin_ia32_subpd256 ((__v4df)__A, (__v4df)__B);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_sub_ps (__m256 __A, __m256 __B)
+{
+ return (__m256) __builtin_ia32_subps256 ((__v8sf)__A, (__v8sf)__B);
+}
+
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_xor_pd (__m256d __A, __m256d __B)
+{
+ return (__m256d) __builtin_ia32_xorpd256 ((__v4df)__A, (__v4df)__B);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_xor_ps (__m256 __A, __m256 __B)
+{
+ return (__m256) __builtin_ia32_xorps256 ((__v8sf)__A, (__v8sf)__B);
+}
+
+#ifdef __OPTIMIZE__
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmp_pd (__m128d __X, __m128d __Y, const int __P)
+{
+ return (__m128d) __builtin_ia32_cmppd ((__v2df)__X, (__v2df)__Y, __P);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmp_ps (__m128 __X, __m128 __Y, const int __P)
+{
+ return (__m128) __builtin_ia32_cmpps ((__v4sf)__X, (__v4sf)__Y, __P);
+}
+
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_cmp_pd (__m256d __X, __m256d __Y, const int __P)
+{
+ return (__m256d) __builtin_ia32_cmppd256 ((__v4df)__X, (__v4df)__Y,
+ __P);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_cmp_ps (__m256 __X, __m256 __Y, const int __P)
+{
+ return (__m256) __builtin_ia32_cmpps256 ((__v8sf)__X, (__v8sf)__Y,
+ __P);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmp_sd (__m128d __X, __m128d __Y, const int __P)
+{
+ return (__m128d) __builtin_ia32_cmpsd ((__v2df)__X, (__v2df)__Y, __P);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmp_ss (__m128 __X, __m128 __Y, const int __P)
+{
+ return (__m128) __builtin_ia32_cmpss ((__v4sf)__X, (__v4sf)__Y, __P);
+}
+#else
+#define _mm_cmp_pd(X, Y, P) \
+ ((__m128d) __builtin_ia32_cmppd ((__v2df)(__m128d)(X), \
+ (__v2df)(__m128d)(Y), (int)(P)))
+
+#define _mm_cmp_ps(X, Y, P) \
+ ((__m128) __builtin_ia32_cmpps ((__v4sf)(__m128)(X), \
+ (__v4sf)(__m128)(Y), (int)(P)))
+
+#define _mm256_cmp_pd(X, Y, P) \
+ ((__m256d) __builtin_ia32_cmppd256 ((__v4df)(__m256d)(X), \
+ (__v4df)(__m256d)(Y), (int)(P)))
+
+#define _mm256_cmp_ps(X, Y, P) \
+ ((__m256) __builtin_ia32_cmpps256 ((__v8sf)(__m256)(X), \
+ (__v8sf)(__m256)(Y), (int)(P)))
+
+#define _mm_cmp_sd(X, Y, P) \
+ ((__m128d) __builtin_ia32_cmpsd ((__v2df)(__m128d)(X), \
+ (__v2df)(__m128d)(Y), (int)(P)))
+
+#define _mm_cmp_ss(X, Y, P) \
+ ((__m128) __builtin_ia32_cmpss ((__v4sf)(__m128)(X), \
+ (__v4sf)(__m128)(Y), (int)(P)))
+#endif
+
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_cvtepi32_pd (__m128i __A)
+{
+ return (__m256d)__builtin_ia32_cvtdq2pd256 ((__v4si) __A);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_cvtepi32_ps (__m256i __A)
+{
+ return (__m256)__builtin_ia32_cvtdq2ps256 ((__v8si) __A);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_cvtpd_ps (__m256d __A)
+{
+ return (__m128)__builtin_ia32_cvtpd2ps256 ((__v4df) __A);
+}
+
+extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_cvtps_epi32 (__m256 __A)
+{
+ return (__m256i)__builtin_ia32_cvtps2dq256 ((__v8sf) __A);
+}
+
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_cvtps_pd (__m128 __A)
+{
+ return (__m256d)__builtin_ia32_cvtps2pd256 ((__v4sf) __A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_cvttpd_epi32 (__m256d __A)
+{
+ return (__m128i)__builtin_ia32_cvttpd2dq256 ((__v4df) __A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_cvtpd_epi32 (__m256d __A)
+{
+ return (__m128i)__builtin_ia32_cvtpd2dq256 ((__v4df) __A);
+}
+
+extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_cvttps_epi32 (__m256 __A)
+{
+ return (__m256i)__builtin_ia32_cvttps2dq256 ((__v8sf) __A);
+}
+
+#ifdef __OPTIMIZE__
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_extractf128_pd (__m256d __X, const int __N)
+{
+ return (__m128d) __builtin_ia32_vextractf128_pd256 ((__v4df)__X, __N);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_extractf128_ps (__m256 __X, const int __N)
+{
+ return (__m128) __builtin_ia32_vextractf128_ps256 ((__v8sf)__X, __N);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_extractf128_si256 (__m256i __X, const int __N)
+{
+ return (__m128i) __builtin_ia32_vextractf128_si256 ((__v8si)__X, __N);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_extract_epi32 (__m256i __X, int const __N)
+{
+ __m128i __Y = _mm256_extractf128_si256 (__X, __N >> 2);
+ return _mm_extract_epi32 (__Y, __N % 4);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_extract_epi16 (__m256i __X, int const __N)
+{
+ __m128i __Y = _mm256_extractf128_si256 (__X, __N >> 3);
+ return _mm_extract_epi16 (__Y, __N % 8);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_extract_epi8 (__m256i __X, int const __N)
+{
+ __m128i __Y = _mm256_extractf128_si256 (__X, __N >> 4);
+ return _mm_extract_epi8 (__Y, __N % 16);
+}
+
+#ifdef __x86_64__
+extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_extract_epi64 (__m256i __X, const int __N)
+{
+ __m128i __Y = _mm256_extractf128_si256 (__X, __N >> 1);
+ return _mm_extract_epi64 (__Y, __N % 2);
+}
+#endif
+#else
+#define _mm256_extractf128_pd(X, N) \
+ ((__m128d) __builtin_ia32_vextractf128_pd256 ((__v4df)(__m256d)(X), \
+ (int)(N)))
+
+#define _mm256_extractf128_ps(X, N) \
+ ((__m128) __builtin_ia32_vextractf128_ps256 ((__v8sf)(__m256)(X), \
+ (int)(N)))
+
+#define _mm256_extractf128_si256(X, N) \
+ ((__m128i) __builtin_ia32_vextractf128_si256 ((__v8si)(__m256i)(X), \
+ (int)(N)))
+
+#define _mm256_extract_epi32(X, N) \
+ (__extension__ \
+ ({ \
+ __m128i __Y = _mm256_extractf128_si256 ((X), (N) >> 2); \
+ _mm_extract_epi32 (__Y, (N) % 4); \
+ }))
+
+#define _mm256_extract_epi16(X, N) \
+ (__extension__ \
+ ({ \
+ __m128i __Y = _mm256_extractf128_si256 ((X), (N) >> 3); \
+ _mm_extract_epi16 (__Y, (N) % 8); \
+ }))
+
+#define _mm256_extract_epi8(X, N) \
+ (__extension__ \
+ ({ \
+ __m128i __Y = _mm256_extractf128_si256 ((X), (N) >> 4); \
+ _mm_extract_epi8 (__Y, (N) % 16); \
+ }))
+
+#ifdef __x86_64__
+#define _mm256_extract_epi64(X, N) \
+ (__extension__ \
+ ({ \
+ __m128i __Y = _mm256_extractf128_si256 ((X), (N) >> 1); \
+ _mm_extract_epi64 (__Y, (N) % 2); \
+ }))
+#endif
+#endif
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_zeroall (void)
+{
+ __builtin_ia32_vzeroall ();
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_zeroupper (void)
+{
+ __builtin_ia32_vzeroupper ();
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_permutevar_pd (__m128d __A, __m128i __C)
+{
+ return (__m128d) __builtin_ia32_vpermilvarpd ((__v2df)__A,
+ (__v2di)__C);
+}
+
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_permutevar_pd (__m256d __A, __m256i __C)
+{
+ return (__m256d) __builtin_ia32_vpermilvarpd256 ((__v4df)__A,
+ (__v4di)__C);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_permutevar_ps (__m128 __A, __m128i __C)
+{
+ return (__m128) __builtin_ia32_vpermilvarps ((__v4sf)__A,
+ (__v4si)__C);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_permutevar_ps (__m256 __A, __m256i __C)
+{
+ return (__m256) __builtin_ia32_vpermilvarps256 ((__v8sf)__A,
+ (__v8si)__C);
+}
+
+#ifdef __OPTIMIZE__
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_permute_pd (__m128d __X, const int __C)
+{
+ return (__m128d) __builtin_ia32_vpermilpd ((__v2df)__X, __C);
+}
+
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_permute_pd (__m256d __X, const int __C)
+{
+ return (__m256d) __builtin_ia32_vpermilpd256 ((__v4df)__X, __C);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_permute_ps (__m128 __X, const int __C)
+{
+ return (__m128) __builtin_ia32_vpermilps ((__v4sf)__X, __C);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_permute_ps (__m256 __X, const int __C)
+{
+ return (__m256) __builtin_ia32_vpermilps256 ((__v8sf)__X, __C);
+}
+#else
+#define _mm_permute_pd(X, C) \
+ ((__m128d) __builtin_ia32_vpermilpd ((__v2df)(__m128d)(X), (int)(C)))
+
+#define _mm256_permute_pd(X, C) \
+ ((__m256d) __builtin_ia32_vpermilpd256 ((__v4df)(__m256d)(X), (int)(C)))
+
+#define _mm_permute_ps(X, C) \
+ ((__m128) __builtin_ia32_vpermilps ((__v4sf)(__m128)(X), (int)(C)))
+
+#define _mm256_permute_ps(X, C) \
+ ((__m256) __builtin_ia32_vpermilps256 ((__v8sf)(__m256)(X), (int)(C)))
+#endif
+
+#ifdef __OPTIMIZE__
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_permute2f128_pd (__m256d __X, __m256d __Y, const int __C)
+{
+ return (__m256d) __builtin_ia32_vperm2f128_pd256 ((__v4df)__X,
+ (__v4df)__Y,
+ __C);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_permute2f128_ps (__m256 __X, __m256 __Y, const int __C)
+{
+ return (__m256) __builtin_ia32_vperm2f128_ps256 ((__v8sf)__X,
+ (__v8sf)__Y,
+ __C);
+}
+
+extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_permute2f128_si256 (__m256i __X, __m256i __Y, const int __C)
+{
+ return (__m256i) __builtin_ia32_vperm2f128_si256 ((__v8si)__X,
+ (__v8si)__Y,
+ __C);
+}
+#else
+#define _mm256_permute2f128_pd(X, Y, C) \
+ ((__m256d) __builtin_ia32_vperm2f128_pd256 ((__v4df)(__m256d)(X), \
+ (__v4df)(__m256d)(Y), \
+ (int)(C)))
+
+#define _mm256_permute2f128_ps(X, Y, C) \
+ ((__m256) __builtin_ia32_vperm2f128_ps256 ((__v8sf)(__m256)(X), \
+ (__v8sf)(__m256)(Y), \
+ (int)(C)))
+
+#define _mm256_permute2f128_si256(X, Y, C) \
+ ((__m256i) __builtin_ia32_vperm2f128_si256 ((__v8si)(__m256i)(X), \
+ (__v8si)(__m256i)(Y), \
+ (int)(C)))
+#endif
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_broadcast_ss (float const *__X)
+{
+ return (__m128) __builtin_ia32_vbroadcastss (__X);
+}
+
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_broadcast_sd (double const *__X)
+{
+ return (__m256d) __builtin_ia32_vbroadcastsd256 (__X);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_broadcast_ss (float const *__X)
+{
+ return (__m256) __builtin_ia32_vbroadcastss256 (__X);
+}
+
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_broadcast_pd (__m128d const *__X)
+{
+ return (__m256d) __builtin_ia32_vbroadcastf128_pd256 (__X);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_broadcast_ps (__m128 const *__X)
+{
+ return (__m256) __builtin_ia32_vbroadcastf128_ps256 (__X);
+}
+
+#ifdef __OPTIMIZE__
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_insertf128_pd (__m256d __X, __m128d __Y, const int __O)
+{
+ return (__m256d) __builtin_ia32_vinsertf128_pd256 ((__v4df)__X,
+ (__v2df)__Y,
+ __O);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_insertf128_ps (__m256 __X, __m128 __Y, const int __O)
+{
+ return (__m256) __builtin_ia32_vinsertf128_ps256 ((__v8sf)__X,
+ (__v4sf)__Y,
+ __O);
+}
+
+extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_insertf128_si256 (__m256i __X, __m128i __Y, const int __O)
+{
+ return (__m256i) __builtin_ia32_vinsertf128_si256 ((__v8si)__X,
+ (__v4si)__Y,
+ __O);
+}
+
+extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_insert_epi32 (__m256i __X, int __D, int const __N)
+{
+ __m128i __Y = _mm256_extractf128_si256 (__X, __N >> 2);
+ __Y = _mm_insert_epi16 (__Y, __D, __N % 4);
+ return _mm256_insertf128_si256 (__X, __Y, __N >> 2);
+}
+
+extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_insert_epi16 (__m256i __X, int __D, int const __N)
+{
+ __m128i __Y = _mm256_extractf128_si256 (__X, __N >> 3);
+ __Y = _mm_insert_epi16 (__Y, __D, __N % 8);
+ return _mm256_insertf128_si256 (__X, __Y, __N >> 3);
+}
+
+extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_insert_epi8 (__m256i __X, int __D, int const __N)
+{
+ __m128i __Y = _mm256_extractf128_si256 (__X, __N >> 4);
+ __Y = _mm_insert_epi8 (__Y, __D, __N % 16);
+ return _mm256_insertf128_si256 (__X, __Y, __N >> 4);
+}
+
+#ifdef __x86_64__
+extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_insert_epi64 (__m256i __X, int __D, int const __N)
+{
+ __m128i __Y = _mm256_extractf128_si256 (__X, __N >> 1);
+ __Y = _mm_insert_epi16 (__Y, __D, __N % 2);
+ return _mm256_insertf128_si256 (__X, __Y, __N >> 1);
+}
+#endif
+#else
+#define _mm256_insertf128_pd(X, Y, O) \
+ ((__m256d) __builtin_ia32_vinsertf128_pd256 ((__v4df)(__m256d)(X), \
+ (__v2df)(__m128d)(Y), \
+ (int)(O)))
+
+#define _mm256_insertf128_ps(X, Y, O) \
+ ((__m256) __builtin_ia32_vinsertf128_ps256 ((__v8sf)(__m256)(X), \
+ (__v4sf)(__m128)(Y), \
+ (int)(O)))
+
+#define _mm256_insertf128_si256(X, Y, O) \
+ ((__m256i) __builtin_ia32_vinsertf128_si256 ((__v8si)(__m256i)(X), \
+ (__v4si)(__m128i)(Y), \
+ (int)(O)))
+
+#define _mm256_insert_epi32(X, D, N) \
+ (__extension__ \
+ ({ \
+ __m128i __Y = _mm256_extractf128_si256 ((X), (N) >> 2); \
+ __Y = _mm_insert_epi32 (__Y, (D), (N) % 4); \
+ _mm256_insertf128_si256 ((X), __Y, (N) >> 2); \
+ }))
+
+#define _mm256_insert_epi16(X, D, N) \
+ (__extension__ \
+ ({ \
+ __m128i __Y = _mm256_extractf128_si256 ((X), (N) >> 3); \
+ __Y = _mm_insert_epi16 (__Y, (D), (N) % 8); \
+ _mm256_insertf128_si256 ((X), __Y, (N) >> 3); \
+ }))
+
+#define _mm256_insert_epi8(X, D, N) \
+ (__extension__ \
+ ({ \
+ __m128i __Y = _mm256_extractf128_si256 ((X), (N) >> 4); \
+ __Y = _mm_insert_epi8 (__Y, (D), (N) % 16); \
+ _mm256_insertf128_si256 ((X), __Y, (N) >> 4); \
+ }))
+
+#ifdef __x86_64__
+#define _mm256_insert_epi64(X, D, N) \
+ (__extension__ \
+ ({ \
+ __m128i __Y = _mm256_extractf128_si256 ((X), (N) >> 1); \
+ __Y = _mm_insert_epi64 (__Y, (D), (N) % 2); \
+ _mm256_insertf128_si256 ((X), __Y, (N) >> 1); \
+ }))
+#endif
+#endif
+
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_load_pd (double const *__P)
+{
+ return *(__m256d *)__P;
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_store_pd (double *__P, __m256d __A)
+{
+ *(__m256d *)__P = __A;
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_load_ps (float const *__P)
+{
+ return *(__m256 *)__P;
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_store_ps (float *__P, __m256 __A)
+{
+ *(__m256 *)__P = __A;
+}
+
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_loadu_pd (double const *__P)
+{
+ return (__m256d) __builtin_ia32_loadupd256 (__P);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_storeu_pd (double *__P, __m256d __A)
+{
+ __builtin_ia32_storeupd256 (__P, (__v4df)__A);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_loadu_ps (float const *__P)
+{
+ return (__m256) __builtin_ia32_loadups256 (__P);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_storeu_ps (float *__P, __m256 __A)
+{
+ __builtin_ia32_storeups256 (__P, (__v8sf)__A);
+}
+
+extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_load_si256 (__m256i const *__P)
+{
+ return *__P;
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_store_si256 (__m256i *__P, __m256i __A)
+{
+ *__P = __A;
+}
+
+extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_loadu_si256 (__m256i const *__P)
+{
+ return (__m256i) __builtin_ia32_loaddqu256 ((char const *)__P);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_storeu_si256 (__m256i *__P, __m256i __A)
+{
+ __builtin_ia32_storedqu256 ((char *)__P, (__v32qi)__A);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_maskload_pd (double const *__P, __m128d __M)
+{
+ return (__m128d) __builtin_ia32_maskloadpd ((const __v2df *)__P,
+ (__v2df)__M);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_maskstore_pd (double *__P, __m128d __M, __m128d __A)
+{
+ __builtin_ia32_maskstorepd ((__v2df *)__P, (__v2df)__M, (__v2df)__A);
+}
+
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_maskload_pd (double const *__P, __m256d __M)
+{
+ return (__m256d) __builtin_ia32_maskloadpd256 ((const __v4df *)__P,
+ (__v4df)__M);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_maskstore_pd (double *__P, __m256d __M, __m256d __A)
+{
+ __builtin_ia32_maskstorepd256 ((__v4df *)__P, (__v4df)__M, (__v4df)__A);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_maskload_ps (float const *__P, __m128 __M)
+{
+ return (__m128) __builtin_ia32_maskloadps ((const __v4sf *)__P,
+ (__v4sf)__M);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_maskstore_ps (float *__P, __m128 __M, __m128 __A)
+{
+ __builtin_ia32_maskstoreps ((__v4sf *)__P, (__v4sf)__M, (__v4sf)__A);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_maskload_ps (float const *__P, __m256 __M)
+{
+ return (__m256) __builtin_ia32_maskloadps256 ((const __v8sf *)__P,
+ (__v8sf)__M);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_maskstore_ps (float *__P, __m256 __M, __m256 __A)
+{
+ __builtin_ia32_maskstoreps256 ((__v8sf *)__P, (__v8sf)__M, (__v8sf)__A);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_movehdup_ps (__m256 __X)
+{
+ return (__m256) __builtin_ia32_movshdup256 ((__v8sf)__X);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_moveldup_ps (__m256 __X)
+{
+ return (__m256) __builtin_ia32_movsldup256 ((__v8sf)__X);
+}
+
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_movedup_pd (__m256d __X)
+{
+ return (__m256d) __builtin_ia32_movddup256 ((__v4df)__X);
+}
+
+extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_lddqu_si256 (__m256i const *__P)
+{
+ return (__m256i) __builtin_ia32_lddqu256 ((char const *)__P);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_stream_si256 (__m256i *__A, __m256i __B)
+{
+ __builtin_ia32_movntdq256 ((__v4di *)__A, (__v4di)__B);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_stream_pd (double *__A, __m256d __B)
+{
+ __builtin_ia32_movntpd256 (__A, (__v4df)__B);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_stream_ps (float *__P, __m256 __A)
+{
+ __builtin_ia32_movntps256 (__P, (__v8sf)__A);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_rcp_ps (__m256 __A)
+{
+ return (__m256) __builtin_ia32_rcpps256 ((__v8sf)__A);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_rsqrt_ps (__m256 __A)
+{
+ return (__m256) __builtin_ia32_rsqrtps256 ((__v8sf)__A);
+}
+
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_sqrt_pd (__m256d __A)
+{
+ return (__m256d) __builtin_ia32_sqrtpd256 ((__v4df)__A);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_sqrt_ps (__m256 __A)
+{
+ return (__m256) __builtin_ia32_sqrtps256 ((__v8sf)__A);
+}
+
+#ifdef __OPTIMIZE__
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_round_pd (__m256d __V, const int __M)
+{
+ return (__m256d) __builtin_ia32_roundpd256 ((__v4df)__V, __M);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_round_ps (__m256 __V, const int __M)
+{
+ return (__m256) __builtin_ia32_roundps256 ((__v8sf)__V, __M);
+}
+#else
+#define _mm256_round_pd(V, M) \
+ ((__m256d) __builtin_ia32_roundpd256 ((__v4df)(__m256d)(V), (int)(M)))
+
+#define _mm256_round_ps(V, M) \
+ ((__m256) __builtin_ia32_roundps256 ((__v8sf)(__m256)(V), (int)(M)))
+#endif
+
+#define _mm256_ceil_pd(V) _mm256_round_pd ((V), _MM_FROUND_CEIL)
+#define _mm256_floor_pd(V) _mm256_round_pd ((V), _MM_FROUND_FLOOR)
+#define _mm256_ceil_ps(V) _mm256_round_ps ((V), _MM_FROUND_CEIL)
+#define _mm256_floor_ps(V) _mm256_round_ps ((V), _MM_FROUND_FLOOR)
+
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_unpackhi_pd (__m256d __A, __m256d __B)
+{
+ return (__m256d) __builtin_ia32_unpckhpd256 ((__v4df)__A, (__v4df)__B);
+}
+
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_unpacklo_pd (__m256d __A, __m256d __B)
+{
+ return (__m256d) __builtin_ia32_unpcklpd256 ((__v4df)__A, (__v4df)__B);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_unpackhi_ps (__m256 __A, __m256 __B)
+{
+ return (__m256) __builtin_ia32_unpckhps256 ((__v8sf)__A, (__v8sf)__B);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_unpacklo_ps (__m256 __A, __m256 __B)
+{
+ return (__m256) __builtin_ia32_unpcklps256 ((__v8sf)__A, (__v8sf)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_testz_pd (__m128d __M, __m128d __V)
+{
+ return __builtin_ia32_vtestzpd ((__v2df)__M, (__v2df)__V);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_testc_pd (__m128d __M, __m128d __V)
+{
+ return __builtin_ia32_vtestcpd ((__v2df)__M, (__v2df)__V);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_testnzc_pd (__m128d __M, __m128d __V)
+{
+ return __builtin_ia32_vtestnzcpd ((__v2df)__M, (__v2df)__V);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_testz_ps (__m128 __M, __m128 __V)
+{
+ return __builtin_ia32_vtestzps ((__v4sf)__M, (__v4sf)__V);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_testc_ps (__m128 __M, __m128 __V)
+{
+ return __builtin_ia32_vtestcps ((__v4sf)__M, (__v4sf)__V);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_testnzc_ps (__m128 __M, __m128 __V)
+{
+ return __builtin_ia32_vtestnzcps ((__v4sf)__M, (__v4sf)__V);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_testz_pd (__m256d __M, __m256d __V)
+{
+ return __builtin_ia32_vtestzpd256 ((__v4df)__M, (__v4df)__V);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_testc_pd (__m256d __M, __m256d __V)
+{
+ return __builtin_ia32_vtestcpd256 ((__v4df)__M, (__v4df)__V);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_testnzc_pd (__m256d __M, __m256d __V)
+{
+ return __builtin_ia32_vtestnzcpd256 ((__v4df)__M, (__v4df)__V);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_testz_ps (__m256 __M, __m256 __V)
+{
+ return __builtin_ia32_vtestzps256 ((__v8sf)__M, (__v8sf)__V);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_testc_ps (__m256 __M, __m256 __V)
+{
+ return __builtin_ia32_vtestcps256 ((__v8sf)__M, (__v8sf)__V);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_testnzc_ps (__m256 __M, __m256 __V)
+{
+ return __builtin_ia32_vtestnzcps256 ((__v8sf)__M, (__v8sf)__V);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_testz_si256 (__m256i __M, __m256i __V)
+{
+ return __builtin_ia32_ptestz256 ((__v4di)__M, (__v4di)__V);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_testc_si256 (__m256i __M, __m256i __V)
+{
+ return __builtin_ia32_ptestc256 ((__v4di)__M, (__v4di)__V);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_testnzc_si256 (__m256i __M, __m256i __V)
+{
+ return __builtin_ia32_ptestnzc256 ((__v4di)__M, (__v4di)__V);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_movemask_pd (__m256d __A)
+{
+ return __builtin_ia32_movmskpd256 ((__v4df)__A);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_movemask_ps (__m256 __A)
+{
+ return __builtin_ia32_movmskps256 ((__v8sf)__A);
+}
+
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_setzero_pd (void)
+{
+ return __extension__ (__m256d){ 0.0, 0.0, 0.0, 0.0 };
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_setzero_ps (void)
+{
+ return __extension__ (__m256){ 0.0, 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0, 0.0 };
+}
+
+extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_setzero_si256 (void)
+{
+ return __extension__ (__m256i)(__v4di){ 0, 0, 0, 0 };
+}
+
+/* Create the vector [A B C D]. */
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_set_pd (double __A, double __B, double __C, double __D)
+{
+ return __extension__ (__m256d){ __D, __C, __B, __A };
+}
+
+/* Create the vector [A B C D E F G H]. */
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_set_ps (float __A, float __B, float __C, float __D,
+ float __E, float __F, float __G, float __H)
+{
+ return __extension__ (__m256){ __H, __G, __F, __E,
+ __D, __C, __B, __A };
+}
+
+/* Create the vector [A B C D E F G H]. */
+extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_set_epi32 (int __A, int __B, int __C, int __D,
+ int __E, int __F, int __G, int __H)
+{
+ return __extension__ (__m256i)(__v8si){ __H, __G, __F, __E,
+ __D, __C, __B, __A };
+}
+
+extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_set_epi16 (short __q15, short __q14, short __q13, short __q12,
+ short __q11, short __q10, short __q09, short __q08,
+ short __q07, short __q06, short __q05, short __q04,
+ short __q03, short __q02, short __q01, short __q00)
+{
+ return __extension__ (__m256i)(__v16hi){
+ __q00, __q01, __q02, __q03, __q04, __q05, __q06, __q07,
+ __q08, __q09, __q10, __q11, __q12, __q13, __q14, __q15
+ };
+}
+
+extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_set_epi8 (char __q31, char __q30, char __q29, char __q28,
+ char __q27, char __q26, char __q25, char __q24,
+ char __q23, char __q22, char __q21, char __q20,
+ char __q19, char __q18, char __q17, char __q16,
+ char __q15, char __q14, char __q13, char __q12,
+ char __q11, char __q10, char __q09, char __q08,
+ char __q07, char __q06, char __q05, char __q04,
+ char __q03, char __q02, char __q01, char __q00)
+{
+ return __extension__ (__m256i)(__v32qi){
+ __q00, __q01, __q02, __q03, __q04, __q05, __q06, __q07,
+ __q08, __q09, __q10, __q11, __q12, __q13, __q14, __q15,
+ __q16, __q17, __q18, __q19, __q20, __q21, __q22, __q23,
+ __q24, __q25, __q26, __q27, __q28, __q29, __q30, __q31
+ };
+}
+
+extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_set_epi64x (long long __A, long long __B, long long __C,
+ long long __D)
+{
+ return __extension__ (__m256i)(__v4di){ __D, __C, __B, __A };
+}
+
+/* Create a vector with all elements equal to A. */
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_set1_pd (double __A)
+{
+ return __extension__ (__m256d){ __A, __A, __A, __A };
+}
+
+/* Create a vector with all elements equal to A. */
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_set1_ps (float __A)
+{
+ return __extension__ (__m256){ __A, __A, __A, __A,
+ __A, __A, __A, __A };
+}
+
+/* Create a vector with all elements equal to A. */
+extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_set1_epi32 (int __A)
+{
+ return __extension__ (__m256i)(__v8si){ __A, __A, __A, __A,
+ __A, __A, __A, __A };
+}
+
+extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_set1_epi16 (short __A)
+{
+ return _mm256_set_epi16 (__A, __A, __A, __A, __A, __A, __A, __A,
+ __A, __A, __A, __A, __A, __A, __A, __A);
+}
+
+extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_set1_epi8 (char __A)
+{
+ return _mm256_set_epi8 (__A, __A, __A, __A, __A, __A, __A, __A,
+ __A, __A, __A, __A, __A, __A, __A, __A,
+ __A, __A, __A, __A, __A, __A, __A, __A,
+ __A, __A, __A, __A, __A, __A, __A, __A);
+}
+
+extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_set1_epi64x (long long __A)
+{
+ return __extension__ (__m256i)(__v4di){ __A, __A, __A, __A };
+}
+
+/* Create vectors of elements in the reversed order from the
+ _mm256_set_XXX functions. */
+
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_setr_pd (double __A, double __B, double __C, double __D)
+{
+ return _mm256_set_pd (__D, __C, __B, __A);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_setr_ps (float __A, float __B, float __C, float __D,
+ float __E, float __F, float __G, float __H)
+{
+ return _mm256_set_ps (__H, __G, __F, __E, __D, __C, __B, __A);
+}
+
+extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_setr_epi32 (int __A, int __B, int __C, int __D,
+ int __E, int __F, int __G, int __H)
+{
+ return _mm256_set_epi32 (__H, __G, __F, __E, __D, __C, __B, __A);
+}
+
+extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_setr_epi16 (short __q15, short __q14, short __q13, short __q12,
+ short __q11, short __q10, short __q09, short __q08,
+ short __q07, short __q06, short __q05, short __q04,
+ short __q03, short __q02, short __q01, short __q00)
+{
+ return _mm256_set_epi16 (__q00, __q01, __q02, __q03,
+ __q04, __q05, __q06, __q07,
+ __q08, __q09, __q10, __q11,
+ __q12, __q13, __q14, __q15);
+}
+
+extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_setr_epi8 (char __q31, char __q30, char __q29, char __q28,
+ char __q27, char __q26, char __q25, char __q24,
+ char __q23, char __q22, char __q21, char __q20,
+ char __q19, char __q18, char __q17, char __q16,
+ char __q15, char __q14, char __q13, char __q12,
+ char __q11, char __q10, char __q09, char __q08,
+ char __q07, char __q06, char __q05, char __q04,
+ char __q03, char __q02, char __q01, char __q00)
+{
+ return _mm256_set_epi8 (__q00, __q01, __q02, __q03,
+ __q04, __q05, __q06, __q07,
+ __q08, __q09, __q10, __q11,
+ __q12, __q13, __q14, __q15,
+ __q16, __q17, __q18, __q19,
+ __q20, __q21, __q22, __q23,
+ __q24, __q25, __q26, __q27,
+ __q28, __q29, __q30, __q31);
+}
+
+extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_setr_epi64x (long long __A, long long __B, long long __C,
+ long long __D)
+{
+ return _mm256_set_epi64x (__D, __C, __B, __A);
+}
+
+/* Casts between various SP, DP, INT vector types. Note that these do no
+ conversion of values, they just change the type. */
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_castpd_ps (__m256d __A)
+{
+ return (__m256) __A;
+}
+
+extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_castpd_si256 (__m256d __A)
+{
+ return (__m256i) __A;
+}
+
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_castps_pd (__m256 __A)
+{
+ return (__m256d) __A;
+}
+
+extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_castps_si256(__m256 __A)
+{
+ return (__m256i) __A;
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_castsi256_ps (__m256i __A)
+{
+ return (__m256) __A;
+}
+
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_castsi256_pd (__m256i __A)
+{
+ return (__m256d) __A;
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_castpd256_pd128 (__m256d __A)
+{
+ return (__m128d) __builtin_ia32_pd_pd256 ((__v4df)__A);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_castps256_ps128 (__m256 __A)
+{
+ return (__m128) __builtin_ia32_ps_ps256 ((__v8sf)__A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_castsi256_si128 (__m256i __A)
+{
+ return (__m128i) __builtin_ia32_si_si256 ((__v8si)__A);
+}
+
+/* When cast is done from a 128 to 256-bit type, the low 128 bits of
+ the 256-bit result contain source parameter value and the upper 128
+ bits of the result are undefined. Those intrinsics shouldn't
+ generate any extra moves. */
+
+extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_castpd128_pd256 (__m128d __A)
+{
+ return (__m256d) __builtin_ia32_pd256_pd ((__v2df)__A);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_castps128_ps256 (__m128 __A)
+{
+ return (__m256) __builtin_ia32_ps256_ps ((__v4sf)__A);
+}
+
+extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_castsi128_si256 (__m128i __A)
+{
+ return (__m256i) __builtin_ia32_si256_si ((__v4si)__A);
+}
diff --git a/lib/gcc/i686-linux/4.4.3/include/bmmintrin.h b/lib/gcc/i686-linux/4.4.3/include/bmmintrin.h
new file mode 100644
index 0000000..e92768c
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include/bmmintrin.h
@@ -0,0 +1,1261 @@
+/* Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ GCC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _BMMINTRIN_H_INCLUDED
+#define _BMMINTRIN_H_INCLUDED
+
+#ifndef __SSE5__
+# error "SSE5 instruction set not enabled"
+#else
+
+/* We need definitions from the SSE4A, SSE3, SSE2 and SSE header files. */
+#include <ammintrin.h>
+#include <mmintrin-common.h>
+
+/* Floating point multiply/add type instructions */
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_macc_ps(__m128 __A, __m128 __B, __m128 __C)
+{
+ return (__m128) __builtin_ia32_fmaddps ((__v4sf)__A, (__v4sf)__B, (__v4sf)__C);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_macc_pd(__m128d __A, __m128d __B, __m128d __C)
+{
+ return (__m128d) __builtin_ia32_fmaddpd ((__v2df)__A, (__v2df)__B, (__v2df)__C);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_macc_ss(__m128 __A, __m128 __B, __m128 __C)
+{
+ return (__m128) __builtin_ia32_fmaddss ((__v4sf)__A, (__v4sf)__B, (__v4sf)__C);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_macc_sd(__m128d __A, __m128d __B, __m128d __C)
+{
+ return (__m128d) __builtin_ia32_fmaddsd ((__v2df)__A, (__v2df)__B, (__v2df)__C);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_msub_ps(__m128 __A, __m128 __B, __m128 __C)
+{
+ return (__m128) __builtin_ia32_fmsubps ((__v4sf)__A, (__v4sf)__B, (__v4sf)__C);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_msub_pd(__m128d __A, __m128d __B, __m128d __C)
+{
+ return (__m128d) __builtin_ia32_fmsubpd ((__v2df)__A, (__v2df)__B, (__v2df)__C);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_msub_ss(__m128 __A, __m128 __B, __m128 __C)
+{
+ return (__m128) __builtin_ia32_fmsubss ((__v4sf)__A, (__v4sf)__B, (__v4sf)__C);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_msub_sd(__m128d __A, __m128d __B, __m128d __C)
+{
+ return (__m128d) __builtin_ia32_fmsubsd ((__v2df)__A, (__v2df)__B, (__v2df)__C);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_nmacc_ps(__m128 __A, __m128 __B, __m128 __C)
+{
+ return (__m128) __builtin_ia32_fnmaddps ((__v4sf)__A, (__v4sf)__B, (__v4sf)__C);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_nmacc_pd(__m128d __A, __m128d __B, __m128d __C)
+{
+ return (__m128d) __builtin_ia32_fnmaddpd ((__v2df)__A, (__v2df)__B, (__v2df)__C);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_nmacc_ss(__m128 __A, __m128 __B, __m128 __C)
+{
+ return (__m128) __builtin_ia32_fnmaddss ((__v4sf)__A, (__v4sf)__B, (__v4sf)__C);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_nmacc_sd(__m128d __A, __m128d __B, __m128d __C)
+{
+ return (__m128d) __builtin_ia32_fnmaddsd ((__v2df)__A, (__v2df)__B, (__v2df)__C);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_nmsub_ps(__m128 __A, __m128 __B, __m128 __C)
+{
+ return (__m128) __builtin_ia32_fnmsubps ((__v4sf)__A, (__v4sf)__B, (__v4sf)__C);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_nmsub_pd(__m128d __A, __m128d __B, __m128d __C)
+{
+ return (__m128d) __builtin_ia32_fnmsubpd ((__v2df)__A, (__v2df)__B, (__v2df)__C);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_nmsub_ss(__m128 __A, __m128 __B, __m128 __C)
+{
+ return (__m128) __builtin_ia32_fnmsubss ((__v4sf)__A, (__v4sf)__B, (__v4sf)__C);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_nmsub_sd(__m128d __A, __m128d __B, __m128d __C)
+{
+ return (__m128d) __builtin_ia32_fnmsubsd ((__v2df)__A, (__v2df)__B, (__v2df)__C);
+}
+
+/* Integer multiply/add intructions. */
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_maccs_epi16(__m128i __A, __m128i __B, __m128i __C)
+{
+ return (__m128i) __builtin_ia32_pmacssww ((__v8hi)__A,(__v8hi)__B, (__v8hi)__C);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_macc_epi16(__m128i __A, __m128i __B, __m128i __C)
+{
+ return (__m128i) __builtin_ia32_pmacsww ((__v8hi)__A, (__v8hi)__B, (__v8hi)__C);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_maccsd_epi16(__m128i __A, __m128i __B, __m128i __C)
+{
+ return (__m128i) __builtin_ia32_pmacsswd ((__v8hi)__A, (__v8hi)__B, (__v4si)__C);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_maccd_epi16(__m128i __A, __m128i __B, __m128i __C)
+{
+ return (__m128i) __builtin_ia32_pmacswd ((__v8hi)__A, (__v8hi)__B, (__v4si)__C);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_maccs_epi32(__m128i __A, __m128i __B, __m128i __C)
+{
+ return (__m128i) __builtin_ia32_pmacssdd ((__v4si)__A, (__v4si)__B, (__v4si)__C);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_macc_epi32(__m128i __A, __m128i __B, __m128i __C)
+{
+ return (__m128i) __builtin_ia32_pmacsdd ((__v4si)__A, (__v4si)__B, (__v4si)__C);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_maccslo_epi32(__m128i __A, __m128i __B, __m128i __C)
+{
+ return (__m128i) __builtin_ia32_pmacssdql ((__v4si)__A, (__v4si)__B, (__v2di)__C);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_macclo_epi32(__m128i __A, __m128i __B, __m128i __C)
+{
+ return (__m128i) __builtin_ia32_pmacsdql ((__v4si)__A, (__v4si)__B, (__v2di)__C);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_maccshi_epi32(__m128i __A, __m128i __B, __m128i __C)
+{
+ return (__m128i) __builtin_ia32_pmacssdqh ((__v4si)__A, (__v4si)__B, (__v2di)__C);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_macchi_epi32(__m128i __A, __m128i __B, __m128i __C)
+{
+ return (__m128i) __builtin_ia32_pmacsdqh ((__v4si)__A, (__v4si)__B, (__v2di)__C);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_maddsd_epi16(__m128i __A, __m128i __B, __m128i __C)
+{
+ return (__m128i) __builtin_ia32_pmadcsswd ((__v8hi)__A,(__v8hi)__B,(__v4si)__C);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_maddd_epi16(__m128i __A, __m128i __B, __m128i __C)
+{
+ return (__m128i) __builtin_ia32_pmadcswd ((__v8hi)__A,(__v8hi)__B,(__v4si)__C);
+}
+
+/* Packed Integer Horizontal Add and Subtract */
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_haddw_epi8(__m128i __A)
+{
+ return (__m128i) __builtin_ia32_phaddbw ((__v16qi)__A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_haddd_epi8(__m128i __A)
+{
+ return (__m128i) __builtin_ia32_phaddbd ((__v16qi)__A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_haddq_epi8(__m128i __A)
+{
+ return (__m128i) __builtin_ia32_phaddbq ((__v16qi)__A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_haddd_epi16(__m128i __A)
+{
+ return (__m128i) __builtin_ia32_phaddwd ((__v8hi)__A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_haddq_epi16(__m128i __A)
+{
+ return (__m128i) __builtin_ia32_phaddwq ((__v8hi)__A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_haddq_epi32(__m128i __A)
+{
+ return (__m128i) __builtin_ia32_phadddq ((__v4si)__A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_haddw_epu8(__m128i __A)
+{
+ return (__m128i) __builtin_ia32_phaddubw ((__v16qi)__A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_haddd_epu8(__m128i __A)
+{
+ return (__m128i) __builtin_ia32_phaddubd ((__v16qi)__A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_haddq_epu8(__m128i __A)
+{
+ return (__m128i) __builtin_ia32_phaddubq ((__v16qi)__A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_haddd_epu16(__m128i __A)
+{
+ return (__m128i) __builtin_ia32_phadduwd ((__v8hi)__A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_haddq_epu16(__m128i __A)
+{
+ return (__m128i) __builtin_ia32_phadduwq ((__v8hi)__A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_haddq_epu32(__m128i __A)
+{
+ return (__m128i) __builtin_ia32_phaddudq ((__v4si)__A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_hsubw_epi8(__m128i __A)
+{
+ return (__m128i) __builtin_ia32_phsubbw ((__v16qi)__A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_hsubd_epi16(__m128i __A)
+{
+ return (__m128i) __builtin_ia32_phsubwd ((__v8hi)__A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_hsubq_epi32(__m128i __A)
+{
+ return (__m128i) __builtin_ia32_phsubdq ((__v4si)__A);
+}
+
+/* Vector conditional move and permute */
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmov_si128(__m128i __A, __m128i __B, __m128i __C)
+{
+ return (__m128i) __builtin_ia32_pcmov (__A, __B, __C);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_perm_epi8(__m128i __A, __m128i __B, __m128i __C)
+{
+ return (__m128i) __builtin_ia32_pperm ((__v16qi)__A, (__v16qi)__B, (__v16qi)__C);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_perm_ps(__m128 __A, __m128 __B, __m128i __C)
+{
+ return (__m128) __builtin_ia32_permps ((__m128)__A, (__m128)__B, (__v16qi)__C);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_perm_pd(__m128d __A, __m128d __B, __m128i __C)
+{
+ return (__m128d) __builtin_ia32_permpd ((__m128d)__A, (__m128d)__B, (__v16qi)__C);
+}
+
+/* Packed Integer Rotates and Shifts */
+
+/* Rotates - Non-Immediate form */
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_rot_epi8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_protb ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_rot_epi16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_protw ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_rot_epi32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_protd ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_rot_epi64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_protq ((__v2di)__A, (__v2di)__B);
+}
+
+
+/* Rotates - Immediate form */
+#ifdef __OPTIMIZE__
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_roti_epi8(__m128i __A, const int __B)
+{
+ return (__m128i) __builtin_ia32_protbi ((__v16qi)__A, __B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_roti_epi16(__m128i __A, const int __B)
+{
+ return (__m128i) __builtin_ia32_protwi ((__v8hi)__A, __B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_roti_epi32(__m128i __A, const int __B)
+{
+ return (__m128i) __builtin_ia32_protdi ((__v4si)__A, __B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_roti_epi64(__m128i __A, const int __B)
+{
+ return (__m128i) __builtin_ia32_protqi ((__v2di)__A, __B);
+}
+#else
+#define _mm_roti_epi8(A, N) \
+ ((__m128i) __builtin_ia32_protbi ((__v16qi)(__m128i)(A), (int)(N)))
+#define _mm_roti_epi16(A, N) \
+ ((__m128i) __builtin_ia32_protwi ((__v8hi)(__m128i)(A), (int)(N)))
+#define _mm_roti_epi32(A, N) \
+ ((__m128i) __builtin_ia32_protdi ((__v4si)(__m128i)(A), (int)(N)))
+#define _mm_roti_epi64(A, N) \
+ ((__m128i) __builtin_ia32_protqi ((__v2di)(__m128i)(A), (int)(N)))
+#endif
+
+/* pshl */
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_shl_epi8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pshlb ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_shl_epi16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pshlw ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_shl_epi32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pshld ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_shl_epi64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pshlq ((__v2di)__A, (__v2di)__B);
+}
+
+/* psha */
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sha_epi8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pshab ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sha_epi16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pshaw ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sha_epi32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pshad ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sha_epi64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pshaq ((__v2di)__A, (__v2di)__B);
+}
+
+/* Compare and Predicate Generation */
+
+/* com (floating point, packed single) */
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comeq_ps(__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_comeqps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comlt_ps(__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_comltps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comle_ps(__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_comleps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comunord_ps(__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_comunordps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comneq_ps(__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_comuneqps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comnlt_ps(__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_comunltps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comnle_ps(__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_comunleps ((__v4sf)__A, (__v4sf)__B);
+}
+
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comord_ps(__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_comordps ((__v4sf)__A, (__v4sf)__B);
+}
+
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comueq_ps(__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_comueqps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comnge_ps(__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_comungeps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comngt_ps(__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_comungtps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comfalse_ps(__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_comfalseps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comoneq_ps(__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_comneqps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comge_ps(__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_comgeps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comgt_ps(__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_comgtps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comtrue_ps(__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_comtrueps ((__v4sf)__A, (__v4sf)__B);
+}
+
+/* com (floating point, packed double) */
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comeq_pd(__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_comeqpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comlt_pd(__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_comltpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comle_pd(__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_comlepd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comunord_pd(__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_comunordpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comneq_pd(__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_comuneqpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comnlt_pd(__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_comunltpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comnle_pd(__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_comunlepd ((__v2df)__A, (__v2df)__B);
+}
+
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comord_pd(__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_comordpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comueq_pd(__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_comueqpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comnge_pd(__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_comungepd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comngt_pd(__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_comungtpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comfalse_pd(__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_comfalsepd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comoneq_pd(__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_comneqpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comge_pd(__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_comgepd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comgt_pd(__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_comgtpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comtrue_pd(__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_comtruepd ((__v2df)__A, (__v2df)__B);
+}
+
+/* com (floating point, scalar single) */
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comeq_ss(__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_comeqss ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comlt_ss(__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_comltss ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comle_ss(__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_comless ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comunord_ss(__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_comunordss ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comneq_ss(__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_comuneqss ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comnlt_ss(__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_comunltss ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comnle_ss(__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_comunless ((__v4sf)__A, (__v4sf)__B);
+}
+
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comord_ss(__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_comordss ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comueq_ss(__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_comueqss ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comnge_ss(__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_comungess ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comngt_ss(__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_comungtss ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comfalse_ss(__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_comfalsess ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comoneq_ss(__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_comneqss ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comge_ss(__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_comgess ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comgt_ss(__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_comgtss ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comtrue_ss(__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_comtruess ((__v4sf)__A, (__v4sf)__B);
+}
+
+/* com (floating point, scalar double) */
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comeq_sd(__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_comeqsd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comlt_sd(__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_comltsd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comle_sd(__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_comlesd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comunord_sd(__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_comunordsd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comneq_sd(__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_comuneqsd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comnlt_sd(__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_comunltsd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comnle_sd(__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_comunlesd ((__v2df)__A, (__v2df)__B);
+}
+
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comord_sd(__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_comordsd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comueq_sd(__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_comueqsd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comnge_sd(__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_comungesd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comngt_sd(__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_comungtsd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comfalse_sd(__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_comfalsesd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comoneq_sd(__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_comneqsd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comge_sd(__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_comgesd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comgt_sd(__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_comgtsd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comtrue_sd(__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_comtruesd ((__v2df)__A, (__v2df)__B);
+}
+
+
+/*pcom (integer, unsinged bytes) */
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comlt_epu8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomltub ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comle_epu8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomleub ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comgt_epu8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomgtub ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comge_epu8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomgeub ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comeq_epu8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomequb ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comneq_epu8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomnequb ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comfalse_epu8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomfalseub ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comtrue_epu8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomtrueub ((__v16qi)__A, (__v16qi)__B);
+}
+
+/*pcom (integer, unsinged words) */
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comlt_epu16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomltuw ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comle_epu16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomleuw ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comgt_epu16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomgtuw ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comge_epu16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomgeuw ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comeq_epu16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomequw ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comneq_epu16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomnequw ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comfalse_epu16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomfalseuw ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comtrue_epu16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomtrueuw ((__v8hi)__A, (__v8hi)__B);
+}
+
+/*pcom (integer, unsinged double words) */
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comlt_epu32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomltud ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comle_epu32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomleud ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comgt_epu32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomgtud ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comge_epu32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomgeud ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comeq_epu32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomequd ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comneq_epu32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomnequd ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comfalse_epu32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomfalseud ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comtrue_epu32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomtrueud ((__v4si)__A, (__v4si)__B);
+}
+
+/*pcom (integer, unsinged quad words) */
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comlt_epu64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomltuq ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comle_epu64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomleuq ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comgt_epu64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomgtuq ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comge_epu64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomgeuq ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comeq_epu64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomequq ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comneq_epu64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomnequq ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comfalse_epu64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomfalseuq ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comtrue_epu64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomtrueuq ((__v2di)__A, (__v2di)__B);
+}
+
+/*pcom (integer, signed bytes) */
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comlt_epi8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomltb ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comle_epi8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomleb ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comgt_epi8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomgtb ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comge_epi8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomgeb ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comeq_epi8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomeqb ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comneq_epi8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomneqb ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comfalse_epi8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomfalseb ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comtrue_epi8(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomtrueb ((__v16qi)__A, (__v16qi)__B);
+}
+
+/*pcom (integer, signed words) */
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comlt_epi16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomltw ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comle_epi16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomlew ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comgt_epi16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomgtw ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comge_epi16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomgew ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comeq_epi16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomeqw ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comneq_epi16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomneqw ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comfalse_epi16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomfalsew ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comtrue_epi16(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomtruew ((__v8hi)__A, (__v8hi)__B);
+}
+
+/*pcom (integer, signed double words) */
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comlt_epi32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomltd ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comle_epi32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomled ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comgt_epi32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomgtd ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comge_epi32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomged ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comeq_epi32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomeqd ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comneq_epi32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomneqd ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comfalse_epi32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomfalsed ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comtrue_epi32(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomtrued ((__v4si)__A, (__v4si)__B);
+}
+
+/*pcom (integer, signed quad words) */
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comlt_epi64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomltq ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comle_epi64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomleq ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comgt_epi64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomgtq ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comge_epi64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomgeq ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comeq_epi64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomeqq ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comneq_epi64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomneqq ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comfalse_epi64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomfalseq ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comtrue_epi64(__m128i __A, __m128i __B)
+{
+ return (__m128i) __builtin_ia32_pcomtrueq ((__v2di)__A, (__v2di)__B);
+}
+
+/* FRCZ */
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_frcz_ps (__m128 __A)
+{
+ return (__m128) __builtin_ia32_frczps ((__v4sf)__A);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_frcz_pd (__m128d __A)
+{
+ return (__m128d) __builtin_ia32_frczpd ((__v2df)__A);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_frcz_ss (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_frczss ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_frcz_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_frczsd ((__v2df)__A, (__v2df)__B);
+}
+
+#endif /* __SSE5__ */
+
+#endif /* _BMMINTRIN_H_INCLUDED */
diff --git a/lib/gcc/i686-linux/4.4.3/include/cpuid.h b/lib/gcc/i686-linux/4.4.3/include/cpuid.h
new file mode 100644
index 0000000..003c202
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include/cpuid.h
@@ -0,0 +1,179 @@
+/*
+ * Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+ *
+ * This file is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 3, or (at your option) any
+ * later version.
+ *
+ * This file is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * Under Section 7 of GPL version 3, you are granted additional
+ * permissions described in the GCC Runtime Library Exception, version
+ * 3.1, as published by the Free Software Foundation.
+ *
+ * You should have received a copy of the GNU General Public License and
+ * a copy of the GCC Runtime Library Exception along with this program;
+ * see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ * <http://www.gnu.org/licenses/>.
+ */
+
+/* %ecx */
+#define bit_SSE3 (1 << 0)
+#define bit_PCLMUL (1 << 1)
+#define bit_SSSE3 (1 << 9)
+#define bit_FMA (1 << 12)
+#define bit_CMPXCHG16B (1 << 13)
+#define bit_SSE4_1 (1 << 19)
+#define bit_SSE4_2 (1 << 20)
+#define bit_MOVBE (1 << 22)
+#define bit_POPCNT (1 << 23)
+#define bit_AES (1 << 25)
+#define bit_XSAVE (1 << 26)
+#define bit_OSXSAVE (1 << 27)
+#define bit_AVX (1 << 28)
+
+/* %edx */
+#define bit_CMPXCHG8B (1 << 8)
+#define bit_CMOV (1 << 15)
+#define bit_MMX (1 << 23)
+#define bit_FXSAVE (1 << 24)
+#define bit_SSE (1 << 25)
+#define bit_SSE2 (1 << 26)
+
+/* Extended Features */
+/* %ecx */
+#define bit_LAHF_LM (1 << 0)
+#define bit_LWP (1 << 15)
+#define bit_SSE4a (1 << 6)
+#define bit_SSE5 (1 << 11)
+
+/* %edx */
+#define bit_LM (1 << 29)
+#define bit_3DNOWP (1 << 30)
+#define bit_3DNOW (1 << 31)
+
+
+#if defined(__i386__) && defined(__PIC__)
+/* %ebx may be the PIC register. */
+#if __GNUC__ >= 3
+#define __cpuid(level, a, b, c, d) \
+ __asm__ ("xchg{l}\t{%%}ebx, %1\n\t" \
+ "cpuid\n\t" \
+ "xchg{l}\t{%%}ebx, %1\n\t" \
+ : "=a" (a), "=r" (b), "=c" (c), "=d" (d) \
+ : "0" (level))
+
+#define __cpuid_count(level, count, a, b, c, d) \
+ __asm__ ("xchg{l}\t{%%}ebx, %1\n\t" \
+ "cpuid\n\t" \
+ "xchg{l}\t{%%}ebx, %1\n\t" \
+ : "=a" (a), "=r" (b), "=c" (c), "=d" (d) \
+ : "0" (level), "2" (count))
+#else
+/* Host GCCs older than 3.0 weren't supporting Intel asm syntax
+ nor alternatives in i386 code. */
+#define __cpuid(level, a, b, c, d) \
+ __asm__ ("xchgl\t%%ebx, %1\n\t" \
+ "cpuid\n\t" \
+ "xchgl\t%%ebx, %1\n\t" \
+ : "=a" (a), "=r" (b), "=c" (c), "=d" (d) \
+ : "0" (level))
+
+#define __cpuid_count(level, count, a, b, c, d) \
+ __asm__ ("xchgl\t%%ebx, %1\n\t" \
+ "cpuid\n\t" \
+ "xchgl\t%%ebx, %1\n\t" \
+ : "=a" (a), "=r" (b), "=c" (c), "=d" (d) \
+ : "0" (level), "2" (count))
+#endif
+#else
+#define __cpuid(level, a, b, c, d) \
+ __asm__ ("cpuid\n\t" \
+ : "=a" (a), "=b" (b), "=c" (c), "=d" (d) \
+ : "0" (level))
+
+#define __cpuid_count(level, count, a, b, c, d) \
+ __asm__ ("cpuid\n\t" \
+ : "=a" (a), "=b" (b), "=c" (c), "=d" (d) \
+ : "0" (level), "2" (count))
+#endif
+
+/* Return highest supported input value for cpuid instruction. ext can
+ be either 0x0 or 0x8000000 to return highest supported value for
+ basic or extended cpuid information. Function returns 0 if cpuid
+ is not supported or whatever cpuid returns in eax register. If sig
+ pointer is non-null, then first four bytes of the signature
+ (as found in ebx register) are returned in location pointed by sig. */
+
+static __inline unsigned int
+__get_cpuid_max (unsigned int __ext, unsigned int *__sig)
+{
+ unsigned int __eax, __ebx, __ecx, __edx;
+
+#ifndef __x86_64__
+#if __GNUC__ >= 3
+ /* See if we can use cpuid. On AMD64 we always can. */
+ __asm__ ("pushf{l|d}\n\t"
+ "pushf{l|d}\n\t"
+ "pop{l}\t%0\n\t"
+ "mov{l}\t{%0, %1|%1, %0}\n\t"
+ "xor{l}\t{%2, %0|%0, %2}\n\t"
+ "push{l}\t%0\n\t"
+ "popf{l|d}\n\t"
+ "pushf{l|d}\n\t"
+ "pop{l}\t%0\n\t"
+ "popf{l|d}\n\t"
+ : "=&r" (__eax), "=&r" (__ebx)
+ : "i" (0x00200000));
+#else
+/* Host GCCs older than 3.0 weren't supporting Intel asm syntax
+ nor alternatives in i386 code. */
+ __asm__ ("pushfl\n\t"
+ "pushfl\n\t"
+ "popl\t%0\n\t"
+ "movl\t%0, %1\n\t"
+ "xorl\t%2, %0\n\t"
+ "pushl\t%0\n\t"
+ "popfl\n\t"
+ "pushfl\n\t"
+ "popl\t%0\n\t"
+ "popfl\n\t"
+ : "=&r" (__eax), "=&r" (__ebx)
+ : "i" (0x00200000));
+#endif
+
+ if (!((__eax ^ __ebx) & 0x00200000))
+ return 0;
+#endif
+
+ /* Host supports cpuid. Return highest supported cpuid input value. */
+ __cpuid (__ext, __eax, __ebx, __ecx, __edx);
+
+ if (__sig)
+ *__sig = __ebx;
+
+ return __eax;
+}
+
+/* Return cpuid data for requested cpuid level, as found in returned
+ eax, ebx, ecx and edx registers. The function checks if cpuid is
+ supported and returns 1 for valid cpuid information or 0 for
+ unsupported cpuid level. All pointers are required to be non-null. */
+
+static __inline int
+__get_cpuid (unsigned int __level,
+ unsigned int *__eax, unsigned int *__ebx,
+ unsigned int *__ecx, unsigned int *__edx)
+{
+ unsigned int __ext = __level & 0x80000000;
+
+ if (__get_cpuid_max (__ext, 0) < __level)
+ return 0;
+
+ __cpuid (__level, *__eax, *__ebx, *__ecx, *__edx);
+ return 1;
+}
diff --git a/lib/gcc/i686-linux/4.4.3/include/cross-stdarg.h b/lib/gcc/i686-linux/4.4.3/include/cross-stdarg.h
new file mode 100644
index 0000000..7139ffa
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include/cross-stdarg.h
@@ -0,0 +1,73 @@
+/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+ Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ GCC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef __CROSS_STDARG_H_INCLUDED
+#define __CROSS_STDARG_H_INCLUDED
+
+/* Make sure that for non x64 targets cross builtins are defined. */
+#ifndef __x86_64__
+/* Call abi ms_abi. */
+#define __builtin_ms_va_list __builtin_va_list
+#define __builtin_ms_va_copy __builtin_va_copy
+#define __builtin_ms_va_start __builtin_va_start
+#define __builtin_ms_va_end __builtin_va_end
+
+/* Call abi sysv_abi. */
+#define __builtin_sysv_va_list __builtin_va_list
+#define __builtin_sysv_va_copy __builtin_va_copy
+#define __builtin_sysv_va_start __builtin_va_start
+#define __builtin_sysv_va_end __builtin_va_end
+#endif
+
+#define __ms_va_copy(__d,__s) __builtin_ms_va_copy(__d,__s)
+#define __ms_va_start(__v,__l) __builtin_ms_va_start(__v,__l)
+#define __ms_va_arg(__v,__l) __builtin_va_arg(__v,__l)
+#define __ms_va_end(__v) __builtin_ms_va_end(__v)
+
+#define __sysv_va_copy(__d,__s) __builtin_sysv_va_copy(__d,__s)
+#define __sysv_va_start(__v,__l) __builtin_sysv_va_start(__v,__l)
+#define __sysv_va_arg(__v,__l) __builtin_va_arg(__v,__l)
+#define __sysv_va_end(__v) __builtin_sysv_va_end(__v)
+
+#ifndef __GNUC_SYSV_VA_LIST
+#define __GNUC_SYSV_VA_LIST
+ typedef __builtin_sysv_va_list __gnuc_sysv_va_list;
+#endif
+
+#ifndef _SYSV_VA_LIST_DEFINED
+#define _SYSV_VA_LIST_DEFINED
+ typedef __gnuc_sysv_va_list sysv_va_list;
+#endif
+
+#ifndef __GNUC_MS_VA_LIST
+#define __GNUC_MS_VA_LIST
+ typedef __builtin_ms_va_list __gnuc_ms_va_list;
+#endif
+
+#ifndef _MS_VA_LIST_DEFINED
+#define _MS_VA_LIST_DEFINED
+ typedef __gnuc_ms_va_list ms_va_list;
+#endif
+
+#endif /* __CROSS_STDARG_H_INCLUDED */
diff --git a/lib/gcc/i686-linux/4.4.3/include/emmintrin.h b/lib/gcc/i686-linux/4.4.3/include/emmintrin.h
new file mode 100644
index 0000000..9467fe0
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include/emmintrin.h
@@ -0,0 +1,1513 @@
+/* Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
+ Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ GCC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* Implemented from the specification included in the Intel C++ Compiler
+ User Guide and Reference, version 9.0. */
+
+#ifndef _EMMINTRIN_H_INCLUDED
+#define _EMMINTRIN_H_INCLUDED
+
+#ifndef __SSE2__
+# error "SSE2 instruction set not enabled"
+#else
+
+/* We need definitions from the SSE header files*/
+#include <xmmintrin.h>
+
+/* SSE2 */
+typedef double __v2df __attribute__ ((__vector_size__ (16)));
+typedef long long __v2di __attribute__ ((__vector_size__ (16)));
+typedef int __v4si __attribute__ ((__vector_size__ (16)));
+typedef short __v8hi __attribute__ ((__vector_size__ (16)));
+typedef char __v16qi __attribute__ ((__vector_size__ (16)));
+
+/* The Intel API is flexible enough that we must allow aliasing with other
+ vector types, and their scalar components. */
+typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__));
+typedef double __m128d __attribute__ ((__vector_size__ (16), __may_alias__));
+
+/* Create a selector for use with the SHUFPD instruction. */
+#define _MM_SHUFFLE2(fp1,fp0) \
+ (((fp1) << 1) | (fp0))
+
+/* Create a vector with element 0 as F and the rest zero. */
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set_sd (double __F)
+{
+ return __extension__ (__m128d){ __F, 0.0 };
+}
+
+/* Create a vector with both elements equal to F. */
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set1_pd (double __F)
+{
+ return __extension__ (__m128d){ __F, __F };
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set_pd1 (double __F)
+{
+ return _mm_set1_pd (__F);
+}
+
+/* Create a vector with the lower value X and upper value W. */
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set_pd (double __W, double __X)
+{
+ return __extension__ (__m128d){ __X, __W };
+}
+
+/* Create a vector with the lower value W and upper value X. */
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_setr_pd (double __W, double __X)
+{
+ return __extension__ (__m128d){ __W, __X };
+}
+
+/* Create a vector of zeros. */
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_setzero_pd (void)
+{
+ return __extension__ (__m128d){ 0.0, 0.0 };
+}
+
+/* Sets the low DPFP value of A from the low value of B. */
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_move_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_movsd ((__v2df)__A, (__v2df)__B);
+}
+
+/* Load two DPFP values from P. The address must be 16-byte aligned. */
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_load_pd (double const *__P)
+{
+ return *(__m128d *)__P;
+}
+
+/* Load two DPFP values from P. The address need not be 16-byte aligned. */
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_loadu_pd (double const *__P)
+{
+ return __builtin_ia32_loadupd (__P);
+}
+
+/* Create a vector with all two elements equal to *P. */
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_load1_pd (double const *__P)
+{
+ return _mm_set1_pd (*__P);
+}
+
+/* Create a vector with element 0 as *P and the rest zero. */
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_load_sd (double const *__P)
+{
+ return _mm_set_sd (*__P);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_load_pd1 (double const *__P)
+{
+ return _mm_load1_pd (__P);
+}
+
+/* Load two DPFP values in reverse order. The address must be aligned. */
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_loadr_pd (double const *__P)
+{
+ __m128d __tmp = _mm_load_pd (__P);
+ return __builtin_ia32_shufpd (__tmp, __tmp, _MM_SHUFFLE2 (0,1));
+}
+
+/* Store two DPFP values. The address must be 16-byte aligned. */
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_store_pd (double *__P, __m128d __A)
+{
+ *(__m128d *)__P = __A;
+}
+
+/* Store two DPFP values. The address need not be 16-byte aligned. */
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_storeu_pd (double *__P, __m128d __A)
+{
+ __builtin_ia32_storeupd (__P, __A);
+}
+
+/* Stores the lower DPFP value. */
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_store_sd (double *__P, __m128d __A)
+{
+ *__P = __builtin_ia32_vec_ext_v2df (__A, 0);
+}
+
+extern __inline double __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsd_f64 (__m128d __A)
+{
+ return __builtin_ia32_vec_ext_v2df (__A, 0);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_storel_pd (double *__P, __m128d __A)
+{
+ _mm_store_sd (__P, __A);
+}
+
+/* Stores the upper DPFP value. */
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_storeh_pd (double *__P, __m128d __A)
+{
+ *__P = __builtin_ia32_vec_ext_v2df (__A, 1);
+}
+
+/* Store the lower DPFP value across two words.
+ The address must be 16-byte aligned. */
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_store1_pd (double *__P, __m128d __A)
+{
+ _mm_store_pd (__P, __builtin_ia32_shufpd (__A, __A, _MM_SHUFFLE2 (0,0)));
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_store_pd1 (double *__P, __m128d __A)
+{
+ _mm_store1_pd (__P, __A);
+}
+
+/* Store two DPFP values in reverse order. The address must be aligned. */
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_storer_pd (double *__P, __m128d __A)
+{
+ _mm_store_pd (__P, __builtin_ia32_shufpd (__A, __A, _MM_SHUFFLE2 (0,1)));
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsi128_si32 (__m128i __A)
+{
+ return __builtin_ia32_vec_ext_v4si ((__v4si)__A, 0);
+}
+
+#ifdef __x86_64__
+/* Intel intrinsic. */
+extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsi128_si64 (__m128i __A)
+{
+ return __builtin_ia32_vec_ext_v2di ((__v2di)__A, 0);
+}
+
+/* Microsoft intrinsic. */
+extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsi128_si64x (__m128i __A)
+{
+ return __builtin_ia32_vec_ext_v2di ((__v2di)__A, 0);
+}
+#endif
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_add_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_addpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_add_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_addsd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sub_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_subpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sub_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_subsd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_mul_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_mulpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_mul_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_mulsd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_div_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_divpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_div_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_divsd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sqrt_pd (__m128d __A)
+{
+ return (__m128d)__builtin_ia32_sqrtpd ((__v2df)__A);
+}
+
+/* Return pair {sqrt (A[0), B[1]}. */
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sqrt_sd (__m128d __A, __m128d __B)
+{
+ __v2df __tmp = __builtin_ia32_movsd ((__v2df)__A, (__v2df)__B);
+ return (__m128d)__builtin_ia32_sqrtsd ((__v2df)__tmp);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_min_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_minpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_min_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_minsd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_max_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_maxpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_max_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_maxsd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_and_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_andpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_andnot_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_andnpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_or_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_orpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_xor_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_xorpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpeq_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmpeqpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmplt_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmpltpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmple_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmplepd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpgt_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmpgtpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpge_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmpgepd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpneq_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmpneqpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpnlt_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmpnltpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpnle_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmpnlepd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpngt_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmpngtpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpnge_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmpngepd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpord_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmpordpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpunord_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmpunordpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpeq_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmpeqsd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmplt_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmpltsd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmple_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmplesd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpgt_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_movsd ((__v2df) __A,
+ (__v2df)
+ __builtin_ia32_cmpltsd ((__v2df) __B,
+ (__v2df)
+ __A));
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpge_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_movsd ((__v2df) __A,
+ (__v2df)
+ __builtin_ia32_cmplesd ((__v2df) __B,
+ (__v2df)
+ __A));
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpneq_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmpneqsd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpnlt_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmpnltsd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpnle_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmpnlesd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpngt_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_movsd ((__v2df) __A,
+ (__v2df)
+ __builtin_ia32_cmpnltsd ((__v2df) __B,
+ (__v2df)
+ __A));
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpnge_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_movsd ((__v2df) __A,
+ (__v2df)
+ __builtin_ia32_cmpnlesd ((__v2df) __B,
+ (__v2df)
+ __A));
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpord_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmpordsd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpunord_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmpunordsd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comieq_sd (__m128d __A, __m128d __B)
+{
+ return __builtin_ia32_comisdeq ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comilt_sd (__m128d __A, __m128d __B)
+{
+ return __builtin_ia32_comisdlt ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comile_sd (__m128d __A, __m128d __B)
+{
+ return __builtin_ia32_comisdle ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comigt_sd (__m128d __A, __m128d __B)
+{
+ return __builtin_ia32_comisdgt ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comige_sd (__m128d __A, __m128d __B)
+{
+ return __builtin_ia32_comisdge ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comineq_sd (__m128d __A, __m128d __B)
+{
+ return __builtin_ia32_comisdneq ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_ucomieq_sd (__m128d __A, __m128d __B)
+{
+ return __builtin_ia32_ucomisdeq ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_ucomilt_sd (__m128d __A, __m128d __B)
+{
+ return __builtin_ia32_ucomisdlt ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_ucomile_sd (__m128d __A, __m128d __B)
+{
+ return __builtin_ia32_ucomisdle ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_ucomigt_sd (__m128d __A, __m128d __B)
+{
+ return __builtin_ia32_ucomisdgt ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_ucomige_sd (__m128d __A, __m128d __B)
+{
+ return __builtin_ia32_ucomisdge ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_ucomineq_sd (__m128d __A, __m128d __B)
+{
+ return __builtin_ia32_ucomisdneq ((__v2df)__A, (__v2df)__B);
+}
+
+/* Create a vector of Qi, where i is the element number. */
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set_epi64x (long long __q1, long long __q0)
+{
+ return __extension__ (__m128i)(__v2di){ __q0, __q1 };
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set_epi64 (__m64 __q1, __m64 __q0)
+{
+ return _mm_set_epi64x ((long long)__q1, (long long)__q0);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set_epi32 (int __q3, int __q2, int __q1, int __q0)
+{
+ return __extension__ (__m128i)(__v4si){ __q0, __q1, __q2, __q3 };
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set_epi16 (short __q7, short __q6, short __q5, short __q4,
+ short __q3, short __q2, short __q1, short __q0)
+{
+ return __extension__ (__m128i)(__v8hi){
+ __q0, __q1, __q2, __q3, __q4, __q5, __q6, __q7 };
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set_epi8 (char __q15, char __q14, char __q13, char __q12,
+ char __q11, char __q10, char __q09, char __q08,
+ char __q07, char __q06, char __q05, char __q04,
+ char __q03, char __q02, char __q01, char __q00)
+{
+ return __extension__ (__m128i)(__v16qi){
+ __q00, __q01, __q02, __q03, __q04, __q05, __q06, __q07,
+ __q08, __q09, __q10, __q11, __q12, __q13, __q14, __q15
+ };
+}
+
+/* Set all of the elements of the vector to A. */
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set1_epi64x (long long __A)
+{
+ return _mm_set_epi64x (__A, __A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set1_epi64 (__m64 __A)
+{
+ return _mm_set_epi64 (__A, __A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set1_epi32 (int __A)
+{
+ return _mm_set_epi32 (__A, __A, __A, __A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set1_epi16 (short __A)
+{
+ return _mm_set_epi16 (__A, __A, __A, __A, __A, __A, __A, __A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set1_epi8 (char __A)
+{
+ return _mm_set_epi8 (__A, __A, __A, __A, __A, __A, __A, __A,
+ __A, __A, __A, __A, __A, __A, __A, __A);
+}
+
+/* Create a vector of Qi, where i is the element number.
+ The parameter order is reversed from the _mm_set_epi* functions. */
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_setr_epi64 (__m64 __q0, __m64 __q1)
+{
+ return _mm_set_epi64 (__q1, __q0);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_setr_epi32 (int __q0, int __q1, int __q2, int __q3)
+{
+ return _mm_set_epi32 (__q3, __q2, __q1, __q0);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_setr_epi16 (short __q0, short __q1, short __q2, short __q3,
+ short __q4, short __q5, short __q6, short __q7)
+{
+ return _mm_set_epi16 (__q7, __q6, __q5, __q4, __q3, __q2, __q1, __q0);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_setr_epi8 (char __q00, char __q01, char __q02, char __q03,
+ char __q04, char __q05, char __q06, char __q07,
+ char __q08, char __q09, char __q10, char __q11,
+ char __q12, char __q13, char __q14, char __q15)
+{
+ return _mm_set_epi8 (__q15, __q14, __q13, __q12, __q11, __q10, __q09, __q08,
+ __q07, __q06, __q05, __q04, __q03, __q02, __q01, __q00);
+}
+
+/* Create a vector with element 0 as *P and the rest zero. */
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_load_si128 (__m128i const *__P)
+{
+ return *__P;
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_loadu_si128 (__m128i const *__P)
+{
+ return (__m128i) __builtin_ia32_loaddqu ((char const *)__P);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_loadl_epi64 (__m128i const *__P)
+{
+ return _mm_set_epi64 ((__m64)0LL, *(__m64 *)__P);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_store_si128 (__m128i *__P, __m128i __B)
+{
+ *__P = __B;
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_storeu_si128 (__m128i *__P, __m128i __B)
+{
+ __builtin_ia32_storedqu ((char *)__P, (__v16qi)__B);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_storel_epi64 (__m128i *__P, __m128i __B)
+{
+ *(long long *)__P = __builtin_ia32_vec_ext_v2di ((__v2di)__B, 0);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_movepi64_pi64 (__m128i __B)
+{
+ return (__m64) __builtin_ia32_vec_ext_v2di ((__v2di)__B, 0);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_movpi64_epi64 (__m64 __A)
+{
+ return _mm_set_epi64 ((__m64)0LL, __A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_move_epi64 (__m128i __A)
+{
+ return (__m128i)__builtin_ia32_movq128 ((__v2di) __A);
+}
+
+/* Create a vector of zeros. */
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_setzero_si128 (void)
+{
+ return __extension__ (__m128i)(__v4si){ 0, 0, 0, 0 };
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtepi32_pd (__m128i __A)
+{
+ return (__m128d)__builtin_ia32_cvtdq2pd ((__v4si) __A);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtepi32_ps (__m128i __A)
+{
+ return (__m128)__builtin_ia32_cvtdq2ps ((__v4si) __A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtpd_epi32 (__m128d __A)
+{
+ return (__m128i)__builtin_ia32_cvtpd2dq ((__v2df) __A);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtpd_pi32 (__m128d __A)
+{
+ return (__m64)__builtin_ia32_cvtpd2pi ((__v2df) __A);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtpd_ps (__m128d __A)
+{
+ return (__m128)__builtin_ia32_cvtpd2ps ((__v2df) __A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvttpd_epi32 (__m128d __A)
+{
+ return (__m128i)__builtin_ia32_cvttpd2dq ((__v2df) __A);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvttpd_pi32 (__m128d __A)
+{
+ return (__m64)__builtin_ia32_cvttpd2pi ((__v2df) __A);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtpi32_pd (__m64 __A)
+{
+ return (__m128d)__builtin_ia32_cvtpi2pd ((__v2si) __A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtps_epi32 (__m128 __A)
+{
+ return (__m128i)__builtin_ia32_cvtps2dq ((__v4sf) __A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvttps_epi32 (__m128 __A)
+{
+ return (__m128i)__builtin_ia32_cvttps2dq ((__v4sf) __A);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtps_pd (__m128 __A)
+{
+ return (__m128d)__builtin_ia32_cvtps2pd ((__v4sf) __A);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsd_si32 (__m128d __A)
+{
+ return __builtin_ia32_cvtsd2si ((__v2df) __A);
+}
+
+#ifdef __x86_64__
+/* Intel intrinsic. */
+extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsd_si64 (__m128d __A)
+{
+ return __builtin_ia32_cvtsd2si64 ((__v2df) __A);
+}
+
+/* Microsoft intrinsic. */
+extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsd_si64x (__m128d __A)
+{
+ return __builtin_ia32_cvtsd2si64 ((__v2df) __A);
+}
+#endif
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvttsd_si32 (__m128d __A)
+{
+ return __builtin_ia32_cvttsd2si ((__v2df) __A);
+}
+
+#ifdef __x86_64__
+/* Intel intrinsic. */
+extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvttsd_si64 (__m128d __A)
+{
+ return __builtin_ia32_cvttsd2si64 ((__v2df) __A);
+}
+
+/* Microsoft intrinsic. */
+extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvttsd_si64x (__m128d __A)
+{
+ return __builtin_ia32_cvttsd2si64 ((__v2df) __A);
+}
+#endif
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsd_ss (__m128 __A, __m128d __B)
+{
+ return (__m128)__builtin_ia32_cvtsd2ss ((__v4sf) __A, (__v2df) __B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsi32_sd (__m128d __A, int __B)
+{
+ return (__m128d)__builtin_ia32_cvtsi2sd ((__v2df) __A, __B);
+}
+
+#ifdef __x86_64__
+/* Intel intrinsic. */
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsi64_sd (__m128d __A, long long __B)
+{
+ return (__m128d)__builtin_ia32_cvtsi642sd ((__v2df) __A, __B);
+}
+
+/* Microsoft intrinsic. */
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsi64x_sd (__m128d __A, long long __B)
+{
+ return (__m128d)__builtin_ia32_cvtsi642sd ((__v2df) __A, __B);
+}
+#endif
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtss_sd (__m128d __A, __m128 __B)
+{
+ return (__m128d)__builtin_ia32_cvtss2sd ((__v2df) __A, (__v4sf)__B);
+}
+
+#ifdef __OPTIMIZE__
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_shuffle_pd(__m128d __A, __m128d __B, const int __mask)
+{
+ return (__m128d)__builtin_ia32_shufpd ((__v2df)__A, (__v2df)__B, __mask);
+}
+#else
+#define _mm_shuffle_pd(A, B, N) \
+ ((__m128d)__builtin_ia32_shufpd ((__v2df)(__m128d)(A), \
+ (__v2df)(__m128d)(B), (int)(N)))
+#endif
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_unpackhi_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_unpckhpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_unpacklo_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_unpcklpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_loadh_pd (__m128d __A, double const *__B)
+{
+ return (__m128d)__builtin_ia32_loadhpd ((__v2df)__A, __B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_loadl_pd (__m128d __A, double const *__B)
+{
+ return (__m128d)__builtin_ia32_loadlpd ((__v2df)__A, __B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_movemask_pd (__m128d __A)
+{
+ return __builtin_ia32_movmskpd ((__v2df)__A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_packs_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_packsswb128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_packs_epi32 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_packssdw128 ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_packus_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_packuswb128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_unpackhi_epi8 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_punpckhbw128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_unpackhi_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_punpckhwd128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_unpackhi_epi32 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_punpckhdq128 ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_unpackhi_epi64 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_punpckhqdq128 ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_unpacklo_epi8 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_punpcklbw128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_unpacklo_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_punpcklwd128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_unpacklo_epi32 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_punpckldq128 ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_unpacklo_epi64 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_punpcklqdq128 ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_add_epi8 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_paddb128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_add_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_paddw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_add_epi32 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_paddd128 ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_add_epi64 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_paddq128 ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_adds_epi8 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_paddsb128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_adds_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_paddsw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_adds_epu8 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_paddusb128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_adds_epu16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_paddusw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sub_epi8 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_psubb128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sub_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_psubw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sub_epi32 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_psubd128 ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sub_epi64 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_psubq128 ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_subs_epi8 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_psubsb128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_subs_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_psubsw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_subs_epu8 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_psubusb128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_subs_epu16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_psubusw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_madd_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pmaddwd128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_mulhi_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pmulhw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_mullo_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pmullw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_mul_su32 (__m64 __A, __m64 __B)
+{
+ return (__m64)__builtin_ia32_pmuludq ((__v2si)__A, (__v2si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_mul_epu32 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pmuludq128 ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_slli_epi16 (__m128i __A, int __B)
+{
+ return (__m128i)__builtin_ia32_psllwi128 ((__v8hi)__A, __B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_slli_epi32 (__m128i __A, int __B)
+{
+ return (__m128i)__builtin_ia32_pslldi128 ((__v4si)__A, __B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_slli_epi64 (__m128i __A, int __B)
+{
+ return (__m128i)__builtin_ia32_psllqi128 ((__v2di)__A, __B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_srai_epi16 (__m128i __A, int __B)
+{
+ return (__m128i)__builtin_ia32_psrawi128 ((__v8hi)__A, __B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_srai_epi32 (__m128i __A, int __B)
+{
+ return (__m128i)__builtin_ia32_psradi128 ((__v4si)__A, __B);
+}
+
+#ifdef __OPTIMIZE__
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_srli_si128 (__m128i __A, const int __N)
+{
+ return (__m128i)__builtin_ia32_psrldqi128 (__A, __N * 8);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_slli_si128 (__m128i __A, const int __N)
+{
+ return (__m128i)__builtin_ia32_pslldqi128 (__A, __N * 8);
+}
+#else
+#define _mm_srli_si128(A, N) \
+ ((__m128i)__builtin_ia32_psrldqi128 ((__m128i)(A), (int)(N) * 8))
+#define _mm_slli_si128(A, N) \
+ ((__m128i)__builtin_ia32_pslldqi128 ((__m128i)(A), (int)(N) * 8))
+#endif
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_srli_epi16 (__m128i __A, int __B)
+{
+ return (__m128i)__builtin_ia32_psrlwi128 ((__v8hi)__A, __B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_srli_epi32 (__m128i __A, int __B)
+{
+ return (__m128i)__builtin_ia32_psrldi128 ((__v4si)__A, __B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_srli_epi64 (__m128i __A, int __B)
+{
+ return (__m128i)__builtin_ia32_psrlqi128 ((__v2di)__A, __B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sll_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_psllw128((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sll_epi32 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pslld128((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sll_epi64 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_psllq128((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sra_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_psraw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sra_epi32 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_psrad128 ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_srl_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_psrlw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_srl_epi32 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_psrld128 ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_srl_epi64 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_psrlq128 ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_and_si128 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pand128 ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_andnot_si128 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pandn128 ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_or_si128 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_por128 ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_xor_si128 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pxor128 ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpeq_epi8 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pcmpeqb128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpeq_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pcmpeqw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpeq_epi32 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pcmpeqd128 ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmplt_epi8 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pcmpgtb128 ((__v16qi)__B, (__v16qi)__A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmplt_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pcmpgtw128 ((__v8hi)__B, (__v8hi)__A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmplt_epi32 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pcmpgtd128 ((__v4si)__B, (__v4si)__A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpgt_epi8 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pcmpgtb128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpgt_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pcmpgtw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpgt_epi32 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pcmpgtd128 ((__v4si)__A, (__v4si)__B);
+}
+
+#ifdef __OPTIMIZE__
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_extract_epi16 (__m128i const __A, int const __N)
+{
+ return __builtin_ia32_vec_ext_v8hi ((__v8hi)__A, __N);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_insert_epi16 (__m128i const __A, int const __D, int const __N)
+{
+ return (__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)__A, __D, __N);
+}
+#else
+#define _mm_extract_epi16(A, N) \
+ ((int) __builtin_ia32_vec_ext_v8hi ((__v8hi)(__m128i)(A), (int)(N)))
+#define _mm_insert_epi16(A, D, N) \
+ ((__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)(__m128i)(A), \
+ (int)(D), (int)(N)))
+#endif
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_max_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pmaxsw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_max_epu8 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pmaxub128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_min_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pminsw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_min_epu8 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pminub128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_movemask_epi8 (__m128i __A)
+{
+ return __builtin_ia32_pmovmskb128 ((__v16qi)__A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_mulhi_epu16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pmulhuw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+#ifdef __OPTIMIZE__
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_shufflehi_epi16 (__m128i __A, const int __mask)
+{
+ return (__m128i)__builtin_ia32_pshufhw ((__v8hi)__A, __mask);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_shufflelo_epi16 (__m128i __A, const int __mask)
+{
+ return (__m128i)__builtin_ia32_pshuflw ((__v8hi)__A, __mask);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_shuffle_epi32 (__m128i __A, const int __mask)
+{
+ return (__m128i)__builtin_ia32_pshufd ((__v4si)__A, __mask);
+}
+#else
+#define _mm_shufflehi_epi16(A, N) \
+ ((__m128i)__builtin_ia32_pshufhw ((__v8hi)(__m128i)(A), (int)(N)))
+#define _mm_shufflelo_epi16(A, N) \
+ ((__m128i)__builtin_ia32_pshuflw ((__v8hi)(__m128i)(A), (int)(N)))
+#define _mm_shuffle_epi32(A, N) \
+ ((__m128i)__builtin_ia32_pshufd ((__v4si)(__m128i)(A), (int)(N)))
+#endif
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_maskmoveu_si128 (__m128i __A, __m128i __B, char *__C)
+{
+ __builtin_ia32_maskmovdqu ((__v16qi)__A, (__v16qi)__B, __C);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_avg_epu8 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pavgb128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_avg_epu16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pavgw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sad_epu8 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_psadbw128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_stream_si32 (int *__A, int __B)
+{
+ __builtin_ia32_movnti (__A, __B);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_stream_si128 (__m128i *__A, __m128i __B)
+{
+ __builtin_ia32_movntdq ((__v2di *)__A, (__v2di)__B);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_stream_pd (double *__A, __m128d __B)
+{
+ __builtin_ia32_movntpd (__A, (__v2df)__B);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_clflush (void const *__A)
+{
+ __builtin_ia32_clflush (__A);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_lfence (void)
+{
+ __builtin_ia32_lfence ();
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_mfence (void)
+{
+ __builtin_ia32_mfence ();
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsi32_si128 (int __A)
+{
+ return _mm_set_epi32 (0, 0, 0, __A);
+}
+
+#ifdef __x86_64__
+/* Intel intrinsic. */
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsi64_si128 (long long __A)
+{
+ return _mm_set_epi64x (0, __A);
+}
+
+/* Microsoft intrinsic. */
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsi64x_si128 (long long __A)
+{
+ return _mm_set_epi64x (0, __A);
+}
+#endif
+
+/* Casts between various SP, DP, INT vector types. Note that these do no
+ conversion of values, they just change the type. */
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_castpd_ps(__m128d __A)
+{
+ return (__m128) __A;
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_castpd_si128(__m128d __A)
+{
+ return (__m128i) __A;
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_castps_pd(__m128 __A)
+{
+ return (__m128d) __A;
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_castps_si128(__m128 __A)
+{
+ return (__m128i) __A;
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_castsi128_ps(__m128i __A)
+{
+ return (__m128) __A;
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_castsi128_pd(__m128i __A)
+{
+ return (__m128d) __A;
+}
+
+#endif /* __SSE2__ */
+
+#endif /* _EMMINTRIN_H_INCLUDED */
diff --git a/lib/gcc/i686-linux/4.4.3/include/float.h b/lib/gcc/i686-linux/4.4.3/include/float.h
new file mode 100644
index 0000000..9969f1c
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include/float.h
@@ -0,0 +1,238 @@
+/* Copyright (C) 2002, 2007, 2008, 2009 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+/*
+ * ISO C Standard: 5.2.4.2.2 Characteristics of floating types <float.h>
+ */
+
+#ifndef _FLOAT_H___
+#define _FLOAT_H___
+
+/* Radix of exponent representation, b. */
+#undef FLT_RADIX
+#define FLT_RADIX __FLT_RADIX__
+
+/* Number of base-FLT_RADIX digits in the significand, p. */
+#undef FLT_MANT_DIG
+#undef DBL_MANT_DIG
+#undef LDBL_MANT_DIG
+#define FLT_MANT_DIG __FLT_MANT_DIG__
+#define DBL_MANT_DIG __DBL_MANT_DIG__
+#define LDBL_MANT_DIG __LDBL_MANT_DIG__
+
+/* Number of decimal digits, q, such that any floating-point number with q
+ decimal digits can be rounded into a floating-point number with p radix b
+ digits and back again without change to the q decimal digits,
+
+ p * log10(b) if b is a power of 10
+ floor((p - 1) * log10(b)) otherwise
+*/
+#undef FLT_DIG
+#undef DBL_DIG
+#undef LDBL_DIG
+#define FLT_DIG __FLT_DIG__
+#define DBL_DIG __DBL_DIG__
+#define LDBL_DIG __LDBL_DIG__
+
+/* Minimum int x such that FLT_RADIX**(x-1) is a normalized float, emin */
+#undef FLT_MIN_EXP
+#undef DBL_MIN_EXP
+#undef LDBL_MIN_EXP
+#define FLT_MIN_EXP __FLT_MIN_EXP__
+#define DBL_MIN_EXP __DBL_MIN_EXP__
+#define LDBL_MIN_EXP __LDBL_MIN_EXP__
+
+/* Minimum negative integer such that 10 raised to that power is in the
+ range of normalized floating-point numbers,
+
+ ceil(log10(b) * (emin - 1))
+*/
+#undef FLT_MIN_10_EXP
+#undef DBL_MIN_10_EXP
+#undef LDBL_MIN_10_EXP
+#define FLT_MIN_10_EXP __FLT_MIN_10_EXP__
+#define DBL_MIN_10_EXP __DBL_MIN_10_EXP__
+#define LDBL_MIN_10_EXP __LDBL_MIN_10_EXP__
+
+/* Maximum int x such that FLT_RADIX**(x-1) is a representable float, emax. */
+#undef FLT_MAX_EXP
+#undef DBL_MAX_EXP
+#undef LDBL_MAX_EXP
+#define FLT_MAX_EXP __FLT_MAX_EXP__
+#define DBL_MAX_EXP __DBL_MAX_EXP__
+#define LDBL_MAX_EXP __LDBL_MAX_EXP__
+
+/* Maximum integer such that 10 raised to that power is in the range of
+ representable finite floating-point numbers,
+
+ floor(log10((1 - b**-p) * b**emax))
+*/
+#undef FLT_MAX_10_EXP
+#undef DBL_MAX_10_EXP
+#undef LDBL_MAX_10_EXP
+#define FLT_MAX_10_EXP __FLT_MAX_10_EXP__
+#define DBL_MAX_10_EXP __DBL_MAX_10_EXP__
+#define LDBL_MAX_10_EXP __LDBL_MAX_10_EXP__
+
+/* Maximum representable finite floating-point number,
+
+ (1 - b**-p) * b**emax
+*/
+#undef FLT_MAX
+#undef DBL_MAX
+#undef LDBL_MAX
+#define FLT_MAX __FLT_MAX__
+#define DBL_MAX __DBL_MAX__
+#define LDBL_MAX __LDBL_MAX__
+
+/* The difference between 1 and the least value greater than 1 that is
+ representable in the given floating point type, b**1-p. */
+#undef FLT_EPSILON
+#undef DBL_EPSILON
+#undef LDBL_EPSILON
+#define FLT_EPSILON __FLT_EPSILON__
+#define DBL_EPSILON __DBL_EPSILON__
+#define LDBL_EPSILON __LDBL_EPSILON__
+
+/* Minimum normalized positive floating-point number, b**(emin - 1). */
+#undef FLT_MIN
+#undef DBL_MIN
+#undef LDBL_MIN
+#define FLT_MIN __FLT_MIN__
+#define DBL_MIN __DBL_MIN__
+#define LDBL_MIN __LDBL_MIN__
+
+/* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown. */
+/* ??? This is supposed to change with calls to fesetround in <fenv.h>. */
+#undef FLT_ROUNDS
+#define FLT_ROUNDS 1
+
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+/* The floating-point expression evaluation method.
+ -1 indeterminate
+ 0 evaluate all operations and constants just to the range and
+ precision of the type
+ 1 evaluate operations and constants of type float and double
+ to the range and precision of the double type, evaluate
+ long double operations and constants to the range and
+ precision of the long double type
+ 2 evaluate all operations and constants to the range and
+ precision of the long double type
+
+ ??? This ought to change with the setting of the fp control word;
+ the value provided by the compiler assumes the widest setting. */
+#undef FLT_EVAL_METHOD
+#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
+
+/* Number of decimal digits, n, such that any floating-point number in the
+ widest supported floating type with pmax radix b digits can be rounded
+ to a floating-point number with n decimal digits and back again without
+ change to the value,
+
+ pmax * log10(b) if b is a power of 10
+ ceil(1 + pmax * log10(b)) otherwise
+*/
+#undef DECIMAL_DIG
+#define DECIMAL_DIG __DECIMAL_DIG__
+
+#endif /* C99 */
+
+#ifdef __STDC_WANT_DEC_FP__
+/* Draft Technical Report 24732, extension for decimal floating-point
+ arithmetic: Characteristic of decimal floating types <float.h>. */
+
+/* Number of base-FLT_RADIX digits in the significand, p. */
+#undef DEC32_MANT_DIG
+#undef DEC64_MANT_DIG
+#undef DEC128_MANT_DIG
+#define DEC32_MANT_DIG __DEC32_MANT_DIG__
+#define DEC64_MANT_DIG __DEC64_MANT_DIG__
+#define DEC128_MANT_DIG __DEC128_MANT_DIG__
+
+/* Minimum exponent. */
+#undef DEC32_MIN_EXP
+#undef DEC64_MIN_EXP
+#undef DEC128_MIN_EXP
+#define DEC32_MIN_EXP __DEC32_MIN_EXP__
+#define DEC64_MIN_EXP __DEC64_MIN_EXP__
+#define DEC128_MIN_EXP __DEC128_MIN_EXP__
+
+/* Maximum exponent. */
+#undef DEC32_MAX_EXP
+#undef DEC64_MAX_EXP
+#undef DEC128_MAX_EXP
+#define DEC32_MAX_EXP __DEC32_MAX_EXP__
+#define DEC64_MAX_EXP __DEC64_MAX_EXP__
+#define DEC128_MAX_EXP __DEC128_MAX_EXP__
+
+/* Maximum representable finite decimal floating-point number
+ (there are 6, 15, and 33 9s after the decimal points respectively). */
+#undef DEC32_MAX
+#undef DEC64_MAX
+#undef DEC128_MAX
+#define DEC32_MAX __DEC32_MAX__
+#define DEC64_MAX __DEC64_MAX__
+#define DEC128_MAX __DEC128_MAX__
+
+/* The difference between 1 and the least value greater than 1 that is
+ representable in the given floating point type. */
+#undef DEC32_EPSILON
+#undef DEC64_EPSILON
+#undef DEC128_EPSILON
+#define DEC32_EPSILON __DEC32_EPSILON__
+#define DEC64_EPSILON __DEC64_EPSILON__
+#define DEC128_EPSILON __DEC128_EPSILON__
+
+/* Minimum normalized positive floating-point number. */
+#undef DEC32_MIN
+#undef DEC64_MIN
+#undef DEC128_MIN
+#define DEC32_MIN __DEC32_MIN__
+#define DEC64_MIN __DEC64_MIN__
+#define DEC128_MIN __DEC128_MIN__
+
+/* Minimum subnormal positive floating-point number. */
+#undef DEC32_SUBNORMAL_MIN
+#undef DEC64_SUBNORMAL_MIN
+#undef DEC128_SUBNORMAL_MIN
+#define DEC32_SUBNORMAL_MIN __DEC32_SUBNORMAL_MIN__
+#define DEC64_SUBNORMAL_MIN __DEC64_SUBNORMAL_MIN__
+#define DEC128_SUBNORMAL_MIN __DEC128_SUBNORMAL_MIN__
+
+/* The floating-point expression evaluation method.
+ -1 indeterminate
+ 0 evaluate all operations and constants just to the range and
+ precision of the type
+ 1 evaluate operations and constants of type _Decimal32
+ and _Decimal64 to the range and precision of the _Decimal64
+ type, evaluate _Decimal128 operations and constants to the
+ range and precision of the _Decimal128 type;
+ 2 evaluate all operations and constants to the range and
+ precision of the _Decimal128 type. */
+
+#undef DEC_EVAL_METHOD
+#define DEC_EVAL_METHOD __DEC_EVAL_METHOD__
+
+#endif /* __STDC_WANT_DEC_FP__ */
+
+#endif /* _FLOAT_H___ */
diff --git a/lib/gcc/i686-linux/4.4.3/include/immintrin.h b/lib/gcc/i686-linux/4.4.3/include/immintrin.h
new file mode 100644
index 0000000..7a2b9b9
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include/immintrin.h
@@ -0,0 +1,59 @@
+/* Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ GCC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _IMMINTRIN_H_INCLUDED
+#define _IMMINTRIN_H_INCLUDED
+
+#ifdef __MMX__
+#include <mmintrin.h>
+#endif
+
+#ifdef __SSE__
+#include <xmmintrin.h>
+#endif
+
+#ifdef __SSE2__
+#include <emmintrin.h>
+#endif
+
+#ifdef __SSE3__
+#include <pmmintrin.h>
+#endif
+
+#ifdef __SSSE3__
+#include <tmmintrin.h>
+#endif
+
+#if defined (__SSE4_2__) || defined (__SSE4_1__)
+#include <smmintrin.h>
+#endif
+
+#if defined (__AES__) || defined (__PCLMUL__)
+#include <wmmintrin.h>
+#endif
+
+#ifdef __AVX__
+#include <avxintrin.h>
+#endif
+
+#endif /* _IMMINTRIN_H_INCLUDED */
diff --git a/lib/gcc/i686-linux/4.4.3/include/iso646.h b/lib/gcc/i686-linux/4.4.3/include/iso646.h
new file mode 100644
index 0000000..28ff9d1
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include/iso646.h
@@ -0,0 +1,45 @@
+/* Copyright (C) 1997, 1999, 2009 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+/*
+ * ISO C Standard: 7.9 Alternative spellings <iso646.h>
+ */
+
+#ifndef _ISO646_H
+#define _ISO646_H
+
+#ifndef __cplusplus
+#define and &&
+#define and_eq &=
+#define bitand &
+#define bitor |
+#define compl ~
+#define not !
+#define not_eq !=
+#define or ||
+#define or_eq |=
+#define xor ^
+#define xor_eq ^=
+#endif
+
+#endif
diff --git a/lib/gcc/i686-linux/4.4.3/include/lwpintrin.h b/lib/gcc/i686-linux/4.4.3/include/lwpintrin.h
new file mode 100644
index 0000000..954b039
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include/lwpintrin.h
@@ -0,0 +1,100 @@
+/* Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ GCC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _X86INTRIN_H_INCLUDED
+# error "Never use <lwpintrin.h> directly; include <x86intrin.h> instead."
+#endif
+
+#ifndef _LWPINTRIN_H_INCLUDED
+#define _LWPINTRIN_H_INCLUDED
+
+#ifndef __LWP__
+# error "LWP instruction set not enabled"
+#else
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+__llwpcb (void *pcbAddress)
+{
+ __builtin_ia32_llwpcb (pcbAddress);
+}
+
+extern __inline void * __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+__slwpcb (void)
+{
+ return __builtin_ia32_slwpcb ();
+}
+
+#ifdef __OPTIMIZE__
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+__lwpval32 (unsigned int data2, unsigned int data1, unsigned int flags)
+{
+ __builtin_ia32_lwpval32 (data2, data1, flags);
+}
+
+#ifdef __x86_64__
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+__lwpval64 (unsigned long long data2, unsigned int data1, unsigned int flags)
+{
+ __builtin_ia32_lwpval64 (data2, data1, flags);
+}
+#endif
+#else
+#define __lwpval32(D2, D1, F) \
+ (__builtin_ia32_lwpval32 ((unsigned int) (D2), (unsigned int) (D1), \
+ (unsigned int) (F)))
+#ifdef __x86_64__
+#define __lwpval64(D2, D1, F) \
+ (__builtin_ia32_lwpval64 ((unsigned long long) (D2), (unsigned int) (D1), \
+ (unsigned int) (F)))
+#endif
+#endif
+
+
+#ifdef __OPTIMIZE__
+extern __inline unsigned char __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+__lwpins32 (unsigned int data2, unsigned int data1, unsigned int flags)
+{
+ return __builtin_ia32_lwpins32 (data2, data1, flags);
+}
+
+#ifdef __x86_64__
+extern __inline unsigned char __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+__lwpins64 (unsigned long long data2, unsigned int data1, unsigned int flags)
+{
+ return __builtin_ia32_lwpins64 (data2, data1, flags);
+}
+#endif
+#else
+#define __lwpins32(D2, D1, F) \
+ (__builtin_ia32_lwpins32 ((unsigned int) (D2), (unsigned int) (D1), \
+ (unsigned int) (F)))
+#ifdef __x86_64__
+#define __lwpins64(D2, D1, F) \
+ (__builtin_ia32_lwpins64 ((unsigned long long) (D2), (unsigned int) (D1), \
+ (unsigned int) (F)))
+#endif
+#endif
+
+#endif /* __LWP__ */
+
+#endif /* _LWPINTRIN_H_INCLUDED */
diff --git a/lib/gcc/i686-linux/4.4.3/include/mf-runtime.h b/lib/gcc/i686-linux/4.4.3/include/mf-runtime.h
new file mode 100644
index 0000000..4c512d5
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include/mf-runtime.h
@@ -0,0 +1,244 @@
+/* Implementation header for mudflap runtime library.
+ Mudflap: narrow-pointer bounds-checking by tree rewriting.
+ Copyright (C) 2002, 2003, 2004, 2005, 2009 Free Software Foundation, Inc.
+ Contributed by Frank Ch. Eigler <fche@redhat.com>
+ and Graydon Hoare <graydon@redhat.com>
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+/* Public libmudflap declarations -*- C -*- */
+
+#ifndef MF_RUNTIME_H
+#define MF_RUNTIME_H
+
+typedef void *__mf_ptr_t;
+typedef unsigned int __mf_uintptr_t __attribute__ ((__mode__ (__pointer__)));
+typedef __SIZE_TYPE__ __mf_size_t;
+
+/* Global declarations used by instrumentation. When _MUDFLAP is
+ defined, these have been auto-declared by the compiler and we
+ should not declare them again (ideally we *would* declare them
+ again, to verify that the compiler's declarations match the
+ library's, but the C++ front end has no mechanism for allowing
+ the re-definition of a structure type). */
+#ifndef _MUDFLAP
+struct __mf_cache { __mf_uintptr_t low; __mf_uintptr_t high; };
+extern struct __mf_cache __mf_lookup_cache [];
+extern __mf_uintptr_t __mf_lc_mask;
+extern unsigned char __mf_lc_shift;
+#endif
+
+/* Multithreading support. */
+#ifdef _MUDFLAPTH
+/* extern pthread_mutex_t __mf_biglock; */
+#ifndef _REENTRANT
+#define _REENTRANT
+#endif
+#ifndef _THREAD_SAFE
+#define _THREAD_SAFE
+#endif
+#endif
+
+/* Codes to describe the type of access to check: __mf_check arg 3 */
+
+#define __MF_CHECK_READ 0
+#define __MF_CHECK_WRITE 1
+
+
+/* Codes to describe a region of memory being registered: __mf_*register arg 3 */
+
+#define __MF_TYPE_NOACCESS 0
+#define __MF_TYPE_HEAP 1
+#define __MF_TYPE_HEAP_I 2
+#define __MF_TYPE_STACK 3
+#define __MF_TYPE_STATIC 4
+#define __MF_TYPE_GUESS 5
+
+
+/* The public mudflap API */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern void __mf_check (void *ptr, __mf_size_t sz, int type, const char *location)
+ __attribute((nothrow));
+extern void __mf_register (void *ptr, __mf_size_t sz, int type, const char *name)
+ __attribute((nothrow));
+extern void __mf_unregister (void *ptr, __mf_size_t sz, int type)
+ __attribute((nothrow));
+extern unsigned __mf_watch (void *ptr, __mf_size_t sz);
+extern unsigned __mf_unwatch (void *ptr, __mf_size_t sz);
+extern void __mf_report ();
+extern int __mf_set_options (const char *opts);
+
+
+/* Redirect some standard library functions to libmudflap. These are
+ done by simple #define rather than linker wrapping, since only
+ instrumented modules are meant to be affected. */
+
+#ifdef _MUDFLAP
+#pragma redefine_extname memcpy __mfwrap_memcpy
+#pragma redefine_extname memmove __mfwrap_memmove
+#pragma redefine_extname memset __mfwrap_memset
+#pragma redefine_extname memcmp __mfwrap_memcmp
+#pragma redefine_extname memchr __mfwrap_memchr
+#pragma redefine_extname memrchr __mfwrap_memrchr
+#pragma redefine_extname strcpy __mfwrap_strcpy
+#pragma redefine_extname strncpy __mfwrap_strncpy
+#pragma redefine_extname strcat __mfwrap_strcat
+#pragma redefine_extname strncat __mfwrap_strncat
+#pragma redefine_extname strcmp __mfwrap_strcmp
+#pragma redefine_extname strcasecmp __mfwrap_strcasecmp
+#pragma redefine_extname strncmp __mfwrap_strncmp
+#pragma redefine_extname strncasecmp __mfwrap_strncasecmp
+#pragma redefine_extname strdup __mfwrap_strdup
+#pragma redefine_extname strndup __mfwrap_strndup
+#pragma redefine_extname strchr __mfwrap_strchr
+#pragma redefine_extname strrchr __mfwrap_strrchr
+#pragma redefine_extname strstr __mfwrap_strstr
+#pragma redefine_extname memmem __mfwrap_memmem
+#pragma redefine_extname strlen __mfwrap_strlen
+#pragma redefine_extname strnlen __mfwrap_strnlen
+#pragma redefine_extname bzero __mfwrap_bzero
+#pragma redefine_extname bcopy __mfwrap_bcopy
+#pragma redefine_extname bcmp __mfwrap_bcmp
+#pragma redefine_extname index __mfwrap_index
+#pragma redefine_extname rindex __mfwrap_rindex
+#pragma redefine_extname asctime __mfwrap_asctime
+#pragma redefine_extname ctime __mfwrap_ctime
+#pragma redefine_extname gmtime __mfwrap_gmtime
+#pragma redefine_extname localtime __mfwrap_localtime
+#pragma redefine_extname time __mfwrap_time
+#pragma redefine_extname strerror __mfwrap_strerror
+#pragma redefine_extname fopen __mfwrap_fopen
+#pragma redefine_extname fdopen __mfwrap_fdopen
+#pragma redefine_extname freopen __mfwrap_freopen
+#pragma redefine_extname fclose __mfwrap_fclose
+#pragma redefine_extname fread __mfwrap_fread
+#pragma redefine_extname fwrite __mfwrap_fwrite
+#pragma redefine_extname fgetc __mfwrap_fgetc
+#pragma redefine_extname fgets __mfwrap_fgets
+#pragma redefine_extname getc __mfwrap_getc
+#pragma redefine_extname gets __mfwrap_gets
+#pragma redefine_extname ungetc __mfwrap_ungetc
+#pragma redefine_extname fputc __mfwrap_fputc
+#pragma redefine_extname fputs __mfwrap_fputs
+#pragma redefine_extname putc __mfwrap_putc
+#pragma redefine_extname puts __mfwrap_puts
+#pragma redefine_extname clearerr __mfwrap_clearerr
+#pragma redefine_extname feof __mfwrap_feof
+#pragma redefine_extname ferror __mfwrap_ferror
+#pragma redefine_extname fileno __mfwrap_fileno
+#pragma redefine_extname printf __mfwrap_printf
+#pragma redefine_extname fprintf __mfwrap_fprintf
+#pragma redefine_extname sprintf __mfwrap_sprintf
+#pragma redefine_extname snprintf __mfwrap_snprintf
+#pragma redefine_extname vprintf __mfwrap_vprintf
+#pragma redefine_extname vfprintf __mfwrap_vfprintf
+#pragma redefine_extname vsprintf __mfwrap_vsprintf
+#pragma redefine_extname vsnprintf __mfwrap_vsnprintf
+#pragma redefine_extname access __mfwrap_access
+#pragma redefine_extname remove __mfwrap_remove
+#pragma redefine_extname fflush __mfwrap_fflush
+#pragma redefine_extname fseek __mfwrap_fseek
+#pragma redefine_extname ftell __mfwrap_ftell
+#pragma redefine_extname rewind __mfwrap_rewind
+#pragma redefine_extname fgetpos __mfwrap_fgetpos
+#pragma redefine_extname fsetpos __mfwrap_fsetpos
+#pragma redefine_extname stat __mfwrap_stat
+#pragma redefine_extname fstat __mfwrap_fstat
+#pragma redefine_extname lstat __mfwrap_lstat
+#pragma redefine_extname mkfifo __mfwrap_mkfifo
+#pragma redefine_extname setvbuf __mfwrap_setvbuf
+#pragma redefine_extname setbuf __mfwrap_setbuf
+#pragma redefine_extname setbuffer __mfwrap_setbuffer
+#pragma redefine_extname setlinebuf __mfwrap_setlinebuf
+#pragma redefine_extname opendir __mfwrap_opendir
+#pragma redefine_extname closedir __mfwrap_closedir
+#pragma redefine_extname readdir __mfwrap_readdir
+#pragma redefine_extname recv __mfwrap_recv
+#pragma redefine_extname recvfrom __mfwrap_recvfrom
+#pragma redefine_extname recvmsg __mfwrap_recvmsg
+#pragma redefine_extname send __mfwrap_send
+#pragma redefine_extname sendto __mfwrap_sendto
+#pragma redefine_extname sendmsg __mfwrap_sendmsg
+#pragma redefine_extname setsockopt __mfwrap_setsockopt
+#pragma redefine_extname getsockopt __mfwrap_getsockopt
+#pragma redefine_extname accept __mfwrap_accept
+#pragma redefine_extname bind __mfwrap_bind
+#pragma redefine_extname connect __mfwrap_connect
+#pragma redefine_extname gethostname __mfwrap_gethostname
+#pragma redefine_extname sethostname __mfwrap_sethostname
+#pragma redefine_extname gethostbyname __mfwrap_gethostbyname
+#pragma redefine_extname wait __mfwrap_wait
+#pragma redefine_extname waitpid __mfwrap_waitpid
+#pragma redefine_extname popen __mfwrap_popen
+#pragma redefine_extname pclose __mfwrap_pclose
+#pragma redefine_extname execve __mfwrap_execve
+#pragma redefine_extname execv __mfwrap_execv
+#pragma redefine_extname execvp __mfwrap_execvp
+#pragma redefine_extname system __mfwrap_system
+#pragma redefine_extname dlopen __mfwrap_dlopen
+#pragma redefine_extname dlerror __mfwrap_dlerror
+#pragma redefine_extname dlsym __mfwrap_dlsym
+#pragma redefine_extname dlclose __mfwrap_dlclose
+#pragma redefine_extname fopen64 __mfwrap_fopen64
+#pragma redefine_extname freopen64 __mfwrap_freopen64
+#pragma redefine_extname stat64 __mfwrap_stat64
+#pragma redefine_extname fseeko64 __mfwrap_fseeko64
+#pragma redefine_extname ftello64 __mfwrap_ftello64
+#pragma redefine_extname semop __mfwrap_semop
+#pragma redefine_extname semctl __mfwrap_semctl
+#pragma redefine_extname shmctl __mfwrap_shmctl
+#pragma redefine_extname shmat __mfwrap_shmat
+#pragma redefine_extname shmdt __mfwrap_shmdt
+#pragma redefine_extname __ctype_b_loc __mfwrap___ctype_b_loc
+#pragma redefine_extname __ctype_toupper_loc __mfwrap___ctype_toupper_loc
+#pragma redefine_extname __ctype_tolower_loc __mfwrap___ctype_tolower_loc
+#pragma redefine_extname getlogin __mfwrap_getlogin
+#pragma redefine_extname cuserid __mfwrap_cuserid
+#pragma redefine_extname getpwnam __mfwrap_getpwnam
+#pragma redefine_extname getpwuid __mfwrap_getpwuid
+#pragma redefine_extname getgrnam __mfwrap_getgrnam
+#pragma redefine_extname getgrgid __mfwrap_getgrgid
+#pragma redefine_extname getservent __mfwrap_getservent
+#pragma redefine_extname getservbyname __mfwrap_getservbyname
+#pragma redefine_extname getservbyport __mfwrap_getservbyport
+#pragma redefine_extname gai_strerror __mfwrap_gai_strerror
+#pragma redefine_extname getmntent __mfwrap_getmntent
+#pragma redefine_extname inet_ntoa __mfwrap_inet_ntoa
+#pragma redefine_extname getprotoent __mfwrap_getprotoent
+#pragma redefine_extname getprotobyname __mfwrap_getprotobyname
+#pragma redefine_extname getprotobynumber __mfwrap_getprotobynumber
+
+/* Disable glibc macros. */
+#define __NO_STRING_INLINES
+
+#endif /* _MUDFLAP */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* MF_RUNTIME_H */
diff --git a/lib/gcc/i686-linux/4.4.3/include/mm3dnow.h b/lib/gcc/i686-linux/4.4.3/include/mm3dnow.h
new file mode 100644
index 0000000..0d0735c
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include/mm3dnow.h
@@ -0,0 +1,215 @@
+/* Copyright (C) 2004, 2007, 2008, 2009 Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ GCC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* Implemented from the mm3dnow.h (of supposedly AMD origin) included with
+ MSVC 7.1. */
+
+#ifndef _MM3DNOW_H_INCLUDED
+#define _MM3DNOW_H_INCLUDED
+
+#ifdef __3dNOW__
+
+#include <mmintrin.h>
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_femms (void)
+{
+ __builtin_ia32_femms();
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pavgusb (__m64 __A, __m64 __B)
+{
+ return (__m64)__builtin_ia32_pavgusb ((__v8qi)__A, (__v8qi)__B);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pf2id (__m64 __A)
+{
+ return (__m64)__builtin_ia32_pf2id ((__v2sf)__A);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pfacc (__m64 __A, __m64 __B)
+{
+ return (__m64)__builtin_ia32_pfacc ((__v2sf)__A, (__v2sf)__B);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pfadd (__m64 __A, __m64 __B)
+{
+ return (__m64)__builtin_ia32_pfadd ((__v2sf)__A, (__v2sf)__B);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pfcmpeq (__m64 __A, __m64 __B)
+{
+ return (__m64)__builtin_ia32_pfcmpeq ((__v2sf)__A, (__v2sf)__B);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pfcmpge (__m64 __A, __m64 __B)
+{
+ return (__m64)__builtin_ia32_pfcmpge ((__v2sf)__A, (__v2sf)__B);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pfcmpgt (__m64 __A, __m64 __B)
+{
+ return (__m64)__builtin_ia32_pfcmpgt ((__v2sf)__A, (__v2sf)__B);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pfmax (__m64 __A, __m64 __B)
+{
+ return (__m64)__builtin_ia32_pfmax ((__v2sf)__A, (__v2sf)__B);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pfmin (__m64 __A, __m64 __B)
+{
+ return (__m64)__builtin_ia32_pfmin ((__v2sf)__A, (__v2sf)__B);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pfmul (__m64 __A, __m64 __B)
+{
+ return (__m64)__builtin_ia32_pfmul ((__v2sf)__A, (__v2sf)__B);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pfrcp (__m64 __A)
+{
+ return (__m64)__builtin_ia32_pfrcp ((__v2sf)__A);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pfrcpit1 (__m64 __A, __m64 __B)
+{
+ return (__m64)__builtin_ia32_pfrcpit1 ((__v2sf)__A, (__v2sf)__B);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pfrcpit2 (__m64 __A, __m64 __B)
+{
+ return (__m64)__builtin_ia32_pfrcpit2 ((__v2sf)__A, (__v2sf)__B);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pfrsqrt (__m64 __A)
+{
+ return (__m64)__builtin_ia32_pfrsqrt ((__v2sf)__A);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pfrsqit1 (__m64 __A, __m64 __B)
+{
+ return (__m64)__builtin_ia32_pfrsqit1 ((__v2sf)__A, (__v2sf)__B);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pfsub (__m64 __A, __m64 __B)
+{
+ return (__m64)__builtin_ia32_pfsub ((__v2sf)__A, (__v2sf)__B);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pfsubr (__m64 __A, __m64 __B)
+{
+ return (__m64)__builtin_ia32_pfsubr ((__v2sf)__A, (__v2sf)__B);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pi2fd (__m64 __A)
+{
+ return (__m64)__builtin_ia32_pi2fd ((__v2si)__A);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pmulhrw (__m64 __A, __m64 __B)
+{
+ return (__m64)__builtin_ia32_pmulhrw ((__v4hi)__A, (__v4hi)__B);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_prefetch (void *__P)
+{
+ __builtin_prefetch (__P, 0, 3 /* _MM_HINT_T0 */);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_prefetchw (void *__P)
+{
+ __builtin_prefetch (__P, 1, 3 /* _MM_HINT_T0 */);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_from_float (float __A)
+{
+ return __extension__ (__m64)(__v2sf){ __A, 0.0f };
+}
+
+extern __inline float __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_to_float (__m64 __A)
+{
+ union { __v2sf v; float a[2]; } __tmp;
+ __tmp.v = (__v2sf)__A;
+ return __tmp.a[0];
+}
+
+#ifdef __3dNOW_A__
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pf2iw (__m64 __A)
+{
+ return (__m64)__builtin_ia32_pf2iw ((__v2sf)__A);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pfnacc (__m64 __A, __m64 __B)
+{
+ return (__m64)__builtin_ia32_pfnacc ((__v2sf)__A, (__v2sf)__B);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pfpnacc (__m64 __A, __m64 __B)
+{
+ return (__m64)__builtin_ia32_pfpnacc ((__v2sf)__A, (__v2sf)__B);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pi2fw (__m64 __A)
+{
+ return (__m64)__builtin_ia32_pi2fw ((__v2si)__A);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pswapd (__m64 __A)
+{
+ return (__m64)__builtin_ia32_pswapdsf ((__v2sf)__A);
+}
+
+#endif /* __3dNOW_A__ */
+#endif /* __3dNOW__ */
+
+#endif /* _MM3DNOW_H_INCLUDED */
diff --git a/lib/gcc/i686-linux/4.4.3/include/mm_malloc.h b/lib/gcc/i686-linux/4.4.3/include/mm_malloc.h
new file mode 100644
index 0000000..0a9f2e2
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include/mm_malloc.h
@@ -0,0 +1,57 @@
+/* Copyright (C) 2004, 2006, 2009 Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ GCC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _MM_MALLOC_H_INCLUDED
+#define _MM_MALLOC_H_INCLUDED
+
+#include <stdlib.h>
+
+/* We can't depend on <stdlib.h> since the prototype of posix_memalign
+ may not be visible. */
+#ifndef __cplusplus
+extern int posix_memalign (void **, size_t, size_t);
+#else
+extern "C" int posix_memalign (void **, size_t, size_t) throw ();
+#endif
+
+static __inline void *
+_mm_malloc (size_t size, size_t alignment)
+{
+ void *ptr;
+ if (alignment == 1)
+ return malloc (size);
+ if (alignment == 2 || (sizeof (void *) == 8 && alignment == 4))
+ alignment = sizeof (void *);
+ if (posix_memalign (&ptr, alignment, size) == 0)
+ return ptr;
+ else
+ return NULL;
+}
+
+static __inline void
+_mm_free (void * ptr)
+{
+ free (ptr);
+}
+
+#endif /* _MM_MALLOC_H_INCLUDED */
diff --git a/lib/gcc/i686-linux/4.4.3/include/mmintrin-common.h b/lib/gcc/i686-linux/4.4.3/include/mmintrin-common.h
new file mode 100644
index 0000000..0054168
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include/mmintrin-common.h
@@ -0,0 +1,155 @@
+/* Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ GCC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* Common definition of the ROUND and PTEST intrinsics that are shared
+ between SSE4.1 and SSE5. */
+
+#ifndef _MMINTRIN_COMMON_H_INCLUDED
+#define _MMINTRIN_COMMON_H_INCLUDED
+
+#if !defined(__SSE5__) && !defined(__SSE4_1__)
+# error "SSE5 or SSE4.1 instruction set not enabled"
+#else
+
+/* Rounding mode macros. */
+#define _MM_FROUND_TO_NEAREST_INT 0x00
+#define _MM_FROUND_TO_NEG_INF 0x01
+#define _MM_FROUND_TO_POS_INF 0x02
+#define _MM_FROUND_TO_ZERO 0x03
+#define _MM_FROUND_CUR_DIRECTION 0x04
+
+#define _MM_FROUND_RAISE_EXC 0x00
+#define _MM_FROUND_NO_EXC 0x08
+
+#define _MM_FROUND_NINT \
+ (_MM_FROUND_TO_NEAREST_INT | _MM_FROUND_RAISE_EXC)
+#define _MM_FROUND_FLOOR \
+ (_MM_FROUND_TO_NEG_INF | _MM_FROUND_RAISE_EXC)
+#define _MM_FROUND_CEIL \
+ (_MM_FROUND_TO_POS_INF | _MM_FROUND_RAISE_EXC)
+#define _MM_FROUND_TRUNC \
+ (_MM_FROUND_TO_ZERO | _MM_FROUND_RAISE_EXC)
+#define _MM_FROUND_RINT \
+ (_MM_FROUND_CUR_DIRECTION | _MM_FROUND_RAISE_EXC)
+#define _MM_FROUND_NEARBYINT \
+ (_MM_FROUND_CUR_DIRECTION | _MM_FROUND_NO_EXC)
+
+/* Test Instruction */
+/* Packed integer 128-bit bitwise comparison. Return 1 if
+ (__V & __M) == 0. */
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_testz_si128 (__m128i __M, __m128i __V)
+{
+ return __builtin_ia32_ptestz128 ((__v2di)__M, (__v2di)__V);
+}
+
+/* Packed integer 128-bit bitwise comparison. Return 1 if
+ (__V & ~__M) == 0. */
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_testc_si128 (__m128i __M, __m128i __V)
+{
+ return __builtin_ia32_ptestc128 ((__v2di)__M, (__v2di)__V);
+}
+
+/* Packed integer 128-bit bitwise comparison. Return 1 if
+ (__V & __M) != 0 && (__V & ~__M) != 0. */
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_testnzc_si128 (__m128i __M, __m128i __V)
+{
+ return __builtin_ia32_ptestnzc128 ((__v2di)__M, (__v2di)__V);
+}
+
+/* Macros for packed integer 128-bit comparison intrinsics. */
+#define _mm_test_all_zeros(M, V) _mm_testz_si128 ((M), (V))
+
+#define _mm_test_all_ones(V) \
+ _mm_testc_si128 ((V), _mm_cmpeq_epi32 ((V), (V)))
+
+#define _mm_test_mix_ones_zeros(M, V) _mm_testnzc_si128 ((M), (V))
+
+/* Packed/scalar double precision floating point rounding. */
+
+#ifdef __OPTIMIZE__
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_round_pd (__m128d __V, const int __M)
+{
+ return (__m128d) __builtin_ia32_roundpd ((__v2df)__V, __M);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_round_sd(__m128d __D, __m128d __V, const int __M)
+{
+ return (__m128d) __builtin_ia32_roundsd ((__v2df)__D,
+ (__v2df)__V,
+ __M);
+}
+#else
+#define _mm_round_pd(V, M) \
+ ((__m128d) __builtin_ia32_roundpd ((__v2df)(__m128d)(V), (int)(M)))
+
+#define _mm_round_sd(D, V, M) \
+ ((__m128d) __builtin_ia32_roundsd ((__v2df)(__m128d)(D), \
+ (__v2df)(__m128d)(V), (int)(M)))
+#endif
+
+/* Packed/scalar single precision floating point rounding. */
+
+#ifdef __OPTIMIZE__
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_round_ps (__m128 __V, const int __M)
+{
+ return (__m128) __builtin_ia32_roundps ((__v4sf)__V, __M);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_round_ss (__m128 __D, __m128 __V, const int __M)
+{
+ return (__m128) __builtin_ia32_roundss ((__v4sf)__D,
+ (__v4sf)__V,
+ __M);
+}
+#else
+#define _mm_round_ps(V, M) \
+ ((__m128) __builtin_ia32_roundps ((__v4sf)(__m128)(V), (int)(M)))
+
+#define _mm_round_ss(D, V, M) \
+ ((__m128) __builtin_ia32_roundss ((__v4sf)(__m128)(D), \
+ (__v4sf)(__m128)(V), (int)(M)))
+#endif
+
+/* Macros for ceil/floor intrinsics. */
+#define _mm_ceil_pd(V) _mm_round_pd ((V), _MM_FROUND_CEIL)
+#define _mm_ceil_sd(D, V) _mm_round_sd ((D), (V), _MM_FROUND_CEIL)
+
+#define _mm_floor_pd(V) _mm_round_pd((V), _MM_FROUND_FLOOR)
+#define _mm_floor_sd(D, V) _mm_round_sd ((D), (V), _MM_FROUND_FLOOR)
+
+#define _mm_ceil_ps(V) _mm_round_ps ((V), _MM_FROUND_CEIL)
+#define _mm_ceil_ss(D, V) _mm_round_ss ((D), (V), _MM_FROUND_CEIL)
+
+#define _mm_floor_ps(V) _mm_round_ps ((V), _MM_FROUND_FLOOR)
+#define _mm_floor_ss(D, V) _mm_round_ss ((D), (V), _MM_FROUND_FLOOR)
+
+#endif /* __SSE5__/__SSE4_1__ */
+
+#endif /* _MMINTRIN_COMMON_H_INCLUDED */
diff --git a/lib/gcc/i686-linux/4.4.3/include/mmintrin.h b/lib/gcc/i686-linux/4.4.3/include/mmintrin.h
new file mode 100644
index 0000000..497e22e
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include/mmintrin.h
@@ -0,0 +1,921 @@
+/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+ Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ GCC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* Implemented from the specification included in the Intel C++ Compiler
+ User Guide and Reference, version 9.0. */
+
+#ifndef _MMINTRIN_H_INCLUDED
+#define _MMINTRIN_H_INCLUDED
+
+#ifndef __MMX__
+# error "MMX instruction set not enabled"
+#else
+/* The Intel API is flexible enough that we must allow aliasing with other
+ vector types, and their scalar components. */
+typedef int __m64 __attribute__ ((__vector_size__ (8), __may_alias__));
+
+/* Internal data types for implementing the intrinsics. */
+typedef int __v2si __attribute__ ((__vector_size__ (8)));
+typedef short __v4hi __attribute__ ((__vector_size__ (8)));
+typedef char __v8qi __attribute__ ((__vector_size__ (8)));
+typedef long long __v1di __attribute__ ((__vector_size__ (8)));
+typedef float __v2sf __attribute__ ((__vector_size__ (8)));
+
+/* Empty the multimedia state. */
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_empty (void)
+{
+ __builtin_ia32_emms ();
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_empty (void)
+{
+ _mm_empty ();
+}
+
+/* Convert I to a __m64 object. The integer is zero-extended to 64-bits. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsi32_si64 (int __i)
+{
+ return (__m64) __builtin_ia32_vec_init_v2si (__i, 0);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_from_int (int __i)
+{
+ return _mm_cvtsi32_si64 (__i);
+}
+
+#ifdef __x86_64__
+/* Convert I to a __m64 object. */
+
+/* Intel intrinsic. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_from_int64 (long long __i)
+{
+ return (__m64) __i;
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsi64_m64 (long long __i)
+{
+ return (__m64) __i;
+}
+
+/* Microsoft intrinsic. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsi64x_si64 (long long __i)
+{
+ return (__m64) __i;
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set_pi64x (long long __i)
+{
+ return (__m64) __i;
+}
+#endif
+
+/* Convert the lower 32 bits of the __m64 object into an integer. */
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsi64_si32 (__m64 __i)
+{
+ return __builtin_ia32_vec_ext_v2si ((__v2si)__i, 0);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_to_int (__m64 __i)
+{
+ return _mm_cvtsi64_si32 (__i);
+}
+
+#ifdef __x86_64__
+/* Convert the __m64 object to a 64bit integer. */
+
+/* Intel intrinsic. */
+extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_to_int64 (__m64 __i)
+{
+ return (long long)__i;
+}
+
+extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtm64_si64 (__m64 __i)
+{
+ return (long long)__i;
+}
+
+/* Microsoft intrinsic. */
+extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsi64_si64x (__m64 __i)
+{
+ return (long long)__i;
+}
+#endif
+
+/* Pack the four 16-bit values from M1 into the lower four 8-bit values of
+ the result, and the four 16-bit values from M2 into the upper four 8-bit
+ values of the result, all with signed saturation. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_packs_pi16 (__m64 __m1, __m64 __m2)
+{
+ return (__m64) __builtin_ia32_packsswb ((__v4hi)__m1, (__v4hi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_packsswb (__m64 __m1, __m64 __m2)
+{
+ return _mm_packs_pi16 (__m1, __m2);
+}
+
+/* Pack the two 32-bit values from M1 in to the lower two 16-bit values of
+ the result, and the two 32-bit values from M2 into the upper two 16-bit
+ values of the result, all with signed saturation. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_packs_pi32 (__m64 __m1, __m64 __m2)
+{
+ return (__m64) __builtin_ia32_packssdw ((__v2si)__m1, (__v2si)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_packssdw (__m64 __m1, __m64 __m2)
+{
+ return _mm_packs_pi32 (__m1, __m2);
+}
+
+/* Pack the four 16-bit values from M1 into the lower four 8-bit values of
+ the result, and the four 16-bit values from M2 into the upper four 8-bit
+ values of the result, all with unsigned saturation. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_packs_pu16 (__m64 __m1, __m64 __m2)
+{
+ return (__m64) __builtin_ia32_packuswb ((__v4hi)__m1, (__v4hi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_packuswb (__m64 __m1, __m64 __m2)
+{
+ return _mm_packs_pu16 (__m1, __m2);
+}
+
+/* Interleave the four 8-bit values from the high half of M1 with the four
+ 8-bit values from the high half of M2. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_unpackhi_pi8 (__m64 __m1, __m64 __m2)
+{
+ return (__m64) __builtin_ia32_punpckhbw ((__v8qi)__m1, (__v8qi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_punpckhbw (__m64 __m1, __m64 __m2)
+{
+ return _mm_unpackhi_pi8 (__m1, __m2);
+}
+
+/* Interleave the two 16-bit values from the high half of M1 with the two
+ 16-bit values from the high half of M2. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_unpackhi_pi16 (__m64 __m1, __m64 __m2)
+{
+ return (__m64) __builtin_ia32_punpckhwd ((__v4hi)__m1, (__v4hi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_punpckhwd (__m64 __m1, __m64 __m2)
+{
+ return _mm_unpackhi_pi16 (__m1, __m2);
+}
+
+/* Interleave the 32-bit value from the high half of M1 with the 32-bit
+ value from the high half of M2. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_unpackhi_pi32 (__m64 __m1, __m64 __m2)
+{
+ return (__m64) __builtin_ia32_punpckhdq ((__v2si)__m1, (__v2si)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_punpckhdq (__m64 __m1, __m64 __m2)
+{
+ return _mm_unpackhi_pi32 (__m1, __m2);
+}
+
+/* Interleave the four 8-bit values from the low half of M1 with the four
+ 8-bit values from the low half of M2. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_unpacklo_pi8 (__m64 __m1, __m64 __m2)
+{
+ return (__m64) __builtin_ia32_punpcklbw ((__v8qi)__m1, (__v8qi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_punpcklbw (__m64 __m1, __m64 __m2)
+{
+ return _mm_unpacklo_pi8 (__m1, __m2);
+}
+
+/* Interleave the two 16-bit values from the low half of M1 with the two
+ 16-bit values from the low half of M2. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_unpacklo_pi16 (__m64 __m1, __m64 __m2)
+{
+ return (__m64) __builtin_ia32_punpcklwd ((__v4hi)__m1, (__v4hi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_punpcklwd (__m64 __m1, __m64 __m2)
+{
+ return _mm_unpacklo_pi16 (__m1, __m2);
+}
+
+/* Interleave the 32-bit value from the low half of M1 with the 32-bit
+ value from the low half of M2. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_unpacklo_pi32 (__m64 __m1, __m64 __m2)
+{
+ return (__m64) __builtin_ia32_punpckldq ((__v2si)__m1, (__v2si)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_punpckldq (__m64 __m1, __m64 __m2)
+{
+ return _mm_unpacklo_pi32 (__m1, __m2);
+}
+
+/* Add the 8-bit values in M1 to the 8-bit values in M2. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_add_pi8 (__m64 __m1, __m64 __m2)
+{
+ return (__m64) __builtin_ia32_paddb ((__v8qi)__m1, (__v8qi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_paddb (__m64 __m1, __m64 __m2)
+{
+ return _mm_add_pi8 (__m1, __m2);
+}
+
+/* Add the 16-bit values in M1 to the 16-bit values in M2. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_add_pi16 (__m64 __m1, __m64 __m2)
+{
+ return (__m64) __builtin_ia32_paddw ((__v4hi)__m1, (__v4hi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_paddw (__m64 __m1, __m64 __m2)
+{
+ return _mm_add_pi16 (__m1, __m2);
+}
+
+/* Add the 32-bit values in M1 to the 32-bit values in M2. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_add_pi32 (__m64 __m1, __m64 __m2)
+{
+ return (__m64) __builtin_ia32_paddd ((__v2si)__m1, (__v2si)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_paddd (__m64 __m1, __m64 __m2)
+{
+ return _mm_add_pi32 (__m1, __m2);
+}
+
+/* Add the 64-bit values in M1 to the 64-bit values in M2. */
+#ifdef __SSE2__
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_add_si64 (__m64 __m1, __m64 __m2)
+{
+ return (__m64) __builtin_ia32_paddq ((__v1di)__m1, (__v1di)__m2);
+}
+#endif
+
+/* Add the 8-bit values in M1 to the 8-bit values in M2 using signed
+ saturated arithmetic. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_adds_pi8 (__m64 __m1, __m64 __m2)
+{
+ return (__m64) __builtin_ia32_paddsb ((__v8qi)__m1, (__v8qi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_paddsb (__m64 __m1, __m64 __m2)
+{
+ return _mm_adds_pi8 (__m1, __m2);
+}
+
+/* Add the 16-bit values in M1 to the 16-bit values in M2 using signed
+ saturated arithmetic. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_adds_pi16 (__m64 __m1, __m64 __m2)
+{
+ return (__m64) __builtin_ia32_paddsw ((__v4hi)__m1, (__v4hi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_paddsw (__m64 __m1, __m64 __m2)
+{
+ return _mm_adds_pi16 (__m1, __m2);
+}
+
+/* Add the 8-bit values in M1 to the 8-bit values in M2 using unsigned
+ saturated arithmetic. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_adds_pu8 (__m64 __m1, __m64 __m2)
+{
+ return (__m64) __builtin_ia32_paddusb ((__v8qi)__m1, (__v8qi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_paddusb (__m64 __m1, __m64 __m2)
+{
+ return _mm_adds_pu8 (__m1, __m2);
+}
+
+/* Add the 16-bit values in M1 to the 16-bit values in M2 using unsigned
+ saturated arithmetic. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_adds_pu16 (__m64 __m1, __m64 __m2)
+{
+ return (__m64) __builtin_ia32_paddusw ((__v4hi)__m1, (__v4hi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_paddusw (__m64 __m1, __m64 __m2)
+{
+ return _mm_adds_pu16 (__m1, __m2);
+}
+
+/* Subtract the 8-bit values in M2 from the 8-bit values in M1. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sub_pi8 (__m64 __m1, __m64 __m2)
+{
+ return (__m64) __builtin_ia32_psubb ((__v8qi)__m1, (__v8qi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psubb (__m64 __m1, __m64 __m2)
+{
+ return _mm_sub_pi8 (__m1, __m2);
+}
+
+/* Subtract the 16-bit values in M2 from the 16-bit values in M1. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sub_pi16 (__m64 __m1, __m64 __m2)
+{
+ return (__m64) __builtin_ia32_psubw ((__v4hi)__m1, (__v4hi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psubw (__m64 __m1, __m64 __m2)
+{
+ return _mm_sub_pi16 (__m1, __m2);
+}
+
+/* Subtract the 32-bit values in M2 from the 32-bit values in M1. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sub_pi32 (__m64 __m1, __m64 __m2)
+{
+ return (__m64) __builtin_ia32_psubd ((__v2si)__m1, (__v2si)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psubd (__m64 __m1, __m64 __m2)
+{
+ return _mm_sub_pi32 (__m1, __m2);
+}
+
+/* Add the 64-bit values in M1 to the 64-bit values in M2. */
+#ifdef __SSE2__
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sub_si64 (__m64 __m1, __m64 __m2)
+{
+ return (__m64) __builtin_ia32_psubq ((__v1di)__m1, (__v1di)__m2);
+}
+#endif
+
+/* Subtract the 8-bit values in M2 from the 8-bit values in M1 using signed
+ saturating arithmetic. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_subs_pi8 (__m64 __m1, __m64 __m2)
+{
+ return (__m64) __builtin_ia32_psubsb ((__v8qi)__m1, (__v8qi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psubsb (__m64 __m1, __m64 __m2)
+{
+ return _mm_subs_pi8 (__m1, __m2);
+}
+
+/* Subtract the 16-bit values in M2 from the 16-bit values in M1 using
+ signed saturating arithmetic. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_subs_pi16 (__m64 __m1, __m64 __m2)
+{
+ return (__m64) __builtin_ia32_psubsw ((__v4hi)__m1, (__v4hi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psubsw (__m64 __m1, __m64 __m2)
+{
+ return _mm_subs_pi16 (__m1, __m2);
+}
+
+/* Subtract the 8-bit values in M2 from the 8-bit values in M1 using
+ unsigned saturating arithmetic. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_subs_pu8 (__m64 __m1, __m64 __m2)
+{
+ return (__m64) __builtin_ia32_psubusb ((__v8qi)__m1, (__v8qi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psubusb (__m64 __m1, __m64 __m2)
+{
+ return _mm_subs_pu8 (__m1, __m2);
+}
+
+/* Subtract the 16-bit values in M2 from the 16-bit values in M1 using
+ unsigned saturating arithmetic. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_subs_pu16 (__m64 __m1, __m64 __m2)
+{
+ return (__m64) __builtin_ia32_psubusw ((__v4hi)__m1, (__v4hi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psubusw (__m64 __m1, __m64 __m2)
+{
+ return _mm_subs_pu16 (__m1, __m2);
+}
+
+/* Multiply four 16-bit values in M1 by four 16-bit values in M2 producing
+ four 32-bit intermediate results, which are then summed by pairs to
+ produce two 32-bit results. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_madd_pi16 (__m64 __m1, __m64 __m2)
+{
+ return (__m64) __builtin_ia32_pmaddwd ((__v4hi)__m1, (__v4hi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pmaddwd (__m64 __m1, __m64 __m2)
+{
+ return _mm_madd_pi16 (__m1, __m2);
+}
+
+/* Multiply four signed 16-bit values in M1 by four signed 16-bit values in
+ M2 and produce the high 16 bits of the 32-bit results. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_mulhi_pi16 (__m64 __m1, __m64 __m2)
+{
+ return (__m64) __builtin_ia32_pmulhw ((__v4hi)__m1, (__v4hi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pmulhw (__m64 __m1, __m64 __m2)
+{
+ return _mm_mulhi_pi16 (__m1, __m2);
+}
+
+/* Multiply four 16-bit values in M1 by four 16-bit values in M2 and produce
+ the low 16 bits of the results. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_mullo_pi16 (__m64 __m1, __m64 __m2)
+{
+ return (__m64) __builtin_ia32_pmullw ((__v4hi)__m1, (__v4hi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pmullw (__m64 __m1, __m64 __m2)
+{
+ return _mm_mullo_pi16 (__m1, __m2);
+}
+
+/* Shift four 16-bit values in M left by COUNT. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sll_pi16 (__m64 __m, __m64 __count)
+{
+ return (__m64) __builtin_ia32_psllw ((__v4hi)__m, (__v4hi)__count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psllw (__m64 __m, __m64 __count)
+{
+ return _mm_sll_pi16 (__m, __count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_slli_pi16 (__m64 __m, int __count)
+{
+ return (__m64) __builtin_ia32_psllwi ((__v4hi)__m, __count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psllwi (__m64 __m, int __count)
+{
+ return _mm_slli_pi16 (__m, __count);
+}
+
+/* Shift two 32-bit values in M left by COUNT. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sll_pi32 (__m64 __m, __m64 __count)
+{
+ return (__m64) __builtin_ia32_pslld ((__v2si)__m, (__v2si)__count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pslld (__m64 __m, __m64 __count)
+{
+ return _mm_sll_pi32 (__m, __count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_slli_pi32 (__m64 __m, int __count)
+{
+ return (__m64) __builtin_ia32_pslldi ((__v2si)__m, __count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pslldi (__m64 __m, int __count)
+{
+ return _mm_slli_pi32 (__m, __count);
+}
+
+/* Shift the 64-bit value in M left by COUNT. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sll_si64 (__m64 __m, __m64 __count)
+{
+ return (__m64) __builtin_ia32_psllq ((__v1di)__m, (__v1di)__count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psllq (__m64 __m, __m64 __count)
+{
+ return _mm_sll_si64 (__m, __count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_slli_si64 (__m64 __m, int __count)
+{
+ return (__m64) __builtin_ia32_psllqi ((__v1di)__m, __count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psllqi (__m64 __m, int __count)
+{
+ return _mm_slli_si64 (__m, __count);
+}
+
+/* Shift four 16-bit values in M right by COUNT; shift in the sign bit. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sra_pi16 (__m64 __m, __m64 __count)
+{
+ return (__m64) __builtin_ia32_psraw ((__v4hi)__m, (__v4hi)__count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psraw (__m64 __m, __m64 __count)
+{
+ return _mm_sra_pi16 (__m, __count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_srai_pi16 (__m64 __m, int __count)
+{
+ return (__m64) __builtin_ia32_psrawi ((__v4hi)__m, __count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psrawi (__m64 __m, int __count)
+{
+ return _mm_srai_pi16 (__m, __count);
+}
+
+/* Shift two 32-bit values in M right by COUNT; shift in the sign bit. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sra_pi32 (__m64 __m, __m64 __count)
+{
+ return (__m64) __builtin_ia32_psrad ((__v2si)__m, (__v2si)__count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psrad (__m64 __m, __m64 __count)
+{
+ return _mm_sra_pi32 (__m, __count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_srai_pi32 (__m64 __m, int __count)
+{
+ return (__m64) __builtin_ia32_psradi ((__v2si)__m, __count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psradi (__m64 __m, int __count)
+{
+ return _mm_srai_pi32 (__m, __count);
+}
+
+/* Shift four 16-bit values in M right by COUNT; shift in zeros. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_srl_pi16 (__m64 __m, __m64 __count)
+{
+ return (__m64) __builtin_ia32_psrlw ((__v4hi)__m, (__v4hi)__count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psrlw (__m64 __m, __m64 __count)
+{
+ return _mm_srl_pi16 (__m, __count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_srli_pi16 (__m64 __m, int __count)
+{
+ return (__m64) __builtin_ia32_psrlwi ((__v4hi)__m, __count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psrlwi (__m64 __m, int __count)
+{
+ return _mm_srli_pi16 (__m, __count);
+}
+
+/* Shift two 32-bit values in M right by COUNT; shift in zeros. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_srl_pi32 (__m64 __m, __m64 __count)
+{
+ return (__m64) __builtin_ia32_psrld ((__v2si)__m, (__v2si)__count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psrld (__m64 __m, __m64 __count)
+{
+ return _mm_srl_pi32 (__m, __count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_srli_pi32 (__m64 __m, int __count)
+{
+ return (__m64) __builtin_ia32_psrldi ((__v2si)__m, __count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psrldi (__m64 __m, int __count)
+{
+ return _mm_srli_pi32 (__m, __count);
+}
+
+/* Shift the 64-bit value in M left by COUNT; shift in zeros. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_srl_si64 (__m64 __m, __m64 __count)
+{
+ return (__m64) __builtin_ia32_psrlq ((__v1di)__m, (__v1di)__count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psrlq (__m64 __m, __m64 __count)
+{
+ return _mm_srl_si64 (__m, __count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_srli_si64 (__m64 __m, int __count)
+{
+ return (__m64) __builtin_ia32_psrlqi ((__v1di)__m, __count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psrlqi (__m64 __m, int __count)
+{
+ return _mm_srli_si64 (__m, __count);
+}
+
+/* Bit-wise AND the 64-bit values in M1 and M2. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_and_si64 (__m64 __m1, __m64 __m2)
+{
+ return __builtin_ia32_pand (__m1, __m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pand (__m64 __m1, __m64 __m2)
+{
+ return _mm_and_si64 (__m1, __m2);
+}
+
+/* Bit-wise complement the 64-bit value in M1 and bit-wise AND it with the
+ 64-bit value in M2. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_andnot_si64 (__m64 __m1, __m64 __m2)
+{
+ return __builtin_ia32_pandn (__m1, __m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pandn (__m64 __m1, __m64 __m2)
+{
+ return _mm_andnot_si64 (__m1, __m2);
+}
+
+/* Bit-wise inclusive OR the 64-bit values in M1 and M2. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_or_si64 (__m64 __m1, __m64 __m2)
+{
+ return __builtin_ia32_por (__m1, __m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_por (__m64 __m1, __m64 __m2)
+{
+ return _mm_or_si64 (__m1, __m2);
+}
+
+/* Bit-wise exclusive OR the 64-bit values in M1 and M2. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_xor_si64 (__m64 __m1, __m64 __m2)
+{
+ return __builtin_ia32_pxor (__m1, __m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pxor (__m64 __m1, __m64 __m2)
+{
+ return _mm_xor_si64 (__m1, __m2);
+}
+
+/* Compare eight 8-bit values. The result of the comparison is 0xFF if the
+ test is true and zero if false. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpeq_pi8 (__m64 __m1, __m64 __m2)
+{
+ return (__m64) __builtin_ia32_pcmpeqb ((__v8qi)__m1, (__v8qi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pcmpeqb (__m64 __m1, __m64 __m2)
+{
+ return _mm_cmpeq_pi8 (__m1, __m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpgt_pi8 (__m64 __m1, __m64 __m2)
+{
+ return (__m64) __builtin_ia32_pcmpgtb ((__v8qi)__m1, (__v8qi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pcmpgtb (__m64 __m1, __m64 __m2)
+{
+ return _mm_cmpgt_pi8 (__m1, __m2);
+}
+
+/* Compare four 16-bit values. The result of the comparison is 0xFFFF if
+ the test is true and zero if false. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpeq_pi16 (__m64 __m1, __m64 __m2)
+{
+ return (__m64) __builtin_ia32_pcmpeqw ((__v4hi)__m1, (__v4hi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pcmpeqw (__m64 __m1, __m64 __m2)
+{
+ return _mm_cmpeq_pi16 (__m1, __m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpgt_pi16 (__m64 __m1, __m64 __m2)
+{
+ return (__m64) __builtin_ia32_pcmpgtw ((__v4hi)__m1, (__v4hi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pcmpgtw (__m64 __m1, __m64 __m2)
+{
+ return _mm_cmpgt_pi16 (__m1, __m2);
+}
+
+/* Compare two 32-bit values. The result of the comparison is 0xFFFFFFFF if
+ the test is true and zero if false. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpeq_pi32 (__m64 __m1, __m64 __m2)
+{
+ return (__m64) __builtin_ia32_pcmpeqd ((__v2si)__m1, (__v2si)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pcmpeqd (__m64 __m1, __m64 __m2)
+{
+ return _mm_cmpeq_pi32 (__m1, __m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpgt_pi32 (__m64 __m1, __m64 __m2)
+{
+ return (__m64) __builtin_ia32_pcmpgtd ((__v2si)__m1, (__v2si)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pcmpgtd (__m64 __m1, __m64 __m2)
+{
+ return _mm_cmpgt_pi32 (__m1, __m2);
+}
+
+/* Creates a 64-bit zero. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_setzero_si64 (void)
+{
+ return (__m64)0LL;
+}
+
+/* Creates a vector of two 32-bit values; I0 is least significant. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set_pi32 (int __i1, int __i0)
+{
+ return (__m64) __builtin_ia32_vec_init_v2si (__i0, __i1);
+}
+
+/* Creates a vector of four 16-bit values; W0 is least significant. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set_pi16 (short __w3, short __w2, short __w1, short __w0)
+{
+ return (__m64) __builtin_ia32_vec_init_v4hi (__w0, __w1, __w2, __w3);
+}
+
+/* Creates a vector of eight 8-bit values; B0 is least significant. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set_pi8 (char __b7, char __b6, char __b5, char __b4,
+ char __b3, char __b2, char __b1, char __b0)
+{
+ return (__m64) __builtin_ia32_vec_init_v8qi (__b0, __b1, __b2, __b3,
+ __b4, __b5, __b6, __b7);
+}
+
+/* Similar, but with the arguments in reverse order. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_setr_pi32 (int __i0, int __i1)
+{
+ return _mm_set_pi32 (__i1, __i0);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_setr_pi16 (short __w0, short __w1, short __w2, short __w3)
+{
+ return _mm_set_pi16 (__w3, __w2, __w1, __w0);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_setr_pi8 (char __b0, char __b1, char __b2, char __b3,
+ char __b4, char __b5, char __b6, char __b7)
+{
+ return _mm_set_pi8 (__b7, __b6, __b5, __b4, __b3, __b2, __b1, __b0);
+}
+
+/* Creates a vector of two 32-bit values, both elements containing I. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set1_pi32 (int __i)
+{
+ return _mm_set_pi32 (__i, __i);
+}
+
+/* Creates a vector of four 16-bit values, all elements containing W. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set1_pi16 (short __w)
+{
+ return _mm_set_pi16 (__w, __w, __w, __w);
+}
+
+/* Creates a vector of eight 8-bit values, all elements containing B. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set1_pi8 (char __b)
+{
+ return _mm_set_pi8 (__b, __b, __b, __b, __b, __b, __b, __b);
+}
+
+#endif /* __MMX__ */
+#endif /* _MMINTRIN_H_INCLUDED */
diff --git a/lib/gcc/i686-linux/4.4.3/include/nmmintrin.h b/lib/gcc/i686-linux/4.4.3/include/nmmintrin.h
new file mode 100644
index 0000000..2a2d264
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include/nmmintrin.h
@@ -0,0 +1,37 @@
+/* Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ GCC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>.
+
+/* Implemented from the specification included in the Intel C++ Compiler
+ User Guide and Reference, version 10.0. */
+
+#ifndef _NMMINTRIN_H_INCLUDED
+#define _NMMINTRIN_H_INCLUDED
+
+#ifndef __SSE4_2__
+# error "SSE4.2 instruction set not enabled"
+#else
+/* We just include SSE4.1 header file. */
+#include <smmintrin.h>
+#endif /* __SSE4_2__ */
+
+#endif /* _NMMINTRIN_H_INCLUDED */
diff --git a/lib/gcc/i686-linux/4.4.3/include/omp.h b/lib/gcc/i686-linux/4.4.3/include/omp.h
new file mode 100644
index 0000000..6102dbf
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include/omp.h
@@ -0,0 +1,105 @@
+/* Copyright (C) 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
+ Contributed by Richard Henderson <rth@redhat.com>.
+
+ This file is part of the GNU OpenMP Library (libgomp).
+
+ Libgomp is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef OMP_H
+#define OMP_H 1
+
+#ifndef _LIBGOMP_OMP_LOCK_DEFINED
+#define _LIBGOMP_OMP_LOCK_DEFINED 1
+/* These two structures get edited by the libgomp build process to
+ reflect the shape of the two types. Their internals are private
+ to the library. */
+
+typedef struct
+{
+ unsigned char _x[4]
+ __attribute__((__aligned__(4)));
+} omp_lock_t;
+
+typedef struct
+{
+ unsigned char _x[12]
+ __attribute__((__aligned__(4)));
+} omp_nest_lock_t;
+#endif
+
+typedef enum omp_sched_t
+{
+ omp_sched_static = 1,
+ omp_sched_dynamic = 2,
+ omp_sched_guided = 3,
+ omp_sched_auto = 4
+} omp_sched_t;
+
+#ifdef __cplusplus
+extern "C" {
+# define __GOMP_NOTHROW throw ()
+#else
+# define __GOMP_NOTHROW __attribute__((__nothrow__))
+#endif
+
+extern void omp_set_num_threads (int) __GOMP_NOTHROW;
+extern int omp_get_num_threads (void) __GOMP_NOTHROW;
+extern int omp_get_max_threads (void) __GOMP_NOTHROW;
+extern int omp_get_thread_num (void) __GOMP_NOTHROW;
+extern int omp_get_num_procs (void) __GOMP_NOTHROW;
+
+extern int omp_in_parallel (void) __GOMP_NOTHROW;
+
+extern void omp_set_dynamic (int) __GOMP_NOTHROW;
+extern int omp_get_dynamic (void) __GOMP_NOTHROW;
+
+extern void omp_set_nested (int) __GOMP_NOTHROW;
+extern int omp_get_nested (void) __GOMP_NOTHROW;
+
+extern void omp_init_lock (omp_lock_t *) __GOMP_NOTHROW;
+extern void omp_destroy_lock (omp_lock_t *) __GOMP_NOTHROW;
+extern void omp_set_lock (omp_lock_t *) __GOMP_NOTHROW;
+extern void omp_unset_lock (omp_lock_t *) __GOMP_NOTHROW;
+extern int omp_test_lock (omp_lock_t *) __GOMP_NOTHROW;
+
+extern void omp_init_nest_lock (omp_nest_lock_t *) __GOMP_NOTHROW;
+extern void omp_destroy_nest_lock (omp_nest_lock_t *) __GOMP_NOTHROW;
+extern void omp_set_nest_lock (omp_nest_lock_t *) __GOMP_NOTHROW;
+extern void omp_unset_nest_lock (omp_nest_lock_t *) __GOMP_NOTHROW;
+extern int omp_test_nest_lock (omp_nest_lock_t *) __GOMP_NOTHROW;
+
+extern double omp_get_wtime (void) __GOMP_NOTHROW;
+extern double omp_get_wtick (void) __GOMP_NOTHROW;
+
+void omp_set_schedule (omp_sched_t, int) __GOMP_NOTHROW;
+void omp_get_schedule (omp_sched_t *, int *) __GOMP_NOTHROW;
+int omp_get_thread_limit (void) __GOMP_NOTHROW;
+void omp_set_max_active_levels (int) __GOMP_NOTHROW;
+int omp_get_max_active_levels (void) __GOMP_NOTHROW;
+int omp_get_level (void) __GOMP_NOTHROW;
+int omp_get_ancestor_thread_num (int) __GOMP_NOTHROW;
+int omp_get_team_size (int) __GOMP_NOTHROW;
+int omp_get_active_level (void) __GOMP_NOTHROW;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* OMP_H */
diff --git a/lib/gcc/i686-linux/4.4.3/include/pmmintrin.h b/lib/gcc/i686-linux/4.4.3/include/pmmintrin.h
new file mode 100644
index 0000000..c5c9ae2
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include/pmmintrin.h
@@ -0,0 +1,128 @@
+/* Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
+ Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ GCC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* Implemented from the specification included in the Intel C++ Compiler
+ User Guide and Reference, version 9.0. */
+
+#ifndef _PMMINTRIN_H_INCLUDED
+#define _PMMINTRIN_H_INCLUDED
+
+#ifndef __SSE3__
+# error "SSE3 instruction set not enabled"
+#else
+
+/* We need definitions from the SSE2 and SSE header files*/
+#include <emmintrin.h>
+
+/* Additional bits in the MXCSR. */
+#define _MM_DENORMALS_ZERO_MASK 0x0040
+#define _MM_DENORMALS_ZERO_ON 0x0040
+#define _MM_DENORMALS_ZERO_OFF 0x0000
+
+#define _MM_SET_DENORMALS_ZERO_MODE(mode) \
+ _mm_setcsr ((_mm_getcsr () & ~_MM_DENORMALS_ZERO_MASK) | (mode))
+#define _MM_GET_DENORMALS_ZERO_MODE() \
+ (_mm_getcsr() & _MM_DENORMALS_ZERO_MASK)
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_addsub_ps (__m128 __X, __m128 __Y)
+{
+ return (__m128) __builtin_ia32_addsubps ((__v4sf)__X, (__v4sf)__Y);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_hadd_ps (__m128 __X, __m128 __Y)
+{
+ return (__m128) __builtin_ia32_haddps ((__v4sf)__X, (__v4sf)__Y);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_hsub_ps (__m128 __X, __m128 __Y)
+{
+ return (__m128) __builtin_ia32_hsubps ((__v4sf)__X, (__v4sf)__Y);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_movehdup_ps (__m128 __X)
+{
+ return (__m128) __builtin_ia32_movshdup ((__v4sf)__X);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_moveldup_ps (__m128 __X)
+{
+ return (__m128) __builtin_ia32_movsldup ((__v4sf)__X);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_addsub_pd (__m128d __X, __m128d __Y)
+{
+ return (__m128d) __builtin_ia32_addsubpd ((__v2df)__X, (__v2df)__Y);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_hadd_pd (__m128d __X, __m128d __Y)
+{
+ return (__m128d) __builtin_ia32_haddpd ((__v2df)__X, (__v2df)__Y);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_hsub_pd (__m128d __X, __m128d __Y)
+{
+ return (__m128d) __builtin_ia32_hsubpd ((__v2df)__X, (__v2df)__Y);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_loaddup_pd (double const *__P)
+{
+ return _mm_load1_pd (__P);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_movedup_pd (__m128d __X)
+{
+ return _mm_shuffle_pd (__X, __X, _MM_SHUFFLE2 (0,0));
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_lddqu_si128 (__m128i const *__P)
+{
+ return (__m128i) __builtin_ia32_lddqu ((char const *)__P);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_monitor (void const * __P, unsigned int __E, unsigned int __H)
+{
+ __builtin_ia32_monitor (__P, __E, __H);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_mwait (unsigned int __E, unsigned int __H)
+{
+ __builtin_ia32_mwait (__E, __H);
+}
+
+#endif /* __SSE3__ */
+
+#endif /* _PMMINTRIN_H_INCLUDED */
diff --git a/lib/gcc/i686-linux/4.4.3/include/smmintrin.h b/lib/gcc/i686-linux/4.4.3/include/smmintrin.h
new file mode 100644
index 0000000..1a29989
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include/smmintrin.h
@@ -0,0 +1,724 @@
+/* Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ GCC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>.
+
+
+/* Implemented from the specification included in the Intel C++ Compiler
+ User Guide and Reference, version 10.0. */
+
+#ifndef _SMMINTRIN_H_INCLUDED
+#define _SMMINTRIN_H_INCLUDED
+
+#ifndef __SSE4_1__
+# error "SSE4.1 instruction set not enabled"
+#else
+
+/* We need definitions from the SSSE3, SSE3, SSE2 and SSE header
+ files. */
+#include <tmmintrin.h>
+#include <mmintrin-common.h>
+
+/* SSE4.1 */
+
+/* Integer blend instructions - select data from 2 sources using
+ constant/variable mask. */
+
+#ifdef __OPTIMIZE__
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_blend_epi16 (__m128i __X, __m128i __Y, const int __M)
+{
+ return (__m128i) __builtin_ia32_pblendw128 ((__v8hi)__X,
+ (__v8hi)__Y,
+ __M);
+}
+#else
+#define _mm_blend_epi16(X, Y, M) \
+ ((__m128i) __builtin_ia32_pblendw128 ((__v8hi)(__m128i)(X), \
+ (__v8hi)(__m128i)(Y), (int)(M)))
+#endif
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_blendv_epi8 (__m128i __X, __m128i __Y, __m128i __M)
+{
+ return (__m128i) __builtin_ia32_pblendvb128 ((__v16qi)__X,
+ (__v16qi)__Y,
+ (__v16qi)__M);
+}
+
+/* Single precision floating point blend instructions - select data
+ from 2 sources using constant/variable mask. */
+
+#ifdef __OPTIMIZE__
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_blend_ps (__m128 __X, __m128 __Y, const int __M)
+{
+ return (__m128) __builtin_ia32_blendps ((__v4sf)__X,
+ (__v4sf)__Y,
+ __M);
+}
+#else
+#define _mm_blend_ps(X, Y, M) \
+ ((__m128) __builtin_ia32_blendps ((__v4sf)(__m128)(X), \
+ (__v4sf)(__m128)(Y), (int)(M)))
+#endif
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_blendv_ps (__m128 __X, __m128 __Y, __m128 __M)
+{
+ return (__m128) __builtin_ia32_blendvps ((__v4sf)__X,
+ (__v4sf)__Y,
+ (__v4sf)__M);
+}
+
+/* Double precision floating point blend instructions - select data
+ from 2 sources using constant/variable mask. */
+
+#ifdef __OPTIMIZE__
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_blend_pd (__m128d __X, __m128d __Y, const int __M)
+{
+ return (__m128d) __builtin_ia32_blendpd ((__v2df)__X,
+ (__v2df)__Y,
+ __M);
+}
+#else
+#define _mm_blend_pd(X, Y, M) \
+ ((__m128d) __builtin_ia32_blendpd ((__v2df)(__m128d)(X), \
+ (__v2df)(__m128d)(Y), (int)(M)))
+#endif
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_blendv_pd (__m128d __X, __m128d __Y, __m128d __M)
+{
+ return (__m128d) __builtin_ia32_blendvpd ((__v2df)__X,
+ (__v2df)__Y,
+ (__v2df)__M);
+}
+
+/* Dot product instructions with mask-defined summing and zeroing parts
+ of result. */
+
+#ifdef __OPTIMIZE__
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_dp_ps (__m128 __X, __m128 __Y, const int __M)
+{
+ return (__m128) __builtin_ia32_dpps ((__v4sf)__X,
+ (__v4sf)__Y,
+ __M);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_dp_pd (__m128d __X, __m128d __Y, const int __M)
+{
+ return (__m128d) __builtin_ia32_dppd ((__v2df)__X,
+ (__v2df)__Y,
+ __M);
+}
+#else
+#define _mm_dp_ps(X, Y, M) \
+ ((__m128) __builtin_ia32_dpps ((__v4sf)(__m128)(X), \
+ (__v4sf)(__m128)(Y), (int)(M)))
+
+#define _mm_dp_pd(X, Y, M) \
+ ((__m128d) __builtin_ia32_dppd ((__v2df)(__m128d)(X), \
+ (__v2df)(__m128d)(Y), (int)(M)))
+#endif
+
+/* Packed integer 64-bit comparison, zeroing or filling with ones
+ corresponding parts of result. */
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpeq_epi64 (__m128i __X, __m128i __Y)
+{
+ return (__m128i) __builtin_ia32_pcmpeqq ((__v2di)__X, (__v2di)__Y);
+}
+
+/* Min/max packed integer instructions. */
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_min_epi8 (__m128i __X, __m128i __Y)
+{
+ return (__m128i) __builtin_ia32_pminsb128 ((__v16qi)__X, (__v16qi)__Y);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_max_epi8 (__m128i __X, __m128i __Y)
+{
+ return (__m128i) __builtin_ia32_pmaxsb128 ((__v16qi)__X, (__v16qi)__Y);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_min_epu16 (__m128i __X, __m128i __Y)
+{
+ return (__m128i) __builtin_ia32_pminuw128 ((__v8hi)__X, (__v8hi)__Y);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_max_epu16 (__m128i __X, __m128i __Y)
+{
+ return (__m128i) __builtin_ia32_pmaxuw128 ((__v8hi)__X, (__v8hi)__Y);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_min_epi32 (__m128i __X, __m128i __Y)
+{
+ return (__m128i) __builtin_ia32_pminsd128 ((__v4si)__X, (__v4si)__Y);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_max_epi32 (__m128i __X, __m128i __Y)
+{
+ return (__m128i) __builtin_ia32_pmaxsd128 ((__v4si)__X, (__v4si)__Y);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_min_epu32 (__m128i __X, __m128i __Y)
+{
+ return (__m128i) __builtin_ia32_pminud128 ((__v4si)__X, (__v4si)__Y);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_max_epu32 (__m128i __X, __m128i __Y)
+{
+ return (__m128i) __builtin_ia32_pmaxud128 ((__v4si)__X, (__v4si)__Y);
+}
+
+/* Packed integer 32-bit multiplication with truncation of upper
+ halves of results. */
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_mullo_epi32 (__m128i __X, __m128i __Y)
+{
+ return (__m128i) __builtin_ia32_pmulld128 ((__v4si)__X, (__v4si)__Y);
+}
+
+/* Packed integer 32-bit multiplication of 2 pairs of operands
+ with two 64-bit results. */
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_mul_epi32 (__m128i __X, __m128i __Y)
+{
+ return (__m128i) __builtin_ia32_pmuldq128 ((__v4si)__X, (__v4si)__Y);
+}
+
+/* Insert single precision float into packed single precision array
+ element selected by index N. The bits [7-6] of N define S
+ index, the bits [5-4] define D index, and bits [3-0] define
+ zeroing mask for D. */
+
+#ifdef __OPTIMIZE__
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_insert_ps (__m128 __D, __m128 __S, const int __N)
+{
+ return (__m128) __builtin_ia32_insertps128 ((__v4sf)__D,
+ (__v4sf)__S,
+ __N);
+}
+#else
+#define _mm_insert_ps(D, S, N) \
+ ((__m128) __builtin_ia32_insertps128 ((__v4sf)(__m128)(D), \
+ (__v4sf)(__m128)(S), (int)(N)))
+#endif
+
+/* Helper macro to create the N value for _mm_insert_ps. */
+#define _MM_MK_INSERTPS_NDX(S, D, M) (((S) << 6) | ((D) << 4) | (M))
+
+/* Extract binary representation of single precision float from packed
+ single precision array element of X selected by index N. */
+
+#ifdef __OPTIMIZE__
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_extract_ps (__m128 __X, const int __N)
+{
+ union { int i; float f; } __tmp;
+ __tmp.f = __builtin_ia32_vec_ext_v4sf ((__v4sf)__X, __N);
+ return __tmp.i;
+}
+#else
+#define _mm_extract_ps(X, N) \
+ (__extension__ \
+ ({ \
+ union { int i; float f; } __tmp; \
+ __tmp.f = __builtin_ia32_vec_ext_v4sf ((__v4sf)(__m128)(X), (int)(N)); \
+ __tmp.i; \
+ }))
+#endif
+
+/* Extract binary representation of single precision float into
+ D from packed single precision array element of S selected
+ by index N. */
+#define _MM_EXTRACT_FLOAT(D, S, N) \
+ { (D) = __builtin_ia32_vec_ext_v4sf ((__v4sf)(S), (N)); }
+
+/* Extract specified single precision float element into the lower
+ part of __m128. */
+#define _MM_PICK_OUT_PS(X, N) \
+ _mm_insert_ps (_mm_setzero_ps (), (X), \
+ _MM_MK_INSERTPS_NDX ((N), 0, 0x0e))
+
+/* Insert integer, S, into packed integer array element of D
+ selected by index N. */
+
+#ifdef __OPTIMIZE__
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_insert_epi8 (__m128i __D, int __S, const int __N)
+{
+ return (__m128i) __builtin_ia32_vec_set_v16qi ((__v16qi)__D,
+ __S, __N);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_insert_epi32 (__m128i __D, int __S, const int __N)
+{
+ return (__m128i) __builtin_ia32_vec_set_v4si ((__v4si)__D,
+ __S, __N);
+}
+
+#ifdef __x86_64__
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_insert_epi64 (__m128i __D, long long __S, const int __N)
+{
+ return (__m128i) __builtin_ia32_vec_set_v2di ((__v2di)__D,
+ __S, __N);
+}
+#endif
+#else
+#define _mm_insert_epi8(D, S, N) \
+ ((__m128i) __builtin_ia32_vec_set_v16qi ((__v16qi)(__m128i)(D), \
+ (int)(S), (int)(N)))
+
+#define _mm_insert_epi32(D, S, N) \
+ ((__m128i) __builtin_ia32_vec_set_v4si ((__v4si)(__m128i)(D), \
+ (int)(S), (int)(N)))
+
+#ifdef __x86_64__
+#define _mm_insert_epi64(D, S, N) \
+ ((__m128i) __builtin_ia32_vec_set_v2di ((__v2di)(__m128i)(D), \
+ (long long)(S), (int)(N)))
+#endif
+#endif
+
+/* Extract integer from packed integer array element of X selected by
+ index N. */
+
+#ifdef __OPTIMIZE__
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_extract_epi8 (__m128i __X, const int __N)
+{
+ return __builtin_ia32_vec_ext_v16qi ((__v16qi)__X, __N);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_extract_epi32 (__m128i __X, const int __N)
+{
+ return __builtin_ia32_vec_ext_v4si ((__v4si)__X, __N);
+}
+
+#ifdef __x86_64__
+extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_extract_epi64 (__m128i __X, const int __N)
+{
+ return __builtin_ia32_vec_ext_v2di ((__v2di)__X, __N);
+}
+#endif
+#else
+#define _mm_extract_epi8(X, N) \
+ ((int) __builtin_ia32_vec_ext_v16qi ((__v16qi)(__m128i)(X), (int)(N)))
+#define _mm_extract_epi32(X, N) \
+ ((int) __builtin_ia32_vec_ext_v4si ((__v4si)(__m128i)(X), (int)(N)))
+
+#ifdef __x86_64__
+#define _mm_extract_epi64(X, N) \
+ ((long long) __builtin_ia32_vec_ext_v2di ((__v2di)(__m128i)(X), (int)(N)))
+#endif
+#endif
+
+/* Return horizontal packed word minimum and its index in bits [15:0]
+ and bits [18:16] respectively. */
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_minpos_epu16 (__m128i __X)
+{
+ return (__m128i) __builtin_ia32_phminposuw128 ((__v8hi)__X);
+}
+
+/* Packed integer sign-extension. */
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtepi8_epi32 (__m128i __X)
+{
+ return (__m128i) __builtin_ia32_pmovsxbd128 ((__v16qi)__X);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtepi16_epi32 (__m128i __X)
+{
+ return (__m128i) __builtin_ia32_pmovsxwd128 ((__v8hi)__X);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtepi8_epi64 (__m128i __X)
+{
+ return (__m128i) __builtin_ia32_pmovsxbq128 ((__v16qi)__X);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtepi32_epi64 (__m128i __X)
+{
+ return (__m128i) __builtin_ia32_pmovsxdq128 ((__v4si)__X);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtepi16_epi64 (__m128i __X)
+{
+ return (__m128i) __builtin_ia32_pmovsxwq128 ((__v8hi)__X);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtepi8_epi16 (__m128i __X)
+{
+ return (__m128i) __builtin_ia32_pmovsxbw128 ((__v16qi)__X);
+}
+
+/* Packed integer zero-extension. */
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtepu8_epi32 (__m128i __X)
+{
+ return (__m128i) __builtin_ia32_pmovzxbd128 ((__v16qi)__X);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtepu16_epi32 (__m128i __X)
+{
+ return (__m128i) __builtin_ia32_pmovzxwd128 ((__v8hi)__X);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtepu8_epi64 (__m128i __X)
+{
+ return (__m128i) __builtin_ia32_pmovzxbq128 ((__v16qi)__X);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtepu32_epi64 (__m128i __X)
+{
+ return (__m128i) __builtin_ia32_pmovzxdq128 ((__v4si)__X);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtepu16_epi64 (__m128i __X)
+{
+ return (__m128i) __builtin_ia32_pmovzxwq128 ((__v8hi)__X);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtepu8_epi16 (__m128i __X)
+{
+ return (__m128i) __builtin_ia32_pmovzxbw128 ((__v16qi)__X);
+}
+
+/* Pack 8 double words from 2 operands into 8 words of result with
+ unsigned saturation. */
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_packus_epi32 (__m128i __X, __m128i __Y)
+{
+ return (__m128i) __builtin_ia32_packusdw128 ((__v4si)__X, (__v4si)__Y);
+}
+
+/* Sum absolute 8-bit integer difference of adjacent groups of 4
+ byte integers in the first 2 operands. Starting offsets within
+ operands are determined by the 3rd mask operand. */
+
+#ifdef __OPTIMIZE__
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_mpsadbw_epu8 (__m128i __X, __m128i __Y, const int __M)
+{
+ return (__m128i) __builtin_ia32_mpsadbw128 ((__v16qi)__X,
+ (__v16qi)__Y, __M);
+}
+#else
+#define _mm_mpsadbw_epu8(X, Y, M) \
+ ((__m128i) __builtin_ia32_mpsadbw128 ((__v16qi)(__m128i)(X), \
+ (__v16qi)(__m128i)(Y), (int)(M)))
+#endif
+
+/* Load double quadword using non-temporal aligned hint. */
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_stream_load_si128 (__m128i *__X)
+{
+ return (__m128i) __builtin_ia32_movntdqa ((__v2di *) __X);
+}
+
+#ifdef __SSE4_2__
+
+/* These macros specify the source data format. */
+#define _SIDD_UBYTE_OPS 0x00
+#define _SIDD_UWORD_OPS 0x01
+#define _SIDD_SBYTE_OPS 0x02
+#define _SIDD_SWORD_OPS 0x03
+
+/* These macros specify the comparison operation. */
+#define _SIDD_CMP_EQUAL_ANY 0x00
+#define _SIDD_CMP_RANGES 0x04
+#define _SIDD_CMP_EQUAL_EACH 0x08
+#define _SIDD_CMP_EQUAL_ORDERED 0x0c
+
+/* These macros specify the the polarity. */
+#define _SIDD_POSITIVE_POLARITY 0x00
+#define _SIDD_NEGATIVE_POLARITY 0x10
+#define _SIDD_MASKED_POSITIVE_POLARITY 0x20
+#define _SIDD_MASKED_NEGATIVE_POLARITY 0x30
+
+/* These macros specify the output selection in _mm_cmpXstri (). */
+#define _SIDD_LEAST_SIGNIFICANT 0x00
+#define _SIDD_MOST_SIGNIFICANT 0x40
+
+/* These macros specify the output selection in _mm_cmpXstrm (). */
+#define _SIDD_BIT_MASK 0x00
+#define _SIDD_UNIT_MASK 0x40
+
+/* Intrinsics for text/string processing. */
+
+#ifdef __OPTIMIZE__
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpistrm (__m128i __X, __m128i __Y, const int __M)
+{
+ return (__m128i) __builtin_ia32_pcmpistrm128 ((__v16qi)__X,
+ (__v16qi)__Y,
+ __M);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpistri (__m128i __X, __m128i __Y, const int __M)
+{
+ return __builtin_ia32_pcmpistri128 ((__v16qi)__X,
+ (__v16qi)__Y,
+ __M);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpestrm (__m128i __X, int __LX, __m128i __Y, int __LY, const int __M)
+{
+ return (__m128i) __builtin_ia32_pcmpestrm128 ((__v16qi)__X, __LX,
+ (__v16qi)__Y, __LY,
+ __M);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpestri (__m128i __X, int __LX, __m128i __Y, int __LY, const int __M)
+{
+ return __builtin_ia32_pcmpestri128 ((__v16qi)__X, __LX,
+ (__v16qi)__Y, __LY,
+ __M);
+}
+#else
+#define _mm_cmpistrm(X, Y, M) \
+ ((__m128i) __builtin_ia32_pcmpistrm128 ((__v16qi)(__m128i)(X), \
+ (__v16qi)(__m128i)(Y), (int)(M)))
+#define _mm_cmpistri(X, Y, M) \
+ ((int) __builtin_ia32_pcmpistri128 ((__v16qi)(__m128i)(X), \
+ (__v16qi)(__m128i)(Y), (int)(M)))
+
+#define _mm_cmpestrm(X, LX, Y, LY, M) \
+ ((__m128i) __builtin_ia32_pcmpestrm128 ((__v16qi)(__m128i)(X), \
+ (int)(LX), (__v16qi)(__m128i)(Y), \
+ (int)(LY), (int)(M)))
+#define _mm_cmpestri(X, LX, Y, LY, M) \
+ ((int) __builtin_ia32_pcmpestri128 ((__v16qi)(__m128i)(X), (int)(LX), \
+ (__v16qi)(__m128i)(Y), (int)(LY), \
+ (int)(M)))
+#endif
+
+/* Intrinsics for text/string processing and reading values of
+ EFlags. */
+
+#ifdef __OPTIMIZE__
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpistra (__m128i __X, __m128i __Y, const int __M)
+{
+ return __builtin_ia32_pcmpistria128 ((__v16qi)__X,
+ (__v16qi)__Y,
+ __M);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpistrc (__m128i __X, __m128i __Y, const int __M)
+{
+ return __builtin_ia32_pcmpistric128 ((__v16qi)__X,
+ (__v16qi)__Y,
+ __M);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpistro (__m128i __X, __m128i __Y, const int __M)
+{
+ return __builtin_ia32_pcmpistrio128 ((__v16qi)__X,
+ (__v16qi)__Y,
+ __M);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpistrs (__m128i __X, __m128i __Y, const int __M)
+{
+ return __builtin_ia32_pcmpistris128 ((__v16qi)__X,
+ (__v16qi)__Y,
+ __M);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpistrz (__m128i __X, __m128i __Y, const int __M)
+{
+ return __builtin_ia32_pcmpistriz128 ((__v16qi)__X,
+ (__v16qi)__Y,
+ __M);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpestra (__m128i __X, int __LX, __m128i __Y, int __LY, const int __M)
+{
+ return __builtin_ia32_pcmpestria128 ((__v16qi)__X, __LX,
+ (__v16qi)__Y, __LY,
+ __M);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpestrc (__m128i __X, int __LX, __m128i __Y, int __LY, const int __M)
+{
+ return __builtin_ia32_pcmpestric128 ((__v16qi)__X, __LX,
+ (__v16qi)__Y, __LY,
+ __M);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpestro (__m128i __X, int __LX, __m128i __Y, int __LY, const int __M)
+{
+ return __builtin_ia32_pcmpestrio128 ((__v16qi)__X, __LX,
+ (__v16qi)__Y, __LY,
+ __M);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpestrs (__m128i __X, int __LX, __m128i __Y, int __LY, const int __M)
+{
+ return __builtin_ia32_pcmpestris128 ((__v16qi)__X, __LX,
+ (__v16qi)__Y, __LY,
+ __M);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpestrz (__m128i __X, int __LX, __m128i __Y, int __LY, const int __M)
+{
+ return __builtin_ia32_pcmpestriz128 ((__v16qi)__X, __LX,
+ (__v16qi)__Y, __LY,
+ __M);
+}
+#else
+#define _mm_cmpistra(X, Y, M) \
+ ((int) __builtin_ia32_pcmpistria128 ((__v16qi)(__m128i)(X), \
+ (__v16qi)(__m128i)(Y), (int)(M)))
+#define _mm_cmpistrc(X, Y, M) \
+ ((int) __builtin_ia32_pcmpistric128 ((__v16qi)(__m128i)(X), \
+ (__v16qi)(__m128i)(Y), (int)(M)))
+#define _mm_cmpistro(X, Y, M) \
+ ((int) __builtin_ia32_pcmpistrio128 ((__v16qi)(__m128i)(X), \
+ (__v16qi)(__m128i)(Y), (int)(M)))
+#define _mm_cmpistrs(X, Y, M) \
+ ((int) __builtin_ia32_pcmpistris128 ((__v16qi)(__m128i)(X), \
+ (__v16qi)(__m128i)(Y), (int)(M)))
+#define _mm_cmpistrz(X, Y, M) \
+ ((int) __builtin_ia32_pcmpistriz128 ((__v16qi)(__m128i)(X), \
+ (__v16qi)(__m128i)(Y), (int)(M)))
+
+#define _mm_cmpestra(X, LX, Y, LY, M) \
+ ((int) __builtin_ia32_pcmpestria128 ((__v16qi)(__m128i)(X), (int)(LX), \
+ (__v16qi)(__m128i)(Y), (int)(LY), \
+ (int)(M)))
+#define _mm_cmpestrc(X, LX, Y, LY, M) \
+ ((int) __builtin_ia32_pcmpestric128 ((__v16qi)(__m128i)(X), (int)(LX), \
+ (__v16qi)(__m128i)(Y), (int)(LY), \
+ (int)(M)))
+#define _mm_cmpestro(X, LX, Y, LY, M) \
+ ((int) __builtin_ia32_pcmpestrio128 ((__v16qi)(__m128i)(X), (int)(LX), \
+ (__v16qi)(__m128i)(Y), (int)(LY), \
+ (int)(M)))
+#define _mm_cmpestrs(X, LX, Y, LY, M) \
+ ((int) __builtin_ia32_pcmpestris128 ((__v16qi)(__m128i)(X), (int)(LX), \
+ (__v16qi)(__m128i)(Y), (int)(LY), \
+ (int)(M)))
+#define _mm_cmpestrz(X, LX, Y, LY, M) \
+ ((int) __builtin_ia32_pcmpestriz128 ((__v16qi)(__m128i)(X), (int)(LX), \
+ (__v16qi)(__m128i)(Y), (int)(LY), \
+ (int)(M)))
+#endif
+
+/* Packed integer 64-bit comparison, zeroing or filling with ones
+ corresponding parts of result. */
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpgt_epi64 (__m128i __X, __m128i __Y)
+{
+ return (__m128i) __builtin_ia32_pcmpgtq ((__v2di)__X, (__v2di)__Y);
+}
+
+/* Calculate a number of bits set to 1. */
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_popcnt_u32 (unsigned int __X)
+{
+ return __builtin_popcount (__X);
+}
+
+#ifdef __x86_64__
+extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_popcnt_u64 (unsigned long long __X)
+{
+ return __builtin_popcountll (__X);
+}
+#endif
+
+/* Accumulate CRC32 (polynomial 0x11EDC6F41) value. */
+extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_crc32_u8 (unsigned int __C, unsigned char __V)
+{
+ return __builtin_ia32_crc32qi (__C, __V);
+}
+
+extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_crc32_u16 (unsigned int __C, unsigned short __V)
+{
+ return __builtin_ia32_crc32hi (__C, __V);
+}
+
+extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_crc32_u32 (unsigned int __C, unsigned int __V)
+{
+ return __builtin_ia32_crc32si (__C, __V);
+}
+
+#ifdef __x86_64__
+extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_crc32_u64 (unsigned long long __C, unsigned long long __V)
+{
+ return __builtin_ia32_crc32di (__C, __V);
+}
+#endif
+
+#endif /* __SSE4_2__ */
+
+#endif /* __SSE4_1__ */
+
+#endif /* _SMMINTRIN_H_INCLUDED */
diff --git a/lib/gcc/i686-linux/4.4.3/include/ssp/ssp.h b/lib/gcc/i686-linux/4.4.3/include/ssp/ssp.h
new file mode 100644
index 0000000..9efe0e3
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include/ssp/ssp.h
@@ -0,0 +1,65 @@
+/* Object size checking support macros.
+ Copyright (C) 2004, 2005, 2009 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+
+#ifndef _SSP_H
+#define _SSP_H 1
+
+#if _FORTIFY_SOURCE > 0 && __OPTIMIZE__ > 0 \
+ && defined __GNUC__ \
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) \
+ && !defined __cplusplus
+# if _FORTIFY_SOURCE == 1
+# define __SSP_FORTIFY_LEVEL 1
+# elif _FORTIFY_SOURCE > 1
+# define __SSP_FORTIFY_LEVEL 2
+# endif
+#endif
+
+#if __SSP_FORTIFY_LEVEL > 0
+# include <stddef.h>
+# define __ssp_bos(ptr) __builtin_object_size (ptr, __SSP_FORTIFY_LEVEL > 1)
+# define __ssp_bos0(ptr) __builtin_object_size (ptr, 0)
+
+# define __SSP_REDIRECT(name, proto, alias) \
+ name proto __asm__ (__SSP_ASMNAME (#alias))
+# define __SSP_ASMNAME(cname) __SSP_ASMNAME2 (__USER_LABEL_PREFIX__, cname)
+# define __SSP_ASMNAME2(prefix, cname) __SSP_ASMNAME3 (prefix) cname
+# define __SSP_ASMNAME3(prefix) #prefix
+
+# undef __SSP_HAVE_VSNPRINTF
+
+extern void __chk_fail (void) __attribute__((__noreturn__));
+#endif
+
+#endif /* _SSP_H */
diff --git a/lib/gcc/i686-linux/4.4.3/include/ssp/stdio.h b/lib/gcc/i686-linux/4.4.3/include/ssp/stdio.h
new file mode 100644
index 0000000..283ca62
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include/ssp/stdio.h
@@ -0,0 +1,100 @@
+/* Checking macros for stdio functions.
+ Copyright (C) 2004, 2005, 2009 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+
+#ifndef _SSP_STDIO_H
+#define _SSP_STDIO_H 1
+
+#include <ssp.h>
+#include_next <stdio.h>
+
+#if __SSP_FORTIFY_LEVEL > 0
+
+#include <stdarg.h>
+
+#undef sprintf
+#undef vsprintf
+#undef snprintf
+#undef vsnprintf
+#undef gets
+#undef fgets
+
+extern int __sprintf_chk (char *__restrict__ __s, int __flag, size_t __slen,
+ __const char *__restrict__ __format, ...);
+extern int __vsprintf_chk (char *__restrict__ __s, int __flag, size_t __slen,
+ __const char *__restrict__ __format,
+ va_list __ap);
+
+#define sprintf(str, ...) \
+ __builtin___sprintf_chk (str, 0, __ssp_bos (str), \
+ __VA_ARGS__)
+#define vsprintf(str, fmt, ap) \
+ __builtin___vsprintf_chk (str, 0, __ssp_bos (str), fmt, ap)
+
+extern int __snprintf_chk (char *__restrict__ __s, size_t __n, int __flag,
+ size_t __slen, __const char *__restrict__ __format,
+ ...);
+extern int __vsnprintf_chk (char *__restrict__ __s, size_t __n, int __flag,
+ size_t __slen, __const char *__restrict__ __format,
+ va_list __ap);
+
+#define snprintf(str, len, ...) \
+ __builtin___snprintf_chk (str, len, 0, __ssp_bos (str), __VA_ARGS__)
+#define vsnprintf(str, len, fmt, ap) \
+ __builtin___vsnprintf_chk (str, len, 0, __ssp_bos (str), fmt, ap)
+
+extern char *__gets_chk (char *__str, size_t);
+extern char *__SSP_REDIRECT (__gets_alias, (char *__str), gets);
+
+extern inline __attribute__((__always_inline__)) char *
+gets (char *__str)
+{
+ if (__ssp_bos (__str) != (size_t) -1)
+ return __gets_chk (__str, __ssp_bos (__str));
+ return __gets_alias (__str);
+}
+
+extern char *__SSP_REDIRECT (__fgets_alias,
+ (char *__restrict__ __s, int __n,
+ FILE *__restrict__ __stream), fgets);
+
+extern inline __attribute__((__always_inline__)) char *
+fgets (char *__restrict__ __s, int __n, FILE *__restrict__ __stream)
+{
+ if (__ssp_bos (__s) != (size_t) -1 && (size_t) __n > __ssp_bos (__s))
+ __chk_fail ();
+ return __fgets_alias (__s, __n, __stream);
+}
+
+#endif /* __SSP_FORTIFY_LEVEL > 0 */
+#endif /* _SSP_STDIO_H */
diff --git a/lib/gcc/i686-linux/4.4.3/include/ssp/string.h b/lib/gcc/i686-linux/4.4.3/include/ssp/string.h
new file mode 100644
index 0000000..9e4754c
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include/ssp/string.h
@@ -0,0 +1,167 @@
+/* Checking macros for string functions.
+ Copyright (C) 2004, 2005, 2009 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+
+#ifndef _SSP_STRING_H
+#define _SSP_STRING_H 1
+
+#include <ssp.h>
+#include_next <string.h>
+
+#if __SSP_FORTIFY_LEVEL > 0
+
+#undef memcpy
+#undef memmove
+#undef memset
+#undef strcat
+#undef strcpy
+#undef strncat
+#undef strncpy
+#undef mempcpy
+#undef stpcpy
+#undef bcopy
+#undef bzero
+
+#define memcpy(dest, src, len) \
+ ((__ssp_bos0 (dest) != (size_t) -1) \
+ ? __builtin___memcpy_chk (dest, src, len, __ssp_bos0 (dest)) \
+ : __memcpy_ichk (dest, src, len))
+static inline __attribute__((__always_inline__)) void *
+__memcpy_ichk (void *__restrict__ __dest, const void *__restrict__ __src,
+ size_t __len)
+{
+ return __builtin___memcpy_chk (__dest, __src, __len, __ssp_bos0 (__dest));
+}
+
+
+#define memmove(dest, src, len) \
+ ((__ssp_bos0 (dest) != (size_t) -1) \
+ ? __builtin___memmove_chk (dest, src, len, __ssp_bos0 (dest)) \
+ : __memmove_ichk (dest, src, len))
+static inline __attribute__((__always_inline__)) void *
+__memmove_ichk (void *__dest, const void *__src, size_t __len)
+{
+ return __builtin___memmove_chk (__dest, __src, __len, __ssp_bos0 (__dest));
+}
+
+
+#define mempcpy(dest, src, len) \
+ ((__ssp_bos0 (dest) != (size_t) -1) \
+ ? __builtin___mempcpy_chk (dest, src, len, __ssp_bos0 (dest)) \
+ : __mempcpy_ichk (dest, src, len))
+static inline __attribute__((__always_inline__)) void *
+__mempcpy_ichk (void *__restrict__ __dest, const void *__restrict__ __src,
+ size_t __len)
+{
+ return __builtin___mempcpy_chk (__dest, __src, __len, __ssp_bos0 (__dest));
+}
+
+
+#define memset(dest, ch, len) \
+ ((__ssp_bos0 (dest) != (size_t) -1) \
+ ? __builtin___memset_chk (dest, ch, len, __ssp_bos0 (dest)) \
+ : __memset_ichk (dest, ch, len))
+static inline __attribute__((__always_inline__)) void *
+__memset_ichk (void *__dest, int __ch, size_t __len)
+{
+ return __builtin___memset_chk (__dest, __ch, __len, __ssp_bos0 (__dest));
+}
+
+#define bcopy(src, dest, len) ((void) \
+ ((__ssp_bos0 (dest) != (size_t) -1) \
+ ? __builtin___memmove_chk (dest, src, len, __ssp_bos0 (dest)) \
+ : __memmove_ichk (dest, src, len)))
+#define bzero(dest, len) ((void) \
+ ((__ssp_bos0 (dest) != (size_t) -1) \
+ ? __builtin___memset_chk (dest, '\0', len, __ssp_bos0 (dest)) \
+ : __memset_ichk (dest, '\0', len)))
+
+
+#define strcpy(dest, src) \
+ ((__ssp_bos (dest) != (size_t) -1) \
+ ? __builtin___strcpy_chk (dest, src, __ssp_bos (dest)) \
+ : __strcpy_ichk (dest, src))
+static inline __attribute__((__always_inline__)) char *
+__strcpy_ichk (char *__restrict__ __dest, const char *__restrict__ __src)
+{
+ return __builtin___strcpy_chk (__dest, __src, __ssp_bos (__dest));
+}
+
+
+#define stpcpy(dest, src) \
+ ((__ssp_bos (dest) != (size_t) -1) \
+ ? __builtin___stpcpy_chk (dest, src, __ssp_bos (dest)) \
+ : __stpcpy_ichk (dest, src))
+static inline __attribute__((__always_inline__)) char *
+__stpcpy_ichk (char *__restrict__ __dest, const char *__restrict__ __src)
+{
+ return __builtin___stpcpy_chk (__dest, __src, __ssp_bos (__dest));
+}
+
+
+#define strncpy(dest, src, len) \
+ ((__ssp_bos (dest) != (size_t) -1) \
+ ? __builtin___strncpy_chk (dest, src, len, __ssp_bos (dest)) \
+ : __strncpy_ichk (dest, src, len))
+static inline __attribute__((__always_inline__)) char *
+__strncpy_ichk (char *__restrict__ __dest, const char *__restrict__ __src,
+ size_t __len)
+{
+ return __builtin___strncpy_chk (__dest, __src, __len, __ssp_bos (__dest));
+}
+
+
+#define strcat(dest, src) \
+ ((__ssp_bos (dest) != (size_t) -1) \
+ ? __builtin___strcat_chk (dest, src, __ssp_bos (dest)) \
+ : __strcat_ichk (dest, src))
+static inline __attribute__((__always_inline__)) char *
+__strcat_ichk (char *__restrict__ __dest, const char *__restrict__ __src)
+{
+ return __builtin___strcat_chk (__dest, __src, __ssp_bos (__dest));
+}
+
+
+#define strncat(dest, src, len) \
+ ((__ssp_bos (dest) != (size_t) -1) \
+ ? __builtin___strncat_chk (dest, src, len, __ssp_bos (dest)) \
+ : __strncat_ichk (dest, src, len))
+static inline __attribute__((__always_inline__)) char *
+__strncat_ichk (char *__restrict__ __dest, const char *__restrict__ __src,
+ size_t __len)
+{
+ return __builtin___strncat_chk (__dest, __src, __len, __ssp_bos (__dest));
+}
+
+#endif /* __SSP_FORTIFY_LEVEL > 0 */
+#endif /* _SSP_STRING_H */
diff --git a/lib/gcc/i686-linux/4.4.3/include/ssp/unistd.h b/lib/gcc/i686-linux/4.4.3/include/ssp/unistd.h
new file mode 100644
index 0000000..343fe50
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include/ssp/unistd.h
@@ -0,0 +1,84 @@
+/* Checking macros for unistd functions.
+ Copyright (C) 2005, 2009 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+
+#ifndef _SSP_UNISTD_H
+#define _SSP_UNISTD_H 1
+
+#include <ssp.h>
+#include_next <unistd.h>
+
+#if __SSP_FORTIFY_LEVEL > 0
+
+#undef read
+#undef readlink
+#undef getcwd
+
+extern ssize_t __SSP_REDIRECT (__read_alias, (int __fd, void *__buf,
+ size_t __nbytes), read);
+
+extern inline __attribute__((__always_inline__)) ssize_t
+read (int __fd, void *__buf, size_t __nbytes)
+{
+ if (__ssp_bos0 (__buf) != (size_t) -1 && __nbytes > __ssp_bos0 (__buf))
+ __chk_fail ();
+ return __read_alias (__fd, __buf, __nbytes);
+}
+
+extern int __SSP_REDIRECT (__readlink_alias,
+ (const char *__restrict__ __path,
+ char *__restrict__ __buf, size_t __len),
+ readlink);
+
+extern inline __attribute__((__always_inline__)) int
+readlink (const char *__restrict__ __path, char *__restrict__ __buf,
+ size_t __len)
+{
+ if (__ssp_bos (__buf) != (size_t) -1 && __len > __ssp_bos (__buf))
+ __chk_fail ();
+ return __readlink_alias (__path, __buf, __len);
+}
+
+extern char *__SSP_REDIRECT (__getcwd_alias,
+ (char *__buf, size_t __size), getcwd);
+
+extern inline __attribute__((__always_inline__)) char *
+getcwd (char *__buf, size_t __size)
+{
+ if (__ssp_bos (__buf) != (size_t) -1 && __size > __ssp_bos (__buf))
+ __chk_fail ();
+ return __getcwd_alias (__buf, __size);
+}
+
+#endif /* __SSP_FORTIFY_LEVEL > 0 */
+#endif /* _SSP_UNISTD_H */
diff --git a/lib/gcc/i686-linux/4.4.3/include/stdarg.h b/lib/gcc/i686-linux/4.4.3/include/stdarg.h
new file mode 100644
index 0000000..54dc2e7
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include/stdarg.h
@@ -0,0 +1,130 @@
+/* Copyright (C) 1989, 1997, 1998, 1999, 2000, 2009 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+/*
+ * ISO C Standard: 7.15 Variable arguments <stdarg.h>
+ */
+
+#ifndef _STDARG_H
+#ifndef _ANSI_STDARG_H_
+#ifndef __need___va_list
+#define _STDARG_H
+#define _ANSI_STDARG_H_
+#endif /* not __need___va_list */
+#undef __need___va_list
+
+/* Define __gnuc_va_list. */
+
+#ifndef __GNUC_VA_LIST
+#define __GNUC_VA_LIST
+typedef __builtin_va_list __gnuc_va_list;
+#endif
+
+/* Define the standard macros for the user,
+ if this invocation was from the user program. */
+#ifdef _STDARG_H
+
+#define va_start(v,l) __builtin_va_start(v,l)
+#define va_end(v) __builtin_va_end(v)
+#define va_arg(v,l) __builtin_va_arg(v,l)
+#if !defined(__STRICT_ANSI__) || __STDC_VERSION__ + 0 >= 199900L || defined(__GXX_EXPERIMENTAL_CXX0X__)
+#define va_copy(d,s) __builtin_va_copy(d,s)
+#endif
+#define __va_copy(d,s) __builtin_va_copy(d,s)
+
+/* Define va_list, if desired, from __gnuc_va_list. */
+/* We deliberately do not define va_list when called from
+ stdio.h, because ANSI C says that stdio.h is not supposed to define
+ va_list. stdio.h needs to have access to that data type,
+ but must not use that name. It should use the name __gnuc_va_list,
+ which is safe because it is reserved for the implementation. */
+
+#ifdef _HIDDEN_VA_LIST /* On OSF1, this means varargs.h is "half-loaded". */
+#undef _VA_LIST
+#endif
+
+#ifdef _BSD_VA_LIST
+#undef _BSD_VA_LIST
+#endif
+
+#if defined(__svr4__) || (defined(_SCO_DS) && !defined(__VA_LIST))
+/* SVR4.2 uses _VA_LIST for an internal alias for va_list,
+ so we must avoid testing it and setting it here.
+ SVR4 uses _VA_LIST as a flag in stdarg.h, but we should
+ have no conflict with that. */
+#ifndef _VA_LIST_
+#define _VA_LIST_
+#ifdef __i860__
+#ifndef _VA_LIST
+#define _VA_LIST va_list
+#endif
+#endif /* __i860__ */
+typedef __gnuc_va_list va_list;
+#ifdef _SCO_DS
+#define __VA_LIST
+#endif
+#endif /* _VA_LIST_ */
+#else /* not __svr4__ || _SCO_DS */
+
+/* The macro _VA_LIST_ is the same thing used by this file in Ultrix.
+ But on BSD NET2 we must not test or define or undef it.
+ (Note that the comments in NET 2's ansi.h
+ are incorrect for _VA_LIST_--see stdio.h!) */
+#if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__) || defined(WINNT)
+/* The macro _VA_LIST_DEFINED is used in Windows NT 3.5 */
+#ifndef _VA_LIST_DEFINED
+/* The macro _VA_LIST is used in SCO Unix 3.2. */
+#ifndef _VA_LIST
+/* The macro _VA_LIST_T_H is used in the Bull dpx2 */
+#ifndef _VA_LIST_T_H
+/* The macro __va_list__ is used by BeOS. */
+#ifndef __va_list__
+typedef __gnuc_va_list va_list;
+#endif /* not __va_list__ */
+#endif /* not _VA_LIST_T_H */
+#endif /* not _VA_LIST */
+#endif /* not _VA_LIST_DEFINED */
+#if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__))
+#define _VA_LIST_
+#endif
+#ifndef _VA_LIST
+#define _VA_LIST
+#endif
+#ifndef _VA_LIST_DEFINED
+#define _VA_LIST_DEFINED
+#endif
+#ifndef _VA_LIST_T_H
+#define _VA_LIST_T_H
+#endif
+#ifndef __va_list__
+#define __va_list__
+#endif
+
+#endif /* not _VA_LIST_, except on certain systems */
+
+#endif /* not __svr4__ */
+
+#endif /* _STDARG_H */
+
+#endif /* not _ANSI_STDARG_H_ */
+#endif /* not _STDARG_H */
diff --git a/lib/gcc/i686-linux/4.4.3/include/stdbool.h b/lib/gcc/i686-linux/4.4.3/include/stdbool.h
new file mode 100644
index 0000000..4ed911f
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include/stdbool.h
@@ -0,0 +1,50 @@
+/* Copyright (C) 1998, 1999, 2000, 2009 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+/*
+ * ISO C Standard: 7.16 Boolean type and values <stdbool.h>
+ */
+
+#ifndef _STDBOOL_H
+#define _STDBOOL_H
+
+#ifndef __cplusplus
+
+#define bool _Bool
+#define true 1
+#define false 0
+
+#else /* __cplusplus */
+
+/* Supporting <stdbool.h> in C++ is a GCC extension. */
+#define _Bool bool
+#define bool bool
+#define false false
+#define true true
+
+#endif /* __cplusplus */
+
+/* Signal that all the definitions are present. */
+#define __bool_true_false_are_defined 1
+
+#endif /* stdbool.h */
diff --git a/lib/gcc/i686-linux/4.4.3/include/stddef.h b/lib/gcc/i686-linux/4.4.3/include/stddef.h
new file mode 100644
index 0000000..89e5b2e
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include/stddef.h
@@ -0,0 +1,416 @@
+/* Copyright (C) 1989, 1997, 1998, 1999, 2000, 2002, 2004, 2009
+ Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+/*
+ * ISO C Standard: 7.17 Common definitions <stddef.h>
+ */
+#if (!defined(_STDDEF_H) && !defined(_STDDEF_H_) && !defined(_ANSI_STDDEF_H) \
+ && !defined(__STDDEF_H__)) \
+ || defined(__need_wchar_t) || defined(__need_size_t) \
+ || defined(__need_ptrdiff_t) || defined(__need_NULL) \
+ || defined(__need_wint_t)
+
+/* Any one of these symbols __need_* means that GNU libc
+ wants us just to define one data type. So don't define
+ the symbols that indicate this file's entire job has been done. */
+#if (!defined(__need_wchar_t) && !defined(__need_size_t) \
+ && !defined(__need_ptrdiff_t) && !defined(__need_NULL) \
+ && !defined(__need_wint_t))
+#define _STDDEF_H
+#define _STDDEF_H_
+/* snaroff@next.com says the NeXT needs this. */
+#define _ANSI_STDDEF_H
+/* Irix 5.1 needs this. */
+#define __STDDEF_H__
+#endif
+
+#ifndef __sys_stdtypes_h
+/* This avoids lossage on SunOS but only if stdtypes.h comes first.
+ There's no way to win with the other order! Sun lossage. */
+
+/* On 4.3bsd-net2, make sure ansi.h is included, so we have
+ one less case to deal with in the following. */
+#if defined (__BSD_NET2__) || defined (____386BSD____) || (defined (__FreeBSD__) && (__FreeBSD__ < 5)) || defined(__NetBSD__)
+#include <machine/ansi.h>
+#endif
+/* On FreeBSD 5, machine/ansi.h does not exist anymore... */
+#if defined (__FreeBSD__) && (__FreeBSD__ >= 5)
+#include <sys/_types.h>
+#endif
+
+/* In 4.3bsd-net2, machine/ansi.h defines these symbols, which are
+ defined if the corresponding type is *not* defined.
+ FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_ */
+#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_)
+#if !defined(_SIZE_T_) && !defined(_BSD_SIZE_T_)
+#define _SIZE_T
+#endif
+#if !defined(_PTRDIFF_T_) && !defined(_BSD_PTRDIFF_T_)
+#define _PTRDIFF_T
+#endif
+/* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_
+ instead of _WCHAR_T_. */
+#if !defined(_WCHAR_T_) && !defined(_BSD_WCHAR_T_)
+#ifndef _BSD_WCHAR_T_
+#define _WCHAR_T
+#endif
+#endif
+/* Undef _FOO_T_ if we are supposed to define foo_t. */
+#if defined (__need_ptrdiff_t) || defined (_STDDEF_H_)
+#undef _PTRDIFF_T_
+#undef _BSD_PTRDIFF_T_
+#endif
+#if defined (__need_size_t) || defined (_STDDEF_H_)
+#undef _SIZE_T_
+#undef _BSD_SIZE_T_
+#endif
+#if defined (__need_wchar_t) || defined (_STDDEF_H_)
+#undef _WCHAR_T_
+#undef _BSD_WCHAR_T_
+#endif
+#endif /* defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) */
+
+/* Sequent's header files use _PTRDIFF_T_ in some conflicting way.
+ Just ignore it. */
+#if defined (__sequent__) && defined (_PTRDIFF_T_)
+#undef _PTRDIFF_T_
+#endif
+
+/* On VxWorks, <type/vxTypesBase.h> may have defined macros like
+ _TYPE_size_t which will typedef size_t. fixincludes patched the
+ vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is
+ not defined, and so that defining this macro defines _GCC_SIZE_T.
+ If we find that the macros are still defined at this point, we must
+ invoke them so that the type is defined as expected. */
+#if defined (_TYPE_ptrdiff_t) && (defined (__need_ptrdiff_t) || defined (_STDDEF_H_))
+_TYPE_ptrdiff_t;
+#undef _TYPE_ptrdiff_t
+#endif
+#if defined (_TYPE_size_t) && (defined (__need_size_t) || defined (_STDDEF_H_))
+_TYPE_size_t;
+#undef _TYPE_size_t
+#endif
+#if defined (_TYPE_wchar_t) && (defined (__need_wchar_t) || defined (_STDDEF_H_))
+_TYPE_wchar_t;
+#undef _TYPE_wchar_t
+#endif
+
+/* In case nobody has defined these types, but we aren't running under
+ GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and
+ __WCHAR_TYPE__ have reasonable values. This can happen if the
+ parts of GCC is compiled by an older compiler, that actually
+ include gstddef.h, such as collect2. */
+
+/* Signed type of difference of two pointers. */
+
+/* Define this type if we are doing the whole job,
+ or if we want this type in particular. */
+#if defined (_STDDEF_H) || defined (__need_ptrdiff_t)
+#ifndef _PTRDIFF_T /* in case <sys/types.h> has defined it. */
+#ifndef _T_PTRDIFF_
+#ifndef _T_PTRDIFF
+#ifndef __PTRDIFF_T
+#ifndef _PTRDIFF_T_
+#ifndef _BSD_PTRDIFF_T_
+#ifndef ___int_ptrdiff_t_h
+#ifndef _GCC_PTRDIFF_T
+#define _PTRDIFF_T
+#define _T_PTRDIFF_
+#define _T_PTRDIFF
+#define __PTRDIFF_T
+#define _PTRDIFF_T_
+#define _BSD_PTRDIFF_T_
+#define ___int_ptrdiff_t_h
+#define _GCC_PTRDIFF_T
+#ifndef __PTRDIFF_TYPE__
+#define __PTRDIFF_TYPE__ long int
+#endif
+typedef __PTRDIFF_TYPE__ ptrdiff_t;
+#endif /* _GCC_PTRDIFF_T */
+#endif /* ___int_ptrdiff_t_h */
+#endif /* _BSD_PTRDIFF_T_ */
+#endif /* _PTRDIFF_T_ */
+#endif /* __PTRDIFF_T */
+#endif /* _T_PTRDIFF */
+#endif /* _T_PTRDIFF_ */
+#endif /* _PTRDIFF_T */
+
+/* If this symbol has done its job, get rid of it. */
+#undef __need_ptrdiff_t
+
+#endif /* _STDDEF_H or __need_ptrdiff_t. */
+
+/* Unsigned type of `sizeof' something. */
+
+/* Define this type if we are doing the whole job,
+ or if we want this type in particular. */
+#if defined (_STDDEF_H) || defined (__need_size_t)
+#ifndef __size_t__ /* BeOS */
+#ifndef __SIZE_T__ /* Cray Unicos/Mk */
+#ifndef _SIZE_T /* in case <sys/types.h> has defined it. */
+#ifndef _SYS_SIZE_T_H
+#ifndef _T_SIZE_
+#ifndef _T_SIZE
+#ifndef __SIZE_T
+#ifndef _SIZE_T_
+#ifndef _BSD_SIZE_T_
+#ifndef _SIZE_T_DEFINED_
+#ifndef _SIZE_T_DEFINED
+#ifndef _BSD_SIZE_T_DEFINED_ /* Darwin */
+#ifndef _SIZE_T_DECLARED /* FreeBSD 5 */
+#ifndef ___int_size_t_h
+#ifndef _GCC_SIZE_T
+#ifndef _SIZET_
+#ifndef __size_t
+#define __size_t__ /* BeOS */
+#define __SIZE_T__ /* Cray Unicos/Mk */
+#define _SIZE_T
+#define _SYS_SIZE_T_H
+#define _T_SIZE_
+#define _T_SIZE
+#define __SIZE_T
+#define _SIZE_T_
+#define _BSD_SIZE_T_
+#define _SIZE_T_DEFINED_
+#define _SIZE_T_DEFINED
+#define _BSD_SIZE_T_DEFINED_ /* Darwin */
+#define _SIZE_T_DECLARED /* FreeBSD 5 */
+#define ___int_size_t_h
+#define _GCC_SIZE_T
+#define _SIZET_
+#if defined (__FreeBSD__) && (__FreeBSD__ >= 5)
+/* __size_t is a typedef on FreeBSD 5!, must not trash it. */
+#else
+#define __size_t
+#endif
+#ifndef __SIZE_TYPE__
+#define __SIZE_TYPE__ long unsigned int
+#endif
+#if !(defined (__GNUG__) && defined (size_t))
+typedef __SIZE_TYPE__ size_t;
+#ifdef __BEOS__
+typedef long ssize_t;
+#endif /* __BEOS__ */
+#endif /* !(defined (__GNUG__) && defined (size_t)) */
+#endif /* __size_t */
+#endif /* _SIZET_ */
+#endif /* _GCC_SIZE_T */
+#endif /* ___int_size_t_h */
+#endif /* _SIZE_T_DECLARED */
+#endif /* _BSD_SIZE_T_DEFINED_ */
+#endif /* _SIZE_T_DEFINED */
+#endif /* _SIZE_T_DEFINED_ */
+#endif /* _BSD_SIZE_T_ */
+#endif /* _SIZE_T_ */
+#endif /* __SIZE_T */
+#endif /* _T_SIZE */
+#endif /* _T_SIZE_ */
+#endif /* _SYS_SIZE_T_H */
+#endif /* _SIZE_T */
+#endif /* __SIZE_T__ */
+#endif /* __size_t__ */
+#undef __need_size_t
+#endif /* _STDDEF_H or __need_size_t. */
+
+
+/* Wide character type.
+ Locale-writers should change this as necessary to
+ be big enough to hold unique values not between 0 and 127,
+ and not (wchar_t) -1, for each defined multibyte character. */
+
+/* Define this type if we are doing the whole job,
+ or if we want this type in particular. */
+#if defined (_STDDEF_H) || defined (__need_wchar_t)
+#ifndef __wchar_t__ /* BeOS */
+#ifndef __WCHAR_T__ /* Cray Unicos/Mk */
+#ifndef _WCHAR_T
+#ifndef _T_WCHAR_
+#ifndef _T_WCHAR
+#ifndef __WCHAR_T
+#ifndef _WCHAR_T_
+#ifndef _BSD_WCHAR_T_
+#ifndef _BSD_WCHAR_T_DEFINED_ /* Darwin */
+#ifndef _BSD_RUNE_T_DEFINED_ /* Darwin */
+#ifndef _WCHAR_T_DECLARED /* FreeBSD 5 */
+#ifndef _WCHAR_T_DEFINED_
+#ifndef _WCHAR_T_DEFINED
+#ifndef _WCHAR_T_H
+#ifndef ___int_wchar_t_h
+#ifndef __INT_WCHAR_T_H
+#ifndef _GCC_WCHAR_T
+#define __wchar_t__ /* BeOS */
+#define __WCHAR_T__ /* Cray Unicos/Mk */
+#define _WCHAR_T
+#define _T_WCHAR_
+#define _T_WCHAR
+#define __WCHAR_T
+#define _WCHAR_T_
+#define _BSD_WCHAR_T_
+#define _WCHAR_T_DEFINED_
+#define _WCHAR_T_DEFINED
+#define _WCHAR_T_H
+#define ___int_wchar_t_h
+#define __INT_WCHAR_T_H
+#define _GCC_WCHAR_T
+#define _WCHAR_T_DECLARED
+
+/* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_
+ instead of _WCHAR_T_, and _BSD_RUNE_T_ (which, unlike the other
+ symbols in the _FOO_T_ family, stays defined even after its
+ corresponding type is defined). If we define wchar_t, then we
+ must undef _WCHAR_T_; for BSD/386 1.1 (and perhaps others), if
+ we undef _WCHAR_T_, then we must also define rune_t, since
+ headers like runetype.h assume that if machine/ansi.h is included,
+ and _BSD_WCHAR_T_ is not defined, then rune_t is available.
+ machine/ansi.h says, "Note that _WCHAR_T_ and _RUNE_T_ must be of
+ the same type." */
+#ifdef _BSD_WCHAR_T_
+#undef _BSD_WCHAR_T_
+#ifdef _BSD_RUNE_T_
+#if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE)
+typedef _BSD_RUNE_T_ rune_t;
+#define _BSD_WCHAR_T_DEFINED_
+#define _BSD_RUNE_T_DEFINED_ /* Darwin */
+#if defined (__FreeBSD__) && (__FreeBSD__ < 5)
+/* Why is this file so hard to maintain properly? In contrast to
+ the comment above regarding BSD/386 1.1, on FreeBSD for as long
+ as the symbol has existed, _BSD_RUNE_T_ must not stay defined or
+ redundant typedefs will occur when stdlib.h is included after this file. */
+#undef _BSD_RUNE_T_
+#endif
+#endif
+#endif
+#endif
+/* FreeBSD 5 can't be handled well using "traditional" logic above
+ since it no longer defines _BSD_RUNE_T_ yet still desires to export
+ rune_t in some cases... */
+#if defined (__FreeBSD__) && (__FreeBSD__ >= 5)
+#if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE)
+#if __BSD_VISIBLE
+#ifndef _RUNE_T_DECLARED
+typedef __rune_t rune_t;
+#define _RUNE_T_DECLARED
+#endif
+#endif
+#endif
+#endif
+
+#ifndef __WCHAR_TYPE__
+#define __WCHAR_TYPE__ int
+#endif
+#ifndef __cplusplus
+typedef __WCHAR_TYPE__ wchar_t;
+#endif
+#endif
+#endif
+#endif
+#endif
+#endif
+#endif
+#endif /* _WCHAR_T_DECLARED */
+#endif /* _BSD_RUNE_T_DEFINED_ */
+#endif
+#endif
+#endif
+#endif
+#endif
+#endif
+#endif
+#endif /* __WCHAR_T__ */
+#endif /* __wchar_t__ */
+#undef __need_wchar_t
+#endif /* _STDDEF_H or __need_wchar_t. */
+
+#if defined (__need_wint_t)
+#ifndef _WINT_T
+#define _WINT_T
+
+#ifndef __WINT_TYPE__
+#define __WINT_TYPE__ unsigned int
+#endif
+typedef __WINT_TYPE__ wint_t;
+#endif
+#undef __need_wint_t
+#endif
+
+/* In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
+ are already defined. */
+/* BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here. */
+#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_)
+/* The references to _GCC_PTRDIFF_T_, _GCC_SIZE_T_, and _GCC_WCHAR_T_
+ are probably typos and should be removed before 2.8 is released. */
+#ifdef _GCC_PTRDIFF_T_
+#undef _PTRDIFF_T_
+#undef _BSD_PTRDIFF_T_
+#endif
+#ifdef _GCC_SIZE_T_
+#undef _SIZE_T_
+#undef _BSD_SIZE_T_
+#endif
+#ifdef _GCC_WCHAR_T_
+#undef _WCHAR_T_
+#undef _BSD_WCHAR_T_
+#endif
+/* The following ones are the real ones. */
+#ifdef _GCC_PTRDIFF_T
+#undef _PTRDIFF_T_
+#undef _BSD_PTRDIFF_T_
+#endif
+#ifdef _GCC_SIZE_T
+#undef _SIZE_T_
+#undef _BSD_SIZE_T_
+#endif
+#ifdef _GCC_WCHAR_T
+#undef _WCHAR_T_
+#undef _BSD_WCHAR_T_
+#endif
+#endif /* _ANSI_H_ || _MACHINE_ANSI_H_ */
+
+#endif /* __sys_stdtypes_h */
+
+/* A null pointer constant. */
+
+#if defined (_STDDEF_H) || defined (__need_NULL)
+#undef NULL /* in case <stdio.h> has defined it. */
+#ifdef __GNUG__
+#define NULL __null
+#else /* G++ */
+#ifndef __cplusplus
+#define NULL ((void *)0)
+#else /* C++ */
+#define NULL 0
+#endif /* C++ */
+#endif /* G++ */
+#endif /* NULL not defined and <stddef.h> or need NULL. */
+#undef __need_NULL
+
+#ifdef _STDDEF_H
+
+/* Offset of member MEMBER in a struct of type TYPE. */
+#define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER)
+
+#endif /* _STDDEF_H was defined this time */
+
+#endif /* !_STDDEF_H && !_STDDEF_H_ && !_ANSI_STDDEF_H && !__STDDEF_H__
+ || __need_XXX was not defined before */
diff --git a/lib/gcc/i686-linux/4.4.3/include/stdfix.h b/lib/gcc/i686-linux/4.4.3/include/stdfix.h
new file mode 100644
index 0000000..3c3ec00
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include/stdfix.h
@@ -0,0 +1,204 @@
+/* Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+/* ISO/IEC JTC1 SC22 WG14 N1169
+ * Date: 2006-04-04
+ * ISO/IEC TR 18037
+ * Programming languages - C - Extensions to support embedded processors
+ */
+
+#ifndef _STDFIX_H
+#define _STDFIX_H
+
+/* 7.18a.1 Introduction. */
+
+#undef fract
+#undef accum
+#undef sat
+#define fract _Fract
+#define accum _Accum
+#define sat _Sat
+
+/* 7.18a.3 Precision macros. */
+
+#undef SFRACT_FBIT
+#undef SFRACT_MIN
+#undef SFRACT_MAX
+#undef SFRACT_EPSILON
+#define SFRACT_FBIT __SFRACT_FBIT__
+#define SFRACT_MIN __SFRACT_MIN__
+#define SFRACT_MAX __SFRACT_MAX__
+#define SFRACT_EPSILON __SFRACT_EPSILON__
+
+#undef USFRACT_FBIT
+#undef USFRACT_MIN
+#undef USFRACT_MAX
+#undef USFRACT_EPSILON
+#define USFRACT_FBIT __USFRACT_FBIT__
+#define USFRACT_MIN __USFRACT_MIN__ /* GCC extension. */
+#define USFRACT_MAX __USFRACT_MAX__
+#define USFRACT_EPSILON __USFRACT_EPSILON__
+
+#undef FRACT_FBIT
+#undef FRACT_MIN
+#undef FRACT_MAX
+#undef FRACT_EPSILON
+#define FRACT_FBIT __FRACT_FBIT__
+#define FRACT_MIN __FRACT_MIN__
+#define FRACT_MAX __FRACT_MAX__
+#define FRACT_EPSILON __FRACT_EPSILON__
+
+#undef UFRACT_FBIT
+#undef UFRACT_MIN
+#undef UFRACT_MAX
+#undef UFRACT_EPSILON
+#define UFRACT_FBIT __UFRACT_FBIT__
+#define UFRACT_MIN __UFRACT_MIN__ /* GCC extension. */
+#define UFRACT_MAX __UFRACT_MAX__
+#define UFRACT_EPSILON __UFRACT_EPSILON__
+
+#undef LFRACT_FBIT
+#undef LFRACT_MIN
+#undef LFRACT_MAX
+#undef LFRACT_EPSILON
+#define LFRACT_FBIT __LFRACT_FBIT__
+#define LFRACT_MIN __LFRACT_MIN__
+#define LFRACT_MAX __LFRACT_MAX__
+#define LFRACT_EPSILON __LFRACT_EPSILON__
+
+#undef ULFRACT_FBIT
+#undef ULFRACT_MIN
+#undef ULFRACT_MAX
+#undef ULFRACT_EPSILON
+#define ULFRACT_FBIT __ULFRACT_FBIT__
+#define ULFRACT_MIN __ULFRACT_MIN__ /* GCC extension. */
+#define ULFRACT_MAX __ULFRACT_MAX__
+#define ULFRACT_EPSILON __ULFRACT_EPSILON__
+
+#undef LLFRACT_FBIT
+#undef LLFRACT_MIN
+#undef LLFRACT_MAX
+#undef LLFRACT_EPSILON
+#define LLFRACT_FBIT __LLFRACT_FBIT__ /* GCC extension. */
+#define LLFRACT_MIN __LLFRACT_MIN__ /* GCC extension. */
+#define LLFRACT_MAX __LLFRACT_MAX__ /* GCC extension. */
+#define LLFRACT_EPSILON __LLFRACT_EPSILON__ /* GCC extension. */
+
+#undef ULLFRACT_FBIT
+#undef ULLFRACT_MIN
+#undef ULLFRACT_MAX
+#undef ULLFRACT_EPSILON
+#define ULLFRACT_FBIT __ULLFRACT_FBIT__ /* GCC extension. */
+#define ULLFRACT_MIN __ULLFRACT_MIN__ /* GCC extension. */
+#define ULLFRACT_MAX __ULLFRACT_MAX__ /* GCC extension. */
+#define ULLFRACT_EPSILON __ULLFRACT_EPSILON__ /* GCC extension. */
+
+#undef SACCUM_FBIT
+#undef SACCUM_IBIT
+#undef SACCUM_MIN
+#undef SACCUM_MAX
+#undef SACCUM_EPSILON
+#define SACCUM_FBIT __SACCUM_FBIT__
+#define SACCUM_IBIT __SACCUM_IBIT__
+#define SACCUM_MIN __SACCUM_MIN__
+#define SACCUM_MAX __SACCUM_MAX__
+#define SACCUM_EPSILON __SACCUM_EPSILON__
+
+#undef USACCUM_FBIT
+#undef USACCUM_IBIT
+#undef USACCUM_MIN
+#undef USACCUM_MAX
+#undef USACCUM_EPSILON
+#define USACCUM_FBIT __USACCUM_FBIT__
+#define USACCUM_IBIT __USACCUM_IBIT__
+#define USACCUM_MIN __USACCUM_MIN__ /* GCC extension. */
+#define USACCUM_MAX __USACCUM_MAX__
+#define USACCUM_EPSILON __USACCUM_EPSILON__
+
+#undef ACCUM_FBIT
+#undef ACCUM_IBIT
+#undef ACCUM_MIN
+#undef ACCUM_MAX
+#undef ACCUM_EPSILON
+#define ACCUM_FBIT __ACCUM_FBIT__
+#define ACCUM_IBIT __ACCUM_IBIT__
+#define ACCUM_MIN __ACCUM_MIN__
+#define ACCUM_MAX __ACCUM_MAX__
+#define ACCUM_EPSILON __ACCUM_EPSILON__
+
+#undef UACCUM_FBIT
+#undef UACCUM_IBIT
+#undef UACCUM_MIN
+#undef UACCUM_MAX
+#undef UACCUM_EPSILON
+#define UACCUM_FBIT __UACCUM_FBIT__
+#define UACCUM_IBIT __UACCUM_IBIT__
+#define UACCUM_MIN __UACCUM_MIN__ /* GCC extension. */
+#define UACCUM_MAX __UACCUM_MAX__
+#define UACCUM_EPSILON __UACCUM_EPSILON__
+
+#undef LACCUM_FBIT
+#undef LACCUM_IBIT
+#undef LACCUM_MIN
+#undef LACCUM_MAX
+#undef LACCUM_EPSILON
+#define LACCUM_FBIT __LACCUM_FBIT__
+#define LACCUM_IBIT __LACCUM_IBIT__
+#define LACCUM_MIN __LACCUM_MIN__
+#define LACCUM_MAX __LACCUM_MAX__
+#define LACCUM_EPSILON __LACCUM_EPSILON__
+
+#undef ULACCUM_FBIT
+#undef ULACCUM_IBIT
+#undef ULACCUM_MIN
+#undef ULACCUM_MAX
+#undef ULACCUM_EPSILON
+#define ULACCUM_FBIT __ULACCUM_FBIT__
+#define ULACCUM_IBIT __ULACCUM_IBIT__
+#define ULACCUM_MIN __ULACCUM_MIN__ /* GCC extension. */
+#define ULACCUM_MAX __ULACCUM_MAX__
+#define ULACCUM_EPSILON __ULACCUM_EPSILON__
+
+#undef LLACCUM_FBIT
+#undef LLACCUM_IBIT
+#undef LLACCUM_MIN
+#undef LLACCUM_MAX
+#undef LLACCUM_EPSILON
+#define LLACCUM_FBIT __LLACCUM_FBIT__ /* GCC extension. */
+#define LLACCUM_IBIT __LLACCUM_IBIT__ /* GCC extension. */
+#define LLACCUM_MIN __LLACCUM_MIN__ /* GCC extension. */
+#define LLACCUM_MAX __LLACCUM_MAX__ /* GCC extension. */
+#define LLACCUM_EPSILON __LLACCUM_EPSILON__ /* GCC extension. */
+
+#undef ULLACCUM_FBIT
+#undef ULLACCUM_IBIT
+#undef ULLACCUM_MIN
+#undef ULLACCUM_MAX
+#undef ULLACCUM_EPSILON
+#define ULLACCUM_FBIT __ULLACCUM_FBIT__ /* GCC extension. */
+#define ULLACCUM_IBIT __ULLACCUM_IBIT__ /* GCC extension. */
+#define ULLACCUM_MIN __ULLACCUM_MIN__ /* GCC extension. */
+#define ULLACCUM_MAX __ULLACCUM_MAX__ /* GCC extension. */
+#define ULLACCUM_EPSILON __ULLACCUM_EPSILON__ /* GCC extension. */
+
+#endif /* _STDFIX_H */
diff --git a/lib/gcc/i686-linux/4.4.3/include/tmmintrin.h b/lib/gcc/i686-linux/4.4.3/include/tmmintrin.h
new file mode 100644
index 0000000..9835669
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include/tmmintrin.h
@@ -0,0 +1,244 @@
+/* Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ GCC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* Implemented from the specification included in the Intel C++ Compiler
+ User Guide and Reference, version 9.1. */
+
+#ifndef _TMMINTRIN_H_INCLUDED
+#define _TMMINTRIN_H_INCLUDED
+
+#ifndef __SSSE3__
+# error "SSSE3 instruction set not enabled"
+#else
+
+/* We need definitions from the SSE3, SSE2 and SSE header files*/
+#include <pmmintrin.h>
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_hadd_epi16 (__m128i __X, __m128i __Y)
+{
+ return (__m128i) __builtin_ia32_phaddw128 ((__v8hi)__X, (__v8hi)__Y);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_hadd_epi32 (__m128i __X, __m128i __Y)
+{
+ return (__m128i) __builtin_ia32_phaddd128 ((__v4si)__X, (__v4si)__Y);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_hadds_epi16 (__m128i __X, __m128i __Y)
+{
+ return (__m128i) __builtin_ia32_phaddsw128 ((__v8hi)__X, (__v8hi)__Y);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_hadd_pi16 (__m64 __X, __m64 __Y)
+{
+ return (__m64) __builtin_ia32_phaddw ((__v4hi)__X, (__v4hi)__Y);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_hadd_pi32 (__m64 __X, __m64 __Y)
+{
+ return (__m64) __builtin_ia32_phaddd ((__v2si)__X, (__v2si)__Y);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_hadds_pi16 (__m64 __X, __m64 __Y)
+{
+ return (__m64) __builtin_ia32_phaddsw ((__v4hi)__X, (__v4hi)__Y);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_hsub_epi16 (__m128i __X, __m128i __Y)
+{
+ return (__m128i) __builtin_ia32_phsubw128 ((__v8hi)__X, (__v8hi)__Y);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_hsub_epi32 (__m128i __X, __m128i __Y)
+{
+ return (__m128i) __builtin_ia32_phsubd128 ((__v4si)__X, (__v4si)__Y);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_hsubs_epi16 (__m128i __X, __m128i __Y)
+{
+ return (__m128i) __builtin_ia32_phsubsw128 ((__v8hi)__X, (__v8hi)__Y);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_hsub_pi16 (__m64 __X, __m64 __Y)
+{
+ return (__m64) __builtin_ia32_phsubw ((__v4hi)__X, (__v4hi)__Y);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_hsub_pi32 (__m64 __X, __m64 __Y)
+{
+ return (__m64) __builtin_ia32_phsubd ((__v2si)__X, (__v2si)__Y);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_hsubs_pi16 (__m64 __X, __m64 __Y)
+{
+ return (__m64) __builtin_ia32_phsubsw ((__v4hi)__X, (__v4hi)__Y);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_maddubs_epi16 (__m128i __X, __m128i __Y)
+{
+ return (__m128i) __builtin_ia32_pmaddubsw128 ((__v16qi)__X, (__v16qi)__Y);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_maddubs_pi16 (__m64 __X, __m64 __Y)
+{
+ return (__m64) __builtin_ia32_pmaddubsw ((__v8qi)__X, (__v8qi)__Y);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_mulhrs_epi16 (__m128i __X, __m128i __Y)
+{
+ return (__m128i) __builtin_ia32_pmulhrsw128 ((__v8hi)__X, (__v8hi)__Y);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_mulhrs_pi16 (__m64 __X, __m64 __Y)
+{
+ return (__m64) __builtin_ia32_pmulhrsw ((__v4hi)__X, (__v4hi)__Y);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_shuffle_epi8 (__m128i __X, __m128i __Y)
+{
+ return (__m128i) __builtin_ia32_pshufb128 ((__v16qi)__X, (__v16qi)__Y);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_shuffle_pi8 (__m64 __X, __m64 __Y)
+{
+ return (__m64) __builtin_ia32_pshufb ((__v8qi)__X, (__v8qi)__Y);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sign_epi8 (__m128i __X, __m128i __Y)
+{
+ return (__m128i) __builtin_ia32_psignb128 ((__v16qi)__X, (__v16qi)__Y);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sign_epi16 (__m128i __X, __m128i __Y)
+{
+ return (__m128i) __builtin_ia32_psignw128 ((__v8hi)__X, (__v8hi)__Y);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sign_epi32 (__m128i __X, __m128i __Y)
+{
+ return (__m128i) __builtin_ia32_psignd128 ((__v4si)__X, (__v4si)__Y);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sign_pi8 (__m64 __X, __m64 __Y)
+{
+ return (__m64) __builtin_ia32_psignb ((__v8qi)__X, (__v8qi)__Y);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sign_pi16 (__m64 __X, __m64 __Y)
+{
+ return (__m64) __builtin_ia32_psignw ((__v4hi)__X, (__v4hi)__Y);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sign_pi32 (__m64 __X, __m64 __Y)
+{
+ return (__m64) __builtin_ia32_psignd ((__v2si)__X, (__v2si)__Y);
+}
+
+#ifdef __OPTIMIZE__
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_alignr_epi8(__m128i __X, __m128i __Y, const int __N)
+{
+ return (__m128i) __builtin_ia32_palignr128 ((__v2di)__X,
+ (__v2di)__Y, __N * 8);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_alignr_pi8(__m64 __X, __m64 __Y, const int __N)
+{
+ return (__m64) __builtin_ia32_palignr ((__v1di)__X,
+ (__v1di)__Y, __N * 8);
+}
+#else
+#define _mm_alignr_epi8(X, Y, N) \
+ ((__m128i) __builtin_ia32_palignr128 ((__v2di)(__m128i)(X), \
+ (__v2di)(__m128i)(Y), \
+ (int)(N) * 8))
+#define _mm_alignr_pi8(X, Y, N) \
+ ((__m64) __builtin_ia32_palignr ((__v1di)(__m64)(X), \
+ (__v1di)(__m64)(Y), \
+ (int)(N) * 8))
+#endif
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_abs_epi8 (__m128i __X)
+{
+ return (__m128i) __builtin_ia32_pabsb128 ((__v16qi)__X);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_abs_epi16 (__m128i __X)
+{
+ return (__m128i) __builtin_ia32_pabsw128 ((__v8hi)__X);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_abs_epi32 (__m128i __X)
+{
+ return (__m128i) __builtin_ia32_pabsd128 ((__v4si)__X);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_abs_pi8 (__m64 __X)
+{
+ return (__m64) __builtin_ia32_pabsb ((__v8qi)__X);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_abs_pi16 (__m64 __X)
+{
+ return (__m64) __builtin_ia32_pabsw ((__v4hi)__X);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_abs_pi32 (__m64 __X)
+{
+ return (__m64) __builtin_ia32_pabsd ((__v2si)__X);
+}
+
+#endif /* __SSSE3__ */
+
+#endif /* _TMMINTRIN_H_INCLUDED */
diff --git a/lib/gcc/i686-linux/4.4.3/include/unwind.h b/lib/gcc/i686-linux/4.4.3/include/unwind.h
new file mode 100644
index 0000000..4ff9017
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include/unwind.h
@@ -0,0 +1,276 @@
+/* Exception handling and frame unwind runtime interface routines.
+ Copyright (C) 2001, 2003, 2004, 2006, 2008, 2009 Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ GCC is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+ License for more details.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* This is derived from the C++ ABI for IA-64. Where we diverge
+ for cross-architecture compatibility are noted with "@@@". */
+
+#ifndef _UNWIND_H
+#define _UNWIND_H
+
+#ifndef HIDE_EXPORTS
+#pragma GCC visibility push(default)
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Level 1: Base ABI */
+
+/* @@@ The IA-64 ABI uses uint64 throughout. Most places this is
+ inefficient for 32-bit and smaller machines. */
+typedef unsigned _Unwind_Word __attribute__((__mode__(__unwind_word__)));
+typedef signed _Unwind_Sword __attribute__((__mode__(__unwind_word__)));
+#if defined(__ia64__) && defined(__hpux__)
+typedef unsigned _Unwind_Ptr __attribute__((__mode__(__word__)));
+#else
+typedef unsigned _Unwind_Ptr __attribute__((__mode__(__pointer__)));
+#endif
+typedef unsigned _Unwind_Internal_Ptr __attribute__((__mode__(__pointer__)));
+
+/* @@@ The IA-64 ABI uses a 64-bit word to identify the producer and
+ consumer of an exception. We'll go along with this for now even on
+ 32-bit machines. We'll need to provide some other option for
+ 16-bit machines and for machines with > 8 bits per byte. */
+typedef unsigned _Unwind_Exception_Class __attribute__((__mode__(__DI__)));
+
+/* The unwind interface uses reason codes in several contexts to
+ identify the reasons for failures or other actions. */
+typedef enum
+{
+ _URC_NO_REASON = 0,
+ _URC_FOREIGN_EXCEPTION_CAUGHT = 1,
+ _URC_FATAL_PHASE2_ERROR = 2,
+ _URC_FATAL_PHASE1_ERROR = 3,
+ _URC_NORMAL_STOP = 4,
+ _URC_END_OF_STACK = 5,
+ _URC_HANDLER_FOUND = 6,
+ _URC_INSTALL_CONTEXT = 7,
+ _URC_CONTINUE_UNWIND = 8
+} _Unwind_Reason_Code;
+
+
+/* The unwind interface uses a pointer to an exception header object
+ as its representation of an exception being thrown. In general, the
+ full representation of an exception object is language- and
+ implementation-specific, but it will be prefixed by a header
+ understood by the unwind interface. */
+
+struct _Unwind_Exception;
+
+typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code,
+ struct _Unwind_Exception *);
+
+struct _Unwind_Exception
+{
+ _Unwind_Exception_Class exception_class;
+ _Unwind_Exception_Cleanup_Fn exception_cleanup;
+ _Unwind_Word private_1;
+ _Unwind_Word private_2;
+
+ /* @@@ The IA-64 ABI says that this structure must be double-word aligned.
+ Taking that literally does not make much sense generically. Instead we
+ provide the maximum alignment required by any type for the machine. */
+} __attribute__((__aligned__));
+
+
+/* The ACTIONS argument to the personality routine is a bitwise OR of one
+ or more of the following constants. */
+typedef int _Unwind_Action;
+
+#define _UA_SEARCH_PHASE 1
+#define _UA_CLEANUP_PHASE 2
+#define _UA_HANDLER_FRAME 4
+#define _UA_FORCE_UNWIND 8
+#define _UA_END_OF_STACK 16
+
+/* The target can override this macro to define any back-end-specific
+ attributes required for the lowest-level stack frame. */
+#ifndef LIBGCC2_UNWIND_ATTRIBUTE
+#define LIBGCC2_UNWIND_ATTRIBUTE
+#endif
+
+/* This is an opaque type used to refer to a system-specific data
+ structure used by the system unwinder. This context is created and
+ destroyed by the system, and passed to the personality routine
+ during unwinding. */
+struct _Unwind_Context;
+
+/* Raise an exception, passing along the given exception object. */
+extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
+_Unwind_RaiseException (struct _Unwind_Exception *);
+
+/* Raise an exception for forced unwinding. */
+
+typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn)
+ (int, _Unwind_Action, _Unwind_Exception_Class,
+ struct _Unwind_Exception *, struct _Unwind_Context *, void *);
+
+extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
+_Unwind_ForcedUnwind (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *);
+
+/* Helper to invoke the exception_cleanup routine. */
+extern void _Unwind_DeleteException (struct _Unwind_Exception *);
+
+/* Resume propagation of an existing exception. This is used after
+ e.g. executing cleanup code, and not to implement rethrowing. */
+extern void LIBGCC2_UNWIND_ATTRIBUTE
+_Unwind_Resume (struct _Unwind_Exception *);
+
+/* @@@ Resume propagation of a FORCE_UNWIND exception, or to rethrow
+ a normal exception that was handled. */
+extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
+_Unwind_Resume_or_Rethrow (struct _Unwind_Exception *);
+
+/* @@@ Use unwind data to perform a stack backtrace. The trace callback
+ is called for every stack frame in the call chain, but no cleanup
+ actions are performed. */
+typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn)
+ (struct _Unwind_Context *, void *);
+
+extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
+_Unwind_Backtrace (_Unwind_Trace_Fn, void *);
+
+/* These functions are used for communicating information about the unwind
+ context (i.e. the unwind descriptors and the user register state) between
+ the unwind library and the personality routine and landing pad. Only
+ selected registers may be manipulated. */
+
+extern _Unwind_Word _Unwind_GetGR (struct _Unwind_Context *, int);
+extern void _Unwind_SetGR (struct _Unwind_Context *, int, _Unwind_Word);
+
+extern _Unwind_Ptr _Unwind_GetIP (struct _Unwind_Context *);
+extern _Unwind_Ptr _Unwind_GetIPInfo (struct _Unwind_Context *, int *);
+extern void _Unwind_SetIP (struct _Unwind_Context *, _Unwind_Ptr);
+
+/* @@@ Retrieve the CFA of the given context. */
+extern _Unwind_Word _Unwind_GetCFA (struct _Unwind_Context *);
+
+extern void *_Unwind_GetLanguageSpecificData (struct _Unwind_Context *);
+
+extern _Unwind_Ptr _Unwind_GetRegionStart (struct _Unwind_Context *);
+
+
+/* The personality routine is the function in the C++ (or other language)
+ runtime library which serves as an interface between the system unwind
+ library and language-specific exception handling semantics. It is
+ specific to the code fragment described by an unwind info block, and
+ it is always referenced via the pointer in the unwind info block, and
+ hence it has no ABI-specified name.
+
+ Note that this implies that two different C++ implementations can
+ use different names, and have different contents in the language
+ specific data area. Moreover, that the language specific data
+ area contains no version info because name of the function invoked
+ provides more effective versioning by detecting at link time the
+ lack of code to handle the different data format. */
+
+typedef _Unwind_Reason_Code (*_Unwind_Personality_Fn)
+ (int, _Unwind_Action, _Unwind_Exception_Class,
+ struct _Unwind_Exception *, struct _Unwind_Context *);
+
+/* @@@ The following alternate entry points are for setjmp/longjmp
+ based unwinding. */
+
+struct SjLj_Function_Context;
+extern void _Unwind_SjLj_Register (struct SjLj_Function_Context *);
+extern void _Unwind_SjLj_Unregister (struct SjLj_Function_Context *);
+
+extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
+_Unwind_SjLj_RaiseException (struct _Unwind_Exception *);
+extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
+_Unwind_SjLj_ForcedUnwind (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *);
+extern void LIBGCC2_UNWIND_ATTRIBUTE
+_Unwind_SjLj_Resume (struct _Unwind_Exception *);
+extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
+_Unwind_SjLj_Resume_or_Rethrow (struct _Unwind_Exception *);
+
+/* @@@ The following provide access to the base addresses for text
+ and data-relative addressing in the LDSA. In order to stay link
+ compatible with the standard ABI for IA-64, we inline these. */
+
+#ifdef __ia64__
+#include <stdlib.h>
+
+static inline _Unwind_Ptr
+_Unwind_GetDataRelBase (struct _Unwind_Context *_C)
+{
+ /* The GP is stored in R1. */
+ return _Unwind_GetGR (_C, 1);
+}
+
+static inline _Unwind_Ptr
+_Unwind_GetTextRelBase (struct _Unwind_Context *_C __attribute__ ((__unused__)))
+{
+ abort ();
+ return 0;
+}
+
+/* @@@ Retrieve the Backing Store Pointer of the given context. */
+extern _Unwind_Word _Unwind_GetBSP (struct _Unwind_Context *);
+#else
+extern _Unwind_Ptr _Unwind_GetDataRelBase (struct _Unwind_Context *);
+extern _Unwind_Ptr _Unwind_GetTextRelBase (struct _Unwind_Context *);
+#endif
+
+/* @@@ Given an address, return the entry point of the function that
+ contains it. */
+extern void * _Unwind_FindEnclosingFunction (void *pc);
+
+#ifndef __SIZEOF_LONG__
+ #error "__SIZEOF_LONG__ macro not defined"
+#endif
+
+#ifndef __SIZEOF_POINTER__
+ #error "__SIZEOF_POINTER__ macro not defined"
+#endif
+
+
+/* leb128 type numbers have a potentially unlimited size.
+ The target of the following definitions of _sleb128_t and _uleb128_t
+ is to have efficient data types large enough to hold the leb128 type
+ numbers used in the unwind code.
+ Mostly these types will simply be defined to long and unsigned long
+ except when a unsigned long data type on the target machine is not
+ capable of storing a pointer. */
+
+#if __SIZEOF_LONG__ >= __SIZEOF_POINTER__
+ typedef long _sleb128_t;
+ typedef unsigned long _uleb128_t;
+#elif __SIZEOF_LONG_LONG__ >= __SIZEOF_POINTER__
+ typedef long long _sleb128_t;
+ typedef unsigned long long _uleb128_t;
+#else
+# error "What type shall we use for _sleb128_t?"
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#ifndef HIDE_EXPORTS
+#pragma GCC visibility pop
+#endif
+
+#endif /* unwind.h */
diff --git a/lib/gcc/i686-linux/4.4.3/include/varargs.h b/lib/gcc/i686-linux/4.4.3/include/varargs.h
new file mode 100644
index 0000000..4b9803e
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include/varargs.h
@@ -0,0 +1,7 @@
+#ifndef _VARARGS_H
+#define _VARARGS_H
+
+#error "GCC no longer implements <varargs.h>."
+#error "Revise your code to use <stdarg.h>."
+
+#endif
diff --git a/lib/gcc/i686-linux/4.4.3/include/wmmintrin.h b/lib/gcc/i686-linux/4.4.3/include/wmmintrin.h
new file mode 100644
index 0000000..2c4bdc9
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include/wmmintrin.h
@@ -0,0 +1,120 @@
+/* Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ GCC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* Implemented from the specification included in the Intel C++ Compiler
+ User Guide and Reference, version 10.1. */
+
+#ifndef _WMMINTRIN_H_INCLUDED
+#define _WMMINTRIN_H_INCLUDED
+
+/* We need definitions from the SSE2 header file. */
+#include <emmintrin.h>
+
+#if !defined (__AES__) && !defined (__PCLMUL__)
+# error "AES/PCLMUL instructions not enabled"
+#else
+
+/* AES */
+
+#ifdef __AES__
+/* Performs 1 round of AES decryption of the first m128i using
+ the second m128i as a round key. */
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_aesdec_si128 (__m128i __X, __m128i __Y)
+{
+ return (__m128i) __builtin_ia32_aesdec128 ((__v2di)__X, (__v2di)__Y);
+}
+
+/* Performs the last round of AES decryption of the first m128i
+ using the second m128i as a round key. */
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_aesdeclast_si128 (__m128i __X, __m128i __Y)
+{
+ return (__m128i) __builtin_ia32_aesdeclast128 ((__v2di)__X,
+ (__v2di)__Y);
+}
+
+/* Performs 1 round of AES encryption of the first m128i using
+ the second m128i as a round key. */
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_aesenc_si128 (__m128i __X, __m128i __Y)
+{
+ return (__m128i) __builtin_ia32_aesenc128 ((__v2di)__X, (__v2di)__Y);
+}
+
+/* Performs the last round of AES encryption of the first m128i
+ using the second m128i as a round key. */
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_aesenclast_si128 (__m128i __X, __m128i __Y)
+{
+ return (__m128i) __builtin_ia32_aesenclast128 ((__v2di)__X, (__v2di)__Y);
+}
+
+/* Performs the InverseMixColumn operation on the source m128i
+ and stores the result into m128i destination. */
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_aesimc_si128 (__m128i __X)
+{
+ return (__m128i) __builtin_ia32_aesimc128 ((__v2di)__X);
+}
+
+/* Generates a m128i round key for the input m128i AES cipher key and
+ byte round constant. The second parameter must be a compile time
+ constant. */
+#ifdef __OPTIMIZE__
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_aeskeygenassist_si128 (__m128i __X, const int __C)
+{
+ return (__m128i) __builtin_ia32_aeskeygenassist128 ((__v2di)__X, __C);
+}
+#else
+#define _mm_aeskeygenassist_si128(X, C) \
+ ((__m128i) __builtin_ia32_aeskeygenassist128 ((__v2di)(__m128i)(X), \
+ (int)(C)))
+#endif
+#endif /* __AES__ */
+
+/* PCLMUL */
+
+#ifdef __PCLMUL__
+/* Performs carry-less integer multiplication of 64-bit halves of
+ 128-bit input operands. The third parameter inducates which 64-bit
+ haves of the input parameters v1 and v2 should be used. It must be
+ a compile time constant. */
+#ifdef __OPTIMIZE__
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_clmulepi64_si128 (__m128i __X, __m128i __Y, const int __I)
+{
+ return (__m128i) __builtin_ia32_pclmulqdq128 ((__v2di)__X,
+ (__v2di)__Y, __I);
+}
+#else
+#define _mm_clmulepi64_si128(X, Y, I) \
+ ((__m128i) __builtin_ia32_pclmulqdq128 ((__v2di)(__m128i)(X), \
+ (__v2di)(__m128i)(Y), (int)(I)))
+#endif
+#endif /* __PCLMUL__ */
+
+#endif /* __AES__/__PCLMUL__ */
+
+#endif /* _WMMINTRIN_H_INCLUDED */
diff --git a/lib/gcc/i686-linux/4.4.3/include/x86intrin.h b/lib/gcc/i686-linux/4.4.3/include/x86intrin.h
new file mode 100644
index 0000000..fead766
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include/x86intrin.h
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ GCC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _X86INTRIN_H_INCLUDED
+#define _X86INTRIN_H_INCLUDED
+
+#ifdef __MMX__
+#include <mmintrin.h>
+#endif
+
+#ifdef __SSE__
+#include <xmmintrin.h>
+#endif
+
+#ifdef __SSE2__
+#include <emmintrin.h>
+#endif
+
+#ifdef __SSE3__
+#include <pmmintrin.h>
+#endif
+
+#ifdef __SSSE3__
+#include <tmmintrin.h>
+#endif
+
+#ifdef __SSE4a__
+#include <ammintrin.h>
+#endif
+
+#if defined (__SSE4_2__) || defined (__SSE4_1__)
+#include <smmintrin.h>
+#endif
+
+#ifdef __SSE5__
+#include <bmmintrin.h>
+#endif
+
+#ifdef __LWP__
+#include <lwpintrin.h>
+#endif
+
+#if defined (__AES__) || defined (__PCLMUL__)
+#include <wmmintrin.h>
+#endif
+
+/* For including AVX instructions */
+#include <immintrin.h>
+
+#ifdef __3dNOW__
+#include <mm3dnow.h>
+#endif
+
+#endif /* _X86INTRIN_H_INCLUDED */
diff --git a/lib/gcc/i686-linux/4.4.3/include/xmmintrin.h b/lib/gcc/i686-linux/4.4.3/include/xmmintrin.h
new file mode 100644
index 0000000..544577e
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/include/xmmintrin.h
@@ -0,0 +1,1251 @@
+/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+ Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ GCC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* Implemented from the specification included in the Intel C++ Compiler
+ User Guide and Reference, version 9.0. */
+
+#ifndef _XMMINTRIN_H_INCLUDED
+#define _XMMINTRIN_H_INCLUDED
+
+#ifndef __SSE__
+# error "SSE instruction set not enabled"
+#else
+
+/* We need type definitions from the MMX header file. */
+#include <mmintrin.h>
+
+/* Get _mm_malloc () and _mm_free (). */
+#include <mm_malloc.h>
+
+/* The Intel API is flexible enough that we must allow aliasing with other
+ vector types, and their scalar components. */
+typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__));
+
+/* Internal data types for implementing the intrinsics. */
+typedef float __v4sf __attribute__ ((__vector_size__ (16)));
+
+/* Create a selector for use with the SHUFPS instruction. */
+#define _MM_SHUFFLE(fp3,fp2,fp1,fp0) \
+ (((fp3) << 6) | ((fp2) << 4) | ((fp1) << 2) | (fp0))
+
+/* Constants for use with _mm_prefetch. */
+enum _mm_hint
+{
+ _MM_HINT_T0 = 3,
+ _MM_HINT_T1 = 2,
+ _MM_HINT_T2 = 1,
+ _MM_HINT_NTA = 0
+};
+
+/* Bits in the MXCSR. */
+#define _MM_EXCEPT_MASK 0x003f
+#define _MM_EXCEPT_INVALID 0x0001
+#define _MM_EXCEPT_DENORM 0x0002
+#define _MM_EXCEPT_DIV_ZERO 0x0004
+#define _MM_EXCEPT_OVERFLOW 0x0008
+#define _MM_EXCEPT_UNDERFLOW 0x0010
+#define _MM_EXCEPT_INEXACT 0x0020
+
+#define _MM_MASK_MASK 0x1f80
+#define _MM_MASK_INVALID 0x0080
+#define _MM_MASK_DENORM 0x0100
+#define _MM_MASK_DIV_ZERO 0x0200
+#define _MM_MASK_OVERFLOW 0x0400
+#define _MM_MASK_UNDERFLOW 0x0800
+#define _MM_MASK_INEXACT 0x1000
+
+#define _MM_ROUND_MASK 0x6000
+#define _MM_ROUND_NEAREST 0x0000
+#define _MM_ROUND_DOWN 0x2000
+#define _MM_ROUND_UP 0x4000
+#define _MM_ROUND_TOWARD_ZERO 0x6000
+
+#define _MM_FLUSH_ZERO_MASK 0x8000
+#define _MM_FLUSH_ZERO_ON 0x8000
+#define _MM_FLUSH_ZERO_OFF 0x0000
+
+/* Create a vector of zeros. */
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_setzero_ps (void)
+{
+ return __extension__ (__m128){ 0.0f, 0.0f, 0.0f, 0.0f };
+}
+
+/* Perform the respective operation on the lower SPFP (single-precision
+ floating-point) values of A and B; the upper three SPFP values are
+ passed through from A. */
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_add_ss (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_addss ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sub_ss (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_subss ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_mul_ss (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_mulss ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_div_ss (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_divss ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sqrt_ss (__m128 __A)
+{
+ return (__m128) __builtin_ia32_sqrtss ((__v4sf)__A);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_rcp_ss (__m128 __A)
+{
+ return (__m128) __builtin_ia32_rcpss ((__v4sf)__A);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_rsqrt_ss (__m128 __A)
+{
+ return (__m128) __builtin_ia32_rsqrtss ((__v4sf)__A);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_min_ss (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_minss ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_max_ss (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_maxss ((__v4sf)__A, (__v4sf)__B);
+}
+
+/* Perform the respective operation on the four SPFP values in A and B. */
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_add_ps (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_addps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sub_ps (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_subps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_mul_ps (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_mulps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_div_ps (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_divps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sqrt_ps (__m128 __A)
+{
+ return (__m128) __builtin_ia32_sqrtps ((__v4sf)__A);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_rcp_ps (__m128 __A)
+{
+ return (__m128) __builtin_ia32_rcpps ((__v4sf)__A);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_rsqrt_ps (__m128 __A)
+{
+ return (__m128) __builtin_ia32_rsqrtps ((__v4sf)__A);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_min_ps (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_minps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_max_ps (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_maxps ((__v4sf)__A, (__v4sf)__B);
+}
+
+/* Perform logical bit-wise operations on 128-bit values. */
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_and_ps (__m128 __A, __m128 __B)
+{
+ return __builtin_ia32_andps (__A, __B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_andnot_ps (__m128 __A, __m128 __B)
+{
+ return __builtin_ia32_andnps (__A, __B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_or_ps (__m128 __A, __m128 __B)
+{
+ return __builtin_ia32_orps (__A, __B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_xor_ps (__m128 __A, __m128 __B)
+{
+ return __builtin_ia32_xorps (__A, __B);
+}
+
+/* Perform a comparison on the lower SPFP values of A and B. If the
+ comparison is true, place a mask of all ones in the result, otherwise a
+ mask of zeros. The upper three SPFP values are passed through from A. */
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpeq_ss (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_cmpeqss ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmplt_ss (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_cmpltss ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmple_ss (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_cmpless ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpgt_ss (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_movss ((__v4sf) __A,
+ (__v4sf)
+ __builtin_ia32_cmpltss ((__v4sf) __B,
+ (__v4sf)
+ __A));
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpge_ss (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_movss ((__v4sf) __A,
+ (__v4sf)
+ __builtin_ia32_cmpless ((__v4sf) __B,
+ (__v4sf)
+ __A));
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpneq_ss (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_cmpneqss ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpnlt_ss (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_cmpnltss ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpnle_ss (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_cmpnless ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpngt_ss (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_movss ((__v4sf) __A,
+ (__v4sf)
+ __builtin_ia32_cmpnltss ((__v4sf) __B,
+ (__v4sf)
+ __A));
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpnge_ss (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_movss ((__v4sf) __A,
+ (__v4sf)
+ __builtin_ia32_cmpnless ((__v4sf) __B,
+ (__v4sf)
+ __A));
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpord_ss (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_cmpordss ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpunord_ss (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_cmpunordss ((__v4sf)__A, (__v4sf)__B);
+}
+
+/* Perform a comparison on the four SPFP values of A and B. For each
+ element, if the comparison is true, place a mask of all ones in the
+ result, otherwise a mask of zeros. */
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpeq_ps (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_cmpeqps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmplt_ps (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_cmpltps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmple_ps (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_cmpleps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpgt_ps (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_cmpgtps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpge_ps (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_cmpgeps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpneq_ps (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_cmpneqps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpnlt_ps (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_cmpnltps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpnle_ps (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_cmpnleps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpngt_ps (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_cmpngtps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpnge_ps (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_cmpngeps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpord_ps (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_cmpordps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpunord_ps (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_cmpunordps ((__v4sf)__A, (__v4sf)__B);
+}
+
+/* Compare the lower SPFP values of A and B and return 1 if true
+ and 0 if false. */
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comieq_ss (__m128 __A, __m128 __B)
+{
+ return __builtin_ia32_comieq ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comilt_ss (__m128 __A, __m128 __B)
+{
+ return __builtin_ia32_comilt ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comile_ss (__m128 __A, __m128 __B)
+{
+ return __builtin_ia32_comile ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comigt_ss (__m128 __A, __m128 __B)
+{
+ return __builtin_ia32_comigt ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comige_ss (__m128 __A, __m128 __B)
+{
+ return __builtin_ia32_comige ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comineq_ss (__m128 __A, __m128 __B)
+{
+ return __builtin_ia32_comineq ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_ucomieq_ss (__m128 __A, __m128 __B)
+{
+ return __builtin_ia32_ucomieq ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_ucomilt_ss (__m128 __A, __m128 __B)
+{
+ return __builtin_ia32_ucomilt ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_ucomile_ss (__m128 __A, __m128 __B)
+{
+ return __builtin_ia32_ucomile ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_ucomigt_ss (__m128 __A, __m128 __B)
+{
+ return __builtin_ia32_ucomigt ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_ucomige_ss (__m128 __A, __m128 __B)
+{
+ return __builtin_ia32_ucomige ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_ucomineq_ss (__m128 __A, __m128 __B)
+{
+ return __builtin_ia32_ucomineq ((__v4sf)__A, (__v4sf)__B);
+}
+
+/* Convert the lower SPFP value to a 32-bit integer according to the current
+ rounding mode. */
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtss_si32 (__m128 __A)
+{
+ return __builtin_ia32_cvtss2si ((__v4sf) __A);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvt_ss2si (__m128 __A)
+{
+ return _mm_cvtss_si32 (__A);
+}
+
+#ifdef __x86_64__
+/* Convert the lower SPFP value to a 32-bit integer according to the
+ current rounding mode. */
+
+/* Intel intrinsic. */
+extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtss_si64 (__m128 __A)
+{
+ return __builtin_ia32_cvtss2si64 ((__v4sf) __A);
+}
+
+/* Microsoft intrinsic. */
+extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtss_si64x (__m128 __A)
+{
+ return __builtin_ia32_cvtss2si64 ((__v4sf) __A);
+}
+#endif
+
+/* Convert the two lower SPFP values to 32-bit integers according to the
+ current rounding mode. Return the integers in packed form. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtps_pi32 (__m128 __A)
+{
+ return (__m64) __builtin_ia32_cvtps2pi ((__v4sf) __A);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvt_ps2pi (__m128 __A)
+{
+ return _mm_cvtps_pi32 (__A);
+}
+
+/* Truncate the lower SPFP value to a 32-bit integer. */
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvttss_si32 (__m128 __A)
+{
+ return __builtin_ia32_cvttss2si ((__v4sf) __A);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtt_ss2si (__m128 __A)
+{
+ return _mm_cvttss_si32 (__A);
+}
+
+#ifdef __x86_64__
+/* Truncate the lower SPFP value to a 32-bit integer. */
+
+/* Intel intrinsic. */
+extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvttss_si64 (__m128 __A)
+{
+ return __builtin_ia32_cvttss2si64 ((__v4sf) __A);
+}
+
+/* Microsoft intrinsic. */
+extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvttss_si64x (__m128 __A)
+{
+ return __builtin_ia32_cvttss2si64 ((__v4sf) __A);
+}
+#endif
+
+/* Truncate the two lower SPFP values to 32-bit integers. Return the
+ integers in packed form. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvttps_pi32 (__m128 __A)
+{
+ return (__m64) __builtin_ia32_cvttps2pi ((__v4sf) __A);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtt_ps2pi (__m128 __A)
+{
+ return _mm_cvttps_pi32 (__A);
+}
+
+/* Convert B to a SPFP value and insert it as element zero in A. */
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsi32_ss (__m128 __A, int __B)
+{
+ return (__m128) __builtin_ia32_cvtsi2ss ((__v4sf) __A, __B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvt_si2ss (__m128 __A, int __B)
+{
+ return _mm_cvtsi32_ss (__A, __B);
+}
+
+#ifdef __x86_64__
+/* Convert B to a SPFP value and insert it as element zero in A. */
+
+/* Intel intrinsic. */
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsi64_ss (__m128 __A, long long __B)
+{
+ return (__m128) __builtin_ia32_cvtsi642ss ((__v4sf) __A, __B);
+}
+
+/* Microsoft intrinsic. */
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsi64x_ss (__m128 __A, long long __B)
+{
+ return (__m128) __builtin_ia32_cvtsi642ss ((__v4sf) __A, __B);
+}
+#endif
+
+/* Convert the two 32-bit values in B to SPFP form and insert them
+ as the two lower elements in A. */
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtpi32_ps (__m128 __A, __m64 __B)
+{
+ return (__m128) __builtin_ia32_cvtpi2ps ((__v4sf) __A, (__v2si)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvt_pi2ps (__m128 __A, __m64 __B)
+{
+ return _mm_cvtpi32_ps (__A, __B);
+}
+
+/* Convert the four signed 16-bit values in A to SPFP form. */
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtpi16_ps (__m64 __A)
+{
+ __v4hi __sign;
+ __v2si __hisi, __losi;
+ __v4sf __zero, __ra, __rb;
+
+ /* This comparison against zero gives us a mask that can be used to
+ fill in the missing sign bits in the unpack operations below, so
+ that we get signed values after unpacking. */
+ __sign = __builtin_ia32_pcmpgtw ((__v4hi)0LL, (__v4hi)__A);
+
+ /* Convert the four words to doublewords. */
+ __hisi = (__v2si) __builtin_ia32_punpckhwd ((__v4hi)__A, __sign);
+ __losi = (__v2si) __builtin_ia32_punpcklwd ((__v4hi)__A, __sign);
+
+ /* Convert the doublewords to floating point two at a time. */
+ __zero = (__v4sf) _mm_setzero_ps ();
+ __ra = __builtin_ia32_cvtpi2ps (__zero, __hisi);
+ __rb = __builtin_ia32_cvtpi2ps (__ra, __losi);
+
+ return (__m128) __builtin_ia32_movlhps (__ra, __rb);
+}
+
+/* Convert the four unsigned 16-bit values in A to SPFP form. */
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtpu16_ps (__m64 __A)
+{
+ __v2si __hisi, __losi;
+ __v4sf __zero, __ra, __rb;
+
+ /* Convert the four words to doublewords. */
+ __hisi = (__v2si) __builtin_ia32_punpckhwd ((__v4hi)__A, (__v4hi)0LL);
+ __losi = (__v2si) __builtin_ia32_punpcklwd ((__v4hi)__A, (__v4hi)0LL);
+
+ /* Convert the doublewords to floating point two at a time. */
+ __zero = (__v4sf) _mm_setzero_ps ();
+ __ra = __builtin_ia32_cvtpi2ps (__zero, __hisi);
+ __rb = __builtin_ia32_cvtpi2ps (__ra, __losi);
+
+ return (__m128) __builtin_ia32_movlhps (__ra, __rb);
+}
+
+/* Convert the low four signed 8-bit values in A to SPFP form. */
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtpi8_ps (__m64 __A)
+{
+ __v8qi __sign;
+
+ /* This comparison against zero gives us a mask that can be used to
+ fill in the missing sign bits in the unpack operations below, so
+ that we get signed values after unpacking. */
+ __sign = __builtin_ia32_pcmpgtb ((__v8qi)0LL, (__v8qi)__A);
+
+ /* Convert the four low bytes to words. */
+ __A = (__m64) __builtin_ia32_punpcklbw ((__v8qi)__A, __sign);
+
+ return _mm_cvtpi16_ps(__A);
+}
+
+/* Convert the low four unsigned 8-bit values in A to SPFP form. */
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtpu8_ps(__m64 __A)
+{
+ __A = (__m64) __builtin_ia32_punpcklbw ((__v8qi)__A, (__v8qi)0LL);
+ return _mm_cvtpu16_ps(__A);
+}
+
+/* Convert the four signed 32-bit values in A and B to SPFP form. */
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtpi32x2_ps(__m64 __A, __m64 __B)
+{
+ __v4sf __zero = (__v4sf) _mm_setzero_ps ();
+ __v4sf __sfa = __builtin_ia32_cvtpi2ps (__zero, (__v2si)__A);
+ __v4sf __sfb = __builtin_ia32_cvtpi2ps (__sfa, (__v2si)__B);
+ return (__m128) __builtin_ia32_movlhps (__sfa, __sfb);
+}
+
+/* Convert the four SPFP values in A to four signed 16-bit integers. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtps_pi16(__m128 __A)
+{
+ __v4sf __hisf = (__v4sf)__A;
+ __v4sf __losf = __builtin_ia32_movhlps (__hisf, __hisf);
+ __v2si __hisi = __builtin_ia32_cvtps2pi (__hisf);
+ __v2si __losi = __builtin_ia32_cvtps2pi (__losf);
+ return (__m64) __builtin_ia32_packssdw (__hisi, __losi);
+}
+
+/* Convert the four SPFP values in A to four signed 8-bit integers. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtps_pi8(__m128 __A)
+{
+ __v4hi __tmp = (__v4hi) _mm_cvtps_pi16 (__A);
+ return (__m64) __builtin_ia32_packsswb (__tmp, (__v4hi)0LL);
+}
+
+/* Selects four specific SPFP values from A and B based on MASK. */
+#ifdef __OPTIMIZE__
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_shuffle_ps (__m128 __A, __m128 __B, int const __mask)
+{
+ return (__m128) __builtin_ia32_shufps ((__v4sf)__A, (__v4sf)__B, __mask);
+}
+#else
+#define _mm_shuffle_ps(A, B, MASK) \
+ ((__m128) __builtin_ia32_shufps ((__v4sf)(__m128)(A), \
+ (__v4sf)(__m128)(B), (int)(MASK)))
+#endif
+
+/* Selects and interleaves the upper two SPFP values from A and B. */
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_unpackhi_ps (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_unpckhps ((__v4sf)__A, (__v4sf)__B);
+}
+
+/* Selects and interleaves the lower two SPFP values from A and B. */
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_unpacklo_ps (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_unpcklps ((__v4sf)__A, (__v4sf)__B);
+}
+
+/* Sets the upper two SPFP values with 64-bits of data loaded from P;
+ the lower two values are passed through from A. */
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_loadh_pi (__m128 __A, __m64 const *__P)
+{
+ return (__m128) __builtin_ia32_loadhps ((__v4sf)__A, (const __v2sf *)__P);
+}
+
+/* Stores the upper two SPFP values of A into P. */
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_storeh_pi (__m64 *__P, __m128 __A)
+{
+ __builtin_ia32_storehps ((__v2sf *)__P, (__v4sf)__A);
+}
+
+/* Moves the upper two values of B into the lower two values of A. */
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_movehl_ps (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_movhlps ((__v4sf)__A, (__v4sf)__B);
+}
+
+/* Moves the lower two values of B into the upper two values of A. */
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_movelh_ps (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_movlhps ((__v4sf)__A, (__v4sf)__B);
+}
+
+/* Sets the lower two SPFP values with 64-bits of data loaded from P;
+ the upper two values are passed through from A. */
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_loadl_pi (__m128 __A, __m64 const *__P)
+{
+ return (__m128) __builtin_ia32_loadlps ((__v4sf)__A, (const __v2sf *)__P);
+}
+
+/* Stores the lower two SPFP values of A into P. */
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_storel_pi (__m64 *__P, __m128 __A)
+{
+ __builtin_ia32_storelps ((__v2sf *)__P, (__v4sf)__A);
+}
+
+/* Creates a 4-bit mask from the most significant bits of the SPFP values. */
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_movemask_ps (__m128 __A)
+{
+ return __builtin_ia32_movmskps ((__v4sf)__A);
+}
+
+/* Return the contents of the control register. */
+extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_getcsr (void)
+{
+ return __builtin_ia32_stmxcsr ();
+}
+
+/* Read exception bits from the control register. */
+extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_MM_GET_EXCEPTION_STATE (void)
+{
+ return _mm_getcsr() & _MM_EXCEPT_MASK;
+}
+
+extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_MM_GET_EXCEPTION_MASK (void)
+{
+ return _mm_getcsr() & _MM_MASK_MASK;
+}
+
+extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_MM_GET_ROUNDING_MODE (void)
+{
+ return _mm_getcsr() & _MM_ROUND_MASK;
+}
+
+extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_MM_GET_FLUSH_ZERO_MODE (void)
+{
+ return _mm_getcsr() & _MM_FLUSH_ZERO_MASK;
+}
+
+/* Set the control register to I. */
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_setcsr (unsigned int __I)
+{
+ __builtin_ia32_ldmxcsr (__I);
+}
+
+/* Set exception bits in the control register. */
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_MM_SET_EXCEPTION_STATE(unsigned int __mask)
+{
+ _mm_setcsr((_mm_getcsr() & ~_MM_EXCEPT_MASK) | __mask);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_MM_SET_EXCEPTION_MASK (unsigned int __mask)
+{
+ _mm_setcsr((_mm_getcsr() & ~_MM_MASK_MASK) | __mask);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_MM_SET_ROUNDING_MODE (unsigned int __mode)
+{
+ _mm_setcsr((_mm_getcsr() & ~_MM_ROUND_MASK) | __mode);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_MM_SET_FLUSH_ZERO_MODE (unsigned int __mode)
+{
+ _mm_setcsr((_mm_getcsr() & ~_MM_FLUSH_ZERO_MASK) | __mode);
+}
+
+/* Create a vector with element 0 as F and the rest zero. */
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set_ss (float __F)
+{
+ return __extension__ (__m128)(__v4sf){ __F, 0.0f, 0.0f, 0.0f };
+}
+
+/* Create a vector with all four elements equal to F. */
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set1_ps (float __F)
+{
+ return __extension__ (__m128)(__v4sf){ __F, __F, __F, __F };
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set_ps1 (float __F)
+{
+ return _mm_set1_ps (__F);
+}
+
+/* Create a vector with element 0 as *P and the rest zero. */
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_load_ss (float const *__P)
+{
+ return _mm_set_ss (*__P);
+}
+
+/* Create a vector with all four elements equal to *P. */
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_load1_ps (float const *__P)
+{
+ return _mm_set1_ps (*__P);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_load_ps1 (float const *__P)
+{
+ return _mm_load1_ps (__P);
+}
+
+/* Load four SPFP values from P. The address must be 16-byte aligned. */
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_load_ps (float const *__P)
+{
+ return (__m128) *(__v4sf *)__P;
+}
+
+/* Load four SPFP values from P. The address need not be 16-byte aligned. */
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_loadu_ps (float const *__P)
+{
+ return (__m128) __builtin_ia32_loadups (__P);
+}
+
+/* Load four SPFP values in reverse order. The address must be aligned. */
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_loadr_ps (float const *__P)
+{
+ __v4sf __tmp = *(__v4sf *)__P;
+ return (__m128) __builtin_ia32_shufps (__tmp, __tmp, _MM_SHUFFLE (0,1,2,3));
+}
+
+/* Create the vector [Z Y X W]. */
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set_ps (const float __Z, const float __Y, const float __X, const float __W)
+{
+ return __extension__ (__m128)(__v4sf){ __W, __X, __Y, __Z };
+}
+
+/* Create the vector [W X Y Z]. */
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_setr_ps (float __Z, float __Y, float __X, float __W)
+{
+ return __extension__ (__m128)(__v4sf){ __Z, __Y, __X, __W };
+}
+
+/* Stores the lower SPFP value. */
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_store_ss (float *__P, __m128 __A)
+{
+ *__P = __builtin_ia32_vec_ext_v4sf ((__v4sf)__A, 0);
+}
+
+extern __inline float __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtss_f32 (__m128 __A)
+{
+ return __builtin_ia32_vec_ext_v4sf ((__v4sf)__A, 0);
+}
+
+/* Store four SPFP values. The address must be 16-byte aligned. */
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_store_ps (float *__P, __m128 __A)
+{
+ *(__v4sf *)__P = (__v4sf)__A;
+}
+
+/* Store four SPFP values. The address need not be 16-byte aligned. */
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_storeu_ps (float *__P, __m128 __A)
+{
+ __builtin_ia32_storeups (__P, (__v4sf)__A);
+}
+
+/* Store the lower SPFP value across four words. */
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_store1_ps (float *__P, __m128 __A)
+{
+ __v4sf __va = (__v4sf)__A;
+ __v4sf __tmp = __builtin_ia32_shufps (__va, __va, _MM_SHUFFLE (0,0,0,0));
+ _mm_storeu_ps (__P, __tmp);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_store_ps1 (float *__P, __m128 __A)
+{
+ _mm_store1_ps (__P, __A);
+}
+
+/* Store four SPFP values in reverse order. The address must be aligned. */
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_storer_ps (float *__P, __m128 __A)
+{
+ __v4sf __va = (__v4sf)__A;
+ __v4sf __tmp = __builtin_ia32_shufps (__va, __va, _MM_SHUFFLE (0,1,2,3));
+ _mm_store_ps (__P, __tmp);
+}
+
+/* Sets the low SPFP value of A from the low value of B. */
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_move_ss (__m128 __A, __m128 __B)
+{
+ return (__m128) __builtin_ia32_movss ((__v4sf)__A, (__v4sf)__B);
+}
+
+/* Extracts one of the four words of A. The selector N must be immediate. */
+#ifdef __OPTIMIZE__
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_extract_pi16 (__m64 const __A, int const __N)
+{
+ return __builtin_ia32_vec_ext_v4hi ((__v4hi)__A, __N);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pextrw (__m64 const __A, int const __N)
+{
+ return _mm_extract_pi16 (__A, __N);
+}
+#else
+#define _mm_extract_pi16(A, N) \
+ ((int) __builtin_ia32_vec_ext_v4hi ((__v4hi)(__m64)(A), (int)(N)))
+
+#define _m_pextrw(A, N) _mm_extract_pi16(A, N)
+#endif
+
+/* Inserts word D into one of four words of A. The selector N must be
+ immediate. */
+#ifdef __OPTIMIZE__
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_insert_pi16 (__m64 const __A, int const __D, int const __N)
+{
+ return (__m64) __builtin_ia32_vec_set_v4hi ((__v4hi)__A, __D, __N);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pinsrw (__m64 const __A, int const __D, int const __N)
+{
+ return _mm_insert_pi16 (__A, __D, __N);
+}
+#else
+#define _mm_insert_pi16(A, D, N) \
+ ((__m64) __builtin_ia32_vec_set_v4hi ((__v4hi)(__m64)(A), \
+ (int)(D), (int)(N)))
+
+#define _m_pinsrw(A, D, N) _mm_insert_pi16(A, D, N)
+#endif
+
+/* Compute the element-wise maximum of signed 16-bit values. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_max_pi16 (__m64 __A, __m64 __B)
+{
+ return (__m64) __builtin_ia32_pmaxsw ((__v4hi)__A, (__v4hi)__B);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pmaxsw (__m64 __A, __m64 __B)
+{
+ return _mm_max_pi16 (__A, __B);
+}
+
+/* Compute the element-wise maximum of unsigned 8-bit values. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_max_pu8 (__m64 __A, __m64 __B)
+{
+ return (__m64) __builtin_ia32_pmaxub ((__v8qi)__A, (__v8qi)__B);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pmaxub (__m64 __A, __m64 __B)
+{
+ return _mm_max_pu8 (__A, __B);
+}
+
+/* Compute the element-wise minimum of signed 16-bit values. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_min_pi16 (__m64 __A, __m64 __B)
+{
+ return (__m64) __builtin_ia32_pminsw ((__v4hi)__A, (__v4hi)__B);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pminsw (__m64 __A, __m64 __B)
+{
+ return _mm_min_pi16 (__A, __B);
+}
+
+/* Compute the element-wise minimum of unsigned 8-bit values. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_min_pu8 (__m64 __A, __m64 __B)
+{
+ return (__m64) __builtin_ia32_pminub ((__v8qi)__A, (__v8qi)__B);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pminub (__m64 __A, __m64 __B)
+{
+ return _mm_min_pu8 (__A, __B);
+}
+
+/* Create an 8-bit mask of the signs of 8-bit values. */
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_movemask_pi8 (__m64 __A)
+{
+ return __builtin_ia32_pmovmskb ((__v8qi)__A);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pmovmskb (__m64 __A)
+{
+ return _mm_movemask_pi8 (__A);
+}
+
+/* Multiply four unsigned 16-bit values in A by four unsigned 16-bit values
+ in B and produce the high 16 bits of the 32-bit results. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_mulhi_pu16 (__m64 __A, __m64 __B)
+{
+ return (__m64) __builtin_ia32_pmulhuw ((__v4hi)__A, (__v4hi)__B);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pmulhuw (__m64 __A, __m64 __B)
+{
+ return _mm_mulhi_pu16 (__A, __B);
+}
+
+/* Return a combination of the four 16-bit values in A. The selector
+ must be an immediate. */
+#ifdef __OPTIMIZE__
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_shuffle_pi16 (__m64 __A, int const __N)
+{
+ return (__m64) __builtin_ia32_pshufw ((__v4hi)__A, __N);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pshufw (__m64 __A, int const __N)
+{
+ return _mm_shuffle_pi16 (__A, __N);
+}
+#else
+#define _mm_shuffle_pi16(A, N) \
+ ((__m64) __builtin_ia32_pshufw ((__v4hi)(__m64)(A), (int)(N)))
+
+#define _m_pshufw(A, N) _mm_shuffle_pi16 (A, N)
+#endif
+
+/* Conditionally store byte elements of A into P. The high bit of each
+ byte in the selector N determines whether the corresponding byte from
+ A is stored. */
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_maskmove_si64 (__m64 __A, __m64 __N, char *__P)
+{
+ __builtin_ia32_maskmovq ((__v8qi)__A, (__v8qi)__N, __P);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_maskmovq (__m64 __A, __m64 __N, char *__P)
+{
+ _mm_maskmove_si64 (__A, __N, __P);
+}
+
+/* Compute the rounded averages of the unsigned 8-bit values in A and B. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_avg_pu8 (__m64 __A, __m64 __B)
+{
+ return (__m64) __builtin_ia32_pavgb ((__v8qi)__A, (__v8qi)__B);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pavgb (__m64 __A, __m64 __B)
+{
+ return _mm_avg_pu8 (__A, __B);
+}
+
+/* Compute the rounded averages of the unsigned 16-bit values in A and B. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_avg_pu16 (__m64 __A, __m64 __B)
+{
+ return (__m64) __builtin_ia32_pavgw ((__v4hi)__A, (__v4hi)__B);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pavgw (__m64 __A, __m64 __B)
+{
+ return _mm_avg_pu16 (__A, __B);
+}
+
+/* Compute the sum of the absolute differences of the unsigned 8-bit
+ values in A and B. Return the value in the lower 16-bit word; the
+ upper words are cleared. */
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sad_pu8 (__m64 __A, __m64 __B)
+{
+ return (__m64) __builtin_ia32_psadbw ((__v8qi)__A, (__v8qi)__B);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psadbw (__m64 __A, __m64 __B)
+{
+ return _mm_sad_pu8 (__A, __B);
+}
+
+/* Loads one cache line from address P to a location "closer" to the
+ processor. The selector I specifies the type of prefetch operation. */
+#ifdef __OPTIMIZE__
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_prefetch (const void *__P, enum _mm_hint __I)
+{
+ __builtin_prefetch (__P, 0, __I);
+}
+#else
+#define _mm_prefetch(P, I) \
+ __builtin_prefetch ((P), 0, (I))
+#endif
+
+/* Stores the data in A to the address P without polluting the caches. */
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_stream_pi (__m64 *__P, __m64 __A)
+{
+ __builtin_ia32_movntq ((unsigned long long *)__P, (unsigned long long)__A);
+}
+
+/* Likewise. The address must be 16-byte aligned. */
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_stream_ps (float *__P, __m128 __A)
+{
+ __builtin_ia32_movntps (__P, (__v4sf)__A);
+}
+
+/* Guarantees that every preceding store is globally visible before
+ any subsequent store. */
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sfence (void)
+{
+ __builtin_ia32_sfence ();
+}
+
+/* The execution of the next instruction is delayed by an implementation
+ specific amount of time. The instruction does not modify the
+ architectural state. */
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_pause (void)
+{
+ __asm__ __volatile__ ("rep; nop" : : );
+}
+
+/* Transpose the 4x4 matrix composed of row[0-3]. */
+#define _MM_TRANSPOSE4_PS(row0, row1, row2, row3) \
+do { \
+ __v4sf __r0 = (row0), __r1 = (row1), __r2 = (row2), __r3 = (row3); \
+ __v4sf __t0 = __builtin_ia32_unpcklps (__r0, __r1); \
+ __v4sf __t1 = __builtin_ia32_unpcklps (__r2, __r3); \
+ __v4sf __t2 = __builtin_ia32_unpckhps (__r0, __r1); \
+ __v4sf __t3 = __builtin_ia32_unpckhps (__r2, __r3); \
+ (row0) = __builtin_ia32_movlhps (__t0, __t1); \
+ (row1) = __builtin_ia32_movhlps (__t1, __t0); \
+ (row2) = __builtin_ia32_movlhps (__t2, __t3); \
+ (row3) = __builtin_ia32_movhlps (__t3, __t2); \
+} while (0)
+
+/* For backward source compatibility. */
+#ifdef __SSE2__
+# include <emmintrin.h>
+#endif
+
+#endif /* __SSE__ */
+#endif /* _XMMINTRIN_H_INCLUDED */
diff --git a/lib/gcc/i686-linux/4.4.3/install-tools/fixinc_list b/lib/gcc/i686-linux/4.4.3/install-tools/fixinc_list
new file mode 100644
index 0000000..092bc2b
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/install-tools/fixinc_list
@@ -0,0 +1 @@
+;
diff --git a/lib/gcc/i686-linux/4.4.3/install-tools/gsyslimits.h b/lib/gcc/i686-linux/4.4.3/install-tools/gsyslimits.h
new file mode 100644
index 0000000..a362802
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/install-tools/gsyslimits.h
@@ -0,0 +1,8 @@
+/* syslimits.h stands for the system's own limits.h file.
+ If we can use it ok unmodified, then we install this text.
+ If fixincludes fixes it, then the fixed version is installed
+ instead of this text. */
+
+#define _GCC_NEXT_LIMITS_H /* tell gcc's limits.h to recurse */
+#include_next <limits.h>
+#undef _GCC_NEXT_LIMITS_H
diff --git a/lib/gcc/i686-linux/4.4.3/install-tools/include/README b/lib/gcc/i686-linux/4.4.3/install-tools/include/README
new file mode 100644
index 0000000..7086a77
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/install-tools/include/README
@@ -0,0 +1,14 @@
+This README file is copied into the directory for GCC-only header files
+when fixincludes is run by the makefile for GCC.
+
+Many of the files in this directory were automatically edited from the
+standard system header files by the fixincludes process. They are
+system-specific, and will not work on any other kind of system. They
+are also not part of GCC. The reason we have to do this is because
+GCC requires ANSI C headers and many vendors supply ANSI-incompatible
+headers.
+
+Because this is an automated process, sometimes headers get "fixed"
+that do not, strictly speaking, need a fix. As long as nothing is broken
+by the process, it is just an unfortunate collateral inconvenience.
+We would like to rectify it, if it is not "too inconvenient".
diff --git a/lib/gcc/i686-linux/4.4.3/install-tools/include/limits.h b/lib/gcc/i686-linux/4.4.3/install-tools/include/limits.h
new file mode 100644
index 0000000..30e08a7
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/install-tools/include/limits.h
@@ -0,0 +1,125 @@
+/* This administrivia gets added to the beginning of limits.h
+ if the system has its own version of limits.h. */
+
+/* We use _GCC_LIMITS_H_ because we want this not to match
+ any macros that the system's limits.h uses for its own purposes. */
+#ifndef _GCC_LIMITS_H_ /* Terminated in limity.h. */
+#define _GCC_LIMITS_H_
+
+#ifndef _LIBC_LIMITS_H_
+/* Use "..." so that we find syslimits.h only in this same directory. */
+#include "syslimits.h"
+#endif
+#ifndef _LIMITS_H___
+#define _LIMITS_H___
+
+/* Number of bits in a `char'. */
+#undef CHAR_BIT
+#define CHAR_BIT __CHAR_BIT__
+
+/* Maximum length of a multibyte character. */
+#ifndef MB_LEN_MAX
+#define MB_LEN_MAX 1
+#endif
+
+/* Minimum and maximum values a `signed char' can hold. */
+#undef SCHAR_MIN
+#define SCHAR_MIN (-SCHAR_MAX - 1)
+#undef SCHAR_MAX
+#define SCHAR_MAX __SCHAR_MAX__
+
+/* Maximum value an `unsigned char' can hold. (Minimum is 0). */
+#undef UCHAR_MAX
+#if __SCHAR_MAX__ == __INT_MAX__
+# define UCHAR_MAX (SCHAR_MAX * 2U + 1U)
+#else
+# define UCHAR_MAX (SCHAR_MAX * 2 + 1)
+#endif
+
+/* Minimum and maximum values a `char' can hold. */
+#ifdef __CHAR_UNSIGNED__
+# undef CHAR_MIN
+# if __SCHAR_MAX__ == __INT_MAX__
+# define CHAR_MIN 0U
+# else
+# define CHAR_MIN 0
+# endif
+# undef CHAR_MAX
+# define CHAR_MAX UCHAR_MAX
+#else
+# undef CHAR_MIN
+# define CHAR_MIN SCHAR_MIN
+# undef CHAR_MAX
+# define CHAR_MAX SCHAR_MAX
+#endif
+
+/* Minimum and maximum values a `signed short int' can hold. */
+#undef SHRT_MIN
+#define SHRT_MIN (-SHRT_MAX - 1)
+#undef SHRT_MAX
+#define SHRT_MAX __SHRT_MAX__
+
+/* Maximum value an `unsigned short int' can hold. (Minimum is 0). */
+#undef USHRT_MAX
+#if __SHRT_MAX__ == __INT_MAX__
+# define USHRT_MAX (SHRT_MAX * 2U + 1U)
+#else
+# define USHRT_MAX (SHRT_MAX * 2 + 1)
+#endif
+
+/* Minimum and maximum values a `signed int' can hold. */
+#undef INT_MIN
+#define INT_MIN (-INT_MAX - 1)
+#undef INT_MAX
+#define INT_MAX __INT_MAX__
+
+/* Maximum value an `unsigned int' can hold. (Minimum is 0). */
+#undef UINT_MAX
+#define UINT_MAX (INT_MAX * 2U + 1U)
+
+/* Minimum and maximum values a `signed long int' can hold.
+ (Same as `int'). */
+#undef LONG_MIN
+#define LONG_MIN (-LONG_MAX - 1L)
+#undef LONG_MAX
+#define LONG_MAX __LONG_MAX__
+
+/* Maximum value an `unsigned long int' can hold. (Minimum is 0). */
+#undef ULONG_MAX
+#define ULONG_MAX (LONG_MAX * 2UL + 1UL)
+
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+/* Minimum and maximum values a `signed long long int' can hold. */
+# undef LLONG_MIN
+# define LLONG_MIN (-LLONG_MAX - 1LL)
+# undef LLONG_MAX
+# define LLONG_MAX __LONG_LONG_MAX__
+
+/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
+# undef ULLONG_MAX
+# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
+#endif
+
+#if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined (__STRICT_ANSI__)
+/* Minimum and maximum values a `signed long long int' can hold. */
+# undef LONG_LONG_MIN
+# define LONG_LONG_MIN (-LONG_LONG_MAX - 1LL)
+# undef LONG_LONG_MAX
+# define LONG_LONG_MAX __LONG_LONG_MAX__
+
+/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
+# undef ULONG_LONG_MAX
+# define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1ULL)
+#endif
+
+#endif /* _LIMITS_H___ */
+/* This administrivia gets added to the end of limits.h
+ if the system has its own version of limits.h. */
+
+#else /* not _GCC_LIMITS_H_ */
+
+#ifdef _GCC_NEXT_LIMITS_H
+#include_next <limits.h> /* recurse down to the real one */
+#endif
+
+#endif /* not _GCC_LIMITS_H_ */
diff --git a/lib/gcc/i686-linux/4.4.3/install-tools/macro_list b/lib/gcc/i686-linux/4.4.3/install-tools/macro_list
new file mode 100644
index 0000000..b43a58c
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/install-tools/macro_list
@@ -0,0 +1,3 @@
+i386
+linux
+unix
diff --git a/lib/gcc/i686-linux/4.4.3/install-tools/mkheaders.conf b/lib/gcc/i686-linux/4.4.3/install-tools/mkheaders.conf
new file mode 100644
index 0000000..89713ea
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/install-tools/mkheaders.conf
@@ -0,0 +1,5 @@
+SYSTEM_HEADER_DIR="/tmp/gcc32/1/i686-linux-glibc2.7-4.4.3/sysroot${sysroot_headers_suffix}/usr/include"
+OTHER_FIXINCLUDES_DIRS=""
+FIXPROTO_DEFINES=""
+STMP_FIXPROTO=""
+STMP_FIXINC="stmp-fixinc"
diff --git a/lib/gcc/i686-linux/4.4.3/libgcc.a b/lib/gcc/i686-linux/4.4.3/libgcc.a
new file mode 100644
index 0000000..b219bd6
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/libgcc.a
Binary files differ
diff --git a/lib/gcc/i686-linux/4.4.3/libgcc_eh.a b/lib/gcc/i686-linux/4.4.3/libgcc_eh.a
new file mode 100644
index 0000000..681296d
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/libgcc_eh.a
Binary files differ
diff --git a/lib/gcc/i686-linux/4.4.3/libgcov.a b/lib/gcc/i686-linux/4.4.3/libgcov.a
new file mode 100644
index 0000000..d300998
--- /dev/null
+++ b/lib/gcc/i686-linux/4.4.3/libgcov.a
Binary files differ
diff --git a/lib/libgmp.a b/lib/libgmp.a
new file mode 100644
index 0000000..1232c33
--- /dev/null
+++ b/lib/libgmp.a
Binary files differ
diff --git a/lib/libgmp.la b/lib/libgmp.la
new file mode 100755
index 0000000..8aa08d4
--- /dev/null
+++ b/lib/libgmp.la
@@ -0,0 +1,35 @@
+# libgmp.la - a libtool library file
+# Generated by ltmain.sh - GNU libtool 1.5.24 (1.1220.2.455 2007/06/24 02:13:29)
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname=''
+
+# Names of this library.
+library_names=''
+
+# The name of the static archive.
+old_library='libgmp.a'
+
+# Libraries that this one depends upon.
+dependency_libs=''
+
+# Version information for libgmp.
+current=7
+age=4
+revision=4
+
+# Is this an already installed library?
+installed=yes
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=no
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir='/tmp/gcc32/1/i686-linux-glibc2.7-4.4.3/lib'
diff --git a/lib/libiberty.a b/lib/libiberty.a
new file mode 100644
index 0000000..6de47ec
--- /dev/null
+++ b/lib/libiberty.a
Binary files differ
diff --git a/lib/libmpfr.a b/lib/libmpfr.a
new file mode 100644
index 0000000..b98f687
--- /dev/null
+++ b/lib/libmpfr.a
Binary files differ
diff --git a/lib/libmpfr.la b/lib/libmpfr.la
new file mode 100755
index 0000000..201bb74
--- /dev/null
+++ b/lib/libmpfr.la
@@ -0,0 +1,41 @@
+# libmpfr.la - a libtool library file
+# Generated by ltmain.sh (GNU libtool) 2.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname=''
+
+# Names of this library.
+library_names=''
+
+# The name of the static archive.
+old_library='libmpfr.a'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags=''
+
+# Libraries that this one depends upon.
+dependency_libs=' -L/tmp/gcc32/1/i686-linux-glibc2.7-4.4.3/lib /tmp/gcc32/1/i686-linux-glibc2.7-4.4.3/lib/libgmp.la'
+
+# Names of additional weak libraries provided by this library
+weak_library_names=''
+
+# Version information for libmpfr.
+current=3
+age=2
+revision=0
+
+# Is this an already installed library?
+installed=yes
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=no
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir='/tmp/gcc32/1/i686-linux-glibc2.7-4.4.3/lib'
diff --git a/libexec/gcc/i686-linux/4.4.3/cc1 b/libexec/gcc/i686-linux/4.4.3/cc1
new file mode 100755
index 0000000..1c9dd7b
--- /dev/null
+++ b/libexec/gcc/i686-linux/4.4.3/cc1
Binary files differ
diff --git a/libexec/gcc/i686-linux/4.4.3/cc1plus b/libexec/gcc/i686-linux/4.4.3/cc1plus
new file mode 100755
index 0000000..3e4fa78
--- /dev/null
+++ b/libexec/gcc/i686-linux/4.4.3/cc1plus
Binary files differ
diff --git a/libexec/gcc/i686-linux/4.4.3/collect2 b/libexec/gcc/i686-linux/4.4.3/collect2
new file mode 100755
index 0000000..003f803
--- /dev/null
+++ b/libexec/gcc/i686-linux/4.4.3/collect2
Binary files differ
diff --git a/libexec/gcc/i686-linux/4.4.3/install-tools/fixinc.sh b/libexec/gcc/i686-linux/4.4.3/install-tools/fixinc.sh
new file mode 100755
index 0000000..e73aed9
--- /dev/null
+++ b/libexec/gcc/i686-linux/4.4.3/install-tools/fixinc.sh
@@ -0,0 +1,498 @@
+#!/bin/sh
+#
+# Install modified versions of certain ANSI-incompatible system header
+# files which are fixed to work correctly with ANSI C and placed in a
+# directory that GCC will search.
+#
+# See README-fixinc for more information.
+#
+# fixincludes copyright (c) 1998, 1999, 2000, 2002, 2009
+# The Free Software Foundation, Inc.
+#
+# fixincludes is free software.
+#
+# You may redistribute it and/or modify it under the terms of the
+# GNU General Public License, as published by the Free Software
+# Foundation; either version 3, or (at your option) any later version.
+#
+# fixincludes is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with fixincludes; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+#
+# # # # # # # # # # # # # # # # # # # # #
+
+# Usage: fixinc.sh output-dir input-dir
+#
+# Directory in which to store the results.
+# Fail if no arg to specify a directory for the output.
+if [ "x$1" = "x" ]
+then
+ echo fixincludes: no output directory specified
+ exit 1
+fi
+
+LIB=${1}
+shift
+
+# Make sure it exists.
+if [ ! -d $LIB ]; then
+ mkdir $LIB || {
+ echo fixincludes: output dir '`'$LIB"' cannot be created"
+ exit 1
+ }
+else
+ ( cd $LIB && touch DONE && rm DONE ) || {
+ echo fixincludes: output dir '`'$LIB"' is an invalid directory"
+ exit 1
+ }
+fi
+
+if test -z "$VERBOSE"
+then
+ VERBOSE=2
+ export VERBOSE
+else
+ case "$VERBOSE" in
+ [0-9] ) : ;;
+ * ) VERBOSE=3 ;;
+ esac
+fi
+
+# Define what target system we're fixing.
+#
+if test -r ./Makefile; then
+ target_canonical="`sed -n -e 's,^target[ ]*=[ ]*\(.*\)$,\1,p' < Makefile`"
+fi
+
+# If not from the Makefile, then try config.guess
+#
+if test -z "${target_canonical}" ; then
+ if test -x ./config.guess ; then
+ target_canonical="`config.guess`" ; fi
+ test -z "${target_canonical}" && target_canonical=unknown
+fi
+export target_canonical
+
+# # # # # # # # # # # # # # # # # # # # #
+#
+# Define PWDCMD as a command to use to get the working dir
+# in the form that we want.
+PWDCMD=${PWDCMD-pwd}
+
+case "`$PWDCMD`" in
+//*)
+ # On an Apollo, discard everything before `/usr'.
+ PWDCMD="eval pwd | sed -e 's,.*/usr/,/usr/,'"
+ ;;
+esac
+
+# Original directory.
+ORIGDIR=`${PWDCMD}`
+export ORIGDIR
+FIXINCL=`${PWDCMD}`/fixincl
+if [ ! -x $FIXINCL ] ; then
+ echo "Cannot find fixincl" >&2
+ exit 1
+fi
+export FIXINCL
+
+# Make LIB absolute only if needed to avoid problems with the amd.
+case $LIB in
+/*)
+ ;;
+*)
+ cd $LIB; LIB=`${PWDCMD}`
+ ;;
+esac
+
+if test $VERBOSE -gt 0
+then echo Fixing headers into ${LIB} for ${target_canonical} target ; fi
+
+# Determine whether this system has symbolic links.
+if test -n "$DJDIR"; then
+ LINKS=false
+elif ln -s X $LIB/ShouldNotExist 2>/dev/null; then
+ rm -f $LIB/ShouldNotExist
+ LINKS=true
+elif ln -s X /tmp/ShouldNotExist 2>/dev/null; then
+ rm -f /tmp/ShouldNotExist
+ LINKS=true
+else
+ LINKS=false
+fi
+
+# # # # # # # # # # # # # # # # # # # # #
+#
+# In the file macro_list are listed all the predefined
+# macros that are not in the C89 reserved namespace (the reserved
+# namespace is all identifiers beginnning with two underscores or one
+# underscore followed by a capital letter). A regular expression to find
+# any of those macros in a header file is written to MN_NAME_PAT.
+#
+# Note dependency on ASCII. \012 = newline.
+# tr ' ' '\n' is, alas, not portable.
+
+if test -s ${MACRO_LIST}
+then
+ if test $VERBOSE -gt 0; then
+ echo "Forbidden identifiers: `tr '\012' ' ' < ${MACRO_LIST}`"
+ fi
+ MN_NAME_PAT="`sed 's/^/\\\\</; s/$/\\\\>/; $!s/$/|/' \
+ < ${MACRO_LIST} | tr -d '\012'`"
+ export MN_NAME_PAT
+else
+ if test $VERBOSE -gt 0
+ then echo "No forbidden identifiers defined by this target" ; fi
+fi
+
+# # # # # # # # # # # # # # # # # # # # #
+#
+# Search each input directory for broken header files.
+# This loop ends near the end of the file.
+#
+if test $# -eq 0
+then
+ INPUTLIST="/usr/include"
+else
+ INPUTLIST="$@"
+fi
+
+for INPUT in ${INPUTLIST} ; do
+
+cd ${ORIGDIR}
+
+# Make sure a directory exists before changing into it,
+# otherwise Solaris2 will fail-exit the script.
+#
+if [ ! -d ${INPUT} ]; then
+ continue
+fi
+cd ${INPUT}
+
+INPUT=`${PWDCMD}`
+export INPUT
+
+#
+# # # # # # # # # # # # # # # # # # # # #
+#
+if test $VERBOSE -gt 1
+then echo Finding directories and links to directories ; fi
+
+# Find all directories and all symlinks that point to directories.
+# Put the list in $all_dirs.
+# Each time we find a symlink, add it to newdirs
+# so that we do another find within the dir the link points to.
+# Note that $all_dirs may have duplicates in it;
+# later parts of this file are supposed to ignore them.
+dirs="."
+levels=2
+all_dirs=""
+search_dirs=""
+
+while [ -n "$dirs" ] && [ $levels -gt 0 ]
+do
+ levels=`expr $levels - 1`
+ newdirs=
+ for d in $dirs
+ do
+ if test $VERBOSE -gt 1
+ then echo " Searching $INPUT/$d" ; fi
+
+ # Find all directories under $d, relative to $d, excluding $d itself.
+ # (The /. is needed after $d in case $d is a symlink.)
+ all_dirs="$all_dirs `find $d/. -type d -print | \
+ sed -e '/\/\.$/d' -e 's@/./@/@g'`"
+ # Find all links to directories.
+ # Using `-exec test -d' in find fails on some systems,
+ # and trying to run test via sh fails on others,
+ # so this is the simplest alternative left.
+ # First find all the links, then test each one.
+ theselinks=
+ $LINKS && \
+ theselinks=`find $d/. -type l -print | sed -e 's@/./@/@g'`
+ for d1 in $theselinks --dummy--
+ do
+ # If the link points to a directory,
+ # add that dir to $newdirs
+ if [ -d $d1 ]
+ then
+ all_dirs="$all_dirs $d1"
+ if [ "`ls -ld $d1 | sed -n 's/.*-> //p'`" != "." ]
+ then
+ newdirs="$newdirs $d1"
+ search_dirs="$search_dirs $d1"
+ fi
+ fi
+ done
+ done
+
+ dirs="$newdirs"
+done
+
+# # # # # # # # # # # # # # # # # # # # #
+#
+dirs=
+if test $VERBOSE -gt 2
+then echo "All directories (including links to directories):"
+ echo $all_dirs
+fi
+
+for file in $all_dirs; do
+ rm -rf $LIB/$file
+ if [ ! -d $LIB/$file ]
+ then mkdir $LIB/$file
+ fi
+done
+mkdir $LIB/root
+
+# # # # # # # # # # # # # # # # # # # # #
+#
+# treetops gets an alternating list
+# of old directories to copy
+# and the new directories to copy to.
+treetops=". ${LIB}"
+
+if $LINKS; then
+ if test $VERBOSE -gt 1
+ then echo 'Making symbolic directory links' ; fi
+ cwd=`${PWDCMD}`
+
+ for sym_link in $search_dirs; do
+ cd ${INPUT}
+ dest=`ls -ld ${sym_link} | sed -n 's/.*-> //p'`
+
+ # In case $dest is relative, get to ${sym_link}'s dir first.
+ #
+ cd ./`echo ${sym_link} | sed 's;/[^/]*$;;'`
+
+ # Check that the target directory exists.
+ # Redirections changed to avoid bug in sh on Ultrix.
+ #
+ (cd $dest) > /dev/null 2>&1
+ if [ $? = 0 ]; then
+ cd $dest
+
+ # full_dest_dir gets the dir that the link actually leads to.
+ #
+ full_dest_dir=`${PWDCMD}`
+
+ # Canonicalize ${INPUT} now to minimize the time an
+ # automounter has to change the result of ${PWDCMD}.
+ #
+ cinput=`cd ${INPUT}; ${PWDCMD}`
+
+ # If a link points to ., make a similar link to .
+ #
+ if [ ${full_dest_dir} = ${cinput} ]; then
+ if test $VERBOSE -gt 2
+ then echo ${sym_link} '->' . ': Making self link' ; fi
+ rm -fr ${LIB}/${sym_link} > /dev/null 2>&1
+ ln -s . ${LIB}/${sym_link} > /dev/null 2>&1
+
+ # If link leads back into ${INPUT},
+ # make a similar link here.
+ #
+ elif expr ${full_dest_dir} : "${cinput}/.*" > /dev/null; then
+ # Y gets the actual target dir name, relative to ${INPUT}.
+ y=`echo ${full_dest_dir} | sed -n "s&${cinput}/&&p"`
+ # DOTS is the relative path from ${LIB}/${sym_link} back to ${LIB}.
+ dots=`echo "${sym_link}" |
+ sed -e 's@^./@@' -e 's@/./@/@g' -e 's@[^/][^/]*@..@g' -e 's@..$@@'`
+ if test $VERBOSE -gt 2
+ then echo ${sym_link} '->' $dots$y ': Making local link' ; fi
+ rm -fr ${LIB}/${sym_link} > /dev/null 2>&1
+ ln -s $dots$y ${LIB}/${sym_link} > /dev/null 2>&1
+
+ else
+ # If the link is to a dir $target outside ${INPUT},
+ # repoint the link at ${INPUT}/root$target
+ # and process $target into ${INPUT}/root$target
+ # treat this directory as if it actually contained the files.
+ #
+ if test $VERBOSE -gt 2
+ then echo ${sym_link} '->' root${full_dest_dir} ': Making rooted link'
+ fi
+ if [ -d $LIB/root${full_dest_dir} ]
+ then true
+ else
+ dirname=root${full_dest_dir}/
+ dirmade=.
+ cd $LIB
+ while [ x$dirname != x ]; do
+ component=`echo $dirname | sed -e 's|/.*$||'`
+ mkdir $component >/dev/null 2>&1
+ cd $component
+ dirmade=$dirmade/$component
+ dirname=`echo $dirname | sed -e 's|[^/]*/||'`
+ done
+ fi
+
+ # Duplicate directory structure created in ${LIB}/${sym_link} in new
+ # root area.
+ #
+ for file2 in $all_dirs; do
+ case $file2 in
+ ${sym_link}/*)
+ dupdir=${LIB}/root${full_dest_dir}/`echo $file2 |
+ sed -n "s|^${sym_link}/||p"`
+ if test $VERBOSE -gt 2
+ then echo "Duplicating ${sym_link}'s ${dupdir}" ; fi
+ if [ -d ${dupdir} ]
+ then true
+ else
+ mkdir ${dupdir}
+ fi
+ ;;
+ *)
+ ;;
+ esac
+ done
+
+ # Get the path from ${LIB} to ${sym_link}, accounting for symlinks.
+ #
+ parent=`echo "${sym_link}" | sed -e 's@/[^/]*$@@'`
+ libabs=`cd ${LIB}; ${PWDCMD}`
+ file2=`cd ${LIB}; cd $parent; ${PWDCMD} | sed -e "s@^${libabs}@@"`
+
+ # DOTS is the relative path from ${LIB}/${sym_link} back to ${LIB}.
+ #
+ dots=`echo "$file2" | sed -e 's@/[^/]*@../@g'`
+ rm -fr ${LIB}/${sym_link} > /dev/null 2>&1
+ ln -s ${dots}root${full_dest_dir} ${LIB}/${sym_link} > /dev/null 2>&1
+ treetops="$treetops ${sym_link} ${LIB}/root${full_dest_dir}"
+ fi
+ fi
+ done
+fi
+
+# # # # # # # # # # # # # # # # # # # # #
+#
+required=
+set x $treetops
+shift
+while [ $# != 0 ]; do
+ # $1 is an old directory to copy, and $2 is the new directory to copy to.
+ #
+ SRCDIR=`cd ${INPUT} ; cd $1 ; ${PWDCMD}`
+ export SRCDIR
+
+ FIND_BASE=$1
+ export FIND_BASE
+ shift
+
+ DESTDIR=`cd $1;${PWDCMD}`
+ export DESTDIR
+ shift
+
+ # The same dir can appear more than once in treetops.
+ # There's no need to scan it more than once.
+ #
+ if [ -f ${DESTDIR}/DONE ]
+ then continue ; fi
+
+ touch ${DESTDIR}/DONE
+ if test $VERBOSE -gt 1
+ then echo Fixing directory ${SRCDIR} into ${DESTDIR} ; fi
+
+ # Check files which are symlinks as well as those which are files.
+ #
+ cd ${INPUT}
+ required="$required `if $LINKS; then
+ find ${FIND_BASE}/. -name '*.h' \( -type f -o -type l \) -print
+ else
+ find ${FIND_BASE}/. -name '*.h' -type f -print
+ fi | \
+ sed -e 's;/\./;/;g' -e 's;//*;/;g' | \
+ ${FIXINCL}`"
+done
+
+## Make sure that any include files referenced using double quotes
+## exist in the fixed directory. This comes last since otherwise
+## we might end up deleting some of these files "because they don't
+## need any change."
+set x `echo $required`
+shift
+while [ $# != 0 ]; do
+ newreq=
+ while [ $# != 0 ]; do
+ # $1 is the directory to copy from,
+ # $2 is the unfixed file,
+ # $3 is the fixed file name.
+ #
+ cd ${INPUT}
+ cd $1
+ if [ -f $2 ] ; then
+ if [ -r $2 ] && [ ! -r $3 ]; then
+ cp $2 $3 >/dev/null 2>&1 || echo "Can't copy $2" >&2
+ chmod +w $3 2>/dev/null
+ chmod a+r $3 2>/dev/null
+ if test $VERBOSE -gt 2
+ then echo Copied $2 ; fi
+ for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' $3 |
+ sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`
+ do
+ dir=`echo $2 | sed -e s'|/[^/]*$||'`
+ dir2=`echo $3 | sed -e s'|/[^/]*$||'`
+ newreq="$newreq $1 $dir/$include $dir2/$include"
+ done
+ fi
+ fi
+ shift; shift; shift
+ done
+ set x $newreq
+ shift
+done
+
+if test $VERBOSE -gt 2
+then echo 'Cleaning up DONE files.' ; fi
+cd $LIB
+# Look for files case-insensitively, for the benefit of
+# DOS/Windows filesystems.
+find . -name '[Dd][Oo][Nn][Ee]' -exec rm -f '{}' ';'
+
+if test $VERBOSE -gt 1
+then echo 'Cleaning up unneeded directories:' ; fi
+cd $LIB
+all_dirs=`find . -type d \! -name '.' -print | sort -r`
+for file in $all_dirs; do
+ if rmdir $LIB/$file > /dev/null
+ then
+ test $VERBOSE -gt 3 && echo " removed $file"
+ fi
+done 2> /dev/null
+
+# On systems which don't support symlinks, `find' may barf
+# if called with "-type l" predicate. So only use that if
+# we know we should look for symlinks.
+if $LINKS; then
+ test $VERBOSE -gt 2 && echo "Removing unused symlinks"
+
+ all_dirs=`find . -type l -print`
+ for file in $all_dirs
+ do
+ if test ! -d $file
+ then
+ rm -f $file
+ test $VERBOSE -gt 3 && echo " removed $file"
+ rmdir `dirname $file` > /dev/null && \
+ test $VERBOSE -gt 3 && \
+ echo " removed `dirname $file`"
+ fi
+ done 2> /dev/null
+fi
+
+if test $VERBOSE -gt 0
+then echo fixincludes is done ; fi
+
+# # # # # # # # # # # # # # # # # # # # #
+#
+# End of for INPUT directories
+#
+done
+#
+# # # # # # # # # # # # # # # # # # # # #
diff --git a/libexec/gcc/i686-linux/4.4.3/install-tools/fixincl b/libexec/gcc/i686-linux/4.4.3/install-tools/fixincl
new file mode 100755
index 0000000..e744e4f
--- /dev/null
+++ b/libexec/gcc/i686-linux/4.4.3/install-tools/fixincl
Binary files differ
diff --git a/libexec/gcc/i686-linux/4.4.3/install-tools/mkheaders b/libexec/gcc/i686-linux/4.4.3/install-tools/mkheaders
new file mode 100755
index 0000000..f9c7b32
--- /dev/null
+++ b/libexec/gcc/i686-linux/4.4.3/install-tools/mkheaders
@@ -0,0 +1,109 @@
+#!/bin/sh
+
+# Copyright (C) 2002, 2007, 2009 Free Software Foundation, Inc.
+
+#This file is part of GCC.
+
+#GCC is free software; you can redistribute it and/or modify it under
+#the terms of the GNU General Public License as published by the Free
+#Software Foundation; either version 3, or (at your option) any later
+#version.
+
+#GCC is distributed in the hope that it will be useful, but WITHOUT
+#ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+#FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+#for more details.
+
+#You should have received a copy of the GNU General Public License
+#along with GCC; see the file COPYING3. If not see
+#<http://www.gnu.org/licenses/>.
+
+# Basic information
+target=i686-pc-linux-gnu
+target_noncanonical=i686-linux
+version=4.4.3
+
+VERBOSE=0
+while [ x$1 = x-v ] ; do
+ shift
+ VERBOSE=`expr $VERBOSE + 1`
+done
+export VERBOSE
+
+if [ x$1 = x--help ] ; then
+ echo "Usage: mkheaders [options] [prefix [isysroot]]"
+ echo "Options:"
+ echo " -v Print more output (may be repeated for even more output)"
+ echo " --help This help"
+ echo " --version Print version information"
+ exit 0
+fi
+
+if [ x$1 = x--version ] ; then
+ echo "mkheaders (GCC) version $version"
+ echo "Copyright 2002, 2007 Free Software Foundation, Inc."
+ echo "This program is free software; you may redistribute it under the"
+ echo "terms of the GNU General Public License. This program has"
+ echo "absolutely no warranty."
+ exit 0
+fi
+
+# Common prefix for installation directories.
+if [ x$1 != x ] ; then
+ prefix=$1
+ shift
+else
+ prefix=/tmp/gcc32/1/i686-linux-glibc2.7-4.4.3
+fi
+
+# Allow for alternate isysroot in which to find headers
+if [ x$1 != x ] ; then
+ isysroot=$1
+ shift
+else
+ isysroot=
+fi
+
+# Directory in which to put host dependent programs and libraries
+exec_prefix=${prefix}
+# Directory in which to put the directories used by the compiler.
+libdir=${exec_prefix}/lib
+libexecdir=${exec_prefix}/libexec
+# Directory in which the compiler finds libraries, etc.
+libsubdir=${libdir}/gcc/${target_noncanonical}/${version}
+# Directory in which the compiler finds executables
+libexecsubdir=${libexecdir}/gcc/${target_noncanonical}/${version}
+
+itoolsdir=${libexecsubdir}/install-tools
+itoolsdatadir=${libsubdir}/install-tools
+incdir=${libsubdir}/include-fixed
+mkinstalldirs="/bin/sh ${itoolsdir}/mkinstalldirs"
+
+cd ${itoolsdir}
+rm -rf ${incdir}/*
+
+for ml in `cat ${itoolsdatadir}/fixinc_list`; do
+ sysroot_headers_suffix=`echo ${ml} | sed -e 's/;.*$//'`
+ multi_dir=`echo ${ml} | sed -e 's/^[^;]*;//'`
+ subincdir=${incdir}${multi_dir}
+ . ${itoolsdatadir}/mkheaders.conf
+ if [ x${STMP_FIXINC} != x ] ; then
+ TARGET_MACHINE="${target}" target_canonical="${target}" \
+ MACRO_LIST="${itoolsdatadir}/macro_list" \
+ /bin/sh ./fixinc.sh ${subincdir} \
+ ${isysroot}${SYSTEM_HEADER_DIR} ${OTHER_FIXINCLUDES_DIRS}
+ rm -f ${subincdir}/syslimits.h
+ if [ -f ${subincdir}/limits.h ]; then
+ mv ${subincdir}/limits.h ${subincdir}/syslimits.h
+ else
+ cp ${itoolsdatadir}/gsyslimits.h ${subincdir}/syslimits.h
+ fi
+ fi
+
+ cp ${itoolsdatadir}/include${multi_dir}/limits.h ${subincdir}
+
+ if [ x${STMP_FIXPROTO} != x ] ; then
+ export FIXPROTO_DEFINES mkinstalldirs
+ /bin/sh fixproto ${subincdir} ${subincdir} ${isysroot}${SYSTEM_HEADER_DIR} || exit 1
+ fi
+done
diff --git a/libexec/gcc/i686-linux/4.4.3/install-tools/mkinstalldirs b/libexec/gcc/i686-linux/4.4.3/install-tools/mkinstalldirs
new file mode 100755
index 0000000..259dbfc
--- /dev/null
+++ b/libexec/gcc/i686-linux/4.4.3/install-tools/mkinstalldirs
@@ -0,0 +1,158 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+
+scriptversion=2005-06-29.22
+
+# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain.
+#
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+errstatus=0
+dirmode=
+
+usage="\
+Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
+
+Create each directory DIR (with mode MODE, if specified), including all
+leading file name components.
+
+Report bugs to <bug-automake@gnu.org>."
+
+# process command line arguments
+while test $# -gt 0 ; do
+ case $1 in
+ -h | --help | --h*) # -h for help
+ echo "$usage"
+ exit $?
+ ;;
+ -m) # -m PERM arg
+ shift
+ test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
+ dirmode=$1
+ shift
+ ;;
+ --version)
+ echo "$0 $scriptversion"
+ exit $?
+ ;;
+ --) # stop option processing
+ shift
+ break
+ ;;
+ -*) # unknown option
+ echo "$usage" 1>&2
+ exit 1
+ ;;
+ *) # first non-opt arg
+ break
+ ;;
+ esac
+done
+
+for file
+do
+ if test -d "$file"; then
+ shift
+ else
+ break
+ fi
+done
+
+case $# in
+ 0) exit 0 ;;
+esac
+
+# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and
+# mkdir -p a/c at the same time, both will detect that a is missing,
+# one will create a, then the other will try to create a and die with
+# a "File exists" error. This is a problem when calling mkinstalldirs
+# from a parallel make. We use --version in the probe to restrict
+# ourselves to GNU mkdir, which is thread-safe.
+case $dirmode in
+ '')
+ if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+ echo "mkdir -p -- $*"
+ exec mkdir -p -- "$@"
+ else
+ # On NextStep and OpenStep, the `mkdir' command does not
+ # recognize any option. It will interpret all options as
+ # directories to create, and then abort because `.' already
+ # exists.
+ test -d ./-p && rmdir ./-p
+ test -d ./--version && rmdir ./--version
+ fi
+ ;;
+ *)
+ if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
+ test ! -d ./--version; then
+ echo "mkdir -m $dirmode -p -- $*"
+ exec mkdir -m "$dirmode" -p -- "$@"
+ else
+ # Clean up after NextStep and OpenStep mkdir.
+ for d in ./-m ./-p ./--version "./$dirmode";
+ do
+ test -d $d && rmdir $d
+ done
+ fi
+ ;;
+esac
+
+for file
+do
+ case $file in
+ /*) pathcomp=/ ;;
+ *) pathcomp= ;;
+ esac
+ oIFS=$IFS
+ IFS=/
+ set fnord $file
+ shift
+ IFS=$oIFS
+
+ for d
+ do
+ test "x$d" = x && continue
+
+ pathcomp=$pathcomp$d
+ case $pathcomp in
+ -*) pathcomp=./$pathcomp ;;
+ esac
+
+ if test ! -d "$pathcomp"; then
+ echo "mkdir $pathcomp"
+
+ mkdir "$pathcomp" || lasterr=$?
+
+ if test ! -d "$pathcomp"; then
+ errstatus=$lasterr
+ else
+ if test ! -z "$dirmode"; then
+ echo "chmod $dirmode $pathcomp"
+ lasterr=
+ chmod "$dirmode" "$pathcomp" || lasterr=$?
+
+ if test ! -z "$lasterr"; then
+ errstatus=$lasterr
+ fi
+ fi
+ fi
+ fi
+
+ pathcomp=$pathcomp/
+ done
+done
+
+exit $errstatus
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/sysroot/usr/include/GL/gl.h b/sysroot/usr/include/GL/gl.h
new file mode 100644
index 0000000..ce5e90e
--- /dev/null
+++ b/sysroot/usr/include/GL/gl.h
@@ -0,0 +1,2252 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.0
+ *
+ * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#ifndef __gl_h_
+#define __gl_h_
+
+#if defined(USE_MGL_NAMESPACE)
+#include "gl_mangle.h"
+#endif
+
+
+/**********************************************************************
+ * Begin system-specific stuff. Do not do any of this when building
+ * for SciTech SNAP, as this is all done before this header file is
+ * included.
+ */
+#if !defined(__SCITECH_SNAP__)
+
+#if defined(__BEOS__)
+#include <stdlib.h> /* to get some BeOS-isms */
+#endif
+
+#if !defined(OPENSTEP) && (defined(NeXT) || defined(NeXT_PDO))
+#define OPENSTEP
+#endif
+
+#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__)
+#define __WIN32__
+#endif
+
+#if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__))
+# if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
+# define GLAPI __declspec(dllexport)
+# elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
+# define GLAPI __declspec(dllimport)
+# else /* for use with static link lib build of Win32 edition only */
+# define GLAPI extern
+# endif /* _STATIC_MESA support */
+# define GLAPIENTRY __stdcall
+#elif defined(__CYGWIN__) && defined(USE_OPENGL32) /* use native windows opengl32 */
+# define GLAPI extern
+# define GLAPIENTRY __stdcall
+#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303
+# define GLAPI __attribute__((visibility("default")))
+# define GLAPIENTRY
+#endif /* WIN32 && !CYGWIN */
+
+#if (defined(__BEOS__) && defined(__POWERPC__)) || defined(__QUICKDRAW__)
+# define PRAGMA_EXPORT_SUPPORTED 1
+#endif
+
+/*
+ * WINDOWS: Include windows.h here to define APIENTRY.
+ * It is also useful when applications include this file by
+ * including only glut.h, since glut.h depends on windows.h.
+ * Applications needing to include windows.h with parms other
+ * than "WIN32_LEAN_AND_MEAN" may include windows.h before
+ * glut.h or gl.h.
+ */
+#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__)
+#define WIN32_LEAN_AND_MEAN 1
+#include <windows.h>
+#endif
+
+#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) \
+ && !defined(OPENSTEP) && !defined(__CYGWIN__) || defined(__MINGW32__)
+#include <GL/mesa_wgl.h>
+#endif
+
+#if defined(macintosh) && PRAGMA_IMPORT_SUPPORTED
+#pragma import on
+#endif
+
+#ifndef GLAPI
+#define GLAPI extern
+#endif
+
+#ifndef GLAPIENTRY
+#define GLAPIENTRY
+#endif
+
+#ifndef APIENTRY
+#define APIENTRY GLAPIENTRY
+#endif
+
+/* "P" suffix to be used for a pointer to a function */
+#ifndef APIENTRYP
+#define APIENTRYP APIENTRY *
+#endif
+
+#ifndef GLAPIENTRYP
+#define GLAPIENTRYP GLAPIENTRY *
+#endif
+
+#ifdef CENTERLINE_CLPP
+#define signed
+#endif
+
+#if defined(PRAGMA_EXPORT_SUPPORTED)
+#pragma export on
+#endif
+
+#endif /* !__SCITECH_SNAP__ */
+/*
+ * End system-specific stuff.
+ **********************************************************************/
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+
+#define GL_VERSION_1_1 1
+#define GL_VERSION_1_2 1
+#define GL_VERSION_1_3 1
+#define GL_ARB_imaging 1
+
+
+/*
+ * Datatypes
+ */
+typedef unsigned int GLenum;
+typedef unsigned char GLboolean;
+typedef unsigned int GLbitfield;
+typedef void GLvoid;
+typedef signed char GLbyte; /* 1-byte signed */
+typedef short GLshort; /* 2-byte signed */
+typedef int GLint; /* 4-byte signed */
+typedef unsigned char GLubyte; /* 1-byte unsigned */
+typedef unsigned short GLushort; /* 2-byte unsigned */
+typedef unsigned int GLuint; /* 4-byte unsigned */
+typedef int GLsizei; /* 4-byte signed */
+typedef float GLfloat; /* single precision float */
+typedef float GLclampf; /* single precision float in [0,1] */
+typedef double GLdouble; /* double precision float */
+typedef double GLclampd; /* double precision float in [0,1] */
+
+
+
+/*
+ * Constants
+ */
+
+/* Boolean values */
+#define GL_FALSE 0x0
+#define GL_TRUE 0x1
+
+/* Data types */
+#define GL_BYTE 0x1400
+#define GL_UNSIGNED_BYTE 0x1401
+#define GL_SHORT 0x1402
+#define GL_UNSIGNED_SHORT 0x1403
+#define GL_INT 0x1404
+#define GL_UNSIGNED_INT 0x1405
+#define GL_FLOAT 0x1406
+#define GL_2_BYTES 0x1407
+#define GL_3_BYTES 0x1408
+#define GL_4_BYTES 0x1409
+#define GL_DOUBLE 0x140A
+
+/* Primitives */
+#define GL_POINTS 0x0000
+#define GL_LINES 0x0001
+#define GL_LINE_LOOP 0x0002
+#define GL_LINE_STRIP 0x0003
+#define GL_TRIANGLES 0x0004
+#define GL_TRIANGLE_STRIP 0x0005
+#define GL_TRIANGLE_FAN 0x0006
+#define GL_QUADS 0x0007
+#define GL_QUAD_STRIP 0x0008
+#define GL_POLYGON 0x0009
+
+/* Vertex Arrays */
+#define GL_VERTEX_ARRAY 0x8074
+#define GL_NORMAL_ARRAY 0x8075
+#define GL_COLOR_ARRAY 0x8076
+#define GL_INDEX_ARRAY 0x8077
+#define GL_TEXTURE_COORD_ARRAY 0x8078
+#define GL_EDGE_FLAG_ARRAY 0x8079
+#define GL_VERTEX_ARRAY_SIZE 0x807A
+#define GL_VERTEX_ARRAY_TYPE 0x807B
+#define GL_VERTEX_ARRAY_STRIDE 0x807C
+#define GL_NORMAL_ARRAY_TYPE 0x807E
+#define GL_NORMAL_ARRAY_STRIDE 0x807F
+#define GL_COLOR_ARRAY_SIZE 0x8081
+#define GL_COLOR_ARRAY_TYPE 0x8082
+#define GL_COLOR_ARRAY_STRIDE 0x8083
+#define GL_INDEX_ARRAY_TYPE 0x8085
+#define GL_INDEX_ARRAY_STRIDE 0x8086
+#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088
+#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089
+#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A
+#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C
+#define GL_VERTEX_ARRAY_POINTER 0x808E
+#define GL_NORMAL_ARRAY_POINTER 0x808F
+#define GL_COLOR_ARRAY_POINTER 0x8090
+#define GL_INDEX_ARRAY_POINTER 0x8091
+#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092
+#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093
+#define GL_V2F 0x2A20
+#define GL_V3F 0x2A21
+#define GL_C4UB_V2F 0x2A22
+#define GL_C4UB_V3F 0x2A23
+#define GL_C3F_V3F 0x2A24
+#define GL_N3F_V3F 0x2A25
+#define GL_C4F_N3F_V3F 0x2A26
+#define GL_T2F_V3F 0x2A27
+#define GL_T4F_V4F 0x2A28
+#define GL_T2F_C4UB_V3F 0x2A29
+#define GL_T2F_C3F_V3F 0x2A2A
+#define GL_T2F_N3F_V3F 0x2A2B
+#define GL_T2F_C4F_N3F_V3F 0x2A2C
+#define GL_T4F_C4F_N3F_V4F 0x2A2D
+
+/* Matrix Mode */
+#define GL_MATRIX_MODE 0x0BA0
+#define GL_MODELVIEW 0x1700
+#define GL_PROJECTION 0x1701
+#define GL_TEXTURE 0x1702
+
+/* Points */
+#define GL_POINT_SMOOTH 0x0B10
+#define GL_POINT_SIZE 0x0B11
+#define GL_POINT_SIZE_GRANULARITY 0x0B13
+#define GL_POINT_SIZE_RANGE 0x0B12
+
+/* Lines */
+#define GL_LINE_SMOOTH 0x0B20
+#define GL_LINE_STIPPLE 0x0B24
+#define GL_LINE_STIPPLE_PATTERN 0x0B25
+#define GL_LINE_STIPPLE_REPEAT 0x0B26
+#define GL_LINE_WIDTH 0x0B21
+#define GL_LINE_WIDTH_GRANULARITY 0x0B23
+#define GL_LINE_WIDTH_RANGE 0x0B22
+
+/* Polygons */
+#define GL_POINT 0x1B00
+#define GL_LINE 0x1B01
+#define GL_FILL 0x1B02
+#define GL_CW 0x0900
+#define GL_CCW 0x0901
+#define GL_FRONT 0x0404
+#define GL_BACK 0x0405
+#define GL_POLYGON_MODE 0x0B40
+#define GL_POLYGON_SMOOTH 0x0B41
+#define GL_POLYGON_STIPPLE 0x0B42
+#define GL_EDGE_FLAG 0x0B43
+#define GL_CULL_FACE 0x0B44
+#define GL_CULL_FACE_MODE 0x0B45
+#define GL_FRONT_FACE 0x0B46
+#define GL_POLYGON_OFFSET_FACTOR 0x8038
+#define GL_POLYGON_OFFSET_UNITS 0x2A00
+#define GL_POLYGON_OFFSET_POINT 0x2A01
+#define GL_POLYGON_OFFSET_LINE 0x2A02
+#define GL_POLYGON_OFFSET_FILL 0x8037
+
+/* Display Lists */
+#define GL_COMPILE 0x1300
+#define GL_COMPILE_AND_EXECUTE 0x1301
+#define GL_LIST_BASE 0x0B32
+#define GL_LIST_INDEX 0x0B33
+#define GL_LIST_MODE 0x0B30
+
+/* Depth buffer */
+#define GL_NEVER 0x0200
+#define GL_LESS 0x0201
+#define GL_EQUAL 0x0202
+#define GL_LEQUAL 0x0203
+#define GL_GREATER 0x0204
+#define GL_NOTEQUAL 0x0205
+#define GL_GEQUAL 0x0206
+#define GL_ALWAYS 0x0207
+#define GL_DEPTH_TEST 0x0B71
+#define GL_DEPTH_BITS 0x0D56
+#define GL_DEPTH_CLEAR_VALUE 0x0B73
+#define GL_DEPTH_FUNC 0x0B74
+#define GL_DEPTH_RANGE 0x0B70
+#define GL_DEPTH_WRITEMASK 0x0B72
+#define GL_DEPTH_COMPONENT 0x1902
+
+/* Lighting */
+#define GL_LIGHTING 0x0B50
+#define GL_LIGHT0 0x4000
+#define GL_LIGHT1 0x4001
+#define GL_LIGHT2 0x4002
+#define GL_LIGHT3 0x4003
+#define GL_LIGHT4 0x4004
+#define GL_LIGHT5 0x4005
+#define GL_LIGHT6 0x4006
+#define GL_LIGHT7 0x4007
+#define GL_SPOT_EXPONENT 0x1205
+#define GL_SPOT_CUTOFF 0x1206
+#define GL_CONSTANT_ATTENUATION 0x1207
+#define GL_LINEAR_ATTENUATION 0x1208
+#define GL_QUADRATIC_ATTENUATION 0x1209
+#define GL_AMBIENT 0x1200
+#define GL_DIFFUSE 0x1201
+#define GL_SPECULAR 0x1202
+#define GL_SHININESS 0x1601
+#define GL_EMISSION 0x1600
+#define GL_POSITION 0x1203
+#define GL_SPOT_DIRECTION 0x1204
+#define GL_AMBIENT_AND_DIFFUSE 0x1602
+#define GL_COLOR_INDEXES 0x1603
+#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52
+#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51
+#define GL_LIGHT_MODEL_AMBIENT 0x0B53
+#define GL_FRONT_AND_BACK 0x0408
+#define GL_SHADE_MODEL 0x0B54
+#define GL_FLAT 0x1D00
+#define GL_SMOOTH 0x1D01
+#define GL_COLOR_MATERIAL 0x0B57
+#define GL_COLOR_MATERIAL_FACE 0x0B55
+#define GL_COLOR_MATERIAL_PARAMETER 0x0B56
+#define GL_NORMALIZE 0x0BA1
+
+/* User clipping planes */
+#define GL_CLIP_PLANE0 0x3000
+#define GL_CLIP_PLANE1 0x3001
+#define GL_CLIP_PLANE2 0x3002
+#define GL_CLIP_PLANE3 0x3003
+#define GL_CLIP_PLANE4 0x3004
+#define GL_CLIP_PLANE5 0x3005
+
+/* Accumulation buffer */
+#define GL_ACCUM_RED_BITS 0x0D58
+#define GL_ACCUM_GREEN_BITS 0x0D59
+#define GL_ACCUM_BLUE_BITS 0x0D5A
+#define GL_ACCUM_ALPHA_BITS 0x0D5B
+#define GL_ACCUM_CLEAR_VALUE 0x0B80
+#define GL_ACCUM 0x0100
+#define GL_ADD 0x0104
+#define GL_LOAD 0x0101
+#define GL_MULT 0x0103
+#define GL_RETURN 0x0102
+
+/* Alpha testing */
+#define GL_ALPHA_TEST 0x0BC0
+#define GL_ALPHA_TEST_REF 0x0BC2
+#define GL_ALPHA_TEST_FUNC 0x0BC1
+
+/* Blending */
+#define GL_BLEND 0x0BE2
+#define GL_BLEND_SRC 0x0BE1
+#define GL_BLEND_DST 0x0BE0
+#define GL_ZERO 0x0
+#define GL_ONE 0x1
+#define GL_SRC_COLOR 0x0300
+#define GL_ONE_MINUS_SRC_COLOR 0x0301
+#define GL_SRC_ALPHA 0x0302
+#define GL_ONE_MINUS_SRC_ALPHA 0x0303
+#define GL_DST_ALPHA 0x0304
+#define GL_ONE_MINUS_DST_ALPHA 0x0305
+#define GL_DST_COLOR 0x0306
+#define GL_ONE_MINUS_DST_COLOR 0x0307
+#define GL_SRC_ALPHA_SATURATE 0x0308
+
+/* Render Mode */
+#define GL_FEEDBACK 0x1C01
+#define GL_RENDER 0x1C00
+#define GL_SELECT 0x1C02
+
+/* Feedback */
+#define GL_2D 0x0600
+#define GL_3D 0x0601
+#define GL_3D_COLOR 0x0602
+#define GL_3D_COLOR_TEXTURE 0x0603
+#define GL_4D_COLOR_TEXTURE 0x0604
+#define GL_POINT_TOKEN 0x0701
+#define GL_LINE_TOKEN 0x0702
+#define GL_LINE_RESET_TOKEN 0x0707
+#define GL_POLYGON_TOKEN 0x0703
+#define GL_BITMAP_TOKEN 0x0704
+#define GL_DRAW_PIXEL_TOKEN 0x0705
+#define GL_COPY_PIXEL_TOKEN 0x0706
+#define GL_PASS_THROUGH_TOKEN 0x0700
+#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0
+#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1
+#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2
+
+/* Selection */
+#define GL_SELECTION_BUFFER_POINTER 0x0DF3
+#define GL_SELECTION_BUFFER_SIZE 0x0DF4
+
+/* Fog */
+#define GL_FOG 0x0B60
+#define GL_FOG_MODE 0x0B65
+#define GL_FOG_DENSITY 0x0B62
+#define GL_FOG_COLOR 0x0B66
+#define GL_FOG_INDEX 0x0B61
+#define GL_FOG_START 0x0B63
+#define GL_FOG_END 0x0B64
+#define GL_LINEAR 0x2601
+#define GL_EXP 0x0800
+#define GL_EXP2 0x0801
+
+/* Logic Ops */
+#define GL_LOGIC_OP 0x0BF1
+#define GL_INDEX_LOGIC_OP 0x0BF1
+#define GL_COLOR_LOGIC_OP 0x0BF2
+#define GL_LOGIC_OP_MODE 0x0BF0
+#define GL_CLEAR 0x1500
+#define GL_SET 0x150F
+#define GL_COPY 0x1503
+#define GL_COPY_INVERTED 0x150C
+#define GL_NOOP 0x1505
+#define GL_INVERT 0x150A
+#define GL_AND 0x1501
+#define GL_NAND 0x150E
+#define GL_OR 0x1507
+#define GL_NOR 0x1508
+#define GL_XOR 0x1506
+#define GL_EQUIV 0x1509
+#define GL_AND_REVERSE 0x1502
+#define GL_AND_INVERTED 0x1504
+#define GL_OR_REVERSE 0x150B
+#define GL_OR_INVERTED 0x150D
+
+/* Stencil */
+#define GL_STENCIL_BITS 0x0D57
+#define GL_STENCIL_TEST 0x0B90
+#define GL_STENCIL_CLEAR_VALUE 0x0B91
+#define GL_STENCIL_FUNC 0x0B92
+#define GL_STENCIL_VALUE_MASK 0x0B93
+#define GL_STENCIL_FAIL 0x0B94
+#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
+#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
+#define GL_STENCIL_REF 0x0B97
+#define GL_STENCIL_WRITEMASK 0x0B98
+#define GL_STENCIL_INDEX 0x1901
+#define GL_KEEP 0x1E00
+#define GL_REPLACE 0x1E01
+#define GL_INCR 0x1E02
+#define GL_DECR 0x1E03
+
+/* Buffers, Pixel Drawing/Reading */
+#define GL_NONE 0x0
+#define GL_LEFT 0x0406
+#define GL_RIGHT 0x0407
+/*GL_FRONT 0x0404 */
+/*GL_BACK 0x0405 */
+/*GL_FRONT_AND_BACK 0x0408 */
+#define GL_FRONT_LEFT 0x0400
+#define GL_FRONT_RIGHT 0x0401
+#define GL_BACK_LEFT 0x0402
+#define GL_BACK_RIGHT 0x0403
+#define GL_AUX0 0x0409
+#define GL_AUX1 0x040A
+#define GL_AUX2 0x040B
+#define GL_AUX3 0x040C
+#define GL_COLOR_INDEX 0x1900
+#define GL_RED 0x1903
+#define GL_GREEN 0x1904
+#define GL_BLUE 0x1905
+#define GL_ALPHA 0x1906
+#define GL_LUMINANCE 0x1909
+#define GL_LUMINANCE_ALPHA 0x190A
+#define GL_ALPHA_BITS 0x0D55
+#define GL_RED_BITS 0x0D52
+#define GL_GREEN_BITS 0x0D53
+#define GL_BLUE_BITS 0x0D54
+#define GL_INDEX_BITS 0x0D51
+#define GL_SUBPIXEL_BITS 0x0D50
+#define GL_AUX_BUFFERS 0x0C00
+#define GL_READ_BUFFER 0x0C02
+#define GL_DRAW_BUFFER 0x0C01
+#define GL_DOUBLEBUFFER 0x0C32
+#define GL_STEREO 0x0C33
+#define GL_BITMAP 0x1A00
+#define GL_COLOR 0x1800
+#define GL_DEPTH 0x1801
+#define GL_STENCIL 0x1802
+#define GL_DITHER 0x0BD0
+#define GL_RGB 0x1907
+#define GL_RGBA 0x1908
+
+/* Implementation limits */
+#define GL_MAX_LIST_NESTING 0x0B31
+#define GL_MAX_EVAL_ORDER 0x0D30
+#define GL_MAX_LIGHTS 0x0D31
+#define GL_MAX_CLIP_PLANES 0x0D32
+#define GL_MAX_TEXTURE_SIZE 0x0D33
+#define GL_MAX_PIXEL_MAP_TABLE 0x0D34
+#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35
+#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36
+#define GL_MAX_NAME_STACK_DEPTH 0x0D37
+#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38
+#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39
+#define GL_MAX_VIEWPORT_DIMS 0x0D3A
+#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B
+
+/* Gets */
+#define GL_ATTRIB_STACK_DEPTH 0x0BB0
+#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1
+#define GL_COLOR_CLEAR_VALUE 0x0C22
+#define GL_COLOR_WRITEMASK 0x0C23
+#define GL_CURRENT_INDEX 0x0B01
+#define GL_CURRENT_COLOR 0x0B00
+#define GL_CURRENT_NORMAL 0x0B02
+#define GL_CURRENT_RASTER_COLOR 0x0B04
+#define GL_CURRENT_RASTER_DISTANCE 0x0B09
+#define GL_CURRENT_RASTER_INDEX 0x0B05
+#define GL_CURRENT_RASTER_POSITION 0x0B07
+#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06
+#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08
+#define GL_CURRENT_TEXTURE_COORDS 0x0B03
+#define GL_INDEX_CLEAR_VALUE 0x0C20
+#define GL_INDEX_MODE 0x0C30
+#define GL_INDEX_WRITEMASK 0x0C21
+#define GL_MODELVIEW_MATRIX 0x0BA6
+#define GL_MODELVIEW_STACK_DEPTH 0x0BA3
+#define GL_NAME_STACK_DEPTH 0x0D70
+#define GL_PROJECTION_MATRIX 0x0BA7
+#define GL_PROJECTION_STACK_DEPTH 0x0BA4
+#define GL_RENDER_MODE 0x0C40
+#define GL_RGBA_MODE 0x0C31
+#define GL_TEXTURE_MATRIX 0x0BA8
+#define GL_TEXTURE_STACK_DEPTH 0x0BA5
+#define GL_VIEWPORT 0x0BA2
+
+/* Evaluators */
+#define GL_AUTO_NORMAL 0x0D80
+#define GL_MAP1_COLOR_4 0x0D90
+#define GL_MAP1_INDEX 0x0D91
+#define GL_MAP1_NORMAL 0x0D92
+#define GL_MAP1_TEXTURE_COORD_1 0x0D93
+#define GL_MAP1_TEXTURE_COORD_2 0x0D94
+#define GL_MAP1_TEXTURE_COORD_3 0x0D95
+#define GL_MAP1_TEXTURE_COORD_4 0x0D96
+#define GL_MAP1_VERTEX_3 0x0D97
+#define GL_MAP1_VERTEX_4 0x0D98
+#define GL_MAP2_COLOR_4 0x0DB0
+#define GL_MAP2_INDEX 0x0DB1
+#define GL_MAP2_NORMAL 0x0DB2
+#define GL_MAP2_TEXTURE_COORD_1 0x0DB3
+#define GL_MAP2_TEXTURE_COORD_2 0x0DB4
+#define GL_MAP2_TEXTURE_COORD_3 0x0DB5
+#define GL_MAP2_TEXTURE_COORD_4 0x0DB6
+#define GL_MAP2_VERTEX_3 0x0DB7
+#define GL_MAP2_VERTEX_4 0x0DB8
+#define GL_MAP1_GRID_DOMAIN 0x0DD0
+#define GL_MAP1_GRID_SEGMENTS 0x0DD1
+#define GL_MAP2_GRID_DOMAIN 0x0DD2
+#define GL_MAP2_GRID_SEGMENTS 0x0DD3
+#define GL_COEFF 0x0A00
+#define GL_ORDER 0x0A01
+#define GL_DOMAIN 0x0A02
+
+/* Hints */
+#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50
+#define GL_POINT_SMOOTH_HINT 0x0C51
+#define GL_LINE_SMOOTH_HINT 0x0C52
+#define GL_POLYGON_SMOOTH_HINT 0x0C53
+#define GL_FOG_HINT 0x0C54
+#define GL_DONT_CARE 0x1100
+#define GL_FASTEST 0x1101
+#define GL_NICEST 0x1102
+
+/* Scissor box */
+#define GL_SCISSOR_BOX 0x0C10
+#define GL_SCISSOR_TEST 0x0C11
+
+/* Pixel Mode / Transfer */
+#define GL_MAP_COLOR 0x0D10
+#define GL_MAP_STENCIL 0x0D11
+#define GL_INDEX_SHIFT 0x0D12
+#define GL_INDEX_OFFSET 0x0D13
+#define GL_RED_SCALE 0x0D14
+#define GL_RED_BIAS 0x0D15
+#define GL_GREEN_SCALE 0x0D18
+#define GL_GREEN_BIAS 0x0D19
+#define GL_BLUE_SCALE 0x0D1A
+#define GL_BLUE_BIAS 0x0D1B
+#define GL_ALPHA_SCALE 0x0D1C
+#define GL_ALPHA_BIAS 0x0D1D
+#define GL_DEPTH_SCALE 0x0D1E
+#define GL_DEPTH_BIAS 0x0D1F
+#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1
+#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0
+#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2
+#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3
+#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4
+#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5
+#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6
+#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7
+#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8
+#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9
+#define GL_PIXEL_MAP_S_TO_S 0x0C71
+#define GL_PIXEL_MAP_I_TO_I 0x0C70
+#define GL_PIXEL_MAP_I_TO_R 0x0C72
+#define GL_PIXEL_MAP_I_TO_G 0x0C73
+#define GL_PIXEL_MAP_I_TO_B 0x0C74
+#define GL_PIXEL_MAP_I_TO_A 0x0C75
+#define GL_PIXEL_MAP_R_TO_R 0x0C76
+#define GL_PIXEL_MAP_G_TO_G 0x0C77
+#define GL_PIXEL_MAP_B_TO_B 0x0C78
+#define GL_PIXEL_MAP_A_TO_A 0x0C79
+#define GL_PACK_ALIGNMENT 0x0D05
+#define GL_PACK_LSB_FIRST 0x0D01
+#define GL_PACK_ROW_LENGTH 0x0D02
+#define GL_PACK_SKIP_PIXELS 0x0D04
+#define GL_PACK_SKIP_ROWS 0x0D03
+#define GL_PACK_SWAP_BYTES 0x0D00
+#define GL_UNPACK_ALIGNMENT 0x0CF5
+#define GL_UNPACK_LSB_FIRST 0x0CF1
+#define GL_UNPACK_ROW_LENGTH 0x0CF2
+#define GL_UNPACK_SKIP_PIXELS 0x0CF4
+#define GL_UNPACK_SKIP_ROWS 0x0CF3
+#define GL_UNPACK_SWAP_BYTES 0x0CF0
+#define GL_ZOOM_X 0x0D16
+#define GL_ZOOM_Y 0x0D17
+
+/* Texture mapping */
+#define GL_TEXTURE_ENV 0x2300
+#define GL_TEXTURE_ENV_MODE 0x2200
+#define GL_TEXTURE_1D 0x0DE0
+#define GL_TEXTURE_2D 0x0DE1
+#define GL_TEXTURE_WRAP_S 0x2802
+#define GL_TEXTURE_WRAP_T 0x2803
+#define GL_TEXTURE_MAG_FILTER 0x2800
+#define GL_TEXTURE_MIN_FILTER 0x2801
+#define GL_TEXTURE_ENV_COLOR 0x2201
+#define GL_TEXTURE_GEN_S 0x0C60
+#define GL_TEXTURE_GEN_T 0x0C61
+#define GL_TEXTURE_GEN_MODE 0x2500
+#define GL_TEXTURE_BORDER_COLOR 0x1004
+#define GL_TEXTURE_WIDTH 0x1000
+#define GL_TEXTURE_HEIGHT 0x1001
+#define GL_TEXTURE_BORDER 0x1005
+#define GL_TEXTURE_COMPONENTS 0x1003
+#define GL_TEXTURE_RED_SIZE 0x805C
+#define GL_TEXTURE_GREEN_SIZE 0x805D
+#define GL_TEXTURE_BLUE_SIZE 0x805E
+#define GL_TEXTURE_ALPHA_SIZE 0x805F
+#define GL_TEXTURE_LUMINANCE_SIZE 0x8060
+#define GL_TEXTURE_INTENSITY_SIZE 0x8061
+#define GL_NEAREST_MIPMAP_NEAREST 0x2700
+#define GL_NEAREST_MIPMAP_LINEAR 0x2702
+#define GL_LINEAR_MIPMAP_NEAREST 0x2701
+#define GL_LINEAR_MIPMAP_LINEAR 0x2703
+#define GL_OBJECT_LINEAR 0x2401
+#define GL_OBJECT_PLANE 0x2501
+#define GL_EYE_LINEAR 0x2400
+#define GL_EYE_PLANE 0x2502
+#define GL_SPHERE_MAP 0x2402
+#define GL_DECAL 0x2101
+#define GL_MODULATE 0x2100
+#define GL_NEAREST 0x2600
+#define GL_REPEAT 0x2901
+#define GL_CLAMP 0x2900
+#define GL_S 0x2000
+#define GL_T 0x2001
+#define GL_R 0x2002
+#define GL_Q 0x2003
+#define GL_TEXTURE_GEN_R 0x0C62
+#define GL_TEXTURE_GEN_Q 0x0C63
+
+/* Utility */
+#define GL_VENDOR 0x1F00
+#define GL_RENDERER 0x1F01
+#define GL_VERSION 0x1F02
+#define GL_EXTENSIONS 0x1F03
+
+/* Errors */
+#define GL_NO_ERROR 0x0
+#define GL_INVALID_ENUM 0x0500
+#define GL_INVALID_VALUE 0x0501
+#define GL_INVALID_OPERATION 0x0502
+#define GL_STACK_OVERFLOW 0x0503
+#define GL_STACK_UNDERFLOW 0x0504
+#define GL_OUT_OF_MEMORY 0x0505
+
+/* glPush/PopAttrib bits */
+#define GL_CURRENT_BIT 0x00000001
+#define GL_POINT_BIT 0x00000002
+#define GL_LINE_BIT 0x00000004
+#define GL_POLYGON_BIT 0x00000008
+#define GL_POLYGON_STIPPLE_BIT 0x00000010
+#define GL_PIXEL_MODE_BIT 0x00000020
+#define GL_LIGHTING_BIT 0x00000040
+#define GL_FOG_BIT 0x00000080
+#define GL_DEPTH_BUFFER_BIT 0x00000100
+#define GL_ACCUM_BUFFER_BIT 0x00000200
+#define GL_STENCIL_BUFFER_BIT 0x00000400
+#define GL_VIEWPORT_BIT 0x00000800
+#define GL_TRANSFORM_BIT 0x00001000
+#define GL_ENABLE_BIT 0x00002000
+#define GL_COLOR_BUFFER_BIT 0x00004000
+#define GL_HINT_BIT 0x00008000
+#define GL_EVAL_BIT 0x00010000
+#define GL_LIST_BIT 0x00020000
+#define GL_TEXTURE_BIT 0x00040000
+#define GL_SCISSOR_BIT 0x00080000
+#define GL_ALL_ATTRIB_BITS 0x000FFFFF
+
+
+/* OpenGL 1.1 */
+#define GL_PROXY_TEXTURE_1D 0x8063
+#define GL_PROXY_TEXTURE_2D 0x8064
+#define GL_TEXTURE_PRIORITY 0x8066
+#define GL_TEXTURE_RESIDENT 0x8067
+#define GL_TEXTURE_BINDING_1D 0x8068
+#define GL_TEXTURE_BINDING_2D 0x8069
+#define GL_TEXTURE_INTERNAL_FORMAT 0x1003
+#define GL_ALPHA4 0x803B
+#define GL_ALPHA8 0x803C
+#define GL_ALPHA12 0x803D
+#define GL_ALPHA16 0x803E
+#define GL_LUMINANCE4 0x803F
+#define GL_LUMINANCE8 0x8040
+#define GL_LUMINANCE12 0x8041
+#define GL_LUMINANCE16 0x8042
+#define GL_LUMINANCE4_ALPHA4 0x8043
+#define GL_LUMINANCE6_ALPHA2 0x8044
+#define GL_LUMINANCE8_ALPHA8 0x8045
+#define GL_LUMINANCE12_ALPHA4 0x8046
+#define GL_LUMINANCE12_ALPHA12 0x8047
+#define GL_LUMINANCE16_ALPHA16 0x8048
+#define GL_INTENSITY 0x8049
+#define GL_INTENSITY4 0x804A
+#define GL_INTENSITY8 0x804B
+#define GL_INTENSITY12 0x804C
+#define GL_INTENSITY16 0x804D
+#define GL_R3_G3_B2 0x2A10
+#define GL_RGB4 0x804F
+#define GL_RGB5 0x8050
+#define GL_RGB8 0x8051
+#define GL_RGB10 0x8052
+#define GL_RGB12 0x8053
+#define GL_RGB16 0x8054
+#define GL_RGBA2 0x8055
+#define GL_RGBA4 0x8056
+#define GL_RGB5_A1 0x8057
+#define GL_RGBA8 0x8058
+#define GL_RGB10_A2 0x8059
+#define GL_RGBA12 0x805A
+#define GL_RGBA16 0x805B
+#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001
+#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002
+#define GL_ALL_CLIENT_ATTRIB_BITS 0xFFFFFFFF
+#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF
+
+
+
+/*
+ * Miscellaneous
+ */
+
+GLAPI void GLAPIENTRY glClearIndex( GLfloat c );
+
+GLAPI void GLAPIENTRY glClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha );
+
+GLAPI void GLAPIENTRY glClear( GLbitfield mask );
+
+GLAPI void GLAPIENTRY glIndexMask( GLuint mask );
+
+GLAPI void GLAPIENTRY glColorMask( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha );
+
+GLAPI void GLAPIENTRY glAlphaFunc( GLenum func, GLclampf ref );
+
+GLAPI void GLAPIENTRY glBlendFunc( GLenum sfactor, GLenum dfactor );
+
+GLAPI void GLAPIENTRY glLogicOp( GLenum opcode );
+
+GLAPI void GLAPIENTRY glCullFace( GLenum mode );
+
+GLAPI void GLAPIENTRY glFrontFace( GLenum mode );
+
+GLAPI void GLAPIENTRY glPointSize( GLfloat size );
+
+GLAPI void GLAPIENTRY glLineWidth( GLfloat width );
+
+GLAPI void GLAPIENTRY glLineStipple( GLint factor, GLushort pattern );
+
+GLAPI void GLAPIENTRY glPolygonMode( GLenum face, GLenum mode );
+
+GLAPI void GLAPIENTRY glPolygonOffset( GLfloat factor, GLfloat units );
+
+GLAPI void GLAPIENTRY glPolygonStipple( const GLubyte *mask );
+
+GLAPI void GLAPIENTRY glGetPolygonStipple( GLubyte *mask );
+
+GLAPI void GLAPIENTRY glEdgeFlag( GLboolean flag );
+
+GLAPI void GLAPIENTRY glEdgeFlagv( const GLboolean *flag );
+
+GLAPI void GLAPIENTRY glScissor( GLint x, GLint y, GLsizei width, GLsizei height);
+
+GLAPI void GLAPIENTRY glClipPlane( GLenum plane, const GLdouble *equation );
+
+GLAPI void GLAPIENTRY glGetClipPlane( GLenum plane, GLdouble *equation );
+
+GLAPI void GLAPIENTRY glDrawBuffer( GLenum mode );
+
+GLAPI void GLAPIENTRY glReadBuffer( GLenum mode );
+
+GLAPI void GLAPIENTRY glEnable( GLenum cap );
+
+GLAPI void GLAPIENTRY glDisable( GLenum cap );
+
+GLAPI GLboolean GLAPIENTRY glIsEnabled( GLenum cap );
+
+
+GLAPI void GLAPIENTRY glEnableClientState( GLenum cap ); /* 1.1 */
+
+GLAPI void GLAPIENTRY glDisableClientState( GLenum cap ); /* 1.1 */
+
+
+GLAPI void GLAPIENTRY glGetBooleanv( GLenum pname, GLboolean *params );
+
+GLAPI void GLAPIENTRY glGetDoublev( GLenum pname, GLdouble *params );
+
+GLAPI void GLAPIENTRY glGetFloatv( GLenum pname, GLfloat *params );
+
+GLAPI void GLAPIENTRY glGetIntegerv( GLenum pname, GLint *params );
+
+
+GLAPI void GLAPIENTRY glPushAttrib( GLbitfield mask );
+
+GLAPI void GLAPIENTRY glPopAttrib( void );
+
+
+GLAPI void GLAPIENTRY glPushClientAttrib( GLbitfield mask ); /* 1.1 */
+
+GLAPI void GLAPIENTRY glPopClientAttrib( void ); /* 1.1 */
+
+
+GLAPI GLint GLAPIENTRY glRenderMode( GLenum mode );
+
+GLAPI GLenum GLAPIENTRY glGetError( void );
+
+GLAPI const GLubyte * GLAPIENTRY glGetString( GLenum name );
+
+GLAPI void GLAPIENTRY glFinish( void );
+
+GLAPI void GLAPIENTRY glFlush( void );
+
+GLAPI void GLAPIENTRY glHint( GLenum target, GLenum mode );
+
+
+/*
+ * Depth Buffer
+ */
+
+GLAPI void GLAPIENTRY glClearDepth( GLclampd depth );
+
+GLAPI void GLAPIENTRY glDepthFunc( GLenum func );
+
+GLAPI void GLAPIENTRY glDepthMask( GLboolean flag );
+
+GLAPI void GLAPIENTRY glDepthRange( GLclampd near_val, GLclampd far_val );
+
+
+/*
+ * Accumulation Buffer
+ */
+
+GLAPI void GLAPIENTRY glClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha );
+
+GLAPI void GLAPIENTRY glAccum( GLenum op, GLfloat value );
+
+
+/*
+ * Transformation
+ */
+
+GLAPI void GLAPIENTRY glMatrixMode( GLenum mode );
+
+GLAPI void GLAPIENTRY glOrtho( GLdouble left, GLdouble right,
+ GLdouble bottom, GLdouble top,
+ GLdouble near_val, GLdouble far_val );
+
+GLAPI void GLAPIENTRY glFrustum( GLdouble left, GLdouble right,
+ GLdouble bottom, GLdouble top,
+ GLdouble near_val, GLdouble far_val );
+
+GLAPI void GLAPIENTRY glViewport( GLint x, GLint y,
+ GLsizei width, GLsizei height );
+
+GLAPI void GLAPIENTRY glPushMatrix( void );
+
+GLAPI void GLAPIENTRY glPopMatrix( void );
+
+GLAPI void GLAPIENTRY glLoadIdentity( void );
+
+GLAPI void GLAPIENTRY glLoadMatrixd( const GLdouble *m );
+GLAPI void GLAPIENTRY glLoadMatrixf( const GLfloat *m );
+
+GLAPI void GLAPIENTRY glMultMatrixd( const GLdouble *m );
+GLAPI void GLAPIENTRY glMultMatrixf( const GLfloat *m );
+
+GLAPI void GLAPIENTRY glRotated( GLdouble angle,
+ GLdouble x, GLdouble y, GLdouble z );
+GLAPI void GLAPIENTRY glRotatef( GLfloat angle,
+ GLfloat x, GLfloat y, GLfloat z );
+
+GLAPI void GLAPIENTRY glScaled( GLdouble x, GLdouble y, GLdouble z );
+GLAPI void GLAPIENTRY glScalef( GLfloat x, GLfloat y, GLfloat z );
+
+GLAPI void GLAPIENTRY glTranslated( GLdouble x, GLdouble y, GLdouble z );
+GLAPI void GLAPIENTRY glTranslatef( GLfloat x, GLfloat y, GLfloat z );
+
+
+/*
+ * Display Lists
+ */
+
+GLAPI GLboolean GLAPIENTRY glIsList( GLuint list );
+
+GLAPI void GLAPIENTRY glDeleteLists( GLuint list, GLsizei range );
+
+GLAPI GLuint GLAPIENTRY glGenLists( GLsizei range );
+
+GLAPI void GLAPIENTRY glNewList( GLuint list, GLenum mode );
+
+GLAPI void GLAPIENTRY glEndList( void );
+
+GLAPI void GLAPIENTRY glCallList( GLuint list );
+
+GLAPI void GLAPIENTRY glCallLists( GLsizei n, GLenum type,
+ const GLvoid *lists );
+
+GLAPI void GLAPIENTRY glListBase( GLuint base );
+
+
+/*
+ * Drawing Functions
+ */
+
+GLAPI void GLAPIENTRY glBegin( GLenum mode );
+
+GLAPI void GLAPIENTRY glEnd( void );
+
+
+GLAPI void GLAPIENTRY glVertex2d( GLdouble x, GLdouble y );
+GLAPI void GLAPIENTRY glVertex2f( GLfloat x, GLfloat y );
+GLAPI void GLAPIENTRY glVertex2i( GLint x, GLint y );
+GLAPI void GLAPIENTRY glVertex2s( GLshort x, GLshort y );
+
+GLAPI void GLAPIENTRY glVertex3d( GLdouble x, GLdouble y, GLdouble z );
+GLAPI void GLAPIENTRY glVertex3f( GLfloat x, GLfloat y, GLfloat z );
+GLAPI void GLAPIENTRY glVertex3i( GLint x, GLint y, GLint z );
+GLAPI void GLAPIENTRY glVertex3s( GLshort x, GLshort y, GLshort z );
+
+GLAPI void GLAPIENTRY glVertex4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w );
+GLAPI void GLAPIENTRY glVertex4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w );
+GLAPI void GLAPIENTRY glVertex4i( GLint x, GLint y, GLint z, GLint w );
+GLAPI void GLAPIENTRY glVertex4s( GLshort x, GLshort y, GLshort z, GLshort w );
+
+GLAPI void GLAPIENTRY glVertex2dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glVertex2fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glVertex2iv( const GLint *v );
+GLAPI void GLAPIENTRY glVertex2sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glVertex3dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glVertex3fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glVertex3iv( const GLint *v );
+GLAPI void GLAPIENTRY glVertex3sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glVertex4dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glVertex4fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glVertex4iv( const GLint *v );
+GLAPI void GLAPIENTRY glVertex4sv( const GLshort *v );
+
+
+GLAPI void GLAPIENTRY glNormal3b( GLbyte nx, GLbyte ny, GLbyte nz );
+GLAPI void GLAPIENTRY glNormal3d( GLdouble nx, GLdouble ny, GLdouble nz );
+GLAPI void GLAPIENTRY glNormal3f( GLfloat nx, GLfloat ny, GLfloat nz );
+GLAPI void GLAPIENTRY glNormal3i( GLint nx, GLint ny, GLint nz );
+GLAPI void GLAPIENTRY glNormal3s( GLshort nx, GLshort ny, GLshort nz );
+
+GLAPI void GLAPIENTRY glNormal3bv( const GLbyte *v );
+GLAPI void GLAPIENTRY glNormal3dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glNormal3fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glNormal3iv( const GLint *v );
+GLAPI void GLAPIENTRY glNormal3sv( const GLshort *v );
+
+
+GLAPI void GLAPIENTRY glIndexd( GLdouble c );
+GLAPI void GLAPIENTRY glIndexf( GLfloat c );
+GLAPI void GLAPIENTRY glIndexi( GLint c );
+GLAPI void GLAPIENTRY glIndexs( GLshort c );
+GLAPI void GLAPIENTRY glIndexub( GLubyte c ); /* 1.1 */
+
+GLAPI void GLAPIENTRY glIndexdv( const GLdouble *c );
+GLAPI void GLAPIENTRY glIndexfv( const GLfloat *c );
+GLAPI void GLAPIENTRY glIndexiv( const GLint *c );
+GLAPI void GLAPIENTRY glIndexsv( const GLshort *c );
+GLAPI void GLAPIENTRY glIndexubv( const GLubyte *c ); /* 1.1 */
+
+GLAPI void GLAPIENTRY glColor3b( GLbyte red, GLbyte green, GLbyte blue );
+GLAPI void GLAPIENTRY glColor3d( GLdouble red, GLdouble green, GLdouble blue );
+GLAPI void GLAPIENTRY glColor3f( GLfloat red, GLfloat green, GLfloat blue );
+GLAPI void GLAPIENTRY glColor3i( GLint red, GLint green, GLint blue );
+GLAPI void GLAPIENTRY glColor3s( GLshort red, GLshort green, GLshort blue );
+GLAPI void GLAPIENTRY glColor3ub( GLubyte red, GLubyte green, GLubyte blue );
+GLAPI void GLAPIENTRY glColor3ui( GLuint red, GLuint green, GLuint blue );
+GLAPI void GLAPIENTRY glColor3us( GLushort red, GLushort green, GLushort blue );
+
+GLAPI void GLAPIENTRY glColor4b( GLbyte red, GLbyte green,
+ GLbyte blue, GLbyte alpha );
+GLAPI void GLAPIENTRY glColor4d( GLdouble red, GLdouble green,
+ GLdouble blue, GLdouble alpha );
+GLAPI void GLAPIENTRY glColor4f( GLfloat red, GLfloat green,
+ GLfloat blue, GLfloat alpha );
+GLAPI void GLAPIENTRY glColor4i( GLint red, GLint green,
+ GLint blue, GLint alpha );
+GLAPI void GLAPIENTRY glColor4s( GLshort red, GLshort green,
+ GLshort blue, GLshort alpha );
+GLAPI void GLAPIENTRY glColor4ub( GLubyte red, GLubyte green,
+ GLubyte blue, GLubyte alpha );
+GLAPI void GLAPIENTRY glColor4ui( GLuint red, GLuint green,
+ GLuint blue, GLuint alpha );
+GLAPI void GLAPIENTRY glColor4us( GLushort red, GLushort green,
+ GLushort blue, GLushort alpha );
+
+
+GLAPI void GLAPIENTRY glColor3bv( const GLbyte *v );
+GLAPI void GLAPIENTRY glColor3dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glColor3fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glColor3iv( const GLint *v );
+GLAPI void GLAPIENTRY glColor3sv( const GLshort *v );
+GLAPI void GLAPIENTRY glColor3ubv( const GLubyte *v );
+GLAPI void GLAPIENTRY glColor3uiv( const GLuint *v );
+GLAPI void GLAPIENTRY glColor3usv( const GLushort *v );
+
+GLAPI void GLAPIENTRY glColor4bv( const GLbyte *v );
+GLAPI void GLAPIENTRY glColor4dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glColor4fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glColor4iv( const GLint *v );
+GLAPI void GLAPIENTRY glColor4sv( const GLshort *v );
+GLAPI void GLAPIENTRY glColor4ubv( const GLubyte *v );
+GLAPI void GLAPIENTRY glColor4uiv( const GLuint *v );
+GLAPI void GLAPIENTRY glColor4usv( const GLushort *v );
+
+
+GLAPI void GLAPIENTRY glTexCoord1d( GLdouble s );
+GLAPI void GLAPIENTRY glTexCoord1f( GLfloat s );
+GLAPI void GLAPIENTRY glTexCoord1i( GLint s );
+GLAPI void GLAPIENTRY glTexCoord1s( GLshort s );
+
+GLAPI void GLAPIENTRY glTexCoord2d( GLdouble s, GLdouble t );
+GLAPI void GLAPIENTRY glTexCoord2f( GLfloat s, GLfloat t );
+GLAPI void GLAPIENTRY glTexCoord2i( GLint s, GLint t );
+GLAPI void GLAPIENTRY glTexCoord2s( GLshort s, GLshort t );
+
+GLAPI void GLAPIENTRY glTexCoord3d( GLdouble s, GLdouble t, GLdouble r );
+GLAPI void GLAPIENTRY glTexCoord3f( GLfloat s, GLfloat t, GLfloat r );
+GLAPI void GLAPIENTRY glTexCoord3i( GLint s, GLint t, GLint r );
+GLAPI void GLAPIENTRY glTexCoord3s( GLshort s, GLshort t, GLshort r );
+
+GLAPI void GLAPIENTRY glTexCoord4d( GLdouble s, GLdouble t, GLdouble r, GLdouble q );
+GLAPI void GLAPIENTRY glTexCoord4f( GLfloat s, GLfloat t, GLfloat r, GLfloat q );
+GLAPI void GLAPIENTRY glTexCoord4i( GLint s, GLint t, GLint r, GLint q );
+GLAPI void GLAPIENTRY glTexCoord4s( GLshort s, GLshort t, GLshort r, GLshort q );
+
+GLAPI void GLAPIENTRY glTexCoord1dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glTexCoord1fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glTexCoord1iv( const GLint *v );
+GLAPI void GLAPIENTRY glTexCoord1sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glTexCoord2dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glTexCoord2fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glTexCoord2iv( const GLint *v );
+GLAPI void GLAPIENTRY glTexCoord2sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glTexCoord3dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glTexCoord3fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glTexCoord3iv( const GLint *v );
+GLAPI void GLAPIENTRY glTexCoord3sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glTexCoord4dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glTexCoord4fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glTexCoord4iv( const GLint *v );
+GLAPI void GLAPIENTRY glTexCoord4sv( const GLshort *v );
+
+
+GLAPI void GLAPIENTRY glRasterPos2d( GLdouble x, GLdouble y );
+GLAPI void GLAPIENTRY glRasterPos2f( GLfloat x, GLfloat y );
+GLAPI void GLAPIENTRY glRasterPos2i( GLint x, GLint y );
+GLAPI void GLAPIENTRY glRasterPos2s( GLshort x, GLshort y );
+
+GLAPI void GLAPIENTRY glRasterPos3d( GLdouble x, GLdouble y, GLdouble z );
+GLAPI void GLAPIENTRY glRasterPos3f( GLfloat x, GLfloat y, GLfloat z );
+GLAPI void GLAPIENTRY glRasterPos3i( GLint x, GLint y, GLint z );
+GLAPI void GLAPIENTRY glRasterPos3s( GLshort x, GLshort y, GLshort z );
+
+GLAPI void GLAPIENTRY glRasterPos4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w );
+GLAPI void GLAPIENTRY glRasterPos4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w );
+GLAPI void GLAPIENTRY glRasterPos4i( GLint x, GLint y, GLint z, GLint w );
+GLAPI void GLAPIENTRY glRasterPos4s( GLshort x, GLshort y, GLshort z, GLshort w );
+
+GLAPI void GLAPIENTRY glRasterPos2dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glRasterPos2fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glRasterPos2iv( const GLint *v );
+GLAPI void GLAPIENTRY glRasterPos2sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glRasterPos3dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glRasterPos3fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glRasterPos3iv( const GLint *v );
+GLAPI void GLAPIENTRY glRasterPos3sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glRasterPos4dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glRasterPos4fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glRasterPos4iv( const GLint *v );
+GLAPI void GLAPIENTRY glRasterPos4sv( const GLshort *v );
+
+
+GLAPI void GLAPIENTRY glRectd( GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2 );
+GLAPI void GLAPIENTRY glRectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 );
+GLAPI void GLAPIENTRY glRecti( GLint x1, GLint y1, GLint x2, GLint y2 );
+GLAPI void GLAPIENTRY glRects( GLshort x1, GLshort y1, GLshort x2, GLshort y2 );
+
+
+GLAPI void GLAPIENTRY glRectdv( const GLdouble *v1, const GLdouble *v2 );
+GLAPI void GLAPIENTRY glRectfv( const GLfloat *v1, const GLfloat *v2 );
+GLAPI void GLAPIENTRY glRectiv( const GLint *v1, const GLint *v2 );
+GLAPI void GLAPIENTRY glRectsv( const GLshort *v1, const GLshort *v2 );
+
+
+/*
+ * Vertex Arrays (1.1)
+ */
+
+GLAPI void GLAPIENTRY glVertexPointer( GLint size, GLenum type,
+ GLsizei stride, const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY glNormalPointer( GLenum type, GLsizei stride,
+ const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY glColorPointer( GLint size, GLenum type,
+ GLsizei stride, const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY glIndexPointer( GLenum type, GLsizei stride,
+ const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY glTexCoordPointer( GLint size, GLenum type,
+ GLsizei stride, const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY glEdgeFlagPointer( GLsizei stride, const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY glGetPointerv( GLenum pname, GLvoid **params );
+
+GLAPI void GLAPIENTRY glArrayElement( GLint i );
+
+GLAPI void GLAPIENTRY glDrawArrays( GLenum mode, GLint first, GLsizei count );
+
+GLAPI void GLAPIENTRY glDrawElements( GLenum mode, GLsizei count,
+ GLenum type, const GLvoid *indices );
+
+GLAPI void GLAPIENTRY glInterleavedArrays( GLenum format, GLsizei stride,
+ const GLvoid *pointer );
+
+/*
+ * Lighting
+ */
+
+GLAPI void GLAPIENTRY glShadeModel( GLenum mode );
+
+GLAPI void GLAPIENTRY glLightf( GLenum light, GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glLighti( GLenum light, GLenum pname, GLint param );
+GLAPI void GLAPIENTRY glLightfv( GLenum light, GLenum pname,
+ const GLfloat *params );
+GLAPI void GLAPIENTRY glLightiv( GLenum light, GLenum pname,
+ const GLint *params );
+
+GLAPI void GLAPIENTRY glGetLightfv( GLenum light, GLenum pname,
+ GLfloat *params );
+GLAPI void GLAPIENTRY glGetLightiv( GLenum light, GLenum pname,
+ GLint *params );
+
+GLAPI void GLAPIENTRY glLightModelf( GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glLightModeli( GLenum pname, GLint param );
+GLAPI void GLAPIENTRY glLightModelfv( GLenum pname, const GLfloat *params );
+GLAPI void GLAPIENTRY glLightModeliv( GLenum pname, const GLint *params );
+
+GLAPI void GLAPIENTRY glMaterialf( GLenum face, GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glMateriali( GLenum face, GLenum pname, GLint param );
+GLAPI void GLAPIENTRY glMaterialfv( GLenum face, GLenum pname, const GLfloat *params );
+GLAPI void GLAPIENTRY glMaterialiv( GLenum face, GLenum pname, const GLint *params );
+
+GLAPI void GLAPIENTRY glGetMaterialfv( GLenum face, GLenum pname, GLfloat *params );
+GLAPI void GLAPIENTRY glGetMaterialiv( GLenum face, GLenum pname, GLint *params );
+
+GLAPI void GLAPIENTRY glColorMaterial( GLenum face, GLenum mode );
+
+
+/*
+ * Raster functions
+ */
+
+GLAPI void GLAPIENTRY glPixelZoom( GLfloat xfactor, GLfloat yfactor );
+
+GLAPI void GLAPIENTRY glPixelStoref( GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glPixelStorei( GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY glPixelTransferf( GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glPixelTransferi( GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY glPixelMapfv( GLenum map, GLsizei mapsize,
+ const GLfloat *values );
+GLAPI void GLAPIENTRY glPixelMapuiv( GLenum map, GLsizei mapsize,
+ const GLuint *values );
+GLAPI void GLAPIENTRY glPixelMapusv( GLenum map, GLsizei mapsize,
+ const GLushort *values );
+
+GLAPI void GLAPIENTRY glGetPixelMapfv( GLenum map, GLfloat *values );
+GLAPI void GLAPIENTRY glGetPixelMapuiv( GLenum map, GLuint *values );
+GLAPI void GLAPIENTRY glGetPixelMapusv( GLenum map, GLushort *values );
+
+GLAPI void GLAPIENTRY glBitmap( GLsizei width, GLsizei height,
+ GLfloat xorig, GLfloat yorig,
+ GLfloat xmove, GLfloat ymove,
+ const GLubyte *bitmap );
+
+GLAPI void GLAPIENTRY glReadPixels( GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ GLvoid *pixels );
+
+GLAPI void GLAPIENTRY glDrawPixels( GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const GLvoid *pixels );
+
+GLAPI void GLAPIENTRY glCopyPixels( GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLenum type );
+
+/*
+ * Stenciling
+ */
+
+GLAPI void GLAPIENTRY glStencilFunc( GLenum func, GLint ref, GLuint mask );
+
+GLAPI void GLAPIENTRY glStencilMask( GLuint mask );
+
+GLAPI void GLAPIENTRY glStencilOp( GLenum fail, GLenum zfail, GLenum zpass );
+
+GLAPI void GLAPIENTRY glClearStencil( GLint s );
+
+
+
+/*
+ * Texture mapping
+ */
+
+GLAPI void GLAPIENTRY glTexGend( GLenum coord, GLenum pname, GLdouble param );
+GLAPI void GLAPIENTRY glTexGenf( GLenum coord, GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glTexGeni( GLenum coord, GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY glTexGendv( GLenum coord, GLenum pname, const GLdouble *params );
+GLAPI void GLAPIENTRY glTexGenfv( GLenum coord, GLenum pname, const GLfloat *params );
+GLAPI void GLAPIENTRY glTexGeniv( GLenum coord, GLenum pname, const GLint *params );
+
+GLAPI void GLAPIENTRY glGetTexGendv( GLenum coord, GLenum pname, GLdouble *params );
+GLAPI void GLAPIENTRY glGetTexGenfv( GLenum coord, GLenum pname, GLfloat *params );
+GLAPI void GLAPIENTRY glGetTexGeniv( GLenum coord, GLenum pname, GLint *params );
+
+
+GLAPI void GLAPIENTRY glTexEnvf( GLenum target, GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glTexEnvi( GLenum target, GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY glTexEnvfv( GLenum target, GLenum pname, const GLfloat *params );
+GLAPI void GLAPIENTRY glTexEnviv( GLenum target, GLenum pname, const GLint *params );
+
+GLAPI void GLAPIENTRY glGetTexEnvfv( GLenum target, GLenum pname, GLfloat *params );
+GLAPI void GLAPIENTRY glGetTexEnviv( GLenum target, GLenum pname, GLint *params );
+
+
+GLAPI void GLAPIENTRY glTexParameterf( GLenum target, GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glTexParameteri( GLenum target, GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY glTexParameterfv( GLenum target, GLenum pname,
+ const GLfloat *params );
+GLAPI void GLAPIENTRY glTexParameteriv( GLenum target, GLenum pname,
+ const GLint *params );
+
+GLAPI void GLAPIENTRY glGetTexParameterfv( GLenum target,
+ GLenum pname, GLfloat *params);
+GLAPI void GLAPIENTRY glGetTexParameteriv( GLenum target,
+ GLenum pname, GLint *params );
+
+GLAPI void GLAPIENTRY glGetTexLevelParameterfv( GLenum target, GLint level,
+ GLenum pname, GLfloat *params );
+GLAPI void GLAPIENTRY glGetTexLevelParameteriv( GLenum target, GLint level,
+ GLenum pname, GLint *params );
+
+
+GLAPI void GLAPIENTRY glTexImage1D( GLenum target, GLint level,
+ GLint internalFormat,
+ GLsizei width, GLint border,
+ GLenum format, GLenum type,
+ const GLvoid *pixels );
+
+GLAPI void GLAPIENTRY glTexImage2D( GLenum target, GLint level,
+ GLint internalFormat,
+ GLsizei width, GLsizei height,
+ GLint border, GLenum format, GLenum type,
+ const GLvoid *pixels );
+
+GLAPI void GLAPIENTRY glGetTexImage( GLenum target, GLint level,
+ GLenum format, GLenum type,
+ GLvoid *pixels );
+
+
+/* 1.1 functions */
+
+GLAPI void GLAPIENTRY glGenTextures( GLsizei n, GLuint *textures );
+
+GLAPI void GLAPIENTRY glDeleteTextures( GLsizei n, const GLuint *textures);
+
+GLAPI void GLAPIENTRY glBindTexture( GLenum target, GLuint texture );
+
+GLAPI void GLAPIENTRY glPrioritizeTextures( GLsizei n,
+ const GLuint *textures,
+ const GLclampf *priorities );
+
+GLAPI GLboolean GLAPIENTRY glAreTexturesResident( GLsizei n,
+ const GLuint *textures,
+ GLboolean *residences );
+
+GLAPI GLboolean GLAPIENTRY glIsTexture( GLuint texture );
+
+
+GLAPI void GLAPIENTRY glTexSubImage1D( GLenum target, GLint level,
+ GLint xoffset,
+ GLsizei width, GLenum format,
+ GLenum type, const GLvoid *pixels );
+
+
+GLAPI void GLAPIENTRY glTexSubImage2D( GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const GLvoid *pixels );
+
+
+GLAPI void GLAPIENTRY glCopyTexImage1D( GLenum target, GLint level,
+ GLenum internalformat,
+ GLint x, GLint y,
+ GLsizei width, GLint border );
+
+
+GLAPI void GLAPIENTRY glCopyTexImage2D( GLenum target, GLint level,
+ GLenum internalformat,
+ GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLint border );
+
+
+GLAPI void GLAPIENTRY glCopyTexSubImage1D( GLenum target, GLint level,
+ GLint xoffset, GLint x, GLint y,
+ GLsizei width );
+
+
+GLAPI void GLAPIENTRY glCopyTexSubImage2D( GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLint x, GLint y,
+ GLsizei width, GLsizei height );
+
+
+/*
+ * Evaluators
+ */
+
+GLAPI void GLAPIENTRY glMap1d( GLenum target, GLdouble u1, GLdouble u2,
+ GLint stride,
+ GLint order, const GLdouble *points );
+GLAPI void GLAPIENTRY glMap1f( GLenum target, GLfloat u1, GLfloat u2,
+ GLint stride,
+ GLint order, const GLfloat *points );
+
+GLAPI void GLAPIENTRY glMap2d( GLenum target,
+ GLdouble u1, GLdouble u2, GLint ustride, GLint uorder,
+ GLdouble v1, GLdouble v2, GLint vstride, GLint vorder,
+ const GLdouble *points );
+GLAPI void GLAPIENTRY glMap2f( GLenum target,
+ GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
+ GLfloat v1, GLfloat v2, GLint vstride, GLint vorder,
+ const GLfloat *points );
+
+GLAPI void GLAPIENTRY glGetMapdv( GLenum target, GLenum query, GLdouble *v );
+GLAPI void GLAPIENTRY glGetMapfv( GLenum target, GLenum query, GLfloat *v );
+GLAPI void GLAPIENTRY glGetMapiv( GLenum target, GLenum query, GLint *v );
+
+GLAPI void GLAPIENTRY glEvalCoord1d( GLdouble u );
+GLAPI void GLAPIENTRY glEvalCoord1f( GLfloat u );
+
+GLAPI void GLAPIENTRY glEvalCoord1dv( const GLdouble *u );
+GLAPI void GLAPIENTRY glEvalCoord1fv( const GLfloat *u );
+
+GLAPI void GLAPIENTRY glEvalCoord2d( GLdouble u, GLdouble v );
+GLAPI void GLAPIENTRY glEvalCoord2f( GLfloat u, GLfloat v );
+
+GLAPI void GLAPIENTRY glEvalCoord2dv( const GLdouble *u );
+GLAPI void GLAPIENTRY glEvalCoord2fv( const GLfloat *u );
+
+GLAPI void GLAPIENTRY glMapGrid1d( GLint un, GLdouble u1, GLdouble u2 );
+GLAPI void GLAPIENTRY glMapGrid1f( GLint un, GLfloat u1, GLfloat u2 );
+
+GLAPI void GLAPIENTRY glMapGrid2d( GLint un, GLdouble u1, GLdouble u2,
+ GLint vn, GLdouble v1, GLdouble v2 );
+GLAPI void GLAPIENTRY glMapGrid2f( GLint un, GLfloat u1, GLfloat u2,
+ GLint vn, GLfloat v1, GLfloat v2 );
+
+GLAPI void GLAPIENTRY glEvalPoint1( GLint i );
+
+GLAPI void GLAPIENTRY glEvalPoint2( GLint i, GLint j );
+
+GLAPI void GLAPIENTRY glEvalMesh1( GLenum mode, GLint i1, GLint i2 );
+
+GLAPI void GLAPIENTRY glEvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 );
+
+
+/*
+ * Fog
+ */
+
+GLAPI void GLAPIENTRY glFogf( GLenum pname, GLfloat param );
+
+GLAPI void GLAPIENTRY glFogi( GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY glFogfv( GLenum pname, const GLfloat *params );
+
+GLAPI void GLAPIENTRY glFogiv( GLenum pname, const GLint *params );
+
+
+/*
+ * Selection and Feedback
+ */
+
+GLAPI void GLAPIENTRY glFeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer );
+
+GLAPI void GLAPIENTRY glPassThrough( GLfloat token );
+
+GLAPI void GLAPIENTRY glSelectBuffer( GLsizei size, GLuint *buffer );
+
+GLAPI void GLAPIENTRY glInitNames( void );
+
+GLAPI void GLAPIENTRY glLoadName( GLuint name );
+
+GLAPI void GLAPIENTRY glPushName( GLuint name );
+
+GLAPI void GLAPIENTRY glPopName( void );
+
+
+
+/*
+ * OpenGL 1.2
+ */
+
+#define GL_RESCALE_NORMAL 0x803A
+#define GL_CLAMP_TO_EDGE 0x812F
+#define GL_MAX_ELEMENTS_VERTICES 0x80E8
+#define GL_MAX_ELEMENTS_INDICES 0x80E9
+#define GL_BGR 0x80E0
+#define GL_BGRA 0x80E1
+#define GL_UNSIGNED_BYTE_3_3_2 0x8032
+#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
+#define GL_UNSIGNED_SHORT_5_6_5 0x8363
+#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
+#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
+#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365
+#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
+#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
+#define GL_UNSIGNED_INT_8_8_8_8 0x8035
+#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
+#define GL_UNSIGNED_INT_10_10_10_2 0x8036
+#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
+#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8
+#define GL_SINGLE_COLOR 0x81F9
+#define GL_SEPARATE_SPECULAR_COLOR 0x81FA
+#define GL_TEXTURE_MIN_LOD 0x813A
+#define GL_TEXTURE_MAX_LOD 0x813B
+#define GL_TEXTURE_BASE_LEVEL 0x813C
+#define GL_TEXTURE_MAX_LEVEL 0x813D
+#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
+#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13
+#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
+#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23
+#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
+#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
+#define GL_PACK_SKIP_IMAGES 0x806B
+#define GL_PACK_IMAGE_HEIGHT 0x806C
+#define GL_UNPACK_SKIP_IMAGES 0x806D
+#define GL_UNPACK_IMAGE_HEIGHT 0x806E
+#define GL_TEXTURE_3D 0x806F
+#define GL_PROXY_TEXTURE_3D 0x8070
+#define GL_TEXTURE_DEPTH 0x8071
+#define GL_TEXTURE_WRAP_R 0x8072
+#define GL_MAX_3D_TEXTURE_SIZE 0x8073
+#define GL_TEXTURE_BINDING_3D 0x806A
+
+GLAPI void GLAPIENTRY glDrawRangeElements( GLenum mode, GLuint start,
+ GLuint end, GLsizei count, GLenum type, const GLvoid *indices );
+
+GLAPI void GLAPIENTRY glTexImage3D( GLenum target, GLint level,
+ GLint internalFormat,
+ GLsizei width, GLsizei height,
+ GLsizei depth, GLint border,
+ GLenum format, GLenum type,
+ const GLvoid *pixels );
+
+GLAPI void GLAPIENTRY glTexSubImage3D( GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLint zoffset, GLsizei width,
+ GLsizei height, GLsizei depth,
+ GLenum format,
+ GLenum type, const GLvoid *pixels);
+
+GLAPI void GLAPIENTRY glCopyTexSubImage3D( GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLint zoffset, GLint x,
+ GLint y, GLsizei width,
+ GLsizei height );
+
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
+typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+
+
+/*
+ * GL_ARB_imaging
+ */
+
+#define GL_CONSTANT_COLOR 0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
+#define GL_CONSTANT_ALPHA 0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
+#define GL_COLOR_TABLE 0x80D0
+#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1
+#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2
+#define GL_PROXY_COLOR_TABLE 0x80D3
+#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4
+#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5
+#define GL_COLOR_TABLE_SCALE 0x80D6
+#define GL_COLOR_TABLE_BIAS 0x80D7
+#define GL_COLOR_TABLE_FORMAT 0x80D8
+#define GL_COLOR_TABLE_WIDTH 0x80D9
+#define GL_COLOR_TABLE_RED_SIZE 0x80DA
+#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB
+#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC
+#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD
+#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE
+#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF
+#define GL_CONVOLUTION_1D 0x8010
+#define GL_CONVOLUTION_2D 0x8011
+#define GL_SEPARABLE_2D 0x8012
+#define GL_CONVOLUTION_BORDER_MODE 0x8013
+#define GL_CONVOLUTION_FILTER_SCALE 0x8014
+#define GL_CONVOLUTION_FILTER_BIAS 0x8015
+#define GL_REDUCE 0x8016
+#define GL_CONVOLUTION_FORMAT 0x8017
+#define GL_CONVOLUTION_WIDTH 0x8018
+#define GL_CONVOLUTION_HEIGHT 0x8019
+#define GL_MAX_CONVOLUTION_WIDTH 0x801A
+#define GL_MAX_CONVOLUTION_HEIGHT 0x801B
+#define GL_POST_CONVOLUTION_RED_SCALE 0x801C
+#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D
+#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E
+#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F
+#define GL_POST_CONVOLUTION_RED_BIAS 0x8020
+#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021
+#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022
+#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023
+#define GL_CONSTANT_BORDER 0x8151
+#define GL_REPLICATE_BORDER 0x8153
+#define GL_CONVOLUTION_BORDER_COLOR 0x8154
+#define GL_COLOR_MATRIX 0x80B1
+#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2
+#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3
+#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4
+#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5
+#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6
+#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7
+#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8
+#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9
+#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA
+#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB
+#define GL_HISTOGRAM 0x8024
+#define GL_PROXY_HISTOGRAM 0x8025
+#define GL_HISTOGRAM_WIDTH 0x8026
+#define GL_HISTOGRAM_FORMAT 0x8027
+#define GL_HISTOGRAM_RED_SIZE 0x8028
+#define GL_HISTOGRAM_GREEN_SIZE 0x8029
+#define GL_HISTOGRAM_BLUE_SIZE 0x802A
+#define GL_HISTOGRAM_ALPHA_SIZE 0x802B
+#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C
+#define GL_HISTOGRAM_SINK 0x802D
+#define GL_MINMAX 0x802E
+#define GL_MINMAX_FORMAT 0x802F
+#define GL_MINMAX_SINK 0x8030
+#define GL_TABLE_TOO_LARGE 0x8031
+#define GL_BLEND_EQUATION 0x8009
+#define GL_MIN 0x8007
+#define GL_MAX 0x8008
+#define GL_FUNC_ADD 0x8006
+#define GL_FUNC_SUBTRACT 0x800A
+#define GL_FUNC_REVERSE_SUBTRACT 0x800B
+#define GL_BLEND_COLOR 0x8005
+
+
+GLAPI void GLAPIENTRY glColorTable( GLenum target, GLenum internalformat,
+ GLsizei width, GLenum format,
+ GLenum type, const GLvoid *table );
+
+GLAPI void GLAPIENTRY glColorSubTable( GLenum target,
+ GLsizei start, GLsizei count,
+ GLenum format, GLenum type,
+ const GLvoid *data );
+
+GLAPI void GLAPIENTRY glColorTableParameteriv(GLenum target, GLenum pname,
+ const GLint *params);
+
+GLAPI void GLAPIENTRY glColorTableParameterfv(GLenum target, GLenum pname,
+ const GLfloat *params);
+
+GLAPI void GLAPIENTRY glCopyColorSubTable( GLenum target, GLsizei start,
+ GLint x, GLint y, GLsizei width );
+
+GLAPI void GLAPIENTRY glCopyColorTable( GLenum target, GLenum internalformat,
+ GLint x, GLint y, GLsizei width );
+
+GLAPI void GLAPIENTRY glGetColorTable( GLenum target, GLenum format,
+ GLenum type, GLvoid *table );
+
+GLAPI void GLAPIENTRY glGetColorTableParameterfv( GLenum target, GLenum pname,
+ GLfloat *params );
+
+GLAPI void GLAPIENTRY glGetColorTableParameteriv( GLenum target, GLenum pname,
+ GLint *params );
+
+GLAPI void GLAPIENTRY glBlendEquation( GLenum mode );
+
+GLAPI void GLAPIENTRY glBlendColor( GLclampf red, GLclampf green,
+ GLclampf blue, GLclampf alpha );
+
+GLAPI void GLAPIENTRY glHistogram( GLenum target, GLsizei width,
+ GLenum internalformat, GLboolean sink );
+
+GLAPI void GLAPIENTRY glResetHistogram( GLenum target );
+
+GLAPI void GLAPIENTRY glGetHistogram( GLenum target, GLboolean reset,
+ GLenum format, GLenum type,
+ GLvoid *values );
+
+GLAPI void GLAPIENTRY glGetHistogramParameterfv( GLenum target, GLenum pname,
+ GLfloat *params );
+
+GLAPI void GLAPIENTRY glGetHistogramParameteriv( GLenum target, GLenum pname,
+ GLint *params );
+
+GLAPI void GLAPIENTRY glMinmax( GLenum target, GLenum internalformat,
+ GLboolean sink );
+
+GLAPI void GLAPIENTRY glResetMinmax( GLenum target );
+
+GLAPI void GLAPIENTRY glGetMinmax( GLenum target, GLboolean reset,
+ GLenum format, GLenum types,
+ GLvoid *values );
+
+GLAPI void GLAPIENTRY glGetMinmaxParameterfv( GLenum target, GLenum pname,
+ GLfloat *params );
+
+GLAPI void GLAPIENTRY glGetMinmaxParameteriv( GLenum target, GLenum pname,
+ GLint *params );
+
+GLAPI void GLAPIENTRY glConvolutionFilter1D( GLenum target,
+ GLenum internalformat, GLsizei width, GLenum format, GLenum type,
+ const GLvoid *image );
+
+GLAPI void GLAPIENTRY glConvolutionFilter2D( GLenum target,
+ GLenum internalformat, GLsizei width, GLsizei height, GLenum format,
+ GLenum type, const GLvoid *image );
+
+GLAPI void GLAPIENTRY glConvolutionParameterf( GLenum target, GLenum pname,
+ GLfloat params );
+
+GLAPI void GLAPIENTRY glConvolutionParameterfv( GLenum target, GLenum pname,
+ const GLfloat *params );
+
+GLAPI void GLAPIENTRY glConvolutionParameteri( GLenum target, GLenum pname,
+ GLint params );
+
+GLAPI void GLAPIENTRY glConvolutionParameteriv( GLenum target, GLenum pname,
+ const GLint *params );
+
+GLAPI void GLAPIENTRY glCopyConvolutionFilter1D( GLenum target,
+ GLenum internalformat, GLint x, GLint y, GLsizei width );
+
+GLAPI void GLAPIENTRY glCopyConvolutionFilter2D( GLenum target,
+ GLenum internalformat, GLint x, GLint y, GLsizei width,
+ GLsizei height);
+
+GLAPI void GLAPIENTRY glGetConvolutionFilter( GLenum target, GLenum format,
+ GLenum type, GLvoid *image );
+
+GLAPI void GLAPIENTRY glGetConvolutionParameterfv( GLenum target, GLenum pname,
+ GLfloat *params );
+
+GLAPI void GLAPIENTRY glGetConvolutionParameteriv( GLenum target, GLenum pname,
+ GLint *params );
+
+GLAPI void GLAPIENTRY glSeparableFilter2D( GLenum target,
+ GLenum internalformat, GLsizei width, GLsizei height, GLenum format,
+ GLenum type, const GLvoid *row, const GLvoid *column );
+
+GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format,
+ GLenum type, GLvoid *row, GLvoid *column, GLvoid *span );
+
+typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
+typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
+typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target);
+
+
+
+/*
+ * OpenGL 1.3
+ */
+
+/* multitexture */
+#define GL_TEXTURE0 0x84C0
+#define GL_TEXTURE1 0x84C1
+#define GL_TEXTURE2 0x84C2
+#define GL_TEXTURE3 0x84C3
+#define GL_TEXTURE4 0x84C4
+#define GL_TEXTURE5 0x84C5
+#define GL_TEXTURE6 0x84C6
+#define GL_TEXTURE7 0x84C7
+#define GL_TEXTURE8 0x84C8
+#define GL_TEXTURE9 0x84C9
+#define GL_TEXTURE10 0x84CA
+#define GL_TEXTURE11 0x84CB
+#define GL_TEXTURE12 0x84CC
+#define GL_TEXTURE13 0x84CD
+#define GL_TEXTURE14 0x84CE
+#define GL_TEXTURE15 0x84CF
+#define GL_TEXTURE16 0x84D0
+#define GL_TEXTURE17 0x84D1
+#define GL_TEXTURE18 0x84D2
+#define GL_TEXTURE19 0x84D3
+#define GL_TEXTURE20 0x84D4
+#define GL_TEXTURE21 0x84D5
+#define GL_TEXTURE22 0x84D6
+#define GL_TEXTURE23 0x84D7
+#define GL_TEXTURE24 0x84D8
+#define GL_TEXTURE25 0x84D9
+#define GL_TEXTURE26 0x84DA
+#define GL_TEXTURE27 0x84DB
+#define GL_TEXTURE28 0x84DC
+#define GL_TEXTURE29 0x84DD
+#define GL_TEXTURE30 0x84DE
+#define GL_TEXTURE31 0x84DF
+#define GL_ACTIVE_TEXTURE 0x84E0
+#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
+#define GL_MAX_TEXTURE_UNITS 0x84E2
+/* texture_cube_map */
+#define GL_NORMAL_MAP 0x8511
+#define GL_REFLECTION_MAP 0x8512
+#define GL_TEXTURE_CUBE_MAP 0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
+#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
+/* texture_compression */
+#define GL_COMPRESSED_ALPHA 0x84E9
+#define GL_COMPRESSED_LUMINANCE 0x84EA
+#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB
+#define GL_COMPRESSED_INTENSITY 0x84EC
+#define GL_COMPRESSED_RGB 0x84ED
+#define GL_COMPRESSED_RGBA 0x84EE
+#define GL_TEXTURE_COMPRESSION_HINT 0x84EF
+#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0
+#define GL_TEXTURE_COMPRESSED 0x86A1
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
+/* multisample */
+#define GL_MULTISAMPLE 0x809D
+#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE 0x809F
+#define GL_SAMPLE_COVERAGE 0x80A0
+#define GL_SAMPLE_BUFFERS 0x80A8
+#define GL_SAMPLES 0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
+#define GL_MULTISAMPLE_BIT 0x20000000
+/* transpose_matrix */
+#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3
+#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4
+#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5
+#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6
+/* texture_env_combine */
+#define GL_COMBINE 0x8570
+#define GL_COMBINE_RGB 0x8571
+#define GL_COMBINE_ALPHA 0x8572
+#define GL_SOURCE0_RGB 0x8580
+#define GL_SOURCE1_RGB 0x8581
+#define GL_SOURCE2_RGB 0x8582
+#define GL_SOURCE0_ALPHA 0x8588
+#define GL_SOURCE1_ALPHA 0x8589
+#define GL_SOURCE2_ALPHA 0x858A
+#define GL_OPERAND0_RGB 0x8590
+#define GL_OPERAND1_RGB 0x8591
+#define GL_OPERAND2_RGB 0x8592
+#define GL_OPERAND0_ALPHA 0x8598
+#define GL_OPERAND1_ALPHA 0x8599
+#define GL_OPERAND2_ALPHA 0x859A
+#define GL_RGB_SCALE 0x8573
+#define GL_ADD_SIGNED 0x8574
+#define GL_INTERPOLATE 0x8575
+#define GL_SUBTRACT 0x84E7
+#define GL_CONSTANT 0x8576
+#define GL_PRIMARY_COLOR 0x8577
+#define GL_PREVIOUS 0x8578
+/* texture_env_dot3 */
+#define GL_DOT3_RGB 0x86AE
+#define GL_DOT3_RGBA 0x86AF
+/* texture_border_clamp */
+#define GL_CLAMP_TO_BORDER 0x812D
+
+GLAPI void GLAPIENTRY glActiveTexture( GLenum texture );
+
+GLAPI void GLAPIENTRY glClientActiveTexture( GLenum texture );
+
+GLAPI void GLAPIENTRY glCompressedTexImage1D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data );
+
+GLAPI void GLAPIENTRY glCompressedTexImage2D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data );
+
+GLAPI void GLAPIENTRY glCompressedTexImage3D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data );
+
+GLAPI void GLAPIENTRY glCompressedTexSubImage1D( GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data );
+
+GLAPI void GLAPIENTRY glCompressedTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data );
+
+GLAPI void GLAPIENTRY glCompressedTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data );
+
+GLAPI void GLAPIENTRY glGetCompressedTexImage( GLenum target, GLint lod, GLvoid *img );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1d( GLenum target, GLdouble s );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1dv( GLenum target, const GLdouble *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1f( GLenum target, GLfloat s );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1fv( GLenum target, const GLfloat *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1i( GLenum target, GLint s );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1iv( GLenum target, const GLint *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1s( GLenum target, GLshort s );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1sv( GLenum target, const GLshort *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2d( GLenum target, GLdouble s, GLdouble t );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2dv( GLenum target, const GLdouble *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2f( GLenum target, GLfloat s, GLfloat t );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2fv( GLenum target, const GLfloat *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2i( GLenum target, GLint s, GLint t );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2iv( GLenum target, const GLint *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2s( GLenum target, GLshort s, GLshort t );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2sv( GLenum target, const GLshort *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3d( GLenum target, GLdouble s, GLdouble t, GLdouble r );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3dv( GLenum target, const GLdouble *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3f( GLenum target, GLfloat s, GLfloat t, GLfloat r );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3fv( GLenum target, const GLfloat *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3i( GLenum target, GLint s, GLint t, GLint r );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3iv( GLenum target, const GLint *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3s( GLenum target, GLshort s, GLshort t, GLshort r );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3sv( GLenum target, const GLshort *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4d( GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4dv( GLenum target, const GLdouble *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4f( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4fv( GLenum target, const GLfloat *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4i( GLenum target, GLint s, GLint t, GLint r, GLint q );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4iv( GLenum target, const GLint *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4s( GLenum target, GLshort s, GLshort t, GLshort r, GLshort q );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4sv( GLenum target, const GLshort *v );
+
+
+GLAPI void GLAPIENTRY glLoadTransposeMatrixd( const GLdouble m[16] );
+
+GLAPI void GLAPIENTRY glLoadTransposeMatrixf( const GLfloat m[16] );
+
+GLAPI void GLAPIENTRY glMultTransposeMatrixd( const GLdouble m[16] );
+
+GLAPI void GLAPIENTRY glMultTransposeMatrixf( const GLfloat m[16] );
+
+GLAPI void GLAPIENTRY glSampleCoverage( GLclampf value, GLboolean invert );
+
+typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m);
+typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, void *img);
+
+
+/*
+ * GL_ARB_multitexture (ARB extension 1 and OpenGL 1.2.1)
+ */
+#ifndef GL_ARB_multitexture
+#define GL_ARB_multitexture 1
+
+#define GL_TEXTURE0_ARB 0x84C0
+#define GL_TEXTURE1_ARB 0x84C1
+#define GL_TEXTURE2_ARB 0x84C2
+#define GL_TEXTURE3_ARB 0x84C3
+#define GL_TEXTURE4_ARB 0x84C4
+#define GL_TEXTURE5_ARB 0x84C5
+#define GL_TEXTURE6_ARB 0x84C6
+#define GL_TEXTURE7_ARB 0x84C7
+#define GL_TEXTURE8_ARB 0x84C8
+#define GL_TEXTURE9_ARB 0x84C9
+#define GL_TEXTURE10_ARB 0x84CA
+#define GL_TEXTURE11_ARB 0x84CB
+#define GL_TEXTURE12_ARB 0x84CC
+#define GL_TEXTURE13_ARB 0x84CD
+#define GL_TEXTURE14_ARB 0x84CE
+#define GL_TEXTURE15_ARB 0x84CF
+#define GL_TEXTURE16_ARB 0x84D0
+#define GL_TEXTURE17_ARB 0x84D1
+#define GL_TEXTURE18_ARB 0x84D2
+#define GL_TEXTURE19_ARB 0x84D3
+#define GL_TEXTURE20_ARB 0x84D4
+#define GL_TEXTURE21_ARB 0x84D5
+#define GL_TEXTURE22_ARB 0x84D6
+#define GL_TEXTURE23_ARB 0x84D7
+#define GL_TEXTURE24_ARB 0x84D8
+#define GL_TEXTURE25_ARB 0x84D9
+#define GL_TEXTURE26_ARB 0x84DA
+#define GL_TEXTURE27_ARB 0x84DB
+#define GL_TEXTURE28_ARB 0x84DC
+#define GL_TEXTURE29_ARB 0x84DD
+#define GL_TEXTURE30_ARB 0x84DE
+#define GL_TEXTURE31_ARB 0x84DF
+#define GL_ACTIVE_TEXTURE_ARB 0x84E0
+#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1
+#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2
+
+GLAPI void GLAPIENTRY glActiveTextureARB(GLenum texture);
+GLAPI void GLAPIENTRY glClientActiveTextureARB(GLenum texture);
+GLAPI void GLAPIENTRY glMultiTexCoord1dARB(GLenum target, GLdouble s);
+GLAPI void GLAPIENTRY glMultiTexCoord1dvARB(GLenum target, const GLdouble *v);
+GLAPI void GLAPIENTRY glMultiTexCoord1fARB(GLenum target, GLfloat s);
+GLAPI void GLAPIENTRY glMultiTexCoord1fvARB(GLenum target, const GLfloat *v);
+GLAPI void GLAPIENTRY glMultiTexCoord1iARB(GLenum target, GLint s);
+GLAPI void GLAPIENTRY glMultiTexCoord1ivARB(GLenum target, const GLint *v);
+GLAPI void GLAPIENTRY glMultiTexCoord1sARB(GLenum target, GLshort s);
+GLAPI void GLAPIENTRY glMultiTexCoord1svARB(GLenum target, const GLshort *v);
+GLAPI void GLAPIENTRY glMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t);
+GLAPI void GLAPIENTRY glMultiTexCoord2dvARB(GLenum target, const GLdouble *v);
+GLAPI void GLAPIENTRY glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t);
+GLAPI void GLAPIENTRY glMultiTexCoord2fvARB(GLenum target, const GLfloat *v);
+GLAPI void GLAPIENTRY glMultiTexCoord2iARB(GLenum target, GLint s, GLint t);
+GLAPI void GLAPIENTRY glMultiTexCoord2ivARB(GLenum target, const GLint *v);
+GLAPI void GLAPIENTRY glMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t);
+GLAPI void GLAPIENTRY glMultiTexCoord2svARB(GLenum target, const GLshort *v);
+GLAPI void GLAPIENTRY glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r);
+GLAPI void GLAPIENTRY glMultiTexCoord3dvARB(GLenum target, const GLdouble *v);
+GLAPI void GLAPIENTRY glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r);
+GLAPI void GLAPIENTRY glMultiTexCoord3fvARB(GLenum target, const GLfloat *v);
+GLAPI void GLAPIENTRY glMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r);
+GLAPI void GLAPIENTRY glMultiTexCoord3ivARB(GLenum target, const GLint *v);
+GLAPI void GLAPIENTRY glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r);
+GLAPI void GLAPIENTRY glMultiTexCoord3svARB(GLenum target, const GLshort *v);
+GLAPI void GLAPIENTRY glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+GLAPI void GLAPIENTRY glMultiTexCoord4dvARB(GLenum target, const GLdouble *v);
+GLAPI void GLAPIENTRY glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+GLAPI void GLAPIENTRY glMultiTexCoord4fvARB(GLenum target, const GLfloat *v);
+GLAPI void GLAPIENTRY glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q);
+GLAPI void GLAPIENTRY glMultiTexCoord4ivARB(GLenum target, const GLint *v);
+GLAPI void GLAPIENTRY glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+GLAPI void GLAPIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v);
+
+typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v);
+
+#endif /* GL_ARB_multitexture */
+
+
+
+/*
+ * Define this token if you want "old-style" header file behaviour (extensions
+ * defined in gl.h). Otherwise, extensions will be included from glext.h.
+ */
+#if defined(GL_GLEXT_LEGACY)
+
+/* All extensions that used to be here are now found in glext.h */
+
+#else /* GL_GLEXT_LEGACY */
+
+#include <GL/glext.h>
+
+#endif /* GL_GLEXT_LEGACY */
+
+
+
+#if GL_ARB_shader_objects
+
+#ifndef GL_MESA_shader_debug
+#define GL_MESA_shader_debug 1
+
+#define GL_DEBUG_OBJECT_MESA 0x8759
+#define GL_DEBUG_PRINT_MESA 0x875A
+#define GL_DEBUG_ASSERT_MESA 0x875B
+
+GLAPI GLhandleARB GLAPIENTRY glCreateDebugObjectMESA (void);
+GLAPI void GLAPIENTRY glClearDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType);
+GLAPI void GLAPIENTRY glGetDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType, GLsizei maxLength,
+ GLsizei *length, GLcharARB *debugLog);
+GLAPI GLsizei GLAPIENTRY glGetDebugLogLengthMESA (GLhandleARB obj, GLenum logType, GLenum shaderType);
+
+#endif /* GL_MESA_shader_debug */
+
+#endif /* GL_ARB_shader_objects */
+
+
+/*
+ * ???. GL_MESA_packed_depth_stencil
+ * XXX obsolete
+ */
+#ifndef GL_MESA_packed_depth_stencil
+#define GL_MESA_packed_depth_stencil 1
+
+#define GL_DEPTH_STENCIL_MESA 0x8750
+#define GL_UNSIGNED_INT_24_8_MESA 0x8751
+#define GL_UNSIGNED_INT_8_24_REV_MESA 0x8752
+#define GL_UNSIGNED_SHORT_15_1_MESA 0x8753
+#define GL_UNSIGNED_SHORT_1_15_REV_MESA 0x8754
+
+#endif /* GL_MESA_packed_depth_stencil */
+
+
+#ifndef GL_MESA_program_debug
+#define GL_MESA_program_debug 1
+
+#define GL_FRAGMENT_PROGRAM_POSITION_MESA 0x8bb0
+#define GL_FRAGMENT_PROGRAM_CALLBACK_MESA 0x8bb1
+#define GL_FRAGMENT_PROGRAM_CALLBACK_FUNC_MESA 0x8bb2
+#define GL_FRAGMENT_PROGRAM_CALLBACK_DATA_MESA 0x8bb3
+#define GL_VERTEX_PROGRAM_POSITION_MESA 0x8bb4
+#define GL_VERTEX_PROGRAM_CALLBACK_MESA 0x8bb5
+#define GL_VERTEX_PROGRAM_CALLBACK_FUNC_MESA 0x8bb6
+#define GL_VERTEX_PROGRAM_CALLBACK_DATA_MESA 0x8bb7
+
+typedef void (*GLprogramcallbackMESA)(GLenum target, GLvoid *data);
+
+GLAPI void GLAPIENTRY glProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback, GLvoid *data);
+
+GLAPI void GLAPIENTRY glGetProgramRegisterfvMESA(GLenum target, GLsizei len, const GLubyte *name, GLfloat *v);
+
+#endif /* GL_MESA_program_debug */
+
+
+#ifndef GL_ATI_blend_equation_separate
+#define GL_ATI_blend_equation_separate 1
+
+#define GL_ALPHA_BLEND_EQUATION_ATI 0x883D
+
+GLAPI void GLAPIENTRY glBlendEquationSeparateATI( GLenum modeRGB, GLenum modeA );
+typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLenum modeA);
+
+#endif /* GL_ATI_blend_equation_separate */
+
+
+
+/**
+ ** NOTE!!!!! If you add new functions to this file, or update
+ ** glext.h be sure to regenerate the gl_mangle.h file. See comments
+ ** in that file for details.
+ **/
+
+
+
+/**********************************************************************
+ * Begin system-specific stuff
+ */
+#if defined(PRAGMA_EXPORT_SUPPORTED)
+#pragma export off
+#endif
+
+#if defined(macintosh) && PRAGMA_IMPORT_SUPPORTED
+#pragma import off
+#endif
+/*
+ * End system-specific stuff
+ **********************************************************************/
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __gl_h_ */
diff --git a/sysroot/usr/include/GL/gl_mangle.h b/sysroot/usr/include/GL/gl_mangle.h
new file mode 100644
index 0000000..1dcd4a8
--- /dev/null
+++ b/sysroot/usr/include/GL/gl_mangle.h
@@ -0,0 +1,1568 @@
+#if 0
+#define GL_MANGLE_C1 "DO NOT EDIT!!! - TO REGENERATE from gl.h, EXECUTE THIS FILE IN SHELL (/bin/sh) and save the output"
+#define GL_MANGLE_C2 "This file is used to create GL function protypes and aliases for the function names"
+ files="gl.h glext.h"
+#define GL_MANGLE_C3 "get regeneration header - copy everything in this file above the 'REGENERATE_TO_END' line"
+ awk '!done; /^\/\*REGENERATE_TO_END/ {done=1}' $0
+ echo ""
+#define GL_MANGLE_C4 get aliases
+ grep '^GLAPI' $files | sed -e 's/.*ENTRY gl\([^( ]*\).*$/#define gl\1 MANGLE(\1)/' | sort | uniq
+ echo ""
+ echo "#endif /* GL_MANGLE_H */"
+ exit
+#endif /* REGENERATION */
+
+/*
+ * If you compile Mesa with USE_MGL_NAMESPACE defined then you can link
+ * your application both with OpenGL and Mesa. The Mesa functions will
+ * be redefined so they are prefixed with "mgl" instead of "gl".
+ * Mgl contributed by Randy Frank (rfrank@rsinc.com)
+ * Regneration code contributed by Ray Tice (rayt@ma.ultra.net)
+ */
+
+#ifndef GL_MANGLE_H
+#define GL_MANGLE_H
+
+#ifndef MANGLE
+#define MANGLE(x) mgl##x
+#endif /*MANGLE*/
+
+/*REGENERATE_TO_END-----------ALL LINES BELOW HERE GET REPLACED ON REGENERATION */
+
+#define glAccum MANGLE(Accum)
+#define glActiveStencilFaceEXT MANGLE(ActiveStencilFaceEXT)
+#define glActiveTextureARB MANGLE(ActiveTextureARB)
+#define glActiveTexture MANGLE(ActiveTexture)
+#define glActiveVaryingNV MANGLE(ActiveVaryingNV)
+#define glAlphaFragmentOp1ATI MANGLE(AlphaFragmentOp1ATI)
+#define glAlphaFragmentOp2ATI MANGLE(AlphaFragmentOp2ATI)
+#define glAlphaFragmentOp3ATI MANGLE(AlphaFragmentOp3ATI)
+#define glAlphaFunc MANGLE(AlphaFunc)
+#define glApplyTextureEXT MANGLE(ApplyTextureEXT)
+#define glAreProgramsResidentNV MANGLE(AreProgramsResidentNV)
+#define glAreTexturesResidentEXT MANGLE(AreTexturesResidentEXT)
+#define glAreTexturesResident MANGLE(AreTexturesResident)
+#define glArrayElementEXT MANGLE(ArrayElementEXT)
+#define glArrayElement MANGLE(ArrayElement)
+#define glArrayObjectATI MANGLE(ArrayObjectATI)
+#define glAsyncMarkerSGIX MANGLE(AsyncMarkerSGIX)
+#define glAttachObjectARB MANGLE(AttachObjectARB)
+#define glAttachShader MANGLE(AttachShader)
+#define glBeginFragmentShaderATI MANGLE(BeginFragmentShaderATI)
+#define glBegin MANGLE(Begin)
+#define glBeginOcclusionQueryNV MANGLE(BeginOcclusionQueryNV)
+#define glBeginQueryARB MANGLE(BeginQueryARB)
+#define glBeginQuery MANGLE(BeginQuery)
+#define glBeginTransformFeedbackNV MANGLE(BeginTransformFeedbackNV)
+#define glBeginVertexShaderEXT MANGLE(BeginVertexShaderEXT)
+#define glBindAttribLocationARB MANGLE(BindAttribLocationARB)
+#define glBindAttribLocation MANGLE(BindAttribLocation)
+#define glBindBufferARB MANGLE(BindBufferARB)
+#define glBindBufferBaseNV MANGLE(BindBufferBaseNV)
+#define glBindBuffer MANGLE(BindBuffer)
+#define glBindBufferOffsetNV MANGLE(BindBufferOffsetNV)
+#define glBindBufferRangeNV MANGLE(BindBufferRangeNV)
+#define glBindFragDataLocationEXT MANGLE(BindFragDataLocationEXT)
+#define glBindFragmentShaderATI MANGLE(BindFragmentShaderATI)
+#define glBindFramebufferEXT MANGLE(BindFramebufferEXT)
+#define glBindLightParameterEXT MANGLE(BindLightParameterEXT)
+#define glBindMaterialParameterEXT MANGLE(BindMaterialParameterEXT)
+#define glBindParameterEXT MANGLE(BindParameterEXT)
+#define glBindProgramARB MANGLE(BindProgramARB)
+#define glBindProgramNV MANGLE(BindProgramNV)
+#define glBindRenderbufferEXT MANGLE(BindRenderbufferEXT)
+#define glBindTexGenParameterEXT MANGLE(BindTexGenParameterEXT)
+#define glBindTextureEXT MANGLE(BindTextureEXT)
+#define glBindTexture MANGLE(BindTexture)
+#define glBindTextureUnitParameterEXT MANGLE(BindTextureUnitParameterEXT)
+#define glBindVertexArrayAPPLE MANGLE(BindVertexArrayAPPLE)
+#define glBindVertexShaderEXT MANGLE(BindVertexShaderEXT)
+#define glBinormal3bEXT MANGLE(Binormal3bEXT)
+#define glBinormal3bvEXT MANGLE(Binormal3bvEXT)
+#define glBinormal3dEXT MANGLE(Binormal3dEXT)
+#define glBinormal3dvEXT MANGLE(Binormal3dvEXT)
+#define glBinormal3fEXT MANGLE(Binormal3fEXT)
+#define glBinormal3fvEXT MANGLE(Binormal3fvEXT)
+#define glBinormal3iEXT MANGLE(Binormal3iEXT)
+#define glBinormal3ivEXT MANGLE(Binormal3ivEXT)
+#define glBinormal3sEXT MANGLE(Binormal3sEXT)
+#define glBinormal3svEXT MANGLE(Binormal3svEXT)
+#define glBinormalPointerEXT MANGLE(BinormalPointerEXT)
+#define glBitmap MANGLE(Bitmap)
+#define glBlendColorEXT MANGLE(BlendColorEXT)
+#define glBlendColor MANGLE(BlendColor)
+#define glBlendEquationEXT MANGLE(BlendEquationEXT)
+#define glBlendEquation MANGLE(BlendEquation)
+#define glBlendEquationSeparateATI MANGLE(BlendEquationSeparateATI)
+#define glBlendEquationSeparateEXT MANGLE(BlendEquationSeparateEXT)
+#define glBlendEquationSeparate MANGLE(BlendEquationSeparate)
+#define glBlendFunc MANGLE(BlendFunc)
+#define glBlendFuncSeparateEXT MANGLE(BlendFuncSeparateEXT)
+#define glBlendFuncSeparateINGR MANGLE(BlendFuncSeparateINGR)
+#define glBlendFuncSeparate MANGLE(BlendFuncSeparate)
+#define glBlitFramebufferEXT MANGLE(BlitFramebufferEXT)
+#define glBufferDataARB MANGLE(BufferDataARB)
+#define glBufferData MANGLE(BufferData)
+#define glBufferParameteriAPPLE MANGLE(BufferParameteriAPPLE)
+#define glBufferSubDataARB MANGLE(BufferSubDataARB)
+#define glBufferSubData MANGLE(BufferSubData)
+#define glCallList MANGLE(CallList)
+#define glCallLists MANGLE(CallLists)
+#define glCheckFramebufferStatusEXT MANGLE(CheckFramebufferStatusEXT)
+#define glClampColorARB MANGLE(ClampColorARB)
+#define glClearAccum MANGLE(ClearAccum)
+#define glClearColorIiEXT MANGLE(ClearColorIiEXT)
+#define glClearColorIuiEXT MANGLE(ClearColorIuiEXT)
+#define glClearColor MANGLE(ClearColor)
+#define glClearDebugLogMESA MANGLE(ClearDebugLogMESA)
+#define glClearDepthdNV MANGLE(ClearDepthdNV)
+#define glClearDepth MANGLE(ClearDepth)
+#define glClearIndex MANGLE(ClearIndex)
+#define glClear MANGLE(Clear)
+#define glClearStencil MANGLE(ClearStencil)
+#define glClientActiveTextureARB MANGLE(ClientActiveTextureARB)
+#define glClientActiveTexture MANGLE(ClientActiveTexture)
+#define glClientActiveVertexStreamATI MANGLE(ClientActiveVertexStreamATI)
+#define glClipPlane MANGLE(ClipPlane)
+#define glColor3b MANGLE(Color3b)
+#define glColor3bv MANGLE(Color3bv)
+#define glColor3d MANGLE(Color3d)
+#define glColor3dv MANGLE(Color3dv)
+#define glColor3f MANGLE(Color3f)
+#define glColor3fVertex3fSUN MANGLE(Color3fVertex3fSUN)
+#define glColor3fVertex3fvSUN MANGLE(Color3fVertex3fvSUN)
+#define glColor3fv MANGLE(Color3fv)
+#define glColor3hNV MANGLE(Color3hNV)
+#define glColor3hvNV MANGLE(Color3hvNV)
+#define glColor3i MANGLE(Color3i)
+#define glColor3iv MANGLE(Color3iv)
+#define glColor3s MANGLE(Color3s)
+#define glColor3sv MANGLE(Color3sv)
+#define glColor3ub MANGLE(Color3ub)
+#define glColor3ubv MANGLE(Color3ubv)
+#define glColor3ui MANGLE(Color3ui)
+#define glColor3uiv MANGLE(Color3uiv)
+#define glColor3us MANGLE(Color3us)
+#define glColor3usv MANGLE(Color3usv)
+#define glColor4b MANGLE(Color4b)
+#define glColor4bv MANGLE(Color4bv)
+#define glColor4d MANGLE(Color4d)
+#define glColor4dv MANGLE(Color4dv)
+#define glColor4f MANGLE(Color4f)
+#define glColor4fNormal3fVertex3fSUN MANGLE(Color4fNormal3fVertex3fSUN)
+#define glColor4fNormal3fVertex3fvSUN MANGLE(Color4fNormal3fVertex3fvSUN)
+#define glColor4fv MANGLE(Color4fv)
+#define glColor4hNV MANGLE(Color4hNV)
+#define glColor4hvNV MANGLE(Color4hvNV)
+#define glColor4i MANGLE(Color4i)
+#define glColor4iv MANGLE(Color4iv)
+#define glColor4s MANGLE(Color4s)
+#define glColor4sv MANGLE(Color4sv)
+#define glColor4ub MANGLE(Color4ub)
+#define glColor4ubVertex2fSUN MANGLE(Color4ubVertex2fSUN)
+#define glColor4ubVertex2fvSUN MANGLE(Color4ubVertex2fvSUN)
+#define glColor4ubVertex3fSUN MANGLE(Color4ubVertex3fSUN)
+#define glColor4ubVertex3fvSUN MANGLE(Color4ubVertex3fvSUN)
+#define glColor4ubv MANGLE(Color4ubv)
+#define glColor4ui MANGLE(Color4ui)
+#define glColor4uiv MANGLE(Color4uiv)
+#define glColor4us MANGLE(Color4us)
+#define glColor4usv MANGLE(Color4usv)
+#define glColorFragmentOp1ATI MANGLE(ColorFragmentOp1ATI)
+#define glColorFragmentOp2ATI MANGLE(ColorFragmentOp2ATI)
+#define glColorFragmentOp3ATI MANGLE(ColorFragmentOp3ATI)
+#define glColorMaskIndexedEXT MANGLE(ColorMaskIndexedEXT)
+#define glColorMask MANGLE(ColorMask)
+#define glColorMaterial MANGLE(ColorMaterial)
+#define glColorPointerEXT MANGLE(ColorPointerEXT)
+#define glColorPointerListIBM MANGLE(ColorPointerListIBM)
+#define glColorPointer MANGLE(ColorPointer)
+#define glColorPointervINTEL MANGLE(ColorPointervINTEL)
+#define glColorSubTableEXT MANGLE(ColorSubTableEXT)
+#define glColorSubTable MANGLE(ColorSubTable)
+#define glColorTableEXT MANGLE(ColorTableEXT)
+#define glColorTable MANGLE(ColorTable)
+#define glColorTableParameterfv MANGLE(ColorTableParameterfv)
+#define glColorTableParameterfvSGI MANGLE(ColorTableParameterfvSGI)
+#define glColorTableParameteriv MANGLE(ColorTableParameteriv)
+#define glColorTableParameterivSGI MANGLE(ColorTableParameterivSGI)
+#define glColorTableSGI MANGLE(ColorTableSGI)
+#define glCombinerInputNV MANGLE(CombinerInputNV)
+#define glCombinerOutputNV MANGLE(CombinerOutputNV)
+#define glCombinerParameterfNV MANGLE(CombinerParameterfNV)
+#define glCombinerParameterfvNV MANGLE(CombinerParameterfvNV)
+#define glCombinerParameteriNV MANGLE(CombinerParameteriNV)
+#define glCombinerParameterivNV MANGLE(CombinerParameterivNV)
+#define glCombinerStageParameterfvNV MANGLE(CombinerStageParameterfvNV)
+#define glCompileShaderARB MANGLE(CompileShaderARB)
+#define glCompileShader MANGLE(CompileShader)
+#define glCompressedTexImage1DARB MANGLE(CompressedTexImage1DARB)
+#define glCompressedTexImage1D MANGLE(CompressedTexImage1D)
+#define glCompressedTexImage2DARB MANGLE(CompressedTexImage2DARB)
+#define glCompressedTexImage2D MANGLE(CompressedTexImage2D)
+#define glCompressedTexImage3DARB MANGLE(CompressedTexImage3DARB)
+#define glCompressedTexImage3D MANGLE(CompressedTexImage3D)
+#define glCompressedTexSubImage1DARB MANGLE(CompressedTexSubImage1DARB)
+#define glCompressedTexSubImage1D MANGLE(CompressedTexSubImage1D)
+#define glCompressedTexSubImage2DARB MANGLE(CompressedTexSubImage2DARB)
+#define glCompressedTexSubImage2D MANGLE(CompressedTexSubImage2D)
+#define glCompressedTexSubImage3DARB MANGLE(CompressedTexSubImage3DARB)
+#define glCompressedTexSubImage3D MANGLE(CompressedTexSubImage3D)
+#define glConvolutionFilter1DEXT MANGLE(ConvolutionFilter1DEXT)
+#define glConvolutionFilter1D MANGLE(ConvolutionFilter1D)
+#define glConvolutionFilter2DEXT MANGLE(ConvolutionFilter2DEXT)
+#define glConvolutionFilter2D MANGLE(ConvolutionFilter2D)
+#define glConvolutionParameterfEXT MANGLE(ConvolutionParameterfEXT)
+#define glConvolutionParameterf MANGLE(ConvolutionParameterf)
+#define glConvolutionParameterfvEXT MANGLE(ConvolutionParameterfvEXT)
+#define glConvolutionParameterfv MANGLE(ConvolutionParameterfv)
+#define glConvolutionParameteriEXT MANGLE(ConvolutionParameteriEXT)
+#define glConvolutionParameteri MANGLE(ConvolutionParameteri)
+#define glConvolutionParameterivEXT MANGLE(ConvolutionParameterivEXT)
+#define glConvolutionParameteriv MANGLE(ConvolutionParameteriv)
+#define glCopyColorSubTableEXT MANGLE(CopyColorSubTableEXT)
+#define glCopyColorSubTable MANGLE(CopyColorSubTable)
+#define glCopyColorTable MANGLE(CopyColorTable)
+#define glCopyColorTableSGI MANGLE(CopyColorTableSGI)
+#define glCopyConvolutionFilter1DEXT MANGLE(CopyConvolutionFilter1DEXT)
+#define glCopyConvolutionFilter1D MANGLE(CopyConvolutionFilter1D)
+#define glCopyConvolutionFilter2DEXT MANGLE(CopyConvolutionFilter2DEXT)
+#define glCopyConvolutionFilter2D MANGLE(CopyConvolutionFilter2D)
+#define glCopyPixels MANGLE(CopyPixels)
+#define glCopyTexImage1DEXT MANGLE(CopyTexImage1DEXT)
+#define glCopyTexImage1D MANGLE(CopyTexImage1D)
+#define glCopyTexImage2DEXT MANGLE(CopyTexImage2DEXT)
+#define glCopyTexImage2D MANGLE(CopyTexImage2D)
+#define glCopyTexSubImage1DEXT MANGLE(CopyTexSubImage1DEXT)
+#define glCopyTexSubImage1D MANGLE(CopyTexSubImage1D)
+#define glCopyTexSubImage2DEXT MANGLE(CopyTexSubImage2DEXT)
+#define glCopyTexSubImage2D MANGLE(CopyTexSubImage2D)
+#define glCopyTexSubImage3DEXT MANGLE(CopyTexSubImage3DEXT)
+#define glCopyTexSubImage3D MANGLE(CopyTexSubImage3D)
+#define glCreateDebugObjectMESA MANGLE(CreateDebugObjectMESA)
+#define glCreateProgram MANGLE(CreateProgram)
+#define glCreateProgramObjectARB MANGLE(CreateProgramObjectARB)
+#define glCreateShader MANGLE(CreateShader)
+#define glCreateShaderObjectARB MANGLE(CreateShaderObjectARB)
+#define glCullFace MANGLE(CullFace)
+#define glCullParameterdvEXT MANGLE(CullParameterdvEXT)
+#define glCullParameterfvEXT MANGLE(CullParameterfvEXT)
+#define glCurrentPaletteMatrixARB MANGLE(CurrentPaletteMatrixARB)
+#define glDeformationMap3dSGIX MANGLE(DeformationMap3dSGIX)
+#define glDeformationMap3fSGIX MANGLE(DeformationMap3fSGIX)
+#define glDeformSGIX MANGLE(DeformSGIX)
+#define glDeleteAsyncMarkersSGIX MANGLE(DeleteAsyncMarkersSGIX)
+#define glDeleteBuffersARB MANGLE(DeleteBuffersARB)
+#define glDeleteBuffers MANGLE(DeleteBuffers)
+#define glDeleteFencesAPPLE MANGLE(DeleteFencesAPPLE)
+#define glDeleteFencesNV MANGLE(DeleteFencesNV)
+#define glDeleteFragmentShaderATI MANGLE(DeleteFragmentShaderATI)
+#define glDeleteFramebuffersEXT MANGLE(DeleteFramebuffersEXT)
+#define glDeleteLists MANGLE(DeleteLists)
+#define glDeleteObjectARB MANGLE(DeleteObjectARB)
+#define glDeleteOcclusionQueriesNV MANGLE(DeleteOcclusionQueriesNV)
+#define glDeleteProgram MANGLE(DeleteProgram)
+#define glDeleteProgramsARB MANGLE(DeleteProgramsARB)
+#define glDeleteProgramsNV MANGLE(DeleteProgramsNV)
+#define glDeleteQueriesARB MANGLE(DeleteQueriesARB)
+#define glDeleteQueries MANGLE(DeleteQueries)
+#define glDeleteRenderbuffersEXT MANGLE(DeleteRenderbuffersEXT)
+#define glDeleteShader MANGLE(DeleteShader)
+#define glDeleteTexturesEXT MANGLE(DeleteTexturesEXT)
+#define glDeleteTextures MANGLE(DeleteTextures)
+#define glDeleteVertexArraysAPPLE MANGLE(DeleteVertexArraysAPPLE)
+#define glDeleteVertexShaderEXT MANGLE(DeleteVertexShaderEXT)
+#define glDepthBoundsdNV MANGLE(DepthBoundsdNV)
+#define glDepthBoundsEXT MANGLE(DepthBoundsEXT)
+#define glDepthFunc MANGLE(DepthFunc)
+#define glDepthMask MANGLE(DepthMask)
+#define glDepthRangedNV MANGLE(DepthRangedNV)
+#define glDepthRange MANGLE(DepthRange)
+#define glDetachObjectARB MANGLE(DetachObjectARB)
+#define glDetachShader MANGLE(DetachShader)
+#define glDetailTexFuncSGIS MANGLE(DetailTexFuncSGIS)
+#define glDisableClientState MANGLE(DisableClientState)
+#define glDisableIndexedEXT MANGLE(DisableIndexedEXT)
+#define glDisable MANGLE(Disable)
+#define glDisableVariantClientStateEXT MANGLE(DisableVariantClientStateEXT)
+#define glDisableVertexAttribArrayARB MANGLE(DisableVertexAttribArrayARB)
+#define glDisableVertexAttribArray MANGLE(DisableVertexAttribArray)
+#define glDrawArraysEXT MANGLE(DrawArraysEXT)
+#define glDrawArraysInstancedEXT MANGLE(DrawArraysInstancedEXT)
+#define glDrawArrays MANGLE(DrawArrays)
+#define glDrawBuffer MANGLE(DrawBuffer)
+#define glDrawBuffersARB MANGLE(DrawBuffersARB)
+#define glDrawBuffersATI MANGLE(DrawBuffersATI)
+#define glDrawBuffers MANGLE(DrawBuffers)
+#define glDrawElementArrayAPPLE MANGLE(DrawElementArrayAPPLE)
+#define glDrawElementArrayATI MANGLE(DrawElementArrayATI)
+#define glDrawElementsInstancedEXT MANGLE(DrawElementsInstancedEXT)
+#define glDrawElements MANGLE(DrawElements)
+#define glDrawMeshArraysSUN MANGLE(DrawMeshArraysSUN)
+#define glDrawPixels MANGLE(DrawPixels)
+#define glDrawRangeElementArrayAPPLE MANGLE(DrawRangeElementArrayAPPLE)
+#define glDrawRangeElementArrayATI MANGLE(DrawRangeElementArrayATI)
+#define glDrawRangeElementsEXT MANGLE(DrawRangeElementsEXT)
+#define glDrawRangeElements MANGLE(DrawRangeElements)
+#define glEdgeFlag MANGLE(EdgeFlag)
+#define glEdgeFlagPointerEXT MANGLE(EdgeFlagPointerEXT)
+#define glEdgeFlagPointerListIBM MANGLE(EdgeFlagPointerListIBM)
+#define glEdgeFlagPointer MANGLE(EdgeFlagPointer)
+#define glEdgeFlagv MANGLE(EdgeFlagv)
+#define glElementPointerAPPLE MANGLE(ElementPointerAPPLE)
+#define glElementPointerATI MANGLE(ElementPointerATI)
+#define glEnableClientState MANGLE(EnableClientState)
+#define glEnableIndexedEXT MANGLE(EnableIndexedEXT)
+#define glEnable MANGLE(Enable)
+#define glEnableVariantClientStateEXT MANGLE(EnableVariantClientStateEXT)
+#define glEnableVertexAttribArrayARB MANGLE(EnableVertexAttribArrayARB)
+#define glEnableVertexAttribArray MANGLE(EnableVertexAttribArray)
+#define glEndFragmentShaderATI MANGLE(EndFragmentShaderATI)
+#define glEndList MANGLE(EndList)
+#define glEnd MANGLE(End)
+#define glEndOcclusionQueryNV MANGLE(EndOcclusionQueryNV)
+#define glEndQueryARB MANGLE(EndQueryARB)
+#define glEndQuery MANGLE(EndQuery)
+#define glEndTransformFeedbackNV MANGLE(EndTransformFeedbackNV)
+#define glEndVertexShaderEXT MANGLE(EndVertexShaderEXT)
+#define glEvalCoord1d MANGLE(EvalCoord1d)
+#define glEvalCoord1dv MANGLE(EvalCoord1dv)
+#define glEvalCoord1f MANGLE(EvalCoord1f)
+#define glEvalCoord1fv MANGLE(EvalCoord1fv)
+#define glEvalCoord2d MANGLE(EvalCoord2d)
+#define glEvalCoord2dv MANGLE(EvalCoord2dv)
+#define glEvalCoord2f MANGLE(EvalCoord2f)
+#define glEvalCoord2fv MANGLE(EvalCoord2fv)
+#define glEvalMapsNV MANGLE(EvalMapsNV)
+#define glEvalMesh1 MANGLE(EvalMesh1)
+#define glEvalMesh2 MANGLE(EvalMesh2)
+#define glEvalPoint1 MANGLE(EvalPoint1)
+#define glEvalPoint2 MANGLE(EvalPoint2)
+#define glExecuteProgramNV MANGLE(ExecuteProgramNV)
+#define glExtractComponentEXT MANGLE(ExtractComponentEXT)
+#define glFeedbackBuffer MANGLE(FeedbackBuffer)
+#define glFinalCombinerInputNV MANGLE(FinalCombinerInputNV)
+#define glFinishAsyncSGIX MANGLE(FinishAsyncSGIX)
+#define glFinishFenceAPPLE MANGLE(FinishFenceAPPLE)
+#define glFinishFenceNV MANGLE(FinishFenceNV)
+#define glFinish MANGLE(Finish)
+#define glFinishObjectAPPLE MANGLE(FinishObjectAPPLE)
+#define glFinishTextureSUNX MANGLE(FinishTextureSUNX)
+#define glFlush MANGLE(Flush)
+#define glFlushMappedBufferRangeAPPLE MANGLE(FlushMappedBufferRangeAPPLE)
+#define glFlushPixelDataRangeNV MANGLE(FlushPixelDataRangeNV)
+#define glFlushRasterSGIX MANGLE(FlushRasterSGIX)
+#define glFlushVertexArrayRangeAPPLE MANGLE(FlushVertexArrayRangeAPPLE)
+#define glFlushVertexArrayRangeNV MANGLE(FlushVertexArrayRangeNV)
+#define glFogCoorddEXT MANGLE(FogCoorddEXT)
+#define glFogCoordd MANGLE(FogCoordd)
+#define glFogCoorddvEXT MANGLE(FogCoorddvEXT)
+#define glFogCoorddv MANGLE(FogCoorddv)
+#define glFogCoordfEXT MANGLE(FogCoordfEXT)
+#define glFogCoordf MANGLE(FogCoordf)
+#define glFogCoordfvEXT MANGLE(FogCoordfvEXT)
+#define glFogCoordfv MANGLE(FogCoordfv)
+#define glFogCoordhNV MANGLE(FogCoordhNV)
+#define glFogCoordhvNV MANGLE(FogCoordhvNV)
+#define glFogCoordPointerEXT MANGLE(FogCoordPointerEXT)
+#define glFogCoordPointerListIBM MANGLE(FogCoordPointerListIBM)
+#define glFogCoordPointer MANGLE(FogCoordPointer)
+#define glFogf MANGLE(Fogf)
+#define glFogFuncSGIS MANGLE(FogFuncSGIS)
+#define glFogfv MANGLE(Fogfv)
+#define glFogi MANGLE(Fogi)
+#define glFogiv MANGLE(Fogiv)
+#define glFragmentColorMaterialSGIX MANGLE(FragmentColorMaterialSGIX)
+#define glFragmentLightfSGIX MANGLE(FragmentLightfSGIX)
+#define glFragmentLightfvSGIX MANGLE(FragmentLightfvSGIX)
+#define glFragmentLightiSGIX MANGLE(FragmentLightiSGIX)
+#define glFragmentLightivSGIX MANGLE(FragmentLightivSGIX)
+#define glFragmentLightModelfSGIX MANGLE(FragmentLightModelfSGIX)
+#define glFragmentLightModelfvSGIX MANGLE(FragmentLightModelfvSGIX)
+#define glFragmentLightModeliSGIX MANGLE(FragmentLightModeliSGIX)
+#define glFragmentLightModelivSGIX MANGLE(FragmentLightModelivSGIX)
+#define glFragmentMaterialfSGIX MANGLE(FragmentMaterialfSGIX)
+#define glFragmentMaterialfvSGIX MANGLE(FragmentMaterialfvSGIX)
+#define glFragmentMaterialiSGIX MANGLE(FragmentMaterialiSGIX)
+#define glFragmentMaterialivSGIX MANGLE(FragmentMaterialivSGIX)
+#define glFramebufferRenderbufferEXT MANGLE(FramebufferRenderbufferEXT)
+#define glFramebufferTexture1DEXT MANGLE(FramebufferTexture1DEXT)
+#define glFramebufferTexture2DEXT MANGLE(FramebufferTexture2DEXT)
+#define glFramebufferTexture3DEXT MANGLE(FramebufferTexture3DEXT)
+#define glFramebufferTextureEXT MANGLE(FramebufferTextureEXT)
+#define glFramebufferTextureFaceEXT MANGLE(FramebufferTextureFaceEXT)
+#define glFramebufferTextureLayerEXT MANGLE(FramebufferTextureLayerEXT)
+#define glFrameZoomSGIX MANGLE(FrameZoomSGIX)
+#define glFreeObjectBufferATI MANGLE(FreeObjectBufferATI)
+#define glFrontFace MANGLE(FrontFace)
+#define glFrustum MANGLE(Frustum)
+#define glGenAsyncMarkersSGIX MANGLE(GenAsyncMarkersSGIX)
+#define glGenBuffersARB MANGLE(GenBuffersARB)
+#define glGenBuffers MANGLE(GenBuffers)
+#define glGenerateMipmapEXT MANGLE(GenerateMipmapEXT)
+#define glGenFencesAPPLE MANGLE(GenFencesAPPLE)
+#define glGenFencesNV MANGLE(GenFencesNV)
+#define glGenFragmentShadersATI MANGLE(GenFragmentShadersATI)
+#define glGenFramebuffersEXT MANGLE(GenFramebuffersEXT)
+#define glGenLists MANGLE(GenLists)
+#define glGenOcclusionQueriesNV MANGLE(GenOcclusionQueriesNV)
+#define glGenProgramsARB MANGLE(GenProgramsARB)
+#define glGenProgramsNV MANGLE(GenProgramsNV)
+#define glGenQueriesARB MANGLE(GenQueriesARB)
+#define glGenQueries MANGLE(GenQueries)
+#define glGenRenderbuffersEXT MANGLE(GenRenderbuffersEXT)
+#define glGenSymbolsEXT MANGLE(GenSymbolsEXT)
+#define glGenTexturesEXT MANGLE(GenTexturesEXT)
+#define glGenTextures MANGLE(GenTextures)
+#define glGenVertexArraysAPPLE MANGLE(GenVertexArraysAPPLE)
+#define glGenVertexShadersEXT MANGLE(GenVertexShadersEXT)
+#define glGetActiveAttribARB MANGLE(GetActiveAttribARB)
+#define glGetActiveAttrib MANGLE(GetActiveAttrib)
+#define glGetActiveUniformARB MANGLE(GetActiveUniformARB)
+#define glGetActiveUniform MANGLE(GetActiveUniform)
+#define glGetActiveVaryingNV MANGLE(GetActiveVaryingNV)
+#define glGetArrayObjectfvATI MANGLE(GetArrayObjectfvATI)
+#define glGetArrayObjectivATI MANGLE(GetArrayObjectivATI)
+#define glGetAttachedObjectsARB MANGLE(GetAttachedObjectsARB)
+#define glGetAttachedShaders MANGLE(GetAttachedShaders)
+#define glGetAttribLocationARB MANGLE(GetAttribLocationARB)
+#define glGetAttribLocation MANGLE(GetAttribLocation)
+#define glGetBooleanIndexedvEXT MANGLE(GetBooleanIndexedvEXT)
+#define glGetBooleanv MANGLE(GetBooleanv)
+#define glGetBufferParameterivARB MANGLE(GetBufferParameterivARB)
+#define glGetBufferParameteriv MANGLE(GetBufferParameteriv)
+#define glGetBufferPointervARB MANGLE(GetBufferPointervARB)
+#define glGetBufferPointerv MANGLE(GetBufferPointerv)
+#define glGetBufferSubDataARB MANGLE(GetBufferSubDataARB)
+#define glGetBufferSubData MANGLE(GetBufferSubData)
+#define glGetClipPlane MANGLE(GetClipPlane)
+#define glGetColorTableEXT MANGLE(GetColorTableEXT)
+#define glGetColorTable MANGLE(GetColorTable)
+#define glGetColorTableParameterfvEXT MANGLE(GetColorTableParameterfvEXT)
+#define glGetColorTableParameterfv MANGLE(GetColorTableParameterfv)
+#define glGetColorTableParameterfvSGI MANGLE(GetColorTableParameterfvSGI)
+#define glGetColorTableParameterivEXT MANGLE(GetColorTableParameterivEXT)
+#define glGetColorTableParameteriv MANGLE(GetColorTableParameteriv)
+#define glGetColorTableParameterivSGI MANGLE(GetColorTableParameterivSGI)
+#define glGetColorTableSGI MANGLE(GetColorTableSGI)
+#define glGetCombinerInputParameterfvNV MANGLE(GetCombinerInputParameterfvNV)
+#define glGetCombinerInputParameterivNV MANGLE(GetCombinerInputParameterivNV)
+#define glGetCombinerOutputParameterfvNV MANGLE(GetCombinerOutputParameterfvNV)
+#define glGetCombinerOutputParameterivNV MANGLE(GetCombinerOutputParameterivNV)
+#define glGetCombinerStageParameterfvNV MANGLE(GetCombinerStageParameterfvNV)
+#define glGetCompressedTexImageARB MANGLE(GetCompressedTexImageARB)
+#define glGetCompressedTexImage MANGLE(GetCompressedTexImage)
+#define glGetConvolutionFilterEXT MANGLE(GetConvolutionFilterEXT)
+#define glGetConvolutionFilter MANGLE(GetConvolutionFilter)
+#define glGetConvolutionParameterfvEXT MANGLE(GetConvolutionParameterfvEXT)
+#define glGetConvolutionParameterfv MANGLE(GetConvolutionParameterfv)
+#define glGetConvolutionParameterivEXT MANGLE(GetConvolutionParameterivEXT)
+#define glGetConvolutionParameteriv MANGLE(GetConvolutionParameteriv)
+#define glGetDebugLogLengthMESA MANGLE(GetDebugLogLengthMESA)
+#define glGetDebugLogMESA MANGLE(GetDebugLogMESA)
+#define glGetDetailTexFuncSGIS MANGLE(GetDetailTexFuncSGIS)
+#define glGetDoublev MANGLE(GetDoublev)
+#define glGetError MANGLE(GetError)
+#define glGetFenceivNV MANGLE(GetFenceivNV)
+#define glGetFinalCombinerInputParameterfvNV MANGLE(GetFinalCombinerInputParameterfvNV)
+#define glGetFinalCombinerInputParameterivNV MANGLE(GetFinalCombinerInputParameterivNV)
+#define glGetFloatv MANGLE(GetFloatv)
+#define glGetFogFuncSGIS MANGLE(GetFogFuncSGIS)
+#define glGetFragDataLocationEXT MANGLE(GetFragDataLocationEXT)
+#define glGetFragmentLightfvSGIX MANGLE(GetFragmentLightfvSGIX)
+#define glGetFragmentLightivSGIX MANGLE(GetFragmentLightivSGIX)
+#define glGetFragmentMaterialfvSGIX MANGLE(GetFragmentMaterialfvSGIX)
+#define glGetFragmentMaterialivSGIX MANGLE(GetFragmentMaterialivSGIX)
+#define glGetFramebufferAttachmentParameterivEXT MANGLE(GetFramebufferAttachmentParameterivEXT)
+#define glGetHandleARB MANGLE(GetHandleARB)
+#define glGetHistogramEXT MANGLE(GetHistogramEXT)
+#define glGetHistogram MANGLE(GetHistogram)
+#define glGetHistogramParameterfvEXT MANGLE(GetHistogramParameterfvEXT)
+#define glGetHistogramParameterfv MANGLE(GetHistogramParameterfv)
+#define glGetHistogramParameterivEXT MANGLE(GetHistogramParameterivEXT)
+#define glGetHistogramParameteriv MANGLE(GetHistogramParameteriv)
+#define glGetImageTransformParameterfvHP MANGLE(GetImageTransformParameterfvHP)
+#define glGetImageTransformParameterivHP MANGLE(GetImageTransformParameterivHP)
+#define glGetInfoLogARB MANGLE(GetInfoLogARB)
+#define glGetInstrumentsSGIX MANGLE(GetInstrumentsSGIX)
+#define glGetIntegerIndexedvEXT MANGLE(GetIntegerIndexedvEXT)
+#define glGetIntegerv MANGLE(GetIntegerv)
+#define glGetInvariantBooleanvEXT MANGLE(GetInvariantBooleanvEXT)
+#define glGetInvariantFloatvEXT MANGLE(GetInvariantFloatvEXT)
+#define glGetInvariantIntegervEXT MANGLE(GetInvariantIntegervEXT)
+#define glGetLightfv MANGLE(GetLightfv)
+#define glGetLightiv MANGLE(GetLightiv)
+#define glGetListParameterfvSGIX MANGLE(GetListParameterfvSGIX)
+#define glGetListParameterivSGIX MANGLE(GetListParameterivSGIX)
+#define glGetLocalConstantBooleanvEXT MANGLE(GetLocalConstantBooleanvEXT)
+#define glGetLocalConstantFloatvEXT MANGLE(GetLocalConstantFloatvEXT)
+#define glGetLocalConstantIntegervEXT MANGLE(GetLocalConstantIntegervEXT)
+#define glGetMapAttribParameterfvNV MANGLE(GetMapAttribParameterfvNV)
+#define glGetMapAttribParameterivNV MANGLE(GetMapAttribParameterivNV)
+#define glGetMapControlPointsNV MANGLE(GetMapControlPointsNV)
+#define glGetMapdv MANGLE(GetMapdv)
+#define glGetMapfv MANGLE(GetMapfv)
+#define glGetMapiv MANGLE(GetMapiv)
+#define glGetMapParameterfvNV MANGLE(GetMapParameterfvNV)
+#define glGetMapParameterivNV MANGLE(GetMapParameterivNV)
+#define glGetMaterialfv MANGLE(GetMaterialfv)
+#define glGetMaterialiv MANGLE(GetMaterialiv)
+#define glGetMinmaxEXT MANGLE(GetMinmaxEXT)
+#define glGetMinmax MANGLE(GetMinmax)
+#define glGetMinmaxParameterfvEXT MANGLE(GetMinmaxParameterfvEXT)
+#define glGetMinmaxParameterfv MANGLE(GetMinmaxParameterfv)
+#define glGetMinmaxParameterivEXT MANGLE(GetMinmaxParameterivEXT)
+#define glGetMinmaxParameteriv MANGLE(GetMinmaxParameteriv)
+#define glGetObjectBufferfvATI MANGLE(GetObjectBufferfvATI)
+#define glGetObjectBufferivATI MANGLE(GetObjectBufferivATI)
+#define glGetObjectParameterfvARB MANGLE(GetObjectParameterfvARB)
+#define glGetObjectParameterivARB MANGLE(GetObjectParameterivARB)
+#define glGetOcclusionQueryivNV MANGLE(GetOcclusionQueryivNV)
+#define glGetOcclusionQueryuivNV MANGLE(GetOcclusionQueryuivNV)
+#define glGetPixelMapfv MANGLE(GetPixelMapfv)
+#define glGetPixelMapuiv MANGLE(GetPixelMapuiv)
+#define glGetPixelMapusv MANGLE(GetPixelMapusv)
+#define glGetPixelTexGenParameterfvSGIS MANGLE(GetPixelTexGenParameterfvSGIS)
+#define glGetPixelTexGenParameterivSGIS MANGLE(GetPixelTexGenParameterivSGIS)
+#define glGetPointervEXT MANGLE(GetPointervEXT)
+#define glGetPointerv MANGLE(GetPointerv)
+#define glGetPolygonStipple MANGLE(GetPolygonStipple)
+#define glGetProgramEnvParameterdvARB MANGLE(GetProgramEnvParameterdvARB)
+#define glGetProgramEnvParameterfvARB MANGLE(GetProgramEnvParameterfvARB)
+#define glGetProgramEnvParameterIivNV MANGLE(GetProgramEnvParameterIivNV)
+#define glGetProgramEnvParameterIuivNV MANGLE(GetProgramEnvParameterIuivNV)
+#define glGetProgramInfoLog MANGLE(GetProgramInfoLog)
+#define glGetProgramivARB MANGLE(GetProgramivARB)
+#define glGetProgramiv MANGLE(GetProgramiv)
+#define glGetProgramivNV MANGLE(GetProgramivNV)
+#define glGetProgramLocalParameterdvARB MANGLE(GetProgramLocalParameterdvARB)
+#define glGetProgramLocalParameterfvARB MANGLE(GetProgramLocalParameterfvARB)
+#define glGetProgramLocalParameterIivNV MANGLE(GetProgramLocalParameterIivNV)
+#define glGetProgramLocalParameterIuivNV MANGLE(GetProgramLocalParameterIuivNV)
+#define glGetProgramNamedParameterdvNV MANGLE(GetProgramNamedParameterdvNV)
+#define glGetProgramNamedParameterfvNV MANGLE(GetProgramNamedParameterfvNV)
+#define glGetProgramParameterdvNV MANGLE(GetProgramParameterdvNV)
+#define glGetProgramParameterfvNV MANGLE(GetProgramParameterfvNV)
+#define glGetProgramRegisterfvMESA MANGLE(GetProgramRegisterfvMESA)
+#define glGetProgramStringARB MANGLE(GetProgramStringARB)
+#define glGetProgramStringNV MANGLE(GetProgramStringNV)
+#define glGetQueryivARB MANGLE(GetQueryivARB)
+#define glGetQueryiv MANGLE(GetQueryiv)
+#define glGetQueryObjecti64vEXT MANGLE(GetQueryObjecti64vEXT)
+#define glGetQueryObjectivARB MANGLE(GetQueryObjectivARB)
+#define glGetQueryObjectiv MANGLE(GetQueryObjectiv)
+#define glGetQueryObjectui64vEXT MANGLE(GetQueryObjectui64vEXT)
+#define glGetQueryObjectuivARB MANGLE(GetQueryObjectuivARB)
+#define glGetQueryObjectuiv MANGLE(GetQueryObjectuiv)
+#define glGetRenderbufferParameterivEXT MANGLE(GetRenderbufferParameterivEXT)
+#define glGetSeparableFilterEXT MANGLE(GetSeparableFilterEXT)
+#define glGetSeparableFilter MANGLE(GetSeparableFilter)
+#define glGetShaderInfoLog MANGLE(GetShaderInfoLog)
+#define glGetShaderiv MANGLE(GetShaderiv)
+#define glGetShaderSourceARB MANGLE(GetShaderSourceARB)
+#define glGetShaderSource MANGLE(GetShaderSource)
+#define glGetSharpenTexFuncSGIS MANGLE(GetSharpenTexFuncSGIS)
+#define glGetString MANGLE(GetString)
+#define glGetTexBumpParameterfvATI MANGLE(GetTexBumpParameterfvATI)
+#define glGetTexBumpParameterivATI MANGLE(GetTexBumpParameterivATI)
+#define glGetTexEnvfv MANGLE(GetTexEnvfv)
+#define glGetTexEnviv MANGLE(GetTexEnviv)
+#define glGetTexFilterFuncSGIS MANGLE(GetTexFilterFuncSGIS)
+#define glGetTexGendv MANGLE(GetTexGendv)
+#define glGetTexGenfv MANGLE(GetTexGenfv)
+#define glGetTexGeniv MANGLE(GetTexGeniv)
+#define glGetTexImage MANGLE(GetTexImage)
+#define glGetTexLevelParameterfv MANGLE(GetTexLevelParameterfv)
+#define glGetTexLevelParameteriv MANGLE(GetTexLevelParameteriv)
+#define glGetTexParameterfv MANGLE(GetTexParameterfv)
+#define glGetTexParameterIivEXT MANGLE(GetTexParameterIivEXT)
+#define glGetTexParameterIuivEXT MANGLE(GetTexParameterIuivEXT)
+#define glGetTexParameteriv MANGLE(GetTexParameteriv)
+#define glGetTrackMatrixivNV MANGLE(GetTrackMatrixivNV)
+#define glGetTransformFeedbackVaryingNV MANGLE(GetTransformFeedbackVaryingNV)
+#define glGetUniformBufferSizeEXT MANGLE(GetUniformBufferSizeEXT)
+#define glGetUniformfvARB MANGLE(GetUniformfvARB)
+#define glGetUniformfv MANGLE(GetUniformfv)
+#define glGetUniformivARB MANGLE(GetUniformivARB)
+#define glGetUniformiv MANGLE(GetUniformiv)
+#define glGetUniformLocationARB MANGLE(GetUniformLocationARB)
+#define glGetUniformLocation MANGLE(GetUniformLocation)
+#define glGetUniformOffsetEXT MANGLE(GetUniformOffsetEXT)
+#define glGetUniformuivEXT MANGLE(GetUniformuivEXT)
+#define glGetVariantArrayObjectfvATI MANGLE(GetVariantArrayObjectfvATI)
+#define glGetVariantArrayObjectivATI MANGLE(GetVariantArrayObjectivATI)
+#define glGetVariantBooleanvEXT MANGLE(GetVariantBooleanvEXT)
+#define glGetVariantFloatvEXT MANGLE(GetVariantFloatvEXT)
+#define glGetVariantIntegervEXT MANGLE(GetVariantIntegervEXT)
+#define glGetVariantPointervEXT MANGLE(GetVariantPointervEXT)
+#define glGetVaryingLocationNV MANGLE(GetVaryingLocationNV)
+#define glGetVertexAttribArrayObjectfvATI MANGLE(GetVertexAttribArrayObjectfvATI)
+#define glGetVertexAttribArrayObjectivATI MANGLE(GetVertexAttribArrayObjectivATI)
+#define glGetVertexAttribdvARB MANGLE(GetVertexAttribdvARB)
+#define glGetVertexAttribdv MANGLE(GetVertexAttribdv)
+#define glGetVertexAttribdvNV MANGLE(GetVertexAttribdvNV)
+#define glGetVertexAttribfvARB MANGLE(GetVertexAttribfvARB)
+#define glGetVertexAttribfv MANGLE(GetVertexAttribfv)
+#define glGetVertexAttribfvNV MANGLE(GetVertexAttribfvNV)
+#define glGetVertexAttribIivEXT MANGLE(GetVertexAttribIivEXT)
+#define glGetVertexAttribIuivEXT MANGLE(GetVertexAttribIuivEXT)
+#define glGetVertexAttribivARB MANGLE(GetVertexAttribivARB)
+#define glGetVertexAttribiv MANGLE(GetVertexAttribiv)
+#define glGetVertexAttribivNV MANGLE(GetVertexAttribivNV)
+#define glGetVertexAttribPointervARB MANGLE(GetVertexAttribPointervARB)
+#define glGetVertexAttribPointerv MANGLE(GetVertexAttribPointerv)
+#define glGetVertexAttribPointervNV MANGLE(GetVertexAttribPointervNV)
+#define glGlobalAlphaFactorbSUN MANGLE(GlobalAlphaFactorbSUN)
+#define glGlobalAlphaFactordSUN MANGLE(GlobalAlphaFactordSUN)
+#define glGlobalAlphaFactorfSUN MANGLE(GlobalAlphaFactorfSUN)
+#define glGlobalAlphaFactoriSUN MANGLE(GlobalAlphaFactoriSUN)
+#define glGlobalAlphaFactorsSUN MANGLE(GlobalAlphaFactorsSUN)
+#define glGlobalAlphaFactorubSUN MANGLE(GlobalAlphaFactorubSUN)
+#define glGlobalAlphaFactoruiSUN MANGLE(GlobalAlphaFactoruiSUN)
+#define glGlobalAlphaFactorusSUN MANGLE(GlobalAlphaFactorusSUN)
+#define glHint MANGLE(Hint)
+#define glHintPGI MANGLE(HintPGI)
+#define glHistogramEXT MANGLE(HistogramEXT)
+#define glHistogram MANGLE(Histogram)
+#define glIglooInterfaceSGIX MANGLE(IglooInterfaceSGIX)
+#define glImageTransformParameterfHP MANGLE(ImageTransformParameterfHP)
+#define glImageTransformParameterfvHP MANGLE(ImageTransformParameterfvHP)
+#define glImageTransformParameteriHP MANGLE(ImageTransformParameteriHP)
+#define glImageTransformParameterivHP MANGLE(ImageTransformParameterivHP)
+#define glIndexd MANGLE(Indexd)
+#define glIndexdv MANGLE(Indexdv)
+#define glIndexf MANGLE(Indexf)
+#define glIndexFuncEXT MANGLE(IndexFuncEXT)
+#define glIndexfv MANGLE(Indexfv)
+#define glIndexi MANGLE(Indexi)
+#define glIndexiv MANGLE(Indexiv)
+#define glIndexMask MANGLE(IndexMask)
+#define glIndexMaterialEXT MANGLE(IndexMaterialEXT)
+#define glIndexPointerEXT MANGLE(IndexPointerEXT)
+#define glIndexPointerListIBM MANGLE(IndexPointerListIBM)
+#define glIndexPointer MANGLE(IndexPointer)
+#define glIndexs MANGLE(Indexs)
+#define glIndexsv MANGLE(Indexsv)
+#define glIndexub MANGLE(Indexub)
+#define glIndexubv MANGLE(Indexubv)
+#define glInitNames MANGLE(InitNames)
+#define glInsertComponentEXT MANGLE(InsertComponentEXT)
+#define glInstrumentsBufferSGIX MANGLE(InstrumentsBufferSGIX)
+#define glInterleavedArrays MANGLE(InterleavedArrays)
+#define glIsAsyncMarkerSGIX MANGLE(IsAsyncMarkerSGIX)
+#define glIsBufferARB MANGLE(IsBufferARB)
+#define glIsBuffer MANGLE(IsBuffer)
+#define glIsEnabledIndexedEXT MANGLE(IsEnabledIndexedEXT)
+#define glIsEnabled MANGLE(IsEnabled)
+#define glIsFenceAPPLE MANGLE(IsFenceAPPLE)
+#define glIsFenceNV MANGLE(IsFenceNV)
+#define glIsFramebufferEXT MANGLE(IsFramebufferEXT)
+#define glIsList MANGLE(IsList)
+#define glIsObjectBufferATI MANGLE(IsObjectBufferATI)
+#define glIsOcclusionQueryNV MANGLE(IsOcclusionQueryNV)
+#define glIsProgramARB MANGLE(IsProgramARB)
+#define glIsProgram MANGLE(IsProgram)
+#define glIsProgramNV MANGLE(IsProgramNV)
+#define glIsQueryARB MANGLE(IsQueryARB)
+#define glIsQuery MANGLE(IsQuery)
+#define glIsRenderbufferEXT MANGLE(IsRenderbufferEXT)
+#define glIsShader MANGLE(IsShader)
+#define glIsTextureEXT MANGLE(IsTextureEXT)
+#define glIsTexture MANGLE(IsTexture)
+#define glIsVariantEnabledEXT MANGLE(IsVariantEnabledEXT)
+#define glIsVertexArrayAPPLE MANGLE(IsVertexArrayAPPLE)
+#define glLightEnviSGIX MANGLE(LightEnviSGIX)
+#define glLightf MANGLE(Lightf)
+#define glLightfv MANGLE(Lightfv)
+#define glLighti MANGLE(Lighti)
+#define glLightiv MANGLE(Lightiv)
+#define glLightModelf MANGLE(LightModelf)
+#define glLightModelfv MANGLE(LightModelfv)
+#define glLightModeli MANGLE(LightModeli)
+#define glLightModeliv MANGLE(LightModeliv)
+#define glLineStipple MANGLE(LineStipple)
+#define glLineWidth MANGLE(LineWidth)
+#define glLinkProgramARB MANGLE(LinkProgramARB)
+#define glLinkProgram MANGLE(LinkProgram)
+#define glListBase MANGLE(ListBase)
+#define glListParameterfSGIX MANGLE(ListParameterfSGIX)
+#define glListParameterfvSGIX MANGLE(ListParameterfvSGIX)
+#define glListParameteriSGIX MANGLE(ListParameteriSGIX)
+#define glListParameterivSGIX MANGLE(ListParameterivSGIX)
+#define glLoadIdentityDeformationMapSGIX MANGLE(LoadIdentityDeformationMapSGIX)
+#define glLoadIdentity MANGLE(LoadIdentity)
+#define glLoadMatrixd MANGLE(LoadMatrixd)
+#define glLoadMatrixf MANGLE(LoadMatrixf)
+#define glLoadName MANGLE(LoadName)
+#define glLoadProgramNV MANGLE(LoadProgramNV)
+#define glLoadTransposeMatrixdARB MANGLE(LoadTransposeMatrixdARB)
+#define glLoadTransposeMatrixd MANGLE(LoadTransposeMatrixd)
+#define glLoadTransposeMatrixfARB MANGLE(LoadTransposeMatrixfARB)
+#define glLoadTransposeMatrixf MANGLE(LoadTransposeMatrixf)
+#define glLockArraysEXT MANGLE(LockArraysEXT)
+#define glLogicOp MANGLE(LogicOp)
+#define glMap1d MANGLE(Map1d)
+#define glMap1f MANGLE(Map1f)
+#define glMap2d MANGLE(Map2d)
+#define glMap2f MANGLE(Map2f)
+#define glMapBufferARB MANGLE(MapBufferARB)
+#define glMapBuffer MANGLE(MapBuffer)
+#define glMapControlPointsNV MANGLE(MapControlPointsNV)
+#define glMapGrid1d MANGLE(MapGrid1d)
+#define glMapGrid1f MANGLE(MapGrid1f)
+#define glMapGrid2d MANGLE(MapGrid2d)
+#define glMapGrid2f MANGLE(MapGrid2f)
+#define glMapObjectBufferATI MANGLE(MapObjectBufferATI)
+#define glMapParameterfvNV MANGLE(MapParameterfvNV)
+#define glMapParameterivNV MANGLE(MapParameterivNV)
+#define glMaterialf MANGLE(Materialf)
+#define glMaterialfv MANGLE(Materialfv)
+#define glMateriali MANGLE(Materiali)
+#define glMaterialiv MANGLE(Materialiv)
+#define glMatrixIndexPointerARB MANGLE(MatrixIndexPointerARB)
+#define glMatrixIndexubvARB MANGLE(MatrixIndexubvARB)
+#define glMatrixIndexuivARB MANGLE(MatrixIndexuivARB)
+#define glMatrixIndexusvARB MANGLE(MatrixIndexusvARB)
+#define glMatrixMode MANGLE(MatrixMode)
+#define glMinmaxEXT MANGLE(MinmaxEXT)
+#define glMinmax MANGLE(Minmax)
+#define glMultiDrawArraysEXT MANGLE(MultiDrawArraysEXT)
+#define glMultiDrawArrays MANGLE(MultiDrawArrays)
+#define glMultiDrawElementArrayAPPLE MANGLE(MultiDrawElementArrayAPPLE)
+#define glMultiDrawElementsEXT MANGLE(MultiDrawElementsEXT)
+#define glMultiDrawElements MANGLE(MultiDrawElements)
+#define glMultiDrawRangeElementArrayAPPLE MANGLE(MultiDrawRangeElementArrayAPPLE)
+#define glMultiModeDrawArraysIBM MANGLE(MultiModeDrawArraysIBM)
+#define glMultiModeDrawElementsIBM MANGLE(MultiModeDrawElementsIBM)
+#define glMultiTexCoord1dARB MANGLE(MultiTexCoord1dARB)
+#define glMultiTexCoord1d MANGLE(MultiTexCoord1d)
+#define glMultiTexCoord1dvARB MANGLE(MultiTexCoord1dvARB)
+#define glMultiTexCoord1dv MANGLE(MultiTexCoord1dv)
+#define glMultiTexCoord1fARB MANGLE(MultiTexCoord1fARB)
+#define glMultiTexCoord1f MANGLE(MultiTexCoord1f)
+#define glMultiTexCoord1fvARB MANGLE(MultiTexCoord1fvARB)
+#define glMultiTexCoord1fv MANGLE(MultiTexCoord1fv)
+#define glMultiTexCoord1hNV MANGLE(MultiTexCoord1hNV)
+#define glMultiTexCoord1hvNV MANGLE(MultiTexCoord1hvNV)
+#define glMultiTexCoord1iARB MANGLE(MultiTexCoord1iARB)
+#define glMultiTexCoord1i MANGLE(MultiTexCoord1i)
+#define glMultiTexCoord1ivARB MANGLE(MultiTexCoord1ivARB)
+#define glMultiTexCoord1iv MANGLE(MultiTexCoord1iv)
+#define glMultiTexCoord1sARB MANGLE(MultiTexCoord1sARB)
+#define glMultiTexCoord1s MANGLE(MultiTexCoord1s)
+#define glMultiTexCoord1svARB MANGLE(MultiTexCoord1svARB)
+#define glMultiTexCoord1sv MANGLE(MultiTexCoord1sv)
+#define glMultiTexCoord2dARB MANGLE(MultiTexCoord2dARB)
+#define glMultiTexCoord2d MANGLE(MultiTexCoord2d)
+#define glMultiTexCoord2dvARB MANGLE(MultiTexCoord2dvARB)
+#define glMultiTexCoord2dv MANGLE(MultiTexCoord2dv)
+#define glMultiTexCoord2fARB MANGLE(MultiTexCoord2fARB)
+#define glMultiTexCoord2f MANGLE(MultiTexCoord2f)
+#define glMultiTexCoord2fvARB MANGLE(MultiTexCoord2fvARB)
+#define glMultiTexCoord2fv MANGLE(MultiTexCoord2fv)
+#define glMultiTexCoord2hNV MANGLE(MultiTexCoord2hNV)
+#define glMultiTexCoord2hvNV MANGLE(MultiTexCoord2hvNV)
+#define glMultiTexCoord2iARB MANGLE(MultiTexCoord2iARB)
+#define glMultiTexCoord2i MANGLE(MultiTexCoord2i)
+#define glMultiTexCoord2ivARB MANGLE(MultiTexCoord2ivARB)
+#define glMultiTexCoord2iv MANGLE(MultiTexCoord2iv)
+#define glMultiTexCoord2sARB MANGLE(MultiTexCoord2sARB)
+#define glMultiTexCoord2s MANGLE(MultiTexCoord2s)
+#define glMultiTexCoord2svARB MANGLE(MultiTexCoord2svARB)
+#define glMultiTexCoord2sv MANGLE(MultiTexCoord2sv)
+#define glMultiTexCoord3dARB MANGLE(MultiTexCoord3dARB)
+#define glMultiTexCoord3d MANGLE(MultiTexCoord3d)
+#define glMultiTexCoord3dvARB MANGLE(MultiTexCoord3dvARB)
+#define glMultiTexCoord3dv MANGLE(MultiTexCoord3dv)
+#define glMultiTexCoord3fARB MANGLE(MultiTexCoord3fARB)
+#define glMultiTexCoord3f MANGLE(MultiTexCoord3f)
+#define glMultiTexCoord3fvARB MANGLE(MultiTexCoord3fvARB)
+#define glMultiTexCoord3fv MANGLE(MultiTexCoord3fv)
+#define glMultiTexCoord3hNV MANGLE(MultiTexCoord3hNV)
+#define glMultiTexCoord3hvNV MANGLE(MultiTexCoord3hvNV)
+#define glMultiTexCoord3iARB MANGLE(MultiTexCoord3iARB)
+#define glMultiTexCoord3i MANGLE(MultiTexCoord3i)
+#define glMultiTexCoord3ivARB MANGLE(MultiTexCoord3ivARB)
+#define glMultiTexCoord3iv MANGLE(MultiTexCoord3iv)
+#define glMultiTexCoord3sARB MANGLE(MultiTexCoord3sARB)
+#define glMultiTexCoord3s MANGLE(MultiTexCoord3s)
+#define glMultiTexCoord3svARB MANGLE(MultiTexCoord3svARB)
+#define glMultiTexCoord3sv MANGLE(MultiTexCoord3sv)
+#define glMultiTexCoord4dARB MANGLE(MultiTexCoord4dARB)
+#define glMultiTexCoord4d MANGLE(MultiTexCoord4d)
+#define glMultiTexCoord4dvARB MANGLE(MultiTexCoord4dvARB)
+#define glMultiTexCoord4dv MANGLE(MultiTexCoord4dv)
+#define glMultiTexCoord4fARB MANGLE(MultiTexCoord4fARB)
+#define glMultiTexCoord4f MANGLE(MultiTexCoord4f)
+#define glMultiTexCoord4fvARB MANGLE(MultiTexCoord4fvARB)
+#define glMultiTexCoord4fv MANGLE(MultiTexCoord4fv)
+#define glMultiTexCoord4hNV MANGLE(MultiTexCoord4hNV)
+#define glMultiTexCoord4hvNV MANGLE(MultiTexCoord4hvNV)
+#define glMultiTexCoord4iARB MANGLE(MultiTexCoord4iARB)
+#define glMultiTexCoord4i MANGLE(MultiTexCoord4i)
+#define glMultiTexCoord4ivARB MANGLE(MultiTexCoord4ivARB)
+#define glMultiTexCoord4iv MANGLE(MultiTexCoord4iv)
+#define glMultiTexCoord4sARB MANGLE(MultiTexCoord4sARB)
+#define glMultiTexCoord4s MANGLE(MultiTexCoord4s)
+#define glMultiTexCoord4svARB MANGLE(MultiTexCoord4svARB)
+#define glMultiTexCoord4sv MANGLE(MultiTexCoord4sv)
+#define glMultMatrixd MANGLE(MultMatrixd)
+#define glMultMatrixf MANGLE(MultMatrixf)
+#define glMultTransposeMatrixdARB MANGLE(MultTransposeMatrixdARB)
+#define glMultTransposeMatrixd MANGLE(MultTransposeMatrixd)
+#define glMultTransposeMatrixfARB MANGLE(MultTransposeMatrixfARB)
+#define glMultTransposeMatrixf MANGLE(MultTransposeMatrixf)
+#define glNewList MANGLE(NewList)
+#define glNewObjectBufferATI MANGLE(NewObjectBufferATI)
+#define glNormal3b MANGLE(Normal3b)
+#define glNormal3bv MANGLE(Normal3bv)
+#define glNormal3d MANGLE(Normal3d)
+#define glNormal3dv MANGLE(Normal3dv)
+#define glNormal3f MANGLE(Normal3f)
+#define glNormal3fVertex3fSUN MANGLE(Normal3fVertex3fSUN)
+#define glNormal3fVertex3fvSUN MANGLE(Normal3fVertex3fvSUN)
+#define glNormal3fv MANGLE(Normal3fv)
+#define glNormal3hNV MANGLE(Normal3hNV)
+#define glNormal3hvNV MANGLE(Normal3hvNV)
+#define glNormal3i MANGLE(Normal3i)
+#define glNormal3iv MANGLE(Normal3iv)
+#define glNormal3s MANGLE(Normal3s)
+#define glNormal3sv MANGLE(Normal3sv)
+#define glNormalPointerEXT MANGLE(NormalPointerEXT)
+#define glNormalPointerListIBM MANGLE(NormalPointerListIBM)
+#define glNormalPointer MANGLE(NormalPointer)
+#define glNormalPointervINTEL MANGLE(NormalPointervINTEL)
+#define glNormalStream3bATI MANGLE(NormalStream3bATI)
+#define glNormalStream3bvATI MANGLE(NormalStream3bvATI)
+#define glNormalStream3dATI MANGLE(NormalStream3dATI)
+#define glNormalStream3dvATI MANGLE(NormalStream3dvATI)
+#define glNormalStream3fATI MANGLE(NormalStream3fATI)
+#define glNormalStream3fvATI MANGLE(NormalStream3fvATI)
+#define glNormalStream3iATI MANGLE(NormalStream3iATI)
+#define glNormalStream3ivATI MANGLE(NormalStream3ivATI)
+#define glNormalStream3sATI MANGLE(NormalStream3sATI)
+#define glNormalStream3svATI MANGLE(NormalStream3svATI)
+#define glOrtho MANGLE(Ortho)
+#define glPassTexCoordATI MANGLE(PassTexCoordATI)
+#define glPassThrough MANGLE(PassThrough)
+#define glPixelDataRangeNV MANGLE(PixelDataRangeNV)
+#define glPixelMapfv MANGLE(PixelMapfv)
+#define glPixelMapuiv MANGLE(PixelMapuiv)
+#define glPixelMapusv MANGLE(PixelMapusv)
+#define glPixelStoref MANGLE(PixelStoref)
+#define glPixelStorei MANGLE(PixelStorei)
+#define glPixelTexGenParameterfSGIS MANGLE(PixelTexGenParameterfSGIS)
+#define glPixelTexGenParameterfvSGIS MANGLE(PixelTexGenParameterfvSGIS)
+#define glPixelTexGenParameteriSGIS MANGLE(PixelTexGenParameteriSGIS)
+#define glPixelTexGenParameterivSGIS MANGLE(PixelTexGenParameterivSGIS)
+#define glPixelTexGenSGIX MANGLE(PixelTexGenSGIX)
+#define glPixelTransferf MANGLE(PixelTransferf)
+#define glPixelTransferi MANGLE(PixelTransferi)
+#define glPixelTransformParameterfEXT MANGLE(PixelTransformParameterfEXT)
+#define glPixelTransformParameterfvEXT MANGLE(PixelTransformParameterfvEXT)
+#define glPixelTransformParameteriEXT MANGLE(PixelTransformParameteriEXT)
+#define glPixelTransformParameterivEXT MANGLE(PixelTransformParameterivEXT)
+#define glPixelZoom MANGLE(PixelZoom)
+#define glPNTrianglesfATI MANGLE(PNTrianglesfATI)
+#define glPNTrianglesiATI MANGLE(PNTrianglesiATI)
+#define glPointParameterfARB MANGLE(PointParameterfARB)
+#define glPointParameterfEXT MANGLE(PointParameterfEXT)
+#define glPointParameterf MANGLE(PointParameterf)
+#define glPointParameterfSGIS MANGLE(PointParameterfSGIS)
+#define glPointParameterfvARB MANGLE(PointParameterfvARB)
+#define glPointParameterfvEXT MANGLE(PointParameterfvEXT)
+#define glPointParameterfv MANGLE(PointParameterfv)
+#define glPointParameterfvSGIS MANGLE(PointParameterfvSGIS)
+#define glPointParameteri MANGLE(PointParameteri)
+#define glPointParameteriNV MANGLE(PointParameteriNV)
+#define glPointParameteriv MANGLE(PointParameteriv)
+#define glPointParameterivNV MANGLE(PointParameterivNV)
+#define glPointSize MANGLE(PointSize)
+#define glPollAsyncSGIX MANGLE(PollAsyncSGIX)
+#define glPollInstrumentsSGIX MANGLE(PollInstrumentsSGIX)
+#define glPolygonMode MANGLE(PolygonMode)
+#define glPolygonOffsetEXT MANGLE(PolygonOffsetEXT)
+#define glPolygonOffset MANGLE(PolygonOffset)
+#define glPolygonStipple MANGLE(PolygonStipple)
+#define glPopAttrib MANGLE(PopAttrib)
+#define glPopClientAttrib MANGLE(PopClientAttrib)
+#define glPopMatrix MANGLE(PopMatrix)
+#define glPopName MANGLE(PopName)
+#define glPrimitiveRestartIndexNV MANGLE(PrimitiveRestartIndexNV)
+#define glPrimitiveRestartNV MANGLE(PrimitiveRestartNV)
+#define glPrioritizeTexturesEXT MANGLE(PrioritizeTexturesEXT)
+#define glPrioritizeTextures MANGLE(PrioritizeTextures)
+#define glProgramBufferParametersfvNV MANGLE(ProgramBufferParametersfvNV)
+#define glProgramBufferParametersIivNV MANGLE(ProgramBufferParametersIivNV)
+#define glProgramBufferParametersIuivNV MANGLE(ProgramBufferParametersIuivNV)
+#define glProgramCallbackMESA MANGLE(ProgramCallbackMESA)
+#define glProgramEnvParameter4dARB MANGLE(ProgramEnvParameter4dARB)
+#define glProgramEnvParameter4dvARB MANGLE(ProgramEnvParameter4dvARB)
+#define glProgramEnvParameter4fARB MANGLE(ProgramEnvParameter4fARB)
+#define glProgramEnvParameter4fvARB MANGLE(ProgramEnvParameter4fvARB)
+#define glProgramEnvParameterI4iNV MANGLE(ProgramEnvParameterI4iNV)
+#define glProgramEnvParameterI4ivNV MANGLE(ProgramEnvParameterI4ivNV)
+#define glProgramEnvParameterI4uiNV MANGLE(ProgramEnvParameterI4uiNV)
+#define glProgramEnvParameterI4uivNV MANGLE(ProgramEnvParameterI4uivNV)
+#define glProgramEnvParameters4fvEXT MANGLE(ProgramEnvParameters4fvEXT)
+#define glProgramEnvParametersI4ivNV MANGLE(ProgramEnvParametersI4ivNV)
+#define glProgramEnvParametersI4uivNV MANGLE(ProgramEnvParametersI4uivNV)
+#define glProgramLocalParameter4dARB MANGLE(ProgramLocalParameter4dARB)
+#define glProgramLocalParameter4dvARB MANGLE(ProgramLocalParameter4dvARB)
+#define glProgramLocalParameter4fARB MANGLE(ProgramLocalParameter4fARB)
+#define glProgramLocalParameter4fvARB MANGLE(ProgramLocalParameter4fvARB)
+#define glProgramLocalParameterI4iNV MANGLE(ProgramLocalParameterI4iNV)
+#define glProgramLocalParameterI4ivNV MANGLE(ProgramLocalParameterI4ivNV)
+#define glProgramLocalParameterI4uiNV MANGLE(ProgramLocalParameterI4uiNV)
+#define glProgramLocalParameterI4uivNV MANGLE(ProgramLocalParameterI4uivNV)
+#define glProgramLocalParameters4fvEXT MANGLE(ProgramLocalParameters4fvEXT)
+#define glProgramLocalParametersI4ivNV MANGLE(ProgramLocalParametersI4ivNV)
+#define glProgramLocalParametersI4uivNV MANGLE(ProgramLocalParametersI4uivNV)
+#define glProgramNamedParameter4dNV MANGLE(ProgramNamedParameter4dNV)
+#define glProgramNamedParameter4dvNV MANGLE(ProgramNamedParameter4dvNV)
+#define glProgramNamedParameter4fNV MANGLE(ProgramNamedParameter4fNV)
+#define glProgramNamedParameter4fvNV MANGLE(ProgramNamedParameter4fvNV)
+#define glProgramParameter4dNV MANGLE(ProgramParameter4dNV)
+#define glProgramParameter4dvNV MANGLE(ProgramParameter4dvNV)
+#define glProgramParameter4fNV MANGLE(ProgramParameter4fNV)
+#define glProgramParameter4fvNV MANGLE(ProgramParameter4fvNV)
+#define glProgramParameteriEXT MANGLE(ProgramParameteriEXT)
+#define glProgramParameters4dvNV MANGLE(ProgramParameters4dvNV)
+#define glProgramParameters4fvNV MANGLE(ProgramParameters4fvNV)
+#define glProgramStringARB MANGLE(ProgramStringARB)
+#define glProgramVertexLimitNV MANGLE(ProgramVertexLimitNV)
+#define glPushAttrib MANGLE(PushAttrib)
+#define glPushClientAttrib MANGLE(PushClientAttrib)
+#define glPushMatrix MANGLE(PushMatrix)
+#define glPushName MANGLE(PushName)
+#define glRasterPos2d MANGLE(RasterPos2d)
+#define glRasterPos2dv MANGLE(RasterPos2dv)
+#define glRasterPos2f MANGLE(RasterPos2f)
+#define glRasterPos2fv MANGLE(RasterPos2fv)
+#define glRasterPos2i MANGLE(RasterPos2i)
+#define glRasterPos2iv MANGLE(RasterPos2iv)
+#define glRasterPos2s MANGLE(RasterPos2s)
+#define glRasterPos2sv MANGLE(RasterPos2sv)
+#define glRasterPos3d MANGLE(RasterPos3d)
+#define glRasterPos3dv MANGLE(RasterPos3dv)
+#define glRasterPos3f MANGLE(RasterPos3f)
+#define glRasterPos3fv MANGLE(RasterPos3fv)
+#define glRasterPos3i MANGLE(RasterPos3i)
+#define glRasterPos3iv MANGLE(RasterPos3iv)
+#define glRasterPos3s MANGLE(RasterPos3s)
+#define glRasterPos3sv MANGLE(RasterPos3sv)
+#define glRasterPos4d MANGLE(RasterPos4d)
+#define glRasterPos4dv MANGLE(RasterPos4dv)
+#define glRasterPos4f MANGLE(RasterPos4f)
+#define glRasterPos4fv MANGLE(RasterPos4fv)
+#define glRasterPos4i MANGLE(RasterPos4i)
+#define glRasterPos4iv MANGLE(RasterPos4iv)
+#define glRasterPos4s MANGLE(RasterPos4s)
+#define glRasterPos4sv MANGLE(RasterPos4sv)
+#define glReadBuffer MANGLE(ReadBuffer)
+#define glReadInstrumentsSGIX MANGLE(ReadInstrumentsSGIX)
+#define glReadPixels MANGLE(ReadPixels)
+#define glRectd MANGLE(Rectd)
+#define glRectdv MANGLE(Rectdv)
+#define glRectf MANGLE(Rectf)
+#define glRectfv MANGLE(Rectfv)
+#define glRecti MANGLE(Recti)
+#define glRectiv MANGLE(Rectiv)
+#define glRects MANGLE(Rects)
+#define glRectsv MANGLE(Rectsv)
+#define glReferencePlaneSGIX MANGLE(ReferencePlaneSGIX)
+#define glRenderbufferStorageEXT MANGLE(RenderbufferStorageEXT)
+#define glRenderbufferStorageMultisampleCoverageNV MANGLE(RenderbufferStorageMultisampleCoverageNV)
+#define glRenderbufferStorageMultisampleEXT MANGLE(RenderbufferStorageMultisampleEXT)
+#define glRenderMode MANGLE(RenderMode)
+#define glReplacementCodePointerSUN MANGLE(ReplacementCodePointerSUN)
+#define glReplacementCodeubSUN MANGLE(ReplacementCodeubSUN)
+#define glReplacementCodeubvSUN MANGLE(ReplacementCodeubvSUN)
+#define glReplacementCodeuiColor3fVertex3fSUN MANGLE(ReplacementCodeuiColor3fVertex3fSUN)
+#define glReplacementCodeuiColor3fVertex3fvSUN MANGLE(ReplacementCodeuiColor3fVertex3fvSUN)
+#define glReplacementCodeuiColor4fNormal3fVertex3fSUN MANGLE(ReplacementCodeuiColor4fNormal3fVertex3fSUN)
+#define glReplacementCodeuiColor4fNormal3fVertex3fvSUN MANGLE(ReplacementCodeuiColor4fNormal3fVertex3fvSUN)
+#define glReplacementCodeuiColor4ubVertex3fSUN MANGLE(ReplacementCodeuiColor4ubVertex3fSUN)
+#define glReplacementCodeuiColor4ubVertex3fvSUN MANGLE(ReplacementCodeuiColor4ubVertex3fvSUN)
+#define glReplacementCodeuiNormal3fVertex3fSUN MANGLE(ReplacementCodeuiNormal3fVertex3fSUN)
+#define glReplacementCodeuiNormal3fVertex3fvSUN MANGLE(ReplacementCodeuiNormal3fVertex3fvSUN)
+#define glReplacementCodeuiSUN MANGLE(ReplacementCodeuiSUN)
+#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN MANGLE(ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN)
+#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN MANGLE(ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN)
+#define glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN MANGLE(ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN)
+#define glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN MANGLE(ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN)
+#define glReplacementCodeuiTexCoord2fVertex3fSUN MANGLE(ReplacementCodeuiTexCoord2fVertex3fSUN)
+#define glReplacementCodeuiTexCoord2fVertex3fvSUN MANGLE(ReplacementCodeuiTexCoord2fVertex3fvSUN)
+#define glReplacementCodeuiVertex3fSUN MANGLE(ReplacementCodeuiVertex3fSUN)
+#define glReplacementCodeuiVertex3fvSUN MANGLE(ReplacementCodeuiVertex3fvSUN)
+#define glReplacementCodeuivSUN MANGLE(ReplacementCodeuivSUN)
+#define glReplacementCodeusSUN MANGLE(ReplacementCodeusSUN)
+#define glReplacementCodeusvSUN MANGLE(ReplacementCodeusvSUN)
+#define glRequestResidentProgramsNV MANGLE(RequestResidentProgramsNV)
+#define glResetHistogramEXT MANGLE(ResetHistogramEXT)
+#define glResetHistogram MANGLE(ResetHistogram)
+#define glResetMinmaxEXT MANGLE(ResetMinmaxEXT)
+#define glResetMinmax MANGLE(ResetMinmax)
+#define glResizeBuffersMESA MANGLE(ResizeBuffersMESA)
+#define glRotated MANGLE(Rotated)
+#define glRotatef MANGLE(Rotatef)
+#define glSampleCoverageARB MANGLE(SampleCoverageARB)
+#define glSampleCoverage MANGLE(SampleCoverage)
+#define glSampleMapATI MANGLE(SampleMapATI)
+#define glSampleMaskEXT MANGLE(SampleMaskEXT)
+#define glSampleMaskSGIS MANGLE(SampleMaskSGIS)
+#define glSamplePatternEXT MANGLE(SamplePatternEXT)
+#define glSamplePatternSGIS MANGLE(SamplePatternSGIS)
+#define glScaled MANGLE(Scaled)
+#define glScalef MANGLE(Scalef)
+#define glScissor MANGLE(Scissor)
+#define glSecondaryColor3bEXT MANGLE(SecondaryColor3bEXT)
+#define glSecondaryColor3b MANGLE(SecondaryColor3b)
+#define glSecondaryColor3bvEXT MANGLE(SecondaryColor3bvEXT)
+#define glSecondaryColor3bv MANGLE(SecondaryColor3bv)
+#define glSecondaryColor3dEXT MANGLE(SecondaryColor3dEXT)
+#define glSecondaryColor3d MANGLE(SecondaryColor3d)
+#define glSecondaryColor3dvEXT MANGLE(SecondaryColor3dvEXT)
+#define glSecondaryColor3dv MANGLE(SecondaryColor3dv)
+#define glSecondaryColor3fEXT MANGLE(SecondaryColor3fEXT)
+#define glSecondaryColor3f MANGLE(SecondaryColor3f)
+#define glSecondaryColor3fvEXT MANGLE(SecondaryColor3fvEXT)
+#define glSecondaryColor3fv MANGLE(SecondaryColor3fv)
+#define glSecondaryColor3hNV MANGLE(SecondaryColor3hNV)
+#define glSecondaryColor3hvNV MANGLE(SecondaryColor3hvNV)
+#define glSecondaryColor3iEXT MANGLE(SecondaryColor3iEXT)
+#define glSecondaryColor3i MANGLE(SecondaryColor3i)
+#define glSecondaryColor3ivEXT MANGLE(SecondaryColor3ivEXT)
+#define glSecondaryColor3iv MANGLE(SecondaryColor3iv)
+#define glSecondaryColor3sEXT MANGLE(SecondaryColor3sEXT)
+#define glSecondaryColor3s MANGLE(SecondaryColor3s)
+#define glSecondaryColor3svEXT MANGLE(SecondaryColor3svEXT)
+#define glSecondaryColor3sv MANGLE(SecondaryColor3sv)
+#define glSecondaryColor3ubEXT MANGLE(SecondaryColor3ubEXT)
+#define glSecondaryColor3ub MANGLE(SecondaryColor3ub)
+#define glSecondaryColor3ubvEXT MANGLE(SecondaryColor3ubvEXT)
+#define glSecondaryColor3ubv MANGLE(SecondaryColor3ubv)
+#define glSecondaryColor3uiEXT MANGLE(SecondaryColor3uiEXT)
+#define glSecondaryColor3ui MANGLE(SecondaryColor3ui)
+#define glSecondaryColor3uivEXT MANGLE(SecondaryColor3uivEXT)
+#define glSecondaryColor3uiv MANGLE(SecondaryColor3uiv)
+#define glSecondaryColor3usEXT MANGLE(SecondaryColor3usEXT)
+#define glSecondaryColor3us MANGLE(SecondaryColor3us)
+#define glSecondaryColor3usvEXT MANGLE(SecondaryColor3usvEXT)
+#define glSecondaryColor3usv MANGLE(SecondaryColor3usv)
+#define glSecondaryColorPointerEXT MANGLE(SecondaryColorPointerEXT)
+#define glSecondaryColorPointerListIBM MANGLE(SecondaryColorPointerListIBM)
+#define glSecondaryColorPointer MANGLE(SecondaryColorPointer)
+#define glSelectBuffer MANGLE(SelectBuffer)
+#define glSeparableFilter2DEXT MANGLE(SeparableFilter2DEXT)
+#define glSeparableFilter2D MANGLE(SeparableFilter2D)
+#define glSetFenceAPPLE MANGLE(SetFenceAPPLE)
+#define glSetFenceNV MANGLE(SetFenceNV)
+#define glSetFragmentShaderConstantATI MANGLE(SetFragmentShaderConstantATI)
+#define glSetInvariantEXT MANGLE(SetInvariantEXT)
+#define glSetLocalConstantEXT MANGLE(SetLocalConstantEXT)
+#define glShadeModel MANGLE(ShadeModel)
+#define glShaderOp1EXT MANGLE(ShaderOp1EXT)
+#define glShaderOp2EXT MANGLE(ShaderOp2EXT)
+#define glShaderOp3EXT MANGLE(ShaderOp3EXT)
+#define glShaderSourceARB MANGLE(ShaderSourceARB)
+#define glShaderSource MANGLE(ShaderSource)
+#define glSharpenTexFuncSGIS MANGLE(SharpenTexFuncSGIS)
+#define glSpriteParameterfSGIX MANGLE(SpriteParameterfSGIX)
+#define glSpriteParameterfvSGIX MANGLE(SpriteParameterfvSGIX)
+#define glSpriteParameteriSGIX MANGLE(SpriteParameteriSGIX)
+#define glSpriteParameterivSGIX MANGLE(SpriteParameterivSGIX)
+#define glStartInstrumentsSGIX MANGLE(StartInstrumentsSGIX)
+#define glStencilClearTagEXT MANGLE(StencilClearTagEXT)
+#define glStencilFunc MANGLE(StencilFunc)
+#define glStencilFuncSeparateATI MANGLE(StencilFuncSeparateATI)
+#define glStencilFuncSeparate MANGLE(StencilFuncSeparate)
+#define glStencilMask MANGLE(StencilMask)
+#define glStencilMaskSeparate MANGLE(StencilMaskSeparate)
+#define glStencilOp MANGLE(StencilOp)
+#define glStencilOpSeparateATI MANGLE(StencilOpSeparateATI)
+#define glStencilOpSeparate MANGLE(StencilOpSeparate)
+#define glStopInstrumentsSGIX MANGLE(StopInstrumentsSGIX)
+#define glStringMarkerGREMEDY MANGLE(StringMarkerGREMEDY)
+#define glSwizzleEXT MANGLE(SwizzleEXT)
+#define glTagSampleBufferSGIX MANGLE(TagSampleBufferSGIX)
+#define glTangent3bEXT MANGLE(Tangent3bEXT)
+#define glTangent3bvEXT MANGLE(Tangent3bvEXT)
+#define glTangent3dEXT MANGLE(Tangent3dEXT)
+#define glTangent3dvEXT MANGLE(Tangent3dvEXT)
+#define glTangent3fEXT MANGLE(Tangent3fEXT)
+#define glTangent3fvEXT MANGLE(Tangent3fvEXT)
+#define glTangent3iEXT MANGLE(Tangent3iEXT)
+#define glTangent3ivEXT MANGLE(Tangent3ivEXT)
+#define glTangent3sEXT MANGLE(Tangent3sEXT)
+#define glTangent3svEXT MANGLE(Tangent3svEXT)
+#define glTangentPointerEXT MANGLE(TangentPointerEXT)
+#define glTbufferMask3DFX MANGLE(TbufferMask3DFX)
+#define glTestFenceAPPLE MANGLE(TestFenceAPPLE)
+#define glTestFenceNV MANGLE(TestFenceNV)
+#define glTestObjectAPPLE MANGLE(TestObjectAPPLE)
+#define glTexBufferEXT MANGLE(TexBufferEXT)
+#define glTexBumpParameterfvATI MANGLE(TexBumpParameterfvATI)
+#define glTexBumpParameterivATI MANGLE(TexBumpParameterivATI)
+#define glTexCoord1d MANGLE(TexCoord1d)
+#define glTexCoord1dv MANGLE(TexCoord1dv)
+#define glTexCoord1f MANGLE(TexCoord1f)
+#define glTexCoord1fv MANGLE(TexCoord1fv)
+#define glTexCoord1hNV MANGLE(TexCoord1hNV)
+#define glTexCoord1hvNV MANGLE(TexCoord1hvNV)
+#define glTexCoord1i MANGLE(TexCoord1i)
+#define glTexCoord1iv MANGLE(TexCoord1iv)
+#define glTexCoord1s MANGLE(TexCoord1s)
+#define glTexCoord1sv MANGLE(TexCoord1sv)
+#define glTexCoord2d MANGLE(TexCoord2d)
+#define glTexCoord2dv MANGLE(TexCoord2dv)
+#define glTexCoord2fColor3fVertex3fSUN MANGLE(TexCoord2fColor3fVertex3fSUN)
+#define glTexCoord2fColor3fVertex3fvSUN MANGLE(TexCoord2fColor3fVertex3fvSUN)
+#define glTexCoord2fColor4fNormal3fVertex3fSUN MANGLE(TexCoord2fColor4fNormal3fVertex3fSUN)
+#define glTexCoord2fColor4fNormal3fVertex3fvSUN MANGLE(TexCoord2fColor4fNormal3fVertex3fvSUN)
+#define glTexCoord2fColor4ubVertex3fSUN MANGLE(TexCoord2fColor4ubVertex3fSUN)
+#define glTexCoord2fColor4ubVertex3fvSUN MANGLE(TexCoord2fColor4ubVertex3fvSUN)
+#define glTexCoord2f MANGLE(TexCoord2f)
+#define glTexCoord2fNormal3fVertex3fSUN MANGLE(TexCoord2fNormal3fVertex3fSUN)
+#define glTexCoord2fNormal3fVertex3fvSUN MANGLE(TexCoord2fNormal3fVertex3fvSUN)
+#define glTexCoord2fVertex3fSUN MANGLE(TexCoord2fVertex3fSUN)
+#define glTexCoord2fVertex3fvSUN MANGLE(TexCoord2fVertex3fvSUN)
+#define glTexCoord2fv MANGLE(TexCoord2fv)
+#define glTexCoord2hNV MANGLE(TexCoord2hNV)
+#define glTexCoord2hvNV MANGLE(TexCoord2hvNV)
+#define glTexCoord2i MANGLE(TexCoord2i)
+#define glTexCoord2iv MANGLE(TexCoord2iv)
+#define glTexCoord2s MANGLE(TexCoord2s)
+#define glTexCoord2sv MANGLE(TexCoord2sv)
+#define glTexCoord3d MANGLE(TexCoord3d)
+#define glTexCoord3dv MANGLE(TexCoord3dv)
+#define glTexCoord3f MANGLE(TexCoord3f)
+#define glTexCoord3fv MANGLE(TexCoord3fv)
+#define glTexCoord3hNV MANGLE(TexCoord3hNV)
+#define glTexCoord3hvNV MANGLE(TexCoord3hvNV)
+#define glTexCoord3i MANGLE(TexCoord3i)
+#define glTexCoord3iv MANGLE(TexCoord3iv)
+#define glTexCoord3s MANGLE(TexCoord3s)
+#define glTexCoord3sv MANGLE(TexCoord3sv)
+#define glTexCoord4d MANGLE(TexCoord4d)
+#define glTexCoord4dv MANGLE(TexCoord4dv)
+#define glTexCoord4fColor4fNormal3fVertex4fSUN MANGLE(TexCoord4fColor4fNormal3fVertex4fSUN)
+#define glTexCoord4fColor4fNormal3fVertex4fvSUN MANGLE(TexCoord4fColor4fNormal3fVertex4fvSUN)
+#define glTexCoord4f MANGLE(TexCoord4f)
+#define glTexCoord4fVertex4fSUN MANGLE(TexCoord4fVertex4fSUN)
+#define glTexCoord4fVertex4fvSUN MANGLE(TexCoord4fVertex4fvSUN)
+#define glTexCoord4fv MANGLE(TexCoord4fv)
+#define glTexCoord4hNV MANGLE(TexCoord4hNV)
+#define glTexCoord4hvNV MANGLE(TexCoord4hvNV)
+#define glTexCoord4i MANGLE(TexCoord4i)
+#define glTexCoord4iv MANGLE(TexCoord4iv)
+#define glTexCoord4s MANGLE(TexCoord4s)
+#define glTexCoord4sv MANGLE(TexCoord4sv)
+#define glTexCoordPointerEXT MANGLE(TexCoordPointerEXT)
+#define glTexCoordPointerListIBM MANGLE(TexCoordPointerListIBM)
+#define glTexCoordPointer MANGLE(TexCoordPointer)
+#define glTexCoordPointervINTEL MANGLE(TexCoordPointervINTEL)
+#define glTexEnvf MANGLE(TexEnvf)
+#define glTexEnvfv MANGLE(TexEnvfv)
+#define glTexEnvi MANGLE(TexEnvi)
+#define glTexEnviv MANGLE(TexEnviv)
+#define glTexFilterFuncSGIS MANGLE(TexFilterFuncSGIS)
+#define glTexGend MANGLE(TexGend)
+#define glTexGendv MANGLE(TexGendv)
+#define glTexGenf MANGLE(TexGenf)
+#define glTexGenfv MANGLE(TexGenfv)
+#define glTexGeni MANGLE(TexGeni)
+#define glTexGeniv MANGLE(TexGeniv)
+#define glTexImage1D MANGLE(TexImage1D)
+#define glTexImage2D MANGLE(TexImage2D)
+#define glTexImage3DEXT MANGLE(TexImage3DEXT)
+#define glTexImage3D MANGLE(TexImage3D)
+#define glTexImage4DSGIS MANGLE(TexImage4DSGIS)
+#define glTexParameterf MANGLE(TexParameterf)
+#define glTexParameterfv MANGLE(TexParameterfv)
+#define glTexParameterIivEXT MANGLE(TexParameterIivEXT)
+#define glTexParameteri MANGLE(TexParameteri)
+#define glTexParameterIuivEXT MANGLE(TexParameterIuivEXT)
+#define glTexParameteriv MANGLE(TexParameteriv)
+#define glTexSubImage1DEXT MANGLE(TexSubImage1DEXT)
+#define glTexSubImage1D MANGLE(TexSubImage1D)
+#define glTexSubImage2DEXT MANGLE(TexSubImage2DEXT)
+#define glTexSubImage2D MANGLE(TexSubImage2D)
+#define glTexSubImage3DEXT MANGLE(TexSubImage3DEXT)
+#define glTexSubImage3D MANGLE(TexSubImage3D)
+#define glTexSubImage4DSGIS MANGLE(TexSubImage4DSGIS)
+#define glTextureColorMaskSGIS MANGLE(TextureColorMaskSGIS)
+#define glTextureLightEXT MANGLE(TextureLightEXT)
+#define glTextureMaterialEXT MANGLE(TextureMaterialEXT)
+#define glTextureNormalEXT MANGLE(TextureNormalEXT)
+#define glTrackMatrixNV MANGLE(TrackMatrixNV)
+#define glTransformFeedbackAttribsNV MANGLE(TransformFeedbackAttribsNV)
+#define glTransformFeedbackVaryingsNV MANGLE(TransformFeedbackVaryingsNV)
+#define glTranslated MANGLE(Translated)
+#define glTranslatef MANGLE(Translatef)
+#define glUniform1fARB MANGLE(Uniform1fARB)
+#define glUniform1f MANGLE(Uniform1f)
+#define glUniform1fvARB MANGLE(Uniform1fvARB)
+#define glUniform1fv MANGLE(Uniform1fv)
+#define glUniform1iARB MANGLE(Uniform1iARB)
+#define glUniform1i MANGLE(Uniform1i)
+#define glUniform1ivARB MANGLE(Uniform1ivARB)
+#define glUniform1iv MANGLE(Uniform1iv)
+#define glUniform1uiEXT MANGLE(Uniform1uiEXT)
+#define glUniform1uivEXT MANGLE(Uniform1uivEXT)
+#define glUniform2fARB MANGLE(Uniform2fARB)
+#define glUniform2f MANGLE(Uniform2f)
+#define glUniform2fvARB MANGLE(Uniform2fvARB)
+#define glUniform2fv MANGLE(Uniform2fv)
+#define glUniform2iARB MANGLE(Uniform2iARB)
+#define glUniform2i MANGLE(Uniform2i)
+#define glUniform2ivARB MANGLE(Uniform2ivARB)
+#define glUniform2iv MANGLE(Uniform2iv)
+#define glUniform2uiEXT MANGLE(Uniform2uiEXT)
+#define glUniform2uivEXT MANGLE(Uniform2uivEXT)
+#define glUniform3fARB MANGLE(Uniform3fARB)
+#define glUniform3f MANGLE(Uniform3f)
+#define glUniform3fvARB MANGLE(Uniform3fvARB)
+#define glUniform3fv MANGLE(Uniform3fv)
+#define glUniform3iARB MANGLE(Uniform3iARB)
+#define glUniform3i MANGLE(Uniform3i)
+#define glUniform3ivARB MANGLE(Uniform3ivARB)
+#define glUniform3iv MANGLE(Uniform3iv)
+#define glUniform3uiEXT MANGLE(Uniform3uiEXT)
+#define glUniform3uivEXT MANGLE(Uniform3uivEXT)
+#define glUniform4fARB MANGLE(Uniform4fARB)
+#define glUniform4f MANGLE(Uniform4f)
+#define glUniform4fvARB MANGLE(Uniform4fvARB)
+#define glUniform4fv MANGLE(Uniform4fv)
+#define glUniform4iARB MANGLE(Uniform4iARB)
+#define glUniform4i MANGLE(Uniform4i)
+#define glUniform4ivARB MANGLE(Uniform4ivARB)
+#define glUniform4iv MANGLE(Uniform4iv)
+#define glUniform4uiEXT MANGLE(Uniform4uiEXT)
+#define glUniform4uivEXT MANGLE(Uniform4uivEXT)
+#define glUniformBufferEXT MANGLE(UniformBufferEXT)
+#define glUniformMatrix2fvARB MANGLE(UniformMatrix2fvARB)
+#define glUniformMatrix2fv MANGLE(UniformMatrix2fv)
+#define glUniformMatrix2x3fv MANGLE(UniformMatrix2x3fv)
+#define glUniformMatrix2x4fv MANGLE(UniformMatrix2x4fv)
+#define glUniformMatrix3fvARB MANGLE(UniformMatrix3fvARB)
+#define glUniformMatrix3fv MANGLE(UniformMatrix3fv)
+#define glUniformMatrix3x2fv MANGLE(UniformMatrix3x2fv)
+#define glUniformMatrix3x4fv MANGLE(UniformMatrix3x4fv)
+#define glUniformMatrix4fvARB MANGLE(UniformMatrix4fvARB)
+#define glUniformMatrix4fv MANGLE(UniformMatrix4fv)
+#define glUniformMatrix4x2fv MANGLE(UniformMatrix4x2fv)
+#define glUniformMatrix4x3fv MANGLE(UniformMatrix4x3fv)
+#define glUnlockArraysEXT MANGLE(UnlockArraysEXT)
+#define glUnmapBufferARB MANGLE(UnmapBufferARB)
+#define glUnmapBuffer MANGLE(UnmapBuffer)
+#define glUnmapObjectBufferATI MANGLE(UnmapObjectBufferATI)
+#define glUpdateObjectBufferATI MANGLE(UpdateObjectBufferATI)
+#define glUseProgram MANGLE(UseProgram)
+#define glUseProgramObjectARB MANGLE(UseProgramObjectARB)
+#define glValidateProgramARB MANGLE(ValidateProgramARB)
+#define glValidateProgram MANGLE(ValidateProgram)
+#define glVariantArrayObjectATI MANGLE(VariantArrayObjectATI)
+#define glVariantbvEXT MANGLE(VariantbvEXT)
+#define glVariantdvEXT MANGLE(VariantdvEXT)
+#define glVariantfvEXT MANGLE(VariantfvEXT)
+#define glVariantivEXT MANGLE(VariantivEXT)
+#define glVariantPointerEXT MANGLE(VariantPointerEXT)
+#define glVariantsvEXT MANGLE(VariantsvEXT)
+#define glVariantubvEXT MANGLE(VariantubvEXT)
+#define glVariantuivEXT MANGLE(VariantuivEXT)
+#define glVariantusvEXT MANGLE(VariantusvEXT)
+#define glVertex2d MANGLE(Vertex2d)
+#define glVertex2dv MANGLE(Vertex2dv)
+#define glVertex2f MANGLE(Vertex2f)
+#define glVertex2fv MANGLE(Vertex2fv)
+#define glVertex2hNV MANGLE(Vertex2hNV)
+#define glVertex2hvNV MANGLE(Vertex2hvNV)
+#define glVertex2i MANGLE(Vertex2i)
+#define glVertex2iv MANGLE(Vertex2iv)
+#define glVertex2s MANGLE(Vertex2s)
+#define glVertex2sv MANGLE(Vertex2sv)
+#define glVertex3d MANGLE(Vertex3d)
+#define glVertex3dv MANGLE(Vertex3dv)
+#define glVertex3f MANGLE(Vertex3f)
+#define glVertex3fv MANGLE(Vertex3fv)
+#define glVertex3hNV MANGLE(Vertex3hNV)
+#define glVertex3hvNV MANGLE(Vertex3hvNV)
+#define glVertex3i MANGLE(Vertex3i)
+#define glVertex3iv MANGLE(Vertex3iv)
+#define glVertex3s MANGLE(Vertex3s)
+#define glVertex3sv MANGLE(Vertex3sv)
+#define glVertex4d MANGLE(Vertex4d)
+#define glVertex4dv MANGLE(Vertex4dv)
+#define glVertex4f MANGLE(Vertex4f)
+#define glVertex4fv MANGLE(Vertex4fv)
+#define glVertex4hNV MANGLE(Vertex4hNV)
+#define glVertex4hvNV MANGLE(Vertex4hvNV)
+#define glVertex4i MANGLE(Vertex4i)
+#define glVertex4iv MANGLE(Vertex4iv)
+#define glVertex4s MANGLE(Vertex4s)
+#define glVertex4sv MANGLE(Vertex4sv)
+#define glVertexArrayParameteriAPPLE MANGLE(VertexArrayParameteriAPPLE)
+#define glVertexArrayRangeAPPLE MANGLE(VertexArrayRangeAPPLE)
+#define glVertexArrayRangeNV MANGLE(VertexArrayRangeNV)
+#define glVertexAttrib1dARB MANGLE(VertexAttrib1dARB)
+#define glVertexAttrib1d MANGLE(VertexAttrib1d)
+#define glVertexAttrib1dNV MANGLE(VertexAttrib1dNV)
+#define glVertexAttrib1dvARB MANGLE(VertexAttrib1dvARB)
+#define glVertexAttrib1dv MANGLE(VertexAttrib1dv)
+#define glVertexAttrib1dvNV MANGLE(VertexAttrib1dvNV)
+#define glVertexAttrib1fARB MANGLE(VertexAttrib1fARB)
+#define glVertexAttrib1f MANGLE(VertexAttrib1f)
+#define glVertexAttrib1fNV MANGLE(VertexAttrib1fNV)
+#define glVertexAttrib1fvARB MANGLE(VertexAttrib1fvARB)
+#define glVertexAttrib1fv MANGLE(VertexAttrib1fv)
+#define glVertexAttrib1fvNV MANGLE(VertexAttrib1fvNV)
+#define glVertexAttrib1hNV MANGLE(VertexAttrib1hNV)
+#define glVertexAttrib1hvNV MANGLE(VertexAttrib1hvNV)
+#define glVertexAttrib1sARB MANGLE(VertexAttrib1sARB)
+#define glVertexAttrib1s MANGLE(VertexAttrib1s)
+#define glVertexAttrib1sNV MANGLE(VertexAttrib1sNV)
+#define glVertexAttrib1svARB MANGLE(VertexAttrib1svARB)
+#define glVertexAttrib1sv MANGLE(VertexAttrib1sv)
+#define glVertexAttrib1svNV MANGLE(VertexAttrib1svNV)
+#define glVertexAttrib2dARB MANGLE(VertexAttrib2dARB)
+#define glVertexAttrib2d MANGLE(VertexAttrib2d)
+#define glVertexAttrib2dNV MANGLE(VertexAttrib2dNV)
+#define glVertexAttrib2dvARB MANGLE(VertexAttrib2dvARB)
+#define glVertexAttrib2dv MANGLE(VertexAttrib2dv)
+#define glVertexAttrib2dvNV MANGLE(VertexAttrib2dvNV)
+#define glVertexAttrib2fARB MANGLE(VertexAttrib2fARB)
+#define glVertexAttrib2f MANGLE(VertexAttrib2f)
+#define glVertexAttrib2fNV MANGLE(VertexAttrib2fNV)
+#define glVertexAttrib2fvARB MANGLE(VertexAttrib2fvARB)
+#define glVertexAttrib2fv MANGLE(VertexAttrib2fv)
+#define glVertexAttrib2fvNV MANGLE(VertexAttrib2fvNV)
+#define glVertexAttrib2hNV MANGLE(VertexAttrib2hNV)
+#define glVertexAttrib2hvNV MANGLE(VertexAttrib2hvNV)
+#define glVertexAttrib2sARB MANGLE(VertexAttrib2sARB)
+#define glVertexAttrib2s MANGLE(VertexAttrib2s)
+#define glVertexAttrib2sNV MANGLE(VertexAttrib2sNV)
+#define glVertexAttrib2svARB MANGLE(VertexAttrib2svARB)
+#define glVertexAttrib2sv MANGLE(VertexAttrib2sv)
+#define glVertexAttrib2svNV MANGLE(VertexAttrib2svNV)
+#define glVertexAttrib3dARB MANGLE(VertexAttrib3dARB)
+#define glVertexAttrib3d MANGLE(VertexAttrib3d)
+#define glVertexAttrib3dNV MANGLE(VertexAttrib3dNV)
+#define glVertexAttrib3dvARB MANGLE(VertexAttrib3dvARB)
+#define glVertexAttrib3dv MANGLE(VertexAttrib3dv)
+#define glVertexAttrib3dvNV MANGLE(VertexAttrib3dvNV)
+#define glVertexAttrib3fARB MANGLE(VertexAttrib3fARB)
+#define glVertexAttrib3f MANGLE(VertexAttrib3f)
+#define glVertexAttrib3fNV MANGLE(VertexAttrib3fNV)
+#define glVertexAttrib3fvARB MANGLE(VertexAttrib3fvARB)
+#define glVertexAttrib3fv MANGLE(VertexAttrib3fv)
+#define glVertexAttrib3fvNV MANGLE(VertexAttrib3fvNV)
+#define glVertexAttrib3hNV MANGLE(VertexAttrib3hNV)
+#define glVertexAttrib3hvNV MANGLE(VertexAttrib3hvNV)
+#define glVertexAttrib3sARB MANGLE(VertexAttrib3sARB)
+#define glVertexAttrib3s MANGLE(VertexAttrib3s)
+#define glVertexAttrib3sNV MANGLE(VertexAttrib3sNV)
+#define glVertexAttrib3svARB MANGLE(VertexAttrib3svARB)
+#define glVertexAttrib3sv MANGLE(VertexAttrib3sv)
+#define glVertexAttrib3svNV MANGLE(VertexAttrib3svNV)
+#define glVertexAttrib4bvARB MANGLE(VertexAttrib4bvARB)
+#define glVertexAttrib4bv MANGLE(VertexAttrib4bv)
+#define glVertexAttrib4dARB MANGLE(VertexAttrib4dARB)
+#define glVertexAttrib4d MANGLE(VertexAttrib4d)
+#define glVertexAttrib4dNV MANGLE(VertexAttrib4dNV)
+#define glVertexAttrib4dvARB MANGLE(VertexAttrib4dvARB)
+#define glVertexAttrib4dv MANGLE(VertexAttrib4dv)
+#define glVertexAttrib4dvNV MANGLE(VertexAttrib4dvNV)
+#define glVertexAttrib4fARB MANGLE(VertexAttrib4fARB)
+#define glVertexAttrib4f MANGLE(VertexAttrib4f)
+#define glVertexAttrib4fNV MANGLE(VertexAttrib4fNV)
+#define glVertexAttrib4fvARB MANGLE(VertexAttrib4fvARB)
+#define glVertexAttrib4fv MANGLE(VertexAttrib4fv)
+#define glVertexAttrib4fvNV MANGLE(VertexAttrib4fvNV)
+#define glVertexAttrib4hNV MANGLE(VertexAttrib4hNV)
+#define glVertexAttrib4hvNV MANGLE(VertexAttrib4hvNV)
+#define glVertexAttrib4ivARB MANGLE(VertexAttrib4ivARB)
+#define glVertexAttrib4iv MANGLE(VertexAttrib4iv)
+#define glVertexAttrib4NbvARB MANGLE(VertexAttrib4NbvARB)
+#define glVertexAttrib4Nbv MANGLE(VertexAttrib4Nbv)
+#define glVertexAttrib4NivARB MANGLE(VertexAttrib4NivARB)
+#define glVertexAttrib4Niv MANGLE(VertexAttrib4Niv)
+#define glVertexAttrib4NsvARB MANGLE(VertexAttrib4NsvARB)
+#define glVertexAttrib4Nsv MANGLE(VertexAttrib4Nsv)
+#define glVertexAttrib4NubARB MANGLE(VertexAttrib4NubARB)
+#define glVertexAttrib4Nub MANGLE(VertexAttrib4Nub)
+#define glVertexAttrib4NubvARB MANGLE(VertexAttrib4NubvARB)
+#define glVertexAttrib4Nubv MANGLE(VertexAttrib4Nubv)
+#define glVertexAttrib4NuivARB MANGLE(VertexAttrib4NuivARB)
+#define glVertexAttrib4Nuiv MANGLE(VertexAttrib4Nuiv)
+#define glVertexAttrib4NusvARB MANGLE(VertexAttrib4NusvARB)
+#define glVertexAttrib4Nusv MANGLE(VertexAttrib4Nusv)
+#define glVertexAttrib4sARB MANGLE(VertexAttrib4sARB)
+#define glVertexAttrib4s MANGLE(VertexAttrib4s)
+#define glVertexAttrib4sNV MANGLE(VertexAttrib4sNV)
+#define glVertexAttrib4svARB MANGLE(VertexAttrib4svARB)
+#define glVertexAttrib4sv MANGLE(VertexAttrib4sv)
+#define glVertexAttrib4svNV MANGLE(VertexAttrib4svNV)
+#define glVertexAttrib4ubNV MANGLE(VertexAttrib4ubNV)
+#define glVertexAttrib4ubvARB MANGLE(VertexAttrib4ubvARB)
+#define glVertexAttrib4ubv MANGLE(VertexAttrib4ubv)
+#define glVertexAttrib4ubvNV MANGLE(VertexAttrib4ubvNV)
+#define glVertexAttrib4uivARB MANGLE(VertexAttrib4uivARB)
+#define glVertexAttrib4uiv MANGLE(VertexAttrib4uiv)
+#define glVertexAttrib4usvARB MANGLE(VertexAttrib4usvARB)
+#define glVertexAttrib4usv MANGLE(VertexAttrib4usv)
+#define glVertexAttribArrayObjectATI MANGLE(VertexAttribArrayObjectATI)
+#define glVertexAttribI1iEXT MANGLE(VertexAttribI1iEXT)
+#define glVertexAttribI1ivEXT MANGLE(VertexAttribI1ivEXT)
+#define glVertexAttribI1uiEXT MANGLE(VertexAttribI1uiEXT)
+#define glVertexAttribI1uivEXT MANGLE(VertexAttribI1uivEXT)
+#define glVertexAttribI2iEXT MANGLE(VertexAttribI2iEXT)
+#define glVertexAttribI2ivEXT MANGLE(VertexAttribI2ivEXT)
+#define glVertexAttribI2uiEXT MANGLE(VertexAttribI2uiEXT)
+#define glVertexAttribI2uivEXT MANGLE(VertexAttribI2uivEXT)
+#define glVertexAttribI3iEXT MANGLE(VertexAttribI3iEXT)
+#define glVertexAttribI3ivEXT MANGLE(VertexAttribI3ivEXT)
+#define glVertexAttribI3uiEXT MANGLE(VertexAttribI3uiEXT)
+#define glVertexAttribI3uivEXT MANGLE(VertexAttribI3uivEXT)
+#define glVertexAttribI4bvEXT MANGLE(VertexAttribI4bvEXT)
+#define glVertexAttribI4iEXT MANGLE(VertexAttribI4iEXT)
+#define glVertexAttribI4ivEXT MANGLE(VertexAttribI4ivEXT)
+#define glVertexAttribI4svEXT MANGLE(VertexAttribI4svEXT)
+#define glVertexAttribI4ubvEXT MANGLE(VertexAttribI4ubvEXT)
+#define glVertexAttribI4uiEXT MANGLE(VertexAttribI4uiEXT)
+#define glVertexAttribI4uivEXT MANGLE(VertexAttribI4uivEXT)
+#define glVertexAttribI4usvEXT MANGLE(VertexAttribI4usvEXT)
+#define glVertexAttribIPointerEXT MANGLE(VertexAttribIPointerEXT)
+#define glVertexAttribPointerARB MANGLE(VertexAttribPointerARB)
+#define glVertexAttribPointer MANGLE(VertexAttribPointer)
+#define glVertexAttribPointerNV MANGLE(VertexAttribPointerNV)
+#define glVertexAttribs1dvNV MANGLE(VertexAttribs1dvNV)
+#define glVertexAttribs1fvNV MANGLE(VertexAttribs1fvNV)
+#define glVertexAttribs1hvNV MANGLE(VertexAttribs1hvNV)
+#define glVertexAttribs1svNV MANGLE(VertexAttribs1svNV)
+#define glVertexAttribs2dvNV MANGLE(VertexAttribs2dvNV)
+#define glVertexAttribs2fvNV MANGLE(VertexAttribs2fvNV)
+#define glVertexAttribs2hvNV MANGLE(VertexAttribs2hvNV)
+#define glVertexAttribs2svNV MANGLE(VertexAttribs2svNV)
+#define glVertexAttribs3dvNV MANGLE(VertexAttribs3dvNV)
+#define glVertexAttribs3fvNV MANGLE(VertexAttribs3fvNV)
+#define glVertexAttribs3hvNV MANGLE(VertexAttribs3hvNV)
+#define glVertexAttribs3svNV MANGLE(VertexAttribs3svNV)
+#define glVertexAttribs4dvNV MANGLE(VertexAttribs4dvNV)
+#define glVertexAttribs4fvNV MANGLE(VertexAttribs4fvNV)
+#define glVertexAttribs4hvNV MANGLE(VertexAttribs4hvNV)
+#define glVertexAttribs4svNV MANGLE(VertexAttribs4svNV)
+#define glVertexAttribs4ubvNV MANGLE(VertexAttribs4ubvNV)
+#define glVertexBlendARB MANGLE(VertexBlendARB)
+#define glVertexBlendEnvfATI MANGLE(VertexBlendEnvfATI)
+#define glVertexBlendEnviATI MANGLE(VertexBlendEnviATI)
+#define glVertexPointerEXT MANGLE(VertexPointerEXT)
+#define glVertexPointerListIBM MANGLE(VertexPointerListIBM)
+#define glVertexPointer MANGLE(VertexPointer)
+#define glVertexPointervINTEL MANGLE(VertexPointervINTEL)
+#define glVertexStream1dATI MANGLE(VertexStream1dATI)
+#define glVertexStream1dvATI MANGLE(VertexStream1dvATI)
+#define glVertexStream1fATI MANGLE(VertexStream1fATI)
+#define glVertexStream1fvATI MANGLE(VertexStream1fvATI)
+#define glVertexStream1iATI MANGLE(VertexStream1iATI)
+#define glVertexStream1ivATI MANGLE(VertexStream1ivATI)
+#define glVertexStream1sATI MANGLE(VertexStream1sATI)
+#define glVertexStream1svATI MANGLE(VertexStream1svATI)
+#define glVertexStream2dATI MANGLE(VertexStream2dATI)
+#define glVertexStream2dvATI MANGLE(VertexStream2dvATI)
+#define glVertexStream2fATI MANGLE(VertexStream2fATI)
+#define glVertexStream2fvATI MANGLE(VertexStream2fvATI)
+#define glVertexStream2iATI MANGLE(VertexStream2iATI)
+#define glVertexStream2ivATI MANGLE(VertexStream2ivATI)
+#define glVertexStream2sATI MANGLE(VertexStream2sATI)
+#define glVertexStream2svATI MANGLE(VertexStream2svATI)
+#define glVertexStream3dATI MANGLE(VertexStream3dATI)
+#define glVertexStream3dvATI MANGLE(VertexStream3dvATI)
+#define glVertexStream3fATI MANGLE(VertexStream3fATI)
+#define glVertexStream3fvATI MANGLE(VertexStream3fvATI)
+#define glVertexStream3iATI MANGLE(VertexStream3iATI)
+#define glVertexStream3ivATI MANGLE(VertexStream3ivATI)
+#define glVertexStream3sATI MANGLE(VertexStream3sATI)
+#define glVertexStream3svATI MANGLE(VertexStream3svATI)
+#define glVertexStream4dATI MANGLE(VertexStream4dATI)
+#define glVertexStream4dvATI MANGLE(VertexStream4dvATI)
+#define glVertexStream4fATI MANGLE(VertexStream4fATI)
+#define glVertexStream4fvATI MANGLE(VertexStream4fvATI)
+#define glVertexStream4iATI MANGLE(VertexStream4iATI)
+#define glVertexStream4ivATI MANGLE(VertexStream4ivATI)
+#define glVertexStream4sATI MANGLE(VertexStream4sATI)
+#define glVertexStream4svATI MANGLE(VertexStream4svATI)
+#define glVertexWeightfEXT MANGLE(VertexWeightfEXT)
+#define glVertexWeightfvEXT MANGLE(VertexWeightfvEXT)
+#define glVertexWeighthNV MANGLE(VertexWeighthNV)
+#define glVertexWeighthvNV MANGLE(VertexWeighthvNV)
+#define glVertexWeightPointerEXT MANGLE(VertexWeightPointerEXT)
+#define glViewport MANGLE(Viewport)
+#define glWeightbvARB MANGLE(WeightbvARB)
+#define glWeightdvARB MANGLE(WeightdvARB)
+#define glWeightfvARB MANGLE(WeightfvARB)
+#define glWeightivARB MANGLE(WeightivARB)
+#define glWeightPointerARB MANGLE(WeightPointerARB)
+#define glWeightsvARB MANGLE(WeightsvARB)
+#define glWeightubvARB MANGLE(WeightubvARB)
+#define glWeightuivARB MANGLE(WeightuivARB)
+#define glWeightusvARB MANGLE(WeightusvARB)
+#define glWindowPos2dARB MANGLE(WindowPos2dARB)
+#define glWindowPos2d MANGLE(WindowPos2d)
+#define glWindowPos2dMESA MANGLE(WindowPos2dMESA)
+#define glWindowPos2dvARB MANGLE(WindowPos2dvARB)
+#define glWindowPos2dv MANGLE(WindowPos2dv)
+#define glWindowPos2dvMESA MANGLE(WindowPos2dvMESA)
+#define glWindowPos2fARB MANGLE(WindowPos2fARB)
+#define glWindowPos2f MANGLE(WindowPos2f)
+#define glWindowPos2fMESA MANGLE(WindowPos2fMESA)
+#define glWindowPos2fvARB MANGLE(WindowPos2fvARB)
+#define glWindowPos2fv MANGLE(WindowPos2fv)
+#define glWindowPos2fvMESA MANGLE(WindowPos2fvMESA)
+#define glWindowPos2iARB MANGLE(WindowPos2iARB)
+#define glWindowPos2i MANGLE(WindowPos2i)
+#define glWindowPos2iMESA MANGLE(WindowPos2iMESA)
+#define glWindowPos2ivARB MANGLE(WindowPos2ivARB)
+#define glWindowPos2iv MANGLE(WindowPos2iv)
+#define glWindowPos2ivMESA MANGLE(WindowPos2ivMESA)
+#define glWindowPos2sARB MANGLE(WindowPos2sARB)
+#define glWindowPos2s MANGLE(WindowPos2s)
+#define glWindowPos2sMESA MANGLE(WindowPos2sMESA)
+#define glWindowPos2svARB MANGLE(WindowPos2svARB)
+#define glWindowPos2sv MANGLE(WindowPos2sv)
+#define glWindowPos2svMESA MANGLE(WindowPos2svMESA)
+#define glWindowPos3dARB MANGLE(WindowPos3dARB)
+#define glWindowPos3d MANGLE(WindowPos3d)
+#define glWindowPos3dMESA MANGLE(WindowPos3dMESA)
+#define glWindowPos3dvARB MANGLE(WindowPos3dvARB)
+#define glWindowPos3dv MANGLE(WindowPos3dv)
+#define glWindowPos3dvMESA MANGLE(WindowPos3dvMESA)
+#define glWindowPos3fARB MANGLE(WindowPos3fARB)
+#define glWindowPos3f MANGLE(WindowPos3f)
+#define glWindowPos3fMESA MANGLE(WindowPos3fMESA)
+#define glWindowPos3fvARB MANGLE(WindowPos3fvARB)
+#define glWindowPos3fv MANGLE(WindowPos3fv)
+#define glWindowPos3fvMESA MANGLE(WindowPos3fvMESA)
+#define glWindowPos3iARB MANGLE(WindowPos3iARB)
+#define glWindowPos3i MANGLE(WindowPos3i)
+#define glWindowPos3iMESA MANGLE(WindowPos3iMESA)
+#define glWindowPos3ivARB MANGLE(WindowPos3ivARB)
+#define glWindowPos3iv MANGLE(WindowPos3iv)
+#define glWindowPos3ivMESA MANGLE(WindowPos3ivMESA)
+#define glWindowPos3sARB MANGLE(WindowPos3sARB)
+#define glWindowPos3s MANGLE(WindowPos3s)
+#define glWindowPos3sMESA MANGLE(WindowPos3sMESA)
+#define glWindowPos3svARB MANGLE(WindowPos3svARB)
+#define glWindowPos3sv MANGLE(WindowPos3sv)
+#define glWindowPos3svMESA MANGLE(WindowPos3svMESA)
+#define glWindowPos4dMESA MANGLE(WindowPos4dMESA)
+#define glWindowPos4dvMESA MANGLE(WindowPos4dvMESA)
+#define glWindowPos4fMESA MANGLE(WindowPos4fMESA)
+#define glWindowPos4fvMESA MANGLE(WindowPos4fvMESA)
+#define glWindowPos4iMESA MANGLE(WindowPos4iMESA)
+#define glWindowPos4ivMESA MANGLE(WindowPos4ivMESA)
+#define glWindowPos4sMESA MANGLE(WindowPos4sMESA)
+#define glWindowPos4svMESA MANGLE(WindowPos4svMESA)
+#define glWriteMaskEXT MANGLE(WriteMaskEXT)
+
+#endif /* GL_MANGLE_H */
diff --git a/sysroot/usr/include/GL/glext.h b/sysroot/usr/include/GL/glext.h
new file mode 100644
index 0000000..2519a6c
--- /dev/null
+++ b/sysroot/usr/include/GL/glext.h
@@ -0,0 +1,7260 @@
+#ifndef __glext_h_
+#define __glext_h_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** Copyright (c) 2007 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
+#define WIN32_LEAN_AND_MEAN 1
+#include <windows.h>
+#endif
+
+#ifndef APIENTRY
+#define APIENTRY
+#endif
+#ifndef APIENTRYP
+#define APIENTRYP APIENTRY *
+#endif
+#ifndef GLAPI
+#define GLAPI extern
+#endif
+
+/*************************************************************/
+
+/* Header file version number, required by OpenGL ABI for Linux */
+/* glext.h last updated 2007/02/12 */
+/* Current version at http://www.opengl.org/registry/ */
+#define GL_GLEXT_VERSION 39
+
+#ifndef GL_VERSION_1_2
+#define GL_UNSIGNED_BYTE_3_3_2 0x8032
+#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
+#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
+#define GL_UNSIGNED_INT_8_8_8_8 0x8035
+#define GL_UNSIGNED_INT_10_10_10_2 0x8036
+#define GL_RESCALE_NORMAL 0x803A
+#define GL_TEXTURE_BINDING_3D 0x806A
+#define GL_PACK_SKIP_IMAGES 0x806B
+#define GL_PACK_IMAGE_HEIGHT 0x806C
+#define GL_UNPACK_SKIP_IMAGES 0x806D
+#define GL_UNPACK_IMAGE_HEIGHT 0x806E
+#define GL_TEXTURE_3D 0x806F
+#define GL_PROXY_TEXTURE_3D 0x8070
+#define GL_TEXTURE_DEPTH 0x8071
+#define GL_TEXTURE_WRAP_R 0x8072
+#define GL_MAX_3D_TEXTURE_SIZE 0x8073
+#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
+#define GL_UNSIGNED_SHORT_5_6_5 0x8363
+#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
+#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365
+#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
+#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
+#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
+#define GL_BGR 0x80E0
+#define GL_BGRA 0x80E1
+#define GL_MAX_ELEMENTS_VERTICES 0x80E8
+#define GL_MAX_ELEMENTS_INDICES 0x80E9
+#define GL_CLAMP_TO_EDGE 0x812F
+#define GL_TEXTURE_MIN_LOD 0x813A
+#define GL_TEXTURE_MAX_LOD 0x813B
+#define GL_TEXTURE_BASE_LEVEL 0x813C
+#define GL_TEXTURE_MAX_LEVEL 0x813D
+#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8
+#define GL_SINGLE_COLOR 0x81F9
+#define GL_SEPARATE_SPECULAR_COLOR 0x81FA
+#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
+#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13
+#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
+#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23
+#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
+#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
+#endif
+
+#ifndef GL_ARB_imaging
+#define GL_CONSTANT_COLOR 0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
+#define GL_CONSTANT_ALPHA 0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
+#define GL_BLEND_COLOR 0x8005
+#define GL_FUNC_ADD 0x8006
+#define GL_MIN 0x8007
+#define GL_MAX 0x8008
+#define GL_BLEND_EQUATION 0x8009
+#define GL_FUNC_SUBTRACT 0x800A
+#define GL_FUNC_REVERSE_SUBTRACT 0x800B
+#define GL_CONVOLUTION_1D 0x8010
+#define GL_CONVOLUTION_2D 0x8011
+#define GL_SEPARABLE_2D 0x8012
+#define GL_CONVOLUTION_BORDER_MODE 0x8013
+#define GL_CONVOLUTION_FILTER_SCALE 0x8014
+#define GL_CONVOLUTION_FILTER_BIAS 0x8015
+#define GL_REDUCE 0x8016
+#define GL_CONVOLUTION_FORMAT 0x8017
+#define GL_CONVOLUTION_WIDTH 0x8018
+#define GL_CONVOLUTION_HEIGHT 0x8019
+#define GL_MAX_CONVOLUTION_WIDTH 0x801A
+#define GL_MAX_CONVOLUTION_HEIGHT 0x801B
+#define GL_POST_CONVOLUTION_RED_SCALE 0x801C
+#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D
+#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E
+#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F
+#define GL_POST_CONVOLUTION_RED_BIAS 0x8020
+#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021
+#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022
+#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023
+#define GL_HISTOGRAM 0x8024
+#define GL_PROXY_HISTOGRAM 0x8025
+#define GL_HISTOGRAM_WIDTH 0x8026
+#define GL_HISTOGRAM_FORMAT 0x8027
+#define GL_HISTOGRAM_RED_SIZE 0x8028
+#define GL_HISTOGRAM_GREEN_SIZE 0x8029
+#define GL_HISTOGRAM_BLUE_SIZE 0x802A
+#define GL_HISTOGRAM_ALPHA_SIZE 0x802B
+#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C
+#define GL_HISTOGRAM_SINK 0x802D
+#define GL_MINMAX 0x802E
+#define GL_MINMAX_FORMAT 0x802F
+#define GL_MINMAX_SINK 0x8030
+#define GL_TABLE_TOO_LARGE 0x8031
+#define GL_COLOR_MATRIX 0x80B1
+#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2
+#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3
+#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4
+#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5
+#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6
+#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7
+#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8
+#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9
+#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA
+#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB
+#define GL_COLOR_TABLE 0x80D0
+#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1
+#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2
+#define GL_PROXY_COLOR_TABLE 0x80D3
+#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4
+#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5
+#define GL_COLOR_TABLE_SCALE 0x80D6
+#define GL_COLOR_TABLE_BIAS 0x80D7
+#define GL_COLOR_TABLE_FORMAT 0x80D8
+#define GL_COLOR_TABLE_WIDTH 0x80D9
+#define GL_COLOR_TABLE_RED_SIZE 0x80DA
+#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB
+#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC
+#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD
+#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE
+#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF
+#define GL_CONSTANT_BORDER 0x8151
+#define GL_REPLICATE_BORDER 0x8153
+#define GL_CONVOLUTION_BORDER_COLOR 0x8154
+#endif
+
+#ifndef GL_VERSION_1_3
+#define GL_TEXTURE0 0x84C0
+#define GL_TEXTURE1 0x84C1
+#define GL_TEXTURE2 0x84C2
+#define GL_TEXTURE3 0x84C3
+#define GL_TEXTURE4 0x84C4
+#define GL_TEXTURE5 0x84C5
+#define GL_TEXTURE6 0x84C6
+#define GL_TEXTURE7 0x84C7
+#define GL_TEXTURE8 0x84C8
+#define GL_TEXTURE9 0x84C9
+#define GL_TEXTURE10 0x84CA
+#define GL_TEXTURE11 0x84CB
+#define GL_TEXTURE12 0x84CC
+#define GL_TEXTURE13 0x84CD
+#define GL_TEXTURE14 0x84CE
+#define GL_TEXTURE15 0x84CF
+#define GL_TEXTURE16 0x84D0
+#define GL_TEXTURE17 0x84D1
+#define GL_TEXTURE18 0x84D2
+#define GL_TEXTURE19 0x84D3
+#define GL_TEXTURE20 0x84D4
+#define GL_TEXTURE21 0x84D5
+#define GL_TEXTURE22 0x84D6
+#define GL_TEXTURE23 0x84D7
+#define GL_TEXTURE24 0x84D8
+#define GL_TEXTURE25 0x84D9
+#define GL_TEXTURE26 0x84DA
+#define GL_TEXTURE27 0x84DB
+#define GL_TEXTURE28 0x84DC
+#define GL_TEXTURE29 0x84DD
+#define GL_TEXTURE30 0x84DE
+#define GL_TEXTURE31 0x84DF
+#define GL_ACTIVE_TEXTURE 0x84E0
+#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
+#define GL_MAX_TEXTURE_UNITS 0x84E2
+#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3
+#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4
+#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5
+#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6
+#define GL_MULTISAMPLE 0x809D
+#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE 0x809F
+#define GL_SAMPLE_COVERAGE 0x80A0
+#define GL_SAMPLE_BUFFERS 0x80A8
+#define GL_SAMPLES 0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
+#define GL_MULTISAMPLE_BIT 0x20000000
+#define GL_NORMAL_MAP 0x8511
+#define GL_REFLECTION_MAP 0x8512
+#define GL_TEXTURE_CUBE_MAP 0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
+#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
+#define GL_COMPRESSED_ALPHA 0x84E9
+#define GL_COMPRESSED_LUMINANCE 0x84EA
+#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB
+#define GL_COMPRESSED_INTENSITY 0x84EC
+#define GL_COMPRESSED_RGB 0x84ED
+#define GL_COMPRESSED_RGBA 0x84EE
+#define GL_TEXTURE_COMPRESSION_HINT 0x84EF
+#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0
+#define GL_TEXTURE_COMPRESSED 0x86A1
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
+#define GL_CLAMP_TO_BORDER 0x812D
+#define GL_COMBINE 0x8570
+#define GL_COMBINE_RGB 0x8571
+#define GL_COMBINE_ALPHA 0x8572
+#define GL_SOURCE0_RGB 0x8580
+#define GL_SOURCE1_RGB 0x8581
+#define GL_SOURCE2_RGB 0x8582
+#define GL_SOURCE0_ALPHA 0x8588
+#define GL_SOURCE1_ALPHA 0x8589
+#define GL_SOURCE2_ALPHA 0x858A
+#define GL_OPERAND0_RGB 0x8590
+#define GL_OPERAND1_RGB 0x8591
+#define GL_OPERAND2_RGB 0x8592
+#define GL_OPERAND0_ALPHA 0x8598
+#define GL_OPERAND1_ALPHA 0x8599
+#define GL_OPERAND2_ALPHA 0x859A
+#define GL_RGB_SCALE 0x8573
+#define GL_ADD_SIGNED 0x8574
+#define GL_INTERPOLATE 0x8575
+#define GL_SUBTRACT 0x84E7
+#define GL_CONSTANT 0x8576
+#define GL_PRIMARY_COLOR 0x8577
+#define GL_PREVIOUS 0x8578
+#define GL_DOT3_RGB 0x86AE
+#define GL_DOT3_RGBA 0x86AF
+#endif
+
+#ifndef GL_VERSION_1_4
+#define GL_BLEND_DST_RGB 0x80C8
+#define GL_BLEND_SRC_RGB 0x80C9
+#define GL_BLEND_DST_ALPHA 0x80CA
+#define GL_BLEND_SRC_ALPHA 0x80CB
+#define GL_POINT_SIZE_MIN 0x8126
+#define GL_POINT_SIZE_MAX 0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128
+#define GL_POINT_DISTANCE_ATTENUATION 0x8129
+#define GL_GENERATE_MIPMAP 0x8191
+#define GL_GENERATE_MIPMAP_HINT 0x8192
+#define GL_DEPTH_COMPONENT16 0x81A5
+#define GL_DEPTH_COMPONENT24 0x81A6
+#define GL_DEPTH_COMPONENT32 0x81A7
+#define GL_MIRRORED_REPEAT 0x8370
+#define GL_FOG_COORDINATE_SOURCE 0x8450
+#define GL_FOG_COORDINATE 0x8451
+#define GL_FRAGMENT_DEPTH 0x8452
+#define GL_CURRENT_FOG_COORDINATE 0x8453
+#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454
+#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455
+#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456
+#define GL_FOG_COORDINATE_ARRAY 0x8457
+#define GL_COLOR_SUM 0x8458
+#define GL_CURRENT_SECONDARY_COLOR 0x8459
+#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A
+#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B
+#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C
+#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D
+#define GL_SECONDARY_COLOR_ARRAY 0x845E
+#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD
+#define GL_TEXTURE_FILTER_CONTROL 0x8500
+#define GL_TEXTURE_LOD_BIAS 0x8501
+#define GL_INCR_WRAP 0x8507
+#define GL_DECR_WRAP 0x8508
+#define GL_TEXTURE_DEPTH_SIZE 0x884A
+#define GL_DEPTH_TEXTURE_MODE 0x884B
+#define GL_TEXTURE_COMPARE_MODE 0x884C
+#define GL_TEXTURE_COMPARE_FUNC 0x884D
+#define GL_COMPARE_R_TO_TEXTURE 0x884E
+#endif
+
+#ifndef GL_VERSION_1_5
+#define GL_BUFFER_SIZE 0x8764
+#define GL_BUFFER_USAGE 0x8765
+#define GL_QUERY_COUNTER_BITS 0x8864
+#define GL_CURRENT_QUERY 0x8865
+#define GL_QUERY_RESULT 0x8866
+#define GL_QUERY_RESULT_AVAILABLE 0x8867
+#define GL_ARRAY_BUFFER 0x8892
+#define GL_ELEMENT_ARRAY_BUFFER 0x8893
+#define GL_ARRAY_BUFFER_BINDING 0x8894
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
+#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896
+#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897
+#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898
+#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899
+#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A
+#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B
+#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C
+#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D
+#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E
+#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
+#define GL_READ_ONLY 0x88B8
+#define GL_WRITE_ONLY 0x88B9
+#define GL_READ_WRITE 0x88BA
+#define GL_BUFFER_ACCESS 0x88BB
+#define GL_BUFFER_MAPPED 0x88BC
+#define GL_BUFFER_MAP_POINTER 0x88BD
+#define GL_STREAM_DRAW 0x88E0
+#define GL_STREAM_READ 0x88E1
+#define GL_STREAM_COPY 0x88E2
+#define GL_STATIC_DRAW 0x88E4
+#define GL_STATIC_READ 0x88E5
+#define GL_STATIC_COPY 0x88E6
+#define GL_DYNAMIC_DRAW 0x88E8
+#define GL_DYNAMIC_READ 0x88E9
+#define GL_DYNAMIC_COPY 0x88EA
+#define GL_SAMPLES_PASSED 0x8914
+#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE
+#define GL_FOG_COORD GL_FOG_COORDINATE
+#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE
+#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE
+#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE
+#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER
+#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY
+#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING
+#define GL_SRC0_RGB GL_SOURCE0_RGB
+#define GL_SRC1_RGB GL_SOURCE1_RGB
+#define GL_SRC2_RGB GL_SOURCE2_RGB
+#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA
+#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA
+#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA
+#endif
+
+#ifndef GL_VERSION_2_0
+#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION
+#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
+#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
+#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
+#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
+#define GL_CURRENT_VERTEX_ATTRIB 0x8626
+#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642
+#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643
+#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
+#define GL_STENCIL_BACK_FUNC 0x8800
+#define GL_STENCIL_BACK_FAIL 0x8801
+#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
+#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
+#define GL_MAX_DRAW_BUFFERS 0x8824
+#define GL_DRAW_BUFFER0 0x8825
+#define GL_DRAW_BUFFER1 0x8826
+#define GL_DRAW_BUFFER2 0x8827
+#define GL_DRAW_BUFFER3 0x8828
+#define GL_DRAW_BUFFER4 0x8829
+#define GL_DRAW_BUFFER5 0x882A
+#define GL_DRAW_BUFFER6 0x882B
+#define GL_DRAW_BUFFER7 0x882C
+#define GL_DRAW_BUFFER8 0x882D
+#define GL_DRAW_BUFFER9 0x882E
+#define GL_DRAW_BUFFER10 0x882F
+#define GL_DRAW_BUFFER11 0x8830
+#define GL_DRAW_BUFFER12 0x8831
+#define GL_DRAW_BUFFER13 0x8832
+#define GL_DRAW_BUFFER14 0x8833
+#define GL_DRAW_BUFFER15 0x8834
+#define GL_BLEND_EQUATION_ALPHA 0x883D
+#define GL_POINT_SPRITE 0x8861
+#define GL_COORD_REPLACE 0x8862
+#define GL_MAX_VERTEX_ATTRIBS 0x8869
+#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
+#define GL_MAX_TEXTURE_COORDS 0x8871
+#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
+#define GL_FRAGMENT_SHADER 0x8B30
+#define GL_VERTEX_SHADER 0x8B31
+#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
+#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A
+#define GL_MAX_VARYING_FLOATS 0x8B4B
+#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
+#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
+#define GL_SHADER_TYPE 0x8B4F
+#define GL_FLOAT_VEC2 0x8B50
+#define GL_FLOAT_VEC3 0x8B51
+#define GL_FLOAT_VEC4 0x8B52
+#define GL_INT_VEC2 0x8B53
+#define GL_INT_VEC3 0x8B54
+#define GL_INT_VEC4 0x8B55
+#define GL_BOOL 0x8B56
+#define GL_BOOL_VEC2 0x8B57
+#define GL_BOOL_VEC3 0x8B58
+#define GL_BOOL_VEC4 0x8B59
+#define GL_FLOAT_MAT2 0x8B5A
+#define GL_FLOAT_MAT3 0x8B5B
+#define GL_FLOAT_MAT4 0x8B5C
+#define GL_SAMPLER_1D 0x8B5D
+#define GL_SAMPLER_2D 0x8B5E
+#define GL_SAMPLER_3D 0x8B5F
+#define GL_SAMPLER_CUBE 0x8B60
+#define GL_SAMPLER_1D_SHADOW 0x8B61
+#define GL_SAMPLER_2D_SHADOW 0x8B62
+#define GL_DELETE_STATUS 0x8B80
+#define GL_COMPILE_STATUS 0x8B81
+#define GL_LINK_STATUS 0x8B82
+#define GL_VALIDATE_STATUS 0x8B83
+#define GL_INFO_LOG_LENGTH 0x8B84
+#define GL_ATTACHED_SHADERS 0x8B85
+#define GL_ACTIVE_UNIFORMS 0x8B86
+#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
+#define GL_SHADER_SOURCE_LENGTH 0x8B88
+#define GL_ACTIVE_ATTRIBUTES 0x8B89
+#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
+#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B
+#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
+#define GL_CURRENT_PROGRAM 0x8B8D
+#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0
+#define GL_LOWER_LEFT 0x8CA1
+#define GL_UPPER_LEFT 0x8CA2
+#define GL_STENCIL_BACK_REF 0x8CA3
+#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
+#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
+#endif
+
+#ifndef GL_VERSION_2_1
+#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F
+#define GL_PIXEL_PACK_BUFFER 0x88EB
+#define GL_PIXEL_UNPACK_BUFFER 0x88EC
+#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED
+#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF
+#define GL_FLOAT_MAT2x3 0x8B65
+#define GL_FLOAT_MAT2x4 0x8B66
+#define GL_FLOAT_MAT3x2 0x8B67
+#define GL_FLOAT_MAT3x4 0x8B68
+#define GL_FLOAT_MAT4x2 0x8B69
+#define GL_FLOAT_MAT4x3 0x8B6A
+#define GL_SRGB 0x8C40
+#define GL_SRGB8 0x8C41
+#define GL_SRGB_ALPHA 0x8C42
+#define GL_SRGB8_ALPHA8 0x8C43
+#define GL_SLUMINANCE_ALPHA 0x8C44
+#define GL_SLUMINANCE8_ALPHA8 0x8C45
+#define GL_SLUMINANCE 0x8C46
+#define GL_SLUMINANCE8 0x8C47
+#define GL_COMPRESSED_SRGB 0x8C48
+#define GL_COMPRESSED_SRGB_ALPHA 0x8C49
+#define GL_COMPRESSED_SLUMINANCE 0x8C4A
+#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B
+#endif
+
+#ifndef GL_ARB_multitexture
+#define GL_TEXTURE0_ARB 0x84C0
+#define GL_TEXTURE1_ARB 0x84C1
+#define GL_TEXTURE2_ARB 0x84C2
+#define GL_TEXTURE3_ARB 0x84C3
+#define GL_TEXTURE4_ARB 0x84C4
+#define GL_TEXTURE5_ARB 0x84C5
+#define GL_TEXTURE6_ARB 0x84C6
+#define GL_TEXTURE7_ARB 0x84C7
+#define GL_TEXTURE8_ARB 0x84C8
+#define GL_TEXTURE9_ARB 0x84C9
+#define GL_TEXTURE10_ARB 0x84CA
+#define GL_TEXTURE11_ARB 0x84CB
+#define GL_TEXTURE12_ARB 0x84CC
+#define GL_TEXTURE13_ARB 0x84CD
+#define GL_TEXTURE14_ARB 0x84CE
+#define GL_TEXTURE15_ARB 0x84CF
+#define GL_TEXTURE16_ARB 0x84D0
+#define GL_TEXTURE17_ARB 0x84D1
+#define GL_TEXTURE18_ARB 0x84D2
+#define GL_TEXTURE19_ARB 0x84D3
+#define GL_TEXTURE20_ARB 0x84D4
+#define GL_TEXTURE21_ARB 0x84D5
+#define GL_TEXTURE22_ARB 0x84D6
+#define GL_TEXTURE23_ARB 0x84D7
+#define GL_TEXTURE24_ARB 0x84D8
+#define GL_TEXTURE25_ARB 0x84D9
+#define GL_TEXTURE26_ARB 0x84DA
+#define GL_TEXTURE27_ARB 0x84DB
+#define GL_TEXTURE28_ARB 0x84DC
+#define GL_TEXTURE29_ARB 0x84DD
+#define GL_TEXTURE30_ARB 0x84DE
+#define GL_TEXTURE31_ARB 0x84DF
+#define GL_ACTIVE_TEXTURE_ARB 0x84E0
+#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1
+#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2
+#endif
+
+#ifndef GL_ARB_transpose_matrix
+#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3
+#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4
+#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5
+#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6
+#endif
+
+#ifndef GL_ARB_multisample
+#define GL_MULTISAMPLE_ARB 0x809D
+#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F
+#define GL_SAMPLE_COVERAGE_ARB 0x80A0
+#define GL_SAMPLE_BUFFERS_ARB 0x80A8
+#define GL_SAMPLES_ARB 0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB
+#define GL_MULTISAMPLE_BIT_ARB 0x20000000
+#endif
+
+#ifndef GL_ARB_texture_env_add
+#endif
+
+#ifndef GL_ARB_texture_cube_map
+#define GL_NORMAL_MAP_ARB 0x8511
+#define GL_REFLECTION_MAP_ARB 0x8512
+#define GL_TEXTURE_CUBE_MAP_ARB 0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A
+#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C
+#endif
+
+#ifndef GL_ARB_texture_compression
+#define GL_COMPRESSED_ALPHA_ARB 0x84E9
+#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA
+#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB
+#define GL_COMPRESSED_INTENSITY_ARB 0x84EC
+#define GL_COMPRESSED_RGB_ARB 0x84ED
+#define GL_COMPRESSED_RGBA_ARB 0x84EE
+#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF
+#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0
+#define GL_TEXTURE_COMPRESSED_ARB 0x86A1
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3
+#endif
+
+#ifndef GL_ARB_texture_border_clamp
+#define GL_CLAMP_TO_BORDER_ARB 0x812D
+#endif
+
+#ifndef GL_ARB_point_parameters
+#define GL_POINT_SIZE_MIN_ARB 0x8126
+#define GL_POINT_SIZE_MAX_ARB 0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128
+#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129
+#endif
+
+#ifndef GL_ARB_vertex_blend
+#define GL_MAX_VERTEX_UNITS_ARB 0x86A4
+#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5
+#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6
+#define GL_VERTEX_BLEND_ARB 0x86A7
+#define GL_CURRENT_WEIGHT_ARB 0x86A8
+#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9
+#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA
+#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB
+#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC
+#define GL_WEIGHT_ARRAY_ARB 0x86AD
+#define GL_MODELVIEW0_ARB 0x1700
+#define GL_MODELVIEW1_ARB 0x850A
+#define GL_MODELVIEW2_ARB 0x8722
+#define GL_MODELVIEW3_ARB 0x8723
+#define GL_MODELVIEW4_ARB 0x8724
+#define GL_MODELVIEW5_ARB 0x8725
+#define GL_MODELVIEW6_ARB 0x8726
+#define GL_MODELVIEW7_ARB 0x8727
+#define GL_MODELVIEW8_ARB 0x8728
+#define GL_MODELVIEW9_ARB 0x8729
+#define GL_MODELVIEW10_ARB 0x872A
+#define GL_MODELVIEW11_ARB 0x872B
+#define GL_MODELVIEW12_ARB 0x872C
+#define GL_MODELVIEW13_ARB 0x872D
+#define GL_MODELVIEW14_ARB 0x872E
+#define GL_MODELVIEW15_ARB 0x872F
+#define GL_MODELVIEW16_ARB 0x8730
+#define GL_MODELVIEW17_ARB 0x8731
+#define GL_MODELVIEW18_ARB 0x8732
+#define GL_MODELVIEW19_ARB 0x8733
+#define GL_MODELVIEW20_ARB 0x8734
+#define GL_MODELVIEW21_ARB 0x8735
+#define GL_MODELVIEW22_ARB 0x8736
+#define GL_MODELVIEW23_ARB 0x8737
+#define GL_MODELVIEW24_ARB 0x8738
+#define GL_MODELVIEW25_ARB 0x8739
+#define GL_MODELVIEW26_ARB 0x873A
+#define GL_MODELVIEW27_ARB 0x873B
+#define GL_MODELVIEW28_ARB 0x873C
+#define GL_MODELVIEW29_ARB 0x873D
+#define GL_MODELVIEW30_ARB 0x873E
+#define GL_MODELVIEW31_ARB 0x873F
+#endif
+
+#ifndef GL_ARB_matrix_palette
+#define GL_MATRIX_PALETTE_ARB 0x8840
+#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841
+#define GL_MAX_PALETTE_MATRICES_ARB 0x8842
+#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843
+#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844
+#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845
+#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846
+#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847
+#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848
+#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849
+#endif
+
+#ifndef GL_ARB_texture_env_combine
+#define GL_COMBINE_ARB 0x8570
+#define GL_COMBINE_RGB_ARB 0x8571
+#define GL_COMBINE_ALPHA_ARB 0x8572
+#define GL_SOURCE0_RGB_ARB 0x8580
+#define GL_SOURCE1_RGB_ARB 0x8581
+#define GL_SOURCE2_RGB_ARB 0x8582
+#define GL_SOURCE0_ALPHA_ARB 0x8588
+#define GL_SOURCE1_ALPHA_ARB 0x8589
+#define GL_SOURCE2_ALPHA_ARB 0x858A
+#define GL_OPERAND0_RGB_ARB 0x8590
+#define GL_OPERAND1_RGB_ARB 0x8591
+#define GL_OPERAND2_RGB_ARB 0x8592
+#define GL_OPERAND0_ALPHA_ARB 0x8598
+#define GL_OPERAND1_ALPHA_ARB 0x8599
+#define GL_OPERAND2_ALPHA_ARB 0x859A
+#define GL_RGB_SCALE_ARB 0x8573
+#define GL_ADD_SIGNED_ARB 0x8574
+#define GL_INTERPOLATE_ARB 0x8575
+#define GL_SUBTRACT_ARB 0x84E7
+#define GL_CONSTANT_ARB 0x8576
+#define GL_PRIMARY_COLOR_ARB 0x8577
+#define GL_PREVIOUS_ARB 0x8578
+#endif
+
+#ifndef GL_ARB_texture_env_crossbar
+#endif
+
+#ifndef GL_ARB_texture_env_dot3
+#define GL_DOT3_RGB_ARB 0x86AE
+#define GL_DOT3_RGBA_ARB 0x86AF
+#endif
+
+#ifndef GL_ARB_texture_mirrored_repeat
+#define GL_MIRRORED_REPEAT_ARB 0x8370
+#endif
+
+#ifndef GL_ARB_depth_texture
+#define GL_DEPTH_COMPONENT16_ARB 0x81A5
+#define GL_DEPTH_COMPONENT24_ARB 0x81A6
+#define GL_DEPTH_COMPONENT32_ARB 0x81A7
+#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A
+#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B
+#endif
+
+#ifndef GL_ARB_shadow
+#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C
+#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D
+#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E
+#endif
+
+#ifndef GL_ARB_shadow_ambient
+#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF
+#endif
+
+#ifndef GL_ARB_window_pos
+#endif
+
+#ifndef GL_ARB_vertex_program
+#define GL_COLOR_SUM_ARB 0x8458
+#define GL_VERTEX_PROGRAM_ARB 0x8620
+#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622
+#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623
+#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624
+#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625
+#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626
+#define GL_PROGRAM_LENGTH_ARB 0x8627
+#define GL_PROGRAM_STRING_ARB 0x8628
+#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E
+#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F
+#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640
+#define GL_CURRENT_MATRIX_ARB 0x8641
+#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642
+#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643
+#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645
+#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B
+#define GL_PROGRAM_BINDING_ARB 0x8677
+#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869
+#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A
+#define GL_PROGRAM_ERROR_STRING_ARB 0x8874
+#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875
+#define GL_PROGRAM_FORMAT_ARB 0x8876
+#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0
+#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1
+#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2
+#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3
+#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4
+#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5
+#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6
+#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7
+#define GL_PROGRAM_PARAMETERS_ARB 0x88A8
+#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9
+#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA
+#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB
+#define GL_PROGRAM_ATTRIBS_ARB 0x88AC
+#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD
+#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE
+#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF
+#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0
+#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1
+#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2
+#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3
+#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4
+#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5
+#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6
+#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7
+#define GL_MATRIX0_ARB 0x88C0
+#define GL_MATRIX1_ARB 0x88C1
+#define GL_MATRIX2_ARB 0x88C2
+#define GL_MATRIX3_ARB 0x88C3
+#define GL_MATRIX4_ARB 0x88C4
+#define GL_MATRIX5_ARB 0x88C5
+#define GL_MATRIX6_ARB 0x88C6
+#define GL_MATRIX7_ARB 0x88C7
+#define GL_MATRIX8_ARB 0x88C8
+#define GL_MATRIX9_ARB 0x88C9
+#define GL_MATRIX10_ARB 0x88CA
+#define GL_MATRIX11_ARB 0x88CB
+#define GL_MATRIX12_ARB 0x88CC
+#define GL_MATRIX13_ARB 0x88CD
+#define GL_MATRIX14_ARB 0x88CE
+#define GL_MATRIX15_ARB 0x88CF
+#define GL_MATRIX16_ARB 0x88D0
+#define GL_MATRIX17_ARB 0x88D1
+#define GL_MATRIX18_ARB 0x88D2
+#define GL_MATRIX19_ARB 0x88D3
+#define GL_MATRIX20_ARB 0x88D4
+#define GL_MATRIX21_ARB 0x88D5
+#define GL_MATRIX22_ARB 0x88D6
+#define GL_MATRIX23_ARB 0x88D7
+#define GL_MATRIX24_ARB 0x88D8
+#define GL_MATRIX25_ARB 0x88D9
+#define GL_MATRIX26_ARB 0x88DA
+#define GL_MATRIX27_ARB 0x88DB
+#define GL_MATRIX28_ARB 0x88DC
+#define GL_MATRIX29_ARB 0x88DD
+#define GL_MATRIX30_ARB 0x88DE
+#define GL_MATRIX31_ARB 0x88DF
+#endif
+
+#ifndef GL_ARB_fragment_program
+#define GL_FRAGMENT_PROGRAM_ARB 0x8804
+#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805
+#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806
+#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807
+#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808
+#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809
+#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A
+#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B
+#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C
+#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D
+#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E
+#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F
+#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810
+#define GL_MAX_TEXTURE_COORDS_ARB 0x8871
+#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872
+#endif
+
+#ifndef GL_ARB_vertex_buffer_object
+#define GL_BUFFER_SIZE_ARB 0x8764
+#define GL_BUFFER_USAGE_ARB 0x8765
+#define GL_ARRAY_BUFFER_ARB 0x8892
+#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893
+#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895
+#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896
+#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897
+#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898
+#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899
+#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A
+#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B
+#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C
+#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D
+#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E
+#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F
+#define GL_READ_ONLY_ARB 0x88B8
+#define GL_WRITE_ONLY_ARB 0x88B9
+#define GL_READ_WRITE_ARB 0x88BA
+#define GL_BUFFER_ACCESS_ARB 0x88BB
+#define GL_BUFFER_MAPPED_ARB 0x88BC
+#define GL_BUFFER_MAP_POINTER_ARB 0x88BD
+#define GL_STREAM_DRAW_ARB 0x88E0
+#define GL_STREAM_READ_ARB 0x88E1
+#define GL_STREAM_COPY_ARB 0x88E2
+#define GL_STATIC_DRAW_ARB 0x88E4
+#define GL_STATIC_READ_ARB 0x88E5
+#define GL_STATIC_COPY_ARB 0x88E6
+#define GL_DYNAMIC_DRAW_ARB 0x88E8
+#define GL_DYNAMIC_READ_ARB 0x88E9
+#define GL_DYNAMIC_COPY_ARB 0x88EA
+#endif
+
+#ifndef GL_ARB_occlusion_query
+#define GL_QUERY_COUNTER_BITS_ARB 0x8864
+#define GL_CURRENT_QUERY_ARB 0x8865
+#define GL_QUERY_RESULT_ARB 0x8866
+#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867
+#define GL_SAMPLES_PASSED_ARB 0x8914
+#endif
+
+#ifndef GL_ARB_shader_objects
+#define GL_PROGRAM_OBJECT_ARB 0x8B40
+#define GL_SHADER_OBJECT_ARB 0x8B48
+#define GL_OBJECT_TYPE_ARB 0x8B4E
+#define GL_OBJECT_SUBTYPE_ARB 0x8B4F
+#define GL_FLOAT_VEC2_ARB 0x8B50
+#define GL_FLOAT_VEC3_ARB 0x8B51
+#define GL_FLOAT_VEC4_ARB 0x8B52
+#define GL_INT_VEC2_ARB 0x8B53
+#define GL_INT_VEC3_ARB 0x8B54
+#define GL_INT_VEC4_ARB 0x8B55
+#define GL_BOOL_ARB 0x8B56
+#define GL_BOOL_VEC2_ARB 0x8B57
+#define GL_BOOL_VEC3_ARB 0x8B58
+#define GL_BOOL_VEC4_ARB 0x8B59
+#define GL_FLOAT_MAT2_ARB 0x8B5A
+#define GL_FLOAT_MAT3_ARB 0x8B5B
+#define GL_FLOAT_MAT4_ARB 0x8B5C
+#define GL_SAMPLER_1D_ARB 0x8B5D
+#define GL_SAMPLER_2D_ARB 0x8B5E
+#define GL_SAMPLER_3D_ARB 0x8B5F
+#define GL_SAMPLER_CUBE_ARB 0x8B60
+#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61
+#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62
+#define GL_SAMPLER_2D_RECT_ARB 0x8B63
+#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64
+#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80
+#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81
+#define GL_OBJECT_LINK_STATUS_ARB 0x8B82
+#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83
+#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84
+#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85
+#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86
+#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87
+#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88
+#endif
+
+#ifndef GL_ARB_vertex_shader
+#define GL_VERTEX_SHADER_ARB 0x8B31
+#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A
+#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B
+#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C
+#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D
+#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89
+#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A
+#endif
+
+#ifndef GL_ARB_fragment_shader
+#define GL_FRAGMENT_SHADER_ARB 0x8B30
+#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49
+#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B
+#endif
+
+#ifndef GL_ARB_shading_language_100
+#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C
+#endif
+
+#ifndef GL_ARB_texture_non_power_of_two
+#endif
+
+#ifndef GL_ARB_point_sprite
+#define GL_POINT_SPRITE_ARB 0x8861
+#define GL_COORD_REPLACE_ARB 0x8862
+#endif
+
+#ifndef GL_ARB_fragment_program_shadow
+#endif
+
+#ifndef GL_ARB_draw_buffers
+#define GL_MAX_DRAW_BUFFERS_ARB 0x8824
+#define GL_DRAW_BUFFER0_ARB 0x8825
+#define GL_DRAW_BUFFER1_ARB 0x8826
+#define GL_DRAW_BUFFER2_ARB 0x8827
+#define GL_DRAW_BUFFER3_ARB 0x8828
+#define GL_DRAW_BUFFER4_ARB 0x8829
+#define GL_DRAW_BUFFER5_ARB 0x882A
+#define GL_DRAW_BUFFER6_ARB 0x882B
+#define GL_DRAW_BUFFER7_ARB 0x882C
+#define GL_DRAW_BUFFER8_ARB 0x882D
+#define GL_DRAW_BUFFER9_ARB 0x882E
+#define GL_DRAW_BUFFER10_ARB 0x882F
+#define GL_DRAW_BUFFER11_ARB 0x8830
+#define GL_DRAW_BUFFER12_ARB 0x8831
+#define GL_DRAW_BUFFER13_ARB 0x8832
+#define GL_DRAW_BUFFER14_ARB 0x8833
+#define GL_DRAW_BUFFER15_ARB 0x8834
+#endif
+
+#ifndef GL_ARB_texture_rectangle
+#define GL_TEXTURE_RECTANGLE_ARB 0x84F5
+#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6
+#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7
+#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8
+#endif
+
+#ifndef GL_ARB_color_buffer_float
+#define GL_RGBA_FLOAT_MODE_ARB 0x8820
+#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A
+#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B
+#define GL_CLAMP_READ_COLOR_ARB 0x891C
+#define GL_FIXED_ONLY_ARB 0x891D
+#endif
+
+#ifndef GL_ARB_half_float_pixel
+#define GL_HALF_FLOAT_ARB 0x140B
+#endif
+
+#ifndef GL_ARB_texture_float
+#define GL_TEXTURE_RED_TYPE_ARB 0x8C10
+#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11
+#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12
+#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13
+#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14
+#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15
+#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16
+#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17
+#define GL_RGBA32F_ARB 0x8814
+#define GL_RGB32F_ARB 0x8815
+#define GL_ALPHA32F_ARB 0x8816
+#define GL_INTENSITY32F_ARB 0x8817
+#define GL_LUMINANCE32F_ARB 0x8818
+#define GL_LUMINANCE_ALPHA32F_ARB 0x8819
+#define GL_RGBA16F_ARB 0x881A
+#define GL_RGB16F_ARB 0x881B
+#define GL_ALPHA16F_ARB 0x881C
+#define GL_INTENSITY16F_ARB 0x881D
+#define GL_LUMINANCE16F_ARB 0x881E
+#define GL_LUMINANCE_ALPHA16F_ARB 0x881F
+#endif
+
+#ifndef GL_ARB_pixel_buffer_object
+#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB
+#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC
+#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED
+#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF
+#endif
+
+#ifndef GL_EXT_abgr
+#define GL_ABGR_EXT 0x8000
+#endif
+
+#ifndef GL_EXT_blend_color
+#define GL_CONSTANT_COLOR_EXT 0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002
+#define GL_CONSTANT_ALPHA_EXT 0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004
+#define GL_BLEND_COLOR_EXT 0x8005
+#endif
+
+#ifndef GL_EXT_polygon_offset
+#define GL_POLYGON_OFFSET_EXT 0x8037
+#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038
+#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039
+#endif
+
+#ifndef GL_EXT_texture
+#define GL_ALPHA4_EXT 0x803B
+#define GL_ALPHA8_EXT 0x803C
+#define GL_ALPHA12_EXT 0x803D
+#define GL_ALPHA16_EXT 0x803E
+#define GL_LUMINANCE4_EXT 0x803F
+#define GL_LUMINANCE8_EXT 0x8040
+#define GL_LUMINANCE12_EXT 0x8041
+#define GL_LUMINANCE16_EXT 0x8042
+#define GL_LUMINANCE4_ALPHA4_EXT 0x8043
+#define GL_LUMINANCE6_ALPHA2_EXT 0x8044
+#define GL_LUMINANCE8_ALPHA8_EXT 0x8045
+#define GL_LUMINANCE12_ALPHA4_EXT 0x8046
+#define GL_LUMINANCE12_ALPHA12_EXT 0x8047
+#define GL_LUMINANCE16_ALPHA16_EXT 0x8048
+#define GL_INTENSITY_EXT 0x8049
+#define GL_INTENSITY4_EXT 0x804A
+#define GL_INTENSITY8_EXT 0x804B
+#define GL_INTENSITY12_EXT 0x804C
+#define GL_INTENSITY16_EXT 0x804D
+#define GL_RGB2_EXT 0x804E
+#define GL_RGB4_EXT 0x804F
+#define GL_RGB5_EXT 0x8050
+#define GL_RGB8_EXT 0x8051
+#define GL_RGB10_EXT 0x8052
+#define GL_RGB12_EXT 0x8053
+#define GL_RGB16_EXT 0x8054
+#define GL_RGBA2_EXT 0x8055
+#define GL_RGBA4_EXT 0x8056
+#define GL_RGB5_A1_EXT 0x8057
+#define GL_RGBA8_EXT 0x8058
+#define GL_RGB10_A2_EXT 0x8059
+#define GL_RGBA12_EXT 0x805A
+#define GL_RGBA16_EXT 0x805B
+#define GL_TEXTURE_RED_SIZE_EXT 0x805C
+#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D
+#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E
+#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F
+#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060
+#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061
+#define GL_REPLACE_EXT 0x8062
+#define GL_PROXY_TEXTURE_1D_EXT 0x8063
+#define GL_PROXY_TEXTURE_2D_EXT 0x8064
+#define GL_TEXTURE_TOO_LARGE_EXT 0x8065
+#endif
+
+#ifndef GL_EXT_texture3D
+#define GL_PACK_SKIP_IMAGES_EXT 0x806B
+#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C
+#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D
+#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E
+#define GL_TEXTURE_3D_EXT 0x806F
+#define GL_PROXY_TEXTURE_3D_EXT 0x8070
+#define GL_TEXTURE_DEPTH_EXT 0x8071
+#define GL_TEXTURE_WRAP_R_EXT 0x8072
+#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073
+#endif
+
+#ifndef GL_SGIS_texture_filter4
+#define GL_FILTER4_SGIS 0x8146
+#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147
+#endif
+
+#ifndef GL_EXT_subtexture
+#endif
+
+#ifndef GL_EXT_copy_texture
+#endif
+
+#ifndef GL_EXT_histogram
+#define GL_HISTOGRAM_EXT 0x8024
+#define GL_PROXY_HISTOGRAM_EXT 0x8025
+#define GL_HISTOGRAM_WIDTH_EXT 0x8026
+#define GL_HISTOGRAM_FORMAT_EXT 0x8027
+#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028
+#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029
+#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A
+#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B
+#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C
+#define GL_HISTOGRAM_SINK_EXT 0x802D
+#define GL_MINMAX_EXT 0x802E
+#define GL_MINMAX_FORMAT_EXT 0x802F
+#define GL_MINMAX_SINK_EXT 0x8030
+#define GL_TABLE_TOO_LARGE_EXT 0x8031
+#endif
+
+#ifndef GL_EXT_convolution
+#define GL_CONVOLUTION_1D_EXT 0x8010
+#define GL_CONVOLUTION_2D_EXT 0x8011
+#define GL_SEPARABLE_2D_EXT 0x8012
+#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013
+#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014
+#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015
+#define GL_REDUCE_EXT 0x8016
+#define GL_CONVOLUTION_FORMAT_EXT 0x8017
+#define GL_CONVOLUTION_WIDTH_EXT 0x8018
+#define GL_CONVOLUTION_HEIGHT_EXT 0x8019
+#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A
+#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B
+#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C
+#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D
+#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E
+#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F
+#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020
+#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021
+#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022
+#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023
+#endif
+
+#ifndef GL_SGI_color_matrix
+#define GL_COLOR_MATRIX_SGI 0x80B1
+#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2
+#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3
+#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4
+#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5
+#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6
+#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7
+#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8
+#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9
+#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA
+#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB
+#endif
+
+#ifndef GL_SGI_color_table
+#define GL_COLOR_TABLE_SGI 0x80D0
+#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1
+#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2
+#define GL_PROXY_COLOR_TABLE_SGI 0x80D3
+#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4
+#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5
+#define GL_COLOR_TABLE_SCALE_SGI 0x80D6
+#define GL_COLOR_TABLE_BIAS_SGI 0x80D7
+#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8
+#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9
+#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA
+#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB
+#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC
+#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD
+#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE
+#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF
+#endif
+
+#ifndef GL_SGIS_pixel_texture
+#define GL_PIXEL_TEXTURE_SGIS 0x8353
+#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354
+#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355
+#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356
+#endif
+
+#ifndef GL_SGIX_pixel_texture
+#define GL_PIXEL_TEX_GEN_SGIX 0x8139
+#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B
+#endif
+
+#ifndef GL_SGIS_texture4D
+#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130
+#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131
+#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132
+#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133
+#define GL_TEXTURE_4D_SGIS 0x8134
+#define GL_PROXY_TEXTURE_4D_SGIS 0x8135
+#define GL_TEXTURE_4DSIZE_SGIS 0x8136
+#define GL_TEXTURE_WRAP_Q_SGIS 0x8137
+#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138
+#define GL_TEXTURE_4D_BINDING_SGIS 0x814F
+#endif
+
+#ifndef GL_SGI_texture_color_table
+#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC
+#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD
+#endif
+
+#ifndef GL_EXT_cmyka
+#define GL_CMYK_EXT 0x800C
+#define GL_CMYKA_EXT 0x800D
+#define GL_PACK_CMYK_HINT_EXT 0x800E
+#define GL_UNPACK_CMYK_HINT_EXT 0x800F
+#endif
+
+#ifndef GL_EXT_texture_object
+#define GL_TEXTURE_PRIORITY_EXT 0x8066
+#define GL_TEXTURE_RESIDENT_EXT 0x8067
+#define GL_TEXTURE_1D_BINDING_EXT 0x8068
+#define GL_TEXTURE_2D_BINDING_EXT 0x8069
+#define GL_TEXTURE_3D_BINDING_EXT 0x806A
+#endif
+
+#ifndef GL_SGIS_detail_texture
+#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095
+#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096
+#define GL_LINEAR_DETAIL_SGIS 0x8097
+#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098
+#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099
+#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A
+#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B
+#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C
+#endif
+
+#ifndef GL_SGIS_sharpen_texture
+#define GL_LINEAR_SHARPEN_SGIS 0x80AD
+#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE
+#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF
+#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0
+#endif
+
+#ifndef GL_EXT_packed_pixels
+#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032
+#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033
+#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034
+#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035
+#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036
+#endif
+
+#ifndef GL_SGIS_texture_lod
+#define GL_TEXTURE_MIN_LOD_SGIS 0x813A
+#define GL_TEXTURE_MAX_LOD_SGIS 0x813B
+#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C
+#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D
+#endif
+
+#ifndef GL_SGIS_multisample
+#define GL_MULTISAMPLE_SGIS 0x809D
+#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F
+#define GL_SAMPLE_MASK_SGIS 0x80A0
+#define GL_1PASS_SGIS 0x80A1
+#define GL_2PASS_0_SGIS 0x80A2
+#define GL_2PASS_1_SGIS 0x80A3
+#define GL_4PASS_0_SGIS 0x80A4
+#define GL_4PASS_1_SGIS 0x80A5
+#define GL_4PASS_2_SGIS 0x80A6
+#define GL_4PASS_3_SGIS 0x80A7
+#define GL_SAMPLE_BUFFERS_SGIS 0x80A8
+#define GL_SAMPLES_SGIS 0x80A9
+#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA
+#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB
+#define GL_SAMPLE_PATTERN_SGIS 0x80AC
+#endif
+
+#ifndef GL_EXT_rescale_normal
+#define GL_RESCALE_NORMAL_EXT 0x803A
+#endif
+
+#ifndef GL_EXT_vertex_array
+#define GL_VERTEX_ARRAY_EXT 0x8074
+#define GL_NORMAL_ARRAY_EXT 0x8075
+#define GL_COLOR_ARRAY_EXT 0x8076
+#define GL_INDEX_ARRAY_EXT 0x8077
+#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078
+#define GL_EDGE_FLAG_ARRAY_EXT 0x8079
+#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A
+#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B
+#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C
+#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D
+#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E
+#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F
+#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080
+#define GL_COLOR_ARRAY_SIZE_EXT 0x8081
+#define GL_COLOR_ARRAY_TYPE_EXT 0x8082
+#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083
+#define GL_COLOR_ARRAY_COUNT_EXT 0x8084
+#define GL_INDEX_ARRAY_TYPE_EXT 0x8085
+#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086
+#define GL_INDEX_ARRAY_COUNT_EXT 0x8087
+#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088
+#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089
+#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A
+#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B
+#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C
+#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D
+#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E
+#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F
+#define GL_COLOR_ARRAY_POINTER_EXT 0x8090
+#define GL_INDEX_ARRAY_POINTER_EXT 0x8091
+#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092
+#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093
+#endif
+
+#ifndef GL_EXT_misc_attribute
+#endif
+
+#ifndef GL_SGIS_generate_mipmap
+#define GL_GENERATE_MIPMAP_SGIS 0x8191
+#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192
+#endif
+
+#ifndef GL_SGIX_clipmap
+#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170
+#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171
+#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172
+#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173
+#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174
+#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175
+#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176
+#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177
+#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178
+#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D
+#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E
+#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F
+#endif
+
+#ifndef GL_SGIX_shadow
+#define GL_TEXTURE_COMPARE_SGIX 0x819A
+#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B
+#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C
+#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D
+#endif
+
+#ifndef GL_SGIS_texture_edge_clamp
+#define GL_CLAMP_TO_EDGE_SGIS 0x812F
+#endif
+
+#ifndef GL_SGIS_texture_border_clamp
+#define GL_CLAMP_TO_BORDER_SGIS 0x812D
+#endif
+
+#ifndef GL_EXT_blend_minmax
+#define GL_FUNC_ADD_EXT 0x8006
+#define GL_MIN_EXT 0x8007
+#define GL_MAX_EXT 0x8008
+#define GL_BLEND_EQUATION_EXT 0x8009
+#endif
+
+#ifndef GL_EXT_blend_subtract
+#define GL_FUNC_SUBTRACT_EXT 0x800A
+#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B
+#endif
+
+#ifndef GL_EXT_blend_logic_op
+#endif
+
+#ifndef GL_SGIX_interlace
+#define GL_INTERLACE_SGIX 0x8094
+#endif
+
+#ifndef GL_SGIX_pixel_tiles
+#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E
+#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F
+#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140
+#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141
+#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142
+#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143
+#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144
+#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145
+#endif
+
+#ifndef GL_SGIS_texture_select
+#define GL_DUAL_ALPHA4_SGIS 0x8110
+#define GL_DUAL_ALPHA8_SGIS 0x8111
+#define GL_DUAL_ALPHA12_SGIS 0x8112
+#define GL_DUAL_ALPHA16_SGIS 0x8113
+#define GL_DUAL_LUMINANCE4_SGIS 0x8114
+#define GL_DUAL_LUMINANCE8_SGIS 0x8115
+#define GL_DUAL_LUMINANCE12_SGIS 0x8116
+#define GL_DUAL_LUMINANCE16_SGIS 0x8117
+#define GL_DUAL_INTENSITY4_SGIS 0x8118
+#define GL_DUAL_INTENSITY8_SGIS 0x8119
+#define GL_DUAL_INTENSITY12_SGIS 0x811A
+#define GL_DUAL_INTENSITY16_SGIS 0x811B
+#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C
+#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D
+#define GL_QUAD_ALPHA4_SGIS 0x811E
+#define GL_QUAD_ALPHA8_SGIS 0x811F
+#define GL_QUAD_LUMINANCE4_SGIS 0x8120
+#define GL_QUAD_LUMINANCE8_SGIS 0x8121
+#define GL_QUAD_INTENSITY4_SGIS 0x8122
+#define GL_QUAD_INTENSITY8_SGIS 0x8123
+#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124
+#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125
+#endif
+
+#ifndef GL_SGIX_sprite
+#define GL_SPRITE_SGIX 0x8148
+#define GL_SPRITE_MODE_SGIX 0x8149
+#define GL_SPRITE_AXIS_SGIX 0x814A
+#define GL_SPRITE_TRANSLATION_SGIX 0x814B
+#define GL_SPRITE_AXIAL_SGIX 0x814C
+#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D
+#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E
+#endif
+
+#ifndef GL_SGIX_texture_multi_buffer
+#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E
+#endif
+
+#ifndef GL_EXT_point_parameters
+#define GL_POINT_SIZE_MIN_EXT 0x8126
+#define GL_POINT_SIZE_MAX_EXT 0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128
+#define GL_DISTANCE_ATTENUATION_EXT 0x8129
+#endif
+
+#ifndef GL_SGIS_point_parameters
+#define GL_POINT_SIZE_MIN_SGIS 0x8126
+#define GL_POINT_SIZE_MAX_SGIS 0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128
+#define GL_DISTANCE_ATTENUATION_SGIS 0x8129
+#endif
+
+#ifndef GL_SGIX_instruments
+#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180
+#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181
+#endif
+
+#ifndef GL_SGIX_texture_scale_bias
+#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179
+#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A
+#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B
+#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C
+#endif
+
+#ifndef GL_SGIX_framezoom
+#define GL_FRAMEZOOM_SGIX 0x818B
+#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C
+#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D
+#endif
+
+#ifndef GL_SGIX_tag_sample_buffer
+#endif
+
+#ifndef GL_FfdMaskSGIX
+#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001
+#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002
+#endif
+
+#ifndef GL_SGIX_polynomial_ffd
+#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194
+#define GL_TEXTURE_DEFORMATION_SGIX 0x8195
+#define GL_DEFORMATIONS_MASK_SGIX 0x8196
+#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197
+#endif
+
+#ifndef GL_SGIX_reference_plane
+#define GL_REFERENCE_PLANE_SGIX 0x817D
+#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E
+#endif
+
+#ifndef GL_SGIX_flush_raster
+#endif
+
+#ifndef GL_SGIX_depth_texture
+#define GL_DEPTH_COMPONENT16_SGIX 0x81A5
+#define GL_DEPTH_COMPONENT24_SGIX 0x81A6
+#define GL_DEPTH_COMPONENT32_SGIX 0x81A7
+#endif
+
+#ifndef GL_SGIS_fog_function
+#define GL_FOG_FUNC_SGIS 0x812A
+#define GL_FOG_FUNC_POINTS_SGIS 0x812B
+#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C
+#endif
+
+#ifndef GL_SGIX_fog_offset
+#define GL_FOG_OFFSET_SGIX 0x8198
+#define GL_FOG_OFFSET_VALUE_SGIX 0x8199
+#endif
+
+#ifndef GL_HP_image_transform
+#define GL_IMAGE_SCALE_X_HP 0x8155
+#define GL_IMAGE_SCALE_Y_HP 0x8156
+#define GL_IMAGE_TRANSLATE_X_HP 0x8157
+#define GL_IMAGE_TRANSLATE_Y_HP 0x8158
+#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159
+#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A
+#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B
+#define GL_IMAGE_MAG_FILTER_HP 0x815C
+#define GL_IMAGE_MIN_FILTER_HP 0x815D
+#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E
+#define GL_CUBIC_HP 0x815F
+#define GL_AVERAGE_HP 0x8160
+#define GL_IMAGE_TRANSFORM_2D_HP 0x8161
+#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162
+#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163
+#endif
+
+#ifndef GL_HP_convolution_border_modes
+#define GL_IGNORE_BORDER_HP 0x8150
+#define GL_CONSTANT_BORDER_HP 0x8151
+#define GL_REPLICATE_BORDER_HP 0x8153
+#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154
+#endif
+
+#ifndef GL_INGR_palette_buffer
+#endif
+
+#ifndef GL_SGIX_texture_add_env
+#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE
+#endif
+
+#ifndef GL_EXT_color_subtable
+#endif
+
+#ifndef GL_PGI_vertex_hints
+#define GL_VERTEX_DATA_HINT_PGI 0x1A22A
+#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B
+#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C
+#define GL_MAX_VERTEX_HINT_PGI 0x1A22D
+#define GL_COLOR3_BIT_PGI 0x00010000
+#define GL_COLOR4_BIT_PGI 0x00020000
+#define GL_EDGEFLAG_BIT_PGI 0x00040000
+#define GL_INDEX_BIT_PGI 0x00080000
+#define GL_MAT_AMBIENT_BIT_PGI 0x00100000
+#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000
+#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000
+#define GL_MAT_EMISSION_BIT_PGI 0x00800000
+#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000
+#define GL_MAT_SHININESS_BIT_PGI 0x02000000
+#define GL_MAT_SPECULAR_BIT_PGI 0x04000000
+#define GL_NORMAL_BIT_PGI 0x08000000
+#define GL_TEXCOORD1_BIT_PGI 0x10000000
+#define GL_TEXCOORD2_BIT_PGI 0x20000000
+#define GL_TEXCOORD3_BIT_PGI 0x40000000
+#define GL_TEXCOORD4_BIT_PGI 0x80000000
+#define GL_VERTEX23_BIT_PGI 0x00000004
+#define GL_VERTEX4_BIT_PGI 0x00000008
+#endif
+
+#ifndef GL_PGI_misc_hints
+#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8
+#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD
+#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE
+#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202
+#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203
+#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204
+#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C
+#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D
+#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E
+#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F
+#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210
+#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211
+#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216
+#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217
+#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218
+#define GL_FULL_STIPPLE_HINT_PGI 0x1A219
+#define GL_CLIP_NEAR_HINT_PGI 0x1A220
+#define GL_CLIP_FAR_HINT_PGI 0x1A221
+#define GL_WIDE_LINE_HINT_PGI 0x1A222
+#define GL_BACK_NORMALS_HINT_PGI 0x1A223
+#endif
+
+#ifndef GL_EXT_paletted_texture
+#define GL_COLOR_INDEX1_EXT 0x80E2
+#define GL_COLOR_INDEX2_EXT 0x80E3
+#define GL_COLOR_INDEX4_EXT 0x80E4
+#define GL_COLOR_INDEX8_EXT 0x80E5
+#define GL_COLOR_INDEX12_EXT 0x80E6
+#define GL_COLOR_INDEX16_EXT 0x80E7
+#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED
+#endif
+
+#ifndef GL_EXT_clip_volume_hint
+#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0
+#endif
+
+#ifndef GL_SGIX_list_priority
+#define GL_LIST_PRIORITY_SGIX 0x8182
+#endif
+
+#ifndef GL_SGIX_ir_instrument1
+#define GL_IR_INSTRUMENT1_SGIX 0x817F
+#endif
+
+#ifndef GL_SGIX_calligraphic_fragment
+#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183
+#endif
+
+#ifndef GL_SGIX_texture_lod_bias
+#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E
+#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F
+#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190
+#endif
+
+#ifndef GL_SGIX_shadow_ambient
+#define GL_SHADOW_AMBIENT_SGIX 0x80BF
+#endif
+
+#ifndef GL_EXT_index_texture
+#endif
+
+#ifndef GL_EXT_index_material
+#define GL_INDEX_MATERIAL_EXT 0x81B8
+#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9
+#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA
+#endif
+
+#ifndef GL_EXT_index_func
+#define GL_INDEX_TEST_EXT 0x81B5
+#define GL_INDEX_TEST_FUNC_EXT 0x81B6
+#define GL_INDEX_TEST_REF_EXT 0x81B7
+#endif
+
+#ifndef GL_EXT_index_array_formats
+#define GL_IUI_V2F_EXT 0x81AD
+#define GL_IUI_V3F_EXT 0x81AE
+#define GL_IUI_N3F_V2F_EXT 0x81AF
+#define GL_IUI_N3F_V3F_EXT 0x81B0
+#define GL_T2F_IUI_V2F_EXT 0x81B1
+#define GL_T2F_IUI_V3F_EXT 0x81B2
+#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3
+#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4
+#endif
+
+#ifndef GL_EXT_compiled_vertex_array
+#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8
+#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9
+#endif
+
+#ifndef GL_EXT_cull_vertex
+#define GL_CULL_VERTEX_EXT 0x81AA
+#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB
+#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC
+#endif
+
+#ifndef GL_SGIX_ycrcb
+#define GL_YCRCB_422_SGIX 0x81BB
+#define GL_YCRCB_444_SGIX 0x81BC
+#endif
+
+#ifndef GL_SGIX_fragment_lighting
+#define GL_FRAGMENT_LIGHTING_SGIX 0x8400
+#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401
+#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402
+#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403
+#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404
+#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405
+#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406
+#define GL_LIGHT_ENV_MODE_SGIX 0x8407
+#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408
+#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409
+#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A
+#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B
+#define GL_FRAGMENT_LIGHT0_SGIX 0x840C
+#define GL_FRAGMENT_LIGHT1_SGIX 0x840D
+#define GL_FRAGMENT_LIGHT2_SGIX 0x840E
+#define GL_FRAGMENT_LIGHT3_SGIX 0x840F
+#define GL_FRAGMENT_LIGHT4_SGIX 0x8410
+#define GL_FRAGMENT_LIGHT5_SGIX 0x8411
+#define GL_FRAGMENT_LIGHT6_SGIX 0x8412
+#define GL_FRAGMENT_LIGHT7_SGIX 0x8413
+#endif
+
+#ifndef GL_IBM_rasterpos_clip
+#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262
+#endif
+
+#ifndef GL_HP_texture_lighting
+#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167
+#define GL_TEXTURE_POST_SPECULAR_HP 0x8168
+#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169
+#endif
+
+#ifndef GL_EXT_draw_range_elements
+#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8
+#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9
+#endif
+
+#ifndef GL_WIN_phong_shading
+#define GL_PHONG_WIN 0x80EA
+#define GL_PHONG_HINT_WIN 0x80EB
+#endif
+
+#ifndef GL_WIN_specular_fog
+#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC
+#endif
+
+#ifndef GL_EXT_light_texture
+#define GL_FRAGMENT_MATERIAL_EXT 0x8349
+#define GL_FRAGMENT_NORMAL_EXT 0x834A
+#define GL_FRAGMENT_COLOR_EXT 0x834C
+#define GL_ATTENUATION_EXT 0x834D
+#define GL_SHADOW_ATTENUATION_EXT 0x834E
+#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F
+#define GL_TEXTURE_LIGHT_EXT 0x8350
+#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351
+#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352
+/* reuse GL_FRAGMENT_DEPTH_EXT */
+#endif
+
+#ifndef GL_SGIX_blend_alpha_minmax
+#define GL_ALPHA_MIN_SGIX 0x8320
+#define GL_ALPHA_MAX_SGIX 0x8321
+#endif
+
+#ifndef GL_SGIX_impact_pixel_texture
+#define GL_PIXEL_TEX_GEN_Q_CEILING_SGIX 0x8184
+#define GL_PIXEL_TEX_GEN_Q_ROUND_SGIX 0x8185
+#define GL_PIXEL_TEX_GEN_Q_FLOOR_SGIX 0x8186
+#define GL_PIXEL_TEX_GEN_ALPHA_REPLACE_SGIX 0x8187
+#define GL_PIXEL_TEX_GEN_ALPHA_NO_REPLACE_SGIX 0x8188
+#define GL_PIXEL_TEX_GEN_ALPHA_LS_SGIX 0x8189
+#define GL_PIXEL_TEX_GEN_ALPHA_MS_SGIX 0x818A
+#endif
+
+#ifndef GL_EXT_bgra
+#define GL_BGR_EXT 0x80E0
+#define GL_BGRA_EXT 0x80E1
+#endif
+
+#ifndef GL_SGIX_async
+#define GL_ASYNC_MARKER_SGIX 0x8329
+#endif
+
+#ifndef GL_SGIX_async_pixel
+#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C
+#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D
+#define GL_ASYNC_READ_PIXELS_SGIX 0x835E
+#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F
+#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360
+#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361
+#endif
+
+#ifndef GL_SGIX_async_histogram
+#define GL_ASYNC_HISTOGRAM_SGIX 0x832C
+#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D
+#endif
+
+#ifndef GL_INTEL_texture_scissor
+#endif
+
+#ifndef GL_INTEL_parallel_arrays
+#define GL_PARALLEL_ARRAYS_INTEL 0x83F4
+#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5
+#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6
+#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7
+#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8
+#endif
+
+#ifndef GL_HP_occlusion_test
+#define GL_OCCLUSION_TEST_HP 0x8165
+#define GL_OCCLUSION_TEST_RESULT_HP 0x8166
+#endif
+
+#ifndef GL_EXT_pixel_transform
+#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330
+#define GL_PIXEL_MAG_FILTER_EXT 0x8331
+#define GL_PIXEL_MIN_FILTER_EXT 0x8332
+#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333
+#define GL_CUBIC_EXT 0x8334
+#define GL_AVERAGE_EXT 0x8335
+#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336
+#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337
+#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338
+#endif
+
+#ifndef GL_EXT_pixel_transform_color_table
+#endif
+
+#ifndef GL_EXT_shared_texture_palette
+#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB
+#endif
+
+#ifndef GL_EXT_separate_specular_color
+#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8
+#define GL_SINGLE_COLOR_EXT 0x81F9
+#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA
+#endif
+
+#ifndef GL_EXT_secondary_color
+#define GL_COLOR_SUM_EXT 0x8458
+#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459
+#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A
+#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B
+#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C
+#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D
+#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E
+#endif
+
+#ifndef GL_EXT_texture_perturb_normal
+#define GL_PERTURB_EXT 0x85AE
+#define GL_TEXTURE_NORMAL_EXT 0x85AF
+#endif
+
+#ifndef GL_EXT_multi_draw_arrays
+#endif
+
+#ifndef GL_EXT_fog_coord
+#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450
+#define GL_FOG_COORDINATE_EXT 0x8451
+#define GL_FRAGMENT_DEPTH_EXT 0x8452
+#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453
+#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454
+#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455
+#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456
+#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457
+#endif
+
+#ifndef GL_REND_screen_coordinates
+#define GL_SCREEN_COORDINATES_REND 0x8490
+#define GL_INVERTED_SCREEN_W_REND 0x8491
+#endif
+
+#ifndef GL_EXT_coordinate_frame
+#define GL_TANGENT_ARRAY_EXT 0x8439
+#define GL_BINORMAL_ARRAY_EXT 0x843A
+#define GL_CURRENT_TANGENT_EXT 0x843B
+#define GL_CURRENT_BINORMAL_EXT 0x843C
+#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E
+#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F
+#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440
+#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441
+#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442
+#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443
+#define GL_MAP1_TANGENT_EXT 0x8444
+#define GL_MAP2_TANGENT_EXT 0x8445
+#define GL_MAP1_BINORMAL_EXT 0x8446
+#define GL_MAP2_BINORMAL_EXT 0x8447
+#endif
+
+#ifndef GL_EXT_texture_env_combine
+#define GL_COMBINE_EXT 0x8570
+#define GL_COMBINE_RGB_EXT 0x8571
+#define GL_COMBINE_ALPHA_EXT 0x8572
+#define GL_RGB_SCALE_EXT 0x8573
+#define GL_ADD_SIGNED_EXT 0x8574
+#define GL_INTERPOLATE_EXT 0x8575
+#define GL_CONSTANT_EXT 0x8576
+#define GL_PRIMARY_COLOR_EXT 0x8577
+#define GL_PREVIOUS_EXT 0x8578
+#define GL_SOURCE0_RGB_EXT 0x8580
+#define GL_SOURCE1_RGB_EXT 0x8581
+#define GL_SOURCE2_RGB_EXT 0x8582
+#define GL_SOURCE0_ALPHA_EXT 0x8588
+#define GL_SOURCE1_ALPHA_EXT 0x8589
+#define GL_SOURCE2_ALPHA_EXT 0x858A
+#define GL_OPERAND0_RGB_EXT 0x8590
+#define GL_OPERAND1_RGB_EXT 0x8591
+#define GL_OPERAND2_RGB_EXT 0x8592
+#define GL_OPERAND0_ALPHA_EXT 0x8598
+#define GL_OPERAND1_ALPHA_EXT 0x8599
+#define GL_OPERAND2_ALPHA_EXT 0x859A
+#endif
+
+#ifndef GL_APPLE_specular_vector
+#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0
+#endif
+
+#ifndef GL_APPLE_transform_hint
+#define GL_TRANSFORM_HINT_APPLE 0x85B1
+#endif
+
+#ifndef GL_SGIX_fog_scale
+#define GL_FOG_SCALE_SGIX 0x81FC
+#define GL_FOG_SCALE_VALUE_SGIX 0x81FD
+#endif
+
+#ifndef GL_SUNX_constant_data
+#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5
+#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6
+#endif
+
+#ifndef GL_SUN_global_alpha
+#define GL_GLOBAL_ALPHA_SUN 0x81D9
+#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA
+#endif
+
+#ifndef GL_SUN_triangle_list
+#define GL_RESTART_SUN 0x0001
+#define GL_REPLACE_MIDDLE_SUN 0x0002
+#define GL_REPLACE_OLDEST_SUN 0x0003
+#define GL_TRIANGLE_LIST_SUN 0x81D7
+#define GL_REPLACEMENT_CODE_SUN 0x81D8
+#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0
+#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1
+#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2
+#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3
+#define GL_R1UI_V3F_SUN 0x85C4
+#define GL_R1UI_C4UB_V3F_SUN 0x85C5
+#define GL_R1UI_C3F_V3F_SUN 0x85C6
+#define GL_R1UI_N3F_V3F_SUN 0x85C7
+#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8
+#define GL_R1UI_T2F_V3F_SUN 0x85C9
+#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA
+#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB
+#endif
+
+#ifndef GL_SUN_vertex
+#endif
+
+#ifndef GL_EXT_blend_func_separate
+#define GL_BLEND_DST_RGB_EXT 0x80C8
+#define GL_BLEND_SRC_RGB_EXT 0x80C9
+#define GL_BLEND_DST_ALPHA_EXT 0x80CA
+#define GL_BLEND_SRC_ALPHA_EXT 0x80CB
+#endif
+
+#ifndef GL_INGR_color_clamp
+#define GL_RED_MIN_CLAMP_INGR 0x8560
+#define GL_GREEN_MIN_CLAMP_INGR 0x8561
+#define GL_BLUE_MIN_CLAMP_INGR 0x8562
+#define GL_ALPHA_MIN_CLAMP_INGR 0x8563
+#define GL_RED_MAX_CLAMP_INGR 0x8564
+#define GL_GREEN_MAX_CLAMP_INGR 0x8565
+#define GL_BLUE_MAX_CLAMP_INGR 0x8566
+#define GL_ALPHA_MAX_CLAMP_INGR 0x8567
+#endif
+
+#ifndef GL_INGR_interlace_read
+#define GL_INTERLACE_READ_INGR 0x8568
+#endif
+
+#ifndef GL_EXT_stencil_wrap
+#define GL_INCR_WRAP_EXT 0x8507
+#define GL_DECR_WRAP_EXT 0x8508
+#endif
+
+#ifndef GL_EXT_422_pixels
+#define GL_422_EXT 0x80CC
+#define GL_422_REV_EXT 0x80CD
+#define GL_422_AVERAGE_EXT 0x80CE
+#define GL_422_REV_AVERAGE_EXT 0x80CF
+#endif
+
+#ifndef GL_NV_texgen_reflection
+#define GL_NORMAL_MAP_NV 0x8511
+#define GL_REFLECTION_MAP_NV 0x8512
+#endif
+
+#ifndef GL_EXT_texture_cube_map
+#define GL_NORMAL_MAP_EXT 0x8511
+#define GL_REFLECTION_MAP_EXT 0x8512
+#define GL_TEXTURE_CUBE_MAP_EXT 0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A
+#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C
+#endif
+
+#ifndef GL_SUN_convolution_border_modes
+#define GL_WRAP_BORDER_SUN 0x81D4
+#endif
+
+#ifndef GL_EXT_texture_env_add
+#endif
+
+#ifndef GL_EXT_texture_lod_bias
+#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD
+#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500
+#define GL_TEXTURE_LOD_BIAS_EXT 0x8501
+#endif
+
+#ifndef GL_EXT_texture_filter_anisotropic
+#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
+#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
+#endif
+
+#ifndef GL_EXT_vertex_weighting
+#define GL_MODELVIEW0_STACK_DEPTH_EXT GL_MODELVIEW_STACK_DEPTH
+#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502
+#define GL_MODELVIEW0_MATRIX_EXT GL_MODELVIEW_MATRIX
+#define GL_MODELVIEW1_MATRIX_EXT 0x8506
+#define GL_VERTEX_WEIGHTING_EXT 0x8509
+#define GL_MODELVIEW0_EXT GL_MODELVIEW
+#define GL_MODELVIEW1_EXT 0x850A
+#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B
+#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C
+#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D
+#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E
+#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F
+#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510
+#endif
+
+#ifndef GL_NV_light_max_exponent
+#define GL_MAX_SHININESS_NV 0x8504
+#define GL_MAX_SPOT_EXPONENT_NV 0x8505
+#endif
+
+#ifndef GL_NV_vertex_array_range
+#define GL_VERTEX_ARRAY_RANGE_NV 0x851D
+#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E
+#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F
+#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520
+#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521
+#endif
+
+#ifndef GL_NV_register_combiners
+#define GL_REGISTER_COMBINERS_NV 0x8522
+#define GL_VARIABLE_A_NV 0x8523
+#define GL_VARIABLE_B_NV 0x8524
+#define GL_VARIABLE_C_NV 0x8525
+#define GL_VARIABLE_D_NV 0x8526
+#define GL_VARIABLE_E_NV 0x8527
+#define GL_VARIABLE_F_NV 0x8528
+#define GL_VARIABLE_G_NV 0x8529
+#define GL_CONSTANT_COLOR0_NV 0x852A
+#define GL_CONSTANT_COLOR1_NV 0x852B
+#define GL_PRIMARY_COLOR_NV 0x852C
+#define GL_SECONDARY_COLOR_NV 0x852D
+#define GL_SPARE0_NV 0x852E
+#define GL_SPARE1_NV 0x852F
+#define GL_DISCARD_NV 0x8530
+#define GL_E_TIMES_F_NV 0x8531
+#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532
+#define GL_UNSIGNED_IDENTITY_NV 0x8536
+#define GL_UNSIGNED_INVERT_NV 0x8537
+#define GL_EXPAND_NORMAL_NV 0x8538
+#define GL_EXPAND_NEGATE_NV 0x8539
+#define GL_HALF_BIAS_NORMAL_NV 0x853A
+#define GL_HALF_BIAS_NEGATE_NV 0x853B
+#define GL_SIGNED_IDENTITY_NV 0x853C
+#define GL_SIGNED_NEGATE_NV 0x853D
+#define GL_SCALE_BY_TWO_NV 0x853E
+#define GL_SCALE_BY_FOUR_NV 0x853F
+#define GL_SCALE_BY_ONE_HALF_NV 0x8540
+#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541
+#define GL_COMBINER_INPUT_NV 0x8542
+#define GL_COMBINER_MAPPING_NV 0x8543
+#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544
+#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545
+#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546
+#define GL_COMBINER_MUX_SUM_NV 0x8547
+#define GL_COMBINER_SCALE_NV 0x8548
+#define GL_COMBINER_BIAS_NV 0x8549
+#define GL_COMBINER_AB_OUTPUT_NV 0x854A
+#define GL_COMBINER_CD_OUTPUT_NV 0x854B
+#define GL_COMBINER_SUM_OUTPUT_NV 0x854C
+#define GL_MAX_GENERAL_COMBINERS_NV 0x854D
+#define GL_NUM_GENERAL_COMBINERS_NV 0x854E
+#define GL_COLOR_SUM_CLAMP_NV 0x854F
+#define GL_COMBINER0_NV 0x8550
+#define GL_COMBINER1_NV 0x8551
+#define GL_COMBINER2_NV 0x8552
+#define GL_COMBINER3_NV 0x8553
+#define GL_COMBINER4_NV 0x8554
+#define GL_COMBINER5_NV 0x8555
+#define GL_COMBINER6_NV 0x8556
+#define GL_COMBINER7_NV 0x8557
+/* reuse GL_TEXTURE0_ARB */
+/* reuse GL_TEXTURE1_ARB */
+/* reuse GL_ZERO */
+/* reuse GL_NONE */
+/* reuse GL_FOG */
+#endif
+
+#ifndef GL_NV_fog_distance
+#define GL_FOG_DISTANCE_MODE_NV 0x855A
+#define GL_EYE_RADIAL_NV 0x855B
+#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C
+/* reuse GL_EYE_PLANE */
+#endif
+
+#ifndef GL_NV_texgen_emboss
+#define GL_EMBOSS_LIGHT_NV 0x855D
+#define GL_EMBOSS_CONSTANT_NV 0x855E
+#define GL_EMBOSS_MAP_NV 0x855F
+#endif
+
+#ifndef GL_NV_blend_square
+#endif
+
+#ifndef GL_NV_texture_env_combine4
+#define GL_COMBINE4_NV 0x8503
+#define GL_SOURCE3_RGB_NV 0x8583
+#define GL_SOURCE3_ALPHA_NV 0x858B
+#define GL_OPERAND3_RGB_NV 0x8593
+#define GL_OPERAND3_ALPHA_NV 0x859B
+#endif
+
+#ifndef GL_MESA_resize_buffers
+#endif
+
+#ifndef GL_MESA_window_pos
+#endif
+
+#ifndef GL_EXT_texture_compression_s3tc
+#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
+#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
+#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
+#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
+#endif
+
+#ifndef GL_IBM_cull_vertex
+#define GL_CULL_VERTEX_IBM 103050
+#endif
+
+#ifndef GL_IBM_multimode_draw_arrays
+#endif
+
+#ifndef GL_IBM_vertex_array_lists
+#define GL_VERTEX_ARRAY_LIST_IBM 103070
+#define GL_NORMAL_ARRAY_LIST_IBM 103071
+#define GL_COLOR_ARRAY_LIST_IBM 103072
+#define GL_INDEX_ARRAY_LIST_IBM 103073
+#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074
+#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075
+#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076
+#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077
+#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080
+#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081
+#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082
+#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083
+#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084
+#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085
+#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086
+#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087
+#endif
+
+#ifndef GL_SGIX_subsample
+#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0
+#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1
+#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2
+#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3
+#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4
+#endif
+
+#ifndef GL_SGIX_ycrcb_subsample
+#endif
+
+#ifndef GL_SGIX_ycrcba
+#define GL_YCRCB_SGIX 0x8318
+#define GL_YCRCBA_SGIX 0x8319
+#endif
+
+#ifndef GL_SGI_depth_pass_instrument
+#define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310
+#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311
+#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312
+#endif
+
+#ifndef GL_3DFX_texture_compression_FXT1
+#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0
+#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1
+#endif
+
+#ifndef GL_3DFX_multisample
+#define GL_MULTISAMPLE_3DFX 0x86B2
+#define GL_SAMPLE_BUFFERS_3DFX 0x86B3
+#define GL_SAMPLES_3DFX 0x86B4
+#define GL_MULTISAMPLE_BIT_3DFX 0x20000000
+#endif
+
+#ifndef GL_3DFX_tbuffer
+#endif
+
+#ifndef GL_EXT_multisample
+#define GL_MULTISAMPLE_EXT 0x809D
+#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F
+#define GL_SAMPLE_MASK_EXT 0x80A0
+#define GL_1PASS_EXT 0x80A1
+#define GL_2PASS_0_EXT 0x80A2
+#define GL_2PASS_1_EXT 0x80A3
+#define GL_4PASS_0_EXT 0x80A4
+#define GL_4PASS_1_EXT 0x80A5
+#define GL_4PASS_2_EXT 0x80A6
+#define GL_4PASS_3_EXT 0x80A7
+#define GL_SAMPLE_BUFFERS_EXT 0x80A8
+#define GL_SAMPLES_EXT 0x80A9
+#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA
+#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB
+#define GL_SAMPLE_PATTERN_EXT 0x80AC
+#define GL_MULTISAMPLE_BIT_EXT 0x20000000
+#endif
+
+#ifndef GL_SGIX_vertex_preclip
+#define GL_VERTEX_PRECLIP_SGIX 0x83EE
+#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF
+#endif
+
+#ifndef GL_SGIX_convolution_accuracy
+#define GL_CONVOLUTION_HINT_SGIX 0x8316
+#endif
+
+#ifndef GL_SGIX_resample
+#define GL_PACK_RESAMPLE_SGIX 0x842C
+#define GL_UNPACK_RESAMPLE_SGIX 0x842D
+#define GL_RESAMPLE_REPLICATE_SGIX 0x842E
+#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F
+#define GL_RESAMPLE_DECIMATE_SGIX 0x8430
+#endif
+
+#ifndef GL_SGIS_point_line_texgen
+#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0
+#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1
+#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2
+#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3
+#define GL_EYE_POINT_SGIS 0x81F4
+#define GL_OBJECT_POINT_SGIS 0x81F5
+#define GL_EYE_LINE_SGIS 0x81F6
+#define GL_OBJECT_LINE_SGIS 0x81F7
+#endif
+
+#ifndef GL_SGIS_texture_color_mask
+#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF
+#endif
+
+#ifndef GL_EXT_texture_env_dot3
+#define GL_DOT3_RGB_EXT 0x8740
+#define GL_DOT3_RGBA_EXT 0x8741
+#endif
+
+#ifndef GL_ATI_texture_mirror_once
+#define GL_MIRROR_CLAMP_ATI 0x8742
+#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743
+#endif
+
+#ifndef GL_NV_fence
+#define GL_ALL_COMPLETED_NV 0x84F2
+#define GL_FENCE_STATUS_NV 0x84F3
+#define GL_FENCE_CONDITION_NV 0x84F4
+#endif
+
+#ifndef GL_IBM_texture_mirrored_repeat
+#define GL_MIRRORED_REPEAT_IBM 0x8370
+#endif
+
+#ifndef GL_NV_evaluators
+#define GL_EVAL_2D_NV 0x86C0
+#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1
+#define GL_MAP_TESSELLATION_NV 0x86C2
+#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3
+#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4
+#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5
+#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6
+#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7
+#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8
+#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9
+#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA
+#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB
+#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC
+#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD
+#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE
+#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF
+#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0
+#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1
+#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2
+#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3
+#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4
+#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5
+#define GL_MAX_MAP_TESSELLATION_NV 0x86D6
+#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7
+#endif
+
+#ifndef GL_NV_packed_depth_stencil
+#define GL_DEPTH_STENCIL_NV 0x84F9
+#define GL_UNSIGNED_INT_24_8_NV 0x84FA
+#endif
+
+#ifndef GL_NV_register_combiners2
+#define GL_PER_STAGE_CONSTANTS_NV 0x8535
+#endif
+
+#ifndef GL_NV_texture_compression_vtc
+#endif
+
+#ifndef GL_NV_texture_rectangle
+#define GL_TEXTURE_RECTANGLE_NV 0x84F5
+#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6
+#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7
+#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8
+#endif
+
+#ifndef GL_NV_texture_shader
+#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C
+#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D
+#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E
+#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9
+#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA
+#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB
+#define GL_DSDT_MAG_INTENSITY_NV 0x86DC
+#define GL_SHADER_CONSISTENT_NV 0x86DD
+#define GL_TEXTURE_SHADER_NV 0x86DE
+#define GL_SHADER_OPERATION_NV 0x86DF
+#define GL_CULL_MODES_NV 0x86E0
+#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1
+#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2
+#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3
+#define GL_OFFSET_TEXTURE_2D_MATRIX_NV GL_OFFSET_TEXTURE_MATRIX_NV
+#define GL_OFFSET_TEXTURE_2D_SCALE_NV GL_OFFSET_TEXTURE_SCALE_NV
+#define GL_OFFSET_TEXTURE_2D_BIAS_NV GL_OFFSET_TEXTURE_BIAS_NV
+#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4
+#define GL_CONST_EYE_NV 0x86E5
+#define GL_PASS_THROUGH_NV 0x86E6
+#define GL_CULL_FRAGMENT_NV 0x86E7
+#define GL_OFFSET_TEXTURE_2D_NV 0x86E8
+#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9
+#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA
+#define GL_DOT_PRODUCT_NV 0x86EC
+#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED
+#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE
+#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0
+#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1
+#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2
+#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3
+#define GL_HILO_NV 0x86F4
+#define GL_DSDT_NV 0x86F5
+#define GL_DSDT_MAG_NV 0x86F6
+#define GL_DSDT_MAG_VIB_NV 0x86F7
+#define GL_HILO16_NV 0x86F8
+#define GL_SIGNED_HILO_NV 0x86F9
+#define GL_SIGNED_HILO16_NV 0x86FA
+#define GL_SIGNED_RGBA_NV 0x86FB
+#define GL_SIGNED_RGBA8_NV 0x86FC
+#define GL_SIGNED_RGB_NV 0x86FE
+#define GL_SIGNED_RGB8_NV 0x86FF
+#define GL_SIGNED_LUMINANCE_NV 0x8701
+#define GL_SIGNED_LUMINANCE8_NV 0x8702
+#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703
+#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704
+#define GL_SIGNED_ALPHA_NV 0x8705
+#define GL_SIGNED_ALPHA8_NV 0x8706
+#define GL_SIGNED_INTENSITY_NV 0x8707
+#define GL_SIGNED_INTENSITY8_NV 0x8708
+#define GL_DSDT8_NV 0x8709
+#define GL_DSDT8_MAG8_NV 0x870A
+#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B
+#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C
+#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D
+#define GL_HI_SCALE_NV 0x870E
+#define GL_LO_SCALE_NV 0x870F
+#define GL_DS_SCALE_NV 0x8710
+#define GL_DT_SCALE_NV 0x8711
+#define GL_MAGNITUDE_SCALE_NV 0x8712
+#define GL_VIBRANCE_SCALE_NV 0x8713
+#define GL_HI_BIAS_NV 0x8714
+#define GL_LO_BIAS_NV 0x8715
+#define GL_DS_BIAS_NV 0x8716
+#define GL_DT_BIAS_NV 0x8717
+#define GL_MAGNITUDE_BIAS_NV 0x8718
+#define GL_VIBRANCE_BIAS_NV 0x8719
+#define GL_TEXTURE_BORDER_VALUES_NV 0x871A
+#define GL_TEXTURE_HI_SIZE_NV 0x871B
+#define GL_TEXTURE_LO_SIZE_NV 0x871C
+#define GL_TEXTURE_DS_SIZE_NV 0x871D
+#define GL_TEXTURE_DT_SIZE_NV 0x871E
+#define GL_TEXTURE_MAG_SIZE_NV 0x871F
+#endif
+
+#ifndef GL_NV_texture_shader2
+#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF
+#endif
+
+#ifndef GL_NV_vertex_array_range2
+#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533
+#endif
+
+#ifndef GL_NV_vertex_program
+#define GL_VERTEX_PROGRAM_NV 0x8620
+#define GL_VERTEX_STATE_PROGRAM_NV 0x8621
+#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623
+#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624
+#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625
+#define GL_CURRENT_ATTRIB_NV 0x8626
+#define GL_PROGRAM_LENGTH_NV 0x8627
+#define GL_PROGRAM_STRING_NV 0x8628
+#define GL_MODELVIEW_PROJECTION_NV 0x8629
+#define GL_IDENTITY_NV 0x862A
+#define GL_INVERSE_NV 0x862B
+#define GL_TRANSPOSE_NV 0x862C
+#define GL_INVERSE_TRANSPOSE_NV 0x862D
+#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E
+#define GL_MAX_TRACK_MATRICES_NV 0x862F
+#define GL_MATRIX0_NV 0x8630
+#define GL_MATRIX1_NV 0x8631
+#define GL_MATRIX2_NV 0x8632
+#define GL_MATRIX3_NV 0x8633
+#define GL_MATRIX4_NV 0x8634
+#define GL_MATRIX5_NV 0x8635
+#define GL_MATRIX6_NV 0x8636
+#define GL_MATRIX7_NV 0x8637
+#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640
+#define GL_CURRENT_MATRIX_NV 0x8641
+#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642
+#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643
+#define GL_PROGRAM_PARAMETER_NV 0x8644
+#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645
+#define GL_PROGRAM_TARGET_NV 0x8646
+#define GL_PROGRAM_RESIDENT_NV 0x8647
+#define GL_TRACK_MATRIX_NV 0x8648
+#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649
+#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A
+#define GL_PROGRAM_ERROR_POSITION_NV 0x864B
+#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650
+#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651
+#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652
+#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653
+#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654
+#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655
+#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656
+#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657
+#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658
+#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659
+#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A
+#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B
+#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C
+#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D
+#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E
+#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F
+#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660
+#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661
+#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662
+#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663
+#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664
+#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665
+#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666
+#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667
+#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668
+#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669
+#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A
+#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B
+#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C
+#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D
+#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E
+#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F
+#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670
+#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671
+#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672
+#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673
+#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674
+#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675
+#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676
+#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677
+#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678
+#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679
+#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A
+#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B
+#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C
+#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D
+#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E
+#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F
+#endif
+
+#ifndef GL_SGIX_texture_coordinate_clamp
+#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369
+#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A
+#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B
+#endif
+
+#ifndef GL_SGIX_scalebias_hint
+#define GL_SCALEBIAS_HINT_SGIX 0x8322
+#endif
+
+#ifndef GL_OML_interlace
+#define GL_INTERLACE_OML 0x8980
+#define GL_INTERLACE_READ_OML 0x8981
+#endif
+
+#ifndef GL_OML_subsample
+#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982
+#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983
+#endif
+
+#ifndef GL_OML_resample
+#define GL_PACK_RESAMPLE_OML 0x8984
+#define GL_UNPACK_RESAMPLE_OML 0x8985
+#define GL_RESAMPLE_REPLICATE_OML 0x8986
+#define GL_RESAMPLE_ZERO_FILL_OML 0x8987
+#define GL_RESAMPLE_AVERAGE_OML 0x8988
+#define GL_RESAMPLE_DECIMATE_OML 0x8989
+#endif
+
+#ifndef GL_NV_copy_depth_to_color
+#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E
+#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F
+#endif
+
+#ifndef GL_ATI_envmap_bumpmap
+#define GL_BUMP_ROT_MATRIX_ATI 0x8775
+#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776
+#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777
+#define GL_BUMP_TEX_UNITS_ATI 0x8778
+#define GL_DUDV_ATI 0x8779
+#define GL_DU8DV8_ATI 0x877A
+#define GL_BUMP_ENVMAP_ATI 0x877B
+#define GL_BUMP_TARGET_ATI 0x877C
+#endif
+
+#ifndef GL_ATI_fragment_shader
+#define GL_FRAGMENT_SHADER_ATI 0x8920
+#define GL_REG_0_ATI 0x8921
+#define GL_REG_1_ATI 0x8922
+#define GL_REG_2_ATI 0x8923
+#define GL_REG_3_ATI 0x8924
+#define GL_REG_4_ATI 0x8925
+#define GL_REG_5_ATI 0x8926
+#define GL_REG_6_ATI 0x8927
+#define GL_REG_7_ATI 0x8928
+#define GL_REG_8_ATI 0x8929
+#define GL_REG_9_ATI 0x892A
+#define GL_REG_10_ATI 0x892B
+#define GL_REG_11_ATI 0x892C
+#define GL_REG_12_ATI 0x892D
+#define GL_REG_13_ATI 0x892E
+#define GL_REG_14_ATI 0x892F
+#define GL_REG_15_ATI 0x8930
+#define GL_REG_16_ATI 0x8931
+#define GL_REG_17_ATI 0x8932
+#define GL_REG_18_ATI 0x8933
+#define GL_REG_19_ATI 0x8934
+#define GL_REG_20_ATI 0x8935
+#define GL_REG_21_ATI 0x8936
+#define GL_REG_22_ATI 0x8937
+#define GL_REG_23_ATI 0x8938
+#define GL_REG_24_ATI 0x8939
+#define GL_REG_25_ATI 0x893A
+#define GL_REG_26_ATI 0x893B
+#define GL_REG_27_ATI 0x893C
+#define GL_REG_28_ATI 0x893D
+#define GL_REG_29_ATI 0x893E
+#define GL_REG_30_ATI 0x893F
+#define GL_REG_31_ATI 0x8940
+#define GL_CON_0_ATI 0x8941
+#define GL_CON_1_ATI 0x8942
+#define GL_CON_2_ATI 0x8943
+#define GL_CON_3_ATI 0x8944
+#define GL_CON_4_ATI 0x8945
+#define GL_CON_5_ATI 0x8946
+#define GL_CON_6_ATI 0x8947
+#define GL_CON_7_ATI 0x8948
+#define GL_CON_8_ATI 0x8949
+#define GL_CON_9_ATI 0x894A
+#define GL_CON_10_ATI 0x894B
+#define GL_CON_11_ATI 0x894C
+#define GL_CON_12_ATI 0x894D
+#define GL_CON_13_ATI 0x894E
+#define GL_CON_14_ATI 0x894F
+#define GL_CON_15_ATI 0x8950
+#define GL_CON_16_ATI 0x8951
+#define GL_CON_17_ATI 0x8952
+#define GL_CON_18_ATI 0x8953
+#define GL_CON_19_ATI 0x8954
+#define GL_CON_20_ATI 0x8955
+#define GL_CON_21_ATI 0x8956
+#define GL_CON_22_ATI 0x8957
+#define GL_CON_23_ATI 0x8958
+#define GL_CON_24_ATI 0x8959
+#define GL_CON_25_ATI 0x895A
+#define GL_CON_26_ATI 0x895B
+#define GL_CON_27_ATI 0x895C
+#define GL_CON_28_ATI 0x895D
+#define GL_CON_29_ATI 0x895E
+#define GL_CON_30_ATI 0x895F
+#define GL_CON_31_ATI 0x8960
+#define GL_MOV_ATI 0x8961
+#define GL_ADD_ATI 0x8963
+#define GL_MUL_ATI 0x8964
+#define GL_SUB_ATI 0x8965
+#define GL_DOT3_ATI 0x8966
+#define GL_DOT4_ATI 0x8967
+#define GL_MAD_ATI 0x8968
+#define GL_LERP_ATI 0x8969
+#define GL_CND_ATI 0x896A
+#define GL_CND0_ATI 0x896B
+#define GL_DOT2_ADD_ATI 0x896C
+#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D
+#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E
+#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F
+#define GL_NUM_PASSES_ATI 0x8970
+#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971
+#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972
+#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973
+#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974
+#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975
+#define GL_SWIZZLE_STR_ATI 0x8976
+#define GL_SWIZZLE_STQ_ATI 0x8977
+#define GL_SWIZZLE_STR_DR_ATI 0x8978
+#define GL_SWIZZLE_STQ_DQ_ATI 0x8979
+#define GL_SWIZZLE_STRQ_ATI 0x897A
+#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B
+#define GL_RED_BIT_ATI 0x00000001
+#define GL_GREEN_BIT_ATI 0x00000002
+#define GL_BLUE_BIT_ATI 0x00000004
+#define GL_2X_BIT_ATI 0x00000001
+#define GL_4X_BIT_ATI 0x00000002
+#define GL_8X_BIT_ATI 0x00000004
+#define GL_HALF_BIT_ATI 0x00000008
+#define GL_QUARTER_BIT_ATI 0x00000010
+#define GL_EIGHTH_BIT_ATI 0x00000020
+#define GL_SATURATE_BIT_ATI 0x00000040
+#define GL_COMP_BIT_ATI 0x00000002
+#define GL_NEGATE_BIT_ATI 0x00000004
+#define GL_BIAS_BIT_ATI 0x00000008
+#endif
+
+#ifndef GL_ATI_pn_triangles
+#define GL_PN_TRIANGLES_ATI 0x87F0
+#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1
+#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2
+#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3
+#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4
+#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5
+#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6
+#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7
+#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8
+#endif
+
+#ifndef GL_ATI_vertex_array_object
+#define GL_STATIC_ATI 0x8760
+#define GL_DYNAMIC_ATI 0x8761
+#define GL_PRESERVE_ATI 0x8762
+#define GL_DISCARD_ATI 0x8763
+#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764
+#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765
+#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766
+#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767
+#endif
+
+#ifndef GL_EXT_vertex_shader
+#define GL_VERTEX_SHADER_EXT 0x8780
+#define GL_VERTEX_SHADER_BINDING_EXT 0x8781
+#define GL_OP_INDEX_EXT 0x8782
+#define GL_OP_NEGATE_EXT 0x8783
+#define GL_OP_DOT3_EXT 0x8784
+#define GL_OP_DOT4_EXT 0x8785
+#define GL_OP_MUL_EXT 0x8786
+#define GL_OP_ADD_EXT 0x8787
+#define GL_OP_MADD_EXT 0x8788
+#define GL_OP_FRAC_EXT 0x8789
+#define GL_OP_MAX_EXT 0x878A
+#define GL_OP_MIN_EXT 0x878B
+#define GL_OP_SET_GE_EXT 0x878C
+#define GL_OP_SET_LT_EXT 0x878D
+#define GL_OP_CLAMP_EXT 0x878E
+#define GL_OP_FLOOR_EXT 0x878F
+#define GL_OP_ROUND_EXT 0x8790
+#define GL_OP_EXP_BASE_2_EXT 0x8791
+#define GL_OP_LOG_BASE_2_EXT 0x8792
+#define GL_OP_POWER_EXT 0x8793
+#define GL_OP_RECIP_EXT 0x8794
+#define GL_OP_RECIP_SQRT_EXT 0x8795
+#define GL_OP_SUB_EXT 0x8796
+#define GL_OP_CROSS_PRODUCT_EXT 0x8797
+#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798
+#define GL_OP_MOV_EXT 0x8799
+#define GL_OUTPUT_VERTEX_EXT 0x879A
+#define GL_OUTPUT_COLOR0_EXT 0x879B
+#define GL_OUTPUT_COLOR1_EXT 0x879C
+#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D
+#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E
+#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F
+#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0
+#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1
+#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2
+#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3
+#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4
+#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5
+#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6
+#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7
+#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8
+#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9
+#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA
+#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB
+#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC
+#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD
+#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE
+#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF
+#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0
+#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1
+#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2
+#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3
+#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4
+#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5
+#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6
+#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7
+#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8
+#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9
+#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA
+#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB
+#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC
+#define GL_OUTPUT_FOG_EXT 0x87BD
+#define GL_SCALAR_EXT 0x87BE
+#define GL_VECTOR_EXT 0x87BF
+#define GL_MATRIX_EXT 0x87C0
+#define GL_VARIANT_EXT 0x87C1
+#define GL_INVARIANT_EXT 0x87C2
+#define GL_LOCAL_CONSTANT_EXT 0x87C3
+#define GL_LOCAL_EXT 0x87C4
+#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5
+#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6
+#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7
+#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8
+#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE
+#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF
+#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0
+#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1
+#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2
+#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3
+#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4
+#define GL_X_EXT 0x87D5
+#define GL_Y_EXT 0x87D6
+#define GL_Z_EXT 0x87D7
+#define GL_W_EXT 0x87D8
+#define GL_NEGATIVE_X_EXT 0x87D9
+#define GL_NEGATIVE_Y_EXT 0x87DA
+#define GL_NEGATIVE_Z_EXT 0x87DB
+#define GL_NEGATIVE_W_EXT 0x87DC
+#define GL_ZERO_EXT 0x87DD
+#define GL_ONE_EXT 0x87DE
+#define GL_NEGATIVE_ONE_EXT 0x87DF
+#define GL_NORMALIZED_RANGE_EXT 0x87E0
+#define GL_FULL_RANGE_EXT 0x87E1
+#define GL_CURRENT_VERTEX_EXT 0x87E2
+#define GL_MVP_MATRIX_EXT 0x87E3
+#define GL_VARIANT_VALUE_EXT 0x87E4
+#define GL_VARIANT_DATATYPE_EXT 0x87E5
+#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6
+#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7
+#define GL_VARIANT_ARRAY_EXT 0x87E8
+#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9
+#define GL_INVARIANT_VALUE_EXT 0x87EA
+#define GL_INVARIANT_DATATYPE_EXT 0x87EB
+#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC
+#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED
+#endif
+
+#ifndef GL_ATI_vertex_streams
+#define GL_MAX_VERTEX_STREAMS_ATI 0x876B
+#define GL_VERTEX_STREAM0_ATI 0x876C
+#define GL_VERTEX_STREAM1_ATI 0x876D
+#define GL_VERTEX_STREAM2_ATI 0x876E
+#define GL_VERTEX_STREAM3_ATI 0x876F
+#define GL_VERTEX_STREAM4_ATI 0x8770
+#define GL_VERTEX_STREAM5_ATI 0x8771
+#define GL_VERTEX_STREAM6_ATI 0x8772
+#define GL_VERTEX_STREAM7_ATI 0x8773
+#define GL_VERTEX_SOURCE_ATI 0x8774
+#endif
+
+#ifndef GL_ATI_element_array
+#define GL_ELEMENT_ARRAY_ATI 0x8768
+#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769
+#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A
+#endif
+
+#ifndef GL_SUN_mesh_array
+#define GL_QUAD_MESH_SUN 0x8614
+#define GL_TRIANGLE_MESH_SUN 0x8615
+#endif
+
+#ifndef GL_SUN_slice_accum
+#define GL_SLICE_ACCUM_SUN 0x85CC
+#endif
+
+#ifndef GL_NV_multisample_filter_hint
+#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534
+#endif
+
+#ifndef GL_NV_depth_clamp
+#define GL_DEPTH_CLAMP_NV 0x864F
+#endif
+
+#ifndef GL_NV_occlusion_query
+#define GL_PIXEL_COUNTER_BITS_NV 0x8864
+#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865
+#define GL_PIXEL_COUNT_NV 0x8866
+#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867
+#endif
+
+#ifndef GL_NV_point_sprite
+#define GL_POINT_SPRITE_NV 0x8861
+#define GL_COORD_REPLACE_NV 0x8862
+#define GL_POINT_SPRITE_R_MODE_NV 0x8863
+#endif
+
+#ifndef GL_NV_texture_shader3
+#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850
+#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851
+#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852
+#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853
+#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854
+#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855
+#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856
+#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857
+#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858
+#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859
+#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A
+#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B
+#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C
+#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D
+#define GL_HILO8_NV 0x885E
+#define GL_SIGNED_HILO8_NV 0x885F
+#define GL_FORCE_BLUE_TO_ONE_NV 0x8860
+#endif
+
+#ifndef GL_NV_vertex_program1_1
+#endif
+
+#ifndef GL_EXT_shadow_funcs
+#endif
+
+#ifndef GL_EXT_stencil_two_side
+#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910
+#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911
+#endif
+
+#ifndef GL_ATI_text_fragment_shader
+#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200
+#endif
+
+#ifndef GL_APPLE_client_storage
+#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2
+#endif
+
+#ifndef GL_APPLE_element_array
+#define GL_ELEMENT_ARRAY_APPLE 0x8768
+#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8769
+#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x876A
+#endif
+
+#ifndef GL_APPLE_fence
+#define GL_DRAW_PIXELS_APPLE 0x8A0A
+#define GL_FENCE_APPLE 0x8A0B
+#endif
+
+#ifndef GL_APPLE_vertex_array_object
+#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5
+#endif
+
+#ifndef GL_APPLE_vertex_array_range
+#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D
+#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E
+#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F
+#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521
+#define GL_STORAGE_CACHED_APPLE 0x85BE
+#define GL_STORAGE_SHARED_APPLE 0x85BF
+#endif
+
+#ifndef GL_APPLE_ycbcr_422
+#define GL_YCBCR_422_APPLE 0x85B9
+#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA
+#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB
+#endif
+
+#ifndef GL_S3_s3tc
+#define GL_RGB_S3TC 0x83A0
+#define GL_RGB4_S3TC 0x83A1
+#define GL_RGBA_S3TC 0x83A2
+#define GL_RGBA4_S3TC 0x83A3
+#endif
+
+#ifndef GL_ATI_draw_buffers
+#define GL_MAX_DRAW_BUFFERS_ATI 0x8824
+#define GL_DRAW_BUFFER0_ATI 0x8825
+#define GL_DRAW_BUFFER1_ATI 0x8826
+#define GL_DRAW_BUFFER2_ATI 0x8827
+#define GL_DRAW_BUFFER3_ATI 0x8828
+#define GL_DRAW_BUFFER4_ATI 0x8829
+#define GL_DRAW_BUFFER5_ATI 0x882A
+#define GL_DRAW_BUFFER6_ATI 0x882B
+#define GL_DRAW_BUFFER7_ATI 0x882C
+#define GL_DRAW_BUFFER8_ATI 0x882D
+#define GL_DRAW_BUFFER9_ATI 0x882E
+#define GL_DRAW_BUFFER10_ATI 0x882F
+#define GL_DRAW_BUFFER11_ATI 0x8830
+#define GL_DRAW_BUFFER12_ATI 0x8831
+#define GL_DRAW_BUFFER13_ATI 0x8832
+#define GL_DRAW_BUFFER14_ATI 0x8833
+#define GL_DRAW_BUFFER15_ATI 0x8834
+#endif
+
+#ifndef GL_ATI_pixel_format_float
+#define GL_TYPE_RGBA_FLOAT_ATI 0x8820
+#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835
+#endif
+
+#ifndef GL_ATI_texture_env_combine3
+#define GL_MODULATE_ADD_ATI 0x8744
+#define GL_MODULATE_SIGNED_ADD_ATI 0x8745
+#define GL_MODULATE_SUBTRACT_ATI 0x8746
+#endif
+
+#ifndef GL_ATI_texture_float
+#define GL_RGBA_FLOAT32_ATI 0x8814
+#define GL_RGB_FLOAT32_ATI 0x8815
+#define GL_ALPHA_FLOAT32_ATI 0x8816
+#define GL_INTENSITY_FLOAT32_ATI 0x8817
+#define GL_LUMINANCE_FLOAT32_ATI 0x8818
+#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819
+#define GL_RGBA_FLOAT16_ATI 0x881A
+#define GL_RGB_FLOAT16_ATI 0x881B
+#define GL_ALPHA_FLOAT16_ATI 0x881C
+#define GL_INTENSITY_FLOAT16_ATI 0x881D
+#define GL_LUMINANCE_FLOAT16_ATI 0x881E
+#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F
+#endif
+
+#ifndef GL_NV_float_buffer
+#define GL_FLOAT_R_NV 0x8880
+#define GL_FLOAT_RG_NV 0x8881
+#define GL_FLOAT_RGB_NV 0x8882
+#define GL_FLOAT_RGBA_NV 0x8883
+#define GL_FLOAT_R16_NV 0x8884
+#define GL_FLOAT_R32_NV 0x8885
+#define GL_FLOAT_RG16_NV 0x8886
+#define GL_FLOAT_RG32_NV 0x8887
+#define GL_FLOAT_RGB16_NV 0x8888
+#define GL_FLOAT_RGB32_NV 0x8889
+#define GL_FLOAT_RGBA16_NV 0x888A
+#define GL_FLOAT_RGBA32_NV 0x888B
+#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C
+#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D
+#define GL_FLOAT_RGBA_MODE_NV 0x888E
+#endif
+
+#ifndef GL_NV_fragment_program
+#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868
+#define GL_FRAGMENT_PROGRAM_NV 0x8870
+#define GL_MAX_TEXTURE_COORDS_NV 0x8871
+#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872
+#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873
+#define GL_PROGRAM_ERROR_STRING_NV 0x8874
+#endif
+
+#ifndef GL_NV_half_float
+#define GL_HALF_FLOAT_NV 0x140B
+#endif
+
+#ifndef GL_NV_pixel_data_range
+#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878
+#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879
+#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A
+#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B
+#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C
+#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D
+#endif
+
+#ifndef GL_NV_primitive_restart
+#define GL_PRIMITIVE_RESTART_NV 0x8558
+#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559
+#endif
+
+#ifndef GL_NV_texture_expand_normal
+#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F
+#endif
+
+#ifndef GL_NV_vertex_program2
+#endif
+
+#ifndef GL_ATI_map_object_buffer
+#endif
+
+#ifndef GL_ATI_separate_stencil
+#define GL_STENCIL_BACK_FUNC_ATI 0x8800
+#define GL_STENCIL_BACK_FAIL_ATI 0x8801
+#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802
+#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803
+#endif
+
+#ifndef GL_ATI_vertex_attrib_array_object
+#endif
+
+#ifndef GL_OES_read_format
+#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A
+#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B
+#endif
+
+#ifndef GL_EXT_depth_bounds_test
+#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890
+#define GL_DEPTH_BOUNDS_EXT 0x8891
+#endif
+
+#ifndef GL_EXT_texture_mirror_clamp
+#define GL_MIRROR_CLAMP_EXT 0x8742
+#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743
+#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912
+#endif
+
+#ifndef GL_EXT_blend_equation_separate
+#define GL_BLEND_EQUATION_RGB_EXT GL_BLEND_EQUATION
+#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D
+#endif
+
+#ifndef GL_MESA_pack_invert
+#define GL_PACK_INVERT_MESA 0x8758
+#endif
+
+#ifndef GL_MESA_ycbcr_texture
+#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA
+#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB
+#define GL_YCBCR_MESA 0x8757
+#endif
+
+#ifndef GL_EXT_pixel_buffer_object
+#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB
+#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC
+#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED
+#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF
+#endif
+
+#ifndef GL_NV_fragment_program_option
+#endif
+
+#ifndef GL_NV_fragment_program2
+#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4
+#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5
+#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6
+#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7
+#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8
+#endif
+
+#ifndef GL_NV_vertex_program2_option
+/* reuse GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */
+/* reuse GL_MAX_PROGRAM_CALL_DEPTH_NV */
+#endif
+
+#ifndef GL_NV_vertex_program3
+/* reuse GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */
+#endif
+
+#ifndef GL_EXT_framebuffer_object
+#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506
+#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8
+#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6
+#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4
+#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5
+#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6
+#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7
+#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9
+#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA
+#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB
+#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC
+#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD
+#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF
+#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0
+#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1
+#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2
+#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3
+#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4
+#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5
+#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6
+#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7
+#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8
+#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9
+#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA
+#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB
+#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC
+#define GL_COLOR_ATTACHMENT13_EXT 0x8CED
+#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE
+#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF
+#define GL_DEPTH_ATTACHMENT_EXT 0x8D00
+#define GL_STENCIL_ATTACHMENT_EXT 0x8D20
+#define GL_FRAMEBUFFER_EXT 0x8D40
+#define GL_RENDERBUFFER_EXT 0x8D41
+#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42
+#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43
+#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44
+#define GL_STENCIL_INDEX1_EXT 0x8D46
+#define GL_STENCIL_INDEX4_EXT 0x8D47
+#define GL_STENCIL_INDEX8_EXT 0x8D48
+#define GL_STENCIL_INDEX16_EXT 0x8D49
+#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50
+#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51
+#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52
+#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53
+#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54
+#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55
+#endif
+
+#ifndef GL_GREMEDY_string_marker
+#endif
+
+#ifndef GL_EXT_packed_depth_stencil
+#define GL_DEPTH_STENCIL_EXT 0x84F9
+#define GL_UNSIGNED_INT_24_8_EXT 0x84FA
+#define GL_DEPTH24_STENCIL8_EXT 0x88F0
+#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1
+#endif
+
+#ifndef GL_EXT_stencil_clear_tag
+#define GL_STENCIL_TAG_BITS_EXT 0x88F2
+#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3
+#endif
+
+#ifndef GL_EXT_texture_sRGB
+#define GL_SRGB_EXT 0x8C40
+#define GL_SRGB8_EXT 0x8C41
+#define GL_SRGB_ALPHA_EXT 0x8C42
+#define GL_SRGB8_ALPHA8_EXT 0x8C43
+#define GL_SLUMINANCE_ALPHA_EXT 0x8C44
+#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45
+#define GL_SLUMINANCE_EXT 0x8C46
+#define GL_SLUMINANCE8_EXT 0x8C47
+#define GL_COMPRESSED_SRGB_EXT 0x8C48
+#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49
+#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A
+#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B
+#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F
+#endif
+
+#ifndef GL_EXT_framebuffer_blit
+#define GL_READ_FRAMEBUFFER_EXT 0x8CA8
+#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9
+#define GL_READ_FRAMEBUFFER_BINDING_EXT GL_FRAMEBUFFER_BINDING_EXT
+#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CAA
+#endif
+
+#ifndef GL_EXT_framebuffer_multisample
+#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56
+#define GL_MAX_SAMPLES_EXT 0x8D57
+#endif
+
+#ifndef GL_MESAX_texture_stack
+#define GL_TEXTURE_1D_STACK_MESAX 0x8759
+#define GL_TEXTURE_2D_STACK_MESAX 0x875A
+#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B
+#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C
+#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D
+#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E
+#endif
+
+#ifndef GL_EXT_timer_query
+#define GL_TIME_ELAPSED_EXT 0x88BF
+#endif
+
+#ifndef GL_EXT_gpu_program_parameters
+#endif
+
+#ifndef GL_APPLE_flush_buffer_range
+#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12
+#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13
+#endif
+
+#ifndef GL_NV_gpu_program4
+#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904
+#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905
+#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906
+#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907
+#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908
+#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909
+#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5
+#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6
+#endif
+
+#ifndef GL_NV_geometry_program4
+#define GL_LINES_ADJACENCY_EXT 0x000A
+#define GL_LINE_STRIP_ADJACENCY_EXT 0x000B
+#define GL_TRIANGLES_ADJACENCY_EXT 0x000C
+#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0x000D
+#define GL_GEOMETRY_PROGRAM_NV 0x8C26
+#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27
+#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28
+#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA
+#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB
+#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC
+#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29
+#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7
+#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8
+#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4
+#define GL_PROGRAM_POINT_SIZE_EXT 0x8642
+#endif
+
+#ifndef GL_EXT_geometry_shader4
+#define GL_GEOMETRY_SHADER_EXT 0x8DD9
+/* reuse GL_GEOMETRY_VERTICES_OUT_EXT */
+/* reuse GL_GEOMETRY_INPUT_TYPE_EXT */
+/* reuse GL_GEOMETRY_OUTPUT_TYPE_EXT */
+/* reuse GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT */
+#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD
+#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE
+#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B
+#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF
+#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0
+#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1
+/* reuse GL_LINES_ADJACENCY_EXT */
+/* reuse GL_LINE_STRIP_ADJACENCY_EXT */
+/* reuse GL_TRIANGLES_ADJACENCY_EXT */
+/* reuse GL_TRIANGLE_STRIP_ADJACENCY_EXT */
+/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT */
+/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */
+/* reuse GL_PROGRAM_POINT_SIZE_EXT */
+#endif
+
+#ifndef GL_NV_vertex_program4
+#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD
+#endif
+
+#ifndef GL_EXT_gpu_shader4
+#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0
+#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1
+#define GL_SAMPLER_BUFFER_EXT 0x8DC2
+#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3
+#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4
+#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5
+#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6
+#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7
+#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8
+#define GL_INT_SAMPLER_1D_EXT 0x8DC9
+#define GL_INT_SAMPLER_2D_EXT 0x8DCA
+#define GL_INT_SAMPLER_3D_EXT 0x8DCB
+#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC
+#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD
+#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE
+#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF
+#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0
+#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1
+#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2
+#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3
+#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4
+#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5
+#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6
+#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7
+#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8
+#endif
+
+#ifndef GL_EXT_draw_instanced
+#endif
+
+#ifndef GL_EXT_packed_float
+#define GL_R11F_G11F_B10F_EXT 0x8C3A
+#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B
+#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C
+#endif
+
+#ifndef GL_EXT_texture_array
+#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18
+#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19
+#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A
+#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B
+#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C
+#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D
+#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF
+#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */
+#endif
+
+#ifndef GL_EXT_texture_buffer_object
+#define GL_TEXTURE_BUFFER_EXT 0x8C2A
+#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B
+#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C
+#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D
+#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E
+#endif
+
+#ifndef GL_EXT_texture_compression_latc
+#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70
+#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71
+#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72
+#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73
+#endif
+
+#ifndef GL_EXT_texture_compression_rgtc
+#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB
+#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC
+#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD
+#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE
+#endif
+
+#ifndef GL_EXT_texture_shared_exponent
+#define GL_RGB9_E5_EXT 0x8C3D
+#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E
+#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F
+#endif
+
+#ifndef GL_NV_depth_buffer_float
+#define GL_DEPTH_COMPONENT32F_NV 0x8DAB
+#define GL_DEPTH32F_STENCIL8_NV 0x8DAC
+#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD
+#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF
+#endif
+
+#ifndef GL_NV_fragment_program4
+#endif
+
+#ifndef GL_NV_framebuffer_multisample_coverage
+#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB
+#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10
+#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11
+#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12
+#endif
+
+#ifndef GL_EXT_framebuffer_sRGB
+#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9
+#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA
+#endif
+
+#ifndef GL_NV_geometry_shader4
+#endif
+
+#ifndef GL_NV_parameter_buffer_object
+#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0
+#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1
+#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2
+#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3
+#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4
+#endif
+
+#ifndef GL_EXT_draw_buffers2
+#endif
+
+#ifndef GL_NV_transform_feedback
+#define GL_BACK_PRIMARY_COLOR_NV 0x8C77
+#define GL_BACK_SECONDARY_COLOR_NV 0x8C78
+#define GL_TEXTURE_COORD_NV 0x8C79
+#define GL_CLIP_DISTANCE_NV 0x8C7A
+#define GL_VERTEX_ID_NV 0x8C7B
+#define GL_PRIMITIVE_ID_NV 0x8C7C
+#define GL_GENERIC_ATTRIB_NV 0x8C7D
+#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E
+#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80
+#define GL_ACTIVE_VARYINGS_NV 0x8C81
+#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82
+#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83
+#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84
+#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85
+#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86
+#define GL_PRIMITIVES_GENERATED_NV 0x8C87
+#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88
+#define GL_RASTERIZER_DISCARD_NV 0x8C89
+#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_ATTRIBS_NV 0x8C8A
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B
+#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C
+#define GL_SEPARATE_ATTRIBS_NV 0x8C8D
+#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E
+#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F
+#endif
+
+#ifndef GL_EXT_bindable_uniform
+#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2
+#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3
+#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4
+#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED
+#define GL_UNIFORM_BUFFER_EXT 0x8DEE
+#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF
+#endif
+
+#ifndef GL_EXT_texture_integer
+#define GL_RGBA32UI_EXT 0x8D70
+#define GL_RGB32UI_EXT 0x8D71
+#define GL_ALPHA32UI_EXT 0x8D72
+#define GL_INTENSITY32UI_EXT 0x8D73
+#define GL_LUMINANCE32UI_EXT 0x8D74
+#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75
+#define GL_RGBA16UI_EXT 0x8D76
+#define GL_RGB16UI_EXT 0x8D77
+#define GL_ALPHA16UI_EXT 0x8D78
+#define GL_INTENSITY16UI_EXT 0x8D79
+#define GL_LUMINANCE16UI_EXT 0x8D7A
+#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B
+#define GL_RGBA8UI_EXT 0x8D7C
+#define GL_RGB8UI_EXT 0x8D7D
+#define GL_ALPHA8UI_EXT 0x8D7E
+#define GL_INTENSITY8UI_EXT 0x8D7F
+#define GL_LUMINANCE8UI_EXT 0x8D80
+#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81
+#define GL_RGBA32I_EXT 0x8D82
+#define GL_RGB32I_EXT 0x8D83
+#define GL_ALPHA32I_EXT 0x8D84
+#define GL_INTENSITY32I_EXT 0x8D85
+#define GL_LUMINANCE32I_EXT 0x8D86
+#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87
+#define GL_RGBA16I_EXT 0x8D88
+#define GL_RGB16I_EXT 0x8D89
+#define GL_ALPHA16I_EXT 0x8D8A
+#define GL_INTENSITY16I_EXT 0x8D8B
+#define GL_LUMINANCE16I_EXT 0x8D8C
+#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D
+#define GL_RGBA8I_EXT 0x8D8E
+#define GL_RGB8I_EXT 0x8D8F
+#define GL_ALPHA8I_EXT 0x8D90
+#define GL_INTENSITY8I_EXT 0x8D91
+#define GL_LUMINANCE8I_EXT 0x8D92
+#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93
+#define GL_RED_INTEGER_EXT 0x8D94
+#define GL_GREEN_INTEGER_EXT 0x8D95
+#define GL_BLUE_INTEGER_EXT 0x8D96
+#define GL_ALPHA_INTEGER_EXT 0x8D97
+#define GL_RGB_INTEGER_EXT 0x8D98
+#define GL_RGBA_INTEGER_EXT 0x8D99
+#define GL_BGR_INTEGER_EXT 0x8D9A
+#define GL_BGRA_INTEGER_EXT 0x8D9B
+#define GL_LUMINANCE_INTEGER_EXT 0x8D9C
+#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D
+#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E
+#endif
+
+
+/*************************************************************/
+
+#include <stddef.h>
+#ifndef GL_VERSION_2_0
+/* GL type for program/shader text */
+typedef char GLchar; /* native character */
+#endif
+
+#ifndef GL_VERSION_1_5
+/* GL types for handling large vertex buffer objects */
+typedef ptrdiff_t GLintptr;
+typedef ptrdiff_t GLsizeiptr;
+#endif
+
+#ifndef GL_ARB_vertex_buffer_object
+/* GL types for handling large vertex buffer objects */
+typedef ptrdiff_t GLintptrARB;
+typedef ptrdiff_t GLsizeiptrARB;
+#endif
+
+#ifndef GL_ARB_shader_objects
+/* GL types for handling shader object handles and program/shader text */
+typedef char GLcharARB; /* native character */
+typedef unsigned int GLhandleARB; /* shader object handle */
+#endif
+
+/* GL types for "half" precision (s10e5) float data in host memory */
+#ifndef GL_ARB_half_float_pixel
+typedef unsigned short GLhalfARB;
+#endif
+
+#ifndef GL_NV_half_float
+typedef unsigned short GLhalfNV;
+#endif
+
+#ifndef GLEXT_64_TYPES_DEFINED
+/* This code block is duplicated in glext.h, so must be protected */
+#define GLEXT_64_TYPES_DEFINED
+/* Define int32_t, int64_t, and uint64_t types for UST/MSC */
+/* (as used in the GL_EXT_timer_query extension). */
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+#include <inttypes.h>
+#elif defined(__sun__)
+#include <inttypes.h>
+#if defined(__STDC__)
+#if defined(__arch64__)
+typedef long int int64_t;
+typedef unsigned long int uint64_t;
+#else
+typedef long long int int64_t;
+typedef unsigned long long int uint64_t;
+#endif /* __arch64__ */
+#endif /* __STDC__ */
+#elif defined( __VMS )
+#include <inttypes.h>
+#elif defined(__SCO__) || defined(__USLC__)
+#include <stdint.h>
+#elif defined(__UNIXOS2__) || defined(__SOL64__)
+typedef long int int32_t;
+typedef long long int int64_t;
+typedef unsigned long long int uint64_t;
+#elif defined(_WIN32) && defined(__GNUC__)
+#include <stdint.h>
+#elif defined(_WIN32)
+typedef __int32 int32_t;
+typedef __int64 int64_t;
+typedef unsigned __int64 uint64_t;
+#else
+#include <inttypes.h> /* Fallback option */
+#endif
+#endif
+
+#ifndef GL_EXT_timer_query
+typedef int64_t GLint64EXT;
+typedef uint64_t GLuint64EXT;
+#endif
+
+#ifndef GL_VERSION_1_2
+#define GL_VERSION_1_2 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendColor (GLclampf, GLclampf, GLclampf, GLclampf);
+GLAPI void APIENTRY glBlendEquation (GLenum);
+GLAPI void APIENTRY glDrawRangeElements (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *);
+GLAPI void APIENTRY glColorTable (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glColorTableParameterfv (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glColorTableParameteriv (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glCopyColorTable (GLenum, GLenum, GLint, GLint, GLsizei);
+GLAPI void APIENTRY glGetColorTable (GLenum, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetColorTableParameterfv (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetColorTableParameteriv (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glColorSubTable (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glCopyColorSubTable (GLenum, GLsizei, GLint, GLint, GLsizei);
+GLAPI void APIENTRY glConvolutionFilter1D (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glConvolutionFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glConvolutionParameterf (GLenum, GLenum, GLfloat);
+GLAPI void APIENTRY glConvolutionParameterfv (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glConvolutionParameteri (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glConvolutionParameteriv (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum, GLenum, GLint, GLint, GLsizei);
+GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei);
+GLAPI void APIENTRY glGetConvolutionFilter (GLenum, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetSeparableFilter (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *);
+GLAPI void APIENTRY glSeparableFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *);
+GLAPI void APIENTRY glGetHistogram (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetHistogramParameterfv (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetHistogramParameteriv (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetMinmax (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glHistogram (GLenum, GLsizei, GLenum, GLboolean);
+GLAPI void APIENTRY glMinmax (GLenum, GLenum, GLboolean);
+GLAPI void APIENTRY glResetHistogram (GLenum);
+GLAPI void APIENTRY glResetMinmax (GLenum);
+GLAPI void APIENTRY glTexImage3D (GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glCopyTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
+typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
+typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+#endif
+
+#ifndef GL_VERSION_1_3
+#define GL_VERSION_1_3 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glActiveTexture (GLenum);
+GLAPI void APIENTRY glClientActiveTexture (GLenum);
+GLAPI void APIENTRY glMultiTexCoord1d (GLenum, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord1dv (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord1f (GLenum, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord1fv (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord1i (GLenum, GLint);
+GLAPI void APIENTRY glMultiTexCoord1iv (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord1s (GLenum, GLshort);
+GLAPI void APIENTRY glMultiTexCoord1sv (GLenum, const GLshort *);
+GLAPI void APIENTRY glMultiTexCoord2d (GLenum, GLdouble, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord2dv (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord2f (GLenum, GLfloat, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord2fv (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord2i (GLenum, GLint, GLint);
+GLAPI void APIENTRY glMultiTexCoord2iv (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord2s (GLenum, GLshort, GLshort);
+GLAPI void APIENTRY glMultiTexCoord2sv (GLenum, const GLshort *);
+GLAPI void APIENTRY glMultiTexCoord3d (GLenum, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord3dv (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord3f (GLenum, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord3fv (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord3i (GLenum, GLint, GLint, GLint);
+GLAPI void APIENTRY glMultiTexCoord3iv (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord3s (GLenum, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glMultiTexCoord3sv (GLenum, const GLshort *);
+GLAPI void APIENTRY glMultiTexCoord4d (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord4dv (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord4f (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord4fv (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord4i (GLenum, GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glMultiTexCoord4iv (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord4s (GLenum, GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glMultiTexCoord4sv (GLenum, const GLshort *);
+GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *);
+GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *);
+GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *);
+GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *);
+GLAPI void APIENTRY glSampleCoverage (GLclampf, GLboolean);
+GLAPI void APIENTRY glCompressedTexImage3D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexImage2D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexImage1D (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glGetCompressedTexImage (GLenum, GLint, GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m);
+typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img);
+#endif
+
+#ifndef GL_VERSION_1_4
+#define GL_VERSION_1_4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendFuncSeparate (GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glFogCoordf (GLfloat);
+GLAPI void APIENTRY glFogCoordfv (const GLfloat *);
+GLAPI void APIENTRY glFogCoordd (GLdouble);
+GLAPI void APIENTRY glFogCoorddv (const GLdouble *);
+GLAPI void APIENTRY glFogCoordPointer (GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glMultiDrawArrays (GLenum, GLint *, GLsizei *, GLsizei);
+GLAPI void APIENTRY glMultiDrawElements (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei);
+GLAPI void APIENTRY glPointParameterf (GLenum, GLfloat);
+GLAPI void APIENTRY glPointParameterfv (GLenum, const GLfloat *);
+GLAPI void APIENTRY glPointParameteri (GLenum, GLint);
+GLAPI void APIENTRY glPointParameteriv (GLenum, const GLint *);
+GLAPI void APIENTRY glSecondaryColor3b (GLbyte, GLbyte, GLbyte);
+GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *);
+GLAPI void APIENTRY glSecondaryColor3d (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *);
+GLAPI void APIENTRY glSecondaryColor3f (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *);
+GLAPI void APIENTRY glSecondaryColor3i (GLint, GLint, GLint);
+GLAPI void APIENTRY glSecondaryColor3iv (const GLint *);
+GLAPI void APIENTRY glSecondaryColor3s (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *);
+GLAPI void APIENTRY glSecondaryColor3ub (GLubyte, GLubyte, GLubyte);
+GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *);
+GLAPI void APIENTRY glSecondaryColor3ui (GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *);
+GLAPI void APIENTRY glSecondaryColor3us (GLushort, GLushort, GLushort);
+GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *);
+GLAPI void APIENTRY glSecondaryColorPointer (GLint, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glWindowPos2d (GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos2dv (const GLdouble *);
+GLAPI void APIENTRY glWindowPos2f (GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos2fv (const GLfloat *);
+GLAPI void APIENTRY glWindowPos2i (GLint, GLint);
+GLAPI void APIENTRY glWindowPos2iv (const GLint *);
+GLAPI void APIENTRY glWindowPos2s (GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos2sv (const GLshort *);
+GLAPI void APIENTRY glWindowPos3d (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos3dv (const GLdouble *);
+GLAPI void APIENTRY glWindowPos3f (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos3fv (const GLfloat *);
+GLAPI void APIENTRY glWindowPos3i (GLint, GLint, GLint);
+GLAPI void APIENTRY glWindowPos3iv (const GLint *);
+GLAPI void APIENTRY glWindowPos3s (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos3sv (const GLshort *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord);
+typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord);
+typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord);
+typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord);
+typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v);
+#endif
+
+#ifndef GL_VERSION_1_5
+#define GL_VERSION_1_5 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenQueries (GLsizei, GLuint *);
+GLAPI void APIENTRY glDeleteQueries (GLsizei, const GLuint *);
+GLAPI GLboolean APIENTRY glIsQuery (GLuint);
+GLAPI void APIENTRY glBeginQuery (GLenum, GLuint);
+GLAPI void APIENTRY glEndQuery (GLenum);
+GLAPI void APIENTRY glGetQueryiv (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetQueryObjectiv (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetQueryObjectuiv (GLuint, GLenum, GLuint *);
+GLAPI void APIENTRY glBindBuffer (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteBuffers (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenBuffers (GLsizei, GLuint *);
+GLAPI GLboolean APIENTRY glIsBuffer (GLuint);
+GLAPI void APIENTRY glBufferData (GLenum, GLsizeiptr, const GLvoid *, GLenum);
+GLAPI void APIENTRY glBufferSubData (GLenum, GLintptr, GLsizeiptr, const GLvoid *);
+GLAPI void APIENTRY glGetBufferSubData (GLenum, GLintptr, GLsizeiptr, GLvoid *);
+GLAPI GLvoid* APIENTRY glMapBuffer (GLenum, GLenum);
+GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum);
+GLAPI void APIENTRY glGetBufferParameteriv (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetBufferPointerv (GLenum, GLenum, GLvoid* *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids);
+typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids);
+typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id);
+typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params);
+typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
+typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers);
+typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers);
+typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
+typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data);
+typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access);
+typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid* *params);
+#endif
+
+#ifndef GL_VERSION_2_0
+#define GL_VERSION_2_0 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendEquationSeparate (GLenum, GLenum);
+GLAPI void APIENTRY glDrawBuffers (GLsizei, const GLenum *);
+GLAPI void APIENTRY glStencilOpSeparate (GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glStencilFuncSeparate (GLenum, GLenum, GLint, GLuint);
+GLAPI void APIENTRY glStencilMaskSeparate (GLenum, GLuint);
+GLAPI void APIENTRY glAttachShader (GLuint, GLuint);
+GLAPI void APIENTRY glBindAttribLocation (GLuint, GLuint, const GLchar *);
+GLAPI void APIENTRY glCompileShader (GLuint);
+GLAPI GLuint APIENTRY glCreateProgram (void);
+GLAPI GLuint APIENTRY glCreateShader (GLenum);
+GLAPI void APIENTRY glDeleteProgram (GLuint);
+GLAPI void APIENTRY glDeleteShader (GLuint);
+GLAPI void APIENTRY glDetachShader (GLuint, GLuint);
+GLAPI void APIENTRY glDisableVertexAttribArray (GLuint);
+GLAPI void APIENTRY glEnableVertexAttribArray (GLuint);
+GLAPI void APIENTRY glGetActiveAttrib (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *);
+GLAPI void APIENTRY glGetActiveUniform (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *);
+GLAPI void APIENTRY glGetAttachedShaders (GLuint, GLsizei, GLsizei *, GLuint *);
+GLAPI GLint APIENTRY glGetAttribLocation (GLuint, const GLchar *);
+GLAPI void APIENTRY glGetProgramiv (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetProgramInfoLog (GLuint, GLsizei, GLsizei *, GLchar *);
+GLAPI void APIENTRY glGetShaderiv (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetShaderInfoLog (GLuint, GLsizei, GLsizei *, GLchar *);
+GLAPI void APIENTRY glGetShaderSource (GLuint, GLsizei, GLsizei *, GLchar *);
+GLAPI GLint APIENTRY glGetUniformLocation (GLuint, const GLchar *);
+GLAPI void APIENTRY glGetUniformfv (GLuint, GLint, GLfloat *);
+GLAPI void APIENTRY glGetUniformiv (GLuint, GLint, GLint *);
+GLAPI void APIENTRY glGetVertexAttribdv (GLuint, GLenum, GLdouble *);
+GLAPI void APIENTRY glGetVertexAttribfv (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetVertexAttribiv (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint, GLenum, GLvoid* *);
+GLAPI GLboolean APIENTRY glIsProgram (GLuint);
+GLAPI GLboolean APIENTRY glIsShader (GLuint);
+GLAPI void APIENTRY glLinkProgram (GLuint);
+GLAPI void APIENTRY glShaderSource (GLuint, GLsizei, const GLchar* *, const GLint *);
+GLAPI void APIENTRY glUseProgram (GLuint);
+GLAPI void APIENTRY glUniform1f (GLint, GLfloat);
+GLAPI void APIENTRY glUniform2f (GLint, GLfloat, GLfloat);
+GLAPI void APIENTRY glUniform3f (GLint, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glUniform4f (GLint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glUniform1i (GLint, GLint);
+GLAPI void APIENTRY glUniform2i (GLint, GLint, GLint);
+GLAPI void APIENTRY glUniform3i (GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glUniform4i (GLint, GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glUniform1fv (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform2fv (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform3fv (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform4fv (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform1iv (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniform2iv (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniform3iv (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniform4iv (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniformMatrix2fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix3fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix4fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glValidateProgram (GLuint);
+GLAPI void APIENTRY glVertexAttrib1d (GLuint, GLdouble);
+GLAPI void APIENTRY glVertexAttrib1dv (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib1f (GLuint, GLfloat);
+GLAPI void APIENTRY glVertexAttrib1fv (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib1s (GLuint, GLshort);
+GLAPI void APIENTRY glVertexAttrib1sv (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib2d (GLuint, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib2dv (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib2f (GLuint, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib2fv (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib2s (GLuint, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib2sv (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib3d (GLuint, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib3dv (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib3f (GLuint, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib3fv (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib3s (GLuint, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib3sv (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint, const GLbyte *);
+GLAPI void APIENTRY glVertexAttrib4Niv (GLuint, const GLint *);
+GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4Nub (GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
+GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint, const GLuint *);
+GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint, const GLushort *);
+GLAPI void APIENTRY glVertexAttrib4bv (GLuint, const GLbyte *);
+GLAPI void APIENTRY glVertexAttrib4d (GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib4dv (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib4f (GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib4fv (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib4iv (GLuint, const GLint *);
+GLAPI void APIENTRY glVertexAttrib4s (GLuint, GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib4sv (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4ubv (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVertexAttrib4uiv (GLuint, const GLuint *);
+GLAPI void APIENTRY glVertexAttrib4usv (GLuint, const GLushort *);
+GLAPI void APIENTRY glVertexAttribPointer (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha);
+typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs);
+typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
+typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask);
+typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);
+typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name);
+typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader);
+typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void);
+typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type);
+typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program);
+typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader);
+typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader);
+typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index);
+typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);
+typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj);
+typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name);
+typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
+typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name);
+typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
+typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program);
+typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader);
+typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program);
+typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length);
+typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program);
+typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0);
+typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1);
+typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0);
+typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1);
+typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2);
+typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_VERSION_2_1
+#define GL_VERSION_2_1 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glUniformMatrix2x3fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix3x2fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix2x4fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix4x2fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix3x4fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix4x3fv (GLint, GLsizei, GLboolean, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+#endif
+
+#ifndef GL_ARB_multitexture
+#define GL_ARB_multitexture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glActiveTextureARB (GLenum);
+GLAPI void APIENTRY glClientActiveTextureARB (GLenum);
+GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum, GLint);
+GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum, GLshort);
+GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum, const GLshort *);
+GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum, GLdouble, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum, GLfloat, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum, GLint, GLint);
+GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum, GLshort, GLshort);
+GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum, const GLshort *);
+GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum, GLint, GLint, GLint);
+GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum, const GLshort *);
+GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum, GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum, GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum, const GLshort *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v);
+#endif
+
+#ifndef GL_ARB_transpose_matrix
+#define GL_ARB_transpose_matrix 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *);
+GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *);
+GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *);
+GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
+#endif
+
+#ifndef GL_ARB_multisample
+#define GL_ARB_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSampleCoverageARB (GLclampf, GLboolean);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert);
+#endif
+
+#ifndef GL_ARB_texture_env_add
+#define GL_ARB_texture_env_add 1
+#endif
+
+#ifndef GL_ARB_texture_cube_map
+#define GL_ARB_texture_cube_map 1
+#endif
+
+#ifndef GL_ARB_texture_compression
+#define GL_ARB_texture_compression 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum, GLint, GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, GLvoid *img);
+#endif
+
+#ifndef GL_ARB_texture_border_clamp
+#define GL_ARB_texture_border_clamp 1
+#endif
+
+#ifndef GL_ARB_point_parameters
+#define GL_ARB_point_parameters 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPointParameterfARB (GLenum, GLfloat);
+GLAPI void APIENTRY glPointParameterfvARB (GLenum, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params);
+#endif
+
+#ifndef GL_ARB_vertex_blend
+#define GL_ARB_vertex_blend 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glWeightbvARB (GLint, const GLbyte *);
+GLAPI void APIENTRY glWeightsvARB (GLint, const GLshort *);
+GLAPI void APIENTRY glWeightivARB (GLint, const GLint *);
+GLAPI void APIENTRY glWeightfvARB (GLint, const GLfloat *);
+GLAPI void APIENTRY glWeightdvARB (GLint, const GLdouble *);
+GLAPI void APIENTRY glWeightubvARB (GLint, const GLubyte *);
+GLAPI void APIENTRY glWeightusvARB (GLint, const GLushort *);
+GLAPI void APIENTRY glWeightuivARB (GLint, const GLuint *);
+GLAPI void APIENTRY glWeightPointerARB (GLint, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glVertexBlendARB (GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights);
+typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights);
+typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights);
+typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights);
+typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights);
+typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights);
+typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights);
+typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights);
+typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count);
+#endif
+
+#ifndef GL_ARB_matrix_palette
+#define GL_ARB_matrix_palette 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint);
+GLAPI void APIENTRY glMatrixIndexubvARB (GLint, const GLubyte *);
+GLAPI void APIENTRY glMatrixIndexusvARB (GLint, const GLushort *);
+GLAPI void APIENTRY glMatrixIndexuivARB (GLint, const GLuint *);
+GLAPI void APIENTRY glMatrixIndexPointerARB (GLint, GLenum, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index);
+typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices);
+typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices);
+typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices);
+typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_ARB_texture_env_combine
+#define GL_ARB_texture_env_combine 1
+#endif
+
+#ifndef GL_ARB_texture_env_crossbar
+#define GL_ARB_texture_env_crossbar 1
+#endif
+
+#ifndef GL_ARB_texture_env_dot3
+#define GL_ARB_texture_env_dot3 1
+#endif
+
+#ifndef GL_ARB_texture_mirrored_repeat
+#define GL_ARB_texture_mirrored_repeat 1
+#endif
+
+#ifndef GL_ARB_depth_texture
+#define GL_ARB_depth_texture 1
+#endif
+
+#ifndef GL_ARB_shadow
+#define GL_ARB_shadow 1
+#endif
+
+#ifndef GL_ARB_shadow_ambient
+#define GL_ARB_shadow_ambient 1
+#endif
+
+#ifndef GL_ARB_window_pos
+#define GL_ARB_window_pos 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glWindowPos2dARB (GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *);
+GLAPI void APIENTRY glWindowPos2fARB (GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *);
+GLAPI void APIENTRY glWindowPos2iARB (GLint, GLint);
+GLAPI void APIENTRY glWindowPos2ivARB (const GLint *);
+GLAPI void APIENTRY glWindowPos2sARB (GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos2svARB (const GLshort *);
+GLAPI void APIENTRY glWindowPos3dARB (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *);
+GLAPI void APIENTRY glWindowPos3fARB (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *);
+GLAPI void APIENTRY glWindowPos3iARB (GLint, GLint, GLint);
+GLAPI void APIENTRY glWindowPos3ivARB (const GLint *);
+GLAPI void APIENTRY glWindowPos3sARB (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos3svARB (const GLshort *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v);
+#endif
+
+#ifndef GL_ARB_vertex_program
+#define GL_ARB_vertex_program 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttrib1dARB (GLuint, GLdouble);
+GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib1fARB (GLuint, GLfloat);
+GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib1sARB (GLuint, GLshort);
+GLAPI void APIENTRY glVertexAttrib1svARB (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib2dARB (GLuint, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib2fARB (GLuint, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib2sARB (GLuint, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib2svARB (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib3dARB (GLuint, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib3fARB (GLuint, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib3sARB (GLuint, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib3svARB (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint, const GLbyte *);
+GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint, const GLint *);
+GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
+GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint, const GLuint *);
+GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint, const GLushort *);
+GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint, const GLbyte *);
+GLAPI void APIENTRY glVertexAttrib4dARB (GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib4fARB (GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint, const GLint *);
+GLAPI void APIENTRY glVertexAttrib4sARB (GLuint, GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib4svARB (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint, const GLuint *);
+GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint, const GLushort *);
+GLAPI void APIENTRY glVertexAttribPointerARB (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint);
+GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint);
+GLAPI void APIENTRY glProgramStringARB (GLenum, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glBindProgramARB (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteProgramsARB (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenProgramsARB (GLsizei, GLuint *);
+GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum, GLuint, const GLdouble *);
+GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum, GLuint, const GLfloat *);
+GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum, GLuint, const GLdouble *);
+GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum, GLuint, const GLfloat *);
+GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum, GLuint, GLdouble *);
+GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum, GLuint, GLfloat *);
+GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum, GLuint, GLdouble *);
+GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum, GLuint, GLfloat *);
+GLAPI void APIENTRY glGetProgramivARB (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetProgramStringARB (GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint, GLenum, GLdouble *);
+GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetVertexAttribivARB (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint, GLenum, GLvoid* *);
+GLAPI GLboolean APIENTRY glIsProgramARB (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
+typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
+typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string);
+typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program);
+typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs);
+typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
+typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program);
+#endif
+
+#ifndef GL_ARB_fragment_program
+#define GL_ARB_fragment_program 1
+/* All ARB_fragment_program entry points are shared with ARB_vertex_program. */
+#endif
+
+#ifndef GL_ARB_vertex_buffer_object
+#define GL_ARB_vertex_buffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindBufferARB (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteBuffersARB (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenBuffersARB (GLsizei, GLuint *);
+GLAPI GLboolean APIENTRY glIsBufferARB (GLuint);
+GLAPI void APIENTRY glBufferDataARB (GLenum, GLsizeiptrARB, const GLvoid *, GLenum);
+GLAPI void APIENTRY glBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *);
+GLAPI void APIENTRY glGetBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *);
+GLAPI GLvoid* APIENTRY glMapBufferARB (GLenum, GLenum);
+GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum);
+GLAPI void APIENTRY glGetBufferParameterivARB (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetBufferPointervARB (GLenum, GLenum, GLvoid* *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer);
+typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers);
+typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers);
+typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage);
+typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data);
+typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access);
+typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* *params);
+#endif
+
+#ifndef GL_ARB_occlusion_query
+#define GL_ARB_occlusion_query 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenQueriesARB (GLsizei, GLuint *);
+GLAPI void APIENTRY glDeleteQueriesARB (GLsizei, const GLuint *);
+GLAPI GLboolean APIENTRY glIsQueryARB (GLuint);
+GLAPI void APIENTRY glBeginQueryARB (GLenum, GLuint);
+GLAPI void APIENTRY glEndQueryARB (GLenum);
+GLAPI void APIENTRY glGetQueryivARB (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetQueryObjectivARB (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint, GLenum, GLuint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids);
+typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids);
+typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id);
+typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params);
+#endif
+
+#ifndef GL_ARB_shader_objects
+#define GL_ARB_shader_objects 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB);
+GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum);
+GLAPI void APIENTRY glDetachObjectARB (GLhandleARB, GLhandleARB);
+GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum);
+GLAPI void APIENTRY glShaderSourceARB (GLhandleARB, GLsizei, const GLcharARB* *, const GLint *);
+GLAPI void APIENTRY glCompileShaderARB (GLhandleARB);
+GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void);
+GLAPI void APIENTRY glAttachObjectARB (GLhandleARB, GLhandleARB);
+GLAPI void APIENTRY glLinkProgramARB (GLhandleARB);
+GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB);
+GLAPI void APIENTRY glValidateProgramARB (GLhandleARB);
+GLAPI void APIENTRY glUniform1fARB (GLint, GLfloat);
+GLAPI void APIENTRY glUniform2fARB (GLint, GLfloat, GLfloat);
+GLAPI void APIENTRY glUniform3fARB (GLint, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glUniform4fARB (GLint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glUniform1iARB (GLint, GLint);
+GLAPI void APIENTRY glUniform2iARB (GLint, GLint, GLint);
+GLAPI void APIENTRY glUniform3iARB (GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glUniform4iARB (GLint, GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glUniform1fvARB (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform2fvARB (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform3fvARB (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform4fvARB (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform1ivARB (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniform2ivARB (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniform3ivARB (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniform4ivARB (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniformMatrix2fvARB (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix3fvARB (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix4fvARB (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB, GLenum, GLint *);
+GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
+GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB, GLsizei, GLsizei *, GLhandleARB *);
+GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB, const GLcharARB *);
+GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *);
+GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB, GLint, GLfloat *);
+GLAPI void APIENTRY glGetUniformivARB (GLhandleARB, GLint, GLint *);
+GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj);
+typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname);
+typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj);
+typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType);
+typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length);
+typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj);
+typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void);
+typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj);
+typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj);
+typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj);
+typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj);
+typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0);
+typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1);
+typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0);
+typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1);
+typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2);
+typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog);
+typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj);
+typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);
+typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
+typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params);
+typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source);
+#endif
+
+#ifndef GL_ARB_vertex_shader
+#define GL_ARB_vertex_shader 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB, GLuint, const GLcharARB *);
+GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *);
+GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB, const GLcharARB *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name);
+typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
+typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);
+#endif
+
+#ifndef GL_ARB_fragment_shader
+#define GL_ARB_fragment_shader 1
+#endif
+
+#ifndef GL_ARB_shading_language_100
+#define GL_ARB_shading_language_100 1
+#endif
+
+#ifndef GL_ARB_texture_non_power_of_two
+#define GL_ARB_texture_non_power_of_two 1
+#endif
+
+#ifndef GL_ARB_point_sprite
+#define GL_ARB_point_sprite 1
+#endif
+
+#ifndef GL_ARB_fragment_program_shadow
+#define GL_ARB_fragment_program_shadow 1
+#endif
+
+#ifndef GL_ARB_draw_buffers
+#define GL_ARB_draw_buffers 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawBuffersARB (GLsizei, const GLenum *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs);
+#endif
+
+#ifndef GL_ARB_texture_rectangle
+#define GL_ARB_texture_rectangle 1
+#endif
+
+#ifndef GL_ARB_color_buffer_float
+#define GL_ARB_color_buffer_float 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glClampColorARB (GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp);
+#endif
+
+#ifndef GL_ARB_half_float_pixel
+#define GL_ARB_half_float_pixel 1
+#endif
+
+#ifndef GL_ARB_texture_float
+#define GL_ARB_texture_float 1
+#endif
+
+#ifndef GL_ARB_pixel_buffer_object
+#define GL_ARB_pixel_buffer_object 1
+#endif
+
+#ifndef GL_EXT_abgr
+#define GL_EXT_abgr 1
+#endif
+
+#ifndef GL_EXT_blend_color
+#define GL_EXT_blend_color 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendColorEXT (GLclampf, GLclampf, GLclampf, GLclampf);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+#endif
+
+#ifndef GL_EXT_polygon_offset
+#define GL_EXT_polygon_offset 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat, GLfloat);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias);
+#endif
+
+#ifndef GL_EXT_texture
+#define GL_EXT_texture 1
+#endif
+
+#ifndef GL_EXT_texture3D
+#define GL_EXT_texture3D 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexImage3DEXT (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+#endif
+
+#ifndef GL_SGIS_texture_filter4
+#define GL_SGIS_texture_filter4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum, GLenum, GLsizei, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights);
+typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights);
+#endif
+
+#ifndef GL_EXT_subtexture
+#define GL_EXT_subtexture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexSubImage1DEXT (GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+#endif
+
+#ifndef GL_EXT_copy_texture
+#define GL_EXT_copy_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint);
+GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint);
+GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei);
+GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
+GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+#endif
+
+#ifndef GL_EXT_histogram
+#define GL_EXT_histogram 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetHistogramEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetMinmaxEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glHistogramEXT (GLenum, GLsizei, GLenum, GLboolean);
+GLAPI void APIENTRY glMinmaxEXT (GLenum, GLenum, GLboolean);
+GLAPI void APIENTRY glResetHistogramEXT (GLenum);
+GLAPI void APIENTRY glResetMinmaxEXT (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target);
+#endif
+
+#ifndef GL_EXT_convolution
+#define GL_EXT_convolution 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum, GLenum, GLfloat);
+GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum, GLenum, GLint, GLint, GLsizei);
+GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei);
+GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *);
+GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
+typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
+#endif
+
+#ifndef GL_SGI_color_matrix
+#define GL_SGI_color_matrix 1
+#endif
+
+#ifndef GL_SGI_color_table
+#define GL_SGI_color_table 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorTableSGI (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glColorTableParameterivSGI (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glCopyColorTableSGI (GLenum, GLenum, GLint, GLint, GLsizei);
+GLAPI void APIENTRY glGetColorTableSGI (GLenum, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum, GLenum, GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_SGIX_pixel_texture
+#define GL_SGIX_pixel_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPixelTexGenSGIX (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode);
+#endif
+
+#ifndef GL_SGIS_pixel_texture
+#define GL_SGIS_pixel_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum, GLint);
+GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum, const GLint *);
+GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum, GLfloat);
+GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum, const GLfloat *);
+GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum, GLint *);
+GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_SGIS_texture4D
+#define GL_SGIS_texture4D 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexImage4DSGIS (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels);
+#endif
+
+#ifndef GL_SGI_texture_color_table
+#define GL_SGI_texture_color_table 1
+#endif
+
+#ifndef GL_EXT_cmyka
+#define GL_EXT_cmyka 1
+#endif
+
+#ifndef GL_EXT_texture_object
+#define GL_EXT_texture_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei, const GLuint *, GLboolean *);
+GLAPI void APIENTRY glBindTextureEXT (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenTexturesEXT (GLsizei, GLuint *);
+GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint);
+GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei, const GLuint *, const GLclampf *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences);
+typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture);
+typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures);
+typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures);
+typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture);
+typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities);
+#endif
+
+#ifndef GL_SGIS_detail_texture
+#define GL_SGIS_detail_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);
+typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points);
+#endif
+
+#ifndef GL_SGIS_sharpen_texture
+#define GL_SGIS_sharpen_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);
+typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points);
+#endif
+
+#ifndef GL_EXT_packed_pixels
+#define GL_EXT_packed_pixels 1
+#endif
+
+#ifndef GL_SGIS_texture_lod
+#define GL_SGIS_texture_lod 1
+#endif
+
+#ifndef GL_SGIS_multisample
+#define GL_SGIS_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSampleMaskSGIS (GLclampf, GLboolean);
+GLAPI void APIENTRY glSamplePatternSGIS (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert);
+typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern);
+#endif
+
+#ifndef GL_EXT_rescale_normal
+#define GL_EXT_rescale_normal 1
+#endif
+
+#ifndef GL_EXT_vertex_array
+#define GL_EXT_vertex_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glArrayElementEXT (GLint);
+GLAPI void APIENTRY glColorPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glDrawArraysEXT (GLenum, GLint, GLsizei);
+GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei, GLsizei, const GLboolean *);
+GLAPI void APIENTRY glGetPointervEXT (GLenum, GLvoid* *);
+GLAPI void APIENTRY glIndexPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glNormalPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glTexCoordPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glVertexPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i);
+typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count);
+typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer);
+typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params);
+typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+#endif
+
+#ifndef GL_EXT_misc_attribute
+#define GL_EXT_misc_attribute 1
+#endif
+
+#ifndef GL_SGIS_generate_mipmap
+#define GL_SGIS_generate_mipmap 1
+#endif
+
+#ifndef GL_SGIX_clipmap
+#define GL_SGIX_clipmap 1
+#endif
+
+#ifndef GL_SGIX_shadow
+#define GL_SGIX_shadow 1
+#endif
+
+#ifndef GL_SGIS_texture_edge_clamp
+#define GL_SGIS_texture_edge_clamp 1
+#endif
+
+#ifndef GL_SGIS_texture_border_clamp
+#define GL_SGIS_texture_border_clamp 1
+#endif
+
+#ifndef GL_EXT_blend_minmax
+#define GL_EXT_blend_minmax 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendEquationEXT (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode);
+#endif
+
+#ifndef GL_EXT_blend_subtract
+#define GL_EXT_blend_subtract 1
+#endif
+
+#ifndef GL_EXT_blend_logic_op
+#define GL_EXT_blend_logic_op 1
+#endif
+
+#ifndef GL_SGIX_interlace
+#define GL_SGIX_interlace 1
+#endif
+
+#ifndef GL_SGIX_pixel_tiles
+#define GL_SGIX_pixel_tiles 1
+#endif
+
+#ifndef GL_SGIX_texture_select
+#define GL_SGIX_texture_select 1
+#endif
+
+#ifndef GL_SGIX_sprite
+#define GL_SGIX_sprite 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum, GLfloat);
+GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum, const GLfloat *);
+GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum, GLint);
+GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum, const GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params);
+#endif
+
+#ifndef GL_SGIX_texture_multi_buffer
+#define GL_SGIX_texture_multi_buffer 1
+#endif
+
+#ifndef GL_EXT_point_parameters
+#define GL_EXT_point_parameters 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPointParameterfEXT (GLenum, GLfloat);
+GLAPI void APIENTRY glPointParameterfvEXT (GLenum, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params);
+#endif
+
+#ifndef GL_SGIS_point_parameters
+#define GL_SGIS_point_parameters 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPointParameterfSGIS (GLenum, GLfloat);
+GLAPI void APIENTRY glPointParameterfvSGIS (GLenum, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);
+#endif
+
+#ifndef GL_SGIX_instruments
+#define GL_SGIX_instruments 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLint APIENTRY glGetInstrumentsSGIX (void);
+GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei, GLint *);
+GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *);
+GLAPI void APIENTRY glReadInstrumentsSGIX (GLint);
+GLAPI void APIENTRY glStartInstrumentsSGIX (void);
+GLAPI void APIENTRY glStopInstrumentsSGIX (GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void);
+typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer);
+typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p);
+typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker);
+typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void);
+typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker);
+#endif
+
+#ifndef GL_SGIX_texture_scale_bias
+#define GL_SGIX_texture_scale_bias 1
+#endif
+
+#ifndef GL_SGIX_framezoom
+#define GL_SGIX_framezoom 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFrameZoomSGIX (GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor);
+#endif
+
+#ifndef GL_SGIX_tag_sample_buffer
+#define GL_SGIX_tag_sample_buffer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTagSampleBufferSGIX (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void);
+#endif
+
+#ifndef GL_SGIX_polynomial_ffd
+#define GL_SGIX_polynomial_ffd 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *);
+GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *);
+GLAPI void APIENTRY glDeformSGIX (GLbitfield);
+GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points);
+typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points);
+typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask);
+typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask);
+#endif
+
+#ifndef GL_SGIX_reference_plane
+#define GL_SGIX_reference_plane 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation);
+#endif
+
+#ifndef GL_SGIX_flush_raster
+#define GL_SGIX_flush_raster 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFlushRasterSGIX (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void);
+#endif
+
+#ifndef GL_SGIX_depth_texture
+#define GL_SGIX_depth_texture 1
+#endif
+
+#ifndef GL_SGIS_fog_function
+#define GL_SGIS_fog_function 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFogFuncSGIS (GLsizei, const GLfloat *);
+GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points);
+typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points);
+#endif
+
+#ifndef GL_SGIX_fog_offset
+#define GL_SGIX_fog_offset 1
+#endif
+
+#ifndef GL_HP_image_transform
+#define GL_HP_image_transform 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glImageTransformParameteriHP (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glImageTransformParameterfHP (GLenum, GLenum, GLfloat);
+GLAPI void APIENTRY glImageTransformParameterivHP (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum, GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_HP_convolution_border_modes
+#define GL_HP_convolution_border_modes 1
+#endif
+
+#ifndef GL_SGIX_texture_add_env
+#define GL_SGIX_texture_add_env 1
+#endif
+
+#ifndef GL_EXT_color_subtable
+#define GL_EXT_color_subtable 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorSubTableEXT (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum, GLsizei, GLint, GLint, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
+#endif
+
+#ifndef GL_PGI_vertex_hints
+#define GL_PGI_vertex_hints 1
+#endif
+
+#ifndef GL_PGI_misc_hints
+#define GL_PGI_misc_hints 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glHintPGI (GLenum, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode);
+#endif
+
+#ifndef GL_EXT_paletted_texture
+#define GL_EXT_paletted_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorTableEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glGetColorTableEXT (GLenum, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum, GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_EXT_clip_volume_hint
+#define GL_EXT_clip_volume_hint 1
+#endif
+
+#ifndef GL_SGIX_list_priority
+#define GL_SGIX_list_priority 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetListParameterivSGIX (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glListParameterfSGIX (GLuint, GLenum, GLfloat);
+GLAPI void APIENTRY glListParameterfvSGIX (GLuint, GLenum, const GLfloat *);
+GLAPI void APIENTRY glListParameteriSGIX (GLuint, GLenum, GLint);
+GLAPI void APIENTRY glListParameterivSGIX (GLuint, GLenum, const GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params);
+#endif
+
+#ifndef GL_SGIX_ir_instrument1
+#define GL_SGIX_ir_instrument1 1
+#endif
+
+#ifndef GL_SGIX_calligraphic_fragment
+#define GL_SGIX_calligraphic_fragment 1
+#endif
+
+#ifndef GL_SGIX_texture_lod_bias
+#define GL_SGIX_texture_lod_bias 1
+#endif
+
+#ifndef GL_SGIX_shadow_ambient
+#define GL_SGIX_shadow_ambient 1
+#endif
+
+#ifndef GL_EXT_index_texture
+#define GL_EXT_index_texture 1
+#endif
+
+#ifndef GL_EXT_index_material
+#define GL_EXT_index_material 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glIndexMaterialEXT (GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode);
+#endif
+
+#ifndef GL_EXT_index_func
+#define GL_EXT_index_func 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glIndexFuncEXT (GLenum, GLclampf);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref);
+#endif
+
+#ifndef GL_EXT_index_array_formats
+#define GL_EXT_index_array_formats 1
+#endif
+
+#ifndef GL_EXT_compiled_vertex_array
+#define GL_EXT_compiled_vertex_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glLockArraysEXT (GLint, GLsizei);
+GLAPI void APIENTRY glUnlockArraysEXT (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count);
+typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void);
+#endif
+
+#ifndef GL_EXT_cull_vertex
+#define GL_EXT_cull_vertex 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCullParameterdvEXT (GLenum, GLdouble *);
+GLAPI void APIENTRY glCullParameterfvEXT (GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_SGIX_ycrcb
+#define GL_SGIX_ycrcb 1
+#endif
+
+#ifndef GL_SGIX_fragment_lighting
+#define GL_SGIX_fragment_lighting 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum, GLenum);
+GLAPI void APIENTRY glFragmentLightfSGIX (GLenum, GLenum, GLfloat);
+GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glFragmentLightiSGIX (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glFragmentLightivSGIX (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum, GLfloat);
+GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum, const GLfloat *);
+GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum, GLint);
+GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum, const GLint *);
+GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum, GLenum, GLfloat);
+GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glLightEnviSGIX (GLenum, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param);
+#endif
+
+#ifndef GL_IBM_rasterpos_clip
+#define GL_IBM_rasterpos_clip 1
+#endif
+
+#ifndef GL_HP_texture_lighting
+#define GL_HP_texture_lighting 1
+#endif
+
+#ifndef GL_EXT_draw_range_elements
+#define GL_EXT_draw_range_elements 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
+#endif
+
+#ifndef GL_WIN_phong_shading
+#define GL_WIN_phong_shading 1
+#endif
+
+#ifndef GL_WIN_specular_fog
+#define GL_WIN_specular_fog 1
+#endif
+
+#ifndef GL_EXT_light_texture
+#define GL_EXT_light_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glApplyTextureEXT (GLenum);
+GLAPI void APIENTRY glTextureLightEXT (GLenum);
+GLAPI void APIENTRY glTextureMaterialEXT (GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode);
+typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname);
+typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode);
+#endif
+
+#ifndef GL_SGIX_blend_alpha_minmax
+#define GL_SGIX_blend_alpha_minmax 1
+#endif
+
+#ifndef GL_EXT_bgra
+#define GL_EXT_bgra 1
+#endif
+
+#ifndef GL_SGIX_async
+#define GL_SGIX_async 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint);
+GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *);
+GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *);
+GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei);
+GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint, GLsizei);
+GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker);
+typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp);
+typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp);
+typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range);
+typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range);
+typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker);
+#endif
+
+#ifndef GL_SGIX_async_pixel
+#define GL_SGIX_async_pixel 1
+#endif
+
+#ifndef GL_SGIX_async_histogram
+#define GL_SGIX_async_histogram 1
+#endif
+
+#ifndef GL_INTEL_parallel_arrays
+#define GL_INTEL_parallel_arrays 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexPointervINTEL (GLint, GLenum, const GLvoid* *);
+GLAPI void APIENTRY glNormalPointervINTEL (GLenum, const GLvoid* *);
+GLAPI void APIENTRY glColorPointervINTEL (GLint, GLenum, const GLvoid* *);
+GLAPI void APIENTRY glTexCoordPointervINTEL (GLint, GLenum, const GLvoid* *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
+typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer);
+typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
+typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
+#endif
+
+#ifndef GL_HP_occlusion_test
+#define GL_HP_occlusion_test 1
+#endif
+
+#ifndef GL_EXT_pixel_transform
+#define GL_EXT_pixel_transform 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum, GLenum, GLfloat);
+GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum, GLenum, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params);
+#endif
+
+#ifndef GL_EXT_pixel_transform_color_table
+#define GL_EXT_pixel_transform_color_table 1
+#endif
+
+#ifndef GL_EXT_shared_texture_palette
+#define GL_EXT_shared_texture_palette 1
+#endif
+
+#ifndef GL_EXT_separate_specular_color
+#define GL_EXT_separate_specular_color 1
+#endif
+
+#ifndef GL_EXT_secondary_color
+#define GL_EXT_secondary_color 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte, GLbyte, GLbyte);
+GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *);
+GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *);
+GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *);
+GLAPI void APIENTRY glSecondaryColor3iEXT (GLint, GLint, GLint);
+GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *);
+GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *);
+GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte, GLubyte, GLubyte);
+GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *);
+GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *);
+GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort, GLushort, GLushort);
+GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *);
+GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint, GLenum, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_EXT_texture_perturb_normal
+#define GL_EXT_texture_perturb_normal 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTextureNormalEXT (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode);
+#endif
+
+#ifndef GL_EXT_multi_draw_arrays
+#define GL_EXT_multi_draw_arrays 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei);
+GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
+#endif
+
+#ifndef GL_EXT_fog_coord
+#define GL_EXT_fog_coord 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFogCoordfEXT (GLfloat);
+GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *);
+GLAPI void APIENTRY glFogCoorddEXT (GLdouble);
+GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *);
+GLAPI void APIENTRY glFogCoordPointerEXT (GLenum, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord);
+typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord);
+typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord);
+typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord);
+typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_REND_screen_coordinates
+#define GL_REND_screen_coordinates 1
+#endif
+
+#ifndef GL_EXT_coordinate_frame
+#define GL_EXT_coordinate_frame 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTangent3bEXT (GLbyte, GLbyte, GLbyte);
+GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *);
+GLAPI void APIENTRY glTangent3dEXT (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *);
+GLAPI void APIENTRY glTangent3fEXT (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *);
+GLAPI void APIENTRY glTangent3iEXT (GLint, GLint, GLint);
+GLAPI void APIENTRY glTangent3ivEXT (const GLint *);
+GLAPI void APIENTRY glTangent3sEXT (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glTangent3svEXT (const GLshort *);
+GLAPI void APIENTRY glBinormal3bEXT (GLbyte, GLbyte, GLbyte);
+GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *);
+GLAPI void APIENTRY glBinormal3dEXT (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *);
+GLAPI void APIENTRY glBinormal3fEXT (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *);
+GLAPI void APIENTRY glBinormal3iEXT (GLint, GLint, GLint);
+GLAPI void APIENTRY glBinormal3ivEXT (const GLint *);
+GLAPI void APIENTRY glBinormal3sEXT (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glBinormal3svEXT (const GLshort *);
+GLAPI void APIENTRY glTangentPointerEXT (GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glBinormalPointerEXT (GLenum, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz);
+typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v);
+typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz);
+typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz);
+typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz);
+typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz);
+typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz);
+typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v);
+typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz);
+typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz);
+typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz);
+typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz);
+typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_EXT_texture_env_combine
+#define GL_EXT_texture_env_combine 1
+#endif
+
+#ifndef GL_APPLE_specular_vector
+#define GL_APPLE_specular_vector 1
+#endif
+
+#ifndef GL_APPLE_transform_hint
+#define GL_APPLE_transform_hint 1
+#endif
+
+#ifndef GL_SGIX_fog_scale
+#define GL_SGIX_fog_scale 1
+#endif
+
+#ifndef GL_SUNX_constant_data
+#define GL_SUNX_constant_data 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFinishTextureSUNX (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void);
+#endif
+
+#ifndef GL_SUN_global_alpha
+#define GL_SUN_global_alpha 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte);
+GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort);
+GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint);
+GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat);
+GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble);
+GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte);
+GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort);
+GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor);
+#endif
+
+#ifndef GL_SUN_triangle_list
+#define GL_SUN_triangle_list 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint);
+GLAPI void APIENTRY glReplacementCodeusSUN (GLushort);
+GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte);
+GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *);
+GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *);
+GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *);
+GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum, GLsizei, const GLvoid* *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer);
+#endif
+
+#ifndef GL_SUN_vertex
+#define GL_SUN_vertex 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat);
+GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *, const GLfloat *);
+GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *, const GLfloat *);
+GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat, GLfloat, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *, const GLubyte *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *, const GLubyte *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+#endif
+
+#ifndef GL_EXT_blend_func_separate
+#define GL_EXT_blend_func_separate 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum, GLenum, GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+#endif
+
+#ifndef GL_INGR_blend_func_separate
+#define GL_INGR_blend_func_separate 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum, GLenum, GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+#endif
+
+#ifndef GL_INGR_color_clamp
+#define GL_INGR_color_clamp 1
+#endif
+
+#ifndef GL_INGR_interlace_read
+#define GL_INGR_interlace_read 1
+#endif
+
+#ifndef GL_EXT_stencil_wrap
+#define GL_EXT_stencil_wrap 1
+#endif
+
+#ifndef GL_EXT_422_pixels
+#define GL_EXT_422_pixels 1
+#endif
+
+#ifndef GL_NV_texgen_reflection
+#define GL_NV_texgen_reflection 1
+#endif
+
+#ifndef GL_SUN_convolution_border_modes
+#define GL_SUN_convolution_border_modes 1
+#endif
+
+#ifndef GL_EXT_texture_env_add
+#define GL_EXT_texture_env_add 1
+#endif
+
+#ifndef GL_EXT_texture_lod_bias
+#define GL_EXT_texture_lod_bias 1
+#endif
+
+#ifndef GL_EXT_texture_filter_anisotropic
+#define GL_EXT_texture_filter_anisotropic 1
+#endif
+
+#ifndef GL_EXT_vertex_weighting
+#define GL_EXT_vertex_weighting 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexWeightfEXT (GLfloat);
+GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *);
+GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei, GLenum, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight);
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight);
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_NV_light_max_exponent
+#define GL_NV_light_max_exponent 1
+#endif
+
+#ifndef GL_NV_vertex_array_range
+#define GL_NV_vertex_array_range 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFlushVertexArrayRangeNV (void);
+GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void);
+typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid *pointer);
+#endif
+
+#ifndef GL_NV_register_combiners
+#define GL_NV_register_combiners 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCombinerParameterfvNV (GLenum, const GLfloat *);
+GLAPI void APIENTRY glCombinerParameterfNV (GLenum, GLfloat);
+GLAPI void APIENTRY glCombinerParameterivNV (GLenum, const GLint *);
+GLAPI void APIENTRY glCombinerParameteriNV (GLenum, GLint);
+GLAPI void APIENTRY glCombinerInputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glCombinerOutputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean);
+GLAPI void APIENTRY glFinalCombinerInputNV (GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum, GLenum, GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum, GLenum, GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum, GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum, GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum, GLenum, GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
+typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum);
+typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
+typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_NV_fog_distance
+#define GL_NV_fog_distance 1
+#endif
+
+#ifndef GL_NV_texgen_emboss
+#define GL_NV_texgen_emboss 1
+#endif
+
+#ifndef GL_NV_blend_square
+#define GL_NV_blend_square 1
+#endif
+
+#ifndef GL_NV_texture_env_combine4
+#define GL_NV_texture_env_combine4 1
+#endif
+
+#ifndef GL_MESA_resize_buffers
+#define GL_MESA_resize_buffers 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glResizeBuffersMESA (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void);
+#endif
+
+#ifndef GL_MESA_window_pos
+#define GL_MESA_window_pos 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glWindowPos2dMESA (GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *);
+GLAPI void APIENTRY glWindowPos2fMESA (GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *);
+GLAPI void APIENTRY glWindowPos2iMESA (GLint, GLint);
+GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *);
+GLAPI void APIENTRY glWindowPos2sMESA (GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *);
+GLAPI void APIENTRY glWindowPos3dMESA (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *);
+GLAPI void APIENTRY glWindowPos3fMESA (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *);
+GLAPI void APIENTRY glWindowPos3iMESA (GLint, GLint, GLint);
+GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *);
+GLAPI void APIENTRY glWindowPos3sMESA (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *);
+GLAPI void APIENTRY glWindowPos4dMESA (GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *);
+GLAPI void APIENTRY glWindowPos4fMESA (GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *);
+GLAPI void APIENTRY glWindowPos4iMESA (GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *);
+GLAPI void APIENTRY glWindowPos4sMESA (GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v);
+#endif
+
+#ifndef GL_IBM_cull_vertex
+#define GL_IBM_cull_vertex 1
+#endif
+
+#ifndef GL_IBM_multimode_draw_arrays
+#define GL_IBM_multimode_draw_arrays 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *, const GLint *, const GLsizei *, GLsizei, GLint);
+GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *, const GLsizei *, GLenum, const GLvoid* const *, GLsizei, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride);
+typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride);
+#endif
+
+#ifndef GL_IBM_vertex_array_lists
+#define GL_IBM_vertex_array_lists 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
+GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
+GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint, const GLboolean* *, GLint);
+GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum, GLint, const GLvoid* *, GLint);
+GLAPI void APIENTRY glIndexPointerListIBM (GLenum, GLint, const GLvoid* *, GLint);
+GLAPI void APIENTRY glNormalPointerListIBM (GLenum, GLint, const GLvoid* *, GLint);
+GLAPI void APIENTRY glTexCoordPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
+GLAPI void APIENTRY glVertexPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+#endif
+
+#ifndef GL_SGIX_subsample
+#define GL_SGIX_subsample 1
+#endif
+
+#ifndef GL_SGIX_ycrcba
+#define GL_SGIX_ycrcba 1
+#endif
+
+#ifndef GL_SGIX_ycrcb_subsample
+#define GL_SGIX_ycrcb_subsample 1
+#endif
+
+#ifndef GL_SGIX_depth_pass_instrument
+#define GL_SGIX_depth_pass_instrument 1
+#endif
+
+#ifndef GL_3DFX_texture_compression_FXT1
+#define GL_3DFX_texture_compression_FXT1 1
+#endif
+
+#ifndef GL_3DFX_multisample
+#define GL_3DFX_multisample 1
+#endif
+
+#ifndef GL_3DFX_tbuffer
+#define GL_3DFX_tbuffer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTbufferMask3DFX (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask);
+#endif
+
+#ifndef GL_EXT_multisample
+#define GL_EXT_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSampleMaskEXT (GLclampf, GLboolean);
+GLAPI void APIENTRY glSamplePatternEXT (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert);
+typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern);
+#endif
+
+#ifndef GL_SGIX_vertex_preclip
+#define GL_SGIX_vertex_preclip 1
+#endif
+
+#ifndef GL_SGIX_convolution_accuracy
+#define GL_SGIX_convolution_accuracy 1
+#endif
+
+#ifndef GL_SGIX_resample
+#define GL_SGIX_resample 1
+#endif
+
+#ifndef GL_SGIS_point_line_texgen
+#define GL_SGIS_point_line_texgen 1
+#endif
+
+#ifndef GL_SGIS_texture_color_mask
+#define GL_SGIS_texture_color_mask 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean, GLboolean, GLboolean, GLboolean);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+#endif
+
+#ifndef GL_SGIX_igloo_interface
+#define GL_SGIX_igloo_interface 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params);
+#endif
+
+#ifndef GL_EXT_texture_env_dot3
+#define GL_EXT_texture_env_dot3 1
+#endif
+
+#ifndef GL_ATI_texture_mirror_once
+#define GL_ATI_texture_mirror_once 1
+#endif
+
+#ifndef GL_NV_fence
+#define GL_NV_fence 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDeleteFencesNV (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenFencesNV (GLsizei, GLuint *);
+GLAPI GLboolean APIENTRY glIsFenceNV (GLuint);
+GLAPI GLboolean APIENTRY glTestFenceNV (GLuint);
+GLAPI void APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glFinishFenceNV (GLuint);
+GLAPI void APIENTRY glSetFenceNV (GLuint, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences);
+typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences);
+typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence);
+typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence);
+typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence);
+typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
+#endif
+
+#ifndef GL_NV_evaluators
+#define GL_NV_evaluators 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLint, GLint, GLboolean, const GLvoid *);
+GLAPI void APIENTRY glMapParameterivNV (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glMapParameterfvNV (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glGetMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLboolean, GLvoid *);
+GLAPI void APIENTRY glGetMapParameterivNV (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetMapParameterfvNV (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum, GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum, GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glEvalMapsNV (GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points);
+typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points);
+typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode);
+#endif
+
+#ifndef GL_NV_packed_depth_stencil
+#define GL_NV_packed_depth_stencil 1
+#endif
+
+#ifndef GL_NV_register_combiners2
+#define GL_NV_register_combiners2 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum, GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_NV_texture_compression_vtc
+#define GL_NV_texture_compression_vtc 1
+#endif
+
+#ifndef GL_NV_texture_rectangle
+#define GL_NV_texture_rectangle 1
+#endif
+
+#ifndef GL_NV_texture_shader
+#define GL_NV_texture_shader 1
+#endif
+
+#ifndef GL_NV_texture_shader2
+#define GL_NV_texture_shader2 1
+#endif
+
+#ifndef GL_NV_vertex_array_range2
+#define GL_NV_vertex_array_range2 1
+#endif
+
+#ifndef GL_NV_vertex_program
+#define GL_NV_vertex_program 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei, const GLuint *, GLboolean *);
+GLAPI void APIENTRY glBindProgramNV (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteProgramsNV (GLsizei, const GLuint *);
+GLAPI void APIENTRY glExecuteProgramNV (GLenum, GLuint, const GLfloat *);
+GLAPI void APIENTRY glGenProgramsNV (GLsizei, GLuint *);
+GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum, GLuint, GLenum, GLdouble *);
+GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum, GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetProgramivNV (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetProgramStringNV (GLuint, GLenum, GLubyte *);
+GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum, GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint, GLenum, GLdouble *);
+GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetVertexAttribivNV (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint, GLenum, GLvoid* *);
+GLAPI GLboolean APIENTRY glIsProgramNV (GLuint);
+GLAPI void APIENTRY glLoadProgramNV (GLenum, GLuint, GLsizei, const GLubyte *);
+GLAPI void APIENTRY glProgramParameter4dNV (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glProgramParameter4dvNV (GLenum, GLuint, const GLdouble *);
+GLAPI void APIENTRY glProgramParameter4fNV (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glProgramParameter4fvNV (GLenum, GLuint, const GLfloat *);
+GLAPI void APIENTRY glProgramParameters4dvNV (GLenum, GLuint, GLuint, const GLdouble *);
+GLAPI void APIENTRY glProgramParameters4fvNV (GLenum, GLuint, GLuint, const GLfloat *);
+GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei, const GLuint *);
+GLAPI void APIENTRY glTrackMatrixNV (GLenum, GLuint, GLenum, GLenum);
+GLAPI void APIENTRY glVertexAttribPointerNV (GLuint, GLint, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glVertexAttrib1dNV (GLuint, GLdouble);
+GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib1fNV (GLuint, GLfloat);
+GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib1sNV (GLuint, GLshort);
+GLAPI void APIENTRY glVertexAttrib1svNV (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib2dNV (GLuint, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib2fNV (GLuint, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib2sNV (GLuint, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib2svNV (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib3dNV (GLuint, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib3fNV (GLuint, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib3sNV (GLuint, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib3svNV (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4dNV (GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib4fNV (GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib4sNV (GLuint, GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib4svNV (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
+GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint, GLsizei, const GLdouble *);
+GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glVertexAttribs1svNV (GLuint, GLsizei, const GLshort *);
+GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint, GLsizei, const GLdouble *);
+GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glVertexAttribs2svNV (GLuint, GLsizei, const GLshort *);
+GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint, GLsizei, const GLdouble *);
+GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glVertexAttribs3svNV (GLuint, GLsizei, const GLshort *);
+GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint, GLsizei, const GLdouble *);
+GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glVertexAttribs4svNV (GLuint, GLsizei, const GLshort *);
+GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint, GLsizei, const GLubyte *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences);
+typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id);
+typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
+typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs);
+typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program);
+typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
+typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
+typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v);
+#endif
+
+#ifndef GL_SGIX_texture_coordinate_clamp
+#define GL_SGIX_texture_coordinate_clamp 1
+#endif
+
+#ifndef GL_SGIX_scalebias_hint
+#define GL_SGIX_scalebias_hint 1
+#endif
+
+#ifndef GL_OML_interlace
+#define GL_OML_interlace 1
+#endif
+
+#ifndef GL_OML_subsample
+#define GL_OML_subsample 1
+#endif
+
+#ifndef GL_OML_resample
+#define GL_OML_resample 1
+#endif
+
+#ifndef GL_NV_copy_depth_to_color
+#define GL_NV_copy_depth_to_color 1
+#endif
+
+#ifndef GL_ATI_envmap_bumpmap
+#define GL_ATI_envmap_bumpmap 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexBumpParameterivATI (GLenum, const GLint *);
+GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum, const GLfloat *);
+GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum, GLint *);
+GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param);
+typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param);
+typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param);
+typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param);
+#endif
+
+#ifndef GL_ATI_fragment_shader
+#define GL_ATI_fragment_shader 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint);
+GLAPI void APIENTRY glBindFragmentShaderATI (GLuint);
+GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint);
+GLAPI void APIENTRY glBeginFragmentShaderATI (void);
+GLAPI void APIENTRY glEndFragmentShaderATI (void);
+GLAPI void APIENTRY glPassTexCoordATI (GLuint, GLuint, GLenum);
+GLAPI void APIENTRY glSampleMapATI (GLuint, GLuint, GLenum);
+GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range);
+typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void);
+typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void);
+typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle);
+typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle);
+typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
+typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
+typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
+typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
+typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
+typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
+typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value);
+#endif
+
+#ifndef GL_ATI_pn_triangles
+#define GL_ATI_pn_triangles 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPNTrianglesiATI (GLenum, GLint);
+GLAPI void APIENTRY glPNTrianglesfATI (GLenum, GLfloat);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param);
+#endif
+
+#ifndef GL_ATI_vertex_array_object
+#define GL_ATI_vertex_array_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei, const GLvoid *, GLenum);
+GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint);
+GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint, GLuint, GLsizei, const GLvoid *, GLenum);
+GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetObjectBufferivATI (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glFreeObjectBufferATI (GLuint);
+GLAPI void APIENTRY glArrayObjectATI (GLenum, GLint, GLenum, GLsizei, GLuint, GLuint);
+GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetArrayObjectivATI (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glVariantArrayObjectATI (GLuint, GLenum, GLsizei, GLuint, GLuint);
+GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint, GLenum, GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage);
+typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve);
+typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
+typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
+typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_EXT_vertex_shader
+#define GL_EXT_vertex_shader 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBeginVertexShaderEXT (void);
+GLAPI void APIENTRY glEndVertexShaderEXT (void);
+GLAPI void APIENTRY glBindVertexShaderEXT (GLuint);
+GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint);
+GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint);
+GLAPI void APIENTRY glShaderOp1EXT (GLenum, GLuint, GLuint);
+GLAPI void APIENTRY glShaderOp2EXT (GLenum, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glShaderOp3EXT (GLenum, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glSwizzleEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glWriteMaskEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glInsertComponentEXT (GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glExtractComponentEXT (GLuint, GLuint, GLuint);
+GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum, GLenum, GLenum, GLuint);
+GLAPI void APIENTRY glSetInvariantEXT (GLuint, GLenum, const GLvoid *);
+GLAPI void APIENTRY glSetLocalConstantEXT (GLuint, GLenum, const GLvoid *);
+GLAPI void APIENTRY glVariantbvEXT (GLuint, const GLbyte *);
+GLAPI void APIENTRY glVariantsvEXT (GLuint, const GLshort *);
+GLAPI void APIENTRY glVariantivEXT (GLuint, const GLint *);
+GLAPI void APIENTRY glVariantfvEXT (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVariantdvEXT (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVariantubvEXT (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVariantusvEXT (GLuint, const GLushort *);
+GLAPI void APIENTRY glVariantuivEXT (GLuint, const GLuint *);
+GLAPI void APIENTRY glVariantPointerEXT (GLuint, GLenum, GLuint, const GLvoid *);
+GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint);
+GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint);
+GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum, GLenum);
+GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum, GLenum);
+GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum, GLenum, GLenum);
+GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum, GLenum);
+GLAPI GLuint APIENTRY glBindParameterEXT (GLenum);
+GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint, GLenum);
+GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint, GLenum, GLboolean *);
+GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetVariantPointervEXT (GLuint, GLenum, GLvoid* *);
+GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint, GLenum, GLboolean *);
+GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint, GLenum, GLboolean *);
+GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint, GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void);
+typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void);
+typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id);
+typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range);
+typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1);
+typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2);
+typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3);
+typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
+typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
+typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);
+typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);
+typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components);
+typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr);
+typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr);
+typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr);
+typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr);
+typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr);
+typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr);
+typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr);
+typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr);
+typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr);
+typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr);
+typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const GLvoid *addr);
+typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);
+typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value);
+typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value);
+typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value);
+typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value);
+typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value);
+typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap);
+typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
+typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
+typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
+typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid* *data);
+typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
+typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
+typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
+typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
+typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
+typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
+#endif
+
+#ifndef GL_ATI_vertex_streams
+#define GL_ATI_vertex_streams 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexStream1sATI (GLenum, GLshort);
+GLAPI void APIENTRY glVertexStream1svATI (GLenum, const GLshort *);
+GLAPI void APIENTRY glVertexStream1iATI (GLenum, GLint);
+GLAPI void APIENTRY glVertexStream1ivATI (GLenum, const GLint *);
+GLAPI void APIENTRY glVertexStream1fATI (GLenum, GLfloat);
+GLAPI void APIENTRY glVertexStream1fvATI (GLenum, const GLfloat *);
+GLAPI void APIENTRY glVertexStream1dATI (GLenum, GLdouble);
+GLAPI void APIENTRY glVertexStream1dvATI (GLenum, const GLdouble *);
+GLAPI void APIENTRY glVertexStream2sATI (GLenum, GLshort, GLshort);
+GLAPI void APIENTRY glVertexStream2svATI (GLenum, const GLshort *);
+GLAPI void APIENTRY glVertexStream2iATI (GLenum, GLint, GLint);
+GLAPI void APIENTRY glVertexStream2ivATI (GLenum, const GLint *);
+GLAPI void APIENTRY glVertexStream2fATI (GLenum, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexStream2fvATI (GLenum, const GLfloat *);
+GLAPI void APIENTRY glVertexStream2dATI (GLenum, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexStream2dvATI (GLenum, const GLdouble *);
+GLAPI void APIENTRY glVertexStream3sATI (GLenum, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexStream3svATI (GLenum, const GLshort *);
+GLAPI void APIENTRY glVertexStream3iATI (GLenum, GLint, GLint, GLint);
+GLAPI void APIENTRY glVertexStream3ivATI (GLenum, const GLint *);
+GLAPI void APIENTRY glVertexStream3fATI (GLenum, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexStream3fvATI (GLenum, const GLfloat *);
+GLAPI void APIENTRY glVertexStream3dATI (GLenum, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexStream3dvATI (GLenum, const GLdouble *);
+GLAPI void APIENTRY glVertexStream4sATI (GLenum, GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexStream4svATI (GLenum, const GLshort *);
+GLAPI void APIENTRY glVertexStream4iATI (GLenum, GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glVertexStream4ivATI (GLenum, const GLint *);
+GLAPI void APIENTRY glVertexStream4fATI (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexStream4fvATI (GLenum, const GLfloat *);
+GLAPI void APIENTRY glVertexStream4dATI (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexStream4dvATI (GLenum, const GLdouble *);
+GLAPI void APIENTRY glNormalStream3bATI (GLenum, GLbyte, GLbyte, GLbyte);
+GLAPI void APIENTRY glNormalStream3bvATI (GLenum, const GLbyte *);
+GLAPI void APIENTRY glNormalStream3sATI (GLenum, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glNormalStream3svATI (GLenum, const GLshort *);
+GLAPI void APIENTRY glNormalStream3iATI (GLenum, GLint, GLint, GLint);
+GLAPI void APIENTRY glNormalStream3ivATI (GLenum, const GLint *);
+GLAPI void APIENTRY glNormalStream3fATI (GLenum, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glNormalStream3fvATI (GLenum, const GLfloat *);
+GLAPI void APIENTRY glNormalStream3dATI (GLenum, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glNormalStream3dvATI (GLenum, const GLdouble *);
+GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum);
+GLAPI void APIENTRY glVertexBlendEnviATI (GLenum, GLint);
+GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum, GLfloat);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream);
+typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param);
+#endif
+
+#ifndef GL_ATI_element_array
+#define GL_ATI_element_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glElementPointerATI (GLenum, const GLvoid *);
+GLAPI void APIENTRY glDrawElementArrayATI (GLenum, GLsizei);
+GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum, GLuint, GLuint, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count);
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count);
+#endif
+
+#ifndef GL_SUN_mesh_array
+#define GL_SUN_mesh_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum, GLint, GLsizei, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width);
+#endif
+
+#ifndef GL_SUN_slice_accum
+#define GL_SUN_slice_accum 1
+#endif
+
+#ifndef GL_NV_multisample_filter_hint
+#define GL_NV_multisample_filter_hint 1
+#endif
+
+#ifndef GL_NV_depth_clamp
+#define GL_NV_depth_clamp 1
+#endif
+
+#ifndef GL_NV_occlusion_query
+#define GL_NV_occlusion_query 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei, GLuint *);
+GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei, const GLuint *);
+GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint);
+GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint);
+GLAPI void APIENTRY glEndOcclusionQueryNV (void);
+GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint, GLenum, GLuint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids);
+typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids);
+typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void);
+typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params);
+#endif
+
+#ifndef GL_NV_point_sprite
+#define GL_NV_point_sprite 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPointParameteriNV (GLenum, GLint);
+GLAPI void APIENTRY glPointParameterivNV (GLenum, const GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params);
+#endif
+
+#ifndef GL_NV_texture_shader3
+#define GL_NV_texture_shader3 1
+#endif
+
+#ifndef GL_NV_vertex_program1_1
+#define GL_NV_vertex_program1_1 1
+#endif
+
+#ifndef GL_EXT_shadow_funcs
+#define GL_EXT_shadow_funcs 1
+#endif
+
+#ifndef GL_EXT_stencil_two_side
+#define GL_EXT_stencil_two_side 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face);
+#endif
+
+#ifndef GL_ATI_text_fragment_shader
+#define GL_ATI_text_fragment_shader 1
+#endif
+
+#ifndef GL_APPLE_client_storage
+#define GL_APPLE_client_storage 1
+#endif
+
+#ifndef GL_APPLE_element_array
+#define GL_APPLE_element_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glElementPointerAPPLE (GLenum, const GLvoid *);
+GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum, GLint, GLsizei);
+GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, GLint, GLsizei);
+GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum, const GLint *, const GLsizei *, GLsizei);
+GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, const GLint *, const GLsizei *, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count);
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
+typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount);
+#endif
+
+#ifndef GL_APPLE_fence
+#define GL_APPLE_fence 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenFencesAPPLE (GLsizei, GLuint *);
+GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei, const GLuint *);
+GLAPI void APIENTRY glSetFenceAPPLE (GLuint);
+GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint);
+GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint);
+GLAPI void APIENTRY glFinishFenceAPPLE (GLuint);
+GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum, GLuint);
+GLAPI void APIENTRY glFinishObjectAPPLE (GLenum, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences);
+typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences);
+typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence);
+typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence);
+typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence);
+typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence);
+typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name);
+typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name);
+#endif
+
+#ifndef GL_APPLE_vertex_array_object
+#define GL_APPLE_vertex_array_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint);
+GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei, GLuint *);
+GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array);
+typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays);
+typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint *arrays);
+typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array);
+#endif
+
+#ifndef GL_APPLE_vertex_array_range
+#define GL_APPLE_vertex_array_range 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei, GLvoid *);
+GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei, GLvoid *);
+GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer);
+typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer);
+typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param);
+#endif
+
+#ifndef GL_APPLE_ycbcr_422
+#define GL_APPLE_ycbcr_422 1
+#endif
+
+#ifndef GL_S3_s3tc
+#define GL_S3_s3tc 1
+#endif
+
+#ifndef GL_ATI_draw_buffers
+#define GL_ATI_draw_buffers 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawBuffersATI (GLsizei, const GLenum *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs);
+#endif
+
+#ifndef GL_ATI_pixel_format_float
+#define GL_ATI_pixel_format_float 1
+/* This is really a WGL extension, but defines some associated GL enums.
+ * ATI does not export "GL_ATI_pixel_format_float" in the GL_EXTENSIONS string.
+ */
+#endif
+
+#ifndef GL_ATI_texture_env_combine3
+#define GL_ATI_texture_env_combine3 1
+#endif
+
+#ifndef GL_ATI_texture_float
+#define GL_ATI_texture_float 1
+#endif
+
+#ifndef GL_NV_float_buffer
+#define GL_NV_float_buffer 1
+#endif
+
+#ifndef GL_NV_fragment_program
+#define GL_NV_fragment_program 1
+/* Some NV_fragment_program entry points are shared with ARB_vertex_program. */
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint, GLsizei, const GLubyte *, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint, GLsizei, const GLubyte *, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint, GLsizei, const GLubyte *, const GLfloat *);
+GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint, GLsizei, const GLubyte *, const GLdouble *);
+GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint, GLsizei, const GLubyte *, GLfloat *);
+GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint, GLsizei, const GLubyte *, GLdouble *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v);
+typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v);
+typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params);
+#endif
+
+#ifndef GL_NV_half_float
+#define GL_NV_half_float 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertex2hNV (GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glVertex3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glVertex4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glNormal3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glColor4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV);
+GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum, GLhalfNV);
+GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum, const GLhalfNV *);
+GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum, const GLhalfNV *);
+GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum, const GLhalfNV *);
+GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum, const GLhalfNV *);
+GLAPI void APIENTRY glFogCoordhNV (GLhalfNV);
+GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *);
+GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV);
+GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttrib1hNV (GLuint, GLhalfNV);
+GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttrib2hNV (GLuint, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttrib3hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttrib4hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint, GLsizei, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint, GLsizei, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint, GLsizei, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint, GLsizei, const GLhalfNV *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y);
+typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z);
+typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
+typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz);
+typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
+typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha);
+typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s);
+typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t);
+typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r);
+typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
+typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog);
+typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight);
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
+#endif
+
+#ifndef GL_NV_pixel_data_range
+#define GL_NV_pixel_data_range 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPixelDataRangeNV (GLenum, GLsizei, GLvoid *);
+GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer);
+typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target);
+#endif
+
+#ifndef GL_NV_primitive_restart
+#define GL_NV_primitive_restart 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPrimitiveRestartNV (void);
+GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void);
+typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index);
+#endif
+
+#ifndef GL_NV_texture_expand_normal
+#define GL_NV_texture_expand_normal 1
+#endif
+
+#ifndef GL_NV_vertex_program2
+#define GL_NV_vertex_program2 1
+#endif
+
+#ifndef GL_ATI_map_object_buffer
+#define GL_ATI_map_object_buffer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLvoid* APIENTRY glMapObjectBufferATI (GLuint);
+GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLvoid* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer);
+#endif
+
+#ifndef GL_ATI_separate_stencil
+#define GL_ATI_separate_stencil 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glStencilOpSeparateATI (GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum, GLenum, GLint, GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
+#endif
+
+#ifndef GL_ATI_vertex_attrib_array_object
+#define GL_ATI_vertex_attrib_array_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint, GLint, GLenum, GLboolean, GLsizei, GLuint, GLuint);
+GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint, GLenum, GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_OES_read_format
+#define GL_OES_read_format 1
+#endif
+
+#ifndef GL_EXT_depth_bounds_test
+#define GL_EXT_depth_bounds_test 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDepthBoundsEXT (GLclampd, GLclampd);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax);
+#endif
+
+#ifndef GL_EXT_texture_mirror_clamp
+#define GL_EXT_texture_mirror_clamp 1
+#endif
+
+#ifndef GL_EXT_blend_equation_separate
+#define GL_EXT_blend_equation_separate 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha);
+#endif
+
+#ifndef GL_MESA_pack_invert
+#define GL_MESA_pack_invert 1
+#endif
+
+#ifndef GL_MESA_ycbcr_texture
+#define GL_MESA_ycbcr_texture 1
+#endif
+
+#ifndef GL_EXT_pixel_buffer_object
+#define GL_EXT_pixel_buffer_object 1
+#endif
+
+#ifndef GL_NV_fragment_program_option
+#define GL_NV_fragment_program_option 1
+#endif
+
+#ifndef GL_NV_fragment_program2
+#define GL_NV_fragment_program2 1
+#endif
+
+#ifndef GL_NV_vertex_program2_option
+#define GL_NV_vertex_program2_option 1
+#endif
+
+#ifndef GL_NV_vertex_program3
+#define GL_NV_vertex_program3 1
+#endif
+
+#ifndef GL_EXT_framebuffer_object
+#define GL_EXT_framebuffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint);
+GLAPI void APIENTRY glBindRenderbufferEXT (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei, GLuint *);
+GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum, GLenum, GLsizei, GLsizei);
+GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum, GLenum, GLint *);
+GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint);
+GLAPI void APIENTRY glBindFramebufferEXT (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei, GLuint *);
+GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum);
+GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum, GLenum, GLenum, GLuint, GLint);
+GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum, GLenum, GLenum, GLuint, GLint);
+GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum, GLenum, GLenum, GLuint, GLint, GLint);
+GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum, GLenum, GLenum, GLuint);
+GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum, GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGenerateMipmapEXT (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers);
+typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers);
+typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer);
+typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer);
+typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers);
+typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers);
+typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target);
+#endif
+
+#ifndef GL_GREMEDY_string_marker
+#define GL_GREMEDY_string_marker 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string);
+#endif
+
+#ifndef GL_EXT_packed_depth_stencil
+#define GL_EXT_packed_depth_stencil 1
+#endif
+
+#ifndef GL_EXT_stencil_clear_tag
+#define GL_EXT_stencil_clear_tag 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glStencilClearTagEXT (GLsizei, GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSTENCILCLEARTAGEXTPROC) (GLsizei stencilTagBits, GLuint stencilClearTag);
+#endif
+
+#ifndef GL_EXT_texture_sRGB
+#define GL_EXT_texture_sRGB 1
+#endif
+
+#ifndef GL_EXT_framebuffer_blit
+#define GL_EXT_framebuffer_blit 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlitFramebufferEXT (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+#endif
+
+#ifndef GL_EXT_framebuffer_multisample
+#define GL_EXT_framebuffer_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glRenderbufferStorageMultisampleEXT (GLenum, GLsizei, GLenum, GLsizei, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+#endif
+
+#ifndef GL_MESAX_texture_stack
+#define GL_MESAX_texture_stack 1
+#endif
+
+#ifndef GL_EXT_timer_query
+#define GL_EXT_timer_query 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetQueryObjecti64vEXT (GLuint, GLenum, GLint64EXT *);
+GLAPI void APIENTRY glGetQueryObjectui64vEXT (GLuint, GLenum, GLuint64EXT *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params);
+#endif
+
+#ifndef GL_EXT_gpu_program_parameters
+#define GL_EXT_gpu_program_parameters 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramEnvParameters4fvEXT (GLenum, GLuint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glProgramLocalParameters4fvEXT (GLenum, GLuint, GLsizei, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
+#endif
+
+#ifndef GL_APPLE_flush_buffer_range
+#define GL_APPLE_flush_buffer_range 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBufferParameteriAPPLE (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glFlushMappedBufferRangeAPPLE (GLenum, GLintptr, GLsizeiptr);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size);
+#endif
+
+#ifndef GL_NV_gpu_program4
+#define GL_NV_gpu_program4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramLocalParameterI4iNV (GLenum, GLuint, GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glProgramLocalParameterI4ivNV (GLenum, GLuint, const GLint *);
+GLAPI void APIENTRY glProgramLocalParametersI4ivNV (GLenum, GLuint, GLsizei, const GLint *);
+GLAPI void APIENTRY glProgramLocalParameterI4uiNV (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glProgramLocalParameterI4uivNV (GLenum, GLuint, const GLuint *);
+GLAPI void APIENTRY glProgramLocalParametersI4uivNV (GLenum, GLuint, GLsizei, const GLuint *);
+GLAPI void APIENTRY glProgramEnvParameterI4iNV (GLenum, GLuint, GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glProgramEnvParameterI4ivNV (GLenum, GLuint, const GLint *);
+GLAPI void APIENTRY glProgramEnvParametersI4ivNV (GLenum, GLuint, GLsizei, const GLint *);
+GLAPI void APIENTRY glProgramEnvParameterI4uiNV (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glProgramEnvParameterI4uivNV (GLenum, GLuint, const GLuint *);
+GLAPI void APIENTRY glProgramEnvParametersI4uivNV (GLenum, GLuint, GLsizei, const GLuint *);
+GLAPI void APIENTRY glGetProgramLocalParameterIivNV (GLenum, GLuint, GLint *);
+GLAPI void APIENTRY glGetProgramLocalParameterIuivNV (GLenum, GLuint, GLuint *);
+GLAPI void APIENTRY glGetProgramEnvParameterIivNV (GLenum, GLuint, GLint *);
+GLAPI void APIENTRY glGetProgramEnvParameterIuivNV (GLenum, GLuint, GLuint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params);
+#endif
+
+#ifndef GL_NV_geometry_program4
+#define GL_NV_geometry_program4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramVertexLimitNV (GLenum, GLint);
+GLAPI void APIENTRY glFramebufferTextureEXT (GLenum, GLenum, GLuint, GLint);
+GLAPI void APIENTRY glFramebufferTextureLayerEXT (GLenum, GLenum, GLuint, GLint, GLint);
+GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum, GLenum, GLuint, GLint, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
+#endif
+
+#ifndef GL_EXT_geometry_shader4
+#define GL_EXT_geometry_shader4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramParameteriEXT (GLuint, GLenum, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value);
+#endif
+
+#ifndef GL_NV_vertex_program4
+#define GL_NV_vertex_program4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttribI1iEXT (GLuint, GLint);
+GLAPI void APIENTRY glVertexAttribI2iEXT (GLuint, GLint, GLint);
+GLAPI void APIENTRY glVertexAttribI3iEXT (GLuint, GLint, GLint, GLint);
+GLAPI void APIENTRY glVertexAttribI4iEXT (GLuint, GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glVertexAttribI1uiEXT (GLuint, GLuint);
+GLAPI void APIENTRY glVertexAttribI2uiEXT (GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glVertexAttribI3uiEXT (GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glVertexAttribI4uiEXT (GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glVertexAttribI1ivEXT (GLuint, const GLint *);
+GLAPI void APIENTRY glVertexAttribI2ivEXT (GLuint, const GLint *);
+GLAPI void APIENTRY glVertexAttribI3ivEXT (GLuint, const GLint *);
+GLAPI void APIENTRY glVertexAttribI4ivEXT (GLuint, const GLint *);
+GLAPI void APIENTRY glVertexAttribI1uivEXT (GLuint, const GLuint *);
+GLAPI void APIENTRY glVertexAttribI2uivEXT (GLuint, const GLuint *);
+GLAPI void APIENTRY glVertexAttribI3uivEXT (GLuint, const GLuint *);
+GLAPI void APIENTRY glVertexAttribI4uivEXT (GLuint, const GLuint *);
+GLAPI void APIENTRY glVertexAttribI4bvEXT (GLuint, const GLbyte *);
+GLAPI void APIENTRY glVertexAttribI4svEXT (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttribI4ubvEXT (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVertexAttribI4usvEXT (GLuint, const GLushort *);
+GLAPI void APIENTRY glVertexAttribIPointerEXT (GLuint, GLint, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glGetVertexAttribIivEXT (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetVertexAttribIuivEXT (GLuint, GLenum, GLuint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params);
+#endif
+
+#ifndef GL_EXT_gpu_shader4
+#define GL_EXT_gpu_shader4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetUniformuivEXT (GLuint, GLint, GLuint *);
+GLAPI void APIENTRY glBindFragDataLocationEXT (GLuint, GLuint, const GLchar *);
+GLAPI GLint APIENTRY glGetFragDataLocationEXT (GLuint, const GLchar *);
+GLAPI void APIENTRY glUniform1uiEXT (GLint, GLuint);
+GLAPI void APIENTRY glUniform2uiEXT (GLint, GLuint, GLuint);
+GLAPI void APIENTRY glUniform3uiEXT (GLint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glUniform4uiEXT (GLint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glUniform1uivEXT (GLint, GLsizei, const GLuint *);
+GLAPI void APIENTRY glUniform2uivEXT (GLint, GLsizei, const GLuint *);
+GLAPI void APIENTRY glUniform3uivEXT (GLint, GLsizei, const GLuint *);
+GLAPI void APIENTRY glUniform4uivEXT (GLint, GLsizei, const GLuint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params);
+typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name);
+typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name);
+typedef void (APIENTRYP PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0);
+typedef void (APIENTRYP PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1);
+typedef void (APIENTRYP PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2);
+typedef void (APIENTRYP PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+typedef void (APIENTRYP PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
+#endif
+
+#ifndef GL_EXT_draw_instanced
+#define GL_EXT_draw_instanced 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawArraysInstancedEXT (GLenum, GLint, GLsizei, GLsizei);
+GLAPI void APIENTRY glDrawElementsInstancedEXT (GLenum, GLsizei, GLenum, const GLvoid *, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount);
+typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
+#endif
+
+#ifndef GL_EXT_packed_float
+#define GL_EXT_packed_float 1
+#endif
+
+#ifndef GL_EXT_texture_array
+#define GL_EXT_texture_array 1
+#endif
+
+#ifndef GL_EXT_texture_buffer_object
+#define GL_EXT_texture_buffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexBufferEXT (GLenum, GLenum, GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer);
+#endif
+
+#ifndef GL_EXT_texture_compression_latc
+#define GL_EXT_texture_compression_latc 1
+#endif
+
+#ifndef GL_EXT_texture_compression_rgtc
+#define GL_EXT_texture_compression_rgtc 1
+#endif
+
+#ifndef GL_EXT_texture_shared_exponent
+#define GL_EXT_texture_shared_exponent 1
+#endif
+
+#ifndef GL_NV_depth_buffer_float
+#define GL_NV_depth_buffer_float 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDepthRangedNV (GLdouble, GLdouble);
+GLAPI void APIENTRY glClearDepthdNV (GLdouble);
+GLAPI void APIENTRY glDepthBoundsdNV (GLdouble, GLdouble);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar);
+typedef void (APIENTRYP PFNGLCLEARDEPTHDNVPROC) (GLdouble depth);
+typedef void (APIENTRYP PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax);
+#endif
+
+#ifndef GL_NV_fragment_program4
+#define GL_NV_fragment_program4 1
+#endif
+
+#ifndef GL_NV_framebuffer_multisample_coverage
+#define GL_NV_framebuffer_multisample_coverage 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glRenderbufferStorageMultisampleCoverageNV (GLenum, GLsizei, GLsizei, GLenum, GLsizei, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
+#endif
+
+#ifndef GL_EXT_framebuffer_sRGB
+#define GL_EXT_framebuffer_sRGB 1
+#endif
+
+#ifndef GL_NV_geometry_shader4
+#define GL_NV_geometry_shader4 1
+#endif
+
+#ifndef GL_NV_parameter_buffer_object
+#define GL_NV_parameter_buffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramBufferParametersfvNV (GLenum, GLuint, GLuint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glProgramBufferParametersIivNV (GLenum, GLuint, GLuint, GLsizei, const GLint *);
+GLAPI void APIENTRY glProgramBufferParametersIuivNV (GLenum, GLuint, GLuint, GLsizei, const GLuint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params);
+typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params);
+typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params);
+#endif
+
+#ifndef GL_EXT_draw_buffers2
+#define GL_EXT_draw_buffers2 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorMaskIndexedEXT (GLuint, GLboolean, GLboolean, GLboolean, GLboolean);
+GLAPI void APIENTRY glGetBooleanIndexedvEXT (GLenum, GLuint, GLboolean *);
+GLAPI void APIENTRY glGetIntegerIndexedvEXT (GLenum, GLuint, GLint *);
+GLAPI void APIENTRY glEnableIndexedEXT (GLenum, GLuint);
+GLAPI void APIENTRY glDisableIndexedEXT (GLenum, GLuint);
+GLAPI GLboolean APIENTRY glIsEnabledIndexedEXT (GLenum, GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
+typedef void (APIENTRYP PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum target, GLuint index, GLboolean *data);
+typedef void (APIENTRYP PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLint *data);
+typedef void (APIENTRYP PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index);
+typedef void (APIENTRYP PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index);
+typedef GLboolean (APIENTRYP PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index);
+#endif
+
+#ifndef GL_NV_transform_feedback
+#define GL_NV_transform_feedback 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBeginTransformFeedbackNV (GLenum);
+GLAPI void APIENTRY glEndTransformFeedbackNV (void);
+GLAPI void APIENTRY glTransformFeedbackAttribsNV (GLuint, const GLint *, GLenum);
+GLAPI void APIENTRY glBindBufferRangeNV (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr);
+GLAPI void APIENTRY glBindBufferOffsetNV (GLenum, GLuint, GLuint, GLintptr);
+GLAPI void APIENTRY glBindBufferBaseNV (GLenum, GLuint, GLuint);
+GLAPI void APIENTRY glTransformFeedbackVaryingsNV (GLuint, GLsizei, const GLint *, GLenum);
+GLAPI void APIENTRY glActiveVaryingNV (GLuint, const GLchar *);
+GLAPI GLint APIENTRY glGetVaryingLocationNV (GLuint, const GLchar *);
+GLAPI void APIENTRY glGetActiveVaryingNV (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *);
+GLAPI void APIENTRY glGetTransformFeedbackVaryingNV (GLuint, GLuint, GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode);
+typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKNVPROC) (void);
+typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode);
+typedef void (APIENTRYP PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
+typedef void (APIENTRYP PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer);
+typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode);
+typedef void (APIENTRYP PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name);
+typedef GLint (APIENTRYP PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name);
+typedef void (APIENTRYP PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
+typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location);
+#endif
+
+#ifndef GL_EXT_bindable_uniform
+#define GL_EXT_bindable_uniform 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glUniformBufferEXT (GLuint, GLint, GLuint);
+GLAPI GLint APIENTRY glGetUniformBufferSizeEXT (GLuint, GLint);
+GLAPI GLintptr APIENTRY glGetUniformOffsetEXT (GLuint, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer);
+typedef GLint (APIENTRYP PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location);
+typedef GLintptr (APIENTRYP PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location);
+#endif
+
+#ifndef GL_EXT_texture_integer
+#define GL_EXT_texture_integer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexParameterIivEXT (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glTexParameterIuivEXT (GLenum, GLenum, const GLuint *);
+GLAPI void APIENTRY glGetTexParameterIivEXT (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetTexParameterIuivEXT (GLenum, GLenum, GLuint *);
+GLAPI void APIENTRY glClearColorIiEXT (GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glClearColorIuiEXT (GLuint, GLuint, GLuint, GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params);
+typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params);
+typedef void (APIENTRYP PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha);
+typedef void (APIENTRYP PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha);
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/sysroot/usr/include/GL/glx.h b/sysroot/usr/include/GL/glx.h
new file mode 100644
index 0000000..c70a294
--- /dev/null
+++ b/sysroot/usr/include/GL/glx.h
@@ -0,0 +1,500 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#ifndef GLX_H
+#define GLX_H
+
+
+#ifdef __VMS
+#include <GL/vms_x_fix.h>
+# ifdef __cplusplus
+/* VMS Xlib.h gives problems with C++.
+ * this avoids a bunch of trivial warnings */
+#pragma message disable nosimpint
+#endif
+#endif
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#ifdef __VMS
+# ifdef __cplusplus
+#pragma message enable nosimpint
+#endif
+#endif
+#include <GL/gl.h>
+
+
+#if defined(USE_MGL_NAMESPACE)
+#include "glx_mangle.h"
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#define GLX_VERSION_1_1 1
+#define GLX_VERSION_1_2 1
+#define GLX_VERSION_1_3 1
+#define GLX_VERSION_1_4 1
+
+#define GLX_EXTENSION_NAME "GLX"
+
+
+
+/*
+ * Tokens for glXChooseVisual and glXGetConfig:
+ */
+#define GLX_USE_GL 1
+#define GLX_BUFFER_SIZE 2
+#define GLX_LEVEL 3
+#define GLX_RGBA 4
+#define GLX_DOUBLEBUFFER 5
+#define GLX_STEREO 6
+#define GLX_AUX_BUFFERS 7
+#define GLX_RED_SIZE 8
+#define GLX_GREEN_SIZE 9
+#define GLX_BLUE_SIZE 10
+#define GLX_ALPHA_SIZE 11
+#define GLX_DEPTH_SIZE 12
+#define GLX_STENCIL_SIZE 13
+#define GLX_ACCUM_RED_SIZE 14
+#define GLX_ACCUM_GREEN_SIZE 15
+#define GLX_ACCUM_BLUE_SIZE 16
+#define GLX_ACCUM_ALPHA_SIZE 17
+
+
+/*
+ * Error codes returned by glXGetConfig:
+ */
+#define GLX_BAD_SCREEN 1
+#define GLX_BAD_ATTRIBUTE 2
+#define GLX_NO_EXTENSION 3
+#define GLX_BAD_VISUAL 4
+#define GLX_BAD_CONTEXT 5
+#define GLX_BAD_VALUE 6
+#define GLX_BAD_ENUM 7
+
+
+/*
+ * GLX 1.1 and later:
+ */
+#define GLX_VENDOR 1
+#define GLX_VERSION 2
+#define GLX_EXTENSIONS 3
+
+
+/*
+ * GLX 1.3 and later:
+ */
+#define GLX_CONFIG_CAVEAT 0x20
+#define GLX_DONT_CARE 0xFFFFFFFF
+#define GLX_X_VISUAL_TYPE 0x22
+#define GLX_TRANSPARENT_TYPE 0x23
+#define GLX_TRANSPARENT_INDEX_VALUE 0x24
+#define GLX_TRANSPARENT_RED_VALUE 0x25
+#define GLX_TRANSPARENT_GREEN_VALUE 0x26
+#define GLX_TRANSPARENT_BLUE_VALUE 0x27
+#define GLX_TRANSPARENT_ALPHA_VALUE 0x28
+#define GLX_WINDOW_BIT 0x00000001
+#define GLX_PIXMAP_BIT 0x00000002
+#define GLX_PBUFFER_BIT 0x00000004
+#define GLX_AUX_BUFFERS_BIT 0x00000010
+#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001
+#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002
+#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004
+#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008
+#define GLX_DEPTH_BUFFER_BIT 0x00000020
+#define GLX_STENCIL_BUFFER_BIT 0x00000040
+#define GLX_ACCUM_BUFFER_BIT 0x00000080
+#define GLX_NONE 0x8000
+#define GLX_SLOW_CONFIG 0x8001
+#define GLX_TRUE_COLOR 0x8002
+#define GLX_DIRECT_COLOR 0x8003
+#define GLX_PSEUDO_COLOR 0x8004
+#define GLX_STATIC_COLOR 0x8005
+#define GLX_GRAY_SCALE 0x8006
+#define GLX_STATIC_GRAY 0x8007
+#define GLX_TRANSPARENT_RGB 0x8008
+#define GLX_TRANSPARENT_INDEX 0x8009
+#define GLX_VISUAL_ID 0x800B
+#define GLX_SCREEN 0x800C
+#define GLX_NON_CONFORMANT_CONFIG 0x800D
+#define GLX_DRAWABLE_TYPE 0x8010
+#define GLX_RENDER_TYPE 0x8011
+#define GLX_X_RENDERABLE 0x8012
+#define GLX_FBCONFIG_ID 0x8013
+#define GLX_RGBA_TYPE 0x8014
+#define GLX_COLOR_INDEX_TYPE 0x8015
+#define GLX_MAX_PBUFFER_WIDTH 0x8016
+#define GLX_MAX_PBUFFER_HEIGHT 0x8017
+#define GLX_MAX_PBUFFER_PIXELS 0x8018
+#define GLX_PRESERVED_CONTENTS 0x801B
+#define GLX_LARGEST_PBUFFER 0x801C
+#define GLX_WIDTH 0x801D
+#define GLX_HEIGHT 0x801E
+#define GLX_EVENT_MASK 0x801F
+#define GLX_DAMAGED 0x8020
+#define GLX_SAVED 0x8021
+#define GLX_WINDOW 0x8022
+#define GLX_PBUFFER 0x8023
+#define GLX_PBUFFER_HEIGHT 0x8040
+#define GLX_PBUFFER_WIDTH 0x8041
+#define GLX_RGBA_BIT 0x00000001
+#define GLX_COLOR_INDEX_BIT 0x00000002
+#define GLX_PBUFFER_CLOBBER_MASK 0x08000000
+
+
+/*
+ * GLX 1.4 and later:
+ */
+#define GLX_SAMPLE_BUFFERS 0x186a0 /*100000*/
+#define GLX_SAMPLES 0x186a1 /*100001*/
+
+
+
+typedef struct __GLXcontextRec *GLXContext;
+typedef XID GLXPixmap;
+typedef XID GLXDrawable;
+/* GLX 1.3 and later */
+typedef struct __GLXFBConfigRec *GLXFBConfig;
+typedef XID GLXFBConfigID;
+typedef XID GLXContextID;
+typedef XID GLXWindow;
+typedef XID GLXPbuffer;
+
+
+
+extern XVisualInfo* glXChooseVisual( Display *dpy, int screen,
+ int *attribList );
+
+extern GLXContext glXCreateContext( Display *dpy, XVisualInfo *vis,
+ GLXContext shareList, Bool direct );
+
+extern void glXDestroyContext( Display *dpy, GLXContext ctx );
+
+extern Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable,
+ GLXContext ctx);
+
+extern void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
+ unsigned long mask );
+
+extern void glXSwapBuffers( Display *dpy, GLXDrawable drawable );
+
+extern GLXPixmap glXCreateGLXPixmap( Display *dpy, XVisualInfo *visual,
+ Pixmap pixmap );
+
+extern void glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap );
+
+extern Bool glXQueryExtension( Display *dpy, int *errorb, int *event );
+
+extern Bool glXQueryVersion( Display *dpy, int *maj, int *min );
+
+extern Bool glXIsDirect( Display *dpy, GLXContext ctx );
+
+extern int glXGetConfig( Display *dpy, XVisualInfo *visual,
+ int attrib, int *value );
+
+extern GLXContext glXGetCurrentContext( void );
+
+extern GLXDrawable glXGetCurrentDrawable( void );
+
+extern void glXWaitGL( void );
+
+extern void glXWaitX( void );
+
+extern void glXUseXFont( Font font, int first, int count, int list );
+
+
+
+/* GLX 1.1 and later */
+extern const char *glXQueryExtensionsString( Display *dpy, int screen );
+
+extern const char *glXQueryServerString( Display *dpy, int screen, int name );
+
+extern const char *glXGetClientString( Display *dpy, int name );
+
+
+/* GLX 1.2 and later */
+extern Display *glXGetCurrentDisplay( void );
+
+
+/* GLX 1.3 and later */
+extern GLXFBConfig *glXChooseFBConfig( Display *dpy, int screen,
+ const int *attribList, int *nitems );
+
+extern int glXGetFBConfigAttrib( Display *dpy, GLXFBConfig config,
+ int attribute, int *value );
+
+extern GLXFBConfig *glXGetFBConfigs( Display *dpy, int screen,
+ int *nelements );
+
+extern XVisualInfo *glXGetVisualFromFBConfig( Display *dpy,
+ GLXFBConfig config );
+
+extern GLXWindow glXCreateWindow( Display *dpy, GLXFBConfig config,
+ Window win, const int *attribList );
+
+extern void glXDestroyWindow( Display *dpy, GLXWindow window );
+
+extern GLXPixmap glXCreatePixmap( Display *dpy, GLXFBConfig config,
+ Pixmap pixmap, const int *attribList );
+
+extern void glXDestroyPixmap( Display *dpy, GLXPixmap pixmap );
+
+extern GLXPbuffer glXCreatePbuffer( Display *dpy, GLXFBConfig config,
+ const int *attribList );
+
+extern void glXDestroyPbuffer( Display *dpy, GLXPbuffer pbuf );
+
+extern void glXQueryDrawable( Display *dpy, GLXDrawable draw, int attribute,
+ unsigned int *value );
+
+extern GLXContext glXCreateNewContext( Display *dpy, GLXFBConfig config,
+ int renderType, GLXContext shareList,
+ Bool direct );
+
+extern Bool glXMakeContextCurrent( Display *dpy, GLXDrawable draw,
+ GLXDrawable read, GLXContext ctx );
+
+extern GLXDrawable glXGetCurrentReadDrawable( void );
+
+extern int glXQueryContext( Display *dpy, GLXContext ctx, int attribute,
+ int *value );
+
+extern void glXSelectEvent( Display *dpy, GLXDrawable drawable,
+ unsigned long mask );
+
+extern void glXGetSelectedEvent( Display *dpy, GLXDrawable drawable,
+ unsigned long *mask );
+
+
+/* GLX 1.4 and later */
+extern void (*glXGetProcAddress(const GLubyte *procname))( void );
+
+
+#ifndef GLX_GLXEXT_LEGACY
+
+#include <GL/glxext.h>
+
+#else
+
+
+
+/*
+ * ARB 2. GLX_ARB_get_proc_address
+ */
+#ifndef GLX_ARB_get_proc_address
+#define GLX_ARB_get_proc_address 1
+
+typedef void (*__GLXextFuncPtr)(void);
+extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *);
+
+#endif /* GLX_ARB_get_proc_address */
+
+
+
+#endif /* GLX_GLXEXT_LEGACY */
+
+
+/**
+ ** The following aren't in glxext.h yet.
+ **/
+
+
+/*
+ * ???. GLX_NV_vertex_array_range
+ */
+#ifndef GLX_NV_vertex_array_range
+#define GLX_NV_vertex_array_range
+
+extern void *glXAllocateMemoryNV(GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
+extern void glXFreeMemoryNV(GLvoid *pointer);
+typedef void * ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
+typedef void ( * PFNGLXFREEMEMORYNVPROC) (GLvoid *pointer);
+
+#endif /* GLX_NV_vertex_array_range */
+
+
+/*
+ * ???. GLX_MESA_allocate_memory
+ */
+#ifndef GLX_MESA_allocate_memory
+#define GLX_MESA_allocate_memory 1
+
+extern void *glXAllocateMemoryMESA(Display *dpy, int scrn, size_t size, float readfreq, float writefreq, float priority);
+extern void glXFreeMemoryMESA(Display *dpy, int scrn, void *pointer);
+extern GLuint glXGetMemoryOffsetMESA(Display *dpy, int scrn, const void *pointer);
+typedef void * ( * PFNGLXALLOCATEMEMORYMESAPROC) (Display *dpy, int scrn, size_t size, float readfreq, float writefreq, float priority);
+typedef void ( * PFNGLXFREEMEMORYMESAPROC) (Display *dpy, int scrn, void *pointer);
+typedef GLuint (* PFNGLXGETMEMORYOFFSETMESAPROC) (Display *dpy, int scrn, const void *pointer);
+
+#endif /* GLX_MESA_allocate_memory */
+
+
+/*
+ * ARB ?. GLX_ARB_render_texture
+ * XXX This was never finalized!
+ */
+#ifndef GLX_ARB_render_texture
+#define GLX_ARB_render_texture 1
+
+extern Bool glXBindTexImageARB(Display *dpy, GLXPbuffer pbuffer, int buffer);
+extern Bool glXReleaseTexImageARB(Display *dpy, GLXPbuffer pbuffer, int buffer);
+extern Bool glXDrawableAttribARB(Display *dpy, GLXDrawable draw, const int *attribList);
+
+#endif /* GLX_ARB_render_texture */
+
+
+/*
+ * Remove this when glxext.h is updated.
+ */
+#ifndef GLX_NV_float_buffer
+#define GLX_NV_float_buffer 1
+
+#define GLX_FLOAT_COMPONENTS_NV 0x20B0
+
+#endif /* GLX_NV_float_buffer */
+
+
+
+/*
+ * #?. GLX_MESA_swap_frame_usage
+ */
+#ifndef GLX_MESA_swap_frame_usage
+#define GLX_MESA_swap_frame_usage 1
+
+extern int glXGetFrameUsageMESA(Display *dpy, GLXDrawable drawable, float *usage);
+extern int glXBeginFrameTrackingMESA(Display *dpy, GLXDrawable drawable);
+extern int glXEndFrameTrackingMESA(Display *dpy, GLXDrawable drawable);
+extern int glXQueryFrameTrackingMESA(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage);
+
+typedef int (*PFNGLXGETFRAMEUSAGEMESAPROC) (Display *dpy, GLXDrawable drawable, float *usage);
+typedef int (*PFNGLXBEGINFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable);
+typedef int (*PFNGLXENDFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable);
+typedef int (*PFNGLXQUERYFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage);
+
+#endif /* GLX_MESA_swap_frame_usage */
+
+
+
+/*
+ * #?. GLX_MESA_swap_control
+ */
+#ifndef GLX_MESA_swap_control
+#define GLX_MESA_swap_control 1
+
+extern int glXSwapIntervalMESA(unsigned int interval);
+extern int glXGetSwapIntervalMESA(void);
+
+typedef int (*PFNGLXSWAPINTERVALMESAPROC)(unsigned int interval);
+typedef int (*PFNGLXGETSWAPINTERVALMESAPROC)(void);
+
+#endif /* GLX_MESA_swap_control */
+
+
+
+/*
+ * #?. GLX_EXT_texture_from_pixmap
+ * XXX not finished?
+ */
+#ifndef GLX_EXT_texture_from_pixmap
+#define GLX_EXT_texture_from_pixmap 1
+
+#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0
+#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1
+#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2
+#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3
+#define GLX_Y_INVERTED_EXT 0x20D4
+
+#define GLX_TEXTURE_FORMAT_EXT 0x20D5
+#define GLX_TEXTURE_TARGET_EXT 0x20D6
+#define GLX_MIPMAP_TEXTURE_EXT 0x20D7
+
+#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8
+#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9
+#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA
+
+#define GLX_TEXTURE_1D_BIT_EXT 0x00000001
+#define GLX_TEXTURE_2D_BIT_EXT 0x00000002
+#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004
+
+#define GLX_TEXTURE_1D_EXT 0x20DB
+#define GLX_TEXTURE_2D_EXT 0x20DC
+#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD
+
+#define GLX_FRONT_LEFT_EXT 0x20DE
+#define GLX_FRONT_RIGHT_EXT 0x20DF
+#define GLX_BACK_LEFT_EXT 0x20E0
+#define GLX_BACK_RIGHT_EXT 0x20E1
+#define GLX_FRONT_EXT GLX_FRONT_LEFT_EXT
+#define GLX_BACK_EXT GLX_BACK_LEFT_EXT
+#define GLX_AUX0_EXT 0x20E2
+#define GLX_AUX1_EXT 0x20E3
+#define GLX_AUX2_EXT 0x20E4
+#define GLX_AUX3_EXT 0x20E5
+#define GLX_AUX4_EXT 0x20E6
+#define GLX_AUX5_EXT 0x20E7
+#define GLX_AUX6_EXT 0x20E8
+#define GLX_AUX7_EXT 0x20E9
+#define GLX_AUX8_EXT 0x20EA
+#define GLX_AUX9_EXT 0x20EB
+
+extern void glXBindTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list);
+extern void glXReleaseTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer);
+
+#endif /* GLX_EXT_texture_from_pixmap */
+
+
+
+
+/*** Should these go here, or in another header? */
+/*
+** GLX Events
+*/
+typedef struct {
+ int event_type; /* GLX_DAMAGED or GLX_SAVED */
+ int draw_type; /* GLX_WINDOW or GLX_PBUFFER */
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came for SendEvent request */
+ Display *display; /* display the event was read from */
+ GLXDrawable drawable; /* XID of Drawable */
+ unsigned int buffer_mask; /* mask indicating which buffers are affected */
+ unsigned int aux_buffer; /* which aux buffer was affected */
+ int x, y;
+ int width, height;
+ int count; /* if nonzero, at least this many more */
+} GLXPbufferClobberEvent;
+
+typedef union __GLXEvent {
+ GLXPbufferClobberEvent glxpbufferclobber;
+ long pad[24];
+} GLXEvent;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/sysroot/usr/include/GL/glx_mangle.h b/sysroot/usr/include/GL/glx_mangle.h
new file mode 100644
index 0000000..4439a96
--- /dev/null
+++ b/sysroot/usr/include/GL/glx_mangle.h
@@ -0,0 +1,81 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#ifndef GLX_MANGLE_H
+#define GLX_MANGLE_H
+
+#define glXChooseVisual mglXChooseVisual
+#define glXCreateContext mglXCreateContext
+#define glXDestroyContext mglXDestroyContext
+#define glXMakeCurrent mglXMakeCurrent
+#define glXCopyContext mglXCopyContext
+#define glXSwapBuffers mglXSwapBuffers
+#define glXCreateGLXPixmap mglXCreateGLXPixmap
+#define glXDestroyGLXPixmap mglXDestroyGLXPixmap
+#define glXQueryExtension mglXQueryExtension
+#define glXQueryVersion mglXQueryVersion
+#define glXIsDirect mglXIsDirect
+#define glXGetConfig mglXGetConfig
+#define glXGetCurrentContext mglXGetCurrentContext
+#define glXGetCurrentDrawable mglXGetCurrentDrawable
+#define glXWaitGL mglXWaitGL
+#define glXWaitX mglXWaitX
+#define glXUseXFont mglXUseXFont
+#define glXQueryExtensionsString mglXQueryExtensionsString
+#define glXQueryServerString mglXQueryServerString
+#define glXGetClientString mglXGetClientString
+#define glXCreateGLXPixmapMESA mglXCreateGLXPixmapMESA
+#define glXReleaseBuffersMESA mglXReleaseBuffersMESA
+#define glXCopySubBufferMESA mglXCopySubBufferMESA
+#define glXGetVideoSyncSGI mglXGetVideoSyncSGI
+#define glXWaitVideoSyncSGI mglXWaitVideoSyncSGI
+
+/* GLX 1.2 */
+#define glXGetCurrentDisplay mglXGetCurrentDisplay
+
+/* GLX 1.3 */
+#define glXChooseFBConfig mglXChooseFBConfig
+#define glXGetFBConfigAttrib mglXGetFBConfigAttrib
+#define glXGetFBConfigs mglXGetFBConfigs
+#define glXGetVisualFromFBConfig mglXGetVisualFromFBConfig
+#define glXCreateWindow mglXCreateWindow
+#define glXDestroyWindow mglXDestroyWindow
+#define glXCreatePixmap mglXCreatePixmap
+#define glXDestroyPixmap mglXDestroyPixmap
+#define glXCreatePbuffer mglXCreatePbuffer
+#define glXDestroyPbuffer mglXDestroyPbuffer
+#define glXQueryDrawable mglXQueryDrawable
+#define glXCreateNewContext mglXCreateNewContext
+#define glXMakeContextCurrent mglXMakeContextCurrent
+#define glXGetCurrentReadDrawable mglXGetCurrentReadDrawable
+#define glXQueryContext mglXQueryContext
+#define glXSelectEvent mglXSelectEvent
+#define glXGetSelectedEvent mglXGetSelectedEvent
+
+/* GLX 1.4 */
+#define glXGetProcAddress mglXGetProcAddress
+
+
+#endif
diff --git a/sysroot/usr/include/GL/glxext.h b/sysroot/usr/include/GL/glxext.h
new file mode 100644
index 0000000..0f66df6
--- /dev/null
+++ b/sysroot/usr/include/GL/glxext.h
@@ -0,0 +1,785 @@
+#ifndef __glxext_h_
+#define __glxext_h_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** Copyright (c) 2007 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
+#define WIN32_LEAN_AND_MEAN 1
+#include <windows.h>
+#endif
+
+#ifndef APIENTRY
+#define APIENTRY
+#endif
+#ifndef APIENTRYP
+#define APIENTRYP APIENTRY *
+#endif
+#ifndef GLAPI
+#define GLAPI extern
+#endif
+
+/*************************************************************/
+
+/* Header file version number, required by OpenGL ABI for Linux */
+/* glxext.h last updated 2007/04/21 */
+/* Current version at http://www.opengl.org/registry/ */
+#define GLX_GLXEXT_VERSION 19
+
+#ifndef GLX_VERSION_1_3
+#define GLX_WINDOW_BIT 0x00000001
+#define GLX_PIXMAP_BIT 0x00000002
+#define GLX_PBUFFER_BIT 0x00000004
+#define GLX_RGBA_BIT 0x00000001
+#define GLX_COLOR_INDEX_BIT 0x00000002
+#define GLX_PBUFFER_CLOBBER_MASK 0x08000000
+#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001
+#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002
+#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004
+#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008
+#define GLX_AUX_BUFFERS_BIT 0x00000010
+#define GLX_DEPTH_BUFFER_BIT 0x00000020
+#define GLX_STENCIL_BUFFER_BIT 0x00000040
+#define GLX_ACCUM_BUFFER_BIT 0x00000080
+#define GLX_CONFIG_CAVEAT 0x20
+#define GLX_X_VISUAL_TYPE 0x22
+#define GLX_TRANSPARENT_TYPE 0x23
+#define GLX_TRANSPARENT_INDEX_VALUE 0x24
+#define GLX_TRANSPARENT_RED_VALUE 0x25
+#define GLX_TRANSPARENT_GREEN_VALUE 0x26
+#define GLX_TRANSPARENT_BLUE_VALUE 0x27
+#define GLX_TRANSPARENT_ALPHA_VALUE 0x28
+#define GLX_DONT_CARE 0xFFFFFFFF
+#define GLX_NONE 0x8000
+#define GLX_SLOW_CONFIG 0x8001
+#define GLX_TRUE_COLOR 0x8002
+#define GLX_DIRECT_COLOR 0x8003
+#define GLX_PSEUDO_COLOR 0x8004
+#define GLX_STATIC_COLOR 0x8005
+#define GLX_GRAY_SCALE 0x8006
+#define GLX_STATIC_GRAY 0x8007
+#define GLX_TRANSPARENT_RGB 0x8008
+#define GLX_TRANSPARENT_INDEX 0x8009
+#define GLX_VISUAL_ID 0x800B
+#define GLX_SCREEN 0x800C
+#define GLX_NON_CONFORMANT_CONFIG 0x800D
+#define GLX_DRAWABLE_TYPE 0x8010
+#define GLX_RENDER_TYPE 0x8011
+#define GLX_X_RENDERABLE 0x8012
+#define GLX_FBCONFIG_ID 0x8013
+#define GLX_RGBA_TYPE 0x8014
+#define GLX_COLOR_INDEX_TYPE 0x8015
+#define GLX_MAX_PBUFFER_WIDTH 0x8016
+#define GLX_MAX_PBUFFER_HEIGHT 0x8017
+#define GLX_MAX_PBUFFER_PIXELS 0x8018
+#define GLX_PRESERVED_CONTENTS 0x801B
+#define GLX_LARGEST_PBUFFER 0x801C
+#define GLX_WIDTH 0x801D
+#define GLX_HEIGHT 0x801E
+#define GLX_EVENT_MASK 0x801F
+#define GLX_DAMAGED 0x8020
+#define GLX_SAVED 0x8021
+#define GLX_WINDOW 0x8022
+#define GLX_PBUFFER 0x8023
+#define GLX_PBUFFER_HEIGHT 0x8040
+#define GLX_PBUFFER_WIDTH 0x8041
+#endif
+
+#ifndef GLX_VERSION_1_4
+#define GLX_SAMPLE_BUFFERS 100000
+#define GLX_SAMPLES 100001
+#endif
+
+#ifndef GLX_ARB_get_proc_address
+#endif
+
+#ifndef GLX_ARB_multisample
+#define GLX_SAMPLE_BUFFERS_ARB 100000
+#define GLX_SAMPLES_ARB 100001
+#endif
+
+#ifndef GLX_ARB_fbconfig_float
+#define GLX_RGBA_FLOAT_TYPE_ARB 0x20B9
+#define GLX_RGBA_FLOAT_BIT_ARB 0x00000004
+#endif
+
+#ifndef GLX_SGIS_multisample
+#define GLX_SAMPLE_BUFFERS_SGIS 100000
+#define GLX_SAMPLES_SGIS 100001
+#endif
+
+#ifndef GLX_EXT_visual_info
+#define GLX_X_VISUAL_TYPE_EXT 0x22
+#define GLX_TRANSPARENT_TYPE_EXT 0x23
+#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24
+#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25
+#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26
+#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27
+#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28
+#define GLX_NONE_EXT 0x8000
+#define GLX_TRUE_COLOR_EXT 0x8002
+#define GLX_DIRECT_COLOR_EXT 0x8003
+#define GLX_PSEUDO_COLOR_EXT 0x8004
+#define GLX_STATIC_COLOR_EXT 0x8005
+#define GLX_GRAY_SCALE_EXT 0x8006
+#define GLX_STATIC_GRAY_EXT 0x8007
+#define GLX_TRANSPARENT_RGB_EXT 0x8008
+#define GLX_TRANSPARENT_INDEX_EXT 0x8009
+#endif
+
+#ifndef GLX_SGI_swap_control
+#endif
+
+#ifndef GLX_SGI_video_sync
+#endif
+
+#ifndef GLX_SGI_make_current_read
+#endif
+
+#ifndef GLX_SGIX_video_source
+#endif
+
+#ifndef GLX_EXT_visual_rating
+#define GLX_VISUAL_CAVEAT_EXT 0x20
+#define GLX_SLOW_VISUAL_EXT 0x8001
+#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D
+/* reuse GLX_NONE_EXT */
+#endif
+
+#ifndef GLX_EXT_import_context
+#define GLX_SHARE_CONTEXT_EXT 0x800A
+#define GLX_VISUAL_ID_EXT 0x800B
+#define GLX_SCREEN_EXT 0x800C
+#endif
+
+#ifndef GLX_SGIX_fbconfig
+#define GLX_WINDOW_BIT_SGIX 0x00000001
+#define GLX_PIXMAP_BIT_SGIX 0x00000002
+#define GLX_RGBA_BIT_SGIX 0x00000001
+#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002
+#define GLX_DRAWABLE_TYPE_SGIX 0x8010
+#define GLX_RENDER_TYPE_SGIX 0x8011
+#define GLX_X_RENDERABLE_SGIX 0x8012
+#define GLX_FBCONFIG_ID_SGIX 0x8013
+#define GLX_RGBA_TYPE_SGIX 0x8014
+#define GLX_COLOR_INDEX_TYPE_SGIX 0x8015
+/* reuse GLX_SCREEN_EXT */
+#endif
+
+#ifndef GLX_SGIX_pbuffer
+#define GLX_PBUFFER_BIT_SGIX 0x00000004
+#define GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000
+#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001
+#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002
+#define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004
+#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008
+#define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010
+#define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020
+#define GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040
+#define GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080
+#define GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100
+#define GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016
+#define GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017
+#define GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018
+#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019
+#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A
+#define GLX_PRESERVED_CONTENTS_SGIX 0x801B
+#define GLX_LARGEST_PBUFFER_SGIX 0x801C
+#define GLX_WIDTH_SGIX 0x801D
+#define GLX_HEIGHT_SGIX 0x801E
+#define GLX_EVENT_MASK_SGIX 0x801F
+#define GLX_DAMAGED_SGIX 0x8020
+#define GLX_SAVED_SGIX 0x8021
+#define GLX_WINDOW_SGIX 0x8022
+#define GLX_PBUFFER_SGIX 0x8023
+#endif
+
+#ifndef GLX_SGI_cushion
+#endif
+
+#ifndef GLX_SGIX_video_resize
+#define GLX_SYNC_FRAME_SGIX 0x00000000
+#define GLX_SYNC_SWAP_SGIX 0x00000001
+#endif
+
+#ifndef GLX_SGIX_dmbuffer
+#define GLX_DIGITAL_MEDIA_PBUFFER_SGIX 0x8024
+#endif
+
+#ifndef GLX_SGIX_swap_group
+#endif
+
+#ifndef GLX_SGIX_swap_barrier
+#endif
+
+#ifndef GLX_SGIS_blended_overlay
+#define GLX_BLENDED_RGBA_SGIS 0x8025
+#endif
+
+#ifndef GLX_SGIS_shared_multisample
+#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026
+#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027
+#endif
+
+#ifndef GLX_SUN_get_transparent_index
+#endif
+
+#ifndef GLX_3DFX_multisample
+#define GLX_SAMPLE_BUFFERS_3DFX 0x8050
+#define GLX_SAMPLES_3DFX 0x8051
+#endif
+
+#ifndef GLX_MESA_copy_sub_buffer
+#endif
+
+#ifndef GLX_MESA_pixmap_colormap
+#endif
+
+#ifndef GLX_MESA_release_buffers
+#endif
+
+#ifndef GLX_MESA_set_3dfx_mode
+#define GLX_3DFX_WINDOW_MODE_MESA 0x1
+#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2
+#endif
+
+#ifndef GLX_SGIX_visual_select_group
+#define GLX_VISUAL_SELECT_GROUP_SGIX 0x8028
+#endif
+
+#ifndef GLX_OML_swap_method
+#define GLX_SWAP_METHOD_OML 0x8060
+#define GLX_SWAP_EXCHANGE_OML 0x8061
+#define GLX_SWAP_COPY_OML 0x8062
+#define GLX_SWAP_UNDEFINED_OML 0x8063
+#endif
+
+#ifndef GLX_OML_sync_control
+#endif
+
+#ifndef GLX_NV_float_buffer
+#define GLX_FLOAT_COMPONENTS_NV 0x20B0
+#endif
+
+#ifndef GLX_SGIX_hyperpipe
+#define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80
+#define GLX_BAD_HYPERPIPE_CONFIG_SGIX 91
+#define GLX_BAD_HYPERPIPE_SGIX 92
+#define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001
+#define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002
+#define GLX_PIPE_RECT_SGIX 0x00000001
+#define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002
+#define GLX_HYPERPIPE_STEREO_SGIX 0x00000003
+#define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004
+#define GLX_HYPERPIPE_ID_SGIX 0x8030
+#endif
+
+#ifndef GLX_MESA_agp_offset
+#endif
+
+#ifndef GLX_EXT_fbconfig_packed_float
+#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1
+#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008
+#endif
+
+#ifndef GLX_EXT_framebuffer_sRGB
+#define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2
+#endif
+
+#ifndef GLX_EXT_texture_from_pixmap
+#define GLX_TEXTURE_1D_BIT_EXT 0x00000001
+#define GLX_TEXTURE_2D_BIT_EXT 0x00000002
+#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004
+#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0
+#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1
+#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2
+#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3
+#define GLX_Y_INVERTED_EXT 0x20D4
+#define GLX_TEXTURE_FORMAT_EXT 0x20D5
+#define GLX_TEXTURE_TARGET_EXT 0x20D6
+#define GLX_MIPMAP_TEXTURE_EXT 0x20D7
+#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8
+#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9
+#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA
+#define GLX_TEXTURE_1D_EXT 0x20DB
+#define GLX_TEXTURE_2D_EXT 0x20DC
+#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD
+#define GLX_FRONT_LEFT_EXT 0x20DE
+#define GLX_FRONT_RIGHT_EXT 0x20DF
+#define GLX_BACK_LEFT_EXT 0x20E0
+#define GLX_BACK_RIGHT_EXT 0x20E1
+#define GLX_FRONT_EXT GLX_FRONT_LEFT_EXT
+#define GLX_BACK_EXT GLX_BACK_LEFT_EXT
+#define GLX_AUX0_EXT 0x20E2
+#define GLX_AUX1_EXT 0x20E3
+#define GLX_AUX2_EXT 0x20E4
+#define GLX_AUX3_EXT 0x20E5
+#define GLX_AUX4_EXT 0x20E6
+#define GLX_AUX5_EXT 0x20E7
+#define GLX_AUX6_EXT 0x20E8
+#define GLX_AUX7_EXT 0x20E9
+#define GLX_AUX8_EXT 0x20EA
+#define GLX_AUX9_EXT 0x20EB
+#endif
+
+
+/*************************************************************/
+
+#ifndef GLX_ARB_get_proc_address
+typedef void (*__GLXextFuncPtr)(void);
+#endif
+
+#ifndef GLX_SGIX_video_source
+typedef XID GLXVideoSourceSGIX;
+#endif
+
+#ifndef GLX_SGIX_fbconfig
+typedef XID GLXFBConfigIDSGIX;
+typedef struct __GLXFBConfigRec *GLXFBConfigSGIX;
+#endif
+
+#ifndef GLX_SGIX_pbuffer
+typedef XID GLXPbufferSGIX;
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came for SendEvent request */
+ Display *display; /* display the event was read from */
+ GLXDrawable drawable; /* i.d. of Drawable */
+ int event_type; /* GLX_DAMAGED_SGIX or GLX_SAVED_SGIX */
+ int draw_type; /* GLX_WINDOW_SGIX or GLX_PBUFFER_SGIX */
+ unsigned int mask; /* mask indicating which buffers are affected*/
+ int x, y;
+ int width, height;
+ int count; /* if nonzero, at least this many more */
+} GLXBufferClobberEventSGIX;
+#endif
+
+#ifndef GLEXT_64_TYPES_DEFINED
+/* This code block is duplicated in glxext.h, so must be protected */
+#define GLEXT_64_TYPES_DEFINED
+/* Define int32_t, int64_t, and uint64_t types for UST/MSC */
+/* (as used in the GLX_OML_sync_control extension). */
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+#include <inttypes.h>
+#elif defined(__sun__) || defined(__digital__)
+#include <inttypes.h>
+#if defined(__STDC__)
+#if defined(__arch64__)
+typedef long int int64_t;
+typedef unsigned long int uint64_t;
+#else
+typedef long long int int64_t;
+typedef unsigned long long int uint64_t;
+#endif /* __arch64__ */
+#endif /* __STDC__ */
+#elif defined( __VMS )
+#include <inttypes.h>
+#elif defined(__SCO__) || defined(__USLC__)
+#include <stdint.h>
+#elif defined(__UNIXOS2__) || defined(__SOL64__)
+typedef long int int32_t;
+typedef long long int int64_t;
+typedef unsigned long long int uint64_t;
+#elif defined(_WIN32) && defined(__GNUC__)
+#include <stdint.h>
+#elif defined(_WIN32)
+typedef __int32 int32_t;
+typedef __int64 int64_t;
+typedef unsigned __int64 uint64_t;
+#else
+#include <inttypes.h> /* Fallback option */
+#endif
+#endif
+
+#ifndef GLX_VERSION_1_3
+#define GLX_VERSION_1_3 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLXFBConfig * glXGetFBConfigs (Display *, int, int *);
+extern GLXFBConfig * glXChooseFBConfig (Display *, int, const int *, int *);
+extern int glXGetFBConfigAttrib (Display *, GLXFBConfig, int, int *);
+extern XVisualInfo * glXGetVisualFromFBConfig (Display *, GLXFBConfig);
+extern GLXWindow glXCreateWindow (Display *, GLXFBConfig, Window, const int *);
+extern void glXDestroyWindow (Display *, GLXWindow);
+extern GLXPixmap glXCreatePixmap (Display *, GLXFBConfig, Pixmap, const int *);
+extern void glXDestroyPixmap (Display *, GLXPixmap);
+extern GLXPbuffer glXCreatePbuffer (Display *, GLXFBConfig, const int *);
+extern void glXDestroyPbuffer (Display *, GLXPbuffer);
+extern void glXQueryDrawable (Display *, GLXDrawable, int, unsigned int *);
+extern GLXContext glXCreateNewContext (Display *, GLXFBConfig, int, GLXContext, Bool);
+extern Bool glXMakeContextCurrent (Display *, GLXDrawable, GLXDrawable, GLXContext);
+extern GLXDrawable glXGetCurrentReadDrawable (void);
+extern Display * glXGetCurrentDisplay (void);
+extern int glXQueryContext (Display *, GLXContext, int, int *);
+extern void glXSelectEvent (Display *, GLXDrawable, unsigned long);
+extern void glXGetSelectedEvent (Display *, GLXDrawable, unsigned long *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLXFBConfig * ( * PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements);
+typedef GLXFBConfig * ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);
+typedef int ( * PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value);
+typedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config);
+typedef GLXWindow ( * PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
+typedef void ( * PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win);
+typedef GLXPixmap ( * PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);
+typedef void ( * PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap);
+typedef GLXPbuffer ( * PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list);
+typedef void ( * PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf);
+typedef void ( * PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
+typedef GLXContext ( * PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
+typedef Bool ( * PFNGLXMAKECONTEXTCURRENTPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
+typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLEPROC) (void);
+typedef Display * ( * PFNGLXGETCURRENTDISPLAYPROC) (void);
+typedef int ( * PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value);
+typedef void ( * PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask);
+typedef void ( * PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask);
+#endif
+
+#ifndef GLX_VERSION_1_4
+#define GLX_VERSION_1_4 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern __GLXextFuncPtr glXGetProcAddress (const GLubyte *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSPROC) (const GLubyte *procName);
+#endif
+
+#ifndef GLX_ARB_get_proc_address
+#define GLX_ARB_get_proc_address 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSARBPROC) (const GLubyte *procName);
+#endif
+
+#ifndef GLX_ARB_multisample
+#define GLX_ARB_multisample 1
+#endif
+
+#ifndef GLX_ARB_fbconfig_float
+#define GLX_ARB_fbconfig_float 1
+#endif
+
+#ifndef GLX_SGIS_multisample
+#define GLX_SGIS_multisample 1
+#endif
+
+#ifndef GLX_EXT_visual_info
+#define GLX_EXT_visual_info 1
+#endif
+
+#ifndef GLX_SGI_swap_control
+#define GLX_SGI_swap_control 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern int glXSwapIntervalSGI (int);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval);
+#endif
+
+#ifndef GLX_SGI_video_sync
+#define GLX_SGI_video_sync 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern int glXGetVideoSyncSGI (unsigned int *);
+extern int glXWaitVideoSyncSGI (int, int, unsigned int *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int *count);
+typedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int *count);
+#endif
+
+#ifndef GLX_SGI_make_current_read
+#define GLX_SGI_make_current_read 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXMakeCurrentReadSGI (Display *, GLXDrawable, GLXDrawable, GLXContext);
+extern GLXDrawable glXGetCurrentReadDrawableSGI (void);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Bool ( * PFNGLXMAKECURRENTREADSGIPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
+typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void);
+#endif
+
+#ifndef GLX_SGIX_video_source
+#define GLX_SGIX_video_source 1
+#ifdef _VL_H
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLXVideoSourceSGIX glXCreateGLXVideoSourceSGIX (Display *, int, VLServer, VLPath, int, VLNode);
+extern void glXDestroyGLXVideoSourceSGIX (Display *, GLXVideoSourceSGIX);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLXVideoSourceSGIX ( * PFNGLXCREATEGLXVIDEOSOURCESGIXPROC) (Display *display, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode);
+typedef void ( * PFNGLXDESTROYGLXVIDEOSOURCESGIXPROC) (Display *dpy, GLXVideoSourceSGIX glxvideosource);
+#endif /* _VL_H */
+#endif
+
+#ifndef GLX_EXT_visual_rating
+#define GLX_EXT_visual_rating 1
+#endif
+
+#ifndef GLX_EXT_import_context
+#define GLX_EXT_import_context 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Display * glXGetCurrentDisplayEXT (void);
+extern int glXQueryContextInfoEXT (Display *, GLXContext, int, int *);
+extern GLXContextID glXGetContextIDEXT (const GLXContext);
+extern GLXContext glXImportContextEXT (Display *, GLXContextID);
+extern void glXFreeContextEXT (Display *, GLXContext);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Display * ( * PFNGLXGETCURRENTDISPLAYEXTPROC) (void);
+typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display *dpy, GLXContext context, int attribute, int *value);
+typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context);
+typedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display *dpy, GLXContextID contextID);
+typedef void ( * PFNGLXFREECONTEXTEXTPROC) (Display *dpy, GLXContext context);
+#endif
+
+#ifndef GLX_SGIX_fbconfig
+#define GLX_SGIX_fbconfig 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern int glXGetFBConfigAttribSGIX (Display *, GLXFBConfigSGIX, int, int *);
+extern GLXFBConfigSGIX * glXChooseFBConfigSGIX (Display *, int, int *, int *);
+extern GLXPixmap glXCreateGLXPixmapWithConfigSGIX (Display *, GLXFBConfigSGIX, Pixmap);
+extern GLXContext glXCreateContextWithConfigSGIX (Display *, GLXFBConfigSGIX, int, GLXContext, Bool);
+extern XVisualInfo * glXGetVisualFromFBConfigSGIX (Display *, GLXFBConfigSGIX);
+extern GLXFBConfigSGIX glXGetFBConfigFromVisualSGIX (Display *, XVisualInfo *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef int ( * PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int attribute, int *value);
+typedef GLXFBConfigSGIX * ( * PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, int *attrib_list, int *nelements);
+typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap);
+typedef GLXContext ( * PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct);
+typedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config);
+typedef GLXFBConfigSGIX ( * PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display *dpy, XVisualInfo *vis);
+#endif
+
+#ifndef GLX_SGIX_pbuffer
+#define GLX_SGIX_pbuffer 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLXPbufferSGIX glXCreateGLXPbufferSGIX (Display *, GLXFBConfigSGIX, unsigned int, unsigned int, int *);
+extern void glXDestroyGLXPbufferSGIX (Display *, GLXPbufferSGIX);
+extern int glXQueryGLXPbufferSGIX (Display *, GLXPbufferSGIX, int, unsigned int *);
+extern void glXSelectEventSGIX (Display *, GLXDrawable, unsigned long);
+extern void glXGetSelectedEventSGIX (Display *, GLXDrawable, unsigned long *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLXPbufferSGIX ( * PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list);
+typedef void ( * PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf);
+typedef int ( * PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value);
+typedef void ( * PFNGLXSELECTEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long mask);
+typedef void ( * PFNGLXGETSELECTEDEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long *mask);
+#endif
+
+#ifndef GLX_SGI_cushion
+#define GLX_SGI_cushion 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern void glXCushionSGI (Display *, Window, float);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef void ( * PFNGLXCUSHIONSGIPROC) (Display *dpy, Window window, float cushion);
+#endif
+
+#ifndef GLX_SGIX_video_resize
+#define GLX_SGIX_video_resize 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern int glXBindChannelToWindowSGIX (Display *, int, int, Window);
+extern int glXChannelRectSGIX (Display *, int, int, int, int, int, int);
+extern int glXQueryChannelRectSGIX (Display *, int, int, int *, int *, int *, int *);
+extern int glXQueryChannelDeltasSGIX (Display *, int, int, int *, int *, int *, int *);
+extern int glXChannelRectSyncSGIX (Display *, int, int, GLenum);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef int ( * PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display *display, int screen, int channel, Window window);
+typedef int ( * PFNGLXCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int x, int y, int w, int h);
+typedef int ( * PFNGLXQUERYCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int *dx, int *dy, int *dw, int *dh);
+typedef int ( * PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display *display, int screen, int channel, int *x, int *y, int *w, int *h);
+typedef int ( * PFNGLXCHANNELRECTSYNCSGIXPROC) (Display *display, int screen, int channel, GLenum synctype);
+#endif
+
+#ifndef GLX_SGIX_dmbuffer
+#define GLX_SGIX_dmbuffer 1
+#ifdef _DM_BUFFER_H_
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXAssociateDMPbufferSGIX (Display *, GLXPbufferSGIX, DMparams *, DMbuffer);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Bool ( * PFNGLXASSOCIATEDMPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params, DMbuffer dmbuffer);
+#endif /* _DM_BUFFER_H_ */
+#endif
+
+#ifndef GLX_SGIX_swap_group
+#define GLX_SGIX_swap_group 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern void glXJoinSwapGroupSGIX (Display *, GLXDrawable, GLXDrawable);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef void ( * PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member);
+#endif
+
+#ifndef GLX_SGIX_swap_barrier
+#define GLX_SGIX_swap_barrier 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern void glXBindSwapBarrierSGIX (Display *, GLXDrawable, int);
+extern Bool glXQueryMaxSwapBarriersSGIX (Display *, int, int *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef void ( * PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier);
+typedef Bool ( * PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max);
+#endif
+
+#ifndef GLX_SUN_get_transparent_index
+#define GLX_SUN_get_transparent_index 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Status glXGetTransparentIndexSUN (Display *, Window, Window, long *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Status ( * PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display *dpy, Window overlay, Window underlay, long *pTransparentIndex);
+#endif
+
+#ifndef GLX_MESA_copy_sub_buffer
+#define GLX_MESA_copy_sub_buffer 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern void glXCopySubBufferMESA (Display *, GLXDrawable, int, int, int, int);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef void ( * PFNGLXCOPYSUBBUFFERMESAPROC) (Display *dpy, GLXDrawable drawable, int x, int y, int width, int height);
+#endif
+
+#ifndef GLX_MESA_pixmap_colormap
+#define GLX_MESA_pixmap_colormap 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLXPixmap glXCreateGLXPixmapMESA (Display *, XVisualInfo *, Pixmap, Colormap);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display *dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap);
+#endif
+
+#ifndef GLX_MESA_release_buffers
+#define GLX_MESA_release_buffers 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXReleaseBuffersMESA (Display *, GLXDrawable);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Bool ( * PFNGLXRELEASEBUFFERSMESAPROC) (Display *dpy, GLXDrawable drawable);
+#endif
+
+#ifndef GLX_MESA_set_3dfx_mode
+#define GLX_MESA_set_3dfx_mode 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXSet3DfxModeMESA (int);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Bool ( * PFNGLXSET3DFXMODEMESAPROC) (int mode);
+#endif
+
+#ifndef GLX_SGIX_visual_select_group
+#define GLX_SGIX_visual_select_group 1
+#endif
+
+#ifndef GLX_OML_swap_method
+#define GLX_OML_swap_method 1
+#endif
+
+#ifndef GLX_OML_sync_control
+#define GLX_OML_sync_control 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXGetSyncValuesOML (Display *, GLXDrawable, int64_t *, int64_t *, int64_t *);
+extern Bool glXGetMscRateOML (Display *, GLXDrawable, int32_t *, int32_t *);
+extern int64_t glXSwapBuffersMscOML (Display *, GLXDrawable, int64_t, int64_t, int64_t);
+extern Bool glXWaitForMscOML (Display *, GLXDrawable, int64_t, int64_t, int64_t, int64_t *, int64_t *, int64_t *);
+extern Bool glXWaitForSbcOML (Display *, GLXDrawable, int64_t, int64_t *, int64_t *, int64_t *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Bool ( * PFNGLXGETSYNCVALUESOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t *ust, int64_t *msc, int64_t *sbc);
+typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display *dpy, GLXDrawable drawable, int32_t *numerator, int32_t *denominator);
+typedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder);
+typedef Bool ( * PFNGLXWAITFORMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc);
+typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc);
+#endif
+
+#ifndef GLX_NV_float_buffer
+#define GLX_NV_float_buffer 1
+#endif
+
+#ifndef GLX_SGIX_hyperpipe
+#define GLX_SGIX_hyperpipe 1
+
+typedef struct {
+ char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
+ int networkId;
+} GLXHyperpipeNetworkSGIX;
+
+typedef struct {
+ char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
+ int channel;
+ unsigned int
+ participationType;
+ int timeSlice;
+} GLXHyperpipeConfigSGIX;
+
+typedef struct {
+ char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
+ int srcXOrigin, srcYOrigin, srcWidth, srcHeight;
+ int destXOrigin, destYOrigin, destWidth, destHeight;
+} GLXPipeRect;
+
+typedef struct {
+ char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
+ int XOrigin, YOrigin, maxHeight, maxWidth;
+} GLXPipeRectLimits;
+
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLXHyperpipeNetworkSGIX * glXQueryHyperpipeNetworkSGIX (Display *, int *);
+extern int glXHyperpipeConfigSGIX (Display *, int, int, GLXHyperpipeConfigSGIX *, int *);
+extern GLXHyperpipeConfigSGIX * glXQueryHyperpipeConfigSGIX (Display *, int, int *);
+extern int glXDestroyHyperpipeConfigSGIX (Display *, int);
+extern int glXBindHyperpipeSGIX (Display *, int);
+extern int glXQueryHyperpipeBestAttribSGIX (Display *, int, int, int, void *, void *);
+extern int glXHyperpipeAttribSGIX (Display *, int, int, int, void *);
+extern int glXQueryHyperpipeAttribSGIX (Display *, int, int, int, void *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLXHyperpipeNetworkSGIX * ( * PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display *dpy, int *npipes);
+typedef int ( * PFNGLXHYPERPIPECONFIGSGIXPROC) (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId);
+typedef GLXHyperpipeConfigSGIX * ( * PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId, int *npipes);
+typedef int ( * PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId);
+typedef int ( * PFNGLXBINDHYPERPIPESGIXPROC) (Display *dpy, int hpId);
+typedef int ( * PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList);
+typedef int ( * PFNGLXHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList);
+typedef int ( * PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList);
+#endif
+
+#ifndef GLX_MESA_agp_offset
+#define GLX_MESA_agp_offset 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern unsigned int glXGetAGPOffsetMESA (const void *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void *pointer);
+#endif
+
+#ifndef GLX_EXT_fbconfig_packed_float
+#define GLX_EXT_fbconfig_packed_float 1
+#endif
+
+#ifndef GLX_EXT_framebuffer_sRGB
+#define GLX_EXT_framebuffer_sRGB 1
+#endif
+
+#ifndef GLX_EXT_texture_from_pixmap
+#define GLX_EXT_texture_from_pixmap 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern void glXBindTexImageEXT (Display *, GLXDrawable, int, const int *);
+extern void glXReleaseTexImageEXT (Display *, GLXDrawable, int);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef void ( * PFNGLXBINDTEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list);
+typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable, int buffer);
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/sysroot/usr/include/X11/DECkeysym.h b/sysroot/usr/include/X11/DECkeysym.h
new file mode 100644
index 0000000..6ab103e
--- /dev/null
+++ b/sysroot/usr/include/X11/DECkeysym.h
@@ -0,0 +1,67 @@
+/* $Xorg: DECkeysym.h,v 1.4 2001/02/09 02:03:22 xorgcvs Exp $ */
+
+/***********************************************************
+
+Copyright 1988, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************/
+
+/*
+ * DEC private keysyms
+ * (29th bit set)
+ */
+
+/* two-key compose sequence initiators, chosen to map to Latin1 characters */
+
+#define DXK_ring_accent 0x1000FEB0
+#define DXK_circumflex_accent 0x1000FE5E
+#define DXK_cedilla_accent 0x1000FE2C
+#define DXK_acute_accent 0x1000FE27
+#define DXK_grave_accent 0x1000FE60
+#define DXK_tilde 0x1000FE7E
+#define DXK_diaeresis 0x1000FE22
+
+/* special keysym for LK2** "Remove" key on editing keypad */
+
+#define DXK_Remove 0x1000FF00 /* Remove */
diff --git a/sysroot/usr/include/X11/HPkeysym.h b/sysroot/usr/include/X11/HPkeysym.h
new file mode 100644
index 0000000..2d09277
--- /dev/null
+++ b/sysroot/usr/include/X11/HPkeysym.h
@@ -0,0 +1,165 @@
+/* $Xorg: HPkeysym.h,v 1.5 2001/02/09 02:03:22 xorgcvs Exp $ */
+/*
+
+Copyright 1987, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from The Open Group.
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the names of Hewlett Packard
+or Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+HEWLETT-PACKARD MAKES NO WARRANTY OF ANY KIND WITH REGARD
+TO THIS SOFWARE, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. Hewlett-Packard shall not be liable for errors
+contained herein or direct, indirect, special, incidental or
+consequential damages in connection with the furnishing,
+performance, or use of this material.
+
+*/
+
+#ifndef _HPKEYSYM_H
+
+#define _HPKEYSYM
+
+#define hpXK_ClearLine 0x1000FF6F
+#define hpXK_InsertLine 0x1000FF70
+#define hpXK_DeleteLine 0x1000FF71
+#define hpXK_InsertChar 0x1000FF72
+#define hpXK_DeleteChar 0x1000FF73
+#define hpXK_BackTab 0x1000FF74
+#define hpXK_KP_BackTab 0x1000FF75
+#define hpXK_Modelock1 0x1000FF48
+#define hpXK_Modelock2 0x1000FF49
+#define hpXK_Reset 0x1000FF6C
+#define hpXK_System 0x1000FF6D
+#define hpXK_User 0x1000FF6E
+#define hpXK_mute_acute 0x100000A8
+#define hpXK_mute_grave 0x100000A9
+#define hpXK_mute_asciicircum 0x100000AA
+#define hpXK_mute_diaeresis 0x100000AB
+#define hpXK_mute_asciitilde 0x100000AC
+#define hpXK_lira 0x100000AF
+#define hpXK_guilder 0x100000BE
+#define hpXK_Ydiaeresis 0x100000EE
+#define hpXK_IO 0x100000EE
+#define hpXK_longminus 0x100000F6
+#define hpXK_block 0x100000FC
+
+
+#ifndef _OSF_Keysyms
+#define _OSF_Keysyms
+
+#define osfXK_Copy 0x1004FF02
+#define osfXK_Cut 0x1004FF03
+#define osfXK_Paste 0x1004FF04
+#define osfXK_BackTab 0x1004FF07
+#define osfXK_BackSpace 0x1004FF08
+#define osfXK_Clear 0x1004FF0B
+#define osfXK_Escape 0x1004FF1B
+#define osfXK_AddMode 0x1004FF31
+#define osfXK_PrimaryPaste 0x1004FF32
+#define osfXK_QuickPaste 0x1004FF33
+#define osfXK_PageLeft 0x1004FF40
+#define osfXK_PageUp 0x1004FF41
+#define osfXK_PageDown 0x1004FF42
+#define osfXK_PageRight 0x1004FF43
+#define osfXK_Activate 0x1004FF44
+#define osfXK_MenuBar 0x1004FF45
+#define osfXK_Left 0x1004FF51
+#define osfXK_Up 0x1004FF52
+#define osfXK_Right 0x1004FF53
+#define osfXK_Down 0x1004FF54
+#define osfXK_EndLine 0x1004FF57
+#define osfXK_BeginLine 0x1004FF58
+#define osfXK_EndData 0x1004FF59
+#define osfXK_BeginData 0x1004FF5A
+#define osfXK_PrevMenu 0x1004FF5B
+#define osfXK_NextMenu 0x1004FF5C
+#define osfXK_PrevField 0x1004FF5D
+#define osfXK_NextField 0x1004FF5E
+#define osfXK_Select 0x1004FF60
+#define osfXK_Insert 0x1004FF63
+#define osfXK_Undo 0x1004FF65
+#define osfXK_Menu 0x1004FF67
+#define osfXK_Cancel 0x1004FF69
+#define osfXK_Help 0x1004FF6A
+#define osfXK_SelectAll 0x1004FF71
+#define osfXK_DeselectAll 0x1004FF72
+#define osfXK_Reselect 0x1004FF73
+#define osfXK_Extend 0x1004FF74
+#define osfXK_Restore 0x1004FF78
+#define osfXK_Delete 0x1004FFFF
+
+#endif /* _OSF_Keysyms */
+
+
+/**************************************************************
+ * The use of the following macros is deprecated.
+ * They are listed below only for backwards compatibility.
+ */
+#define XK_Reset 0x1000FF6C
+#define XK_System 0x1000FF6D
+#define XK_User 0x1000FF6E
+#define XK_ClearLine 0x1000FF6F
+#define XK_InsertLine 0x1000FF70
+#define XK_DeleteLine 0x1000FF71
+#define XK_InsertChar 0x1000FF72
+#define XK_DeleteChar 0x1000FF73
+#define XK_BackTab 0x1000FF74
+#define XK_KP_BackTab 0x1000FF75
+#define XK_Ext16bit_L 0x1000FF76
+#define XK_Ext16bit_R 0x1000FF77
+#define XK_mute_acute 0x100000a8
+#define XK_mute_grave 0x100000a9
+#define XK_mute_asciicircum 0x100000aa
+#define XK_mute_diaeresis 0x100000ab
+#define XK_mute_asciitilde 0x100000ac
+#define XK_lira 0x100000af
+#define XK_guilder 0x100000be
+#ifndef XK_Ydiaeresis
+#define XK_Ydiaeresis 0x100000ee
+#endif
+#define XK_IO 0x100000ee
+#define XK_longminus 0x100000f6
+#define XK_block 0x100000fc
+
+#endif /* _HPKEYSYM_H */
diff --git a/sysroot/usr/include/X11/ImUtil.h b/sysroot/usr/include/X11/ImUtil.h
new file mode 100644
index 0000000..89f0381
--- /dev/null
+++ b/sysroot/usr/include/X11/ImUtil.h
@@ -0,0 +1,31 @@
+/* $XFree86: xc/lib/X11/ImUtil.h,v 1.2 2003/04/15 22:10:07 herrb Exp $ */
+
+#ifndef _IMUTIL_H_
+#define _IMUTIL_H_
+
+extern int
+_XGetScanlinePad(
+ Display *dpy,
+ int depth);
+
+extern int
+_XGetBitsPerPixel(
+ Display *dpy,
+ int depth);
+
+extern int
+_XSetImage(
+ XImage *srcimg,
+ register XImage *dstimg,
+ register int x,
+ register int y);
+
+extern int
+_XReverse_Bytes(
+ register unsigned char *bpt,
+ register int nb);
+extern void
+_XInitImageFuncPtrs(
+ register XImage *image);
+
+#endif /* _IMUTIL_H_ */
diff --git a/sysroot/usr/include/X11/Sunkeysym.h b/sysroot/usr/include/X11/Sunkeysym.h
new file mode 100644
index 0000000..e723444
--- /dev/null
+++ b/sysroot/usr/include/X11/Sunkeysym.h
@@ -0,0 +1,112 @@
+/* $Xorg: Sunkeysym.h,v 1.4 2001/02/09 02:03:22 xorgcvs Exp $ */
+
+/************************************************************
+
+Copyright 1991, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1991 by Sun Microsystems, Inc. Mountain View, CA.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this
+software and its documentation for any purpose and without
+fee is hereby granted, provided that the above copyright no-
+tice appear in all copies and that both that copyright no-
+tice and this permission notice appear in supporting docu-
+mentation, and that the name of Sun not be used in
+advertising or publicity pertaining to distribution of the
+software without specific prior written permission. Sun
+makes no representations about the suitability of this
+software for any purpose. It is provided "as is" without any
+express or implied warranty.
+
+SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
+NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI-
+ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
+THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+***********************************************************/
+
+/*
+ * Floating Accent
+ */
+
+#define SunXK_FA_Grave 0x1005FF00
+#define SunXK_FA_Circum 0x1005FF01
+#define SunXK_FA_Tilde 0x1005FF02
+#define SunXK_FA_Acute 0x1005FF03
+#define SunXK_FA_Diaeresis 0x1005FF04
+#define SunXK_FA_Cedilla 0x1005FF05
+
+/*
+ * Miscellaneous Functions
+ */
+
+#define SunXK_F36 0x1005FF10 /* Labeled F11 */
+#define SunXK_F37 0x1005FF11 /* Labeled F12 */
+
+#define SunXK_Sys_Req 0x1005FF60
+#define SunXK_Print_Screen 0x0000FF61 /* Same as XK_Print */
+
+/*
+ * International & Multi-Key Character Composition
+ */
+
+#define SunXK_Compose 0x0000FF20 /* Same as XK_Multi_key */
+#define SunXK_AltGraph 0x0000FF7E /* Same as XK_Mode_switch */
+
+/*
+ * Cursor Control
+ */
+
+#define SunXK_PageUp 0x0000FF55 /* Same as XK_Prior */
+#define SunXK_PageDown 0x0000FF56 /* Same as XK_Next */
+
+/*
+ * Open Look Functions
+ */
+
+#define SunXK_Undo 0x0000FF65 /* Same as XK_Undo */
+#define SunXK_Again 0x0000FF66 /* Same as XK_Redo */
+#define SunXK_Find 0x0000FF68 /* Same as XK_Find */
+#define SunXK_Stop 0x0000FF69 /* Same as XK_Cancel */
+#define SunXK_Props 0x1005FF70
+#define SunXK_Front 0x1005FF71
+#define SunXK_Copy 0x1005FF72
+#define SunXK_Open 0x1005FF73
+#define SunXK_Paste 0x1005FF74
+#define SunXK_Cut 0x1005FF75
+
+#define SunXK_PowerSwitch 0x1005FF76
+#define SunXK_AudioLowerVolume 0x1005FF77
+#define SunXK_AudioMute 0x1005FF78
+#define SunXK_AudioRaiseVolume 0x1005FF79
+#define SunXK_VideoDegauss 0x1005FF7A
+#define SunXK_VideoLowerBrightness 0x1005FF7B
+#define SunXK_VideoRaiseBrightness 0x1005FF7C
+#define SunXK_PowerSwitchShift 0x1005FF7D
diff --git a/sysroot/usr/include/X11/X.h b/sysroot/usr/include/X11/X.h
new file mode 100644
index 0000000..0a9c501
--- /dev/null
+++ b/sysroot/usr/include/X11/X.h
@@ -0,0 +1,721 @@
+/*
+ * $Xorg: X.h,v 1.4 2001/02/09 02:03:22 xorgcvs Exp $
+ */
+
+/* Definitions for the X window system likely to be used by applications */
+
+#ifndef X_H
+#define X_H
+
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************/
+/* $XFree86: xc/include/X.h,v 1.6 2003/07/09 15:27:28 tsi Exp $ */
+
+#define X_PROTOCOL 11 /* current protocol version */
+#define X_PROTOCOL_REVISION 0 /* current minor version */
+
+/* Resources */
+
+/*
+ * _XSERVER64 must ONLY be defined when compiling X server sources on
+ * systems where unsigned long is not 32 bits, must NOT be used in
+ * client or library code.
+ */
+#ifndef _XSERVER64
+# ifndef _XTYPEDEF_XID
+# define _XTYPEDEF_XID
+typedef unsigned long XID;
+# endif
+# ifndef _XTYPEDEF_MASK
+# define _XTYPEDEF_MASK
+typedef unsigned long Mask;
+# endif
+# ifndef _XTYPEDEF_ATOM
+# define _XTYPEDEF_ATOM
+typedef unsigned long Atom; /* Also in Xdefs.h */
+# endif
+typedef unsigned long VisualID;
+typedef unsigned long Time;
+#else
+# include <X11/Xmd.h>
+# ifndef _XTYPEDEF_XID
+# define _XTYPEDEF_XID
+typedef CARD32 XID;
+# endif
+# ifndef _XTYPEDEF_MASK
+# define _XTYPEDEF_MASK
+typedef CARD32 Mask;
+# endif
+# ifndef _XTYPEDEF_ATOM
+# define _XTYPEDEF_ATOM
+typedef CARD32 Atom;
+# endif
+typedef CARD32 VisualID;
+typedef CARD32 Time;
+#endif
+
+typedef XID Window;
+typedef XID Drawable;
+#ifndef _XTYPEDEF_FONT
+# define _XTYPEDEF_FONT
+typedef XID Font;
+#endif
+typedef XID Pixmap;
+typedef XID Cursor;
+typedef XID Colormap;
+typedef XID GContext;
+typedef XID KeySym;
+
+typedef unsigned char KeyCode;
+
+/*****************************************************************
+ * RESERVED RESOURCE AND CONSTANT DEFINITIONS
+ *****************************************************************/
+
+#ifndef None
+#define None 0L /* universal null resource or null atom */
+#endif
+
+#define ParentRelative 1L /* background pixmap in CreateWindow
+ and ChangeWindowAttributes */
+
+#define CopyFromParent 0L /* border pixmap in CreateWindow
+ and ChangeWindowAttributes
+ special VisualID and special window
+ class passed to CreateWindow */
+
+#define PointerWindow 0L /* destination window in SendEvent */
+#define InputFocus 1L /* destination window in SendEvent */
+
+#define PointerRoot 1L /* focus window in SetInputFocus */
+
+#define AnyPropertyType 0L /* special Atom, passed to GetProperty */
+
+#define AnyKey 0L /* special Key Code, passed to GrabKey */
+
+#define AnyButton 0L /* special Button Code, passed to GrabButton */
+
+#define AllTemporary 0L /* special Resource ID passed to KillClient */
+
+#define CurrentTime 0L /* special Time */
+
+#define NoSymbol 0L /* special KeySym */
+
+/*****************************************************************
+ * EVENT DEFINITIONS
+ *****************************************************************/
+
+/* Input Event Masks. Used as event-mask window attribute and as arguments
+ to Grab requests. Not to be confused with event names. */
+
+#define NoEventMask 0L
+#define KeyPressMask (1L<<0)
+#define KeyReleaseMask (1L<<1)
+#define ButtonPressMask (1L<<2)
+#define ButtonReleaseMask (1L<<3)
+#define EnterWindowMask (1L<<4)
+#define LeaveWindowMask (1L<<5)
+#define PointerMotionMask (1L<<6)
+#define PointerMotionHintMask (1L<<7)
+#define Button1MotionMask (1L<<8)
+#define Button2MotionMask (1L<<9)
+#define Button3MotionMask (1L<<10)
+#define Button4MotionMask (1L<<11)
+#define Button5MotionMask (1L<<12)
+#define ButtonMotionMask (1L<<13)
+#define KeymapStateMask (1L<<14)
+#define ExposureMask (1L<<15)
+#define VisibilityChangeMask (1L<<16)
+#define StructureNotifyMask (1L<<17)
+#define ResizeRedirectMask (1L<<18)
+#define SubstructureNotifyMask (1L<<19)
+#define SubstructureRedirectMask (1L<<20)
+#define FocusChangeMask (1L<<21)
+#define PropertyChangeMask (1L<<22)
+#define ColormapChangeMask (1L<<23)
+#define OwnerGrabButtonMask (1L<<24)
+
+/* Event names. Used in "type" field in XEvent structures. Not to be
+confused with event masks above. They start from 2 because 0 and 1
+are reserved in the protocol for errors and replies. */
+
+#define KeyPress 2
+#define KeyRelease 3
+#define ButtonPress 4
+#define ButtonRelease 5
+#define MotionNotify 6
+#define EnterNotify 7
+#define LeaveNotify 8
+#define FocusIn 9
+#define FocusOut 10
+#define KeymapNotify 11
+#define Expose 12
+#define GraphicsExpose 13
+#define NoExpose 14
+#define VisibilityNotify 15
+#define CreateNotify 16
+#define DestroyNotify 17
+#define UnmapNotify 18
+#define MapNotify 19
+#define MapRequest 20
+#define ReparentNotify 21
+#define ConfigureNotify 22
+#define ConfigureRequest 23
+#define GravityNotify 24
+#define ResizeRequest 25
+#define CirculateNotify 26
+#define CirculateRequest 27
+#define PropertyNotify 28
+#define SelectionClear 29
+#define SelectionRequest 30
+#define SelectionNotify 31
+#define ColormapNotify 32
+#define ClientMessage 33
+#define MappingNotify 34
+#define LASTEvent 35 /* must be bigger than any event # */
+
+
+/* Key masks. Used as modifiers to GrabButton and GrabKey, results of QueryPointer,
+ state in various key-, mouse-, and button-related events. */
+
+#define ShiftMask (1<<0)
+#define LockMask (1<<1)
+#define ControlMask (1<<2)
+#define Mod1Mask (1<<3)
+#define Mod2Mask (1<<4)
+#define Mod3Mask (1<<5)
+#define Mod4Mask (1<<6)
+#define Mod5Mask (1<<7)
+
+/* modifier names. Used to build a SetModifierMapping request or
+ to read a GetModifierMapping request. These correspond to the
+ masks defined above. */
+#define ShiftMapIndex 0
+#define LockMapIndex 1
+#define ControlMapIndex 2
+#define Mod1MapIndex 3
+#define Mod2MapIndex 4
+#define Mod3MapIndex 5
+#define Mod4MapIndex 6
+#define Mod5MapIndex 7
+
+
+/* button masks. Used in same manner as Key masks above. Not to be confused
+ with button names below. */
+
+#define Button1Mask (1<<8)
+#define Button2Mask (1<<9)
+#define Button3Mask (1<<10)
+#define Button4Mask (1<<11)
+#define Button5Mask (1<<12)
+
+#define AnyModifier (1<<15) /* used in GrabButton, GrabKey */
+
+
+/* button names. Used as arguments to GrabButton and as detail in ButtonPress
+ and ButtonRelease events. Not to be confused with button masks above.
+ Note that 0 is already defined above as "AnyButton". */
+
+#define Button1 1
+#define Button2 2
+#define Button3 3
+#define Button4 4
+#define Button5 5
+
+/* Notify modes */
+
+#define NotifyNormal 0
+#define NotifyGrab 1
+#define NotifyUngrab 2
+#define NotifyWhileGrabbed 3
+
+#define NotifyHint 1 /* for MotionNotify events */
+
+/* Notify detail */
+
+#define NotifyAncestor 0
+#define NotifyVirtual 1
+#define NotifyInferior 2
+#define NotifyNonlinear 3
+#define NotifyNonlinearVirtual 4
+#define NotifyPointer 5
+#define NotifyPointerRoot 6
+#define NotifyDetailNone 7
+
+/* Visibility notify */
+
+#define VisibilityUnobscured 0
+#define VisibilityPartiallyObscured 1
+#define VisibilityFullyObscured 2
+
+/* Circulation request */
+
+#define PlaceOnTop 0
+#define PlaceOnBottom 1
+
+/* protocol families */
+
+#define FamilyInternet 0 /* IPv4 */
+#define FamilyDECnet 1
+#define FamilyChaos 2
+#define FamilyInternet6 6 /* IPv6 */
+
+/* authentication families not tied to a specific protocol */
+#define FamilyServerInterpreted 5
+
+/* Property notification */
+
+#define PropertyNewValue 0
+#define PropertyDelete 1
+
+/* Color Map notification */
+
+#define ColormapUninstalled 0
+#define ColormapInstalled 1
+
+/* GrabPointer, GrabButton, GrabKeyboard, GrabKey Modes */
+
+#define GrabModeSync 0
+#define GrabModeAsync 1
+
+/* GrabPointer, GrabKeyboard reply status */
+
+#define GrabSuccess 0
+#define AlreadyGrabbed 1
+#define GrabInvalidTime 2
+#define GrabNotViewable 3
+#define GrabFrozen 4
+
+/* AllowEvents modes */
+
+#define AsyncPointer 0
+#define SyncPointer 1
+#define ReplayPointer 2
+#define AsyncKeyboard 3
+#define SyncKeyboard 4
+#define ReplayKeyboard 5
+#define AsyncBoth 6
+#define SyncBoth 7
+
+/* Used in SetInputFocus, GetInputFocus */
+
+#define RevertToNone (int)None
+#define RevertToPointerRoot (int)PointerRoot
+#define RevertToParent 2
+
+/*****************************************************************
+ * ERROR CODES
+ *****************************************************************/
+
+#define Success 0 /* everything's okay */
+#define BadRequest 1 /* bad request code */
+#define BadValue 2 /* int parameter out of range */
+#define BadWindow 3 /* parameter not a Window */
+#define BadPixmap 4 /* parameter not a Pixmap */
+#define BadAtom 5 /* parameter not an Atom */
+#define BadCursor 6 /* parameter not a Cursor */
+#define BadFont 7 /* parameter not a Font */
+#define BadMatch 8 /* parameter mismatch */
+#define BadDrawable 9 /* parameter not a Pixmap or Window */
+#define BadAccess 10 /* depending on context:
+ - key/button already grabbed
+ - attempt to free an illegal
+ cmap entry
+ - attempt to store into a read-only
+ color map entry.
+ - attempt to modify the access control
+ list from other than the local host.
+ */
+#define BadAlloc 11 /* insufficient resources */
+#define BadColor 12 /* no such colormap */
+#define BadGC 13 /* parameter not a GC */
+#define BadIDChoice 14 /* choice not in range or already used */
+#define BadName 15 /* font or color name doesn't exist */
+#define BadLength 16 /* Request length incorrect */
+#define BadImplementation 17 /* server is defective */
+
+#define FirstExtensionError 128
+#define LastExtensionError 255
+
+/*****************************************************************
+ * WINDOW DEFINITIONS
+ *****************************************************************/
+
+/* Window classes used by CreateWindow */
+/* Note that CopyFromParent is already defined as 0 above */
+
+#define InputOutput 1
+#define InputOnly 2
+
+/* Window attributes for CreateWindow and ChangeWindowAttributes */
+
+#define CWBackPixmap (1L<<0)
+#define CWBackPixel (1L<<1)
+#define CWBorderPixmap (1L<<2)
+#define CWBorderPixel (1L<<3)
+#define CWBitGravity (1L<<4)
+#define CWWinGravity (1L<<5)
+#define CWBackingStore (1L<<6)
+#define CWBackingPlanes (1L<<7)
+#define CWBackingPixel (1L<<8)
+#define CWOverrideRedirect (1L<<9)
+#define CWSaveUnder (1L<<10)
+#define CWEventMask (1L<<11)
+#define CWDontPropagate (1L<<12)
+#define CWColormap (1L<<13)
+#define CWCursor (1L<<14)
+
+/* ConfigureWindow structure */
+
+#define CWX (1<<0)
+#define CWY (1<<1)
+#define CWWidth (1<<2)
+#define CWHeight (1<<3)
+#define CWBorderWidth (1<<4)
+#define CWSibling (1<<5)
+#define CWStackMode (1<<6)
+
+
+/* Bit Gravity */
+
+#define ForgetGravity 0
+#define NorthWestGravity 1
+#define NorthGravity 2
+#define NorthEastGravity 3
+#define WestGravity 4
+#define CenterGravity 5
+#define EastGravity 6
+#define SouthWestGravity 7
+#define SouthGravity 8
+#define SouthEastGravity 9
+#define StaticGravity 10
+
+/* Window gravity + bit gravity above */
+
+#define UnmapGravity 0
+
+/* Used in CreateWindow for backing-store hint */
+
+#define NotUseful 0
+#define WhenMapped 1
+#define Always 2
+
+/* Used in GetWindowAttributes reply */
+
+#define IsUnmapped 0
+#define IsUnviewable 1
+#define IsViewable 2
+
+/* Used in ChangeSaveSet */
+
+#define SetModeInsert 0
+#define SetModeDelete 1
+
+/* Used in ChangeCloseDownMode */
+
+#define DestroyAll 0
+#define RetainPermanent 1
+#define RetainTemporary 2
+
+/* Window stacking method (in configureWindow) */
+
+#define Above 0
+#define Below 1
+#define TopIf 2
+#define BottomIf 3
+#define Opposite 4
+
+/* Circulation direction */
+
+#define RaiseLowest 0
+#define LowerHighest 1
+
+/* Property modes */
+
+#define PropModeReplace 0
+#define PropModePrepend 1
+#define PropModeAppend 2
+
+/*****************************************************************
+ * GRAPHICS DEFINITIONS
+ *****************************************************************/
+
+/* graphics functions, as in GC.alu */
+
+#define GXclear 0x0 /* 0 */
+#define GXand 0x1 /* src AND dst */
+#define GXandReverse 0x2 /* src AND NOT dst */
+#define GXcopy 0x3 /* src */
+#define GXandInverted 0x4 /* NOT src AND dst */
+#define GXnoop 0x5 /* dst */
+#define GXxor 0x6 /* src XOR dst */
+#define GXor 0x7 /* src OR dst */
+#define GXnor 0x8 /* NOT src AND NOT dst */
+#define GXequiv 0x9 /* NOT src XOR dst */
+#define GXinvert 0xa /* NOT dst */
+#define GXorReverse 0xb /* src OR NOT dst */
+#define GXcopyInverted 0xc /* NOT src */
+#define GXorInverted 0xd /* NOT src OR dst */
+#define GXnand 0xe /* NOT src OR NOT dst */
+#define GXset 0xf /* 1 */
+
+/* LineStyle */
+
+#define LineSolid 0
+#define LineOnOffDash 1
+#define LineDoubleDash 2
+
+/* capStyle */
+
+#define CapNotLast 0
+#define CapButt 1
+#define CapRound 2
+#define CapProjecting 3
+
+/* joinStyle */
+
+#define JoinMiter 0
+#define JoinRound 1
+#define JoinBevel 2
+
+/* fillStyle */
+
+#define FillSolid 0
+#define FillTiled 1
+#define FillStippled 2
+#define FillOpaqueStippled 3
+
+/* fillRule */
+
+#define EvenOddRule 0
+#define WindingRule 1
+
+/* subwindow mode */
+
+#define ClipByChildren 0
+#define IncludeInferiors 1
+
+/* SetClipRectangles ordering */
+
+#define Unsorted 0
+#define YSorted 1
+#define YXSorted 2
+#define YXBanded 3
+
+/* CoordinateMode for drawing routines */
+
+#define CoordModeOrigin 0 /* relative to the origin */
+#define CoordModePrevious 1 /* relative to previous point */
+
+/* Polygon shapes */
+
+#define Complex 0 /* paths may intersect */
+#define Nonconvex 1 /* no paths intersect, but not convex */
+#define Convex 2 /* wholly convex */
+
+/* Arc modes for PolyFillArc */
+
+#define ArcChord 0 /* join endpoints of arc */
+#define ArcPieSlice 1 /* join endpoints to center of arc */
+
+/* GC components: masks used in CreateGC, CopyGC, ChangeGC, OR'ed into
+ GC.stateChanges */
+
+#define GCFunction (1L<<0)
+#define GCPlaneMask (1L<<1)
+#define GCForeground (1L<<2)
+#define GCBackground (1L<<3)
+#define GCLineWidth (1L<<4)
+#define GCLineStyle (1L<<5)
+#define GCCapStyle (1L<<6)
+#define GCJoinStyle (1L<<7)
+#define GCFillStyle (1L<<8)
+#define GCFillRule (1L<<9)
+#define GCTile (1L<<10)
+#define GCStipple (1L<<11)
+#define GCTileStipXOrigin (1L<<12)
+#define GCTileStipYOrigin (1L<<13)
+#define GCFont (1L<<14)
+#define GCSubwindowMode (1L<<15)
+#define GCGraphicsExposures (1L<<16)
+#define GCClipXOrigin (1L<<17)
+#define GCClipYOrigin (1L<<18)
+#define GCClipMask (1L<<19)
+#define GCDashOffset (1L<<20)
+#define GCDashList (1L<<21)
+#define GCArcMode (1L<<22)
+
+#define GCLastBit 22
+/*****************************************************************
+ * FONTS
+ *****************************************************************/
+
+/* used in QueryFont -- draw direction */
+
+#define FontLeftToRight 0
+#define FontRightToLeft 1
+
+#define FontChange 255
+
+/*****************************************************************
+ * IMAGING
+ *****************************************************************/
+
+/* ImageFormat -- PutImage, GetImage */
+
+#define XYBitmap 0 /* depth 1, XYFormat */
+#define XYPixmap 1 /* depth == drawable depth */
+#define ZPixmap 2 /* depth == drawable depth */
+
+/*****************************************************************
+ * COLOR MAP STUFF
+ *****************************************************************/
+
+/* For CreateColormap */
+
+#define AllocNone 0 /* create map with no entries */
+#define AllocAll 1 /* allocate entire map writeable */
+
+
+/* Flags used in StoreNamedColor, StoreColors */
+
+#define DoRed (1<<0)
+#define DoGreen (1<<1)
+#define DoBlue (1<<2)
+
+/*****************************************************************
+ * CURSOR STUFF
+ *****************************************************************/
+
+/* QueryBestSize Class */
+
+#define CursorShape 0 /* largest size that can be displayed */
+#define TileShape 1 /* size tiled fastest */
+#define StippleShape 2 /* size stippled fastest */
+
+/*****************************************************************
+ * KEYBOARD/POINTER STUFF
+ *****************************************************************/
+
+#define AutoRepeatModeOff 0
+#define AutoRepeatModeOn 1
+#define AutoRepeatModeDefault 2
+
+#define LedModeOff 0
+#define LedModeOn 1
+
+/* masks for ChangeKeyboardControl */
+
+#define KBKeyClickPercent (1L<<0)
+#define KBBellPercent (1L<<1)
+#define KBBellPitch (1L<<2)
+#define KBBellDuration (1L<<3)
+#define KBLed (1L<<4)
+#define KBLedMode (1L<<5)
+#define KBKey (1L<<6)
+#define KBAutoRepeatMode (1L<<7)
+
+#define MappingSuccess 0
+#define MappingBusy 1
+#define MappingFailed 2
+
+#define MappingModifier 0
+#define MappingKeyboard 1
+#define MappingPointer 2
+
+/*****************************************************************
+ * SCREEN SAVER STUFF
+ *****************************************************************/
+
+#define DontPreferBlanking 0
+#define PreferBlanking 1
+#define DefaultBlanking 2
+
+#define DisableScreenSaver 0
+#define DisableScreenInterval 0
+
+#define DontAllowExposures 0
+#define AllowExposures 1
+#define DefaultExposures 2
+
+/* for ForceScreenSaver */
+
+#define ScreenSaverReset 0
+#define ScreenSaverActive 1
+
+/*****************************************************************
+ * HOSTS AND CONNECTIONS
+ *****************************************************************/
+
+/* for ChangeHosts */
+
+#define HostInsert 0
+#define HostDelete 1
+
+/* for ChangeAccessControl */
+
+#define EnableAccess 1
+#define DisableAccess 0
+
+/* Display classes used in opening the connection
+ * Note that the statically allocated ones are even numbered and the
+ * dynamically changeable ones are odd numbered */
+
+#define StaticGray 0
+#define GrayScale 1
+#define StaticColor 2
+#define PseudoColor 3
+#define TrueColor 4
+#define DirectColor 5
+
+
+/* Byte order used in imageByteOrder and bitmapBitOrder */
+
+#define LSBFirst 0
+#define MSBFirst 1
+
+#endif /* X_H */
diff --git a/sysroot/usr/include/X11/XF86keysym.h b/sysroot/usr/include/X11/XF86keysym.h
new file mode 100644
index 0000000..fb0ee67
--- /dev/null
+++ b/sysroot/usr/include/X11/XF86keysym.h
@@ -0,0 +1,205 @@
+/* $XFree86: xc/include/XF86keysym.h,v 1.16 2003/02/11 02:51:10 dawes Exp $ */
+
+/*
+ * XFree86 vendor specific keysyms.
+ *
+ * The XFree86 keysym range is 0x10080001 - 0x1008FFFF.
+ *
+ * When adding new entries, the xc/lib/XKeysymDB file should also be
+ * updated to make the new entries visible to Xlib.
+ */
+
+/*
+ * ModeLock
+ *
+ * This one is old, and not really used any more since XKB offers this
+ * functionality.
+ */
+
+#define XF86XK_ModeLock 0x1008FF01 /* Mode Switch Lock */
+
+/*
+ * Note, 0x1008FF07 - 0x1008FF0F are free and should be used for misc new
+ * keysyms that don't fit into any of the groups below.
+ *
+ * 0x1008FF64, 0x1008FF6F, 0x1008FF71, 0x1008FF83 are no longer used,
+ * and should be used first for new keysyms.
+ *
+ * Check in keysymdef.h for generic symbols before adding new XFree86-specific
+ * symbols here.
+ *
+ * X.Org will not be adding to the XF86 set of keysyms, though they have
+ * been adopted and are considered a "standard" part of X keysym definitions.
+ * XFree86 never properly commented these keysyms, so we have done our
+ * best to explain the semantic meaning of these keys.
+ *
+ * XFree86 has removed their mail archives of the period, that might have
+ * shed more light on some of these definitions. Until/unless we resurrect
+ * these archives, these are from memory and usage.
+ */
+
+
+/* Backlight controls. */
+#define XF86XK_MonBrightnessUp 0x1008FF02 /* Monitor/panel brightness */
+#define XF86XK_MonBrightnessDown 0x1008FF03 /* Monitor/panel brightness */
+#define XF86XK_KbdLightOnOff 0x1008FF04 /* Keyboards may be lit */
+#define XF86XK_KbdBrightnessUp 0x1008FF05 /* Keyboards may be lit */
+#define XF86XK_KbdBrightnessDown 0x1008FF06 /* Keyboards may be lit */
+
+/*
+ * Keys found on some "Internet" keyboards.
+ */
+#define XF86XK_Standby 0x1008FF10 /* System into standby mode */
+#define XF86XK_AudioLowerVolume 0x1008FF11 /* Volume control down */
+#define XF86XK_AudioMute 0x1008FF12 /* Mute sound from the system */
+#define XF86XK_AudioRaiseVolume 0x1008FF13 /* Volume control up */
+#define XF86XK_AudioPlay 0x1008FF14 /* Start playing of audio > */
+#define XF86XK_AudioStop 0x1008FF15 /* Stop playing audio */
+#define XF86XK_AudioPrev 0x1008FF16 /* Previous track */
+#define XF86XK_AudioNext 0x1008FF17 /* Next track */
+#define XF86XK_HomePage 0x1008FF18 /* Display user's home page */
+#define XF86XK_Mail 0x1008FF19 /* Invoke user's mail program */
+#define XF86XK_Start 0x1008FF1A /* Start application */
+#define XF86XK_Search 0x1008FF1B /* Search */
+#define XF86XK_AudioRecord 0x1008FF1C /* Record audio application */
+
+/* These are sometimes found on PDA's (e.g. Palm, PocketPC or elsewhere) */
+#define XF86XK_Calculator 0x1008FF1D /* Invoke calculator program */
+#define XF86XK_Memo 0x1008FF1E /* Invoke Memo taking program */
+#define XF86XK_ToDoList 0x1008FF1F /* Invoke To Do List program */
+#define XF86XK_Calendar 0x1008FF20 /* Invoke Calendar program */
+#define XF86XK_PowerDown 0x1008FF21 /* Deep sleep the system */
+#define XF86XK_ContrastAdjust 0x1008FF22 /* Adjust screen contrast */
+#define XF86XK_RockerUp 0x1008FF23 /* Rocker switches exist up */
+#define XF86XK_RockerDown 0x1008FF24 /* and down */
+#define XF86XK_RockerEnter 0x1008FF25 /* and let you press them */
+
+/* Some more "Internet" keyboard symbols */
+#define XF86XK_Back 0x1008FF26 /* Like back on a browser */
+#define XF86XK_Forward 0x1008FF27 /* Like forward on a browser */
+#define XF86XK_Stop 0x1008FF28 /* Stop current operation */
+#define XF86XK_Refresh 0x1008FF29 /* Refresh the page */
+#define XF86XK_PowerOff 0x1008FF2A /* Power off system entirely */
+#define XF86XK_WakeUp 0x1008FF2B /* Wake up system from sleep */
+#define XF86XK_Eject 0x1008FF2C /* Eject device (e.g. DVD) */
+#define XF86XK_ScreenSaver 0x1008FF2D /* Invoke screensaver */
+#define XF86XK_WWW 0x1008FF2E /* Invoke web browser */
+#define XF86XK_Sleep 0x1008FF2F /* Put system to sleep */
+#define XF86XK_Favorites 0x1008FF30 /* Show favorite locations */
+#define XF86XK_AudioPause 0x1008FF31 /* Pause audio playing */
+#define XF86XK_AudioMedia 0x1008FF32 /* Launch media collection app */
+#define XF86XK_MyComputer 0x1008FF33 /* Display "My Computer" window */
+#define XF86XK_VendorHome 0x1008FF34 /* Display vendor home web site */
+#define XF86XK_LightBulb 0x1008FF35 /* Light bulb keys exist */
+#define XF86XK_Shop 0x1008FF36 /* Display shopping web site */
+#define XF86XK_History 0x1008FF37 /* Show history of web surfing */
+#define XF86XK_OpenURL 0x1008FF38 /* Open selected URL */
+#define XF86XK_AddFavorite 0x1008FF39 /* Add URL to favorites list */
+#define XF86XK_HotLinks 0x1008FF3A /* Show "hot" links */
+#define XF86XK_BrightnessAdjust 0x1008FF3B /* Invoke brightness adj. UI */
+#define XF86XK_Finance 0x1008FF3C /* Display financial site */
+#define XF86XK_Community 0x1008FF3D /* Display user's community */
+#define XF86XK_AudioRewind 0x1008FF3E /* "rewind" audio track */
+#define XF86XK_XF86BackForward 0x1008FF3F /* ??? */
+#define XF86XK_Launch0 0x1008FF40 /* Launch Application */
+#define XF86XK_Launch1 0x1008FF41 /* Launch Application */
+#define XF86XK_Launch2 0x1008FF42 /* Launch Application */
+#define XF86XK_Launch3 0x1008FF43 /* Launch Application */
+#define XF86XK_Launch4 0x1008FF44 /* Launch Application */
+#define XF86XK_Launch5 0x1008FF45 /* Launch Application */
+#define XF86XK_Launch6 0x1008FF46 /* Launch Application */
+#define XF86XK_Launch7 0x1008FF47 /* Launch Application */
+#define XF86XK_Launch8 0x1008FF48 /* Launch Application */
+#define XF86XK_Launch9 0x1008FF49 /* Launch Application */
+#define XF86XK_LaunchA 0x1008FF4A /* Launch Application */
+#define XF86XK_LaunchB 0x1008FF4B /* Launch Application */
+#define XF86XK_LaunchC 0x1008FF4C /* Launch Application */
+#define XF86XK_LaunchD 0x1008FF4D /* Launch Application */
+#define XF86XK_LaunchE 0x1008FF4E /* Launch Application */
+#define XF86XK_LaunchF 0x1008FF4F /* Launch Application */
+
+#define XF86XK_ApplicationLeft 0x1008FF50 /* switch to application, left */
+#define XF86XK_ApplicationRight 0x1008FF51 /* switch to application, right*/
+#define XF86XK_Book 0x1008FF52 /* Launch bookreader */
+#define XF86XK_CD 0x1008FF53 /* Launch CD/DVD player */
+#define XF86XK_Calculater 0x1008FF54 /* Launch Calculater */
+#define XF86XK_Clear 0x1008FF55 /* Clear window, screen */
+#define XF86XK_Close 0x1008FF56 /* Close window */
+#define XF86XK_Copy 0x1008FF57 /* Copy selection */
+#define XF86XK_Cut 0x1008FF58 /* Cut selection */
+#define XF86XK_Display 0x1008FF59 /* Output switch key */
+#define XF86XK_DOS 0x1008FF5A /* Launch DOS (emulation) */
+#define XF86XK_Documents 0x1008FF5B /* Open documents window */
+#define XF86XK_Excel 0x1008FF5C /* Launch spread sheet */
+#define XF86XK_Explorer 0x1008FF5D /* Launch file explorer */
+#define XF86XK_Game 0x1008FF5E /* Launch game */
+#define XF86XK_Go 0x1008FF5F /* Go to URL */
+#define XF86XK_iTouch 0x1008FF60 /* Logitch iTouch- don't use */
+#define XF86XK_LogOff 0x1008FF61 /* Log off system */
+#define XF86XK_Market 0x1008FF62 /* ?? */
+#define XF86XK_Meeting 0x1008FF63 /* enter meeting in calendar */
+#define XF86XK_MenuKB 0x1008FF65 /* distingush keyboard from PB */
+#define XF86XK_MenuPB 0x1008FF66 /* distinuish PB from keyboard */
+#define XF86XK_MySites 0x1008FF67 /* Favourites */
+#define XF86XK_New 0x1008FF68 /* New (folder, document... */
+#define XF86XK_News 0x1008FF69 /* News */
+#define XF86XK_OfficeHome 0x1008FF6A /* Office home (old Staroffice)*/
+#define XF86XK_Open 0x1008FF6B /* Open */
+#define XF86XK_Option 0x1008FF6C /* ?? */
+#define XF86XK_Paste 0x1008FF6D /* Paste */
+#define XF86XK_Phone 0x1008FF6E /* Launch phone; dial number */
+#define XF86XK_Q 0x1008FF70 /* Compaq's Q - don't use */
+#define XF86XK_Reply 0x1008FF72 /* Reply e.g., mail */
+#define XF86XK_Reload 0x1008FF73 /* Reload web page, file, etc. */
+#define XF86XK_RotateWindows 0x1008FF74 /* Rotate windows e.g. xrandr */
+#define XF86XK_RotationPB 0x1008FF75 /* don't use */
+#define XF86XK_RotationKB 0x1008FF76 /* don't use */
+#define XF86XK_Save 0x1008FF77 /* Save (file, document, state */
+#define XF86XK_ScrollUp 0x1008FF78 /* Scroll window/contents up */
+#define XF86XK_ScrollDown 0x1008FF79 /* Scrool window/contentd down */
+#define XF86XK_ScrollClick 0x1008FF7A /* Use XKB mousekeys instead */
+#define XF86XK_Send 0x1008FF7B /* Send mail, file, object */
+#define XF86XK_Spell 0x1008FF7C /* Spell checker */
+#define XF86XK_SplitScreen 0x1008FF7D /* Split window or screen */
+#define XF86XK_Support 0x1008FF7E /* Get support (??) */
+#define XF86XK_TaskPane 0x1008FF7F /* Show tasks */
+#define XF86XK_Terminal 0x1008FF80 /* Launch terminal emulator */
+#define XF86XK_Tools 0x1008FF81 /* toolbox of desktop/app. */
+#define XF86XK_Travel 0x1008FF82 /* ?? */
+#define XF86XK_UserPB 0x1008FF84 /* ?? */
+#define XF86XK_User1KB 0x1008FF85 /* ?? */
+#define XF86XK_User2KB 0x1008FF86 /* ?? */
+#define XF86XK_Video 0x1008FF87 /* Launch video player */
+#define XF86XK_WheelButton 0x1008FF88 /* button from a mouse wheel */
+#define XF86XK_Word 0x1008FF89 /* Launch word processor */
+#define XF86XK_Xfer 0x1008FF8A
+#define XF86XK_ZoomIn 0x1008FF8B /* zoom in view, map, etc. */
+#define XF86XK_ZoomOut 0x1008FF8C /* zoom out view, map, etc. */
+
+#define XF86XK_Away 0x1008FF8D /* mark yourself as away */
+#define XF86XK_Messenger 0x1008FF8E /* as in instant messaging */
+#define XF86XK_WebCam 0x1008FF8F /* Launch web camera app. */
+#define XF86XK_MailForward 0x1008FF90 /* Forward in mail */
+#define XF86XK_Pictures 0x1008FF91 /* Show pictures */
+#define XF86XK_Music 0x1008FF92 /* Launch music application */
+
+/* Keys for special action keys (hot keys) */
+/* Virtual terminals on some operating systems */
+#define XF86XK_Switch_VT_1 0x1008FE01
+#define XF86XK_Switch_VT_2 0x1008FE02
+#define XF86XK_Switch_VT_3 0x1008FE03
+#define XF86XK_Switch_VT_4 0x1008FE04
+#define XF86XK_Switch_VT_5 0x1008FE05
+#define XF86XK_Switch_VT_6 0x1008FE06
+#define XF86XK_Switch_VT_7 0x1008FE07
+#define XF86XK_Switch_VT_8 0x1008FE08
+#define XF86XK_Switch_VT_9 0x1008FE09
+#define XF86XK_Switch_VT_10 0x1008FE0A
+#define XF86XK_Switch_VT_11 0x1008FE0B
+#define XF86XK_Switch_VT_12 0x1008FE0C
+
+#define XF86XK_Ungrab 0x1008FE20 /* force ungrab */
+#define XF86XK_ClearGrab 0x1008FE21 /* kill application with grab */
+#define XF86XK_Next_VMode 0x1008FE22 /* next video mode available */
+#define XF86XK_Prev_VMode 0x1008FE23 /* prev. video mode available */
+
diff --git a/sysroot/usr/include/X11/XKBlib.h b/sysroot/usr/include/X11/XKBlib.h
new file mode 100644
index 0000000..6a5dc8a
--- /dev/null
+++ b/sysroot/usr/include/X11/XKBlib.h
@@ -0,0 +1,1151 @@
+/* $Xorg: XKBlib.h,v 1.6 2000/08/17 19:45:03 cpqbld Exp $ */
+/************************************************************
+Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
+
+Permission to use, copy, modify, and distribute this
+software and its documentation for any purpose and without
+fee is hereby granted, provided that the above copyright
+notice appear in all copies and that both that copyright
+notice and this permission notice appear in supporting
+documentation, and that the name of Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
+of the software without specific prior written permission.
+Silicon Graphics makes no representation about the suitability
+of this software for any purpose. It is provided "as is"
+without any express or implied warranty.
+
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
+THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+********************************************************/
+/* $XFree86: xc/lib/X11/XKBlib.h,v 3.5 2003/04/17 02:06:31 dawes Exp $ */
+
+#ifndef _XKBLIB_H_
+#define _XKBLIB_H_
+
+#include <X11/Xlib.h>
+#include <X11/extensions/XKBstr.h>
+
+typedef struct _XkbAnyEvent {
+ int type; /* XkbAnyEvent */
+ unsigned long serial; /* # of last req processed by server */
+ Bool send_event; /* is this from a SendEvent request? */
+ Display * display; /* Display the event was read from */
+ Time time; /* milliseconds */
+ int xkb_type; /* XKB event minor code */
+ unsigned int device; /* device ID */
+} XkbAnyEvent;
+
+typedef struct _XkbNewKeyboardNotify {
+ int type; /* XkbAnyEvent */
+ unsigned long serial; /* of last req processed by server */
+ Bool send_event; /* is this from a SendEvent request? */
+ Display * display; /* Display the event was read from */
+ Time time; /* milliseconds */
+ int xkb_type; /* XkbNewKeyboardNotify */
+ int device; /* device ID */
+ int old_device; /* device ID of previous keyboard */
+ int min_key_code; /* minimum key code */
+ int max_key_code; /* maximum key code */
+ int old_min_key_code;/* min key code of previous kbd */
+ int old_max_key_code;/* max key code of previous kbd */
+ unsigned int changed; /* changed aspects of the keyboard */
+ char req_major; /* major and minor opcode of req */
+ char req_minor; /* that caused change, if applicable */
+} XkbNewKeyboardNotifyEvent;
+
+typedef struct _XkbMapNotifyEvent {
+ int type; /* XkbAnyEvent */
+ unsigned long serial; /* of last req processed by server */
+ Bool send_event; /* is this from a SendEvent request */
+ Display * display; /* Display the event was read from */
+ Time time; /* milliseconds */
+ int xkb_type; /* XkbMapNotify */
+ int device; /* device ID */
+ unsigned int changed; /* fields which have been changed */
+ unsigned int flags; /* reserved */
+ int first_type; /* first changed key type */
+ int num_types; /* number of changed key types */
+ KeyCode min_key_code;
+ KeyCode max_key_code;
+ KeyCode first_key_sym;
+ KeyCode first_key_act;
+ KeyCode first_key_behavior;
+ KeyCode first_key_explicit;
+ KeyCode first_modmap_key;
+ KeyCode first_vmodmap_key;
+ int num_key_syms;
+ int num_key_acts;
+ int num_key_behaviors;
+ int num_key_explicit;
+ int num_modmap_keys;
+ int num_vmodmap_keys;
+ unsigned int vmods; /* mask of changed virtual mods */
+} XkbMapNotifyEvent;
+
+typedef struct _XkbStateNotifyEvent {
+ int type; /* XkbAnyEvent */
+ unsigned long serial; /* # of last req processed by server */
+ Bool send_event; /* is this from a SendEvent request? */
+ Display * display; /* Display the event was read from */
+ Time time; /* milliseconds */
+ int xkb_type; /* XkbStateNotify */
+ int device; /* device ID */
+ unsigned int changed; /* mask of changed state components */
+ int group; /* keyboard group */
+ int base_group; /* base keyboard group */
+ int latched_group; /* latched keyboard group */
+ int locked_group; /* locked keyboard group */
+ unsigned int mods; /* modifier state */
+ unsigned int base_mods; /* base modifier state */
+ unsigned int latched_mods; /* latched modifiers */
+ unsigned int locked_mods; /* locked modifiers */
+ int compat_state; /* compatibility state */
+ unsigned char grab_mods; /* mods used for grabs */
+ unsigned char compat_grab_mods;/* grab mods for non-XKB clients */
+ unsigned char lookup_mods; /* mods sent to clients */
+ unsigned char compat_lookup_mods; /* mods sent to non-XKB clients */
+ int ptr_buttons; /* pointer button state */
+ KeyCode keycode; /* keycode that caused the change */
+ char event_type; /* KeyPress or KeyRelease */
+ char req_major; /* Major opcode of request */
+ char req_minor; /* Minor opcode of request */
+} XkbStateNotifyEvent;
+
+typedef struct _XkbControlsNotify {
+ int type; /* XkbAnyEvent */
+ unsigned long serial; /* of last req processed by server */
+ Bool send_event; /* is this from a SendEvent request? */
+ Display * display; /* Display the event was read from */
+ Time time; /* milliseconds */
+ int xkb_type; /* XkbControlsNotify */
+ int device; /* device ID */
+ unsigned int changed_ctrls; /* controls with changed sub-values */
+ unsigned int enabled_ctrls; /* controls currently enabled */
+ unsigned int enabled_ctrl_changes;/* controls just {en,dis}abled */
+ int num_groups; /* total groups on keyboard */
+ KeyCode keycode; /* key that caused change or 0 */
+ char event_type; /* type of event that caused change */
+ char req_major; /* if keycode==0, major and minor */
+ char req_minor; /* opcode of req that caused change */
+} XkbControlsNotifyEvent;
+
+typedef struct _XkbIndicatorNotify {
+ int type; /* XkbAnyEvent */
+ unsigned long serial; /* of last req processed by server */
+ Bool send_event; /* is this from a SendEvent request? */
+ Display * display; /* Display the event was read from */
+ Time time; /* milliseconds */
+ int xkb_type; /* XkbIndicatorNotify */
+ int device; /* device ID */
+ unsigned int changed; /* indicators with new state or map */
+ unsigned int state; /* current state of all indicators */
+} XkbIndicatorNotifyEvent;
+
+typedef struct _XkbNamesNotify {
+ int type; /* XkbAnyEvent */
+ unsigned long serial; /* of last req processed by server */
+ Bool send_event; /* is this from a SendEvent request? */
+ Display * display; /* Display the event was read from */
+ Time time; /* milliseconds */
+ int xkb_type; /* XkbNamesNotify */
+ int device; /* device ID */
+ unsigned int changed; /* names that have changed */
+ int first_type; /* first key type with new name */
+ int num_types; /* number of key types with new names */
+ int first_lvl; /* first key type new new level names */
+ int num_lvls; /* # of key types w/new level names */
+ int num_aliases; /* total number of key aliases*/
+ int num_radio_groups;/* total number of radio groups */
+ unsigned int changed_vmods; /* virtual modifiers with new names */
+ unsigned int changed_groups; /* groups with new names */
+ unsigned int changed_indicators;/* indicators with new names */
+ int first_key; /* first key with new name */
+ int num_keys; /* number of keys with new names */
+} XkbNamesNotifyEvent;
+
+typedef struct _XkbCompatMapNotify {
+ int type; /* XkbAnyEvent */
+ unsigned long serial; /* of last req processed by server */
+ Bool send_event; /* is this from a SendEvent request? */
+ Display * display; /* Display the event was read from */
+ Time time; /* milliseconds */
+ int xkb_type; /* XkbCompatMapNotify */
+ int device; /* device ID */
+ unsigned int changed_groups; /* groups with new compat maps */
+ int first_si; /* first new symbol interp */
+ int num_si; /* number of new symbol interps */
+ int num_total_si; /* total # of symbol interps */
+} XkbCompatMapNotifyEvent;
+
+typedef struct _XkbBellNotify {
+ int type; /* XkbAnyEvent */
+ unsigned long serial; /* of last req processed by server */
+ Bool send_event; /* is this from a SendEvent request? */
+ Display * display; /* Display the event was read from */
+ Time time; /* milliseconds */
+ int xkb_type; /* XkbBellNotify */
+ int device; /* device ID */
+ int percent; /* requested volume as a % of maximum */
+ int pitch; /* requested pitch in Hz */
+ int duration; /* requested duration in useconds */
+ int bell_class; /* (input extension) feedback class */
+ int bell_id; /* (input extension) ID of feedback */
+ Atom name; /* "name" of requested bell */
+ Window window; /* window associated with event */
+ Bool event_only; /* "event only" requested */
+} XkbBellNotifyEvent;
+
+typedef struct _XkbActionMessage {
+ int type; /* XkbAnyEvent */
+ unsigned long serial; /* of last req processed by server */
+ Bool send_event; /* is this from a SendEvent request? */
+ Display * display; /* Display the event was read from */
+ Time time; /* milliseconds */
+ int xkb_type; /* XkbActionMessage */
+ int device; /* device ID */
+ KeyCode keycode; /* key that generated the event */
+ Bool press; /* true if act caused by key press */
+ Bool key_event_follows;/* true if key event also generated */
+ int group; /* effective group */
+ unsigned int mods; /* effective mods */
+ char message[XkbActionMessageLength+1];
+ /* message -- leave space for NUL */
+} XkbActionMessageEvent;
+
+typedef struct _XkbAccessXNotify {
+ int type; /* XkbAnyEvent */
+ unsigned long serial; /* of last req processed by server */
+ Bool send_event; /* is this from a SendEvent request? */
+ Display * display; /* Display the event was read from */
+ Time time; /* milliseconds */
+ int xkb_type; /* XkbAccessXNotify */
+ int device; /* device ID */
+ int detail; /* XkbAXN_* */
+ int keycode; /* key of event */
+ int sk_delay; /* current slow keys delay */
+ int debounce_delay; /* current debounce delay */
+} XkbAccessXNotifyEvent;
+
+typedef struct _XkbExtensionDeviceNotify {
+ int type; /* XkbAnyEvent */
+ unsigned long serial; /* of last req processed by server */
+ Bool send_event; /* is this from a SendEvent request? */
+ Display * display; /* Display the event was read from */
+ Time time; /* milliseconds */
+ int xkb_type; /* XkbExtensionDeviceNotify */
+ int device; /* device ID */
+ unsigned int reason; /* reason for the event */
+ unsigned int supported; /* mask of supported features */
+ unsigned int unsupported; /* mask of unsupported features */
+ /* that some app tried to use */
+ int first_btn; /* first button that changed */
+ int num_btns; /* range of buttons changed */
+ unsigned int leds_defined; /* indicators with names or maps */
+ unsigned int led_state; /* current state of the indicators */
+ int led_class; /* feedback class for led changes */
+ int led_id; /* feedback id for led changes */
+} XkbExtensionDeviceNotifyEvent;
+
+typedef union _XkbEvent {
+ int type;
+ XkbAnyEvent any;
+ XkbNewKeyboardNotifyEvent new_kbd;
+ XkbMapNotifyEvent map;
+ XkbStateNotifyEvent state;
+ XkbControlsNotifyEvent ctrls;
+ XkbIndicatorNotifyEvent indicators;
+ XkbNamesNotifyEvent names;
+ XkbCompatMapNotifyEvent compat;
+ XkbBellNotifyEvent bell;
+ XkbActionMessageEvent message;
+ XkbAccessXNotifyEvent accessx;
+ XkbExtensionDeviceNotifyEvent device;
+ XEvent core;
+} XkbEvent;
+
+typedef struct _XkbKbdDpyState XkbKbdDpyStateRec,*XkbKbdDpyStatePtr;
+
+ /* XkbOpenDisplay error codes */
+#define XkbOD_Success 0
+#define XkbOD_BadLibraryVersion 1
+#define XkbOD_ConnectionRefused 2
+#define XkbOD_NonXkbServer 3
+#define XkbOD_BadServerVersion 4
+
+ /* Values for XlibFlags */
+#define XkbLC_ForceLatin1Lookup (1<<0)
+#define XkbLC_ConsumeLookupMods (1<<1)
+#define XkbLC_AlwaysConsumeShiftAndLock (1<<2)
+#define XkbLC_IgnoreNewKeyboards (1<<3)
+#define XkbLC_ControlFallback (1<<4)
+#define XkbLC_ConsumeKeysOnComposeFail (1<<29)
+#define XkbLC_ComposeLED (1<<30)
+#define XkbLC_BeepOnComposeFail (1<<31)
+
+#define XkbLC_AllComposeControls (0xc0000000)
+#define XkbLC_AllControls (0xc000001f)
+
+_XFUNCPROTOBEGIN
+
+extern Bool XkbIgnoreExtension(
+ Bool /* ignore */
+);
+
+extern Display *XkbOpenDisplay(
+ char * /* name */,
+ int * /* ev_rtrn */,
+ int * /* err_rtrn */,
+ int * /* major_rtrn */,
+ int * /* minor_rtrn */,
+ int * /* reason */
+);
+
+extern Bool XkbQueryExtension(
+ Display * /* dpy */,
+ int * /* opcodeReturn */,
+ int * /* eventBaseReturn */,
+ int * /* errorBaseReturn */,
+ int * /* majorRtrn */,
+ int * /* minorRtrn */
+);
+
+extern Bool XkbUseExtension(
+ Display * /* dpy */,
+ int * /* major_rtrn */,
+ int * /* minor_rtrn */
+);
+
+extern Bool XkbLibraryVersion(
+ int * /* libMajorRtrn */,
+ int * /* libMinorRtrn */
+);
+
+extern unsigned int XkbSetXlibControls(
+ Display* /* dpy */,
+ unsigned int /* affect */,
+ unsigned int /* values */
+);
+
+extern unsigned int XkbGetXlibControls(
+ Display* /* dpy */
+);
+
+extern unsigned int XkbXlibControlsImplemented(void);
+
+typedef Atom (*XkbInternAtomFunc)(
+ Display * /* dpy */,
+ _Xconst char * /* name */,
+ Bool /* only_if_exists */
+);
+
+typedef char * (*XkbGetAtomNameFunc)(
+ Display * /* dpy */,
+ Atom /* atom */
+);
+
+extern void XkbSetAtomFuncs(
+ XkbInternAtomFunc /* getAtom */,
+ XkbGetAtomNameFunc /* getName */
+);
+
+extern KeySym XkbKeycodeToKeysym(
+ Display * /* dpy */,
+#if NeedWidePrototypes
+ unsigned int /* kc */,
+#else
+ KeyCode /* kc */,
+#endif
+ int /* group */,
+ int /* level */
+);
+
+extern unsigned int XkbKeysymToModifiers(
+ Display * /* dpy */,
+ KeySym /* ks */
+);
+
+extern Bool XkbLookupKeySym(
+ Display * /* dpy */,
+ KeyCode /* keycode */,
+ unsigned int /* modifiers */,
+ unsigned int * /* modifiers_return */,
+ KeySym * /* keysym_return */
+);
+
+extern int XkbLookupKeyBinding(
+ Display * /* dpy */,
+ KeySym /* sym_rtrn */,
+ unsigned int /* mods */,
+ char * /* buffer */,
+ int /* nbytes */,
+ int * /* extra_rtrn */
+);
+
+extern Bool XkbTranslateKeyCode(
+ XkbDescPtr /* xkb */,
+ KeyCode /* keycode */,
+ unsigned int /* modifiers */,
+ unsigned int * /* modifiers_return */,
+ KeySym * /* keysym_return */
+);
+
+extern int XkbTranslateKeySym(
+ Display * /* dpy */,
+ register KeySym * /* sym_return */,
+ unsigned int /* modifiers */,
+ char * /* buffer */,
+ int /* nbytes */,
+ int * /* extra_rtrn */
+);
+
+extern Bool XkbSetAutoRepeatRate(
+ Display * /* dpy */,
+ unsigned int /* deviceSpec */,
+ unsigned int /* delay */,
+ unsigned int /* interval */
+);
+
+extern Bool XkbGetAutoRepeatRate(
+ Display * /* dpy */,
+ unsigned int /* deviceSpec */,
+ unsigned int * /* delayRtrn */,
+ unsigned int * /* intervalRtrn */
+);
+
+extern Bool XkbChangeEnabledControls(
+ Display * /* dpy */,
+ unsigned int /* deviceSpec */,
+ unsigned int /* affect */,
+ unsigned int /* values */
+);
+
+extern Bool XkbDeviceBell(
+ Display * /* dpy */,
+ Window /* win */,
+ int /* deviceSpec */,
+ int /* bellClass */,
+ int /* bellID */,
+ int /* percent */,
+ Atom /* name */
+);
+
+extern Bool XkbForceDeviceBell(
+ Display * /* dpy */,
+ int /* deviceSpec */,
+ int /* bellClass */,
+ int /* bellID */,
+ int /* percent */
+);
+
+extern Bool XkbDeviceBellEvent(
+ Display * /* dpy */,
+ Window /* win */,
+ int /* deviceSpec */,
+ int /* bellClass */,
+ int /* bellID */,
+ int /* percent */,
+ Atom /* name */
+);
+
+extern Bool XkbBell(
+ Display * /* dpy */,
+ Window /* win */,
+ int /* percent */,
+ Atom /* name */
+);
+
+extern Bool XkbForceBell(
+ Display * /* dpy */,
+ int /* percent */
+);
+
+extern Bool XkbBellEvent(
+ Display * /* dpy */,
+ Window /* win */,
+ int /* percent */,
+ Atom /* name */
+);
+
+extern Bool XkbSelectEvents(
+ Display * /* dpy */,
+ unsigned int /* deviceID */,
+ unsigned int /* affect */,
+ unsigned int /* values */
+);
+
+extern Bool XkbSelectEventDetails(
+ Display * /* dpy */,
+ unsigned int /* deviceID */,
+ unsigned int /* eventType */,
+ unsigned long /* affect */,
+ unsigned long /* details */
+);
+
+extern void XkbNoteMapChanges(
+ XkbMapChangesPtr /* old */,
+ XkbMapNotifyEvent * /* new */,
+ unsigned int /* wanted */
+);
+
+extern void XkbNoteNameChanges(
+ XkbNameChangesPtr /* old */,
+ XkbNamesNotifyEvent * /* new */,
+ unsigned int /* wanted */
+);
+
+extern Status XkbGetIndicatorState(
+ Display * /* dpy */,
+ unsigned int /* deviceSpec */,
+ unsigned int * /* pStateRtrn */
+);
+
+extern Status XkbGetDeviceIndicatorState(
+ Display * /* dpy */,
+ unsigned int /* deviceSpec */,
+ unsigned int /* ledClass */,
+ unsigned int /* ledID */,
+ unsigned int * /* pStateRtrn */
+);
+
+extern Status XkbGetIndicatorMap(
+ Display * /* dpy */,
+ unsigned long /* which */,
+ XkbDescPtr /* desc */
+);
+
+extern Bool XkbSetIndicatorMap(
+ Display * /* dpy */,
+ unsigned long /* which */,
+ XkbDescPtr /* desc */
+);
+
+#define XkbNoteIndicatorMapChanges(o,n,w) \
+ ((o)->map_changes|=((n)->map_changes&(w)))
+#define XkbNoteIndicatorStateChanges(o,n,w)\
+ ((o)->state_changes|=((n)->state_changes&(w)))
+#define XkbGetIndicatorMapChanges(d,x,c) \
+ (XkbGetIndicatorMap((d),(c)->map_changes,x)
+#define XkbChangeIndicatorMaps(d,x,c) \
+ (XkbSetIndicatorMap((d),(c)->map_changes,x))
+
+extern Bool XkbGetNamedIndicator(
+ Display * /* dpy */,
+ Atom /* name */,
+ int * /* pNdxRtrn */,
+ Bool * /* pStateRtrn */,
+ XkbIndicatorMapPtr /* pMapRtrn */,
+ Bool * /* pRealRtrn */
+);
+
+extern Bool XkbGetNamedDeviceIndicator(
+ Display * /* dpy */,
+ unsigned int /* deviceSpec */,
+ unsigned int /* ledClass */,
+ unsigned int /* ledID */,
+ Atom /* name */,
+ int * /* pNdxRtrn */,
+ Bool * /* pStateRtrn */,
+ XkbIndicatorMapPtr /* pMapRtrn */,
+ Bool * /* pRealRtrn */
+);
+
+extern Bool XkbSetNamedIndicator(
+ Display * /* dpy */,
+ Atom /* name */,
+ Bool /* changeState */,
+ Bool /* state */,
+ Bool /* createNewMap */,
+ XkbIndicatorMapPtr /* pMap */
+);
+
+extern Bool XkbSetNamedDeviceIndicator(
+ Display * /* dpy */,
+ unsigned int /* deviceSpec */,
+ unsigned int /* ledClass */,
+ unsigned int /* ledID */,
+ Atom /* name */,
+ Bool /* changeState */,
+ Bool /* state */,
+ Bool /* createNewMap */,
+ XkbIndicatorMapPtr /* pMap */
+);
+
+extern Bool XkbLockModifiers(
+ Display * /* dpy */,
+ unsigned int /* deviceSpec */,
+ unsigned int /* affect */,
+ unsigned int /* values */
+);
+
+extern Bool XkbLatchModifiers(
+ Display * /* dpy */,
+ unsigned int /* deviceSpec */,
+ unsigned int /* affect */,
+ unsigned int /* values */
+);
+
+extern Bool XkbLockGroup(
+ Display * /* dpy */,
+ unsigned int /* deviceSpec */,
+ unsigned int /* group */
+);
+
+extern Bool XkbLatchGroup(
+ Display * /* dpy */,
+ unsigned int /* deviceSpec */,
+ unsigned int /* group */
+);
+
+extern Bool XkbSetServerInternalMods(
+ Display * /* dpy */,
+ unsigned int /* deviceSpec */,
+ unsigned int /* affectReal */,
+ unsigned int /* realValues */,
+ unsigned int /* affectVirtual */,
+ unsigned int /* virtualValues */
+);
+
+extern Bool XkbSetIgnoreLockMods(
+ Display * /* dpy */,
+ unsigned int /* deviceSpec */,
+ unsigned int /* affectReal */,
+ unsigned int /* realValues */,
+ unsigned int /* affectVirtual */,
+ unsigned int /* virtualValues */
+);
+
+
+extern Bool XkbVirtualModsToReal(
+ XkbDescPtr /* xkb */,
+ unsigned int /* virtual_mask */,
+ unsigned int * /* mask_rtrn */
+);
+
+extern Bool XkbComputeEffectiveMap(
+ XkbDescPtr /* xkb */,
+ XkbKeyTypePtr /* type */,
+ unsigned char * /* map_rtrn */
+);
+
+extern Status XkbInitCanonicalKeyTypes(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ int /* keypadVMod */
+);
+
+extern XkbDescPtr XkbAllocKeyboard(
+ void
+);
+
+extern void XkbFreeKeyboard(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ Bool /* freeDesc */
+);
+
+extern Status XkbAllocClientMap(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ unsigned int /* nTypes */
+);
+
+extern Status XkbAllocServerMap(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ unsigned int /* nActions */
+);
+
+extern void XkbFreeClientMap(
+ XkbDescPtr /* xkb */,
+ unsigned int /* what */,
+ Bool /* freeMap */
+);
+
+extern void XkbFreeServerMap(
+ XkbDescPtr /* xkb */,
+ unsigned int /* what */,
+ Bool /* freeMap */
+);
+
+extern XkbKeyTypePtr XkbAddKeyType(
+ XkbDescPtr /* xkb */,
+ Atom /* name */,
+ int /* map_count */,
+ Bool /* want_preserve */,
+ int /* num_lvls */
+);
+
+extern Status XkbAllocIndicatorMaps(
+ XkbDescPtr /* xkb */
+);
+
+extern void XkbFreeIndicatorMaps(
+ XkbDescPtr /* xkb */
+);
+
+extern XkbDescPtr XkbGetMap(
+ Display * /* dpy */,
+ unsigned int /* which */,
+ unsigned int /* deviceSpec */
+);
+
+extern Status XkbGetUpdatedMap(
+ Display * /* dpy */,
+ unsigned int /* which */,
+ XkbDescPtr /* desc */
+);
+
+extern Status XkbGetMapChanges(
+ Display * /* dpy */,
+ XkbDescPtr /* xkb */,
+ XkbMapChangesPtr /* changes */
+);
+
+
+extern Status XkbRefreshKeyboardMapping(
+ XkbMapNotifyEvent * /* event */
+);
+
+extern Status XkbGetKeyTypes(
+ Display * /* dpy */,
+ unsigned int /* first */,
+ unsigned int /* num */,
+ XkbDescPtr /* xkb */
+);
+
+extern Status XkbGetKeySyms(
+ Display * /* dpy */,
+ unsigned int /* first */,
+ unsigned int /* num */,
+ XkbDescPtr /* xkb */
+);
+
+extern Status XkbGetKeyActions(
+ Display * /* dpy */,
+ unsigned int /* first */,
+ unsigned int /* num */,
+ XkbDescPtr /* xkb */
+);
+
+extern Status XkbGetKeyBehaviors(
+ Display * /* dpy */,
+ unsigned int /* firstKey */,
+ unsigned int /* nKeys */,
+ XkbDescPtr /* desc */
+);
+
+extern Status XkbGetVirtualMods(
+ Display * /* dpy */,
+ unsigned int /* which */,
+ XkbDescPtr /* desc */
+);
+
+extern Status XkbGetKeyExplicitComponents(
+ Display * /* dpy */,
+ unsigned int /* firstKey */,
+ unsigned int /* nKeys */,
+ XkbDescPtr /* desc */
+);
+
+extern Status XkbGetKeyModifierMap(
+ Display * /* dpy */,
+ unsigned int /* firstKey */,
+ unsigned int /* nKeys */,
+ XkbDescPtr /* desc */
+);
+
+extern Status XkbGetKeyVirtualModMap(
+ Display * /* dpy */,
+ unsigned int /* first */,
+ unsigned int /* num */,
+ XkbDescPtr /* xkb */
+);
+
+extern Status XkbAllocControls(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which*/
+);
+
+extern void XkbFreeControls(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ Bool /* freeMap */
+);
+
+extern Status XkbGetControls(
+ Display * /* dpy */,
+ unsigned long /* which */,
+ XkbDescPtr /* desc */
+);
+
+extern Bool XkbSetControls(
+ Display * /* dpy */,
+ unsigned long /* which */,
+ XkbDescPtr /* desc */
+);
+
+extern void XkbNoteControlsChanges(
+ XkbControlsChangesPtr /* old */,
+ XkbControlsNotifyEvent * /* new */,
+ unsigned int /* wanted */
+);
+
+#define XkbGetControlsChanges(d,x,c) XkbGetControls(d,(c)->changed_ctrls,x)
+#define XkbChangeControls(d,x,c) XkbSetControls(d,(c)->changed_ctrls,x)
+
+extern Status XkbAllocCompatMap(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ unsigned int /* nInterpret */
+);
+
+extern void XkbFreeCompatMap(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ Bool /* freeMap */
+);
+
+extern Status XkbGetCompatMap(
+ Display * /* dpy */,
+ unsigned int /* which */,
+ XkbDescPtr /* xkb */
+);
+
+extern Bool XkbSetCompatMap(
+ Display * /* dpy */,
+ unsigned int /* which */,
+ XkbDescPtr /* xkb */,
+ Bool /* updateActions */
+);
+
+extern XkbSymInterpretPtr XkbAddSymInterpret(
+ XkbDescPtr /* xkb */,
+ XkbSymInterpretPtr /* si */,
+ Bool /* updateMap */,
+ XkbChangesPtr /* changes */
+);
+
+extern Status XkbAllocNames(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ int /* nTotalRG */,
+ int /* nTotalAliases */
+);
+
+extern Status XkbGetNames(
+ Display * /* dpy */,
+ unsigned int /* which */,
+ XkbDescPtr /* desc */
+);
+
+extern Bool XkbSetNames(
+ Display * /* dpy */,
+ unsigned int /* which */,
+ unsigned int /* firstType */,
+ unsigned int /* nTypes */,
+ XkbDescPtr /* desc */
+);
+
+extern Bool XkbChangeNames(
+ Display * /* dpy */,
+ XkbDescPtr /* xkb */,
+ XkbNameChangesPtr /* changes */
+);
+
+extern void XkbFreeNames(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ Bool /* freeMap */
+);
+
+
+extern Status XkbGetState(
+ Display * /* dpy */,
+ unsigned int /* deviceSpec */,
+ XkbStatePtr /* rtrnState */
+);
+
+extern Bool XkbSetMap(
+ Display * /* dpy */,
+ unsigned int /* which */,
+ XkbDescPtr /* desc */
+);
+
+extern Bool XkbChangeMap(
+ Display* /* dpy */,
+ XkbDescPtr /* desc */,
+ XkbMapChangesPtr /* changes */
+);
+
+extern Bool XkbSetDetectableAutoRepeat(
+ Display * /* dpy */,
+ Bool /* detectable */,
+ Bool * /* supported */
+);
+
+extern Bool XkbGetDetectableAutoRepeat(
+ Display * /* dpy */,
+ Bool * /* supported */
+);
+
+extern Bool XkbSetAutoResetControls(
+ Display * /* dpy */,
+ unsigned int /* changes */,
+ unsigned int * /* auto_ctrls */,
+ unsigned int * /* auto_values */
+);
+
+extern Bool XkbGetAutoResetControls(
+ Display * /* dpy */,
+ unsigned int * /* auto_ctrls */,
+ unsigned int * /* auto_ctrl_values */
+);
+
+extern Bool XkbSetPerClientControls(
+ Display * /* dpy */,
+ unsigned int /* change */,
+ unsigned int * /* values */
+);
+
+extern Bool XkbGetPerClientControls(
+ Display * /* dpy */,
+ unsigned int * /* ctrls */
+);
+
+extern Status XkbCopyKeyType(
+ XkbKeyTypePtr /* from */,
+ XkbKeyTypePtr /* into */
+);
+
+extern Status XkbCopyKeyTypes(
+ XkbKeyTypePtr /* from */,
+ XkbKeyTypePtr /* into */,
+ int /* num_types */
+);
+
+extern Status XkbResizeKeyType(
+ XkbDescPtr /* xkb */,
+ int /* type_ndx */,
+ int /* map_count */,
+ Bool /* want_preserve */,
+ int /* new_num_lvls */
+);
+
+extern KeySym *XkbResizeKeySyms(
+ XkbDescPtr /* desc */,
+ int /* forKey */,
+ int /* symsNeeded */
+);
+
+extern XkbAction *XkbResizeKeyActions(
+ XkbDescPtr /* desc */,
+ int /* forKey */,
+ int /* actsNeeded */
+);
+
+extern Status XkbChangeTypesOfKey(
+ XkbDescPtr /* xkb */,
+ int /* key */,
+ int /* num_groups */,
+ unsigned int /* groups */,
+ int * /* newTypes */,
+ XkbMapChangesPtr /* pChanges */
+);
+
+extern Status XkbChangeKeycodeRange(
+ XkbDescPtr /* xkb */,
+ int /* minKC */,
+ int /* maxKC */,
+ XkbChangesPtr /* changes */
+);
+
+/***====================================================================***/
+
+extern XkbComponentListPtr XkbListComponents(
+ Display * /* dpy */,
+ unsigned int /* deviceSpec */,
+ XkbComponentNamesPtr /* ptrns */,
+ int * /* max_inout */
+);
+
+extern void XkbFreeComponentList(
+ XkbComponentListPtr /* list */
+);
+
+extern XkbDescPtr XkbGetKeyboard(
+ Display * /* dpy */,
+ unsigned int /* which */,
+ unsigned int /* deviceSpec */
+);
+
+extern XkbDescPtr XkbGetKeyboardByName(
+ Display * /* dpy */,
+ unsigned int /* deviceSpec */,
+ XkbComponentNamesPtr /* names */,
+ unsigned int /* want */,
+ unsigned int /* need */,
+ Bool /* load */
+);
+
+/***====================================================================***/
+
+extern int XkbKeyTypesForCoreSymbols( /* returns # of groups */
+ XkbDescPtr /* xkb */, /* keyboard device */
+ int /* map_width */, /* width of core KeySym array */
+ KeySym * /* core_syms */, /* always mapWidth symbols */
+ unsigned int /* protected */, /* explicit key types */
+ int * /* types_inout */, /* always four type indices */
+ KeySym * /* xkb_syms_rtrn */ /* must have enough space */
+);
+
+extern Bool XkbApplyCompatMapToKey( /* False only on error */
+ XkbDescPtr /* xkb */, /* keymap to be edited */
+ KeyCode /* key */, /* key to be updated */
+ XkbChangesPtr /* changes */ /* resulting changes to map */
+);
+
+extern Bool XkbUpdateMapFromCore( /* False only on error */
+ XkbDescPtr /* xkb */, /* XKB keyboard to be edited */
+ KeyCode /* first_key */, /* first changed key */
+ int /* num_keys */, /* number of changed keys */
+ int /* map_width */, /* width of core keymap */
+ KeySym * /* core_keysyms */, /* symbols from core keymap */
+ XkbChangesPtr /* changes */ /* resulting changes */
+);
+
+/***====================================================================***/
+
+extern XkbDeviceLedInfoPtr XkbAddDeviceLedInfo(
+ XkbDeviceInfoPtr /* devi */,
+ unsigned int /* ledClass */,
+ unsigned int /* ledId */
+);
+
+extern Status XkbResizeDeviceButtonActions(
+ XkbDeviceInfoPtr /* devi */,
+ unsigned int /* newTotal */
+);
+
+extern XkbDeviceInfoPtr XkbAllocDeviceInfo(
+ unsigned int /* deviceSpec */,
+ unsigned int /* nButtons */,
+ unsigned int /* szLeds */
+);
+
+extern void XkbFreeDeviceInfo(
+ XkbDeviceInfoPtr /* devi */,
+ unsigned int /* which */,
+ Bool /* freeDevI */
+);
+
+extern void XkbNoteDeviceChanges(
+ XkbDeviceChangesPtr /* old */,
+ XkbExtensionDeviceNotifyEvent * /* new */,
+ unsigned int /* wanted */
+);
+
+extern XkbDeviceInfoPtr XkbGetDeviceInfo(
+ Display * /* dpy */,
+ unsigned int /* which */,
+ unsigned int /* deviceSpec */,
+ unsigned int /* ledClass */,
+ unsigned int /* ledID */
+);
+
+extern Status XkbGetDeviceInfoChanges(
+ Display * /* dpy */,
+ XkbDeviceInfoPtr /* devi */,
+ XkbDeviceChangesPtr /* changes */
+);
+
+extern Status XkbGetDeviceButtonActions(
+ Display * /* dpy */,
+ XkbDeviceInfoPtr /* devi */,
+ Bool /* all */,
+ unsigned int /* first */,
+ unsigned int /* nBtns */
+);
+
+extern Status XkbGetDeviceLedInfo(
+ Display * /* dpy */,
+ XkbDeviceInfoPtr /* devi */,
+ unsigned int /* ledClass (class, XIDflt, XIAll) */,
+ unsigned int /* ledId (id, XIDflt, XIAll) */,
+ unsigned int /* which (XkbXI_Indicator{Names,Map}Mask */
+);
+
+extern Bool XkbSetDeviceInfo(
+ Display * /* dpy */,
+ unsigned int /* which */,
+ XkbDeviceInfoPtr /* devi */
+);
+
+extern Bool XkbChangeDeviceInfo(
+ Display* /* dpy */,
+ XkbDeviceInfoPtr /* desc */,
+ XkbDeviceChangesPtr /* changes */
+);
+
+extern Bool XkbSetDeviceLedInfo(
+ Display * /* dpy */,
+ XkbDeviceInfoPtr /* devi */,
+ unsigned int /* ledClass */,
+ unsigned int /* ledID */,
+ unsigned int /* which */
+);
+
+extern Bool XkbSetDeviceButtonActions(
+ Display * /* dpy */,
+ XkbDeviceInfoPtr /* devi */,
+ unsigned int /* first */,
+ unsigned int /* nBtns */
+);
+
+/***====================================================================***/
+
+extern char XkbToControl(
+ char /* c */
+);
+
+/***====================================================================***/
+
+extern Bool XkbSetDebuggingFlags(
+ Display * /* dpy */,
+ unsigned int /* mask */,
+ unsigned int /* flags */,
+ char * /* msg */,
+ unsigned int /* ctrls_mask */,
+ unsigned int /* ctrls */,
+ unsigned int * /* rtrn_flags */,
+ unsigned int * /* rtrn_ctrls */
+);
+
+extern Bool XkbApplyVirtualModChanges(
+ XkbDescPtr /* xkb */,
+ unsigned int /* changed */,
+ XkbChangesPtr /* changes */
+);
+
+extern Bool XkbUpdateActionVirtualMods(
+ XkbDescPtr /* xkb */,
+ XkbAction * /* act */,
+ unsigned int /* changed */
+);
+
+extern void XkbUpdateKeyTypeVirtualMods(
+ XkbDescPtr /* xkb */,
+ XkbKeyTypePtr /* type */,
+ unsigned int /* changed */,
+ XkbChangesPtr /* changes */
+);
+
+_XFUNCPROTOEND
+
+#endif /* _XKBLIB_H_ */
diff --git a/sysroot/usr/include/X11/XWDFile.h b/sysroot/usr/include/X11/XWDFile.h
new file mode 100644
index 0000000..0ce22e1
--- /dev/null
+++ b/sysroot/usr/include/X11/XWDFile.h
@@ -0,0 +1,114 @@
+/* $Xorg: XWDFile.h,v 1.4 2001/02/09 02:03:22 xorgcvs Exp $ */
+/*
+
+Copyright 1985, 1986, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+*/
+
+/*
+ * XWDFile.h MIT Project Athena, X Window system window raster
+ * image dumper, dump file format header file.
+ *
+ * Author: Tony Della Fera, DEC
+ * 27-Jun-85
+ *
+ * Modifier: William F. Wyatt, SAO
+ * 18-Nov-86 - version 6 for saving/restoring color maps
+ */
+
+#ifndef XWDFILE_H
+#define XWDFILE_H
+
+#include <X11/Xmd.h>
+
+#define XWD_FILE_VERSION 7
+#define sz_XWDheader 100
+#define sz_XWDColor 12
+
+typedef CARD32 xwdval; /* for old broken programs */
+
+/* Values in the file are most significant byte first. */
+
+typedef struct _xwd_file_header {
+ /* header_size = SIZEOF(XWDheader) + length of null-terminated
+ * window name. */
+ CARD32 header_size B32;
+
+ CARD32 file_version B32; /* = XWD_FILE_VERSION above */
+ CARD32 pixmap_format B32; /* ZPixmap or XYPixmap */
+ CARD32 pixmap_depth B32; /* Pixmap depth */
+ CARD32 pixmap_width B32; /* Pixmap width */
+ CARD32 pixmap_height B32; /* Pixmap height */
+ CARD32 xoffset B32; /* Bitmap x offset, normally 0 */
+ CARD32 byte_order B32; /* of image data: MSBFirst, LSBFirst */
+
+ /* bitmap_unit applies to bitmaps (depth 1 format XY) only.
+ * It is the number of bits that each scanline is padded to. */
+ CARD32 bitmap_unit B32;
+
+ CARD32 bitmap_bit_order B32; /* bitmaps only: MSBFirst, LSBFirst */
+
+ /* bitmap_pad applies to pixmaps (non-bitmaps) only.
+ * It is the number of bits that each scanline is padded to. */
+ CARD32 bitmap_pad B32;
+
+ CARD32 bits_per_pixel B32; /* Bits per pixel */
+
+ /* bytes_per_line is pixmap_width padded to bitmap_unit (bitmaps)
+ * or bitmap_pad (pixmaps). It is the delta (in bytes) to get
+ * to the same x position on an adjacent row. */
+ CARD32 bytes_per_line B32;
+ CARD32 visual_class B32; /* Class of colormap */
+ CARD32 red_mask B32; /* Z red mask */
+ CARD32 green_mask B32; /* Z green mask */
+ CARD32 blue_mask B32; /* Z blue mask */
+ CARD32 bits_per_rgb B32; /* Log2 of distinct color values */
+ CARD32 colormap_entries B32; /* Number of entries in colormap; not used? */
+ CARD32 ncolors B32; /* Number of XWDColor structures */
+ CARD32 window_width B32; /* Window width */
+ CARD32 window_height B32; /* Window height */
+ CARD32 window_x B32; /* Window upper left X coordinate */
+ CARD32 window_y B32; /* Window upper left Y coordinate */
+ CARD32 window_bdrwidth B32; /* Window border width */
+} XWDFileHeader;
+
+/* Null-terminated window name follows the above structure. */
+
+/* Next comes XWDColor structures, at offset XWDFileHeader.header_size in
+ * the file. XWDFileHeader.ncolors tells how many XWDColor structures
+ * there are.
+ */
+
+typedef struct {
+ CARD32 pixel B32;
+ CARD16 red B16;
+ CARD16 green B16;
+ CARD16 blue B16;
+ CARD8 flags;
+ CARD8 pad;
+} XWDColor;
+
+/* Last comes the image data in the format described by XWDFileHeader. */
+
+#endif /* XWDFILE_H */
+
diff --git a/sysroot/usr/include/X11/Xalloca.h b/sysroot/usr/include/X11/Xalloca.h
new file mode 100644
index 0000000..67f2671
--- /dev/null
+++ b/sysroot/usr/include/X11/Xalloca.h
@@ -0,0 +1,145 @@
+/* $Xorg: Xalloca.h,v 1.4 2001/02/09 02:03:22 xorgcvs Exp $ */
+
+/*
+
+Copyright 1995, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from The Open Group.
+
+*/
+/* $XFree86: xc/include/Xalloca.h,v 3.10 2001/12/14 19:53:25 dawes Exp $ */
+
+/*
+ * The purpose of this header is to define the macros ALLOCATE_LOCAL and
+ * DEALLOCATE_LOCAL appropriately for the platform being compiled on.
+ * These macros are used to make fast, function-local memory allocations.
+ * Their characteristics are as follows:
+ *
+ * void *ALLOCATE_LOCAL(int size)
+ * Returns a pointer to size bytes of memory, or NULL if the allocation
+ * failed. The memory must be freed with DEALLOCATE_LOCAL before the
+ * function that made the allocation returns. You should not ask for
+ * large blocks of memory with this function, since on many platforms
+ * the memory comes from the stack, which may have limited size.
+ *
+ * void DEALLOCATE_LOCAL(void *)
+ * Frees the memory allocated by ALLOCATE_LOCAL. Omission of this
+ * step may be harmless on some platforms, but will result in
+ * memory leaks or worse on others.
+ *
+ * Before including this file, you should define two macros,
+ * ALLOCATE_LOCAL_FALLBACK and DEALLOCATE_LOCAL_FALLBACK, that have the
+ * same characteristics as ALLOCATE_LOCAL and DEALLOCATE_LOCAL. The
+ * header uses the fallbacks if it doesn't know a "better" way to define
+ * ALLOCATE_LOCAL and DEALLOCATE_LOCAL. Typical usage would be:
+ *
+ * #define ALLOCATE_LOCAL_FALLBACK(_size) malloc(_size)
+ * #define DEALLOCATE_LOCAL_FALLBACK(_ptr) free(_ptr)
+ * #include "Xalloca.h"
+ */
+
+#ifndef XALLOCA_H
+#define XALLOCA_H 1
+
+#ifndef INCLUDE_ALLOCA_H
+# if defined(__SUNPRO_C) /* Need to add more here to match Imake *.cf's */
+# define INCLUDE_ALLOCA_H
+# endif
+#endif
+
+#ifdef INCLUDE_ALLOCA_H
+# include <alloca.h>
+#endif
+
+#ifndef NO_ALLOCA
+/*
+ * os-dependent definition of local allocation and deallocation
+ * If you want something other than (DE)ALLOCATE_LOCAL_FALLBACK
+ * for ALLOCATE/DEALLOCATE_LOCAL then you add that in here.
+ */
+# if defined(__HIGHC__)
+# ifndef NCR
+ extern char *alloca();
+# if HCVERSION < 21003
+# define ALLOCATE_LOCAL(size) alloca((int)(size))
+ pragma on(alloca);
+# else /* HCVERSION >= 21003 */
+# define ALLOCATE_LOCAL(size) _Alloca((int)(size))
+# endif /* HCVERSION < 21003 */
+# else /* NCR */
+# define ALLOCATE_LOCAL(size) alloca(size)
+# endif
+# endif /* defined(__HIGHC__) */
+
+
+# ifdef __GNUC__
+# ifndef alloca
+# define alloca __builtin_alloca
+# endif /* !alloca */
+# define ALLOCATE_LOCAL(size) alloca((int)(size))
+# else /* ! __GNUC__ */
+
+/*
+ * warning: old mips alloca (pre 2.10) is unusable, new one is built in
+ * Test is easy, the new one is named __builtin_alloca and comes
+ * from alloca.h which #defines alloca.
+ */
+# ifndef NCR
+# if defined(vax) || defined(sun) || defined(apollo) || defined(stellar) || defined(alloca)
+/*
+ * Some System V boxes extract alloca.o from /lib/libPW.a; if you
+ * decide that you don't want to use alloca, you might want to fix it here.
+ */
+/* alloca might be a macro taking one arg (hi, Sun!), so give it one. */
+# ifndef __sgi /* IRIX 5/6 has definition */
+# ifndef __QNX__
+# define __Xnullarg /* as nothing */
+# ifndef X_NOT_STDC_ENV
+ extern void *alloca(__Xnullarg);
+# else
+ extern char *alloca(__Xnullarg);
+# endif
+# endif /* __QNX__ */
+# endif /* __sgi */
+# define ALLOCATE_LOCAL(size) alloca((int)(size))
+# endif /* who does alloca */
+# endif /* NCR */
+# endif /* __GNUC__ */
+
+#endif /* NO_ALLOCA */
+
+#if !defined(ALLOCATE_LOCAL)
+# if defined(ALLOCATE_LOCAL_FALLBACK) && defined(DEALLOCATE_LOCAL_FALLBACK)
+# define ALLOCATE_LOCAL(_size) ALLOCATE_LOCAL_FALLBACK(_size)
+# define DEALLOCATE_LOCAL(_ptr) DEALLOCATE_LOCAL_FALLBACK(_ptr)
+# else /* no fallbacks supplied; error */
+# define ALLOCATE_LOCAL(_size) ALLOCATE_LOCAL_FALLBACK undefined!
+# define DEALLOCATE_LOCAL(_ptr) DEALLOCATE_LOCAL_FALLBACK undefined!
+# endif /* defined(ALLOCATE_LOCAL_FALLBACK && DEALLOCATE_LOCAL_FALLBACK) */
+#else
+# if !defined(DEALLOCATE_LOCAL)
+# define DEALLOCATE_LOCAL(_ptr) do {} while(0)
+# endif
+#endif /* defined(ALLOCATE_LOCAL) */
+
+#endif /* XALLOCA_H */
diff --git a/sysroot/usr/include/X11/Xarch.h b/sysroot/usr/include/X11/Xarch.h
new file mode 100644
index 0000000..6e04e53
--- /dev/null
+++ b/sysroot/usr/include/X11/Xarch.h
@@ -0,0 +1,126 @@
+#ifndef _XARCH_H_
+#define _XARCH_H_
+
+/*
+ * Copyright 1997 Metro Link Incorporated
+ *
+ * All Rights Reserved
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the names of the above listed copyright holder(s)
+ * not be used in advertising or publicity pertaining to distribution of
+ * the software without specific, written prior permission. The above listed
+ * copyright holder(s) make(s) no representations about the suitability of
+ * this software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ *
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM(S) ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
+ * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
+ * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
+ * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+/* $XFree86: xc/include/Xarch.h,v 1.10tsi Exp $ */
+
+
+/*
+ * Determine the machine's byte order.
+ */
+
+/* See if it is set in the imake config first */
+#ifdef X_BYTE_ORDER
+
+#define X_BIG_ENDIAN 4321
+#define X_LITTLE_ENDIAN 1234
+
+#else
+
+#ifdef SVR4
+#if defined(NCR) || defined(Mips) || defined(__sgi)
+#include <sys/endian.h>
+#else
+#if !defined(sun)
+#include <sys/byteorder.h>
+#endif
+#endif
+#elif defined(CSRG_BASED)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
+#include <sys/types.h>
+#endif
+#include <machine/endian.h>
+#elif defined(linux)
+#if defined __STRICT_ANSI__
+#undef __STRICT_ANSI__
+#include <endian.h>
+#define __STRICT_ANSI__
+#else
+#include <endian.h>
+#endif
+/* 'endian.h' might have been included before 'Xarch.h' */
+#if !defined(LITTLE_ENDIAN) && defined(__LITTLE_ENDIAN)
+#define LITTLE_ENDIAN __LITTLE_ENDIAN
+#endif
+#if !defined(BIG_ENDIAN) && defined(__BIG_ENDIAN)
+#define BIG_ENDIAN __BIG_ENDIAN
+#endif
+#if !defined(PDP_ENDIAN) && defined(__PDP_ENDIAN)
+#define PDP_ENDIAN __PDP_ENDIAN
+#endif
+#if !defined(BYTE_ORDER) && defined(__BYTE_ORDER)
+#define BYTE_ORDER __BYTE_ORDER
+#endif
+#elif defined(Lynx)
+#if 0
+/* LynxOS 2.4.0 has wrong defines in bsd/ip.h */
+#include <bsd/in.h>
+#include <bsd/in_systm.h>
+#include <bsd/ip.h>
+#endif
+#endif
+
+#ifndef BYTE_ORDER
+#define LITTLE_ENDIAN 1234
+#define BIG_ENDIAN 4321
+
+#if defined(__QNX__) && !defined(__QNXNTO__)
+#define BYTE_ORDER LITTLE_ENDIAN
+#endif
+
+#if defined(__QNXNTO__)
+#if defined(i386) || defined(__i386__) || defined(__x86__)
+#define BYTE_ORDER LITTLE_ENDIAN
+#else
+#define BYTE_ORDER BIG_ENDIAN
+#endif
+#endif
+
+#ifdef Lynx
+#if defined(i386) || defined(__i386__) || defined(__x86__)
+#define BYTE_ORDER LITTLE_ENDIAN
+#else
+#define BYTE_ORDER BIG_ENDIAN
+#endif
+#endif
+#if (defined(sun) && defined(SVR4)) && !defined(Lynx)
+#include <sys/isa_defs.h>
+#ifdef _LITTLE_ENDIAN
+#define BYTE_ORDER LITTLE_ENDIAN
+#endif
+#ifdef _BIG_ENDIAN
+#define BYTE_ORDER BIG_ENDIAN
+#endif
+#endif /* sun */
+#endif /* BYTE_ORDER */
+
+#define X_BYTE_ORDER BYTE_ORDER
+#define X_BIG_ENDIAN BIG_ENDIAN
+#define X_LITTLE_ENDIAN LITTLE_ENDIAN
+
+#endif /* not in imake config */
+
+#endif /* _XARCH_H_ */
diff --git a/sysroot/usr/include/X11/Xatom.h b/sysroot/usr/include/X11/Xatom.h
new file mode 100644
index 0000000..485a423
--- /dev/null
+++ b/sysroot/usr/include/X11/Xatom.h
@@ -0,0 +1,79 @@
+#ifndef XATOM_H
+#define XATOM_H 1
+
+/* THIS IS A GENERATED FILE
+ *
+ * Do not change! Changing this file implies a protocol change!
+ */
+
+#define XA_PRIMARY ((Atom) 1)
+#define XA_SECONDARY ((Atom) 2)
+#define XA_ARC ((Atom) 3)
+#define XA_ATOM ((Atom) 4)
+#define XA_BITMAP ((Atom) 5)
+#define XA_CARDINAL ((Atom) 6)
+#define XA_COLORMAP ((Atom) 7)
+#define XA_CURSOR ((Atom) 8)
+#define XA_CUT_BUFFER0 ((Atom) 9)
+#define XA_CUT_BUFFER1 ((Atom) 10)
+#define XA_CUT_BUFFER2 ((Atom) 11)
+#define XA_CUT_BUFFER3 ((Atom) 12)
+#define XA_CUT_BUFFER4 ((Atom) 13)
+#define XA_CUT_BUFFER5 ((Atom) 14)
+#define XA_CUT_BUFFER6 ((Atom) 15)
+#define XA_CUT_BUFFER7 ((Atom) 16)
+#define XA_DRAWABLE ((Atom) 17)
+#define XA_FONT ((Atom) 18)
+#define XA_INTEGER ((Atom) 19)
+#define XA_PIXMAP ((Atom) 20)
+#define XA_POINT ((Atom) 21)
+#define XA_RECTANGLE ((Atom) 22)
+#define XA_RESOURCE_MANAGER ((Atom) 23)
+#define XA_RGB_COLOR_MAP ((Atom) 24)
+#define XA_RGB_BEST_MAP ((Atom) 25)
+#define XA_RGB_BLUE_MAP ((Atom) 26)
+#define XA_RGB_DEFAULT_MAP ((Atom) 27)
+#define XA_RGB_GRAY_MAP ((Atom) 28)
+#define XA_RGB_GREEN_MAP ((Atom) 29)
+#define XA_RGB_RED_MAP ((Atom) 30)
+#define XA_STRING ((Atom) 31)
+#define XA_VISUALID ((Atom) 32)
+#define XA_WINDOW ((Atom) 33)
+#define XA_WM_COMMAND ((Atom) 34)
+#define XA_WM_HINTS ((Atom) 35)
+#define XA_WM_CLIENT_MACHINE ((Atom) 36)
+#define XA_WM_ICON_NAME ((Atom) 37)
+#define XA_WM_ICON_SIZE ((Atom) 38)
+#define XA_WM_NAME ((Atom) 39)
+#define XA_WM_NORMAL_HINTS ((Atom) 40)
+#define XA_WM_SIZE_HINTS ((Atom) 41)
+#define XA_WM_ZOOM_HINTS ((Atom) 42)
+#define XA_MIN_SPACE ((Atom) 43)
+#define XA_NORM_SPACE ((Atom) 44)
+#define XA_MAX_SPACE ((Atom) 45)
+#define XA_END_SPACE ((Atom) 46)
+#define XA_SUPERSCRIPT_X ((Atom) 47)
+#define XA_SUPERSCRIPT_Y ((Atom) 48)
+#define XA_SUBSCRIPT_X ((Atom) 49)
+#define XA_SUBSCRIPT_Y ((Atom) 50)
+#define XA_UNDERLINE_POSITION ((Atom) 51)
+#define XA_UNDERLINE_THICKNESS ((Atom) 52)
+#define XA_STRIKEOUT_ASCENT ((Atom) 53)
+#define XA_STRIKEOUT_DESCENT ((Atom) 54)
+#define XA_ITALIC_ANGLE ((Atom) 55)
+#define XA_X_HEIGHT ((Atom) 56)
+#define XA_QUAD_WIDTH ((Atom) 57)
+#define XA_WEIGHT ((Atom) 58)
+#define XA_POINT_SIZE ((Atom) 59)
+#define XA_RESOLUTION ((Atom) 60)
+#define XA_COPYRIGHT ((Atom) 61)
+#define XA_NOTICE ((Atom) 62)
+#define XA_FONT_NAME ((Atom) 63)
+#define XA_FAMILY_NAME ((Atom) 64)
+#define XA_FULL_NAME ((Atom) 65)
+#define XA_CAP_HEIGHT ((Atom) 66)
+#define XA_WM_CLASS ((Atom) 67)
+#define XA_WM_TRANSIENT_FOR ((Atom) 68)
+
+#define XA_LAST_PREDEFINED ((Atom) 68)
+#endif /* XATOM_H */
diff --git a/sysroot/usr/include/X11/Xcms.h b/sysroot/usr/include/X11/Xcms.h
new file mode 100644
index 0000000..779bc52
--- /dev/null
+++ b/sysroot/usr/include/X11/Xcms.h
@@ -0,0 +1,805 @@
+/* $Xorg: Xcms.h,v 1.6 2000/08/17 19:45:04 cpqbld Exp $ */
+
+/*
+ * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
+ * All Rights Reserved
+ *
+ * This file is a component of an X Window System-specific implementation
+ * of Xcms based on the TekColor Color Management System. Permission is
+ * hereby granted to use, copy, modify, sell, and otherwise distribute this
+ * software and its documentation for any purpose and without fee, provided
+ * that this copyright, permission, and disclaimer notice is reproduced in
+ * all copies of this software and in supporting documentation. TekColor
+ * is a trademark of Tektronix, Inc.
+ *
+ * Tektronix makes no representation about the suitability of this software
+ * for any purpose. It is provided "as is" and with all faults.
+ *
+ * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
+ * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
+ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ * RESULTING FROM LOSS OF USE, DATA, OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR THE PERFORMANCE OF THIS SOFTWARE.
+ *
+ *
+ * DESCRIPTION
+ * Public include file for X Color Management System
+ */
+/* $XFree86: xc/lib/X11/Xcms.h,v 1.7 2003/11/03 03:46:26 dawes Exp $ */
+#ifndef _XCMS_H_
+#define _XCMS_H_
+
+#include <X11/Xlib.h>
+
+ /*
+ * XCMS Status Values
+ */
+#define XcmsFailure 0
+#define XcmsSuccess 1
+#define XcmsSuccessWithCompression 2
+
+ /*
+ * Color Space Format ID's
+ * Color Space ID's are of XcmsColorFormat type.
+ *
+ * bit 31
+ * 0 == Device-Independent
+ * 1 == Device-Dependent
+ *
+ * bit 30:
+ * 0 == Registered with X Consortium
+ * 1 == Unregistered
+ */
+#define XcmsUndefinedFormat (XcmsColorFormat)0x00000000
+#define XcmsCIEXYZFormat (XcmsColorFormat)0x00000001
+#define XcmsCIEuvYFormat (XcmsColorFormat)0x00000002
+#define XcmsCIExyYFormat (XcmsColorFormat)0x00000003
+#define XcmsCIELabFormat (XcmsColorFormat)0x00000004
+#define XcmsCIELuvFormat (XcmsColorFormat)0x00000005
+#define XcmsTekHVCFormat (XcmsColorFormat)0x00000006
+#define XcmsRGBFormat (XcmsColorFormat)0x80000000
+#define XcmsRGBiFormat (XcmsColorFormat)0x80000001
+
+ /*
+ * State of XcmsPerScrnInfo
+ */
+#define XcmsInitNone 0x00 /* no initialization attempted */
+#define XcmsInitSuccess 0x01 /* initialization successful */
+#define XcmsInitFailure 0xff /* failure, use defaults */
+
+#define DisplayOfCCC(ccc) ((ccc)->dpy)
+#define ScreenNumberOfCCC(ccc) ((ccc)->screenNumber)
+#define VisualOfCCC(ccc) ((ccc)->visual)
+#define ClientWhitePointOfCCC(ccc) (&(ccc)->clientWhitePt)
+#define ScreenWhitePointOfCCC(ccc) (&(ccc)->pPerScrnInfo->screenWhitePt)
+#define FunctionSetOfCCC(ccc) ((ccc)->pPerScrnInfo->functionSet)
+
+typedef unsigned long XcmsColorFormat; /* Color Space Format ID */
+
+typedef double XcmsFloat;
+
+ /*
+ * Device RGB
+ */
+typedef struct {
+ unsigned short red; /* scaled from 0x0000 to 0xffff */
+ unsigned short green; /* scaled from 0x0000 to 0xffff */
+ unsigned short blue; /* scaled from 0x0000 to 0xffff */
+} XcmsRGB;
+
+ /*
+ * RGB Intensity
+ */
+typedef struct {
+ XcmsFloat red; /* 0.0 - 1.0 */
+ XcmsFloat green; /* 0.0 - 1.0 */
+ XcmsFloat blue; /* 0.0 - 1.0 */
+} XcmsRGBi;
+
+ /*
+ * CIE XYZ
+ */
+typedef struct {
+ XcmsFloat X;
+ XcmsFloat Y;
+ XcmsFloat Z;
+} XcmsCIEXYZ;
+
+ /*
+ * CIE u'v'Y
+ */
+typedef struct {
+ XcmsFloat u_prime; /* 0.0 - 1.0 */
+ XcmsFloat v_prime; /* 0.0 - 1.0 */
+ XcmsFloat Y; /* 0.0 - 1.0 */
+} XcmsCIEuvY;
+
+ /*
+ * CIE xyY
+ */
+typedef struct {
+ XcmsFloat x; /* 0.0 - 1.0 */
+ XcmsFloat y; /* 0.0 - 1.0 */
+ XcmsFloat Y; /* 0.0 - 1.0 */
+} XcmsCIExyY;
+
+ /*
+ * CIE L*a*b*
+ */
+typedef struct {
+ XcmsFloat L_star; /* 0.0 - 100.0 */
+ XcmsFloat a_star;
+ XcmsFloat b_star;
+} XcmsCIELab;
+
+ /*
+ * CIE L*u*v*
+ */
+typedef struct {
+ XcmsFloat L_star; /* 0.0 - 100.0 */
+ XcmsFloat u_star;
+ XcmsFloat v_star;
+} XcmsCIELuv;
+
+ /*
+ * TekHVC
+ */
+typedef struct {
+ XcmsFloat H; /* 0.0 - 360.0 */
+ XcmsFloat V; /* 0.0 - 100.0 */
+ XcmsFloat C; /* 0.0 - 100.0 */
+} XcmsTekHVC;
+
+ /*
+ * PAD
+ */
+typedef struct {
+ XcmsFloat pad0;
+ XcmsFloat pad1;
+ XcmsFloat pad2;
+ XcmsFloat pad3;
+} XcmsPad;
+
+
+ /*
+ * XCMS Color Structure
+ */
+typedef struct {
+ union {
+ XcmsRGB RGB;
+ XcmsRGBi RGBi;
+ XcmsCIEXYZ CIEXYZ;
+ XcmsCIEuvY CIEuvY;
+ XcmsCIExyY CIExyY;
+ XcmsCIELab CIELab;
+ XcmsCIELuv CIELuv;
+ XcmsTekHVC TekHVC;
+ XcmsPad Pad;
+ } spec; /* the color specification */
+ unsigned long pixel; /* pixel value (as needed) */
+ XcmsColorFormat format; /* the specification format */
+} XcmsColor;
+
+
+ /*
+ * XCMS Per Screen related data
+ */
+
+typedef struct _XcmsPerScrnInfo {
+ XcmsColor screenWhitePt; /* Screen White point */
+ XPointer functionSet; /* pointer to Screen Color Characterization */
+ /* Function Set structure */
+ XPointer screenData; /* pointer to corresponding Screen Color*/
+ /* Characterization Data */
+ unsigned char state; /* XcmsInitNone, XcmsInitSuccess, XcmsInitFailure */
+ char pad[3];
+} XcmsPerScrnInfo;
+
+typedef struct _XcmsCCC *XcmsCCC;
+
+typedef Status (*XcmsCompressionProc)( /* Gamut Compression Proc */
+ XcmsCCC /* ccc */,
+ XcmsColor* /* colors_in_out */,
+ unsigned int /* ncolors */,
+ unsigned int /* index */,
+ Bool* /* compression_flags_return */
+);
+
+typedef Status (*XcmsWhiteAdjustProc)( /* White Point Adjust Proc */
+ XcmsCCC /* ccc */,
+ XcmsColor* /* initial_white_point*/,
+ XcmsColor* /* target_white_point*/,
+ XcmsColorFormat /* target_format */,
+ XcmsColor* /* colors_in_out */,
+ unsigned int /* ncolors */,
+ Bool* /* compression_flags_return */
+);
+
+ /*
+ * XCMS Color Conversion Context
+ */
+typedef struct _XcmsCCC {
+ Display *dpy; /* X Display */
+ int screenNumber; /* X screen number */
+ Visual *visual; /* X Visual */
+ XcmsColor clientWhitePt; /* Client White Point */
+ XcmsCompressionProc gamutCompProc; /* Gamut Compression Function */
+ XPointer gamutCompClientData; /* Gamut Comp Func Client Data */
+ XcmsWhiteAdjustProc whitePtAdjProc; /* White Point Adjustment Function */
+ XPointer whitePtAdjClientData; /* White Pt Adj Func Client Data */
+ XcmsPerScrnInfo *pPerScrnInfo; /* pointer to per screen information */
+ /* associated with the above display */
+ /* screenNumber */
+} XcmsCCCRec;
+
+typedef Status (*XcmsScreenInitProc)( /* Screen Initialization Proc */
+ Display* /* dpy */,
+ int /* screen_number */,
+ XcmsPerScrnInfo* /* screen_info */
+);
+
+typedef void (*XcmsScreenFreeProc)(
+ XPointer /* screenData */
+);
+
+ /*
+ * Function List Pointer -- pointer to an array of function pointers.
+ * The end of list is indicated by a NULL pointer.
+ */
+/*
+ * XXX: The use of the XcmsConversionProc type is broken. The
+ * device-independent colour conversion code uses it as:
+
+typedef Status (*XcmsConversionProc)(XcmsCCC, XcmsColor *, XcmsColor *,
+ unsigned int);
+
+ * while the device-dependent code uses it as:
+
+typedef Status (*XcmsConversionProc)(XcmsCCC, XcmsColor *, unsigned int,
+ Bool *);
+
+ * Until this is reworked, it's probably best to leave it unprotoized.
+ * The code works regardless.
+ */
+typedef Status (*XcmsDDConversionProc)( /* using device-dependent version */
+ XcmsCCC /* ccc */,
+ XcmsColor* /* pcolors_in_out */,
+ unsigned int /* ncolors */,
+ Bool* /* pCompressed */
+ );
+
+typedef Status (*XcmsDIConversionProc)( /* using device-independent version */
+ XcmsCCC /* ccc */,
+ XcmsColor* /* white_point */,
+ XcmsColor* /* pcolors_in_out */,
+ unsigned int /* ncolors */
+ );
+
+typedef XcmsDIConversionProc XcmsConversionProc;
+typedef XcmsConversionProc *XcmsFuncListPtr;
+
+typedef int (*XcmsParseStringProc)( /* Color String Parsing Proc */
+ char* /* color_string */,
+ XcmsColor* /* color_return */
+);
+
+ /*
+ * Color Space -- per Color Space related data (Device-Independent
+ * or Device-Dependent)
+ */
+typedef struct _XcmsColorSpace {
+ const char *prefix; /* Prefix of string format. */
+ XcmsColorFormat id; /* Format ID number. */
+ XcmsParseStringProc parseString;
+ /* String format parsing function */
+ XcmsFuncListPtr to_CIEXYZ; /* Pointer to an array of function */
+ /* pointers such that when the */
+ /* functions are executed in sequence */
+ /* will convert a XcmsColor structure */
+ /* from this color space to CIEXYZ */
+ /* space. */
+ XcmsFuncListPtr from_CIEXYZ;/* Pointer to an array of function */
+ /* pointers such that when the */
+ /* functions are executed in sequence */
+ /* will convert a XcmsColor structure */
+ /* from CIEXYZ space to this color */
+ /* space. */
+ int inverse_flag; /* If 1, indicates that for 0 <= i < n */
+ /* where n is the number of function */
+ /* pointers in the lists to_CIEXYZ */
+ /* and from_CIEXYZ; for each function */
+ /* to_CIEXYZ[i] its inverse function */
+ /* is from_CIEXYZ[n - i]. */
+
+} XcmsColorSpace;
+
+ /*
+ * Screen Color Characterization Function Set -- per device class
+ * color space conversion functions.
+ */
+typedef struct _XcmsFunctionSet {
+ XcmsColorSpace **DDColorSpaces;
+ /* Pointer to an array of pointers to */
+ /* Device-DEPENDENT color spaces */
+ /* understood by this SCCFuncSet. */
+ XcmsScreenInitProc screenInitProc;
+ /* Screen initialization function that */
+ /* reads Screen Color Characterization*/
+ /* Data off properties on the screen's*/
+ /* root window. */
+ XcmsScreenFreeProc screenFreeProc;
+ /* Function that frees the SCCData */
+ /* structures. */
+} XcmsFunctionSet;
+
+_XFUNCPROTOBEGIN
+
+extern Status XcmsAddColorSpace (
+ XcmsColorSpace* /* pColorSpace */
+);
+
+extern Status XcmsAddFunctionSet (
+ XcmsFunctionSet* /* functionSet */
+);
+
+extern Status XcmsAllocColor (
+ Display* /* dpy */,
+ Colormap /* colormap */,
+ XcmsColor* /* color_in_out */,
+ XcmsColorFormat /* result_format */
+);
+
+extern Status XcmsAllocNamedColor (
+ Display* /* dpy */,
+ Colormap /* colormap */,
+ _Xconst char* /* color_string */,
+ XcmsColor* /* color_scrn_return */,
+ XcmsColor* /* color_exact_return */,
+ XcmsColorFormat /* result_format */
+);
+
+extern XcmsCCC XcmsCCCOfColormap (
+ Display* /* dpy */,
+ Colormap /* colormap */
+);
+
+extern Status XcmsCIELabClipab(
+ XcmsCCC /* ccc */,
+ XcmsColor* /* colors_in_out */,
+ unsigned int /* ncolors */,
+ unsigned int /* index */,
+ Bool* /* compression_flags_return */
+);
+
+extern Status XcmsCIELabClipL(
+ XcmsCCC /* ccc */,
+ XcmsColor* /* colors_in_out */,
+ unsigned int /* ncolors */,
+ unsigned int /* index */,
+ Bool* /* compression_flags_return */
+);
+
+extern Status XcmsCIELabClipLab(
+ XcmsCCC /* ccc */,
+ XcmsColor* /* colors_in_out */,
+ unsigned int /* ncolors */,
+ unsigned int /* index */,
+ Bool* /* compression_flags_return */
+);
+
+extern Status XcmsCIELabQueryMaxC (
+ XcmsCCC /* ccc */,
+ XcmsFloat /* hue_angle */,
+ XcmsFloat /* L_star */,
+ XcmsColor* /* color_return */
+);
+
+extern Status XcmsCIELabQueryMaxL (
+ XcmsCCC /* ccc */,
+ XcmsFloat /* hue_angle */,
+ XcmsFloat /* chroma */,
+ XcmsColor* /* color_return */
+);
+
+extern Status XcmsCIELabQueryMaxLC (
+ XcmsCCC /* ccc */,
+ XcmsFloat /* hue_angle */,
+ XcmsColor* /* color_return */
+);
+
+extern Status XcmsCIELabQueryMinL (
+ XcmsCCC /* ccc */,
+ XcmsFloat /* hue_angle */,
+ XcmsFloat /* chroma */,
+ XcmsColor* /* color_return */
+);
+
+extern Status XcmsCIELabToCIEXYZ (
+ XcmsCCC /* ccc */,
+ XcmsColor* /* white_point */,
+ XcmsColor* /* colors */,
+ unsigned int /* ncolors */
+);
+
+extern Status XcmsCIELabWhiteShiftColors(
+ XcmsCCC /* ccc */,
+ XcmsColor* /* initial_white_point*/,
+ XcmsColor* /* target_white_point*/,
+ XcmsColorFormat /* target_format */,
+ XcmsColor* /* colors_in_out */,
+ unsigned int /* ncolors */,
+ Bool* /* compression_flags_return */
+);
+
+extern Status XcmsCIELuvClipL(
+ XcmsCCC /* ccc */,
+ XcmsColor* /* colors_in_out */,
+ unsigned int /* ncolors */,
+ unsigned int /* index */,
+ Bool* /* compression_flags_return */
+);
+
+extern Status XcmsCIELuvClipLuv(
+ XcmsCCC /* ccc */,
+ XcmsColor* /* colors_in_out */,
+ unsigned int /* ncolors */,
+ unsigned int /* index */,
+ Bool* /* compression_flags_return */
+);
+
+extern Status XcmsCIELuvClipuv(
+ XcmsCCC /* ccc */,
+ XcmsColor* /* colors_in_out */,
+ unsigned int /* ncolors */,
+ unsigned int /* index */,
+ Bool* /* compression_flags_return */
+);
+
+extern Status XcmsCIELuvQueryMaxC (
+ XcmsCCC /* ccc */,
+ XcmsFloat /* hue_angle */,
+ XcmsFloat /* L_star */,
+ XcmsColor* /* color_return */
+);
+
+extern Status XcmsCIELuvQueryMaxL (
+ XcmsCCC /* ccc */,
+ XcmsFloat /* hue_angle */,
+ XcmsFloat /* chroma */,
+ XcmsColor* /* color_return */
+);
+
+extern Status XcmsCIELuvQueryMaxLC (
+ XcmsCCC /* ccc */,
+ XcmsFloat /* hue_angle */,
+ XcmsColor* /* color_return */
+);
+
+extern Status XcmsCIELuvQueryMinL (
+ XcmsCCC /* ccc */,
+ XcmsFloat /* hue_angle */,
+ XcmsFloat /* chroma */,
+ XcmsColor* /* color_return */
+);
+
+extern Status XcmsCIELuvToCIEuvY (
+ XcmsCCC /* ccc */,
+ XcmsColor* /* white_point */,
+ XcmsColor* /* colors */,
+ unsigned int /* ncolors */
+);
+
+extern Status XcmsCIELuvWhiteShiftColors(
+ XcmsCCC /* ccc */,
+ XcmsColor* /* initial_white_point*/,
+ XcmsColor* /* target_white_point*/,
+ XcmsColorFormat /* target_format */,
+ XcmsColor* /* colors_in_out */,
+ unsigned int /* ncolors */,
+ Bool* /* compression_flags_return */
+);
+
+extern Status XcmsCIEXYZToCIELab (
+ XcmsCCC /* ccc */,
+ XcmsColor* /* white_point */,
+ XcmsColor* /* colors */,
+ unsigned int /* ncolors */
+);
+
+extern Status XcmsCIEXYZToCIEuvY (
+ XcmsCCC /* ccc */,
+ XcmsColor* /* white_point */,
+ XcmsColor* /* colors */,
+ unsigned int /* ncolors */
+);
+
+extern Status XcmsCIEXYZToCIExyY (
+ XcmsCCC /* ccc */,
+ XcmsColor* /* white_point */,
+ XcmsColor* /* colors */,
+ unsigned int /* ncolors */
+);
+
+extern Status XcmsCIEXYZToRGBi (
+ XcmsCCC /* ccc */,
+ XcmsColor* /* colors */,
+ unsigned int /* ncolors */,
+ Bool* /* compression_flags_return */
+);
+
+extern Status XcmsCIEuvYToCIELuv (
+ XcmsCCC /* ccc */,
+ XcmsColor* /* white_point */,
+ XcmsColor* /* colors */,
+ unsigned int /* ncolors */
+);
+
+extern Status XcmsCIEuvYToCIEXYZ (
+ XcmsCCC /* ccc */,
+ XcmsColor* /* white_point */,
+ XcmsColor* /* colors */,
+ unsigned int /* ncolors */
+);
+
+extern Status XcmsCIEuvYToTekHVC (
+ XcmsCCC /* ccc */,
+ XcmsColor* /* white_point */,
+ XcmsColor* /* colors */,
+ unsigned int /* ncolors */
+);
+
+extern Status XcmsCIExyYToCIEXYZ (
+ XcmsCCC /* ccc */,
+ XcmsColor* /* white_point */,
+ XcmsColor* /* colors */,
+ unsigned int /* ncolors */
+);
+
+extern XcmsColor *XcmsClientWhitePointOfCCC (
+ XcmsCCC /* ccc */
+);
+
+extern Status XcmsConvertColors (
+ XcmsCCC /* ccc */,
+ XcmsColor* /* colorArry_in_out */,
+ unsigned int /* nColors */,
+ XcmsColorFormat /* targetFormat */,
+ Bool* /* compArry_return */
+);
+
+extern XcmsCCC XcmsCreateCCC (
+ Display* /* dpy */,
+ int /* screenNumber */,
+ Visual* /* visual */,
+ XcmsColor* /* clientWhitePt */,
+ XcmsCompressionProc /* gamutCompProc */,
+ XPointer /* gamutCompClientData */,
+ XcmsWhiteAdjustProc /* whitePtAdjProc */,
+ XPointer /* whitePtAdjClientData */
+);
+
+extern XcmsCCC XcmsDefaultCCC (
+ Display* /* dpy */,
+ int /* screenNumber */
+);
+
+extern Display *XcmsDisplayOfCCC (
+ XcmsCCC /* ccc */
+);
+
+extern XcmsColorFormat XcmsFormatOfPrefix (
+ char* /* prefix */
+);
+
+extern void XcmsFreeCCC (
+ XcmsCCC /* ccc */
+);
+
+extern Status XcmsLookupColor (
+ Display* /* dpy */,
+ Colormap /* colormap */,
+ _Xconst char* /* color_string */,
+ XcmsColor* /* pColor_exact_in_out */,
+ XcmsColor* /* pColor_scrn_in_out */,
+ XcmsColorFormat /* result_format */
+);
+
+extern char *XcmsPrefixOfFormat (
+ XcmsColorFormat /* id */
+);
+
+extern Status XcmsQueryBlack (
+ XcmsCCC /* ccc */,
+ XcmsColorFormat /* target_format */,
+ XcmsColor* /* color_return */
+);
+
+extern Status XcmsQueryBlue (
+ XcmsCCC /* ccc */,
+ XcmsColorFormat /* target_format */,
+ XcmsColor* /* color_return */
+);
+
+extern Status XcmsQueryColor (
+ Display* /* dpy */,
+ Colormap /* colormap */,
+ XcmsColor* /* pColor_in_out */,
+ XcmsColorFormat /* result_format */
+);
+
+extern Status XcmsQueryColors (
+ Display* /* dpy */,
+ Colormap /* colormap */,
+ XcmsColor* /* colorArry_in_out */,
+ unsigned int /* nColors */,
+ XcmsColorFormat /* result_format */
+);
+
+extern Status XcmsQueryGreen (
+ XcmsCCC /* ccc */,
+ XcmsColorFormat /* target_format */,
+ XcmsColor* /* color_return */
+);
+
+extern Status XcmsQueryRed (
+ XcmsCCC /* ccc */,
+ XcmsColorFormat /* target_format */,
+ XcmsColor* /* color_return */
+);
+
+extern Status XcmsQueryWhite (
+ XcmsCCC /* ccc */,
+ XcmsColorFormat /* target_format */,
+ XcmsColor* /* color_return */
+);
+
+extern Status XcmsRGBiToCIEXYZ (
+ XcmsCCC /* ccc */,
+ XcmsColor* /* colors */,
+ unsigned int /* ncolors */,
+ Bool* /* compression_flags_return */
+);
+
+extern Status XcmsRGBiToRGB (
+ XcmsCCC /* ccc */,
+ XcmsColor* /* colors */,
+ unsigned int /* ncolors */,
+ Bool* /* compression_flags_return */
+);
+
+extern Status XcmsRGBToRGBi (
+ XcmsCCC /* ccc */,
+ XcmsColor* /* colors */,
+ unsigned int /* ncolors */,
+ Bool* /* compression_flags_return */
+);
+
+extern int XcmsScreenNumberOfCCC (
+ XcmsCCC /* ccc */
+);
+
+extern XcmsColor *XcmsScreenWhitePointOfCCC (
+ XcmsCCC /* ccc */
+);
+
+extern XcmsCCC XcmsSetCCCOfColormap(
+ Display* /* dpy */,
+ Colormap /* colormap */,
+ XcmsCCC /* ccc */
+);
+
+extern XcmsCompressionProc XcmsSetCompressionProc (
+ XcmsCCC /* ccc */,
+ XcmsCompressionProc /* compression_proc */,
+ XPointer /* client_data */
+);
+
+extern XcmsWhiteAdjustProc XcmsSetWhiteAdjustProc (
+ XcmsCCC /* ccc */,
+ XcmsWhiteAdjustProc /* white_adjust_proc */,
+ XPointer /* client_data */
+);
+
+extern Status XcmsSetWhitePoint (
+ XcmsCCC /* ccc */,
+ XcmsColor* /* color */
+);
+
+extern Status XcmsStoreColor (
+ Display* /* dpy */,
+ Colormap /* colormap */,
+ XcmsColor* /* pColor_in */
+);
+
+extern Status XcmsStoreColors (
+ Display* /* dpy */,
+ Colormap /* colormap */,
+ XcmsColor* /* colorArry_in */,
+ unsigned int /* nColors */,
+ Bool* /* compArry_return */
+);
+
+extern Status XcmsTekHVCClipC(
+ XcmsCCC /* ccc */,
+ XcmsColor* /* colors_in_out */,
+ unsigned int /* ncolors */,
+ unsigned int /* index */,
+ Bool* /* compression_flags_return */
+);
+
+extern Status XcmsTekHVCClipV(
+ XcmsCCC /* ccc */,
+ XcmsColor* /* colors_in_out */,
+ unsigned int /* ncolors */,
+ unsigned int /* index */,
+ Bool* /* compression_flags_return */
+);
+
+extern Status XcmsTekHVCClipVC(
+ XcmsCCC /* ccc */,
+ XcmsColor* /* colors_in_out */,
+ unsigned int /* ncolors */,
+ unsigned int /* index */,
+ Bool* /* compression_flags_return */
+);
+
+extern Status XcmsTekHVCQueryMaxC (
+ XcmsCCC /* ccc */,
+ XcmsFloat /* hue */,
+ XcmsFloat /* value */,
+ XcmsColor* /* color_return */
+);
+
+extern Status XcmsTekHVCQueryMaxV (
+ XcmsCCC /* ccc */,
+ XcmsFloat /* hue */,
+ XcmsFloat /* chroma */,
+ XcmsColor* /* color_return */
+);
+
+extern Status XcmsTekHVCQueryMaxVC (
+ XcmsCCC /* ccc */,
+ XcmsFloat /* hue */,
+ XcmsColor* /* color_return */
+);
+
+extern Status XcmsTekHVCQueryMaxVSamples (
+ XcmsCCC /* ccc */,
+ XcmsFloat /* hue */,
+ XcmsColor* /* colors_return */,
+ unsigned int /* nsamples */
+);
+
+extern Status XcmsTekHVCQueryMinV (
+ XcmsCCC /* ccc */,
+ XcmsFloat /* hue */,
+ XcmsFloat /* chroma */,
+ XcmsColor* /* color_return */
+);
+
+extern Status XcmsTekHVCToCIEuvY (
+ XcmsCCC /* ccc */,
+ XcmsColor* /* white_point */,
+ XcmsColor* /* colors */,
+ unsigned int /* ncolors */
+);
+
+extern Status XcmsTekHVCWhiteShiftColors(
+ XcmsCCC /* ccc */,
+ XcmsColor* /* initial_white_point*/,
+ XcmsColor* /* target_white_point*/,
+ XcmsColorFormat /* target_format */,
+ XcmsColor* /* colors_in_out */,
+ unsigned int /* ncolors */,
+ Bool* /* compression_flags_return */
+);
+
+extern Visual *XcmsVisualOfCCC (
+ XcmsCCC /* ccc */
+);
+
+_XFUNCPROTOEND
+
+#endif /* _XCMS_H_ */
diff --git a/sysroot/usr/include/X11/Xdefs.h b/sysroot/usr/include/X11/Xdefs.h
new file mode 100644
index 0000000..5ee2d89
--- /dev/null
+++ b/sysroot/usr/include/X11/Xdefs.h
@@ -0,0 +1,110 @@
+/* $XFree86: xc/include/Xdefs.h,v 1.2 1999/08/22 06:21:20 dawes Exp $ */
+
+/***********************************************************
+
+Copyright (c) 1999 The XFree86 Project Inc.
+
+All Rights Reserved.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The XFree86 Project
+Inc. shall not be used in advertising or otherwise to promote the
+sale, use or other dealings in this Software without prior written
+authorization from The XFree86 Project Inc..
+
+*/
+
+/**
+ ** Types definitions shared between server and clients
+ **/
+
+#ifndef _XDEFS_H
+#define _XDEFS_H
+
+#ifdef _XSERVER64
+#include <X11/Xmd.h>
+#endif
+
+#ifndef _XTYPEDEF_ATOM
+# define _XTYPEDEF_ATOM
+# ifndef _XSERVER64
+typedef unsigned long Atom;
+# else
+typedef CARD32 Atom;
+# endif
+#endif
+
+#ifndef Bool
+# ifndef _XTYPEDEF_BOOL
+# define _XTYPEDEF_BOOL
+typedef int Bool;
+# endif
+#endif
+
+#ifndef _XTYPEDEF_POINTER
+# define _XTYPEDEF_POINTER
+typedef void *pointer;
+#endif
+
+#ifndef _XTYPEDEF_CLIENTPTR
+typedef struct _Client *ClientPtr;
+# define _XTYPEDEF_CLIENTPTR
+#endif
+
+#ifndef _XTYPEDEF_XID
+# define _XTYPEDEF_XID
+# ifndef _XSERVER64
+typedef unsigned long XID;
+# else
+typedef CARD32 XID;
+# endif
+#endif
+
+#ifndef _XTYPEDEF_MASK
+# define _XTYPEDEF_MASK
+# ifndef _XSERVER64
+typedef unsigned long Mask;
+# else
+typedef CARD32 Mask;
+# endif
+#endif
+
+#ifndef _XTYPEDEF_FONTPTR
+# define _XTYPEDEF_FONTPTR
+typedef struct _Font *FontPtr; /* also in fonts/include/font.h */
+#endif
+
+#ifndef _XTYPEDEF_FONT
+# define _XTYPEDEF_FONT
+typedef XID Font;
+#endif
+
+#ifndef _XTYPEDEF_FSID
+# ifndef _XSERVER64
+typedef unsigned long FSID;
+# else
+typedef CARD32 FSID;
+# endif
+#endif
+
+typedef FSID AccContext;
+
+/* OS independent time value
+ XXX Should probably go in Xos.h */
+typedef struct timeval **OSTimePtr;
+
+
+typedef void (* BlockHandlerProcPtr)(pointer /* blockData */,
+ OSTimePtr /* pTimeout */,
+ pointer /* pReadmask */);
+
+#endif
diff --git a/sysroot/usr/include/X11/Xfuncproto.h b/sysroot/usr/include/X11/Xfuncproto.h
new file mode 100644
index 0000000..49f3b59
--- /dev/null
+++ b/sysroot/usr/include/X11/Xfuncproto.h
@@ -0,0 +1,123 @@
+/* Xfuncproto.h. Generated from Xfuncproto.h.in by configure. */
+/* $Xorg: Xfuncproto.h,v 1.4 2001/02/09 02:03:22 xorgcvs Exp $ */
+/*
+ *
+Copyright 1989, 1991, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+ *
+ */
+/* $XFree86: xc/include/Xfuncproto.h,v 3.4 2001/12/14 19:53:25 dawes Exp $ */
+
+/* Definitions to make function prototypes manageable */
+
+#ifndef _XFUNCPROTO_H_
+#define _XFUNCPROTO_H_
+
+#ifndef NeedFunctionPrototypes
+#define NeedFunctionPrototypes 1
+#endif /* NeedFunctionPrototypes */
+
+#ifndef NeedVarargsPrototypes
+#define NeedVarargsPrototypes 1
+#endif /* NeedVarargsPrototypes */
+
+#if NeedFunctionPrototypes
+
+#ifndef NeedNestedPrototypes
+#define NeedNestedPrototypes 1
+#endif /* NeedNestedPrototypes */
+
+#ifndef _Xconst
+#define _Xconst const
+#endif /* _Xconst */
+
+/* Function prototype configuration (see configure for more info) */
+#ifndef NARROWPROTO
+#define NARROWPROTO
+#endif
+#ifndef FUNCPROTO
+#define FUNCPROTO 15
+#endif
+
+#ifndef NeedWidePrototypes
+#ifdef NARROWPROTO
+#define NeedWidePrototypes 0
+#else
+#define NeedWidePrototypes 1 /* default to make interropt. easier */
+#endif
+#endif /* NeedWidePrototypes */
+
+#endif /* NeedFunctionPrototypes */
+
+#ifndef _XFUNCPROTOBEGIN
+#if defined(__cplusplus) || defined(c_plusplus) /* for C++ V2.0 */
+#define _XFUNCPROTOBEGIN extern "C" { /* do not leave open across includes */
+#define _XFUNCPROTOEND }
+#else
+#define _XFUNCPROTOBEGIN
+#define _XFUNCPROTOEND
+#endif
+#endif /* _XFUNCPROTOBEGIN */
+
+#if defined(__GNUC__) && (__GNUC__ >= 4)
+# define _X_SENTINEL(x) __attribute__ ((__sentinel__(x)))
+# define _X_ATTRIBUTE_PRINTF(x,y) __attribute__((__format__(__printf__,x,y)))
+#else
+# define _X_SENTINEL(x)
+# define _X_ATTRIBUTE_PRINTF(x,y)
+#endif /* GNUC >= 4 */
+
+#if defined(__GNUC__) && (__GNUC__ >= 4)
+# define _X_EXPORT __attribute__((visibility("default")))
+# define _X_HIDDEN __attribute__((visibility("hidden")))
+# define _X_INTERNAL __attribute__((visibility("internal")))
+#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
+# define _X_EXPORT __global
+# define _X_HIDDEN __hidden
+# define _X_INTERNAL __hidden
+#else /* not gcc >= 4 and not Sun Studio >= 8 */
+# define _X_EXPORT
+# define _X_HIDDEN
+# define _X_INTERNAL
+#endif /* GNUC >= 4 */
+
+#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 303)
+# define _X_LIKELY(x) __builtin_expect(!!(x), 1)
+# define _X_UNLIKELY(x) __builtin_expect(!!(x), 0)
+# define _X_INLINE inline
+#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
+# define _X_LIKELY(x) (x)
+# define _X_UNLIKELY(x) (x)
+# define _X_INLINE inline
+#else /* not gcc >= 3.3 and not Sun Studio >= 8 */
+# define _X_LIKELY(x) (x)
+# define _X_UNLIKELY(x) (x)
+# define _X_INLINE
+#endif
+
+#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 301)
+# define _X_DEPRECATED __attribute__((deprecated))
+#else /* not gcc >= 3.1 */
+# define _X_DEPRECATED
+#endif
+
+#endif /* _XFUNCPROTO_H_ */
diff --git a/sysroot/usr/include/X11/Xfuncs.h b/sysroot/usr/include/X11/Xfuncs.h
new file mode 100644
index 0000000..2469b69
--- /dev/null
+++ b/sysroot/usr/include/X11/Xfuncs.h
@@ -0,0 +1,98 @@
+/*
+ * $XdotOrg: xc/include/Xfuncs.h,v 1.2 2004/04/23 18:43:05 eich Exp $
+ * $Xorg: Xfuncs.h,v 1.4 2001/02/09 02:03:22 xorgcvs Exp $
+ *
+ *
+Copyright 1990, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+ *
+ */
+/* $XFree86: xc/include/Xfuncs.h,v 3.10 2002/05/31 18:45:38 dawes Exp $ */
+
+#ifndef _XFUNCS_H_
+#define _XFUNCS_H_
+
+#include <X11/Xosdefs.h>
+
+/* the old Xfuncs.h, for pre-R6 */
+#if !(defined(XFree86LOADER) && defined(IN_MODULE))
+
+#ifdef X_USEBFUNCS
+void bcopy();
+void bzero();
+int bcmp();
+#else
+#if defined(SYSV) && !defined(__SCO__) && !defined(sun) && !defined(__UNIXWARE__)
+#include <memory.h>
+void bcopy();
+#define bzero(b,len) memset(b, 0, len)
+#define bcmp(b1,b2,len) memcmp(b1, b2, len)
+#else
+#include <string.h>
+#if defined(__SCO__) || defined(sun) || defined(__UNIXWARE__)
+#include <strings.h>
+#endif
+#define _XFUNCS_H_INCLUDED_STRING_H
+#if defined(sun)
+#define bcopy(b1,b2,len) memmove(b2, b1, (size_t)(len))
+#define bzero(b,len) memset(b, 0, (size_t)(len))
+#define bcmp(b1,b2,len) memcmp(b1, b2, (size_t)(len))
+#endif
+#endif
+#endif /* X_USEBFUNCS */
+
+/* the new Xfuncs.h */
+
+#if !defined(X_NOT_STDC_ENV) && (!defined(sun) || defined(SVR4))
+/* the ANSI C way */
+#ifndef _XFUNCS_H_INCLUDED_STRING_H
+#include <string.h>
+#endif
+#undef bzero
+#define bzero(b,len) memset(b,0,len)
+#else /* else X_NOT_STDC_ENV or SunOS 4 */
+#if defined(SYSV) || defined(luna) || defined(sun) || defined(__sxg__)
+#include <memory.h>
+#define memmove(dst,src,len) bcopy((char *)(src),(char *)(dst),(int)(len))
+#if defined(SYSV) && defined(_XBCOPYFUNC)
+#undef memmove
+#define memmove(dst,src,len) _XBCOPYFUNC((char *)(src),(char *)(dst),(int)(len))
+#define _XNEEDBCOPYFUNC
+#endif
+#else /* else vanilla BSD */
+#define memmove(dst,src,len) bcopy((char *)(src),(char *)(dst),(int)(len))
+#define memcpy(dst,src,len) bcopy((char *)(src),(char *)(dst),(int)(len))
+#define memcmp(b1,b2,len) bcmp((char *)(b1),(char *)(b2),(int)(len))
+#endif /* SYSV else */
+#endif /* ! X_NOT_STDC_ENV else */
+
+#if defined(X_NOT_STDC_ENV) || (defined(sun) && !defined(SVR4))
+#define atexit(f) on_exit(f, 0)
+#endif
+
+#if defined WIN32 && defined __MINGW32__
+#define bcopy(b1,b2,len) memmove(b2, b1, (size_t)(len))
+#endif
+
+#endif /* !(defined(XFree86LOADER) && defined(IN_MODULE)) */
+
+#endif /* _XFUNCS_H_ */
diff --git a/sysroot/usr/include/X11/Xlib.h b/sysroot/usr/include/X11/Xlib.h
new file mode 100644
index 0000000..6266930
--- /dev/null
+++ b/sysroot/usr/include/X11/Xlib.h
@@ -0,0 +1,4013 @@
+/* $XdotOrg: lib/X11/include/X11/Xlib.h,v 1.6 2005-11-08 06:33:25 jkj Exp $ */
+/* $Xorg: Xlib.h,v 1.6 2001/02/09 02:03:38 xorgcvs Exp $ */
+/*
+
+Copyright 1985, 1986, 1987, 1991, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+*/
+/* $XFree86: xc/lib/X11/Xlib.h,v 3.25 2003/11/17 22:20:10 dawes Exp $ */
+
+
+/*
+ * Xlib.h - Header definition and support file for the C subroutine
+ * interface library (Xlib) to the X Window System Protocol (V11).
+ * Structures and symbols starting with "_" are private to the library.
+ */
+#ifndef _XLIB_H_
+#define _XLIB_H_
+
+#define XlibSpecificationRelease 6
+
+#ifdef USG
+#ifndef __TYPES__
+#include <sys/types.h> /* forgot to protect it... */
+#define __TYPES__
+#endif /* __TYPES__ */
+#else
+#if defined(_POSIX_SOURCE) && defined(MOTOROLA)
+#undef _POSIX_SOURCE
+#include <sys/types.h>
+#define _POSIX_SOURCE
+#else
+#include <sys/types.h>
+#endif
+#endif /* USG */
+
+#if defined(__SCO__) || defined(__UNIXWARE__)
+#include <stdint.h>
+#endif
+
+#include <X11/X.h>
+
+/* applications should not depend on these two headers being included! */
+#include <X11/Xfuncproto.h>
+#include <X11/Xosdefs.h>
+
+#ifndef X_WCHAR
+#ifdef X_NOT_STDC_ENV
+#ifndef ISC
+#define X_WCHAR
+#endif
+#endif
+#endif
+
+#ifndef X_WCHAR
+#include <stddef.h>
+#else
+#ifdef __UNIXOS2__
+#include <stdlib.h>
+#else
+/* replace this with #include or typedef appropriate for your system */
+typedef unsigned long wchar_t;
+#endif
+#endif
+
+#if defined(ISC) && defined(USE_XMBTOWC)
+#define wctomb(a,b) _Xwctomb(a,b)
+#define mblen(a,b) _Xmblen(a,b)
+#ifndef USE_XWCHAR_STRING
+#define mbtowc(a,b,c) _Xmbtowc(a,b,c)
+#endif
+#endif
+
+extern int
+_Xmblen(
+#ifdef ISC
+ char const *str,
+ size_t len
+#else
+ char *str,
+ int len
+#endif
+ );
+
+/* API mentioning "UTF8" or "utf8" is an XFree86 extension, introduced in
+ November 2000. Its presence is indicated through the following macro. */
+#define X_HAVE_UTF8_STRING 1
+
+typedef char *XPointer;
+
+#define Bool int
+#define Status int
+#define True 1
+#define False 0
+
+#define QueuedAlready 0
+#define QueuedAfterReading 1
+#define QueuedAfterFlush 2
+
+#define ConnectionNumber(dpy) (((_XPrivDisplay)dpy)->fd)
+#define RootWindow(dpy, scr) (ScreenOfDisplay(dpy,scr)->root)
+#define DefaultScreen(dpy) (((_XPrivDisplay)dpy)->default_screen)
+#define DefaultRootWindow(dpy) (ScreenOfDisplay(dpy,DefaultScreen(dpy))->root)
+#define DefaultVisual(dpy, scr) (ScreenOfDisplay(dpy,scr)->root_visual)
+#define DefaultGC(dpy, scr) (ScreenOfDisplay(dpy,scr)->default_gc)
+#define BlackPixel(dpy, scr) (ScreenOfDisplay(dpy,scr)->black_pixel)
+#define WhitePixel(dpy, scr) (ScreenOfDisplay(dpy,scr)->white_pixel)
+#define AllPlanes ((unsigned long)~0L)
+#define QLength(dpy) (((_XPrivDisplay)dpy)->qlen)
+#define DisplayWidth(dpy, scr) (ScreenOfDisplay(dpy,scr)->width)
+#define DisplayHeight(dpy, scr) (ScreenOfDisplay(dpy,scr)->height)
+#define DisplayWidthMM(dpy, scr)(ScreenOfDisplay(dpy,scr)->mwidth)
+#define DisplayHeightMM(dpy, scr)(ScreenOfDisplay(dpy,scr)->mheight)
+#define DisplayPlanes(dpy, scr) (ScreenOfDisplay(dpy,scr)->root_depth)
+#define DisplayCells(dpy, scr) (DefaultVisual(dpy,scr)->map_entries)
+#define ScreenCount(dpy) (((_XPrivDisplay)dpy)->nscreens)
+#define ServerVendor(dpy) (((_XPrivDisplay)dpy)->vendor)
+#define ProtocolVersion(dpy) (((_XPrivDisplay)dpy)->proto_major_version)
+#define ProtocolRevision(dpy) (((_XPrivDisplay)dpy)->proto_minor_version)
+#define VendorRelease(dpy) (((_XPrivDisplay)dpy)->release)
+#define DisplayString(dpy) (((_XPrivDisplay)dpy)->display_name)
+#define DefaultDepth(dpy, scr) (ScreenOfDisplay(dpy,scr)->root_depth)
+#define DefaultColormap(dpy, scr)(ScreenOfDisplay(dpy,scr)->cmap)
+#define BitmapUnit(dpy) (((_XPrivDisplay)dpy)->bitmap_unit)
+#define BitmapBitOrder(dpy) (((_XPrivDisplay)dpy)->bitmap_bit_order)
+#define BitmapPad(dpy) (((_XPrivDisplay)dpy)->bitmap_pad)
+#define ImageByteOrder(dpy) (((_XPrivDisplay)dpy)->byte_order)
+#ifdef CRAY /* unable to get WORD64 without pulling in other symbols */
+#define NextRequest(dpy) XNextRequest(dpy)
+#else
+#define NextRequest(dpy) (((_XPrivDisplay)dpy)->request + 1)
+#endif
+#define LastKnownRequestProcessed(dpy) (((_XPrivDisplay)dpy)->last_request_read)
+
+/* macros for screen oriented applications (toolkit) */
+#define ScreenOfDisplay(dpy, scr)(&((_XPrivDisplay)dpy)->screens[scr])
+#define DefaultScreenOfDisplay(dpy) ScreenOfDisplay(dpy,DefaultScreen(dpy))
+#define DisplayOfScreen(s) ((s)->display)
+#define RootWindowOfScreen(s) ((s)->root)
+#define BlackPixelOfScreen(s) ((s)->black_pixel)
+#define WhitePixelOfScreen(s) ((s)->white_pixel)
+#define DefaultColormapOfScreen(s)((s)->cmap)
+#define DefaultDepthOfScreen(s) ((s)->root_depth)
+#define DefaultGCOfScreen(s) ((s)->default_gc)
+#define DefaultVisualOfScreen(s)((s)->root_visual)
+#define WidthOfScreen(s) ((s)->width)
+#define HeightOfScreen(s) ((s)->height)
+#define WidthMMOfScreen(s) ((s)->mwidth)
+#define HeightMMOfScreen(s) ((s)->mheight)
+#define PlanesOfScreen(s) ((s)->root_depth)
+#define CellsOfScreen(s) (DefaultVisualOfScreen((s))->map_entries)
+#define MinCmapsOfScreen(s) ((s)->min_maps)
+#define MaxCmapsOfScreen(s) ((s)->max_maps)
+#define DoesSaveUnders(s) ((s)->save_unders)
+#define DoesBackingStore(s) ((s)->backing_store)
+#define EventMaskOfScreen(s) ((s)->root_input_mask)
+
+/*
+ * Extensions need a way to hang private data on some structures.
+ */
+typedef struct _XExtData {
+ int number; /* number returned by XRegisterExtension */
+ struct _XExtData *next; /* next item on list of data for structure */
+ int (*free_private)( /* called to free private storage */
+ struct _XExtData *extension
+ );
+ XPointer private_data; /* data private to this extension. */
+} XExtData;
+
+/*
+ * This file contains structures used by the extension mechanism.
+ */
+typedef struct { /* public to extension, cannot be changed */
+ int extension; /* extension number */
+ int major_opcode; /* major op-code assigned by server */
+ int first_event; /* first event number for the extension */
+ int first_error; /* first error number for the extension */
+} XExtCodes;
+
+/*
+ * Data structure for retrieving info about pixmap formats.
+ */
+
+typedef struct {
+ int depth;
+ int bits_per_pixel;
+ int scanline_pad;
+} XPixmapFormatValues;
+
+
+/*
+ * Data structure for setting graphics context.
+ */
+typedef struct {
+ int function; /* logical operation */
+ unsigned long plane_mask;/* plane mask */
+ unsigned long foreground;/* foreground pixel */
+ unsigned long background;/* background pixel */
+ int line_width; /* line width */
+ int line_style; /* LineSolid, LineOnOffDash, LineDoubleDash */
+ int cap_style; /* CapNotLast, CapButt,
+ CapRound, CapProjecting */
+ int join_style; /* JoinMiter, JoinRound, JoinBevel */
+ int fill_style; /* FillSolid, FillTiled,
+ FillStippled, FillOpaeueStippled */
+ int fill_rule; /* EvenOddRule, WindingRule */
+ int arc_mode; /* ArcChord, ArcPieSlice */
+ Pixmap tile; /* tile pixmap for tiling operations */
+ Pixmap stipple; /* stipple 1 plane pixmap for stipping */
+ int ts_x_origin; /* offset for tile or stipple operations */
+ int ts_y_origin;
+ Font font; /* default text font for text operations */
+ int subwindow_mode; /* ClipByChildren, IncludeInferiors */
+ Bool graphics_exposures;/* boolean, should exposures be generated */
+ int clip_x_origin; /* origin for clipping */
+ int clip_y_origin;
+ Pixmap clip_mask; /* bitmap clipping; other calls for rects */
+ int dash_offset; /* patterned/dashed line information */
+ char dashes;
+} XGCValues;
+
+/*
+ * Graphics context. The contents of this structure are implementation
+ * dependent. A GC should be treated as opaque by application code.
+ */
+
+typedef struct _XGC
+#ifdef XLIB_ILLEGAL_ACCESS
+{
+ XExtData *ext_data; /* hook for extension to hang data */
+ GContext gid; /* protocol ID for graphics context */
+ /* there is more to this structure, but it is private to Xlib */
+}
+#endif
+*GC;
+
+/*
+ * Visual structure; contains information about colormapping possible.
+ */
+typedef struct {
+ XExtData *ext_data; /* hook for extension to hang data */
+ VisualID visualid; /* visual id of this visual */
+#if defined(__cplusplus) || defined(c_plusplus)
+ int c_class; /* C++ class of screen (monochrome, etc.) */
+#else
+ int class; /* class of screen (monochrome, etc.) */
+#endif
+ unsigned long red_mask, green_mask, blue_mask; /* mask values */
+ int bits_per_rgb; /* log base 2 of distinct color values */
+ int map_entries; /* color map entries */
+} Visual;
+
+/*
+ * Depth structure; contains information for each possible depth.
+ */
+typedef struct {
+ int depth; /* this depth (Z) of the depth */
+ int nvisuals; /* number of Visual types at this depth */
+ Visual *visuals; /* list of visuals possible at this depth */
+} Depth;
+
+/*
+ * Information about the screen. The contents of this structure are
+ * implementation dependent. A Screen should be treated as opaque
+ * by application code.
+ */
+
+struct _XDisplay; /* Forward declare before use for C++ */
+
+typedef struct {
+ XExtData *ext_data; /* hook for extension to hang data */
+ struct _XDisplay *display;/* back pointer to display structure */
+ Window root; /* Root window id. */
+ int width, height; /* width and height of screen */
+ int mwidth, mheight; /* width and height of in millimeters */
+ int ndepths; /* number of depths possible */
+ Depth *depths; /* list of allowable depths on the screen */
+ int root_depth; /* bits per pixel */
+ Visual *root_visual; /* root visual */
+ GC default_gc; /* GC for the root root visual */
+ Colormap cmap; /* default color map */
+ unsigned long white_pixel;
+ unsigned long black_pixel; /* White and Black pixel values */
+ int max_maps, min_maps; /* max and min color maps */
+ int backing_store; /* Never, WhenMapped, Always */
+ Bool save_unders;
+ long root_input_mask; /* initial root input mask */
+} Screen;
+
+/*
+ * Format structure; describes ZFormat data the screen will understand.
+ */
+typedef struct {
+ XExtData *ext_data; /* hook for extension to hang data */
+ int depth; /* depth of this image format */
+ int bits_per_pixel; /* bits/pixel at this depth */
+ int scanline_pad; /* scanline must padded to this multiple */
+} ScreenFormat;
+
+/*
+ * Data structure for setting window attributes.
+ */
+typedef struct {
+ Pixmap background_pixmap; /* background or None or ParentRelative */
+ unsigned long background_pixel; /* background pixel */
+ Pixmap border_pixmap; /* border of the window */
+ unsigned long border_pixel; /* border pixel value */
+ int bit_gravity; /* one of bit gravity values */
+ int win_gravity; /* one of the window gravity values */
+ int backing_store; /* NotUseful, WhenMapped, Always */
+ unsigned long backing_planes;/* planes to be preseved if possible */
+ unsigned long backing_pixel;/* value to use in restoring planes */
+ Bool save_under; /* should bits under be saved? (popups) */
+ long event_mask; /* set of events that should be saved */
+ long do_not_propagate_mask; /* set of events that should not propagate */
+ Bool override_redirect; /* boolean value for override-redirect */
+ Colormap colormap; /* color map to be associated with window */
+ Cursor cursor; /* cursor to be displayed (or None) */
+} XSetWindowAttributes;
+
+typedef struct {
+ int x, y; /* location of window */
+ int width, height; /* width and height of window */
+ int border_width; /* border width of window */
+ int depth; /* depth of window */
+ Visual *visual; /* the associated visual structure */
+ Window root; /* root of screen containing window */
+#if defined(__cplusplus) || defined(c_plusplus)
+ int c_class; /* C++ InputOutput, InputOnly*/
+#else
+ int class; /* InputOutput, InputOnly*/
+#endif
+ int bit_gravity; /* one of bit gravity values */
+ int win_gravity; /* one of the window gravity values */
+ int backing_store; /* NotUseful, WhenMapped, Always */
+ unsigned long backing_planes;/* planes to be preserved if possible */
+ unsigned long backing_pixel;/* value to be used when restoring planes */
+ Bool save_under; /* boolean, should bits under be saved? */
+ Colormap colormap; /* color map to be associated with window */
+ Bool map_installed; /* boolean, is color map currently installed*/
+ int map_state; /* IsUnmapped, IsUnviewable, IsViewable */
+ long all_event_masks; /* set of events all people have interest in*/
+ long your_event_mask; /* my event mask */
+ long do_not_propagate_mask; /* set of events that should not propagate */
+ Bool override_redirect; /* boolean value for override-redirect */
+ Screen *screen; /* back pointer to correct screen */
+} XWindowAttributes;
+
+/*
+ * Data structure for host setting; getting routines.
+ *
+ */
+
+typedef struct {
+ int family; /* for example FamilyInternet */
+ int length; /* length of address, in bytes */
+ char *address; /* pointer to where to find the bytes */
+} XHostAddress;
+
+/*
+ * Data structure for ServerFamilyInterpreted addresses in host routines
+ */
+typedef struct {
+ int typelength; /* length of type string, in bytes */
+ int valuelength; /* length of value string, in bytes */
+ char *type; /* pointer to where to find the type string */
+ char *value; /* pointer to where to find the address */
+} XServerInterpretedAddress;
+
+/*
+ * Data structure for "image" data, used by image manipulation routines.
+ */
+typedef struct _XImage {
+ int width, height; /* size of image */
+ int xoffset; /* number of pixels offset in X direction */
+ int format; /* XYBitmap, XYPixmap, ZPixmap */
+ char *data; /* pointer to image data */
+ int byte_order; /* data byte order, LSBFirst, MSBFirst */
+ int bitmap_unit; /* quant. of scanline 8, 16, 32 */
+ int bitmap_bit_order; /* LSBFirst, MSBFirst */
+ int bitmap_pad; /* 8, 16, 32 either XY or ZPixmap */
+ int depth; /* depth of image */
+ int bytes_per_line; /* accelarator to next line */
+ int bits_per_pixel; /* bits per pixel (ZPixmap) */
+ unsigned long red_mask; /* bits in z arrangment */
+ unsigned long green_mask;
+ unsigned long blue_mask;
+ XPointer obdata; /* hook for the object routines to hang on */
+ struct funcs { /* image manipulation routines */
+ struct _XImage *(*create_image)(
+ struct _XDisplay* /* display */,
+ Visual* /* visual */,
+ unsigned int /* depth */,
+ int /* format */,
+ int /* offset */,
+ char* /* data */,
+ unsigned int /* width */,
+ unsigned int /* height */,
+ int /* bitmap_pad */,
+ int /* bytes_per_line */);
+ int (*destroy_image) (struct _XImage *);
+ unsigned long (*get_pixel) (struct _XImage *, int, int);
+ int (*put_pixel) (struct _XImage *, int, int, unsigned long);
+ struct _XImage *(*sub_image)(struct _XImage *, int, int, unsigned int, unsigned int);
+ int (*add_pixel) (struct _XImage *, long);
+ } f;
+} XImage;
+
+/*
+ * Data structure for XReconfigureWindow
+ */
+typedef struct {
+ int x, y;
+ int width, height;
+ int border_width;
+ Window sibling;
+ int stack_mode;
+} XWindowChanges;
+
+/*
+ * Data structure used by color operations
+ */
+typedef struct {
+ unsigned long pixel;
+ unsigned short red, green, blue;
+ char flags; /* do_red, do_green, do_blue */
+ char pad;
+} XColor;
+
+/*
+ * Data structures for graphics operations. On most machines, these are
+ * congruent with the wire protocol structures, so reformatting the data
+ * can be avoided on these architectures.
+ */
+typedef struct {
+ short x1, y1, x2, y2;
+} XSegment;
+
+typedef struct {
+ short x, y;
+} XPoint;
+
+typedef struct {
+ short x, y;
+ unsigned short width, height;
+} XRectangle;
+
+typedef struct {
+ short x, y;
+ unsigned short width, height;
+ short angle1, angle2;
+} XArc;
+
+
+/* Data structure for XChangeKeyboardControl */
+
+typedef struct {
+ int key_click_percent;
+ int bell_percent;
+ int bell_pitch;
+ int bell_duration;
+ int led;
+ int led_mode;
+ int key;
+ int auto_repeat_mode; /* On, Off, Default */
+} XKeyboardControl;
+
+/* Data structure for XGetKeyboardControl */
+
+typedef struct {
+ int key_click_percent;
+ int bell_percent;
+ unsigned int bell_pitch, bell_duration;
+ unsigned long led_mask;
+ int global_auto_repeat;
+ char auto_repeats[32];
+} XKeyboardState;
+
+/* Data structure for XGetMotionEvents. */
+
+typedef struct {
+ Time time;
+ short x, y;
+} XTimeCoord;
+
+/* Data structure for X{Set,Get}ModifierMapping */
+
+typedef struct {
+ int max_keypermod; /* The server's max # of keys per modifier */
+ KeyCode *modifiermap; /* An 8 by max_keypermod array of modifiers */
+} XModifierKeymap;
+
+
+/*
+ * Display datatype maintaining display specific data.
+ * The contents of this structure are implementation dependent.
+ * A Display should be treated as opaque by application code.
+ */
+#ifndef XLIB_ILLEGAL_ACCESS
+typedef struct _XDisplay Display;
+#endif
+
+struct _XPrivate; /* Forward declare before use for C++ */
+struct _XrmHashBucketRec;
+
+typedef struct
+#ifdef XLIB_ILLEGAL_ACCESS
+_XDisplay
+#endif
+{
+ XExtData *ext_data; /* hook for extension to hang data */
+ struct _XPrivate *private1;
+ int fd; /* Network socket. */
+ int private2;
+ int proto_major_version;/* major version of server's X protocol */
+ int proto_minor_version;/* minor version of servers X protocol */
+ char *vendor; /* vendor of the server hardware */
+ XID private3;
+ XID private4;
+ XID private5;
+ int private6;
+ XID (*resource_alloc)( /* allocator function */
+ struct _XDisplay*
+ );
+ int byte_order; /* screen byte order, LSBFirst, MSBFirst */
+ int bitmap_unit; /* padding and data requirements */
+ int bitmap_pad; /* padding requirements on bitmaps */
+ int bitmap_bit_order; /* LeastSignificant or MostSignificant */
+ int nformats; /* number of pixmap formats in list */
+ ScreenFormat *pixmap_format; /* pixmap format list */
+ int private8;
+ int release; /* release of the server */
+ struct _XPrivate *private9, *private10;
+ int qlen; /* Length of input event queue */
+ unsigned long last_request_read; /* seq number of last event read */
+ unsigned long request; /* sequence number of last request. */
+ XPointer private11;
+ XPointer private12;
+ XPointer private13;
+ XPointer private14;
+ unsigned max_request_size; /* maximum number 32 bit words in request*/
+ struct _XrmHashBucketRec *db;
+ int (*private15)(
+ struct _XDisplay*
+ );
+ char *display_name; /* "host:display" string used on this connect*/
+ int default_screen; /* default screen for operations */
+ int nscreens; /* number of screens on this server*/
+ Screen *screens; /* pointer to list of screens */
+ unsigned long motion_buffer; /* size of motion buffer */
+ unsigned long private16;
+ int min_keycode; /* minimum defined keycode */
+ int max_keycode; /* maximum defined keycode */
+ XPointer private17;
+ XPointer private18;
+ int private19;
+ char *xdefaults; /* contents of defaults from server */
+ /* there is more to this structure, but it is private to Xlib */
+}
+#ifdef XLIB_ILLEGAL_ACCESS
+Display,
+#endif
+*_XPrivDisplay;
+
+#undef _XEVENT_
+#ifndef _XEVENT_
+/*
+ * Definitions of specific events.
+ */
+typedef struct {
+ int type; /* of event */
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window; /* "event" window it is reported relative to */
+ Window root; /* root window that the event occurred on */
+ Window subwindow; /* child window */
+ Time time; /* milliseconds */
+ int x, y; /* pointer x, y coordinates in event window */
+ int x_root, y_root; /* coordinates relative to root */
+ unsigned int state; /* key or button mask */
+ unsigned int keycode; /* detail */
+ Bool same_screen; /* same screen flag */
+} XKeyEvent;
+typedef XKeyEvent XKeyPressedEvent;
+typedef XKeyEvent XKeyReleasedEvent;
+
+typedef struct {
+ int type; /* of event */
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window; /* "event" window it is reported relative to */
+ Window root; /* root window that the event occurred on */
+ Window subwindow; /* child window */
+ Time time; /* milliseconds */
+ int x, y; /* pointer x, y coordinates in event window */
+ int x_root, y_root; /* coordinates relative to root */
+ unsigned int state; /* key or button mask */
+ unsigned int button; /* detail */
+ Bool same_screen; /* same screen flag */
+} XButtonEvent;
+typedef XButtonEvent XButtonPressedEvent;
+typedef XButtonEvent XButtonReleasedEvent;
+
+typedef struct {
+ int type; /* of event */
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window; /* "event" window reported relative to */
+ Window root; /* root window that the event occurred on */
+ Window subwindow; /* child window */
+ Time time; /* milliseconds */
+ int x, y; /* pointer x, y coordinates in event window */
+ int x_root, y_root; /* coordinates relative to root */
+ unsigned int state; /* key or button mask */
+ char is_hint; /* detail */
+ Bool same_screen; /* same screen flag */
+} XMotionEvent;
+typedef XMotionEvent XPointerMovedEvent;
+
+typedef struct {
+ int type; /* of event */
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window; /* "event" window reported relative to */
+ Window root; /* root window that the event occurred on */
+ Window subwindow; /* child window */
+ Time time; /* milliseconds */
+ int x, y; /* pointer x, y coordinates in event window */
+ int x_root, y_root; /* coordinates relative to root */
+ int mode; /* NotifyNormal, NotifyGrab, NotifyUngrab */
+ int detail;
+ /*
+ * NotifyAncestor, NotifyVirtual, NotifyInferior,
+ * NotifyNonlinear,NotifyNonlinearVirtual
+ */
+ Bool same_screen; /* same screen flag */
+ Bool focus; /* boolean focus */
+ unsigned int state; /* key or button mask */
+} XCrossingEvent;
+typedef XCrossingEvent XEnterWindowEvent;
+typedef XCrossingEvent XLeaveWindowEvent;
+
+typedef struct {
+ int type; /* FocusIn or FocusOut */
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window; /* window of event */
+ int mode; /* NotifyNormal, NotifyWhileGrabbed,
+ NotifyGrab, NotifyUngrab */
+ int detail;
+ /*
+ * NotifyAncestor, NotifyVirtual, NotifyInferior,
+ * NotifyNonlinear,NotifyNonlinearVirtual, NotifyPointer,
+ * NotifyPointerRoot, NotifyDetailNone
+ */
+} XFocusChangeEvent;
+typedef XFocusChangeEvent XFocusInEvent;
+typedef XFocusChangeEvent XFocusOutEvent;
+
+/* generated on EnterWindow and FocusIn when KeyMapState selected */
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window;
+ char key_vector[32];
+} XKeymapEvent;
+
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window;
+ int x, y;
+ int width, height;
+ int count; /* if non-zero, at least this many more */
+} XExposeEvent;
+
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Drawable drawable;
+ int x, y;
+ int width, height;
+ int count; /* if non-zero, at least this many more */
+ int major_code; /* core is CopyArea or CopyPlane */
+ int minor_code; /* not defined in the core */
+} XGraphicsExposeEvent;
+
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Drawable drawable;
+ int major_code; /* core is CopyArea or CopyPlane */
+ int minor_code; /* not defined in the core */
+} XNoExposeEvent;
+
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window;
+ int state; /* Visibility state */
+} XVisibilityEvent;
+
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window parent; /* parent of the window */
+ Window window; /* window id of window created */
+ int x, y; /* window location */
+ int width, height; /* size of window */
+ int border_width; /* border width */
+ Bool override_redirect; /* creation should be overridden */
+} XCreateWindowEvent;
+
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window event;
+ Window window;
+} XDestroyWindowEvent;
+
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window event;
+ Window window;
+ Bool from_configure;
+} XUnmapEvent;
+
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window event;
+ Window window;
+ Bool override_redirect; /* boolean, is override set... */
+} XMapEvent;
+
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window parent;
+ Window window;
+} XMapRequestEvent;
+
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window event;
+ Window window;
+ Window parent;
+ int x, y;
+ Bool override_redirect;
+} XReparentEvent;
+
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window event;
+ Window window;
+ int x, y;
+ int width, height;
+ int border_width;
+ Window above;
+ Bool override_redirect;
+} XConfigureEvent;
+
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window event;
+ Window window;
+ int x, y;
+} XGravityEvent;
+
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window;
+ int width, height;
+} XResizeRequestEvent;
+
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window parent;
+ Window window;
+ int x, y;
+ int width, height;
+ int border_width;
+ Window above;
+ int detail; /* Above, Below, TopIf, BottomIf, Opposite */
+ unsigned long value_mask;
+} XConfigureRequestEvent;
+
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window event;
+ Window window;
+ int place; /* PlaceOnTop, PlaceOnBottom */
+} XCirculateEvent;
+
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window parent;
+ Window window;
+ int place; /* PlaceOnTop, PlaceOnBottom */
+} XCirculateRequestEvent;
+
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window;
+ Atom atom;
+ Time time;
+ int state; /* NewValue, Deleted */
+} XPropertyEvent;
+
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window;
+ Atom selection;
+ Time time;
+} XSelectionClearEvent;
+
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window owner;
+ Window requestor;
+ Atom selection;
+ Atom target;
+ Atom property;
+ Time time;
+} XSelectionRequestEvent;
+
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window requestor;
+ Atom selection;
+ Atom target;
+ Atom property; /* ATOM or None */
+ Time time;
+} XSelectionEvent;
+
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window;
+ Colormap colormap; /* COLORMAP or None */
+#if defined(__cplusplus) || defined(c_plusplus)
+ Bool c_new; /* C++ */
+#else
+ Bool new;
+#endif
+ int state; /* ColormapInstalled, ColormapUninstalled */
+} XColormapEvent;
+
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window;
+ Atom message_type;
+ int format;
+ union {
+ char b[20];
+ short s[10];
+ long l[5];
+ } data;
+} XClientMessageEvent;
+
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window; /* unused */
+ int request; /* one of MappingModifier, MappingKeyboard,
+ MappingPointer */
+ int first_keycode; /* first keycode */
+ int count; /* defines range of change w. first_keycode*/
+} XMappingEvent;
+
+typedef struct {
+ int type;
+ Display *display; /* Display the event was read from */
+ XID resourceid; /* resource id */
+ unsigned long serial; /* serial number of failed request */
+ unsigned char error_code; /* error code of failed request */
+ unsigned char request_code; /* Major op-code of failed request */
+ unsigned char minor_code; /* Minor op-code of failed request */
+} XErrorEvent;
+
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display;/* Display the event was read from */
+ Window window; /* window on which event was requested in event mask */
+} XAnyEvent;
+
+/*
+ * this union is defined so Xlib can always use the same sized
+ * event structure internally, to avoid memory fragmentation.
+ */
+typedef union _XEvent {
+ int type; /* must not be changed; first element */
+ XAnyEvent xany;
+ XKeyEvent xkey;
+ XButtonEvent xbutton;
+ XMotionEvent xmotion;
+ XCrossingEvent xcrossing;
+ XFocusChangeEvent xfocus;
+ XExposeEvent xexpose;
+ XGraphicsExposeEvent xgraphicsexpose;
+ XNoExposeEvent xnoexpose;
+ XVisibilityEvent xvisibility;
+ XCreateWindowEvent xcreatewindow;
+ XDestroyWindowEvent xdestroywindow;
+ XUnmapEvent xunmap;
+ XMapEvent xmap;
+ XMapRequestEvent xmaprequest;
+ XReparentEvent xreparent;
+ XConfigureEvent xconfigure;
+ XGravityEvent xgravity;
+ XResizeRequestEvent xresizerequest;
+ XConfigureRequestEvent xconfigurerequest;
+ XCirculateEvent xcirculate;
+ XCirculateRequestEvent xcirculaterequest;
+ XPropertyEvent xproperty;
+ XSelectionClearEvent xselectionclear;
+ XSelectionRequestEvent xselectionrequest;
+ XSelectionEvent xselection;
+ XColormapEvent xcolormap;
+ XClientMessageEvent xclient;
+ XMappingEvent xmapping;
+ XErrorEvent xerror;
+ XKeymapEvent xkeymap;
+ long pad[24];
+} XEvent;
+#endif
+
+#define XAllocID(dpy) ((*((_XPrivDisplay)dpy)->resource_alloc)((dpy)))
+
+/*
+ * per character font metric information.
+ */
+typedef struct {
+ short lbearing; /* origin to left edge of raster */
+ short rbearing; /* origin to right edge of raster */
+ short width; /* advance to next char's origin */
+ short ascent; /* baseline to top edge of raster */
+ short descent; /* baseline to bottom edge of raster */
+ unsigned short attributes; /* per char flags (not predefined) */
+} XCharStruct;
+
+/*
+ * To allow arbitrary information with fonts, there are additional properties
+ * returned.
+ */
+typedef struct {
+ Atom name;
+ unsigned long card32;
+} XFontProp;
+
+typedef struct {
+ XExtData *ext_data; /* hook for extension to hang data */
+ Font fid; /* Font id for this font */
+ unsigned direction; /* hint about direction the font is painted */
+ unsigned min_char_or_byte2;/* first character */
+ unsigned max_char_or_byte2;/* last character */
+ unsigned min_byte1; /* first row that exists */
+ unsigned max_byte1; /* last row that exists */
+ Bool all_chars_exist;/* flag if all characters have non-zero size*/
+ unsigned default_char; /* char to print for undefined character */
+ int n_properties; /* how many properties there are */
+ XFontProp *properties; /* pointer to array of additional properties*/
+ XCharStruct min_bounds; /* minimum bounds over all existing char*/
+ XCharStruct max_bounds; /* maximum bounds over all existing char*/
+ XCharStruct *per_char; /* first_char to last_char information */
+ int ascent; /* log. extent above baseline for spacing */
+ int descent; /* log. descent below baseline for spacing */
+} XFontStruct;
+
+/*
+ * PolyText routines take these as arguments.
+ */
+typedef struct {
+ char *chars; /* pointer to string */
+ int nchars; /* number of characters */
+ int delta; /* delta between strings */
+ Font font; /* font to print it in, None don't change */
+} XTextItem;
+
+typedef struct { /* normal 16 bit characters are two bytes */
+ unsigned char byte1;
+ unsigned char byte2;
+}
+#if defined(__GNUC__) && defined(__arm__) && !defined(__ARM_EABI__)
+__attribute__ ((packed))
+#endif
+XChar2b;
+
+
+typedef struct {
+ XChar2b *chars; /* two byte characters */
+ int nchars; /* number of characters */
+ int delta; /* delta between strings */
+ Font font; /* font to print it in, None don't change */
+} XTextItem16;
+
+
+typedef union { Display *display;
+ GC gc;
+ Visual *visual;
+ Screen *screen;
+ ScreenFormat *pixmap_format;
+ XFontStruct *font; } XEDataObject;
+
+typedef struct {
+ XRectangle max_ink_extent;
+ XRectangle max_logical_extent;
+} XFontSetExtents;
+
+/* unused:
+typedef void (*XOMProc)();
+ */
+
+typedef struct _XOM *XOM;
+typedef struct _XOC *XOC, *XFontSet;
+
+typedef struct {
+ char *chars;
+ int nchars;
+ int delta;
+ XFontSet font_set;
+} XmbTextItem;
+
+typedef struct {
+ wchar_t *chars;
+ int nchars;
+ int delta;
+ XFontSet font_set;
+} XwcTextItem;
+
+#define XNRequiredCharSet "requiredCharSet"
+#define XNQueryOrientation "queryOrientation"
+#define XNBaseFontName "baseFontName"
+#define XNOMAutomatic "omAutomatic"
+#define XNMissingCharSet "missingCharSet"
+#define XNDefaultString "defaultString"
+#define XNOrientation "orientation"
+#define XNDirectionalDependentDrawing "directionalDependentDrawing"
+#define XNContextualDrawing "contextualDrawing"
+#define XNFontInfo "fontInfo"
+
+typedef struct {
+ int charset_count;
+ char **charset_list;
+} XOMCharSetList;
+
+typedef enum {
+ XOMOrientation_LTR_TTB,
+ XOMOrientation_RTL_TTB,
+ XOMOrientation_TTB_LTR,
+ XOMOrientation_TTB_RTL,
+ XOMOrientation_Context
+} XOrientation;
+
+typedef struct {
+ int num_orientation;
+ XOrientation *orientation; /* Input Text description */
+} XOMOrientation;
+
+typedef struct {
+ int num_font;
+ XFontStruct **font_struct_list;
+ char **font_name_list;
+} XOMFontInfo;
+
+typedef struct _XIM *XIM;
+typedef struct _XIC *XIC;
+
+typedef void (*XIMProc)(
+ XIM,
+ XPointer,
+ XPointer
+);
+
+typedef Bool (*XICProc)(
+ XIC,
+ XPointer,
+ XPointer
+);
+
+typedef void (*XIDProc)(
+ Display*,
+ XPointer,
+ XPointer
+);
+
+typedef unsigned long XIMStyle;
+
+typedef struct {
+ unsigned short count_styles;
+ XIMStyle *supported_styles;
+} XIMStyles;
+
+#define XIMPreeditArea 0x0001L
+#define XIMPreeditCallbacks 0x0002L
+#define XIMPreeditPosition 0x0004L
+#define XIMPreeditNothing 0x0008L
+#define XIMPreeditNone 0x0010L
+#define XIMStatusArea 0x0100L
+#define XIMStatusCallbacks 0x0200L
+#define XIMStatusNothing 0x0400L
+#define XIMStatusNone 0x0800L
+
+#define XNVaNestedList "XNVaNestedList"
+#define XNQueryInputStyle "queryInputStyle"
+#define XNClientWindow "clientWindow"
+#define XNInputStyle "inputStyle"
+#define XNFocusWindow "focusWindow"
+#define XNResourceName "resourceName"
+#define XNResourceClass "resourceClass"
+#define XNGeometryCallback "geometryCallback"
+#define XNDestroyCallback "destroyCallback"
+#define XNFilterEvents "filterEvents"
+#define XNPreeditStartCallback "preeditStartCallback"
+#define XNPreeditDoneCallback "preeditDoneCallback"
+#define XNPreeditDrawCallback "preeditDrawCallback"
+#define XNPreeditCaretCallback "preeditCaretCallback"
+#define XNPreeditStateNotifyCallback "preeditStateNotifyCallback"
+#define XNPreeditAttributes "preeditAttributes"
+#define XNStatusStartCallback "statusStartCallback"
+#define XNStatusDoneCallback "statusDoneCallback"
+#define XNStatusDrawCallback "statusDrawCallback"
+#define XNStatusAttributes "statusAttributes"
+#define XNArea "area"
+#define XNAreaNeeded "areaNeeded"
+#define XNSpotLocation "spotLocation"
+#define XNColormap "colorMap"
+#define XNStdColormap "stdColorMap"
+#define XNForeground "foreground"
+#define XNBackground "background"
+#define XNBackgroundPixmap "backgroundPixmap"
+#define XNFontSet "fontSet"
+#define XNLineSpace "lineSpace"
+#define XNCursor "cursor"
+
+#define XNQueryIMValuesList "queryIMValuesList"
+#define XNQueryICValuesList "queryICValuesList"
+#define XNVisiblePosition "visiblePosition"
+#define XNR6PreeditCallback "r6PreeditCallback"
+#define XNStringConversionCallback "stringConversionCallback"
+#define XNStringConversion "stringConversion"
+#define XNResetState "resetState"
+#define XNHotKey "hotKey"
+#define XNHotKeyState "hotKeyState"
+#define XNPreeditState "preeditState"
+#define XNSeparatorofNestedList "separatorofNestedList"
+
+#define XBufferOverflow -1
+#define XLookupNone 1
+#define XLookupChars 2
+#define XLookupKeySym 3
+#define XLookupBoth 4
+
+typedef void *XVaNestedList;
+
+typedef struct {
+ XPointer client_data;
+ XIMProc callback;
+} XIMCallback;
+
+typedef struct {
+ XPointer client_data;
+ XICProc callback;
+} XICCallback;
+
+typedef unsigned long XIMFeedback;
+
+#define XIMReverse 1L
+#define XIMUnderline (1L<<1)
+#define XIMHighlight (1L<<2)
+#define XIMPrimary (1L<<5)
+#define XIMSecondary (1L<<6)
+#define XIMTertiary (1L<<7)
+#define XIMVisibleToForward (1L<<8)
+#define XIMVisibleToBackword (1L<<9)
+#define XIMVisibleToCenter (1L<<10)
+
+typedef struct _XIMText {
+ unsigned short length;
+ XIMFeedback *feedback;
+ Bool encoding_is_wchar;
+ union {
+ char *multi_byte;
+ wchar_t *wide_char;
+ } string;
+} XIMText;
+
+typedef unsigned long XIMPreeditState;
+
+#define XIMPreeditUnKnown 0L
+#define XIMPreeditEnable 1L
+#define XIMPreeditDisable (1L<<1)
+
+typedef struct _XIMPreeditStateNotifyCallbackStruct {
+ XIMPreeditState state;
+} XIMPreeditStateNotifyCallbackStruct;
+
+typedef unsigned long XIMResetState;
+
+#define XIMInitialState 1L
+#define XIMPreserveState (1L<<1)
+
+typedef unsigned long XIMStringConversionFeedback;
+
+#define XIMStringConversionLeftEdge (0x00000001)
+#define XIMStringConversionRightEdge (0x00000002)
+#define XIMStringConversionTopEdge (0x00000004)
+#define XIMStringConversionBottomEdge (0x00000008)
+#define XIMStringConversionConcealed (0x00000010)
+#define XIMStringConversionWrapped (0x00000020)
+
+typedef struct _XIMStringConversionText {
+ unsigned short length;
+ XIMStringConversionFeedback *feedback;
+ Bool encoding_is_wchar;
+ union {
+ char *mbs;
+ wchar_t *wcs;
+ } string;
+} XIMStringConversionText;
+
+typedef unsigned short XIMStringConversionPosition;
+
+typedef unsigned short XIMStringConversionType;
+
+#define XIMStringConversionBuffer (0x0001)
+#define XIMStringConversionLine (0x0002)
+#define XIMStringConversionWord (0x0003)
+#define XIMStringConversionChar (0x0004)
+
+typedef unsigned short XIMStringConversionOperation;
+
+#define XIMStringConversionSubstitution (0x0001)
+#define XIMStringConversionRetrieval (0x0002)
+
+typedef enum {
+ XIMForwardChar, XIMBackwardChar,
+ XIMForwardWord, XIMBackwardWord,
+ XIMCaretUp, XIMCaretDown,
+ XIMNextLine, XIMPreviousLine,
+ XIMLineStart, XIMLineEnd,
+ XIMAbsolutePosition,
+ XIMDontChange
+} XIMCaretDirection;
+
+typedef struct _XIMStringConversionCallbackStruct {
+ XIMStringConversionPosition position;
+ XIMCaretDirection direction;
+ XIMStringConversionOperation operation;
+ unsigned short factor;
+ XIMStringConversionText *text;
+} XIMStringConversionCallbackStruct;
+
+typedef struct _XIMPreeditDrawCallbackStruct {
+ int caret; /* Cursor offset within pre-edit string */
+ int chg_first; /* Starting change position */
+ int chg_length; /* Length of the change in character count */
+ XIMText *text;
+} XIMPreeditDrawCallbackStruct;
+
+typedef enum {
+ XIMIsInvisible, /* Disable caret feedback */
+ XIMIsPrimary, /* UI defined caret feedback */
+ XIMIsSecondary /* UI defined caret feedback */
+} XIMCaretStyle;
+
+typedef struct _XIMPreeditCaretCallbackStruct {
+ int position; /* Caret offset within pre-edit string */
+ XIMCaretDirection direction; /* Caret moves direction */
+ XIMCaretStyle style; /* Feedback of the caret */
+} XIMPreeditCaretCallbackStruct;
+
+typedef enum {
+ XIMTextType,
+ XIMBitmapType
+} XIMStatusDataType;
+
+typedef struct _XIMStatusDrawCallbackStruct {
+ XIMStatusDataType type;
+ union {
+ XIMText *text;
+ Pixmap bitmap;
+ } data;
+} XIMStatusDrawCallbackStruct;
+
+typedef struct _XIMHotKeyTrigger {
+ KeySym keysym;
+ int modifier;
+ int modifier_mask;
+} XIMHotKeyTrigger;
+
+typedef struct _XIMHotKeyTriggers {
+ int num_hot_key;
+ XIMHotKeyTrigger *key;
+} XIMHotKeyTriggers;
+
+typedef unsigned long XIMHotKeyState;
+
+#define XIMHotKeyStateON (0x0001L)
+#define XIMHotKeyStateOFF (0x0002L)
+
+typedef struct {
+ unsigned short count_values;
+ char **supported_values;
+} XIMValuesList;
+
+_XFUNCPROTOBEGIN
+
+#if defined(WIN32) && !defined(_XLIBINT_)
+#define _Xdebug (*_Xdebug_p)
+#endif
+
+extern int _Xdebug;
+
+extern XFontStruct *XLoadQueryFont(
+ Display* /* display */,
+ _Xconst char* /* name */
+);
+
+extern XFontStruct *XQueryFont(
+ Display* /* display */,
+ XID /* font_ID */
+);
+
+
+extern XTimeCoord *XGetMotionEvents(
+ Display* /* display */,
+ Window /* w */,
+ Time /* start */,
+ Time /* stop */,
+ int* /* nevents_return */
+);
+
+extern XModifierKeymap *XDeleteModifiermapEntry(
+ XModifierKeymap* /* modmap */,
+#if NeedWidePrototypes
+ unsigned int /* keycode_entry */,
+#else
+ KeyCode /* keycode_entry */,
+#endif
+ int /* modifier */
+);
+
+extern XModifierKeymap *XGetModifierMapping(
+ Display* /* display */
+);
+
+extern XModifierKeymap *XInsertModifiermapEntry(
+ XModifierKeymap* /* modmap */,
+#if NeedWidePrototypes
+ unsigned int /* keycode_entry */,
+#else
+ KeyCode /* keycode_entry */,
+#endif
+ int /* modifier */
+);
+
+extern XModifierKeymap *XNewModifiermap(
+ int /* max_keys_per_mod */
+);
+
+extern XImage *XCreateImage(
+ Display* /* display */,
+ Visual* /* visual */,
+ unsigned int /* depth */,
+ int /* format */,
+ int /* offset */,
+ char* /* data */,
+ unsigned int /* width */,
+ unsigned int /* height */,
+ int /* bitmap_pad */,
+ int /* bytes_per_line */
+);
+extern Status XInitImage(
+ XImage* /* image */
+);
+extern XImage *XGetImage(
+ Display* /* display */,
+ Drawable /* d */,
+ int /* x */,
+ int /* y */,
+ unsigned int /* width */,
+ unsigned int /* height */,
+ unsigned long /* plane_mask */,
+ int /* format */
+);
+extern XImage *XGetSubImage(
+ Display* /* display */,
+ Drawable /* d */,
+ int /* x */,
+ int /* y */,
+ unsigned int /* width */,
+ unsigned int /* height */,
+ unsigned long /* plane_mask */,
+ int /* format */,
+ XImage* /* dest_image */,
+ int /* dest_x */,
+ int /* dest_y */
+);
+
+/*
+ * X function declarations.
+ */
+extern Display *XOpenDisplay(
+ _Xconst char* /* display_name */
+);
+
+extern void XrmInitialize(
+ void
+);
+
+extern char *XFetchBytes(
+ Display* /* display */,
+ int* /* nbytes_return */
+);
+extern char *XFetchBuffer(
+ Display* /* display */,
+ int* /* nbytes_return */,
+ int /* buffer */
+);
+extern char *XGetAtomName(
+ Display* /* display */,
+ Atom /* atom */
+);
+extern Status XGetAtomNames(
+ Display* /* dpy */,
+ Atom* /* atoms */,
+ int /* count */,
+ char** /* names_return */
+);
+extern char *XGetDefault(
+ Display* /* display */,
+ _Xconst char* /* program */,
+ _Xconst char* /* option */
+);
+extern char *XDisplayName(
+ _Xconst char* /* string */
+);
+extern char *XKeysymToString(
+ KeySym /* keysym */
+);
+
+extern int (*XSynchronize(
+ Display* /* display */,
+ Bool /* onoff */
+))(
+ Display* /* display */
+);
+extern int (*XSetAfterFunction(
+ Display* /* display */,
+ int (*) (
+ Display* /* display */
+ ) /* procedure */
+))(
+ Display* /* display */
+);
+extern Atom XInternAtom(
+ Display* /* display */,
+ _Xconst char* /* atom_name */,
+ Bool /* only_if_exists */
+);
+extern Status XInternAtoms(
+ Display* /* dpy */,
+ char** /* names */,
+ int /* count */,
+ Bool /* onlyIfExists */,
+ Atom* /* atoms_return */
+);
+extern Colormap XCopyColormapAndFree(
+ Display* /* display */,
+ Colormap /* colormap */
+);
+extern Colormap XCreateColormap(
+ Display* /* display */,
+ Window /* w */,
+ Visual* /* visual */,
+ int /* alloc */
+);
+extern Cursor XCreatePixmapCursor(
+ Display* /* display */,
+ Pixmap /* source */,
+ Pixmap /* mask */,
+ XColor* /* foreground_color */,
+ XColor* /* background_color */,
+ unsigned int /* x */,
+ unsigned int /* y */
+);
+extern Cursor XCreateGlyphCursor(
+ Display* /* display */,
+ Font /* source_font */,
+ Font /* mask_font */,
+ unsigned int /* source_char */,
+ unsigned int /* mask_char */,
+ XColor _Xconst * /* foreground_color */,
+ XColor _Xconst * /* background_color */
+);
+extern Cursor XCreateFontCursor(
+ Display* /* display */,
+ unsigned int /* shape */
+);
+extern Font XLoadFont(
+ Display* /* display */,
+ _Xconst char* /* name */
+);
+extern GC XCreateGC(
+ Display* /* display */,
+ Drawable /* d */,
+ unsigned long /* valuemask */,
+ XGCValues* /* values */
+);
+extern GContext XGContextFromGC(
+ GC /* gc */
+);
+extern void XFlushGC(
+ Display* /* display */,
+ GC /* gc */
+);
+extern Pixmap XCreatePixmap(
+ Display* /* display */,
+ Drawable /* d */,
+ unsigned int /* width */,
+ unsigned int /* height */,
+ unsigned int /* depth */
+);
+extern Pixmap XCreateBitmapFromData(
+ Display* /* display */,
+ Drawable /* d */,
+ _Xconst char* /* data */,
+ unsigned int /* width */,
+ unsigned int /* height */
+);
+extern Pixmap XCreatePixmapFromBitmapData(
+ Display* /* display */,
+ Drawable /* d */,
+ char* /* data */,
+ unsigned int /* width */,
+ unsigned int /* height */,
+ unsigned long /* fg */,
+ unsigned long /* bg */,
+ unsigned int /* depth */
+);
+extern Window XCreateSimpleWindow(
+ Display* /* display */,
+ Window /* parent */,
+ int /* x */,
+ int /* y */,
+ unsigned int /* width */,
+ unsigned int /* height */,
+ unsigned int /* border_width */,
+ unsigned long /* border */,
+ unsigned long /* background */
+);
+extern Window XGetSelectionOwner(
+ Display* /* display */,
+ Atom /* selection */
+);
+extern Window XCreateWindow(
+ Display* /* display */,
+ Window /* parent */,
+ int /* x */,
+ int /* y */,
+ unsigned int /* width */,
+ unsigned int /* height */,
+ unsigned int /* border_width */,
+ int /* depth */,
+ unsigned int /* class */,
+ Visual* /* visual */,
+ unsigned long /* valuemask */,
+ XSetWindowAttributes* /* attributes */
+);
+extern Colormap *XListInstalledColormaps(
+ Display* /* display */,
+ Window /* w */,
+ int* /* num_return */
+);
+extern char **XListFonts(
+ Display* /* display */,
+ _Xconst char* /* pattern */,
+ int /* maxnames */,
+ int* /* actual_count_return */
+);
+extern char **XListFontsWithInfo(
+ Display* /* display */,
+ _Xconst char* /* pattern */,
+ int /* maxnames */,
+ int* /* count_return */,
+ XFontStruct** /* info_return */
+);
+extern char **XGetFontPath(
+ Display* /* display */,
+ int* /* npaths_return */
+);
+extern char **XListExtensions(
+ Display* /* display */,
+ int* /* nextensions_return */
+);
+extern Atom *XListProperties(
+ Display* /* display */,
+ Window /* w */,
+ int* /* num_prop_return */
+);
+extern XHostAddress *XListHosts(
+ Display* /* display */,
+ int* /* nhosts_return */,
+ Bool* /* state_return */
+);
+extern KeySym XKeycodeToKeysym(
+ Display* /* display */,
+#if NeedWidePrototypes
+ unsigned int /* keycode */,
+#else
+ KeyCode /* keycode */,
+#endif
+ int /* index */
+);
+extern KeySym XLookupKeysym(
+ XKeyEvent* /* key_event */,
+ int /* index */
+);
+extern KeySym *XGetKeyboardMapping(
+ Display* /* display */,
+#if NeedWidePrototypes
+ unsigned int /* first_keycode */,
+#else
+ KeyCode /* first_keycode */,
+#endif
+ int /* keycode_count */,
+ int* /* keysyms_per_keycode_return */
+);
+extern KeySym XStringToKeysym(
+ _Xconst char* /* string */
+);
+extern long XMaxRequestSize(
+ Display* /* display */
+);
+extern long XExtendedMaxRequestSize(
+ Display* /* display */
+);
+extern char *XResourceManagerString(
+ Display* /* display */
+);
+extern char *XScreenResourceString(
+ Screen* /* screen */
+);
+extern unsigned long XDisplayMotionBufferSize(
+ Display* /* display */
+);
+extern VisualID XVisualIDFromVisual(
+ Visual* /* visual */
+);
+
+/* multithread routines */
+
+extern Status XInitThreads(
+ void
+);
+
+extern void XLockDisplay(
+ Display* /* display */
+);
+
+extern void XUnlockDisplay(
+ Display* /* display */
+);
+
+/* routines for dealing with extensions */
+
+extern XExtCodes *XInitExtension(
+ Display* /* display */,
+ _Xconst char* /* name */
+);
+
+extern XExtCodes *XAddExtension(
+ Display* /* display */
+);
+extern XExtData *XFindOnExtensionList(
+ XExtData** /* structure */,
+ int /* number */
+);
+extern XExtData **XEHeadOfExtensionList(
+ XEDataObject /* object */
+);
+
+/* these are routines for which there are also macros */
+extern Window XRootWindow(
+ Display* /* display */,
+ int /* screen_number */
+);
+extern Window XDefaultRootWindow(
+ Display* /* display */
+);
+extern Window XRootWindowOfScreen(
+ Screen* /* screen */
+);
+extern Visual *XDefaultVisual(
+ Display* /* display */,
+ int /* screen_number */
+);
+extern Visual *XDefaultVisualOfScreen(
+ Screen* /* screen */
+);
+extern GC XDefaultGC(
+ Display* /* display */,
+ int /* screen_number */
+);
+extern GC XDefaultGCOfScreen(
+ Screen* /* screen */
+);
+extern unsigned long XBlackPixel(
+ Display* /* display */,
+ int /* screen_number */
+);
+extern unsigned long XWhitePixel(
+ Display* /* display */,
+ int /* screen_number */
+);
+extern unsigned long XAllPlanes(
+ void
+);
+extern unsigned long XBlackPixelOfScreen(
+ Screen* /* screen */
+);
+extern unsigned long XWhitePixelOfScreen(
+ Screen* /* screen */
+);
+extern unsigned long XNextRequest(
+ Display* /* display */
+);
+extern unsigned long XLastKnownRequestProcessed(
+ Display* /* display */
+);
+extern char *XServerVendor(
+ Display* /* display */
+);
+extern char *XDisplayString(
+ Display* /* display */
+);
+extern Colormap XDefaultColormap(
+ Display* /* display */,
+ int /* screen_number */
+);
+extern Colormap XDefaultColormapOfScreen(
+ Screen* /* screen */
+);
+extern Display *XDisplayOfScreen(
+ Screen* /* screen */
+);
+extern Screen *XScreenOfDisplay(
+ Display* /* display */,
+ int /* screen_number */
+);
+extern Screen *XDefaultScreenOfDisplay(
+ Display* /* display */
+);
+extern long XEventMaskOfScreen(
+ Screen* /* screen */
+);
+
+extern int XScreenNumberOfScreen(
+ Screen* /* screen */
+);
+
+typedef int (*XErrorHandler) ( /* WARNING, this type not in Xlib spec */
+ Display* /* display */,
+ XErrorEvent* /* error_event */
+);
+
+extern XErrorHandler XSetErrorHandler (
+ XErrorHandler /* handler */
+);
+
+
+typedef int (*XIOErrorHandler) ( /* WARNING, this type not in Xlib spec */
+ Display* /* display */
+);
+
+extern XIOErrorHandler XSetIOErrorHandler (
+ XIOErrorHandler /* handler */
+);
+
+
+extern XPixmapFormatValues *XListPixmapFormats(
+ Display* /* display */,
+ int* /* count_return */
+);
+extern int *XListDepths(
+ Display* /* display */,
+ int /* screen_number */,
+ int* /* count_return */
+);
+
+/* ICCCM routines for things that don't require special include files; */
+/* other declarations are given in Xutil.h */
+extern Status XReconfigureWMWindow(
+ Display* /* display */,
+ Window /* w */,
+ int /* screen_number */,
+ unsigned int /* mask */,
+ XWindowChanges* /* changes */
+);
+
+extern Status XGetWMProtocols(
+ Display* /* display */,
+ Window /* w */,
+ Atom** /* protocols_return */,
+ int* /* count_return */
+);
+extern Status XSetWMProtocols(
+ Display* /* display */,
+ Window /* w */,
+ Atom* /* protocols */,
+ int /* count */
+);
+extern Status XIconifyWindow(
+ Display* /* display */,
+ Window /* w */,
+ int /* screen_number */
+);
+extern Status XWithdrawWindow(
+ Display* /* display */,
+ Window /* w */,
+ int /* screen_number */
+);
+extern Status XGetCommand(
+ Display* /* display */,
+ Window /* w */,
+ char*** /* argv_return */,
+ int* /* argc_return */
+);
+extern Status XGetWMColormapWindows(
+ Display* /* display */,
+ Window /* w */,
+ Window** /* windows_return */,
+ int* /* count_return */
+);
+extern Status XSetWMColormapWindows(
+ Display* /* display */,
+ Window /* w */,
+ Window* /* colormap_windows */,
+ int /* count */
+);
+extern void XFreeStringList(
+ char** /* list */
+);
+extern int XSetTransientForHint(
+ Display* /* display */,
+ Window /* w */,
+ Window /* prop_window */
+);
+
+/* The following are given in alphabetical order */
+
+extern int XActivateScreenSaver(
+ Display* /* display */
+);
+
+extern int XAddHost(
+ Display* /* display */,
+ XHostAddress* /* host */
+);
+
+extern int XAddHosts(
+ Display* /* display */,
+ XHostAddress* /* hosts */,
+ int /* num_hosts */
+);
+
+extern int XAddToExtensionList(
+ struct _XExtData** /* structure */,
+ XExtData* /* ext_data */
+);
+
+extern int XAddToSaveSet(
+ Display* /* display */,
+ Window /* w */
+);
+
+extern Status XAllocColor(
+ Display* /* display */,
+ Colormap /* colormap */,
+ XColor* /* screen_in_out */
+);
+
+extern Status XAllocColorCells(
+ Display* /* display */,
+ Colormap /* colormap */,
+ Bool /* contig */,
+ unsigned long* /* plane_masks_return */,
+ unsigned int /* nplanes */,
+ unsigned long* /* pixels_return */,
+ unsigned int /* npixels */
+);
+
+extern Status XAllocColorPlanes(
+ Display* /* display */,
+ Colormap /* colormap */,
+ Bool /* contig */,
+ unsigned long* /* pixels_return */,
+ int /* ncolors */,
+ int /* nreds */,
+ int /* ngreens */,
+ int /* nblues */,
+ unsigned long* /* rmask_return */,
+ unsigned long* /* gmask_return */,
+ unsigned long* /* bmask_return */
+);
+
+extern Status XAllocNamedColor(
+ Display* /* display */,
+ Colormap /* colormap */,
+ _Xconst char* /* color_name */,
+ XColor* /* screen_def_return */,
+ XColor* /* exact_def_return */
+);
+
+extern int XAllowEvents(
+ Display* /* display */,
+ int /* event_mode */,
+ Time /* time */
+);
+
+extern int XAutoRepeatOff(
+ Display* /* display */
+);
+
+extern int XAutoRepeatOn(
+ Display* /* display */
+);
+
+extern int XBell(
+ Display* /* display */,
+ int /* percent */
+);
+
+extern int XBitmapBitOrder(
+ Display* /* display */
+);
+
+extern int XBitmapPad(
+ Display* /* display */
+);
+
+extern int XBitmapUnit(
+ Display* /* display */
+);
+
+extern int XCellsOfScreen(
+ Screen* /* screen */
+);
+
+extern int XChangeActivePointerGrab(
+ Display* /* display */,
+ unsigned int /* event_mask */,
+ Cursor /* cursor */,
+ Time /* time */
+);
+
+extern int XChangeGC(
+ Display* /* display */,
+ GC /* gc */,
+ unsigned long /* valuemask */,
+ XGCValues* /* values */
+);
+
+extern int XChangeKeyboardControl(
+ Display* /* display */,
+ unsigned long /* value_mask */,
+ XKeyboardControl* /* values */
+);
+
+extern int XChangeKeyboardMapping(
+ Display* /* display */,
+ int /* first_keycode */,
+ int /* keysyms_per_keycode */,
+ KeySym* /* keysyms */,
+ int /* num_codes */
+);
+
+extern int XChangePointerControl(
+ Display* /* display */,
+ Bool /* do_accel */,
+ Bool /* do_threshold */,
+ int /* accel_numerator */,
+ int /* accel_denominator */,
+ int /* threshold */
+);
+
+extern int XChangeProperty(
+ Display* /* display */,
+ Window /* w */,
+ Atom /* property */,
+ Atom /* type */,
+ int /* format */,
+ int /* mode */,
+ _Xconst unsigned char* /* data */,
+ int /* nelements */
+);
+
+extern int XChangeSaveSet(
+ Display* /* display */,
+ Window /* w */,
+ int /* change_mode */
+);
+
+extern int XChangeWindowAttributes(
+ Display* /* display */,
+ Window /* w */,
+ unsigned long /* valuemask */,
+ XSetWindowAttributes* /* attributes */
+);
+
+extern Bool XCheckIfEvent(
+ Display* /* display */,
+ XEvent* /* event_return */,
+ Bool (*) (
+ Display* /* display */,
+ XEvent* /* event */,
+ XPointer /* arg */
+ ) /* predicate */,
+ XPointer /* arg */
+);
+
+extern Bool XCheckMaskEvent(
+ Display* /* display */,
+ long /* event_mask */,
+ XEvent* /* event_return */
+);
+
+extern Bool XCheckTypedEvent(
+ Display* /* display */,
+ int /* event_type */,
+ XEvent* /* event_return */
+);
+
+extern Bool XCheckTypedWindowEvent(
+ Display* /* display */,
+ Window /* w */,
+ int /* event_type */,
+ XEvent* /* event_return */
+);
+
+extern Bool XCheckWindowEvent(
+ Display* /* display */,
+ Window /* w */,
+ long /* event_mask */,
+ XEvent* /* event_return */
+);
+
+extern int XCirculateSubwindows(
+ Display* /* display */,
+ Window /* w */,
+ int /* direction */
+);
+
+extern int XCirculateSubwindowsDown(
+ Display* /* display */,
+ Window /* w */
+);
+
+extern int XCirculateSubwindowsUp(
+ Display* /* display */,
+ Window /* w */
+);
+
+extern int XClearArea(
+ Display* /* display */,
+ Window /* w */,
+ int /* x */,
+ int /* y */,
+ unsigned int /* width */,
+ unsigned int /* height */,
+ Bool /* exposures */
+);
+
+extern int XClearWindow(
+ Display* /* display */,
+ Window /* w */
+);
+
+extern int XCloseDisplay(
+ Display* /* display */
+);
+
+extern int XConfigureWindow(
+ Display* /* display */,
+ Window /* w */,
+ unsigned int /* value_mask */,
+ XWindowChanges* /* values */
+);
+
+extern int XConnectionNumber(
+ Display* /* display */
+);
+
+extern int XConvertSelection(
+ Display* /* display */,
+ Atom /* selection */,
+ Atom /* target */,
+ Atom /* property */,
+ Window /* requestor */,
+ Time /* time */
+);
+
+extern int XCopyArea(
+ Display* /* display */,
+ Drawable /* src */,
+ Drawable /* dest */,
+ GC /* gc */,
+ int /* src_x */,
+ int /* src_y */,
+ unsigned int /* width */,
+ unsigned int /* height */,
+ int /* dest_x */,
+ int /* dest_y */
+);
+
+extern int XCopyGC(
+ Display* /* display */,
+ GC /* src */,
+ unsigned long /* valuemask */,
+ GC /* dest */
+);
+
+extern int XCopyPlane(
+ Display* /* display */,
+ Drawable /* src */,
+ Drawable /* dest */,
+ GC /* gc */,
+ int /* src_x */,
+ int /* src_y */,
+ unsigned int /* width */,
+ unsigned int /* height */,
+ int /* dest_x */,
+ int /* dest_y */,
+ unsigned long /* plane */
+);
+
+extern int XDefaultDepth(
+ Display* /* display */,
+ int /* screen_number */
+);
+
+extern int XDefaultDepthOfScreen(
+ Screen* /* screen */
+);
+
+extern int XDefaultScreen(
+ Display* /* display */
+);
+
+extern int XDefineCursor(
+ Display* /* display */,
+ Window /* w */,
+ Cursor /* cursor */
+);
+
+extern int XDeleteProperty(
+ Display* /* display */,
+ Window /* w */,
+ Atom /* property */
+);
+
+extern int XDestroyWindow(
+ Display* /* display */,
+ Window /* w */
+);
+
+extern int XDestroySubwindows(
+ Display* /* display */,
+ Window /* w */
+);
+
+extern int XDoesBackingStore(
+ Screen* /* screen */
+);
+
+extern Bool XDoesSaveUnders(
+ Screen* /* screen */
+);
+
+extern int XDisableAccessControl(
+ Display* /* display */
+);
+
+
+extern int XDisplayCells(
+ Display* /* display */,
+ int /* screen_number */
+);
+
+extern int XDisplayHeight(
+ Display* /* display */,
+ int /* screen_number */
+);
+
+extern int XDisplayHeightMM(
+ Display* /* display */,
+ int /* screen_number */
+);
+
+extern int XDisplayKeycodes(
+ Display* /* display */,
+ int* /* min_keycodes_return */,
+ int* /* max_keycodes_return */
+);
+
+extern int XDisplayPlanes(
+ Display* /* display */,
+ int /* screen_number */
+);
+
+extern int XDisplayWidth(
+ Display* /* display */,
+ int /* screen_number */
+);
+
+extern int XDisplayWidthMM(
+ Display* /* display */,
+ int /* screen_number */
+);
+
+extern int XDrawArc(
+ Display* /* display */,
+ Drawable /* d */,
+ GC /* gc */,
+ int /* x */,
+ int /* y */,
+ unsigned int /* width */,
+ unsigned int /* height */,
+ int /* angle1 */,
+ int /* angle2 */
+);
+
+extern int XDrawArcs(
+ Display* /* display */,
+ Drawable /* d */,
+ GC /* gc */,
+ XArc* /* arcs */,
+ int /* narcs */
+);
+
+extern int XDrawImageString(
+ Display* /* display */,
+ Drawable /* d */,
+ GC /* gc */,
+ int /* x */,
+ int /* y */,
+ _Xconst char* /* string */,
+ int /* length */
+);
+
+extern int XDrawImageString16(
+ Display* /* display */,
+ Drawable /* d */,
+ GC /* gc */,
+ int /* x */,
+ int /* y */,
+ _Xconst XChar2b* /* string */,
+ int /* length */
+);
+
+extern int XDrawLine(
+ Display* /* display */,
+ Drawable /* d */,
+ GC /* gc */,
+ int /* x1 */,
+ int /* y1 */,
+ int /* x2 */,
+ int /* y2 */
+);
+
+extern int XDrawLines(
+ Display* /* display */,
+ Drawable /* d */,
+ GC /* gc */,
+ XPoint* /* points */,
+ int /* npoints */,
+ int /* mode */
+);
+
+extern int XDrawPoint(
+ Display* /* display */,
+ Drawable /* d */,
+ GC /* gc */,
+ int /* x */,
+ int /* y */
+);
+
+extern int XDrawPoints(
+ Display* /* display */,
+ Drawable /* d */,
+ GC /* gc */,
+ XPoint* /* points */,
+ int /* npoints */,
+ int /* mode */
+);
+
+extern int XDrawRectangle(
+ Display* /* display */,
+ Drawable /* d */,
+ GC /* gc */,
+ int /* x */,
+ int /* y */,
+ unsigned int /* width */,
+ unsigned int /* height */
+);
+
+extern int XDrawRectangles(
+ Display* /* display */,
+ Drawable /* d */,
+ GC /* gc */,
+ XRectangle* /* rectangles */,
+ int /* nrectangles */
+);
+
+extern int XDrawSegments(
+ Display* /* display */,
+ Drawable /* d */,
+ GC /* gc */,
+ XSegment* /* segments */,
+ int /* nsegments */
+);
+
+extern int XDrawString(
+ Display* /* display */,
+ Drawable /* d */,
+ GC /* gc */,
+ int /* x */,
+ int /* y */,
+ _Xconst char* /* string */,
+ int /* length */
+);
+
+extern int XDrawString16(
+ Display* /* display */,
+ Drawable /* d */,
+ GC /* gc */,
+ int /* x */,
+ int /* y */,
+ _Xconst XChar2b* /* string */,
+ int /* length */
+);
+
+extern int XDrawText(
+ Display* /* display */,
+ Drawable /* d */,
+ GC /* gc */,
+ int /* x */,
+ int /* y */,
+ XTextItem* /* items */,
+ int /* nitems */
+);
+
+extern int XDrawText16(
+ Display* /* display */,
+ Drawable /* d */,
+ GC /* gc */,
+ int /* x */,
+ int /* y */,
+ XTextItem16* /* items */,
+ int /* nitems */
+);
+
+extern int XEnableAccessControl(
+ Display* /* display */
+);
+
+extern int XEventsQueued(
+ Display* /* display */,
+ int /* mode */
+);
+
+extern Status XFetchName(
+ Display* /* display */,
+ Window /* w */,
+ char** /* window_name_return */
+);
+
+extern int XFillArc(
+ Display* /* display */,
+ Drawable /* d */,
+ GC /* gc */,
+ int /* x */,
+ int /* y */,
+ unsigned int /* width */,
+ unsigned int /* height */,
+ int /* angle1 */,
+ int /* angle2 */
+);
+
+extern int XFillArcs(
+ Display* /* display */,
+ Drawable /* d */,
+ GC /* gc */,
+ XArc* /* arcs */,
+ int /* narcs */
+);
+
+extern int XFillPolygon(
+ Display* /* display */,
+ Drawable /* d */,
+ GC /* gc */,
+ XPoint* /* points */,
+ int /* npoints */,
+ int /* shape */,
+ int /* mode */
+);
+
+extern int XFillRectangle(
+ Display* /* display */,
+ Drawable /* d */,
+ GC /* gc */,
+ int /* x */,
+ int /* y */,
+ unsigned int /* width */,
+ unsigned int /* height */
+);
+
+extern int XFillRectangles(
+ Display* /* display */,
+ Drawable /* d */,
+ GC /* gc */,
+ XRectangle* /* rectangles */,
+ int /* nrectangles */
+);
+
+extern int XFlush(
+ Display* /* display */
+);
+
+extern int XForceScreenSaver(
+ Display* /* display */,
+ int /* mode */
+);
+
+extern int XFree(
+ void* /* data */
+);
+
+extern int XFreeColormap(
+ Display* /* display */,
+ Colormap /* colormap */
+);
+
+extern int XFreeColors(
+ Display* /* display */,
+ Colormap /* colormap */,
+ unsigned long* /* pixels */,
+ int /* npixels */,
+ unsigned long /* planes */
+);
+
+extern int XFreeCursor(
+ Display* /* display */,
+ Cursor /* cursor */
+);
+
+extern int XFreeExtensionList(
+ char** /* list */
+);
+
+extern int XFreeFont(
+ Display* /* display */,
+ XFontStruct* /* font_struct */
+);
+
+extern int XFreeFontInfo(
+ char** /* names */,
+ XFontStruct* /* free_info */,
+ int /* actual_count */
+);
+
+extern int XFreeFontNames(
+ char** /* list */
+);
+
+extern int XFreeFontPath(
+ char** /* list */
+);
+
+extern int XFreeGC(
+ Display* /* display */,
+ GC /* gc */
+);
+
+extern int XFreeModifiermap(
+ XModifierKeymap* /* modmap */
+);
+
+extern int XFreePixmap(
+ Display* /* display */,
+ Pixmap /* pixmap */
+);
+
+extern int XGeometry(
+ Display* /* display */,
+ int /* screen */,
+ _Xconst char* /* position */,
+ _Xconst char* /* default_position */,
+ unsigned int /* bwidth */,
+ unsigned int /* fwidth */,
+ unsigned int /* fheight */,
+ int /* xadder */,
+ int /* yadder */,
+ int* /* x_return */,
+ int* /* y_return */,
+ int* /* width_return */,
+ int* /* height_return */
+);
+
+extern int XGetErrorDatabaseText(
+ Display* /* display */,
+ _Xconst char* /* name */,
+ _Xconst char* /* message */,
+ _Xconst char* /* default_string */,
+ char* /* buffer_return */,
+ int /* length */
+);
+
+extern int XGetErrorText(
+ Display* /* display */,
+ int /* code */,
+ char* /* buffer_return */,
+ int /* length */
+);
+
+extern Bool XGetFontProperty(
+ XFontStruct* /* font_struct */,
+ Atom /* atom */,
+ unsigned long* /* value_return */
+);
+
+extern Status XGetGCValues(
+ Display* /* display */,
+ GC /* gc */,
+ unsigned long /* valuemask */,
+ XGCValues* /* values_return */
+);
+
+extern Status XGetGeometry(
+ Display* /* display */,
+ Drawable /* d */,
+ Window* /* root_return */,
+ int* /* x_return */,
+ int* /* y_return */,
+ unsigned int* /* width_return */,
+ unsigned int* /* height_return */,
+ unsigned int* /* border_width_return */,
+ unsigned int* /* depth_return */
+);
+
+extern Status XGetIconName(
+ Display* /* display */,
+ Window /* w */,
+ char** /* icon_name_return */
+);
+
+extern int XGetInputFocus(
+ Display* /* display */,
+ Window* /* focus_return */,
+ int* /* revert_to_return */
+);
+
+extern int XGetKeyboardControl(
+ Display* /* display */,
+ XKeyboardState* /* values_return */
+);
+
+extern int XGetPointerControl(
+ Display* /* display */,
+ int* /* accel_numerator_return */,
+ int* /* accel_denominator_return */,
+ int* /* threshold_return */
+);
+
+extern int XGetPointerMapping(
+ Display* /* display */,
+ unsigned char* /* map_return */,
+ int /* nmap */
+);
+
+extern int XGetScreenSaver(
+ Display* /* display */,
+ int* /* timeout_return */,
+ int* /* interval_return */,
+ int* /* prefer_blanking_return */,
+ int* /* allow_exposures_return */
+);
+
+extern Status XGetTransientForHint(
+ Display* /* display */,
+ Window /* w */,
+ Window* /* prop_window_return */
+);
+
+extern int XGetWindowProperty(
+ Display* /* display */,
+ Window /* w */,
+ Atom /* property */,
+ long /* long_offset */,
+ long /* long_length */,
+ Bool /* delete */,
+ Atom /* req_type */,
+ Atom* /* actual_type_return */,
+ int* /* actual_format_return */,
+ unsigned long* /* nitems_return */,
+ unsigned long* /* bytes_after_return */,
+ unsigned char** /* prop_return */
+);
+
+extern Status XGetWindowAttributes(
+ Display* /* display */,
+ Window /* w */,
+ XWindowAttributes* /* window_attributes_return */
+);
+
+extern int XGrabButton(
+ Display* /* display */,
+ unsigned int /* button */,
+ unsigned int /* modifiers */,
+ Window /* grab_window */,
+ Bool /* owner_events */,
+ unsigned int /* event_mask */,
+ int /* pointer_mode */,
+ int /* keyboard_mode */,
+ Window /* confine_to */,
+ Cursor /* cursor */
+);
+
+extern int XGrabKey(
+ Display* /* display */,
+ int /* keycode */,
+ unsigned int /* modifiers */,
+ Window /* grab_window */,
+ Bool /* owner_events */,
+ int /* pointer_mode */,
+ int /* keyboard_mode */
+);
+
+extern int XGrabKeyboard(
+ Display* /* display */,
+ Window /* grab_window */,
+ Bool /* owner_events */,
+ int /* pointer_mode */,
+ int /* keyboard_mode */,
+ Time /* time */
+);
+
+extern int XGrabPointer(
+ Display* /* display */,
+ Window /* grab_window */,
+ Bool /* owner_events */,
+ unsigned int /* event_mask */,
+ int /* pointer_mode */,
+ int /* keyboard_mode */,
+ Window /* confine_to */,
+ Cursor /* cursor */,
+ Time /* time */
+);
+
+extern int XGrabServer(
+ Display* /* display */
+);
+
+extern int XHeightMMOfScreen(
+ Screen* /* screen */
+);
+
+extern int XHeightOfScreen(
+ Screen* /* screen */
+);
+
+extern int XIfEvent(
+ Display* /* display */,
+ XEvent* /* event_return */,
+ Bool (*) (
+ Display* /* display */,
+ XEvent* /* event */,
+ XPointer /* arg */
+ ) /* predicate */,
+ XPointer /* arg */
+);
+
+extern int XImageByteOrder(
+ Display* /* display */
+);
+
+extern int XInstallColormap(
+ Display* /* display */,
+ Colormap /* colormap */
+);
+
+extern KeyCode XKeysymToKeycode(
+ Display* /* display */,
+ KeySym /* keysym */
+);
+
+extern int XKillClient(
+ Display* /* display */,
+ XID /* resource */
+);
+
+extern Status XLookupColor(
+ Display* /* display */,
+ Colormap /* colormap */,
+ _Xconst char* /* color_name */,
+ XColor* /* exact_def_return */,
+ XColor* /* screen_def_return */
+);
+
+extern int XLowerWindow(
+ Display* /* display */,
+ Window /* w */
+);
+
+extern int XMapRaised(
+ Display* /* display */,
+ Window /* w */
+);
+
+extern int XMapSubwindows(
+ Display* /* display */,
+ Window /* w */
+);
+
+extern int XMapWindow(
+ Display* /* display */,
+ Window /* w */
+);
+
+extern int XMaskEvent(
+ Display* /* display */,
+ long /* event_mask */,
+ XEvent* /* event_return */
+);
+
+extern int XMaxCmapsOfScreen(
+ Screen* /* screen */
+);
+
+extern int XMinCmapsOfScreen(
+ Screen* /* screen */
+);
+
+extern int XMoveResizeWindow(
+ Display* /* display */,
+ Window /* w */,
+ int /* x */,
+ int /* y */,
+ unsigned int /* width */,
+ unsigned int /* height */
+);
+
+extern int XMoveWindow(
+ Display* /* display */,
+ Window /* w */,
+ int /* x */,
+ int /* y */
+);
+
+extern int XNextEvent(
+ Display* /* display */,
+ XEvent* /* event_return */
+);
+
+extern int XNoOp(
+ Display* /* display */
+);
+
+extern Status XParseColor(
+ Display* /* display */,
+ Colormap /* colormap */,
+ _Xconst char* /* spec */,
+ XColor* /* exact_def_return */
+);
+
+extern int XParseGeometry(
+ _Xconst char* /* parsestring */,
+ int* /* x_return */,
+ int* /* y_return */,
+ unsigned int* /* width_return */,
+ unsigned int* /* height_return */
+);
+
+extern int XPeekEvent(
+ Display* /* display */,
+ XEvent* /* event_return */
+);
+
+extern int XPeekIfEvent(
+ Display* /* display */,
+ XEvent* /* event_return */,
+ Bool (*) (
+ Display* /* display */,
+ XEvent* /* event */,
+ XPointer /* arg */
+ ) /* predicate */,
+ XPointer /* arg */
+);
+
+extern int XPending(
+ Display* /* display */
+);
+
+extern int XPlanesOfScreen(
+ Screen* /* screen */
+);
+
+extern int XProtocolRevision(
+ Display* /* display */
+);
+
+extern int XProtocolVersion(
+ Display* /* display */
+);
+
+
+extern int XPutBackEvent(
+ Display* /* display */,
+ XEvent* /* event */
+);
+
+extern int XPutImage(
+ Display* /* display */,
+ Drawable /* d */,
+ GC /* gc */,
+ XImage* /* image */,
+ int /* src_x */,
+ int /* src_y */,
+ int /* dest_x */,
+ int /* dest_y */,
+ unsigned int /* width */,
+ unsigned int /* height */
+);
+
+extern int XQLength(
+ Display* /* display */
+);
+
+extern Status XQueryBestCursor(
+ Display* /* display */,
+ Drawable /* d */,
+ unsigned int /* width */,
+ unsigned int /* height */,
+ unsigned int* /* width_return */,
+ unsigned int* /* height_return */
+);
+
+extern Status XQueryBestSize(
+ Display* /* display */,
+ int /* class */,
+ Drawable /* which_screen */,
+ unsigned int /* width */,
+ unsigned int /* height */,
+ unsigned int* /* width_return */,
+ unsigned int* /* height_return */
+);
+
+extern Status XQueryBestStipple(
+ Display* /* display */,
+ Drawable /* which_screen */,
+ unsigned int /* width */,
+ unsigned int /* height */,
+ unsigned int* /* width_return */,
+ unsigned int* /* height_return */
+);
+
+extern Status XQueryBestTile(
+ Display* /* display */,
+ Drawable /* which_screen */,
+ unsigned int /* width */,
+ unsigned int /* height */,
+ unsigned int* /* width_return */,
+ unsigned int* /* height_return */
+);
+
+extern int XQueryColor(
+ Display* /* display */,
+ Colormap /* colormap */,
+ XColor* /* def_in_out */
+);
+
+extern int XQueryColors(
+ Display* /* display */,
+ Colormap /* colormap */,
+ XColor* /* defs_in_out */,
+ int /* ncolors */
+);
+
+extern Bool XQueryExtension(
+ Display* /* display */,
+ _Xconst char* /* name */,
+ int* /* major_opcode_return */,
+ int* /* first_event_return */,
+ int* /* first_error_return */
+);
+
+extern int XQueryKeymap(
+ Display* /* display */,
+ char [32] /* keys_return */
+);
+
+extern Bool XQueryPointer(
+ Display* /* display */,
+ Window /* w */,
+ Window* /* root_return */,
+ Window* /* child_return */,
+ int* /* root_x_return */,
+ int* /* root_y_return */,
+ int* /* win_x_return */,
+ int* /* win_y_return */,
+ unsigned int* /* mask_return */
+);
+
+extern int XQueryTextExtents(
+ Display* /* display */,
+ XID /* font_ID */,
+ _Xconst char* /* string */,
+ int /* nchars */,
+ int* /* direction_return */,
+ int* /* font_ascent_return */,
+ int* /* font_descent_return */,
+ XCharStruct* /* overall_return */
+);
+
+extern int XQueryTextExtents16(
+ Display* /* display */,
+ XID /* font_ID */,
+ _Xconst XChar2b* /* string */,
+ int /* nchars */,
+ int* /* direction_return */,
+ int* /* font_ascent_return */,
+ int* /* font_descent_return */,
+ XCharStruct* /* overall_return */
+);
+
+extern Status XQueryTree(
+ Display* /* display */,
+ Window /* w */,
+ Window* /* root_return */,
+ Window* /* parent_return */,
+ Window** /* children_return */,
+ unsigned int* /* nchildren_return */
+);
+
+extern int XRaiseWindow(
+ Display* /* display */,
+ Window /* w */
+);
+
+extern int XReadBitmapFile(
+ Display* /* display */,
+ Drawable /* d */,
+ _Xconst char* /* filename */,
+ unsigned int* /* width_return */,
+ unsigned int* /* height_return */,
+ Pixmap* /* bitmap_return */,
+ int* /* x_hot_return */,
+ int* /* y_hot_return */
+);
+
+extern int XReadBitmapFileData(
+ _Xconst char* /* filename */,
+ unsigned int* /* width_return */,
+ unsigned int* /* height_return */,
+ unsigned char** /* data_return */,
+ int* /* x_hot_return */,
+ int* /* y_hot_return */
+);
+
+extern int XRebindKeysym(
+ Display* /* display */,
+ KeySym /* keysym */,
+ KeySym* /* list */,
+ int /* mod_count */,
+ _Xconst unsigned char* /* string */,
+ int /* bytes_string */
+);
+
+extern int XRecolorCursor(
+ Display* /* display */,
+ Cursor /* cursor */,
+ XColor* /* foreground_color */,
+ XColor* /* background_color */
+);
+
+extern int XRefreshKeyboardMapping(
+ XMappingEvent* /* event_map */
+);
+
+extern int XRemoveFromSaveSet(
+ Display* /* display */,
+ Window /* w */
+);
+
+extern int XRemoveHost(
+ Display* /* display */,
+ XHostAddress* /* host */
+);
+
+extern int XRemoveHosts(
+ Display* /* display */,
+ XHostAddress* /* hosts */,
+ int /* num_hosts */
+);
+
+extern int XReparentWindow(
+ Display* /* display */,
+ Window /* w */,
+ Window /* parent */,
+ int /* x */,
+ int /* y */
+);
+
+extern int XResetScreenSaver(
+ Display* /* display */
+);
+
+extern int XResizeWindow(
+ Display* /* display */,
+ Window /* w */,
+ unsigned int /* width */,
+ unsigned int /* height */
+);
+
+extern int XRestackWindows(
+ Display* /* display */,
+ Window* /* windows */,
+ int /* nwindows */
+);
+
+extern int XRotateBuffers(
+ Display* /* display */,
+ int /* rotate */
+);
+
+extern int XRotateWindowProperties(
+ Display* /* display */,
+ Window /* w */,
+ Atom* /* properties */,
+ int /* num_prop */,
+ int /* npositions */
+);
+
+extern int XScreenCount(
+ Display* /* display */
+);
+
+extern int XSelectInput(
+ Display* /* display */,
+ Window /* w */,
+ long /* event_mask */
+);
+
+extern Status XSendEvent(
+ Display* /* display */,
+ Window /* w */,
+ Bool /* propagate */,
+ long /* event_mask */,
+ XEvent* /* event_send */
+);
+
+extern int XSetAccessControl(
+ Display* /* display */,
+ int /* mode */
+);
+
+extern int XSetArcMode(
+ Display* /* display */,
+ GC /* gc */,
+ int /* arc_mode */
+);
+
+extern int XSetBackground(
+ Display* /* display */,
+ GC /* gc */,
+ unsigned long /* background */
+);
+
+extern int XSetClipMask(
+ Display* /* display */,
+ GC /* gc */,
+ Pixmap /* pixmap */
+);
+
+extern int XSetClipOrigin(
+ Display* /* display */,
+ GC /* gc */,
+ int /* clip_x_origin */,
+ int /* clip_y_origin */
+);
+
+extern int XSetClipRectangles(
+ Display* /* display */,
+ GC /* gc */,
+ int /* clip_x_origin */,
+ int /* clip_y_origin */,
+ XRectangle* /* rectangles */,
+ int /* n */,
+ int /* ordering */
+);
+
+extern int XSetCloseDownMode(
+ Display* /* display */,
+ int /* close_mode */
+);
+
+extern int XSetCommand(
+ Display* /* display */,
+ Window /* w */,
+ char** /* argv */,
+ int /* argc */
+);
+
+extern int XSetDashes(
+ Display* /* display */,
+ GC /* gc */,
+ int /* dash_offset */,
+ _Xconst char* /* dash_list */,
+ int /* n */
+);
+
+extern int XSetFillRule(
+ Display* /* display */,
+ GC /* gc */,
+ int /* fill_rule */
+);
+
+extern int XSetFillStyle(
+ Display* /* display */,
+ GC /* gc */,
+ int /* fill_style */
+);
+
+extern int XSetFont(
+ Display* /* display */,
+ GC /* gc */,
+ Font /* font */
+);
+
+extern int XSetFontPath(
+ Display* /* display */,
+ char** /* directories */,
+ int /* ndirs */
+);
+
+extern int XSetForeground(
+ Display* /* display */,
+ GC /* gc */,
+ unsigned long /* foreground */
+);
+
+extern int XSetFunction(
+ Display* /* display */,
+ GC /* gc */,
+ int /* function */
+);
+
+extern int XSetGraphicsExposures(
+ Display* /* display */,
+ GC /* gc */,
+ Bool /* graphics_exposures */
+);
+
+extern int XSetIconName(
+ Display* /* display */,
+ Window /* w */,
+ _Xconst char* /* icon_name */
+);
+
+extern int XSetInputFocus(
+ Display* /* display */,
+ Window /* focus */,
+ int /* revert_to */,
+ Time /* time */
+);
+
+extern int XSetLineAttributes(
+ Display* /* display */,
+ GC /* gc */,
+ unsigned int /* line_width */,
+ int /* line_style */,
+ int /* cap_style */,
+ int /* join_style */
+);
+
+extern int XSetModifierMapping(
+ Display* /* display */,
+ XModifierKeymap* /* modmap */
+);
+
+extern int XSetPlaneMask(
+ Display* /* display */,
+ GC /* gc */,
+ unsigned long /* plane_mask */
+);
+
+extern int XSetPointerMapping(
+ Display* /* display */,
+ _Xconst unsigned char* /* map */,
+ int /* nmap */
+);
+
+extern int XSetScreenSaver(
+ Display* /* display */,
+ int /* timeout */,
+ int /* interval */,
+ int /* prefer_blanking */,
+ int /* allow_exposures */
+);
+
+extern int XSetSelectionOwner(
+ Display* /* display */,
+ Atom /* selection */,
+ Window /* owner */,
+ Time /* time */
+);
+
+extern int XSetState(
+ Display* /* display */,
+ GC /* gc */,
+ unsigned long /* foreground */,
+ unsigned long /* background */,
+ int /* function */,
+ unsigned long /* plane_mask */
+);
+
+extern int XSetStipple(
+ Display* /* display */,
+ GC /* gc */,
+ Pixmap /* stipple */
+);
+
+extern int XSetSubwindowMode(
+ Display* /* display */,
+ GC /* gc */,
+ int /* subwindow_mode */
+);
+
+extern int XSetTSOrigin(
+ Display* /* display */,
+ GC /* gc */,
+ int /* ts_x_origin */,
+ int /* ts_y_origin */
+);
+
+extern int XSetTile(
+ Display* /* display */,
+ GC /* gc */,
+ Pixmap /* tile */
+);
+
+extern int XSetWindowBackground(
+ Display* /* display */,
+ Window /* w */,
+ unsigned long /* background_pixel */
+);
+
+extern int XSetWindowBackgroundPixmap(
+ Display* /* display */,
+ Window /* w */,
+ Pixmap /* background_pixmap */
+);
+
+extern int XSetWindowBorder(
+ Display* /* display */,
+ Window /* w */,
+ unsigned long /* border_pixel */
+);
+
+extern int XSetWindowBorderPixmap(
+ Display* /* display */,
+ Window /* w */,
+ Pixmap /* border_pixmap */
+);
+
+extern int XSetWindowBorderWidth(
+ Display* /* display */,
+ Window /* w */,
+ unsigned int /* width */
+);
+
+extern int XSetWindowColormap(
+ Display* /* display */,
+ Window /* w */,
+ Colormap /* colormap */
+);
+
+extern int XStoreBuffer(
+ Display* /* display */,
+ _Xconst char* /* bytes */,
+ int /* nbytes */,
+ int /* buffer */
+);
+
+extern int XStoreBytes(
+ Display* /* display */,
+ _Xconst char* /* bytes */,
+ int /* nbytes */
+);
+
+extern int XStoreColor(
+ Display* /* display */,
+ Colormap /* colormap */,
+ XColor* /* color */
+);
+
+extern int XStoreColors(
+ Display* /* display */,
+ Colormap /* colormap */,
+ XColor* /* color */,
+ int /* ncolors */
+);
+
+extern int XStoreName(
+ Display* /* display */,
+ Window /* w */,
+ _Xconst char* /* window_name */
+);
+
+extern int XStoreNamedColor(
+ Display* /* display */,
+ Colormap /* colormap */,
+ _Xconst char* /* color */,
+ unsigned long /* pixel */,
+ int /* flags */
+);
+
+extern int XSync(
+ Display* /* display */,
+ Bool /* discard */
+);
+
+extern int XTextExtents(
+ XFontStruct* /* font_struct */,
+ _Xconst char* /* string */,
+ int /* nchars */,
+ int* /* direction_return */,
+ int* /* font_ascent_return */,
+ int* /* font_descent_return */,
+ XCharStruct* /* overall_return */
+);
+
+extern int XTextExtents16(
+ XFontStruct* /* font_struct */,
+ _Xconst XChar2b* /* string */,
+ int /* nchars */,
+ int* /* direction_return */,
+ int* /* font_ascent_return */,
+ int* /* font_descent_return */,
+ XCharStruct* /* overall_return */
+);
+
+extern int XTextWidth(
+ XFontStruct* /* font_struct */,
+ _Xconst char* /* string */,
+ int /* count */
+);
+
+extern int XTextWidth16(
+ XFontStruct* /* font_struct */,
+ _Xconst XChar2b* /* string */,
+ int /* count */
+);
+
+extern Bool XTranslateCoordinates(
+ Display* /* display */,
+ Window /* src_w */,
+ Window /* dest_w */,
+ int /* src_x */,
+ int /* src_y */,
+ int* /* dest_x_return */,
+ int* /* dest_y_return */,
+ Window* /* child_return */
+);
+
+extern int XUndefineCursor(
+ Display* /* display */,
+ Window /* w */
+);
+
+extern int XUngrabButton(
+ Display* /* display */,
+ unsigned int /* button */,
+ unsigned int /* modifiers */,
+ Window /* grab_window */
+);
+
+extern int XUngrabKey(
+ Display* /* display */,
+ int /* keycode */,
+ unsigned int /* modifiers */,
+ Window /* grab_window */
+);
+
+extern int XUngrabKeyboard(
+ Display* /* display */,
+ Time /* time */
+);
+
+extern int XUngrabPointer(
+ Display* /* display */,
+ Time /* time */
+);
+
+extern int XUngrabServer(
+ Display* /* display */
+);
+
+extern int XUninstallColormap(
+ Display* /* display */,
+ Colormap /* colormap */
+);
+
+extern int XUnloadFont(
+ Display* /* display */,
+ Font /* font */
+);
+
+extern int XUnmapSubwindows(
+ Display* /* display */,
+ Window /* w */
+);
+
+extern int XUnmapWindow(
+ Display* /* display */,
+ Window /* w */
+);
+
+extern int XVendorRelease(
+ Display* /* display */
+);
+
+extern int XWarpPointer(
+ Display* /* display */,
+ Window /* src_w */,
+ Window /* dest_w */,
+ int /* src_x */,
+ int /* src_y */,
+ unsigned int /* src_width */,
+ unsigned int /* src_height */,
+ int /* dest_x */,
+ int /* dest_y */
+);
+
+extern int XWidthMMOfScreen(
+ Screen* /* screen */
+);
+
+extern int XWidthOfScreen(
+ Screen* /* screen */
+);
+
+extern int XWindowEvent(
+ Display* /* display */,
+ Window /* w */,
+ long /* event_mask */,
+ XEvent* /* event_return */
+);
+
+extern int XWriteBitmapFile(
+ Display* /* display */,
+ _Xconst char* /* filename */,
+ Pixmap /* bitmap */,
+ unsigned int /* width */,
+ unsigned int /* height */,
+ int /* x_hot */,
+ int /* y_hot */
+);
+
+extern Bool XSupportsLocale (void);
+
+extern char *XSetLocaleModifiers(
+ const char* /* modifier_list */
+);
+
+extern XOM XOpenOM(
+ Display* /* display */,
+ struct _XrmHashBucketRec* /* rdb */,
+ _Xconst char* /* res_name */,
+ _Xconst char* /* res_class */
+);
+
+extern Status XCloseOM(
+ XOM /* om */
+);
+
+extern char *XSetOMValues(
+ XOM /* om */,
+ ...
+) _X_SENTINEL(0);
+
+extern char *XGetOMValues(
+ XOM /* om */,
+ ...
+) _X_SENTINEL(0);
+
+extern Display *XDisplayOfOM(
+ XOM /* om */
+);
+
+extern char *XLocaleOfOM(
+ XOM /* om */
+);
+
+extern XOC XCreateOC(
+ XOM /* om */,
+ ...
+) _X_SENTINEL(0);
+
+extern void XDestroyOC(
+ XOC /* oc */
+);
+
+extern XOM XOMOfOC(
+ XOC /* oc */
+);
+
+extern char *XSetOCValues(
+ XOC /* oc */,
+ ...
+) _X_SENTINEL(0);
+
+extern char *XGetOCValues(
+ XOC /* oc */,
+ ...
+) _X_SENTINEL(0);
+
+extern XFontSet XCreateFontSet(
+ Display* /* display */,
+ _Xconst char* /* base_font_name_list */,
+ char*** /* missing_charset_list */,
+ int* /* missing_charset_count */,
+ char** /* def_string */
+);
+
+extern void XFreeFontSet(
+ Display* /* display */,
+ XFontSet /* font_set */
+);
+
+extern int XFontsOfFontSet(
+ XFontSet /* font_set */,
+ XFontStruct*** /* font_struct_list */,
+ char*** /* font_name_list */
+);
+
+extern char *XBaseFontNameListOfFontSet(
+ XFontSet /* font_set */
+);
+
+extern char *XLocaleOfFontSet(
+ XFontSet /* font_set */
+);
+
+extern Bool XContextDependentDrawing(
+ XFontSet /* font_set */
+);
+
+extern Bool XDirectionalDependentDrawing(
+ XFontSet /* font_set */
+);
+
+extern Bool XContextualDrawing(
+ XFontSet /* font_set */
+);
+
+extern XFontSetExtents *XExtentsOfFontSet(
+ XFontSet /* font_set */
+);
+
+extern int XmbTextEscapement(
+ XFontSet /* font_set */,
+ _Xconst char* /* text */,
+ int /* bytes_text */
+);
+
+extern int XwcTextEscapement(
+ XFontSet /* font_set */,
+ _Xconst wchar_t* /* text */,
+ int /* num_wchars */
+);
+
+extern int Xutf8TextEscapement(
+ XFontSet /* font_set */,
+ _Xconst char* /* text */,
+ int /* bytes_text */
+);
+
+extern int XmbTextExtents(
+ XFontSet /* font_set */,
+ _Xconst char* /* text */,
+ int /* bytes_text */,
+ XRectangle* /* overall_ink_return */,
+ XRectangle* /* overall_logical_return */
+);
+
+extern int XwcTextExtents(
+ XFontSet /* font_set */,
+ _Xconst wchar_t* /* text */,
+ int /* num_wchars */,
+ XRectangle* /* overall_ink_return */,
+ XRectangle* /* overall_logical_return */
+);
+
+extern int Xutf8TextExtents(
+ XFontSet /* font_set */,
+ _Xconst char* /* text */,
+ int /* bytes_text */,
+ XRectangle* /* overall_ink_return */,
+ XRectangle* /* overall_logical_return */
+);
+
+extern Status XmbTextPerCharExtents(
+ XFontSet /* font_set */,
+ _Xconst char* /* text */,
+ int /* bytes_text */,
+ XRectangle* /* ink_extents_buffer */,
+ XRectangle* /* logical_extents_buffer */,
+ int /* buffer_size */,
+ int* /* num_chars */,
+ XRectangle* /* overall_ink_return */,
+ XRectangle* /* overall_logical_return */
+);
+
+extern Status XwcTextPerCharExtents(
+ XFontSet /* font_set */,
+ _Xconst wchar_t* /* text */,
+ int /* num_wchars */,
+ XRectangle* /* ink_extents_buffer */,
+ XRectangle* /* logical_extents_buffer */,
+ int /* buffer_size */,
+ int* /* num_chars */,
+ XRectangle* /* overall_ink_return */,
+ XRectangle* /* overall_logical_return */
+);
+
+extern Status Xutf8TextPerCharExtents(
+ XFontSet /* font_set */,
+ _Xconst char* /* text */,
+ int /* bytes_text */,
+ XRectangle* /* ink_extents_buffer */,
+ XRectangle* /* logical_extents_buffer */,
+ int /* buffer_size */,
+ int* /* num_chars */,
+ XRectangle* /* overall_ink_return */,
+ XRectangle* /* overall_logical_return */
+);
+
+extern void XmbDrawText(
+ Display* /* display */,
+ Drawable /* d */,
+ GC /* gc */,
+ int /* x */,
+ int /* y */,
+ XmbTextItem* /* text_items */,
+ int /* nitems */
+);
+
+extern void XwcDrawText(
+ Display* /* display */,
+ Drawable /* d */,
+ GC /* gc */,
+ int /* x */,
+ int /* y */,
+ XwcTextItem* /* text_items */,
+ int /* nitems */
+);
+
+extern void Xutf8DrawText(
+ Display* /* display */,
+ Drawable /* d */,
+ GC /* gc */,
+ int /* x */,
+ int /* y */,
+ XmbTextItem* /* text_items */,
+ int /* nitems */
+);
+
+extern void XmbDrawString(
+ Display* /* display */,
+ Drawable /* d */,
+ XFontSet /* font_set */,
+ GC /* gc */,
+ int /* x */,
+ int /* y */,
+ _Xconst char* /* text */,
+ int /* bytes_text */
+);
+
+extern void XwcDrawString(
+ Display* /* display */,
+ Drawable /* d */,
+ XFontSet /* font_set */,
+ GC /* gc */,
+ int /* x */,
+ int /* y */,
+ _Xconst wchar_t* /* text */,
+ int /* num_wchars */
+);
+
+extern void Xutf8DrawString(
+ Display* /* display */,
+ Drawable /* d */,
+ XFontSet /* font_set */,
+ GC /* gc */,
+ int /* x */,
+ int /* y */,
+ _Xconst char* /* text */,
+ int /* bytes_text */
+);
+
+extern void XmbDrawImageString(
+ Display* /* display */,
+ Drawable /* d */,
+ XFontSet /* font_set */,
+ GC /* gc */,
+ int /* x */,
+ int /* y */,
+ _Xconst char* /* text */,
+ int /* bytes_text */
+);
+
+extern void XwcDrawImageString(
+ Display* /* display */,
+ Drawable /* d */,
+ XFontSet /* font_set */,
+ GC /* gc */,
+ int /* x */,
+ int /* y */,
+ _Xconst wchar_t* /* text */,
+ int /* num_wchars */
+);
+
+extern void Xutf8DrawImageString(
+ Display* /* display */,
+ Drawable /* d */,
+ XFontSet /* font_set */,
+ GC /* gc */,
+ int /* x */,
+ int /* y */,
+ _Xconst char* /* text */,
+ int /* bytes_text */
+);
+
+extern XIM XOpenIM(
+ Display* /* dpy */,
+ struct _XrmHashBucketRec* /* rdb */,
+ char* /* res_name */,
+ char* /* res_class */
+);
+
+extern Status XCloseIM(
+ XIM /* im */
+);
+
+extern char *XGetIMValues(
+ XIM /* im */, ...
+) _X_SENTINEL(0);
+
+extern char *XSetIMValues(
+ XIM /* im */, ...
+) _X_SENTINEL(0);
+
+extern Display *XDisplayOfIM(
+ XIM /* im */
+);
+
+extern char *XLocaleOfIM(
+ XIM /* im*/
+);
+
+extern XIC XCreateIC(
+ XIM /* im */, ...
+) _X_SENTINEL(0);
+
+extern void XDestroyIC(
+ XIC /* ic */
+);
+
+extern void XSetICFocus(
+ XIC /* ic */
+);
+
+extern void XUnsetICFocus(
+ XIC /* ic */
+);
+
+extern wchar_t *XwcResetIC(
+ XIC /* ic */
+);
+
+extern char *XmbResetIC(
+ XIC /* ic */
+);
+
+extern char *Xutf8ResetIC(
+ XIC /* ic */
+);
+
+extern char *XSetICValues(
+ XIC /* ic */, ...
+) _X_SENTINEL(0);
+
+extern char *XGetICValues(
+ XIC /* ic */, ...
+) _X_SENTINEL(0);
+
+extern XIM XIMOfIC(
+ XIC /* ic */
+);
+
+extern Bool XFilterEvent(
+ XEvent* /* event */,
+ Window /* window */
+);
+
+extern int XmbLookupString(
+ XIC /* ic */,
+ XKeyPressedEvent* /* event */,
+ char* /* buffer_return */,
+ int /* bytes_buffer */,
+ KeySym* /* keysym_return */,
+ Status* /* status_return */
+);
+
+extern int XwcLookupString(
+ XIC /* ic */,
+ XKeyPressedEvent* /* event */,
+ wchar_t* /* buffer_return */,
+ int /* wchars_buffer */,
+ KeySym* /* keysym_return */,
+ Status* /* status_return */
+);
+
+extern int Xutf8LookupString(
+ XIC /* ic */,
+ XKeyPressedEvent* /* event */,
+ char* /* buffer_return */,
+ int /* bytes_buffer */,
+ KeySym* /* keysym_return */,
+ Status* /* status_return */
+);
+
+extern XVaNestedList XVaCreateNestedList(
+ int /*unused*/, ...
+) _X_SENTINEL(0);
+
+/* internal connections for IMs */
+
+extern Bool XRegisterIMInstantiateCallback(
+ Display* /* dpy */,
+ struct _XrmHashBucketRec* /* rdb */,
+ char* /* res_name */,
+ char* /* res_class */,
+ XIDProc /* callback */,
+ XPointer /* client_data */
+);
+
+extern Bool XUnregisterIMInstantiateCallback(
+ Display* /* dpy */,
+ struct _XrmHashBucketRec* /* rdb */,
+ char* /* res_name */,
+ char* /* res_class */,
+ XIDProc /* callback */,
+ XPointer /* client_data */
+);
+
+typedef void (*XConnectionWatchProc)(
+ Display* /* dpy */,
+ XPointer /* client_data */,
+ int /* fd */,
+ Bool /* opening */, /* open or close flag */
+ XPointer* /* watch_data */ /* open sets, close uses */
+);
+
+
+extern Status XInternalConnectionNumbers(
+ Display* /* dpy */,
+ int** /* fd_return */,
+ int* /* count_return */
+);
+
+extern void XProcessInternalConnection(
+ Display* /* dpy */,
+ int /* fd */
+);
+
+extern Status XAddConnectionWatch(
+ Display* /* dpy */,
+ XConnectionWatchProc /* callback */,
+ XPointer /* client_data */
+);
+
+extern void XRemoveConnectionWatch(
+ Display* /* dpy */,
+ XConnectionWatchProc /* callback */,
+ XPointer /* client_data */
+);
+
+extern void XSetAuthorization(
+ char * /* name */,
+ int /* namelen */,
+ char * /* data */,
+ int /* datalen */
+);
+
+extern int _Xmbtowc(
+ wchar_t * /* wstr */,
+#ifdef ISC
+ char const * /* str */,
+ size_t /* len */
+#else
+ char * /* str */,
+ int /* len */
+#endif
+);
+
+extern int _Xwctomb(
+ char * /* str */,
+ wchar_t /* wc */
+);
+
+_XFUNCPROTOEND
+
+#endif /* _XLIB_H_ */
diff --git a/sysroot/usr/include/X11/XlibConf.h b/sysroot/usr/include/X11/XlibConf.h
new file mode 100644
index 0000000..71083f4
--- /dev/null
+++ b/sysroot/usr/include/X11/XlibConf.h
@@ -0,0 +1,40 @@
+/* include/X11/XlibConf.h. Generated from XlibConf.h.in by configure. */
+/*
+ * $Id: $
+ *
+ * Copyright © 2005 Keith Packard
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of Keith Packard not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Keith Packard makes no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef _XLIBCONF_H_
+#define _XLIBCONF_H_
+/*
+ * This header file exports defines necessary to correctly
+ * use Xlibint.h both inside Xlib and by external libraries
+ * such as extensions.
+ */
+
+/* Threading support? */
+#define XTHREADS
+
+/* Use multi-threaded libc functions? */
+#define XUSE_MTSAFE_API
+
+#endif /* _XLIBCONF_H_ */
diff --git a/sysroot/usr/include/X11/Xlibint.h b/sysroot/usr/include/X11/Xlibint.h
new file mode 100644
index 0000000..8aab764
--- /dev/null
+++ b/sysroot/usr/include/X11/Xlibint.h
@@ -0,0 +1,1329 @@
+/* $Xorg: Xlibint.h,v 1.5 2001/02/09 02:03:38 xorgcvs Exp $ */
+
+/*
+
+Copyright 1984, 1985, 1987, 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from The Open Group.
+
+*/
+/* $XFree86: xc/lib/X11/Xlibint.h,v 3.27 2003/05/27 22:26:26 tsi Exp $ */
+
+#ifndef _XLIBINT_H_
+#define _XLIBINT_H_ 1
+
+/*
+ * Xlibint.h - Header definition and support file for the internal
+ * support routines used by the C subroutine interface
+ * library (Xlib) to the X Window System.
+ *
+ * Warning, there be dragons here....
+ */
+
+#include <X11/Xlib.h>
+#include <X11/Xproto.h> /* to declare xEvent */
+#include <X11/XlibConf.h> /* for configured options like XTHREADS */
+
+#ifdef WIN32
+#define _XFlush _XFlushIt
+#endif
+
+/*
+ * If your BytesReadable correctly detects broken connections, then
+ * you should NOT define XCONN_CHECK_FREQ.
+ */
+#ifndef XCONN_CHECK_FREQ
+#define XCONN_CHECK_FREQ 256
+#endif
+
+struct _XGC
+{
+ XExtData *ext_data; /* hook for extension to hang data */
+ GContext gid; /* protocol ID for graphics context */
+ Bool rects; /* boolean: TRUE if clipmask is list of rectangles */
+ Bool dashes; /* boolean: TRUE if dash-list is really a list */
+ unsigned long dirty;/* cache dirty bits */
+ XGCValues values; /* shadow structure of values */
+};
+
+struct _XDisplay
+{
+ XExtData *ext_data; /* hook for extension to hang data */
+ struct _XFreeFuncs *free_funcs; /* internal free functions */
+ int fd; /* Network socket. */
+ int conn_checker; /* ugly thing used by _XEventsQueued */
+ int proto_major_version;/* maj. version of server's X protocol */
+ int proto_minor_version;/* minor version of server's X protocol */
+ char *vendor; /* vendor of the server hardware */
+ XID resource_base; /* resource ID base */
+ XID resource_mask; /* resource ID mask bits */
+ XID resource_id; /* allocator current ID */
+ int resource_shift; /* allocator shift to correct bits */
+ XID (*resource_alloc)( /* allocator function */
+ struct _XDisplay*
+ );
+ int byte_order; /* screen byte order, LSBFirst, MSBFirst */
+ int bitmap_unit; /* padding and data requirements */
+ int bitmap_pad; /* padding requirements on bitmaps */
+ int bitmap_bit_order; /* LeastSignificant or MostSignificant */
+ int nformats; /* number of pixmap formats in list */
+ ScreenFormat *pixmap_format; /* pixmap format list */
+ int vnumber; /* Xlib's X protocol version number. */
+ int release; /* release of the server */
+ struct _XSQEvent *head, *tail; /* Input event queue. */
+ int qlen; /* Length of input event queue */
+ unsigned long last_request_read; /* seq number of last event read */
+ unsigned long request; /* sequence number of last request. */
+ char *last_req; /* beginning of last request, or dummy */
+ char *buffer; /* Output buffer starting address. */
+ char *bufptr; /* Output buffer index pointer. */
+ char *bufmax; /* Output buffer maximum+1 address. */
+ unsigned max_request_size; /* maximum number 32 bit words in request*/
+ struct _XrmHashBucketRec *db;
+ int (*synchandler)( /* Synchronization handler */
+ struct _XDisplay*
+ );
+ char *display_name; /* "host:display" string used on this connect*/
+ int default_screen; /* default screen for operations */
+ int nscreens; /* number of screens on this server*/
+ Screen *screens; /* pointer to list of screens */
+ unsigned long motion_buffer; /* size of motion buffer */
+ unsigned long flags; /* internal connection flags */
+ int min_keycode; /* minimum defined keycode */
+ int max_keycode; /* maximum defined keycode */
+ KeySym *keysyms; /* This server's keysyms */
+ XModifierKeymap *modifiermap; /* This server's modifier keymap */
+ int keysyms_per_keycode;/* number of rows */
+ char *xdefaults; /* contents of defaults from server */
+ char *scratch_buffer; /* place to hang scratch buffer */
+ unsigned long scratch_length; /* length of scratch buffer */
+ int ext_number; /* extension number on this display */
+ struct _XExten *ext_procs; /* extensions initialized on this display */
+ /*
+ * the following can be fixed size, as the protocol defines how
+ * much address space is available.
+ * While this could be done using the extension vector, there
+ * may be MANY events processed, so a search through the extension
+ * list to find the right procedure for each event might be
+ * expensive if many extensions are being used.
+ */
+ Bool (*event_vec[128])( /* vector for wire to event */
+ Display * /* dpy */,
+ XEvent * /* re */,
+ xEvent * /* event */
+ );
+ Status (*wire_vec[128])( /* vector for event to wire */
+ Display * /* dpy */,
+ XEvent * /* re */,
+ xEvent * /* event */
+ );
+ KeySym lock_meaning; /* for XLookupString */
+ struct _XLockInfo *lock; /* multi-thread state, display lock */
+ struct _XInternalAsync *async_handlers; /* for internal async */
+ unsigned long bigreq_size; /* max size of big requests */
+ struct _XLockPtrs *lock_fns; /* pointers to threads functions */
+ void (*idlist_alloc)( /* XID list allocator function */
+ Display * /* dpy */,
+ XID * /* ids */,
+ int /* count */
+ );
+ /* things above this line should not move, for binary compatibility */
+ struct _XKeytrans *key_bindings; /* for XLookupString */
+ Font cursor_font; /* for XCreateFontCursor */
+ struct _XDisplayAtoms *atoms; /* for XInternAtom */
+ unsigned int mode_switch; /* keyboard group modifiers */
+ unsigned int num_lock; /* keyboard numlock modifiers */
+ struct _XContextDB *context_db; /* context database */
+ Bool (**error_vec)( /* vector for wire to error */
+ Display * /* display */,
+ XErrorEvent * /* he */,
+ xError * /* we */
+ );
+ /*
+ * Xcms information
+ */
+ struct {
+ XPointer defaultCCCs; /* pointer to an array of default XcmsCCC */
+ XPointer clientCmaps; /* pointer to linked list of XcmsCmapRec */
+ XPointer perVisualIntensityMaps;
+ /* linked list of XcmsIntensityMap */
+ } cms;
+ struct _XIMFilter *im_filters;
+ struct _XSQEvent *qfree; /* unallocated event queue elements */
+ unsigned long next_event_serial_num; /* inserted into next queue elt */
+ struct _XExten *flushes; /* Flush hooks */
+ struct _XConnectionInfo *im_fd_info; /* _XRegisterInternalConnection */
+ int im_fd_length; /* number of im_fd_info */
+ struct _XConnWatchInfo *conn_watchers; /* XAddConnectionWatch */
+ int watcher_count; /* number of conn_watchers */
+ XPointer filedes; /* struct pollfd cache for _XWaitForReadable */
+ int (*savedsynchandler)( /* user synchandler when Xlib usurps */
+ Display * /* dpy */
+ );
+ XID resource_max; /* allocator max ID */
+ int xcmisc_opcode; /* major opcode for XC-MISC */
+ struct _XkbInfoRec *xkb_info; /* XKB info */
+ struct _XtransConnInfo *trans_conn; /* transport connection object */
+ struct _X11XCBPrivate *xcb; /* XCB glue private data */
+};
+
+#define XAllocIDs(dpy,ids,n) (*(dpy)->idlist_alloc)(dpy,ids,n)
+
+/*
+ * define the following if you want the Data macro to be a procedure instead
+ */
+#ifdef CRAY
+#define DataRoutineIsProcedure
+#endif /* CRAY */
+
+#ifndef _XEVENT_
+/*
+ * _QEvent datatype for use in input queueing.
+ */
+typedef struct _XSQEvent
+{
+ struct _XSQEvent *next;
+ XEvent event;
+ unsigned long qserial_num; /* so multi-threaded code can find new ones */
+} _XQEvent;
+#endif
+
+#ifdef XTHREADS /* for xReply */
+#define NEED_REPLIES
+#endif
+
+#define NEED_EVENTS
+#define NEED_REPLIES
+#include <X11/Xproto.h>
+#ifdef __sgi
+#define _SGI_MP_SOURCE /* turn this on to get MP safe errno */
+#endif
+#include <errno.h>
+#define _XBCOPYFUNC _Xbcopy
+#include <X11/Xfuncs.h>
+#include <X11/Xosdefs.h>
+
+/* Utek leaves kernel macros around in include files (bleah) */
+#ifdef dirty
+#undef dirty
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+
+#include <X11/Xfuncproto.h>
+
+_XFUNCPROTOBEGIN
+
+/*
+ * The following definitions can be used for locking requests in multi-threaded
+ * address spaces.
+ */
+#ifdef XTHREADS
+/* Author: Stephen Gildea, MIT X Consortium
+ *
+ * declarations for C Threads locking
+ */
+
+typedef struct _LockInfoRec *LockInfoPtr;
+
+/* interfaces for locking.c */
+struct _XLockPtrs {
+ /* used by all, including extensions; do not move */
+ void (*lock_display)(
+ Display *dpy
+#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
+ , char *file
+ , int line
+#endif
+ );
+ void (*unlock_display)(
+ Display *dpy
+#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
+ , char *file
+ , int line
+#endif
+ );
+};
+
+#if defined(WIN32) && !defined(_XLIBINT_)
+#define _XCreateMutex_fn (*_XCreateMutex_fn_p)
+#define _XFreeMutex_fn (*_XFreeMutex_fn_p)
+#define _XLockMutex_fn (*_XLockMutex_fn_p)
+#define _XUnlockMutex_fn (*_XUnlockMutex_fn_p)
+#define _Xglobal_lock (*_Xglobal_lock_p)
+#endif
+
+/* in XlibInt.c */
+extern void (*_XCreateMutex_fn)(
+ LockInfoPtr /* lock */
+);
+extern void (*_XFreeMutex_fn)(
+ LockInfoPtr /* lock */
+);
+extern void (*_XLockMutex_fn)(
+ LockInfoPtr /* lock */
+#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
+ , char * /* file */
+ , int /* line */
+#endif
+);
+extern void (*_XUnlockMutex_fn)(
+ LockInfoPtr /* lock */
+#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
+ , char * /* file */
+ , int /* line */
+#endif
+);
+
+extern LockInfoPtr _Xglobal_lock;
+
+#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
+#define LockDisplay(d) if ((d)->lock_fns) (*(d)->lock_fns->lock_display)((d),__FILE__,__LINE__)
+#define UnlockDisplay(d) if ((d)->lock_fns) (*(d)->lock_fns->unlock_display)((d),__FILE__,__LINE__)
+#define _XLockMutex(lock) if (_XLockMutex_fn) (*_XLockMutex_fn)(lock,__FILE__,__LINE__)
+#define _XUnlockMutex(lock) if (_XUnlockMutex_fn) (*_XUnlockMutex_fn)(lock,__FILE__,__LINE__)
+#else
+/* used everywhere, so must be fast if not using threads */
+#define LockDisplay(d) if ((d)->lock_fns) (*(d)->lock_fns->lock_display)(d)
+#define UnlockDisplay(d) if ((d)->lock_fns) (*(d)->lock_fns->unlock_display)(d)
+#define _XLockMutex(lock) if (_XLockMutex_fn) (*_XLockMutex_fn)(lock)
+#define _XUnlockMutex(lock) if (_XUnlockMutex_fn) (*_XUnlockMutex_fn)(lock)
+#endif
+#define _XCreateMutex(lock) if (_XCreateMutex_fn) (*_XCreateMutex_fn)(lock);
+#define _XFreeMutex(lock) if (_XFreeMutex_fn) (*_XFreeMutex_fn)(lock);
+
+#else /* XTHREADS */
+#define LockDisplay(dis)
+#define _XLockMutex(lock)
+#define _XUnlockMutex(lock)
+#define UnlockDisplay(dis)
+#define _XCreateMutex(lock)
+#define _XFreeMutex(lock)
+#endif
+
+#define Xfree(ptr) free((ptr))
+
+/*
+ * Note that some machines do not return a valid pointer for malloc(0), in
+ * which case we provide an alternate under the control of the
+ * define MALLOC_0_RETURNS_NULL. This is necessary because some
+ * Xlib code expects malloc(0) to return a valid pointer to storage.
+ */
+#ifdef MALLOC_0_RETURNS_NULL
+
+# define Xmalloc(size) malloc(((size) == 0 ? 1 : (size)))
+# define Xrealloc(ptr, size) realloc((ptr), ((size) == 0 ? 1 : (size)))
+# define Xcalloc(nelem, elsize) calloc(((nelem) == 0 ? 1 : (nelem)), (elsize))
+
+#else
+
+# define Xmalloc(size) malloc((size))
+# define Xrealloc(ptr, size) realloc((ptr), (size))
+# define Xcalloc(nelem, elsize) calloc((nelem), (elsize))
+
+#endif
+
+#include <stddef.h>
+
+#define LOCKED 1
+#define UNLOCKED 0
+
+#ifndef BUFSIZE
+#define BUFSIZE 2048 /* X output buffer size. */
+#endif
+#ifndef PTSPERBATCH
+#define PTSPERBATCH 1024 /* point batching */
+#endif
+#ifndef WLNSPERBATCH
+#define WLNSPERBATCH 50 /* wide line batching */
+#endif
+#ifndef ZLNSPERBATCH
+#define ZLNSPERBATCH 1024 /* thin line batching */
+#endif
+#ifndef WRCTSPERBATCH
+#define WRCTSPERBATCH 10 /* wide line rectangle batching */
+#endif
+#ifndef ZRCTSPERBATCH
+#define ZRCTSPERBATCH 256 /* thin line rectangle batching */
+#endif
+#ifndef FRCTSPERBATCH
+#define FRCTSPERBATCH 256 /* filled rectangle batching */
+#endif
+#ifndef FARCSPERBATCH
+#define FARCSPERBATCH 256 /* filled arc batching */
+#endif
+#ifndef CURSORFONT
+#define CURSORFONT "cursor" /* standard cursor fonts */
+#endif
+
+/*
+ * Display flags
+ */
+#define XlibDisplayIOError (1L << 0)
+#define XlibDisplayClosing (1L << 1)
+#define XlibDisplayNoXkb (1L << 2)
+#define XlibDisplayPrivSync (1L << 3)
+#define XlibDisplayProcConni (1L << 4) /* in _XProcessInternalConnection */
+#define XlibDisplayReadEvents (1L << 5) /* in _XReadEvents */
+#define XlibDisplayReply (1L << 5) /* in _XReply */
+#define XlibDisplayWriting (1L << 6) /* in _XFlushInt, _XSend */
+#define XlibDisplayDfltRMDB (1L << 7) /* mark if RM db from XGetDefault */
+
+/*
+ * X Protocol packetizing macros.
+ */
+
+/* Need to start requests on 64 bit word boundaries
+ * on a CRAY computer so add a NoOp (127) if needed.
+ * A character pointer on a CRAY computer will be non-zero
+ * after shifting right 61 bits of it is not pointing to
+ * a word boundary.
+ */
+#ifdef WORD64
+#define WORD64ALIGN if ((long)dpy->bufptr >> 61) {\
+ dpy->last_req = dpy->bufptr;\
+ *(dpy->bufptr) = X_NoOperation;\
+ *(dpy->bufptr+1) = 0;\
+ *(dpy->bufptr+2) = 0;\
+ *(dpy->bufptr+3) = 1;\
+ dpy->request++;\
+ dpy->bufptr += 4;\
+ }
+#else /* else does not require alignment on 64-bit boundaries */
+#define WORD64ALIGN
+#endif /* WORD64 */
+
+
+/*
+ * GetReq - Get the next available X request packet in the buffer and
+ * return it.
+ *
+ * "name" is the name of the request, e.g. CreatePixmap, OpenFont, etc.
+ * "req" is the name of the request pointer.
+ *
+ */
+
+#if !defined(UNIXCPP) || defined(ANSICPP)
+#define GetReq(name, req) \
+ WORD64ALIGN\
+ if ((dpy->bufptr + SIZEOF(x##name##Req)) > dpy->bufmax)\
+ _XFlush(dpy);\
+ req = (x##name##Req *)(dpy->last_req = dpy->bufptr);\
+ req->reqType = X_##name;\
+ req->length = (SIZEOF(x##name##Req))>>2;\
+ dpy->bufptr += SIZEOF(x##name##Req);\
+ dpy->request++
+
+#else /* non-ANSI C uses empty comment instead of "##" for token concatenation */
+#define GetReq(name, req) \
+ WORD64ALIGN\
+ if ((dpy->bufptr + SIZEOF(x/**/name/**/Req)) > dpy->bufmax)\
+ _XFlush(dpy);\
+ req = (x/**/name/**/Req *)(dpy->last_req = dpy->bufptr);\
+ req->reqType = X_/**/name;\
+ req->length = (SIZEOF(x/**/name/**/Req))>>2;\
+ dpy->bufptr += SIZEOF(x/**/name/**/Req);\
+ dpy->request++
+#endif
+
+/* GetReqExtra is the same as GetReq, but allocates "n" additional
+ bytes after the request. "n" must be a multiple of 4! */
+
+#if !defined(UNIXCPP) || defined(ANSICPP)
+#define GetReqExtra(name, n, req) \
+ WORD64ALIGN\
+ if ((dpy->bufptr + SIZEOF(x##name##Req) + n) > dpy->bufmax)\
+ _XFlush(dpy);\
+ req = (x##name##Req *)(dpy->last_req = dpy->bufptr);\
+ req->reqType = X_##name;\
+ req->length = (SIZEOF(x##name##Req) + n)>>2;\
+ dpy->bufptr += SIZEOF(x##name##Req) + n;\
+ dpy->request++
+#else
+#define GetReqExtra(name, n, req) \
+ WORD64ALIGN\
+ if ((dpy->bufptr + SIZEOF(x/**/name/**/Req) + n) > dpy->bufmax)\
+ _XFlush(dpy);\
+ req = (x/**/name/**/Req *)(dpy->last_req = dpy->bufptr);\
+ req->reqType = X_/**/name;\
+ req->length = (SIZEOF(x/**/name/**/Req) + n)>>2;\
+ dpy->bufptr += SIZEOF(x/**/name/**/Req) + n;\
+ dpy->request++
+#endif
+
+
+/*
+ * GetResReq is for those requests that have a resource ID
+ * (Window, Pixmap, GContext, etc.) as their single argument.
+ * "rid" is the name of the resource.
+ */
+
+#if !defined(UNIXCPP) || defined(ANSICPP)
+#define GetResReq(name, rid, req) \
+ WORD64ALIGN\
+ if ((dpy->bufptr + SIZEOF(xResourceReq)) > dpy->bufmax)\
+ _XFlush(dpy);\
+ req = (xResourceReq *) (dpy->last_req = dpy->bufptr);\
+ req->reqType = X_##name;\
+ req->length = 2;\
+ req->id = (rid);\
+ dpy->bufptr += SIZEOF(xResourceReq);\
+ dpy->request++
+#else
+#define GetResReq(name, rid, req) \
+ WORD64ALIGN\
+ if ((dpy->bufptr + SIZEOF(xResourceReq)) > dpy->bufmax)\
+ _XFlush(dpy);\
+ req = (xResourceReq *) (dpy->last_req = dpy->bufptr);\
+ req->reqType = X_/**/name;\
+ req->length = 2;\
+ req->id = (rid);\
+ dpy->bufptr += SIZEOF(xResourceReq);\
+ dpy->request++
+#endif
+
+/*
+ * GetEmptyReq is for those requests that have no arguments
+ * at all.
+ */
+#if !defined(UNIXCPP) || defined(ANSICPP)
+#define GetEmptyReq(name, req) \
+ WORD64ALIGN\
+ if ((dpy->bufptr + SIZEOF(xReq)) > dpy->bufmax)\
+ _XFlush(dpy);\
+ req = (xReq *) (dpy->last_req = dpy->bufptr);\
+ req->reqType = X_##name;\
+ req->length = 1;\
+ dpy->bufptr += SIZEOF(xReq);\
+ dpy->request++
+#else
+#define GetEmptyReq(name, req) \
+ WORD64ALIGN\
+ if ((dpy->bufptr + SIZEOF(xReq)) > dpy->bufmax)\
+ _XFlush(dpy);\
+ req = (xReq *) (dpy->last_req = dpy->bufptr);\
+ req->reqType = X_/**/name;\
+ req->length = 1;\
+ dpy->bufptr += SIZEOF(xReq);\
+ dpy->request++
+#endif
+
+#ifdef WORD64
+#define MakeBigReq(req,n) \
+ { \
+ char _BRdat[4]; \
+ unsigned long _BRlen = req->length - 1; \
+ req->length = 0; \
+ memcpy(_BRdat, ((char *)req) + (_BRlen << 2), 4); \
+ memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \
+ memcpy(((char *)req) + 4, _BRdat, 4); \
+ Data32(dpy, (long *)&_BRdat, 4); \
+ }
+#else
+#ifdef LONG64
+#define MakeBigReq(req,n) \
+ { \
+ CARD64 _BRdat; \
+ CARD32 _BRlen = req->length - 1; \
+ req->length = 0; \
+ _BRdat = ((CARD32 *)req)[_BRlen]; \
+ memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \
+ ((CARD32 *)req)[1] = _BRlen + n + 2; \
+ Data32(dpy, &_BRdat, 4); \
+ }
+#else
+#define MakeBigReq(req,n) \
+ { \
+ CARD32 _BRdat; \
+ CARD32 _BRlen = req->length - 1; \
+ req->length = 0; \
+ _BRdat = ((CARD32 *)req)[_BRlen]; \
+ memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \
+ ((CARD32 *)req)[1] = _BRlen + n + 2; \
+ Data32(dpy, &_BRdat, 4); \
+ }
+#endif
+#endif
+
+#define SetReqLen(req,n,badlen) \
+ if ((req->length + n) > (unsigned)65535) { \
+ if (dpy->bigreq_size) { \
+ MakeBigReq(req,n) \
+ } else { \
+ n = badlen; \
+ req->length += n; \
+ } \
+ } else \
+ req->length += n
+
+#define SyncHandle() \
+ if (dpy->synchandler) (*dpy->synchandler)(dpy)
+
+extern void _XFlushGCCache(Display *dpy, GC gc);
+#define FlushGC(dpy, gc) \
+ if ((gc)->dirty) _XFlushGCCache((dpy), (gc))
+/*
+ * Data - Place data in the buffer and pad the end to provide
+ * 32 bit word alignment. Transmit if the buffer fills.
+ *
+ * "dpy" is a pointer to a Display.
+ * "data" is a pinter to a data buffer.
+ * "len" is the length of the data buffer.
+ */
+#ifndef DataRoutineIsProcedure
+#define Data(dpy, data, len) {\
+ if (dpy->bufptr + (len) <= dpy->bufmax) {\
+ memcpy(dpy->bufptr, data, (int)len);\
+ dpy->bufptr += ((len) + 3) & ~3;\
+ } else\
+ _XSend(dpy, data, len);\
+ }
+#endif /* DataRoutineIsProcedure */
+
+
+/* Allocate bytes from the buffer. No padding is done, so if
+ * the length is not a multiple of 4, the caller must be
+ * careful to leave the buffer aligned after sending the
+ * current request.
+ *
+ * "type" is the type of the pointer being assigned to.
+ * "ptr" is the pointer being assigned to.
+ * "n" is the number of bytes to allocate.
+ *
+ * Example:
+ * xTextElt *elt;
+ * BufAlloc (xTextElt *, elt, nbytes)
+ */
+
+#define BufAlloc(type, ptr, n) \
+ if (dpy->bufptr + (n) > dpy->bufmax) \
+ _XFlush (dpy); \
+ ptr = (type) dpy->bufptr; \
+ (void)ptr; \
+ dpy->bufptr += (n);
+
+#ifdef WORD64
+#define Data16(dpy, data, len) _XData16(dpy, (short *)data, len)
+#define Data32(dpy, data, len) _XData32(dpy, (long *)data, len)
+#else
+#define Data16(dpy, data, len) Data((dpy), (char *)(data), (len))
+#define _XRead16Pad(dpy, data, len) _XReadPad((dpy), (char *)(data), (len))
+#define _XRead16(dpy, data, len) _XRead((dpy), (char *)(data), (len))
+#ifdef LONG64
+#define Data32(dpy, data, len) _XData32(dpy, (long *)data, len)
+extern int _XData32(
+ Display *dpy,
+ register long *data,
+ unsigned len
+);
+extern void _XRead32(
+ Display *dpy,
+ register long *data,
+ long len
+);
+#else
+#define Data32(dpy, data, len) Data((dpy), (char *)(data), (len))
+#define _XRead32(dpy, data, len) _XRead((dpy), (char *)(data), (len))
+#endif
+#endif /* not WORD64 */
+
+#define PackData16(dpy,data,len) Data16 (dpy, data, len)
+#define PackData32(dpy,data,len) Data32 (dpy, data, len)
+
+/* Xlib manual is bogus */
+#define PackData(dpy,data,len) PackData16 (dpy, data, len)
+
+#define min(a,b) (((a) < (b)) ? (a) : (b))
+#define max(a,b) (((a) > (b)) ? (a) : (b))
+
+#define CI_NONEXISTCHAR(cs) (((cs)->width == 0) && \
+ (((cs)->rbearing|(cs)->lbearing| \
+ (cs)->ascent|(cs)->descent) == 0))
+
+/*
+ * CI_GET_CHAR_INFO_1D - return the charinfo struct for the indicated 8bit
+ * character. If the character is in the column and exists, then return the
+ * appropriate metrics (note that fonts with common per-character metrics will
+ * return min_bounds). If none of these hold true, try again with the default
+ * char.
+ */
+#define CI_GET_CHAR_INFO_1D(fs,col,def,cs) \
+{ \
+ cs = def; \
+ if (col >= fs->min_char_or_byte2 && col <= fs->max_char_or_byte2) { \
+ if (fs->per_char == NULL) { \
+ cs = &fs->min_bounds; \
+ } else { \
+ cs = &fs->per_char[(col - fs->min_char_or_byte2)]; \
+ if (CI_NONEXISTCHAR(cs)) cs = def; \
+ } \
+ } \
+}
+
+#define CI_GET_DEFAULT_INFO_1D(fs,cs) \
+ CI_GET_CHAR_INFO_1D (fs, fs->default_char, NULL, cs)
+
+
+
+/*
+ * CI_GET_CHAR_INFO_2D - return the charinfo struct for the indicated row and
+ * column. This is used for fonts that have more than row zero.
+ */
+#define CI_GET_CHAR_INFO_2D(fs,row,col,def,cs) \
+{ \
+ cs = def; \
+ if (row >= fs->min_byte1 && row <= fs->max_byte1 && \
+ col >= fs->min_char_or_byte2 && col <= fs->max_char_or_byte2) { \
+ if (fs->per_char == NULL) { \
+ cs = &fs->min_bounds; \
+ } else { \
+ cs = &fs->per_char[((row - fs->min_byte1) * \
+ (fs->max_char_or_byte2 - \
+ fs->min_char_or_byte2 + 1)) + \
+ (col - fs->min_char_or_byte2)]; \
+ if (CI_NONEXISTCHAR(cs)) cs = def; \
+ } \
+ } \
+}
+
+#define CI_GET_DEFAULT_INFO_2D(fs,cs) \
+{ \
+ unsigned int r = (fs->default_char >> 8); \
+ unsigned int c = (fs->default_char & 0xff); \
+ CI_GET_CHAR_INFO_2D (fs, r, c, NULL, cs); \
+}
+
+
+#ifdef MUSTCOPY
+
+/* for when 32-bit alignment is not good enough */
+#define OneDataCard32(dpy,dstaddr,srcvar) \
+ { dpy->bufptr -= 4; Data32 (dpy, (char *) &(srcvar), 4); }
+
+#else
+
+/* srcvar must be a variable for large architecture version */
+#define OneDataCard32(dpy,dstaddr,srcvar) \
+ { *(CARD32 *)(dstaddr) = (srcvar); }
+
+#endif /* MUSTCOPY */
+
+typedef struct _XInternalAsync {
+ struct _XInternalAsync *next;
+ /*
+ * handler arguments:
+ * rep is the generic reply that caused this handler
+ * to be invoked. It must also be passed to _XGetAsyncReply.
+ * buf and len are opaque values that must be passed to
+ * _XGetAsyncReply or _XGetAsyncData.
+ * data is the closure stored in this struct.
+ * The handler returns True iff it handled this reply.
+ */
+ Bool (*handler)(
+ Display* /* dpy */,
+ xReply* /* rep */,
+ char* /* buf */,
+ int /* len */,
+ XPointer /* data */
+ );
+ XPointer data;
+} _XAsyncHandler;
+
+typedef struct _XAsyncEState {
+ unsigned long min_sequence_number;
+ unsigned long max_sequence_number;
+ unsigned char error_code;
+ unsigned char major_opcode;
+ unsigned short minor_opcode;
+ unsigned char last_error_received;
+ int error_count;
+} _XAsyncErrorState;
+
+extern void _XDeqAsyncHandler(Display *dpy, _XAsyncHandler *handler);
+#define DeqAsyncHandler(dpy,handler) { \
+ if (dpy->async_handlers == (handler)) \
+ dpy->async_handlers = (handler)->next; \
+ else \
+ _XDeqAsyncHandler(dpy, handler); \
+ }
+
+typedef void (*FreeFuncType) (
+ Display* /* display */
+);
+
+typedef int (*FreeModmapType) (
+ XModifierKeymap* /* modmap */
+);
+
+/*
+ * This structure is private to the library.
+ */
+typedef struct _XFreeFuncs {
+ FreeFuncType atoms; /* _XFreeAtomTable */
+ FreeModmapType modifiermap; /* XFreeModifierMap */
+ FreeFuncType key_bindings; /* _XFreeKeyBindings */
+ FreeFuncType context_db; /* _XFreeContextDB */
+ FreeFuncType defaultCCCs; /* _XcmsFreeDefaultCCCs */
+ FreeFuncType clientCmaps; /* _XcmsFreeClientCmaps */
+ FreeFuncType intensityMaps; /* _XcmsFreeIntensityMaps */
+ FreeFuncType im_filters; /* _XFreeIMFilters */
+ FreeFuncType xkb; /* _XkbFreeInfo */
+} _XFreeFuncRec;
+
+/* types for InitExt.c */
+typedef int (*CreateGCType) (
+ Display* /* display */,
+ GC /* gc */,
+ XExtCodes* /* codes */
+);
+
+typedef int (*CopyGCType)(
+ Display* /* display */,
+ GC /* gc */,
+ XExtCodes* /* codes */
+);
+
+typedef int (*FlushGCType) (
+ Display* /* display */,
+ GC /* gc */,
+ XExtCodes* /* codes */
+);
+
+typedef int (*FreeGCType) (
+ Display* /* display */,
+ GC /* gc */,
+ XExtCodes* /* codes */
+);
+
+typedef int (*CreateFontType) (
+ Display* /* display */,
+ XFontStruct* /* fs */,
+ XExtCodes* /* codes */
+);
+
+typedef int (*FreeFontType) (
+ Display* /* display */,
+ XFontStruct* /* fs */,
+ XExtCodes* /* codes */
+);
+
+typedef int (*CloseDisplayType) (
+ Display* /* display */,
+ XExtCodes* /* codes */
+);
+
+typedef int (*ErrorType) (
+ Display* /* display */,
+ xError* /* err */,
+ XExtCodes* /* codes */,
+ int* /* ret_code */
+);
+
+typedef char* (*ErrorStringType) (
+ Display* /* display */,
+ int /* code */,
+ XExtCodes* /* codes */,
+ char* /* buffer */,
+ int /* nbytes */
+);
+
+typedef void (*PrintErrorType)(
+ Display* /* display */,
+ XErrorEvent* /* ev */,
+ void* /* fp */
+);
+
+typedef void (*BeforeFlushType)(
+ Display* /* display */,
+ XExtCodes* /* codes */,
+ _Xconst char* /* data */,
+ long /* len */
+);
+
+/*
+ * This structure is private to the library.
+ */
+typedef struct _XExten { /* private to extension mechanism */
+ struct _XExten *next; /* next in list */
+ XExtCodes codes; /* public information, all extension told */
+ CreateGCType create_GC; /* routine to call when GC created */
+ CopyGCType copy_GC; /* routine to call when GC copied */
+ FlushGCType flush_GC; /* routine to call when GC flushed */
+ FreeGCType free_GC; /* routine to call when GC freed */
+ CreateFontType create_Font; /* routine to call when Font created */
+ FreeFontType free_Font; /* routine to call when Font freed */
+ CloseDisplayType close_display; /* routine to call when connection closed */
+ ErrorType error; /* who to call when an error occurs */
+ ErrorStringType error_string; /* routine to supply error string */
+ char *name; /* name of this extension */
+ PrintErrorType error_values; /* routine to supply error values */
+ BeforeFlushType before_flush; /* routine to call when sending data */
+ struct _XExten *next_flush; /* next in list of those with flushes */
+} _XExtension;
+
+/* extension hooks */
+
+#ifdef DataRoutineIsProcedure
+extern void Data(Display *dpy, char *data, long len);
+#endif
+extern int _XError(
+ Display* /* dpy */,
+ xError* /* rep */
+);
+extern int _XIOError(
+ Display* /* dpy */
+);
+extern int (*_XIOErrorFunction)(
+ Display* /* dpy */
+);
+extern int (*_XErrorFunction)(
+ Display* /* dpy */,
+ XErrorEvent* /* error_event */
+);
+extern void _XEatData(
+ Display* /* dpy */,
+ unsigned long /* n */
+);
+extern char *_XAllocScratch(
+ Display* /* dpy */,
+ unsigned long /* nbytes */
+);
+extern char *_XAllocTemp(
+ Display* /* dpy */,
+ unsigned long /* nbytes */
+);
+extern void _XFreeTemp(
+ Display* /* dpy */,
+ char* /* buf */,
+ unsigned long /* nbytes */
+);
+extern Visual *_XVIDtoVisual(
+ Display* /* dpy */,
+ VisualID /* id */
+);
+extern unsigned long _XSetLastRequestRead(
+ Display* /* dpy */,
+ xGenericReply* /* rep */
+);
+extern int _XGetHostname(
+ char* /* buf */,
+ int /* maxlen */
+);
+extern Screen *_XScreenOfWindow(
+ Display* /* dpy */,
+ Window /* w */
+);
+extern Bool _XAsyncErrorHandler(
+ Display* /* dpy */,
+ xReply* /* rep */,
+ char* /* buf */,
+ int /* len */,
+ XPointer /* data */
+);
+extern char *_XGetAsyncReply(
+ Display* /* dpy */,
+ char* /* replbuf */,
+ xReply* /* rep */,
+ char* /* buf */,
+ int /* len */,
+ int /* extra */,
+ Bool /* discard */
+);
+extern void _XGetAsyncData(
+ Display* /* dpy */,
+ char * /* data */,
+ char * /* buf */,
+ int /* len */,
+ int /* skip */,
+ int /* datalen */,
+ int /* discardtotal */
+);
+extern void _XSetSeqSyncFunction(
+ Display* /* dpy */
+);
+extern void _XFlush(
+ Display* /* dpy */
+);
+extern int _XEventsQueued(
+ Display* /* dpy */,
+ int /* mode */
+);
+extern void _XReadEvents(
+ Display* /* dpy */
+);
+extern int _XRead(
+ Display* /* dpy */,
+ char* /* data */,
+ long /* size */
+);
+extern void _XReadPad(
+ Display* /* dpy */,
+ char* /* data */,
+ long /* size */
+);
+extern void _XSend(
+ Display* /* dpy */,
+ _Xconst char* /* data */,
+ long /* size */
+);
+extern Status _XReply(
+ Display* /* dpy */,
+ xReply* /* rep */,
+ int /* extra */,
+ Bool /* discard */
+);
+extern void _XEnq(
+ Display* /* dpy */,
+ xEvent* /* event */
+);
+extern void _XDeq(
+ Display* /* dpy */,
+ _XQEvent* /* prev */,
+ _XQEvent* /* qelt */
+);
+
+extern Bool _XUnknownWireEvent(
+ Display* /* dpy */,
+ XEvent* /* re */,
+ xEvent* /* event */
+);
+extern Status _XUnknownNativeEvent(
+ Display* /* dpy */,
+ XEvent* /* re */,
+ xEvent* /* event */
+);
+
+extern Bool _XWireToEvent(Display *dpy, XEvent *re, xEvent *event);
+extern Bool _XDefaultWireError(Display *display, XErrorEvent *he, xError *we);
+extern Bool _XPollfdCacheInit(Display *dpy);
+extern void _XPollfdCacheAdd(Display *dpy, int fd);
+extern void _XPollfdCacheDel(Display *dpy, int fd);
+extern XID _XAllocID(Display *dpy);
+extern void _XAllocIDs(Display *dpy, XID *ids, int count);
+
+extern int _XFreeExtData(
+ XExtData* /* extension */
+);
+
+extern int (*XESetCreateGC(
+ Display* /* display */,
+ int /* extension */,
+ int (*) (
+ Display* /* display */,
+ GC /* gc */,
+ XExtCodes* /* codes */
+ ) /* proc */
+))(
+ Display*, GC, XExtCodes*
+);
+
+extern int (*XESetCopyGC(
+ Display* /* display */,
+ int /* extension */,
+ int (*) (
+ Display* /* display */,
+ GC /* gc */,
+ XExtCodes* /* codes */
+ ) /* proc */
+))(
+ Display*, GC, XExtCodes*
+);
+
+extern int (*XESetFlushGC(
+ Display* /* display */,
+ int /* extension */,
+ int (*) (
+ Display* /* display */,
+ GC /* gc */,
+ XExtCodes* /* codes */
+ ) /* proc */
+))(
+ Display*, GC, XExtCodes*
+);
+
+extern int (*XESetFreeGC(
+ Display* /* display */,
+ int /* extension */,
+ int (*) (
+ Display* /* display */,
+ GC /* gc */,
+ XExtCodes* /* codes */
+ ) /* proc */
+))(
+ Display*, GC, XExtCodes*
+);
+
+extern int (*XESetCreateFont(
+ Display* /* display */,
+ int /* extension */,
+ int (*) (
+ Display* /* display */,
+ XFontStruct* /* fs */,
+ XExtCodes* /* codes */
+ ) /* proc */
+))(
+ Display*, XFontStruct*, XExtCodes*
+);
+
+extern int (*XESetFreeFont(
+ Display* /* display */,
+ int /* extension */,
+ int (*) (
+ Display* /* display */,
+ XFontStruct* /* fs */,
+ XExtCodes* /* codes */
+ ) /* proc */
+))(
+ Display*, XFontStruct*, XExtCodes*
+);
+
+extern int (*XESetCloseDisplay(
+ Display* /* display */,
+ int /* extension */,
+ int (*) (
+ Display* /* display */,
+ XExtCodes* /* codes */
+ ) /* proc */
+))(
+ Display*, XExtCodes*
+);
+
+extern int (*XESetError(
+ Display* /* display */,
+ int /* extension */,
+ int (*) (
+ Display* /* display */,
+ xError* /* err */,
+ XExtCodes* /* codes */,
+ int* /* ret_code */
+ ) /* proc */
+))(
+ Display*, xError*, XExtCodes*, int*
+);
+
+extern char* (*XESetErrorString(
+ Display* /* display */,
+ int /* extension */,
+ char* (*) (
+ Display* /* display */,
+ int /* code */,
+ XExtCodes* /* codes */,
+ char* /* buffer */,
+ int /* nbytes */
+ ) /* proc */
+))(
+ Display*, int, XExtCodes*, char*, int
+);
+
+extern void (*XESetPrintErrorValues (
+ Display* /* display */,
+ int /* extension */,
+ void (*)(
+ Display* /* display */,
+ XErrorEvent* /* ev */,
+ void* /* fp */
+ ) /* proc */
+))(
+ Display*, XErrorEvent*, void*
+);
+
+extern Bool (*XESetWireToEvent(
+ Display* /* display */,
+ int /* event_number */,
+ Bool (*) (
+ Display* /* display */,
+ XEvent* /* re */,
+ xEvent* /* event */
+ ) /* proc */
+))(
+ Display*, XEvent*, xEvent*
+);
+
+extern Status (*XESetEventToWire(
+ Display* /* display */,
+ int /* event_number */,
+ Status (*) (
+ Display* /* display */,
+ XEvent* /* re */,
+ xEvent* /* event */
+ ) /* proc */
+))(
+ Display*, XEvent*, xEvent*
+);
+
+extern Bool (*XESetWireToError(
+ Display* /* display */,
+ int /* error_number */,
+ Bool (*) (
+ Display* /* display */,
+ XErrorEvent* /* he */,
+ xError* /* we */
+ ) /* proc */
+))(
+ Display*, XErrorEvent*, xError*
+);
+
+extern void (*XESetBeforeFlush(
+ Display* /* display */,
+ int /* error_number */,
+ void (*) (
+ Display* /* display */,
+ XExtCodes* /* codes */,
+ _Xconst char* /* data */,
+ long /* len */
+ ) /* proc */
+))(
+ Display*, XExtCodes*, _Xconst char*, long
+);
+
+/* internal connections for IMs */
+
+typedef void (*_XInternalConnectionProc)(
+ Display* /* dpy */,
+ int /* fd */,
+ XPointer /* call_data */
+);
+
+
+extern Status _XRegisterInternalConnection(
+ Display* /* dpy */,
+ int /* fd */,
+ _XInternalConnectionProc /* callback */,
+ XPointer /* call_data */
+);
+
+extern void _XUnregisterInternalConnection(
+ Display* /* dpy */,
+ int /* fd */
+);
+
+extern void _XProcessInternalConnection(
+ Display* /* dpy */,
+ struct _XConnectionInfo* /* conn_info */
+);
+
+/* Display structure has pointers to these */
+
+struct _XConnectionInfo { /* info from _XRegisterInternalConnection */
+ int fd;
+ _XInternalConnectionProc read_callback;
+ XPointer call_data;
+ XPointer *watch_data; /* set/used by XConnectionWatchProc */
+ struct _XConnectionInfo *next;
+};
+
+struct _XConnWatchInfo { /* info from XAddConnectionWatch */
+ XConnectionWatchProc fn;
+ XPointer client_data;
+ struct _XConnWatchInfo *next;
+};
+
+#ifdef __UNIXOS2__
+extern char* __XOS2RedirRoot(
+ char*
+);
+#endif
+
+extern int _XTextHeight(
+ XFontStruct* /* font_struct */,
+ _Xconst char* /* string */,
+ int /* count */
+);
+
+extern int _XTextHeight16(
+ XFontStruct* /* font_struct */,
+ _Xconst XChar2b* /* string */,
+ int /* count */
+);
+
+#if defined(WIN32)
+
+extern int _XOpenFile(
+ _Xconst char* /* path */,
+ int /* flags */
+);
+
+extern int _XOpenFileMode(
+ _Xconst char* /* path */,
+ int /* flags */,
+ mode_t /* mode */
+);
+
+extern void* _XFopenFile(
+ _Xconst char* /* path */,
+ _Xconst char* /* mode */
+);
+
+extern int _XAccessFile(
+ _Xconst char* /* path */
+);
+#else
+#define _XOpenFile(path,flags) open(path,flags)
+#define _XOpenFileMode(path,flags,mode) open(path,flags,mode)
+#define _XFopenFile(path,mode) fopen(path,mode)
+#endif
+
+/* EvToWire.c */
+extern Status _XEventToWire(Display *dpy, XEvent *re, xEvent *event);
+
+extern int _XF86LoadQueryLocaleFont(
+ Display* /* dpy */,
+ _Xconst char* /* name*/,
+ XFontStruct** /* xfp*/,
+ Font* /* fidp */
+);
+
+extern void _XProcessWindowAttributes (
+ register Display *dpy,
+ xChangeWindowAttributesReq *req,
+ register unsigned long valuemask,
+ register XSetWindowAttributes *attributes);
+
+extern int _XDefaultError(
+ Display *dpy,
+ XErrorEvent *event);
+
+extern int _XDefaultIOError(
+ Display *dpy);
+
+extern void _XSetClipRectangles (
+ register Display *dpy,
+ GC gc,
+ int clip_x_origin, int clip_y_origin,
+ XRectangle *rectangles,
+ int n,
+ int ordering);
+
+Status _XGetWindowAttributes(
+ register Display *dpy,
+ Window w,
+ XWindowAttributes *attr);
+
+int _XPutBackEvent (
+ register Display *dpy,
+ register XEvent *event);
+
+_XFUNCPROTOEND
+
+#endif /* _XLIBINT_H_ */
diff --git a/sysroot/usr/include/X11/Xlocale.h b/sysroot/usr/include/X11/Xlocale.h
new file mode 100644
index 0000000..61d2f7a
--- /dev/null
+++ b/sysroot/usr/include/X11/Xlocale.h
@@ -0,0 +1,61 @@
+/* $Xorg: Xlocale.h,v 1.4 2001/02/09 02:03:38 xorgcvs Exp $ */
+/*
+
+Copyright 1991, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from The Open Group.
+
+*/
+/* $XFree86: xc/lib/X11/Xlocale.h,v 1.4 2001/12/14 19:54:09 dawes Exp $ */
+
+#ifndef _XLOCALE_H_
+#define _XLOCALE_H_
+
+#include <X11/Xfuncproto.h>
+#include <X11/Xosdefs.h>
+
+#ifndef X_LOCALE
+#include <locale.h>
+#else
+
+#define LC_ALL 0
+#define LC_COLLATE 1
+#define LC_CTYPE 2
+#define LC_MONETARY 3
+#define LC_NUMERIC 4
+#define LC_TIME 5
+
+_XFUNCPROTOBEGIN
+extern char *_Xsetlocale(
+ int /* category */,
+ _Xconst char* /* name */
+);
+_XFUNCPROTOEND
+
+#define setlocale _Xsetlocale
+
+#include <stddef.h>
+
+#endif /* X_LOCALE */
+
+#endif /* _XLOCALE_H_ */
diff --git a/sysroot/usr/include/X11/Xmd.h b/sysroot/usr/include/X11/Xmd.h
new file mode 100644
index 0000000..80fbe7c
--- /dev/null
+++ b/sysroot/usr/include/X11/Xmd.h
@@ -0,0 +1,211 @@
+/* $XdotOrg: $ */
+/* $XFree86: xc/include/Xmd.h,v 3.18tsi Exp $ */
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************/
+#ifndef XMD_H
+#define XMD_H 1
+/* $Xorg: Xmd.h,v 1.4 2001/02/09 02:03:22 xorgcvs Exp $ */
+/*
+ * Xmd.h: MACHINE DEPENDENT DECLARATIONS.
+ */
+
+/*
+ * Special per-machine configuration flags.
+ */
+#if defined(sun) && defined(__SVR4)
+# include <sys/isa_defs.h> /* Solaris: defines _LP64 if necessary */
+#endif
+
+#ifdef CRAY
+#define WORD64 /* 64-bit architecture */
+#endif
+#if defined (_LP64) || \
+ defined(__alpha) || defined(__alpha__) || \
+ defined(__ia64__) || defined(ia64) || \
+ defined(__sparc64__) || \
+ defined(__s390x__) || \
+ (defined(__hppa__) && defined(__LP64__)) || \
+ defined(__amd64__) || defined(amd64) || \
+ defined(__powerpc64__) || \
+ (defined(sgi) && (_MIPS_SZLONG == 64))
+#define LONG64 /* 32/64-bit architecture */
+#endif
+
+/*
+ * Stuff to handle large architecture machines; the constants were generated
+ * on a 32-bit machine and must correspond to the protocol.
+ */
+#ifdef WORD64
+#define MUSTCOPY
+#endif /* WORD64 */
+
+
+/*
+ * Definition of macro used to set constants for size of network structures;
+ * machines with preprocessors that can't handle all of the sz_ symbols
+ * can define this macro to be sizeof(x) if and only if their compiler doesn't
+ * pad out structures (esp. the xTextElt structure which contains only two
+ * one-byte fields). Network structures should always define sz_symbols.
+ *
+ * The sz_ prefix is used instead of something more descriptive so that the
+ * symbols are no more than 32 characters long (which causes problems for some
+ * compilers and preprocessors).
+ *
+ * The extra indirection in the __STDC__ case is to get macro arguments to
+ * expand correctly before the concatenation, rather than afterward.
+ */
+#if ((defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)) && !defined(UNIXCPP)) || defined(ANSICPP)
+#define _SIZEOF(x) sz_##x
+#define SIZEOF(x) _SIZEOF(x)
+#else
+#define SIZEOF(x) sz_/**/x
+#endif /* if ANSI C compiler else not */
+
+/*
+ * Bitfield suffixes for the protocol structure elements, if you
+ * need them. Note that bitfields are not guaranteed to be signed
+ * (or even unsigned) according to ANSI C.
+ */
+#ifdef WORD64
+typedef long INT64;
+typedef unsigned long CARD64;
+#define B32 :32
+#define B16 :16
+#ifdef UNSIGNEDBITFIELDS
+typedef unsigned int INT32;
+typedef unsigned int INT16;
+#else
+#ifdef __STDC__
+typedef signed int INT32;
+typedef signed int INT16;
+#else
+typedef int INT32;
+typedef int INT16;
+#endif
+#endif
+#else
+#define B32
+#define B16
+#ifdef LONG64
+typedef long INT64;
+typedef int INT32;
+#else
+typedef long INT32;
+#endif
+typedef short INT16;
+#endif
+
+#if defined(__STDC__) || defined(sgi) || defined(_AIX)
+typedef signed char INT8;
+#else
+typedef char INT8;
+#endif
+
+#ifdef LONG64
+typedef unsigned long CARD64;
+typedef unsigned int CARD32;
+#else
+typedef unsigned long CARD32;
+#endif
+#if !defined(WORD64) && !defined(LONG64)
+typedef unsigned long long CARD64;
+#endif
+typedef unsigned short CARD16;
+typedef unsigned char CARD8;
+
+typedef CARD32 BITS32;
+typedef CARD16 BITS16;
+
+#ifndef I_NEED_OS2_H
+typedef CARD8 BYTE;
+typedef CARD8 BOOL;
+#else
+#define BYTE CARD8
+#define BOOL CARD8
+#endif
+
+/*
+ * definitions for sign-extending bitfields on 64-bit architectures
+ */
+#if defined(WORD64) && defined(UNSIGNEDBITFIELDS)
+#define cvtINT8toInt(val) (((val) & 0x00000080) ? ((val) | 0xffffffffffffff00) : (val))
+#define cvtINT16toInt(val) (((val) & 0x00008000) ? ((val) | 0xffffffffffff0000) : (val))
+#define cvtINT32toInt(val) (((val) & 0x80000000) ? ((val) | 0xffffffff00000000) : (val))
+#define cvtINT8toShort(val) cvtINT8toInt(val)
+#define cvtINT16toShort(val) cvtINT16toInt(val)
+#define cvtINT32toShort(val) cvtINT32toInt(val)
+#define cvtINT8toLong(val) cvtINT8toInt(val)
+#define cvtINT16toLong(val) cvtINT16toInt(val)
+#define cvtINT32toLong(val) cvtINT32toInt(val)
+#else
+#define cvtINT8toInt(val) (val)
+#define cvtINT16toInt(val) (val)
+#define cvtINT32toInt(val) (val)
+#define cvtINT8toShort(val) (val)
+#define cvtINT16toShort(val) (val)
+#define cvtINT32toShort(val) (val)
+#define cvtINT8toLong(val) (val)
+#define cvtINT16toLong(val) (val)
+#define cvtINT32toLong(val) (val)
+#endif /* WORD64 and UNSIGNEDBITFIELDS */
+
+
+
+#ifdef MUSTCOPY
+/*
+ * This macro must not cast or else pointers will get aligned and be wrong
+ */
+#define NEXTPTR(p,t) (((char *) p) + SIZEOF(t))
+#else /* else not MUSTCOPY, this is used for 32-bit machines */
+/*
+ * this version should leave result of type (t *), but that should only be
+ * used when not in MUSTCOPY
+ */
+#define NEXTPTR(p,t) (((t *)(p)) + 1)
+#endif /* MUSTCOPY - used machines whose C structs don't line up with proto */
+
+#endif /* XMD_H */
diff --git a/sysroot/usr/include/X11/Xos.h b/sysroot/usr/include/X11/Xos.h
new file mode 100644
index 0000000..b6b93a5
--- /dev/null
+++ b/sysroot/usr/include/X11/Xos.h
@@ -0,0 +1,296 @@
+/*
+ * $XdotOrg: proto/X11/Xos.h,v 1.8 2005/11/08 06:33:25 jkj Exp $
+ * $Xorg: Xos.h,v 1.6 2001/02/09 02:03:22 xorgcvs Exp $
+ *
+ *
+Copyright 1987, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+ *
+ * The X Window System is a Trademark of The Open Group.
+ *
+ */
+/* $XFree86: xc/include/Xos.h,v 3.41tsi Exp $ */
+
+/* This is a collection of things to try and minimize system dependencies
+ * in a "significant" number of source files.
+ */
+
+#ifndef _XOS_H_
+#define _XOS_H_
+
+#include <X11/Xosdefs.h>
+
+/*
+ * Get major data types (esp. caddr_t)
+ */
+
+#ifdef USG
+#ifndef __TYPES__
+#ifdef CRAY
+#define word word_t
+#endif /* CRAY */
+#include <sys/types.h> /* forgot to protect it... */
+#define __TYPES__
+#endif /* __TYPES__ */
+#else /* USG */
+#if defined(_POSIX_SOURCE) && defined(MOTOROLA)
+#undef _POSIX_SOURCE
+#include <sys/types.h>
+#define _POSIX_SOURCE
+#else
+# include <sys/types.h>
+#endif
+#endif /* USG */
+
+#ifndef sgi
+#if defined(__SCO__) || defined(__UNIXWARE__)
+#include <stdint.h>
+#endif
+#endif
+
+#ifdef _SEQUENT_
+/*
+ * in_systm.h compatibility between SysV and BSD types u_char u_short u_long
+ * select.h for typedef of args to select, fd_set, may use SVR4 later
+ */
+#include <netinet/in_systm.h>
+#include <sys/select.h>
+#endif /* _SEQUENT_ */
+
+/*
+ * Just about everyone needs the strings routines. We provide both forms here,
+ * index/rindex and strchr/strrchr, so any systems that don't provide them all
+ * need to have #defines here.
+ *
+ * These macros are defined this way, rather than, e.g.:
+ * #defined index(s,c) strchr(s,c)
+ * because someone might be using them as function pointers, and such
+ * a change would break compatibility for anyone who's relying on them
+ * being the way they currently are. So we're stuck with them this way,
+ * which can be really inconvenient. :-(
+ */
+
+#ifndef X_NOT_STDC_ENV
+
+#include <string.h>
+#if defined(__SCO__) || defined(__UNIXWARE__)
+#include <strings.h>
+#else
+#if (defined(sun) && defined(__SVR4))
+#include <strings.h>
+#endif
+#ifdef __STDC__
+#ifndef index
+#define index(s,c) (strchr((s),(c)))
+#endif
+#ifndef rindex
+#define rindex(s,c) (strrchr((s),(c)))
+#endif
+#else
+#ifndef index
+#define index strchr
+#endif
+#ifndef rindex
+#define rindex strrchr
+#endif
+#endif
+#endif
+
+#else
+
+#ifdef SYSV
+#if defined(clipper) || defined(__clipper__)
+#include <malloc.h>
+#endif
+#include <string.h>
+#define index strchr
+#define rindex strrchr
+#else
+#include <strings.h>
+#define strchr index
+#define strrchr rindex
+#endif
+
+#endif /* X_NOT_STDC_ENV */
+
+/*
+ * strerror()
+ */
+#if (defined(X_NOT_STDC_ENV) || (defined(sun) && !defined(SVR4)) || defined(macII)) && !defined(__GLIBC__)
+#ifndef strerror
+extern char *sys_errlist[];
+extern int sys_nerr;
+#define strerror(n) \
+ (((n) >= 0 && (n) < sys_nerr) ? sys_errlist[n] : "unknown error")
+#endif
+#endif
+
+/*
+ * Get open(2) constants
+ */
+#if defined(X_NOT_POSIX)
+#include <fcntl.h>
+#if defined(USL) || defined(CRAY) || defined(MOTOROLA) || (defined(i386) && (defined(SYSV) || defined(SVR4))) || defined(__sxg__)
+#include <unistd.h>
+#endif
+#ifdef WIN32
+#include <X11/Xw32defs.h>
+#else
+#include <sys/file.h>
+#endif
+#else /* X_NOT_POSIX */
+#if !defined(_POSIX_SOURCE) && defined(macII)
+#define _POSIX_SOURCE
+#include <fcntl.h>
+#include <unistd.h>
+#undef _POSIX_SOURCE
+#else
+#include <fcntl.h>
+#include <unistd.h>
+#endif
+#endif /* X_NOT_POSIX else */
+
+/*
+ * Get struct timeval and struct tm
+ */
+
+#if defined(SYSV) && !defined(_SEQUENT_)
+
+#ifndef USL
+#include <sys/time.h>
+#endif
+#include <time.h>
+#ifdef CRAY
+#undef word
+#endif /* CRAY */
+#if defined(USG) && !defined(CRAY) && !defined(MOTOROLA) && !defined(uniosu) && !defined(__sxg__) && !defined(clipper) && !defined(__clipper__)
+struct timeval {
+ long tv_sec;
+ long tv_usec;
+};
+#ifndef USL_SHARELIB
+struct timezone {
+ int tz_minuteswest;
+ int tz_dsttime;
+};
+#endif /* USL_SHARELIB */
+#endif /* USG */
+
+#ifdef _SEQUENT_
+struct timezone {
+ int tz_minuteswest;
+ int tz_dsttime;
+};
+#endif /* _SEQUENT_ */
+
+#else /* not SYSV */
+
+#if defined(_POSIX_SOURCE) && defined(SVR4)
+/* need to omit _POSIX_SOURCE in order to get what we want in SVR4 */
+#undef _POSIX_SOURCE
+#include <sys/time.h>
+#define _POSIX_SOURCE
+#elif defined(WIN32)
+#include <time.h>
+#if !defined(_WINSOCKAPI_) && !defined(_WILLWINSOCK_) && !defined(_TIMEVAL_DEFINED) && !defined(_STRUCT_TIMEVAL)
+struct timeval {
+ long tv_sec; /* seconds */
+ long tv_usec; /* and microseconds */
+};
+#define _TIMEVAL_DEFINED
+#endif
+#include <sys/timeb.h>
+#define gettimeofday(t) \
+{ \
+ struct _timeb _gtodtmp; \
+ _ftime (&_gtodtmp); \
+ (t)->tv_sec = _gtodtmp.time; \
+ (t)->tv_usec = _gtodtmp.millitm * 1000; \
+}
+#elif defined(_SEQUENT_) || defined(Lynx)
+#include <time.h>
+#elif defined (__QNX__)
+typedef unsigned long fd_mask;
+/* Make sure we get 256 bit select masks */
+#define FD_SETSIZE 256
+#include <sys/select.h>
+#include <sys/time.h>
+#include <time.h>
+#else
+#include <sys/time.h>
+#include <time.h>
+#endif /* defined(_POSIX_SOURCE) && defined(SVR4) */
+
+#endif /* SYSV */
+
+/* define X_GETTIMEOFDAY macro, a portable gettimeofday() */
+#if defined(_XOPEN_XPG4) || defined(_XOPEN_UNIX) /* _XOPEN_UNIX is XPG4.2 */
+#define X_GETTIMEOFDAY(t) gettimeofday(t, (struct timezone*)0)
+#else
+#if defined(SVR4) || defined(VMS) || defined(WIN32)
+#define X_GETTIMEOFDAY(t) gettimeofday(t)
+#else
+#define X_GETTIMEOFDAY(t) gettimeofday(t, (struct timezone*)0)
+#endif
+#endif /* XPG4 else */
+
+#ifdef __UNIXOS2__
+typedef unsigned long fd_mask;
+#include <limits.h>
+#define MAX_PATH _POSIX_PATH_MAX
+#endif
+
+#ifdef __GNU__
+#define PATH_MAX 4096
+#define MAXPATHLEN 4096
+#define OPEN_MAX 256 /* We define a reasonable limit. */
+#endif
+
+/* use POSIX name for signal */
+#if defined(X_NOT_POSIX) && defined(SYSV) && !defined(SIGCHLD) && !defined(ISC)
+#define SIGCHLD SIGCLD
+#endif
+
+#ifdef ISC
+#include <sys/bsdtypes.h>
+#include <sys/limits.h>
+#define NGROUPS 16
+#endif
+
+#if defined(ISC) || defined(__UNIXOS2__) || \
+ (defined(__linux__) && !defined(__GLIBC__)) || \
+ (defined(__QNX__) && !defined(UNIXCONN))
+/*
+ * Some OS's may not have this
+ */
+
+#define X_NO_SYS_UN 1
+
+struct sockaddr_un {
+ short sun_family;
+ char sun_path[108];
+};
+#endif
+
+#include <X11/Xarch.h>
+
+#endif /* _XOS_H_ */
diff --git a/sysroot/usr/include/X11/Xos_r.h b/sysroot/usr/include/X11/Xos_r.h
new file mode 100644
index 0000000..f52bde7
--- /dev/null
+++ b/sysroot/usr/include/X11/Xos_r.h
@@ -0,0 +1,1160 @@
+/* $Xorg: Xos_r.h,v 1.4 2001/02/09 02:03:22 xorgcvs Exp $ */
+/* $XdotOrg: proto/X11/Xos_r.h,v 1.5 2005/07/13 07:23:56 keithp Exp $ */
+/*
+Copyright 1996, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+*/
+/* $XFree86: xc/include/Xos_r.h,v 1.18tsi Exp $ */
+
+/*
+ * Various and sundry Thread-Safe functions used by X11, Motif, and CDE.
+ *
+ * Use this file in MT-safe code where you would have included
+ * <dirent.h> for readdir()
+ * <grp.h> for getgrgid() or getgrnam()
+ * <netdb.h> for gethostbyname(), gethostbyaddr(), or getservbyname()
+ * <pwd.h> for getpwnam() or getpwuid()
+ * <string.h> for strtok()
+ * <time.h> for asctime(), ctime(), localtime(), or gmtime()
+ * <unistd.h> for getlogin() or ttyname()
+ * or their thread-safe analogs.
+ *
+ * If you are on a platform that defines XTHREADS but does not have
+ * MT-safe system API (e.g. UnixWare) you must define _Xos_processLock
+ * and _Xos_processUnlock macros before including this header. If
+ * you are on OSF/1 V3.2 and plan to use readdir(), you must also define
+ * _Xos_isThreadInitialized. For convenience XOS_USE_XLIB_LOCKING or
+ * XOS_USE_XT_LOCKING may be defined to obtain either Xlib-only or
+ * Xt-based versions of these macros. These macros won't result in
+ * truly thread-safe calls, but they are better than nothing. If you
+ * do not want locking in this situation define XOS_USE_NO_LOCKING.
+ *
+ * NOTE: On systems lacking appropriate _r functions Gethostbyname(),
+ * Gethostbyaddr(), and Getservbyname() do NOT copy the host or
+ * protocol lists!
+ *
+ * NOTE: On systems lacking appropriate _r functions Getgrgid() and
+ * Getgrnam() do NOT copy the list of group members!
+ *
+ * This header is nominally intended to simplify porting X11, Motif, and
+ * CDE; it may be useful to other people too. The structure below is
+ * complicated, mostly because P1003.1c (the IEEE POSIX Threads spec)
+ * went through lots of drafts, and some vendors shipped systems based
+ * on draft API that were changed later. Unfortunately POSIX did not
+ * provide a feature-test macro for distinguishing each of the drafts.
+ */
+
+/*
+ * This header has several parts. Search for "Effective prototypes"
+ * to locate the beginning of a section.
+ */
+
+/* This header can be included multiple times with different defines! */
+#ifndef _XOS_R_H_
+# define _XOS_R_H_
+
+# include <X11/Xos.h>
+# include <X11/Xfuncs.h>
+
+# ifndef X_NOT_POSIX
+# ifdef _POSIX_SOURCE
+# include <limits.h>
+# else
+# define _POSIX_SOURCE
+# include <limits.h>
+# undef _POSIX_SOURCE
+# endif
+# ifndef LINE_MAX
+# define X_LINE_MAX 2048
+# else
+# define X_LINE_MAX LINE_MAX
+# endif
+# endif
+#endif /* _XOS_R_H */
+
+#ifndef WIN32
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# if defined(XOS_USE_XLIB_LOCKING)
+# ifndef XAllocIDs /* Xlibint.h does not have multiple include protection */
+typedef struct _LockInfoRec *LockInfoPtr;
+extern LockInfoPtr _Xglobal_lock;
+# endif
+# ifndef _Xos_isThreadInitialized
+# define _Xos_isThreadInitialized (_Xglobal_lock)
+# endif
+# if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
+# ifndef XAllocIDs /* Xlibint.h does not have multiple include protection */
+# include <X11/Xfuncproto.h> /* for NeedFunctionPrototypes */
+extern void (*_XLockMutex_fn)(
+# if NeedFunctionPrototypes
+ LockInfoPtr /* lock */, char * /* file */, int /* line */
+# endif
+);
+extern void (*_XUnlockMutex_fn)(
+# if NeedFunctionPrototypes
+ LockInfoPtr /* lock */, char * /* file */, int /* line */
+# endif
+);
+# endif
+# ifndef _Xos_processLock
+# define _Xos_processLock \
+ (_XLockMutex_fn ? (*_XLockMutex_fn)(_Xglobal_lock,__FILE__,__LINE__) : 0)
+# endif
+# ifndef _Xos_processUnlock
+# define _Xos_processUnlock \
+ (_XUnlockMutex_fn ? (*_XUnlockMutex_fn)(_Xglobal_lock,__FILE__,__LINE__) : 0)
+# endif
+# else
+# ifndef XAllocIDs /* Xlibint.h does not have multiple include protection */
+# include <X11/Xfuncproto.h> /* for NeedFunctionPrototypes */
+extern void (*_XLockMutex_fn)(
+# if NeedFunctionPrototypes
+ LockInfoPtr /* lock */
+# endif
+);
+extern void (*_XUnlockMutex_fn)(
+# if NeedFunctionPrototypes
+ LockInfoPtr /* lock */
+# endif
+);
+# endif
+# ifndef _Xos_processLock
+# define _Xos_processLock \
+ (_XLockMutex_fn ? ((*_XLockMutex_fn)(_Xglobal_lock), 0) : 0)
+# endif
+# ifndef _Xos_processUnlock
+# define _Xos_processUnlock \
+ (_XUnlockMutex_fn ? ((*_XUnlockMutex_fn)(_Xglobal_lock), 0) : 0)
+# endif
+# endif
+# elif defined(XOS_USE_XT_LOCKING)
+# ifndef _XtThreadsI_h
+extern void (*_XtProcessLock)(void);
+# endif
+# ifndef _XtintrinsicP_h
+# include <X11/Xfuncproto.h> /* for NeedFunctionPrototypes */
+extern void XtProcessLock(
+# if NeedFunctionPrototypes
+ void
+# endif
+);
+extern void XtProcessUnlock(
+# if NeedFunctionPrototypes
+ void
+# endif
+);
+# endif
+# ifndef _Xos_isThreadInitialized
+# define _Xos_isThreadInitialized _XtProcessLock
+# endif
+# ifndef _Xos_processLock
+# define _Xos_processLock XtProcessLock()
+# endif
+# ifndef _Xos_processUnlock
+# define _Xos_processUnlock XtProcessUnlock()
+# endif
+# elif defined(XOS_USE_NO_LOCKING)
+# ifndef _Xos_isThreadInitialized
+# define _Xos_isThreadInitialized 0
+# endif
+# ifndef _Xos_processLock
+# define _Xos_processLock 0
+# endif
+# ifndef _Xos_processUnlock
+# define _Xos_processUnlock 0
+# endif
+# endif
+
+#endif /* !defined WIN32 */
+
+/*
+ * Solaris defines the POSIX thread-safe feature test macro, but
+ * uses the older SVR4 thread-safe functions unless the POSIX ones
+ * are specifically requested. Fix the feature test macro.
+ */
+#if defined(sun) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && \
+ (_POSIX_C_SOURCE - 0 < 199506L) && !defined(_POSIX_PTHREAD_SEMANTICS)
+# undef _POSIX_THREAD_SAFE_FUNCTIONS
+#endif
+
+/*
+ * LynxOS 3.1 defines _POSIX_THREAD_SAFE_FUNCTIONS but
+ * getpwuid_r has different semantics than defined by POSIX
+ */
+#if defined(Lynx) && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
+# undef _POSIX_THREAD_SAFE_FUNCTIONS
+#endif
+
+
+/***** <pwd.h> wrappers *****/
+
+/*
+ * Effective prototypes for <pwd.h> wrappers:
+ *
+ * #define X_INCLUDE_PWD_H
+ * #define XOS_USE_..._LOCKING
+ * #include <X11/Xos_r.h>
+ *
+ * typedef ... _Xgetpwparams;
+ *
+ * struct passwd* _XGetpwnam(const char *name, _Xgetpwparams);
+ * struct passwd* _XGetpwuid(uid_t uid, _Xgetpwparams);
+ */
+
+#if defined(X_INCLUDE_PWD_H) && !defined(_XOS_INCLUDED_PWD_H)
+# include <pwd.h>
+# if defined(XUSE_MTSAFE_API) || defined(XUSE_MTSAFE_PWDAPI)
+# define XOS_USE_MTSAFE_PWDAPI 1
+# endif
+#endif
+
+#undef X_NEEDS_PWPARAMS
+#if !defined(X_INCLUDE_PWD_H) || defined(_XOS_INCLUDED_PWD_H)
+/* Do nothing */
+
+#elif !defined(XTHREADS) && !defined(X_FORCE_USE_MTSAFE_API)
+/* Use regular, unsafe API. */
+# if defined(X_NOT_POSIX) && !defined(i386) && !defined(SYSV)
+extern struct passwd *getpwuid(), *getpwnam();
+# endif
+typedef int _Xgetpwparams; /* dummy */
+# define _XGetpwuid(u,p) getpwuid((u))
+# define _XGetpwnam(u,p) getpwnam((u))
+
+#elif !defined(XOS_USE_MTSAFE_PWDAPI) || defined(XNO_MTSAFE_PWDAPI)
+/* UnixWare 2.0, or other systems with thread support but no _r API. */
+# define X_NEEDS_PWPARAMS
+typedef struct {
+ struct passwd pws;
+ char pwbuf[1024];
+ struct passwd* pwp;
+ size_t len;
+} _Xgetpwparams;
+
+/*
+ * NetBSD and FreeBSD, at least, are missing several of the unixware passwd
+ * fields.
+ */
+
+#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || \
+ defined(__APPLE__) || defined(__DragonFly__)
+static __inline__ void _Xpw_copyPasswd(_Xgetpwparams p)
+{
+ memcpy(&(p).pws, (p).pwp, sizeof(struct passwd));
+
+ (p).pws.pw_name = (p).pwbuf;
+ (p).len = strlen((p).pwp->pw_name);
+ strcpy((p).pws.pw_name, (p).pwp->pw_name);
+
+ (p).pws.pw_passwd = (p).pws.pw_name + (p).len + 1;
+ (p).len = strlen((p).pwp->pw_passwd);
+ strcpy((p).pws.pw_passwd,(p).pwp->pw_passwd);
+
+ (p).pws.pw_class = (p).pws.pw_passwd + (p).len + 1;
+ (p).len = strlen((p).pwp->pw_class);
+ strcpy((p).pws.pw_class, (p).pwp->pw_class);
+
+ (p).pws.pw_gecos = (p).pws.pw_class + (p).len + 1;
+ (p).len = strlen((p).pwp->pw_gecos);
+ strcpy((p).pws.pw_gecos, (p).pwp->pw_gecos);
+
+ (p).pws.pw_dir = (p).pws.pw_gecos + (p).len + 1;
+ (p).len = strlen((p).pwp->pw_dir);
+ strcpy((p).pws.pw_dir, (p).pwp->pw_dir);
+
+ (p).pws.pw_shell = (p).pws.pw_dir + (p).len + 1;
+ (p).len = strlen((p).pwp->pw_shell);
+ strcpy((p).pws.pw_shell, (p).pwp->pw_shell);
+
+ (p).pwp = &(p).pws;
+}
+
+#else
+# define _Xpw_copyPasswd(p) \
+ (memcpy(&(p).pws, (p).pwp, sizeof(struct passwd)), \
+ ((p).pws.pw_name = (p).pwbuf), \
+ ((p).len = strlen((p).pwp->pw_name)), \
+ strcpy((p).pws.pw_name, (p).pwp->pw_name), \
+ ((p).pws.pw_passwd = (p).pws.pw_name + (p).len + 1), \
+ ((p).len = strlen((p).pwp->pw_passwd)), \
+ strcpy((p).pws.pw_passwd,(p).pwp->pw_passwd), \
+ ((p).pws.pw_age = (p).pws.pw_passwd + (p).len + 1), \
+ ((p).len = strlen((p).pwp->pw_age)), \
+ strcpy((p).pws.pw_age, (p).pwp->pw_age), \
+ ((p).pws.pw_comment = (p).pws.pw_age + (p).len + 1), \
+ ((p).len = strlen((p).pwp->pw_comment)), \
+ strcpy((p).pws.pw_comment, (p).pwp->pw_comment), \
+ ((p).pws.pw_gecos = (p).pws.pw_comment + (p).len + 1), \
+ ((p).len = strlen((p).pwp->pw_gecos)), \
+ strcpy((p).pws.pw_gecos, (p).pwp->pw_gecos), \
+ ((p).pws.pw_dir = (p).pws.pw_comment + (p).len + 1), \
+ ((p).len = strlen((p).pwp->pw_dir)), \
+ strcpy((p).pws.pw_dir, (p).pwp->pw_dir), \
+ ((p).pws.pw_shell = (p).pws.pw_dir + (p).len + 1), \
+ ((p).len = strlen((p).pwp->pw_shell)), \
+ strcpy((p).pws.pw_shell, (p).pwp->pw_shell), \
+ ((p).pwp = &(p).pws), \
+ 0 )
+#endif
+# define _XGetpwuid(u,p) \
+( (_Xos_processLock), \
+ (((p).pwp = getpwuid((u))) ? _Xpw_copyPasswd(p), 0 : 0), \
+ (_Xos_processUnlock), \
+ (p).pwp )
+# define _XGetpwnam(u,p) \
+( (_Xos_processLock), \
+ (((p).pwp = getpwnam((u))) ? _Xpw_copyPasswd(p), 0 : 0), \
+ (_Xos_processUnlock), \
+ (p).pwp )
+
+#elif !defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(__APPLE__)
+/* SVR4 threads, AIX 4.2.0 and earlier and OSF/1 3.2 and earlier pthreads */
+# define X_NEEDS_PWPARAMS
+typedef struct {
+ struct passwd pws;
+ char pwbuf[X_LINE_MAX];
+} _Xgetpwparams;
+# if defined(_POSIX_REENTRANT_FUNCTIONS) || !defined(SVR4) || defined(Lynx)
+# ifndef Lynx
+# define _XGetpwuid(u,p) \
+((getpwuid_r((u),&(p).pws,(p).pwbuf,sizeof((p).pwbuf)) == -1) ? NULL : &(p).pws)
+# define _XGetpwnam(u,p) \
+((getpwnam_r((u),&(p).pws,(p).pwbuf,sizeof((p).pwbuf)) == -1) ? NULL : &(p).pws)
+# else /* Lynx */
+# define _XGetpwuid(u,p) \
+((getpwuid_r(&(p).pws,(u),(p).pwbuf,sizeof((p).pwbuf)) == -1) ? NULL : &(p).pws)
+# define _XGetpwnam(u,p) \
+((getpwnam_r(&(p).pws,(u),(p).pwbuf,sizeof((p).pwbuf)) == -1) ? NULL : &(p).pws)
+# endif
+# else /* SVR4 */
+# define _XGetpwuid(u,p) \
+((getpwuid_r((u),&(p).pws,(p).pwbuf,sizeof((p).pwbuf)) == NULL) ? NULL : &(p).pws)
+# define _XGetpwnam(u,p) \
+((getpwnam_r((u),&(p).pws,(p).pwbuf,sizeof((p).pwbuf)) == NULL) ? NULL : &(p).pws)
+# endif /* SVR4 */
+
+#else /* _POSIX_THREAD_SAFE_FUNCTIONS */
+/* Digital UNIX 4.0, but not (beta) T4.0-1 */
+# if defined(__osf__)
+/* OSF/1 V4.0 <pwd.h> doesn't declare the _P routines, breaking under C++. */
+extern int _Pgetpwuid_r(uid_t, struct passwd *, char *, size_t, struct passwd **);
+extern int _Pgetpwnam_r(const char *, struct passwd *, char *, size_t, struct passwd **);
+# endif
+# define X_NEEDS_PWPARAMS
+typedef struct {
+ struct passwd pws;
+ char pwbuf[X_LINE_MAX];
+ struct passwd* pwp;
+} _Xgetpwparams;
+typedef int _Xgetpwret;
+# define _XGetpwuid(u,p) \
+((getpwuid_r((u),&(p).pws,(p).pwbuf,sizeof((p).pwbuf),&(p).pwp) == 0) ? \
+ (p).pwp : NULL)
+# define _XGetpwnam(u,p) \
+((getpwnam_r((u),&(p).pws,(p).pwbuf,sizeof((p).pwbuf),&(p).pwp) == 0) ? \
+ (p).pwp : NULL)
+#endif /* X_INCLUDE_PWD_H */
+
+#if defined(X_INCLUDE_PWD_H) && !defined(_XOS_INCLUDED_PWD_H)
+# define _XOS_INCLUDED_PWD_H
+#endif
+
+
+/***** <netdb.h> wrappers *****/
+
+/*
+ * Effective prototypes for <netdb.h> wrappers:
+ *
+ * NOTE: On systems lacking the appropriate _r functions Gethostbyname(),
+ * Gethostbyaddr(), and Getservbyname() do NOT copy the host or
+ * protocol lists!
+ *
+ * #define X_INCLUDE_NETDB_H
+ * #define XOS_USE_..._LOCKING
+ * #include <X11/Xos_r.h>
+ *
+ * typedef ... _Xgethostbynameparams;
+ * typedef ... _Xgetservbynameparams;
+ *
+ * struct hostent* _XGethostbyname(const char* name,_Xgethostbynameparams);
+ * struct hostent* _XGethostbyaddr(const char* addr, int len, int type,
+ * _Xgethostbynameparams);
+ * struct servent* _XGetservbyname(const char* name, const char* proto,
+ * _Xgetservbynameparams);
+ */
+
+#undef XTHREADS_NEEDS_BYNAMEPARAMS
+#if defined(X_INCLUDE_NETDB_H) && !defined(_XOS_INCLUDED_NETDB_H) \
+ && !defined(WIN32)
+# include <netdb.h>
+# if defined(XUSE_MTSAFE_API) || defined(XUSE_MTSAFE_NETDBAPI)
+# define XOS_USE_MTSAFE_NETDBAPI 1
+# endif
+#endif
+
+#if !defined(X_INCLUDE_NETDB_H) || defined(_XOS_INCLUDED_NETDB_H)
+/* Do nothing. */
+
+#elif !defined(XTHREADS) && !defined(X_FORCE_USE_MTSAFE_API)
+/* Use regular, unsafe API. */
+typedef int _Xgethostbynameparams; /* dummy */
+typedef int _Xgetservbynameparams; /* dummy */
+# define _XGethostbyname(h,hp) gethostbyname((h))
+# define _XGethostbyaddr(a,al,t,hp) gethostbyaddr((a),(al),(t))
+# define _XGetservbyname(s,p,sp) getservbyname((s),(p))
+
+#elif !defined(XOS_USE_MTSAFE_NETDBAPI) || defined(XNO_MTSAFE_NETDBAPI)
+/* UnixWare 2.0, or other systems with thread support but no _r API. */
+/* WARNING: The h_addr_list and s_aliases values are *not* copied! */
+
+#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
+#include <sys/param.h>
+#endif
+
+typedef struct {
+ struct hostent hent;
+ char h_name[MAXHOSTNAMELEN];
+ struct hostent *hptr;
+} _Xgethostbynameparams;
+typedef struct {
+ struct servent sent;
+ char s_name[255];
+ char s_proto[255];
+ struct servent *sptr;
+} _Xgetservbynameparams;
+
+# define XTHREADS_NEEDS_BYNAMEPARAMS
+
+# define _Xg_copyHostent(hp) \
+ (memcpy(&(hp).hent, (hp).hptr, sizeof(struct hostent)), \
+ strcpy((hp).h_name, (hp).hptr->h_name), \
+ ((hp).hent.h_name = (hp).h_name), \
+ ((hp).hptr = &(hp).hent), \
+ 0 )
+# define _Xg_copyServent(sp) \
+ (memcpy(&(sp).sent, (sp).sptr, sizeof(struct servent)), \
+ strcpy((sp).s_name, (sp).sptr->s_name), \
+ ((sp).sent.s_name = (sp).s_name), \
+ strcpy((sp).s_proto, (sp).sptr->s_proto), \
+ ((sp).sent.s_proto = (sp).s_proto), \
+ ((sp).sptr = &(sp).sent), \
+ 0 )
+# define _XGethostbyname(h,hp) \
+ ((_Xos_processLock), \
+ (((hp).hptr = gethostbyname((h))) ? _Xg_copyHostent(hp) : 0), \
+ (_Xos_processUnlock), \
+ (hp).hptr )
+# define _XGethostbyaddr(a,al,t,hp) \
+ ((_Xos_processLock), \
+ (((hp).hptr = gethostbyaddr((a),(al),(t))) ? _Xg_copyHostent(hp) : 0), \
+ (_Xos_processUnlock), \
+ (hp).hptr )
+# define _XGetservbyname(s,p,sp) \
+ ((_Xos_processLock), \
+ (((sp).sptr = getservbyname((s),(p))) ? _Xg_copyServent(sp) : 0), \
+ (_Xos_processUnlock), \
+ (sp).sptr )
+
+#elif defined(XUSE_NETDB_R_API)
+/*
+ * POSIX does not specify _r equivalents for <netdb.h> API, but some
+ * vendors provide them anyway. Use them only when explicitly asked.
+ */
+# ifdef _POSIX_REENTRANT_FUNCTIONS
+# ifndef _POSIX_THREAD_SAFE_FUNCTIONS
+# if defined(AIXV3) || defined(AIXV4) || defined(__osf__)
+# define X_POSIX_THREAD_SAFE_FUNCTIONS 1
+# endif
+# endif
+# endif
+# ifdef _POSIX_THREAD_SAFE_FUNCTIONS
+# define X_POSIX_THREAD_SAFE_FUNCTIONS 1
+# endif
+
+# define XTHREADS_NEEDS_BYNAMEPARAMS
+
+# ifndef X_POSIX_THREAD_SAFE_FUNCTIONS
+typedef struct {
+ struct hostent hent;
+ char hbuf[X_LINE_MAX];
+ int herr;
+} _Xgethostbynameparams;
+typedef struct {
+ struct servent sent;
+ char sbuf[X_LINE_MAX];
+} _Xgetservbynameparams;
+# define _XGethostbyname(h,hp) \
+ gethostbyname_r((h),&(hp).hent,(hp).hbuf,sizeof((hp).hbuf),&(hp).herr)
+# define _XGethostbyaddr(a,al,t,hp) \
+ gethostbyaddr_r((a),(al),(t),&(hp).hent,(hp).hbuf,sizeof((hp).hbuf),&(hp).herr)
+# define _XGetservbyname(s,p,sp) \
+ getservbyname_r((s),(p),&(sp).sent,(sp).sbuf,sizeof((sp).sbuf))
+# else
+typedef struct {
+ struct hostent hent;
+ struct hostent_data hdata;
+} _Xgethostbynameparams;
+typedef struct {
+ struct servent sent;
+ struct servent_data sdata;
+} _Xgetservbynameparams;
+# define _XGethostbyname(h,hp) \
+ (bzero((char*)&(hp).hdata,sizeof((hp).hdata)), \
+ ((gethostbyname_r((h),&(hp).hent,&(hp).hdata) == -1) ? NULL : &(hp).hent))
+# define _XGethostbyaddr(a,al,t,hp) \
+ (bzero((char*)&(hp).hdata,sizeof((hp).hdata)), \
+ ((gethostbyaddr_r((a),(al),(t),&(hp).hent,&(hp).hdata) == -1) ? NULL : &(hp).hent))
+# define _XGetservbyname(s,p,sp) \
+ (bzero((char*)&(sp).sdata,sizeof((sp).sdata)), \
+ ((getservbyname_r((s),(p),&(sp).sent,&(sp).sdata) == -1) ? NULL : &(sp).sent) )
+# endif
+# ifdef X_POSIX_THREAD_SAFE_FUNCTIONS
+# undef X_POSIX_THREAD_SAFE_FUNCTIONS
+# endif
+
+#else
+/* The regular API is assumed to be MT-safe under POSIX. */
+typedef int _Xgethostbynameparams; /* dummy */
+typedef int _Xgetservbynameparams; /* dummy */
+# define _XGethostbyname(h,hp) gethostbyname((h))
+# define _XGethostbyaddr(a,al,t,hp) gethostbyaddr((a),(al),(t))
+# define _XGetservbyname(s,p,sp) getservbyname((s),(p))
+#endif /* X_INCLUDE_NETDB_H */
+
+#if defined(X_INCLUDE_NETDB_H) && !defined(_XOS_INCLUDED_NETDB_H)
+# define _XOS_INCLUDED_NETDB_H
+#endif
+
+
+/***** <dirent.h> wrappers *****/
+
+/*
+ * Effective prototypes for <dirent.h> wrappers:
+ *
+ * #define X_INCLUDE_DIRENT_H
+ * #define XOS_USE_..._LOCKING
+ * #include <X11/Xos_r.h>
+ *
+ * typedef ... _Xreaddirparams;
+ *
+ * struct dirent *_XReaddir(DIR *dir_pointer, _Xreaddirparams);
+ */
+
+#if defined(X_INCLUDE_DIRENT_H) && !defined(_XOS_INCLUDED_DIRENT_H)
+# include <sys/types.h>
+# if !defined(X_NOT_POSIX) || defined(SYSV) || defined(USG)
+# include <dirent.h>
+# else
+# include <sys/dir.h>
+# ifndef dirent
+# define dirent direct
+# endif
+# endif
+# if defined(XUSE_MTSAFE_API) || defined(XUSE_MTSAFE_DIRENTAPI)
+# define XOS_USE_MTSAFE_DIRENTAPI 1
+# endif
+#endif
+
+#if !defined(X_INCLUDE_DIRENT_H) || defined(_XOS_INCLUDED_DIRENT_H)
+/* Do nothing. */
+
+#elif !defined(XTHREADS) && !defined(X_FORCE_USE_MTSAFE_API)
+/* Use regular, unsafe API. */
+typedef int _Xreaddirparams; /* dummy */
+# define _XReaddir(d,p) readdir(d)
+
+#elif !defined(XOS_USE_MTSAFE_DIRENTAPI) || defined(XNO_MTSAFE_DIRENTAPI)
+/* Systems with thread support but no _r API. */
+typedef struct {
+ struct dirent *result;
+ struct dirent dir_entry;
+# ifdef _POSIX_PATH_MAX
+ char buf[_POSIX_PATH_MAX];
+# elif defined(NAME_MAX)
+ char buf[NAME_MAX];
+# else
+ char buf[255];
+# endif
+} _Xreaddirparams;
+
+# define _XReaddir(d,p) \
+ ( (_Xos_processLock), \
+ (((p).result = readdir((d))) ? \
+ (memcpy(&((p).dir_entry), (p).result, (p).result->d_reclen), \
+ ((p).result = &(p).dir_entry), 0) : \
+ 0), \
+ (_Xos_processUnlock), \
+ (p).result )
+
+#else
+typedef struct {
+ struct dirent *result;
+ struct dirent dir_entry;
+# ifdef _POSIX_PATH_MAX
+ char buf[_POSIX_PATH_MAX];
+# elif defined(NAME_MAX)
+ char buf[NAME_MAX];
+# else
+ char buf[255];
+# endif
+} _Xreaddirparams;
+
+# if defined(_POSIX_THREAD_SAFE_FUNCTIONS) || defined(AIXV3) || \
+ defined(AIXV4) || defined(__APPLE__)
+/* AIX defines the draft POSIX symbol, but uses the final API. */
+/* POSIX final API, returns (int)0 on success. */
+# if defined(__osf__)
+/* OSF/1 V4.0 <dirent.h> doesn't declare _Preaddir_r, breaking under C++. */
+extern int _Preaddir_r(DIR *, struct dirent *, struct dirent **);
+# endif
+# define _XReaddir(d,p) \
+ (readdir_r((d), &((p).dir_entry), &((p).result)) ? NULL : (p).result)
+# elif defined(_POSIX_REENTRANT_FUNCTIONS) && defined(__osf__)
+/*
+ * OSF/1 V3.2 readdir_r() will SEGV if the main program is not
+ * explicitly linked with -lc_r. The library REQUIREDLIBS don't help.
+ * Assume that if threads have been initialized we're linked properly.
+ */
+# define _XReaddir(d,p) \
+ ( (_Xos_isThreadInitialized) ? \
+ (readdir_r((d), &((p).dir_entry)) ? NULL : &((p).dir_entry)) : \
+ ((_Xos_processLock), \
+ (((p).result = readdir((d))) ? \
+ (memcpy(&((p).dir_entry), (p).result, (p).result->d_reclen), \
+ ((p).result = &(p).dir_entry), 0) : \
+ 0), \
+ (_Xos_processUnlock), \
+ (p).result) )
+# elif defined(_POSIX_REENTRANT_FUNCTIONS)
+/* POSIX draft API, returns (int)0 on success. */
+# define _XReaddir(d,p) \
+ (readdir_r((d),&((p).dir_entry)) ? NULL : &((p).dir_entry))
+# elif defined(SVR4)
+/* Pre-POSIX API, returns non-NULL on success. */
+# define _XReaddir(d,p) (readdir_r((d), &(p).dir_entry))
+# else
+/* We have no idea what is going on. Fake it all using process locks. */
+# define _XReaddir(d,p) \
+ ( (_Xos_processLock), \
+ (((p).result = readdir((d))) ? \
+ (memcpy(&((p).dir_entry), (p).result, (p).result->d_reclen), \
+ ((p).result = &(p).dir_entry), 0) : \
+ 0), \
+ (_Xos_processUnlock), \
+ (p).result )
+# endif
+#endif /* X_INCLUDE_DIRENT_H */
+
+#if defined(X_INCLUDE_DIRENT_H) && !defined(_XOS_INCLUDED_DIRENT_H)
+# define _XOS_INCLUDED_DIRENT_H
+#endif
+
+
+/***** <unistd.h> wrappers *****/
+
+/*
+ * Effective prototypes for <unistd.h> wrappers:
+ *
+ * #define X_INCLUDE_UNISTD_H
+ * #define XOS_USE_..._LOCKING
+ * #include <X11/Xos_r.h>
+ *
+ * typedef ... _Xgetloginparams;
+ * typedef ... _Xttynameparams;
+ *
+ * char *_XGetlogin(_Xgetloginparams);
+ * char *_XTtyname(int, _Xttynameparams);
+ */
+
+#if defined(X_INCLUDE_UNISTD_H) && !defined(_XOS_INCLUDED_UNISTD_H)
+/* <unistd.h> already included by <X11/Xos.h> */
+# if defined(XUSE_MTSAFE_API) || defined(XUSE_MTSAFE_UNISTDAPI)
+# define XOS_USE_MTSAFE_UNISTDAPI 1
+# endif
+#endif
+
+#if !defined(X_INCLUDE_UNISTD_H) || defined(_XOS_INCLUDED_UNISTD_H)
+/* Do nothing. */
+
+#elif !defined(XTHREADS) && !defined(X_FORCE_USE_MTSAFE_API)
+/* Use regular, unsafe API. */
+typedef int _Xgetloginparams; /* dummy */
+typedef int _Xttynameparams; /* dummy */
+# define _XGetlogin(p) getlogin()
+# define _XTtyname(f) ttyname((f))
+
+#elif !defined(XOS_USE_MTSAFE_UNISTDAPI) || defined(XNO_MTSAFE_UNISTDAPI)
+/* Systems with thread support but no _r API. */
+typedef struct {
+ char *result;
+# if defined(MAXLOGNAME)
+ char buf[MAXLOGNAME];
+# elif defined(LOGIN_NAME_MAX)
+ char buf[LOGIN_NAME_MAX];
+# else
+ char buf[64];
+# endif
+} _Xgetloginparams;
+typedef struct {
+ char *result;
+# ifdef TTY_NAME_MAX
+ char buf[TTY_NAME_MAX];
+# elif defined(_POSIX_TTY_NAME_MAX)
+ char buf[_POSIX_TTY_NAME_MAX];
+# elif defined(_POSIX_PATH_MAX)
+ char buf[_POSIX_PATH_MAX];
+# else
+ char buf[256];
+# endif
+} _Xttynameparams;
+
+# define _XGetlogin(p) \
+ ( (_Xos_processLock), \
+ (((p).result = getlogin()) ? \
+ (strncpy((p).buf, (p).result, sizeof((p).buf)), \
+ ((p).buf[sizeof((p).buf)-1] = '\0'), \
+ ((p).result = (p).buf), 0) : 0), \
+ (_Xos_processUnlock), \
+ (p).result )
+#define _XTtyname(f,p) \
+ ( (_Xos_processLock), \
+ (((p).result = ttyname(f)) ? \
+ (strncpy((p).buf, (p).result, sizeof((p).buf)), \
+ ((p).buf[sizeof((p).buf)-1] = '\0'), \
+ ((p).result = (p).buf), 0) : 0), \
+ (_Xos_processUnlock), \
+ (p).result )
+
+#elif defined(_POSIX_THREAD_SAFE_FUNCTIONS) || defined(_POSIX_REENTRANT_FUNCTIONS)
+/* POSIX API.
+ *
+ * extern int getlogin_r(char *, size_t);
+ * extern int ttyname_r(int, char *, size_t);
+ */
+typedef struct {
+# if defined(MAXLOGNAME)
+ char buf[MAXLOGNAME];
+# elif defined(LOGIN_NAME_MAX)
+ char buf[LOGIN_NAME_MAX];
+# else
+ char buf[64];
+# endif
+} _Xgetloginparams;
+typedef struct {
+# ifdef TTY_NAME_MAX
+ char buf[TTY_NAME_MAX];
+# elif defined(_POSIX_TTY_NAME_MAX)
+ char buf[_POSIX_TTY_NAME_MAX];
+# elif defined(_POSIX_PATH_MAX)
+ char buf[_POSIX_PATH_MAX];
+# else
+ char buf[256];
+# endif
+} _Xttynameparams;
+
+# define _XGetlogin(p) (getlogin_r((p).buf, sizeof((p).buf)) ? NULL : (p).buf)
+# define _XTtyname(f,p) \
+ (ttyname_r((f), (p).buf, sizeof((p).buf)) ? NULL : (p).buf)
+
+#else
+/* Pre-POSIX API.
+ *
+ * extern char *getlogin_r(char *, size_t);
+ * extern char *ttyname_r(int, char *, size_t);
+ */
+typedef struct {
+# if defined(MAXLOGNAME)
+ char buf[MAXLOGNAME];
+# elif defined(LOGIN_NAME_MAX)
+ char buf[LOGIN_NAME_MAX];
+# else
+ char buf[64];
+# endif
+} _Xgetloginparams;
+typedef struct {
+# ifdef TTY_NAME_MAX
+ char buf[TTY_NAME_MAX];
+# elif defined(_POSIX_TTY_NAME_MAX)
+ char buf[_POSIX_TTY_NAME_MAX];
+# elif defined(_POSIX_PATH_MAX)
+ char buf[_POSIX_PATH_MAX];
+# else
+ char buf[256];
+# endif
+} _Xttynameparams;
+
+# define _XGetlogin(p) getlogin_r((p).buf, sizeof((p).buf))
+# define _XTtyname(f,p) ttyname_r((f), (p).buf, sizeof((p).buf))
+#endif /* X_INCLUDE_UNISTD_H */
+
+#if defined(X_INCLUDE_UNISTD_H) && !defined(_XOS_INCLUDED_UNISTD_H)
+# define _XOS_INCLUDED_UNISTD_H
+#endif
+
+
+/***** <string.h> wrappers *****/
+
+/*
+ * Effective prototypes for <string.h> wrappers:
+ *
+ * #define X_INCLUDE_STRING_H
+ * #define XOS_USE_..._LOCKING
+ * #include <X11/Xos_r.h>
+ *
+ * typedef ... _Xstrtokparams;
+ *
+ * char *_XStrtok(char *, const char*, _Xstrtokparams);
+ */
+
+#if defined(X_INCLUDE_STRING_H) && !defined(_XOS_INCLUDED_STRING_H)
+/* <string.h> has already been included by <X11/Xos.h> */
+# if defined(XUSE_MTSAFE_API) || defined(XUSE_MTSAFE_STRINGAPI)
+# define XOS_USE_MTSAFE_STRINGAPI 1
+# endif
+#endif
+
+#if !defined(X_INCLUDE_STRING_H) || defined(_XOS_INCLUDED_STRING_H)
+/* Do nothing. */
+
+#elif !defined(XTHREADS) && !defined(X_FORCE_USE_MTSAFE_API)
+/* Use regular, unsafe API. */
+typedef int _Xstrtokparams; /* dummy */
+# define _XStrtok(s1,s2,p) \
+ ( p = 0, (void)p, strtok((s1),(s2)) )
+
+#elif !defined(XOS_USE_MTSAFE_STRINGAPI) || defined(XNO_MTSAFE_STRINGAPI)
+/* Systems with thread support but no _r API. */
+typedef char *_Xstrtokparams;
+# define _XStrtok(s1,s2,p) \
+ ( (_Xos_processLock), \
+ ((p) = strtok((s1),(s2))), \
+ (_Xos_processUnlock), \
+ (p) )
+
+#else
+/* POSIX or pre-POSIX API. */
+typedef char * _Xstrtokparams;
+# define _XStrtok(s1,s2,p) strtok_r((s1),(s2),&(p))
+#endif /* X_INCLUDE_STRING_H */
+
+
+/***** <time.h> wrappers *****/
+
+/*
+ * Effective prototypes for <time.h> wrappers:
+ *
+ * #define X_INCLUDE_TIME_H
+ * #define XOS_USE_..._LOCKING
+ * #include <X11/Xos_r.h>
+ *
+ * typedef ... _Xatimeparams;
+ * typedef ... _Xctimeparams;
+ * typedef ... _Xgtimeparams;
+ * typedef ... _Xltimeparams;
+ *
+ * char *_XAsctime(const struct tm *, _Xatimeparams);
+ * char *_XCtime(const time_t *, _Xctimeparams);
+ * struct tm *_XGmtime(const time_t *, _Xgtimeparams);
+ * struct tm *_XLocaltime(const time_t *, _Xltimeparams);
+ */
+
+#if defined(X_INCLUDE_TIME_H) && !defined(_XOS_INCLUDED_TIME_H)
+# include <time.h>
+# if defined(XUSE_MTSAFE_API) || defined(XUSE_MTSAFE_TIMEAPI)
+# define XOS_USE_MTSAFE_TIMEAPI 1
+# endif
+#endif
+
+#if !defined(X_INCLUDE_TIME_H) || defined(_XOS_INCLUDED_TIME_H)
+/* Do nothing. */
+
+#elif !defined(XTHREADS) && !defined(X_FORCE_USE_MTSAFE_API)
+/* Use regular, unsafe API. */
+typedef int _Xatimeparams; /* dummy */
+# define _XAsctime(t,p) asctime((t))
+typedef int _Xctimeparams; /* dummy */
+# define _XCtime(t,p) ctime((t))
+typedef int _Xgtimeparams; /* dummy */
+# define _XGmtime(t,p) gmtime((t))
+typedef int _Xltimeparams; /* dummy */
+# define _XLocaltime(t,p) localtime((t))
+
+#elif !defined(XOS_USE_MTSAFE_TIMEAPI) || defined(XNO_MTSAFE_TIMEAPI)
+/* Systems with thread support but no _r API. */
+typedef struct {
+# ifdef TIMELEN
+ char buf[TIMELEN];
+# else
+ char buf[26];
+# endif
+ char *result;
+} _Xctimeparams, _Xatimeparams;
+typedef struct {
+ struct tm buf;
+ struct tm *result;
+} _Xgtimeparams, _Xltimeparams;
+# define _XAsctime(t,p) \
+ ( (_Xos_processLock), \
+ (((p).result = asctime((t))) ? \
+ (strncpy((p).buf, (p).result, sizeof((p).buf)), (p).result = &(p).buf) : \
+ 0), \
+ (_Xos_processUnlock), \
+ (p).result )
+# define _XCtime(t,p) \
+ ( (_Xos_processLock), \
+ (((p).result = ctime((t))) ? \
+ (strncpy((p).buf, (p).result, sizeof((p).buf)), (p).result = &(p).buf) : \
+ 0), \
+ (_Xos_processUnlock), \
+ (p).result )
+# define _XGmtime(t,p) \
+ ( (_Xos_processLock), \
+ (((p).result = gmtime(t)) ? \
+ (memcpy(&(p).buf, (p).result, sizeof((p).buf)), (p).result = &(p).buf) : \
+ 0), \
+ (_Xos_processUnlock), \
+ (p).result )
+# define _XLocaltime(t,p) \
+ ( (_Xos_processLock), \
+ (((p).result = localtime(t)) ? \
+ (memcpy(&(p).buf, (p).result, sizeof((p).buf)), (p).result = &(p).buf) : \
+ 0), \
+ (_Xos_processUnlock), \
+ (p).result )
+
+#elif !defined(_POSIX_THREAD_SAFE_FUNCTIONS) && (defined(__osf__) || defined(hpV4))
+/* Returns (int)0 on success. OSF/1 v3.2, HP/UX 10
+ *
+ * extern int asctime_r(const struct tm *timeptr, char *buffer, int buflen);
+ * extern int ctime_r(const time_t *timer, char *buffer, int buflen);
+ * extern int gmtime_r(const time_t *timer, struct tm *result);
+ * extern int localtime_r(const time_t *timer, struct tm *result);
+ */
+# ifdef TIMELEN
+typedef char _Xatimeparams[TIMELEN];
+typedef char _Xctimeparams[TIMELEN];
+# else
+typedef char _Xatimeparams[26];
+typedef char _Xctimeparams[26];
+# endif
+typedef struct tm _Xgtimeparams;
+typedef struct tm _Xltimeparams;
+# define _XAsctime(t,p) (asctime_r((t),(p),sizeof((p))) ? NULL : (p))
+# define _XCtime(t,p) (ctime_r((t),(p),sizeof((p))) ? NULL : (p))
+# define _XGmtime(t,p) (gmtime_r((t),&(p)) ? NULL : &(p))
+# define _XLocaltime(t,p) (localtime_r((t),&(p)) ? NULL : &(p))
+
+#elif !defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(sun)
+/* Returns NULL on failure. Solaris 2.5
+ *
+ * extern char *asctime_r(const struct tm *tm,char *buf, int buflen);
+ * extern char *ctime_r(const time_t *clock, char *buf, int buflen);
+ * extern struct tm *gmtime_r(const time_t *clock, struct tm *res);
+ * extern struct tm *localtime_r(const time_t *clock, struct tm *res);
+ */
+# ifdef TIMELEN
+typedef char _Xatimeparams[TIMELEN];
+typedef char _Xctimeparams[TIMELEN];
+# else
+typedef char _Xatimeparams[26];
+typedef char _Xctimeparams[26];
+# endif
+typedef struct tm _Xgtimeparams;
+typedef struct tm _Xltimeparams;
+# define _XAsctime(t,p) asctime_r((t),(p),sizeof((p)))
+# define _XCtime(t,p) ctime_r((t),(p),sizeof((p)))
+# define _XGmtime(t,p) gmtime_r((t),&(p))
+# define _XLocaltime(t,p) localtime_r((t),&(p))
+
+#else /* defined(_POSIX_THREAD_SAFE_FUNCTIONS) */
+/* POSIX final API. OSF/1 v4.0, AIX, etc.
+ *
+ * extern char *asctime_r(const struct tm *timeptr, char *buffer);
+ * extern char *ctime_r(const time_t *timer, char *buffer);
+ * extern struct tm *gmtime_r(const time_t *timer, struct tm *result);
+ * extern struct tm *localtime_r(const time_t *timer, struct tm *result);
+ */
+# if defined(__osf__)
+/* OSF/1 V4.0 <time.h> doesn't declare the _P routines, breaking under C++. */
+extern char *_Pasctime_r(const struct tm *, char *);
+extern char *_Pctime_r(const time_t *, char *);
+extern struct tm *_Plocaltime_r(const time_t *, struct tm *);
+# endif
+# ifdef TIMELEN
+typedef char _Xatimeparams[TIMELEN];
+typedef char _Xctimeparams[TIMELEN];
+# else
+typedef char _Xatimeparams[26];
+typedef char _Xctimeparams[26];
+# endif
+typedef struct tm _Xgtimeparams;
+typedef struct tm _Xltimeparams;
+# define _XAsctime(t,p) asctime_r((t),(p))
+# define _XCtime(t,p) ctime_r((t),(p))
+# define _XGmtime(t,p) gmtime_r((t),&(p))
+# define _XLocaltime(t,p) localtime_r((t),&(p))
+#endif /* X_INCLUDE_TIME_H */
+
+#if defined(X_INCLUDE_TIME_H) && !defined(_XOS_INCLUDED_TIME_H)
+# define _XOS_INCLUDED_TIME_H
+#endif
+
+
+/***** <grp.h> wrappers *****/
+
+/*
+ * Effective prototypes for <grp.h> wrappers:
+ *
+ * NOTE: On systems lacking appropriate _r functions Getgrgid() and
+ * Getgrnam() do NOT copy the list of group members!
+ *
+ * Remember that fgetgrent(), setgrent(), getgrent(), and endgrent()
+ * are not included in POSIX.
+ *
+ * #define X_INCLUDE_GRP_H
+ * #define XOS_USE_..._LOCKING
+ * #include <X11/Xos_r.h>
+ *
+ * typedef ... _Xgetgrparams;
+ *
+ * struct group *_XGetgrgid(gid_t, _Xgetgrparams);
+ * struct group *_XGetgrnam(const char *, _Xgetgrparams);
+ */
+
+#if defined(X_INCLUDE_GRP_H) && !defined(_XOS_INCLUDED_GRP_H)
+# include <grp.h>
+# if defined(XUSE_MTSAFE_API) || defined(XUSE_MTSAFE_GRPAPI)
+# define XOS_USE_MTSAFE_GRPAPI 1
+# endif
+#endif
+
+#if !defined(X_INCLUDE_GRP_H) || defined(_XOS_INCLUDED_GRP_H)
+/* Do nothing. */
+
+#elif !defined(XTHREADS) && !defined(X_FORCE_USE_MTSAFE_API)
+/* Use regular, unsafe API. */
+typedef int _Xgetgrparams; /* dummy */
+#define _XGetgrgid(g,p) getgrgid((g))
+#define _XGetgrnam(n,p) getgrnam((n))
+
+#elif !defined(XOS_USE_MTSAFE_GRPAPI) || defined(XNO_MTSAFE_GRPAPI)
+/* Systems with thread support but no _r API. UnixWare 2.0. */
+typedef struct {
+ struct group grp;
+ char buf[X_LINE_MAX]; /* Should be sysconf(_SC_GETGR_R_SIZE_MAX)? */
+ struct group *pgrp;
+ size_t len;
+} _Xgetgrparams;
+#ifdef SVR4
+/* Copy the gr_passwd field too. */
+# define _Xgrp_copyGroup(p) \
+ ( memcpy(&(p).grp, (p).pgrp, sizeof(struct group)), \
+ ((p).grp.gr_name = (p).buf), \
+ ((p).len = strlen((p).pgrp->gr_name)), \
+ strcpy((p).grp.gr_name, (p).pgrp->gr_name), \
+ ((p).grp.gr_passwd = (p).grp.gr_name + (p).len + 1), \
+ ((p).pgrp = &(p).grp), \
+ 0 )
+#else
+# define _Xgrp_copyGroup(p) \
+ ( memcpy(&(p).grp, (p).pgrp, sizeof(struct group)), \
+ ((p).grp.gr_name = (p).buf), \
+ strcpy((p).grp.gr_name, (p).pgrp->gr_name), \
+ ((p).pgrp = &(p).grp), \
+ 0 )
+#endif
+#define _XGetgrgid(g,p) \
+ ( (_Xos_processLock), \
+ (((p).pgrp = getgrgid((g))) ? _Xgrp_copyGroup(p) : 0), \
+ (_Xos_processUnlock), \
+ (p).pgrp )
+#define _XGetgrnam(n,p) \
+ ( (_Xos_processLock), \
+ (((p).pgrp = getgrnam((n))) ? _Xgrp_copyGroup(p) : 0), \
+ (_Xos_processUnlock), \
+ (p).pgrp )
+
+#elif !defined(_POSIX_THREAD_SAFE_FUNCTIONS) && (defined(sun) || defined(__osf__))
+/* Non-POSIX API. Solaris, DEC v3.2.
+ *
+ * extern struct group *getgrgid_r(gid_t, struct group *, char *, int);
+ * extern struct group *getgrnam_r(const char *, struct group *, char *, int);
+ */
+typedef struct {
+ struct group grp;
+ char buf[X_LINE_MAX]; /* Should be sysconf(_SC_GETGR_R_SIZE_MAX)? */
+} _Xgetgrparams;
+#define _XGetgrgid(g,p) getgrgid_r((g), &(p).grp, (p).buf, sizeof((p).buf))
+#define _XGetgrnam(n,p) getgrnam_r((n), &(p).grp, (p).buf, sizeof((p).buf))
+
+#elif !defined(_POSIX_THREAD_SAFE_FUNCTIONS)
+/* Non-POSIX API. HP/UX 10, AIX 4.
+ *
+ * extern int getgrgid_r(gid_t, struct group *, char *, int);
+ * extern int getgrnam_r(const char *, struct group *, char *, int);
+ */
+typedef struct {
+ struct group grp;
+ char buf[X_LINE_MAX]; /* Should be sysconf(_SC_GETGR_R_SIZE_MAX)? */
+} _Xgetgrparams;
+#define _XGetgrgid(g,p) \
+ ((getgrgid_r((g), &(p).grp, (p).buf, sizeof((p).buf)) ? NULL : &(p).grp))
+#define _XGetgrnam(n,p) \
+ ((getgrnam_r((n), &(p).grp, (p).buf, sizeof((p).buf)) ? NULL : &(p).grp))
+
+#else
+/* POSIX final API. DEC v4.0, IRIX 6.2.
+ *
+ * int getgrgid_r(gid_t, struct group *, char *, size_t, struct group **);
+ * int getgrnam_r(const char *, struct group *, char *, size_t, struct group **);
+ */
+# if defined(__osf__)
+/* OSF/1 V4.0 <grp.h> doesn't declare the _P routines, breaking under C++. */
+extern int _Pgetgrgid_r(gid_t, struct group *, char *, size_t, struct group **);
+extern int _Pgetgrnam_r(const char *, struct group *, char *, size_t, struct group **);
+# endif
+typedef struct {
+ struct group grp;
+ char buf[X_LINE_MAX]; /* Should be sysconf(_SC_GETGR_R_SIZE_MAX)? */
+ struct group *result;
+} _Xgetgrparams;
+
+#define _XGetgrgid(g,p) \
+ ((getgrgid_r((g), &(p).grp, (p).buf, sizeof((p).buf), &(p).result) ? \
+ NULL : (p).result))
+#define _XGetgrnam(n,p) \
+ ((getgrnam_r((n), &(p).grp, (p).buf, sizeof((p).buf), &(p).result) ? \
+ NULL : (p).result))
+#endif
+
+#if defined(X_INCLUDE_GRP_H) && !defined(_XOS_INCLUDED_GRP_H)
+# define _XOS_INCLUDED_GRP_H
+#endif
+
+
+#ifdef __cplusplus
+} /* Close scope of 'extern "C"' declaration which encloses file. */
+#endif
diff --git a/sysroot/usr/include/X11/Xosdefs.h b/sysroot/usr/include/X11/Xosdefs.h
new file mode 100644
index 0000000..075d798
--- /dev/null
+++ b/sysroot/usr/include/X11/Xosdefs.h
@@ -0,0 +1,166 @@
+/*
+ * O/S-dependent (mis)feature macro definitions
+ *
+ * $XdotOrg: xc/include/Xosdefs.h,v 1.3 2005/04/28 22:04:12 alanc Exp $
+ * $Xorg: Xosdefs.h,v 1.5 2001/02/09 02:03:23 xorgcvs Exp $
+ *
+Copyright 1991, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+ */
+/* $XFree86: xc/include/Xosdefs.h,v 3.20 2002/05/31 18:45:39 dawes Exp $ */
+
+#ifndef _XOSDEFS_H_
+#define _XOSDEFS_H_
+
+/*
+ * X_NOT_STDC_ENV means does not have ANSI C header files. Lack of this
+ * symbol does NOT mean that the system has stdarg.h.
+ *
+ * X_NOT_POSIX means does not have POSIX header files. Lack of this
+ * symbol does NOT mean that the POSIX environment is the default.
+ * You may still have to define _POSIX_SOURCE to get it.
+ */
+
+#ifdef NOSTDHDRS
+#define X_NOT_POSIX
+#define X_NOT_STDC_ENV
+#endif
+
+#ifdef sony
+#if !defined(SYSTYPE_SYSV) && !defined(_SYSTYPE_SYSV)
+#define X_NOT_POSIX
+#endif
+#endif
+
+#ifdef UTEK
+#define X_NOT_POSIX
+#define X_NOT_STDC_ENV
+#endif
+
+#ifdef vax
+#ifndef ultrix /* assume vanilla BSD */
+#define X_NOT_POSIX
+#define X_NOT_STDC_ENV
+#endif
+#endif
+
+#ifdef luna
+#define X_NOT_POSIX
+#define X_NOT_STDC_ENV
+#endif
+
+#ifdef Mips
+#define X_NOT_POSIX
+#define X_NOT_STDC_ENV
+#endif
+
+#ifdef USL
+#ifdef SYSV /* (release 3.2) */
+#define X_NOT_POSIX
+#define X_NOT_STDC_ENV
+#endif
+#endif
+
+#ifdef _SCO_DS
+#ifndef __SCO__
+#define __SCO__
+#endif
+#endif
+
+#ifdef i386
+#ifdef SYSV
+#if !defined(ISC) && !defined(__SCO__) && !defined(_SEQUENT_) && \
+ !defined(__UNIXWARE__) && !defined(sun)
+#if !defined(_POSIX_SOURCE)
+#define X_NOT_POSIX
+#endif
+#define X_NOT_STDC_ENV
+#endif
+#endif
+#endif
+
+#ifdef MOTOROLA
+#ifdef SYSV
+#define X_NOT_STDC_ENV
+#endif
+#endif
+
+#ifdef sun
+/* Imake configs define SVR4 on Solaris, but cc & gcc only define __SVR4
+ * This check allows non-Imake configured programs to build correctly.
+ */
+#if defined(__SVR4) && !defined(SVR4)
+#define SVR4 1
+#endif
+#ifdef SVR4
+/* define this to whatever it needs to be */
+#define X_POSIX_C_SOURCE 199300L
+#endif
+#endif
+
+#ifdef WIN32
+#ifndef _POSIX_
+#define X_NOT_POSIX
+#endif
+#endif
+
+#if defined(nec_ews_svr2) || defined(SX) || defined(PC_UX)
+#define X_NOT_POSIX
+#define X_NOT_STDC_ENV
+#endif
+
+#ifdef __UNIXOS2__
+#define USGISH
+#define NULL_NOT_ZERO
+#endif
+
+#ifdef __DARWIN__
+#define NULL_NOT_ZERO
+#endif
+
+#ifdef __GNU__
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 4096
+#endif
+#endif
+
+#if defined(__SCO__) || defined(__UNIXWARE__)
+# ifndef PATH_MAX
+# define PATH_MAX 1024
+# endif
+# ifndef MAXPATHLEN
+# define MAXPATHLEN 1024
+# endif
+#endif
+
+#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) \
+ || defined(__Darwin__) || defined(__DragonFly__)
+# ifndef CSRG_BASED
+# define CSRG_BASED
+# endif
+#endif
+
+#endif /* _XOSDEFS_H_ */
+
diff --git a/sysroot/usr/include/X11/Xpoll.h b/sysroot/usr/include/X11/Xpoll.h
new file mode 100644
index 0000000..e483c21
--- /dev/null
+++ b/sysroot/usr/include/X11/Xpoll.h
@@ -0,0 +1,255 @@
+/* $Xorg: Xpoll.h,v 1.4 2001/02/09 02:03:23 xorgcvs Exp $ */
+
+/*
+
+Copyright 1994, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from The Open Group.
+
+*/
+
+/*
+ * Copyright © 2005 Daniel Stone
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of Daniel Stone not be used in advertising
+ * or publicity pertaining to distribution of the software without specific,
+ * written prior permission. Daniel Stone makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * DANIEL STONE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * DANIEL STONE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
+ * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+*/
+
+/* $XFree86: xc/include/Xpoll.h,v 3.8 2001/01/17 17:53:11 dawes Exp $ */
+
+#ifndef _XPOLL_H_
+#define _XPOLL_H_
+
+#ifndef WIN32
+
+#ifndef USE_POLL
+
+#include <X11/Xos.h>
+
+/* Below is the monster branch from hell. Basically, most systems will drop to
+ * 'the branch below is the fallthrough for halfway modern systems', and include
+ * <sys/select.h>, so we get the FD_* macros. */
+#if !defined(DGUX)
+# if (defined(SVR4) || defined(CRAY) || defined(AIXV3)) && !defined(FD_SETSIZE)
+# include <sys/select.h>
+# ifdef luna
+# include <sysent.h>
+# endif
+# else /* not SVR4/CRAY/AIXv3 */
+# if defined(AIXV4) /* AIX 4.2 fubar-ed <sys/select.h>, so try really hard. */
+# if !defined(NFDBITS)
+# include <sys/select.h>
+# endif
+# else /* the branch below is the fallthrough for halfway modern systems */
+# ifdef __QNX__ /* Make sure we get 256 bit select masks */
+# define FD_SETSIZE 256
+# endif
+# include <sys/select.h>
+# endif
+# endif
+#else /* DGUX -- No sys/select in Intel DG/ux */
+# include <sys/time.h>
+# include <sys/types.h>
+# include <unistd.h>
+#endif
+
+#include <X11/Xmd.h>
+
+#ifdef CSRG_BASED
+#include <sys/param.h>
+# if BSD < 199103
+typedef long fd_mask;
+# endif
+#endif
+
+#define XFD_SETSIZE 256
+
+#ifndef FD_SETSIZE
+#define FD_SETSIZE XFD_SETSIZE
+#endif
+
+#ifndef NBBY
+#define NBBY 8 /* number of bits in a byte */
+#endif
+
+#ifndef NFDBITS
+#define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */
+#endif
+
+#ifndef howmany
+#define howmany(x,y) (((x)+((y)-1))/(y))
+#endif
+
+#if defined(BSD) && BSD < 198911 && !defined(luna)
+typedef struct fd_set {
+ fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
+} fd_set;
+#endif
+
+#ifndef hpux /* and perhaps old BSD ??? */
+# define Select(n,r,w,e,t) select(n,(fd_set*)r,(fd_set*)w,(fd_set*)e,(struct timeval*)t)
+#else
+# ifndef _XPG4_EXTENDED /* HPUX 9.x and earlier */
+# define Select(n,r,w,e,t) select(n,(int*)r,(int*)w,(int*)e,(struct timeval*)t)
+# else
+# define Select(n,r,w,e,t) select(n,(fd_set*)r,(fd_set*)w,(fd_set*)e,(struct timeval*)t)
+# endif
+#endif
+
+#define __X_FDS_BITS __fds_bits
+
+#ifndef __FDS_BITS
+# define __FDS_BITS(p) ((p)->__X_FDS_BITS)
+#endif
+
+#define __XFDS_BITS(p, n) (__FDS_BITS(p))[n]
+
+#ifndef FD_SET
+#define FD_SET(n, p) (__XFDS_BITS(p, ((n)/NFDBITS)) |= ((fd_mask)1 << ((n) % NFDBITS)))
+#endif
+#ifndef FD_CLR
+#define FD_CLR(n, p) (__XFDS_BITS((p), ((n)/NFDBITS)) &= ~((fd_mask)1 << ((n) % NFDBITS)))
+#endif
+#ifndef FD_ISSET
+#define FD_ISSET(n, p) ((__XFDS_BITS((p), ((n)/NFDBITS))) & ((fd_mask)1 << ((n) % NFDBITS)))
+#endif
+#ifndef FD_ZERO
+#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p)))
+#endif
+
+/*
+ * The howmany(FD_SETSIZE, NFDBITS) computes the number of elements in the
+ * array. before accessing an element in the array we check it exists.
+ * If it does not exist then the compiler discards the code to access it.
+ */
+#define XFD_ANYSET(p) \
+ ((howmany(FD_SETSIZE, NFDBITS) > 0 && (__XFDS_BITS(p, 0))) || \
+ (howmany(FD_SETSIZE, NFDBITS) > 1 && (__XFDS_BITS(p, 1))) || \
+ (howmany(FD_SETSIZE, NFDBITS) > 2 && (__XFDS_BITS(p, 2))) || \
+ (howmany(FD_SETSIZE, NFDBITS) > 3 && (__XFDS_BITS(p, 3))) || \
+ (howmany(FD_SETSIZE, NFDBITS) > 4 && (__XFDS_BITS(p, 4))) || \
+ (howmany(FD_SETSIZE, NFDBITS) > 5 && (__XFDS_BITS(p, 5))) || \
+ (howmany(FD_SETSIZE, NFDBITS) > 6 && (__XFDS_BITS(p, 6))) || \
+ (howmany(FD_SETSIZE, NFDBITS) > 7 && (__XFDS_BITS(p, 7))))
+
+#define XFD_COPYSET(src,dst) { \
+ int __i__; \
+ for (__i__ = 0; __i__ < howmany(FD_SETSIZE, NFDBITS); __i__++) \
+ __XFDS_BITS((dst), __i__) = __XFDS_BITS((src), __i__); \
+ }
+#define XFD_ANDSET(dst,b1,b2) { \
+ int __i__; \
+ for (__i__ = 0; __i__ < howmany(FD_SETSIZE, NFDBITS); __i__++) \
+ __XFDS_BITS((dst), __i__) = ((__XFDS_BITS((b1), __i__)) & (__XFDS_BITS((b2), __i__))); \
+ }
+#define XFD_ORSET(dst,b1,b2) { \
+ int __i__; \
+ for (__i__ = 0; __i__ < howmany(FD_SETSIZE, NFDBITS); __i__++) \
+ __XFDS_BITS((dst), __i__) = ((__XFDS_BITS((b1), __i__)) | (__XFDS_BITS((b2), __i__))); \
+ }
+#define XFD_UNSET(dst,b1) { \
+ int __i__; \
+ for (__i__ = 0; __i__ < howmany(FD_SETSIZE, NFDBITS); __i__++) \
+ __XFDS_BITS((dst), __i__) &= ~(__XFDS_BITS((b1), __i__)); \
+ }
+
+#else /* USE_POLL */
+#include <sys/poll.h>
+#endif /* USE_POLL */
+
+#else /* WIN32 */
+
+#define XFD_SETSIZE 256
+#ifndef FD_SETSIZE
+#define FD_SETSIZE XFD_SETSIZE
+#endif
+#include <X11/Xwinsock.h>
+
+#define Select(n,r,w,e,t) select(0,(fd_set*)r,(fd_set*)w,(fd_set*)e,(struct timeval*)t)
+
+#define XFD_SETCOUNT(p) (((fd_set FAR *)(p))->fd_count)
+#define XFD_FD(p,i) (((fd_set FAR *)(p))->fd_array[i])
+#define XFD_ANYSET(p) XFD_SETCOUNT(p)
+
+#define XFD_COPYSET(src,dst) { \
+ u_int __i; \
+ FD_ZERO(dst); \
+ for (__i = 0; __i < XFD_SETCOUNT(src) ; __i++) { \
+ XFD_FD(dst,__i) = XFD_FD(src,__i); \
+ } \
+ XFD_SETCOUNT(dst) = XFD_SETCOUNT(src); \
+}
+
+#define XFD_ANDSET(dst,b1,b2) { \
+ u_int __i; \
+ FD_ZERO(dst); \
+ for (__i = 0; __i < XFD_SETCOUNT(b1) ; __i++) { \
+ if (FD_ISSET(XFD_FD(b1,__i), b2)) \
+ FD_SET(XFD_FD(b1,__i), dst); \
+ } \
+}
+
+#define XFD_ORSET(dst,b1,b2) { \
+ u_int __i; \
+ if (dst != b1) XFD_COPYSET(b1,dst); \
+ for (__i = 0; __i < XFD_SETCOUNT(b2) ; __i++) { \
+ if (!FD_ISSET(XFD_FD(b2,__i), dst)) \
+ FD_SET(XFD_FD(b2,__i), dst); \
+ } \
+}
+
+/* this one is really sub-optimal */
+#define XFD_UNSET(dst,b1) { \
+ u_int __i; \
+ for (__i = 0; __i < XFD_SETCOUNT(b1) ; __i++) { \
+ FD_CLR(XFD_FD(b1,__i), dst); \
+ } \
+}
+
+/* we have to pay the price of having an array here, unlike with bitmasks
+ calling twice FD_SET with the same fd is not transparent, so be careful */
+#undef FD_SET
+#define FD_SET(fd,set) do { \
+ if (XFD_SETCOUNT(set) < FD_SETSIZE && !FD_ISSET(fd,set)) \
+ XFD_FD(set,XFD_SETCOUNT(set)++)=(fd); \
+} while(0)
+
+#define getdtablesize() FD_SETSIZE
+
+#endif /* WIN32 */
+
+#endif /* _XPOLL_H_ */
diff --git a/sysroot/usr/include/X11/Xproto.h b/sysroot/usr/include/X11/Xproto.h
new file mode 100644
index 0000000..e5bba70
--- /dev/null
+++ b/sysroot/usr/include/X11/Xproto.h
@@ -0,0 +1,2129 @@
+/*
+ * $Xorg: Xproto.h,v 1.4 2001/02/09 02:03:23 xorgcvs Exp $
+ */
+
+/* Definitions for the X window system used by server and c bindings */
+
+/*
+ * This packet-construction scheme makes the following assumptions:
+ *
+ * 1. The compiler is able
+ * to generate code which addresses one- and two-byte quantities.
+ * In the worst case, this would be done with bit-fields. If bit-fields
+ * are used it may be necessary to reorder the request fields in this file,
+ * depending on the order in which the machine assigns bit fields to
+ * machine words. There may also be a problem with sign extension,
+ * as K+R specify that bitfields are always unsigned.
+ *
+ * 2. 2- and 4-byte fields in packet structures must be ordered by hand
+ * such that they are naturally-aligned, so that no compiler will ever
+ * insert padding bytes.
+ *
+ * 3. All packets are hand-padded to a multiple of 4 bytes, for
+ * the same reason.
+ */
+
+#ifndef XPROTO_H
+#define XPROTO_H
+
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************/
+
+#include <X11/Xmd.h>
+#include <X11/Xprotostr.h>
+
+/*
+ * Define constants for the sizes of the network packets. The sz_ prefix is
+ * used instead of something more descriptive so that the symbols are no more
+ * than 32 characters in length (which causes problems for some compilers).
+ */
+#define sz_xSegment 8
+#define sz_xPoint 4
+#define sz_xRectangle 8
+#define sz_xArc 12
+#define sz_xConnClientPrefix 12
+#define sz_xConnSetupPrefix 8
+#define sz_xConnSetup 32
+#define sz_xPixmapFormat 8
+#define sz_xDepth 8
+#define sz_xVisualType 24
+#define sz_xWindowRoot 40
+#define sz_xTimecoord 8
+#define sz_xHostEntry 4
+#define sz_xCharInfo 12
+#define sz_xFontProp 8
+#define sz_xTextElt 2
+#define sz_xColorItem 12
+#define sz_xrgb 8
+#define sz_xGenericReply 32
+#define sz_xGetWindowAttributesReply 44
+#define sz_xGetGeometryReply 32
+#define sz_xQueryTreeReply 32
+#define sz_xInternAtomReply 32
+#define sz_xGetAtomNameReply 32
+#define sz_xGetPropertyReply 32
+#define sz_xListPropertiesReply 32
+#define sz_xGetSelectionOwnerReply 32
+#define sz_xGrabPointerReply 32
+#define sz_xQueryPointerReply 32
+#define sz_xGetMotionEventsReply 32
+#define sz_xTranslateCoordsReply 32
+#define sz_xGetInputFocusReply 32
+#define sz_xQueryKeymapReply 40
+#define sz_xQueryFontReply 60
+#define sz_xQueryTextExtentsReply 32
+#define sz_xListFontsReply 32
+#define sz_xGetFontPathReply 32
+#define sz_xGetImageReply 32
+#define sz_xListInstalledColormapsReply 32
+#define sz_xAllocColorReply 32
+#define sz_xAllocNamedColorReply 32
+#define sz_xAllocColorCellsReply 32
+#define sz_xAllocColorPlanesReply 32
+#define sz_xQueryColorsReply 32
+#define sz_xLookupColorReply 32
+#define sz_xQueryBestSizeReply 32
+#define sz_xQueryExtensionReply 32
+#define sz_xListExtensionsReply 32
+#define sz_xSetMappingReply 32
+#define sz_xGetKeyboardControlReply 52
+#define sz_xGetPointerControlReply 32
+#define sz_xGetScreenSaverReply 32
+#define sz_xListHostsReply 32
+#define sz_xSetModifierMappingReply 32
+#define sz_xError 32
+#define sz_xEvent 32
+#define sz_xKeymapEvent 32
+#define sz_xReq 4
+#define sz_xResourceReq 8
+#define sz_xCreateWindowReq 32
+#define sz_xChangeWindowAttributesReq 12
+#define sz_xChangeSaveSetReq 8
+#define sz_xReparentWindowReq 16
+#define sz_xConfigureWindowReq 12
+#define sz_xCirculateWindowReq 8
+#define sz_xInternAtomReq 8
+#define sz_xChangePropertyReq 24
+#define sz_xDeletePropertyReq 12
+#define sz_xGetPropertyReq 24
+#define sz_xSetSelectionOwnerReq 16
+#define sz_xConvertSelectionReq 24
+#define sz_xSendEventReq 44
+#define sz_xGrabPointerReq 24
+#define sz_xGrabButtonReq 24
+#define sz_xUngrabButtonReq 12
+#define sz_xChangeActivePointerGrabReq 16
+#define sz_xGrabKeyboardReq 16
+#define sz_xGrabKeyReq 16
+#define sz_xUngrabKeyReq 12
+#define sz_xAllowEventsReq 8
+#define sz_xGetMotionEventsReq 16
+#define sz_xTranslateCoordsReq 16
+#define sz_xWarpPointerReq 24
+#define sz_xSetInputFocusReq 12
+#define sz_xOpenFontReq 12
+#define sz_xQueryTextExtentsReq 8
+#define sz_xListFontsReq 8
+#define sz_xSetFontPathReq 8
+#define sz_xCreatePixmapReq 16
+#define sz_xCreateGCReq 16
+#define sz_xChangeGCReq 12
+#define sz_xCopyGCReq 16
+#define sz_xSetDashesReq 12
+#define sz_xSetClipRectanglesReq 12
+#define sz_xCopyAreaReq 28
+#define sz_xCopyPlaneReq 32
+#define sz_xPolyPointReq 12
+#define sz_xPolySegmentReq 12
+#define sz_xFillPolyReq 16
+#define sz_xPutImageReq 24
+#define sz_xGetImageReq 20
+#define sz_xPolyTextReq 16
+#define sz_xImageTextReq 16
+#define sz_xCreateColormapReq 16
+#define sz_xCopyColormapAndFreeReq 12
+#define sz_xAllocColorReq 16
+#define sz_xAllocNamedColorReq 12
+#define sz_xAllocColorCellsReq 12
+#define sz_xAllocColorPlanesReq 16
+#define sz_xFreeColorsReq 12
+#define sz_xStoreColorsReq 8
+#define sz_xStoreNamedColorReq 16
+#define sz_xQueryColorsReq 8
+#define sz_xLookupColorReq 12
+#define sz_xCreateCursorReq 32
+#define sz_xCreateGlyphCursorReq 32
+#define sz_xRecolorCursorReq 20
+#define sz_xQueryBestSizeReq 12
+#define sz_xQueryExtensionReq 8
+#define sz_xChangeKeyboardControlReq 8
+#define sz_xBellReq 4
+#define sz_xChangePointerControlReq 12
+#define sz_xSetScreenSaverReq 12
+#define sz_xChangeHostsReq 8
+#define sz_xListHostsReq 4
+#define sz_xChangeModeReq 4
+#define sz_xRotatePropertiesReq 12
+#define sz_xReply 32
+#define sz_xGrabKeyboardReply 32
+#define sz_xListFontsWithInfoReply 60
+#define sz_xSetPointerMappingReply 32
+#define sz_xGetKeyboardMappingReply 32
+#define sz_xGetPointerMappingReply 32
+#define sz_xGetModifierMappingReply 32
+#define sz_xListFontsWithInfoReq 8
+#define sz_xPolyLineReq 12
+#define sz_xPolyArcReq 12
+#define sz_xPolyRectangleReq 12
+#define sz_xPolyFillRectangleReq 12
+#define sz_xPolyFillArcReq 12
+#define sz_xPolyText8Req 16
+#define sz_xPolyText16Req 16
+#define sz_xImageText8Req 16
+#define sz_xImageText16Req 16
+#define sz_xSetPointerMappingReq 4
+#define sz_xForceScreenSaverReq 4
+#define sz_xSetCloseDownModeReq 4
+#define sz_xClearAreaReq 16
+#define sz_xSetAccessControlReq 4
+#define sz_xGetKeyboardMappingReq 8
+#define sz_xSetModifierMappingReq 4
+#define sz_xPropIconSize 24
+#define sz_xChangeKeyboardMappingReq 8
+
+
+/* For the purpose of the structure definitions in this file,
+we must redefine the following types in terms of Xmd.h's types, which may
+include bit fields. All of these are #undef'd at the end of this file,
+restoring the definitions in X.h. */
+
+#define Window CARD32
+#define Drawable CARD32
+#define Font CARD32
+#define Pixmap CARD32
+#define Cursor CARD32
+#define Colormap CARD32
+#define GContext CARD32
+#define Atom CARD32
+#define VisualID CARD32
+#define Time CARD32
+#define KeyCode CARD8
+#define KeySym CARD32
+
+#define X_TCP_PORT 6000 /* add display number */
+
+#define xTrue 1
+#define xFalse 0
+
+
+typedef CARD16 KeyButMask;
+
+/*****************
+ connection setup structure. This is followed by
+ numRoots xWindowRoot structs.
+*****************/
+
+typedef struct {
+ CARD8 byteOrder;
+ BYTE pad;
+ CARD16 majorVersion B16, minorVersion B16;
+ CARD16 nbytesAuthProto B16; /* Authorization protocol */
+ CARD16 nbytesAuthString B16; /* Authorization string */
+ CARD16 pad2 B16;
+} xConnClientPrefix;
+
+typedef struct {
+ CARD8 success;
+ BYTE lengthReason; /*num bytes in string following if failure */
+ CARD16 majorVersion B16,
+ minorVersion B16;
+ CARD16 length B16; /* 1/4 additional bytes in setup info */
+} xConnSetupPrefix;
+
+
+typedef struct {
+ CARD32 release B32;
+ CARD32 ridBase B32,
+ ridMask B32;
+ CARD32 motionBufferSize B32;
+ CARD16 nbytesVendor B16; /* number of bytes in vendor string */
+ CARD16 maxRequestSize B16;
+ CARD8 numRoots; /* number of roots structs to follow */
+ CARD8 numFormats; /* number of pixmap formats */
+ CARD8 imageByteOrder; /* LSBFirst, MSBFirst */
+ CARD8 bitmapBitOrder; /* LeastSignificant, MostSign...*/
+ CARD8 bitmapScanlineUnit, /* 8, 16, 32 */
+ bitmapScanlinePad; /* 8, 16, 32 */
+ KeyCode minKeyCode, maxKeyCode;
+ CARD32 pad2 B32;
+} xConnSetup;
+
+typedef struct {
+ CARD8 depth;
+ CARD8 bitsPerPixel;
+ CARD8 scanLinePad;
+ CARD8 pad1;
+ CARD32 pad2 B32;
+} xPixmapFormat;
+
+/* window root */
+
+typedef struct {
+ CARD8 depth;
+ CARD8 pad1;
+ CARD16 nVisuals B16; /* number of xVisualType structures following */
+ CARD32 pad2 B32;
+ } xDepth;
+
+typedef struct {
+ VisualID visualID B32;
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class;
+#else
+ CARD8 class;
+#endif
+ CARD8 bitsPerRGB;
+ CARD16 colormapEntries B16;
+ CARD32 redMask B32, greenMask B32, blueMask B32;
+ CARD32 pad B32;
+ } xVisualType;
+
+typedef struct {
+ Window windowId B32;
+ Colormap defaultColormap B32;
+ CARD32 whitePixel B32, blackPixel B32;
+ CARD32 currentInputMask B32;
+ CARD16 pixWidth B16, pixHeight B16;
+ CARD16 mmWidth B16, mmHeight B16;
+ CARD16 minInstalledMaps B16, maxInstalledMaps B16;
+ VisualID rootVisualID B32;
+ CARD8 backingStore;
+ BOOL saveUnders;
+ CARD8 rootDepth;
+ CARD8 nDepths; /* number of xDepth structures following */
+} xWindowRoot;
+
+
+/*****************************************************************
+ * Structure Defns
+ * Structures needed for replies
+ *****************************************************************/
+
+/* Used in GetMotionEvents */
+
+typedef struct {
+ CARD32 time B32;
+ INT16 x B16, y B16;
+} xTimecoord;
+
+typedef struct {
+ CARD8 family;
+ BYTE pad;
+ CARD16 length B16;
+} xHostEntry;
+
+typedef struct {
+ INT16 leftSideBearing B16,
+ rightSideBearing B16,
+ characterWidth B16,
+ ascent B16,
+ descent B16;
+ CARD16 attributes B16;
+} xCharInfo;
+
+typedef struct {
+ Atom name B32;
+ CARD32 value B32;
+} xFontProp;
+
+/*
+ * non-aligned big-endian font ID follows this struct
+ */
+typedef struct { /* followed by string */
+ CARD8 len; /* number of *characters* in string, or FontChange (255)
+ for font change, or 0 if just delta given */
+ INT8 delta;
+} xTextElt;
+
+
+typedef struct {
+ CARD32 pixel B32;
+ CARD16 red B16, green B16, blue B16;
+ CARD8 flags; /* DoRed, DoGreen, DoBlue booleans */
+ CARD8 pad;
+} xColorItem;
+
+
+typedef struct {
+ CARD16 red B16, green B16, blue B16, pad B16;
+} xrgb;
+
+typedef CARD8 KEYCODE;
+
+
+/*****************
+ * XRep:
+ * meant to be 32 byte quantity
+ *****************/
+
+/* GenericReply is the common format of all replies. The "data" items
+ are specific to each individual reply type. */
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE data1; /* depends on reply type */
+ CARD16 sequenceNumber B16; /* of last request received by server */
+ CARD32 length B32; /* 4 byte quantities beyond size of GenericReply */
+ CARD32 data00 B32;
+ CARD32 data01 B32;
+ CARD32 data02 B32;
+ CARD32 data03 B32;
+ CARD32 data04 B32;
+ CARD32 data05 B32;
+ } xGenericReply;
+
+/* Individual reply formats. */
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 backingStore;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* NOT 0; this is an extra-large reply */
+ VisualID visualID B32;
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD16 c_class B16;
+#else
+ CARD16 class B16;
+#endif
+ CARD8 bitGravity;
+ CARD8 winGravity;
+ CARD32 backingBitPlanes B32;
+ CARD32 backingPixel B32;
+ BOOL saveUnder;
+ BOOL mapInstalled;
+ CARD8 mapState;
+ BOOL override;
+ Colormap colormap B32;
+ CARD32 allEventMasks B32;
+ CARD32 yourEventMask B32;
+ CARD16 doNotPropagateMask B16;
+ CARD16 pad B16;
+ } xGetWindowAttributesReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 depth;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ Window root B32;
+ INT16 x B16, y B16;
+ CARD16 width B16, height B16;
+ CARD16 borderWidth B16;
+ CARD16 pad1 B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ } xGetGeometryReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ Window root B32, parent B32;
+ CARD16 nChildren B16;
+ CARD16 pad2 B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ } xQueryTreeReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ Atom atom B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ } xInternAtomReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* of additional bytes */
+ CARD16 nameLength B16; /* # of characters in name */
+ CARD16 pad2 B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+ } xGetAtomNameReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 format;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* of additional bytes */
+ Atom propertyType B32;
+ CARD32 bytesAfter B32;
+ CARD32 nItems B32; /* # of 8, 16, or 32-bit entities in reply */
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ } xGetPropertyReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 nProperties B16;
+ CARD16 pad2 B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+ } xListPropertiesReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ Window owner B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ } xGetSelectionOwnerReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE status;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ } xGrabPointerReply;
+
+typedef xGrabPointerReply xGrabKeyboardReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BOOL sameScreen;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ Window root B32, child B32;
+ INT16 rootX B16, rootY B16, winX B16, winY B16;
+ CARD16 mask B16;
+ CARD16 pad1 B16;
+ CARD32 pad B32;
+ } xQueryPointerReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 nEvents B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ } xGetMotionEventsReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BOOL sameScreen;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ Window child B32;
+ INT16 dstX B16, dstY B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ } xTranslateCoordsReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 revertTo;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ Window focus B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ } xGetInputFocusReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 2, NOT 0; this is an extra-large reply */
+ BYTE map[32];
+ } xQueryKeymapReply;
+
+/* Warning: this MUST match (up to component renaming) xListFontsWithInfoReply */
+typedef struct _xQueryFontReply {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* definitely > 0, even if "nCharInfos" is 0 */
+ xCharInfo minBounds;
+#ifndef WORD64
+ CARD32 walign1 B32;
+#endif
+ xCharInfo maxBounds;
+#ifndef WORD64
+ CARD32 walign2 B32;
+#endif
+ CARD16 minCharOrByte2 B16, maxCharOrByte2 B16;
+ CARD16 defaultChar B16;
+ CARD16 nFontProps B16; /* followed by this many xFontProp structures */
+ CARD8 drawDirection;
+ CARD8 minByte1, maxByte1;
+ BOOL allCharsExist;
+ INT16 fontAscent B16, fontDescent B16;
+ CARD32 nCharInfos B32; /* followed by this many xCharInfo structures */
+} xQueryFontReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 drawDirection;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ INT16 fontAscent B16, fontDescent B16;
+ INT16 overallAscent B16, overallDescent B16;
+ INT32 overallWidth B32, overallLeft B32, overallRight B32;
+ CARD32 pad B32;
+ } xQueryTextExtentsReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 nFonts B16;
+ CARD16 pad2 B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+ } xListFontsReply;
+
+/* Warning: this MUST match (up to component renaming) xQueryFontReply */
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 nameLength; /* 0 indicates end-of-reply-sequence */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* definitely > 0, even if "nameLength" is 0 */
+ xCharInfo minBounds;
+#ifndef WORD64
+ CARD32 walign1 B32;
+#endif
+ xCharInfo maxBounds;
+#ifndef WORD64
+ CARD32 walign2 B32;
+#endif
+ CARD16 minCharOrByte2 B16, maxCharOrByte2 B16;
+ CARD16 defaultChar B16;
+ CARD16 nFontProps B16; /* followed by this many xFontProp structures */
+ CARD8 drawDirection;
+ CARD8 minByte1, maxByte1;
+ BOOL allCharsExist;
+ INT16 fontAscent B16, fontDescent B16;
+ CARD32 nReplies B32; /* hint as to how many more replies might be coming */
+} xListFontsWithInfoReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 nPaths B16;
+ CARD16 pad2 B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+ } xGetFontPathReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 depth;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ VisualID visual B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+ } xGetImageReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 nColormaps B16;
+ CARD16 pad2 B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+ } xListInstalledColormapsReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ CARD16 red B16, green B16, blue B16;
+ CARD16 pad2 B16;
+ CARD32 pixel B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ } xAllocColorReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ CARD32 pixel B32;
+ CARD16 exactRed B16, exactGreen B16, exactBlue B16;
+ CARD16 screenRed B16, screenGreen B16, screenBlue B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ } xAllocNamedColorReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 nPixels B16, nMasks B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+ } xAllocColorCellsReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 nPixels B16;
+ CARD16 pad2 B16;
+ CARD32 redMask B32, greenMask B32, blueMask B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ } xAllocColorPlanesReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 nColors B16;
+ CARD16 pad2 B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+ } xQueryColorsReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ CARD16 exactRed B16, exactGreen B16, exactBlue B16;
+ CARD16 screenRed B16, screenGreen B16, screenBlue B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ } xLookupColorReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ CARD16 width B16, height B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+ } xQueryBestSizeReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ BOOL present;
+ CARD8 major_opcode;
+ CARD8 first_event;
+ CARD8 first_error;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+ } xQueryExtensionReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 nExtensions;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+ } xListExtensionsReply;
+
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 success;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+ } xSetMappingReply;
+typedef xSetMappingReply xSetPointerMappingReply;
+typedef xSetMappingReply xSetModifierMappingReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 nElts; /* how many elements does the map have */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+ } xGetPointerMappingReply;
+
+typedef struct {
+ BYTE type;
+ CARD8 keySymsPerKeyCode;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+} xGetKeyboardMappingReply;
+
+typedef struct {
+ BYTE type;
+ CARD8 numKeyPerModifier;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGetModifierMappingReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BOOL globalAutoRepeat;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 5 */
+ CARD32 ledMask B32;
+ CARD8 keyClickPercent, bellPercent;
+ CARD16 bellPitch B16, bellDuration B16;
+ CARD16 pad B16;
+ BYTE map[32]; /* bit masks start here */
+ } xGetKeyboardControlReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ CARD16 accelNumerator B16, accelDenominator B16;
+ CARD16 threshold B16;
+ CARD16 pad2 B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ } xGetPointerControlReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ CARD16 timeout B16, interval B16;
+ BOOL preferBlanking;
+ BOOL allowExposures;
+ CARD16 pad2 B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ } xGetScreenSaverReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BOOL enabled;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 nHosts B16;
+ CARD16 pad1 B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+ } xListHostsReply;
+
+
+
+
+/*****************************************************************
+ * Xerror
+ * All errors are 32 bytes
+ *****************************************************************/
+
+typedef struct {
+ BYTE type; /* X_Error */
+ BYTE errorCode;
+ CARD16 sequenceNumber B16; /* the nth request from this client */
+ CARD32 resourceID B32;
+ CARD16 minorCode B16;
+ CARD8 majorCode;
+ BYTE pad1;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+} xError;
+
+/*****************************************************************
+ * xEvent
+ * All events are 32 bytes
+ *****************************************************************/
+
+typedef struct _xEvent {
+ union {
+ struct {
+ BYTE type;
+ BYTE detail;
+ CARD16 sequenceNumber B16;
+ } u;
+ struct {
+ CARD32 pad00 B32;
+ Time time B32;
+ Window root B32, event B32, child B32;
+ INT16 rootX B16, rootY B16, eventX B16, eventY B16;
+ KeyButMask state B16;
+ BOOL sameScreen;
+ BYTE pad1;
+ } keyButtonPointer;
+ struct {
+ CARD32 pad00 B32;
+ Time time B32;
+ Window root B32, event B32, child B32;
+ INT16 rootX B16, rootY B16, eventX B16, eventY B16;
+ KeyButMask state B16;
+ BYTE mode; /* really XMode */
+ BYTE flags; /* sameScreen and focus booleans, packed together */
+#define ELFlagFocus (1<<0)
+#define ELFlagSameScreen (1<<1)
+ } enterLeave;
+ struct {
+ CARD32 pad00 B32;
+ Window window B32;
+ BYTE mode; /* really XMode */
+ BYTE pad1, pad2, pad3;
+ } focus;
+ struct {
+ CARD32 pad00 B32;
+ Window window B32;
+ CARD16 x B16, y B16, width B16, height B16;
+ CARD16 count B16;
+ CARD16 pad2 B16;
+ } expose;
+ struct {
+ CARD32 pad00 B32;
+ Drawable drawable B32;
+ CARD16 x B16, y B16, width B16, height B16;
+ CARD16 minorEvent B16;
+ CARD16 count B16;
+ BYTE majorEvent;
+ BYTE pad1, pad2, pad3;
+ } graphicsExposure;
+ struct {
+ CARD32 pad00 B32;
+ Drawable drawable B32;
+ CARD16 minorEvent B16;
+ BYTE majorEvent;
+ BYTE bpad;
+ } noExposure;
+ struct {
+ CARD32 pad00 B32;
+ Window window B32;
+ CARD8 state;
+ BYTE pad1, pad2, pad3;
+ } visibility;
+ struct {
+ CARD32 pad00 B32;
+ Window parent B32, window B32;
+ INT16 x B16, y B16;
+ CARD16 width B16, height B16, borderWidth B16;
+ BOOL override;
+ BYTE bpad;
+ } createNotify;
+/*
+ * The event fields in the structures for DestroyNotify, UnmapNotify,
+ * MapNotify, ReparentNotify, ConfigureNotify, CirculateNotify, GravityNotify,
+ * must be at the same offset because server internal code is depending upon
+ * this to patch up the events before they are delivered.
+ * Also note that MapRequest, ConfigureRequest and CirculateRequest have
+ * the same offset for the event window.
+ */
+ struct {
+ CARD32 pad00 B32;
+ Window event B32, window B32;
+ } destroyNotify;
+ struct {
+ CARD32 pad00 B32;
+ Window event B32, window B32;
+ BOOL fromConfigure;
+ BYTE pad1, pad2, pad3;
+ } unmapNotify;
+ struct {
+ CARD32 pad00 B32;
+ Window event B32, window B32;
+ BOOL override;
+ BYTE pad1, pad2, pad3;
+ } mapNotify;
+ struct {
+ CARD32 pad00 B32;
+ Window parent B32, window B32;
+ } mapRequest;
+ struct {
+ CARD32 pad00 B32;
+ Window event B32, window B32, parent B32;
+ INT16 x B16, y B16;
+ BOOL override;
+ BYTE pad1, pad2, pad3;
+ } reparent;
+ struct {
+ CARD32 pad00 B32;
+ Window event B32, window B32, aboveSibling B32;
+ INT16 x B16, y B16;
+ CARD16 width B16, height B16, borderWidth B16;
+ BOOL override;
+ BYTE bpad;
+ } configureNotify;
+ struct {
+ CARD32 pad00 B32;
+ Window parent B32, window B32, sibling B32;
+ INT16 x B16, y B16;
+ CARD16 width B16, height B16, borderWidth B16;
+ CARD16 valueMask B16;
+ CARD32 pad1 B32;
+ } configureRequest;
+ struct {
+ CARD32 pad00 B32;
+ Window event B32, window B32;
+ INT16 x B16, y B16;
+ CARD32 pad1 B32, pad2 B32, pad3 B32, pad4 B32;
+ } gravity;
+ struct {
+ CARD32 pad00 B32;
+ Window window B32;
+ CARD16 width B16, height B16;
+ } resizeRequest;
+ struct {
+/* The event field in the circulate record is really the parent when this
+ is used as a CirculateRequest instead of a CirculateNotify */
+ CARD32 pad00 B32;
+ Window event B32, window B32, parent B32;
+ BYTE place; /* Top or Bottom */
+ BYTE pad1, pad2, pad3;
+ } circulate;
+ struct {
+ CARD32 pad00 B32;
+ Window window B32;
+ Atom atom B32;
+ Time time B32;
+ BYTE state; /* NewValue or Deleted */
+ BYTE pad1;
+ CARD16 pad2 B16;
+ } property;
+ struct {
+ CARD32 pad00 B32;
+ Time time B32;
+ Window window B32;
+ Atom atom B32;
+ } selectionClear;
+ struct {
+ CARD32 pad00 B32;
+ Time time B32;
+ Window owner B32, requestor B32;
+ Atom selection B32, target B32, property B32;
+ } selectionRequest;
+ struct {
+ CARD32 pad00 B32;
+ Time time B32;
+ Window requestor B32;
+ Atom selection B32, target B32, property B32;
+ } selectionNotify;
+ struct {
+ CARD32 pad00 B32;
+ Window window B32;
+ Colormap colormap B32;
+#if defined(__cplusplus) || defined(c_plusplus)
+ BOOL c_new;
+#else
+ BOOL new;
+#endif
+ BYTE state; /* Installed or UnInstalled */
+ BYTE pad1, pad2;
+ } colormap;
+ struct {
+ CARD32 pad00 B32;
+ CARD8 request;
+ KeyCode firstKeyCode;
+ CARD8 count;
+ BYTE pad1;
+ } mappingNotify;
+ struct {
+ CARD32 pad00 B32;
+ Window window B32;
+ union {
+ struct {
+ Atom type B32;
+ INT32 longs0 B32;
+ INT32 longs1 B32;
+ INT32 longs2 B32;
+ INT32 longs3 B32;
+ INT32 longs4 B32;
+ } l;
+ struct {
+ Atom type B32;
+ INT16 shorts0 B16;
+ INT16 shorts1 B16;
+ INT16 shorts2 B16;
+ INT16 shorts3 B16;
+ INT16 shorts4 B16;
+ INT16 shorts5 B16;
+ INT16 shorts6 B16;
+ INT16 shorts7 B16;
+ INT16 shorts8 B16;
+ INT16 shorts9 B16;
+ } s;
+ struct {
+ Atom type B32;
+ INT8 bytes[20];
+ } b;
+ } u;
+ } clientMessage;
+ } u;
+} xEvent;
+
+/* KeymapNotify events are not included in the above union because they
+ are different from all other events: they do not have a "detail"
+ or "sequenceNumber", so there is room for a 248-bit key mask. */
+
+typedef struct {
+ BYTE type;
+ BYTE map[31];
+ } xKeymapEvent;
+
+#define XEventSize (sizeof(xEvent))
+
+/* XReply is the union of all the replies above whose "fixed part"
+fits in 32 bytes. It does NOT include GetWindowAttributesReply,
+QueryFontReply, QueryKeymapReply, or GetKeyboardControlReply
+ListFontsWithInfoReply */
+
+typedef union {
+ xGenericReply generic;
+ xGetGeometryReply geom;
+ xQueryTreeReply tree;
+ xInternAtomReply atom;
+ xGetAtomNameReply atomName;
+ xGetPropertyReply property;
+ xListPropertiesReply listProperties;
+ xGetSelectionOwnerReply selection;
+ xGrabPointerReply grabPointer;
+ xGrabKeyboardReply grabKeyboard;
+ xQueryPointerReply pointer;
+ xGetMotionEventsReply motionEvents;
+ xTranslateCoordsReply coords;
+ xGetInputFocusReply inputFocus;
+ xQueryTextExtentsReply textExtents;
+ xListFontsReply fonts;
+ xGetFontPathReply fontPath;
+ xGetImageReply image;
+ xListInstalledColormapsReply colormaps;
+ xAllocColorReply allocColor;
+ xAllocNamedColorReply allocNamedColor;
+ xAllocColorCellsReply colorCells;
+ xAllocColorPlanesReply colorPlanes;
+ xQueryColorsReply colors;
+ xLookupColorReply lookupColor;
+ xQueryBestSizeReply bestSize;
+ xQueryExtensionReply extension;
+ xListExtensionsReply extensions;
+ xSetModifierMappingReply setModifierMapping;
+ xGetModifierMappingReply getModifierMapping;
+ xSetPointerMappingReply setPointerMapping;
+ xGetKeyboardMappingReply getKeyboardMapping;
+ xGetPointerMappingReply getPointerMapping;
+ xGetPointerControlReply pointerControl;
+ xGetScreenSaverReply screenSaver;
+ xListHostsReply hosts;
+ xError error;
+ xEvent event;
+} xReply;
+
+
+
+/*****************************************************************
+ * REQUESTS
+ *****************************************************************/
+
+
+/* Request structure */
+
+typedef struct _xReq {
+ CARD8 reqType;
+ CARD8 data; /* meaning depends on request type */
+ CARD16 length B16; /* length in 4 bytes quantities
+ of whole request, including this header */
+} xReq;
+
+/*****************************************************************
+ * structures that follow request.
+ *****************************************************************/
+
+/* ResourceReq is used for any request which has a resource ID
+ (or Atom or Time) as its one and only argument. */
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ CARD32 id B32; /* a Window, Drawable, Font, GContext, Pixmap, etc. */
+ } xResourceReq;
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 depth;
+ CARD16 length B16;
+ Window wid B32, parent B32;
+ INT16 x B16, y B16;
+ CARD16 width B16, height B16, borderWidth B16;
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD16 c_class B16;
+#else
+ CARD16 class B16;
+#endif
+ VisualID visual B32;
+ CARD32 mask B32;
+} xCreateWindowReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Window window B32;
+ CARD32 valueMask B32;
+} xChangeWindowAttributesReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE mode;
+ CARD16 length B16;
+ Window window B32;
+} xChangeSaveSetReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Window window B32, parent B32;
+ INT16 x B16, y B16;
+} xReparentWindowReq;
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 pad;
+ CARD16 length B16;
+ Window window B32;
+ CARD16 mask B16;
+ CARD16 pad2 B16;
+} xConfigureWindowReq;
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 direction;
+ CARD16 length B16;
+ Window window B32;
+} xCirculateWindowReq;
+
+typedef struct { /* followed by padded string */
+ CARD8 reqType;
+ BOOL onlyIfExists;
+ CARD16 length B16;
+ CARD16 nbytes B16; /* number of bytes in string */
+ CARD16 pad B16;
+} xInternAtomReq;
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 mode;
+ CARD16 length B16;
+ Window window B32;
+ Atom property B32, type B32;
+ CARD8 format;
+ BYTE pad[3];
+ CARD32 nUnits B32; /* length of stuff following, depends on format */
+} xChangePropertyReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Window window B32;
+ Atom property B32;
+} xDeletePropertyReq;
+
+typedef struct {
+ CARD8 reqType;
+#if defined(__cplusplus) || defined(c_plusplus)
+ BOOL c_delete;
+#else
+ BOOL delete;
+#endif
+ CARD16 length B16;
+ Window window B32;
+ Atom property B32, type B32;
+ CARD32 longOffset B32;
+ CARD32 longLength B32;
+} xGetPropertyReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Window window B32;
+ Atom selection B32;
+ Time time B32;
+} xSetSelectionOwnerReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Window requestor B32;
+ Atom selection B32, target B32, property B32;
+ Time time B32;
+ } xConvertSelectionReq;
+
+typedef struct {
+ CARD8 reqType;
+ BOOL propagate;
+ CARD16 length B16;
+ Window destination B32;
+ CARD32 eventMask B32;
+#ifdef WORD64
+ /* the structure should have been quad-aligned */
+ BYTE eventdata[SIZEOF(xEvent)];
+#else
+ xEvent event;
+#endif /* WORD64 */
+} xSendEventReq;
+
+typedef struct {
+ CARD8 reqType;
+ BOOL ownerEvents;
+ CARD16 length B16;
+ Window grabWindow B32;
+ CARD16 eventMask B16;
+ BYTE pointerMode, keyboardMode;
+ Window confineTo B32;
+ Cursor cursor B32;
+ Time time B32;
+} xGrabPointerReq;
+
+typedef struct {
+ CARD8 reqType;
+ BOOL ownerEvents;
+ CARD16 length B16;
+ Window grabWindow B32;
+ CARD16 eventMask B16;
+ BYTE pointerMode, keyboardMode;
+ Window confineTo B32;
+ Cursor cursor B32;
+ CARD8 button;
+ BYTE pad;
+ CARD16 modifiers B16;
+} xGrabButtonReq;
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 button;
+ CARD16 length B16;
+ Window grabWindow B32;
+ CARD16 modifiers B16;
+ CARD16 pad B16;
+} xUngrabButtonReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Cursor cursor B32;
+ Time time B32;
+ CARD16 eventMask B16;
+ CARD16 pad2 B16;
+} xChangeActivePointerGrabReq;
+
+typedef struct {
+ CARD8 reqType;
+ BOOL ownerEvents;
+ CARD16 length B16;
+ Window grabWindow B32;
+ Time time B32;
+ BYTE pointerMode, keyboardMode;
+ CARD16 pad B16;
+} xGrabKeyboardReq;
+
+typedef struct {
+ CARD8 reqType;
+ BOOL ownerEvents;
+ CARD16 length B16;
+ Window grabWindow B32;
+ CARD16 modifiers B16;
+ CARD8 key;
+ BYTE pointerMode, keyboardMode;
+ BYTE pad1, pad2, pad3;
+} xGrabKeyReq;
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 key;
+ CARD16 length B16;
+ Window grabWindow B32;
+ CARD16 modifiers B16;
+ CARD16 pad B16;
+} xUngrabKeyReq;
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 mode;
+ CARD16 length B16;
+ Time time B32;
+} xAllowEventsReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Window window B32;
+ Time start B32, stop B32;
+} xGetMotionEventsReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Window srcWid B32, dstWid B32;
+ INT16 srcX B16, srcY B16;
+} xTranslateCoordsReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Window srcWid B32, dstWid B32;
+ INT16 srcX B16, srcY B16;
+ CARD16 srcWidth B16, srcHeight B16;
+ INT16 dstX B16, dstY B16;
+} xWarpPointerReq;
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 revertTo;
+ CARD16 length B16;
+ Window focus B32;
+ Time time B32;
+} xSetInputFocusReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Font fid B32;
+ CARD16 nbytes B16;
+ BYTE pad1, pad2; /* string follows on word boundary */
+} xOpenFontReq;
+
+typedef struct {
+ CARD8 reqType;
+ BOOL oddLength;
+ CARD16 length B16;
+ Font fid B32;
+ } xQueryTextExtentsReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ CARD16 maxNames B16;
+ CARD16 nbytes B16; /* followed immediately by string bytes */
+} xListFontsReq;
+
+typedef xListFontsReq xListFontsWithInfoReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ CARD16 nFonts B16;
+ BYTE pad1, pad2; /* LISTofSTRING8 follows on word boundary */
+} xSetFontPathReq;
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 depth;
+ CARD16 length B16;
+ Pixmap pid B32;
+ Drawable drawable B32;
+ CARD16 width B16, height B16;
+} xCreatePixmapReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ GContext gc B32;
+ Drawable drawable B32;
+ CARD32 mask B32;
+} xCreateGCReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ GContext gc B32;
+ CARD32 mask B32;
+} xChangeGCReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ GContext srcGC B32, dstGC B32;
+ CARD32 mask B32;
+} xCopyGCReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ GContext gc B32;
+ CARD16 dashOffset B16;
+ CARD16 nDashes B16; /* length LISTofCARD8 of values following */
+} xSetDashesReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE ordering;
+ CARD16 length B16;
+ GContext gc B32;
+ INT16 xOrigin B16, yOrigin B16;
+} xSetClipRectanglesReq;
+
+typedef struct {
+ CARD8 reqType;
+ BOOL exposures;
+ CARD16 length B16;
+ Window window B32;
+ INT16 x B16, y B16;
+ CARD16 width B16, height B16;
+} xClearAreaReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Drawable srcDrawable B32, dstDrawable B32;
+ GContext gc B32;
+ INT16 srcX B16, srcY B16, dstX B16, dstY B16;
+ CARD16 width B16, height B16;
+} xCopyAreaReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Drawable srcDrawable B32, dstDrawable B32;
+ GContext gc B32;
+ INT16 srcX B16, srcY B16, dstX B16, dstY B16;
+ CARD16 width B16, height B16;
+ CARD32 bitPlane B32;
+} xCopyPlaneReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE coordMode;
+ CARD16 length B16;
+ Drawable drawable B32;
+ GContext gc B32;
+} xPolyPointReq;
+
+typedef xPolyPointReq xPolyLineReq; /* same request structure */
+
+/* The following used for PolySegment, PolyRectangle, PolyArc, PolyFillRectangle, PolyFillArc */
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Drawable drawable B32;
+ GContext gc B32;
+} xPolySegmentReq;
+
+typedef xPolySegmentReq xPolyArcReq;
+typedef xPolySegmentReq xPolyRectangleReq;
+typedef xPolySegmentReq xPolyFillRectangleReq;
+typedef xPolySegmentReq xPolyFillArcReq;
+
+typedef struct _FillPolyReq {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Drawable drawable B32;
+ GContext gc B32;
+ BYTE shape;
+ BYTE coordMode;
+ CARD16 pad1 B16;
+} xFillPolyReq;
+
+
+typedef struct _PutImageReq {
+ CARD8 reqType;
+ CARD8 format;
+ CARD16 length B16;
+ Drawable drawable B32;
+ GContext gc B32;
+ CARD16 width B16, height B16;
+ INT16 dstX B16, dstY B16;
+ CARD8 leftPad;
+ CARD8 depth;
+ CARD16 pad B16;
+} xPutImageReq;
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 format;
+ CARD16 length B16;
+ Drawable drawable B32;
+ INT16 x B16, y B16;
+ CARD16 width B16, height B16;
+ CARD32 planeMask B32;
+} xGetImageReq;
+
+/* the following used by PolyText8 and PolyText16 */
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 pad;
+ CARD16 length B16;
+ Drawable drawable B32;
+ GContext gc B32;
+ INT16 x B16, y B16; /* items (xTextElt) start after struct */
+} xPolyTextReq;
+
+typedef xPolyTextReq xPolyText8Req;
+typedef xPolyTextReq xPolyText16Req;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE nChars;
+ CARD16 length B16;
+ Drawable drawable B32;
+ GContext gc B32;
+ INT16 x B16, y B16;
+} xImageTextReq;
+
+typedef xImageTextReq xImageText8Req;
+typedef xImageTextReq xImageText16Req;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE alloc;
+ CARD16 length B16;
+ Colormap mid B32;
+ Window window B32;
+ VisualID visual B32;
+} xCreateColormapReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Colormap mid B32;
+ Colormap srcCmap B32;
+} xCopyColormapAndFreeReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Colormap cmap B32;
+ CARD16 red B16, green B16, blue B16;
+ CARD16 pad2 B16;
+} xAllocColorReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Colormap cmap B32;
+ CARD16 nbytes B16; /* followed by structure */
+ BYTE pad1, pad2;
+} xAllocNamedColorReq;
+
+typedef struct {
+ CARD8 reqType;
+ BOOL contiguous;
+ CARD16 length B16;
+ Colormap cmap B32;
+ CARD16 colors B16, planes B16;
+} xAllocColorCellsReq;
+
+typedef struct {
+ CARD8 reqType;
+ BOOL contiguous;
+ CARD16 length B16;
+ Colormap cmap B32;
+ CARD16 colors B16, red B16, green B16, blue B16;
+} xAllocColorPlanesReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Colormap cmap B32;
+ CARD32 planeMask B32;
+} xFreeColorsReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Colormap cmap B32;
+} xStoreColorsReq;
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 flags; /* DoRed, DoGreen, DoBlue, as in xColorItem */
+ CARD16 length B16;
+ Colormap cmap B32;
+ CARD32 pixel B32;
+ CARD16 nbytes B16; /* number of name string bytes following structure */
+ BYTE pad1, pad2;
+ } xStoreNamedColorReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Colormap cmap B32;
+} xQueryColorsReq;
+
+typedef struct { /* followed by string of length len */
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Colormap cmap B32;
+ CARD16 nbytes B16; /* number of string bytes following structure*/
+ BYTE pad1, pad2;
+} xLookupColorReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Cursor cid B32;
+ Pixmap source B32, mask B32;
+ CARD16 foreRed B16, foreGreen B16, foreBlue B16;
+ CARD16 backRed B16, backGreen B16, backBlue B16;
+ CARD16 x B16, y B16;
+} xCreateCursorReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Cursor cid B32;
+ Font source B32, mask B32;
+ CARD16 sourceChar B16, maskChar B16;
+ CARD16 foreRed B16, foreGreen B16, foreBlue B16;
+ CARD16 backRed B16, backGreen B16, backBlue B16;
+} xCreateGlyphCursorReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Cursor cursor B32;
+ CARD16 foreRed B16, foreGreen B16, foreBlue B16;
+ CARD16 backRed B16, backGreen B16, backBlue B16;
+} xRecolorCursorReq;
+
+typedef struct {
+ CARD8 reqType;
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class;
+#else
+ CARD8 class;
+#endif
+ CARD16 length B16;
+ Drawable drawable B32;
+ CARD16 width B16, height B16;
+} xQueryBestSizeReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ CARD16 nbytes B16; /* number of string bytes following structure */
+ BYTE pad1, pad2;
+} xQueryExtensionReq;
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 numKeyPerModifier;
+ CARD16 length B16;
+} xSetModifierMappingReq;
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 nElts; /* how many elements in the map */
+ CARD16 length B16;
+} xSetPointerMappingReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ KeyCode firstKeyCode;
+ CARD8 count;
+ CARD16 pad1 B16;
+} xGetKeyboardMappingReq;
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 keyCodes;
+ CARD16 length B16;
+ KeyCode firstKeyCode;
+ CARD8 keySymsPerKeyCode;
+ CARD16 pad1 B16;
+} xChangeKeyboardMappingReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ CARD32 mask B32;
+} xChangeKeyboardControlReq;
+
+typedef struct {
+ CARD8 reqType;
+ INT8 percent; /* -100 to 100 */
+ CARD16 length B16;
+} xBellReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ INT16 accelNum B16, accelDenum B16;
+ INT16 threshold B16;
+ BOOL doAccel, doThresh;
+} xChangePointerControlReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ INT16 timeout B16, interval B16;
+ BYTE preferBlank, allowExpose;
+ CARD16 pad2 B16;
+} xSetScreenSaverReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE mode;
+ CARD16 length B16;
+ CARD8 hostFamily;
+ BYTE pad;
+ CARD16 hostLength B16;
+} xChangeHostsReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ } xListHostsReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE mode;
+ CARD16 length B16;
+ } xChangeModeReq;
+
+typedef xChangeModeReq xSetAccessControlReq;
+typedef xChangeModeReq xSetCloseDownModeReq;
+typedef xChangeModeReq xForceScreenSaverReq;
+
+typedef struct { /* followed by LIST of ATOM */
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Window window B32;
+ CARD16 nAtoms B16;
+ INT16 nPositions B16;
+ } xRotatePropertiesReq;
+
+
+
+/* Reply codes */
+
+#define X_Reply 1 /* Normal reply */
+#define X_Error 0 /* Error */
+
+/* Request codes */
+
+#define X_CreateWindow 1
+#define X_ChangeWindowAttributes 2
+#define X_GetWindowAttributes 3
+#define X_DestroyWindow 4
+#define X_DestroySubwindows 5
+#define X_ChangeSaveSet 6
+#define X_ReparentWindow 7
+#define X_MapWindow 8
+#define X_MapSubwindows 9
+#define X_UnmapWindow 10
+#define X_UnmapSubwindows 11
+#define X_ConfigureWindow 12
+#define X_CirculateWindow 13
+#define X_GetGeometry 14
+#define X_QueryTree 15
+#define X_InternAtom 16
+#define X_GetAtomName 17
+#define X_ChangeProperty 18
+#define X_DeleteProperty 19
+#define X_GetProperty 20
+#define X_ListProperties 21
+#define X_SetSelectionOwner 22
+#define X_GetSelectionOwner 23
+#define X_ConvertSelection 24
+#define X_SendEvent 25
+#define X_GrabPointer 26
+#define X_UngrabPointer 27
+#define X_GrabButton 28
+#define X_UngrabButton 29
+#define X_ChangeActivePointerGrab 30
+#define X_GrabKeyboard 31
+#define X_UngrabKeyboard 32
+#define X_GrabKey 33
+#define X_UngrabKey 34
+#define X_AllowEvents 35
+#define X_GrabServer 36
+#define X_UngrabServer 37
+#define X_QueryPointer 38
+#define X_GetMotionEvents 39
+#define X_TranslateCoords 40
+#define X_WarpPointer 41
+#define X_SetInputFocus 42
+#define X_GetInputFocus 43
+#define X_QueryKeymap 44
+#define X_OpenFont 45
+#define X_CloseFont 46
+#define X_QueryFont 47
+#define X_QueryTextExtents 48
+#define X_ListFonts 49
+#define X_ListFontsWithInfo 50
+#define X_SetFontPath 51
+#define X_GetFontPath 52
+#define X_CreatePixmap 53
+#define X_FreePixmap 54
+#define X_CreateGC 55
+#define X_ChangeGC 56
+#define X_CopyGC 57
+#define X_SetDashes 58
+#define X_SetClipRectangles 59
+#define X_FreeGC 60
+#define X_ClearArea 61
+#define X_CopyArea 62
+#define X_CopyPlane 63
+#define X_PolyPoint 64
+#define X_PolyLine 65
+#define X_PolySegment 66
+#define X_PolyRectangle 67
+#define X_PolyArc 68
+#define X_FillPoly 69
+#define X_PolyFillRectangle 70
+#define X_PolyFillArc 71
+#define X_PutImage 72
+#define X_GetImage 73
+#define X_PolyText8 74
+#define X_PolyText16 75
+#define X_ImageText8 76
+#define X_ImageText16 77
+#define X_CreateColormap 78
+#define X_FreeColormap 79
+#define X_CopyColormapAndFree 80
+#define X_InstallColormap 81
+#define X_UninstallColormap 82
+#define X_ListInstalledColormaps 83
+#define X_AllocColor 84
+#define X_AllocNamedColor 85
+#define X_AllocColorCells 86
+#define X_AllocColorPlanes 87
+#define X_FreeColors 88
+#define X_StoreColors 89
+#define X_StoreNamedColor 90
+#define X_QueryColors 91
+#define X_LookupColor 92
+#define X_CreateCursor 93
+#define X_CreateGlyphCursor 94
+#define X_FreeCursor 95
+#define X_RecolorCursor 96
+#define X_QueryBestSize 97
+#define X_QueryExtension 98
+#define X_ListExtensions 99
+#define X_ChangeKeyboardMapping 100
+#define X_GetKeyboardMapping 101
+#define X_ChangeKeyboardControl 102
+#define X_GetKeyboardControl 103
+#define X_Bell 104
+#define X_ChangePointerControl 105
+#define X_GetPointerControl 106
+#define X_SetScreenSaver 107
+#define X_GetScreenSaver 108
+#define X_ChangeHosts 109
+#define X_ListHosts 110
+#define X_SetAccessControl 111
+#define X_SetCloseDownMode 112
+#define X_KillClient 113
+#define X_RotateProperties 114
+#define X_ForceScreenSaver 115
+#define X_SetPointerMapping 116
+#define X_GetPointerMapping 117
+#define X_SetModifierMapping 118
+#define X_GetModifierMapping 119
+#define X_NoOperation 127
+
+/* restore these definitions back to the typedefs in X.h */
+#undef Window
+#undef Drawable
+#undef Font
+#undef Pixmap
+#undef Cursor
+#undef Colormap
+#undef GContext
+#undef Atom
+#undef VisualID
+#undef Time
+#undef KeyCode
+#undef KeySym
+
+#endif /* XPROTO_H */
diff --git a/sysroot/usr/include/X11/Xprotostr.h b/sysroot/usr/include/X11/Xprotostr.h
new file mode 100644
index 0000000..f343d98
--- /dev/null
+++ b/sysroot/usr/include/X11/Xprotostr.h
@@ -0,0 +1,78 @@
+/* $Xorg: Xprotostr.h,v 1.4 2001/02/09 02:03:23 xorgcvs Exp $ */
+#ifndef XPROTOSTRUCTS_H
+#define XPROTOSTRUCTS_H
+
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************/
+#include <X11/Xmd.h>
+
+/* Used by PolySegment */
+
+typedef struct _xSegment {
+ INT16 x1 B16, y1 B16, x2 B16, y2 B16;
+} xSegment;
+
+/* POINT */
+
+typedef struct _xPoint {
+ INT16 x B16, y B16;
+} xPoint;
+
+typedef struct _xRectangle {
+ INT16 x B16, y B16;
+ CARD16 width B16, height B16;
+} xRectangle;
+
+/* ARC */
+
+typedef struct _xArc {
+ INT16 x B16, y B16;
+ CARD16 width B16, height B16;
+ INT16 angle1 B16, angle2 B16;
+} xArc;
+
+#endif /* XPROTOSTRUCTS_H */
diff --git a/sysroot/usr/include/X11/Xregion.h b/sysroot/usr/include/X11/Xregion.h
new file mode 100644
index 0000000..2ddf12c
--- /dev/null
+++ b/sysroot/usr/include/X11/Xregion.h
@@ -0,0 +1,190 @@
+/* $Xorg: region.h,v 1.4 2001/02/09 02:03:40 xorgcvs Exp $ */
+/************************************************************************
+
+Copyright 1987, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+************************************************************************/
+
+#ifndef _XREGION_H
+#define _XREGION_H
+
+typedef struct {
+ short x1, x2, y1, y2;
+} Box, BOX, BoxRec, *BoxPtr;
+
+typedef struct {
+ short x, y, width, height;
+}RECTANGLE, RectangleRec, *RectanglePtr;
+
+#define TRUE 1
+#define FALSE 0
+#define MAXSHORT 32767
+#define MINSHORT -MAXSHORT
+#ifndef MAX
+#define MAX(a,b) (((a) > (b)) ? (a) : (b))
+#endif
+#ifndef MIN
+#define MIN(a,b) (((a) < (b)) ? (a) : (b))
+#endif
+
+
+/*
+ * clip region
+ */
+
+typedef struct _XRegion {
+ long size;
+ long numRects;
+ BOX *rects;
+ BOX extents;
+} REGION;
+
+/* Xutil.h contains the declaration:
+ * typedef struct _XRegion *Region;
+ */
+
+/* 1 if two BOXs overlap.
+ * 0 if two BOXs do not overlap.
+ * Remember, x2 and y2 are not in the region
+ */
+#define EXTENTCHECK(r1, r2) \
+ ((r1)->x2 > (r2)->x1 && \
+ (r1)->x1 < (r2)->x2 && \
+ (r1)->y2 > (r2)->y1 && \
+ (r1)->y1 < (r2)->y2)
+
+/*
+ * update region extents
+ */
+#define EXTENTS(r,idRect){\
+ if((r)->x1 < (idRect)->extents.x1)\
+ (idRect)->extents.x1 = (r)->x1;\
+ if((r)->y1 < (idRect)->extents.y1)\
+ (idRect)->extents.y1 = (r)->y1;\
+ if((r)->x2 > (idRect)->extents.x2)\
+ (idRect)->extents.x2 = (r)->x2;\
+ if((r)->y2 > (idRect)->extents.y2)\
+ (idRect)->extents.y2 = (r)->y2;\
+ }
+
+/*
+ * Check to see if there is enough memory in the present region.
+ */
+#define MEMCHECK(reg, rect, firstrect){\
+ if ((reg)->numRects >= ((reg)->size - 1)){\
+ (firstrect) = (BOX *) Xrealloc \
+ ((char *)(firstrect), (unsigned) (2 * (sizeof(BOX)) * ((reg)->size)));\
+ if ((firstrect) == 0)\
+ return(0);\
+ (reg)->size *= 2;\
+ (rect) = &(firstrect)[(reg)->numRects];\
+ }\
+ }
+
+/* this routine checks to see if the previous rectangle is the same
+ * or subsumes the new rectangle to add.
+ */
+
+#define CHECK_PREVIOUS(Reg, R, Rx1, Ry1, Rx2, Ry2)\
+ (!(((Reg)->numRects > 0)&&\
+ ((R-1)->y1 == (Ry1)) &&\
+ ((R-1)->y2 == (Ry2)) &&\
+ ((R-1)->x1 <= (Rx1)) &&\
+ ((R-1)->x2 >= (Rx2))))
+
+/* add a rectangle to the given Region */
+#define ADDRECT(reg, r, rx1, ry1, rx2, ry2){\
+ if (((rx1) < (rx2)) && ((ry1) < (ry2)) &&\
+ CHECK_PREVIOUS((reg), (r), (rx1), (ry1), (rx2), (ry2))){\
+ (r)->x1 = (rx1);\
+ (r)->y1 = (ry1);\
+ (r)->x2 = (rx2);\
+ (r)->y2 = (ry2);\
+ EXTENTS((r), (reg));\
+ (reg)->numRects++;\
+ (r)++;\
+ }\
+ }
+
+
+
+/* add a rectangle to the given Region */
+#define ADDRECTNOX(reg, r, rx1, ry1, rx2, ry2){\
+ if ((rx1 < rx2) && (ry1 < ry2) &&\
+ CHECK_PREVIOUS((reg), (r), (rx1), (ry1), (rx2), (ry2))){\
+ (r)->x1 = (rx1);\
+ (r)->y1 = (ry1);\
+ (r)->x2 = (rx2);\
+ (r)->y2 = (ry2);\
+ (reg)->numRects++;\
+ (r)++;\
+ }\
+ }
+
+#define EMPTY_REGION(pReg) pReg->numRects = 0
+
+#define REGION_NOT_EMPTY(pReg) pReg->numRects
+
+#define INBOX(r, x, y) \
+ ( ( ((r).x2 > x)) && \
+ ( ((r).x1 <= x)) && \
+ ( ((r).y2 > y)) && \
+ ( ((r).y1 <= y)) )
+
+/*
+ * number of points to buffer before sending them off
+ * to scanlines() : Must be an even number
+ */
+#define NUMPTSTOBUFFER 200
+
+/*
+ * used to allocate buffers for points and link
+ * the buffers together
+ */
+typedef struct _POINTBLOCK {
+ XPoint pts[NUMPTSTOBUFFER];
+ struct _POINTBLOCK *next;
+} POINTBLOCK;
+
+#endif
diff --git a/sysroot/usr/include/X11/Xresource.h b/sysroot/usr/include/X11/Xresource.h
new file mode 100644
index 0000000..ce12137
--- /dev/null
+++ b/sysroot/usr/include/X11/Xresource.h
@@ -0,0 +1,360 @@
+/* $Xorg: Xresource.h,v 1.7 2001/02/09 02:03:39 xorgcvs Exp $ */
+
+/***********************************************************
+
+Copyright 1987, 1988, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************/
+/* $XFree86: xc/lib/X11/Xresource.h,v 3.8 2001/12/14 19:54:10 dawes Exp $ */
+
+#ifndef _XRESOURCE_H_
+#define _XRESOURCE_H_
+
+#ifndef _XP_PRINT_SERVER_
+#include <X11/Xlib.h>
+#endif
+
+/****************************************************************
+ ****************************************************************
+ *** ***
+ *** ***
+ *** X Resource Manager Intrinsics ***
+ *** ***
+ *** ***
+ ****************************************************************
+ ****************************************************************/
+
+_XFUNCPROTOBEGIN
+
+/****************************************************************
+ *
+ * Memory Management
+ *
+ ****************************************************************/
+
+extern char *Xpermalloc(
+ unsigned int /* size */
+);
+
+/****************************************************************
+ *
+ * Quark Management
+ *
+ ****************************************************************/
+
+typedef int XrmQuark, *XrmQuarkList;
+#define NULLQUARK ((XrmQuark) 0)
+
+typedef char *XrmString;
+#define NULLSTRING ((XrmString) 0)
+
+/* find quark for string, create new quark if none already exists */
+extern XrmQuark XrmStringToQuark(
+ _Xconst char* /* string */
+);
+
+extern XrmQuark XrmPermStringToQuark(
+ _Xconst char* /* string */
+);
+
+/* find string for quark */
+extern XrmString XrmQuarkToString(
+ XrmQuark /* quark */
+);
+
+extern XrmQuark XrmUniqueQuark(
+ void
+);
+
+#define XrmStringsEqual(a1, a2) (strcmp(a1, a2) == 0)
+
+
+/****************************************************************
+ *
+ * Conversion of Strings to Lists
+ *
+ ****************************************************************/
+
+typedef enum {XrmBindTightly, XrmBindLoosely} XrmBinding, *XrmBindingList;
+
+extern void XrmStringToQuarkList(
+ _Xconst char* /* string */,
+ XrmQuarkList /* quarks_return */
+);
+
+extern void XrmStringToBindingQuarkList(
+ _Xconst char* /* string */,
+ XrmBindingList /* bindings_return */,
+ XrmQuarkList /* quarks_return */
+);
+
+/****************************************************************
+ *
+ * Name and Class lists.
+ *
+ ****************************************************************/
+
+typedef XrmQuark XrmName;
+typedef XrmQuarkList XrmNameList;
+#define XrmNameToString(name) XrmQuarkToString(name)
+#define XrmStringToName(string) XrmStringToQuark(string)
+#define XrmStringToNameList(str, name) XrmStringToQuarkList(str, name)
+
+typedef XrmQuark XrmClass;
+typedef XrmQuarkList XrmClassList;
+#define XrmClassToString(c_class) XrmQuarkToString(c_class)
+#define XrmStringToClass(c_class) XrmStringToQuark(c_class)
+#define XrmStringToClassList(str,c_class) XrmStringToQuarkList(str, c_class)
+
+
+
+/****************************************************************
+ *
+ * Resource Representation Types and Values
+ *
+ ****************************************************************/
+
+typedef XrmQuark XrmRepresentation;
+#define XrmStringToRepresentation(string) XrmStringToQuark(string)
+#define XrmRepresentationToString(type) XrmQuarkToString(type)
+
+typedef struct {
+ unsigned int size;
+ XPointer addr;
+} XrmValue, *XrmValuePtr;
+
+
+/****************************************************************
+ *
+ * Resource Manager Functions
+ *
+ ****************************************************************/
+
+typedef struct _XrmHashBucketRec *XrmHashBucket;
+typedef XrmHashBucket *XrmHashTable;
+typedef XrmHashTable XrmSearchList[];
+typedef struct _XrmHashBucketRec *XrmDatabase;
+
+
+extern void XrmDestroyDatabase(
+ XrmDatabase /* database */
+);
+
+extern void XrmQPutResource(
+ XrmDatabase* /* database */,
+ XrmBindingList /* bindings */,
+ XrmQuarkList /* quarks */,
+ XrmRepresentation /* type */,
+ XrmValue* /* value */
+);
+
+extern void XrmPutResource(
+ XrmDatabase* /* database */,
+ _Xconst char* /* specifier */,
+ _Xconst char* /* type */,
+ XrmValue* /* value */
+);
+
+extern void XrmQPutStringResource(
+ XrmDatabase* /* database */,
+ XrmBindingList /* bindings */,
+ XrmQuarkList /* quarks */,
+ _Xconst char* /* value */
+);
+
+extern void XrmPutStringResource(
+ XrmDatabase* /* database */,
+ _Xconst char* /* specifier */,
+ _Xconst char* /* value */
+);
+
+extern void XrmPutLineResource(
+ XrmDatabase* /* database */,
+ _Xconst char* /* line */
+);
+
+extern Bool XrmQGetResource(
+ XrmDatabase /* database */,
+ XrmNameList /* quark_name */,
+ XrmClassList /* quark_class */,
+ XrmRepresentation* /* quark_type_return */,
+ XrmValue* /* value_return */
+);
+
+extern Bool XrmGetResource(
+ XrmDatabase /* database */,
+ _Xconst char* /* str_name */,
+ _Xconst char* /* str_class */,
+ char** /* str_type_return */,
+ XrmValue* /* value_return */
+);
+
+extern Bool XrmQGetSearchList(
+ XrmDatabase /* database */,
+ XrmNameList /* names */,
+ XrmClassList /* classes */,
+ XrmSearchList /* list_return */,
+ int /* list_length */
+);
+
+extern Bool XrmQGetSearchResource(
+ XrmSearchList /* list */,
+ XrmName /* name */,
+ XrmClass /* class */,
+ XrmRepresentation* /* type_return */,
+ XrmValue* /* value_return */
+);
+
+/****************************************************************
+ *
+ * Resource Database Management
+ *
+ ****************************************************************/
+
+#ifndef _XP_PRINT_SERVER_
+
+extern void XrmSetDatabase(
+ Display* /* display */,
+ XrmDatabase /* database */
+);
+
+extern XrmDatabase XrmGetDatabase(
+ Display* /* display */
+);
+
+#endif /* !_XP_PRINT_SERVER_ */
+
+extern XrmDatabase XrmGetFileDatabase(
+ _Xconst char* /* filename */
+);
+
+extern Status XrmCombineFileDatabase(
+ _Xconst char* /* filename */,
+ XrmDatabase* /* target */,
+ Bool /* override */
+);
+
+extern XrmDatabase XrmGetStringDatabase(
+ _Xconst char* /* data */ /* null terminated string */
+);
+
+extern void XrmPutFileDatabase(
+ XrmDatabase /* database */,
+ _Xconst char* /* filename */
+);
+
+extern void XrmMergeDatabases(
+ XrmDatabase /* source_db */,
+ XrmDatabase* /* target_db */
+);
+
+extern void XrmCombineDatabase(
+ XrmDatabase /* source_db */,
+ XrmDatabase* /* target_db */,
+ Bool /* override */
+);
+
+#define XrmEnumAllLevels 0
+#define XrmEnumOneLevel 1
+
+extern Bool XrmEnumerateDatabase(
+ XrmDatabase /* db */,
+ XrmNameList /* name_prefix */,
+ XrmClassList /* class_prefix */,
+ int /* mode */,
+ Bool (*)(
+ XrmDatabase* /* db */,
+ XrmBindingList /* bindings */,
+ XrmQuarkList /* quarks */,
+ XrmRepresentation* /* type */,
+ XrmValue* /* value */,
+ XPointer /* closure */
+ ) /* proc */,
+ XPointer /* closure */
+);
+
+extern const char *XrmLocaleOfDatabase(
+ XrmDatabase /* database */
+);
+
+
+/****************************************************************
+ *
+ * Command line option mapping to resource entries
+ *
+ ****************************************************************/
+
+typedef enum {
+ XrmoptionNoArg, /* Value is specified in OptionDescRec.value */
+ XrmoptionIsArg, /* Value is the option string itself */
+ XrmoptionStickyArg, /* Value is characters immediately following option */
+ XrmoptionSepArg, /* Value is next argument in argv */
+ XrmoptionResArg, /* Resource and value in next argument in argv */
+ XrmoptionSkipArg, /* Ignore this option and the next argument in argv */
+ XrmoptionSkipLine, /* Ignore this option and the rest of argv */
+ XrmoptionSkipNArgs /* Ignore this option and the next
+ OptionDescRes.value arguments in argv */
+} XrmOptionKind;
+
+typedef struct {
+ char *option; /* Option abbreviation in argv */
+ char *specifier; /* Resource specifier */
+ XrmOptionKind argKind; /* Which style of option it is */
+ XPointer value; /* Value to provide if XrmoptionNoArg */
+} XrmOptionDescRec, *XrmOptionDescList;
+
+
+extern void XrmParseCommand(
+ XrmDatabase* /* database */,
+ XrmOptionDescList /* table */,
+ int /* table_count */,
+ _Xconst char* /* name */,
+ int* /* argc_in_out */,
+ char** /* argv_in_out */
+);
+
+_XFUNCPROTOEND
+
+#endif /* _XRESOURCE_H_ */
+/* DON'T ADD STUFF AFTER THIS #endif */
diff --git a/sysroot/usr/include/X11/Xthreads.h b/sysroot/usr/include/X11/Xthreads.h
new file mode 100644
index 0000000..54b5440
--- /dev/null
+++ b/sysroot/usr/include/X11/Xthreads.h
@@ -0,0 +1,316 @@
+/*
+ * $Xorg: Xthreads.h,v 1.5 2001/02/09 02:03:23 xorgcvs Exp $
+ *
+ *
+Copyright 1993, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+ * *
+ */
+/* $XFree86: Xthreads.h,v 3.10 2001/12/14 19:53:26 dawes Exp $ */
+
+#ifndef _XTHREADS_H_
+#define _XTHREADS_H_
+
+/* Redefine these to XtMalloc/XtFree or whatever you want before including
+ * this header file.
+ */
+#ifndef xmalloc
+#define xmalloc malloc
+#endif
+#ifndef xfree
+#define xfree free
+#endif
+
+#ifdef CTHREADS
+#include <cthreads.h>
+typedef cthread_t xthread_t;
+typedef struct condition xcondition_rec;
+typedef struct mutex xmutex_rec;
+#define xthread_init() cthread_init()
+#define xthread_self cthread_self
+#define xthread_fork(func,closure) cthread_fork(func,closure)
+#define xthread_yield() cthread_yield()
+#define xthread_exit(v) cthread_exit(v)
+#define xthread_set_name(t,str) cthread_set_name(t,str)
+#define xmutex_init(m) mutex_init(m)
+#define xmutex_clear(m) mutex_clear(m)
+#define xmutex_lock(m) mutex_lock(m)
+#define xmutex_unlock(m) mutex_unlock(m)
+#define xmutex_set_name(m,str) mutex_set_name(m,str)
+#define xcondition_init(cv) condition_init(cv)
+#define xcondition_clear(cv) condition_clear(cv)
+#define xcondition_wait(cv,m) condition_wait(cv,m)
+#define xcondition_signal(cv) condition_signal(cv)
+#define xcondition_broadcast(cv) condition_broadcast(cv)
+#define xcondition_set_name(cv,str) condition_set_name(cv,str)
+#else /* !CTHREADS */
+#if defined(SVR4) && !defined(__sgi) && !defined(_SEQUENT_)
+#include <thread.h>
+#include <synch.h>
+typedef thread_t xthread_t;
+typedef thread_key_t xthread_key_t;
+typedef cond_t xcondition_rec;
+typedef mutex_t xmutex_rec;
+#if defined(__UNIXWARE__)
+extern xthread_t (*_x11_thr_self)();
+#define xthread_self (_x11_thr_self)
+#else
+#define xthread_self thr_self
+#endif
+#define xthread_fork(func,closure) thr_create(NULL,0,func,closure,THR_NEW_LWP|THR_DETACHED,NULL)
+#define xthread_yield() thr_yield()
+#define xthread_exit(v) thr_exit(v)
+#define xthread_key_create(kp,d) thr_keycreate(kp,d)
+#ifdef sun
+#define xthread_key_delete(k) 0
+#else
+#define xthread_key_delete(k) thr_keydelete(k)
+#endif
+#define xthread_set_specific(k,v) thr_setspecific(k,v)
+#define xthread_get_specific(k,vp) thr_getspecific(k,vp)
+#define xmutex_init(m) mutex_init(m,USYNC_THREAD,0)
+#define xmutex_clear(m) mutex_destroy(m)
+#define xmutex_lock(m) mutex_lock(m)
+#define xmutex_unlock(m) mutex_unlock(m)
+#define xcondition_init(cv) cond_init(cv,USYNC_THREAD,0)
+#define xcondition_clear(cv) cond_destroy(cv)
+#define xcondition_wait(cv,m) cond_wait(cv,m)
+#define xcondition_signal(cv) cond_signal(cv)
+#define xcondition_broadcast(cv) cond_broadcast(cv)
+#else /* !SVR4 */
+#ifdef WIN32
+#include <X11/Xwindows.h>
+typedef DWORD xthread_t;
+typedef DWORD xthread_key_t;
+struct _xthread_waiter {
+ HANDLE sem;
+ struct _xthread_waiter *next;
+};
+typedef struct {
+ CRITICAL_SECTION cs;
+ struct _xthread_waiter *waiters;
+} xcondition_rec;
+typedef CRITICAL_SECTION xmutex_rec;
+#define xthread_init() _Xthread_init()
+#define xthread_self GetCurrentThreadId
+#define xthread_fork(func,closure) { \
+ DWORD _tmptid; \
+ CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)func, (LPVOID)closure, 0, \
+ &_tmptid); \
+}
+#define xthread_yield() Sleep(0)
+#define xthread_exit(v) ExitThread((DWORD)(v))
+#define xthread_key_create(kp,d) *(kp) = TlsAlloc()
+#define xthread_key_delete(k) TlsFree(k)
+#define xthread_set_specific(k,v) TlsSetValue(k,v)
+#define xthread_get_specific(k,vp) TlsGetValue(k)
+#define xmutex_init(m) InitializeCriticalSection(m)
+#define xmutex_clear(m) DeleteCriticalSection(m)
+#define _XMUTEX_NESTS
+#define xmutex_lock(m) EnterCriticalSection(m)
+#define xmutex_unlock(m) LeaveCriticalSection(m)
+#define xcondition_init(cv) { \
+ InitializeCriticalSection(&(cv)->cs); \
+ (cv)->waiters = NULL; \
+}
+#define xcondition_clear(cv) DeleteCriticalSection(&(cv)->cs)
+extern struct _xthread_waiter *_Xthread_waiter();
+#define xcondition_wait(cv,m) { \
+ struct _xthread_waiter *_tmpthr = _Xthread_waiter(); \
+ EnterCriticalSection(&(cv)->cs); \
+ _tmpthr->next = (cv)->waiters; \
+ (cv)->waiters = _tmpthr; \
+ LeaveCriticalSection(&(cv)->cs); \
+ LeaveCriticalSection(m); \
+ WaitForSingleObject(_tmpthr->sem, INFINITE); \
+ EnterCriticalSection(m); \
+}
+#define xcondition_signal(cv) { \
+ EnterCriticalSection(&(cv)->cs); \
+ if ((cv)->waiters) { \
+ ReleaseSemaphore((cv)->waiters->sem, 1, NULL); \
+ (cv)->waiters = (cv)->waiters->next; \
+ } \
+ LeaveCriticalSection(&(cv)->cs); \
+}
+#define xcondition_broadcast(cv) { \
+ struct _xthread_waiter *_tmpthr; \
+ EnterCriticalSection(&(cv)->cs); \
+ for (_tmpthr = (cv)->waiters; _tmpthr; _tmpthr = _tmpthr->next) \
+ ReleaseSemaphore(_tmpthr->sem, 1, NULL); \
+ (cv)->waiters = NULL; \
+ LeaveCriticalSection(&(cv)->cs); \
+}
+#else /* !WIN32 */
+#ifdef USE_TIS_SUPPORT
+/*
+ * TIS support is intended for thread safe libraries.
+ * This should not be used for general client programming.
+ */
+#include <tis.h>
+typedef pthread_t xthread_t;
+typedef pthread_key_t xthread_key_t;
+typedef pthread_cond_t xcondition_rec;
+typedef pthread_mutex_t xmutex_rec;
+#define xthread_self tis_self
+#define xthread_fork(func,closure) { pthread_t _tmpxthr; \
+ pthread_create(&_tmpxthr,NULL,func,closure); }
+#define xthread_yield() pthread_yield_np()
+#define xthread_exit(v) pthread_exit(v)
+#define xthread_key_create(kp,d) tis_key_create(kp,d)
+#define xthread_key_delete(k) tis_key_delete(k)
+#define xthread_set_specific(k,v) tis_setspecific(k,v)
+#define xthread_get_specific(k,vp) *(vp) = tis_getspecific(k)
+#define XMUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
+#define xmutex_init(m) tis_mutex_init(m)
+#define xmutex_clear(m) tis_mutex_destroy(m)
+#define xmutex_lock(m) tis_mutex_lock(m)
+#define xmutex_unlock(m) tis_mutex_unlock(m)
+#define xcondition_init(c) tis_cond_init(c)
+#define xcondition_clear(c) tis_cond_destroy(c)
+#define xcondition_wait(c,m) tis_cond_wait(c,m)
+#define xcondition_signal(c) tis_cond_signal(c)
+#define xcondition_broadcast(c) tis_cond_broadcast(c)
+#else
+#ifdef USE_NBSD_THREADLIB
+/*
+ * NetBSD threadlib support is intended for thread safe libraries.
+ * This should not be used for general client programming.
+ */
+#include <threadlib.h>
+typedef thr_t xthread_t;
+typedef thread_key_t xthread_key_t;
+typedef cond_t xcondition_rec;
+typedef mutex_t xmutex_rec;
+#define xthread_self thr_self
+#define xthread_fork(func,closure) { thr_t _tmpxthr; \
+ /* XXX Create it detached? --thorpej */ \
+ thr_create(&_tmpxthr,NULL,func,closure); }
+#define xthread_yield() thr_yield()
+#define xthread_exit(v) thr_exit(v)
+#define xthread_key_create(kp,d) thr_keycreate(kp,d)
+#define xthread_key_delete(k) thr_keydelete(k)
+#define xthread_set_specific(k,v) thr_setspecific(k,v)
+#define xthread_get_specific(k,vp) *(vp) = thr_getspecific(k)
+#define XMUTEX_INITIALIZER MUTEX_INITIALIZER
+#define xmutex_init(m) mutex_init(m, 0)
+#define xmutex_clear(m) mutex_destroy(m)
+#define xmutex_lock(m) mutex_lock(m)
+#define xmutex_unlock(m) mutex_unlock(m)
+#define xcondition_init(c) cond_init(c, 0, 0)
+#define xcondition_clear(c) cond_destroy(c)
+#define xcondition_wait(c,m) cond_wait(c,m)
+#define xcondition_signal(c) cond_signal(c)
+#define xcondition_broadcast(c) cond_broadcast(c)
+#else
+#include <pthread.h>
+typedef pthread_t xthread_t;
+typedef pthread_key_t xthread_key_t;
+typedef pthread_cond_t xcondition_rec;
+typedef pthread_mutex_t xmutex_rec;
+#define xthread_self pthread_self
+#define xthread_yield() pthread_yield()
+#define xthread_exit(v) pthread_exit(v)
+#define xthread_set_specific(k,v) pthread_setspecific(k,v)
+#define xmutex_clear(m) pthread_mutex_destroy(m)
+#define xmutex_lock(m) pthread_mutex_lock(m)
+#define xmutex_unlock(m) pthread_mutex_unlock(m)
+#ifndef XPRE_STANDARD_API
+#define xthread_key_create(kp,d) pthread_key_create(kp,d)
+#define xthread_key_delete(k) pthread_key_delete(k)
+#define xthread_get_specific(k,vp) *(vp) = pthread_getspecific(k)
+#define xthread_fork(func,closure) { pthread_t _tmpxthr; \
+ pthread_create(&_tmpxthr,NULL,func,closure); }
+#define XMUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
+#define xmutex_init(m) pthread_mutex_init(m, NULL)
+#define xcondition_init(c) pthread_cond_init(c, NULL)
+#else /* XPRE_STANDARD_API */
+#define xthread_key_create(kp,d) pthread_keycreate(kp,d)
+#define xthread_key_delete(k) 0
+#define xthread_get_specific(k,vp) pthread_getspecific(k,vp)
+#define xthread_fork(func,closure) { pthread_t _tmpxthr; \
+ pthread_create(&_tmpxthr,pthread_attr_default,func,closure); }
+#define xmutex_init(m) pthread_mutex_init(m, pthread_mutexattr_default)
+#define xcondition_init(c) pthread_cond_init(c, pthread_condattr_default)
+#endif /* XPRE_STANDARD_API */
+#define xcondition_clear(c) pthread_cond_destroy(c)
+#define xcondition_wait(c,m) pthread_cond_wait(c,m)
+#define xcondition_signal(c) pthread_cond_signal(c)
+#define xcondition_broadcast(c) pthread_cond_broadcast(c)
+#if defined(_DECTHREADS_)
+static xthread_t _X_no_thread_id;
+#define xthread_have_id(id) !pthread_equal(id, _X_no_thread_id)
+#define xthread_clear_id(id) id = _X_no_thread_id
+#define xthread_equal(id1,id2) pthread_equal(id1, id2)
+#endif /* _DECTHREADS_ */
+#if defined(__linux__)
+#define xthread_have_id(id) !pthread_equal(id, 0)
+#define xthread_clear_id(id) id = 0
+#define xthread_equal(id1,id2) pthread_equal(id1, id2)
+#endif /* linux */
+#if defined(_CMA_VENDOR_) && defined(_CMA__IBM) && (_CMA_VENDOR_ == _CMA__IBM)
+#ifdef DEBUG /* too much of a hack to enable normally */
+/* see also cma__obj_set_name() */
+#define xmutex_set_name(m,str) ((char**)(m)->field1)[5] = (str)
+#define xcondition_set_name(cv,str) ((char**)(cv)->field1)[5] = (str)
+#endif /* DEBUG */
+#endif /* _CMA_VENDOR_ == _CMA__IBM */
+#endif /* USE_NBSD_THREADLIB */
+#endif /* USE_TIS_SUPPORT */
+#endif /* WIN32 */
+#endif /* SVR4 */
+#endif /* CTHREADS */
+typedef xcondition_rec *xcondition_t;
+typedef xmutex_rec *xmutex_t;
+#ifndef xcondition_malloc
+#define xcondition_malloc() (xcondition_t)xmalloc(sizeof(xcondition_rec))
+#endif
+#ifndef xcondition_free
+#define xcondition_free(c) xfree((char *)c)
+#endif
+#ifndef xmutex_malloc
+#define xmutex_malloc() (xmutex_t)xmalloc(sizeof(xmutex_rec))
+#endif
+#ifndef xmutex_free
+#define xmutex_free(m) xfree((char *)m)
+#endif
+#ifndef xthread_have_id
+#define xthread_have_id(id) id
+#endif
+#ifndef xthread_clear_id
+#define xthread_clear_id(id) id = 0
+#endif
+#ifndef xthread_equal
+#define xthread_equal(id1,id2) ((id1) == (id2))
+#endif
+/* aids understood by some debuggers */
+#ifndef xthread_set_name
+#define xthread_set_name(t,str)
+#endif
+#ifndef xmutex_set_name
+#define xmutex_set_name(m,str)
+#endif
+#ifndef xcondition_set_name
+#define xcondition_set_name(cv,str)
+#endif
+
+#endif /* _XTHREADS_H_ */
diff --git a/sysroot/usr/include/X11/Xutil.h b/sysroot/usr/include/X11/Xutil.h
new file mode 100644
index 0000000..9f2ef63
--- /dev/null
+++ b/sysroot/usr/include/X11/Xutil.h
@@ -0,0 +1,828 @@
+/* $Xorg: Xutil.h,v 1.8 2001/02/09 02:03:39 xorgcvs Exp $ */
+
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************/
+/* $XFree86: xc/lib/X11/Xutil.h,v 3.6 2003/04/13 19:22:20 dawes Exp $ */
+
+#ifndef _XUTIL_H_
+#define _XUTIL_H_
+
+/* You must include <X11/Xlib.h> before including this file */
+#include <X11/Xlib.h>
+#include <X11/keysym.h>
+
+/*
+ * Bitmask returned by XParseGeometry(). Each bit tells if the corresponding
+ * value (x, y, width, height) was found in the parsed string.
+ */
+#define NoValue 0x0000
+#define XValue 0x0001
+#define YValue 0x0002
+#define WidthValue 0x0004
+#define HeightValue 0x0008
+#define AllValues 0x000F
+#define XNegative 0x0010
+#define YNegative 0x0020
+
+/*
+ * new version containing base_width, base_height, and win_gravity fields;
+ * used with WM_NORMAL_HINTS.
+ */
+typedef struct {
+ long flags; /* marks which fields in this structure are defined */
+ int x, y; /* obsolete for new window mgrs, but clients */
+ int width, height; /* should set so old wm's don't mess up */
+ int min_width, min_height;
+ int max_width, max_height;
+ int width_inc, height_inc;
+ struct {
+ int x; /* numerator */
+ int y; /* denominator */
+ } min_aspect, max_aspect;
+ int base_width, base_height; /* added by ICCCM version 1 */
+ int win_gravity; /* added by ICCCM version 1 */
+} XSizeHints;
+
+/*
+ * The next block of definitions are for window manager properties that
+ * clients and applications use for communication.
+ */
+
+/* flags argument in size hints */
+#define USPosition (1L << 0) /* user specified x, y */
+#define USSize (1L << 1) /* user specified width, height */
+
+#define PPosition (1L << 2) /* program specified position */
+#define PSize (1L << 3) /* program specified size */
+#define PMinSize (1L << 4) /* program specified minimum size */
+#define PMaxSize (1L << 5) /* program specified maximum size */
+#define PResizeInc (1L << 6) /* program specified resize increments */
+#define PAspect (1L << 7) /* program specified min and max aspect ratios */
+#define PBaseSize (1L << 8) /* program specified base for incrementing */
+#define PWinGravity (1L << 9) /* program specified window gravity */
+
+/* obsolete */
+#define PAllHints (PPosition|PSize|PMinSize|PMaxSize|PResizeInc|PAspect)
+
+
+
+typedef struct {
+ long flags; /* marks which fields in this structure are defined */
+ Bool input; /* does this application rely on the window manager to
+ get keyboard input? */
+ int initial_state; /* see below */
+ Pixmap icon_pixmap; /* pixmap to be used as icon */
+ Window icon_window; /* window to be used as icon */
+ int icon_x, icon_y; /* initial position of icon */
+ Pixmap icon_mask; /* icon mask bitmap */
+ XID window_group; /* id of related window group */
+ /* this structure may be extended in the future */
+} XWMHints;
+
+/* definition for flags of XWMHints */
+
+#define InputHint (1L << 0)
+#define StateHint (1L << 1)
+#define IconPixmapHint (1L << 2)
+#define IconWindowHint (1L << 3)
+#define IconPositionHint (1L << 4)
+#define IconMaskHint (1L << 5)
+#define WindowGroupHint (1L << 6)
+#define AllHints (InputHint|StateHint|IconPixmapHint|IconWindowHint| \
+IconPositionHint|IconMaskHint|WindowGroupHint)
+#define XUrgencyHint (1L << 8)
+
+/* definitions for initial window state */
+#define WithdrawnState 0 /* for windows that are not mapped */
+#define NormalState 1 /* most applications want to start this way */
+#define IconicState 3 /* application wants to start as an icon */
+
+/*
+ * Obsolete states no longer defined by ICCCM
+ */
+#define DontCareState 0 /* don't know or care */
+#define ZoomState 2 /* application wants to start zoomed */
+#define InactiveState 4 /* application believes it is seldom used; */
+ /* some wm's may put it on inactive menu */
+
+
+/*
+ * new structure for manipulating TEXT properties; used with WM_NAME,
+ * WM_ICON_NAME, WM_CLIENT_MACHINE, and WM_COMMAND.
+ */
+typedef struct {
+ unsigned char *value; /* same as Property routines */
+ Atom encoding; /* prop type */
+ int format; /* prop data format: 8, 16, or 32 */
+ unsigned long nitems; /* number of data items in value */
+} XTextProperty;
+
+#define XNoMemory -1
+#define XLocaleNotSupported -2
+#define XConverterNotFound -3
+
+typedef enum {
+ XStringStyle, /* STRING */
+ XCompoundTextStyle, /* COMPOUND_TEXT */
+ XTextStyle, /* text in owner's encoding (current locale)*/
+ XStdICCTextStyle, /* STRING, else COMPOUND_TEXT */
+ /* The following is an XFree86 extension, introduced in November 2000 */
+ XUTF8StringStyle /* UTF8_STRING */
+} XICCEncodingStyle;
+
+typedef struct {
+ int min_width, min_height;
+ int max_width, max_height;
+ int width_inc, height_inc;
+} XIconSize;
+
+typedef struct {
+ char *res_name;
+ char *res_class;
+} XClassHint;
+
+#ifdef XUTIL_DEFINE_FUNCTIONS
+extern int XDestroyImage(
+ XImage *ximage);
+extern unsigned long XGetPixel(
+ XImage *ximage,
+ int x, int y);
+extern int XPutPixel(
+ XImage *ximage,
+ int x, int y,
+ unsigned long pixel);
+extern XImage *XSubImage(
+ XImage *ximage,
+ int x, int y,
+ unsigned int width, unsigned int height);
+extern int XAddPixel(
+ XImage *ximage,
+ long value);
+#else
+/*
+ * These macros are used to give some sugar to the image routines so that
+ * naive people are more comfortable with them.
+ */
+#define XDestroyImage(ximage) \
+ ((*((ximage)->f.destroy_image))((ximage)))
+#define XGetPixel(ximage, x, y) \
+ ((*((ximage)->f.get_pixel))((ximage), (x), (y)))
+#define XPutPixel(ximage, x, y, pixel) \
+ ((*((ximage)->f.put_pixel))((ximage), (x), (y), (pixel)))
+#define XSubImage(ximage, x, y, width, height) \
+ ((*((ximage)->f.sub_image))((ximage), (x), (y), (width), (height)))
+#define XAddPixel(ximage, value) \
+ ((*((ximage)->f.add_pixel))((ximage), (value)))
+#endif
+
+/*
+ * Compose sequence status structure, used in calling XLookupString.
+ */
+typedef struct _XComposeStatus {
+ XPointer compose_ptr; /* state table pointer */
+ int chars_matched; /* match state */
+} XComposeStatus;
+
+/*
+ * Keysym macros, used on Keysyms to test for classes of symbols
+ */
+#define IsKeypadKey(keysym) \
+ (((KeySym)(keysym) >= XK_KP_Space) && ((KeySym)(keysym) <= XK_KP_Equal))
+
+#define IsPrivateKeypadKey(keysym) \
+ (((KeySym)(keysym) >= 0x11000000) && ((KeySym)(keysym) <= 0x1100FFFF))
+
+#define IsCursorKey(keysym) \
+ (((KeySym)(keysym) >= XK_Home) && ((KeySym)(keysym) < XK_Select))
+
+#define IsPFKey(keysym) \
+ (((KeySym)(keysym) >= XK_KP_F1) && ((KeySym)(keysym) <= XK_KP_F4))
+
+#define IsFunctionKey(keysym) \
+ (((KeySym)(keysym) >= XK_F1) && ((KeySym)(keysym) <= XK_F35))
+
+#define IsMiscFunctionKey(keysym) \
+ (((KeySym)(keysym) >= XK_Select) && ((KeySym)(keysym) <= XK_Break))
+
+#ifdef XK_XKB_KEYS
+#define IsModifierKey(keysym) \
+ ((((KeySym)(keysym) >= XK_Shift_L) && ((KeySym)(keysym) <= XK_Hyper_R)) \
+ || (((KeySym)(keysym) >= XK_ISO_Lock) && \
+ ((KeySym)(keysym) <= XK_ISO_Last_Group_Lock)) \
+ || ((KeySym)(keysym) == XK_Mode_switch) \
+ || ((KeySym)(keysym) == XK_Num_Lock))
+#else
+#define IsModifierKey(keysym) \
+ ((((KeySym)(keysym) >= XK_Shift_L) && ((KeySym)(keysym) <= XK_Hyper_R)) \
+ || ((KeySym)(keysym) == XK_Mode_switch) \
+ || ((KeySym)(keysym) == XK_Num_Lock))
+#endif
+/*
+ * opaque reference to Region data type
+ */
+typedef struct _XRegion *Region;
+
+/* Return values from XRectInRegion() */
+
+#define RectangleOut 0
+#define RectangleIn 1
+#define RectanglePart 2
+
+
+/*
+ * Information used by the visual utility routines to find desired visual
+ * type from the many visuals a display may support.
+ */
+
+typedef struct {
+ Visual *visual;
+ VisualID visualid;
+ int screen;
+ int depth;
+#if defined(__cplusplus) || defined(c_plusplus)
+ int c_class; /* C++ */
+#else
+ int class;
+#endif
+ unsigned long red_mask;
+ unsigned long green_mask;
+ unsigned long blue_mask;
+ int colormap_size;
+ int bits_per_rgb;
+} XVisualInfo;
+
+#define VisualNoMask 0x0
+#define VisualIDMask 0x1
+#define VisualScreenMask 0x2
+#define VisualDepthMask 0x4
+#define VisualClassMask 0x8
+#define VisualRedMaskMask 0x10
+#define VisualGreenMaskMask 0x20
+#define VisualBlueMaskMask 0x40
+#define VisualColormapSizeMask 0x80
+#define VisualBitsPerRGBMask 0x100
+#define VisualAllMask 0x1FF
+
+/*
+ * This defines a window manager property that clients may use to
+ * share standard color maps of type RGB_COLOR_MAP:
+ */
+typedef struct {
+ Colormap colormap;
+ unsigned long red_max;
+ unsigned long red_mult;
+ unsigned long green_max;
+ unsigned long green_mult;
+ unsigned long blue_max;
+ unsigned long blue_mult;
+ unsigned long base_pixel;
+ VisualID visualid; /* added by ICCCM version 1 */
+ XID killid; /* added by ICCCM version 1 */
+} XStandardColormap;
+
+#define ReleaseByFreeingColormap ((XID) 1L) /* for killid field above */
+
+
+/*
+ * return codes for XReadBitmapFile and XWriteBitmapFile
+ */
+#define BitmapSuccess 0
+#define BitmapOpenFailed 1
+#define BitmapFileInvalid 2
+#define BitmapNoMemory 3
+
+/****************************************************************
+ *
+ * Context Management
+ *
+ ****************************************************************/
+
+
+/* Associative lookup table return codes */
+
+#define XCSUCCESS 0 /* No error. */
+#define XCNOMEM 1 /* Out of memory */
+#define XCNOENT 2 /* No entry in table */
+
+typedef int XContext;
+
+#define XUniqueContext() ((XContext) XrmUniqueQuark())
+#define XStringToContext(string) ((XContext) XrmStringToQuark(string))
+
+_XFUNCPROTOBEGIN
+
+/* The following declarations are alphabetized. */
+
+extern XClassHint *XAllocClassHint (
+ void
+);
+
+extern XIconSize *XAllocIconSize (
+ void
+);
+
+extern XSizeHints *XAllocSizeHints (
+ void
+);
+
+extern XStandardColormap *XAllocStandardColormap (
+ void
+);
+
+extern XWMHints *XAllocWMHints (
+ void
+);
+
+extern int XClipBox(
+ Region /* r */,
+ XRectangle* /* rect_return */
+);
+
+extern Region XCreateRegion(
+ void
+);
+
+extern const char *XDefaultString (void);
+
+extern int XDeleteContext(
+ Display* /* display */,
+ XID /* rid */,
+ XContext /* context */
+);
+
+extern int XDestroyRegion(
+ Region /* r */
+);
+
+extern int XEmptyRegion(
+ Region /* r */
+);
+
+extern int XEqualRegion(
+ Region /* r1 */,
+ Region /* r2 */
+);
+
+extern int XFindContext(
+ Display* /* display */,
+ XID /* rid */,
+ XContext /* context */,
+ XPointer* /* data_return */
+);
+
+extern Status XGetClassHint(
+ Display* /* display */,
+ Window /* w */,
+ XClassHint* /* class_hints_return */
+);
+
+extern Status XGetIconSizes(
+ Display* /* display */,
+ Window /* w */,
+ XIconSize** /* size_list_return */,
+ int* /* count_return */
+);
+
+extern Status XGetNormalHints(
+ Display* /* display */,
+ Window /* w */,
+ XSizeHints* /* hints_return */
+);
+
+extern Status XGetRGBColormaps(
+ Display* /* display */,
+ Window /* w */,
+ XStandardColormap** /* stdcmap_return */,
+ int* /* count_return */,
+ Atom /* property */
+);
+
+extern Status XGetSizeHints(
+ Display* /* display */,
+ Window /* w */,
+ XSizeHints* /* hints_return */,
+ Atom /* property */
+);
+
+extern Status XGetStandardColormap(
+ Display* /* display */,
+ Window /* w */,
+ XStandardColormap* /* colormap_return */,
+ Atom /* property */
+);
+
+extern Status XGetTextProperty(
+ Display* /* display */,
+ Window /* window */,
+ XTextProperty* /* text_prop_return */,
+ Atom /* property */
+);
+
+extern XVisualInfo *XGetVisualInfo(
+ Display* /* display */,
+ long /* vinfo_mask */,
+ XVisualInfo* /* vinfo_template */,
+ int* /* nitems_return */
+);
+
+extern Status XGetWMClientMachine(
+ Display* /* display */,
+ Window /* w */,
+ XTextProperty* /* text_prop_return */
+);
+
+extern XWMHints *XGetWMHints(
+ Display* /* display */,
+ Window /* w */
+);
+
+extern Status XGetWMIconName(
+ Display* /* display */,
+ Window /* w */,
+ XTextProperty* /* text_prop_return */
+);
+
+extern Status XGetWMName(
+ Display* /* display */,
+ Window /* w */,
+ XTextProperty* /* text_prop_return */
+);
+
+extern Status XGetWMNormalHints(
+ Display* /* display */,
+ Window /* w */,
+ XSizeHints* /* hints_return */,
+ long* /* supplied_return */
+);
+
+extern Status XGetWMSizeHints(
+ Display* /* display */,
+ Window /* w */,
+ XSizeHints* /* hints_return */,
+ long* /* supplied_return */,
+ Atom /* property */
+);
+
+extern Status XGetZoomHints(
+ Display* /* display */,
+ Window /* w */,
+ XSizeHints* /* zhints_return */
+);
+
+extern int XIntersectRegion(
+ Region /* sra */,
+ Region /* srb */,
+ Region /* dr_return */
+);
+
+extern void XConvertCase(
+ KeySym /* sym */,
+ KeySym* /* lower */,
+ KeySym* /* upper */
+);
+
+extern int XLookupString(
+ XKeyEvent* /* event_struct */,
+ char* /* buffer_return */,
+ int /* bytes_buffer */,
+ KeySym* /* keysym_return */,
+ XComposeStatus* /* status_in_out */
+);
+
+extern Status XMatchVisualInfo(
+ Display* /* display */,
+ int /* screen */,
+ int /* depth */,
+ int /* class */,
+ XVisualInfo* /* vinfo_return */
+);
+
+extern int XOffsetRegion(
+ Region /* r */,
+ int /* dx */,
+ int /* dy */
+);
+
+extern Bool XPointInRegion(
+ Region /* r */,
+ int /* x */,
+ int /* y */
+);
+
+extern Region XPolygonRegion(
+ XPoint* /* points */,
+ int /* n */,
+ int /* fill_rule */
+);
+
+extern int XRectInRegion(
+ Region /* r */,
+ int /* x */,
+ int /* y */,
+ unsigned int /* width */,
+ unsigned int /* height */
+);
+
+extern int XSaveContext(
+ Display* /* display */,
+ XID /* rid */,
+ XContext /* context */,
+ _Xconst char* /* data */
+);
+
+extern int XSetClassHint(
+ Display* /* display */,
+ Window /* w */,
+ XClassHint* /* class_hints */
+);
+
+extern int XSetIconSizes(
+ Display* /* display */,
+ Window /* w */,
+ XIconSize* /* size_list */,
+ int /* count */
+);
+
+extern int XSetNormalHints(
+ Display* /* display */,
+ Window /* w */,
+ XSizeHints* /* hints */
+);
+
+extern void XSetRGBColormaps(
+ Display* /* display */,
+ Window /* w */,
+ XStandardColormap* /* stdcmaps */,
+ int /* count */,
+ Atom /* property */
+);
+
+extern int XSetSizeHints(
+ Display* /* display */,
+ Window /* w */,
+ XSizeHints* /* hints */,
+ Atom /* property */
+);
+
+extern int XSetStandardProperties(
+ Display* /* display */,
+ Window /* w */,
+ _Xconst char* /* window_name */,
+ _Xconst char* /* icon_name */,
+ Pixmap /* icon_pixmap */,
+ char** /* argv */,
+ int /* argc */,
+ XSizeHints* /* hints */
+);
+
+extern void XSetTextProperty(
+ Display* /* display */,
+ Window /* w */,
+ XTextProperty* /* text_prop */,
+ Atom /* property */
+);
+
+extern void XSetWMClientMachine(
+ Display* /* display */,
+ Window /* w */,
+ XTextProperty* /* text_prop */
+);
+
+extern int XSetWMHints(
+ Display* /* display */,
+ Window /* w */,
+ XWMHints* /* wm_hints */
+);
+
+extern void XSetWMIconName(
+ Display* /* display */,
+ Window /* w */,
+ XTextProperty* /* text_prop */
+);
+
+extern void XSetWMName(
+ Display* /* display */,
+ Window /* w */,
+ XTextProperty* /* text_prop */
+);
+
+extern void XSetWMNormalHints(
+ Display* /* display */,
+ Window /* w */,
+ XSizeHints* /* hints */
+);
+
+extern void XSetWMProperties(
+ Display* /* display */,
+ Window /* w */,
+ XTextProperty* /* window_name */,
+ XTextProperty* /* icon_name */,
+ char** /* argv */,
+ int /* argc */,
+ XSizeHints* /* normal_hints */,
+ XWMHints* /* wm_hints */,
+ XClassHint* /* class_hints */
+);
+
+extern void XmbSetWMProperties(
+ Display* /* display */,
+ Window /* w */,
+ _Xconst char* /* window_name */,
+ _Xconst char* /* icon_name */,
+ char** /* argv */,
+ int /* argc */,
+ XSizeHints* /* normal_hints */,
+ XWMHints* /* wm_hints */,
+ XClassHint* /* class_hints */
+);
+
+extern void Xutf8SetWMProperties(
+ Display* /* display */,
+ Window /* w */,
+ _Xconst char* /* window_name */,
+ _Xconst char* /* icon_name */,
+ char** /* argv */,
+ int /* argc */,
+ XSizeHints* /* normal_hints */,
+ XWMHints* /* wm_hints */,
+ XClassHint* /* class_hints */
+);
+
+extern void XSetWMSizeHints(
+ Display* /* display */,
+ Window /* w */,
+ XSizeHints* /* hints */,
+ Atom /* property */
+);
+
+extern int XSetRegion(
+ Display* /* display */,
+ GC /* gc */,
+ Region /* r */
+);
+
+extern void XSetStandardColormap(
+ Display* /* display */,
+ Window /* w */,
+ XStandardColormap* /* colormap */,
+ Atom /* property */
+);
+
+extern int XSetZoomHints(
+ Display* /* display */,
+ Window /* w */,
+ XSizeHints* /* zhints */
+);
+
+extern int XShrinkRegion(
+ Region /* r */,
+ int /* dx */,
+ int /* dy */
+);
+
+extern Status XStringListToTextProperty(
+ char** /* list */,
+ int /* count */,
+ XTextProperty* /* text_prop_return */
+);
+
+extern int XSubtractRegion(
+ Region /* sra */,
+ Region /* srb */,
+ Region /* dr_return */
+);
+
+extern int XmbTextListToTextProperty(
+ Display* display,
+ char** list,
+ int count,
+ XICCEncodingStyle style,
+ XTextProperty* text_prop_return
+);
+
+extern int XwcTextListToTextProperty(
+ Display* display,
+ wchar_t** list,
+ int count,
+ XICCEncodingStyle style,
+ XTextProperty* text_prop_return
+);
+
+extern int Xutf8TextListToTextProperty(
+ Display* display,
+ char** list,
+ int count,
+ XICCEncodingStyle style,
+ XTextProperty* text_prop_return
+);
+
+extern void XwcFreeStringList(
+ wchar_t** list
+);
+
+extern Status XTextPropertyToStringList(
+ XTextProperty* /* text_prop */,
+ char*** /* list_return */,
+ int* /* count_return */
+);
+
+extern int XmbTextPropertyToTextList(
+ Display* display,
+ const XTextProperty* text_prop,
+ char*** list_return,
+ int* count_return
+);
+
+extern int XwcTextPropertyToTextList(
+ Display* display,
+ const XTextProperty* text_prop,
+ wchar_t*** list_return,
+ int* count_return
+);
+
+extern int Xutf8TextPropertyToTextList(
+ Display* display,
+ const XTextProperty* text_prop,
+ char*** list_return,
+ int* count_return
+);
+
+extern int XUnionRectWithRegion(
+ XRectangle* /* rectangle */,
+ Region /* src_region */,
+ Region /* dest_region_return */
+);
+
+extern int XUnionRegion(
+ Region /* sra */,
+ Region /* srb */,
+ Region /* dr_return */
+);
+
+extern int XWMGeometry(
+ Display* /* display */,
+ int /* screen_number */,
+ _Xconst char* /* user_geometry */,
+ _Xconst char* /* default_geometry */,
+ unsigned int /* border_width */,
+ XSizeHints* /* hints */,
+ int* /* x_return */,
+ int* /* y_return */,
+ int* /* width_return */,
+ int* /* height_return */,
+ int* /* gravity_return */
+);
+
+extern int XXorRegion(
+ Region /* sra */,
+ Region /* srb */,
+ Region /* dr_return */
+);
+
+_XFUNCPROTOEND
+
+#endif /* _XUTIL_H_ */
diff --git a/sysroot/usr/include/X11/Xw32defs.h b/sysroot/usr/include/X11/Xw32defs.h
new file mode 100644
index 0000000..07624fe
--- /dev/null
+++ b/sysroot/usr/include/X11/Xw32defs.h
@@ -0,0 +1,81 @@
+/* $Xorg: Xw32defs.h,v 1.3 2000/08/18 04:05:44 coskrey Exp $ */
+
+#ifndef _XW32DEFS_H
+#define _XW32DEFS_H
+
+#ifdef __GNUC__ /* mingw is more close to unix than msvc */
+#if !defined(__daddr_t_defined)
+typedef char *caddr_t;
+#endif
+#define lstat stat
+
+#else
+typedef char *caddr_t;
+
+#define access _access
+#define alloca _alloca
+#define chdir _chdir
+#define chmod _chmod
+#define close _close
+#define creat _creat
+#define dup _dup
+#define dup2 _dup2
+#define environ _environ
+#define execl _execl
+#define execle _execle
+#define execlp _execlp
+#define execlpe _execlpe
+#define execv _execv
+#define execve _execve
+#define execvp _execvp
+#define execvpe _execvpe
+#define fdopen _fdopen
+#define fileno _fileno
+#define fstat _fstat
+#define getcwd _getcwd
+#define getpid _getpid
+#define hypot _hypot
+#define isascii __isascii
+#define isatty _isatty
+#define lseek _lseek
+#define mkdir _mkdir
+#define mktemp _mktemp
+#define open _open
+#define putenv _putenv
+#define read _read
+#define rmdir _rmdir
+#define sleep(x) _sleep((x) * 1000)
+#define stat _stat
+#define sys_errlist _sys_errlist
+#define sys_nerr _sys_nerr
+#define umask _umask
+#define unlink _unlink
+#define write _write
+#define random rand
+#define srandom srand
+
+#define O_RDONLY _O_RDONLY
+#define O_WRONLY _O_WRONLY
+#define O_RDWR _O_RDWR
+#define O_APPEND _O_APPEND
+#define O_CREAT _O_CREAT
+#define O_TRUNC _O_TRUNC
+#define O_EXCL _O_EXCL
+#define O_TEXT _O_TEXT
+#define O_BINARY _O_BINARY
+#define O_RAW _O_BINARY
+
+#define S_IFMT _S_IFMT
+#define S_IFDIR _S_IFDIR
+#define S_IFCHR _S_IFCHR
+#define S_IFREG _S_IFREG
+#define S_IREAD _S_IREAD
+#define S_IWRITE _S_IWRITE
+#define S_IEXEC _S_IEXEC
+
+#define F_OK 0
+#define X_OK 1
+#define W_OK 2
+#define R_OK 4
+#endif /* __GNUC__ */
+#endif
diff --git a/sysroot/usr/include/X11/Xwindows.h b/sysroot/usr/include/X11/Xwindows.h
new file mode 100644
index 0000000..7fb9840
--- /dev/null
+++ b/sysroot/usr/include/X11/Xwindows.h
@@ -0,0 +1,80 @@
+/* $Xorg$ */
+/*
+
+Copyright 1996, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
+ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABIL-
+ITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization from
+The Open Group.
+
+*/
+
+/*
+ * This header file has for sole purpose to allow to include windows.h
+ * without getting any name conflicts with our code.
+ * Conflicts come from the fact that including windows.h actually pulls
+ * in the whole Windows API...
+ */
+
+#undef _XFree86Server
+#ifdef XFree86Server
+#define _XFree86Server
+#undef XFree86Server
+#endif
+
+#define BOOL wBOOL
+#define INT32 wINT32
+#undef Status
+#define Status wStatus
+#define ATOM wATOM
+#define BYTE wBYTE
+#define FreeResource wFreeResource
+#include <windows.h>
+#undef Status
+#define Status int
+#undef BYTE
+#undef BOOL
+#undef INT32
+#undef ATOM
+#undef FreeResource
+#undef CreateWindowA
+#undef min
+#undef max
+
+#ifdef RESOURCE_H
+#undef RT_FONT
+#undef RT_CURSOR
+#define RT_FONT ((RESTYPE)4)
+#define RT_CURSOR ((RESTYPE)5)
+#endif
+
+#define sleep(x) Sleep(1000*x)
+
+#if defined(WIN32) && (!defined(PATH_MAX) || PATH_MAX < 1024)
+#undef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
+#ifdef _XFree86Server
+#define XFree86Server
+#undef _XFree86Server
+#endif
+
diff --git a/sysroot/usr/include/X11/Xwinsock.h b/sysroot/usr/include/X11/Xwinsock.h
new file mode 100644
index 0000000..0278c09
--- /dev/null
+++ b/sysroot/usr/include/X11/Xwinsock.h
@@ -0,0 +1,66 @@
+/* $Xorg: Xwinsock.h,v 1.4 2001/02/09 02:03:23 xorgcvs Exp $ */
+/*
+
+Copyright 1996, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
+ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABIL-
+ITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization from
+The Open Group.
+
+*/
+
+/*
+ * This header file has for sole purpose to allow to include winsock.h
+ * without getting any name conflicts with our code.
+ * Conflicts come from the fact that including winsock.h actually pulls
+ * in the whole Windows API...
+ */
+
+#undef _XFree86Server
+#ifdef XFree86Server
+#define _XFree86Server
+#undef XFree86Server
+#endif
+
+#define BOOL wBOOL
+#define INT32 wINT32
+#undef Status
+#define Status wStatus
+#define ATOM wATOM
+#define BYTE wBYTE
+#define FreeResource wFreeResource
+#include <winsock.h>
+#undef Status
+#define Status int
+#undef BYTE
+#undef BOOL
+#undef INT32
+#undef ATOM
+#undef FreeResource
+#undef CreateWindowA
+#undef RT_FONT
+#undef RT_CURSOR
+
+#ifdef _XFree86Server
+#define XFree86Server
+#undef _XFree86Server
+#endif
+
diff --git a/sysroot/usr/include/X11/ap_keysym.h b/sysroot/usr/include/X11/ap_keysym.h
new file mode 100644
index 0000000..9a11971
--- /dev/null
+++ b/sysroot/usr/include/X11/ap_keysym.h
@@ -0,0 +1,51 @@
+/******************************************************************
+Copyright 1987 by Apollo Computer Inc., Chelmsford, Massachusetts.
+Copyright 1989 by Hewlett-Packard Company.
+
+ All Rights Reserved
+
+Permission to use, duplicate, change, and distribute this software and
+its documentation for any purpose and without fee is granted, provided
+that the above copyright notice appear in such copy and that this
+copyright notice appear in all supporting documentation, and that the
+names of Apollo Computer Inc., the Hewlett-Packard Company, or the X
+Consortium not be used in advertising or publicity pertaining to
+distribution of the software without written prior permission.
+
+HEWLETT-PACKARD MAKES NO WARRANTY OF ANY KIND WITH REGARD
+TO THIS SOFWARE, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. Hewlett-Packard shall not be liable for errors
+contained herein or direct, indirect, special, incidental or
+consequential damages in connection with the furnishing,
+performance, or use of this material.
+
+This software is not subject to any license of the American
+Telephone and Telegraph Company or of the Regents of the
+University of California.
+******************************************************************/
+
+#define apXK_LineDel 0x1000FF00
+#define apXK_CharDel 0x1000FF01
+#define apXK_Copy 0x1000FF02
+#define apXK_Cut 0x1000FF03
+#define apXK_Paste 0x1000FF04
+#define apXK_Move 0x1000FF05
+#define apXK_Grow 0x1000FF06
+#define apXK_Cmd 0x1000FF07
+#define apXK_Shell 0x1000FF08
+#define apXK_LeftBar 0x1000FF09
+#define apXK_RightBar 0x1000FF0A
+#define apXK_LeftBox 0x1000FF0B
+#define apXK_RightBox 0x1000FF0C
+#define apXK_UpBox 0x1000FF0D
+#define apXK_DownBox 0x1000FF0E
+#define apXK_Pop 0x1000FF0F
+#define apXK_Read 0x1000FF10
+#define apXK_Edit 0x1000FF11
+#define apXK_Save 0x1000FF12
+#define apXK_Exit 0x1000FF13
+#define apXK_Repeat 0x1000FF14
+
+#define apXK_KP_parenleft 0x1000FFA8
+#define apXK_KP_parenright 0x1000FFA9
diff --git a/sysroot/usr/include/X11/cursorfont.h b/sysroot/usr/include/X11/cursorfont.h
new file mode 100644
index 0000000..c6204f1
--- /dev/null
+++ b/sysroot/usr/include/X11/cursorfont.h
@@ -0,0 +1,107 @@
+/* $Xorg: cursorfont.h,v 1.4 2001/02/09 02:03:39 xorgcvs Exp $ */
+/*
+
+Copyright 1987, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from The Open Group.
+
+*/
+
+#define XC_num_glyphs 154
+#define XC_X_cursor 0
+#define XC_arrow 2
+#define XC_based_arrow_down 4
+#define XC_based_arrow_up 6
+#define XC_boat 8
+#define XC_bogosity 10
+#define XC_bottom_left_corner 12
+#define XC_bottom_right_corner 14
+#define XC_bottom_side 16
+#define XC_bottom_tee 18
+#define XC_box_spiral 20
+#define XC_center_ptr 22
+#define XC_circle 24
+#define XC_clock 26
+#define XC_coffee_mug 28
+#define XC_cross 30
+#define XC_cross_reverse 32
+#define XC_crosshair 34
+#define XC_diamond_cross 36
+#define XC_dot 38
+#define XC_dotbox 40
+#define XC_double_arrow 42
+#define XC_draft_large 44
+#define XC_draft_small 46
+#define XC_draped_box 48
+#define XC_exchange 50
+#define XC_fleur 52
+#define XC_gobbler 54
+#define XC_gumby 56
+#define XC_hand1 58
+#define XC_hand2 60
+#define XC_heart 62
+#define XC_icon 64
+#define XC_iron_cross 66
+#define XC_left_ptr 68
+#define XC_left_side 70
+#define XC_left_tee 72
+#define XC_leftbutton 74
+#define XC_ll_angle 76
+#define XC_lr_angle 78
+#define XC_man 80
+#define XC_middlebutton 82
+#define XC_mouse 84
+#define XC_pencil 86
+#define XC_pirate 88
+#define XC_plus 90
+#define XC_question_arrow 92
+#define XC_right_ptr 94
+#define XC_right_side 96
+#define XC_right_tee 98
+#define XC_rightbutton 100
+#define XC_rtl_logo 102
+#define XC_sailboat 104
+#define XC_sb_down_arrow 106
+#define XC_sb_h_double_arrow 108
+#define XC_sb_left_arrow 110
+#define XC_sb_right_arrow 112
+#define XC_sb_up_arrow 114
+#define XC_sb_v_double_arrow 116
+#define XC_shuttle 118
+#define XC_sizing 120
+#define XC_spider 122
+#define XC_spraycan 124
+#define XC_star 126
+#define XC_target 128
+#define XC_tcross 130
+#define XC_top_left_arrow 132
+#define XC_top_left_corner 134
+#define XC_top_right_corner 136
+#define XC_top_side 138
+#define XC_top_tee 140
+#define XC_trek 142
+#define XC_ul_angle 144
+#define XC_umbrella 146
+#define XC_ur_angle 148
+#define XC_watch 150
+#define XC_xterm 152
diff --git a/sysroot/usr/include/X11/extensions/MITMisc.h b/sysroot/usr/include/X11/extensions/MITMisc.h
new file mode 100644
index 0000000..975700e
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/MITMisc.h
@@ -0,0 +1,66 @@
+/************************************************************
+
+Copyright 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+********************************************************/
+
+/* RANDOM CRUFT! THIS HAS NO OFFICIAL X CONSORTIUM OR X PROJECT TEAM BLESSING */
+
+/* $Xorg: MITMisc.h,v 1.4 2001/02/09 02:03:23 xorgcvs Exp $ */
+
+#ifndef _XMITMISC_H_
+#define _XMITMISC_H_
+
+#include <X11/Xfuncproto.h>
+
+#define X_MITSetBugMode 0
+#define X_MITGetBugMode 1
+
+#define MITMiscNumberEvents 0
+
+#define MITMiscNumberErrors 0
+
+#ifndef _MITMISC_SERVER_
+
+_XFUNCPROTOBEGIN
+
+Bool XMITMiscQueryExtension(
+ Display* /* dpy */,
+ int* /* event_basep */,
+ int* /* error_basep */
+);
+
+Status XMITMiscSetBugMode(
+ Display* /* dpy */,
+ Bool /* onOff */
+);
+
+Bool XMITMiscGetBugMode(
+ Display* /* dpy */
+);
+
+_XFUNCPROTOEND
+
+#endif
+
+#endif
diff --git a/sysroot/usr/include/X11/extensions/XEVI.h b/sysroot/usr/include/X11/extensions/XEVI.h
new file mode 100644
index 0000000..d8e37ff
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/XEVI.h
@@ -0,0 +1,64 @@
+/* $Xorg: XEVI.h,v 1.3 2000/08/18 04:05:44 coskrey Exp $ */
+/************************************************************
+Copyright (c) 1997 by Silicon Graphics Computer Systems, Inc.
+Permission to use, copy, modify, and distribute this
+software and its documentation for any purpose and without
+fee is hereby granted, provided that the above copyright
+notice appear in all copies and that both that copyright
+notice and this permission notice appear in supporting
+documentation, and that the name of Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
+of the software without specific prior written permission.
+Silicon Graphics makes no representation about the suitability
+of this software for any purpose. It is provided "as is"
+without any express or implied warranty.
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
+THE USE OR PERFORMANCE OF THIS SOFTWARE.
+********************************************************/
+/* $XFree86$ */
+
+#ifndef _XEVI_H_
+#define _XEVI_H_
+#include <X11/Xfuncproto.h>
+#define X_EVIQueryVersion 0
+#define X_EVIGetVisualInfo 1
+#define XEVI_TRANSPARENCY_NONE 0
+#define XEVI_TRANSPARENCY_PIXEL 1
+#define XEVI_TRANSPARENCY_MASK 2
+#ifndef _XEVI_SERVER_
+typedef struct {
+ VisualID core_visual_id;
+ int screen;
+ int level;
+ unsigned int transparency_type;
+ unsigned int transparency_value;
+ unsigned int min_hw_colormaps;
+ unsigned int max_hw_colormaps;
+ unsigned int num_colormap_conflicts;
+ VisualID* colormap_conflicts;
+} ExtendedVisualInfo;
+_XFUNCPROTOBEGIN
+Bool XeviQueryExtension(
+ Display* /* dpy */
+);
+Status XeviQueryVersion(
+ Display* /* dpy */,
+ int* /* majorVersion */,
+ int* /* minorVersion */
+);
+Status XeviGetVisualInfo(
+ Display* /* dpy */,
+ VisualID* /* visual_query */,
+ int /* nVisual_query */,
+ ExtendedVisualInfo** /* extendedVisualInfo_return */,
+ int* /* nInfo_return */
+);
+_XFUNCPROTOEND
+#endif
+#endif
diff --git a/sysroot/usr/include/X11/extensions/XEVIstr.h b/sysroot/usr/include/X11/extensions/XEVIstr.h
new file mode 100644
index 0000000..388ef4b
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/XEVIstr.h
@@ -0,0 +1,98 @@
+/* $Xorg: XEVIstr.h,v 1.3 2000/08/18 04:05:44 coskrey Exp $ */
+/************************************************************
+Copyright (c) 1997 by Silicon Graphics Computer Systems, Inc.
+Permission to use, copy, modify, and distribute this
+software and its documentation for any purpose and without
+fee is hereby granted, provided that the above copyright
+notice appear in all copies and that both that copyright
+notice and this permission notice appear in supporting
+documentation, and that the name of Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
+of the software without specific prior written permission.
+Silicon Graphics makes no representation about the suitability
+of this software for any purpose. It is provided "as is"
+without any express or implied warranty.
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
+THE USE OR PERFORMANCE OF THIS SOFTWARE.
+********************************************************/
+/* $XFree86$ */
+
+#ifndef _EVISTR_H_
+#define _EVISTR_H_
+
+#include <X11/extensions/XEVI.h>
+
+#define VisualID CARD32
+#define EVINAME "Extended-Visual-Information"
+#define XEVI_MAJOR_VERSION 1 /* current version numbers */
+#define XEVI_MINOR_VERSION 0
+
+typedef CARD32 VisualID32;
+#define sz_VisualID32 4
+
+typedef struct _xExtendedVisualInfo {
+ VisualID core_visual_id B32;
+ INT8 screen;
+ INT8 level;
+ CARD8 transparency_type;
+ CARD8 pad0;
+ CARD32 transparency_value B32;
+ CARD8 min_hw_colormaps;
+ CARD8 max_hw_colormaps;
+ CARD16 num_colormap_conflicts B16;
+} xExtendedVisualInfo;
+#define sz_xExtendedVisualInfo 16
+
+typedef struct _XEVIQueryVersion {
+ CARD8 reqType; /* always XEVIReqCode */
+ CARD8 xeviReqType; /* always X_EVIQueryVersion */
+ CARD16 length B16;
+} xEVIQueryVersionReq;
+#define sz_xEVIQueryVersionReq 4
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 majorVersion B16; /* major version of EVI protocol */
+ CARD16 minorVersion B16; /* minor version of EVI protocol */
+ CARD32 pad0 B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+} xEVIQueryVersionReply;
+#define sz_xEVIQueryVersionReply 32
+
+typedef struct _XEVIGetVisualInfoReq {
+ CARD8 reqType; /* always XEVIReqCode */
+ CARD8 xeviReqType; /* always X_EVIGetVisualInfo */
+ CARD16 length B16;
+ CARD32 n_visual B32;
+} xEVIGetVisualInfoReq;
+#define sz_xEVIGetVisualInfoReq 8
+
+typedef struct _XEVIGetVisualInfoReply {
+ BYTE type; /* X_Reply */
+ CARD8 unused;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 n_info B32;
+ CARD32 n_conflicts B32;
+ CARD32 pad0 B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+} xEVIGetVisualInfoReply;
+#define sz_xEVIGetVisualInfoReply 32
+
+#undef VisualID
+
+#endif /* _EVISTR_H_ */
diff --git a/sysroot/usr/include/X11/extensions/XI.h b/sysroot/usr/include/X11/extensions/XI.h
new file mode 100644
index 0000000..ae52292
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/XI.h
@@ -0,0 +1,287 @@
+/* $Xorg: XI.h,v 1.4 2001/02/09 02:03:23 xorgcvs Exp $ */
+
+/************************************************************
+
+Copyright 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Hewlett-Packard not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+********************************************************/
+/* $XFree86: xc/include/extensions/XI.h,v 1.4 2001/01/17 17:53:16 dawes Exp $ */
+
+/* Definitions used by the server, library and client */
+
+#ifndef _XI_H_
+
+#define _XI_H_
+
+#define sz_xGetExtensionVersionReq 8
+#define sz_xGetExtensionVersionReply 32
+#define sz_xListInputDevicesReq 4
+#define sz_xListInputDevicesReply 32
+#define sz_xOpenDeviceReq 8
+#define sz_xOpenDeviceReply 32
+#define sz_xCloseDeviceReq 8
+#define sz_xSetDeviceModeReq 8
+#define sz_xSetDeviceModeReply 32
+#define sz_xSelectExtensionEventReq 12
+#define sz_xGetSelectedExtensionEventsReq 8
+#define sz_xGetSelectedExtensionEventsReply 32
+#define sz_xChangeDeviceDontPropagateListReq 12
+#define sz_xGetDeviceDontPropagateListReq 8
+#define sz_xGetDeviceDontPropagateListReply 32
+#define sz_xGetDeviceMotionEventsReq 16
+#define sz_xGetDeviceMotionEventsReply 32
+#define sz_xChangeKeyboardDeviceReq 8
+#define sz_xChangeKeyboardDeviceReply 32
+#define sz_xChangePointerDeviceReq 8
+#define sz_xChangePointerDeviceReply 32
+#define sz_xGrabDeviceReq 20
+#define sz_xGrabDeviceReply 32
+#define sz_xUngrabDeviceReq 12
+#define sz_xGrabDeviceKeyReq 20
+#define sz_xGrabDeviceKeyReply 32
+#define sz_xUngrabDeviceKeyReq 16
+#define sz_xGrabDeviceButtonReq 20
+#define sz_xGrabDeviceButtonReply 32
+#define sz_xUngrabDeviceButtonReq 16
+#define sz_xAllowDeviceEventsReq 12
+#define sz_xGetDeviceFocusReq 8
+#define sz_xGetDeviceFocusReply 32
+#define sz_xSetDeviceFocusReq 16
+#define sz_xGetFeedbackControlReq 8
+#define sz_xGetFeedbackControlReply 32
+#define sz_xChangeFeedbackControlReq 12
+#define sz_xGetDeviceKeyMappingReq 8
+#define sz_xGetDeviceKeyMappingReply 32
+#define sz_xChangeDeviceKeyMappingReq 8
+#define sz_xGetDeviceModifierMappingReq 8
+#define sz_xSetDeviceModifierMappingReq 8
+#define sz_xSetDeviceModifierMappingReply 32
+#define sz_xGetDeviceButtonMappingReq 8
+#define sz_xGetDeviceButtonMappingReply 32
+#define sz_xSetDeviceButtonMappingReq 8
+#define sz_xSetDeviceButtonMappingReply 32
+#define sz_xQueryDeviceStateReq 8
+#define sz_xQueryDeviceStateReply 32
+#define sz_xSendExtensionEventReq 16
+#define sz_xDeviceBellReq 8
+#define sz_xSetDeviceValuatorsReq 8
+#define sz_xSetDeviceValuatorsReply 32
+#define sz_xGetDeviceControlReq 8
+#define sz_xGetDeviceControlReply 32
+#define sz_xChangeDeviceControlReq 8
+#define sz_xChangeDeviceControlReply 32
+
+#define INAME "XInputExtension"
+
+#define XI_KEYBOARD "KEYBOARD"
+#define XI_MOUSE "MOUSE"
+#define XI_TABLET "TABLET"
+#define XI_TOUCHSCREEN "TOUCHSCREEN"
+#define XI_TOUCHPAD "TOUCHPAD"
+#define XI_BARCODE "BARCODE"
+#define XI_BUTTONBOX "BUTTONBOX"
+#define XI_KNOB_BOX "KNOB_BOX"
+#define XI_ONE_KNOB "ONE_KNOB"
+#define XI_NINE_KNOB "NINE_KNOB"
+#define XI_TRACKBALL "TRACKBALL"
+#define XI_QUADRATURE "QUADRATURE"
+#define XI_ID_MODULE "ID_MODULE"
+#define XI_SPACEBALL "SPACEBALL"
+#define XI_DATAGLOVE "DATAGLOVE"
+#define XI_EYETRACKER "EYETRACKER"
+#define XI_CURSORKEYS "CURSORKEYS"
+#define XI_FOOTMOUSE "FOOTMOUSE"
+
+#define Dont_Check 0
+#define XInput_Initial_Release 1
+#define XInput_Add_XDeviceBell 2
+#define XInput_Add_XSetDeviceValuators 3
+#define XInput_Add_XChangeDeviceControl 4
+#define XInput_Add_DevicePresenceNotify 5
+
+#define XI_Absent 0
+#define XI_Present 1
+
+#define XI_Initial_Release_Major 1
+#define XI_Initial_Release_Minor 0
+
+#define XI_Add_XDeviceBell_Major 1
+#define XI_Add_XDeviceBell_Minor 1
+
+#define XI_Add_XSetDeviceValuators_Major 1
+#define XI_Add_XSetDeviceValuators_Minor 2
+
+#define XI_Add_XChangeDeviceControl_Major 1
+#define XI_Add_XChangeDeviceControl_Minor 3
+
+#define XI_Add_DevicePresenceNotify_Major 1
+#define XI_Add_DevicePresenceNotify_Minor 4
+
+#define DEVICE_RESOLUTION 1
+#define DEVICE_ABS_CALIB 2
+#define DEVICE_CORE 3
+#define DEVICE_ENABLE 4
+#define DEVICE_ABS_AREA 5
+
+#define NoSuchExtension 1
+
+#define COUNT 0
+#define CREATE 1
+
+#define NewPointer 0
+#define NewKeyboard 1
+
+#define XPOINTER 0
+#define XKEYBOARD 1
+
+#define UseXKeyboard 0xFF
+
+#define IsXPointer 0
+#define IsXKeyboard 1
+#define IsXExtensionDevice 2
+#define IsXExtensionKeyboard 3
+#define IsXExtensionPointer 4
+
+#define AsyncThisDevice 0
+#define SyncThisDevice 1
+#define ReplayThisDevice 2
+#define AsyncOtherDevices 3
+#define AsyncAll 4
+#define SyncAll 5
+
+#define FollowKeyboard 3
+#ifndef RevertToFollowKeyboard
+#define RevertToFollowKeyboard 3
+#endif
+
+#define DvAccelNum (1L << 0)
+#define DvAccelDenom (1L << 1)
+#define DvThreshold (1L << 2)
+
+#define DvKeyClickPercent (1L<<0)
+#define DvPercent (1L<<1)
+#define DvPitch (1L<<2)
+#define DvDuration (1L<<3)
+#define DvLed (1L<<4)
+#define DvLedMode (1L<<5)
+#define DvKey (1L<<6)
+#define DvAutoRepeatMode (1L<<7)
+
+#define DvString (1L << 0)
+
+#define DvInteger (1L << 0)
+
+#define DeviceMode (1L << 0)
+#define Relative 0
+#define Absolute 1
+
+#define ProximityState (1L << 1)
+#define InProximity (0L << 1)
+#define OutOfProximity (1L << 1)
+
+#define AddToList 0
+#define DeleteFromList 1
+
+#define KeyClass 0
+#define ButtonClass 1
+#define ValuatorClass 2
+#define FeedbackClass 3
+#define ProximityClass 4
+#define FocusClass 5
+#define OtherClass 6
+
+#define KbdFeedbackClass 0
+#define PtrFeedbackClass 1
+#define StringFeedbackClass 2
+#define IntegerFeedbackClass 3
+#define LedFeedbackClass 4
+#define BellFeedbackClass 5
+
+#define _devicePointerMotionHint 0
+#define _deviceButton1Motion 1
+#define _deviceButton2Motion 2
+#define _deviceButton3Motion 3
+#define _deviceButton4Motion 4
+#define _deviceButton5Motion 5
+#define _deviceButtonMotion 6
+#define _deviceButtonGrab 7
+#define _deviceOwnerGrabButton 8
+#define _noExtensionEvent 9
+
+#define _devicePresence 0
+
+#define DeviceAdded 0
+#define DeviceRemoved 1
+#define DeviceEnabled 2
+#define DeviceDisabled 3
+#define DeviceUnrecoverable 4
+
+#define XI_BadDevice 0
+#define XI_BadEvent 1
+#define XI_BadMode 2
+#define XI_DeviceBusy 3
+#define XI_BadClass 4
+
+/* Make XEventClass be a CARD32 for 64 bit servers. Don't affect client
+ * definition of XEventClass since that would be a library interface change.
+ * See the top of X.h for more _XSERVER64 magic.
+ */
+#ifdef _XSERVER64
+typedef CARD32 XEventClass;
+#else
+typedef unsigned long XEventClass;
+#endif
+
+/*******************************************************************
+ *
+ * Extension version structure.
+ *
+ */
+
+typedef struct {
+ int present;
+ short major_version;
+ short minor_version;
+} XExtensionVersion;
+
+#endif /* _XI_H_ */
diff --git a/sysroot/usr/include/X11/extensions/XInput.h b/sysroot/usr/include/X11/extensions/XInput.h
new file mode 100644
index 0000000..e3585b4
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/XInput.h
@@ -0,0 +1,1200 @@
+/* $Xorg: XInput.h,v 1.4 2001/02/09 02:03:23 xorgcvs Exp $ */
+
+/************************************************************
+
+Copyright 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Hewlett-Packard not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+********************************************************/
+/* $XFree86: xc/include/extensions/XInput.h,v 1.3 2001/12/14 19:53:28 dawes Exp $ */
+
+/* Definitions used by the library and client */
+
+#ifndef _XINPUT_H_
+#define _XINPUT_H_
+
+#include <X11/Xlib.h>
+#include <X11/extensions/XI.h>
+
+#define _deviceKeyPress 0
+#define _deviceKeyRelease 1
+
+#define _deviceButtonPress 0
+#define _deviceButtonRelease 1
+
+#define _deviceMotionNotify 0
+
+#define _deviceFocusIn 0
+#define _deviceFocusOut 1
+
+#define _proximityIn 0
+#define _proximityOut 1
+
+#define _deviceStateNotify 0
+#define _deviceMappingNotify 1
+#define _changeDeviceNotify 2
+
+#define FindTypeAndClass(d,type,_class,classid,offset) \
+ { int _i; XInputClassInfo *_ip; \
+ type = 0; _class = 0; \
+ for (_i=0, _ip= ((XDevice *) d)->classes; \
+ _i< ((XDevice *) d)->num_classes; \
+ _i++, _ip++) \
+ if (_ip->input_class == classid) \
+ {type = _ip->event_type_base + offset; \
+ _class = ((XDevice *) d)->device_id << 8 | type;}}
+
+#define DeviceKeyPress(d,type,_class) \
+ FindTypeAndClass(d, type, _class, KeyClass, _deviceKeyPress)
+
+#define DeviceKeyRelease(d,type,_class) \
+ FindTypeAndClass(d, type, _class, KeyClass, _deviceKeyRelease)
+
+#define DeviceButtonPress(d,type,_class) \
+ FindTypeAndClass(d, type, _class, ButtonClass, _deviceButtonPress)
+
+#define DeviceButtonRelease(d,type,_class) \
+ FindTypeAndClass(d, type, _class, ButtonClass, _deviceButtonRelease)
+
+#define DeviceMotionNotify(d,type,_class) \
+ FindTypeAndClass(d, type, _class, ValuatorClass, _deviceMotionNotify)
+
+#define DeviceFocusIn(d,type,_class) \
+ FindTypeAndClass(d, type, _class, FocusClass, _deviceFocusIn)
+
+#define DeviceFocusOut(d,type,_class) \
+ FindTypeAndClass(d, type, _class, FocusClass, _deviceFocusOut)
+
+#define ProximityIn(d,type,_class) \
+ FindTypeAndClass(d, type, _class, ProximityClass, _proximityIn)
+
+#define ProximityOut(d,type,_class) \
+ FindTypeAndClass(d, type, _class, ProximityClass, _proximityOut)
+
+#define DeviceStateNotify(d,type,_class) \
+ FindTypeAndClass(d, type, _class, OtherClass, _deviceStateNotify)
+
+#define DeviceMappingNotify(d,type,_class) \
+ FindTypeAndClass(d, type, _class, OtherClass, _deviceMappingNotify)
+
+#define ChangeDeviceNotify(d,type,_class) \
+ FindTypeAndClass(d, type, _class, OtherClass, _changeDeviceNotify)
+
+#define DevicePointerMotionHint(d,type,_class) \
+ { _class = ((XDevice *) d)->device_id << 8 | _devicePointerMotionHint;}
+
+#define DeviceButton1Motion(d,type,_class) \
+ { _class = ((XDevice *) d)->device_id << 8 | _deviceButton1Motion;}
+
+#define DeviceButton2Motion(d,type,_class) \
+ { _class = ((XDevice *) d)->device_id << 8 | _deviceButton2Motion;}
+
+#define DeviceButton3Motion(d,type,_class) \
+ { _class = ((XDevice *) d)->device_id << 8 | _deviceButton3Motion;}
+
+#define DeviceButton4Motion(d,type, _class) \
+ { _class = ((XDevice *) d)->device_id << 8 | _deviceButton4Motion;}
+
+#define DeviceButton5Motion(d,type,_class) \
+ { _class = ((XDevice *) d)->device_id << 8 | _deviceButton5Motion;}
+
+#define DeviceButtonMotion(d,type, _class) \
+ { _class = ((XDevice *) d)->device_id << 8 | _deviceButtonMotion;}
+
+#define DeviceOwnerGrabButton(d,type,_class) \
+ { _class = ((XDevice *) d)->device_id << 8 | _deviceOwnerGrabButton;}
+
+#define DeviceButtonPressGrab(d,type,_class) \
+ { _class = ((XDevice *) d)->device_id << 8 | _deviceButtonGrab;}
+
+#define NoExtensionEvent(d,type,_class) \
+ { _class = ((XDevice *) d)->device_id << 8 | _noExtensionEvent;}
+
+#define DevicePresence(dpy, type, _class) \
+ { \
+ extern int _XiGetDevicePresenceNotifyEvent(Display *); \
+ type = _XiGetDevicePresenceNotifyEvent(dpy); \
+ _class = (0x10000 | _devicePresence); \
+ }
+
+#define BadDevice(dpy,error) _xibaddevice(dpy, &error)
+
+#define BadClass(dpy,error) _xibadclass(dpy, &error)
+
+#define BadEvent(dpy,error) _xibadevent(dpy, &error)
+
+#define BadMode(dpy,error) _xibadmode(dpy, &error)
+
+#define DeviceBusy(dpy,error) _xidevicebusy(dpy, &error)
+
+/***************************************************************
+ *
+ * DeviceKey events. These events are sent by input devices that
+ * support input class Keys.
+ * The location of the X pointer is reported in the coordinate
+ * fields of the x,y and x_root,y_root fields.
+ *
+ */
+
+typedef struct
+ {
+ int type; /* of event */
+ unsigned long serial; /* # of last request processed */
+ Bool send_event; /* true if from SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window; /* "event" window reported relative to */
+ XID deviceid;
+ Window root; /* root window event occured on */
+ Window subwindow; /* child window */
+ Time time; /* milliseconds */
+ int x, y; /* x, y coordinates in event window */
+ int x_root; /* coordinates relative to root */
+ int y_root; /* coordinates relative to root */
+ unsigned int state; /* key or button mask */
+ unsigned int keycode; /* detail */
+ Bool same_screen; /* same screen flag */
+ unsigned int device_state; /* device key or button mask */
+ unsigned char axes_count;
+ unsigned char first_axis;
+ int axis_data[6];
+ } XDeviceKeyEvent;
+
+typedef XDeviceKeyEvent XDeviceKeyPressedEvent;
+typedef XDeviceKeyEvent XDeviceKeyReleasedEvent;
+
+/*******************************************************************
+ *
+ * DeviceButton events. These events are sent by extension devices
+ * that support input class Buttons.
+ *
+ */
+
+typedef struct {
+ int type; /* of event */
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window; /* "event" window reported relative to */
+ XID deviceid;
+ Window root; /* root window that the event occured on */
+ Window subwindow; /* child window */
+ Time time; /* milliseconds */
+ int x, y; /* x, y coordinates in event window */
+ int x_root; /* coordinates relative to root */
+ int y_root; /* coordinates relative to root */
+ unsigned int state; /* key or button mask */
+ unsigned int button; /* detail */
+ Bool same_screen; /* same screen flag */
+ unsigned int device_state; /* device key or button mask */
+ unsigned char axes_count;
+ unsigned char first_axis;
+ int axis_data[6];
+ } XDeviceButtonEvent;
+
+typedef XDeviceButtonEvent XDeviceButtonPressedEvent;
+typedef XDeviceButtonEvent XDeviceButtonReleasedEvent;
+
+/*******************************************************************
+ *
+ * DeviceMotionNotify event. These events are sent by extension devices
+ * that support input class Valuators.
+ *
+ */
+
+typedef struct
+ {
+ int type; /* of event */
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window; /* "event" window reported relative to */
+ XID deviceid;
+ Window root; /* root window that the event occured on */
+ Window subwindow; /* child window */
+ Time time; /* milliseconds */
+ int x, y; /* x, y coordinates in event window */
+ int x_root; /* coordinates relative to root */
+ int y_root; /* coordinates relative to root */
+ unsigned int state; /* key or button mask */
+ char is_hint; /* detail */
+ Bool same_screen; /* same screen flag */
+ unsigned int device_state; /* device key or button mask */
+ unsigned char axes_count;
+ unsigned char first_axis;
+ int axis_data[6];
+ } XDeviceMotionEvent;
+
+/*******************************************************************
+ *
+ * DeviceFocusChange events. These events are sent when the focus
+ * of an extension device that can be focused is changed.
+ *
+ */
+
+typedef struct
+ {
+ int type; /* of event */
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window; /* "event" window reported relative to */
+ XID deviceid;
+ int mode; /* NotifyNormal, NotifyGrab, NotifyUngrab */
+ int detail;
+ /*
+ * NotifyAncestor, NotifyVirtual, NotifyInferior,
+ * NotifyNonLinear,NotifyNonLinearVirtual, NotifyPointer,
+ * NotifyPointerRoot, NotifyDetailNone
+ */
+ Time time;
+ } XDeviceFocusChangeEvent;
+
+typedef XDeviceFocusChangeEvent XDeviceFocusInEvent;
+typedef XDeviceFocusChangeEvent XDeviceFocusOutEvent;
+
+/*******************************************************************
+ *
+ * ProximityNotify events. These events are sent by those absolute
+ * positioning devices that are capable of generating proximity information.
+ *
+ */
+
+typedef struct
+ {
+ int type; /* ProximityIn or ProximityOut */
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window;
+ XID deviceid;
+ Window root;
+ Window subwindow;
+ Time time;
+ int x, y;
+ int x_root, y_root;
+ unsigned int state;
+ Bool same_screen;
+ unsigned int device_state; /* device key or button mask */
+ unsigned char axes_count;
+ unsigned char first_axis;
+ int axis_data[6];
+ } XProximityNotifyEvent;
+typedef XProximityNotifyEvent XProximityInEvent;
+typedef XProximityNotifyEvent XProximityOutEvent;
+
+/*******************************************************************
+ *
+ * DeviceStateNotify events are generated on EnterWindow and FocusIn
+ * for those clients who have selected DeviceState.
+ *
+ */
+
+typedef struct
+ {
+#if defined(__cplusplus) || defined(c_plusplus)
+ unsigned char c_class;
+#else
+ unsigned char class;
+#endif
+ unsigned char length;
+ } XInputClass;
+
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window;
+ XID deviceid;
+ Time time;
+ int num_classes;
+ char data[64];
+} XDeviceStateNotifyEvent;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ unsigned char c_class;
+#else
+ unsigned char class;
+#endif
+ unsigned char length;
+ unsigned char num_valuators;
+ unsigned char mode;
+ int valuators[6];
+} XValuatorStatus;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ unsigned char c_class;
+#else
+ unsigned char class;
+#endif
+ unsigned char length;
+ short num_keys;
+ char keys[32];
+} XKeyStatus;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ unsigned char c_class;
+#else
+ unsigned char class;
+#endif
+ unsigned char length;
+ short num_buttons;
+ char buttons[32];
+} XButtonStatus;
+
+/*******************************************************************
+ *
+ * DeviceMappingNotify event. This event is sent when the key mapping,
+ * modifier mapping, or button mapping of an extension device is changed.
+ *
+ */
+
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window; /* unused */
+ XID deviceid;
+ Time time;
+ int request; /* one of MappingModifier, MappingKeyboard,
+ MappingPointer */
+ int first_keycode;/* first keycode */
+ int count; /* defines range of change w. first_keycode*/
+} XDeviceMappingEvent;
+
+/*******************************************************************
+ *
+ * ChangeDeviceNotify event. This event is sent when an
+ * XChangeKeyboard or XChangePointer request is made.
+ *
+ */
+
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window; /* unused */
+ XID deviceid;
+ Time time;
+ int request; /* NewPointer or NewKeyboard */
+} XChangeDeviceNotifyEvent;
+
+/*******************************************************************
+ *
+ * DevicePresenceNotify event. This event is sent when the list of
+ * input devices changes, in which case devchange will be false, and
+ * no information about the change will be contained in the event;
+ * the client should use XListInputDevices() to learn what has changed.
+ *
+ * If devchange is true, an attribute that the server believes is
+ * important has changed on a device, and the client should use
+ * XGetDeviceControl to examine the device. If control is non-zero,
+ * then that control has changed meaningfully.
+ */
+
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window; /* unused */
+ Time time;
+ Bool devchange;
+ XID deviceid;
+ XID control;
+} XDevicePresenceNotifyEvent;
+
+/*******************************************************************
+ *
+ * Control structures for input devices that support input class
+ * Feedback. These are used by the XGetFeedbackControl and
+ * XChangeFeedbackControl functions.
+ *
+ */
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ XID c_class;
+#else
+ XID class;
+#endif
+ int length;
+ XID id;
+} XFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ XID c_class;
+#else
+ XID class;
+#endif
+ int length;
+ XID id;
+ int click;
+ int percent;
+ int pitch;
+ int duration;
+ int led_mask;
+ int global_auto_repeat;
+ char auto_repeats[32];
+} XKbdFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ XID c_class;
+#else
+ XID class;
+#endif
+ int length;
+ XID id;
+ int accelNum;
+ int accelDenom;
+ int threshold;
+} XPtrFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ XID c_class;
+#else
+ XID class;
+#endif
+ int length;
+ XID id;
+ int resolution;
+ int minVal;
+ int maxVal;
+} XIntegerFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ XID c_class;
+#else
+ XID class;
+#endif
+ int length;
+ XID id;
+ int max_symbols;
+ int num_syms_supported;
+ KeySym *syms_supported;
+} XStringFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ XID c_class;
+#else
+ XID class;
+#endif
+ int length;
+ XID id;
+ int percent;
+ int pitch;
+ int duration;
+} XBellFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ XID c_class;
+#else
+ XID class;
+#endif
+ int length;
+ XID id;
+ int led_values;
+ int led_mask;
+} XLedFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ XID c_class;
+#else
+ XID class;
+#endif
+ int length;
+ XID id;
+} XFeedbackControl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ XID c_class;
+#else
+ XID class;
+#endif
+ int length;
+ XID id;
+ int accelNum;
+ int accelDenom;
+ int threshold;
+} XPtrFeedbackControl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ XID c_class;
+#else
+ XID class;
+#endif
+ int length;
+ XID id;
+ int click;
+ int percent;
+ int pitch;
+ int duration;
+ int led_mask;
+ int led_value;
+ int key;
+ int auto_repeat_mode;
+} XKbdFeedbackControl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ XID c_class;
+#else
+ XID class;
+#endif
+ int length;
+ XID id;
+ int num_keysyms;
+ KeySym *syms_to_display;
+} XStringFeedbackControl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ XID c_class;
+#else
+ XID class;
+#endif
+ int length;
+ XID id;
+ int int_to_display;
+} XIntegerFeedbackControl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ XID c_class;
+#else
+ XID class;
+#endif
+ int length;
+ XID id;
+ int percent;
+ int pitch;
+ int duration;
+} XBellFeedbackControl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ XID c_class;
+#else
+ XID class;
+#endif
+ int length;
+ XID id;
+ int led_mask;
+ int led_values;
+} XLedFeedbackControl;
+
+/*******************************************************************
+ *
+ * Device control structures.
+ *
+ */
+
+typedef struct {
+ XID control;
+ int length;
+} XDeviceControl;
+
+typedef struct {
+ XID control;
+ int length;
+ int first_valuator;
+ int num_valuators;
+ int *resolutions;
+} XDeviceResolutionControl;
+
+typedef struct {
+ XID control;
+ int length;
+ int num_valuators;
+ int *resolutions;
+ int *min_resolutions;
+ int *max_resolutions;
+} XDeviceResolutionState;
+
+typedef struct {
+ XID control;
+ int length;
+ int min_x;
+ int max_x;
+ int min_y;
+ int max_y;
+ int flip_x;
+ int flip_y;
+ int rotation;
+ int button_threshold;
+} XDeviceAbsCalibControl, XDeviceAbsCalibState;
+
+typedef struct {
+ XID control;
+ int length;
+ int offset_x;
+ int offset_y;
+ int width;
+ int height;
+ int screen;
+ XID following;
+} XDeviceAbsAreaControl, XDeviceAbsAreaState;
+
+typedef struct {
+ XID control;
+ int length;
+ int status;
+} XDeviceCoreControl;
+
+typedef struct {
+ XID control;
+ int length;
+ int status;
+ int iscore;
+} XDeviceCoreState;
+
+typedef struct {
+ XID control;
+ int length;
+ int enable;
+} XDeviceEnableControl, XDeviceEnableState;
+
+/*******************************************************************
+ *
+ * An array of XDeviceList structures is returned by the
+ * XListInputDevices function. Each entry contains information
+ * about one input device. Among that information is an array of
+ * pointers to structures that describe the characteristics of
+ * the input device.
+ *
+ */
+
+typedef struct _XAnyClassinfo *XAnyClassPtr;
+
+typedef struct _XAnyClassinfo {
+#if defined(__cplusplus) || defined(c_plusplus)
+ XID c_class;
+#else
+ XID class;
+#endif
+ int length;
+ } XAnyClassInfo;
+
+typedef struct _XDeviceInfo *XDeviceInfoPtr;
+
+typedef struct _XDeviceInfo
+ {
+ XID id;
+ Atom type;
+ char *name;
+ int num_classes;
+ int use;
+ XAnyClassPtr inputclassinfo;
+ } XDeviceInfo;
+
+typedef struct _XKeyInfo *XKeyInfoPtr;
+
+typedef struct _XKeyInfo
+ {
+#if defined(__cplusplus) || defined(c_plusplus)
+ XID c_class;
+#else
+ XID class;
+#endif
+ int length;
+ unsigned short min_keycode;
+ unsigned short max_keycode;
+ unsigned short num_keys;
+ } XKeyInfo;
+
+typedef struct _XButtonInfo *XButtonInfoPtr;
+
+typedef struct _XButtonInfo {
+#if defined(__cplusplus) || defined(c_plusplus)
+ XID c_class;
+#else
+ XID class;
+#endif
+ int length;
+ short num_buttons;
+ } XButtonInfo;
+
+typedef struct _XAxisInfo *XAxisInfoPtr;
+
+typedef struct _XAxisInfo {
+ int resolution;
+ int min_value;
+ int max_value;
+ } XAxisInfo;
+
+typedef struct _XValuatorInfo *XValuatorInfoPtr;
+
+typedef struct _XValuatorInfo
+ {
+#if defined(__cplusplus) || defined(c_plusplus)
+ XID c_class;
+#else
+ XID class;
+#endif
+ int length;
+ unsigned char num_axes;
+ unsigned char mode;
+ unsigned long motion_buffer;
+ XAxisInfoPtr axes;
+ } XValuatorInfo;
+
+
+/*******************************************************************
+ *
+ * An XDevice structure is returned by the XOpenDevice function.
+ * It contains an array of pointers to XInputClassInfo structures.
+ * Each contains information about a class of input supported by the
+ * device, including a pointer to an array of data for each type of event
+ * the device reports.
+ *
+ */
+
+
+typedef struct {
+ unsigned char input_class;
+ unsigned char event_type_base;
+} XInputClassInfo;
+
+typedef struct {
+ XID device_id;
+ int num_classes;
+ XInputClassInfo *classes;
+} XDevice;
+
+
+/*******************************************************************
+ *
+ * The following structure is used to return information for the
+ * XGetSelectedExtensionEvents function.
+ *
+ */
+
+typedef struct {
+ XEventClass event_type;
+ XID device;
+} XEventList;
+
+/*******************************************************************
+ *
+ * The following structure is used to return motion history data from
+ * an input device that supports the input class Valuators.
+ * This information is returned by the XGetDeviceMotionEvents function.
+ *
+ */
+
+typedef struct {
+ Time time;
+ int *data;
+} XDeviceTimeCoord;
+
+
+/*******************************************************************
+ *
+ * Device state structure.
+ * This is returned by the XQueryDeviceState request.
+ *
+ */
+
+typedef struct {
+ XID device_id;
+ int num_classes;
+ XInputClass *data;
+} XDeviceState;
+
+/*******************************************************************
+ *
+ * Note that the mode field is a bitfield that reports the Proximity
+ * status of the device as well as the mode. The mode field should
+ * be OR'd with the mask DeviceMode and compared with the values
+ * Absolute and Relative to determine the mode, and should be OR'd
+ * with the mask ProximityState and compared with the values InProximity
+ * and OutOfProximity to determine the proximity state.
+ *
+ */
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ unsigned char c_class;
+#else
+ unsigned char class;
+#endif
+ unsigned char length;
+ unsigned char num_valuators;
+ unsigned char mode;
+ int *valuators;
+} XValuatorState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ unsigned char c_class;
+#else
+ unsigned char class;
+#endif
+ unsigned char length;
+ short num_keys;
+ char keys[32];
+} XKeyState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ unsigned char c_class;
+#else
+ unsigned char class;
+#endif
+ unsigned char length;
+ short num_buttons;
+ char buttons[32];
+} XButtonState;
+
+/*******************************************************************
+ *
+ * Function definitions.
+ *
+ */
+
+_XFUNCPROTOBEGIN
+
+extern int XChangeKeyboardDevice(
+ Display* /* display */,
+ XDevice* /* device */
+);
+
+extern int XChangePointerDevice(
+ Display* /* display */,
+ XDevice* /* device */,
+ int /* xaxis */,
+ int /* yaxis */
+);
+
+extern int XGrabDevice(
+ Display* /* display */,
+ XDevice* /* device */,
+ Window /* grab_window */,
+ Bool /* ownerEvents */,
+ int /* event count */,
+ XEventClass* /* event_list */,
+ int /* this_device_mode */,
+ int /* other_devices_mode */,
+ Time /* time */
+);
+
+extern int XUngrabDevice(
+ Display* /* display */,
+ XDevice* /* device */,
+ Time /* time */
+);
+
+extern int XGrabDeviceKey(
+ Display* /* display */,
+ XDevice* /* device */,
+ unsigned int /* key */,
+ unsigned int /* modifiers */,
+ XDevice* /* modifier_device */,
+ Window /* grab_window */,
+ Bool /* owner_events */,
+ unsigned int /* event_count */,
+ XEventClass* /* event_list */,
+ int /* this_device_mode */,
+ int /* other_devices_mode */
+);
+
+extern int XUngrabDeviceKey(
+ Display* /* display */,
+ XDevice* /* device */,
+ unsigned int /* key */,
+ unsigned int /* modifiers */,
+ XDevice* /* modifier_dev */,
+ Window /* grab_window */
+);
+
+extern int XGrabDeviceButton(
+ Display* /* display */,
+ XDevice* /* device */,
+ unsigned int /* button */,
+ unsigned int /* modifiers */,
+ XDevice* /* modifier_device */,
+ Window /* grab_window */,
+ Bool /* owner_events */,
+ unsigned int /* event_count */,
+ XEventClass* /* event_list */,
+ int /* this_device_mode */,
+ int /* other_devices_mode */
+);
+
+extern int XUngrabDeviceButton(
+ Display* /* display */,
+ XDevice* /* device */,
+ unsigned int /* button */,
+ unsigned int /* modifiers */,
+ XDevice* /* modifier_dev */,
+ Window /* grab_window */
+);
+
+extern int XAllowDeviceEvents(
+ Display* /* display */,
+ XDevice* /* device */,
+ int /* event_mode */,
+ Time /* time */
+);
+
+extern int XGetDeviceFocus(
+ Display* /* display */,
+ XDevice* /* device */,
+ Window* /* focus */,
+ int* /* revert_to */,
+ Time* /* time */
+);
+
+extern int XSetDeviceFocus(
+ Display* /* display */,
+ XDevice* /* device */,
+ Window /* focus */,
+ int /* revert_to */,
+ Time /* time */
+);
+
+extern XFeedbackState *XGetFeedbackControl(
+ Display* /* display */,
+ XDevice* /* device */,
+ int* /* num_feedbacks */
+);
+
+extern void XFreeFeedbackList(
+ XFeedbackState* /* list */
+);
+
+extern int XChangeFeedbackControl(
+ Display* /* display */,
+ XDevice* /* device */,
+ unsigned long /* mask */,
+ XFeedbackControl* /* f */
+);
+
+extern int XDeviceBell(
+ Display* /* display */,
+ XDevice* /* device */,
+ XID /* feedbackclass */,
+ XID /* feedbackid */,
+ int /* percent */
+);
+
+extern KeySym *XGetDeviceKeyMapping(
+ Display* /* display */,
+ XDevice* /* device */,
+#if NeedWidePrototypes
+ unsigned int /* first */,
+#else
+ KeyCode /* first */,
+#endif
+ int /* keycount */,
+ int* /* syms_per_code */
+);
+
+extern int XChangeDeviceKeyMapping(
+ Display* /* display */,
+ XDevice* /* device */,
+ int /* first */,
+ int /* syms_per_code */,
+ KeySym* /* keysyms */,
+ int /* count */
+);
+
+extern XModifierKeymap *XGetDeviceModifierMapping(
+ Display* /* display */,
+ XDevice* /* device */
+);
+
+extern int XSetDeviceModifierMapping(
+ Display* /* display */,
+ XDevice* /* device */,
+ XModifierKeymap* /* modmap */
+);
+
+extern int XSetDeviceButtonMapping(
+ Display* /* display */,
+ XDevice* /* device */,
+ unsigned char* /* map[] */,
+ int /* nmap */
+);
+
+extern int XGetDeviceButtonMapping(
+ Display* /* display */,
+ XDevice* /* device */,
+ unsigned char* /* map[] */,
+ unsigned int /* nmap */
+);
+
+extern XDeviceState *XQueryDeviceState(
+ Display* /* display */,
+ XDevice* /* device */
+);
+
+extern void XFreeDeviceState(
+ XDeviceState* /* list */
+);
+
+extern XExtensionVersion *XGetExtensionVersion(
+ Display* /* display */,
+ _Xconst char* /* name */
+);
+
+extern XDeviceInfo *XListInputDevices(
+ Display* /* display */,
+ int* /* ndevices */
+);
+
+extern void XFreeDeviceList(
+ XDeviceInfo* /* list */
+);
+
+extern XDevice *XOpenDevice(
+ Display* /* display */,
+ XID /* id */
+);
+
+extern int XCloseDevice(
+ Display* /* display */,
+ XDevice* /* device */
+);
+
+extern int XSetDeviceMode(
+ Display* /* display */,
+ XDevice* /* device */,
+ int /* mode */
+);
+
+extern int XSetDeviceValuators(
+ Display* /* display */,
+ XDevice* /* device */,
+ int* /* valuators */,
+ int /* first_valuator */,
+ int /* num_valuators */
+);
+
+extern XDeviceControl *XGetDeviceControl(
+ Display* /* display */,
+ XDevice* /* device */,
+ int /* control */
+);
+
+extern int XChangeDeviceControl(
+ Display* /* display */,
+ XDevice* /* device */,
+ int /* control */,
+ XDeviceControl* /* d */
+);
+
+extern int XSelectExtensionEvent(
+ Display* /* display */,
+ Window /* w */,
+ XEventClass* /* event_list */,
+ int /* count */
+);
+
+extern int XGetSelectedExtensionEvents(
+ Display* /* display */,
+ Window /* w */,
+ int* /* this_client_count */,
+ XEventClass** /* this_client_list */,
+ int* /* all_clients_count */,
+ XEventClass** /* all_clients_list */
+);
+
+extern int XChangeDeviceDontPropagateList(
+ Display* /* display */,
+ Window /* window */,
+ int /* count */,
+ XEventClass* /* events */,
+ int /* mode */
+);
+
+extern XEventClass *XGetDeviceDontPropagateList(
+ Display* /* display */,
+ Window /* window */,
+ int* /* count */
+);
+
+extern Status XSendExtensionEvent(
+ Display* /* display */,
+ XDevice* /* device */,
+ Window /* dest */,
+ Bool /* prop */,
+ int /* count */,
+ XEventClass* /* list */,
+ XEvent* /* event */
+);
+
+extern XDeviceTimeCoord *XGetDeviceMotionEvents(
+ Display* /* display */,
+ XDevice* /* device */,
+ Time /* start */,
+ Time /* stop */,
+ int* /* nEvents */,
+ int* /* mode */,
+ int* /* axis_count */
+);
+
+extern void XFreeDeviceMotionEvents(
+ XDeviceTimeCoord* /* events */
+);
+
+extern void XFreeDeviceControl(
+ XDeviceControl* /* control */
+);
+
+_XFUNCPROTOEND
+
+#endif /* _XINPUT_H_ */
diff --git a/sysroot/usr/include/X11/extensions/XIproto.h b/sysroot/usr/include/X11/extensions/XIproto.h
new file mode 100644
index 0000000..4f46f4f
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/XIproto.h
@@ -0,0 +1,1617 @@
+/* $Xorg: XIproto.h,v 1.5 2001/02/09 02:03:24 xorgcvs Exp $ */
+
+/************************************************************
+
+Copyright 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Hewlett-Packard not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+********************************************************/
+/* $XFree86: xc/include/extensions/XIproto.h,v 1.4 2001/01/17 17:53:17 dawes Exp $ */
+
+#ifndef _XIPROTO_H
+#define _XIPROTO_H
+
+#include <X11/Xproto.h>
+#include <X11/X.h>
+
+/* make sure types have right sizes for protocol structures. */
+#define Window CARD32
+#define Time CARD32
+#define KeyCode CARD8
+
+/*********************************************************
+ *
+ * number of events, errors, and extension name.
+ *
+ */
+
+#define MORE_EVENTS 0x80
+#define DEVICE_BITS 0x7F
+
+#define InputClassBits 0x3F /* bits in mode field for input classes */
+#define ModeBitsShift 6 /* amount to shift the remaining bits */
+
+#define numInputClasses 7
+
+#define IEVENTS 16
+#define IERRORS 5
+
+#define CLIENT_REQ 1
+
+typedef struct _XExtEventInfo
+ {
+ Mask mask;
+ BYTE type;
+ BYTE word;
+ } XExtEventInfo;
+
+typedef unsigned char *Pointer;
+
+struct tmask
+ {
+ Mask mask;
+ Pointer dev;
+ };
+
+/*********************************************************
+ *
+ * Event constants used by library.
+ *
+ */
+
+#define XI_DeviceValuator 0
+#define XI_DeviceKeyPress 1
+#define XI_DeviceKeyRelease 2
+#define XI_DeviceButtonPress 3
+#define XI_DeviceButtonRelease 4
+#define XI_DeviceMotionNotify 5
+#define XI_DeviceFocusIn 6
+#define XI_DeviceFocusOut 7
+#define XI_ProximityIn 8
+#define XI_ProximityOut 9
+#define XI_DeviceStateNotify 10
+#define XI_DeviceMappingNotify 11
+#define XI_ChangeDeviceNotify 12
+#define XI_DeviceKeystateNotify 13
+#define XI_DeviceButtonstateNotify 14
+#define XI_DevicePresenceNotify 15
+
+/*********************************************************
+ *
+ * Protocol request constants
+ *
+ */
+
+#define X_GetExtensionVersion 1
+#define X_ListInputDevices 2
+#define X_OpenDevice 3
+#define X_CloseDevice 4
+#define X_SetDeviceMode 5
+#define X_SelectExtensionEvent 6
+#define X_GetSelectedExtensionEvents 7
+#define X_ChangeDeviceDontPropagateList 8
+#define X_GetDeviceDontPropagateList 9
+#define X_GetDeviceMotionEvents 10
+#define X_ChangeKeyboardDevice 11
+#define X_ChangePointerDevice 12
+#define X_GrabDevice 13
+#define X_UngrabDevice 14
+#define X_GrabDeviceKey 15
+#define X_UngrabDeviceKey 16
+#define X_GrabDeviceButton 17
+#define X_UngrabDeviceButton 18
+#define X_AllowDeviceEvents 19
+#define X_GetDeviceFocus 20
+#define X_SetDeviceFocus 21
+#define X_GetFeedbackControl 22
+#define X_ChangeFeedbackControl 23
+#define X_GetDeviceKeyMapping 24
+#define X_ChangeDeviceKeyMapping 25
+#define X_GetDeviceModifierMapping 26
+#define X_SetDeviceModifierMapping 27
+#define X_GetDeviceButtonMapping 28
+#define X_SetDeviceButtonMapping 29
+#define X_QueryDeviceState 30
+#define X_SendExtensionEvent 31
+#define X_DeviceBell 32
+#define X_SetDeviceValuators 33
+#define X_GetDeviceControl 34
+#define X_ChangeDeviceControl 35
+
+/*********************************************************
+ *
+ * Protocol request and reply structures.
+ *
+ * GetExtensionVersion.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_GetExtensionVersion */
+ CARD16 length B16;
+ CARD16 nbytes B16;
+ CARD8 pad1, pad2;
+} xGetExtensionVersionReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_GetExtensionVersion */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 major_version B16;
+ CARD16 minor_version B16;
+ BOOL present;
+ CARD8 pad1, pad2, pad3;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+} xGetExtensionVersionReply;
+
+/*********************************************************
+ *
+ * ListInputDevices.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_ListInputDevices */
+ CARD16 length B16;
+} xListInputDevicesReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_ListInputDevices */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 ndevices;
+ CARD8 pad1, pad2, pad3;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+} xListInputDevicesReply;
+
+typedef struct _xDeviceInfo *xDeviceInfoPtr;
+
+typedef struct _xAnyClassinfo *xAnyClassPtr;
+
+typedef struct _xAnyClassinfo {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class;
+#else
+ CARD8 class;
+#endif
+ CARD8 length;
+ } xAnyClassInfo;
+
+typedef struct _xDeviceInfo {
+ CARD32 type B32;
+ CARD8 id;
+ CARD8 num_classes;
+ CARD8 use;
+ CARD8 pad1;
+ } xDeviceInfo;
+
+typedef struct _xKeyInfo *xKeyInfoPtr;
+
+typedef struct _xKeyInfo {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class;
+#else
+ CARD8 class;
+#endif
+ CARD8 length;
+ KeyCode min_keycode;
+ KeyCode max_keycode;
+ CARD16 num_keys B16;
+ CARD8 pad1,pad2;
+ } xKeyInfo;
+
+typedef struct _xButtonInfo *xButtonInfoPtr;
+
+typedef struct _xButtonInfo {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class;
+#else
+ CARD8 class;
+#endif
+ CARD8 length;
+ CARD16 num_buttons B16;
+ } xButtonInfo;
+
+typedef struct _xValuatorInfo *xValuatorInfoPtr;
+
+typedef struct _xValuatorInfo {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class;
+#else
+ CARD8 class;
+#endif
+ CARD8 length;
+ CARD8 num_axes;
+ CARD8 mode;
+ CARD32 motion_buffer_size B32;
+ } xValuatorInfo;
+
+typedef struct _xAxisInfo *xAxisInfoPtr;
+
+typedef struct _xAxisInfo {
+ CARD32 resolution B32;
+ CARD32 min_value B32;
+ CARD32 max_value B32;
+ } xAxisInfo;
+
+/*********************************************************
+ *
+ * OpenDevice.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_OpenDevice */
+ CARD16 length B16;
+ CARD8 deviceid;
+ BYTE pad1, pad2, pad3;
+} xOpenDeviceReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_OpenDevice */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 num_classes;
+ BYTE pad1, pad2, pad3;
+ CARD32 pad00 B32;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ } xOpenDeviceReply;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class;
+#else
+ CARD8 class;
+#endif
+ CARD8 event_type_base;
+ } xInputClassInfo;
+
+/*********************************************************
+ *
+ * CloseDevice.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_CloseDevice */
+ CARD16 length B16;
+ CARD8 deviceid;
+ BYTE pad1, pad2, pad3;
+} xCloseDeviceReq;
+
+/*********************************************************
+ *
+ * SetDeviceMode.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_SetDeviceMode */
+ CARD16 length B16;
+ CARD8 deviceid;
+ CARD8 mode;
+ BYTE pad1, pad2;
+} xSetDeviceModeReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_SetDeviceMode */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 status;
+ BYTE pad1, pad2, pad3;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+} xSetDeviceModeReply;
+
+/*********************************************************
+ *
+ * SelectExtensionEvent.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_SelectExtensionEvent */
+ CARD16 length B16;
+ Window window B32;
+ CARD16 count B16;
+ CARD16 pad00 B16;
+} xSelectExtensionEventReq;
+
+/*********************************************************
+ *
+ * GetSelectedExtensionEvent.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* X_GetSelectedExtensionEvents */
+ CARD16 length B16;
+ Window window B32;
+} xGetSelectedExtensionEventsReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* GetSelectedExtensionEvents */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 this_client_count B16;
+ CARD16 all_clients_count B16;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+} xGetSelectedExtensionEventsReply;
+
+/*********************************************************
+ *
+ * ChangeDeviceDontPropagateList.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* X_ChangeDeviceDontPropagateList */
+ CARD16 length B16;
+ Window window B32;
+ CARD16 count B16;
+ CARD8 mode;
+ BYTE pad;
+} xChangeDeviceDontPropagateListReq;
+
+/*********************************************************
+ *
+ * GetDeviceDontPropagateList.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* X_GetDeviceDontPropagateList */
+ CARD16 length B16;
+ Window window B32;
+} xGetDeviceDontPropagateListReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* GetDeviceDontPropagateList */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 count B16;
+ CARD16 pad00 B16;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+ } xGetDeviceDontPropagateListReply;
+
+/*********************************************************
+ *
+ * GetDeviceMotionEvents.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_GetDeviceMotionEvents*/
+ CARD16 length B16;
+ Time start B32;
+ Time stop B32;
+ CARD8 deviceid;
+ BYTE pad1, pad2, pad3;
+} xGetDeviceMotionEventsReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_GetDeviceMotionEvents */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 nEvents B32;
+ CARD8 axes;
+ CARD8 mode;
+ BYTE pad1, pad2;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+} xGetDeviceMotionEventsReply;
+
+/*********************************************************
+ *
+ * ChangeKeyboardDevice.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* X_ChangeKeyboardDevice */
+ CARD16 length B16;
+ CARD8 deviceid;
+ BYTE pad1, pad2, pad3;
+} xChangeKeyboardDeviceReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_ChangeKeyboardDevice*/
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ CARD8 status;
+ BYTE pad1, pad2, pad3;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+ } xChangeKeyboardDeviceReply;
+
+/*********************************************************
+ *
+ * ChangePointerDevice.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* X_ChangePointerDevice */
+ CARD16 length B16;
+ CARD8 xaxis;
+ CARD8 yaxis;
+ CARD8 deviceid;
+ BYTE pad1;
+} xChangePointerDeviceReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_ChangePointerDevice */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ CARD8 status;
+ BYTE pad1, pad2, pad3;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+ } xChangePointerDeviceReply;
+
+/*********************************************************
+ *
+ * GrabDevice.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_GrabDevice */
+ CARD16 length B16;
+ Window grabWindow B32;
+ Time time B32;
+ CARD16 event_count B16;
+ CARD8 this_device_mode;
+ CARD8 other_devices_mode;
+ BOOL ownerEvents;
+ CARD8 deviceid;
+ CARD16 pad01 B16;
+} xGrabDeviceReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_GrabDevice */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ CARD8 status;
+ BYTE pad1, pad2, pad3;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+ } xGrabDeviceReply;
+
+/*********************************************************
+ *
+ * UngrabDevice.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_UnGrabDevice */
+ CARD16 length B16;
+ Time time B32;
+ CARD8 deviceid;
+ BYTE pad1, pad2, pad3;
+} xUngrabDeviceReq;
+
+/*********************************************************
+ *
+ * GrabDeviceKey.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_GrabDeviceKey */
+ CARD16 length B16;
+ Window grabWindow B32;
+ CARD16 event_count B16;
+ CARD16 modifiers B16;
+ CARD8 modifier_device;
+ CARD8 grabbed_device;
+ CARD8 key;
+ BYTE this_device_mode;
+ BYTE other_devices_mode;
+ BOOL ownerEvents;
+ BYTE pad1, pad2;
+} xGrabDeviceKeyReq;
+
+/*********************************************************
+ *
+ * UngrabDeviceKey.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_UngrabDeviceKey */
+ CARD16 length B16;
+ Window grabWindow B32;
+ CARD16 modifiers B16;
+ CARD8 modifier_device;
+ CARD8 key;
+ CARD8 grabbed_device;
+ BYTE pad1, pad2, pad3;
+} xUngrabDeviceKeyReq;
+
+/*********************************************************
+ *
+ * GrabDeviceButton.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_GrabDeviceButton */
+ CARD16 length B16;
+ Window grabWindow B32;
+ CARD8 grabbed_device;
+ CARD8 modifier_device;
+ CARD16 event_count B16;
+ CARD16 modifiers B16;
+ BYTE this_device_mode;
+ BYTE other_devices_mode;
+ CARD8 button;
+ BOOL ownerEvents;
+ BYTE pad1, pad2;
+} xGrabDeviceButtonReq;
+
+/*********************************************************
+ *
+ * UngrabDeviceButton.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_UngrabDeviceButton */
+ CARD16 length B16;
+ Window grabWindow B32;
+ CARD16 modifiers B16;
+ CARD8 modifier_device;
+ CARD8 button;
+ CARD8 grabbed_device;
+ BYTE pad1, pad2, pad3;
+} xUngrabDeviceButtonReq;
+
+/*********************************************************
+ *
+ * AllowDeviceEvents.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_AllowDeviceEvents */
+ CARD16 length B16;
+ Time time B32;
+ CARD8 mode;
+ CARD8 deviceid;
+ BYTE pad1, pad2;
+} xAllowDeviceEventsReq;
+
+/*********************************************************
+ *
+ * GetDeviceFocus.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_GetDeviceFocus */
+ CARD16 length B16;
+ CARD8 deviceid;
+ BYTE pad1, pad2, pad3;
+} xGetDeviceFocusReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_GetDeviceFocus */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 focus B32;
+ Time time B32;
+ CARD8 revertTo;
+ BYTE pad1, pad2, pad3;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ } xGetDeviceFocusReply;
+
+/*********************************************************
+ *
+ * SetDeviceFocus.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_SetDeviceFocus */
+ CARD16 length B16;
+ Window focus B32;
+ Time time B32;
+ CARD8 revertTo;
+ CARD8 device;
+ CARD16 pad01 B16;
+} xSetDeviceFocusReq;
+
+/*********************************************************
+ *
+ * GetFeedbackControl.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* X_GetFeedbackControl */
+ CARD16 length B16;
+ CARD8 deviceid;
+ BYTE pad1, pad2, pad3;
+} xGetFeedbackControlReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_GetFeedbackControl */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 num_feedbacks B16;
+ CARD16 pad01 B16;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+ CARD32 pad06 B32;
+} xGetFeedbackControlReply;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class; /* feedback class */
+#else
+ CARD8 class; /* feedback class */
+#endif
+ CARD8 id; /* feedback id */
+ CARD16 length B16; /* feedback length */
+} xFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class;
+#else
+ CARD8 class;
+#endif
+ CARD8 id;
+ CARD16 length B16;
+ CARD16 pitch B16;
+ CARD16 duration B16;
+ CARD32 led_mask B32;
+ CARD32 led_values B32;
+ BOOL global_auto_repeat;
+ CARD8 click;
+ CARD8 percent;
+ BYTE pad;
+ BYTE auto_repeats[32];
+} xKbdFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class;
+#else
+ CARD8 class;
+#endif
+ CARD8 id;
+ CARD16 length B16;
+ CARD8 pad1,pad2;
+ CARD16 accelNum B16;
+ CARD16 accelDenom B16;
+ CARD16 threshold B16;
+} xPtrFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class; /* feedback class id */
+#else
+ CARD8 class; /* feedback class id */
+#endif
+ CARD8 id;
+ CARD16 length B16; /* feedback length */
+ CARD32 resolution B32;
+ INT32 min_value B32;
+ INT32 max_value B32;
+} xIntegerFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class; /* feedback class id */
+#else
+ CARD8 class; /* feedback class id */
+#endif
+ CARD8 id;
+ CARD16 length B16; /* feedback length */
+ CARD16 max_symbols B16;
+ CARD16 num_syms_supported B16;
+} xStringFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class; /* feedback class id */
+#else
+ CARD8 class; /* feedback class id */
+#endif
+ CARD8 id;
+ CARD16 length B16; /* feedback length */
+ CARD8 percent;
+ BYTE pad1, pad2, pad3;
+ CARD16 pitch B16;
+ CARD16 duration B16;
+} xBellFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class; /* feedback class id */
+#else
+ CARD8 class; /* feedback class id */
+#endif
+ CARD8 id;
+ CARD16 length B16; /* feedback length */
+ CARD32 led_mask B32;
+ CARD32 led_values B32;
+} xLedFeedbackState;
+
+/*********************************************************
+ *
+ * ChangeFeedbackControl.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* X_ChangeFeedbackControl */
+ CARD16 length B16;
+ CARD32 mask B32;
+ CARD8 deviceid;
+ CARD8 feedbackid;
+ BYTE pad1, pad2;
+} xChangeFeedbackControlReq;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class; /* feedback class id */
+#else
+ CARD8 class; /* feedback class id */
+#endif
+ CARD8 id; /* feedback id */
+ CARD16 length B16; /* feedback length */
+} xFeedbackCtl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class; /* feedback class id */
+#else
+ CARD8 class; /* feedback class id */
+#endif
+ CARD8 id; /* feedback length */
+ CARD16 length B16; /* feedback length */
+ KeyCode key;
+ CARD8 auto_repeat_mode;
+ INT8 click;
+ INT8 percent;
+ INT16 pitch B16;
+ INT16 duration B16;
+ CARD32 led_mask B32;
+ CARD32 led_values B32;
+} xKbdFeedbackCtl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class; /* feedback class id */
+#else
+ CARD8 class; /* feedback class id */
+#endif
+ CARD8 id; /* feedback id */
+ CARD16 length B16; /* feedback length */
+ CARD8 pad1,pad2;
+ INT16 num B16;
+ INT16 denom B16;
+ INT16 thresh B16;
+} xPtrFeedbackCtl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class; /* feedback class id */
+#else
+ CARD8 class; /* feedback class id */
+#endif
+ CARD8 id; /* feedback id */
+ CARD16 length B16; /* feedback length */
+ INT32 int_to_display B32;
+} xIntegerFeedbackCtl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class; /* feedback class id */
+#else
+ CARD8 class; /* feedback class id */
+#endif
+ CARD8 id; /* feedback id */
+ CARD16 length B16; /* feedback length */
+ CARD8 pad1,pad2;
+ CARD16 num_keysyms B16;
+} xStringFeedbackCtl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class; /* feedback class id */
+#else
+ CARD8 class; /* feedback class id */
+#endif
+ CARD8 id; /* feedback id */
+ CARD16 length B16; /* feedback length */
+ INT8 percent;
+ BYTE pad1, pad2, pad3;
+ INT16 pitch B16;
+ INT16 duration B16;
+} xBellFeedbackCtl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class; /* feedback class id */
+#else
+ CARD8 class; /* feedback class id */
+#endif
+ CARD8 id; /* feedback id */
+ CARD16 length B16; /* feedback length */
+ CARD32 led_mask B32;
+ CARD32 led_values B32;
+} xLedFeedbackCtl;
+
+/*********************************************************
+ *
+ * GetDeviceKeyMapping.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_GetDeviceKeyMapping */
+ CARD16 length B16;
+ CARD8 deviceid;
+ KeyCode firstKeyCode;
+ CARD8 count;
+ BYTE pad1;
+} xGetDeviceKeyMappingReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_GetDeviceKeyMapping */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 keySymsPerKeyCode;
+ CARD8 pad0;
+ CARD16 pad1 B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGetDeviceKeyMappingReply;
+
+/*********************************************************
+ *
+ * ChangeDeviceKeyMapping.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_ChangeDeviceKeyMapping */
+ CARD16 length B16;
+ CARD8 deviceid;
+ KeyCode firstKeyCode;
+ CARD8 keySymsPerKeyCode;
+ CARD8 keyCodes;
+} xChangeDeviceKeyMappingReq;
+
+/*********************************************************
+ *
+ * GetDeviceModifierMapping.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_GetDeviceModifierMapping */
+ CARD16 length B16;
+ CARD8 deviceid;
+ BYTE pad1, pad2, pad3;
+} xGetDeviceModifierMappingReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_GetDeviceModifierMapping */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 numKeyPerModifier;
+ CARD8 pad0;
+ CARD16 pad1 B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGetDeviceModifierMappingReply;
+
+/*********************************************************
+ *
+ * SetDeviceModifierMapping.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_SetDeviceModifierMapping */
+ CARD16 length B16;
+ CARD8 deviceid;
+ CARD8 numKeyPerModifier;
+ CARD16 pad1 B16;
+} xSetDeviceModifierMappingReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_SetDeviceModifierMapping */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 success;
+ CARD8 pad0;
+ CARD16 pad1 B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xSetDeviceModifierMappingReply;
+
+/*********************************************************
+ *
+ * GetDeviceButtonMapping.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* X_GetDeviceButtonMapping */
+ CARD16 length B16;
+ CARD8 deviceid;
+ BYTE pad1, pad2, pad3;
+} xGetDeviceButtonMappingReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_GetDeviceButtonMapping */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 nElts;
+ BYTE pad1, pad2, pad3;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+} xGetDeviceButtonMappingReply;
+
+/*********************************************************
+ *
+ * SetDeviceButtonMapping.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* X_SetDeviceButtonMapping */
+ CARD16 length B16;
+ CARD8 deviceid;
+ CARD8 map_length;
+ BYTE pad1, pad2;
+} xSetDeviceButtonMappingReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_SetDeviceButtonMapping */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 status;
+ BYTE pad0;
+ CARD16 pad1 B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xSetDeviceButtonMappingReply;
+
+/*********************************************************
+ *
+ * QueryDeviceState.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 ReqType; /* always X_QueryDeviceState */
+ CARD16 length B16;
+ CARD8 deviceid;
+ BYTE pad1, pad2, pad3;
+} xQueryDeviceStateReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_QueryDeviceState */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 num_classes;
+ BYTE pad0;
+ CARD16 pad1 B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xQueryDeviceStateReply;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class;
+#else
+ CARD8 class;
+#endif
+ CARD8 length;
+ CARD8 num_keys;
+ BYTE pad1;
+ CARD8 keys[32];
+} xKeyState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class;
+#else
+ CARD8 class;
+#endif
+ CARD8 length;
+ CARD8 num_buttons;
+ BYTE pad1;
+ CARD8 buttons[32];
+} xButtonState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class;
+#else
+ CARD8 class;
+#endif
+ CARD8 length;
+ CARD8 num_valuators;
+ CARD8 mode;
+} xValuatorState;
+
+/*********************************************************
+ *
+ * SendExtensionEvent.
+ * THIS REQUEST MUST BE KEPT A MULTIPLE OF 8 BYTES IN LENGTH!
+ * MORE EVENTS MAY FOLLOW AND THEY MUST BE QUAD-ALIGNED!
+ *
+ */
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 ReqType; /* always X_SendExtensionEvent */
+ CARD16 length B16;
+ Window destination B32;
+ CARD8 deviceid;
+ BOOL propagate;
+ CARD16 count B16;
+ CARD8 num_events;
+ BYTE pad1,pad2,pad3;
+} xSendExtensionEventReq;
+
+/*********************************************************
+ *
+ * DeviceBell.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 ReqType; /* always X_DeviceBell */
+ CARD16 length B16;
+ CARD8 deviceid;
+ CARD8 feedbackid;
+ CARD8 feedbackclass;
+ INT8 percent;
+} xDeviceBellReq;
+
+/*********************************************************
+ *
+ * SetDeviceValuators.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_SetDeviceValuators */
+ CARD16 length B16;
+ CARD8 deviceid;
+ CARD8 first_valuator;
+ CARD8 num_valuators;
+ BYTE pad1;
+} xSetDeviceValuatorsReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_SetDeviceValuators */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 status;
+ BYTE pad1, pad2, pad3;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+} xSetDeviceValuatorsReply;
+
+/*********************************************************
+ *
+ * GetDeviceControl.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_GetDeviceControl */
+ CARD16 length B16;
+ CARD16 control B16;
+ CARD8 deviceid;
+ BYTE pad2;
+} xGetDeviceControlReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_GetDeviceControl */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 status;
+ BYTE pad1, pad2, pad3;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+} xGetDeviceControlReply;
+
+typedef struct {
+ CARD16 control B16; /* control type */
+ CARD16 length B16; /* control length */
+} xDeviceState;
+
+typedef struct {
+ CARD16 control B16; /* control type */
+ CARD16 length B16; /* control length */
+ CARD32 num_valuators B32; /* number of valuators */
+} xDeviceResolutionState;
+
+typedef struct {
+ CARD16 control B16;
+ CARD16 length B16;
+ INT32 min_x B32;
+ INT32 max_x B32;
+ INT32 min_y B32;
+ INT32 max_y B32;
+ CARD32 flip_x B32;
+ CARD32 flip_y B32;
+ CARD32 rotation B32;
+ CARD32 button_threshold B32;
+} xDeviceAbsCalibState;
+
+typedef struct {
+ CARD16 control B16;
+ CARD16 length B16;
+ CARD32 offset_x B32;
+ CARD32 offset_y B32;
+ CARD32 width B32;
+ CARD32 height B32;
+ CARD32 screen B32;
+ CARD32 following B32;
+} xDeviceAbsAreaState;
+
+typedef struct {
+ CARD16 control B16; /* control type */
+ CARD16 length B16; /* control length */
+ CARD8 status;
+ CARD8 iscore;
+ CARD16 pad1 B16;
+} xDeviceCoreState;
+
+typedef struct {
+ CARD16 control B16; /* control type */
+ CARD16 length B16; /* control length */
+ CARD8 enable;
+ CARD8 pad0;
+ CARD16 pad1 B16;
+} xDeviceEnableState;
+
+/*********************************************************
+ *
+ * ChangeDeviceControl.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_ChangeDeviceControl */
+ CARD16 length B16;
+ CARD16 control B16;
+ CARD8 deviceid;
+ BYTE pad0;
+} xChangeDeviceControlReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_ChangeDeviceControl */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 status;
+ BYTE pad1, pad2, pad3;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+} xChangeDeviceControlReply;
+
+typedef struct {
+ CARD16 control B16; /* control type */
+ CARD16 length B16; /* control length */
+} xDeviceCtl;
+
+typedef struct {
+ CARD16 control B16; /* control type */
+ CARD16 length B16; /* control length */
+ CARD8 first_valuator; /* first valuator to change */
+ CARD8 num_valuators; /* number of valuators to change*/
+ CARD8 pad1,pad2;
+} xDeviceResolutionCtl;
+
+typedef struct {
+ CARD16 control B16;
+ CARD16 length B16;
+ INT32 min_x;
+ INT32 max_x;
+ INT32 min_y;
+ INT32 max_y;
+ CARD32 flip_x;
+ CARD32 flip_y;
+ CARD32 rotation;
+ CARD32 button_threshold;
+} xDeviceAbsCalibCtl;
+
+typedef struct {
+ CARD16 control B16;
+ CARD16 length B16;
+ CARD32 offset_x;
+ CARD32 offset_y;
+ INT32 width;
+ INT32 height;
+ INT32 screen;
+ CARD32 following;
+} xDeviceAbsAreaCtl;
+
+typedef struct {
+ CARD16 control B16;
+ CARD16 length B16;
+ CARD8 status;
+ CARD8 pad0;
+ CARD16 pad1 B16;
+} xDeviceCoreCtl;
+
+typedef struct {
+ CARD16 control B16;
+ CARD16 length B16;
+ CARD8 enable;
+ CARD8 pad0;
+ CARD16 pad1 B16;
+} xDeviceEnableCtl;
+
+/**********************************************************
+ *
+ * Input extension events.
+ *
+ * DeviceValuator
+ *
+ */
+
+typedef struct
+ {
+ BYTE type;
+ CARD8 deviceid;
+ CARD16 sequenceNumber B16;
+ KeyButMask device_state B16;
+ CARD8 num_valuators;
+ CARD8 first_valuator;
+ INT32 valuator0 B32;
+ INT32 valuator1 B32;
+ INT32 valuator2 B32;
+ INT32 valuator3 B32;
+ INT32 valuator4 B32;
+ INT32 valuator5 B32;
+ } deviceValuator;
+
+/**********************************************************
+ *
+ * DeviceKeyButtonPointer.
+ *
+ * Used for: DeviceKeyPress, DeviceKeyRelease,
+ * DeviceButtonPress, DeviceButtonRelease,
+ * ProximityIn, ProximityOut
+ * DeviceMotionNotify,
+ *
+ */
+
+typedef struct
+ {
+ BYTE type;
+ BYTE detail;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ Window root B32;
+ Window event B32;
+ Window child B32;
+ INT16 root_x B16;
+ INT16 root_y B16;
+ INT16 event_x B16;
+ INT16 event_y B16;
+ KeyButMask state B16;
+ BOOL same_screen;
+ CARD8 deviceid;
+ } deviceKeyButtonPointer;
+
+/**********************************************************
+ *
+ * DeviceFocus.
+ *
+ */
+
+typedef struct
+ {
+ BYTE type;
+ BYTE detail;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ Window window B32;
+ BYTE mode;
+ CARD8 deviceid;
+ BYTE pad1, pad2;
+ CARD32 pad00 B32;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ } deviceFocus;
+
+/**********************************************************
+ *
+ * DeviceStateNotify.
+ *
+ * Note that the two high-order bits in the classes_reported
+ * field are the proximity state (InProximity or OutOfProximity),
+ * and the device mode (Absolute or Relative), respectively.
+ *
+ */
+
+typedef struct
+ {
+ BYTE type;
+ BYTE deviceid;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ CARD8 num_keys;
+ CARD8 num_buttons;
+ CARD8 num_valuators;
+ CARD8 classes_reported;
+ CARD8 buttons[4];
+ CARD8 keys[4];
+ INT32 valuator0 B32;
+ INT32 valuator1 B32;
+ INT32 valuator2 B32;
+ } deviceStateNotify;
+
+/**********************************************************
+ *
+ * DeviceKeyStateNotify.
+ *
+ */
+
+typedef struct
+ {
+ BYTE type;
+ BYTE deviceid;
+ CARD16 sequenceNumber B16;
+ CARD8 keys[28];
+ } deviceKeyStateNotify;
+
+/**********************************************************
+ *
+ * DeviceButtonStateNotify.
+ *
+ */
+
+typedef struct
+ {
+ BYTE type;
+ BYTE deviceid;
+ CARD16 sequenceNumber B16;
+ CARD8 buttons[28];
+ } deviceButtonStateNotify;
+
+/**********************************************************
+ *
+ * DeviceMappingNotify.
+ * Fields must be kept in sync with core mappingnotify event.
+ *
+ */
+
+typedef struct
+ {
+ BYTE type;
+ BYTE deviceid;
+ CARD16 sequenceNumber B16;
+ CARD8 request;
+ KeyCode firstKeyCode;
+ CARD8 count;
+ BYTE pad1;
+ Time time B32;
+ CARD32 pad00 B32;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ } deviceMappingNotify;
+
+/**********************************************************
+ *
+ * ChangeDeviceNotify.
+ *
+ */
+
+typedef struct
+ {
+ BYTE type;
+ BYTE deviceid;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ CARD8 request;
+ BYTE pad1, pad2, pad3;
+ CARD32 pad00 B32;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ } changeDeviceNotify;
+
+/**********************************************************
+ *
+ * devicePresenceNotify.
+ *
+ */
+
+typedef struct
+ {
+ BYTE type;
+ BYTE pad00;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ BYTE devchange; /* Device{Added|Removed|Enabled|Disabled} */
+ BYTE deviceid;
+ CARD16 control B16;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+ CARD32 pad06 B32;
+ } devicePresenceNotify;
+
+#undef Window
+#undef Time
+#undef KeyCode
+
+#endif
diff --git a/sysroot/usr/include/X11/extensions/XKB.h b/sysroot/usr/include/X11/extensions/XKB.h
new file mode 100644
index 0000000..a915317
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/XKB.h
@@ -0,0 +1,788 @@
+/* $Xorg: XKB.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */
+/************************************************************
+Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
+
+Permission to use, copy, modify, and distribute this
+software and its documentation for any purpose and without
+fee is hereby granted, provided that the above copyright
+notice appear in all copies and that both that copyright
+notice and this permission notice appear in supporting
+documentation, and that the name of Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
+of the software without specific prior written permission.
+Silicon Graphics makes no representation about the suitability
+of this software for any purpose. It is provided "as is"
+without any express or implied warranty.
+
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
+THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+********************************************************/
+/* $XFree86: xc/include/extensions/XKB.h,v 1.5tsi Exp $ */
+
+#ifndef _XKB_H_
+#define _XKB_H_
+
+ /*
+ * XKB request codes, used in:
+ * - xkbReqType field of all requests
+ * - requestMinor field of some events
+ */
+#define X_kbUseExtension 0
+#define X_kbSelectEvents 1
+#define X_kbBell 3
+#define X_kbGetState 4
+#define X_kbLatchLockState 5
+#define X_kbGetControls 6
+#define X_kbSetControls 7
+#define X_kbGetMap 8
+#define X_kbSetMap 9
+#define X_kbGetCompatMap 10
+#define X_kbSetCompatMap 11
+#define X_kbGetIndicatorState 12
+#define X_kbGetIndicatorMap 13
+#define X_kbSetIndicatorMap 14
+#define X_kbGetNamedIndicator 15
+#define X_kbSetNamedIndicator 16
+#define X_kbGetNames 17
+#define X_kbSetNames 18
+#define X_kbGetGeometry 19
+#define X_kbSetGeometry 20
+#define X_kbPerClientFlags 21
+#define X_kbListComponents 22
+#define X_kbGetKbdByName 23
+#define X_kbGetDeviceInfo 24
+#define X_kbSetDeviceInfo 25
+#define X_kbSetDebuggingFlags 101
+
+ /*
+ * In the X sense, XKB reports only one event.
+ * The type field of all XKB events is XkbEventCode
+ */
+#define XkbEventCode 0
+#define XkbNumberEvents (XkbEventCode+1)
+
+ /*
+ * XKB has a minor event code so it can use one X event code for
+ * multiple purposes.
+ * - reported in the xkbType field of all XKB events.
+ * - XkbSelectEventDetails: Indicates the event for which event details
+ * are being changed
+ */
+#define XkbNewKeyboardNotify 0
+#define XkbMapNotify 1
+#define XkbStateNotify 2
+#define XkbControlsNotify 3
+#define XkbIndicatorStateNotify 4
+#define XkbIndicatorMapNotify 5
+#define XkbNamesNotify 6
+#define XkbCompatMapNotify 7
+#define XkbBellNotify 8
+#define XkbActionMessage 9
+#define XkbAccessXNotify 10
+#define XkbExtensionDeviceNotify 11
+
+ /*
+ * Event Mask:
+ * - XkbSelectEvents: Specifies event interest.
+ */
+#define XkbNewKeyboardNotifyMask (1L << 0)
+#define XkbMapNotifyMask (1L << 1)
+#define XkbStateNotifyMask (1L << 2)
+#define XkbControlsNotifyMask (1L << 3)
+#define XkbIndicatorStateNotifyMask (1L << 4)
+#define XkbIndicatorMapNotifyMask (1L << 5)
+#define XkbNamesNotifyMask (1L << 6)
+#define XkbCompatMapNotifyMask (1L << 7)
+#define XkbBellNotifyMask (1L << 8)
+#define XkbActionMessageMask (1L << 9)
+#define XkbAccessXNotifyMask (1L << 10)
+#define XkbExtensionDeviceNotifyMask (1L << 11)
+#define XkbAllEventsMask (0xFFF)
+
+ /*
+ * NewKeyboardNotify event details:
+ */
+#define XkbNKN_KeycodesMask (1L << 0)
+#define XkbNKN_GeometryMask (1L << 1)
+#define XkbNKN_DeviceIDMask (1L << 2)
+#define XkbAllNewKeyboardEventsMask (0x7)
+
+ /*
+ * AccessXNotify event types:
+ * - The 'what' field of AccessXNotify events reports the
+ * reason that the event was generated.
+ */
+#define XkbAXN_SKPress 0
+#define XkbAXN_SKAccept 1
+#define XkbAXN_SKReject 2
+#define XkbAXN_SKRelease 3
+#define XkbAXN_BKAccept 4
+#define XkbAXN_BKReject 5
+#define XkbAXN_AXKWarning 6
+
+ /*
+ * AccessXNotify details:
+ * - Used as an event detail mask to limit the conditions under which
+ * AccessXNotify events are reported
+ */
+#define XkbAXN_SKPressMask (1L << 0)
+#define XkbAXN_SKAcceptMask (1L << 1)
+#define XkbAXN_SKRejectMask (1L << 2)
+#define XkbAXN_SKReleaseMask (1L << 3)
+#define XkbAXN_BKAcceptMask (1L << 4)
+#define XkbAXN_BKRejectMask (1L << 5)
+#define XkbAXN_AXKWarningMask (1L << 6)
+#define XkbAllAccessXEventsMask (0xf)
+
+ /*
+ * Miscellaneous event details:
+ * - event detail masks for assorted events that don't reall
+ * have any details.
+ */
+#define XkbAllStateEventsMask XkbAllStateComponentsMask
+#define XkbAllMapEventsMask XkbAllMapComponentsMask
+#define XkbAllControlEventsMask XkbAllControlsMask
+#define XkbAllIndicatorEventsMask XkbAllIndicatorsMask
+#define XkbAllNameEventsMask XkbAllNamesMask
+#define XkbAllCompatMapEventsMask XkbAllCompatMask
+#define XkbAllBellEventsMask (1L << 0)
+#define XkbAllActionMessagesMask (1L << 0)
+
+ /*
+ * XKB reports one error: BadKeyboard
+ * A further reason for the error is encoded into to most significant
+ * byte of the resourceID for the error:
+ * XkbErr_BadDevice - the device in question was not found
+ * XkbErr_BadClass - the device was found but it doesn't belong to
+ * the appropriate class.
+ * XkbErr_BadId - the device was found and belongs to the right
+ * class, but not feedback with a matching id was
+ * found.
+ * The low byte of the resourceID for this error contains the device
+ * id, class specifier or feedback id that failed.
+ */
+#define XkbKeyboard 0
+#define XkbNumberErrors 1
+
+#define XkbErr_BadDevice 0xff
+#define XkbErr_BadClass 0xfe
+#define XkbErr_BadId 0xfd
+
+ /*
+ * Keyboard Components Mask:
+ * - Specifies the components that follow a GetKeyboardByNameReply
+ */
+#define XkbClientMapMask (1L << 0)
+#define XkbServerMapMask (1L << 1)
+#define XkbCompatMapMask (1L << 2)
+#define XkbIndicatorMapMask (1L << 3)
+#define XkbNamesMask (1L << 4)
+#define XkbGeometryMask (1L << 5)
+#define XkbControlsMask (1L << 6)
+#define XkbAllComponentsMask (0x7f)
+
+ /*
+ * State detail mask:
+ * - The 'changed' field of StateNotify events reports which of
+ * the keyboard state components have changed.
+ * - Used as an event detail mask to limit the conditions under
+ * which StateNotify events are reported.
+ */
+#define XkbModifierStateMask (1L << 0)
+#define XkbModifierBaseMask (1L << 1)
+#define XkbModifierLatchMask (1L << 2)
+#define XkbModifierLockMask (1L << 3)
+#define XkbGroupStateMask (1L << 4)
+#define XkbGroupBaseMask (1L << 5)
+#define XkbGroupLatchMask (1L << 6)
+#define XkbGroupLockMask (1L << 7)
+#define XkbCompatStateMask (1L << 8)
+#define XkbGrabModsMask (1L << 9)
+#define XkbCompatGrabModsMask (1L << 10)
+#define XkbLookupModsMask (1L << 11)
+#define XkbCompatLookupModsMask (1L << 12)
+#define XkbPointerButtonMask (1L << 13)
+#define XkbAllStateComponentsMask (0x3fff)
+
+ /*
+ * Controls detail masks:
+ * The controls specified in XkbAllControlsMask:
+ * - The 'changed' field of ControlsNotify events reports which of
+ * the keyboard controls have changed.
+ * - The 'changeControls' field of the SetControls request specifies
+ * the controls for which values are to be changed.
+ * - Used as an event detail mask to limit the conditions under
+ * which ControlsNotify events are reported.
+ *
+ * The controls specified in the XkbAllBooleanCtrlsMask:
+ * - The 'enabledControls' field of ControlsNotify events reports the
+ * current status of the boolean controls.
+ * - The 'enabledControlsChanges' field of ControlsNotify events reports
+ * any boolean controls that have been turned on or off.
+ * - The 'affectEnabledControls' and 'enabledControls' fields of the
+ * kbSetControls request change the set of enabled controls.
+ * - The 'accessXTimeoutMask' and 'accessXTimeoutValues' fields of
+ * an XkbControlsRec specify the controls to be changed if the keyboard
+ * times out and the values to which they should be changed.
+ * - The 'autoCtrls' and 'autoCtrlsValues' fields of the PerClientFlags
+ * request specifies the specify the controls to be reset when the
+ * client exits and the values to which they should be reset.
+ * - The 'ctrls' field of an indicator map specifies the controls
+ * that drive the indicator.
+ * - Specifies the boolean controls affected by the SetControls and
+ * LockControls key actions.
+ */
+#define XkbRepeatKeysMask (1L << 0)
+#define XkbSlowKeysMask (1L << 1)
+#define XkbBounceKeysMask (1L << 2)
+#define XkbStickyKeysMask (1L << 3)
+#define XkbMouseKeysMask (1L << 4)
+#define XkbMouseKeysAccelMask (1L << 5)
+#define XkbAccessXKeysMask (1L << 6)
+#define XkbAccessXTimeoutMask (1L << 7)
+#define XkbAccessXFeedbackMask (1L << 8)
+#define XkbAudibleBellMask (1L << 9)
+#define XkbOverlay1Mask (1L << 10)
+#define XkbOverlay2Mask (1L << 11)
+#define XkbIgnoreGroupLockMask (1L << 12)
+#define XkbGroupsWrapMask (1L << 27)
+#define XkbInternalModsMask (1L << 28)
+#define XkbIgnoreLockModsMask (1L << 29)
+#define XkbPerKeyRepeatMask (1L << 30)
+#define XkbControlsEnabledMask (1L << 31)
+
+#define XkbAccessXOptionsMask (XkbStickyKeysMask|XkbAccessXFeedbackMask)
+
+#define XkbAllBooleanCtrlsMask (0x00001FFF)
+#define XkbAllControlsMask (0xF8001FFF)
+#define XkbAllControlEventsMask XkbAllControlsMask
+
+ /*
+ * AccessX Options Mask
+ * - The 'accessXOptions' field of an XkbControlsRec specifies the
+ * AccessX options that are currently in effect.
+ * - The 'accessXTimeoutOptionsMask' and 'accessXTimeoutOptionsValues'
+ * fields of an XkbControlsRec specify the Access X options to be
+ * changed if the keyboard times out and the values to which they
+ * should be changed.
+ */
+#define XkbAX_SKPressFBMask (1L << 0)
+#define XkbAX_SKAcceptFBMask (1L << 1)
+#define XkbAX_FeatureFBMask (1L << 2)
+#define XkbAX_SlowWarnFBMask (1L << 3)
+#define XkbAX_IndicatorFBMask (1L << 4)
+#define XkbAX_StickyKeysFBMask (1L << 5)
+#define XkbAX_TwoKeysMask (1L << 6)
+#define XkbAX_LatchToLockMask (1L << 7)
+#define XkbAX_SKReleaseFBMask (1L << 8)
+#define XkbAX_SKRejectFBMask (1L << 9)
+#define XkbAX_BKRejectFBMask (1L << 10)
+#define XkbAX_DumbBellFBMask (1L << 11)
+#define XkbAX_FBOptionsMask (0xF3F)
+#define XkbAX_SKOptionsMask (0x0C0)
+#define XkbAX_AllOptionsMask (0xFFF)
+
+ /*
+ * XkbUseCoreKbd is used to specify the core keyboard without having
+ * to look up its X input extension identifier.
+ * XkbUseCorePtr is used to specify the core pointer without having
+ * to look up its X input extension identifier.
+ * XkbDfltXIClass is used to specify "don't care" any place that the
+ * XKB protocol is looking for an X Input Extension
+ * device class.
+ * XkbDfltXIId is used to specify "don't care" any place that the
+ * XKB protocol is looking for an X Input Extension
+ * feedback identifier.
+ * XkbAllXIClasses is used to get information about all device indicators,
+ * whether they're part of the indicator feedback class
+ * or the keyboard feedback class.
+ * XkbAllXIIds is used to get information about all device indicator
+ * feedbacks without having to list them.
+ * XkbXINone is used to indicate that no class or id has been specified.
+ * XkbLegalXILedClass(c) True if 'c' specifies a legal class with LEDs
+ * XkbLegalXIBellClass(c) True if 'c' specifies a legal class with bells
+ * XkbExplicitXIDevice(d) True if 'd' explicitly specifies a device
+ * XkbExplicitXIClass(c) True if 'c' explicitly specifies a device class
+ * XkbExplicitXIId(c) True if 'i' explicitly specifies a device id
+ * XkbSingleXIClass(c) True if 'c' specifies exactly one device class,
+ * including the default.
+ * XkbSingleXIId(i) True if 'i' specifies exactly one device
+ * identifier, including the default.
+ */
+#define XkbUseCoreKbd 0x0100
+#define XkbUseCorePtr 0x0200
+#define XkbDfltXIClass 0x0300
+#define XkbDfltXIId 0x0400
+#define XkbAllXIClasses 0x0500
+#define XkbAllXIIds 0x0600
+#define XkbXINone 0xff00
+
+#define XkbLegalXILedClass(c) (((c)==KbdFeedbackClass)||\
+ ((c)==LedFeedbackClass)||\
+ ((c)==XkbDfltXIClass)||\
+ ((c)==XkbAllXIClasses))
+#define XkbLegalXIBellClass(c) (((c)==KbdFeedbackClass)||\
+ ((c)==BellFeedbackClass)||\
+ ((c)==XkbDfltXIClass)||\
+ ((c)==XkbAllXIClasses))
+#define XkbExplicitXIDevice(c) (((c)&(~0xff))==0)
+#define XkbExplicitXIClass(c) (((c)&(~0xff))==0)
+#define XkbExplicitXIId(c) (((c)&(~0xff))==0)
+#define XkbSingleXIClass(c) ((((c)&(~0xff))==0)||((c)==XkbDfltXIClass))
+#define XkbSingleXIId(c) ((((c)&(~0xff))==0)||((c)==XkbDfltXIId))
+
+#define XkbNoModifier 0xff
+#define XkbNoShiftLevel 0xff
+#define XkbNoShape 0xff
+#define XkbNoIndicator 0xff
+
+#define XkbNoModifierMask 0
+#define XkbAllModifiersMask 0xff
+#define XkbAllVirtualModsMask 0xffff
+
+#define XkbNumKbdGroups 4
+#define XkbMaxKbdGroup (XkbNumKbdGroups-1)
+
+#define XkbMaxMouseKeysBtn 4
+
+ /*
+ * Group Index and Mask:
+ * - Indices into the kt_index array of a key type.
+ * - Mask specifies types to be changed for XkbChangeTypesOfKey
+ */
+#define XkbGroup1Index 0
+#define XkbGroup2Index 1
+#define XkbGroup3Index 2
+#define XkbGroup4Index 3
+#define XkbAnyGroup 254
+#define XkbAllGroups 255
+
+#define XkbGroup1Mask (1<<0)
+#define XkbGroup2Mask (1<<1)
+#define XkbGroup3Mask (1<<2)
+#define XkbGroup4Mask (1<<3)
+#define XkbAnyGroupMask (1<<7)
+#define XkbAllGroupsMask (0xf)
+
+ /*
+ * BuildCoreState: Given a keyboard group and a modifier state,
+ * construct the value to be reported an event.
+ * GroupForCoreState: Given the state reported in an event,
+ * determine the keyboard group.
+ * IsLegalGroup: Returns TRUE if 'g' is a valid group index.
+ */
+#define XkbBuildCoreState(m,g) ((((g)&0x3)<<13)|((m)&0xff))
+#define XkbGroupForCoreState(s) (((s)>>13)&0x3)
+#define XkbIsLegalGroup(g) (((g)>=0)&&((g)<XkbNumKbdGroups))
+
+ /*
+ * GroupsWrap values:
+ * - The 'groupsWrap' field of an XkbControlsRec specifies the
+ * treatment of out of range groups.
+ * - Bits 6 and 7 of the group info field of a key symbol map
+ * specify the interpretation of out of range groups for the
+ * corresponding key.
+ */
+#define XkbWrapIntoRange (0x00)
+#define XkbClampIntoRange (0x40)
+#define XkbRedirectIntoRange (0x80)
+
+ /*
+ * Action flags: Reported in the 'flags' field of most key actions.
+ * Interpretation depends on the type of the action; not all actions
+ * accept all flags.
+ *
+ * Option Used for Actions
+ * ------ ----------------
+ * ClearLocks SetMods, LatchMods, SetGroup, LatchGroup
+ * LatchToLock SetMods, LatchMods, SetGroup, LatchGroup
+ * LockNoLock LockMods, ISOLock, LockPtrBtn, LockDeviceBtn
+ * LockNoUnlock LockMods, ISOLock, LockPtrBtn, LockDeviceBtn
+ * UseModMapMods SetMods, LatchMods, LockMods, ISOLock
+ * GroupAbsolute SetGroup, LatchGroup, LockGroup, ISOLock
+ * UseDfltButton PtrBtn, LockPtrBtn
+ * NoAcceleration MovePtr
+ * MoveAbsoluteX MovePtr
+ * MoveAbsoluteY MovePtr
+ * ISODfltIsGroup ISOLock
+ * ISONoAffectMods ISOLock
+ * ISONoAffectGroup ISOLock
+ * ISONoAffectPtr ISOLock
+ * ISONoAffectCtrls ISOLock
+ * MessageOnPress ActionMessage
+ * MessageOnRelease ActionMessage
+ * MessageGenKeyEvent ActionMessage
+ * AffectDfltBtn SetPtrDflt
+ * DfltBtnAbsolute SetPtrDflt
+ * SwitchApplication SwitchScreen
+ * SwitchAbsolute SwitchScreen
+ */
+
+#define XkbSA_ClearLocks (1L << 0)
+#define XkbSA_LatchToLock (1L << 1)
+
+#define XkbSA_LockNoLock (1L << 0)
+#define XkbSA_LockNoUnlock (1L << 1)
+
+#define XkbSA_UseModMapMods (1L << 2)
+
+#define XkbSA_GroupAbsolute (1L << 2)
+#define XkbSA_UseDfltButton 0
+
+#define XkbSA_NoAcceleration (1L << 0)
+#define XkbSA_MoveAbsoluteX (1L << 1)
+#define XkbSA_MoveAbsoluteY (1L << 2)
+
+#define XkbSA_ISODfltIsGroup (1L << 7)
+#define XkbSA_ISONoAffectMods (1L << 6)
+#define XkbSA_ISONoAffectGroup (1L << 5)
+#define XkbSA_ISONoAffectPtr (1L << 4)
+#define XkbSA_ISONoAffectCtrls (1L << 3)
+#define XkbSA_ISOAffectMask (0x78)
+
+#define XkbSA_MessageOnPress (1L << 0)
+#define XkbSA_MessageOnRelease (1L << 1)
+#define XkbSA_MessageGenKeyEvent (1L << 2)
+
+#define XkbSA_AffectDfltBtn 1
+#define XkbSA_DfltBtnAbsolute (1L << 2)
+
+#define XkbSA_SwitchApplication (1L << 0)
+#define XkbSA_SwitchAbsolute (1L << 2)
+
+ /*
+ * The following values apply to the SA_DeviceValuator
+ * action only. Valuator operations specify the action
+ * to be taken. Values specified in the action are
+ * multiplied by 2^scale before they are applied.
+ */
+#define XkbSA_IgnoreVal (0x00)
+#define XkbSA_SetValMin (0x10)
+#define XkbSA_SetValCenter (0x20)
+#define XkbSA_SetValMax (0x30)
+#define XkbSA_SetValRelative (0x40)
+#define XkbSA_SetValAbsolute (0x50)
+#define XkbSA_ValOpMask (0x70)
+#define XkbSA_ValScaleMask (0x07)
+#define XkbSA_ValOp(a) ((a)&XkbSA_ValOpMask)
+#define XkbSA_ValScale(a) ((a)&XkbSA_ValScaleMask)
+
+ /*
+ * Action types: specifies the type of a key action. Reported in the
+ * type field of all key actions.
+ */
+#define XkbSA_NoAction 0x00
+#define XkbSA_SetMods 0x01
+#define XkbSA_LatchMods 0x02
+#define XkbSA_LockMods 0x03
+#define XkbSA_SetGroup 0x04
+#define XkbSA_LatchGroup 0x05
+#define XkbSA_LockGroup 0x06
+#define XkbSA_MovePtr 0x07
+#define XkbSA_PtrBtn 0x08
+#define XkbSA_LockPtrBtn 0x09
+#define XkbSA_SetPtrDflt 0x0a
+#define XkbSA_ISOLock 0x0b
+#define XkbSA_Terminate 0x0c
+#define XkbSA_SwitchScreen 0x0d
+#define XkbSA_SetControls 0x0e
+#define XkbSA_LockControls 0x0f
+#define XkbSA_ActionMessage 0x10
+#define XkbSA_RedirectKey 0x11
+#define XkbSA_DeviceBtn 0x12
+#define XkbSA_LockDeviceBtn 0x13
+#define XkbSA_DeviceValuator 0x14
+#define XkbSA_LastAction XkbSA_DeviceValuator
+#define XkbSA_NumActions (XkbSA_LastAction+1)
+
+#define XkbSA_XFree86Private 0x86
+
+ /*
+ * Specifies the key actions that clear latched groups or modifiers.
+ */
+#define XkbSA_BreakLatch \
+ ((1<<XkbSA_NoAction)|(1<<XkbSA_PtrBtn)|(1<<XkbSA_LockPtrBtn)|\
+ (1<<XkbSA_Terminate)|(1<<XkbSA_SwitchScreen)|(1<<XkbSA_SetControls)|\
+ (1<<XkbSA_LockControls)|(1<<XkbSA_ActionMessage)|\
+ (1<<XkbSA_RedirectKey)|(1<<XkbSA_DeviceBtn)|(1<<XkbSA_LockDeviceBtn))
+
+ /*
+ * Macros to classify key actions
+ */
+#define XkbIsModAction(a) (((a)->type>=Xkb_SASetMods)&&((a)->type<=XkbSA_LockMods))
+#define XkbIsGroupAction(a) (((a)->type>=XkbSA_SetGroup)&&((a)->type<=XkbSA_LockGroup))
+#define XkbIsPtrAction(a) (((a)->type>=XkbSA_MovePtr)&&((a)->type<=XkbSA_SetPtrDflt))
+
+
+ /*
+ * Key Behavior Qualifier:
+ * KB_Permanent indicates that the behavior describes an unalterable
+ * characteristic of the keyboard, not an XKB software-simulation of
+ * the listed behavior.
+ * Key Behavior Types:
+ * Specifies the behavior of the underlying key.
+ */
+#define XkbKB_Permanent 0x80
+#define XkbKB_OpMask 0x7f
+
+#define XkbKB_Default 0x00
+#define XkbKB_Lock 0x01
+#define XkbKB_RadioGroup 0x02
+#define XkbKB_Overlay1 0x03
+#define XkbKB_Overlay2 0x04
+
+#define XkbKB_RGAllowNone 0x80
+
+ /*
+ * Various macros which describe the range of legal keycodes.
+ */
+#define XkbMinLegalKeyCode 8
+#define XkbMaxLegalKeyCode 255
+#define XkbMaxKeyCount (XkbMaxLegalKeyCode-XkbMinLegalKeyCode+1)
+#define XkbPerKeyBitArraySize ((XkbMaxLegalKeyCode+1)/8)
+/* Seems kinda silly to check that an unsigned char is <= 255... */
+#define XkbIsLegalKeycode(k) ((k)>=XkbMinLegalKeyCode)
+
+ /*
+ * Assorted constants and limits.
+ */
+#define XkbNumModifiers 8
+#define XkbNumVirtualMods 16
+#define XkbNumIndicators 32
+#define XkbAllIndicatorsMask (0xffffffff)
+#define XkbMaxRadioGroups 32
+#define XkbAllRadioGroupsMask (0xffffffff)
+#define XkbMaxShiftLevel 63
+#define XkbMaxSymsPerKey (XkbMaxShiftLevel*XkbNumKbdGroups)
+#define XkbRGMaxMembers 12
+#define XkbActionMessageLength 6
+#define XkbKeyNameLength 4
+#define XkbMaxRedirectCount 8
+
+#define XkbGeomPtsPerMM 10
+#define XkbGeomMaxColors 32
+#define XkbGeomMaxLabelColors 3
+#define XkbGeomMaxPriority 255
+
+ /*
+ * Key Type index and mask for the four standard key types.
+ */
+#define XkbOneLevelIndex 0
+#define XkbTwoLevelIndex 1
+#define XkbAlphabeticIndex 2
+#define XkbKeypadIndex 3
+#define XkbLastRequiredType XkbKeypadIndex
+#define XkbNumRequiredTypes (XkbLastRequiredType+1)
+#define XkbMaxKeyTypes 255
+
+#define XkbOneLevelMask (1<<0)
+#define XkbTwoLevelMask (1<<1)
+#define XkbAlphabeticMask (1<<2)
+#define XkbKeypadMask (1<<3)
+#define XkbAllRequiredTypes (0xf)
+
+#define XkbShiftLevel(n) ((n)-1)
+#define XkbShiftLevelMask(n) (1<<((n)-1))
+
+ /*
+ * Extension name and version information
+ */
+#define XkbName "XKEYBOARD"
+#define XkbMajorVersion 1
+#define XkbMinorVersion 0
+
+ /*
+ * Explicit map components:
+ * - Used in the 'explicit' field of an XkbServerMap. Specifies
+ * the keyboard components that should _not_ be updated automatically
+ * in response to core protocol keyboard mapping requests.
+ */
+#define XkbExplicitKeyTypesMask (0x0f)
+#define XkbExplicitKeyType1Mask (1<<0)
+#define XkbExplicitKeyType2Mask (1<<1)
+#define XkbExplicitKeyType3Mask (1<<2)
+#define XkbExplicitKeyType4Mask (1<<3)
+#define XkbExplicitInterpretMask (1<<4)
+#define XkbExplicitAutoRepeatMask (1<<5)
+#define XkbExplicitBehaviorMask (1<<6)
+#define XkbExplicitVModMapMask (1<<7)
+#define XkbAllExplicitMask (0xff)
+
+ /*
+ * Map components masks:
+ * Those in AllMapComponentsMask:
+ * - Specifies the individual fields to be loaded or changed for the
+ * GetMap and SetMap requests.
+ * Those in ClientInfoMask:
+ * - Specifies the components to be allocated by XkbAllocClientMap.
+ * Those in ServerInfoMask:
+ * - Specifies the components to be allocated by XkbAllocServerMap.
+ */
+#define XkbKeyTypesMask (1<<0)
+#define XkbKeySymsMask (1<<1)
+#define XkbModifierMapMask (1<<2)
+#define XkbExplicitComponentsMask (1<<3)
+#define XkbKeyActionsMask (1<<4)
+#define XkbKeyBehaviorsMask (1<<5)
+#define XkbVirtualModsMask (1<<6)
+#define XkbVirtualModMapMask (1<<7)
+
+#define XkbAllClientInfoMask (XkbKeyTypesMask|XkbKeySymsMask|XkbModifierMapMask)
+#define XkbAllServerInfoMask (XkbExplicitComponentsMask|XkbKeyActionsMask|XkbKeyBehaviorsMask|XkbVirtualModsMask|XkbVirtualModMapMask)
+#define XkbAllMapComponentsMask (XkbAllClientInfoMask|XkbAllServerInfoMask)
+
+ /*
+ * Symbol interpretations flags:
+ * - Used in the flags field of a symbol interpretation
+ */
+#define XkbSI_AutoRepeat (1<<0)
+#define XkbSI_LockingKey (1<<1)
+
+ /*
+ * Symbol interpretations match specification:
+ * - Used in the match field of a symbol interpretation to specify
+ * the conditions under which an interpretation is used.
+ */
+#define XkbSI_LevelOneOnly (0x80)
+#define XkbSI_OpMask (0x7f)
+#define XkbSI_NoneOf (0)
+#define XkbSI_AnyOfOrNone (1)
+#define XkbSI_AnyOf (2)
+#define XkbSI_AllOf (3)
+#define XkbSI_Exactly (4)
+
+ /*
+ * Indicator map flags:
+ * - Used in the flags field of an indicator map to indicate the
+ * conditions under which and indicator can be changed and the
+ * effects of changing the indicator.
+ */
+#define XkbIM_NoExplicit (1L << 7)
+#define XkbIM_NoAutomatic (1L << 6)
+#define XkbIM_LEDDrivesKB (1L << 5)
+
+ /*
+ * Indicator map component specifications:
+ * - Used by the 'which_groups' and 'which_mods' fields of an indicator
+ * map to specify which keyboard components should be used to drive
+ * the indicator.
+ */
+#define XkbIM_UseBase (1L << 0)
+#define XkbIM_UseLatched (1L << 1)
+#define XkbIM_UseLocked (1L << 2)
+#define XkbIM_UseEffective (1L << 3)
+#define XkbIM_UseCompat (1L << 4)
+
+#define XkbIM_UseNone 0
+#define XkbIM_UseAnyGroup (XkbIM_UseBase|XkbIM_UseLatched|XkbIM_UseLocked\
+ |XkbIM_UseEffective)
+#define XkbIM_UseAnyMods (XkbIM_UseAnyGroup|XkbIM_UseCompat)
+
+ /*
+ * Compatibility Map Compontents:
+ * - Specifies the components to be allocated in XkbAllocCompatMap.
+ */
+#define XkbSymInterpMask (1<<0)
+#define XkbGroupCompatMask (1<<1)
+#define XkbAllCompatMask (0x3)
+
+ /*
+ * Names component mask:
+ * - Specifies the names to be loaded or changed for the GetNames and
+ * SetNames requests.
+ * - Specifies the names that have changed in a NamesNotify event.
+ * - Specifies the names components to be allocated by XkbAllocNames.
+ */
+#define XkbKeycodesNameMask (1<<0)
+#define XkbGeometryNameMask (1<<1)
+#define XkbSymbolsNameMask (1<<2)
+#define XkbPhysSymbolsNameMask (1<<3)
+#define XkbTypesNameMask (1<<4)
+#define XkbCompatNameMask (1<<5)
+#define XkbKeyTypeNamesMask (1<<6)
+#define XkbKTLevelNamesMask (1<<7)
+#define XkbIndicatorNamesMask (1<<8)
+#define XkbKeyNamesMask (1<<9)
+#define XkbKeyAliasesMask (1<<10)
+#define XkbVirtualModNamesMask (1<<11)
+#define XkbGroupNamesMask (1<<12)
+#define XkbRGNamesMask (1<<13)
+#define XkbComponentNamesMask (0x3f)
+#define XkbAllNamesMask (0x3fff)
+
+ /*
+ * GetByName components:
+ * - Specifies desired or necessary components to GetKbdByName request.
+ * - Reports the components that were found in a GetKbdByNameReply
+ */
+#define XkbGBN_TypesMask (1L << 0)
+#define XkbGBN_CompatMapMask (1L << 1)
+#define XkbGBN_ClientSymbolsMask (1L << 2)
+#define XkbGBN_ServerSymbolsMask (1L << 3)
+#define XkbGBN_SymbolsMask (XkbGBN_ClientSymbolsMask|XkbGBN_ServerSymbolsMask)
+#define XkbGBN_IndicatorMapMask (1L << 4)
+#define XkbGBN_KeyNamesMask (1L << 5)
+#define XkbGBN_GeometryMask (1L << 6)
+#define XkbGBN_OtherNamesMask (1L << 7)
+#define XkbGBN_AllComponentsMask (0xff)
+
+ /*
+ * ListComponents flags
+ */
+#define XkbLC_Hidden (1L << 0)
+#define XkbLC_Default (1L << 1)
+#define XkbLC_Partial (1L << 2)
+
+#define XkbLC_AlphanumericKeys (1L << 8)
+#define XkbLC_ModifierKeys (1L << 9)
+#define XkbLC_KeypadKeys (1L << 10)
+#define XkbLC_FunctionKeys (1L << 11)
+#define XkbLC_AlternateGroup (1L << 12)
+
+ /*
+ * X Input Extension Interactions
+ * - Specifies the possible interactions between XKB and the X input
+ * extension
+ * - Used to request (XkbGetDeviceInfo) or change (XKbSetDeviceInfo)
+ * XKB information about an extension device.
+ * - Reports the list of supported optional features in the reply to
+ * XkbGetDeviceInfo or in an XkbExtensionDeviceNotify event.
+ * XkbXI_UnsupportedFeature is reported in XkbExtensionDeviceNotify
+ * events to indicate an attempt to use an unsupported feature.
+ */
+#define XkbXI_KeyboardsMask (1L << 0)
+#define XkbXI_ButtonActionsMask (1L << 1)
+#define XkbXI_IndicatorNamesMask (1L << 2)
+#define XkbXI_IndicatorMapsMask (1L << 3)
+#define XkbXI_IndicatorStateMask (1L << 4)
+#define XkbXI_UnsupportedFeatureMask (1L << 15)
+#define XkbXI_AllFeaturesMask (0x001f)
+#define XkbXI_AllDeviceFeaturesMask (0x001e)
+
+#define XkbXI_IndicatorsMask (0x001c)
+#define XkbAllExtensionDeviceEventsMask (0x801f)
+
+ /*
+ * Per-Client Flags:
+ * - Specifies flags to be changed by the PerClientFlags request.
+ */
+#define XkbPCF_DetectableAutoRepeatMask (1L << 0)
+#define XkbPCF_GrabsUseXKBStateMask (1L << 1)
+#define XkbPCF_AutoResetControlsMask (1L << 2)
+#define XkbPCF_LookupStateWhenGrabbed (1L << 3)
+#define XkbPCF_SendEventUsesXKBState (1L << 4)
+#define XkbPCF_AllFlagsMask (0x1F)
+
+ /*
+ * Debugging flags and controls
+ */
+#define XkbDF_DisableLocks (1<<0)
+
+#endif /* _XKB_H_ */
diff --git a/sysroot/usr/include/X11/extensions/XKBgeom.h b/sysroot/usr/include/X11/extensions/XKBgeom.h
new file mode 100644
index 0000000..89f902f
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/XKBgeom.h
@@ -0,0 +1,659 @@
+/* $Xorg: XKBgeom.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */
+/************************************************************
+Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
+
+Permission to use, copy, modify, and distribute this
+software and its documentation for any purpose and without
+fee is hereby granted, provided that the above copyright
+notice appear in all copies and that both that copyright
+notice and this permission notice appear in supporting
+documentation, and that the name of Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
+of the software without specific prior written permission.
+Silicon Graphics makes no representation about the suitability
+of this software for any purpose. It is provided "as is"
+without any express or implied warranty.
+
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
+THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+********************************************************/
+/* $XFree86: xc/include/extensions/XKBgeom.h,v 3.9 2002/09/18 17:11:40 tsi Exp $ */
+
+#ifndef _XKBGEOM_H_
+#define _XKBGEOM_H_
+
+#include <X11/extensions/XKBstr.h>
+
+#ifdef XKB_IN_SERVER
+#define XkbAddGeomKeyAlias SrvXkbAddGeomKeyAlias
+#define XkbAddGeomColor SrvXkbAddGeomColor
+#define XkbAddGeomDoodad SrvXkbAddGeomDoodad
+#define XkbAddGeomKey SrvXkbAddGeomKey
+#define XkbAddGeomOutline SrvXkbAddGeomOutline
+#define XkbAddGeomOverlay SrvXkbAddGeomOverlay
+#define XkbAddGeomOverlayRow SrvXkbAddGeomOverlayRow
+#define XkbAddGeomOverlayKey SrvXkbAddGeomOverlayKey
+#define XkbAddGeomProperty SrvXkbAddGeomProperty
+#define XkbAddGeomRow SrvXkbAddGeomRow
+#define XkbAddGeomSection SrvXkbAddGeomSection
+#define XkbAddGeomShape SrvXkbAddGeomShape
+#define XkbAllocGeomKeyAliases SrvXkbAllocGeomKeyAliases
+#define XkbAllocGeomColors SrvXkbAllocGeomColors
+#define XkbAllocGeomDoodads SrvXkbAllocGeomDoodads
+#define XkbAllocGeomKeys SrvXkbAllocGeomKeys
+#define XkbAllocGeomOutlines SrvXkbAllocGeomOutlines
+#define XkbAllocGeomPoints SrvXkbAllocGeomPoints
+#define XkbAllocGeomProps SrvXkbAllocGeomProps
+#define XkbAllocGeomRows SrvXkbAllocGeomRows
+#define XkbAllocGeomSectionDoodads SrvXkbAllocGeomSectionDoodads
+#define XkbAllocGeomSections SrvXkbAllocGeomSections
+#define XkbAllocGeomOverlays SrvXkbAllocGeomOverlays
+#define XkbAllocGeomOverlayRows SrvXkbAllocGeomOverlayRows
+#define XkbAllocGeomOverlayKeys SrvXkbAllocGeomOverlayKeys
+#define XkbAllocGeomShapes SrvXkbAllocGeomShapes
+#define XkbAllocGeometry SrvXkbAllocGeometry
+#define XkbFreeGeomKeyAliases SrvXkbFreeGeomKeyAliases
+#define XkbFreeGeomColors SrvXkbFreeGeomColors
+#define XkbFreeGeomDoodads SrvXkbFreeGeomDoodads
+#define XkbFreeGeomProperties SrvXkbFreeGeomProperties
+#define XkbFreeGeomOverlayKeys SrvXkbFreeGeomOverlayKeys
+#define XkbFreeGeomOverlayRows SrvXkbFreeGeomOverlayRows
+#define XkbFreeGeomOverlays SrvXkbFreeGeomOverlays
+#define XkbFreeGeomKeys SrvXkbFreeGeomKeys
+#define XkbFreeGeomRows SrvXkbFreeGeomRows
+#define XkbFreeGeomSections SrvXkbFreeGeomSections
+#define XkbFreeGeomPoints SrvXkbFreeGeomPoints
+#define XkbFreeGeomOutlines SrvXkbFreeGeomOutlines
+#define XkbFreeGeomShapes SrvXkbFreeGeomShapes
+#define XkbFreeGeometry SrvXkbFreeGeometry
+#endif
+
+typedef struct _XkbProperty {
+ char *name;
+ char *value;
+} XkbPropertyRec,*XkbPropertyPtr;
+
+typedef struct _XkbColor {
+ unsigned int pixel;
+ char * spec;
+} XkbColorRec,*XkbColorPtr;
+
+typedef struct _XkbPoint {
+ short x;
+ short y;
+} XkbPointRec, *XkbPointPtr;
+
+typedef struct _XkbBounds {
+ short x1,y1;
+ short x2,y2;
+} XkbBoundsRec, *XkbBoundsPtr;
+#define XkbBoundsWidth(b) (((b)->x2)-((b)->x1))
+#define XkbBoundsHeight(b) (((b)->y2)-((b)->y1))
+
+typedef struct _XkbOutline {
+ unsigned short num_points;
+ unsigned short sz_points;
+ unsigned short corner_radius;
+ XkbPointPtr points;
+} XkbOutlineRec, *XkbOutlinePtr;
+
+typedef struct _XkbShape {
+ Atom name;
+ unsigned short num_outlines;
+ unsigned short sz_outlines;
+ XkbOutlinePtr outlines;
+ XkbOutlinePtr approx;
+ XkbOutlinePtr primary;
+ XkbBoundsRec bounds;
+} XkbShapeRec, *XkbShapePtr;
+#define XkbOutlineIndex(s,o) ((int)((o)-&(s)->outlines[0]))
+
+typedef struct _XkbShapeDoodad {
+ Atom name;
+ unsigned char type;
+ unsigned char priority;
+ short top;
+ short left;
+ short angle;
+ unsigned short color_ndx;
+ unsigned short shape_ndx;
+} XkbShapeDoodadRec, *XkbShapeDoodadPtr;
+#define XkbShapeDoodadColor(g,d) (&(g)->colors[(d)->color_ndx])
+#define XkbShapeDoodadShape(g,d) (&(g)->shapes[(d)->shape_ndx])
+#define XkbSetShapeDoodadColor(g,d,c) ((d)->color_ndx= (c)-&(g)->colors[0])
+#define XkbSetShapeDoodadShape(g,d,s) ((d)->shape_ndx= (s)-&(g)->shapes[0])
+
+typedef struct _XkbTextDoodad {
+ Atom name;
+ unsigned char type;
+ unsigned char priority;
+ short top;
+ short left;
+ short angle;
+ short width;
+ short height;
+ unsigned short color_ndx;
+ char * text;
+ char * font;
+} XkbTextDoodadRec, *XkbTextDoodadPtr;
+#define XkbTextDoodadColor(g,d) (&(g)->colors[(d)->color_ndx])
+#define XkbSetTextDoodadColor(g,d,c) ((d)->color_ndx= (c)-&(g)->colors[0])
+
+typedef struct _XkbIndicatorDoodad {
+ Atom name;
+ unsigned char type;
+ unsigned char priority;
+ short top;
+ short left;
+ short angle;
+ unsigned short shape_ndx;
+ unsigned short on_color_ndx;
+ unsigned short off_color_ndx;
+} XkbIndicatorDoodadRec, *XkbIndicatorDoodadPtr;
+#define XkbIndicatorDoodadShape(g,d) (&(g)->shapes[(d)->shape_ndx])
+#define XkbIndicatorDoodadOnColor(g,d) (&(g)->colors[(d)->on_color_ndx])
+#define XkbIndicatorDoodadOffColor(g,d) (&(g)->colors[(d)->off_color_ndx])
+#define XkbSetIndicatorDoodadOnColor(g,d,c) \
+ ((d)->on_color_ndx= (c)-&(g)->colors[0])
+#define XkbSetIndicatorDoodadOffColor(g,d,c) \
+ ((d)->off_color_ndx= (c)-&(g)->colors[0])
+#define XkbSetIndicatorDoodadShape(g,d,s) \
+ ((d)->shape_ndx= (s)-&(g)->shapes[0])
+
+typedef struct _XkbLogoDoodad {
+ Atom name;
+ unsigned char type;
+ unsigned char priority;
+ short top;
+ short left;
+ short angle;
+ unsigned short color_ndx;
+ unsigned short shape_ndx;
+ char * logo_name;
+} XkbLogoDoodadRec, *XkbLogoDoodadPtr;
+#define XkbLogoDoodadColor(g,d) (&(g)->colors[(d)->color_ndx])
+#define XkbLogoDoodadShape(g,d) (&(g)->shapes[(d)->shape_ndx])
+#define XkbSetLogoDoodadColor(g,d,c) ((d)->color_ndx= (c)-&(g)->colors[0])
+#define XkbSetLogoDoodadShape(g,d,s) ((d)->shape_ndx= (s)-&(g)->shapes[0])
+
+typedef struct _XkbAnyDoodad {
+ Atom name;
+ unsigned char type;
+ unsigned char priority;
+ short top;
+ short left;
+ short angle;
+} XkbAnyDoodadRec, *XkbAnyDoodadPtr;
+
+typedef union _XkbDoodad {
+ XkbAnyDoodadRec any;
+ XkbShapeDoodadRec shape;
+ XkbTextDoodadRec text;
+ XkbIndicatorDoodadRec indicator;
+ XkbLogoDoodadRec logo;
+} XkbDoodadRec, *XkbDoodadPtr;
+
+#define XkbUnknownDoodad 0
+#define XkbOutlineDoodad 1
+#define XkbSolidDoodad 2
+#define XkbTextDoodad 3
+#define XkbIndicatorDoodad 4
+#define XkbLogoDoodad 5
+
+typedef struct _XkbKey {
+ XkbKeyNameRec name;
+ short gap;
+ unsigned char shape_ndx;
+ unsigned char color_ndx;
+} XkbKeyRec, *XkbKeyPtr;
+#define XkbKeyShape(g,k) (&(g)->shapes[(k)->shape_ndx])
+#define XkbKeyColor(g,k) (&(g)->colors[(k)->color_ndx])
+#define XkbSetKeyShape(g,k,s) ((k)->shape_ndx= (s)-&(g)->shapes[0])
+#define XkbSetKeyColor(g,k,c) ((k)->color_ndx= (c)-&(g)->colors[0])
+
+typedef struct _XkbRow {
+ short top;
+ short left;
+ unsigned short num_keys;
+ unsigned short sz_keys;
+ int vertical;
+ XkbKeyPtr keys;
+ XkbBoundsRec bounds;
+} XkbRowRec, *XkbRowPtr;
+
+typedef struct _XkbSection {
+ Atom name;
+ unsigned char priority;
+ short top;
+ short left;
+ unsigned short width;
+ unsigned short height;
+ short angle;
+ unsigned short num_rows;
+ unsigned short num_doodads;
+ unsigned short num_overlays;
+ unsigned short sz_rows;
+ unsigned short sz_doodads;
+ unsigned short sz_overlays;
+ XkbRowPtr rows;
+ XkbDoodadPtr doodads;
+ XkbBoundsRec bounds;
+ struct _XkbOverlay *overlays;
+} XkbSectionRec, *XkbSectionPtr;
+
+typedef struct _XkbOverlayKey {
+ XkbKeyNameRec over;
+ XkbKeyNameRec under;
+} XkbOverlayKeyRec,*XkbOverlayKeyPtr;
+
+typedef struct _XkbOverlayRow {
+ unsigned short row_under;
+ unsigned short num_keys;
+ unsigned short sz_keys;
+ XkbOverlayKeyPtr keys;
+} XkbOverlayRowRec,*XkbOverlayRowPtr;
+
+typedef struct _XkbOverlay {
+ Atom name;
+ XkbSectionPtr section_under;
+ unsigned short num_rows;
+ unsigned short sz_rows;
+ XkbOverlayRowPtr rows;
+ XkbBoundsPtr bounds;
+} XkbOverlayRec,*XkbOverlayPtr;
+
+typedef struct _XkbGeometry {
+ Atom name;
+ unsigned short width_mm;
+ unsigned short height_mm;
+ char * label_font;
+ XkbColorPtr label_color;
+ XkbColorPtr base_color;
+ unsigned short sz_properties;
+ unsigned short sz_colors;
+ unsigned short sz_shapes;
+ unsigned short sz_sections;
+ unsigned short sz_doodads;
+ unsigned short sz_key_aliases;
+ unsigned short num_properties;
+ unsigned short num_colors;
+ unsigned short num_shapes;
+ unsigned short num_sections;
+ unsigned short num_doodads;
+ unsigned short num_key_aliases;
+ XkbPropertyPtr properties;
+ XkbColorPtr colors;
+ XkbShapePtr shapes;
+ XkbSectionPtr sections;
+ XkbDoodadPtr doodads;
+ XkbKeyAliasPtr key_aliases;
+} XkbGeometryRec;
+#define XkbGeomColorIndex(g,c) ((int)((c)-&(g)->colors[0]))
+
+#define XkbGeomPropertiesMask (1<<0)
+#define XkbGeomColorsMask (1<<1)
+#define XkbGeomShapesMask (1<<2)
+#define XkbGeomSectionsMask (1<<3)
+#define XkbGeomDoodadsMask (1<<4)
+#define XkbGeomKeyAliasesMask (1<<5)
+#define XkbGeomAllMask (0x3f)
+
+typedef struct _XkbGeometrySizes {
+ unsigned int which;
+ unsigned short num_properties;
+ unsigned short num_colors;
+ unsigned short num_shapes;
+ unsigned short num_sections;
+ unsigned short num_doodads;
+ unsigned short num_key_aliases;
+} XkbGeometrySizesRec,*XkbGeometrySizesPtr;
+
+_XFUNCPROTOBEGIN
+
+extern XkbPropertyPtr
+XkbAddGeomProperty(
+ XkbGeometryPtr /* geom */,
+ char * /* name */,
+ char * /* value */
+);
+
+extern XkbKeyAliasPtr
+XkbAddGeomKeyAlias(
+ XkbGeometryPtr /* geom */,
+ char * /* alias */,
+ char * /* real */
+);
+
+extern XkbColorPtr
+XkbAddGeomColor(
+ XkbGeometryPtr /* geom */,
+ char * /* spec */,
+ unsigned int /* pixel */
+);
+
+extern XkbOutlinePtr
+XkbAddGeomOutline(
+ XkbShapePtr /* shape */,
+ int /* sz_points */
+);
+
+extern XkbShapePtr
+XkbAddGeomShape(
+ XkbGeometryPtr /* geom */,
+ Atom /* name */,
+ int /* sz_outlines */
+);
+
+extern XkbKeyPtr
+XkbAddGeomKey(
+ XkbRowPtr /* row */
+);
+
+extern XkbRowPtr
+XkbAddGeomRow(
+ XkbSectionPtr /* section */,
+ int /* sz_keys */
+);
+
+extern XkbSectionPtr
+XkbAddGeomSection(
+ XkbGeometryPtr /* geom */,
+ Atom /* name */,
+ int /* sz_rows */,
+ int /* sz_doodads */,
+ int /* sz_overlays */
+);
+
+extern XkbOverlayPtr
+XkbAddGeomOverlay(
+ XkbSectionPtr /* section */,
+ Atom /* name */,
+ int /* sz_rows */
+);
+
+extern XkbOverlayRowPtr
+XkbAddGeomOverlayRow(
+ XkbOverlayPtr /* overlay */,
+ int /* row_under */,
+ int /* sz_keys */
+);
+
+extern XkbOverlayKeyPtr
+XkbAddGeomOverlayKey(
+ XkbOverlayPtr /* overlay */,
+ XkbOverlayRowPtr /* row */,
+ char * /* over */,
+ char * /* under */
+);
+
+extern XkbDoodadPtr
+XkbAddGeomDoodad(
+ XkbGeometryPtr /* geom */,
+ XkbSectionPtr /* section */,
+ Atom /* name */
+);
+
+
+extern void
+XkbFreeGeomKeyAliases(
+ XkbGeometryPtr /* geom */,
+ int /* first */,
+ int /* count */,
+ Bool /* freeAll */
+);
+
+extern void
+XkbFreeGeomColors(
+ XkbGeometryPtr /* geom */,
+ int /* first */,
+ int /* count */,
+ Bool /* freeAll */
+);
+
+extern void
+XkbFreeGeomDoodads(
+ XkbDoodadPtr /* doodads */,
+ int /* nDoodads */,
+ Bool /* freeAll */
+);
+
+
+extern void
+XkbFreeGeomProperties(
+ XkbGeometryPtr /* geom */,
+ int /* first */,
+ int /* count */,
+ Bool /* freeAll */
+);
+
+extern void
+XkbFreeGeomOverlayKeys(
+ XkbOverlayRowPtr /* row */,
+ int /* first */,
+ int /* count */,
+ Bool /* freeAll */
+);
+
+extern void
+XkbFreeGeomOverlayRows(
+ XkbOverlayPtr /* overlay */,
+ int /* first */,
+ int /* count */,
+ Bool /* freeAll */
+);
+
+extern void
+XkbFreeGeomOverlays(
+ XkbSectionPtr /* section */,
+ int /* first */,
+ int /* count */,
+ Bool /* freeAll */
+);
+
+extern void
+XkbFreeGeomKeys(
+ XkbRowPtr /* row */,
+ int /* first */,
+ int /* count */,
+ Bool /* freeAll */
+);
+
+extern void
+XkbFreeGeomRows(
+ XkbSectionPtr /* section */,
+ int /* first */,
+ int /* count */,
+ Bool /* freeAll */
+);
+
+extern void
+XkbFreeGeomSections(
+ XkbGeometryPtr /* geom */,
+ int /* first */,
+ int /* count */,
+ Bool /* freeAll */
+);
+
+
+extern void
+XkbFreeGeomPoints(
+ XkbOutlinePtr /* outline */,
+ int /* first */,
+ int /* count */,
+ Bool /* freeAll */
+);
+
+extern void
+XkbFreeGeomOutlines(
+ XkbShapePtr /* shape */,
+ int /* first */,
+ int /* count */,
+ Bool /* freeAll */
+);
+
+extern void
+XkbFreeGeomShapes(
+ XkbGeometryPtr /* geom */,
+ int /* first */,
+ int /* count */,
+ Bool /* freeAll */
+);
+
+extern void
+XkbFreeGeometry(
+ XkbGeometryPtr /* geom */,
+ unsigned int /* which */,
+ Bool /* freeMap */
+);
+
+extern Status
+XkbAllocGeomProps(
+ XkbGeometryPtr /* geom */,
+ int /* nProps */
+);
+
+extern Status
+XkbAllocGeomKeyAliases(
+ XkbGeometryPtr /* geom */,
+ int /* nAliases */
+);
+
+extern Status
+XkbAllocGeomColors(
+ XkbGeometryPtr /* geom */,
+ int /* nColors */
+);
+
+extern Status
+XkbAllocGeomShapes(
+ XkbGeometryPtr /* geom */,
+ int /* nShapes */
+);
+
+extern Status
+XkbAllocGeomSections(
+ XkbGeometryPtr /* geom */,
+ int /* nSections */
+);
+
+extern Status
+XkbAllocGeomOverlays(
+ XkbSectionPtr /* section */,
+ int /* num_needed */
+);
+
+extern Status
+XkbAllocGeomOverlayRows(
+ XkbOverlayPtr /* overlay */,
+ int /* num_needed */
+);
+
+extern Status
+XkbAllocGeomOverlayKeys(
+ XkbOverlayRowPtr /* row */,
+ int /* num_needed */
+);
+
+extern Status
+XkbAllocGeomDoodads(
+ XkbGeometryPtr /* geom */,
+ int /* nDoodads */
+);
+
+extern Status
+XkbAllocGeomSectionDoodads(
+ XkbSectionPtr /* section */,
+ int /* nDoodads */
+);
+
+extern Status
+XkbAllocGeomOutlines(
+ XkbShapePtr /* shape */,
+ int /* nOL */
+);
+
+extern Status
+XkbAllocGeomRows(
+ XkbSectionPtr /* section */,
+ int /* nRows */
+);
+
+extern Status
+XkbAllocGeomPoints(
+ XkbOutlinePtr /* ol */,
+ int /* nPts */
+);
+
+extern Status
+XkbAllocGeomKeys(
+ XkbRowPtr /* row */,
+ int /* nKeys */
+);
+
+extern Status
+XkbAllocGeometry(
+ XkbDescPtr /* xkb */,
+ XkbGeometrySizesPtr /* sizes */
+);
+
+extern Status
+XkbSetGeometry(
+ Display * /* dpy */,
+ unsigned /* deviceSpec */,
+ XkbGeometryPtr /* geom */
+);
+
+extern Bool
+XkbComputeShapeTop(
+ XkbShapePtr /* shape */,
+ XkbBoundsPtr /* bounds */
+);
+
+extern Bool
+XkbComputeShapeBounds(
+ XkbShapePtr /* shape */
+);
+
+extern Bool
+XkbComputeRowBounds(
+ XkbGeometryPtr /* geom */,
+ XkbSectionPtr /* section */,
+ XkbRowPtr /* row */
+);
+
+extern Bool
+XkbComputeSectionBounds(
+ XkbGeometryPtr /* geom */,
+ XkbSectionPtr /* section */
+);
+
+extern char *
+XkbFindOverlayForKey(
+ XkbGeometryPtr /* geom */,
+ XkbSectionPtr /* wanted */,
+ char * /* under */
+);
+
+extern Status
+XkbGetGeometry(
+ Display * /* dpy */,
+ XkbDescPtr /* xkb */
+);
+
+extern Status
+XkbGetNamedGeometry(
+ Display * /* dpy */,
+ XkbDescPtr /* xkb */,
+ Atom /* name */
+);
+
+_XFUNCPROTOEND
+
+#endif /* _XKBSTR_H_ */
diff --git a/sysroot/usr/include/X11/extensions/XKBproto.h b/sysroot/usr/include/X11/extensions/XKBproto.h
new file mode 100644
index 0000000..97dd4d2
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/XKBproto.h
@@ -0,0 +1,1282 @@
+/* $Xorg: XKBproto.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */
+/************************************************************
+Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
+
+Permission to use, copy, modify, and distribute this
+software and its documentation for any purpose and without
+fee is hereby granted, provided that the above copyright
+notice appear in all copies and that both that copyright
+notice and this permission notice appear in supporting
+documentation, and that the name of Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
+of the software without specific prior written permission.
+Silicon Graphics makes no representation about the suitability
+of this software for any purpose. It is provided "as is"
+without any express or implied warranty.
+
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
+THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+********************************************************/
+
+#ifndef _XKBPROTO_H_
+#define _XKBPROTO_H_
+
+#include <X11/Xmd.h>
+#include <X11/extensions/XKB.h>
+
+#define Window CARD32
+#define Atom CARD32
+#define Time CARD32
+#define KeyCode CARD8
+#define KeySym CARD32
+
+#define XkbPaddedSize(n) ((((unsigned int)(n)+3) >> 2) << 2)
+
+typedef struct _xkbUseExtension {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBUseExtension */
+ CARD16 length B16;
+ CARD16 wantedMajor B16;
+ CARD16 wantedMinor B16;
+} xkbUseExtensionReq;
+#define sz_xkbUseExtensionReq 8
+
+typedef struct _xkbUseExtensionReply {
+ BYTE type; /* X_Reply */
+ BOOL supported;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 serverMajor B16;
+ CARD16 serverMinor B16;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+} xkbUseExtensionReply;
+#define sz_xkbUseExtensionReply 32
+
+typedef struct _xkbSelectEvents {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* X_KBSelectEvents */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD16 affectWhich B16;
+ CARD16 clear B16;
+ CARD16 selectAll B16;
+ CARD16 affectMap B16;
+ CARD16 map B16;
+} xkbSelectEventsReq;
+#define sz_xkbSelectEventsReq 16
+
+typedef struct _xkbBell {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* X_KBBell */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD16 bellClass B16;
+ CARD16 bellID B16;
+ INT8 percent;
+ BOOL forceSound;
+ BOOL eventOnly;
+ CARD8 pad1;
+ INT16 pitch B16;
+ INT16 duration B16;
+ CARD16 pad2 B16;
+ Atom name B32;
+ Window window B32;
+} xkbBellReq;
+#define sz_xkbBellReq 28
+
+typedef struct _xkbGetState {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBGetState */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD16 pad B16;
+} xkbGetStateReq;
+#define sz_xkbGetStateReq 8
+
+typedef struct _xkbGetStateReply {
+ BYTE type;
+ BYTE deviceID;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 mods;
+ CARD8 baseMods;
+ CARD8 latchedMods;
+ CARD8 lockedMods;
+ CARD8 group;
+ CARD8 lockedGroup;
+ INT16 baseGroup B16;
+ INT16 latchedGroup B16;
+ CARD8 compatState;
+ CARD8 grabMods;
+ CARD8 compatGrabMods;
+ CARD8 lookupMods;
+ CARD8 compatLookupMods;
+ CARD8 pad1;
+ CARD16 ptrBtnState B16;
+ CARD16 pad2 B16;
+ CARD32 pad3 B32;
+} xkbGetStateReply;
+#define sz_xkbGetStateReply 32
+
+typedef struct _xkbLatchLockState {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBLatchLockState */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD8 affectModLocks;
+ CARD8 modLocks;
+ BOOL lockGroup;
+ CARD8 groupLock;
+ CARD8 affectModLatches;
+ CARD8 modLatches;
+ CARD8 pad;
+ BOOL latchGroup;
+ INT16 groupLatch B16;
+} xkbLatchLockStateReq;
+#define sz_xkbLatchLockStateReq 16
+
+typedef struct _xkbGetControls {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBGetControls */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD16 pad B16;
+} xkbGetControlsReq;
+#define sz_xkbGetControlsReq 8
+
+typedef struct _xkbGetControlsReply {
+ BYTE type; /* X_Reply */
+ CARD8 deviceID;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 mkDfltBtn;
+ CARD8 numGroups;
+ CARD8 groupsWrap;
+ CARD8 internalMods;
+ CARD8 ignoreLockMods;
+ CARD8 internalRealMods;
+ CARD8 ignoreLockRealMods;
+ CARD8 pad1;
+ CARD16 internalVMods B16;
+ CARD16 ignoreLockVMods B16;
+ CARD16 repeatDelay B16;
+ CARD16 repeatInterval B16;
+ CARD16 slowKeysDelay B16;
+ CARD16 debounceDelay B16;
+ CARD16 mkDelay B16;
+ CARD16 mkInterval B16;
+ CARD16 mkTimeToMax B16;
+ CARD16 mkMaxSpeed B16;
+ INT16 mkCurve B16;
+ CARD16 axOptions B16;
+ CARD16 axTimeout B16;
+ CARD16 axtOptsMask B16;
+ CARD16 axtOptsValues B16;
+ CARD16 pad2 B16;
+ CARD32 axtCtrlsMask B32;
+ CARD32 axtCtrlsValues B32;
+ CARD32 enabledCtrls B32;
+ BYTE perKeyRepeat[XkbPerKeyBitArraySize];
+} xkbGetControlsReply;
+#define sz_xkbGetControlsReply 92
+
+typedef struct _xkbSetControls {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBSetControls */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD8 affectInternalMods;
+ CARD8 internalMods;
+ CARD8 affectIgnoreLockMods;
+ CARD8 ignoreLockMods;
+ CARD16 affectInternalVMods B16;
+ CARD16 internalVMods B16;
+ CARD16 affectIgnoreLockVMods B16;
+ CARD16 ignoreLockVMods B16;
+ CARD8 mkDfltBtn;
+ CARD8 groupsWrap;
+ CARD16 axOptions B16;
+ CARD16 pad1 B16;
+ CARD32 affectEnabledCtrls B32;
+ CARD32 enabledCtrls B32;
+ CARD32 changeCtrls B32;
+ CARD16 repeatDelay B16;
+ CARD16 repeatInterval B16;
+ CARD16 slowKeysDelay B16;
+ CARD16 debounceDelay B16;
+ CARD16 mkDelay B16;
+ CARD16 mkInterval B16;
+ CARD16 mkTimeToMax B16;
+ CARD16 mkMaxSpeed B16;
+ INT16 mkCurve B16;
+ CARD16 axTimeout B16;
+ CARD32 axtCtrlsMask B32;
+ CARD32 axtCtrlsValues B32;
+ CARD16 axtOptsMask B16;
+ CARD16 axtOptsValues B16;
+ BYTE perKeyRepeat[XkbPerKeyBitArraySize];
+} xkbSetControlsReq;
+#define sz_xkbSetControlsReq 100
+
+typedef struct _xkbKTMapEntryWireDesc {
+ BOOL active;
+ CARD8 mask;
+ CARD8 level;
+ CARD8 realMods;
+ CARD16 virtualMods B16;
+ CARD16 pad B16;
+} xkbKTMapEntryWireDesc;
+#define sz_xkbKTMapEntryWireDesc 8
+
+typedef struct _xkbKTSetMapEntryWireDesc {
+ CARD8 level;
+ CARD8 realMods;
+ CARD16 virtualMods B16;
+} xkbKTSetMapEntryWireDesc;
+#define sz_xkbKTSetMapEntryWireDesc 4
+
+typedef struct _xkbModsWireDesc {
+ CARD8 mask; /* GetMap only */
+ CARD8 realMods;
+ CARD16 virtualMods B16;
+} xkbModsWireDesc;
+#define sz_xkbModsWireDesc 4
+
+typedef struct _xkbKeyTypeWireDesc {
+ CARD8 mask;
+ CARD8 realMods;
+ CARD16 virtualMods B16;
+ CARD8 numLevels;
+ CARD8 nMapEntries;
+ BOOL preserve;
+ CARD8 pad;
+} xkbKeyTypeWireDesc;
+#define sz_xkbKeyTypeWireDesc 8
+
+typedef struct _xkbSymMapWireDesc {
+ CARD8 ktIndex[XkbNumKbdGroups];
+ CARD8 groupInfo;
+ CARD8 width;
+ CARD16 nSyms B16;
+} xkbSymMapWireDesc;
+#define sz_xkbSymMapWireDesc 8
+
+typedef struct _xkbVModMapWireDesc {
+ KeyCode key;
+ CARD8 pad;
+ CARD16 vmods B16;
+} xkbVModMapWireDesc;
+#define sz_xkbVModMapWireDesc 4
+
+typedef struct _xkbBehaviorWireDesc {
+ CARD8 key;
+ CARD8 type;
+ CARD8 data;
+ CARD8 pad;
+} xkbBehaviorWireDesc;
+#define sz_xkbBehaviorWireDesc 4
+
+typedef struct _xkbActionWireDesc {
+ CARD8 type;
+ CARD8 data[7];
+} xkbActionWireDesc;
+#define sz_xkbActionWireDesc 8
+
+typedef struct _xkbGetMap {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBGetMap */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD16 full B16;
+ CARD16 partial B16;
+ CARD8 firstType;
+ CARD8 nTypes;
+ KeyCode firstKeySym;
+ CARD8 nKeySyms;
+ KeyCode firstKeyAct;
+ CARD8 nKeyActs;
+ KeyCode firstKeyBehavior;
+ CARD8 nKeyBehaviors;
+ CARD16 virtualMods B16;
+ KeyCode firstKeyExplicit;
+ CARD8 nKeyExplicit;
+ KeyCode firstModMapKey;
+ CARD8 nModMapKeys;
+ KeyCode firstVModMapKey;
+ CARD8 nVModMapKeys;
+ CARD16 pad1 B16;
+} xkbGetMapReq;
+#define sz_xkbGetMapReq 28
+
+typedef struct _xkbGetMapReply {
+ CARD8 type; /* always X_Reply */
+ CARD8 deviceID;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 pad1 B16;
+ KeyCode minKeyCode;
+ KeyCode maxKeyCode;
+ CARD16 present B16;
+ CARD8 firstType;
+ CARD8 nTypes;
+ CARD8 totalTypes;
+ KeyCode firstKeySym;
+ CARD16 totalSyms B16;
+ CARD8 nKeySyms;
+ KeyCode firstKeyAct;
+ CARD16 totalActs B16;
+ CARD8 nKeyActs;
+ KeyCode firstKeyBehavior;
+ CARD8 nKeyBehaviors;
+ CARD8 totalKeyBehaviors;
+ KeyCode firstKeyExplicit;
+ CARD8 nKeyExplicit;
+ CARD8 totalKeyExplicit;
+ KeyCode firstModMapKey;
+ CARD8 nModMapKeys;
+ CARD8 totalModMapKeys;
+ KeyCode firstVModMapKey;
+ CARD8 nVModMapKeys;
+ CARD8 totalVModMapKeys;
+ CARD8 pad2;
+ CARD16 virtualMods B16;
+} xkbGetMapReply;
+#define sz_xkbGetMapReply 40
+
+#define XkbSetMapResizeTypes (1L<<0)
+#define XkbSetMapRecomputeActions (1L<<1)
+#define XkbSetMapAllFlags (0x3)
+
+typedef struct _xkbSetMap {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBSetMap */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD16 present B16;
+ CARD16 flags B16;
+ KeyCode minKeyCode;
+ KeyCode maxKeyCode;
+ CARD8 firstType;
+ CARD8 nTypes;
+ KeyCode firstKeySym;
+ CARD8 nKeySyms;
+ CARD16 totalSyms B16;
+ KeyCode firstKeyAct;
+ CARD8 nKeyActs;
+ CARD16 totalActs B16;
+ KeyCode firstKeyBehavior;
+ CARD8 nKeyBehaviors;
+ CARD8 totalKeyBehaviors;
+ KeyCode firstKeyExplicit;
+ CARD8 nKeyExplicit;
+ CARD8 totalKeyExplicit;
+ KeyCode firstModMapKey;
+ CARD8 nModMapKeys;
+ CARD8 totalModMapKeys;
+ KeyCode firstVModMapKey;
+ CARD8 nVModMapKeys;
+ CARD8 totalVModMapKeys;
+ CARD16 virtualMods B16;
+} xkbSetMapReq;
+#define sz_xkbSetMapReq 36
+
+typedef struct _xkbSymInterpretWireDesc {
+ CARD32 sym B32;
+ CARD8 mods;
+ CARD8 match;
+ CARD8 virtualMod;
+ CARD8 flags;
+ xkbActionWireDesc act;
+} xkbSymInterpretWireDesc;
+#define sz_xkbSymInterpretWireDesc 16
+
+typedef struct _xkbGetCompatMap {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBGetCompatMap */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD8 groups;
+ BOOL getAllSI;
+ CARD16 firstSI B16;
+ CARD16 nSI B16;
+} xkbGetCompatMapReq;
+#define sz_xkbGetCompatMapReq 12
+
+typedef struct _xkbGetCompatMapReply {
+ CARD8 type; /* always X_Reply */
+ CARD8 deviceID;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 groups;
+ CARD8 pad1;
+ CARD16 firstSI B16;
+ CARD16 nSI B16;
+ CARD16 nTotalSI B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+} xkbGetCompatMapReply;
+#define sz_xkbGetCompatMapReply 32
+
+typedef struct _xkbSetCompatMap {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBSetCompatMap */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD8 pad1;
+ BOOL recomputeActions;
+ BOOL truncateSI;
+ CARD8 groups;
+ CARD16 firstSI B16;
+ CARD16 nSI B16;
+ CARD16 pad2 B16;
+} xkbSetCompatMapReq;
+#define sz_xkbSetCompatMapReq 16
+
+typedef struct _xkbGetIndicatorState {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBGetIndicatorState */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD16 pad1 B16;
+} xkbGetIndicatorStateReq;
+#define sz_xkbGetIndicatorStateReq 8
+
+typedef struct _xkbGetIndicatorStateReply {
+ CARD8 type; /* always X_Reply */
+ CARD8 deviceID;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 state B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+} xkbGetIndicatorStateReply;
+#define sz_xkbGetIndicatorStateReply 32
+
+typedef struct _xkbGetIndicatorMap {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBGetIndicatorMap */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD16 pad B16;
+ CARD32 which B32;
+} xkbGetIndicatorMapReq;
+#define sz_xkbGetIndicatorMapReq 12
+
+typedef struct _xkbGetIndicatorMapReply {
+ CARD8 type; /* always X_Reply */
+ CARD8 deviceID;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 which B32;
+ CARD32 realIndicators B32;
+ CARD8 nIndicators;
+ CARD8 pad1;
+ CARD16 pad2 B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+} xkbGetIndicatorMapReply;
+#define sz_xkbGetIndicatorMapReply 32
+
+typedef struct _xkbIndicatorMapWireDesc {
+ CARD8 flags;
+ CARD8 whichGroups;
+ CARD8 groups;
+ CARD8 whichMods;
+ CARD8 mods;
+ CARD8 realMods;
+ CARD16 virtualMods B16;
+ CARD32 ctrls B32;
+} xkbIndicatorMapWireDesc;
+#define sz_xkbIndicatorMapWireDesc 12
+
+typedef struct _xkbSetIndicatorMap {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBSetIndicatorMap */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD16 pad1 B16;
+ CARD32 which B32;
+} xkbSetIndicatorMapReq;
+#define sz_xkbSetIndicatorMapReq 12
+
+typedef struct _xkbGetNamedIndicator {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* X_KBGetNamedIndicator */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD16 ledClass B16;
+ CARD16 ledID B16;
+ CARD16 pad1 B16;
+ Atom indicator B32;
+} xkbGetNamedIndicatorReq;
+#define sz_xkbGetNamedIndicatorReq 16
+
+typedef struct _xkbGetNamedIndicatorReply {
+ BYTE type;
+ BYTE deviceID;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ Atom indicator B32;
+ BOOL found;
+ BOOL on;
+ BOOL realIndicator;
+ CARD8 ndx;
+ CARD8 flags;
+ CARD8 whichGroups;
+ CARD8 groups;
+ CARD8 whichMods;
+ CARD8 mods;
+ CARD8 realMods;
+ CARD16 virtualMods B16;
+ CARD32 ctrls B32;
+ BOOL supported;
+ CARD8 pad1;
+ CARD16 pad2 B16;
+} xkbGetNamedIndicatorReply;
+#define sz_xkbGetNamedIndicatorReply 32
+
+typedef struct _xkbSetNamedIndicator {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* X_KBSetNamedIndicator */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD16 ledClass B16;
+ CARD16 ledID B16;
+ CARD16 pad1 B16;
+ Atom indicator B32;
+ BOOL setState;
+ BOOL on;
+ BOOL setMap;
+ BOOL createMap;
+ CARD8 pad2;
+ CARD8 flags;
+ CARD8 whichGroups;
+ CARD8 groups;
+ CARD8 whichMods;
+ CARD8 realMods;
+ CARD16 virtualMods B16;
+ CARD32 ctrls B32;
+} xkbSetNamedIndicatorReq;
+#define sz_xkbSetNamedIndicatorReq 32
+
+typedef struct _xkbGetNames {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBGetNames */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD16 pad B16;
+ CARD32 which B32;
+} xkbGetNamesReq;
+#define sz_xkbGetNamesReq 12
+
+typedef struct _xkbGetNamesReply {
+ BYTE type;
+ BYTE deviceID;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 which B32;
+ KeyCode minKeyCode;
+ KeyCode maxKeyCode;
+ CARD8 nTypes;
+ CARD8 groupNames;
+ CARD16 virtualMods B16;
+ KeyCode firstKey;
+ CARD8 nKeys;
+ CARD32 indicators B32;
+ CARD8 nRadioGroups;
+ CARD8 nKeyAliases;
+ CARD16 nKTLevels B16;
+ CARD32 pad3 B32;
+} xkbGetNamesReply;
+#define sz_xkbGetNamesReply 32
+
+typedef struct _xkbSetNames {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBSetNames */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD16 virtualMods B16;
+ CARD32 which B32;
+ CARD8 firstType;
+ CARD8 nTypes;
+ CARD8 firstKTLevel;
+ CARD8 nKTLevels;
+ CARD32 indicators B32;
+ CARD8 groupNames;
+ CARD8 nRadioGroups;
+ KeyCode firstKey;
+ CARD8 nKeys;
+ CARD8 nKeyAliases;
+ CARD8 pad1;
+ CARD16 totalKTLevelNames B16;
+} xkbSetNamesReq;
+#define sz_xkbSetNamesReq 28
+
+typedef struct _xkbPointWireDesc {
+ INT16 x B16;
+ INT16 y B16;
+} xkbPointWireDesc;
+#define sz_xkbPointWireDesc 4
+
+typedef struct _xkbOutlineWireDesc {
+ CARD8 nPoints;
+ CARD8 cornerRadius;
+ CARD16 pad B16;
+} xkbOutlineWireDesc;
+#define sz_xkbOutlineWireDesc 4
+
+typedef struct _xkbShapeWireDesc {
+ Atom name B32;
+ CARD8 nOutlines;
+ CARD8 primaryNdx;
+ CARD8 approxNdx;
+ CARD8 pad;
+} xkbShapeWireDesc;
+#define sz_xkbShapeWireDesc 8
+
+typedef struct _xkbSectionWireDesc {
+ Atom name B32;
+ INT16 top B16;
+ INT16 left B16;
+ CARD16 width B16;
+ CARD16 height B16;
+ INT16 angle B16;
+ CARD8 priority;
+ CARD8 nRows;
+ CARD8 nDoodads;
+ CARD8 nOverlays;
+ CARD16 pad B16;
+} xkbSectionWireDesc;
+#define sz_xkbSectionWireDesc 20
+
+typedef struct _xkbRowWireDesc {
+ INT16 top B16;
+ INT16 left B16;
+ CARD8 nKeys;
+ BOOL vertical;
+ CARD16 pad B16;
+} xkbRowWireDesc;
+#define sz_xkbRowWireDesc 8
+
+typedef struct _xkbKeyWireDesc {
+ CARD8 name[XkbKeyNameLength];
+ INT16 gap B16;
+ CARD8 shapeNdx;
+ CARD8 colorNdx;
+} xkbKeyWireDesc;
+#define sz_xkbKeyWireDesc 8
+
+typedef struct _xkbOverlayWireDesc {
+ Atom name B32;
+ CARD8 nRows;
+ CARD8 pad1;
+ CARD16 pad2 B16;
+} xkbOverlayWireDesc;
+#define sz_xkbOverlayWireDesc 8
+
+typedef struct _xkbOverlayRowWireDesc {
+ CARD8 rowUnder;
+ CARD8 nKeys;
+ CARD16 pad1 B16;
+} xkbOverlayRowWireDesc;
+#define sz_xkbOverlayRowWireDesc 4
+
+typedef struct _xkbOverlayKeyWireDesc {
+ CARD8 over[XkbKeyNameLength];
+ CARD8 under[XkbKeyNameLength];
+} xkbOverlayKeyWireDesc;
+#define sz_xkbOverlayKeyWireDesc 8
+
+typedef struct _xkbShapeDoodadWireDesc {
+ Atom name B32;
+ CARD8 type;
+ CARD8 priority;
+ INT16 top B16;
+ INT16 left B16;
+ INT16 angle B16;
+ CARD8 colorNdx;
+ CARD8 shapeNdx;
+ CARD16 pad1 B16;
+ CARD32 pad2 B32;
+} xkbShapeDoodadWireDesc;
+#define sz_xkbShapeDoodadWireDesc 20
+
+typedef struct _xkbTextDoodadWireDesc {
+ Atom name B32;
+ CARD8 type;
+ CARD8 priority;
+ INT16 top B16;
+ INT16 left B16;
+ INT16 angle B16;
+ CARD16 width B16;
+ CARD16 height B16;
+ CARD8 colorNdx;
+ CARD8 pad1;
+ CARD16 pad2 B16;
+} xkbTextDoodadWireDesc;
+#define sz_xkbTextDoodadWireDesc 20
+
+typedef struct _xkbIndicatorDoodadWireDesc {
+ Atom name B32;
+ CARD8 type;
+ CARD8 priority;
+ INT16 top B16;
+ INT16 left B16;
+ INT16 angle B16;
+ CARD8 shapeNdx;
+ CARD8 onColorNdx;
+ CARD8 offColorNdx;
+ CARD8 pad1;
+ CARD32 pad2 B32;
+} xkbIndicatorDoodadWireDesc;
+#define sz_xkbIndicatorDoodadWireDesc 20
+
+typedef struct _xkbLogoDoodadWireDesc {
+ Atom name B32;
+ CARD8 type;
+ CARD8 priority;
+ INT16 top B16;
+ INT16 left B16;
+ INT16 angle B16;
+ CARD8 colorNdx;
+ CARD8 shapeNdx;
+ CARD16 pad1 B16;
+ CARD32 pad2 B32;
+} xkbLogoDoodadWireDesc;
+#define sz_xkbLogoDoodadWireDesc 20
+
+typedef struct _xkbAnyDoodadWireDesc {
+ Atom name B32;
+ CARD8 type;
+ CARD8 priority;
+ INT16 top B16;
+ INT16 left B16;
+ INT16 angle B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+} xkbAnyDoodadWireDesc;
+#define sz_xkbAnyDoodadWireDesc 20
+
+typedef union _xkbDoodadWireDesc {
+ xkbAnyDoodadWireDesc any;
+ xkbShapeDoodadWireDesc shape;
+ xkbTextDoodadWireDesc text;
+ xkbIndicatorDoodadWireDesc indicator;
+ xkbLogoDoodadWireDesc logo;
+} xkbDoodadWireDesc;
+#define sz_xkbDoodadWireDesc 20
+
+typedef struct _xkbGetGeometry {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBGetGeometry */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD16 pad B16;
+ Atom name B32;
+} xkbGetGeometryReq;
+#define sz_xkbGetGeometryReq 12
+
+typedef struct _xkbGetGeometryReply {
+ CARD8 type; /* always X_Reply */
+ CARD8 deviceID;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ Atom name B32;
+ BOOL found;
+ CARD8 pad;
+ CARD16 widthMM B16;
+ CARD16 heightMM B16;
+ CARD16 nProperties B16;
+ CARD16 nColors B16;
+ CARD16 nShapes B16;
+ CARD16 nSections B16;
+ CARD16 nDoodads B16;
+ CARD16 nKeyAliases B16;
+ CARD8 baseColorNdx;
+ CARD8 labelColorNdx;
+} xkbGetGeometryReply;
+#define sz_xkbGetGeometryReply 32
+
+typedef struct _xkbSetGeometry {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBSetGeometry */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD8 nShapes;
+ CARD8 nSections;
+ Atom name B32;
+ CARD16 widthMM B16;
+ CARD16 heightMM B16;
+ CARD16 nProperties B16;
+ CARD16 nColors B16;
+ CARD16 nDoodads B16;
+ CARD16 nKeyAliases B16;
+ CARD8 baseColorNdx;
+ CARD8 labelColorNdx;
+ CARD16 pad B16;
+} xkbSetGeometryReq;
+#define sz_xkbSetGeometryReq 28
+
+typedef struct _xkbPerClientFlags {
+ CARD8 reqType;
+ CARD8 xkbReqType;/* always X_KBPerClientFlags */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD16 pad1 B16;
+ CARD32 change B32;
+ CARD32 value B32;
+ CARD32 ctrlsToChange B32;
+ CARD32 autoCtrls B32;
+ CARD32 autoCtrlValues B32;
+} xkbPerClientFlagsReq;
+#define sz_xkbPerClientFlagsReq 28
+
+typedef struct _xkbPerClientFlagsReply {
+ CARD8 type; /* always X_Reply */
+ CARD8 deviceID;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 supported B32;
+ CARD32 value B32;
+ CARD32 autoCtrls B32;
+ CARD32 autoCtrlValues B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+} xkbPerClientFlagsReply;
+#define sz_xkbPerClientFlagsReply 32
+
+typedef struct _xkbListComponents {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBListComponents */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD16 maxNames B16;
+} xkbListComponentsReq;
+#define sz_xkbListComponentsReq 8
+
+typedef struct _xkbListComponentsReply {
+ CARD8 type; /* always X_Reply */
+ CARD8 deviceID;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 nKeymaps B16;
+ CARD16 nKeycodes B16;
+ CARD16 nTypes B16;
+ CARD16 nCompatMaps B16;
+ CARD16 nSymbols B16;
+ CARD16 nGeometries B16;
+ CARD16 extra B16;
+ CARD16 pad1 B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+} xkbListComponentsReply;
+#define sz_xkbListComponentsReply 32
+
+typedef struct _xkbGetKbdByName {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBGetKbdByName */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD16 need B16; /* combination of XkbGBN_* */
+ CARD16 want B16; /* combination of XkbGBN_* */
+ BOOL load;
+ CARD8 pad;
+} xkbGetKbdByNameReq;
+#define sz_xkbGetKbdByNameReq 12
+
+typedef struct _xkbGetKbdByNameReply {
+ CARD8 type; /* always X_Reply */
+ CARD8 deviceID;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ KeyCode minKeyCode;
+ KeyCode maxKeyCode;
+ BOOL loaded;
+ BOOL newKeyboard;
+ CARD16 found B16; /* combination of XkbGBN_* */
+ CARD16 reported B16; /* combination of XkbAllComponents */
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+} xkbGetKbdByNameReply;
+#define sz_xkbGetKbdByNameReply 32
+
+typedef struct _xkbDeviceLedsWireDesc {
+ CARD16 ledClass B16;
+ CARD16 ledID B16;
+ CARD32 namesPresent B32;
+ CARD32 mapsPresent B32;
+ CARD32 physIndicators B32;
+ CARD32 state B32;
+} xkbDeviceLedsWireDesc;
+#define sz_xkbDeviceLedsWireDesc 20
+
+typedef struct _xkbGetDeviceInfo {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBGetDeviceInfo */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD16 wanted B16;
+ BOOL allBtns;
+ CARD8 firstBtn;
+ CARD8 nBtns;
+ CARD8 pad;
+ CARD16 ledClass B16;
+ CARD16 ledID B16;
+} xkbGetDeviceInfoReq;
+#define sz_xkbGetDeviceInfoReq 16
+
+typedef struct _xkbGetDeviceInfoReply {
+ CARD8 type; /* always X_Reply */
+ CARD8 deviceID;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 present B16;
+ CARD16 supported B16;
+ CARD16 unsupported B16;
+ CARD16 nDeviceLedFBs B16;
+ CARD8 firstBtnWanted;
+ CARD8 nBtnsWanted;
+ CARD8 firstBtnRtrn;
+ CARD8 nBtnsRtrn;
+ CARD8 totalBtns;
+ BOOL hasOwnState;
+ CARD16 dfltKbdFB B16;
+ CARD16 dfltLedFB B16;
+ CARD16 pad B16;
+ Atom devType B32;
+} xkbGetDeviceInfoReply;
+#define sz_xkbGetDeviceInfoReply 32
+
+typedef struct _xkbSetDeviceInfo {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBSetDeviceInfo */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD8 firstBtn;
+ CARD8 nBtns;
+ CARD16 change B16;
+ CARD16 nDeviceLedFBs B16;
+} xkbSetDeviceInfoReq;
+#define sz_xkbSetDeviceInfoReq 12
+
+typedef struct _xkbSetDebuggingFlags {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBSetDebuggingFlags */
+ CARD16 length B16;
+ CARD16 msgLength B16;
+ CARD16 pad B16;
+ CARD32 affectFlags B32;
+ CARD32 flags B32;
+ CARD32 affectCtrls B32;
+ CARD32 ctrls B32;
+} xkbSetDebuggingFlagsReq;
+#define sz_xkbSetDebuggingFlagsReq 24
+
+typedef struct _xkbSetDebuggingFlagsReply {
+ BYTE type; /* X_Reply */
+ CARD8 pad0;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 currentFlags B32;
+ CARD32 currentCtrls B32;
+ CARD32 supportedFlags B32;
+ CARD32 supportedCtrls B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+} xkbSetDebuggingFlagsReply;
+#define sz_xkbSetDebuggingFlagsReply 32
+
+ /*
+ * X KEYBOARD EXTENSION EVENT STRUCTURES
+ */
+
+typedef struct _xkbAnyEvent {
+ BYTE type;
+ BYTE xkbType;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ CARD8 deviceID;
+ CARD8 pad1;
+ CARD16 pad2 B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+} xkbAnyEvent;
+#define sz_xkbAnyEvent 32
+
+typedef struct _xkbNewKeyboardNotify {
+ BYTE type;
+ BYTE xkbType;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ CARD8 deviceID;
+ CARD8 oldDeviceID;
+ KeyCode minKeyCode;
+ KeyCode maxKeyCode;
+ KeyCode oldMinKeyCode;
+ KeyCode oldMaxKeyCode;
+ CARD8 requestMajor;
+ CARD8 requestMinor;
+ CARD16 changed B16;
+ CARD8 detail;
+ CARD8 pad1;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+} xkbNewKeyboardNotify;
+#define sz_xkbNewKeyboardNotify 32
+
+typedef struct _xkbMapNotify {
+ BYTE type;
+ BYTE xkbType;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ CARD8 deviceID;
+ CARD8 ptrBtnActions;
+ CARD16 changed B16;
+ KeyCode minKeyCode;
+ KeyCode maxKeyCode;
+ CARD8 firstType;
+ CARD8 nTypes;
+ KeyCode firstKeySym;
+ CARD8 nKeySyms;
+ KeyCode firstKeyAct;
+ CARD8 nKeyActs;
+ KeyCode firstKeyBehavior;
+ CARD8 nKeyBehaviors;
+ KeyCode firstKeyExplicit;
+ CARD8 nKeyExplicit;
+ KeyCode firstModMapKey;
+ CARD8 nModMapKeys;
+ KeyCode firstVModMapKey;
+ CARD8 nVModMapKeys;
+ CARD16 virtualMods B16;
+ CARD16 pad1 B16;
+} xkbMapNotify;
+#define sz_xkbMapNotify 32
+
+typedef struct _xkbStateNotify {
+ BYTE type;
+ BYTE xkbType;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ CARD8 deviceID;
+ CARD8 mods;
+ CARD8 baseMods;
+ CARD8 latchedMods;
+ CARD8 lockedMods;
+ CARD8 group;
+ INT16 baseGroup B16;
+ INT16 latchedGroup B16;
+ CARD8 lockedGroup;
+ CARD8 compatState;
+ CARD8 grabMods;
+ CARD8 compatGrabMods;
+ CARD8 lookupMods;
+ CARD8 compatLookupMods;
+ CARD16 ptrBtnState B16;
+ CARD16 changed B16;
+ KeyCode keycode;
+ CARD8 eventType;
+ CARD8 requestMajor;
+ CARD8 requestMinor;
+} xkbStateNotify;
+#define sz_xkbStateNotify 32
+
+typedef struct _xkbControlsNotify {
+ BYTE type;
+ BYTE xkbType;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ CARD8 deviceID;
+ CARD8 numGroups;
+ CARD16 pad1 B16;
+ CARD32 changedControls B32;
+ CARD32 enabledControls B32;
+ CARD32 enabledControlChanges B32;
+ KeyCode keycode;
+ CARD8 eventType;
+ CARD8 requestMajor;
+ CARD8 requestMinor;
+ CARD32 pad2 B32;
+} xkbControlsNotify;
+#define sz_xkbControlsNotify 32
+
+typedef struct _xkbIndicatorNotify {
+ BYTE type;
+ BYTE xkbType;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ CARD8 deviceID;
+ CARD8 pad1;
+ CARD16 pad2 B16;
+ CARD32 state B32;
+ CARD32 changed B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+} xkbIndicatorNotify;
+#define sz_xkbIndicatorNotify 32
+
+typedef struct _xkbNamesNotify {
+ BYTE type;
+ BYTE xkbType;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ CARD8 deviceID;
+ CARD8 pad1;
+ CARD16 changed B16;
+ CARD8 firstType;
+ CARD8 nTypes;
+ CARD8 firstLevelName;
+ CARD8 nLevelNames;
+ CARD8 pad2;
+ CARD8 nRadioGroups;
+ CARD8 nAliases;
+ CARD8 changedGroupNames;
+ CARD16 changedVirtualMods B16;
+ CARD8 firstKey;
+ CARD8 nKeys;
+ CARD32 changedIndicators B32;
+ CARD32 pad3 B32;
+} xkbNamesNotify;
+#define sz_xkbNamesNotify 32
+
+typedef struct _xkbCompatMapNotify {
+ BYTE type;
+ BYTE xkbType;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ CARD8 deviceID;
+ CARD8 changedGroups;
+ CARD16 firstSI B16;
+ CARD16 nSI B16;
+ CARD16 nTotalSI B16;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+} xkbCompatMapNotify;
+#define sz_xkbCompatMapNotify 32
+
+typedef struct _xkbBellNotify {
+ BYTE type;
+ BYTE xkbType;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ CARD8 deviceID;
+ CARD8 bellClass;
+ CARD8 bellID;
+ CARD8 percent;
+ CARD16 pitch B16;
+ CARD16 duration B16;
+ Atom name B32;
+ Window window B32;
+ BOOL eventOnly;
+ CARD8 pad1;
+ CARD16 pad2 B16;
+ CARD32 pad3 B32;
+} xkbBellNotify;
+#define sz_xkbBellNotify 32
+
+typedef struct _xkbActionMessage {
+ BYTE type;
+ BYTE xkbType;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ CARD8 deviceID;
+ KeyCode keycode;
+ BOOL press;
+ BOOL keyEventFollows;
+ CARD8 mods;
+ CARD8 group;
+ CARD8 message[8];
+ CARD16 pad1 B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+} xkbActionMessage;
+#define sz_xkbActionMessage 32
+
+typedef struct _xkbAccessXNotify {
+ BYTE type;
+ BYTE xkbType;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ CARD8 deviceID;
+ KeyCode keycode;
+ CARD16 detail B16;
+ CARD16 slowKeysDelay B16;
+ CARD16 debounceDelay B16;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+} xkbAccessXNotify;
+#define sz_xkbAccessXNotify 32
+
+typedef struct _xkbExtensionDeviceNotify {
+ BYTE type;
+ BYTE xkbType;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ CARD8 deviceID;
+ CARD8 pad1;
+ CARD16 reason B16;
+ CARD16 ledClass B16;
+ CARD16 ledID B16;
+ CARD32 ledsDefined B32;
+ CARD32 ledState B32;
+ CARD8 firstBtn;
+ CARD8 nBtns;
+ CARD16 supported B16;
+ CARD16 unsupported B16;
+ CARD16 pad3 B16;
+} xkbExtensionDeviceNotify;
+#define sz_xkbExtensionDeviceNotify 32
+
+typedef struct _xkbEvent {
+ union {
+ xkbAnyEvent any;
+ xkbNewKeyboardNotify new_kbd;
+ xkbMapNotify map;
+ xkbStateNotify state;
+ xkbControlsNotify ctrls;
+ xkbIndicatorNotify indicators;
+ xkbNamesNotify names;
+ xkbCompatMapNotify compat;
+ xkbBellNotify bell;
+ xkbActionMessage message;
+ xkbAccessXNotify accessx;
+ xkbExtensionDeviceNotify device;
+ } u;
+} xkbEvent;
+#define sz_xkbEvent 32
+
+#undef Window
+#undef Atom
+#undef Time
+#undef KeyCode
+#undef KeySym
+
+#endif /* _XKBPROTO_H_ */
diff --git a/sysroot/usr/include/X11/extensions/XKBsrv.h b/sysroot/usr/include/X11/extensions/XKBsrv.h
new file mode 100644
index 0000000..49630af
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/XKBsrv.h
@@ -0,0 +1,1187 @@
+/* $Xorg: XKBsrv.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */
+/* $XdotOrg: $ */
+/************************************************************
+Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
+
+Permission to use, copy, modify, and distribute this
+software and its documentation for any purpose and without
+fee is hereby granted, provided that the above copyright
+notice appear in all copies and that both that copyright
+notice and this permission notice appear in supporting
+documentation, and that the name of Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
+of the software without specific prior written permission.
+Silicon Graphics makes no representation about the suitability
+of this software for any purpose. It is provided "as is"
+without any express or implied warranty.
+
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
+THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+********************************************************/
+/* $XFree86: xc/include/extensions/XKBsrv.h,v 3.22 2002/11/20 04:49:01 dawes Exp $ */
+
+#ifndef _XKBSRV_H_
+#define _XKBSRV_H_
+
+#ifdef XKB_IN_SERVER
+#define XkbAllocClientMap SrvXkbAllocClientMap
+#define XkbAllocServerMap SrvXkbAllocServerMap
+#define XkbChangeTypesOfKey SrvXkbChangeTypesOfKey
+#define XkbAddKeyType SrvXkbAddKeyType
+#define XkbCopyKeyType SrvXkbCopyKeyType
+#define XkbCopyKeyTypes SrvXkbCopyKeyTypes
+#define XkbFreeClientMap SrvXkbFreeClientMap
+#define XkbFreeServerMap SrvXkbFreeServerMap
+#define XkbInitCanonicalKeyTypes SrvXkbInitCanonicalKeyTypes
+#define XkbKeyTypesForCoreSymbols SrvXkbKeyTypesForCoreSymbols
+#define XkbApplyCompatMapToKey SrvXkbApplyCompatMapToKey
+#define XkbUpdateMapFromCore SrvXkbUpdateMapFromCore
+#define XkbResizeKeyActions SrvXkbResizeKeyActions
+#define XkbResizeKeySyms SrvXkbResizeKeySyms
+#define XkbResizeKeyType SrvXkbResizeKeyType
+#define XkbAllocCompatMap SrvXkbAllocCompatMap
+#define XkbAllocControls SrvXkbAllocControls
+#define XkbAllocIndicatorMaps SrvXkbAllocIndicatorMaps
+#define XkbAllocKeyboard SrvXkbAllocKeyboard
+#define XkbAllocNames SrvXkbAllocNames
+#define XkbFreeCompatMap SrvXkbFreeCompatMap
+#define XkbFreeControls SrvXkbFreeControls
+#define XkbFreeIndicatorMaps SrvXkbFreeIndicatorMaps
+#define XkbFreeKeyboard SrvXkbFreeKeyboard
+#define XkbFreeNames SrvXkbFreeNames
+#define XkbAddDeviceLedInfo SrvXkbAddDeviceLedInfo
+#define XkbAllocDeviceInfo SrvXkbAllocDeviceInfo
+#define XkbFreeDeviceInfo SrvXkbFreeDeviceInfo
+#define XkbResizeDeviceButtonActions SrvXkbResizeDeviceButtonActions
+#define XkbLatchModifiers SrvXkbLatchModifiers
+#define XkbLatchGroup SrvXkbLatchGroup
+#define XkbVirtualModsToReal SrvXkbVirtualModsToReal
+#define XkbChangeKeycodeRange SrvXkbChangeKeycodeRange
+#define XkbApplyVirtualModChanges SrvXkbApplyVirtualModChanges
+#define XkbUpdateActionVirtualMods SrvXkbUpdateActionVirtualMods
+#define XkbUpdateKeyTypeVirtualMods SrvXkbUpdateKeyTypeVirtualMods
+#endif
+
+#include <X11/extensions/XKBstr.h>
+#include <X11/extensions/XKBproto.h>
+#include "inputstr.h"
+
+typedef struct _XkbInterest {
+ DeviceIntPtr dev;
+ ClientPtr client;
+ XID resource;
+ struct _XkbInterest * next;
+ CARD16 extDevNotifyMask;
+ CARD16 stateNotifyMask;
+ CARD16 namesNotifyMask;
+ CARD32 ctrlsNotifyMask;
+ CARD8 compatNotifyMask;
+ BOOL bellNotifyMask;
+ BOOL actionMessageMask;
+ CARD16 accessXNotifyMask;
+ CARD32 iStateNotifyMask;
+ CARD32 iMapNotifyMask;
+ CARD16 altSymsNotifyMask;
+ CARD32 autoCtrls;
+ CARD32 autoCtrlValues;
+} XkbInterestRec,*XkbInterestPtr;
+
+typedef struct _XkbRadioGroup {
+ CARD8 flags;
+ CARD8 nMembers;
+ CARD8 dfltDown;
+ CARD8 currentDown;
+ CARD8 members[XkbRGMaxMembers];
+} XkbRadioGroupRec, *XkbRadioGroupPtr;
+
+typedef struct _XkbEventCause {
+ CARD8 kc;
+ CARD8 event;
+ CARD8 mjr;
+ CARD8 mnr;
+ ClientPtr client;
+} XkbEventCauseRec,*XkbEventCausePtr;
+#define XkbSetCauseKey(c,k,e) { (c)->kc= (k),(c)->event= (e),\
+ (c)->mjr= (c)->mnr= 0; \
+ (c)->client= NULL; }
+#define XkbSetCauseReq(c,j,n,cl) { (c)->kc= (c)->event= 0,\
+ (c)->mjr= (j),(c)->mnr= (n);\
+ (c)->client= (cl); }
+#define XkbSetCauseCoreReq(c,e,cl) XkbSetCauseReq(c,e,0,cl)
+#define XkbSetCauseXkbReq(c,e,cl) XkbSetCauseReq(c,XkbReqCode,e,cl)
+#define XkbSetCauseUnknown(c) XkbSetCauseKey(c,0,0)
+
+#define _OFF_TIMER 0
+#define _KRG_WARN_TIMER 1
+#define _KRG_TIMER 2
+#define _SK_TIMEOUT_TIMER 3
+#define _ALL_TIMEOUT_TIMER 4
+
+#define _BEEP_NONE 0
+#define _BEEP_FEATURE_ON 1
+#define _BEEP_FEATURE_OFF 2
+#define _BEEP_FEATURE_CHANGE 3
+#define _BEEP_SLOW_WARN 4
+#define _BEEP_SLOW_PRESS 5
+#define _BEEP_SLOW_ACCEPT 6
+#define _BEEP_SLOW_REJECT 7
+#define _BEEP_SLOW_RELEASE 8
+#define _BEEP_STICKY_LATCH 9
+#define _BEEP_STICKY_LOCK 10
+#define _BEEP_STICKY_UNLOCK 11
+#define _BEEP_LED_ON 12
+#define _BEEP_LED_OFF 13
+#define _BEEP_LED_CHANGE 14
+#define _BEEP_BOUNCE_REJECT 15
+
+typedef struct _XkbSrvInfo {
+ XkbStateRec prev_state;
+ XkbStateRec state;
+ XkbDescPtr desc;
+
+ DeviceIntPtr device;
+ KbdCtrlProcPtr kbdProc;
+
+ XkbRadioGroupPtr radioGroups;
+ CARD8 nRadioGroups;
+ CARD8 clearMods;
+ CARD8 setMods;
+ INT16 groupChange;
+
+ CARD16 dfltPtrDelta;
+
+ double mouseKeysCurve;
+ double mouseKeysCurveFactor;
+ INT16 mouseKeysDX;
+ INT16 mouseKeysDY;
+ CARD8 mouseKeysFlags;
+ Bool mouseKeysAccel;
+ CARD8 mouseKeysCounter;
+
+ CARD8 lockedPtrButtons;
+ CARD8 shiftKeyCount;
+ KeyCode mouseKey;
+ KeyCode inactiveKey;
+ KeyCode slowKey;
+ KeyCode repeatKey;
+ CARD8 krgTimerActive;
+ CARD8 beepType;
+ CARD8 beepCount;
+
+ CARD32 flags;
+ CARD32 lastPtrEventTime;
+ CARD32 lastShiftEventTime;
+ OsTimerPtr beepTimer;
+ OsTimerPtr mouseKeyTimer;
+ OsTimerPtr slowKeysTimer;
+ OsTimerPtr bounceKeysTimer;
+ OsTimerPtr repeatKeyTimer;
+ OsTimerPtr krgTimer;
+} XkbSrvInfoRec, *XkbSrvInfoPtr;
+
+#define XkbSLI_IsDefault (1L<<0)
+#define XkbSLI_HasOwnState (1L<<1)
+
+typedef struct _XkbSrvLedInfo {
+ CARD16 flags;
+ CARD16 class;
+ CARD16 id;
+ union {
+ KbdFeedbackPtr kf;
+ LedFeedbackPtr lf;
+ } fb;
+
+ CARD32 physIndicators;
+ CARD32 autoState;
+ CARD32 explicitState;
+ CARD32 effectiveState;
+
+ CARD32 mapsPresent;
+ CARD32 namesPresent;
+ XkbIndicatorMapPtr maps;
+ Atom * names;
+
+ CARD32 usesBase;
+ CARD32 usesLatched;
+ CARD32 usesLocked;
+ CARD32 usesEffective;
+ CARD32 usesCompat;
+ CARD32 usesControls;
+
+ CARD32 usedComponents;
+} XkbSrvLedInfoRec, *XkbSrvLedInfoPtr;
+
+/*
+ * Settings for xkbClientFlags field (used by DIX)
+ * These flags _must_ not overlap with XkbPCF_*
+ */
+#define _XkbClientInitialized (1<<15)
+
+#define _XkbWantsDetectableAutoRepeat(c)\
+ ((c)->xkbClientFlags&XkbPCF_DetectableAutoRepeatMask)
+
+/*
+ * Settings for flags field
+ */
+#define _XkbStateNotifyInProgress (1<<0)
+
+typedef struct
+{
+ ProcessInputProc processInputProc;
+ ProcessInputProc realInputProc;
+ DeviceUnwrapProc unwrapProc;
+} xkbDeviceInfoRec, *xkbDeviceInfoPtr;
+
+#define WRAP_PROCESS_INPUT_PROC(device, oldprocs, proc, unwrapproc) \
+ device->public.processInputProc = proc; \
+ oldprocs->processInputProc = \
+ oldprocs->realInputProc = device->public.realInputProc; \
+ device->public.realInputProc = proc; \
+ oldprocs->unwrapProc = device->unwrapProc; \
+ device->unwrapProc = unwrapproc;
+
+#define COND_WRAP_PROCESS_INPUT_PROC(device, oldprocs, proc, unwrapproc) \
+ if (device->public.processInputProc == device->public.realInputProc)\
+ device->public.processInputProc = proc; \
+ oldprocs->processInputProc = \
+ oldprocs->realInputProc = device->public.realInputProc; \
+ device->public.realInputProc = proc; \
+ oldprocs->unwrapProc = device->unwrapProc; \
+ device->unwrapProc = unwrapproc;
+
+#define UNWRAP_PROCESS_INPUT_PROC(device, oldprocs) \
+ device->public.processInputProc = oldprocs->processInputProc; \
+ device->public.realInputProc = oldprocs->realInputProc; \
+ device->unwrapProc = oldprocs->unwrapProc;
+
+#define XKBDEVICEINFO(dev) ((xkbDeviceInfoPtr) (dev)->devPrivates[xkbDevicePrivateIndex].ptr)
+
+/***====================================================================***/
+
+
+/***====================================================================***/
+
+#define XkbAX_KRGMask (XkbSlowKeysMask|XkbBounceKeysMask)
+#define XkbAllFilteredEventsMask \
+ (XkbAccessXKeysMask|XkbRepeatKeysMask|XkbMouseKeysAccelMask|XkbAX_KRGMask)
+
+/***====================================================================***/
+
+extern int XkbReqCode;
+extern int XkbEventBase;
+extern int XkbKeyboardErrorCode;
+extern int XkbDisableLockActions;
+extern char * XkbBaseDirectory;
+extern char * XkbBinDirectory;
+extern char * XkbInitialMap;
+extern int _XkbClientMajor;
+extern int _XkbClientMinor;
+extern unsigned int XkbXIUnsupported;
+
+extern char * XkbModelUsed,*XkbLayoutUsed,*XkbVariantUsed,*XkbOptionsUsed;
+extern Bool noXkbExtension;
+extern Bool XkbWantRulesProp;
+
+extern pointer XkbLastRepeatEvent;
+
+extern CARD32 xkbDebugFlags;
+extern CARD32 xkbDebugCtrls;
+
+#define _XkbAlloc(s) xalloc((s))
+#define _XkbCalloc(n,s) Xcalloc((n)*(s))
+#define _XkbRealloc(o,s) Xrealloc((o),(s))
+#define _XkbTypedAlloc(t) ((t *)xalloc(sizeof(t)))
+#define _XkbTypedCalloc(n,t) ((t *)Xcalloc((n)*sizeof(t)))
+#define _XkbTypedRealloc(o,n,t) \
+ ((o)?(t *)Xrealloc((o),(n)*sizeof(t)):_XkbTypedCalloc(n,t))
+#define _XkbClearElems(a,f,l,t) bzero(&(a)[f],((l)-(f)+1)*sizeof(t))
+#define _XkbFree(p) Xfree(p)
+
+#define _XkbLibError(c,l,d) \
+ { _XkbErrCode= (c); _XkbErrLocation= (l); _XkbErrData= (d); }
+#define _XkbErrCode2(a,b) ((XID)((((unsigned int)(a))<<24)|((b)&0xffffff)))
+#define _XkbErrCode3(a,b,c) _XkbErrCode2(a,(((unsigned int)(b))<<16)|(c))
+#define _XkbErrCode4(a,b,c,d) _XkbErrCode3(a,b,((((unsigned int)(c))<<8)|(d)))
+
+extern int DeviceKeyPress,DeviceKeyRelease;
+extern int DeviceButtonPress,DeviceButtonRelease;
+
+#ifdef XINPUT
+#define _XkbIsPressEvent(t) (((t)==KeyPress)||((t)==DeviceKeyPress))
+#define _XkbIsReleaseEvent(t) (((t)==KeyRelease)||((t)==DeviceKeyRelease))
+#else
+#define _XkbIsPressEvent(t) ((t)==KeyPress)
+#define _XkbIsReleaseEvent(t) ((t)==KeyRelease)
+#endif
+
+#define _XkbCoreKeycodeInRange(c,k) (((k)>=(c)->curKeySyms.minKeyCode)&&\
+ ((k)<=(c)->curKeySyms.maxKeyCode))
+#define _XkbCoreNumKeys(c) ((c)->curKeySyms.maxKeyCode-\
+ (c)->curKeySyms.minKeyCode+1)
+
+#define XConvertCase(s,l,u) XkbConvertCase(s,l,u)
+#undef IsKeypadKey
+#define IsKeypadKey(s) XkbKSIsKeypad(s)
+
+#define Status int
+#define XPointer pointer
+#define Display struct _XDisplay
+
+#ifndef True
+#define True 1
+#define False 0
+#endif
+
+#ifndef PATH_MAX
+#ifdef MAXPATHLEN
+#define PATH_MAX MAXPATHLEN
+#else
+#define PATH_MAX 1024
+#endif
+#endif
+
+_XFUNCPROTOBEGIN
+
+extern void XkbUseMsg(
+ void
+);
+
+extern int XkbProcessArguments(
+ int /* argc */,
+ char ** /* argv */,
+ int /* i */
+);
+
+extern void XkbSetExtension(DeviceIntPtr device, ProcessInputProc proc);
+
+extern void XkbFreeCompatMap(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ Bool /* freeMap */
+);
+
+extern void XkbFreeNames(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ Bool /* freeMap */
+);
+
+extern DeviceIntPtr _XkbLookupAnyDevice(
+ int /* id */,
+ int * /* why_rtrn */
+);
+
+extern DeviceIntPtr _XkbLookupKeyboard(
+ int /* id */,
+ int * /* why_rtrn */
+);
+
+extern DeviceIntPtr _XkbLookupBellDevice(
+ int /* id */,
+ int * /* why_rtrn */
+);
+
+extern DeviceIntPtr _XkbLookupLedDevice(
+ int /* id */,
+ int * /* why_rtrn */
+);
+
+extern DeviceIntPtr _XkbLookupButtonDevice(
+ int /* id */,
+ int * /* why_rtrn */
+);
+
+extern XkbDescPtr XkbAllocKeyboard(
+ void
+);
+
+extern Status XkbAllocClientMap(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ unsigned int /* nTypes */
+);
+
+extern Status XkbAllocServerMap(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ unsigned int /* nNewActions */
+);
+
+extern void XkbFreeClientMap(
+ XkbDescPtr /* xkb */,
+ unsigned int /* what */,
+ Bool /* freeMap */
+);
+
+extern void XkbFreeServerMap(
+ XkbDescPtr /* xkb */,
+ unsigned int /* what */,
+ Bool /* freeMap */
+);
+
+extern Status XkbAllocIndicatorMaps(
+ XkbDescPtr /* xkb */
+);
+
+extern Status XkbAllocCompatMap(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ unsigned int /* nInterpret */
+);
+
+extern Status XkbAllocNames(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ int /* nTotalRG */,
+ int /* nTotalAliases */
+);
+
+extern Status XkbAllocControls(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which*/
+);
+
+extern Status XkbCopyKeyType(
+ XkbKeyTypePtr /* from */,
+ XkbKeyTypePtr /* into */
+);
+
+extern Status XkbCopyKeyTypes(
+ XkbKeyTypePtr /* from */,
+ XkbKeyTypePtr /* into */,
+ int /* num_types */
+);
+
+extern Status XkbResizeKeyType(
+ XkbDescPtr /* xkb */,
+ int /* type_ndx */,
+ int /* map_count */,
+ Bool /* want_preserve */,
+ int /* new_num_lvls */
+);
+
+extern void XkbFreeKeyboard(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ Bool /* freeDesc */
+);
+
+extern void XkbSetActionKeyMods(
+ XkbDescPtr /* xkb */,
+ XkbAction * /* act */,
+ unsigned int /* mods */
+);
+
+extern Bool XkbCheckActionVMods(
+ XkbDescPtr /* xkb */,
+ XkbAction * /* act */,
+ unsigned int /* changed */
+);
+
+extern Bool XkbApplyVModChanges(
+ XkbSrvInfoPtr /* xkbi */,
+ unsigned int /* changed */,
+ XkbChangesPtr /* pChanges */,
+ unsigned int * /* needChecksRtrn */,
+ XkbEventCausePtr /* cause */
+);
+
+extern void XkbApplyVModChangesToAllDevices(
+ DeviceIntPtr /* dev */,
+ XkbDescPtr /* xkb */,
+ unsigned int /* changed */,
+ XkbEventCausePtr /* cause */
+);
+
+extern unsigned int XkbMaskForVMask(
+ XkbDescPtr /* xkb */,
+ unsigned int /* vmask */
+);
+
+extern Bool XkbVirtualModsToReal(
+ XkbDescPtr /* xkb */,
+ unsigned int /* virtua_mask */,
+ unsigned int * /* mask_rtrn */
+);
+
+extern unsigned int XkbAdjustGroup(
+ int /* group */,
+ XkbControlsPtr /* ctrls */
+);
+
+extern KeySym *XkbResizeKeySyms(
+ XkbDescPtr /* xkb */,
+ int /* key */,
+ int /* needed */
+);
+
+extern XkbAction *XkbResizeKeyActions(
+ XkbDescPtr /* xkb */,
+ int /* key */,
+ int /* needed */
+);
+
+extern void XkbUpdateKeyTypesFromCore(
+ DeviceIntPtr /* pXDev */,
+ KeyCode /* first */,
+ CARD8 /* num */,
+ XkbChangesPtr /* pChanges */
+);
+
+extern void XkbUpdateDescActions(
+ XkbDescPtr /* xkb */,
+ KeyCode /* first */,
+ CARD8 /* num */,
+ XkbChangesPtr /* changes */
+);
+
+extern void XkbUpdateActions(
+ DeviceIntPtr /* pXDev */,
+ KeyCode /* first */,
+ CARD8 /* num */,
+ XkbChangesPtr /* pChanges */,
+ unsigned int * /* needChecksRtrn */,
+ XkbEventCausePtr /* cause */
+);
+
+extern void XkbUpdateCoreDescription(
+ DeviceIntPtr /* keybd */,
+ Bool /* resize */
+);
+
+extern void XkbApplyMappingChange(
+ DeviceIntPtr /* pXDev */,
+ CARD8 /* request */,
+ KeyCode /* firstKey */,
+ CARD8 /* num */,
+ ClientPtr /* client */
+);
+
+extern void XkbSetIndicators(
+ DeviceIntPtr /* pXDev */,
+ CARD32 /* affect */,
+ CARD32 /* values */,
+ XkbEventCausePtr /* cause */
+);
+
+extern void XkbUpdateIndicators(
+ DeviceIntPtr /* keybd */,
+ CARD32 /* changed */,
+ Bool /* check_edevs */,
+ XkbChangesPtr /* pChanges */,
+ XkbEventCausePtr /* cause */
+);
+
+extern XkbSrvLedInfoPtr XkbAllocSrvLedInfo(
+ DeviceIntPtr /* dev */,
+ KbdFeedbackPtr /* kf */,
+ LedFeedbackPtr /* lf */,
+ unsigned int /* needed_parts */
+);
+
+extern XkbSrvLedInfoPtr XkbFindSrvLedInfo(
+ DeviceIntPtr /* dev */,
+ unsigned int /* class */,
+ unsigned int /* id */,
+ unsigned int /* needed_parts */
+);
+
+extern void XkbApplyLedNameChanges(
+ DeviceIntPtr /* dev */,
+ XkbSrvLedInfoPtr /* sli */,
+ unsigned int /* changed_names */,
+ xkbExtensionDeviceNotify * /* ed */,
+ XkbChangesPtr /* changes */,
+ XkbEventCausePtr /* cause */
+);
+
+extern void XkbApplyLedMapChanges(
+ DeviceIntPtr /* dev */,
+ XkbSrvLedInfoPtr /* sli */,
+ unsigned int /* changed_maps */,
+ xkbExtensionDeviceNotify * /* ed */,
+ XkbChangesPtr /* changes */,
+ XkbEventCausePtr /* cause */
+);
+
+extern void XkbApplyLedStateChanges(
+ DeviceIntPtr /* dev */,
+ XkbSrvLedInfoPtr /* sli */,
+ unsigned int /* changed_leds */,
+ xkbExtensionDeviceNotify * /* ed */,
+ XkbChangesPtr /* changes */,
+ XkbEventCausePtr /* cause */
+);
+
+extern void XkbUpdateLedAutoState(
+ DeviceIntPtr /* dev */,
+ XkbSrvLedInfoPtr /* sli */,
+ unsigned int /* maps_to_check */,
+ xkbExtensionDeviceNotify * /* ed */,
+ XkbChangesPtr /* changes */,
+ XkbEventCausePtr /* cause */
+);
+
+extern void XkbFlushLedEvents(
+ DeviceIntPtr /* dev */,
+ DeviceIntPtr /* kbd */,
+ XkbSrvLedInfoPtr /* sli */,
+ xkbExtensionDeviceNotify * /* ed */,
+ XkbChangesPtr /* changes */,
+ XkbEventCausePtr /* cause */
+);
+
+extern void XkbUpdateAllDeviceIndicators(
+ XkbChangesPtr /* changes */,
+ XkbEventCausePtr /* cause */
+);
+
+extern unsigned int XkbIndicatorsToUpdate(
+ DeviceIntPtr /* dev */,
+ unsigned long /* state_changes */,
+ Bool /* enabled_ctrl_changes */
+);
+
+extern void XkbComputeDerivedState(
+ XkbSrvInfoPtr /* xkbi */
+);
+
+extern void XkbCheckSecondaryEffects(
+ XkbSrvInfoPtr /* xkbi */,
+ unsigned int /* which */,
+ XkbChangesPtr /* changes */,
+ XkbEventCausePtr /* cause */
+);
+
+extern void XkbCheckIndicatorMaps(
+ DeviceIntPtr /* dev */,
+ XkbSrvLedInfoPtr /* sli */,
+ unsigned int /* which */
+);
+
+extern unsigned int XkbStateChangedFlags(
+ XkbStatePtr /* old */,
+ XkbStatePtr /* new */
+);
+
+extern void XkbSendStateNotify(
+ DeviceIntPtr /* kbd */,
+ xkbStateNotify * /* pSN */
+);
+
+extern void XkbSendMapNotify(
+ DeviceIntPtr /* kbd */,
+ xkbMapNotify * /* ev */
+);
+
+extern int XkbComputeControlsNotify(
+ DeviceIntPtr /* kbd */,
+ XkbControlsPtr /* old */,
+ XkbControlsPtr /* new */,
+ xkbControlsNotify * /* pCN */,
+ Bool /* forceCtrlProc */
+);
+
+extern void XkbSendControlsNotify(
+ DeviceIntPtr /* kbd */,
+ xkbControlsNotify * /* ev */
+);
+
+extern void XkbSendCompatMapNotify(
+ DeviceIntPtr /* kbd */,
+ xkbCompatMapNotify * /* ev */
+);
+
+extern void XkbSendIndicatorNotify(
+ DeviceIntPtr /* kbd */,
+ int /* xkbType */,
+ xkbIndicatorNotify * /* ev */
+);
+
+extern void XkbHandleBell(
+ BOOL /* force */,
+ BOOL /* eventOnly */,
+ DeviceIntPtr /* kbd */,
+ CARD8 /* percent */,
+ pointer /* ctrl */,
+ CARD8 /* class */,
+ Atom /* name */,
+ WindowPtr /* pWin */,
+ ClientPtr /* pClient */
+);
+
+extern void XkbSendAccessXNotify(
+ DeviceIntPtr /* kbd */,
+ xkbAccessXNotify * /* pEv */
+);
+
+extern void XkbSendNamesNotify(
+ DeviceIntPtr /* kbd */,
+ xkbNamesNotify * /* ev */
+);
+
+extern void XkbSendCompatNotify(
+ DeviceIntPtr /* kbd */,
+ xkbCompatMapNotify * /* ev */
+);
+
+extern void XkbSendActionMessage(
+ DeviceIntPtr /* kbd */,
+ xkbActionMessage * /* ev */
+);
+
+extern void XkbSendExtensionDeviceNotify(
+ DeviceIntPtr /* kbd */,
+ ClientPtr /* client */,
+ xkbExtensionDeviceNotify * /* ev */
+);
+
+extern void XkbSendNotification(
+ DeviceIntPtr /* kbd */,
+ XkbChangesPtr /* pChanges */,
+ XkbEventCausePtr /* cause */
+);
+
+extern void XkbProcessKeyboardEvent(
+ struct _xEvent * /* xE */,
+ DeviceIntPtr /* keybd */,
+ int /* count */
+);
+
+extern void XkbProcessOtherEvent(
+ struct _xEvent * /* xE */,
+ DeviceIntPtr /* keybd */,
+ int /* count */
+);
+
+extern void XkbHandleActions(
+ DeviceIntPtr /* dev */,
+ DeviceIntPtr /* kbd */,
+ struct _xEvent * /* xE */,
+ int /* count */
+);
+
+extern Bool XkbEnableDisableControls(
+ XkbSrvInfoPtr /* xkbi */,
+ unsigned long /* change */,
+ unsigned long /* newValues */,
+ XkbChangesPtr /* changes */,
+ XkbEventCausePtr /* cause */
+);
+
+extern void AccessXInit(
+ DeviceIntPtr /* dev */
+);
+
+extern Bool AccessXFilterPressEvent(
+ register struct _xEvent * /* xE */,
+ register DeviceIntPtr /* keybd */,
+ int /* count */
+);
+
+extern Bool AccessXFilterReleaseEvent(
+ register struct _xEvent * /* xE */,
+ register DeviceIntPtr /* keybd */,
+ int /* count */
+);
+
+extern void AccessXCancelRepeatKey(
+ XkbSrvInfoPtr /* xkbi */,
+ KeyCode /* key */
+);
+
+extern void AccessXComputeCurveFactor(
+ XkbSrvInfoPtr /* xkbi */,
+ XkbControlsPtr /* ctrls */
+);
+
+extern XkbDeviceLedInfoPtr XkbAddDeviceLedInfo(
+ XkbDeviceInfoPtr /* devi */,
+ unsigned int /* ledClass */,
+ unsigned int /* ledId */
+);
+
+extern XkbDeviceInfoPtr XkbAllocDeviceInfo(
+ unsigned int /* deviceSpec */,
+ unsigned int /* nButtons */,
+ unsigned int /* szLeds */
+);
+
+extern void XkbFreeDeviceInfo(
+ XkbDeviceInfoPtr /* devi */,
+ unsigned int /* which */,
+ Bool /* freeDevI */
+);
+
+extern Status XkbResizeDeviceButtonActions(
+ XkbDeviceInfoPtr /* devi */,
+ unsigned int /* newTotal */
+);
+
+extern XkbInterestPtr XkbFindClientResource(
+ DevicePtr /* inDev */,
+ ClientPtr /* client */
+);
+
+extern XkbInterestPtr XkbAddClientResource(
+ DevicePtr /* inDev */,
+ ClientPtr /* client */,
+ XID /* id */
+);
+
+extern int XkbRemoveClient(
+ DevicePtr /* inDev */,
+ ClientPtr /* client */
+);
+
+extern int XkbRemoveResourceClient(
+ DevicePtr /* inDev */,
+ XID /* id */
+);
+
+extern int XkbDDXInitDevice(
+ DeviceIntPtr /* dev */
+);
+
+extern int XkbDDXAccessXBeep(
+ DeviceIntPtr /* dev */,
+ unsigned int /* what */,
+ unsigned int /* which */
+);
+
+extern void XkbDDXKeyClick(
+ DeviceIntPtr /* dev */,
+ int /* keycode */,
+ int /* synthetic */
+);
+
+extern int XkbDDXUsesSoftRepeat(
+ DeviceIntPtr /* dev */
+);
+
+extern void XkbDDXKeybdCtrlProc(
+ DeviceIntPtr /* dev */,
+ KeybdCtrl * /* ctrl */
+);
+
+extern void XkbDDXChangeControls(
+ DeviceIntPtr /* dev */,
+ XkbControlsPtr /* old */,
+ XkbControlsPtr /* new */
+);
+
+extern void XkbDDXUpdateIndicators(
+ DeviceIntPtr /* keybd */,
+ CARD32 /* newState */
+);
+
+extern void XkbDDXUpdateDeviceIndicators(
+ DeviceIntPtr /* dev */,
+ XkbSrvLedInfoPtr /* sli */,
+ CARD32 /* newState */
+);
+
+extern void XkbDDXFakePointerButton(
+ int /* event */,
+ int /* button */
+);
+
+extern void XkbDDXFakePointerMotion(
+ unsigned int /* flags */,
+ int /* x */,
+ int /* y */
+);
+
+extern void XkbDDXFakeDeviceButton(
+ DeviceIntPtr /* dev */,
+ Bool /* press */,
+ int /* button */
+);
+
+extern int XkbDDXTerminateServer(
+ DeviceIntPtr /* dev */,
+ KeyCode /* key */,
+ XkbAction * /* act */
+);
+
+extern int XkbDDXSwitchScreen(
+ DeviceIntPtr /* dev */,
+ KeyCode /* key */,
+ XkbAction * /* act */
+);
+
+extern int XkbDDXPrivate(
+ DeviceIntPtr /* dev */,
+ KeyCode /* key */,
+ XkbAction * /* act */
+);
+
+extern void XkbDisableComputedAutoRepeats(
+ DeviceIntPtr /* pXDev */,
+ unsigned int /* key */
+);
+
+extern void XkbSetRepeatKeys(
+ DeviceIntPtr /* pXDev */,
+ int /* key */,
+ int /* onoff */
+);
+
+extern int XkbLatchModifiers(
+ DeviceIntPtr /* pXDev */,
+ CARD8 /* mask */,
+ CARD8 /* latches */
+);
+
+extern int XkbLatchGroup(
+ DeviceIntPtr /* pXDev */,
+ int /* group */
+);
+
+extern void XkbClearAllLatchesAndLocks(
+ DeviceIntPtr /* dev */,
+ XkbSrvInfoPtr /* xkbi */,
+ Bool /* genEv */,
+ XkbEventCausePtr /* cause */
+);
+
+extern void XkbSetRulesDflts(
+ char * /* rulesFile */,
+ char * /* model */,
+ char * /* layout */,
+ char * /* variant */,
+ char * /* options */
+);
+
+extern void XkbInitDevice(
+ DeviceIntPtr /* pXDev */
+);
+
+extern Bool XkbInitKeyboardDeviceStruct(
+ DeviceIntPtr /* pXDev */,
+ XkbComponentNamesPtr /* pNames */,
+ KeySymsPtr /* pSyms */,
+ CARD8 /* pMods */[],
+ BellProcPtr /* bellProc */,
+ KbdCtrlProcPtr /* ctrlProc */
+);
+
+extern int SProcXkbDispatch(
+ ClientPtr /* client */
+);
+
+extern XkbGeometryPtr XkbLookupNamedGeometry(
+ DeviceIntPtr /* dev */,
+ Atom /* name */,
+ Bool * /* shouldFree */
+);
+
+extern char * _XkbDupString(
+ char * /* str */
+);
+
+extern void XkbConvertCase(
+ KeySym /* sym */,
+ KeySym * /* lower */,
+ KeySym * /* upper */
+);
+
+extern Status XkbChangeKeycodeRange(
+ XkbDescPtr /* xkb */,
+ int /* minKC */,
+ int /* maxKC */,
+ XkbChangesPtr /* changes */
+);
+
+extern int XkbFinishDeviceInit(
+ DeviceIntPtr /* pXDev */
+);
+
+extern void XkbFreeSrvLedInfo(
+ XkbSrvLedInfoPtr /* sli */
+);
+
+extern void XkbFreeInfo(
+ XkbSrvInfoPtr /* xkbi */
+);
+
+extern Status XkbChangeTypesOfKey(
+ XkbDescPtr /* xkb */,
+ int /* key */,
+ int /* nGroups */,
+ unsigned int /* groups */,
+ int * /* newTypesIn */,
+ XkbMapChangesPtr /* changes */
+);
+
+extern XkbKeyTypePtr XkbAddKeyType(
+ XkbDescPtr /* xkb */,
+ Atom /* name */,
+ int /* map_count */,
+ Bool /* want_preserve */,
+ int /* num_lvls */
+);
+
+extern Status XkbInitCanonicalKeyTypes(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ int /* keypadVMod */
+);
+
+extern int XkbKeyTypesForCoreSymbols(
+ XkbDescPtr /* xkb */,
+ int /* map_width */,
+ KeySym * /* core_syms */,
+ unsigned int /* protected */,
+ int * /* types_inout */,
+ KeySym * /* xkb_syms_rtrn */
+);
+
+extern Bool XkbApplyCompatMapToKey(
+ XkbDescPtr /* xkb */,
+ KeyCode /* key */,
+ XkbChangesPtr /* changes */
+);
+
+extern Bool XkbUpdateMapFromCore(
+ XkbDescPtr /* xkb */,
+ KeyCode /* first_key */,
+ int /* num_keys */,
+ int /* map_width */,
+ KeySym * /* core_keysyms */,
+ XkbChangesPtr /* changes */
+);
+
+extern void XkbFreeControls(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ Bool /* freeMap */
+);
+
+extern void XkbFreeIndicatorMaps(
+ XkbDescPtr /* xkb */
+);
+
+extern Bool XkbApplyVirtualModChanges(
+ XkbDescPtr /* xkb */,
+ unsigned int /* changed */,
+ XkbChangesPtr /* changes */
+);
+
+extern Bool XkbUpdateActionVirtualMods(
+ XkbDescPtr /* xkb */,
+ XkbAction * /* act */,
+ unsigned int /* changed */
+);
+
+extern void XkbUpdateKeyTypeVirtualMods(
+ XkbDescPtr /* xkb */,
+ XkbKeyTypePtr /* type */,
+ unsigned int /* changed */,
+ XkbChangesPtr /* changes */
+);
+
+extern void XkbSendNewKeyboardNotify(
+ DeviceIntPtr /* kbd */,
+ xkbNewKeyboardNotify * /* pNKN */
+);
+
+#ifdef XKBSRV_NEED_FILE_FUNCS
+
+#include <X11/extensions/XKMformat.h>
+#include <X11/extensions/XKBfile.h>
+#include <X11/extensions/XKBrules.h>
+
+#define _XkbListKeymaps 0
+#define _XkbListKeycodes 1
+#define _XkbListTypes 2
+#define _XkbListCompat 3
+#define _XkbListSymbols 4
+#define _XkbListGeometry 5
+#define _XkbListNumComponents 6
+
+typedef struct _XkbSrvListInfo {
+ int szPool;
+ int nPool;
+ char * pool;
+
+ int maxRtrn;
+ int nTotal;
+
+ char * pattern[_XkbListNumComponents];
+ int nFound[_XkbListNumComponents];
+} XkbSrvListInfoRec,*XkbSrvListInfoPtr;
+
+char *
+XkbGetRulesDflts(
+ XkbRF_VarDefsPtr /* defs */
+);
+
+extern void XkbSetRulesUsed(
+ XkbRF_VarDefsPtr /* defs */
+);
+
+
+extern Status XkbDDXList(
+ DeviceIntPtr /* dev */,
+ XkbSrvListInfoPtr /* listing */,
+ ClientPtr /* client */
+);
+
+extern unsigned int XkbDDXLoadKeymapByNames(
+ DeviceIntPtr /* keybd */,
+ XkbComponentNamesPtr /* names */,
+ unsigned int /* want */,
+ unsigned int /* need */,
+ XkbFileInfoPtr /* finfoRtrn */,
+ char * /* keymapNameRtrn */,
+ int /* keymapNameRtrnLen */
+);
+
+extern Bool XkbDDXNamesFromRules(
+ DeviceIntPtr /* keybd */,
+ char * /* rules */,
+ XkbRF_VarDefsPtr /* defs */,
+ XkbComponentNamesPtr /* names */
+);
+
+extern FILE *XkbDDXOpenConfigFile(
+ char * /* mapName */,
+ char * /* fileNameRtrn */,
+ int /* fileNameRtrnLen */
+);
+
+extern Bool XkbDDXApplyConfig(
+ XPointer /* cfg_in */,
+ XkbSrvInfoPtr /* xkbi */
+);
+
+extern XPointer XkbDDXPreloadConfig(
+ char ** /* rulesFileRtrn */,
+ XkbRF_VarDefsPtr /* defs */,
+ XkbComponentNamesPtr /* names */,
+ DeviceIntPtr /* dev */
+);
+
+extern int _XkbStrCaseCmp(
+ char * /* str1 */,
+ char * /* str2 */
+);
+
+#endif /* XKBSRV_NEED_FILE_FUNCS */
+
+
+_XFUNCPROTOEND
+
+#define XkbAtomGetString(d,s) NameForAtom(s)
+
+#endif /* _XKBSRV_H_ */
+
+
diff --git a/sysroot/usr/include/X11/extensions/XKBstr.h b/sysroot/usr/include/X11/extensions/XKBstr.h
new file mode 100644
index 0000000..bc63f49
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/XKBstr.h
@@ -0,0 +1,614 @@
+/* $Xorg: XKBstr.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */
+/************************************************************
+Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
+
+Permission to use, copy, modify, and distribute this
+software and its documentation for any purpose and without
+fee is hereby granted, provided that the above copyright
+notice appear in all copies and that both that copyright
+notice and this permission notice appear in supporting
+documentation, and that the name of Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
+of the software without specific prior written permission.
+Silicon Graphics makes no representation about the suitability
+of this software for any purpose. It is provided "as is"
+without any express or implied warranty.
+
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
+THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+********************************************************/
+
+#ifndef _XKBSTR_H_
+#define _XKBSTR_H_
+
+#include <X11/extensions/XKB.h>
+
+#define XkbCharToInt(v) ((v)&0x80?(int)((v)|(~0xff)):(int)((v)&0x7f))
+#define XkbIntTo2Chars(i,h,l) (((h)=((i>>8)&0xff)),((l)=((i)&0xff)))
+
+#if defined(WORD64) && defined(UNSIGNEDBITFIELDS)
+#define Xkb2CharsToInt(h,l) ((h)&0x80?(int)(((h)<<8)|(l)|(~0xffff)):\
+ (int)(((h)<<8)|(l)&0x7fff))
+#else
+#define Xkb2CharsToInt(h,l) ((short)(((h)<<8)|(l)))
+#endif
+
+ /*
+ * Common data structures and access macros
+ */
+
+typedef struct _XkbStateRec {
+ unsigned char group;
+ unsigned char locked_group;
+ unsigned short base_group;
+ unsigned short latched_group;
+ unsigned char mods;
+ unsigned char base_mods;
+ unsigned char latched_mods;
+ unsigned char locked_mods;
+ unsigned char compat_state;
+ unsigned char grab_mods;
+ unsigned char compat_grab_mods;
+ unsigned char lookup_mods;
+ unsigned char compat_lookup_mods;
+ unsigned short ptr_buttons;
+} XkbStateRec,*XkbStatePtr;
+#define XkbModLocks(s) ((s)->locked_mods)
+#define XkbStateMods(s) ((s)->base_mods|(s)->latched_mods|XkbModLocks(s))
+#define XkbGroupLock(s) ((s)->locked_group)
+#define XkbStateGroup(s) ((s)->base_group+(s)->latched_group+XkbGroupLock(s))
+#define XkbStateFieldFromRec(s) XkbBuildCoreState((s)->lookup_mods,(s)->group)
+#define XkbGrabStateFromRec(s) XkbBuildCoreState((s)->grab_mods,(s)->group)
+
+typedef struct _XkbMods {
+ unsigned char mask; /* effective mods */
+ unsigned char real_mods;
+ unsigned short vmods;
+} XkbModsRec,*XkbModsPtr;
+
+typedef struct _XkbKTMapEntry {
+ Bool active;
+ unsigned char level;
+ XkbModsRec mods;
+} XkbKTMapEntryRec,*XkbKTMapEntryPtr;
+
+typedef struct _XkbKeyType {
+ XkbModsRec mods;
+ unsigned char num_levels;
+ unsigned char map_count;
+ XkbKTMapEntryPtr map;
+ XkbModsPtr preserve;
+ Atom name;
+ Atom * level_names;
+} XkbKeyTypeRec, *XkbKeyTypePtr;
+
+#define XkbNumGroups(g) ((g)&0x0f)
+#define XkbOutOfRangeGroupInfo(g) ((g)&0xf0)
+#define XkbOutOfRangeGroupAction(g) ((g)&0xc0)
+#define XkbOutOfRangeGroupNumber(g) (((g)&0x30)>>4)
+#define XkbSetGroupInfo(g,w,n) (((w)&0xc0)|(((n)&3)<<4)|((g)&0x0f))
+#define XkbSetNumGroups(g,n) (((g)&0xf0)|((n)&0x0f))
+
+ /*
+ * Structures and access macros used primarily by the server
+ */
+
+typedef struct _XkbBehavior {
+ unsigned char type;
+ unsigned char data;
+} XkbBehavior;
+
+#define XkbAnyActionDataSize 7
+typedef struct _XkbAnyAction {
+ unsigned char type;
+ unsigned char data[XkbAnyActionDataSize];
+} XkbAnyAction;
+
+typedef struct _XkbModAction {
+ unsigned char type;
+ unsigned char flags;
+ unsigned char mask;
+ unsigned char real_mods;
+ unsigned char vmods1;
+ unsigned char vmods2;
+} XkbModAction;
+#define XkbModActionVMods(a) \
+ ((short)(((a)->vmods1<<8)|((a)->vmods2)))
+#define XkbSetModActionVMods(a,v) \
+ (((a)->vmods1=(((v)>>8)&0xff)),(a)->vmods2=((v)&0xff))
+
+typedef struct _XkbGroupAction {
+ unsigned char type;
+ unsigned char flags;
+ char group_XXX;
+} XkbGroupAction;
+#define XkbSAGroup(a) (XkbCharToInt((a)->group_XXX))
+#define XkbSASetGroup(a,g) ((a)->group_XXX=(g))
+
+typedef struct _XkbISOAction {
+ unsigned char type;
+ unsigned char flags;
+ unsigned char mask;
+ unsigned char real_mods;
+ char group_XXX;
+ unsigned char affect;
+ unsigned char vmods1;
+ unsigned char vmods2;
+} XkbISOAction;
+
+typedef struct _XkbPtrAction {
+ unsigned char type;
+ unsigned char flags;
+ unsigned char high_XXX;
+ unsigned char low_XXX;
+ unsigned char high_YYY;
+ unsigned char low_YYY;
+} XkbPtrAction;
+#define XkbPtrActionX(a) (Xkb2CharsToInt((a)->high_XXX,(a)->low_XXX))
+#define XkbPtrActionY(a) (Xkb2CharsToInt((a)->high_YYY,(a)->low_YYY))
+#define XkbSetPtrActionX(a,x) (XkbIntTo2Chars(x,(a)->high_XXX,(a)->low_XXX))
+#define XkbSetPtrActionY(a,y) (XkbIntTo2Chars(y,(a)->high_YYY,(a)->low_YYY))
+
+typedef struct _XkbPtrBtnAction {
+ unsigned char type;
+ unsigned char flags;
+ unsigned char count;
+ unsigned char button;
+} XkbPtrBtnAction;
+
+typedef struct _XkbPtrDfltAction {
+ unsigned char type;
+ unsigned char flags;
+ unsigned char affect;
+ char valueXXX;
+} XkbPtrDfltAction;
+#define XkbSAPtrDfltValue(a) (XkbCharToInt((a)->valueXXX))
+#define XkbSASetPtrDfltValue(a,c) ((a)->valueXXX= ((c)&0xff))
+
+typedef struct _XkbSwitchScreenAction {
+ unsigned char type;
+ unsigned char flags;
+ char screenXXX;
+} XkbSwitchScreenAction;
+#define XkbSAScreen(a) (XkbCharToInt((a)->screenXXX))
+#define XkbSASetScreen(a,s) ((a)->screenXXX= ((s)&0xff))
+
+typedef struct _XkbCtrlsAction {
+ unsigned char type;
+ unsigned char flags;
+ unsigned char ctrls3;
+ unsigned char ctrls2;
+ unsigned char ctrls1;
+ unsigned char ctrls0;
+} XkbCtrlsAction;
+#define XkbActionSetCtrls(a,c) (((a)->ctrls3=(((c)>>24)&0xff)),\
+ ((a)->ctrls2=(((c)>>16)&0xff)),\
+ ((a)->ctrls1=(((c)>>8)&0xff)),\
+ ((a)->ctrls0=((c)&0xff)))
+#define XkbActionCtrls(a) ((((unsigned int)(a)->ctrls3)<<24)|\
+ (((unsigned int)(a)->ctrls2)<<16)|\
+ (((unsigned int)(a)->ctrls1)<<8)|\
+ ((unsigned int)((a)->ctrls0)))
+
+typedef struct _XkbMessageAction {
+ unsigned char type;
+ unsigned char flags;
+ unsigned char message[6];
+} XkbMessageAction;
+
+typedef struct _XkbRedirectKeyAction {
+ unsigned char type;
+ unsigned char new_key;
+ unsigned char mods_mask;
+ unsigned char mods;
+ unsigned char vmods_mask0;
+ unsigned char vmods_mask1;
+ unsigned char vmods0;
+ unsigned char vmods1;
+} XkbRedirectKeyAction;
+
+#define XkbSARedirectVMods(a) ((((unsigned int)(a)->vmods1)<<8)|\
+ ((unsigned int)(a)->vmods0))
+#define XkbSARedirectSetVMods(a,m) (((a)->vmods_mask1=(((m)>>8)&0xff)),\
+ ((a)->vmods_mask0=((m)&0xff)))
+#define XkbSARedirectVModsMask(a) ((((unsigned int)(a)->vmods_mask1)<<8)|\
+ ((unsigned int)(a)->vmods_mask0))
+#define XkbSARedirectSetVModsMask(a,m) (((a)->vmods_mask1=(((m)>>8)&0xff)),\
+ ((a)->vmods_mask0=((m)&0xff)))
+
+typedef struct _XkbDeviceBtnAction {
+ unsigned char type;
+ unsigned char flags;
+ unsigned char count;
+ unsigned char button;
+ unsigned char device;
+} XkbDeviceBtnAction;
+
+typedef struct _XkbDeviceValuatorAction {
+ unsigned char type;
+ unsigned char device;
+ unsigned char v1_what;
+ unsigned char v1_ndx;
+ unsigned char v1_value;
+ unsigned char v2_what;
+ unsigned char v2_ndx;
+ unsigned char v2_value;
+} XkbDeviceValuatorAction;
+
+typedef union _XkbAction {
+ XkbAnyAction any;
+ XkbModAction mods;
+ XkbGroupAction group;
+ XkbISOAction iso;
+ XkbPtrAction ptr;
+ XkbPtrBtnAction btn;
+ XkbPtrDfltAction dflt;
+ XkbSwitchScreenAction screen;
+ XkbCtrlsAction ctrls;
+ XkbMessageAction msg;
+ XkbRedirectKeyAction redirect;
+ XkbDeviceBtnAction devbtn;
+ XkbDeviceValuatorAction devval;
+ unsigned char type;
+} XkbAction;
+
+typedef struct _XkbControls {
+ unsigned char mk_dflt_btn;
+ unsigned char num_groups;
+ unsigned char groups_wrap;
+ XkbModsRec internal;
+ XkbModsRec ignore_lock;
+ unsigned int enabled_ctrls;
+ unsigned short repeat_delay;
+ unsigned short repeat_interval;
+ unsigned short slow_keys_delay;
+ unsigned short debounce_delay;
+ unsigned short mk_delay;
+ unsigned short mk_interval;
+ unsigned short mk_time_to_max;
+ unsigned short mk_max_speed;
+ short mk_curve;
+ unsigned short ax_options;
+ unsigned short ax_timeout;
+ unsigned short axt_opts_mask;
+ unsigned short axt_opts_values;
+ unsigned int axt_ctrls_mask;
+ unsigned int axt_ctrls_values;
+ unsigned char per_key_repeat[XkbPerKeyBitArraySize];
+} XkbControlsRec, *XkbControlsPtr;
+
+#define XkbAX_AnyFeedback(c) ((c)->enabled_ctrls&XkbAccessXFeedbackMask)
+#define XkbAX_NeedOption(c,w) ((c)->ax_options&(w))
+#define XkbAX_NeedFeedback(c,w) (XkbAX_AnyFeedback(c)&&XkbAX_NeedOption(c,w))
+
+typedef struct _XkbServerMapRec {
+ unsigned short num_acts;
+ unsigned short size_acts;
+ XkbAction *acts;
+
+ XkbBehavior *behaviors;
+ unsigned short *key_acts;
+#if defined(__cplusplus) || defined(c_plusplus)
+ /* explicit is a C++ reserved word */
+ unsigned char *c_explicit;
+#else
+ unsigned char *explicit;
+#endif
+ unsigned char vmods[XkbNumVirtualMods];
+ unsigned short *vmodmap;
+} XkbServerMapRec, *XkbServerMapPtr;
+
+#define XkbSMKeyActionsPtr(m,k) (&(m)->acts[(m)->key_acts[k]])
+
+ /*
+ * Structures and access macros used primarily by clients
+ */
+
+typedef struct _XkbSymMapRec {
+ unsigned char kt_index[XkbNumKbdGroups];
+ unsigned char group_info;
+ unsigned char width;
+ unsigned short offset;
+} XkbSymMapRec, *XkbSymMapPtr;
+
+typedef struct _XkbClientMapRec {
+ unsigned char size_types;
+ unsigned char num_types;
+ XkbKeyTypePtr types;
+
+ unsigned short size_syms;
+ unsigned short num_syms;
+ KeySym *syms;
+ XkbSymMapPtr key_sym_map;
+
+ unsigned char *modmap;
+} XkbClientMapRec, *XkbClientMapPtr;
+
+#define XkbCMKeyGroupInfo(m,k) ((m)->key_sym_map[k].group_info)
+#define XkbCMKeyNumGroups(m,k) (XkbNumGroups((m)->key_sym_map[k].group_info))
+#define XkbCMKeyGroupWidth(m,k,g) (XkbCMKeyType(m,k,g)->num_levels)
+#define XkbCMKeyGroupsWidth(m,k) ((m)->key_sym_map[k].width)
+#define XkbCMKeyTypeIndex(m,k,g) ((m)->key_sym_map[k].kt_index[g&0x3])
+#define XkbCMKeyType(m,k,g) (&(m)->types[XkbCMKeyTypeIndex(m,k,g)])
+#define XkbCMKeyNumSyms(m,k) (XkbCMKeyGroupsWidth(m,k)*XkbCMKeyNumGroups(m,k))
+#define XkbCMKeySymsOffset(m,k) ((m)->key_sym_map[k].offset)
+#define XkbCMKeySymsPtr(m,k) (&(m)->syms[XkbCMKeySymsOffset(m,k)])
+
+ /*
+ * Compatibility structures and access macros
+ */
+
+typedef struct _XkbSymInterpretRec {
+ KeySym sym;
+ unsigned char flags;
+ unsigned char match;
+ unsigned char mods;
+ unsigned char virtual_mod;
+ XkbAnyAction act;
+} XkbSymInterpretRec,*XkbSymInterpretPtr;
+
+typedef struct _XkbCompatMapRec {
+ XkbSymInterpretPtr sym_interpret;
+ XkbModsRec groups[XkbNumKbdGroups];
+ unsigned short num_si;
+ unsigned short size_si;
+} XkbCompatMapRec, *XkbCompatMapPtr;
+
+typedef struct _XkbIndicatorMapRec {
+ unsigned char flags;
+ unsigned char which_groups;
+ unsigned char groups;
+ unsigned char which_mods;
+ XkbModsRec mods;
+ unsigned int ctrls;
+} XkbIndicatorMapRec, *XkbIndicatorMapPtr;
+
+#define XkbIM_IsAuto(i) ((((i)->flags&XkbIM_NoAutomatic)==0)&&\
+ (((i)->which_groups&&(i)->groups)||\
+ ((i)->which_mods&&(i)->mods.mask)||\
+ ((i)->ctrls)))
+#define XkbIM_InUse(i) (((i)->flags)||((i)->which_groups)||\
+ ((i)->which_mods)||((i)->ctrls))
+
+
+typedef struct _XkbIndicatorRec {
+ unsigned long phys_indicators;
+ XkbIndicatorMapRec maps[XkbNumIndicators];
+} XkbIndicatorRec,*XkbIndicatorPtr;
+
+typedef struct _XkbKeyNameRec {
+ char name[XkbKeyNameLength];
+} XkbKeyNameRec,*XkbKeyNamePtr;
+
+typedef struct _XkbKeyAliasRec {
+ char real[XkbKeyNameLength];
+ char alias[XkbKeyNameLength];
+} XkbKeyAliasRec,*XkbKeyAliasPtr;
+
+ /*
+ * Names for everything
+ */
+typedef struct _XkbNamesRec {
+ Atom keycodes;
+ Atom geometry;
+ Atom symbols;
+ Atom types;
+ Atom compat;
+ Atom vmods[XkbNumVirtualMods];
+ Atom indicators[XkbNumIndicators];
+ Atom groups[XkbNumKbdGroups];
+ XkbKeyNamePtr keys;
+ XkbKeyAliasPtr key_aliases;
+ Atom *radio_groups;
+ Atom phys_symbols;
+
+ unsigned char num_keys;
+ unsigned char num_key_aliases;
+ unsigned short num_rg;
+} XkbNamesRec,*XkbNamesPtr;
+
+typedef struct _XkbGeometry *XkbGeometryPtr;
+ /*
+ * Tie it all together into one big keyboard description
+ */
+typedef struct _XkbDesc {
+ struct _XDisplay * dpy;
+ unsigned short flags;
+ unsigned short device_spec;
+ KeyCode min_key_code;
+ KeyCode max_key_code;
+
+ XkbControlsPtr ctrls;
+ XkbServerMapPtr server;
+ XkbClientMapPtr map;
+ XkbIndicatorPtr indicators;
+ XkbNamesPtr names;
+ XkbCompatMapPtr compat;
+ XkbGeometryPtr geom;
+} XkbDescRec, *XkbDescPtr;
+#define XkbKeyKeyTypeIndex(d,k,g) (XkbCMKeyTypeIndex((d)->map,k,g))
+#define XkbKeyKeyType(d,k,g) (XkbCMKeyType((d)->map,k,g))
+#define XkbKeyGroupWidth(d,k,g) (XkbCMKeyGroupWidth((d)->map,k,g))
+#define XkbKeyGroupsWidth(d,k) (XkbCMKeyGroupsWidth((d)->map,k))
+#define XkbKeyGroupInfo(d,k) (XkbCMKeyGroupInfo((d)->map,(k)))
+#define XkbKeyNumGroups(d,k) (XkbCMKeyNumGroups((d)->map,(k)))
+#define XkbKeyNumSyms(d,k) (XkbCMKeyNumSyms((d)->map,(k)))
+#define XkbKeySymsPtr(d,k) (XkbCMKeySymsPtr((d)->map,(k)))
+#define XkbKeySym(d,k,n) (XkbKeySymsPtr(d,k)[n])
+#define XkbKeySymEntry(d,k,sl,g) \
+ (XkbKeySym(d,k,((XkbKeyGroupsWidth(d,k)*(g))+(sl))))
+#define XkbKeyAction(d,k,n) \
+ (XkbKeyHasActions(d,k)?&XkbKeyActionsPtr(d,k)[n]:NULL)
+#define XkbKeyActionEntry(d,k,sl,g) \
+ (XkbKeyHasActions(d,k)?\
+ XkbKeyAction(d,k,((XkbKeyGroupsWidth(d,k)*(g))+(sl))):NULL)
+
+#define XkbKeyHasActions(d,k) ((d)->server->key_acts[k]!=0)
+#define XkbKeyNumActions(d,k) (XkbKeyHasActions(d,k)?XkbKeyNumSyms(d,k):1)
+#define XkbKeyActionsPtr(d,k) (XkbSMKeyActionsPtr((d)->server,k))
+#define XkbKeycodeInRange(d,k) (((k)>=(d)->min_key_code)&&\
+ ((k)<=(d)->max_key_code))
+#define XkbNumKeys(d) ((d)->max_key_code-(d)->min_key_code+1)
+
+
+ /*
+ * The following structures can be used to track changes
+ * to a keyboard device
+ */
+typedef struct _XkbMapChanges {
+ unsigned short changed;
+ KeyCode min_key_code;
+ KeyCode max_key_code;
+ unsigned char first_type;
+ unsigned char num_types;
+ KeyCode first_key_sym;
+ unsigned char num_key_syms;
+ KeyCode first_key_act;
+ unsigned char num_key_acts;
+ KeyCode first_key_behavior;
+ unsigned char num_key_behaviors;
+ KeyCode first_key_explicit;
+ unsigned char num_key_explicit;
+ KeyCode first_modmap_key;
+ unsigned char num_modmap_keys;
+ KeyCode first_vmodmap_key;
+ unsigned char num_vmodmap_keys;
+ unsigned char pad;
+ unsigned short vmods;
+} XkbMapChangesRec,*XkbMapChangesPtr;
+
+typedef struct _XkbControlsChanges {
+ unsigned int changed_ctrls;
+ unsigned int enabled_ctrls_changes;
+ Bool num_groups_changed;
+} XkbControlsChangesRec,*XkbControlsChangesPtr;
+
+typedef struct _XkbIndicatorChanges {
+ unsigned int state_changes;
+ unsigned int map_changes;
+} XkbIndicatorChangesRec,*XkbIndicatorChangesPtr;
+
+typedef struct _XkbNameChanges {
+ unsigned int changed;
+ unsigned char first_type;
+ unsigned char num_types;
+ unsigned char first_lvl;
+ unsigned char num_lvls;
+ unsigned char num_aliases;
+ unsigned char num_rg;
+ unsigned char first_key;
+ unsigned char num_keys;
+ unsigned short changed_vmods;
+ unsigned long changed_indicators;
+ unsigned char changed_groups;
+} XkbNameChangesRec,*XkbNameChangesPtr;
+
+typedef struct _XkbCompatChanges {
+ unsigned char changed_groups;
+ unsigned short first_si;
+ unsigned short num_si;
+} XkbCompatChangesRec,*XkbCompatChangesPtr;
+
+typedef struct _XkbChanges {
+ unsigned short device_spec;
+ unsigned short state_changes;
+ XkbMapChangesRec map;
+ XkbControlsChangesRec ctrls;
+ XkbIndicatorChangesRec indicators;
+ XkbNameChangesRec names;
+ XkbCompatChangesRec compat;
+} XkbChangesRec, *XkbChangesPtr;
+
+ /*
+ * These data structures are used to construct a keymap from
+ * a set of components or to list components in the server
+ * database.
+ */
+typedef struct _XkbComponentNames {
+ char * keymap;
+ char * keycodes;
+ char * types;
+ char * compat;
+ char * symbols;
+ char * geometry;
+} XkbComponentNamesRec, *XkbComponentNamesPtr;
+
+typedef struct _XkbComponentName {
+ unsigned short flags;
+ char * name;
+} XkbComponentNameRec,*XkbComponentNamePtr;
+
+typedef struct _XkbComponentList {
+ int num_keymaps;
+ int num_keycodes;
+ int num_types;
+ int num_compat;
+ int num_symbols;
+ int num_geometry;
+ XkbComponentNamePtr keymaps;
+ XkbComponentNamePtr keycodes;
+ XkbComponentNamePtr types;
+ XkbComponentNamePtr compat;
+ XkbComponentNamePtr symbols;
+ XkbComponentNamePtr geometry;
+} XkbComponentListRec, *XkbComponentListPtr;
+
+ /*
+ * The following data structures describe and track changes to a
+ * non-keyboard extension device
+ */
+typedef struct _XkbDeviceLedInfo {
+ unsigned short led_class;
+ unsigned short led_id;
+ unsigned int phys_indicators;
+ unsigned int maps_present;
+ unsigned int names_present;
+ unsigned int state;
+ Atom names[XkbNumIndicators];
+ XkbIndicatorMapRec maps[XkbNumIndicators];
+} XkbDeviceLedInfoRec,*XkbDeviceLedInfoPtr;
+
+typedef struct _XkbDeviceInfo {
+ char * name;
+ Atom type;
+ unsigned short device_spec;
+ Bool has_own_state;
+ unsigned short supported;
+ unsigned short unsupported;
+
+ unsigned short num_btns;
+ XkbAction * btn_acts;
+
+ unsigned short sz_leds;
+ unsigned short num_leds;
+ unsigned short dflt_kbd_fb;
+ unsigned short dflt_led_fb;
+ XkbDeviceLedInfoPtr leds;
+} XkbDeviceInfoRec,*XkbDeviceInfoPtr;
+
+#define XkbXI_DevHasBtnActs(d) (((d)->num_btns>0)&&((d)->btn_acts!=NULL))
+#define XkbXI_LegalDevBtn(d,b) (XkbXI_DevHasBtnActs(d)&&((b)<(d)->num_btns))
+#define XkbXI_DevHasLeds(d) (((d)->num_leds>0)&&((d)->leds!=NULL))
+
+typedef struct _XkbDeviceLedChanges {
+ unsigned short led_class;
+ unsigned short led_id;
+ unsigned int defined; /* names or maps changed */
+ struct _XkbDeviceLedChanges *next;
+} XkbDeviceLedChangesRec,*XkbDeviceLedChangesPtr;
+
+typedef struct _XkbDeviceChanges {
+ unsigned int changed;
+ unsigned short first_btn;
+ unsigned short num_btns;
+ XkbDeviceLedChangesRec leds;
+} XkbDeviceChangesRec,*XkbDeviceChangesPtr;
+
+#endif /* _XKBSTR_H_ */
diff --git a/sysroot/usr/include/X11/extensions/XLbx.h b/sysroot/usr/include/X11/extensions/XLbx.h
new file mode 100644
index 0000000..01d44f0
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/XLbx.h
@@ -0,0 +1,155 @@
+/* $Xorg: XLbx.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */
+/*
+ * Copyright 1992 Network Computing Devices
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of NCD. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. NCD. makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * NCD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NCD.
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+/* $XFree86: xc/include/extensions/XLbx.h,v 1.3 2002/10/16 01:59:55 dawes Exp $ */
+
+#ifndef _XLBX_H_
+#define _XLBX_H_
+
+#include <X11/Xfuncproto.h>
+
+/*
+ * NOTE: any changes or additions to the opcodes needs to be reflected
+ * in the lbxCacheable array in Xserver/lbx/lbxmain.c
+ */
+
+#define X_LbxQueryVersion 0
+#define X_LbxStartProxy 1
+#define X_LbxStopProxy 2
+#define X_LbxSwitch 3
+#define X_LbxNewClient 4
+#define X_LbxCloseClient 5
+#define X_LbxModifySequence 6
+#define X_LbxAllowMotion 7
+#define X_LbxIncrementPixel 8
+#define X_LbxDelta 9
+#define X_LbxGetModifierMapping 10
+#define X_LbxInvalidateTag 12
+#define X_LbxPolyPoint 13
+#define X_LbxPolyLine 14
+#define X_LbxPolySegment 15
+#define X_LbxPolyRectangle 16
+#define X_LbxPolyArc 17
+#define X_LbxFillPoly 18
+#define X_LbxPolyFillRectangle 19
+#define X_LbxPolyFillArc 20
+#define X_LbxGetKeyboardMapping 21
+#define X_LbxQueryFont 22
+#define X_LbxChangeProperty 23
+#define X_LbxGetProperty 24
+#define X_LbxTagData 25
+
+#define X_LbxCopyArea 26
+#define X_LbxCopyPlane 27
+#define X_LbxPolyText8 28
+#define X_LbxPolyText16 29
+#define X_LbxImageText8 30
+#define X_LbxImageText16 31
+
+#define X_LbxQueryExtension 32
+#define X_LbxPutImage 33
+#define X_LbxGetImage 34
+
+#define X_LbxBeginLargeRequest 35
+#define X_LbxLargeRequestData 36
+#define X_LbxEndLargeRequest 37
+
+#define X_LbxInternAtoms 38
+#define X_LbxGetWinAttrAndGeom 39
+
+#define X_LbxGrabCmap 40
+#define X_LbxReleaseCmap 41
+#define X_LbxAllocColor 42
+
+#define X_LbxSync 43
+
+#define LbxNumberReqs 44
+
+
+#define LbxEvent 0
+#define LbxQuickMotionDeltaEvent 1
+#define LbxNumberEvents 2
+
+/* This is always the master client */
+#define LbxMasterClientIndex 0
+
+/* LbxEvent lbxType sub-fields */
+#define LbxSwitchEvent 0
+#define LbxCloseEvent 1
+#define LbxDeltaEvent 2
+#define LbxInvalidateTagEvent 3
+#define LbxSendTagDataEvent 4
+#define LbxListenToOne 5
+#define LbxListenToAll 6
+#define LbxMotionDeltaEvent 7
+#define LbxReleaseCmapEvent 8
+#define LbxFreeCellsEvent 9
+
+/*
+ * Lbx image compression methods
+ *
+ * No compression is always assigned the value of 0.
+ *
+ * The rest of the compression method opcodes are assigned dynamically
+ * at option negotiation time.
+ */
+
+#define LbxImageCompressNone 0
+
+
+#define BadLbxClient 0
+#define LbxNumberErrors (BadLbxClient + 1)
+
+/* tagged data types */
+#define LbxTagTypeModmap 1
+#define LbxTagTypeKeymap 2
+#define LbxTagTypeProperty 3
+#define LbxTagTypeFont 4
+#define LbxTagTypeConnInfo 5
+
+#ifndef _XLBX_SERVER_
+
+#include <X11/Xdefs.h>
+#include <X11/Xlib.h>
+
+_XFUNCPROTOBEGIN
+
+Bool XLbxQueryExtension(
+ Display* /* dpy */,
+ int* /* requestp */,
+ int* /* event_basep */,
+ int* /* error_basep */
+);
+
+Bool XLbxQueryVersion(
+ Display* /* dpy */,
+ int* /* majorVersion */,
+ int* /* minorVersion */
+);
+
+int XLbxGetEventBase(Display *dpy);
+
+_XFUNCPROTOEND
+
+#endif
+
+#endif
diff --git a/sysroot/usr/include/X11/extensions/XShm.h b/sysroot/usr/include/X11/extensions/XShm.h
new file mode 100644
index 0000000..4ae14ca
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/XShm.h
@@ -0,0 +1,161 @@
+/* $XFree86: xc/include/extensions/XShm.h,v 1.11 2003/04/03 15:11:07 dawes Exp $ */
+/************************************************************
+
+Copyright 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+********************************************************/
+
+/* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */
+
+/* $Xorg: XShm.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ */
+
+#ifndef _XSHM_H_
+#define _XSHM_H_
+
+#include <X11/Xfuncproto.h>
+
+#define X_ShmQueryVersion 0
+#define X_ShmAttach 1
+#define X_ShmDetach 2
+#define X_ShmPutImage 3
+#define X_ShmGetImage 4
+#define X_ShmCreatePixmap 5
+
+#define ShmCompletion 0
+#define ShmNumberEvents (ShmCompletion + 1)
+
+#define BadShmSeg 0
+#define ShmNumberErrors (BadShmSeg + 1)
+
+typedef unsigned long ShmSeg;
+
+#ifndef _XSHM_SERVER_
+typedef struct {
+ int type; /* of event */
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came frome a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Drawable drawable; /* drawable of request */
+ int major_code; /* ShmReqCode */
+ int minor_code; /* X_ShmPutImage */
+ ShmSeg shmseg; /* the ShmSeg used in the request */
+ unsigned long offset; /* the offset into ShmSeg used in the request */
+} XShmCompletionEvent;
+
+typedef struct {
+ ShmSeg shmseg; /* resource id */
+ int shmid; /* kernel id */
+ char *shmaddr; /* address in client */
+ Bool readOnly; /* how the server should attach it */
+} XShmSegmentInfo;
+
+_XFUNCPROTOBEGIN
+
+Bool XShmQueryExtension(
+ Display* /* dpy */
+);
+
+int XShmGetEventBase(
+ Display* /* dpy */
+);
+
+Bool XShmQueryVersion(
+ Display* /* dpy */,
+ int* /* majorVersion */,
+ int* /* minorVersion */,
+ Bool* /* sharedPixmaps */
+);
+
+int XShmPixmapFormat(
+ Display* /* dpy */
+);
+
+Status XShmAttach(
+ Display* /* dpy */,
+ XShmSegmentInfo* /* shminfo */
+);
+
+Status XShmDetach(
+ Display* /* dpy */,
+ XShmSegmentInfo* /* shminfo */
+);
+
+Status XShmPutImage(
+ Display* /* dpy */,
+ Drawable /* d */,
+ GC /* gc */,
+ XImage* /* image */,
+ int /* src_x */,
+ int /* src_y */,
+ int /* dst_x */,
+ int /* dst_y */,
+ unsigned int /* src_width */,
+ unsigned int /* src_height */,
+ Bool /* send_event */
+);
+
+Status XShmGetImage(
+ Display* /* dpy */,
+ Drawable /* d */,
+ XImage* /* image */,
+ int /* x */,
+ int /* y */,
+ unsigned long /* plane_mask */
+);
+
+XImage *XShmCreateImage(
+ Display* /* dpy */,
+ Visual* /* visual */,
+ unsigned int /* depth */,
+ int /* format */,
+ char* /* data */,
+ XShmSegmentInfo* /* shminfo */,
+ unsigned int /* width */,
+ unsigned int /* height */
+);
+
+Pixmap XShmCreatePixmap(
+ Display* /* dpy */,
+ Drawable /* d */,
+ char* /* data */,
+ XShmSegmentInfo* /* shminfo */,
+ unsigned int /* width */,
+ unsigned int /* height */,
+ unsigned int /* depth */
+);
+
+_XFUNCPROTOEND
+
+#else /* _XSHM_SERVER_ */
+
+#include "screenint.h"
+#include "pixmap.h"
+#include "gc.h"
+
+extern void ShmRegisterFbFuncs(
+ ScreenPtr /* pScreen */
+);
+
+#endif
+
+#endif
diff --git a/sysroot/usr/include/X11/extensions/XTest.h b/sysroot/usr/include/X11/extensions/XTest.h
new file mode 100644
index 0000000..afb1849
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/XTest.h
@@ -0,0 +1,164 @@
+/* $Xorg: XTest.h,v 1.5 2001/02/09 02:03:24 xorgcvs Exp $ */
+/*
+
+Copyright 1992, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+*/
+/* $XFree86: xc/include/extensions/XTest.h,v 3.3 2001/12/14 19:53:28 dawes Exp $ */
+
+#ifndef _XTEST_H_
+#define _XTEST_H_
+
+#include <X11/Xfuncproto.h>
+
+#define X_XTestGetVersion 0
+#define X_XTestCompareCursor 1
+#define X_XTestFakeInput 2
+#define X_XTestGrabControl 3
+
+#define XTestNumberEvents 0
+
+#define XTestNumberErrors 0
+
+#define XTestMajorVersion 2
+#define XTestMinorVersion 2
+
+#define XTestExtensionName "XTEST"
+
+#ifndef _XTEST_SERVER_
+
+#include <X11/extensions/XInput.h>
+
+_XFUNCPROTOBEGIN
+
+Bool XTestQueryExtension(
+ Display* /* dpy */,
+ int* /* event_basep */,
+ int* /* error_basep */,
+ int* /* majorp */,
+ int* /* minorp */
+);
+
+Bool XTestCompareCursorWithWindow(
+ Display* /* dpy */,
+ Window /* window */,
+ Cursor /* cursor */
+);
+
+Bool XTestCompareCurrentCursorWithWindow(
+ Display* /* dpy */,
+ Window /* window */
+);
+
+extern int XTestFakeKeyEvent(
+ Display* /* dpy */,
+ unsigned int /* keycode */,
+ Bool /* is_press */,
+ unsigned long /* delay */
+);
+
+extern int XTestFakeButtonEvent(
+ Display* /* dpy */,
+ unsigned int /* button */,
+ Bool /* is_press */,
+ unsigned long /* delay */
+);
+
+extern int XTestFakeMotionEvent(
+ Display* /* dpy */,
+ int /* screen */,
+ int /* x */,
+ int /* y */,
+ unsigned long /* delay */
+);
+
+extern int XTestFakeRelativeMotionEvent(
+ Display* /* dpy */,
+ int /* x */,
+ int /* y */,
+ unsigned long /* delay */
+);
+
+extern int XTestFakeDeviceKeyEvent(
+ Display* /* dpy */,
+ XDevice* /* dev */,
+ unsigned int /* keycode */,
+ Bool /* is_press */,
+ int* /* axes */,
+ int /* n_axes */,
+ unsigned long /* delay */
+);
+
+extern int XTestFakeDeviceButtonEvent(
+ Display* /* dpy */,
+ XDevice* /* dev */,
+ unsigned int /* button */,
+ Bool /* is_press */,
+ int* /* axes */,
+ int /* n_axes */,
+ unsigned long /* delay */
+);
+
+extern int XTestFakeProximityEvent(
+ Display* /* dpy */,
+ XDevice* /* dev */,
+ Bool /* in_prox */,
+ int* /* axes */,
+ int /* n_axes */,
+ unsigned long /* delay */
+);
+
+extern int XTestFakeDeviceMotionEvent(
+ Display* /* dpy */,
+ XDevice* /* dev */,
+ Bool /* is_relative */,
+ int /* first_axis */,
+ int* /* axes */,
+ int /* n_axes */,
+ unsigned long /* delay */
+);
+
+extern int XTestGrabControl(
+ Display* /* dpy */,
+ Bool /* impervious */
+);
+
+void XTestSetGContextOfGC(
+ GC /* gc */,
+ GContext /* gid */
+);
+
+void XTestSetVisualIDOfVisual(
+ Visual* /* visual */,
+ VisualID /* visualid */
+);
+
+Status XTestDiscard(
+ Display* /* dpy */
+);
+
+_XFUNCPROTOEND
+
+#endif /* _XTEST_SERVER_ */
+
+#endif
diff --git a/sysroot/usr/include/X11/extensions/Xag.h b/sysroot/usr/include/X11/extensions/Xag.h
new file mode 100644
index 0000000..815f2b9
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/Xag.h
@@ -0,0 +1,114 @@
+/* $XFree86: xc/include/extensions/Xag.h,v 1.5 2001/12/17 20:52:24 dawes Exp $ */
+/*
+Copyright 1996, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from The Open Group.
+*/
+/* $Xorg: Xag.h,v 1.5 2001/02/09 02:03:24 xorgcvs Exp $ */
+
+#ifndef _XAG_H_
+#define _XAG_H_
+
+#include <X11/Xfuncproto.h>
+
+#define X_XagQueryVersion 0
+#define X_XagCreate 1
+#define X_XagDestroy 2
+#define X_XagGetAttr 3
+#define X_XagQuery 4
+#define X_XagCreateAssoc 5
+#define X_XagDestroyAssoc 6
+
+#define XagBadAppGroup 0
+#define XagNumberErrors (XagBadAppGroup + 1)
+
+#define XagNsingleScreen 7
+#define XagNdefaultRoot 1
+#define XagNrootVisual 2
+#define XagNdefaultColormap 3
+#define XagNblackPixel 4
+#define XagNwhitePixel 5
+#define XagNappGroupLeader 6
+
+#ifndef _XAG_SERVER_
+
+#include <stdarg.h>
+
+_XFUNCPROTOBEGIN
+
+typedef XID XAppGroup;
+
+Bool XagQueryVersion(
+ Display* /* dpy */,
+ int* /* major_version */,
+ int* /* minor_version */
+);
+
+Status XagCreateEmbeddedApplicationGroup(
+ Display* /* dpy */,
+ VisualID /* root_visual */,
+ Colormap /* default_colormap */,
+ unsigned long /* black_pixel */,
+ unsigned long /* white_pixel */,
+ XAppGroup* /* app_group_return */
+);
+
+Status XagCreateNonembeddedApplicationGroup(
+ Display* /* dpy */,
+ XAppGroup* /* app_group_return */
+);
+
+Status XagDestroyApplicationGroup(
+ Display* /* dpy */,
+ XAppGroup /* app_group */
+);
+
+Status XagGetApplicationGroupAttributes(
+ Display* /* dpy */,
+ XAppGroup /* app_group */,
+ ...
+);
+
+Status XagQueryApplicationGroup(
+ Display* /* dpy */,
+ XID /* resource_base */,
+ XAppGroup* /* app_group_ret */
+);
+
+Status XagCreateAssociation(
+ Display* /* dpy */,
+ Window* /* window_ret */,
+ void* /* system_window */
+);
+
+Status XagDestroyAssociation(
+ Display* /* dpy */,
+ Window /* window */
+);
+
+_XFUNCPROTOEND
+
+#endif /* _XAG_SERVER_ */
+
+#endif /* _XAG_H_ */
+
diff --git a/sysroot/usr/include/X11/extensions/Xagsrv.h b/sysroot/usr/include/X11/extensions/Xagsrv.h
new file mode 100644
index 0000000..b9c50aa
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/Xagsrv.h
@@ -0,0 +1,76 @@
+/* $XFree86: xc/include/extensions/Xagsrv.h,v 1.5 2003/07/16 01:38:24 dawes Exp $ */
+/*
+Copyright 1996, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from The Open Group.
+*/
+/* $Xorg: Xagsrv.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ */
+
+#ifndef _XAGSRV_H_
+#define _XAGSRV_H_
+
+#include <X11/Xfuncproto.h>
+
+_XFUNCPROTOBEGIN
+
+extern void XagConnectionInfo(
+ ClientPtr /* client */,
+ xConnSetupPrefix** /* conn_prefix */,
+ char** /* conn_info */,
+ int* /* num_screens */
+);
+
+extern VisualID XagRootVisual(
+ ClientPtr /* client */
+);
+
+extern Colormap XagDefaultColormap(
+ ClientPtr /* client */
+);
+
+extern ClientPtr XagLeader(
+ ClientPtr /* client */
+);
+
+extern void XagCallClientStateChange(
+ ClientPtr /* client */
+);
+
+extern Bool XagIsControlledRoot (
+ ClientPtr /* client */,
+ WindowPtr /* pParent */
+);
+
+extern XID XagId (
+ ClientPtr /* client */
+);
+
+extern void XagGetDeltaInfo (
+ ClientPtr /* client */,
+ CARD32* /* buf */
+);
+
+_XFUNCPROTOEND
+
+#endif /* _XAGSRV_H_ */
+
diff --git a/sysroot/usr/include/X11/extensions/Xagstr.h b/sysroot/usr/include/X11/extensions/Xagstr.h
new file mode 100644
index 0000000..ffb5527
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/Xagstr.h
@@ -0,0 +1,182 @@
+/* $XFree86: xc/include/extensions/Xagstr.h,v 1.4 2001/12/14 19:53:28 dawes Exp $ */
+/*
+Copyright 1996, 1998, 2001 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from The Open Group.
+*/
+/* $Xorg: Xagstr.h,v 1.6 2001/02/09 02:03:24 xorgcvs Exp $ */
+
+#ifndef _XAGSTR_H_ /* { */
+#define _XAGSTR_H_
+
+#include <X11/extensions/Xag.h>
+
+#define XAppGroup CARD32
+
+#define XAGNAME "XC-APPGROUP"
+
+#define XAG_MAJOR_VERSION 1 /* current version numbers */
+#define XAG_MINOR_VERSION 0
+
+#define XagWindowTypeX11 0
+#define XagWindowTypeMacintosh 1
+#define XagWindowTypeWin32 2
+#define XagWindowTypeWin16 3
+
+/*
+* Redefine some basic types used by structures defined herein. This allows
+* both the library and server to view communicated data as 32-bit entities,
+* thus preventing problems on 64-bit architectures where libXext sees this
+* data as 64 bits and the server sees it as 32 bits.
+*/
+
+#define Colormap CARD32
+#define VisualID CARD32
+#define Window CARD32
+
+typedef struct _XagQueryVersion {
+ CARD8 reqType; /* always XagReqCode */
+ CARD8 xagReqType; /* always X_XagQueryVersion */
+ CARD16 length B16;
+ CARD16 client_major_version B16;
+ CARD16 client_minor_version B16;
+} xXagQueryVersionReq;
+#define sz_xXagQueryVersionReq 8
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BOOL pad1;
+ CARD16 sequence_number B16;
+ CARD32 length B32;
+ CARD16 server_major_version B16;
+ CARD16 server_minor_version B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xXagQueryVersionReply;
+#define sz_xXagQueryVersionReply 32
+
+/* Set AppGroup Attributes masks */
+#define XagSingleScreenMask 1 << 0
+#define XagDefaultRootMask 1 << XagNdefaultRoot
+#define XagRootVisualMask 1 << XagNrootVisual
+#define XagDefaultColormapMask 1 << XagNdefaultColormap
+#define XagBlackPixelMask 1 << XagNblackPixel
+#define XagWhitePixelMask 1 << XagNwhitePixel
+#define XagAppGroupLeaderMask 1 << XagNappGroupLeader
+
+typedef struct _XagCreate {
+ CARD8 reqType; /* always XagReqCode */
+ CARD8 xagReqType; /* always X_XagCreate */
+ CARD16 length B16;
+ XAppGroup app_group B32;
+ CARD32 attrib_mask B32; /* LISTofVALUE follows */
+} xXagCreateReq;
+#define sz_xXagCreateReq 12
+
+typedef struct _XagDestroy {
+ CARD8 reqType; /* always XagReqCode */
+ CARD8 xagReqType; /* always X_XagDestroy */
+ CARD16 length B16;
+ XAppGroup app_group B32;
+} xXagDestroyReq;
+#define sz_xXagDestroyReq 8
+
+typedef struct _XagGetAttr {
+ CARD8 reqType; /* always XagReqCode */
+ CARD8 xagReqType; /* always X_XagGetAttr */
+ CARD16 length B16;
+ XAppGroup app_group B32;
+} xXagGetAttrReq;
+#define sz_xXagGetAttrReq 8
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BOOL pad1;
+ CARD16 sequence_number B16;
+ CARD32 length B32;
+ Window default_root B32;
+ VisualID root_visual B32;
+ Colormap default_colormap B32;
+ CARD32 black_pixel B32;
+ CARD32 white_pixel B32;
+ BOOL single_screen;
+ BOOL app_group_leader;
+ CARD16 pad2 B16;
+} xXagGetAttrReply;
+#define sz_xXagGetAttrReply 32
+
+typedef struct _XagQuery {
+ CARD8 reqType; /* always XagReqCode */
+ CARD8 xagReqType; /* always X_XagQuery */
+ CARD16 length B16;
+ CARD32 resource B32;
+} xXagQueryReq;
+#define sz_xXagQueryReq 8
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BOOL pad1;
+ CARD16 sequence_number B16;
+ CARD32 length B32;
+ XAppGroup app_group B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xXagQueryReply;
+#define sz_xXagQueryReply 32
+
+typedef struct _XagCreateAssoc {
+ CARD8 reqType; /* always XagReqCode */
+ CARD8 xagReqType; /* always X_XagCreateAssoc */
+ CARD16 length B16;
+ Window window B32;
+ CARD16 window_type B16;
+ CARD16 system_window_len B16; /* LISTofCARD8 follows */
+} xXagCreateAssocReq;
+#define sz_xXagCreateAssocReq 12
+
+typedef struct _XagDestroyAssoc {
+ CARD8 reqType; /* always XagReqCode */
+ CARD8 xagReqType; /* always X_XagDestroyAssoc */
+ CARD16 length B16;
+ Window window B32;
+} xXagDestroyAssocReq;
+#define sz_xXagDestroyAssocReq 8
+
+#undef XAppGroup
+/*
+ * Cancel the previous redefinition of the basic types, thus restoring their
+ * X.h definitions.
+ */
+
+#undef Window
+#undef Colormap
+#undef VisualID
+
+#endif /* } _XAGSTR_H_ */
+
diff --git a/sysroot/usr/include/X11/extensions/Xcup.h b/sysroot/usr/include/X11/extensions/Xcup.h
new file mode 100644
index 0000000..b1df039
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/Xcup.h
@@ -0,0 +1,69 @@
+/* $Xorg: Xcup.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ */
+/*
+
+Copyright 1987, 1988, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+*/
+/* $XFree86$ */
+
+#ifndef _XCUP_H_
+#define _XCUP_H_
+
+#include <X11/Xfuncproto.h>
+
+#define X_XcupQueryVersion 0
+#define X_XcupGetReservedColormapEntries 1
+#define X_XcupStoreColors 2
+
+#define XcupNumberErrors 0
+
+#ifndef _XCUP_SERVER_
+
+_XFUNCPROTOBEGIN
+
+Bool XcupQueryVersion(
+ Display* /* dpy */,
+ int* /* major_version */,
+ int* /* minor_version */
+);
+
+Status XcupGetReservedColormapEntries(
+ Display* /* dpy */,
+ int /* screen */,
+ XColor** /* colors_out */,
+ int* /* ncolors */
+);
+
+Status XcupStoreColors(
+ Display* /* dpy */,
+ Colormap /* colormap */,
+ XColor* /* colors */,
+ int /* ncolors */
+);
+
+_XFUNCPROTOEND
+
+#endif /* _XCUP_SERVER_ */
+
+#endif /* _XCUP_H_ */
+
diff --git a/sysroot/usr/include/X11/extensions/Xcupstr.h b/sysroot/usr/include/X11/extensions/Xcupstr.h
new file mode 100644
index 0000000..f521c33
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/Xcupstr.h
@@ -0,0 +1,109 @@
+/* $Xorg: Xcupstr.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ */
+
+/*
+
+Copyright 1987, 1988, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+*/
+/* $XFree86: xc/include/extensions/Xcupstr.h,v 3.5 2001/08/01 00:44:35 tsi Exp $ */
+
+#ifndef _XCUPSTR_H_ /* { */
+#define _XCUPSTR_H_
+
+#include <X11/extensions/Xcup.h>
+
+#define XCUPNAME "TOG-CUP"
+
+#define XCUP_MAJOR_VERSION 1 /* current version numbers */
+#define XCUP_MINOR_VERSION 0
+
+typedef struct _XcupQueryVersion {
+ CARD8 reqType; /* always XcupReqCode */
+ CARD8 xcupReqType; /* always X_XcupQueryVersion */
+ CARD16 length B16;
+ CARD16 client_major_version B16;
+ CARD16 client_minor_version B16;
+} xXcupQueryVersionReq;
+#define sz_xXcupQueryVersionReq 8
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BOOL pad1;
+ CARD16 sequence_number B16;
+ CARD32 length B32;
+ CARD16 server_major_version B16;
+ CARD16 server_minor_version B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xXcupQueryVersionReply;
+#define sz_xXcupQueryVersionReply 32
+
+typedef struct _XcupGetReservedColormapEntries {
+ CARD8 reqType; /* always XcupReqCode */
+ CARD8 xcupReqType; /* always X_XcupGetReservedColormapEntries */
+ CARD16 length B16;
+ CARD32 screen B32;
+} xXcupGetReservedColormapEntriesReq;
+#define sz_xXcupGetReservedColormapEntriesReq 8
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BOOL pad1;
+ CARD16 sequence_number B16;
+ CARD32 length B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+} xXcupGetReservedColormapEntriesReply;
+#define sz_xXcupGetReservedColormapEntriesReply 32
+
+typedef struct _XcupStoreColors {
+ CARD8 reqType; /* always XcupReqCode */
+ CARD8 xcupReqType; /* always X_XcupStoreColors */
+ CARD16 length B16;
+ CARD32 cmap B32;
+} xXcupStoreColorsReq;
+#define sz_xXcupStoreColorsReq 8
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BOOL pad1;
+ CARD16 sequence_number B16;
+ CARD32 length B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+} xXcupStoreColorsReply;
+#define sz_xXcupStoreColorsReply 32
+
+#endif /* } _XCUPSTR_H_ */
+
diff --git a/sysroot/usr/include/X11/extensions/Xdbe.h b/sysroot/usr/include/X11/extensions/Xdbe.h
new file mode 100644
index 0000000..f9205a2
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/Xdbe.h
@@ -0,0 +1,136 @@
+/* $Xorg: Xdbe.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */
+/******************************************************************************
+ *
+ * Copyright (c) 1994, 1995 Hewlett-Packard Company
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL HEWLETT-PACKARD COMPANY BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name of the Hewlett-Packard
+ * Company shall not be used in advertising or otherwise to promote the
+ * sale, use or other dealings in this Software without prior written
+ * authorization from the Hewlett-Packard Company.
+ *
+ * Header file for Xlib-related DBE
+ *
+ *****************************************************************************/
+/* $XFree86: xc/include/extensions/Xdbe.h,v 3.2 2001/08/01 00:44:35 tsi Exp $ */
+
+#ifndef XDBE_H
+#define XDBE_H
+
+
+/* INCLUDES */
+
+#include <X11/Xfuncproto.h>
+#include <X11/extensions/Xdbeproto.h>
+
+
+/* DEFINES */
+
+/* Errors */
+#define XdbeBadBuffer 0
+
+
+/* TYPEDEFS */
+
+typedef Drawable XdbeBackBuffer;
+
+typedef unsigned char XdbeSwapAction;
+
+typedef struct
+{
+ Window swap_window; /* window for which to swap buffers */
+ XdbeSwapAction swap_action; /* swap action to use for swap_window */
+}
+XdbeSwapInfo;
+
+typedef struct
+{
+ Window window; /* window that buffer belongs to */
+}
+XdbeBackBufferAttributes;
+
+typedef struct
+{
+ int type;
+ Display *display; /* display the event was read from */
+ XdbeBackBuffer buffer; /* resource id */
+ unsigned long serial; /* serial number of failed request */
+ unsigned char error_code; /* error base + XdbeBadBuffer */
+ unsigned char request_code; /* major opcode of failed request */
+ unsigned char minor_code; /* minor opcode of failed request */
+}
+XdbeBufferError;
+
+/* _XFUNCPROTOBEGIN and _XFUNCPROTOEND are defined as noops
+ * (for non-C++ builds) in X11/Xfuncproto.h.
+ */
+_XFUNCPROTOBEGIN
+
+extern Status XdbeQueryExtension(
+ Display* /* dpy */,
+ int* /* major_version_return */,
+ int* /* minor_version_return */
+);
+
+extern XdbeBackBuffer XdbeAllocateBackBufferName(
+ Display* /* dpy */,
+ Window /* window */,
+ XdbeSwapAction /* swap_action */
+);
+
+extern Status XdbeDeallocateBackBufferName(
+ Display* /* dpy */,
+ XdbeBackBuffer /* buffer */
+);
+
+extern Status XdbeSwapBuffers(
+ Display* /* dpy */,
+ XdbeSwapInfo* /* swap_info */,
+ int /* num_windows */
+);
+
+extern Status XdbeBeginIdiom(
+ Display* /* dpy */
+);
+
+extern Status XdbeEndIdiom(
+ Display* /* dpy */
+);
+
+extern XdbeScreenVisualInfo *XdbeGetVisualInfo(
+ Display* /* dpy */,
+ Drawable* /* screen_specifiers */,
+ int* /* num_screens */
+);
+
+extern void XdbeFreeVisualInfo(
+ XdbeScreenVisualInfo* /* visual_info */
+);
+
+extern XdbeBackBufferAttributes *XdbeGetBackBufferAttributes(
+ Display* /* dpy */,
+ XdbeBackBuffer /* buffer */
+);
+
+_XFUNCPROTOEND
+
+#endif /* XDBE_H */
+
diff --git a/sysroot/usr/include/X11/extensions/Xdbeproto.h b/sysroot/usr/include/X11/extensions/Xdbeproto.h
new file mode 100644
index 0000000..8a8c555
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/Xdbeproto.h
@@ -0,0 +1,277 @@
+/* $Xorg: Xdbeproto.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */
+/******************************************************************************
+ *
+ * Copyright (c) 1994, 1995 Hewlett-Packard Company
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL HEWLETT-PACKARD COMPANY BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name of the Hewlett-Packard
+ * Company shall not be used in advertising or otherwise to promote the
+ * sale, use or other dealings in this Software without prior written
+ * authorization from the Hewlett-Packard Company.
+ *
+ * Header file for Xlib-related DBE
+ *
+ *****************************************************************************/
+
+
+#ifndef XDBE_PROTO_H
+#define XDBE_PROTO_H
+
+/* INCLUDES */
+
+
+/* DEFINES */
+
+/* Values for swap_action field of XdbeSwapInfo structure */
+#define XdbeUndefined 0
+#define XdbeBackground 1
+#define XdbeUntouched 2
+#define XdbeCopied 3
+
+#ifdef NEED_DBE_PROTOCOL
+
+#define DBE_PROTOCOL_NAME "DOUBLE-BUFFER"
+
+/* Current version numbers */
+#define DBE_MAJOR_VERSION 1
+#define DBE_MINOR_VERSION 0
+
+/* Used when adding extension; also used in Xdbe macros */
+#define DbeNumberEvents 0
+#define DbeBadBuffer 0
+#define DbeNumberErrors (DbeBadBuffer + 1)
+
+/* Request values used in (S)ProcDbeDispatch() */
+#define X_DbeGetVersion 0
+#define X_DbeAllocateBackBufferName 1
+#define X_DbeDeallocateBackBufferName 2
+#define X_DbeSwapBuffers 3
+#define X_DbeBeginIdiom 4
+#define X_DbeEndIdiom 5
+#define X_DbeGetVisualInfo 6
+#define X_DbeGetBackBufferAttributes 7
+
+typedef CARD8 xDbeSwapAction;
+typedef CARD32 xDbeBackBuffer;
+
+#endif /* NEED_DBE_PROTOCOL */
+
+
+/* TYPEDEFS */
+
+/* Client data types */
+
+/* XdbeVisualInfo and XdbeScreenVisualInfo are defined in this file,
+ * "Xdbeproto.h", rather than "Xdbe.h" because the server uses these data
+ * types.
+ */
+
+typedef struct
+{
+ VisualID visual; /* one visual ID that supports double-buffering */
+ int depth; /* depth of visual in bits */
+ int perflevel; /* performance level of visual */
+}
+XdbeVisualInfo;
+
+typedef struct
+{
+ int count; /* number of items in visual_depth */
+ XdbeVisualInfo *visinfo; /* list of visuals & depths for scrn */
+}
+XdbeScreenVisualInfo;
+
+/* Protocol data types */
+
+#ifdef NEED_DBE_PROTOCOL
+
+typedef struct
+{
+ CARD32 window B32; /* window */
+ xDbeSwapAction swapAction; /* swap action */
+ CARD8 pad1; /* unused */
+ CARD16 pad2 B16;
+
+} xDbeSwapInfo;
+
+typedef struct
+{
+ CARD32 visualID B32; /* associated visual */
+ CARD8 depth; /* depth of visual */
+ CARD8 perfLevel; /* performance level hint */
+ CARD16 pad1 B16;
+
+} xDbeVisInfo;
+#define sz_xDbeVisInfo 8
+
+typedef struct
+{
+ CARD32 n B32; /* number of visual info items in list */
+
+} xDbeScreenVisInfo; /* followed by n xDbeVisInfo items */
+
+typedef struct
+{
+ CARD32 window B32; /* window */
+
+} xDbeBufferAttributes;
+
+
+/* Requests and replies */
+
+typedef struct
+{
+ CARD8 reqType; /* major-opcode: always codes->major_opcode */
+ CARD8 dbeReqType; /* minor-opcode: always X_DbeGetVersion (0) */
+ CARD16 length B16; /* request length: (2) */
+ CARD8 majorVersion; /* client-major-version */
+ CARD8 minorVersion; /* client-minor-version */
+ CARD16 unused B16; /* unused */
+
+} xDbeGetVersionReq;
+#define sz_xDbeGetVersionReq 8
+
+typedef struct
+{
+ BYTE type; /* Reply: X_Reply (1) */
+ CARD8 unused; /* unused */
+ CARD16 sequenceNumber B16; /* sequence number */
+ CARD32 length B32; /* reply length: (0) */
+ CARD8 majorVersion; /* server-major-version */
+ CARD8 minorVersion; /* server-minor-version */
+ CARD16 pad1 B16; /* unused */
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+
+} xDbeGetVersionReply;
+#define sz_xDbeGetVersionReply 32
+
+typedef struct
+{
+ CARD8 reqType; /* major-opcode: codes->major_opcode */
+ CARD8 dbeReqType; /* X_DbeAllocateBackBufferName (1) */
+ CARD16 length B16; /* request length: (4) */
+ CARD32 window B32; /* window */
+ xDbeBackBuffer buffer B32; /* back buffer name */
+ xDbeSwapAction swapAction; /* swap action hint */
+ CARD8 pad1; /* unused */
+ CARD16 pad2 B16;
+
+} xDbeAllocateBackBufferNameReq;
+#define sz_xDbeAllocateBackBufferNameReq 16
+
+typedef struct
+{
+ CARD8 reqType; /* major-opcode: codes->major_opcode */
+ CARD8 dbeReqType; /* X_DbeDeallocateBackBufferName (2) */
+ CARD16 length B16; /* request length: (2) */
+ xDbeBackBuffer buffer B32; /* back buffer name */
+
+} xDbeDeallocateBackBufferNameReq;
+#define sz_xDbeDeallocateBackBufferNameReq 8
+
+typedef struct
+{
+ CARD8 reqType; /* major-opcode: always codes->major_opcode */
+ CARD8 dbeReqType; /* minor-opcode: always X_DbeSwapBuffers (3) */
+ CARD16 length B16; /* request length: (2+2n) */
+ CARD32 n B32; /* n, number of window/swap action pairs */
+
+} xDbeSwapBuffersReq; /* followed by n window/swap action pairs */
+#define sz_xDbeSwapBuffersReq 8
+
+typedef struct
+{
+ CARD8 reqType; /* major-opcode: always codes->major_opcode */
+ CARD8 dbeReqType; /* minor-opcode: always X_DbeBeginIdom (4) */
+ CARD16 length B16; /* request length: (1) */
+
+} xDbeBeginIdiomReq;
+#define sz_xDbeBeginIdiomReq 4
+
+typedef struct
+{
+ CARD8 reqType; /* major-opcode: always codes->major_opcode */
+ CARD8 dbeReqType; /* minor-opcode: always X_DbeEndIdom (5) */
+ CARD16 length B16; /* request length: (1) */
+
+} xDbeEndIdiomReq;
+#define sz_xDbeEndIdiomReq 4
+
+typedef struct
+{
+ CARD8 reqType; /* always codes->major_opcode */
+ CARD8 dbeReqType; /* always X_DbeGetVisualInfo (6) */
+ CARD16 length B16; /* request length: (2+n) */
+ CARD32 n B32; /* n, number of drawables in list */
+
+} xDbeGetVisualInfoReq; /* followed by n drawables */
+#define sz_xDbeGetVisualInfoReq 8
+
+typedef struct
+{
+ BYTE type; /* Reply: X_Reply (1) */
+ CARD8 unused; /* unused */
+ CARD16 sequenceNumber B16; /* sequence number */
+ CARD32 length B32; /* reply length */
+ CARD32 m; /* m, number of visual infos in list */
+ CARD32 pad1 B32; /* unused */
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+
+} xDbeGetVisualInfoReply; /* followed by m visual infos */
+#define sz_xDbeGetVisualInfoReply 32
+
+typedef struct
+{
+ CARD8 reqType; /* always codes->major_opcode */
+ CARD8 dbeReqType; /* X_DbeGetBackBufferAttributes (7) */
+ CARD16 length B16; /* request length: (2) */
+ xDbeBackBuffer buffer B32; /* back buffer name */
+
+} xDbeGetBackBufferAttributesReq;
+#define sz_xDbeGetBackBufferAttributesReq 8
+
+typedef struct
+{
+ BYTE type; /* Reply: X_Reply (1) */
+ CARD8 unused; /* unused */
+ CARD16 sequenceNumber B16; /* sequence number */
+ CARD32 length B32; /* reply length: (0) */
+ CARD32 attributes; /* attributes */
+ CARD32 pad1 B32; /* unused */
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+
+} xDbeGetBackBufferAttributesReply;
+#define sz_xDbeGetBackBufferAttributesReply 32
+
+#endif /* NEED_DBE_PROTOCOL */
+
+#endif /* XDBE_PROTO_H */
+
diff --git a/sysroot/usr/include/X11/extensions/Xext.h b/sysroot/usr/include/X11/extensions/Xext.h
new file mode 100644
index 0000000..5b62c8b
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/Xext.h
@@ -0,0 +1,57 @@
+/*
+ * $Xorg: Xext.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $
+ *
+Copyright 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+ */
+/* $XFree86: xc/include/extensions/Xext.h,v 1.4 2001/12/14 19:53:28 dawes Exp $ */
+
+#ifndef _XEXT_H_
+#define _XEXT_H_
+
+#include <X11/Xfuncproto.h>
+
+_XFUNCPROTOBEGIN
+
+extern int (*XSetExtensionErrorHandler(
+ int (*handler)(
+ Display *,
+ char *,
+ char *
+ )
+))(
+ Display *,
+ char *,
+ char *
+);
+
+extern int XMissingExtension(
+ Display* /* dpy */,
+ _Xconst char* /* ext_name */
+);
+
+_XFUNCPROTOEND
+
+#define X_EXTENSION_UNKNOWN "unknown"
+#define X_EXTENSION_MISSING "missing"
+
+#endif /* _XEXT_H_ */
diff --git a/sysroot/usr/include/X11/extensions/dpms.h b/sysroot/usr/include/X11/extensions/dpms.h
new file mode 100644
index 0000000..7555f4a
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/dpms.h
@@ -0,0 +1,67 @@
+/* $Xorg: dpms.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */
+/*****************************************************************
+
+Copyright (c) 1996 Digital Equipment Corporation, Maynard, Massachusetts.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
+BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of Digital Equipment Corporation
+shall not be used in advertising or otherwise to promote the sale, use or other
+dealings in this Software without prior written authorization from Digital
+Equipment Corporation.
+
+******************************************************************/
+/* $XFree86: xc/include/extensions/dpms.h,v 3.4 2000/03/15 16:51:51 tsi Exp $ */
+
+#ifndef _X11_EXTENSIONS_DPMS_H
+#define _X11_EXTENSIONS_DPMS_H 1
+
+/*
+ * HISTORY
+ */
+/*
+ * @(#)RCSfile: dpms.h,v Revision: 1.1.4.2 (DEC) Date: 1995/11/21 19:34:17
+ */
+
+
+#define DPMSModeOn 0
+#define DPMSModeStandby 1
+#define DPMSModeSuspend 2
+#define DPMSModeOff 3
+
+#ifndef DPMS_SERVER
+
+#include <X11/X.h>
+#include <X11/Xmd.h>
+
+_XFUNCPROTOBEGIN
+
+extern Bool DPMSQueryExtension(Display *, int *, int *);
+extern Status DPMSGetVersion(Display *, int *, int *);
+extern Bool DPMSCapable(Display *);
+extern Status DPMSSetTimeouts(Display *, CARD16, CARD16, CARD16);
+extern Bool DPMSGetTimeouts(Display *, CARD16 *, CARD16 *, CARD16 *);
+extern Status DPMSEnable(Display *);
+extern Status DPMSDisable(Display *);
+extern Status DPMSForceLevel(Display *, CARD16);
+extern Status DPMSInfo(Display *, CARD16 *, BOOL *);
+
+_XFUNCPROTOEND
+#endif /* !DPMS_SERVER */
+#endif /* !_X11_EXTENSIONS_DPMS_H */
+
diff --git a/sysroot/usr/include/X11/extensions/dpmsstr.h b/sysroot/usr/include/X11/extensions/dpmsstr.h
new file mode 100644
index 0000000..9386d4a
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/dpmsstr.h
@@ -0,0 +1,186 @@
+/* $Xorg: dpmsstr.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */
+/*****************************************************************
+
+Copyright (c) 1996 Digital Equipment Corporation, Maynard, Massachusetts.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
+BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of Digital Equipment Corporation
+shall not be used in advertising or otherwise to promote the sale, use or other
+dealings in this Software without prior written authorization from Digital
+Equipment Corporation.
+
+******************************************************************/
+/* $XFree86$ */
+
+/*
+ * HISTORY
+ */
+/*
+ * @(#)RCSfile: dpmsstr.h,v Revision: 1.1.4.2 (DEC) Date: 1995/11/21 19:34:19
+ */
+
+#ifndef _DPMSSTR_H_
+#define _DPMSSTR_H_
+
+#define X_DPMSGetVersion 0
+#define X_DPMSCapable 1
+#define X_DPMSGetTimeouts 2
+#define X_DPMSSetTimeouts 3
+#define X_DPMSEnable 4
+#define X_DPMSDisable 5
+#define X_DPMSForceLevel 6
+#define X_DPMSInfo 7
+
+#define DPMSNumberEvents 0
+
+#define DPMSNumberErrors 0
+
+#define DPMSMajorVersion 1
+#define DPMSMinorVersion 1
+
+#define DPMSExtensionName "DPMS"
+
+typedef struct {
+ CARD8 reqType; /* always DPMSCode */
+ CARD8 dpmsReqType; /* always X_DPMSGetVersion */
+ CARD16 length B16;
+ CARD16 majorVersion B16;
+ CARD16 minorVersion B16;
+} xDPMSGetVersionReq;
+#define sz_xDPMSGetVersionReq 8
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 pad0;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 majorVersion B16;
+ CARD16 minorVersion B16;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+} xDPMSGetVersionReply;
+#define sz_xDPMSGetVersionReply 32
+
+typedef struct {
+ CARD8 reqType; /* always DPMSCode */
+ CARD8 dpmsReqType; /* always X_DPMSCapable */
+ CARD16 length B16;
+} xDPMSCapableReq;
+#define sz_xDPMSCapableReq 4
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 pad0;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ BOOL capable;
+ CARD8 pad1;
+ CARD16 pad2 B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+} xDPMSCapableReply;
+#define sz_xDPMSCapableReply 32
+
+typedef struct {
+ CARD8 reqType; /* always DPMSCode */
+ CARD8 dpmsReqType; /* always X_DPMSGetTimeouts */
+ CARD16 length B16;
+} xDPMSGetTimeoutsReq;
+#define sz_xDPMSGetTimeoutsReq 4
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 pad0;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 standby B16;
+ CARD16 suspend B16;
+ CARD16 off B16;
+ CARD16 pad1 B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+} xDPMSGetTimeoutsReply;
+#define sz_xDPMSGetTimeoutsReply 32
+
+typedef struct {
+ CARD8 reqType; /* always DPMSCode */
+ CARD8 dpmsReqType; /* always X_DPMSSetTimeouts */
+ CARD16 length B16;
+ CARD16 standby B16;
+ CARD16 suspend B16;
+ CARD16 off B16;
+ CARD16 pad0 B16;
+} xDPMSSetTimeoutsReq;
+#define sz_xDPMSSetTimeoutsReq 12
+
+typedef struct {
+ CARD8 reqType; /* always DPMSCode */
+ CARD8 dpmsReqType; /* always X_DPMSEnable */
+ CARD16 length B16;
+} xDPMSEnableReq;
+#define sz_xDPMSEnableReq 4
+
+typedef struct {
+ CARD8 reqType; /* always DPMSCode */
+ CARD8 dpmsReqType; /* always X_DPMSDisable */
+ CARD16 length B16;
+} xDPMSDisableReq;
+#define sz_xDPMSDisableReq 4
+
+typedef struct {
+ CARD8 reqType; /* always DPMSCode */
+ CARD8 dpmsReqType; /* always X_DPMSForceLevel */
+ CARD16 length B16;
+ CARD16 level B16; /* power level requested */
+ CARD16 pad0 B16;
+} xDPMSForceLevelReq;
+#define sz_xDPMSForceLevelReq 8
+
+typedef struct {
+ CARD8 reqType; /* always DPMSCode */
+ CARD8 dpmsReqType; /* always X_DPMSInfo */
+ CARD16 length B16;
+} xDPMSInfoReq;
+#define sz_xDPMSInfoReq 4
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 pad0;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 power_level B16;
+ BOOL state;
+ CARD8 pad1;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xDPMSInfoReply;
+#define sz_xDPMSInfoReply 32
+
+#endif /* _DPMSSTR_H_ */
diff --git a/sysroot/usr/include/X11/extensions/extutil.h b/sysroot/usr/include/X11/extensions/extutil.h
new file mode 100644
index 0000000..825d81e
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/extutil.h
@@ -0,0 +1,192 @@
+/*
+ * $Xorg: extutil.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $
+ *
+Copyright 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+ *
+ * Author: Jim Fulton, MIT The Open Group
+ *
+ * Xlib Extension-Writing Utilities
+ *
+ * This package contains utilities for writing the client API for various
+ * protocol extensions. THESE INTERFACES ARE NOT PART OF THE X STANDARD AND
+ * ARE SUBJECT TO CHANGE!
+ */
+/* $XFree86: xc/include/extensions/extutil.h,v 1.9 2001/12/14 19:53:28 dawes Exp $ */
+
+#ifndef _EXTUTIL_H_
+#define _EXTUTIL_H_
+
+#include <X11/extensions/Xext.h>
+
+/*
+ * We need to keep a list of open displays since the Xlib display list isn't
+ * public. We also have to per-display info in a separate block since it isn't
+ * stored directly in the Display structure.
+ */
+typedef struct _XExtDisplayInfo {
+ struct _XExtDisplayInfo *next; /* keep a linked list */
+ Display *display; /* which display this is */
+ XExtCodes *codes; /* the extension protocol codes */
+ XPointer data; /* extra data for extension to use */
+} XExtDisplayInfo;
+
+typedef struct _XExtensionInfo {
+ XExtDisplayInfo *head; /* start of list */
+ XExtDisplayInfo *cur; /* most recently used */
+ int ndisplays; /* number of displays */
+} XExtensionInfo;
+
+typedef struct _XExtensionHooks {
+ int (*create_gc)(
+ Display* /* display */,
+ GC /* gc */,
+ XExtCodes* /* codes */
+);
+ int (*copy_gc)(
+ Display* /* display */,
+ GC /* gc */,
+ XExtCodes* /* codes */
+);
+ int (*flush_gc)(
+ Display* /* display */,
+ GC /* gc */,
+ XExtCodes* /* codes */
+);
+ int (*free_gc)(
+ Display* /* display */,
+ GC /* gc */,
+ XExtCodes* /* codes */
+);
+ int (*create_font)(
+ Display* /* display */,
+ XFontStruct* /* fs */,
+ XExtCodes* /* codes */
+);
+ int (*free_font)(
+ Display* /* display */,
+ XFontStruct* /* fs */,
+ XExtCodes* /* codes */
+);
+ int (*close_display)(
+ Display* /* display */,
+ XExtCodes* /* codes */
+);
+ Bool (*wire_to_event)(
+ Display* /* display */,
+ XEvent* /* re */,
+ xEvent* /* event */
+);
+ Status (*event_to_wire)(
+ Display* /* display */,
+ XEvent* /* re */,
+ xEvent* /* event */
+);
+ int (*error)(
+ Display* /* display */,
+ xError* /* err */,
+ XExtCodes* /* codes */,
+ int* /* ret_code */
+);
+ char *(*error_string)(
+ Display* /* display */,
+ int /* code */,
+ XExtCodes* /* codes */,
+ char* /* buffer */,
+ int /* nbytes */
+);
+} XExtensionHooks;
+
+extern XExtensionInfo *XextCreateExtension(
+ void
+);
+extern void XextDestroyExtension(
+ XExtensionInfo* /* info */
+);
+extern XExtDisplayInfo *XextAddDisplay(
+ XExtensionInfo* /* extinfo */,
+ Display* /* dpy */,
+ char* /* ext_name */,
+ XExtensionHooks* /* hooks */,
+ int /* nevents */,
+ XPointer /* data */
+);
+extern int XextRemoveDisplay(
+ XExtensionInfo* /* extinfo */,
+ Display* /* dpy */
+);
+extern XExtDisplayInfo *XextFindDisplay(
+ XExtensionInfo* /* extinfo */,
+ Display* /* dpy */
+);
+
+#define XextHasExtension(i) ((i) && ((i)->codes))
+#define XextCheckExtension(dpy,i,name,val) \
+ if (!XextHasExtension(i)) { XMissingExtension (dpy, name); return val; }
+#define XextSimpleCheckExtension(dpy,i,name) \
+ if (!XextHasExtension(i)) { XMissingExtension (dpy, name); return; }
+
+
+/*
+ * helper macros to generate code that is common to all extensions; caller
+ * should prefix it with static if extension source is in one file; this
+ * could be a utility function, but have to stack 6 unused arguments for
+ * something that is called many, many times would be bad.
+ */
+#define XEXT_GENERATE_FIND_DISPLAY(proc,extinfo,extname,hooks,nev,data) \
+XExtDisplayInfo *proc (Display *dpy) \
+{ \
+ XExtDisplayInfo *dpyinfo; \
+ if (!extinfo) { if (!(extinfo = XextCreateExtension())) return NULL; } \
+ if (!(dpyinfo = XextFindDisplay (extinfo, dpy))) \
+ dpyinfo = XextAddDisplay (extinfo,dpy,extname,hooks,nev,data); \
+ return dpyinfo; \
+}
+
+#define XEXT_FIND_DISPLAY_PROTO(proc) \
+ XExtDisplayInfo *proc(Display *dpy)
+
+#define XEXT_GENERATE_CLOSE_DISPLAY(proc,extinfo) \
+int proc (Display *dpy, XExtCodes *codes) \
+{ \
+ return XextRemoveDisplay (extinfo, dpy); \
+}
+
+#define XEXT_CLOSE_DISPLAY_PROTO(proc) \
+ int proc(Display *dpy, XExtCodes *codes)
+
+#define XEXT_GENERATE_ERROR_STRING(proc,extname,nerr,errl) \
+char *proc (Display *dpy, int code, XExtCodes *codes, char *buf, int n) \
+{ \
+ code -= codes->first_error; \
+ if (code >= 0 && code < nerr) { \
+ char tmp[256]; \
+ sprintf (tmp, "%s.%d", extname, code); \
+ XGetErrorDatabaseText (dpy, "XProtoError", tmp, errl[code], buf, n); \
+ return buf; \
+ } \
+ return (char *)0; \
+}
+
+#define XEXT_ERROR_STRING_PROTO(proc) \
+ char *proc(Display *dpy, int code, XExtCodes *codes, char *buf, int n)
+#endif
diff --git a/sysroot/usr/include/X11/extensions/lbxbuf.h b/sysroot/usr/include/X11/extensions/lbxbuf.h
new file mode 100644
index 0000000..63983df
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/lbxbuf.h
@@ -0,0 +1,51 @@
+/* $Xorg: lbxbuf.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */
+/*
+ * Copyright 1988, 1989, 1990, 1994 Network Computing Devices, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name Network Computing Devices, Inc. not be
+ * used in advertising or publicity pertaining to distribution of this
+ * software without specific, written prior permission.
+ *
+ * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC.,
+ * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT
+ * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK
+ * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING
+ * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE,
+ * DATA, OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND
+ * REGARDLESS OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ *
+ */
+
+#ifndef _BUFFER_H_
+#define _BUFFER_H_
+
+#define INBUFFER_SIZE (1 << 13) /* 8K */
+#define OUTBUFFER_SIZE (1 << 12) /* 4K */
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+typedef struct _zlibbuffer *ZlibBufferPtr;
+
+#include <X11/Xfuncproto.h>
+
+_XFUNCPROTOBEGIN
+
+extern int InitZlibBuffer(ZlibBufferPtr b, int size);
+extern void FreeZlibBuffer(ZlibBufferPtr b);
+extern char *ReserveOutBuf(ZlibBufferPtr outbuf, int outlen);
+
+_XFUNCPROTOEND
+
+#endif /* _BUFFER_H_ */
diff --git a/sysroot/usr/include/X11/extensions/lbxbufstr.h b/sysroot/usr/include/X11/extensions/lbxbufstr.h
new file mode 100644
index 0000000..e1a06f6
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/lbxbufstr.h
@@ -0,0 +1,45 @@
+/* $Xorg: lbxbufstr.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */
+/*
+ * Copyright 1988, 1989, 1990, 1994 Network Computing Devices, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name Network Computing Devices, Inc. not be
+ * used in advertising or publicity pertaining to distribution of this
+ * software without specific, written prior permission.
+ *
+ * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC.,
+ * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT
+ * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK
+ * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING
+ * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE,
+ * DATA, OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND
+ * REGARDLESS OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ *
+ */
+/* $XFree86$ */
+
+#ifndef _BUFFERSTR_H_
+#define _BUFFERSTR_H_
+
+#include <X11/extensions/lbxbuf.h>
+
+/*
+ * ZLIB Input/Output buffer
+ */
+typedef struct _zlibbuffer {
+ char *bufbase;
+ char *bufend;
+ char *bufptr;
+ int bufcnt;
+} ZlibBuffer;
+
+#define BYTES_AVAIL(inbuf, len) \
+ (((inbuf)->bufcnt >= (len)) ? (inbuf)->bufptr : NULL)
+
+#endif /* _BUFFERSTR_H_ */
diff --git a/sysroot/usr/include/X11/extensions/lbxdeltastr.h b/sysroot/usr/include/X11/extensions/lbxdeltastr.h
new file mode 100644
index 0000000..a8e4cb3
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/lbxdeltastr.h
@@ -0,0 +1,105 @@
+/* $Xorg: lbxdeltastr.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */
+/*
+ * Copyright 1993 Network Computing Devices
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of NCD. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. NCD. makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * NCD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NCD.
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+#ifndef LBX_DELTA_STRUCT_H
+#define LBX_DELTA_STRUCT_H
+
+#define MIN_CACHEABLE_LEN 8
+
+#define DELTA_CACHEABLE(pcache, len) \
+ ((len) > MIN_CACHEABLE_LEN && (len) <= (pcache)->maxDeltasize)
+
+/*
+ * An entry in the delta compactor cache
+ */
+typedef struct _LBXDeltaElem {
+ int length;
+ unsigned char *buf;
+} LBXDeltaElemRec, *LBXDeltaElemPtr;
+
+
+/*
+ * Delta compactor cache
+ */
+typedef struct _LBXDeltas {
+ unsigned short nDeltas;
+ unsigned short maxDeltasize;
+ LBXDeltaElemPtr deltas;
+ unsigned short nextDelta;
+ unsigned short activeDeltas; /* only needed for outgoing */
+} LBXDeltasRec, *LBXDeltasPtr;
+
+
+/*
+ * Motion delta cache
+ */
+
+typedef struct {
+ BYTE swapped;
+ BYTE detail;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ Window root B32, event B32, child B32;
+ INT16 rootX B16, rootY B16, eventX B16, eventY B16;
+ KeyButMask state B16;
+ BOOL sameScreen;
+} lbxMotionCache;
+
+
+/*
+ * Motion delta events
+ */
+
+typedef struct {
+ BYTE type; /* always eventBase + LbxQuickMotionDeltaEvent */
+ CARD8 deltaTime;
+ INT8 deltaX;
+ INT8 deltaY;
+} lbxQuickMotionDeltaEvent;
+#define sz_lbxQuickMotionDeltaEvent 4
+
+typedef struct {
+ BYTE type; /* always eventBase + LbxEvent */
+ BYTE lbxType; /* LbxMotionDeltaEvent */
+ INT8 deltaX;
+ INT8 deltaY;
+ CARD16 deltaTime B16;
+ CARD16 deltaSequence B16;
+} lbxMotionDeltaEvent;
+#define sz_lbxMotionDeltaEvent 8
+
+extern int LBXInitDeltaCache ( LBXDeltasPtr pcache, int nDeltas,
+ int maxDeltasize );
+extern void LBXFreeDeltaCache ( LBXDeltasPtr pcache );
+extern int LBXDeltaMinDiffs ( LBXDeltasPtr pcache, unsigned char *inmsg,
+ int inmsglen, int maxdiff, int *pindex );
+extern void LBXEncodeDelta ( LBXDeltasPtr pcache, unsigned char *inmsg,
+ int ndiff, int index, unsigned char *buf );
+extern int LBXDecodeDelta ( LBXDeltasPtr pcache, xLbxDiffItem *deltas,
+ int ndiff, int index, unsigned char **buf );
+extern void LBXAddDeltaOut ( LBXDeltasPtr pcache, unsigned char *inmsg,
+ int inmsglen );
+extern void LBXAddDeltaIn ( LBXDeltasPtr pcache, unsigned char *inmsg,
+ int inmsglen );
+
+#endif /* LBX_DELTA_STRUCT_H */
diff --git a/sysroot/usr/include/X11/extensions/lbximage.h b/sysroot/usr/include/X11/extensions/lbximage.h
new file mode 100644
index 0000000..10627cf
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/lbximage.h
@@ -0,0 +1,151 @@
+/* $Xorg: lbximage.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ */
+
+/******************************************************************************
+
+Copyright 1994, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+******************************************************************************/
+/* $XFree86: xc/include/extensions/lbximage.h,v 1.4 2001/12/20 19:28:54 tsi Exp $ */
+
+#ifndef _LBX_IMAGE_H_
+#define _LBX_IMAGE_H_
+
+#include <X11/Xfuncproto.h>
+
+_XFUNCPROTOBEGIN
+
+typedef struct _LbxBitmapCompMethod {
+
+ char *methodName;
+ int inited;
+ int methodOpCode; /* to be filled on reply from server */
+
+ int (*compInit)(
+ void
+ );
+
+ int (*compFunc)(
+ unsigned char * /* inbuf */,
+ unsigned char * /* outbuf */,
+ int /* outbufSize */,
+ int /* image_bytes */,
+ int /* pixels_per_line */,
+ int /* padded_bytes_per_scanline */,
+ int /* reverse_bits */,
+ int * /* bytesCompressed */
+ );
+
+ int (*decompFunc)(
+ unsigned char * /* inbuf */,
+ unsigned char * /* outbuf */,
+ int /* image_bytes */,
+ int /* pixels_per_line */,
+ int /* padded_bytes_per_scanline */,
+ int /* reverse_bits */
+ );
+
+} LbxBitmapCompMethod;
+
+
+#define LBX_MAX_DEPTHS 5
+
+typedef struct _LbxPixmapCompMethod {
+
+ char *methodName;
+ unsigned formatMask;
+ int depthCount;
+ int depths[LBX_MAX_DEPTHS];
+ int inited;
+ int methodOpCode; /* to be filled on reply from server */
+
+ int (*compInit)(
+ void
+ );
+
+ int (*compFunc)(
+ char * /* inbuf */,
+ char * /* outbuf */,
+ int /* outbufSize */,
+ int /* format */,
+ int /* depth */,
+ int /* num_scan_lines */,
+ int /* scan_line_size */,
+ int * /* bytesCompressed */
+ );
+
+ int (*decompFunc)(
+ char * /* inbuf */,
+ char * /* outbuf */,
+ int /* num_scan_lines */,
+ int /* scan_line_size */
+ );
+
+} LbxPixmapCompMethod;
+
+
+extern int LbxImageEncodePackBits (
+char * /* inbuf */,
+char * /* outbuf */,
+int /* outbufSize */,
+int /* format */,
+int /* depth */,
+int /* num_scan_lines */,
+int /* scan_line_size */,
+int * /* bytesCompressed */
+);
+
+extern int LbxImageEncodeFaxG42D (
+unsigned char * /* inbuf */,
+unsigned char * /* outbuf */,
+int /* outbufSize */,
+int /* image_bytes */,
+int /* pixels_per_line */,
+int /* padded_bytes_per_scanline */,
+int /* reverse_bits */,
+int * /* bytesCompressed */
+);
+
+extern int LbxImageDecodePackBits (
+char * /* inbuf */,
+char * /* outbuf */,
+int /* num_scan_lines */,
+int /* scan_line_size */
+);
+
+extern int LbxImageDecodeFaxG42D (
+unsigned char * /* inbuf */,
+unsigned char * /* outbuf */,
+int /* image_bytes */,
+int /* pixels_per_line */,
+int /* padded_bytes_per_scanline */,
+int /* reverse_bits */
+);
+
+_XFUNCPROTOEND
+
+#define LBX_IMAGE_COMPRESS_SUCCESS 0
+#define LBX_IMAGE_COMPRESS_NO_SUPPORT 1
+#define LBX_IMAGE_COMPRESS_BAD_MALLOC 2
+#define LBX_IMAGE_COMPRESS_NOT_WORTH_IT 3
+
+#endif /* _LBX_IMAGE_H_ */
diff --git a/sysroot/usr/include/X11/extensions/lbxopts.h b/sysroot/usr/include/X11/extensions/lbxopts.h
new file mode 100644
index 0000000..02e87fd
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/lbxopts.h
@@ -0,0 +1,133 @@
+/* $Xorg: lbxopts.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */
+/*
+ * Copyright 1994 Network Computing Devices, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name Network Computing Devices, Inc. not be
+ * used in advertising or publicity pertaining to distribution of this
+ * software without specific, written prior permission.
+ *
+ * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC.,
+ * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT
+ * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK
+ * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING
+ * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA,
+ * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF
+ * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+/* $XFree86: xc/include/extensions/lbxopts.h,v 1.5 2001/01/17 17:53:21 dawes Exp $ */
+
+#ifndef _LBX_OPTS_H_
+#define _LBX_OPTS_H_
+
+/*
+ * Negotiable configuration options
+ */
+#define LBX_OPT_DELTA_PROXY 0
+#define LBX_OPT_DELTA_SERVER 1
+#define LBX_OPT_STREAM_COMP 2
+#define LBX_OPT_BITMAP_COMP 3
+#define LBX_OPT_PIXMAP_COMP 4
+#define LBX_OPT_MSG_COMP 5 /* aka "squishing" */
+#define LBX_OPT_USE_TAGS 6
+#define LBX_OPT_CMAP_ALL 7
+#define LBX_OPT_EXTENSION 255
+
+/*
+ * Length fields are encoded in 1 or 3 bytes
+ */
+#define LBX_OPT_SMALLLEN_SIZE 1
+#define LBX_OPT_BIGLEN_SIZE 3
+#define LBX_OPT_BIGLEN_MIN 256
+
+#define LBX_OPT_DECODE_LEN(p, len, size) \
+ if ((p)[0]) { \
+ (len) = (p)[0]; \
+ (size) = LBX_OPT_SMALLLEN_SIZE; \
+ } \
+ else { \
+ (len) = ((LBX_OPT_BIGLEN_MIN + (p)[1]) << 8) | (p)[2]; \
+ (size) = LBX_OPT_BIGLEN_SIZE; \
+ }
+
+/*
+ * Option header lengths
+ */
+#define LBX_OPT_SMALLHDR_LEN (1 + LBX_OPT_SMALLLEN_SIZE)
+#define LBX_OPT_BIGHDR_LEN (1 + LBX_OPT_BIGLEN_SIZE)
+
+/*
+ * Delta compression parameters
+ */
+#define LBX_OPT_DELTA_REQLEN 6
+#define LBX_OPT_DELTA_REPLYLEN 2
+#define LBX_OPT_DELTA_NCACHE_DFLT 16
+#define LBX_OPT_DELTA_MSGLEN_MIN 32
+#define LBX_OPT_DELTA_MSGLEN_DFLT 64
+
+
+/*
+ * Stream compression opts
+ */
+
+#include <sys/types.h>
+
+#if defined(WIN32) || (defined(USG) && !defined(CRAY) && !defined(umips) && !defined(MOTOROLA) && !defined(uniosu) && !defined(__sxg__))
+
+struct iovec {
+ caddr_t iov_base;
+ int iov_len;
+};
+
+#else
+#ifndef Lynx
+#include <sys/uio.h>
+#else
+#include <uio.h>
+#endif
+#endif
+
+typedef void *LbxStreamCompHandle;
+
+typedef struct _LbxStreamOpts {
+ LbxStreamCompHandle (*streamCompInit)(int fd, pointer arg);
+ pointer streamCompArg;
+ int (*streamCompStuffInput)(
+ int fd,
+ unsigned char *buf,
+ int buflen
+ );
+ int (*streamCompInputAvail)(
+ int fd
+ );
+ int (*streamCompFlush)(
+ int fd
+ );
+ int (*streamCompRead)(
+ int fd,
+ unsigned char *buf,
+ int buflen
+ );
+ int (*streamCompWriteV)(
+ int fd,
+ struct iovec *iov,
+ int iovcnt
+ );
+ void (*streamCompOn)(
+ int fd
+ );
+ void (*streamCompOff)(
+ int fd
+ );
+ void (*streamCompFreeHandle)(
+ LbxStreamCompHandle handle
+ );
+} LbxStreamOpts;
+
+#endif /* _LBX_OPTS_H_ */
diff --git a/sysroot/usr/include/X11/extensions/lbxstr.h b/sysroot/usr/include/X11/extensions/lbxstr.h
new file mode 100644
index 0000000..5b79e36
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/lbxstr.h
@@ -0,0 +1,935 @@
+/* $Xorg: lbxstr.h,v 1.4 2001/02/13 20:14:04 pookie Exp $ */
+/*
+ * Copyright 1992 Network Computing Devices
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of NCD. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. NCD. makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * NCD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NCD.
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+/* $XFree86: xc/include/extensions/lbxstr.h,v 1.2 2001/08/01 00:44:35 tsi Exp $ */
+
+#ifndef _LBXSTR_H_
+#define _LBXSTR_H_
+
+#include <X11/extensions/XLbx.h>
+
+#define LBXNAME "LBX"
+
+#define LBX_MAJOR_VERSION 1
+#define LBX_MINOR_VERSION 0
+
+/*
+ * Redefine some basic types used by structures defined herein. This removes
+ * any possibility on 64-bit architectures of one entity viewing communicated
+ * data as 32-bit quantities and another entity viewing the same data as 64-bit
+ * quantities.
+ */
+#define XID CARD32
+#define Atom CARD32
+#define Colormap CARD32
+#define Drawable CARD32
+#define VisualID CARD32
+#define Window CARD32
+
+typedef struct {
+ BOOL success; /* TRUE */
+ BOOL changeType;
+ CARD16 majorVersion B16,
+ minorVersion B16;
+ CARD16 length B16; /* 1/4 additional bytes in setup info */
+ CARD32 tag B32;
+} xLbxConnSetupPrefix;
+
+typedef struct _LbxQueryVersion {
+ CARD8 reqType; /* always LbxReqCode */
+ CARD8 lbxReqType; /* always X_LbxQueryVersion */
+ CARD16 length B16;
+} xLbxQueryVersionReq;
+#define sz_xLbxQueryVersionReq 4
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 majorVersion B16; /* major version of LBX protocol */
+ CARD16 minorVersion B16; /* minor version of LBX protocol */
+ CARD32 pad0 B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+} xLbxQueryVersionReply;
+#define sz_xLbxQueryVersionReply 32
+
+typedef struct _LbxStartProxy {
+ CARD8 reqType; /* always LbxReqCode */
+ CARD8 lbxReqType; /* always X_LbxStartProxy */
+ CARD16 length B16;
+} xLbxStartProxyReq;
+#define sz_xLbxStartProxyReq 4
+
+typedef struct _LbxStopProxy {
+ CARD8 reqType; /* always LbxReqCode */
+ CARD8 lbxReqType; /* always X_LbxStopProxy */
+ CARD16 length B16;
+} xLbxStopProxyReq;
+#define sz_xLbxStopProxyReq 4
+
+typedef struct _LbxSwitch {
+ CARD8 reqType; /* always LbxReqCode */
+ CARD8 lbxReqType; /* always X_LbxSwitch */
+ CARD16 length B16;
+ CARD32 client B32; /* new client */
+} xLbxSwitchReq;
+#define sz_xLbxSwitchReq 8
+
+typedef struct _LbxNewClient {
+ CARD8 reqType; /* always LbxReqCode */
+ CARD8 lbxReqType; /* always X_LbxNewClient */
+ CARD16 length B16;
+ CARD32 client B32; /* new client */
+} xLbxNewClientReq;
+#define sz_xLbxNewClientReq 8
+
+typedef struct _LbxCloseClient {
+ CARD8 reqType; /* always LbxReqCode */
+ CARD8 lbxReqType; /* always X_LbxCloseClient */
+ CARD16 length B16;
+ CARD32 client B32; /* new client */
+} xLbxCloseClientReq;
+#define sz_xLbxCloseClientReq 8
+
+typedef struct _LbxModifySequence {
+ CARD8 reqType; /* always LbxReqCode */
+ CARD8 lbxReqType; /* always X_LbxModifySequence */
+ CARD16 length B16;
+ CARD32 adjust B32;
+} xLbxModifySequenceReq;
+#define sz_xLbxModifySequenceReq 8
+
+typedef struct _LbxAllowMotion {
+ CARD8 reqType; /* always LbxReqCode */
+ CARD8 lbxReqType; /* always X_LbxAllowMotion */
+ CARD16 length B16;
+ CARD32 num B32;
+} xLbxAllowMotionReq;
+#define sz_xLbxAllowMotionReq 8
+
+typedef struct {
+ CARD8 reqType; /* always LbxReqCode */
+ CARD8 lbxReqType; /* always X_LbxGrabCmap */
+ CARD16 length B16;
+ Colormap cmap B32;
+} xLbxGrabCmapReq;
+#define sz_xLbxGrabCmapReq 8
+
+#define LBX_SMART_GRAB 0x80
+#define LBX_AUTO_RELEASE 0x40
+#define LBX_3CHANNELS 0x20
+#define LBX_2BYTE_PIXELS 0x10
+#define LBX_RGB_BITS_MASK 0x0f
+
+#define LBX_LIST_END 0
+#define LBX_PIXEL_PRIVATE 1
+#define LBX_PIXEL_SHARED 2
+#define LBX_PIXEL_RANGE_PRIVATE 3
+#define LBX_PIXEL_RANGE_SHARED 4
+#define LBX_NEXT_CHANNEL 5
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 flags;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad0 B16;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B16;
+} xLbxGrabCmapReply;
+#define sz_xLbxGrabCmapReply 32
+#define sz_xLbxGrabCmapReplyHdr 8
+
+
+typedef struct {
+ CARD8 reqType; /* always LbxReqCode */
+ CARD8 lbxReqType; /* always X_LbxReleaseCmap */
+ CARD16 length B16;
+ Colormap cmap B32;
+} xLbxReleaseCmapReq;
+#define sz_xLbxReleaseCmapReq 8
+
+typedef struct {
+ CARD8 reqType; /* always LbxReqCode */
+ CARD8 lbxReqType; /* always X_LbxAllocColor */
+ CARD16 length B16;
+ Colormap cmap B32;
+ CARD32 pixel B32;
+ CARD16 red B16, green B16, blue B16;
+ CARD16 pad B16;
+} xLbxAllocColorReq;
+#define sz_xLbxAllocColorReq 20
+
+typedef struct _LbxIncrementPixel {
+ CARD8 reqType; /* always LbxReqCode */
+ CARD8 lbxReqType; /* always X_LbxIncrementPixel */
+ CARD16 length B16;
+ CARD32 cmap B32;
+ CARD32 pixel B32;
+} xLbxIncrementPixelReq;
+#define sz_xLbxIncrementPixelReq 12
+
+typedef struct _LbxDelta {
+ CARD8 reqType; /* always LbxReqCode */
+ CARD8 lbxReqType; /* always X_LbxDelta */
+ CARD16 length B16;
+ CARD8 diffs; /* number of diffs */
+ CARD8 cindex; /* cache index */
+ /* list of diffs follows */
+} xLbxDeltaReq;
+#define sz_xLbxDeltaReq 6
+
+typedef struct _LbxGetModifierMapping {
+ CARD8 reqType; /* always LbxReqCode */
+ CARD8 lbxReqType; /* always X_LbxGetModifierMapping */
+ CARD16 length B16;
+} xLbxGetModifierMappingReq;
+#define sz_xLbxGetModifierMappingReq 4
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 keyspermod;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 tag B32;
+ CARD32 pad0 B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+} xLbxGetModifierMappingReply;
+#define sz_xLbxGetModifierMappingReply 32
+
+typedef struct _LbxGetKeyboardMapping {
+ CARD8 reqType; /* always LbxReqCode */
+ CARD8 lbxReqType; /* always X_LbxGetKeyboardMapping */
+ CARD16 length B16;
+ KeyCode firstKeyCode;
+ CARD8 count;
+ CARD16 pad1 B16;
+} xLbxGetKeyboardMappingReq;
+#define sz_xLbxGetKeyboardMappingReq 8
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 keysperkeycode;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 tag B32;
+ CARD32 pad0 B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+} xLbxGetKeyboardMappingReply;
+#define sz_xLbxGetKeyboardMappingReply 32
+
+typedef struct _LbxQueryFont {
+ CARD8 reqType; /* always LbxReqCode */
+ CARD8 lbxReqType; /* always X_LbxQueryFont */
+ CARD16 length B16;
+ CARD32 fid B32;
+} xLbxQueryFontReq;
+#define sz_xLbxQueryFontReq 8
+
+typedef struct _LbxInternAtoms {
+ CARD8 reqType; /* always LbxReqCode */
+ CARD8 lbxReqType; /* always X_LbxInternAtoms */
+ CARD16 length B16;
+ CARD16 num B16;
+} xLbxInternAtomsReq;
+#define sz_xLbxInternAtomsReq 6
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 atomsStart B32;
+ CARD32 pad0 B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+} xLbxInternAtomsReply;
+#define sz_xLbxInternAtomsReply 32
+#define sz_xLbxInternAtomsReplyHdr 8
+
+
+typedef struct _LbxGetWinAttrAndGeom {
+ CARD8 reqType; /* always LbxReqCode */
+ CARD8 lbxReqType; /* always X_LbxGetWinAttrAndGeom */
+ CARD16 length B16;
+ CARD32 id B32; /* window id */
+} xLbxGetWinAttrAndGeomReq;
+#define sz_xLbxGetWinAttrAndGeomReq 8
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 backingStore;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* NOT 0; this is an extra-large reply */
+ VisualID visualID B32;
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD16 c_class B16;
+#else
+ CARD16 class B16;
+#endif
+ CARD8 bitGravity;
+ CARD8 winGravity;
+ CARD32 backingBitPlanes B32;
+ CARD32 backingPixel B32;
+ BOOL saveUnder;
+ BOOL mapInstalled;
+ CARD8 mapState;
+ BOOL override;
+ Colormap colormap B32;
+ CARD32 allEventMasks B32;
+ CARD32 yourEventMask B32;
+ CARD16 doNotPropagateMask B16;
+ CARD16 pad1 B16;
+ Window root B32;
+ INT16 x B16, y B16;
+ CARD16 width B16, height B16;
+ CARD16 borderWidth B16;
+ CARD8 depth;
+ CARD8 pad2;
+} xLbxGetWinAttrAndGeomReply;
+#define sz_xLbxGetWinAttrAndGeomReply 60
+
+
+typedef struct {
+ CARD8 reqType; /* always LbxReqCode */
+ CARD8 lbxReqType; /* always X_LbxSync */
+ CARD16 length B16;
+} xLbxSyncReq;
+#define sz_xLbxSyncReq 4
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 pad0;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xLbxSyncReply;
+#define sz_xLbxSyncReply 32
+
+
+/* an LBX squished charinfo packs the data in a CARD32 as follows */
+#define LBX_WIDTH_SHIFT 26
+#define LBX_LEFT_SHIFT 20
+#define LBX_RIGHT_SHIFT 13
+#define LBX_ASCENT_SHIFT 7
+#define LBX_DESCENT_SHIFT 0
+
+#define LBX_WIDTH_BITS 6
+#define LBX_LEFT_BITS 6
+#define LBX_RIGHT_BITS 7
+#define LBX_ASCENT_BITS 6
+#define LBX_DESCENT_BITS 7
+
+#define LBX_WIDTH_MASK 0xfc000000
+#define LBX_LEFT_MASK 0x03f00000
+#define LBX_RIGHT_MASK 0x000fe000
+#define LBX_ASCENT_MASK 0x00001f80
+#define LBX_DESCENT_MASK 0x0000007f
+
+#define LBX_MASK_BITS(val, n) ((unsigned int) ((val) & ((1 << (n)) - 1)))
+
+typedef struct {
+ CARD32 metrics B32;
+} xLbxCharInfo;
+
+/* note that this is identical to xQueryFontReply except for missing
+ * first 2 words
+ */
+typedef struct {
+ xCharInfo minBounds;
+/* XXX do we need to leave this gunk? */
+#ifndef WORD64
+ CARD32 walign1 B32;
+#endif
+ xCharInfo maxBounds;
+#ifndef WORD64
+ CARD32 walign2 B32;
+#endif
+ CARD16 minCharOrByte2 B16, maxCharOrByte2 B16;
+ CARD16 defaultChar B16;
+ CARD16 nFontProps B16; /* followed by this many xFontProp structures */
+ CARD8 drawDirection;
+ CARD8 minByte1, maxByte1;
+ BOOL allCharsExist;
+ INT16 fontAscent B16, fontDescent B16;
+ CARD32 nCharInfos B32; /* followed by this many xLbxCharInfo structures */
+} xLbxFontInfo;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 compression;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 tag B32;
+ CARD32 pad0 B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ /* X_QueryFont sticks much of the data in the base reply packet,
+ * but we hope that it won't be needed, (and it won't fit in 32 bytes
+ * with the tag anyways)
+ *
+ * if any additional data is needed, its sent in a xLbxFontInfo
+ */
+} xLbxQueryFontReply;
+#define sz_xLbxQueryFontReply 32
+
+typedef struct _LbxChangeProperty {
+ CARD8 reqType; /* always LbxReqCode */
+ CARD8 lbxReqType; /* always X_LbxChangeProperty */
+ CARD16 length B16;
+ Window window B32;
+ Atom property B32;
+ Atom type B32;
+ CARD8 format;
+ CARD8 mode;
+ BYTE pad[2];
+ CARD32 nUnits B32;
+} xLbxChangePropertyReq;
+#define sz_xLbxChangePropertyReq 24
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 pad;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 tag B32;
+ CARD32 pad0 B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+} xLbxChangePropertyReply;
+#define sz_xLbxChangePropertyReply 32
+
+typedef struct _LbxGetProperty {
+ CARD8 reqType; /* always LbxReqCode */
+ CARD8 lbxReqType; /* always X_LbxGetProperty */
+ CARD16 length B16;
+ Window window B32;
+ Atom property B32;
+ Atom type B32;
+ CARD8 delete;
+ BYTE pad[3];
+ CARD32 longOffset B32;
+ CARD32 longLength B32;
+} xLbxGetPropertyReq;
+#define sz_xLbxGetPropertyReq 28
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 format;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ Atom propertyType B32;
+ CARD32 bytesAfter B32;
+ CARD32 nItems B32;
+ CARD32 tag B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+} xLbxGetPropertyReply;
+#define sz_xLbxGetPropertyReply 32
+
+typedef struct _LbxTagData {
+ CARD8 reqType; /* always LbxReqCode */
+ CARD8 lbxReqType; /* always X_LbxTagData */
+ CARD16 length B16;
+ XID tag B32;
+ CARD32 real_length B32;
+ /* data */
+} xLbxTagDataReq;
+#define sz_xLbxTagDataReq 12
+
+typedef struct _LbxInvalidateTag {
+ CARD8 reqType; /* always LbxReqCode */
+ CARD8 lbxReqType; /* always X_LbxInvalidateTag */
+ CARD16 length B16;
+ CARD32 tag B32;
+} xLbxInvalidateTagReq;
+#define sz_xLbxInvalidateTagReq 8
+
+typedef struct _LbxPutImage {
+ CARD8 reqType; /* always LbxReqCode */
+ CARD8 lbxReqType; /* always X_LbxPutImage */
+ CARD16 length B16;
+ CARD8 compressionMethod;
+ CARD8 cacheEnts;
+ CARD8 bitPacked;
+ /* rest is variable */
+} xLbxPutImageReq;
+#define sz_xLbxPutImageReq 7
+
+typedef struct {
+ CARD8 reqType; /* always LbxReqCode */
+ CARD8 lbxReqType; /* always X_LbxGetImage */
+ CARD16 length B16;
+ Drawable drawable B32;
+ INT16 x B16, y B16;
+ CARD16 width B16, height B16;
+ CARD32 planeMask B32;
+ CARD8 format;
+ CARD8 pad1;
+ CARD16 pad2 B16;
+} xLbxGetImageReq;
+
+#define sz_xLbxGetImageReq 24
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 depth;
+ CARD16 sequenceNumber B16;
+ CARD32 lbxLength B32;
+ CARD32 xLength B32;
+ VisualID visual B32;
+ CARD8 compressionMethod;
+ CARD8 pad1;
+ CARD16 pad2 B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+} xLbxGetImageReply;
+
+#define sz_xLbxGetImageReply 32
+
+/* Following used for LbxPolyPoint, LbxPolyLine, LbxPolySegment,
+ LbxPolyRectangle, LbxPolyArc, LbxPolyFillRectangle and LbxPolyFillArc */
+
+#define GFX_CACHE_SIZE 15
+
+#define GFXdCacheEnt(e) ((e) & 0xf)
+#define GFXgCacheEnt(e) (((e) >> 4) & 0xf)
+#define GFXCacheEnts(d,g) (((d) & 0xf) | (((g) & 0xf) << 4))
+
+#define GFXCacheNone 0xf
+
+typedef struct _LbxPolyPoint {
+ CARD8 reqType; /* always LbxReqCode */
+ CARD8 lbxReqType;
+ CARD16 length B16;
+ CARD8 cacheEnts;
+ CARD8 padBytes;
+} xLbxPolyPointReq;
+
+#define sz_xLbxPolyPointReq 6
+
+typedef xLbxPolyPointReq xLbxPolyLineReq;
+typedef xLbxPolyPointReq xLbxPolySegmentReq;
+typedef xLbxPolyPointReq xLbxPolyRectangleReq;
+typedef xLbxPolyPointReq xLbxPolyArcReq;
+typedef xLbxPolyPointReq xLbxPolyFillRectangleReq;
+typedef xLbxPolyPointReq xLbxPolyFillArcReq;
+
+#define sz_xLbxPolyLineReq sz_xLbxPolyPointReq
+#define sz_xLbxPolySegmentReq sz_xLbxPolyPointReq
+#define sz_xLbxPolyRectangleReq sz_xLbxPolyPointReq
+#define sz_xLbxPolyArcReq sz_xLbxPolyPointReq
+#define sz_xLbxPolyFillRectangleReq sz_xLbxPolyPointReq
+#define sz_xLbxPolyFillArc sz_xLbxPolyPointReq
+
+typedef struct _LbxFillPoly {
+ CARD8 reqType; /* always LbxReqCode */
+ CARD8 lbxReqType;
+ CARD16 length B16;
+ CARD8 cacheEnts;
+ BYTE shape;
+ CARD8 padBytes;
+} xLbxFillPolyReq;
+#define sz_xLbxFillPolyReq 7
+
+typedef struct _LbxCopyArea {
+ CARD8 reqType; /* always LbxReqCode */
+ CARD8 lbxReqType;
+ CARD16 length B16;
+ CARD8 srcCache; /* source drawable */
+ CARD8 cacheEnts; /* dest drawable and gc */
+ /* followed by encoded src x, src y, dst x, dst y, width, height */
+} xLbxCopyAreaReq;
+
+#define sz_xLbxCopyAreaReq 6
+
+typedef struct _LbxCopyPlane {
+ CARD8 reqType; /* always LbxReqCode */
+ CARD8 lbxReqType;
+ CARD16 length B16;
+ CARD32 bitPlane B32;
+ CARD8 srcCache; /* source drawable */
+ CARD8 cacheEnts; /* dest drawable and gc */
+ /* followed by encoded src x, src y, dst x, dst y, width, height */
+} xLbxCopyPlaneReq;
+
+#define sz_xLbxCopyPlaneReq 10
+
+typedef struct _LbxPolyText {
+ CARD8 reqType; /* always LbxReqCode */
+ CARD8 lbxReqType;
+ CARD16 length B16;
+ CARD8 cacheEnts;
+ /* followed by encoded src x, src y coordinates and text elts */
+} xLbxPolyTextReq;
+
+#define sz_xLbxPolyTextReq 5
+
+typedef xLbxPolyTextReq xLbxPolyText8Req;
+typedef xLbxPolyTextReq xLbxPolyText16Req;
+
+#define sz_xLbxPolyTextReq 5
+#define sz_xLbxPolyText8Req 5
+#define sz_xLbxPolyText16Req 5
+
+typedef struct _LbxImageText {
+ CARD8 reqType; /* always LbxReqCode */
+ CARD8 lbxReqType;
+ CARD16 length B16;
+ CARD8 cacheEnts;
+ CARD8 nChars;
+ /* followed by encoded src x, src y coordinates and string */
+} xLbxImageTextReq;
+
+typedef xLbxImageTextReq xLbxImageText8Req;
+typedef xLbxImageTextReq xLbxImageText16Req;
+
+#define sz_xLbxImageTextReq 6
+#define sz_xLbxImageText8Req 6
+#define sz_xLbxImageText16Req 6
+
+typedef struct {
+ CARD8 offset;
+ CARD8 diff;
+} xLbxDiffItem;
+#define sz_xLbxDiffItem 2
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 nOpts;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 optDataStart B32;
+ CARD32 pad0 B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+} xLbxStartReply;
+#define sz_xLbxStartReply 32
+#define sz_xLbxStartReplyHdr 8
+
+typedef struct _LbxQueryExtension {
+ CARD8 reqType; /* always LbxReqCode */
+ CARD8 lbxReqType; /* always X_LbxQueryExtension */
+ CARD16 length B16;
+ CARD32 nbytes B32;
+} xLbxQueryExtensionReq;
+#define sz_xLbxQueryExtensionReq 8
+
+typedef struct _LbxQueryExtensionReply {
+ BYTE type; /* X_Reply */
+ CARD8 numReqs;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ BOOL present;
+ CARD8 major_opcode;
+ CARD8 first_event;
+ CARD8 first_error;
+ CARD32 pad0 B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+
+ /* reply & event generating requests */
+} xLbxQueryExtensionReply;
+#define sz_xLbxQueryExtensionReply 32
+
+
+typedef struct _LbxBeginLargeRequest {
+ CARD8 reqType; /* always LbxReqCode */
+ CARD8 lbxReqType; /* always X_LbxBeginLargeRequest */
+ CARD16 length B16;
+ CARD32 largeReqLength B32;
+} xLbxBeginLargeRequestReq;
+#define sz_BeginLargeRequestReq 8
+
+typedef struct _LbxLargeRequestData {
+ CARD8 reqType; /* always LbxReqCode */
+ CARD8 lbxReqType; /* always X_LbxLargeRequestData */
+ CARD16 length B16;
+ /* followed by LISTofCARD8 data */
+} xLbxLargeRequestDataReq;
+#define sz_LargeRequestDataReq 4
+
+typedef struct _LbxEndLargeRequest {
+ CARD8 reqType; /* always LbxReqCode */
+ CARD8 lbxReqType; /* always X_LbxEndLargeRequest */
+ CARD16 length B16;
+} xLbxEndLargeRequestReq;
+#define sz_EndLargeRequestReq 4
+
+
+
+typedef struct _LbxSwitchEvent {
+ BYTE type; /* always eventBase + LbxEvent */
+ BYTE lbxType; /* LbxSwitchEvent */
+ CARD16 pad B16;
+ CARD32 client B32;
+} xLbxSwitchEvent;
+#define sz_xLbxSwitchEvent 8
+
+typedef struct _LbxCloseEvent {
+ BYTE type; /* always eventBase + LbxEvent */
+ BYTE lbxType; /* LbxCloseEvent */
+ CARD16 sequenceNumber B16;
+ CARD32 client B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xLbxCloseEvent;
+#define sz_xLbxCloseEvent 32
+
+typedef struct _LbxInvalidateTagEvent {
+ BYTE type; /* always eventBase + LbxEvent */
+ BYTE lbxType; /* LbxInvalidateTagEvent */
+ CARD16 sequenceNumber B16;
+ CARD32 tag B32;
+ CARD32 tagType B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+} xLbxInvalidateTagEvent;
+#define sz_xLbxInvalidateTagEvent 32
+
+typedef struct _LbxSendTagDataEvent {
+ BYTE type; /* always eventBase + LbxEvent */
+ BYTE lbxType; /* LbxSendTagDataEvent */
+ CARD16 sequenceNumber B16;
+ CARD32 tag B32;
+ CARD32 tagType B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+} xLbxSendTagDataEvent;
+#define sz_xLbxSendTagDataEvent 32
+
+typedef struct _LbxListenToOneEvent {
+ BYTE type; /* always eventBase + LbxEvent */
+ BYTE lbxType; /* LbxListenToOneEvent */
+ CARD16 sequenceNumber B16;
+ CARD32 client B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xLbxListenToOneEvent;
+#define sz_xLbxListenToOneEvent 32
+
+typedef struct _LbxListenToAllEvent {
+ BYTE type; /* always eventBase + LbxEvent */
+ BYTE lbxType; /* LbxListenToAllEvent */
+ CARD16 sequenceNumber B16;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+} xLbxListenToAllEvent;
+#define sz_xLbxListenToOneEvent 32
+
+typedef struct _LbxReleaseCmapEvent {
+ BYTE type; /* always eventBase + LbxEvent */
+ BYTE lbxType; /* LbxReleaseCmapEvent */
+ CARD16 sequenceNumber B16;
+ Colormap colormap B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xLbxReleaseCmapEvent;
+#define sz_xLbxReleaseCmapEvent 32
+
+
+typedef struct _LbxFreeCellsEvent {
+ BYTE type; /* always eventBase + LbxEvent */
+ BYTE lbxType; /* LbxFreeCellsEvent */
+ CARD16 sequenceNumber B16;
+ Colormap colormap B32;
+ CARD32 pixelStart B32;
+ CARD32 pixelEnd B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+} xLbxFreeCellsEvent;
+#define sz_xLbxFreeCellsEvent 32
+
+
+/*
+ * squished X event sizes. If these change, be sure to update lbxquish.c
+ * and unsquish.c appropriately
+ *
+ * lbxsz_* is the padded squished length
+ * lbxupsz_* is the unpadded squished length
+ */
+
+#define lbxsz_KeyButtonEvent 32
+#define lbxupsz_KeyButtonEvent 31
+
+#define lbxsz_EnterLeaveEvent 32
+#define lbxupsz_EnterLeaveEvent 32
+
+#define lbxsz_FocusEvent 12
+#define lbxupsz_FocusEvent 9
+
+#define lbxsz_KeymapEvent 32
+#define lbxupsz_KeymapEvent 32
+
+#define lbxsz_ExposeEvent 20
+#define lbxupsz_ExposeEvent 18
+
+#define lbxsz_GfxExposeEvent 24
+#define lbxupsz_GfxExposeEvent 21
+
+#define lbxsz_NoExposeEvent 12
+#define lbxupsz_NoExposeEvent 11
+
+#define lbxsz_VisibilityEvent 12
+#define lbxupsz_VisibilityEvent 9
+
+#define lbxsz_CreateNotifyEvent 24
+#define lbxupsz_CreateNotifyEvent 23
+
+#define lbxsz_DestroyNotifyEvent 12
+#define lbxupsz_DestroyNotifyEvent 12
+
+#define lbxsz_UnmapNotifyEvent 16
+#define lbxupsz_UnmapNotifyEvent 13
+
+#define lbxsz_MapNotifyEvent 16
+#define lbxupsz_MapNotifyEvent 13
+
+#define lbxsz_MapRequestEvent 12
+#define lbxupsz_MapRequestEvent 12
+
+#define lbxsz_ReparentEvent 24
+#define lbxupsz_ReparentEvent 21
+
+#define lbxsz_ConfigureNotifyEvent 28
+#define lbxupsz_ConfigureNotifyEvent 27
+
+#define lbxsz_ConfigureRequestEvent 28
+#define lbxupsz_ConfigureRequestEvent 28
+
+#define lbxsz_GravityEvent 16
+#define lbxupsz_GravityEvent 16
+
+#define lbxsz_ResizeRequestEvent 12
+#define lbxupsz_ResizeRequestEvent 12
+
+#define lbxsz_CirculateEvent 20
+#define lbxupsz_CirculateEvent 17
+
+#define lbxsz_PropertyEvent 20
+#define lbxupsz_PropertyEvent 17
+
+#define lbxsz_SelectionClearEvent 16
+#define lbxupsz_SelectionClearEvent 16
+
+#define lbxsz_SelectionRequestEvent 28
+#define lbxupsz_SelectionRequestEvent 28
+
+#define lbxsz_SelectionNotifyEvent 24
+#define lbxupsz_SelectionNotifyEvent 24
+
+#define lbxsz_ColormapEvent 16
+#define lbxupsz_ColormapEvent 14
+
+#define lbxsz_MappingNotifyEvent 8
+#define lbxupsz_MappingNotifyEvent 7
+
+#define lbxsz_ClientMessageEvent 32
+#define lbxupsz_ClientMessageEvent 32
+
+#define lbxsz_UnknownEvent 32
+
+#ifdef DEBUG
+
+#define DBG_SWITCH 0x00000001
+#define DBG_CLOSE 0x00000002
+#define DBG_IO 0x00000004
+#define DBG_READ_REQ 0x00000008
+#define DBG_LEN 0x00000010
+#define DBG_BLOCK 0x00000020
+#define DBG_CLIENT 0x00000040
+#define DBG_DELTA 0x00000080
+
+extern int lbxDebug;
+
+#define DBG(n,m) if (lbxDebug & (n)) { fprintf m; } else
+#else
+#define DBG(n,m)
+#endif
+
+/*
+ * Cancel the previous redefinition of the basic types, thus restoring their
+ * X.h definitions.
+ */
+
+#undef XID
+#undef Atom
+#undef Colormap
+#undef Drawable
+#undef VisualID
+#undef Window
+
+#endif /* _LBXSTR_H_ */
diff --git a/sysroot/usr/include/X11/extensions/lbxzlib.h b/sysroot/usr/include/X11/extensions/lbxzlib.h
new file mode 100644
index 0000000..dc21837
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/lbxzlib.h
@@ -0,0 +1,64 @@
+/* $Xorg: lbxzlib.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */
+/*
+ * Copyright 1993 Network Computing Devices
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of NCD. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. NCD. makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * NCD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NCD.
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Author: Dale Tonogai, Network Computing Devices
+ */
+
+#ifndef _ZLIB_H_
+#define _ZLIB_H_
+
+#define ZLIB_STRCOMP_OPT "XC-ZLIB"
+#define ZLIB_STRCOMP_OPT_LEN 7
+
+#define ZLIB_PACKET_HDRLEN 2
+#define ZLIB_MAX_DATALEN 0xfff
+#define ZLIB_MAX_PLAIN 270
+#define ZLIB_MAX_OUTLEN (ZLIB_MAX_PLAIN << 1)
+
+#define ZLIB_COMPRESS_FLAG 0x80
+#define ZLIB_DATALEN_MASK 0x0f
+
+#define ZLIB_PUT_PKTHDR(p, len, compflag) \
+ { \
+ (p)[0] = ((unsigned)(len)) >> 8 | ((compflag) ? ZLIB_COMPRESS_FLAG : 0);\
+ (p)[1] = (len) & 0xff; \
+ }
+
+#define ZLIB_GET_DATALEN(p) \
+ ((((unsigned)((p)[0] & ZLIB_DATALEN_MASK)) << 8) | (unsigned)(p)[1])
+
+#define ZLIB_COMPRESSED(p) ((p)[0] & ZLIB_COMPRESS_FLAG)
+
+struct ZlibInfo;
+
+extern void * ZlibInit ( int fd, int level );
+extern void ZlibFree ( struct ZlibInfo *comp );
+extern int ZlibFlush ( int fd );
+extern int ZlibStuffInput ( int fd, unsigned char *buffer, int buflen );
+extern void ZlibCompressOn ( int fd );
+extern void ZlibCompressOff ( int fd );
+extern int ZlibWrite ( int fd, unsigned char *buffer, int buflen );
+extern int ZlibWriteV ( int fd, struct iovec *iov, int iovcnt );
+extern int ZlibRead ( int fd, unsigned char *buffer, int buflen );
+extern int ZlibInputAvail ( int fd );
+
+
+#endif /* _ZLIB_H_ */
diff --git a/sysroot/usr/include/X11/extensions/mitmiscstr.h b/sysroot/usr/include/X11/extensions/mitmiscstr.h
new file mode 100644
index 0000000..32cae26
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/mitmiscstr.h
@@ -0,0 +1,70 @@
+/* $XFree86$ */
+/************************************************************
+
+Copyright 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+********************************************************/
+
+/* RANDOM CRUFT! THIS HAS NO OFFICIAL X CONSORTIUM OR X PROJECT TEAM BLESSING */
+
+/* $Xorg: mitmiscstr.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ */
+
+#ifndef _MITMISCSTR_H_
+#define _MITMISCSTR_H_
+
+#include "MITMisc.h"
+
+#define MITMISCNAME "MIT-SUNDRY-NONSTANDARD"
+
+typedef struct _SetBugMode {
+ CARD8 reqType; /* always MITReqCode */
+ CARD8 mitReqType; /* always X_MITSetBugMode */
+ CARD16 length B16;
+ BOOL onOff;
+ BYTE pad0;
+ CARD16 pad1;
+} xMITSetBugModeReq;
+#define sz_xMITSetBugModeReq 8
+
+typedef struct _GetBugMode {
+ CARD8 reqType; /* always MITReqCode */
+ CARD8 mitReqType; /* always X_MITGetBugMode */
+ CARD16 length B16;
+} xMITGetBugModeReq;
+#define sz_xMITGetBugModeReq 4
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BOOL onOff;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad0 B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+} xMITGetBugModeReply;
+#define sz_xMITGetBugModeReply 32
+
+#endif /* _MITMISCSTR_H_ */
diff --git a/sysroot/usr/include/X11/extensions/multibuf.h b/sysroot/usr/include/X11/extensions/multibuf.h
new file mode 100644
index 0000000..96b4c3b
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/multibuf.h
@@ -0,0 +1,317 @@
+/*
+ * $Xorg: multibuf.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $
+ *
+Copyright 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+ */
+
+/* $XFree86: xc/include/extensions/multibuf.h,v 3.4 2001/12/14 19:53:28 dawes Exp $ */
+
+#ifndef _MULTIBUF_H_
+#define _MULTIBUF_H_
+
+#include <X11/Xfuncproto.h>
+
+#define MULTIBUFFER_PROTOCOL_NAME "Multi-Buffering"
+
+#define MULTIBUFFER_MAJOR_VERSION 1 /* current version numbers */
+#define MULTIBUFFER_MINOR_VERSION 1 /* has ClearImageBufferArea */
+
+#define X_MbufGetBufferVersion 0
+#define X_MbufCreateImageBuffers 1
+#define X_MbufDestroyImageBuffers 2
+#define X_MbufDisplayImageBuffers 3
+#define X_MbufSetMBufferAttributes 4
+#define X_MbufGetMBufferAttributes 5
+#define X_MbufSetBufferAttributes 6
+#define X_MbufGetBufferAttributes 7
+#define X_MbufGetBufferInfo 8
+#define X_MbufCreateStereoWindow 9
+#define X_MbufClearImageBufferArea 10
+
+/*
+ * update_action field
+ */
+#define MultibufferUpdateActionUndefined 0
+#define MultibufferUpdateActionBackground 1
+#define MultibufferUpdateActionUntouched 2
+#define MultibufferUpdateActionCopied 3
+
+/*
+ * update_hint field
+ */
+#define MultibufferUpdateHintFrequent 0
+#define MultibufferUpdateHintIntermittent 1
+#define MultibufferUpdateHintStatic 2
+
+/*
+ * valuemask fields
+ */
+#define MultibufferWindowUpdateHint (1L << 0)
+#define MultibufferBufferEventMask (1L << 0)
+
+/*
+ * mono vs. stereo and left vs. right
+ */
+#define MultibufferModeMono 0
+#define MultibufferModeStereo 1
+#define MultibufferSideMono 0
+#define MultibufferSideLeft 1
+#define MultibufferSideRight 2
+
+/*
+ * clobber state
+ */
+#define MultibufferUnclobbered 0
+#define MultibufferPartiallyClobbered 1
+#define MultibufferFullyClobbered 2
+
+/*
+ * event stuff
+ */
+#define MultibufferClobberNotifyMask 0x02000000
+#define MultibufferUpdateNotifyMask 0x04000000
+
+#define MultibufferClobberNotify 0
+#define MultibufferUpdateNotify 1
+#define MultibufferNumberEvents (MultibufferUpdateNotify + 1)
+
+#define MultibufferBadBuffer 0
+#define MultibufferNumberErrors (MultibufferBadBuffer + 1)
+
+
+#ifndef _MULTIBUF_SERVER_
+/*
+ * Extra definitions that will only be needed in the client
+ */
+typedef XID Multibuffer;
+
+typedef struct {
+ int type; /* of event */
+ unsigned long serial; /* # of last request processed by server */
+ int send_event; /* true if this came frome a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Multibuffer buffer; /* buffer of event */
+ int state; /* see Clobbered constants above */
+} XmbufClobberNotifyEvent;
+
+typedef struct {
+ int type; /* of event */
+ unsigned long serial; /* # of last request processed by server */
+ int send_event; /* true if this came frome a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Multibuffer buffer; /* buffer of event */
+} XmbufUpdateNotifyEvent;
+
+
+/*
+ * per-window attributes that can be got
+ */
+typedef struct {
+ int displayed_index; /* which buffer is being displayed */
+ int update_action; /* Undefined, Background, Untouched, Copied */
+ int update_hint; /* Frequent, Intermittent, Static */
+ int window_mode; /* Mono, Stereo */
+ int nbuffers; /* Number of buffers */
+ Multibuffer *buffers; /* Buffers */
+} XmbufWindowAttributes;
+
+/*
+ * per-window attributes that can be set
+ */
+typedef struct {
+ int update_hint; /* Frequent, Intermittent, Static */
+} XmbufSetWindowAttributes;
+
+
+/*
+ * per-buffer attributes that can be got
+ */
+typedef struct {
+ Window window; /* which window this belongs to */
+ unsigned long event_mask; /* events that have been selected */
+ int buffer_index; /* which buffer is this */
+ int side; /* Mono, Left, Right */
+} XmbufBufferAttributes;
+
+/*
+ * per-buffer attributes that can be set
+ */
+typedef struct {
+ unsigned long event_mask; /* events that have been selected */
+} XmbufSetBufferAttributes;
+
+
+/*
+ * per-screen buffer info (there will be lists of them)
+ */
+typedef struct {
+ VisualID visualid; /* visual usuable at this depth */
+ int max_buffers; /* most buffers for this visual */
+ int depth; /* depth of buffers to be created */
+} XmbufBufferInfo;
+
+_XFUNCPROTOBEGIN
+
+extern Bool XmbufQueryExtension(
+ Display* /* dpy */,
+ int* /* event_base_return */,
+ int* /* error_base_return */
+);
+
+extern Status XmbufGetVersion(
+ Display* /* dpy */,
+ int* /* major_version_return */,
+ int* /* minor_version_return */
+);
+
+extern int XmbufCreateBuffers(
+ Display* /* dpy */,
+ Window /* w */,
+ int /* count */,
+ int /* update_action */,
+ int /* update_hint */,
+ Multibuffer* /* buffers */
+);
+
+extern void XmbufDestroyBuffers(
+ Display* /* dpy */,
+ Window /* window */
+);
+
+extern void XmbufDisplayBuffers(
+ Display* /* dpy */,
+ int /* count */,
+ Multibuffer* /* buffers */,
+ int /* min_delay */,
+ int /* max_delay */
+);
+
+extern Status XmbufGetWindowAttributes(
+ Display* /* dpy */,
+ Window /* w */,
+ XmbufWindowAttributes* /* attr */
+);
+
+extern void XmbufChangeWindowAttributes(
+ Display* /* dpy */,
+ Window /* w */,
+ unsigned long /* valuemask */,
+ XmbufSetWindowAttributes* /* attr */
+);
+
+extern Status XmbufGetBufferAttributes(
+ Display* /* dpy */,
+ Multibuffer /* b */,
+ XmbufBufferAttributes* /* attr */
+);
+
+extern void XmbufChangeBufferAttributes(
+ Display* /* dpy */,
+ Multibuffer /* b */,
+ unsigned long /* valuemask */,
+ XmbufSetBufferAttributes* /* attr */
+);
+
+extern Status XmbufGetScreenInfo(
+ Display* /* dpy */,
+ Drawable /* d */,
+ int* /* nmono_return */,
+ XmbufBufferInfo** /* mono_info_return */,
+ int* /* nstereo_return */,
+ XmbufBufferInfo** /* stereo_info_return */
+);
+
+extern Window XmbufCreateStereoWindow(
+ Display* /* dpy */,
+ Window /* parent */,
+ int /* x */,
+ int /* y */,
+ unsigned int /* width */,
+ unsigned int /* height */,
+ unsigned int /* border_width */,
+ int /* depth */,
+ unsigned int /* class */,
+ Visual* /* visual */,
+ unsigned long /* valuemask */,
+ XSetWindowAttributes* /* attr */,
+ Multibuffer* /* leftp */,
+ Multibuffer* /* rightp */
+);
+
+extern void XmbufClearBufferArea(
+ Display* /* dpy */,
+ Multibuffer /* buffer */,
+ int /* x */,
+ int /* y */,
+ unsigned int /* width */,
+ unsigned int /* height */,
+ Bool /* exposures */
+);
+
+_XFUNCPROTOEND
+
+#else
+
+#include "scrnintstr.h"
+
+typedef Bool (* mbInitFunc)();
+
+struct _mbufScreen; /* declared in multibufst.h */
+
+extern void RegisterMultibufferInit(
+ ScreenPtr /* pScreen */,
+ Bool (* /* bufMultibufferInit */)(
+ ScreenPtr /* pScreen */,
+ struct _mbufScreen * /* pMBScreen */
+ )
+);
+
+struct xMbufBufferInfo; /* declared in multibufst.h */
+
+extern void RegisterDoubleBufferHardware(
+ ScreenPtr /* pScreen */,
+ int /* nInfo */,
+ struct xMbufBufferInfo * /* pInfo */,
+ DevUnion * /* frameBuffer */,
+ DevUnion /* selectPlane */,
+ void (* /* CopyBufferBitsFunc */ )(),
+ void (* /* DrawSelectPlaneFunc */ )()
+);
+
+extern int CreateImageBuffers (
+ WindowPtr /* pWin */,
+ int /* nbuf */,
+ XID * /* ids */,
+ int /* action */,
+ int /* hint */
+);
+extern void DestroyImageBuffers (
+ WindowPtr /* pWin */
+);
+extern int DisplayImageBuffers (
+ XID * /* ids */,
+ int /* nbuf */
+);
+
+#endif /* _MULTIBUF_SERVER_ */
+#endif /* _MULTIBUF_H_ */
diff --git a/sysroot/usr/include/X11/extensions/multibufst.h b/sysroot/usr/include/X11/extensions/multibufst.h
new file mode 100644
index 0000000..8469a16
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/multibufst.h
@@ -0,0 +1,609 @@
+/*
+ * $Xorg: multibufst.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $
+ *
+Copyright 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+ */
+
+/* $XFree86: xc/include/extensions/multibufst.h,v 3.8 2001/12/19 21:37:29 dawes Exp $ */
+
+#ifndef _MULTIBUFST_H_
+#define _MULTIBUFST_H_
+
+/*
+ * Protocol requests constants and alignment values
+ */
+
+#include "multibuf.h"
+#ifdef _MULTIBUF_SERVER_
+#include "inputstr.h"
+#endif
+
+#if !defined(UNIXCPP) || defined(ANSICPP)
+#define MbufGetReq(name,req,info) GetReq (name, req); \
+ req->reqType = info->codes->major_opcode; \
+ req->mbufReqType = X_##name;
+#else
+#define MbufGetReq(name,req,info) GetReq (name, req); \
+ req->reqType = info->codes->major_opcode; \
+ req->mbufReqType = X_/**/name;
+#endif
+
+#define Window CARD32
+#define Drawable CARD32
+#define VisualID CARD32
+#define Multibuffer CARD32
+
+typedef struct xMbufBufferInfo {
+ CARD32 visualID B32; /* associated visual */
+ CARD16 maxBuffers B16; /* maximum supported buffers */
+ CARD8 depth; /* depth of visual (redundant) */
+ CARD8 unused;
+} xMbufBufferInfo;
+#define sz_xMbufBufferInfo 8
+
+typedef struct {
+ BYTE type;
+ BYTE unused;
+ CARD16 sequenceNumber B16;
+ CARD32 buffer B32; /* affected buffer */
+ BYTE state; /* current status */
+ CARD8 unused1;
+ CARD16 unused2 B16;
+ CARD32 unused3 B32;
+ CARD32 unused4 B32;
+ CARD32 unused5 B32;
+ CARD32 unused6 B32;
+ CARD32 unused7 B32;
+} xMbufClobberNotifyEvent;
+
+typedef struct {
+ BYTE type;
+ BYTE unused;
+ CARD16 sequenceNumber B16;
+ CARD32 buffer B32; /* affected buffer */
+ CARD32 timeStamp B32; /* update time */
+ CARD32 unused1 B32;
+ CARD32 unused2 B32;
+ CARD32 unused3 B32;
+ CARD32 unused4 B32;
+ CARD32 unused5 B32;
+ CARD32 unused6 B32;
+} xMbufUpdateNotifyEvent;
+
+typedef struct {
+ CARD8 reqType; /* always codes->major_opcode */
+ CARD8 mbufReqType; /* always X_MbufGetBufferVersion */
+ CARD16 length B16;
+} xMbufGetBufferVersionReq;
+#define sz_xMbufGetBufferVersionReq 4
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 majorVersion; /* major version of Multi-Buffering protocol */
+ CARD8 minorVersion; /* minor version of Multi-Buffering protocol */
+ CARD16 pad1 B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xMbufGetBufferVersionReply;
+#define sz_xMbufGetBufferVersionReply 32
+
+typedef struct {
+ CARD8 reqType; /* always codes->major_opcode */
+ CARD8 mbufReqType; /* always X_MbufCreateImageBuffers */
+ CARD16 length B16;
+ CARD32 window B32; /* associated window */
+ CARD8 updateAction; /* action at update */
+ CARD8 updateHint; /* hint as to frequency of updates */
+ CARD16 unused;
+} xMbufCreateImageBuffersReq; /* followed by buffer ids */
+#define sz_xMbufCreateImageBuffersReq 12
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 numberBuffer B16; /* number successfully allocated */
+ CARD16 unused1 B16;
+ CARD32 unused2 B32;
+ CARD32 unused3 B32;
+ CARD32 unused4 B32;
+ CARD32 unused5 B32;
+ CARD32 unused6 B32;
+} xMbufCreateImageBuffersReply;
+#define sz_xMbufCreateImageBuffersReply 32
+
+typedef struct {
+ CARD8 reqType; /* always codes->major_opcode */
+ CARD8 mbufReqType; /* always X_MbufDestroyImageBuffers */
+ CARD16 length B16;
+ CARD32 window B32; /* associated window */
+} xMbufDestroyImageBuffersReq;
+#define sz_xMbufDestroyImageBuffersReq 8
+
+typedef struct {
+ CARD8 reqType; /* always codes->major_opcode */
+ CARD8 mbufReqType; /* always X_MbufDisplayImageBuffers */
+ CARD16 length B16;
+ CARD16 minDelay B16; /* minimum time between last update and now */
+ CARD16 maxDelay B16; /* maximum time between last update and now */
+} xMbufDisplayImageBuffersReq; /* followed by list of buffers */
+#define sz_xMbufDisplayImageBuffersReq 8
+
+typedef struct {
+ CARD8 reqType; /* always codes->major_opcode */
+ CARD8 mbufReqType; /* always X_MbufSetMBufferAttributes */
+ CARD16 length B16;
+ CARD32 window B32; /* associated window */
+ CARD32 valueMask B32; /* modified entries */
+} xMbufSetMBufferAttributesReq; /* followed by values */
+#define sz_xMbufSetMBufferAttributesReq 12
+
+typedef struct {
+ CARD8 reqType; /* always codes->major_opcode */
+ CARD8 mbufReqType; /* always X_MbufGetMBufferAttributes */
+ CARD16 length B16;
+ CARD32 window B32; /* associated window */
+} xMbufGetMBufferAttributesReq;
+#define sz_xMbufGetMBufferAttributesReq 8
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 displayedBuffer B16; /* currently visible buffer */
+ CARD8 updateAction;
+ CARD8 updateHint;
+ CARD8 windowMode;
+ CARD8 unused0;
+ CARD16 unused1 B16;
+ CARD32 unused2 B32;
+ CARD32 unused3 B32;
+ CARD32 unused4 B32;
+ CARD32 unused5 B32;
+} xMbufGetMBufferAttributesReply;
+#define sz_xMbufGetMBufferAttributesReply 32
+
+typedef struct {
+ CARD8 reqType; /* always codes->major_opcode */
+ CARD8 mbufReqType; /* always X_MbufSetBufferAttributes */
+ CARD16 length B16;
+ CARD32 buffer B32;
+ CARD32 valueMask B32;
+} xMbufSetBufferAttributesReq; /* followed by values */
+#define sz_xMbufSetBufferAttributesReq 12
+
+typedef struct {
+ CARD8 reqType; /* always codes->major_opcode */
+ CARD8 mbufReqType; /* always X_MbufGetBufferAttributes */
+ CARD16 length B16;
+ CARD32 buffer B32;
+} xMbufGetBufferAttributesReq;
+#define sz_xMbufGetBufferAttributesReq 8
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 window B32;
+ CARD32 eventMask B32;
+ CARD16 bufferIndex B16;
+ CARD8 side;
+ CARD8 unused0;
+ CARD32 unused1 B32;
+ CARD32 unused2 B32;
+ CARD32 unused3 B32;
+} xMbufGetBufferAttributesReply;
+#define sz_xMbufGetBufferAttributesReply 32
+
+typedef struct {
+ CARD8 reqType; /* always codes->major_opcode */
+ CARD8 mbufReqType; /* always X_MbufGetBufferInfo */
+ CARD16 length B16;
+ Drawable drawable B32;
+} xMbufGetBufferInfoReq;
+#define sz_xMbufGetBufferInfoReq 8
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 normalInfo B16;
+ CARD16 stereoInfo B16;
+ CARD32 unused1 B32;
+ CARD32 unused2 B32;
+ CARD32 unused3 B32;
+ CARD32 unused4 B32;
+ CARD32 unused5 B32;
+} xMbufGetBufferInfoReply; /* followed by buffer infos */
+#define sz_xMbufGetBufferInfoReply 32
+
+
+typedef struct {
+ CARD8 reqType; /* always codes->major_opcode */
+ CARD8 mbufReqType; /* always X_MbufCreateStereoWindow */
+ CARD16 length B16;
+ CARD8 unused0;
+ CARD8 unused1;
+ CARD8 unused2;
+ CARD8 depth;
+ Window wid B32;
+ Window parent B32;
+ Multibuffer left B32; /* associated buffers */
+ Multibuffer right B32;
+ INT16 x B16;
+ INT16 y B16;
+ CARD16 width B16;
+ CARD16 height B16;
+ CARD16 borderWidth B16;
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD16 c_class B16;
+#else
+ CARD16 class B16;
+#endif
+ VisualID visual B32;
+ CARD32 mask B32;
+} xMbufCreateStereoWindowReq; /* followed by value list */
+#define sz_xMbufCreateStereoWindowReq 44
+
+typedef struct {
+ CARD8 reqType; /* always codes->major_opcode */
+ CARD8 mbufReqType; /* always X_MbufClearImageBufferArea */
+ CARD16 length B16;
+ Multibuffer buffer B32;
+ INT16 x B16;
+ INT16 y B16;
+ CARD16 width B16;
+ CARD16 height B16;
+ CARD8 unused0;
+ CARD8 unused1;
+ CARD8 unused2;
+ BOOL exposures;
+} xMbufClearImageBufferAreaReq;
+#define sz_xMbufClearImageBufferAreaReq 20
+
+#undef Window
+#undef Drawable
+#undef VisualID
+#undef Multibuffer
+
+
+#ifdef _MULTIBUF_SERVER_
+/* Macros for wrapping and unwrapping functions */
+
+#define SWAP_FUNC_VECTOR(pSTRUCT1,pSTRUCT2,DATA_TYPE,FUNC_NAME) \
+{ \
+ DATA_TYPE (* tmpFn)(); \
+ \
+ tmpFn = pSTRUCT1->FUNC_NAME; \
+ pSTRUCT1->FUNC_NAME = pSTRUCT2->FUNC_NAME; \
+ pSTRUCT2->FUNC_NAME = tmpFn; \
+}
+
+#if !defined(UNIXCPP) || defined(ANSICPP)
+#define WRAP_SCREEN_FUNC(pSCREEN,pPRIV,FUNC_NAME, PRIV_FUNC_NAME) \
+{ \
+ if ((pPRIV->funcsWrapped & FUNC_NAME##Mask) == 0) \
+ { \
+ pPRIV->FUNC_NAME = pSCREEN->FUNC_NAME; \
+ pSCREEN->FUNC_NAME = PRIV_FUNC_NAME; \
+ pPRIV->funcsWrapped |= FUNC_NAME##Mask; \
+ } \
+}
+
+#define UNWRAP_SCREEN_FUNC(pSCREEN,pPRIV,DATA_TYPE,FUNC_NAME) \
+{ \
+ SWAP_FUNC_VECTOR(pSCREEN,pPRIV,DATA_TYPE,FUNC_NAME); \
+ pPRIV->funcsWrapped &= ~(FUNC_NAME##Mask); \
+}
+
+#define REWRAP_SCREEN_FUNC(pSCREEN,pPRIV,DATA_TYPE,FUNC_NAME) \
+{ \
+ if (MB_SCREEN_PRIV(pSCREEN)->mbufWindowCount) \
+ { \
+ SWAP_FUNC_VECTOR(pSCREEN,pPRIV,DATA_TYPE,FUNC_NAME); \
+ pPRIV->funcsWrapped |= FUNC_NAME##Mask; \
+ } \
+}
+#else
+#define WRAP_SCREEN_FUNC(pSCREEN,pPRIV,FUNC_NAME, PRIV_FUNC_NAME) \
+{ \
+ if ((pPRIV->funcsWrapped & FUNC_NAME/**/Mask) == 0) \
+ { \
+ pPRIV->FUNC_NAME = pSCREEN->FUNC_NAME; \
+ pSCREEN->FUNC_NAME = PRIV_FUNC_NAME; \
+ pPRIV->funcsWrapped |= FUNC_NAME/**/Mask; \
+ } \
+}
+
+#define UNWRAP_SCREEN_FUNC(pSCREEN,pPRIV,DATA_TYPE,FUNC_NAME) \
+{ \
+ SWAP_FUNC_VECTOR(pSCREEN,pPRIV,DATA_TYPE,FUNC_NAME); \
+ pPRIV->funcsWrapped &= ~(FUNC_NAME/**/Mask); \
+}
+
+#define REWRAP_SCREEN_FUNC(pSCREEN,pPRIV,DATA_TYPE,FUNC_NAME) \
+{ \
+ if (MB_SCREEN_PRIV(pSCREEN)->mbufWindowCount) \
+ { \
+ SWAP_FUNC_VECTOR(pSCREEN,pPRIV,DATA_TYPE,FUNC_NAME); \
+ pPRIV->funcsWrapped |= FUNC_NAME/**/Mask; \
+ } \
+}
+#endif
+
+/* The _Multibuffer and _Multibuffers structures below refer to each other,
+ * so we need this forward declaration
+ */
+typedef struct _Multibuffers *MultibuffersPtr;
+
+/*
+ * per-Multibuffer data
+ */
+
+typedef struct _Multibuffer {
+ MultibuffersPtr pMultibuffers; /* associated window data */
+ Mask eventMask; /* MultibufferClobberNotifyMask|ExposureMask|MultibufferUpdateNotifyMask */
+ Mask otherEventMask; /* mask of all other clients event masks */
+ OtherClients *otherClients; /* other clients that want events */
+ int number; /* index of this buffer into array */
+ int side; /* always Mono */
+ int clobber; /* Unclobbered, PartiallyClobbered, FullClobbered */
+ PixmapPtr pPixmap; /* associated pixmap */
+} MultibufferRec, *MultibufferPtr;
+
+/*
+ * per-window data
+ */
+
+typedef struct _Multibuffers {
+ WindowPtr pWindow; /* associated window */
+ int numMultibuffer; /* count of buffers */
+ int refcnt; /* ref count for delete */
+ int displayedMultibuffer; /* currently active buffer */
+ int updateAction; /* Undefined, Background, Untouched, Copied */
+ int updateHint; /* Frequent, Intermittent, Static */
+ int windowMode; /* always Mono */
+
+ TimeStamp lastUpdate; /* time of last update */
+
+ unsigned short width, height; /* last known window size */
+ short x, y; /* for static gravity */
+
+ MultibufferPtr buffers; /* array of numMultibuffer buffers */
+} MultibuffersRec;
+
+/*
+ * per-screen data
+ */
+typedef struct _MultibufferScreen {
+ PositionWindowProcPtr PositionWindow; /* pWin, x,y */
+} MultibufferScreenRec, *MultibufferScreenPtr;
+
+/*
+ * per display-image-buffers request data.
+ */
+
+typedef struct _DisplayRequest {
+ struct _DisplayRequest *next;
+ TimeStamp activateTime;
+ ClientPtr pClient;
+ XID id;
+} DisplayRequestRec, *DisplayRequestPtr;
+
+#define DestroyWindowMask (1L<<0)
+#define PositionWindowMask (1L<<1)
+#define PostValidateTreeMask (1L<<2)
+#define ClipNotifyMask (1L<<3)
+#define WindowExposuresMask (1L<<4)
+#define CopyWindowMask (1L<<5)
+#define ClearToBackgroundMask (1L<<6)
+#define ChangeWindowAttributesMask (1L<<7)
+
+extern int MultibufferScreenIndex;
+extern int MultibufferWindowIndex;
+
+extern RESTYPE MultibufferDrawableResType;
+
+extern void MultibufferUpdate( /* pMbuffer, time */
+ MultibufferPtr /* pMultibuffer */,
+ CARD32 /* time */
+ );
+extern void MultibufferExpose( /* pMbuffer, pRegion */
+ MultibufferPtr /* pMultibuffer */,
+ RegionPtr /* pRegion */
+ );
+extern void MultibufferClobber( /* pMbuffer */
+ MultibufferPtr /* pMultibuffer */
+ );
+
+typedef struct _mbufWindow *mbufWindowPtr;
+
+/*
+ * per-buffer data
+ */
+
+#define MB_DISPLAYED_BUFFER(pMBWindow) \
+ ((pMBWindow)->buffers + (pMBWindow)->displayedMultibuffer)
+
+typedef struct _mbufBuffer {
+ mbufWindowPtr pMBWindow; /* associated window data */
+ Mask eventMask; /* client event mask */
+ Mask otherEventMask; /* union of other clients' event masks */
+ OtherClientsPtr otherClients; /* other clients that want events */
+ int number; /* index of this buffer into array */
+ int side; /* stero side: always Mono */
+ int clobber; /* clober state */
+ DrawablePtr pDrawable; /* associated drawable */
+} mbufBufferRec, *mbufBufferPtr;
+
+
+/*
+ * per-window data
+ */
+
+#define MB_WINDOW_PRIV(pWin) \
+ ((mbufWindowPtr)((pWin)->devPrivates[MultibufferWindowIndex].ptr))
+
+typedef struct _mbufWindow {
+ WindowPtr pWindow; /* associated window */
+ int numMultibuffer; /* count of buffers */
+ mbufBufferPtr buffers; /* array of (numMultibuffer) buffers */
+ int displayedMultibuffer; /* currently active buffer */
+ int updateAction; /* Undefined, Background,
+ Untouched, Copied */
+ int updateHint; /* Frequent, Intermittent, Static */
+ int windowMode; /* always Mono */
+ TimeStamp lastUpdate; /* time of last update */
+ short x, y; /* for static gravity */
+ unsigned short width, height; /* last known window size */
+ DevUnion devPrivate;
+} mbufWindowRec;
+
+
+/*
+ * per-screen data
+ */
+
+#define MB_SCREEN_PRIV(pScreen) \
+ ((mbufScreenPtr)((pScreen)->devPrivates[MultibufferScreenIndex].ptr))
+
+typedef struct _mbufScreen {
+ long mbufWindowCount; /* count of multibuffered windows */
+
+ /* Wrap pScreen->DestroyWindow */
+ DestroyWindowProcPtr DestroyWindow;
+ long funcsWrapped; /* flags which functions are wrapped */
+
+ /* Initialized by device-dependent section */
+ int nInfo; /* number of buffer info rec's */
+ xMbufBufferInfo *pInfo; /* buffer info (for Normal buffers) */
+
+ int (* CreateImageBuffers)(
+ WindowPtr /* pWin */,
+ int /* nbuf */,
+ XID * /* ids */,
+ int /* action */,
+ int /* hint */
+ );
+ void (* DestroyImageBuffers)(
+ WindowPtr /* pWin */
+ );
+ void (* DisplayImageBuffers)(
+ ScreenPtr /* pScreen */,
+ mbufBufferPtr * /* ppMBBuffer */,
+ mbufWindowPtr * /* ppMBWindow */,
+ int /* nbuf */
+ );
+ void (* ClearImageBufferArea)(
+ mbufBufferPtr /* pMBBuffer */,
+ short /* x */,
+ short /* y */,
+ unsigned short /* width */,
+ unsigned short /* height */,
+ Bool /* exposures */
+ );
+ Bool (* ChangeMBufferAttributes)( /* pMBWindow, vmask */
+ /* FIXME */
+ );
+ Bool (* ChangeBufferAttributes)( /* pMBBuffer, vmask */
+ /* FIXME */
+ );
+ void (* DeleteBufferDrawable)(
+ DrawablePtr /* pDrawable */
+ );
+ void (* WrapScreenFuncs)(
+ ScreenPtr /* pScreen */
+ );
+ void (* ResetProc)(
+ ScreenPtr /* pScreen */
+ );
+ DevUnion devPrivate;
+} mbufScreenRec, *mbufScreenPtr;
+
+
+/* Privates to mbufScreenRec */
+
+#ifdef _MULTIBUF_PIXMAP_
+#define MB_SCREEN_PRIV_PIXMAP(pScreen) \
+ ((mbufPixmapPrivPtr) MB_SCREEN_PRIV((pScreen))->devPrivate.ptr)
+
+typedef struct _mbufPixmapPriv
+{
+ /* Pointers to wrapped functions */
+ PositionWindowProcPtr PositionWindow; /* pWin, x,y */
+ long funcsWrapped; /* flags which functions are wrapped */
+} mbufPixmapPrivRec, *mbufPixmapPrivPtr;
+#endif /* _MULTIBUF_PIXMAP_ */
+
+
+#ifdef _MULTIBUF_BUFFER_
+
+extern int frameWindowPrivateIndex;
+
+#define MB_SCREEN_PRIV_BUFFER(pScreen) \
+ ((mbufBufferPrivPtr) MB_SCREEN_PRIV((pScreen))->devPrivate.ptr)
+
+typedef struct _mbufBufferPriv
+{
+ DevUnion *frameBuffer; /* Array of screen framebuffers */
+ DevUnion selectPlane; /* Plane(s) that select displayed buffer */
+
+ /*
+ * Note: subtractRgn and unionRgn may overlap. subtractRgn is a union
+ * of all the old clipLists of the windows that are displaying
+ * the backbuffer. unionRgn is the union of all the new clipLists
+ * of the same windows.
+ */
+
+ RegionRec backBuffer; /* Area of screen displaying back buffer */
+ RegionRec subtractRgn; /* Regions lost to backBuffer */
+ RegionRec unionRgn; /* Regions gained by backBuffer */
+ Bool rgnChanged; /* TRUE if "backBuffer" needs to be updated */
+
+ void (* CopyBufferBits)(); /* pMBWindow, srcBufferNum, dstBufferNum */
+ void (* DrawSelectPlane)(); /* pScreen, selectPlane, pRegion, bufferNum */
+
+ /* Pointers to wrapped functions */
+ PostValidateTreeProcPtr PostValidateTree; /* pParent, pChild, kind */
+ ClipNotifyProcPtr ClipNotify; /* pWin, dx, dy */
+ WindowExposuresProcPtr WindowExposures; /* pWin, pRegion */
+ CopyWindowProcPtr CopyWindow; /* pWin, oldPt, pOldRegion */
+ ClearToBackgroundProcPtr ClearToBackground; /* pWin, x,y,w,h, sendExpose */
+ ChangeWindowAttributesProcPtr ChangeWindowAttributes; /* pWin, vmask */
+ long funcsWrapped; /* flags which functions are wrapped */
+ unsigned inClearToBackground:1; /* used by WindowExposure */
+} mbufBufferPrivRec, *mbufBufferPrivPtr;
+#endif /* _MULTIBUF_BUFFER_ */
+
+#endif /* _MULTIBUF_SERVER_ */
+#endif /* _MULTIBUFST_H_ */
diff --git a/sysroot/usr/include/X11/extensions/security.h b/sysroot/usr/include/X11/extensions/security.h
new file mode 100644
index 0000000..188ad55
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/security.h
@@ -0,0 +1,195 @@
+/* $Xorg: security.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ */
+/*
+Copyright 1996, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from The Open Group.
+*/
+/* $XFree86: xc/include/extensions/security.h,v 1.3 2001/12/14 19:53:29 dawes Exp $ */
+
+#ifndef _SECURITY_H
+#define _SECURITY_H
+
+#define _XAUTH_STRUCT_ONLY
+#include <X11/Xauth.h>
+
+/* constants that server, library, and application all need */
+
+#define XSecurityNumberEvents 1
+#define XSecurityNumberErrors 2
+#define XSecurityBadAuthorization 0
+#define XSecurityBadAuthorizationProtocol 1
+
+/* trust levels */
+#define XSecurityClientTrusted 0
+#define XSecurityClientUntrusted 1
+
+/* authorization attribute masks */
+#define XSecurityTimeout (1<<0)
+#define XSecurityTrustLevel (1<<1)
+#define XSecurityGroup (1<<2)
+#define XSecurityEventMask (1<<3)
+#define XSecurityAllAuthorizationAttributes \
+ (XSecurityTimeout | XSecurityTrustLevel | XSecurityGroup | XSecurityEventMask)
+
+/* event masks */
+#define XSecurityAuthorizationRevokedMask (1<<0)
+#define XSecurityAllEventMasks XSecurityAuthorizationRevokedMask
+
+/* event offsets */
+#define XSecurityAuthorizationRevoked 0
+
+#define XSecurityAuthorizationName "XC-QUERY-SECURITY-1"
+#define XSecurityAuthorizationNameLen 19
+
+
+#ifndef _SECURITY_SERVER
+
+_XFUNCPROTOBEGIN
+
+Status XSecurityQueryExtension (
+ Display *dpy,
+ int *major_version_return,
+ int *minor_version_return);
+
+Xauth *XSecurityAllocXauth(void);
+
+void XSecurityFreeXauth(Xauth *auth);
+
+/* type for returned auth ids */
+typedef unsigned long XSecurityAuthorization;
+
+typedef struct {
+ unsigned int timeout;
+ unsigned int trust_level;
+ XID group;
+ long event_mask;
+} XSecurityAuthorizationAttributes;
+
+Xauth *XSecurityGenerateAuthorization(
+ Display *dpy,
+ Xauth *auth_in,
+ unsigned long valuemask,
+ XSecurityAuthorizationAttributes *attributes,
+ XSecurityAuthorization *auth_id_return);
+
+Status XSecurityRevokeAuthorization(
+ Display *dpy,
+ XSecurityAuthorization auth_id);
+
+_XFUNCPROTOEND
+
+typedef struct {
+ int type; /* event base + XSecurityAuthorizationRevoked */
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ XSecurityAuthorization auth_id; /* revoked authorization id */
+} XSecurityAuthorizationRevokedEvent;
+
+#else /* _SECURITY_SERVER */
+
+#include "input.h" /* for DeviceIntPtr */
+#include "property.h" /* for PropertyPtr */
+#include "pixmap.h" /* for DrawablePtr */
+#include "resource.h" /* for RESTYPE */
+
+/* resource type to pass in LookupIDByType for authorizations */
+extern RESTYPE SecurityAuthorizationResType;
+
+/* this is what we store for an authorization */
+typedef struct {
+ XID id; /* resource ID */
+ CARD32 timeout; /* how long to live in seconds after refcnt == 0 */
+ unsigned int trustLevel; /* trusted/untrusted */
+ XID group; /* see embedding extension */
+ unsigned int refcnt; /* how many clients connected with this auth */
+ unsigned int secondsRemaining; /* overflow time amount for >49 days */
+ OsTimerPtr timer; /* timer for this auth */
+ struct _OtherClients *eventClients; /* clients wanting events */
+} SecurityAuthorizationRec, *SecurityAuthorizationPtr;
+
+/* The following callback is called when a GenerateAuthorization request
+ * is processed to sanity check the group argument. The call data will
+ * be a pointer to a SecurityValidateGroupInfoRec (below).
+ * Functions registered on this callback are expected to examine the
+ * group and set the valid field to TRUE if they recognize the group as a
+ * legitimate group. If they don't recognize it, they should not change the
+ * valid field.
+ */
+extern CallbackListPtr SecurityValidateGroupCallback;
+typedef struct {
+ XID group; /* the group that was sent in GenerateAuthorization */
+ Bool valid; /* did anyone recognize it? if so, set to TRUE */
+} SecurityValidateGroupInfoRec;
+
+/* Proc vectors for untrusted clients, swapped and unswapped versions.
+ * These are the same as the normal proc vectors except that extensions
+ * that haven't declared themselves secure will have ProcBadRequest plugged
+ * in for their major opcode dispatcher. This prevents untrusted clients
+ * from guessing extension major opcodes and using the extension even though
+ * the extension can't be listed or queried.
+ */
+extern int (*UntrustedProcVector[256])(ClientPtr client);
+extern int (*SwappedUntrustedProcVector[256])(ClientPtr client);
+
+extern Bool SecurityCheckDeviceAccess(ClientPtr client, DeviceIntPtr dev,
+ Bool fromRequest);
+
+extern void SecurityAudit(char *format, ...);
+
+#ifdef LBX
+extern Bool SecuritySameLevel(ClientPtr client, XID authId);
+#endif
+
+extern int XSecurityOptions(int argc, char **argv, int i);
+
+/* Give this value or higher to the -audit option to get security messages */
+#define SECURITY_AUDIT_LEVEL 4
+
+extern void SecurityCensorImage(
+ ClientPtr client,
+ RegionPtr pVisibleRegion,
+ long widthBytesLine,
+ DrawablePtr pDraw,
+ int x, int y, int w, int h,
+ unsigned int format,
+ char * pBuf);
+
+#define SecurityAllowOperation 0
+#define SecurityIgnoreOperation 1
+#define SecurityErrorOperation 2
+
+char
+SecurityCheckPropertyAccess(
+ ClientPtr client,
+ WindowPtr pWin,
+ ATOM propertyName,
+ Mask access_mode);
+
+#define SECURITY_POLICY_FILE_VERSION "version-1"
+
+char **SecurityGetSitePolicyStrings(int *n);
+
+#endif /* _SECURITY_SERVER */
+
+#endif /* _SECURITY_H */
diff --git a/sysroot/usr/include/X11/extensions/securstr.h b/sysroot/usr/include/X11/extensions/securstr.h
new file mode 100644
index 0000000..50c7644
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/securstr.h
@@ -0,0 +1,116 @@
+/* $Xorg: securstr.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ */
+/*
+Copyright 1996, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from The Open Group.
+*/
+/* $XFree86: xc/include/extensions/securstr.h,v 1.2 2001/08/01 00:44:35 tsi Exp $ */
+
+#ifndef _SECURSTR_H
+#define _SECURSTR_H
+
+#include <X11/extensions/security.h>
+
+#define SECURITY_EXTENSION_NAME "SECURITY"
+#define SECURITY_MAJOR_VERSION 1
+#define SECURITY_MINOR_VERSION 0
+
+#define X_SecurityQueryVersion 0
+#define X_SecurityGenerateAuthorization 1
+#define X_SecurityRevokeAuthorization 2
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 securityReqType;
+ CARD16 length B16;
+ CARD16 majorVersion B16;
+ CARD16 minorVersion B16;
+} xSecurityQueryVersionReq;
+#define sz_xSecurityQueryVersionReq 8
+
+typedef struct {
+ CARD8 type;
+ CARD8 pad0;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 majorVersion B16;
+ CARD16 minorVersion B16;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ } xSecurityQueryVersionReply;
+#define sz_xSecurityQueryVersionReply 32
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 securityReqType;
+ CARD16 length B16;
+ CARD16 nbytesAuthProto B16;
+ CARD16 nbytesAuthData B16;
+ CARD32 valueMask B32;
+ /* auth protocol name padded to 4 bytes */
+ /* auth protocol data padded to 4 bytes */
+ /* list of CARD32 values, if any */
+} xSecurityGenerateAuthorizationReq;
+#define sz_xSecurityGenerateAuthorizationReq 12
+
+typedef struct {
+ CARD8 type;
+ CARD8 pad0;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 authId B32;
+ CARD16 dataLength B16;
+ CARD16 pad1 B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ } xSecurityGenerateAuthorizationReply;
+#define sz_xSecurityGenerateAuthorizationReply 32
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 securityReqType;
+ CARD16 length B16;
+ CARD32 authId B32;
+} xSecurityRevokeAuthorizationReq;
+#define sz_xSecurityRevokeAuthorizationReq 8
+
+typedef struct _xSecurityAuthorizationRevokedEvent {
+ BYTE type;
+ BYTE detail;
+ CARD16 sequenceNumber B16;
+ CARD32 authId B32;
+ CARD32 pad0 B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+} xSecurityAuthorizationRevokedEvent;
+#define sz_xSecurityAuthorizationRevokedEvent 32
+
+#endif /* _SECURSTR_H */
diff --git a/sysroot/usr/include/X11/extensions/shape.h b/sysroot/usr/include/X11/extensions/shape.h
new file mode 100644
index 0000000..d173efe
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/shape.h
@@ -0,0 +1,180 @@
+/* $XFree86: xc/include/extensions/shape.h,v 1.3 2001/12/14 19:53:29 dawes Exp $ */
+/************************************************************
+
+Copyright 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+********************************************************/
+
+/* $Xorg: shape.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ */
+
+#ifndef _SHAPE_H_
+#define _SHAPE_H_
+
+#include <X11/Xfuncproto.h>
+
+#define X_ShapeQueryVersion 0
+#define X_ShapeRectangles 1
+#define X_ShapeMask 2
+#define X_ShapeCombine 3
+#define X_ShapeOffset 4
+#define X_ShapeQueryExtents 5
+#define X_ShapeSelectInput 6
+#define X_ShapeInputSelected 7
+#define X_ShapeGetRectangles 8
+
+#define ShapeSet 0
+#define ShapeUnion 1
+#define ShapeIntersect 2
+#define ShapeSubtract 3
+#define ShapeInvert 4
+
+#define ShapeBounding 0
+#define ShapeClip 1
+#define ShapeInput 2
+
+#define ShapeNotifyMask (1L << 0)
+#define ShapeNotify 0
+
+#define ShapeNumberEvents (ShapeNotify + 1)
+
+#ifndef _SHAPE_SERVER_
+
+#include <X11/Xutil.h>
+
+typedef struct {
+ int type; /* of event */
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came frome a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window; /* window of event */
+ int kind; /* ShapeBounding or ShapeClip */
+ int x, y; /* extents of new region */
+ unsigned width, height;
+ Time time; /* server timestamp when region changed */
+ Bool shaped; /* true if the region exists */
+} XShapeEvent;
+
+_XFUNCPROTOBEGIN
+
+extern Bool XShapeQueryExtension (
+ Display* /* display */,
+ int* /* event_base */,
+ int* /* error_base */
+);
+
+extern Status XShapeQueryVersion (
+ Display* /* display */,
+ int* /* major_version */,
+ int* /* minor_version */
+);
+
+extern void XShapeCombineRegion (
+ Display* /* display */,
+ Window /* dest */,
+ int /* dest_kind */,
+ int /* x_off */,
+ int /* y_off */,
+ Region /* region */,
+ int /* op */
+);
+
+extern void XShapeCombineRectangles (
+ Display* /* display */,
+ Window /* dest */,
+ int /* dest_kind */,
+ int /* x_off */,
+ int /* y_off */,
+ XRectangle* /* rectangles */,
+ int /* n_rects */,
+ int /* op */,
+ int /* ordering */
+);
+
+extern void XShapeCombineMask (
+ Display* /* display */,
+ Window /* dest */,
+ int /* dest_kind */,
+ int /* x_off */,
+ int /* y_off */,
+ Pixmap /* src */,
+ int /* op */
+);
+
+extern void XShapeCombineShape (
+ Display* /* display */,
+ Window /* dest */,
+ int /* dest_kind */,
+ int /* x_off */,
+ int /* y_off */,
+ Window /* src */,
+ int /* src_kind */,
+ int /* op */
+);
+
+extern void XShapeOffsetShape (
+ Display* /* display */,
+ Window /* dest */,
+ int /* dest_kind */,
+ int /* x_off */,
+ int /* y_off */
+);
+
+extern Status XShapeQueryExtents (
+ Display* /* display */,
+ Window /* window */,
+ Bool* /* bounding_shaped */,
+ int* /* x_bounding */,
+ int* /* y_bounding */,
+ unsigned int* /* w_bounding */,
+ unsigned int* /* h_bounding */,
+ Bool* /* clip_shaped */,
+ int* /* x_clip */,
+ int* /* y_clip */,
+ unsigned int* /* w_clip */,
+ unsigned int* /* h_clip */
+);
+
+extern void XShapeSelectInput (
+ Display* /* display */,
+ Window /* window */,
+ unsigned long /* mask */
+);
+
+extern unsigned long XShapeInputSelected (
+ Display* /* display */,
+ Window /* window */
+);
+
+extern XRectangle *XShapeGetRectangles (
+ Display* /* display */,
+ Window /* window */,
+ int /* kind */,
+ int* /* count */,
+ int* /* ordering */
+);
+
+_XFUNCPROTOEND
+
+#endif /* _SHAPE_SERVER_ */
+
+#endif /* _SHAPE_H_ */
diff --git a/sysroot/usr/include/X11/extensions/shapestr.h b/sysroot/usr/include/X11/extensions/shapestr.h
new file mode 100644
index 0000000..4742ba8
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/shapestr.h
@@ -0,0 +1,234 @@
+/************************************************************
+
+Copyright 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+********************************************************/
+
+/* $Xorg: shapestr.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ */
+
+#ifndef _SHAPESTR_H_
+#define _SHAPESTR_H_
+
+/*
+ * Protocol requests constants and alignment values
+ * These would really be in SHAPE's X.h and Xproto.h equivalents
+ */
+
+#include "shape.h"
+
+#define Window CARD32
+#define Time CARD32
+
+#define SHAPENAME "SHAPE"
+
+#define SHAPE_MAJOR_VERSION 1 /* current version numbers */
+#define SHAPE_MINOR_VERSION 1
+
+typedef struct _ShapeQueryVersion {
+ CARD8 reqType; /* always ShapeReqCode */
+ CARD8 shapeReqType; /* always X_ShapeQueryVersion */
+ CARD16 length B16;
+} xShapeQueryVersionReq;
+#define sz_xShapeQueryVersionReq 4
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 majorVersion B16; /* major version of SHAPE protocol */
+ CARD16 minorVersion B16; /* minor version of SHAPE protocol */
+ CARD32 pad0 B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+} xShapeQueryVersionReply;
+#define sz_xShapeQueryVersionReply 32
+
+typedef struct _ShapeRectangles {
+ CARD8 reqType; /* always ShapeReqCode */
+ CARD8 shapeReqType; /* always X_ShapeRectangles */
+ CARD16 length B16;
+ CARD8 op; /* Set, ... */
+ CARD8 destKind; /* ShapeBounding or ShapeClip */
+ CARD8 ordering; /* UnSorted, YSorted, YXSorted, YXBanded */
+ CARD8 pad0; /* not used */
+ Window dest B32;
+ INT16 xOff B16;
+ INT16 yOff B16;
+} xShapeRectanglesReq; /* followed by xRects */
+#define sz_xShapeRectanglesReq 16
+
+typedef struct _ShapeMask {
+ CARD8 reqType; /* always ShapeReqCode */
+ CARD8 shapeReqType; /* always X_ShapeMask */
+ CARD16 length B16;
+
+ CARD8 op; /* Set, ... */
+ CARD8 destKind; /* ShapeBounding or ShapeClip */
+ CARD16 junk B16; /* not used */
+
+ Window dest B32;
+ INT16 xOff B16;
+ INT16 yOff B16;
+ CARD32 src B32; /* 1 bit pixmap */
+} xShapeMaskReq;
+#define sz_xShapeMaskReq 20
+
+typedef struct _ShapeCombine {
+ CARD8 reqType; /* always ShapeReqCode */
+ CARD8 shapeReqType; /* always X_ShapeCombine */
+ CARD16 length B16;
+ CARD8 op; /* Set, ... */
+ CARD8 destKind; /* ShapeBounding or ShapeClip */
+ CARD8 srcKind; /* ShapeBounding or ShapeClip */
+ CARD8 junk; /* not used */
+ Window dest B32;
+ INT16 xOff B16;
+ INT16 yOff B16;
+ Window src B32;
+} xShapeCombineReq;
+#define sz_xShapeCombineReq 20
+
+typedef struct _ShapeOffset {
+ CARD8 reqType; /* always ShapeReqCode */
+ CARD8 shapeReqType; /* always X_ShapeOffset */
+ CARD16 length B16;
+ CARD8 destKind; /* ShapeBounding or ShapeClip */
+ CARD8 junk1; /* not used */
+ CARD16 junk2 B16; /* not used */
+ Window dest B32;
+ INT16 xOff B16;
+ INT16 yOff B16;
+} xShapeOffsetReq;
+#define sz_xShapeOffsetReq 16
+
+typedef struct _ShapeQueryExtents {
+ CARD8 reqType; /* always ShapeReqCode */
+ CARD8 shapeReqType; /* always X_ShapeQueryExtents */
+ CARD16 length B16;
+ Window window B32;
+} xShapeQueryExtentsReq;
+#define sz_xShapeQueryExtentsReq 8
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ CARD8 boundingShaped; /* window has bounding shape */
+ CARD8 clipShaped; /* window has clip shape */
+ CARD16 unused1 B16;
+ INT16 xBoundingShape B16; /* extents of bounding shape */
+ INT16 yBoundingShape B16;
+ CARD16 widthBoundingShape B16;
+ CARD16 heightBoundingShape B16;
+ INT16 xClipShape B16; /* extents of clip shape */
+ INT16 yClipShape B16;
+ CARD16 widthClipShape B16;
+ CARD16 heightClipShape B16;
+ CARD32 pad1 B32;
+} xShapeQueryExtentsReply;
+#define sz_xShapeQueryExtentsReply 32
+
+typedef struct _ShapeSelectInput {
+ CARD8 reqType; /* always ShapeReqCode */
+ CARD8 shapeReqType; /* always X_ShapeSelectInput */
+ CARD16 length B16;
+ Window window B32;
+ BYTE enable; /* xTrue -> send events */
+ BYTE pad1;
+ CARD16 pad2 B16;
+} xShapeSelectInputReq;
+#define sz_xShapeSelectInputReq 12
+
+typedef struct _ShapeNotify {
+ BYTE type; /* always eventBase + ShapeNotify */
+ BYTE kind; /* either ShapeBounding or ShapeClip */
+ CARD16 sequenceNumber B16;
+ Window window B32;
+ INT16 x B16;
+ INT16 y B16; /* extents of new shape */
+ CARD16 width B16;
+ CARD16 height B16;
+ Time time B32; /* time of change */
+ BYTE shaped; /* set when a shape actual exists */
+ BYTE pad0;
+ CARD16 pad1 B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+} xShapeNotifyEvent;
+#define sz_xShapeNotifyEvent 32
+
+typedef struct _ShapeInputSelected {
+ CARD8 reqType; /* always ShapeReqCode */
+ CARD8 shapeReqType; /* always X_ShapeInputSelected */
+ CARD16 length B16;
+ Window window B32;
+} xShapeInputSelectedReq;
+#define sz_xShapeInputSelectedReq 8
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 enabled; /* current status */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ CARD32 pad1 B32; /* unused */
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xShapeInputSelectedReply;
+#define sz_xShapeInputSelectedReply 32
+
+typedef struct _ShapeGetRectangles {
+ CARD8 reqType; /* always ShapeReqCode */
+ CARD8 shapeReqType; /* always X_ShapeGetRectangles */
+ CARD16 length B16;
+ Window window B32;
+ CARD8 kind; /* ShapeBounding or ShapeClip */
+ CARD8 junk1;
+ CARD16 junk2 B16;
+} xShapeGetRectanglesReq;
+#define sz_xShapeGetRectanglesReq 12
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 ordering; /* UnSorted, YSorted, YXSorted, YXBanded */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* not zero */
+ CARD32 nrects B32; /* number of rectangles */
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+} xShapeGetRectanglesReply; /* followed by xRectangles */
+#define sz_xShapeGetRectanglesReply 32
+
+#undef Window
+#undef Time
+
+#endif /* _SHAPESTR_H_ */
diff --git a/sysroot/usr/include/X11/extensions/shmstr.h b/sysroot/usr/include/X11/extensions/shmstr.h
new file mode 100644
index 0000000..b15538d
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/shmstr.h
@@ -0,0 +1,217 @@
+/* $XFree86: xc/include/extensions/shmstr.h,v 3.3 2001/12/14 19:53:29 dawes Exp $ */
+/************************************************************
+
+Copyright 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+********************************************************/
+
+/* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */
+
+#ifndef _SHMSTR_H_
+#define _SHMSTR_H_
+
+/* $Xorg: shmstr.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ */
+
+#include "XShm.h"
+
+#define ShmSeg CARD32
+#define Drawable CARD32
+#define VisualID CARD32
+#define GContext CARD32
+#define Pixmap CARD32
+
+#define SHMNAME "MIT-SHM"
+
+#define SHM_MAJOR_VERSION 1 /* current version numbers */
+#define SHM_MINOR_VERSION 1
+
+#ifdef _XSHM_SERVER_
+#define XSHM_PUT_IMAGE_ARGS \
+ DrawablePtr /* dst */, \
+ GCPtr /* pGC */, \
+ int /* depth */, \
+ unsigned int /* format */, \
+ int /* w */, \
+ int /* h */, \
+ int /* sx */, \
+ int /* sy */, \
+ int /* sw */, \
+ int /* sh */, \
+ int /* dx */, \
+ int /* dy */, \
+ char * /* data */
+
+#define XSHM_CREATE_PIXMAP_ARGS \
+ ScreenPtr /* pScreen */, \
+ int /* width */, \
+ int /* height */, \
+ int /* depth */, \
+ char * /* addr */
+
+typedef struct _ShmFuncs {
+ PixmapPtr (* CreatePixmap)(XSHM_CREATE_PIXMAP_ARGS);
+ void (* PutImage)(XSHM_PUT_IMAGE_ARGS);
+} ShmFuncs, *ShmFuncsPtr;
+#endif
+
+typedef struct _ShmQueryVersion {
+ CARD8 reqType; /* always ShmReqCode */
+ CARD8 shmReqType; /* always X_ShmQueryVersion */
+ CARD16 length B16;
+} xShmQueryVersionReq;
+#define sz_xShmQueryVersionReq 4
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BOOL sharedPixmaps;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 majorVersion B16; /* major version of SHM protocol */
+ CARD16 minorVersion B16; /* minor version of SHM protocol */
+ CARD16 uid B16;
+ CARD16 gid B16;
+ CARD8 pixmapFormat;
+ CARD8 pad0;
+ CARD16 pad1 B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+} xShmQueryVersionReply;
+#define sz_xShmQueryVersionReply 32
+
+typedef struct _ShmAttach {
+ CARD8 reqType; /* always ShmReqCode */
+ CARD8 shmReqType; /* always X_ShmAttach */
+ CARD16 length B16;
+ ShmSeg shmseg B32;
+ CARD32 shmid B32;
+ BOOL readOnly;
+ BYTE pad0;
+ CARD16 pad1 B16;
+} xShmAttachReq;
+#define sz_xShmAttachReq 16
+
+typedef struct _ShmDetach {
+ CARD8 reqType; /* always ShmReqCode */
+ CARD8 shmReqType; /* always X_ShmDetach */
+ CARD16 length B16;
+ ShmSeg shmseg B32;
+} xShmDetachReq;
+#define sz_xShmDetachReq 8
+
+typedef struct _ShmPutImage {
+ CARD8 reqType; /* always ShmReqCode */
+ CARD8 shmReqType; /* always X_ShmPutImage */
+ CARD16 length B16;
+ Drawable drawable B32;
+ GContext gc B32;
+ CARD16 totalWidth B16;
+ CARD16 totalHeight B16;
+ CARD16 srcX B16;
+ CARD16 srcY B16;
+ CARD16 srcWidth B16;
+ CARD16 srcHeight B16;
+ INT16 dstX B16;
+ INT16 dstY B16;
+ CARD8 depth;
+ CARD8 format;
+ CARD8 sendEvent;
+ CARD8 bpad;
+ ShmSeg shmseg B32;
+ CARD32 offset B32;
+} xShmPutImageReq;
+#define sz_xShmPutImageReq 40
+
+typedef struct _ShmGetImage {
+ CARD8 reqType; /* always ShmReqCode */
+ CARD8 shmReqType; /* always X_ShmGetImage */
+ CARD16 length B16;
+ Drawable drawable B32;
+ INT16 x B16;
+ INT16 y B16;
+ CARD16 width B16;
+ CARD16 height B16;
+ CARD32 planeMask B32;
+ CARD8 format;
+ CARD8 pad0;
+ CARD8 pad1;
+ CARD8 pad2;
+ ShmSeg shmseg B32;
+ CARD32 offset B32;
+} xShmGetImageReq;
+#define sz_xShmGetImageReq 32
+
+typedef struct _ShmGetImageReply {
+ BYTE type; /* X_Reply */
+ CARD8 depth;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ VisualID visual B32;
+ CARD32 size B32;
+ CARD32 pad0 B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+} xShmGetImageReply;
+#define sz_xShmGetImageReply 32
+
+typedef struct _ShmCreatePixmap {
+ CARD8 reqType; /* always ShmReqCode */
+ CARD8 shmReqType; /* always X_ShmCreatePixmap */
+ CARD16 length B16;
+ Pixmap pid B32;
+ Drawable drawable B32;
+ CARD16 width B16;
+ CARD16 height B16;
+ CARD8 depth;
+ CARD8 pad0;
+ CARD8 pad1;
+ CARD8 pad2;
+ ShmSeg shmseg B32;
+ CARD32 offset B32;
+} xShmCreatePixmapReq;
+#define sz_xShmCreatePixmapReq 28
+
+typedef struct _ShmCompletion {
+ BYTE type; /* always eventBase + ShmCompletion */
+ BYTE bpad0;
+ CARD16 sequenceNumber B16;
+ Drawable drawable B32;
+ CARD16 minorEvent B16;
+ BYTE majorEvent;
+ BYTE bpad1;
+ ShmSeg shmseg B32;
+ CARD32 offset B32;
+ CARD32 pad0 B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+} xShmCompletionEvent;
+#define sz_xShmCompletionEvent 32
+
+#undef ShmSeg
+#undef Drawable
+#undef VisualID
+#undef GContext
+#undef Pixmap
+
+#endif /* _SHMSTR_H_ */
diff --git a/sysroot/usr/include/X11/extensions/sync.h b/sysroot/usr/include/X11/extensions/sync.h
new file mode 100644
index 0000000..9fbe6d7
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/sync.h
@@ -0,0 +1,469 @@
+/* $Xorg: sync.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ */
+/*
+
+Copyright 1991, 1993, 1994, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+*/
+
+/***********************************************************
+Copyright 1991,1993 by Digital Equipment Corporation, Maynard, Massachusetts,
+and Olivetti Research Limited, Cambridge, England.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the names of Digital or Olivetti
+not be used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL AND OLIVETTI DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS, IN NO EVENT SHALL THEY BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+
+******************************************************************/
+/* $XFree86: xc/include/extensions/sync.h,v 1.4 2001/12/20 19:40:59 tsi Exp $ */
+
+#ifndef _SYNC_H_
+#define _SYNC_H_
+
+#include <X11/Xfuncproto.h>
+
+_XFUNCPROTOBEGIN
+
+#define SYNC_NAME "SYNC"
+
+#define SYNC_MAJOR_VERSION 3
+#define SYNC_MINOR_VERSION 0
+
+#define X_SyncInitialize 0
+#define X_SyncListSystemCounters 1
+#define X_SyncCreateCounter 2
+#define X_SyncSetCounter 3
+#define X_SyncChangeCounter 4
+#define X_SyncQueryCounter 5
+#define X_SyncDestroyCounter 6
+#define X_SyncAwait 7
+#define X_SyncCreateAlarm 8
+#define X_SyncChangeAlarm 9
+#define X_SyncQueryAlarm 10
+#define X_SyncDestroyAlarm 11
+#define X_SyncSetPriority 12
+#define X_SyncGetPriority 13
+
+#define XSyncCounterNotify 0
+#define XSyncAlarmNotify 1
+#define XSyncAlarmNotifyMask (1L << XSyncAlarmNotify)
+
+#define XSyncNumberEvents 2L
+
+#define XSyncBadCounter 0L
+#define XSyncBadAlarm 1L
+#define XSyncNumberErrors (XSyncBadAlarm + 1)
+
+/*
+ * Flags for Alarm Attributes
+ */
+#define XSyncCACounter (1L<<0)
+#define XSyncCAValueType (1L<<1)
+#define XSyncCAValue (1L<<2)
+#define XSyncCATestType (1L<<3)
+#define XSyncCADelta (1L<<4)
+#define XSyncCAEvents (1L<<5)
+
+/*
+ * Constants for the value_type argument of various requests
+ */
+typedef enum {
+ XSyncAbsolute,
+ XSyncRelative
+} XSyncValueType;
+
+/*
+ * Alarm Test types
+ */
+typedef enum {
+ XSyncPositiveTransition,
+ XSyncNegativeTransition,
+ XSyncPositiveComparison,
+ XSyncNegativeComparison
+} XSyncTestType;
+
+/*
+ * Alarm state constants
+ */
+typedef enum {
+ XSyncAlarmActive,
+ XSyncAlarmInactive,
+ XSyncAlarmDestroyed
+} XSyncAlarmState;
+
+
+typedef XID XSyncCounter;
+typedef XID XSyncAlarm;
+typedef struct _XSyncValue {
+ int hi;
+ unsigned int lo;
+} XSyncValue;
+
+/*
+ * Macros/functions for manipulating 64 bit values
+ */
+
+/* have to put these prototypes before the corresponding macro definitions */
+
+extern void XSyncIntToValue(
+ XSyncValue* /*pv*/,
+ int /*i*/
+);
+
+extern void XSyncIntsToValue(
+ XSyncValue* /*pv*/,
+ unsigned int /*l*/,
+ int /*h*/
+);
+
+extern Bool XSyncValueGreaterThan(
+ XSyncValue /*a*/,
+ XSyncValue /*b*/
+);
+
+extern Bool XSyncValueLessThan(
+ XSyncValue /*a*/,
+ XSyncValue /*b*/
+);
+
+extern Bool XSyncValueGreaterOrEqual(
+ XSyncValue /*a*/,
+ XSyncValue /*b*/
+);
+
+extern Bool XSyncValueLessOrEqual(
+ XSyncValue /*a*/,
+ XSyncValue /*b*/
+);
+
+extern Bool XSyncValueEqual(
+ XSyncValue /*a*/,
+ XSyncValue /*b*/
+);
+
+extern Bool XSyncValueIsNegative(
+ XSyncValue /*v*/
+);
+
+extern Bool XSyncValueIsZero(
+ XSyncValue /*a*/
+);
+
+extern Bool XSyncValueIsPositive(
+ XSyncValue /*v*/
+);
+
+extern unsigned int XSyncValueLow32(
+ XSyncValue /*v*/
+);
+
+extern int XSyncValueHigh32(
+ XSyncValue /*v*/
+);
+
+extern void XSyncValueAdd(
+ XSyncValue* /*presult*/,
+ XSyncValue /*a*/,
+ XSyncValue /*b*/,
+ int* /*poverflow*/
+);
+
+extern void XSyncValueSubtract(
+ XSyncValue* /*presult*/,
+ XSyncValue /*a*/,
+ XSyncValue /*b*/,
+ int* /*poverflow*/
+);
+
+extern void XSyncMaxValue(
+ XSyncValue* /*pv*/
+);
+
+extern void XSyncMinValue(
+ XSyncValue* /*pv*/
+);
+
+_XFUNCPROTOEND
+
+/* The _XSync macros below are for library internal use only. They exist
+ * so that if we have to make a fix, we can change it in this one place
+ * and have both the macro and function variants inherit the fix.
+ */
+
+#define _XSyncIntToValue(pv, i) ((pv)->hi=((i<0)?~0:0),(pv)->lo=(i))
+#define _XSyncIntsToValue(pv, l, h) ((pv)->lo = (l), (pv)->hi = (h))
+#define _XSyncValueGreaterThan(a, b)\
+ ((a).hi>(b).hi || ((a).hi==(b).hi && (a).lo>(b).lo))
+#define _XSyncValueLessThan(a, b)\
+ ((a).hi<(b).hi || ((a).hi==(b).hi && (a).lo<(b).lo))
+#define _XSyncValueGreaterOrEqual(a, b)\
+ ((a).hi>(b).hi || ((a).hi==(b).hi && (a).lo>=(b).lo))
+#define _XSyncValueLessOrEqual(a, b)\
+ ((a).hi<(b).hi || ((a).hi==(b).hi && (a).lo<=(b).lo))
+#define _XSyncValueEqual(a, b) ((a).lo==(b).lo && (a).hi==(b).hi)
+#define _XSyncValueIsNegative(v) (((v).hi & 0x80000000) ? 1 : 0)
+#define _XSyncValueIsZero(a) ((a).lo==0 && (a).hi==0)
+#define _XSyncValueIsPositive(v) (((v).hi & 0x80000000) ? 0 : 1)
+#define _XSyncValueLow32(v) ((v).lo)
+#define _XSyncValueHigh32(v) ((v).hi)
+#define _XSyncValueAdd(presult,a,b,poverflow) {\
+ int t = (a).lo;\
+ Bool signa = XSyncValueIsNegative(a);\
+ Bool signb = XSyncValueIsNegative(b);\
+ ((presult)->lo = (a).lo + (b).lo);\
+ ((presult)->hi = (a).hi + (b).hi);\
+ if (t>(presult)->lo) (presult)->hi++;\
+ *poverflow = ((signa == signb) && !(signa == XSyncValueIsNegative(*presult)));\
+ }
+#define _XSyncValueSubtract(presult,a,b,poverflow) {\
+ int t = (a).lo;\
+ Bool signa = XSyncValueIsNegative(a);\
+ Bool signb = XSyncValueIsNegative(b);\
+ ((presult)->lo = (a).lo - (b).lo);\
+ ((presult)->hi = (a).hi - (b).hi);\
+ if (t>(presult)->lo) (presult)->hi--;\
+ *poverflow = ((signa == signb) && !(signa == XSyncValueIsNegative(*presult)));\
+ }
+#define _XSyncMaxValue(pv) ((pv)->hi = 0x7fffffff, (pv)->lo = 0xffffffff)
+#define _XSyncMinValue(pv) ((pv)->hi = 0x80000000, (pv)->lo = 0)
+
+/*
+ * These are the publically usable macros. If you want the function version
+ * of one of these, just #undef the macro to uncover the function.
+ * (This is the same convention that the ANSI C library uses.)
+ */
+
+#define XSyncIntToValue(pv, i) _XSyncIntToValue(pv, i)
+#define XSyncIntsToValue(pv, l, h) _XSyncIntsToValue(pv, l, h)
+#define XSyncValueGreaterThan(a, b) _XSyncValueGreaterThan(a, b)
+#define XSyncValueLessThan(a, b) _XSyncValueLessThan(a, b)
+#define XSyncValueGreaterOrEqual(a, b) _XSyncValueGreaterOrEqual(a, b)
+#define XSyncValueLessOrEqual(a, b) _XSyncValueLessOrEqual(a, b)
+#define XSyncValueEqual(a, b) _XSyncValueEqual(a, b)
+#define XSyncValueIsNegative(v) _XSyncValueIsNegative(v)
+#define XSyncValueIsZero(a) _XSyncValueIsZero(a)
+#define XSyncValueIsPositive(v) _XSyncValueIsPositive(v)
+#define XSyncValueLow32(v) _XSyncValueLow32(v)
+#define XSyncValueHigh32(v) _XSyncValueHigh32(v)
+#define XSyncValueAdd(presult,a,b,poverflow) _XSyncValueAdd(presult,a,b,poverflow)
+#define XSyncValueSubtract(presult,a,b,poverflow) _XSyncValueSubtract(presult,a,b,poverflow)
+#define XSyncMaxValue(pv) _XSyncMaxValue(pv)
+#define XSyncMinValue(pv) _XSyncMinValue(pv)
+
+#ifndef _SYNC_SERVER
+
+typedef struct _XSyncSystemCounter {
+ char *name; /* null-terminated name of system counter */
+ XSyncCounter counter; /* counter id of this system counter */
+ XSyncValue resolution; /* resolution of this system counter */
+} XSyncSystemCounter;
+
+
+typedef struct {
+ XSyncCounter counter; /* counter to trigger on */
+ XSyncValueType value_type; /* absolute/relative */
+ XSyncValue wait_value; /* value to compare counter to */
+ XSyncTestType test_type; /* pos/neg comparison/transtion */
+} XSyncTrigger;
+
+typedef struct {
+ XSyncTrigger trigger; /* trigger for await */
+ XSyncValue event_threshold; /* send event if past threshold */
+} XSyncWaitCondition;
+
+
+typedef struct {
+ XSyncTrigger trigger;
+ XSyncValue delta;
+ Bool events;
+ XSyncAlarmState state;
+} XSyncAlarmAttributes;
+
+/*
+ * Events
+ */
+
+typedef struct {
+ int type; /* event base + XSyncCounterNotify */
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ XSyncCounter counter; /* counter involved in await */
+ XSyncValue wait_value; /* value being waited for */
+ XSyncValue counter_value; /* counter value when this event was sent */
+ Time time; /* milliseconds */
+ int count; /* how many more events to come */
+ Bool destroyed; /* True if counter was destroyed */
+} XSyncCounterNotifyEvent;
+
+typedef struct {
+ int type; /* event base + XSyncCounterNotify */
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ XSyncAlarm alarm; /* alarm that triggered */
+ XSyncValue counter_value; /* value that triggered the alarm */
+ XSyncValue alarm_value; /* test value of trigger in alarm */
+ Time time; /* milliseconds */
+ XSyncAlarmState state; /* new state of alarm */
+} XSyncAlarmNotifyEvent;
+
+/*
+ * Errors
+ */
+
+typedef struct {
+ int type;
+ Display *display; /* Display the event was read from */
+ XSyncAlarm alarm; /* resource id */
+ unsigned long serial; /* serial number of failed request */
+ unsigned char error_code; /* error base + XSyncBadAlarm */
+ unsigned char request_code; /* Major op-code of failed request */
+ unsigned char minor_code; /* Minor op-code of failed request */
+} XSyncAlarmError;
+
+typedef struct {
+ int type;
+ Display *display; /* Display the event was read from */
+ XSyncCounter counter; /* resource id */
+ unsigned long serial; /* serial number of failed request */
+ unsigned char error_code; /* error base + XSyncBadCounter */
+ unsigned char request_code; /* Major op-code of failed request */
+ unsigned char minor_code; /* Minor op-code of failed request */
+} XSyncCounterError;
+
+/*
+ * Prototypes
+ */
+
+_XFUNCPROTOBEGIN
+
+extern Status XSyncQueryExtension(
+ Display* /*dpy*/,
+ int* /*event_base_return*/,
+ int* /*error_base_return*/
+);
+
+extern Status XSyncInitialize(
+ Display* /*dpy*/,
+ int* /*major_version_return*/,
+ int* /*minor_version_return*/
+);
+
+extern XSyncSystemCounter *XSyncListSystemCounters(
+ Display* /*dpy*/,
+ int* /*n_counters_return*/
+);
+
+extern void XSyncFreeSystemCounterList(
+ XSyncSystemCounter* /*list*/
+);
+
+extern XSyncCounter XSyncCreateCounter(
+ Display* /*dpy*/,
+ XSyncValue /*initial_value*/
+);
+
+extern Status XSyncSetCounter(
+ Display* /*dpy*/,
+ XSyncCounter /*counter*/,
+ XSyncValue /*value*/
+);
+
+extern Status XSyncChangeCounter(
+ Display* /*dpy*/,
+ XSyncCounter /*counter*/,
+ XSyncValue /*value*/
+);
+
+extern Status XSyncDestroyCounter(
+ Display* /*dpy*/,
+ XSyncCounter /*counter*/
+);
+
+extern Status XSyncQueryCounter(
+ Display* /*dpy*/,
+ XSyncCounter /*counter*/,
+ XSyncValue* /*value_return*/
+);
+
+extern Status XSyncAwait(
+ Display* /*dpy*/,
+ XSyncWaitCondition* /*wait_list*/,
+ int /*n_conditions*/
+);
+
+extern XSyncAlarm XSyncCreateAlarm(
+ Display* /*dpy*/,
+ unsigned long /*values_mask*/,
+ XSyncAlarmAttributes* /*values*/
+);
+
+extern Status XSyncDestroyAlarm(
+ Display* /*dpy*/,
+ XSyncAlarm /*alarm*/
+);
+
+extern Status XSyncQueryAlarm(
+ Display* /*dpy*/,
+ XSyncAlarm /*alarm*/,
+ XSyncAlarmAttributes* /*values_return*/
+);
+
+extern Status XSyncChangeAlarm(
+ Display* /*dpy*/,
+ XSyncAlarm /*alarm*/,
+ unsigned long /*values_mask*/,
+ XSyncAlarmAttributes* /*values*/
+);
+
+extern Status XSyncSetPriority(
+ Display* /*dpy*/,
+ XID /*client_resource_id*/,
+ int /*priority*/
+);
+
+extern Status XSyncGetPriority(
+ Display* /*dpy*/,
+ XID /*client_resource_id*/,
+ int* /*return_priority*/
+);
+
+#endif /* _SYNC_SERVER */
+
+_XFUNCPROTOEND
+
+#endif /* _SYNC_H_ */
diff --git a/sysroot/usr/include/X11/extensions/syncstr.h b/sysroot/usr/include/X11/extensions/syncstr.h
new file mode 100644
index 0000000..4e384f2
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/syncstr.h
@@ -0,0 +1,494 @@
+/* $Xorg: syncstr.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ */
+/*
+
+Copyright 1991, 1993, 1994, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+*/
+
+/***********************************************************
+Copyright 1991,1993 by Digital Equipment Corporation, Maynard, Massachusetts,
+and Olivetti Research Limited, Cambridge, England.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the names of Digital or Olivetti
+not be used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL AND OLIVETTI DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS, IN NO EVENT SHALL THEY BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+
+******************************************************************/
+/* $XFree86: xc/include/extensions/syncstr.h,v 1.3 2003/07/16 01:38:24 dawes Exp $ */
+
+#ifndef _SYNCSTR_H_
+#define _SYNCSTR_H_
+
+#include "sync.h"
+
+#ifndef _SYNC_OS
+
+/* cover up types from sync.h to make sure they're the right size for
+ * protocol packaging. These will be undef'ed after all the protocol
+ * structures are defined.
+ */
+#define XSyncCounter CARD32
+#define XSyncAlarm CARD32
+
+/*
+ * Initialize
+ */
+typedef struct _xSyncInitialize {
+ CARD8 reqType;
+ CARD8 syncReqType;
+ CARD16 length B16;
+ CARD8 majorVersion;
+ CARD8 minorVersion;
+ CARD16 pad B16;
+} xSyncInitializeReq;
+#define sz_xSyncInitializeReq 8
+
+typedef struct {
+ BYTE type;
+ CARD8 unused;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 majorVersion;
+ CARD8 minorVersion;
+ CARD16 pad B16;
+ CARD32 pad0 B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+} xSyncInitializeReply;
+#define sz_xSyncInitializeReply 32
+
+/*
+ * ListSystemCounters
+ */
+typedef struct _xSyncListSystemCounters
+{
+ CARD8 reqType;
+ CARD8 syncReqType;
+ CARD16 length B16;
+} xSyncListSystemCountersReq;
+#define sz_xSyncListSystemCountersReq 4
+
+typedef struct {
+ BYTE type;
+ CARD8 unused;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ INT32 nCounters B32;
+ CARD32 pad0 B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+} xSyncListSystemCountersReply;
+#define sz_xSyncListSystemCountersReply 32
+
+typedef struct {
+ XSyncCounter counter B32;
+ INT32 resolution_hi B32;
+ CARD32 resolution_lo B32;
+ CARD16 name_length B16;
+} xSyncSystemCounter;
+#define sz_xSyncSystemCounter 14
+
+/*
+ * Create Counter
+ */
+typedef struct _xSyncCreateCounterReq {
+ CARD8 reqType;
+ CARD8 syncReqType;
+ CARD16 length B16;
+ XSyncCounter cid B32;
+ INT32 initial_value_hi B32;
+ CARD32 initial_value_lo B32;
+} xSyncCreateCounterReq;
+#define sz_xSyncCreateCounterReq 16
+
+/*
+ * Change Counter
+ */
+typedef struct _xSyncChangeCounterReq {
+ CARD8 reqType;
+ CARD8 syncReqType;
+ CARD16 length B16;
+ XSyncCounter cid B32;
+ INT32 value_hi B32;
+ CARD32 value_lo B32;
+} xSyncChangeCounterReq;
+#define sz_xSyncChangeCounterReq 16
+
+/*
+ * Set Counter
+ */
+typedef struct _xSyncSetCounterReq {
+ CARD8 reqType;
+ CARD8 syncReqType;
+ CARD16 length B16;
+ XSyncCounter cid B32;
+ INT32 value_hi B32;
+ CARD32 value_lo B32;
+} xSyncSetCounterReq;
+#define sz_xSyncSetCounterReq 16
+
+/*
+ * Destroy Counter
+ */
+typedef struct _xSyncDestroyCounterReq {
+ CARD8 reqType;
+ CARD8 syncReqType;
+ CARD16 length B16;
+ XSyncCounter counter B32;
+} xSyncDestroyCounterReq;
+#define sz_xSyncDestroyCounterReq 8
+
+/*
+ * Query Counter
+ */
+typedef struct _xSyncQueryCounterReq {
+ CARD8 reqType;
+ CARD8 syncReqType;
+ CARD16 length B16;
+ XSyncCounter counter B32;
+} xSyncQueryCounterReq;
+#define sz_xSyncQueryCounterReq 8
+
+
+typedef struct {
+ BYTE type;
+ CARD8 unused;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ INT32 value_hi B32;
+ CARD32 value_lo B32;
+ CARD32 pad0 B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+} xSyncQueryCounterReply;
+#define sz_xSyncQueryCounterReply 32
+
+/*
+ * Await
+ */
+typedef struct _xSyncAwaitReq {
+ CARD8 reqType;
+ CARD8 syncReqType;
+ CARD16 length B16;
+} xSyncAwaitReq;
+#define sz_xSyncAwaitReq 4
+
+typedef struct _xSyncWaitCondition {
+ XSyncCounter counter B32;
+ CARD32 value_type B32;
+ INT32 wait_value_hi B32;
+ CARD32 wait_value_lo B32;
+ CARD32 test_type B32;
+ INT32 event_threshold_hi B32;
+ CARD32 event_threshold_lo B32;
+} xSyncWaitCondition;
+#define sz_xSyncWaitCondition 28
+
+/*
+ * Create Alarm
+ */
+typedef struct _xSyncCreateAlarmReq {
+ CARD8 reqType;
+ CARD8 syncReqType;
+ CARD16 length B16;
+ XSyncAlarm id B32;
+ CARD32 valueMask B32;
+} xSyncCreateAlarmReq;
+#define sz_xSyncCreateAlarmReq 12
+
+/*
+ * Destroy Alarm
+ */
+typedef struct _xSyncDestroyAlarmReq {
+ CARD8 reqType;
+ CARD8 syncReqType;
+ CARD16 length B16;
+ XSyncAlarm alarm B32;
+} xSyncDestroyAlarmReq;
+#define sz_xSyncDestroyAlarmReq 8
+
+/*
+ * Query Alarm
+ */
+typedef struct _xSyncQueryAlarmReq {
+ CARD8 reqType;
+ CARD8 syncReqType;
+ CARD16 length B16;
+ XSyncAlarm alarm B32;
+} xSyncQueryAlarmReq;
+#define sz_xSyncQueryAlarmReq 8
+
+typedef struct {
+ BYTE type;
+ CARD8 unused;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ XSyncCounter counter B32;
+ CARD32 value_type B32;
+ INT32 wait_value_hi B32;
+ CARD32 wait_value_lo B32;
+ CARD32 test_type B32;
+ INT32 delta_hi B32;
+ CARD32 delta_lo B32;
+ BOOL events;
+ BYTE state;
+ BYTE pad0;
+ BYTE pad1;
+} xSyncQueryAlarmReply;
+#define sz_xSyncQueryAlarmReply 40
+
+/*
+ * Change Alarm
+ */
+typedef struct _xSyncChangeAlarmReq {
+ CARD8 reqType;
+ CARD8 syncReqType;
+ CARD16 length B16;
+ XSyncAlarm alarm B32;
+ CARD32 valueMask B32;
+} xSyncChangeAlarmReq;
+#define sz_xSyncChangeAlarmReq 12
+
+/*
+ * SetPriority
+ */
+typedef struct _xSyncSetPriority{
+ CARD8 reqType;
+ CARD8 syncReqType;
+ CARD16 length B16;
+ CARD32 id B32;
+ INT32 priority B32;
+} xSyncSetPriorityReq;
+#define sz_xSyncSetPriorityReq 12
+
+/*
+ * Get Priority
+ */
+typedef struct _xSyncGetPriority{
+ CARD8 reqType;
+ CARD8 syncReqType;
+ CARD16 length B16;
+ CARD32 id B32; /*XXX XID? */
+} xSyncGetPriorityReq;
+#define sz_xSyncGetPriorityReq 8
+
+typedef struct {
+ BYTE type;
+ CARD8 unused;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ INT32 priority B32;
+ CARD32 pad0 B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+} xSyncGetPriorityReply;
+#define sz_xSyncGetPriorityReply 32
+
+/*
+ * Events
+ */
+
+typedef struct _xSyncCounterNotifyEvent {
+ BYTE type;
+ BYTE kind;
+ CARD16 sequenceNumber B16;
+ XSyncCounter counter B32;
+ INT32 wait_value_hi B32;
+ CARD32 wait_value_lo B32;
+ INT32 counter_value_hi B32;
+ CARD32 counter_value_lo B32;
+ CARD32 time B32;
+ CARD16 count B16;
+ BOOL destroyed;
+ BYTE pad0;
+} xSyncCounterNotifyEvent;
+
+typedef struct _xSyncAlarmNotifyEvent {
+ BYTE type;
+ BYTE kind;
+ CARD16 sequenceNumber B16;
+ XSyncAlarm alarm B32;
+ INT32 counter_value_hi B32;
+ CARD32 counter_value_lo B32;
+ INT32 alarm_value_hi B32;
+ CARD32 alarm_value_lo B32;
+ CARD32 time B32;
+ CARD8 state;
+ BYTE pad0;
+ BYTE pad1;
+ BYTE pad2;
+} xSyncAlarmNotifyEvent;
+
+#undef XSyncCounter
+#undef XSyncAlarm
+
+#endif /* _SYNC_OS */
+
+#ifdef _SYNC_SERVER
+
+#define CARD64 XSyncValue /* XXX temporary! need real 64 bit values for Alpha */
+
+typedef struct _SyncCounter {
+ ClientPtr client; /* Owning client. 0 for system counters */
+ XSyncCounter id; /* resource ID */
+ CARD64 value; /* counter value */
+ struct _SyncTriggerList *pTriglist; /* list of triggers */
+ Bool beingDestroyed; /* in process of going away */
+ struct _SysCounterInfo *pSysCounterInfo; /* NULL if not a system counter */
+} SyncCounter;
+
+/*
+ * The System Counter interface
+ */
+
+typedef enum {
+ XSyncCounterNeverChanges,
+ XSyncCounterNeverIncreases,
+ XSyncCounterNeverDecreases,
+ XSyncCounterUnrestricted
+} SyncCounterType;
+
+typedef struct _SysCounterInfo {
+ char *name;
+ CARD64 resolution;
+ CARD64 bracket_greater;
+ CARD64 bracket_less;
+ SyncCounterType counterType; /* how can this counter change */
+ void (*QueryValue)(
+ pointer /*pCounter*/,
+ CARD64 * /*freshvalue*/
+);
+ void (*BracketValues)(
+ pointer /*pCounter*/,
+ CARD64 * /*lessthan*/,
+ CARD64 * /*greaterthan*/
+);
+} SysCounterInfo;
+
+
+
+typedef struct _SyncTrigger {
+ SyncCounter *pCounter;
+ CARD64 wait_value; /* wait value */
+ unsigned int value_type; /* Absolute or Relative */
+ unsigned int test_type; /* transition or Comparision type */
+ CARD64 test_value; /* trigger event threshold value */
+ Bool (*CheckTrigger)(
+ struct _SyncTrigger * /*pTrigger*/,
+ CARD64 /*newval*/
+ );
+ void (*TriggerFired)(
+ struct _SyncTrigger * /*pTrigger*/
+ );
+ void (*CounterDestroyed)(
+ struct _SyncTrigger * /*pTrigger*/
+ );
+} SyncTrigger;
+
+typedef struct _SyncTriggerList {
+ SyncTrigger *pTrigger;
+ struct _SyncTriggerList *next;
+} SyncTriggerList;
+
+typedef struct _SyncAlarmClientList {
+ ClientPtr client;
+ XID delete_id;
+ struct _SyncAlarmClientList *next;
+} SyncAlarmClientList;
+
+typedef struct _SyncAlarm {
+ SyncTrigger trigger;
+ ClientPtr client;
+ XSyncAlarm alarm_id;
+ CARD64 delta;
+ int events;
+ int state;
+ SyncAlarmClientList *pEventClients;
+} SyncAlarm;
+
+typedef struct {
+ ClientPtr client;
+ CARD32 delete_id;
+ int num_waitconditions;
+} SyncAwaitHeader;
+
+typedef struct {
+ SyncTrigger trigger;
+ CARD64 event_threshold;
+ SyncAwaitHeader *pHeader;
+} SyncAwait;
+
+typedef union {
+ SyncAwaitHeader header;
+ SyncAwait await;
+} SyncAwaitUnion;
+
+
+extern pointer SyncCreateSystemCounter(
+ char * /* name */,
+ CARD64 /* inital_value */,
+ CARD64 /* resolution */,
+ SyncCounterType /* change characterization */,
+ void (* /*QueryValue*/ ) (
+ pointer /* pCounter */,
+ CARD64 * /* pValue_return */), /* XXX prototype */
+ void (* /*BracketValues*/) (
+ pointer /* pCounter */,
+ CARD64 * /* pbracket_less */,
+ CARD64 * /* pbracket_greater */)
+);
+
+extern void SyncChangeCounter(
+ SyncCounter * /* pCounter*/,
+ CARD64 /* new_value */
+);
+
+extern void SyncDestroySystemCounter(
+ pointer pCounter
+);
+extern void InitServertime(void);
+
+#endif /* _SYNC_SERVER */
+
+#endif /* _SYNCSTR_H_ */
diff --git a/sysroot/usr/include/X11/extensions/xtestext1.h b/sysroot/usr/include/X11/extensions/xtestext1.h
new file mode 100644
index 0000000..8f49cad
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/xtestext1.h
@@ -0,0 +1,326 @@
+/* $Xorg: xtestext1.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ */
+/*
+ * xtestext1.h
+ *
+ * X11 Input Synthesis Extension include file
+ */
+
+/*
+
+
+Copyright 1986, 1987, 1988, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1986, 1987, 1988 by Hewlett-Packard Corporation
+
+Permission to use, copy, modify, and distribute this
+software and its documentation for any purpose and without
+fee is hereby granted, provided that the above copyright
+notice appear in all copies and that both that copyright
+notice and this permission notice appear in supporting
+documentation, and that the name of Hewlett-Packard not be used in
+advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+Hewlett-Packard makes no representations about the
+suitability of this software for any purpose. It is provided
+"as is" without express or implied warranty.
+
+This software is not subject to any license of the American
+Telephone and Telegraph Company or of the Regents of the
+University of California.
+
+*/
+
+/*
+ * the typedefs for CARD8, CARD16, and CARD32 are defined in Xmd.h
+ */
+
+/*
+ * used in the XTestPressButton and XTestPressKey functions
+ */
+#define XTestPRESS 1 << 0
+#define XTestRELEASE 1 << 1
+#define XTestSTROKE 1 << 2
+
+/*
+ * When doing a key or button stroke, the number of milliseconds
+ * to delay between the press and the release of a key or button
+ * in the XTestPressButton and XTestPressKey functions.
+ */
+
+#define XTestSTROKE_DELAY_TIME 10
+
+/*
+ * used in the XTestGetInput function
+ */
+#define XTestEXCLUSIVE 1 << 0
+#define XTestPACKED_ACTIONS 1 << 1
+#define XTestPACKED_MOTION 1 << 2
+
+/*
+ * used in the XTestFakeInput function
+ */
+#define XTestFAKE_ACK_NOT_NEEDED 0
+#define XTestFAKE_ACK_REQUEST 1
+
+/*
+ * used in the XTest extension initialization routine
+ */
+#define XTestEXTENSION_NAME "XTestExtension1"
+#define XTestEVENT_COUNT 2
+
+/*
+ * XTest request type values
+ *
+ * used in the XTest extension protocol requests
+ */
+#define X_TestFakeInput 1
+#define X_TestGetInput 2
+#define X_TestStopInput 3
+#define X_TestReset 4
+#define X_TestQueryInputSize 5
+
+/*
+ * This defines the maximum size of a list of input actions
+ * to be sent to the server. It should always be a multiple of
+ * 4 so that the entire xTestFakeInputReq structure size is a
+ * multiple of 4.
+ */
+#define XTestMAX_ACTION_LIST_SIZE 64
+
+typedef struct {
+ CARD8 reqType; /* always XTestReqCode */
+ CARD8 XTestReqType; /* always X_TestFakeInput */
+ CARD16 length B16; /* 2 + XTestMAX_ACTION_LIST_SIZE/4 */
+ CARD32 ack B32;
+ CARD8 action_list[XTestMAX_ACTION_LIST_SIZE];
+} xTestFakeInputReq;
+#define sz_xTestFakeInputReq (XTestMAX_ACTION_LIST_SIZE + 8)
+
+typedef struct {
+ CARD8 reqType; /* always XTestReqCode */
+ CARD8 XTestReqType; /* always X_TestGetInput */
+ CARD16 length B16; /* 2 */
+ CARD32 mode B32;
+} xTestGetInputReq;
+#define sz_xTestGetInputReq 8
+
+typedef struct {
+ CARD8 reqType; /* always XTestReqCode */
+ CARD8 XTestReqType; /* always X_TestStopInput */
+ CARD16 length B32; /* 1 */
+} xTestStopInputReq;
+#define sz_xTestStopInputReq 4
+
+typedef struct {
+ CARD8 reqType; /* always XTestReqCode */
+ CARD8 XTestReqType; /* always X_TestReset */
+ CARD16 length B16; /* 1 */
+} xTestResetReq;
+#define sz_xTestResetReq 4
+
+typedef struct {
+ CARD8 reqType; /* always XTestReqCode */
+ CARD8 XTestReqType; /* always X_TestQueryInputSize */
+ CARD16 length B16; /* 1 */
+} xTestQueryInputSizeReq;
+#define sz_xTestQueryInputSizeReq 4
+
+/*
+ * This is the definition of the reply for the xTestQueryInputSize
+ * request. It should remain the same minimum size as other replies
+ * (32 bytes).
+ */
+typedef struct {
+ CARD8 type; /* always X_Reply */
+ CARD8 pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* always 0 */
+ CARD32 size_return B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xTestQueryInputSizeReply;
+
+/*
+ * This is the definition for the input action wire event structure.
+ * This event is sent to the client when the server has one or
+ * more user input actions to report to the client. It must
+ * remain the same size as all other wire events (32 bytes).
+ */
+#define XTestACTIONS_SIZE 28
+
+typedef struct {
+ CARD8 type; /* always XTestInputActionType */
+ CARD8 pad00;
+ CARD16 sequenceNumber B16;
+ CARD8 actions[XTestACTIONS_SIZE];
+} xTestInputActionEvent;
+
+/*
+ * This is the definition for the xTestFakeAck wire event structure.
+ * This event is sent to the client when the server has completely
+ * processed its input action buffer, and is ready for more.
+ * It must remain the same size as all other wire events (32 bytes).
+ */
+typedef struct {
+ CARD8 type; /* always XTestFakeAckType */
+ CARD8 pad00;
+ CARD16 sequenceNumber B16;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+ CARD32 pad06 B32;
+ CARD32 pad07 B32;
+ CARD32 pad08 B32;
+} xTestFakeAckEvent;
+
+/*
+ * The server side of this extension does not (and should not) have
+ * definitions for Display and Window. The ifndef allows the server
+ * side of the extension to ignore the following typedefs.
+ */
+#ifndef XTestSERVER_SIDE
+/*
+ * This is the definition for the input action host format event structure.
+ * This is the form that a client using this extension will see when
+ * it receives an input action event.
+ */
+typedef struct {
+ int type; /* always XTestInputActionType */
+ Display *display;
+ Window window;
+ CARD8 actions[XTestACTIONS_SIZE];
+} XTestInputActionEvent;
+
+/*
+ * This is the definition for the xTestFakeAck host format event structure.
+ * This is the form that a client using this extension will see when
+ * it receives an XTestFakeAck event.
+ */
+typedef struct {
+ int type; /* always XTestFakeAckType */
+ Display *display;
+ Window window;
+} XTestFakeAckEvent;
+#endif
+
+/*
+ * This is the definition for the format of the header byte
+ * in the input action structures.
+ */
+#define XTestACTION_TYPE_MASK 0x03 /* bits 0 and 1 */
+#define XTestKEY_STATE_MASK 0x04 /* bit 2 (key action) */
+#define XTestX_SIGN_BIT_MASK 0x04 /* bit 2 (motion action) */
+#define XTestY_SIGN_BIT_MASK 0x08 /* bit 3 (motion action) */
+#define XTestDEVICE_ID_MASK 0xf0 /* bits 4 through 7 */
+
+#define XTestMAX_DEVICE_ID 0x0f
+#define XTestPackDeviceID(x) (((x) & XTestMAX_DEVICE_ID) << 4)
+#define XTestUnpackDeviceID(x) (((x) & XTestDEVICE_ID_MASK) >> 4)
+
+/*
+ * These are the possible action types.
+ */
+#define XTestDELAY_ACTION 0
+#define XTestKEY_ACTION 1
+#define XTestMOTION_ACTION 2
+#define XTestJUMP_ACTION 3
+
+/*
+ * These are the definitions for key/button motion input actions.
+ */
+#define XTestKEY_UP 0x04
+#define XTestKEY_DOWN 0x00
+
+typedef struct {
+ CARD8 header; /* which device, key up/down */
+ CARD8 keycode; /* which key/button to move */
+ CARD16 delay_time B16; /* how long to delay (in ms) */
+} XTestKeyInfo;
+
+/*
+ * This is the definition for pointer jump input actions.
+ */
+typedef struct {
+ CARD8 header; /* which pointer */
+ CARD8 pad1; /* unused padding byte */
+ CARD16 jumpx B16; /* x coord to jump to */
+ CARD16 jumpy B16; /* y coord to jump to */
+ CARD16 delay_time B16; /* how long to delay (in ms) */
+} XTestJumpInfo;
+
+/*
+ * These are the definitions for pointer relative motion input
+ * actions.
+ *
+ * The sign bits for the x and y relative motions are contained
+ * in the header byte. The x and y relative motions are packed
+ * into one byte to make things fit in 32 bits. If the relative
+ * motion range is larger than +/-15, use the pointer jump action.
+ */
+#define XTestMOTION_MAX 15
+#define XTestMOTION_MIN -15
+
+#define XTestX_NEGATIVE 0x04
+#define XTestY_NEGATIVE 0x08
+
+#define XTestX_MOTION_MASK 0x0f
+#define XTestY_MOTION_MASK 0xf0
+
+#define XTestPackXMotionValue(x) ((x) & XTestX_MOTION_MASK)
+#define XTestPackYMotionValue(x) (((x) << 4) & XTestY_MOTION_MASK)
+
+#define XTestUnpackXMotionValue(x) ((x) & XTestX_MOTION_MASK)
+#define XTestUnpackYMotionValue(x) (((x) & XTestY_MOTION_MASK) >> 4)
+
+typedef struct {
+ CARD8 header; /* which pointer */
+ CARD8 motion_data; /* x,y relative motion */
+ CARD16 delay_time B16; /* how long to delay (in ms) */
+} XTestMotionInfo;
+
+/*
+ * These are the definitions for a long delay input action. It is
+ * used when more than XTestSHORT_DELAY_TIME milliseconds of delay
+ * (approximately one minute) is needed.
+ *
+ * The device ID for a delay is always set to XTestDELAY_DEVICE_ID.
+ * This guarantees that a header byte with a value of 0 is not
+ * a valid header, so it can be used as a flag to indicate that
+ * there are no more input actions in an XTestInputAction event.
+ */
+
+#define XTestSHORT_DELAY_TIME 0xffff
+#define XTestDELAY_DEVICE_ID 0x0f
+
+typedef struct {
+ CARD8 header; /* always XTestDELAY_DEVICE_ID */
+ CARD8 pad1; /* unused padding byte */
+ CARD16 pad2 B16; /* unused padding word */
+ CARD32 delay_time B32; /* how long to delay (in ms) */
+} XTestDelayInfo;
diff --git a/sysroot/usr/include/X11/extensions/xteststr.h b/sysroot/usr/include/X11/extensions/xteststr.h
new file mode 100644
index 0000000..a196b77
--- /dev/null
+++ b/sysroot/usr/include/X11/extensions/xteststr.h
@@ -0,0 +1,120 @@
+/* $Xorg: xteststr.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ */
+/*
+
+Copyright 1992, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+*/
+
+#ifndef _XTESTSTR_H_
+#define _XTESTSTR_H_
+
+#define Window CARD32
+#define Time CARD32
+#define Cursor CARD32
+
+#define XTestCurrentCursor ((Cursor)1)
+
+typedef struct {
+ CARD8 reqType; /* always XTestReqCode */
+ CARD8 xtReqType; /* always X_XTestGetVersion */
+ CARD16 length B16;
+ CARD8 majorVersion;
+ CARD8 pad;
+ CARD16 minorVersion B16;
+} xXTestGetVersionReq;
+#define sz_xXTestGetVersionReq 8
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 majorVersion;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 minorVersion B16;
+ CARD16 pad0 B16;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+} xXTestGetVersionReply;
+#define sz_xXTestGetVersionReply 32
+
+typedef struct {
+ CARD8 reqType; /* always XTestReqCode */
+ CARD8 xtReqType; /* always X_XTestCompareCursor */
+ CARD16 length B16;
+ Window window B32;
+ Cursor cursor B32;
+} xXTestCompareCursorReq;
+#define sz_xXTestCompareCursorReq 12
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BOOL same;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad0 B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+} xXTestCompareCursorReply;
+#define sz_xXTestCompareCursorReply 32
+
+/* used only on the client side */
+typedef struct {
+ CARD8 reqType; /* always XTestReqCode */
+ CARD8 xtReqType; /* always X_XTestFakeInput */
+ CARD16 length B16;
+ BYTE type;
+ BYTE detail;
+ CARD16 pad0 B16;
+ Time time B32;
+ Window root B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ INT16 rootX B16, rootY B16;
+ CARD32 pad3 B32;
+ CARD16 pad4 B16;
+ CARD8 pad5;
+ CARD8 deviceid;
+} xXTestFakeInputReq;
+#define sz_xXTestFakeInputReq 36
+
+typedef struct {
+ CARD8 reqType; /* always XTestReqCode */
+ CARD8 xtReqType; /* always X_XTestGrabControl */
+ CARD16 length B16;
+ BOOL impervious;
+ CARD8 pad0;
+ CARD8 pad1;
+ CARD8 pad2;
+} xXTestGrabControlReq;
+#define sz_xXTestGrabControlReq 8
+
+#undef Window
+#undef Time
+#undef Cursor
+
+#endif /* _XTESTSTR_H_ */
diff --git a/sysroot/usr/include/X11/keysym.h b/sysroot/usr/include/X11/keysym.h
new file mode 100644
index 0000000..04e2956
--- /dev/null
+++ b/sysroot/usr/include/X11/keysym.h
@@ -0,0 +1,76 @@
+/* $Xorg: keysym.h,v 1.4 2001/02/09 02:03:23 xorgcvs Exp $ */
+
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************/
+/* $XFree86: xc/include/keysym.h,v 1.3 2001/01/17 17:53:12 dawes Exp $ */
+
+/* default keysyms */
+#define XK_MISCELLANY
+#define XK_XKB_KEYS
+#define XK_LATIN1
+#define XK_LATIN2
+#define XK_LATIN3
+#define XK_LATIN4
+#define XK_LATIN8
+#define XK_LATIN9
+#define XK_CAUCASUS
+#define XK_GREEK
+#define XK_KATAKANA
+#define XK_ARABIC
+#define XK_CYRILLIC
+#define XK_HEBREW
+#define XK_THAI
+#define XK_KOREAN
+#define XK_ARMENIAN
+#define XK_GEORGIAN
+#define XK_VIETNAMESE
+#define XK_CURRENCY
+#define XK_MATHEMATICAL
+#define XK_BRAILLE
+
+#include <X11/keysymdef.h>
+
diff --git a/sysroot/usr/include/X11/keysymdef.h b/sysroot/usr/include/X11/keysymdef.h
new file mode 100644
index 0000000..b3ade4d
--- /dev/null
+++ b/sysroot/usr/include/X11/keysymdef.h
@@ -0,0 +1,2358 @@
+/* $Xorg: keysymdef.h,v 1.4 2001/02/09 02:03:23 $ */
+
+/***********************************************************
+Copyright 1987, 1994, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from The Open Group.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************/
+/* $XFree86: $ */
+
+/*
+ * The "X11 Window System Protocol" standard defines in Appendix A the
+ * keysym codes. These 29-bit integer values identify characters or
+ * functions associated with each key (e.g., via the visible
+ * engraving) of a keyboard layout. This file assigns mnemonic macro
+ * names for these keysyms.
+ *
+ * This file is also compiled (by xc/lib/X11/util/makekeys.c) into
+ * hash tables that can be accessed with X11 library functions such as
+ * XStringToKeysym() and XKeysymToString().
+ *
+ * Where a keysym corresponds one-to-one to an ISO 10646 / Unicode
+ * character, this is noted in a comment that provides both the U+xxxx
+ * Unicode position, as well as the official Unicode name of the
+ * character.
+ *
+ * Where the correspondence is either not one-to-one or semantically
+ * unclear, the Unicode position and name are enclosed in
+ * parentheses. Such legacy keysyms should be considered deprecated
+ * and are not recommended for use in future keyboard mappings.
+ *
+ * For any future extension of the keysyms with characters already
+ * found in ISO 10646 / Unicode, the following algorithm shall be
+ * used. The new keysym code position will simply be the character's
+ * Unicode number plus 0x01000000. The keysym values in the range
+ * 0x01000100 to 0x0110ffff are reserved to represent Unicode
+ * characters in the range U+0100 to U+10FFFF.
+ *
+ * While most newer Unicode-based X11 clients do already accept
+ * Unicode-mapped keysyms in the range 0x01000100 to 0x0110ffff, it
+ * will remain necessary for clients -- in the interest of
+ * compatibility with existing servers -- to also understand the
+ * existing legacy keysym values in the range 0x0100 to 0x20ff.
+ *
+ * Where several mnemonic names are defined for the same keysym in this
+ * file, all but the first one listed should be considered deprecated.
+ *
+ * Mnemonic names for keysyms are defined in this file with lines
+ * that match one of these Perl regular expressions:
+ *
+ * /^\#define XK_([a-zA-Z_0-9]+)\s+0x([0-9a-f]+)\s*\/\* U+([0-9A-F]{4,6}) (.*) \*\/\s*$/
+ * /^\#define XK_([a-zA-Z_0-9]+)\s+0x([0-9a-f]+)\s*\/\*\(U+([0-9A-F]{4,6}) (.*)\)\*\/\s*$/
+ * /^\#define XK_([a-zA-Z_0-9]+)\s+0x([0-9a-f]+)\s*(\/\*\s*(.*)\s*\*\/)?\s*$/
+ *
+ * When adding new keysyms to this file, do not forget to also update the
+ * mappings in xc/lib/X11/KeyBind.c and the protocol specification in
+ * xc/doc/specs/XProtocol/X11.keysyms.
+ */
+
+/*
+ * Now that the Xorg code base is managed in Git repositories, the KeyBind.c
+ * and X11.keysyms files mentioned in the last comment block are located at:
+ *
+ * src/KeyBind.c in the repo git://anongit.freedesktop.org/xorg/lib/libX11
+ * specs/XProtocol/X11.keysyms in the repo git://anongit.freedesktop.org/xorg/doc/xorg-docs
+ */
+
+#define XK_VoidSymbol 0xffffff /* Void symbol */
+
+#ifdef XK_MISCELLANY
+/*
+ * TTY function keys, cleverly chosen to map to ASCII, for convenience of
+ * programming, but could have been arbitrary (at the cost of lookup
+ * tables in client code).
+ */
+
+#define XK_BackSpace 0xff08 /* Back space, back char */
+#define XK_Tab 0xff09
+#define XK_Linefeed 0xff0a /* Linefeed, LF */
+#define XK_Clear 0xff0b
+#define XK_Return 0xff0d /* Return, enter */
+#define XK_Pause 0xff13 /* Pause, hold */
+#define XK_Scroll_Lock 0xff14
+#define XK_Sys_Req 0xff15
+#define XK_Escape 0xff1b
+#define XK_Delete 0xffff /* Delete, rubout */
+
+
+
+/* International & multi-key character composition */
+
+#define XK_Multi_key 0xff20 /* Multi-key character compose */
+#define XK_Codeinput 0xff37
+#define XK_SingleCandidate 0xff3c
+#define XK_MultipleCandidate 0xff3d
+#define XK_PreviousCandidate 0xff3e
+
+/* Japanese keyboard support */
+
+#define XK_Kanji 0xff21 /* Kanji, Kanji convert */
+#define XK_Muhenkan 0xff22 /* Cancel Conversion */
+#define XK_Henkan_Mode 0xff23 /* Start/Stop Conversion */
+#define XK_Henkan 0xff23 /* Alias for Henkan_Mode */
+#define XK_Romaji 0xff24 /* to Romaji */
+#define XK_Hiragana 0xff25 /* to Hiragana */
+#define XK_Katakana 0xff26 /* to Katakana */
+#define XK_Hiragana_Katakana 0xff27 /* Hiragana/Katakana toggle */
+#define XK_Zenkaku 0xff28 /* to Zenkaku */
+#define XK_Hankaku 0xff29 /* to Hankaku */
+#define XK_Zenkaku_Hankaku 0xff2a /* Zenkaku/Hankaku toggle */
+#define XK_Touroku 0xff2b /* Add to Dictionary */
+#define XK_Massyo 0xff2c /* Delete from Dictionary */
+#define XK_Kana_Lock 0xff2d /* Kana Lock */
+#define XK_Kana_Shift 0xff2e /* Kana Shift */
+#define XK_Eisu_Shift 0xff2f /* Alphanumeric Shift */
+#define XK_Eisu_toggle 0xff30 /* Alphanumeric toggle */
+#define XK_Kanji_Bangou 0xff37 /* Codeinput */
+#define XK_Zen_Koho 0xff3d /* Multiple/All Candidate(s) */
+#define XK_Mae_Koho 0xff3e /* Previous Candidate */
+
+/* 0xff31 thru 0xff3f are under XK_KOREAN */
+
+/* Cursor control & motion */
+
+#define XK_Home 0xff50
+#define XK_Left 0xff51 /* Move left, left arrow */
+#define XK_Up 0xff52 /* Move up, up arrow */
+#define XK_Right 0xff53 /* Move right, right arrow */
+#define XK_Down 0xff54 /* Move down, down arrow */
+#define XK_Prior 0xff55 /* Prior, previous */
+#define XK_Page_Up 0xff55
+#define XK_Next 0xff56 /* Next */
+#define XK_Page_Down 0xff56
+#define XK_End 0xff57 /* EOL */
+#define XK_Begin 0xff58 /* BOL */
+
+
+/* Misc functions */
+
+#define XK_Select 0xff60 /* Select, mark */
+#define XK_Print 0xff61
+#define XK_Execute 0xff62 /* Execute, run, do */
+#define XK_Insert 0xff63 /* Insert, insert here */
+#define XK_Undo 0xff65
+#define XK_Redo 0xff66 /* Redo, again */
+#define XK_Menu 0xff67
+#define XK_Find 0xff68 /* Find, search */
+#define XK_Cancel 0xff69 /* Cancel, stop, abort, exit */
+#define XK_Help 0xff6a /* Help */
+#define XK_Break 0xff6b
+#define XK_Mode_switch 0xff7e /* Character set switch */
+#define XK_script_switch 0xff7e /* Alias for mode_switch */
+#define XK_Num_Lock 0xff7f
+
+/* Keypad functions, keypad numbers cleverly chosen to map to ASCII */
+
+#define XK_KP_Space 0xff80 /* Space */
+#define XK_KP_Tab 0xff89
+#define XK_KP_Enter 0xff8d /* Enter */
+#define XK_KP_F1 0xff91 /* PF1, KP_A, ... */
+#define XK_KP_F2 0xff92
+#define XK_KP_F3 0xff93
+#define XK_KP_F4 0xff94
+#define XK_KP_Home 0xff95
+#define XK_KP_Left 0xff96
+#define XK_KP_Up 0xff97
+#define XK_KP_Right 0xff98
+#define XK_KP_Down 0xff99
+#define XK_KP_Prior 0xff9a
+#define XK_KP_Page_Up 0xff9a
+#define XK_KP_Next 0xff9b
+#define XK_KP_Page_Down 0xff9b
+#define XK_KP_End 0xff9c
+#define XK_KP_Begin 0xff9d
+#define XK_KP_Insert 0xff9e
+#define XK_KP_Delete 0xff9f
+#define XK_KP_Equal 0xffbd /* Equals */
+#define XK_KP_Multiply 0xffaa
+#define XK_KP_Add 0xffab
+#define XK_KP_Separator 0xffac /* Separator, often comma */
+#define XK_KP_Subtract 0xffad
+#define XK_KP_Decimal 0xffae
+#define XK_KP_Divide 0xffaf
+
+#define XK_KP_0 0xffb0
+#define XK_KP_1 0xffb1
+#define XK_KP_2 0xffb2
+#define XK_KP_3 0xffb3
+#define XK_KP_4 0xffb4
+#define XK_KP_5 0xffb5
+#define XK_KP_6 0xffb6
+#define XK_KP_7 0xffb7
+#define XK_KP_8 0xffb8
+#define XK_KP_9 0xffb9
+
+
+
+/*
+ * Auxiliary functions; note the duplicate definitions for left and right
+ * function keys; Sun keyboards and a few other manufacturers have such
+ * function key groups on the left and/or right sides of the keyboard.
+ * We've not found a keyboard with more than 35 function keys total.
+ */
+
+#define XK_F1 0xffbe
+#define XK_F2 0xffbf
+#define XK_F3 0xffc0
+#define XK_F4 0xffc1
+#define XK_F5 0xffc2
+#define XK_F6 0xffc3
+#define XK_F7 0xffc4
+#define XK_F8 0xffc5
+#define XK_F9 0xffc6
+#define XK_F10 0xffc7
+#define XK_F11 0xffc8
+#define XK_L1 0xffc8
+#define XK_F12 0xffc9
+#define XK_L2 0xffc9
+#define XK_F13 0xffca
+#define XK_L3 0xffca
+#define XK_F14 0xffcb
+#define XK_L4 0xffcb
+#define XK_F15 0xffcc
+#define XK_L5 0xffcc
+#define XK_F16 0xffcd
+#define XK_L6 0xffcd
+#define XK_F17 0xffce
+#define XK_L7 0xffce
+#define XK_F18 0xffcf
+#define XK_L8 0xffcf
+#define XK_F19 0xffd0
+#define XK_L9 0xffd0
+#define XK_F20 0xffd1
+#define XK_L10 0xffd1
+#define XK_F21 0xffd2
+#define XK_R1 0xffd2
+#define XK_F22 0xffd3
+#define XK_R2 0xffd3
+#define XK_F23 0xffd4
+#define XK_R3 0xffd4
+#define XK_F24 0xffd5
+#define XK_R4 0xffd5
+#define XK_F25 0xffd6
+#define XK_R5 0xffd6
+#define XK_F26 0xffd7
+#define XK_R6 0xffd7
+#define XK_F27 0xffd8
+#define XK_R7 0xffd8
+#define XK_F28 0xffd9
+#define XK_R8 0xffd9
+#define XK_F29 0xffda
+#define XK_R9 0xffda
+#define XK_F30 0xffdb
+#define XK_R10 0xffdb
+#define XK_F31 0xffdc
+#define XK_R11 0xffdc
+#define XK_F32 0xffdd
+#define XK_R12 0xffdd
+#define XK_F33 0xffde
+#define XK_R13 0xffde
+#define XK_F34 0xffdf
+#define XK_R14 0xffdf
+#define XK_F35 0xffe0
+#define XK_R15 0xffe0
+
+/* Modifiers */
+
+#define XK_Shift_L 0xffe1 /* Left shift */
+#define XK_Shift_R 0xffe2 /* Right shift */
+#define XK_Control_L 0xffe3 /* Left control */
+#define XK_Control_R 0xffe4 /* Right control */
+#define XK_Caps_Lock 0xffe5 /* Caps lock */
+#define XK_Shift_Lock 0xffe6 /* Shift lock */
+
+#define XK_Meta_L 0xffe7 /* Left meta */
+#define XK_Meta_R 0xffe8 /* Right meta */
+#define XK_Alt_L 0xffe9 /* Left alt */
+#define XK_Alt_R 0xffea /* Right alt */
+#define XK_Super_L 0xffeb /* Left super */
+#define XK_Super_R 0xffec /* Right super */
+#define XK_Hyper_L 0xffed /* Left hyper */
+#define XK_Hyper_R 0xffee /* Right hyper */
+#endif /* XK_MISCELLANY */
+
+/*
+ * Keyboard (XKB) Extension function and modifier keys
+ * (from Appendix C of "The X Keyboard Extension: Protocol Specification")
+ * Byte 3 = 0xfe
+ */
+
+#ifdef XK_XKB_KEYS
+#define XK_ISO_Lock 0xfe01
+#define XK_ISO_Level2_Latch 0xfe02
+#define XK_ISO_Level3_Shift 0xfe03
+#define XK_ISO_Level3_Latch 0xfe04
+#define XK_ISO_Level3_Lock 0xfe05
+#define XK_ISO_Level5_Shift 0xfe11
+#define XK_ISO_Level5_Latch 0xfe12
+#define XK_ISO_Level5_Lock 0xfe13
+#define XK_ISO_Group_Shift 0xff7e /* Alias for mode_switch */
+#define XK_ISO_Group_Latch 0xfe06
+#define XK_ISO_Group_Lock 0xfe07
+#define XK_ISO_Next_Group 0xfe08
+#define XK_ISO_Next_Group_Lock 0xfe09
+#define XK_ISO_Prev_Group 0xfe0a
+#define XK_ISO_Prev_Group_Lock 0xfe0b
+#define XK_ISO_First_Group 0xfe0c
+#define XK_ISO_First_Group_Lock 0xfe0d
+#define XK_ISO_Last_Group 0xfe0e
+#define XK_ISO_Last_Group_Lock 0xfe0f
+
+#define XK_ISO_Left_Tab 0xfe20
+#define XK_ISO_Move_Line_Up 0xfe21
+#define XK_ISO_Move_Line_Down 0xfe22
+#define XK_ISO_Partial_Line_Up 0xfe23
+#define XK_ISO_Partial_Line_Down 0xfe24
+#define XK_ISO_Partial_Space_Left 0xfe25
+#define XK_ISO_Partial_Space_Right 0xfe26
+#define XK_ISO_Set_Margin_Left 0xfe27
+#define XK_ISO_Set_Margin_Right 0xfe28
+#define XK_ISO_Release_Margin_Left 0xfe29
+#define XK_ISO_Release_Margin_Right 0xfe2a
+#define XK_ISO_Release_Both_Margins 0xfe2b
+#define XK_ISO_Fast_Cursor_Left 0xfe2c
+#define XK_ISO_Fast_Cursor_Right 0xfe2d
+#define XK_ISO_Fast_Cursor_Up 0xfe2e
+#define XK_ISO_Fast_Cursor_Down 0xfe2f
+#define XK_ISO_Continuous_Underline 0xfe30
+#define XK_ISO_Discontinuous_Underline 0xfe31
+#define XK_ISO_Emphasize 0xfe32
+#define XK_ISO_Center_Object 0xfe33
+#define XK_ISO_Enter 0xfe34
+
+#define XK_dead_grave 0xfe50
+#define XK_dead_acute 0xfe51
+#define XK_dead_circumflex 0xfe52
+#define XK_dead_tilde 0xfe53
+#define XK_dead_macron 0xfe54
+#define XK_dead_breve 0xfe55
+#define XK_dead_abovedot 0xfe56
+#define XK_dead_diaeresis 0xfe57
+#define XK_dead_abovering 0xfe58
+#define XK_dead_doubleacute 0xfe59
+#define XK_dead_caron 0xfe5a
+#define XK_dead_cedilla 0xfe5b
+#define XK_dead_ogonek 0xfe5c
+#define XK_dead_iota 0xfe5d
+#define XK_dead_voiced_sound 0xfe5e
+#define XK_dead_semivoiced_sound 0xfe5f
+#define XK_dead_belowdot 0xfe60
+#define XK_dead_hook 0xfe61
+#define XK_dead_horn 0xfe62
+#define XK_dead_stroke 0xfe63
+#define XK_dead_abovecomma 0xfe64
+#define XK_dead_psili 0xfe64 /* alias for dead_abovecomma */
+#define XK_dead_abovereversedcomma 0xfe65
+#define XK_dead_dasia 0xfe66 /* alias for dead_abovereversedcomma */
+
+#define XK_First_Virtual_Screen 0xfed0
+#define XK_Prev_Virtual_Screen 0xfed1
+#define XK_Next_Virtual_Screen 0xfed2
+#define XK_Last_Virtual_Screen 0xfed4
+#define XK_Terminate_Server 0xfed5
+
+#define XK_AccessX_Enable 0xfe70
+#define XK_AccessX_Feedback_Enable 0xfe71
+#define XK_RepeatKeys_Enable 0xfe72
+#define XK_SlowKeys_Enable 0xfe73
+#define XK_BounceKeys_Enable 0xfe74
+#define XK_StickyKeys_Enable 0xfe75
+#define XK_MouseKeys_Enable 0xfe76
+#define XK_MouseKeys_Accel_Enable 0xfe77
+#define XK_Overlay1_Enable 0xfe78
+#define XK_Overlay2_Enable 0xfe79
+#define XK_AudibleBell_Enable 0xfe7a
+
+#define XK_Pointer_Left 0xfee0
+#define XK_Pointer_Right 0xfee1
+#define XK_Pointer_Up 0xfee2
+#define XK_Pointer_Down 0xfee3
+#define XK_Pointer_UpLeft 0xfee4
+#define XK_Pointer_UpRight 0xfee5
+#define XK_Pointer_DownLeft 0xfee6
+#define XK_Pointer_DownRight 0xfee7
+#define XK_Pointer_Button_Dflt 0xfee8
+#define XK_Pointer_Button1 0xfee9
+#define XK_Pointer_Button2 0xfeea
+#define XK_Pointer_Button3 0xfeeb
+#define XK_Pointer_Button4 0xfeec
+#define XK_Pointer_Button5 0xfeed
+#define XK_Pointer_DblClick_Dflt 0xfeee
+#define XK_Pointer_DblClick1 0xfeef
+#define XK_Pointer_DblClick2 0xfef0
+#define XK_Pointer_DblClick3 0xfef1
+#define XK_Pointer_DblClick4 0xfef2
+#define XK_Pointer_DblClick5 0xfef3
+#define XK_Pointer_Drag_Dflt 0xfef4
+#define XK_Pointer_Drag1 0xfef5
+#define XK_Pointer_Drag2 0xfef6
+#define XK_Pointer_Drag3 0xfef7
+#define XK_Pointer_Drag4 0xfef8
+#define XK_Pointer_Drag5 0xfefd
+
+#define XK_Pointer_EnableKeys 0xfef9
+#define XK_Pointer_Accelerate 0xfefa
+#define XK_Pointer_DfltBtnNext 0xfefb
+#define XK_Pointer_DfltBtnPrev 0xfefc
+
+#endif /* XK_XKB_KEYS */
+
+/*
+ * 3270 Terminal Keys
+ * Byte 3 = 0xfd
+ */
+
+#ifdef XK_3270
+#define XK_3270_Duplicate 0xfd01
+#define XK_3270_FieldMark 0xfd02
+#define XK_3270_Right2 0xfd03
+#define XK_3270_Left2 0xfd04
+#define XK_3270_BackTab 0xfd05
+#define XK_3270_EraseEOF 0xfd06
+#define XK_3270_EraseInput 0xfd07
+#define XK_3270_Reset 0xfd08
+#define XK_3270_Quit 0xfd09
+#define XK_3270_PA1 0xfd0a
+#define XK_3270_PA2 0xfd0b
+#define XK_3270_PA3 0xfd0c
+#define XK_3270_Test 0xfd0d
+#define XK_3270_Attn 0xfd0e
+#define XK_3270_CursorBlink 0xfd0f
+#define XK_3270_AltCursor 0xfd10
+#define XK_3270_KeyClick 0xfd11
+#define XK_3270_Jump 0xfd12
+#define XK_3270_Ident 0xfd13
+#define XK_3270_Rule 0xfd14
+#define XK_3270_Copy 0xfd15
+#define XK_3270_Play 0xfd16
+#define XK_3270_Setup 0xfd17
+#define XK_3270_Record 0xfd18
+#define XK_3270_ChangeScreen 0xfd19
+#define XK_3270_DeleteWord 0xfd1a
+#define XK_3270_ExSelect 0xfd1b
+#define XK_3270_CursorSelect 0xfd1c
+#define XK_3270_PrintScreen 0xfd1d
+#define XK_3270_Enter 0xfd1e
+#endif /* XK_3270 */
+
+/*
+ * Latin 1
+ * (ISO/IEC 8859-1 = Unicode U+0020..U+00FF)
+ * Byte 3 = 0
+ */
+#ifdef XK_LATIN1
+#define XK_space 0x0020 /* U+0020 SPACE */
+#define XK_exclam 0x0021 /* U+0021 EXCLAMATION MARK */
+#define XK_quotedbl 0x0022 /* U+0022 QUOTATION MARK */
+#define XK_numbersign 0x0023 /* U+0023 NUMBER SIGN */
+#define XK_dollar 0x0024 /* U+0024 DOLLAR SIGN */
+#define XK_percent 0x0025 /* U+0025 PERCENT SIGN */
+#define XK_ampersand 0x0026 /* U+0026 AMPERSAND */
+#define XK_apostrophe 0x0027 /* U+0027 APOSTROPHE */
+#define XK_quoteright 0x0027 /* deprecated */
+#define XK_parenleft 0x0028 /* U+0028 LEFT PARENTHESIS */
+#define XK_parenright 0x0029 /* U+0029 RIGHT PARENTHESIS */
+#define XK_asterisk 0x002a /* U+002A ASTERISK */
+#define XK_plus 0x002b /* U+002B PLUS SIGN */
+#define XK_comma 0x002c /* U+002C COMMA */
+#define XK_minus 0x002d /* U+002D HYPHEN-MINUS */
+#define XK_period 0x002e /* U+002E FULL STOP */
+#define XK_slash 0x002f /* U+002F SOLIDUS */
+#define XK_0 0x0030 /* U+0030 DIGIT ZERO */
+#define XK_1 0x0031 /* U+0031 DIGIT ONE */
+#define XK_2 0x0032 /* U+0032 DIGIT TWO */
+#define XK_3 0x0033 /* U+0033 DIGIT THREE */
+#define XK_4 0x0034 /* U+0034 DIGIT FOUR */
+#define XK_5 0x0035 /* U+0035 DIGIT FIVE */
+#define XK_6 0x0036 /* U+0036 DIGIT SIX */
+#define XK_7 0x0037 /* U+0037 DIGIT SEVEN */
+#define XK_8 0x0038 /* U+0038 DIGIT EIGHT */
+#define XK_9 0x0039 /* U+0039 DIGIT NINE */
+#define XK_colon 0x003a /* U+003A COLON */
+#define XK_semicolon 0x003b /* U+003B SEMICOLON */
+#define XK_less 0x003c /* U+003C LESS-THAN SIGN */
+#define XK_equal 0x003d /* U+003D EQUALS SIGN */
+#define XK_greater 0x003e /* U+003E GREATER-THAN SIGN */
+#define XK_question 0x003f /* U+003F QUESTION MARK */
+#define XK_at 0x0040 /* U+0040 COMMERCIAL AT */
+#define XK_A 0x0041 /* U+0041 LATIN CAPITAL LETTER A */
+#define XK_B 0x0042 /* U+0042 LATIN CAPITAL LETTER B */
+#define XK_C 0x0043 /* U+0043 LATIN CAPITAL LETTER C */
+#define XK_D 0x0044 /* U+0044 LATIN CAPITAL LETTER D */
+#define XK_E 0x0045 /* U+0045 LATIN CAPITAL LETTER E */
+#define XK_F 0x0046 /* U+0046 LATIN CAPITAL LETTER F */
+#define XK_G 0x0047 /* U+0047 LATIN CAPITAL LETTER G */
+#define XK_H 0x0048 /* U+0048 LATIN CAPITAL LETTER H */
+#define XK_I 0x0049 /* U+0049 LATIN CAPITAL LETTER I */
+#define XK_J 0x004a /* U+004A LATIN CAPITAL LETTER J */
+#define XK_K 0x004b /* U+004B LATIN CAPITAL LETTER K */
+#define XK_L 0x004c /* U+004C LATIN CAPITAL LETTER L */
+#define XK_M 0x004d /* U+004D LATIN CAPITAL LETTER M */
+#define XK_N 0x004e /* U+004E LATIN CAPITAL LETTER N */
+#define XK_O 0x004f /* U+004F LATIN CAPITAL LETTER O */
+#define XK_P 0x0050 /* U+0050 LATIN CAPITAL LETTER P */
+#define XK_Q 0x0051 /* U+0051 LATIN CAPITAL LETTER Q */
+#define XK_R 0x0052 /* U+0052 LATIN CAPITAL LETTER R */
+#define XK_S 0x0053 /* U+0053 LATIN CAPITAL LETTER S */
+#define XK_T 0x0054 /* U+0054 LATIN CAPITAL LETTER T */
+#define XK_U 0x0055 /* U+0055 LATIN CAPITAL LETTER U */
+#define XK_V 0x0056 /* U+0056 LATIN CAPITAL LETTER V */
+#define XK_W 0x0057 /* U+0057 LATIN CAPITAL LETTER W */
+#define XK_X 0x0058 /* U+0058 LATIN CAPITAL LETTER X */
+#define XK_Y 0x0059 /* U+0059 LATIN CAPITAL LETTER Y */
+#define XK_Z 0x005a /* U+005A LATIN CAPITAL LETTER Z */
+#define XK_bracketleft 0x005b /* U+005B LEFT SQUARE BRACKET */
+#define XK_backslash 0x005c /* U+005C REVERSE SOLIDUS */
+#define XK_bracketright 0x005d /* U+005D RIGHT SQUARE BRACKET */
+#define XK_asciicircum 0x005e /* U+005E CIRCUMFLEX ACCENT */
+#define XK_underscore 0x005f /* U+005F LOW LINE */
+#define XK_grave 0x0060 /* U+0060 GRAVE ACCENT */
+#define XK_quoteleft 0x0060 /* deprecated */
+#define XK_a 0x0061 /* U+0061 LATIN SMALL LETTER A */
+#define XK_b 0x0062 /* U+0062 LATIN SMALL LETTER B */
+#define XK_c 0x0063 /* U+0063 LATIN SMALL LETTER C */
+#define XK_d 0x0064 /* U+0064 LATIN SMALL LETTER D */
+#define XK_e 0x0065 /* U+0065 LATIN SMALL LETTER E */
+#define XK_f 0x0066 /* U+0066 LATIN SMALL LETTER F */
+#define XK_g 0x0067 /* U+0067 LATIN SMALL LETTER G */
+#define XK_h 0x0068 /* U+0068 LATIN SMALL LETTER H */
+#define XK_i 0x0069 /* U+0069 LATIN SMALL LETTER I */
+#define XK_j 0x006a /* U+006A LATIN SMALL LETTER J */
+#define XK_k 0x006b /* U+006B LATIN SMALL LETTER K */
+#define XK_l 0x006c /* U+006C LATIN SMALL LETTER L */
+#define XK_m 0x006d /* U+006D LATIN SMALL LETTER M */
+#define XK_n 0x006e /* U+006E LATIN SMALL LETTER N */
+#define XK_o 0x006f /* U+006F LATIN SMALL LETTER O */
+#define XK_p 0x0070 /* U+0070 LATIN SMALL LETTER P */
+#define XK_q 0x0071 /* U+0071 LATIN SMALL LETTER Q */
+#define XK_r 0x0072 /* U+0072 LATIN SMALL LETTER R */
+#define XK_s 0x0073 /* U+0073 LATIN SMALL LETTER S */
+#define XK_t 0x0074 /* U+0074 LATIN SMALL LETTER T */
+#define XK_u 0x0075 /* U+0075 LATIN SMALL LETTER U */
+#define XK_v 0x0076 /* U+0076 LATIN SMALL LETTER V */
+#define XK_w 0x0077 /* U+0077 LATIN SMALL LETTER W */
+#define XK_x 0x0078 /* U+0078 LATIN SMALL LETTER X */
+#define XK_y 0x0079 /* U+0079 LATIN SMALL LETTER Y */
+#define XK_z 0x007a /* U+007A LATIN SMALL LETTER Z */
+#define XK_braceleft 0x007b /* U+007B LEFT CURLY BRACKET */
+#define XK_bar 0x007c /* U+007C VERTICAL LINE */
+#define XK_braceright 0x007d /* U+007D RIGHT CURLY BRACKET */
+#define XK_asciitilde 0x007e /* U+007E TILDE */
+
+#define XK_nobreakspace 0x00a0 /* U+00A0 NO-BREAK SPACE */
+#define XK_exclamdown 0x00a1 /* U+00A1 INVERTED EXCLAMATION MARK */
+#define XK_cent 0x00a2 /* U+00A2 CENT SIGN */
+#define XK_sterling 0x00a3 /* U+00A3 POUND SIGN */
+#define XK_currency 0x00a4 /* U+00A4 CURRENCY SIGN */
+#define XK_yen 0x00a5 /* U+00A5 YEN SIGN */
+#define XK_brokenbar 0x00a6 /* U+00A6 BROKEN BAR */
+#define XK_section 0x00a7 /* U+00A7 SECTION SIGN */
+#define XK_diaeresis 0x00a8 /* U+00A8 DIAERESIS */
+#define XK_copyright 0x00a9 /* U+00A9 COPYRIGHT SIGN */
+#define XK_ordfeminine 0x00aa /* U+00AA FEMININE ORDINAL INDICATOR */
+#define XK_guillemotleft 0x00ab /* U+00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK */
+#define XK_notsign 0x00ac /* U+00AC NOT SIGN */
+#define XK_hyphen 0x00ad /* U+00AD SOFT HYPHEN */
+#define XK_registered 0x00ae /* U+00AE REGISTERED SIGN */
+#define XK_macron 0x00af /* U+00AF MACRON */
+#define XK_degree 0x00b0 /* U+00B0 DEGREE SIGN */
+#define XK_plusminus 0x00b1 /* U+00B1 PLUS-MINUS SIGN */
+#define XK_twosuperior 0x00b2 /* U+00B2 SUPERSCRIPT TWO */
+#define XK_threesuperior 0x00b3 /* U+00B3 SUPERSCRIPT THREE */
+#define XK_acute 0x00b4 /* U+00B4 ACUTE ACCENT */
+#define XK_mu 0x00b5 /* U+00B5 MICRO SIGN */
+#define XK_paragraph 0x00b6 /* U+00B6 PILCROW SIGN */
+#define XK_periodcentered 0x00b7 /* U+00B7 MIDDLE DOT */
+#define XK_cedilla 0x00b8 /* U+00B8 CEDILLA */
+#define XK_onesuperior 0x00b9 /* U+00B9 SUPERSCRIPT ONE */
+#define XK_masculine 0x00ba /* U+00BA MASCULINE ORDINAL INDICATOR */
+#define XK_guillemotright 0x00bb /* U+00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK */
+#define XK_onequarter 0x00bc /* U+00BC VULGAR FRACTION ONE QUARTER */
+#define XK_onehalf 0x00bd /* U+00BD VULGAR FRACTION ONE HALF */
+#define XK_threequarters 0x00be /* U+00BE VULGAR FRACTION THREE QUARTERS */
+#define XK_questiondown 0x00bf /* U+00BF INVERTED QUESTION MARK */
+#define XK_Agrave 0x00c0 /* U+00C0 LATIN CAPITAL LETTER A WITH GRAVE */
+#define XK_Aacute 0x00c1 /* U+00C1 LATIN CAPITAL LETTER A WITH ACUTE */
+#define XK_Acircumflex 0x00c2 /* U+00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX */
+#define XK_Atilde 0x00c3 /* U+00C3 LATIN CAPITAL LETTER A WITH TILDE */
+#define XK_Adiaeresis 0x00c4 /* U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS */
+#define XK_Aring 0x00c5 /* U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE */
+#define XK_AE 0x00c6 /* U+00C6 LATIN CAPITAL LETTER AE */
+#define XK_Ccedilla 0x00c7 /* U+00C7 LATIN CAPITAL LETTER C WITH CEDILLA */
+#define XK_Egrave 0x00c8 /* U+00C8 LATIN CAPITAL LETTER E WITH GRAVE */
+#define XK_Eacute 0x00c9 /* U+00C9 LATIN CAPITAL LETTER E WITH ACUTE */
+#define XK_Ecircumflex 0x00ca /* U+00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX */
+#define XK_Ediaeresis 0x00cb /* U+00CB LATIN CAPITAL LETTER E WITH DIAERESIS */
+#define XK_Igrave 0x00cc /* U+00CC LATIN CAPITAL LETTER I WITH GRAVE */
+#define XK_Iacute 0x00cd /* U+00CD LATIN CAPITAL LETTER I WITH ACUTE */
+#define XK_Icircumflex 0x00ce /* U+00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX */
+#define XK_Idiaeresis 0x00cf /* U+00CF LATIN CAPITAL LETTER I WITH DIAERESIS */
+#define XK_ETH 0x00d0 /* U+00D0 LATIN CAPITAL LETTER ETH */
+#define XK_Eth 0x00d0 /* deprecated */
+#define XK_Ntilde 0x00d1 /* U+00D1 LATIN CAPITAL LETTER N WITH TILDE */
+#define XK_Ograve 0x00d2 /* U+00D2 LATIN CAPITAL LETTER O WITH GRAVE */
+#define XK_Oacute 0x00d3 /* U+00D3 LATIN CAPITAL LETTER O WITH ACUTE */
+#define XK_Ocircumflex 0x00d4 /* U+00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX */
+#define XK_Otilde 0x00d5 /* U+00D5 LATIN CAPITAL LETTER O WITH TILDE */
+#define XK_Odiaeresis 0x00d6 /* U+00D6 LATIN CAPITAL LETTER O WITH DIAERESIS */
+#define XK_multiply 0x00d7 /* U+00D7 MULTIPLICATION SIGN */
+#define XK_Oslash 0x00d8 /* U+00D8 LATIN CAPITAL LETTER O WITH STROKE */
+#define XK_Ooblique 0x00d8 /* U+00D8 LATIN CAPITAL LETTER O WITH STROKE */
+#define XK_Ugrave 0x00d9 /* U+00D9 LATIN CAPITAL LETTER U WITH GRAVE */
+#define XK_Uacute 0x00da /* U+00DA LATIN CAPITAL LETTER U WITH ACUTE */
+#define XK_Ucircumflex 0x00db /* U+00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX */
+#define XK_Udiaeresis 0x00dc /* U+00DC LATIN CAPITAL LETTER U WITH DIAERESIS */
+#define XK_Yacute 0x00dd /* U+00DD LATIN CAPITAL LETTER Y WITH ACUTE */
+#define XK_THORN 0x00de /* U+00DE LATIN CAPITAL LETTER THORN */
+#define XK_Thorn 0x00de /* deprecated */
+#define XK_ssharp 0x00df /* U+00DF LATIN SMALL LETTER SHARP S */
+#define XK_agrave 0x00e0 /* U+00E0 LATIN SMALL LETTER A WITH GRAVE */
+#define XK_aacute 0x00e1 /* U+00E1 LATIN SMALL LETTER A WITH ACUTE */
+#define XK_acircumflex 0x00e2 /* U+00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX */
+#define XK_atilde 0x00e3 /* U+00E3 LATIN SMALL LETTER A WITH TILDE */
+#define XK_adiaeresis 0x00e4 /* U+00E4 LATIN SMALL LETTER A WITH DIAERESIS */
+#define XK_aring 0x00e5 /* U+00E5 LATIN SMALL LETTER A WITH RING ABOVE */
+#define XK_ae 0x00e6 /* U+00E6 LATIN SMALL LETTER AE */
+#define XK_ccedilla 0x00e7 /* U+00E7 LATIN SMALL LETTER C WITH CEDILLA */
+#define XK_egrave 0x00e8 /* U+00E8 LATIN SMALL LETTER E WITH GRAVE */
+#define XK_eacute 0x00e9 /* U+00E9 LATIN SMALL LETTER E WITH ACUTE */
+#define XK_ecircumflex 0x00ea /* U+00EA LATIN SMALL LETTER E WITH CIRCUMFLEX */
+#define XK_ediaeresis 0x00eb /* U+00EB LATIN SMALL LETTER E WITH DIAERESIS */
+#define XK_igrave 0x00ec /* U+00EC LATIN SMALL LETTER I WITH GRAVE */
+#define XK_iacute 0x00ed /* U+00ED LATIN SMALL LETTER I WITH ACUTE */
+#define XK_icircumflex 0x00ee /* U+00EE LATIN SMALL LETTER I WITH CIRCUMFLEX */
+#define XK_idiaeresis 0x00ef /* U+00EF LATIN SMALL LETTER I WITH DIAERESIS */
+#define XK_eth 0x00f0 /* U+00F0 LATIN SMALL LETTER ETH */
+#define XK_ntilde 0x00f1 /* U+00F1 LATIN SMALL LETTER N WITH TILDE */
+#define XK_ograve 0x00f2 /* U+00F2 LATIN SMALL LETTER O WITH GRAVE */
+#define XK_oacute 0x00f3 /* U+00F3 LATIN SMALL LETTER O WITH ACUTE */
+#define XK_ocircumflex 0x00f4 /* U+00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX */
+#define XK_otilde 0x00f5 /* U+00F5 LATIN SMALL LETTER O WITH TILDE */
+#define XK_odiaeresis 0x00f6 /* U+00F6 LATIN SMALL LETTER O WITH DIAERESIS */
+#define XK_division 0x00f7 /* U+00F7 DIVISION SIGN */
+#define XK_oslash 0x00f8 /* U+00F8 LATIN SMALL LETTER O WITH STROKE */
+#define XK_ooblique 0x00f8 /* U+00F8 LATIN SMALL LETTER O WITH STROKE */
+#define XK_ugrave 0x00f9 /* U+00F9 LATIN SMALL LETTER U WITH GRAVE */
+#define XK_uacute 0x00fa /* U+00FA LATIN SMALL LETTER U WITH ACUTE */
+#define XK_ucircumflex 0x00fb /* U+00FB LATIN SMALL LETTER U WITH CIRCUMFLEX */
+#define XK_udiaeresis 0x00fc /* U+00FC LATIN SMALL LETTER U WITH DIAERESIS */
+#define XK_yacute 0x00fd /* U+00FD LATIN SMALL LETTER Y WITH ACUTE */
+#define XK_thorn 0x00fe /* U+00FE LATIN SMALL LETTER THORN */
+#define XK_ydiaeresis 0x00ff /* U+00FF LATIN SMALL LETTER Y WITH DIAERESIS */
+#endif /* XK_LATIN1 */
+
+/*
+ * Latin 2
+ * Byte 3 = 1
+ */
+
+#ifdef XK_LATIN2
+#define XK_Aogonek 0x01a1 /* U+0104 LATIN CAPITAL LETTER A WITH OGONEK */
+#define XK_breve 0x01a2 /* U+02D8 BREVE */
+#define XK_Lstroke 0x01a3 /* U+0141 LATIN CAPITAL LETTER L WITH STROKE */
+#define XK_Lcaron 0x01a5 /* U+013D LATIN CAPITAL LETTER L WITH CARON */
+#define XK_Sacute 0x01a6 /* U+015A LATIN CAPITAL LETTER S WITH ACUTE */
+#define XK_Scaron 0x01a9 /* U+0160 LATIN CAPITAL LETTER S WITH CARON */
+#define XK_Scedilla 0x01aa /* U+015E LATIN CAPITAL LETTER S WITH CEDILLA */
+#define XK_Tcaron 0x01ab /* U+0164 LATIN CAPITAL LETTER T WITH CARON */
+#define XK_Zacute 0x01ac /* U+0179 LATIN CAPITAL LETTER Z WITH ACUTE */
+#define XK_Zcaron 0x01ae /* U+017D LATIN CAPITAL LETTER Z WITH CARON */
+#define XK_Zabovedot 0x01af /* U+017B LATIN CAPITAL LETTER Z WITH DOT ABOVE */
+#define XK_aogonek 0x01b1 /* U+0105 LATIN SMALL LETTER A WITH OGONEK */
+#define XK_ogonek 0x01b2 /* U+02DB OGONEK */
+#define XK_lstroke 0x01b3 /* U+0142 LATIN SMALL LETTER L WITH STROKE */
+#define XK_lcaron 0x01b5 /* U+013E LATIN SMALL LETTER L WITH CARON */
+#define XK_sacute 0x01b6 /* U+015B LATIN SMALL LETTER S WITH ACUTE */
+#define XK_caron 0x01b7 /* U+02C7 CARON */
+#define XK_scaron 0x01b9 /* U+0161 LATIN SMALL LETTER S WITH CARON */
+#define XK_scedilla 0x01ba /* U+015F LATIN SMALL LETTER S WITH CEDILLA */
+#define XK_tcaron 0x01bb /* U+0165 LATIN SMALL LETTER T WITH CARON */
+#define XK_zacute 0x01bc /* U+017A LATIN SMALL LETTER Z WITH ACUTE */
+#define XK_doubleacute 0x01bd /* U+02DD DOUBLE ACUTE ACCENT */
+#define XK_zcaron 0x01be /* U+017E LATIN SMALL LETTER Z WITH CARON */
+#define XK_zabovedot 0x01bf /* U+017C LATIN SMALL LETTER Z WITH DOT ABOVE */
+#define XK_Racute 0x01c0 /* U+0154 LATIN CAPITAL LETTER R WITH ACUTE */
+#define XK_Abreve 0x01c3 /* U+0102 LATIN CAPITAL LETTER A WITH BREVE */
+#define XK_Lacute 0x01c5 /* U+0139 LATIN CAPITAL LETTER L WITH ACUTE */
+#define XK_Cacute 0x01c6 /* U+0106 LATIN CAPITAL LETTER C WITH ACUTE */
+#define XK_Ccaron 0x01c8 /* U+010C LATIN CAPITAL LETTER C WITH CARON */
+#define XK_Eogonek 0x01ca /* U+0118 LATIN CAPITAL LETTER E WITH OGONEK */
+#define XK_Ecaron 0x01cc /* U+011A LATIN CAPITAL LETTER E WITH CARON */
+#define XK_Dcaron 0x01cf /* U+010E LATIN CAPITAL LETTER D WITH CARON */
+#define XK_Dstroke 0x01d0 /* U+0110 LATIN CAPITAL LETTER D WITH STROKE */
+#define XK_Nacute 0x01d1 /* U+0143 LATIN CAPITAL LETTER N WITH ACUTE */
+#define XK_Ncaron 0x01d2 /* U+0147 LATIN CAPITAL LETTER N WITH CARON */
+#define XK_Odoubleacute 0x01d5 /* U+0150 LATIN CAPITAL LETTER O WITH DOUBLE ACUTE */
+#define XK_Rcaron 0x01d8 /* U+0158 LATIN CAPITAL LETTER R WITH CARON */
+#define XK_Uring 0x01d9 /* U+016E LATIN CAPITAL LETTER U WITH RING ABOVE */
+#define XK_Udoubleacute 0x01db /* U+0170 LATIN CAPITAL LETTER U WITH DOUBLE ACUTE */
+#define XK_Tcedilla 0x01de /* U+0162 LATIN CAPITAL LETTER T WITH CEDILLA */
+#define XK_racute 0x01e0 /* U+0155 LATIN SMALL LETTER R WITH ACUTE */
+#define XK_abreve 0x01e3 /* U+0103 LATIN SMALL LETTER A WITH BREVE */
+#define XK_lacute 0x01e5 /* U+013A LATIN SMALL LETTER L WITH ACUTE */
+#define XK_cacute 0x01e6 /* U+0107 LATIN SMALL LETTER C WITH ACUTE */
+#define XK_ccaron 0x01e8 /* U+010D LATIN SMALL LETTER C WITH CARON */
+#define XK_eogonek 0x01ea /* U+0119 LATIN SMALL LETTER E WITH OGONEK */
+#define XK_ecaron 0x01ec /* U+011B LATIN SMALL LETTER E WITH CARON */
+#define XK_dcaron 0x01ef /* U+010F LATIN SMALL LETTER D WITH CARON */
+#define XK_dstroke 0x01f0 /* U+0111 LATIN SMALL LETTER D WITH STROKE */
+#define XK_nacute 0x01f1 /* U+0144 LATIN SMALL LETTER N WITH ACUTE */
+#define XK_ncaron 0x01f2 /* U+0148 LATIN SMALL LETTER N WITH CARON */
+#define XK_odoubleacute 0x01f5 /* U+0151 LATIN SMALL LETTER O WITH DOUBLE ACUTE */
+#define XK_udoubleacute 0x01fb /* U+0171 LATIN SMALL LETTER U WITH DOUBLE ACUTE */
+#define XK_rcaron 0x01f8 /* U+0159 LATIN SMALL LETTER R WITH CARON */
+#define XK_uring 0x01f9 /* U+016F LATIN SMALL LETTER U WITH RING ABOVE */
+#define XK_tcedilla 0x01fe /* U+0163 LATIN SMALL LETTER T WITH CEDILLA */
+#define XK_abovedot 0x01ff /* U+02D9 DOT ABOVE */
+#endif /* XK_LATIN2 */
+
+/*
+ * Latin 3
+ * Byte 3 = 2
+ */
+
+#ifdef XK_LATIN3
+#define XK_Hstroke 0x02a1 /* U+0126 LATIN CAPITAL LETTER H WITH STROKE */
+#define XK_Hcircumflex 0x02a6 /* U+0124 LATIN CAPITAL LETTER H WITH CIRCUMFLEX */
+#define XK_Iabovedot 0x02a9 /* U+0130 LATIN CAPITAL LETTER I WITH DOT ABOVE */
+#define XK_Gbreve 0x02ab /* U+011E LATIN CAPITAL LETTER G WITH BREVE */
+#define XK_Jcircumflex 0x02ac /* U+0134 LATIN CAPITAL LETTER J WITH CIRCUMFLEX */
+#define XK_hstroke 0x02b1 /* U+0127 LATIN SMALL LETTER H WITH STROKE */
+#define XK_hcircumflex 0x02b6 /* U+0125 LATIN SMALL LETTER H WITH CIRCUMFLEX */
+#define XK_idotless 0x02b9 /* U+0131 LATIN SMALL LETTER DOTLESS I */
+#define XK_gbreve 0x02bb /* U+011F LATIN SMALL LETTER G WITH BREVE */
+#define XK_jcircumflex 0x02bc /* U+0135 LATIN SMALL LETTER J WITH CIRCUMFLEX */
+#define XK_Cabovedot 0x02c5 /* U+010A LATIN CAPITAL LETTER C WITH DOT ABOVE */
+#define XK_Ccircumflex 0x02c6 /* U+0108 LATIN CAPITAL LETTER C WITH CIRCUMFLEX */
+#define XK_Gabovedot 0x02d5 /* U+0120 LATIN CAPITAL LETTER G WITH DOT ABOVE */
+#define XK_Gcircumflex 0x02d8 /* U+011C LATIN CAPITAL LETTER G WITH CIRCUMFLEX */
+#define XK_Ubreve 0x02dd /* U+016C LATIN CAPITAL LETTER U WITH BREVE */
+#define XK_Scircumflex 0x02de /* U+015C LATIN CAPITAL LETTER S WITH CIRCUMFLEX */
+#define XK_cabovedot 0x02e5 /* U+010B LATIN SMALL LETTER C WITH DOT ABOVE */
+#define XK_ccircumflex 0x02e6 /* U+0109 LATIN SMALL LETTER C WITH CIRCUMFLEX */
+#define XK_gabovedot 0x02f5 /* U+0121 LATIN SMALL LETTER G WITH DOT ABOVE */
+#define XK_gcircumflex 0x02f8 /* U+011D LATIN SMALL LETTER G WITH CIRCUMFLEX */
+#define XK_ubreve 0x02fd /* U+016D LATIN SMALL LETTER U WITH BREVE */
+#define XK_scircumflex 0x02fe /* U+015D LATIN SMALL LETTER S WITH CIRCUMFLEX */
+#endif /* XK_LATIN3 */
+
+
+/*
+ * Latin 4
+ * Byte 3 = 3
+ */
+
+#ifdef XK_LATIN4
+#define XK_kra 0x03a2 /* U+0138 LATIN SMALL LETTER KRA */
+#define XK_kappa 0x03a2 /* deprecated */
+#define XK_Rcedilla 0x03a3 /* U+0156 LATIN CAPITAL LETTER R WITH CEDILLA */
+#define XK_Itilde 0x03a5 /* U+0128 LATIN CAPITAL LETTER I WITH TILDE */
+#define XK_Lcedilla 0x03a6 /* U+013B LATIN CAPITAL LETTER L WITH CEDILLA */
+#define XK_Emacron 0x03aa /* U+0112 LATIN CAPITAL LETTER E WITH MACRON */
+#define XK_Gcedilla 0x03ab /* U+0122 LATIN CAPITAL LETTER G WITH CEDILLA */
+#define XK_Tslash 0x03ac /* U+0166 LATIN CAPITAL LETTER T WITH STROKE */
+#define XK_rcedilla 0x03b3 /* U+0157 LATIN SMALL LETTER R WITH CEDILLA */
+#define XK_itilde 0x03b5 /* U+0129 LATIN SMALL LETTER I WITH TILDE */
+#define XK_lcedilla 0x03b6 /* U+013C LATIN SMALL LETTER L WITH CEDILLA */
+#define XK_emacron 0x03ba /* U+0113 LATIN SMALL LETTER E WITH MACRON */
+#define XK_gcedilla 0x03bb /* U+0123 LATIN SMALL LETTER G WITH CEDILLA */
+#define XK_tslash 0x03bc /* U+0167 LATIN SMALL LETTER T WITH STROKE */
+#define XK_ENG 0x03bd /* U+014A LATIN CAPITAL LETTER ENG */
+#define XK_eng 0x03bf /* U+014B LATIN SMALL LETTER ENG */
+#define XK_Amacron 0x03c0 /* U+0100 LATIN CAPITAL LETTER A WITH MACRON */
+#define XK_Iogonek 0x03c7 /* U+012E LATIN CAPITAL LETTER I WITH OGONEK */
+#define XK_Eabovedot 0x03cc /* U+0116 LATIN CAPITAL LETTER E WITH DOT ABOVE */
+#define XK_Imacron 0x03cf /* U+012A LATIN CAPITAL LETTER I WITH MACRON */
+#define XK_Ncedilla 0x03d1 /* U+0145 LATIN CAPITAL LETTER N WITH CEDILLA */
+#define XK_Omacron 0x03d2 /* U+014C LATIN CAPITAL LETTER O WITH MACRON */
+#define XK_Kcedilla 0x03d3 /* U+0136 LATIN CAPITAL LETTER K WITH CEDILLA */
+#define XK_Uogonek 0x03d9 /* U+0172 LATIN CAPITAL LETTER U WITH OGONEK */
+#define XK_Utilde 0x03dd /* U+0168 LATIN CAPITAL LETTER U WITH TILDE */
+#define XK_Umacron 0x03de /* U+016A LATIN CAPITAL LETTER U WITH MACRON */
+#define XK_amacron 0x03e0 /* U+0101 LATIN SMALL LETTER A WITH MACRON */
+#define XK_iogonek 0x03e7 /* U+012F LATIN SMALL LETTER I WITH OGONEK */
+#define XK_eabovedot 0x03ec /* U+0117 LATIN SMALL LETTER E WITH DOT ABOVE */
+#define XK_imacron 0x03ef /* U+012B LATIN SMALL LETTER I WITH MACRON */
+#define XK_ncedilla 0x03f1 /* U+0146 LATIN SMALL LETTER N WITH CEDILLA */
+#define XK_omacron 0x03f2 /* U+014D LATIN SMALL LETTER O WITH MACRON */
+#define XK_kcedilla 0x03f3 /* U+0137 LATIN SMALL LETTER K WITH CEDILLA */
+#define XK_uogonek 0x03f9 /* U+0173 LATIN SMALL LETTER U WITH OGONEK */
+#define XK_utilde 0x03fd /* U+0169 LATIN SMALL LETTER U WITH TILDE */
+#define XK_umacron 0x03fe /* U+016B LATIN SMALL LETTER U WITH MACRON */
+#endif /* XK_LATIN4 */
+
+/*
+ * Latin 8
+ */
+#ifdef XK_LATIN8
+#define XK_Babovedot 0x1001e02 /* U+1E02 LATIN CAPITAL LETTER B WITH DOT ABOVE */
+#define XK_babovedot 0x1001e03 /* U+1E03 LATIN SMALL LETTER B WITH DOT ABOVE */
+#define XK_Dabovedot 0x1001e0a /* U+1E0A LATIN CAPITAL LETTER D WITH DOT ABOVE */
+#define XK_Wgrave 0x1001e80 /* U+1E80 LATIN CAPITAL LETTER W WITH GRAVE */
+#define XK_Wacute 0x1001e82 /* U+1E82 LATIN CAPITAL LETTER W WITH ACUTE */
+#define XK_dabovedot 0x1001e0b /* U+1E0B LATIN SMALL LETTER D WITH DOT ABOVE */
+#define XK_Ygrave 0x1001ef2 /* U+1EF2 LATIN CAPITAL LETTER Y WITH GRAVE */
+#define XK_Fabovedot 0x1001e1e /* U+1E1E LATIN CAPITAL LETTER F WITH DOT ABOVE */
+#define XK_fabovedot 0x1001e1f /* U+1E1F LATIN SMALL LETTER F WITH DOT ABOVE */
+#define XK_Mabovedot 0x1001e40 /* U+1E40 LATIN CAPITAL LETTER M WITH DOT ABOVE */
+#define XK_mabovedot 0x1001e41 /* U+1E41 LATIN SMALL LETTER M WITH DOT ABOVE */
+#define XK_Pabovedot 0x1001e56 /* U+1E56 LATIN CAPITAL LETTER P WITH DOT ABOVE */
+#define XK_wgrave 0x1001e81 /* U+1E81 LATIN SMALL LETTER W WITH GRAVE */
+#define XK_pabovedot 0x1001e57 /* U+1E57 LATIN SMALL LETTER P WITH DOT ABOVE */
+#define XK_wacute 0x1001e83 /* U+1E83 LATIN SMALL LETTER W WITH ACUTE */
+#define XK_Sabovedot 0x1001e60 /* U+1E60 LATIN CAPITAL LETTER S WITH DOT ABOVE */
+#define XK_ygrave 0x1001ef3 /* U+1EF3 LATIN SMALL LETTER Y WITH GRAVE */
+#define XK_Wdiaeresis 0x1001e84 /* U+1E84 LATIN CAPITAL LETTER W WITH DIAERESIS */
+#define XK_wdiaeresis 0x1001e85 /* U+1E85 LATIN SMALL LETTER W WITH DIAERESIS */
+#define XK_sabovedot 0x1001e61 /* U+1E61 LATIN SMALL LETTER S WITH DOT ABOVE */
+#define XK_Wcircumflex 0x1000174 /* U+0174 LATIN CAPITAL LETTER W WITH CIRCUMFLEX */
+#define XK_Tabovedot 0x1001e6a /* U+1E6A LATIN CAPITAL LETTER T WITH DOT ABOVE */
+#define XK_Ycircumflex 0x1000176 /* U+0176 LATIN CAPITAL LETTER Y WITH CIRCUMFLEX */
+#define XK_wcircumflex 0x1000175 /* U+0175 LATIN SMALL LETTER W WITH CIRCUMFLEX */
+#define XK_tabovedot 0x1001e6b /* U+1E6B LATIN SMALL LETTER T WITH DOT ABOVE */
+#define XK_ycircumflex 0x1000177 /* U+0177 LATIN SMALL LETTER Y WITH CIRCUMFLEX */
+#endif /* XK_LATIN8 */
+
+/*
+ * Latin 9
+ * Byte 3 = 0x13
+ */
+
+#ifdef XK_LATIN9
+#define XK_OE 0x13bc /* U+0152 LATIN CAPITAL LIGATURE OE */
+#define XK_oe 0x13bd /* U+0153 LATIN SMALL LIGATURE OE */
+#define XK_Ydiaeresis 0x13be /* U+0178 LATIN CAPITAL LETTER Y WITH DIAERESIS */
+#endif /* XK_LATIN9 */
+
+/*
+ * Katakana
+ * Byte 3 = 4
+ */
+
+#ifdef XK_KATAKANA
+#define XK_overline 0x047e /* U+203E OVERLINE */
+#define XK_kana_fullstop 0x04a1 /* U+3002 IDEOGRAPHIC FULL STOP */
+#define XK_kana_openingbracket 0x04a2 /* U+300C LEFT CORNER BRACKET */
+#define XK_kana_closingbracket 0x04a3 /* U+300D RIGHT CORNER BRACKET */
+#define XK_kana_comma 0x04a4 /* U+3001 IDEOGRAPHIC COMMA */
+#define XK_kana_conjunctive 0x04a5 /* U+30FB KATAKANA MIDDLE DOT */
+#define XK_kana_middledot 0x04a5 /* deprecated */
+#define XK_kana_WO 0x04a6 /* U+30F2 KATAKANA LETTER WO */
+#define XK_kana_a 0x04a7 /* U+30A1 KATAKANA LETTER SMALL A */
+#define XK_kana_i 0x04a8 /* U+30A3 KATAKANA LETTER SMALL I */
+#define XK_kana_u 0x04a9 /* U+30A5 KATAKANA LETTER SMALL U */
+#define XK_kana_e 0x04aa /* U+30A7 KATAKANA LETTER SMALL E */
+#define XK_kana_o 0x04ab /* U+30A9 KATAKANA LETTER SMALL O */
+#define XK_kana_ya 0x04ac /* U+30E3 KATAKANA LETTER SMALL YA */
+#define XK_kana_yu 0x04ad /* U+30E5 KATAKANA LETTER SMALL YU */
+#define XK_kana_yo 0x04ae /* U+30E7 KATAKANA LETTER SMALL YO */
+#define XK_kana_tsu 0x04af /* U+30C3 KATAKANA LETTER SMALL TU */
+#define XK_kana_tu 0x04af /* deprecated */
+#define XK_prolongedsound 0x04b0 /* U+30FC KATAKANA-HIRAGANA PROLONGED SOUND MARK */
+#define XK_kana_A 0x04b1 /* U+30A2 KATAKANA LETTER A */
+#define XK_kana_I 0x04b2 /* U+30A4 KATAKANA LETTER I */
+#define XK_kana_U 0x04b3 /* U+30A6 KATAKANA LETTER U */
+#define XK_kana_E 0x04b4 /* U+30A8 KATAKANA LETTER E */
+#define XK_kana_O 0x04b5 /* U+30AA KATAKANA LETTER O */
+#define XK_kana_KA 0x04b6 /* U+30AB KATAKANA LETTER KA */
+#define XK_kana_KI 0x04b7 /* U+30AD KATAKANA LETTER KI */
+#define XK_kana_KU 0x04b8 /* U+30AF KATAKANA LETTER KU */
+#define XK_kana_KE 0x04b9 /* U+30B1 KATAKANA LETTER KE */
+#define XK_kana_KO 0x04ba /* U+30B3 KATAKANA LETTER KO */
+#define XK_kana_SA 0x04bb /* U+30B5 KATAKANA LETTER SA */
+#define XK_kana_SHI 0x04bc /* U+30B7 KATAKANA LETTER SI */
+#define XK_kana_SU 0x04bd /* U+30B9 KATAKANA LETTER SU */
+#define XK_kana_SE 0x04be /* U+30BB KATAKANA LETTER SE */
+#define XK_kana_SO 0x04bf /* U+30BD KATAKANA LETTER SO */
+#define XK_kana_TA 0x04c0 /* U+30BF KATAKANA LETTER TA */
+#define XK_kana_CHI 0x04c1 /* U+30C1 KATAKANA LETTER TI */
+#define XK_kana_TI 0x04c1 /* deprecated */
+#define XK_kana_TSU 0x04c2 /* U+30C4 KATAKANA LETTER TU */
+#define XK_kana_TU 0x04c2 /* deprecated */
+#define XK_kana_TE 0x04c3 /* U+30C6 KATAKANA LETTER TE */
+#define XK_kana_TO 0x04c4 /* U+30C8 KATAKANA LETTER TO */
+#define XK_kana_NA 0x04c5 /* U+30CA KATAKANA LETTER NA */
+#define XK_kana_NI 0x04c6 /* U+30CB KATAKANA LETTER NI */
+#define XK_kana_NU 0x04c7 /* U+30CC KATAKANA LETTER NU */
+#define XK_kana_NE 0x04c8 /* U+30CD KATAKANA LETTER NE */
+#define XK_kana_NO 0x04c9 /* U+30CE KATAKANA LETTER NO */
+#define XK_kana_HA 0x04ca /* U+30CF KATAKANA LETTER HA */
+#define XK_kana_HI 0x04cb /* U+30D2 KATAKANA LETTER HI */
+#define XK_kana_FU 0x04cc /* U+30D5 KATAKANA LETTER HU */
+#define XK_kana_HU 0x04cc /* deprecated */
+#define XK_kana_HE 0x04cd /* U+30D8 KATAKANA LETTER HE */
+#define XK_kana_HO 0x04ce /* U+30DB KATAKANA LETTER HO */
+#define XK_kana_MA 0x04cf /* U+30DE KATAKANA LETTER MA */
+#define XK_kana_MI 0x04d0 /* U+30DF KATAKANA LETTER MI */
+#define XK_kana_MU 0x04d1 /* U+30E0 KATAKANA LETTER MU */
+#define XK_kana_ME 0x04d2 /* U+30E1 KATAKANA LETTER ME */
+#define XK_kana_MO 0x04d3 /* U+30E2 KATAKANA LETTER MO */
+#define XK_kana_YA 0x04d4 /* U+30E4 KATAKANA LETTER YA */
+#define XK_kana_YU 0x04d5 /* U+30E6 KATAKANA LETTER YU */
+#define XK_kana_YO 0x04d6 /* U+30E8 KATAKANA LETTER YO */
+#define XK_kana_RA 0x04d7 /* U+30E9 KATAKANA LETTER RA */
+#define XK_kana_RI 0x04d8 /* U+30EA KATAKANA LETTER RI */
+#define XK_kana_RU 0x04d9 /* U+30EB KATAKANA LETTER RU */
+#define XK_kana_RE 0x04da /* U+30EC KATAKANA LETTER RE */
+#define XK_kana_RO 0x04db /* U+30ED KATAKANA LETTER RO */
+#define XK_kana_WA 0x04dc /* U+30EF KATAKANA LETTER WA */
+#define XK_kana_N 0x04dd /* U+30F3 KATAKANA LETTER N */
+#define XK_voicedsound 0x04de /* U+309B KATAKANA-HIRAGANA VOICED SOUND MARK */
+#define XK_semivoicedsound 0x04df /* U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK */
+#define XK_kana_switch 0xff7e /* Alias for mode_switch */
+#endif /* XK_KATAKANA */
+
+/*
+ * Arabic
+ * Byte 3 = 5
+ */
+
+#ifdef XK_ARABIC
+#define XK_Farsi_0 0x10006f0 /* U+06F0 EXTENDED ARABIC-INDIC DIGIT ZERO */
+#define XK_Farsi_1 0x10006f1 /* U+06F1 EXTENDED ARABIC-INDIC DIGIT ONE */
+#define XK_Farsi_2 0x10006f2 /* U+06F2 EXTENDED ARABIC-INDIC DIGIT TWO */
+#define XK_Farsi_3 0x10006f3 /* U+06F3 EXTENDED ARABIC-INDIC DIGIT THREE */
+#define XK_Farsi_4 0x10006f4 /* U+06F4 EXTENDED ARABIC-INDIC DIGIT FOUR */
+#define XK_Farsi_5 0x10006f5 /* U+06F5 EXTENDED ARABIC-INDIC DIGIT FIVE */
+#define XK_Farsi_6 0x10006f6 /* U+06F6 EXTENDED ARABIC-INDIC DIGIT SIX */
+#define XK_Farsi_7 0x10006f7 /* U+06F7 EXTENDED ARABIC-INDIC DIGIT SEVEN */
+#define XK_Farsi_8 0x10006f8 /* U+06F8 EXTENDED ARABIC-INDIC DIGIT EIGHT */
+#define XK_Farsi_9 0x10006f9 /* U+06F9 EXTENDED ARABIC-INDIC DIGIT NINE */
+#define XK_Arabic_percent 0x100066a /* U+066A ARABIC PERCENT SIGN */
+#define XK_Arabic_superscript_alef 0x1000670 /* U+0670 ARABIC LETTER SUPERSCRIPT ALEF */
+#define XK_Arabic_tteh 0x1000679 /* U+0679 ARABIC LETTER TTEH */
+#define XK_Arabic_peh 0x100067e /* U+067E ARABIC LETTER PEH */
+#define XK_Arabic_tcheh 0x1000686 /* U+0686 ARABIC LETTER TCHEH */
+#define XK_Arabic_ddal 0x1000688 /* U+0688 ARABIC LETTER DDAL */
+#define XK_Arabic_rreh 0x1000691 /* U+0691 ARABIC LETTER RREH */
+#define XK_Arabic_comma 0x05ac /* U+060C ARABIC COMMA */
+#define XK_Arabic_fullstop 0x10006d4 /* U+06D4 ARABIC FULL STOP */
+#define XK_Arabic_0 0x1000660 /* U+0660 ARABIC-INDIC DIGIT ZERO */
+#define XK_Arabic_1 0x1000661 /* U+0661 ARABIC-INDIC DIGIT ONE */
+#define XK_Arabic_2 0x1000662 /* U+0662 ARABIC-INDIC DIGIT TWO */
+#define XK_Arabic_3 0x1000663 /* U+0663 ARABIC-INDIC DIGIT THREE */
+#define XK_Arabic_4 0x1000664 /* U+0664 ARABIC-INDIC DIGIT FOUR */
+#define XK_Arabic_5 0x1000665 /* U+0665 ARABIC-INDIC DIGIT FIVE */
+#define XK_Arabic_6 0x1000666 /* U+0666 ARABIC-INDIC DIGIT SIX */
+#define XK_Arabic_7 0x1000667 /* U+0667 ARABIC-INDIC DIGIT SEVEN */
+#define XK_Arabic_8 0x1000668 /* U+0668 ARABIC-INDIC DIGIT EIGHT */
+#define XK_Arabic_9 0x1000669 /* U+0669 ARABIC-INDIC DIGIT NINE */
+#define XK_Arabic_semicolon 0x05bb /* U+061B ARABIC SEMICOLON */
+#define XK_Arabic_question_mark 0x05bf /* U+061F ARABIC QUESTION MARK */
+#define XK_Arabic_hamza 0x05c1 /* U+0621 ARABIC LETTER HAMZA */
+#define XK_Arabic_maddaonalef 0x05c2 /* U+0622 ARABIC LETTER ALEF WITH MADDA ABOVE */
+#define XK_Arabic_hamzaonalef 0x05c3 /* U+0623 ARABIC LETTER ALEF WITH HAMZA ABOVE */
+#define XK_Arabic_hamzaonwaw 0x05c4 /* U+0624 ARABIC LETTER WAW WITH HAMZA ABOVE */
+#define XK_Arabic_hamzaunderalef 0x05c5 /* U+0625 ARABIC LETTER ALEF WITH HAMZA BELOW */
+#define XK_Arabic_hamzaonyeh 0x05c6 /* U+0626 ARABIC LETTER YEH WITH HAMZA ABOVE */
+#define XK_Arabic_alef 0x05c7 /* U+0627 ARABIC LETTER ALEF */
+#define XK_Arabic_beh 0x05c8 /* U+0628 ARABIC LETTER BEH */
+#define XK_Arabic_tehmarbuta 0x05c9 /* U+0629 ARABIC LETTER TEH MARBUTA */
+#define XK_Arabic_teh 0x05ca /* U+062A ARABIC LETTER TEH */
+#define XK_Arabic_theh 0x05cb /* U+062B ARABIC LETTER THEH */
+#define XK_Arabic_jeem 0x05cc /* U+062C ARABIC LETTER JEEM */
+#define XK_Arabic_hah 0x05cd /* U+062D ARABIC LETTER HAH */
+#define XK_Arabic_khah 0x05ce /* U+062E ARABIC LETTER KHAH */
+#define XK_Arabic_dal 0x05cf /* U+062F ARABIC LETTER DAL */
+#define XK_Arabic_thal 0x05d0 /* U+0630 ARABIC LETTER THAL */
+#define XK_Arabic_ra 0x05d1 /* U+0631 ARABIC LETTER REH */
+#define XK_Arabic_zain 0x05d2 /* U+0632 ARABIC LETTER ZAIN */
+#define XK_Arabic_seen 0x05d3 /* U+0633 ARABIC LETTER SEEN */
+#define XK_Arabic_sheen 0x05d4 /* U+0634 ARABIC LETTER SHEEN */
+#define XK_Arabic_sad 0x05d5 /* U+0635 ARABIC LETTER SAD */
+#define XK_Arabic_dad 0x05d6 /* U+0636 ARABIC LETTER DAD */
+#define XK_Arabic_tah 0x05d7 /* U+0637 ARABIC LETTER TAH */
+#define XK_Arabic_zah 0x05d8 /* U+0638 ARABIC LETTER ZAH */
+#define XK_Arabic_ain 0x05d9 /* U+0639 ARABIC LETTER AIN */
+#define XK_Arabic_ghain 0x05da /* U+063A ARABIC LETTER GHAIN */
+#define XK_Arabic_tatweel 0x05e0 /* U+0640 ARABIC TATWEEL */
+#define XK_Arabic_feh 0x05e1 /* U+0641 ARABIC LETTER FEH */
+#define XK_Arabic_qaf 0x05e2 /* U+0642 ARABIC LETTER QAF */
+#define XK_Arabic_kaf 0x05e3 /* U+0643 ARABIC LETTER KAF */
+#define XK_Arabic_lam 0x05e4 /* U+0644 ARABIC LETTER LAM */
+#define XK_Arabic_meem 0x05e5 /* U+0645 ARABIC LETTER MEEM */
+#define XK_Arabic_noon 0x05e6 /* U+0646 ARABIC LETTER NOON */
+#define XK_Arabic_ha 0x05e7 /* U+0647 ARABIC LETTER HEH */
+#define XK_Arabic_heh 0x05e7 /* deprecated */
+#define XK_Arabic_waw 0x05e8 /* U+0648 ARABIC LETTER WAW */
+#define XK_Arabic_alefmaksura 0x05e9 /* U+0649 ARABIC LETTER ALEF MAKSURA */
+#define XK_Arabic_yeh 0x05ea /* U+064A ARABIC LETTER YEH */
+#define XK_Arabic_fathatan 0x05eb /* U+064B ARABIC FATHATAN */
+#define XK_Arabic_dammatan 0x05ec /* U+064C ARABIC DAMMATAN */
+#define XK_Arabic_kasratan 0x05ed /* U+064D ARABIC KASRATAN */
+#define XK_Arabic_fatha 0x05ee /* U+064E ARABIC FATHA */
+#define XK_Arabic_damma 0x05ef /* U+064F ARABIC DAMMA */
+#define XK_Arabic_kasra 0x05f0 /* U+0650 ARABIC KASRA */
+#define XK_Arabic_shadda 0x05f1 /* U+0651 ARABIC SHADDA */
+#define XK_Arabic_sukun 0x05f2 /* U+0652 ARABIC SUKUN */
+#define XK_Arabic_madda_above 0x1000653 /* U+0653 ARABIC MADDAH ABOVE */
+#define XK_Arabic_hamza_above 0x1000654 /* U+0654 ARABIC HAMZA ABOVE */
+#define XK_Arabic_hamza_below 0x1000655 /* U+0655 ARABIC HAMZA BELOW */
+#define XK_Arabic_jeh 0x1000698 /* U+0698 ARABIC LETTER JEH */
+#define XK_Arabic_veh 0x10006a4 /* U+06A4 ARABIC LETTER VEH */
+#define XK_Arabic_keheh 0x10006a9 /* U+06A9 ARABIC LETTER KEHEH */
+#define XK_Arabic_gaf 0x10006af /* U+06AF ARABIC LETTER GAF */
+#define XK_Arabic_noon_ghunna 0x10006ba /* U+06BA ARABIC LETTER NOON GHUNNA */
+#define XK_Arabic_heh_doachashmee 0x10006be /* U+06BE ARABIC LETTER HEH DOACHASHMEE */
+#define XK_Farsi_yeh 0x10006cc /* U+06CC ARABIC LETTER FARSI YEH */
+#define XK_Arabic_farsi_yeh 0x10006cc /* U+06CC ARABIC LETTER FARSI YEH */
+#define XK_Arabic_yeh_baree 0x10006d2 /* U+06D2 ARABIC LETTER YEH BARREE */
+#define XK_Arabic_heh_goal 0x10006c1 /* U+06C1 ARABIC LETTER HEH GOAL */
+#define XK_Arabic_switch 0xff7e /* Alias for mode_switch */
+#endif /* XK_ARABIC */
+
+/*
+ * Cyrillic
+ * Byte 3 = 6
+ */
+#ifdef XK_CYRILLIC
+#define XK_Cyrillic_GHE_bar 0x1000492 /* U+0492 CYRILLIC CAPITAL LETTER GHE WITH STROKE */
+#define XK_Cyrillic_ghe_bar 0x1000493 /* U+0493 CYRILLIC SMALL LETTER GHE WITH STROKE */
+#define XK_Cyrillic_ZHE_descender 0x1000496 /* U+0496 CYRILLIC CAPITAL LETTER ZHE WITH DESCENDER */
+#define XK_Cyrillic_zhe_descender 0x1000497 /* U+0497 CYRILLIC SMALL LETTER ZHE WITH DESCENDER */
+#define XK_Cyrillic_KA_descender 0x100049a /* U+049A CYRILLIC CAPITAL LETTER KA WITH DESCENDER */
+#define XK_Cyrillic_ka_descender 0x100049b /* U+049B CYRILLIC SMALL LETTER KA WITH DESCENDER */
+#define XK_Cyrillic_KA_vertstroke 0x100049c /* U+049C CYRILLIC CAPITAL LETTER KA WITH VERTICAL STROKE */
+#define XK_Cyrillic_ka_vertstroke 0x100049d /* U+049D CYRILLIC SMALL LETTER KA WITH VERTICAL STROKE */
+#define XK_Cyrillic_EN_descender 0x10004a2 /* U+04A2 CYRILLIC CAPITAL LETTER EN WITH DESCENDER */
+#define XK_Cyrillic_en_descender 0x10004a3 /* U+04A3 CYRILLIC SMALL LETTER EN WITH DESCENDER */
+#define XK_Cyrillic_U_straight 0x10004ae /* U+04AE CYRILLIC CAPITAL LETTER STRAIGHT U */
+#define XK_Cyrillic_u_straight 0x10004af /* U+04AF CYRILLIC SMALL LETTER STRAIGHT U */
+#define XK_Cyrillic_U_straight_bar 0x10004b0 /* U+04B0 CYRILLIC CAPITAL LETTER STRAIGHT U WITH STROKE */
+#define XK_Cyrillic_u_straight_bar 0x10004b1 /* U+04B1 CYRILLIC SMALL LETTER STRAIGHT U WITH STROKE */
+#define XK_Cyrillic_HA_descender 0x10004b2 /* U+04B2 CYRILLIC CAPITAL LETTER HA WITH DESCENDER */
+#define XK_Cyrillic_ha_descender 0x10004b3 /* U+04B3 CYRILLIC SMALL LETTER HA WITH DESCENDER */
+#define XK_Cyrillic_CHE_descender 0x10004b6 /* U+04B6 CYRILLIC CAPITAL LETTER CHE WITH DESCENDER */
+#define XK_Cyrillic_che_descender 0x10004b7 /* U+04B7 CYRILLIC SMALL LETTER CHE WITH DESCENDER */
+#define XK_Cyrillic_CHE_vertstroke 0x10004b8 /* U+04B8 CYRILLIC CAPITAL LETTER CHE WITH VERTICAL STROKE */
+#define XK_Cyrillic_che_vertstroke 0x10004b9 /* U+04B9 CYRILLIC SMALL LETTER CHE WITH VERTICAL STROKE */
+#define XK_Cyrillic_SHHA 0x10004ba /* U+04BA CYRILLIC CAPITAL LETTER SHHA */
+#define XK_Cyrillic_shha 0x10004bb /* U+04BB CYRILLIC SMALL LETTER SHHA */
+
+#define XK_Cyrillic_SCHWA 0x10004d8 /* U+04D8 CYRILLIC CAPITAL LETTER SCHWA */
+#define XK_Cyrillic_schwa 0x10004d9 /* U+04D9 CYRILLIC SMALL LETTER SCHWA */
+#define XK_Cyrillic_I_macron 0x10004e2 /* U+04E2 CYRILLIC CAPITAL LETTER I WITH MACRON */
+#define XK_Cyrillic_i_macron 0x10004e3 /* U+04E3 CYRILLIC SMALL LETTER I WITH MACRON */
+#define XK_Cyrillic_O_bar 0x10004e8 /* U+04E8 CYRILLIC CAPITAL LETTER BARRED O */
+#define XK_Cyrillic_o_bar 0x10004e9 /* U+04E9 CYRILLIC SMALL LETTER BARRED O */
+#define XK_Cyrillic_U_macron 0x10004ee /* U+04EE CYRILLIC CAPITAL LETTER U WITH MACRON */
+#define XK_Cyrillic_u_macron 0x10004ef /* U+04EF CYRILLIC SMALL LETTER U WITH MACRON */
+
+#define XK_Serbian_dje 0x06a1 /* U+0452 CYRILLIC SMALL LETTER DJE */
+#define XK_Macedonia_gje 0x06a2 /* U+0453 CYRILLIC SMALL LETTER GJE */
+#define XK_Cyrillic_io 0x06a3 /* U+0451 CYRILLIC SMALL LETTER IO */
+#define XK_Ukrainian_ie 0x06a4 /* U+0454 CYRILLIC SMALL LETTER UKRAINIAN IE */
+#define XK_Ukranian_je 0x06a4 /* deprecated */
+#define XK_Macedonia_dse 0x06a5 /* U+0455 CYRILLIC SMALL LETTER DZE */
+#define XK_Ukrainian_i 0x06a6 /* U+0456 CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I */
+#define XK_Ukranian_i 0x06a6 /* deprecated */
+#define XK_Ukrainian_yi 0x06a7 /* U+0457 CYRILLIC SMALL LETTER YI */
+#define XK_Ukranian_yi 0x06a7 /* deprecated */
+#define XK_Cyrillic_je 0x06a8 /* U+0458 CYRILLIC SMALL LETTER JE */
+#define XK_Serbian_je 0x06a8 /* deprecated */
+#define XK_Cyrillic_lje 0x06a9 /* U+0459 CYRILLIC SMALL LETTER LJE */
+#define XK_Serbian_lje 0x06a9 /* deprecated */
+#define XK_Cyrillic_nje 0x06aa /* U+045A CYRILLIC SMALL LETTER NJE */
+#define XK_Serbian_nje 0x06aa /* deprecated */
+#define XK_Serbian_tshe 0x06ab /* U+045B CYRILLIC SMALL LETTER TSHE */
+#define XK_Macedonia_kje 0x06ac /* U+045C CYRILLIC SMALL LETTER KJE */
+#define XK_Ukrainian_ghe_with_upturn 0x06ad /* U+0491 CYRILLIC SMALL LETTER GHE WITH UPTURN */
+#define XK_Byelorussian_shortu 0x06ae /* U+045E CYRILLIC SMALL LETTER SHORT U */
+#define XK_Cyrillic_dzhe 0x06af /* U+045F CYRILLIC SMALL LETTER DZHE */
+#define XK_Serbian_dze 0x06af /* deprecated */
+#define XK_numerosign 0x06b0 /* U+2116 NUMERO SIGN */
+#define XK_Serbian_DJE 0x06b1 /* U+0402 CYRILLIC CAPITAL LETTER DJE */
+#define XK_Macedonia_GJE 0x06b2 /* U+0403 CYRILLIC CAPITAL LETTER GJE */
+#define XK_Cyrillic_IO 0x06b3 /* U+0401 CYRILLIC CAPITAL LETTER IO */
+#define XK_Ukrainian_IE 0x06b4 /* U+0404 CYRILLIC CAPITAL LETTER UKRAINIAN IE */
+#define XK_Ukranian_JE 0x06b4 /* deprecated */
+#define XK_Macedonia_DSE 0x06b5 /* U+0405 CYRILLIC CAPITAL LETTER DZE */
+#define XK_Ukrainian_I 0x06b6 /* U+0406 CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I */
+#define XK_Ukranian_I 0x06b6 /* deprecated */
+#define XK_Ukrainian_YI 0x06b7 /* U+0407 CYRILLIC CAPITAL LETTER YI */
+#define XK_Ukranian_YI 0x06b7 /* deprecated */
+#define XK_Cyrillic_JE 0x06b8 /* U+0408 CYRILLIC CAPITAL LETTER JE */
+#define XK_Serbian_JE 0x06b8 /* deprecated */
+#define XK_Cyrillic_LJE 0x06b9 /* U+0409 CYRILLIC CAPITAL LETTER LJE */
+#define XK_Serbian_LJE 0x06b9 /* deprecated */
+#define XK_Cyrillic_NJE 0x06ba /* U+040A CYRILLIC CAPITAL LETTER NJE */
+#define XK_Serbian_NJE 0x06ba /* deprecated */
+#define XK_Serbian_TSHE 0x06bb /* U+040B CYRILLIC CAPITAL LETTER TSHE */
+#define XK_Macedonia_KJE 0x06bc /* U+040C CYRILLIC CAPITAL LETTER KJE */
+#define XK_Ukrainian_GHE_WITH_UPTURN 0x06bd /* U+0490 CYRILLIC CAPITAL LETTER GHE WITH UPTURN */
+#define XK_Byelorussian_SHORTU 0x06be /* U+040E CYRILLIC CAPITAL LETTER SHORT U */
+#define XK_Cyrillic_DZHE 0x06bf /* U+040F CYRILLIC CAPITAL LETTER DZHE */
+#define XK_Serbian_DZE 0x06bf /* deprecated */
+#define XK_Cyrillic_yu 0x06c0 /* U+044E CYRILLIC SMALL LETTER YU */
+#define XK_Cyrillic_a 0x06c1 /* U+0430 CYRILLIC SMALL LETTER A */
+#define XK_Cyrillic_be 0x06c2 /* U+0431 CYRILLIC SMALL LETTER BE */
+#define XK_Cyrillic_tse 0x06c3 /* U+0446 CYRILLIC SMALL LETTER TSE */
+#define XK_Cyrillic_de 0x06c4 /* U+0434 CYRILLIC SMALL LETTER DE */
+#define XK_Cyrillic_ie 0x06c5 /* U+0435 CYRILLIC SMALL LETTER IE */
+#define XK_Cyrillic_ef 0x06c6 /* U+0444 CYRILLIC SMALL LETTER EF */
+#define XK_Cyrillic_ghe 0x06c7 /* U+0433 CYRILLIC SMALL LETTER GHE */
+#define XK_Cyrillic_ha 0x06c8 /* U+0445 CYRILLIC SMALL LETTER HA */
+#define XK_Cyrillic_i 0x06c9 /* U+0438 CYRILLIC SMALL LETTER I */
+#define XK_Cyrillic_shorti 0x06ca /* U+0439 CYRILLIC SMALL LETTER SHORT I */
+#define XK_Cyrillic_ka 0x06cb /* U+043A CYRILLIC SMALL LETTER KA */
+#define XK_Cyrillic_el 0x06cc /* U+043B CYRILLIC SMALL LETTER EL */
+#define XK_Cyrillic_em 0x06cd /* U+043C CYRILLIC SMALL LETTER EM */
+#define XK_Cyrillic_en 0x06ce /* U+043D CYRILLIC SMALL LETTER EN */
+#define XK_Cyrillic_o 0x06cf /* U+043E CYRILLIC SMALL LETTER O */
+#define XK_Cyrillic_pe 0x06d0 /* U+043F CYRILLIC SMALL LETTER PE */
+#define XK_Cyrillic_ya 0x06d1 /* U+044F CYRILLIC SMALL LETTER YA */
+#define XK_Cyrillic_er 0x06d2 /* U+0440 CYRILLIC SMALL LETTER ER */
+#define XK_Cyrillic_es 0x06d3 /* U+0441 CYRILLIC SMALL LETTER ES */
+#define XK_Cyrillic_te 0x06d4 /* U+0442 CYRILLIC SMALL LETTER TE */
+#define XK_Cyrillic_u 0x06d5 /* U+0443 CYRILLIC SMALL LETTER U */
+#define XK_Cyrillic_zhe 0x06d6 /* U+0436 CYRILLIC SMALL LETTER ZHE */
+#define XK_Cyrillic_ve 0x06d7 /* U+0432 CYRILLIC SMALL LETTER VE */
+#define XK_Cyrillic_softsign 0x06d8 /* U+044C CYRILLIC SMALL LETTER SOFT SIGN */
+#define XK_Cyrillic_yeru 0x06d9 /* U+044B CYRILLIC SMALL LETTER YERU */
+#define XK_Cyrillic_ze 0x06da /* U+0437 CYRILLIC SMALL LETTER ZE */
+#define XK_Cyrillic_sha 0x06db /* U+0448 CYRILLIC SMALL LETTER SHA */
+#define XK_Cyrillic_e 0x06dc /* U+044D CYRILLIC SMALL LETTER E */
+#define XK_Cyrillic_shcha 0x06dd /* U+0449 CYRILLIC SMALL LETTER SHCHA */
+#define XK_Cyrillic_che 0x06de /* U+0447 CYRILLIC SMALL LETTER CHE */
+#define XK_Cyrillic_hardsign 0x06df /* U+044A CYRILLIC SMALL LETTER HARD SIGN */
+#define XK_Cyrillic_YU 0x06e0 /* U+042E CYRILLIC CAPITAL LETTER YU */
+#define XK_Cyrillic_A 0x06e1 /* U+0410 CYRILLIC CAPITAL LETTER A */
+#define XK_Cyrillic_BE 0x06e2 /* U+0411 CYRILLIC CAPITAL LETTER BE */
+#define XK_Cyrillic_TSE 0x06e3 /* U+0426 CYRILLIC CAPITAL LETTER TSE */
+#define XK_Cyrillic_DE 0x06e4 /* U+0414 CYRILLIC CAPITAL LETTER DE */
+#define XK_Cyrillic_IE 0x06e5 /* U+0415 CYRILLIC CAPITAL LETTER IE */
+#define XK_Cyrillic_EF 0x06e6 /* U+0424 CYRILLIC CAPITAL LETTER EF */
+#define XK_Cyrillic_GHE 0x06e7 /* U+0413 CYRILLIC CAPITAL LETTER GHE */
+#define XK_Cyrillic_HA 0x06e8 /* U+0425 CYRILLIC CAPITAL LETTER HA */
+#define XK_Cyrillic_I 0x06e9 /* U+0418 CYRILLIC CAPITAL LETTER I */
+#define XK_Cyrillic_SHORTI 0x06ea /* U+0419 CYRILLIC CAPITAL LETTER SHORT I */
+#define XK_Cyrillic_KA 0x06eb /* U+041A CYRILLIC CAPITAL LETTER KA */
+#define XK_Cyrillic_EL 0x06ec /* U+041B CYRILLIC CAPITAL LETTER EL */
+#define XK_Cyrillic_EM 0x06ed /* U+041C CYRILLIC CAPITAL LETTER EM */
+#define XK_Cyrillic_EN 0x06ee /* U+041D CYRILLIC CAPITAL LETTER EN */
+#define XK_Cyrillic_O 0x06ef /* U+041E CYRILLIC CAPITAL LETTER O */
+#define XK_Cyrillic_PE 0x06f0 /* U+041F CYRILLIC CAPITAL LETTER PE */
+#define XK_Cyrillic_YA 0x06f1 /* U+042F CYRILLIC CAPITAL LETTER YA */
+#define XK_Cyrillic_ER 0x06f2 /* U+0420 CYRILLIC CAPITAL LETTER ER */
+#define XK_Cyrillic_ES 0x06f3 /* U+0421 CYRILLIC CAPITAL LETTER ES */
+#define XK_Cyrillic_TE 0x06f4 /* U+0422 CYRILLIC CAPITAL LETTER TE */
+#define XK_Cyrillic_U 0x06f5 /* U+0423 CYRILLIC CAPITAL LETTER U */
+#define XK_Cyrillic_ZHE 0x06f6 /* U+0416 CYRILLIC CAPITAL LETTER ZHE */
+#define XK_Cyrillic_VE 0x06f7 /* U+0412 CYRILLIC CAPITAL LETTER VE */
+#define XK_Cyrillic_SOFTSIGN 0x06f8 /* U+042C CYRILLIC CAPITAL LETTER SOFT SIGN */
+#define XK_Cyrillic_YERU 0x06f9 /* U+042B CYRILLIC CAPITAL LETTER YERU */
+#define XK_Cyrillic_ZE 0x06fa /* U+0417 CYRILLIC CAPITAL LETTER ZE */
+#define XK_Cyrillic_SHA 0x06fb /* U+0428 CYRILLIC CAPITAL LETTER SHA */
+#define XK_Cyrillic_E 0x06fc /* U+042D CYRILLIC CAPITAL LETTER E */
+#define XK_Cyrillic_SHCHA 0x06fd /* U+0429 CYRILLIC CAPITAL LETTER SHCHA */
+#define XK_Cyrillic_CHE 0x06fe /* U+0427 CYRILLIC CAPITAL LETTER CHE */
+#define XK_Cyrillic_HARDSIGN 0x06ff /* U+042A CYRILLIC CAPITAL LETTER HARD SIGN */
+#endif /* XK_CYRILLIC */
+
+/*
+ * Greek
+ * (based on an early draft of, and not quite identical to, ISO/IEC 8859-7)
+ * Byte 3 = 7
+ */
+
+#ifdef XK_GREEK
+#define XK_Greek_ALPHAaccent 0x07a1 /* U+0386 GREEK CAPITAL LETTER ALPHA WITH TONOS */
+#define XK_Greek_EPSILONaccent 0x07a2 /* U+0388 GREEK CAPITAL LETTER EPSILON WITH TONOS */
+#define XK_Greek_ETAaccent 0x07a3 /* U+0389 GREEK CAPITAL LETTER ETA WITH TONOS */
+#define XK_Greek_IOTAaccent 0x07a4 /* U+038A GREEK CAPITAL LETTER IOTA WITH TONOS */
+#define XK_Greek_IOTAdieresis 0x07a5 /* U+03AA GREEK CAPITAL LETTER IOTA WITH DIALYTIKA */
+#define XK_Greek_IOTAdiaeresis 0x07a5 /* old typo */
+#define XK_Greek_OMICRONaccent 0x07a7 /* U+038C GREEK CAPITAL LETTER OMICRON WITH TONOS */
+#define XK_Greek_UPSILONaccent 0x07a8 /* U+038E GREEK CAPITAL LETTER UPSILON WITH TONOS */
+#define XK_Greek_UPSILONdieresis 0x07a9 /* U+03AB GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA */
+#define XK_Greek_OMEGAaccent 0x07ab /* U+038F GREEK CAPITAL LETTER OMEGA WITH TONOS */
+#define XK_Greek_accentdieresis 0x07ae /* U+0385 GREEK DIALYTIKA TONOS */
+#define XK_Greek_horizbar 0x07af /* U+2015 HORIZONTAL BAR */
+#define XK_Greek_alphaaccent 0x07b1 /* U+03AC GREEK SMALL LETTER ALPHA WITH TONOS */
+#define XK_Greek_epsilonaccent 0x07b2 /* U+03AD GREEK SMALL LETTER EPSILON WITH TONOS */
+#define XK_Greek_etaaccent 0x07b3 /* U+03AE GREEK SMALL LETTER ETA WITH TONOS */
+#define XK_Greek_iotaaccent 0x07b4 /* U+03AF GREEK SMALL LETTER IOTA WITH TONOS */
+#define XK_Greek_iotadieresis 0x07b5 /* U+03CA GREEK SMALL LETTER IOTA WITH DIALYTIKA */
+#define XK_Greek_iotaaccentdieresis 0x07b6 /* U+0390 GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS */
+#define XK_Greek_omicronaccent 0x07b7 /* U+03CC GREEK SMALL LETTER OMICRON WITH TONOS */
+#define XK_Greek_upsilonaccent 0x07b8 /* U+03CD GREEK SMALL LETTER UPSILON WITH TONOS */
+#define XK_Greek_upsilondieresis 0x07b9 /* U+03CB GREEK SMALL LETTER UPSILON WITH DIALYTIKA */
+#define XK_Greek_upsilonaccentdieresis 0x07ba /* U+03B0 GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS */
+#define XK_Greek_omegaaccent 0x07bb /* U+03CE GREEK SMALL LETTER OMEGA WITH TONOS */
+#define XK_Greek_ALPHA 0x07c1 /* U+0391 GREEK CAPITAL LETTER ALPHA */
+#define XK_Greek_BETA 0x07c2 /* U+0392 GREEK CAPITAL LETTER BETA */
+#define XK_Greek_GAMMA 0x07c3 /* U+0393 GREEK CAPITAL LETTER GAMMA */
+#define XK_Greek_DELTA 0x07c4 /* U+0394 GREEK CAPITAL LETTER DELTA */
+#define XK_Greek_EPSILON 0x07c5 /* U+0395 GREEK CAPITAL LETTER EPSILON */
+#define XK_Greek_ZETA 0x07c6 /* U+0396 GREEK CAPITAL LETTER ZETA */
+#define XK_Greek_ETA 0x07c7 /* U+0397 GREEK CAPITAL LETTER ETA */
+#define XK_Greek_THETA 0x07c8 /* U+0398 GREEK CAPITAL LETTER THETA */
+#define XK_Greek_IOTA 0x07c9 /* U+0399 GREEK CAPITAL LETTER IOTA */
+#define XK_Greek_KAPPA 0x07ca /* U+039A GREEK CAPITAL LETTER KAPPA */
+#define XK_Greek_LAMDA 0x07cb /* U+039B GREEK CAPITAL LETTER LAMDA */
+#define XK_Greek_LAMBDA 0x07cb /* U+039B GREEK CAPITAL LETTER LAMDA */
+#define XK_Greek_MU 0x07cc /* U+039C GREEK CAPITAL LETTER MU */
+#define XK_Greek_NU 0x07cd /* U+039D GREEK CAPITAL LETTER NU */
+#define XK_Greek_XI 0x07ce /* U+039E GREEK CAPITAL LETTER XI */
+#define XK_Greek_OMICRON 0x07cf /* U+039F GREEK CAPITAL LETTER OMICRON */
+#define XK_Greek_PI 0x07d0 /* U+03A0 GREEK CAPITAL LETTER PI */
+#define XK_Greek_RHO 0x07d1 /* U+03A1 GREEK CAPITAL LETTER RHO */
+#define XK_Greek_SIGMA 0x07d2 /* U+03A3 GREEK CAPITAL LETTER SIGMA */
+#define XK_Greek_TAU 0x07d4 /* U+03A4 GREEK CAPITAL LETTER TAU */
+#define XK_Greek_UPSILON 0x07d5 /* U+03A5 GREEK CAPITAL LETTER UPSILON */
+#define XK_Greek_PHI 0x07d6 /* U+03A6 GREEK CAPITAL LETTER PHI */
+#define XK_Greek_CHI 0x07d7 /* U+03A7 GREEK CAPITAL LETTER CHI */
+#define XK_Greek_PSI 0x07d8 /* U+03A8 GREEK CAPITAL LETTER PSI */
+#define XK_Greek_OMEGA 0x07d9 /* U+03A9 GREEK CAPITAL LETTER OMEGA */
+#define XK_Greek_alpha 0x07e1 /* U+03B1 GREEK SMALL LETTER ALPHA */
+#define XK_Greek_beta 0x07e2 /* U+03B2 GREEK SMALL LETTER BETA */
+#define XK_Greek_gamma 0x07e3 /* U+03B3 GREEK SMALL LETTER GAMMA */
+#define XK_Greek_delta 0x07e4 /* U+03B4 GREEK SMALL LETTER DELTA */
+#define XK_Greek_epsilon 0x07e5 /* U+03B5 GREEK SMALL LETTER EPSILON */
+#define XK_Greek_zeta 0x07e6 /* U+03B6 GREEK SMALL LETTER ZETA */
+#define XK_Greek_eta 0x07e7 /* U+03B7 GREEK SMALL LETTER ETA */
+#define XK_Greek_theta 0x07e8 /* U+03B8 GREEK SMALL LETTER THETA */
+#define XK_Greek_iota 0x07e9 /* U+03B9 GREEK SMALL LETTER IOTA */
+#define XK_Greek_kappa 0x07ea /* U+03BA GREEK SMALL LETTER KAPPA */
+#define XK_Greek_lamda 0x07eb /* U+03BB GREEK SMALL LETTER LAMDA */
+#define XK_Greek_lambda 0x07eb /* U+03BB GREEK SMALL LETTER LAMDA */
+#define XK_Greek_mu 0x07ec /* U+03BC GREEK SMALL LETTER MU */
+#define XK_Greek_nu 0x07ed /* U+03BD GREEK SMALL LETTER NU */
+#define XK_Greek_xi 0x07ee /* U+03BE GREEK SMALL LETTER XI */
+#define XK_Greek_omicron 0x07ef /* U+03BF GREEK SMALL LETTER OMICRON */
+#define XK_Greek_pi 0x07f0 /* U+03C0 GREEK SMALL LETTER PI */
+#define XK_Greek_rho 0x07f1 /* U+03C1 GREEK SMALL LETTER RHO */
+#define XK_Greek_sigma 0x07f2 /* U+03C3 GREEK SMALL LETTER SIGMA */
+#define XK_Greek_finalsmallsigma 0x07f3 /* U+03C2 GREEK SMALL LETTER FINAL SIGMA */
+#define XK_Greek_tau 0x07f4 /* U+03C4 GREEK SMALL LETTER TAU */
+#define XK_Greek_upsilon 0x07f5 /* U+03C5 GREEK SMALL LETTER UPSILON */
+#define XK_Greek_phi 0x07f6 /* U+03C6 GREEK SMALL LETTER PHI */
+#define XK_Greek_chi 0x07f7 /* U+03C7 GREEK SMALL LETTER CHI */
+#define XK_Greek_psi 0x07f8 /* U+03C8 GREEK SMALL LETTER PSI */
+#define XK_Greek_omega 0x07f9 /* U+03C9 GREEK SMALL LETTER OMEGA */
+#define XK_Greek_switch 0xff7e /* Alias for mode_switch */
+#endif /* XK_GREEK */
+
+/*
+ * Technical
+ * (from the DEC VT330/VT420 Technical Character Set, http://vt100.net/charsets/technical.html)
+ * Byte 3 = 8
+ */
+
+#ifdef XK_TECHNICAL
+#define XK_leftradical 0x08a1 /* U+23B7 RADICAL SYMBOL BOTTOM */
+#define XK_topleftradical 0x08a2 /*(U+250C BOX DRAWINGS LIGHT DOWN AND RIGHT)*/
+#define XK_horizconnector 0x08a3 /*(U+2500 BOX DRAWINGS LIGHT HORIZONTAL)*/
+#define XK_topintegral 0x08a4 /* U+2320 TOP HALF INTEGRAL */
+#define XK_botintegral 0x08a5 /* U+2321 BOTTOM HALF INTEGRAL */
+#define XK_vertconnector 0x08a6 /*(U+2502 BOX DRAWINGS LIGHT VERTICAL)*/
+#define XK_topleftsqbracket 0x08a7 /* U+23A1 LEFT SQUARE BRACKET UPPER CORNER */
+#define XK_botleftsqbracket 0x08a8 /* U+23A3 LEFT SQUARE BRACKET LOWER CORNER */
+#define XK_toprightsqbracket 0x08a9 /* U+23A4 RIGHT SQUARE BRACKET UPPER CORNER */
+#define XK_botrightsqbracket 0x08aa /* U+23A6 RIGHT SQUARE BRACKET LOWER CORNER */
+#define XK_topleftparens 0x08ab /* U+239B LEFT PARENTHESIS UPPER HOOK */
+#define XK_botleftparens 0x08ac /* U+239D LEFT PARENTHESIS LOWER HOOK */
+#define XK_toprightparens 0x08ad /* U+239E RIGHT PARENTHESIS UPPER HOOK */
+#define XK_botrightparens 0x08ae /* U+23A0 RIGHT PARENTHESIS LOWER HOOK */
+#define XK_leftmiddlecurlybrace 0x08af /* U+23A8 LEFT CURLY BRACKET MIDDLE PIECE */
+#define XK_rightmiddlecurlybrace 0x08b0 /* U+23AC RIGHT CURLY BRACKET MIDDLE PIECE */
+#define XK_topleftsummation 0x08b1
+#define XK_botleftsummation 0x08b2
+#define XK_topvertsummationconnector 0x08b3
+#define XK_botvertsummationconnector 0x08b4
+#define XK_toprightsummation 0x08b5
+#define XK_botrightsummation 0x08b6
+#define XK_rightmiddlesummation 0x08b7
+#define XK_lessthanequal 0x08bc /* U+2264 LESS-THAN OR EQUAL TO */
+#define XK_notequal 0x08bd /* U+2260 NOT EQUAL TO */
+#define XK_greaterthanequal 0x08be /* U+2265 GREATER-THAN OR EQUAL TO */
+#define XK_integral 0x08bf /* U+222B INTEGRAL */
+#define XK_therefore 0x08c0 /* U+2234 THEREFORE */
+#define XK_variation 0x08c1 /* U+221D PROPORTIONAL TO */
+#define XK_infinity 0x08c2 /* U+221E INFINITY */
+#define XK_nabla 0x08c5 /* U+2207 NABLA */
+#define XK_approximate 0x08c8 /* U+223C TILDE OPERATOR */
+#define XK_similarequal 0x08c9 /* U+2243 ASYMPTOTICALLY EQUAL TO */
+#define XK_ifonlyif 0x08cd /* U+21D4 LEFT RIGHT DOUBLE ARROW */
+#define XK_implies 0x08ce /* U+21D2 RIGHTWARDS DOUBLE ARROW */
+#define XK_identical 0x08cf /* U+2261 IDENTICAL TO */
+#define XK_radical 0x08d6 /* U+221A SQUARE ROOT */
+#define XK_includedin 0x08da /* U+2282 SUBSET OF */
+#define XK_includes 0x08db /* U+2283 SUPERSET OF */
+#define XK_intersection 0x08dc /* U+2229 INTERSECTION */
+#define XK_union 0x08dd /* U+222A UNION */
+#define XK_logicaland 0x08de /* U+2227 LOGICAL AND */
+#define XK_logicalor 0x08df /* U+2228 LOGICAL OR */
+#define XK_partialderivative 0x08ef /* U+2202 PARTIAL DIFFERENTIAL */
+#define XK_function 0x08f6 /* U+0192 LATIN SMALL LETTER F WITH HOOK */
+#define XK_leftarrow 0x08fb /* U+2190 LEFTWARDS ARROW */
+#define XK_uparrow 0x08fc /* U+2191 UPWARDS ARROW */
+#define XK_rightarrow 0x08fd /* U+2192 RIGHTWARDS ARROW */
+#define XK_downarrow 0x08fe /* U+2193 DOWNWARDS ARROW */
+#endif /* XK_TECHNICAL */
+
+/*
+ * Special
+ * (from the DEC VT100 Special Graphics Character Set)
+ * Byte 3 = 9
+ */
+
+#ifdef XK_SPECIAL
+#define XK_blank 0x09df
+#define XK_soliddiamond 0x09e0 /* U+25C6 BLACK DIAMOND */
+#define XK_checkerboard 0x09e1 /* U+2592 MEDIUM SHADE */
+#define XK_ht 0x09e2 /* U+2409 SYMBOL FOR HORIZONTAL TABULATION */
+#define XK_ff 0x09e3 /* U+240C SYMBOL FOR FORM FEED */
+#define XK_cr 0x09e4 /* U+240D SYMBOL FOR CARRIAGE RETURN */
+#define XK_lf 0x09e5 /* U+240A SYMBOL FOR LINE FEED */
+#define XK_nl 0x09e8 /* U+2424 SYMBOL FOR NEWLINE */
+#define XK_vt 0x09e9 /* U+240B SYMBOL FOR VERTICAL TABULATION */
+#define XK_lowrightcorner 0x09ea /* U+2518 BOX DRAWINGS LIGHT UP AND LEFT */
+#define XK_uprightcorner 0x09eb /* U+2510 BOX DRAWINGS LIGHT DOWN AND LEFT */
+#define XK_upleftcorner 0x09ec /* U+250C BOX DRAWINGS LIGHT DOWN AND RIGHT */
+#define XK_lowleftcorner 0x09ed /* U+2514 BOX DRAWINGS LIGHT UP AND RIGHT */
+#define XK_crossinglines 0x09ee /* U+253C BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL */
+#define XK_horizlinescan1 0x09ef /* U+23BA HORIZONTAL SCAN LINE-1 */
+#define XK_horizlinescan3 0x09f0 /* U+23BB HORIZONTAL SCAN LINE-3 */
+#define XK_horizlinescan5 0x09f1 /* U+2500 BOX DRAWINGS LIGHT HORIZONTAL */
+#define XK_horizlinescan7 0x09f2 /* U+23BC HORIZONTAL SCAN LINE-7 */
+#define XK_horizlinescan9 0x09f3 /* U+23BD HORIZONTAL SCAN LINE-9 */
+#define XK_leftt 0x09f4 /* U+251C BOX DRAWINGS LIGHT VERTICAL AND RIGHT */
+#define XK_rightt 0x09f5 /* U+2524 BOX DRAWINGS LIGHT VERTICAL AND LEFT */
+#define XK_bott 0x09f6 /* U+2534 BOX DRAWINGS LIGHT UP AND HORIZONTAL */
+#define XK_topt 0x09f7 /* U+252C BOX DRAWINGS LIGHT DOWN AND HORIZONTAL */
+#define XK_vertbar 0x09f8 /* U+2502 BOX DRAWINGS LIGHT VERTICAL */
+#endif /* XK_SPECIAL */
+
+/*
+ * Publishing
+ * (these are probably from a long forgotten DEC Publishing
+ * font that once shipped with DECwrite)
+ * Byte 3 = 0x0a
+ */
+
+#ifdef XK_PUBLISHING
+#define XK_emspace 0x0aa1 /* U+2003 EM SPACE */
+#define XK_enspace 0x0aa2 /* U+2002 EN SPACE */
+#define XK_em3space 0x0aa3 /* U+2004 THREE-PER-EM SPACE */
+#define XK_em4space 0x0aa4 /* U+2005 FOUR-PER-EM SPACE */
+#define XK_digitspace 0x0aa5 /* U+2007 FIGURE SPACE */
+#define XK_punctspace 0x0aa6 /* U+2008 PUNCTUATION SPACE */
+#define XK_thinspace 0x0aa7 /* U+2009 THIN SPACE */
+#define XK_hairspace 0x0aa8 /* U+200A HAIR SPACE */
+#define XK_emdash 0x0aa9 /* U+2014 EM DASH */
+#define XK_endash 0x0aaa /* U+2013 EN DASH */
+#define XK_signifblank 0x0aac /*(U+2423 OPEN BOX)*/
+#define XK_ellipsis 0x0aae /* U+2026 HORIZONTAL ELLIPSIS */
+#define XK_doubbaselinedot 0x0aaf /* U+2025 TWO DOT LEADER */
+#define XK_onethird 0x0ab0 /* U+2153 VULGAR FRACTION ONE THIRD */
+#define XK_twothirds 0x0ab1 /* U+2154 VULGAR FRACTION TWO THIRDS */
+#define XK_onefifth 0x0ab2 /* U+2155 VULGAR FRACTION ONE FIFTH */
+#define XK_twofifths 0x0ab3 /* U+2156 VULGAR FRACTION TWO FIFTHS */
+#define XK_threefifths 0x0ab4 /* U+2157 VULGAR FRACTION THREE FIFTHS */
+#define XK_fourfifths 0x0ab5 /* U+2158 VULGAR FRACTION FOUR FIFTHS */
+#define XK_onesixth 0x0ab6 /* U+2159 VULGAR FRACTION ONE SIXTH */
+#define XK_fivesixths 0x0ab7 /* U+215A VULGAR FRACTION FIVE SIXTHS */
+#define XK_careof 0x0ab8 /* U+2105 CARE OF */
+#define XK_figdash 0x0abb /* U+2012 FIGURE DASH */
+#define XK_leftanglebracket 0x0abc /*(U+27E8 MATHEMATICAL LEFT ANGLE BRACKET)*/
+#define XK_decimalpoint 0x0abd /*(U+002E FULL STOP)*/
+#define XK_rightanglebracket 0x0abe /*(U+27E9 MATHEMATICAL RIGHT ANGLE BRACKET)*/
+#define XK_marker 0x0abf
+#define XK_oneeighth 0x0ac3 /* U+215B VULGAR FRACTION ONE EIGHTH */
+#define XK_threeeighths 0x0ac4 /* U+215C VULGAR FRACTION THREE EIGHTHS */
+#define XK_fiveeighths 0x0ac5 /* U+215D VULGAR FRACTION FIVE EIGHTHS */
+#define XK_seveneighths 0x0ac6 /* U+215E VULGAR FRACTION SEVEN EIGHTHS */
+#define XK_trademark 0x0ac9 /* U+2122 TRADE MARK SIGN */
+#define XK_signaturemark 0x0aca /*(U+2613 SALTIRE)*/
+#define XK_trademarkincircle 0x0acb
+#define XK_leftopentriangle 0x0acc /*(U+25C1 WHITE LEFT-POINTING TRIANGLE)*/
+#define XK_rightopentriangle 0x0acd /*(U+25B7 WHITE RIGHT-POINTING TRIANGLE)*/
+#define XK_emopencircle 0x0ace /*(U+25CB WHITE CIRCLE)*/
+#define XK_emopenrectangle 0x0acf /*(U+25AF WHITE VERTICAL RECTANGLE)*/
+#define XK_leftsinglequotemark 0x0ad0 /* U+2018 LEFT SINGLE QUOTATION MARK */
+#define XK_rightsinglequotemark 0x0ad1 /* U+2019 RIGHT SINGLE QUOTATION MARK */
+#define XK_leftdoublequotemark 0x0ad2 /* U+201C LEFT DOUBLE QUOTATION MARK */
+#define XK_rightdoublequotemark 0x0ad3 /* U+201D RIGHT DOUBLE QUOTATION MARK */
+#define XK_prescription 0x0ad4 /* U+211E PRESCRIPTION TAKE */
+#define XK_minutes 0x0ad6 /* U+2032 PRIME */
+#define XK_seconds 0x0ad7 /* U+2033 DOUBLE PRIME */
+#define XK_latincross 0x0ad9 /* U+271D LATIN CROSS */
+#define XK_hexagram 0x0ada
+#define XK_filledrectbullet 0x0adb /*(U+25AC BLACK RECTANGLE)*/
+#define XK_filledlefttribullet 0x0adc /*(U+25C0 BLACK LEFT-POINTING TRIANGLE)*/
+#define XK_filledrighttribullet 0x0add /*(U+25B6 BLACK RIGHT-POINTING TRIANGLE)*/
+#define XK_emfilledcircle 0x0ade /*(U+25CF BLACK CIRCLE)*/
+#define XK_emfilledrect 0x0adf /*(U+25AE BLACK VERTICAL RECTANGLE)*/
+#define XK_enopencircbullet 0x0ae0 /*(U+25E6 WHITE BULLET)*/
+#define XK_enopensquarebullet 0x0ae1 /*(U+25AB WHITE SMALL SQUARE)*/
+#define XK_openrectbullet 0x0ae2 /*(U+25AD WHITE RECTANGLE)*/
+#define XK_opentribulletup 0x0ae3 /*(U+25B3 WHITE UP-POINTING TRIANGLE)*/
+#define XK_opentribulletdown 0x0ae4 /*(U+25BD WHITE DOWN-POINTING TRIANGLE)*/
+#define XK_openstar 0x0ae5 /*(U+2606 WHITE STAR)*/
+#define XK_enfilledcircbullet 0x0ae6 /*(U+2022 BULLET)*/
+#define XK_enfilledsqbullet 0x0ae7 /*(U+25AA BLACK SMALL SQUARE)*/
+#define XK_filledtribulletup 0x0ae8 /*(U+25B2 BLACK UP-POINTING TRIANGLE)*/
+#define XK_filledtribulletdown 0x0ae9 /*(U+25BC BLACK DOWN-POINTING TRIANGLE)*/
+#define XK_leftpointer 0x0aea /*(U+261C WHITE LEFT POINTING INDEX)*/
+#define XK_rightpointer 0x0aeb /*(U+261E WHITE RIGHT POINTING INDEX)*/
+#define XK_club 0x0aec /* U+2663 BLACK CLUB SUIT */
+#define XK_diamond 0x0aed /* U+2666 BLACK DIAMOND SUIT */
+#define XK_heart 0x0aee /* U+2665 BLACK HEART SUIT */
+#define XK_maltesecross 0x0af0 /* U+2720 MALTESE CROSS */
+#define XK_dagger 0x0af1 /* U+2020 DAGGER */
+#define XK_doubledagger 0x0af2 /* U+2021 DOUBLE DAGGER */
+#define XK_checkmark 0x0af3 /* U+2713 CHECK MARK */
+#define XK_ballotcross 0x0af4 /* U+2717 BALLOT X */
+#define XK_musicalsharp 0x0af5 /* U+266F MUSIC SHARP SIGN */
+#define XK_musicalflat 0x0af6 /* U+266D MUSIC FLAT SIGN */
+#define XK_malesymbol 0x0af7 /* U+2642 MALE SIGN */
+#define XK_femalesymbol 0x0af8 /* U+2640 FEMALE SIGN */
+#define XK_telephone 0x0af9 /* U+260E BLACK TELEPHONE */
+#define XK_telephonerecorder 0x0afa /* U+2315 TELEPHONE RECORDER */
+#define XK_phonographcopyright 0x0afb /* U+2117 SOUND RECORDING COPYRIGHT */
+#define XK_caret 0x0afc /* U+2038 CARET */
+#define XK_singlelowquotemark 0x0afd /* U+201A SINGLE LOW-9 QUOTATION MARK */
+#define XK_doublelowquotemark 0x0afe /* U+201E DOUBLE LOW-9 QUOTATION MARK */
+#define XK_cursor 0x0aff
+#endif /* XK_PUBLISHING */
+
+/*
+ * APL
+ * Byte 3 = 0x0b
+ */
+
+#ifdef XK_APL
+#define XK_leftcaret 0x0ba3 /*(U+003C LESS-THAN SIGN)*/
+#define XK_rightcaret 0x0ba6 /*(U+003E GREATER-THAN SIGN)*/
+#define XK_downcaret 0x0ba8 /*(U+2228 LOGICAL OR)*/
+#define XK_upcaret 0x0ba9 /*(U+2227 LOGICAL AND)*/
+#define XK_overbar 0x0bc0 /*(U+00AF MACRON)*/
+#define XK_downtack 0x0bc2 /* U+22A5 UP TACK */
+#define XK_upshoe 0x0bc3 /*(U+2229 INTERSECTION)*/
+#define XK_downstile 0x0bc4 /* U+230A LEFT FLOOR */
+#define XK_underbar 0x0bc6 /*(U+005F LOW LINE)*/
+#define XK_jot 0x0bca /* U+2218 RING OPERATOR */
+#define XK_quad 0x0bcc /* U+2395 APL FUNCTIONAL SYMBOL QUAD */
+#define XK_uptack 0x0bce /* U+22A4 DOWN TACK */
+#define XK_circle 0x0bcf /* U+25CB WHITE CIRCLE */
+#define XK_upstile 0x0bd3 /* U+2308 LEFT CEILING */
+#define XK_downshoe 0x0bd6 /*(U+222A UNION)*/
+#define XK_rightshoe 0x0bd8 /*(U+2283 SUPERSET OF)*/
+#define XK_leftshoe 0x0bda /*(U+2282 SUBSET OF)*/
+#define XK_lefttack 0x0bdc /* U+22A2 RIGHT TACK */
+#define XK_righttack 0x0bfc /* U+22A3 LEFT TACK */
+#endif /* XK_APL */
+
+/*
+ * Hebrew
+ * Byte 3 = 0x0c
+ */
+
+#ifdef XK_HEBREW
+#define XK_hebrew_doublelowline 0x0cdf /* U+2017 DOUBLE LOW LINE */
+#define XK_hebrew_aleph 0x0ce0 /* U+05D0 HEBREW LETTER ALEF */
+#define XK_hebrew_bet 0x0ce1 /* U+05D1 HEBREW LETTER BET */
+#define XK_hebrew_beth 0x0ce1 /* deprecated */
+#define XK_hebrew_gimel 0x0ce2 /* U+05D2 HEBREW LETTER GIMEL */
+#define XK_hebrew_gimmel 0x0ce2 /* deprecated */
+#define XK_hebrew_dalet 0x0ce3 /* U+05D3 HEBREW LETTER DALET */
+#define XK_hebrew_daleth 0x0ce3 /* deprecated */
+#define XK_hebrew_he 0x0ce4 /* U+05D4 HEBREW LETTER HE */
+#define XK_hebrew_waw 0x0ce5 /* U+05D5 HEBREW LETTER VAV */
+#define XK_hebrew_zain 0x0ce6 /* U+05D6 HEBREW LETTER ZAYIN */
+#define XK_hebrew_zayin 0x0ce6 /* deprecated */
+#define XK_hebrew_chet 0x0ce7 /* U+05D7 HEBREW LETTER HET */
+#define XK_hebrew_het 0x0ce7 /* deprecated */
+#define XK_hebrew_tet 0x0ce8 /* U+05D8 HEBREW LETTER TET */
+#define XK_hebrew_teth 0x0ce8 /* deprecated */
+#define XK_hebrew_yod 0x0ce9 /* U+05D9 HEBREW LETTER YOD */
+#define XK_hebrew_finalkaph 0x0cea /* U+05DA HEBREW LETTER FINAL KAF */
+#define XK_hebrew_kaph 0x0ceb /* U+05DB HEBREW LETTER KAF */
+#define XK_hebrew_lamed 0x0cec /* U+05DC HEBREW LETTER LAMED */
+#define XK_hebrew_finalmem 0x0ced /* U+05DD HEBREW LETTER FINAL MEM */
+#define XK_hebrew_mem 0x0cee /* U+05DE HEBREW LETTER MEM */
+#define XK_hebrew_finalnun 0x0cef /* U+05DF HEBREW LETTER FINAL NUN */
+#define XK_hebrew_nun 0x0cf0 /* U+05E0 HEBREW LETTER NUN */
+#define XK_hebrew_samech 0x0cf1 /* U+05E1 HEBREW LETTER SAMEKH */
+#define XK_hebrew_samekh 0x0cf1 /* deprecated */
+#define XK_hebrew_ayin 0x0cf2 /* U+05E2 HEBREW LETTER AYIN */
+#define XK_hebrew_finalpe 0x0cf3 /* U+05E3 HEBREW LETTER FINAL PE */
+#define XK_hebrew_pe 0x0cf4 /* U+05E4 HEBREW LETTER PE */
+#define XK_hebrew_finalzade 0x0cf5 /* U+05E5 HEBREW LETTER FINAL TSADI */
+#define XK_hebrew_finalzadi 0x0cf5 /* deprecated */
+#define XK_hebrew_zade 0x0cf6 /* U+05E6 HEBREW LETTER TSADI */
+#define XK_hebrew_zadi 0x0cf6 /* deprecated */
+#define XK_hebrew_qoph 0x0cf7 /* U+05E7 HEBREW LETTER QOF */
+#define XK_hebrew_kuf 0x0cf7 /* deprecated */
+#define XK_hebrew_resh 0x0cf8 /* U+05E8 HEBREW LETTER RESH */
+#define XK_hebrew_shin 0x0cf9 /* U+05E9 HEBREW LETTER SHIN */
+#define XK_hebrew_taw 0x0cfa /* U+05EA HEBREW LETTER TAV */
+#define XK_hebrew_taf 0x0cfa /* deprecated */
+#define XK_Hebrew_switch 0xff7e /* Alias for mode_switch */
+#endif /* XK_HEBREW */
+
+/*
+ * Thai
+ * Byte 3 = 0x0d
+ */
+
+#ifdef XK_THAI
+#define XK_Thai_kokai 0x0da1 /* U+0E01 THAI CHARACTER KO KAI */
+#define XK_Thai_khokhai 0x0da2 /* U+0E02 THAI CHARACTER KHO KHAI */
+#define XK_Thai_khokhuat 0x0da3 /* U+0E03 THAI CHARACTER KHO KHUAT */
+#define XK_Thai_khokhwai 0x0da4 /* U+0E04 THAI CHARACTER KHO KHWAI */
+#define XK_Thai_khokhon 0x0da5 /* U+0E05 THAI CHARACTER KHO KHON */
+#define XK_Thai_khorakhang 0x0da6 /* U+0E06 THAI CHARACTER KHO RAKHANG */
+#define XK_Thai_ngongu 0x0da7 /* U+0E07 THAI CHARACTER NGO NGU */
+#define XK_Thai_chochan 0x0da8 /* U+0E08 THAI CHARACTER CHO CHAN */
+#define XK_Thai_choching 0x0da9 /* U+0E09 THAI CHARACTER CHO CHING */
+#define XK_Thai_chochang 0x0daa /* U+0E0A THAI CHARACTER CHO CHANG */
+#define XK_Thai_soso 0x0dab /* U+0E0B THAI CHARACTER SO SO */
+#define XK_Thai_chochoe 0x0dac /* U+0E0C THAI CHARACTER CHO CHOE */
+#define XK_Thai_yoying 0x0dad /* U+0E0D THAI CHARACTER YO YING */
+#define XK_Thai_dochada 0x0dae /* U+0E0E THAI CHARACTER DO CHADA */
+#define XK_Thai_topatak 0x0daf /* U+0E0F THAI CHARACTER TO PATAK */
+#define XK_Thai_thothan 0x0db0 /* U+0E10 THAI CHARACTER THO THAN */
+#define XK_Thai_thonangmontho 0x0db1 /* U+0E11 THAI CHARACTER THO NANGMONTHO */
+#define XK_Thai_thophuthao 0x0db2 /* U+0E12 THAI CHARACTER THO PHUTHAO */
+#define XK_Thai_nonen 0x0db3 /* U+0E13 THAI CHARACTER NO NEN */
+#define XK_Thai_dodek 0x0db4 /* U+0E14 THAI CHARACTER DO DEK */
+#define XK_Thai_totao 0x0db5 /* U+0E15 THAI CHARACTER TO TAO */
+#define XK_Thai_thothung 0x0db6 /* U+0E16 THAI CHARACTER THO THUNG */
+#define XK_Thai_thothahan 0x0db7 /* U+0E17 THAI CHARACTER THO THAHAN */
+#define XK_Thai_thothong 0x0db8 /* U+0E18 THAI CHARACTER THO THONG */
+#define XK_Thai_nonu 0x0db9 /* U+0E19 THAI CHARACTER NO NU */
+#define XK_Thai_bobaimai 0x0dba /* U+0E1A THAI CHARACTER BO BAIMAI */
+#define XK_Thai_popla 0x0dbb /* U+0E1B THAI CHARACTER PO PLA */
+#define XK_Thai_phophung 0x0dbc /* U+0E1C THAI CHARACTER PHO PHUNG */
+#define XK_Thai_fofa 0x0dbd /* U+0E1D THAI CHARACTER FO FA */
+#define XK_Thai_phophan 0x0dbe /* U+0E1E THAI CHARACTER PHO PHAN */
+#define XK_Thai_fofan 0x0dbf /* U+0E1F THAI CHARACTER FO FAN */
+#define XK_Thai_phosamphao 0x0dc0 /* U+0E20 THAI CHARACTER PHO SAMPHAO */
+#define XK_Thai_moma 0x0dc1 /* U+0E21 THAI CHARACTER MO MA */
+#define XK_Thai_yoyak 0x0dc2 /* U+0E22 THAI CHARACTER YO YAK */
+#define XK_Thai_rorua 0x0dc3 /* U+0E23 THAI CHARACTER RO RUA */
+#define XK_Thai_ru 0x0dc4 /* U+0E24 THAI CHARACTER RU */
+#define XK_Thai_loling 0x0dc5 /* U+0E25 THAI CHARACTER LO LING */
+#define XK_Thai_lu 0x0dc6 /* U+0E26 THAI CHARACTER LU */
+#define XK_Thai_wowaen 0x0dc7 /* U+0E27 THAI CHARACTER WO WAEN */
+#define XK_Thai_sosala 0x0dc8 /* U+0E28 THAI CHARACTER SO SALA */
+#define XK_Thai_sorusi 0x0dc9 /* U+0E29 THAI CHARACTER SO RUSI */
+#define XK_Thai_sosua 0x0dca /* U+0E2A THAI CHARACTER SO SUA */
+#define XK_Thai_hohip 0x0dcb /* U+0E2B THAI CHARACTER HO HIP */
+#define XK_Thai_lochula 0x0dcc /* U+0E2C THAI CHARACTER LO CHULA */
+#define XK_Thai_oang 0x0dcd /* U+0E2D THAI CHARACTER O ANG */
+#define XK_Thai_honokhuk 0x0dce /* U+0E2E THAI CHARACTER HO NOKHUK */
+#define XK_Thai_paiyannoi 0x0dcf /* U+0E2F THAI CHARACTER PAIYANNOI */
+#define XK_Thai_saraa 0x0dd0 /* U+0E30 THAI CHARACTER SARA A */
+#define XK_Thai_maihanakat 0x0dd1 /* U+0E31 THAI CHARACTER MAI HAN-AKAT */
+#define XK_Thai_saraaa 0x0dd2 /* U+0E32 THAI CHARACTER SARA AA */
+#define XK_Thai_saraam 0x0dd3 /* U+0E33 THAI CHARACTER SARA AM */
+#define XK_Thai_sarai 0x0dd4 /* U+0E34 THAI CHARACTER SARA I */
+#define XK_Thai_saraii 0x0dd5 /* U+0E35 THAI CHARACTER SARA II */
+#define XK_Thai_saraue 0x0dd6 /* U+0E36 THAI CHARACTER SARA UE */
+#define XK_Thai_sarauee 0x0dd7 /* U+0E37 THAI CHARACTER SARA UEE */
+#define XK_Thai_sarau 0x0dd8 /* U+0E38 THAI CHARACTER SARA U */
+#define XK_Thai_sarauu 0x0dd9 /* U+0E39 THAI CHARACTER SARA UU */
+#define XK_Thai_phinthu 0x0dda /* U+0E3A THAI CHARACTER PHINTHU */
+#define XK_Thai_maihanakat_maitho 0x0dde
+#define XK_Thai_baht 0x0ddf /* U+0E3F THAI CURRENCY SYMBOL BAHT */
+#define XK_Thai_sarae 0x0de0 /* U+0E40 THAI CHARACTER SARA E */
+#define XK_Thai_saraae 0x0de1 /* U+0E41 THAI CHARACTER SARA AE */
+#define XK_Thai_sarao 0x0de2 /* U+0E42 THAI CHARACTER SARA O */
+#define XK_Thai_saraaimaimuan 0x0de3 /* U+0E43 THAI CHARACTER SARA AI MAIMUAN */
+#define XK_Thai_saraaimaimalai 0x0de4 /* U+0E44 THAI CHARACTER SARA AI MAIMALAI */
+#define XK_Thai_lakkhangyao 0x0de5 /* U+0E45 THAI CHARACTER LAKKHANGYAO */
+#define XK_Thai_maiyamok 0x0de6 /* U+0E46 THAI CHARACTER MAIYAMOK */
+#define XK_Thai_maitaikhu 0x0de7 /* U+0E47 THAI CHARACTER MAITAIKHU */
+#define XK_Thai_maiek 0x0de8 /* U+0E48 THAI CHARACTER MAI EK */
+#define XK_Thai_maitho 0x0de9 /* U+0E49 THAI CHARACTER MAI THO */
+#define XK_Thai_maitri 0x0dea /* U+0E4A THAI CHARACTER MAI TRI */
+#define XK_Thai_maichattawa 0x0deb /* U+0E4B THAI CHARACTER MAI CHATTAWA */
+#define XK_Thai_thanthakhat 0x0dec /* U+0E4C THAI CHARACTER THANTHAKHAT */
+#define XK_Thai_nikhahit 0x0ded /* U+0E4D THAI CHARACTER NIKHAHIT */
+#define XK_Thai_leksun 0x0df0 /* U+0E50 THAI DIGIT ZERO */
+#define XK_Thai_leknung 0x0df1 /* U+0E51 THAI DIGIT ONE */
+#define XK_Thai_leksong 0x0df2 /* U+0E52 THAI DIGIT TWO */
+#define XK_Thai_leksam 0x0df3 /* U+0E53 THAI DIGIT THREE */
+#define XK_Thai_leksi 0x0df4 /* U+0E54 THAI DIGIT FOUR */
+#define XK_Thai_lekha 0x0df5 /* U+0E55 THAI DIGIT FIVE */
+#define XK_Thai_lekhok 0x0df6 /* U+0E56 THAI DIGIT SIX */
+#define XK_Thai_lekchet 0x0df7 /* U+0E57 THAI DIGIT SEVEN */
+#define XK_Thai_lekpaet 0x0df8 /* U+0E58 THAI DIGIT EIGHT */
+#define XK_Thai_lekkao 0x0df9 /* U+0E59 THAI DIGIT NINE */
+#endif /* XK_THAI */
+
+/*
+ * Korean
+ * Byte 3 = 0x0e
+ */
+
+#ifdef XK_KOREAN
+
+#define XK_Hangul 0xff31 /* Hangul start/stop(toggle) */
+#define XK_Hangul_Start 0xff32 /* Hangul start */
+#define XK_Hangul_End 0xff33 /* Hangul end, English start */
+#define XK_Hangul_Hanja 0xff34 /* Start Hangul->Hanja Conversion */
+#define XK_Hangul_Jamo 0xff35 /* Hangul Jamo mode */
+#define XK_Hangul_Romaja 0xff36 /* Hangul Romaja mode */
+#define XK_Hangul_Codeinput 0xff37 /* Hangul code input mode */
+#define XK_Hangul_Jeonja 0xff38 /* Jeonja mode */
+#define XK_Hangul_Banja 0xff39 /* Banja mode */
+#define XK_Hangul_PreHanja 0xff3a /* Pre Hanja conversion */
+#define XK_Hangul_PostHanja 0xff3b /* Post Hanja conversion */
+#define XK_Hangul_SingleCandidate 0xff3c /* Single candidate */
+#define XK_Hangul_MultipleCandidate 0xff3d /* Multiple candidate */
+#define XK_Hangul_PreviousCandidate 0xff3e /* Previous candidate */
+#define XK_Hangul_Special 0xff3f /* Special symbols */
+#define XK_Hangul_switch 0xff7e /* Alias for mode_switch */
+
+/* Hangul Consonant Characters */
+#define XK_Hangul_Kiyeog 0x0ea1
+#define XK_Hangul_SsangKiyeog 0x0ea2
+#define XK_Hangul_KiyeogSios 0x0ea3
+#define XK_Hangul_Nieun 0x0ea4
+#define XK_Hangul_NieunJieuj 0x0ea5
+#define XK_Hangul_NieunHieuh 0x0ea6
+#define XK_Hangul_Dikeud 0x0ea7
+#define XK_Hangul_SsangDikeud 0x0ea8
+#define XK_Hangul_Rieul 0x0ea9
+#define XK_Hangul_RieulKiyeog 0x0eaa
+#define XK_Hangul_RieulMieum 0x0eab
+#define XK_Hangul_RieulPieub 0x0eac
+#define XK_Hangul_RieulSios 0x0ead
+#define XK_Hangul_RieulTieut 0x0eae
+#define XK_Hangul_RieulPhieuf 0x0eaf
+#define XK_Hangul_RieulHieuh 0x0eb0
+#define XK_Hangul_Mieum 0x0eb1
+#define XK_Hangul_Pieub 0x0eb2
+#define XK_Hangul_SsangPieub 0x0eb3
+#define XK_Hangul_PieubSios 0x0eb4
+#define XK_Hangul_Sios 0x0eb5
+#define XK_Hangul_SsangSios 0x0eb6
+#define XK_Hangul_Ieung 0x0eb7
+#define XK_Hangul_Jieuj 0x0eb8
+#define XK_Hangul_SsangJieuj 0x0eb9
+#define XK_Hangul_Cieuc 0x0eba
+#define XK_Hangul_Khieuq 0x0ebb
+#define XK_Hangul_Tieut 0x0ebc
+#define XK_Hangul_Phieuf 0x0ebd
+#define XK_Hangul_Hieuh 0x0ebe
+
+/* Hangul Vowel Characters */
+#define XK_Hangul_A 0x0ebf
+#define XK_Hangul_AE 0x0ec0
+#define XK_Hangul_YA 0x0ec1
+#define XK_Hangul_YAE 0x0ec2
+#define XK_Hangul_EO 0x0ec3
+#define XK_Hangul_E 0x0ec4
+#define XK_Hangul_YEO 0x0ec5
+#define XK_Hangul_YE 0x0ec6
+#define XK_Hangul_O 0x0ec7
+#define XK_Hangul_WA 0x0ec8
+#define XK_Hangul_WAE 0x0ec9
+#define XK_Hangul_OE 0x0eca
+#define XK_Hangul_YO 0x0ecb
+#define XK_Hangul_U 0x0ecc
+#define XK_Hangul_WEO 0x0ecd
+#define XK_Hangul_WE 0x0ece
+#define XK_Hangul_WI 0x0ecf
+#define XK_Hangul_YU 0x0ed0
+#define XK_Hangul_EU 0x0ed1
+#define XK_Hangul_YI 0x0ed2
+#define XK_Hangul_I 0x0ed3
+
+/* Hangul syllable-final (JongSeong) Characters */
+#define XK_Hangul_J_Kiyeog 0x0ed4
+#define XK_Hangul_J_SsangKiyeog 0x0ed5
+#define XK_Hangul_J_KiyeogSios 0x0ed6
+#define XK_Hangul_J_Nieun 0x0ed7
+#define XK_Hangul_J_NieunJieuj 0x0ed8
+#define XK_Hangul_J_NieunHieuh 0x0ed9
+#define XK_Hangul_J_Dikeud 0x0eda
+#define XK_Hangul_J_Rieul 0x0edb
+#define XK_Hangul_J_RieulKiyeog 0x0edc
+#define XK_Hangul_J_RieulMieum 0x0edd
+#define XK_Hangul_J_RieulPieub 0x0ede
+#define XK_Hangul_J_RieulSios 0x0edf
+#define XK_Hangul_J_RieulTieut 0x0ee0
+#define XK_Hangul_J_RieulPhieuf 0x0ee1
+#define XK_Hangul_J_RieulHieuh 0x0ee2
+#define XK_Hangul_J_Mieum 0x0ee3
+#define XK_Hangul_J_Pieub 0x0ee4
+#define XK_Hangul_J_PieubSios 0x0ee5
+#define XK_Hangul_J_Sios 0x0ee6
+#define XK_Hangul_J_SsangSios 0x0ee7
+#define XK_Hangul_J_Ieung 0x0ee8
+#define XK_Hangul_J_Jieuj 0x0ee9
+#define XK_Hangul_J_Cieuc 0x0eea
+#define XK_Hangul_J_Khieuq 0x0eeb
+#define XK_Hangul_J_Tieut 0x0eec
+#define XK_Hangul_J_Phieuf 0x0eed
+#define XK_Hangul_J_Hieuh 0x0eee
+
+/* Ancient Hangul Consonant Characters */
+#define XK_Hangul_RieulYeorinHieuh 0x0eef
+#define XK_Hangul_SunkyeongeumMieum 0x0ef0
+#define XK_Hangul_SunkyeongeumPieub 0x0ef1
+#define XK_Hangul_PanSios 0x0ef2
+#define XK_Hangul_KkogjiDalrinIeung 0x0ef3
+#define XK_Hangul_SunkyeongeumPhieuf 0x0ef4
+#define XK_Hangul_YeorinHieuh 0x0ef5
+
+/* Ancient Hangul Vowel Characters */
+#define XK_Hangul_AraeA 0x0ef6
+#define XK_Hangul_AraeAE 0x0ef7
+
+/* Ancient Hangul syllable-final (JongSeong) Characters */
+#define XK_Hangul_J_PanSios 0x0ef8
+#define XK_Hangul_J_KkogjiDalrinIeung 0x0ef9
+#define XK_Hangul_J_YeorinHieuh 0x0efa
+
+/* Korean currency symbol */
+#define XK_Korean_Won 0x0eff /*(U+20A9 WON SIGN)*/
+
+#endif /* XK_KOREAN */
+
+/*
+ * Armenian
+ */
+
+#ifdef XK_ARMENIAN
+#define XK_Armenian_ligature_ew 0x1000587 /* U+0587 ARMENIAN SMALL LIGATURE ECH YIWN */
+#define XK_Armenian_full_stop 0x1000589 /* U+0589 ARMENIAN FULL STOP */
+#define XK_Armenian_verjaket 0x1000589 /* U+0589 ARMENIAN FULL STOP */
+#define XK_Armenian_separation_mark 0x100055d /* U+055D ARMENIAN COMMA */
+#define XK_Armenian_but 0x100055d /* U+055D ARMENIAN COMMA */
+#define XK_Armenian_hyphen 0x100058a /* U+058A ARMENIAN HYPHEN */
+#define XK_Armenian_yentamna 0x100058a /* U+058A ARMENIAN HYPHEN */
+#define XK_Armenian_exclam 0x100055c /* U+055C ARMENIAN EXCLAMATION MARK */
+#define XK_Armenian_amanak 0x100055c /* U+055C ARMENIAN EXCLAMATION MARK */
+#define XK_Armenian_accent 0x100055b /* U+055B ARMENIAN EMPHASIS MARK */
+#define XK_Armenian_shesht 0x100055b /* U+055B ARMENIAN EMPHASIS MARK */
+#define XK_Armenian_question 0x100055e /* U+055E ARMENIAN QUESTION MARK */
+#define XK_Armenian_paruyk 0x100055e /* U+055E ARMENIAN QUESTION MARK */
+#define XK_Armenian_AYB 0x1000531 /* U+0531 ARMENIAN CAPITAL LETTER AYB */
+#define XK_Armenian_ayb 0x1000561 /* U+0561 ARMENIAN SMALL LETTER AYB */
+#define XK_Armenian_BEN 0x1000532 /* U+0532 ARMENIAN CAPITAL LETTER BEN */
+#define XK_Armenian_ben 0x1000562 /* U+0562 ARMENIAN SMALL LETTER BEN */
+#define XK_Armenian_GIM 0x1000533 /* U+0533 ARMENIAN CAPITAL LETTER GIM */
+#define XK_Armenian_gim 0x1000563 /* U+0563 ARMENIAN SMALL LETTER GIM */
+#define XK_Armenian_DA 0x1000534 /* U+0534 ARMENIAN CAPITAL LETTER DA */
+#define XK_Armenian_da 0x1000564 /* U+0564 ARMENIAN SMALL LETTER DA */
+#define XK_Armenian_YECH 0x1000535 /* U+0535 ARMENIAN CAPITAL LETTER ECH */
+#define XK_Armenian_yech 0x1000565 /* U+0565 ARMENIAN SMALL LETTER ECH */
+#define XK_Armenian_ZA 0x1000536 /* U+0536 ARMENIAN CAPITAL LETTER ZA */
+#define XK_Armenian_za 0x1000566 /* U+0566 ARMENIAN SMALL LETTER ZA */
+#define XK_Armenian_E 0x1000537 /* U+0537 ARMENIAN CAPITAL LETTER EH */
+#define XK_Armenian_e 0x1000567 /* U+0567 ARMENIAN SMALL LETTER EH */
+#define XK_Armenian_AT 0x1000538 /* U+0538 ARMENIAN CAPITAL LETTER ET */
+#define XK_Armenian_at 0x1000568 /* U+0568 ARMENIAN SMALL LETTER ET */
+#define XK_Armenian_TO 0x1000539 /* U+0539 ARMENIAN CAPITAL LETTER TO */
+#define XK_Armenian_to 0x1000569 /* U+0569 ARMENIAN SMALL LETTER TO */
+#define XK_Armenian_ZHE 0x100053a /* U+053A ARMENIAN CAPITAL LETTER ZHE */
+#define XK_Armenian_zhe 0x100056a /* U+056A ARMENIAN SMALL LETTER ZHE */
+#define XK_Armenian_INI 0x100053b /* U+053B ARMENIAN CAPITAL LETTER INI */
+#define XK_Armenian_ini 0x100056b /* U+056B ARMENIAN SMALL LETTER INI */
+#define XK_Armenian_LYUN 0x100053c /* U+053C ARMENIAN CAPITAL LETTER LIWN */
+#define XK_Armenian_lyun 0x100056c /* U+056C ARMENIAN SMALL LETTER LIWN */
+#define XK_Armenian_KHE 0x100053d /* U+053D ARMENIAN CAPITAL LETTER XEH */
+#define XK_Armenian_khe 0x100056d /* U+056D ARMENIAN SMALL LETTER XEH */
+#define XK_Armenian_TSA 0x100053e /* U+053E ARMENIAN CAPITAL LETTER CA */
+#define XK_Armenian_tsa 0x100056e /* U+056E ARMENIAN SMALL LETTER CA */
+#define XK_Armenian_KEN 0x100053f /* U+053F ARMENIAN CAPITAL LETTER KEN */
+#define XK_Armenian_ken 0x100056f /* U+056F ARMENIAN SMALL LETTER KEN */
+#define XK_Armenian_HO 0x1000540 /* U+0540 ARMENIAN CAPITAL LETTER HO */
+#define XK_Armenian_ho 0x1000570 /* U+0570 ARMENIAN SMALL LETTER HO */
+#define XK_Armenian_DZA 0x1000541 /* U+0541 ARMENIAN CAPITAL LETTER JA */
+#define XK_Armenian_dza 0x1000571 /* U+0571 ARMENIAN SMALL LETTER JA */
+#define XK_Armenian_GHAT 0x1000542 /* U+0542 ARMENIAN CAPITAL LETTER GHAD */
+#define XK_Armenian_ghat 0x1000572 /* U+0572 ARMENIAN SMALL LETTER GHAD */
+#define XK_Armenian_TCHE 0x1000543 /* U+0543 ARMENIAN CAPITAL LETTER CHEH */
+#define XK_Armenian_tche 0x1000573 /* U+0573 ARMENIAN SMALL LETTER CHEH */
+#define XK_Armenian_MEN 0x1000544 /* U+0544 ARMENIAN CAPITAL LETTER MEN */
+#define XK_Armenian_men 0x1000574 /* U+0574 ARMENIAN SMALL LETTER MEN */
+#define XK_Armenian_HI 0x1000545 /* U+0545 ARMENIAN CAPITAL LETTER YI */
+#define XK_Armenian_hi 0x1000575 /* U+0575 ARMENIAN SMALL LETTER YI */
+#define XK_Armenian_NU 0x1000546 /* U+0546 ARMENIAN CAPITAL LETTER NOW */
+#define XK_Armenian_nu 0x1000576 /* U+0576 ARMENIAN SMALL LETTER NOW */
+#define XK_Armenian_SHA 0x1000547 /* U+0547 ARMENIAN CAPITAL LETTER SHA */
+#define XK_Armenian_sha 0x1000577 /* U+0577 ARMENIAN SMALL LETTER SHA */
+#define XK_Armenian_VO 0x1000548 /* U+0548 ARMENIAN CAPITAL LETTER VO */
+#define XK_Armenian_vo 0x1000578 /* U+0578 ARMENIAN SMALL LETTER VO */
+#define XK_Armenian_CHA 0x1000549 /* U+0549 ARMENIAN CAPITAL LETTER CHA */
+#define XK_Armenian_cha 0x1000579 /* U+0579 ARMENIAN SMALL LETTER CHA */
+#define XK_Armenian_PE 0x100054a /* U+054A ARMENIAN CAPITAL LETTER PEH */
+#define XK_Armenian_pe 0x100057a /* U+057A ARMENIAN SMALL LETTER PEH */
+#define XK_Armenian_JE 0x100054b /* U+054B ARMENIAN CAPITAL LETTER JHEH */
+#define XK_Armenian_je 0x100057b /* U+057B ARMENIAN SMALL LETTER JHEH */
+#define XK_Armenian_RA 0x100054c /* U+054C ARMENIAN CAPITAL LETTER RA */
+#define XK_Armenian_ra 0x100057c /* U+057C ARMENIAN SMALL LETTER RA */
+#define XK_Armenian_SE 0x100054d /* U+054D ARMENIAN CAPITAL LETTER SEH */
+#define XK_Armenian_se 0x100057d /* U+057D ARMENIAN SMALL LETTER SEH */
+#define XK_Armenian_VEV 0x100054e /* U+054E ARMENIAN CAPITAL LETTER VEW */
+#define XK_Armenian_vev 0x100057e /* U+057E ARMENIAN SMALL LETTER VEW */
+#define XK_Armenian_TYUN 0x100054f /* U+054F ARMENIAN CAPITAL LETTER TIWN */
+#define XK_Armenian_tyun 0x100057f /* U+057F ARMENIAN SMALL LETTER TIWN */
+#define XK_Armenian_RE 0x1000550 /* U+0550 ARMENIAN CAPITAL LETTER REH */
+#define XK_Armenian_re 0x1000580 /* U+0580 ARMENIAN SMALL LETTER REH */
+#define XK_Armenian_TSO 0x1000551 /* U+0551 ARMENIAN CAPITAL LETTER CO */
+#define XK_Armenian_tso 0x1000581 /* U+0581 ARMENIAN SMALL LETTER CO */
+#define XK_Armenian_VYUN 0x1000552 /* U+0552 ARMENIAN CAPITAL LETTER YIWN */
+#define XK_Armenian_vyun 0x1000582 /* U+0582 ARMENIAN SMALL LETTER YIWN */
+#define XK_Armenian_PYUR 0x1000553 /* U+0553 ARMENIAN CAPITAL LETTER PIWR */
+#define XK_Armenian_pyur 0x1000583 /* U+0583 ARMENIAN SMALL LETTER PIWR */
+#define XK_Armenian_KE 0x1000554 /* U+0554 ARMENIAN CAPITAL LETTER KEH */
+#define XK_Armenian_ke 0x1000584 /* U+0584 ARMENIAN SMALL LETTER KEH */
+#define XK_Armenian_O 0x1000555 /* U+0555 ARMENIAN CAPITAL LETTER OH */
+#define XK_Armenian_o 0x1000585 /* U+0585 ARMENIAN SMALL LETTER OH */
+#define XK_Armenian_FE 0x1000556 /* U+0556 ARMENIAN CAPITAL LETTER FEH */
+#define XK_Armenian_fe 0x1000586 /* U+0586 ARMENIAN SMALL LETTER FEH */
+#define XK_Armenian_apostrophe 0x100055a /* U+055A ARMENIAN APOSTROPHE */
+#endif /* XK_ARMENIAN */
+
+/*
+ * Georgian
+ */
+
+#ifdef XK_GEORGIAN
+#define XK_Georgian_an 0x10010d0 /* U+10D0 GEORGIAN LETTER AN */
+#define XK_Georgian_ban 0x10010d1 /* U+10D1 GEORGIAN LETTER BAN */
+#define XK_Georgian_gan 0x10010d2 /* U+10D2 GEORGIAN LETTER GAN */
+#define XK_Georgian_don 0x10010d3 /* U+10D3 GEORGIAN LETTER DON */
+#define XK_Georgian_en 0x10010d4 /* U+10D4 GEORGIAN LETTER EN */
+#define XK_Georgian_vin 0x10010d5 /* U+10D5 GEORGIAN LETTER VIN */
+#define XK_Georgian_zen 0x10010d6 /* U+10D6 GEORGIAN LETTER ZEN */
+#define XK_Georgian_tan 0x10010d7 /* U+10D7 GEORGIAN LETTER TAN */
+#define XK_Georgian_in 0x10010d8 /* U+10D8 GEORGIAN LETTER IN */
+#define XK_Georgian_kan 0x10010d9 /* U+10D9 GEORGIAN LETTER KAN */
+#define XK_Georgian_las 0x10010da /* U+10DA GEORGIAN LETTER LAS */
+#define XK_Georgian_man 0x10010db /* U+10DB GEORGIAN LETTER MAN */
+#define XK_Georgian_nar 0x10010dc /* U+10DC GEORGIAN LETTER NAR */
+#define XK_Georgian_on 0x10010dd /* U+10DD GEORGIAN LETTER ON */
+#define XK_Georgian_par 0x10010de /* U+10DE GEORGIAN LETTER PAR */
+#define XK_Georgian_zhar 0x10010df /* U+10DF GEORGIAN LETTER ZHAR */
+#define XK_Georgian_rae 0x10010e0 /* U+10E0 GEORGIAN LETTER RAE */
+#define XK_Georgian_san 0x10010e1 /* U+10E1 GEORGIAN LETTER SAN */
+#define XK_Georgian_tar 0x10010e2 /* U+10E2 GEORGIAN LETTER TAR */
+#define XK_Georgian_un 0x10010e3 /* U+10E3 GEORGIAN LETTER UN */
+#define XK_Georgian_phar 0x10010e4 /* U+10E4 GEORGIAN LETTER PHAR */
+#define XK_Georgian_khar 0x10010e5 /* U+10E5 GEORGIAN LETTER KHAR */
+#define XK_Georgian_ghan 0x10010e6 /* U+10E6 GEORGIAN LETTER GHAN */
+#define XK_Georgian_qar 0x10010e7 /* U+10E7 GEORGIAN LETTER QAR */
+#define XK_Georgian_shin 0x10010e8 /* U+10E8 GEORGIAN LETTER SHIN */
+#define XK_Georgian_chin 0x10010e9 /* U+10E9 GEORGIAN LETTER CHIN */
+#define XK_Georgian_can 0x10010ea /* U+10EA GEORGIAN LETTER CAN */
+#define XK_Georgian_jil 0x10010eb /* U+10EB GEORGIAN LETTER JIL */
+#define XK_Georgian_cil 0x10010ec /* U+10EC GEORGIAN LETTER CIL */
+#define XK_Georgian_char 0x10010ed /* U+10ED GEORGIAN LETTER CHAR */
+#define XK_Georgian_xan 0x10010ee /* U+10EE GEORGIAN LETTER XAN */
+#define XK_Georgian_jhan 0x10010ef /* U+10EF GEORGIAN LETTER JHAN */
+#define XK_Georgian_hae 0x10010f0 /* U+10F0 GEORGIAN LETTER HAE */
+#define XK_Georgian_he 0x10010f1 /* U+10F1 GEORGIAN LETTER HE */
+#define XK_Georgian_hie 0x10010f2 /* U+10F2 GEORGIAN LETTER HIE */
+#define XK_Georgian_we 0x10010f3 /* U+10F3 GEORGIAN LETTER WE */
+#define XK_Georgian_har 0x10010f4 /* U+10F4 GEORGIAN LETTER HAR */
+#define XK_Georgian_hoe 0x10010f5 /* U+10F5 GEORGIAN LETTER HOE */
+#define XK_Georgian_fi 0x10010f6 /* U+10F6 GEORGIAN LETTER FI */
+#endif /* XK_GEORGIAN */
+
+/*
+ * Azeri (and other Turkic or Caucasian languages)
+ */
+
+#ifdef XK_CAUCASUS
+/* latin */
+#define XK_Xabovedot 0x1001e8a /* U+1E8A LATIN CAPITAL LETTER X WITH DOT ABOVE */
+#define XK_Ibreve 0x100012c /* U+012C LATIN CAPITAL LETTER I WITH BREVE */
+#define XK_Zstroke 0x10001b5 /* U+01B5 LATIN CAPITAL LETTER Z WITH STROKE */
+#define XK_Gcaron 0x10001e6 /* U+01E6 LATIN CAPITAL LETTER G WITH CARON */
+#define XK_Ocaron 0x10001d1 /* U+01D2 LATIN CAPITAL LETTER O WITH CARON */
+#define XK_Obarred 0x100019f /* U+019F LATIN CAPITAL LETTER O WITH MIDDLE TILDE */
+#define XK_xabovedot 0x1001e8b /* U+1E8B LATIN SMALL LETTER X WITH DOT ABOVE */
+#define XK_ibreve 0x100012d /* U+012D LATIN SMALL LETTER I WITH BREVE */
+#define XK_zstroke 0x10001b6 /* U+01B6 LATIN SMALL LETTER Z WITH STROKE */
+#define XK_gcaron 0x10001e7 /* U+01E7 LATIN SMALL LETTER G WITH CARON */
+#define XK_ocaron 0x10001d2 /* U+01D2 LATIN SMALL LETTER O WITH CARON */
+#define XK_obarred 0x1000275 /* U+0275 LATIN SMALL LETTER BARRED O */
+#define XK_SCHWA 0x100018f /* U+018F LATIN CAPITAL LETTER SCHWA */
+#define XK_schwa 0x1000259 /* U+0259 LATIN SMALL LETTER SCHWA */
+/* those are not really Caucasus */
+/* For Inupiak */
+#define XK_Lbelowdot 0x1001e36 /* U+1E36 LATIN CAPITAL LETTER L WITH DOT BELOW */
+#define XK_lbelowdot 0x1001e37 /* U+1E37 LATIN SMALL LETTER L WITH DOT BELOW */
+#endif /* XK_CAUCASUS */
+
+/*
+ * Vietnamese
+ */
+
+#ifdef XK_VIETNAMESE
+#define XK_Abelowdot 0x1001ea0 /* U+1EA0 LATIN CAPITAL LETTER A WITH DOT BELOW */
+#define XK_abelowdot 0x1001ea1 /* U+1EA1 LATIN SMALL LETTER A WITH DOT BELOW */
+#define XK_Ahook 0x1001ea2 /* U+1EA2 LATIN CAPITAL LETTER A WITH HOOK ABOVE */
+#define XK_ahook 0x1001ea3 /* U+1EA3 LATIN SMALL LETTER A WITH HOOK ABOVE */
+#define XK_Acircumflexacute 0x1001ea4 /* U+1EA4 LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE */
+#define XK_acircumflexacute 0x1001ea5 /* U+1EA5 LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE */
+#define XK_Acircumflexgrave 0x1001ea6 /* U+1EA6 LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE */
+#define XK_acircumflexgrave 0x1001ea7 /* U+1EA7 LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE */
+#define XK_Acircumflexhook 0x1001ea8 /* U+1EA8 LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE */
+#define XK_acircumflexhook 0x1001ea9 /* U+1EA9 LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE */
+#define XK_Acircumflextilde 0x1001eaa /* U+1EAA LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE */
+#define XK_acircumflextilde 0x1001eab /* U+1EAB LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE */
+#define XK_Acircumflexbelowdot 0x1001eac /* U+1EAC LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW */
+#define XK_acircumflexbelowdot 0x1001ead /* U+1EAD LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW */
+#define XK_Abreveacute 0x1001eae /* U+1EAE LATIN CAPITAL LETTER A WITH BREVE AND ACUTE */
+#define XK_abreveacute 0x1001eaf /* U+1EAF LATIN SMALL LETTER A WITH BREVE AND ACUTE */
+#define XK_Abrevegrave 0x1001eb0 /* U+1EB0 LATIN CAPITAL LETTER A WITH BREVE AND GRAVE */
+#define XK_abrevegrave 0x1001eb1 /* U+1EB1 LATIN SMALL LETTER A WITH BREVE AND GRAVE */
+#define XK_Abrevehook 0x1001eb2 /* U+1EB2 LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE */
+#define XK_abrevehook 0x1001eb3 /* U+1EB3 LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE */
+#define XK_Abrevetilde 0x1001eb4 /* U+1EB4 LATIN CAPITAL LETTER A WITH BREVE AND TILDE */
+#define XK_abrevetilde 0x1001eb5 /* U+1EB5 LATIN SMALL LETTER A WITH BREVE AND TILDE */
+#define XK_Abrevebelowdot 0x1001eb6 /* U+1EB6 LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW */
+#define XK_abrevebelowdot 0x1001eb7 /* U+1EB7 LATIN SMALL LETTER A WITH BREVE AND DOT BELOW */
+#define XK_Ebelowdot 0x1001eb8 /* U+1EB8 LATIN CAPITAL LETTER E WITH DOT BELOW */
+#define XK_ebelowdot 0x1001eb9 /* U+1EB9 LATIN SMALL LETTER E WITH DOT BELOW */
+#define XK_Ehook 0x1001eba /* U+1EBA LATIN CAPITAL LETTER E WITH HOOK ABOVE */
+#define XK_ehook 0x1001ebb /* U+1EBB LATIN SMALL LETTER E WITH HOOK ABOVE */
+#define XK_Etilde 0x1001ebc /* U+1EBC LATIN CAPITAL LETTER E WITH TILDE */
+#define XK_etilde 0x1001ebd /* U+1EBD LATIN SMALL LETTER E WITH TILDE */
+#define XK_Ecircumflexacute 0x1001ebe /* U+1EBE LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE */
+#define XK_ecircumflexacute 0x1001ebf /* U+1EBF LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE */
+#define XK_Ecircumflexgrave 0x1001ec0 /* U+1EC0 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE */
+#define XK_ecircumflexgrave 0x1001ec1 /* U+1EC1 LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE */
+#define XK_Ecircumflexhook 0x1001ec2 /* U+1EC2 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE */
+#define XK_ecircumflexhook 0x1001ec3 /* U+1EC3 LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE */
+#define XK_Ecircumflextilde 0x1001ec4 /* U+1EC4 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE */
+#define XK_ecircumflextilde 0x1001ec5 /* U+1EC5 LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE */
+#define XK_Ecircumflexbelowdot 0x1001ec6 /* U+1EC6 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW */
+#define XK_ecircumflexbelowdot 0x1001ec7 /* U+1EC7 LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW */
+#define XK_Ihook 0x1001ec8 /* U+1EC8 LATIN CAPITAL LETTER I WITH HOOK ABOVE */
+#define XK_ihook 0x1001ec9 /* U+1EC9 LATIN SMALL LETTER I WITH HOOK ABOVE */
+#define XK_Ibelowdot 0x1001eca /* U+1ECA LATIN CAPITAL LETTER I WITH DOT BELOW */
+#define XK_ibelowdot 0x1001ecb /* U+1ECB LATIN SMALL LETTER I WITH DOT BELOW */
+#define XK_Obelowdot 0x1001ecc /* U+1ECC LATIN CAPITAL LETTER O WITH DOT BELOW */
+#define XK_obelowdot 0x1001ecd /* U+1ECD LATIN SMALL LETTER O WITH DOT BELOW */
+#define XK_Ohook 0x1001ece /* U+1ECE LATIN CAPITAL LETTER O WITH HOOK ABOVE */
+#define XK_ohook 0x1001ecf /* U+1ECF LATIN SMALL LETTER O WITH HOOK ABOVE */
+#define XK_Ocircumflexacute 0x1001ed0 /* U+1ED0 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE */
+#define XK_ocircumflexacute 0x1001ed1 /* U+1ED1 LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE */
+#define XK_Ocircumflexgrave 0x1001ed2 /* U+1ED2 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE */
+#define XK_ocircumflexgrave 0x1001ed3 /* U+1ED3 LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE */
+#define XK_Ocircumflexhook 0x1001ed4 /* U+1ED4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE */
+#define XK_ocircumflexhook 0x1001ed5 /* U+1ED5 LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE */
+#define XK_Ocircumflextilde 0x1001ed6 /* U+1ED6 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE */
+#define XK_ocircumflextilde 0x1001ed7 /* U+1ED7 LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE */
+#define XK_Ocircumflexbelowdot 0x1001ed8 /* U+1ED8 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW */
+#define XK_ocircumflexbelowdot 0x1001ed9 /* U+1ED9 LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW */
+#define XK_Ohornacute 0x1001eda /* U+1EDA LATIN CAPITAL LETTER O WITH HORN AND ACUTE */
+#define XK_ohornacute 0x1001edb /* U+1EDB LATIN SMALL LETTER O WITH HORN AND ACUTE */
+#define XK_Ohorngrave 0x1001edc /* U+1EDC LATIN CAPITAL LETTER O WITH HORN AND GRAVE */
+#define XK_ohorngrave 0x1001edd /* U+1EDD LATIN SMALL LETTER O WITH HORN AND GRAVE */
+#define XK_Ohornhook 0x1001ede /* U+1EDE LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE */
+#define XK_ohornhook 0x1001edf /* U+1EDF LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE */
+#define XK_Ohorntilde 0x1001ee0 /* U+1EE0 LATIN CAPITAL LETTER O WITH HORN AND TILDE */
+#define XK_ohorntilde 0x1001ee1 /* U+1EE1 LATIN SMALL LETTER O WITH HORN AND TILDE */
+#define XK_Ohornbelowdot 0x1001ee2 /* U+1EE2 LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW */
+#define XK_ohornbelowdot 0x1001ee3 /* U+1EE3 LATIN SMALL LETTER O WITH HORN AND DOT BELOW */
+#define XK_Ubelowdot 0x1001ee4 /* U+1EE4 LATIN CAPITAL LETTER U WITH DOT BELOW */
+#define XK_ubelowdot 0x1001ee5 /* U+1EE5 LATIN SMALL LETTER U WITH DOT BELOW */
+#define XK_Uhook 0x1001ee6 /* U+1EE6 LATIN CAPITAL LETTER U WITH HOOK ABOVE */
+#define XK_uhook 0x1001ee7 /* U+1EE7 LATIN SMALL LETTER U WITH HOOK ABOVE */
+#define XK_Uhornacute 0x1001ee8 /* U+1EE8 LATIN CAPITAL LETTER U WITH HORN AND ACUTE */
+#define XK_uhornacute 0x1001ee9 /* U+1EE9 LATIN SMALL LETTER U WITH HORN AND ACUTE */
+#define XK_Uhorngrave 0x1001eea /* U+1EEA LATIN CAPITAL LETTER U WITH HORN AND GRAVE */
+#define XK_uhorngrave 0x1001eeb /* U+1EEB LATIN SMALL LETTER U WITH HORN AND GRAVE */
+#define XK_Uhornhook 0x1001eec /* U+1EEC LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE */
+#define XK_uhornhook 0x1001eed /* U+1EED LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE */
+#define XK_Uhorntilde 0x1001eee /* U+1EEE LATIN CAPITAL LETTER U WITH HORN AND TILDE */
+#define XK_uhorntilde 0x1001eef /* U+1EEF LATIN SMALL LETTER U WITH HORN AND TILDE */
+#define XK_Uhornbelowdot 0x1001ef0 /* U+1EF0 LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW */
+#define XK_uhornbelowdot 0x1001ef1 /* U+1EF1 LATIN SMALL LETTER U WITH HORN AND DOT BELOW */
+#define XK_Ybelowdot 0x1001ef4 /* U+1EF4 LATIN CAPITAL LETTER Y WITH DOT BELOW */
+#define XK_ybelowdot 0x1001ef5 /* U+1EF5 LATIN SMALL LETTER Y WITH DOT BELOW */
+#define XK_Yhook 0x1001ef6 /* U+1EF6 LATIN CAPITAL LETTER Y WITH HOOK ABOVE */
+#define XK_yhook 0x1001ef7 /* U+1EF7 LATIN SMALL LETTER Y WITH HOOK ABOVE */
+#define XK_Ytilde 0x1001ef8 /* U+1EF8 LATIN CAPITAL LETTER Y WITH TILDE */
+#define XK_ytilde 0x1001ef9 /* U+1EF9 LATIN SMALL LETTER Y WITH TILDE */
+#define XK_Ohorn 0x10001a0 /* U+01A0 LATIN CAPITAL LETTER O WITH HORN */
+#define XK_ohorn 0x10001a1 /* U+01A1 LATIN SMALL LETTER O WITH HORN */
+#define XK_Uhorn 0x10001af /* U+01AF LATIN CAPITAL LETTER U WITH HORN */
+#define XK_uhorn 0x10001b0 /* U+01B0 LATIN SMALL LETTER U WITH HORN */
+
+#endif /* XK_VIETNAMESE */
+
+#ifdef XK_CURRENCY
+#define XK_EcuSign 0x10020a0 /* U+20A0 EURO-CURRENCY SIGN */
+#define XK_ColonSign 0x10020a1 /* U+20A1 COLON SIGN */
+#define XK_CruzeiroSign 0x10020a2 /* U+20A2 CRUZEIRO SIGN */
+#define XK_FFrancSign 0x10020a3 /* U+20A3 FRENCH FRANC SIGN */
+#define XK_LiraSign 0x10020a4 /* U+20A4 LIRA SIGN */
+#define XK_MillSign 0x10020a5 /* U+20A5 MILL SIGN */
+#define XK_NairaSign 0x10020a6 /* U+20A6 NAIRA SIGN */
+#define XK_PesetaSign 0x10020a7 /* U+20A7 PESETA SIGN */
+#define XK_RupeeSign 0x10020a8 /* U+20A8 RUPEE SIGN */
+#define XK_WonSign 0x10020a9 /* U+20A9 WON SIGN */
+#define XK_NewSheqelSign 0x10020aa /* U+20AA NEW SHEQEL SIGN */
+#define XK_DongSign 0x10020ab /* U+20AB DONG SIGN */
+#define XK_EuroSign 0x20ac /* U+20AC EURO SIGN */
+#endif /* XK_CURRENCY */
+
+#ifdef XK_MATHEMATICAL
+/* one, two and three are defined above. */
+#define XK_zerosuperior 0x1002070 /* U+2070 SUPERSCRIPT ZERO */
+#define XK_foursuperior 0x1002074 /* U+2074 SUPERSCRIPT FOUR */
+#define XK_fivesuperior 0x1002075 /* U+2075 SUPERSCRIPT FIVE */
+#define XK_sixsuperior 0x1002076 /* U+2076 SUPERSCRIPT SIX */
+#define XK_sevensuperior 0x1002077 /* U+2077 SUPERSCRIPT SEVEN */
+#define XK_eightsuperior 0x1002078 /* U+2078 SUPERSCRIPT EIGHT */
+#define XK_ninesuperior 0x1002079 /* U+2079 SUPERSCRIPT NINE */
+#define XK_zerosubscript 0x1002080 /* U+2080 SUBSCRIPT ZERO */
+#define XK_onesubscript 0x1002081 /* U+2081 SUBSCRIPT ONE */
+#define XK_twosubscript 0x1002082 /* U+2082 SUBSCRIPT TWO */
+#define XK_threesubscript 0x1002083 /* U+2083 SUBSCRIPT THREE */
+#define XK_foursubscript 0x1002084 /* U+2084 SUBSCRIPT FOUR */
+#define XK_fivesubscript 0x1002085 /* U+2085 SUBSCRIPT FIVE */
+#define XK_sixsubscript 0x1002086 /* U+2086 SUBSCRIPT SIX */
+#define XK_sevensubscript 0x1002087 /* U+2087 SUBSCRIPT SEVEN */
+#define XK_eightsubscript 0x1002088 /* U+2088 SUBSCRIPT EIGHT */
+#define XK_ninesubscript 0x1002089 /* U+2089 SUBSCRIPT NINE */
+#define XK_partdifferential 0x1002202 /* U+2202 PARTIAL DIFFERENTIAL */
+#define XK_emptyset 0x1002205 /* U+2205 NULL SET */
+#define XK_elementof 0x1002208 /* U+2208 ELEMENT OF */
+#define XK_notelementof 0x1002209 /* U+2209 NOT AN ELEMENT OF */
+#define XK_containsas 0x100220B /* U+220B CONTAINS AS MEMBER */
+#define XK_squareroot 0x100221A /* U+221A SQUARE ROOT */
+#define XK_cuberoot 0x100221B /* U+221B CUBE ROOT */
+#define XK_fourthroot 0x100221C /* U+221C FOURTH ROOT */
+#define XK_dintegral 0x100222C /* U+222C DOUBLE INTEGRAL */
+#define XK_tintegral 0x100222D /* U+222D TRIPLE INTEGRAL */
+#define XK_because 0x1002235 /* U+2235 BECAUSE */
+#define XK_approxeq 0x1002248 /* U+2245 ALMOST EQUAL TO */
+#define XK_notapproxeq 0x1002247 /* U+2247 NOT ALMOST EQUAL TO */
+#define XK_notidentical 0x1002262 /* U+2262 NOT IDENTICAL TO */
+#define XK_stricteq 0x1002263 /* U+2263 STRICTLY EQUIVALENT TO */
+#endif /* XK_MATHEMATICAL */
+
+#ifdef XK_BRAILLE
+#define XK_braille_dot_1 0xfff1
+#define XK_braille_dot_2 0xfff2
+#define XK_braille_dot_3 0xfff3
+#define XK_braille_dot_4 0xfff4
+#define XK_braille_dot_5 0xfff5
+#define XK_braille_dot_6 0xfff6
+#define XK_braille_dot_7 0xfff7
+#define XK_braille_dot_8 0xfff8
+#define XK_braille_dot_9 0xfff9
+#define XK_braille_dot_10 0xfffa
+#define XK_braille_blank 0x1002800 /* U+2800 BRAILLE PATTERN BLANK */
+#define XK_braille_dots_1 0x1002801 /* U+2801 BRAILLE PATTERN DOTS-1 */
+#define XK_braille_dots_2 0x1002802 /* U+2802 BRAILLE PATTERN DOTS-2 */
+#define XK_braille_dots_12 0x1002803 /* U+2803 BRAILLE PATTERN DOTS-12 */
+#define XK_braille_dots_3 0x1002804 /* U+2804 BRAILLE PATTERN DOTS-3 */
+#define XK_braille_dots_13 0x1002805 /* U+2805 BRAILLE PATTERN DOTS-13 */
+#define XK_braille_dots_23 0x1002806 /* U+2806 BRAILLE PATTERN DOTS-23 */
+#define XK_braille_dots_123 0x1002807 /* U+2807 BRAILLE PATTERN DOTS-123 */
+#define XK_braille_dots_4 0x1002808 /* U+2808 BRAILLE PATTERN DOTS-4 */
+#define XK_braille_dots_14 0x1002809 /* U+2809 BRAILLE PATTERN DOTS-14 */
+#define XK_braille_dots_24 0x100280a /* U+280a BRAILLE PATTERN DOTS-24 */
+#define XK_braille_dots_124 0x100280b /* U+280b BRAILLE PATTERN DOTS-124 */
+#define XK_braille_dots_34 0x100280c /* U+280c BRAILLE PATTERN DOTS-34 */
+#define XK_braille_dots_134 0x100280d /* U+280d BRAILLE PATTERN DOTS-134 */
+#define XK_braille_dots_234 0x100280e /* U+280e BRAILLE PATTERN DOTS-234 */
+#define XK_braille_dots_1234 0x100280f /* U+280f BRAILLE PATTERN DOTS-1234 */
+#define XK_braille_dots_5 0x1002810 /* U+2810 BRAILLE PATTERN DOTS-5 */
+#define XK_braille_dots_15 0x1002811 /* U+2811 BRAILLE PATTERN DOTS-15 */
+#define XK_braille_dots_25 0x1002812 /* U+2812 BRAILLE PATTERN DOTS-25 */
+#define XK_braille_dots_125 0x1002813 /* U+2813 BRAILLE PATTERN DOTS-125 */
+#define XK_braille_dots_35 0x1002814 /* U+2814 BRAILLE PATTERN DOTS-35 */
+#define XK_braille_dots_135 0x1002815 /* U+2815 BRAILLE PATTERN DOTS-135 */
+#define XK_braille_dots_235 0x1002816 /* U+2816 BRAILLE PATTERN DOTS-235 */
+#define XK_braille_dots_1235 0x1002817 /* U+2817 BRAILLE PATTERN DOTS-1235 */
+#define XK_braille_dots_45 0x1002818 /* U+2818 BRAILLE PATTERN DOTS-45 */
+#define XK_braille_dots_145 0x1002819 /* U+2819 BRAILLE PATTERN DOTS-145 */
+#define XK_braille_dots_245 0x100281a /* U+281a BRAILLE PATTERN DOTS-245 */
+#define XK_braille_dots_1245 0x100281b /* U+281b BRAILLE PATTERN DOTS-1245 */
+#define XK_braille_dots_345 0x100281c /* U+281c BRAILLE PATTERN DOTS-345 */
+#define XK_braille_dots_1345 0x100281d /* U+281d BRAILLE PATTERN DOTS-1345 */
+#define XK_braille_dots_2345 0x100281e /* U+281e BRAILLE PATTERN DOTS-2345 */
+#define XK_braille_dots_12345 0x100281f /* U+281f BRAILLE PATTERN DOTS-12345 */
+#define XK_braille_dots_6 0x1002820 /* U+2820 BRAILLE PATTERN DOTS-6 */
+#define XK_braille_dots_16 0x1002821 /* U+2821 BRAILLE PATTERN DOTS-16 */
+#define XK_braille_dots_26 0x1002822 /* U+2822 BRAILLE PATTERN DOTS-26 */
+#define XK_braille_dots_126 0x1002823 /* U+2823 BRAILLE PATTERN DOTS-126 */
+#define XK_braille_dots_36 0x1002824 /* U+2824 BRAILLE PATTERN DOTS-36 */
+#define XK_braille_dots_136 0x1002825 /* U+2825 BRAILLE PATTERN DOTS-136 */
+#define XK_braille_dots_236 0x1002826 /* U+2826 BRAILLE PATTERN DOTS-236 */
+#define XK_braille_dots_1236 0x1002827 /* U+2827 BRAILLE PATTERN DOTS-1236 */
+#define XK_braille_dots_46 0x1002828 /* U+2828 BRAILLE PATTERN DOTS-46 */
+#define XK_braille_dots_146 0x1002829 /* U+2829 BRAILLE PATTERN DOTS-146 */
+#define XK_braille_dots_246 0x100282a /* U+282a BRAILLE PATTERN DOTS-246 */
+#define XK_braille_dots_1246 0x100282b /* U+282b BRAILLE PATTERN DOTS-1246 */
+#define XK_braille_dots_346 0x100282c /* U+282c BRAILLE PATTERN DOTS-346 */
+#define XK_braille_dots_1346 0x100282d /* U+282d BRAILLE PATTERN DOTS-1346 */
+#define XK_braille_dots_2346 0x100282e /* U+282e BRAILLE PATTERN DOTS-2346 */
+#define XK_braille_dots_12346 0x100282f /* U+282f BRAILLE PATTERN DOTS-12346 */
+#define XK_braille_dots_56 0x1002830 /* U+2830 BRAILLE PATTERN DOTS-56 */
+#define XK_braille_dots_156 0x1002831 /* U+2831 BRAILLE PATTERN DOTS-156 */
+#define XK_braille_dots_256 0x1002832 /* U+2832 BRAILLE PATTERN DOTS-256 */
+#define XK_braille_dots_1256 0x1002833 /* U+2833 BRAILLE PATTERN DOTS-1256 */
+#define XK_braille_dots_356 0x1002834 /* U+2834 BRAILLE PATTERN DOTS-356 */
+#define XK_braille_dots_1356 0x1002835 /* U+2835 BRAILLE PATTERN DOTS-1356 */
+#define XK_braille_dots_2356 0x1002836 /* U+2836 BRAILLE PATTERN DOTS-2356 */
+#define XK_braille_dots_12356 0x1002837 /* U+2837 BRAILLE PATTERN DOTS-12356 */
+#define XK_braille_dots_456 0x1002838 /* U+2838 BRAILLE PATTERN DOTS-456 */
+#define XK_braille_dots_1456 0x1002839 /* U+2839 BRAILLE PATTERN DOTS-1456 */
+#define XK_braille_dots_2456 0x100283a /* U+283a BRAILLE PATTERN DOTS-2456 */
+#define XK_braille_dots_12456 0x100283b /* U+283b BRAILLE PATTERN DOTS-12456 */
+#define XK_braille_dots_3456 0x100283c /* U+283c BRAILLE PATTERN DOTS-3456 */
+#define XK_braille_dots_13456 0x100283d /* U+283d BRAILLE PATTERN DOTS-13456 */
+#define XK_braille_dots_23456 0x100283e /* U+283e BRAILLE PATTERN DOTS-23456 */
+#define XK_braille_dots_123456 0x100283f /* U+283f BRAILLE PATTERN DOTS-123456 */
+#define XK_braille_dots_7 0x1002840 /* U+2840 BRAILLE PATTERN DOTS-7 */
+#define XK_braille_dots_17 0x1002841 /* U+2841 BRAILLE PATTERN DOTS-17 */
+#define XK_braille_dots_27 0x1002842 /* U+2842 BRAILLE PATTERN DOTS-27 */
+#define XK_braille_dots_127 0x1002843 /* U+2843 BRAILLE PATTERN DOTS-127 */
+#define XK_braille_dots_37 0x1002844 /* U+2844 BRAILLE PATTERN DOTS-37 */
+#define XK_braille_dots_137 0x1002845 /* U+2845 BRAILLE PATTERN DOTS-137 */
+#define XK_braille_dots_237 0x1002846 /* U+2846 BRAILLE PATTERN DOTS-237 */
+#define XK_braille_dots_1237 0x1002847 /* U+2847 BRAILLE PATTERN DOTS-1237 */
+#define XK_braille_dots_47 0x1002848 /* U+2848 BRAILLE PATTERN DOTS-47 */
+#define XK_braille_dots_147 0x1002849 /* U+2849 BRAILLE PATTERN DOTS-147 */
+#define XK_braille_dots_247 0x100284a /* U+284a BRAILLE PATTERN DOTS-247 */
+#define XK_braille_dots_1247 0x100284b /* U+284b BRAILLE PATTERN DOTS-1247 */
+#define XK_braille_dots_347 0x100284c /* U+284c BRAILLE PATTERN DOTS-347 */
+#define XK_braille_dots_1347 0x100284d /* U+284d BRAILLE PATTERN DOTS-1347 */
+#define XK_braille_dots_2347 0x100284e /* U+284e BRAILLE PATTERN DOTS-2347 */
+#define XK_braille_dots_12347 0x100284f /* U+284f BRAILLE PATTERN DOTS-12347 */
+#define XK_braille_dots_57 0x1002850 /* U+2850 BRAILLE PATTERN DOTS-57 */
+#define XK_braille_dots_157 0x1002851 /* U+2851 BRAILLE PATTERN DOTS-157 */
+#define XK_braille_dots_257 0x1002852 /* U+2852 BRAILLE PATTERN DOTS-257 */
+#define XK_braille_dots_1257 0x1002853 /* U+2853 BRAILLE PATTERN DOTS-1257 */
+#define XK_braille_dots_357 0x1002854 /* U+2854 BRAILLE PATTERN DOTS-357 */
+#define XK_braille_dots_1357 0x1002855 /* U+2855 BRAILLE PATTERN DOTS-1357 */
+#define XK_braille_dots_2357 0x1002856 /* U+2856 BRAILLE PATTERN DOTS-2357 */
+#define XK_braille_dots_12357 0x1002857 /* U+2857 BRAILLE PATTERN DOTS-12357 */
+#define XK_braille_dots_457 0x1002858 /* U+2858 BRAILLE PATTERN DOTS-457 */
+#define XK_braille_dots_1457 0x1002859 /* U+2859 BRAILLE PATTERN DOTS-1457 */
+#define XK_braille_dots_2457 0x100285a /* U+285a BRAILLE PATTERN DOTS-2457 */
+#define XK_braille_dots_12457 0x100285b /* U+285b BRAILLE PATTERN DOTS-12457 */
+#define XK_braille_dots_3457 0x100285c /* U+285c BRAILLE PATTERN DOTS-3457 */
+#define XK_braille_dots_13457 0x100285d /* U+285d BRAILLE PATTERN DOTS-13457 */
+#define XK_braille_dots_23457 0x100285e /* U+285e BRAILLE PATTERN DOTS-23457 */
+#define XK_braille_dots_123457 0x100285f /* U+285f BRAILLE PATTERN DOTS-123457 */
+#define XK_braille_dots_67 0x1002860 /* U+2860 BRAILLE PATTERN DOTS-67 */
+#define XK_braille_dots_167 0x1002861 /* U+2861 BRAILLE PATTERN DOTS-167 */
+#define XK_braille_dots_267 0x1002862 /* U+2862 BRAILLE PATTERN DOTS-267 */
+#define XK_braille_dots_1267 0x1002863 /* U+2863 BRAILLE PATTERN DOTS-1267 */
+#define XK_braille_dots_367 0x1002864 /* U+2864 BRAILLE PATTERN DOTS-367 */
+#define XK_braille_dots_1367 0x1002865 /* U+2865 BRAILLE PATTERN DOTS-1367 */
+#define XK_braille_dots_2367 0x1002866 /* U+2866 BRAILLE PATTERN DOTS-2367 */
+#define XK_braille_dots_12367 0x1002867 /* U+2867 BRAILLE PATTERN DOTS-12367 */
+#define XK_braille_dots_467 0x1002868 /* U+2868 BRAILLE PATTERN DOTS-467 */
+#define XK_braille_dots_1467 0x1002869 /* U+2869 BRAILLE PATTERN DOTS-1467 */
+#define XK_braille_dots_2467 0x100286a /* U+286a BRAILLE PATTERN DOTS-2467 */
+#define XK_braille_dots_12467 0x100286b /* U+286b BRAILLE PATTERN DOTS-12467 */
+#define XK_braille_dots_3467 0x100286c /* U+286c BRAILLE PATTERN DOTS-3467 */
+#define XK_braille_dots_13467 0x100286d /* U+286d BRAILLE PATTERN DOTS-13467 */
+#define XK_braille_dots_23467 0x100286e /* U+286e BRAILLE PATTERN DOTS-23467 */
+#define XK_braille_dots_123467 0x100286f /* U+286f BRAILLE PATTERN DOTS-123467 */
+#define XK_braille_dots_567 0x1002870 /* U+2870 BRAILLE PATTERN DOTS-567 */
+#define XK_braille_dots_1567 0x1002871 /* U+2871 BRAILLE PATTERN DOTS-1567 */
+#define XK_braille_dots_2567 0x1002872 /* U+2872 BRAILLE PATTERN DOTS-2567 */
+#define XK_braille_dots_12567 0x1002873 /* U+2873 BRAILLE PATTERN DOTS-12567 */
+#define XK_braille_dots_3567 0x1002874 /* U+2874 BRAILLE PATTERN DOTS-3567 */
+#define XK_braille_dots_13567 0x1002875 /* U+2875 BRAILLE PATTERN DOTS-13567 */
+#define XK_braille_dots_23567 0x1002876 /* U+2876 BRAILLE PATTERN DOTS-23567 */
+#define XK_braille_dots_123567 0x1002877 /* U+2877 BRAILLE PATTERN DOTS-123567 */
+#define XK_braille_dots_4567 0x1002878 /* U+2878 BRAILLE PATTERN DOTS-4567 */
+#define XK_braille_dots_14567 0x1002879 /* U+2879 BRAILLE PATTERN DOTS-14567 */
+#define XK_braille_dots_24567 0x100287a /* U+287a BRAILLE PATTERN DOTS-24567 */
+#define XK_braille_dots_124567 0x100287b /* U+287b BRAILLE PATTERN DOTS-124567 */
+#define XK_braille_dots_34567 0x100287c /* U+287c BRAILLE PATTERN DOTS-34567 */
+#define XK_braille_dots_134567 0x100287d /* U+287d BRAILLE PATTERN DOTS-134567 */
+#define XK_braille_dots_234567 0x100287e /* U+287e BRAILLE PATTERN DOTS-234567 */
+#define XK_braille_dots_1234567 0x100287f /* U+287f BRAILLE PATTERN DOTS-1234567 */
+#define XK_braille_dots_8 0x1002880 /* U+2880 BRAILLE PATTERN DOTS-8 */
+#define XK_braille_dots_18 0x1002881 /* U+2881 BRAILLE PATTERN DOTS-18 */
+#define XK_braille_dots_28 0x1002882 /* U+2882 BRAILLE PATTERN DOTS-28 */
+#define XK_braille_dots_128 0x1002883 /* U+2883 BRAILLE PATTERN DOTS-128 */
+#define XK_braille_dots_38 0x1002884 /* U+2884 BRAILLE PATTERN DOTS-38 */
+#define XK_braille_dots_138 0x1002885 /* U+2885 BRAILLE PATTERN DOTS-138 */
+#define XK_braille_dots_238 0x1002886 /* U+2886 BRAILLE PATTERN DOTS-238 */
+#define XK_braille_dots_1238 0x1002887 /* U+2887 BRAILLE PATTERN DOTS-1238 */
+#define XK_braille_dots_48 0x1002888 /* U+2888 BRAILLE PATTERN DOTS-48 */
+#define XK_braille_dots_148 0x1002889 /* U+2889 BRAILLE PATTERN DOTS-148 */
+#define XK_braille_dots_248 0x100288a /* U+288a BRAILLE PATTERN DOTS-248 */
+#define XK_braille_dots_1248 0x100288b /* U+288b BRAILLE PATTERN DOTS-1248 */
+#define XK_braille_dots_348 0x100288c /* U+288c BRAILLE PATTERN DOTS-348 */
+#define XK_braille_dots_1348 0x100288d /* U+288d BRAILLE PATTERN DOTS-1348 */
+#define XK_braille_dots_2348 0x100288e /* U+288e BRAILLE PATTERN DOTS-2348 */
+#define XK_braille_dots_12348 0x100288f /* U+288f BRAILLE PATTERN DOTS-12348 */
+#define XK_braille_dots_58 0x1002890 /* U+2890 BRAILLE PATTERN DOTS-58 */
+#define XK_braille_dots_158 0x1002891 /* U+2891 BRAILLE PATTERN DOTS-158 */
+#define XK_braille_dots_258 0x1002892 /* U+2892 BRAILLE PATTERN DOTS-258 */
+#define XK_braille_dots_1258 0x1002893 /* U+2893 BRAILLE PATTERN DOTS-1258 */
+#define XK_braille_dots_358 0x1002894 /* U+2894 BRAILLE PATTERN DOTS-358 */
+#define XK_braille_dots_1358 0x1002895 /* U+2895 BRAILLE PATTERN DOTS-1358 */
+#define XK_braille_dots_2358 0x1002896 /* U+2896 BRAILLE PATTERN DOTS-2358 */
+#define XK_braille_dots_12358 0x1002897 /* U+2897 BRAILLE PATTERN DOTS-12358 */
+#define XK_braille_dots_458 0x1002898 /* U+2898 BRAILLE PATTERN DOTS-458 */
+#define XK_braille_dots_1458 0x1002899 /* U+2899 BRAILLE PATTERN DOTS-1458 */
+#define XK_braille_dots_2458 0x100289a /* U+289a BRAILLE PATTERN DOTS-2458 */
+#define XK_braille_dots_12458 0x100289b /* U+289b BRAILLE PATTERN DOTS-12458 */
+#define XK_braille_dots_3458 0x100289c /* U+289c BRAILLE PATTERN DOTS-3458 */
+#define XK_braille_dots_13458 0x100289d /* U+289d BRAILLE PATTERN DOTS-13458 */
+#define XK_braille_dots_23458 0x100289e /* U+289e BRAILLE PATTERN DOTS-23458 */
+#define XK_braille_dots_123458 0x100289f /* U+289f BRAILLE PATTERN DOTS-123458 */
+#define XK_braille_dots_68 0x10028a0 /* U+28a0 BRAILLE PATTERN DOTS-68 */
+#define XK_braille_dots_168 0x10028a1 /* U+28a1 BRAILLE PATTERN DOTS-168 */
+#define XK_braille_dots_268 0x10028a2 /* U+28a2 BRAILLE PATTERN DOTS-268 */
+#define XK_braille_dots_1268 0x10028a3 /* U+28a3 BRAILLE PATTERN DOTS-1268 */
+#define XK_braille_dots_368 0x10028a4 /* U+28a4 BRAILLE PATTERN DOTS-368 */
+#define XK_braille_dots_1368 0x10028a5 /* U+28a5 BRAILLE PATTERN DOTS-1368 */
+#define XK_braille_dots_2368 0x10028a6 /* U+28a6 BRAILLE PATTERN DOTS-2368 */
+#define XK_braille_dots_12368 0x10028a7 /* U+28a7 BRAILLE PATTERN DOTS-12368 */
+#define XK_braille_dots_468 0x10028a8 /* U+28a8 BRAILLE PATTERN DOTS-468 */
+#define XK_braille_dots_1468 0x10028a9 /* U+28a9 BRAILLE PATTERN DOTS-1468 */
+#define XK_braille_dots_2468 0x10028aa /* U+28aa BRAILLE PATTERN DOTS-2468 */
+#define XK_braille_dots_12468 0x10028ab /* U+28ab BRAILLE PATTERN DOTS-12468 */
+#define XK_braille_dots_3468 0x10028ac /* U+28ac BRAILLE PATTERN DOTS-3468 */
+#define XK_braille_dots_13468 0x10028ad /* U+28ad BRAILLE PATTERN DOTS-13468 */
+#define XK_braille_dots_23468 0x10028ae /* U+28ae BRAILLE PATTERN DOTS-23468 */
+#define XK_braille_dots_123468 0x10028af /* U+28af BRAILLE PATTERN DOTS-123468 */
+#define XK_braille_dots_568 0x10028b0 /* U+28b0 BRAILLE PATTERN DOTS-568 */
+#define XK_braille_dots_1568 0x10028b1 /* U+28b1 BRAILLE PATTERN DOTS-1568 */
+#define XK_braille_dots_2568 0x10028b2 /* U+28b2 BRAILLE PATTERN DOTS-2568 */
+#define XK_braille_dots_12568 0x10028b3 /* U+28b3 BRAILLE PATTERN DOTS-12568 */
+#define XK_braille_dots_3568 0x10028b4 /* U+28b4 BRAILLE PATTERN DOTS-3568 */
+#define XK_braille_dots_13568 0x10028b5 /* U+28b5 BRAILLE PATTERN DOTS-13568 */
+#define XK_braille_dots_23568 0x10028b6 /* U+28b6 BRAILLE PATTERN DOTS-23568 */
+#define XK_braille_dots_123568 0x10028b7 /* U+28b7 BRAILLE PATTERN DOTS-123568 */
+#define XK_braille_dots_4568 0x10028b8 /* U+28b8 BRAILLE PATTERN DOTS-4568 */
+#define XK_braille_dots_14568 0x10028b9 /* U+28b9 BRAILLE PATTERN DOTS-14568 */
+#define XK_braille_dots_24568 0x10028ba /* U+28ba BRAILLE PATTERN DOTS-24568 */
+#define XK_braille_dots_124568 0x10028bb /* U+28bb BRAILLE PATTERN DOTS-124568 */
+#define XK_braille_dots_34568 0x10028bc /* U+28bc BRAILLE PATTERN DOTS-34568 */
+#define XK_braille_dots_134568 0x10028bd /* U+28bd BRAILLE PATTERN DOTS-134568 */
+#define XK_braille_dots_234568 0x10028be /* U+28be BRAILLE PATTERN DOTS-234568 */
+#define XK_braille_dots_1234568 0x10028bf /* U+28bf BRAILLE PATTERN DOTS-1234568 */
+#define XK_braille_dots_78 0x10028c0 /* U+28c0 BRAILLE PATTERN DOTS-78 */
+#define XK_braille_dots_178 0x10028c1 /* U+28c1 BRAILLE PATTERN DOTS-178 */
+#define XK_braille_dots_278 0x10028c2 /* U+28c2 BRAILLE PATTERN DOTS-278 */
+#define XK_braille_dots_1278 0x10028c3 /* U+28c3 BRAILLE PATTERN DOTS-1278 */
+#define XK_braille_dots_378 0x10028c4 /* U+28c4 BRAILLE PATTERN DOTS-378 */
+#define XK_braille_dots_1378 0x10028c5 /* U+28c5 BRAILLE PATTERN DOTS-1378 */
+#define XK_braille_dots_2378 0x10028c6 /* U+28c6 BRAILLE PATTERN DOTS-2378 */
+#define XK_braille_dots_12378 0x10028c7 /* U+28c7 BRAILLE PATTERN DOTS-12378 */
+#define XK_braille_dots_478 0x10028c8 /* U+28c8 BRAILLE PATTERN DOTS-478 */
+#define XK_braille_dots_1478 0x10028c9 /* U+28c9 BRAILLE PATTERN DOTS-1478 */
+#define XK_braille_dots_2478 0x10028ca /* U+28ca BRAILLE PATTERN DOTS-2478 */
+#define XK_braille_dots_12478 0x10028cb /* U+28cb BRAILLE PATTERN DOTS-12478 */
+#define XK_braille_dots_3478 0x10028cc /* U+28cc BRAILLE PATTERN DOTS-3478 */
+#define XK_braille_dots_13478 0x10028cd /* U+28cd BRAILLE PATTERN DOTS-13478 */
+#define XK_braille_dots_23478 0x10028ce /* U+28ce BRAILLE PATTERN DOTS-23478 */
+#define XK_braille_dots_123478 0x10028cf /* U+28cf BRAILLE PATTERN DOTS-123478 */
+#define XK_braille_dots_578 0x10028d0 /* U+28d0 BRAILLE PATTERN DOTS-578 */
+#define XK_braille_dots_1578 0x10028d1 /* U+28d1 BRAILLE PATTERN DOTS-1578 */
+#define XK_braille_dots_2578 0x10028d2 /* U+28d2 BRAILLE PATTERN DOTS-2578 */
+#define XK_braille_dots_12578 0x10028d3 /* U+28d3 BRAILLE PATTERN DOTS-12578 */
+#define XK_braille_dots_3578 0x10028d4 /* U+28d4 BRAILLE PATTERN DOTS-3578 */
+#define XK_braille_dots_13578 0x10028d5 /* U+28d5 BRAILLE PATTERN DOTS-13578 */
+#define XK_braille_dots_23578 0x10028d6 /* U+28d6 BRAILLE PATTERN DOTS-23578 */
+#define XK_braille_dots_123578 0x10028d7 /* U+28d7 BRAILLE PATTERN DOTS-123578 */
+#define XK_braille_dots_4578 0x10028d8 /* U+28d8 BRAILLE PATTERN DOTS-4578 */
+#define XK_braille_dots_14578 0x10028d9 /* U+28d9 BRAILLE PATTERN DOTS-14578 */
+#define XK_braille_dots_24578 0x10028da /* U+28da BRAILLE PATTERN DOTS-24578 */
+#define XK_braille_dots_124578 0x10028db /* U+28db BRAILLE PATTERN DOTS-124578 */
+#define XK_braille_dots_34578 0x10028dc /* U+28dc BRAILLE PATTERN DOTS-34578 */
+#define XK_braille_dots_134578 0x10028dd /* U+28dd BRAILLE PATTERN DOTS-134578 */
+#define XK_braille_dots_234578 0x10028de /* U+28de BRAILLE PATTERN DOTS-234578 */
+#define XK_braille_dots_1234578 0x10028df /* U+28df BRAILLE PATTERN DOTS-1234578 */
+#define XK_braille_dots_678 0x10028e0 /* U+28e0 BRAILLE PATTERN DOTS-678 */
+#define XK_braille_dots_1678 0x10028e1 /* U+28e1 BRAILLE PATTERN DOTS-1678 */
+#define XK_braille_dots_2678 0x10028e2 /* U+28e2 BRAILLE PATTERN DOTS-2678 */
+#define XK_braille_dots_12678 0x10028e3 /* U+28e3 BRAILLE PATTERN DOTS-12678 */
+#define XK_braille_dots_3678 0x10028e4 /* U+28e4 BRAILLE PATTERN DOTS-3678 */
+#define XK_braille_dots_13678 0x10028e5 /* U+28e5 BRAILLE PATTERN DOTS-13678 */
+#define XK_braille_dots_23678 0x10028e6 /* U+28e6 BRAILLE PATTERN DOTS-23678 */
+#define XK_braille_dots_123678 0x10028e7 /* U+28e7 BRAILLE PATTERN DOTS-123678 */
+#define XK_braille_dots_4678 0x10028e8 /* U+28e8 BRAILLE PATTERN DOTS-4678 */
+#define XK_braille_dots_14678 0x10028e9 /* U+28e9 BRAILLE PATTERN DOTS-14678 */
+#define XK_braille_dots_24678 0x10028ea /* U+28ea BRAILLE PATTERN DOTS-24678 */
+#define XK_braille_dots_124678 0x10028eb /* U+28eb BRAILLE PATTERN DOTS-124678 */
+#define XK_braille_dots_34678 0x10028ec /* U+28ec BRAILLE PATTERN DOTS-34678 */
+#define XK_braille_dots_134678 0x10028ed /* U+28ed BRAILLE PATTERN DOTS-134678 */
+#define XK_braille_dots_234678 0x10028ee /* U+28ee BRAILLE PATTERN DOTS-234678 */
+#define XK_braille_dots_1234678 0x10028ef /* U+28ef BRAILLE PATTERN DOTS-1234678 */
+#define XK_braille_dots_5678 0x10028f0 /* U+28f0 BRAILLE PATTERN DOTS-5678 */
+#define XK_braille_dots_15678 0x10028f1 /* U+28f1 BRAILLE PATTERN DOTS-15678 */
+#define XK_braille_dots_25678 0x10028f2 /* U+28f2 BRAILLE PATTERN DOTS-25678 */
+#define XK_braille_dots_125678 0x10028f3 /* U+28f3 BRAILLE PATTERN DOTS-125678 */
+#define XK_braille_dots_35678 0x10028f4 /* U+28f4 BRAILLE PATTERN DOTS-35678 */
+#define XK_braille_dots_135678 0x10028f5 /* U+28f5 BRAILLE PATTERN DOTS-135678 */
+#define XK_braille_dots_235678 0x10028f6 /* U+28f6 BRAILLE PATTERN DOTS-235678 */
+#define XK_braille_dots_1235678 0x10028f7 /* U+28f7 BRAILLE PATTERN DOTS-1235678 */
+#define XK_braille_dots_45678 0x10028f8 /* U+28f8 BRAILLE PATTERN DOTS-45678 */
+#define XK_braille_dots_145678 0x10028f9 /* U+28f9 BRAILLE PATTERN DOTS-145678 */
+#define XK_braille_dots_245678 0x10028fa /* U+28fa BRAILLE PATTERN DOTS-245678 */
+#define XK_braille_dots_1245678 0x10028fb /* U+28fb BRAILLE PATTERN DOTS-1245678 */
+#define XK_braille_dots_345678 0x10028fc /* U+28fc BRAILLE PATTERN DOTS-345678 */
+#define XK_braille_dots_1345678 0x10028fd /* U+28fd BRAILLE PATTERN DOTS-1345678 */
+#define XK_braille_dots_2345678 0x10028fe /* U+28fe BRAILLE PATTERN DOTS-2345678 */
+#define XK_braille_dots_12345678 0x10028ff /* U+28ff BRAILLE PATTERN DOTS-12345678 */
+#endif /* XK_BRAILLE */
diff --git a/sysroot/usr/include/_G_config.h b/sysroot/usr/include/_G_config.h
new file mode 100644
index 0000000..211d022
--- /dev/null
+++ b/sysroot/usr/include/_G_config.h
@@ -0,0 +1,101 @@
+/* This file is needed by libio to define various configuration parameters.
+ These are always the same in the GNU C library. */
+
+#ifndef _G_config_h
+#define _G_config_h 1
+
+/* Define types for libio in terms of the standard internal type names. */
+
+#include <bits/types.h>
+#define __need_size_t
+#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
+# define __need_wchar_t
+#endif
+#define __need_NULL
+#include <stddef.h>
+#define __need_mbstate_t
+#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
+# define __need_wint_t
+#endif
+#include <wchar.h>
+#define _G_size_t size_t
+typedef struct
+{
+ __off_t __pos;
+ __mbstate_t __state;
+} _G_fpos_t;
+typedef struct
+{
+ __off64_t __pos;
+ __mbstate_t __state;
+} _G_fpos64_t;
+#define _G_ssize_t __ssize_t
+#define _G_off_t __off_t
+#define _G_off64_t __off64_t
+#define _G_pid_t __pid_t
+#define _G_uid_t __uid_t
+#define _G_wchar_t wchar_t
+#define _G_wint_t wint_t
+#define _G_stat64 stat64
+#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
+# include <gconv.h>
+typedef union
+{
+ struct __gconv_info __cd;
+ struct
+ {
+ struct __gconv_info __cd;
+ struct __gconv_step_data __data;
+ } __combined;
+} _G_iconv_t;
+#endif
+
+typedef int _G_int16_t __attribute__ ((__mode__ (__HI__)));
+typedef int _G_int32_t __attribute__ ((__mode__ (__SI__)));
+typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__)));
+typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__)));
+
+#define _G_HAVE_BOOL 1
+
+
+/* These library features are always available in the GNU C library. */
+#define _G_HAVE_ATEXIT 1
+#define _G_HAVE_SYS_CDEFS 1
+#define _G_HAVE_SYS_WAIT 1
+#define _G_NEED_STDARG_H 1
+#define _G_va_list __gnuc_va_list
+
+#define _G_HAVE_PRINTF_FP 1
+#define _G_HAVE_MMAP 1
+#define _G_HAVE_MREMAP 1
+#define _G_HAVE_LONG_DOUBLE_IO 1
+#define _G_HAVE_IO_FILE_OPEN 1
+#define _G_HAVE_IO_GETLINE_INFO 1
+
+#define _G_IO_IO_FILE_VERSION 0x20001
+
+#define _G_OPEN64 __open64
+#define _G_LSEEK64 __lseek64
+#define _G_MMAP64 __mmap64
+#define _G_FSTAT64(fd,buf) __fxstat64 (_STAT_VER, fd, buf)
+
+/* This is defined by <bits/stat.h> if `st_blksize' exists. */
+#define _G_HAVE_ST_BLKSIZE defined (_STATBUF_ST_BLKSIZE)
+
+#define _G_BUFSIZ 8192
+
+/* These are the vtbl details for ELF. */
+#define _G_NAMES_HAVE_UNDERSCORE 0
+#define _G_VTABLE_LABEL_HAS_LENGTH 1
+#define _G_USING_THUNKS 1
+#define _G_VTABLE_LABEL_PREFIX "__vt_"
+#define _G_VTABLE_LABEL_PREFIX_ID __vt_
+
+
+#if defined __cplusplus || defined __STDC__
+# define _G_ARGS(ARGLIST) ARGLIST
+#else
+# define _G_ARGS(ARGLIST) ()
+#endif
+
+#endif /* _G_config.h */
diff --git a/sysroot/usr/include/a.out.h b/sysroot/usr/include/a.out.h
new file mode 100644
index 0000000..f0514c9
--- /dev/null
+++ b/sysroot/usr/include/a.out.h
@@ -0,0 +1,138 @@
+#ifndef __A_OUT_GNU_H__
+#define __A_OUT_GNU_H__
+
+#include <bits/a.out.h>
+
+#define __GNU_EXEC_MACROS__
+
+struct exec
+{
+ unsigned long a_info; /* Use macros N_MAGIC, etc for access. */
+ unsigned int a_text; /* Length of text, in bytes. */
+ unsigned int a_data; /* Length of data, in bytes. */
+ unsigned int a_bss; /* Length of uninitialized data area for file, in bytes. */
+ unsigned int a_syms; /* Length of symbol table data in file, in bytes. */
+ unsigned int a_entry; /* Start address. */
+ unsigned int a_trsize;/* Length of relocation info for text, in bytes. */
+ unsigned int a_drsize;/* Length of relocation info for data, in bytes. */
+};
+
+enum machine_type
+{
+ M_OLDSUN2 = 0,
+ M_68010 = 1,
+ M_68020 = 2,
+ M_SPARC = 3,
+ M_386 = 100,
+ M_MIPS1 = 151,
+ M_MIPS2 = 152
+};
+
+#define N_MAGIC(exec) ((exec).a_info & 0xffff)
+#define N_MACHTYPE(exec) ((enum machine_type)(((exec).a_info >> 16) & 0xff))
+#define N_FLAGS(exec) (((exec).a_info >> 24) & 0xff)
+#define N_SET_INFO(exec, magic, type, flags) \
+ ((exec).a_info = ((magic) & 0xffff) \
+ | (((int)(type) & 0xff) << 16) \
+ | (((flags) & 0xff) << 24))
+#define N_SET_MAGIC(exec, magic) \
+ ((exec).a_info = ((exec).a_info & 0xffff0000) | ((magic) & 0xffff))
+#define N_SET_MACHTYPE(exec, machtype) \
+ ((exec).a_info = \
+ ((exec).a_info&0xff00ffff) | ((((int)(machtype))&0xff) << 16))
+#define N_SET_FLAGS(exec, flags) \
+ ((exec).a_info = \
+ ((exec).a_info&0x00ffffff) | (((flags) & 0xff) << 24))
+
+/* Code indicating object file or impure executable. */
+#define OMAGIC 0407
+/* Code indicating pure executable. */
+#define NMAGIC 0410
+/* Code indicating demand-paged executable. */
+#define ZMAGIC 0413
+/* This indicates a demand-paged executable with the header in the text.
+ The first page is unmapped to help trap NULL pointer references. */
+#define QMAGIC 0314
+/* Code indicating core file. */
+#define CMAGIC 0421
+
+#define N_TRSIZE(a) ((a).a_trsize)
+#define N_DRSIZE(a) ((a).a_drsize)
+#define N_SYMSIZE(a) ((a).a_syms)
+#define N_BADMAG(x) \
+ (N_MAGIC(x) != OMAGIC && N_MAGIC(x) != NMAGIC \
+ && N_MAGIC(x) != ZMAGIC && N_MAGIC(x) != QMAGIC)
+#define _N_HDROFF(x) (1024 - sizeof (struct exec))
+#define N_TXTOFF(x) \
+ (N_MAGIC(x) == ZMAGIC ? _N_HDROFF((x)) + sizeof (struct exec) : \
+ (N_MAGIC(x) == QMAGIC ? 0 : sizeof (struct exec)))
+#define N_DATOFF(x) (N_TXTOFF(x) + (x).a_text)
+#define N_TRELOFF(x) (N_DATOFF(x) + (x).a_data)
+#define N_DRELOFF(x) (N_TRELOFF(x) + N_TRSIZE(x))
+#define N_SYMOFF(x) (N_DRELOFF(x) + N_DRSIZE(x))
+#define N_STROFF(x) (N_SYMOFF(x) + N_SYMSIZE(x))
+
+/* Address of text segment in memory after it is loaded. */
+#define N_TXTADDR(x) (N_MAGIC(x) == QMAGIC ? 4096 : 0)
+
+/* Address of data segment in memory after it is loaded. */
+#define SEGMENT_SIZE 1024
+
+#define _N_SEGMENT_ROUND(x) (((x) + SEGMENT_SIZE - 1) & ~(SEGMENT_SIZE - 1))
+#define _N_TXTENDADDR(x) (N_TXTADDR(x)+(x).a_text)
+
+#define N_DATADDR(x) \
+ (N_MAGIC(x)==OMAGIC? (_N_TXTENDADDR(x)) \
+ : (_N_SEGMENT_ROUND (_N_TXTENDADDR(x))))
+#define N_BSSADDR(x) (N_DATADDR(x) + (x).a_data)
+
+#if !defined (N_NLIST_DECLARED)
+struct nlist
+{
+ union
+ {
+ char *n_name;
+ struct nlist *n_next;
+ long n_strx;
+ } n_un;
+ unsigned char n_type;
+ char n_other;
+ short n_desc;
+ unsigned long n_value;
+};
+#endif /* no N_NLIST_DECLARED. */
+
+#define N_UNDF 0
+#define N_ABS 2
+#define N_TEXT 4
+#define N_DATA 6
+#define N_BSS 8
+#define N_FN 15
+#define N_EXT 1
+#define N_TYPE 036
+#define N_STAB 0340
+#define N_INDR 0xa
+#define N_SETA 0x14 /* Absolute set element symbol. */
+#define N_SETT 0x16 /* Text set element symbol. */
+#define N_SETD 0x18 /* Data set element symbol. */
+#define N_SETB 0x1A /* Bss set element symbol. */
+#define N_SETV 0x1C /* Pointer to set vector in data area. */
+
+#if !defined (N_RELOCATION_INFO_DECLARED)
+/* This structure describes a single relocation to be performed.
+ The text-relocation section of the file is a vector of these structures,
+ all of which apply to the text section.
+ Likewise, the data-relocation section applies to the data section. */
+
+struct relocation_info
+{
+ int r_address;
+ unsigned int r_symbolnum:24;
+ unsigned int r_pcrel:1;
+ unsigned int r_length:2;
+ unsigned int r_extern:1;
+ unsigned int r_pad:4;
+};
+#endif /* no N_RELOCATION_INFO_DECLARED. */
+
+#endif /* __A_OUT_GNU_H__ */
diff --git a/sysroot/usr/include/af_vfs.h b/sysroot/usr/include/af_vfs.h
new file mode 100644
index 0000000..db9b828
--- /dev/null
+++ b/sysroot/usr/include/af_vfs.h
@@ -0,0 +1,56 @@
+/*
+ Audio File Library
+ Copyright (C) 1999, Elliot Lee <sopwith@redhat.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the
+ Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307 USA.
+*/
+
+/*
+ af_vfs.h
+
+ Virtual file operations for the Audio File Library.
+*/
+
+#ifndef AUDIOFILE_VFS_H
+#define AUDIOFILE_VFS_H 1
+
+#include <stdio.h>
+#include <audiofile.h>
+
+struct _AFvirtualfile
+{
+ ssize_t (*read) (AFvirtualfile *vfile, void *data, size_t nbytes);
+ long (*length) (AFvirtualfile *vfile);
+ ssize_t (*write) (AFvirtualfile *vfile, const void *data, size_t nbytes);
+ void (*destroy)(AFvirtualfile *vfile);
+ long (*seek) (AFvirtualfile *vfile, long offset, int is_relative);
+ long (*tell) (AFvirtualfile *vfile);
+
+ void *closure;
+};
+
+AFvirtualfile *af_virtual_file_new (void);
+AFvirtualfile *af_virtual_file_new_for_file (FILE *fh);
+void af_virtual_file_destroy (AFvirtualfile *vfile);
+
+size_t af_fread (void *data, size_t size, size_t nmemb, AFvirtualfile *vfile);
+size_t af_fwrite (const void *data, size_t size, size_t nmemb, AFvirtualfile *vfile);
+int af_fclose (AFvirtualfile *vfile);
+long af_flength (AFvirtualfile *vfile);
+int af_fseek (AFvirtualfile *vfile, long offset, int whence);
+long af_ftell (AFvirtualfile *vfile);
+
+#endif
diff --git a/sysroot/usr/include/aio.h b/sysroot/usr/include/aio.h
new file mode 100644
index 0000000..7cfd0c1
--- /dev/null
+++ b/sysroot/usr/include/aio.h
@@ -0,0 +1,246 @@
+/* Copyright (C) 1996-2000,2003,2004,2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO/IEC 9945-1:1996 6.7: Asynchronous Input and Output
+ */
+
+#ifndef _AIO_H
+#define _AIO_H 1
+
+#include <features.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <time.h>
+#include <sys/types.h>
+
+__BEGIN_DECLS
+
+/* Asynchronous I/O control block. */
+struct aiocb
+{
+ int aio_fildes; /* File desriptor. */
+ int aio_lio_opcode; /* Operation to be performed. */
+ int aio_reqprio; /* Request priority offset. */
+ volatile void *aio_buf; /* Location of buffer. */
+ size_t aio_nbytes; /* Length of transfer. */
+ struct sigevent aio_sigevent; /* Signal number and value. */
+
+ /* Internal members. */
+ struct aiocb *__next_prio;
+ int __abs_prio;
+ int __policy;
+ int __error_code;
+ __ssize_t __return_value;
+
+#ifndef __USE_FILE_OFFSET64
+ __off_t aio_offset; /* File offset. */
+ char __pad[sizeof (__off64_t) - sizeof (__off_t)];
+#else
+ __off64_t aio_offset; /* File offset. */
+#endif
+ char __unused[32];
+};
+
+/* The same for the 64bit offsets. Please note that the members aio_fildes
+ to __return_value have to be the same in aiocb and aiocb64. */
+#ifdef __USE_LARGEFILE64
+struct aiocb64
+{
+ int aio_fildes; /* File desriptor. */
+ int aio_lio_opcode; /* Operation to be performed. */
+ int aio_reqprio; /* Request priority offset. */
+ volatile void *aio_buf; /* Location of buffer. */
+ size_t aio_nbytes; /* Length of transfer. */
+ struct sigevent aio_sigevent; /* Signal number and value. */
+
+ /* Internal members. */
+ struct aiocb *__next_prio;
+ int __abs_prio;
+ int __policy;
+ int __error_code;
+ __ssize_t __return_value;
+
+ __off64_t aio_offset; /* File offset. */
+ char __unused[32];
+};
+#endif
+
+
+#ifdef __USE_GNU
+/* To customize the implementation one can use the following struct.
+ This implementation follows the one in Irix. */
+struct aioinit
+ {
+ int aio_threads; /* Maximal number of threads. */
+ int aio_num; /* Number of expected simultanious requests. */
+ int aio_locks; /* Not used. */
+ int aio_usedba; /* Not used. */
+ int aio_debug; /* Not used. */
+ int aio_numusers; /* Not used. */
+ int aio_idle_time; /* Number of seconds before idle thread
+ terminates. */
+ int aio_reserved;
+ };
+#endif
+
+
+/* Return values of cancelation function. */
+enum
+{
+ AIO_CANCELED,
+#define AIO_CANCELED AIO_CANCELED
+ AIO_NOTCANCELED,
+#define AIO_NOTCANCELED AIO_NOTCANCELED
+ AIO_ALLDONE
+#define AIO_ALLDONE AIO_ALLDONE
+};
+
+
+/* Operation codes for `aio_lio_opcode'. */
+enum
+{
+ LIO_READ,
+#define LIO_READ LIO_READ
+ LIO_WRITE,
+#define LIO_WRITE LIO_WRITE
+ LIO_NOP
+#define LIO_NOP LIO_NOP
+};
+
+
+/* Synchronization options for `lio_listio' function. */
+enum
+{
+ LIO_WAIT,
+#define LIO_WAIT LIO_WAIT
+ LIO_NOWAIT
+#define LIO_NOWAIT LIO_NOWAIT
+};
+
+
+/* Allow user to specify optimization. */
+#ifdef __USE_GNU
+extern void aio_init (__const struct aioinit *__init) __THROW __nonnull ((1));
+#endif
+
+
+#ifndef __USE_FILE_OFFSET64
+/* Enqueue read request for given number of bytes and the given priority. */
+extern int aio_read (struct aiocb *__aiocbp) __THROW __nonnull ((1));
+/* Enqueue write request for given number of bytes and the given priority. */
+extern int aio_write (struct aiocb *__aiocbp) __THROW __nonnull ((1));
+
+/* Initiate list of I/O requests. */
+extern int lio_listio (int __mode,
+ struct aiocb *__const __list[__restrict_arr],
+ int __nent, struct sigevent *__restrict __sig)
+ __THROW __nonnull ((2));
+
+/* Retrieve error status associated with AIOCBP. */
+extern int aio_error (__const struct aiocb *__aiocbp) __THROW __nonnull ((1));
+/* Return status associated with AIOCBP. */
+extern __ssize_t aio_return (struct aiocb *__aiocbp) __THROW __nonnull ((1));
+
+/* Try to cancel asynchronous I/O requests outstanding against file
+ descriptor FILDES. */
+extern int aio_cancel (int __fildes, struct aiocb *__aiocbp) __THROW;
+
+/* Suspend calling thread until at least one of the asynchronous I/O
+ operations referenced by LIST has completed.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int aio_suspend (__const struct aiocb *__const __list[], int __nent,
+ __const struct timespec *__restrict __timeout)
+ __nonnull ((1));
+
+/* Force all operations associated with file desriptor described by
+ `aio_fildes' member of AIOCBP. */
+extern int aio_fsync (int __operation, struct aiocb *__aiocbp)
+ __THROW __nonnull ((2));
+#else
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (aio_read, (struct aiocb *__aiocbp), aio_read64)
+ __nonnull ((1));
+extern int __REDIRECT_NTH (aio_write, (struct aiocb *__aiocbp), aio_write64)
+ __nonnull ((1));
+
+extern int __REDIRECT_NTH (lio_listio,
+ (int __mode,
+ struct aiocb *__const __list[__restrict_arr],
+ int __nent, struct sigevent *__restrict __sig),
+ lio_listio64) __nonnull ((2));
+
+extern int __REDIRECT_NTH (aio_error, (__const struct aiocb *__aiocbp),
+ aio_error64) __nonnull ((1));
+extern __ssize_t __REDIRECT_NTH (aio_return, (struct aiocb *__aiocbp),
+ aio_return64) __nonnull ((1));
+
+extern int __REDIRECT_NTH (aio_cancel,
+ (int __fildes, struct aiocb *__aiocbp),
+ aio_cancel64);
+
+extern int __REDIRECT_NTH (aio_suspend,
+ (__const struct aiocb *__const __list[], int __nent,
+ __const struct timespec *__restrict __timeout),
+ aio_suspend64) __nonnull ((1));
+
+extern int __REDIRECT_NTH (aio_fsync,
+ (int __operation, struct aiocb *__aiocbp),
+ aio_fsync64) __nonnull ((2));
+
+# else
+# define aio_read aio_read64
+# define aio_write aio_write64
+# define lio_listio lio_listio64
+# define aio_error aio_error64
+# define aio_return aio_return64
+# define aio_cancel aio_cancel64
+# define aio_suspend aio_suspend64
+# define aio_fsync aio_fsync64
+# endif
+#endif
+
+#ifdef __USE_LARGEFILE64
+extern int aio_read64 (struct aiocb64 *__aiocbp) __THROW __nonnull ((1));
+extern int aio_write64 (struct aiocb64 *__aiocbp) __THROW __nonnull ((1));
+
+extern int lio_listio64 (int __mode,
+ struct aiocb64 *__const __list[__restrict_arr],
+ int __nent, struct sigevent *__restrict __sig)
+ __THROW __nonnull ((2));
+
+extern int aio_error64 (__const struct aiocb64 *__aiocbp)
+ __THROW __nonnull ((1));
+extern __ssize_t aio_return64 (struct aiocb64 *__aiocbp)
+ __THROW __nonnull ((1));
+
+extern int aio_cancel64 (int __fildes, struct aiocb64 *__aiocbp) __THROW;
+
+extern int aio_suspend64 (__const struct aiocb64 *__const __list[], int __nent,
+ __const struct timespec *__restrict __timeout)
+ __THROW __nonnull ((1));
+
+extern int aio_fsync64 (int __operation, struct aiocb64 *__aiocbp)
+ __THROW __nonnull ((2));
+#endif
+
+__END_DECLS
+
+#endif /* aio.h */
diff --git a/sysroot/usr/include/aliases.h b/sysroot/usr/include/aliases.h
new file mode 100644
index 0000000..58dd8f0
--- /dev/null
+++ b/sysroot/usr/include/aliases.h
@@ -0,0 +1,64 @@
+/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _ALIASES_H
+#define _ALIASES_H 1
+
+#include <features.h>
+
+#include <sys/types.h>
+
+
+__BEGIN_DECLS
+
+/* Structure to represent one entry of the alias data base. */
+struct aliasent
+ {
+ char *alias_name;
+ size_t alias_members_len;
+ char **alias_members;
+ int alias_local;
+ };
+
+
+/* Open alias data base files. */
+extern void setaliasent (void) __THROW;
+
+/* Close alias data base files. */
+extern void endaliasent (void) __THROW;
+
+/* Get the next entry from the alias data base. */
+extern struct aliasent *getaliasent (void) __THROW;
+
+/* Get the next entry from the alias data base and put it in RESULT_BUF. */
+extern int getaliasent_r (struct aliasent *__restrict __result_buf,
+ char *__restrict __buffer, size_t __buflen,
+ struct aliasent **__restrict __result) __THROW;
+
+/* Get alias entry corresponding to NAME. */
+extern struct aliasent *getaliasbyname (__const char *__name) __THROW;
+
+/* Get alias entry corresponding to NAME and put it in RESULT_BUF. */
+extern int getaliasbyname_r (__const char *__restrict __name,
+ struct aliasent *__restrict __result_buf,
+ char *__restrict __buffer, size_t __buflen,
+ struct aliasent **__restrict __result) __THROW;
+
+__END_DECLS
+
+#endif /* aliases.h */
diff --git a/sysroot/usr/include/alloca.h b/sysroot/usr/include/alloca.h
new file mode 100644
index 0000000..0dd291f
--- /dev/null
+++ b/sysroot/usr/include/alloca.h
@@ -0,0 +1,41 @@
+/* Copyright (C) 1992, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _ALLOCA_H
+#define _ALLOCA_H 1
+
+#include <features.h>
+
+#define __need_size_t
+#include <stddef.h>
+
+__BEGIN_DECLS
+
+/* Remove any previous definitions. */
+#undef alloca
+
+/* Allocate a block that will be freed when the calling function exits. */
+extern void *alloca (size_t __size) __THROW;
+
+#ifdef __GNUC__
+# define alloca(size) __builtin_alloca (size)
+#endif /* GCC. */
+
+__END_DECLS
+
+#endif /* alloca.h */
diff --git a/sysroot/usr/include/alsa/alisp.h b/sysroot/usr/include/alsa/alisp.h
new file mode 100644
index 0000000..407ed64
--- /dev/null
+++ b/sysroot/usr/include/alsa/alisp.h
@@ -0,0 +1,55 @@
+/*
+ * ALSA lisp implementation
+ * Copyright (c) 2003 by Jaroslav Kysela <perex@perex.cz>
+ *
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+struct alisp_cfg {
+ int verbose: 1,
+ warning: 1,
+ debug: 1;
+ snd_input_t *in; /* program code */
+ snd_output_t *out; /* program output */
+ snd_output_t *eout; /* error output */
+ snd_output_t *vout; /* verbose output */
+ snd_output_t *wout; /* warning output */
+ snd_output_t *dout; /* debug output */
+};
+
+struct alisp_instance;
+struct alisp_object;
+struct alisp_seq_iterator;
+
+struct alisp_cfg *alsa_lisp_default_cfg(snd_input_t *input);
+void alsa_lisp_default_cfg_free(struct alisp_cfg *cfg);
+int alsa_lisp(struct alisp_cfg *cfg, struct alisp_instance **instance);
+void alsa_lisp_free(struct alisp_instance *instance);
+int alsa_lisp_function(struct alisp_instance *instance, struct alisp_seq_iterator **result,
+ const char *id, const char *args, ...)
+#ifndef DOC_HIDDEN
+ __attribute__ ((format (printf, 4, 5)))
+#endif
+ ;
+void alsa_lisp_result_free(struct alisp_instance *instance,
+ struct alisp_seq_iterator *result);
+int alsa_lisp_seq_first(struct alisp_instance *instance, const char *id,
+ struct alisp_seq_iterator **seq);
+int alsa_lisp_seq_next(struct alisp_seq_iterator **seq);
+int alsa_lisp_seq_count(struct alisp_seq_iterator *seq);
+int alsa_lisp_seq_integer(struct alisp_seq_iterator *seq, long *val);
+int alsa_lisp_seq_pointer(struct alisp_seq_iterator *seq, const char *ptr_id, void **ptr);
diff --git a/sysroot/usr/include/alsa/asoundef.h b/sysroot/usr/include/alsa/asoundef.h
new file mode 100644
index 0000000..1f5b974
--- /dev/null
+++ b/sysroot/usr/include/alsa/asoundef.h
@@ -0,0 +1,253 @@
+/**
+ * \file include/asoundef.h
+ * \brief Application interface library for the ALSA driver
+ * \author Jaroslav Kysela <perex@perex.cz>
+ * \author Abramo Bagnara <abramo@alsa-project.org>
+ * \author Takashi Iwai <tiwai@suse.de>
+ * \date 1998-2001
+ *
+ * Definitions of constants for the ALSA driver
+ */
+/*
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef __ALSA_ASOUNDEF_H
+#define __ALSA_ASOUNDEF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \defgroup Digital_Audio_Interface Constants for Digital Audio Interfaces
+ * AES/IEC958 channel status bits.
+ * \{
+ */
+
+#define IEC958_AES0_PROFESSIONAL (1<<0) /**< 0 = consumer, 1 = professional */
+#define IEC958_AES0_NONAUDIO (1<<1) /**< 0 = audio, 1 = non-audio */
+#define IEC958_AES0_PRO_EMPHASIS (7<<2) /**< mask - emphasis */
+#define IEC958_AES0_PRO_EMPHASIS_NOTID (0<<2) /**< emphasis not indicated */
+#define IEC958_AES0_PRO_EMPHASIS_NONE (1<<2) /**< no emphasis */
+#define IEC958_AES0_PRO_EMPHASIS_5015 (3<<2) /**< 50/15us emphasis */
+#define IEC958_AES0_PRO_EMPHASIS_CCITT (7<<2) /**< CCITT J.17 emphasis */
+#define IEC958_AES0_PRO_FREQ_UNLOCKED (1<<5) /**< source sample frequency: 0 = locked, 1 = unlocked */
+#define IEC958_AES0_PRO_FS (3<<6) /**< mask - sample frequency */
+#define IEC958_AES0_PRO_FS_NOTID (0<<6) /**< fs not indicated */
+#define IEC958_AES0_PRO_FS_44100 (1<<6) /**< 44.1kHz */
+#define IEC958_AES0_PRO_FS_48000 (2<<6) /**< 48kHz */
+#define IEC958_AES0_PRO_FS_32000 (3<<6) /**< 32kHz */
+#define IEC958_AES0_CON_NOT_COPYRIGHT (1<<2) /**< 0 = copyright, 1 = not copyright */
+#define IEC958_AES0_CON_EMPHASIS (7<<3) /**< mask - emphasis */
+#define IEC958_AES0_CON_EMPHASIS_NONE (0<<3) /**< no emphasis */
+#define IEC958_AES0_CON_EMPHASIS_5015 (1<<3) /**< 50/15us emphasis */
+#define IEC958_AES0_CON_MODE (3<<6) /**< mask - mode */
+#define IEC958_AES1_PRO_MODE (15<<0) /**< mask - channel mode */
+#define IEC958_AES1_PRO_MODE_NOTID (0<<0) /**< mode not indicated */
+#define IEC958_AES1_PRO_MODE_STEREOPHONIC (2<<0) /**< stereophonic - ch A is left */
+#define IEC958_AES1_PRO_MODE_SINGLE (4<<0) /**< single channel */
+#define IEC958_AES1_PRO_MODE_TWO (8<<0) /**< two channels */
+#define IEC958_AES1_PRO_MODE_PRIMARY (12<<0) /**< primary/secondary */
+#define IEC958_AES1_PRO_MODE_BYTE3 (15<<0) /**< vector to byte 3 */
+#define IEC958_AES1_PRO_USERBITS (15<<4) /**< mask - user bits */
+#define IEC958_AES1_PRO_USERBITS_NOTID (0<<4) /**< user bits not indicated */
+#define IEC958_AES1_PRO_USERBITS_192 (8<<4) /**< 192-bit structure */
+#define IEC958_AES1_PRO_USERBITS_UDEF (12<<4) /**< user defined application */
+#define IEC958_AES1_CON_CATEGORY 0x7f /**< consumer category */
+#define IEC958_AES1_CON_GENERAL 0x00 /**< general category */
+#define IEC958_AES1_CON_EXPERIMENTAL 0x40 /**< experimental category */
+#define IEC958_AES1_CON_SOLIDMEM_MASK 0x0f /**< ??? */
+#define IEC958_AES1_CON_SOLIDMEM_ID 0x08 /**< ??? */
+#define IEC958_AES1_CON_BROADCAST1_MASK 0x07 /**< ??? */
+#define IEC958_AES1_CON_BROADCAST1_ID 0x04 /**< ??? */
+#define IEC958_AES1_CON_DIGDIGCONV_MASK 0x07 /**< digital<->digital converter mask */
+#define IEC958_AES1_CON_DIGDIGCONV_ID 0x02 /**< digital<->digital converter id */
+#define IEC958_AES1_CON_ADC_COPYRIGHT_MASK 0x1f /**< ADC Copyright mask */
+#define IEC958_AES1_CON_ADC_COPYRIGHT_ID 0x06 /**< ADC Copyright ID */
+#define IEC958_AES1_CON_ADC_MASK 0x1f /**< ADC Mask */
+#define IEC958_AES1_CON_ADC_ID 0x16 /**< ADC ID */
+#define IEC958_AES1_CON_BROADCAST2_MASK 0x0f /**< Broadcast mask */
+#define IEC958_AES1_CON_BROADCAST2_ID 0x0e /**< Broadcast ID */
+#define IEC958_AES1_CON_LASEROPT_MASK 0x07 /**< Laser-optical mask */
+#define IEC958_AES1_CON_LASEROPT_ID 0x01 /**< Laser-optical ID */
+#define IEC958_AES1_CON_MUSICAL_MASK 0x07 /**< Musical device mask */
+#define IEC958_AES1_CON_MUSICAL_ID 0x05 /**< Musical device ID */
+#define IEC958_AES1_CON_MAGNETIC_MASK 0x07 /**< Magnetic device mask */
+#define IEC958_AES1_CON_MAGNETIC_ID 0x03 /**< Magnetic device ID */
+#define IEC958_AES1_CON_IEC908_CD (IEC958_AES1_CON_LASEROPT_ID|0x00) /**< IEC958 CD compatible device */
+#define IEC958_AES1_CON_NON_IEC908_CD (IEC958_AES1_CON_LASEROPT_ID|0x08) /**< non-IEC958 CD compatible device */
+#define IEC958_AES1_CON_PCM_CODER (IEC958_AES1_CON_DIGDIGCONV_ID|0x00) /**< PCM coder */
+#define IEC958_AES1_CON_SAMPLER (IEC958_AES1_CON_DIGDIGCONV_ID|0x20) /**< PCM sampler */
+#define IEC958_AES1_CON_MIXER (IEC958_AES1_CON_DIGDIGCONV_ID|0x10) /**< Mixer */
+#define IEC958_AES1_CON_RATE_CONVERTER (IEC958_AES1_CON_DIGDIGCONV_ID|0x18) /**< Rate converter */
+#define IEC958_AES1_CON_SYNTHESIZER (IEC958_AES1_CON_MUSICAL_ID|0x00) /**< Synthesizer */
+#define IEC958_AES1_CON_MICROPHONE (IEC958_AES1_CON_MUSICAL_ID|0x08) /**< Microphone */
+#define IEC958_AES1_CON_DAT (IEC958_AES1_CON_MAGNETIC_ID|0x00) /**< Digital Audio Tape */
+#define IEC958_AES1_CON_VCR (IEC958_AES1_CON_MAGNETIC_ID|0x08) /**< Video recorder */
+#define IEC958_AES1_CON_ORIGINAL (1<<7) /**< this bits depends on the category code */
+#define IEC958_AES2_PRO_SBITS (7<<0) /**< mask - sample bits */
+#define IEC958_AES2_PRO_SBITS_20 (2<<0) /**< 20-bit - coordination */
+#define IEC958_AES2_PRO_SBITS_24 (4<<0) /**< 24-bit - main audio */
+#define IEC958_AES2_PRO_SBITS_UDEF (6<<0) /**< user defined application */
+#define IEC958_AES2_PRO_WORDLEN (7<<3) /**< mask - source word length */
+#define IEC958_AES2_PRO_WORDLEN_NOTID (0<<3) /**< source word length not indicated */
+#define IEC958_AES2_PRO_WORDLEN_22_18 (2<<3) /**< 22-bit or 18-bit */
+#define IEC958_AES2_PRO_WORDLEN_23_19 (4<<3) /**< 23-bit or 19-bit */
+#define IEC958_AES2_PRO_WORDLEN_24_20 (5<<3) /**< 24-bit or 20-bit */
+#define IEC958_AES2_PRO_WORDLEN_20_16 (6<<3) /**< 20-bit or 16-bit */
+#define IEC958_AES2_CON_SOURCE (15<<0) /**< mask - source number */
+#define IEC958_AES2_CON_SOURCE_UNSPEC (0<<0) /**< source number unspecified */
+#define IEC958_AES2_CON_CHANNEL (15<<4) /**< mask - channel number */
+#define IEC958_AES2_CON_CHANNEL_UNSPEC (0<<4) /**< channel number unspecified */
+#define IEC958_AES3_CON_FS (15<<0) /**< mask - sample frequency */
+#define IEC958_AES3_CON_FS_44100 (0<<0) /**< 44.1kHz */
+#define IEC958_AES3_CON_FS_48000 (2<<0) /**< 48kHz */
+#define IEC958_AES3_CON_FS_32000 (3<<0) /**< 32kHz */
+#define IEC958_AES3_CON_CLOCK (3<<4) /**< mask - clock accuracy */
+#define IEC958_AES3_CON_CLOCK_1000PPM (0<<4) /**< 1000 ppm */
+#define IEC958_AES3_CON_CLOCK_50PPM (1<<4) /**< 50 ppm */
+#define IEC958_AES3_CON_CLOCK_VARIABLE (2<<4) /**< variable pitch */
+
+/** \} */
+
+/**
+ * \defgroup MIDI_Interface Constants for MIDI v1.0
+ * Constants for MIDI v1.0.
+ * \{
+ */
+
+#define MIDI_CHANNELS 16 /**< Number of channels per port/cable. */
+#define MIDI_GM_DRUM_CHANNEL (10-1) /**< Channel number for GM drums. */
+
+/**
+ * \defgroup MIDI_Commands MIDI Commands
+ * MIDI command codes.
+ * \{
+ */
+
+#define MIDI_CMD_NOTE_OFF 0x80 /**< note off */
+#define MIDI_CMD_NOTE_ON 0x90 /**< note on */
+#define MIDI_CMD_NOTE_PRESSURE 0xa0 /**< key pressure */
+#define MIDI_CMD_CONTROL 0xb0 /**< control change */
+#define MIDI_CMD_PGM_CHANGE 0xc0 /**< program change */
+#define MIDI_CMD_CHANNEL_PRESSURE 0xd0 /**< channel pressure */
+#define MIDI_CMD_BENDER 0xe0 /**< pitch bender */
+
+#define MIDI_CMD_COMMON_SYSEX 0xf0 /**< sysex (system exclusive) begin */
+#define MIDI_CMD_COMMON_MTC_QUARTER 0xf1 /**< MTC quarter frame */
+#define MIDI_CMD_COMMON_SONG_POS 0xf2 /**< song position */
+#define MIDI_CMD_COMMON_SONG_SELECT 0xf3 /**< song select */
+#define MIDI_CMD_COMMON_TUNE_REQUEST 0xf6 /**< tune request */
+#define MIDI_CMD_COMMON_SYSEX_END 0xf7 /**< end of sysex */
+#define MIDI_CMD_COMMON_CLOCK 0xf8 /**< clock */
+#define MIDI_CMD_COMMON_START 0xfa /**< start */
+#define MIDI_CMD_COMMON_CONTINUE 0xfb /**< continue */
+#define MIDI_CMD_COMMON_STOP 0xfc /**< stop */
+#define MIDI_CMD_COMMON_SENSING 0xfe /**< active sensing */
+#define MIDI_CMD_COMMON_RESET 0xff /**< reset */
+
+/** \} */
+
+/**
+ * \defgroup MIDI_Controllers MIDI Controllers
+ * MIDI controller numbers.
+ * \{
+ */
+
+#define MIDI_CTL_MSB_BANK 0x00 /**< Bank selection */
+#define MIDI_CTL_MSB_MODWHEEL 0x01 /**< Modulation */
+#define MIDI_CTL_MSB_BREATH 0x02 /**< Breath */
+#define MIDI_CTL_MSB_FOOT 0x04 /**< Foot */
+#define MIDI_CTL_MSB_PORTAMENTO_TIME 0x05 /**< Portamento time */
+#define MIDI_CTL_MSB_DATA_ENTRY 0x06 /**< Data entry */
+#define MIDI_CTL_MSB_MAIN_VOLUME 0x07 /**< Main volume */
+#define MIDI_CTL_MSB_BALANCE 0x08 /**< Balance */
+#define MIDI_CTL_MSB_PAN 0x0a /**< Panpot */
+#define MIDI_CTL_MSB_EXPRESSION 0x0b /**< Expression */
+#define MIDI_CTL_MSB_EFFECT1 0x0c /**< Effect1 */
+#define MIDI_CTL_MSB_EFFECT2 0x0d /**< Effect2 */
+#define MIDI_CTL_MSB_GENERAL_PURPOSE1 0x10 /**< General purpose 1 */
+#define MIDI_CTL_MSB_GENERAL_PURPOSE2 0x11 /**< General purpose 2 */
+#define MIDI_CTL_MSB_GENERAL_PURPOSE3 0x12 /**< General purpose 3 */
+#define MIDI_CTL_MSB_GENERAL_PURPOSE4 0x13 /**< General purpose 4 */
+#define MIDI_CTL_LSB_BANK 0x20 /**< Bank selection */
+#define MIDI_CTL_LSB_MODWHEEL 0x21 /**< Modulation */
+#define MIDI_CTL_LSB_BREATH 0x22 /**< Breath */
+#define MIDI_CTL_LSB_FOOT 0x24 /**< Foot */
+#define MIDI_CTL_LSB_PORTAMENTO_TIME 0x25 /**< Portamento time */
+#define MIDI_CTL_LSB_DATA_ENTRY 0x26 /**< Data entry */
+#define MIDI_CTL_LSB_MAIN_VOLUME 0x27 /**< Main volume */
+#define MIDI_CTL_LSB_BALANCE 0x28 /**< Balance */
+#define MIDI_CTL_LSB_PAN 0x2a /**< Panpot */
+#define MIDI_CTL_LSB_EXPRESSION 0x2b /**< Expression */
+#define MIDI_CTL_LSB_EFFECT1 0x2c /**< Effect1 */
+#define MIDI_CTL_LSB_EFFECT2 0x2d /**< Effect2 */
+#define MIDI_CTL_LSB_GENERAL_PURPOSE1 0x30 /**< General purpose 1 */
+#define MIDI_CTL_LSB_GENERAL_PURPOSE2 0x31 /**< General purpose 2 */
+#define MIDI_CTL_LSB_GENERAL_PURPOSE3 0x32 /**< General purpose 3 */
+#define MIDI_CTL_LSB_GENERAL_PURPOSE4 0x33 /**< General purpose 4 */
+#define MIDI_CTL_SUSTAIN 0x40 /**< Sustain pedal */
+#define MIDI_CTL_PORTAMENTO 0x41 /**< Portamento */
+#define MIDI_CTL_SOSTENUTO 0x42 /**< Sostenuto */
+#define MIDI_CTL_SUSTENUTO 0x42 /**< Sostenuto (a typo in the older version) */
+#define MIDI_CTL_SOFT_PEDAL 0x43 /**< Soft pedal */
+#define MIDI_CTL_LEGATO_FOOTSWITCH 0x44 /**< Legato foot switch */
+#define MIDI_CTL_HOLD2 0x45 /**< Hold2 */
+#define MIDI_CTL_SC1_SOUND_VARIATION 0x46 /**< SC1 Sound Variation */
+#define MIDI_CTL_SC2_TIMBRE 0x47 /**< SC2 Timbre */
+#define MIDI_CTL_SC3_RELEASE_TIME 0x48 /**< SC3 Release Time */
+#define MIDI_CTL_SC4_ATTACK_TIME 0x49 /**< SC4 Attack Time */
+#define MIDI_CTL_SC5_BRIGHTNESS 0x4a /**< SC5 Brightness */
+#define MIDI_CTL_SC6 0x4b /**< SC6 */
+#define MIDI_CTL_SC7 0x4c /**< SC7 */
+#define MIDI_CTL_SC8 0x4d /**< SC8 */
+#define MIDI_CTL_SC9 0x4e /**< SC9 */
+#define MIDI_CTL_SC10 0x4f /**< SC10 */
+#define MIDI_CTL_GENERAL_PURPOSE5 0x50 /**< General purpose 5 */
+#define MIDI_CTL_GENERAL_PURPOSE6 0x51 /**< General purpose 6 */
+#define MIDI_CTL_GENERAL_PURPOSE7 0x52 /**< General purpose 7 */
+#define MIDI_CTL_GENERAL_PURPOSE8 0x53 /**< General purpose 8 */
+#define MIDI_CTL_PORTAMENTO_CONTROL 0x54 /**< Portamento control */
+#define MIDI_CTL_E1_REVERB_DEPTH 0x5b /**< E1 Reverb Depth */
+#define MIDI_CTL_E2_TREMOLO_DEPTH 0x5c /**< E2 Tremolo Depth */
+#define MIDI_CTL_E3_CHORUS_DEPTH 0x5d /**< E3 Chorus Depth */
+#define MIDI_CTL_E4_DETUNE_DEPTH 0x5e /**< E4 Detune Depth */
+#define MIDI_CTL_E5_PHASER_DEPTH 0x5f /**< E5 Phaser Depth */
+#define MIDI_CTL_DATA_INCREMENT 0x60 /**< Data Increment */
+#define MIDI_CTL_DATA_DECREMENT 0x61 /**< Data Decrement */
+#define MIDI_CTL_NONREG_PARM_NUM_LSB 0x62 /**< Non-registered parameter number */
+#define MIDI_CTL_NONREG_PARM_NUM_MSB 0x63 /**< Non-registered parameter number */
+#define MIDI_CTL_REGIST_PARM_NUM_LSB 0x64 /**< Registered parameter number */
+#define MIDI_CTL_REGIST_PARM_NUM_MSB 0x65 /**< Registered parameter number */
+#define MIDI_CTL_ALL_SOUNDS_OFF 0x78 /**< All sounds off */
+#define MIDI_CTL_RESET_CONTROLLERS 0x79 /**< Reset Controllers */
+#define MIDI_CTL_LOCAL_CONTROL_SWITCH 0x7a /**< Local control switch */
+#define MIDI_CTL_ALL_NOTES_OFF 0x7b /**< All notes off */
+#define MIDI_CTL_OMNI_OFF 0x7c /**< Omni off */
+#define MIDI_CTL_OMNI_ON 0x7d /**< Omni on */
+#define MIDI_CTL_MONO1 0x7e /**< Mono1 */
+#define MIDI_CTL_MONO2 0x7f /**< Mono2 */
+
+/** \} */
+
+/** \} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __ALSA_ASOUNDEF_H */
diff --git a/sysroot/usr/include/alsa/asoundlib.h b/sysroot/usr/include/alsa/asoundlib.h
new file mode 100644
index 0000000..a45ed8d
--- /dev/null
+++ b/sysroot/usr/include/alsa/asoundlib.h
@@ -0,0 +1,62 @@
+/**
+ * \file include/asoundlib.h
+ * \brief Application interface library for the ALSA driver
+ * \author Jaroslav Kysela <perex@perex.cz>
+ * \author Abramo Bagnara <abramo@alsa-project.org>
+ * \author Takashi Iwai <tiwai@suse.de>
+ * \date 1998-2001
+ *
+ * Application interface library for the ALSA driver
+ */
+/*
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef __ASOUNDLIB_H
+#define __ASOUNDLIB_H
+
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <fcntl.h>
+#include <assert.h>
+#include <endian.h>
+#include <sys/poll.h>
+#include <errno.h>
+#include <stdarg.h>
+
+#include <alsa/asoundef.h>
+#include <alsa/version.h>
+#include <alsa/global.h>
+#include <alsa/input.h>
+#include <alsa/output.h>
+#include <alsa/error.h>
+#include <alsa/conf.h>
+#include <alsa/pcm.h>
+#include <alsa/rawmidi.h>
+#include <alsa/timer.h>
+#include <alsa/hwdep.h>
+#include <alsa/control.h>
+#include <alsa/mixer.h>
+#include <alsa/seq_event.h>
+#include <alsa/seq.h>
+#include <alsa/seqmid.h>
+#include <alsa/seq_midi_event.h>
+#include <alsa/conv.h>
+#include <alsa/instr.h>
+
+#endif /* __ASOUNDLIB_H */
diff --git a/sysroot/usr/include/alsa/conf.h b/sysroot/usr/include/alsa/conf.h
new file mode 100644
index 0000000..7c0cab0
--- /dev/null
+++ b/sysroot/usr/include/alsa/conf.h
@@ -0,0 +1,198 @@
+/**
+ * \file include/conf.h
+ * \brief Application interface library for the ALSA driver
+ * \author Jaroslav Kysela <perex@perex.cz>
+ * \author Abramo Bagnara <abramo@alsa-project.org>
+ * \author Takashi Iwai <tiwai@suse.de>
+ * \date 1998-2001
+ *
+ * Application interface library for the ALSA driver
+ */
+/*
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef __ALSA_CONF_H
+#define __ALSA_CONF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \defgroup Config Configuration Interface
+ * The configuration functions and types allow you to read, enumerate,
+ * modify and write the contents of ALSA configuration files.
+ * \{
+ */
+
+/** \brief \c dlsym version for the config evaluate callback. */
+#define SND_CONFIG_DLSYM_VERSION_EVALUATE _dlsym_config_evaluate_001
+/** \brief \c dlsym version for the config hook callback. */
+#define SND_CONFIG_DLSYM_VERSION_HOOK _dlsym_config_hook_001
+
+/** Configuration node type. */
+typedef enum _snd_config_type {
+ /** Integer number. */
+ SND_CONFIG_TYPE_INTEGER,
+ /** 64 bit Integer number. */
+ SND_CONFIG_TYPE_INTEGER64,
+ /** Real number. */
+ SND_CONFIG_TYPE_REAL,
+ /** Character string. */
+ SND_CONFIG_TYPE_STRING,
+ /** Pointer (runtime only, cannot be saved). */
+ SND_CONFIG_TYPE_POINTER,
+ /** Compound node. */
+ SND_CONFIG_TYPE_COMPOUND = 1024
+} snd_config_type_t;
+
+/**
+ * \brief Internal structure for a configuration node object.
+ *
+ * The ALSA library uses a pointer to this structure as a handle to a
+ * configuration node. Applications don't access its contents directly.
+ */
+typedef struct _snd_config snd_config_t;
+/**
+ * \brief Type for a configuration compound iterator.
+ *
+ * The ALSA library uses this pointer type as a handle to a configuration
+ * compound iterator. Applications don't directly access the contents of
+ * the structure pointed to by this type.
+ */
+typedef struct _snd_config_iterator *snd_config_iterator_t;
+/**
+ * \brief Internal structure for a configuration private update object.
+ *
+ * The ALSA library uses this structure to save private update information.
+ */
+typedef struct _snd_config_update snd_config_update_t;
+
+extern snd_config_t *snd_config;
+
+int snd_config_top(snd_config_t **config);
+
+int snd_config_load(snd_config_t *config, snd_input_t *in);
+int snd_config_load_override(snd_config_t *config, snd_input_t *in);
+int snd_config_save(snd_config_t *config, snd_output_t *out);
+int snd_config_update(void);
+int snd_config_update_r(snd_config_t **top, snd_config_update_t **update, const char *path);
+int snd_config_update_free(snd_config_update_t *update);
+int snd_config_update_free_global(void);
+
+int snd_config_search(snd_config_t *config, const char *key,
+ snd_config_t **result);
+int snd_config_searchv(snd_config_t *config,
+ snd_config_t **result, ...);
+int snd_config_search_definition(snd_config_t *config,
+ const char *base, const char *key,
+ snd_config_t **result);
+
+int snd_config_expand(snd_config_t *config, snd_config_t *root,
+ const char *args, snd_config_t *private_data,
+ snd_config_t **result);
+int snd_config_evaluate(snd_config_t *config, snd_config_t *root,
+ snd_config_t *private_data, snd_config_t **result);
+
+int snd_config_add(snd_config_t *config, snd_config_t *leaf);
+int snd_config_delete(snd_config_t *config);
+int snd_config_delete_compound_members(const snd_config_t *config);
+int snd_config_copy(snd_config_t **dst, snd_config_t *src);
+
+int snd_config_make(snd_config_t **config, const char *key,
+ snd_config_type_t type);
+int snd_config_make_integer(snd_config_t **config, const char *key);
+int snd_config_make_integer64(snd_config_t **config, const char *key);
+int snd_config_make_real(snd_config_t **config, const char *key);
+int snd_config_make_string(snd_config_t **config, const char *key);
+int snd_config_make_pointer(snd_config_t **config, const char *key);
+int snd_config_make_compound(snd_config_t **config, const char *key, int join);
+
+int snd_config_imake_integer(snd_config_t **config, const char *key, const long value);
+int snd_config_imake_integer64(snd_config_t **config, const char *key, const long long value);
+int snd_config_imake_real(snd_config_t **config, const char *key, const double value);
+int snd_config_imake_string(snd_config_t **config, const char *key, const char *ascii);
+int snd_config_imake_pointer(snd_config_t **config, const char *key, const void *ptr);
+
+snd_config_type_t snd_config_get_type(const snd_config_t *config);
+
+int snd_config_set_id(snd_config_t *config, const char *id);
+int snd_config_set_integer(snd_config_t *config, long value);
+int snd_config_set_integer64(snd_config_t *config, long long value);
+int snd_config_set_real(snd_config_t *config, double value);
+int snd_config_set_string(snd_config_t *config, const char *value);
+int snd_config_set_ascii(snd_config_t *config, const char *ascii);
+int snd_config_set_pointer(snd_config_t *config, const void *ptr);
+int snd_config_get_id(const snd_config_t *config, const char **value);
+int snd_config_get_integer(const snd_config_t *config, long *value);
+int snd_config_get_integer64(const snd_config_t *config, long long *value);
+int snd_config_get_real(const snd_config_t *config, double *value);
+int snd_config_get_ireal(const snd_config_t *config, double *value);
+int snd_config_get_string(const snd_config_t *config, const char **value);
+int snd_config_get_ascii(const snd_config_t *config, char **value);
+int snd_config_get_pointer(const snd_config_t *config, const void **value);
+int snd_config_test_id(const snd_config_t *config, const char *id);
+
+snd_config_iterator_t snd_config_iterator_first(const snd_config_t *node);
+snd_config_iterator_t snd_config_iterator_next(const snd_config_iterator_t iterator);
+snd_config_iterator_t snd_config_iterator_end(const snd_config_t *node);
+snd_config_t *snd_config_iterator_entry(const snd_config_iterator_t iterator);
+
+/**
+ * \brief Helper macro to iterate over the children of a compound node.
+ * \param pos Iterator variable for the current node.
+ * \param next Iterator variable for the next node.
+ * \param node Handle to the compound configuration node to iterate over.
+ *
+ * This macro is designed to permit the removal of the current node.
+ */
+#define snd_config_for_each(pos, next, node) \
+ for (pos = snd_config_iterator_first(node), next = snd_config_iterator_next(pos); pos != snd_config_iterator_end(node); pos = next, next = snd_config_iterator_next(pos))
+
+/* Misc functions */
+
+int snd_config_get_bool_ascii(const char *ascii);
+int snd_config_get_bool(const snd_config_t *conf);
+int snd_config_get_ctl_iface_ascii(const char *ascii);
+int snd_config_get_ctl_iface(const snd_config_t *conf);
+
+/* Names functions */
+
+/**
+ * Device-name list element
+ */
+typedef struct snd_devname snd_devname_t;
+
+/**
+ * Device-name list element (definition)
+ */
+struct snd_devname {
+ char *name; /**< Device name string */
+ char *comment; /**< Comments */
+ snd_devname_t *next; /**< Next pointer */
+};
+
+int snd_names_list(const char *iface, snd_devname_t **list);
+void snd_names_list_free(snd_devname_t *list);
+
+/** \} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __ALSA_CONF_H */
diff --git a/sysroot/usr/include/alsa/control.h b/sysroot/usr/include/alsa/control.h
new file mode 100644
index 0000000..33faea0
--- /dev/null
+++ b/sysroot/usr/include/alsa/control.h
@@ -0,0 +1,555 @@
+/**
+ * \file include/control.h
+ * \brief Application interface library for the ALSA driver
+ * \author Jaroslav Kysela <perex@perex.cz>
+ * \author Abramo Bagnara <abramo@alsa-project.org>
+ * \author Takashi Iwai <tiwai@suse.de>
+ * \date 1998-2001
+ *
+ * Application interface library for the ALSA driver
+ */
+/*
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef __ALSA_CONTROL_H
+#define __ALSA_CONTROL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \defgroup Control Control Interface
+ * The control interface.
+ * See \ref control page for more details.
+ * \{
+ */
+
+/** dlsym version for interface entry callback */
+#define SND_CONTROL_DLSYM_VERSION _dlsym_control_001
+
+/** IEC958 structure */
+typedef struct snd_aes_iec958 {
+ unsigned char status[24]; /**< AES/IEC958 channel status bits */
+ unsigned char subcode[147]; /**< AES/IEC958 subcode bits */
+ unsigned char pad; /**< nothing */
+ unsigned char dig_subframe[4]; /**< AES/IEC958 subframe bits */
+} snd_aes_iec958_t;
+
+/** CTL card info container */
+typedef struct _snd_ctl_card_info snd_ctl_card_info_t;
+
+/** CTL element identifier container */
+typedef struct _snd_ctl_elem_id snd_ctl_elem_id_t;
+
+/** CTL element identifier list container */
+typedef struct _snd_ctl_elem_list snd_ctl_elem_list_t;
+
+/** CTL element info container */
+typedef struct _snd_ctl_elem_info snd_ctl_elem_info_t;
+
+/** CTL element value container */
+typedef struct _snd_ctl_elem_value snd_ctl_elem_value_t;
+
+/** CTL event container */
+typedef struct _snd_ctl_event snd_ctl_event_t;
+
+/** CTL element type */
+typedef enum _snd_ctl_elem_type {
+ /** Invalid type */
+ SND_CTL_ELEM_TYPE_NONE = 0,
+ /** Boolean contents */
+ SND_CTL_ELEM_TYPE_BOOLEAN,
+ /** Integer contents */
+ SND_CTL_ELEM_TYPE_INTEGER,
+ /** Enumerated contents */
+ SND_CTL_ELEM_TYPE_ENUMERATED,
+ /** Bytes contents */
+ SND_CTL_ELEM_TYPE_BYTES,
+ /** IEC958 (S/PDIF) setting content */
+ SND_CTL_ELEM_TYPE_IEC958,
+ /** 64-bit integer contents */
+ SND_CTL_ELEM_TYPE_INTEGER64,
+ SND_CTL_ELEM_TYPE_LAST = SND_CTL_ELEM_TYPE_INTEGER64
+} snd_ctl_elem_type_t;
+
+/** CTL related interface */
+typedef enum _snd_ctl_elem_iface {
+ /** Card level */
+ SND_CTL_ELEM_IFACE_CARD = 0,
+ /** Hardware dependent device */
+ SND_CTL_ELEM_IFACE_HWDEP,
+ /** Mixer */
+ SND_CTL_ELEM_IFACE_MIXER,
+ /** PCM */
+ SND_CTL_ELEM_IFACE_PCM,
+ /** RawMidi */
+ SND_CTL_ELEM_IFACE_RAWMIDI,
+ /** Timer */
+ SND_CTL_ELEM_IFACE_TIMER,
+ /** Sequencer */
+ SND_CTL_ELEM_IFACE_SEQUENCER,
+ SND_CTL_ELEM_IFACE_LAST = SND_CTL_ELEM_IFACE_SEQUENCER
+} snd_ctl_elem_iface_t;
+
+/** Event class */
+typedef enum _snd_ctl_event_type {
+ /** Elements related event */
+ SND_CTL_EVENT_ELEM = 0,
+ SND_CTL_EVENT_LAST = SND_CTL_EVENT_ELEM
+}snd_ctl_event_type_t;
+
+/** Element has been removed (Warning: test this first and if set don't
+ * test the other masks) \hideinitializer */
+#define SND_CTL_EVENT_MASK_REMOVE (~0U)
+/** Element value has been changed \hideinitializer */
+#define SND_CTL_EVENT_MASK_VALUE (1<<0)
+/** Element info has been changed \hideinitializer */
+#define SND_CTL_EVENT_MASK_INFO (1<<1)
+/** Element has been added \hideinitializer */
+#define SND_CTL_EVENT_MASK_ADD (1<<2)
+/** Element's TLV value has been changed \hideinitializer */
+#define SND_CTL_EVENT_MASK_TLV (1<<3)
+
+/** CTL name helper */
+#define SND_CTL_NAME_NONE ""
+/** CTL name helper */
+#define SND_CTL_NAME_PLAYBACK "Playback "
+/** CTL name helper */
+#define SND_CTL_NAME_CAPTURE "Capture "
+
+/** CTL name helper */
+#define SND_CTL_NAME_IEC958_NONE ""
+/** CTL name helper */
+#define SND_CTL_NAME_IEC958_SWITCH "Switch"
+/** CTL name helper */
+#define SND_CTL_NAME_IEC958_VOLUME "Volume"
+/** CTL name helper */
+#define SND_CTL_NAME_IEC958_DEFAULT "Default"
+/** CTL name helper */
+#define SND_CTL_NAME_IEC958_MASK "Mask"
+/** CTL name helper */
+#define SND_CTL_NAME_IEC958_CON_MASK "Con Mask"
+/** CTL name helper */
+#define SND_CTL_NAME_IEC958_PRO_MASK "Pro Mask"
+/** CTL name helper */
+#define SND_CTL_NAME_IEC958_PCM_STREAM "PCM Stream"
+/** Element name for IEC958 (S/PDIF) */
+#define SND_CTL_NAME_IEC958(expl,direction,what) "IEC958 " expl SND_CTL_NAME_##direction SND_CTL_NAME_IEC958_##what
+
+/** Mask for the major Power State identifier */
+#define SND_CTL_POWER_MASK 0xff00
+/** ACPI/PCI Power State D0 */
+#define SND_CTL_POWER_D0 0x0000
+/** ACPI/PCI Power State D1 */
+#define SND_CTL_POWER_D1 0x0100
+/** ACPI/PCI Power State D2 */
+#define SND_CTL_POWER_D2 0x0200
+/** ACPI/PCI Power State D3 */
+#define SND_CTL_POWER_D3 0x0300
+/** ACPI/PCI Power State D3hot */
+#define SND_CTL_POWER_D3hot (SND_CTL_POWER_D3|0x0000)
+/** ACPI/PCI Power State D3cold */
+#define SND_CTL_POWER_D3cold (SND_CTL_POWER_D3|0x0001)
+
+/** TLV type - Container */
+#define SND_CTL_TLVT_CONTAINER 0x0000
+/** TLV type - basic dB scale */
+#define SND_CTL_TLVT_DB_SCALE 0x0001
+/** TLV type - linear volume */
+#define SND_CTL_TLVT_DB_LINEAR 0x0002
+/** TLV type - dB range container */
+#define SND_CTL_TLVT_DB_RANGE 0x0003
+
+/** Mute state */
+#define SND_CTL_TLV_DB_GAIN_MUTE -9999999
+
+/** CTL type */
+typedef enum _snd_ctl_type {
+ /** Kernel level CTL */
+ SND_CTL_TYPE_HW,
+ /** Shared memory client CTL */
+ SND_CTL_TYPE_SHM,
+ /** INET client CTL (not yet implemented) */
+ SND_CTL_TYPE_INET,
+ /** External control plugin */
+ SND_CTL_TYPE_EXT
+} snd_ctl_type_t;
+
+/** Non blocking mode (flag for open mode) \hideinitializer */
+#define SND_CTL_NONBLOCK 0x0001
+
+/** Async notification (flag for open mode) \hideinitializer */
+#define SND_CTL_ASYNC 0x0002
+
+/** Read only (flag for open mode) \hideinitializer */
+#define SND_CTL_READONLY 0x0004
+
+/** CTL handle */
+typedef struct _snd_ctl snd_ctl_t;
+
+/** Don't destroy the ctl handle when close */
+#define SND_SCTL_NOFREE 0x0001
+
+/** SCTL type */
+typedef struct _snd_sctl snd_sctl_t;
+
+int snd_card_load(int card);
+int snd_card_next(int *card);
+int snd_card_get_index(const char *name);
+int snd_card_get_name(int card, char **name);
+int snd_card_get_longname(int card, char **name);
+
+int snd_device_name_hint(int card, const char *iface, void ***hints);
+int snd_device_name_free_hint(void **hints);
+char *snd_device_name_get_hint(const void *hint, const char *id);
+
+int snd_ctl_open(snd_ctl_t **ctl, const char *name, int mode);
+int snd_ctl_open_lconf(snd_ctl_t **ctl, const char *name, int mode, snd_config_t *lconf);
+int snd_ctl_close(snd_ctl_t *ctl);
+int snd_ctl_nonblock(snd_ctl_t *ctl, int nonblock);
+int snd_async_add_ctl_handler(snd_async_handler_t **handler, snd_ctl_t *ctl,
+ snd_async_callback_t callback, void *private_data);
+snd_ctl_t *snd_async_handler_get_ctl(snd_async_handler_t *handler);
+int snd_ctl_poll_descriptors_count(snd_ctl_t *ctl);
+int snd_ctl_poll_descriptors(snd_ctl_t *ctl, struct pollfd *pfds, unsigned int space);
+int snd_ctl_poll_descriptors_revents(snd_ctl_t *ctl, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
+int snd_ctl_subscribe_events(snd_ctl_t *ctl, int subscribe);
+int snd_ctl_card_info(snd_ctl_t *ctl, snd_ctl_card_info_t *info);
+int snd_ctl_elem_list(snd_ctl_t *ctl, snd_ctl_elem_list_t *list);
+int snd_ctl_elem_info(snd_ctl_t *ctl, snd_ctl_elem_info_t *info);
+int snd_ctl_elem_read(snd_ctl_t *ctl, snd_ctl_elem_value_t *value);
+int snd_ctl_elem_write(snd_ctl_t *ctl, snd_ctl_elem_value_t *value);
+int snd_ctl_elem_lock(snd_ctl_t *ctl, snd_ctl_elem_id_t *id);
+int snd_ctl_elem_unlock(snd_ctl_t *ctl, snd_ctl_elem_id_t *id);
+int snd_ctl_elem_tlv_read(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id,
+ unsigned int *tlv, unsigned int tlv_size);
+int snd_ctl_elem_tlv_write(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id,
+ const unsigned int *tlv);
+int snd_ctl_elem_tlv_command(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id,
+ const unsigned int *tlv);
+int snd_ctl_hwdep_next_device(snd_ctl_t *ctl, int * device);
+int snd_ctl_hwdep_info(snd_ctl_t *ctl, snd_hwdep_info_t * info);
+int snd_ctl_pcm_next_device(snd_ctl_t *ctl, int *device);
+int snd_ctl_pcm_info(snd_ctl_t *ctl, snd_pcm_info_t * info);
+int snd_ctl_pcm_prefer_subdevice(snd_ctl_t *ctl, int subdev);
+int snd_ctl_rawmidi_next_device(snd_ctl_t *ctl, int * device);
+int snd_ctl_rawmidi_info(snd_ctl_t *ctl, snd_rawmidi_info_t * info);
+int snd_ctl_rawmidi_prefer_subdevice(snd_ctl_t *ctl, int subdev);
+int snd_ctl_set_power_state(snd_ctl_t *ctl, unsigned int state);
+int snd_ctl_get_power_state(snd_ctl_t *ctl, unsigned int *state);
+
+int snd_ctl_read(snd_ctl_t *ctl, snd_ctl_event_t *event);
+int snd_ctl_wait(snd_ctl_t *ctl, int timeout);
+const char *snd_ctl_name(snd_ctl_t *ctl);
+snd_ctl_type_t snd_ctl_type(snd_ctl_t *ctl);
+
+const char *snd_ctl_elem_type_name(snd_ctl_elem_type_t type);
+const char *snd_ctl_elem_iface_name(snd_ctl_elem_iface_t iface);
+const char *snd_ctl_event_type_name(snd_ctl_event_type_t type);
+
+unsigned int snd_ctl_event_elem_get_mask(const snd_ctl_event_t *obj);
+unsigned int snd_ctl_event_elem_get_numid(const snd_ctl_event_t *obj);
+void snd_ctl_event_elem_get_id(const snd_ctl_event_t *obj, snd_ctl_elem_id_t *ptr);
+snd_ctl_elem_iface_t snd_ctl_event_elem_get_interface(const snd_ctl_event_t *obj);
+unsigned int snd_ctl_event_elem_get_device(const snd_ctl_event_t *obj);
+unsigned int snd_ctl_event_elem_get_subdevice(const snd_ctl_event_t *obj);
+const char *snd_ctl_event_elem_get_name(const snd_ctl_event_t *obj);
+unsigned int snd_ctl_event_elem_get_index(const snd_ctl_event_t *obj);
+
+int snd_ctl_elem_list_alloc_space(snd_ctl_elem_list_t *obj, unsigned int entries);
+void snd_ctl_elem_list_free_space(snd_ctl_elem_list_t *obj);
+
+size_t snd_ctl_elem_id_sizeof(void);
+/** \hideinitializer
+ * \brief allocate an invalid #snd_ctl_elem_id_t using standard alloca
+ * \param ptr returned pointer
+ */
+#define snd_ctl_elem_id_alloca(ptr) do { assert(ptr); *ptr = (snd_ctl_elem_id_t *) alloca(snd_ctl_elem_id_sizeof()); memset(*ptr, 0, snd_ctl_elem_id_sizeof()); } while (0)
+int snd_ctl_elem_id_malloc(snd_ctl_elem_id_t **ptr);
+void snd_ctl_elem_id_free(snd_ctl_elem_id_t *obj);
+void snd_ctl_elem_id_clear(snd_ctl_elem_id_t *obj);
+void snd_ctl_elem_id_copy(snd_ctl_elem_id_t *dst, const snd_ctl_elem_id_t *src);
+unsigned int snd_ctl_elem_id_get_numid(const snd_ctl_elem_id_t *obj);
+snd_ctl_elem_iface_t snd_ctl_elem_id_get_interface(const snd_ctl_elem_id_t *obj);
+unsigned int snd_ctl_elem_id_get_device(const snd_ctl_elem_id_t *obj);
+unsigned int snd_ctl_elem_id_get_subdevice(const snd_ctl_elem_id_t *obj);
+const char *snd_ctl_elem_id_get_name(const snd_ctl_elem_id_t *obj);
+unsigned int snd_ctl_elem_id_get_index(const snd_ctl_elem_id_t *obj);
+void snd_ctl_elem_id_set_numid(snd_ctl_elem_id_t *obj, unsigned int val);
+void snd_ctl_elem_id_set_interface(snd_ctl_elem_id_t *obj, snd_ctl_elem_iface_t val);
+void snd_ctl_elem_id_set_device(snd_ctl_elem_id_t *obj, unsigned int val);
+void snd_ctl_elem_id_set_subdevice(snd_ctl_elem_id_t *obj, unsigned int val);
+void snd_ctl_elem_id_set_name(snd_ctl_elem_id_t *obj, const char *val);
+void snd_ctl_elem_id_set_index(snd_ctl_elem_id_t *obj, unsigned int val);
+
+size_t snd_ctl_card_info_sizeof(void);
+/** \hideinitializer
+ * \brief allocate an invalid #snd_ctl_card_info_t using standard alloca
+ * \param ptr returned pointer
+ */
+#define snd_ctl_card_info_alloca(ptr) do { assert(ptr); *ptr = (snd_ctl_card_info_t *) alloca(snd_ctl_card_info_sizeof()); memset(*ptr, 0, snd_ctl_card_info_sizeof()); } while (0)
+int snd_ctl_card_info_malloc(snd_ctl_card_info_t **ptr);
+void snd_ctl_card_info_free(snd_ctl_card_info_t *obj);
+void snd_ctl_card_info_clear(snd_ctl_card_info_t *obj);
+void snd_ctl_card_info_copy(snd_ctl_card_info_t *dst, const snd_ctl_card_info_t *src);
+int snd_ctl_card_info_get_card(const snd_ctl_card_info_t *obj);
+const char *snd_ctl_card_info_get_id(const snd_ctl_card_info_t *obj);
+const char *snd_ctl_card_info_get_driver(const snd_ctl_card_info_t *obj);
+const char *snd_ctl_card_info_get_name(const snd_ctl_card_info_t *obj);
+const char *snd_ctl_card_info_get_longname(const snd_ctl_card_info_t *obj);
+const char *snd_ctl_card_info_get_mixername(const snd_ctl_card_info_t *obj);
+const char *snd_ctl_card_info_get_components(const snd_ctl_card_info_t *obj);
+
+size_t snd_ctl_event_sizeof(void);
+/** \hideinitializer
+ * \brief allocate an invalid #snd_ctl_event_t using standard alloca
+ * \param ptr returned pointer
+ */
+#define snd_ctl_event_alloca(ptr) do { assert(ptr); *ptr = (snd_ctl_event_t *) alloca(snd_ctl_event_sizeof()); memset(*ptr, 0, snd_ctl_event_sizeof()); } while (0)
+int snd_ctl_event_malloc(snd_ctl_event_t **ptr);
+void snd_ctl_event_free(snd_ctl_event_t *obj);
+void snd_ctl_event_clear(snd_ctl_event_t *obj);
+void snd_ctl_event_copy(snd_ctl_event_t *dst, const snd_ctl_event_t *src);
+snd_ctl_event_type_t snd_ctl_event_get_type(const snd_ctl_event_t *obj);
+
+size_t snd_ctl_elem_list_sizeof(void);
+/** \hideinitializer
+ * \brief allocate an invalid #snd_ctl_elem_list_t using standard alloca
+ * \param ptr returned pointer
+ */
+#define snd_ctl_elem_list_alloca(ptr) do { assert(ptr); *ptr = (snd_ctl_elem_list_t *) alloca(snd_ctl_elem_list_sizeof()); memset(*ptr, 0, snd_ctl_elem_list_sizeof()); } while (0)
+int snd_ctl_elem_list_malloc(snd_ctl_elem_list_t **ptr);
+void snd_ctl_elem_list_free(snd_ctl_elem_list_t *obj);
+void snd_ctl_elem_list_clear(snd_ctl_elem_list_t *obj);
+void snd_ctl_elem_list_copy(snd_ctl_elem_list_t *dst, const snd_ctl_elem_list_t *src);
+void snd_ctl_elem_list_set_offset(snd_ctl_elem_list_t *obj, unsigned int val);
+unsigned int snd_ctl_elem_list_get_used(const snd_ctl_elem_list_t *obj);
+unsigned int snd_ctl_elem_list_get_count(const snd_ctl_elem_list_t *obj);
+void snd_ctl_elem_list_get_id(const snd_ctl_elem_list_t *obj, unsigned int idx, snd_ctl_elem_id_t *ptr);
+unsigned int snd_ctl_elem_list_get_numid(const snd_ctl_elem_list_t *obj, unsigned int idx);
+snd_ctl_elem_iface_t snd_ctl_elem_list_get_interface(const snd_ctl_elem_list_t *obj, unsigned int idx);
+unsigned int snd_ctl_elem_list_get_device(const snd_ctl_elem_list_t *obj, unsigned int idx);
+unsigned int snd_ctl_elem_list_get_subdevice(const snd_ctl_elem_list_t *obj, unsigned int idx);
+const char *snd_ctl_elem_list_get_name(const snd_ctl_elem_list_t *obj, unsigned int idx);
+unsigned int snd_ctl_elem_list_get_index(const snd_ctl_elem_list_t *obj, unsigned int idx);
+
+size_t snd_ctl_elem_info_sizeof(void);
+/** \hideinitializer
+ * \brief allocate an invalid #snd_ctl_elem_info_t using standard alloca
+ * \param ptr returned pointer
+ */
+#define snd_ctl_elem_info_alloca(ptr) do { assert(ptr); *ptr = (snd_ctl_elem_info_t *) alloca(snd_ctl_elem_info_sizeof()); memset(*ptr, 0, snd_ctl_elem_info_sizeof()); } while (0)
+int snd_ctl_elem_info_malloc(snd_ctl_elem_info_t **ptr);
+void snd_ctl_elem_info_free(snd_ctl_elem_info_t *obj);
+void snd_ctl_elem_info_clear(snd_ctl_elem_info_t *obj);
+void snd_ctl_elem_info_copy(snd_ctl_elem_info_t *dst, const snd_ctl_elem_info_t *src);
+snd_ctl_elem_type_t snd_ctl_elem_info_get_type(const snd_ctl_elem_info_t *obj);
+int snd_ctl_elem_info_is_readable(const snd_ctl_elem_info_t *obj);
+int snd_ctl_elem_info_is_writable(const snd_ctl_elem_info_t *obj);
+int snd_ctl_elem_info_is_volatile(const snd_ctl_elem_info_t *obj);
+int snd_ctl_elem_info_is_inactive(const snd_ctl_elem_info_t *obj);
+int snd_ctl_elem_info_is_locked(const snd_ctl_elem_info_t *obj);
+int snd_ctl_elem_info_is_tlv_readable(const snd_ctl_elem_info_t *obj);
+int snd_ctl_elem_info_is_tlv_writable(const snd_ctl_elem_info_t *obj);
+int snd_ctl_elem_info_is_tlv_commandable(const snd_ctl_elem_info_t *obj);
+int snd_ctl_elem_info_is_owner(const snd_ctl_elem_info_t *obj);
+int snd_ctl_elem_info_is_user(const snd_ctl_elem_info_t *obj);
+pid_t snd_ctl_elem_info_get_owner(const snd_ctl_elem_info_t *obj);
+unsigned int snd_ctl_elem_info_get_count(const snd_ctl_elem_info_t *obj);
+long snd_ctl_elem_info_get_min(const snd_ctl_elem_info_t *obj);
+long snd_ctl_elem_info_get_max(const snd_ctl_elem_info_t *obj);
+long snd_ctl_elem_info_get_step(const snd_ctl_elem_info_t *obj);
+long long snd_ctl_elem_info_get_min64(const snd_ctl_elem_info_t *obj);
+long long snd_ctl_elem_info_get_max64(const snd_ctl_elem_info_t *obj);
+long long snd_ctl_elem_info_get_step64(const snd_ctl_elem_info_t *obj);
+unsigned int snd_ctl_elem_info_get_items(const snd_ctl_elem_info_t *obj);
+void snd_ctl_elem_info_set_item(snd_ctl_elem_info_t *obj, unsigned int val);
+const char *snd_ctl_elem_info_get_item_name(const snd_ctl_elem_info_t *obj);
+int snd_ctl_elem_info_get_dimensions(const snd_ctl_elem_info_t *obj);
+int snd_ctl_elem_info_get_dimension(const snd_ctl_elem_info_t *obj, unsigned int idx);
+void snd_ctl_elem_info_get_id(const snd_ctl_elem_info_t *obj, snd_ctl_elem_id_t *ptr);
+unsigned int snd_ctl_elem_info_get_numid(const snd_ctl_elem_info_t *obj);
+snd_ctl_elem_iface_t snd_ctl_elem_info_get_interface(const snd_ctl_elem_info_t *obj);
+unsigned int snd_ctl_elem_info_get_device(const snd_ctl_elem_info_t *obj);
+unsigned int snd_ctl_elem_info_get_subdevice(const snd_ctl_elem_info_t *obj);
+const char *snd_ctl_elem_info_get_name(const snd_ctl_elem_info_t *obj);
+unsigned int snd_ctl_elem_info_get_index(const snd_ctl_elem_info_t *obj);
+void snd_ctl_elem_info_set_id(snd_ctl_elem_info_t *obj, const snd_ctl_elem_id_t *ptr);
+void snd_ctl_elem_info_set_numid(snd_ctl_elem_info_t *obj, unsigned int val);
+void snd_ctl_elem_info_set_interface(snd_ctl_elem_info_t *obj, snd_ctl_elem_iface_t val);
+void snd_ctl_elem_info_set_device(snd_ctl_elem_info_t *obj, unsigned int val);
+void snd_ctl_elem_info_set_subdevice(snd_ctl_elem_info_t *obj, unsigned int val);
+void snd_ctl_elem_info_set_name(snd_ctl_elem_info_t *obj, const char *val);
+void snd_ctl_elem_info_set_index(snd_ctl_elem_info_t *obj, unsigned int val);
+
+int snd_ctl_elem_add_integer(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id, unsigned int count, long imin, long imax, long istep);
+int snd_ctl_elem_add_integer64(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id, unsigned int count, long long imin, long long imax, long long istep);
+int snd_ctl_elem_add_boolean(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id, unsigned int count);
+int snd_ctl_elem_add_iec958(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id);
+int snd_ctl_elem_remove(snd_ctl_t *ctl, snd_ctl_elem_id_t *id);
+
+size_t snd_ctl_elem_value_sizeof(void);
+/** \hideinitializer
+ * \brief allocate an invalid #snd_ctl_elem_value_t using standard alloca
+ * \param ptr returned pointer
+ */
+#define snd_ctl_elem_value_alloca(ptr) do { assert(ptr); *ptr = (snd_ctl_elem_value_t *) alloca(snd_ctl_elem_value_sizeof()); memset(*ptr, 0, snd_ctl_elem_value_sizeof()); } while (0)
+int snd_ctl_elem_value_malloc(snd_ctl_elem_value_t **ptr);
+void snd_ctl_elem_value_free(snd_ctl_elem_value_t *obj);
+void snd_ctl_elem_value_clear(snd_ctl_elem_value_t *obj);
+void snd_ctl_elem_value_copy(snd_ctl_elem_value_t *dst, const snd_ctl_elem_value_t *src);
+void snd_ctl_elem_value_get_id(const snd_ctl_elem_value_t *obj, snd_ctl_elem_id_t *ptr);
+unsigned int snd_ctl_elem_value_get_numid(const snd_ctl_elem_value_t *obj);
+snd_ctl_elem_iface_t snd_ctl_elem_value_get_interface(const snd_ctl_elem_value_t *obj);
+unsigned int snd_ctl_elem_value_get_device(const snd_ctl_elem_value_t *obj);
+unsigned int snd_ctl_elem_value_get_subdevice(const snd_ctl_elem_value_t *obj);
+const char *snd_ctl_elem_value_get_name(const snd_ctl_elem_value_t *obj);
+unsigned int snd_ctl_elem_value_get_index(const snd_ctl_elem_value_t *obj);
+void snd_ctl_elem_value_set_id(snd_ctl_elem_value_t *obj, const snd_ctl_elem_id_t *ptr);
+void snd_ctl_elem_value_set_numid(snd_ctl_elem_value_t *obj, unsigned int val);
+void snd_ctl_elem_value_set_interface(snd_ctl_elem_value_t *obj, snd_ctl_elem_iface_t val);
+void snd_ctl_elem_value_set_device(snd_ctl_elem_value_t *obj, unsigned int val);
+void snd_ctl_elem_value_set_subdevice(snd_ctl_elem_value_t *obj, unsigned int val);
+void snd_ctl_elem_value_set_name(snd_ctl_elem_value_t *obj, const char *val);
+void snd_ctl_elem_value_set_index(snd_ctl_elem_value_t *obj, unsigned int val);
+int snd_ctl_elem_value_get_boolean(const snd_ctl_elem_value_t *obj, unsigned int idx);
+long snd_ctl_elem_value_get_integer(const snd_ctl_elem_value_t *obj, unsigned int idx);
+long long snd_ctl_elem_value_get_integer64(const snd_ctl_elem_value_t *obj, unsigned int idx);
+unsigned int snd_ctl_elem_value_get_enumerated(const snd_ctl_elem_value_t *obj, unsigned int idx);
+unsigned char snd_ctl_elem_value_get_byte(const snd_ctl_elem_value_t *obj, unsigned int idx);
+void snd_ctl_elem_value_set_boolean(snd_ctl_elem_value_t *obj, unsigned int idx, long val);
+void snd_ctl_elem_value_set_integer(snd_ctl_elem_value_t *obj, unsigned int idx, long val);
+void snd_ctl_elem_value_set_integer64(snd_ctl_elem_value_t *obj, unsigned int idx, long long val);
+void snd_ctl_elem_value_set_enumerated(snd_ctl_elem_value_t *obj, unsigned int idx, unsigned int val);
+void snd_ctl_elem_value_set_byte(snd_ctl_elem_value_t *obj, unsigned int idx, unsigned char val);
+void snd_ctl_elem_set_bytes(snd_ctl_elem_value_t *obj, void *data, size_t size);
+const void * snd_ctl_elem_value_get_bytes(const snd_ctl_elem_value_t *obj);
+void snd_ctl_elem_value_get_iec958(const snd_ctl_elem_value_t *obj, snd_aes_iec958_t *ptr);
+void snd_ctl_elem_value_set_iec958(snd_ctl_elem_value_t *obj, const snd_aes_iec958_t *ptr);
+
+/**
+ * \defgroup HControl High level Control Interface
+ * \ingroup Control
+ * The high level control interface.
+ * See \ref hcontrol page for more details.
+ * \{
+ */
+
+/** HCTL element handle */
+typedef struct _snd_hctl_elem snd_hctl_elem_t;
+
+/** HCTL handle */
+typedef struct _snd_hctl snd_hctl_t;
+
+/**
+ * \brief Compare function for sorting HCTL elements
+ * \param e1 First element
+ * \param e2 Second element
+ * \return -1 if e1 < e2, 0 if e1 == e2, 1 if e1 > e2
+ */
+typedef int (*snd_hctl_compare_t)(const snd_hctl_elem_t *e1,
+ const snd_hctl_elem_t *e2);
+int snd_hctl_compare_fast(const snd_hctl_elem_t *c1,
+ const snd_hctl_elem_t *c2);
+/**
+ * \brief HCTL callback function
+ * \param hctl HCTL handle
+ * \param mask event mask
+ * \param elem related HCTL element (if any)
+ * \return 0 on success otherwise a negative error code
+ */
+typedef int (*snd_hctl_callback_t)(snd_hctl_t *hctl,
+ unsigned int mask,
+ snd_hctl_elem_t *elem);
+/**
+ * \brief HCTL element callback function
+ * \param elem HCTL element
+ * \param mask event mask
+ * \return 0 on success otherwise a negative error code
+ */
+typedef int (*snd_hctl_elem_callback_t)(snd_hctl_elem_t *elem,
+ unsigned int mask);
+
+int snd_hctl_open(snd_hctl_t **hctl, const char *name, int mode);
+int snd_hctl_open_ctl(snd_hctl_t **hctlp, snd_ctl_t *ctl);
+int snd_hctl_close(snd_hctl_t *hctl);
+int snd_hctl_nonblock(snd_hctl_t *hctl, int nonblock);
+int snd_hctl_poll_descriptors_count(snd_hctl_t *hctl);
+int snd_hctl_poll_descriptors(snd_hctl_t *hctl, struct pollfd *pfds, unsigned int space);
+int snd_hctl_poll_descriptors_revents(snd_hctl_t *ctl, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
+unsigned int snd_hctl_get_count(snd_hctl_t *hctl);
+int snd_hctl_set_compare(snd_hctl_t *hctl, snd_hctl_compare_t hsort);
+snd_hctl_elem_t *snd_hctl_first_elem(snd_hctl_t *hctl);
+snd_hctl_elem_t *snd_hctl_last_elem(snd_hctl_t *hctl);
+snd_hctl_elem_t *snd_hctl_find_elem(snd_hctl_t *hctl, const snd_ctl_elem_id_t *id);
+void snd_hctl_set_callback(snd_hctl_t *hctl, snd_hctl_callback_t callback);
+void snd_hctl_set_callback_private(snd_hctl_t *hctl, void *data);
+void *snd_hctl_get_callback_private(snd_hctl_t *hctl);
+int snd_hctl_load(snd_hctl_t *hctl);
+int snd_hctl_free(snd_hctl_t *hctl);
+int snd_hctl_handle_events(snd_hctl_t *hctl);
+const char *snd_hctl_name(snd_hctl_t *hctl);
+int snd_hctl_wait(snd_hctl_t *hctl, int timeout);
+snd_ctl_t *snd_hctl_ctl(snd_hctl_t *hctl);
+
+snd_hctl_elem_t *snd_hctl_elem_next(snd_hctl_elem_t *elem);
+snd_hctl_elem_t *snd_hctl_elem_prev(snd_hctl_elem_t *elem);
+int snd_hctl_elem_info(snd_hctl_elem_t *elem, snd_ctl_elem_info_t * info);
+int snd_hctl_elem_read(snd_hctl_elem_t *elem, snd_ctl_elem_value_t * value);
+int snd_hctl_elem_write(snd_hctl_elem_t *elem, snd_ctl_elem_value_t * value);
+int snd_hctl_elem_tlv_read(snd_hctl_elem_t *elem, unsigned int *tlv, unsigned int tlv_size);
+int snd_hctl_elem_tlv_write(snd_hctl_elem_t *elem, const unsigned int *tlv);
+int snd_hctl_elem_tlv_command(snd_hctl_elem_t *elem, const unsigned int *tlv);
+
+snd_hctl_t *snd_hctl_elem_get_hctl(snd_hctl_elem_t *elem);
+
+void snd_hctl_elem_get_id(const snd_hctl_elem_t *obj, snd_ctl_elem_id_t *ptr);
+unsigned int snd_hctl_elem_get_numid(const snd_hctl_elem_t *obj);
+snd_ctl_elem_iface_t snd_hctl_elem_get_interface(const snd_hctl_elem_t *obj);
+unsigned int snd_hctl_elem_get_device(const snd_hctl_elem_t *obj);
+unsigned int snd_hctl_elem_get_subdevice(const snd_hctl_elem_t *obj);
+const char *snd_hctl_elem_get_name(const snd_hctl_elem_t *obj);
+unsigned int snd_hctl_elem_get_index(const snd_hctl_elem_t *obj);
+void snd_hctl_elem_set_callback(snd_hctl_elem_t *obj, snd_hctl_elem_callback_t val);
+void * snd_hctl_elem_get_callback_private(const snd_hctl_elem_t *obj);
+void snd_hctl_elem_set_callback_private(snd_hctl_elem_t *obj, void * val);
+
+/** \} */
+
+/** \} */
+
+/**
+ * \defgroup SControl Setup Control Interface
+ * \ingroup Control
+ * The setup control interface - set or modify control elements from a configuration file.
+ * \{
+ */
+
+int snd_sctl_build(snd_sctl_t **ctl, snd_ctl_t *handle, snd_config_t *config,
+ snd_config_t *private_data, int mode);
+int snd_sctl_free(snd_sctl_t *handle);
+int snd_sctl_install(snd_sctl_t *handle);
+int snd_sctl_remove(snd_sctl_t *handle);
+
+/** \} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __ALSA_CONTROL_H */
diff --git a/sysroot/usr/include/alsa/control_external.h b/sysroot/usr/include/alsa/control_external.h
new file mode 100644
index 0000000..7c066cf
--- /dev/null
+++ b/sysroot/usr/include/alsa/control_external.h
@@ -0,0 +1,265 @@
+/**
+ * \file include/control_external.h
+ * \brief External control plugin SDK
+ * \author Takashi Iwai <tiwai@suse.de>
+ * \date 2005
+ *
+ * External control plugin SDK.
+ */
+
+/*
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+#ifndef __ALSA_CONTROL_EXTERNAL_H
+#define __ALSA_CONTROL_EXTERNAL_H
+
+#include "control.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \defgroup CtlPlugin_SDK External Control Plugin SDK
+ * \{
+ */
+
+/**
+ * Define the object entry for external control plugins
+ */
+#define SND_CTL_PLUGIN_ENTRY(name) _snd_ctl_##name##_open
+
+/**
+ * Define the symbols of the given control plugin with versions
+ */
+#define SND_CTL_PLUGIN_SYMBOL(name) SND_DLSYM_BUILD_VERSION(SND_CTL_PLUGIN_ENTRY(name), SND_CONTROL_DLSYM_VERSION);
+
+/**
+ * Define the control plugin
+ */
+#define SND_CTL_PLUGIN_DEFINE_FUNC(plugin) \
+int SND_CTL_PLUGIN_ENTRY(plugin) (snd_ctl_t **handlep, const char *name,\
+ snd_config_t *root, snd_config_t *conf, int mode)
+
+/** External control plugin handle */
+typedef struct snd_ctl_ext snd_ctl_ext_t;
+/** Callback table of control ext */
+typedef struct snd_ctl_ext_callback snd_ctl_ext_callback_t;
+/** Key to access a control pointer */
+typedef unsigned long snd_ctl_ext_key_t;
+
+/*
+ * Protocol version
+ */
+#define SND_CTL_EXT_VERSION_MAJOR 1 /**< Protocol major version */
+#define SND_CTL_EXT_VERSION_MINOR 0 /**< Protocol minor version */
+#define SND_CTL_EXT_VERSION_TINY 0 /**< Protocol tiny version */
+/**
+ * external plugin protocol version
+ */
+#define SND_CTL_EXT_VERSION ((SND_CTL_EXT_VERSION_MAJOR<<16) |\
+ (SND_CTL_EXT_VERSION_MINOR<<8) |\
+ (SND_CTL_EXT_VERSION_TINY))
+
+/** Handle of control ext */
+struct snd_ctl_ext {
+ /**
+ * protocol version; #SND_CTL_EXT_VERSION must be filled here
+ * before calling #snd_ctl_ext_create()
+ */
+ unsigned int version;
+ /**
+ * Index of this card; must be filled before calling #snd_ctl_ext_create()
+ */
+ int card_idx;
+ /**
+ * ID string of this card; must be filled before calling #snd_ctl_ext_create()
+ */
+ char id[16];
+ /**
+ * Driver name of this card; must be filled before calling #snd_ctl_ext_create()
+ */
+ char driver[16];
+ /**
+ * short name of this card; must be filled before calling #snd_ctl_ext_create()
+ */
+ char name[32];
+ /**
+ * Long name of this card; must be filled before calling #snd_ctl_ext_create()
+ */
+ char longname[80];
+ /**
+ * Mixer name of this card; must be filled before calling #snd_ctl_ext_create()
+ */
+ char mixername[80];
+ /**
+ * poll descriptor
+ */
+ int poll_fd;
+
+ /**
+ * callbacks of this plugin; must be filled before calling #snd_pcm_ioplug_create()
+ */
+ const snd_ctl_ext_callback_t *callback;
+ /**
+ * private data, which can be used freely in the driver callbacks
+ */
+ void *private_data;
+ /**
+ * control handle filled by #snd_ctl_ext_create()
+ */
+ snd_ctl_t *handle;
+
+ int nonblock; /**< non-block mode; read-only */
+ int subscribed; /**< events subscribed; read-only */
+};
+
+/** Callback table of ext */
+struct snd_ctl_ext_callback {
+ /**
+ * close the control handle; optional
+ */
+ void (*close)(snd_ctl_ext_t *ext);
+ /**
+ * return the total number of elements; required
+ */
+ int (*elem_count)(snd_ctl_ext_t *ext);
+ /**
+ * return the element id of the given offset (array index); required
+ */
+ int (*elem_list)(snd_ctl_ext_t *ext, unsigned int offset, snd_ctl_elem_id_t *id);
+ /**
+ * convert the element id to a search key; required
+ */
+ snd_ctl_ext_key_t (*find_elem)(snd_ctl_ext_t *ext, const snd_ctl_elem_id_t *id);
+ /**
+ * the destructor of the key; optional
+ */
+ void (*free_key)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key);
+ /**
+ * get the attribute of the element; required
+ */
+ int (*get_attribute)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key,
+ int *type, unsigned int *acc, unsigned int *count);
+ /**
+ * get the element information of integer type
+ */
+ int (*get_integer_info)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key,
+ long *imin, long *imax, long *istep);
+ /**
+ * get the element information of integer64 type
+ */
+ int (*get_integer64_info)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key,
+ int64_t *imin, int64_t *imax, int64_t *istep);
+ /**
+ * get the element information of enumerated type
+ */
+ int (*get_enumerated_info)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, unsigned int *items);
+ /**
+ * get the name of the enumerated item
+ */
+ int (*get_enumerated_name)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, unsigned int item,
+ char *name, size_t name_max_len);
+ /**
+ * read the current values of integer type
+ */
+ int (*read_integer)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, long *value);
+ /**
+ * read the current values of integer64 type
+ */
+ int (*read_integer64)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, int64_t *value);
+ /**
+ * read the current values of enumerated type
+ */
+ int (*read_enumerated)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, unsigned int *items);
+ /**
+ * read the current values of bytes type
+ */
+ int (*read_bytes)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, unsigned char *data,
+ size_t max_bytes);
+ /**
+ * read the current values of iec958 type
+ */
+ int (*read_iec958)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, snd_aes_iec958_t *iec958);
+ /**
+ * update the current values of integer type with the given values
+ */
+ int (*write_integer)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, long *value);
+ /**
+ * update the current values of integer64 type with the given values
+ */
+ int (*write_integer64)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, int64_t *value);
+ /**
+ * update the current values of enumerated type with the given values
+ */
+ int (*write_enumerated)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, unsigned int *items);
+ /**
+ * update the current values of bytes type with the given values
+ */
+ int (*write_bytes)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, unsigned char *data,
+ size_t max_bytes);
+ /**
+ * update the current values of iec958 type with the given values
+ */
+ int (*write_iec958)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, snd_aes_iec958_t *iec958);
+ /**
+ * subscribe/unsubscribe the event notification; optional
+ */
+ void (*subscribe_events)(snd_ctl_ext_t *ext, int subscribe);
+ /**
+ * read a pending notification event; optional
+ */
+ int (*read_event)(snd_ctl_ext_t *ext, snd_ctl_elem_id_t *id, unsigned int *event_mask);
+ /**
+ * return the number of poll descriptors; optional
+ */
+ int (*poll_descriptors_count)(snd_ctl_ext_t *ext);
+ /**
+ * fill the poll descriptors; optional
+ */
+ int (*poll_descriptors)(snd_ctl_ext_t *ext, struct pollfd *pfds, unsigned int space);
+ /**
+ * mangle the revents of poll descriptors
+ */
+ int (*poll_revents)(snd_ctl_ext_t *ext, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
+};
+
+/**
+ * The access type bits stored in get_attribute callback
+ */
+typedef enum snd_ctl_ext_access {
+ SND_CTL_EXT_ACCESS_READ = (1<<0),
+ SND_CTL_EXT_ACCESS_WRITE = (1<<1),
+ SND_CTL_EXT_ACCESS_READWRITE = (3<<0),
+ SND_CTL_EXT_ACCESS_VOLATILE = (1<<2),
+ SND_CTL_EXT_ACCESS_INACTIVE = (1<<8),
+} snd_ctl_ext_access_t;
+
+/**
+ * find_elem callback returns this if no matching control element is found
+ */
+#define SND_CTL_EXT_KEY_NOT_FOUND (snd_ctl_ext_key_t)(-1)
+
+int snd_ctl_ext_create(snd_ctl_ext_t *ext, const char *name, int mode);
+int snd_ctl_ext_delete(snd_ctl_ext_t *ext);
+
+/** \} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __ALSA_CONTROL_EXTERNAL_H */
diff --git a/sysroot/usr/include/alsa/conv.h b/sysroot/usr/include/alsa/conv.h
new file mode 100644
index 0000000..27d624c
--- /dev/null
+++ b/sysroot/usr/include/alsa/conv.h
@@ -0,0 +1,57 @@
+/**
+ * \file include/conv.h
+ * \brief Application interface library for the ALSA driver
+ * \author Jaroslav Kysela <perex@perex.cz>
+ * \author Abramo Bagnara <abramo@alsa-project.org>
+ * \author Takashi Iwai <tiwai@suse.de>
+ * \date 1998-2001
+ *
+ * Application interface library for the ALSA driver
+ */
+/*
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef __ALSA_CONV_H
+#define __ALSA_CONV_H
+
+/**
+ * \defgroup BConv Binary Value Conversion
+ * Helper macros to convert binary values to/from a specific byte order.
+ * \{
+ */
+
+/** Converts a 16-bit value from host to little endian byte order. */
+#define snd_host_to_LE_16(val) __cpu_to_le16(val)
+/** Converts a 16-bit value from little endian to host byte order. */
+#define snd_LE_to_host_16(val) __le16_to_cpu(val)
+/** Converts a 32-bit value from host to little endian byte order. */
+#define snd_host_to_LE_32(val) __cpu_to_le32(val)
+/** Converts a 32-bit value from little endian to host byte order. */
+#define snd_LE_to_host_32(val) __le32_to_cpu(val)
+/** Converts a 16-bit value from host to big endian byte order. */
+#define snd_host_to_BE_16(val) __cpu_to_be16(val)
+/** Converts a 16-bit value from big endian to host byte order. */
+#define snd_BE_to_host_16(val) __be16_to_cpu(val)
+/** Converts a 32-bit value from host to big endian byte order. */
+#define snd_host_to_BE_32(val) __cpu_to_be32(val)
+/** Converts a 32-bit value from big endian to host byte order. */
+#define snd_BE_to_host_32(val) __be32_to_cpu(val)
+
+/** \} */
+
+#endif /* __ALSA_CONV_H */
+
diff --git a/sysroot/usr/include/alsa/error.h b/sysroot/usr/include/alsa/error.h
new file mode 100644
index 0000000..6d27083
--- /dev/null
+++ b/sysroot/usr/include/alsa/error.h
@@ -0,0 +1,78 @@
+/**
+ * \file include/error.h
+ * \brief Application interface library for the ALSA driver
+ * \author Jaroslav Kysela <perex@perex.cz>
+ * \author Abramo Bagnara <abramo@alsa-project.org>
+ * \author Takashi Iwai <tiwai@suse.de>
+ * \date 1998-2001
+ *
+ * Application interface library for the ALSA driver
+ */
+/*
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef __ALSA_ERROR_H
+#define __ALSA_ERROR_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \defgroup Error Error handling
+ * Error handling macros and functions.
+ * \{
+ */
+
+#define SND_ERROR_BEGIN 500000 /**< Lower boundary of sound error codes. */
+#define SND_ERROR_INCOMPATIBLE_VERSION (SND_ERROR_BEGIN+0) /**< Kernel/library protocols are not compatible. */
+#define SND_ERROR_ALISP_NIL (SND_ERROR_BEGIN+1) /**< Lisp encountered an error during acall. */
+
+const char *snd_strerror(int errnum);
+
+/**
+ * \brief Error handler callback.
+ * \param file Source file name.
+ * \param line Line number.
+ * \param function Function name.
+ * \param err Value of \c errno, or 0 if not relevant.
+ * \param fmt \c printf(3) format.
+ * \param ... \c printf(3) arguments.
+ *
+ * A function of this type is called by the ALSA library when an error occurs.
+ * This function usually shows the message on the screen, and/or logs it.
+ */
+typedef void (*snd_lib_error_handler_t)(const char *file, int line, const char *function, int err, const char *fmt, ...) /* __attribute__ ((format (printf, 5, 6))) */;
+extern snd_lib_error_handler_t snd_lib_error;
+extern int snd_lib_error_set_handler(snd_lib_error_handler_t handler);
+
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 95)
+#define SNDERR(...) snd_lib_error(__FILE__, __LINE__, __FUNCTION__, 0, __VA_ARGS__) /**< Shows a sound error message. */
+#define SYSERR(...) snd_lib_error(__FILE__, __LINE__, __FUNCTION__, errno, __VA_ARGS__) /**< Shows a system error message (related to \c errno). */
+#else
+#define SNDERR(args...) snd_lib_error(__FILE__, __LINE__, __FUNCTION__, 0, ##args) /**< Shows a sound error message. */
+#define SYSERR(args...) snd_lib_error(__FILE__, __LINE__, __FUNCTION__, errno, ##args) /**< Shows a system error message (related to \c errno). */
+#endif
+
+/** \} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __ALSA_ERROR_H */
+
diff --git a/sysroot/usr/include/alsa/global.h b/sysroot/usr/include/alsa/global.h
new file mode 100644
index 0000000..f388e4b
--- /dev/null
+++ b/sysroot/usr/include/alsa/global.h
@@ -0,0 +1,156 @@
+/**
+ * \file include/global.h
+ * \brief Application interface library for the ALSA driver
+ * \author Jaroslav Kysela <perex@perex.cz>
+ * \author Abramo Bagnara <abramo@alsa-project.org>
+ * \author Takashi Iwai <tiwai@suse.de>
+ * \date 1998-2001
+ *
+ * Application interface library for the ALSA driver
+ */
+/*
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef __ALSA_GLOBAL_H_
+#define __ALSA_GLOBAL_H_
+
+/* for timeval and timespec */
+#include <time.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \defgroup Global Global defines and functions
+ * Global defines and functions.
+ * \par
+ * The ALSA library implementation uses these macros and functions.
+ * Most applications probably do not need them.
+ * \{
+ */
+
+const char *snd_asoundlib_version(void);
+
+#ifndef ATTRIBUTE_UNUSED
+/** do not print warning (gcc) when function parameter is not used */
+#define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
+#endif
+
+#ifdef PIC /* dynamic build */
+
+/** \hideinitializer \brief Helper macro for #SND_DLSYM_BUILD_VERSION. */
+#define __SND_DLSYM_VERSION(name, version) _ ## name ## version
+/**
+ * \hideinitializer
+ * \brief Appends the build version to the name of a versioned dynamic symbol.
+ */
+#define SND_DLSYM_BUILD_VERSION(name, version) char __SND_DLSYM_VERSION(name, version);
+
+#else /* static build */
+
+struct snd_dlsym_link {
+ struct snd_dlsym_link *next;
+ const char *dlsym_name;
+ const void *dlsym_ptr;
+};
+
+extern struct snd_dlsym_link *snd_dlsym_start;
+
+/** \hideinitializer \brief Helper macro for #SND_DLSYM_BUILD_VERSION. */
+#define __SND_DLSYM_VERSION(prefix, name, version) _ ## prefix ## name ## version
+/**
+ * \hideinitializer
+ * \brief Appends the build version to the name of a versioned dynamic symbol.
+ */
+#define SND_DLSYM_BUILD_VERSION(name, version) \
+ static struct snd_dlsym_link __SND_DLSYM_VERSION(snd_dlsym_, name, version); \
+ void __SND_DLSYM_VERSION(snd_dlsym_constructor_, name, version) (void) __attribute__ ((constructor)); \
+ void __SND_DLSYM_VERSION(snd_dlsym_constructor_, name, version) (void) { \
+ __SND_DLSYM_VERSION(snd_dlsym_, name, version).next = snd_dlsym_start; \
+ __SND_DLSYM_VERSION(snd_dlsym_, name, version).dlsym_name = # name; \
+ __SND_DLSYM_VERSION(snd_dlsym_, name, version).dlsym_ptr = (void *)&name; \
+ snd_dlsym_start = &__SND_DLSYM_VERSION(snd_dlsym_, name, version); \
+ }
+
+#endif
+
+#ifndef __STRING
+/** \brief Return 'x' argument as string */
+#define __STRING(x) #x
+#endif
+
+/** \brief Returns the version of a dynamic symbol as a string. */
+#define SND_DLSYM_VERSION(version) __STRING(version)
+
+void *snd_dlopen(const char *file, int mode);
+void *snd_dlsym(void *handle, const char *name, const char *version);
+int snd_dlclose(void *handle);
+
+
+/**
+ * \brief Internal structure for an async notification client handler.
+ *
+ * The ALSA library uses a pointer to this structure as a handle to an async
+ * notification object. Applications don't access its contents directly.
+ */
+typedef struct _snd_async_handler snd_async_handler_t;
+
+/**
+ * \brief Async notification callback.
+ *
+ * See the #snd_async_add_handler function for details.
+ */
+typedef void (*snd_async_callback_t)(snd_async_handler_t *handler);
+
+int snd_async_add_handler(snd_async_handler_t **handler, int fd,
+ snd_async_callback_t callback, void *private_data);
+int snd_async_del_handler(snd_async_handler_t *handler);
+int snd_async_handler_get_fd(snd_async_handler_t *handler);
+int snd_async_handler_get_signo(snd_async_handler_t *handler);
+void *snd_async_handler_get_callback_private(snd_async_handler_t *handler);
+
+struct snd_shm_area *snd_shm_area_create(int shmid, void *ptr);
+struct snd_shm_area *snd_shm_area_share(struct snd_shm_area *area);
+int snd_shm_area_destroy(struct snd_shm_area *area);
+
+int snd_user_file(const char *file, char **result);
+
+#if !defined(_POSIX_C_SOURCE) && !defined(_POSIX_SOURCE)
+struct timeval {
+ time_t tv_sec; /* seconds */
+ long tv_usec; /* microseconds */
+};
+
+struct timespec {
+ time_t tv_sec; /* seconds */
+ long tv_nsec; /* nanoseconds */
+};
+#endif
+
+/** Timestamp */
+typedef struct timeval snd_timestamp_t;
+/** Hi-res timestamp */
+typedef struct timespec snd_htimestamp_t;
+
+/** \} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __ALSA_GLOBAL_H */
diff --git a/sysroot/usr/include/alsa/hwdep.h b/sysroot/usr/include/alsa/hwdep.h
new file mode 100644
index 0000000..6ff1e90
--- /dev/null
+++ b/sysroot/usr/include/alsa/hwdep.h
@@ -0,0 +1,160 @@
+/**
+ * \file include/hwdep.h
+ * \brief Application interface library for the ALSA driver
+ * \author Jaroslav Kysela <perex@perex.cz>
+ * \author Abramo Bagnara <abramo@alsa-project.org>
+ * \author Takashi Iwai <tiwai@suse.de>
+ * \date 1998-2001
+ *
+ * Application interface library for the ALSA driver
+ */
+/*
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef __ALSA_HWDEP_H
+#define __ALSA_HWDEP_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \defgroup HwDep Hardware Dependant Interface
+ * The Hardware Dependant Interface.
+ * \{
+ */
+
+/** dlsym version for interface entry callback */
+#define SND_HWDEP_DLSYM_VERSION _dlsym_hwdep_001
+
+/** HwDep information container */
+typedef struct _snd_hwdep_info snd_hwdep_info_t;
+
+/** HwDep DSP status container */
+typedef struct _snd_hwdep_dsp_status snd_hwdep_dsp_status_t;
+
+/** HwDep DSP image container */
+typedef struct _snd_hwdep_dsp_image snd_hwdep_dsp_image_t;
+
+/** HwDep interface */
+typedef enum _snd_hwdep_iface {
+ SND_HWDEP_IFACE_OPL2 = 0, /**< OPL2 raw driver */
+ SND_HWDEP_IFACE_OPL3, /**< OPL3 raw driver */
+ SND_HWDEP_IFACE_OPL4, /**< OPL4 raw driver */
+ SND_HWDEP_IFACE_SB16CSP, /**< SB16CSP driver */
+ SND_HWDEP_IFACE_EMU10K1, /**< EMU10K1 driver */
+ SND_HWDEP_IFACE_YSS225, /**< YSS225 driver */
+ SND_HWDEP_IFACE_ICS2115, /**< ICS2115 driver */
+ SND_HWDEP_IFACE_SSCAPE, /**< Ensoniq SoundScape ISA card (MC68EC000) */
+ SND_HWDEP_IFACE_VX, /**< Digigram VX cards */
+ SND_HWDEP_IFACE_MIXART, /**< Digigram miXart cards */
+ SND_HWDEP_IFACE_USX2Y, /**< Tascam US122, US224 & US428 usb */
+ SND_HWDEP_IFACE_EMUX_WAVETABLE, /**< EmuX wavetable */
+ SND_HWDEP_IFACE_BLUETOOTH, /**< Bluetooth audio */
+ SND_HWDEP_IFACE_USX2Y_PCM, /**< Tascam US122, US224 & US428 raw USB PCM */
+ SND_HWDEP_IFACE_PCXHR, /**< Digigram PCXHR */
+ SND_HWDEP_IFACE_SB_RC, /**< SB Extigy/Audigy2NX remote control */
+
+ SND_HWDEP_IFACE_LAST = SND_HWDEP_IFACE_SB_RC /**< last known hwdep interface */
+} snd_hwdep_iface_t;
+
+/** open for reading */
+#define SND_HWDEP_OPEN_READ (O_RDONLY)
+/** open for writing */
+#define SND_HWDEP_OPEN_WRITE (O_WRONLY)
+/** open for reading and writing */
+#define SND_HWDEP_OPEN_DUPLEX (O_RDWR)
+/** open mode flag: open in nonblock mode */
+#define SND_HWDEP_OPEN_NONBLOCK (O_NONBLOCK)
+
+/** HwDep handle type */
+typedef enum _snd_hwdep_type {
+ /** Kernel level HwDep */
+ SND_HWDEP_TYPE_HW,
+ /** Shared memory client HwDep (not yet implemented) */
+ SND_HWDEP_TYPE_SHM,
+ /** INET client HwDep (not yet implemented) */
+ SND_HWDEP_TYPE_INET
+} snd_hwdep_type_t;
+
+/** HwDep handle */
+typedef struct _snd_hwdep snd_hwdep_t;
+
+int snd_hwdep_open(snd_hwdep_t **hwdep, const char *name, int mode);
+int snd_hwdep_close(snd_hwdep_t *hwdep);
+int snd_hwdep_poll_descriptors(snd_hwdep_t *hwdep, struct pollfd *pfds, unsigned int space);
+int snd_hwdep_poll_descriptors_revents(snd_hwdep_t *hwdep, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
+int snd_hwdep_nonblock(snd_hwdep_t *hwdep, int nonblock);
+int snd_hwdep_info(snd_hwdep_t *hwdep, snd_hwdep_info_t * info);
+int snd_hwdep_dsp_status(snd_hwdep_t *hwdep, snd_hwdep_dsp_status_t *status);
+int snd_hwdep_dsp_load(snd_hwdep_t *hwdep, snd_hwdep_dsp_image_t *block);
+int snd_hwdep_ioctl(snd_hwdep_t *hwdep, unsigned int request, void * arg);
+ssize_t snd_hwdep_write(snd_hwdep_t *hwdep, const void *buffer, size_t size);
+ssize_t snd_hwdep_read(snd_hwdep_t *hwdep, void *buffer, size_t size);
+
+size_t snd_hwdep_info_sizeof(void);
+/** allocate #snd_hwdep_info_t container on stack */
+#define snd_hwdep_info_alloca(ptr) do { assert(ptr); *ptr = (snd_hwdep_info_t *) alloca(snd_hwdep_info_sizeof()); memset(*ptr, 0, snd_hwdep_info_sizeof()); } while (0)
+int snd_hwdep_info_malloc(snd_hwdep_info_t **ptr);
+void snd_hwdep_info_free(snd_hwdep_info_t *obj);
+void snd_hwdep_info_copy(snd_hwdep_info_t *dst, const snd_hwdep_info_t *src);
+
+unsigned int snd_hwdep_info_get_device(const snd_hwdep_info_t *obj);
+int snd_hwdep_info_get_card(const snd_hwdep_info_t *obj);
+const char *snd_hwdep_info_get_id(const snd_hwdep_info_t *obj);
+const char *snd_hwdep_info_get_name(const snd_hwdep_info_t *obj);
+snd_hwdep_iface_t snd_hwdep_info_get_iface(const snd_hwdep_info_t *obj);
+void snd_hwdep_info_set_device(snd_hwdep_info_t *obj, unsigned int val);
+
+size_t snd_hwdep_dsp_status_sizeof(void);
+/** allocate #snd_hwdep_dsp_status_t container on stack */
+#define snd_hwdep_dsp_status_alloca(ptr) do { assert(ptr); *ptr = (snd_hwdep_dsp_status_t *) alloca(snd_hwdep_dsp_status_sizeof()); memset(*ptr, 0, snd_hwdep_dsp_status_sizeof()); } while (0)
+int snd_hwdep_dsp_status_malloc(snd_hwdep_dsp_status_t **ptr);
+void snd_hwdep_dsp_status_free(snd_hwdep_dsp_status_t *obj);
+void snd_hwdep_dsp_status_copy(snd_hwdep_dsp_status_t *dst, const snd_hwdep_dsp_status_t *src);
+
+unsigned int snd_hwdep_dsp_status_get_version(const snd_hwdep_dsp_status_t *obj);
+const char *snd_hwdep_dsp_status_get_id(const snd_hwdep_dsp_status_t *obj);
+unsigned int snd_hwdep_dsp_status_get_num_dsps(const snd_hwdep_dsp_status_t *obj);
+unsigned int snd_hwdep_dsp_status_get_dsp_loaded(const snd_hwdep_dsp_status_t *obj);
+unsigned int snd_hwdep_dsp_status_get_chip_ready(const snd_hwdep_dsp_status_t *obj);
+
+size_t snd_hwdep_dsp_image_sizeof(void);
+/** allocate #snd_hwdep_dsp_image_t container on stack */
+#define snd_hwdep_dsp_image_alloca(ptr) do { assert(ptr); *ptr = (snd_hwdep_dsp_image_t *) alloca(snd_hwdep_dsp_image_sizeof()); memset(*ptr, 0, snd_hwdep_dsp_image_sizeof()); } while (0)
+int snd_hwdep_dsp_image_malloc(snd_hwdep_dsp_image_t **ptr);
+void snd_hwdep_dsp_image_free(snd_hwdep_dsp_image_t *obj);
+void snd_hwdep_dsp_image_copy(snd_hwdep_dsp_image_t *dst, const snd_hwdep_dsp_image_t *src);
+
+unsigned int snd_hwdep_dsp_image_get_index(const snd_hwdep_dsp_image_t *obj);
+const char *snd_hwdep_dsp_image_get_name(const snd_hwdep_dsp_image_t *obj);
+const void *snd_hwdep_dsp_image_get_image(const snd_hwdep_dsp_image_t *obj);
+size_t snd_hwdep_dsp_image_get_length(const snd_hwdep_dsp_image_t *obj);
+
+void snd_hwdep_dsp_image_set_index(snd_hwdep_dsp_image_t *obj, unsigned int _index);
+void snd_hwdep_dsp_image_set_name(snd_hwdep_dsp_image_t *obj, const char *name);
+void snd_hwdep_dsp_image_set_image(snd_hwdep_dsp_image_t *obj, void *buffer);
+void snd_hwdep_dsp_image_set_length(snd_hwdep_dsp_image_t *obj, size_t length);
+
+/** \} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __ALSA_HWDEP_H */
+
diff --git a/sysroot/usr/include/alsa/iatomic.h b/sysroot/usr/include/alsa/iatomic.h
new file mode 100644
index 0000000..d4b12c1
--- /dev/null
+++ b/sysroot/usr/include/alsa/iatomic.h
@@ -0,0 +1,1106 @@
+#ifndef __ALSA_IATOMIC_H
+#define __ALSA_IATOMIC_H
+
+#if defined(__i386__) || defined(__x86_64__)
+
+/*
+ * Atomic operations that C can't guarantee us. Useful for
+ * resource counting etc..
+ */
+
+#define ATOMIC_SMP_LOCK "lock ; "
+
+/*
+ * Make sure gcc doesn't try to be clever and move things around
+ * on us. We need to use _exactly_ the address the user gave us,
+ * not some alias that contains the same information.
+ */
+typedef struct { volatile int counter; } atomic_t;
+
+#define ATOMIC_INIT(i) { (i) }
+
+/**
+ * atomic_read - read atomic variable
+ * @v: pointer of type atomic_t
+ *
+ * Atomically reads the value of @v. Note that the guaranteed
+ * useful range of an atomic_t is only 24 bits.
+ */
+#define atomic_read(v) ((v)->counter)
+
+/**
+ * atomic_set - set atomic variable
+ * @v: pointer of type atomic_t
+ * @i: required value
+ *
+ * Atomically sets the value of @v to @i. Note that the guaranteed
+ * useful range of an atomic_t is only 24 bits.
+ */
+#define atomic_set(v,i) (((v)->counter) = (i))
+
+/**
+ * atomic_add - add integer to atomic variable
+ * @i: integer value to add
+ * @v: pointer of type atomic_t
+ *
+ * Atomically adds @i to @v. Note that the guaranteed useful range
+ * of an atomic_t is only 24 bits.
+ */
+static __inline__ void atomic_add(int i, atomic_t *v)
+{
+ __asm__ __volatile__(
+ ATOMIC_SMP_LOCK "addl %1,%0"
+ :"=m" (v->counter)
+ :"ir" (i), "m" (v->counter));
+}
+
+/**
+ * atomic_sub - subtract the atomic variable
+ * @i: integer value to subtract
+ * @v: pointer of type atomic_t
+ *
+ * Atomically subtracts @i from @v. Note that the guaranteed
+ * useful range of an atomic_t is only 24 bits.
+ */
+static __inline__ void atomic_sub(int i, atomic_t *v)
+{
+ __asm__ __volatile__(
+ ATOMIC_SMP_LOCK "subl %1,%0"
+ :"=m" (v->counter)
+ :"ir" (i), "m" (v->counter));
+}
+
+/**
+ * atomic_sub_and_test - subtract value from variable and test result
+ * @i: integer value to subtract
+ * @v: pointer of type atomic_t
+ *
+ * Atomically subtracts @i from @v and returns
+ * true if the result is zero, or false for all
+ * other cases. Note that the guaranteed
+ * useful range of an atomic_t is only 24 bits.
+ */
+static __inline__ int atomic_sub_and_test(int i, atomic_t *v)
+{
+ unsigned char c;
+
+ __asm__ __volatile__(
+ ATOMIC_SMP_LOCK "subl %2,%0; sete %1"
+ :"=m" (v->counter), "=qm" (c)
+ :"ir" (i), "m" (v->counter) : "memory");
+ return c;
+}
+
+/**
+ * atomic_inc - increment atomic variable
+ * @v: pointer of type atomic_t
+ *
+ * Atomically increments @v by 1. Note that the guaranteed
+ * useful range of an atomic_t is only 24 bits.
+ */
+static __inline__ void atomic_inc(atomic_t *v)
+{
+ __asm__ __volatile__(
+ ATOMIC_SMP_LOCK "incl %0"
+ :"=m" (v->counter)
+ :"m" (v->counter));
+}
+
+/**
+ * atomic_dec - decrement atomic variable
+ * @v: pointer of type atomic_t
+ *
+ * Atomically decrements @v by 1. Note that the guaranteed
+ * useful range of an atomic_t is only 24 bits.
+ */
+static __inline__ void atomic_dec(atomic_t *v)
+{
+ __asm__ __volatile__(
+ ATOMIC_SMP_LOCK "decl %0"
+ :"=m" (v->counter)
+ :"m" (v->counter));
+}
+
+/**
+ * atomic_dec_and_test - decrement and test
+ * @v: pointer of type atomic_t
+ *
+ * Atomically decrements @v by 1 and
+ * returns true if the result is 0, or false for all other
+ * cases. Note that the guaranteed
+ * useful range of an atomic_t is only 24 bits.
+ */
+static __inline__ int atomic_dec_and_test(atomic_t *v)
+{
+ unsigned char c;
+
+ __asm__ __volatile__(
+ ATOMIC_SMP_LOCK "decl %0; sete %1"
+ :"=m" (v->counter), "=qm" (c)
+ :"m" (v->counter) : "memory");
+ return c != 0;
+}
+
+/**
+ * atomic_inc_and_test - increment and test
+ * @v: pointer of type atomic_t
+ *
+ * Atomically increments @v by 1
+ * and returns true if the result is zero, or false for all
+ * other cases. Note that the guaranteed
+ * useful range of an atomic_t is only 24 bits.
+ */
+static __inline__ int atomic_inc_and_test(atomic_t *v)
+{
+ unsigned char c;
+
+ __asm__ __volatile__(
+ ATOMIC_SMP_LOCK "incl %0; sete %1"
+ :"=m" (v->counter), "=qm" (c)
+ :"m" (v->counter) : "memory");
+ return c != 0;
+}
+
+/**
+ * atomic_add_negative - add and test if negative
+ * @v: pointer of type atomic_t
+ * @i: integer value to add
+ *
+ * Atomically adds @i to @v and returns true
+ * if the result is negative, or false when
+ * result is greater than or equal to zero. Note that the guaranteed
+ * useful range of an atomic_t is only 24 bits.
+ */
+static __inline__ int atomic_add_negative(int i, atomic_t *v)
+{
+ unsigned char c;
+
+ __asm__ __volatile__(
+ ATOMIC_SMP_LOCK "addl %2,%0; sets %1"
+ :"=m" (v->counter), "=qm" (c)
+ :"ir" (i), "m" (v->counter) : "memory");
+ return c;
+}
+
+/* These are x86-specific, used by some header files */
+#define atomic_clear_mask(mask, addr) \
+__asm__ __volatile__(ATOMIC_SMP_LOCK "andl %0,%1" \
+: : "r" (~(mask)),"m" (*addr) : "memory")
+
+#define atomic_set_mask(mask, addr) \
+__asm__ __volatile__(ATOMIC_SMP_LOCK "orl %0,%1" \
+: : "r" (mask),"m" (*addr) : "memory")
+
+/*
+ * Force strict CPU ordering.
+ * And yes, this is required on UP too when we're talking
+ * to devices.
+ *
+ * For now, "wmb()" doesn't actually do anything, as all
+ * Intel CPU's follow what Intel calls a *Processor Order*,
+ * in which all writes are seen in the program order even
+ * outside the CPU.
+ *
+ * I expect future Intel CPU's to have a weaker ordering,
+ * but I'd also expect them to finally get their act together
+ * and add some real memory barriers if so.
+ */
+
+#ifdef __i386__
+#define mb() __asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory")
+#define rmb() mb()
+#define wmb() __asm__ __volatile__ ("": : :"memory")
+#else
+#define mb() asm volatile("mfence":::"memory")
+#define rmb() asm volatile("lfence":::"memory")
+#define wmb() asm volatile("sfence":::"memory")
+#endif
+
+#undef ATOMIC_SMP_LOCK
+
+#define IATOMIC_DEFINED 1
+
+#endif /* __i386__ */
+
+#ifdef __ia64__
+
+/*
+ * On IA-64, counter must always be volatile to ensure that that the
+ * memory accesses are ordered.
+ */
+typedef struct { volatile int counter; } atomic_t;
+
+#define ATOMIC_INIT(i) ((atomic_t) { (i) })
+
+#define atomic_read(v) ((v)->counter)
+#define atomic_set(v,i) (((v)->counter) = (i))
+
+/* stripped version - we need only 4byte version */
+#define ia64_cmpxchg(sem,ptr,old,new,size) \
+({ \
+ __typeof__(ptr) _p_ = (ptr); \
+ __typeof__(new) _n_ = (new); \
+ unsigned long _o_, _r_; \
+ _o_ = (unsigned int) (long) (old); \
+ __asm__ __volatile__ ("mov ar.ccv=%0;;" :: "rO"(_o_)); \
+ __asm__ __volatile__ ("cmpxchg4."sem" %0=[%1],%2,ar.ccv" \
+ : "=r"(_r_) : "r"(_p_), "r"(_n_) : "memory"); \
+ (__typeof__(old)) _r_; \
+})
+
+static __inline__ int
+ia64_atomic_add (int i, atomic_t *v)
+{
+ int old, new;
+ // CMPXCHG_BUGCHECK_DECL
+
+ do {
+ // CMPXCHG_BUGCHECK(v);
+ old = atomic_read(v);
+ new = old + i;
+ } while (ia64_cmpxchg("acq", v, old, old + i, sizeof(atomic_t)) != old);
+ return new;
+}
+
+static __inline__ int
+ia64_atomic_sub (int i, atomic_t *v)
+{
+ int old, new;
+ // CMPXCHG_BUGCHECK_DECL
+
+ do {
+ // CMPXCHG_BUGCHECK(v);
+ old = atomic_read(v);
+ new = old - i;
+ } while (ia64_cmpxchg("acq", v, old, new, sizeof(atomic_t)) != old);
+ return new;
+}
+
+#define IA64_FETCHADD(tmp,v,n,sz) \
+({ \
+ switch (sz) { \
+ case 4: \
+ __asm__ __volatile__ ("fetchadd4.rel %0=[%1],%2" \
+ : "=r"(tmp) : "r"(v), "i"(n) : "memory"); \
+ break; \
+ \
+ case 8: \
+ __asm__ __volatile__ ("fetchadd8.rel %0=[%1],%2" \
+ : "=r"(tmp) : "r"(v), "i"(n) : "memory"); \
+ break; \
+ } \
+})
+
+#define ia64_fetch_and_add(i,v) \
+({ \
+ unsigned long _tmp; \
+ volatile __typeof__(*(v)) *_v = (v); \
+ switch (i) { \
+ case -16: IA64_FETCHADD(_tmp, _v, -16, sizeof(*(v))); break; \
+ case -8: IA64_FETCHADD(_tmp, _v, -8, sizeof(*(v))); break; \
+ case -4: IA64_FETCHADD(_tmp, _v, -4, sizeof(*(v))); break; \
+ case -1: IA64_FETCHADD(_tmp, _v, -1, sizeof(*(v))); break; \
+ case 1: IA64_FETCHADD(_tmp, _v, 1, sizeof(*(v))); break; \
+ case 4: IA64_FETCHADD(_tmp, _v, 4, sizeof(*(v))); break; \
+ case 8: IA64_FETCHADD(_tmp, _v, 8, sizeof(*(v))); break; \
+ case 16: IA64_FETCHADD(_tmp, _v, 16, sizeof(*(v))); break; \
+ } \
+ (__typeof__(*v)) (_tmp + (i)); /* return new value */ \
+})
+
+/*
+ * Atomically add I to V and return TRUE if the resulting value is
+ * negative.
+ */
+static __inline__ int
+atomic_add_negative (int i, atomic_t *v)
+{
+ return ia64_atomic_add(i, v) < 0;
+}
+
+#define atomic_add_return(i,v) \
+ ((__builtin_constant_p(i) && \
+ ( (i == 1) || (i == 4) || (i == 8) || (i == 16) \
+ || (i == -1) || (i == -4) || (i == -8) || (i == -16))) \
+ ? ia64_fetch_and_add(i, &(v)->counter) \
+ : ia64_atomic_add(i, v))
+
+#define atomic_sub_return(i,v) \
+ ((__builtin_constant_p(i) && \
+ ( (i == 1) || (i == 4) || (i == 8) || (i == 16) \
+ || (i == -1) || (i == -4) || (i == -8) || (i == -16))) \
+ ? ia64_fetch_and_add(-(i), &(v)->counter) \
+ : ia64_atomic_sub(i, v))
+
+#define atomic_dec_return(v) atomic_sub_return(1, (v))
+#define atomic_inc_return(v) atomic_add_return(1, (v))
+
+#define atomic_sub_and_test(i,v) (atomic_sub_return((i), (v)) == 0)
+#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0)
+#define atomic_inc_and_test(v) (atomic_add_return(1, (v)) != 0)
+
+#define atomic_add(i,v) atomic_add_return((i), (v))
+#define atomic_sub(i,v) atomic_sub_return((i), (v))
+#define atomic_inc(v) atomic_add(1, (v))
+#define atomic_dec(v) atomic_sub(1, (v))
+
+/*
+ * Macros to force memory ordering. In these descriptions, "previous"
+ * and "subsequent" refer to program order; "visible" means that all
+ * architecturally visible effects of a memory access have occurred
+ * (at a minimum, this means the memory has been read or written).
+ *
+ * wmb(): Guarantees that all preceding stores to memory-
+ * like regions are visible before any subsequent
+ * stores and that all following stores will be
+ * visible only after all previous stores.
+ * rmb(): Like wmb(), but for reads.
+ * mb(): wmb()/rmb() combo, i.e., all previous memory
+ * accesses are visible before all subsequent
+ * accesses and vice versa. This is also known as
+ * a "fence."
+ *
+ * Note: "mb()" and its variants cannot be used as a fence to order
+ * accesses to memory mapped I/O registers. For that, mf.a needs to
+ * be used. However, we don't want to always use mf.a because (a)
+ * it's (presumably) much slower than mf and (b) mf.a is supported for
+ * sequential memory pages only.
+ */
+#define mb() __asm__ __volatile__ ("mf" ::: "memory")
+#define rmb() mb()
+#define wmb() mb()
+
+#define IATOMIC_DEFINED 1
+
+#endif /* __ia64__ */
+
+#ifdef __alpha__
+
+/*
+ * Atomic operations that C can't guarantee us. Useful for
+ * resource counting etc...
+ *
+ * But use these as seldom as possible since they are much slower
+ * than regular operations.
+ */
+
+
+/*
+ * Counter is volatile to make sure gcc doesn't try to be clever
+ * and move things around on us. We need to use _exactly_ the address
+ * the user gave us, not some alias that contains the same information.
+ */
+typedef struct { volatile int counter; } atomic_t;
+
+#define ATOMIC_INIT(i) ( (atomic_t) { (i) } )
+
+#define atomic_read(v) ((v)->counter)
+#define atomic_set(v,i) ((v)->counter = (i))
+
+/*
+ * To get proper branch prediction for the main line, we must branch
+ * forward to code at the end of this object's .text section, then
+ * branch back to restart the operation.
+ */
+
+static __inline__ void atomic_add(int i, atomic_t * v)
+{
+ unsigned long temp;
+ __asm__ __volatile__(
+ "1: ldl_l %0,%1\n"
+ " addl %0,%2,%0\n"
+ " stl_c %0,%1\n"
+ " beq %0,2f\n"
+ ".subsection 2\n"
+ "2: br 1b\n"
+ ".previous"
+ :"=&r" (temp), "=m" (v->counter)
+ :"Ir" (i), "m" (v->counter));
+}
+
+static __inline__ void atomic_sub(int i, atomic_t * v)
+{
+ unsigned long temp;
+ __asm__ __volatile__(
+ "1: ldl_l %0,%1\n"
+ " subl %0,%2,%0\n"
+ " stl_c %0,%1\n"
+ " beq %0,2f\n"
+ ".subsection 2\n"
+ "2: br 1b\n"
+ ".previous"
+ :"=&r" (temp), "=m" (v->counter)
+ :"Ir" (i), "m" (v->counter));
+}
+
+/*
+ * Same as above, but return the result value
+ */
+static __inline__ long atomic_add_return(int i, atomic_t * v)
+{
+ long temp, result;
+ __asm__ __volatile__(
+ "1: ldl_l %0,%1\n"
+ " addl %0,%3,%2\n"
+ " addl %0,%3,%0\n"
+ " stl_c %0,%1\n"
+ " beq %0,2f\n"
+ " mb\n"
+ ".subsection 2\n"
+ "2: br 1b\n"
+ ".previous"
+ :"=&r" (temp), "=m" (v->counter), "=&r" (result)
+ :"Ir" (i), "m" (v->counter) : "memory");
+ return result;
+}
+
+static __inline__ long atomic_sub_return(int i, atomic_t * v)
+{
+ long temp, result;
+ __asm__ __volatile__(
+ "1: ldl_l %0,%1\n"
+ " subl %0,%3,%2\n"
+ " subl %0,%3,%0\n"
+ " stl_c %0,%1\n"
+ " beq %0,2f\n"
+ " mb\n"
+ ".subsection 2\n"
+ "2: br 1b\n"
+ ".previous"
+ :"=&r" (temp), "=m" (v->counter), "=&r" (result)
+ :"Ir" (i), "m" (v->counter) : "memory");
+ return result;
+}
+
+#define atomic_dec_return(v) atomic_sub_return(1,(v))
+#define atomic_inc_return(v) atomic_add_return(1,(v))
+
+#define atomic_sub_and_test(i,v) (atomic_sub_return((i), (v)) == 0)
+#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0)
+
+#define atomic_inc(v) atomic_add(1,(v))
+#define atomic_dec(v) atomic_sub(1,(v))
+
+#define mb() \
+__asm__ __volatile__("mb": : :"memory")
+
+#define rmb() \
+__asm__ __volatile__("mb": : :"memory")
+
+#define wmb() \
+__asm__ __volatile__("wmb": : :"memory")
+
+#define IATOMIC_DEFINED 1
+
+#endif /* __alpha__ */
+
+#ifdef __powerpc__
+
+typedef struct { volatile int counter; } atomic_t;
+
+#define ATOMIC_INIT(i) { (i) }
+
+#define atomic_read(v) ((v)->counter)
+#define atomic_set(v,i) (((v)->counter) = (i))
+
+extern void atomic_clear_mask(unsigned long mask, unsigned long *addr);
+extern void atomic_set_mask(unsigned long mask, unsigned long *addr);
+
+#define SMP_ISYNC "\n\tisync"
+
+static __inline__ void atomic_add(int a, atomic_t *v)
+{
+ int t;
+
+ __asm__ __volatile__(
+"1: lwarx %0,0,%3 # atomic_add\n\
+ add %0,%2,%0\n\
+ stwcx. %0,0,%3\n\
+ bne- 1b"
+ : "=&r" (t), "=m" (v->counter)
+ : "r" (a), "r" (&v->counter), "m" (v->counter)
+ : "cc");
+}
+
+static __inline__ int atomic_add_return(int a, atomic_t *v)
+{
+ int t;
+
+ __asm__ __volatile__(
+"1: lwarx %0,0,%2 # atomic_add_return\n\
+ add %0,%1,%0\n\
+ stwcx. %0,0,%2\n\
+ bne- 1b"
+ SMP_ISYNC
+ : "=&r" (t)
+ : "r" (a), "r" (&v->counter)
+ : "cc", "memory");
+
+ return t;
+}
+
+static __inline__ void atomic_sub(int a, atomic_t *v)
+{
+ int t;
+
+ __asm__ __volatile__(
+"1: lwarx %0,0,%3 # atomic_sub\n\
+ subf %0,%2,%0\n\
+ stwcx. %0,0,%3\n\
+ bne- 1b"
+ : "=&r" (t), "=m" (v->counter)
+ : "r" (a), "r" (&v->counter), "m" (v->counter)
+ : "cc");
+}
+
+static __inline__ int atomic_sub_return(int a, atomic_t *v)
+{
+ int t;
+
+ __asm__ __volatile__(
+"1: lwarx %0,0,%2 # atomic_sub_return\n\
+ subf %0,%1,%0\n\
+ stwcx. %0,0,%2\n\
+ bne- 1b"
+ SMP_ISYNC
+ : "=&r" (t)
+ : "r" (a), "r" (&v->counter)
+ : "cc", "memory");
+
+ return t;
+}
+
+static __inline__ void atomic_inc(atomic_t *v)
+{
+ int t;
+
+ __asm__ __volatile__(
+"1: lwarx %0,0,%2 # atomic_inc\n\
+ addic %0,%0,1\n\
+ stwcx. %0,0,%2\n\
+ bne- 1b"
+ : "=&r" (t), "=m" (v->counter)
+ : "r" (&v->counter), "m" (v->counter)
+ : "cc");
+}
+
+static __inline__ int atomic_inc_return(atomic_t *v)
+{
+ int t;
+
+ __asm__ __volatile__(
+"1: lwarx %0,0,%1 # atomic_inc_return\n\
+ addic %0,%0,1\n\
+ stwcx. %0,0,%1\n\
+ bne- 1b"
+ SMP_ISYNC
+ : "=&r" (t)
+ : "r" (&v->counter)
+ : "cc", "memory");
+
+ return t;
+}
+
+static __inline__ void atomic_dec(atomic_t *v)
+{
+ int t;
+
+ __asm__ __volatile__(
+"1: lwarx %0,0,%2 # atomic_dec\n\
+ addic %0,%0,-1\n\
+ stwcx. %0,0,%2\n\
+ bne- 1b"
+ : "=&r" (t), "=m" (v->counter)
+ : "r" (&v->counter), "m" (v->counter)
+ : "cc");
+}
+
+static __inline__ int atomic_dec_return(atomic_t *v)
+{
+ int t;
+
+ __asm__ __volatile__(
+"1: lwarx %0,0,%1 # atomic_dec_return\n\
+ addic %0,%0,-1\n\
+ stwcx. %0,0,%1\n\
+ bne- 1b"
+ SMP_ISYNC
+ : "=&r" (t)
+ : "r" (&v->counter)
+ : "cc", "memory");
+
+ return t;
+}
+
+#define atomic_sub_and_test(a, v) (atomic_sub_return((a), (v)) == 0)
+#define atomic_dec_and_test(v) (atomic_dec_return((v)) == 0)
+
+/*
+ * Atomically test *v and decrement if it is greater than 0.
+ * The function returns the old value of *v minus 1.
+ */
+static __inline__ int atomic_dec_if_positive(atomic_t *v)
+{
+ int t;
+
+ __asm__ __volatile__(
+"1: lwarx %0,0,%1 # atomic_dec_if_positive\n\
+ addic. %0,%0,-1\n\
+ blt- 2f\n\
+ stwcx. %0,0,%1\n\
+ bne- 1b"
+ SMP_ISYNC
+ "\n\
+2:" : "=&r" (t)
+ : "r" (&v->counter)
+ : "cc", "memory");
+
+ return t;
+}
+
+/*
+ * Memory barrier.
+ * The sync instruction guarantees that all memory accesses initiated
+ * by this processor have been performed (with respect to all other
+ * mechanisms that access memory). The eieio instruction is a barrier
+ * providing an ordering (separately) for (a) cacheable stores and (b)
+ * loads and stores to non-cacheable memory (e.g. I/O devices).
+ *
+ * mb() prevents loads and stores being reordered across this point.
+ * rmb() prevents loads being reordered across this point.
+ * wmb() prevents stores being reordered across this point.
+ *
+ * We can use the eieio instruction for wmb, but since it doesn't
+ * give any ordering guarantees about loads, we have to use the
+ * stronger but slower sync instruction for mb and rmb.
+ */
+#define mb() __asm__ __volatile__ ("sync" : : : "memory")
+#define rmb() __asm__ __volatile__ ("sync" : : : "memory")
+#define wmb() __asm__ __volatile__ ("eieio" : : : "memory")
+
+#define IATOMIC_DEFINED 1
+
+#endif /* __powerpc__ */
+
+#ifdef __mips__
+
+typedef struct { volatile int counter; } atomic_t;
+
+#define ATOMIC_INIT(i) { (i) }
+
+/*
+ * atomic_read - read atomic variable
+ * @v: pointer of type atomic_t
+ *
+ * Atomically reads the value of @v. Note that the guaranteed
+ * useful range of an atomic_t is only 24 bits.
+ */
+#define atomic_read(v) ((v)->counter)
+
+/*
+ * atomic_set - set atomic variable
+ * @v: pointer of type atomic_t
+ * @i: required value
+ *
+ * Atomically sets the value of @v to @i. Note that the guaranteed
+ * useful range of an atomic_t is only 24 bits.
+ */
+#define atomic_set(v,i) ((v)->counter = (i))
+
+/*
+ * for MIPS II and better we can use ll/sc instruction, and kernel 2.4.3+
+ * will emulate it on MIPS I.
+ */
+
+/*
+ * atomic_add - add integer to atomic variable
+ * @i: integer value to add
+ * @v: pointer of type atomic_t
+ *
+ * Atomically adds @i to @v. Note that the guaranteed useful range
+ * of an atomic_t is only 24 bits.
+ */
+extern __inline__ void atomic_add(int i, atomic_t * v)
+{
+ unsigned long temp;
+
+ __asm__ __volatile__(
+ ".set push \n"
+ ".set mips2 \n"
+ "1: ll %0, %1 # atomic_add\n"
+ " addu %0, %2 \n"
+ " sc %0, %1 \n"
+ " beqz %0, 1b \n"
+ ".set pop \n"
+ : "=&r" (temp), "=m" (v->counter)
+ : "Ir" (i), "m" (v->counter));
+}
+
+/*
+ * atomic_sub - subtract the atomic variable
+ * @i: integer value to subtract
+ * @v: pointer of type atomic_t
+ *
+ * Atomically subtracts @i from @v. Note that the guaranteed
+ * useful range of an atomic_t is only 24 bits.
+ */
+extern __inline__ void atomic_sub(int i, atomic_t * v)
+{
+ unsigned long temp;
+
+ __asm__ __volatile__(
+ ".set push \n"
+ ".set mips2 \n"
+ "1: ll %0, %1 # atomic_sub\n"
+ " subu %0, %2 \n"
+ " sc %0, %1 \n"
+ " beqz %0, 1b \n"
+ ".set pop \n"
+ : "=&r" (temp), "=m" (v->counter)
+ : "Ir" (i), "m" (v->counter));
+}
+
+/*
+ * Same as above, but return the result value
+ */
+extern __inline__ int atomic_add_return(int i, atomic_t * v)
+{
+ unsigned long temp, result;
+
+ __asm__ __volatile__(
+ ".set push # atomic_add_return\n"
+ ".set noreorder \n"
+ ".set mips2 \n"
+ "1: ll %1, %2 \n"
+ " addu %0, %1, %3 \n"
+ " sc %0, %2 \n"
+ " beqz %0, 1b \n"
+ " addu %0, %1, %3 \n"
+ ".set pop \n"
+ : "=&r" (result), "=&r" (temp), "=m" (v->counter)
+ : "Ir" (i), "m" (v->counter)
+ : "memory");
+
+ return result;
+}
+
+extern __inline__ int atomic_sub_return(int i, atomic_t * v)
+{
+ unsigned long temp, result;
+
+ __asm__ __volatile__(
+ ".set push \n"
+ ".set mips2 \n"
+ ".set noreorder # atomic_sub_return\n"
+ "1: ll %1, %2 \n"
+ " subu %0, %1, %3 \n"
+ " sc %0, %2 \n"
+ " beqz %0, 1b \n"
+ " subu %0, %1, %3 \n"
+ ".set pop \n"
+ : "=&r" (result), "=&r" (temp), "=m" (v->counter)
+ : "Ir" (i), "m" (v->counter)
+ : "memory");
+
+ return result;
+}
+
+#define atomic_dec_return(v) atomic_sub_return(1,(v))
+#define atomic_inc_return(v) atomic_add_return(1,(v))
+
+/*
+ * atomic_sub_and_test - subtract value from variable and test result
+ * @i: integer value to subtract
+ * @v: pointer of type atomic_t
+ *
+ * Atomically subtracts @i from @v and returns
+ * true if the result is zero, or false for all
+ * other cases. Note that the guaranteed
+ * useful range of an atomic_t is only 24 bits.
+ */
+#define atomic_sub_and_test(i,v) (atomic_sub_return((i), (v)) == 0)
+
+/*
+ * atomic_inc_and_test - increment and test
+ * @v: pointer of type atomic_t
+ *
+ * Atomically increments @v by 1
+ * and returns true if the result is zero, or false for all
+ * other cases. Note that the guaranteed
+ * useful range of an atomic_t is only 24 bits.
+ */
+#define atomic_inc_and_test(v) (atomic_inc_return(1, (v)) == 0)
+
+/*
+ * atomic_dec_and_test - decrement by 1 and test
+ * @v: pointer of type atomic_t
+ *
+ * Atomically decrements @v by 1 and
+ * returns true if the result is 0, or false for all other
+ * cases. Note that the guaranteed
+ * useful range of an atomic_t is only 24 bits.
+ */
+#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0)
+
+/*
+ * atomic_inc - increment atomic variable
+ * @v: pointer of type atomic_t
+ *
+ * Atomically increments @v by 1. Note that the guaranteed
+ * useful range of an atomic_t is only 24 bits.
+ */
+#define atomic_inc(v) atomic_add(1,(v))
+
+/*
+ * atomic_dec - decrement and test
+ * @v: pointer of type atomic_t
+ *
+ * Atomically decrements @v by 1. Note that the guaranteed
+ * useful range of an atomic_t is only 24 bits.
+ */
+#define atomic_dec(v) atomic_sub(1,(v))
+
+/*
+ * atomic_add_negative - add and test if negative
+ * @v: pointer of type atomic_t
+ * @i: integer value to add
+ *
+ * Atomically adds @i to @v and returns true
+ * if the result is negative, or false when
+ * result is greater than or equal to zero. Note that the guaranteed
+ * useful range of an atomic_t is only 24 bits.
+ *
+ * Currently not implemented for MIPS.
+ */
+
+#define mb() \
+__asm__ __volatile__( \
+ "# prevent instructions being moved around\n\t" \
+ ".set\tnoreorder\n\t" \
+ "# 8 nops to fool the R4400 pipeline\n\t" \
+ "nop;nop;nop;nop;nop;nop;nop;nop\n\t" \
+ ".set\treorder" \
+ : /* no output */ \
+ : /* no input */ \
+ : "memory")
+#define rmb() mb()
+#define wmb() mb()
+
+#define IATOMIC_DEFINED 1
+
+#endif /* __mips__ */
+
+#ifdef __arm__
+
+/*
+ * FIXME: bellow code is valid only for SA11xx
+ */
+
+/*
+ * Save the current interrupt enable state & disable IRQs
+ */
+#define local_irq_save(x) \
+ ({ \
+ unsigned long temp; \
+ __asm__ __volatile__( \
+ "mrs %0, cpsr @ local_irq_save\n" \
+" orr %1, %0, #128\n" \
+" msr cpsr_c, %1" \
+ : "=r" (x), "=r" (temp) \
+ : \
+ : "memory"); \
+ })
+
+/*
+ * restore saved IRQ & FIQ state
+ */
+#define local_irq_restore(x) \
+ __asm__ __volatile__( \
+ "msr cpsr_c, %0 @ local_irq_restore\n" \
+ : \
+ : "r" (x) \
+ : "memory")
+
+#define __save_flags_cli(x) local_irq_save(x)
+#define __restore_flags(x) local_irq_restore(x)
+
+typedef struct { volatile int counter; } atomic_t;
+
+#define ATOMIC_INIT(i) { (i) }
+
+#define atomic_read(v) ((v)->counter)
+#define atomic_set(v,i) (((v)->counter) = (i))
+
+static __inline__ void atomic_add(int i, volatile atomic_t *v)
+{
+ unsigned long flags;
+
+ __save_flags_cli(flags);
+ v->counter += i;
+ __restore_flags(flags);
+}
+
+static __inline__ void atomic_sub(int i, volatile atomic_t *v)
+{
+ unsigned long flags;
+
+ __save_flags_cli(flags);
+ v->counter -= i;
+ __restore_flags(flags);
+}
+
+static __inline__ void atomic_inc(volatile atomic_t *v)
+{
+ unsigned long flags;
+
+ __save_flags_cli(flags);
+ v->counter += 1;
+ __restore_flags(flags);
+}
+
+static __inline__ void atomic_dec(volatile atomic_t *v)
+{
+ unsigned long flags;
+
+ __save_flags_cli(flags);
+ v->counter -= 1;
+ __restore_flags(flags);
+}
+
+static __inline__ int atomic_dec_and_test(volatile atomic_t *v)
+{
+ unsigned long flags;
+ int result;
+
+ __save_flags_cli(flags);
+ v->counter -= 1;
+ result = (v->counter == 0);
+ __restore_flags(flags);
+
+ return result;
+}
+
+static inline int atomic_add_negative(int i, volatile atomic_t *v)
+{
+ unsigned long flags;
+ int result;
+
+ __save_flags_cli(flags);
+ v->counter += i;
+ result = (v->counter < 0);
+ __restore_flags(flags);
+
+ return result;
+}
+
+static __inline__ void atomic_clear_mask(unsigned long mask, unsigned long *addr)
+{
+ unsigned long flags;
+
+ __save_flags_cli(flags);
+ *addr &= ~mask;
+ __restore_flags(flags);
+}
+
+#define mb() __asm__ __volatile__ ("" : : : "memory")
+#define rmb() mb()
+#define wmb() mb()
+
+#define IATOMIC_DEFINED 1
+
+#endif /* __arm__ */
+
+#ifndef IATOMIC_DEFINED
+/*
+ * non supported architecture.
+ */
+#warning "Atomic operations are not supported on this architecture."
+
+typedef struct { volatile int counter; } atomic_t;
+
+#define ATOMIC_INIT(i) { (i) }
+
+#define atomic_read(v) ((v)->counter)
+#define atomic_set(v,i) (((v)->counter) = (i))
+#define atomic_add(i,v) (((v)->counter) += (i))
+#define atomic_sub(i,v) (((v)->counter) -= (i))
+#define atomic_inc(v) (((v)->counter)++)
+#define atomic_dec(v) (((v)->counter)--)
+
+#define mb()
+#define rmb()
+#define wmb()
+
+#define IATOMIC_DEFINED 1
+
+#endif /* IATOMIC_DEFINED */
+
+/*
+ * Atomic read/write
+ * Copyright (c) 2001 by Abramo Bagnara <abramo@alsa-project.org>
+ */
+
+/* Max number of times we must spin on a spin-lock calling sched_yield().
+ After MAX_SPIN_COUNT iterations, we put the calling thread to sleep. */
+
+#ifndef MAX_SPIN_COUNT
+#define MAX_SPIN_COUNT 50
+#endif
+
+/* Duration of sleep (in nanoseconds) when we can't acquire a spin-lock
+ after MAX_SPIN_COUNT iterations of sched_yield().
+ This MUST BE > 2ms.
+ (Otherwise the kernel does busy-waiting for real-time threads,
+ giving other threads no chance to run.) */
+
+#ifndef SPIN_SLEEP_DURATION
+#define SPIN_SLEEP_DURATION 2000001
+#endif
+
+typedef struct {
+ unsigned int begin, end;
+} snd_atomic_write_t;
+
+typedef struct {
+ volatile const snd_atomic_write_t *write;
+ unsigned int end;
+} snd_atomic_read_t;
+
+void snd_atomic_read_wait(snd_atomic_read_t *t);
+
+static inline void snd_atomic_write_init(snd_atomic_write_t *w)
+{
+ w->begin = 0;
+ w->end = 0;
+}
+
+static inline void snd_atomic_write_begin(snd_atomic_write_t *w)
+{
+ w->begin++;
+ wmb();
+}
+
+static inline void snd_atomic_write_end(snd_atomic_write_t *w)
+{
+ wmb();
+ w->end++;
+}
+
+static inline void snd_atomic_read_init(snd_atomic_read_t *r, snd_atomic_write_t *w)
+{
+ r->write = w;
+}
+
+static inline void snd_atomic_read_begin(snd_atomic_read_t *r)
+{
+ r->end = r->write->end;
+ rmb();
+}
+
+static inline int snd_atomic_read_ok(snd_atomic_read_t *r)
+{
+ rmb();
+ return r->end == r->write->begin;
+}
+
+#endif /* __ALSA_IATOMIC_H */
diff --git a/sysroot/usr/include/alsa/input.h b/sysroot/usr/include/alsa/input.h
new file mode 100644
index 0000000..fc5d0e6
--- /dev/null
+++ b/sysroot/usr/include/alsa/input.h
@@ -0,0 +1,83 @@
+/**
+ * \file include/input.h
+ * \brief Application interface library for the ALSA driver
+ * \author Jaroslav Kysela <perex@perex.cz>
+ * \author Abramo Bagnara <abramo@alsa-project.org>
+ * \author Takashi Iwai <tiwai@suse.de>
+ * \date 1998-2001
+ *
+ * Application interface library for the ALSA driver
+ */
+/*
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef __ALSA_INPUT_H
+#define __ALSA_INPUT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \defgroup Input Input Interface
+ *
+ * The input functions present an interface similar to the stdio functions
+ * on top of different underlying input sources.
+ *
+ * The #snd_config_load function uses such an input handle to be able to
+ * load configurations not only from standard files but also from other
+ * sources, e.g. from memory buffers.
+ *
+ * \{
+ */
+
+/**
+ * \brief Internal structure for an input object.
+ *
+ * The ALSA library uses a pointer to this structure as a handle to an
+ * input object. Applications don't access its contents directly.
+ */
+typedef struct _snd_input snd_input_t;
+
+/** Input type. */
+typedef enum _snd_input_type {
+ /** Input from a stdio stream. */
+ SND_INPUT_STDIO,
+ /** Input from a memory buffer. */
+ SND_INPUT_BUFFER
+} snd_input_type_t;
+
+int snd_input_stdio_open(snd_input_t **inputp, const char *file, const char *mode);
+int snd_input_stdio_attach(snd_input_t **inputp, FILE *fp, int _close);
+int snd_input_buffer_open(snd_input_t **inputp, const char *buffer, ssize_t size);
+int snd_input_close(snd_input_t *input);
+int snd_input_scanf(snd_input_t *input, const char *format, ...)
+#ifndef DOC_HIDDEN
+ __attribute__ ((format (scanf, 2, 3)))
+#endif
+ ;
+char *snd_input_gets(snd_input_t *input, char *str, size_t size);
+int snd_input_getc(snd_input_t *input);
+int snd_input_ungetc(snd_input_t *input, int c);
+
+/** \} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __ALSA_INPUT_H */
diff --git a/sysroot/usr/include/alsa/instr.h b/sysroot/usr/include/alsa/instr.h
new file mode 100644
index 0000000..aac6f66
--- /dev/null
+++ b/sysroot/usr/include/alsa/instr.h
@@ -0,0 +1,177 @@
+/**
+ * \file include/instr.h
+ * \brief Application interface library for the ALSA driver
+ * \author Jaroslav Kysela <perex@perex.cz>
+ * \author Abramo Bagnara <abramo@alsa-project.org>
+ * \author Takashi Iwai <tiwai@suse.de>
+ * \date 1998-2001
+ *
+ * Application interface library for the ALSA driver
+ */
+/*
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef __ALSA_INSTR_H
+#define __ALSA_INSTR_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \defgroup Instrument Instrument Interface
+ * The Instrument Interface.
+ * \{
+ */
+
+/* instrument get/put */
+
+/** container for sequencer instrument header */
+typedef struct _snd_instr_header snd_instr_header_t;
+
+size_t snd_instr_header_sizeof(void);
+#define snd_instr_header_alloca(ptr) \
+do {\
+ assert(ptr);\
+ *ptr = (snd_instr_header_t *)alloca(snd_instr_header_sizeof());\
+ memset(*ptr, 0, snd_instr_header_sizeof());\
+} while (0) /**< allocate instrument header on stack */
+int snd_instr_header_malloc(snd_instr_header_t **ptr, size_t len);
+void snd_instr_header_free(snd_instr_header_t *ptr);
+void snd_instr_header_copy(snd_instr_header_t *dst, const snd_instr_header_t *src);
+
+const snd_seq_instr_t *snd_instr_header_get_id(const snd_instr_header_t *info);
+snd_seq_instr_cluster_t snd_instr_header_get_cluster(const snd_instr_header_t *info);
+unsigned int snd_instr_header_get_cmd(const snd_instr_header_t *info);
+size_t snd_instr_header_get_len(const snd_instr_header_t *info);
+const char *snd_instr_header_get_name(const snd_instr_header_t *info);
+int snd_instr_header_get_type(const snd_instr_header_t *info);
+const char *snd_instr_header_get_format(const snd_instr_header_t *info);
+const snd_seq_instr_t *snd_instr_header_get_alias(const snd_instr_header_t *info);
+void *snd_instr_header_get_data(const snd_instr_header_t *info);
+int snd_instr_header_get_follow_alias(const snd_instr_header_t *info);
+
+void snd_instr_header_set_id(snd_instr_header_t *info, const snd_seq_instr_t *id);
+void snd_instr_header_set_cluster(snd_instr_header_t *info, snd_seq_instr_cluster_t cluster);
+void snd_instr_header_set_cmd(snd_instr_header_t *info, unsigned int cmd);
+void snd_instr_header_set_len(snd_instr_header_t *info, size_t len);
+void snd_instr_header_set_name(snd_instr_header_t *info, const char *name);
+void snd_instr_header_set_type(snd_instr_header_t *info, int type);
+void snd_instr_header_set_format(snd_instr_header_t *info, const char *format);
+void snd_instr_header_set_alias(snd_instr_header_t *info, const snd_seq_instr_t *instr);
+void snd_instr_header_set_follow_alias(snd_instr_header_t *info, int val);
+
+/**
+ * Instrument abstraction layer
+ * - based on events
+ */
+
+/** instrument types */
+#define SND_SEQ_INSTR_ATYPE_DATA 0 /**< instrument data */
+#define SND_SEQ_INSTR_ATYPE_ALIAS 1 /**< instrument alias */
+
+/** instrument ASCII identifiers */
+#define SND_SEQ_INSTR_ID_DLS1 "DLS1" /**< DLS1 */
+#define SND_SEQ_INSTR_ID_DLS2 "DLS2" /**< DLS2 */
+#define SND_SEQ_INSTR_ID_SIMPLE "Simple Wave" /**< Simple Wave */
+#define SND_SEQ_INSTR_ID_SOUNDFONT "SoundFont" /**< SoundFont */
+#define SND_SEQ_INSTR_ID_GUS_PATCH "GUS Patch" /**< Gravis Patch */
+#define SND_SEQ_INSTR_ID_INTERWAVE "Interwave FFFF" /**< InterWave FFFF */
+#define SND_SEQ_INSTR_ID_OPL2_3 "OPL2/3 FM" /**< OPL2/3 FM */
+#define SND_SEQ_INSTR_ID_OPL4 "OPL4" /**< OPL4 */
+
+/** instrument types */
+#define SND_SEQ_INSTR_TYPE0_DLS1 (1<<0) /**< MIDI DLS v1 */
+#define SND_SEQ_INSTR_TYPE0_DLS2 (1<<1) /**< MIDI DLS v2 */
+#define SND_SEQ_INSTR_TYPE1_SIMPLE (1<<0) /**< Simple Wave */
+#define SND_SEQ_INSTR_TYPE1_SOUNDFONT (1<<1) /**< EMU SoundFont */
+#define SND_SEQ_INSTR_TYPE1_GUS_PATCH (1<<2) /**< Gravis UltraSound Patch */
+#define SND_SEQ_INSTR_TYPE1_INTERWAVE (1<<3) /**< InterWave FFFF */
+#define SND_SEQ_INSTR_TYPE2_OPL2_3 (1<<0) /**< Yamaha OPL2/3 FM */
+#define SND_SEQ_INSTR_TYPE2_OPL4 (1<<1) /**< Yamaha OPL4 */
+
+/** put commands */
+#define SND_SEQ_INSTR_PUT_CMD_CREATE 0 /**< create a new layer */
+#define SND_SEQ_INSTR_PUT_CMD_REPLACE 1 /**< replace the old layer with new one */
+#define SND_SEQ_INSTR_PUT_CMD_MODIFY 2 /**< modify the existing layer */
+#define SND_SEQ_INSTR_PUT_CMD_ADD 3 /**< add one to the existing layer */
+#define SND_SEQ_INSTR_PUT_CMD_REMOVE 4 /**< remove the layer */
+
+/** get commands */
+#define SND_SEQ_INSTR_GET_CMD_FULL 0 /**< get the full data stream */
+#define SND_SEQ_INSTR_GET_CMD_PARTIAL 1 /**< get the partial data stream */
+
+/* query flags */
+#define SND_SEQ_INSTR_QUERY_FOLLOW_ALIAS (1<<0) /**< follow alias to get the instrument data */
+
+/** free commands */
+#define SND_SEQ_INSTR_FREE_CMD_ALL 0 /**< remove all matching instruments */
+#define SND_SEQ_INSTR_FREE_CMD_PRIVATE 1 /**< remove only private instruments */
+#define SND_SEQ_INSTR_FREE_CMD_CLUSTER 2 /**< remove only cluster instruments */
+#define SND_SEQ_INSTR_FREE_CMD_SINGLE 3 /**< remove single instrument */
+
+
+/**
+ * FM instrument support
+ */
+
+/** FM instrument data structure */
+typedef void snd_instr_fm_t;
+
+int snd_instr_fm_convert_to_stream(snd_instr_fm_t *fm, const char *name, snd_instr_header_t **put, size_t *size);
+int snd_instr_fm_convert_from_stream(snd_instr_header_t *data, size_t size, snd_instr_fm_t **fm);
+int snd_instr_fm_free(snd_instr_fm_t *fm);
+
+
+/**
+ * Simple Wave support
+ */
+
+/** simple instrument data structure */
+typedef void snd_instr_simple_t;
+
+int snd_instr_simple_convert_to_stream(snd_instr_simple_t *simple, const char *name, snd_instr_header_t **put, size_t *size);
+int snd_instr_simple_convert_from_stream(snd_instr_header_t *data, size_t size, snd_instr_simple_t **simple);
+int snd_instr_simple_free(snd_instr_simple_t *simple);
+
+
+/**
+ * InterWave FFFF support
+ */
+
+/** IW FFFF instrument data structure */
+typedef void snd_instr_iwffff_t;
+/** IW FFFF handler */
+typedef struct _snd_iwffff_handle snd_iwffff_handle_t;
+
+int snd_instr_iwffff_open(snd_iwffff_handle_t **handle, const char *name_fff, const char *name_dta);
+int snd_instr_iwffff_open_rom(snd_iwffff_handle_t **handle, int card, int bank, int file);
+int snd_instr_iwffff_open_rom_file(snd_iwffff_handle_t **handle, const char *name, int bank, int file);
+int snd_instr_iwffff_close(snd_iwffff_handle_t *handle);
+int snd_instr_iwffff_load(snd_iwffff_handle_t *handle, int bank, int prg, snd_instr_iwffff_t **iwffff);
+int snd_instr_iwffff_convert_to_stream(snd_instr_iwffff_t *iwffff, const char *name, snd_instr_header_t **data, size_t *size);
+int snd_instr_iwffff_convert_from_stream(snd_instr_header_t *data, size_t size, snd_instr_iwffff_t **iwffff);
+int snd_instr_iwffff_free(snd_instr_iwffff_t *iwffff);
+
+/** \} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __ALSA_INSTR_H */
+
diff --git a/sysroot/usr/include/alsa/mixer.h b/sysroot/usr/include/alsa/mixer.h
new file mode 100644
index 0000000..4129778
--- /dev/null
+++ b/sysroot/usr/include/alsa/mixer.h
@@ -0,0 +1,315 @@
+/**
+ * \file include/mixer.h
+ * \brief Application interface library for the ALSA driver
+ * \author Jaroslav Kysela <perex@perex.cz>
+ * \author Abramo Bagnara <abramo@alsa-project.org>
+ * \author Takashi Iwai <tiwai@suse.de>
+ * \date 1998-2001
+ *
+ * Application interface library for the ALSA driver
+ */
+/*
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef __ALSA_MIXER_H
+#define __ALSA_MIXER_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \defgroup Mixer Mixer Interface
+ * The mixer interface.
+ * \{
+ */
+
+/** Mixer handle */
+typedef struct _snd_mixer snd_mixer_t;
+/** Mixer elements class handle */
+typedef struct _snd_mixer_class snd_mixer_class_t;
+/** Mixer element handle */
+typedef struct _snd_mixer_elem snd_mixer_elem_t;
+
+/**
+ * \brief Mixer callback function
+ * \param mixer Mixer handle
+ * \param mask event mask
+ * \param elem related mixer element (if any)
+ * \return 0 on success otherwise a negative error code
+ */
+typedef int (*snd_mixer_callback_t)(snd_mixer_t *ctl,
+ unsigned int mask,
+ snd_mixer_elem_t *elem);
+
+/**
+ * \brief Mixer element callback function
+ * \param elem Mixer element
+ * \param mask event mask
+ * \return 0 on success otherwise a negative error code
+ */
+typedef int (*snd_mixer_elem_callback_t)(snd_mixer_elem_t *elem,
+ unsigned int mask);
+
+/**
+ * \brief Compare function for sorting mixer elements
+ * \param e1 First element
+ * \param e2 Second element
+ * \return -1 if e1 < e2, 0 if e1 == e2, 1 if e1 > e2
+ */
+typedef int (*snd_mixer_compare_t)(const snd_mixer_elem_t *e1,
+ const snd_mixer_elem_t *e2);
+
+/**
+ * \brief Event callback for the mixer class
+ * \param class_ Mixer class
+ * \param mask Event mask (SND_CTL_EVENT_*)
+ * \param helem HCTL element which invoked the event
+ * \param melem Mixer element associated to HCTL element
+ * \return zero if success, otherwise a negative error value
+ */
+typedef int (*snd_mixer_event_t)(snd_mixer_class_t *class_, unsigned int mask,
+ snd_hctl_elem_t *helem, snd_mixer_elem_t *melem);
+
+
+/** Mixer element type */
+typedef enum _snd_mixer_elem_type {
+ /* Simple (legacy) mixer elements */
+ SND_MIXER_ELEM_SIMPLE,
+ SND_MIXER_ELEM_LAST = SND_MIXER_ELEM_SIMPLE
+} snd_mixer_elem_type_t;
+
+int snd_mixer_open(snd_mixer_t **mixer, int mode);
+int snd_mixer_close(snd_mixer_t *mixer);
+snd_mixer_elem_t *snd_mixer_first_elem(snd_mixer_t *mixer);
+snd_mixer_elem_t *snd_mixer_last_elem(snd_mixer_t *mixer);
+int snd_mixer_handle_events(snd_mixer_t *mixer);
+int snd_mixer_attach(snd_mixer_t *mixer, const char *name);
+int snd_mixer_attach_hctl(snd_mixer_t *mixer, snd_hctl_t *hctl);
+int snd_mixer_detach(snd_mixer_t *mixer, const char *name);
+int snd_mixer_detach_hctl(snd_mixer_t *mixer, snd_hctl_t *hctl);
+int snd_mixer_get_hctl(snd_mixer_t *mixer, const char *name, snd_hctl_t **hctl);
+int snd_mixer_poll_descriptors_count(snd_mixer_t *mixer);
+int snd_mixer_poll_descriptors(snd_mixer_t *mixer, struct pollfd *pfds, unsigned int space);
+int snd_mixer_poll_descriptors_revents(snd_mixer_t *mixer, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
+int snd_mixer_load(snd_mixer_t *mixer);
+void snd_mixer_free(snd_mixer_t *mixer);
+int snd_mixer_wait(snd_mixer_t *mixer, int timeout);
+int snd_mixer_set_compare(snd_mixer_t *mixer, snd_mixer_compare_t msort);
+void snd_mixer_set_callback(snd_mixer_t *obj, snd_mixer_callback_t val);
+void * snd_mixer_get_callback_private(const snd_mixer_t *obj);
+void snd_mixer_set_callback_private(snd_mixer_t *obj, void * val);
+unsigned int snd_mixer_get_count(const snd_mixer_t *obj);
+int snd_mixer_class_unregister(snd_mixer_class_t *clss);
+
+snd_mixer_elem_t *snd_mixer_elem_next(snd_mixer_elem_t *elem);
+snd_mixer_elem_t *snd_mixer_elem_prev(snd_mixer_elem_t *elem);
+void snd_mixer_elem_set_callback(snd_mixer_elem_t *obj, snd_mixer_elem_callback_t val);
+void * snd_mixer_elem_get_callback_private(const snd_mixer_elem_t *obj);
+void snd_mixer_elem_set_callback_private(snd_mixer_elem_t *obj, void * val);
+snd_mixer_elem_type_t snd_mixer_elem_get_type(const snd_mixer_elem_t *obj);
+
+int snd_mixer_class_register(snd_mixer_class_t *class_, snd_mixer_t *mixer);
+int snd_mixer_add_elem(snd_mixer_t *mixer, snd_mixer_elem_t *elem);
+int snd_mixer_remove_elem(snd_mixer_t *mixer, snd_mixer_elem_t *elem);
+int snd_mixer_elem_new(snd_mixer_elem_t **elem,
+ snd_mixer_elem_type_t type,
+ int compare_weight,
+ void *private_data,
+ void (*private_free)(snd_mixer_elem_t *elem));
+int snd_mixer_elem_add(snd_mixer_elem_t *elem, snd_mixer_class_t *class_);
+int snd_mixer_elem_remove(snd_mixer_elem_t *elem);
+void snd_mixer_elem_free(snd_mixer_elem_t *elem);
+int snd_mixer_elem_info(snd_mixer_elem_t *elem);
+int snd_mixer_elem_value(snd_mixer_elem_t *elem);
+int snd_mixer_elem_attach(snd_mixer_elem_t *melem, snd_hctl_elem_t *helem);
+int snd_mixer_elem_detach(snd_mixer_elem_t *melem, snd_hctl_elem_t *helem);
+int snd_mixer_elem_empty(snd_mixer_elem_t *melem);
+void *snd_mixer_elem_get_private(const snd_mixer_elem_t *melem);
+
+size_t snd_mixer_class_sizeof(void);
+/** \hideinitializer
+ * \brief allocate an invalid #snd_mixer_class_t using standard alloca
+ * \param ptr returned pointer
+ */
+#define snd_mixer_class_alloca(ptr) do { assert(ptr); *ptr = (snd_mixer_class_t *) alloca(snd_mixer_class_sizeof()); memset(*ptr, 0, snd_mixer_class_sizeof()); } while (0)
+int snd_mixer_class_malloc(snd_mixer_class_t **ptr);
+void snd_mixer_class_free(snd_mixer_class_t *obj);
+void snd_mixer_class_copy(snd_mixer_class_t *dst, const snd_mixer_class_t *src);
+snd_mixer_t *snd_mixer_class_get_mixer(const snd_mixer_class_t *class_);
+snd_mixer_event_t snd_mixer_class_get_event(const snd_mixer_class_t *class_);
+void *snd_mixer_class_get_private(const snd_mixer_class_t *class_);
+snd_mixer_compare_t snd_mixer_class_get_compare(const snd_mixer_class_t *class_);
+int snd_mixer_class_set_event(snd_mixer_class_t *class_, snd_mixer_event_t event);
+int snd_mixer_class_set_private(snd_mixer_class_t *class_, void *private_data);
+int snd_mixer_class_set_private_free(snd_mixer_class_t *class_, void (*private_free)(snd_mixer_class_t *class_));
+int snd_mixer_class_set_compare(snd_mixer_class_t *class_, snd_mixer_compare_t compare);
+
+/**
+ * \defgroup SimpleMixer Simple Mixer Interface
+ * \ingroup Mixer
+ * The simple mixer interface.
+ * \{
+ */
+
+/* Simple (legacy) mixer elements API */
+
+/** Mixer simple element channel identifier */
+typedef enum _snd_mixer_selem_channel_id {
+ /** Unknown */
+ SND_MIXER_SCHN_UNKNOWN = -1,
+ /** Front left */
+ SND_MIXER_SCHN_FRONT_LEFT = 0,
+ /** Front right */
+ SND_MIXER_SCHN_FRONT_RIGHT,
+ /** Rear left */
+ SND_MIXER_SCHN_REAR_LEFT,
+ /** Rear right */
+ SND_MIXER_SCHN_REAR_RIGHT,
+ /** Front center */
+ SND_MIXER_SCHN_FRONT_CENTER,
+ /** Woofer */
+ SND_MIXER_SCHN_WOOFER,
+ /** Side Left */
+ SND_MIXER_SCHN_SIDE_LEFT,
+ /** Side Right */
+ SND_MIXER_SCHN_SIDE_RIGHT,
+ /** Rear Center */
+ SND_MIXER_SCHN_REAR_CENTER,
+ SND_MIXER_SCHN_LAST = 31,
+ /** Mono (Front left alias) */
+ SND_MIXER_SCHN_MONO = SND_MIXER_SCHN_FRONT_LEFT
+} snd_mixer_selem_channel_id_t;
+
+/** Mixer simple element - register options - abstraction level */
+enum snd_mixer_selem_regopt_abstract {
+ /** no abstraction - try use all universal controls from driver */
+ SND_MIXER_SABSTRACT_NONE = 0,
+ /** basic abstraction - Master,PCM,CD,Aux,Record-Gain etc. */
+ SND_MIXER_SABSTRACT_BASIC,
+};
+
+/** Mixer simple element - register options */
+struct snd_mixer_selem_regopt {
+ /** structure version */
+ int ver;
+ /** v1: abstract layer selection */
+ enum snd_mixer_selem_regopt_abstract abstract;
+ /** v1: device name (must be NULL when playback_pcm or capture_pcm != NULL) */
+ const char *device;
+ /** v1: playback PCM connected to mixer device (NULL == none) */
+ snd_pcm_t *playback_pcm;
+ /** v1: capture PCM connected to mixer device (NULL == none) */
+ snd_pcm_t *capture_pcm;
+};
+
+/** Mixer simple element identifier */
+typedef struct _snd_mixer_selem_id snd_mixer_selem_id_t;
+
+const char *snd_mixer_selem_channel_name(snd_mixer_selem_channel_id_t channel);
+
+int snd_mixer_selem_register(snd_mixer_t *mixer,
+ struct snd_mixer_selem_regopt *options,
+ snd_mixer_class_t **classp);
+void snd_mixer_selem_get_id(snd_mixer_elem_t *element,
+ snd_mixer_selem_id_t *id);
+const char *snd_mixer_selem_get_name(snd_mixer_elem_t *elem);
+unsigned int snd_mixer_selem_get_index(snd_mixer_elem_t *elem);
+snd_mixer_elem_t *snd_mixer_find_selem(snd_mixer_t *mixer,
+ const snd_mixer_selem_id_t *id);
+
+int snd_mixer_selem_is_active(snd_mixer_elem_t *elem);
+int snd_mixer_selem_is_playback_mono(snd_mixer_elem_t *elem);
+int snd_mixer_selem_has_playback_channel(snd_mixer_elem_t *obj, snd_mixer_selem_channel_id_t channel);
+int snd_mixer_selem_is_capture_mono(snd_mixer_elem_t *elem);
+int snd_mixer_selem_has_capture_channel(snd_mixer_elem_t *obj, snd_mixer_selem_channel_id_t channel);
+int snd_mixer_selem_get_capture_group(snd_mixer_elem_t *elem);
+int snd_mixer_selem_has_common_volume(snd_mixer_elem_t *elem);
+int snd_mixer_selem_has_playback_volume(snd_mixer_elem_t *elem);
+int snd_mixer_selem_has_playback_volume_joined(snd_mixer_elem_t *elem);
+int snd_mixer_selem_has_capture_volume(snd_mixer_elem_t *elem);
+int snd_mixer_selem_has_capture_volume_joined(snd_mixer_elem_t *elem);
+int snd_mixer_selem_has_common_switch(snd_mixer_elem_t *elem);
+int snd_mixer_selem_has_playback_switch(snd_mixer_elem_t *elem);
+int snd_mixer_selem_has_playback_switch_joined(snd_mixer_elem_t *elem);
+int snd_mixer_selem_has_capture_switch(snd_mixer_elem_t *elem);
+int snd_mixer_selem_has_capture_switch_joined(snd_mixer_elem_t *elem);
+int snd_mixer_selem_has_capture_switch_exclusive(snd_mixer_elem_t *elem);
+
+int snd_mixer_selem_get_playback_volume(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long *value);
+int snd_mixer_selem_get_capture_volume(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long *value);
+int snd_mixer_selem_get_playback_dB(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long *value);
+int snd_mixer_selem_get_capture_dB(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long *value);
+int snd_mixer_selem_get_playback_switch(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, int *value);
+int snd_mixer_selem_get_capture_switch(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, int *value);
+int snd_mixer_selem_set_playback_volume(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long value);
+int snd_mixer_selem_set_capture_volume(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long value);
+int snd_mixer_selem_set_playback_dB(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long value, int dir);
+int snd_mixer_selem_set_capture_dB(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long value, int dir);
+int snd_mixer_selem_set_playback_volume_all(snd_mixer_elem_t *elem, long value);
+int snd_mixer_selem_set_capture_volume_all(snd_mixer_elem_t *elem, long value);
+int snd_mixer_selem_set_playback_dB_all(snd_mixer_elem_t *elem, long value, int dir);
+int snd_mixer_selem_set_capture_dB_all(snd_mixer_elem_t *elem, long value, int dir);
+int snd_mixer_selem_set_playback_switch(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, int value);
+int snd_mixer_selem_set_capture_switch(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, int value);
+int snd_mixer_selem_set_playback_switch_all(snd_mixer_elem_t *elem, int value);
+int snd_mixer_selem_set_capture_switch_all(snd_mixer_elem_t *elem, int value);
+int snd_mixer_selem_get_playback_volume_range(snd_mixer_elem_t *elem,
+ long *min, long *max);
+int snd_mixer_selem_get_playback_dB_range(snd_mixer_elem_t *elem,
+ long *min, long *max);
+int snd_mixer_selem_set_playback_volume_range(snd_mixer_elem_t *elem,
+ long min, long max);
+int snd_mixer_selem_get_capture_volume_range(snd_mixer_elem_t *elem,
+ long *min, long *max);
+int snd_mixer_selem_get_capture_dB_range(snd_mixer_elem_t *elem,
+ long *min, long *max);
+int snd_mixer_selem_set_capture_volume_range(snd_mixer_elem_t *elem,
+ long min, long max);
+
+int snd_mixer_selem_is_enumerated(snd_mixer_elem_t *elem);
+int snd_mixer_selem_is_enum_playback(snd_mixer_elem_t *elem);
+int snd_mixer_selem_is_enum_capture(snd_mixer_elem_t *elem);
+int snd_mixer_selem_get_enum_items(snd_mixer_elem_t *elem);
+int snd_mixer_selem_get_enum_item_name(snd_mixer_elem_t *elem, unsigned int idx, size_t maxlen, char *str);
+int snd_mixer_selem_get_enum_item(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, unsigned int *idxp);
+int snd_mixer_selem_set_enum_item(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, unsigned int idx);
+
+size_t snd_mixer_selem_id_sizeof(void);
+/** \hideinitializer
+ * \brief allocate an invalid #snd_mixer_selem_id_t using standard alloca
+ * \param ptr returned pointer
+ */
+#define snd_mixer_selem_id_alloca(ptr) do { assert(ptr); *ptr = (snd_mixer_selem_id_t *) alloca(snd_mixer_selem_id_sizeof()); memset(*ptr, 0, snd_mixer_selem_id_sizeof()); } while (0)
+int snd_mixer_selem_id_malloc(snd_mixer_selem_id_t **ptr);
+void snd_mixer_selem_id_free(snd_mixer_selem_id_t *obj);
+void snd_mixer_selem_id_copy(snd_mixer_selem_id_t *dst, const snd_mixer_selem_id_t *src);
+const char *snd_mixer_selem_id_get_name(const snd_mixer_selem_id_t *obj);
+unsigned int snd_mixer_selem_id_get_index(const snd_mixer_selem_id_t *obj);
+void snd_mixer_selem_id_set_name(snd_mixer_selem_id_t *obj, const char *val);
+void snd_mixer_selem_id_set_index(snd_mixer_selem_id_t *obj, unsigned int val);
+
+/** \} */
+
+/** \} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __ALSA_MIXER_H */
+
diff --git a/sysroot/usr/include/alsa/mixer_abst.h b/sysroot/usr/include/alsa/mixer_abst.h
new file mode 100644
index 0000000..d39d835
--- /dev/null
+++ b/sysroot/usr/include/alsa/mixer_abst.h
@@ -0,0 +1,110 @@
+/**
+ * \file include/mixer_abst.h
+ * \brief Mixer abstract implementation interface library for the ALSA library
+ * \author Jaroslav Kysela <perex@perex.cz>
+ * \date 2005
+ *
+ * Mixer abstact implementation interface library for the ALSA library
+ */
+/*
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef __ALSA_MIXER_ABST_H
+#define __ALSA_MIXER_ABST_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \defgroup Mixer_Abstract Mixer Abstact Module Interface
+ * The mixer abstact module interface.
+ * \{
+ */
+
+#define SM_PLAY 0
+#define SM_CAPT 1
+
+#define SM_CAP_GVOLUME (1<<1)
+#define SM_CAP_GSWITCH (1<<2)
+#define SM_CAP_PVOLUME (1<<3)
+#define SM_CAP_PVOLUME_JOIN (1<<4)
+#define SM_CAP_PSWITCH (1<<5)
+#define SM_CAP_PSWITCH_JOIN (1<<6)
+#define SM_CAP_CVOLUME (1<<7)
+#define SM_CAP_CVOLUME_JOIN (1<<8)
+#define SM_CAP_CSWITCH (1<<9)
+#define SM_CAP_CSWITCH_JOIN (1<<10)
+#define SM_CAP_CSWITCH_EXCL (1<<11)
+#define SM_CAP_PENUM (1<<12)
+#define SM_CAP_CENUM (1<<13)
+/* SM_CAP_* 24-31 => private for module use */
+
+#define SM_OPS_IS_ACTIVE 0
+#define SM_OPS_IS_MONO 1
+#define SM_OPS_IS_CHANNEL 2
+#define SM_OPS_IS_ENUMERATED 3
+#define SM_OPS_IS_ENUMCNT 4
+
+#define sm_selem(x) ((sm_selem_t *)((x)->private_data))
+#define sm_selem_ops(x) ((sm_selem_t *)((x)->private_data))->ops
+
+typedef struct _sm_selem {
+ snd_mixer_selem_id_t *id;
+ struct sm_elem_ops *ops;
+ unsigned int caps;
+ unsigned int capture_group;
+} sm_selem_t;
+
+typedef struct _sm_class_basic {
+ char *device;
+ snd_ctl_t *ctl;
+ snd_hctl_t *hctl;
+ snd_ctl_card_info_t *info;
+} sm_class_basic_t;
+
+struct sm_elem_ops {
+ int (*is)(snd_mixer_elem_t *elem, int dir, int cmd, int val);
+ int (*get_range)(snd_mixer_elem_t *elem, int dir, long *min, long *max);
+ int (*set_range)(snd_mixer_elem_t *elem, int dir, long min, long max);
+ int (*get_dB_range)(snd_mixer_elem_t *elem, int dir, long *min, long *max);
+ int (*get_volume)(snd_mixer_elem_t *elem, int dir, snd_mixer_selem_channel_id_t channel, long *value);
+ int (*get_dB)(snd_mixer_elem_t *elem, int dir, snd_mixer_selem_channel_id_t channel, long *value);
+ int (*set_volume)(snd_mixer_elem_t *elem, int dir, snd_mixer_selem_channel_id_t channel, long value);
+ int (*set_dB)(snd_mixer_elem_t *elem, int dir, snd_mixer_selem_channel_id_t channel, long value, int xdir);
+ int (*get_switch)(snd_mixer_elem_t *elem, int dir, snd_mixer_selem_channel_id_t channel, int *value);
+ int (*set_switch)(snd_mixer_elem_t *elem, int dir, snd_mixer_selem_channel_id_t channel, int value);
+ int (*enum_item_name)(snd_mixer_elem_t *elem, unsigned int item, size_t maxlen, char *buf);
+ int (*get_enum_item)(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, unsigned int *itemp);
+ int (*set_enum_item)(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, unsigned int item);
+};
+
+int snd_mixer_selem_compare(const snd_mixer_elem_t *c1, const snd_mixer_elem_t *c2);
+
+int snd_mixer_sbasic_info(const snd_mixer_class_t *class, sm_class_basic_t *info);
+void *snd_mixer_sbasic_get_private(const snd_mixer_class_t *class);
+void snd_mixer_sbasic_set_private(const snd_mixer_class_t *class, void *private_data);
+void snd_mixer_sbasic_set_private_free(const snd_mixer_class_t *class, void (*private_free)(snd_mixer_class_t *class));
+
+/** \} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __ALSA_MIXER_ABST_H */
+
diff --git a/sysroot/usr/include/alsa/output.h b/sysroot/usr/include/alsa/output.h
new file mode 100644
index 0000000..5279aa2
--- /dev/null
+++ b/sysroot/usr/include/alsa/output.h
@@ -0,0 +1,86 @@
+/**
+ * \file include/output.h
+ * \brief Application interface library for the ALSA driver
+ * \author Jaroslav Kysela <perex@perex.cz>
+ * \author Abramo Bagnara <abramo@alsa-project.org>
+ * \author Takashi Iwai <tiwai@suse.de>
+ * \date 1998-2001
+ *
+ * Application interface library for the ALSA driver
+ */
+/*
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef __ALSA_OUTPUT_H
+#define __ALSA_OUTPUT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \defgroup Output Output Interface
+ *
+ * The output functions present an interface similar to the stdio functions
+ * on top of different underlying output destinations.
+ *
+ * Many PCM debugging functions (\c snd_pcm_xxx_dump_xxx) use such an output
+ * handle to be able to write not only to the screen but also to other
+ * destinations, e.g. to files or to memory buffers.
+ *
+ * \{
+ */
+
+/**
+ * \brief Internal structure for an output object.
+ *
+ * The ALSA library uses a pointer to this structure as a handle to an
+ * output object. Applications don't access its contents directly.
+ */
+typedef struct _snd_output snd_output_t;
+
+/** Output type. */
+typedef enum _snd_output_type {
+ /** Output to a stdio stream. */
+ SND_OUTPUT_STDIO,
+ /** Output to a memory buffer. */
+ SND_OUTPUT_BUFFER
+} snd_output_type_t;
+
+int snd_output_stdio_open(snd_output_t **outputp, const char *file, const char *mode);
+int snd_output_stdio_attach(snd_output_t **outputp, FILE *fp, int _close);
+int snd_output_buffer_open(snd_output_t **outputp);
+size_t snd_output_buffer_string(snd_output_t *output, char **buf);
+int snd_output_close(snd_output_t *output);
+int snd_output_printf(snd_output_t *output, const char *format, ...)
+#ifndef DOC_HIDDEN
+ __attribute__ ((format (printf, 2, 3)))
+#endif
+ ;
+int snd_output_vprintf(snd_output_t *output, const char *format, va_list args);
+int snd_output_puts(snd_output_t *output, const char *str);
+int snd_output_putc(snd_output_t *output, int c);
+int snd_output_flush(snd_output_t *output);
+
+/** \} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __ALSA_OUTPUT_H */
+
diff --git a/sysroot/usr/include/alsa/pcm.h b/sysroot/usr/include/alsa/pcm.h
new file mode 100644
index 0000000..db9fca3
--- /dev/null
+++ b/sysroot/usr/include/alsa/pcm.h
@@ -0,0 +1,1113 @@
+/**
+ * \file include/pcm.h
+ * \brief Application interface library for the ALSA driver
+ * \author Jaroslav Kysela <perex@perex.cz>
+ * \author Abramo Bagnara <abramo@alsa-project.org>
+ * \author Takashi Iwai <tiwai@suse.de>
+ * \date 1998-2001
+ *
+ * Application interface library for the ALSA driver.
+ * See the \ref pcm page for more details.
+ */
+/*
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef __ALSA_PCM_H
+#define __ALSA_PCM_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \defgroup PCM PCM Interface
+ * See the \ref pcm page for more details.
+ * \{
+ */
+
+/** dlsym version for interface entry callback */
+#define SND_PCM_DLSYM_VERSION _dlsym_pcm_001
+
+/** PCM generic info container */
+typedef struct _snd_pcm_info snd_pcm_info_t;
+/** PCM hardware configuration space container */
+typedef struct _snd_pcm_hw_params snd_pcm_hw_params_t;
+/** PCM software configuration container */
+typedef struct _snd_pcm_sw_params snd_pcm_sw_params_t;
+/** PCM status container */
+ typedef struct _snd_pcm_status snd_pcm_status_t;
+/** PCM access types mask */
+typedef struct _snd_pcm_access_mask snd_pcm_access_mask_t;
+/** PCM formats mask */
+typedef struct _snd_pcm_format_mask snd_pcm_format_mask_t;
+/** PCM subformats mask */
+typedef struct _snd_pcm_subformat_mask snd_pcm_subformat_mask_t;
+
+/** PCM class */
+typedef enum _snd_pcm_class {
+ /** standard device */
+
+ SND_PCM_CLASS_GENERIC = 0,
+ /** multichannel device */
+ SND_PCM_CLASS_MULTI,
+ /** software modem device */
+ SND_PCM_CLASS_MODEM,
+ /** digitizer device */
+ SND_PCM_CLASS_DIGITIZER,
+ SND_PCM_CLASS_LAST = SND_PCM_CLASS_DIGITIZER
+} snd_pcm_class_t;
+
+/** PCM subclass */
+typedef enum _snd_pcm_subclass {
+ /** subdevices are mixed together */
+ SND_PCM_SUBCLASS_GENERIC_MIX = 0,
+ /** multichannel subdevices are mixed together */
+ SND_PCM_SUBCLASS_MULTI_MIX,
+ SND_PCM_SUBCLASS_LAST = SND_PCM_SUBCLASS_MULTI_MIX
+} snd_pcm_subclass_t;
+
+/** PCM stream (direction) */
+typedef enum _snd_pcm_stream {
+ /** Playback stream */
+ SND_PCM_STREAM_PLAYBACK = 0,
+ /** Capture stream */
+ SND_PCM_STREAM_CAPTURE,
+ SND_PCM_STREAM_LAST = SND_PCM_STREAM_CAPTURE
+} snd_pcm_stream_t;
+
+/** PCM access type */
+typedef enum _snd_pcm_access {
+ /** mmap access with simple interleaved channels */
+ SND_PCM_ACCESS_MMAP_INTERLEAVED = 0,
+ /** mmap access with simple non interleaved channels */
+ SND_PCM_ACCESS_MMAP_NONINTERLEAVED,
+ /** mmap access with complex placement */
+ SND_PCM_ACCESS_MMAP_COMPLEX,
+ /** snd_pcm_readi/snd_pcm_writei access */
+ SND_PCM_ACCESS_RW_INTERLEAVED,
+ /** snd_pcm_readn/snd_pcm_writen access */
+ SND_PCM_ACCESS_RW_NONINTERLEAVED,
+ SND_PCM_ACCESS_LAST = SND_PCM_ACCESS_RW_NONINTERLEAVED
+} snd_pcm_access_t;
+
+/** PCM sample format */
+typedef enum _snd_pcm_format {
+ /** Unknown */
+ SND_PCM_FORMAT_UNKNOWN = -1,
+ /** Signed 8 bit */
+ SND_PCM_FORMAT_S8 = 0,
+ /** Unsigned 8 bit */
+ SND_PCM_FORMAT_U8,
+ /** Signed 16 bit Little Endian */
+ SND_PCM_FORMAT_S16_LE,
+ /** Signed 16 bit Big Endian */
+ SND_PCM_FORMAT_S16_BE,
+ /** Unsigned 16 bit Little Endian */
+ SND_PCM_FORMAT_U16_LE,
+ /** Unsigned 16 bit Big Endian */
+ SND_PCM_FORMAT_U16_BE,
+ /** Signed 24 bit Little Endian using low three bytes in 32-bit word */
+ SND_PCM_FORMAT_S24_LE,
+ /** Signed 24 bit Big Endian using low three bytes in 32-bit word */
+ SND_PCM_FORMAT_S24_BE,
+ /** Unsigned 24 bit Little Endian using low three bytes in 32-bit word */
+ SND_PCM_FORMAT_U24_LE,
+ /** Unsigned 24 bit Big Endian using low three bytes in 32-bit word */
+ SND_PCM_FORMAT_U24_BE,
+ /** Signed 32 bit Little Endian */
+ SND_PCM_FORMAT_S32_LE,
+ /** Signed 32 bit Big Endian */
+ SND_PCM_FORMAT_S32_BE,
+ /** Unsigned 32 bit Little Endian */
+ SND_PCM_FORMAT_U32_LE,
+ /** Unsigned 32 bit Big Endian */
+ SND_PCM_FORMAT_U32_BE,
+ /** Float 32 bit Little Endian, Range -1.0 to 1.0 */
+ SND_PCM_FORMAT_FLOAT_LE,
+ /** Float 32 bit Big Endian, Range -1.0 to 1.0 */
+ SND_PCM_FORMAT_FLOAT_BE,
+ /** Float 64 bit Little Endian, Range -1.0 to 1.0 */
+ SND_PCM_FORMAT_FLOAT64_LE,
+ /** Float 64 bit Big Endian, Range -1.0 to 1.0 */
+ SND_PCM_FORMAT_FLOAT64_BE,
+ /** IEC-958 Little Endian */
+ SND_PCM_FORMAT_IEC958_SUBFRAME_LE,
+ /** IEC-958 Big Endian */
+ SND_PCM_FORMAT_IEC958_SUBFRAME_BE,
+ /** Mu-Law */
+ SND_PCM_FORMAT_MU_LAW,
+ /** A-Law */
+ SND_PCM_FORMAT_A_LAW,
+ /** Ima-ADPCM */
+ SND_PCM_FORMAT_IMA_ADPCM,
+ /** MPEG */
+ SND_PCM_FORMAT_MPEG,
+ /** GSM */
+ SND_PCM_FORMAT_GSM,
+ /** Special */
+ SND_PCM_FORMAT_SPECIAL = 31,
+ /** Signed 24bit Little Endian in 3bytes format */
+ SND_PCM_FORMAT_S24_3LE = 32,
+ /** Signed 24bit Big Endian in 3bytes format */
+ SND_PCM_FORMAT_S24_3BE,
+ /** Unsigned 24bit Little Endian in 3bytes format */
+ SND_PCM_FORMAT_U24_3LE,
+ /** Unsigned 24bit Big Endian in 3bytes format */
+ SND_PCM_FORMAT_U24_3BE,
+ /** Signed 20bit Little Endian in 3bytes format */
+ SND_PCM_FORMAT_S20_3LE,
+ /** Signed 20bit Big Endian in 3bytes format */
+ SND_PCM_FORMAT_S20_3BE,
+ /** Unsigned 20bit Little Endian in 3bytes format */
+ SND_PCM_FORMAT_U20_3LE,
+ /** Unsigned 20bit Big Endian in 3bytes format */
+ SND_PCM_FORMAT_U20_3BE,
+ /** Signed 18bit Little Endian in 3bytes format */
+ SND_PCM_FORMAT_S18_3LE,
+ /** Signed 18bit Big Endian in 3bytes format */
+ SND_PCM_FORMAT_S18_3BE,
+ /** Unsigned 18bit Little Endian in 3bytes format */
+ SND_PCM_FORMAT_U18_3LE,
+ /** Unsigned 18bit Big Endian in 3bytes format */
+ SND_PCM_FORMAT_U18_3BE,
+ SND_PCM_FORMAT_LAST = SND_PCM_FORMAT_U18_3BE,
+
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+ /** Signed 16 bit CPU endian */
+ SND_PCM_FORMAT_S16 = SND_PCM_FORMAT_S16_LE,
+ /** Unsigned 16 bit CPU endian */
+ SND_PCM_FORMAT_U16 = SND_PCM_FORMAT_U16_LE,
+ /** Signed 24 bit CPU endian */
+ SND_PCM_FORMAT_S24 = SND_PCM_FORMAT_S24_LE,
+ /** Unsigned 24 bit CPU endian */
+ SND_PCM_FORMAT_U24 = SND_PCM_FORMAT_U24_LE,
+ /** Signed 32 bit CPU endian */
+ SND_PCM_FORMAT_S32 = SND_PCM_FORMAT_S32_LE,
+ /** Unsigned 32 bit CPU endian */
+ SND_PCM_FORMAT_U32 = SND_PCM_FORMAT_U32_LE,
+ /** Float 32 bit CPU endian */
+ SND_PCM_FORMAT_FLOAT = SND_PCM_FORMAT_FLOAT_LE,
+ /** Float 64 bit CPU endian */
+ SND_PCM_FORMAT_FLOAT64 = SND_PCM_FORMAT_FLOAT64_LE,
+ /** IEC-958 CPU Endian */
+ SND_PCM_FORMAT_IEC958_SUBFRAME = SND_PCM_FORMAT_IEC958_SUBFRAME_LE
+#elif __BYTE_ORDER == __BIG_ENDIAN
+ /** Signed 16 bit CPU endian */
+ SND_PCM_FORMAT_S16 = SND_PCM_FORMAT_S16_BE,
+ /** Unsigned 16 bit CPU endian */
+ SND_PCM_FORMAT_U16 = SND_PCM_FORMAT_U16_BE,
+ /** Signed 24 bit CPU endian */
+ SND_PCM_FORMAT_S24 = SND_PCM_FORMAT_S24_BE,
+ /** Unsigned 24 bit CPU endian */
+ SND_PCM_FORMAT_U24 = SND_PCM_FORMAT_U24_BE,
+ /** Signed 32 bit CPU endian */
+ SND_PCM_FORMAT_S32 = SND_PCM_FORMAT_S32_BE,
+ /** Unsigned 32 bit CPU endian */
+ SND_PCM_FORMAT_U32 = SND_PCM_FORMAT_U32_BE,
+ /** Float 32 bit CPU endian */
+ SND_PCM_FORMAT_FLOAT = SND_PCM_FORMAT_FLOAT_BE,
+ /** Float 64 bit CPU endian */
+ SND_PCM_FORMAT_FLOAT64 = SND_PCM_FORMAT_FLOAT64_BE,
+ /** IEC-958 CPU Endian */
+ SND_PCM_FORMAT_IEC958_SUBFRAME = SND_PCM_FORMAT_IEC958_SUBFRAME_BE
+#else
+#error "Unknown endian"
+#endif
+} snd_pcm_format_t;
+
+/** PCM sample subformat */
+typedef enum _snd_pcm_subformat {
+ /** Standard */
+ SND_PCM_SUBFORMAT_STD = 0,
+ SND_PCM_SUBFORMAT_LAST = SND_PCM_SUBFORMAT_STD
+} snd_pcm_subformat_t;
+
+/** PCM state */
+typedef enum _snd_pcm_state {
+ /** Open */
+ SND_PCM_STATE_OPEN = 0,
+ /** Setup installed */
+ SND_PCM_STATE_SETUP,
+ /** Ready to start */
+ SND_PCM_STATE_PREPARED,
+ /** Running */
+ SND_PCM_STATE_RUNNING,
+ /** Stopped: underrun (playback) or overrun (capture) detected */
+ SND_PCM_STATE_XRUN,
+ /** Draining: running (playback) or stopped (capture) */
+ SND_PCM_STATE_DRAINING,
+ /** Paused */
+ SND_PCM_STATE_PAUSED,
+ /** Hardware is suspended */
+ SND_PCM_STATE_SUSPENDED,
+ /** Hardware is disconnected */
+ SND_PCM_STATE_DISCONNECTED,
+ SND_PCM_STATE_LAST = SND_PCM_STATE_DISCONNECTED
+} snd_pcm_state_t;
+
+/** PCM start mode */
+typedef enum _snd_pcm_start {
+ /** Automatic start on data read/write */
+ SND_PCM_START_DATA = 0,
+ /** Explicit start */
+ SND_PCM_START_EXPLICIT,
+ SND_PCM_START_LAST = SND_PCM_START_EXPLICIT
+} snd_pcm_start_t;
+
+/** PCM xrun mode */
+typedef enum _snd_pcm_xrun {
+ /** Xrun detection disabled */
+ SND_PCM_XRUN_NONE = 0,
+ /** Stop on xrun detection */
+ SND_PCM_XRUN_STOP,
+ SND_PCM_XRUN_LAST = SND_PCM_XRUN_STOP
+} snd_pcm_xrun_t;
+
+/** PCM timestamp mode */
+typedef enum _snd_pcm_tstamp {
+ /** No timestamp */
+ SND_PCM_TSTAMP_NONE = 0,
+ /** Update mmap'ed timestamp */
+ SND_PCM_TSTAMP_MMAP,
+ SND_PCM_TSTAMP_LAST = SND_PCM_TSTAMP_MMAP
+} snd_pcm_tstamp_t;
+
+/** Unsigned frames quantity */
+typedef unsigned long snd_pcm_uframes_t;
+/** Signed frames quantity */
+typedef long snd_pcm_sframes_t;
+
+/** Non blocking mode (flag for open mode) \hideinitializer */
+#define SND_PCM_NONBLOCK 0x0001
+/** Async notification (flag for open mode) \hideinitializer */
+#define SND_PCM_ASYNC 0x0002
+
+/** PCM handle */
+typedef struct _snd_pcm snd_pcm_t;
+
+/** PCM type */
+enum _snd_pcm_type {
+ /** Kernel level PCM */
+ SND_PCM_TYPE_HW = 0,
+ /** Hooked PCM */
+ SND_PCM_TYPE_HOOKS,
+ /** One or more linked PCM with exclusive access to selected
+ channels */
+ SND_PCM_TYPE_MULTI,
+ /** File writing plugin */
+ SND_PCM_TYPE_FILE,
+ /** Null endpoint PCM */
+ SND_PCM_TYPE_NULL,
+ /** Shared memory client PCM */
+ SND_PCM_TYPE_SHM,
+ /** INET client PCM (not yet implemented) */
+ SND_PCM_TYPE_INET,
+ /** Copying plugin */
+ SND_PCM_TYPE_COPY,
+ /** Linear format conversion PCM */
+ SND_PCM_TYPE_LINEAR,
+ /** A-Law format conversion PCM */
+ SND_PCM_TYPE_ALAW,
+ /** Mu-Law format conversion PCM */
+ SND_PCM_TYPE_MULAW,
+ /** IMA-ADPCM format conversion PCM */
+ SND_PCM_TYPE_ADPCM,
+ /** Rate conversion PCM */
+ SND_PCM_TYPE_RATE,
+ /** Attenuated static route PCM */
+ SND_PCM_TYPE_ROUTE,
+ /** Format adjusted PCM */
+ SND_PCM_TYPE_PLUG,
+ /** Sharing PCM */
+ SND_PCM_TYPE_SHARE,
+ /** Meter plugin */
+ SND_PCM_TYPE_METER,
+ /** Mixing PCM */
+ SND_PCM_TYPE_MIX,
+ /** Attenuated dynamic route PCM (not yet implemented) */
+ SND_PCM_TYPE_DROUTE,
+ /** Loopback server plugin (not yet implemented) */
+ SND_PCM_TYPE_LBSERVER,
+ /** Linear Integer <-> Linear Float format conversion PCM */
+ SND_PCM_TYPE_LINEAR_FLOAT,
+ /** LADSPA integration plugin */
+ SND_PCM_TYPE_LADSPA,
+ /** Direct Mixing plugin */
+ SND_PCM_TYPE_DMIX,
+ /** Jack Audio Connection Kit plugin */
+ SND_PCM_TYPE_JACK,
+ /** Direct Snooping plugin */
+ SND_PCM_TYPE_DSNOOP,
+ /** Direct Sharing plugin */
+ SND_PCM_TYPE_DSHARE,
+ /** IEC958 subframe plugin */
+ SND_PCM_TYPE_IEC958,
+ /** Soft volume plugin */
+ SND_PCM_TYPE_SOFTVOL,
+ /** External I/O plugin */
+ SND_PCM_TYPE_IOPLUG,
+ /** External filter plugin */
+ SND_PCM_TYPE_EXTPLUG,
+ /** Mmap-emulation plugin */
+ SND_PCM_TYPE_MMAP_EMUL,
+ SND_PCM_TYPE_LAST = SND_PCM_TYPE_MMAP_EMUL
+};
+
+/** PCM type */
+typedef enum _snd_pcm_type snd_pcm_type_t;
+
+/** PCM area specification */
+typedef struct _snd_pcm_channel_area {
+ /** base address of channel samples */
+ void *addr;
+ /** offset to first sample in bits */
+ unsigned int first;
+ /** samples distance in bits */
+ unsigned int step;
+} snd_pcm_channel_area_t;
+
+/** PCM synchronization ID */
+typedef union _snd_pcm_sync_id {
+ /** 8-bit ID */
+ unsigned char id[16];
+ /** 16-bit ID */
+ unsigned short id16[8];
+ /** 32-bit ID */
+ unsigned int id32[4];
+} snd_pcm_sync_id_t;
+
+/** #SND_PCM_TYPE_METER scope handle */
+typedef struct _snd_pcm_scope snd_pcm_scope_t;
+
+int snd_pcm_open(snd_pcm_t **pcm, const char *name,
+ snd_pcm_stream_t stream, int mode);
+int snd_pcm_open_lconf(snd_pcm_t **pcm, const char *name,
+ snd_pcm_stream_t stream, int mode,
+ snd_config_t *lconf);
+
+int snd_pcm_close(snd_pcm_t *pcm);
+const char *snd_pcm_name(snd_pcm_t *pcm);
+snd_pcm_type_t snd_pcm_type(snd_pcm_t *pcm);
+snd_pcm_stream_t snd_pcm_stream(snd_pcm_t *pcm);
+int snd_pcm_poll_descriptors_count(snd_pcm_t *pcm);
+int snd_pcm_poll_descriptors(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int space);
+int snd_pcm_poll_descriptors_revents(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
+int snd_pcm_nonblock(snd_pcm_t *pcm, int nonblock);
+int snd_async_add_pcm_handler(snd_async_handler_t **handler, snd_pcm_t *pcm,
+ snd_async_callback_t callback, void *private_data);
+snd_pcm_t *snd_async_handler_get_pcm(snd_async_handler_t *handler);
+int snd_pcm_info(snd_pcm_t *pcm, snd_pcm_info_t *info);
+int snd_pcm_hw_params_current(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
+int snd_pcm_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
+int snd_pcm_hw_free(snd_pcm_t *pcm);
+int snd_pcm_sw_params_current(snd_pcm_t *pcm, snd_pcm_sw_params_t *params);
+int snd_pcm_sw_params(snd_pcm_t *pcm, snd_pcm_sw_params_t *params);
+int snd_pcm_prepare(snd_pcm_t *pcm);
+int snd_pcm_reset(snd_pcm_t *pcm);
+int snd_pcm_status(snd_pcm_t *pcm, snd_pcm_status_t *status);
+int snd_pcm_start(snd_pcm_t *pcm);
+int snd_pcm_drop(snd_pcm_t *pcm);
+int snd_pcm_drain(snd_pcm_t *pcm);
+int snd_pcm_pause(snd_pcm_t *pcm, int enable);
+snd_pcm_state_t snd_pcm_state(snd_pcm_t *pcm);
+int snd_pcm_hwsync(snd_pcm_t *pcm);
+int snd_pcm_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp);
+int snd_pcm_resume(snd_pcm_t *pcm);
+snd_pcm_sframes_t snd_pcm_avail_update(snd_pcm_t *pcm);
+snd_pcm_sframes_t snd_pcm_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames);
+snd_pcm_sframes_t snd_pcm_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames);
+snd_pcm_sframes_t snd_pcm_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size);
+snd_pcm_sframes_t snd_pcm_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size);
+snd_pcm_sframes_t snd_pcm_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
+snd_pcm_sframes_t snd_pcm_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
+int snd_pcm_wait(snd_pcm_t *pcm, int timeout);
+
+int snd_pcm_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2);
+int snd_pcm_unlink(snd_pcm_t *pcm);
+
+/*
+ * application helpers - these functions are implemented on top
+ * of the basic API
+ */
+
+int snd_pcm_recover(snd_pcm_t *pcm, int err, int silent);
+int snd_pcm_set_params(snd_pcm_t *pcm,
+ snd_pcm_format_t format,
+ snd_pcm_access_t access,
+ unsigned int channels,
+ unsigned int rate,
+ int soft_resample,
+ unsigned int latency);
+int snd_pcm_get_params(snd_pcm_t *pcm,
+ snd_pcm_uframes_t *buffer_size,
+ snd_pcm_uframes_t *period_size);
+
+/** \} */
+
+/**
+ * \defgroup PCM_Info Stream Information
+ * \ingroup PCM
+ * See the \ref pcm page for more details.
+ * \{
+ */
+
+size_t snd_pcm_info_sizeof(void);
+/** \hideinitializer
+ * \brief allocate an invalid #snd_pcm_info_t using standard alloca
+ * \param ptr returned pointer
+ */
+#define snd_pcm_info_alloca(ptr) do { assert(ptr); *ptr = (snd_pcm_info_t *) alloca(snd_pcm_info_sizeof()); memset(*ptr, 0, snd_pcm_info_sizeof()); } while (0)
+int snd_pcm_info_malloc(snd_pcm_info_t **ptr);
+void snd_pcm_info_free(snd_pcm_info_t *obj);
+void snd_pcm_info_copy(snd_pcm_info_t *dst, const snd_pcm_info_t *src);
+unsigned int snd_pcm_info_get_device(const snd_pcm_info_t *obj);
+unsigned int snd_pcm_info_get_subdevice(const snd_pcm_info_t *obj);
+snd_pcm_stream_t snd_pcm_info_get_stream(const snd_pcm_info_t *obj);
+int snd_pcm_info_get_card(const snd_pcm_info_t *obj);
+const char *snd_pcm_info_get_id(const snd_pcm_info_t *obj);
+const char *snd_pcm_info_get_name(const snd_pcm_info_t *obj);
+const char *snd_pcm_info_get_subdevice_name(const snd_pcm_info_t *obj);
+snd_pcm_class_t snd_pcm_info_get_class(const snd_pcm_info_t *obj);
+snd_pcm_subclass_t snd_pcm_info_get_subclass(const snd_pcm_info_t *obj);
+unsigned int snd_pcm_info_get_subdevices_count(const snd_pcm_info_t *obj);
+unsigned int snd_pcm_info_get_subdevices_avail(const snd_pcm_info_t *obj);
+snd_pcm_sync_id_t snd_pcm_info_get_sync(const snd_pcm_info_t *obj);
+void snd_pcm_info_set_device(snd_pcm_info_t *obj, unsigned int val);
+void snd_pcm_info_set_subdevice(snd_pcm_info_t *obj, unsigned int val);
+void snd_pcm_info_set_stream(snd_pcm_info_t *obj, snd_pcm_stream_t val);
+
+/** \} */
+
+/**
+ * \defgroup PCM_HW_Params Hardware Parameters
+ * \ingroup PCM
+ * See the \ref pcm page for more details.
+ * \{
+ */
+
+int snd_pcm_hw_params_any(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
+
+int snd_pcm_hw_params_can_mmap_sample_resolution(const snd_pcm_hw_params_t *params);
+int snd_pcm_hw_params_is_double(const snd_pcm_hw_params_t *params);
+int snd_pcm_hw_params_is_batch(const snd_pcm_hw_params_t *params);
+int snd_pcm_hw_params_is_block_transfer(const snd_pcm_hw_params_t *params);
+int snd_pcm_hw_params_can_overrange(const snd_pcm_hw_params_t *params);
+int snd_pcm_hw_params_can_pause(const snd_pcm_hw_params_t *params);
+int snd_pcm_hw_params_can_resume(const snd_pcm_hw_params_t *params);
+int snd_pcm_hw_params_is_half_duplex(const snd_pcm_hw_params_t *params);
+int snd_pcm_hw_params_is_joint_duplex(const snd_pcm_hw_params_t *params);
+int snd_pcm_hw_params_can_sync_start(const snd_pcm_hw_params_t *params);
+int snd_pcm_hw_params_get_rate_numden(const snd_pcm_hw_params_t *params,
+ unsigned int *rate_num,
+ unsigned int *rate_den);
+int snd_pcm_hw_params_get_sbits(const snd_pcm_hw_params_t *params);
+int snd_pcm_hw_params_get_fifo_size(const snd_pcm_hw_params_t *params);
+
+#if 0
+typedef struct _snd_pcm_hw_strategy snd_pcm_hw_strategy_t;
+
+/* choices need to be sorted on ascending badness */
+typedef struct _snd_pcm_hw_strategy_simple_choices_list {
+ unsigned int value;
+ unsigned int badness;
+} snd_pcm_hw_strategy_simple_choices_list_t;
+
+int snd_pcm_hw_params_strategy(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
+ const snd_pcm_hw_strategy_t *strategy,
+ unsigned int badness_min,
+ unsigned int badness_max);
+
+void snd_pcm_hw_strategy_free(snd_pcm_hw_strategy_t *strategy);
+int snd_pcm_hw_strategy_simple(snd_pcm_hw_strategy_t **strategyp,
+ unsigned int badness_min,
+ unsigned int badness_max);
+int snd_pcm_hw_params_try_explain_failure(snd_pcm_t *pcm,
+ snd_pcm_hw_params_t *fail,
+ snd_pcm_hw_params_t *success,
+ unsigned int depth,
+ snd_output_t *out);
+
+#endif
+
+size_t snd_pcm_hw_params_sizeof(void);
+/** \hideinitializer
+ * \brief allocate an invalid #snd_pcm_hw_params_t using standard alloca
+ * \param ptr returned pointer
+ */
+#define snd_pcm_hw_params_alloca(ptr) do { assert(ptr); *ptr = (snd_pcm_hw_params_t *) alloca(snd_pcm_hw_params_sizeof()); memset(*ptr, 0, snd_pcm_hw_params_sizeof()); } while (0)
+int snd_pcm_hw_params_malloc(snd_pcm_hw_params_t **ptr);
+void snd_pcm_hw_params_free(snd_pcm_hw_params_t *obj);
+void snd_pcm_hw_params_copy(snd_pcm_hw_params_t *dst, const snd_pcm_hw_params_t *src);
+
+#if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_HW_PARAMS_API)
+
+int snd_pcm_hw_params_get_access(const snd_pcm_hw_params_t *params, snd_pcm_access_t *_access);
+int snd_pcm_hw_params_test_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t _access);
+int snd_pcm_hw_params_set_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t _access);
+int snd_pcm_hw_params_set_access_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t *_access);
+int snd_pcm_hw_params_set_access_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t *_access);
+int snd_pcm_hw_params_set_access_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_mask_t *mask);
+int snd_pcm_hw_params_get_access_mask(snd_pcm_hw_params_t *params, snd_pcm_access_mask_t *mask);
+
+int snd_pcm_hw_params_get_format(const snd_pcm_hw_params_t *params, snd_pcm_format_t *val);
+int snd_pcm_hw_params_test_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val);
+int snd_pcm_hw_params_set_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val);
+int snd_pcm_hw_params_set_format_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t *format);
+int snd_pcm_hw_params_set_format_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t *format);
+int snd_pcm_hw_params_set_format_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_mask_t *mask);
+void snd_pcm_hw_params_get_format_mask(snd_pcm_hw_params_t *params, snd_pcm_format_mask_t *mask);
+
+int snd_pcm_hw_params_get_subformat(const snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat);
+int snd_pcm_hw_params_test_subformat(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t subformat);
+int snd_pcm_hw_params_set_subformat(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t subformat);
+int snd_pcm_hw_params_set_subformat_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat);
+int snd_pcm_hw_params_set_subformat_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat);
+int snd_pcm_hw_params_set_subformat_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_mask_t *mask);
+void snd_pcm_hw_params_get_subformat_mask(snd_pcm_hw_params_t *params, snd_pcm_subformat_mask_t *mask);
+
+int snd_pcm_hw_params_get_channels(const snd_pcm_hw_params_t *params, unsigned int *val);
+int snd_pcm_hw_params_get_channels_min(const snd_pcm_hw_params_t *params, unsigned int *val);
+int snd_pcm_hw_params_get_channels_max(const snd_pcm_hw_params_t *params, unsigned int *val);
+int snd_pcm_hw_params_test_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
+int snd_pcm_hw_params_set_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
+int snd_pcm_hw_params_set_channels_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
+int snd_pcm_hw_params_set_channels_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
+int snd_pcm_hw_params_set_channels_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, unsigned int *max);
+int snd_pcm_hw_params_set_channels_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
+int snd_pcm_hw_params_set_channels_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
+int snd_pcm_hw_params_set_channels_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
+
+int snd_pcm_hw_params_get_rate(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_get_rate_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_get_rate_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_test_rate(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
+int snd_pcm_hw_params_set_rate(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
+int snd_pcm_hw_params_set_rate_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_set_rate_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_set_rate_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, int *mindir, unsigned int *max, int *maxdir);
+int snd_pcm_hw_params_set_rate_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_set_rate_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_set_rate_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_set_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
+int snd_pcm_hw_params_get_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
+int snd_pcm_hw_params_set_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
+int snd_pcm_hw_params_get_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
+
+int snd_pcm_hw_params_get_period_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_get_period_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_get_period_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_test_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
+int snd_pcm_hw_params_set_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
+int snd_pcm_hw_params_set_period_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_set_period_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_set_period_time_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, int *mindir, unsigned int *max, int *maxdir);
+int snd_pcm_hw_params_set_period_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_set_period_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_set_period_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+
+int snd_pcm_hw_params_get_period_size(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir);
+int snd_pcm_hw_params_get_period_size_min(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir);
+int snd_pcm_hw_params_get_period_size_max(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir);
+int snd_pcm_hw_params_test_period_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val, int dir);
+int snd_pcm_hw_params_set_period_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val, int dir);
+int snd_pcm_hw_params_set_period_size_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val, int *dir);
+int snd_pcm_hw_params_set_period_size_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val, int *dir);
+int snd_pcm_hw_params_set_period_size_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *min, int *mindir, snd_pcm_uframes_t *max, int *maxdir);
+int snd_pcm_hw_params_set_period_size_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val, int *dir);
+int snd_pcm_hw_params_set_period_size_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val, int *dir);
+int snd_pcm_hw_params_set_period_size_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val, int *dir);
+int snd_pcm_hw_params_set_period_size_integer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
+
+int snd_pcm_hw_params_get_periods(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_get_periods_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_get_periods_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_test_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
+int snd_pcm_hw_params_set_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
+int snd_pcm_hw_params_set_periods_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_set_periods_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_set_periods_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, int *mindir, unsigned int *max, int *maxdir);
+int snd_pcm_hw_params_set_periods_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_set_periods_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_set_periods_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_set_periods_integer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
+
+int snd_pcm_hw_params_get_buffer_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_get_buffer_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_get_buffer_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_test_buffer_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
+int snd_pcm_hw_params_set_buffer_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
+int snd_pcm_hw_params_set_buffer_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_set_buffer_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_set_buffer_time_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, int *mindir, unsigned int *max, int *maxdir);
+int snd_pcm_hw_params_set_buffer_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_set_buffer_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_set_buffer_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+
+int snd_pcm_hw_params_get_buffer_size(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
+int snd_pcm_hw_params_get_buffer_size_min(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
+int snd_pcm_hw_params_get_buffer_size_max(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
+int snd_pcm_hw_params_test_buffer_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val);
+int snd_pcm_hw_params_set_buffer_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val);
+int snd_pcm_hw_params_set_buffer_size_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
+int snd_pcm_hw_params_set_buffer_size_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
+int snd_pcm_hw_params_set_buffer_size_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *min, snd_pcm_uframes_t *max);
+int snd_pcm_hw_params_set_buffer_size_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
+int snd_pcm_hw_params_set_buffer_size_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
+int snd_pcm_hw_params_set_buffer_size_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
+
+int snd_pcm_hw_params_get_tick_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_get_tick_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_get_tick_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_test_tick_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
+int snd_pcm_hw_params_set_tick_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
+int snd_pcm_hw_params_set_tick_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_set_tick_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_set_tick_time_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, int *mindir, unsigned int *max, int *maxdir);
+int snd_pcm_hw_params_set_tick_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_set_tick_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_set_tick_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+
+#endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_HW_PARAMS_API */
+
+int snd_pcm_hw_params_get_min_align(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
+
+/** \} */
+
+/**
+ * \defgroup PCM_SW_Params Software Parameters
+ * \ingroup PCM
+ * See the \ref pcm page for more details.
+ * \{
+ */
+
+size_t snd_pcm_sw_params_sizeof(void);
+/** \hideinitializer
+ * \brief allocate an invalid #snd_pcm_sw_params_t using standard alloca
+ * \param ptr returned pointer
+ */
+#define snd_pcm_sw_params_alloca(ptr) do { assert(ptr); *ptr = (snd_pcm_sw_params_t *) alloca(snd_pcm_sw_params_sizeof()); memset(*ptr, 0, snd_pcm_sw_params_sizeof()); } while (0)
+int snd_pcm_sw_params_malloc(snd_pcm_sw_params_t **ptr);
+void snd_pcm_sw_params_free(snd_pcm_sw_params_t *obj);
+void snd_pcm_sw_params_copy(snd_pcm_sw_params_t *dst, const snd_pcm_sw_params_t *src);
+int snd_pcm_sw_params_get_boundary(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
+
+#if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_SW_PARAMS_API)
+
+int snd_pcm_sw_params_set_tstamp_mode(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_tstamp_t val);
+int snd_pcm_sw_params_get_tstamp_mode(const snd_pcm_sw_params_t *params, snd_pcm_tstamp_t *val);
+int snd_pcm_sw_params_set_sleep_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, unsigned int val);
+int snd_pcm_sw_params_get_sleep_min(const snd_pcm_sw_params_t *params, unsigned int *val);
+int snd_pcm_sw_params_set_avail_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
+int snd_pcm_sw_params_get_avail_min(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
+int snd_pcm_sw_params_set_xfer_align(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
+int snd_pcm_sw_params_get_xfer_align(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
+int snd_pcm_sw_params_set_start_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
+int snd_pcm_sw_params_get_start_threshold(const snd_pcm_sw_params_t *paramsm, snd_pcm_uframes_t *val);
+int snd_pcm_sw_params_set_stop_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
+int snd_pcm_sw_params_get_stop_threshold(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
+int snd_pcm_sw_params_set_silence_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
+int snd_pcm_sw_params_get_silence_threshold(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
+int snd_pcm_sw_params_set_silence_size(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
+int snd_pcm_sw_params_get_silence_size(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
+
+#endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_SW_PARAMS_API */
+
+/** \} */
+
+/* include old API */
+#ifndef ALSA_LIBRARY_BUILD
+#if defined(ALSA_PCM_OLD_HW_PARAMS_API) || defined(ALSA_PCM_OLD_SW_PARAMS_API)
+#include "pcm_old.h"
+#endif
+#endif
+
+/**
+ * \defgroup PCM_Access Access Mask Functions
+ * \ingroup PCM
+ * See the \ref pcm page for more details.
+ * \{
+ */
+
+size_t snd_pcm_access_mask_sizeof(void);
+/** \hideinitializer
+ * \brief allocate an empty #snd_pcm_access_mask_t using standard alloca
+ * \param ptr returned pointer
+ */
+#define snd_pcm_access_mask_alloca(ptr) do { assert(ptr); *ptr = (snd_pcm_access_mask_t *) alloca(snd_pcm_access_mask_sizeof()); memset(*ptr, 0, snd_pcm_access_mask_sizeof()); } while (0)
+int snd_pcm_access_mask_malloc(snd_pcm_access_mask_t **ptr);
+void snd_pcm_access_mask_free(snd_pcm_access_mask_t *obj);
+void snd_pcm_access_mask_copy(snd_pcm_access_mask_t *dst, const snd_pcm_access_mask_t *src);
+void snd_pcm_access_mask_none(snd_pcm_access_mask_t *mask);
+void snd_pcm_access_mask_any(snd_pcm_access_mask_t *mask);
+int snd_pcm_access_mask_test(const snd_pcm_access_mask_t *mask, snd_pcm_access_t val);
+int snd_pcm_access_mask_empty(const snd_pcm_access_mask_t *mask);
+void snd_pcm_access_mask_set(snd_pcm_access_mask_t *mask, snd_pcm_access_t val);
+void snd_pcm_access_mask_reset(snd_pcm_access_mask_t *mask, snd_pcm_access_t val);
+
+/** \} */
+
+/**
+ * \defgroup PCM_Format Format Mask Functions
+ * \ingroup PCM
+ * See the \ref pcm page for more details.
+ * \{
+ */
+
+size_t snd_pcm_format_mask_sizeof(void);
+/** \hideinitializer
+ * \brief allocate an empty #snd_pcm_format_mask_t using standard alloca
+ * \param ptr returned pointer
+ */
+#define snd_pcm_format_mask_alloca(ptr) do { assert(ptr); *ptr = (snd_pcm_format_mask_t *) alloca(snd_pcm_format_mask_sizeof()); memset(*ptr, 0, snd_pcm_format_mask_sizeof()); } while (0)
+int snd_pcm_format_mask_malloc(snd_pcm_format_mask_t **ptr);
+void snd_pcm_format_mask_free(snd_pcm_format_mask_t *obj);
+void snd_pcm_format_mask_copy(snd_pcm_format_mask_t *dst, const snd_pcm_format_mask_t *src);
+void snd_pcm_format_mask_none(snd_pcm_format_mask_t *mask);
+void snd_pcm_format_mask_any(snd_pcm_format_mask_t *mask);
+int snd_pcm_format_mask_test(const snd_pcm_format_mask_t *mask, snd_pcm_format_t val);
+int snd_pcm_format_mask_empty(const snd_pcm_format_mask_t *mask);
+void snd_pcm_format_mask_set(snd_pcm_format_mask_t *mask, snd_pcm_format_t val);
+void snd_pcm_format_mask_reset(snd_pcm_format_mask_t *mask, snd_pcm_format_t val);
+
+/** \} */
+
+/**
+ * \defgroup PCM_SubFormat Subformat Mask Functions
+ * \ingroup PCM
+ * See the \ref pcm page for more details.
+ * \{
+ */
+
+size_t snd_pcm_subformat_mask_sizeof(void);
+/** \hideinitializer
+ * \brief allocate an empty #snd_pcm_subformat_mask_t using standard alloca
+ * \param ptr returned pointer
+ */
+#define snd_pcm_subformat_mask_alloca(ptr) do { assert(ptr); *ptr = (snd_pcm_subformat_mask_t *) alloca(snd_pcm_subformat_mask_sizeof()); memset(*ptr, 0, snd_pcm_subformat_mask_sizeof()); } while (0)
+int snd_pcm_subformat_mask_malloc(snd_pcm_subformat_mask_t **ptr);
+void snd_pcm_subformat_mask_free(snd_pcm_subformat_mask_t *obj);
+void snd_pcm_subformat_mask_copy(snd_pcm_subformat_mask_t *dst, const snd_pcm_subformat_mask_t *src);
+void snd_pcm_subformat_mask_none(snd_pcm_subformat_mask_t *mask);
+void snd_pcm_subformat_mask_any(snd_pcm_subformat_mask_t *mask);
+int snd_pcm_subformat_mask_test(const snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val);
+int snd_pcm_subformat_mask_empty(const snd_pcm_subformat_mask_t *mask);
+void snd_pcm_subformat_mask_set(snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val);
+void snd_pcm_subformat_mask_reset(snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val);
+
+/** \} */
+
+/**
+ * \defgroup PCM_Status Status Functions
+ * \ingroup PCM
+ * See the \ref pcm page for more details.
+ * \{
+ */
+
+size_t snd_pcm_status_sizeof(void);
+/** \hideinitializer
+ * \brief allocate an invalid #snd_pcm_status_t using standard alloca
+ * \param ptr returned pointer
+ */
+#define snd_pcm_status_alloca(ptr) do { assert(ptr); *ptr = (snd_pcm_status_t *) alloca(snd_pcm_status_sizeof()); memset(*ptr, 0, snd_pcm_status_sizeof()); } while (0)
+int snd_pcm_status_malloc(snd_pcm_status_t **ptr);
+void snd_pcm_status_free(snd_pcm_status_t *obj);
+void snd_pcm_status_copy(snd_pcm_status_t *dst, const snd_pcm_status_t *src);
+snd_pcm_state_t snd_pcm_status_get_state(const snd_pcm_status_t *obj);
+void snd_pcm_status_get_trigger_tstamp(const snd_pcm_status_t *obj, snd_timestamp_t *ptr);
+void snd_pcm_status_get_trigger_htstamp(const snd_pcm_status_t *obj, snd_htimestamp_t *ptr);
+void snd_pcm_status_get_tstamp(const snd_pcm_status_t *obj, snd_timestamp_t *ptr);
+void snd_pcm_status_get_htstamp(const snd_pcm_status_t *obj, snd_htimestamp_t *ptr);
+snd_pcm_sframes_t snd_pcm_status_get_delay(const snd_pcm_status_t *obj);
+snd_pcm_uframes_t snd_pcm_status_get_avail(const snd_pcm_status_t *obj);
+snd_pcm_uframes_t snd_pcm_status_get_avail_max(const snd_pcm_status_t *obj);
+snd_pcm_uframes_t snd_pcm_status_get_overrange(const snd_pcm_status_t *obj);
+
+/** \} */
+
+/**
+ * \defgroup PCM_Description Description Functions
+ * \ingroup PCM
+ * See the \ref pcm page for more details.
+ * \{
+ */
+
+const char *snd_pcm_type_name(snd_pcm_type_t type);
+const char *snd_pcm_stream_name(const snd_pcm_stream_t stream);
+const char *snd_pcm_access_name(const snd_pcm_access_t _access);
+const char *snd_pcm_format_name(const snd_pcm_format_t format);
+const char *snd_pcm_format_description(const snd_pcm_format_t format);
+const char *snd_pcm_subformat_name(const snd_pcm_subformat_t subformat);
+const char *snd_pcm_subformat_description(const snd_pcm_subformat_t subformat);
+snd_pcm_format_t snd_pcm_format_value(const char* name);
+const char *snd_pcm_tstamp_mode_name(const snd_pcm_tstamp_t mode);
+const char *snd_pcm_state_name(const snd_pcm_state_t state);
+
+/** \} */
+
+/**
+ * \defgroup PCM_Dump Debug Functions
+ * \ingroup PCM
+ * See the \ref pcm page for more details.
+ * \{
+ */
+
+int snd_pcm_dump(snd_pcm_t *pcm, snd_output_t *out);
+int snd_pcm_dump_hw_setup(snd_pcm_t *pcm, snd_output_t *out);
+int snd_pcm_dump_sw_setup(snd_pcm_t *pcm, snd_output_t *out);
+int snd_pcm_dump_setup(snd_pcm_t *pcm, snd_output_t *out);
+int snd_pcm_hw_params_dump(snd_pcm_hw_params_t *params, snd_output_t *out);
+int snd_pcm_sw_params_dump(snd_pcm_sw_params_t *params, snd_output_t *out);
+int snd_pcm_status_dump(snd_pcm_status_t *status, snd_output_t *out);
+
+/** \} */
+
+/**
+ * \defgroup PCM_Direct Direct Access (MMAP) Functions
+ * \ingroup PCM
+ * See the \ref pcm page for more details.
+ * \{
+ */
+
+int snd_pcm_mmap_begin(snd_pcm_t *pcm,
+ const snd_pcm_channel_area_t **areas,
+ snd_pcm_uframes_t *offset,
+ snd_pcm_uframes_t *frames);
+snd_pcm_sframes_t snd_pcm_mmap_commit(snd_pcm_t *pcm,
+ snd_pcm_uframes_t offset,
+ snd_pcm_uframes_t frames);
+snd_pcm_sframes_t snd_pcm_mmap_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size);
+snd_pcm_sframes_t snd_pcm_mmap_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size);
+snd_pcm_sframes_t snd_pcm_mmap_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
+snd_pcm_sframes_t snd_pcm_mmap_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
+
+/** \} */
+
+/**
+ * \defgroup PCM_Helpers Helper Functions
+ * \ingroup PCM
+ * See the \ref pcm page for more details.
+ * \{
+ */
+
+int snd_pcm_format_signed(snd_pcm_format_t format);
+int snd_pcm_format_unsigned(snd_pcm_format_t format);
+int snd_pcm_format_linear(snd_pcm_format_t format);
+int snd_pcm_format_float(snd_pcm_format_t format);
+int snd_pcm_format_little_endian(snd_pcm_format_t format);
+int snd_pcm_format_big_endian(snd_pcm_format_t format);
+int snd_pcm_format_cpu_endian(snd_pcm_format_t format);
+int snd_pcm_format_width(snd_pcm_format_t format); /* in bits */
+int snd_pcm_format_physical_width(snd_pcm_format_t format); /* in bits */
+snd_pcm_format_t snd_pcm_build_linear_format(int width, int pwidth, int unsignd, int big_endian);
+ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples);
+u_int8_t snd_pcm_format_silence(snd_pcm_format_t format);
+u_int16_t snd_pcm_format_silence_16(snd_pcm_format_t format);
+u_int32_t snd_pcm_format_silence_32(snd_pcm_format_t format);
+u_int64_t snd_pcm_format_silence_64(snd_pcm_format_t format);
+int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int samples);
+
+snd_pcm_sframes_t snd_pcm_bytes_to_frames(snd_pcm_t *pcm, ssize_t bytes);
+ssize_t snd_pcm_frames_to_bytes(snd_pcm_t *pcm, snd_pcm_sframes_t frames);
+long snd_pcm_bytes_to_samples(snd_pcm_t *pcm, ssize_t bytes);
+ssize_t snd_pcm_samples_to_bytes(snd_pcm_t *pcm, long samples);
+
+int snd_pcm_area_silence(const snd_pcm_channel_area_t *dst_channel, snd_pcm_uframes_t dst_offset,
+ unsigned int samples, snd_pcm_format_t format);
+int snd_pcm_areas_silence(const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset,
+ unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format);
+int snd_pcm_area_copy(const snd_pcm_channel_area_t *dst_channel, snd_pcm_uframes_t dst_offset,
+ const snd_pcm_channel_area_t *src_channel, snd_pcm_uframes_t src_offset,
+ unsigned int samples, snd_pcm_format_t format);
+int snd_pcm_areas_copy(const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset,
+ const snd_pcm_channel_area_t *src_channels, snd_pcm_uframes_t src_offset,
+ unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format);
+
+/** \} */
+
+/**
+ * \defgroup PCM_Hook Hook Extension
+ * \ingroup PCM
+ * See the \ref pcm page for more details.
+ * \{
+ */
+
+/** type of pcm hook */
+typedef enum _snd_pcm_hook_type {
+ SND_PCM_HOOK_TYPE_HW_PARAMS = 0,
+ SND_PCM_HOOK_TYPE_HW_FREE,
+ SND_PCM_HOOK_TYPE_CLOSE,
+ SND_PCM_HOOK_TYPE_LAST = SND_PCM_HOOK_TYPE_CLOSE
+} snd_pcm_hook_type_t;
+
+/** PCM hook container */
+typedef struct _snd_pcm_hook snd_pcm_hook_t;
+/** PCM hook callback function */
+typedef int (*snd_pcm_hook_func_t)(snd_pcm_hook_t *hook);
+snd_pcm_t *snd_pcm_hook_get_pcm(snd_pcm_hook_t *hook);
+void *snd_pcm_hook_get_private(snd_pcm_hook_t *hook);
+void snd_pcm_hook_set_private(snd_pcm_hook_t *hook, void *private_data);
+int snd_pcm_hook_add(snd_pcm_hook_t **hookp, snd_pcm_t *pcm,
+ snd_pcm_hook_type_t type,
+ snd_pcm_hook_func_t func, void *private_data);
+int snd_pcm_hook_remove(snd_pcm_hook_t *hook);
+
+/** \} */
+
+/**
+ * \defgroup PCM_Scope Scope Plugin Extension
+ * \ingroup PCM
+ * See the \ref pcm page for more details.
+ * \{
+ */
+
+/** #SND_PCM_TYPE_METER scope functions */
+typedef struct _snd_pcm_scope_ops {
+ /** \brief Enable and prepare it using current params
+ * \param scope scope handle
+ */
+ int (*enable)(snd_pcm_scope_t *scope);
+ /** \brief Disable
+ * \param scope scope handle
+ */
+ void (*disable)(snd_pcm_scope_t *scope);
+ /** \brief PCM has been started
+ * \param scope scope handle
+ */
+ void (*start)(snd_pcm_scope_t *scope);
+ /** \brief PCM has been stopped
+ * \param scope scope handle
+ */
+ void (*stop)(snd_pcm_scope_t *scope);
+ /** \brief New frames are present
+ * \param scope scope handle
+ */
+ void (*update)(snd_pcm_scope_t *scope);
+ /** \brief Reset status
+ * \param scope scope handle
+ */
+ void (*reset)(snd_pcm_scope_t *scope);
+ /** \brief PCM is closing
+ * \param scope scope handle
+ */
+ void (*close)(snd_pcm_scope_t *scope);
+} snd_pcm_scope_ops_t;
+
+snd_pcm_uframes_t snd_pcm_meter_get_bufsize(snd_pcm_t *pcm);
+unsigned int snd_pcm_meter_get_channels(snd_pcm_t *pcm);
+unsigned int snd_pcm_meter_get_rate(snd_pcm_t *pcm);
+snd_pcm_uframes_t snd_pcm_meter_get_now(snd_pcm_t *pcm);
+snd_pcm_uframes_t snd_pcm_meter_get_boundary(snd_pcm_t *pcm);
+int snd_pcm_meter_add_scope(snd_pcm_t *pcm, snd_pcm_scope_t *scope);
+snd_pcm_scope_t *snd_pcm_meter_search_scope(snd_pcm_t *pcm, const char *name);
+int snd_pcm_scope_malloc(snd_pcm_scope_t **ptr);
+void snd_pcm_scope_set_ops(snd_pcm_scope_t *scope, snd_pcm_scope_ops_t *val);
+void snd_pcm_scope_set_name(snd_pcm_scope_t *scope, const char *val);
+const char *snd_pcm_scope_get_name(snd_pcm_scope_t *scope);
+void *snd_pcm_scope_get_callback_private(snd_pcm_scope_t *scope);
+void snd_pcm_scope_set_callback_private(snd_pcm_scope_t *scope, void *val);
+int snd_pcm_scope_s16_open(snd_pcm_t *pcm, const char *name,
+ snd_pcm_scope_t **scopep);
+int16_t *snd_pcm_scope_s16_get_channel_buffer(snd_pcm_scope_t *scope,
+ unsigned int channel);
+
+/** \} */
+
+/**
+ * \defgroup PCM_Simple Simple setup functions
+ * \ingroup PCM
+ * See the \ref pcm page for more details.
+ * \{
+ */
+
+/** Simple PCM latency type */
+typedef enum _snd_spcm_latency {
+ /** standard latency - for standard playback or capture
+ (estimated latency in one direction 350ms) */
+ SND_SPCM_LATENCY_STANDARD = 0,
+ /** medium latency - software phones etc.
+ (estimated latency in one direction maximally 25ms */
+ SND_SPCM_LATENCY_MEDIUM,
+ /** realtime latency - realtime applications (effect processors etc.)
+ (estimated latency in one direction 5ms and better) */
+ SND_SPCM_LATENCY_REALTIME
+} snd_spcm_latency_t;
+
+/** Simple PCM xrun type */
+typedef enum _snd_spcm_xrun_type {
+ /** driver / library will ignore all xruns, the stream runs forever */
+ SND_SPCM_XRUN_IGNORE = 0,
+ /** driver / library stops the stream when an xrun occurs */
+ SND_SPCM_XRUN_STOP
+} snd_spcm_xrun_type_t;
+
+/** Simple PCM duplex type */
+typedef enum _snd_spcm_duplex_type {
+ /** liberal duplex - the buffer and period sizes might not match */
+ SND_SPCM_DUPLEX_LIBERAL = 0,
+ /** pedantic duplex - the buffer and period sizes MUST match */
+ SND_SPCM_DUPLEX_PEDANTIC
+} snd_spcm_duplex_type_t;
+
+int snd_spcm_init(snd_pcm_t *pcm,
+ unsigned int rate,
+ unsigned int channels,
+ snd_pcm_format_t format,
+ snd_pcm_subformat_t subformat,
+ snd_spcm_latency_t latency,
+ snd_pcm_access_t _access,
+ snd_spcm_xrun_type_t xrun_type);
+
+int snd_spcm_init_duplex(snd_pcm_t *playback_pcm,
+ snd_pcm_t *capture_pcm,
+ unsigned int rate,
+ unsigned int channels,
+ snd_pcm_format_t format,
+ snd_pcm_subformat_t subformat,
+ snd_spcm_latency_t latency,
+ snd_pcm_access_t _access,
+ snd_spcm_xrun_type_t xrun_type,
+ snd_spcm_duplex_type_t duplex_type);
+
+int snd_spcm_init_get_params(snd_pcm_t *pcm,
+ unsigned int *rate,
+ snd_pcm_uframes_t *buffer_size,
+ snd_pcm_uframes_t *period_size);
+
+/** \} */
+
+/**
+ * \defgroup PCM_Deprecated Deprecated Functions
+ * \ingroup PCM
+ * See the \ref pcm page for more details.
+ * \{
+ */
+
+/* Deprecated functions, for compatibility */
+const char *snd_pcm_start_mode_name(snd_pcm_start_t mode);
+const char *snd_pcm_xrun_mode_name(snd_pcm_xrun_t mode);
+int snd_pcm_sw_params_set_start_mode(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_start_t val);
+snd_pcm_start_t snd_pcm_sw_params_get_start_mode(const snd_pcm_sw_params_t *params);
+int snd_pcm_sw_params_set_xrun_mode(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_xrun_t val);
+snd_pcm_xrun_t snd_pcm_sw_params_get_xrun_mode(const snd_pcm_sw_params_t *params);
+
+/** \} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __ALSA_PCM_H */
diff --git a/sysroot/usr/include/alsa/pcm_external.h b/sysroot/usr/include/alsa/pcm_external.h
new file mode 100644
index 0000000..5750418
--- /dev/null
+++ b/sysroot/usr/include/alsa/pcm_external.h
@@ -0,0 +1,70 @@
+/**
+ * \file include/pcm_external.h
+ * \brief External PCM plugin SDK
+ * \author Takashi Iwai <tiwai@suse.de>
+ * \date 2005
+ *
+ * Extern PCM plugin SDK.
+ */
+
+/*
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+#ifndef __ALSA_PCM_EXTERNAL_H
+#define __ALSA_PCM_EXTERNAL_H
+
+#include "pcm.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \defgroup Plugin_SDK External PCM plugin SDK
+ * \{
+ */
+
+/**
+ * Define the object entry for external PCM plugins
+ */
+#define SND_PCM_PLUGIN_ENTRY(name) _snd_pcm_##name##_open
+
+/**
+ * Define the symbols of the given plugin with versions
+ */
+#define SND_PCM_PLUGIN_SYMBOL(name) SND_DLSYM_BUILD_VERSION(SND_PCM_PLUGIN_ENTRY(name), SND_PCM_DLSYM_VERSION);
+
+/**
+ * Define the plugin
+ */
+#define SND_PCM_PLUGIN_DEFINE_FUNC(plugin) \
+int SND_PCM_PLUGIN_ENTRY(plugin) (snd_pcm_t **pcmp, const char *name,\
+ snd_config_t *root, snd_config_t *conf, \
+ snd_pcm_stream_t stream, int mode)
+
+#include "pcm_ioplug.h"
+#include "pcm_extplug.h"
+
+int snd_pcm_parse_control_id(snd_config_t *conf, snd_ctl_elem_id_t *ctl_id, int *cardp,
+ int *cchannelsp, int *hwctlp);
+
+/** \} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __ALSA_PCM_EXTERNAL_H */
diff --git a/sysroot/usr/include/alsa/pcm_extplug.h b/sysroot/usr/include/alsa/pcm_extplug.h
new file mode 100644
index 0000000..b14c5be
--- /dev/null
+++ b/sysroot/usr/include/alsa/pcm_extplug.h
@@ -0,0 +1,189 @@
+/**
+ * \file include/pcm_extplug.h
+ * \brief External Filter-Plugin SDK
+ * \author Takashi Iwai <tiwai@suse.de>
+ * \date 2005
+ *
+ * External Filter-Plugin SDK
+ */
+
+/*
+ * ALSA external PCM plugin SDK (draft version)
+ *
+ * Copyright (c) 2005 Takashi Iwai <tiwai@suse.de>
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef __ALSA_PCM_EXTPLUG_H
+#define __ALSA_PCM_EXTPLUG_H
+
+/**
+ * \defgroup PCM_ExtPlug External Filter plugin SDK
+ * \ingroup Plugin_SDK
+ * See the \ref pcm page for more details.
+ * \{
+ */
+
+/** hw constraints for extplug */
+enum {
+ SND_PCM_EXTPLUG_HW_FORMAT, /**< format */
+ SND_PCM_EXTPLUG_HW_CHANNELS, /**< channels */
+ SND_PCM_EXTPLUG_HW_PARAMS /**< max number of hw constraints */
+};
+
+/** Handle of external filter plugin */
+typedef struct snd_pcm_extplug snd_pcm_extplug_t;
+/** Callback table of extplug */
+typedef struct snd_pcm_extplug_callback snd_pcm_extplug_callback_t;
+
+/*
+ * Protocol version
+ */
+#define SND_PCM_EXTPLUG_VERSION_MAJOR 1 /**< Protocol major version */
+#define SND_PCM_EXTPLUG_VERSION_MINOR 0 /**< Protocol minor version */
+#define SND_PCM_EXTPLUG_VERSION_TINY 1 /**< Protocol tiny version */
+/**
+ * Filter-plugin protocol version
+ */
+#define SND_PCM_EXTPLUG_VERSION ((SND_PCM_EXTPLUG_VERSION_MAJOR<<16) |\
+ (SND_PCM_EXTPLUG_VERSION_MINOR<<8) |\
+ (SND_PCM_EXTPLUG_VERSION_TINY))
+
+/** Handle of extplug */
+struct snd_pcm_extplug {
+ /**
+ * protocol version; #SND_PCM_EXTPLUG_VERSION must be filled here
+ * before calling #snd_pcm_extplug_create()
+ */
+ unsigned int version;
+ /**
+ * name of this plugin; must be filled before calling #snd_pcm_extplug_create()
+ */
+ const char *name;
+ /**
+ * callbacks of this plugin; must be filled before calling #snd_pcm_extplug_create()
+ */
+ const snd_pcm_extplug_callback_t *callback;
+ /**
+ * private data, which can be used freely in the driver callbacks
+ */
+ void *private_data;
+ /**
+ * PCM handle filled by #snd_pcm_extplug_create()
+ */
+ snd_pcm_t *pcm;
+ /**
+ * stream direction; read-only status
+ */
+ snd_pcm_stream_t stream;
+ /**
+ * format hw parameter; filled after hw_params is caled
+ */
+ snd_pcm_format_t format;
+ /**
+ * subformat hw parameter; filled after hw_params is caled
+ */
+ snd_pcm_subformat_t subformat;
+ /**
+ * channels hw parameter; filled after hw_params is caled
+ */
+ unsigned int channels;
+ /**
+ * rate hw parameter; filled after hw_params is caled
+ */
+ unsigned int rate;
+ /**
+ * slave_format hw parameter; filled after hw_params is caled
+ */
+ snd_pcm_format_t slave_format;
+ /**
+ * slave_subformat hw parameter; filled after hw_params is caled
+ */
+ snd_pcm_subformat_t slave_subformat;
+ /**
+ * slave_channels hw parameter; filled after hw_params is caled
+ */
+ unsigned int slave_channels;
+};
+
+/** Callback table of extplug */
+struct snd_pcm_extplug_callback {
+ /**
+ * transfer between source and destination; this is a required callback
+ */
+ snd_pcm_sframes_t (*transfer)(snd_pcm_extplug_t *ext,
+ const snd_pcm_channel_area_t *dst_areas,
+ snd_pcm_uframes_t dst_offset,
+ const snd_pcm_channel_area_t *src_areas,
+ snd_pcm_uframes_t src_offset,
+ snd_pcm_uframes_t size);
+ /**
+ * close the PCM; optional
+ */
+ int (*close)(snd_pcm_extplug_t *ext);
+ /**
+ * hw_params; optional
+ */
+ int (*hw_params)(snd_pcm_extplug_t *ext, snd_pcm_hw_params_t *params);
+ /**
+ * hw_free; optional
+ */
+ int (*hw_free)(snd_pcm_extplug_t *ext);
+ /**
+ * dump; optional
+ */
+ void (*dump)(snd_pcm_extplug_t *ext, snd_output_t *out);
+ /**
+ * init; optional initialization called at prepare or reset
+ */
+ int (*init)(snd_pcm_extplug_t *ext);
+};
+
+
+int snd_pcm_extplug_create(snd_pcm_extplug_t *ext, const char *name,
+ snd_config_t *root, snd_config_t *slave_conf,
+ snd_pcm_stream_t stream, int mode);
+int snd_pcm_extplug_delete(snd_pcm_extplug_t *ext);
+
+/* clear hw_parameter setting */
+void snd_pcm_extplug_params_reset(snd_pcm_extplug_t *ext);
+
+/* hw_parameter setting */
+int snd_pcm_extplug_set_param_list(snd_pcm_extplug_t *extplug, int type, unsigned int num_list, const unsigned int *list);
+int snd_pcm_extplug_set_param_minmax(snd_pcm_extplug_t *extplug, int type, unsigned int min, unsigned int max);
+int snd_pcm_extplug_set_slave_param_list(snd_pcm_extplug_t *extplug, int type, unsigned int num_list, const unsigned int *list);
+int snd_pcm_extplug_set_slave_param_minmax(snd_pcm_extplug_t *extplug, int type, unsigned int min, unsigned int max);
+
+/**
+ * set the parameter constraint with a single value
+ */
+static inline int snd_pcm_extplug_set_param(snd_pcm_extplug_t *extplug, int type, unsigned int val)
+{
+ return snd_pcm_extplug_set_param_list(extplug, type, 1, &val);
+}
+
+/**
+ * set the parameter constraint for slave PCM with a single value
+ */
+static inline int snd_pcm_extplug_set_slave_param(snd_pcm_extplug_t *extplug, int type, unsigned int val)
+{
+ return snd_pcm_extplug_set_slave_param_list(extplug, type, 1, &val);
+}
+
+/** \} */
+
+#endif /* __ALSA_PCM_EXTPLUG_H */
diff --git a/sysroot/usr/include/alsa/pcm_ioplug.h b/sysroot/usr/include/alsa/pcm_ioplug.h
new file mode 100644
index 0000000..f8a23f6
--- /dev/null
+++ b/sysroot/usr/include/alsa/pcm_ioplug.h
@@ -0,0 +1,213 @@
+/**
+ * \file include/pcm_ioplug.h
+ * \brief External I/O-Plugin SDK
+ * \author Takashi Iwai <tiwai@suse.de>
+ * \date 2005
+ *
+ * External I/O-Plugin SDK
+ */
+
+/*
+ * ALSA external PCM plugin SDK
+ *
+ * Copyright (c) 2005 Takashi Iwai <tiwai@suse.de>
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef __ALSA_PCM_IOPLUG_H
+#define __ALSA_PCM_IOPLUG_H
+
+/**
+ * \defgroup PCM_IOPlug External I/O plugin SDK
+ * \ingroup Plugin_SDK
+ * See the \ref pcm page for more details.
+ * \{
+ */
+
+/** hw constraints for ioplug */
+enum {
+ SND_PCM_IOPLUG_HW_ACCESS = 0, /**< access type */
+ SND_PCM_IOPLUG_HW_FORMAT, /**< format */
+ SND_PCM_IOPLUG_HW_CHANNELS, /**< channels */
+ SND_PCM_IOPLUG_HW_RATE, /**< rate */
+ SND_PCM_IOPLUG_HW_PERIOD_BYTES, /**< period bytes */
+ SND_PCM_IOPLUG_HW_BUFFER_BYTES, /**< buffer bytes */
+ SND_PCM_IOPLUG_HW_PERIODS, /**< number of periods */
+ SND_PCM_IOPLUG_HW_PARAMS /**< max number of hw constraints */
+};
+
+/** I/O plugin handle */
+typedef struct snd_pcm_ioplug snd_pcm_ioplug_t;
+/** Callback table of ioplug */
+typedef struct snd_pcm_ioplug_callback snd_pcm_ioplug_callback_t;
+
+/**
+ * bit flags for additional conditions
+ */
+#define SND_PCM_IOPLUG_FLAG_LISTED (1<<0) /* list up this PCM */
+
+/*
+ * Protocol version
+ */
+#define SND_PCM_IOPLUG_VERSION_MAJOR 1 /**< Protocol major version */
+#define SND_PCM_IOPLUG_VERSION_MINOR 0 /**< Protocol minor version */
+#define SND_PCM_IOPLUG_VERSION_TINY 1 /**< Protocol tiny version */
+/**
+ * IO-plugin protocol version
+ */
+#define SND_PCM_IOPLUG_VERSION ((SND_PCM_IOPLUG_VERSION_MAJOR<<16) |\
+ (SND_PCM_IOPLUG_VERSION_MINOR<<8) |\
+ (SND_PCM_IOPLUG_VERSION_TINY))
+
+/** Handle of ioplug */
+struct snd_pcm_ioplug {
+ /**
+ * protocol version; #SND_PCM_IOPLUG_VERSION must be filled here
+ * before calling #snd_pcm_ioplug_create()
+ */
+ unsigned int version;
+ /**
+ * name of this plugin; must be filled before calling #snd_pcm_ioplug_create()
+ */
+ const char *name;
+ unsigned int flags; /**< SND_PCM_IOPLUG_FLAG_XXX */
+ int poll_fd; /**< poll file descriptor */
+ unsigned int poll_events; /**< poll events */
+ unsigned int mmap_rw; /**< pseudo mmap mode */
+ /**
+ * callbacks of this plugin; must be filled before calling #snd_pcm_ioplug_create()
+ */
+ const snd_pcm_ioplug_callback_t *callback;
+ /**
+ * private data, which can be used freely in the driver callbacks
+ */
+ void *private_data;
+ /**
+ * PCM handle filled by #snd_pcm_extplug_create()
+ */
+ snd_pcm_t *pcm;
+
+ snd_pcm_stream_t stream; /**< stream direcion; read-only */
+ snd_pcm_state_t state; /**< current PCM state; read-only */
+ volatile snd_pcm_uframes_t appl_ptr; /**< application pointer; read-only */
+ volatile snd_pcm_uframes_t hw_ptr; /**< hw pointer; read-only */
+ int nonblock; /**< non-block mode; read-only */
+
+ snd_pcm_access_t access; /**< access type; filled after hw_params is called */
+ snd_pcm_format_t format; /**< PCM format; filled after hw_params is called */
+ unsigned int channels; /**< number of channels; filled after hw_params is called */
+ unsigned int rate; /**< rate; filled after hw_params is called */
+ snd_pcm_uframes_t period_size; /**< period size; filled after hw_params is called */
+ snd_pcm_uframes_t buffer_size; /**< buffer size; filled after hw_params is called */
+};
+
+/** Callback table of ioplug */
+struct snd_pcm_ioplug_callback {
+ /**
+ * start the PCM; required
+ */
+ int (*start)(snd_pcm_ioplug_t *io);
+ /**
+ * stop the PCM; required
+ */
+ int (*stop)(snd_pcm_ioplug_t *io);
+ /**
+ * get the current DMA position; required
+ */
+ snd_pcm_sframes_t (*pointer)(snd_pcm_ioplug_t *io);
+ /**
+ * transfer the data; optional
+ */
+ snd_pcm_sframes_t (*transfer)(snd_pcm_ioplug_t *io,
+ const snd_pcm_channel_area_t *areas,
+ snd_pcm_uframes_t offset,
+ snd_pcm_uframes_t size);
+ /**
+ * close the PCM; optional
+ */
+ int (*close)(snd_pcm_ioplug_t *io);
+ /**
+ * hw_params; optional
+ */
+ int (*hw_params)(snd_pcm_ioplug_t *io, snd_pcm_hw_params_t *params);
+ /**
+ * hw_free; optional
+ */
+ int (*hw_free)(snd_pcm_ioplug_t *io);
+ /**
+ * sw_params; optional
+ */
+ int (*sw_params)(snd_pcm_ioplug_t *io, snd_pcm_sw_params_t *params);
+ /**
+ * prepare; optional
+ */
+ int (*prepare)(snd_pcm_ioplug_t *io);
+ /**
+ * drain; optional
+ */
+ int (*drain)(snd_pcm_ioplug_t *io);
+ /**
+ * toggle pause; optional
+ */
+ int (*pause)(snd_pcm_ioplug_t *io, int enable);
+ /**
+ * resume; optional
+ */
+ int (*resume)(snd_pcm_ioplug_t *io);
+ /**
+ * poll descriptors count; optional
+ */
+ int (*poll_descriptors_count)(snd_pcm_ioplug_t *io);
+ /**
+ * poll descriptors; optional
+ */
+ int (*poll_descriptors)(snd_pcm_ioplug_t *io, struct pollfd *pfd, unsigned int space);
+ /**
+ * mangle poll events; optional
+ */
+ int (*poll_revents)(snd_pcm_ioplug_t *io, struct pollfd *pfd, unsigned int nfds, unsigned short *revents);
+ /**
+ * dump; optional
+ */
+ void (*dump)(snd_pcm_ioplug_t *io, snd_output_t *out);
+ /**
+ * get the delay for the running PCM; optional
+ */
+ int (*delay)(snd_pcm_ioplug_t *io, snd_pcm_sframes_t *delayp);
+};
+
+
+int snd_pcm_ioplug_create(snd_pcm_ioplug_t *io, const char *name,
+ snd_pcm_stream_t stream, int mode);
+int snd_pcm_ioplug_delete(snd_pcm_ioplug_t *io);
+
+/* update poll_fd and mmap_rw */
+int snd_pcm_ioplug_reinit_status(snd_pcm_ioplug_t *ioplug);
+
+/* get a mmap area (for mmap_rw only) */
+const snd_pcm_channel_area_t *snd_pcm_ioplug_mmap_areas(snd_pcm_ioplug_t *ioplug);
+
+/* clear hw_parameter setting */
+void snd_pcm_ioplug_params_reset(snd_pcm_ioplug_t *io);
+
+/* hw_parameter setting */
+int snd_pcm_ioplug_set_param_minmax(snd_pcm_ioplug_t *io, int type, unsigned int min, unsigned int max);
+int snd_pcm_ioplug_set_param_list(snd_pcm_ioplug_t *io, int type, unsigned int num_list, const unsigned int *list);
+
+/** \} */
+
+#endif /* __ALSA_PCM_IOPLUG_H */
diff --git a/sysroot/usr/include/alsa/pcm_old.h b/sysroot/usr/include/alsa/pcm_old.h
new file mode 100644
index 0000000..f0de4c3
--- /dev/null
+++ b/sysroot/usr/include/alsa/pcm_old.h
@@ -0,0 +1,230 @@
+/*
+ * Old ALSA 0.9.x API
+ */
+
+#ifdef ALSA_PCM_OLD_HW_PARAMS_API
+
+asm(".symver snd_pcm_hw_params_get_access,snd_pcm_hw_params_get_access@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_set_access_first,snd_pcm_hw_params_set_access_first@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_set_access_last,snd_pcm_hw_params_set_access_last@ALSA_0.9");
+
+int snd_pcm_hw_params_get_access(const snd_pcm_hw_params_t *params);
+int snd_pcm_hw_params_test_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t val);
+int snd_pcm_hw_params_set_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t val);
+snd_pcm_access_t snd_pcm_hw_params_set_access_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
+snd_pcm_access_t snd_pcm_hw_params_set_access_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
+int snd_pcm_hw_params_set_access_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_mask_t *mask);
+void snd_pcm_hw_params_get_access_mask(snd_pcm_hw_params_t *params, snd_pcm_access_mask_t *mask);
+
+asm(".symver snd_pcm_hw_params_get_format,snd_pcm_hw_params_get_format@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_set_format_first,snd_pcm_hw_params_set_format_first@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_set_format_last,snd_pcm_hw_params_set_format_last@ALSA_0.9");
+
+int snd_pcm_hw_params_get_format(const snd_pcm_hw_params_t *params);
+int snd_pcm_hw_params_test_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val);
+int snd_pcm_hw_params_set_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val);
+snd_pcm_format_t snd_pcm_hw_params_set_format_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
+snd_pcm_format_t snd_pcm_hw_params_set_format_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
+int snd_pcm_hw_params_set_format_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_mask_t *mask);
+void snd_pcm_hw_params_get_format_mask(snd_pcm_hw_params_t *params, snd_pcm_format_mask_t *mask);
+
+asm(".symver snd_pcm_hw_params_get_subformat,snd_pcm_hw_params_get_subformat@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_set_subformat_first,snd_pcm_hw_params_set_subformat_first@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_set_subformat_last,snd_pcm_hw_params_set_subformat_last@ALSA_0.9");
+
+int snd_pcm_hw_params_test_subformat(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t val);
+int snd_pcm_hw_params_get_subformat(const snd_pcm_hw_params_t *params);
+int snd_pcm_hw_params_set_subformat(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t val);
+snd_pcm_subformat_t snd_pcm_hw_params_set_subformat_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
+snd_pcm_subformat_t snd_pcm_hw_params_set_subformat_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
+int snd_pcm_hw_params_set_subformat_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_mask_t *mask);
+void snd_pcm_hw_params_get_subformat_mask(snd_pcm_hw_params_t *params, snd_pcm_subformat_mask_t *mask);
+
+asm(".symver snd_pcm_hw_params_get_channels,snd_pcm_hw_params_get_channels@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_get_channels_min,snd_pcm_hw_params_get_channels_min@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_get_channels_max,snd_pcm_hw_params_get_channels_max@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_set_channels_near,snd_pcm_hw_params_set_channels_near@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_set_channels_first,snd_pcm_hw_params_set_channels_first@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_set_channels_last,snd_pcm_hw_params_set_channels_last@ALSA_0.9");
+
+int snd_pcm_hw_params_get_channels(const snd_pcm_hw_params_t *params);
+unsigned int snd_pcm_hw_params_get_channels_min(const snd_pcm_hw_params_t *params);
+unsigned int snd_pcm_hw_params_get_channels_max(const snd_pcm_hw_params_t *params);
+int snd_pcm_hw_params_test_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
+int snd_pcm_hw_params_set_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
+int snd_pcm_hw_params_set_channels_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
+int snd_pcm_hw_params_set_channels_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
+int snd_pcm_hw_params_set_channels_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, unsigned int *max);
+unsigned int snd_pcm_hw_params_set_channels_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
+unsigned int snd_pcm_hw_params_set_channels_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
+unsigned int snd_pcm_hw_params_set_channels_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
+
+asm(".symver snd_pcm_hw_params_get_rate,snd_pcm_hw_params_get_rate@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_get_rate_min,snd_pcm_hw_params_get_rate_min@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_get_rate_max,snd_pcm_hw_params_get_rate_max@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_set_rate_near,snd_pcm_hw_params_set_rate_near@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_set_rate_first,snd_pcm_hw_params_set_rate_first@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_set_rate_last,snd_pcm_hw_params_set_rate_last@ALSA_0.9");
+
+int snd_pcm_hw_params_get_rate(const snd_pcm_hw_params_t *params, int *dir);
+unsigned int snd_pcm_hw_params_get_rate_min(const snd_pcm_hw_params_t *params, int *dir);
+unsigned int snd_pcm_hw_params_get_rate_max(const snd_pcm_hw_params_t *params, int *dir);
+int snd_pcm_hw_params_test_rate(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
+int snd_pcm_hw_params_set_rate(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
+int snd_pcm_hw_params_set_rate_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_set_rate_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_set_rate_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, int *mindir, unsigned int *max, int *maxdir);
+unsigned int snd_pcm_hw_params_set_rate_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int *dir);
+unsigned int snd_pcm_hw_params_set_rate_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir);
+unsigned int snd_pcm_hw_params_set_rate_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir);
+int snd_pcm_hw_params_set_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
+int snd_pcm_hw_params_get_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
+
+asm(".symver snd_pcm_hw_params_get_period_time,snd_pcm_hw_params_get_period_time@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_get_period_time_min,snd_pcm_hw_params_get_period_time_min@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_get_period_time_max,snd_pcm_hw_params_get_period_time_max@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_set_period_time_near,snd_pcm_hw_params_set_period_time_near@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_set_period_time_first,snd_pcm_hw_params_set_period_time_first@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_set_period_time_last,snd_pcm_hw_params_set_period_time_last@ALSA_0.9");
+
+int snd_pcm_hw_params_get_period_time(const snd_pcm_hw_params_t *params, int *dir);
+unsigned int snd_pcm_hw_params_get_period_time_min(const snd_pcm_hw_params_t *params, int *dir);
+unsigned int snd_pcm_hw_params_get_period_time_max(const snd_pcm_hw_params_t *params, int *dir);
+int snd_pcm_hw_params_test_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
+int snd_pcm_hw_params_set_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
+int snd_pcm_hw_params_set_period_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_set_period_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_set_period_time_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, int *mindir, unsigned int *max, int *maxdir);
+unsigned int snd_pcm_hw_params_set_period_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int *dir);
+unsigned int snd_pcm_hw_params_set_period_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir);
+unsigned int snd_pcm_hw_params_set_period_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir);
+
+asm(".symver snd_pcm_hw_params_get_period_size,snd_pcm_hw_params_get_period_size@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_get_period_size_min,snd_pcm_hw_params_get_period_size_min@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_get_period_size_max,snd_pcm_hw_params_get_period_size_max@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_set_period_size_near,snd_pcm_hw_params_set_period_size_near@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_set_period_size_first,snd_pcm_hw_params_set_period_size_first@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_set_period_size_last,snd_pcm_hw_params_set_period_size_last@ALSA_0.9");
+
+snd_pcm_sframes_t snd_pcm_hw_params_get_period_size(const snd_pcm_hw_params_t *params, int *dir);
+snd_pcm_uframes_t snd_pcm_hw_params_get_period_size_min(const snd_pcm_hw_params_t *params, int *dir);
+snd_pcm_uframes_t snd_pcm_hw_params_get_period_size_max(const snd_pcm_hw_params_t *params, int *dir);
+int snd_pcm_hw_params_test_period_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val, int dir);
+int snd_pcm_hw_params_set_period_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val, int dir);
+int snd_pcm_hw_params_set_period_size_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val, int *dir);
+int snd_pcm_hw_params_set_period_size_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val, int *dir);
+int snd_pcm_hw_params_set_period_size_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *min, int *mindir, snd_pcm_uframes_t *max, int *maxdir);
+snd_pcm_uframes_t snd_pcm_hw_params_set_period_size_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val, int *dir);
+snd_pcm_uframes_t snd_pcm_hw_params_set_period_size_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir);
+snd_pcm_uframes_t snd_pcm_hw_params_set_period_size_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir);
+int snd_pcm_hw_params_set_period_size_integer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
+
+asm(".symver snd_pcm_hw_params_get_periods,snd_pcm_hw_params_get_periods@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_get_periods_min,snd_pcm_hw_params_get_periods_min@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_get_periods_max,snd_pcm_hw_params_get_periods_max@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_set_periods_near,snd_pcm_hw_params_set_periods_near@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_set_periods_first,snd_pcm_hw_params_set_periods_first@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_set_periods_last,snd_pcm_hw_params_set_periods_last@ALSA_0.9");
+
+int snd_pcm_hw_params_get_periods(const snd_pcm_hw_params_t *params, int *dir);
+unsigned int snd_pcm_hw_params_get_periods_min(const snd_pcm_hw_params_t *params, int *dir);
+unsigned int snd_pcm_hw_params_get_periods_max(const snd_pcm_hw_params_t *params, int *dir);
+int snd_pcm_hw_params_test_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
+int snd_pcm_hw_params_set_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
+int snd_pcm_hw_params_set_periods_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_set_periods_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_set_periods_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, int *mindir, unsigned int *max, int *maxdir);
+unsigned int snd_pcm_hw_params_set_periods_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int *dir);
+unsigned int snd_pcm_hw_params_set_periods_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir);
+unsigned int snd_pcm_hw_params_set_periods_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir);
+int snd_pcm_hw_params_set_periods_integer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
+
+asm(".symver snd_pcm_hw_params_get_buffer_time,snd_pcm_hw_params_get_buffer_time@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_get_buffer_time_min,snd_pcm_hw_params_get_buffer_time_min@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_get_buffer_time_max,snd_pcm_hw_params_get_buffer_time_max@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_set_buffer_time_near,snd_pcm_hw_params_set_buffer_time_near@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_set_buffer_time_first,snd_pcm_hw_params_set_buffer_time_first@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_set_buffer_time_last,snd_pcm_hw_params_set_buffer_time_last@ALSA_0.9");
+
+int snd_pcm_hw_params_get_buffer_time(const snd_pcm_hw_params_t *params, int *dir);
+unsigned int snd_pcm_hw_params_get_buffer_time_min(const snd_pcm_hw_params_t *params, int *dir);
+unsigned int snd_pcm_hw_params_get_buffer_time_max(const snd_pcm_hw_params_t *params, int *dir);
+int snd_pcm_hw_params_test_buffer_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
+int snd_pcm_hw_params_set_buffer_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
+int snd_pcm_hw_params_set_buffer_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_set_buffer_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_set_buffer_time_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, int *mindir, unsigned int *max, int *maxdir);
+unsigned int snd_pcm_hw_params_set_buffer_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int *dir);
+unsigned int snd_pcm_hw_params_set_buffer_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir);
+unsigned int snd_pcm_hw_params_set_buffer_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir);
+
+asm(".symver snd_pcm_hw_params_get_buffer_size,snd_pcm_hw_params_get_buffer_size@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_get_buffer_size_min,snd_pcm_hw_params_get_buffer_size_min@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_get_buffer_size_max,snd_pcm_hw_params_get_buffer_size_max@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_set_buffer_size_near,snd_pcm_hw_params_set_buffer_size_near@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_set_buffer_size_first,snd_pcm_hw_params_set_buffer_size_first@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_set_buffer_size_last,snd_pcm_hw_params_set_buffer_size_last@ALSA_0.9");
+
+snd_pcm_sframes_t snd_pcm_hw_params_get_buffer_size(const snd_pcm_hw_params_t *params);
+snd_pcm_uframes_t snd_pcm_hw_params_get_buffer_size_min(const snd_pcm_hw_params_t *params);
+snd_pcm_uframes_t snd_pcm_hw_params_get_buffer_size_max(const snd_pcm_hw_params_t *params);
+int snd_pcm_hw_params_test_buffer_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val);
+int snd_pcm_hw_params_set_buffer_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val);
+int snd_pcm_hw_params_set_buffer_size_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
+int snd_pcm_hw_params_set_buffer_size_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
+int snd_pcm_hw_params_set_buffer_size_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *min, snd_pcm_uframes_t *max);
+snd_pcm_uframes_t snd_pcm_hw_params_set_buffer_size_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val);
+snd_pcm_uframes_t snd_pcm_hw_params_set_buffer_size_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
+snd_pcm_uframes_t snd_pcm_hw_params_set_buffer_size_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
+
+asm(".symver snd_pcm_hw_params_get_tick_time,snd_pcm_hw_params_get_tick_time@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_get_tick_time_min,snd_pcm_hw_params_get_tick_time_min@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_get_tick_time_max,snd_pcm_hw_params_get_tick_time_max@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_set_tick_time_near,snd_pcm_hw_params_set_tick_time_near@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_set_tick_time_first,snd_pcm_hw_params_set_tick_time_first@ALSA_0.9");
+asm(".symver snd_pcm_hw_params_set_tick_time_last,snd_pcm_hw_params_set_tick_time_last@ALSA_0.9");
+
+int snd_pcm_hw_params_get_tick_time(const snd_pcm_hw_params_t *params, int *dir);
+unsigned int snd_pcm_hw_params_get_tick_time_min(const snd_pcm_hw_params_t *params, int *dir);
+unsigned int snd_pcm_hw_params_get_tick_time_max(const snd_pcm_hw_params_t *params, int *dir);
+int snd_pcm_hw_params_test_tick_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
+int snd_pcm_hw_params_set_tick_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
+int snd_pcm_hw_params_set_tick_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_set_tick_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+int snd_pcm_hw_params_set_tick_time_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, int *mindir, unsigned int *max, int *maxdir);
+unsigned int snd_pcm_hw_params_set_tick_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int *dir);
+unsigned int snd_pcm_hw_params_set_tick_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir);
+unsigned int snd_pcm_hw_params_set_tick_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir);
+
+#endif /* ALSA_PCM_OLD_HW_PARAMS_API */
+
+
+#ifdef ALSA_PCM_OLD_SW_PARAMS_API
+
+asm(".symver snd_pcm_sw_params_get_tstamp_mode,snd_pcm_sw_params_get_tstamp_mode@ALSA_0.9");
+asm(".symver snd_pcm_sw_params_get_sleep_min,snd_pcm_sw_params_get_sleep_min@ALSA_0.9");
+asm(".symver snd_pcm_sw_params_get_avail_min,snd_pcm_sw_params_get_avail_min@ALSA_0.9");
+asm(".symver snd_pcm_sw_params_get_xfer_align,snd_pcm_sw_params_get_xfer_align@ALSA_0.9");
+asm(".symver snd_pcm_sw_params_get_start_threshold,snd_pcm_sw_params_get_start_threshold@ALSA_0.9");
+asm(".symver snd_pcm_sw_params_get_stop_threshold,snd_pcm_sw_params_set_stop_threshold@ALSA_0.9");
+asm(".symver snd_pcm_sw_params_get_silence_threshold,snd_pcm_sw_params_get_silence_threshold@ALSA_0.9");
+asm(".symver snd_pcm_sw_params_get_silence_size,snd_pcm_sw_params_get_silence_size@ALSA_0.9");
+
+int snd_pcm_sw_params_set_tstamp_mode(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_tstamp_t val);
+snd_pcm_tstamp_t snd_pcm_sw_params_get_tstamp_mode(const snd_pcm_sw_params_t *params);
+int snd_pcm_sw_params_set_sleep_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, unsigned int val);
+unsigned int snd_pcm_sw_params_get_sleep_min(const snd_pcm_sw_params_t *params);
+int snd_pcm_sw_params_set_avail_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
+snd_pcm_uframes_t snd_pcm_sw_params_get_avail_min(const snd_pcm_sw_params_t *params);
+int snd_pcm_sw_params_set_xfer_align(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
+snd_pcm_uframes_t snd_pcm_sw_params_get_xfer_align(const snd_pcm_sw_params_t *params);
+int snd_pcm_sw_params_set_start_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
+snd_pcm_uframes_t snd_pcm_sw_params_get_start_threshold(const snd_pcm_sw_params_t *params);
+int snd_pcm_sw_params_set_stop_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
+snd_pcm_uframes_t snd_pcm_sw_params_get_stop_threshold(const snd_pcm_sw_params_t *params);
+int snd_pcm_sw_params_set_silence_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
+snd_pcm_uframes_t snd_pcm_sw_params_get_silence_threshold(const snd_pcm_sw_params_t *params);
+int snd_pcm_sw_params_set_silence_size(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
+snd_pcm_uframes_t snd_pcm_sw_params_get_silence_size(const snd_pcm_sw_params_t *params);
+
+#endif /* ALSA_PCM_OLD_SW_PARAMS_API */
diff --git a/sysroot/usr/include/alsa/pcm_plugin.h b/sysroot/usr/include/alsa/pcm_plugin.h
new file mode 100644
index 0000000..eea1d82
--- /dev/null
+++ b/sysroot/usr/include/alsa/pcm_plugin.h
@@ -0,0 +1,202 @@
+/**
+ * \file include/pcm_plugin.h
+ * \brief Common PCM plugin code
+ * \author Abramo Bagnara <abramo@alsa-project.org>
+ * \author Jaroslav Kysela <perex@perex.cz>
+ * \date 2000-2001
+ *
+ * Application interface library for the ALSA driver.
+ * See the \ref pcm_plugins page for more details.
+ *
+ * \warning Using of contents of this header file might be dangerous
+ * in the sense of compatibility reasons. The contents might be
+ * freely changed in future.
+ */
+/*
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef __ALSA_PCM_PLUGIN_H
+
+/**
+ * \defgroup PCM_Plugins PCM Plugins
+ * \ingroup PCM
+ * See the \ref pcm_plugins page for more details.
+ * \{
+ */
+
+#define SND_PCM_PLUGIN_RATE_MIN 4000 /**< minimal rate for the rate plugin */
+#define SND_PCM_PLUGIN_RATE_MAX 192000 /**< maximal rate for the rate plugin */
+
+/* ROUTE_FLOAT should be set to 0 for machines without FP unit - like iPAQ */
+#ifdef HAVE_SOFT_FLOAT
+#define SND_PCM_PLUGIN_ROUTE_FLOAT 0 /**< use integers for route plugin */
+#else
+#define SND_PCM_PLUGIN_ROUTE_FLOAT 1 /**< use floats for route plugin */
+#endif
+
+#define SND_PCM_PLUGIN_ROUTE_RESOLUTION 16 /**< integer resolution for route plugin */
+
+#if SND_PCM_PLUGIN_ROUTE_FLOAT
+/** route ttable entry type */
+typedef float snd_pcm_route_ttable_entry_t;
+#define SND_PCM_PLUGIN_ROUTE_HALF 0.5 /**< half value */
+#define SND_PCM_PLUGIN_ROUTE_FULL 1.0 /**< full value */
+#else
+/** route ttable entry type */
+typedef int snd_pcm_route_ttable_entry_t;
+#define SND_PCM_PLUGIN_ROUTE_HALF (SND_PCM_PLUGIN_ROUTE_RESOLUTION / 2) /**< half value */
+#define SND_PCM_PLUGIN_ROUTE_FULL SND_PCM_PLUGIN_ROUTE_RESOLUTION /**< full value */
+#endif
+
+/*
+ * Hardware plugin
+ */
+int snd_pcm_hw_open(snd_pcm_t **pcmp, const char *name,
+ int card, int device, int subdevice,
+ snd_pcm_stream_t stream, int mode,
+ int mmap_emulation, int sync_ptr_ioctl);
+int _snd_pcm_hw_open(snd_pcm_t **pcmp, const char *name,
+ snd_config_t *root ATTRIBUTE_UNUSED, snd_config_t *conf,
+ snd_pcm_stream_t stream, int mode);
+
+/*
+ * Copy plugin
+ */
+int snd_pcm_copy_open(snd_pcm_t **pcmp, const char *name,
+ snd_pcm_t *slave, int close_slave);
+int _snd_pcm_copy_open(snd_pcm_t **pcmp, const char *name,
+ snd_config_t *root, snd_config_t *conf,
+ snd_pcm_stream_t stream, int mode);
+
+/*
+ * Linear conversion plugin
+ */
+int snd_pcm_linear_open(snd_pcm_t **pcmp, const char *name,
+ snd_pcm_format_t sformat, snd_pcm_t *slave,
+ int close_slave);
+int _snd_pcm_linear_open(snd_pcm_t **pcmp, const char *name,
+ snd_config_t *root, snd_config_t *conf,
+ snd_pcm_stream_t stream, int mode);
+
+/*
+ * Linear<->Float conversion plugin
+ */
+int snd_pcm_lfloat_open(snd_pcm_t **pcmp, const char *name,
+ snd_pcm_format_t sformat, snd_pcm_t *slave,
+ int close_slave);
+int _snd_pcm_lfloat_open(snd_pcm_t **pcmp, const char *name,
+ snd_config_t *root, snd_config_t *conf,
+ snd_pcm_stream_t stream, int mode);
+
+/*
+ * Linear<->mu-Law conversion plugin
+ */
+int snd_pcm_mulaw_open(snd_pcm_t **pcmp, const char *name,
+ snd_pcm_format_t sformat, snd_pcm_t *slave,
+ int close_slave);
+int _snd_pcm_mulaw_open(snd_pcm_t **pcmp, const char *name,
+ snd_config_t *root, snd_config_t *conf,
+ snd_pcm_stream_t stream, int mode);
+
+/*
+ * Linear<->a-Law conversion plugin
+ */
+int snd_pcm_alaw_open(snd_pcm_t **pcmp, const char *name,
+ snd_pcm_format_t sformat, snd_pcm_t *slave,
+ int close_slave);
+int _snd_pcm_alaw_open(snd_pcm_t **pcmp, const char *name,
+ snd_config_t *root, snd_config_t *conf,
+ snd_pcm_stream_t stream, int mode);
+
+/*
+ * Linear<->Ima-ADPCM conversion plugin
+ */
+int snd_pcm_adpcm_open(snd_pcm_t **pcmp, const char *name,
+ snd_pcm_format_t sformat, snd_pcm_t *slave,
+ int close_slave);
+int _snd_pcm_adpcm_open(snd_pcm_t **pcmp, const char *name,
+ snd_config_t *root, snd_config_t *conf,
+ snd_pcm_stream_t stream, int mode);
+
+/*
+ * Route plugin for linear formats
+ */
+int snd_pcm_route_load_ttable(snd_config_t *tt, snd_pcm_route_ttable_entry_t *ttable,
+ unsigned int tt_csize, unsigned int tt_ssize,
+ unsigned int *tt_cused, unsigned int *tt_sused,
+ int schannels);
+int snd_pcm_route_determine_ttable(snd_config_t *tt,
+ unsigned int *tt_csize,
+ unsigned int *tt_ssize);
+int snd_pcm_route_open(snd_pcm_t **pcmp, const char *name,
+ snd_pcm_format_t sformat, int schannels,
+ snd_pcm_route_ttable_entry_t *ttable,
+ unsigned int tt_ssize,
+ unsigned int tt_cused, unsigned int tt_sused,
+ snd_pcm_t *slave, int close_slave);
+int _snd_pcm_route_open(snd_pcm_t **pcmp, const char *name,
+ snd_config_t *root, snd_config_t *conf,
+ snd_pcm_stream_t stream, int mode);
+
+/*
+ * Rate plugin for linear formats
+ */
+int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name,
+ snd_pcm_format_t sformat, unsigned int srate,
+ const snd_config_t *converter,
+ snd_pcm_t *slave, int close_slave);
+int _snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name,
+ snd_config_t *root, snd_config_t *conf,
+ snd_pcm_stream_t stream, int mode);
+
+/*
+ * Hooks plugin
+ */
+int snd_pcm_hooks_open(snd_pcm_t **pcmp, const char *name,
+ snd_pcm_t *slave, int close_slave);
+int _snd_pcm_hooks_open(snd_pcm_t **pcmp, const char *name,
+ snd_config_t *root, snd_config_t *conf,
+ snd_pcm_stream_t stream, int mode);
+
+/*
+ * LADSPA plugin
+ */
+int snd_pcm_ladspa_open(snd_pcm_t **pcmp, const char *name,
+ const char *ladspa_path,
+ unsigned int channels,
+ snd_config_t *ladspa_pplugins,
+ snd_config_t *ladspa_cplugins,
+ snd_pcm_t *slave, int close_slave);
+int _snd_pcm_ladspa_open(snd_pcm_t **pcmp, const char *name,
+ snd_config_t *root, snd_config_t *conf,
+ snd_pcm_stream_t stream, int mode);
+
+/*
+ * Jack plugin
+ */
+int snd_pcm_jack_open(snd_pcm_t **pcmp, const char *name,
+ snd_config_t *playback_conf,
+ snd_config_t *capture_conf,
+ snd_pcm_stream_t stream, int mode);
+int _snd_pcm_jack_open(snd_pcm_t **pcmp, const char *name,
+ snd_config_t *root, snd_config_t *conf,
+ snd_pcm_stream_t stream, int mode);
+
+
+/** \} */
+
+#endif /* __ALSA_PCM_PLUGIN_H */
diff --git a/sysroot/usr/include/alsa/pcm_rate.h b/sysroot/usr/include/alsa/pcm_rate.h
new file mode 100644
index 0000000..d211e09
--- /dev/null
+++ b/sysroot/usr/include/alsa/pcm_rate.h
@@ -0,0 +1,117 @@
+/**
+ * \file include/pcm_rate.h
+ * \brief External Rate-Converter-Plugin SDK
+ * \author Takashi Iwai <tiwai@suse.de>
+ * \date 2006
+ *
+ * External Rate-Converter-Plugin SDK
+ */
+
+/*
+ * ALSA external PCM rate-converter plugin SDK (draft version)
+ *
+ * Copyright (c) 2006 Takashi Iwai <tiwai@suse.de>
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef __ALSA_PCM_RATE_H
+#define __ALSA_PCM_RATE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Protocol version
+ */
+#define SND_PCM_RATE_PLUGIN_VERSION 0x010001
+
+/** hw_params information for a single side */
+typedef struct snd_pcm_rate_side_info {
+ snd_pcm_format_t format;
+ unsigned int rate;
+ snd_pcm_uframes_t buffer_size;
+ snd_pcm_uframes_t period_size;
+} snd_pcm_rate_side_info_t;
+
+/** hw_params information */
+typedef struct snd_pcm_rate_info {
+ struct snd_pcm_rate_side_info in;
+ struct snd_pcm_rate_side_info out;
+ unsigned int channels;
+} snd_pcm_rate_info_t;
+
+/** Callback table of rate-converter */
+typedef struct snd_pcm_rate_ops {
+ /**
+ * close the converter; optional
+ */
+ void (*close)(void *obj);
+ /**
+ * initialize the converter, called at hw_params
+ */
+ int (*init)(void *obj, snd_pcm_rate_info_t *info);
+ /**
+ * free the converter; optional
+ */
+ void (*free)(void *obj);
+ /**
+ * reset the converter, called at prepare; optional
+ */
+ void (*reset)(void *obj);
+ /**
+ * adjust the pitch, called at sw_params; optional
+ */
+ int (*adjust_pitch)(void *obj, snd_pcm_rate_info_t *info);
+ /**
+ * convert the data
+ */
+ void (*convert)(void *obj,
+ const snd_pcm_channel_area_t *dst_areas,
+ snd_pcm_uframes_t dst_offset, unsigned int dst_frames,
+ const snd_pcm_channel_area_t *src_areas,
+ snd_pcm_uframes_t src_offset, unsigned int src_frames);
+ /**
+ * convert an s16 interleaved-data array; exclusive with convert
+ */
+ void (*convert_s16)(void *obj, int16_t *dst, unsigned int dst_frames,
+ const int16_t *src, unsigned int src_frames);
+ /**
+ * compute the frame size for input
+ */
+ snd_pcm_uframes_t (*input_frames)(void *obj, snd_pcm_uframes_t frames);
+ /**
+ * compute the frame size for output
+ */
+ snd_pcm_uframes_t (*output_frames)(void *obj, snd_pcm_uframes_t frames);
+} snd_pcm_rate_ops_t;
+
+/** open function type */
+typedef int (*snd_pcm_rate_open_func_t)(unsigned int version, void **objp,
+ snd_pcm_rate_ops_t *opsp);
+
+/**
+ * Define the object entry for external PCM rate-converter plugins
+ */
+#define SND_PCM_RATE_PLUGIN_ENTRY(name) _snd_pcm_rate_##name##_open
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __ALSA_PCM_RATE_H */
diff --git a/sysroot/usr/include/alsa/rawmidi.h b/sysroot/usr/include/alsa/rawmidi.h
new file mode 100644
index 0000000..c7517aa
--- /dev/null
+++ b/sysroot/usr/include/alsa/rawmidi.h
@@ -0,0 +1,159 @@
+/**
+ * \file include/rawmidi.h
+ * \brief Application interface library for the ALSA driver
+ * \author Jaroslav Kysela <perex@perex.cz>
+ * \author Abramo Bagnara <abramo@alsa-project.org>
+ * \author Takashi Iwai <tiwai@suse.de>
+ * \date 1998-2001
+ *
+ * Application interface library for the ALSA driver
+ */
+/*
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef __ALSA_RAWMIDI_H
+#define __ALSA_RAWMIDI_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \defgroup RawMidi RawMidi Interface
+ * The RawMidi Interface. See \ref rawmidi page for more details.
+ * \{
+ */
+
+/** dlsym version for interface entry callback */
+#define SND_RAWMIDI_DLSYM_VERSION _dlsym_rawmidi_001
+
+/** RawMidi information container */
+typedef struct _snd_rawmidi_info snd_rawmidi_info_t;
+/** RawMidi settings container */
+typedef struct _snd_rawmidi_params snd_rawmidi_params_t;
+/** RawMidi status container */
+typedef struct _snd_rawmidi_status snd_rawmidi_status_t;
+
+/** RawMidi stream (direction) */
+typedef enum _snd_rawmidi_stream {
+ /** Output stream */
+ SND_RAWMIDI_STREAM_OUTPUT = 0,
+ /** Input stream */
+ SND_RAWMIDI_STREAM_INPUT,
+ SND_RAWMIDI_STREAM_LAST = SND_RAWMIDI_STREAM_INPUT
+} snd_rawmidi_stream_t;
+
+/** Append (flag to open mode) \hideinitializer */
+#define SND_RAWMIDI_APPEND 0x0001
+/** Non blocking mode (flag to open mode) \hideinitializer */
+#define SND_RAWMIDI_NONBLOCK 0x0002
+/** Write sync mode (Flag to open mode) \hideinitializer */
+#define SND_RAWMIDI_SYNC 0x0004
+
+/** RawMidi handle */
+typedef struct _snd_rawmidi snd_rawmidi_t;
+
+/** RawMidi type */
+typedef enum _snd_rawmidi_type {
+ /** Kernel level RawMidi */
+ SND_RAWMIDI_TYPE_HW,
+ /** Shared memory client RawMidi (not yet implemented) */
+ SND_RAWMIDI_TYPE_SHM,
+ /** INET client RawMidi (not yet implemented) */
+ SND_RAWMIDI_TYPE_INET,
+ /** Virtual (sequencer) RawMidi */
+ SND_RAWMIDI_TYPE_VIRTUAL
+} snd_rawmidi_type_t;
+
+int snd_rawmidi_open(snd_rawmidi_t **in_rmidi, snd_rawmidi_t **out_rmidi,
+ const char *name, int mode);
+int snd_rawmidi_open_lconf(snd_rawmidi_t **in_rmidi, snd_rawmidi_t **out_rmidi,
+ const char *name, int mode, snd_config_t *lconf);
+int snd_rawmidi_close(snd_rawmidi_t *rmidi);
+int snd_rawmidi_poll_descriptors_count(snd_rawmidi_t *rmidi);
+int snd_rawmidi_poll_descriptors(snd_rawmidi_t *rmidi, struct pollfd *pfds, unsigned int space);
+int snd_rawmidi_poll_descriptors_revents(snd_rawmidi_t *rawmidi, struct pollfd *pfds, unsigned int nfds, unsigned short *revent);
+int snd_rawmidi_nonblock(snd_rawmidi_t *rmidi, int nonblock);
+size_t snd_rawmidi_info_sizeof(void);
+/** \hideinitializer
+ * \brief allocate an invalid #snd_rawmidi_info_t using standard alloca
+ * \param ptr returned pointer
+ */
+#define snd_rawmidi_info_alloca(ptr) do { assert(ptr); *ptr = (snd_rawmidi_info_t *) alloca(snd_rawmidi_info_sizeof()); memset(*ptr, 0, snd_rawmidi_info_sizeof()); } while (0)
+int snd_rawmidi_info_malloc(snd_rawmidi_info_t **ptr);
+void snd_rawmidi_info_free(snd_rawmidi_info_t *obj);
+void snd_rawmidi_info_copy(snd_rawmidi_info_t *dst, const snd_rawmidi_info_t *src);
+unsigned int snd_rawmidi_info_get_device(const snd_rawmidi_info_t *obj);
+unsigned int snd_rawmidi_info_get_subdevice(const snd_rawmidi_info_t *obj);
+snd_rawmidi_stream_t snd_rawmidi_info_get_stream(const snd_rawmidi_info_t *obj);
+int snd_rawmidi_info_get_card(const snd_rawmidi_info_t *obj);
+unsigned int snd_rawmidi_info_get_flags(const snd_rawmidi_info_t *obj);
+const char *snd_rawmidi_info_get_id(const snd_rawmidi_info_t *obj);
+const char *snd_rawmidi_info_get_name(const snd_rawmidi_info_t *obj);
+const char *snd_rawmidi_info_get_subdevice_name(const snd_rawmidi_info_t *obj);
+unsigned int snd_rawmidi_info_get_subdevices_count(const snd_rawmidi_info_t *obj);
+unsigned int snd_rawmidi_info_get_subdevices_avail(const snd_rawmidi_info_t *obj);
+void snd_rawmidi_info_set_device(snd_rawmidi_info_t *obj, unsigned int val);
+void snd_rawmidi_info_set_subdevice(snd_rawmidi_info_t *obj, unsigned int val);
+void snd_rawmidi_info_set_stream(snd_rawmidi_info_t *obj, snd_rawmidi_stream_t val);
+int snd_rawmidi_info(snd_rawmidi_t *rmidi, snd_rawmidi_info_t * info);
+size_t snd_rawmidi_params_sizeof(void);
+/** \hideinitializer
+ * \brief allocate an invalid #snd_rawmidi_params_t using standard alloca
+ * \param ptr returned pointer
+ */
+#define snd_rawmidi_params_alloca(ptr) do { assert(ptr); *ptr = (snd_rawmidi_params_t *) alloca(snd_rawmidi_params_sizeof()); memset(*ptr, 0, snd_rawmidi_params_sizeof()); } while (0)
+int snd_rawmidi_params_malloc(snd_rawmidi_params_t **ptr);
+void snd_rawmidi_params_free(snd_rawmidi_params_t *obj);
+void snd_rawmidi_params_copy(snd_rawmidi_params_t *dst, const snd_rawmidi_params_t *src);
+int snd_rawmidi_params_set_buffer_size(snd_rawmidi_t *rmidi, snd_rawmidi_params_t *params, size_t val);
+size_t snd_rawmidi_params_get_buffer_size(const snd_rawmidi_params_t *params);
+int snd_rawmidi_params_set_avail_min(snd_rawmidi_t *rmidi, snd_rawmidi_params_t *params, size_t val);
+size_t snd_rawmidi_params_get_avail_min(const snd_rawmidi_params_t *params);
+int snd_rawmidi_params_set_no_active_sensing(snd_rawmidi_t *rmidi, snd_rawmidi_params_t *params, int val);
+int snd_rawmidi_params_get_no_active_sensing(const snd_rawmidi_params_t *params);
+int snd_rawmidi_params(snd_rawmidi_t *rmidi, snd_rawmidi_params_t * params);
+int snd_rawmidi_params_current(snd_rawmidi_t *rmidi, snd_rawmidi_params_t *params);
+size_t snd_rawmidi_status_sizeof(void);
+/** \hideinitializer
+ * \brief allocate an invalid #snd_rawmidi_status_t using standard alloca
+ * \param ptr returned pointer
+ */
+#define snd_rawmidi_status_alloca(ptr) do { assert(ptr); *ptr = (snd_rawmidi_status_t *) alloca(snd_rawmidi_status_sizeof()); memset(*ptr, 0, snd_rawmidi_status_sizeof()); } while (0)
+int snd_rawmidi_status_malloc(snd_rawmidi_status_t **ptr);
+void snd_rawmidi_status_free(snd_rawmidi_status_t *obj);
+void snd_rawmidi_status_copy(snd_rawmidi_status_t *dst, const snd_rawmidi_status_t *src);
+void snd_rawmidi_status_get_tstamp(const snd_rawmidi_status_t *obj, snd_htimestamp_t *ptr);
+size_t snd_rawmidi_status_get_avail(const snd_rawmidi_status_t *obj);
+size_t snd_rawmidi_status_get_xruns(const snd_rawmidi_status_t *obj);
+int snd_rawmidi_status(snd_rawmidi_t *rmidi, snd_rawmidi_status_t * status);
+int snd_rawmidi_drain(snd_rawmidi_t *rmidi);
+int snd_rawmidi_drop(snd_rawmidi_t *rmidi);
+ssize_t snd_rawmidi_write(snd_rawmidi_t *rmidi, const void *buffer, size_t size);
+ssize_t snd_rawmidi_read(snd_rawmidi_t *rmidi, void *buffer, size_t size);
+const char *snd_rawmidi_name(snd_rawmidi_t *rmidi);
+snd_rawmidi_type_t snd_rawmidi_type(snd_rawmidi_t *rmidi);
+snd_rawmidi_stream_t snd_rawmidi_stream(snd_rawmidi_t *rawmidi);
+
+/** \} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __RAWMIDI_H */
+
diff --git a/sysroot/usr/include/alsa/seq.h b/sysroot/usr/include/alsa/seq.h
new file mode 100644
index 0000000..94ea711
--- /dev/null
+++ b/sysroot/usr/include/alsa/seq.h
@@ -0,0 +1,740 @@
+/**
+ * \file include/seq.h
+ * \brief Application interface library for the ALSA driver
+ * \author Jaroslav Kysela <perex@perex.cz>
+ * \author Abramo Bagnara <abramo@alsa-project.org>
+ * \author Takashi Iwai <tiwai@suse.de>
+ * \date 1998-2001
+ */
+/*
+ * Application interface library for the ALSA driver
+ *
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef __ALSA_SEQ_H
+#define __ALSA_SEQ_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \defgroup Sequencer MIDI Sequencer
+ * MIDI Sequencer Interface.
+ * See \ref seq page for more details.
+ * \{
+ */
+
+/** dlsym version for interface entry callback */
+#define SND_SEQ_DLSYM_VERSION _dlsym_seq_001
+
+/** Sequencer handle */
+typedef struct _snd_seq snd_seq_t;
+
+#ifndef DOC_HIDDEN
+#define SND_ALLOCA(type,ptr) \
+do {\
+ assert(ptr);\
+ *ptr = (type##_t *)alloca(type##_sizeof());\
+ memset(*ptr, 0, type##_sizeof());\
+} while (0)
+#endif
+
+/**
+ * sequencer opening stream types
+ */
+#define SND_SEQ_OPEN_OUTPUT 1 /**< open for output (write) */
+#define SND_SEQ_OPEN_INPUT 2 /**< open for input (read) */
+#define SND_SEQ_OPEN_DUPLEX (SND_SEQ_OPEN_OUTPUT|SND_SEQ_OPEN_INPUT) /**< open for both input and output (read/write) */
+
+/**
+ * sequencer opening mode
+ */
+#define SND_SEQ_NONBLOCK 0x0001 /**< non-blocking mode (flag to open mode) */
+
+/** sequencer handle type */
+typedef enum _snd_seq_type {
+ SND_SEQ_TYPE_HW, /**< hardware */
+ SND_SEQ_TYPE_SHM, /**< shared memory (NYI) */
+ SND_SEQ_TYPE_INET /**< network (NYI) */
+} snd_seq_type_t;
+
+/** special client (port) ids */
+#define SND_SEQ_ADDRESS_UNKNOWN 253 /**< unknown source */
+#define SND_SEQ_ADDRESS_SUBSCRIBERS 254 /**< send event to all subscribed ports */
+#define SND_SEQ_ADDRESS_BROADCAST 255 /**< send event to all queues/clients/ports/channels */
+
+/** known client numbers */
+#define SND_SEQ_CLIENT_SYSTEM 0 /**< system client */
+
+/*
+ */
+int snd_seq_open(snd_seq_t **handle, const char *name, int streams, int mode);
+int snd_seq_open_lconf(snd_seq_t **handle, const char *name, int streams, int mode, snd_config_t *lconf);
+const char *snd_seq_name(snd_seq_t *seq);
+snd_seq_type_t snd_seq_type(snd_seq_t *seq);
+int snd_seq_close(snd_seq_t *handle);
+int snd_seq_poll_descriptors_count(snd_seq_t *handle, short events);
+int snd_seq_poll_descriptors(snd_seq_t *handle, struct pollfd *pfds, unsigned int space, short events);
+int snd_seq_poll_descriptors_revents(snd_seq_t *seq, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
+int snd_seq_nonblock(snd_seq_t *handle, int nonblock);
+int snd_seq_client_id(snd_seq_t *handle);
+
+size_t snd_seq_get_output_buffer_size(snd_seq_t *handle);
+size_t snd_seq_get_input_buffer_size(snd_seq_t *handle);
+int snd_seq_set_output_buffer_size(snd_seq_t *handle, size_t size);
+int snd_seq_set_input_buffer_size(snd_seq_t *handle, size_t size);
+
+/** system information container */
+typedef struct _snd_seq_system_info snd_seq_system_info_t;
+
+size_t snd_seq_system_info_sizeof(void);
+/** allocate a #snd_seq_system_info_t container on stack */
+#define snd_seq_system_info_alloca(ptr) \
+ SND_ALLOCA(snd_seq_system_info, ptr)
+int snd_seq_system_info_malloc(snd_seq_system_info_t **ptr);
+void snd_seq_system_info_free(snd_seq_system_info_t *ptr);
+void snd_seq_system_info_copy(snd_seq_system_info_t *dst, const snd_seq_system_info_t *src);
+
+int snd_seq_system_info_get_queues(const snd_seq_system_info_t *info);
+int snd_seq_system_info_get_clients(const snd_seq_system_info_t *info);
+int snd_seq_system_info_get_ports(const snd_seq_system_info_t *info);
+int snd_seq_system_info_get_channels(const snd_seq_system_info_t *info);
+int snd_seq_system_info_get_cur_clients(const snd_seq_system_info_t *info);
+int snd_seq_system_info_get_cur_queues(const snd_seq_system_info_t *info);
+
+int snd_seq_system_info(snd_seq_t *handle, snd_seq_system_info_t *info);
+
+/** \} */
+
+
+/**
+ * \defgroup SeqClient Sequencer Client Interface
+ * Sequencer Client Interface
+ * \ingroup Sequencer
+ * \{
+ */
+
+/** client information container */
+typedef struct _snd_seq_client_info snd_seq_client_info_t;
+
+/** client types */
+typedef enum snd_seq_client_type {
+ SND_SEQ_USER_CLIENT = 1, /**< user client */
+ SND_SEQ_KERNEL_CLIENT = 2 /**< kernel client */
+} snd_seq_client_type_t;
+
+size_t snd_seq_client_info_sizeof(void);
+/** allocate a #snd_seq_client_info_t container on stack */
+#define snd_seq_client_info_alloca(ptr) \
+ SND_ALLOCA(snd_seq_client_info, ptr)
+int snd_seq_client_info_malloc(snd_seq_client_info_t **ptr);
+void snd_seq_client_info_free(snd_seq_client_info_t *ptr);
+void snd_seq_client_info_copy(snd_seq_client_info_t *dst, const snd_seq_client_info_t *src);
+
+int snd_seq_client_info_get_client(const snd_seq_client_info_t *info);
+snd_seq_client_type_t snd_seq_client_info_get_type(const snd_seq_client_info_t *info);
+const char *snd_seq_client_info_get_name(snd_seq_client_info_t *info);
+int snd_seq_client_info_get_broadcast_filter(const snd_seq_client_info_t *info);
+int snd_seq_client_info_get_error_bounce(const snd_seq_client_info_t *info);
+const unsigned char *snd_seq_client_info_get_event_filter(const snd_seq_client_info_t *info);
+int snd_seq_client_info_get_num_ports(const snd_seq_client_info_t *info);
+int snd_seq_client_info_get_event_lost(const snd_seq_client_info_t *info);
+
+void snd_seq_client_info_set_client(snd_seq_client_info_t *info, int client);
+void snd_seq_client_info_set_name(snd_seq_client_info_t *info, const char *name);
+void snd_seq_client_info_set_broadcast_filter(snd_seq_client_info_t *info, int val);
+void snd_seq_client_info_set_error_bounce(snd_seq_client_info_t *info, int val);
+void snd_seq_client_info_set_event_filter(snd_seq_client_info_t *info, unsigned char *filter);
+
+int snd_seq_get_client_info(snd_seq_t *handle, snd_seq_client_info_t *info);
+int snd_seq_get_any_client_info(snd_seq_t *handle, int client, snd_seq_client_info_t *info);
+int snd_seq_set_client_info(snd_seq_t *handle, snd_seq_client_info_t *info);
+int snd_seq_query_next_client(snd_seq_t *handle, snd_seq_client_info_t *info);
+
+/*
+ */
+
+/** client pool information container */
+typedef struct _snd_seq_client_pool snd_seq_client_pool_t;
+
+size_t snd_seq_client_pool_sizeof(void);
+/** allocate a #snd_seq_client_pool_t container on stack */
+#define snd_seq_client_pool_alloca(ptr) \
+ SND_ALLOCA(snd_seq_client_pool, ptr)
+int snd_seq_client_pool_malloc(snd_seq_client_pool_t **ptr);
+void snd_seq_client_pool_free(snd_seq_client_pool_t *ptr);
+void snd_seq_client_pool_copy(snd_seq_client_pool_t *dst, const snd_seq_client_pool_t *src);
+
+int snd_seq_client_pool_get_client(const snd_seq_client_pool_t *info);
+size_t snd_seq_client_pool_get_output_pool(const snd_seq_client_pool_t *info);
+size_t snd_seq_client_pool_get_input_pool(const snd_seq_client_pool_t *info);
+size_t snd_seq_client_pool_get_output_room(const snd_seq_client_pool_t *info);
+size_t snd_seq_client_pool_get_output_free(const snd_seq_client_pool_t *info);
+size_t snd_seq_client_pool_get_input_free(const snd_seq_client_pool_t *info);
+void snd_seq_client_pool_set_output_pool(snd_seq_client_pool_t *info, size_t size);
+void snd_seq_client_pool_set_input_pool(snd_seq_client_pool_t *info, size_t size);
+void snd_seq_client_pool_set_output_room(snd_seq_client_pool_t *info, size_t size);
+
+int snd_seq_get_client_pool(snd_seq_t *handle, snd_seq_client_pool_t *info);
+int snd_seq_set_client_pool(snd_seq_t *handle, snd_seq_client_pool_t *info);
+
+
+/** \} */
+
+
+/**
+ * \defgroup SeqPort Sequencer Port Interface
+ * Sequencer Port Interface
+ * \ingroup Sequencer
+ * \{
+ */
+
+/** port information container */
+typedef struct _snd_seq_port_info snd_seq_port_info_t;
+
+/** known port numbers */
+#define SND_SEQ_PORT_SYSTEM_TIMER 0 /**< system timer port */
+#define SND_SEQ_PORT_SYSTEM_ANNOUNCE 1 /**< system announce port */
+
+/** port capabilities (32 bits) */
+#define SND_SEQ_PORT_CAP_READ (1<<0) /**< readable from this port */
+#define SND_SEQ_PORT_CAP_WRITE (1<<1) /**< writable to this port */
+
+#define SND_SEQ_PORT_CAP_SYNC_READ (1<<2) /**< allow read subscriptions */
+#define SND_SEQ_PORT_CAP_SYNC_WRITE (1<<3) /**< allow write subscriptions */
+
+#define SND_SEQ_PORT_CAP_DUPLEX (1<<4) /**< allow read/write duplex */
+
+#define SND_SEQ_PORT_CAP_SUBS_READ (1<<5) /**< allow read subscription */
+#define SND_SEQ_PORT_CAP_SUBS_WRITE (1<<6) /**< allow write subscription */
+#define SND_SEQ_PORT_CAP_NO_EXPORT (1<<7) /**< routing not allowed */
+
+/* port type */
+/** Messages sent from/to this port have device-specific semantics. */
+#define SND_SEQ_PORT_TYPE_SPECIFIC (1<<0)
+/** This port understands MIDI messages. */
+#define SND_SEQ_PORT_TYPE_MIDI_GENERIC (1<<1)
+/** This port is compatible with the General MIDI specification. */
+#define SND_SEQ_PORT_TYPE_MIDI_GM (1<<2)
+/** This port is compatible with the Roland GS standard. */
+#define SND_SEQ_PORT_TYPE_MIDI_GS (1<<3)
+/** This port is compatible with the Yamaha XG specification. */
+#define SND_SEQ_PORT_TYPE_MIDI_XG (1<<4)
+/** This port is compatible with the Roland MT-32. */
+#define SND_SEQ_PORT_TYPE_MIDI_MT32 (1<<5)
+/** This port is compatible with the General MIDI 2 specification. */
+#define SND_SEQ_PORT_TYPE_MIDI_GM2 (1<<6)
+/** This port understands SND_SEQ_EVENT_SAMPLE_xxx messages
+ (these are not MIDI messages). */
+#define SND_SEQ_PORT_TYPE_SYNTH (1<<10)
+/** Instruments can be downloaded to this port
+ (with SND_SEQ_EVENT_INSTR_xxx messages sent directly). */
+#define SND_SEQ_PORT_TYPE_DIRECT_SAMPLE (1<<11)
+/** Instruments can be downloaded to this port
+ (with SND_SEQ_EVENT_INSTR_xxx messages sent directly or through a queue). */
+#define SND_SEQ_PORT_TYPE_SAMPLE (1<<12)
+/** This port is implemented in hardware. */
+#define SND_SEQ_PORT_TYPE_HARDWARE (1<<16)
+/** This port is implemented in software. */
+#define SND_SEQ_PORT_TYPE_SOFTWARE (1<<17)
+/** Messages sent to this port will generate sounds. */
+#define SND_SEQ_PORT_TYPE_SYNTHESIZER (1<<18)
+/** This port may connect to other devices
+ (whose characteristics are not known). */
+#define SND_SEQ_PORT_TYPE_PORT (1<<19)
+/** This port belongs to an application, such as a sequencer or editor. */
+#define SND_SEQ_PORT_TYPE_APPLICATION (1<<20)
+
+
+size_t snd_seq_port_info_sizeof(void);
+/** allocate a #snd_seq_port_info_t container on stack */
+#define snd_seq_port_info_alloca(ptr) \
+ SND_ALLOCA(snd_seq_port_info, ptr)
+int snd_seq_port_info_malloc(snd_seq_port_info_t **ptr);
+void snd_seq_port_info_free(snd_seq_port_info_t *ptr);
+void snd_seq_port_info_copy(snd_seq_port_info_t *dst, const snd_seq_port_info_t *src);
+
+int snd_seq_port_info_get_client(const snd_seq_port_info_t *info);
+int snd_seq_port_info_get_port(const snd_seq_port_info_t *info);
+const snd_seq_addr_t *snd_seq_port_info_get_addr(const snd_seq_port_info_t *info);
+const char *snd_seq_port_info_get_name(const snd_seq_port_info_t *info);
+unsigned int snd_seq_port_info_get_capability(const snd_seq_port_info_t *info);
+unsigned int snd_seq_port_info_get_type(const snd_seq_port_info_t *info);
+int snd_seq_port_info_get_midi_channels(const snd_seq_port_info_t *info);
+int snd_seq_port_info_get_midi_voices(const snd_seq_port_info_t *info);
+int snd_seq_port_info_get_synth_voices(const snd_seq_port_info_t *info);
+int snd_seq_port_info_get_read_use(const snd_seq_port_info_t *info);
+int snd_seq_port_info_get_write_use(const snd_seq_port_info_t *info);
+int snd_seq_port_info_get_port_specified(const snd_seq_port_info_t *info);
+int snd_seq_port_info_get_timestamping(const snd_seq_port_info_t *info);
+int snd_seq_port_info_get_timestamp_real(const snd_seq_port_info_t *info);
+int snd_seq_port_info_get_timestamp_queue(const snd_seq_port_info_t *info);
+
+void snd_seq_port_info_set_client(snd_seq_port_info_t *info, int client);
+void snd_seq_port_info_set_port(snd_seq_port_info_t *info, int port);
+void snd_seq_port_info_set_addr(snd_seq_port_info_t *info, const snd_seq_addr_t *addr);
+void snd_seq_port_info_set_name(snd_seq_port_info_t *info, const char *name);
+void snd_seq_port_info_set_capability(snd_seq_port_info_t *info, unsigned int capability);
+void snd_seq_port_info_set_type(snd_seq_port_info_t *info, unsigned int type);
+void snd_seq_port_info_set_midi_channels(snd_seq_port_info_t *info, int channels);
+void snd_seq_port_info_set_midi_voices(snd_seq_port_info_t *info, int voices);
+void snd_seq_port_info_set_synth_voices(snd_seq_port_info_t *info, int voices);
+void snd_seq_port_info_set_port_specified(snd_seq_port_info_t *info, int val);
+void snd_seq_port_info_set_timestamping(snd_seq_port_info_t *info, int enable);
+void snd_seq_port_info_set_timestamp_real(snd_seq_port_info_t *info, int realtime);
+void snd_seq_port_info_set_timestamp_queue(snd_seq_port_info_t *info, int queue);
+
+int snd_seq_create_port(snd_seq_t *handle, snd_seq_port_info_t *info);
+int snd_seq_delete_port(snd_seq_t *handle, int port);
+int snd_seq_get_port_info(snd_seq_t *handle, int port, snd_seq_port_info_t *info);
+int snd_seq_get_any_port_info(snd_seq_t *handle, int client, int port, snd_seq_port_info_t *info);
+int snd_seq_set_port_info(snd_seq_t *handle, int port, snd_seq_port_info_t *info);
+int snd_seq_query_next_port(snd_seq_t *handle, snd_seq_port_info_t *info);
+
+/** \} */
+
+
+/**
+ * \defgroup SeqSubscribe Sequencer Port Subscription
+ * Sequencer Port Subscription
+ * \ingroup Sequencer
+ * \{
+ */
+
+/** port subscription container */
+typedef struct _snd_seq_port_subscribe snd_seq_port_subscribe_t;
+
+size_t snd_seq_port_subscribe_sizeof(void);
+/** allocate a #snd_seq_port_subscribe_t container on stack */
+#define snd_seq_port_subscribe_alloca(ptr) \
+ SND_ALLOCA(snd_seq_port_subscribe, ptr)
+int snd_seq_port_subscribe_malloc(snd_seq_port_subscribe_t **ptr);
+void snd_seq_port_subscribe_free(snd_seq_port_subscribe_t *ptr);
+void snd_seq_port_subscribe_copy(snd_seq_port_subscribe_t *dst, const snd_seq_port_subscribe_t *src);
+
+const snd_seq_addr_t *snd_seq_port_subscribe_get_sender(const snd_seq_port_subscribe_t *info);
+const snd_seq_addr_t *snd_seq_port_subscribe_get_dest(const snd_seq_port_subscribe_t *info);
+int snd_seq_port_subscribe_get_queue(const snd_seq_port_subscribe_t *info);
+int snd_seq_port_subscribe_get_exclusive(const snd_seq_port_subscribe_t *info);
+int snd_seq_port_subscribe_get_time_update(const snd_seq_port_subscribe_t *info);
+int snd_seq_port_subscribe_get_time_real(const snd_seq_port_subscribe_t *info);
+
+void snd_seq_port_subscribe_set_sender(snd_seq_port_subscribe_t *info, const snd_seq_addr_t *addr);
+void snd_seq_port_subscribe_set_dest(snd_seq_port_subscribe_t *info, const snd_seq_addr_t *addr);
+void snd_seq_port_subscribe_set_queue(snd_seq_port_subscribe_t *info, int q);
+void snd_seq_port_subscribe_set_exclusive(snd_seq_port_subscribe_t *info, int val);
+void snd_seq_port_subscribe_set_time_update(snd_seq_port_subscribe_t *info, int val);
+void snd_seq_port_subscribe_set_time_real(snd_seq_port_subscribe_t *info, int val);
+
+int snd_seq_get_port_subscription(snd_seq_t *handle, snd_seq_port_subscribe_t *sub);
+int snd_seq_subscribe_port(snd_seq_t *handle, snd_seq_port_subscribe_t *sub);
+int snd_seq_unsubscribe_port(snd_seq_t *handle, snd_seq_port_subscribe_t *sub);
+
+/*
+ */
+
+/** subscription query container */
+typedef struct _snd_seq_query_subscribe snd_seq_query_subscribe_t;
+
+/** type of query subscription */
+typedef enum {
+ SND_SEQ_QUERY_SUBS_READ, /**< query read subscriptions */
+ SND_SEQ_QUERY_SUBS_WRITE /**< query write subscriptions */
+} snd_seq_query_subs_type_t;
+
+size_t snd_seq_query_subscribe_sizeof(void);
+/** allocate a #snd_seq_query_subscribe_t container on stack */
+#define snd_seq_query_subscribe_alloca(ptr) \
+ SND_ALLOCA(snd_seq_query_subscribe, ptr)
+int snd_seq_query_subscribe_malloc(snd_seq_query_subscribe_t **ptr);
+void snd_seq_query_subscribe_free(snd_seq_query_subscribe_t *ptr);
+void snd_seq_query_subscribe_copy(snd_seq_query_subscribe_t *dst, const snd_seq_query_subscribe_t *src);
+
+int snd_seq_query_subscribe_get_client(const snd_seq_query_subscribe_t *info);
+int snd_seq_query_subscribe_get_port(const snd_seq_query_subscribe_t *info);
+const snd_seq_addr_t *snd_seq_query_subscribe_get_root(const snd_seq_query_subscribe_t *info);
+snd_seq_query_subs_type_t snd_seq_query_subscribe_get_type(const snd_seq_query_subscribe_t *info);
+int snd_seq_query_subscribe_get_index(const snd_seq_query_subscribe_t *info);
+int snd_seq_query_subscribe_get_num_subs(const snd_seq_query_subscribe_t *info);
+const snd_seq_addr_t *snd_seq_query_subscribe_get_addr(const snd_seq_query_subscribe_t *info);
+int snd_seq_query_subscribe_get_queue(const snd_seq_query_subscribe_t *info);
+int snd_seq_query_subscribe_get_exclusive(const snd_seq_query_subscribe_t *info);
+int snd_seq_query_subscribe_get_time_update(const snd_seq_query_subscribe_t *info);
+int snd_seq_query_subscribe_get_time_real(const snd_seq_query_subscribe_t *info);
+
+void snd_seq_query_subscribe_set_client(snd_seq_query_subscribe_t *info, int client);
+void snd_seq_query_subscribe_set_port(snd_seq_query_subscribe_t *info, int port);
+void snd_seq_query_subscribe_set_root(snd_seq_query_subscribe_t *info, const snd_seq_addr_t *addr);
+void snd_seq_query_subscribe_set_type(snd_seq_query_subscribe_t *info, snd_seq_query_subs_type_t type);
+void snd_seq_query_subscribe_set_index(snd_seq_query_subscribe_t *info, int _index);
+
+int snd_seq_query_port_subscribers(snd_seq_t *seq, snd_seq_query_subscribe_t * subs);
+
+/** \} */
+
+
+/**
+ * \defgroup SeqQueue Sequencer Queue Interface
+ * Sequencer Queue Interface
+ * \ingroup Sequencer
+ * \{
+ */
+
+/** queue information container */
+typedef struct _snd_seq_queue_info snd_seq_queue_info_t;
+/** queue status container */
+typedef struct _snd_seq_queue_status snd_seq_queue_status_t;
+/** queue tempo container */
+typedef struct _snd_seq_queue_tempo snd_seq_queue_tempo_t;
+/** queue timer information container */
+typedef struct _snd_seq_queue_timer snd_seq_queue_timer_t;
+
+/** special queue ids */
+#define SND_SEQ_QUEUE_DIRECT 253 /**< direct dispatch */
+
+size_t snd_seq_queue_info_sizeof(void);
+/** allocate a #snd_seq_queue_info_t container on stack */
+#define snd_seq_queue_info_alloca(ptr) \
+ SND_ALLOCA(snd_seq_queue_info, ptr)
+int snd_seq_queue_info_malloc(snd_seq_queue_info_t **ptr);
+void snd_seq_queue_info_free(snd_seq_queue_info_t *ptr);
+void snd_seq_queue_info_copy(snd_seq_queue_info_t *dst, const snd_seq_queue_info_t *src);
+
+int snd_seq_queue_info_get_queue(const snd_seq_queue_info_t *info);
+const char *snd_seq_queue_info_get_name(const snd_seq_queue_info_t *info);
+int snd_seq_queue_info_get_owner(const snd_seq_queue_info_t *info);
+int snd_seq_queue_info_get_locked(const snd_seq_queue_info_t *info);
+unsigned int snd_seq_queue_info_get_flags(const snd_seq_queue_info_t *info);
+
+void snd_seq_queue_info_set_name(snd_seq_queue_info_t *info, const char *name);
+void snd_seq_queue_info_set_owner(snd_seq_queue_info_t *info, int owner);
+void snd_seq_queue_info_set_locked(snd_seq_queue_info_t *info, int locked);
+void snd_seq_queue_info_set_flags(snd_seq_queue_info_t *info, unsigned int flags);
+
+int snd_seq_create_queue(snd_seq_t *seq, snd_seq_queue_info_t *info);
+int snd_seq_alloc_named_queue(snd_seq_t *seq, const char *name);
+int snd_seq_alloc_queue(snd_seq_t *handle);
+int snd_seq_free_queue(snd_seq_t *handle, int q);
+int snd_seq_get_queue_info(snd_seq_t *seq, int q, snd_seq_queue_info_t *info);
+int snd_seq_set_queue_info(snd_seq_t *seq, int q, snd_seq_queue_info_t *info);
+int snd_seq_query_named_queue(snd_seq_t *seq, const char *name);
+
+int snd_seq_get_queue_usage(snd_seq_t *handle, int q);
+int snd_seq_set_queue_usage(snd_seq_t *handle, int q, int used);
+
+/*
+ */
+size_t snd_seq_queue_status_sizeof(void);
+/** allocate a #snd_seq_queue_status_t container on stack */
+#define snd_seq_queue_status_alloca(ptr) \
+ SND_ALLOCA(snd_seq_queue_status, ptr)
+int snd_seq_queue_status_malloc(snd_seq_queue_status_t **ptr);
+void snd_seq_queue_status_free(snd_seq_queue_status_t *ptr);
+void snd_seq_queue_status_copy(snd_seq_queue_status_t *dst, const snd_seq_queue_status_t *src);
+
+int snd_seq_queue_status_get_queue(const snd_seq_queue_status_t *info);
+int snd_seq_queue_status_get_events(const snd_seq_queue_status_t *info);
+snd_seq_tick_time_t snd_seq_queue_status_get_tick_time(const snd_seq_queue_status_t *info);
+const snd_seq_real_time_t *snd_seq_queue_status_get_real_time(const snd_seq_queue_status_t *info);
+unsigned int snd_seq_queue_status_get_status(const snd_seq_queue_status_t *info);
+
+int snd_seq_get_queue_status(snd_seq_t *handle, int q, snd_seq_queue_status_t *status);
+
+/*
+ */
+size_t snd_seq_queue_tempo_sizeof(void);
+/** allocate a #snd_seq_queue_tempo_t container on stack */
+#define snd_seq_queue_tempo_alloca(ptr) \
+ SND_ALLOCA(snd_seq_queue_tempo, ptr)
+int snd_seq_queue_tempo_malloc(snd_seq_queue_tempo_t **ptr);
+void snd_seq_queue_tempo_free(snd_seq_queue_tempo_t *ptr);
+void snd_seq_queue_tempo_copy(snd_seq_queue_tempo_t *dst, const snd_seq_queue_tempo_t *src);
+
+int snd_seq_queue_tempo_get_queue(const snd_seq_queue_tempo_t *info);
+unsigned int snd_seq_queue_tempo_get_tempo(const snd_seq_queue_tempo_t *info);
+int snd_seq_queue_tempo_get_ppq(const snd_seq_queue_tempo_t *info);
+unsigned int snd_seq_queue_tempo_get_skew(const snd_seq_queue_tempo_t *info);
+unsigned int snd_seq_queue_tempo_get_skew_base(const snd_seq_queue_tempo_t *info);
+void snd_seq_queue_tempo_set_tempo(snd_seq_queue_tempo_t *info, unsigned int tempo);
+void snd_seq_queue_tempo_set_ppq(snd_seq_queue_tempo_t *info, int ppq);
+void snd_seq_queue_tempo_set_skew(snd_seq_queue_tempo_t *info, unsigned int skew);
+void snd_seq_queue_tempo_set_skew_base(snd_seq_queue_tempo_t *info, unsigned int base);
+
+int snd_seq_get_queue_tempo(snd_seq_t *handle, int q, snd_seq_queue_tempo_t *tempo);
+int snd_seq_set_queue_tempo(snd_seq_t *handle, int q, snd_seq_queue_tempo_t *tempo);
+
+/*
+ */
+
+/** sequencer timer sources */
+typedef enum {
+ SND_SEQ_TIMER_ALSA = 0, /* ALSA timer */
+ SND_SEQ_TIMER_MIDI_CLOCK = 1, /* Midi Clock (CLOCK event) */
+ SND_SEQ_TIMER_MIDI_TICK = 2 /* Midi Timer Tick (TICK event */
+} snd_seq_queue_timer_type_t;
+
+size_t snd_seq_queue_timer_sizeof(void);
+/** allocate a #snd_seq_queue_timer_t container on stack */
+#define snd_seq_queue_timer_alloca(ptr) \
+ SND_ALLOCA(snd_seq_queue_timer, ptr)
+int snd_seq_queue_timer_malloc(snd_seq_queue_timer_t **ptr);
+void snd_seq_queue_timer_free(snd_seq_queue_timer_t *ptr);
+void snd_seq_queue_timer_copy(snd_seq_queue_timer_t *dst, const snd_seq_queue_timer_t *src);
+
+int snd_seq_queue_timer_get_queue(const snd_seq_queue_timer_t *info);
+snd_seq_queue_timer_type_t snd_seq_queue_timer_get_type(const snd_seq_queue_timer_t *info);
+const snd_timer_id_t *snd_seq_queue_timer_get_id(const snd_seq_queue_timer_t *info);
+unsigned int snd_seq_queue_timer_get_resolution(const snd_seq_queue_timer_t *info);
+
+void snd_seq_queue_timer_set_type(snd_seq_queue_timer_t *info, snd_seq_queue_timer_type_t type);
+void snd_seq_queue_timer_set_id(snd_seq_queue_timer_t *info, const snd_timer_id_t *id);
+void snd_seq_queue_timer_set_resolution(snd_seq_queue_timer_t *info, unsigned int resolution);
+
+int snd_seq_get_queue_timer(snd_seq_t *handle, int q, snd_seq_queue_timer_t *timer);
+int snd_seq_set_queue_timer(snd_seq_t *handle, int q, snd_seq_queue_timer_t *timer);
+
+/** \} */
+
+/**
+ * \defgroup SeqEvent Sequencer Event API
+ * Sequencer Event API
+ * \ingroup Sequencer
+ * \{
+ */
+
+int snd_seq_free_event(snd_seq_event_t *ev);
+ssize_t snd_seq_event_length(snd_seq_event_t *ev);
+int snd_seq_event_output(snd_seq_t *handle, snd_seq_event_t *ev);
+int snd_seq_event_output_buffer(snd_seq_t *handle, snd_seq_event_t *ev);
+int snd_seq_event_output_direct(snd_seq_t *handle, snd_seq_event_t *ev);
+int snd_seq_event_input(snd_seq_t *handle, snd_seq_event_t **ev);
+int snd_seq_event_input_pending(snd_seq_t *seq, int fetch_sequencer);
+int snd_seq_drain_output(snd_seq_t *handle);
+int snd_seq_event_output_pending(snd_seq_t *seq);
+int snd_seq_extract_output(snd_seq_t *handle, snd_seq_event_t **ev);
+int snd_seq_drop_output(snd_seq_t *handle);
+int snd_seq_drop_output_buffer(snd_seq_t *handle);
+int snd_seq_drop_input(snd_seq_t *handle);
+int snd_seq_drop_input_buffer(snd_seq_t *handle);
+
+/** event removal conditionals */
+typedef struct _snd_seq_remove_events snd_seq_remove_events_t;
+
+/** Remove conditional flags */
+#define SND_SEQ_REMOVE_INPUT (1<<0) /**< Flush input queues */
+#define SND_SEQ_REMOVE_OUTPUT (1<<1) /**< Flush output queues */
+#define SND_SEQ_REMOVE_DEST (1<<2) /**< Restrict by destination q:client:port */
+#define SND_SEQ_REMOVE_DEST_CHANNEL (1<<3) /**< Restrict by channel */
+#define SND_SEQ_REMOVE_TIME_BEFORE (1<<4) /**< Restrict to before time */
+#define SND_SEQ_REMOVE_TIME_AFTER (1<<5) /**< Restrict to time or after */
+#define SND_SEQ_REMOVE_TIME_TICK (1<<6) /**< Time is in ticks */
+#define SND_SEQ_REMOVE_EVENT_TYPE (1<<7) /**< Restrict to event type */
+#define SND_SEQ_REMOVE_IGNORE_OFF (1<<8) /**< Do not flush off events */
+#define SND_SEQ_REMOVE_TAG_MATCH (1<<9) /**< Restrict to events with given tag */
+
+size_t snd_seq_remove_events_sizeof(void);
+/** allocate a #snd_seq_remove_events_t container on stack */
+#define snd_seq_remove_events_alloca(ptr) \
+ SND_ALLOCA(snd_seq_remove_events, ptr)
+int snd_seq_remove_events_malloc(snd_seq_remove_events_t **ptr);
+void snd_seq_remove_events_free(snd_seq_remove_events_t *ptr);
+void snd_seq_remove_events_copy(snd_seq_remove_events_t *dst, const snd_seq_remove_events_t *src);
+
+unsigned int snd_seq_remove_events_get_condition(const snd_seq_remove_events_t *info);
+int snd_seq_remove_events_get_queue(const snd_seq_remove_events_t *info);
+const snd_seq_timestamp_t *snd_seq_remove_events_get_time(const snd_seq_remove_events_t *info);
+const snd_seq_addr_t *snd_seq_remove_events_get_dest(const snd_seq_remove_events_t *info);
+int snd_seq_remove_events_get_channel(const snd_seq_remove_events_t *info);
+int snd_seq_remove_events_get_event_type(const snd_seq_remove_events_t *info);
+int snd_seq_remove_events_get_tag(const snd_seq_remove_events_t *info);
+
+void snd_seq_remove_events_set_condition(snd_seq_remove_events_t *info, unsigned int flags);
+void snd_seq_remove_events_set_queue(snd_seq_remove_events_t *info, int queue);
+void snd_seq_remove_events_set_time(snd_seq_remove_events_t *info, const snd_seq_timestamp_t *time);
+void snd_seq_remove_events_set_dest(snd_seq_remove_events_t *info, const snd_seq_addr_t *addr);
+void snd_seq_remove_events_set_channel(snd_seq_remove_events_t *info, int channel);
+void snd_seq_remove_events_set_event_type(snd_seq_remove_events_t *info, int type);
+void snd_seq_remove_events_set_tag(snd_seq_remove_events_t *info, int tag);
+
+int snd_seq_remove_events(snd_seq_t *handle, snd_seq_remove_events_t *info);
+
+/** \} */
+
+/**
+ * \defgroup SeqMisc Sequencer Miscellaneous
+ * Sequencer Miscellaneous
+ * \ingroup Sequencer
+ * \{
+ */
+
+void snd_seq_set_bit(int nr, void *array);
+int snd_seq_change_bit(int nr, void *array);
+int snd_seq_get_bit(int nr, void *array);
+
+/** \} */
+
+
+/**
+ * \defgroup SeqEvType Sequencer Event Type Checks
+ * Sequencer Event Type Checks
+ * \ingroup Sequencer
+ * \{
+ */
+
+/* event type macros */
+enum {
+ SND_SEQ_EVFLG_RESULT,
+ SND_SEQ_EVFLG_NOTE,
+ SND_SEQ_EVFLG_CONTROL,
+ SND_SEQ_EVFLG_QUEUE,
+ SND_SEQ_EVFLG_SYSTEM,
+ SND_SEQ_EVFLG_MESSAGE,
+ SND_SEQ_EVFLG_CONNECTION,
+ SND_SEQ_EVFLG_SAMPLE,
+ SND_SEQ_EVFLG_USERS,
+ SND_SEQ_EVFLG_INSTR,
+ SND_SEQ_EVFLG_QUOTE,
+ SND_SEQ_EVFLG_NONE,
+ SND_SEQ_EVFLG_RAW,
+ SND_SEQ_EVFLG_FIXED,
+ SND_SEQ_EVFLG_VARIABLE,
+ SND_SEQ_EVFLG_VARUSR
+};
+
+enum {
+ SND_SEQ_EVFLG_NOTE_ONEARG,
+ SND_SEQ_EVFLG_NOTE_TWOARG
+};
+
+enum {
+ SND_SEQ_EVFLG_QUEUE_NOARG,
+ SND_SEQ_EVFLG_QUEUE_TICK,
+ SND_SEQ_EVFLG_QUEUE_TIME,
+ SND_SEQ_EVFLG_QUEUE_VALUE
+};
+
+/**
+ * Exported event type table
+ *
+ * This table is referred by snd_seq_ev_is_xxx.
+ */
+extern const unsigned int snd_seq_event_types[];
+
+#define _SND_SEQ_TYPE(x) (1<<(x)) /**< master type - 24bit */
+#define _SND_SEQ_TYPE_OPT(x) ((x)<<24) /**< optional type - 8bit */
+
+/** check the event type */
+#define snd_seq_type_check(ev,x) (snd_seq_event_types[(ev)->type] & _SND_SEQ_TYPE(x))
+
+/** event type check: result events */
+#define snd_seq_ev_is_result_type(ev) \
+ snd_seq_type_check(ev, SND_SEQ_EVFLG_RESULT)
+/** event type check: note events */
+#define snd_seq_ev_is_note_type(ev) \
+ snd_seq_type_check(ev, SND_SEQ_EVFLG_NOTE)
+/** event type check: control events */
+#define snd_seq_ev_is_control_type(ev) \
+ snd_seq_type_check(ev, SND_SEQ_EVFLG_CONTROL)
+/** event type check: channel specific events */
+#define snd_seq_ev_is_channel_type(ev) \
+ (snd_seq_event_types[(ev)->type] & (_SND_SEQ_TYPE(SND_SEQ_EVFLG_NOTE) | _SND_SEQ_TYPE(SND_SEQ_EVFLG_CONTROL)))
+
+/** event type check: queue control events */
+#define snd_seq_ev_is_queue_type(ev) \
+ snd_seq_type_check(ev, SND_SEQ_EVFLG_QUEUE)
+/** event type check: system status messages */
+#define snd_seq_ev_is_message_type(ev) \
+ snd_seq_type_check(ev, SND_SEQ_EVFLG_MESSAGE)
+/** event type check: system status messages */
+#define snd_seq_ev_is_subscribe_type(ev) \
+ snd_seq_type_check(ev, SND_SEQ_EVFLG_CONNECTION)
+/** event type check: sample messages */
+#define snd_seq_ev_is_sample_type(ev) \
+ snd_seq_type_check(ev, SND_SEQ_EVFLG_SAMPLE)
+/** event type check: user-defined messages */
+#define snd_seq_ev_is_user_type(ev) \
+ snd_seq_type_check(ev, SND_SEQ_EVFLG_USERS)
+/** event type check: instrument layer events */
+#define snd_seq_ev_is_instr_type(ev) \
+ snd_seq_type_check(ev, SND_SEQ_EVFLG_INSTR)
+/** event type check: fixed length events */
+#define snd_seq_ev_is_fixed_type(ev) \
+ snd_seq_type_check(ev, SND_SEQ_EVFLG_FIXED)
+/** event type check: variable length events */
+#define snd_seq_ev_is_variable_type(ev) \
+ snd_seq_type_check(ev, SND_SEQ_EVFLG_VARIABLE)
+/** event type check: user pointer events */
+#define snd_seq_ev_is_varusr_type(ev) \
+ snd_seq_type_check(ev, SND_SEQ_EVFLG_VARUSR)
+/** event type check: reserved for kernel */
+#define snd_seq_ev_is_reserved(ev) \
+ (! snd_seq_event_types[(ev)->type])
+
+/**
+ * macros to check event flags
+ */
+/** prior events */
+#define snd_seq_ev_is_prior(ev) \
+ (((ev)->flags & SND_SEQ_PRIORITY_MASK) == SND_SEQ_PRIORITY_HIGH)
+
+/** get the data length type */
+#define snd_seq_ev_length_type(ev) \
+ ((ev)->flags & SND_SEQ_EVENT_LENGTH_MASK)
+/** fixed length events */
+#define snd_seq_ev_is_fixed(ev) \
+ (snd_seq_ev_length_type(ev) == SND_SEQ_EVENT_LENGTH_FIXED)
+/** variable length events */
+#define snd_seq_ev_is_variable(ev) \
+ (snd_seq_ev_length_type(ev) == SND_SEQ_EVENT_LENGTH_VARIABLE)
+/** variable length on user-space */
+#define snd_seq_ev_is_varusr(ev) \
+ (snd_seq_ev_length_type(ev) == SND_SEQ_EVENT_LENGTH_VARUSR)
+
+/** time-stamp type */
+#define snd_seq_ev_timestamp_type(ev) \
+ ((ev)->flags & SND_SEQ_TIME_STAMP_MASK)
+/** event is in tick time */
+#define snd_seq_ev_is_tick(ev) \
+ (snd_seq_ev_timestamp_type(ev) == SND_SEQ_TIME_STAMP_TICK)
+/** event is in real-time */
+#define snd_seq_ev_is_real(ev) \
+ (snd_seq_ev_timestamp_type(ev) == SND_SEQ_TIME_STAMP_REAL)
+
+/** time-mode type */
+#define snd_seq_ev_timemode_type(ev) \
+ ((ev)->flags & SND_SEQ_TIME_MODE_MASK)
+/** scheduled in absolute time */
+#define snd_seq_ev_is_abstime(ev) \
+ (snd_seq_ev_timemode_type(ev) == SND_SEQ_TIME_MODE_ABS)
+/** scheduled in relative time */
+#define snd_seq_ev_is_reltime(ev) \
+ (snd_seq_ev_timemode_type(ev) == SND_SEQ_TIME_MODE_REL)
+
+/** direct dispatched events */
+#define snd_seq_ev_is_direct(ev) \
+ ((ev)->queue == SND_SEQ_QUEUE_DIRECT)
+
+/** \} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __ALSA_SEQ_H */
+
diff --git a/sysroot/usr/include/alsa/seq_event.h b/sysroot/usr/include/alsa/seq_event.h
new file mode 100644
index 0000000..5bee415
--- /dev/null
+++ b/sysroot/usr/include/alsa/seq_event.h
@@ -0,0 +1,452 @@
+/**
+ * \file include/seq_event.h
+ * \brief Application interface library for the ALSA driver
+ * \author Jaroslav Kysela <perex@perex.cz>
+ * \author Abramo Bagnara <abramo@alsa-project.org>
+ * \author Takashi Iwai <tiwai@suse.de>
+ * \date 1998-2001
+ *
+ * Application interface library for the ALSA driver
+ */
+/*
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef __ALSA_SEQ_EVENT_H
+#define __ALSA_SEQ_EVENT_H
+
+/**
+ * \defgroup SeqEvents Sequencer Event Definitions
+ * Sequencer Event Definitions
+ * \ingroup Sequencer
+ * \{
+ */
+
+/**
+ * Sequencer event data type
+ */
+typedef unsigned char snd_seq_event_type_t;
+
+/** Sequencer event type */
+enum snd_seq_event_type {
+ /** system status; event data type = #snd_seq_result_t */
+ SND_SEQ_EVENT_SYSTEM = 0,
+ /** returned result status; event data type = #snd_seq_result_t */
+ SND_SEQ_EVENT_RESULT,
+
+ /** note on and off with duration; event data type = #snd_seq_ev_note_t */
+ SND_SEQ_EVENT_NOTE = 5,
+ /** note on; event data type = #snd_seq_ev_note_t */
+ SND_SEQ_EVENT_NOTEON,
+ /** note off; event data type = #snd_seq_ev_note_t */
+ SND_SEQ_EVENT_NOTEOFF,
+ /** key pressure change (aftertouch); event data type = #snd_seq_ev_note_t */
+ SND_SEQ_EVENT_KEYPRESS,
+
+ /** controller; event data type = #snd_seq_ev_ctrl_t */
+ SND_SEQ_EVENT_CONTROLLER = 10,
+ /** program change; event data type = #snd_seq_ev_ctrl_t */
+ SND_SEQ_EVENT_PGMCHANGE,
+ /** channel pressure; event data type = #snd_seq_ev_ctrl_t */
+ SND_SEQ_EVENT_CHANPRESS,
+ /** pitchwheel; event data type = #snd_seq_ev_ctrl_t; data is from -8192 to 8191) */
+ SND_SEQ_EVENT_PITCHBEND,
+ /** 14 bit controller value; event data type = #snd_seq_ev_ctrl_t */
+ SND_SEQ_EVENT_CONTROL14,
+ /** 14 bit NRPN; event data type = #snd_seq_ev_ctrl_t */
+ SND_SEQ_EVENT_NONREGPARAM,
+ /** 14 bit RPN; event data type = #snd_seq_ev_ctrl_t */
+ SND_SEQ_EVENT_REGPARAM,
+
+ /** SPP with LSB and MSB values; event data type = #snd_seq_ev_ctrl_t */
+ SND_SEQ_EVENT_SONGPOS = 20,
+ /** Song Select with song ID number; event data type = #snd_seq_ev_ctrl_t */
+ SND_SEQ_EVENT_SONGSEL,
+ /** midi time code quarter frame; event data type = #snd_seq_ev_ctrl_t */
+ SND_SEQ_EVENT_QFRAME,
+ /** SMF Time Signature event; event data type = #snd_seq_ev_ctrl_t */
+ SND_SEQ_EVENT_TIMESIGN,
+ /** SMF Key Signature event; event data type = #snd_seq_ev_ctrl_t */
+ SND_SEQ_EVENT_KEYSIGN,
+
+ /** MIDI Real Time Start message; event data type = #snd_seq_ev_queue_control_t */
+ SND_SEQ_EVENT_START = 30,
+ /** MIDI Real Time Continue message; event data type = #snd_seq_ev_queue_control_t */
+ SND_SEQ_EVENT_CONTINUE,
+ /** MIDI Real Time Stop message; event data type = #snd_seq_ev_queue_control_t */
+ SND_SEQ_EVENT_STOP,
+ /** Set tick queue position; event data type = #snd_seq_ev_queue_control_t */
+ SND_SEQ_EVENT_SETPOS_TICK,
+ /** Set real-time queue position; event data type = #snd_seq_ev_queue_control_t */
+ SND_SEQ_EVENT_SETPOS_TIME,
+ /** (SMF) Tempo event; event data type = #snd_seq_ev_queue_control_t */
+ SND_SEQ_EVENT_TEMPO,
+ /** MIDI Real Time Clock message; event data type = #snd_seq_ev_queue_control_t */
+ SND_SEQ_EVENT_CLOCK,
+ /** MIDI Real Time Tick message; event data type = #snd_seq_ev_queue_control_t */
+ SND_SEQ_EVENT_TICK,
+ /** Queue timer skew; event data type = #snd_seq_ev_queue_control_t */
+ SND_SEQ_EVENT_QUEUE_SKEW,
+ /** Sync position changed; event data type = #snd_seq_ev_queue_control_t */
+ SND_SEQ_EVENT_SYNC_POS,
+
+ /** Tune request; event data type = none */
+ SND_SEQ_EVENT_TUNE_REQUEST = 40,
+ /** Reset to power-on state; event data type = none */
+ SND_SEQ_EVENT_RESET,
+ /** Active sensing event; event data type = none */
+ SND_SEQ_EVENT_SENSING,
+
+ /** Echo-back event; event data type = any type */
+ SND_SEQ_EVENT_ECHO = 50,
+ /** OSS emulation raw event; event data type = any type */
+ SND_SEQ_EVENT_OSS,
+
+ /** New client has connected; event data type = #snd_seq_addr_t */
+ SND_SEQ_EVENT_CLIENT_START = 60,
+ /** Client has left the system; event data type = #snd_seq_addr_t */
+ SND_SEQ_EVENT_CLIENT_EXIT,
+ /** Client status/info has changed; event data type = #snd_seq_addr_t */
+ SND_SEQ_EVENT_CLIENT_CHANGE,
+ /** New port was created; event data type = #snd_seq_addr_t */
+ SND_SEQ_EVENT_PORT_START,
+ /** Port was deleted from system; event data type = #snd_seq_addr_t */
+ SND_SEQ_EVENT_PORT_EXIT,
+ /** Port status/info has changed; event data type = #snd_seq_addr_t */
+ SND_SEQ_EVENT_PORT_CHANGE,
+
+ /** Ports connected; event data type = #snd_seq_connect_t */
+ SND_SEQ_EVENT_PORT_SUBSCRIBED,
+ /** Ports disconnected; event data type = #snd_seq_connect_t */
+ SND_SEQ_EVENT_PORT_UNSUBSCRIBED,
+
+ /** Sample select; event data type = #snd_seq_ev_sample_control_t */
+ SND_SEQ_EVENT_SAMPLE = 70,
+ /** Sample cluster select; event data type = #snd_seq_ev_sample_control_t */
+ SND_SEQ_EVENT_SAMPLE_CLUSTER,
+ /** voice start */
+ SND_SEQ_EVENT_SAMPLE_START,
+ /** voice stop */
+ SND_SEQ_EVENT_SAMPLE_STOP,
+ /** playback frequency */
+ SND_SEQ_EVENT_SAMPLE_FREQ,
+ /** volume and balance */
+ SND_SEQ_EVENT_SAMPLE_VOLUME,
+ /** sample loop */
+ SND_SEQ_EVENT_SAMPLE_LOOP,
+ /** sample position */
+ SND_SEQ_EVENT_SAMPLE_POSITION,
+ /** private (hardware dependent) event */
+ SND_SEQ_EVENT_SAMPLE_PRIVATE1,
+
+ /** user-defined event; event data type = any (fixed size) */
+ SND_SEQ_EVENT_USR0 = 90,
+ /** user-defined event; event data type = any (fixed size) */
+ SND_SEQ_EVENT_USR1,
+ /** user-defined event; event data type = any (fixed size) */
+ SND_SEQ_EVENT_USR2,
+ /** user-defined event; event data type = any (fixed size) */
+ SND_SEQ_EVENT_USR3,
+ /** user-defined event; event data type = any (fixed size) */
+ SND_SEQ_EVENT_USR4,
+ /** user-defined event; event data type = any (fixed size) */
+ SND_SEQ_EVENT_USR5,
+ /** user-defined event; event data type = any (fixed size) */
+ SND_SEQ_EVENT_USR6,
+ /** user-defined event; event data type = any (fixed size) */
+ SND_SEQ_EVENT_USR7,
+ /** user-defined event; event data type = any (fixed size) */
+ SND_SEQ_EVENT_USR8,
+ /** user-defined event; event data type = any (fixed size) */
+ SND_SEQ_EVENT_USR9,
+
+ /** begin of instrument management */
+ SND_SEQ_EVENT_INSTR_BEGIN = 100,
+ /** end of instrument management */
+ SND_SEQ_EVENT_INSTR_END,
+ /** query instrument interface info */
+ SND_SEQ_EVENT_INSTR_INFO,
+ /** result of instrument interface info */
+ SND_SEQ_EVENT_INSTR_INFO_RESULT,
+ /** query instrument format info */
+ SND_SEQ_EVENT_INSTR_FINFO,
+ /** result of instrument format info */
+ SND_SEQ_EVENT_INSTR_FINFO_RESULT,
+ /** reset instrument instrument memory */
+ SND_SEQ_EVENT_INSTR_RESET,
+ /** get instrument interface status */
+ SND_SEQ_EVENT_INSTR_STATUS,
+ /** result of instrument interface status */
+ SND_SEQ_EVENT_INSTR_STATUS_RESULT,
+ /** put an instrument to port */
+ SND_SEQ_EVENT_INSTR_PUT,
+ /** get an instrument from port */
+ SND_SEQ_EVENT_INSTR_GET,
+ /** result of instrument query */
+ SND_SEQ_EVENT_INSTR_GET_RESULT,
+ /** free instrument(s) */
+ SND_SEQ_EVENT_INSTR_FREE,
+ /** get instrument list */
+ SND_SEQ_EVENT_INSTR_LIST,
+ /** result of instrument list */
+ SND_SEQ_EVENT_INSTR_LIST_RESULT,
+ /** set cluster parameters */
+ SND_SEQ_EVENT_INSTR_CLUSTER,
+ /** get cluster parameters */
+ SND_SEQ_EVENT_INSTR_CLUSTER_GET,
+ /** result of cluster parameters */
+ SND_SEQ_EVENT_INSTR_CLUSTER_RESULT,
+ /** instrument change */
+ SND_SEQ_EVENT_INSTR_CHANGE,
+
+ /** system exclusive data (variable length); event data type = #snd_seq_ev_ext_t */
+ SND_SEQ_EVENT_SYSEX = 130,
+ /** error event; event data type = #snd_seq_ev_ext_t */
+ SND_SEQ_EVENT_BOUNCE,
+ /** reserved for user apps; event data type = #snd_seq_ev_ext_t */
+ SND_SEQ_EVENT_USR_VAR0 = 135,
+ /** reserved for user apps; event data type = #snd_seq_ev_ext_t */
+ SND_SEQ_EVENT_USR_VAR1,
+ /** reserved for user apps; event data type = #snd_seq_ev_ext_t */
+ SND_SEQ_EVENT_USR_VAR2,
+ /** reserved for user apps; event data type = #snd_seq_ev_ext_t */
+ SND_SEQ_EVENT_USR_VAR3,
+ /** reserved for user apps; event data type = #snd_seq_ev_ext_t */
+ SND_SEQ_EVENT_USR_VAR4,
+
+ /** NOP; ignored in any case */
+ SND_SEQ_EVENT_NONE = 255
+};
+
+
+/** Sequencer event address */
+typedef struct snd_seq_addr {
+ unsigned char client; /**< Client id */
+ unsigned char port; /**< Port id */
+} snd_seq_addr_t;
+
+/** Connection (subscription) between ports */
+typedef struct snd_seq_connect {
+ snd_seq_addr_t sender; /**< sender address */
+ snd_seq_addr_t dest; /**< destination address */
+} snd_seq_connect_t;
+
+
+/** Real-time data record */
+typedef struct snd_seq_real_time {
+ unsigned int tv_sec; /**< seconds */
+ unsigned int tv_nsec; /**< nanoseconds */
+} snd_seq_real_time_t;
+
+/** (MIDI) Tick-time data record */
+typedef unsigned int snd_seq_tick_time_t;
+
+/** unioned time stamp */
+typedef union snd_seq_timestamp {
+ snd_seq_tick_time_t tick; /**< tick-time */
+ struct snd_seq_real_time time; /**< real-time */
+} snd_seq_timestamp_t;
+
+
+/**
+ * Event mode flags
+ *
+ * NOTE: only 8 bits available!
+ */
+#define SND_SEQ_TIME_STAMP_TICK (0<<0) /**< timestamp in clock ticks */
+#define SND_SEQ_TIME_STAMP_REAL (1<<0) /**< timestamp in real time */
+#define SND_SEQ_TIME_STAMP_MASK (1<<0) /**< mask for timestamp bits */
+
+#define SND_SEQ_TIME_MODE_ABS (0<<1) /**< absolute timestamp */
+#define SND_SEQ_TIME_MODE_REL (1<<1) /**< relative to current time */
+#define SND_SEQ_TIME_MODE_MASK (1<<1) /**< mask for time mode bits */
+
+#define SND_SEQ_EVENT_LENGTH_FIXED (0<<2) /**< fixed event size */
+#define SND_SEQ_EVENT_LENGTH_VARIABLE (1<<2) /**< variable event size */
+#define SND_SEQ_EVENT_LENGTH_VARUSR (2<<2) /**< variable event size - user memory space */
+#define SND_SEQ_EVENT_LENGTH_MASK (3<<2) /**< mask for event length bits */
+
+#define SND_SEQ_PRIORITY_NORMAL (0<<4) /**< normal priority */
+#define SND_SEQ_PRIORITY_HIGH (1<<4) /**< event should be processed before others */
+#define SND_SEQ_PRIORITY_MASK (1<<4) /**< mask for priority bits */
+
+
+/** Note event */
+typedef struct snd_seq_ev_note {
+ unsigned char channel; /**< channel number */
+ unsigned char note; /**< note */
+ unsigned char velocity; /**< velocity */
+ unsigned char off_velocity; /**< note-off velocity; only for #SND_SEQ_EVENT_NOTE */
+ unsigned int duration; /**< duration until note-off; only for #SND_SEQ_EVENT_NOTE */
+} snd_seq_ev_note_t;
+
+/** Controller event */
+typedef struct snd_seq_ev_ctrl {
+ unsigned char channel; /**< channel number */
+ unsigned char unused[3]; /**< reserved */
+ unsigned int param; /**< control parameter */
+ signed int value; /**< control value */
+} snd_seq_ev_ctrl_t;
+
+/** generic set of bytes (12x8 bit) */
+typedef struct snd_seq_ev_raw8 {
+ unsigned char d[12]; /**< 8 bit value */
+} snd_seq_ev_raw8_t;
+
+/** generic set of integers (3x32 bit) */
+typedef struct snd_seq_ev_raw32 {
+ unsigned int d[3]; /**< 32 bit value */
+} snd_seq_ev_raw32_t;
+
+/** external stored data */
+typedef struct snd_seq_ev_ext {
+ unsigned int len; /**< length of data */
+ void *ptr; /**< pointer to data (note: can be 64-bit) */
+} __attribute__((packed)) snd_seq_ev_ext_t;
+
+/** Instrument cluster type */
+typedef unsigned int snd_seq_instr_cluster_t;
+
+/** Instrument type */
+typedef struct snd_seq_instr {
+ snd_seq_instr_cluster_t cluster; /**< cluster id */
+ unsigned int std; /**< instrument standard id; the upper byte means a private instrument (owner - client id) */
+ unsigned short bank; /**< instrument bank id */
+ unsigned short prg; /**< instrument program id */
+} snd_seq_instr_t;
+
+/** sample number */
+typedef struct snd_seq_ev_sample {
+ unsigned int std; /**< sample standard id */
+ unsigned short bank; /**< sample bank id */
+ unsigned short prg; /**< sample program id */
+} snd_seq_ev_sample_t;
+
+/** sample cluster */
+typedef struct snd_seq_ev_cluster {
+ snd_seq_instr_cluster_t cluster; /**< cluster id */
+} snd_seq_ev_cluster_t;
+
+/** sample position */
+typedef unsigned int snd_seq_position_t; /**< playback position (in samples) * 16 */
+
+/** sample stop mode */
+typedef enum snd_seq_stop_mode {
+ SND_SEQ_SAMPLE_STOP_IMMEDIATELY = 0, /**< terminate playing immediately */
+ SND_SEQ_SAMPLE_STOP_VENVELOPE = 1, /**< finish volume envelope */
+ SND_SEQ_SAMPLE_STOP_LOOP = 2 /**< terminate loop and finish wave */
+} snd_seq_stop_mode_t;
+
+/** sample frequency */
+typedef int snd_seq_frequency_t; /**< playback frequency in HZ * 16 */
+
+/** sample volume control; if any value is set to -1 == do not change */
+typedef struct snd_seq_ev_volume {
+ signed short volume; /**< range: 0-16383 */
+ signed short lr; /**< left-right balance; range: 0-16383 */
+ signed short fr; /**< front-rear balance; range: 0-16383 */
+ signed short du; /**< down-up balance; range: 0-16383 */
+} snd_seq_ev_volume_t;
+
+/** simple loop redefinition */
+typedef struct snd_seq_ev_loop {
+ unsigned int start; /**< loop start (in samples) * 16 */
+ unsigned int end; /**< loop end (in samples) * 16 */
+} snd_seq_ev_loop_t;
+
+/** Sample control events */
+typedef struct snd_seq_ev_sample_control {
+ unsigned char channel; /**< channel */
+ unsigned char unused[3]; /**< reserved */
+ union {
+ snd_seq_ev_sample_t sample; /**< sample number */
+ snd_seq_ev_cluster_t cluster; /**< cluster number */
+ snd_seq_position_t position; /**< position */
+ snd_seq_stop_mode_t stop_mode; /**< stop mode */
+ snd_seq_frequency_t frequency; /**< frequency */
+ snd_seq_ev_volume_t volume; /**< volume */
+ snd_seq_ev_loop_t loop; /**< loop control */
+ unsigned char raw8[8]; /**< raw 8-bit */
+ } param; /**< control parameters */
+} snd_seq_ev_sample_control_t;
+
+
+
+/** INSTR_BEGIN event */
+typedef struct snd_seq_ev_instr_begin {
+ int timeout; /**< zero = forever, otherwise timeout in ms */
+} snd_seq_ev_instr_begin_t;
+
+/** Result events */
+typedef struct snd_seq_result {
+ int event; /**< processed event type */
+ int result; /**< status */
+} snd_seq_result_t;
+
+/** Queue skew values */
+typedef struct snd_seq_queue_skew {
+ unsigned int value; /**< skew value */
+ unsigned int base; /**< skew base */
+} snd_seq_queue_skew_t;
+
+/** queue timer control */
+typedef struct snd_seq_ev_queue_control {
+ unsigned char queue; /**< affected queue */
+ unsigned char unused[3]; /**< reserved */
+ union {
+ signed int value; /**< affected value (e.g. tempo) */
+ snd_seq_timestamp_t time; /**< time */
+ unsigned int position; /**< sync position */
+ snd_seq_queue_skew_t skew; /**< queue skew */
+ unsigned int d32[2]; /**< any data */
+ unsigned char d8[8]; /**< any data */
+ } param; /**< data value union */
+} snd_seq_ev_queue_control_t;
+
+
+/** Sequencer event */
+typedef struct snd_seq_event {
+ snd_seq_event_type_t type; /**< event type */
+ unsigned char flags; /**< event flags */
+ unsigned char tag; /**< tag */
+
+ unsigned char queue; /**< schedule queue */
+ snd_seq_timestamp_t time; /**< schedule time */
+
+ snd_seq_addr_t source; /**< source address */
+ snd_seq_addr_t dest; /**< destination address */
+
+ union {
+ snd_seq_ev_note_t note; /**< note information */
+ snd_seq_ev_ctrl_t control; /**< MIDI control information */
+ snd_seq_ev_raw8_t raw8; /**< raw8 data */
+ snd_seq_ev_raw32_t raw32; /**< raw32 data */
+ snd_seq_ev_ext_t ext; /**< external data */
+ snd_seq_ev_queue_control_t queue; /**< queue control */
+ snd_seq_timestamp_t time; /**< timestamp */
+ snd_seq_addr_t addr; /**< address */
+ snd_seq_connect_t connect; /**< connect information */
+ snd_seq_result_t result; /**< operation result code */
+ snd_seq_ev_instr_begin_t instr_begin; /**< instrument */
+ snd_seq_ev_sample_control_t sample; /**< sample control */
+ } data; /**< event data... */
+} snd_seq_event_t;
+
+
+/** \} */
+
+#endif /* __ALSA_SEQ_EVENT_H */
+
diff --git a/sysroot/usr/include/alsa/seq_midi_event.h b/sysroot/usr/include/alsa/seq_midi_event.h
new file mode 100644
index 0000000..9b8ee59
--- /dev/null
+++ b/sysroot/usr/include/alsa/seq_midi_event.h
@@ -0,0 +1,65 @@
+/**
+ * \file include/seq_midi_event.h
+ * \brief Application interface library for the ALSA driver
+ * \author Jaroslav Kysela <perex@perex.cz>
+ * \author Abramo Bagnara <abramo@alsa-project.org>
+ * \author Takashi Iwai <tiwai@suse.de>
+ * \date 1998-2001
+ *
+ * Application interface library for the ALSA driver
+ */
+/*
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef __ALSA_SEQ_MIDI_EVENT_H
+#define __ALSA_SEQ_MIDI_EVENT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \defgroup MIDI_Event Sequencer event <-> MIDI byte stream coder
+ * \ingroup Sequencer
+ * Sequencer event <-> MIDI byte stream coder
+ * \{
+ */
+
+/** container for sequencer midi event parsers */
+typedef struct snd_midi_event snd_midi_event_t;
+
+int snd_midi_event_new(size_t bufsize, snd_midi_event_t **rdev);
+int snd_midi_event_resize_buffer(snd_midi_event_t *dev, size_t bufsize);
+void snd_midi_event_free(snd_midi_event_t *dev);
+void snd_midi_event_init(snd_midi_event_t *dev);
+void snd_midi_event_reset_encode(snd_midi_event_t *dev);
+void snd_midi_event_reset_decode(snd_midi_event_t *dev);
+void snd_midi_event_no_status(snd_midi_event_t *dev, int on);
+/* encode from byte stream - return number of written bytes if success */
+long snd_midi_event_encode(snd_midi_event_t *dev, const unsigned char *buf, long count, snd_seq_event_t *ev);
+int snd_midi_event_encode_byte(snd_midi_event_t *dev, int c, snd_seq_event_t *ev);
+/* decode from event to bytes - return number of written bytes if success */
+long snd_midi_event_decode(snd_midi_event_t *dev, unsigned char *buf, long count, const snd_seq_event_t *ev);
+
+/** \} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __ALSA_SEQ_MIDI_EVENT_H */
+
diff --git a/sysroot/usr/include/alsa/seqmid.h b/sysroot/usr/include/alsa/seqmid.h
new file mode 100644
index 0000000..68069b2
--- /dev/null
+++ b/sysroot/usr/include/alsa/seqmid.h
@@ -0,0 +1,490 @@
+/**
+ * \file include/seqmid.h
+ * \brief Application interface library for the ALSA driver
+ * \author Jaroslav Kysela <perex@perex.cz>
+ * \author Abramo Bagnara <abramo@alsa-project.org>
+ * \author Takashi Iwai <tiwai@suse.de>
+ * \date 1998-2001
+ *
+ * Application interface library for the ALSA driver
+ */
+/*
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef __ALSA_SEQMID_H
+#define __ALSA_SEQMID_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \defgroup SeqMiddle Sequencer Middle Level Interface
+ * Sequencer Middle Level Interface
+ * \ingroup Sequencer
+ * \{
+ */
+
+/**
+ * \brief initialize event record
+ * \param ev event record pointer
+ *
+ * This macro clears the given event record pointer to the default status.
+ */
+#define snd_seq_ev_clear(ev) \
+ memset(ev, 0, sizeof(snd_seq_event_t))
+
+/**
+ * \brief set the tag for given event
+ * \param ev event record
+ * \param t event tag
+ *
+ * This macro sets the tag to the given event record.
+ */
+#define snd_seq_ev_set_tag(ev,t) \
+ ((ev)->tag = (t))
+
+/**
+ * \brief set the explicit destination
+ * \param ev event record
+ * \param c destination client id
+ * \param p destination port id
+ *
+ * This macro sets the client and port id numbers to the given event record.
+ *
+ * \sa snd_seq_ev_set_subs()
+ */
+#define snd_seq_ev_set_dest(ev,c,p) \
+ ((ev)->dest.client = (c), (ev)->dest.port = (p))
+
+/**
+ * \brief set broadcasting to subscribers
+ * \param ev event record
+ *
+ * This macro sets the destination as the subscribers.
+ *
+ * \sa snd_seq_ev_set_dest()
+ */
+#define snd_seq_ev_set_subs(ev) \
+ ((ev)->dest.client = SND_SEQ_ADDRESS_SUBSCRIBERS,\
+ (ev)->dest.port = SND_SEQ_ADDRESS_UNKNOWN)
+
+/**
+ * \brief set broadcasting to all clients/ports
+ * \param ev event record
+ *
+ * This macro sets the destination as the broadcasting.
+ *
+ * \sa snd_seq_ev_set_dest()
+ */
+#define snd_seq_ev_set_broadcast(ev) \
+ ((ev)->dest.client = SND_SEQ_ADDRESS_BROADCAST,\
+ (ev)->dest.port = SND_SEQ_ADDRESS_BROADCAST)
+
+/**
+ * \brief set the source port
+ * \param ev event record
+ * \param p source port id
+ *
+ * This macro sets the source port id number.
+ */
+#define snd_seq_ev_set_source(ev,p) \
+ ((ev)->source.port = (p))
+
+/**
+ * \brief set direct passing mode (without queued)
+ * \param ev event instance
+ *
+ * This macro sets the event to the direct passing mode
+ * to be delivered immediately without queueing.
+ *
+ * \sa snd_seq_ev_schedule_tick(), snd_seq_ev_schedule_real()
+ */
+#define snd_seq_ev_set_direct(ev) \
+ ((ev)->queue = SND_SEQ_QUEUE_DIRECT)
+
+/**
+ * \brief set tick-scheduling mode on queue
+ * \param ev event instance
+ * \param q queue id to schedule
+ * \param relative relative time-stamp if non-zero
+ * \param ttick tick time-stamp to be delivered
+ *
+ * This macro sets the scheduling of the event in the
+ * MIDI tick mode.
+ *
+ * \sa snd_seq_ev_schedule_real(), snd_seq_ev_set_direct()
+ */
+#define snd_seq_ev_schedule_tick(ev, q, relative, ttick) \
+ ((ev)->flags &= ~(SND_SEQ_TIME_STAMP_MASK | SND_SEQ_TIME_MODE_MASK),\
+ (ev)->flags |= SND_SEQ_TIME_STAMP_TICK,\
+ (ev)->flags |= (relative) ? SND_SEQ_TIME_MODE_REL : SND_SEQ_TIME_MODE_ABS,\
+ (ev)->time.tick = (ttick),\
+ (ev)->queue = (q))
+
+/**
+ * \brief set real-time-scheduling mode on queue
+ * \param ev event instance
+ * \param q queue id to schedule
+ * \param relative relative time-stamp if non-zero
+ * \param rtime time-stamp to be delivered
+ *
+ * This macro sets the scheduling of the event in the
+ * realtime mode.
+ *
+ * \sa snd_seq_ev_schedule_tick(), snd_seq_ev_set_direct()
+ */
+#define snd_seq_ev_schedule_real(ev, q, relative, rtime) \
+ ((ev)->flags &= ~(SND_SEQ_TIME_STAMP_MASK | SND_SEQ_TIME_MODE_MASK),\
+ (ev)->flags |= SND_SEQ_TIME_STAMP_REAL,\
+ (ev)->flags |= (relative) ? SND_SEQ_TIME_MODE_REL : SND_SEQ_TIME_MODE_ABS,\
+ (ev)->time.time = *(rtime),\
+ (ev)->queue = (q))
+
+/**
+ * \brief set event priority
+ * \param ev event instance
+ * \param high_prior 1 for high priority mode
+ */
+#define snd_seq_ev_set_priority(ev, high_prior) \
+ ((ev)->flags &= ~SND_SEQ_PRIORITY_MASK,\
+ (ev)->flags |= (high_prior) ? SND_SEQ_PRIORITY_HIGH : SND_SEQ_PRIORITY_NORMAL)
+
+/**
+ * \brief set fixed data
+ * \param ev event instance
+ *
+ * Sets the event length mode as fixed size.
+ *
+ * \sa snd_seq_ev_set_variable(), snd_seq_ev_set_varusr()
+ */
+#define snd_seq_ev_set_fixed(ev) \
+ ((ev)->flags &= ~SND_SEQ_EVENT_LENGTH_MASK,\
+ (ev)->flags |= SND_SEQ_EVENT_LENGTH_FIXED)
+
+/**
+ * \brief set variable data
+ * \param ev event instance
+ * \param datalen length of the external data
+ * \param dataptr pointer of the external data
+ *
+ * Sets the event length mode as variable length and stores the data.
+ *
+ * \sa snd_seq_ev_set_fixed(), snd_seq_ev_set_varusr()
+ */
+#define snd_seq_ev_set_variable(ev, datalen, dataptr) \
+ ((ev)->flags &= ~SND_SEQ_EVENT_LENGTH_MASK,\
+ (ev)->flags |= SND_SEQ_EVENT_LENGTH_VARIABLE,\
+ (ev)->data.ext.len = (datalen),\
+ (ev)->data.ext.ptr = (dataptr))
+
+/**
+ * \brief set varusr data
+ * \param ev event instance
+ * \param datalen length of the external data
+ * \param dataptr pointer of the external data
+ *
+ * Sets the event length mode as variable user-space data and stores the data.
+ *
+ * \sa snd_seq_ev_set_fixed(), snd_seq_ev_set_variable()
+ */
+#define snd_seq_ev_set_varusr(ev, datalen, dataptr) \
+ ((ev)->flags &= ~SND_SEQ_EVENT_LENGTH_MASK,\
+ (ev)->flags |= SND_SEQ_EVENT_LENGTH_VARUSR,\
+ (ev)->data.ext.len = (datalen),\
+ (ev)->data.ext.ptr = (dataptr))
+
+/**
+ * \brief set queue controls
+ * \param ev event record
+ * \param typ event type
+ * \param q queue id
+ * \param val control value
+ */
+#define snd_seq_ev_set_queue_control(ev, typ, q, val) \
+ ((ev)->type = (typ),\
+ snd_seq_ev_set_dest(ev, SND_SEQ_CLIENT_SYSTEM, SND_SEQ_PORT_SYSTEM_TIMER),\
+ (ev)->data.queue.queue = (q),\
+ (ev)->data.queue.param.value = (val))
+
+/**
+ * \brief set the start queue event
+ * \param ev event record
+ * \param q queue id to start
+ *
+ * \sa snd_seq_ev_set_queue_stop(), snd_seq_ev_set_queue_continue()
+ */
+#define snd_seq_ev_set_queue_start(ev, q) \
+ snd_seq_ev_set_queue_control(ev, SND_SEQ_EVENT_START, q, 0)
+
+/**
+ * \brief set the stop queue event
+ * \param ev event record
+ * \param q queue id to stop
+ *
+ * \sa snd_seq_ev_set_queue_start(), snd_seq_ev_set_queue_continue()
+ */
+#define snd_seq_ev_set_queue_stop(ev, q) \
+ snd_seq_ev_set_queue_control(ev, SND_SEQ_EVENT_STOP, q, 0)
+
+/**
+ * \brief set the stop queue event
+ * \param ev event record
+ * \param q queue id to continue
+ *
+ * \sa snd_seq_ev_set_queue_start(), snd_seq_ev_set_queue_stop()
+ */
+#define snd_seq_ev_set_queue_continue(ev, q) \
+ snd_seq_ev_set_queue_control(ev, SND_SEQ_EVENT_CONTINUE, q, 0)
+
+/**
+ * \brief set the stop queue event
+ * \param ev event record
+ * \param q queue id to change tempo
+ * \param val the new tempo value
+ */
+#define snd_seq_ev_set_queue_tempo(ev, q, val) \
+ snd_seq_ev_set_queue_control(ev, SND_SEQ_EVENT_TEMPO, q, val)
+
+/**
+ * \brief set the real-time position of a queue
+ * \param ev event record
+ * \param q queue id to change tempo
+ * \param rtime the new real-time pointer
+ */
+#define snd_seq_ev_set_queue_pos_real(ev, q, rtime) \
+ ((ev)->type = SND_SEQ_EVENT_SETPOS_TIME,\
+ snd_seq_ev_set_dest(ev, SND_SEQ_CLIENT_SYSTEM, SND_SEQ_PORT_SYSTEM_TIMER),\
+ (ev)->data.queue.queue = (q),\
+ (ev)->data.queue.param.time.time = *(rtime))
+
+/**
+ * \brief set the tick-time position of a queue
+ * \param ev event record
+ * \param q queue id to change tempo
+ * \param ttime the new tick-time
+ */
+#define snd_seq_ev_set_queue_pos_tick(ev, q, ttime) \
+ ((ev)->type = SND_SEQ_EVENT_SETPOS_TICK,\
+ snd_seq_ev_set_dest(ev, SND_SEQ_CLIENT_SYSTEM, SND_SEQ_PORT_SYSTEM_TIMER),\
+ (ev)->data.queue.queue = (q),\
+ (ev)->data.queue.param.time.tick = (ttime))
+
+/* set and send a queue control event */
+int snd_seq_control_queue(snd_seq_t *seq, int q, int type, int value, snd_seq_event_t *ev);
+
+/**
+ * \brief start the specified queue
+ * \param seq sequencer handle
+ * \param q queue id to start
+ * \param ev optional event record (see #snd_seq_control_queue)
+ */
+#define snd_seq_start_queue(seq, q, ev) \
+ snd_seq_control_queue(seq, q, SND_SEQ_EVENT_START, 0, ev)
+
+/**
+ * \brief stop the specified queue
+ * \param seq sequencer handle
+ * \param q queue id to stop
+ * \param ev optional event record (see #snd_seq_control_queue)
+ */
+#define snd_seq_stop_queue(seq, q, ev) \
+ snd_seq_control_queue(seq, q, SND_SEQ_EVENT_STOP, 0, ev)
+
+/**
+ * \brief continue the specified queue
+ * \param seq sequencer handle
+ * \param q queue id to continue
+ * \param ev optional event record (see #snd_seq_control_queue)
+ */
+#define snd_seq_continue_queue(seq, q, ev) \
+ snd_seq_control_queue(seq, q, SND_SEQ_EVENT_CONTINUE, 0, ev)
+
+/**
+ * \brief change the tempo of the specified queue
+ * \param seq sequencer handle
+ * \param q queue id
+ * \param tempo the new tempo value
+ * \param ev optional event record (see #snd_seq_control_queue)
+ */
+#define snd_seq_change_queue_tempo(seq, q, tempo, ev) \
+ snd_seq_control_queue(seq, q, SND_SEQ_EVENT_TEMPO, tempo, ev)
+
+/* create a port - simple version - return the port number */
+int snd_seq_create_simple_port(snd_seq_t *seq, const char *name,
+ unsigned int caps, unsigned int type);
+/* delete the port */
+int snd_seq_delete_simple_port(snd_seq_t *seq, int port);
+
+/* simple subscription between this port and another port
+ (w/o exclusive & time conversion)
+ */
+int snd_seq_connect_from(snd_seq_t *seq, int my_port, int src_client, int src_port);
+int snd_seq_connect_to(snd_seq_t *seq, int my_port, int dest_client, int dest_port);
+int snd_seq_disconnect_from(snd_seq_t *seq, int my_port, int src_client, int src_port);
+int snd_seq_disconnect_to(snd_seq_t *seq, int my_port, int dest_client, int dest_port);
+
+/*
+ * set client information
+ */
+int snd_seq_set_client_name(snd_seq_t *seq, const char *name);
+int snd_seq_set_client_event_filter(snd_seq_t *seq, int event_type);
+int snd_seq_set_client_pool_output(snd_seq_t *seq, size_t size);
+int snd_seq_set_client_pool_output_room(snd_seq_t *seq, size_t size);
+int snd_seq_set_client_pool_input(snd_seq_t *seq, size_t size);
+/* sync output queue */
+int snd_seq_sync_output_queue(snd_seq_t *seq);
+
+/*
+ * parse the given string and get the sequencer address
+ */
+int snd_seq_parse_address(snd_seq_t *seq, snd_seq_addr_t *addr, const char *str);
+
+/*
+ * reset client input/output pool
+ */
+int snd_seq_reset_pool_output(snd_seq_t *seq);
+int snd_seq_reset_pool_input(snd_seq_t *seq);
+
+/**
+ * \brief set note event
+ * \param ev event record
+ * \param ch channel number
+ * \param key note key
+ * \param vel velocity
+ * \param dur duration (in tick or msec)
+ */
+#define snd_seq_ev_set_note(ev, ch, key, vel, dur) \
+ ((ev)->type = SND_SEQ_EVENT_NOTE,\
+ snd_seq_ev_set_fixed(ev),\
+ (ev)->data.note.channel = (ch),\
+ (ev)->data.note.note = (key),\
+ (ev)->data.note.velocity = (vel),\
+ (ev)->data.note.duration = (dur))
+
+/**
+ * \brief set note-on event
+ * \param ev event record
+ * \param ch channel number
+ * \param key note key
+ * \param vel velocity
+ */
+#define snd_seq_ev_set_noteon(ev, ch, key, vel) \
+ ((ev)->type = SND_SEQ_EVENT_NOTEON,\
+ snd_seq_ev_set_fixed(ev),\
+ (ev)->data.note.channel = (ch),\
+ (ev)->data.note.note = (key),\
+ (ev)->data.note.velocity = (vel))
+
+/**
+ * \brief set note-off event
+ * \param ev event record
+ * \param ch channel number
+ * \param key note key
+ * \param vel velocity
+ */
+#define snd_seq_ev_set_noteoff(ev, ch, key, vel) \
+ ((ev)->type = SND_SEQ_EVENT_NOTEOFF,\
+ snd_seq_ev_set_fixed(ev),\
+ (ev)->data.note.channel = (ch),\
+ (ev)->data.note.note = (key),\
+ (ev)->data.note.velocity = (vel))
+
+/**
+ * \brief set key-pressure event
+ * \param ev event record
+ * \param ch channel number
+ * \param key note key
+ * \param vel velocity
+ */
+#define snd_seq_ev_set_keypress(ev,ch,key,vel) \
+ ((ev)->type = SND_SEQ_EVENT_KEYPRESS,\
+ snd_seq_ev_set_fixed(ev),\
+ (ev)->data.note.channel = (ch),\
+ (ev)->data.note.note = (key),\
+ (ev)->data.note.velocity = (vel))
+
+/**
+ * \brief set MIDI controller event
+ * \param ev event record
+ * \param ch channel number
+ * \param cc controller number
+ * \param val control value
+ */
+#define snd_seq_ev_set_controller(ev,ch,cc,val) \
+ ((ev)->type = SND_SEQ_EVENT_CONTROLLER,\
+ snd_seq_ev_set_fixed(ev),\
+ (ev)->data.control.channel = (ch),\
+ (ev)->data.control.param = (cc),\
+ (ev)->data.control.value = (val))
+
+/**
+ * \brief set program change event
+ * \param ev event record
+ * \param ch channel number
+ * \param val program number
+ */
+#define snd_seq_ev_set_pgmchange(ev,ch,val) \
+ ((ev)->type = SND_SEQ_EVENT_PGMCHANGE,\
+ snd_seq_ev_set_fixed(ev),\
+ (ev)->data.control.channel = (ch),\
+ (ev)->data.control.value = (val))
+
+/**
+ * \brief set pitch-bend event
+ * \param ev event record
+ * \param ch channel number
+ * \param val pitch bend; zero centered from -8192 to 8191
+ */
+#define snd_seq_ev_set_pitchbend(ev,ch,val) \
+ ((ev)->type = SND_SEQ_EVENT_PITCHBEND,\
+ snd_seq_ev_set_fixed(ev),\
+ (ev)->data.control.channel = (ch),\
+ (ev)->data.control.value = (val))
+
+/**
+ * \brief set channel pressure event
+ * \param ev event record
+ * \param ch channel number
+ * \param val channel pressure value
+ */
+#define snd_seq_ev_set_chanpress(ev,ch,val) \
+ ((ev)->type = SND_SEQ_EVENT_CHANPRESS,\
+ snd_seq_ev_set_fixed(ev),\
+ (ev)->data.control.channel = (ch),\
+ (ev)->data.control.value = (val))
+
+/**
+ * \brief set sysex event
+ * \param ev event record
+ * \param datalen length of sysex data
+ * \param dataptr sysex data pointer
+ *
+ * the sysex data must contain the start byte 0xf0 and the end byte 0xf7.
+ */
+#define snd_seq_ev_set_sysex(ev,datalen,dataptr) \
+ ((ev)->type = SND_SEQ_EVENT_SYSEX,\
+ snd_seq_ev_set_variable(ev, datalen, dataptr))
+
+/** \} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __ALSA_SEQMID_H */
+
diff --git a/sysroot/usr/include/alsa/sound/ainstr_fm.h b/sysroot/usr/include/alsa/sound/ainstr_fm.h
new file mode 100644
index 0000000..43a10a0
--- /dev/null
+++ b/sysroot/usr/include/alsa/sound/ainstr_fm.h
@@ -0,0 +1,129 @@
+/*
+ * Advanced Linux Sound Architecture
+ *
+ * FM (OPL2/3) Instrument Format
+ * Copyright (c) 2000 Uros Bizjak <uros@kss-loka.si>
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef __SOUND_AINSTR_FM_H
+#define __SOUND_AINSTR_FM_H
+
+#include "type_compat.h"
+
+/*
+ * share types (share ID 1)
+ */
+
+#define FM_SHARE_FILE 0
+
+/*
+ * FM operator
+ */
+
+typedef struct fm_operator {
+ unsigned char am_vib;
+ unsigned char ksl_level;
+ unsigned char attack_decay;
+ unsigned char sustain_release;
+ unsigned char wave_select;
+} fm_operator_t;
+
+/*
+ * Instrument
+ */
+
+#define FM_PATCH_OPL2 0x01 /* OPL2 2 operators FM instrument */
+#define FM_PATCH_OPL3 0x02 /* OPL3 4 operators FM instrument */
+
+typedef struct {
+ unsigned int share_id[4]; /* share id - zero = no sharing */
+ unsigned char type; /* instrument type */
+
+ fm_operator_t op[4];
+ unsigned char feedback_connection[2];
+
+ unsigned char echo_delay;
+ unsigned char echo_atten;
+ unsigned char chorus_spread;
+ unsigned char trnsps;
+ unsigned char fix_dur;
+ unsigned char modes;
+ unsigned char fix_key;
+} fm_instrument_t;
+
+/*
+ *
+ * Kernel <-> user space
+ * Hardware (CPU) independent section
+ *
+ * * = zero or more
+ * + = one or more
+ *
+ * fm_xinstrument FM_STRU_INSTR
+ *
+ */
+
+#define FM_STRU_INSTR __cpu_to_be32(('I'<<24)|('N'<<16)|('S'<<8)|'T')
+
+/*
+ * FM operator
+ */
+
+typedef struct fm_xoperator {
+ __u8 am_vib;
+ __u8 ksl_level;
+ __u8 attack_decay;
+ __u8 sustain_release;
+ __u8 wave_select;
+} fm_xoperator_t;
+
+/*
+ * Instrument
+ */
+
+typedef struct fm_xinstrument {
+ __u32 stype; /* structure type */
+
+ __u32 share_id[4]; /* share id - zero = no sharing */
+ __u8 type; /* instrument type */
+
+ fm_xoperator_t op[4]; /* fm operators */
+ __u8 feedback_connection[2];
+
+ __u8 echo_delay;
+ __u8 echo_atten;
+ __u8 chorus_spread;
+ __u8 trnsps;
+ __u8 fix_dur;
+ __u8 modes;
+ __u8 fix_key;
+} fm_xinstrument_t;
+
+#ifdef __KERNEL__
+
+#include "seq_instr.h"
+
+extern char *snd_seq_fm_id;
+
+int snd_seq_fm_init(snd_seq_kinstr_ops_t * ops,
+ snd_seq_kinstr_ops_t * next);
+
+#endif
+
+#endif /* __SOUND_AINSTR_FM_H */
diff --git a/sysroot/usr/include/alsa/sound/ainstr_gf1.h b/sysroot/usr/include/alsa/sound/ainstr_gf1.h
new file mode 100644
index 0000000..824893f
--- /dev/null
+++ b/sysroot/usr/include/alsa/sound/ainstr_gf1.h
@@ -0,0 +1,224 @@
+/*
+ * Advanced Linux Sound Architecture
+ *
+ * GF1 (GUS) Patch Instrument Format
+ * Copyright (c) 1994-99 by Jaroslav Kysela <perex@perex.cz>
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef __SOUND_AINSTR_GF1_H
+#define __SOUND_AINSTR_GF1_H
+
+#include "type_compat.h"
+
+/*
+ * share types (share ID 1)
+ */
+
+#define GF1_SHARE_FILE 0
+
+/*
+ * wave formats
+ */
+
+#define GF1_WAVE_16BIT 0x0001 /* 16-bit wave */
+#define GF1_WAVE_UNSIGNED 0x0002 /* unsigned wave */
+#define GF1_WAVE_INVERT 0x0002 /* same as unsigned wave */
+#define GF1_WAVE_BACKWARD 0x0004 /* backward mode (maybe used for reverb or ping-ping loop) */
+#define GF1_WAVE_LOOP 0x0008 /* loop mode */
+#define GF1_WAVE_BIDIR 0x0010 /* bidirectional mode */
+#define GF1_WAVE_STEREO 0x0100 /* stereo mode */
+#define GF1_WAVE_ULAW 0x0200 /* uLaw compression mode */
+
+/*
+ * Wavetable definitions
+ */
+
+typedef struct gf1_wave {
+ unsigned int share_id[4]; /* share id - zero = no sharing */
+ unsigned int format; /* wave format */
+
+ struct {
+ unsigned int number; /* some other ID for this instrument */
+ unsigned int memory; /* begin of waveform in onboard memory */
+ unsigned char *ptr; /* pointer to waveform in system memory */
+ } address;
+
+ unsigned int size; /* size of waveform in samples */
+ unsigned int start; /* start offset in samples * 16 (lowest 4 bits - fraction) */
+ unsigned int loop_start; /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */
+ unsigned int loop_end; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */
+ unsigned short loop_repeat; /* loop repeat - 0 = forever */
+
+ unsigned char flags; /* GF1 patch flags */
+ unsigned char pad;
+ unsigned int sample_rate; /* sample rate in Hz */
+ unsigned int low_frequency; /* low frequency range */
+ unsigned int high_frequency; /* high frequency range */
+ unsigned int root_frequency; /* root frequency range */
+ signed short tune;
+ unsigned char balance;
+ unsigned char envelope_rate[6];
+ unsigned char envelope_offset[6];
+ unsigned char tremolo_sweep;
+ unsigned char tremolo_rate;
+ unsigned char tremolo_depth;
+ unsigned char vibrato_sweep;
+ unsigned char vibrato_rate;
+ unsigned char vibrato_depth;
+ unsigned short scale_frequency;
+ unsigned short scale_factor; /* 0-2048 or 0-2 */
+
+ struct gf1_wave *next;
+} gf1_wave_t;
+
+/*
+ * Instrument
+ */
+
+#define IWFFFF_EXCLUDE_NONE 0x0000 /* exclusion mode - none */
+#define IWFFFF_EXCLUDE_SINGLE 0x0001 /* exclude single - single note from the instrument group */
+#define IWFFFF_EXCLUDE_MULTIPLE 0x0002 /* exclude multiple - stop only same note from this instrument */
+
+#define IWFFFF_EFFECT_NONE 0
+#define IWFFFF_EFFECT_REVERB 1
+#define IWFFFF_EFFECT_CHORUS 2
+#define IWFFFF_EFFECT_ECHO 3
+
+typedef struct {
+ unsigned short exclusion;
+ unsigned short exclusion_group; /* 0 - none, 1-65535 */
+
+ unsigned char effect1; /* effect 1 */
+ unsigned char effect1_depth; /* 0-127 */
+ unsigned char effect2; /* effect 2 */
+ unsigned char effect2_depth; /* 0-127 */
+
+ gf1_wave_t *wave; /* first waveform */
+} gf1_instrument_t;
+
+/*
+ *
+ * Kernel <-> user space
+ * Hardware (CPU) independent section
+ *
+ * * = zero or more
+ * + = one or more
+ *
+ * gf1_xinstrument IWFFFF_STRU_INSTR
+ * +gf1_xwave IWFFFF_STRU_WAVE
+ *
+ */
+
+#define GF1_STRU_WAVE __cpu_to_be32(('W'<<24)|('A'<<16)|('V'<<8)|'E')
+#define GF1_STRU_INSTR __cpu_to_be32(('I'<<24)|('N'<<16)|('S'<<8)|'T')
+
+/*
+ * Wavetable definitions
+ */
+
+typedef struct gf1_xwave {
+ __u32 stype; /* structure type */
+
+ __u32 share_id[4]; /* share id - zero = no sharing */
+ __u32 format; /* wave format */
+
+ __u32 size; /* size of waveform in samples */
+ __u32 start; /* start offset in samples * 16 (lowest 4 bits - fraction) */
+ __u32 loop_start; /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */
+ __u32 loop_end; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */
+ __u16 loop_repeat; /* loop repeat - 0 = forever */
+
+ __u8 flags; /* GF1 patch flags */
+ __u8 pad;
+ __u32 sample_rate; /* sample rate in Hz */
+ __u32 low_frequency; /* low frequency range */
+ __u32 high_frequency; /* high frequency range */
+ __u32 root_frequency; /* root frequency range */
+ __s16 tune;
+ __u8 balance;
+ __u8 envelope_rate[6];
+ __u8 envelope_offset[6];
+ __u8 tremolo_sweep;
+ __u8 tremolo_rate;
+ __u8 tremolo_depth;
+ __u8 vibrato_sweep;
+ __u8 vibrato_rate;
+ __u8 vibrato_depth;
+ __u16 scale_frequency;
+ __u16 scale_factor; /* 0-2048 or 0-2 */
+} gf1_xwave_t;
+
+/*
+ * Instrument
+ */
+
+typedef struct gf1_xinstrument {
+ __u32 stype;
+
+ __u16 exclusion;
+ __u16 exclusion_group; /* 0 - none, 1-65535 */
+
+ __u8 effect1; /* effect 1 */
+ __u8 effect1_depth; /* 0-127 */
+ __u8 effect2; /* effect 2 */
+ __u8 effect2_depth; /* 0-127 */
+} gf1_xinstrument_t;
+
+/*
+ * Instrument info
+ */
+
+#define GF1_INFO_ENVELOPE (1<<0)
+#define GF1_INFO_TREMOLO (1<<1)
+#define GF1_INFO_VIBRATO (1<<2)
+
+typedef struct gf1_info {
+ unsigned char flags; /* supported wave flags */
+ unsigned char pad[3];
+ unsigned int features; /* supported features */
+ unsigned int max8_len; /* maximum 8-bit wave length */
+ unsigned int max16_len; /* maximum 16-bit wave length */
+} gf1_info_t;
+
+#ifdef __KERNEL__
+
+#include "seq_instr.h"
+
+extern char *snd_seq_gf1_id;
+
+typedef struct {
+ void *private_data;
+ int (*info)(void *private_data, gf1_info_t *info);
+ int (*put_sample)(void *private_data, gf1_wave_t *wave,
+ char *data, long len, int atomic);
+ int (*get_sample)(void *private_data, gf1_wave_t *wave,
+ char *data, long len, int atomic);
+ int (*remove_sample)(void *private_data, gf1_wave_t *wave,
+ int atomic);
+ void (*notify)(void *private_data, snd_seq_kinstr_t *instr, int what);
+ snd_seq_kinstr_ops_t kops;
+} snd_gf1_ops_t;
+
+int snd_seq_gf1_init(snd_gf1_ops_t *ops,
+ void *private_data,
+ snd_seq_kinstr_ops_t *next);
+
+#endif
+
+#endif /* __SOUND_AINSTR_GF1_H */
diff --git a/sysroot/usr/include/alsa/sound/ainstr_iw.h b/sysroot/usr/include/alsa/sound/ainstr_iw.h
new file mode 100644
index 0000000..9bb9e62
--- /dev/null
+++ b/sysroot/usr/include/alsa/sound/ainstr_iw.h
@@ -0,0 +1,372 @@
+/*
+ * Advanced Linux Sound Architecture
+ *
+ * InterWave FFFF Instrument Format
+ * Copyright (c) 1994-99 by Jaroslav Kysela <perex@perex.cz>
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef __SOUND_AINSTR_IW_H
+#define __SOUND_AINSTR_IW_H
+
+#include "type_compat.h"
+
+/*
+ * share types (share ID 1)
+ */
+
+#define IWFFFF_SHARE_FILE 0
+
+/*
+ * wave formats
+ */
+
+#define IWFFFF_WAVE_16BIT 0x0001 /* 16-bit wave */
+#define IWFFFF_WAVE_UNSIGNED 0x0002 /* unsigned wave */
+#define IWFFFF_WAVE_INVERT 0x0002 /* same as unsigned wave */
+#define IWFFFF_WAVE_BACKWARD 0x0004 /* backward mode (maybe used for reverb or ping-ping loop) */
+#define IWFFFF_WAVE_LOOP 0x0008 /* loop mode */
+#define IWFFFF_WAVE_BIDIR 0x0010 /* bidirectional mode */
+#define IWFFFF_WAVE_ULAW 0x0020 /* uLaw compressed wave */
+#define IWFFFF_WAVE_RAM 0x0040 /* wave is _preloaded_ in RAM (it is used for ROM simulation) */
+#define IWFFFF_WAVE_ROM 0x0080 /* wave is in ROM */
+#define IWFFFF_WAVE_STEREO 0x0100 /* wave is stereo */
+
+/*
+ * Wavetable definitions
+ */
+
+typedef struct iwffff_wave {
+ unsigned int share_id[4]; /* share id - zero = no sharing */
+ unsigned int format; /* wave format */
+
+ struct {
+ unsigned int number; /* some other ID for this wave */
+ unsigned int memory; /* begin of waveform in onboard memory */
+ unsigned char *ptr; /* pointer to waveform in system memory */
+ } address;
+
+ unsigned int size; /* size of waveform in samples */
+ unsigned int start; /* start offset in samples * 16 (lowest 4 bits - fraction) */
+ unsigned int loop_start; /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */
+ unsigned int loop_end; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */
+ unsigned short loop_repeat; /* loop repeat - 0 = forever */
+ unsigned int sample_ratio; /* sample ratio (44100 * 1024 / rate) */
+ unsigned char attenuation; /* 0 - 127 (no corresponding midi controller) */
+ unsigned char low_note; /* lower frequency range for this waveform */
+ unsigned char high_note; /* higher frequency range for this waveform */
+ unsigned char pad;
+
+ struct iwffff_wave *next;
+} iwffff_wave_t;
+
+/*
+ * Layer
+ */
+
+#define IWFFFF_LFO_SHAPE_TRIANGLE 0
+#define IWFFFF_LFO_SHAPE_POSTRIANGLE 1
+
+typedef struct iwffff_lfo {
+ unsigned short freq; /* (0-2047) 0.01Hz - 21.5Hz */
+ signed short depth; /* volume +- (0-255) 0.48675dB/step */
+ signed short sweep; /* 0 - 950 deciseconds */
+ unsigned char shape; /* see to IWFFFF_LFO_SHAPE_XXXX */
+ unsigned char delay; /* 0 - 255 deciseconds */
+} iwffff_lfo_t;
+
+#define IWFFFF_ENV_FLAG_RETRIGGER 0x0001 /* flag - retrigger */
+
+#define IWFFFF_ENV_MODE_ONE_SHOT 0x0001 /* mode - one shot */
+#define IWFFFF_ENV_MODE_SUSTAIN 0x0002 /* mode - sustain */
+#define IWFFFF_ENV_MODE_NO_SUSTAIN 0x0003 /* mode - no sustain */
+
+#define IWFFFF_ENV_INDEX_VELOCITY 0x0001 /* index - velocity */
+#define IWFFFF_ENV_INDEX_FREQUENCY 0x0002 /* index - frequency */
+
+typedef struct iwffff_env_point {
+ unsigned short offset;
+ unsigned short rate;
+} iwffff_env_point_t;
+
+typedef struct iwffff_env_record {
+ unsigned short nattack;
+ unsigned short nrelease;
+ unsigned short sustain_offset;
+ unsigned short sustain_rate;
+ unsigned short release_rate;
+ unsigned char hirange;
+ unsigned char pad;
+ struct iwffff_env_record *next;
+ /* points are stored here */
+ /* count of points = nattack + nrelease */
+} iwffff_env_record_t;
+
+typedef struct iwffff_env {
+ unsigned char flags;
+ unsigned char mode;
+ unsigned char index;
+ unsigned char pad;
+ struct iwffff_env_record *record;
+} iwffff_env_t;
+
+#define IWFFFF_LAYER_FLAG_RETRIGGER 0x0001 /* retrigger */
+
+#define IWFFFF_LAYER_VELOCITY_TIME 0x0000 /* velocity mode = time */
+#define IWFFFF_LAYER_VELOCITY_RATE 0x0001 /* velocity mode = rate */
+
+#define IWFFFF_LAYER_EVENT_KUP 0x0000 /* layer event - key up */
+#define IWFFFF_LAYER_EVENT_KDOWN 0x0001 /* layer event - key down */
+#define IWFFFF_LAYER_EVENT_RETRIG 0x0002 /* layer event - retrigger */
+#define IWFFFF_LAYER_EVENT_LEGATO 0x0003 /* layer event - legato */
+
+typedef struct iwffff_layer {
+ unsigned char flags;
+ unsigned char velocity_mode;
+ unsigned char layer_event;
+ unsigned char low_range; /* range for layer based */
+ unsigned char high_range; /* on either velocity or frequency */
+ unsigned char pan; /* pan offset from CC1 (0 left - 127 right) */
+ unsigned char pan_freq_scale; /* position based on frequency (0-127) */
+ unsigned char attenuation; /* 0-127 (no corresponding midi controller) */
+ iwffff_lfo_t tremolo; /* tremolo effect */
+ iwffff_lfo_t vibrato; /* vibrato effect */
+ unsigned short freq_scale; /* 0-2048, 1024 is equal to semitone scaling */
+ unsigned char freq_center; /* center for keyboard frequency scaling */
+ unsigned char pad;
+ iwffff_env_t penv; /* pitch envelope */
+ iwffff_env_t venv; /* volume envelope */
+
+ iwffff_wave_t *wave;
+ struct iwffff_layer *next;
+} iwffff_layer_t;
+
+/*
+ * Instrument
+ */
+
+#define IWFFFF_EXCLUDE_NONE 0x0000 /* exclusion mode - none */
+#define IWFFFF_EXCLUDE_SINGLE 0x0001 /* exclude single - single note from the instrument group */
+#define IWFFFF_EXCLUDE_MULTIPLE 0x0002 /* exclude multiple - stop only same note from this instrument */
+
+#define IWFFFF_LAYER_NONE 0x0000 /* not layered */
+#define IWFFFF_LAYER_ON 0x0001 /* layered */
+#define IWFFFF_LAYER_VELOCITY 0x0002 /* layered by velocity */
+#define IWFFFF_LAYER_FREQUENCY 0x0003 /* layered by frequency */
+
+#define IWFFFF_EFFECT_NONE 0
+#define IWFFFF_EFFECT_REVERB 1
+#define IWFFFF_EFFECT_CHORUS 2
+#define IWFFFF_EFFECT_ECHO 3
+
+typedef struct {
+ unsigned short exclusion;
+ unsigned short layer_type;
+ unsigned short exclusion_group; /* 0 - none, 1-65535 */
+
+ unsigned char effect1; /* effect 1 */
+ unsigned char effect1_depth; /* 0-127 */
+ unsigned char effect2; /* effect 2 */
+ unsigned char effect2_depth; /* 0-127 */
+
+ iwffff_layer_t *layer; /* first layer */
+} iwffff_instrument_t;
+
+/*
+ *
+ * Kernel <-> user space
+ * Hardware (CPU) independent section
+ *
+ * * = zero or more
+ * + = one or more
+ *
+ * iwffff_xinstrument IWFFFF_STRU_INSTR
+ * +iwffff_xlayer IWFFFF_STRU_LAYER
+ * *iwffff_xenv_record IWFFFF_STRU_ENV_RECT (tremolo)
+ * *iwffff_xenv_record IWFFFF_STRU_EVN_RECT (vibrato)
+ * +iwffff_xwave IWFFFF_STRU_WAVE
+ *
+ */
+
+#define IWFFFF_STRU_WAVE __cpu_to_be32(('W'<<24)|('A'<<16)|('V'<<8)|'E')
+#define IWFFFF_STRU_ENV_RECP __cpu_to_be32(('E'<<24)|('N'<<16)|('R'<<8)|'P')
+#define IWFFFF_STRU_ENV_RECV __cpu_to_be32(('E'<<24)|('N'<<16)|('R'<<8)|'V')
+#define IWFFFF_STRU_LAYER __cpu_to_be32(('L'<<24)|('A'<<16)|('Y'<<8)|'R')
+#define IWFFFF_STRU_INSTR __cpu_to_be32(('I'<<24)|('N'<<16)|('S'<<8)|'T')
+
+/*
+ * Wavetable definitions
+ */
+
+typedef struct iwffff_xwave {
+ __u32 stype; /* structure type */
+
+ __u32 share_id[4]; /* share id - zero = no sharing */
+
+ __u32 format; /* wave format */
+ __u32 offset; /* offset to ROM (address) */
+
+ __u32 size; /* size of waveform in samples */
+ __u32 start; /* start offset in samples * 16 (lowest 4 bits - fraction) */
+ __u32 loop_start; /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */
+ __u32 loop_end; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */
+ __u16 loop_repeat; /* loop repeat - 0 = forever */
+ __u32 sample_ratio; /* sample ratio (44100 * 1024 / rate) */
+ __u8 attenuation; /* 0 - 127 (no corresponding midi controller) */
+ __u8 low_note; /* lower frequency range for this waveform */
+ __u8 high_note; /* higher frequency range for this waveform */
+ __u8 pad;
+} iwffff_xwave_t;
+
+/*
+ * Layer
+ */
+
+typedef struct iwffff_xlfo {
+ __u16 freq; /* (0-2047) 0.01Hz - 21.5Hz */
+ __s16 depth; /* volume +- (0-255) 0.48675dB/step */
+ __s16 sweep; /* 0 - 950 deciseconds */
+ __u8 shape; /* see to ULTRA_IW_LFO_SHAPE_XXXX */
+ __u8 delay; /* 0 - 255 deciseconds */
+} iwffff_xlfo_t;
+
+typedef struct iwffff_xenv_point {
+ __u16 offset;
+ __u16 rate;
+} iwffff_xenv_point_t;
+
+typedef struct iwffff_xenv_record {
+ __u32 stype;
+ __u16 nattack;
+ __u16 nrelease;
+ __u16 sustain_offset;
+ __u16 sustain_rate;
+ __u16 release_rate;
+ __u8 hirange;
+ __u8 pad;
+ /* points are stored here.. */
+ /* count of points = nattack + nrelease */
+} iwffff_xenv_record_t;
+
+typedef struct iwffff_xenv {
+ __u8 flags;
+ __u8 mode;
+ __u8 index;
+ __u8 pad;
+} iwffff_xenv_t;
+
+typedef struct iwffff_xlayer {
+ __u32 stype;
+ __u8 flags;
+ __u8 velocity_mode;
+ __u8 layer_event;
+ __u8 low_range; /* range for layer based */
+ __u8 high_range; /* on either velocity or frequency */
+ __u8 pan; /* pan offset from CC1 (0 left - 127 right) */
+ __u8 pan_freq_scale; /* position based on frequency (0-127) */
+ __u8 attenuation; /* 0-127 (no corresponding midi controller) */
+ iwffff_xlfo_t tremolo; /* tremolo effect */
+ iwffff_xlfo_t vibrato; /* vibrato effect */
+ __u16 freq_scale; /* 0-2048, 1024 is equal to semitone scaling */
+ __u8 freq_center; /* center for keyboard frequency scaling */
+ __u8 pad;
+ iwffff_xenv_t penv; /* pitch envelope */
+ iwffff_xenv_t venv; /* volume envelope */
+} iwffff_xlayer_t;
+
+/*
+ * Instrument
+ */
+
+typedef struct iwffff_xinstrument {
+ __u32 stype;
+
+ __u16 exclusion;
+ __u16 layer_type;
+ __u16 exclusion_group; /* 0 - none, 1-65535 */
+
+ __u8 effect1; /* effect 1 */
+ __u8 effect1_depth; /* 0-127 */
+ __u8 effect2; /* effect 2 */
+ __u8 effect2_depth; /* 0-127 */
+} iwffff_xinstrument_t;
+
+/*
+ * ROM support
+ * InterWave ROMs are Little-Endian (x86)
+ */
+
+#define IWFFFF_ROM_HDR_SIZE 512
+
+typedef struct {
+ __u8 iwave[8];
+ __u8 revision;
+ __u8 series_number;
+ __u8 series_name[16];
+ __u8 date[10];
+ __u16 vendor_revision_major;
+ __u16 vendor_revision_minor;
+ __u32 rom_size;
+ __u8 copyright[128];
+ __u8 vendor_name[64];
+ __u8 description[128];
+} iwffff_rom_header_t;
+
+/*
+ * Instrument info
+ */
+
+#define IWFFFF_INFO_LFO_VIBRATO (1<<0)
+#define IWFFFF_INFO_LFO_VIBRATO_SHAPE (1<<1)
+#define IWFFFF_INFO_LFO_TREMOLO (1<<2)
+#define IWFFFF_INFO_LFO_TREMOLO_SHAPE (1<<3)
+
+typedef struct iwffff_info {
+ unsigned int format; /* supported format bits */
+ unsigned int effects; /* supported effects (1 << IWFFFF_EFFECT*) */
+ unsigned int lfos; /* LFO effects */
+ unsigned int max8_len; /* maximum 8-bit wave length */
+ unsigned int max16_len; /* maximum 16-bit wave length */
+} iwffff_info_t;
+
+#ifdef __KERNEL__
+
+#include "seq_instr.h"
+
+extern char *snd_seq_iwffff_id;
+
+typedef struct {
+ void *private_data;
+ int (*info)(void *private_data, iwffff_info_t *info);
+ int (*put_sample)(void *private_data, iwffff_wave_t *wave,
+ char *data, long len, int atomic);
+ int (*get_sample)(void *private_data, iwffff_wave_t *wave,
+ char *data, long len, int atomic);
+ int (*remove_sample)(void *private_data, iwffff_wave_t *wave,
+ int atomic);
+ void (*notify)(void *private_data, snd_seq_kinstr_t *instr, int what);
+ snd_seq_kinstr_ops_t kops;
+} snd_iwffff_ops_t;
+
+int snd_seq_iwffff_init(snd_iwffff_ops_t *ops,
+ void *private_data,
+ snd_seq_kinstr_ops_t *next);
+
+#endif
+
+#endif /* __SOUND_AINSTR_IW_H */
diff --git a/sysroot/usr/include/alsa/sound/ainstr_simple.h b/sysroot/usr/include/alsa/sound/ainstr_simple.h
new file mode 100644
index 0000000..4ab6ce2
--- /dev/null
+++ b/sysroot/usr/include/alsa/sound/ainstr_simple.h
@@ -0,0 +1,155 @@
+/*
+ * Advanced Linux Sound Architecture
+ *
+ * Simple (MOD player) Instrument Format
+ * Copyright (c) 1994-99 by Jaroslav Kysela <perex@perex.cz>
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef __SOUND_AINSTR_SIMPLE_H
+#define __SOUND_AINSTR_SIMPLE_H
+
+#include "type_compat.h"
+
+/*
+ * share types (share ID 1)
+ */
+
+#define SIMPLE_SHARE_FILE 0
+
+/*
+ * wave formats
+ */
+
+#define SIMPLE_WAVE_16BIT 0x0001 /* 16-bit wave */
+#define SIMPLE_WAVE_UNSIGNED 0x0002 /* unsigned wave */
+#define SIMPLE_WAVE_INVERT 0x0002 /* same as unsigned wave */
+#define SIMPLE_WAVE_BACKWARD 0x0004 /* backward mode (maybe used for reverb or ping-ping loop) */
+#define SIMPLE_WAVE_LOOP 0x0008 /* loop mode */
+#define SIMPLE_WAVE_BIDIR 0x0010 /* bidirectional mode */
+#define SIMPLE_WAVE_STEREO 0x0100 /* stereo wave */
+#define SIMPLE_WAVE_ULAW 0x0200 /* uLaw compression mode */
+
+/*
+ * instrument effects
+ */
+
+#define SIMPLE_EFFECT_NONE 0
+#define SIMPLE_EFFECT_REVERB 1
+#define SIMPLE_EFFECT_CHORUS 2
+#define SIMPLE_EFFECT_ECHO 3
+
+/*
+ * instrument info
+ */
+
+typedef struct simple_instrument_info {
+ unsigned int format; /* supported format bits */
+ unsigned int effects; /* supported effects (1 << SIMPLE_EFFECT_*) */
+ unsigned int max8_len; /* maximum 8-bit wave length */
+ unsigned int max16_len; /* maximum 16-bit wave length */
+} simple_instrument_info_t;
+
+/*
+ * Instrument
+ */
+
+typedef struct {
+ unsigned int share_id[4]; /* share id - zero = no sharing */
+ unsigned int format; /* wave format */
+
+ struct {
+ unsigned int number; /* some other ID for this instrument */
+ unsigned int memory; /* begin of waveform in onboard memory */
+ unsigned char *ptr; /* pointer to waveform in system memory */
+ } address;
+
+ unsigned int size; /* size of waveform in samples */
+ unsigned int start; /* start offset in samples * 16 (lowest 4 bits - fraction) */
+ unsigned int loop_start; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */
+ unsigned int loop_end; /* loop end offset in samples * 16 (lowest 4 bits - fraction) */
+ unsigned short loop_repeat; /* loop repeat - 0 = forever */
+
+ unsigned char effect1; /* effect 1 */
+ unsigned char effect1_depth; /* 0-127 */
+ unsigned char effect2; /* effect 2 */
+ unsigned char effect2_depth; /* 0-127 */
+} simple_instrument_t;
+
+/*
+ *
+ * Kernel <-> user space
+ * Hardware (CPU) independent section
+ *
+ * * = zero or more
+ * + = one or more
+ *
+ * simple_xinstrument SIMPLE_STRU_INSTR
+ *
+ */
+
+#define SIMPLE_STRU_INSTR __cpu_to_be32(('I'<<24)|('N'<<16)|('S'<<8)|'T')
+
+/*
+ * Instrument
+ */
+
+typedef struct simple_xinstrument {
+ __u32 stype;
+
+ __u32 share_id[4]; /* share id - zero = no sharing */
+ __u32 format; /* wave format */
+
+ __u32 size; /* size of waveform in samples */
+ __u32 start; /* start offset in samples * 16 (lowest 4 bits - fraction) */
+ __u32 loop_start; /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */
+ __u32 loop_end; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */
+ __u16 loop_repeat; /* loop repeat - 0 = forever */
+
+ __u8 effect1; /* effect 1 */
+ __u8 effect1_depth; /* 0-127 */
+ __u8 effect2; /* effect 2 */
+ __u8 effect2_depth; /* 0-127 */
+} simple_xinstrument_t;
+
+#ifdef __KERNEL__
+
+#include "seq_instr.h"
+
+extern char *snd_seq_simple_id;
+
+typedef struct {
+ void *private_data;
+ int (*info)(void *private_data, simple_instrument_info_t *info);
+ int (*put_sample)(void *private_data, simple_instrument_t *instr,
+ char *data, long len, int atomic);
+ int (*get_sample)(void *private_data, simple_instrument_t *instr,
+ char *data, long len, int atomic);
+ int (*remove_sample)(void *private_data, simple_instrument_t *instr,
+ int atomic);
+ void (*notify)(void *private_data, snd_seq_kinstr_t *instr, int what);
+ snd_seq_kinstr_ops_t kops;
+} snd_simple_ops_t;
+
+int snd_seq_simple_init(snd_simple_ops_t *ops,
+ void *private_data,
+ snd_seq_kinstr_ops_t *next);
+
+#endif
+
+#endif /* __SOUND_AINSTR_SIMPLE_H */
diff --git a/sysroot/usr/include/alsa/sound/asound_fm.h b/sysroot/usr/include/alsa/sound/asound_fm.h
new file mode 100644
index 0000000..fe0ea40
--- /dev/null
+++ b/sysroot/usr/include/alsa/sound/asound_fm.h
@@ -0,0 +1,115 @@
+#ifndef __SOUND_ASOUND_FM_H
+#define __SOUND_ASOUND_FM_H
+
+/*
+ * Advanced Linux Sound Architecture - ALSA
+ *
+ * Interface file between ALSA driver & user space
+ * Copyright (c) 1994-98 by Jaroslav Kysela <perex@perex.cz>,
+ * 4Front Technologies
+ *
+ * Direct FM control
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#define SNDRV_DM_FM_MODE_OPL2 0x00
+#define SNDRV_DM_FM_MODE_OPL3 0x01
+
+typedef struct snd_dm_fm_info {
+ unsigned char fm_mode; /* OPL mode, see SNDRV_DM_FM_MODE_XXX */
+ unsigned char rhythm; /* percussion mode flag */
+} snd_dm_fm_info_t;
+
+/*
+ * Data structure composing an FM "note" or sound event.
+ */
+
+typedef struct snd_dm_fm_voice {
+ unsigned char op; /* operator cell (0 or 1) */
+ unsigned char voice; /* FM voice (0 to 17) */
+
+ unsigned char am; /* amplitude modulation */
+ unsigned char vibrato; /* vibrato effect */
+ unsigned char do_sustain; /* sustain phase */
+ unsigned char kbd_scale; /* keyboard scaling */
+ unsigned char harmonic; /* 4 bits: harmonic and multiplier */
+ unsigned char scale_level; /* 2 bits: decrease output freq rises */
+ unsigned char volume; /* 6 bits: volume */
+
+ unsigned char attack; /* 4 bits: attack rate */
+ unsigned char decay; /* 4 bits: decay rate */
+ unsigned char sustain; /* 4 bits: sustain level */
+ unsigned char release; /* 4 bits: release rate */
+
+ unsigned char feedback; /* 3 bits: feedback for op0 */
+ unsigned char connection; /* 0 for serial, 1 for parallel */
+ unsigned char left; /* stereo left */
+ unsigned char right; /* stereo right */
+ unsigned char waveform; /* 3 bits: waveform shape */
+} snd_dm_fm_voice_t;
+
+/*
+ * This describes an FM note by its voice, octave, frequency number (10bit)
+ * and key on/off.
+ */
+
+typedef struct snd_dm_fm_note {
+ unsigned char voice; /* 0-17 voice channel */
+ unsigned char octave; /* 3 bits: what octave to play */
+ unsigned int fnum; /* 10 bits: frequency number */
+ unsigned char key_on; /* set for active, clear for silent */
+} snd_dm_fm_note_t;
+
+/*
+ * FM parameters that apply globally to all voices, and thus are not "notes"
+ */
+
+typedef struct snd_dm_fm_params {
+ unsigned char am_depth; /* amplitude modulation depth (1=hi) */
+ unsigned char vib_depth; /* vibrato depth (1=hi) */
+ unsigned char kbd_split; /* keyboard split */
+ unsigned char rhythm; /* percussion mode select */
+
+ /* This block is the percussion instrument data */
+ unsigned char bass;
+ unsigned char snare;
+ unsigned char tomtom;
+ unsigned char cymbal;
+ unsigned char hihat;
+} snd_dm_fm_params_t;
+
+/*
+ * FM mode ioctl settings
+ */
+
+#define SNDRV_DM_FM_IOCTL_INFO _IOR('H', 0x20, snd_dm_fm_info_t)
+#define SNDRV_DM_FM_IOCTL_RESET _IO ('H', 0x21)
+#define SNDRV_DM_FM_IOCTL_PLAY_NOTE _IOW('H', 0x22, snd_dm_fm_note_t)
+#define SNDRV_DM_FM_IOCTL_SET_VOICE _IOW('H', 0x23, snd_dm_fm_voice_t)
+#define SNDRV_DM_FM_IOCTL_SET_PARAMS _IOW('H', 0x24, snd_dm_fm_params_t)
+#define SNDRV_DM_FM_IOCTL_SET_MODE _IOW('H', 0x25, int)
+/* for OPL3 only */
+#define SNDRV_DM_FM_IOCTL_SET_CONNECTION _IOW('H', 0x26, int)
+
+#define SNDRV_DM_FM_OSS_IOCTL_RESET 0x20
+#define SNDRV_DM_FM_OSS_IOCTL_PLAY_NOTE 0x21
+#define SNDRV_DM_FM_OSS_IOCTL_SET_VOICE 0x22
+#define SNDRV_DM_FM_OSS_IOCTL_SET_PARAMS 0x23
+#define SNDRV_DM_FM_OSS_IOCTL_SET_MODE 0x24
+#define SNDRV_DM_FM_OSS_IOCTL_SET_OPL 0x25
+
+#endif /* __SOUND_ASOUND_FM_H */
diff --git a/sysroot/usr/include/alsa/sound/emu10k1.h b/sysroot/usr/include/alsa/sound/emu10k1.h
new file mode 100644
index 0000000..94018b7
--- /dev/null
+++ b/sysroot/usr/include/alsa/sound/emu10k1.h
@@ -0,0 +1,349 @@
+#ifndef __SOUND_EMU10K1_H
+#define __SOUND_EMU10K1_H
+
+/*
+ * Copyright (c) by Jaroslav Kysela <perex@perex.cz>,
+ * Creative Labs, Inc.
+ * Definitions for EMU10K1 (SB Live!) chips
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <stdint.h>
+
+/*
+ * ---- FX8010 ----
+ */
+
+#define EMU10K1_CARD_CREATIVE 0x00000000
+#define EMU10K1_CARD_EMUAPS 0x00000001
+
+#define EMU10K1_FX8010_PCM_COUNT 8
+
+/* instruction set */
+#define iMAC0 0x00 /* R = A + (X * Y >> 31) ; saturation */
+#define iMAC1 0x01 /* R = A + (-X * Y >> 31) ; saturation */
+#define iMAC2 0x02 /* R = A + (X * Y >> 31) ; wraparound */
+#define iMAC3 0x03 /* R = A + (-X * Y >> 31) ; wraparound */
+#define iMACINT0 0x04 /* R = A + X * Y ; saturation */
+#define iMACINT1 0x05 /* R = A + X * Y ; wraparound (31-bit) */
+#define iACC3 0x06 /* R = A + X + Y ; saturation */
+#define iMACMV 0x07 /* R = A, acc += X * Y >> 31 */
+#define iANDXOR 0x08 /* R = (A & X) ^ Y */
+#define iTSTNEG 0x09 /* R = (A >= Y) ? X : ~X */
+#define iLIMITGE 0x0a /* R = (A >= Y) ? X : Y */
+#define iLIMITLT 0x0b /* R = (A < Y) ? X : Y */
+#define iLOG 0x0c /* R = linear_data, A (log_data), X (max_exp), Y (format_word) */
+#define iEXP 0x0d /* R = log_data, A (linear_data), X (max_exp), Y (format_word) */
+#define iINTERP 0x0e /* R = A + (X * (Y - A) >> 31) ; saturation */
+#define iSKIP 0x0f /* R = A (cc_reg), X (count), Y (cc_test) */
+
+/* GPRs */
+#define FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x0f */
+#define EXTIN(x) (0x10 + (x)) /* x = 0x00 - 0x0f */
+#define EXTOUT(x) (0x20 + (x)) /* x = 0x00 - 0x0f */
+#define C_00000000 0x40
+#define C_00000001 0x41
+#define C_00000002 0x42
+#define C_00000003 0x43
+#define C_00000004 0x44
+#define C_00000008 0x45
+#define C_00000010 0x46
+#define C_00000020 0x47
+#define C_00000100 0x48
+#define C_00010000 0x49
+#define C_00080000 0x4a
+#define C_10000000 0x4b
+#define C_20000000 0x4c
+#define C_40000000 0x4d
+#define C_80000000 0x4e
+#define C_7fffffff 0x4f
+#define C_ffffffff 0x50
+#define C_fffffffe 0x51
+#define C_c0000000 0x52
+#define C_4f1bbcdc 0x53
+#define C_5a7ef9db 0x54
+#define C_00100000 0x55 /* ?? */
+#define GPR_ACCU 0x56 /* ACCUM, accumulator */
+#define GPR_COND 0x57 /* CCR, condition register */
+#define GPR_NOISE0 0x58 /* noise source */
+#define GPR_NOISE1 0x59 /* noise source */
+#define GPR_IRQ 0x5a /* IRQ register */
+#define GPR_DBAC 0x5b /* TRAM Delay Base Address Counter */
+#define GPR(x) (FXGPREGBASE + (x)) /* free GPRs: x = 0x00 - 0xff */
+#define ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */
+#define ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */
+#define ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */
+#define ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */
+
+#define A_FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x3f? */
+#define A_EXTIN(x) (0x40 + (x)) /* x = 0x00 - 0x1f? */
+#define A_EXTOUT(x) (0x60 + (x)) /* x = 0x00 - 0x1f? */
+#define A_GPR(x) (A_FXGPREGBASE + (x))
+
+/* cc_reg constants */
+#define CC_REG_NORMALIZED C_00000001
+#define CC_REG_BORROW C_00000002
+#define CC_REG_MINUS C_00000004
+#define CC_REG_ZERO C_00000008
+#define CC_REG_SATURATE C_00000010
+#define CC_REG_NONZERO C_00000100
+
+/* FX buses */
+#define FXBUS_PCM_LEFT 0x00
+#define FXBUS_PCM_RIGHT 0x01
+#define FXBUS_PCM_LEFT_REAR 0x02
+#define FXBUS_PCM_RIGHT_REAR 0x03
+#define FXBUS_MIDI_LEFT 0x04
+#define FXBUS_MIDI_RIGHT 0x05
+#define FXBUS_PCM_CENTER 0x06
+#define FXBUS_PCM_LFE 0x07
+#define FXBUS_PCM_LEFT_FRONT 0x08
+#define FXBUS_PCM_RIGHT_FRONT 0x09
+#define FXBUS_MIDI_REVERB 0x0c
+#define FXBUS_MIDI_CHORUS 0x0d
+#define FXBUS_PCM_LEFT_SIDE 0x0e
+#define FXBUS_PCM_RIGHT_SIDE 0x0f
+#define FXBUS_PT_LEFT 0x14
+#define FXBUS_PT_RIGHT 0x15
+
+/* Inputs */
+#define EXTIN_AC97_L 0x00 /* AC'97 capture channel - left */
+#define EXTIN_AC97_R 0x01 /* AC'97 capture channel - right */
+#define EXTIN_SPDIF_CD_L 0x02 /* internal S/PDIF CD - onboard - left */
+#define EXTIN_SPDIF_CD_R 0x03 /* internal S/PDIF CD - onboard - right */
+#define EXTIN_ZOOM_L 0x04 /* Zoom Video I2S - left */
+#define EXTIN_ZOOM_R 0x05 /* Zoom Video I2S - right */
+#define EXTIN_TOSLINK_L 0x06 /* LiveDrive - TOSLink Optical - left */
+#define EXTIN_TOSLINK_R 0x07 /* LiveDrive - TOSLink Optical - right */
+#define EXTIN_LINE1_L 0x08 /* LiveDrive - Line/Mic 1 - left */
+#define EXTIN_LINE1_R 0x09 /* LiveDrive - Line/Mic 1 - right */
+#define EXTIN_COAX_SPDIF_L 0x0a /* LiveDrive - Coaxial S/PDIF - left */
+#define EXTIN_COAX_SPDIF_R 0x0b /* LiveDrive - Coaxial S/PDIF - right */
+#define EXTIN_LINE2_L 0x0c /* LiveDrive - Line/Mic 2 - left */
+#define EXTIN_LINE2_R 0x0d /* LiveDrive - Line/Mic 2 - right */
+
+/* Outputs */
+#define EXTOUT_AC97_L 0x00 /* AC'97 playback channel - left */
+#define EXTOUT_AC97_R 0x01 /* AC'97 playback channel - right */
+#define EXTOUT_TOSLINK_L 0x02 /* LiveDrive - TOSLink Optical - left */
+#define EXTOUT_TOSLINK_R 0x03 /* LiveDrive - TOSLink Optical - right */
+#define EXTOUT_AC97_CENTER 0x04 /* SB Live 5.1 - center */
+#define EXTOUT_AC97_LFE 0x05 /* SB Live 5.1 - LFE */
+#define EXTOUT_HEADPHONE_L 0x06 /* LiveDrive - Headphone - left */
+#define EXTOUT_HEADPHONE_R 0x07 /* LiveDrive - Headphone - right */
+#define EXTOUT_REAR_L 0x08 /* Rear channel - left */
+#define EXTOUT_REAR_R 0x09 /* Rear channel - right */
+#define EXTOUT_ADC_CAP_L 0x0a /* ADC Capture buffer - left */
+#define EXTOUT_ADC_CAP_R 0x0b /* ADC Capture buffer - right */
+#define EXTOUT_MIC_CAP 0x0c /* MIC Capture buffer */
+#define EXTOUT_AC97_REAR_L 0x0d /* SB Live 5.1 (c) 2003 - Rear Left */
+#define EXTOUT_AC97_REAR_R 0x0e /* SB Live 5.1 (c) 2003 - Rear Right */
+#define EXTOUT_ACENTER 0x11 /* Analog Center */
+#define EXTOUT_ALFE 0x12 /* Analog LFE */
+
+/* Audigy Inputs */
+#define A_EXTIN_AC97_L 0x00 /* AC'97 capture channel - left */
+#define A_EXTIN_AC97_R 0x01 /* AC'97 capture channel - right */
+#define A_EXTIN_SPDIF_CD_L 0x02 /* digital CD left */
+#define A_EXTIN_SPDIF_CD_R 0x03 /* digital CD left */
+#define A_EXTIN_OPT_SPDIF_L 0x04 /* audigy drive Optical SPDIF - left */
+#define A_EXTIN_OPT_SPDIF_R 0x05 /* right */
+#define A_EXTIN_LINE2_L 0x08 /* audigy drive line2/mic2 - left */
+#define A_EXTIN_LINE2_R 0x09 /* right */
+#define A_EXTIN_ADC_L 0x0a /* Philips ADC - left */
+#define A_EXTIN_ADC_R 0x0b /* right */
+#define A_EXTIN_AUX2_L 0x0c /* audigy drive aux2 - left */
+#define A_EXTIN_AUX2_R 0x0d /* - right */
+
+/* Audigiy Outputs */
+#define A_EXTOUT_FRONT_L 0x00 /* digital front left */
+#define A_EXTOUT_FRONT_R 0x01 /* right */
+#define A_EXTOUT_CENTER 0x02 /* digital front center */
+#define A_EXTOUT_LFE 0x03 /* digital front lfe */
+#define A_EXTOUT_HEADPHONE_L 0x04 /* headphone audigy drive left */
+#define A_EXTOUT_HEADPHONE_R 0x05 /* right */
+#define A_EXTOUT_REAR_L 0x06 /* digital rear left */
+#define A_EXTOUT_REAR_R 0x07 /* right */
+#define A_EXTOUT_AFRONT_L 0x08 /* analog front left */
+#define A_EXTOUT_AFRONT_R 0x09 /* right */
+#define A_EXTOUT_ACENTER 0x0a /* analog center */
+#define A_EXTOUT_ALFE 0x0b /* analog LFE */
+#define A_EXTOUT_ASIDE_L 0x0c /* analog side left - Audigy 2 ZS */
+#define A_EXTOUT_ASIDE_R 0x0d /* right - Audigy 2 ZS */
+#define A_EXTOUT_AREAR_L 0x0e /* analog rear left */
+#define A_EXTOUT_AREAR_R 0x0f /* right */
+#define A_EXTOUT_AC97_L 0x10 /* AC97 left (front) */
+#define A_EXTOUT_AC97_R 0x11 /* right */
+#define A_EXTOUT_ADC_CAP_L 0x16 /* ADC capture buffer left */
+#define A_EXTOUT_ADC_CAP_R 0x17 /* right */
+#define A_EXTOUT_MIC_CAP 0x18 /* Mic capture buffer */
+
+/* Audigy constants */
+#define A_C_00000000 0xc0
+#define A_C_00000001 0xc1
+#define A_C_00000002 0xc2
+#define A_C_00000003 0xc3
+#define A_C_00000004 0xc4
+#define A_C_00000008 0xc5
+#define A_C_00000010 0xc6
+#define A_C_00000020 0xc7
+#define A_C_00000100 0xc8
+#define A_C_00010000 0xc9
+#define A_C_00000800 0xca
+#define A_C_10000000 0xcb
+#define A_C_20000000 0xcc
+#define A_C_40000000 0xcd
+#define A_C_80000000 0xce
+#define A_C_7fffffff 0xcf
+#define A_C_ffffffff 0xd0
+#define A_C_fffffffe 0xd1
+#define A_C_c0000000 0xd2
+#define A_C_4f1bbcdc 0xd3
+#define A_C_5a7ef9db 0xd4
+#define A_C_00100000 0xd5
+#define A_GPR_ACCU 0xd6 /* ACCUM, accumulator */
+#define A_GPR_COND 0xd7 /* CCR, condition register */
+#define A_GPR_NOISE0 0xd8 /* noise source */
+#define A_GPR_NOISE1 0xd9 /* noise source */
+#define A_GPR_IRQ 0xda /* IRQ register */
+#define A_GPR_DBAC 0xdb /* TRAM Delay Base Address Counter - internal */
+#define A_GPR_DBACE 0xde /* TRAM Delay Base Address Counter - external */
+
+/* definitions for debug register */
+#define EMU10K1_DBG_ZC 0x80000000 /* zero tram counter */
+#define EMU10K1_DBG_SATURATION_OCCURED 0x02000000 /* saturation control */
+#define EMU10K1_DBG_SATURATION_ADDR 0x01ff0000 /* saturation address */
+#define EMU10K1_DBG_SINGLE_STEP 0x00008000 /* single step mode */
+#define EMU10K1_DBG_STEP 0x00004000 /* start single step */
+#define EMU10K1_DBG_CONDITION_CODE 0x00003e00 /* condition code */
+#define EMU10K1_DBG_SINGLE_STEP_ADDR 0x000001ff /* single step address */
+
+/* tank memory address line */
+#ifndef __KERNEL__
+#define TANKMEMADDRREG_ADDR_MASK 0x000fffff /* 20 bit tank address field */
+#define TANKMEMADDRREG_CLEAR 0x00800000 /* Clear tank memory */
+#define TANKMEMADDRREG_ALIGN 0x00400000 /* Align read or write relative to tank access */
+#define TANKMEMADDRREG_WRITE 0x00200000 /* Write to tank memory */
+#define TANKMEMADDRREG_READ 0x00100000 /* Read from tank memory */
+#endif
+
+typedef struct {
+ unsigned int internal_tram_size; /* in samples */
+ unsigned int external_tram_size; /* in samples */
+ char fxbus_names[16][32]; /* names of FXBUSes */
+ char extin_names[16][32]; /* names of external inputs */
+ char extout_names[32][32]; /* names of external outputs */
+ unsigned int gpr_controls; /* count of GPR controls */
+} emu10k1_fx8010_info_t;
+
+#define EMU10K1_GPR_TRANSLATION_NONE 0
+#define EMU10K1_GPR_TRANSLATION_TABLE100 1
+#define EMU10K1_GPR_TRANSLATION_BASS 2
+#define EMU10K1_GPR_TRANSLATION_TREBLE 3
+#define EMU10K1_GPR_TRANSLATION_ONOFF 4
+
+enum emu10k1_ctl_elem_iface {
+ EMU10K1_CTL_ELEM_IFACE_MIXER = 2, /* virtual mixer device */
+ EMU10K1_CTL_ELEM_IFACE_PCM = 3, /* PCM device */
+};
+
+typedef struct {
+ unsigned int pad; /* don't use */
+ int iface; /* interface identifier */
+ unsigned int device; /* device/client number */
+ unsigned int subdevice; /* subdevice (substream) number */
+ unsigned char name[44]; /* ASCII name of item */
+ unsigned int index; /* index of item */
+} emu10k1_ctl_elem_id_t;
+
+typedef struct {
+ emu10k1_ctl_elem_id_t id; /* full control ID definition */
+ unsigned int vcount; /* visible count */
+ unsigned int count; /* count of GPR (1..16) */
+ unsigned short gpr[32]; /* GPR number(s) */
+ unsigned int value[32]; /* initial values */
+ unsigned int min; /* minimum range */
+ unsigned int max; /* maximum range */
+ unsigned int translation; /* translation type (EMU10K1_GPR_TRANSLATION*) */
+ unsigned int *tlv;
+} emu10k1_fx8010_control_gpr_t;
+
+typedef struct {
+ char name[128];
+
+ unsigned long gpr_valid[0x200/(sizeof(unsigned long)*8)]; /* bitmask of valid initializers */
+ uint32_t *gpr_map; /* initializers */
+
+ unsigned int gpr_add_control_count; /* count of GPR controls to add/replace */
+ emu10k1_fx8010_control_gpr_t *gpr_add_controls; /* GPR controls to add/replace */
+
+ unsigned int gpr_del_control_count; /* count of GPR controls to remove */
+ emu10k1_ctl_elem_id_t *gpr_del_controls; /* IDs of GPR controls to remove */
+
+ unsigned int gpr_list_control_count; /* count of GPR controls to list */
+ unsigned int gpr_list_control_total; /* total count of GPR controls */
+ emu10k1_fx8010_control_gpr_t *gpr_list_controls; /* listed GPR controls */
+
+ unsigned long tram_valid[0x100/(sizeof(unsigned long)*8)]; /* bitmask of valid initializers */
+ uint32_t *tram_data_map; /* data initializers */
+ uint32_t *tram_addr_map; /* map initializers */
+
+ unsigned long code_valid[1024/(sizeof(unsigned long)*8)]; /* bitmask of valid instructions */
+ uint32_t *code; /* one instruction - 64 bits */
+} emu10k1_fx8010_code_t;
+
+typedef struct {
+ unsigned int address; /* 31.bit == 1 -> external TRAM */
+ unsigned int size; /* size in samples (4 bytes) */
+ unsigned int *samples; /* pointer to samples (20-bit) */
+ /* NULL->clear memory */
+} emu10k1_fx8010_tram_t;
+
+typedef struct {
+ unsigned int substream; /* substream number */
+ unsigned int res1; /* reserved */
+ unsigned int channels; /* 16-bit channels count, zero = remove this substream */
+ unsigned int tram_start; /* ring buffer position in TRAM (in samples) */
+ unsigned int buffer_size; /* count of buffered samples */
+ unsigned short gpr_size; /* GPR containing size of ringbuffer in samples (host) */
+ unsigned short gpr_ptr; /* GPR containing current pointer in the ring buffer (host = reset, FX8010) */
+ unsigned short gpr_count; /* GPR containing count of samples between two interrupts (host) */
+ unsigned short gpr_tmpcount; /* GPR containing current count of samples to interrupt (host = set, FX8010) */
+ unsigned short gpr_trigger; /* GPR containing trigger (activate) information (host) */
+ unsigned short gpr_running; /* GPR containing info if PCM is running (FX8010) */
+ unsigned char pad; /* reserved */
+ unsigned char etram[32]; /* external TRAM address & data (one per channel) */
+ unsigned int res2; /* reserved */
+} emu10k1_fx8010_pcm_t;
+
+#define SNDRV_EMU10K1_IOCTL_INFO _IOR ('H', 0x10, emu10k1_fx8010_info_t)
+#define SNDRV_EMU10K1_IOCTL_CODE_POKE _IOW ('H', 0x11, emu10k1_fx8010_code_t)
+#define SNDRV_EMU10K1_IOCTL_CODE_PEEK _IOWR('H', 0x12, emu10k1_fx8010_code_t)
+#define SNDRV_EMU10K1_IOCTL_TRAM_SETUP _IOW ('H', 0x20, int)
+#define SNDRV_EMU10K1_IOCTL_TRAM_POKE _IOW ('H', 0x21, emu10k1_fx8010_tram_t)
+#define SNDRV_EMU10K1_IOCTL_TRAM_PEEK _IOWR('H', 0x22, emu10k1_fx8010_tram_t)
+#define SNDRV_EMU10K1_IOCTL_PCM_POKE _IOW ('H', 0x30, emu10k1_fx8010_pcm_t)
+#define SNDRV_EMU10K1_IOCTL_PCM_PEEK _IOWR('H', 0x31, emu10k1_fx8010_pcm_t)
+#define SNDRV_EMU10K1_IOCTL_PVERSION _IOR ('H', 0x40, int)
+#define SNDRV_EMU10K1_IOCTL_STOP _IO ('H', 0x80)
+#define SNDRV_EMU10K1_IOCTL_CONTINUE _IO ('H', 0x81)
+#define SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER _IO ('H', 0x82)
+#define SNDRV_EMU10K1_IOCTL_SINGLE_STEP _IOW ('H', 0x83, int)
+#define SNDRV_EMU10K1_IOCTL_DBG_READ _IOR ('H', 0x84, int)
+
+#endif /* __SOUND_EMU10K1_H */
diff --git a/sysroot/usr/include/alsa/sound/hdsp.h b/sysroot/usr/include/alsa/sound/hdsp.h
new file mode 100644
index 0000000..0fc9e98
--- /dev/null
+++ b/sysroot/usr/include/alsa/sound/hdsp.h
@@ -0,0 +1,112 @@
+#ifndef __SOUND_HDSP_H
+#define __SOUND_HDSP_H
+
+/*
+ * Copyright (C) 2003 Thomas Charbonnel (thomas@undata.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <stdint.h>
+
+#define HDSP_MATRIX_MIXER_SIZE 2048
+
+typedef enum {
+ Digiface,
+ Multiface,
+ H9652,
+ H9632,
+ Undefined,
+} HDSP_IO_Type;
+
+typedef struct _snd_hdsp_peak_rms hdsp_peak_rms_t;
+
+struct _snd_hdsp_peak_rms {
+ uint32_t input_peaks[26];
+ uint32_t playback_peaks[26];
+ uint32_t output_peaks[28];
+ uint64_t input_rms[26];
+ uint64_t playback_rms[26];
+ /* These are only used for H96xx cards */
+ uint64_t output_rms[26];
+};
+
+#define SNDRV_HDSP_IOCTL_GET_PEAK_RMS _IOR('H', 0x40, hdsp_peak_rms_t)
+
+typedef struct _snd_hdsp_config_info hdsp_config_info_t;
+
+struct _snd_hdsp_config_info {
+ unsigned char pref_sync_ref;
+ unsigned char wordclock_sync_check;
+ unsigned char spdif_sync_check;
+ unsigned char adatsync_sync_check;
+ unsigned char adat_sync_check[3];
+ unsigned char spdif_in;
+ unsigned char spdif_out;
+ unsigned char spdif_professional;
+ unsigned char spdif_emphasis;
+ unsigned char spdif_nonaudio;
+ unsigned int spdif_sample_rate;
+ unsigned int system_sample_rate;
+ unsigned int autosync_sample_rate;
+ unsigned char system_clock_mode;
+ unsigned char clock_source;
+ unsigned char autosync_ref;
+ unsigned char line_out;
+ unsigned char passthru;
+ unsigned char da_gain;
+ unsigned char ad_gain;
+ unsigned char phone_gain;
+ unsigned char xlr_breakout_cable;
+ unsigned char analog_extension_board;
+};
+
+#define SNDRV_HDSP_IOCTL_GET_CONFIG_INFO _IOR('H', 0x41, hdsp_config_info_t)
+
+typedef struct _snd_hdsp_firmware hdsp_firmware_t;
+
+struct _snd_hdsp_firmware {
+ void *firmware_data; /* 24413 x 4 bytes */
+};
+
+#define SNDRV_HDSP_IOCTL_UPLOAD_FIRMWARE _IOW('H', 0x42, hdsp_firmware_t)
+
+typedef struct _snd_hdsp_version hdsp_version_t;
+
+struct _snd_hdsp_version {
+ HDSP_IO_Type io_type;
+ unsigned short firmware_rev;
+};
+
+#define SNDRV_HDSP_IOCTL_GET_VERSION _IOR('H', 0x43, hdsp_version_t)
+
+typedef struct _snd_hdsp_mixer hdsp_mixer_t;
+
+struct _snd_hdsp_mixer {
+ unsigned short matrix[HDSP_MATRIX_MIXER_SIZE];
+};
+
+#define SNDRV_HDSP_IOCTL_GET_MIXER _IOR('H', 0x44, hdsp_mixer_t)
+
+typedef struct _snd_hdsp_9632_aeb hdsp_9632_aeb_t;
+
+struct _snd_hdsp_9632_aeb {
+ int aebi;
+ int aebo;
+};
+
+#define SNDRV_HDSP_IOCTL_GET_9632_AEB _IOR('H', 0x45, hdsp_9632_aeb_t)
+
+#endif /* __SOUND_HDSP_H */
diff --git a/sysroot/usr/include/alsa/sound/sb16_csp.h b/sysroot/usr/include/alsa/sound/sb16_csp.h
new file mode 100644
index 0000000..78817b4
--- /dev/null
+++ b/sysroot/usr/include/alsa/sound/sb16_csp.h
@@ -0,0 +1,115 @@
+#ifndef __SOUND_SB16_CSP_H
+#define __SOUND_SB16_CSP_H
+
+/*
+ * Copyright (c) 1999 by Uros Bizjak <uros@kss-loka.si>
+ * Takashi Iwai <tiwai@suse.de>
+ *
+ * SB16ASP/AWE32 CSP control
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+/* CSP modes */
+#define SNDRV_SB_CSP_MODE_NONE 0x00
+#define SNDRV_SB_CSP_MODE_DSP_READ 0x01 /* Record from DSP */
+#define SNDRV_SB_CSP_MODE_DSP_WRITE 0x02 /* Play to DSP */
+#define SNDRV_SB_CSP_MODE_QSOUND 0x04 /* QSound */
+
+/* CSP load flags */
+#define SNDRV_SB_CSP_LOAD_FROMUSER 0x01
+#define SNDRV_SB_CSP_LOAD_INITBLOCK 0x02
+
+/* CSP sample width */
+#define SNDRV_SB_CSP_SAMPLE_8BIT 0x01
+#define SNDRV_SB_CSP_SAMPLE_16BIT 0x02
+
+/* CSP channels */
+#define SNDRV_SB_CSP_MONO 0x01
+#define SNDRV_SB_CSP_STEREO 0x02
+
+/* CSP rates */
+#define SNDRV_SB_CSP_RATE_8000 0x01
+#define SNDRV_SB_CSP_RATE_11025 0x02
+#define SNDRV_SB_CSP_RATE_22050 0x04
+#define SNDRV_SB_CSP_RATE_44100 0x08
+#define SNDRV_SB_CSP_RATE_ALL 0x0f
+
+/* CSP running state */
+#define SNDRV_SB_CSP_ST_IDLE 0x00
+#define SNDRV_SB_CSP_ST_LOADED 0x01
+#define SNDRV_SB_CSP_ST_RUNNING 0x02
+#define SNDRV_SB_CSP_ST_PAUSED 0x04
+#define SNDRV_SB_CSP_ST_AUTO 0x08
+#define SNDRV_SB_CSP_ST_QSOUND 0x10
+
+/* maximum QSound value (180 degrees right) */
+#define SNDRV_SB_CSP_QSOUND_MAX_RIGHT 0x20
+
+/* maximum microcode RIFF file size */
+#define SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE 0x3000
+
+/* microcode header */
+typedef struct snd_sb_csp_mc_header {
+ char codec_name[16]; /* id name of codec */
+ unsigned short func_req; /* requested function */
+} snd_sb_csp_mc_header_t;
+
+/* microcode to be loaded */
+typedef struct snd_sb_csp_microcode {
+ snd_sb_csp_mc_header_t info;
+ unsigned char data[SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE];
+} snd_sb_csp_microcode_t;
+
+/* start CSP with sample_width in mono/stereo */
+typedef struct snd_sb_csp_start {
+ int sample_width; /* sample width, look above */
+ int channels; /* channels, look above */
+} snd_sb_csp_start_t;
+
+/* CSP information */
+typedef struct snd_sb_csp_info {
+ char codec_name[16]; /* id name of codec */
+ unsigned short func_nr; /* function number */
+ unsigned int acc_format; /* accepted PCM formats */
+ unsigned short acc_channels; /* accepted channels */
+ unsigned short acc_width; /* accepted sample width */
+ unsigned short acc_rates; /* accepted sample rates */
+ unsigned short csp_mode; /* CSP mode, see above */
+ unsigned short run_channels; /* current channels */
+ unsigned short run_width; /* current sample width */
+ unsigned short version; /* version id: 0x10 - 0x1f */
+ unsigned short state; /* state bits */
+} snd_sb_csp_info_t;
+
+/* HWDEP controls */
+/* get CSP information */
+#define SNDRV_SB_CSP_IOCTL_INFO _IOR('H', 0x10, snd_sb_csp_info_t)
+/* load microcode to CSP */
+#define SNDRV_SB_CSP_IOCTL_LOAD_CODE _IOW('H', 0x11, snd_sb_csp_microcode_t)
+/* unload microcode from CSP */
+#define SNDRV_SB_CSP_IOCTL_UNLOAD_CODE _IO('H', 0x12)
+/* start CSP */
+#define SNDRV_SB_CSP_IOCTL_START _IOW('H', 0x13, snd_sb_csp_start_t)
+/* stop CSP */
+#define SNDRV_SB_CSP_IOCTL_STOP _IO('H', 0x14)
+/* pause CSP and DMA transfer */
+#define SNDRV_SB_CSP_IOCTL_PAUSE _IO('H', 0x15)
+/* restart CSP and DMA transfer */
+#define SNDRV_SB_CSP_IOCTL_RESTART _IO('H', 0x16)
+
+
+#endif /* __SOUND_SB16_CSP */
diff --git a/sysroot/usr/include/alsa/sound/sscape_ioctl.h b/sysroot/usr/include/alsa/sound/sscape_ioctl.h
new file mode 100644
index 0000000..c6653eb
--- /dev/null
+++ b/sysroot/usr/include/alsa/sound/sscape_ioctl.h
@@ -0,0 +1,21 @@
+#ifndef SSCAPE_IOCTL_H
+#define SSCAPE_IOCTL_H
+
+
+struct sscape_bootblock
+{
+ unsigned char code[256];
+ unsigned version;
+};
+
+#define SSCAPE_MICROCODE_SIZE 65536
+
+struct sscape_microcode
+{
+ unsigned char *code;
+};
+
+#define SND_SSCAPE_LOAD_BOOTB _IOWR('P', 100, struct sscape_bootblock)
+#define SND_SSCAPE_LOAD_MCODE _IOW ('P', 101, struct sscape_microcode)
+
+#endif
diff --git a/sysroot/usr/include/alsa/sound/type_compat.h b/sysroot/usr/include/alsa/sound/type_compat.h
new file mode 100644
index 0000000..eec86e4
--- /dev/null
+++ b/sysroot/usr/include/alsa/sound/type_compat.h
@@ -0,0 +1,40 @@
+#ifndef __TYPE_COMPAT_H
+#define __TYPE_COMPAT_H
+
+#ifndef DOC_HIDDEN
+#include <stdint.h>
+typedef uint8_t __u8;
+typedef uint16_t __u16;
+typedef uint32_t __u32;
+typedef int8_t __s8;
+typedef int16_t __s16;
+typedef int32_t __s32;
+
+#include <endian.h>
+#include <byteswap.h>
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+#define __cpu_to_le32(x) (x)
+#define __cpu_to_be32(x) bswap_32(x)
+#define __cpu_to_le16(x) (x)
+#define __cpu_to_be16(x) bswap_16(x)
+#else
+#define __cpu_to_le32(x) bswap_32(x)
+#define __cpu_to_be32(x) (x)
+#define __cpu_to_le16(x) bswap_16(x)
+#define __cpu_to_be16(x) (x)
+#endif
+
+#define __le32_to_cpu __cpu_to_le32
+#define __be32_to_cpu __cpu_to_be32
+#define __le16_to_cpu __cpu_to_le16
+#define __be16_to_cpu __cpu_to_be16
+
+#define __le64 __u64
+#define __le32 __u32
+#define __le16 __u16
+#define __be64 __u64
+#define __be32 __u32
+#define __be16 __u16
+#endif /* DOC_HIDDEN */
+
+#endif /* __TYPE_COMPAT_H */
diff --git a/sysroot/usr/include/alsa/timer.h b/sysroot/usr/include/alsa/timer.h
new file mode 100644
index 0000000..ef6a18d
--- /dev/null
+++ b/sysroot/usr/include/alsa/timer.h
@@ -0,0 +1,257 @@
+/**
+ * \file include/timer.h
+ * \brief Application interface library for the ALSA driver
+ * \author Jaroslav Kysela <perex@perex.cz>
+ * \author Abramo Bagnara <abramo@alsa-project.org>
+ * \author Takashi Iwai <tiwai@suse.de>
+ * \date 1998-2001
+ *
+ * Application interface library for the ALSA driver
+ */
+/*
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef __ALSA_TIMER_H
+#define __ALSA_TIMER_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \defgroup Timer Timer Interface
+ * Timer Interface. See \ref timer page for more details.
+ * \{
+ */
+
+/** dlsym version for interface entry callback */
+#define SND_TIMER_DLSYM_VERSION _dlsym_timer_001
+/** dlsym version for interface entry callback */
+#define SND_TIMER_QUERY_DLSYM_VERSION _dlsym_timer_query_001
+
+/** timer identification structure */
+typedef struct _snd_timer_id snd_timer_id_t;
+/** timer global info structure */
+typedef struct _snd_timer_ginfo snd_timer_ginfo_t;
+/** timer global params structure */
+typedef struct _snd_timer_gparams snd_timer_gparams_t;
+/** timer global status structure */
+typedef struct _snd_timer_gstatus snd_timer_gstatus_t;
+/** timer info structure */
+typedef struct _snd_timer_info snd_timer_info_t;
+/** timer params structure */
+typedef struct _snd_timer_params snd_timer_params_t;
+/** timer status structure */
+typedef struct _snd_timer_status snd_timer_status_t;
+/** timer master class */
+typedef enum _snd_timer_class {
+ SND_TIMER_CLASS_NONE = -1, /**< invalid */
+ SND_TIMER_CLASS_SLAVE = 0, /**< slave timer */
+ SND_TIMER_CLASS_GLOBAL, /**< global timer */
+ SND_TIMER_CLASS_CARD, /**< card timer */
+ SND_TIMER_CLASS_PCM, /**< PCM timer */
+ SND_TIMER_CLASS_LAST = SND_TIMER_CLASS_PCM /**< last timer */
+} snd_timer_class_t;
+
+/** timer slave class */
+typedef enum _snd_timer_slave_class {
+ SND_TIMER_SCLASS_NONE = 0, /**< none */
+ SND_TIMER_SCLASS_APPLICATION, /**< for internal use */
+ SND_TIMER_SCLASS_SEQUENCER, /**< sequencer timer */
+ SND_TIMER_SCLASS_OSS_SEQUENCER, /**< OSS sequencer timer */
+ SND_TIMER_SCLASS_LAST = SND_TIMER_SCLASS_OSS_SEQUENCER /**< last slave timer */
+} snd_timer_slave_class_t;
+
+/** timer read event identification */
+typedef enum _snd_timer_event {
+ SND_TIMER_EVENT_RESOLUTION = 0, /* val = resolution in ns */
+ SND_TIMER_EVENT_TICK, /* val = ticks */
+ SND_TIMER_EVENT_START, /* val = resolution in ns */
+ SND_TIMER_EVENT_STOP, /* val = 0 */
+ SND_TIMER_EVENT_CONTINUE, /* val = resolution in ns */
+ SND_TIMER_EVENT_PAUSE, /* val = 0 */
+ SND_TIMER_EVENT_EARLY, /* val = 0 */
+ SND_TIMER_EVENT_SUSPEND, /* val = 0 */
+ SND_TIMER_EVENT_RESUME, /* val = resolution in ns */
+ /* master timer events for slave timer instances */
+ SND_TIMER_EVENT_MSTART = SND_TIMER_EVENT_START + 10,
+ SND_TIMER_EVENT_MSTOP = SND_TIMER_EVENT_STOP + 10,
+ SND_TIMER_EVENT_MCONTINUE = SND_TIMER_EVENT_CONTINUE + 10,
+ SND_TIMER_EVENT_MPAUSE = SND_TIMER_EVENT_PAUSE + 10,
+ SND_TIMER_EVENT_MSUSPEND = SND_TIMER_EVENT_SUSPEND + 10,
+ SND_TIMER_EVENT_MRESUME = SND_TIMER_EVENT_RESUME + 10
+} snd_timer_event_t;
+
+/** timer read structure */
+typedef struct _snd_timer_read {
+ unsigned int resolution; /**< tick resolution in nanoseconds */
+ unsigned int ticks; /**< count of happened ticks */
+} snd_timer_read_t;
+
+/** timer tstamp + event read structure */
+typedef struct _snd_timer_tread {
+ snd_timer_event_t event; /**< Timer event */
+ snd_htimestamp_t tstamp; /**< Time stamp of each event */
+ unsigned int val; /**< Event value */
+} snd_timer_tread_t;
+
+/** global timer - system */
+#define SND_TIMER_GLOBAL_SYSTEM 0
+/** global timer - RTC */
+#define SND_TIMER_GLOBAL_RTC 1
+/** global timer - HPET */
+#define SND_TIMER_GLOBAL_HPET 2
+
+/** timer open mode flag - non-blocking behaviour */
+#define SND_TIMER_OPEN_NONBLOCK (1<<0)
+/** use timestamps and event notification - enhanced read */
+#define SND_TIMER_OPEN_TREAD (1<<1)
+
+/** timer handle type */
+typedef enum _snd_timer_type {
+ /** Kernel level HwDep */
+ SND_TIMER_TYPE_HW = 0,
+ /** Shared memory client timer (not yet implemented) */
+ SND_TIMER_TYPE_SHM,
+ /** INET client timer (not yet implemented) */
+ SND_TIMER_TYPE_INET
+} snd_timer_type_t;
+
+/** timer query handle */
+typedef struct _snd_timer_query snd_timer_query_t;
+/** timer handle */
+typedef struct _snd_timer snd_timer_t;
+
+
+int snd_timer_query_open(snd_timer_query_t **handle, const char *name, int mode);
+int snd_timer_query_open_lconf(snd_timer_query_t **handle, const char *name, int mode, snd_config_t *lconf);
+int snd_timer_query_close(snd_timer_query_t *handle);
+int snd_timer_query_next_device(snd_timer_query_t *handle, snd_timer_id_t *tid);
+int snd_timer_query_info(snd_timer_query_t *handle, snd_timer_ginfo_t *info);
+int snd_timer_query_params(snd_timer_query_t *handle, snd_timer_gparams_t *params);
+int snd_timer_query_status(snd_timer_query_t *handle, snd_timer_gstatus_t *status);
+
+int snd_timer_open(snd_timer_t **handle, const char *name, int mode);
+int snd_timer_open_lconf(snd_timer_t **handle, const char *name, int mode, snd_config_t *lconf);
+int snd_timer_close(snd_timer_t *handle);
+int snd_async_add_timer_handler(snd_async_handler_t **handler, snd_timer_t *timer,
+ snd_async_callback_t callback, void *private_data);
+snd_timer_t *snd_async_handler_get_timer(snd_async_handler_t *handler);
+int snd_timer_poll_descriptors_count(snd_timer_t *handle);
+int snd_timer_poll_descriptors(snd_timer_t *handle, struct pollfd *pfds, unsigned int space);
+int snd_timer_poll_descriptors_revents(snd_timer_t *timer, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
+int snd_timer_info(snd_timer_t *handle, snd_timer_info_t *timer);
+int snd_timer_params(snd_timer_t *handle, snd_timer_params_t *params);
+int snd_timer_status(snd_timer_t *handle, snd_timer_status_t *status);
+int snd_timer_start(snd_timer_t *handle);
+int snd_timer_stop(snd_timer_t *handle);
+int snd_timer_continue(snd_timer_t *handle);
+ssize_t snd_timer_read(snd_timer_t *handle, void *buffer, size_t size);
+
+size_t snd_timer_id_sizeof(void);
+/** allocate #snd_timer_id_t container on stack */
+#define snd_timer_id_alloca(ptr) do { assert(ptr); *ptr = (snd_timer_id_t *) alloca(snd_timer_id_sizeof()); memset(*ptr, 0, snd_timer_id_sizeof()); } while (0)
+int snd_timer_id_malloc(snd_timer_id_t **ptr);
+void snd_timer_id_free(snd_timer_id_t *obj);
+void snd_timer_id_copy(snd_timer_id_t *dst, const snd_timer_id_t *src);
+
+void snd_timer_id_set_class(snd_timer_id_t *id, int dev_class);
+int snd_timer_id_get_class(snd_timer_id_t *id);
+void snd_timer_id_set_sclass(snd_timer_id_t *id, int dev_sclass);
+int snd_timer_id_get_sclass(snd_timer_id_t *id);
+void snd_timer_id_set_card(snd_timer_id_t *id, int card);
+int snd_timer_id_get_card(snd_timer_id_t *id);
+void snd_timer_id_set_device(snd_timer_id_t *id, int device);
+int snd_timer_id_get_device(snd_timer_id_t *id);
+void snd_timer_id_set_subdevice(snd_timer_id_t *id, int subdevice);
+int snd_timer_id_get_subdevice(snd_timer_id_t *id);
+
+size_t snd_timer_ginfo_sizeof(void);
+/** allocate #snd_timer_ginfo_t container on stack */
+#define snd_timer_ginfo_alloca(ptr) do { assert(ptr); *ptr = (snd_timer_ginfo_t *) alloca(snd_timer_ginfo_sizeof()); memset(*ptr, 0, snd_timer_ginfo_sizeof()); } while (0)
+int snd_timer_ginfo_malloc(snd_timer_ginfo_t **ptr);
+void snd_timer_ginfo_free(snd_timer_ginfo_t *obj);
+void snd_timer_ginfo_copy(snd_timer_ginfo_t *dst, const snd_timer_ginfo_t *src);
+
+int snd_timer_ginfo_set_tid(snd_timer_ginfo_t *obj, snd_timer_id_t *tid);
+snd_timer_id_t *snd_timer_ginfo_get_tid(snd_timer_ginfo_t *obj);
+unsigned int snd_timer_ginfo_get_flags(snd_timer_ginfo_t *obj);
+int snd_timer_ginfo_get_card(snd_timer_ginfo_t *obj);
+char *snd_timer_ginfo_get_id(snd_timer_ginfo_t *obj);
+char *snd_timer_ginfo_get_name(snd_timer_ginfo_t *obj);
+unsigned long snd_timer_ginfo_get_resolution(snd_timer_ginfo_t *obj);
+unsigned long snd_timer_ginfo_get_resolution_min(snd_timer_ginfo_t *obj);
+unsigned long snd_timer_ginfo_get_resolution_max(snd_timer_ginfo_t *obj);
+unsigned int snd_timer_ginfo_get_clients(snd_timer_ginfo_t *obj);
+
+size_t snd_timer_info_sizeof(void);
+/** allocate #snd_timer_info_t container on stack */
+#define snd_timer_info_alloca(ptr) do { assert(ptr); *ptr = (snd_timer_info_t *) alloca(snd_timer_info_sizeof()); memset(*ptr, 0, snd_timer_info_sizeof()); } while (0)
+int snd_timer_info_malloc(snd_timer_info_t **ptr);
+void snd_timer_info_free(snd_timer_info_t *obj);
+void snd_timer_info_copy(snd_timer_info_t *dst, const snd_timer_info_t *src);
+
+int snd_timer_info_is_slave(snd_timer_info_t * info);
+int snd_timer_info_get_card(snd_timer_info_t * info);
+const char *snd_timer_info_get_id(snd_timer_info_t * info);
+const char *snd_timer_info_get_name(snd_timer_info_t * info);
+long snd_timer_info_get_resolution(snd_timer_info_t * info);
+
+size_t snd_timer_params_sizeof(void);
+/** allocate #snd_timer_params_t container on stack */
+#define snd_timer_params_alloca(ptr) do { assert(ptr); *ptr = (snd_timer_params_t *) alloca(snd_timer_params_sizeof()); memset(*ptr, 0, snd_timer_params_sizeof()); } while (0)
+int snd_timer_params_malloc(snd_timer_params_t **ptr);
+void snd_timer_params_free(snd_timer_params_t *obj);
+void snd_timer_params_copy(snd_timer_params_t *dst, const snd_timer_params_t *src);
+
+int snd_timer_params_set_auto_start(snd_timer_params_t * params, int auto_start);
+int snd_timer_params_get_auto_start(snd_timer_params_t * params);
+int snd_timer_params_set_exclusive(snd_timer_params_t * params, int exclusive);
+int snd_timer_params_get_exclusive(snd_timer_params_t * params);
+int snd_timer_params_set_early_event(snd_timer_params_t * params, int early_event);
+int snd_timer_params_get_early_event(snd_timer_params_t * params);
+void snd_timer_params_set_ticks(snd_timer_params_t * params, long ticks);
+long snd_timer_params_get_ticks(snd_timer_params_t * params);
+void snd_timer_params_set_queue_size(snd_timer_params_t * params, long queue_size);
+long snd_timer_params_get_queue_size(snd_timer_params_t * params);
+void snd_timer_params_set_filter(snd_timer_params_t * params, unsigned int filter);
+unsigned int snd_timer_params_get_filter(snd_timer_params_t * params);
+
+size_t snd_timer_status_sizeof(void);
+/** allocate #snd_timer_status_t container on stack */
+#define snd_timer_status_alloca(ptr) do { assert(ptr); *ptr = (snd_timer_status_t *) alloca(snd_timer_status_sizeof()); memset(*ptr, 0, snd_timer_status_sizeof()); } while (0)
+int snd_timer_status_malloc(snd_timer_status_t **ptr);
+void snd_timer_status_free(snd_timer_status_t *obj);
+void snd_timer_status_copy(snd_timer_status_t *dst, const snd_timer_status_t *src);
+
+snd_htimestamp_t snd_timer_status_get_timestamp(snd_timer_status_t * status);
+long snd_timer_status_get_resolution(snd_timer_status_t * status);
+long snd_timer_status_get_lost(snd_timer_status_t * status);
+long snd_timer_status_get_overrun(snd_timer_status_t * status);
+long snd_timer_status_get_queue(snd_timer_status_t * status);
+
+/* deprecated functions, for compatibility */
+long snd_timer_info_get_ticks(snd_timer_info_t * info);
+
+/** \} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /** __ALSA_TIMER_H */
+
diff --git a/sysroot/usr/include/alsa/version.h b/sysroot/usr/include/alsa/version.h
new file mode 100644
index 0000000..08235f2
--- /dev/null
+++ b/sysroot/usr/include/alsa/version.h
@@ -0,0 +1,15 @@
+/*
+ * version.h
+ */
+
+#define SND_LIB_MAJOR 1 /**< major number of library version */
+#define SND_LIB_MINOR 0 /**< minor number of library version */
+#define SND_LIB_SUBMINOR 15 /**< subminor number of library version */
+#define SND_LIB_EXTRAVER 1000000 /**< extra version number, used mainly for betas */
+/** library version */
+#define SND_LIB_VERSION ((SND_LIB_MAJOR<<16)|\
+ (SND_LIB_MINOR<<8)|\
+ SND_LIB_SUBMINOR)
+/** library version (string) */
+#define SND_LIB_VERSION_STR "1.0.15"
+
diff --git a/sysroot/usr/include/ar.h b/sysroot/usr/include/ar.h
new file mode 100644
index 0000000..5d157ec
--- /dev/null
+++ b/sysroot/usr/include/ar.h
@@ -0,0 +1,48 @@
+/* Header describing `ar' archive file format.
+ Copyright (C) 1996 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _AR_H
+#define _AR_H 1
+
+#include <sys/cdefs.h>
+
+/* Archive files start with the ARMAG identifying string. Then follows a
+ `struct ar_hdr', and as many bytes of member file data as its `ar_size'
+ member indicates, for each member file. */
+
+#define ARMAG "!<arch>\n" /* String that begins an archive file. */
+#define SARMAG 8 /* Size of that string. */
+
+#define ARFMAG "`\n" /* String in ar_fmag at end of each header. */
+
+__BEGIN_DECLS
+
+struct ar_hdr
+ {
+ char ar_name[16]; /* Member file name, sometimes / terminated. */
+ char ar_date[12]; /* File date, decimal seconds since Epoch. */
+ char ar_uid[6], ar_gid[6]; /* User and group IDs, in ASCII decimal. */
+ char ar_mode[8]; /* File mode, in ASCII octal. */
+ char ar_size[10]; /* File size, in ASCII decimal. */
+ char ar_fmag[2]; /* Always contains ARFMAG. */
+ };
+
+__END_DECLS
+
+#endif /* ar.h */
diff --git a/sysroot/usr/include/argp.h b/sysroot/usr/include/argp.h
new file mode 100644
index 0000000..baf3afd
--- /dev/null
+++ b/sysroot/usr/include/argp.h
@@ -0,0 +1,601 @@
+/* Hierarchial argument parsing, layered over getopt.
+ Copyright (C) 1995-1999, 2003, 2004, 2005, 2006, 2007
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Written by Miles Bader <miles@gnu.ai.mit.edu>.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _ARGP_H
+#define _ARGP_H
+
+#include <stdio.h>
+#include <ctype.h>
+#include <getopt.h>
+#include <limits.h>
+
+#define __need_error_t
+#include <errno.h>
+
+#ifndef __const
+# define __const const
+#endif
+
+#ifndef __THROW
+# define __THROW
+#endif
+#ifndef __NTH
+# define __NTH(fct) fct __THROW
+#endif
+
+#ifndef __attribute__
+/* This feature is available in gcc versions 2.5 and later. */
+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
+# define __attribute__(Spec) /* empty */
+# endif
+/* The __-protected variants of `format' and `printf' attributes
+ are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) || __STRICT_ANSI__
+# define __format__ format
+# define __printf__ printf
+# endif
+#endif
+
+/* GCC 2.95 and later have "__restrict"; C99 compilers have
+ "restrict", and "configure" may have defined "restrict". */
+#ifndef __restrict
+# if ! (2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__))
+# if defined restrict || 199901L <= __STDC_VERSION__
+# define __restrict restrict
+# else
+# define __restrict
+# endif
+# endif
+#endif
+
+#ifndef __error_t_defined
+typedef int error_t;
+# define __error_t_defined
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* A description of a particular option. A pointer to an array of
+ these is passed in the OPTIONS field of an argp structure. Each option
+ entry can correspond to one long option and/or one short option; more
+ names for the same option can be added by following an entry in an option
+ array with options having the OPTION_ALIAS flag set. */
+struct argp_option
+{
+ /* The long option name. For more than one name for the same option, you
+ can use following options with the OPTION_ALIAS flag set. */
+ __const char *name;
+
+ /* What key is returned for this option. If > 0 and printable, then it's
+ also accepted as a short option. */
+ int key;
+
+ /* If non-NULL, this is the name of the argument associated with this
+ option, which is required unless the OPTION_ARG_OPTIONAL flag is set. */
+ __const char *arg;
+
+ /* OPTION_ flags. */
+ int flags;
+
+ /* The doc string for this option. If both NAME and KEY are 0, This string
+ will be printed outdented from the normal option column, making it
+ useful as a group header (it will be the first thing printed in its
+ group); in this usage, it's conventional to end the string with a `:'. */
+ __const char *doc;
+
+ /* The group this option is in. In a long help message, options are sorted
+ alphabetically within each group, and the groups presented in the order
+ 0, 1, 2, ..., n, -m, ..., -2, -1. Every entry in an options array with
+ if this field 0 will inherit the group number of the previous entry, or
+ zero if it's the first one, unless its a group header (NAME and KEY both
+ 0), in which case, the previous entry + 1 is the default. Automagic
+ options such as --help are put into group -1. */
+ int group;
+};
+
+/* The argument associated with this option is optional. */
+#define OPTION_ARG_OPTIONAL 0x1
+
+/* This option isn't displayed in any help messages. */
+#define OPTION_HIDDEN 0x2
+
+/* This option is an alias for the closest previous non-alias option. This
+ means that it will be displayed in the same help entry, and will inherit
+ fields other than NAME and KEY from the aliased option. */
+#define OPTION_ALIAS 0x4
+
+/* This option isn't actually an option (and so should be ignored by the
+ actual option parser), but rather an arbitrary piece of documentation that
+ should be displayed in much the same manner as the options. If this flag
+ is set, then the option NAME field is displayed unmodified (e.g., no `--'
+ prefix is added) at the left-margin (where a *short* option would normally
+ be displayed), and the documentation string in the normal place. For
+ purposes of sorting, any leading whitespace and punctuation is ignored,
+ except that if the first non-whitespace character is not `-', this entry
+ is displayed after all options (and OPTION_DOC entries with a leading `-')
+ in the same group. */
+#define OPTION_DOC 0x8
+
+/* This option shouldn't be included in `long' usage messages (but is still
+ included in help messages). This is mainly intended for options that are
+ completely documented in an argp's ARGS_DOC field, in which case including
+ the option in the generic usage list would be redundant. For instance,
+ if ARGS_DOC is "FOO BAR\n-x BLAH", and the `-x' option's purpose is to
+ distinguish these two cases, -x should probably be marked
+ OPTION_NO_USAGE. */
+#define OPTION_NO_USAGE 0x10
+
+struct argp; /* fwd declare this type */
+struct argp_state; /* " */
+struct argp_child; /* " */
+
+/* The type of a pointer to an argp parsing function. */
+typedef error_t (*argp_parser_t) (int key, char *arg,
+ struct argp_state *state);
+
+/* What to return for unrecognized keys. For special ARGP_KEY_ keys, such
+ returns will simply be ignored. For user keys, this error will be turned
+ into EINVAL (if the call to argp_parse is such that errors are propagated
+ back to the user instead of exiting); returning EINVAL itself would result
+ in an immediate stop to parsing in *all* cases. */
+#define ARGP_ERR_UNKNOWN E2BIG /* Hurd should never need E2BIG. XXX */
+
+/* Special values for the KEY argument to an argument parsing function.
+ ARGP_ERR_UNKNOWN should be returned if they aren't understood.
+
+ The sequence of keys to a parsing function is either (where each
+ uppercased word should be prefixed by `ARGP_KEY_' and opt is a user key):
+
+ INIT opt... NO_ARGS END SUCCESS -- No non-option arguments at all
+ or INIT (opt | ARG)... END SUCCESS -- All non-option args parsed
+ or INIT (opt | ARG)... SUCCESS -- Some non-option arg unrecognized
+
+ The third case is where every parser returned ARGP_KEY_UNKNOWN for an
+ argument, in which case parsing stops at that argument (returning the
+ unparsed arguments to the caller of argp_parse if requested, or stopping
+ with an error message if not).
+
+ If an error occurs (either detected by argp, or because the parsing
+ function returned an error value), then the parser is called with
+ ARGP_KEY_ERROR, and no further calls are made. */
+
+/* This is not an option at all, but rather a command line argument. If a
+ parser receiving this key returns success, the fact is recorded, and the
+ ARGP_KEY_NO_ARGS case won't be used. HOWEVER, if while processing the
+ argument, a parser function decrements the NEXT field of the state it's
+ passed, the option won't be considered processed; this is to allow you to
+ actually modify the argument (perhaps into an option), and have it
+ processed again. */
+#define ARGP_KEY_ARG 0
+/* There are remaining arguments not parsed by any parser, which may be found
+ starting at (STATE->argv + STATE->next). If success is returned, but
+ STATE->next left untouched, it's assumed that all arguments were consume,
+ otherwise, the parser should adjust STATE->next to reflect any arguments
+ consumed. */
+#define ARGP_KEY_ARGS 0x1000006
+/* There are no more command line arguments at all. */
+#define ARGP_KEY_END 0x1000001
+/* Because it's common to want to do some special processing if there aren't
+ any non-option args, user parsers are called with this key if they didn't
+ successfully process any non-option arguments. Called just before
+ ARGP_KEY_END (where more general validity checks on previously parsed
+ arguments can take place). */
+#define ARGP_KEY_NO_ARGS 0x1000002
+/* Passed in before any parsing is done. Afterwards, the values of each
+ element of the CHILD_INPUT field, if any, in the state structure is
+ copied to each child's state to be the initial value of the INPUT field. */
+#define ARGP_KEY_INIT 0x1000003
+/* Use after all other keys, including SUCCESS & END. */
+#define ARGP_KEY_FINI 0x1000007
+/* Passed in when parsing has successfully been completed (even if there are
+ still arguments remaining). */
+#define ARGP_KEY_SUCCESS 0x1000004
+/* Passed in if an error occurs. */
+#define ARGP_KEY_ERROR 0x1000005
+
+/* An argp structure contains a set of options declarations, a function to
+ deal with parsing one, documentation string, a possible vector of child
+ argp's, and perhaps a function to filter help output. When actually
+ parsing options, getopt is called with the union of all the argp
+ structures chained together through their CHILD pointers, with conflicts
+ being resolved in favor of the first occurrence in the chain. */
+struct argp
+{
+ /* An array of argp_option structures, terminated by an entry with both
+ NAME and KEY having a value of 0. */
+ __const struct argp_option *options;
+
+ /* What to do with an option from this structure. KEY is the key
+ associated with the option, and ARG is any associated argument (NULL if
+ none was supplied). If KEY isn't understood, ARGP_ERR_UNKNOWN should be
+ returned. If a non-zero, non-ARGP_ERR_UNKNOWN value is returned, then
+ parsing is stopped immediately, and that value is returned from
+ argp_parse(). For special (non-user-supplied) values of KEY, see the
+ ARGP_KEY_ definitions below. */
+ argp_parser_t parser;
+
+ /* A string describing what other arguments are wanted by this program. It
+ is only used by argp_usage to print the `Usage:' message. If it
+ contains newlines, the strings separated by them are considered
+ alternative usage patterns, and printed on separate lines (lines after
+ the first are prefix by ` or: ' instead of `Usage:'). */
+ __const char *args_doc;
+
+ /* If non-NULL, a string containing extra text to be printed before and
+ after the options in a long help message (separated by a vertical tab
+ `\v' character). */
+ __const char *doc;
+
+ /* A vector of argp_children structures, terminated by a member with a 0
+ argp field, pointing to child argps should be parsed with this one. Any
+ conflicts are resolved in favor of this argp, or early argps in the
+ CHILDREN list. This field is useful if you use libraries that supply
+ their own argp structure, which you want to use in conjunction with your
+ own. */
+ __const struct argp_child *children;
+
+ /* If non-zero, this should be a function to filter the output of help
+ messages. KEY is either a key from an option, in which case TEXT is
+ that option's help text, or a special key from the ARGP_KEY_HELP_
+ defines, below, describing which other help text TEXT is. The function
+ should return either TEXT, if it should be used as-is, a replacement
+ string, which should be malloced, and will be freed by argp, or NULL,
+ meaning `print nothing'. The value for TEXT is *after* any translation
+ has been done, so if any of the replacement text also needs translation,
+ that should be done by the filter function. INPUT is either the input
+ supplied to argp_parse, or NULL, if argp_help was called directly. */
+ char *(*help_filter) (int __key, __const char *__text, void *__input);
+
+ /* If non-zero the strings used in the argp library are translated using
+ the domain described by this string. Otherwise the currently installed
+ default domain is used. */
+ const char *argp_domain;
+};
+
+/* Possible KEY arguments to a help filter function. */
+#define ARGP_KEY_HELP_PRE_DOC 0x2000001 /* Help text preceeding options. */
+#define ARGP_KEY_HELP_POST_DOC 0x2000002 /* Help text following options. */
+#define ARGP_KEY_HELP_HEADER 0x2000003 /* Option header string. */
+#define ARGP_KEY_HELP_EXTRA 0x2000004 /* After all other documentation;
+ TEXT is NULL for this key. */
+/* Explanatory note emitted when duplicate option arguments have been
+ suppressed. */
+#define ARGP_KEY_HELP_DUP_ARGS_NOTE 0x2000005
+#define ARGP_KEY_HELP_ARGS_DOC 0x2000006 /* Argument doc string. */
+
+/* When an argp has a non-zero CHILDREN field, it should point to a vector of
+ argp_child structures, each of which describes a subsidiary argp. */
+struct argp_child
+{
+ /* The child parser. */
+ __const struct argp *argp;
+
+ /* Flags for this child. */
+ int flags;
+
+ /* If non-zero, an optional header to be printed in help output before the
+ child options. As a side-effect, a non-zero value forces the child
+ options to be grouped together; to achieve this effect without actually
+ printing a header string, use a value of "". */
+ __const char *header;
+
+ /* Where to group the child options relative to the other (`consolidated')
+ options in the parent argp; the values are the same as the GROUP field
+ in argp_option structs, but all child-groupings follow parent options at
+ a particular group level. If both this field and HEADER are zero, then
+ they aren't grouped at all, but rather merged with the parent options
+ (merging the child's grouping levels with the parents). */
+ int group;
+};
+
+/* Parsing state. This is provided to parsing functions called by argp,
+ which may examine and, as noted, modify fields. */
+struct argp_state
+{
+ /* The top level ARGP being parsed. */
+ __const struct argp *root_argp;
+
+ /* The argument vector being parsed. May be modified. */
+ int argc;
+ char **argv;
+
+ /* The index in ARGV of the next arg that to be parsed. May be modified. */
+ int next;
+
+ /* The flags supplied to argp_parse. May be modified. */
+ unsigned flags;
+
+ /* While calling a parsing function with a key of ARGP_KEY_ARG, this is the
+ number of the current arg, starting at zero, and incremented after each
+ such call returns. At all other times, this is the number of such
+ arguments that have been processed. */
+ unsigned arg_num;
+
+ /* If non-zero, the index in ARGV of the first argument following a special
+ `--' argument (which prevents anything following being interpreted as an
+ option). Only set once argument parsing has proceeded past this point. */
+ int quoted;
+
+ /* An arbitrary pointer passed in from the user. */
+ void *input;
+ /* Values to pass to child parsers. This vector will be the same length as
+ the number of children for the current parser. */
+ void **child_inputs;
+
+ /* For the parser's use. Initialized to 0. */
+ void *hook;
+
+ /* The name used when printing messages. This is initialized to ARGV[0],
+ or PROGRAM_INVOCATION_NAME if that is unavailable. */
+ char *name;
+
+ /* Streams used when argp prints something. */
+ FILE *err_stream; /* For errors; initialized to stderr. */
+ FILE *out_stream; /* For information; initialized to stdout. */
+
+ void *pstate; /* Private, for use by argp. */
+};
+
+/* Flags for argp_parse (note that the defaults are those that are
+ convenient for program command line parsing): */
+
+/* Don't ignore the first element of ARGV. Normally (and always unless
+ ARGP_NO_ERRS is set) the first element of the argument vector is
+ skipped for option parsing purposes, as it corresponds to the program name
+ in a command line. */
+#define ARGP_PARSE_ARGV0 0x01
+
+/* Don't print error messages for unknown options to stderr; unless this flag
+ is set, ARGP_PARSE_ARGV0 is ignored, as ARGV[0] is used as the program
+ name in the error messages. This flag implies ARGP_NO_EXIT (on the
+ assumption that silent exiting upon errors is bad behaviour). */
+#define ARGP_NO_ERRS 0x02
+
+/* Don't parse any non-option args. Normally non-option args are parsed by
+ calling the parse functions with a key of ARGP_KEY_ARG, and the actual arg
+ as the value. Since it's impossible to know which parse function wants to
+ handle it, each one is called in turn, until one returns 0 or an error
+ other than ARGP_ERR_UNKNOWN; if an argument is handled by no one, the
+ argp_parse returns prematurely (but with a return value of 0). If all
+ args have been parsed without error, all parsing functions are called one
+ last time with a key of ARGP_KEY_END. This flag needn't normally be set,
+ as the normal behavior is to stop parsing as soon as some argument can't
+ be handled. */
+#define ARGP_NO_ARGS 0x04
+
+/* Parse options and arguments in the same order they occur on the command
+ line -- normally they're rearranged so that all options come first. */
+#define ARGP_IN_ORDER 0x08
+
+/* Don't provide the standard long option --help, which causes usage and
+ option help information to be output to stdout, and exit (0) called. */
+#define ARGP_NO_HELP 0x10
+
+/* Don't exit on errors (they may still result in error messages). */
+#define ARGP_NO_EXIT 0x20
+
+/* Use the gnu getopt `long-only' rules for parsing arguments. */
+#define ARGP_LONG_ONLY 0x40
+
+/* Turns off any message-printing/exiting options. */
+#define ARGP_SILENT (ARGP_NO_EXIT | ARGP_NO_ERRS | ARGP_NO_HELP)
+
+/* Parse the options strings in ARGC & ARGV according to the options in ARGP.
+ FLAGS is one of the ARGP_ flags above. If ARG_INDEX is non-NULL, the
+ index in ARGV of the first unparsed option is returned in it. If an
+ unknown option is present, ARGP_ERR_UNKNOWN is returned; if some parser
+ routine returned a non-zero value, it is returned; otherwise 0 is
+ returned. This function may also call exit unless the ARGP_NO_HELP flag
+ is set. INPUT is a pointer to a value to be passed in to the parser. */
+extern error_t argp_parse (__const struct argp *__restrict __argp,
+ int __argc, char **__restrict __argv,
+ unsigned __flags, int *__restrict __arg_index,
+ void *__restrict __input);
+extern error_t __argp_parse (__const struct argp *__restrict __argp,
+ int __argc, char **__restrict __argv,
+ unsigned __flags, int *__restrict __arg_index,
+ void *__restrict __input);
+
+/* Global variables. */
+
+/* If defined or set by the user program to a non-zero value, then a default
+ option --version is added (unless the ARGP_NO_HELP flag is used), which
+ will print this string followed by a newline and exit (unless the
+ ARGP_NO_EXIT flag is used). Overridden by ARGP_PROGRAM_VERSION_HOOK. */
+extern __const char *argp_program_version;
+
+/* If defined or set by the user program to a non-zero value, then a default
+ option --version is added (unless the ARGP_NO_HELP flag is used), which
+ calls this function with a stream to print the version to and a pointer to
+ the current parsing state, and then exits (unless the ARGP_NO_EXIT flag is
+ used). This variable takes precedent over ARGP_PROGRAM_VERSION. */
+extern void (*argp_program_version_hook) (FILE *__restrict __stream,
+ struct argp_state *__restrict
+ __state);
+
+/* If defined or set by the user program, it should point to string that is
+ the bug-reporting address for the program. It will be printed by
+ argp_help if the ARGP_HELP_BUG_ADDR flag is set (as it is by various
+ standard help messages), embedded in a sentence that says something like
+ `Report bugs to ADDR.'. */
+extern __const char *argp_program_bug_address;
+
+/* The exit status that argp will use when exiting due to a parsing error.
+ If not defined or set by the user program, this defaults to EX_USAGE from
+ <sysexits.h>. */
+extern error_t argp_err_exit_status;
+
+/* Flags for argp_help. */
+#define ARGP_HELP_USAGE 0x01 /* a Usage: message. */
+#define ARGP_HELP_SHORT_USAGE 0x02 /* " but don't actually print options. */
+#define ARGP_HELP_SEE 0x04 /* a `Try ... for more help' message. */
+#define ARGP_HELP_LONG 0x08 /* a long help message. */
+#define ARGP_HELP_PRE_DOC 0x10 /* doc string preceding long help. */
+#define ARGP_HELP_POST_DOC 0x20 /* doc string following long help. */
+#define ARGP_HELP_DOC (ARGP_HELP_PRE_DOC | ARGP_HELP_POST_DOC)
+#define ARGP_HELP_BUG_ADDR 0x40 /* bug report address */
+#define ARGP_HELP_LONG_ONLY 0x80 /* modify output appropriately to
+ reflect ARGP_LONG_ONLY mode. */
+
+/* These ARGP_HELP flags are only understood by argp_state_help. */
+#define ARGP_HELP_EXIT_ERR 0x100 /* Call exit(1) instead of returning. */
+#define ARGP_HELP_EXIT_OK 0x200 /* Call exit(0) instead of returning. */
+
+/* The standard thing to do after a program command line parsing error, if an
+ error message has already been printed. */
+#define ARGP_HELP_STD_ERR \
+ (ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR)
+/* The standard thing to do after a program command line parsing error, if no
+ more specific error message has been printed. */
+#define ARGP_HELP_STD_USAGE \
+ (ARGP_HELP_SHORT_USAGE | ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR)
+/* The standard thing to do in response to a --help option. */
+#define ARGP_HELP_STD_HELP \
+ (ARGP_HELP_SHORT_USAGE | ARGP_HELP_LONG | ARGP_HELP_EXIT_OK \
+ | ARGP_HELP_DOC | ARGP_HELP_BUG_ADDR)
+
+/* Output a usage message for ARGP to STREAM. FLAGS are from the set
+ ARGP_HELP_*. */
+extern void argp_help (__const struct argp *__restrict __argp,
+ FILE *__restrict __stream,
+ unsigned __flags, char *__restrict __name);
+extern void __argp_help (__const struct argp *__restrict __argp,
+ FILE *__restrict __stream, unsigned __flags,
+ char *__name);
+
+/* The following routines are intended to be called from within an argp
+ parsing routine (thus taking an argp_state structure as the first
+ argument). They may or may not print an error message and exit, depending
+ on the flags in STATE -- in any case, the caller should be prepared for
+ them *not* to exit, and should return an appropiate error after calling
+ them. [argp_usage & argp_error should probably be called argp_state_...,
+ but they're used often enough that they should be short] */
+
+/* Output, if appropriate, a usage message for STATE to STREAM. FLAGS are
+ from the set ARGP_HELP_*. */
+extern void argp_state_help (__const struct argp_state *__restrict __state,
+ FILE *__restrict __stream,
+ unsigned int __flags);
+extern void __argp_state_help (__const struct argp_state *__restrict __state,
+ FILE *__restrict __stream,
+ unsigned int __flags);
+
+/* Possibly output the standard usage message for ARGP to stderr and exit. */
+extern void argp_usage (__const struct argp_state *__state);
+extern void __argp_usage (__const struct argp_state *__state);
+
+/* If appropriate, print the printf string FMT and following args, preceded
+ by the program name and `:', to stderr, and followed by a `Try ... --help'
+ message, then exit (1). */
+extern void argp_error (__const struct argp_state *__restrict __state,
+ __const char *__restrict __fmt, ...)
+ __attribute__ ((__format__ (__printf__, 2, 3)));
+extern void __argp_error (__const struct argp_state *__restrict __state,
+ __const char *__restrict __fmt, ...)
+ __attribute__ ((__format__ (__printf__, 2, 3)));
+
+/* Similar to the standard gnu error-reporting function error(), but will
+ respect the ARGP_NO_EXIT and ARGP_NO_ERRS flags in STATE, and will print
+ to STATE->err_stream. This is useful for argument parsing code that is
+ shared between program startup (when exiting is desired) and runtime
+ option parsing (when typically an error code is returned instead). The
+ difference between this function and argp_error is that the latter is for
+ *parsing errors*, and the former is for other problems that occur during
+ parsing but don't reflect a (syntactic) problem with the input. */
+extern void argp_failure (__const struct argp_state *__restrict __state,
+ int __status, int __errnum,
+ __const char *__restrict __fmt, ...)
+ __attribute__ ((__format__ (__printf__, 4, 5)));
+extern void __argp_failure (__const struct argp_state *__restrict __state,
+ int __status, int __errnum,
+ __const char *__restrict __fmt, ...)
+ __attribute__ ((__format__ (__printf__, 4, 5)));
+
+/* Returns true if the option OPT is a valid short option. */
+extern int _option_is_short (__const struct argp_option *__opt) __THROW;
+extern int __option_is_short (__const struct argp_option *__opt) __THROW;
+
+/* Returns true if the option OPT is in fact the last (unused) entry in an
+ options array. */
+extern int _option_is_end (__const struct argp_option *__opt) __THROW;
+extern int __option_is_end (__const struct argp_option *__opt) __THROW;
+
+/* Return the input field for ARGP in the parser corresponding to STATE; used
+ by the help routines. */
+extern void *_argp_input (__const struct argp *__restrict __argp,
+ __const struct argp_state *__restrict __state)
+ __THROW;
+extern void *__argp_input (__const struct argp *__restrict __argp,
+ __const struct argp_state *__restrict __state)
+ __THROW;
+
+#ifdef __USE_EXTERN_INLINES
+
+# if !_LIBC
+# define __argp_usage argp_usage
+# define __argp_state_help argp_state_help
+# define __option_is_short _option_is_short
+# define __option_is_end _option_is_end
+# endif
+
+# ifndef ARGP_EI
+# define ARGP_EI __extern_inline
+# endif
+
+ARGP_EI void
+__argp_usage (__const struct argp_state *__state)
+{
+ __argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
+}
+
+ARGP_EI int
+__NTH (__option_is_short (__const struct argp_option *__opt))
+{
+ if (__opt->flags & OPTION_DOC)
+ return 0;
+ else
+ {
+ int __key = __opt->key;
+ return __key > 0 && __key <= UCHAR_MAX && isprint (__key);
+ }
+}
+
+ARGP_EI int
+__NTH (__option_is_end (__const struct argp_option *__opt))
+{
+ return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
+}
+
+# if !_LIBC
+# undef __argp_usage
+# undef __argp_state_help
+# undef __option_is_short
+# undef __option_is_end
+# endif
+#endif /* Use extern inlines. */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* argp.h */
diff --git a/sysroot/usr/include/argz.h b/sysroot/usr/include/argz.h
new file mode 100644
index 0000000..4141d99
--- /dev/null
+++ b/sysroot/usr/include/argz.h
@@ -0,0 +1,187 @@
+/* Routines for dealing with '\0' separated arg vectors.
+ Copyright (C) 1995,96,97,98,99,2000,2004,2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _ARGZ_H
+#define _ARGZ_H 1
+
+#include <features.h>
+
+#define __need_error_t
+#include <errno.h>
+#include <string.h> /* Need size_t, and strchr is called below. */
+
+#ifndef __const
+# define __const const
+#endif
+
+#ifndef __error_t_defined
+typedef int error_t;
+#endif
+
+
+__BEGIN_DECLS
+
+/* Make a '\0' separated arg vector from a unix argv vector, returning it in
+ ARGZ, and the total length in LEN. If a memory allocation error occurs,
+ ENOMEM is returned, otherwise 0. The result can be destroyed using free. */
+extern error_t __argz_create (char *__const __argv[], char **__restrict __argz,
+ size_t *__restrict __len) __THROW;
+extern error_t argz_create (char *__const __argv[], char **__restrict __argz,
+ size_t *__restrict __len) __THROW;
+
+/* Make a '\0' separated arg vector from a SEP separated list in
+ STRING, returning it in ARGZ, and the total length in LEN. If a
+ memory allocation error occurs, ENOMEM is returned, otherwise 0.
+ The result can be destroyed using free. */
+extern error_t __argz_create_sep (__const char *__restrict __string,
+ int __sep, char **__restrict __argz,
+ size_t *__restrict __len) __THROW;
+extern error_t argz_create_sep (__const char *__restrict __string,
+ int __sep, char **__restrict __argz,
+ size_t *__restrict __len) __THROW;
+
+/* Returns the number of strings in ARGZ. */
+extern size_t __argz_count (__const char *__argz, size_t __len)
+ __THROW __attribute_pure__;
+extern size_t argz_count (__const char *__argz, size_t __len)
+ __THROW __attribute_pure__;
+
+/* Puts pointers to each string in ARGZ into ARGV, which must be large enough
+ to hold them all. */
+extern void __argz_extract (__const char *__restrict __argz, size_t __len,
+ char **__restrict __argv) __THROW;
+extern void argz_extract (__const char *__restrict __argz, size_t __len,
+ char **__restrict __argv) __THROW;
+
+/* Make '\0' separated arg vector ARGZ printable by converting all the '\0's
+ except the last into the character SEP. */
+extern void __argz_stringify (char *__argz, size_t __len, int __sep) __THROW;
+extern void argz_stringify (char *__argz, size_t __len, int __sep) __THROW;
+
+/* Append BUF, of length BUF_LEN to the argz vector in ARGZ & ARGZ_LEN. */
+extern error_t __argz_append (char **__restrict __argz,
+ size_t *__restrict __argz_len,
+ __const char *__restrict __buf, size_t _buf_len)
+ __THROW;
+extern error_t argz_append (char **__restrict __argz,
+ size_t *__restrict __argz_len,
+ __const char *__restrict __buf, size_t __buf_len)
+ __THROW;
+
+/* Append STR to the argz vector in ARGZ & ARGZ_LEN. */
+extern error_t __argz_add (char **__restrict __argz,
+ size_t *__restrict __argz_len,
+ __const char *__restrict __str) __THROW;
+extern error_t argz_add (char **__restrict __argz,
+ size_t *__restrict __argz_len,
+ __const char *__restrict __str) __THROW;
+
+/* Append SEP separated list in STRING to the argz vector in ARGZ &
+ ARGZ_LEN. */
+extern error_t __argz_add_sep (char **__restrict __argz,
+ size_t *__restrict __argz_len,
+ __const char *__restrict __string, int __delim)
+ __THROW;
+extern error_t argz_add_sep (char **__restrict __argz,
+ size_t *__restrict __argz_len,
+ __const char *__restrict __string, int __delim)
+ __THROW;
+
+/* Delete ENTRY from ARGZ & ARGZ_LEN, if it appears there. */
+extern void __argz_delete (char **__restrict __argz,
+ size_t *__restrict __argz_len,
+ char *__restrict __entry) __THROW;
+extern void argz_delete (char **__restrict __argz,
+ size_t *__restrict __argz_len,
+ char *__restrict __entry) __THROW;
+
+/* Insert ENTRY into ARGZ & ARGZ_LEN before BEFORE, which should be an
+ existing entry in ARGZ; if BEFORE is NULL, ENTRY is appended to the end.
+ Since ARGZ's first entry is the same as ARGZ, argz_insert (ARGZ, ARGZ_LEN,
+ ARGZ, ENTRY) will insert ENTRY at the beginning of ARGZ. If BEFORE is not
+ in ARGZ, EINVAL is returned, else if memory can't be allocated for the new
+ ARGZ, ENOMEM is returned, else 0. */
+extern error_t __argz_insert (char **__restrict __argz,
+ size_t *__restrict __argz_len,
+ char *__restrict __before,
+ __const char *__restrict __entry) __THROW;
+extern error_t argz_insert (char **__restrict __argz,
+ size_t *__restrict __argz_len,
+ char *__restrict __before,
+ __const char *__restrict __entry) __THROW;
+
+/* Replace any occurrences of the string STR in ARGZ with WITH, reallocating
+ ARGZ as necessary. If REPLACE_COUNT is non-zero, *REPLACE_COUNT will be
+ incremented by number of replacements performed. */
+extern error_t __argz_replace (char **__restrict __argz,
+ size_t *__restrict __argz_len,
+ __const char *__restrict __str,
+ __const char *__restrict __with,
+ unsigned int *__restrict __replace_count);
+extern error_t argz_replace (char **__restrict __argz,
+ size_t *__restrict __argz_len,
+ __const char *__restrict __str,
+ __const char *__restrict __with,
+ unsigned int *__restrict __replace_count);
+
+/* Returns the next entry in ARGZ & ARGZ_LEN after ENTRY, or NULL if there
+ are no more. If entry is NULL, then the first entry is returned. This
+ behavior allows two convenient iteration styles:
+
+ char *entry = 0;
+ while ((entry = argz_next (argz, argz_len, entry)))
+ ...;
+
+ or
+
+ char *entry;
+ for (entry = argz; entry; entry = argz_next (argz, argz_len, entry))
+ ...;
+*/
+extern char *__argz_next (__const char *__restrict __argz, size_t __argz_len,
+ __const char *__restrict __entry) __THROW;
+extern char *argz_next (__const char *__restrict __argz, size_t __argz_len,
+ __const char *__restrict __entry) __THROW;
+
+#ifdef __USE_EXTERN_INLINES
+__extern_inline char *
+__NTH (__argz_next (__const char *__argz, size_t __argz_len,
+ __const char *__entry))
+{
+ if (__entry)
+ {
+ if (__entry < __argz + __argz_len)
+ __entry = strchr (__entry, '\0') + 1;
+
+ return __entry >= __argz + __argz_len ? (char *) NULL : (char *) __entry;
+ }
+ else
+ return __argz_len > 0 ? (char *) __argz : 0;
+}
+__extern_inline char *
+__NTH (argz_next (__const char *__argz, size_t __argz_len,
+ __const char *__entry))
+{
+ return __argz_next (__argz, __argz_len, __entry);
+}
+#endif /* Use extern inlines. */
+
+__END_DECLS
+
+#endif /* argz.h */
diff --git a/sysroot/usr/include/arpa/ftp.h b/sysroot/usr/include/arpa/ftp.h
new file mode 100644
index 0000000..e5b340d
--- /dev/null
+++ b/sysroot/usr/include/arpa/ftp.h
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 1983, 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)ftp.h 8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _ARPA_FTP_H
+#define _ARPA_FTP_H 1
+
+/* Definitions for FTP; see RFC-765. */
+
+/*
+ * Reply codes.
+ */
+#define PRELIM 1 /* positive preliminary */
+#define COMPLETE 2 /* positive completion */
+#define CONTINUE 3 /* positive intermediate */
+#define TRANSIENT 4 /* transient negative completion */
+#define ERROR 5 /* permanent negative completion */
+
+/*
+ * Type codes
+ */
+#define TYPE_A 1 /* ASCII */
+#define TYPE_E 2 /* EBCDIC */
+#define TYPE_I 3 /* image */
+#define TYPE_L 4 /* local byte size */
+
+#ifdef FTP_NAMES
+char *typenames[] = {"0", "ASCII", "EBCDIC", "Image", "Local" };
+#endif
+
+/*
+ * Form codes
+ */
+#define FORM_N 1 /* non-print */
+#define FORM_T 2 /* telnet format effectors */
+#define FORM_C 3 /* carriage control (ASA) */
+#ifdef FTP_NAMES
+char *formnames[] = {"0", "Nonprint", "Telnet", "Carriage-control" };
+#endif
+
+/*
+ * Structure codes
+ */
+#define STRU_F 1 /* file (no record structure) */
+#define STRU_R 2 /* record structure */
+#define STRU_P 3 /* page structure */
+#ifdef FTP_NAMES
+char *strunames[] = {"0", "File", "Record", "Page" };
+#endif
+
+/*
+ * Mode types
+ */
+#define MODE_S 1 /* stream */
+#define MODE_B 2 /* block */
+#define MODE_C 3 /* compressed */
+#ifdef FTP_NAMES
+char *modenames[] = {"0", "Stream", "Block", "Compressed" };
+#endif
+
+/*
+ * Record Tokens
+ */
+#define REC_ESC '\377' /* Record-mode Escape */
+#define REC_EOR '\001' /* Record-mode End-of-Record */
+#define REC_EOF '\002' /* Record-mode End-of-File */
+
+/*
+ * Block Header
+ */
+#define BLK_EOR 0x80 /* Block is End-of-Record */
+#define BLK_EOF 0x40 /* Block is End-of-File */
+#define BLK_ERRORS 0x20 /* Block is suspected of containing errors */
+#define BLK_RESTART 0x10 /* Block is Restart Marker */
+
+#define BLK_BYTECOUNT 2 /* Bytes in this block */
+
+#endif /* arpa/ftp.h */
diff --git a/sysroot/usr/include/arpa/inet.h b/sysroot/usr/include/arpa/inet.h
new file mode 100644
index 0000000..5b1154e
--- /dev/null
+++ b/sysroot/usr/include/arpa/inet.h
@@ -0,0 +1,106 @@
+/* Copyright (C) 1997, 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _ARPA_INET_H
+#define _ARPA_INET_H 1
+
+#include <features.h>
+#include <netinet/in.h> /* To define `struct in_addr'. */
+
+/* Type for length arguments in socket calls. */
+#ifndef __socklen_t_defined
+typedef __socklen_t socklen_t;
+# define __socklen_t_defined
+#endif
+
+__BEGIN_DECLS
+
+/* Convert Internet host address from numbers-and-dots notation in CP
+ into binary data in network byte order. */
+extern in_addr_t inet_addr (__const char *__cp) __THROW;
+
+/* Return the local host address part of the Internet address in IN. */
+extern in_addr_t inet_lnaof (struct in_addr __in) __THROW;
+
+/* Make Internet host address in network byte order by combining the
+ network number NET with the local address HOST. */
+extern struct in_addr inet_makeaddr (in_addr_t __net, in_addr_t __host)
+ __THROW;
+
+/* Return network number part of the Internet address IN. */
+extern in_addr_t inet_netof (struct in_addr __in) __THROW;
+
+/* Extract the network number in network byte order from the address
+ in numbers-and-dots natation starting at CP. */
+extern in_addr_t inet_network (__const char *__cp) __THROW;
+
+/* Convert Internet number in IN to ASCII representation. The return value
+ is a pointer to an internal array containing the string. */
+extern char *inet_ntoa (struct in_addr __in) __THROW;
+
+/* Convert from presentation format of an Internet number in buffer
+ starting at CP to the binary network format and store result for
+ interface type AF in buffer starting at BUF. */
+extern int inet_pton (int __af, __const char *__restrict __cp,
+ void *__restrict __buf) __THROW;
+
+/* Convert a Internet address in binary network format for interface
+ type AF in buffer starting at CP to presentation form and place
+ result in buffer of length LEN astarting at BUF. */
+extern __const char *inet_ntop (int __af, __const void *__restrict __cp,
+ char *__restrict __buf, socklen_t __len)
+ __THROW;
+
+
+/* The following functions are not part of XNS 5.2. */
+#ifdef __USE_MISC
+/* Convert Internet host address from numbers-and-dots notation in CP
+ into binary data and store the result in the structure INP. */
+extern int inet_aton (__const char *__cp, struct in_addr *__inp) __THROW;
+
+/* Format a network number NET into presentation format and place result
+ in buffer starting at BUF with length of LEN bytes. */
+extern char *inet_neta (in_addr_t __net, char *__buf, size_t __len) __THROW;
+
+/* Convert network number for interface type AF in buffer starting at
+ CP to presentation format. The result will specifiy BITS bits of
+ the number. */
+extern char *inet_net_ntop (int __af, __const void *__cp, int __bits,
+ char *__buf, size_t __len) __THROW;
+
+/* Convert network number for interface type AF from presentation in
+ buffer starting at CP to network format and store result int
+ buffer starting at BUF of size LEN. */
+extern int inet_net_pton (int __af, __const char *__cp,
+ void *__buf, size_t __len) __THROW;
+
+/* Convert ASCII representation in hexadecimal form of the Internet
+ address to binary form and place result in buffer of length LEN
+ starting at BUF. */
+extern unsigned int inet_nsap_addr (__const char *__cp,
+ unsigned char *__buf, int __len) __THROW;
+
+/* Convert internet address in binary form in LEN bytes starting at CP
+ a presentation form and place result in BUF. */
+extern char *inet_nsap_ntoa (int __len, __const unsigned char *__cp,
+ char *__buf) __THROW;
+#endif
+
+__END_DECLS
+
+#endif /* arpa/inet.h */
diff --git a/sysroot/usr/include/arpa/nameser.h b/sysroot/usr/include/arpa/nameser.h
new file mode 100644
index 0000000..a164221
--- /dev/null
+++ b/sysroot/usr/include/arpa/nameser.h
@@ -0,0 +1,562 @@
+/*
+ * Copyright (c) 1983, 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Copyright (c) 1996-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
+ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
+ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+/*
+ * $BINDId: nameser.h,v 8.37 2000/03/30 21:16:49 vixie Exp $
+ */
+
+#ifndef _ARPA_NAMESER_H_
+#define _ARPA_NAMESER_H_
+
+#define BIND_4_COMPAT
+
+#include <sys/param.h>
+#if (!defined(BSD)) || (BSD < 199306)
+# include <sys/bitypes.h>
+#else
+# include <sys/types.h>
+#endif
+#include <sys/cdefs.h>
+
+/*
+ * Revision information. This is the release date in YYYYMMDD format.
+ * It can change every day so the right thing to do with it is use it
+ * in preprocessor commands such as "#if (__NAMESER > 19931104)". Do not
+ * compare for equality; rather, use it to determine whether your libbind.a
+ * contains a new enough lib/nameser/ to support the feature you need.
+ */
+
+#define __NAMESER 19991006 /* New interface version stamp. */
+
+/*
+ * Define constants based on RFC 883, RFC 1034, RFC 1035
+ */
+#define NS_PACKETSZ 512 /* maximum packet size */
+#define NS_MAXDNAME 1025 /* maximum domain name */
+#define NS_MAXCDNAME 255 /* maximum compressed domain name */
+#define NS_MAXLABEL 63 /* maximum length of domain label */
+#define NS_HFIXEDSZ 12 /* #/bytes of fixed data in header */
+#define NS_QFIXEDSZ 4 /* #/bytes of fixed data in query */
+#define NS_RRFIXEDSZ 10 /* #/bytes of fixed data in r record */
+#define NS_INT32SZ 4 /* #/bytes of data in a u_int32_t */
+#define NS_INT16SZ 2 /* #/bytes of data in a u_int16_t */
+#define NS_INT8SZ 1 /* #/bytes of data in a u_int8_t */
+#define NS_INADDRSZ 4 /* IPv4 T_A */
+#define NS_IN6ADDRSZ 16 /* IPv6 T_AAAA */
+#define NS_CMPRSFLGS 0xc0 /* Flag bits indicating name compression. */
+#define NS_DEFAULTPORT 53 /* For both TCP and UDP. */
+
+/*
+ * These can be expanded with synonyms, just keep ns_parse.c:ns_parserecord()
+ * in synch with it.
+ */
+typedef enum __ns_sect {
+ ns_s_qd = 0, /* Query: Question. */
+ ns_s_zn = 0, /* Update: Zone. */
+ ns_s_an = 1, /* Query: Answer. */
+ ns_s_pr = 1, /* Update: Prerequisites. */
+ ns_s_ns = 2, /* Query: Name servers. */
+ ns_s_ud = 2, /* Update: Update. */
+ ns_s_ar = 3, /* Query|Update: Additional records. */
+ ns_s_max = 4
+} ns_sect;
+
+/*
+ * This is a message handle. It is caller allocated and has no dynamic data.
+ * This structure is intended to be opaque to all but ns_parse.c, thus the
+ * leading _'s on the member names. Use the accessor functions, not the _'s.
+ */
+typedef struct __ns_msg {
+ const u_char *_msg, *_eom;
+ u_int16_t _id, _flags, _counts[ns_s_max];
+ const u_char *_sections[ns_s_max];
+ ns_sect _sect;
+ int _rrnum;
+ const u_char *_ptr;
+} ns_msg;
+
+/* Private data structure - do not use from outside library. */
+struct _ns_flagdata { int mask, shift; };
+extern struct _ns_flagdata _ns_flagdata[];
+
+/* Accessor macros - this is part of the public interface. */
+#define ns_msg_getflag(handle, flag) ( \
+ ((handle)._flags & _ns_flagdata[flag].mask) \
+ >> _ns_flagdata[flag].shift \
+ )
+#define ns_msg_id(handle) ((handle)._id + 0)
+#define ns_msg_base(handle) ((handle)._msg + 0)
+#define ns_msg_end(handle) ((handle)._eom + 0)
+#define ns_msg_size(handle) ((handle)._eom - (handle)._msg)
+#define ns_msg_count(handle, section) ((handle)._counts[section] + 0)
+
+/*
+ * This is a parsed record. It is caller allocated and has no dynamic data.
+ */
+typedef struct __ns_rr {
+ char name[NS_MAXDNAME];
+ u_int16_t type;
+ u_int16_t rr_class;
+ u_int32_t ttl;
+ u_int16_t rdlength;
+ const u_char * rdata;
+} ns_rr;
+
+/* Accessor macros - this is part of the public interface. */
+#define ns_rr_name(rr) (((rr).name[0] != '\0') ? (rr).name : ".")
+#define ns_rr_type(rr) ((ns_type)((rr).type + 0))
+#define ns_rr_class(rr) ((ns_class)((rr).rr_class + 0))
+#define ns_rr_ttl(rr) ((rr).ttl + 0)
+#define ns_rr_rdlen(rr) ((rr).rdlength + 0)
+#define ns_rr_rdata(rr) ((rr).rdata + 0)
+
+/*
+ * These don't have to be in the same order as in the packet flags word,
+ * and they can even overlap in some cases, but they will need to be kept
+ * in synch with ns_parse.c:ns_flagdata[].
+ */
+typedef enum __ns_flag {
+ ns_f_qr, /* Question/Response. */
+ ns_f_opcode, /* Operation code. */
+ ns_f_aa, /* Authoritative Answer. */
+ ns_f_tc, /* Truncation occurred. */
+ ns_f_rd, /* Recursion Desired. */
+ ns_f_ra, /* Recursion Available. */
+ ns_f_z, /* MBZ. */
+ ns_f_ad, /* Authentic Data (DNSSEC). */
+ ns_f_cd, /* Checking Disabled (DNSSEC). */
+ ns_f_rcode, /* Response code. */
+ ns_f_max
+} ns_flag;
+
+/*
+ * Currently defined opcodes.
+ */
+typedef enum __ns_opcode {
+ ns_o_query = 0, /* Standard query. */
+ ns_o_iquery = 1, /* Inverse query (deprecated/unsupported). */
+ ns_o_status = 2, /* Name server status query (unsupported). */
+ /* Opcode 3 is undefined/reserved. */
+ ns_o_notify = 4, /* Zone change notification. */
+ ns_o_update = 5, /* Zone update message. */
+ ns_o_max = 6
+} ns_opcode;
+
+/*
+ * Currently defined response codes.
+ */
+typedef enum __ns_rcode {
+ ns_r_noerror = 0, /* No error occurred. */
+ ns_r_formerr = 1, /* Format error. */
+ ns_r_servfail = 2, /* Server failure. */
+ ns_r_nxdomain = 3, /* Name error. */
+ ns_r_notimpl = 4, /* Unimplemented. */
+ ns_r_refused = 5, /* Operation refused. */
+ /* these are for BIND_UPDATE */
+ ns_r_yxdomain = 6, /* Name exists */
+ ns_r_yxrrset = 7, /* RRset exists */
+ ns_r_nxrrset = 8, /* RRset does not exist */
+ ns_r_notauth = 9, /* Not authoritative for zone */
+ ns_r_notzone = 10, /* Zone of record different from zone section */
+ ns_r_max = 11,
+ /* The following are TSIG extended errors */
+ ns_r_badsig = 16,
+ ns_r_badkey = 17,
+ ns_r_badtime = 18
+} ns_rcode;
+
+/* BIND_UPDATE */
+typedef enum __ns_update_operation {
+ ns_uop_delete = 0,
+ ns_uop_add = 1,
+ ns_uop_max = 2
+} ns_update_operation;
+
+/*
+ * This structure is used for TSIG authenticated messages
+ */
+struct ns_tsig_key {
+ char name[NS_MAXDNAME], alg[NS_MAXDNAME];
+ unsigned char *data;
+ int len;
+};
+typedef struct ns_tsig_key ns_tsig_key;
+
+/*
+ * This structure is used for TSIG authenticated TCP messages
+ */
+struct ns_tcp_tsig_state {
+ int counter;
+ struct dst_key *key;
+ void *ctx;
+ unsigned char sig[NS_PACKETSZ];
+ int siglen;
+};
+typedef struct ns_tcp_tsig_state ns_tcp_tsig_state;
+
+#define NS_TSIG_FUDGE 300
+#define NS_TSIG_TCP_COUNT 100
+#define NS_TSIG_ALG_HMAC_MD5 "HMAC-MD5.SIG-ALG.REG.INT"
+
+#define NS_TSIG_ERROR_NO_TSIG -10
+#define NS_TSIG_ERROR_NO_SPACE -11
+#define NS_TSIG_ERROR_FORMERR -12
+
+/*
+ * Currently defined type values for resources and queries.
+ */
+typedef enum __ns_type {
+ ns_t_invalid = 0, /* Cookie. */
+ ns_t_a = 1, /* Host address. */
+ ns_t_ns = 2, /* Authoritative server. */
+ ns_t_md = 3, /* Mail destination. */
+ ns_t_mf = 4, /* Mail forwarder. */
+ ns_t_cname = 5, /* Canonical name. */
+ ns_t_soa = 6, /* Start of authority zone. */
+ ns_t_mb = 7, /* Mailbox domain name. */
+ ns_t_mg = 8, /* Mail group member. */
+ ns_t_mr = 9, /* Mail rename name. */
+ ns_t_null = 10, /* Null resource record. */
+ ns_t_wks = 11, /* Well known service. */
+ ns_t_ptr = 12, /* Domain name pointer. */
+ ns_t_hinfo = 13, /* Host information. */
+ ns_t_minfo = 14, /* Mailbox information. */
+ ns_t_mx = 15, /* Mail routing information. */
+ ns_t_txt = 16, /* Text strings. */
+ ns_t_rp = 17, /* Responsible person. */
+ ns_t_afsdb = 18, /* AFS cell database. */
+ ns_t_x25 = 19, /* X_25 calling address. */
+ ns_t_isdn = 20, /* ISDN calling address. */
+ ns_t_rt = 21, /* Router. */
+ ns_t_nsap = 22, /* NSAP address. */
+ ns_t_nsap_ptr = 23, /* Reverse NSAP lookup (deprecated). */
+ ns_t_sig = 24, /* Security signature. */
+ ns_t_key = 25, /* Security key. */
+ ns_t_px = 26, /* X.400 mail mapping. */
+ ns_t_gpos = 27, /* Geographical position (withdrawn). */
+ ns_t_aaaa = 28, /* Ip6 Address. */
+ ns_t_loc = 29, /* Location Information. */
+ ns_t_nxt = 30, /* Next domain (security). */
+ ns_t_eid = 31, /* Endpoint identifier. */
+ ns_t_nimloc = 32, /* Nimrod Locator. */
+ ns_t_srv = 33, /* Server Selection. */
+ ns_t_atma = 34, /* ATM Address */
+ ns_t_naptr = 35, /* Naming Authority PoinTeR */
+ ns_t_kx = 36, /* Key Exchange */
+ ns_t_cert = 37, /* Certification record */
+ ns_t_a6 = 38, /* IPv6 address (deprecated, use ns_t_aaaa) */
+ ns_t_dname = 39, /* Non-terminal DNAME (for IPv6) */
+ ns_t_sink = 40, /* Kitchen sink (experimentatl) */
+ ns_t_opt = 41, /* EDNS0 option (meta-RR) */
+ ns_t_tsig = 250, /* Transaction signature. */
+ ns_t_ixfr = 251, /* Incremental zone transfer. */
+ ns_t_axfr = 252, /* Transfer zone of authority. */
+ ns_t_mailb = 253, /* Transfer mailbox records. */
+ ns_t_maila = 254, /* Transfer mail agent records. */
+ ns_t_any = 255, /* Wildcard match. */
+ ns_t_zxfr = 256, /* BIND-specific, nonstandard. */
+ ns_t_max = 65536
+} ns_type;
+
+/* Exclusively a QTYPE? (not also an RTYPE) */
+#define ns_t_qt_p(t) (ns_t_xfr_p(t) || (t) == ns_t_any || \
+ (t) == ns_t_mailb || (t) == ns_t_maila)
+/* Some kind of meta-RR? (not a QTYPE, but also not an RTYPE) */
+#define ns_t_mrr_p(t) ((t) == ns_t_tsig || (t) == ns_t_opt)
+/* Exclusively an RTYPE? (not also a QTYPE or a meta-RR) */
+#define ns_t_rr_p(t) (!ns_t_qt_p(t) && !ns_t_mrr_p(t))
+#define ns_t_udp_p(t) ((t) != ns_t_axfr && (t) != ns_t_zxfr)
+#define ns_t_xfr_p(t) ((t) == ns_t_axfr || (t) == ns_t_ixfr || \
+ (t) == ns_t_zxfr)
+
+/*
+ * Values for class field
+ */
+typedef enum __ns_class {
+ ns_c_invalid = 0, /* Cookie. */
+ ns_c_in = 1, /* Internet. */
+ ns_c_2 = 2, /* unallocated/unsupported. */
+ ns_c_chaos = 3, /* MIT Chaos-net. */
+ ns_c_hs = 4, /* MIT Hesiod. */
+ /* Query class values which do not appear in resource records */
+ ns_c_none = 254, /* for prereq. sections in update requests */
+ ns_c_any = 255, /* Wildcard match. */
+ ns_c_max = 65536
+} ns_class;
+
+/* DNSSEC constants. */
+
+typedef enum __ns_key_types {
+ ns_kt_rsa = 1, /* key type RSA/MD5 */
+ ns_kt_dh = 2, /* Diffie Hellman */
+ ns_kt_dsa = 3, /* Digital Signature Standard (MANDATORY) */
+ ns_kt_private = 254 /* Private key type starts with OID */
+} ns_key_types;
+
+typedef enum __ns_cert_types {
+ cert_t_pkix = 1, /* PKIX (X.509v3) */
+ cert_t_spki = 2, /* SPKI */
+ cert_t_pgp = 3, /* PGP */
+ cert_t_url = 253, /* URL private type */
+ cert_t_oid = 254 /* OID private type */
+} ns_cert_types;
+
+/* Flags field of the KEY RR rdata. */
+#define NS_KEY_TYPEMASK 0xC000 /* Mask for "type" bits */
+#define NS_KEY_TYPE_AUTH_CONF 0x0000 /* Key usable for both */
+#define NS_KEY_TYPE_CONF_ONLY 0x8000 /* Key usable for confidentiality */
+#define NS_KEY_TYPE_AUTH_ONLY 0x4000 /* Key usable for authentication */
+#define NS_KEY_TYPE_NO_KEY 0xC000 /* No key usable for either; no key */
+/* The type bits can also be interpreted independently, as single bits: */
+#define NS_KEY_NO_AUTH 0x8000 /* Key unusable for authentication */
+#define NS_KEY_NO_CONF 0x4000 /* Key unusable for confidentiality */
+#define NS_KEY_RESERVED2 0x2000 /* Security is *mandatory* if bit=0 */
+#define NS_KEY_EXTENDED_FLAGS 0x1000 /* reserved - must be zero */
+#define NS_KEY_RESERVED4 0x0800 /* reserved - must be zero */
+#define NS_KEY_RESERVED5 0x0400 /* reserved - must be zero */
+#define NS_KEY_NAME_TYPE 0x0300 /* these bits determine the type */
+#define NS_KEY_NAME_USER 0x0000 /* key is assoc. with user */
+#define NS_KEY_NAME_ENTITY 0x0200 /* key is assoc. with entity eg host */
+#define NS_KEY_NAME_ZONE 0x0100 /* key is zone key */
+#define NS_KEY_NAME_RESERVED 0x0300 /* reserved meaning */
+#define NS_KEY_RESERVED8 0x0080 /* reserved - must be zero */
+#define NS_KEY_RESERVED9 0x0040 /* reserved - must be zero */
+#define NS_KEY_RESERVED10 0x0020 /* reserved - must be zero */
+#define NS_KEY_RESERVED11 0x0010 /* reserved - must be zero */
+#define NS_KEY_SIGNATORYMASK 0x000F /* key can sign RR's of same name */
+#define NS_KEY_RESERVED_BITMASK ( NS_KEY_RESERVED2 | \
+ NS_KEY_RESERVED4 | \
+ NS_KEY_RESERVED5 | \
+ NS_KEY_RESERVED8 | \
+ NS_KEY_RESERVED9 | \
+ NS_KEY_RESERVED10 | \
+ NS_KEY_RESERVED11 )
+#define NS_KEY_RESERVED_BITMASK2 0xFFFF /* no bits defined here */
+
+/* The Algorithm field of the KEY and SIG RR's is an integer, {1..254} */
+#define NS_ALG_MD5RSA 1 /* MD5 with RSA */
+#define NS_ALG_DH 2 /* Diffie Hellman KEY */
+#define NS_ALG_DSA 3 /* DSA KEY */
+#define NS_ALG_DSS NS_ALG_DSA
+#define NS_ALG_EXPIRE_ONLY 253 /* No alg, no security */
+#define NS_ALG_PRIVATE_OID 254 /* Key begins with OID giving alg */
+
+/* Protocol values */
+/* value 0 is reserved */
+#define NS_KEY_PROT_TLS 1
+#define NS_KEY_PROT_EMAIL 2
+#define NS_KEY_PROT_DNSSEC 3
+#define NS_KEY_PROT_IPSEC 4
+#define NS_KEY_PROT_ANY 255
+
+/* Signatures */
+#define NS_MD5RSA_MIN_BITS 512 /* Size of a mod or exp in bits */
+#define NS_MD5RSA_MAX_BITS 2552
+ /* Total of binary mod and exp */
+#define NS_MD5RSA_MAX_BYTES ((NS_MD5RSA_MAX_BITS+7/8)*2+3)
+ /* Max length of text sig block */
+#define NS_MD5RSA_MAX_BASE64 (((NS_MD5RSA_MAX_BYTES+2)/3)*4)
+#define NS_MD5RSA_MIN_SIZE ((NS_MD5RSA_MIN_BITS+7)/8)
+#define NS_MD5RSA_MAX_SIZE ((NS_MD5RSA_MAX_BITS+7)/8)
+
+#define NS_DSA_SIG_SIZE 41
+#define NS_DSA_MIN_SIZE 213
+#define NS_DSA_MAX_BYTES 405
+
+/* Offsets into SIG record rdata to find various values */
+#define NS_SIG_TYPE 0 /* Type flags */
+#define NS_SIG_ALG 2 /* Algorithm */
+#define NS_SIG_LABELS 3 /* How many labels in name */
+#define NS_SIG_OTTL 4 /* Original TTL */
+#define NS_SIG_EXPIR 8 /* Expiration time */
+#define NS_SIG_SIGNED 12 /* Signature time */
+#define NS_SIG_FOOT 16 /* Key footprint */
+#define NS_SIG_SIGNER 18 /* Domain name of who signed it */
+
+/* How RR types are represented as bit-flags in NXT records */
+#define NS_NXT_BITS 8
+#define NS_NXT_BIT_SET( n,p) (p[(n)/NS_NXT_BITS] |= (0x80>>((n)%NS_NXT_BITS)))
+#define NS_NXT_BIT_CLEAR(n,p) (p[(n)/NS_NXT_BITS] &= ~(0x80>>((n)%NS_NXT_BITS)))
+#define NS_NXT_BIT_ISSET(n,p) (p[(n)/NS_NXT_BITS] & (0x80>>((n)%NS_NXT_BITS)))
+#define NS_NXT_MAX 127
+
+/*
+ * EDNS0 extended flags, host order.
+ */
+#define NS_OPT_DNSSEC_OK 0x8000U
+
+/*
+ * Inline versions of get/put short/long. Pointer is advanced.
+ */
+#define NS_GET16(s, cp) do { \
+ register u_char *t_cp = (u_char *)(cp); \
+ (s) = ((u_int16_t)t_cp[0] << 8) \
+ | ((u_int16_t)t_cp[1]) \
+ ; \
+ (cp) += NS_INT16SZ; \
+} while (0)
+
+#define NS_GET32(l, cp) do { \
+ register u_char *t_cp = (u_char *)(cp); \
+ (l) = ((u_int32_t)t_cp[0] << 24) \
+ | ((u_int32_t)t_cp[1] << 16) \
+ | ((u_int32_t)t_cp[2] << 8) \
+ | ((u_int32_t)t_cp[3]) \
+ ; \
+ (cp) += NS_INT32SZ; \
+} while (0)
+
+#define NS_PUT16(s, cp) do { \
+ register u_int16_t t_s = (u_int16_t)(s); \
+ register u_char *t_cp = (u_char *)(cp); \
+ *t_cp++ = t_s >> 8; \
+ *t_cp = t_s; \
+ (cp) += NS_INT16SZ; \
+} while (0)
+
+#define NS_PUT32(l, cp) do { \
+ register u_int32_t t_l = (u_int32_t)(l); \
+ register u_char *t_cp = (u_char *)(cp); \
+ *t_cp++ = t_l >> 24; \
+ *t_cp++ = t_l >> 16; \
+ *t_cp++ = t_l >> 8; \
+ *t_cp = t_l; \
+ (cp) += NS_INT32SZ; \
+} while (0)
+
+/*
+ * ANSI C identifier hiding for bind's lib/nameser.
+ */
+#define ns_get16 __ns_get16
+#define ns_get32 __ns_get32
+#define ns_put16 __ns_put16
+#define ns_put32 __ns_put32
+#define ns_initparse __ns_initparse
+#define ns_skiprr __ns_skiprr
+#define ns_parserr __ns_parserr
+#define ns_sprintrr __ns_sprintrr
+#define ns_sprintrrf __ns_sprintrrf
+#define ns_format_ttl __ns_format_ttl
+#define ns_parse_ttl __ns_parse_ttl
+#define ns_datetosecs __ns_datetosecs
+#define ns_name_ntol __ns_name_ntol
+#define ns_name_ntop __ns_name_ntop
+#define ns_name_pton __ns_name_pton
+#define ns_name_unpack __ns_name_unpack
+#define ns_name_pack __ns_name_pack
+#define ns_name_compress __ns_name_compress
+#define ns_name_uncompress __ns_name_uncompress
+#define ns_name_skip __ns_name_skip
+#define ns_name_rollback __ns_name_rollback
+#define ns_sign __ns_sign
+#define ns_sign_tcp __ns_sign_tcp
+#define ns_sign_tcp_init __ns_sign_tcp_init
+#define ns_find_tsig __ns_find_tsig
+#define ns_verify __ns_verify
+#define ns_verify_tcp __ns_verify_tcp
+#define ns_verify_tcp_init __ns_verify_tcp_init
+#define ns_samedomain __ns_samedomain
+#define ns_subdomain __ns_subdomain
+#define ns_makecanon __ns_makecanon
+#define ns_samename __ns_samename
+
+__BEGIN_DECLS
+u_int ns_get16 (const u_char *) __THROW;
+u_long ns_get32 (const u_char *) __THROW;
+void ns_put16 (u_int, u_char *) __THROW;
+void ns_put32 (u_long, u_char *) __THROW;
+int ns_initparse (const u_char *, int, ns_msg *) __THROW;
+int ns_skiprr (const u_char *, const u_char *, ns_sect, int)
+ __THROW;
+int ns_parserr (ns_msg *, ns_sect, int, ns_rr *) __THROW;
+int ns_sprintrr (const ns_msg *, const ns_rr *,
+ const char *, const char *, char *, size_t)
+ __THROW;
+int ns_sprintrrf (const u_char *, size_t, const char *,
+ ns_class, ns_type, u_long, const u_char *,
+ size_t, const char *, const char *,
+ char *, size_t) __THROW;
+int ns_format_ttl (u_long, char *, size_t) __THROW;
+int ns_parse_ttl (const char *, u_long *) __THROW;
+u_int32_t ns_datetosecs (const char *cp, int *errp) __THROW;
+int ns_name_ntol (const u_char *, u_char *, size_t) __THROW;
+int ns_name_ntop (const u_char *, char *, size_t) __THROW;
+int ns_name_pton (const char *, u_char *, size_t) __THROW;
+int ns_name_unpack (const u_char *, const u_char *,
+ const u_char *, u_char *, size_t) __THROW;
+int ns_name_pack (const u_char *, u_char *, int,
+ const u_char **, const u_char **) __THROW;
+int ns_name_uncompress (const u_char *, const u_char *,
+ const u_char *, char *, size_t) __THROW;
+int ns_name_compress (const char *, u_char *, size_t,
+ const u_char **, const u_char **) __THROW;
+int ns_name_skip (const u_char **, const u_char *) __THROW;
+void ns_name_rollback (const u_char *, const u_char **,
+ const u_char **) __THROW;
+int ns_sign (u_char *, int *, int, int, void *,
+ const u_char *, int, u_char *, int *, time_t) __THROW;
+int ns_sign_tcp (u_char *, int *, int, int,
+ ns_tcp_tsig_state *, int) __THROW;
+int ns_sign_tcp_init (void *, const u_char *, int,
+ ns_tcp_tsig_state *) __THROW;
+u_char *ns_find_tsig (u_char *, u_char *) __THROW;
+int ns_verify (u_char *, int *, void *, const u_char *, int,
+ u_char *, int *, time_t *, int) __THROW;
+int ns_verify_tcp (u_char *, int *, ns_tcp_tsig_state *, int)
+ __THROW;
+int ns_verify_tcp_init (void *, const u_char *, int,
+ ns_tcp_tsig_state *) __THROW;
+int ns_samedomain (const char *, const char *) __THROW;
+int ns_subdomain (const char *, const char *) __THROW;
+int ns_makecanon (const char *, char *, size_t) __THROW;
+int ns_samename (const char *, const char *) __THROW;
+__END_DECLS
+
+#ifdef BIND_4_COMPAT
+#include <arpa/nameser_compat.h>
+#endif
+
+#endif /* !_ARPA_NAMESER_H_ */
diff --git a/sysroot/usr/include/arpa/nameser_compat.h b/sysroot/usr/include/arpa/nameser_compat.h
new file mode 100644
index 0000000..43bcd3a
--- /dev/null
+++ b/sysroot/usr/include/arpa/nameser_compat.h
@@ -0,0 +1,183 @@
+/* Copyright (c) 1983, 1989
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * from nameser.h 8.1 (Berkeley) 6/2/93
+ * $BINDId: nameser_compat.h,v 8.11 1999/01/02 08:00:58 vixie Exp $
+ */
+
+#ifndef _ARPA_NAMESER_COMPAT_
+#define _ARPA_NAMESER_COMPAT_
+
+#define __BIND 19950621 /* (DEAD) interface version stamp. */
+
+#include <endian.h>
+
+/*
+ * Structure for query header. The order of the fields is machine- and
+ * compiler-dependent, depending on the byte/bit order and the layout
+ * of bit fields. We use bit fields only in int variables, as this
+ * is all ANSI requires. This requires a somewhat confusing rearrangement.
+ */
+
+typedef struct {
+ unsigned id :16; /* query identification number */
+#if BYTE_ORDER == BIG_ENDIAN
+ /* fields in third byte */
+ unsigned qr: 1; /* response flag */
+ unsigned opcode: 4; /* purpose of message */
+ unsigned aa: 1; /* authoritive answer */
+ unsigned tc: 1; /* truncated message */
+ unsigned rd: 1; /* recursion desired */
+ /* fields in fourth byte */
+ unsigned ra: 1; /* recursion available */
+ unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */
+ unsigned ad: 1; /* authentic data from named */
+ unsigned cd: 1; /* checking disabled by resolver */
+ unsigned rcode :4; /* response code */
+#endif
+#if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN
+ /* fields in third byte */
+ unsigned rd :1; /* recursion desired */
+ unsigned tc :1; /* truncated message */
+ unsigned aa :1; /* authoritive answer */
+ unsigned opcode :4; /* purpose of message */
+ unsigned qr :1; /* response flag */
+ /* fields in fourth byte */
+ unsigned rcode :4; /* response code */
+ unsigned cd: 1; /* checking disabled by resolver */
+ unsigned ad: 1; /* authentic data from named */
+ unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */
+ unsigned ra :1; /* recursion available */
+#endif
+ /* remaining bytes */
+ unsigned qdcount :16; /* number of question entries */
+ unsigned ancount :16; /* number of answer entries */
+ unsigned nscount :16; /* number of authority entries */
+ unsigned arcount :16; /* number of resource entries */
+} HEADER;
+
+#define PACKETSZ NS_PACKETSZ
+#define MAXDNAME NS_MAXDNAME
+#define MAXCDNAME NS_MAXCDNAME
+#define MAXLABEL NS_MAXLABEL
+#define HFIXEDSZ NS_HFIXEDSZ
+#define QFIXEDSZ NS_QFIXEDSZ
+#define RRFIXEDSZ NS_RRFIXEDSZ
+#define INT32SZ NS_INT32SZ
+#define INT16SZ NS_INT16SZ
+#define INADDRSZ NS_INADDRSZ
+#define IN6ADDRSZ NS_IN6ADDRSZ
+#define INDIR_MASK NS_CMPRSFLGS
+#define NAMESERVER_PORT NS_DEFAULTPORT
+
+#define S_ZONE ns_s_zn
+#define S_PREREQ ns_s_pr
+#define S_UPDATE ns_s_ud
+#define S_ADDT ns_s_ar
+
+#define QUERY ns_o_query
+#define IQUERY ns_o_iquery
+#define STATUS ns_o_status
+#define NS_NOTIFY_OP ns_o_notify
+#define NS_UPDATE_OP ns_o_update
+
+#define NOERROR ns_r_noerror
+#define FORMERR ns_r_formerr
+#define SERVFAIL ns_r_servfail
+#define NXDOMAIN ns_r_nxdomain
+#define NOTIMP ns_r_notimpl
+#define REFUSED ns_r_refused
+#define YXDOMAIN ns_r_yxdomain
+#define YXRRSET ns_r_yxrrset
+#define NXRRSET ns_r_nxrrset
+#define NOTAUTH ns_r_notauth
+#define NOTZONE ns_r_notzone
+/*#define BADSIG ns_r_badsig*/
+/*#define BADKEY ns_r_badkey*/
+/*#define BADTIME ns_r_badtime*/
+
+
+#define DELETE ns_uop_delete
+#define ADD ns_uop_add
+
+#define T_A ns_t_a
+#define T_NS ns_t_ns
+#define T_MD ns_t_md
+#define T_MF ns_t_mf
+#define T_CNAME ns_t_cname
+#define T_SOA ns_t_soa
+#define T_MB ns_t_mb
+#define T_MG ns_t_mg
+#define T_MR ns_t_mr
+#define T_NULL ns_t_null
+#define T_WKS ns_t_wks
+#define T_PTR ns_t_ptr
+#define T_HINFO ns_t_hinfo
+#define T_MINFO ns_t_minfo
+#define T_MX ns_t_mx
+#define T_TXT ns_t_txt
+#define T_RP ns_t_rp
+#define T_AFSDB ns_t_afsdb
+#define T_X25 ns_t_x25
+#define T_ISDN ns_t_isdn
+#define T_RT ns_t_rt
+#define T_NSAP ns_t_nsap
+#define T_NSAP_PTR ns_t_nsap_ptr
+#define T_SIG ns_t_sig
+#define T_KEY ns_t_key
+#define T_PX ns_t_px
+#define T_GPOS ns_t_gpos
+#define T_AAAA ns_t_aaaa
+#define T_LOC ns_t_loc
+#define T_NXT ns_t_nxt
+#define T_EID ns_t_eid
+#define T_NIMLOC ns_t_nimloc
+#define T_SRV ns_t_srv
+#define T_ATMA ns_t_atma
+#define T_NAPTR ns_t_naptr
+#define T_TSIG ns_t_tsig
+#define T_IXFR ns_t_ixfr
+#define T_AXFR ns_t_axfr
+#define T_MAILB ns_t_mailb
+#define T_MAILA ns_t_maila
+#define T_ANY ns_t_any
+
+#define C_IN ns_c_in
+#define C_CHAOS ns_c_chaos
+#define C_HS ns_c_hs
+/* BIND_UPDATE */
+#define C_NONE ns_c_none
+#define C_ANY ns_c_any
+
+#define GETSHORT NS_GET16
+#define GETLONG NS_GET32
+#define PUTSHORT NS_PUT16
+#define PUTLONG NS_PUT32
+
+#endif /* _ARPA_NAMESER_COMPAT_ */
diff --git a/sysroot/usr/include/arpa/telnet.h b/sysroot/usr/include/arpa/telnet.h
new file mode 100644
index 0000000..3774c89
--- /dev/null
+++ b/sysroot/usr/include/arpa/telnet.h
@@ -0,0 +1,316 @@
+/*
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)telnet.h 8.2 (Berkeley) 12/15/93
+ */
+
+#ifndef _ARPA_TELNET_H
+#define _ARPA_TELNET_H 1
+
+/*
+ * Definitions for the TELNET protocol.
+ */
+#define IAC 255 /* interpret as command: */
+#define DONT 254 /* you are not to use option */
+#define DO 253 /* please, you use option */
+#define WONT 252 /* I won't use option */
+#define WILL 251 /* I will use option */
+#define SB 250 /* interpret as subnegotiation */
+#define GA 249 /* you may reverse the line */
+#define EL 248 /* erase the current line */
+#define EC 247 /* erase the current character */
+#define AYT 246 /* are you there */
+#define AO 245 /* abort output--but let prog finish */
+#define IP 244 /* interrupt process--permanently */
+#define BREAK 243 /* break */
+#define DM 242 /* data mark--for connect. cleaning */
+#define NOP 241 /* nop */
+#define SE 240 /* end sub negotiation */
+#define EOR 239 /* end of record (transparent mode) */
+#define ABORT 238 /* Abort process */
+#define SUSP 237 /* Suspend process */
+#define xEOF 236 /* End of file: EOF is already used... */
+
+#define SYNCH 242 /* for telfunc calls */
+
+#ifdef TELCMDS
+char *telcmds[] = {
+ "EOF", "SUSP", "ABORT", "EOR",
+ "SE", "NOP", "DMARK", "BRK", "IP", "AO", "AYT", "EC",
+ "EL", "GA", "SB", "WILL", "WONT", "DO", "DONT", "IAC", 0,
+};
+#else
+extern char *telcmds[];
+#endif
+
+#define TELCMD_FIRST xEOF
+#define TELCMD_LAST IAC
+#define TELCMD_OK(x) ((unsigned int)(x) <= TELCMD_LAST && \
+ (unsigned int)(x) >= TELCMD_FIRST)
+#define TELCMD(x) telcmds[(x)-TELCMD_FIRST]
+
+/* telnet options */
+#define TELOPT_BINARY 0 /* 8-bit data path */
+#define TELOPT_ECHO 1 /* echo */
+#define TELOPT_RCP 2 /* prepare to reconnect */
+#define TELOPT_SGA 3 /* suppress go ahead */
+#define TELOPT_NAMS 4 /* approximate message size */
+#define TELOPT_STATUS 5 /* give status */
+#define TELOPT_TM 6 /* timing mark */
+#define TELOPT_RCTE 7 /* remote controlled transmission and echo */
+#define TELOPT_NAOL 8 /* negotiate about output line width */
+#define TELOPT_NAOP 9 /* negotiate about output page size */
+#define TELOPT_NAOCRD 10 /* negotiate about CR disposition */
+#define TELOPT_NAOHTS 11 /* negotiate about horizontal tabstops */
+#define TELOPT_NAOHTD 12 /* negotiate about horizontal tab disposition */
+#define TELOPT_NAOFFD 13 /* negotiate about formfeed disposition */
+#define TELOPT_NAOVTS 14 /* negotiate about vertical tab stops */
+#define TELOPT_NAOVTD 15 /* negotiate about vertical tab disposition */
+#define TELOPT_NAOLFD 16 /* negotiate about output LF disposition */
+#define TELOPT_XASCII 17 /* extended ascii character set */
+#define TELOPT_LOGOUT 18 /* force logout */
+#define TELOPT_BM 19 /* byte macro */
+#define TELOPT_DET 20 /* data entry terminal */
+#define TELOPT_SUPDUP 21 /* supdup protocol */
+#define TELOPT_SUPDUPOUTPUT 22 /* supdup output */
+#define TELOPT_SNDLOC 23 /* send location */
+#define TELOPT_TTYPE 24 /* terminal type */
+#define TELOPT_EOR 25 /* end or record */
+#define TELOPT_TUID 26 /* TACACS user identification */
+#define TELOPT_OUTMRK 27 /* output marking */
+#define TELOPT_TTYLOC 28 /* terminal location number */
+#define TELOPT_3270REGIME 29 /* 3270 regime */
+#define TELOPT_X3PAD 30 /* X.3 PAD */
+#define TELOPT_NAWS 31 /* window size */
+#define TELOPT_TSPEED 32 /* terminal speed */
+#define TELOPT_LFLOW 33 /* remote flow control */
+#define TELOPT_LINEMODE 34 /* Linemode option */
+#define TELOPT_XDISPLOC 35 /* X Display Location */
+#define TELOPT_OLD_ENVIRON 36 /* Old - Environment variables */
+#define TELOPT_AUTHENTICATION 37/* Authenticate */
+#define TELOPT_ENCRYPT 38 /* Encryption option */
+#define TELOPT_NEW_ENVIRON 39 /* New - Environment variables */
+#define TELOPT_EXOPL 255 /* extended-options-list */
+
+
+#define NTELOPTS (1+TELOPT_NEW_ENVIRON)
+#ifdef TELOPTS
+char *telopts[NTELOPTS+1] = {
+ "BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", "NAME",
+ "STATUS", "TIMING MARK", "RCTE", "NAOL", "NAOP",
+ "NAOCRD", "NAOHTS", "NAOHTD", "NAOFFD", "NAOVTS",
+ "NAOVTD", "NAOLFD", "EXTEND ASCII", "LOGOUT", "BYTE MACRO",
+ "DATA ENTRY TERMINAL", "SUPDUP", "SUPDUP OUTPUT",
+ "SEND LOCATION", "TERMINAL TYPE", "END OF RECORD",
+ "TACACS UID", "OUTPUT MARKING", "TTYLOC",
+ "3270 REGIME", "X.3 PAD", "NAWS", "TSPEED", "LFLOW",
+ "LINEMODE", "XDISPLOC", "OLD-ENVIRON", "AUTHENTICATION",
+ "ENCRYPT", "NEW-ENVIRON",
+ 0,
+};
+#define TELOPT_FIRST TELOPT_BINARY
+#define TELOPT_LAST TELOPT_NEW_ENVIRON
+#define TELOPT_OK(x) ((unsigned int)(x) <= TELOPT_LAST)
+#define TELOPT(x) telopts[(x)-TELOPT_FIRST]
+#endif
+
+/* sub-option qualifiers */
+#define TELQUAL_IS 0 /* option is... */
+#define TELQUAL_SEND 1 /* send option */
+#define TELQUAL_INFO 2 /* ENVIRON: informational version of IS */
+#define TELQUAL_REPLY 2 /* AUTHENTICATION: client version of IS */
+#define TELQUAL_NAME 3 /* AUTHENTICATION: client version of IS */
+
+#define LFLOW_OFF 0 /* Disable remote flow control */
+#define LFLOW_ON 1 /* Enable remote flow control */
+#define LFLOW_RESTART_ANY 2 /* Restart output on any char */
+#define LFLOW_RESTART_XON 3 /* Restart output only on XON */
+
+/*
+ * LINEMODE suboptions
+ */
+
+#define LM_MODE 1
+#define LM_FORWARDMASK 2
+#define LM_SLC 3
+
+#define MODE_EDIT 0x01
+#define MODE_TRAPSIG 0x02
+#define MODE_ACK 0x04
+#define MODE_SOFT_TAB 0x08
+#define MODE_LIT_ECHO 0x10
+
+#define MODE_MASK 0x1f
+
+/* Not part of protocol, but needed to simplify things... */
+#define MODE_FLOW 0x0100
+#define MODE_ECHO 0x0200
+#define MODE_INBIN 0x0400
+#define MODE_OUTBIN 0x0800
+#define MODE_FORCE 0x1000
+
+#define SLC_SYNCH 1
+#define SLC_BRK 2
+#define SLC_IP 3
+#define SLC_AO 4
+#define SLC_AYT 5
+#define SLC_EOR 6
+#define SLC_ABORT 7
+#define SLC_EOF 8
+#define SLC_SUSP 9
+#define SLC_EC 10
+#define SLC_EL 11
+#define SLC_EW 12
+#define SLC_RP 13
+#define SLC_LNEXT 14
+#define SLC_XON 15
+#define SLC_XOFF 16
+#define SLC_FORW1 17
+#define SLC_FORW2 18
+
+#define NSLC 18
+
+/*
+ * For backwards compatibility, we define SLC_NAMES to be the
+ * list of names if SLC_NAMES is not defined.
+ */
+#define SLC_NAMELIST "0", "SYNCH", "BRK", "IP", "AO", "AYT", "EOR", \
+ "ABORT", "EOF", "SUSP", "EC", "EL", "EW", "RP", \
+ "LNEXT", "XON", "XOFF", "FORW1", "FORW2", 0,
+#ifdef SLC_NAMES
+char *slc_names[] = {
+ SLC_NAMELIST
+};
+#else
+extern char *slc_names[];
+#define SLC_NAMES SLC_NAMELIST
+#endif
+
+#define SLC_NAME_OK(x) ((unsigned int)(x) <= NSLC)
+#define SLC_NAME(x) slc_names[x]
+
+#define SLC_NOSUPPORT 0
+#define SLC_CANTCHANGE 1
+#define SLC_VARIABLE 2
+#define SLC_DEFAULT 3
+#define SLC_LEVELBITS 0x03
+
+#define SLC_FUNC 0
+#define SLC_FLAGS 1
+#define SLC_VALUE 2
+
+#define SLC_ACK 0x80
+#define SLC_FLUSHIN 0x40
+#define SLC_FLUSHOUT 0x20
+
+#define OLD_ENV_VAR 1
+#define OLD_ENV_VALUE 0
+#define NEW_ENV_VAR 0
+#define NEW_ENV_VALUE 1
+#define ENV_ESC 2
+#define ENV_USERVAR 3
+
+/*
+ * AUTHENTICATION suboptions
+ */
+
+/*
+ * Who is authenticating who ...
+ */
+#define AUTH_WHO_CLIENT 0 /* Client authenticating server */
+#define AUTH_WHO_SERVER 1 /* Server authenticating client */
+#define AUTH_WHO_MASK 1
+
+/*
+ * amount of authentication done
+ */
+#define AUTH_HOW_ONE_WAY 0
+#define AUTH_HOW_MUTUAL 2
+#define AUTH_HOW_MASK 2
+
+#define AUTHTYPE_NULL 0
+#define AUTHTYPE_KERBEROS_V4 1
+#define AUTHTYPE_KERBEROS_V5 2
+#define AUTHTYPE_SPX 3
+#define AUTHTYPE_MINK 4
+#define AUTHTYPE_CNT 5
+
+#define AUTHTYPE_TEST 99
+
+#ifdef AUTH_NAMES
+char *authtype_names[] = {
+ "NULL", "KERBEROS_V4", "KERBEROS_V5", "SPX", "MINK", 0,
+};
+#else
+extern char *authtype_names[];
+#endif
+
+#define AUTHTYPE_NAME_OK(x) ((unsigned int)(x) < AUTHTYPE_CNT)
+#define AUTHTYPE_NAME(x) authtype_names[x]
+
+/*
+ * ENCRYPTion suboptions
+ */
+#define ENCRYPT_IS 0 /* I pick encryption type ... */
+#define ENCRYPT_SUPPORT 1 /* I support encryption types ... */
+#define ENCRYPT_REPLY 2 /* Initial setup response */
+#define ENCRYPT_START 3 /* Am starting to send encrypted */
+#define ENCRYPT_END 4 /* Am ending encrypted */
+#define ENCRYPT_REQSTART 5 /* Request you start encrypting */
+#define ENCRYPT_REQEND 6 /* Request you send encrypting */
+#define ENCRYPT_ENC_KEYID 7
+#define ENCRYPT_DEC_KEYID 8
+#define ENCRYPT_CNT 9
+
+#define ENCTYPE_ANY 0
+#define ENCTYPE_DES_CFB64 1
+#define ENCTYPE_DES_OFB64 2
+#define ENCTYPE_CNT 3
+
+#ifdef ENCRYPT_NAMES
+char *encrypt_names[] = {
+ "IS", "SUPPORT", "REPLY", "START", "END",
+ "REQUEST-START", "REQUEST-END", "ENC-KEYID", "DEC-KEYID",
+ 0,
+};
+char *enctype_names[] = {
+ "ANY", "DES_CFB64", "DES_OFB64", 0,
+};
+#else
+extern char *encrypt_names[];
+extern char *enctype_names[];
+#endif
+
+
+#define ENCRYPT_NAME_OK(x) ((unsigned int)(x) < ENCRYPT_CNT)
+#define ENCRYPT_NAME(x) encrypt_names[x]
+
+#define ENCTYPE_NAME_OK(x) ((unsigned int)(x) < ENCTYPE_CNT)
+#define ENCTYPE_NAME(x) enctype_names[x]
+
+#endif /* arpa/telnet.h */
diff --git a/sysroot/usr/include/arpa/tftp.h b/sysroot/usr/include/arpa/tftp.h
new file mode 100644
index 0000000..21b0559
--- /dev/null
+++ b/sysroot/usr/include/arpa/tftp.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)tftp.h 8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _ARPA_TFTP_H
+#define _ARPA_TFTP_H 1
+
+/*
+ * Trivial File Transfer Protocol (IEN-133)
+ */
+#define SEGSIZE 512 /* data segment size */
+
+/*
+ * Packet types.
+ */
+#define RRQ 01 /* read request */
+#define WRQ 02 /* write request */
+#define DATA 03 /* data packet */
+#define ACK 04 /* acknowledgement */
+#define ERROR 05 /* error code */
+
+struct tftphdr {
+ short th_opcode; /* packet type */
+ union {
+ unsigned short tu_block; /* block # */
+ short tu_code; /* error code */
+ char tu_stuff[1]; /* request packet stuff */
+ } __attribute__ ((__packed__)) th_u;
+ char th_data[1]; /* data or error string */
+} __attribute__ ((__packed__));
+
+#define th_block th_u.tu_block
+#define th_code th_u.tu_code
+#define th_stuff th_u.tu_stuff
+#define th_msg th_data
+
+/*
+ * Error codes.
+ */
+#define EUNDEF 0 /* not defined */
+#define ENOTFOUND 1 /* file not found */
+#define EACCESS 2 /* access violation */
+#define ENOSPACE 3 /* disk full or allocation exceeded */
+#define EBADOP 4 /* illegal TFTP operation */
+#define EBADID 5 /* unknown transfer ID */
+#define EEXISTS 6 /* file already exists */
+#define ENOUSER 7 /* no such user */
+
+#endif /* arpa/tftp.h */
diff --git a/sysroot/usr/include/asm-generic/errno-base.h b/sysroot/usr/include/asm-generic/errno-base.h
new file mode 100644
index 0000000..6511597
--- /dev/null
+++ b/sysroot/usr/include/asm-generic/errno-base.h
@@ -0,0 +1,39 @@
+#ifndef _ASM_GENERIC_ERRNO_BASE_H
+#define _ASM_GENERIC_ERRNO_BASE_H
+
+#define EPERM 1 /* Operation not permitted */
+#define ENOENT 2 /* No such file or directory */
+#define ESRCH 3 /* No such process */
+#define EINTR 4 /* Interrupted system call */
+#define EIO 5 /* I/O error */
+#define ENXIO 6 /* No such device or address */
+#define E2BIG 7 /* Argument list too long */
+#define ENOEXEC 8 /* Exec format error */
+#define EBADF 9 /* Bad file number */
+#define ECHILD 10 /* No child processes */
+#define EAGAIN 11 /* Try again */
+#define ENOMEM 12 /* Out of memory */
+#define EACCES 13 /* Permission denied */
+#define EFAULT 14 /* Bad address */
+#define ENOTBLK 15 /* Block device required */
+#define EBUSY 16 /* Device or resource busy */
+#define EEXIST 17 /* File exists */
+#define EXDEV 18 /* Cross-device link */
+#define ENODEV 19 /* No such device */
+#define ENOTDIR 20 /* Not a directory */
+#define EISDIR 21 /* Is a directory */
+#define EINVAL 22 /* Invalid argument */
+#define ENFILE 23 /* File table overflow */
+#define EMFILE 24 /* Too many open files */
+#define ENOTTY 25 /* Not a typewriter */
+#define ETXTBSY 26 /* Text file busy */
+#define EFBIG 27 /* File too large */
+#define ENOSPC 28 /* No space left on device */
+#define ESPIPE 29 /* Illegal seek */
+#define EROFS 30 /* Read-only file system */
+#define EMLINK 31 /* Too many links */
+#define EPIPE 32 /* Broken pipe */
+#define EDOM 33 /* Math argument out of domain of func */
+#define ERANGE 34 /* Math result not representable */
+
+#endif
diff --git a/sysroot/usr/include/asm-generic/errno.h b/sysroot/usr/include/asm-generic/errno.h
new file mode 100644
index 0000000..e8852c0
--- /dev/null
+++ b/sysroot/usr/include/asm-generic/errno.h
@@ -0,0 +1,109 @@
+#ifndef _ASM_GENERIC_ERRNO_H
+#define _ASM_GENERIC_ERRNO_H
+
+#include <asm-generic/errno-base.h>
+
+#define EDEADLK 35 /* Resource deadlock would occur */
+#define ENAMETOOLONG 36 /* File name too long */
+#define ENOLCK 37 /* No record locks available */
+#define ENOSYS 38 /* Function not implemented */
+#define ENOTEMPTY 39 /* Directory not empty */
+#define ELOOP 40 /* Too many symbolic links encountered */
+#define EWOULDBLOCK EAGAIN /* Operation would block */
+#define ENOMSG 42 /* No message of desired type */
+#define EIDRM 43 /* Identifier removed */
+#define ECHRNG 44 /* Channel number out of range */
+#define EL2NSYNC 45 /* Level 2 not synchronized */
+#define EL3HLT 46 /* Level 3 halted */
+#define EL3RST 47 /* Level 3 reset */
+#define ELNRNG 48 /* Link number out of range */
+#define EUNATCH 49 /* Protocol driver not attached */
+#define ENOCSI 50 /* No CSI structure available */
+#define EL2HLT 51 /* Level 2 halted */
+#define EBADE 52 /* Invalid exchange */
+#define EBADR 53 /* Invalid request descriptor */
+#define EXFULL 54 /* Exchange full */
+#define ENOANO 55 /* No anode */
+#define EBADRQC 56 /* Invalid request code */
+#define EBADSLT 57 /* Invalid slot */
+
+#define EDEADLOCK EDEADLK
+
+#define EBFONT 59 /* Bad font file format */
+#define ENOSTR 60 /* Device not a stream */
+#define ENODATA 61 /* No data available */
+#define ETIME 62 /* Timer expired */
+#define ENOSR 63 /* Out of streams resources */
+#define ENONET 64 /* Machine is not on the network */
+#define ENOPKG 65 /* Package not installed */
+#define EREMOTE 66 /* Object is remote */
+#define ENOLINK 67 /* Link has been severed */
+#define EADV 68 /* Advertise error */
+#define ESRMNT 69 /* Srmount error */
+#define ECOMM 70 /* Communication error on send */
+#define EPROTO 71 /* Protocol error */
+#define EMULTIHOP 72 /* Multihop attempted */
+#define EDOTDOT 73 /* RFS specific error */
+#define EBADMSG 74 /* Not a data message */
+#define EOVERFLOW 75 /* Value too large for defined data type */
+#define ENOTUNIQ 76 /* Name not unique on network */
+#define EBADFD 77 /* File descriptor in bad state */
+#define EREMCHG 78 /* Remote address changed */
+#define ELIBACC 79 /* Can not access a needed shared library */
+#define ELIBBAD 80 /* Accessing a corrupted shared library */
+#define ELIBSCN 81 /* .lib section in a.out corrupted */
+#define ELIBMAX 82 /* Attempting to link in too many shared libraries */
+#define ELIBEXEC 83 /* Cannot exec a shared library directly */
+#define EILSEQ 84 /* Illegal byte sequence */
+#define ERESTART 85 /* Interrupted system call should be restarted */
+#define ESTRPIPE 86 /* Streams pipe error */
+#define EUSERS 87 /* Too many users */
+#define ENOTSOCK 88 /* Socket operation on non-socket */
+#define EDESTADDRREQ 89 /* Destination address required */
+#define EMSGSIZE 90 /* Message too long */
+#define EPROTOTYPE 91 /* Protocol wrong type for socket */
+#define ENOPROTOOPT 92 /* Protocol not available */
+#define EPROTONOSUPPORT 93 /* Protocol not supported */
+#define ESOCKTNOSUPPORT 94 /* Socket type not supported */
+#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */
+#define EPFNOSUPPORT 96 /* Protocol family not supported */
+#define EAFNOSUPPORT 97 /* Address family not supported by protocol */
+#define EADDRINUSE 98 /* Address already in use */
+#define EADDRNOTAVAIL 99 /* Cannot assign requested address */
+#define ENETDOWN 100 /* Network is down */
+#define ENETUNREACH 101 /* Network is unreachable */
+#define ENETRESET 102 /* Network dropped connection because of reset */
+#define ECONNABORTED 103 /* Software caused connection abort */
+#define ECONNRESET 104 /* Connection reset by peer */
+#define ENOBUFS 105 /* No buffer space available */
+#define EISCONN 106 /* Transport endpoint is already connected */
+#define ENOTCONN 107 /* Transport endpoint is not connected */
+#define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */
+#define ETOOMANYREFS 109 /* Too many references: cannot splice */
+#define ETIMEDOUT 110 /* Connection timed out */
+#define ECONNREFUSED 111 /* Connection refused */
+#define EHOSTDOWN 112 /* Host is down */
+#define EHOSTUNREACH 113 /* No route to host */
+#define EALREADY 114 /* Operation already in progress */
+#define EINPROGRESS 115 /* Operation now in progress */
+#define ESTALE 116 /* Stale NFS file handle */
+#define EUCLEAN 117 /* Structure needs cleaning */
+#define ENOTNAM 118 /* Not a XENIX named type file */
+#define ENAVAIL 119 /* No XENIX semaphores available */
+#define EISNAM 120 /* Is a named type file */
+#define EREMOTEIO 121 /* Remote I/O error */
+#define EDQUOT 122 /* Quota exceeded */
+
+#define ENOMEDIUM 123 /* No medium found */
+#define EMEDIUMTYPE 124 /* Wrong medium type */
+#define ECANCELED 125 /* Operation Canceled */
+#define ENOKEY 126 /* Required key not available */
+#define EKEYEXPIRED 127 /* Key has expired */
+#define EKEYREVOKED 128 /* Key has been revoked */
+#define EKEYREJECTED 129 /* Key was rejected by service */
+
+/* for robust mutexes */
+#define EOWNERDEAD 130 /* Owner died */
+#define ENOTRECOVERABLE 131 /* State not recoverable */
+
+#endif
diff --git a/sysroot/usr/include/asm-generic/fcntl.h b/sysroot/usr/include/asm-generic/fcntl.h
new file mode 100644
index 0000000..b847741
--- /dev/null
+++ b/sysroot/usr/include/asm-generic/fcntl.h
@@ -0,0 +1,151 @@
+#ifndef _ASM_GENERIC_FCNTL_H
+#define _ASM_GENERIC_FCNTL_H
+
+#include <linux/types.h>
+
+/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
+ located on an ext2 file system */
+#define O_ACCMODE 00000003
+#define O_RDONLY 00000000
+#define O_WRONLY 00000001
+#define O_RDWR 00000002
+#ifndef O_CREAT
+#define O_CREAT 00000100 /* not fcntl */
+#endif
+#ifndef O_EXCL
+#define O_EXCL 00000200 /* not fcntl */
+#endif
+#ifndef O_NOCTTY
+#define O_NOCTTY 00000400 /* not fcntl */
+#endif
+#ifndef O_TRUNC
+#define O_TRUNC 00001000 /* not fcntl */
+#endif
+#ifndef O_APPEND
+#define O_APPEND 00002000
+#endif
+#ifndef O_NONBLOCK
+#define O_NONBLOCK 00004000
+#endif
+#ifndef O_SYNC
+#define O_SYNC 00010000
+#endif
+#ifndef FASYNC
+#define FASYNC 00020000 /* fcntl, for BSD compatibility */
+#endif
+#ifndef O_DIRECT
+#define O_DIRECT 00040000 /* direct disk access hint */
+#endif
+#ifndef O_LARGEFILE
+#define O_LARGEFILE 00100000
+#endif
+#ifndef O_DIRECTORY
+#define O_DIRECTORY 00200000 /* must be a directory */
+#endif
+#ifndef O_NOFOLLOW
+#define O_NOFOLLOW 00400000 /* don't follow links */
+#endif
+#ifndef O_NOATIME
+#define O_NOATIME 01000000
+#endif
+#ifndef O_CLOEXEC
+#define O_CLOEXEC 02000000 /* set close_on_exec */
+#endif
+#ifndef O_NDELAY
+#define O_NDELAY O_NONBLOCK
+#endif
+
+#define F_DUPFD 0 /* dup */
+#define F_GETFD 1 /* get close_on_exec */
+#define F_SETFD 2 /* set/clear close_on_exec */
+#define F_GETFL 3 /* get file->f_flags */
+#define F_SETFL 4 /* set file->f_flags */
+#ifndef F_GETLK
+#define F_GETLK 5
+#define F_SETLK 6
+#define F_SETLKW 7
+#endif
+#ifndef F_SETOWN
+#define F_SETOWN 8 /* for sockets. */
+#define F_GETOWN 9 /* for sockets. */
+#endif
+#ifndef F_SETSIG
+#define F_SETSIG 10 /* for sockets. */
+#define F_GETSIG 11 /* for sockets. */
+#endif
+
+/* for F_[GET|SET]FL */
+#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
+
+/* for posix fcntl() and lockf() */
+#ifndef F_RDLCK
+#define F_RDLCK 0
+#define F_WRLCK 1
+#define F_UNLCK 2
+#endif
+
+/* for old implementation of bsd flock () */
+#ifndef F_EXLCK
+#define F_EXLCK 4 /* or 3 */
+#define F_SHLCK 8 /* or 4 */
+#endif
+
+/* for leases */
+#ifndef F_INPROGRESS
+#define F_INPROGRESS 16
+#endif
+
+/* operations for bsd flock(), also used by the kernel implementation */
+#define LOCK_SH 1 /* shared lock */
+#define LOCK_EX 2 /* exclusive lock */
+#define LOCK_NB 4 /* or'd with one of the above to prevent
+ blocking */
+#define LOCK_UN 8 /* remove lock */
+
+#define LOCK_MAND 32 /* This is a mandatory flock ... */
+#define LOCK_READ 64 /* which allows concurrent read operations */
+#define LOCK_WRITE 128 /* which allows concurrent write operations */
+#define LOCK_RW 192 /* which allows concurrent read & write ops */
+
+#define F_LINUX_SPECIFIC_BASE 1024
+
+#ifndef HAVE_ARCH_STRUCT_FLOCK
+#ifndef __ARCH_FLOCK_PAD
+#define __ARCH_FLOCK_PAD
+#endif
+
+struct flock {
+ short l_type;
+ short l_whence;
+ off_t l_start;
+ off_t l_len;
+ pid_t l_pid;
+ __ARCH_FLOCK_PAD
+};
+#endif
+
+#ifndef CONFIG_64BIT
+
+#ifndef F_GETLK64
+#define F_GETLK64 12 /* using 'struct flock64' */
+#define F_SETLK64 13
+#define F_SETLKW64 14
+#endif
+
+#ifndef HAVE_ARCH_STRUCT_FLOCK64
+#ifndef __ARCH_FLOCK64_PAD
+#define __ARCH_FLOCK64_PAD
+#endif
+
+struct flock64 {
+ short l_type;
+ short l_whence;
+ loff_t l_start;
+ loff_t l_len;
+ pid_t l_pid;
+ __ARCH_FLOCK64_PAD
+};
+#endif
+#endif /* !CONFIG_64BIT */
+
+#endif /* _ASM_GENERIC_FCNTL_H */
diff --git a/sysroot/usr/include/asm-generic/ioctl.h b/sysroot/usr/include/asm-generic/ioctl.h
new file mode 100644
index 0000000..cd02729
--- /dev/null
+++ b/sysroot/usr/include/asm-generic/ioctl.h
@@ -0,0 +1,80 @@
+#ifndef _ASM_GENERIC_IOCTL_H
+#define _ASM_GENERIC_IOCTL_H
+
+/* ioctl command encoding: 32 bits total, command in lower 16 bits,
+ * size of the parameter structure in the lower 14 bits of the
+ * upper 16 bits.
+ * Encoding the size of the parameter structure in the ioctl request
+ * is useful for catching programs compiled with old versions
+ * and to avoid overwriting user space outside the user buffer area.
+ * The highest 2 bits are reserved for indicating the ``access mode''.
+ * NOTE: This limits the max parameter size to 16kB -1 !
+ */
+
+/*
+ * The following is for compatibility across the various Linux
+ * platforms. The generic ioctl numbering scheme doesn't really enforce
+ * a type field. De facto, however, the top 8 bits of the lower 16
+ * bits are indeed used as a type field, so we might just as well make
+ * this explicit here. Please be sure to use the decoding macros
+ * below from now on.
+ */
+#define _IOC_NRBITS 8
+#define _IOC_TYPEBITS 8
+#define _IOC_SIZEBITS 14
+#define _IOC_DIRBITS 2
+
+#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
+#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
+#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
+#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
+
+#define _IOC_NRSHIFT 0
+#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
+#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
+#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
+
+/*
+ * Direction bits.
+ */
+#define _IOC_NONE 0U
+#define _IOC_WRITE 1U
+#define _IOC_READ 2U
+
+#define _IOC(dir,type,nr,size) \
+ (((dir) << _IOC_DIRSHIFT) | \
+ ((type) << _IOC_TYPESHIFT) | \
+ ((nr) << _IOC_NRSHIFT) | \
+ ((size) << _IOC_SIZESHIFT))
+
+/* provoke compile error for invalid uses of size argument */
+extern unsigned int __invalid_size_argument_for_IOC;
+#define _IOC_TYPECHECK(t) \
+ ((sizeof(t) == sizeof(t[1]) && \
+ sizeof(t) < (1 << _IOC_SIZEBITS)) ? \
+ sizeof(t) : __invalid_size_argument_for_IOC)
+
+/* used to create numbers */
+#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
+#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),(_IOC_TYPECHECK(size)))
+#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
+#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
+#define _IOR_BAD(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
+#define _IOW_BAD(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
+#define _IOWR_BAD(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
+
+/* used to decode ioctl numbers.. */
+#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
+#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
+#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
+#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
+
+/* ...and for the drivers/sound files... */
+
+#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
+#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
+#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
+#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
+#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
+
+#endif /* _ASM_GENERIC_IOCTL_H */
diff --git a/sysroot/usr/include/asm-generic/mman.h b/sysroot/usr/include/asm-generic/mman.h
new file mode 100644
index 0000000..5e3dde2
--- /dev/null
+++ b/sysroot/usr/include/asm-generic/mman.h
@@ -0,0 +1,41 @@
+#ifndef _ASM_GENERIC_MMAN_H
+#define _ASM_GENERIC_MMAN_H
+
+/*
+ Author: Michael S. Tsirkin <mst@mellanox.co.il>, Mellanox Technologies Ltd.
+ Based on: asm-xxx/mman.h
+*/
+
+#define PROT_READ 0x1 /* page can be read */
+#define PROT_WRITE 0x2 /* page can be written */
+#define PROT_EXEC 0x4 /* page can be executed */
+#define PROT_SEM 0x8 /* page may be used for atomic ops */
+#define PROT_NONE 0x0 /* page can not be accessed */
+#define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */
+#define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */
+
+#define MAP_SHARED 0x01 /* Share changes */
+#define MAP_PRIVATE 0x02 /* Changes are private */
+#define MAP_TYPE 0x0f /* Mask for type of mapping */
+#define MAP_FIXED 0x10 /* Interpret addr exactly */
+#define MAP_ANONYMOUS 0x20 /* don't use a file */
+
+#define MS_ASYNC 1 /* sync memory asynchronously */
+#define MS_INVALIDATE 2 /* invalidate the caches */
+#define MS_SYNC 4 /* synchronous memory sync */
+
+#define MADV_NORMAL 0 /* no further special treatment */
+#define MADV_RANDOM 1 /* expect random page references */
+#define MADV_SEQUENTIAL 2 /* expect sequential page references */
+#define MADV_WILLNEED 3 /* will need these pages */
+#define MADV_DONTNEED 4 /* don't need these pages */
+
+/* common parameters: try to keep these consistent across architectures */
+#define MADV_REMOVE 9 /* remove these pages & resources */
+#define MADV_DONTFORK 10 /* don't inherit across fork */
+#define MADV_DOFORK 11 /* do inherit across fork */
+
+/* compatibility flags */
+#define MAP_FILE 0
+
+#endif
diff --git a/sysroot/usr/include/asm-generic/poll.h b/sysroot/usr/include/asm-generic/poll.h
new file mode 100644
index 0000000..44bce83
--- /dev/null
+++ b/sysroot/usr/include/asm-generic/poll.h
@@ -0,0 +1,37 @@
+#ifndef __ASM_GENERIC_POLL_H
+#define __ASM_GENERIC_POLL_H
+
+/* These are specified by iBCS2 */
+#define POLLIN 0x0001
+#define POLLPRI 0x0002
+#define POLLOUT 0x0004
+#define POLLERR 0x0008
+#define POLLHUP 0x0010
+#define POLLNVAL 0x0020
+
+/* The rest seem to be more-or-less nonstandard. Check them! */
+#define POLLRDNORM 0x0040
+#define POLLRDBAND 0x0080
+#ifndef POLLWRNORM
+#define POLLWRNORM 0x0100
+#endif
+#ifndef POLLWRBAND
+#define POLLWRBAND 0x0200
+#endif
+#ifndef POLLMSG
+#define POLLMSG 0x0400
+#endif
+#ifndef POLLREMOVE
+#define POLLREMOVE 0x1000
+#endif
+#ifndef POLLRDHUP
+#define POLLRDHUP 0x2000
+#endif
+
+struct pollfd {
+ int fd;
+ short events;
+ short revents;
+};
+
+#endif /* __ASM_GENERIC_POLL_H */
diff --git a/sysroot/usr/include/asm-generic/resource.h b/sysroot/usr/include/asm-generic/resource.h
new file mode 100644
index 0000000..c2695d9
--- /dev/null
+++ b/sysroot/usr/include/asm-generic/resource.h
@@ -0,0 +1,68 @@
+#ifndef _ASM_GENERIC_RESOURCE_H
+#define _ASM_GENERIC_RESOURCE_H
+
+/*
+ * Resource limit IDs
+ *
+ * ( Compatibility detail: there are architectures that have
+ * a different rlimit ID order in the 5-9 range and want
+ * to keep that order for binary compatibility. The reasons
+ * are historic and all new rlimits are identical across all
+ * arches. If an arch has such special order for some rlimits
+ * then it defines them prior including asm-generic/resource.h. )
+ */
+
+#define RLIMIT_CPU 0 /* CPU time in sec */
+#define RLIMIT_FSIZE 1 /* Maximum filesize */
+#define RLIMIT_DATA 2 /* max data size */
+#define RLIMIT_STACK 3 /* max stack size */
+#define RLIMIT_CORE 4 /* max core file size */
+
+#ifndef RLIMIT_RSS
+# define RLIMIT_RSS 5 /* max resident set size */
+#endif
+
+#ifndef RLIMIT_NPROC
+# define RLIMIT_NPROC 6 /* max number of processes */
+#endif
+
+#ifndef RLIMIT_NOFILE
+# define RLIMIT_NOFILE 7 /* max number of open files */
+#endif
+
+#ifndef RLIMIT_MEMLOCK
+# define RLIMIT_MEMLOCK 8 /* max locked-in-memory address space */
+#endif
+
+#ifndef RLIMIT_AS
+# define RLIMIT_AS 9 /* address space limit */
+#endif
+
+#define RLIMIT_LOCKS 10 /* maximum file locks held */
+#define RLIMIT_SIGPENDING 11 /* max number of pending signals */
+#define RLIMIT_MSGQUEUE 12 /* maximum bytes in POSIX mqueues */
+#define RLIMIT_NICE 13 /* max nice prio allowed to raise to
+ 0-39 for nice level 19 .. -20 */
+#define RLIMIT_RTPRIO 14 /* maximum realtime priority */
+
+#define RLIM_NLIMITS 15
+
+/*
+ * SuS says limits have to be unsigned.
+ * Which makes a ton more sense anyway.
+ *
+ * Some architectures override this (for compatibility reasons):
+ */
+#ifndef RLIM_INFINITY
+# define RLIM_INFINITY (~0UL)
+#endif
+
+/*
+ * RLIMIT_STACK default maximum - some architectures override it:
+ */
+#ifndef _STK_LIM_MAX
+# define _STK_LIM_MAX RLIM_INFINITY
+#endif
+
+
+#endif
diff --git a/sysroot/usr/include/asm-generic/siginfo.h b/sysroot/usr/include/asm-generic/siginfo.h
new file mode 100644
index 0000000..acb5137
--- /dev/null
+++ b/sysroot/usr/include/asm-generic/siginfo.h
@@ -0,0 +1,258 @@
+#ifndef _ASM_GENERIC_SIGINFO_H
+#define _ASM_GENERIC_SIGINFO_H
+
+#include <linux/types.h>
+
+typedef union sigval {
+ int sival_int;
+ void *sival_ptr;
+} sigval_t;
+
+/*
+ * This is the size (including padding) of the part of the
+ * struct siginfo that is before the union.
+ */
+#ifndef __ARCH_SI_PREAMBLE_SIZE
+#define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int))
+#endif
+
+#define SI_MAX_SIZE 128
+#ifndef SI_PAD_SIZE
+#define SI_PAD_SIZE ((SI_MAX_SIZE - __ARCH_SI_PREAMBLE_SIZE) / sizeof(int))
+#endif
+
+#ifndef __ARCH_SI_UID_T
+#define __ARCH_SI_UID_T uid_t
+#endif
+
+/*
+ * The default "si_band" type is "long", as specified by POSIX.
+ * However, some architectures want to override this to "int"
+ * for historical compatibility reasons, so we allow that.
+ */
+#ifndef __ARCH_SI_BAND_T
+#define __ARCH_SI_BAND_T long
+#endif
+
+#ifndef HAVE_ARCH_SIGINFO_T
+
+typedef struct siginfo {
+ int si_signo;
+ int si_errno;
+ int si_code;
+
+ union {
+ int _pad[SI_PAD_SIZE];
+
+ /* kill() */
+ struct {
+ pid_t _pid; /* sender's pid */
+ __ARCH_SI_UID_T _uid; /* sender's uid */
+ } _kill;
+
+ /* POSIX.1b timers */
+ struct {
+ timer_t _tid; /* timer id */
+ int _overrun; /* overrun count */
+ char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)];
+ sigval_t _sigval; /* same as below */
+ int _sys_private; /* not to be passed to user */
+ } _timer;
+
+ /* POSIX.1b signals */
+ struct {
+ pid_t _pid; /* sender's pid */
+ __ARCH_SI_UID_T _uid; /* sender's uid */
+ sigval_t _sigval;
+ } _rt;
+
+ /* SIGCHLD */
+ struct {
+ pid_t _pid; /* which child */
+ __ARCH_SI_UID_T _uid; /* sender's uid */
+ int _status; /* exit code */
+ clock_t _utime;
+ clock_t _stime;
+ } _sigchld;
+
+ /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
+ struct {
+ void *_addr; /* faulting insn/memory ref. */
+#ifdef __ARCH_SI_TRAPNO
+ int _trapno; /* TRAP # which caused the signal */
+#endif
+ } _sigfault;
+
+ /* SIGPOLL */
+ struct {
+ __ARCH_SI_BAND_T _band; /* POLL_IN, POLL_OUT, POLL_MSG */
+ int _fd;
+ } _sigpoll;
+ } _sifields;
+} siginfo_t;
+
+#endif
+
+/*
+ * How these fields are to be accessed.
+ */
+#define si_pid _sifields._kill._pid
+#define si_uid _sifields._kill._uid
+#define si_tid _sifields._timer._tid
+#define si_overrun _sifields._timer._overrun
+#define si_sys_private _sifields._timer._sys_private
+#define si_status _sifields._sigchld._status
+#define si_utime _sifields._sigchld._utime
+#define si_stime _sifields._sigchld._stime
+#define si_value _sifields._rt._sigval
+#define si_int _sifields._rt._sigval.sival_int
+#define si_ptr _sifields._rt._sigval.sival_ptr
+#define si_addr _sifields._sigfault._addr
+#ifdef __ARCH_SI_TRAPNO
+#define si_trapno _sifields._sigfault._trapno
+#endif
+#define si_band _sifields._sigpoll._band
+#define si_fd _sifields._sigpoll._fd
+
+#define __SI_KILL 0
+#define __SI_TIMER 0
+#define __SI_POLL 0
+#define __SI_FAULT 0
+#define __SI_CHLD 0
+#define __SI_RT 0
+#define __SI_MESGQ 0
+#define __SI_CODE(T,N) (N)
+
+/*
+ * si_code values
+ * Digital reserves positive values for kernel-generated signals.
+ */
+#define SI_USER 0 /* sent by kill, sigsend, raise */
+#define SI_KERNEL 0x80 /* sent by the kernel from somewhere */
+#define SI_QUEUE -1 /* sent by sigqueue */
+#define SI_TIMER __SI_CODE(__SI_TIMER,-2) /* sent by timer expiration */
+#define SI_MESGQ __SI_CODE(__SI_MESGQ,-3) /* sent by real time mesq state change */
+#define SI_ASYNCIO -4 /* sent by AIO completion */
+#define SI_SIGIO -5 /* sent by queued SIGIO */
+#define SI_TKILL -6 /* sent by tkill system call */
+#define SI_DETHREAD -7 /* sent by execve() killing subsidiary threads */
+
+#define SI_FROMUSER(siptr) ((siptr)->si_code <= 0)
+#define SI_FROMKERNEL(siptr) ((siptr)->si_code > 0)
+
+/*
+ * SIGILL si_codes
+ */
+#define ILL_ILLOPC (__SI_FAULT|1) /* illegal opcode */
+#define ILL_ILLOPN (__SI_FAULT|2) /* illegal operand */
+#define ILL_ILLADR (__SI_FAULT|3) /* illegal addressing mode */
+#define ILL_ILLTRP (__SI_FAULT|4) /* illegal trap */
+#define ILL_PRVOPC (__SI_FAULT|5) /* privileged opcode */
+#define ILL_PRVREG (__SI_FAULT|6) /* privileged register */
+#define ILL_COPROC (__SI_FAULT|7) /* coprocessor error */
+#define ILL_BADSTK (__SI_FAULT|8) /* internal stack error */
+#define NSIGILL 8
+
+/*
+ * SIGFPE si_codes
+ */
+#define FPE_INTDIV (__SI_FAULT|1) /* integer divide by zero */
+#define FPE_INTOVF (__SI_FAULT|2) /* integer overflow */
+#define FPE_FLTDIV (__SI_FAULT|3) /* floating point divide by zero */
+#define FPE_FLTOVF (__SI_FAULT|4) /* floating point overflow */
+#define FPE_FLTUND (__SI_FAULT|5) /* floating point underflow */
+#define FPE_FLTRES (__SI_FAULT|6) /* floating point inexact result */
+#define FPE_FLTINV (__SI_FAULT|7) /* floating point invalid operation */
+#define FPE_FLTSUB (__SI_FAULT|8) /* subscript out of range */
+#define NSIGFPE 8
+
+/*
+ * SIGSEGV si_codes
+ */
+#define SEGV_MAPERR (__SI_FAULT|1) /* address not mapped to object */
+#define SEGV_ACCERR (__SI_FAULT|2) /* invalid permissions for mapped object */
+#define NSIGSEGV 2
+
+/*
+ * SIGBUS si_codes
+ */
+#define BUS_ADRALN (__SI_FAULT|1) /* invalid address alignment */
+#define BUS_ADRERR (__SI_FAULT|2) /* non-existant physical address */
+#define BUS_OBJERR (__SI_FAULT|3) /* object specific hardware error */
+#define NSIGBUS 3
+
+/*
+ * SIGTRAP si_codes
+ */
+#define TRAP_BRKPT (__SI_FAULT|1) /* process breakpoint */
+#define TRAP_TRACE (__SI_FAULT|2) /* process trace trap */
+#define NSIGTRAP 2
+
+/*
+ * SIGCHLD si_codes
+ */
+#define CLD_EXITED (__SI_CHLD|1) /* child has exited */
+#define CLD_KILLED (__SI_CHLD|2) /* child was killed */
+#define CLD_DUMPED (__SI_CHLD|3) /* child terminated abnormally */
+#define CLD_TRAPPED (__SI_CHLD|4) /* traced child has trapped */
+#define CLD_STOPPED (__SI_CHLD|5) /* child has stopped */
+#define CLD_CONTINUED (__SI_CHLD|6) /* stopped child has continued */
+#define NSIGCHLD 6
+
+/*
+ * SIGPOLL si_codes
+ */
+#define POLL_IN (__SI_POLL|1) /* data input available */
+#define POLL_OUT (__SI_POLL|2) /* output buffers available */
+#define POLL_MSG (__SI_POLL|3) /* input message available */
+#define POLL_ERR (__SI_POLL|4) /* i/o error */
+#define POLL_PRI (__SI_POLL|5) /* high priority input available */
+#define POLL_HUP (__SI_POLL|6) /* device disconnected */
+#define NSIGPOLL 6
+
+/*
+ * sigevent definitions
+ *
+ * It seems likely that SIGEV_THREAD will have to be handled from
+ * userspace, libpthread transmuting it to SIGEV_SIGNAL, which the
+ * thread manager then catches and does the appropriate nonsense.
+ * However, everything is written out here so as to not get lost.
+ */
+#define SIGEV_SIGNAL 0 /* notify via signal */
+#define SIGEV_NONE 1 /* other notification: meaningless */
+#define SIGEV_THREAD 2 /* deliver via thread creation */
+#define SIGEV_THREAD_ID 4 /* deliver to thread */
+
+/*
+ * This works because the alignment is ok on all current architectures
+ * but we leave open this being overridden in the future
+ */
+#ifndef __ARCH_SIGEV_PREAMBLE_SIZE
+#define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(int) * 2 + sizeof(sigval_t))
+#endif
+
+#define SIGEV_MAX_SIZE 64
+#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE - __ARCH_SIGEV_PREAMBLE_SIZE) \
+ / sizeof(int))
+
+typedef struct sigevent {
+ sigval_t sigev_value;
+ int sigev_signo;
+ int sigev_notify;
+ union {
+ int _pad[SIGEV_PAD_SIZE];
+ int _tid;
+
+ struct {
+ void (*_function)(sigval_t);
+ void *_attribute; /* really pthread_attr_t */
+ } _sigev_thread;
+ } _sigev_un;
+} sigevent_t;
+
+#define sigev_notify_function _sigev_un._sigev_thread._function
+#define sigev_notify_attributes _sigev_un._sigev_thread._attribute
+#define sigev_notify_thread_id _sigev_un._tid
+
+
+#endif
diff --git a/sysroot/usr/include/asm-generic/signal.h b/sysroot/usr/include/asm-generic/signal.h
new file mode 100644
index 0000000..bcd063a
--- /dev/null
+++ b/sysroot/usr/include/asm-generic/signal.h
@@ -0,0 +1,27 @@
+#ifndef __ASM_GENERIC_SIGNAL_H
+#define __ASM_GENERIC_SIGNAL_H
+
+
+#ifndef SIG_BLOCK
+#define SIG_BLOCK 0 /* for blocking signals */
+#endif
+#ifndef SIG_UNBLOCK
+#define SIG_UNBLOCK 1 /* for unblocking signals */
+#endif
+#ifndef SIG_SETMASK
+#define SIG_SETMASK 2 /* for setting the signal mask */
+#endif
+
+#ifndef __ASSEMBLY__
+typedef void __signalfn_t(int);
+typedef __signalfn_t *__sighandler_t;
+
+typedef void __restorefn_t(void);
+typedef __restorefn_t *__sigrestore_t;
+
+#define SIG_DFL ( (__sighandler_t)0) /* default signal handling */
+#define SIG_IGN ( (__sighandler_t)1) /* ignore signal */
+#define SIG_ERR ( (__sighandler_t)-1) /* error return from signal */
+#endif
+
+#endif /* __ASM_GENERIC_SIGNAL_H */
diff --git a/sysroot/usr/include/asm-generic/statfs.h b/sysroot/usr/include/asm-generic/statfs.h
new file mode 100644
index 0000000..1d01043
--- /dev/null
+++ b/sysroot/usr/include/asm-generic/statfs.h
@@ -0,0 +1,51 @@
+#ifndef _GENERIC_STATFS_H
+#define _GENERIC_STATFS_H
+
+#ifndef __KERNEL_STRICT_NAMES
+# include <linux/types.h>
+typedef __kernel_fsid_t fsid_t;
+#endif
+
+struct statfs {
+ __u32 f_type;
+ __u32 f_bsize;
+ __u32 f_blocks;
+ __u32 f_bfree;
+ __u32 f_bavail;
+ __u32 f_files;
+ __u32 f_ffree;
+ __kernel_fsid_t f_fsid;
+ __u32 f_namelen;
+ __u32 f_frsize;
+ __u32 f_spare[5];
+};
+
+struct statfs64 {
+ __u32 f_type;
+ __u32 f_bsize;
+ __u64 f_blocks;
+ __u64 f_bfree;
+ __u64 f_bavail;
+ __u64 f_files;
+ __u64 f_ffree;
+ __kernel_fsid_t f_fsid;
+ __u32 f_namelen;
+ __u32 f_frsize;
+ __u32 f_spare[5];
+};
+
+struct compat_statfs64 {
+ __u32 f_type;
+ __u32 f_bsize;
+ __u64 f_blocks;
+ __u64 f_bfree;
+ __u64 f_bavail;
+ __u64 f_files;
+ __u64 f_ffree;
+ __kernel_fsid_t f_fsid;
+ __u32 f_namelen;
+ __u32 f_frsize;
+ __u32 f_spare[5];
+};
+
+#endif
diff --git a/sysroot/usr/include/asm/a.out.h b/sysroot/usr/include/asm/a.out.h
new file mode 100644
index 0000000..37f75af
--- /dev/null
+++ b/sysroot/usr/include/asm/a.out.h
@@ -0,0 +1,21 @@
+#ifndef _ASM_X86_A_OUT_H
+#define _ASM_X86_A_OUT_H
+
+struct exec
+{
+ unsigned int a_info; /* Use macros N_MAGIC, etc for access */
+ unsigned a_text; /* length of text, in bytes */
+ unsigned a_data; /* length of data, in bytes */
+ unsigned a_bss; /* length of uninitialized data area for file, in bytes */
+ unsigned a_syms; /* length of symbol table data in file, in bytes */
+ unsigned a_entry; /* start address */
+ unsigned a_trsize; /* length of relocation info for text, in bytes */
+ unsigned a_drsize; /* length of relocation info for data, in bytes */
+};
+
+#define N_TRSIZE(a) ((a).a_trsize)
+#define N_DRSIZE(a) ((a).a_drsize)
+#define N_SYMSIZE(a) ((a).a_syms)
+
+
+#endif /* _ASM_X86_A_OUT_H */
diff --git a/sysroot/usr/include/asm/auxvec.h b/sysroot/usr/include/asm/auxvec.h
new file mode 100644
index 0000000..87f5e6d
--- /dev/null
+++ b/sysroot/usr/include/asm/auxvec.h
@@ -0,0 +1,12 @@
+#ifndef _ASM_X86_AUXVEC_H
+#define _ASM_X86_AUXVEC_H
+/*
+ * Architecture-neutral AT_ values in 0-17, leave some room
+ * for more of them, start the x86-specific ones at 32.
+ */
+#ifdef __i386__
+#define AT_SYSINFO 32
+#endif
+#define AT_SYSINFO_EHDR 33
+
+#endif
diff --git a/sysroot/usr/include/asm/boot.h b/sysroot/usr/include/asm/boot.h
new file mode 100644
index 0000000..ed8affb
--- /dev/null
+++ b/sysroot/usr/include/asm/boot.h
@@ -0,0 +1,20 @@
+#ifndef _ASM_BOOT_H
+#define _ASM_BOOT_H
+
+/* Don't touch these, unless you really know what you're doing. */
+#define DEF_INITSEG 0x9000
+#define DEF_SYSSEG 0x1000
+#define DEF_SETUPSEG 0x9020
+#define DEF_SYSSIZE 0x7F00
+
+/* Internal svga startup constants */
+#define NORMAL_VGA 0xffff /* 80x25 mode */
+#define EXTENDED_VGA 0xfffe /* 80x50 mode */
+#define ASK_VGA 0xfffd /* ask for it at bootup */
+
+/* Physical address where kernel should be loaded. */
+#define LOAD_PHYSICAL_ADDR ((CONFIG_PHYSICAL_START \
+ + (CONFIG_PHYSICAL_ALIGN - 1)) \
+ & ~(CONFIG_PHYSICAL_ALIGN - 1))
+
+#endif /* _ASM_BOOT_H */
diff --git a/sysroot/usr/include/asm/bootparam.h b/sysroot/usr/include/asm/bootparam.h
new file mode 100644
index 0000000..19f3ddf
--- /dev/null
+++ b/sysroot/usr/include/asm/bootparam.h
@@ -0,0 +1,94 @@
+#ifndef _ASM_BOOTPARAM_H
+#define _ASM_BOOTPARAM_H
+
+#include <linux/types.h>
+#include <linux/screen_info.h>
+#include <linux/apm_bios.h>
+#include <linux/edd.h>
+#include <asm/e820.h>
+#include <asm/ist.h>
+#include <video/edid.h>
+
+struct setup_header {
+ __u8 setup_sects;
+ __u16 root_flags;
+ __u32 syssize;
+ __u16 ram_size;
+#define RAMDISK_IMAGE_START_MASK 0x07FF
+#define RAMDISK_PROMPT_FLAG 0x8000
+#define RAMDISK_LOAD_FLAG 0x4000
+ __u16 vid_mode;
+ __u16 root_dev;
+ __u16 boot_flag;
+ __u16 jump;
+ __u32 header;
+ __u16 version;
+ __u32 realmode_swtch;
+ __u16 start_sys;
+ __u16 kernel_version;
+ __u8 type_of_loader;
+ __u8 loadflags;
+#define LOADED_HIGH (1<<0)
+#define KEEP_SEGMENTS (1<<6)
+#define CAN_USE_HEAP (1<<7)
+ __u16 setup_move_size;
+ __u32 code32_start;
+ __u32 ramdisk_image;
+ __u32 ramdisk_size;
+ __u32 bootsect_kludge;
+ __u16 heap_end_ptr;
+ __u16 _pad1;
+ __u32 cmd_line_ptr;
+ __u32 initrd_addr_max;
+ __u32 kernel_alignment;
+ __u8 relocatable_kernel;
+ __u8 _pad2[3];
+ __u32 cmdline_size;
+ __u32 hardware_subarch;
+ __u64 hardware_subarch_data;
+} __attribute__((packed));
+
+struct sys_desc_table {
+ __u16 length;
+ __u8 table[14];
+};
+
+struct efi_info {
+ __u32 _pad1;
+ __u32 efi_systab;
+ __u32 efi_memdesc_size;
+ __u32 efi_memdesc_version;
+ __u32 efi_memmap;
+ __u32 efi_memmap_size;
+ __u32 _pad2[2];
+};
+
+/* The so-called "zeropage" */
+struct boot_params {
+ struct screen_info screen_info; /* 0x000 */
+ struct apm_bios_info apm_bios_info; /* 0x040 */
+ __u8 _pad2[12]; /* 0x054 */
+ struct ist_info ist_info; /* 0x060 */
+ __u8 _pad3[16]; /* 0x070 */
+ __u8 hd0_info[16]; /* obsolete! */ /* 0x080 */
+ __u8 hd1_info[16]; /* obsolete! */ /* 0x090 */
+ struct sys_desc_table sys_desc_table; /* 0x0a0 */
+ __u8 _pad4[144]; /* 0x0b0 */
+ struct edid_info edid_info; /* 0x140 */
+ struct efi_info efi_info; /* 0x1c0 */
+ __u32 alt_mem_k; /* 0x1e0 */
+ __u32 scratch; /* Scratch field! */ /* 0x1e4 */
+ __u8 e820_entries; /* 0x1e8 */
+ __u8 eddbuf_entries; /* 0x1e9 */
+ __u8 edd_mbr_sig_buf_entries; /* 0x1ea */
+ __u8 _pad6[6]; /* 0x1eb */
+ struct setup_header hdr; /* setup header */ /* 0x1f1 */
+ __u8 _pad7[0x290-0x1f1-sizeof(struct setup_header)];
+ __u32 edd_mbr_sig_buffer[EDD_MBR_SIG_MAX]; /* 0x290 */
+ struct e820entry e820_map[E820MAX]; /* 0x2d0 */
+ __u8 _pad8[48]; /* 0xcd0 */
+ struct edd_info eddbuf[EDDMAXNR]; /* 0xd00 */
+ __u8 _pad9[276]; /* 0xeec */
+} __attribute__((packed));
+
+#endif /* _ASM_BOOTPARAM_H */
diff --git a/sysroot/usr/include/asm/byteorder.h b/sysroot/usr/include/asm/byteorder.h
new file mode 100644
index 0000000..eda492b
--- /dev/null
+++ b/sysroot/usr/include/asm/byteorder.h
@@ -0,0 +1,71 @@
+#ifndef _ASM_X86_BYTEORDER_H
+#define _ASM_X86_BYTEORDER_H
+
+#include <asm/types.h>
+
+#ifdef __GNUC__
+
+#ifdef __i386__
+
+static __inline__ __u32 ___arch__swab32(__u32 x)
+{
+#ifdef CONFIG_X86_BSWAP
+ __asm__("bswap %0" : "=r" (x) : "0" (x));
+#else
+ __asm__("xchgb %b0,%h0\n\t" /* swap lower bytes */
+ "rorl $16,%0\n\t" /* swap words */
+ "xchgb %b0,%h0" /* swap higher bytes */
+ :"=q" (x)
+ : "0" (x));
+#endif
+ return x;
+}
+
+static __inline__ __u64 ___arch__swab64(__u64 val)
+{
+ union {
+ struct { __u32 a,b; } s;
+ __u64 u;
+ } v;
+ v.u = val;
+#ifdef CONFIG_X86_BSWAP
+ __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1"
+ : "=r" (v.s.a), "=r" (v.s.b)
+ : "0" (v.s.a), "1" (v.s.b));
+#else
+ v.s.a = ___arch__swab32(v.s.a);
+ v.s.b = ___arch__swab32(v.s.b);
+ __asm__("xchgl %0,%1" : "=r" (v.s.a), "=r" (v.s.b) : "0" (v.s.a), "1" (v.s.b));
+#endif
+ return v.u;
+}
+
+#else /* __i386__ */
+
+static __inline__ __u64 ___arch__swab64(__u64 x)
+{
+ __asm__("bswapq %0" : "=r" (x) : "0" (x));
+ return x;
+}
+
+static __inline__ __u32 ___arch__swab32(__u32 x)
+{
+ __asm__("bswapl %0" : "=r" (x) : "0" (x));
+ return x;
+}
+
+#endif
+
+/* Do not define swab16. Gcc is smart enough to recognize "C" version and
+ convert it into rotation or exhange. */
+
+#define __arch__swab64(x) ___arch__swab64(x)
+#define __arch__swab32(x) ___arch__swab32(x)
+
+#define __BYTEORDER_HAS_U64__
+
+#endif /* __GNUC__ */
+
+#include <linux/byteorder/little_endian.h>
+
+#endif /* _ASM_X86_BYTEORDER_H */
diff --git a/sysroot/usr/include/asm/debugreg.h b/sysroot/usr/include/asm/debugreg.h
new file mode 100644
index 0000000..c6344d5
--- /dev/null
+++ b/sysroot/usr/include/asm/debugreg.h
@@ -0,0 +1,70 @@
+#ifndef _ASM_X86_DEBUGREG_H
+#define _ASM_X86_DEBUGREG_H
+
+
+/* Indicate the register numbers for a number of the specific
+ debug registers. Registers 0-3 contain the addresses we wish to trap on */
+#define DR_FIRSTADDR 0 /* u_debugreg[DR_FIRSTADDR] */
+#define DR_LASTADDR 3 /* u_debugreg[DR_LASTADDR] */
+
+#define DR_STATUS 6 /* u_debugreg[DR_STATUS] */
+#define DR_CONTROL 7 /* u_debugreg[DR_CONTROL] */
+
+/* Define a few things for the status register. We can use this to determine
+ which debugging register was responsible for the trap. The other bits
+ are either reserved or not of interest to us. */
+
+#define DR_TRAP0 (0x1) /* db0 */
+#define DR_TRAP1 (0x2) /* db1 */
+#define DR_TRAP2 (0x4) /* db2 */
+#define DR_TRAP3 (0x8) /* db3 */
+
+#define DR_STEP (0x4000) /* single-step */
+#define DR_SWITCH (0x8000) /* task switch */
+
+/* Now define a bunch of things for manipulating the control register.
+ The top two bytes of the control register consist of 4 fields of 4
+ bits - each field corresponds to one of the four debug registers,
+ and indicates what types of access we trap on, and how large the data
+ field is that we are looking at */
+
+#define DR_CONTROL_SHIFT 16 /* Skip this many bits in ctl register */
+#define DR_CONTROL_SIZE 4 /* 4 control bits per register */
+
+#define DR_RW_EXECUTE (0x0) /* Settings for the access types to trap on */
+#define DR_RW_WRITE (0x1)
+#define DR_RW_READ (0x3)
+
+#define DR_LEN_1 (0x0) /* Settings for data length to trap on */
+#define DR_LEN_2 (0x4)
+#define DR_LEN_4 (0xC)
+#define DR_LEN_8 (0x8)
+
+/* The low byte to the control register determine which registers are
+ enabled. There are 4 fields of two bits. One bit is "local", meaning
+ that the processor will reset the bit after a task switch and the other
+ is global meaning that we have to explicitly reset the bit. With linux,
+ you can use either one, since we explicitly zero the register when we enter
+ kernel mode. */
+
+#define DR_LOCAL_ENABLE_SHIFT 0 /* Extra shift to the local enable bit */
+#define DR_GLOBAL_ENABLE_SHIFT 1 /* Extra shift to the global enable bit */
+#define DR_ENABLE_SIZE 2 /* 2 enable bits per register */
+
+#define DR_LOCAL_ENABLE_MASK (0x55) /* Set local bits for all 4 regs */
+#define DR_GLOBAL_ENABLE_MASK (0xAA) /* Set global bits for all 4 regs */
+
+/* The second byte to the control register has a few special things.
+ We can slow the instruction pipeline for instructions coming via the
+ gdt or the ldt if we want to. I am not sure why this is an advantage */
+
+#ifdef __i386__
+#define DR_CONTROL_RESERVED (0xFC00) /* Reserved by Intel */
+#else
+#define DR_CONTROL_RESERVED (0xFFFFFFFF0000FC00UL) /* Reserved */
+#endif
+
+#define DR_LOCAL_SLOWDOWN (0x100) /* Local slow the pipeline */
+#define DR_GLOBAL_SLOWDOWN (0x200) /* Global slow the pipeline */
+
+#endif
diff --git a/sysroot/usr/include/asm/e820.h b/sysroot/usr/include/asm/e820.h
new file mode 100644
index 0000000..0a8a430
--- /dev/null
+++ b/sysroot/usr/include/asm/e820.h
@@ -0,0 +1,29 @@
+#ifndef __ASM_E820_H
+#define __ASM_E820_H
+#define E820MAP 0x2d0 /* our map */
+#define E820MAX 128 /* number of entries in E820MAP */
+#define E820NR 0x1e8 /* # entries in E820MAP */
+
+#define E820_RAM 1
+#define E820_RESERVED 2
+#define E820_ACPI 3
+#define E820_NVS 4
+
+#ifndef __ASSEMBLY__
+struct e820entry {
+ __u64 addr; /* start of memory segment */
+ __u64 size; /* size of memory segment */
+ __u32 type; /* type of memory segment */
+} __attribute__((packed));
+
+struct e820map {
+ __u32 nr_map;
+ struct e820entry map[E820MAX];
+};
+#endif /* __ASSEMBLY__ */
+
+#define BIOS_BEGIN 0x000a0000
+#define BIOS_END 0x00100000
+
+
+#endif /* __ASM_E820_H */
diff --git a/sysroot/usr/include/asm/elf.h b/sysroot/usr/include/asm/elf.h
new file mode 100644
index 0000000..6cc8e6c
--- /dev/null
+++ b/sysroot/usr/include/asm/elf.h
@@ -0,0 +1,76 @@
+#ifndef _ASM_X86_ELF_H
+#define _ASM_X86_ELF_H
+
+/*
+ * ELF register definitions..
+ */
+
+#include <asm/ptrace.h>
+#include <asm/user.h>
+#include <asm/auxvec.h>
+
+typedef unsigned long elf_greg_t;
+
+#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t))
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+typedef struct user_i387_struct elf_fpregset_t;
+
+#ifdef __i386__
+
+typedef struct user_fxsr_struct elf_fpxregset_t;
+
+#define R_386_NONE 0
+#define R_386_32 1
+#define R_386_PC32 2
+#define R_386_GOT32 3
+#define R_386_PLT32 4
+#define R_386_COPY 5
+#define R_386_GLOB_DAT 6
+#define R_386_JMP_SLOT 7
+#define R_386_RELATIVE 8
+#define R_386_GOTOFF 9
+#define R_386_GOTPC 10
+#define R_386_NUM 11
+
+/*
+ * These are used to set parameters in the core dumps.
+ */
+#define ELF_CLASS ELFCLASS32
+#define ELF_DATA ELFDATA2LSB
+#define ELF_ARCH EM_386
+
+#else
+
+/* x86-64 relocation types */
+#define R_X86_64_NONE 0 /* No reloc */
+#define R_X86_64_64 1 /* Direct 64 bit */
+#define R_X86_64_PC32 2 /* PC relative 32 bit signed */
+#define R_X86_64_GOT32 3 /* 32 bit GOT entry */
+#define R_X86_64_PLT32 4 /* 32 bit PLT address */
+#define R_X86_64_COPY 5 /* Copy symbol at runtime */
+#define R_X86_64_GLOB_DAT 6 /* Create GOT entry */
+#define R_X86_64_JUMP_SLOT 7 /* Create PLT entry */
+#define R_X86_64_RELATIVE 8 /* Adjust by program base */
+#define R_X86_64_GOTPCREL 9 /* 32 bit signed pc relative
+ offset to GOT */
+#define R_X86_64_32 10 /* Direct 32 bit zero extended */
+#define R_X86_64_32S 11 /* Direct 32 bit sign extended */
+#define R_X86_64_16 12 /* Direct 16 bit zero extended */
+#define R_X86_64_PC16 13 /* 16 bit sign extended pc relative */
+#define R_X86_64_8 14 /* Direct 8 bit sign extended */
+#define R_X86_64_PC8 15 /* 8 bit sign extended pc relative */
+
+#define R_X86_64_NUM 16
+
+/*
+ * These are used to set parameters in the core dumps.
+ */
+#define ELF_CLASS ELFCLASS64
+#define ELF_DATA ELFDATA2LSB
+#define ELF_ARCH EM_X86_64
+
+#endif
+
+
+#endif
diff --git a/sysroot/usr/include/asm/errno.h b/sysroot/usr/include/asm/errno.h
new file mode 100644
index 0000000..4c82b50
--- /dev/null
+++ b/sysroot/usr/include/asm/errno.h
@@ -0,0 +1 @@
+#include <asm-generic/errno.h>
diff --git a/sysroot/usr/include/asm/fcntl.h b/sysroot/usr/include/asm/fcntl.h
new file mode 100644
index 0000000..46ab12d
--- /dev/null
+++ b/sysroot/usr/include/asm/fcntl.h
@@ -0,0 +1 @@
+#include <asm-generic/fcntl.h>
diff --git a/sysroot/usr/include/asm/ioctl.h b/sysroot/usr/include/asm/ioctl.h
new file mode 100644
index 0000000..b279fe0
--- /dev/null
+++ b/sysroot/usr/include/asm/ioctl.h
@@ -0,0 +1 @@
+#include <asm-generic/ioctl.h>
diff --git a/sysroot/usr/include/asm/ioctls.h b/sysroot/usr/include/asm/ioctls.h
new file mode 100644
index 0000000..0ac49b5
--- /dev/null
+++ b/sysroot/usr/include/asm/ioctls.h
@@ -0,0 +1,87 @@
+#ifndef _ASM_X86_IOCTLS_H
+#define _ASM_X86_IOCTLS_H
+
+#include <asm/ioctl.h>
+
+/* 0x54 is just a magic number to make these relatively unique ('T') */
+
+#define TCGETS 0x5401
+#define TCSETS 0x5402 /* Clashes with SNDCTL_TMR_START sound ioctl */
+#define TCSETSW 0x5403
+#define TCSETSF 0x5404
+#define TCGETA 0x5405
+#define TCSETA 0x5406
+#define TCSETAW 0x5407
+#define TCSETAF 0x5408
+#define TCSBRK 0x5409
+#define TCXONC 0x540A
+#define TCFLSH 0x540B
+#define TIOCEXCL 0x540C
+#define TIOCNXCL 0x540D
+#define TIOCSCTTY 0x540E
+#define TIOCGPGRP 0x540F
+#define TIOCSPGRP 0x5410
+#define TIOCOUTQ 0x5411
+#define TIOCSTI 0x5412
+#define TIOCGWINSZ 0x5413
+#define TIOCSWINSZ 0x5414
+#define TIOCMGET 0x5415
+#define TIOCMBIS 0x5416
+#define TIOCMBIC 0x5417
+#define TIOCMSET 0x5418
+#define TIOCGSOFTCAR 0x5419
+#define TIOCSSOFTCAR 0x541A
+#define FIONREAD 0x541B
+#define TIOCINQ FIONREAD
+#define TIOCLINUX 0x541C
+#define TIOCCONS 0x541D
+#define TIOCGSERIAL 0x541E
+#define TIOCSSERIAL 0x541F
+#define TIOCPKT 0x5420
+#define FIONBIO 0x5421
+#define TIOCNOTTY 0x5422
+#define TIOCSETD 0x5423
+#define TIOCGETD 0x5424
+#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */
+/* #define TIOCTTYGSTRUCT 0x5426 - Former debugging-only ioctl */
+#define TIOCSBRK 0x5427 /* BSD compatibility */
+#define TIOCCBRK 0x5428 /* BSD compatibility */
+#define TIOCGSID 0x5429 /* Return the session ID of FD */
+#define TCGETS2 _IOR('T',0x2A, struct termios2)
+#define TCSETS2 _IOW('T',0x2B, struct termios2)
+#define TCSETSW2 _IOW('T',0x2C, struct termios2)
+#define TCSETSF2 _IOW('T',0x2D, struct termios2)
+#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
+#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
+
+#define FIONCLEX 0x5450
+#define FIOCLEX 0x5451
+#define FIOASYNC 0x5452
+#define TIOCSERCONFIG 0x5453
+#define TIOCSERGWILD 0x5454
+#define TIOCSERSWILD 0x5455
+#define TIOCGLCKTRMIOS 0x5456
+#define TIOCSLCKTRMIOS 0x5457
+#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
+#define TIOCSERGETLSR 0x5459 /* Get line status register */
+#define TIOCSERGETMULTI 0x545A /* Get multiport config */
+#define TIOCSERSETMULTI 0x545B /* Set multiport config */
+
+#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */
+#define TIOCGICOUNT 0x545D /* read serial port __inline__ interrupt counts */
+#define TIOCGHAYESESP 0x545E /* Get Hayes ESP configuration */
+#define TIOCSHAYESESP 0x545F /* Set Hayes ESP configuration */
+#define FIOQSIZE 0x5460
+
+/* Used for packet mode */
+#define TIOCPKT_DATA 0
+#define TIOCPKT_FLUSHREAD 1
+#define TIOCPKT_FLUSHWRITE 2
+#define TIOCPKT_STOP 4
+#define TIOCPKT_START 8
+#define TIOCPKT_NOSTOP 16
+#define TIOCPKT_DOSTOP 32
+
+#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
+
+#endif
diff --git a/sysroot/usr/include/asm/ipcbuf.h b/sysroot/usr/include/asm/ipcbuf.h
new file mode 100644
index 0000000..2adf8b3
--- /dev/null
+++ b/sysroot/usr/include/asm/ipcbuf.h
@@ -0,0 +1,29 @@
+#ifndef _ASM_X86_IPCBUF_H
+#define _ASM_X86_IPCBUF_H
+
+/*
+ * The ipc64_perm structure for x86 architecture.
+ * Note extra padding because this structure is passed back and forth
+ * between kernel and user space.
+ *
+ * Pad space is left for:
+ * - 32-bit mode_t and seq
+ * - 2 miscellaneous 32-bit values
+ */
+
+struct ipc64_perm
+{
+ __kernel_key_t key;
+ __kernel_uid32_t uid;
+ __kernel_gid32_t gid;
+ __kernel_uid32_t cuid;
+ __kernel_gid32_t cgid;
+ __kernel_mode_t mode;
+ unsigned short __pad1;
+ unsigned short seq;
+ unsigned short __pad2;
+ unsigned long __unused1;
+ unsigned long __unused2;
+};
+
+#endif /* _ASM_X86_IPCBUF_H */
diff --git a/sysroot/usr/include/asm/ist.h b/sysroot/usr/include/asm/ist.h
new file mode 100644
index 0000000..2c26529
--- /dev/null
+++ b/sysroot/usr/include/asm/ist.h
@@ -0,0 +1,29 @@
+#ifndef _ASM_IST_H
+#define _ASM_IST_H
+
+/*
+ * Include file for the interface to IST BIOS
+ * Copyright 2002 Andy Grover <andrew.grover@intel.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+
+#include <linux/types.h>
+
+struct ist_info {
+ __u32 signature;
+ __u32 command;
+ __u32 event;
+ __u32 perf_level;
+};
+
+#endif /* _ASM_IST_H */
diff --git a/sysroot/usr/include/asm/kvm.h b/sysroot/usr/include/asm/kvm.h
new file mode 100644
index 0000000..7a71120
--- /dev/null
+++ b/sysroot/usr/include/asm/kvm.h
@@ -0,0 +1,191 @@
+#ifndef __LINUX_KVM_X86_H
+#define __LINUX_KVM_X86_H
+
+/*
+ * KVM x86 specific structures and definitions
+ *
+ */
+
+#include <asm/types.h>
+#include <linux/ioctl.h>
+
+/* Architectural interrupt line count. */
+#define KVM_NR_INTERRUPTS 256
+
+struct kvm_memory_alias {
+ __u32 slot; /* this has a different namespace than memory slots */
+ __u32 flags;
+ __u64 guest_phys_addr;
+ __u64 memory_size;
+ __u64 target_phys_addr;
+};
+
+/* for KVM_GET_IRQCHIP and KVM_SET_IRQCHIP */
+struct kvm_pic_state {
+ __u8 last_irr; /* edge detection */
+ __u8 irr; /* interrupt request register */
+ __u8 imr; /* interrupt mask register */
+ __u8 isr; /* interrupt service register */
+ __u8 priority_add; /* highest irq priority */
+ __u8 irq_base;
+ __u8 read_reg_select;
+ __u8 poll;
+ __u8 special_mask;
+ __u8 init_state;
+ __u8 auto_eoi;
+ __u8 rotate_on_auto_eoi;
+ __u8 special_fully_nested_mode;
+ __u8 init4; /* true if 4 byte init */
+ __u8 elcr; /* PIIX edge/trigger selection */
+ __u8 elcr_mask;
+};
+
+#define KVM_IOAPIC_NUM_PINS 24
+struct kvm_ioapic_state {
+ __u64 base_address;
+ __u32 ioregsel;
+ __u32 id;
+ __u32 irr;
+ __u32 pad;
+ union {
+ __u64 bits;
+ struct {
+ __u8 vector;
+ __u8 delivery_mode:3;
+ __u8 dest_mode:1;
+ __u8 delivery_status:1;
+ __u8 polarity:1;
+ __u8 remote_irr:1;
+ __u8 trig_mode:1;
+ __u8 mask:1;
+ __u8 reserve:7;
+ __u8 reserved[4];
+ __u8 dest_id;
+ } fields;
+ } redirtbl[KVM_IOAPIC_NUM_PINS];
+};
+
+#define KVM_IRQCHIP_PIC_MASTER 0
+#define KVM_IRQCHIP_PIC_SLAVE 1
+#define KVM_IRQCHIP_IOAPIC 2
+
+/* for KVM_GET_REGS and KVM_SET_REGS */
+struct kvm_regs {
+ /* out (KVM_GET_REGS) / in (KVM_SET_REGS) */
+ __u64 rax, rbx, rcx, rdx;
+ __u64 rsi, rdi, rsp, rbp;
+ __u64 r8, r9, r10, r11;
+ __u64 r12, r13, r14, r15;
+ __u64 rip, rflags;
+};
+
+/* for KVM_GET_LAPIC and KVM_SET_LAPIC */
+#define KVM_APIC_REG_SIZE 0x400
+struct kvm_lapic_state {
+ char regs[KVM_APIC_REG_SIZE];
+};
+
+struct kvm_segment {
+ __u64 base;
+ __u32 limit;
+ __u16 selector;
+ __u8 type;
+ __u8 present, dpl, db, s, l, g, avl;
+ __u8 unusable;
+ __u8 padding;
+};
+
+struct kvm_dtable {
+ __u64 base;
+ __u16 limit;
+ __u16 padding[3];
+};
+
+
+/* for KVM_GET_SREGS and KVM_SET_SREGS */
+struct kvm_sregs {
+ /* out (KVM_GET_SREGS) / in (KVM_SET_SREGS) */
+ struct kvm_segment cs, ds, es, fs, gs, ss;
+ struct kvm_segment tr, ldt;
+ struct kvm_dtable gdt, idt;
+ __u64 cr0, cr2, cr3, cr4, cr8;
+ __u64 efer;
+ __u64 apic_base;
+ __u64 interrupt_bitmap[(KVM_NR_INTERRUPTS + 63) / 64];
+};
+
+/* for KVM_GET_FPU and KVM_SET_FPU */
+struct kvm_fpu {
+ __u8 fpr[8][16];
+ __u16 fcw;
+ __u16 fsw;
+ __u8 ftwx; /* in fxsave format */
+ __u8 pad1;
+ __u16 last_opcode;
+ __u64 last_ip;
+ __u64 last_dp;
+ __u8 xmm[16][16];
+ __u32 mxcsr;
+ __u32 pad2;
+};
+
+struct kvm_msr_entry {
+ __u32 index;
+ __u32 reserved;
+ __u64 data;
+};
+
+/* for KVM_GET_MSRS and KVM_SET_MSRS */
+struct kvm_msrs {
+ __u32 nmsrs; /* number of msrs in entries */
+ __u32 pad;
+
+ struct kvm_msr_entry entries[0];
+};
+
+/* for KVM_GET_MSR_INDEX_LIST */
+struct kvm_msr_list {
+ __u32 nmsrs; /* number of msrs in entries */
+ __u32 indices[0];
+};
+
+
+struct kvm_cpuid_entry {
+ __u32 function;
+ __u32 eax;
+ __u32 ebx;
+ __u32 ecx;
+ __u32 edx;
+ __u32 padding;
+};
+
+/* for KVM_SET_CPUID */
+struct kvm_cpuid {
+ __u32 nent;
+ __u32 padding;
+ struct kvm_cpuid_entry entries[0];
+};
+
+struct kvm_cpuid_entry2 {
+ __u32 function;
+ __u32 index;
+ __u32 flags;
+ __u32 eax;
+ __u32 ebx;
+ __u32 ecx;
+ __u32 edx;
+ __u32 padding[3];
+};
+
+#define KVM_CPUID_FLAG_SIGNIFCANT_INDEX 1
+#define KVM_CPUID_FLAG_STATEFUL_FUNC 2
+#define KVM_CPUID_FLAG_STATE_READ_NEXT 4
+
+/* for KVM_SET_CPUID2 */
+struct kvm_cpuid2 {
+ __u32 nent;
+ __u32 padding;
+ struct kvm_cpuid_entry2 entries[0];
+};
+
+#endif
diff --git a/sysroot/usr/include/asm/ldt.h b/sysroot/usr/include/asm/ldt.h
new file mode 100644
index 0000000..20c5972
--- /dev/null
+++ b/sysroot/usr/include/asm/ldt.h
@@ -0,0 +1,40 @@
+/*
+ * ldt.h
+ *
+ * Definitions of structures used with the modify_ldt system call.
+ */
+#ifndef _ASM_X86_LDT_H
+#define _ASM_X86_LDT_H
+
+/* Maximum number of LDT entries supported. */
+#define LDT_ENTRIES 8192
+/* The size of each LDT entry. */
+#define LDT_ENTRY_SIZE 8
+
+#ifndef __ASSEMBLY__
+/*
+ * Note on 64bit base and limit is ignored and you cannot set DS/ES/CS
+ * not to the default values if you still want to do syscalls. This
+ * call is more for 32bit mode therefore.
+ */
+struct user_desc {
+ unsigned int entry_number;
+ unsigned int base_addr;
+ unsigned int limit;
+ unsigned int seg_32bit:1;
+ unsigned int contents:2;
+ unsigned int read_exec_only:1;
+ unsigned int limit_in_pages:1;
+ unsigned int seg_not_present:1;
+ unsigned int useable:1;
+#ifdef __x86_64__
+ unsigned int lm:1;
+#endif
+};
+
+#define MODIFY_LDT_CONTENTS_DATA 0
+#define MODIFY_LDT_CONTENTS_STACK 1
+#define MODIFY_LDT_CONTENTS_CODE 2
+
+#endif /* !__ASSEMBLY__ */
+#endif
diff --git a/sysroot/usr/include/asm/mce.h b/sysroot/usr/include/asm/mce.h
new file mode 100644
index 0000000..c1d737e
--- /dev/null
+++ b/sysroot/usr/include/asm/mce.h
@@ -0,0 +1,86 @@
+#ifndef _ASM_X86_MCE_H
+#define _ASM_X86_MCE_H
+
+#ifdef __x86_64__
+
+#include <asm/ioctls.h>
+#include <asm/types.h>
+
+/*
+ * Machine Check support for x86
+ */
+
+#define MCG_CTL_P (1UL<<8) /* MCG_CAP register available */
+
+#define MCG_STATUS_RIPV (1UL<<0) /* restart ip valid */
+#define MCG_STATUS_EIPV (1UL<<1) /* eip points to correct instruction */
+#define MCG_STATUS_MCIP (1UL<<2) /* machine check in progress */
+
+#define MCI_STATUS_VAL (1UL<<63) /* valid error */
+#define MCI_STATUS_OVER (1UL<<62) /* previous errors lost */
+#define MCI_STATUS_UC (1UL<<61) /* uncorrected error */
+#define MCI_STATUS_EN (1UL<<60) /* error enabled */
+#define MCI_STATUS_MISCV (1UL<<59) /* misc error reg. valid */
+#define MCI_STATUS_ADDRV (1UL<<58) /* addr reg. valid */
+#define MCI_STATUS_PCC (1UL<<57) /* processor context corrupt */
+
+/* Fields are zero when not available */
+struct mce {
+ __u64 status;
+ __u64 misc;
+ __u64 addr;
+ __u64 mcgstatus;
+ __u64 rip;
+ __u64 tsc; /* cpu time stamp counter */
+ __u64 res1; /* for future extension */
+ __u64 res2; /* dito. */
+ __u8 cs; /* code segment */
+ __u8 bank; /* machine check bank */
+ __u8 cpu; /* cpu that raised the error */
+ __u8 finished; /* entry is valid */
+ __u32 pad;
+};
+
+/*
+ * This structure contains all data related to the MCE log. Also
+ * carries a signature to make it easier to find from external
+ * debugging tools. Each entry is only valid when its finished flag
+ * is set.
+ */
+
+#define MCE_LOG_LEN 32
+
+struct mce_log {
+ char signature[12]; /* "MACHINECHECK" */
+ unsigned len; /* = MCE_LOG_LEN */
+ unsigned next;
+ unsigned flags;
+ unsigned pad0;
+ struct mce entry[MCE_LOG_LEN];
+};
+
+#define MCE_OVERFLOW 0 /* bit 0 in flags means overflow */
+
+#define MCE_LOG_SIGNATURE "MACHINECHECK"
+
+#define MCE_GET_RECORD_LEN _IOR('M', 1, int)
+#define MCE_GET_LOG_LEN _IOR('M', 2, int)
+#define MCE_GETCLEAR_FLAGS _IOR('M', 3, int)
+
+/* Software defined banks */
+#define MCE_EXTENDED_BANK 128
+#define MCE_THERMAL_BANK MCE_EXTENDED_BANK + 0
+
+#define K8_MCE_THRESHOLD_BASE (MCE_EXTENDED_BANK + 1) /* MCE_AMD */
+#define K8_MCE_THRESHOLD_BANK_0 (MCE_THRESHOLD_BASE + 0 * 9)
+#define K8_MCE_THRESHOLD_BANK_1 (MCE_THRESHOLD_BASE + 1 * 9)
+#define K8_MCE_THRESHOLD_BANK_2 (MCE_THRESHOLD_BASE + 2 * 9)
+#define K8_MCE_THRESHOLD_BANK_3 (MCE_THRESHOLD_BASE + 3 * 9)
+#define K8_MCE_THRESHOLD_BANK_4 (MCE_THRESHOLD_BASE + 4 * 9)
+#define K8_MCE_THRESHOLD_BANK_5 (MCE_THRESHOLD_BASE + 5 * 9)
+#define K8_MCE_THRESHOLD_DRAM_ECC (MCE_THRESHOLD_BANK_4 + 0)
+
+#endif /* __x86_64__ */
+
+
+#endif
diff --git a/sysroot/usr/include/asm/mman.h b/sysroot/usr/include/asm/mman.h
new file mode 100644
index 0000000..c1682b5
--- /dev/null
+++ b/sysroot/usr/include/asm/mman.h
@@ -0,0 +1,19 @@
+#ifndef _ASM_X86_MMAN_H
+#define _ASM_X86_MMAN_H
+
+#include <asm-generic/mman.h>
+
+#define MAP_32BIT 0x40 /* only give out 32bit addresses */
+
+#define MAP_GROWSDOWN 0x0100 /* stack-like segment */
+#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
+#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */
+#define MAP_LOCKED 0x2000 /* pages are locked */
+#define MAP_NORESERVE 0x4000 /* don't check for reservations */
+#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */
+#define MAP_NONBLOCK 0x10000 /* do not block on IO */
+
+#define MCL_CURRENT 1 /* lock all current mappings */
+#define MCL_FUTURE 2 /* lock all future mappings */
+
+#endif /* _ASM_X86_MMAN_H */
diff --git a/sysroot/usr/include/asm/msgbuf.h b/sysroot/usr/include/asm/msgbuf.h
new file mode 100644
index 0000000..7e4e948
--- /dev/null
+++ b/sysroot/usr/include/asm/msgbuf.h
@@ -0,0 +1,39 @@
+#ifndef _ASM_X86_MSGBUF_H
+#define _ASM_X86_MSGBUF_H
+
+/*
+ * The msqid64_ds structure for i386 architecture.
+ * Note extra padding because this structure is passed back and forth
+ * between kernel and user space.
+ *
+ * Pad space on i386 is left for:
+ * - 64-bit time_t to solve y2038 problem
+ * - 2 miscellaneous 32-bit values
+ *
+ * Pad space on x8664 is left for:
+ * - 2 miscellaneous 64-bit values
+ */
+struct msqid64_ds {
+ struct ipc64_perm msg_perm;
+ __kernel_time_t msg_stime; /* last msgsnd time */
+#ifdef __i386__
+ unsigned long __unused1;
+#endif
+ __kernel_time_t msg_rtime; /* last msgrcv time */
+#ifdef __i386__
+ unsigned long __unused2;
+#endif
+ __kernel_time_t msg_ctime; /* last change time */
+#ifdef __i386__
+ unsigned long __unused3;
+#endif
+ unsigned long msg_cbytes; /* current number of bytes on queue */
+ unsigned long msg_qnum; /* number of messages in queue */
+ unsigned long msg_qbytes; /* max number of bytes on queue */
+ __kernel_pid_t msg_lspid; /* pid of last msgsnd */
+ __kernel_pid_t msg_lrpid; /* last receive pid */
+ unsigned long __unused4;
+ unsigned long __unused5;
+};
+
+#endif /* _ASM_X86_MSGBUF_H */
diff --git a/sysroot/usr/include/asm/msr-index.h b/sysroot/usr/include/asm/msr-index.h
new file mode 100644
index 0000000..a494473
--- /dev/null
+++ b/sysroot/usr/include/asm/msr-index.h
@@ -0,0 +1,292 @@
+#ifndef __ASM_MSR_INDEX_H
+#define __ASM_MSR_INDEX_H
+
+/* CPU model specific register (MSR) numbers */
+
+/* x86-64 specific MSRs */
+#define MSR_EFER 0xc0000080 /* extended feature register */
+#define MSR_STAR 0xc0000081 /* legacy mode SYSCALL target */
+#define MSR_LSTAR 0xc0000082 /* long mode SYSCALL target */
+#define MSR_CSTAR 0xc0000083 /* compat mode SYSCALL target */
+#define MSR_SYSCALL_MASK 0xc0000084 /* EFLAGS mask for syscall */
+#define MSR_FS_BASE 0xc0000100 /* 64bit FS base */
+#define MSR_GS_BASE 0xc0000101 /* 64bit GS base */
+#define MSR_KERNEL_GS_BASE 0xc0000102 /* SwapGS GS shadow */
+
+/* EFER bits: */
+#define _EFER_SCE 0 /* SYSCALL/SYSRET */
+#define _EFER_LME 8 /* Long mode enable */
+#define _EFER_LMA 10 /* Long mode active (read-only) */
+#define _EFER_NX 11 /* No execute enable */
+
+#define EFER_SCE (1<<_EFER_SCE)
+#define EFER_LME (1<<_EFER_LME)
+#define EFER_LMA (1<<_EFER_LMA)
+#define EFER_NX (1<<_EFER_NX)
+
+/* Intel MSRs. Some also available on other CPUs */
+#define MSR_IA32_PERFCTR0 0x000000c1
+#define MSR_IA32_PERFCTR1 0x000000c2
+#define MSR_FSB_FREQ 0x000000cd
+
+#define MSR_MTRRcap 0x000000fe
+#define MSR_IA32_BBL_CR_CTL 0x00000119
+
+#define MSR_IA32_SYSENTER_CS 0x00000174
+#define MSR_IA32_SYSENTER_ESP 0x00000175
+#define MSR_IA32_SYSENTER_EIP 0x00000176
+
+#define MSR_IA32_MCG_CAP 0x00000179
+#define MSR_IA32_MCG_STATUS 0x0000017a
+#define MSR_IA32_MCG_CTL 0x0000017b
+
+#define MSR_IA32_PEBS_ENABLE 0x000003f1
+#define MSR_IA32_DS_AREA 0x00000600
+#define MSR_IA32_PERF_CAPABILITIES 0x00000345
+
+#define MSR_MTRRfix64K_00000 0x00000250
+#define MSR_MTRRfix16K_80000 0x00000258
+#define MSR_MTRRfix16K_A0000 0x00000259
+#define MSR_MTRRfix4K_C0000 0x00000268
+#define MSR_MTRRfix4K_C8000 0x00000269
+#define MSR_MTRRfix4K_D0000 0x0000026a
+#define MSR_MTRRfix4K_D8000 0x0000026b
+#define MSR_MTRRfix4K_E0000 0x0000026c
+#define MSR_MTRRfix4K_E8000 0x0000026d
+#define MSR_MTRRfix4K_F0000 0x0000026e
+#define MSR_MTRRfix4K_F8000 0x0000026f
+#define MSR_MTRRdefType 0x000002ff
+
+#define MSR_IA32_DEBUGCTLMSR 0x000001d9
+#define MSR_IA32_LASTBRANCHFROMIP 0x000001db
+#define MSR_IA32_LASTBRANCHTOIP 0x000001dc
+#define MSR_IA32_LASTINTFROMIP 0x000001dd
+#define MSR_IA32_LASTINTTOIP 0x000001de
+
+#define MSR_IA32_MC0_CTL 0x00000400
+#define MSR_IA32_MC0_STATUS 0x00000401
+#define MSR_IA32_MC0_ADDR 0x00000402
+#define MSR_IA32_MC0_MISC 0x00000403
+
+#define MSR_P6_PERFCTR0 0x000000c1
+#define MSR_P6_PERFCTR1 0x000000c2
+#define MSR_P6_EVNTSEL0 0x00000186
+#define MSR_P6_EVNTSEL1 0x00000187
+
+/* AMD64 MSRs. Not complete. See the architecture manual for a more
+ complete list. */
+
+#define MSR_AMD64_IBSFETCHCTL 0xc0011030
+#define MSR_AMD64_IBSFETCHLINAD 0xc0011031
+#define MSR_AMD64_IBSFETCHPHYSAD 0xc0011032
+#define MSR_AMD64_IBSOPCTL 0xc0011033
+#define MSR_AMD64_IBSOPRIP 0xc0011034
+#define MSR_AMD64_IBSOPDATA 0xc0011035
+#define MSR_AMD64_IBSOPDATA2 0xc0011036
+#define MSR_AMD64_IBSOPDATA3 0xc0011037
+#define MSR_AMD64_IBSDCLINAD 0xc0011038
+#define MSR_AMD64_IBSDCPHYSAD 0xc0011039
+#define MSR_AMD64_IBSCTL 0xc001103a
+
+/* K8 MSRs */
+#define MSR_K8_TOP_MEM1 0xc001001a
+#define MSR_K8_TOP_MEM2 0xc001001d
+#define MSR_K8_SYSCFG 0xc0010010
+#define MSR_K8_HWCR 0xc0010015
+#define MSR_K8_ENABLE_C1E 0xc0010055
+#define K8_MTRRFIXRANGE_DRAM_ENABLE 0x00040000 /* MtrrFixDramEn bit */
+#define K8_MTRRFIXRANGE_DRAM_MODIFY 0x00080000 /* MtrrFixDramModEn bit */
+#define K8_MTRR_RDMEM_WRMEM_MASK 0x18181818 /* Mask: RdMem|WrMem */
+
+/* K7 MSRs */
+#define MSR_K7_EVNTSEL0 0xc0010000
+#define MSR_K7_PERFCTR0 0xc0010004
+#define MSR_K7_EVNTSEL1 0xc0010001
+#define MSR_K7_PERFCTR1 0xc0010005
+#define MSR_K7_EVNTSEL2 0xc0010002
+#define MSR_K7_PERFCTR2 0xc0010006
+#define MSR_K7_EVNTSEL3 0xc0010003
+#define MSR_K7_PERFCTR3 0xc0010007
+#define MSR_K7_CLK_CTL 0xc001001b
+#define MSR_K7_HWCR 0xc0010015
+#define MSR_K7_FID_VID_CTL 0xc0010041
+#define MSR_K7_FID_VID_STATUS 0xc0010042
+
+/* K6 MSRs */
+#define MSR_K6_EFER 0xc0000080
+#define MSR_K6_STAR 0xc0000081
+#define MSR_K6_WHCR 0xc0000082
+#define MSR_K6_UWCCR 0xc0000085
+#define MSR_K6_EPMR 0xc0000086
+#define MSR_K6_PSOR 0xc0000087
+#define MSR_K6_PFIR 0xc0000088
+
+/* Centaur-Hauls/IDT defined MSRs. */
+#define MSR_IDT_FCR1 0x00000107
+#define MSR_IDT_FCR2 0x00000108
+#define MSR_IDT_FCR3 0x00000109
+#define MSR_IDT_FCR4 0x0000010a
+
+#define MSR_IDT_MCR0 0x00000110
+#define MSR_IDT_MCR1 0x00000111
+#define MSR_IDT_MCR2 0x00000112
+#define MSR_IDT_MCR3 0x00000113
+#define MSR_IDT_MCR4 0x00000114
+#define MSR_IDT_MCR5 0x00000115
+#define MSR_IDT_MCR6 0x00000116
+#define MSR_IDT_MCR7 0x00000117
+#define MSR_IDT_MCR_CTRL 0x00000120
+
+/* VIA Cyrix defined MSRs*/
+#define MSR_VIA_FCR 0x00001107
+#define MSR_VIA_LONGHAUL 0x0000110a
+#define MSR_VIA_RNG 0x0000110b
+#define MSR_VIA_BCR2 0x00001147
+
+/* Transmeta defined MSRs */
+#define MSR_TMTA_LONGRUN_CTRL 0x80868010
+#define MSR_TMTA_LONGRUN_FLAGS 0x80868011
+#define MSR_TMTA_LRTI_READOUT 0x80868018
+#define MSR_TMTA_LRTI_VOLT_MHZ 0x8086801a
+
+/* Intel defined MSRs. */
+#define MSR_IA32_P5_MC_ADDR 0x00000000
+#define MSR_IA32_P5_MC_TYPE 0x00000001
+#define MSR_IA32_TSC 0x00000010
+#define MSR_IA32_PLATFORM_ID 0x00000017
+#define MSR_IA32_EBL_CR_POWERON 0x0000002a
+
+#define MSR_IA32_APICBASE 0x0000001b
+#define MSR_IA32_APICBASE_BSP (1<<8)
+#define MSR_IA32_APICBASE_ENABLE (1<<11)
+#define MSR_IA32_APICBASE_BASE (0xfffff<<12)
+
+#define MSR_IA32_UCODE_WRITE 0x00000079
+#define MSR_IA32_UCODE_REV 0x0000008b
+
+#define MSR_IA32_PERF_STATUS 0x00000198
+#define MSR_IA32_PERF_CTL 0x00000199
+
+#define MSR_IA32_MPERF 0x000000e7
+#define MSR_IA32_APERF 0x000000e8
+
+#define MSR_IA32_THERM_CONTROL 0x0000019a
+#define MSR_IA32_THERM_INTERRUPT 0x0000019b
+#define MSR_IA32_THERM_STATUS 0x0000019c
+#define MSR_IA32_MISC_ENABLE 0x000001a0
+
+/* Intel Model 6 */
+#define MSR_P6_EVNTSEL0 0x00000186
+#define MSR_P6_EVNTSEL1 0x00000187
+
+/* P4/Xeon+ specific */
+#define MSR_IA32_MCG_EAX 0x00000180
+#define MSR_IA32_MCG_EBX 0x00000181
+#define MSR_IA32_MCG_ECX 0x00000182
+#define MSR_IA32_MCG_EDX 0x00000183
+#define MSR_IA32_MCG_ESI 0x00000184
+#define MSR_IA32_MCG_EDI 0x00000185
+#define MSR_IA32_MCG_EBP 0x00000186
+#define MSR_IA32_MCG_ESP 0x00000187
+#define MSR_IA32_MCG_EFLAGS 0x00000188
+#define MSR_IA32_MCG_EIP 0x00000189
+#define MSR_IA32_MCG_RESERVED 0x0000018a
+
+/* Pentium IV performance counter MSRs */
+#define MSR_P4_BPU_PERFCTR0 0x00000300
+#define MSR_P4_BPU_PERFCTR1 0x00000301
+#define MSR_P4_BPU_PERFCTR2 0x00000302
+#define MSR_P4_BPU_PERFCTR3 0x00000303
+#define MSR_P4_MS_PERFCTR0 0x00000304
+#define MSR_P4_MS_PERFCTR1 0x00000305
+#define MSR_P4_MS_PERFCTR2 0x00000306
+#define MSR_P4_MS_PERFCTR3 0x00000307
+#define MSR_P4_FLAME_PERFCTR0 0x00000308
+#define MSR_P4_FLAME_PERFCTR1 0x00000309
+#define MSR_P4_FLAME_PERFCTR2 0x0000030a
+#define MSR_P4_FLAME_PERFCTR3 0x0000030b
+#define MSR_P4_IQ_PERFCTR0 0x0000030c
+#define MSR_P4_IQ_PERFCTR1 0x0000030d
+#define MSR_P4_IQ_PERFCTR2 0x0000030e
+#define MSR_P4_IQ_PERFCTR3 0x0000030f
+#define MSR_P4_IQ_PERFCTR4 0x00000310
+#define MSR_P4_IQ_PERFCTR5 0x00000311
+#define MSR_P4_BPU_CCCR0 0x00000360
+#define MSR_P4_BPU_CCCR1 0x00000361
+#define MSR_P4_BPU_CCCR2 0x00000362
+#define MSR_P4_BPU_CCCR3 0x00000363
+#define MSR_P4_MS_CCCR0 0x00000364
+#define MSR_P4_MS_CCCR1 0x00000365
+#define MSR_P4_MS_CCCR2 0x00000366
+#define MSR_P4_MS_CCCR3 0x00000367
+#define MSR_P4_FLAME_CCCR0 0x00000368
+#define MSR_P4_FLAME_CCCR1 0x00000369
+#define MSR_P4_FLAME_CCCR2 0x0000036a
+#define MSR_P4_FLAME_CCCR3 0x0000036b
+#define MSR_P4_IQ_CCCR0 0x0000036c
+#define MSR_P4_IQ_CCCR1 0x0000036d
+#define MSR_P4_IQ_CCCR2 0x0000036e
+#define MSR_P4_IQ_CCCR3 0x0000036f
+#define MSR_P4_IQ_CCCR4 0x00000370
+#define MSR_P4_IQ_CCCR5 0x00000371
+#define MSR_P4_ALF_ESCR0 0x000003ca
+#define MSR_P4_ALF_ESCR1 0x000003cb
+#define MSR_P4_BPU_ESCR0 0x000003b2
+#define MSR_P4_BPU_ESCR1 0x000003b3
+#define MSR_P4_BSU_ESCR0 0x000003a0
+#define MSR_P4_BSU_ESCR1 0x000003a1
+#define MSR_P4_CRU_ESCR0 0x000003b8
+#define MSR_P4_CRU_ESCR1 0x000003b9
+#define MSR_P4_CRU_ESCR2 0x000003cc
+#define MSR_P4_CRU_ESCR3 0x000003cd
+#define MSR_P4_CRU_ESCR4 0x000003e0
+#define MSR_P4_CRU_ESCR5 0x000003e1
+#define MSR_P4_DAC_ESCR0 0x000003a8
+#define MSR_P4_DAC_ESCR1 0x000003a9
+#define MSR_P4_FIRM_ESCR0 0x000003a4
+#define MSR_P4_FIRM_ESCR1 0x000003a5
+#define MSR_P4_FLAME_ESCR0 0x000003a6
+#define MSR_P4_FLAME_ESCR1 0x000003a7
+#define MSR_P4_FSB_ESCR0 0x000003a2
+#define MSR_P4_FSB_ESCR1 0x000003a3
+#define MSR_P4_IQ_ESCR0 0x000003ba
+#define MSR_P4_IQ_ESCR1 0x000003bb
+#define MSR_P4_IS_ESCR0 0x000003b4
+#define MSR_P4_IS_ESCR1 0x000003b5
+#define MSR_P4_ITLB_ESCR0 0x000003b6
+#define MSR_P4_ITLB_ESCR1 0x000003b7
+#define MSR_P4_IX_ESCR0 0x000003c8
+#define MSR_P4_IX_ESCR1 0x000003c9
+#define MSR_P4_MOB_ESCR0 0x000003aa
+#define MSR_P4_MOB_ESCR1 0x000003ab
+#define MSR_P4_MS_ESCR0 0x000003c0
+#define MSR_P4_MS_ESCR1 0x000003c1
+#define MSR_P4_PMH_ESCR0 0x000003ac
+#define MSR_P4_PMH_ESCR1 0x000003ad
+#define MSR_P4_RAT_ESCR0 0x000003bc
+#define MSR_P4_RAT_ESCR1 0x000003bd
+#define MSR_P4_SAAT_ESCR0 0x000003ae
+#define MSR_P4_SAAT_ESCR1 0x000003af
+#define MSR_P4_SSU_ESCR0 0x000003be
+#define MSR_P4_SSU_ESCR1 0x000003bf /* guess: not in manual */
+
+#define MSR_P4_TBPU_ESCR0 0x000003c2
+#define MSR_P4_TBPU_ESCR1 0x000003c3
+#define MSR_P4_TC_ESCR0 0x000003c4
+#define MSR_P4_TC_ESCR1 0x000003c5
+#define MSR_P4_U2L_ESCR0 0x000003b0
+#define MSR_P4_U2L_ESCR1 0x000003b1
+
+/* Intel Core-based CPU performance counters */
+#define MSR_CORE_PERF_FIXED_CTR0 0x00000309
+#define MSR_CORE_PERF_FIXED_CTR1 0x0000030a
+#define MSR_CORE_PERF_FIXED_CTR2 0x0000030b
+#define MSR_CORE_PERF_FIXED_CTR_CTRL 0x0000038d
+#define MSR_CORE_PERF_GLOBAL_STATUS 0x0000038e
+#define MSR_CORE_PERF_GLOBAL_CTRL 0x0000038f
+#define MSR_CORE_PERF_GLOBAL_OVF_CTRL 0x00000390
+
+/* Geode defined MSRs */
+#define MSR_GEODE_BUSCONT_CONF0 0x00001900
+
+#endif /* __ASM_MSR_INDEX_H */
diff --git a/sysroot/usr/include/asm/msr.h b/sysroot/usr/include/asm/msr.h
new file mode 100644
index 0000000..feb11d2
--- /dev/null
+++ b/sysroot/usr/include/asm/msr.h
@@ -0,0 +1,145 @@
+#ifndef __ASM_X86_MSR_H_
+#define __ASM_X86_MSR_H_
+
+#include <asm/msr-index.h>
+
+#ifndef __ASSEMBLY__
+# include <linux/types.h>
+#endif
+
+#ifdef __i386__
+
+
+#else /* __i386__ */
+
+#ifndef __ASSEMBLY__
+#include <linux/errno.h>
+/*
+ * Access to machine-specific registers (available on 586 and better only)
+ * Note: the rd* operations modify the parameters directly (without using
+ * pointer indirection), this allows gcc to optimize better
+ */
+
+#define rdmsr(msr,val1,val2) \
+ __asm__ __volatile__("rdmsr" \
+ : "=a" (val1), "=d" (val2) \
+ : "c" (msr))
+
+
+#define rdmsrl(msr,val) do { unsigned long a__,b__; \
+ __asm__ __volatile__("rdmsr" \
+ : "=a" (a__), "=d" (b__) \
+ : "c" (msr)); \
+ val = a__ | (b__<<32); \
+} while(0)
+
+#define wrmsr(msr,val1,val2) \
+ __asm__ __volatile__("wrmsr" \
+ : /* no outputs */ \
+ : "c" (msr), "a" (val1), "d" (val2))
+
+#define wrmsrl(msr,val) wrmsr(msr,(__u32)((__u64)(val)),((__u64)(val))>>32)
+
+#define rdtsc(low,high) \
+ __asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high))
+
+#define rdtscl(low) \
+ __asm__ __volatile__ ("rdtsc" : "=a" (low) : : "edx")
+
+#define rdtscp(low,high,aux) \
+ __asm__ __volatile__ (".byte 0x0f,0x01,0xf9" : "=a" (low), "=d" (high), "=c" (aux))
+
+#define rdtscll(val) do { \
+ unsigned int __a,__d; \
+ __asm__ __volatile__("rdtsc" : "=a" (__a), "=d" (__d)); \
+ (val) = ((unsigned long)__a) | (((unsigned long)__d)<<32); \
+} while(0)
+
+#define rdtscpll(val, aux) do { \
+ unsigned long __a, __d; \
+ __asm__ __volatile__ (".byte 0x0f,0x01,0xf9" : "=a" (__a), "=d" (__d), "=c" (aux)); \
+ (val) = (__d << 32) | __a; \
+} while (0)
+
+#define write_tsc(val1,val2) wrmsr(0x10, val1, val2)
+
+#define write_rdtscp_aux(val) wrmsr(0xc0000103, val, 0)
+
+#define rdpmc(counter,low,high) \
+ __asm__ __volatile__("rdpmc" \
+ : "=a" (low), "=d" (high) \
+ : "c" (counter))
+
+
+static __inline__ void cpuid(int op, unsigned int *eax, unsigned int *ebx,
+ unsigned int *ecx, unsigned int *edx)
+{
+ __asm__("cpuid"
+ : "=a" (*eax),
+ "=b" (*ebx),
+ "=c" (*ecx),
+ "=d" (*edx)
+ : "0" (op));
+}
+
+/* Some CPUID calls want 'count' to be placed in ecx */
+static __inline__ void cpuid_count(int op, int count, int *eax, int *ebx, int *ecx,
+ int *edx)
+{
+ __asm__("cpuid"
+ : "=a" (*eax),
+ "=b" (*ebx),
+ "=c" (*ecx),
+ "=d" (*edx)
+ : "0" (op), "c" (count));
+}
+
+/*
+ * CPUID functions returning a single datum
+ */
+static __inline__ unsigned int cpuid_eax(unsigned int op)
+{
+ unsigned int eax;
+
+ __asm__("cpuid"
+ : "=a" (eax)
+ : "0" (op)
+ : "bx", "cx", "dx");
+ return eax;
+}
+static __inline__ unsigned int cpuid_ebx(unsigned int op)
+{
+ unsigned int eax, ebx;
+
+ __asm__("cpuid"
+ : "=a" (eax), "=b" (ebx)
+ : "0" (op)
+ : "cx", "dx" );
+ return ebx;
+}
+static __inline__ unsigned int cpuid_ecx(unsigned int op)
+{
+ unsigned int eax, ecx;
+
+ __asm__("cpuid"
+ : "=a" (eax), "=c" (ecx)
+ : "0" (op)
+ : "bx", "dx" );
+ return ecx;
+}
+static __inline__ unsigned int cpuid_edx(unsigned int op)
+{
+ unsigned int eax, edx;
+
+ __asm__("cpuid"
+ : "=a" (eax), "=d" (edx)
+ : "0" (op)
+ : "bx", "cx");
+ return edx;
+}
+
+#endif /* __ASSEMBLY__ */
+
+#endif /* !__i386__ */
+
+#endif
diff --git a/sysroot/usr/include/asm/mtrr.h b/sysroot/usr/include/asm/mtrr.h
new file mode 100644
index 0000000..fa38ac3
--- /dev/null
+++ b/sysroot/usr/include/asm/mtrr.h
@@ -0,0 +1,86 @@
+/* Generic MTRR (Memory Type Range Register) ioctls.
+
+ Copyright (C) 1997-1999 Richard Gooch
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ Richard Gooch may be reached by email at rgooch@atnf.csiro.au
+ The postal address is:
+ Richard Gooch, c/o ATNF, P. O. Box 76, Epping, N.S.W., 2121, Australia.
+*/
+#ifndef _ASM_X86_MTRR_H
+#define _ASM_X86_MTRR_H
+
+#include <linux/ioctl.h>
+#include <linux/errno.h>
+
+#define MTRR_IOCTL_BASE 'M'
+
+struct mtrr_sentry
+{
+ unsigned long base; /* Base address */
+ unsigned int size; /* Size of region */
+ unsigned int type; /* Type of region */
+};
+
+/* Warning: this structure has a different order from i386
+ on x86-64. The 32bit emulation code takes care of that.
+ But you need to use this for 64bit, otherwise your X server
+ will break. */
+
+#ifdef __i386__
+struct mtrr_gentry
+{
+ unsigned int regnum; /* Register number */
+ unsigned long base; /* Base address */
+ unsigned int size; /* Size of region */
+ unsigned int type; /* Type of region */
+};
+
+#else /* __i386__ */
+
+struct mtrr_gentry
+{
+ unsigned long base; /* Base address */
+ unsigned int size; /* Size of region */
+ unsigned int regnum; /* Register number */
+ unsigned int type; /* Type of region */
+};
+#endif /* !__i386__ */
+
+/* These are the various ioctls */
+#define MTRRIOC_ADD_ENTRY _IOW(MTRR_IOCTL_BASE, 0, struct mtrr_sentry)
+#define MTRRIOC_SET_ENTRY _IOW(MTRR_IOCTL_BASE, 1, struct mtrr_sentry)
+#define MTRRIOC_DEL_ENTRY _IOW(MTRR_IOCTL_BASE, 2, struct mtrr_sentry)
+#define MTRRIOC_GET_ENTRY _IOWR(MTRR_IOCTL_BASE, 3, struct mtrr_gentry)
+#define MTRRIOC_KILL_ENTRY _IOW(MTRR_IOCTL_BASE, 4, struct mtrr_sentry)
+#define MTRRIOC_ADD_PAGE_ENTRY _IOW(MTRR_IOCTL_BASE, 5, struct mtrr_sentry)
+#define MTRRIOC_SET_PAGE_ENTRY _IOW(MTRR_IOCTL_BASE, 6, struct mtrr_sentry)
+#define MTRRIOC_DEL_PAGE_ENTRY _IOW(MTRR_IOCTL_BASE, 7, struct mtrr_sentry)
+#define MTRRIOC_GET_PAGE_ENTRY _IOWR(MTRR_IOCTL_BASE, 8, struct mtrr_gentry)
+#define MTRRIOC_KILL_PAGE_ENTRY _IOW(MTRR_IOCTL_BASE, 9, struct mtrr_sentry)
+
+/* These are the region types */
+#define MTRR_TYPE_UNCACHABLE 0
+#define MTRR_TYPE_WRCOMB 1
+/*#define MTRR_TYPE_ 2*/
+/*#define MTRR_TYPE_ 3*/
+#define MTRR_TYPE_WRTHROUGH 4
+#define MTRR_TYPE_WRPROT 5
+#define MTRR_TYPE_WRBACK 6
+#define MTRR_NUM_TYPES 7
+
+
+#endif /* _ASM_X86_MTRR_H */
diff --git a/sysroot/usr/include/asm/page.h b/sysroot/usr/include/asm/page.h
new file mode 100644
index 0000000..d104aab
--- /dev/null
+++ b/sysroot/usr/include/asm/page.h
@@ -0,0 +1,5 @@
+# ifdef __i386__
+# include "page_32.h"
+# else
+# include "page_64.h"
+# endif
diff --git a/sysroot/usr/include/asm/page_32.h b/sysroot/usr/include/asm/page_32.h
new file mode 100644
index 0000000..c5bd3cd
--- /dev/null
+++ b/sysroot/usr/include/asm/page_32.h
@@ -0,0 +1,13 @@
+#ifndef _I386_PAGE_H
+#define _I386_PAGE_H
+
+/* PAGE_SHIFT determines the page size */
+#define PAGE_SHIFT 12
+#define PAGE_SIZE (1UL << PAGE_SHIFT)
+#define PAGE_MASK (~(PAGE_SIZE-1))
+
+#define LARGE_PAGE_MASK (~(LARGE_PAGE_SIZE-1))
+#define LARGE_PAGE_SIZE (1UL << PMD_SHIFT)
+
+
+#endif /* _I386_PAGE_H */
diff --git a/sysroot/usr/include/asm/page_64.h b/sysroot/usr/include/asm/page_64.h
new file mode 100644
index 0000000..9513cb1
--- /dev/null
+++ b/sysroot/usr/include/asm/page_64.h
@@ -0,0 +1,41 @@
+#ifndef _X86_64_PAGE_H
+#define _X86_64_PAGE_H
+
+#include <linux/const.h>
+
+/* PAGE_SHIFT determines the page size */
+#define PAGE_SHIFT 12
+#define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT)
+#define PAGE_MASK (~(PAGE_SIZE-1))
+#define PHYSICAL_PAGE_MASK (~(PAGE_SIZE-1) & __PHYSICAL_MASK)
+
+#define THREAD_ORDER 1
+#define THREAD_SIZE (PAGE_SIZE << THREAD_ORDER)
+#define CURRENT_MASK (~(THREAD_SIZE-1))
+
+#define EXCEPTION_STACK_ORDER 0
+#define EXCEPTION_STKSZ (PAGE_SIZE << EXCEPTION_STACK_ORDER)
+
+#define DEBUG_STACK_ORDER (EXCEPTION_STACK_ORDER + 1)
+#define DEBUG_STKSZ (PAGE_SIZE << DEBUG_STACK_ORDER)
+
+#define IRQSTACK_ORDER 2
+#define IRQSTACKSIZE (PAGE_SIZE << IRQSTACK_ORDER)
+
+#define STACKFAULT_STACK 1
+#define DOUBLEFAULT_STACK 2
+#define NMI_STACK 3
+#define DEBUG_STACK 4
+#define MCE_STACK 5
+#define N_EXCEPTION_STACKS 5 /* hw limit: 7 */
+
+#define LARGE_PAGE_MASK (~(LARGE_PAGE_SIZE-1))
+#define LARGE_PAGE_SIZE (_AC(1,UL) << PMD_SHIFT)
+
+#define HPAGE_SHIFT PMD_SHIFT
+#define HPAGE_SIZE (_AC(1,UL) << HPAGE_SHIFT)
+#define HPAGE_MASK (~(HPAGE_SIZE - 1))
+#define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT)
+
+
+#endif /* _X86_64_PAGE_H */
diff --git a/sysroot/usr/include/asm/param.h b/sysroot/usr/include/asm/param.h
new file mode 100644
index 0000000..64fef0b
--- /dev/null
+++ b/sysroot/usr/include/asm/param.h
@@ -0,0 +1,17 @@
+#ifndef _ASM_X86_PARAM_H
+#define _ASM_X86_PARAM_H
+
+
+#ifndef HZ
+#define HZ 100
+#endif
+
+#define EXEC_PAGESIZE 4096
+
+#ifndef NOGROUP
+#define NOGROUP (-1)
+#endif
+
+#define MAXHOSTNAMELEN 64 /* max length of hostname */
+
+#endif /* _ASM_X86_PARAM_H */
diff --git a/sysroot/usr/include/asm/poll.h b/sysroot/usr/include/asm/poll.h
new file mode 100644
index 0000000..c98509d
--- /dev/null
+++ b/sysroot/usr/include/asm/poll.h
@@ -0,0 +1 @@
+#include <asm-generic/poll.h>
diff --git a/sysroot/usr/include/asm/posix_types.h b/sysroot/usr/include/asm/posix_types.h
new file mode 100644
index 0000000..2d21600
--- /dev/null
+++ b/sysroot/usr/include/asm/posix_types.h
@@ -0,0 +1,5 @@
+# ifdef __i386__
+# include "posix_types_32.h"
+# else
+# include "posix_types_64.h"
+# endif
diff --git a/sysroot/usr/include/asm/posix_types_32.h b/sysroot/usr/include/asm/posix_types_32.h
new file mode 100644
index 0000000..133e31e
--- /dev/null
+++ b/sysroot/usr/include/asm/posix_types_32.h
@@ -0,0 +1,82 @@
+#ifndef __ARCH_I386_POSIX_TYPES_H
+#define __ARCH_I386_POSIX_TYPES_H
+
+/*
+ * This file is generally used by user-level software, so you need to
+ * be a little careful about namespace pollution etc. Also, we cannot
+ * assume GCC is being used.
+ */
+
+typedef unsigned long __kernel_ino_t;
+typedef unsigned short __kernel_mode_t;
+typedef unsigned short __kernel_nlink_t;
+typedef long __kernel_off_t;
+typedef int __kernel_pid_t;
+typedef unsigned short __kernel_ipc_pid_t;
+typedef unsigned short __kernel_uid_t;
+typedef unsigned short __kernel_gid_t;
+typedef unsigned int __kernel_size_t;
+typedef int __kernel_ssize_t;
+typedef int __kernel_ptrdiff_t;
+typedef long __kernel_time_t;
+typedef long __kernel_suseconds_t;
+typedef long __kernel_clock_t;
+typedef int __kernel_timer_t;
+typedef int __kernel_clockid_t;
+typedef int __kernel_daddr_t;
+typedef char * __kernel_caddr_t;
+typedef unsigned short __kernel_uid16_t;
+typedef unsigned short __kernel_gid16_t;
+typedef unsigned int __kernel_uid32_t;
+typedef unsigned int __kernel_gid32_t;
+
+typedef unsigned short __kernel_old_uid_t;
+typedef unsigned short __kernel_old_gid_t;
+typedef unsigned short __kernel_old_dev_t;
+
+#ifdef __GNUC__
+typedef long long __kernel_loff_t;
+#endif
+
+typedef struct {
+#if defined(__KERNEL__) || defined(__USE_ALL)
+ int val[2];
+#else /* !defined(__KERNEL__) && !defined(__USE_ALL) */
+ int __val[2];
+#endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */
+} __kernel_fsid_t;
+
+#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
+
+#undef __FD_SET
+#define __FD_SET(fd,fdsetp) \
+ __asm__ __volatile__("btsl %1,%0": \
+ "+m" (*(__kernel_fd_set *) (fdsetp)):"r" ((int) (fd)))
+
+#undef __FD_CLR
+#define __FD_CLR(fd,fdsetp) \
+ __asm__ __volatile__("btrl %1,%0": \
+ "+m" (*(__kernel_fd_set *) (fdsetp)):"r" ((int) (fd)))
+
+#undef __FD_ISSET
+#define __FD_ISSET(fd,fdsetp) (__extension__ ({ \
+ unsigned char __result; \
+ __asm__ __volatile__("btl %1,%2 ; setb %0" \
+ :"=q" (__result) :"r" ((int) (fd)), \
+ "m" (*(__kernel_fd_set *) (fdsetp))); \
+ __result; }))
+
+#undef __FD_ZERO
+#define __FD_ZERO(fdsetp) \
+do { \
+ int __d0, __d1; \
+ __asm__ __volatile__("cld ; rep ; stosl" \
+ :"=m" (*(__kernel_fd_set *) (fdsetp)), \
+ "=&c" (__d0), "=&D" (__d1) \
+ :"a" (0), "1" (__FDSET_LONGS), \
+ "2" ((__kernel_fd_set *) (fdsetp)) : "memory"); \
+} while (0)
+
+#endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */
+
+#endif
diff --git a/sysroot/usr/include/asm/posix_types_64.h b/sysroot/usr/include/asm/posix_types_64.h
new file mode 100644
index 0000000..91e6914
--- /dev/null
+++ b/sysroot/usr/include/asm/posix_types_64.h
@@ -0,0 +1,47 @@
+#ifndef _ASM_X86_64_POSIX_TYPES_H
+#define _ASM_X86_64_POSIX_TYPES_H
+
+/*
+ * This file is generally used by user-level software, so you need to
+ * be a little careful about namespace pollution etc. Also, we cannot
+ * assume GCC is being used.
+ */
+
+typedef unsigned long __kernel_ino_t;
+typedef unsigned int __kernel_mode_t;
+typedef unsigned long __kernel_nlink_t;
+typedef long __kernel_off_t;
+typedef int __kernel_pid_t;
+typedef int __kernel_ipc_pid_t;
+typedef unsigned int __kernel_uid_t;
+typedef unsigned int __kernel_gid_t;
+typedef unsigned long __kernel_size_t;
+typedef long __kernel_ssize_t;
+typedef long __kernel_ptrdiff_t;
+typedef long __kernel_time_t;
+typedef long __kernel_suseconds_t;
+typedef long __kernel_clock_t;
+typedef int __kernel_timer_t;
+typedef int __kernel_clockid_t;
+typedef int __kernel_daddr_t;
+typedef char * __kernel_caddr_t;
+typedef unsigned short __kernel_uid16_t;
+typedef unsigned short __kernel_gid16_t;
+
+#ifdef __GNUC__
+typedef long long __kernel_loff_t;
+#endif
+
+typedef struct {
+ int val[2];
+} __kernel_fsid_t;
+
+typedef unsigned short __kernel_old_uid_t;
+typedef unsigned short __kernel_old_gid_t;
+typedef __kernel_uid_t __kernel_uid32_t;
+typedef __kernel_gid_t __kernel_gid32_t;
+
+typedef unsigned long __kernel_old_dev_t;
+
+
+#endif
diff --git a/sysroot/usr/include/asm/prctl.h b/sysroot/usr/include/asm/prctl.h
new file mode 100644
index 0000000..52952ad
--- /dev/null
+++ b/sysroot/usr/include/asm/prctl.h
@@ -0,0 +1,10 @@
+#ifndef X86_64_PRCTL_H
+#define X86_64_PRCTL_H 1
+
+#define ARCH_SET_GS 0x1001
+#define ARCH_SET_FS 0x1002
+#define ARCH_GET_FS 0x1003
+#define ARCH_GET_GS 0x1004
+
+
+#endif
diff --git a/sysroot/usr/include/asm/ptrace-abi.h b/sysroot/usr/include/asm/ptrace-abi.h
new file mode 100644
index 0000000..7524e12
--- /dev/null
+++ b/sysroot/usr/include/asm/ptrace-abi.h
@@ -0,0 +1,81 @@
+#ifndef _ASM_X86_PTRACE_ABI_H
+#define _ASM_X86_PTRACE_ABI_H
+
+#ifdef __i386__
+
+#define EBX 0
+#define ECX 1
+#define EDX 2
+#define ESI 3
+#define EDI 4
+#define EBP 5
+#define EAX 6
+#define DS 7
+#define ES 8
+#define FS 9
+#define GS 10
+#define ORIG_EAX 11
+#define EIP 12
+#define CS 13
+#define EFL 14
+#define UESP 15
+#define SS 16
+#define FRAME_SIZE 17
+
+#else /* __i386__ */
+
+#if defined(__ASSEMBLY__) || defined(__FRAME_OFFSETS)
+#define R15 0
+#define R14 8
+#define R13 16
+#define R12 24
+#define RBP 32
+#define RBX 40
+/* arguments: interrupts/non tracing syscalls only save upto here*/
+#define R11 48
+#define R10 56
+#define R9 64
+#define R8 72
+#define RAX 80
+#define RCX 88
+#define RDX 96
+#define RSI 104
+#define RDI 112
+#define ORIG_RAX 120 /* = ERROR */
+/* end of arguments */
+/* cpu exception frame or undefined in case of fast syscall. */
+#define RIP 128
+#define CS 136
+#define EFLAGS 144
+#define RSP 152
+#define SS 160
+#define ARGOFFSET R11
+#endif /* __ASSEMBLY__ */
+
+/* top of stack page */
+#define FRAME_SIZE 168
+
+#endif /* !__i386__ */
+
+/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
+#define PTRACE_GETREGS 12
+#define PTRACE_SETREGS 13
+#define PTRACE_GETFPREGS 14
+#define PTRACE_SETFPREGS 15
+#define PTRACE_GETFPXREGS 18
+#define PTRACE_SETFPXREGS 19
+
+#define PTRACE_OLDSETOPTIONS 21
+
+/* only useful for access 32bit programs / kernels */
+#define PTRACE_GET_THREAD_AREA 25
+#define PTRACE_SET_THREAD_AREA 26
+
+#ifdef __x86_64__
+# define PTRACE_ARCH_PRCTL 30
+#else
+# define PTRACE_SYSEMU 31
+# define PTRACE_SYSEMU_SINGLESTEP 32
+#endif
+
+#endif
diff --git a/sysroot/usr/include/asm/ptrace.h b/sysroot/usr/include/asm/ptrace.h
new file mode 100644
index 0000000..aaeb50c
--- /dev/null
+++ b/sysroot/usr/include/asm/ptrace.h
@@ -0,0 +1,66 @@
+#ifndef _ASM_X86_PTRACE_H
+#define _ASM_X86_PTRACE_H
+
+#include <asm/ptrace-abi.h>
+
+#ifndef __ASSEMBLY__
+
+#ifdef __i386__
+/* this struct defines the way the registers are stored on the
+ stack during a system call. */
+
+struct pt_regs {
+ long ebx;
+ long ecx;
+ long edx;
+ long esi;
+ long edi;
+ long ebp;
+ long eax;
+ int xds;
+ int xes;
+ int xfs;
+ /* int xgs; */
+ long orig_eax;
+ long eip;
+ int xcs;
+ long eflags;
+ long esp;
+ int xss;
+};
+
+
+#else /* __i386__ */
+
+struct pt_regs {
+ unsigned long r15;
+ unsigned long r14;
+ unsigned long r13;
+ unsigned long r12;
+ unsigned long rbp;
+ unsigned long rbx;
+/* arguments: non interrupts/non tracing syscalls only save upto here*/
+ unsigned long r11;
+ unsigned long r10;
+ unsigned long r9;
+ unsigned long r8;
+ unsigned long rax;
+ unsigned long rcx;
+ unsigned long rdx;
+ unsigned long rsi;
+ unsigned long rdi;
+ unsigned long orig_rax;
+/* end of arguments */
+/* cpu exception frame or undefined */
+ unsigned long rip;
+ unsigned long cs;
+ unsigned long eflags;
+ unsigned long rsp;
+ unsigned long ss;
+/* top of stack page */
+};
+
+#endif /* !__i386__ */
+#endif /* !__ASSEMBLY__ */
+
+#endif
diff --git a/sysroot/usr/include/asm/resource.h b/sysroot/usr/include/asm/resource.h
new file mode 100644
index 0000000..04bc4db
--- /dev/null
+++ b/sysroot/usr/include/asm/resource.h
@@ -0,0 +1 @@
+#include <asm-generic/resource.h>
diff --git a/sysroot/usr/include/asm/sembuf.h b/sysroot/usr/include/asm/sembuf.h
new file mode 100644
index 0000000..ee50c80
--- /dev/null
+++ b/sysroot/usr/include/asm/sembuf.h
@@ -0,0 +1,24 @@
+#ifndef _ASM_X86_SEMBUF_H
+#define _ASM_X86_SEMBUF_H
+
+/*
+ * The semid64_ds structure for x86 architecture.
+ * Note extra padding because this structure is passed back and forth
+ * between kernel and user space.
+ *
+ * Pad space is left for:
+ * - 64-bit time_t to solve y2038 problem
+ * - 2 miscellaneous 32-bit values
+ */
+struct semid64_ds {
+ struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
+ __kernel_time_t sem_otime; /* last semop time */
+ unsigned long __unused1;
+ __kernel_time_t sem_ctime; /* last change time */
+ unsigned long __unused2;
+ unsigned long sem_nsems; /* no. of semaphores in array */
+ unsigned long __unused3;
+ unsigned long __unused4;
+};
+
+#endif /* _ASM_X86_SEMBUF_H */
diff --git a/sysroot/usr/include/asm/setup.h b/sysroot/usr/include/asm/setup.h
new file mode 100644
index 0000000..c3b36cb
--- /dev/null
+++ b/sysroot/usr/include/asm/setup.h
@@ -0,0 +1,7 @@
+#ifndef _ASM_X86_SETUP_H
+#define _ASM_X86_SETUP_H
+
+#define COMMAND_LINE_SIZE 2048
+
+
+#endif /* _ASM_X86_SETUP_H */
diff --git a/sysroot/usr/include/asm/shmbuf.h b/sysroot/usr/include/asm/shmbuf.h
new file mode 100644
index 0000000..b51413b
--- /dev/null
+++ b/sysroot/usr/include/asm/shmbuf.h
@@ -0,0 +1,51 @@
+#ifndef _ASM_X86_SHMBUF_H
+#define _ASM_X86_SHMBUF_H
+
+/*
+ * The shmid64_ds structure for x86 architecture.
+ * Note extra padding because this structure is passed back and forth
+ * between kernel and user space.
+ *
+ * Pad space on 32 bit is left for:
+ * - 64-bit time_t to solve y2038 problem
+ * - 2 miscellaneous 32-bit values
+ *
+ * Pad space on 64 bit is left for:
+ * - 2 miscellaneous 64-bit values
+ */
+
+struct shmid64_ds {
+ struct ipc64_perm shm_perm; /* operation perms */
+ size_t shm_segsz; /* size of segment (bytes) */
+ __kernel_time_t shm_atime; /* last attach time */
+#ifdef __i386__
+ unsigned long __unused1;
+#endif
+ __kernel_time_t shm_dtime; /* last detach time */
+#ifdef __i386__
+ unsigned long __unused2;
+#endif
+ __kernel_time_t shm_ctime; /* last change time */
+#ifdef __i386__
+ unsigned long __unused3;
+#endif
+ __kernel_pid_t shm_cpid; /* pid of creator */
+ __kernel_pid_t shm_lpid; /* pid of last operator */
+ unsigned long shm_nattch; /* no. of current attaches */
+ unsigned long __unused4;
+ unsigned long __unused5;
+};
+
+struct shminfo64 {
+ unsigned long shmmax;
+ unsigned long shmmin;
+ unsigned long shmmni;
+ unsigned long shmseg;
+ unsigned long shmall;
+ unsigned long __unused1;
+ unsigned long __unused2;
+ unsigned long __unused3;
+ unsigned long __unused4;
+};
+
+#endif /* _ASM_X86_SHMBUF_H */
diff --git a/sysroot/usr/include/asm/sigcontext.h b/sysroot/usr/include/asm/sigcontext.h
new file mode 100644
index 0000000..c52d310
--- /dev/null
+++ b/sysroot/usr/include/asm/sigcontext.h
@@ -0,0 +1,137 @@
+#ifndef _ASM_X86_SIGCONTEXT_H
+#define _ASM_X86_SIGCONTEXT_H
+
+#include <asm/types.h>
+
+#ifdef __i386__
+/*
+ * As documented in the iBCS2 standard..
+ *
+ * The first part of "struct _fpstate" is just the normal i387
+ * hardware setup, the extra "status" word is used to save the
+ * coprocessor status word before entering the handler.
+ *
+ * Pentium III FXSR, SSE support
+ * Gareth Hughes <gareth@valinux.com>, May 2000
+ *
+ * The FPU state data structure has had to grow to accommodate the
+ * extended FPU state required by the Streaming SIMD Extensions.
+ * There is no documented standard to accomplish this at the moment.
+ */
+struct _fpreg {
+ unsigned short significand[4];
+ unsigned short exponent;
+};
+
+struct _fpxreg {
+ unsigned short significand[4];
+ unsigned short exponent;
+ unsigned short padding[3];
+};
+
+struct _xmmreg {
+ unsigned long element[4];
+};
+
+struct _fpstate {
+ /* Regular FPU environment */
+ unsigned long cw;
+ unsigned long sw;
+ unsigned long tag;
+ unsigned long ipoff;
+ unsigned long cssel;
+ unsigned long dataoff;
+ unsigned long datasel;
+ struct _fpreg _st[8];
+ unsigned short status;
+ unsigned short magic; /* 0xffff = regular FPU data only */
+
+ /* FXSR FPU environment */
+ unsigned long _fxsr_env[6]; /* FXSR FPU env is ignored */
+ unsigned long mxcsr;
+ unsigned long reserved;
+ struct _fpxreg _fxsr_st[8]; /* FXSR FPU reg data is ignored */
+ struct _xmmreg _xmm[8];
+ unsigned long padding[56];
+};
+
+#define X86_FXSR_MAGIC 0x0000
+
+struct sigcontext {
+ unsigned short gs, __gsh;
+ unsigned short fs, __fsh;
+ unsigned short es, __esh;
+ unsigned short ds, __dsh;
+ unsigned long edi;
+ unsigned long esi;
+ unsigned long ebp;
+ unsigned long esp;
+ unsigned long ebx;
+ unsigned long edx;
+ unsigned long ecx;
+ unsigned long eax;
+ unsigned long trapno;
+ unsigned long err;
+ unsigned long eip;
+ unsigned short cs, __csh;
+ unsigned long eflags;
+ unsigned long esp_at_signal;
+ unsigned short ss, __ssh;
+ struct _fpstate * fpstate;
+ unsigned long oldmask;
+ unsigned long cr2;
+};
+
+#else /* __i386__ */
+
+/* FXSAVE frame */
+/* Note: reserved1/2 may someday contain valuable data. Always save/restore
+ them when you change signal frames. */
+struct _fpstate {
+ __u16 cwd;
+ __u16 swd;
+ __u16 twd; /* Note this is not the same as the 32bit/x87/FSAVE twd */
+ __u16 fop;
+ __u64 rip;
+ __u64 rdp;
+ __u32 mxcsr;
+ __u32 mxcsr_mask;
+ __u32 st_space[32]; /* 8*16 bytes for each FP-reg */
+ __u32 xmm_space[64]; /* 16*16 bytes for each XMM-reg */
+ __u32 reserved2[24];
+};
+
+struct sigcontext {
+ unsigned long r8;
+ unsigned long r9;
+ unsigned long r10;
+ unsigned long r11;
+ unsigned long r12;
+ unsigned long r13;
+ unsigned long r14;
+ unsigned long r15;
+ unsigned long rdi;
+ unsigned long rsi;
+ unsigned long rbp;
+ unsigned long rbx;
+ unsigned long rdx;
+ unsigned long rax;
+ unsigned long rcx;
+ unsigned long rsp;
+ unsigned long rip;
+ unsigned long eflags; /* RFLAGS */
+ unsigned short cs;
+ unsigned short gs;
+ unsigned short fs;
+ unsigned short __pad0;
+ unsigned long err;
+ unsigned long trapno;
+ unsigned long oldmask;
+ unsigned long cr2;
+ struct _fpstate *fpstate; /* zero when no FPU context */
+ unsigned long reserved1[8];
+};
+
+#endif /* !__i386__ */
+
+#endif
diff --git a/sysroot/usr/include/asm/sigcontext32.h b/sysroot/usr/include/asm/sigcontext32.h
new file mode 100644
index 0000000..3d65703
--- /dev/null
+++ b/sysroot/usr/include/asm/sigcontext32.h
@@ -0,0 +1,71 @@
+#ifndef _SIGCONTEXT32_H
+#define _SIGCONTEXT32_H 1
+
+/* signal context for 32bit programs. */
+
+#define X86_FXSR_MAGIC 0x0000
+
+struct _fpreg {
+ unsigned short significand[4];
+ unsigned short exponent;
+};
+
+struct _fpxreg {
+ unsigned short significand[4];
+ unsigned short exponent;
+ unsigned short padding[3];
+};
+
+struct _xmmreg {
+ __u32 element[4];
+};
+
+/* FSAVE frame with extensions */
+struct _fpstate_ia32 {
+ /* Regular FPU environment */
+ __u32 cw;
+ __u32 sw;
+ __u32 tag; /* not compatible to 64bit twd */
+ __u32 ipoff;
+ __u32 cssel;
+ __u32 dataoff;
+ __u32 datasel;
+ struct _fpreg _st[8];
+ unsigned short status;
+ unsigned short magic; /* 0xffff = regular FPU data only */
+
+ /* FXSR FPU environment */
+ __u32 _fxsr_env[6];
+ __u32 mxcsr;
+ __u32 reserved;
+ struct _fpxreg _fxsr_st[8];
+ struct _xmmreg _xmm[8]; /* It's actually 16 */
+ __u32 padding[56];
+};
+
+struct sigcontext_ia32 {
+ unsigned short gs, __gsh;
+ unsigned short fs, __fsh;
+ unsigned short es, __esh;
+ unsigned short ds, __dsh;
+ unsigned int edi;
+ unsigned int esi;
+ unsigned int ebp;
+ unsigned int esp;
+ unsigned int ebx;
+ unsigned int edx;
+ unsigned int ecx;
+ unsigned int eax;
+ unsigned int trapno;
+ unsigned int err;
+ unsigned int eip;
+ unsigned short cs, __csh;
+ unsigned int eflags;
+ unsigned int esp_at_signal;
+ unsigned short ss, __ssh;
+ unsigned int fpstate; /* really (struct _fpstate_ia32 *) */
+ unsigned int oldmask;
+ unsigned int cr2;
+};
+
+#endif
diff --git a/sysroot/usr/include/asm/siginfo.h b/sysroot/usr/include/asm/siginfo.h
new file mode 100644
index 0000000..a477bea
--- /dev/null
+++ b/sysroot/usr/include/asm/siginfo.h
@@ -0,0 +1,10 @@
+#ifndef _ASM_X86_SIGINFO_H
+#define _ASM_X86_SIGINFO_H
+
+#ifdef __x86_64__
+# define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
+#endif
+
+#include <asm-generic/siginfo.h>
+
+#endif
diff --git a/sysroot/usr/include/asm/signal.h b/sysroot/usr/include/asm/signal.h
new file mode 100644
index 0000000..0116980
--- /dev/null
+++ b/sysroot/usr/include/asm/signal.h
@@ -0,0 +1,138 @@
+#ifndef _ASM_X86_SIGNAL_H
+#define _ASM_X86_SIGNAL_H
+
+#ifndef __ASSEMBLY__
+#include <linux/types.h>
+#include <linux/time.h>
+
+/* Avoid too many header ordering problems. */
+struct siginfo;
+
+/* Here we must cater to libcs that poke about in kernel headers. */
+
+#define NSIG 32
+typedef unsigned long sigset_t;
+
+#endif /* __ASSEMBLY__ */
+
+#define SIGHUP 1
+#define SIGINT 2
+#define SIGQUIT 3
+#define SIGILL 4
+#define SIGTRAP 5
+#define SIGABRT 6
+#define SIGIOT 6
+#define SIGBUS 7
+#define SIGFPE 8
+#define SIGKILL 9
+#define SIGUSR1 10
+#define SIGSEGV 11
+#define SIGUSR2 12
+#define SIGPIPE 13
+#define SIGALRM 14
+#define SIGTERM 15
+#define SIGSTKFLT 16
+#define SIGCHLD 17
+#define SIGCONT 18
+#define SIGSTOP 19
+#define SIGTSTP 20
+#define SIGTTIN 21
+#define SIGTTOU 22
+#define SIGURG 23
+#define SIGXCPU 24
+#define SIGXFSZ 25
+#define SIGVTALRM 26
+#define SIGPROF 27
+#define SIGWINCH 28
+#define SIGIO 29
+#define SIGPOLL SIGIO
+/*
+#define SIGLOST 29
+*/
+#define SIGPWR 30
+#define SIGSYS 31
+#define SIGUNUSED 31
+
+/* These should not be considered constants from userland. */
+#define SIGRTMIN 32
+#define SIGRTMAX _NSIG
+
+/*
+ * SA_FLAGS values:
+ *
+ * SA_ONSTACK indicates that a registered stack_t will be used.
+ * SA_RESTART flag to get restarting signals (which were the default long ago)
+ * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
+ * SA_RESETHAND clears the handler when the signal is delivered.
+ * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
+ * SA_NODEFER prevents the current signal from being masked in the handler.
+ *
+ * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
+ * Unix names RESETHAND and NODEFER respectively.
+ */
+#define SA_NOCLDSTOP 0x00000001u
+#define SA_NOCLDWAIT 0x00000002u
+#define SA_SIGINFO 0x00000004u
+#define SA_ONSTACK 0x08000000u
+#define SA_RESTART 0x10000000u
+#define SA_NODEFER 0x40000000u
+#define SA_RESETHAND 0x80000000u
+
+#define SA_NOMASK SA_NODEFER
+#define SA_ONESHOT SA_RESETHAND
+
+#define SA_RESTORER 0x04000000
+
+/*
+ * sigaltstack controls
+ */
+#define SS_ONSTACK 1
+#define SS_DISABLE 2
+
+#define MINSIGSTKSZ 2048
+#define SIGSTKSZ 8192
+
+#include <asm-generic/signal.h>
+
+#ifndef __ASSEMBLY__
+
+#ifdef __i386__
+/* Here we must cater to libcs that poke about in kernel headers. */
+
+struct sigaction {
+ union {
+ __sighandler_t _sa_handler;
+ void (*_sa_sigaction)(int, struct siginfo *, void *);
+ } _u;
+ sigset_t sa_mask;
+ unsigned long sa_flags;
+ void (*sa_restorer)(void);
+};
+
+#define sa_handler _u._sa_handler
+#define sa_sigaction _u._sa_sigaction
+
+#else /* __i386__ */
+
+struct sigaction {
+ __sighandler_t sa_handler;
+ unsigned long sa_flags;
+ __sigrestore_t sa_restorer;
+ sigset_t sa_mask; /* mask last for extensibility */
+};
+
+struct k_sigaction {
+ struct sigaction sa;
+};
+
+#endif /* !__i386__ */
+
+typedef struct sigaltstack {
+ void *ss_sp;
+ int ss_flags;
+ size_t ss_size;
+} stack_t;
+
+#endif /* __ASSEMBLY__ */
+
+#endif
diff --git a/sysroot/usr/include/asm/socket.h b/sysroot/usr/include/asm/socket.h
new file mode 100644
index 0000000..99ca648
--- /dev/null
+++ b/sysroot/usr/include/asm/socket.h
@@ -0,0 +1,55 @@
+#ifndef _ASM_SOCKET_H
+#define _ASM_SOCKET_H
+
+#include <asm/sockios.h>
+
+/* For setsockopt(2) */
+#define SOL_SOCKET 1
+
+#define SO_DEBUG 1
+#define SO_REUSEADDR 2
+#define SO_TYPE 3
+#define SO_ERROR 4
+#define SO_DONTROUTE 5
+#define SO_BROADCAST 6
+#define SO_SNDBUF 7
+#define SO_RCVBUF 8
+#define SO_SNDBUFFORCE 32
+#define SO_RCVBUFFORCE 33
+#define SO_KEEPALIVE 9
+#define SO_OOBINLINE 10
+#define SO_NO_CHECK 11
+#define SO_PRIORITY 12
+#define SO_LINGER 13
+#define SO_BSDCOMPAT 14
+/* To add :#define SO_REUSEPORT 15 */
+#define SO_PASSCRED 16
+#define SO_PEERCRED 17
+#define SO_RCVLOWAT 18
+#define SO_SNDLOWAT 19
+#define SO_RCVTIMEO 20
+#define SO_SNDTIMEO 21
+
+/* Security levels - as per NRL IPv6 - don't actually do anything */
+#define SO_SECURITY_AUTHENTICATION 22
+#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
+#define SO_SECURITY_ENCRYPTION_NETWORK 24
+
+#define SO_BINDTODEVICE 25
+
+/* Socket filtering */
+#define SO_ATTACH_FILTER 26
+#define SO_DETACH_FILTER 27
+
+#define SO_PEERNAME 28
+#define SO_TIMESTAMP 29
+#define SCM_TIMESTAMP SO_TIMESTAMP
+
+#define SO_ACCEPTCONN 30
+
+#define SO_PEERSEC 31
+#define SO_PASSSEC 34
+#define SO_TIMESTAMPNS 35
+#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
+
+#endif /* _ASM_SOCKET_H */
diff --git a/sysroot/usr/include/asm/sockios.h b/sysroot/usr/include/asm/sockios.h
new file mode 100644
index 0000000..49cc72b
--- /dev/null
+++ b/sysroot/usr/include/asm/sockios.h
@@ -0,0 +1,13 @@
+#ifndef _ASM_X86_SOCKIOS_H
+#define _ASM_X86_SOCKIOS_H
+
+/* Socket-level I/O control calls. */
+#define FIOSETOWN 0x8901
+#define SIOCSPGRP 0x8902
+#define FIOGETOWN 0x8903
+#define SIOCGPGRP 0x8904
+#define SIOCATMARK 0x8905
+#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */
+#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */
+
+#endif /* _ASM_X86_SOCKIOS_H */
diff --git a/sysroot/usr/include/asm/stat.h b/sysroot/usr/include/asm/stat.h
new file mode 100644
index 0000000..5c22dcb
--- /dev/null
+++ b/sysroot/usr/include/asm/stat.h
@@ -0,0 +1,114 @@
+#ifndef _ASM_X86_STAT_H
+#define _ASM_X86_STAT_H
+
+#define STAT_HAVE_NSEC 1
+
+#ifdef __i386__
+struct stat {
+ unsigned long st_dev;
+ unsigned long st_ino;
+ unsigned short st_mode;
+ unsigned short st_nlink;
+ unsigned short st_uid;
+ unsigned short st_gid;
+ unsigned long st_rdev;
+ unsigned long st_size;
+ unsigned long st_blksize;
+ unsigned long st_blocks;
+ unsigned long st_atime;
+ unsigned long st_atime_nsec;
+ unsigned long st_mtime;
+ unsigned long st_mtime_nsec;
+ unsigned long st_ctime;
+ unsigned long st_ctime_nsec;
+ unsigned long __unused4;
+ unsigned long __unused5;
+};
+
+#define STAT64_HAS_BROKEN_ST_INO 1
+
+/* This matches struct stat64 in glibc2.1, hence the absolutely
+ * insane amounts of padding around dev_t's.
+ */
+struct stat64 {
+ unsigned long long st_dev;
+ unsigned char __pad0[4];
+
+ unsigned long __st_ino;
+
+ unsigned int st_mode;
+ unsigned int st_nlink;
+
+ unsigned long st_uid;
+ unsigned long st_gid;
+
+ unsigned long long st_rdev;
+ unsigned char __pad3[4];
+
+ long long st_size;
+ unsigned long st_blksize;
+
+ /* Number 512-byte blocks allocated. */
+ unsigned long long st_blocks;
+
+ unsigned long st_atime;
+ unsigned long st_atime_nsec;
+
+ unsigned long st_mtime;
+ unsigned int st_mtime_nsec;
+
+ unsigned long st_ctime;
+ unsigned long st_ctime_nsec;
+
+ unsigned long long st_ino;
+};
+
+#else /* __i386__ */
+
+struct stat {
+ unsigned long st_dev;
+ unsigned long st_ino;
+ unsigned long st_nlink;
+
+ unsigned int st_mode;
+ unsigned int st_uid;
+ unsigned int st_gid;
+ unsigned int __pad0;
+ unsigned long st_rdev;
+ long st_size;
+ long st_blksize;
+ long st_blocks; /* Number 512-byte blocks allocated. */
+
+ unsigned long st_atime;
+ unsigned long st_atime_nsec;
+ unsigned long st_mtime;
+ unsigned long st_mtime_nsec;
+ unsigned long st_ctime;
+ unsigned long st_ctime_nsec;
+ long __unused[3];
+};
+#endif
+
+/* for 32bit emulation and 32 bit kernels */
+struct __old_kernel_stat {
+ unsigned short st_dev;
+ unsigned short st_ino;
+ unsigned short st_mode;
+ unsigned short st_nlink;
+ unsigned short st_uid;
+ unsigned short st_gid;
+ unsigned short st_rdev;
+#ifdef __i386__
+ unsigned long st_size;
+ unsigned long st_atime;
+ unsigned long st_mtime;
+ unsigned long st_ctime;
+#else
+ unsigned int st_size;
+ unsigned int st_atime;
+ unsigned int st_mtime;
+ unsigned int st_ctime;
+#endif
+};
+
+#endif
diff --git a/sysroot/usr/include/asm/statfs.h b/sysroot/usr/include/asm/statfs.h
new file mode 100644
index 0000000..7c651aa
--- /dev/null
+++ b/sysroot/usr/include/asm/statfs.h
@@ -0,0 +1,63 @@
+#ifndef _ASM_X86_STATFS_H
+#define _ASM_X86_STATFS_H
+
+#ifdef __i386__
+#include <asm-generic/statfs.h>
+#else
+
+#ifndef __KERNEL_STRICT_NAMES
+
+#include <linux/types.h>
+
+typedef __kernel_fsid_t fsid_t;
+
+#endif
+
+/*
+ * This is ugly -- we're already 64-bit clean, so just duplicate the
+ * definitions.
+ */
+struct statfs {
+ long f_type;
+ long f_bsize;
+ long f_blocks;
+ long f_bfree;
+ long f_bavail;
+ long f_files;
+ long f_ffree;
+ __kernel_fsid_t f_fsid;
+ long f_namelen;
+ long f_frsize;
+ long f_spare[5];
+};
+
+struct statfs64 {
+ long f_type;
+ long f_bsize;
+ long f_blocks;
+ long f_bfree;
+ long f_bavail;
+ long f_files;
+ long f_ffree;
+ __kernel_fsid_t f_fsid;
+ long f_namelen;
+ long f_frsize;
+ long f_spare[5];
+};
+
+struct compat_statfs64 {
+ __u32 f_type;
+ __u32 f_bsize;
+ __u64 f_blocks;
+ __u64 f_bfree;
+ __u64 f_bavail;
+ __u64 f_files;
+ __u64 f_ffree;
+ __kernel_fsid_t f_fsid;
+ __u32 f_namelen;
+ __u32 f_frsize;
+ __u32 f_spare[5];
+} __attribute__((packed));
+
+#endif /* !__i386__ */
+#endif
diff --git a/sysroot/usr/include/asm/termbits.h b/sysroot/usr/include/asm/termbits.h
new file mode 100644
index 0000000..af1b70e
--- /dev/null
+++ b/sysroot/usr/include/asm/termbits.h
@@ -0,0 +1,198 @@
+#ifndef _ASM_X86_TERMBITS_H
+#define _ASM_X86_TERMBITS_H
+
+#include <linux/posix_types.h>
+
+typedef unsigned char cc_t;
+typedef unsigned int speed_t;
+typedef unsigned int tcflag_t;
+
+#define NCCS 19
+struct termios {
+ tcflag_t c_iflag; /* input mode flags */
+ tcflag_t c_oflag; /* output mode flags */
+ tcflag_t c_cflag; /* control mode flags */
+ tcflag_t c_lflag; /* local mode flags */
+ cc_t c_line; /* line discipline */
+ cc_t c_cc[NCCS]; /* control characters */
+};
+
+struct termios2 {
+ tcflag_t c_iflag; /* input mode flags */
+ tcflag_t c_oflag; /* output mode flags */
+ tcflag_t c_cflag; /* control mode flags */
+ tcflag_t c_lflag; /* local mode flags */
+ cc_t c_line; /* line discipline */
+ cc_t c_cc[NCCS]; /* control characters */
+ speed_t c_ispeed; /* input speed */
+ speed_t c_ospeed; /* output speed */
+};
+
+struct ktermios {
+ tcflag_t c_iflag; /* input mode flags */
+ tcflag_t c_oflag; /* output mode flags */
+ tcflag_t c_cflag; /* control mode flags */
+ tcflag_t c_lflag; /* local mode flags */
+ cc_t c_line; /* line discipline */
+ cc_t c_cc[NCCS]; /* control characters */
+ speed_t c_ispeed; /* input speed */
+ speed_t c_ospeed; /* output speed */
+};
+
+/* c_cc characters */
+#define VINTR 0
+#define VQUIT 1
+#define VERASE 2
+#define VKILL 3
+#define VEOF 4
+#define VTIME 5
+#define VMIN 6
+#define VSWTC 7
+#define VSTART 8
+#define VSTOP 9
+#define VSUSP 10
+#define VEOL 11
+#define VREPRINT 12
+#define VDISCARD 13
+#define VWERASE 14
+#define VLNEXT 15
+#define VEOL2 16
+
+/* c_iflag bits */
+#define IGNBRK 0000001
+#define BRKINT 0000002
+#define IGNPAR 0000004
+#define PARMRK 0000010
+#define INPCK 0000020
+#define ISTRIP 0000040
+#define INLCR 0000100
+#define IGNCR 0000200
+#define ICRNL 0000400
+#define IUCLC 0001000
+#define IXON 0002000
+#define IXANY 0004000
+#define IXOFF 0010000
+#define IMAXBEL 0020000
+#define IUTF8 0040000
+
+/* c_oflag bits */
+#define OPOST 0000001
+#define OLCUC 0000002
+#define ONLCR 0000004
+#define OCRNL 0000010
+#define ONOCR 0000020
+#define ONLRET 0000040
+#define OFILL 0000100
+#define OFDEL 0000200
+#define NLDLY 0000400
+#define NL0 0000000
+#define NL1 0000400
+#define CRDLY 0003000
+#define CR0 0000000
+#define CR1 0001000
+#define CR2 0002000
+#define CR3 0003000
+#define TABDLY 0014000
+#define TAB0 0000000
+#define TAB1 0004000
+#define TAB2 0010000
+#define TAB3 0014000
+#define XTABS 0014000
+#define BSDLY 0020000
+#define BS0 0000000
+#define BS1 0020000
+#define VTDLY 0040000
+#define VT0 0000000
+#define VT1 0040000
+#define FFDLY 0100000
+#define FF0 0000000
+#define FF1 0100000
+
+/* c_cflag bit meaning */
+#define CBAUD 0010017
+#define B0 0000000 /* hang up */
+#define B50 0000001
+#define B75 0000002
+#define B110 0000003
+#define B134 0000004
+#define B150 0000005
+#define B200 0000006
+#define B300 0000007
+#define B600 0000010
+#define B1200 0000011
+#define B1800 0000012
+#define B2400 0000013
+#define B4800 0000014
+#define B9600 0000015
+#define B19200 0000016
+#define B38400 0000017
+#define EXTA B19200
+#define EXTB B38400
+#define CSIZE 0000060
+#define CS5 0000000
+#define CS6 0000020
+#define CS7 0000040
+#define CS8 0000060
+#define CSTOPB 0000100
+#define CREAD 0000200
+#define PARENB 0000400
+#define PARODD 0001000
+#define HUPCL 0002000
+#define CLOCAL 0004000
+#define CBAUDEX 0010000
+#define BOTHER 0010000 /* non standard rate */
+#define B57600 0010001
+#define B115200 0010002
+#define B230400 0010003
+#define B460800 0010004
+#define B500000 0010005
+#define B576000 0010006
+#define B921600 0010007
+#define B1000000 0010010
+#define B1152000 0010011
+#define B1500000 0010012
+#define B2000000 0010013
+#define B2500000 0010014
+#define B3000000 0010015
+#define B3500000 0010016
+#define B4000000 0010017
+#define CIBAUD 002003600000 /* input baud rate */
+#define CMSPAR 010000000000 /* mark or space (stick) parity */
+#define CRTSCTS 020000000000 /* flow control */
+
+#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
+
+/* c_lflag bits */
+#define ISIG 0000001
+#define ICANON 0000002
+#define XCASE 0000004
+#define ECHO 0000010
+#define ECHOE 0000020
+#define ECHOK 0000040
+#define ECHONL 0000100
+#define NOFLSH 0000200
+#define TOSTOP 0000400
+#define ECHOCTL 0001000
+#define ECHOPRT 0002000
+#define ECHOKE 0004000
+#define FLUSHO 0010000
+#define PENDIN 0040000
+#define IEXTEN 0100000
+
+/* tcflow() and TCXONC use these */
+#define TCOOFF 0
+#define TCOON 1
+#define TCIOFF 2
+#define TCION 3
+
+/* tcflush() and TCFLSH use these */
+#define TCIFLUSH 0
+#define TCOFLUSH 1
+#define TCIOFLUSH 2
+
+/* tcsetattr uses these */
+#define TCSANOW 0
+#define TCSADRAIN 1
+#define TCSAFLUSH 2
+
+#endif /* _ASM_X86_TERMBITS_H */
diff --git a/sysroot/usr/include/asm/termios.h b/sysroot/usr/include/asm/termios.h
new file mode 100644
index 0000000..385e45e
--- /dev/null
+++ b/sysroot/usr/include/asm/termios.h
@@ -0,0 +1,43 @@
+#ifndef _ASM_X86_TERMIOS_H
+#define _ASM_X86_TERMIOS_H
+
+#include <asm/termbits.h>
+#include <asm/ioctls.h>
+
+struct winsize {
+ unsigned short ws_row;
+ unsigned short ws_col;
+ unsigned short ws_xpixel;
+ unsigned short ws_ypixel;
+};
+
+#define NCC 8
+struct termio {
+ unsigned short c_iflag; /* input mode flags */
+ unsigned short c_oflag; /* output mode flags */
+ unsigned short c_cflag; /* control mode flags */
+ unsigned short c_lflag; /* local mode flags */
+ unsigned char c_line; /* line discipline */
+ unsigned char c_cc[NCC]; /* control characters */
+};
+
+/* modem lines */
+#define TIOCM_LE 0x001
+#define TIOCM_DTR 0x002
+#define TIOCM_RTS 0x004
+#define TIOCM_ST 0x008
+#define TIOCM_SR 0x010
+#define TIOCM_CTS 0x020
+#define TIOCM_CAR 0x040
+#define TIOCM_RNG 0x080
+#define TIOCM_DSR 0x100
+#define TIOCM_CD TIOCM_CAR
+#define TIOCM_RI TIOCM_RNG
+#define TIOCM_OUT1 0x2000
+#define TIOCM_OUT2 0x4000
+#define TIOCM_LOOP 0x8000
+
+/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
+
+
+#endif /* _ASM_X86_TERMIOS_H */
diff --git a/sysroot/usr/include/asm/types.h b/sysroot/usr/include/asm/types.h
new file mode 100644
index 0000000..d78352d
--- /dev/null
+++ b/sysroot/usr/include/asm/types.h
@@ -0,0 +1,38 @@
+#ifndef _ASM_X86_TYPES_H
+#define _ASM_X86_TYPES_H
+
+#ifndef __ASSEMBLY__
+
+typedef unsigned short umode_t;
+
+/*
+ * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
+ * header files exported to user space
+ */
+
+typedef __signed__ char __s8;
+typedef unsigned char __u8;
+
+typedef __signed__ short __s16;
+typedef unsigned short __u16;
+
+typedef __signed__ int __s32;
+typedef unsigned int __u32;
+
+#ifdef __i386__
+# ifdef __GNUC__
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
+# endif
+#else
+typedef __signed__ long long __s64;
+typedef unsigned long long __u64;
+#endif
+
+#endif /* __ASSEMBLY__ */
+
+/*
+ * These aren't exported outside the kernel to avoid name space clashes
+ */
+
+#endif
diff --git a/sysroot/usr/include/asm/ucontext.h b/sysroot/usr/include/asm/ucontext.h
new file mode 100644
index 0000000..50a79f7
--- /dev/null
+++ b/sysroot/usr/include/asm/ucontext.h
@@ -0,0 +1,12 @@
+#ifndef _ASM_X86_UCONTEXT_H
+#define _ASM_X86_UCONTEXT_H
+
+struct ucontext {
+ unsigned long uc_flags;
+ struct ucontext *uc_link;
+ stack_t uc_stack;
+ struct sigcontext uc_mcontext;
+ sigset_t uc_sigmask; /* mask last for extensibility */
+};
+
+#endif /* _ASM_X86_UCONTEXT_H */
diff --git a/sysroot/usr/include/asm/unistd.h b/sysroot/usr/include/asm/unistd.h
new file mode 100644
index 0000000..54de0bf
--- /dev/null
+++ b/sysroot/usr/include/asm/unistd.h
@@ -0,0 +1,5 @@
+# ifdef __i386__
+# include "unistd_32.h"
+# else
+# include "unistd_64.h"
+# endif
diff --git a/sysroot/usr/include/asm/unistd_32.h b/sysroot/usr/include/asm/unistd_32.h
new file mode 100644
index 0000000..5f63e4b
--- /dev/null
+++ b/sysroot/usr/include/asm/unistd_32.h
@@ -0,0 +1,334 @@
+#ifndef _ASM_I386_UNISTD_H_
+#define _ASM_I386_UNISTD_H_
+
+/*
+ * This file contains the system call numbers.
+ */
+
+#define __NR_restart_syscall 0
+#define __NR_exit 1
+#define __NR_fork 2
+#define __NR_read 3
+#define __NR_write 4
+#define __NR_open 5
+#define __NR_close 6
+#define __NR_waitpid 7
+#define __NR_creat 8
+#define __NR_link 9
+#define __NR_unlink 10
+#define __NR_execve 11
+#define __NR_chdir 12
+#define __NR_time 13
+#define __NR_mknod 14
+#define __NR_chmod 15
+#define __NR_lchown 16
+#define __NR_break 17
+#define __NR_oldstat 18
+#define __NR_lseek 19
+#define __NR_getpid 20
+#define __NR_mount 21
+#define __NR_umount 22
+#define __NR_setuid 23
+#define __NR_getuid 24
+#define __NR_stime 25
+#define __NR_ptrace 26
+#define __NR_alarm 27
+#define __NR_oldfstat 28
+#define __NR_pause 29
+#define __NR_utime 30
+#define __NR_stty 31
+#define __NR_gtty 32
+#define __NR_access 33
+#define __NR_nice 34
+#define __NR_ftime 35
+#define __NR_sync 36
+#define __NR_kill 37
+#define __NR_rename 38
+#define __NR_mkdir 39
+#define __NR_rmdir 40
+#define __NR_dup 41
+#define __NR_pipe 42
+#define __NR_times 43
+#define __NR_prof 44
+#define __NR_brk 45
+#define __NR_setgid 46
+#define __NR_getgid 47
+#define __NR_signal 48
+#define __NR_geteuid 49
+#define __NR_getegid 50
+#define __NR_acct 51
+#define __NR_umount2 52
+#define __NR_lock 53
+#define __NR_ioctl 54
+#define __NR_fcntl 55
+#define __NR_mpx 56
+#define __NR_setpgid 57
+#define __NR_ulimit 58
+#define __NR_oldolduname 59
+#define __NR_umask 60
+#define __NR_chroot 61
+#define __NR_ustat 62
+#define __NR_dup2 63
+#define __NR_getppid 64
+#define __NR_getpgrp 65
+#define __NR_setsid 66
+#define __NR_sigaction 67
+#define __NR_sgetmask 68
+#define __NR_ssetmask 69
+#define __NR_setreuid 70
+#define __NR_setregid 71
+#define __NR_sigsuspend 72
+#define __NR_sigpending 73
+#define __NR_sethostname 74
+#define __NR_setrlimit 75
+#define __NR_getrlimit 76 /* Back compatible 2Gig limited rlimit */
+#define __NR_getrusage 77
+#define __NR_gettimeofday 78
+#define __NR_settimeofday 79
+#define __NR_getgroups 80
+#define __NR_setgroups 81
+#define __NR_select 82
+#define __NR_symlink 83
+#define __NR_oldlstat 84
+#define __NR_readlink 85
+#define __NR_uselib 86
+#define __NR_swapon 87
+#define __NR_reboot 88
+#define __NR_readdir 89
+#define __NR_mmap 90
+#define __NR_munmap 91
+#define __NR_truncate 92
+#define __NR_ftruncate 93
+#define __NR_fchmod 94
+#define __NR_fchown 95
+#define __NR_getpriority 96
+#define __NR_setpriority 97
+#define __NR_profil 98
+#define __NR_statfs 99
+#define __NR_fstatfs 100
+#define __NR_ioperm 101
+#define __NR_socketcall 102
+#define __NR_syslog 103
+#define __NR_setitimer 104
+#define __NR_getitimer 105
+#define __NR_stat 106
+#define __NR_lstat 107
+#define __NR_fstat 108
+#define __NR_olduname 109
+#define __NR_iopl 110
+#define __NR_vhangup 111
+#define __NR_idle 112
+#define __NR_vm86old 113
+#define __NR_wait4 114
+#define __NR_swapoff 115
+#define __NR_sysinfo 116
+#define __NR_ipc 117
+#define __NR_fsync 118
+#define __NR_sigreturn 119
+#define __NR_clone 120
+#define __NR_setdomainname 121
+#define __NR_uname 122
+#define __NR_modify_ldt 123
+#define __NR_adjtimex 124
+#define __NR_mprotect 125
+#define __NR_sigprocmask 126
+#define __NR_create_module 127
+#define __NR_init_module 128
+#define __NR_delete_module 129
+#define __NR_get_kernel_syms 130
+#define __NR_quotactl 131
+#define __NR_getpgid 132
+#define __NR_fchdir 133
+#define __NR_bdflush 134
+#define __NR_sysfs 135
+#define __NR_personality 136
+#define __NR_afs_syscall 137 /* Syscall for Andrew File System */
+#define __NR_setfsuid 138
+#define __NR_setfsgid 139
+#define __NR__llseek 140
+#define __NR_getdents 141
+#define __NR__newselect 142
+#define __NR_flock 143
+#define __NR_msync 144
+#define __NR_readv 145
+#define __NR_writev 146
+#define __NR_getsid 147
+#define __NR_fdatasync 148
+#define __NR__sysctl 149
+#define __NR_mlock 150
+#define __NR_munlock 151
+#define __NR_mlockall 152
+#define __NR_munlockall 153
+#define __NR_sched_setparam 154
+#define __NR_sched_getparam 155
+#define __NR_sched_setscheduler 156
+#define __NR_sched_getscheduler 157
+#define __NR_sched_yield 158
+#define __NR_sched_get_priority_max 159
+#define __NR_sched_get_priority_min 160
+#define __NR_sched_rr_get_interval 161
+#define __NR_nanosleep 162
+#define __NR_mremap 163
+#define __NR_setresuid 164
+#define __NR_getresuid 165
+#define __NR_vm86 166
+#define __NR_query_module 167
+#define __NR_poll 168
+#define __NR_nfsservctl 169
+#define __NR_setresgid 170
+#define __NR_getresgid 171
+#define __NR_prctl 172
+#define __NR_rt_sigreturn 173
+#define __NR_rt_sigaction 174
+#define __NR_rt_sigprocmask 175
+#define __NR_rt_sigpending 176
+#define __NR_rt_sigtimedwait 177
+#define __NR_rt_sigqueueinfo 178
+#define __NR_rt_sigsuspend 179
+#define __NR_pread64 180
+#define __NR_pwrite64 181
+#define __NR_chown 182
+#define __NR_getcwd 183
+#define __NR_capget 184
+#define __NR_capset 185
+#define __NR_sigaltstack 186
+#define __NR_sendfile 187
+#define __NR_getpmsg 188 /* some people actually want streams */
+#define __NR_putpmsg 189 /* some people actually want streams */
+#define __NR_vfork 190
+#define __NR_ugetrlimit 191 /* SuS compliant getrlimit */
+#define __NR_mmap2 192
+#define __NR_truncate64 193
+#define __NR_ftruncate64 194
+#define __NR_stat64 195
+#define __NR_lstat64 196
+#define __NR_fstat64 197
+#define __NR_lchown32 198
+#define __NR_getuid32 199
+#define __NR_getgid32 200
+#define __NR_geteuid32 201
+#define __NR_getegid32 202
+#define __NR_setreuid32 203
+#define __NR_setregid32 204
+#define __NR_getgroups32 205
+#define __NR_setgroups32 206
+#define __NR_fchown32 207
+#define __NR_setresuid32 208
+#define __NR_getresuid32 209
+#define __NR_setresgid32 210
+#define __NR_getresgid32 211
+#define __NR_chown32 212
+#define __NR_setuid32 213
+#define __NR_setgid32 214
+#define __NR_setfsuid32 215
+#define __NR_setfsgid32 216
+#define __NR_pivot_root 217
+#define __NR_mincore 218
+#define __NR_madvise 219
+#define __NR_madvise1 219 /* delete when C lib stub is removed */
+#define __NR_getdents64 220
+#define __NR_fcntl64 221
+/* 223 is unused */
+#define __NR_gettid 224
+#define __NR_readahead 225
+#define __NR_setxattr 226
+#define __NR_lsetxattr 227
+#define __NR_fsetxattr 228
+#define __NR_getxattr 229
+#define __NR_lgetxattr 230
+#define __NR_fgetxattr 231
+#define __NR_listxattr 232
+#define __NR_llistxattr 233
+#define __NR_flistxattr 234
+#define __NR_removexattr 235
+#define __NR_lremovexattr 236
+#define __NR_fremovexattr 237
+#define __NR_tkill 238
+#define __NR_sendfile64 239
+#define __NR_futex 240
+#define __NR_sched_setaffinity 241
+#define __NR_sched_getaffinity 242
+#define __NR_set_thread_area 243
+#define __NR_get_thread_area 244
+#define __NR_io_setup 245
+#define __NR_io_destroy 246
+#define __NR_io_getevents 247
+#define __NR_io_submit 248
+#define __NR_io_cancel 249
+#define __NR_fadvise64 250
+/* 251 is available for reuse (was briefly sys_set_zone_reclaim) */
+#define __NR_exit_group 252
+#define __NR_lookup_dcookie 253
+#define __NR_epoll_create 254
+#define __NR_epoll_ctl 255
+#define __NR_epoll_wait 256
+#define __NR_remap_file_pages 257
+#define __NR_set_tid_address 258
+#define __NR_timer_create 259
+#define __NR_timer_settime (__NR_timer_create+1)
+#define __NR_timer_gettime (__NR_timer_create+2)
+#define __NR_timer_getoverrun (__NR_timer_create+3)
+#define __NR_timer_delete (__NR_timer_create+4)
+#define __NR_clock_settime (__NR_timer_create+5)
+#define __NR_clock_gettime (__NR_timer_create+6)
+#define __NR_clock_getres (__NR_timer_create+7)
+#define __NR_clock_nanosleep (__NR_timer_create+8)
+#define __NR_statfs64 268
+#define __NR_fstatfs64 269
+#define __NR_tgkill 270
+#define __NR_utimes 271
+#define __NR_fadvise64_64 272
+#define __NR_vserver 273
+#define __NR_mbind 274
+#define __NR_get_mempolicy 275
+#define __NR_set_mempolicy 276
+#define __NR_mq_open 277
+#define __NR_mq_unlink (__NR_mq_open+1)
+#define __NR_mq_timedsend (__NR_mq_open+2)
+#define __NR_mq_timedreceive (__NR_mq_open+3)
+#define __NR_mq_notify (__NR_mq_open+4)
+#define __NR_mq_getsetattr (__NR_mq_open+5)
+#define __NR_kexec_load 283
+#define __NR_waitid 284
+/* #define __NR_sys_setaltroot 285 */
+#define __NR_add_key 286
+#define __NR_request_key 287
+#define __NR_keyctl 288
+#define __NR_ioprio_set 289
+#define __NR_ioprio_get 290
+#define __NR_inotify_init 291
+#define __NR_inotify_add_watch 292
+#define __NR_inotify_rm_watch 293
+#define __NR_migrate_pages 294
+#define __NR_openat 295
+#define __NR_mkdirat 296
+#define __NR_mknodat 297
+#define __NR_fchownat 298
+#define __NR_futimesat 299
+#define __NR_fstatat64 300
+#define __NR_unlinkat 301
+#define __NR_renameat 302
+#define __NR_linkat 303
+#define __NR_symlinkat 304
+#define __NR_readlinkat 305
+#define __NR_fchmodat 306
+#define __NR_faccessat 307
+#define __NR_pselect6 308
+#define __NR_ppoll 309
+#define __NR_unshare 310
+#define __NR_set_robust_list 311
+#define __NR_get_robust_list 312
+#define __NR_splice 313
+#define __NR_sync_file_range 314
+#define __NR_tee 315
+#define __NR_vmsplice 316
+#define __NR_move_pages 317
+#define __NR_getcpu 318
+#define __NR_epoll_pwait 319
+#define __NR_utimensat 320
+#define __NR_signalfd 321
+#define __NR_timerfd 322
+#define __NR_eventfd 323
+#define __NR_fallocate 324
+
+#endif /* _ASM_I386_UNISTD_H_ */
diff --git a/sysroot/usr/include/asm/unistd_64.h b/sysroot/usr/include/asm/unistd_64.h
new file mode 100644
index 0000000..4ee620a
--- /dev/null
+++ b/sysroot/usr/include/asm/unistd_64.h
@@ -0,0 +1,665 @@
+#ifndef _ASM_X86_64_UNISTD_H_
+#define _ASM_X86_64_UNISTD_H_
+
+#ifndef __SYSCALL
+#define __SYSCALL(a,b)
+#endif
+
+/*
+ * This file contains the system call numbers.
+ *
+ * Note: holes are not allowed.
+ */
+
+/* at least 8 syscall per cacheline */
+#define __NR_read 0
+__SYSCALL(__NR_read, sys_read)
+#define __NR_write 1
+__SYSCALL(__NR_write, sys_write)
+#define __NR_open 2
+__SYSCALL(__NR_open, sys_open)
+#define __NR_close 3
+__SYSCALL(__NR_close, sys_close)
+#define __NR_stat 4
+__SYSCALL(__NR_stat, sys_newstat)
+#define __NR_fstat 5
+__SYSCALL(__NR_fstat, sys_newfstat)
+#define __NR_lstat 6
+__SYSCALL(__NR_lstat, sys_newlstat)
+#define __NR_poll 7
+__SYSCALL(__NR_poll, sys_poll)
+
+#define __NR_lseek 8
+__SYSCALL(__NR_lseek, sys_lseek)
+#define __NR_mmap 9
+__SYSCALL(__NR_mmap, sys_mmap)
+#define __NR_mprotect 10
+__SYSCALL(__NR_mprotect, sys_mprotect)
+#define __NR_munmap 11
+__SYSCALL(__NR_munmap, sys_munmap)
+#define __NR_brk 12
+__SYSCALL(__NR_brk, sys_brk)
+#define __NR_rt_sigaction 13
+__SYSCALL(__NR_rt_sigaction, sys_rt_sigaction)
+#define __NR_rt_sigprocmask 14
+__SYSCALL(__NR_rt_sigprocmask, sys_rt_sigprocmask)
+#define __NR_rt_sigreturn 15
+__SYSCALL(__NR_rt_sigreturn, stub_rt_sigreturn)
+
+#define __NR_ioctl 16
+__SYSCALL(__NR_ioctl, sys_ioctl)
+#define __NR_pread64 17
+__SYSCALL(__NR_pread64, sys_pread64)
+#define __NR_pwrite64 18
+__SYSCALL(__NR_pwrite64, sys_pwrite64)
+#define __NR_readv 19
+__SYSCALL(__NR_readv, sys_readv)
+#define __NR_writev 20
+__SYSCALL(__NR_writev, sys_writev)
+#define __NR_access 21
+__SYSCALL(__NR_access, sys_access)
+#define __NR_pipe 22
+__SYSCALL(__NR_pipe, sys_pipe)
+#define __NR_select 23
+__SYSCALL(__NR_select, sys_select)
+
+#define __NR_sched_yield 24
+__SYSCALL(__NR_sched_yield, sys_sched_yield)
+#define __NR_mremap 25
+__SYSCALL(__NR_mremap, sys_mremap)
+#define __NR_msync 26
+__SYSCALL(__NR_msync, sys_msync)
+#define __NR_mincore 27
+__SYSCALL(__NR_mincore, sys_mincore)
+#define __NR_madvise 28
+__SYSCALL(__NR_madvise, sys_madvise)
+#define __NR_shmget 29
+__SYSCALL(__NR_shmget, sys_shmget)
+#define __NR_shmat 30
+__SYSCALL(__NR_shmat, sys_shmat)
+#define __NR_shmctl 31
+__SYSCALL(__NR_shmctl, sys_shmctl)
+
+#define __NR_dup 32
+__SYSCALL(__NR_dup, sys_dup)
+#define __NR_dup2 33
+__SYSCALL(__NR_dup2, sys_dup2)
+#define __NR_pause 34
+__SYSCALL(__NR_pause, sys_pause)
+#define __NR_nanosleep 35
+__SYSCALL(__NR_nanosleep, sys_nanosleep)
+#define __NR_getitimer 36
+__SYSCALL(__NR_getitimer, sys_getitimer)
+#define __NR_alarm 37
+__SYSCALL(__NR_alarm, sys_alarm)
+#define __NR_setitimer 38
+__SYSCALL(__NR_setitimer, sys_setitimer)
+#define __NR_getpid 39
+__SYSCALL(__NR_getpid, sys_getpid)
+
+#define __NR_sendfile 40
+__SYSCALL(__NR_sendfile, sys_sendfile64)
+#define __NR_socket 41
+__SYSCALL(__NR_socket, sys_socket)
+#define __NR_connect 42
+__SYSCALL(__NR_connect, sys_connect)
+#define __NR_accept 43
+__SYSCALL(__NR_accept, sys_accept)
+#define __NR_sendto 44
+__SYSCALL(__NR_sendto, sys_sendto)
+#define __NR_recvfrom 45
+__SYSCALL(__NR_recvfrom, sys_recvfrom)
+#define __NR_sendmsg 46
+__SYSCALL(__NR_sendmsg, sys_sendmsg)
+#define __NR_recvmsg 47
+__SYSCALL(__NR_recvmsg, sys_recvmsg)
+
+#define __NR_shutdown 48
+__SYSCALL(__NR_shutdown, sys_shutdown)
+#define __NR_bind 49
+__SYSCALL(__NR_bind, sys_bind)
+#define __NR_listen 50
+__SYSCALL(__NR_listen, sys_listen)
+#define __NR_getsockname 51
+__SYSCALL(__NR_getsockname, sys_getsockname)
+#define __NR_getpeername 52
+__SYSCALL(__NR_getpeername, sys_getpeername)
+#define __NR_socketpair 53
+__SYSCALL(__NR_socketpair, sys_socketpair)
+#define __NR_setsockopt 54
+__SYSCALL(__NR_setsockopt, sys_setsockopt)
+#define __NR_getsockopt 55
+__SYSCALL(__NR_getsockopt, sys_getsockopt)
+
+#define __NR_clone 56
+__SYSCALL(__NR_clone, stub_clone)
+#define __NR_fork 57
+__SYSCALL(__NR_fork, stub_fork)
+#define __NR_vfork 58
+__SYSCALL(__NR_vfork, stub_vfork)
+#define __NR_execve 59
+__SYSCALL(__NR_execve, stub_execve)
+#define __NR_exit 60
+__SYSCALL(__NR_exit, sys_exit)
+#define __NR_wait4 61
+__SYSCALL(__NR_wait4, sys_wait4)
+#define __NR_kill 62
+__SYSCALL(__NR_kill, sys_kill)
+#define __NR_uname 63
+__SYSCALL(__NR_uname, sys_uname)
+
+#define __NR_semget 64
+__SYSCALL(__NR_semget, sys_semget)
+#define __NR_semop 65
+__SYSCALL(__NR_semop, sys_semop)
+#define __NR_semctl 66
+__SYSCALL(__NR_semctl, sys_semctl)
+#define __NR_shmdt 67
+__SYSCALL(__NR_shmdt, sys_shmdt)
+#define __NR_msgget 68
+__SYSCALL(__NR_msgget, sys_msgget)
+#define __NR_msgsnd 69
+__SYSCALL(__NR_msgsnd, sys_msgsnd)
+#define __NR_msgrcv 70
+__SYSCALL(__NR_msgrcv, sys_msgrcv)
+#define __NR_msgctl 71
+__SYSCALL(__NR_msgctl, sys_msgctl)
+
+#define __NR_fcntl 72
+__SYSCALL(__NR_fcntl, sys_fcntl)
+#define __NR_flock 73
+__SYSCALL(__NR_flock, sys_flock)
+#define __NR_fsync 74
+__SYSCALL(__NR_fsync, sys_fsync)
+#define __NR_fdatasync 75
+__SYSCALL(__NR_fdatasync, sys_fdatasync)
+#define __NR_truncate 76
+__SYSCALL(__NR_truncate, sys_truncate)
+#define __NR_ftruncate 77
+__SYSCALL(__NR_ftruncate, sys_ftruncate)
+#define __NR_getdents 78
+__SYSCALL(__NR_getdents, sys_getdents)
+#define __NR_getcwd 79
+__SYSCALL(__NR_getcwd, sys_getcwd)
+
+#define __NR_chdir 80
+__SYSCALL(__NR_chdir, sys_chdir)
+#define __NR_fchdir 81
+__SYSCALL(__NR_fchdir, sys_fchdir)
+#define __NR_rename 82
+__SYSCALL(__NR_rename, sys_rename)
+#define __NR_mkdir 83
+__SYSCALL(__NR_mkdir, sys_mkdir)
+#define __NR_rmdir 84
+__SYSCALL(__NR_rmdir, sys_rmdir)
+#define __NR_creat 85
+__SYSCALL(__NR_creat, sys_creat)
+#define __NR_link 86
+__SYSCALL(__NR_link, sys_link)
+#define __NR_unlink 87
+__SYSCALL(__NR_unlink, sys_unlink)
+
+#define __NR_symlink 88
+__SYSCALL(__NR_symlink, sys_symlink)
+#define __NR_readlink 89
+__SYSCALL(__NR_readlink, sys_readlink)
+#define __NR_chmod 90
+__SYSCALL(__NR_chmod, sys_chmod)
+#define __NR_fchmod 91
+__SYSCALL(__NR_fchmod, sys_fchmod)
+#define __NR_chown 92
+__SYSCALL(__NR_chown, sys_chown)
+#define __NR_fchown 93
+__SYSCALL(__NR_fchown, sys_fchown)
+#define __NR_lchown 94
+__SYSCALL(__NR_lchown, sys_lchown)
+#define __NR_umask 95
+__SYSCALL(__NR_umask, sys_umask)
+
+#define __NR_gettimeofday 96
+__SYSCALL(__NR_gettimeofday, sys_gettimeofday)
+#define __NR_getrlimit 97
+__SYSCALL(__NR_getrlimit, sys_getrlimit)
+#define __NR_getrusage 98
+__SYSCALL(__NR_getrusage, sys_getrusage)
+#define __NR_sysinfo 99
+__SYSCALL(__NR_sysinfo, sys_sysinfo)
+#define __NR_times 100
+__SYSCALL(__NR_times, sys_times)
+#define __NR_ptrace 101
+__SYSCALL(__NR_ptrace, sys_ptrace)
+#define __NR_getuid 102
+__SYSCALL(__NR_getuid, sys_getuid)
+#define __NR_syslog 103
+__SYSCALL(__NR_syslog, sys_syslog)
+
+/* at the very end the stuff that never runs during the benchmarks */
+#define __NR_getgid 104
+__SYSCALL(__NR_getgid, sys_getgid)
+#define __NR_setuid 105
+__SYSCALL(__NR_setuid, sys_setuid)
+#define __NR_setgid 106
+__SYSCALL(__NR_setgid, sys_setgid)
+#define __NR_geteuid 107
+__SYSCALL(__NR_geteuid, sys_geteuid)
+#define __NR_getegid 108
+__SYSCALL(__NR_getegid, sys_getegid)
+#define __NR_setpgid 109
+__SYSCALL(__NR_setpgid, sys_setpgid)
+#define __NR_getppid 110
+__SYSCALL(__NR_getppid, sys_getppid)
+#define __NR_getpgrp 111
+__SYSCALL(__NR_getpgrp, sys_getpgrp)
+
+#define __NR_setsid 112
+__SYSCALL(__NR_setsid, sys_setsid)
+#define __NR_setreuid 113
+__SYSCALL(__NR_setreuid, sys_setreuid)
+#define __NR_setregid 114
+__SYSCALL(__NR_setregid, sys_setregid)
+#define __NR_getgroups 115
+__SYSCALL(__NR_getgroups, sys_getgroups)
+#define __NR_setgroups 116
+__SYSCALL(__NR_setgroups, sys_setgroups)
+#define __NR_setresuid 117
+__SYSCALL(__NR_setresuid, sys_setresuid)
+#define __NR_getresuid 118
+__SYSCALL(__NR_getresuid, sys_getresuid)
+#define __NR_setresgid 119
+__SYSCALL(__NR_setresgid, sys_setresgid)
+
+#define __NR_getresgid 120
+__SYSCALL(__NR_getresgid, sys_getresgid)
+#define __NR_getpgid 121
+__SYSCALL(__NR_getpgid, sys_getpgid)
+#define __NR_setfsuid 122
+__SYSCALL(__NR_setfsuid, sys_setfsuid)
+#define __NR_setfsgid 123
+__SYSCALL(__NR_setfsgid, sys_setfsgid)
+#define __NR_getsid 124
+__SYSCALL(__NR_getsid, sys_getsid)
+#define __NR_capget 125
+__SYSCALL(__NR_capget, sys_capget)
+#define __NR_capset 126
+__SYSCALL(__NR_capset, sys_capset)
+
+#define __NR_rt_sigpending 127
+__SYSCALL(__NR_rt_sigpending, sys_rt_sigpending)
+#define __NR_rt_sigtimedwait 128
+__SYSCALL(__NR_rt_sigtimedwait, sys_rt_sigtimedwait)
+#define __NR_rt_sigqueueinfo 129
+__SYSCALL(__NR_rt_sigqueueinfo, sys_rt_sigqueueinfo)
+#define __NR_rt_sigsuspend 130
+__SYSCALL(__NR_rt_sigsuspend, stub_rt_sigsuspend)
+#define __NR_sigaltstack 131
+__SYSCALL(__NR_sigaltstack, stub_sigaltstack)
+#define __NR_utime 132
+__SYSCALL(__NR_utime, sys_utime)
+#define __NR_mknod 133
+__SYSCALL(__NR_mknod, sys_mknod)
+
+/* Only needed for a.out */
+#define __NR_uselib 134
+__SYSCALL(__NR_uselib, sys_ni_syscall)
+#define __NR_personality 135
+__SYSCALL(__NR_personality, sys_personality)
+
+#define __NR_ustat 136
+__SYSCALL(__NR_ustat, sys_ustat)
+#define __NR_statfs 137
+__SYSCALL(__NR_statfs, sys_statfs)
+#define __NR_fstatfs 138
+__SYSCALL(__NR_fstatfs, sys_fstatfs)
+#define __NR_sysfs 139
+__SYSCALL(__NR_sysfs, sys_sysfs)
+
+#define __NR_getpriority 140
+__SYSCALL(__NR_getpriority, sys_getpriority)
+#define __NR_setpriority 141
+__SYSCALL(__NR_setpriority, sys_setpriority)
+#define __NR_sched_setparam 142
+__SYSCALL(__NR_sched_setparam, sys_sched_setparam)
+#define __NR_sched_getparam 143
+__SYSCALL(__NR_sched_getparam, sys_sched_getparam)
+#define __NR_sched_setscheduler 144
+__SYSCALL(__NR_sched_setscheduler, sys_sched_setscheduler)
+#define __NR_sched_getscheduler 145
+__SYSCALL(__NR_sched_getscheduler, sys_sched_getscheduler)
+#define __NR_sched_get_priority_max 146
+__SYSCALL(__NR_sched_get_priority_max, sys_sched_get_priority_max)
+#define __NR_sched_get_priority_min 147
+__SYSCALL(__NR_sched_get_priority_min, sys_sched_get_priority_min)
+#define __NR_sched_rr_get_interval 148
+__SYSCALL(__NR_sched_rr_get_interval, sys_sched_rr_get_interval)
+
+#define __NR_mlock 149
+__SYSCALL(__NR_mlock, sys_mlock)
+#define __NR_munlock 150
+__SYSCALL(__NR_munlock, sys_munlock)
+#define __NR_mlockall 151
+__SYSCALL(__NR_mlockall, sys_mlockall)
+#define __NR_munlockall 152
+__SYSCALL(__NR_munlockall, sys_munlockall)
+
+#define __NR_vhangup 153
+__SYSCALL(__NR_vhangup, sys_vhangup)
+
+#define __NR_modify_ldt 154
+__SYSCALL(__NR_modify_ldt, sys_modify_ldt)
+
+#define __NR_pivot_root 155
+__SYSCALL(__NR_pivot_root, sys_pivot_root)
+
+#define __NR__sysctl 156
+__SYSCALL(__NR__sysctl, sys_sysctl)
+
+#define __NR_prctl 157
+__SYSCALL(__NR_prctl, sys_prctl)
+#define __NR_arch_prctl 158
+__SYSCALL(__NR_arch_prctl, sys_arch_prctl)
+
+#define __NR_adjtimex 159
+__SYSCALL(__NR_adjtimex, sys_adjtimex)
+
+#define __NR_setrlimit 160
+__SYSCALL(__NR_setrlimit, sys_setrlimit)
+
+#define __NR_chroot 161
+__SYSCALL(__NR_chroot, sys_chroot)
+
+#define __NR_sync 162
+__SYSCALL(__NR_sync, sys_sync)
+
+#define __NR_acct 163
+__SYSCALL(__NR_acct, sys_acct)
+
+#define __NR_settimeofday 164
+__SYSCALL(__NR_settimeofday, sys_settimeofday)
+
+#define __NR_mount 165
+__SYSCALL(__NR_mount, sys_mount)
+#define __NR_umount2 166
+__SYSCALL(__NR_umount2, sys_umount)
+
+#define __NR_swapon 167
+__SYSCALL(__NR_swapon, sys_swapon)
+#define __NR_swapoff 168
+__SYSCALL(__NR_swapoff, sys_swapoff)
+
+#define __NR_reboot 169
+__SYSCALL(__NR_reboot, sys_reboot)
+
+#define __NR_sethostname 170
+__SYSCALL(__NR_sethostname, sys_sethostname)
+#define __NR_setdomainname 171
+__SYSCALL(__NR_setdomainname, sys_setdomainname)
+
+#define __NR_iopl 172
+__SYSCALL(__NR_iopl, stub_iopl)
+#define __NR_ioperm 173
+__SYSCALL(__NR_ioperm, sys_ioperm)
+
+#define __NR_create_module 174
+__SYSCALL(__NR_create_module, sys_ni_syscall)
+#define __NR_init_module 175
+__SYSCALL(__NR_init_module, sys_init_module)
+#define __NR_delete_module 176
+__SYSCALL(__NR_delete_module, sys_delete_module)
+#define __NR_get_kernel_syms 177
+__SYSCALL(__NR_get_kernel_syms, sys_ni_syscall)
+#define __NR_query_module 178
+__SYSCALL(__NR_query_module, sys_ni_syscall)
+
+#define __NR_quotactl 179
+__SYSCALL(__NR_quotactl, sys_quotactl)
+
+#define __NR_nfsservctl 180
+__SYSCALL(__NR_nfsservctl, sys_nfsservctl)
+
+/* reserved for LiS/STREAMS */
+#define __NR_getpmsg 181
+__SYSCALL(__NR_getpmsg, sys_ni_syscall)
+#define __NR_putpmsg 182
+__SYSCALL(__NR_putpmsg, sys_ni_syscall)
+
+/* reserved for AFS */
+#define __NR_afs_syscall 183
+__SYSCALL(__NR_afs_syscall, sys_ni_syscall)
+
+/* reserved for tux */
+#define __NR_tuxcall 184
+__SYSCALL(__NR_tuxcall, sys_ni_syscall)
+
+#define __NR_security 185
+__SYSCALL(__NR_security, sys_ni_syscall)
+
+#define __NR_gettid 186
+__SYSCALL(__NR_gettid, sys_gettid)
+
+#define __NR_readahead 187
+__SYSCALL(__NR_readahead, sys_readahead)
+#define __NR_setxattr 188
+__SYSCALL(__NR_setxattr, sys_setxattr)
+#define __NR_lsetxattr 189
+__SYSCALL(__NR_lsetxattr, sys_lsetxattr)
+#define __NR_fsetxattr 190
+__SYSCALL(__NR_fsetxattr, sys_fsetxattr)
+#define __NR_getxattr 191
+__SYSCALL(__NR_getxattr, sys_getxattr)
+#define __NR_lgetxattr 192
+__SYSCALL(__NR_lgetxattr, sys_lgetxattr)
+#define __NR_fgetxattr 193
+__SYSCALL(__NR_fgetxattr, sys_fgetxattr)
+#define __NR_listxattr 194
+__SYSCALL(__NR_listxattr, sys_listxattr)
+#define __NR_llistxattr 195
+__SYSCALL(__NR_llistxattr, sys_llistxattr)
+#define __NR_flistxattr 196
+__SYSCALL(__NR_flistxattr, sys_flistxattr)
+#define __NR_removexattr 197
+__SYSCALL(__NR_removexattr, sys_removexattr)
+#define __NR_lremovexattr 198
+__SYSCALL(__NR_lremovexattr, sys_lremovexattr)
+#define __NR_fremovexattr 199
+__SYSCALL(__NR_fremovexattr, sys_fremovexattr)
+#define __NR_tkill 200
+__SYSCALL(__NR_tkill, sys_tkill)
+#define __NR_time 201
+__SYSCALL(__NR_time, sys_time)
+#define __NR_futex 202
+__SYSCALL(__NR_futex, sys_futex)
+#define __NR_sched_setaffinity 203
+__SYSCALL(__NR_sched_setaffinity, sys_sched_setaffinity)
+#define __NR_sched_getaffinity 204
+__SYSCALL(__NR_sched_getaffinity, sys_sched_getaffinity)
+#define __NR_set_thread_area 205
+__SYSCALL(__NR_set_thread_area, sys_ni_syscall) /* use arch_prctl */
+#define __NR_io_setup 206
+__SYSCALL(__NR_io_setup, sys_io_setup)
+#define __NR_io_destroy 207
+__SYSCALL(__NR_io_destroy, sys_io_destroy)
+#define __NR_io_getevents 208
+__SYSCALL(__NR_io_getevents, sys_io_getevents)
+#define __NR_io_submit 209
+__SYSCALL(__NR_io_submit, sys_io_submit)
+#define __NR_io_cancel 210
+__SYSCALL(__NR_io_cancel, sys_io_cancel)
+#define __NR_get_thread_area 211
+__SYSCALL(__NR_get_thread_area, sys_ni_syscall) /* use arch_prctl */
+#define __NR_lookup_dcookie 212
+__SYSCALL(__NR_lookup_dcookie, sys_lookup_dcookie)
+#define __NR_epoll_create 213
+__SYSCALL(__NR_epoll_create, sys_epoll_create)
+#define __NR_epoll_ctl_old 214
+__SYSCALL(__NR_epoll_ctl_old, sys_ni_syscall)
+#define __NR_epoll_wait_old 215
+__SYSCALL(__NR_epoll_wait_old, sys_ni_syscall)
+#define __NR_remap_file_pages 216
+__SYSCALL(__NR_remap_file_pages, sys_remap_file_pages)
+#define __NR_getdents64 217
+__SYSCALL(__NR_getdents64, sys_getdents64)
+#define __NR_set_tid_address 218
+__SYSCALL(__NR_set_tid_address, sys_set_tid_address)
+#define __NR_restart_syscall 219
+__SYSCALL(__NR_restart_syscall, sys_restart_syscall)
+#define __NR_semtimedop 220
+__SYSCALL(__NR_semtimedop, sys_semtimedop)
+#define __NR_fadvise64 221
+__SYSCALL(__NR_fadvise64, sys_fadvise64)
+#define __NR_timer_create 222
+__SYSCALL(__NR_timer_create, sys_timer_create)
+#define __NR_timer_settime 223
+__SYSCALL(__NR_timer_settime, sys_timer_settime)
+#define __NR_timer_gettime 224
+__SYSCALL(__NR_timer_gettime, sys_timer_gettime)
+#define __NR_timer_getoverrun 225
+__SYSCALL(__NR_timer_getoverrun, sys_timer_getoverrun)
+#define __NR_timer_delete 226
+__SYSCALL(__NR_timer_delete, sys_timer_delete)
+#define __NR_clock_settime 227
+__SYSCALL(__NR_clock_settime, sys_clock_settime)
+#define __NR_clock_gettime 228
+__SYSCALL(__NR_clock_gettime, sys_clock_gettime)
+#define __NR_clock_getres 229
+__SYSCALL(__NR_clock_getres, sys_clock_getres)
+#define __NR_clock_nanosleep 230
+__SYSCALL(__NR_clock_nanosleep, sys_clock_nanosleep)
+#define __NR_exit_group 231
+__SYSCALL(__NR_exit_group, sys_exit_group)
+#define __NR_epoll_wait 232
+__SYSCALL(__NR_epoll_wait, sys_epoll_wait)
+#define __NR_epoll_ctl 233
+__SYSCALL(__NR_epoll_ctl, sys_epoll_ctl)
+#define __NR_tgkill 234
+__SYSCALL(__NR_tgkill, sys_tgkill)
+#define __NR_utimes 235
+__SYSCALL(__NR_utimes, sys_utimes)
+#define __NR_vserver 236
+__SYSCALL(__NR_vserver, sys_ni_syscall)
+#define __NR_mbind 237
+__SYSCALL(__NR_mbind, sys_mbind)
+#define __NR_set_mempolicy 238
+__SYSCALL(__NR_set_mempolicy, sys_set_mempolicy)
+#define __NR_get_mempolicy 239
+__SYSCALL(__NR_get_mempolicy, sys_get_mempolicy)
+#define __NR_mq_open 240
+__SYSCALL(__NR_mq_open, sys_mq_open)
+#define __NR_mq_unlink 241
+__SYSCALL(__NR_mq_unlink, sys_mq_unlink)
+#define __NR_mq_timedsend 242
+__SYSCALL(__NR_mq_timedsend, sys_mq_timedsend)
+#define __NR_mq_timedreceive 243
+__SYSCALL(__NR_mq_timedreceive, sys_mq_timedreceive)
+#define __NR_mq_notify 244
+__SYSCALL(__NR_mq_notify, sys_mq_notify)
+#define __NR_mq_getsetattr 245
+__SYSCALL(__NR_mq_getsetattr, sys_mq_getsetattr)
+#define __NR_kexec_load 246
+__SYSCALL(__NR_kexec_load, sys_kexec_load)
+#define __NR_waitid 247
+__SYSCALL(__NR_waitid, sys_waitid)
+#define __NR_add_key 248
+__SYSCALL(__NR_add_key, sys_add_key)
+#define __NR_request_key 249
+__SYSCALL(__NR_request_key, sys_request_key)
+#define __NR_keyctl 250
+__SYSCALL(__NR_keyctl, sys_keyctl)
+#define __NR_ioprio_set 251
+__SYSCALL(__NR_ioprio_set, sys_ioprio_set)
+#define __NR_ioprio_get 252
+__SYSCALL(__NR_ioprio_get, sys_ioprio_get)
+#define __NR_inotify_init 253
+__SYSCALL(__NR_inotify_init, sys_inotify_init)
+#define __NR_inotify_add_watch 254
+__SYSCALL(__NR_inotify_add_watch, sys_inotify_add_watch)
+#define __NR_inotify_rm_watch 255
+__SYSCALL(__NR_inotify_rm_watch, sys_inotify_rm_watch)
+#define __NR_migrate_pages 256
+__SYSCALL(__NR_migrate_pages, sys_migrate_pages)
+#define __NR_openat 257
+__SYSCALL(__NR_openat, sys_openat)
+#define __NR_mkdirat 258
+__SYSCALL(__NR_mkdirat, sys_mkdirat)
+#define __NR_mknodat 259
+__SYSCALL(__NR_mknodat, sys_mknodat)
+#define __NR_fchownat 260
+__SYSCALL(__NR_fchownat, sys_fchownat)
+#define __NR_futimesat 261
+__SYSCALL(__NR_futimesat, sys_futimesat)
+#define __NR_newfstatat 262
+__SYSCALL(__NR_newfstatat, sys_newfstatat)
+#define __NR_unlinkat 263
+__SYSCALL(__NR_unlinkat, sys_unlinkat)
+#define __NR_renameat 264
+__SYSCALL(__NR_renameat, sys_renameat)
+#define __NR_linkat 265
+__SYSCALL(__NR_linkat, sys_linkat)
+#define __NR_symlinkat 266
+__SYSCALL(__NR_symlinkat, sys_symlinkat)
+#define __NR_readlinkat 267
+__SYSCALL(__NR_readlinkat, sys_readlinkat)
+#define __NR_fchmodat 268
+__SYSCALL(__NR_fchmodat, sys_fchmodat)
+#define __NR_faccessat 269
+__SYSCALL(__NR_faccessat, sys_faccessat)
+#define __NR_pselect6 270
+__SYSCALL(__NR_pselect6, sys_pselect6)
+#define __NR_ppoll 271
+__SYSCALL(__NR_ppoll, sys_ppoll)
+#define __NR_unshare 272
+__SYSCALL(__NR_unshare, sys_unshare)
+#define __NR_set_robust_list 273
+__SYSCALL(__NR_set_robust_list, sys_set_robust_list)
+#define __NR_get_robust_list 274
+__SYSCALL(__NR_get_robust_list, sys_get_robust_list)
+#define __NR_splice 275
+__SYSCALL(__NR_splice, sys_splice)
+#define __NR_tee 276
+__SYSCALL(__NR_tee, sys_tee)
+#define __NR_sync_file_range 277
+__SYSCALL(__NR_sync_file_range, sys_sync_file_range)
+#define __NR_vmsplice 278
+__SYSCALL(__NR_vmsplice, sys_vmsplice)
+#define __NR_move_pages 279
+__SYSCALL(__NR_move_pages, sys_move_pages)
+#define __NR_utimensat 280
+__SYSCALL(__NR_utimensat, sys_utimensat)
+#define __IGNORE_getcpu /* implemented as a vsyscall */
+#define __NR_epoll_pwait 281
+__SYSCALL(__NR_epoll_pwait, sys_epoll_pwait)
+#define __NR_signalfd 282
+__SYSCALL(__NR_signalfd, sys_signalfd)
+#define __NR_timerfd 283
+__SYSCALL(__NR_timerfd, sys_timerfd)
+#define __NR_eventfd 284
+__SYSCALL(__NR_eventfd, sys_eventfd)
+#define __NR_fallocate 285
+__SYSCALL(__NR_fallocate, sys_fallocate)
+
+#ifndef __NO_STUBS
+#define __ARCH_WANT_OLD_READDIR
+#define __ARCH_WANT_OLD_STAT
+#define __ARCH_WANT_SYS_ALARM
+#define __ARCH_WANT_SYS_GETHOSTNAME
+#define __ARCH_WANT_SYS_PAUSE
+#define __ARCH_WANT_SYS_SGETMASK
+#define __ARCH_WANT_SYS_SIGNAL
+#define __ARCH_WANT_SYS_UTIME
+#define __ARCH_WANT_SYS_WAITPID
+#define __ARCH_WANT_SYS_SOCKETCALL
+#define __ARCH_WANT_SYS_FADVISE64
+#define __ARCH_WANT_SYS_GETPGRP
+#define __ARCH_WANT_SYS_LLSEEK
+#define __ARCH_WANT_SYS_NICE
+#define __ARCH_WANT_SYS_OLD_GETRLIMIT
+#define __ARCH_WANT_SYS_OLDUMOUNT
+#define __ARCH_WANT_SYS_SIGPENDING
+#define __ARCH_WANT_SYS_SIGPROCMASK
+#define __ARCH_WANT_SYS_RT_SIGACTION
+#define __ARCH_WANT_SYS_RT_SIGSUSPEND
+#define __ARCH_WANT_SYS_TIME
+#define __ARCH_WANT_COMPAT_SYS_TIME
+#endif /* __NO_STUBS */
+
+
+#endif /* _ASM_X86_64_UNISTD_H_ */
diff --git a/sysroot/usr/include/asm/user.h b/sysroot/usr/include/asm/user.h
new file mode 100644
index 0000000..b3c959c
--- /dev/null
+++ b/sysroot/usr/include/asm/user.h
@@ -0,0 +1,5 @@
+# ifdef __i386__
+# include "user_32.h"
+# else
+# include "user_64.h"
+# endif
diff --git a/sysroot/usr/include/asm/user_32.h b/sysroot/usr/include/asm/user_32.h
new file mode 100644
index 0000000..0e85d2a
--- /dev/null
+++ b/sysroot/usr/include/asm/user_32.h
@@ -0,0 +1,121 @@
+#ifndef _I386_USER_H
+#define _I386_USER_H
+
+#include <asm/page.h>
+/* Core file format: The core file is written in such a way that gdb
+ can understand it and provide useful information to the user (under
+ linux we use the 'trad-core' bfd). There are quite a number of
+ obstacles to being able to view the contents of the floating point
+ registers, and until these are solved you will not be able to view the
+ contents of them. Actually, you can read in the core file and look at
+ the contents of the user struct to find out what the floating point
+ registers contain.
+ The actual file contents are as follows:
+ UPAGE: 1 page consisting of a user struct that tells gdb what is present
+ in the file. Directly after this is a copy of the task_struct, which
+ is currently not used by gdb, but it may come in useful at some point.
+ All of the registers are stored as part of the upage. The upage should
+ always be only one page.
+ DATA: The data area is stored. We use current->end_text to
+ current->brk to pick up all of the user variables, plus any memory
+ that may have been malloced. No attempt is made to determine if a page
+ is demand-zero or if a page is totally unused, we just cover the entire
+ range. All of the addresses are rounded in such a way that an integral
+ number of pages is written.
+ STACK: We need the stack information in order to get a meaningful
+ backtrace. We need to write the data from (esp) to
+ current->start_stack, so we round each of these off in order to be able
+ to write an integer number of pages.
+ The minimum core file size is 3 pages, or 12288 bytes.
+*/
+
+/*
+ * Pentium III FXSR, SSE support
+ * Gareth Hughes <gareth@valinux.com>, May 2000
+ *
+ * Provide support for the GDB 5.0+ PTRACE_{GET|SET}FPXREGS requests for
+ * interacting with the FXSR-format floating point environment. Floating
+ * point data can be accessed in the regular format in the usual manner,
+ * and both the standard and SIMD floating point data can be accessed via
+ * the new ptrace requests. In either case, changes to the FPU environment
+ * will be reflected in the task's state as expected.
+ */
+
+struct user_i387_struct {
+ long cwd;
+ long swd;
+ long twd;
+ long fip;
+ long fcs;
+ long foo;
+ long fos;
+ long st_space[20]; /* 8*10 bytes for each FP-reg = 80 bytes */
+};
+
+struct user_fxsr_struct {
+ unsigned short cwd;
+ unsigned short swd;
+ unsigned short twd;
+ unsigned short fop;
+ long fip;
+ long fcs;
+ long foo;
+ long fos;
+ long mxcsr;
+ long reserved;
+ long st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */
+ long xmm_space[32]; /* 8*16 bytes for each XMM-reg = 128 bytes */
+ long padding[56];
+};
+
+/*
+ * This is the old layout of "struct pt_regs", and
+ * is still the layout used by user mode (the new
+ * pt_regs doesn't have all registers as the kernel
+ * doesn't use the extra segment registers)
+ */
+struct user_regs_struct {
+ long ebx, ecx, edx, esi, edi, ebp, eax;
+ unsigned short ds, __ds, es, __es;
+ unsigned short fs, __fs, gs, __gs;
+ long orig_eax, eip;
+ unsigned short cs, __cs;
+ long eflags, esp;
+ unsigned short ss, __ss;
+};
+
+/* When the kernel dumps core, it starts by dumping the user struct -
+ this will be used by gdb to figure out where the data and stack segments
+ are within the file, and what virtual addresses to use. */
+struct user{
+/* We start with the registers, to mimic the way that "memory" is returned
+ from the ptrace(3,...) function. */
+ struct user_regs_struct regs; /* Where the registers are actually stored */
+/* ptrace does not yet supply these. Someday.... */
+ int u_fpvalid; /* True if math co-processor being used. */
+ /* for this mess. Not yet used. */
+ struct user_i387_struct i387; /* Math Co-processor registers. */
+/* The rest of this junk is to help gdb figure out what goes where */
+ unsigned long int u_tsize; /* Text segment size (pages). */
+ unsigned long int u_dsize; /* Data segment size (pages). */
+ unsigned long int u_ssize; /* Stack segment size (pages). */
+ unsigned long start_code; /* Starting virtual address of text. */
+ unsigned long start_stack; /* Starting virtual address of stack area.
+ This is actually the bottom of the stack,
+ the top of the stack is always found in the
+ esp register. */
+ long int signal; /* Signal that caused the core dump. */
+ int reserved; /* No longer used */
+ struct user_pt_regs * u_ar0; /* Used by gdb to help find the values for */
+ /* the registers. */
+ struct user_i387_struct* u_fpstate; /* Math Co-processor pointer. */
+ unsigned long magic; /* To uniquely identify a core file */
+ char u_comm[32]; /* User command that was responsible */
+ int u_debugreg[8];
+};
+#define NBPG PAGE_SIZE
+#define UPAGES 1
+#define HOST_TEXT_START_ADDR (u.start_code)
+#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
+
+#endif /* _I386_USER_H */
diff --git a/sysroot/usr/include/asm/user_64.h b/sysroot/usr/include/asm/user_64.h
new file mode 100644
index 0000000..12785c6
--- /dev/null
+++ b/sysroot/usr/include/asm/user_64.h
@@ -0,0 +1,114 @@
+#ifndef _X86_64_USER_H
+#define _X86_64_USER_H
+
+#include <asm/types.h>
+#include <asm/page.h>
+/* Core file format: The core file is written in such a way that gdb
+ can understand it and provide useful information to the user.
+ There are quite a number of obstacles to being able to view the
+ contents of the floating point registers, and until these are
+ solved you will not be able to view the contents of them.
+ Actually, you can read in the core file and look at the contents of
+ the user struct to find out what the floating point registers
+ contain.
+
+ The actual file contents are as follows:
+ UPAGE: 1 page consisting of a user struct that tells gdb what is present
+ in the file. Directly after this is a copy of the task_struct, which
+ is currently not used by gdb, but it may come in useful at some point.
+ All of the registers are stored as part of the upage. The upage should
+ always be only one page.
+ DATA: The data area is stored. We use current->end_text to
+ current->brk to pick up all of the user variables, plus any memory
+ that may have been malloced. No attempt is made to determine if a page
+ is demand-zero or if a page is totally unused, we just cover the entire
+ range. All of the addresses are rounded in such a way that an integral
+ number of pages is written.
+ STACK: We need the stack information in order to get a meaningful
+ backtrace. We need to write the data from (esp) to
+ current->start_stack, so we round each of these off in order to be able
+ to write an integer number of pages.
+ The minimum core file size is 3 pages, or 12288 bytes. */
+
+/*
+ * Pentium III FXSR, SSE support
+ * Gareth Hughes <gareth@valinux.com>, May 2000
+ *
+ * Provide support for the GDB 5.0+ PTRACE_{GET|SET}FPXREGS requests for
+ * interacting with the FXSR-format floating point environment. Floating
+ * point data can be accessed in the regular format in the usual manner,
+ * and both the standard and SIMD floating point data can be accessed via
+ * the new ptrace requests. In either case, changes to the FPU environment
+ * will be reflected in the task's state as expected.
+ *
+ * x86-64 support by Andi Kleen.
+ */
+
+/* This matches the 64bit FXSAVE format as defined by AMD. It is the same
+ as the 32bit format defined by Intel, except that the selector:offset pairs for
+ data and eip are replaced with flat 64bit pointers. */
+struct user_i387_struct {
+ unsigned short cwd;
+ unsigned short swd;
+ unsigned short twd; /* Note this is not the same as the 32bit/x87/FSAVE twd */
+ unsigned short fop;
+ __u64 rip;
+ __u64 rdp;
+ __u32 mxcsr;
+ __u32 mxcsr_mask;
+ __u32 st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */
+ __u32 xmm_space[64]; /* 16*16 bytes for each XMM-reg = 256 bytes */
+ __u32 padding[24];
+};
+
+/*
+ * Segment register layout in coredumps.
+ */
+struct user_regs_struct {
+ unsigned long r15,r14,r13,r12,rbp,rbx,r11,r10;
+ unsigned long r9,r8,rax,rcx,rdx,rsi,rdi,orig_rax;
+ unsigned long rip,cs,eflags;
+ unsigned long rsp,ss;
+ unsigned long fs_base, gs_base;
+ unsigned long ds,es,fs,gs;
+};
+
+/* When the kernel dumps core, it starts by dumping the user struct -
+ this will be used by gdb to figure out where the data and stack segments
+ are within the file, and what virtual addresses to use. */
+struct user{
+/* We start with the registers, to mimic the way that "memory" is returned
+ from the ptrace(3,...) function. */
+ struct user_regs_struct regs; /* Where the registers are actually stored */
+/* ptrace does not yet supply these. Someday.... */
+ int u_fpvalid; /* True if math co-processor being used. */
+ /* for this mess. Not yet used. */
+ int pad0;
+ struct user_i387_struct i387; /* Math Co-processor registers. */
+/* The rest of this junk is to help gdb figure out what goes where */
+ unsigned long int u_tsize; /* Text segment size (pages). */
+ unsigned long int u_dsize; /* Data segment size (pages). */
+ unsigned long int u_ssize; /* Stack segment size (pages). */
+ unsigned long start_code; /* Starting virtual address of text. */
+ unsigned long start_stack; /* Starting virtual address of stack area.
+ This is actually the bottom of the stack,
+ the top of the stack is always found in the
+ esp register. */
+ long int signal; /* Signal that caused the core dump. */
+ int reserved; /* No longer used */
+ int pad1;
+ struct user_pt_regs * u_ar0; /* Used by gdb to help find the values for */
+ /* the registers. */
+ struct user_i387_struct* u_fpstate; /* Math Co-processor pointer. */
+ unsigned long magic; /* To uniquely identify a core file */
+ char u_comm[32]; /* User command that was responsible */
+ unsigned long u_debugreg[8];
+ unsigned long error_code; /* CPU error code or 0 */
+ unsigned long fault_address; /* CR3 or 0 */
+};
+#define NBPG PAGE_SIZE
+#define UPAGES 1
+#define HOST_TEXT_START_ADDR (u.start_code)
+#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
+
+#endif /* _X86_64_USER_H */
diff --git a/sysroot/usr/include/asm/vm86.h b/sysroot/usr/include/asm/vm86.h
new file mode 100644
index 0000000..788cf14
--- /dev/null
+++ b/sysroot/usr/include/asm/vm86.h
@@ -0,0 +1,140 @@
+#ifndef _LINUX_VM86_H
+#define _LINUX_VM86_H
+
+/*
+ * I'm guessing at the VIF/VIP flag usage, but hope that this is how
+ * the Pentium uses them. Linux will return from vm86 mode when both
+ * VIF and VIP is set.
+ *
+ * On a Pentium, we could probably optimize the virtual flags directly
+ * in the eflags register instead of doing it "by hand" in vflags...
+ *
+ * Linus
+ */
+
+#define TF_MASK 0x00000100
+#define IF_MASK 0x00000200
+#define IOPL_MASK 0x00003000
+#define NT_MASK 0x00004000
+#ifdef CONFIG_VM86
+#define VM_MASK 0x00020000
+#else
+#define VM_MASK 0 /* ignored */
+#endif
+#define AC_MASK 0x00040000
+#define VIF_MASK 0x00080000 /* virtual interrupt flag */
+#define VIP_MASK 0x00100000 /* virtual interrupt pending */
+#define ID_MASK 0x00200000
+
+#define BIOSSEG 0x0f000
+
+#define CPU_086 0
+#define CPU_186 1
+#define CPU_286 2
+#define CPU_386 3
+#define CPU_486 4
+#define CPU_586 5
+
+/*
+ * Return values for the 'vm86()' system call
+ */
+#define VM86_TYPE(retval) ((retval) & 0xff)
+#define VM86_ARG(retval) ((retval) >> 8)
+
+#define VM86_SIGNAL 0 /* return due to signal */
+#define VM86_UNKNOWN 1 /* unhandled GP fault - IO-instruction or similar */
+#define VM86_INTx 2 /* int3/int x instruction (ARG = x) */
+#define VM86_STI 3 /* sti/popf/iret instruction enabled virtual interrupts */
+
+/*
+ * Additional return values when invoking new vm86()
+ */
+#define VM86_PICRETURN 4 /* return due to pending PIC request */
+#define VM86_TRAP 6 /* return due to DOS-debugger request */
+
+/*
+ * function codes when invoking new vm86()
+ */
+#define VM86_PLUS_INSTALL_CHECK 0
+#define VM86_ENTER 1
+#define VM86_ENTER_NO_BYPASS 2
+#define VM86_REQUEST_IRQ 3
+#define VM86_FREE_IRQ 4
+#define VM86_GET_IRQ_BITS 5
+#define VM86_GET_AND_RESET_IRQ 6
+
+/*
+ * This is the stack-layout seen by the user space program when we have
+ * done a translation of "SAVE_ALL" from vm86 mode. The real kernel layout
+ * is 'kernel_vm86_regs' (see below).
+ */
+
+struct vm86_regs {
+/*
+ * normal regs, with special meaning for the segment descriptors..
+ */
+ long ebx;
+ long ecx;
+ long edx;
+ long esi;
+ long edi;
+ long ebp;
+ long eax;
+ long __null_ds;
+ long __null_es;
+ long __null_fs;
+ long __null_gs;
+ long orig_eax;
+ long eip;
+ unsigned short cs, __csh;
+ long eflags;
+ long esp;
+ unsigned short ss, __ssh;
+/*
+ * these are specific to v86 mode:
+ */
+ unsigned short es, __esh;
+ unsigned short ds, __dsh;
+ unsigned short fs, __fsh;
+ unsigned short gs, __gsh;
+};
+
+struct revectored_struct {
+ unsigned long __map[8]; /* 256 bits */
+};
+
+struct vm86_struct {
+ struct vm86_regs regs;
+ unsigned long flags;
+ unsigned long screen_bitmap;
+ unsigned long cpu_type;
+ struct revectored_struct int_revectored;
+ struct revectored_struct int21_revectored;
+};
+
+/*
+ * flags masks
+ */
+#define VM86_SCREEN_BITMAP 0x0001
+
+struct vm86plus_info_struct {
+ unsigned long force_return_for_pic:1;
+ unsigned long vm86dbg_active:1; /* for debugger */
+ unsigned long vm86dbg_TFpendig:1; /* for debugger */
+ unsigned long unused:28;
+ unsigned long is_vm86pus:1; /* for vm86 internal use */
+ unsigned char vm86dbg_intxxtab[32]; /* for debugger */
+};
+
+struct vm86plus_struct {
+ struct vm86_regs regs;
+ unsigned long flags;
+ unsigned long screen_bitmap;
+ unsigned long cpu_type;
+ struct revectored_struct int_revectored;
+ struct revectored_struct int21_revectored;
+ struct vm86plus_info_struct vm86plus;
+};
+
+
+#endif
diff --git a/sysroot/usr/include/asm/vsyscall.h b/sysroot/usr/include/asm/vsyscall.h
new file mode 100644
index 0000000..8d18b6f
--- /dev/null
+++ b/sysroot/usr/include/asm/vsyscall.h
@@ -0,0 +1,17 @@
+#ifndef _ASM_X86_64_VSYSCALL_H_
+#define _ASM_X86_64_VSYSCALL_H_
+
+enum vsyscall_num {
+ __NR_vgettimeofday,
+ __NR_vtime,
+ __NR_vgetcpu,
+};
+
+#define VSYSCALL_START (-10UL << 20)
+#define VSYSCALL_SIZE 1024
+#define VSYSCALL_END (-2UL << 20)
+#define VSYSCALL_MAPPED_PAGES 1
+#define VSYSCALL_ADDR(vsyscall_nr) (VSYSCALL_START+VSYSCALL_SIZE*(vsyscall_nr))
+
+
+#endif /* _ASM_X86_64_VSYSCALL_H_ */
diff --git a/sysroot/usr/include/asm/vsyscall32.h b/sysroot/usr/include/asm/vsyscall32.h
new file mode 100644
index 0000000..c44a49d
--- /dev/null
+++ b/sysroot/usr/include/asm/vsyscall32.h
@@ -0,0 +1,20 @@
+#ifndef _ASM_VSYSCALL32_H
+#define _ASM_VSYSCALL32_H 1
+
+/* Values need to match arch/x86_64/ia32/vsyscall.lds */
+
+#ifdef __ASSEMBLY__
+#define VSYSCALL32_BASE 0xffffe000
+#define VSYSCALL32_SYSEXIT (VSYSCALL32_BASE + 0x410)
+#else
+#define VSYSCALL32_BASE 0xffffe000UL
+#define VSYSCALL32_END (VSYSCALL32_BASE + PAGE_SIZE)
+#define VSYSCALL32_EHDR ((const struct elf32_hdr *) VSYSCALL32_BASE)
+
+#define VSYSCALL32_VSYSCALL ((void *)VSYSCALL32_BASE + 0x400)
+#define VSYSCALL32_SYSEXIT ((void *)VSYSCALL32_BASE + 0x410)
+#define VSYSCALL32_SIGRETURN ((void *)VSYSCALL32_BASE + 0x500)
+#define VSYSCALL32_RTSIGRETURN ((void *)VSYSCALL32_BASE + 0x600)
+#endif
+
+#endif
diff --git a/sysroot/usr/include/assert.h b/sysroot/usr/include/assert.h
new file mode 100644
index 0000000..8989713
--- /dev/null
+++ b/sysroot/usr/include/assert.h
@@ -0,0 +1,118 @@
+/* Copyright (C) 1991,1992,1994-2001,2003,2004,2007
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99 Standard: 7.2 Diagnostics <assert.h>
+ */
+
+#ifdef _ASSERT_H
+
+# undef _ASSERT_H
+# undef assert
+# undef __ASSERT_VOID_CAST
+
+# ifdef __USE_GNU
+# undef assert_perror
+# endif
+
+#endif /* assert.h */
+
+#define _ASSERT_H 1
+#include <features.h>
+
+#if defined __cplusplus && __GNUC_PREREQ (2,95)
+# define __ASSERT_VOID_CAST static_cast<void>
+#else
+# define __ASSERT_VOID_CAST (void)
+#endif
+
+/* void assert (int expression);
+
+ If NDEBUG is defined, do nothing.
+ If not, and EXPRESSION is zero, print an error message and abort. */
+
+#ifdef NDEBUG
+
+# define assert(expr) (__ASSERT_VOID_CAST (0))
+
+/* void assert_perror (int errnum);
+
+ If NDEBUG is defined, do nothing. If not, and ERRNUM is not zero, print an
+ error message with the error text for ERRNUM and abort.
+ (This is a GNU extension.) */
+
+# ifdef __USE_GNU
+# define assert_perror(errnum) (__ASSERT_VOID_CAST (0))
+# endif
+
+#else /* Not NDEBUG. */
+
+#ifndef _ASSERT_H_DECLS
+#define _ASSERT_H_DECLS
+__BEGIN_DECLS
+
+/* This prints an "Assertion failed" message and aborts. */
+extern void __assert_fail (__const char *__assertion, __const char *__file,
+ unsigned int __line, __const char *__function)
+ __THROW __attribute__ ((__noreturn__));
+
+/* Likewise, but prints the error text for ERRNUM. */
+extern void __assert_perror_fail (int __errnum, __const char *__file,
+ unsigned int __line,
+ __const char *__function)
+ __THROW __attribute__ ((__noreturn__));
+
+
+/* The following is not at all used here but needed for standard
+ compliance. */
+extern void __assert (const char *__assertion, const char *__file, int __line)
+ __THROW __attribute__ ((__noreturn__));
+
+
+__END_DECLS
+#endif /* Not _ASSERT_H_DECLS */
+
+# define assert(expr) \
+ ((expr) \
+ ? __ASSERT_VOID_CAST (0) \
+ : __assert_fail (__STRING(expr), __FILE__, __LINE__, __ASSERT_FUNCTION))
+
+# ifdef __USE_GNU
+# define assert_perror(errnum) \
+ (!(errnum) \
+ ? __ASSERT_VOID_CAST (0) \
+ : __assert_perror_fail ((errnum), __FILE__, __LINE__, __ASSERT_FUNCTION))
+# endif
+
+/* Version 2.4 and later of GCC define a magical variable `__PRETTY_FUNCTION__'
+ which contains the name of the function currently being defined.
+ This is broken in G++ before version 2.6.
+ C9x has a similar variable called __func__, but prefer the GCC one since
+ it demangles C++ function names. */
+# if defined __cplusplus ? __GNUC_PREREQ (2, 6) : __GNUC_PREREQ (2, 4)
+# define __ASSERT_FUNCTION __PRETTY_FUNCTION__
+# else
+# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
+# define __ASSERT_FUNCTION __func__
+# else
+# define __ASSERT_FUNCTION ((__const char *) 0)
+# endif
+# endif
+
+#endif /* NDEBUG. */
diff --git a/sysroot/usr/include/audiofile.h b/sysroot/usr/include/audiofile.h
new file mode 100644
index 0000000..a39c0ba
--- /dev/null
+++ b/sysroot/usr/include/audiofile.h
@@ -0,0 +1,601 @@
+/*
+ Audio File Library
+ Copyright (C) 1998-2000, Michael Pruett <michael@68k.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the
+ Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307 USA.
+*/
+
+/*
+ audiofile.h
+
+ This file contains the public interfaces to the Audio File Library.
+*/
+
+#ifndef AUDIOFILE_H
+#define AUDIOFILE_H
+
+#include <sys/types.h>
+#include <aupvlist.h>
+
+#define LIBAUDIOFILE_MAJOR_VERSION 0
+#define LIBAUDIOFILE_MINOR_VERSION 2
+#define LIBAUDIOFILE_MICRO_VERSION 4
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+typedef struct _AFvirtualfile AFvirtualfile;
+
+typedef struct _AFfilesetup *AFfilesetup;
+typedef struct _AFfilehandle *AFfilehandle;
+typedef void (*AFerrfunc)(long, const char *);
+
+typedef off_t AFframecount;
+typedef off_t AFfileoffset;
+
+#define AF_NULL_FILESETUP ((struct _AFfilesetup *) 0)
+#define AF_NULL_FILEHANDLE ((struct _AFfilehandle *) 0)
+
+#define AF_ERR_BASE 3000
+
+enum
+{
+ AF_DEFAULT_TRACK = 1001
+};
+
+enum
+{
+ AF_DEFAULT_INST = 2001
+};
+
+enum
+{
+ AF_NUM_UNLIMITED = 99999
+};
+
+enum
+{
+ AF_BYTEORDER_BIGENDIAN = 501,
+ AF_BYTEORDER_LITTLEENDIAN = 502
+};
+
+enum
+{
+ AF_FILE_UNKNOWN = -1,
+ AF_FILE_RAWDATA = 0,
+ AF_FILE_AIFFC = 1,
+ AF_FILE_AIFF = 2,
+ AF_FILE_NEXTSND = 3,
+ AF_FILE_WAVE = 4,
+ AF_FILE_BICSF = 5,
+ AF_FILE_IRCAM = AF_FILE_BICSF,
+ AF_FILE_MPEG1BITSTREAM = 6, /* not implemented */
+ AF_FILE_SOUNDDESIGNER1 = 7, /* not implemented */
+ AF_FILE_SOUNDDESIGNER2 = 8, /* not implemented */
+ AF_FILE_AVR = 9,
+ AF_FILE_IFF_8SVX = 10,
+ AF_FILE_SAMPLEVISION = 11, /* not implemented */
+ AF_FILE_VOC = 12, /* not implemented */
+ AF_FILE_NIST_SPHERE = 13,
+ AF_FILE_SOUNDFONT2 = 14 /* not implemented */
+};
+
+enum
+{
+ AF_LOOP_MODE_NOLOOP = 0,
+ AF_LOOP_MODE_FORW = 1,
+ AF_LOOP_MODE_FORWBAKW = 2
+};
+
+enum
+{
+ AF_SAMPFMT_TWOSCOMP = 401, /* linear two's complement */
+ AF_SAMPFMT_UNSIGNED = 402, /* unsigned integer */
+ AF_SAMPFMT_FLOAT = 403, /* 32-bit IEEE floating-point */
+ AF_SAMPFMT_DOUBLE = 404 /* 64-bit IEEE double-precision floating-point */
+};
+
+enum
+{
+ AF_INST_LOOP_OFF = 0, /* no looping */
+ AF_INST_LOOP_CONTINUOUS = 1, /* loop continuously through decay */
+ AF_INST_LOOP_SUSTAIN = 3 /* loop during sustain, then continue */
+};
+
+enum
+{
+ AF_INST_MIDI_BASENOTE = 301,
+ AF_INST_NUMCENTS_DETUNE = 302,
+ AF_INST_MIDI_LONOTE = 303,
+ AF_INST_MIDI_HINOTE = 304,
+ AF_INST_MIDI_LOVELOCITY = 305,
+ AF_INST_MIDI_HIVELOCITY = 306,
+ AF_INST_NUMDBS_GAIN = 307,
+ AF_INST_SUSLOOPID = 308, /* loop id for AIFF sustain loop */
+ AF_INST_RELLOOPID = 309, /* loop id for AIFF release loop */
+ AF_INST_SAMP_STARTFRAME = 310, /* start sample for this inst */
+ AF_INST_SAMP_ENDFRAME = 311, /* end sample for this inst */
+ AF_INST_SAMP_MODE = 312, /* looping mode for this inst */
+ AF_INST_TRACKID = 313,
+ AF_INST_NAME = 314, /* name of this inst */
+ AF_INST_SAMP_RATE = 315, /* sample rate of this inst's sample */
+ AF_INST_PRESETID = 316, /* ID of preset containing this inst */
+ AF_INST_PRESET_NAME = 317 /* name of preset containing this inst */
+};
+
+enum
+{
+ AF_MISC_UNRECOGNIZED = 0, /* unrecognized data chunk */
+ AF_MISC_COPY = 201, /* copyright string */
+ AF_MISC_AUTH = 202, /* author string */
+ AF_MISC_NAME = 203, /* name string */
+ AF_MISC_ANNO = 204, /* annotation string */
+ AF_MISC_APPL = 205, /* application-specific data */
+ AF_MISC_MIDI = 206, /* MIDI exclusive data */
+ AF_MISC_PCMMAP = 207, /* PCM mapping information (future use) */
+ AF_MISC_NeXT = 208, /* misc binary data appended to NeXT header */
+ AF_MISC_IRCAM_PEAKAMP = 209, /* peak amplitude information */
+ AF_MISC_IRCAM_COMMENT = 210, /* BICSF text comment */
+ AF_MISC_COMMENT = 210, /* general text comment */
+
+ AF_MISC_ICMT = AF_MISC_COMMENT, /* comments chunk (WAVE format) */
+ AF_MISC_ICRD = 211, /* creation date (WAVE format) */
+ AF_MISC_ISFT = 212 /* software name (WAVE format) */
+};
+
+enum
+{
+ /* supported compression schemes */
+ AF_COMPRESSION_UNKNOWN = -1,
+ AF_COMPRESSION_NONE = 0,
+ AF_COMPRESSION_G722 = 501,
+ AF_COMPRESSION_G711_ULAW = 502,
+ AF_COMPRESSION_G711_ALAW = 503,
+
+ /* Apple proprietary AIFF-C compression schemes (not supported) */
+ AF_COMPRESSION_APPLE_ACE2 = 504,
+ AF_COMPRESSION_APPLE_ACE8 = 505,
+ AF_COMPRESSION_APPLE_MAC3 = 506,
+ AF_COMPRESSION_APPLE_MAC6 = 507,
+
+ AF_COMPRESSION_G726 = 517,
+ AF_COMPRESSION_G728 = 518,
+ AF_COMPRESSION_DVI_AUDIO = 519,
+ AF_COMPRESSION_IMA = AF_COMPRESSION_DVI_AUDIO,
+ AF_COMPRESSION_GSM = 520,
+ AF_COMPRESSION_FS1016 = 521,
+ AF_COMPRESSION_DV = 522,
+ AF_COMPRESSION_MS_ADPCM = 523
+};
+
+/* tokens for afQuery() -- see the man page for instructions */
+/* level 1 selectors */
+enum
+{
+ AF_QUERYTYPE_INSTPARAM = 500,
+ AF_QUERYTYPE_FILEFMT = 501,
+ AF_QUERYTYPE_COMPRESSION = 502,
+ AF_QUERYTYPE_COMPRESSIONPARAM = 503,
+ AF_QUERYTYPE_MISC = 504,
+ AF_QUERYTYPE_INST = 505,
+ AF_QUERYTYPE_MARK = 506,
+ AF_QUERYTYPE_LOOP = 507
+};
+
+/* level 2 selectors */
+enum
+{
+ AF_QUERY_NAME = 600, /* get name (1-3 words) */
+ AF_QUERY_DESC = 601, /* get description */
+ AF_QUERY_LABEL = 602, /* get 4- or 5-char label */
+ AF_QUERY_TYPE = 603, /* get type token */
+ AF_QUERY_DEFAULT = 604, /* dflt. value for param */
+ AF_QUERY_ID_COUNT = 605, /* get number of ids avail. */
+ AF_QUERY_IDS = 606, /* get array of id tokens */
+ AF_QUERY_IMPLEMENTED = 613, /* boolean */
+ AF_QUERY_TYPE_COUNT = 607, /* get number of types av. */
+ AF_QUERY_TYPES = 608, /* get array of types */
+ AF_QUERY_NATIVE_SAMPFMT = 609, /* for compression */
+ AF_QUERY_NATIVE_SAMPWIDTH = 610,
+ AF_QUERY_SQUISHFAC = 611, /* 1.0 means variable */
+ AF_QUERY_MAX_NUMBER = 612, /* max allowed in file */
+ AF_QUERY_SUPPORTED = 613 /* insts, loops, etc., supported? */
+};
+
+/* level 2 selectors which have sub-selectors */
+enum
+{
+ AF_QUERY_TRACKS = 620,
+ AF_QUERY_CHANNELS = 621,
+ AF_QUERY_SAMPLE_SIZES = 622,
+ AF_QUERY_SAMPLE_FORMATS = 623,
+ AF_QUERY_COMPRESSION_TYPES = 624
+};
+
+/* level 3 sub-selectors */
+enum
+{
+ AF_QUERY_VALUE_COUNT = 650, /* number of values of the above */
+ AF_QUERY_VALUES = 651 /* array of those values */
+};
+
+
+/*
+ Old Audio File Library error codes. These are still returned by the
+ AFerrorhandler calls, but are not used by the new digital media library
+ error reporting routines. See the bottom of this file for the new error
+ tokens.
+*/
+
+enum
+{
+ AF_BAD_NOT_IMPLEMENTED = 0, /* not implemented yet */
+ AF_BAD_FILEHANDLE = 1, /* tried to use invalid filehandle */
+ AF_BAD_OPEN = 3, /* unix open failed */
+ AF_BAD_CLOSE = 4, /* unix close failed */
+ AF_BAD_READ = 5, /* unix read failed */
+ AF_BAD_WRITE = 6, /* unix write failed */
+ AF_BAD_LSEEK = 7, /* unix lseek failed */
+ AF_BAD_NO_FILEHANDLE = 8, /* failed to allocate a filehandle struct */
+ AF_BAD_ACCMODE = 10, /* unrecognized audio file access mode */
+ AF_BAD_NOWRITEACC = 11, /* file not open for writing */
+ AF_BAD_NOREADACC = 12, /* file not open for reading */
+ AF_BAD_FILEFMT = 13, /* unrecognized audio file format */
+ AF_BAD_RATE = 14, /* invalid sample rate */
+ AF_BAD_CHANNELS = 15, /* invalid number of channels*/
+ AF_BAD_SAMPCNT = 16, /* invalid sample count */
+ AF_BAD_WIDTH = 17, /* invalid sample width */
+ AF_BAD_SEEKMODE = 18, /* invalid seek mode */
+ AF_BAD_NO_LOOPDATA = 19, /* failed to allocate loop struct */
+ AF_BAD_MALLOC = 20, /* malloc failed somewhere */
+ AF_BAD_LOOPID = 21,
+ AF_BAD_SAMPFMT = 22, /* bad sample format */
+ AF_BAD_FILESETUP = 23, /* bad file setup structure*/
+ AF_BAD_TRACKID = 24, /* no track corresponding to id */
+ AF_BAD_NUMTRACKS = 25, /* wrong number of tracks for file format */
+ AF_BAD_NO_FILESETUP = 26, /* failed to allocate a filesetup struct*/
+ AF_BAD_LOOPMODE = 27, /* unrecognized loop mode value */
+ AF_BAD_INSTID = 28, /* invalid instrument id */
+ AF_BAD_NUMLOOPS = 29, /* bad number of loops */
+ AF_BAD_NUMMARKS = 30, /* bad number of markers */
+ AF_BAD_MARKID = 31, /* bad marker id */
+ AF_BAD_MARKPOS = 32, /* invalid marker position value */
+ AF_BAD_NUMINSTS = 33, /* invalid number of instruments */
+ AF_BAD_NOAESDATA = 34,
+ AF_BAD_MISCID = 35,
+ AF_BAD_NUMMISC = 36,
+ AF_BAD_MISCSIZE = 37,
+ AF_BAD_MISCTYPE = 38,
+ AF_BAD_MISCSEEK = 39,
+ AF_BAD_STRLEN = 40, /* invalid string length */
+ AF_BAD_RATECONV = 45,
+ AF_BAD_SYNCFILE = 46,
+ AF_BAD_CODEC_CONFIG = 47, /* improperly configured codec */
+ AF_BAD_CODEC_STATE = 48, /* invalid codec state: can't recover */
+ AF_BAD_CODEC_LICENSE = 49, /* no license available for codec */
+ AF_BAD_CODEC_TYPE = 50, /* unsupported codec type */
+ AF_BAD_COMPRESSION = AF_BAD_CODEC_CONFIG, /* for back compat */
+ AF_BAD_COMPTYPE = AF_BAD_CODEC_TYPE, /* for back compat */
+
+ AF_BAD_INSTPTYPE = 51, /* invalid instrument parameter type */
+ AF_BAD_INSTPID = 52, /* invalid instrument parameter id */
+ AF_BAD_BYTEORDER = 53,
+ AF_BAD_FILEFMT_PARAM = 54, /* unrecognized file format parameter */
+ AF_BAD_COMP_PARAM = 55, /* unrecognized compression parameter */
+ AF_BAD_DATAOFFSET = 56, /* bad data offset */
+ AF_BAD_FRAMECNT = 57, /* bad frame count */
+ AF_BAD_QUERYTYPE = 58, /* bad query type */
+ AF_BAD_QUERY = 59, /* bad argument to afQuery() */
+ AF_WARNING_CODEC_RATE = 60, /* using 8k instead of codec rate 8012 */
+ AF_WARNING_RATECVT = 61, /* warning about rate conversion used */
+
+ AF_BAD_HEADER = 62, /* failed to parse header */
+ AF_BAD_FRAME = 63, /* bad frame number */
+ AF_BAD_LOOPCOUNT = 64, /* bad loop count */
+ AF_BAD_DMEDIA_CALL = 65, /* error in dmedia subsystem call */
+
+ /* AIFF/AIFF-C specific errors when parsing file header */
+ AF_BAD_AIFF_HEADER = 108, /* failed to parse chunk header */
+ AF_BAD_AIFF_FORM = 109, /* failed to parse FORM chunk */
+ AF_BAD_AIFF_SSND = 110, /* failed to parse SSND chunk */
+ AF_BAD_AIFF_CHUNKID = 111, /* unrecognized AIFF/AIFF-C chunk id */
+ AF_BAD_AIFF_COMM = 112, /* failed to parse COMM chunk */
+ AF_BAD_AIFF_INST = 113, /* failed to parse INST chunk */
+ AF_BAD_AIFF_MARK = 114, /* failed to parse MARK chunk */
+ AF_BAD_AIFF_SKIP = 115, /* failed to skip unsupported chunk */
+ AF_BAD_AIFF_LOOPMODE = 116 /* unrecognized loop mode (forw, etc)*/
+};
+
+/* new error codes which may be retrieved via dmGetError() */
+/* The old error tokens continue to be retrievable via the AFerrorhandler */
+/* AF_ERR_BASE is #defined in dmedia/dmedia.h */
+
+enum
+{
+ AF_ERR_NOT_IMPLEMENTED = 0+AF_ERR_BASE, /* not implemented yet */
+ AF_ERR_BAD_FILEHANDLE = 1+AF_ERR_BASE, /* invalid filehandle */
+ AF_ERR_BAD_READ = 5+AF_ERR_BASE, /* unix read failed */
+ AF_ERR_BAD_WRITE = 6+AF_ERR_BASE, /* unix write failed */
+ AF_ERR_BAD_LSEEK = 7+AF_ERR_BASE, /* unix lseek failed */
+ AF_ERR_BAD_ACCMODE = 10+AF_ERR_BASE, /* unrecognized audio file access mode */
+ AF_ERR_NO_WRITEACC = 11+AF_ERR_BASE, /* file not open for writing */
+ AF_ERR_NO_READACC = 12+AF_ERR_BASE, /* file not open for reading */
+ AF_ERR_BAD_FILEFMT = 13+AF_ERR_BASE, /* unrecognized audio file format */
+ AF_ERR_BAD_RATE = 14+AF_ERR_BASE, /* invalid sample rate */
+ AF_ERR_BAD_CHANNELS = 15+AF_ERR_BASE, /* invalid # channels*/
+ AF_ERR_BAD_SAMPCNT = 16+AF_ERR_BASE, /* invalid sample count */
+ AF_ERR_BAD_WIDTH = 17+AF_ERR_BASE, /* invalid sample width */
+ AF_ERR_BAD_SEEKMODE = 18+AF_ERR_BASE, /* invalid seek mode */
+ AF_ERR_BAD_LOOPID = 21+AF_ERR_BASE, /* invalid loop id */
+ AF_ERR_BAD_SAMPFMT = 22+AF_ERR_BASE, /* bad sample format */
+ AF_ERR_BAD_FILESETUP = 23+AF_ERR_BASE, /* bad file setup structure*/
+ AF_ERR_BAD_TRACKID = 24+AF_ERR_BASE, /* no track corresponding to id */
+ AF_ERR_BAD_NUMTRACKS = 25+AF_ERR_BASE, /* wrong number of tracks for file format */
+ AF_ERR_BAD_LOOPMODE = 27+AF_ERR_BASE, /* unrecognized loop mode symbol */
+ AF_ERR_BAD_INSTID = 28+AF_ERR_BASE, /* invalid instrument id */
+ AF_ERR_BAD_NUMLOOPS = 29+AF_ERR_BASE, /* bad number of loops */
+ AF_ERR_BAD_NUMMARKS = 30+AF_ERR_BASE, /* bad number of markers */
+ AF_ERR_BAD_MARKID = 31+AF_ERR_BASE, /* bad marker id */
+ AF_ERR_BAD_MARKPOS = 32+AF_ERR_BASE, /* invalid marker position value */
+ AF_ERR_BAD_NUMINSTS = 33+AF_ERR_BASE, /* invalid number of instruments */
+ AF_ERR_BAD_NOAESDATA = 34+AF_ERR_BASE,
+ AF_ERR_BAD_MISCID = 35+AF_ERR_BASE,
+ AF_ERR_BAD_NUMMISC = 36+AF_ERR_BASE,
+ AF_ERR_BAD_MISCSIZE = 37+AF_ERR_BASE,
+ AF_ERR_BAD_MISCTYPE = 38+AF_ERR_BASE,
+ AF_ERR_BAD_MISCSEEK = 39+AF_ERR_BASE,
+ AF_ERR_BAD_STRLEN = 40+AF_ERR_BASE, /* invalid string length */
+ AF_ERR_BAD_RATECONV = 45+AF_ERR_BASE,
+ AF_ERR_BAD_SYNCFILE = 46+AF_ERR_BASE,
+ AF_ERR_BAD_CODEC_CONFIG = 47+AF_ERR_BASE, /* improperly configured codec */
+ AF_ERR_BAD_CODEC_TYPE = 50+AF_ERR_BASE, /* unsupported codec type */
+ AF_ERR_BAD_INSTPTYPE = 51+AF_ERR_BASE, /* invalid instrument parameter type */
+ AF_ERR_BAD_INSTPID = 52+AF_ERR_BASE, /* invalid instrument parameter id */
+
+ AF_ERR_BAD_BYTEORDER = 53+AF_ERR_BASE,
+ AF_ERR_BAD_FILEFMT_PARAM = 54+AF_ERR_BASE, /* unrecognized file format parameter */
+ AF_ERR_BAD_COMP_PARAM = 55+AF_ERR_BASE, /* unrecognized compression parameter */
+ AF_ERR_BAD_DATAOFFSET = 56+AF_ERR_BASE, /* bad data offset */
+ AF_ERR_BAD_FRAMECNT = 57+AF_ERR_BASE, /* bad frame count */
+
+ AF_ERR_BAD_QUERYTYPE = 58+AF_ERR_BASE, /* bad query type */
+ AF_ERR_BAD_QUERY = 59+AF_ERR_BASE, /* bad argument to afQuery() */
+ AF_ERR_BAD_HEADER = 62+AF_ERR_BASE, /* failed to parse header */
+ AF_ERR_BAD_FRAME = 63+AF_ERR_BASE, /* bad frame number */
+ AF_ERR_BAD_LOOPCOUNT = 64+AF_ERR_BASE, /* bad loop count */
+
+ /* AIFF/AIFF-C specific errors when parsing file header */
+
+ AF_ERR_BAD_AIFF_HEADER = 66+AF_ERR_BASE, /* failed to parse chunk header */
+ AF_ERR_BAD_AIFF_FORM = 67+AF_ERR_BASE, /* failed to parse FORM chunk */
+ AF_ERR_BAD_AIFF_SSND = 68+AF_ERR_BASE, /* failed to parse SSND chunk */
+ AF_ERR_BAD_AIFF_CHUNKID = 69+AF_ERR_BASE, /* unrecognized AIFF/AIFF-C chunk id */
+ AF_ERR_BAD_AIFF_COMM = 70+AF_ERR_BASE, /* failed to parse COMM chunk */
+ AF_ERR_BAD_AIFF_INST = 71+AF_ERR_BASE, /* failed to parse INST chunk */
+ AF_ERR_BAD_AIFF_MARK = 72+AF_ERR_BASE, /* failed to parse MARK chunk */
+ AF_ERR_BAD_AIFF_SKIP = 73+AF_ERR_BASE, /* failed to skip unsupported chunk */
+ AF_ERR_BAD_AIFF_LOOPMODE = 74+AF_ERR_BASE /* unrecognized loop mode (forw, etc) */
+};
+
+
+/* global routines */
+AFerrfunc afSetErrorHandler (AFerrfunc efunc);
+
+/* query routines */
+AUpvlist afQuery (int querytype, int arg1, int arg2, int arg3, int arg4);
+long afQueryLong (int querytype, int arg1, int arg2, int arg3, int arg4);
+double afQueryDouble (int querytype, int arg1, int arg2, int arg3, int arg4);
+void *afQueryPointer (int querytype, int arg1, int arg2, int arg3, int arg4);
+
+/* basic operations on file handles and file setups */
+AFfilesetup afNewFileSetup (void);
+void afFreeFileSetup (AFfilesetup);
+int afIdentifyFD (int);
+int afIdentifyNamedFD (int, const char *filename, int *implemented);
+
+AFfilehandle afOpenFile (const char *filename, const char *mode,
+ AFfilesetup setup);
+AFfilehandle afOpenVirtualFile (AFvirtualfile *vfile, const char *mode,
+ AFfilesetup setup);
+AFfilehandle afOpenFD (int fd, const char *mode, AFfilesetup setup);
+AFfilehandle afOpenNamedFD (int fd, const char *mode, AFfilesetup setup,
+ const char *filename);
+
+void afSaveFilePosition (AFfilehandle file);
+void afRestoreFilePosition (AFfilehandle file);
+int afSyncFile (AFfilehandle file);
+int afCloseFile (AFfilehandle file);
+
+void afInitFileFormat (AFfilesetup, int format);
+int afGetFileFormat (AFfilehandle, int *version);
+
+/* track */
+void afInitTrackIDs (AFfilesetup, int *trackids, int trackCount);
+int afGetTrackIDs (AFfilehandle, int *trackids);
+
+/* track data: reading, writng, seeking, sizing frames */
+int afReadFrames (AFfilehandle, int track, void *buffer, int frameCount);
+int afWriteFrames (AFfilehandle, int track, const void *buffer, int frameCount);
+AFframecount afSeekFrame (AFfilehandle, int track, AFframecount frameoffset);
+AFframecount afTellFrame (AFfilehandle, int track);
+AFfileoffset afGetTrackBytes (AFfilehandle, int track);
+float afGetFrameSize (AFfilehandle, int track, int expand3to4);
+float afGetVirtualFrameSize (AFfilehandle, int track, int expand3to4);
+
+/* track data: AES data */
+/* afInitAESChannelData is obsolete -- use afInitAESChannelDataTo() */
+void afInitAESChannelData (AFfilesetup, int track); /* obsolete */
+void afInitAESChannelDataTo (AFfilesetup, int track, int willBeData);
+int afGetAESChannelData (AFfilehandle, int track, unsigned char buf[24]);
+void afSetAESChannelData (AFfilehandle, int track, unsigned char buf[24]);
+
+#if 0
+/* track setup format initialized via DMparams */
+/* track format retrieved via DMparams */
+DMstatus afInitFormatParams (AFfilesetup, int track, DMparams *params);
+/* virtual format set via DMparams */
+DMstatus afGetFormatParams (AFfilehandle, int track, DMparams *params);
+/* virtual format retrieved via DMparams */
+DMstatus afSetVirtualFormatParams (AFfilehandle, int track, DMparams *params);
+DMstatus afGetVirtualFormatParams (AFfilehandle, int track, DMparams *params);
+/* conversion/compression params set via DMparams */
+DMstatus afSetConversionParams (AFfilehandle, int track, DMparams *params);
+/* conversion/compression params retrieved via DMparams */
+DMstatus afGetConversionParams (AFfilehandle, int track, DMparams *params);
+#endif
+
+/* track data: byte order */
+void afInitByteOrder (AFfilesetup, int track, int byteOrder);
+int afGetByteOrder (AFfilehandle, int track);
+int afSetVirtualByteOrder (AFfilehandle, int track, int byteOrder);
+int afGetVirtualByteOrder (AFfilehandle, int track);
+
+/* track data: number of channels */
+void afInitChannels (AFfilesetup, int track, int nchannels);
+int afGetChannels (AFfilehandle, int track);
+int afSetVirtualChannels (AFfilehandle, int track, int channelCount);
+int afGetVirtualChannels (AFfilehandle, int track);
+void afSetChannelMatrix (AFfilehandle, int track, double *matrix);
+
+/* track data: sample format and sample width */
+void afInitSampleFormat (AFfilesetup, int track, int sampleFormat,
+ int sampleWidth);
+void afGetSampleFormat (AFfilehandle file, int track, int *sampfmt,
+ int *sampwidth);
+void afGetVirtualSampleFormat (AFfilehandle file, int track, int *sampfmt,
+ int *sampwidth);
+int afSetVirtualSampleFormat (AFfilehandle, int track,
+ int sampleFormat, int sampleWidth);
+void afGetVirtualSampleFormat (AFfilehandle, int track,
+ int *sampleFormat, int *sampleWidth);
+
+/* track data: sampling rate */
+void afInitRate (AFfilesetup, int track, double rate);
+double afGetRate (AFfilehandle, int track);
+
+#if 0
+int afSetVirtualRate (AFfilehandle, int track, double rate);
+double afGetVirtualRate (AFfilehandle, int track);
+#endif
+
+/* track data: compression */
+void afInitCompression (AFfilesetup, int track, int compression);
+#if 0
+void afInitCompressionParams (AFfilesetup, int track, int compression
+ AUpvlist params, int parameterCount);
+#endif
+
+int afGetCompression (AFfilehandle, int track);
+#if 0
+void afGetCompressionParams (AFfilehandle, int track, int *compression,
+ AUpvlist params, int parameterCount);
+
+int afSetVirtualCompression (AFfilesetup, int track, int compression);
+void afSetVirtualCompressionParams (AFfilehandle, int track, int compression,
+ AUpvlist params, int parameterCount);
+
+int afGetVirtualCompression (AFfilesetup, int track, int compression);
+void afGetVirtualCompressionParams (AFfilehandle, int track, int *compression,
+ AUpvlist params, int parameterCount);
+#endif
+
+/* track data: pcm mapping */
+void afInitPCMMapping (AFfilesetup filesetup, int track,
+ double slope, double intercept, double minClip, double maxClip);
+void afGetPCMMapping (AFfilehandle file, int track,
+ double *slope, double *intercept, double *minClip, double *maxClip);
+/* NOTE: afSetTrackPCMMapping() is special--it does not set the virtual */
+/* format; it changes what the AF thinks the track format is! Be careful. */
+int afSetTrackPCMMapping (AFfilehandle file, int track,
+ double slope, double intercept, double minClip, double maxClip);
+/* NOTE: afSetVirtualPCMMapping() is different from afSetTrackPCMMapping(): */
+/* see comment for afSetTrackPCMMapping(). */
+int afSetVirtualPCMMapping (AFfilehandle file, int track,
+ double slope, double intercept, double minClip, double maxClip);
+void afGetVirtualPCMMapping (AFfilehandle file, int track,
+ double *slope, double *intercept, double *minClip, double *maxClip);
+
+/* track data: data offset within the file */
+/* initialize for raw reading only */
+void afInitDataOffset(AFfilesetup, int track, AFfileoffset offset);
+AFfileoffset afGetDataOffset (AFfilehandle, int track);
+
+/* track data: count of frames in file */
+void afInitFrameCount (AFfilesetup, int track, AFframecount frameCount);
+AFframecount afGetFrameCount (AFfilehandle file, int track);
+
+/* loop operations */
+void afInitLoopIDs (AFfilesetup, int instid, int ids[], int nids);
+int afGetLoopIDs (AFfilehandle, int instid, int loopids[]);
+void afSetLoopMode (AFfilehandle, int instid, int loop, int mode);
+int afGetLoopMode (AFfilehandle, int instid, int loopid);
+int afSetLoopCount (AFfilehandle, int instid, int loop, int count);
+int afGetLoopCount (AFfilehandle, int instid, int loopid);
+void afSetLoopStart (AFfilehandle, int instid, int loopid, int markerid);
+int afGetLoopStart (AFfilehandle, int instid, int loopid);
+void afSetLoopEnd (AFfilehandle, int instid, int loopid, int markerid);
+int afGetLoopEnd (AFfilehandle, int instid, int loopid);
+
+int afSetLoopStartFrame (AFfilehandle, int instid, int loop,
+ AFframecount startFrame);
+AFframecount afGetLoopStartFrame (AFfilehandle, int instid, int loop);
+int afSetLoopEndFrame (AFfilehandle, int instid, int loop,
+ AFframecount startFrame);
+AFframecount afGetLoopEndFrame (AFfilehandle, int instid, int loop);
+
+void afSetLoopTrack (AFfilehandle, int instid, int loopid, int trackid);
+int afGetLoopTrack (AFfilehandle, int instid, int loopid);
+
+/* marker operations */
+void afInitMarkIDs (AFfilesetup, int trackid, int *ids, int nids);
+int afGetMarkIDs (AFfilehandle file, int trackid, int markids[]);
+void afSetMarkPosition (AFfilehandle file, int trackid, int markid,
+ AFframecount markpos);
+AFframecount afGetMarkPosition (AFfilehandle file, int trackid, int markid);
+void afInitMarkName (AFfilesetup, int trackid, int marker, const char *name);
+void afInitMarkComment (AFfilesetup, int trackid, int marker,
+ const char *comment);
+char *afGetMarkName (AFfilehandle file, int trackid, int markid);
+char *afGetMarkComment (AFfilehandle file, int trackid, int markid);
+
+/* instrument operations */
+void afInitInstIDs (AFfilesetup, int *ids, int nids);
+int afGetInstIDs (AFfilehandle file, int *instids);
+void afGetInstParams (AFfilehandle file, int instid, AUpvlist pvlist,
+ int nparams);
+void afSetInstParams (AFfilehandle file, int instid, AUpvlist pvlist,
+ int nparams);
+long afGetInstParamLong (AFfilehandle file, int instid, int param);
+void afSetInstParamLong (AFfilehandle file, int instid, int param, long value);
+
+/* miscellaneous data operations */
+void afInitMiscIDs (AFfilesetup, int *ids, int nids);
+int afGetMiscIDs (AFfilehandle, int *ids);
+void afInitMiscType (AFfilesetup, int miscellaneousid, int type);
+int afGetMiscType (AFfilehandle, int miscellaneousid);
+void afInitMiscSize (AFfilesetup, int miscellaneousid, int size);
+int afGetMiscSize (AFfilehandle, int miscellaneousid);
+int afWriteMisc (AFfilehandle, int miscellaneousid, void *buf, int bytes);
+int afReadMisc (AFfilehandle, int miscellaneousid, void *buf, int bytes);
+int afSeekMisc (AFfilehandle, int miscellaneousid, int offset);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* AUDIOFILE_H */
diff --git a/sysroot/usr/include/aupvlist.h b/sysroot/usr/include/aupvlist.h
new file mode 100644
index 0000000..7286f41
--- /dev/null
+++ b/sysroot/usr/include/aupvlist.h
@@ -0,0 +1,61 @@
+/*
+ Audio File Library
+ Copyright (C) 1998-2000, Michael Pruett <michael@68k.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the
+ Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307 USA.
+*/
+
+/*
+ aupvlist.h
+
+ This file contains the interface to the parameter value list data
+ structures and routines.
+*/
+
+#ifndef AUPVLIST_H
+#define AUPVLIST_H
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+enum
+{
+ AU_PVTYPE_LONG = 1,
+ AU_PVTYPE_DOUBLE = 2,
+ AU_PVTYPE_PTR = 3
+};
+
+typedef struct _AUpvlist *AUpvlist;
+
+#define AU_NULL_PVLIST ((struct _AUpvlist *) 0)
+
+AUpvlist AUpvnew (int maxItems);
+int AUpvgetmaxitems (AUpvlist);
+int AUpvfree (AUpvlist);
+int AUpvsetparam (AUpvlist, int item, int param);
+int AUpvsetvaltype (AUpvlist, int item, int type);
+int AUpvsetval (AUpvlist, int item, void *val);
+int AUpvgetparam (AUpvlist, int item, int *param);
+int AUpvgetvaltype (AUpvlist, int item, int *type);
+int AUpvgetval (AUpvlist, int item, void *val);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* AUPVLIST_H */
diff --git a/sysroot/usr/include/bits/a.out.h b/sysroot/usr/include/bits/a.out.h
new file mode 100644
index 0000000..228a8d4
--- /dev/null
+++ b/sysroot/usr/include/bits/a.out.h
@@ -0,0 +1,13 @@
+#ifndef __A_OUT_GNU_H__
+# error "Never use <bits/a.out.h> directly; include <a.out.h> instead."
+#endif
+
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 64
+
+/* Signal to users of this header that this architecture really doesn't
+ support a.out binary format. */
+#define __NO_A_OUT_SUPPORT 1
+
+#endif
diff --git a/sysroot/usr/include/bits/byteswap.h b/sysroot/usr/include/bits/byteswap.h
new file mode 100644
index 0000000..ec2b178
--- /dev/null
+++ b/sysroot/usr/include/bits/byteswap.h
@@ -0,0 +1,136 @@
+/* Macros to swap the order of bytes in integer values.
+ Copyright (C) 1997, 1998, 2000, 2002, 2003, 2007
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#if !defined _BYTESWAP_H && !defined _NETINET_IN_H
+# error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead."
+#endif
+
+#ifndef _BITS_BYTESWAP_H
+#define _BITS_BYTESWAP_H 1
+
+#include <bits/wordsize.h>
+
+/* Swap bytes in 16 bit value. */
+#define __bswap_constant_16(x) \
+ ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))
+
+#if defined __GNUC__ && __GNUC__ >= 2
+# define __bswap_16(x) \
+ (__extension__ \
+ ({ register unsigned short int __v, __x = (x); \
+ if (__builtin_constant_p (__x)) \
+ __v = __bswap_constant_16 (__x); \
+ else \
+ __asm__ ("rorw $8, %w0" \
+ : "=r" (__v) \
+ : "0" (__x) \
+ : "cc"); \
+ __v; }))
+#else
+/* This is better than nothing. */
+# define __bswap_16(x) \
+ (__extension__ \
+ ({ register unsigned short int __x = (x); __bswap_constant_16 (__x); }))
+#endif
+
+
+/* Swap bytes in 32 bit value. */
+#define __bswap_constant_32(x) \
+ ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \
+ (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))
+
+#if defined __GNUC__ && __GNUC__ >= 2
+# if __WORDSIZE == 64 || (defined __i486__ || defined __pentium__ \
+ || defined __pentiumpro__ || defined __pentium4__ \
+ || defined __k8__ || defined __athlon__ \
+ || defined __k6__ || defined __nocona__ \
+ || defined __core2__ || defined __geode__ \
+ || defined __amdfam10__)
+/* To swap the bytes in a word the i486 processors and up provide the
+ `bswap' opcode. On i386 we have to use three instructions. */
+# define __bswap_32(x) \
+ (__extension__ \
+ ({ register unsigned int __v, __x = (x); \
+ if (__builtin_constant_p (__x)) \
+ __v = __bswap_constant_32 (__x); \
+ else \
+ __asm__ ("bswap %0" : "=r" (__v) : "0" (__x)); \
+ __v; }))
+# else
+# define __bswap_32(x) \
+ (__extension__ \
+ ({ register unsigned int __v, __x = (x); \
+ if (__builtin_constant_p (__x)) \
+ __v = __bswap_constant_32 (__x); \
+ else \
+ __asm__ ("rorw $8, %w0;" \
+ "rorl $16, %0;" \
+ "rorw $8, %w0" \
+ : "=r" (__v) \
+ : "0" (__x) \
+ : "cc"); \
+ __v; }))
+# endif
+#else
+# define __bswap_32(x) \
+ (__extension__ \
+ ({ register unsigned int __x = (x); __bswap_constant_32 (__x); }))
+#endif
+
+
+#if defined __GNUC__ && __GNUC__ >= 2
+/* Swap bytes in 64 bit value. */
+# define __bswap_constant_64(x) \
+ ((((x) & 0xff00000000000000ull) >> 56) \
+ | (((x) & 0x00ff000000000000ull) >> 40) \
+ | (((x) & 0x0000ff0000000000ull) >> 24) \
+ | (((x) & 0x000000ff00000000ull) >> 8) \
+ | (((x) & 0x00000000ff000000ull) << 8) \
+ | (((x) & 0x0000000000ff0000ull) << 24) \
+ | (((x) & 0x000000000000ff00ull) << 40) \
+ | (((x) & 0x00000000000000ffull) << 56))
+
+# if __WORDSIZE == 64
+# define __bswap_64(x) \
+ (__extension__ \
+ ({ register unsigned long __v, __x = (x); \
+ if (__builtin_constant_p (__x)) \
+ __v = __bswap_constant_64 (__x); \
+ else \
+ __asm__ ("bswap %q0" : "=r" (__v) : "0" (__x)); \
+ __v; }))
+# else
+# define __bswap_64(x) \
+ (__extension__ \
+ ({ union { __extension__ unsigned long long int __ll; \
+ unsigned int __l[2]; } __w, __r; \
+ if (__builtin_constant_p (x)) \
+ __r.__ll = __bswap_constant_64 (x); \
+ else \
+ { \
+ __w.__ll = (x); \
+ __r.__l[0] = __bswap_32 (__w.__l[1]); \
+ __r.__l[1] = __bswap_32 (__w.__l[0]); \
+ } \
+ __r.__ll; }))
+# endif
+#endif
+
+#endif /* _BITS_BYTESWAP_H */
diff --git a/sysroot/usr/include/bits/cmathcalls.h b/sysroot/usr/include/bits/cmathcalls.h
new file mode 100644
index 0000000..9c7fdbe
--- /dev/null
+++ b/sysroot/usr/include/bits/cmathcalls.h
@@ -0,0 +1,159 @@
+/* Prototype declarations for complex math functions;
+ helper file for <complex.h>.
+ Copyright (C) 1997, 1998, 2001, 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* NOTE: Because of the special way this file is used by <complex.h>, this
+ file must NOT be protected from multiple inclusion as header files
+ usually are.
+
+ This file provides prototype declarations for the math functions.
+ Most functions are declared using the macro:
+
+ __MATHCALL (NAME, (ARGS...));
+
+ This means there is a function `NAME' returning `double' and a function
+ `NAMEf' returning `float'. Each place `_Mdouble_' appears in the
+ prototype, that is actually `double' in the prototype for `NAME' and
+ `float' in the prototype for `NAMEf'. Reentrant variant functions are
+ called `NAME_r' and `NAMEf_r'.
+
+ Functions returning other types like `int' are declared using the macro:
+
+ __MATHDECL (TYPE, NAME, (ARGS...));
+
+ This is just like __MATHCALL but for a function returning `TYPE'
+ instead of `_Mdouble_'. In all of these cases, there is still
+ both a `NAME' and a `NAMEf' that takes `float' arguments. */
+
+#ifndef _COMPLEX_H
+#error "Never use <bits/cmathcalls.h> directly; include <complex.h> instead."
+#endif
+
+#define _Mdouble_complex_ _Mdouble_ _Complex
+
+
+/* Trigonometric functions. */
+
+/* Arc cosine of Z. */
+__MATHCALL (cacos, (_Mdouble_complex_ __z));
+/* Arc sine of Z. */
+__MATHCALL (casin, (_Mdouble_complex_ __z));
+/* Arc tangent of Z. */
+__MATHCALL (catan, (_Mdouble_complex_ __z));
+
+/* Cosine of Z. */
+__MATHCALL (ccos, (_Mdouble_complex_ __z));
+/* Sine of Z. */
+__MATHCALL (csin, (_Mdouble_complex_ __z));
+/* Tangent of Z. */
+__MATHCALL (ctan, (_Mdouble_complex_ __z));
+
+
+/* Hyperbolic functions. */
+
+/* Hyperbolic arc cosine of Z. */
+__MATHCALL (cacosh, (_Mdouble_complex_ __z));
+/* Hyperbolic arc sine of Z. */
+__MATHCALL (casinh, (_Mdouble_complex_ __z));
+/* Hyperbolic arc tangent of Z. */
+__MATHCALL (catanh, (_Mdouble_complex_ __z));
+
+/* Hyperbolic cosine of Z. */
+__MATHCALL (ccosh, (_Mdouble_complex_ __z));
+/* Hyperbolic sine of Z. */
+__MATHCALL (csinh, (_Mdouble_complex_ __z));
+/* Hyperbolic tangent of Z. */
+__MATHCALL (ctanh, (_Mdouble_complex_ __z));
+
+
+/* Exponential and logarithmic functions. */
+
+/* Exponential function of Z. */
+__MATHCALL (cexp, (_Mdouble_complex_ __z));
+
+/* Natural logarithm of Z. */
+__MATHCALL (clog, (_Mdouble_complex_ __z));
+
+#ifdef __USE_GNU
+/* The base 10 logarithm is not defined by the standard but to implement
+ the standard C++ library it is handy. */
+__MATHCALL (clog10, (_Mdouble_complex_ __z));
+#endif
+
+/* Power functions. */
+
+/* Return X to the Y power. */
+__MATHCALL (cpow, (_Mdouble_complex_ __x, _Mdouble_complex_ __y));
+
+/* Return the square root of Z. */
+__MATHCALL (csqrt, (_Mdouble_complex_ __z));
+
+
+/* Absolute value, conjugates, and projection. */
+
+/* Absolute value of Z. */
+__MATHDECL (_Mdouble_,cabs, (_Mdouble_complex_ __z));
+
+/* Argument value of Z. */
+__MATHDECL (_Mdouble_,carg, (_Mdouble_complex_ __z));
+
+/* Complex conjugate of Z. */
+__MATHCALL (conj, (_Mdouble_complex_ __z));
+
+/* Projection of Z onto the Riemann sphere. */
+__MATHCALL (cproj, (_Mdouble_complex_ __z));
+
+
+/* Decomposing complex values. */
+
+/* Imaginary part of Z. */
+__MATHDECL (_Mdouble_,cimag, (_Mdouble_complex_ __z));
+
+/* Real part of Z. */
+__MATHDECL (_Mdouble_,creal, (_Mdouble_complex_ __z));
+
+
+/* Now some optimized versions. GCC has handy notations for these
+ functions. Recent GCC handles these as builtin functions so does
+ not need inlines. */
+#if defined __GNUC__ && !__GNUC_PREREQ (2, 97) && defined __OPTIMIZE__ \
+ && defined __extern_inline
+
+/* Imaginary part of Z. */
+__extern_inline _Mdouble_
+__MATH_PRECNAME(cimag) (_Mdouble_complex_ __z) __THROW
+{
+ return __imag__ __z;
+}
+
+/* Real part of Z. */
+__extern_inline _Mdouble_
+__MATH_PRECNAME(creal) (_Mdouble_complex_ __z) __THROW
+{
+ return __real__ __z;
+}
+
+/* Complex conjugate of Z. */
+__extern_inline _Mdouble_complex_
+__MATH_PRECNAME(conj) (_Mdouble_complex_ __z) __THROW
+{
+ return __extension__ ~__z;
+}
+
+#endif
diff --git a/sysroot/usr/include/bits/confname.h b/sysroot/usr/include/bits/confname.h
new file mode 100644
index 0000000..80b51ac
--- /dev/null
+++ b/sysroot/usr/include/bits/confname.h
@@ -0,0 +1,602 @@
+/* `sysconf', `pathconf', and `confstr' NAME values. Generic version.
+ Copyright (C) 1993,1995-1998,2000,2001,2003,2004,2007
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _UNISTD_H
+# error "Never use <bits/confname.h> directly; include <unistd.h> instead."
+#endif
+
+/* Values for the NAME argument to `pathconf' and `fpathconf'. */
+enum
+ {
+ _PC_LINK_MAX,
+#define _PC_LINK_MAX _PC_LINK_MAX
+ _PC_MAX_CANON,
+#define _PC_MAX_CANON _PC_MAX_CANON
+ _PC_MAX_INPUT,
+#define _PC_MAX_INPUT _PC_MAX_INPUT
+ _PC_NAME_MAX,
+#define _PC_NAME_MAX _PC_NAME_MAX
+ _PC_PATH_MAX,
+#define _PC_PATH_MAX _PC_PATH_MAX
+ _PC_PIPE_BUF,
+#define _PC_PIPE_BUF _PC_PIPE_BUF
+ _PC_CHOWN_RESTRICTED,
+#define _PC_CHOWN_RESTRICTED _PC_CHOWN_RESTRICTED
+ _PC_NO_TRUNC,
+#define _PC_NO_TRUNC _PC_NO_TRUNC
+ _PC_VDISABLE,
+#define _PC_VDISABLE _PC_VDISABLE
+ _PC_SYNC_IO,
+#define _PC_SYNC_IO _PC_SYNC_IO
+ _PC_ASYNC_IO,
+#define _PC_ASYNC_IO _PC_ASYNC_IO
+ _PC_PRIO_IO,
+#define _PC_PRIO_IO _PC_PRIO_IO
+ _PC_SOCK_MAXBUF,
+#define _PC_SOCK_MAXBUF _PC_SOCK_MAXBUF
+ _PC_FILESIZEBITS,
+#define _PC_FILESIZEBITS _PC_FILESIZEBITS
+ _PC_REC_INCR_XFER_SIZE,
+#define _PC_REC_INCR_XFER_SIZE _PC_REC_INCR_XFER_SIZE
+ _PC_REC_MAX_XFER_SIZE,
+#define _PC_REC_MAX_XFER_SIZE _PC_REC_MAX_XFER_SIZE
+ _PC_REC_MIN_XFER_SIZE,
+#define _PC_REC_MIN_XFER_SIZE _PC_REC_MIN_XFER_SIZE
+ _PC_REC_XFER_ALIGN,
+#define _PC_REC_XFER_ALIGN _PC_REC_XFER_ALIGN
+ _PC_ALLOC_SIZE_MIN,
+#define _PC_ALLOC_SIZE_MIN _PC_ALLOC_SIZE_MIN
+ _PC_SYMLINK_MAX,
+#define _PC_SYMLINK_MAX _PC_SYMLINK_MAX
+ _PC_2_SYMLINKS
+#define _PC_2_SYMLINKS _PC_2_SYMLINKS
+ };
+
+/* Values for the argument to `sysconf'. */
+enum
+ {
+ _SC_ARG_MAX,
+#define _SC_ARG_MAX _SC_ARG_MAX
+ _SC_CHILD_MAX,
+#define _SC_CHILD_MAX _SC_CHILD_MAX
+ _SC_CLK_TCK,
+#define _SC_CLK_TCK _SC_CLK_TCK
+ _SC_NGROUPS_MAX,
+#define _SC_NGROUPS_MAX _SC_NGROUPS_MAX
+ _SC_OPEN_MAX,
+#define _SC_OPEN_MAX _SC_OPEN_MAX
+ _SC_STREAM_MAX,
+#define _SC_STREAM_MAX _SC_STREAM_MAX
+ _SC_TZNAME_MAX,
+#define _SC_TZNAME_MAX _SC_TZNAME_MAX
+ _SC_JOB_CONTROL,
+#define _SC_JOB_CONTROL _SC_JOB_CONTROL
+ _SC_SAVED_IDS,
+#define _SC_SAVED_IDS _SC_SAVED_IDS
+ _SC_REALTIME_SIGNALS,
+#define _SC_REALTIME_SIGNALS _SC_REALTIME_SIGNALS
+ _SC_PRIORITY_SCHEDULING,
+#define _SC_PRIORITY_SCHEDULING _SC_PRIORITY_SCHEDULING
+ _SC_TIMERS,
+#define _SC_TIMERS _SC_TIMERS
+ _SC_ASYNCHRONOUS_IO,
+#define _SC_ASYNCHRONOUS_IO _SC_ASYNCHRONOUS_IO
+ _SC_PRIORITIZED_IO,
+#define _SC_PRIORITIZED_IO _SC_PRIORITIZED_IO
+ _SC_SYNCHRONIZED_IO,
+#define _SC_SYNCHRONIZED_IO _SC_SYNCHRONIZED_IO
+ _SC_FSYNC,
+#define _SC_FSYNC _SC_FSYNC
+ _SC_MAPPED_FILES,
+#define _SC_MAPPED_FILES _SC_MAPPED_FILES
+ _SC_MEMLOCK,
+#define _SC_MEMLOCK _SC_MEMLOCK
+ _SC_MEMLOCK_RANGE,
+#define _SC_MEMLOCK_RANGE _SC_MEMLOCK_RANGE
+ _SC_MEMORY_PROTECTION,
+#define _SC_MEMORY_PROTECTION _SC_MEMORY_PROTECTION
+ _SC_MESSAGE_PASSING,
+#define _SC_MESSAGE_PASSING _SC_MESSAGE_PASSING
+ _SC_SEMAPHORES,
+#define _SC_SEMAPHORES _SC_SEMAPHORES
+ _SC_SHARED_MEMORY_OBJECTS,
+#define _SC_SHARED_MEMORY_OBJECTS _SC_SHARED_MEMORY_OBJECTS
+ _SC_AIO_LISTIO_MAX,
+#define _SC_AIO_LISTIO_MAX _SC_AIO_LISTIO_MAX
+ _SC_AIO_MAX,
+#define _SC_AIO_MAX _SC_AIO_MAX
+ _SC_AIO_PRIO_DELTA_MAX,
+#define _SC_AIO_PRIO_DELTA_MAX _SC_AIO_PRIO_DELTA_MAX
+ _SC_DELAYTIMER_MAX,
+#define _SC_DELAYTIMER_MAX _SC_DELAYTIMER_MAX
+ _SC_MQ_OPEN_MAX,
+#define _SC_MQ_OPEN_MAX _SC_MQ_OPEN_MAX
+ _SC_MQ_PRIO_MAX,
+#define _SC_MQ_PRIO_MAX _SC_MQ_PRIO_MAX
+ _SC_VERSION,
+#define _SC_VERSION _SC_VERSION
+ _SC_PAGESIZE,
+#define _SC_PAGESIZE _SC_PAGESIZE
+#define _SC_PAGE_SIZE _SC_PAGESIZE
+ _SC_RTSIG_MAX,
+#define _SC_RTSIG_MAX _SC_RTSIG_MAX
+ _SC_SEM_NSEMS_MAX,
+#define _SC_SEM_NSEMS_MAX _SC_SEM_NSEMS_MAX
+ _SC_SEM_VALUE_MAX,
+#define _SC_SEM_VALUE_MAX _SC_SEM_VALUE_MAX
+ _SC_SIGQUEUE_MAX,
+#define _SC_SIGQUEUE_MAX _SC_SIGQUEUE_MAX
+ _SC_TIMER_MAX,
+#define _SC_TIMER_MAX _SC_TIMER_MAX
+
+ /* Values for the argument to `sysconf'
+ corresponding to _POSIX2_* symbols. */
+ _SC_BC_BASE_MAX,
+#define _SC_BC_BASE_MAX _SC_BC_BASE_MAX
+ _SC_BC_DIM_MAX,
+#define _SC_BC_DIM_MAX _SC_BC_DIM_MAX
+ _SC_BC_SCALE_MAX,
+#define _SC_BC_SCALE_MAX _SC_BC_SCALE_MAX
+ _SC_BC_STRING_MAX,
+#define _SC_BC_STRING_MAX _SC_BC_STRING_MAX
+ _SC_COLL_WEIGHTS_MAX,
+#define _SC_COLL_WEIGHTS_MAX _SC_COLL_WEIGHTS_MAX
+ _SC_EQUIV_CLASS_MAX,
+#define _SC_EQUIV_CLASS_MAX _SC_EQUIV_CLASS_MAX
+ _SC_EXPR_NEST_MAX,
+#define _SC_EXPR_NEST_MAX _SC_EXPR_NEST_MAX
+ _SC_LINE_MAX,
+#define _SC_LINE_MAX _SC_LINE_MAX
+ _SC_RE_DUP_MAX,
+#define _SC_RE_DUP_MAX _SC_RE_DUP_MAX
+ _SC_CHARCLASS_NAME_MAX,
+#define _SC_CHARCLASS_NAME_MAX _SC_CHARCLASS_NAME_MAX
+
+ _SC_2_VERSION,
+#define _SC_2_VERSION _SC_2_VERSION
+ _SC_2_C_BIND,
+#define _SC_2_C_BIND _SC_2_C_BIND
+ _SC_2_C_DEV,
+#define _SC_2_C_DEV _SC_2_C_DEV
+ _SC_2_FORT_DEV,
+#define _SC_2_FORT_DEV _SC_2_FORT_DEV
+ _SC_2_FORT_RUN,
+#define _SC_2_FORT_RUN _SC_2_FORT_RUN
+ _SC_2_SW_DEV,
+#define _SC_2_SW_DEV _SC_2_SW_DEV
+ _SC_2_LOCALEDEF,
+#define _SC_2_LOCALEDEF _SC_2_LOCALEDEF
+
+ _SC_PII,
+#define _SC_PII _SC_PII
+ _SC_PII_XTI,
+#define _SC_PII_XTI _SC_PII_XTI
+ _SC_PII_SOCKET,
+#define _SC_PII_SOCKET _SC_PII_SOCKET
+ _SC_PII_INTERNET,
+#define _SC_PII_INTERNET _SC_PII_INTERNET
+ _SC_PII_OSI,
+#define _SC_PII_OSI _SC_PII_OSI
+ _SC_POLL,
+#define _SC_POLL _SC_POLL
+ _SC_SELECT,
+#define _SC_SELECT _SC_SELECT
+ _SC_UIO_MAXIOV,
+#define _SC_UIO_MAXIOV _SC_UIO_MAXIOV
+ _SC_IOV_MAX = _SC_UIO_MAXIOV,
+#define _SC_IOV_MAX _SC_IOV_MAX
+ _SC_PII_INTERNET_STREAM,
+#define _SC_PII_INTERNET_STREAM _SC_PII_INTERNET_STREAM
+ _SC_PII_INTERNET_DGRAM,
+#define _SC_PII_INTERNET_DGRAM _SC_PII_INTERNET_DGRAM
+ _SC_PII_OSI_COTS,
+#define _SC_PII_OSI_COTS _SC_PII_OSI_COTS
+ _SC_PII_OSI_CLTS,
+#define _SC_PII_OSI_CLTS _SC_PII_OSI_CLTS
+ _SC_PII_OSI_M,
+#define _SC_PII_OSI_M _SC_PII_OSI_M
+ _SC_T_IOV_MAX,
+#define _SC_T_IOV_MAX _SC_T_IOV_MAX
+
+ /* Values according to POSIX 1003.1c (POSIX threads). */
+ _SC_THREADS,
+#define _SC_THREADS _SC_THREADS
+ _SC_THREAD_SAFE_FUNCTIONS,
+#define _SC_THREAD_SAFE_FUNCTIONS _SC_THREAD_SAFE_FUNCTIONS
+ _SC_GETGR_R_SIZE_MAX,
+#define _SC_GETGR_R_SIZE_MAX _SC_GETGR_R_SIZE_MAX
+ _SC_GETPW_R_SIZE_MAX,
+#define _SC_GETPW_R_SIZE_MAX _SC_GETPW_R_SIZE_MAX
+ _SC_LOGIN_NAME_MAX,
+#define _SC_LOGIN_NAME_MAX _SC_LOGIN_NAME_MAX
+ _SC_TTY_NAME_MAX,
+#define _SC_TTY_NAME_MAX _SC_TTY_NAME_MAX
+ _SC_THREAD_DESTRUCTOR_ITERATIONS,
+#define _SC_THREAD_DESTRUCTOR_ITERATIONS _SC_THREAD_DESTRUCTOR_ITERATIONS
+ _SC_THREAD_KEYS_MAX,
+#define _SC_THREAD_KEYS_MAX _SC_THREAD_KEYS_MAX
+ _SC_THREAD_STACK_MIN,
+#define _SC_THREAD_STACK_MIN _SC_THREAD_STACK_MIN
+ _SC_THREAD_THREADS_MAX,
+#define _SC_THREAD_THREADS_MAX _SC_THREAD_THREADS_MAX
+ _SC_THREAD_ATTR_STACKADDR,
+#define _SC_THREAD_ATTR_STACKADDR _SC_THREAD_ATTR_STACKADDR
+ _SC_THREAD_ATTR_STACKSIZE,
+#define _SC_THREAD_ATTR_STACKSIZE _SC_THREAD_ATTR_STACKSIZE
+ _SC_THREAD_PRIORITY_SCHEDULING,
+#define _SC_THREAD_PRIORITY_SCHEDULING _SC_THREAD_PRIORITY_SCHEDULING
+ _SC_THREAD_PRIO_INHERIT,
+#define _SC_THREAD_PRIO_INHERIT _SC_THREAD_PRIO_INHERIT
+ _SC_THREAD_PRIO_PROTECT,
+#define _SC_THREAD_PRIO_PROTECT _SC_THREAD_PRIO_PROTECT
+ _SC_THREAD_PROCESS_SHARED,
+#define _SC_THREAD_PROCESS_SHARED _SC_THREAD_PROCESS_SHARED
+
+ _SC_NPROCESSORS_CONF,
+#define _SC_NPROCESSORS_CONF _SC_NPROCESSORS_CONF
+ _SC_NPROCESSORS_ONLN,
+#define _SC_NPROCESSORS_ONLN _SC_NPROCESSORS_ONLN
+ _SC_PHYS_PAGES,
+#define _SC_PHYS_PAGES _SC_PHYS_PAGES
+ _SC_AVPHYS_PAGES,
+#define _SC_AVPHYS_PAGES _SC_AVPHYS_PAGES
+ _SC_ATEXIT_MAX,
+#define _SC_ATEXIT_MAX _SC_ATEXIT_MAX
+ _SC_PASS_MAX,
+#define _SC_PASS_MAX _SC_PASS_MAX
+
+ _SC_XOPEN_VERSION,
+#define _SC_XOPEN_VERSION _SC_XOPEN_VERSION
+ _SC_XOPEN_XCU_VERSION,
+#define _SC_XOPEN_XCU_VERSION _SC_XOPEN_XCU_VERSION
+ _SC_XOPEN_UNIX,
+#define _SC_XOPEN_UNIX _SC_XOPEN_UNIX
+ _SC_XOPEN_CRYPT,
+#define _SC_XOPEN_CRYPT _SC_XOPEN_CRYPT
+ _SC_XOPEN_ENH_I18N,
+#define _SC_XOPEN_ENH_I18N _SC_XOPEN_ENH_I18N
+ _SC_XOPEN_SHM,
+#define _SC_XOPEN_SHM _SC_XOPEN_SHM
+
+ _SC_2_CHAR_TERM,
+#define _SC_2_CHAR_TERM _SC_2_CHAR_TERM
+ _SC_2_C_VERSION,
+#define _SC_2_C_VERSION _SC_2_C_VERSION
+ _SC_2_UPE,
+#define _SC_2_UPE _SC_2_UPE
+
+ _SC_XOPEN_XPG2,
+#define _SC_XOPEN_XPG2 _SC_XOPEN_XPG2
+ _SC_XOPEN_XPG3,
+#define _SC_XOPEN_XPG3 _SC_XOPEN_XPG3
+ _SC_XOPEN_XPG4,
+#define _SC_XOPEN_XPG4 _SC_XOPEN_XPG4
+
+ _SC_CHAR_BIT,
+#define _SC_CHAR_BIT _SC_CHAR_BIT
+ _SC_CHAR_MAX,
+#define _SC_CHAR_MAX _SC_CHAR_MAX
+ _SC_CHAR_MIN,
+#define _SC_CHAR_MIN _SC_CHAR_MIN
+ _SC_INT_MAX,
+#define _SC_INT_MAX _SC_INT_MAX
+ _SC_INT_MIN,
+#define _SC_INT_MIN _SC_INT_MIN
+ _SC_LONG_BIT,
+#define _SC_LONG_BIT _SC_LONG_BIT
+ _SC_WORD_BIT,
+#define _SC_WORD_BIT _SC_WORD_BIT
+ _SC_MB_LEN_MAX,
+#define _SC_MB_LEN_MAX _SC_MB_LEN_MAX
+ _SC_NZERO,
+#define _SC_NZERO _SC_NZERO
+ _SC_SSIZE_MAX,
+#define _SC_SSIZE_MAX _SC_SSIZE_MAX
+ _SC_SCHAR_MAX,
+#define _SC_SCHAR_MAX _SC_SCHAR_MAX
+ _SC_SCHAR_MIN,
+#define _SC_SCHAR_MIN _SC_SCHAR_MIN
+ _SC_SHRT_MAX,
+#define _SC_SHRT_MAX _SC_SHRT_MAX
+ _SC_SHRT_MIN,
+#define _SC_SHRT_MIN _SC_SHRT_MIN
+ _SC_UCHAR_MAX,
+#define _SC_UCHAR_MAX _SC_UCHAR_MAX
+ _SC_UINT_MAX,
+#define _SC_UINT_MAX _SC_UINT_MAX
+ _SC_ULONG_MAX,
+#define _SC_ULONG_MAX _SC_ULONG_MAX
+ _SC_USHRT_MAX,
+#define _SC_USHRT_MAX _SC_USHRT_MAX
+
+ _SC_NL_ARGMAX,
+#define _SC_NL_ARGMAX _SC_NL_ARGMAX
+ _SC_NL_LANGMAX,
+#define _SC_NL_LANGMAX _SC_NL_LANGMAX
+ _SC_NL_MSGMAX,
+#define _SC_NL_MSGMAX _SC_NL_MSGMAX
+ _SC_NL_NMAX,
+#define _SC_NL_NMAX _SC_NL_NMAX
+ _SC_NL_SETMAX,
+#define _SC_NL_SETMAX _SC_NL_SETMAX
+ _SC_NL_TEXTMAX,
+#define _SC_NL_TEXTMAX _SC_NL_TEXTMAX
+
+ _SC_XBS5_ILP32_OFF32,
+#define _SC_XBS5_ILP32_OFF32 _SC_XBS5_ILP32_OFF32
+ _SC_XBS5_ILP32_OFFBIG,
+#define _SC_XBS5_ILP32_OFFBIG _SC_XBS5_ILP32_OFFBIG
+ _SC_XBS5_LP64_OFF64,
+#define _SC_XBS5_LP64_OFF64 _SC_XBS5_LP64_OFF64
+ _SC_XBS5_LPBIG_OFFBIG,
+#define _SC_XBS5_LPBIG_OFFBIG _SC_XBS5_LPBIG_OFFBIG
+
+ _SC_XOPEN_LEGACY,
+#define _SC_XOPEN_LEGACY _SC_XOPEN_LEGACY
+ _SC_XOPEN_REALTIME,
+#define _SC_XOPEN_REALTIME _SC_XOPEN_REALTIME
+ _SC_XOPEN_REALTIME_THREADS,
+#define _SC_XOPEN_REALTIME_THREADS _SC_XOPEN_REALTIME_THREADS
+
+ _SC_ADVISORY_INFO,
+#define _SC_ADVISORY_INFO _SC_ADVISORY_INFO
+ _SC_BARRIERS,
+#define _SC_BARRIERS _SC_BARRIERS
+ _SC_BASE,
+#define _SC_BASE _SC_BASE
+ _SC_C_LANG_SUPPORT,
+#define _SC_C_LANG_SUPPORT _SC_C_LANG_SUPPORT
+ _SC_C_LANG_SUPPORT_R,
+#define _SC_C_LANG_SUPPORT_R _SC_C_LANG_SUPPORT_R
+ _SC_CLOCK_SELECTION,
+#define _SC_CLOCK_SELECTION _SC_CLOCK_SELECTION
+ _SC_CPUTIME,
+#define _SC_CPUTIME _SC_CPUTIME
+ _SC_THREAD_CPUTIME,
+#define _SC_THREAD_CPUTIME _SC_THREAD_CPUTIME
+ _SC_DEVICE_IO,
+#define _SC_DEVICE_IO _SC_DEVICE_IO
+ _SC_DEVICE_SPECIFIC,
+#define _SC_DEVICE_SPECIFIC _SC_DEVICE_SPECIFIC
+ _SC_DEVICE_SPECIFIC_R,
+#define _SC_DEVICE_SPECIFIC_R _SC_DEVICE_SPECIFIC_R
+ _SC_FD_MGMT,
+#define _SC_FD_MGMT _SC_FD_MGMT
+ _SC_FIFO,
+#define _SC_FIFO _SC_FIFO
+ _SC_PIPE,
+#define _SC_PIPE _SC_PIPE
+ _SC_FILE_ATTRIBUTES,
+#define _SC_FILE_ATTRIBUTES _SC_FILE_ATTRIBUTES
+ _SC_FILE_LOCKING,
+#define _SC_FILE_LOCKING _SC_FILE_LOCKING
+ _SC_FILE_SYSTEM,
+#define _SC_FILE_SYSTEM _SC_FILE_SYSTEM
+ _SC_MONOTONIC_CLOCK,
+#define _SC_MONOTONIC_CLOCK _SC_MONOTONIC_CLOCK
+ _SC_MULTI_PROCESS,
+#define _SC_MULTI_PROCESS _SC_MULTI_PROCESS
+ _SC_SINGLE_PROCESS,
+#define _SC_SINGLE_PROCESS _SC_SINGLE_PROCESS
+ _SC_NETWORKING,
+#define _SC_NETWORKING _SC_NETWORKING
+ _SC_READER_WRITER_LOCKS,
+#define _SC_READER_WRITER_LOCKS _SC_READER_WRITER_LOCKS
+ _SC_SPIN_LOCKS,
+#define _SC_SPIN_LOCKS _SC_SPIN_LOCKS
+ _SC_REGEXP,
+#define _SC_REGEXP _SC_REGEXP
+ _SC_REGEX_VERSION,
+#define _SC_REGEX_VERSION _SC_REGEX_VERSION
+ _SC_SHELL,
+#define _SC_SHELL _SC_SHELL
+ _SC_SIGNALS,
+#define _SC_SIGNALS _SC_SIGNALS
+ _SC_SPAWN,
+#define _SC_SPAWN _SC_SPAWN
+ _SC_SPORADIC_SERVER,
+#define _SC_SPORADIC_SERVER _SC_SPORADIC_SERVER
+ _SC_THREAD_SPORADIC_SERVER,
+#define _SC_THREAD_SPORADIC_SERVER _SC_THREAD_SPORADIC_SERVER
+ _SC_SYSTEM_DATABASE,
+#define _SC_SYSTEM_DATABASE _SC_SYSTEM_DATABASE
+ _SC_SYSTEM_DATABASE_R,
+#define _SC_SYSTEM_DATABASE_R _SC_SYSTEM_DATABASE_R
+ _SC_TIMEOUTS,
+#define _SC_TIMEOUTS _SC_TIMEOUTS
+ _SC_TYPED_MEMORY_OBJECTS,
+#define _SC_TYPED_MEMORY_OBJECTS _SC_TYPED_MEMORY_OBJECTS
+ _SC_USER_GROUPS,
+#define _SC_USER_GROUPS _SC_USER_GROUPS
+ _SC_USER_GROUPS_R,
+#define _SC_USER_GROUPS_R _SC_USER_GROUPS_R
+ _SC_2_PBS,
+#define _SC_2_PBS _SC_2_PBS
+ _SC_2_PBS_ACCOUNTING,
+#define _SC_2_PBS_ACCOUNTING _SC_2_PBS_ACCOUNTING
+ _SC_2_PBS_LOCATE,
+#define _SC_2_PBS_LOCATE _SC_2_PBS_LOCATE
+ _SC_2_PBS_MESSAGE,
+#define _SC_2_PBS_MESSAGE _SC_2_PBS_MESSAGE
+ _SC_2_PBS_TRACK,
+#define _SC_2_PBS_TRACK _SC_2_PBS_TRACK
+ _SC_SYMLOOP_MAX,
+#define _SC_SYMLOOP_MAX _SC_SYMLOOP_MAX
+ _SC_STREAMS,
+#define _SC_STREAMS _SC_STREAMS
+ _SC_2_PBS_CHECKPOINT,
+#define _SC_2_PBS_CHECKPOINT _SC_2_PBS_CHECKPOINT
+
+ _SC_V6_ILP32_OFF32,
+#define _SC_V6_ILP32_OFF32 _SC_V6_ILP32_OFF32
+ _SC_V6_ILP32_OFFBIG,
+#define _SC_V6_ILP32_OFFBIG _SC_V6_ILP32_OFFBIG
+ _SC_V6_LP64_OFF64,
+#define _SC_V6_LP64_OFF64 _SC_V6_LP64_OFF64
+ _SC_V6_LPBIG_OFFBIG,
+#define _SC_V6_LPBIG_OFFBIG _SC_V6_LPBIG_OFFBIG
+
+ _SC_HOST_NAME_MAX,
+#define _SC_HOST_NAME_MAX _SC_HOST_NAME_MAX
+ _SC_TRACE,
+#define _SC_TRACE _SC_TRACE
+ _SC_TRACE_EVENT_FILTER,
+#define _SC_TRACE_EVENT_FILTER _SC_TRACE_EVENT_FILTER
+ _SC_TRACE_INHERIT,
+#define _SC_TRACE_INHERIT _SC_TRACE_INHERIT
+ _SC_TRACE_LOG,
+#define _SC_TRACE_LOG _SC_TRACE_LOG
+
+ _SC_LEVEL1_ICACHE_SIZE,
+#define _SC_LEVEL1_ICACHE_SIZE _SC_LEVEL1_ICACHE_SIZE
+ _SC_LEVEL1_ICACHE_ASSOC,
+#define _SC_LEVEL1_ICACHE_ASSOC _SC_LEVEL1_ICACHE_ASSOC
+ _SC_LEVEL1_ICACHE_LINESIZE,
+#define _SC_LEVEL1_ICACHE_LINESIZE _SC_LEVEL1_ICACHE_LINESIZE
+ _SC_LEVEL1_DCACHE_SIZE,
+#define _SC_LEVEL1_DCACHE_SIZE _SC_LEVEL1_DCACHE_SIZE
+ _SC_LEVEL1_DCACHE_ASSOC,
+#define _SC_LEVEL1_DCACHE_ASSOC _SC_LEVEL1_DCACHE_ASSOC
+ _SC_LEVEL1_DCACHE_LINESIZE,
+#define _SC_LEVEL1_DCACHE_LINESIZE _SC_LEVEL1_DCACHE_LINESIZE
+ _SC_LEVEL2_CACHE_SIZE,
+#define _SC_LEVEL2_CACHE_SIZE _SC_LEVEL2_CACHE_SIZE
+ _SC_LEVEL2_CACHE_ASSOC,
+#define _SC_LEVEL2_CACHE_ASSOC _SC_LEVEL2_CACHE_ASSOC
+ _SC_LEVEL2_CACHE_LINESIZE,
+#define _SC_LEVEL2_CACHE_LINESIZE _SC_LEVEL2_CACHE_LINESIZE
+ _SC_LEVEL3_CACHE_SIZE,
+#define _SC_LEVEL3_CACHE_SIZE _SC_LEVEL3_CACHE_SIZE
+ _SC_LEVEL3_CACHE_ASSOC,
+#define _SC_LEVEL3_CACHE_ASSOC _SC_LEVEL3_CACHE_ASSOC
+ _SC_LEVEL3_CACHE_LINESIZE,
+#define _SC_LEVEL3_CACHE_LINESIZE _SC_LEVEL3_CACHE_LINESIZE
+ _SC_LEVEL4_CACHE_SIZE,
+#define _SC_LEVEL4_CACHE_SIZE _SC_LEVEL4_CACHE_SIZE
+ _SC_LEVEL4_CACHE_ASSOC,
+#define _SC_LEVEL4_CACHE_ASSOC _SC_LEVEL4_CACHE_ASSOC
+ _SC_LEVEL4_CACHE_LINESIZE,
+#define _SC_LEVEL4_CACHE_LINESIZE _SC_LEVEL4_CACHE_LINESIZE
+ /* Leave room here, maybe we need a few more cache levels some day. */
+
+ _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,
+#define _SC_IPV6 _SC_IPV6
+ _SC_RAW_SOCKETS
+#define _SC_RAW_SOCKETS _SC_RAW_SOCKETS
+ };
+
+/* Values for the NAME argument to `confstr'. */
+enum
+ {
+ _CS_PATH, /* The default search path. */
+#define _CS_PATH _CS_PATH
+
+ _CS_V6_WIDTH_RESTRICTED_ENVS,
+#define _CS_V6_WIDTH_RESTRICTED_ENVS _CS_V6_WIDTH_RESTRICTED_ENVS
+#define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS _CS_V6_WIDTH_RESTRICTED_ENVS
+
+ _CS_GNU_LIBC_VERSION,
+#define _CS_GNU_LIBC_VERSION _CS_GNU_LIBC_VERSION
+ _CS_GNU_LIBPTHREAD_VERSION,
+#define _CS_GNU_LIBPTHREAD_VERSION _CS_GNU_LIBPTHREAD_VERSION
+
+ _CS_LFS_CFLAGS = 1000,
+#define _CS_LFS_CFLAGS _CS_LFS_CFLAGS
+ _CS_LFS_LDFLAGS,
+#define _CS_LFS_LDFLAGS _CS_LFS_LDFLAGS
+ _CS_LFS_LIBS,
+#define _CS_LFS_LIBS _CS_LFS_LIBS
+ _CS_LFS_LINTFLAGS,
+#define _CS_LFS_LINTFLAGS _CS_LFS_LINTFLAGS
+ _CS_LFS64_CFLAGS,
+#define _CS_LFS64_CFLAGS _CS_LFS64_CFLAGS
+ _CS_LFS64_LDFLAGS,
+#define _CS_LFS64_LDFLAGS _CS_LFS64_LDFLAGS
+ _CS_LFS64_LIBS,
+#define _CS_LFS64_LIBS _CS_LFS64_LIBS
+ _CS_LFS64_LINTFLAGS,
+#define _CS_LFS64_LINTFLAGS _CS_LFS64_LINTFLAGS
+
+ _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,
+#define _CS_XBS5_ILP32_OFF32_CFLAGS _CS_XBS5_ILP32_OFF32_CFLAGS
+ _CS_XBS5_ILP32_OFF32_LDFLAGS,
+#define _CS_XBS5_ILP32_OFF32_LDFLAGS _CS_XBS5_ILP32_OFF32_LDFLAGS
+ _CS_XBS5_ILP32_OFF32_LIBS,
+#define _CS_XBS5_ILP32_OFF32_LIBS _CS_XBS5_ILP32_OFF32_LIBS
+ _CS_XBS5_ILP32_OFF32_LINTFLAGS,
+#define _CS_XBS5_ILP32_OFF32_LINTFLAGS _CS_XBS5_ILP32_OFF32_LINTFLAGS
+ _CS_XBS5_ILP32_OFFBIG_CFLAGS,
+#define _CS_XBS5_ILP32_OFFBIG_CFLAGS _CS_XBS5_ILP32_OFFBIG_CFLAGS
+ _CS_XBS5_ILP32_OFFBIG_LDFLAGS,
+#define _CS_XBS5_ILP32_OFFBIG_LDFLAGS _CS_XBS5_ILP32_OFFBIG_LDFLAGS
+ _CS_XBS5_ILP32_OFFBIG_LIBS,
+#define _CS_XBS5_ILP32_OFFBIG_LIBS _CS_XBS5_ILP32_OFFBIG_LIBS
+ _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,
+#define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS _CS_XBS5_ILP32_OFFBIG_LINTFLAGS
+ _CS_XBS5_LP64_OFF64_CFLAGS,
+#define _CS_XBS5_LP64_OFF64_CFLAGS _CS_XBS5_LP64_OFF64_CFLAGS
+ _CS_XBS5_LP64_OFF64_LDFLAGS,
+#define _CS_XBS5_LP64_OFF64_LDFLAGS _CS_XBS5_LP64_OFF64_LDFLAGS
+ _CS_XBS5_LP64_OFF64_LIBS,
+#define _CS_XBS5_LP64_OFF64_LIBS _CS_XBS5_LP64_OFF64_LIBS
+ _CS_XBS5_LP64_OFF64_LINTFLAGS,
+#define _CS_XBS5_LP64_OFF64_LINTFLAGS _CS_XBS5_LP64_OFF64_LINTFLAGS
+ _CS_XBS5_LPBIG_OFFBIG_CFLAGS,
+#define _CS_XBS5_LPBIG_OFFBIG_CFLAGS _CS_XBS5_LPBIG_OFFBIG_CFLAGS
+ _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,
+#define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS _CS_XBS5_LPBIG_OFFBIG_LDFLAGS
+ _CS_XBS5_LPBIG_OFFBIG_LIBS,
+#define _CS_XBS5_LPBIG_OFFBIG_LIBS _CS_XBS5_LPBIG_OFFBIG_LIBS
+ _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,
+#define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
+
+ _CS_POSIX_V6_ILP32_OFF32_CFLAGS,
+#define _CS_POSIX_V6_ILP32_OFF32_CFLAGS _CS_POSIX_V6_ILP32_OFF32_CFLAGS
+ _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,
+#define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS _CS_POSIX_V6_ILP32_OFF32_LDFLAGS
+ _CS_POSIX_V6_ILP32_OFF32_LIBS,
+#define _CS_POSIX_V6_ILP32_OFF32_LIBS _CS_POSIX_V6_ILP32_OFF32_LIBS
+ _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,
+#define _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS
+ _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,
+#define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
+ _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,
+#define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
+ _CS_POSIX_V6_ILP32_OFFBIG_LIBS,
+#define _CS_POSIX_V6_ILP32_OFFBIG_LIBS _CS_POSIX_V6_ILP32_OFFBIG_LIBS
+ _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,
+#define _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS
+ _CS_POSIX_V6_LP64_OFF64_CFLAGS,
+#define _CS_POSIX_V6_LP64_OFF64_CFLAGS _CS_POSIX_V6_LP64_OFF64_CFLAGS
+ _CS_POSIX_V6_LP64_OFF64_LDFLAGS,
+#define _CS_POSIX_V6_LP64_OFF64_LDFLAGS _CS_POSIX_V6_LP64_OFF64_LDFLAGS
+ _CS_POSIX_V6_LP64_OFF64_LIBS,
+#define _CS_POSIX_V6_LP64_OFF64_LIBS _CS_POSIX_V6_LP64_OFF64_LIBS
+ _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,
+#define _CS_POSIX_V6_LP64_OFF64_LINTFLAGS _CS_POSIX_V6_LP64_OFF64_LINTFLAGS
+ _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,
+#define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
+ _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,
+#define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
+ _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,
+#define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS _CS_POSIX_V6_LPBIG_OFFBIG_LIBS
+ _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS
+#define _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS
+ };
diff --git a/sysroot/usr/include/bits/dirent.h b/sysroot/usr/include/bits/dirent.h
new file mode 100644
index 0000000..76794b0
--- /dev/null
+++ b/sysroot/usr/include/bits/dirent.h
@@ -0,0 +1,53 @@
+/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _DIRENT_H
+# error "Never use <bits/dirent.h> directly; include <dirent.h> instead."
+#endif
+
+struct dirent
+ {
+#ifndef __USE_FILE_OFFSET64
+ __ino_t d_ino;
+ __off_t d_off;
+#else
+ __ino64_t d_ino;
+ __off64_t d_off;
+#endif
+ unsigned short int d_reclen;
+ unsigned char d_type;
+ char d_name[256]; /* We must not include limits.h! */
+ };
+
+#ifdef __USE_LARGEFILE64
+struct dirent64
+ {
+ __ino64_t d_ino;
+ __off64_t d_off;
+ unsigned short int d_reclen;
+ unsigned char d_type;
+ char d_name[256]; /* We must not include limits.h! */
+ };
+#endif
+
+#define d_fileno d_ino /* Backwards compatibility. */
+
+#undef _DIRENT_HAVE_D_NAMLEN
+#define _DIRENT_HAVE_D_RECLEN
+#define _DIRENT_HAVE_D_OFF
+#define _DIRENT_HAVE_D_TYPE
diff --git a/sysroot/usr/include/bits/dlfcn.h b/sysroot/usr/include/bits/dlfcn.h
new file mode 100644
index 0000000..67fd96a
--- /dev/null
+++ b/sysroot/usr/include/bits/dlfcn.h
@@ -0,0 +1,65 @@
+/* System dependent definitions for run-time dynamic loading.
+ Copyright (C) 1996-2001, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _DLFCN_H
+# error "Never use <bits/dlfcn.h> directly; include <dlfcn.h> instead."
+#endif
+
+/* The MODE argument to `dlopen' contains one of the following: */
+#define RTLD_LAZY 0x00001 /* Lazy function call binding. */
+#define RTLD_NOW 0x00002 /* Immediate function call binding. */
+#define RTLD_BINDING_MASK 0x3 /* Mask of binding time value. */
+#define RTLD_NOLOAD 0x00004 /* Do not load the object. */
+#define RTLD_DEEPBIND 0x00008 /* Use deep binding. */
+
+/* If the following bit is set in the MODE argument to `dlopen',
+ the symbols of the loaded object and its dependencies are made
+ visible as if the object were linked directly into the program. */
+#define RTLD_GLOBAL 0x00100
+
+/* Unix98 demands the following flag which is the inverse to RTLD_GLOBAL.
+ The implementation does this by default and so we can define the
+ value to zero. */
+#define RTLD_LOCAL 0
+
+/* Do not delete object when closed. */
+#define RTLD_NODELETE 0x01000
+
+#ifdef __USE_GNU
+/* To support profiling of shared objects it is a good idea to call
+ the function found using `dlsym' using the following macro since
+ these calls do not use the PLT. But this would mean the dynamic
+ loader has no chance to find out when the function is called. The
+ macro applies the necessary magic so that profiling is possible.
+ Rewrite
+ foo = (*fctp) (arg1, arg2);
+ into
+ foo = DL_CALL_FCT (fctp, (arg1, arg2));
+*/
+# define DL_CALL_FCT(fctp, args) \
+ (_dl_mcount_wrapper_check ((void *) (fctp)), (*(fctp)) args)
+
+__BEGIN_DECLS
+
+/* This function calls the profiling functions. */
+extern void _dl_mcount_wrapper_check (void *__selfpc) __THROW;
+
+__END_DECLS
+
+#endif
diff --git a/sysroot/usr/include/bits/elfclass.h b/sysroot/usr/include/bits/elfclass.h
new file mode 100644
index 0000000..180227d
--- /dev/null
+++ b/sysroot/usr/include/bits/elfclass.h
@@ -0,0 +1,14 @@
+/* This file specifies the native word size of the machine, which indicates
+ the ELF file class used for executables and shared objects on this
+ machine. */
+
+#ifndef _LINK_H
+# error "Never use <bits/elfclass.h> directly; include <link.h> instead."
+#endif
+
+#include <bits/wordsize.h>
+
+#define __ELF_NATIVE_CLASS __WORDSIZE
+
+/* The entries in the .hash table always have a size of 32 bits. */
+typedef uint32_t Elf_Symndx;
diff --git a/sysroot/usr/include/bits/endian.h b/sysroot/usr/include/bits/endian.h
new file mode 100644
index 0000000..2f59ead
--- /dev/null
+++ b/sysroot/usr/include/bits/endian.h
@@ -0,0 +1,7 @@
+/* x86_64 is little-endian. */
+
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+#define __BYTE_ORDER __LITTLE_ENDIAN
diff --git a/sysroot/usr/include/bits/environments.h b/sysroot/usr/include/bits/environments.h
new file mode 100644
index 0000000..a51a564
--- /dev/null
+++ b/sysroot/usr/include/bits/environments.h
@@ -0,0 +1,87 @@
+/* Copyright (C) 1999, 2001, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _UNISTD_H
+# error "Never include this file directly. Use <unistd.h> instead"
+#endif
+
+#include <bits/wordsize.h>
+
+/* This header should define the following symbols under the described
+ situations. A value `1' means that the model is always supported,
+ `-1' means it is never supported. Undefined means it cannot be
+ statically decided.
+
+ _POSIX_V6_ILP32_OFF32 32bit int, long, pointers, and off_t type
+ _POSIX_V6_ILP32_OFFBIG 32bit int, long, and pointers and larger off_t type
+
+ _POSIX_V6_LP64_OFF32 64bit long and pointers and 32bit off_t type
+ _POSIX_V6_LPBIG_OFFBIG 64bit long and pointers and large off_t type
+
+ The macros _XBS5_ILP32_OFF32, _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and
+ _XBS5_LPBIG_OFFBIG were used in previous versions of the Unix standard
+ and are available only for compatibility.
+*/
+
+#if __WORDSIZE == 64
+
+/* Environments with 32-bit wide pointers are optionally provided.
+ Therefore following macros aren't defined:
+ # undef _POSIX_V6_ILP32_OFF32
+ # undef _POSIX_V6_ILP32_OFFBIG
+ # undef _XBS5_ILP32_OFF32
+ # undef _XBS5_ILP32_OFFBIG
+ and users need to check at runtime. */
+
+/* We also have no use (for now) for an environment with bigger pointers
+ and offsets. */
+# define _POSIX_V6_LPBIG_OFFBIG -1
+# define _XBS5_LPBIG_OFFBIG -1
+
+/* By default we have 64-bit wide `long int', pointers and `off_t'. */
+# define _POSIX_V6_LP64_OFF64 1
+# define _XBS5_LP64_OFF64 1
+
+#else /* __WORDSIZE == 32 */
+
+/* By default we have 32-bit wide `int', `long int', pointers and `off_t'
+ and all platforms support LFS. */
+# define _POSIX_V6_ILP32_OFF32 1
+# define _POSIX_V6_ILP32_OFFBIG 1
+# define _XBS5_ILP32_OFF32 1
+# define _XBS5_ILP32_OFFBIG 1
+
+/* We optionally provide an environment with the above size but an 64-bit
+ side `off_t'. Therefore we don't define _XBS5_ILP32_OFFBIG. */
+
+/* Environments with 64-bit wide pointers can be provided,
+ so these macros aren't defined:
+ # undef _POSIX_V6_LP64_OFF64
+ # undef _POSIX_V6_LPBIG_OFFBIG
+ # undef _XBS5_LP64_OFF64
+ # undef _XBS5_LPBIG_OFFBIG
+ and sysconf tests for it at runtime. */
+
+#endif /* __WORDSIZE == 32 */
+
+#define __ILP32_OFF32_CFLAGS "-m32"
+#define __ILP32_OFFBIG_CFLAGS "-m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
+#define __ILP32_OFF32_LDFLAGS "-m32"
+#define __ILP32_OFFBIG_LDFLAGS "-m32"
+#define __LP64_OFF64_CFLAGS "-m64"
+#define __LP64_OFF64_LDFLAGS "-m64"
diff --git a/sysroot/usr/include/bits/errno.h b/sysroot/usr/include/bits/errno.h
new file mode 100644
index 0000000..4de8cbb
--- /dev/null
+++ b/sysroot/usr/include/bits/errno.h
@@ -0,0 +1,59 @@
+/* Error constants. Linux specific version.
+ Copyright (C) 1996, 1997, 1998, 1999, 2005 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifdef _ERRNO_H
+
+# undef EDOM
+# undef EILSEQ
+# undef ERANGE
+# include <linux/errno.h>
+
+/* Linux has no ENOTSUP error code. */
+# define ENOTSUP EOPNOTSUPP
+
+/* Older Linux versions also had no ECANCELED error code. */
+# ifndef ECANCELED
+# define ECANCELED 125
+# endif
+
+/* Support for error codes to support robust mutexes was added later, too. */
+# ifndef EOWNERDEAD
+# define EOWNERDEAD 130
+# define ENOTRECOVERABLE 131
+# endif
+
+# ifndef __ASSEMBLER__
+/* Function to get address of global `errno' variable. */
+extern int *__errno_location (void) __THROW __attribute__ ((__const__));
+
+# if !defined _LIBC || defined _LIBC_REENTRANT
+/* When using threads, errno is a per-thread value. */
+# define errno (*__errno_location ())
+# endif
+# endif /* !__ASSEMBLER__ */
+#endif /* _ERRNO_H */
+
+#if !defined _ERRNO_H && defined __need_Emath
+/* This is ugly but the kernel header is not clean enough. We must
+ define only the values EDOM, EILSEQ and ERANGE in case __need_Emath is
+ defined. */
+# define EDOM 33 /* Math argument out of domain of function. */
+# define EILSEQ 84 /* Illegal byte sequence. */
+# define ERANGE 34 /* Math result not representable. */
+#endif /* !_ERRNO_H && __need_Emath */
diff --git a/sysroot/usr/include/bits/error.h b/sysroot/usr/include/bits/error.h
new file mode 100644
index 0000000..799a3f1
--- /dev/null
+++ b/sysroot/usr/include/bits/error.h
@@ -0,0 +1,74 @@
+/* Specializations for error functions.
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _ERROR_H
+# error "Never include <bits/error.h> directly; use <error.h> instead."
+#endif
+
+
+extern void __REDIRECT (__error_alias, (int __status, int __errnum,
+ __const char *__format, ...),
+ error)
+ __attribute__ ((__format__ (__printf__, 3, 4)));
+extern void __REDIRECT (__error_noreturn, (int __status, int __errnum,
+ __const char *__format, ...),
+ error)
+ __attribute__ ((__noreturn__, __format__ (__printf__, 3, 4)));
+
+
+/* If we know the function will never return make sure the compiler
+ realizes that, too. */
+__extern_always_inline void
+error (int __status, int __errnum, __const char *__format, ...)
+{
+ if (__builtin_constant_p (__status) && __status != 0)
+ __error_noreturn (__status, __errnum, __format, __va_arg_pack ());
+ else
+ __error_alias (__status, __errnum, __format, __va_arg_pack ());
+}
+
+
+extern void __REDIRECT (__error_at_line_alias, (int __status, int __errnum,
+ __const char *__fname,
+ unsigned int __line,
+ __const char *__format, ...),
+ error_at_line)
+ __attribute__ ((__format__ (__printf__, 5, 6)));
+extern void __REDIRECT (__error_at_line_noreturn, (int __status, int __errnum,
+ __const char *__fname,
+ unsigned int __line,
+ __const char *__format,
+ ...),
+ error_at_line)
+ __attribute__ ((__noreturn__, __format__ (__printf__, 5, 6)));
+
+
+/* If we know the function will never return make sure the compiler
+ realizes that, too. */
+__extern_always_inline void
+error_at_line (int __status, int __errnum, __const char *__fname,
+ unsigned int __line,__const char *__format, ...)
+{
+ if (__builtin_constant_p (__status) && __status != 0)
+ __error_at_line_noreturn (__status, __errnum, __fname, __line, __format,
+ __va_arg_pack ());
+ else
+ __error_at_line_alias (__status, __errnum, __fname, __line,
+ __format, __va_arg_pack ());
+}
diff --git a/sysroot/usr/include/bits/fcntl.h b/sysroot/usr/include/bits/fcntl.h
new file mode 100644
index 0000000..cf96ac7
--- /dev/null
+++ b/sysroot/usr/include/bits/fcntl.h
@@ -0,0 +1,254 @@
+/* O_*, F_*, FD_* bit values for Linux/x86-64.
+ Copyright (C) 2001, 2002, 2004, 2006, 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _FCNTL_H
+# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
+#endif
+
+#include <sys/types.h>
+#include <bits/wordsize.h>
+#ifdef __USE_GNU
+# include <bits/uio.h>
+#endif
+
+
+/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
+ located on an ext2 file system */
+#define O_ACCMODE 0003
+#define O_RDONLY 00
+#define O_WRONLY 01
+#define O_RDWR 02
+#define O_CREAT 0100 /* not fcntl */
+#define O_EXCL 0200 /* not fcntl */
+#define O_NOCTTY 0400 /* not fcntl */
+#define O_TRUNC 01000 /* not fcntl */
+#define O_APPEND 02000
+#define O_NONBLOCK 04000
+#define O_NDELAY O_NONBLOCK
+#define O_SYNC 010000
+#define O_FSYNC O_SYNC
+#define O_ASYNC 020000
+
+#ifdef __USE_GNU
+# define O_DIRECT 040000 /* Direct disk access. */
+# define O_DIRECTORY 0200000 /* Must be a directory. */
+# define O_NOFOLLOW 0400000 /* Do not follow links. */
+# define O_NOATIME 01000000 /* Do not set atime. */
+# define O_CLOEXEC 02000000 /* Set close_on_exec. */
+#endif
+
+/* For now Linux has synchronisity options for data and read operations.
+ We define the symbols here but let them do the same as O_SYNC since
+ this is a superset. */
+#if defined __USE_POSIX199309 || defined __USE_UNIX98
+# define O_DSYNC O_SYNC /* Synchronize data. */
+# define O_RSYNC O_SYNC /* Synchronize read operations. */
+#endif
+
+#ifdef __USE_LARGEFILE64
+# if __WORDSIZE == 64
+# define O_LARGEFILE 0
+# else
+# define O_LARGEFILE 0100000
+# endif
+#endif
+
+/* Values for the second argument to `fcntl'. */
+#define F_DUPFD 0 /* Duplicate file descriptor. */
+#define F_GETFD 1 /* Get file descriptor flags. */
+#define F_SETFD 2 /* Set file descriptor flags. */
+#define F_GETFL 3 /* Get file status flags. */
+#define F_SETFL 4 /* Set file status flags. */
+#if __WORDSIZE == 64
+# define F_GETLK 5 /* Get record locking info. */
+# define F_SETLK 6 /* Set record locking info (non-blocking). */
+# define F_SETLKW 7 /* Set record locking info (blocking). */
+/* Not necessary, we always have 64-bit offsets. */
+# define F_GETLK64 5 /* Get record locking info. */
+# define F_SETLK64 6 /* Set record locking info (non-blocking). */
+# define F_SETLKW64 7 /* Set record locking info (blocking). */
+#else
+# ifndef __USE_FILE_OFFSET64
+# define F_GETLK 5 /* Get record locking info. */
+# define F_SETLK 6 /* Set record locking info (non-blocking). */
+# define F_SETLKW 7 /* Set record locking info (blocking). */
+# else
+# define F_GETLK F_GETLK64 /* Get record locking info. */
+# define F_SETLK F_SETLK64 /* Set record locking info (non-blocking).*/
+# define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */
+# endif
+# define F_GETLK64 12 /* Get record locking info. */
+# define F_SETLK64 13 /* Set record locking info (non-blocking). */
+# define F_SETLKW64 14 /* Set record locking info (blocking). */
+#endif
+
+#if defined __USE_BSD || defined __USE_UNIX98
+# define F_SETOWN 8 /* Get owner of socket (receiver of SIGIO). */
+# define F_GETOWN 9 /* Set owner of socket (receiver of SIGIO). */
+#endif
+
+#ifdef __USE_GNU
+# define F_SETSIG 10 /* Set number of signal to be sent. */
+# define F_GETSIG 11 /* Get number of signal to be sent. */
+#endif
+
+#ifdef __USE_GNU
+# define F_SETLEASE 1024 /* Set a lease. */
+# define F_GETLEASE 1025 /* Enquire what lease is active. */
+# define F_NOTIFY 1026 /* Request notfications on a directory. */
+# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
+ close-on-exit set. */
+#endif
+
+/* For F_[GET|SET]FD. */
+#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
+
+/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */
+#define F_RDLCK 0 /* Read lock. */
+#define F_WRLCK 1 /* Write lock. */
+#define F_UNLCK 2 /* Remove lock. */
+
+/* For old implementation of bsd flock(). */
+#define F_EXLCK 4 /* or 3 */
+#define F_SHLCK 8 /* or 4 */
+
+#ifdef __USE_BSD
+/* Operations for bsd flock(), also used by the kernel implementation. */
+# define LOCK_SH 1 /* shared lock */
+# define LOCK_EX 2 /* exclusive lock */
+# define LOCK_NB 4 /* or'd with one of the above to prevent
+ blocking */
+# define LOCK_UN 8 /* remove lock */
+#endif
+
+#ifdef __USE_GNU
+# define LOCK_MAND 32 /* This is a mandatory flock: */
+# define LOCK_READ 64 /* ... which allows concurrent read operations. */
+# define LOCK_WRITE 128 /* ... which allows concurrent write operations. */
+# define LOCK_RW 192 /* ... Which allows concurrent read & write operations. */
+#endif
+
+#ifdef __USE_GNU
+/* Types of directory notifications that may be requested with F_NOTIFY. */
+# define DN_ACCESS 0x00000001 /* File accessed. */
+# define DN_MODIFY 0x00000002 /* File modified. */
+# define DN_CREATE 0x00000004 /* File created. */
+# define DN_DELETE 0x00000008 /* File removed. */
+# define DN_RENAME 0x00000010 /* File renamed. */
+# define DN_ATTRIB 0x00000020 /* File changed attibutes. */
+# define DN_MULTISHOT 0x80000000 /* Don't remove notifier. */
+#endif
+
+struct flock
+ {
+ short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
+ short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
+#ifndef __USE_FILE_OFFSET64
+ __off_t l_start; /* Offset where the lock begins. */
+ __off_t l_len; /* Size of the locked area; zero means until EOF. */
+#else
+ __off64_t l_start; /* Offset where the lock begins. */
+ __off64_t l_len; /* Size of the locked area; zero means until EOF. */
+#endif
+ __pid_t l_pid; /* Process holding the lock. */
+ };
+
+#ifdef __USE_LARGEFILE64
+struct flock64
+ {
+ short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
+ short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
+ __off64_t l_start; /* Offset where the lock begins. */
+ __off64_t l_len; /* Size of the locked area; zero means until EOF. */
+ __pid_t l_pid; /* Process holding the lock. */
+ };
+#endif
+
+/* Define some more compatibility macros to be backward compatible with
+ BSD systems which did not managed to hide these kernel macros. */
+#ifdef __USE_BSD
+# define FAPPEND O_APPEND
+# define FFSYNC O_FSYNC
+# define FASYNC O_ASYNC
+# define FNONBLOCK O_NONBLOCK
+# define FNDELAY O_NDELAY
+#endif /* Use BSD. */
+
+/* Advise to `posix_fadvise'. */
+#ifdef __USE_XOPEN2K
+# define POSIX_FADV_NORMAL 0 /* No further special treatment. */
+# define POSIX_FADV_RANDOM 1 /* Expect random page references. */
+# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */
+# define POSIX_FADV_WILLNEED 3 /* Will need these pages. */
+# define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */
+# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
+#endif
+
+
+#ifdef __USE_GNU
+/* Flags for SYNC_FILE_RANGE. */
+# define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
+ in the range before performing the
+ write. */
+# define SYNC_FILE_RANGE_WRITE 2 /* Initiate writeout of all those
+ dirty pages in the range which are
+ not presently under writeback. */
+# define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
+ the range after performing the
+ write. */
+
+/* Flags for SPLICE and VMSPLICE. */
+# define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
+# define SPLICE_F_NONBLOCK 2 /* Don't block on the pipe splicing
+ (but we may still block on the fd
+ we splice from/to). */
+# define SPLICE_F_MORE 4 /* Expect more data. */
+# define SPLICE_F_GIFT 8 /* Pages passed in are a gift. */
+#endif
+
+__BEGIN_DECLS
+
+#ifdef __USE_GNU
+
+/* Provide kernel hint to read ahead. */
+extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
+ __THROW;
+
+
+/* Selective file content synch'ing. */
+extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
+ unsigned int __flags);
+
+
+/* Splice address range into a pipe. */
+extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
+ size_t __count, unsigned int __flags);
+
+/* Splice two files together. */
+extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
+ __off64_t *__offout, size_t __len,
+ unsigned int __flags);
+
+/* In-kernel implementation of tee for pipe buffers. */
+extern ssize_t tee (int __fdin, int __fdout, size_t __len,
+ unsigned int __flags);
+
+#endif
+
+__END_DECLS
diff --git a/sysroot/usr/include/bits/fcntl2.h b/sysroot/usr/include/bits/fcntl2.h
new file mode 100644
index 0000000..fbe8585
--- /dev/null
+++ b/sysroot/usr/include/bits/fcntl2.h
@@ -0,0 +1,173 @@
+/* Checking macros for fcntl functions.
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _FCNTL_H
+# error "Never include <bits/fcntl2.h> directly; use <fcntl.h> instead."
+#endif
+
+/* Check that calls to open and openat with O_CREAT set have an
+ appropriate third/fourth parameter. */
+#ifndef __USE_FILE_OFFSET64
+extern int __open_2 (__const char *__path, int __oflag) __nonnull ((1));
+extern int __REDIRECT (__open_alias, (__const char *__path, int __oflag, ...),
+ open) __nonnull ((1));
+#else
+extern int __REDIRECT (__open_2, (__const char *__path, int __oflag),
+ __open64_2) __nonnull ((1));
+extern int __REDIRECT (__open_alias, (__const char *__path, int __oflag, ...),
+ open64) __nonnull ((1));
+#endif
+__errordecl (__open_too_many_args,
+ "open can be called either with 2 or 3 arguments, not more");
+__errordecl (__open_missing_mode,
+ "open with O_CREAT in second argument needs 3 arguments");
+
+__extern_always_inline int
+open (__const char *__path, int __oflag, ...)
+{
+ if (__va_arg_pack_len () > 1)
+ __open_too_many_args ();
+
+ if (__builtin_constant_p (__oflag))
+ {
+ if ((__oflag & O_CREAT) != 0 && __va_arg_pack_len () < 1)
+ {
+ __open_missing_mode ();
+ return __open_2 (__path, __oflag);
+ }
+ return __open_alias (__path, __oflag, __va_arg_pack ());
+ }
+
+ if (__va_arg_pack_len () < 1)
+ return __open_2 (__path, __oflag);
+
+ return __open_alias (__path, __oflag, __va_arg_pack ());
+}
+
+
+#ifdef __USE_LARGEFILE64
+extern int __open64_2 (__const char *__path, int __oflag) __nonnull ((1));
+extern int __REDIRECT (__open64_alias, (__const char *__path, int __oflag,
+ ...), open64) __nonnull ((1));
+__errordecl (__open64_too_many_args,
+ "open64 can be called either with 2 or 3 arguments, not more");
+__errordecl (__open64_missing_mode,
+ "open64 with O_CREAT in second argument needs 3 arguments");
+
+__extern_always_inline int
+open64 (__const char *__path, int __oflag, ...)
+{
+ if (__va_arg_pack_len () > 1)
+ __open64_too_many_args ();
+
+ if (__builtin_constant_p (__oflag))
+ {
+ if ((__oflag & O_CREAT) != 0 && __va_arg_pack_len () < 1)
+ {
+ __open64_missing_mode ();
+ return __open64_2 (__path, __oflag);
+ }
+ return __open64_alias (__path, __oflag, __va_arg_pack ());
+ }
+
+ if (__va_arg_pack_len () < 1)
+ return __open64_2 (__path, __oflag);
+
+ return __open64_alias (__path, __oflag, __va_arg_pack ());
+}
+#endif
+
+
+#ifdef __USE_ATFILE
+# ifndef __USE_FILE_OFFSET64
+extern int __openat_2 (int __fd, __const char *__path, int __oflag)
+ __nonnull ((2));
+extern int __REDIRECT (__openat_alias, (int __fd, __const char *__path,
+ int __oflag, ...), openat)
+ __nonnull ((2));
+# else
+extern int __REDIRECT (__openat_2, (int __fd, __const char *__path,
+ int __oflag), __openat64_2)
+ __nonnull ((2));
+extern int __REDIRECT (__openat_alias, (int __fd, __const char *__path,
+ int __oflag, ...), openat64)
+ __nonnull ((2));
+# endif
+__errordecl (__openat_too_many_args,
+ "openat can be called either with 3 or 4 arguments, not more");
+__errordecl (__openat_missing_mode,
+ "openat with O_CREAT in third argument needs 4 arguments");
+
+__extern_always_inline int
+openat (int __fd, __const char *__path, int __oflag, ...)
+{
+ if (__va_arg_pack_len () > 1)
+ __openat_too_many_args ();
+
+ if (__builtin_constant_p (__oflag))
+ {
+ if ((__oflag & O_CREAT) != 0 && __va_arg_pack_len () < 1)
+ {
+ __openat_missing_mode ();
+ return __openat_2 (__fd, __path, __oflag);
+ }
+ return __openat_alias (__fd, __path, __oflag, __va_arg_pack ());
+ }
+
+ if (__va_arg_pack_len () < 1)
+ return __openat_2 (__fd, __path, __oflag);
+
+ return __openat_alias (__fd, __path, __oflag, __va_arg_pack ());
+}
+
+
+# ifdef __USE_LARGEFILE64
+extern int __openat64_2 (int __fd, __const char *__path, int __oflag)
+ __nonnull ((2));
+extern int __REDIRECT (__openat64_alias, (int __fd, __const char *__path,
+ int __oflag, ...), openat64)
+ __nonnull ((2));
+__errordecl (__openat64_too_many_args,
+ "openat64 can be called either with 3 or 4 arguments, not more");
+__errordecl (__openat64_missing_mode,
+ "openat64 with O_CREAT in third argument needs 4 arguments");
+
+__extern_always_inline int
+openat64 (int __fd, __const char *__path, int __oflag, ...)
+{
+ if (__va_arg_pack_len () > 1)
+ __openat64_too_many_args ();
+
+ if (__builtin_constant_p (__oflag))
+ {
+ if ((__oflag & O_CREAT) != 0 && __va_arg_pack_len () < 1)
+ {
+ __openat64_missing_mode ();
+ return __openat64_2 (__fd, __path, __oflag);
+ }
+ return __openat64_alias (__fd, __path, __oflag, __va_arg_pack ());
+ }
+
+ if (__va_arg_pack_len () < 1)
+ return __openat64_2 (__fd, __path, __oflag);
+
+ return __openat64_alias (__fd, __path, __oflag, __va_arg_pack ());
+}
+# endif
+#endif
diff --git a/sysroot/usr/include/bits/fenv.h b/sysroot/usr/include/bits/fenv.h
new file mode 100644
index 0000000..11859f0
--- /dev/null
+++ b/sysroot/usr/include/bits/fenv.h
@@ -0,0 +1,97 @@
+/* Copyright (C) 1997,1998,1999,2000,2001,2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _FENV_H
+# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
+#endif
+
+#include <bits/wordsize.h>
+
+
+/* Define bits representing the exception. We use the bit positions
+ of the appropriate bits in the FPU control word. */
+enum
+ {
+ FE_INVALID = 0x01,
+#define FE_INVALID FE_INVALID
+ __FE_DENORM = 0x02,
+ FE_DIVBYZERO = 0x04,
+#define FE_DIVBYZERO FE_DIVBYZERO
+ FE_OVERFLOW = 0x08,
+#define FE_OVERFLOW FE_OVERFLOW
+ FE_UNDERFLOW = 0x10,
+#define FE_UNDERFLOW FE_UNDERFLOW
+ FE_INEXACT = 0x20
+#define FE_INEXACT FE_INEXACT
+ };
+
+#define FE_ALL_EXCEPT \
+ (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
+
+/* The ix87 FPU supports all of the four defined rounding modes. We
+ use again the bit positions in the FPU control word as the values
+ for the appropriate macros. */
+enum
+ {
+ FE_TONEAREST = 0,
+#define FE_TONEAREST FE_TONEAREST
+ FE_DOWNWARD = 0x400,
+#define FE_DOWNWARD FE_DOWNWARD
+ FE_UPWARD = 0x800,
+#define FE_UPWARD FE_UPWARD
+ FE_TOWARDZERO = 0xc00
+#define FE_TOWARDZERO FE_TOWARDZERO
+ };
+
+
+/* Type representing exception flags. */
+typedef unsigned short int fexcept_t;
+
+
+/* Type representing floating-point environment. This structure
+ corresponds to the layout of the block written by the `fstenv'
+ instruction and has additional fields for the contents of the MXCSR
+ register as written by the `stmxcsr' instruction. */
+typedef struct
+ {
+ unsigned short int __control_word;
+ unsigned short int __unused1;
+ unsigned short int __status_word;
+ unsigned short int __unused2;
+ unsigned short int __tags;
+ unsigned short int __unused3;
+ unsigned int __eip;
+ unsigned short int __cs_selector;
+ unsigned int __opcode:11;
+ unsigned int __unused4:5;
+ unsigned int __data_offset;
+ unsigned short int __data_selector;
+ unsigned short int __unused5;
+#if __WORDSIZE == 64
+ unsigned int __mxcsr;
+#endif
+ }
+fenv_t;
+
+/* If the default argument is used we use this value. */
+#define FE_DFL_ENV ((__const fenv_t *) -1)
+
+#ifdef __USE_GNU
+/* Floating-point environment where none of the exception is masked. */
+# define FE_NOMASK_ENV ((__const fenv_t *) -2)
+#endif
diff --git a/sysroot/usr/include/bits/fenvinline.h b/sysroot/usr/include/bits/fenvinline.h
new file mode 100644
index 0000000..42f77b5
--- /dev/null
+++ b/sysroot/usr/include/bits/fenvinline.h
@@ -0,0 +1,8 @@
+/* This file provides inline versions of floating-pint environment
+ handling functions. If there were any. */
+
+#ifndef __NO_MATH_INLINES
+
+/* Here is where the code would go. */
+
+#endif
diff --git a/sysroot/usr/include/bits/huge_val.h b/sysroot/usr/include/bits/huge_val.h
new file mode 100644
index 0000000..11ca11f
--- /dev/null
+++ b/sysroot/usr/include/bits/huge_val.h
@@ -0,0 +1,55 @@
+/* `HUGE_VAL' constant for IEEE 754 machines (where it is infinity).
+ Used by <stdlib.h> and <math.h> functions for overflow.
+ Copyright (C) 1992, 1995, 1996, 1997, 1999, 2000, 2004
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _MATH_H
+# error "Never use <bits/huge_val.h> directly; include <math.h> instead."
+#endif
+
+/* IEEE positive infinity (-HUGE_VAL is negative infinity). */
+
+#if __GNUC_PREREQ(3,3)
+# define HUGE_VAL (__builtin_huge_val())
+#elif __GNUC_PREREQ(2,96)
+# define HUGE_VAL (__extension__ 0x1.0p2047)
+#elif defined __GNUC__
+
+# define HUGE_VAL \
+ (__extension__ \
+ ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; }) \
+ { __l: 0x7ff0000000000000ULL }).__d)
+
+#else /* not GCC */
+
+# include <endian.h>
+
+typedef union { unsigned char __c[8]; double __d; } __huge_val_t;
+
+# if __BYTE_ORDER == __BIG_ENDIAN
+# define __HUGE_VAL_bytes { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 }
+# endif
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+# define __HUGE_VAL_bytes { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f }
+# endif
+
+static __huge_val_t __huge_val = { __HUGE_VAL_bytes };
+# define HUGE_VAL (__huge_val.__d)
+
+#endif /* GCC. */
diff --git a/sysroot/usr/include/bits/huge_valf.h b/sysroot/usr/include/bits/huge_valf.h
new file mode 100644
index 0000000..1785342
--- /dev/null
+++ b/sysroot/usr/include/bits/huge_valf.h
@@ -0,0 +1,53 @@
+/* `HUGE_VALF' constant for IEEE 754 machines (where it is infinity).
+ Used by <stdlib.h> and <math.h> functions for overflow.
+ Copyright (C) 1992, 1995, 1996, 1997, 1999, 2000, 2004
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _MATH_H
+# error "Never use <bits/huge_valf.h> directly; include <math.h> instead."
+#endif
+
+/* IEEE positive infinity (-HUGE_VAL is negative infinity). */
+
+#if __GNUC_PREREQ(3,3)
+# define HUGE_VALF (__builtin_huge_valf())
+#elif __GNUC_PREREQ(2,96)
+# define HUGE_VALF (__extension__ 0x1.0p255f)
+#elif defined __GNUC__
+
+# define HUGE_VALF \
+ (__extension__ \
+ ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; }) \
+ { __l: 0x7f800000UL }).__d)
+
+#else /* not GCC */
+
+typedef union { unsigned char __c[4]; float __f; } __huge_valf_t;
+
+# if __BYTE_ORDER == __BIG_ENDIAN
+# define __HUGE_VALF_bytes { 0x7f, 0x80, 0, 0 }
+# endif
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+# define __HUGE_VALF_bytes { 0, 0, 0x80, 0x7f }
+# endif
+
+static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes };
+# define HUGE_VALF (__huge_valf.__f)
+
+#endif /* GCC. */
diff --git a/sysroot/usr/include/bits/huge_vall.h b/sysroot/usr/include/bits/huge_vall.h
new file mode 100644
index 0000000..d5e8e22
--- /dev/null
+++ b/sysroot/usr/include/bits/huge_vall.h
@@ -0,0 +1,29 @@
+/* Default `HUGE_VALL' constant.
+ Used by <stdlib.h> and <math.h> functions for overflow.
+ Copyright (C) 1992, 1996, 1997, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _MATH_H
+# error "Never use <bits/huge_vall.h> directly; include <math.h> instead."
+#endif
+
+#if __GNUC_PREREQ(3,3)
+# define HUGE_VALL (__builtin_huge_vall())
+#else
+# define HUGE_VALL ((long double) HUGE_VAL)
+#endif
diff --git a/sysroot/usr/include/bits/in.h b/sysroot/usr/include/bits/in.h
new file mode 100644
index 0000000..6880a2e
--- /dev/null
+++ b/sysroot/usr/include/bits/in.h
@@ -0,0 +1,170 @@
+/* Copyright (C) 1991-1999, 2000, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Linux version. */
+
+#ifndef _NETINET_IN_H
+# error "Never use <bits/in.h> directly; include <netinet/in.h> instead."
+#endif
+
+/* Options for use with `getsockopt' and `setsockopt' at the IP level.
+ The first word in the comment at the right is the data type used;
+ "bool" means a boolean value stored in an `int'. */
+#define IP_OPTIONS 4 /* ip_opts; IP per-packet options. */
+#define IP_HDRINCL 3 /* int; Header is included with data. */
+#define IP_TOS 1 /* int; IP type of service and precedence. */
+#define IP_TTL 2 /* int; IP time to live. */
+#define IP_RECVOPTS 6 /* bool; Receive all IP options w/datagram. */
+/* For BSD compatibility. */
+#define IP_RECVRETOPTS IP_RETOPTS /* bool; Receive IP options for response. */
+#define IP_RETOPTS 7 /* ip_opts; Set/get IP per-packet options. */
+#define IP_MULTICAST_IF 32 /* in_addr; set/get IP multicast i/f */
+#define IP_MULTICAST_TTL 33 /* u_char; set/get IP multicast ttl */
+#define IP_MULTICAST_LOOP 34 /* i_char; set/get IP multicast loopback */
+#define IP_ADD_MEMBERSHIP 35 /* ip_mreq; add an IP group membership */
+#define IP_DROP_MEMBERSHIP 36 /* ip_mreq; drop an IP group membership */
+#define IP_UNBLOCK_SOURCE 37 /* ip_mreq_source: unblock data from source */
+#define IP_BLOCK_SOURCE 38 /* ip_mreq_source: block data from source */
+#define IP_ADD_SOURCE_MEMBERSHIP 39 /* ip_mreq_source: join source group */
+#define IP_DROP_SOURCE_MEMBERSHIP 40 /* ip_mreq_source: leave source group */
+#define IP_MSFILTER 41
+#define MCAST_JOIN_GROUP 42 /* group_req: join any-source group */
+#define MCAST_BLOCK_SOURCE 43 /* group_source_req: block from given group */
+#define MCAST_UNBLOCK_SOURCE 44 /* group_source_req: unblock from given group*/
+#define MCAST_LEAVE_GROUP 45 /* group_req: leave any-source group */
+#define MCAST_JOIN_SOURCE_GROUP 46 /* group_source_req: join source-spec gr */
+#define MCAST_LEAVE_SOURCE_GROUP 47 /* group_source_req: leave source-spec gr*/
+#define MCAST_MSFILTER 48
+
+#define MCAST_EXCLUDE 0
+#define MCAST_INCLUDE 1
+
+#define IP_ROUTER_ALERT 5 /* bool */
+#define IP_PKTINFO 8 /* bool */
+#define IP_PKTOPTIONS 9
+#define IP_PMTUDISC 10 /* obsolete name? */
+#define IP_MTU_DISCOVER 10 /* int; see below */
+#define IP_RECVERR 11 /* bool */
+#define IP_RECVTTL 12 /* bool */
+#define IP_RECVTOS 13 /* bool */
+
+
+/* IP_MTU_DISCOVER arguments. */
+#define IP_PMTUDISC_DONT 0 /* Never send DF frames. */
+#define IP_PMTUDISC_WANT 1 /* Use per route hints. */
+#define IP_PMTUDISC_DO 2 /* Always DF. */
+
+/* To select the IP level. */
+#define SOL_IP 0
+
+#define IP_DEFAULT_MULTICAST_TTL 1
+#define IP_DEFAULT_MULTICAST_LOOP 1
+#define IP_MAX_MEMBERSHIPS 20
+
+/* Structure used to describe IP options for IP_OPTIONS and IP_RETOPTS.
+ The `ip_dst' field is used for the first-hop gateway when using a
+ source route (this gets put into the header proper). */
+struct ip_opts
+ {
+ struct in_addr ip_dst; /* First hop; zero without source route. */
+ char ip_opts[40]; /* Actually variable in size. */
+ };
+
+/* Like `struct ip_mreq' but including interface specification by index. */
+struct ip_mreqn
+ {
+ struct in_addr imr_multiaddr; /* IP multicast address of group */
+ struct in_addr imr_address; /* local IP address of interface */
+ int imr_ifindex; /* Interface index */
+ };
+
+/* Structure used for IP_PKTINFO. */
+struct in_pktinfo
+ {
+ int ipi_ifindex; /* Interface index */
+ struct in_addr ipi_spec_dst; /* Routing destination address */
+ struct in_addr ipi_addr; /* Header destination address */
+ };
+
+/* Options for use with `getsockopt' and `setsockopt' at the IPv6 level.
+ The first word in the comment at the right is the data type used;
+ "bool" means a boolean value stored in an `int'. */
+#define IPV6_ADDRFORM 1
+#define IPV6_2292PKTINFO 2
+#define IPV6_2292HOPOPTS 3
+#define IPV6_2292DSTOPTS 4
+#define IPV6_2292RTHDR 5
+#define IPV6_2292PKTOPTIONS 6
+#define IPV6_CHECKSUM 7
+#define IPV6_2292HOPLIMIT 8
+
+#define SCM_SRCRT IPV6_RXSRCRT
+
+#define IPV6_NEXTHOP 9
+#define IPV6_AUTHHDR 10
+#define IPV6_UNICAST_HOPS 16
+#define IPV6_MULTICAST_IF 17
+#define IPV6_MULTICAST_HOPS 18
+#define IPV6_MULTICAST_LOOP 19
+#define IPV6_JOIN_GROUP 20
+#define IPV6_LEAVE_GROUP 21
+#define IPV6_ROUTER_ALERT 22
+#define IPV6_MTU_DISCOVER 23
+#define IPV6_MTU 24
+#define IPV6_RECVERR 25
+#define IPV6_V6ONLY 26
+#define IPV6_JOIN_ANYCAST 27
+#define IPV6_LEAVE_ANYCAST 28
+#define IPV6_IPSEC_POLICY 34
+#define IPV6_XFRM_POLICY 35
+
+#define IPV6_RECVPKTINFO 49
+#define IPV6_PKTINFO 50
+#define IPV6_RECVHOPLIMIT 51
+#define IPV6_HOPLIMIT 52
+#define IPV6_RECVHOPOPTS 53
+#define IPV6_HOPOPTS 54
+#define IPV6_RTHDRDSTOPTS 55
+#define IPV6_RECVRTHDR 56
+#define IPV6_RTHDR 57
+#define IPV6_RECVDSTOPTS 58
+#define IPV6_DSTOPTS 59
+
+#define IPV6_RECVTCLASS 66
+#define IPV6_TCLASS 67
+
+/* Obsolete synonyms for the above. */
+#define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP
+#define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP
+#define IPV6_RXHOPOPTS IPV6_HOPOPTS
+#define IPV6_RXDSTOPTS IPV6_DSTOPTS
+
+/* IPV6_MTU_DISCOVER values. */
+#define IPV6_PMTUDISC_DONT 0 /* Never send DF frames. */
+#define IPV6_PMTUDISC_WANT 1 /* Use per route hints. */
+#define IPV6_PMTUDISC_DO 2 /* Always DF. */
+
+/* Socket level values for IPv6. */
+#define SOL_IPV6 41
+#define SOL_ICMPV6 58
+
+/* Routing header options for IPv6. */
+#define IPV6_RTHDR_LOOSE 0 /* Hop doesn't need to be neighbour. */
+#define IPV6_RTHDR_STRICT 1 /* Hop must be a neighbour. */
+
+#define IPV6_RTHDR_TYPE_0 0 /* IPv6 Routing header type 0. */
diff --git a/sysroot/usr/include/bits/inf.h b/sysroot/usr/include/bits/inf.h
new file mode 100644
index 0000000..1619f75
--- /dev/null
+++ b/sysroot/usr/include/bits/inf.h
@@ -0,0 +1,30 @@
+/* `INFINITY' constant for IEEE 754 machines.
+ Copyright (C) 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _MATH_H
+# error "Never use <bits/inf.h> directly; include <math.h> instead."
+#endif
+
+/* IEEE positive infinity. */
+
+#if __GNUC_PREREQ(3,3)
+# define INFINITY (__builtin_inff())
+#else
+# define INFINITY HUGE_VALF
+#endif
diff --git a/sysroot/usr/include/bits/initspin.h b/sysroot/usr/include/bits/initspin.h
new file mode 100644
index 0000000..936f178
--- /dev/null
+++ b/sysroot/usr/include/bits/initspin.h
@@ -0,0 +1 @@
+/* No thread support. */
diff --git a/sysroot/usr/include/bits/ioctl-types.h b/sysroot/usr/include/bits/ioctl-types.h
new file mode 100644
index 0000000..e856a04
--- /dev/null
+++ b/sysroot/usr/include/bits/ioctl-types.h
@@ -0,0 +1,78 @@
+/* Structure types for pre-termios terminal ioctls. Linux version.
+ Copyright (C) 1996, 1997, 1999, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_IOCTL_H
+# error "Never use <bits/ioctl-types.h> directly; include <sys/ioctl.h> instead."
+#endif
+
+/* Get definition of constants for use with `ioctl'. */
+#include <asm/ioctls.h>
+
+
+struct winsize
+ {
+ unsigned short int ws_row;
+ unsigned short int ws_col;
+ unsigned short int ws_xpixel;
+ unsigned short int ws_ypixel;
+ };
+
+#define NCC 8
+struct termio
+ {
+ unsigned short int c_iflag; /* input mode flags */
+ unsigned short int c_oflag; /* output mode flags */
+ unsigned short int c_cflag; /* control mode flags */
+ unsigned short int c_lflag; /* local mode flags */
+ unsigned char c_line; /* line discipline */
+ unsigned char c_cc[NCC]; /* control characters */
+};
+
+/* modem lines */
+#define TIOCM_LE 0x001
+#define TIOCM_DTR 0x002
+#define TIOCM_RTS 0x004
+#define TIOCM_ST 0x008
+#define TIOCM_SR 0x010
+#define TIOCM_CTS 0x020
+#define TIOCM_CAR 0x040
+#define TIOCM_RNG 0x080
+#define TIOCM_DSR 0x100
+#define TIOCM_CD TIOCM_CAR
+#define TIOCM_RI TIOCM_RNG
+
+/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
+
+/* line disciplines */
+#define N_TTY 0
+#define N_SLIP 1
+#define N_MOUSE 2
+#define N_PPP 3
+#define N_STRIP 4
+#define N_AX25 5
+#define N_X25 6 /* X.25 async */
+#define N_6PACK 7
+#define N_MASC 8 /* Mobitex module */
+#define N_R3964 9 /* Simatic R3964 module */
+#define N_PROFIBUS_FDL 10 /* Profibus */
+#define N_IRDA 11 /* Linux IR */
+#define N_SMSBLOCK 12 /* SMS block mode */
+#define N_HDLC 13 /* synchronous HDLC */
+#define N_SYNC_PPP 14 /* synchronous PPP */
+#define N_HCI 15 /* Bluetooth HCI UART */
diff --git a/sysroot/usr/include/bits/ioctls.h b/sysroot/usr/include/bits/ioctls.h
new file mode 100644
index 0000000..11bb4c4
--- /dev/null
+++ b/sysroot/usr/include/bits/ioctls.h
@@ -0,0 +1,109 @@
+/* Copyright (C) 1996, 1997, 1998, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_IOCTL_H
+# error "Never use <bits/ioctls.h> directly; include <sys/ioctl.h> instead."
+#endif
+
+/* Use the definitions from the kernel header files. */
+#include <asm/ioctls.h>
+
+/* Routing table calls. */
+#define SIOCADDRT 0x890B /* add routing table entry */
+#define SIOCDELRT 0x890C /* delete routing table entry */
+#define SIOCRTMSG 0x890D /* call to routing system */
+
+/* Socket configuration controls. */
+#define SIOCGIFNAME 0x8910 /* get iface name */
+#define SIOCSIFLINK 0x8911 /* set iface channel */
+#define SIOCGIFCONF 0x8912 /* get iface list */
+#define SIOCGIFFLAGS 0x8913 /* get flags */
+#define SIOCSIFFLAGS 0x8914 /* set flags */
+#define SIOCGIFADDR 0x8915 /* get PA address */
+#define SIOCSIFADDR 0x8916 /* set PA address */
+#define SIOCGIFDSTADDR 0x8917 /* get remote PA address */
+#define SIOCSIFDSTADDR 0x8918 /* set remote PA address */
+#define SIOCGIFBRDADDR 0x8919 /* get broadcast PA address */
+#define SIOCSIFBRDADDR 0x891a /* set broadcast PA address */
+#define SIOCGIFNETMASK 0x891b /* get network PA mask */
+#define SIOCSIFNETMASK 0x891c /* set network PA mask */
+#define SIOCGIFMETRIC 0x891d /* get metric */
+#define SIOCSIFMETRIC 0x891e /* set metric */
+#define SIOCGIFMEM 0x891f /* get memory address (BSD) */
+#define SIOCSIFMEM 0x8920 /* set memory address (BSD) */
+#define SIOCGIFMTU 0x8921 /* get MTU size */
+#define SIOCSIFMTU 0x8922 /* set MTU size */
+#define SIOCSIFNAME 0x8923 /* set interface name */
+#define SIOCSIFHWADDR 0x8924 /* set hardware address */
+#define SIOCGIFENCAP 0x8925 /* get/set encapsulations */
+#define SIOCSIFENCAP 0x8926
+#define SIOCGIFHWADDR 0x8927 /* Get hardware address */
+#define SIOCGIFSLAVE 0x8929 /* Driver slaving support */
+#define SIOCSIFSLAVE 0x8930
+#define SIOCADDMULTI 0x8931 /* Multicast address lists */
+#define SIOCDELMULTI 0x8932
+#define SIOCGIFINDEX 0x8933 /* name -> if_index mapping */
+#define SIOGIFINDEX SIOCGIFINDEX /* misprint compatibility :-) */
+#define SIOCSIFPFLAGS 0x8934 /* set/get extended flags set */
+#define SIOCGIFPFLAGS 0x8935
+#define SIOCDIFADDR 0x8936 /* delete PA address */
+#define SIOCSIFHWBROADCAST 0x8937 /* set hardware broadcast addr */
+#define SIOCGIFCOUNT 0x8938 /* get number of devices */
+
+#define SIOCGIFBR 0x8940 /* Bridging support */
+#define SIOCSIFBR 0x8941 /* Set bridging options */
+
+#define SIOCGIFTXQLEN 0x8942 /* Get the tx queue length */
+#define SIOCSIFTXQLEN 0x8943 /* Set the tx queue length */
+
+
+/* ARP cache control calls. */
+ /* 0x8950 - 0x8952 * obsolete calls, don't re-use */
+#define SIOCDARP 0x8953 /* delete ARP table entry */
+#define SIOCGARP 0x8954 /* get ARP table entry */
+#define SIOCSARP 0x8955 /* set ARP table entry */
+
+/* RARP cache control calls. */
+#define SIOCDRARP 0x8960 /* delete RARP table entry */
+#define SIOCGRARP 0x8961 /* get RARP table entry */
+#define SIOCSRARP 0x8962 /* set RARP table entry */
+
+/* Driver configuration calls */
+
+#define SIOCGIFMAP 0x8970 /* Get device parameters */
+#define SIOCSIFMAP 0x8971 /* Set device parameters */
+
+/* DLCI configuration calls */
+
+#define SIOCADDDLCI 0x8980 /* Create new DLCI device */
+#define SIOCDELDLCI 0x8981 /* Delete DLCI device */
+
+/* Device private ioctl calls. */
+
+/* These 16 ioctls are available to devices via the do_ioctl() device
+ vector. Each device should include this file and redefine these
+ names as their own. Because these are device dependent it is a good
+ idea _NOT_ to issue them to random objects and hope. */
+
+#define SIOCDEVPRIVATE 0x89F0 /* to 89FF */
+
+/*
+ * These 16 ioctl calls are protocol private
+ */
+
+#define SIOCPROTOPRIVATE 0x89E0 /* to 89EF */
diff --git a/sysroot/usr/include/bits/ipc.h b/sysroot/usr/include/bits/ipc.h
new file mode 100644
index 0000000..f1a043f
--- /dev/null
+++ b/sysroot/usr/include/bits/ipc.h
@@ -0,0 +1,56 @@
+/* Copyright (C) 1995-1999, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_IPC_H
+# error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead."
+#endif
+
+#include <bits/types.h>
+
+/* Mode bits for `msgget', `semget', and `shmget'. */
+#define IPC_CREAT 01000 /* Create key if key does not exist. */
+#define IPC_EXCL 02000 /* Fail if key exists. */
+#define IPC_NOWAIT 04000 /* Return error on wait. */
+
+/* Control commands for `msgctl', `semctl', and `shmctl'. */
+#define IPC_RMID 0 /* Remove identifier. */
+#define IPC_SET 1 /* Set `ipc_perm' options. */
+#define IPC_STAT 2 /* Get `ipc_perm' options. */
+#ifdef __USE_GNU
+# define IPC_INFO 3 /* See ipcs. */
+#endif
+
+/* Special key values. */
+#define IPC_PRIVATE ((__key_t) 0) /* Private key. */
+
+
+/* Data structure used to pass permission information to IPC operations. */
+struct ipc_perm
+ {
+ __key_t __key; /* Key. */
+ __uid_t uid; /* Owner's user ID. */
+ __gid_t gid; /* Owner's group ID. */
+ __uid_t cuid; /* Creator's user ID. */
+ __gid_t cgid; /* Creator's group ID. */
+ unsigned short int mode; /* Read/write permission. */
+ unsigned short int __pad1;
+ unsigned short int __seq; /* Sequence number. */
+ unsigned short int __pad2;
+ unsigned long int __unused1;
+ unsigned long int __unused2;
+ };
diff --git a/sysroot/usr/include/bits/ipctypes.h b/sysroot/usr/include/bits/ipctypes.h
new file mode 100644
index 0000000..b88ca1d
--- /dev/null
+++ b/sysroot/usr/include/bits/ipctypes.h
@@ -0,0 +1,37 @@
+/* bits/ipctypes.h -- Define some types used by SysV IPC/MSG/SHM. Generic.
+ Copyright (C) 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * Never include <bits/ipctypes.h> directly.
+ */
+
+#ifndef _BITS_IPCTYPES_H
+#define _BITS_IPCTYPES_H 1
+
+#include <bits/types.h>
+
+/* Used in `struct shmid_ds'. */
+# if __WORDSIZE == 32
+typedef unsigned short int __ipc_pid_t;
+# else
+typedef int __ipc_pid_t;
+# endif
+
+
+#endif /* bits/ipctypes.h */
diff --git a/sysroot/usr/include/bits/libc-lock.h b/sysroot/usr/include/bits/libc-lock.h
new file mode 100644
index 0000000..a597f3b
--- /dev/null
+++ b/sysroot/usr/include/bits/libc-lock.h
@@ -0,0 +1,585 @@
+/* libc-internal interface for mutex locks. NPTL version.
+ Copyright (C) 1996-2003, 2005, 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef _BITS_LIBC_LOCK_H
+#define _BITS_LIBC_LOCK_H 1
+
+#include <pthread.h>
+#define __need_NULL
+#include <stddef.h>
+
+
+/* Fortunately Linux now has a mean to do locking which is realtime
+ safe without the aid of the thread library. We also need no fancy
+ options like error checking mutexes etc. We only need simple
+ locks, maybe recursive. This can be easily and cheaply implemented
+ using futexes. We will use them everywhere except in ld.so since
+ ld.so might be used on old kernels with a different libc.so. */
+#ifdef _LIBC
+# include <lowlevellock.h>
+# include <tls.h>
+# include <pthread-functions.h>
+#endif
+
+/* Mutex type. */
+#if defined _LIBC || defined _IO_MTSAFE_IO
+# if (defined NOT_IN_libc && !defined IS_IN_libpthread) || !defined _LIBC
+typedef pthread_mutex_t __libc_lock_t;
+typedef struct { pthread_mutex_t mutex; } __libc_lock_recursive_t;
+# else
+typedef int __libc_lock_t;
+typedef struct { int lock; int cnt; void *owner; } __libc_lock_recursive_t;
+# endif
+typedef struct { pthread_mutex_t mutex; } __rtld_lock_recursive_t;
+# ifdef __USE_UNIX98
+typedef pthread_rwlock_t __libc_rwlock_t;
+# else
+typedef struct __libc_rwlock_opaque__ __libc_rwlock_t;
+# endif
+#else
+typedef struct __libc_lock_opaque__ __libc_lock_t;
+typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
+typedef struct __libc_rwlock_opaque__ __libc_rwlock_t;
+#endif
+
+/* Type for key to thread-specific data. */
+typedef pthread_key_t __libc_key_t;
+
+/* Define a lock variable NAME with storage class CLASS. The lock must be
+ initialized with __libc_lock_init before it can be used (or define it
+ with __libc_lock_define_initialized, below). Use `extern' for CLASS to
+ declare a lock defined in another module. In public structure
+ definitions you must use a pointer to the lock structure (i.e., NAME
+ begins with a `*'), because its storage size will not be known outside
+ of libc. */
+#define __libc_lock_define(CLASS,NAME) \
+ CLASS __libc_lock_t NAME;
+#define __libc_rwlock_define(CLASS,NAME) \
+ CLASS __libc_rwlock_t NAME;
+#define __libc_lock_define_recursive(CLASS,NAME) \
+ CLASS __libc_lock_recursive_t NAME;
+#define __rtld_lock_define_recursive(CLASS,NAME) \
+ CLASS __rtld_lock_recursive_t NAME;
+
+/* Define an initialized lock variable NAME with storage class CLASS.
+
+ For the C library we take a deeper look at the initializer. For
+ this implementation all fields are initialized to zero. Therefore
+ we don't initialize the variable which allows putting it into the
+ BSS section. (Except on PA-RISC and other odd architectures, where
+ initialized locks must be set to one due to the lack of normal
+ atomic operations.) */
+
+#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
+# if LLL_LOCK_INITIALIZER == 0
+# define __libc_lock_define_initialized(CLASS,NAME) \
+ CLASS __libc_lock_t NAME;
+# else
+# define __libc_lock_define_initialized(CLASS,NAME) \
+ CLASS __libc_lock_t NAME = LLL_LOCK_INITIALIZER;
+# endif
+#else
+# if __LT_SPINLOCK_INIT == 0
+# define __libc_lock_define_initialized(CLASS,NAME) \
+ CLASS __libc_lock_t NAME;
+# else
+# define __libc_lock_define_initialized(CLASS,NAME) \
+ CLASS __libc_lock_t NAME = PTHREAD_MUTEX_INITIALIZER;
+# endif
+#endif
+
+#define __libc_rwlock_define_initialized(CLASS,NAME) \
+ CLASS __libc_rwlock_t NAME = PTHREAD_RWLOCK_INITIALIZER;
+
+/* Define an initialized recursive lock variable NAME with storage
+ class CLASS. */
+#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
+# if LLL_LOCK_INITIALIZER == 0
+# define __libc_lock_define_initialized_recursive(CLASS,NAME) \
+ CLASS __libc_lock_recursive_t NAME;
+# else
+# define __libc_lock_define_initialized_recursive(CLASS,NAME) \
+ CLASS __libc_lock_recursive_t NAME = _LIBC_LOCK_RECURSIVE_INITIALIZER;
+# endif
+# define _LIBC_LOCK_RECURSIVE_INITIALIZER \
+ { LLL_LOCK_INITIALIZER, 0, NULL }
+#else
+# define __libc_lock_define_initialized_recursive(CLASS,NAME) \
+ CLASS __libc_lock_recursive_t NAME = _LIBC_LOCK_RECURSIVE_INITIALIZER;
+# define _LIBC_LOCK_RECURSIVE_INITIALIZER \
+ {PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP}
+#endif
+
+#define __rtld_lock_define_initialized_recursive(CLASS,NAME) \
+ CLASS __rtld_lock_recursive_t NAME = _RTLD_LOCK_RECURSIVE_INITIALIZER;
+#define _RTLD_LOCK_RECURSIVE_INITIALIZER \
+ {PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP}
+
+#define __rtld_lock_initialize(NAME) \
+ (void) ((NAME) = (__rtld_lock_recursive_t) _RTLD_LOCK_RECURSIVE_INITIALIZER)
+
+/* If we check for a weakly referenced symbol and then perform a
+ normal jump to it te code generated for some platforms in case of
+ PIC is unnecessarily slow. What would happen is that the function
+ is first referenced as data and then it is called indirectly
+ through the PLT. We can make this a direct jump. */
+#ifdef __PIC__
+# define __libc_maybe_call(FUNC, ARGS, ELSE) \
+ (__extension__ ({ __typeof (FUNC) *_fn = (FUNC); \
+ _fn != NULL ? (*_fn) ARGS : ELSE; }))
+#else
+# define __libc_maybe_call(FUNC, ARGS, ELSE) \
+ (FUNC != NULL ? FUNC ARGS : ELSE)
+#endif
+
+/* Call thread functions through the function pointer table. */
+#if defined SHARED && !defined NOT_IN_libc
+# define PTFAVAIL(NAME) __libc_pthread_functions_init
+# define __libc_ptf_call(FUNC, ARGS, ELSE) \
+ (__libc_pthread_functions_init ? PTHFCT_CALL (ptr_##FUNC, ARGS) : ELSE)
+# define __libc_ptf_call_always(FUNC, ARGS) \
+ PTHFCT_CALL (ptr_##FUNC, ARGS)
+#else
+# define PTFAVAIL(NAME) (NAME != NULL)
+# define __libc_ptf_call(FUNC, ARGS, ELSE) \
+ __libc_maybe_call (FUNC, ARGS, ELSE)
+# define __libc_ptf_call_always(FUNC, ARGS) \
+ FUNC ARGS
+#endif
+
+
+/* Initialize the named lock variable, leaving it in a consistent, unlocked
+ state. */
+#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
+# define __libc_lock_init(NAME) ((NAME) = LLL_LOCK_INITIALIZER, 0)
+#else
+# define __libc_lock_init(NAME) \
+ __libc_maybe_call (__pthread_mutex_init, (&(NAME), NULL), 0)
+#endif
+#if defined SHARED && !defined NOT_IN_libc
+/* ((NAME) = (__libc_rwlock_t) PTHREAD_RWLOCK_INITIALIZER, 0) is
+ inefficient. */
+# define __libc_rwlock_init(NAME) \
+ (__builtin_memset (&(NAME), '\0', sizeof (NAME)), 0)
+#else
+# define __libc_rwlock_init(NAME) \
+ __libc_maybe_call (__pthread_rwlock_init, (&(NAME), NULL), 0)
+#endif
+
+/* Same as last but this time we initialize a recursive mutex. */
+#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
+# define __libc_lock_init_recursive(NAME) \
+ ((NAME) = (__libc_lock_recursive_t) _LIBC_LOCK_RECURSIVE_INITIALIZER, 0)
+#else
+# define __libc_lock_init_recursive(NAME) \
+ do { \
+ if (__pthread_mutex_init != NULL) \
+ { \
+ pthread_mutexattr_t __attr; \
+ __pthread_mutexattr_init (&__attr); \
+ __pthread_mutexattr_settype (&__attr, PTHREAD_MUTEX_RECURSIVE_NP); \
+ __pthread_mutex_init (&(NAME).mutex, &__attr); \
+ __pthread_mutexattr_destroy (&__attr); \
+ } \
+ } while (0)
+#endif
+
+#define __rtld_lock_init_recursive(NAME) \
+ do { \
+ if (__pthread_mutex_init != NULL) \
+ { \
+ pthread_mutexattr_t __attr; \
+ __pthread_mutexattr_init (&__attr); \
+ __pthread_mutexattr_settype (&__attr, PTHREAD_MUTEX_RECURSIVE_NP); \
+ __pthread_mutex_init (&(NAME).mutex, &__attr); \
+ __pthread_mutexattr_destroy (&__attr); \
+ } \
+ } while (0)
+
+/* Finalize the named lock variable, which must be locked. It cannot be
+ used again until __libc_lock_init is called again on it. This must be
+ called on a lock variable before the containing storage is reused. */
+#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
+# define __libc_lock_fini(NAME) ((void) 0)
+#else
+# define __libc_lock_fini(NAME) \
+ __libc_maybe_call (__pthread_mutex_destroy, (&(NAME)), 0)
+#endif
+#if defined SHARED && !defined NOT_IN_libc
+# define __libc_rwlock_fini(NAME) ((void) 0)
+#else
+# define __libc_rwlock_fini(NAME) \
+ __libc_maybe_call (__pthread_rwlock_destroy, (&(NAME)), 0)
+#endif
+
+/* Finalize recursive named lock. */
+#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
+# define __libc_lock_fini_recursive(NAME) ((void) 0)
+#else
+# define __libc_lock_fini_recursive(NAME) \
+ __libc_maybe_call (__pthread_mutex_destroy, (&(NAME)), 0)
+#endif
+
+/* Lock the named lock variable. */
+#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
+# define __libc_lock_lock(NAME) \
+ ({ lll_lock (NAME, LLL_PRIVATE); 0; })
+#else
+# define __libc_lock_lock(NAME) \
+ __libc_maybe_call (__pthread_mutex_lock, (&(NAME)), 0)
+#endif
+#define __libc_rwlock_rdlock(NAME) \
+ __libc_ptf_call (__pthread_rwlock_rdlock, (&(NAME)), 0)
+#define __libc_rwlock_wrlock(NAME) \
+ __libc_ptf_call (__pthread_rwlock_wrlock, (&(NAME)), 0)
+
+/* Lock the recursive named lock variable. */
+#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
+# define __libc_lock_lock_recursive(NAME) \
+ do { \
+ void *self = THREAD_SELF; \
+ if ((NAME).owner != self) \
+ { \
+ lll_lock ((NAME).lock, LLL_PRIVATE); \
+ (NAME).owner = self; \
+ } \
+ ++(NAME).cnt; \
+ } while (0)
+#else
+# define __libc_lock_lock_recursive(NAME) \
+ __libc_maybe_call (__pthread_mutex_lock, (&(NAME).mutex), 0)
+#endif
+
+/* Try to lock the named lock variable. */
+#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
+# define __libc_lock_trylock(NAME) \
+ lll_trylock (NAME)
+#else
+# define __libc_lock_trylock(NAME) \
+ __libc_maybe_call (__pthread_mutex_trylock, (&(NAME)), 0)
+#endif
+#define __libc_rwlock_tryrdlock(NAME) \
+ __libc_maybe_call (__pthread_rwlock_tryrdlock, (&(NAME)), 0)
+#define __libc_rwlock_trywrlock(NAME) \
+ __libc_maybe_call (__pthread_rwlock_trywrlock, (&(NAME)), 0)
+
+/* Try to lock the recursive named lock variable. */
+#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
+# define __libc_lock_trylock_recursive(NAME) \
+ ({ \
+ int result = 0; \
+ void *self = THREAD_SELF; \
+ if ((NAME).owner != self) \
+ { \
+ if (lll_trylock ((NAME).lock) == 0) \
+ { \
+ (NAME).owner = self; \
+ (NAME).cnt = 1; \
+ } \
+ else \
+ result = EBUSY; \
+ } \
+ else \
+ ++(NAME).cnt; \
+ result; \
+ })
+#else
+# define __libc_lock_trylock_recursive(NAME) \
+ __libc_maybe_call (__pthread_mutex_trylock, (&(NAME)), 0)
+#endif
+
+#define __rtld_lock_trylock_recursive(NAME) \
+ __libc_maybe_call (__pthread_mutex_trylock, (&(NAME).mutex), 0)
+
+/* Unlock the named lock variable. */
+#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
+# define __libc_lock_unlock(NAME) \
+ lll_unlock (NAME, LLL_PRIVATE)
+#else
+# define __libc_lock_unlock(NAME) \
+ __libc_maybe_call (__pthread_mutex_unlock, (&(NAME)), 0)
+#endif
+#define __libc_rwlock_unlock(NAME) \
+ __libc_ptf_call (__pthread_rwlock_unlock, (&(NAME)), 0)
+
+/* Unlock the recursive named lock variable. */
+#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
+/* We do no error checking here. */
+# define __libc_lock_unlock_recursive(NAME) \
+ do { \
+ if (--(NAME).cnt == 0) \
+ { \
+ (NAME).owner = NULL; \
+ lll_unlock ((NAME).lock, LLL_PRIVATE); \
+ } \
+ } while (0)
+#else
+# define __libc_lock_unlock_recursive(NAME) \
+ __libc_maybe_call (__pthread_mutex_unlock, (&(NAME)), 0)
+#endif
+
+#if defined _LIBC && defined SHARED
+# define __rtld_lock_default_lock_recursive(lock) \
+ ++((pthread_mutex_t *)(lock))->__data.__count;
+
+# define __rtld_lock_default_unlock_recursive(lock) \
+ --((pthread_mutex_t *)(lock))->__data.__count;
+
+# define __rtld_lock_lock_recursive(NAME) \
+ GL(dl_rtld_lock_recursive) (&(NAME).mutex)
+
+# define __rtld_lock_unlock_recursive(NAME) \
+ GL(dl_rtld_unlock_recursive) (&(NAME).mutex)
+#else
+# define __rtld_lock_lock_recursive(NAME) \
+ __libc_maybe_call (__pthread_mutex_lock, (&(NAME).mutex), 0)
+
+# define __rtld_lock_unlock_recursive(NAME) \
+ __libc_maybe_call (__pthread_mutex_unlock, (&(NAME).mutex), 0)
+#endif
+
+/* Define once control variable. */
+#if PTHREAD_ONCE_INIT == 0
+/* Special case for static variables where we can avoid the initialization
+ if it is zero. */
+# define __libc_once_define(CLASS, NAME) \
+ CLASS pthread_once_t NAME
+#else
+# define __libc_once_define(CLASS, NAME) \
+ CLASS pthread_once_t NAME = PTHREAD_ONCE_INIT
+#endif
+
+/* Call handler iff the first call. */
+#define __libc_once(ONCE_CONTROL, INIT_FUNCTION) \
+ do { \
+ if (PTFAVAIL (__pthread_once)) \
+ __libc_ptf_call_always (__pthread_once, (&(ONCE_CONTROL), \
+ INIT_FUNCTION)); \
+ else if ((ONCE_CONTROL) == PTHREAD_ONCE_INIT) { \
+ INIT_FUNCTION (); \
+ (ONCE_CONTROL) |= 2; \
+ } \
+ } while (0)
+
+
+/* Note that for I/O cleanup handling we are using the old-style
+ cancel handling. It does not have to be integrated with C++ snce
+ no C++ code is called in the middle. The old-style handling is
+ faster and the support is not going away. */
+extern void _pthread_cleanup_push (struct _pthread_cleanup_buffer *buffer,
+ void (*routine) (void *), void *arg);
+extern void _pthread_cleanup_pop (struct _pthread_cleanup_buffer *buffer,
+ int execute);
+extern void _pthread_cleanup_push_defer (struct _pthread_cleanup_buffer *buffer,
+ void (*routine) (void *), void *arg);
+extern void _pthread_cleanup_pop_restore (struct _pthread_cleanup_buffer *buffer,
+ int execute);
+
+/* Start critical region with cleanup. */
+#define __libc_cleanup_region_start(DOIT, FCT, ARG) \
+ { struct _pthread_cleanup_buffer _buffer; \
+ int _avail; \
+ if (DOIT) { \
+ _avail = PTFAVAIL (_pthread_cleanup_push_defer); \
+ if (_avail) { \
+ __libc_ptf_call_always (_pthread_cleanup_push_defer, (&_buffer, FCT, \
+ ARG)); \
+ } else { \
+ _buffer.__routine = (FCT); \
+ _buffer.__arg = (ARG); \
+ } \
+ } else { \
+ _avail = 0; \
+ }
+
+/* End critical region with cleanup. */
+#define __libc_cleanup_region_end(DOIT) \
+ if (_avail) { \
+ __libc_ptf_call_always (_pthread_cleanup_pop_restore, (&_buffer, DOIT));\
+ } else if (DOIT) \
+ _buffer.__routine (_buffer.__arg); \
+ }
+
+/* Sometimes we have to exit the block in the middle. */
+#define __libc_cleanup_end(DOIT) \
+ if (_avail) { \
+ __libc_ptf_call_always (_pthread_cleanup_pop_restore, (&_buffer, DOIT));\
+ } else if (DOIT) \
+ _buffer.__routine (_buffer.__arg)
+
+
+/* Normal cleanup handling, based on C cleanup attribute. */
+__extern_inline void
+__libc_cleanup_routine (struct __pthread_cleanup_frame *f)
+{
+ if (f->__do_it)
+ f->__cancel_routine (f->__cancel_arg);
+}
+
+#define __libc_cleanup_push(fct, arg) \
+ do { \
+ struct __pthread_cleanup_frame __clframe \
+ __attribute__ ((__cleanup__ (__libc_cleanup_routine))) \
+ = { .__cancel_routine = (fct), .__cancel_arg = (arg), \
+ .__do_it = 1 };
+
+#define __libc_cleanup_pop(execute) \
+ __clframe.__do_it = (execute); \
+ } while (0)
+
+
+/* Create thread-specific key. */
+#define __libc_key_create(KEY, DESTRUCTOR) \
+ __libc_ptf_call (__pthread_key_create, (KEY, DESTRUCTOR), 1)
+
+/* Get thread-specific data. */
+#define __libc_getspecific(KEY) \
+ __libc_ptf_call (__pthread_getspecific, (KEY), NULL)
+
+/* Set thread-specific data. */
+#define __libc_setspecific(KEY, VALUE) \
+ __libc_ptf_call (__pthread_setspecific, (KEY, VALUE), 0)
+
+
+/* Register handlers to execute before and after `fork'. Note that the
+ last parameter is NULL. The handlers registered by the libc are
+ never removed so this is OK. */
+#define __libc_atfork(PREPARE, PARENT, CHILD) \
+ __register_atfork (PREPARE, PARENT, CHILD, NULL)
+extern int __register_atfork (void (*__prepare) (void),
+ void (*__parent) (void),
+ void (*__child) (void),
+ void *__dso_handle);
+
+/* Functions that are used by this file and are internal to the GNU C
+ library. */
+
+extern int __pthread_mutex_init (pthread_mutex_t *__mutex,
+ __const pthread_mutexattr_t *__mutex_attr);
+
+extern int __pthread_mutex_destroy (pthread_mutex_t *__mutex);
+
+extern int __pthread_mutex_trylock (pthread_mutex_t *__mutex);
+
+extern int __pthread_mutex_lock (pthread_mutex_t *__mutex);
+
+extern int __pthread_mutex_unlock (pthread_mutex_t *__mutex);
+
+extern int __pthread_mutexattr_init (pthread_mutexattr_t *__attr);
+
+extern int __pthread_mutexattr_destroy (pthread_mutexattr_t *__attr);
+
+extern int __pthread_mutexattr_settype (pthread_mutexattr_t *__attr,
+ int __kind);
+
+#ifdef __USE_UNIX98
+extern int __pthread_rwlock_init (pthread_rwlock_t *__rwlock,
+ __const pthread_rwlockattr_t *__attr);
+
+extern int __pthread_rwlock_destroy (pthread_rwlock_t *__rwlock);
+
+extern int __pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock);
+
+extern int __pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock);
+
+extern int __pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock);
+
+extern int __pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock);
+
+extern int __pthread_rwlock_unlock (pthread_rwlock_t *__rwlock);
+#endif
+
+extern int __pthread_key_create (pthread_key_t *__key,
+ void (*__destr_function) (void *));
+
+extern int __pthread_setspecific (pthread_key_t __key,
+ __const void *__pointer);
+
+extern void *__pthread_getspecific (pthread_key_t __key);
+
+extern int __pthread_once (pthread_once_t *__once_control,
+ void (*__init_routine) (void));
+
+extern int __pthread_atfork (void (*__prepare) (void),
+ void (*__parent) (void),
+ void (*__child) (void));
+
+
+
+/* Make the pthread functions weak so that we can elide them from
+ single-threaded processes. */
+#ifndef __NO_WEAK_PTHREAD_ALIASES
+# ifdef weak_extern
+# if _LIBC
+# include <bp-sym.h>
+# else
+# define BP_SYM (sym) sym
+# endif
+weak_extern (BP_SYM (__pthread_mutex_init))
+weak_extern (BP_SYM (__pthread_mutex_destroy))
+weak_extern (BP_SYM (__pthread_mutex_lock))
+weak_extern (BP_SYM (__pthread_mutex_trylock))
+weak_extern (BP_SYM (__pthread_mutex_unlock))
+weak_extern (BP_SYM (__pthread_mutexattr_init))
+weak_extern (BP_SYM (__pthread_mutexattr_destroy))
+weak_extern (BP_SYM (__pthread_mutexattr_settype))
+weak_extern (BP_SYM (__pthread_rwlock_init))
+weak_extern (BP_SYM (__pthread_rwlock_destroy))
+weak_extern (BP_SYM (__pthread_rwlock_rdlock))
+weak_extern (BP_SYM (__pthread_rwlock_tryrdlock))
+weak_extern (BP_SYM (__pthread_rwlock_wrlock))
+weak_extern (BP_SYM (__pthread_rwlock_trywrlock))
+weak_extern (BP_SYM (__pthread_rwlock_unlock))
+weak_extern (BP_SYM (__pthread_key_create))
+weak_extern (BP_SYM (__pthread_setspecific))
+weak_extern (BP_SYM (__pthread_getspecific))
+weak_extern (BP_SYM (__pthread_once))
+weak_extern (__pthread_initialize)
+weak_extern (__pthread_atfork)
+weak_extern (BP_SYM (_pthread_cleanup_push_defer))
+weak_extern (BP_SYM (_pthread_cleanup_pop_restore))
+weak_extern (BP_SYM (pthread_setcancelstate))
+# else
+# pragma weak __pthread_mutex_init
+# pragma weak __pthread_mutex_destroy
+# pragma weak __pthread_mutex_lock
+# pragma weak __pthread_mutex_trylock
+# pragma weak __pthread_mutex_unlock
+# pragma weak __pthread_mutexattr_init
+# pragma weak __pthread_mutexattr_destroy
+# pragma weak __pthread_mutexattr_settype
+# pragma weak __pthread_rwlock_destroy
+# pragma weak __pthread_rwlock_rdlock
+# pragma weak __pthread_rwlock_tryrdlock
+# pragma weak __pthread_rwlock_wrlock
+# pragma weak __pthread_rwlock_trywrlock
+# pragma weak __pthread_rwlock_unlock
+# pragma weak __pthread_key_create
+# pragma weak __pthread_setspecific
+# pragma weak __pthread_getspecific
+# pragma weak __pthread_once
+# pragma weak __pthread_initialize
+# pragma weak __pthread_atfork
+# pragma weak _pthread_cleanup_push_defer
+# pragma weak _pthread_cleanup_pop_restore
+# pragma weak pthread_setcancelstate
+# endif
+#endif
+
+#endif /* bits/libc-lock.h */
diff --git a/sysroot/usr/include/bits/libio-ldbl.h b/sysroot/usr/include/bits/libio-ldbl.h
new file mode 100644
index 0000000..8674bcb
--- /dev/null
+++ b/sysroot/usr/include/bits/libio-ldbl.h
@@ -0,0 +1,25 @@
+/* -mlong-double-64 compatibility mode for libio functions.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _IO_STDIO_H
+# error "Never include <bits/libio-ldbl.h> directly; use <libio.h> instead."
+#endif
+
+__LDBL_REDIR_DECL (_IO_vfscanf)
+__LDBL_REDIR_DECL (_IO_vfprintf)
diff --git a/sysroot/usr/include/bits/link.h b/sysroot/usr/include/bits/link.h
new file mode 100644
index 0000000..2890c2d
--- /dev/null
+++ b/sysroot/usr/include/bits/link.h
@@ -0,0 +1,117 @@
+/* Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _LINK_H
+# error "Never include <bits/link.h> directly; use <link.h> instead."
+#endif
+
+
+#if __ELF_NATIVE_CLASS == 32
+/* Registers for entry into PLT on IA-32. */
+typedef struct La_i86_regs
+{
+ uint32_t lr_edx;
+ uint32_t lr_ecx;
+ uint32_t lr_eax;
+ uint32_t lr_ebp;
+ uint32_t lr_esp;
+} La_i86_regs;
+
+/* Return values for calls from PLT on IA-32. */
+typedef struct La_i86_retval
+{
+ uint32_t lrv_eax;
+ uint32_t lrv_edx;
+ long double lrv_st0;
+ long double lrv_st1;
+} La_i86_retval;
+
+
+__BEGIN_DECLS
+
+extern Elf32_Addr la_i86_gnu_pltenter (Elf32_Sym *__sym, unsigned int __ndx,
+ uintptr_t *__refcook,
+ uintptr_t *__defcook,
+ La_i86_regs *__regs,
+ unsigned int *__flags,
+ const char *__symname,
+ long int *__framesizep);
+extern unsigned int la_i86_gnu_pltexit (Elf32_Sym *__sym, unsigned int __ndx,
+ uintptr_t *__refcook,
+ uintptr_t *__defcook,
+ const La_i86_regs *__inregs,
+ La_i86_retval *__outregs,
+ const char *symname);
+
+__END_DECLS
+
+#else
+
+/* Registers for entry into PLT on x86-64. */
+# if __GNUC_PREREQ (4,0)
+typedef float La_x86_64_xmm __attribute__ ((__vector_size__ (16)));
+# else
+typedef float La_x86_64_xmm __attribute__ ((__mode__ (__V4SF__)));
+# endif
+
+typedef struct La_x86_64_regs
+{
+ uint64_t lr_rdx;
+ uint64_t lr_r8;
+ uint64_t lr_r9;
+ uint64_t lr_rcx;
+ uint64_t lr_rsi;
+ uint64_t lr_rdi;
+ uint64_t lr_rbp;
+ uint64_t lr_rsp;
+ La_x86_64_xmm lr_xmm[8];
+} La_x86_64_regs;
+
+/* Return values for calls from PLT on x86-64. */
+typedef struct La_x86_64_retval
+{
+ uint64_t lrv_rax;
+ uint64_t lrv_rdx;
+ La_x86_64_xmm lrv_xmm0;
+ La_x86_64_xmm lrv_xmm1;
+ long double lrv_st0;
+ long double lrv_st1;
+} La_x86_64_retval;
+
+
+__BEGIN_DECLS
+
+extern Elf64_Addr la_x86_64_gnu_pltenter (Elf64_Sym *__sym,
+ unsigned int __ndx,
+ uintptr_t *__refcook,
+ uintptr_t *__defcook,
+ La_x86_64_regs *__regs,
+ unsigned int *__flags,
+ const char *__symname,
+ long int *__framesizep);
+extern unsigned int la_x86_64_gnu_pltexit (Elf64_Sym *__sym,
+ unsigned int __ndx,
+ uintptr_t *__refcook,
+ uintptr_t *__defcook,
+ const La_x86_64_regs *__inregs,
+ La_x86_64_retval *__outregs,
+ const char *symname);
+
+__END_DECLS
+
+#endif
diff --git a/sysroot/usr/include/bits/local_lim.h b/sysroot/usr/include/bits/local_lim.h
new file mode 100644
index 0000000..4b7b297
--- /dev/null
+++ b/sysroot/usr/include/bits/local_lim.h
@@ -0,0 +1,92 @@
+/* Minimum guaranteed maximum values for system limits. Linux version.
+ Copyright (C) 1993-1998,2000,2002,2003,2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* The kernel header pollutes the namespace with the NR_OPEN symbol
+ and defines LINK_MAX although filesystems have different maxima. A
+ similar thing is true for OPEN_MAX: the limit can be changed at
+ runtime and therefore the macro must not be defined. Remove this
+ after including the header if necessary. */
+#ifndef NR_OPEN
+# define __undef_NR_OPEN
+#endif
+#ifndef LINK_MAX
+# define __undef_LINK_MAX
+#endif
+#ifndef OPEN_MAX
+# define __undef_OPEN_MAX
+#endif
+
+/* The kernel sources contain a file with all the needed information. */
+#include <linux/limits.h>
+
+/* Have to remove NR_OPEN? */
+#ifdef __undef_NR_OPEN
+# undef NR_OPEN
+# undef __undef_NR_OPEN
+#endif
+/* Have to remove LINK_MAX? */
+#ifdef __undef_LINK_MAX
+# undef LINK_MAX
+# undef __undef_LINK_MAX
+#endif
+/* Have to remove OPEN_MAX? */
+#ifdef __undef_OPEN_MAX
+# undef OPEN_MAX
+# undef __undef_OPEN_MAX
+#endif
+
+/* The number of data keys per process. */
+#define _POSIX_THREAD_KEYS_MAX 128
+/* This is the value this implementation supports. */
+#define PTHREAD_KEYS_MAX 1024
+
+/* Controlling the iterations of destructors for thread-specific data. */
+#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
+/* Number of iterations this implementation does. */
+#define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS
+
+/* The number of threads per process. */
+#define _POSIX_THREAD_THREADS_MAX 64
+/* We have no predefined limit on the number of threads. */
+#undef PTHREAD_THREADS_MAX
+
+/* Maximum amount by which a process can descrease its asynchronous I/O
+ priority level. */
+#define AIO_PRIO_DELTA_MAX 20
+
+/* Minimum size for a thread. We are free to choose a reasonable value. */
+#define PTHREAD_STACK_MIN 16384
+
+/* Maximum number of timer expiration overruns. */
+#define DELAYTIMER_MAX 2147483647
+
+/* Maximum tty name length. */
+#define TTY_NAME_MAX 32
+
+/* Maximum login name length. This is arbitrary. */
+#define LOGIN_NAME_MAX 256
+
+/* Maximum host name length. */
+#define HOST_NAME_MAX 64
+
+/* Maximum message queue priority level. */
+#define MQ_PRIO_MAX 32768
+
+/* Maximum value the semaphore can have. */
+#define SEM_VALUE_MAX (2147483647)
diff --git a/sysroot/usr/include/bits/locale.h b/sysroot/usr/include/bits/locale.h
new file mode 100644
index 0000000..50064b5
--- /dev/null
+++ b/sysroot/usr/include/bits/locale.h
@@ -0,0 +1,44 @@
+/* Definition of locale category symbol values.
+ Copyright (C) 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#if !defined _LOCALE_H && !defined _LANGINFO_H
+# error "Never use <bits/locale.h> directly; include <locale.h> instead."
+#endif
+
+#ifndef _BITS_LOCALE_H
+#define _BITS_LOCALE_H 1
+
+enum
+{
+ __LC_CTYPE = 0,
+ __LC_NUMERIC = 1,
+ __LC_TIME = 2,
+ __LC_COLLATE = 3,
+ __LC_MONETARY = 4,
+ __LC_MESSAGES = 5,
+ __LC_ALL = 6,
+ __LC_PAPER = 7,
+ __LC_NAME = 8,
+ __LC_ADDRESS = 9,
+ __LC_TELEPHONE = 10,
+ __LC_MEASUREMENT = 11,
+ __LC_IDENTIFICATION = 12
+};
+
+#endif /* bits/locale.h */
diff --git a/sysroot/usr/include/bits/mathcalls.h b/sysroot/usr/include/bits/mathcalls.h
new file mode 100644
index 0000000..64da627
--- /dev/null
+++ b/sysroot/usr/include/bits/mathcalls.h
@@ -0,0 +1,365 @@
+/* Prototype declarations for math functions; helper file for <math.h>.
+ Copyright (C) 1996-2002, 2003, 2006 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* NOTE: Because of the special way this file is used by <math.h>, this
+ file must NOT be protected from multiple inclusion as header files
+ usually are.
+
+ This file provides prototype declarations for the math functions.
+ Most functions are declared using the macro:
+
+ __MATHCALL (NAME,[_r], (ARGS...));
+
+ This means there is a function `NAME' returning `double' and a function
+ `NAMEf' returning `float'. Each place `_Mdouble_' appears in the
+ prototype, that is actually `double' in the prototype for `NAME' and
+ `float' in the prototype for `NAMEf'. Reentrant variant functions are
+ called `NAME_r' and `NAMEf_r'.
+
+ Functions returning other types like `int' are declared using the macro:
+
+ __MATHDECL (TYPE, NAME,[_r], (ARGS...));
+
+ This is just like __MATHCALL but for a function returning `TYPE'
+ instead of `_Mdouble_'. In all of these cases, there is still
+ both a `NAME' and a `NAMEf' that takes `float' arguments.
+
+ Note that there must be no whitespace before the argument passed for
+ NAME, to make token pasting work with -traditional. */
+
+#ifndef _MATH_H
+# error "Never include <bits/mathcalls.h> directly; include <math.h> instead."
+#endif
+
+
+/* Trigonometric functions. */
+
+_Mdouble_BEGIN_NAMESPACE
+/* Arc cosine of X. */
+__MATHCALL (acos,, (_Mdouble_ __x));
+/* Arc sine of X. */
+__MATHCALL (asin,, (_Mdouble_ __x));
+/* Arc tangent of X. */
+__MATHCALL (atan,, (_Mdouble_ __x));
+/* Arc tangent of Y/X. */
+__MATHCALL (atan2,, (_Mdouble_ __y, _Mdouble_ __x));
+
+/* Cosine of X. */
+__MATHCALL (cos,, (_Mdouble_ __x));
+/* Sine of X. */
+__MATHCALL (sin,, (_Mdouble_ __x));
+/* Tangent of X. */
+__MATHCALL (tan,, (_Mdouble_ __x));
+
+/* Hyperbolic functions. */
+
+/* Hyperbolic cosine of X. */
+__MATHCALL (cosh,, (_Mdouble_ __x));
+/* Hyperbolic sine of X. */
+__MATHCALL (sinh,, (_Mdouble_ __x));
+/* Hyperbolic tangent of X. */
+__MATHCALL (tanh,, (_Mdouble_ __x));
+_Mdouble_END_NAMESPACE
+
+#ifdef __USE_GNU
+/* Cosine and sine of X. */
+__MATHDECL (void,sincos,,
+ (_Mdouble_ __x, _Mdouble_ *__sinx, _Mdouble_ *__cosx));
+#endif
+
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Hyperbolic arc cosine of X. */
+__MATHCALL (acosh,, (_Mdouble_ __x));
+/* Hyperbolic arc sine of X. */
+__MATHCALL (asinh,, (_Mdouble_ __x));
+/* Hyperbolic arc tangent of X. */
+__MATHCALL (atanh,, (_Mdouble_ __x));
+__END_NAMESPACE_C99
+#endif
+
+/* Exponential and logarithmic functions. */
+
+_Mdouble_BEGIN_NAMESPACE
+/* Exponential function of X. */
+__MATHCALL (exp,, (_Mdouble_ __x));
+
+/* Break VALUE into a normalized fraction and an integral power of 2. */
+__MATHCALL (frexp,, (_Mdouble_ __x, int *__exponent));
+
+/* X times (two to the EXP power). */
+__MATHCALL (ldexp,, (_Mdouble_ __x, int __exponent));
+
+/* Natural logarithm of X. */
+__MATHCALL (log,, (_Mdouble_ __x));
+
+/* Base-ten logarithm of X. */
+__MATHCALL (log10,, (_Mdouble_ __x));
+
+/* Break VALUE into integral and fractional parts. */
+__MATHCALL (modf,, (_Mdouble_ __x, _Mdouble_ *__iptr));
+_Mdouble_END_NAMESPACE
+
+#ifdef __USE_GNU
+/* A function missing in all standards: compute exponent to base ten. */
+__MATHCALL (exp10,, (_Mdouble_ __x));
+/* Another name occasionally used. */
+__MATHCALL (pow10,, (_Mdouble_ __x));
+#endif
+
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Return exp(X) - 1. */
+__MATHCALL (expm1,, (_Mdouble_ __x));
+
+/* Return log(1 + X). */
+__MATHCALL (log1p,, (_Mdouble_ __x));
+
+/* Return the base 2 signed integral exponent of X. */
+__MATHCALL (logb,, (_Mdouble_ __x));
+__END_NAMESPACE_C99
+#endif
+
+#ifdef __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Compute base-2 exponential of X. */
+__MATHCALL (exp2,, (_Mdouble_ __x));
+
+/* Compute base-2 logarithm of X. */
+__MATHCALL (log2,, (_Mdouble_ __x));
+__END_NAMESPACE_C99
+#endif
+
+
+/* Power functions. */
+
+_Mdouble_BEGIN_NAMESPACE
+/* Return X to the Y power. */
+__MATHCALL (pow,, (_Mdouble_ __x, _Mdouble_ __y));
+
+/* Return the square root of X. */
+__MATHCALL (sqrt,, (_Mdouble_ __x));
+_Mdouble_END_NAMESPACE
+
+#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Return `sqrt(X*X + Y*Y)'. */
+__MATHCALL (hypot,, (_Mdouble_ __x, _Mdouble_ __y));
+__END_NAMESPACE_C99
+#endif
+
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Return the cube root of X. */
+__MATHCALL (cbrt,, (_Mdouble_ __x));
+__END_NAMESPACE_C99
+#endif
+
+
+/* Nearest integer, absolute value, and remainder functions. */
+
+_Mdouble_BEGIN_NAMESPACE
+/* Smallest integral value not less than X. */
+__MATHCALLX (ceil,, (_Mdouble_ __x), (__const__));
+
+/* Absolute value of X. */
+__MATHCALLX (fabs,, (_Mdouble_ __x), (__const__));
+
+/* Largest integer not greater than X. */
+__MATHCALLX (floor,, (_Mdouble_ __x), (__const__));
+
+/* Floating-point modulo remainder of X/Y. */
+__MATHCALL (fmod,, (_Mdouble_ __x, _Mdouble_ __y));
+
+
+/* Return 0 if VALUE is finite or NaN, +1 if it
+ is +Infinity, -1 if it is -Infinity. */
+__MATHDECL_1 (int,__isinf,, (_Mdouble_ __value)) __attribute__ ((__const__));
+
+/* Return nonzero if VALUE is finite and not NaN. */
+__MATHDECL_1 (int,__finite,, (_Mdouble_ __value)) __attribute__ ((__const__));
+_Mdouble_END_NAMESPACE
+
+#ifdef __USE_MISC
+/* Return 0 if VALUE is finite or NaN, +1 if it
+ is +Infinity, -1 if it is -Infinity. */
+__MATHDECL_1 (int,isinf,, (_Mdouble_ __value)) __attribute__ ((__const__));
+
+/* Return nonzero if VALUE is finite and not NaN. */
+__MATHDECL_1 (int,finite,, (_Mdouble_ __value)) __attribute__ ((__const__));
+
+/* Return the remainder of X/Y. */
+__MATHCALL (drem,, (_Mdouble_ __x, _Mdouble_ __y));
+
+
+/* Return the fractional part of X after dividing out `ilogb (X)'. */
+__MATHCALL (significand,, (_Mdouble_ __x));
+#endif /* Use misc. */
+
+#if defined __USE_MISC || defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Return X with its signed changed to Y's. */
+__MATHCALLX (copysign,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
+__END_NAMESPACE_C99
+#endif
+
+#ifdef __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Return representation of NaN for double type. */
+__MATHCALLX (nan,, (__const char *__tagb), (__const__));
+__END_NAMESPACE_C99
+#endif
+
+
+/* Return nonzero if VALUE is not a number. */
+__MATHDECL_1 (int,__isnan,, (_Mdouble_ __value)) __attribute__ ((__const__));
+
+#if defined __USE_MISC || defined __USE_XOPEN
+/* Return nonzero if VALUE is not a number. */
+__MATHDECL_1 (int,isnan,, (_Mdouble_ __value)) __attribute__ ((__const__));
+
+/* Bessel functions. */
+__MATHCALL (j0,, (_Mdouble_));
+__MATHCALL (j1,, (_Mdouble_));
+__MATHCALL (jn,, (int, _Mdouble_));
+__MATHCALL (y0,, (_Mdouble_));
+__MATHCALL (y1,, (_Mdouble_));
+__MATHCALL (yn,, (int, _Mdouble_));
+#endif
+
+
+#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Error and gamma functions. */
+__MATHCALL (erf,, (_Mdouble_));
+__MATHCALL (erfc,, (_Mdouble_));
+__MATHCALL (lgamma,, (_Mdouble_));
+__END_NAMESPACE_C99
+#endif
+
+#ifdef __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* True gamma function. */
+__MATHCALL (tgamma,, (_Mdouble_));
+__END_NAMESPACE_C99
+#endif
+
+#if defined __USE_MISC || defined __USE_XOPEN
+/* Obsolete alias for `lgamma'. */
+__MATHCALL (gamma,, (_Mdouble_));
+#endif
+
+#ifdef __USE_MISC
+/* Reentrant version of lgamma. This function uses the global variable
+ `signgam'. The reentrant version instead takes a pointer and stores
+ the value through it. */
+__MATHCALL (lgamma,_r, (_Mdouble_, int *__signgamp));
+#endif
+
+
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Return the integer nearest X in the direction of the
+ prevailing rounding mode. */
+__MATHCALL (rint,, (_Mdouble_ __x));
+
+/* Return X + epsilon if X < Y, X - epsilon if X > Y. */
+__MATHCALLX (nextafter,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
+# if defined __USE_ISOC99 && !defined __LDBL_COMPAT
+__MATHCALLX (nexttoward,, (_Mdouble_ __x, long double __y), (__const__));
+# endif
+
+/* Return the remainder of integer divison X / Y with infinite precision. */
+__MATHCALL (remainder,, (_Mdouble_ __x, _Mdouble_ __y));
+
+# if defined __USE_MISC || defined __USE_ISOC99
+/* Return X times (2 to the Nth power). */
+__MATHCALL (scalbn,, (_Mdouble_ __x, int __n));
+# endif
+
+/* Return the binary exponent of X, which must be nonzero. */
+__MATHDECL (int,ilogb,, (_Mdouble_ __x));
+#endif
+
+#ifdef __USE_ISOC99
+/* Return X times (2 to the Nth power). */
+__MATHCALL (scalbln,, (_Mdouble_ __x, long int __n));
+
+/* Round X to integral value in floating-point format using current
+ rounding direction, but do not raise inexact exception. */
+__MATHCALL (nearbyint,, (_Mdouble_ __x));
+
+/* Round X to nearest integral value, rounding halfway cases away from
+ zero. */
+__MATHCALLX (round,, (_Mdouble_ __x), (__const__));
+
+/* Round X to the integral value in floating-point format nearest but
+ not larger in magnitude. */
+__MATHCALLX (trunc,, (_Mdouble_ __x), (__const__));
+
+/* Compute remainder of X and Y and put in *QUO a value with sign of x/y
+ and magnitude congruent `mod 2^n' to the magnitude of the integral
+ quotient x/y, with n >= 3. */
+__MATHCALL (remquo,, (_Mdouble_ __x, _Mdouble_ __y, int *__quo));
+
+
+/* Conversion functions. */
+
+/* Round X to nearest integral value according to current rounding
+ direction. */
+__MATHDECL (long int,lrint,, (_Mdouble_ __x));
+__MATHDECL (long long int,llrint,, (_Mdouble_ __x));
+
+/* Round X to nearest integral value, rounding halfway cases away from
+ zero. */
+__MATHDECL (long int,lround,, (_Mdouble_ __x));
+__MATHDECL (long long int,llround,, (_Mdouble_ __x));
+
+
+/* Return positive difference between X and Y. */
+__MATHCALL (fdim,, (_Mdouble_ __x, _Mdouble_ __y));
+
+/* Return maximum numeric value from X and Y. */
+__MATHCALL (fmax,, (_Mdouble_ __x, _Mdouble_ __y));
+
+/* Return minimum numeric value from X and Y. */
+__MATHCALL (fmin,, (_Mdouble_ __x, _Mdouble_ __y));
+
+
+/* Classify given number. */
+__MATHDECL_1 (int, __fpclassify,, (_Mdouble_ __value))
+ __attribute__ ((__const__));
+
+/* Test for negative number. */
+__MATHDECL_1 (int, __signbit,, (_Mdouble_ __value))
+ __attribute__ ((__const__));
+
+
+/* Multiply-add function computed as a ternary operation. */
+__MATHCALL (fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z));
+#endif /* Use ISO C99. */
+
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+__END_NAMESPACE_C99
+#endif
+
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
+/* Return X times (2 to the Nth power). */
+__MATHCALL (scalb,, (_Mdouble_ __x, _Mdouble_ __n));
+#endif
diff --git a/sysroot/usr/include/bits/mathdef.h b/sysroot/usr/include/bits/mathdef.h
new file mode 100644
index 0000000..7b16189
--- /dev/null
+++ b/sysroot/usr/include/bits/mathdef.h
@@ -0,0 +1,48 @@
+/* Copyright (C) 2001, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#if !defined _MATH_H && !defined _COMPLEX_H
+# error "Never use <bits/mathdef.h> directly; include <math.h> instead"
+#endif
+
+#if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF
+# define _MATH_H_MATHDEF 1
+
+# include <bits/wordsize.h>
+
+# if __WORDSIZE == 64 || (defined __FLT_EVAL_METHOD__ && __FLT_EVAL_METHOD__ == 0)
+/* The x86-64 architecture computes values with the precission of the
+ used type. Similarly for -m32 -mfpmath=sse. */
+typedef float float_t; /* `float' expressions are evaluated as `float'. */
+typedef double double_t; /* `double' expressions are evaluated
+ as `double'. */
+# else
+/* The ix87 FPUs evaluate all values in the 80 bit floating-point format
+ which is also available for the user as `long double'. Therefore we
+ define: */
+typedef long double float_t; /* `float' expressions are evaluated as
+ `long double'. */
+typedef long double double_t; /* `double' expressions are evaluated as
+ `long double'. */
+# endif
+
+/* The values returned by `ilogb' for 0 and NaN respectively. */
+# define FP_ILOGB0 (-2147483647 - 1)
+# define FP_ILOGBNAN (-2147483647 - 1)
+
+#endif /* ISO C99 */
diff --git a/sysroot/usr/include/bits/mathinline.h b/sysroot/usr/include/bits/mathinline.h
new file mode 100644
index 0000000..e8a919f
--- /dev/null
+++ b/sysroot/usr/include/bits/mathinline.h
@@ -0,0 +1,53 @@
+/* Inline math functions for x86-64.
+ Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Andreas Jaeger <aj@suse.de>, 2002.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _MATH_H
+# error "Never use <bits/mathinline.h> directly; include <math.h> instead."
+#endif
+
+#ifndef __extern_inline
+# define __MATH_INLINE __inline
+#else
+# define __MATH_INLINE __extern_inline
+#endif
+
+
+#if defined __USE_ISOC99 && defined __GNUC__ && __GNUC__ >= 2
+
+/* Test for negative number. Used in the signbit() macro. */
+__MATH_INLINE int
+__NTH (__signbitf (float __x))
+{
+ __extension__ union { float __f; int __i; } __u = { __f: __x };
+ return __u.__i < 0;
+}
+__MATH_INLINE int
+__NTH (__signbit (double __x))
+{
+ __extension__ union { double __d; int __i[2]; } __u = { __d: __x };
+ return __u.__i[1] < 0;
+}
+__MATH_INLINE int
+__NTH (__signbitl (long double __x))
+{
+ __extension__ union { long double __l; int __i[3]; } __u = { __l: __x };
+ return (__u.__i[2] & 0x8000) != 0;
+}
+#endif
diff --git a/sysroot/usr/include/bits/mman.h b/sysroot/usr/include/bits/mman.h
new file mode 100644
index 0000000..535c9ed
--- /dev/null
+++ b/sysroot/usr/include/bits/mman.h
@@ -0,0 +1,104 @@
+/* Definitions for POSIX memory map interface. Linux/x86_64 version.
+ Copyright (C) 2001, 2003, 2005, 2006 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_MMAN_H
+# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
+#endif
+
+/* The following definitions basically come from the kernel headers.
+ But the kernel header is not namespace clean. */
+
+
+/* Protections are chosen from these bits, OR'd together. The
+ implementation does not necessarily support PROT_EXEC or PROT_WRITE
+ without PROT_READ. The only guarantees are that no writing will be
+ allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
+
+#define PROT_READ 0x1 /* Page can be read. */
+#define PROT_WRITE 0x2 /* Page can be written. */
+#define PROT_EXEC 0x4 /* Page can be executed. */
+#define PROT_NONE 0x0 /* Page can not be accessed. */
+#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of
+ growsdown vma (mprotect only). */
+#define PROT_GROWSUP 0x02000000 /* Extend change to start of
+ growsup vma (mprotect only). */
+
+/* Sharing types (must choose one and only one of these). */
+#define MAP_SHARED 0x01 /* Share changes. */
+#define MAP_PRIVATE 0x02 /* Changes are private. */
+#ifdef __USE_MISC
+# define MAP_TYPE 0x0f /* Mask for type of mapping. */
+#endif
+
+/* Other flags. */
+#define MAP_FIXED 0x10 /* Interpret addr exactly. */
+#ifdef __USE_MISC
+# define MAP_FILE 0
+# define MAP_ANONYMOUS 0x20 /* Don't use a file. */
+# define MAP_ANON MAP_ANONYMOUS
+# define MAP_32BIT 0x40 /* Only give out 32-bit addresses. */
+#endif
+
+/* These are Linux-specific. */
+#ifdef __USE_MISC
+# define MAP_GROWSDOWN 0x00100 /* Stack-like segment. */
+# define MAP_DENYWRITE 0x00800 /* ETXTBSY */
+# define MAP_EXECUTABLE 0x01000 /* Mark it as an executable. */
+# define MAP_LOCKED 0x02000 /* Lock the mapping. */
+# define MAP_NORESERVE 0x04000 /* Don't check for reservations. */
+# define MAP_POPULATE 0x08000 /* Populate (prefault) pagetables. */
+# define MAP_NONBLOCK 0x10000 /* Do not block on IO. */
+#endif
+
+/* Flags to `msync'. */
+#define MS_ASYNC 1 /* Sync memory asynchronously. */
+#define MS_SYNC 4 /* Synchronous memory sync. */
+#define MS_INVALIDATE 2 /* Invalidate the caches. */
+
+/* Flags for `mlockall'. */
+#define MCL_CURRENT 1 /* Lock all currently mapped pages. */
+#define MCL_FUTURE 2 /* Lock all additions to address
+ space. */
+
+/* Flags for `mremap'. */
+#ifdef __USE_GNU
+# define MREMAP_MAYMOVE 1
+# define MREMAP_FIXED 2
+#endif
+
+/* Advice to `madvise'. */
+#ifdef __USE_BSD
+# define MADV_NORMAL 0 /* No further special treatment. */
+# define MADV_RANDOM 1 /* Expect random page references. */
+# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
+# define MADV_WILLNEED 3 /* Will need these pages. */
+# define MADV_DONTNEED 4 /* Don't need these pages. */
+# define MADV_REMOVE 9 /* Remove these pages and resources. */
+# define MADV_DONTFORK 10 /* Do not inherit across fork. */
+# define MADV_DOFORK 11 /* Do inherit across fork. */
+#endif
+
+/* The POSIX people had to invent similar names for the same things. */
+#ifdef __USE_XOPEN2K
+# define POSIX_MADV_NORMAL 0 /* No further special treatment. */
+# define POSIX_MADV_RANDOM 1 /* Expect random page references. */
+# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */
+# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */
+# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */
+#endif
diff --git a/sysroot/usr/include/bits/monetary-ldbl.h b/sysroot/usr/include/bits/monetary-ldbl.h
new file mode 100644
index 0000000..3e080f9
--- /dev/null
+++ b/sysroot/usr/include/bits/monetary-ldbl.h
@@ -0,0 +1,28 @@
+/* -mlong-double-64 compatibility mode for monetary functions.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _MONETARY_H
+# error "Never include <bits/monetary-ldbl.h> directly; use <monetary.h> instead."
+#endif
+
+__LDBL_REDIR_DECL (strfmon)
+
+#ifdef __USE_GNU
+__LDBL_REDIR_DECL (strfmon_l)
+#endif
diff --git a/sysroot/usr/include/bits/mqueue.h b/sysroot/usr/include/bits/mqueue.h
new file mode 100644
index 0000000..df528f8
--- /dev/null
+++ b/sysroot/usr/include/bits/mqueue.h
@@ -0,0 +1,32 @@
+/* Copyright (C) 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _MQUEUE_H
+# error "Never use <bits/mqueue.h> directly; include <mqueue.h> instead."
+#endif
+
+typedef int mqd_t;
+
+struct mq_attr
+{
+ long int mq_flags; /* Message queue flags. */
+ long int mq_maxmsg; /* Maximum number of messages. */
+ long int mq_msgsize; /* Maximum message size. */
+ long int mq_curmsgs; /* Number of messages currently queued. */
+ long int __pad[4];
+};
diff --git a/sysroot/usr/include/bits/mqueue2.h b/sysroot/usr/include/bits/mqueue2.h
new file mode 100644
index 0000000..4c90609
--- /dev/null
+++ b/sysroot/usr/include/bits/mqueue2.h
@@ -0,0 +1,56 @@
+/* Checking macros for mq functions.
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _FCNTL_H
+# error "Never include <bits/mqueue2.h> directly; use <mqueue.h> instead."
+#endif
+
+/* Check that calls to mq_open with O_CREAT set have an appropriate third and fourth
+ parameter. */
+extern mqd_t mq_open (__const char *__name, int __oflag, ...)
+ __THROW __nonnull ((1));
+extern mqd_t __mq_open_2 (__const char *__name, int __oflag) __nonnull ((1));
+extern mqd_t __REDIRECT (__mq_open_alias, (__const char *__name, int __oflag, ...),
+ mq_open) __nonnull ((1));
+__errordecl (__mq_open_wrong_number_of_args,
+ "mq_open can be called either with 2 or 4 arguments");
+__errordecl (__mq_open_missing_mode_and_attr,
+ "mq_open with O_CREAT in second argument needs 4 arguments");
+
+__extern_always_inline mqd_t
+mq_open (__const char *__name, int __oflag, ...)
+{
+ if (__va_arg_pack_len () != 0 && __va_arg_pack_len () != 2)
+ __mq_open_wrong_number_of_args ();
+
+ if (__builtin_constant_p (__oflag))
+ {
+ if ((__oflag & O_CREAT) != 0 && __va_arg_pack_len () == 0)
+ {
+ __mq_open_missing_mode_and_attr ();
+ return __mq_open_2 (__name, __oflag);
+ }
+ return __mq_open_alias (__name, __oflag, __va_arg_pack ());
+ }
+
+ if (__va_arg_pack_len () == 0)
+ return __mq_open_2 (__name, __oflag);
+
+ return __mq_open_alias (__name, __oflag, __va_arg_pack ());
+}
diff --git a/sysroot/usr/include/bits/msq.h b/sysroot/usr/include/bits/msq.h
new file mode 100644
index 0000000..422218a
--- /dev/null
+++ b/sysroot/usr/include/bits/msq.h
@@ -0,0 +1,83 @@
+/* Copyright (C) 1995, 1996, 1997, 2000, 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_MSG_H
+# error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
+#endif
+
+#include <bits/types.h>
+#include <bits/wordsize.h>
+
+/* Define options for message queue functions. */
+#define MSG_NOERROR 010000 /* no error if message is too big */
+#ifdef __USE_GNU
+# define MSG_EXCEPT 020000 /* recv any msg except of specified type */
+#endif
+
+/* Types used in the structure definition. */
+typedef unsigned long int msgqnum_t;
+typedef unsigned long int msglen_t;
+
+/* Structure of record for one message inside the kernel.
+ The type `struct msg' is opaque. */
+struct msqid_ds
+{
+ struct ipc_perm msg_perm; /* structure describing operation permission */
+ __time_t msg_stime; /* time of last msgsnd command */
+#if __WORDSIZE == 32
+ unsigned long int __unused1;
+#endif
+ __time_t msg_rtime; /* time of last msgrcv command */
+#if __WORDSIZE == 32
+ unsigned long int __unused2;
+#endif
+ __time_t msg_ctime; /* time of last change */
+#if __WORDSIZE == 32
+ unsigned long int __unused3;
+#endif
+ unsigned long int __msg_cbytes; /* current number of bytes on queue */
+ msgqnum_t msg_qnum; /* number of messages currently on queue */
+ msglen_t msg_qbytes; /* max number of bytes allowed on queue */
+ __pid_t msg_lspid; /* pid of last msgsnd() */
+ __pid_t msg_lrpid; /* pid of last msgrcv() */
+ unsigned long int __unused4;
+ unsigned long int __unused5;
+};
+
+#ifdef __USE_MISC
+
+# define msg_cbytes __msg_cbytes
+
+/* ipcs ctl commands */
+# define MSG_STAT 11
+# define MSG_INFO 12
+
+/* buffer for msgctl calls IPC_INFO, MSG_INFO */
+struct msginfo
+ {
+ int msgpool;
+ int msgmap;
+ int msgmax;
+ int msgmnb;
+ int msgmni;
+ int msgssz;
+ int msgtql;
+ unsigned short int msgseg;
+ };
+
+#endif /* __USE_MISC */
diff --git a/sysroot/usr/include/bits/nan.h b/sysroot/usr/include/bits/nan.h
new file mode 100644
index 0000000..bae97f2
--- /dev/null
+++ b/sysroot/usr/include/bits/nan.h
@@ -0,0 +1,53 @@
+/* `NAN' constant for IEEE 754 machines.
+ Copyright (C) 1992,1996,1997,1999,2004,2006 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _MATH_H
+# error "Never use <bits/nan.h> directly; include <math.h> instead."
+#endif
+
+
+/* IEEE Not A Number. */
+
+#if __GNUC_PREREQ(3,3)
+
+# define NAN (__builtin_nanf (""))
+
+#elif defined __GNUC__
+
+# define NAN \
+ (__extension__ \
+ ((union { unsigned __l __attribute__ ((__mode__ (__SI__))); float __d; }) \
+ { __l: 0x7fc00000UL }).__d)
+
+#else
+
+# include <endian.h>
+
+# if __BYTE_ORDER == __BIG_ENDIAN
+# define __nan_bytes { 0x7f, 0xc0, 0, 0 }
+# endif
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+# define __nan_bytes { 0, 0, 0xc0, 0x7f }
+# endif
+
+static union { unsigned char __c[4]; float __d; } __nan_union
+ __attribute_used__ = { __nan_bytes };
+# define NAN (__nan_union.__d)
+
+#endif /* GCC. */
diff --git a/sysroot/usr/include/bits/netdb.h b/sysroot/usr/include/bits/netdb.h
new file mode 100644
index 0000000..41dc731
--- /dev/null
+++ b/sysroot/usr/include/bits/netdb.h
@@ -0,0 +1,33 @@
+/* Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _NETDB_H
+# error "Never include <bits/netdb.h> directly; use <netdb.h> instead."
+#endif
+
+
+/* Description of data base entry for a single network. NOTE: here a
+ poor assumption is made. The network number is expected to fit
+ into an unsigned long int variable. */
+struct netent
+{
+ char *n_name; /* Official name of network. */
+ char **n_aliases; /* Alias list. */
+ int n_addrtype; /* Net address type. */
+ uint32_t n_net; /* Network number. */
+};
diff --git a/sysroot/usr/include/bits/poll.h b/sysroot/usr/include/bits/poll.h
new file mode 100644
index 0000000..d7996b4
--- /dev/null
+++ b/sysroot/usr/include/bits/poll.h
@@ -0,0 +1,50 @@
+/* Copyright (C) 1997, 2001, 2006 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_POLL_H
+# error "Never use <bits/poll.h> directly; include <sys/poll.h> instead."
+#endif
+
+/* Event types that can be polled for. These bits may be set in `events'
+ to indicate the interesting event types; they will appear in `revents'
+ to indicate the status of the file descriptor. */
+#define POLLIN 0x001 /* There is data to read. */
+#define POLLPRI 0x002 /* There is urgent data to read. */
+#define POLLOUT 0x004 /* Writing now will not block. */
+
+#ifdef __USE_XOPEN
+/* These values are defined in XPG4.2. */
+# define POLLRDNORM 0x040 /* Normal data may be read. */
+# define POLLRDBAND 0x080 /* Priority data may be read. */
+# define POLLWRNORM 0x100 /* Writing now will not block. */
+# define POLLWRBAND 0x200 /* Priority data may be written. */
+#endif
+
+#ifdef __USE_GNU
+/* These are extensions for Linux. */
+# define POLLMSG 0x400
+# define POLLREMOVE 0x1000
+# define POLLRDHUP 0x2000
+#endif
+
+/* Event types always implicitly polled for. These bits need not be set in
+ `events', but they will appear in `revents' to indicate the status of
+ the file descriptor. */
+#define POLLERR 0x008 /* Error condition. */
+#define POLLHUP 0x010 /* Hung up. */
+#define POLLNVAL 0x020 /* Invalid polling request. */
diff --git a/sysroot/usr/include/bits/posix1_lim.h b/sysroot/usr/include/bits/posix1_lim.h
new file mode 100644
index 0000000..71c58f7
--- /dev/null
+++ b/sysroot/usr/include/bits/posix1_lim.h
@@ -0,0 +1,168 @@
+/* Copyright (C) 1991-1993,96,98,2000-2003,2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * POSIX Standard: 2.9.2 Minimum Values Added to <limits.h>
+ *
+ * Never include this file directly; use <limits.h> instead.
+ */
+
+#ifndef _BITS_POSIX1_LIM_H
+#define _BITS_POSIX1_LIM_H 1
+
+
+/* These are the standard-mandated minimum values. */
+
+/* Minimum number of operations in one list I/O call. */
+#define _POSIX_AIO_LISTIO_MAX 2
+
+/* Minimal number of outstanding asynchronous I/O operations. */
+#define _POSIX_AIO_MAX 1
+
+/* Maximum length of arguments to `execve', including environment. */
+#define _POSIX_ARG_MAX 4096
+
+/* Maximum simultaneous processes per real user ID. */
+#ifdef __USE_XOPEN2K
+# define _POSIX_CHILD_MAX 25
+#else
+# define _POSIX_CHILD_MAX 6
+#endif
+
+/* Minimal number of timer expiration overruns. */
+#define _POSIX_DELAYTIMER_MAX 32
+
+/* Maximum length of a host name (not including the terminating null)
+ as returned from the GETHOSTNAME function. */
+#define _POSIX_HOST_NAME_MAX 255
+
+/* Maximum link count of a file. */
+#define _POSIX_LINK_MAX 8
+
+/* Maximum length of login name. */
+#define _POSIX_LOGIN_NAME_MAX 9
+
+/* Number of bytes in a terminal canonical input queue. */
+#define _POSIX_MAX_CANON 255
+
+/* Number of bytes for which space will be
+ available in a terminal input queue. */
+#define _POSIX_MAX_INPUT 255
+
+/* Maximum number of message queues open for a process. */
+#define _POSIX_MQ_OPEN_MAX 8
+
+/* Maximum number of supported message priorities. */
+#define _POSIX_MQ_PRIO_MAX 32
+
+/* Number of bytes in a filename. */
+#define _POSIX_NAME_MAX 14
+
+/* Number of simultaneous supplementary group IDs per process. */
+#ifdef __USE_XOPEN2K
+# define _POSIX_NGROUPS_MAX 8
+#else
+# define _POSIX_NGROUPS_MAX 0
+#endif
+
+/* Number of files one process can have open at once. */
+#ifdef __USE_XOPEN2K
+# define _POSIX_OPEN_MAX 20
+#else
+# define _POSIX_OPEN_MAX 16
+#endif
+
+/* Number of descriptors that a process may examine with `pselect' or
+ `select'. */
+#define _POSIX_FD_SETSIZE _POSIX_OPEN_MAX
+
+/* Number of bytes in a pathname. */
+#define _POSIX_PATH_MAX 256
+
+/* Number of bytes than can be written atomically to a pipe. */
+#define _POSIX_PIPE_BUF 512
+
+/* The number of repeated occurrences of a BRE permitted by the
+ REGEXEC and REGCOMP functions when using the interval notation. */
+#define _POSIX_RE_DUP_MAX 255
+
+/* Minimal number of realtime signals reserved for the application. */
+#define _POSIX_RTSIG_MAX 8
+
+/* Number of semaphores a process can have. */
+#define _POSIX_SEM_NSEMS_MAX 256
+
+/* Maximal value of a semaphore. */
+#define _POSIX_SEM_VALUE_MAX 32767
+
+/* Number of pending realtime signals. */
+#define _POSIX_SIGQUEUE_MAX 32
+
+/* Largest value of a `ssize_t'. */
+#define _POSIX_SSIZE_MAX 32767
+
+/* Number of streams a process can have open at once. */
+#define _POSIX_STREAM_MAX 8
+
+/* The number of bytes in a symbolic link. */
+#define _POSIX_SYMLINK_MAX 255
+
+/* The number of symbolic links that can be traversed in the
+ resolution of a pathname in the absence of a loop. */
+#define _POSIX_SYMLOOP_MAX 8
+
+/* Number of timer for a process. */
+#define _POSIX_TIMER_MAX 32
+
+/* Maximum number of characters in a tty name. */
+#define _POSIX_TTY_NAME_MAX 9
+
+/* Maximum length of a timezone name (element of `tzname'). */
+#define _POSIX_TZNAME_MAX 6
+
+/* Maximum number of connections that can be queued on a socket. */
+#define _POSIX_QLIMIT 1
+
+/* Maximum number of bytes that can be buffered on a socket for send
+ or receive. */
+#define _POSIX_HIWAT _POSIX_PIPE_BUF
+
+/* Maximum number of elements in an `iovec' array. */
+#define _POSIX_UIO_MAXIOV 16
+
+/* Maximum clock resolution in nanoseconds. */
+#define _POSIX_CLOCKRES_MIN 20000000
+
+
+/* Get the implementation-specific values for the above. */
+#include <bits/local_lim.h>
+
+
+#ifndef SSIZE_MAX
+# define SSIZE_MAX LONG_MAX
+#endif
+
+
+/* This value is a guaranteed minimum maximum.
+ The current maximum can be got from `sysconf'. */
+
+#ifndef NGROUPS_MAX
+# define NGROUPS_MAX 8
+#endif
+
+#endif /* bits/posix1_lim.h */
diff --git a/sysroot/usr/include/bits/posix2_lim.h b/sysroot/usr/include/bits/posix2_lim.h
new file mode 100644
index 0000000..24483a0
--- /dev/null
+++ b/sysroot/usr/include/bits/posix2_lim.h
@@ -0,0 +1,91 @@
+/* Copyright (C) 1991, 1996, 1999, 2000, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * Never include this file directly; include <limits.h> instead.
+ */
+
+#ifndef _BITS_POSIX2_LIM_H
+#define _BITS_POSIX2_LIM_H 1
+
+
+/* The maximum `ibase' and `obase' values allowed by the `bc' utility. */
+#define _POSIX2_BC_BASE_MAX 99
+
+/* The maximum number of elements allowed in an array by the `bc' utility. */
+#define _POSIX2_BC_DIM_MAX 2048
+
+/* The maximum `scale' value allowed by the `bc' utility. */
+#define _POSIX2_BC_SCALE_MAX 99
+
+/* The maximum length of a string constant accepted by the `bc' utility. */
+#define _POSIX2_BC_STRING_MAX 1000
+
+/* The maximum number of weights that can be assigned to an entry of
+ the LC_COLLATE `order' keyword in the locale definition file. */
+#define _POSIX2_COLL_WEIGHTS_MAX 2
+
+/* The maximum number of expressions that can be nested
+ within parentheses by the `expr' utility. */
+#define _POSIX2_EXPR_NEST_MAX 32
+
+/* The maximum length, in bytes, of an input line. */
+#define _POSIX2_LINE_MAX 2048
+
+/* The maximum number of repeated occurrences of a regular expression
+ permitted when using the interval notation `\{M,N\}'. */
+#define _POSIX2_RE_DUP_MAX 255
+
+/* The maximum number of bytes in a character class name. We have no
+ fixed limit, 2048 is a high number. */
+#define _POSIX2_CHARCLASS_NAME_MAX 14
+
+
+/* These values are implementation-specific,
+ and may vary within the implementation.
+ Their precise values can be obtained from sysconf. */
+
+#ifndef BC_BASE_MAX
+#define BC_BASE_MAX _POSIX2_BC_BASE_MAX
+#endif
+#ifndef BC_DIM_MAX
+#define BC_DIM_MAX _POSIX2_BC_DIM_MAX
+#endif
+#ifndef BC_SCALE_MAX
+#define BC_SCALE_MAX _POSIX2_BC_SCALE_MAX
+#endif
+#ifndef BC_STRING_MAX
+#define BC_STRING_MAX _POSIX2_BC_STRING_MAX
+#endif
+#ifndef COLL_WEIGHTS_MAX
+#define COLL_WEIGHTS_MAX 255
+#endif
+#ifndef EXPR_NEST_MAX
+#define EXPR_NEST_MAX _POSIX2_EXPR_NEST_MAX
+#endif
+#ifndef LINE_MAX
+#define LINE_MAX _POSIX2_LINE_MAX
+#endif
+#ifndef CHARCLASS_NAME_MAX
+#define CHARCLASS_NAME_MAX 2048
+#endif
+
+/* This value is defined like this in regex.h. */
+#define RE_DUP_MAX (0x7fff)
+
+#endif /* bits/posix2_lim.h */
diff --git a/sysroot/usr/include/bits/posix_opt.h b/sysroot/usr/include/bits/posix_opt.h
new file mode 100644
index 0000000..dd0798a
--- /dev/null
+++ b/sysroot/usr/include/bits/posix_opt.h
@@ -0,0 +1,184 @@
+/* Define POSIX options for Linux.
+ Copyright (C) 1996-2004, 2006 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef _POSIX_OPT_H
+#define _POSIX_OPT_H 1
+
+/* Job control is supported. */
+#define _POSIX_JOB_CONTROL 1
+
+/* Processes have a saved set-user-ID and a saved set-group-ID. */
+#define _POSIX_SAVED_IDS 1
+
+/* Priority scheduling is supported. */
+#define _POSIX_PRIORITY_SCHEDULING 200112L
+
+/* Synchronizing file data is supported. */
+#define _POSIX_SYNCHRONIZED_IO 200112L
+
+/* The fsync function is present. */
+#define _POSIX_FSYNC 200112L
+
+/* Mapping of files to memory is supported. */
+#define _POSIX_MAPPED_FILES 200112L
+
+/* Locking of all memory is supported. */
+#define _POSIX_MEMLOCK 200112L
+
+/* Locking of ranges of memory is supported. */
+#define _POSIX_MEMLOCK_RANGE 200112L
+
+/* Setting of memory protections is supported. */
+#define _POSIX_MEMORY_PROTECTION 200112L
+
+/* Only root can change owner of file. */
+#define _POSIX_CHOWN_RESTRICTED 1
+
+/* `c_cc' member of 'struct termios' structure can be disabled by
+ using the value _POSIX_VDISABLE. */
+#define _POSIX_VDISABLE '\0'
+
+/* Filenames are not silently truncated. */
+#define _POSIX_NO_TRUNC 1
+
+/* X/Open realtime support is available. */
+#define _XOPEN_REALTIME 1
+
+/* X/Open thread realtime support is available. */
+#define _XOPEN_REALTIME_THREADS 1
+
+/* XPG4.2 shared memory is supported. */
+#define _XOPEN_SHM 1
+
+/* Tell we have POSIX threads. */
+#define _POSIX_THREADS 200112L
+
+/* We have the reentrant functions described in POSIX. */
+#define _POSIX_REENTRANT_FUNCTIONS 1
+#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L
+
+/* We provide priority scheduling for threads. */
+#define _POSIX_THREAD_PRIORITY_SCHEDULING 200112L
+
+/* We support user-defined stack sizes. */
+#define _POSIX_THREAD_ATTR_STACKSIZE 200112L
+
+/* We support user-defined stacks. */
+#define _POSIX_THREAD_ATTR_STACKADDR 200112L
+
+/* We support priority inheritence. */
+#define _POSIX_THREAD_PRIO_INHERIT 200112L
+
+/* We support priority protection, though only for non-robust
+ mutexes. */
+#define _POSIX_THREAD_PRIO_PROTECT 200112L
+
+/* We support POSIX.1b semaphores. */
+#define _POSIX_SEMAPHORES 200112L
+
+/* Real-time signals are supported. */
+#define _POSIX_REALTIME_SIGNALS 200112L
+
+/* We support asynchronous I/O. */
+#define _POSIX_ASYNCHRONOUS_IO 200112L
+#define _POSIX_ASYNC_IO 1
+/* Alternative name for Unix98. */
+#define _LFS_ASYNCHRONOUS_IO 1
+/* Support for prioritization is also available. */
+#define _POSIX_PRIORITIZED_IO 200112L
+
+/* The LFS support in asynchronous I/O is also available. */
+#define _LFS64_ASYNCHRONOUS_IO 1
+
+/* The rest of the LFS is also available. */
+#define _LFS_LARGEFILE 1
+#define _LFS64_LARGEFILE 1
+#define _LFS64_STDIO 1
+
+/* POSIX shared memory objects are implemented. */
+#define _POSIX_SHARED_MEMORY_OBJECTS 200112L
+
+/* CPU-time clocks support needs to be checked at runtime. */
+#define _POSIX_CPUTIME 0
+
+/* Clock support in threads must be also checked at runtime. */
+#define _POSIX_THREAD_CPUTIME 0
+
+/* GNU libc provides regular expression handling. */
+#define _POSIX_REGEXP 1
+
+/* Reader/Writer locks are available. */
+#define _POSIX_READER_WRITER_LOCKS 200112L
+
+/* We have a POSIX shell. */
+#define _POSIX_SHELL 1
+
+/* We support the Timeouts option. */
+#define _POSIX_TIMEOUTS 200112L
+
+/* We support spinlocks. */
+#define _POSIX_SPIN_LOCKS 200112L
+
+/* The `spawn' function family is supported. */
+#define _POSIX_SPAWN 200112L
+
+/* We have POSIX timers. */
+#define _POSIX_TIMERS 200112L
+
+/* The barrier functions are available. */
+#define _POSIX_BARRIERS 200112L
+
+/* POSIX message queues are available. */
+#define _POSIX_MESSAGE_PASSING 200112L
+
+/* Thread process-shared synchronization is supported. */
+#define _POSIX_THREAD_PROCESS_SHARED 200112L
+
+/* The monotonic clock might be available. */
+#define _POSIX_MONOTONIC_CLOCK 0
+
+/* The clock selection interfaces are available. */
+#define _POSIX_CLOCK_SELECTION 200112L
+
+/* Advisory information interfaces are available. */
+#define _POSIX_ADVISORY_INFO 200112L
+
+/* IPv6 support is available. */
+#define _POSIX_IPV6 200112L
+
+/* Raw socket support is available. */
+#define _POSIX_RAW_SOCKETS 200112L
+
+/* We have at least one terminal. */
+#define _POSIX2_CHAR_TERM 200112L
+
+/* Neither process nor thread sporadic server interfaces is available. */
+#define _POSIX_SPORADIC_SERVER -1
+#define _POSIX_THREAD_SPORADIC_SERVER -1
+
+/* trace.h is not available. */
+#define _POSIX_TRACE -1
+#define _POSIX_TRACE_EVENT_FILTER -1
+#define _POSIX_TRACE_INHERIT -1
+#define _POSIX_TRACE_LOG -1
+
+/* Typed memory objects are not available. */
+#define _POSIX_TYPED_MEMORY_OBJECTS -1
+
+#endif /* posix_opt.h */
diff --git a/sysroot/usr/include/bits/printf-ldbl.h b/sysroot/usr/include/bits/printf-ldbl.h
new file mode 100644
index 0000000..cbdc3f1
--- /dev/null
+++ b/sysroot/usr/include/bits/printf-ldbl.h
@@ -0,0 +1,24 @@
+/* -mlong-double-64 compatibility mode for <printf.h> functions.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _PRINTF_H
+# error "Never include <bits/printf-ldbl.h> directly; use <printf.h> instead."
+#endif
+
+__LDBL_REDIR_DECL (printf_size)
diff --git a/sysroot/usr/include/bits/pthreadtypes.h b/sysroot/usr/include/bits/pthreadtypes.h
new file mode 100644
index 0000000..7a09c81
--- /dev/null
+++ b/sysroot/usr/include/bits/pthreadtypes.h
@@ -0,0 +1,225 @@
+/* Copyright (C) 2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _BITS_PTHREADTYPES_H
+#define _BITS_PTHREADTYPES_H 1
+
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 64
+# define __SIZEOF_PTHREAD_ATTR_T 56
+# define __SIZEOF_PTHREAD_MUTEX_T 40
+# define __SIZEOF_PTHREAD_MUTEXATTR_T 4
+# define __SIZEOF_PTHREAD_COND_T 48
+# define __SIZEOF_PTHREAD_CONDATTR_T 4
+# define __SIZEOF_PTHREAD_RWLOCK_T 56
+# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
+# define __SIZEOF_PTHREAD_BARRIER_T 32
+# define __SIZEOF_PTHREAD_BARRIERATTR_T 4
+#else
+# define __SIZEOF_PTHREAD_ATTR_T 36
+# define __SIZEOF_PTHREAD_MUTEX_T 24
+# define __SIZEOF_PTHREAD_MUTEXATTR_T 4
+# define __SIZEOF_PTHREAD_COND_T 48
+# define __SIZEOF_PTHREAD_CONDATTR_T 4
+# define __SIZEOF_PTHREAD_RWLOCK_T 32
+# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
+# define __SIZEOF_PTHREAD_BARRIER_T 20
+# define __SIZEOF_PTHREAD_BARRIERATTR_T 4
+#endif
+
+
+/* Thread identifiers. The structure of the attribute type is not
+ exposed on purpose. */
+typedef unsigned long int pthread_t;
+
+
+typedef union
+{
+ char __size[__SIZEOF_PTHREAD_ATTR_T];
+ long int __align;
+} pthread_attr_t;
+
+
+#if __WORDSIZE == 64
+typedef struct __pthread_internal_list
+{
+ struct __pthread_internal_list *__prev;
+ struct __pthread_internal_list *__next;
+} __pthread_list_t;
+#else
+typedef struct __pthread_internal_slist
+{
+ struct __pthread_internal_slist *__next;
+} __pthread_slist_t;
+#endif
+
+
+/* Data structures for mutex handling. The structure of the attribute
+ type is not exposed on purpose. */
+typedef union
+{
+ struct __pthread_mutex_s
+ {
+ int __lock;
+ unsigned int __count;
+ int __owner;
+#if __WORDSIZE == 64
+ unsigned int __nusers;
+#endif
+ /* KIND must stay at this position in the structure to maintain
+ binary compatibility. */
+ int __kind;
+#if __WORDSIZE == 64
+ int __spins;
+ __pthread_list_t __list;
+# define __PTHREAD_MUTEX_HAVE_PREV 1
+#else
+ unsigned int __nusers;
+ __extension__ union
+ {
+ int __spins;
+ __pthread_slist_t __list;
+ };
+#endif
+ } __data;
+ char __size[__SIZEOF_PTHREAD_MUTEX_T];
+ long int __align;
+} pthread_mutex_t;
+
+typedef union
+{
+ char __size[__SIZEOF_PTHREAD_MUTEXATTR_T];
+ int __align;
+} pthread_mutexattr_t;
+
+
+/* Data structure for conditional variable handling. The structure of
+ the attribute type is not exposed on purpose. */
+typedef union
+{
+ struct
+ {
+ int __lock;
+ unsigned int __futex;
+ __extension__ unsigned long long int __total_seq;
+ __extension__ unsigned long long int __wakeup_seq;
+ __extension__ unsigned long long int __woken_seq;
+ void *__mutex;
+ unsigned int __nwaiters;
+ unsigned int __broadcast_seq;
+ } __data;
+ char __size[__SIZEOF_PTHREAD_COND_T];
+ __extension__ long long int __align;
+} pthread_cond_t;
+
+typedef union
+{
+ char __size[__SIZEOF_PTHREAD_CONDATTR_T];
+ int __align;
+} pthread_condattr_t;
+
+
+/* Keys for thread-specific data */
+typedef unsigned int pthread_key_t;
+
+
+/* Once-only execution */
+typedef int pthread_once_t;
+
+
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K
+/* Data structure for read-write lock variable handling. The
+ structure of the attribute type is not exposed on purpose. */
+typedef union
+{
+# if __WORDSIZE == 64
+ struct
+ {
+ int __lock;
+ unsigned int __nr_readers;
+ unsigned int __readers_wakeup;
+ unsigned int __writer_wakeup;
+ unsigned int __nr_readers_queued;
+ unsigned int __nr_writers_queued;
+ int __writer;
+ int __shared;
+ unsigned long int __pad1;
+ unsigned long int __pad2;
+ /* FLAGS must stay at this position in the structure to maintain
+ binary compatibility. */
+ unsigned int __flags;
+ } __data;
+# else
+ struct
+ {
+ int __lock;
+ unsigned int __nr_readers;
+ unsigned int __readers_wakeup;
+ unsigned int __writer_wakeup;
+ unsigned int __nr_readers_queued;
+ unsigned int __nr_writers_queued;
+ /* FLAGS must stay at this position in the structure to maintain
+ binary compatibility. */
+ unsigned char __flags;
+ unsigned char __shared;
+ unsigned char __pad1;
+ unsigned char __pad2;
+ int __writer;
+ } __data;
+# endif
+ char __size[__SIZEOF_PTHREAD_RWLOCK_T];
+ long int __align;
+} pthread_rwlock_t;
+
+typedef union
+{
+ char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T];
+ long int __align;
+} pthread_rwlockattr_t;
+#endif
+
+
+#ifdef __USE_XOPEN2K
+/* POSIX spinlock data type. */
+typedef volatile int pthread_spinlock_t;
+
+
+/* POSIX barriers data type. The structure of the type is
+ deliberately not exposed. */
+typedef union
+{
+ char __size[__SIZEOF_PTHREAD_BARRIER_T];
+ long int __align;
+} pthread_barrier_t;
+
+typedef union
+{
+ char __size[__SIZEOF_PTHREAD_BARRIERATTR_T];
+ int __align;
+} pthread_barrierattr_t;
+#endif
+
+
+#if __WORDSIZE == 32
+/* Extra attributes for the cleanup functions. */
+# define __cleanup_fct_attribute __attribute__ ((__regparm__ (1)))
+#endif
+
+#endif /* bits/pthreadtypes.h */
diff --git a/sysroot/usr/include/bits/resource.h b/sysroot/usr/include/bits/resource.h
new file mode 100644
index 0000000..526cdaf
--- /dev/null
+++ b/sysroot/usr/include/bits/resource.h
@@ -0,0 +1,225 @@
+/* Bit values & structures for resource limits. Linux version.
+ Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2004, 2005
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_RESOURCE_H
+# error "Never use <bits/resource.h> directly; include <sys/resource.h> instead."
+#endif
+
+#include <bits/types.h>
+
+/* Transmute defines to enumerations. The macro re-definitions are
+ necessary because some programs want to test for operating system
+ features with #ifdef RUSAGE_SELF. In ISO C the reflexive
+ definition is a no-op. */
+
+/* Kinds of resource limit. */
+enum __rlimit_resource
+{
+ /* Per-process CPU limit, in seconds. */
+ RLIMIT_CPU = 0,
+#define RLIMIT_CPU RLIMIT_CPU
+
+ /* Largest file that can be created, in bytes. */
+ RLIMIT_FSIZE = 1,
+#define RLIMIT_FSIZE RLIMIT_FSIZE
+
+ /* Maximum size of data segment, in bytes. */
+ RLIMIT_DATA = 2,
+#define RLIMIT_DATA RLIMIT_DATA
+
+ /* Maximum size of stack segment, in bytes. */
+ RLIMIT_STACK = 3,
+#define RLIMIT_STACK RLIMIT_STACK
+
+ /* Largest core file that can be created, in bytes. */
+ RLIMIT_CORE = 4,
+#define RLIMIT_CORE RLIMIT_CORE
+
+ /* Largest resident set size, in bytes.
+ This affects swapping; processes that are exceeding their
+ resident set size will be more likely to have physical memory
+ taken from them. */
+ __RLIMIT_RSS = 5,
+#define RLIMIT_RSS __RLIMIT_RSS
+
+ /* Number of open files. */
+ RLIMIT_NOFILE = 7,
+ __RLIMIT_OFILE = RLIMIT_NOFILE, /* BSD name for same. */
+#define RLIMIT_NOFILE RLIMIT_NOFILE
+#define RLIMIT_OFILE __RLIMIT_OFILE
+
+ /* Address space limit. */
+ RLIMIT_AS = 9,
+#define RLIMIT_AS RLIMIT_AS
+
+ /* Number of processes. */
+ __RLIMIT_NPROC = 6,
+#define RLIMIT_NPROC __RLIMIT_NPROC
+
+ /* Locked-in-memory address space. */
+ __RLIMIT_MEMLOCK = 8,
+#define RLIMIT_MEMLOCK __RLIMIT_MEMLOCK
+
+ /* Maximum number of file locks. */
+ __RLIMIT_LOCKS = 10,
+#define RLIMIT_LOCKS __RLIMIT_LOCKS
+
+ /* Maximum number of pending signals. */
+ __RLIMIT_SIGPENDING = 11,
+#define RLIMIT_SIGPENDING __RLIMIT_SIGPENDING
+
+ /* Maximum bytes in POSIX message queues. */
+ __RLIMIT_MSGQUEUE = 12,
+#define RLIMIT_MSGQUEUE __RLIMIT_MSGQUEUE
+
+ /* Maximum nice priority allowed to raise to.
+ Nice levels 19 .. -20 correspond to 0 .. 39
+ values of this resource limit. */
+ __RLIMIT_NICE = 13,
+#define RLIMIT_NICE __RLIMIT_NICE
+
+ /* Maximum realtime priority allowed for non-priviledged
+ processes. */
+ __RLIMIT_RTPRIO = 14,
+#define RLIMIT_RTPRIO __RLIMIT_RTPRIO
+
+ __RLIMIT_NLIMITS = 15,
+ __RLIM_NLIMITS = __RLIMIT_NLIMITS
+#define RLIMIT_NLIMITS __RLIMIT_NLIMITS
+#define RLIM_NLIMITS __RLIM_NLIMITS
+};
+
+/* Value to indicate that there is no limit. */
+#ifndef __USE_FILE_OFFSET64
+# define RLIM_INFINITY ((unsigned long int)(~0UL))
+#else
+# define RLIM_INFINITY 0xffffffffffffffffuLL
+#endif
+
+#ifdef __USE_LARGEFILE64
+# define RLIM64_INFINITY 0xffffffffffffffffuLL
+#endif
+
+/* We can represent all limits. */
+#define RLIM_SAVED_MAX RLIM_INFINITY
+#define RLIM_SAVED_CUR RLIM_INFINITY
+
+
+/* Type for resource quantity measurement. */
+#ifndef __USE_FILE_OFFSET64
+typedef __rlim_t rlim_t;
+#else
+typedef __rlim64_t rlim_t;
+#endif
+#ifdef __USE_LARGEFILE64
+typedef __rlim64_t rlim64_t;
+#endif
+
+struct rlimit
+ {
+ /* The current (soft) limit. */
+ rlim_t rlim_cur;
+ /* The hard limit. */
+ rlim_t rlim_max;
+ };
+
+#ifdef __USE_LARGEFILE64
+struct rlimit64
+ {
+ /* The current (soft) limit. */
+ rlim64_t rlim_cur;
+ /* The hard limit. */
+ rlim64_t rlim_max;
+ };
+#endif
+
+/* Whose usage statistics do you want? */
+enum __rusage_who
+{
+ /* The calling process. */
+ RUSAGE_SELF = 0,
+#define RUSAGE_SELF RUSAGE_SELF
+
+ /* All of its terminated child processes. */
+ RUSAGE_CHILDREN = -1
+#define RUSAGE_CHILDREN RUSAGE_CHILDREN
+};
+
+#define __need_timeval
+#include <bits/time.h> /* For `struct timeval'. */
+
+/* Structure which says how much of each resource has been used. */
+struct rusage
+ {
+ /* Total amount of user time used. */
+ struct timeval ru_utime;
+ /* Total amount of system time used. */
+ struct timeval ru_stime;
+ /* Maximum resident set size (in kilobytes). */
+ long int ru_maxrss;
+ /* Amount of sharing of text segment memory
+ with other processes (kilobyte-seconds). */
+ long int ru_ixrss;
+ /* Amount of data segment memory used (kilobyte-seconds). */
+ long int ru_idrss;
+ /* Amount of stack memory used (kilobyte-seconds). */
+ long int ru_isrss;
+ /* Number of soft page faults (i.e. those serviced by reclaiming
+ a page from the list of pages awaiting reallocation. */
+ long int ru_minflt;
+ /* Number of hard page faults (i.e. those that required I/O). */
+ long int ru_majflt;
+ /* Number of times a process was swapped out of physical memory. */
+ long int ru_nswap;
+ /* Number of input operations via the file system. Note: This
+ and `ru_oublock' do not include operations with the cache. */
+ long int ru_inblock;
+ /* Number of output operations via the file system. */
+ long int ru_oublock;
+ /* Number of IPC messages sent. */
+ long int ru_msgsnd;
+ /* Number of IPC messages received. */
+ long int ru_msgrcv;
+ /* Number of signals delivered. */
+ long int ru_nsignals;
+ /* Number of voluntary context switches, i.e. because the process
+ gave up the process before it had to (usually to wait for some
+ resource to be available). */
+ long int ru_nvcsw;
+ /* Number of involuntary context switches, i.e. a higher priority process
+ became runnable or the current process used up its time slice. */
+ long int ru_nivcsw;
+ };
+
+/* Priority limits. */
+#define PRIO_MIN -20 /* Minimum priority a process can have. */
+#define PRIO_MAX 20 /* Maximum priority a process can have. */
+
+/* The type of the WHICH argument to `getpriority' and `setpriority',
+ indicating what flavor of entity the WHO argument specifies. */
+enum __priority_which
+{
+ PRIO_PROCESS = 0, /* WHO is a process ID. */
+#define PRIO_PROCESS PRIO_PROCESS
+ PRIO_PGRP = 1, /* WHO is a process group ID. */
+#define PRIO_PGRP PRIO_PGRP
+ PRIO_USER = 2 /* WHO is a user ID. */
+#define PRIO_USER PRIO_USER
+};
diff --git a/sysroot/usr/include/bits/sched.h b/sysroot/usr/include/bits/sched.h
new file mode 100644
index 0000000..5387b9c
--- /dev/null
+++ b/sysroot/usr/include/bits/sched.h
@@ -0,0 +1,195 @@
+/* Definitions of constants and data structure for POSIX 1003.1b-1993
+ scheduling interface.
+ Copyright (C) 1996-1999,2001-2003,2005,2006,2007
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef __need_schedparam
+
+#ifndef _SCHED_H
+# error "Never include <bits/sched.h> directly; use <sched.h> instead."
+#endif
+
+
+/* Scheduling algorithms. */
+#define SCHED_OTHER 0
+#define SCHED_FIFO 1
+#define SCHED_RR 2
+#ifdef __USE_GNU
+# define SCHED_BATCH 3
+#endif
+
+#ifdef __USE_MISC
+/* Cloning flags. */
+# define CSIGNAL 0x000000ff /* Signal mask to be sent at exit. */
+# define CLONE_VM 0x00000100 /* Set if VM shared between processes. */
+# define CLONE_FS 0x00000200 /* Set if fs info shared between processes. */
+# define CLONE_FILES 0x00000400 /* Set if open files shared between processes. */
+# define CLONE_SIGHAND 0x00000800 /* Set if signal handlers shared. */
+# define CLONE_PTRACE 0x00002000 /* Set if tracing continues on the child. */
+# define CLONE_VFORK 0x00004000 /* Set if the parent wants the child to
+ wake it up on mm_release. */
+# define CLONE_PARENT 0x00008000 /* Set if we want to have the same
+ parent as the cloner. */
+# define CLONE_THREAD 0x00010000 /* Set to add to same thread group. */
+# define CLONE_NEWNS 0x00020000 /* Set to create new namespace. */
+# define CLONE_SYSVSEM 0x00040000 /* Set to shared SVID SEM_UNDO semantics. */
+# define CLONE_SETTLS 0x00080000 /* Set TLS info. */
+# define CLONE_PARENT_SETTID 0x00100000 /* Store TID in userlevel buffer
+ before MM copy. */
+# define CLONE_CHILD_CLEARTID 0x00200000 /* Register exit futex and memory
+ location to clear. */
+# define CLONE_DETACHED 0x00400000 /* Create clone detached. */
+# define CLONE_UNTRACED 0x00800000 /* Set if the tracing process can't
+ force CLONE_PTRACE on this clone. */
+# define CLONE_CHILD_SETTID 0x01000000 /* Store TID in userlevel buffer in
+ the child. */
+# define CLONE_STOPPED 0x02000000 /* Start in stopped state. */
+#endif
+
+/* The official definition. */
+struct sched_param
+ {
+ int __sched_priority;
+ };
+
+__BEGIN_DECLS
+
+#ifdef __USE_MISC
+/* Clone current process. */
+extern int clone (int (*__fn) (void *__arg), void *__child_stack,
+ int __flags, void *__arg, ...) __THROW;
+
+/* Unshare the specified resources. */
+extern int unshare (int __flags) __THROW;
+
+/* Get index of currently used CPU. */
+extern int sched_getcpu (void) __THROW;
+#endif
+
+__END_DECLS
+
+#endif /* need schedparam */
+
+#if !defined __defined_schedparam \
+ && (defined __need_schedparam || defined _SCHED_H)
+# define __defined_schedparam 1
+/* Data structure to describe a process' schedulability. */
+struct __sched_param
+ {
+ int __sched_priority;
+ };
+# undef __need_schedparam
+#endif
+
+
+#if defined _SCHED_H && !defined __cpu_set_t_defined
+# define __cpu_set_t_defined
+/* Size definition for CPU sets. */
+# define __CPU_SETSIZE 1024
+# define __NCPUBITS (8 * sizeof (__cpu_mask))
+
+/* Type for array elements in 'cpu_set_t'. */
+typedef unsigned long int __cpu_mask;
+
+/* Basic access functions. */
+# define __CPUELT(cpu) ((cpu) / __NCPUBITS)
+# define __CPUMASK(cpu) ((__cpu_mask) 1 << ((cpu) % __NCPUBITS))
+
+/* Data structure to describe CPU mask. */
+typedef struct
+{
+ __cpu_mask __bits[__CPU_SETSIZE / __NCPUBITS];
+} cpu_set_t;
+
+/* Access functions for CPU masks. */
+# if __GNUC_PREREQ (2, 91)
+# define __CPU_ZERO_S(setsize, cpusetp) \
+ do __builtin_memset (cpusetp, '\0', setsize); while (0)
+# else
+# define __CPU_ZERO_S(setsize, cpusetp) \
+ do { \
+ size_t __i; \
+ size_t __imax = (setsize) / sizeof (__cpu_mask); \
+ cpu_set_t *__arr = (cpusetp); \
+ for (__i = 0; __i < __imax; ++__i) \
+ __arr->__bits[__i] = 0; \
+ } while (0)
+# endif
+# define __CPU_SET_S(cpu, setsize, cpusetp) \
+ (__extension__ \
+ ({ size_t __cpu = (cpu); \
+ __cpu < 8 * (setsize) \
+ ? ((cpusetp)->__bits[__CPUELT (__cpu)] |= __CPUMASK (__cpu)) : 0; }))
+# define __CPU_CLR_S(cpu, setsize, cpusetp) \
+ (__extension__ \
+ ({ size_t __cpu = (cpu); \
+ __cpu < 8 * (setsize) \
+ ? ((cpusetp)->__bits[__CPUELT (__cpu)] &= ~__CPUMASK (__cpu)) : 0; }))
+# define __CPU_ISSET_S(cpu, setsize, cpusetp) \
+ (__extension__ \
+ ({ size_t __cpu = (cpu); \
+ __cpu < 8 * (setsize) \
+ ? (((cpusetp)->__bits[__CPUELT (__cpu)] & __CPUMASK (__cpu))) != 0 \
+ : 0; }))
+
+# define __CPU_COUNT_S(setsize, cpusetp) \
+ __sched_cpucount (setsize, cpusetp)
+
+# if __GNUC_PREREQ (2, 91)
+# define __CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \
+ (__builtin_memcmp (cpusetp1, cpusetp2, setsize) == 0)
+# else
+# define __CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \
+ (__extension__ \
+ ({ cpu_set_t *__arr1 = (cpusetp1); \
+ cpu_set_t *__arr2 = (cpusetp2); \
+ size_t __imax = (setsize) / sizeof (__cpu_mask); \
+ size_t __i; \
+ for (__i = 0; __i < __imax; ++__i) \
+ if (__arr1->__bits[__i] != __arr2->__bits[__i]) \
+ break; \
+ __i == __imax; }))
+# endif
+
+# define __CPU_OP_S(setsize, destset, srcset1, srcset2, op) \
+ (__extension__ \
+ ({ cpu_set_t *__dest = (destset); \
+ cpu_set_t *__arr1 = (srcset1); \
+ cpu_set_t *__arr2 = (srcset2); \
+ size_t __imax = (setsize) / sizeof (__cpu_mask); \
+ size_t __i; \
+ for (__i = 0; __i < __imax; ++__i) \
+ __dest->__bits[__i] = __arr1->__bits[__i] op __arr2->__bits[__i]; \
+ __dest; }))
+
+# define __CPU_ALLOC_SIZE(count) \
+ ((((count) + __NCPUBITS - 1) / __NCPUBITS) * 8)
+# define __CPU_ALLOC(count) __sched_cpualloc (count)
+# define __CPU_FREE(cpuset) __sched_cpufree (cpuset)
+
+__BEGIN_DECLS
+
+extern int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp)
+ __THROW;
+extern cpu_set_t *__sched_cpualloc (size_t __count) __THROW __wur;
+extern void __sched_cpufree (cpu_set_t *__set) __THROW;
+
+__END_DECLS
+
+#endif
diff --git a/sysroot/usr/include/bits/select.h b/sysroot/usr/include/bits/select.h
new file mode 100644
index 0000000..47e7ded
--- /dev/null
+++ b/sysroot/usr/include/bits/select.h
@@ -0,0 +1,35 @@
+/* Copyright (C) 1997, 1998, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SELECT_H
+# error "Never use <bits/select.h> directly; include <sys/select.h> instead."
+#endif
+
+
+/* We don't use `memset' because this would require a prototype and
+ the array isn't too big. */
+#define __FD_ZERO(s) \
+ do { \
+ unsigned int __i; \
+ fd_set *__arr = (s); \
+ for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) \
+ __FDS_BITS (__arr)[__i] = 0; \
+ } while (0)
+#define __FD_SET(d, s) (__FDS_BITS (s)[__FDELT(d)] |= __FDMASK(d))
+#define __FD_CLR(d, s) (__FDS_BITS (s)[__FDELT(d)] &= ~__FDMASK(d))
+#define __FD_ISSET(d, s) ((__FDS_BITS (s)[__FDELT(d)] & __FDMASK(d)) != 0)
diff --git a/sysroot/usr/include/bits/sem.h b/sysroot/usr/include/bits/sem.h
new file mode 100644
index 0000000..9b1d993
--- /dev/null
+++ b/sysroot/usr/include/bits/sem.h
@@ -0,0 +1,87 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SEM_H
+# error "Never include <bits/sem.h> directly; use <sys/sem.h> instead."
+#endif
+
+#include <sys/types.h>
+
+/* Flags for `semop'. */
+#define SEM_UNDO 0x1000 /* undo the operation on exit */
+
+/* Commands for `semctl'. */
+#define GETPID 11 /* get sempid */
+#define GETVAL 12 /* get semval */
+#define GETALL 13 /* get all semval's */
+#define GETNCNT 14 /* get semncnt */
+#define GETZCNT 15 /* get semzcnt */
+#define SETVAL 16 /* set semval */
+#define SETALL 17 /* set all semval's */
+
+
+/* Data structure describing a set of semaphores. */
+struct semid_ds
+{
+ struct ipc_perm sem_perm; /* operation permission struct */
+ __time_t sem_otime; /* last semop() time */
+ unsigned long int __unused1;
+ __time_t sem_ctime; /* last time changed by semctl() */
+ unsigned long int __unused2;
+ unsigned long int sem_nsems; /* number of semaphores in set */
+ unsigned long int __unused3;
+ unsigned long int __unused4;
+};
+
+/* The user should define a union like the following to use it for arguments
+ for `semctl'.
+
+ union semun
+ {
+ int val; <= value for SETVAL
+ struct semid_ds *buf; <= buffer for IPC_STAT & IPC_SET
+ unsigned short int *array; <= array for GETALL & SETALL
+ struct seminfo *__buf; <= buffer for IPC_INFO
+ };
+
+ Previous versions of this file used to define this union but this is
+ incorrect. One can test the macro _SEM_SEMUN_UNDEFINED to see whether
+ one must define the union or not. */
+#define _SEM_SEMUN_UNDEFINED 1
+
+#ifdef __USE_MISC
+
+/* ipcs ctl cmds */
+# define SEM_STAT 18
+# define SEM_INFO 19
+
+struct seminfo
+{
+ int semmap;
+ int semmni;
+ int semmns;
+ int semmnu;
+ int semmsl;
+ int semopm;
+ int semume;
+ int semusz;
+ int semvmx;
+ int semaem;
+};
+
+#endif /* __USE_MISC */
diff --git a/sysroot/usr/include/bits/semaphore.h b/sysroot/usr/include/bits/semaphore.h
new file mode 100644
index 0000000..e973bc5
--- /dev/null
+++ b/sysroot/usr/include/bits/semaphore.h
@@ -0,0 +1,41 @@
+/* Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SEMAPHORE_H
+# error "Never use <bits/semaphore.h> directly; include <semaphore.h> instead."
+#endif
+
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 64
+# define __SIZEOF_SEM_T 32
+#else
+# define __SIZEOF_SEM_T 16
+#endif
+
+
+/* Value returned if `sem_open' failed. */
+#define SEM_FAILED ((sem_t *) 0)
+
+
+typedef union
+{
+ char __size[__SIZEOF_SEM_T];
+ long int __align;
+} sem_t;
diff --git a/sysroot/usr/include/bits/setjmp.h b/sysroot/usr/include/bits/setjmp.h
new file mode 100644
index 0000000..c9b98b2
--- /dev/null
+++ b/sysroot/usr/include/bits/setjmp.h
@@ -0,0 +1,39 @@
+/* Copyright (C) 2001,2002,2003,2005,2006 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Define the machine-dependent type `jmp_buf'. x86-64 version. */
+#ifndef _BITS_SETJMP_H
+#define _BITS_SETJMP_H 1
+
+#if !defined _SETJMP_H && !defined _PTHREAD_H
+# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
+#endif
+
+#include <bits/wordsize.h>
+
+#ifndef _ASM
+
+# if __WORDSIZE == 64
+typedef long int __jmp_buf[8];
+# else
+typedef int __jmp_buf[6];
+# endif
+
+#endif
+
+#endif /* bits/setjmp.h */
diff --git a/sysroot/usr/include/bits/shm.h b/sysroot/usr/include/bits/shm.h
new file mode 100644
index 0000000..3d8c05d
--- /dev/null
+++ b/sysroot/usr/include/bits/shm.h
@@ -0,0 +1,110 @@
+/* Copyright (C) 1995, 1996, 1997, 2000, 2002, 2004
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SHM_H
+# error "Never include <bits/shm.h> directly; use <sys/shm.h> instead."
+#endif
+
+#include <bits/types.h>
+
+/* Permission flag for shmget. */
+#define SHM_R 0400 /* or S_IRUGO from <linux/stat.h> */
+#define SHM_W 0200 /* or S_IWUGO from <linux/stat.h> */
+
+/* Flags for `shmat'. */
+#define SHM_RDONLY 010000 /* attach read-only else read-write */
+#define SHM_RND 020000 /* round attach address to SHMLBA */
+#define SHM_REMAP 040000 /* take-over region on attach */
+
+/* Commands for `shmctl'. */
+#define SHM_LOCK 11 /* lock segment (root only) */
+#define SHM_UNLOCK 12 /* unlock segment (root only) */
+
+__BEGIN_DECLS
+
+/* Segment low boundary address multiple. */
+#define SHMLBA (__getpagesize ())
+extern int __getpagesize (void) __THROW __attribute__ ((__const__));
+
+
+/* Type to count number of attaches. */
+typedef unsigned long int shmatt_t;
+
+/* Data structure describing a set of semaphores. */
+struct shmid_ds
+ {
+ struct ipc_perm shm_perm; /* operation permission struct */
+ size_t shm_segsz; /* size of segment in bytes */
+ __time_t shm_atime; /* time of last shmat() */
+#if __WORDSIZE == 32
+ unsigned long int __unused1;
+#endif
+ __time_t shm_dtime; /* time of last shmdt() */
+#if __WORDSIZE == 32
+ unsigned long int __unused2;
+#endif
+ __time_t shm_ctime; /* time of last change by shmctl() */
+#if __WORDSIZE == 32
+ unsigned long int __unused3;
+#endif
+ __pid_t shm_cpid; /* pid of creator */
+ __pid_t shm_lpid; /* pid of last shmop */
+ shmatt_t shm_nattch; /* number of current attaches */
+ unsigned long int __unused4;
+ unsigned long int __unused5;
+ };
+
+#ifdef __USE_MISC
+
+/* ipcs ctl commands */
+# define SHM_STAT 13
+# define SHM_INFO 14
+
+/* shm_mode upper byte flags */
+# define SHM_DEST 01000 /* segment will be destroyed on last detach */
+# define SHM_LOCKED 02000 /* segment will not be swapped */
+# define SHM_HUGETLB 04000 /* segment is mapped via hugetlb */
+# define SHM_NORESERVE 010000 /* don't check for reservations */
+
+struct shminfo
+ {
+ unsigned long int shmmax;
+ unsigned long int shmmin;
+ unsigned long int shmmni;
+ unsigned long int shmseg;
+ unsigned long int shmall;
+ unsigned long int __unused1;
+ unsigned long int __unused2;
+ unsigned long int __unused3;
+ unsigned long int __unused4;
+ };
+
+struct shm_info
+ {
+ int used_ids;
+ unsigned long int shm_tot; /* total allocated shm */
+ unsigned long int shm_rss; /* total resident shm */
+ unsigned long int shm_swp; /* total swapped shm */
+ unsigned long int swap_attempts;
+ unsigned long int swap_successes;
+ };
+
+#endif /* __USE_MISC */
+
+__END_DECLS
diff --git a/sysroot/usr/include/bits/sigaction.h b/sysroot/usr/include/bits/sigaction.h
new file mode 100644
index 0000000..48cc531
--- /dev/null
+++ b/sysroot/usr/include/bits/sigaction.h
@@ -0,0 +1,77 @@
+/* The proper definitions for Linux's sigaction.
+ Copyright (C) 1993-1999, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SIGNAL_H
+# error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
+#endif
+
+/* Structure describing the action to be taken when a signal arrives. */
+struct sigaction
+ {
+ /* Signal handler. */
+#ifdef __USE_POSIX199309
+ union
+ {
+ /* Used if SA_SIGINFO is not set. */
+ __sighandler_t sa_handler;
+ /* Used if SA_SIGINFO is set. */
+ void (*sa_sigaction) (int, siginfo_t *, void *);
+ }
+ __sigaction_handler;
+# define sa_handler __sigaction_handler.sa_handler
+# define sa_sigaction __sigaction_handler.sa_sigaction
+#else
+ __sighandler_t sa_handler;
+#endif
+
+ /* Additional set of signals to be blocked. */
+ __sigset_t sa_mask;
+
+ /* Special flags. */
+ int sa_flags;
+
+ /* Restore handler. */
+ void (*sa_restorer) (void);
+ };
+
+/* Bits in `sa_flags'. */
+#define SA_NOCLDSTOP 1 /* Don't send SIGCHLD when children stop. */
+#define SA_NOCLDWAIT 2 /* Don't create zombie on child death. */
+#define SA_SIGINFO 4 /* Invoke signal-catching function with
+ three arguments instead of one. */
+#if defined __USE_UNIX98 || defined __USE_MISC
+# define SA_ONSTACK 0x08000000 /* Use signal stack by using `sa_restorer'. */
+# define SA_RESTART 0x10000000 /* Restart syscall on signal return. */
+# define SA_NODEFER 0x40000000 /* Don't automatically block the signal when
+ its handler is being executed. */
+# define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler. */
+#endif
+#ifdef __USE_MISC
+# define SA_INTERRUPT 0x20000000 /* Historical no-op. */
+
+/* Some aliases for the SA_ constants. */
+# define SA_NOMASK SA_NODEFER
+# define SA_ONESHOT SA_RESETHAND
+# define SA_STACK SA_ONSTACK
+#endif
+
+/* Values for the HOW argument to `sigprocmask'. */
+#define SIG_BLOCK 0 /* Block signals. */
+#define SIG_UNBLOCK 1 /* Unblock signals. */
+#define SIG_SETMASK 2 /* Set the set of blocked signals. */
diff --git a/sysroot/usr/include/bits/sigcontext.h b/sysroot/usr/include/bits/sigcontext.h
new file mode 100644
index 0000000..c0d5fe7
--- /dev/null
+++ b/sysroot/usr/include/bits/sigcontext.h
@@ -0,0 +1,159 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _BITS_SIGCONTEXT_H
+#define _BITS_SIGCONTEXT_H 1
+
+#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
+# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
+#endif
+
+#include <bits/wordsize.h>
+
+struct _fpreg
+{
+ unsigned short significand[4];
+ unsigned short exponent;
+};
+
+struct _fpxreg
+{
+ unsigned short significand[4];
+ unsigned short exponent;
+ unsigned short padding[3];
+};
+
+struct _xmmreg
+{
+ __uint32_t element[4];
+};
+
+
+
+#if __WORDSIZE == 32
+
+struct _fpstate
+{
+ /* Regular FPU environment. */
+ __uint32_t cw;
+ __uint32_t sw;
+ __uint32_t tag;
+ __uint32_t ipoff;
+ __uint32_t cssel;
+ __uint32_t dataoff;
+ __uint32_t datasel;
+ struct _fpreg _st[8];
+ unsigned short status;
+ unsigned short magic;
+
+ /* FXSR FPU environment. */
+ __uint32_t _fxsr_env[6];
+ __uint32_t mxcsr;
+ __uint32_t reserved;
+ struct _fpxreg _fxsr_st[8];
+ struct _xmmreg _xmm[8];
+ __uint32_t padding[56];
+};
+
+#ifndef sigcontext_struct
+/* Kernel headers before 2.1.1 define a struct sigcontext_struct, but
+ we need sigcontext. Some packages have come to rely on
+ sigcontext_struct being defined on 32-bit x86, so define this for
+ their benefit. */
+# define sigcontext_struct sigcontext
+#endif
+
+struct sigcontext
+{
+ unsigned short gs, __gsh;
+ unsigned short fs, __fsh;
+ unsigned short es, __esh;
+ unsigned short ds, __dsh;
+ unsigned long edi;
+ unsigned long esi;
+ unsigned long ebp;
+ unsigned long esp;
+ unsigned long ebx;
+ unsigned long edx;
+ unsigned long ecx;
+ unsigned long eax;
+ unsigned long trapno;
+ unsigned long err;
+ unsigned long eip;
+ unsigned short cs, __csh;
+ unsigned long eflags;
+ unsigned long esp_at_signal;
+ unsigned short ss, __ssh;
+ struct _fpstate * fpstate;
+ unsigned long oldmask;
+ unsigned long cr2;
+};
+
+#else /* __WORDSIZE == 64 */
+
+struct _fpstate
+{
+ /* FPU environment matching the 64-bit FXSAVE layout. */
+ __uint16_t cwd;
+ __uint16_t swd;
+ __uint16_t ftw;
+ __uint16_t fop;
+ __uint64_t rip;
+ __uint64_t rdp;
+ __uint32_t mxcsr;
+ __uint32_t mxcr_mask;
+ struct _fpxreg _st[8];
+ struct _xmmreg _xmm[16];
+ __uint32_t padding[24];
+};
+
+struct sigcontext
+{
+ unsigned long r8;
+ unsigned long r9;
+ unsigned long r10;
+ unsigned long r11;
+ unsigned long r12;
+ unsigned long r13;
+ unsigned long r14;
+ unsigned long r15;
+ unsigned long rdi;
+ unsigned long rsi;
+ unsigned long rbp;
+ unsigned long rbx;
+ unsigned long rdx;
+ unsigned long rax;
+ unsigned long rcx;
+ unsigned long rsp;
+ unsigned long rip;
+ unsigned long eflags;
+ unsigned short cs;
+ unsigned short gs;
+ unsigned short fs;
+ unsigned short __pad0;
+ unsigned long err;
+ unsigned long trapno;
+ unsigned long oldmask;
+ unsigned long cr2;
+ struct _fpstate * fpstate;
+ unsigned long __reserved1 [8];
+};
+
+#endif /* __WORDSIZE == 64 */
+
+#endif /* _BITS_SIGCONTEXT_H */
diff --git a/sysroot/usr/include/bits/siginfo.h b/sysroot/usr/include/bits/siginfo.h
new file mode 100644
index 0000000..4ce319d
--- /dev/null
+++ b/sysroot/usr/include/bits/siginfo.h
@@ -0,0 +1,313 @@
+/* siginfo_t, sigevent and constants. Linux version.
+ Copyright (C) 1997-2002, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#if !defined _SIGNAL_H && !defined __need_siginfo_t \
+ && !defined __need_sigevent_t
+# error "Never include this file directly. Use <signal.h> instead"
+#endif
+
+#include <bits/wordsize.h>
+
+#if (!defined __have_sigval_t \
+ && (defined _SIGNAL_H || defined __need_siginfo_t \
+ || defined __need_sigevent_t))
+# define __have_sigval_t 1
+
+/* Type for data associated with a signal. */
+typedef union sigval
+ {
+ int sival_int;
+ void *sival_ptr;
+ } sigval_t;
+#endif
+
+#if (!defined __have_siginfo_t \
+ && (defined _SIGNAL_H || defined __need_siginfo_t))
+# define __have_siginfo_t 1
+
+# define __SI_MAX_SIZE 128
+# if __WORDSIZE == 64
+# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 4)
+# else
+# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 3)
+# endif
+
+typedef struct siginfo
+ {
+ int si_signo; /* Signal number. */
+ int si_errno; /* If non-zero, an errno value associated with
+ this signal, as defined in <errno.h>. */
+ int si_code; /* Signal code. */
+
+ union
+ {
+ int _pad[__SI_PAD_SIZE];
+
+ /* kill(). */
+ struct
+ {
+ __pid_t si_pid; /* Sending process ID. */
+ __uid_t si_uid; /* Real user ID of sending process. */
+ } _kill;
+
+ /* POSIX.1b timers. */
+ struct
+ {
+ int si_tid; /* Timer ID. */
+ int si_overrun; /* Overrun count. */
+ sigval_t si_sigval; /* Signal value. */
+ } _timer;
+
+ /* POSIX.1b signals. */
+ struct
+ {
+ __pid_t si_pid; /* Sending process ID. */
+ __uid_t si_uid; /* Real user ID of sending process. */
+ sigval_t si_sigval; /* Signal value. */
+ } _rt;
+
+ /* SIGCHLD. */
+ struct
+ {
+ __pid_t si_pid; /* Which child. */
+ __uid_t si_uid; /* Real user ID of sending process. */
+ int si_status; /* Exit value or signal. */
+ __clock_t si_utime;
+ __clock_t si_stime;
+ } _sigchld;
+
+ /* SIGILL, SIGFPE, SIGSEGV, SIGBUS. */
+ struct
+ {
+ void *si_addr; /* Faulting insn/memory ref. */
+ } _sigfault;
+
+ /* SIGPOLL. */
+ struct
+ {
+ long int si_band; /* Band event for SIGPOLL. */
+ int si_fd;
+ } _sigpoll;
+ } _sifields;
+ } siginfo_t;
+
+
+/* X/Open requires some more fields with fixed names. */
+# define si_pid _sifields._kill.si_pid
+# define si_uid _sifields._kill.si_uid
+# define si_timerid _sifields._timer.si_tid
+# define si_overrun _sifields._timer.si_overrun
+# define si_status _sifields._sigchld.si_status
+# define si_utime _sifields._sigchld.si_utime
+# define si_stime _sifields._sigchld.si_stime
+# define si_value _sifields._rt.si_sigval
+# define si_int _sifields._rt.si_sigval.sival_int
+# define si_ptr _sifields._rt.si_sigval.sival_ptr
+# define si_addr _sifields._sigfault.si_addr
+# define si_band _sifields._sigpoll.si_band
+# define si_fd _sifields._sigpoll.si_fd
+
+
+/* Values for `si_code'. Positive values are reserved for kernel-generated
+ signals. */
+enum
+{
+ SI_ASYNCNL = -60, /* Sent by asynch name lookup completion. */
+# define SI_ASYNCNL SI_ASYNCNL
+ SI_TKILL = -6, /* Sent by tkill. */
+# define SI_TKILL SI_TKILL
+ SI_SIGIO, /* Sent by queued SIGIO. */
+# define SI_SIGIO SI_SIGIO
+ SI_ASYNCIO, /* Sent by AIO completion. */
+# define SI_ASYNCIO SI_ASYNCIO
+ SI_MESGQ, /* Sent by real time mesq state change. */
+# define SI_MESGQ SI_MESGQ
+ SI_TIMER, /* Sent by timer expiration. */
+# define SI_TIMER SI_TIMER
+ SI_QUEUE, /* Sent by sigqueue. */
+# define SI_QUEUE SI_QUEUE
+ SI_USER, /* Sent by kill, sigsend, raise. */
+# define SI_USER SI_USER
+ SI_KERNEL = 0x80 /* Send by kernel. */
+#define SI_KERNEL SI_KERNEL
+};
+
+
+/* `si_code' values for SIGILL signal. */
+enum
+{
+ ILL_ILLOPC = 1, /* Illegal opcode. */
+# define ILL_ILLOPC ILL_ILLOPC
+ ILL_ILLOPN, /* Illegal operand. */
+# define ILL_ILLOPN ILL_ILLOPN
+ ILL_ILLADR, /* Illegal addressing mode. */
+# define ILL_ILLADR ILL_ILLADR
+ ILL_ILLTRP, /* Illegal trap. */
+# define ILL_ILLTRP ILL_ILLTRP
+ ILL_PRVOPC, /* Privileged opcode. */
+# define ILL_PRVOPC ILL_PRVOPC
+ ILL_PRVREG, /* Privileged register. */
+# define ILL_PRVREG ILL_PRVREG
+ ILL_COPROC, /* Coprocessor error. */
+# define ILL_COPROC ILL_COPROC
+ ILL_BADSTK /* Internal stack error. */
+# define ILL_BADSTK ILL_BADSTK
+};
+
+/* `si_code' values for SIGFPE signal. */
+enum
+{
+ FPE_INTDIV = 1, /* Integer divide by zero. */
+# define FPE_INTDIV FPE_INTDIV
+ FPE_INTOVF, /* Integer overflow. */
+# define FPE_INTOVF FPE_INTOVF
+ FPE_FLTDIV, /* Floating point divide by zero. */
+# define FPE_FLTDIV FPE_FLTDIV
+ FPE_FLTOVF, /* Floating point overflow. */
+# define FPE_FLTOVF FPE_FLTOVF
+ FPE_FLTUND, /* Floating point underflow. */
+# define FPE_FLTUND FPE_FLTUND
+ FPE_FLTRES, /* Floating point inexact result. */
+# define FPE_FLTRES FPE_FLTRES
+ FPE_FLTINV, /* Floating point invalid operation. */
+# define FPE_FLTINV FPE_FLTINV
+ FPE_FLTSUB /* Subscript out of range. */
+# define FPE_FLTSUB FPE_FLTSUB
+};
+
+/* `si_code' values for SIGSEGV signal. */
+enum
+{
+ SEGV_MAPERR = 1, /* Address not mapped to object. */
+# define SEGV_MAPERR SEGV_MAPERR
+ SEGV_ACCERR /* Invalid permissions for mapped object. */
+# define SEGV_ACCERR SEGV_ACCERR
+};
+
+/* `si_code' values for SIGBUS signal. */
+enum
+{
+ BUS_ADRALN = 1, /* Invalid address alignment. */
+# define BUS_ADRALN BUS_ADRALN
+ BUS_ADRERR, /* Non-existant physical address. */
+# define BUS_ADRERR BUS_ADRERR
+ BUS_OBJERR /* Object specific hardware error. */
+# define BUS_OBJERR BUS_OBJERR
+};
+
+/* `si_code' values for SIGTRAP signal. */
+enum
+{
+ TRAP_BRKPT = 1, /* Process breakpoint. */
+# define TRAP_BRKPT TRAP_BRKPT
+ TRAP_TRACE /* Process trace trap. */
+# define TRAP_TRACE TRAP_TRACE
+};
+
+/* `si_code' values for SIGCHLD signal. */
+enum
+{
+ CLD_EXITED = 1, /* Child has exited. */
+# define CLD_EXITED CLD_EXITED
+ CLD_KILLED, /* Child was killed. */
+# define CLD_KILLED CLD_KILLED
+ CLD_DUMPED, /* Child terminated abnormally. */
+# define CLD_DUMPED CLD_DUMPED
+ CLD_TRAPPED, /* Traced child has trapped. */
+# define CLD_TRAPPED CLD_TRAPPED
+ CLD_STOPPED, /* Child has stopped. */
+# define CLD_STOPPED CLD_STOPPED
+ CLD_CONTINUED /* Stopped child has continued. */
+# define CLD_CONTINUED CLD_CONTINUED
+};
+
+/* `si_code' values for SIGPOLL signal. */
+enum
+{
+ POLL_IN = 1, /* Data input available. */
+# define POLL_IN POLL_IN
+ POLL_OUT, /* Output buffers available. */
+# define POLL_OUT POLL_OUT
+ POLL_MSG, /* Input message available. */
+# define POLL_MSG POLL_MSG
+ POLL_ERR, /* I/O error. */
+# define POLL_ERR POLL_ERR
+ POLL_PRI, /* High priority input available. */
+# define POLL_PRI POLL_PRI
+ POLL_HUP /* Device disconnected. */
+# define POLL_HUP POLL_HUP
+};
+
+# undef __need_siginfo_t
+#endif /* !have siginfo_t && (have _SIGNAL_H || need siginfo_t). */
+
+
+#if (defined _SIGNAL_H || defined __need_sigevent_t) \
+ && !defined __have_sigevent_t
+# define __have_sigevent_t 1
+
+/* Structure to transport application-defined values with signals. */
+# define __SIGEV_MAX_SIZE 64
+# if __WORDSIZE == 64
+# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 4)
+# else
+# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 3)
+# endif
+
+typedef struct sigevent
+ {
+ sigval_t sigev_value;
+ int sigev_signo;
+ int sigev_notify;
+
+ union
+ {
+ int _pad[__SIGEV_PAD_SIZE];
+
+ /* When SIGEV_SIGNAL and SIGEV_THREAD_ID set, LWP ID of the
+ thread to receive the signal. */
+ __pid_t _tid;
+
+ struct
+ {
+ void (*_function) (sigval_t); /* Function to start. */
+ void *_attribute; /* Really pthread_attr_t. */
+ } _sigev_thread;
+ } _sigev_un;
+ } sigevent_t;
+
+/* POSIX names to access some of the members. */
+# define sigev_notify_function _sigev_un._sigev_thread._function
+# define sigev_notify_attributes _sigev_un._sigev_thread._attribute
+
+/* `sigev_notify' values. */
+enum
+{
+ SIGEV_SIGNAL = 0, /* Notify via signal. */
+# define SIGEV_SIGNAL SIGEV_SIGNAL
+ SIGEV_NONE, /* Other notification: meaningless. */
+# define SIGEV_NONE SIGEV_NONE
+ SIGEV_THREAD, /* Deliver via thread creation. */
+# define SIGEV_THREAD SIGEV_THREAD
+
+ SIGEV_THREAD_ID = 4 /* Send signal to specific thread. */
+#define SIGEV_THREAD_ID SIGEV_THREAD_ID
+};
+
+#endif /* have _SIGNAL_H. */
diff --git a/sysroot/usr/include/bits/signum.h b/sysroot/usr/include/bits/signum.h
new file mode 100644
index 0000000..a18ac11
--- /dev/null
+++ b/sysroot/usr/include/bits/signum.h
@@ -0,0 +1,80 @@
+/* Signal number definitions. Linux version.
+ Copyright (C) 1995,1996,1997,1998,1999,2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifdef _SIGNAL_H
+
+/* Fake signal functions. */
+#define SIG_ERR ((__sighandler_t) -1) /* Error return. */
+#define SIG_DFL ((__sighandler_t) 0) /* Default action. */
+#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */
+
+#ifdef __USE_UNIX98
+# define SIG_HOLD ((__sighandler_t) 2) /* Add signal to hold mask. */
+#endif
+
+
+/* Signals. */
+#define SIGHUP 1 /* Hangup (POSIX). */
+#define SIGINT 2 /* Interrupt (ANSI). */
+#define SIGQUIT 3 /* Quit (POSIX). */
+#define SIGILL 4 /* Illegal instruction (ANSI). */
+#define SIGTRAP 5 /* Trace trap (POSIX). */
+#define SIGABRT 6 /* Abort (ANSI). */
+#define SIGIOT 6 /* IOT trap (4.2 BSD). */
+#define SIGBUS 7 /* BUS error (4.2 BSD). */
+#define SIGFPE 8 /* Floating-point exception (ANSI). */
+#define SIGKILL 9 /* Kill, unblockable (POSIX). */
+#define SIGUSR1 10 /* User-defined signal 1 (POSIX). */
+#define SIGSEGV 11 /* Segmentation violation (ANSI). */
+#define SIGUSR2 12 /* User-defined signal 2 (POSIX). */
+#define SIGPIPE 13 /* Broken pipe (POSIX). */
+#define SIGALRM 14 /* Alarm clock (POSIX). */
+#define SIGTERM 15 /* Termination (ANSI). */
+#define SIGSTKFLT 16 /* Stack fault. */
+#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */
+#define SIGCHLD 17 /* Child status has changed (POSIX). */
+#define SIGCONT 18 /* Continue (POSIX). */
+#define SIGSTOP 19 /* Stop, unblockable (POSIX). */
+#define SIGTSTP 20 /* Keyboard stop (POSIX). */
+#define SIGTTIN 21 /* Background read from tty (POSIX). */
+#define SIGTTOU 22 /* Background write to tty (POSIX). */
+#define SIGURG 23 /* Urgent condition on socket (4.2 BSD). */
+#define SIGXCPU 24 /* CPU limit exceeded (4.2 BSD). */
+#define SIGXFSZ 25 /* File size limit exceeded (4.2 BSD). */
+#define SIGVTALRM 26 /* Virtual alarm clock (4.2 BSD). */
+#define SIGPROF 27 /* Profiling alarm clock (4.2 BSD). */
+#define SIGWINCH 28 /* Window size change (4.3 BSD, Sun). */
+#define SIGPOLL SIGIO /* Pollable event occurred (System V). */
+#define SIGIO 29 /* I/O now possible (4.2 BSD). */
+#define SIGPWR 30 /* Power failure restart (System V). */
+#define SIGSYS 31 /* Bad system call. */
+#define SIGUNUSED 31
+
+#define _NSIG 65 /* Biggest signal number + 1
+ (including real-time signals). */
+
+#define SIGRTMIN (__libc_current_sigrtmin ())
+#define SIGRTMAX (__libc_current_sigrtmax ())
+
+/* These are the hard limits of the kernel. These values should not be
+ used directly at user level. */
+#define __SIGRTMIN 32
+#define __SIGRTMAX (_NSIG - 1)
+
+#endif /* <signal.h> included. */
diff --git a/sysroot/usr/include/bits/sigset.h b/sysroot/usr/include/bits/sigset.h
new file mode 100644
index 0000000..daec8ac
--- /dev/null
+++ b/sysroot/usr/include/bits/sigset.h
@@ -0,0 +1,126 @@
+/* __sig_atomic_t, __sigset_t, and related definitions. Linux version.
+ Copyright (C) 1991, 1992, 1994, 1996, 1997, 2007
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SIGSET_H_types
+# define _SIGSET_H_types 1
+
+typedef int __sig_atomic_t;
+
+/* A `sigset_t' has a bit for each signal. */
+
+# define _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int)))
+typedef struct
+ {
+ unsigned long int __val[_SIGSET_NWORDS];
+ } __sigset_t;
+
+#endif
+
+
+/* We only want to define these functions if <signal.h> was actually
+ included; otherwise we were included just to define the types. Since we
+ are namespace-clean, it wouldn't hurt to define extra macros. But
+ trouble can be caused by functions being defined (e.g., any global
+ register vars declared later will cause compilation errors). */
+
+#if !defined _SIGSET_H_fns && defined _SIGNAL_H
+# define _SIGSET_H_fns 1
+
+# ifndef _EXTERN_INLINE
+# define _EXTERN_INLINE __extern_inline
+# endif
+
+/* Return a mask that includes the bit for SIG only. */
+# define __sigmask(sig) \
+ (((unsigned long int) 1) << (((sig) - 1) % (8 * sizeof (unsigned long int))))
+
+/* Return the word index for SIG. */
+# define __sigword(sig) (((sig) - 1) / (8 * sizeof (unsigned long int)))
+
+# if defined __GNUC__ && __GNUC__ >= 2
+# define __sigemptyset(set) \
+ (__extension__ ({ int __cnt = _SIGSET_NWORDS; \
+ sigset_t *__set = (set); \
+ while (--__cnt >= 0) __set->__val[__cnt] = 0; \
+ 0; }))
+# define __sigfillset(set) \
+ (__extension__ ({ int __cnt = _SIGSET_NWORDS; \
+ sigset_t *__set = (set); \
+ while (--__cnt >= 0) __set->__val[__cnt] = ~0UL; \
+ 0; }))
+
+# ifdef __USE_GNU
+/* The POSIX does not specify for handling the whole signal set in one
+ command. This is often wanted and so we define three more functions
+ here. */
+# define __sigisemptyset(set) \
+ (__extension__ ({ int __cnt = _SIGSET_NWORDS; \
+ const sigset_t *__set = (set); \
+ int __ret = __set->__val[--__cnt]; \
+ while (!__ret && --__cnt >= 0) \
+ __ret = __set->__val[__cnt]; \
+ __ret == 0; }))
+# define __sigandset(dest, left, right) \
+ (__extension__ ({ int __cnt = _SIGSET_NWORDS; \
+ sigset_t *__dest = (dest); \
+ const sigset_t *__left = (left); \
+ const sigset_t *__right = (right); \
+ while (--__cnt >= 0) \
+ __dest->__val[__cnt] = (__left->__val[__cnt] \
+ & __right->__val[__cnt]); \
+ 0; }))
+# define __sigorset(dest, left, right) \
+ (__extension__ ({ int __cnt = _SIGSET_NWORDS; \
+ sigset_t *__dest = (dest); \
+ const sigset_t *__left = (left); \
+ const sigset_t *__right = (right); \
+ while (--__cnt >= 0) \
+ __dest->__val[__cnt] = (__left->__val[__cnt] \
+ | __right->__val[__cnt]); \
+ 0; }))
+# endif
+# endif
+
+/* These functions needn't check for a bogus signal number -- error
+ checking is done in the non __ versions. */
+
+extern int __sigismember (__const __sigset_t *, int);
+extern int __sigaddset (__sigset_t *, int);
+extern int __sigdelset (__sigset_t *, int);
+
+# ifdef __USE_EXTERN_INLINES
+# define __SIGSETFN(NAME, BODY, CONST) \
+ _EXTERN_INLINE int \
+ NAME (CONST __sigset_t *__set, int __sig) \
+ { \
+ unsigned long int __mask = __sigmask (__sig); \
+ unsigned long int __word = __sigword (__sig); \
+ return BODY; \
+ }
+
+__SIGSETFN (__sigismember, (__set->__val[__word] & __mask) ? 1 : 0, __const)
+__SIGSETFN (__sigaddset, ((__set->__val[__word] |= __mask), 0), )
+__SIGSETFN (__sigdelset, ((__set->__val[__word] &= ~__mask), 0), )
+
+# undef __SIGSETFN
+# endif
+
+
+#endif /* ! _SIGSET_H_fns. */
diff --git a/sysroot/usr/include/bits/sigstack.h b/sysroot/usr/include/bits/sigstack.h
new file mode 100644
index 0000000..7f26036
--- /dev/null
+++ b/sysroot/usr/include/bits/sigstack.h
@@ -0,0 +1,55 @@
+/* sigstack, sigaltstack definitions.
+ Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SIGNAL_H
+# error "Never include this file directly. Use <signal.h> instead"
+#endif
+
+
+/* Structure describing a signal stack (obsolete). */
+struct sigstack
+ {
+ void *ss_sp; /* Signal stack pointer. */
+ int ss_onstack; /* Nonzero if executing on this stack. */
+ };
+
+
+/* Possible values for `ss_flags.'. */
+enum
+{
+ SS_ONSTACK = 1,
+#define SS_ONSTACK SS_ONSTACK
+ SS_DISABLE
+#define SS_DISABLE SS_DISABLE
+};
+
+/* Minimum stack size for a signal handler. */
+#define MINSIGSTKSZ 2048
+
+/* System default stack size. */
+#define SIGSTKSZ 8192
+
+
+/* Alternate, preferred interface. */
+typedef struct sigaltstack
+ {
+ void *ss_sp;
+ int ss_flags;
+ size_t ss_size;
+ } stack_t;
diff --git a/sysroot/usr/include/bits/sigthread.h b/sysroot/usr/include/bits/sigthread.h
new file mode 100644
index 0000000..960bde1
--- /dev/null
+++ b/sysroot/usr/include/bits/sigthread.h
@@ -0,0 +1,38 @@
+/* Signal handling function for threaded programs.
+ Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef _BITS_SIGTHREAD_H
+#define _BITS_SIGTHREAD_H 1
+
+#if !defined _SIGNAL_H && !defined _PTHREAD_H
+# error "Never include this file directly. Use <pthread.h> instead"
+#endif
+
+/* Functions for handling signals. */
+
+/* Modify the signal mask for the calling thread. The arguments have
+ the same meaning as for sigprocmask(2). */
+extern int pthread_sigmask (int __how,
+ __const __sigset_t *__restrict __newmask,
+ __sigset_t *__restrict __oldmask)__THROW;
+
+/* Send signal SIGNO to the given thread. */
+extern int pthread_kill (pthread_t __threadid, int __signo) __THROW;
+
+#endif /* bits/sigthread.h */
diff --git a/sysroot/usr/include/bits/sockaddr.h b/sysroot/usr/include/bits/sockaddr.h
new file mode 100644
index 0000000..3e1d131
--- /dev/null
+++ b/sysroot/usr/include/bits/sockaddr.h
@@ -0,0 +1,40 @@
+/* Definition of `struct sockaddr_*' common members. Generic/4.2 BSD version.
+ Copyright (C) 1995,1996,1997,1998,2000,2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * Never include this file directly; use <sys/socket.h> instead.
+ */
+
+#ifndef _BITS_SOCKADDR_H
+#define _BITS_SOCKADDR_H 1
+
+
+/* POSIX.1g specifies this type name for the `sa_family' member. */
+typedef unsigned short int sa_family_t;
+
+/* This macro is used to declare the initial common members
+ of the data types used for socket addresses, `struct sockaddr',
+ `struct sockaddr_in', `struct sockaddr_un', etc. */
+
+#define __SOCKADDR_COMMON(sa_prefix) \
+ sa_family_t sa_prefix##family
+
+#define __SOCKADDR_COMMON_SIZE (sizeof (unsigned short int))
+
+#endif /* bits/sockaddr.h */
diff --git a/sysroot/usr/include/bits/socket.h b/sysroot/usr/include/bits/socket.h
new file mode 100644
index 0000000..11bb607
--- /dev/null
+++ b/sysroot/usr/include/bits/socket.h
@@ -0,0 +1,330 @@
+/* System-specific socket constants and types. Linux version.
+ Copyright (C) 1991, 1992, 1994-2001, 2004, 2006, 2007
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef __BITS_SOCKET_H
+#define __BITS_SOCKET_H
+
+#ifndef _SYS_SOCKET_H
+# error "Never include <bits/socket.h> directly; use <sys/socket.h> instead."
+#endif
+
+#define __need_size_t
+#define __need_NULL
+#include <stddef.h>
+
+#include <limits.h>
+#include <sys/types.h>
+
+/* Type for length arguments in socket calls. */
+#ifndef __socklen_t_defined
+typedef __socklen_t socklen_t;
+# define __socklen_t_defined
+#endif
+
+/* Types of sockets. */
+enum __socket_type
+{
+ SOCK_STREAM = 1, /* Sequenced, reliable, connection-based
+ byte streams. */
+#define SOCK_STREAM SOCK_STREAM
+ SOCK_DGRAM = 2, /* Connectionless, unreliable datagrams
+ of fixed maximum length. */
+#define SOCK_DGRAM SOCK_DGRAM
+ SOCK_RAW = 3, /* Raw protocol interface. */
+#define SOCK_RAW SOCK_RAW
+ SOCK_RDM = 4, /* Reliably-delivered messages. */
+#define SOCK_RDM SOCK_RDM
+ SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based,
+ datagrams of fixed maximum length. */
+#define SOCK_SEQPACKET SOCK_SEQPACKET
+ SOCK_PACKET = 10 /* Linux specific way of getting packets
+ at the dev level. For writing rarp and
+ other similar things on the user level. */
+#define SOCK_PACKET SOCK_PACKET
+};
+
+/* Protocol families. */
+#define PF_UNSPEC 0 /* Unspecified. */
+#define PF_LOCAL 1 /* Local to host (pipes and file-domain). */
+#define PF_UNIX PF_LOCAL /* POSIX name for PF_LOCAL. */
+#define PF_FILE PF_LOCAL /* Another non-standard name for PF_LOCAL. */
+#define PF_INET 2 /* IP protocol family. */
+#define PF_AX25 3 /* Amateur Radio AX.25. */
+#define PF_IPX 4 /* Novell Internet Protocol. */
+#define PF_APPLETALK 5 /* Appletalk DDP. */
+#define PF_NETROM 6 /* Amateur radio NetROM. */
+#define PF_BRIDGE 7 /* Multiprotocol bridge. */
+#define PF_ATMPVC 8 /* ATM PVCs. */
+#define PF_X25 9 /* Reserved for X.25 project. */
+#define PF_INET6 10 /* IP version 6. */
+#define PF_ROSE 11 /* Amateur Radio X.25 PLP. */
+#define PF_DECnet 12 /* Reserved for DECnet project. */
+#define PF_NETBEUI 13 /* Reserved for 802.2LLC project. */
+#define PF_SECURITY 14 /* Security callback pseudo AF. */
+#define PF_KEY 15 /* PF_KEY key management API. */
+#define PF_NETLINK 16
+#define PF_ROUTE PF_NETLINK /* Alias to emulate 4.4BSD. */
+#define PF_PACKET 17 /* Packet family. */
+#define PF_ASH 18 /* Ash. */
+#define PF_ECONET 19 /* Acorn Econet. */
+#define PF_ATMSVC 20 /* ATM SVCs. */
+#define PF_SNA 22 /* Linux SNA Project */
+#define PF_IRDA 23 /* IRDA sockets. */
+#define PF_PPPOX 24 /* PPPoX sockets. */
+#define PF_WANPIPE 25 /* Wanpipe API sockets. */
+#define PF_BLUETOOTH 31 /* Bluetooth sockets. */
+#define PF_IUCV 32 /* IUCV sockets. */
+#define PF_RXRPC 33 /* RxRPC sockets. */
+#define PF_MAX 34 /* For now.. */
+
+/* Address families. */
+#define AF_UNSPEC PF_UNSPEC
+#define AF_LOCAL PF_LOCAL
+#define AF_UNIX PF_UNIX
+#define AF_FILE PF_FILE
+#define AF_INET PF_INET
+#define AF_AX25 PF_AX25
+#define AF_IPX PF_IPX
+#define AF_APPLETALK PF_APPLETALK
+#define AF_NETROM PF_NETROM
+#define AF_BRIDGE PF_BRIDGE
+#define AF_ATMPVC PF_ATMPVC
+#define AF_X25 PF_X25
+#define AF_INET6 PF_INET6
+#define AF_ROSE PF_ROSE
+#define AF_DECnet PF_DECnet
+#define AF_NETBEUI PF_NETBEUI
+#define AF_SECURITY PF_SECURITY
+#define AF_KEY PF_KEY
+#define AF_NETLINK PF_NETLINK
+#define AF_ROUTE PF_ROUTE
+#define AF_PACKET PF_PACKET
+#define AF_ASH PF_ASH
+#define AF_ECONET PF_ECONET
+#define AF_ATMSVC PF_ATMSVC
+#define AF_SNA PF_SNA
+#define AF_IRDA PF_IRDA
+#define AF_PPPOX PF_PPPOX
+#define AF_WANPIPE PF_WANPIPE
+#define AF_BLUETOOTH PF_BLUETOOTH
+#define AF_IUCV PF_IUCV
+#define AF_RXRPC PF_RXRPC
+#define AF_MAX PF_MAX
+
+/* Socket level values. Others are defined in the appropriate headers.
+
+ XXX These definitions also should go into the appropriate headers as
+ far as they are available. */
+#define SOL_RAW 255
+#define SOL_DECNET 261
+#define SOL_X25 262
+#define SOL_PACKET 263
+#define SOL_ATM 264 /* ATM layer (cell level). */
+#define SOL_AAL 265 /* ATM Adaption Layer (packet level). */
+#define SOL_IRDA 266
+
+/* Maximum queue length specifiable by listen. */
+#define SOMAXCONN 128
+
+/* Get the definition of the macro to define the common sockaddr members. */
+#include <bits/sockaddr.h>
+
+/* Structure describing a generic socket address. */
+struct sockaddr
+ {
+ __SOCKADDR_COMMON (sa_); /* Common data: address family and length. */
+ char sa_data[14]; /* Address data. */
+ };
+
+
+/* Structure large enough to hold any socket address (with the historical
+ exception of AF_UNIX). We reserve 128 bytes. */
+#if ULONG_MAX > 0xffffffff
+# define __ss_aligntype __uint64_t
+#else
+# define __ss_aligntype __uint32_t
+#endif
+#define _SS_SIZE 128
+#define _SS_PADSIZE (_SS_SIZE - (2 * sizeof (__ss_aligntype)))
+
+struct sockaddr_storage
+ {
+ __SOCKADDR_COMMON (ss_); /* Address family, etc. */
+ __ss_aligntype __ss_align; /* Force desired alignment. */
+ char __ss_padding[_SS_PADSIZE];
+ };
+
+
+/* Bits in the FLAGS argument to `send', `recv', et al. */
+enum
+ {
+ MSG_OOB = 0x01, /* Process out-of-band data. */
+#define MSG_OOB MSG_OOB
+ MSG_PEEK = 0x02, /* Peek at incoming messages. */
+#define MSG_PEEK MSG_PEEK
+ MSG_DONTROUTE = 0x04, /* Don't use local routing. */
+#define MSG_DONTROUTE MSG_DONTROUTE
+#ifdef __USE_GNU
+ /* DECnet uses a different name. */
+ MSG_TRYHARD = MSG_DONTROUTE,
+# define MSG_TRYHARD MSG_DONTROUTE
+#endif
+ MSG_CTRUNC = 0x08, /* Control data lost before delivery. */
+#define MSG_CTRUNC MSG_CTRUNC
+ MSG_PROXY = 0x10, /* Supply or ask second address. */
+#define MSG_PROXY MSG_PROXY
+ MSG_TRUNC = 0x20,
+#define MSG_TRUNC MSG_TRUNC
+ MSG_DONTWAIT = 0x40, /* Nonblocking IO. */
+#define MSG_DONTWAIT MSG_DONTWAIT
+ MSG_EOR = 0x80, /* End of record. */
+#define MSG_EOR MSG_EOR
+ MSG_WAITALL = 0x100, /* Wait for a full request. */
+#define MSG_WAITALL MSG_WAITALL
+ MSG_FIN = 0x200,
+#define MSG_FIN MSG_FIN
+ MSG_SYN = 0x400,
+#define MSG_SYN MSG_SYN
+ MSG_CONFIRM = 0x800, /* Confirm path validity. */
+#define MSG_CONFIRM MSG_CONFIRM
+ MSG_RST = 0x1000,
+#define MSG_RST MSG_RST
+ MSG_ERRQUEUE = 0x2000, /* Fetch message from error queue. */
+#define MSG_ERRQUEUE MSG_ERRQUEUE
+ MSG_NOSIGNAL = 0x4000, /* Do not generate SIGPIPE. */
+#define MSG_NOSIGNAL MSG_NOSIGNAL
+ MSG_MORE = 0x8000, /* Sender will send more. */
+#define MSG_MORE MSG_MORE
+
+ MSG_CMSG_CLOEXEC = 0x40000000 /* Set close_on_exit for file
+ descriptor received through
+ SCM_RIGHTS. */
+#define MSG_CMSG_CLOEXEC MSG_CMSG_CLOEXEC
+ };
+
+
+/* Structure describing messages sent by
+ `sendmsg' and received by `recvmsg'. */
+struct msghdr
+ {
+ void *msg_name; /* Address to send to/receive from. */
+ socklen_t msg_namelen; /* Length of address data. */
+
+ struct iovec *msg_iov; /* Vector of data to send/receive into. */
+ size_t msg_iovlen; /* Number of elements in the vector. */
+
+ void *msg_control; /* Ancillary data (eg BSD filedesc passing). */
+ size_t msg_controllen; /* Ancillary data buffer length.
+ !! The type should be socklen_t but the
+ definition of the kernel is incompatible
+ with this. */
+
+ int msg_flags; /* Flags on received message. */
+ };
+
+/* Structure used for storage of ancillary data object information. */
+struct cmsghdr
+ {
+ size_t cmsg_len; /* Length of data in cmsg_data plus length
+ of cmsghdr structure.
+ !! The type should be socklen_t but the
+ definition of the kernel is incompatible
+ with this. */
+ int cmsg_level; /* Originating protocol. */
+ int cmsg_type; /* Protocol specific type. */
+#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
+ __extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data. */
+#endif
+ };
+
+/* Ancillary data object manipulation macros. */
+#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
+# define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data)
+#else
+# define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1))
+#endif
+#define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg)
+#define CMSG_FIRSTHDR(mhdr) \
+ ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) \
+ ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) NULL)
+#define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \
+ & (size_t) ~(sizeof (size_t) - 1))
+#define CMSG_SPACE(len) (CMSG_ALIGN (len) \
+ + CMSG_ALIGN (sizeof (struct cmsghdr)))
+#define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
+
+extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+ struct cmsghdr *__cmsg) __THROW;
+#ifdef __USE_EXTERN_INLINES
+# ifndef _EXTERN_INLINE
+# define _EXTERN_INLINE __extern_inline
+# endif
+_EXTERN_INLINE struct cmsghdr *
+__NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
+{
+ if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
+ /* The kernel header does this so there may be a reason. */
+ return 0;
+
+ __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
+ + CMSG_ALIGN (__cmsg->cmsg_len));
+ if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
+ + __mhdr->msg_controllen)
+ || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
+ > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
+ /* No more entries. */
+ return 0;
+ return __cmsg;
+}
+#endif /* Use `extern inline'. */
+
+/* Socket level message types. This must match the definitions in
+ <linux/socket.h>. */
+enum
+ {
+ SCM_RIGHTS = 0x01 /* Transfer file descriptors. */
+#define SCM_RIGHTS SCM_RIGHTS
+#ifdef __USE_BSD
+ , SCM_CREDENTIALS = 0x02 /* Credentials passing. */
+# define SCM_CREDENTIALS SCM_CREDENTIALS
+#endif
+ };
+
+/* User visible structure for SCM_CREDENTIALS message */
+
+struct ucred
+{
+ pid_t pid; /* PID of sending process. */
+ uid_t uid; /* UID of sending process. */
+ gid_t gid; /* GID of sending process. */
+};
+
+/* Get socket manipulation related informations from kernel headers. */
+#include <asm/socket.h>
+
+
+/* Structure used to manipulate the SO_LINGER option. */
+struct linger
+ {
+ int l_onoff; /* Nonzero to linger on close. */
+ int l_linger; /* Time to linger. */
+ };
+
+#endif /* bits/socket.h */
diff --git a/sysroot/usr/include/bits/socket2.h b/sysroot/usr/include/bits/socket2.h
new file mode 100644
index 0000000..5c4cb47
--- /dev/null
+++ b/sysroot/usr/include/bits/socket2.h
@@ -0,0 +1,78 @@
+/* Checking macros for socket functions.
+ Copyright (C) 2005, 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SOCKET_H
+# error "Never include <bits/socket2.h> directly; use <sys/socket.h> instead."
+#endif
+
+extern ssize_t __recv_chk (int __fd, void *__buf, size_t __n, size_t __buflen,
+ int __flags);
+extern ssize_t __REDIRECT (__recv_alias, (int __fd, void *__buf, size_t __n,
+ int __flags), recv);
+extern ssize_t __REDIRECT (__recv_chk_warn,
+ (int __fd, void *__buf, size_t __n, size_t __buflen,
+ int __flags), __recv_chk)
+ __warnattr ("recv called with bigger length than size of destination "
+ "buffer");
+
+__extern_always_inline ssize_t
+recv (int __fd, void *__buf, size_t __n, int __flags)
+{
+ if (__bos0 (__buf) != (size_t) -1)
+ {
+ if (!__builtin_constant_p (__n))
+ return __recv_chk (__fd, __buf, __n, __bos0 (__buf), __flags);
+
+ if (__n > __bos0 (__buf))
+ return __recv_chk_warn (__fd, __buf, __n, __bos0 (__buf), __flags);
+ }
+ return __recv_alias (__fd, __buf, __n, __flags);
+}
+
+extern ssize_t __recvfrom_chk (int __fd, void *__restrict __buf, size_t __n,
+ size_t __buflen, int __flags,
+ __SOCKADDR_ARG __addr,
+ socklen_t *__restrict __addr_len);
+extern ssize_t __REDIRECT (__recvfrom_alias,
+ (int __fd, void *__restrict __buf, size_t __n,
+ int __flags, __SOCKADDR_ARG __addr,
+ socklen_t *__restrict __addr_len), recvfrom);
+extern ssize_t __REDIRECT (__recvfrom_chk_warn,
+ (int __fd, void *__restrict __buf, size_t __n,
+ size_t __buflen, int __flags,
+ __SOCKADDR_ARG __addr,
+ socklen_t *__restrict __addr_len), __recvfrom_chk)
+ __warnattr ("recvfrom called with bigger length than size of "
+ "destination buffer");
+
+__extern_always_inline ssize_t
+recvfrom (int __fd, void *__restrict __buf, size_t __n, int __flags,
+ __SOCKADDR_ARG __addr, socklen_t *__restrict __addr_len)
+{
+ if (__bos0 (__buf) != (size_t) -1)
+ {
+ if (!__builtin_constant_p (__n))
+ return __recvfrom_chk (__fd, __buf, __n, __bos0 (__buf), __flags,
+ __addr, __addr_len);
+ if (__n > __bos0 (__buf))
+ return __recvfrom_chk_warn (__fd, __buf, __n, __bos0 (__buf), __flags,
+ __addr, __addr_len);
+ }
+ return __recvfrom_alias (__fd, __buf, __n, __flags, __addr, __addr_len);
+}
diff --git a/sysroot/usr/include/bits/stab.def b/sysroot/usr/include/bits/stab.def
new file mode 100644
index 0000000..3d54774
--- /dev/null
+++ b/sysroot/usr/include/bits/stab.def
@@ -0,0 +1,234 @@
+/* Table of DBX symbol codes for the GNU system.
+ Copyright (C) 1988, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* This contains contribution from Cygnus Support. */
+
+/* Global variable. Only the name is significant.
+ To find the address, look in the corresponding external symbol. */
+__define_stab (N_GSYM, 0x20, "GSYM")
+
+/* Function name for BSD Fortran. Only the name is significant.
+ To find the address, look in the corresponding external symbol. */
+__define_stab (N_FNAME, 0x22, "FNAME")
+
+/* Function name or text-segment variable for C. Value is its address.
+ Desc is supposedly starting line number, but GCC doesn't set it
+ and DBX seems not to miss it. */
+__define_stab (N_FUN, 0x24, "FUN")
+
+/* Data-segment variable with internal linkage. Value is its address.
+ "Static Sym". */
+__define_stab (N_STSYM, 0x26, "STSYM")
+
+/* BSS-segment variable with internal linkage. Value is its address. */
+__define_stab (N_LCSYM, 0x28, "LCSYM")
+
+/* Name of main routine. Only the name is significant.
+ This is not used in C. */
+__define_stab (N_MAIN, 0x2a, "MAIN")
+
+/* Global symbol in Pascal.
+ Supposedly the value is its line number; I'm skeptical. */
+__define_stab (N_PC, 0x30, "PC")
+
+/* Number of symbols: 0, files,,funcs,lines according to Ultrix V4.0. */
+__define_stab (N_NSYMS, 0x32, "NSYMS")
+
+/* "No DST map for sym: name, ,0,type,ignored" according to Ultrix V4.0. */
+__define_stab (N_NOMAP, 0x34, "NOMAP")
+
+/* New stab from Solaris. I don't know what it means, but it
+ don't seem to contain useful information. */
+__define_stab (N_OBJ, 0x38, "OBJ")
+
+/* New stab from Solaris. I don't know what it means, but it
+ don't seem to contain useful information. Possibly related to the
+ optimization flags used in this module. */
+__define_stab (N_OPT, 0x3c, "OPT")
+
+/* Register variable. Value is number of register. */
+__define_stab (N_RSYM, 0x40, "RSYM")
+
+/* Modula-2 compilation unit. Can someone say what info it contains? */
+__define_stab (N_M2C, 0x42, "M2C")
+
+/* Line number in text segment. Desc is the line number;
+ value is corresponding address. */
+__define_stab (N_SLINE, 0x44, "SLINE")
+
+/* Similar, for data segment. */
+__define_stab (N_DSLINE, 0x46, "DSLINE")
+
+/* Similar, for bss segment. */
+__define_stab (N_BSLINE, 0x48, "BSLINE")
+
+/* Sun's source-code browser stabs. ?? Don't know what the fields are.
+ Supposedly the field is "path to associated .cb file". THIS VALUE
+ OVERLAPS WITH N_BSLINE! */
+__define_stab (N_BROWS, 0x48, "BROWS")
+
+/* GNU Modula-2 definition module dependency. Value is the modification time
+ of the definition file. Other is non-zero if it is imported with the
+ GNU M2 keyword %INITIALIZE. Perhaps N_M2C can be used if there
+ are enough empty fields? */
+__define_stab(N_DEFD, 0x4a, "DEFD")
+
+/* THE FOLLOWING TWO STAB VALUES CONFLICT. Happily, one is for Modula-2
+ and one is for C++. Still,... */
+/* GNU C++ exception variable. Name is variable name. */
+__define_stab (N_EHDECL, 0x50, "EHDECL")
+/* Modula2 info "for imc": name,,0,0,0 according to Ultrix V4.0. */
+__define_stab (N_MOD2, 0x50, "MOD2")
+
+/* GNU C++ `catch' clause. Value is its address. Desc is nonzero if
+ this entry is immediately followed by a CAUGHT stab saying what exception
+ was caught. Multiple CAUGHT stabs means that multiple exceptions
+ can be caught here. If Desc is 0, it means all exceptions are caught
+ here. */
+__define_stab (N_CATCH, 0x54, "CATCH")
+
+/* Structure or union element. Value is offset in the structure. */
+__define_stab (N_SSYM, 0x60, "SSYM")
+
+/* Name of main source file.
+ Value is starting text address of the compilation. */
+__define_stab (N_SO, 0x64, "SO")
+
+/* Automatic variable in the stack. Value is offset from frame pointer.
+ Also used for type descriptions. */
+__define_stab (N_LSYM, 0x80, "LSYM")
+
+/* Beginning of an include file. Only Sun uses this.
+ In an object file, only the name is significant.
+ The Sun linker puts data into some of the other fields. */
+__define_stab (N_BINCL, 0x82, "BINCL")
+
+/* Name of sub-source file (#include file).
+ Value is starting text address of the compilation. */
+__define_stab (N_SOL, 0x84, "SOL")
+
+/* Parameter variable. Value is offset from argument pointer.
+ (On most machines the argument pointer is the same as the frame pointer. */
+__define_stab (N_PSYM, 0xa0, "PSYM")
+
+/* End of an include file. No name.
+ This and N_BINCL act as brackets around the file's output.
+ In an object file, there is no significant data in this entry.
+ The Sun linker puts data into some of the fields. */
+__define_stab (N_EINCL, 0xa2, "EINCL")
+
+/* Alternate entry point. Value is its address. */
+__define_stab (N_ENTRY, 0xa4, "ENTRY")
+
+/* Beginning of lexical block.
+ The desc is the nesting level in lexical blocks.
+ The value is the address of the start of the text for the block.
+ The variables declared inside the block *precede* the N_LBRAC symbol. */
+__define_stab (N_LBRAC, 0xc0, "LBRAC")
+
+/* Place holder for deleted include file. Replaces a N_BINCL and everything
+ up to the corresponding N_EINCL. The Sun linker generates these when
+ it finds multiple identical copies of the symbols from an include file.
+ This appears only in output from the Sun linker. */
+__define_stab (N_EXCL, 0xc2, "EXCL")
+
+/* Modula-2 scope information. Can someone say what info it contains? */
+__define_stab (N_SCOPE, 0xc4, "SCOPE")
+
+/* End of a lexical block. Desc matches the N_LBRAC's desc.
+ The value is the address of the end of the text for the block. */
+__define_stab (N_RBRAC, 0xe0, "RBRAC")
+
+/* Begin named common block. Only the name is significant. */
+__define_stab (N_BCOMM, 0xe2, "BCOMM")
+
+/* End named common block. Only the name is significant
+ (and it should match the N_BCOMM). */
+__define_stab (N_ECOMM, 0xe4, "ECOMM")
+
+/* End common (local name): value is address.
+ I'm not sure how this is used. */
+__define_stab (N_ECOML, 0xe8, "ECOML")
+
+/* These STAB's are used on Gould systems for Non-Base register symbols
+ or something like that. FIXME. I have assigned the values at random
+ since I don't have a Gould here. Fixups from Gould folk welcome... */
+__define_stab (N_NBTEXT, 0xF0, "NBTEXT")
+__define_stab (N_NBDATA, 0xF2, "NBDATA")
+__define_stab (N_NBBSS, 0xF4, "NBBSS")
+__define_stab (N_NBSTS, 0xF6, "NBSTS")
+__define_stab (N_NBLCS, 0xF8, "NBLCS")
+
+/* Second symbol entry containing a length-value for the preceding entry.
+ The value is the length. */
+__define_stab (N_LENG, 0xfe, "LENG")
+
+/* The above information, in matrix format.
+
+ STAB MATRIX
+ _________________________________________________
+ | 00 - 1F are not dbx stab symbols |
+ | In most cases, the low bit is the EXTernal bit|
+
+ | 00 UNDEF | 02 ABS | 04 TEXT | 06 DATA |
+ | 01 |EXT | 03 |EXT | 05 |EXT | 07 |EXT |
+
+ | 08 BSS | 0A INDR | 0C FN_SEQ | 0E |
+ | 09 |EXT | 0B | 0D | 0F |
+
+ | 10 | 12 COMM | 14 SETA | 16 SETT |
+ | 11 | 13 | 15 | 17 |
+
+ | 18 SETD | 1A SETB | 1C SETV | 1E WARNING|
+ | 19 | 1B | 1D | 1F FN |
+
+ |_______________________________________________|
+ | Debug entries with bit 01 set are unused. |
+ | 20 GSYM | 22 FNAME | 24 FUN | 26 STSYM |
+ | 28 LCSYM | 2A MAIN | 2C | 2E |
+ | 30 PC | 32 NSYMS | 34 NOMAP | 36 |
+ | 38 OBJ | 3A | 3C OPT | 3E |
+ | 40 RSYM | 42 M2C | 44 SLINE | 46 DSLINE |
+ | 48 BSLINE*| 4A DEFD | 4C | 4E |
+ | 50 EHDECL*| 52 | 54 CATCH | 56 |
+ | 58 | 5A | 5C | 5E |
+ | 60 SSYM | 62 | 64 SO | 66 |
+ | 68 | 6A | 6C | 6E |
+ | 70 | 72 | 74 | 76 |
+ | 78 | 7A | 7C | 7E |
+ | 80 LSYM | 82 BINCL | 84 SOL | 86 |
+ | 88 | 8A | 8C | 8E |
+ | 90 | 92 | 94 | 96 |
+ | 98 | 9A | 9C | 9E |
+ | A0 PSYM | A2 EINCL | A4 ENTRY | A6 |
+ | A8 | AA | AC | AE |
+ | B0 | B2 | B4 | B6 |
+ | B8 | BA | BC | BE |
+ | C0 LBRAC | C2 EXCL | C4 SCOPE | C6 |
+ | C8 | CA | CC | CE |
+ | D0 | D2 | D4 | D6 |
+ | D8 | DA | DC | DE |
+ | E0 RBRAC | E2 BCOMM | E4 ECOMM | E6 |
+ | E8 ECOML | EA | EC | EE |
+ | F0 | F2 | F4 | F6 |
+ | F8 | FA | FC | FE LENG |
+ +-----------------------------------------------+
+ * 50 EHDECL is also MOD2.
+ * 48 BSLINE is also BROWS.
+ */
diff --git a/sysroot/usr/include/bits/stat.h b/sysroot/usr/include/bits/stat.h
new file mode 100644
index 0000000..add2c8e
--- /dev/null
+++ b/sysroot/usr/include/bits/stat.h
@@ -0,0 +1,209 @@
+/* Copyright (C) 1999,2000,2001,2002,2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_STAT_H
+# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
+#endif
+
+/* Versions of the `struct stat' data structure. */
+#define _STAT_VER_KERNEL 0
+
+#if __WORDSIZE == 32
+# define _STAT_VER_SVR4 2
+# define _STAT_VER_LINUX 3
+
+/* i386 versions of the `xmknod' interface. */
+# define _MKNOD_VER_LINUX 1
+# define _MKNOD_VER_SVR4 2
+# define _MKNOD_VER _MKNOD_VER_LINUX /* The bits defined below. */
+#else
+# define _STAT_VER_LINUX 1
+
+/* x86-64 versions of the `xmknod' interface. */
+# define _MKNOD_VER_LINUX 0
+#endif
+
+#define _STAT_VER _STAT_VER_LINUX
+
+struct stat
+ {
+ __dev_t st_dev; /* Device. */
+#if __WORDSIZE == 32
+ unsigned short int __pad1;
+#endif
+#if __WORDSIZE == 64 || !defined __USE_FILE_OFFSET64
+ __ino_t st_ino; /* File serial number. */
+#else
+ __ino_t __st_ino; /* 32bit file serial number. */
+#endif
+#if __WORDSIZE == 32
+ __mode_t st_mode; /* File mode. */
+ __nlink_t st_nlink; /* Link count. */
+#else
+ __nlink_t st_nlink; /* Link count. */
+ __mode_t st_mode; /* File mode. */
+#endif
+ __uid_t st_uid; /* User ID of the file's owner. */
+ __gid_t st_gid; /* Group ID of the file's group.*/
+#if __WORDSIZE == 64
+ int pad0;
+#endif
+ __dev_t st_rdev; /* Device number, if device. */
+#if __WORDSIZE == 32
+ unsigned short int __pad2;
+#endif
+#if __WORDSIZE == 64 || !defined __USE_FILE_OFFSET64
+ __off_t st_size; /* Size of file, in bytes. */
+#else
+ __off64_t st_size; /* Size of file, in bytes. */
+#endif
+ __blksize_t st_blksize; /* Optimal block size for I/O. */
+#if __WORDSIZE == 64 || !defined __USE_FILE_OFFSET64
+ __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */
+#else
+ __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
+#endif
+#ifdef __USE_MISC
+ /* Nanosecond resolution timestamps are stored in a format
+ equivalent to 'struct timespec'. This is the type used
+ whenever possible but the Unix namespace rules do not allow the
+ identifier 'timespec' to appear in the <sys/stat.h> header.
+ Therefore we have to handle the use of this header in strictly
+ standard-compliant sources special. */
+ struct timespec st_atim; /* Time of last access. */
+ struct timespec st_mtim; /* Time of last modification. */
+ struct timespec st_ctim; /* Time of last status change. */
+# define st_atime st_atim.tv_sec /* Backward compatibility. */
+# define st_mtime st_mtim.tv_sec
+# define st_ctime st_ctim.tv_sec
+#else
+ __time_t st_atime; /* Time of last access. */
+ unsigned long int st_atimensec; /* Nscecs of last access. */
+ __time_t st_mtime; /* Time of last modification. */
+ unsigned long int st_mtimensec; /* Nsecs of last modification. */
+ __time_t st_ctime; /* Time of last status change. */
+ unsigned long int st_ctimensec; /* Nsecs of last status change. */
+#endif
+#if __WORDSIZE == 64
+ long int __unused[3];
+#else
+# ifndef __USE_FILE_OFFSET64
+ unsigned long int __unused4;
+ unsigned long int __unused5;
+# else
+ __ino64_t st_ino; /* File serial number. */
+# endif
+#endif
+ };
+
+#ifdef __USE_LARGEFILE64
+/* Note stat64 has the same shape as stat for x86-64. */
+struct stat64
+ {
+ __dev_t st_dev; /* Device. */
+#if __WORDSIZE == 64
+ __ino64_t st_ino; /* File serial number. */
+ __nlink_t st_nlink; /* Link count. */
+ __mode_t st_mode; /* File mode. */
+#else
+ unsigned int __pad1;
+ __ino_t __st_ino; /* 32bit file serial number. */
+ __mode_t st_mode; /* File mode. */
+ __nlink_t st_nlink; /* Link count. */
+#endif
+ __uid_t st_uid; /* User ID of the file's owner. */
+ __gid_t st_gid; /* Group ID of the file's group.*/
+#if __WORDSIZE == 64
+ int pad0;
+ __dev_t st_rdev; /* Device number, if device. */
+ __off_t st_size; /* Size of file, in bytes. */
+#else
+ __dev_t st_rdev; /* Device number, if device. */
+ unsigned int __pad2;
+ __off64_t st_size; /* Size of file, in bytes. */
+#endif
+ __blksize_t st_blksize; /* Optimal block size for I/O. */
+ __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */
+#ifdef __USE_MISC
+ /* Nanosecond resolution timestamps are stored in a format
+ equivalent to 'struct timespec'. This is the type used
+ whenever possible but the Unix namespace rules do not allow the
+ identifier 'timespec' to appear in the <sys/stat.h> header.
+ Therefore we have to handle the use of this header in strictly
+ standard-compliant sources special. */
+ struct timespec st_atim; /* Time of last access. */
+ struct timespec st_mtim; /* Time of last modification. */
+ struct timespec st_ctim; /* Time of last status change. */
+# define st_atime st_atim.tv_sec /* Backward compatibility. */
+# define st_mtime st_mtim.tv_sec
+# define st_ctime st_ctim.tv_sec
+#else
+ __time_t st_atime; /* Time of last access. */
+ unsigned long int st_atimensec; /* Nscecs of last access. */
+ __time_t st_mtime; /* Time of last modification. */
+ unsigned long int st_mtimensec; /* Nsecs of last modification. */
+ __time_t st_ctime; /* Time of last status change. */
+ unsigned long int st_ctimensec; /* Nsecs of last status change. */
+#endif
+#if __WORDSIZE == 64
+ long int __unused[3];
+#else
+ __ino64_t st_ino; /* File serial number. */
+#endif
+ };
+#endif
+
+/* Tell code we have these members. */
+#define _STATBUF_ST_BLKSIZE
+#define _STATBUF_ST_RDEV
+/* Nanosecond resolution time values are supported. */
+#define _STATBUF_ST_NSEC
+
+/* Encoding of the file mode. */
+
+#define __S_IFMT 0170000 /* These bits determine file type. */
+
+/* File types. */
+#define __S_IFDIR 0040000 /* Directory. */
+#define __S_IFCHR 0020000 /* Character device. */
+#define __S_IFBLK 0060000 /* Block device. */
+#define __S_IFREG 0100000 /* Regular file. */
+#define __S_IFIFO 0010000 /* FIFO. */
+#define __S_IFLNK 0120000 /* Symbolic link. */
+#define __S_IFSOCK 0140000 /* Socket. */
+
+/* POSIX.1b objects. Note that these macros always evaluate to zero. But
+ they do it by enforcing the correct use of the macros. */
+#define __S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode)
+
+/* Protection bits. */
+
+#define __S_ISUID 04000 /* Set user ID on execution. */
+#define __S_ISGID 02000 /* Set group ID on execution. */
+#define __S_ISVTX 01000 /* Save swapped text after use (sticky). */
+#define __S_IREAD 0400 /* Read by owner. */
+#define __S_IWRITE 0200 /* Write by owner. */
+#define __S_IEXEC 0100 /* Execute by owner. */
+
+#if defined __USE_ATFILE || defined __USE_GNU
+/* XXX This will change to the macro for the next 2008 POSIX revision. */
+# define UTIME_NOW ((1l << 30) - 1l)
+# define UTIME_OMIT ((1l << 30) - 2l)
+#endif
diff --git a/sysroot/usr/include/bits/statfs.h b/sysroot/usr/include/bits/statfs.h
new file mode 100644
index 0000000..0e27865
--- /dev/null
+++ b/sysroot/usr/include/bits/statfs.h
@@ -0,0 +1,67 @@
+/* Copyright (C) 1997, 1998, 2000, 2002, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_STATFS_H
+# error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead."
+#endif
+
+#include <bits/types.h>
+
+struct statfs
+ {
+ __SWORD_TYPE f_type;
+ __SWORD_TYPE f_bsize;
+#ifndef __USE_FILE_OFFSET64
+ __fsblkcnt_t f_blocks;
+ __fsblkcnt_t f_bfree;
+ __fsblkcnt_t f_bavail;
+ __fsfilcnt_t f_files;
+ __fsfilcnt_t f_ffree;
+#else
+ __fsblkcnt64_t f_blocks;
+ __fsblkcnt64_t f_bfree;
+ __fsblkcnt64_t f_bavail;
+ __fsfilcnt64_t f_files;
+ __fsfilcnt64_t f_ffree;
+#endif
+ __fsid_t f_fsid;
+ __SWORD_TYPE f_namelen;
+ __SWORD_TYPE f_frsize;
+ __SWORD_TYPE f_spare[5];
+ };
+
+#ifdef __USE_LARGEFILE64
+struct statfs64
+ {
+ __SWORD_TYPE f_type;
+ __SWORD_TYPE f_bsize;
+ __fsblkcnt64_t f_blocks;
+ __fsblkcnt64_t f_bfree;
+ __fsblkcnt64_t f_bavail;
+ __fsfilcnt64_t f_files;
+ __fsfilcnt64_t f_ffree;
+ __fsid_t f_fsid;
+ __SWORD_TYPE f_namelen;
+ __SWORD_TYPE f_frsize;
+ __SWORD_TYPE f_spare[5];
+ };
+#endif
+
+/* Tell code we have these members. */
+#define _STATFS_F_NAMELEN
+#define _STATFS_F_FRSIZE
diff --git a/sysroot/usr/include/bits/statvfs.h b/sysroot/usr/include/bits/statvfs.h
new file mode 100644
index 0000000..84717c3
--- /dev/null
+++ b/sysroot/usr/include/bits/statvfs.h
@@ -0,0 +1,109 @@
+/* Copyright (C) 1997,1998,2000,2001,2002,2006 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_STATVFS_H
+# error "Never include <bits/statvfs.h> directly; use <sys/statvfs.h> instead."
+#endif
+
+#include <bits/types.h> /* For __fsblkcnt_t and __fsfilcnt_t. */
+
+#if __WORDSIZE == 32
+#define _STATVFSBUF_F_UNUSED
+#endif
+
+struct statvfs
+ {
+ unsigned long int f_bsize;
+ unsigned long int f_frsize;
+#ifndef __USE_FILE_OFFSET64
+ __fsblkcnt_t f_blocks;
+ __fsblkcnt_t f_bfree;
+ __fsblkcnt_t f_bavail;
+ __fsfilcnt_t f_files;
+ __fsfilcnt_t f_ffree;
+ __fsfilcnt_t f_favail;
+#else
+ __fsblkcnt64_t f_blocks;
+ __fsblkcnt64_t f_bfree;
+ __fsblkcnt64_t f_bavail;
+ __fsfilcnt64_t f_files;
+ __fsfilcnt64_t f_ffree;
+ __fsfilcnt64_t f_favail;
+#endif
+ unsigned long int f_fsid;
+#ifdef _STATVFSBUF_F_UNUSED
+ int __f_unused;
+#endif
+ unsigned long int f_flag;
+ unsigned long int f_namemax;
+ int __f_spare[6];
+ };
+
+#ifdef __USE_LARGEFILE64
+struct statvfs64
+ {
+ unsigned long int f_bsize;
+ unsigned long int f_frsize;
+ __fsblkcnt64_t f_blocks;
+ __fsblkcnt64_t f_bfree;
+ __fsblkcnt64_t f_bavail;
+ __fsfilcnt64_t f_files;
+ __fsfilcnt64_t f_ffree;
+ __fsfilcnt64_t f_favail;
+ unsigned long int f_fsid;
+#ifdef _STATVFSBUF_F_UNUSED
+ int __f_unused;
+#endif
+ unsigned long int f_flag;
+ unsigned long int f_namemax;
+ int __f_spare[6];
+ };
+#endif
+
+/* Definitions for the flag in `f_flag'. These definitions should be
+ kept in sync with the definitions in <sys/mount.h>. */
+enum
+{
+ ST_RDONLY = 1, /* Mount read-only. */
+#define ST_RDONLY ST_RDONLY
+ ST_NOSUID = 2 /* Ignore suid and sgid bits. */
+#define ST_NOSUID ST_NOSUID
+#ifdef __USE_GNU
+ ,
+ ST_NODEV = 4, /* Disallow access to device special files. */
+# define ST_NODEV ST_NODEV
+ ST_NOEXEC = 8, /* Disallow program execution. */
+# define ST_NOEXEC ST_NOEXEC
+ ST_SYNCHRONOUS = 16, /* Writes are synced at once. */
+# define ST_SYNCHRONOUS ST_SYNCHRONOUS
+ ST_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
+# define ST_MANDLOCK ST_MANDLOCK
+ ST_WRITE = 128, /* Write on file/directory/symlink. */
+# define ST_WRITE ST_WRITE
+ ST_APPEND = 256, /* Append-only file. */
+# define ST_APPEND ST_APPEND
+ ST_IMMUTABLE = 512, /* Immutable file. */
+# define ST_IMMUTABLE ST_IMMUTABLE
+ ST_NOATIME = 1024, /* Do not update access times. */
+# define ST_NOATIME ST_NOATIME
+ ST_NODIRATIME = 2048, /* Do not update directory access times. */
+# define ST_NODIRATIME ST_NODIRATIME
+ ST_RELATIME = 4096 /* Update atime relative to mtime/ctime. */
+# define ST_RELATIME ST_RELATIME
+#endif /* Use GNU. */
+};
diff --git a/sysroot/usr/include/bits/stdio-ldbl.h b/sysroot/usr/include/bits/stdio-ldbl.h
new file mode 100644
index 0000000..c93e6c4
--- /dev/null
+++ b/sysroot/usr/include/bits/stdio-ldbl.h
@@ -0,0 +1,89 @@
+/* -mlong-double-64 compatibility mode for stdio functions.
+ Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _STDIO_H
+# error "Never include <bits/stdio-ldbl.h> directly; use <stdio.h> instead."
+#endif
+
+__BEGIN_NAMESPACE_STD
+__LDBL_REDIR_DECL (fprintf)
+__LDBL_REDIR_DECL (printf)
+__LDBL_REDIR_DECL (sprintf)
+__LDBL_REDIR_DECL (vfprintf)
+__LDBL_REDIR_DECL (vprintf)
+__LDBL_REDIR_DECL (vsprintf)
+#if defined __USE_ISOC99 && !defined __USE_GNU \
+ && !defined __REDIRECT \
+ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K)
+__LDBL_REDIR1_DECL (fscanf, __nldbl___isoc99_fscanf)
+__LDBL_REDIR1_DECL (scanf, __nldbl___isoc99_scanf)
+__LDBL_REDIR1_DECL (sscanf, __nldbl___isoc99_sscanf)
+#else
+__LDBL_REDIR_DECL (fscanf)
+__LDBL_REDIR_DECL (scanf)
+__LDBL_REDIR_DECL (sscanf)
+#endif
+__END_NAMESPACE_STD
+
+#if defined __USE_BSD || defined __USE_ISOC99 || defined __USE_UNIX98
+__BEGIN_NAMESPACE_C99
+__LDBL_REDIR_DECL (snprintf)
+__LDBL_REDIR_DECL (vsnprintf)
+__END_NAMESPACE_C99
+#endif
+
+#ifdef __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+# if !defined __USE_GNU && !defined __REDIRECT \
+ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K)
+__LDBL_REDIR1_DECL (vfscanf, __nldbl___isoc99_vfscanf)
+__LDBL_REDIR1_DECL (vscanf, __nldbl___isoc99_vscanf)
+__LDBL_REDIR1_DECL (vsscanf, __nldbl___isoc99_vsscanf)
+# else
+__LDBL_REDIR_DECL (vfscanf)
+__LDBL_REDIR_DECL (vsscanf)
+__LDBL_REDIR_DECL (vscanf)
+# endif
+__END_NAMESPACE_C99
+#endif
+
+#ifdef __USE_GNU
+__LDBL_REDIR_DECL (vdprintf)
+__LDBL_REDIR_DECL (dprintf)
+__LDBL_REDIR_DECL (vasprintf)
+__LDBL_REDIR_DECL (__asprintf)
+__LDBL_REDIR_DECL (asprintf)
+__LDBL_REDIR_DECL (obstack_printf)
+__LDBL_REDIR_DECL (obstack_vprintf)
+#endif
+
+#if __USE_FORTIFY_LEVEL > 0 && defined __extern_always_inline
+__LDBL_REDIR_DECL (__sprintf_chk)
+__LDBL_REDIR_DECL (__vsprintf_chk)
+# if defined __USE_BSD || defined __USE_ISOC99 || defined __USE_UNIX98
+__LDBL_REDIR_DECL (__snprintf_chk)
+__LDBL_REDIR_DECL (__vsnprintf_chk)
+# endif
+# if __USE_FORTIFY_LEVEL > 1
+__LDBL_REDIR_DECL (__fprintf_chk)
+__LDBL_REDIR_DECL (__printf_chk)
+__LDBL_REDIR_DECL (__vfprintf_chk)
+__LDBL_REDIR_DECL (__vprintf_chk)
+# endif
+#endif
diff --git a/sysroot/usr/include/bits/stdio-lock.h b/sysroot/usr/include/bits/stdio-lock.h
new file mode 100644
index 0000000..b8efdd8
--- /dev/null
+++ b/sysroot/usr/include/bits/stdio-lock.h
@@ -0,0 +1,111 @@
+/* Thread package specific definitions of stream lock type. NPTL version.
+ Copyright (C) 2000, 2001, 2002, 2003, 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _BITS_STDIO_LOCK_H
+#define _BITS_STDIO_LOCK_H 1
+
+#include <bits/libc-lock.h>
+#include <lowlevellock.h>
+
+
+/* The locking here is very inexpensive, even for inlining. */
+#define _IO_lock_inexpensive 1
+
+typedef struct { int lock; int cnt; void *owner; } _IO_lock_t;
+
+#define _IO_lock_initializer { LLL_LOCK_INITIALIZER, 0, NULL }
+
+#define _IO_lock_init(_name) \
+ ((_name) = (_IO_lock_t) _IO_lock_initializer , 0)
+
+#define _IO_lock_fini(_name) \
+ ((void) 0)
+
+#define _IO_lock_lock(_name) \
+ do { \
+ void *__self = THREAD_SELF; \
+ if ((_name).owner != __self) \
+ { \
+ lll_lock ((_name).lock, LLL_PRIVATE); \
+ (_name).owner = __self; \
+ } \
+ ++(_name).cnt; \
+ } while (0)
+
+#define _IO_lock_trylock(_name) \
+ ({ \
+ int __result = 0; \
+ void *__self = THREAD_SELF; \
+ if ((_name).owner != __self) \
+ { \
+ if (lll_trylock ((_name).lock) == 0) \
+ { \
+ (_name).owner = __self; \
+ (_name).cnt = 1; \
+ } \
+ else \
+ __result = EBUSY; \
+ } \
+ else \
+ ++(_name).cnt; \
+ __result; \
+ })
+
+#define _IO_lock_unlock(_name) \
+ do { \
+ if (--(_name).cnt == 0) \
+ { \
+ (_name).owner = NULL; \
+ lll_unlock ((_name).lock, LLL_PRIVATE); \
+ } \
+ } while (0)
+
+
+
+#define _IO_cleanup_region_start(_fct, _fp) \
+ __libc_cleanup_region_start (((_fp)->_flags & _IO_USER_LOCK) == 0, _fct, _fp)
+#define _IO_cleanup_region_start_noarg(_fct) \
+ __libc_cleanup_region_start (1, _fct, NULL)
+#define _IO_cleanup_region_end(_doit) \
+ __libc_cleanup_region_end (_doit)
+
+#if defined _LIBC && !defined NOT_IN_libc
+
+# ifdef __EXCEPTIONS
+# define _IO_acquire_lock(_fp) \
+ do { \
+ _IO_FILE *_IO_acquire_lock_file \
+ __attribute__((cleanup (_IO_acquire_lock_fct))) \
+ = (_fp); \
+ _IO_flockfile (_IO_acquire_lock_file);
+# define _IO_acquire_lock_clear_flags2(_fp) \
+ do { \
+ _IO_FILE *_IO_acquire_lock_file \
+ __attribute__((cleanup (_IO_acquire_lock_clear_flags2_fct))) \
+ = (_fp); \
+ _IO_flockfile (_IO_acquire_lock_file);
+# else
+# define _IO_acquire_lock(_fp) _IO_acquire_lock_needs_exceptions_enabled
+# define _IO_acquire_lock_clear_flags2(_fp) _IO_acquire_lock (_fp)
+# endif
+# define _IO_release_lock(_fp) ; } while (0)
+
+#endif
+
+#endif /* bits/stdio-lock.h */
diff --git a/sysroot/usr/include/bits/stdio.h b/sysroot/usr/include/bits/stdio.h
new file mode 100644
index 0000000..49303c6
--- /dev/null
+++ b/sysroot/usr/include/bits/stdio.h
@@ -0,0 +1,191 @@
+/* Optimizing macros and inline functions for stdio functions.
+ Copyright (C) 1998, 2000, 2001, 2004, 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _STDIO_H
+# error "Never include <bits/stdio.h> directly; use <stdio.h> instead."
+#endif
+
+#ifndef __extern_inline
+# define __STDIO_INLINE inline
+#else
+# define __STDIO_INLINE __extern_inline
+#endif
+
+
+#ifdef __USE_EXTERN_INLINES
+/* For -D_FORTIFY_SOURCE{,=2} bits/stdio2.h will define a different
+ inline. */
+# if !(__USE_FORTIFY_LEVEL > 0 && defined __extern_always_inline)
+/* Write formatted output to stdout from argument list ARG. */
+__STDIO_INLINE int
+vprintf (__const char *__restrict __fmt, _G_va_list __arg)
+{
+ return vfprintf (stdout, __fmt, __arg);
+}
+# endif
+
+/* Read a character from stdin. */
+__STDIO_INLINE int
+getchar (void)
+{
+ return _IO_getc (stdin);
+}
+
+
+# ifdef __USE_MISC
+/* Faster version when locking is not necessary. */
+__STDIO_INLINE int
+fgetc_unlocked (FILE *__fp)
+{
+ return _IO_getc_unlocked (__fp);
+}
+# endif /* misc */
+
+
+# if defined __USE_POSIX || defined __USE_MISC
+/* This is defined in POSIX.1:1996. */
+__STDIO_INLINE int
+getc_unlocked (FILE *__fp)
+{
+ return _IO_getc_unlocked (__fp);
+}
+
+/* This is defined in POSIX.1:1996. */
+__STDIO_INLINE int
+getchar_unlocked (void)
+{
+ return _IO_getc_unlocked (stdin);
+}
+# endif /* POSIX || misc */
+
+
+/* Write a character to stdout. */
+__STDIO_INLINE int
+putchar (int __c)
+{
+ return _IO_putc (__c, stdout);
+}
+
+
+# ifdef __USE_MISC
+/* Faster version when locking is not necessary. */
+__STDIO_INLINE int
+fputc_unlocked (int __c, FILE *__stream)
+{
+ return _IO_putc_unlocked (__c, __stream);
+}
+# endif /* misc */
+
+
+# if defined __USE_POSIX || defined __USE_MISC
+/* This is defined in POSIX.1:1996. */
+__STDIO_INLINE int
+putc_unlocked (int __c, FILE *__stream)
+{
+ return _IO_putc_unlocked (__c, __stream);
+}
+
+/* This is defined in POSIX.1:1996. */
+__STDIO_INLINE int
+putchar_unlocked (int __c)
+{
+ return _IO_putc_unlocked (__c, stdout);
+}
+# endif /* POSIX || misc */
+
+
+# ifdef __USE_GNU
+/* Like `getdelim', but reads up to a newline. */
+__STDIO_INLINE _IO_ssize_t
+getline (char **__lineptr, size_t *__n, FILE *__stream)
+{
+ return __getdelim (__lineptr, __n, '\n', __stream);
+}
+# endif /* GNU */
+
+
+# ifdef __USE_MISC
+/* Faster versions when locking is not required. */
+__STDIO_INLINE int
+__NTH (feof_unlocked (FILE *__stream))
+{
+ return _IO_feof_unlocked (__stream);
+}
+
+/* Faster versions when locking is not required. */
+__STDIO_INLINE int
+__NTH (ferror_unlocked (FILE *__stream))
+{
+ return _IO_ferror_unlocked (__stream);
+}
+# endif /* misc */
+
+#endif /* Use extern inlines. */
+
+
+#if defined __USE_MISC && defined __GNUC__ && defined __OPTIMIZE__ \
+ && !defined __cplusplus
+/* Perform some simple optimizations. */
+# define fread_unlocked(ptr, size, n, stream) \
+ (__extension__ ((__builtin_constant_p (size) && __builtin_constant_p (n) \
+ && (size_t) (size) * (size_t) (n) <= 8 \
+ && (size_t) (size) != 0) \
+ ? ({ char *__ptr = (char *) (ptr); \
+ FILE *__stream = (stream); \
+ size_t __cnt; \
+ for (__cnt = (size_t) (size) * (size_t) (n); \
+ __cnt > 0; --__cnt) \
+ { \
+ int __c = _IO_getc_unlocked (__stream); \
+ if (__c == EOF) \
+ break; \
+ *__ptr++ = __c; \
+ } \
+ ((size_t) (size) * (size_t) (n) - __cnt) \
+ / (size_t) (size); }) \
+ : (((__builtin_constant_p (size) && (size_t) (size) == 0) \
+ || (__builtin_constant_p (n) && (size_t) (n) == 0)) \
+ /* Evaluate all parameters once. */ \
+ ? ((void) (ptr), (void) (stream), (void) (size), \
+ (void) (n), (size_t) 0) \
+ : fread_unlocked (ptr, size, n, stream))))
+
+# define fwrite_unlocked(ptr, size, n, stream) \
+ (__extension__ ((__builtin_constant_p (size) && __builtin_constant_p (n) \
+ && (size_t) (size) * (size_t) (n) <= 8 \
+ && (size_t) (size) != 0) \
+ ? ({ const char *__ptr = (const char *) (ptr); \
+ FILE *__stream = (stream); \
+ size_t __cnt; \
+ for (__cnt = (size_t) (size) * (size_t) (n); \
+ __cnt > 0; --__cnt) \
+ if (_IO_putc_unlocked (*__ptr++, __stream) == EOF) \
+ break; \
+ ((size_t) (size) * (size_t) (n) - __cnt) \
+ / (size_t) (size); }) \
+ : (((__builtin_constant_p (size) && (size_t) (size) == 0) \
+ || (__builtin_constant_p (n) && (size_t) (n) == 0)) \
+ /* Evaluate all parameters once. */ \
+ ? ((void) (ptr), (void) (stream), (void) (size), \
+ (void) (n), (size_t) 0) \
+ : fwrite_unlocked (ptr, size, n, stream))))
+#endif
+
+/* Define helper macro. */
+#undef __STDIO_INLINE
diff --git a/sysroot/usr/include/bits/stdio2.h b/sysroot/usr/include/bits/stdio2.h
new file mode 100644
index 0000000..8889540
--- /dev/null
+++ b/sysroot/usr/include/bits/stdio2.h
@@ -0,0 +1,287 @@
+/* Checking macros for stdio functions.
+ Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _STDIO_H
+# error "Never include <bits/stdio2.h> directly; use <stdio.h> instead."
+#endif
+
+extern int __sprintf_chk (char *__restrict __s, int __flag, size_t __slen,
+ __const char *__restrict __format, ...) __THROW;
+extern int __vsprintf_chk (char *__restrict __s, int __flag, size_t __slen,
+ __const char *__restrict __format,
+ _G_va_list __ap) __THROW;
+
+#ifdef __va_arg_pack
+__extern_always_inline int
+__NTH (sprintf (char *__restrict __s, __const char *__restrict __fmt, ...))
+{
+ return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
+ __bos (__s), __fmt, __va_arg_pack ());
+}
+#elif !defined __cplusplus
+# define sprintf(str, ...) \
+ __builtin___sprintf_chk (str, __USE_FORTIFY_LEVEL - 1, __bos (str), \
+ __VA_ARGS__)
+#endif
+
+__extern_always_inline int
+__NTH (vsprintf (char *__restrict __s, __const char *__restrict __fmt,
+ _G_va_list __ap))
+{
+ return __builtin___vsprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
+ __bos (__s), __fmt, __ap);
+}
+
+#if defined __USE_BSD || defined __USE_ISOC99 || defined __USE_UNIX98
+
+extern int __snprintf_chk (char *__restrict __s, size_t __n, int __flag,
+ size_t __slen, __const char *__restrict __format,
+ ...) __THROW;
+extern int __vsnprintf_chk (char *__restrict __s, size_t __n, int __flag,
+ size_t __slen, __const char *__restrict __format,
+ _G_va_list __ap) __THROW;
+
+# ifdef __va_arg_pack
+__extern_always_inline int
+__NTH (snprintf (char *__restrict __s, size_t __n,
+ __const char *__restrict __fmt, ...))
+{
+ return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
+ __bos (__s), __fmt, __va_arg_pack ());
+}
+# elif !defined __cplusplus
+# define snprintf(str, len, ...) \
+ __builtin___snprintf_chk (str, len, __USE_FORTIFY_LEVEL - 1, __bos (str), \
+ __VA_ARGS__)
+# endif
+
+__extern_always_inline int
+__NTH (vsnprintf (char *__restrict __s, size_t __n,
+ __const char *__restrict __fmt, _G_va_list __ap))
+{
+ return __builtin___vsnprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
+ __bos (__s), __fmt, __ap);
+}
+
+#endif
+
+#if __USE_FORTIFY_LEVEL > 1
+
+extern int __fprintf_chk (FILE *__restrict __stream, int __flag,
+ __const char *__restrict __format, ...);
+extern int __printf_chk (int __flag, __const char *__restrict __format, ...);
+extern int __vfprintf_chk (FILE *__restrict __stream, int __flag,
+ __const char *__restrict __format, _G_va_list __ap);
+extern int __vprintf_chk (int __flag, __const char *__restrict __format,
+ _G_va_list __ap);
+
+# ifdef __va_arg_pack
+__extern_always_inline int
+fprintf (FILE *__restrict __stream, __const char *__restrict __fmt, ...)
+{
+ return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
+ __va_arg_pack ());
+}
+
+__extern_always_inline int
+printf (__const char *__restrict __fmt, ...)
+{
+ return __printf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ());
+}
+# elif !defined __cplusplus
+# define printf(...) \
+ __printf_chk (__USE_FORTIFY_LEVEL - 1, __VA_ARGS__)
+# define fprintf(stream, ...) \
+ __fprintf_chk (stream, __USE_FORTIFY_LEVEL - 1, __VA_ARGS__)
+# endif
+
+__extern_always_inline int
+vprintf (__const char *__restrict __fmt, _G_va_list __ap)
+{
+#ifdef __USE_EXTERN_INLINES
+ return __vfprintf_chk (stdout, __USE_FORTIFY_LEVEL - 1, __fmt, __ap);
+#else
+ return __vprintf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __ap);
+#endif
+}
+
+__extern_always_inline int
+vfprintf (FILE *__restrict __stream,
+ __const char *__restrict __fmt, _G_va_list __ap)
+{
+ return __vfprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt, __ap);
+}
+
+#endif
+
+extern char *__gets_chk (char *__str, size_t) __wur;
+extern char *__REDIRECT (__gets_warn, (char *__str), gets)
+ __wur __warnattr ("please use fgets or getline instead, gets can't "
+ "specify buffer size");
+
+__extern_always_inline __wur char *
+gets (char *__str)
+{
+ if (__bos (__str) != (size_t) -1)
+ return __gets_chk (__str, __bos (__str));
+ return __gets_warn (__str);
+}
+
+extern char *__fgets_chk (char *__restrict __s, size_t __size, int __n,
+ FILE *__restrict __stream) __wur;
+extern char *__REDIRECT (__fgets_alias,
+ (char *__restrict __s, int __n,
+ FILE *__restrict __stream), fgets) __wur;
+extern char *__REDIRECT (__fgets_chk_warn,
+ (char *__restrict __s, size_t __size, int __n,
+ FILE *__restrict __stream), __fgets_chk)
+ __wur __warnattr ("fgets called with bigger size than length "
+ "of destination buffer");
+
+__extern_always_inline __wur char *
+fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
+{
+ if (__bos (__s) != (size_t) -1)
+ {
+ if (!__builtin_constant_p (__n) || __n <= 0)
+ return __fgets_chk (__s, __bos (__s), __n, __stream);
+
+ if ((size_t) __n > __bos (__s))
+ return __fgets_chk_warn (__s, __bos (__s), __n, __stream);
+ }
+ return __fgets_alias (__s, __n, __stream);
+}
+
+extern size_t __fread_chk (void *__restrict __ptr, size_t __ptrlen,
+ size_t __size, size_t __n,
+ FILE *__restrict __stream) __wur;
+extern size_t __REDIRECT (__fread_alias,
+ (void *__restrict __ptr, size_t __size,
+ size_t __n, FILE *__restrict __stream),
+ fread) __wur;
+extern size_t __REDIRECT (__fread_chk_warn,
+ (void *__restrict __ptr, size_t __ptrlen,
+ size_t __size, size_t __n,
+ FILE *__restrict __stream),
+ __fread_chk)
+ __wur __warnattr ("fread called with bigger size * nmemb than length "
+ "of destination buffer");
+
+__extern_always_inline __wur size_t
+fread (void *__restrict __ptr, size_t __size, size_t __n,
+ FILE *__restrict __stream)
+{
+ if (__bos0 (__ptr) != (size_t) -1)
+ {
+ if (!__builtin_constant_p (__size)
+ || !__builtin_constant_p (__n)
+ || (__size | __n) >= (((size_t) 1) << (8 * sizeof (size_t) / 2)))
+ return __fread_chk (__ptr, __bos0 (__ptr), __size, __n, __stream);
+
+ if (__size * __n > __bos0 (__ptr))
+ return __fread_chk_warn (__ptr, __bos0 (__ptr), __size, __n, __stream);
+ }
+ return __fread_alias (__ptr, __size, __n, __stream);
+}
+
+#ifdef __USE_GNU
+extern char *__fgets_unlocked_chk (char *__restrict __s, size_t __size,
+ int __n, FILE *__restrict __stream) __wur;
+extern char *__REDIRECT (__fgets_unlocked_alias,
+ (char *__restrict __s, int __n,
+ FILE *__restrict __stream), fgets_unlocked) __wur;
+extern char *__REDIRECT (__fgets_unlocked_chk_warn,
+ (char *__restrict __s, size_t __size, int __n,
+ FILE *__restrict __stream), __fgets_unlocked_chk)
+ __wur __warnattr ("fgets_unlocked called with bigger size than length "
+ "of destination buffer");
+
+__extern_always_inline __wur char *
+fgets_unlocked (char *__restrict __s, int __n, FILE *__restrict __stream)
+{
+ if (__bos (__s) != (size_t) -1)
+ {
+ if (!__builtin_constant_p (__n) || __n <= 0)
+ return __fgets_unlocked_chk (__s, __bos (__s), __n, __stream);
+
+ if ((size_t) __n > __bos (__s))
+ return __fgets_unlocked_chk_warn (__s, __bos (__s), __n, __stream);
+ }
+ return __fgets_unlocked_alias (__s, __n, __stream);
+}
+#endif
+
+#ifdef __USE_MISC
+# undef fread_unlocked
+extern size_t __fread_unlocked_chk (void *__restrict __ptr, size_t __ptrlen,
+ size_t __size, size_t __n,
+ FILE *__restrict __stream) __wur;
+extern size_t __REDIRECT (__fread_unlocked_alias,
+ (void *__restrict __ptr, size_t __size,
+ size_t __n, FILE *__restrict __stream),
+ fread_unlocked) __wur;
+extern size_t __REDIRECT (__fread_unlocked_chk_warn,
+ (void *__restrict __ptr, size_t __ptrlen,
+ size_t __size, size_t __n,
+ FILE *__restrict __stream),
+ __fread_unlocked_chk)
+ __wur __warnattr ("fread_unlocked called with bigger size * nmemb than "
+ "length of destination buffer");
+
+__extern_always_inline __wur size_t
+fread_unlocked (void *__restrict __ptr, size_t __size, size_t __n,
+ FILE *__restrict __stream)
+{
+ if (__bos0 (__ptr) != (size_t) -1)
+ {
+ if (!__builtin_constant_p (__size)
+ || !__builtin_constant_p (__n)
+ || (__size | __n) >= (((size_t) 1) << (8 * sizeof (size_t) / 2)))
+ return __fread_unlocked_chk (__ptr, __bos0 (__ptr), __size, __n,
+ __stream);
+
+ if (__size * __n > __bos0 (__ptr))
+ return __fread_unlocked_chk_warn (__ptr, __bos0 (__ptr), __size, __n,
+ __stream);
+ }
+
+# ifdef __USE_EXTERN_INLINES
+ if (__builtin_constant_p (__size)
+ && __builtin_constant_p (__n)
+ && (__size | __n) < (((size_t) 1) << (8 * sizeof (size_t) / 2))
+ && __size * __n <= 8)
+ {
+ size_t __cnt = __size * __n;
+ char *__cptr = (char *) __ptr;
+ if (__cnt == 0)
+ return 0;
+
+ for (; __cnt > 0; --__cnt)
+ {
+ int __c = _IO_getc_unlocked (__stream);
+ if (__c == EOF)
+ break;
+ *__cptr++ = __c;
+ }
+ return (__cptr - (char *) __ptr) / __size;
+ }
+# endif
+ return __fread_unlocked_alias (__ptr, __size, __n, __stream);
+}
+#endif
diff --git a/sysroot/usr/include/bits/stdio_lim.h b/sysroot/usr/include/bits/stdio_lim.h
new file mode 100644
index 0000000..309f9d3
--- /dev/null
+++ b/sysroot/usr/include/bits/stdio_lim.h
@@ -0,0 +1,41 @@
+/* Copyright (C) 1994, 1997, 1998, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#if !defined _STDIO_H && !defined __need_FOPEN_MAX && !defined __need_IOV_MAX
+# error "Never include <bits/stdio_lim.h> directly; use <stdio.h> instead."
+#endif
+
+#ifdef _STDIO_H
+# define L_tmpnam 20
+# define TMP_MAX 238328
+# define FILENAME_MAX 4096
+
+# ifdef __USE_POSIX
+# define L_ctermid 9
+# define L_cuserid 9
+# endif
+#endif
+
+#if defined __need_FOPEN_MAX || defined _STDIO_H
+# undef FOPEN_MAX
+# define FOPEN_MAX 16
+#endif
+
+#if defined __need_IOV_MAX && !defined IOV_MAX
+# define IOV_MAX 1024
+#endif
diff --git a/sysroot/usr/include/bits/stdlib-ldbl.h b/sysroot/usr/include/bits/stdlib-ldbl.h
new file mode 100644
index 0000000..d48e1f7
--- /dev/null
+++ b/sysroot/usr/include/bits/stdlib-ldbl.h
@@ -0,0 +1,42 @@
+/* -mlong-double-64 compatibility mode for <stdlib.h> functions.
+ Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _STDLIB_H
+# error "Never include <bits/stdlib-ldbl.h> directly; use <stdlib.h> instead."
+#endif
+
+#ifdef __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+__LDBL_REDIR1_DECL (strtold, strtod)
+__END_NAMESPACE_C99
+#endif
+
+#ifdef __USE_GNU
+__LDBL_REDIR1_DECL (strtold_l, strtod_l)
+#endif
+
+#if defined __USE_SVID || defined __USE_XOPEN_EXTENDED
+# ifdef __USE_MISC
+__LDBL_REDIR1_DECL (qecvt, ecvt)
+__LDBL_REDIR1_DECL (qfcvt, fcvt)
+__LDBL_REDIR1_DECL (qgcvt, gcvt)
+__LDBL_REDIR1_DECL (qecvt_r, ecvt_r)
+__LDBL_REDIR1_DECL (qfcvt_r, fcvt_r)
+# endif
+#endif
diff --git a/sysroot/usr/include/bits/stdlib.h b/sysroot/usr/include/bits/stdlib.h
new file mode 100644
index 0000000..f6af5e5
--- /dev/null
+++ b/sysroot/usr/include/bits/stdlib.h
@@ -0,0 +1,156 @@
+/* Checking macros for stdlib functions.
+ Copyright (C) 2005, 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _STDLIB_H
+# error "Never include <bits/stdlib.h> directly; use <stdlib.h> instead."
+#endif
+
+extern char *__realpath_chk (__const char *__restrict __name,
+ char *__restrict __resolved,
+ size_t __resolvedlen) __THROW __wur;
+extern char *__REDIRECT_NTH (__realpath_alias,
+ (__const char *__restrict __name,
+ char *__restrict __resolved), realpath) __wur;
+extern char *__REDIRECT_NTH (__realpath_chk_warn,
+ (__const char *__restrict __name,
+ char *__restrict __resolved,
+ size_t __resolvedlen), __realpath_chk) __wur
+ __warnattr ("second argument of realpath must be either NULL or at "
+ "least PATH_MAX bytes long buffer");
+
+__extern_always_inline __wur char *
+__NTH (realpath (__const char *__restrict __name, char *__restrict __resolved))
+{
+ if (__bos (__resolved) != (size_t) -1)
+ {
+#if defined _LIBC_LIMITS_H_ && defined PATH_MAX
+ if (__bos (__resolved) < PATH_MAX)
+ return __realpath_chk_warn (__name, __resolved, __bos (__resolved));
+#endif
+ return __realpath_chk (__name, __resolved, __bos (__resolved));
+ }
+
+ return __realpath_alias (__name, __resolved);
+}
+
+
+extern int __ptsname_r_chk (int __fd, char *__buf, size_t __buflen,
+ size_t __nreal) __THROW __nonnull ((2));
+extern int __REDIRECT_NTH (__ptsname_r_alias, (int __fd, char *__buf,
+ size_t __buflen), ptsname_r)
+ __nonnull ((2));
+extern int __REDIRECT_NTH (__ptsname_r_chk_warn,
+ (int __fd, char *__buf, size_t __buflen,
+ size_t __nreal), __ptsname_r_chk)
+ __nonnull ((2)) __warnattr ("ptsname_r called with buflen bigger than "
+ "size of buf");
+
+__extern_always_inline int
+__NTH (ptsname_r (int __fd, char *__buf, size_t __buflen))
+{
+ if (__bos (__buf) != (size_t) -1)
+ {
+ if (!__builtin_constant_p (__buflen))
+ return __ptsname_r_chk (__fd, __buf, __buflen, __bos (__buf));
+ if (__buflen > __bos (__buf))
+ return __ptsname_r_chk_warn (__fd, __buf, __buflen, __bos (__buf));
+ }
+ return __ptsname_r_alias (__fd, __buf, __buflen);
+}
+
+
+extern int __wctomb_chk (char *__s, wchar_t __wchar, size_t __buflen)
+ __THROW __wur;
+extern int __REDIRECT_NTH (__wctomb_alias, (char *__s, wchar_t __wchar),
+ wctomb) __wur;
+
+__extern_always_inline __wur int
+__NTH (wctomb (char *__s, wchar_t __wchar))
+{
+ /* We would have to include <limits.h> to get a definition of MB_LEN_MAX.
+ But this would only disturb the namespace. So we define our own
+ version here. */
+#define __STDLIB_MB_LEN_MAX 16
+#if defined MB_LEN_MAX && MB_LEN_MAX != __STDLIB_MB_LEN_MAX
+# error "Assumed value of MB_LEN_MAX wrong"
+#endif
+ if (__bos (__s) != (size_t) -1 && __STDLIB_MB_LEN_MAX > __bos (__s))
+ return __wctomb_chk (__s, __wchar, __bos (__s));
+ return __wctomb_alias (__s, __wchar);
+}
+
+
+extern size_t __mbstowcs_chk (wchar_t *__restrict __dst,
+ __const char *__restrict __src,
+ size_t __len, size_t __dstlen) __THROW;
+extern size_t __REDIRECT_NTH (__mbstowcs_alias,
+ (wchar_t *__restrict __dst,
+ __const char *__restrict __src,
+ size_t __len), mbstowcs);
+extern size_t __REDIRECT_NTH (__mbstowcs_chk_warn,
+ (wchar_t *__restrict __dst,
+ __const char *__restrict __src,
+ size_t __len, size_t __dstlen), __mbstowcs_chk)
+ __warnattr ("mbstowcs called with dst buffer smaller than len "
+ "* sizeof (wchar_t)");
+
+__extern_always_inline size_t
+__NTH (mbstowcs (wchar_t *__restrict __dst, __const char *__restrict __src,
+ size_t __len))
+{
+ if (__bos (__dst) != (size_t) -1)
+ {
+ if (!__builtin_constant_p (__len))
+ return __mbstowcs_chk (__dst, __src, __len,
+ __bos (__dst) / sizeof (wchar_t));
+
+ if (__len > __bos (__dst) / sizeof (wchar_t))
+ return __mbstowcs_chk_warn (__dst, __src, __len,
+ __bos (__dst) / sizeof (wchar_t));
+ }
+ return __mbstowcs_alias (__dst, __src, __len);
+}
+
+
+extern size_t __wcstombs_chk (char *__restrict __dst,
+ __const wchar_t *__restrict __src,
+ size_t __len, size_t __dstlen) __THROW;
+extern size_t __REDIRECT_NTH (__wcstombs_alias,
+ (char *__restrict __dst,
+ __const wchar_t *__restrict __src,
+ size_t __len), wcstombs);
+extern size_t __REDIRECT_NTH (__wcstombs_chk_warn,
+ (char *__restrict __dst,
+ __const wchar_t *__restrict __src,
+ size_t __len, size_t __dstlen), __wcstombs_chk)
+ __warnattr ("wcstombs called with dst buffer smaller than len");
+
+__extern_always_inline size_t
+__NTH (wcstombs (char *__restrict __dst, __const wchar_t *__restrict __src,
+ size_t __len))
+{
+ if (__bos (__dst) != (size_t) -1)
+ {
+ if (!__builtin_constant_p (__len))
+ return __wcstombs_chk (__dst, __src, __len, __bos (__dst));
+ if (__len > __bos (__dst))
+ return __wcstombs_chk_warn (__dst, __src, __len, __bos (__dst));
+ }
+ return __wcstombs_alias (__dst, __src, __len);
+}
diff --git a/sysroot/usr/include/bits/string.h b/sysroot/usr/include/bits/string.h
new file mode 100644
index 0000000..708ce78
--- /dev/null
+++ b/sysroot/usr/include/bits/string.h
@@ -0,0 +1,26 @@
+/* Optimized, inlined string functions. AMD x86-64 version.
+ Copyright (C) 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _STRING_H
+# error "Never use <bits/string.h> directly; include <string.h> instead."
+#endif
+
+/* Currently the only purpose of this file is to tell the generic inline
+ macros that unaligned memory access is possible for x86-64. */
+#define _STRING_ARCH_unaligned 1
diff --git a/sysroot/usr/include/bits/string2.h b/sysroot/usr/include/bits/string2.h
new file mode 100644
index 0000000..6a18a1a
--- /dev/null
+++ b/sysroot/usr/include/bits/string2.h
@@ -0,0 +1,1355 @@
+/* Machine-independant string function optimizations.
+ Copyright (C) 1997-2003, 2004, 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _STRING_H
+# error "Never use <bits/string2.h> directly; include <string.h> instead."
+#endif
+
+#if !defined __NO_STRING_INLINES && !defined __BOUNDED_POINTERS__
+
+/* Unlike the definitions in the header <bits/string.h> the
+ definitions contained here are not optimized down to assembler
+ level. Those optimizations are not always a good idea since this
+ means the code size increases a lot. Instead the definitions here
+ optimize some functions in a way which do not dramatically
+ increase the code size and which do not use assembler. The main
+ trick is to use GCC's `__builtin_constant_p' function.
+
+ Every function XXX which has a defined version in
+ <bits/string.h> must be accompanied by a symbol _HAVE_STRING_ARCH_XXX
+ to make sure we don't get redefinitions.
+
+ We must use here macros instead of inline functions since the
+ trick won't work with the latter. */
+
+#ifndef __STRING_INLINE
+# ifdef __cplusplus
+# define __STRING_INLINE inline
+# else
+# define __STRING_INLINE __extern_inline
+# endif
+#endif
+
+#if _STRING_ARCH_unaligned
+/* If we can do unaligned memory accesses we must know the endianess. */
+# include <endian.h>
+# include <bits/types.h>
+
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+# define __STRING2_SMALL_GET16(src, idx) \
+ (((__const unsigned char *) (__const char *) (src))[idx + 1] << 8 \
+ | ((__const unsigned char *) (__const char *) (src))[idx])
+# define __STRING2_SMALL_GET32(src, idx) \
+ (((((__const unsigned char *) (__const char *) (src))[idx + 3] << 8 \
+ | ((__const unsigned char *) (__const char *) (src))[idx + 2]) << 8 \
+ | ((__const unsigned char *) (__const char *) (src))[idx + 1]) << 8 \
+ | ((__const unsigned char *) (__const char *) (src))[idx])
+# else
+# define __STRING2_SMALL_GET16(src, idx) \
+ (((__const unsigned char *) (__const char *) (src))[idx] << 8 \
+ | ((__const unsigned char *) (__const char *) (src))[idx + 1])
+# define __STRING2_SMALL_GET32(src, idx) \
+ (((((__const unsigned char *) (__const char *) (src))[idx] << 8 \
+ | ((__const unsigned char *) (__const char *) (src))[idx + 1]) << 8 \
+ | ((__const unsigned char *) (__const char *) (src))[idx + 2]) << 8 \
+ | ((__const unsigned char *) (__const char *) (src))[idx + 3])
+# endif
+#else
+/* These are a few types we need for the optimizations if we cannot
+ use unaligned memory accesses. */
+# define __STRING2_COPY_TYPE(N) \
+ typedef struct { unsigned char __arr[N]; } \
+ __attribute__ ((__packed__)) __STRING2_COPY_ARR##N
+__STRING2_COPY_TYPE (2);
+__STRING2_COPY_TYPE (3);
+__STRING2_COPY_TYPE (4);
+__STRING2_COPY_TYPE (5);
+__STRING2_COPY_TYPE (6);
+__STRING2_COPY_TYPE (7);
+__STRING2_COPY_TYPE (8);
+# undef __STRING2_COPY_TYPE
+#endif
+
+/* Dereferencing a pointer arg to run sizeof on it fails for the void
+ pointer case, so we use this instead.
+ Note that __x is evaluated twice. */
+#define __string2_1bptr_p(__x) \
+ ((size_t)(const void *)((__x) + 1) - (size_t)(const void *)(__x) == 1)
+
+/* Set N bytes of S to C. */
+#if !defined _HAVE_STRING_ARCH_memset
+# if !__GNUC_PREREQ (3, 0)
+# if _STRING_ARCH_unaligned
+# define memset(s, c, n) \
+ (__extension__ (__builtin_constant_p (n) && (n) <= 16 \
+ ? ((n) == 1 \
+ ? __memset_1 (s, c) \
+ : __memset_gc (s, c, n)) \
+ : (__builtin_constant_p (c) && (c) == '\0' \
+ ? ({ void *__s = (s); __bzero (__s, n); __s; }) \
+ : memset (s, c, n))))
+
+# define __memset_1(s, c) ({ void *__s = (s); \
+ *((__uint8_t *) __s) = (__uint8_t) c; __s; })
+
+# define __memset_gc(s, c, n) \
+ ({ void *__s = (s); \
+ union { \
+ unsigned int __ui; \
+ unsigned short int __usi; \
+ unsigned char __uc; \
+ } *__u = __s; \
+ __uint8_t __c = (__uint8_t) (c); \
+ \
+ /* This `switch' statement will be removed at compile-time. */ \
+ switch ((unsigned int) (n)) \
+ { \
+ case 15: \
+ __u->__ui = __c * 0x01010101; \
+ __u = __extension__ ((void *) __u + 4); \
+ case 11: \
+ __u->__ui = __c * 0x01010101; \
+ __u = __extension__ ((void *) __u + 4); \
+ case 7: \
+ __u->__ui = __c * 0x01010101; \
+ __u = __extension__ ((void *) __u + 4); \
+ case 3: \
+ __u->__usi = (unsigned short int) __c * 0x0101; \
+ __u = __extension__ ((void *) __u + 2); \
+ __u->__uc = (unsigned char) __c; \
+ break; \
+ \
+ case 14: \
+ __u->__ui = __c * 0x01010101; \
+ __u = __extension__ ((void *) __u + 4); \
+ case 10: \
+ __u->__ui = __c * 0x01010101; \
+ __u = __extension__ ((void *) __u + 4); \
+ case 6: \
+ __u->__ui = __c * 0x01010101; \
+ __u = __extension__ ((void *) __u + 4); \
+ case 2: \
+ __u->__usi = (unsigned short int) __c * 0x0101; \
+ break; \
+ \
+ case 13: \
+ __u->__ui = __c * 0x01010101; \
+ __u = __extension__ ((void *) __u + 4); \
+ case 9: \
+ __u->__ui = __c * 0x01010101; \
+ __u = __extension__ ((void *) __u + 4); \
+ case 5: \
+ __u->__ui = __c * 0x01010101; \
+ __u = __extension__ ((void *) __u + 4); \
+ case 1: \
+ __u->__uc = (unsigned char) __c; \
+ break; \
+ \
+ case 16: \
+ __u->__ui = __c * 0x01010101; \
+ __u = __extension__ ((void *) __u + 4); \
+ case 12: \
+ __u->__ui = __c * 0x01010101; \
+ __u = __extension__ ((void *) __u + 4); \
+ case 8: \
+ __u->__ui = __c * 0x01010101; \
+ __u = __extension__ ((void *) __u + 4); \
+ case 4: \
+ __u->__ui = __c * 0x01010101; \
+ case 0: \
+ break; \
+ } \
+ \
+ __s; })
+# else
+# define memset(s, c, n) \
+ (__extension__ (__builtin_constant_p (c) && (c) == '\0' \
+ ? ({ void *__s = (s); __bzero (__s, n); __s; }) \
+ : memset (s, c, n)))
+# endif
+# endif
+
+/* GCC < 3.0 optimizes memset(s, 0, n) but not bzero(s, n).
+ The optimization is broken before EGCS 1.1.
+ GCC 3.0+ has __builtin_bzero as well, but at least till GCC 3.4
+ if it decides to call the library function, it calls memset
+ and not bzero. */
+# if __GNUC_PREREQ (2, 91)
+# define __bzero(s, n) __builtin_memset (s, '\0', n)
+# endif
+
+#endif
+
+
+/* Copy N bytes from SRC to DEST, returning pointer to byte following the
+ last copied. */
+#ifdef __USE_GNU
+# if !defined _HAVE_STRING_ARCH_mempcpy || defined _FORCE_INLINES
+# ifndef _HAVE_STRING_ARCH_mempcpy
+# if __GNUC_PREREQ (3, 4)
+# define __mempcpy(dest, src, n) __builtin_mempcpy (dest, src, n)
+# elif __GNUC_PREREQ (3, 0)
+# define __mempcpy(dest, src, n) \
+ (__extension__ (__builtin_constant_p (src) && __builtin_constant_p (n) \
+ && __string2_1bptr_p (src) && n <= 8 \
+ ? __builtin_memcpy (dest, src, n) + (n) \
+ : __mempcpy (dest, src, n)))
+# else
+# define __mempcpy(dest, src, n) \
+ (__extension__ (__builtin_constant_p (src) && __builtin_constant_p (n) \
+ && __string2_1bptr_p (src) && n <= 8 \
+ ? __mempcpy_small (dest, __mempcpy_args (src), n) \
+ : __mempcpy (dest, src, n)))
+# endif
+/* In glibc we use this function frequently but for namespace reasons
+ we have to use the name `__mempcpy'. */
+# define mempcpy(dest, src, n) __mempcpy (dest, src, n)
+# endif
+
+# if !__GNUC_PREREQ (3, 0) || defined _FORCE_INLINES
+# if _STRING_ARCH_unaligned
+# ifndef _FORCE_INLINES
+# define __mempcpy_args(src) \
+ ((__const char *) (src))[0], ((__const char *) (src))[2], \
+ ((__const char *) (src))[4], ((__const char *) (src))[6], \
+ __extension__ __STRING2_SMALL_GET16 (src, 0), \
+ __extension__ __STRING2_SMALL_GET16 (src, 4), \
+ __extension__ __STRING2_SMALL_GET32 (src, 0), \
+ __extension__ __STRING2_SMALL_GET32 (src, 4)
+# endif
+__STRING_INLINE void *__mempcpy_small (void *, char, char, char, char,
+ __uint16_t, __uint16_t, __uint32_t,
+ __uint32_t, size_t);
+__STRING_INLINE void *
+__mempcpy_small (void *__dest1,
+ char __src0_1, char __src2_1, char __src4_1, char __src6_1,
+ __uint16_t __src0_2, __uint16_t __src4_2,
+ __uint32_t __src0_4, __uint32_t __src4_4,
+ size_t __srclen)
+{
+ union {
+ __uint32_t __ui;
+ __uint16_t __usi;
+ unsigned char __uc;
+ unsigned char __c;
+ } *__u = __dest1;
+ switch ((unsigned int) __srclen)
+ {
+ case 1:
+ __u->__c = __src0_1;
+ __u = __extension__ ((void *) __u + 1);
+ break;
+ case 2:
+ __u->__usi = __src0_2;
+ __u = __extension__ ((void *) __u + 2);
+ break;
+ case 3:
+ __u->__usi = __src0_2;
+ __u = __extension__ ((void *) __u + 2);
+ __u->__c = __src2_1;
+ __u = __extension__ ((void *) __u + 1);
+ break;
+ case 4:
+ __u->__ui = __src0_4;
+ __u = __extension__ ((void *) __u + 4);
+ break;
+ case 5:
+ __u->__ui = __src0_4;
+ __u = __extension__ ((void *) __u + 4);
+ __u->__c = __src4_1;
+ __u = __extension__ ((void *) __u + 1);
+ break;
+ case 6:
+ __u->__ui = __src0_4;
+ __u = __extension__ ((void *) __u + 4);
+ __u->__usi = __src4_2;
+ __u = __extension__ ((void *) __u + 2);
+ break;
+ case 7:
+ __u->__ui = __src0_4;
+ __u = __extension__ ((void *) __u + 4);
+ __u->__usi = __src4_2;
+ __u = __extension__ ((void *) __u + 2);
+ __u->__c = __src6_1;
+ __u = __extension__ ((void *) __u + 1);
+ break;
+ case 8:
+ __u->__ui = __src0_4;
+ __u = __extension__ ((void *) __u + 4);
+ __u->__ui = __src4_4;
+ __u = __extension__ ((void *) __u + 4);
+ break;
+ }
+ return (void *) __u;
+}
+# else
+# ifndef _FORCE_INLINES
+# define __mempcpy_args(src) \
+ ((__const char *) (src))[0], \
+ __extension__ ((__STRING2_COPY_ARR2) \
+ { { ((__const char *) (src))[0], ((__const char *) (src))[1] } }), \
+ __extension__ ((__STRING2_COPY_ARR3) \
+ { { ((__const char *) (src))[0], ((__const char *) (src))[1], \
+ ((__const char *) (src))[2] } }), \
+ __extension__ ((__STRING2_COPY_ARR4) \
+ { { ((__const char *) (src))[0], ((__const char *) (src))[1], \
+ ((__const char *) (src))[2], ((__const char *) (src))[3] } }), \
+ __extension__ ((__STRING2_COPY_ARR5) \
+ { { ((__const char *) (src))[0], ((__const char *) (src))[1], \
+ ((__const char *) (src))[2], ((__const char *) (src))[3], \
+ ((__const char *) (src))[4] } }), \
+ __extension__ ((__STRING2_COPY_ARR6) \
+ { { ((__const char *) (src))[0], ((__const char *) (src))[1], \
+ ((__const char *) (src))[2], ((__const char *) (src))[3], \
+ ((__const char *) (src))[4], ((__const char *) (src))[5] } }), \
+ __extension__ ((__STRING2_COPY_ARR7) \
+ { { ((__const char *) (src))[0], ((__const char *) (src))[1], \
+ ((__const char *) (src))[2], ((__const char *) (src))[3], \
+ ((__const char *) (src))[4], ((__const char *) (src))[5], \
+ ((__const char *) (src))[6] } }), \
+ __extension__ ((__STRING2_COPY_ARR8) \
+ { { ((__const char *) (src))[0], ((__const char *) (src))[1], \
+ ((__const char *) (src))[2], ((__const char *) (src))[3], \
+ ((__const char *) (src))[4], ((__const char *) (src))[5], \
+ ((__const char *) (src))[6], ((__const char *) (src))[7] } })
+# endif
+__STRING_INLINE void *__mempcpy_small (void *, char, __STRING2_COPY_ARR2,
+ __STRING2_COPY_ARR3,
+ __STRING2_COPY_ARR4,
+ __STRING2_COPY_ARR5,
+ __STRING2_COPY_ARR6,
+ __STRING2_COPY_ARR7,
+ __STRING2_COPY_ARR8, size_t);
+__STRING_INLINE void *
+__mempcpy_small (void *__dest, char __src1,
+ __STRING2_COPY_ARR2 __src2, __STRING2_COPY_ARR3 __src3,
+ __STRING2_COPY_ARR4 __src4, __STRING2_COPY_ARR5 __src5,
+ __STRING2_COPY_ARR6 __src6, __STRING2_COPY_ARR7 __src7,
+ __STRING2_COPY_ARR8 __src8, size_t __srclen)
+{
+ union {
+ char __c;
+ __STRING2_COPY_ARR2 __sca2;
+ __STRING2_COPY_ARR3 __sca3;
+ __STRING2_COPY_ARR4 __sca4;
+ __STRING2_COPY_ARR5 __sca5;
+ __STRING2_COPY_ARR6 __sca6;
+ __STRING2_COPY_ARR7 __sca7;
+ __STRING2_COPY_ARR8 __sca8;
+ } *__u = __dest;
+ switch ((unsigned int) __srclen)
+ {
+ case 1:
+ __u->__c = __src1;
+ break;
+ case 2:
+ __extension__ __u->__sca2 = __src2;
+ break;
+ case 3:
+ __extension__ __u->__sca3 = __src3;
+ break;
+ case 4:
+ __extension__ __u->__sca4 = __src4;
+ break;
+ case 5:
+ __extension__ __u->__sca5 = __src5;
+ break;
+ case 6:
+ __extension__ __u->__sca6 = __src6;
+ break;
+ case 7:
+ __extension__ __u->__sca7 = __src7;
+ break;
+ case 8:
+ __extension__ __u->__sca8 = __src8;
+ break;
+ }
+ return __extension__ ((void *) __u + __srclen);
+}
+# endif
+# endif
+# endif
+#endif
+
+
+/* Return pointer to C in S. */
+#ifndef _HAVE_STRING_ARCH_strchr
+extern void *__rawmemchr (const void *__s, int __c);
+# if __GNUC_PREREQ (3, 2)
+# define strchr(s, c) \
+ (__extension__ (__builtin_constant_p (c) && !__builtin_constant_p (s) \
+ && (c) == '\0' \
+ ? (char *) __rawmemchr (s, c) \
+ : __builtin_strchr (s, c)))
+# else
+# define strchr(s, c) \
+ (__extension__ (__builtin_constant_p (c) && (c) == '\0' \
+ ? (char *) __rawmemchr (s, c) \
+ : strchr (s, c)))
+# endif
+#endif
+
+
+/* Copy SRC to DEST. */
+#if (!defined _HAVE_STRING_ARCH_strcpy && !__GNUC_PREREQ (3, 0)) \
+ || defined _FORCE_INLINES
+# if !defined _HAVE_STRING_ARCH_strcpy && !__GNUC_PREREQ (3, 0)
+# define strcpy(dest, src) \
+ (__extension__ (__builtin_constant_p (src) \
+ ? (__string2_1bptr_p (src) && strlen (src) + 1 <= 8 \
+ ? __strcpy_small (dest, __strcpy_args (src), \
+ strlen (src) + 1) \
+ : (char *) memcpy (dest, src, strlen (src) + 1)) \
+ : strcpy (dest, src)))
+# endif
+
+# if _STRING_ARCH_unaligned
+# ifndef _FORCE_INLINES
+# define __strcpy_args(src) \
+ __extension__ __STRING2_SMALL_GET16 (src, 0), \
+ __extension__ __STRING2_SMALL_GET16 (src, 4), \
+ __extension__ __STRING2_SMALL_GET32 (src, 0), \
+ __extension__ __STRING2_SMALL_GET32 (src, 4)
+# endif
+__STRING_INLINE char *__strcpy_small (char *, __uint16_t, __uint16_t,
+ __uint32_t, __uint32_t, size_t);
+__STRING_INLINE char *
+__strcpy_small (char *__dest,
+ __uint16_t __src0_2, __uint16_t __src4_2,
+ __uint32_t __src0_4, __uint32_t __src4_4,
+ size_t __srclen)
+{
+ union {
+ __uint32_t __ui;
+ __uint16_t __usi;
+ unsigned char __uc;
+ } *__u = (void *) __dest;
+ switch ((unsigned int) __srclen)
+ {
+ case 1:
+ __u->__uc = '\0';
+ break;
+ case 2:
+ __u->__usi = __src0_2;
+ break;
+ case 3:
+ __u->__usi = __src0_2;
+ __u = __extension__ ((void *) __u + 2);
+ __u->__uc = '\0';
+ break;
+ case 4:
+ __u->__ui = __src0_4;
+ break;
+ case 5:
+ __u->__ui = __src0_4;
+ __u = __extension__ ((void *) __u + 4);
+ __u->__uc = '\0';
+ break;
+ case 6:
+ __u->__ui = __src0_4;
+ __u = __extension__ ((void *) __u + 4);
+ __u->__usi = __src4_2;
+ break;
+ case 7:
+ __u->__ui = __src0_4;
+ __u = __extension__ ((void *) __u + 4);
+ __u->__usi = __src4_2;
+ __u = __extension__ ((void *) __u + 2);
+ __u->__uc = '\0';
+ break;
+ case 8:
+ __u->__ui = __src0_4;
+ __u = __extension__ ((void *) __u + 4);
+ __u->__ui = __src4_4;
+ break;
+ }
+ return __dest;
+}
+# else
+# ifndef _FORCE_INLINES
+# define __strcpy_args(src) \
+ __extension__ ((__STRING2_COPY_ARR2) \
+ { { ((__const char *) (src))[0], '\0' } }), \
+ __extension__ ((__STRING2_COPY_ARR3) \
+ { { ((__const char *) (src))[0], ((__const char *) (src))[1], \
+ '\0' } }), \
+ __extension__ ((__STRING2_COPY_ARR4) \
+ { { ((__const char *) (src))[0], ((__const char *) (src))[1], \
+ ((__const char *) (src))[2], '\0' } }), \
+ __extension__ ((__STRING2_COPY_ARR5) \
+ { { ((__const char *) (src))[0], ((__const char *) (src))[1], \
+ ((__const char *) (src))[2], ((__const char *) (src))[3], \
+ '\0' } }), \
+ __extension__ ((__STRING2_COPY_ARR6) \
+ { { ((__const char *) (src))[0], ((__const char *) (src))[1], \
+ ((__const char *) (src))[2], ((__const char *) (src))[3], \
+ ((__const char *) (src))[4], '\0' } }), \
+ __extension__ ((__STRING2_COPY_ARR7) \
+ { { ((__const char *) (src))[0], ((__const char *) (src))[1], \
+ ((__const char *) (src))[2], ((__const char *) (src))[3], \
+ ((__const char *) (src))[4], ((__const char *) (src))[5], \
+ '\0' } }), \
+ __extension__ ((__STRING2_COPY_ARR8) \
+ { { ((__const char *) (src))[0], ((__const char *) (src))[1], \
+ ((__const char *) (src))[2], ((__const char *) (src))[3], \
+ ((__const char *) (src))[4], ((__const char *) (src))[5], \
+ ((__const char *) (src))[6], '\0' } })
+# endif
+__STRING_INLINE char *__strcpy_small (char *, __STRING2_COPY_ARR2,
+ __STRING2_COPY_ARR3,
+ __STRING2_COPY_ARR4,
+ __STRING2_COPY_ARR5,
+ __STRING2_COPY_ARR6,
+ __STRING2_COPY_ARR7,
+ __STRING2_COPY_ARR8, size_t);
+__STRING_INLINE char *
+__strcpy_small (char *__dest,
+ __STRING2_COPY_ARR2 __src2, __STRING2_COPY_ARR3 __src3,
+ __STRING2_COPY_ARR4 __src4, __STRING2_COPY_ARR5 __src5,
+ __STRING2_COPY_ARR6 __src6, __STRING2_COPY_ARR7 __src7,
+ __STRING2_COPY_ARR8 __src8, size_t __srclen)
+{
+ union {
+ char __c;
+ __STRING2_COPY_ARR2 __sca2;
+ __STRING2_COPY_ARR3 __sca3;
+ __STRING2_COPY_ARR4 __sca4;
+ __STRING2_COPY_ARR5 __sca5;
+ __STRING2_COPY_ARR6 __sca6;
+ __STRING2_COPY_ARR7 __sca7;
+ __STRING2_COPY_ARR8 __sca8;
+ } *__u = (void *) __dest;
+ switch ((unsigned int) __srclen)
+ {
+ case 1:
+ __u->__c = '\0';
+ break;
+ case 2:
+ __extension__ __u->__sca2 = __src2;
+ break;
+ case 3:
+ __extension__ __u->__sca3 = __src3;
+ break;
+ case 4:
+ __extension__ __u->__sca4 = __src4;
+ break;
+ case 5:
+ __extension__ __u->__sca5 = __src5;
+ break;
+ case 6:
+ __extension__ __u->__sca6 = __src6;
+ break;
+ case 7:
+ __extension__ __u->__sca7 = __src7;
+ break;
+ case 8:
+ __extension__ __u->__sca8 = __src8;
+ break;
+ }
+ return __dest;
+}
+# endif
+#endif
+
+
+/* Copy SRC to DEST, returning pointer to final NUL byte. */
+#ifdef __USE_GNU
+# if !defined _HAVE_STRING_ARCH_stpcpy || defined _FORCE_INLINES
+# ifndef _HAVE_STRING_ARCH_stpcpy
+# if __GNUC_PREREQ (3, 4)
+# define __stpcpy(dest, src) __builtin_stpcpy (dest, src)
+# elif __GNUC_PREREQ (3, 0)
+# define __stpcpy(dest, src) \
+ (__extension__ (__builtin_constant_p (src) \
+ ? (__string2_1bptr_p (src) && strlen (src) + 1 <= 8 \
+ ? __builtin_strcpy (dest, src) + strlen (src) \
+ : ((char *) (__mempcpy) (dest, src, strlen (src) + 1) \
+ - 1)) \
+ : __stpcpy (dest, src)))
+# else
+# define __stpcpy(dest, src) \
+ (__extension__ (__builtin_constant_p (src) \
+ ? (__string2_1bptr_p (src) && strlen (src) + 1 <= 8 \
+ ? __stpcpy_small (dest, __stpcpy_args (src), \
+ strlen (src) + 1) \
+ : ((char *) (__mempcpy) (dest, src, strlen (src) + 1) \
+ - 1)) \
+ : __stpcpy (dest, src)))
+# endif
+/* In glibc we use this function frequently but for namespace reasons
+ we have to use the name `__stpcpy'. */
+# define stpcpy(dest, src) __stpcpy (dest, src)
+# endif
+
+# if !__GNUC_PREREQ (3, 0) || defined _FORCE_INLINES
+# if _STRING_ARCH_unaligned
+# ifndef _FORCE_INLINES
+# define __stpcpy_args(src) \
+ __extension__ __STRING2_SMALL_GET16 (src, 0), \
+ __extension__ __STRING2_SMALL_GET16 (src, 4), \
+ __extension__ __STRING2_SMALL_GET32 (src, 0), \
+ __extension__ __STRING2_SMALL_GET32 (src, 4)
+# endif
+__STRING_INLINE char *__stpcpy_small (char *, __uint16_t, __uint16_t,
+ __uint32_t, __uint32_t, size_t);
+__STRING_INLINE char *
+__stpcpy_small (char *__dest,
+ __uint16_t __src0_2, __uint16_t __src4_2,
+ __uint32_t __src0_4, __uint32_t __src4_4,
+ size_t __srclen)
+{
+ union {
+ unsigned int __ui;
+ unsigned short int __usi;
+ unsigned char __uc;
+ char __c;
+ } *__u = (void *) __dest;
+ switch ((unsigned int) __srclen)
+ {
+ case 1:
+ __u->__uc = '\0';
+ break;
+ case 2:
+ __u->__usi = __src0_2;
+ __u = __extension__ ((void *) __u + 1);
+ break;
+ case 3:
+ __u->__usi = __src0_2;
+ __u = __extension__ ((void *) __u + 2);
+ __u->__uc = '\0';
+ break;
+ case 4:
+ __u->__ui = __src0_4;
+ __u = __extension__ ((void *) __u + 3);
+ break;
+ case 5:
+ __u->__ui = __src0_4;
+ __u = __extension__ ((void *) __u + 4);
+ __u->__uc = '\0';
+ break;
+ case 6:
+ __u->__ui = __src0_4;
+ __u = __extension__ ((void *) __u + 4);
+ __u->__usi = __src4_2;
+ __u = __extension__ ((void *) __u + 1);
+ break;
+ case 7:
+ __u->__ui = __src0_4;
+ __u = __extension__ ((void *) __u + 4);
+ __u->__usi = __src4_2;
+ __u = __extension__ ((void *) __u + 2);
+ __u->__uc = '\0';
+ break;
+ case 8:
+ __u->__ui = __src0_4;
+ __u = __extension__ ((void *) __u + 4);
+ __u->__ui = __src4_4;
+ __u = __extension__ ((void *) __u + 3);
+ break;
+ }
+ return &__u->__c;
+}
+# else
+# ifndef _FORCE_INLINES
+# define __stpcpy_args(src) \
+ __extension__ ((__STRING2_COPY_ARR2) \
+ { { ((__const char *) (src))[0], '\0' } }), \
+ __extension__ ((__STRING2_COPY_ARR3) \
+ { { ((__const char *) (src))[0], ((__const char *) (src))[1], \
+ '\0' } }), \
+ __extension__ ((__STRING2_COPY_ARR4) \
+ { { ((__const char *) (src))[0], ((__const char *) (src))[1], \
+ ((__const char *) (src))[2], '\0' } }), \
+ __extension__ ((__STRING2_COPY_ARR5) \
+ { { ((__const char *) (src))[0], ((__const char *) (src))[1], \
+ ((__const char *) (src))[2], ((__const char *) (src))[3], \
+ '\0' } }), \
+ __extension__ ((__STRING2_COPY_ARR6) \
+ { { ((__const char *) (src))[0], ((__const char *) (src))[1], \
+ ((__const char *) (src))[2], ((__const char *) (src))[3], \
+ ((__const char *) (src))[4], '\0' } }), \
+ __extension__ ((__STRING2_COPY_ARR7) \
+ { { ((__const char *) (src))[0], ((__const char *) (src))[1], \
+ ((__const char *) (src))[2], ((__const char *) (src))[3], \
+ ((__const char *) (src))[4], ((__const char *) (src))[5], \
+ '\0' } }), \
+ __extension__ ((__STRING2_COPY_ARR8) \
+ { { ((__const char *) (src))[0], ((__const char *) (src))[1], \
+ ((__const char *) (src))[2], ((__const char *) (src))[3], \
+ ((__const char *) (src))[4], ((__const char *) (src))[5], \
+ ((__const char *) (src))[6], '\0' } })
+# endif
+__STRING_INLINE char *__stpcpy_small (char *, __STRING2_COPY_ARR2,
+ __STRING2_COPY_ARR3,
+ __STRING2_COPY_ARR4,
+ __STRING2_COPY_ARR5,
+ __STRING2_COPY_ARR6,
+ __STRING2_COPY_ARR7,
+ __STRING2_COPY_ARR8, size_t);
+__STRING_INLINE char *
+__stpcpy_small (char *__dest,
+ __STRING2_COPY_ARR2 __src2, __STRING2_COPY_ARR3 __src3,
+ __STRING2_COPY_ARR4 __src4, __STRING2_COPY_ARR5 __src5,
+ __STRING2_COPY_ARR6 __src6, __STRING2_COPY_ARR7 __src7,
+ __STRING2_COPY_ARR8 __src8, size_t __srclen)
+{
+ union {
+ char __c;
+ __STRING2_COPY_ARR2 __sca2;
+ __STRING2_COPY_ARR3 __sca3;
+ __STRING2_COPY_ARR4 __sca4;
+ __STRING2_COPY_ARR5 __sca5;
+ __STRING2_COPY_ARR6 __sca6;
+ __STRING2_COPY_ARR7 __sca7;
+ __STRING2_COPY_ARR8 __sca8;
+ } *__u = (void *) __dest;
+ switch ((unsigned int) __srclen)
+ {
+ case 1:
+ __u->__c = '\0';
+ break;
+ case 2:
+ __extension__ __u->__sca2 = __src2;
+ break;
+ case 3:
+ __extension__ __u->__sca3 = __src3;
+ break;
+ case 4:
+ __extension__ __u->__sca4 = __src4;
+ break;
+ case 5:
+ __extension__ __u->__sca5 = __src5;
+ break;
+ case 6:
+ __extension__ __u->__sca6 = __src6;
+ break;
+ case 7:
+ __extension__ __u->__sca7 = __src7;
+ break;
+ case 8:
+ __extension__ __u->__sca8 = __src8;
+ break;
+ }
+ return __dest + __srclen - 1;
+}
+# endif
+# endif
+# endif
+#endif
+
+
+/* Copy no more than N characters of SRC to DEST. */
+#ifndef _HAVE_STRING_ARCH_strncpy
+# if __GNUC_PREREQ (3, 2)
+# define strncpy(dest, src, n) __builtin_strncpy (dest, src, n)
+# else
+# define strncpy(dest, src, n) \
+ (__extension__ (__builtin_constant_p (src) && __builtin_constant_p (n) \
+ ? (strlen (src) + 1 >= ((size_t) (n)) \
+ ? (char *) memcpy (dest, src, n) \
+ : strncpy (dest, src, n)) \
+ : strncpy (dest, src, n)))
+# endif
+#endif
+
+
+/* Append no more than N characters from SRC onto DEST. */
+#ifndef _HAVE_STRING_ARCH_strncat
+# ifdef _USE_STRING_ARCH_strchr
+# define strncat(dest, src, n) \
+ (__extension__ ({ char *__dest = (dest); \
+ __builtin_constant_p (src) && __builtin_constant_p (n) \
+ ? (strlen (src) < ((size_t) (n)) \
+ ? strcat (__dest, src) \
+ : (*((char *) __mempcpy (strchr (__dest, '\0'), \
+ src, n)) = '\0', __dest)) \
+ : strncat (dest, src, n); }))
+# elif __GNUC_PREREQ (3, 2)
+# define strncat(dest, src, n) __builtin_strncat (dest, src, n)
+# else
+# define strncat(dest, src, n) \
+ (__extension__ (__builtin_constant_p (src) && __builtin_constant_p (n) \
+ ? (strlen (src) < ((size_t) (n)) \
+ ? strcat (dest, src) \
+ : strncat (dest, src, n)) \
+ : strncat (dest, src, n)))
+# endif
+#endif
+
+
+/* Compare characters of S1 and S2. */
+#ifndef _HAVE_STRING_ARCH_strcmp
+# if __GNUC_PREREQ (3, 2)
+# define strcmp(s1, s2) \
+ __extension__ \
+ ({ size_t __s1_len, __s2_len; \
+ (__builtin_constant_p (s1) && __builtin_constant_p (s2) \
+ && (__s1_len = strlen (s1), __s2_len = strlen (s2), \
+ (!__string2_1bptr_p (s1) || __s1_len >= 4) \
+ && (!__string2_1bptr_p (s2) || __s2_len >= 4)) \
+ ? __builtin_strcmp (s1, s2) \
+ : (__builtin_constant_p (s1) && __string2_1bptr_p (s1) \
+ && (__s1_len = strlen (s1), __s1_len < 4) \
+ ? (__builtin_constant_p (s2) && __string2_1bptr_p (s2) \
+ ? __builtin_strcmp (s1, s2) \
+ : __strcmp_cg (s1, s2, __s1_len)) \
+ : (__builtin_constant_p (s2) && __string2_1bptr_p (s2) \
+ && (__s2_len = strlen (s2), __s2_len < 4) \
+ ? (__builtin_constant_p (s1) && __string2_1bptr_p (s1) \
+ ? __builtin_strcmp (s1, s2) \
+ : __strcmp_gc (s1, s2, __s2_len)) \
+ : __builtin_strcmp (s1, s2)))); })
+# else
+# define strcmp(s1, s2) \
+ __extension__ \
+ ({ size_t __s1_len, __s2_len; \
+ (__builtin_constant_p (s1) && __builtin_constant_p (s2) \
+ && (__s1_len = strlen (s1), __s2_len = strlen (s2), \
+ (!__string2_1bptr_p (s1) || __s1_len >= 4) \
+ && (!__string2_1bptr_p (s2) || __s2_len >= 4)) \
+ ? memcmp ((__const char *) (s1), (__const char *) (s2), \
+ (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) \
+ : (__builtin_constant_p (s1) && __string2_1bptr_p (s1) \
+ && (__s1_len = strlen (s1), __s1_len < 4) \
+ ? (__builtin_constant_p (s2) && __string2_1bptr_p (s2) \
+ ? __strcmp_cc (s1, s2, __s1_len) \
+ : __strcmp_cg (s1, s2, __s1_len)) \
+ : (__builtin_constant_p (s2) && __string2_1bptr_p (s2) \
+ && (__s2_len = strlen (s2), __s2_len < 4) \
+ ? (__builtin_constant_p (s1) && __string2_1bptr_p (s1) \
+ ? __strcmp_cc (s1, s2, __s2_len) \
+ : __strcmp_gc (s1, s2, __s2_len)) \
+ : strcmp (s1, s2)))); })
+# endif
+
+# define __strcmp_cc(s1, s2, l) \
+ (__extension__ ({ register int __result = \
+ (((__const unsigned char *) (__const char *) (s1))[0] \
+ - ((__const unsigned char *) (__const char *)(s2))[0]);\
+ if (l > 0 && __result == 0) \
+ { \
+ __result = (((__const unsigned char *) \
+ (__const char *) (s1))[1] \
+ - ((__const unsigned char *) \
+ (__const char *) (s2))[1]); \
+ if (l > 1 && __result == 0) \
+ { \
+ __result = \
+ (((__const unsigned char *) \
+ (__const char *) (s1))[2] \
+ - ((__const unsigned char *) \
+ (__const char *) (s2))[2]); \
+ if (l > 2 && __result == 0) \
+ __result = \
+ (((__const unsigned char *) \
+ (__const char *) (s1))[3] \
+ - ((__const unsigned char *) \
+ (__const char *) (s2))[3]); \
+ } \
+ } \
+ __result; }))
+
+# define __strcmp_cg(s1, s2, l1) \
+ (__extension__ ({ __const unsigned char *__s2 = \
+ (__const unsigned char *) (__const char *) (s2); \
+ register int __result = \
+ (((__const unsigned char *) (__const char *) (s1))[0] \
+ - __s2[0]); \
+ if (l1 > 0 && __result == 0) \
+ { \
+ __result = (((__const unsigned char *) \
+ (__const char *) (s1))[1] - __s2[1]); \
+ if (l1 > 1 && __result == 0) \
+ { \
+ __result = (((__const unsigned char *) \
+ (__const char *) (s1))[2] - __s2[2]);\
+ if (l1 > 2 && __result == 0) \
+ __result = (((__const unsigned char *) \
+ (__const char *) (s1))[3] \
+ - __s2[3]); \
+ } \
+ } \
+ __result; }))
+
+# define __strcmp_gc(s1, s2, l2) \
+ (__extension__ ({ __const unsigned char *__s1 = \
+ (__const unsigned char *) (__const char *) (s1); \
+ register int __result = \
+ __s1[0] - ((__const unsigned char *) \
+ (__const char *) (s2))[0]; \
+ if (l2 > 0 && __result == 0) \
+ { \
+ __result = (__s1[1] \
+ - ((__const unsigned char *) \
+ (__const char *) (s2))[1]); \
+ if (l2 > 1 && __result == 0) \
+ { \
+ __result = \
+ (__s1[2] - ((__const unsigned char *) \
+ (__const char *) (s2))[2]); \
+ if (l2 > 2 && __result == 0) \
+ __result = \
+ (__s1[3] \
+ - ((__const unsigned char *) \
+ (__const char *) (s2))[3]); \
+ } \
+ } \
+ __result; }))
+#endif
+
+
+/* Compare N characters of S1 and S2. */
+#ifndef _HAVE_STRING_ARCH_strncmp
+# define strncmp(s1, s2, n) \
+ (__extension__ (__builtin_constant_p (n) \
+ && ((__builtin_constant_p (s1) \
+ && strlen (s1) < ((size_t) (n))) \
+ || (__builtin_constant_p (s2) \
+ && strlen (s2) < ((size_t) (n)))) \
+ ? strcmp (s1, s2) : strncmp (s1, s2, n)))
+#endif
+
+
+/* Return the length of the initial segment of S which
+ consists entirely of characters not in REJECT. */
+#if !defined _HAVE_STRING_ARCH_strcspn || defined _FORCE_INLINES
+# ifndef _HAVE_STRING_ARCH_strcspn
+# if __GNUC_PREREQ (3, 2)
+# define strcspn(s, reject) \
+ __extension__ \
+ ({ char __r0, __r1, __r2; \
+ (__builtin_constant_p (reject) && __string2_1bptr_p (reject) \
+ ? ((__builtin_constant_p (s) && __string2_1bptr_p (s)) \
+ ? __builtin_strcspn (s, reject) \
+ : ((__r0 = ((__const char *) (reject))[0], __r0 == '\0') \
+ ? strlen (s) \
+ : ((__r1 = ((__const char *) (reject))[1], __r1 == '\0') \
+ ? __strcspn_c1 (s, __r0) \
+ : ((__r2 = ((__const char *) (reject))[2], __r2 == '\0') \
+ ? __strcspn_c2 (s, __r0, __r1) \
+ : (((__const char *) (reject))[3] == '\0' \
+ ? __strcspn_c3 (s, __r0, __r1, __r2) \
+ : __builtin_strcspn (s, reject)))))) \
+ : __builtin_strcspn (s, reject)); })
+# else
+# define strcspn(s, reject) \
+ __extension__ \
+ ({ char __r0, __r1, __r2; \
+ (__builtin_constant_p (reject) && __string2_1bptr_p (reject) \
+ ? ((__r0 = ((__const char *) (reject))[0], __r0 == '\0') \
+ ? strlen (s) \
+ : ((__r1 = ((__const char *) (reject))[1], __r1 == '\0') \
+ ? __strcspn_c1 (s, __r0) \
+ : ((__r2 = ((__const char *) (reject))[2], __r2 == '\0') \
+ ? __strcspn_c2 (s, __r0, __r1) \
+ : (((__const char *) (reject))[3] == '\0' \
+ ? __strcspn_c3 (s, __r0, __r1, __r2) \
+ : strcspn (s, reject))))) \
+ : strcspn (s, reject)); })
+# endif
+# endif
+
+__STRING_INLINE size_t __strcspn_c1 (__const char *__s, int __reject);
+__STRING_INLINE size_t
+__strcspn_c1 (__const char *__s, int __reject)
+{
+ register size_t __result = 0;
+ while (__s[__result] != '\0' && __s[__result] != __reject)
+ ++__result;
+ return __result;
+}
+
+__STRING_INLINE size_t __strcspn_c2 (__const char *__s, int __reject1,
+ int __reject2);
+__STRING_INLINE size_t
+__strcspn_c2 (__const char *__s, int __reject1, int __reject2)
+{
+ register size_t __result = 0;
+ while (__s[__result] != '\0' && __s[__result] != __reject1
+ && __s[__result] != __reject2)
+ ++__result;
+ return __result;
+}
+
+__STRING_INLINE size_t __strcspn_c3 (__const char *__s, int __reject1,
+ int __reject2, int __reject3);
+__STRING_INLINE size_t
+__strcspn_c3 (__const char *__s, int __reject1, int __reject2,
+ int __reject3)
+{
+ register size_t __result = 0;
+ while (__s[__result] != '\0' && __s[__result] != __reject1
+ && __s[__result] != __reject2 && __s[__result] != __reject3)
+ ++__result;
+ return __result;
+}
+#endif
+
+
+/* Return the length of the initial segment of S which
+ consists entirely of characters in ACCEPT. */
+#if !defined _HAVE_STRING_ARCH_strspn || defined _FORCE_INLINES
+# ifndef _HAVE_STRING_ARCH_strspn
+# if __GNUC_PREREQ (3, 2)
+# define strspn(s, accept) \
+ __extension__ \
+ ({ char __a0, __a1, __a2; \
+ (__builtin_constant_p (accept) && __string2_1bptr_p (accept) \
+ ? ((__builtin_constant_p (s) && __string2_1bptr_p (s)) \
+ ? __builtin_strspn (s, accept) \
+ : ((__a0 = ((__const char *) (accept))[0], __a0 == '\0') \
+ ? ((void) (s), 0) \
+ : ((__a1 = ((__const char *) (accept))[1], __a1 == '\0') \
+ ? __strspn_c1 (s, __a0) \
+ : ((__a2 = ((__const char *) (accept))[2], __a2 == '\0') \
+ ? __strspn_c2 (s, __a0, __a1) \
+ : (((__const char *) (accept))[3] == '\0' \
+ ? __strspn_c3 (s, __a0, __a1, __a2) \
+ : __builtin_strspn (s, accept)))))) \
+ : __builtin_strspn (s, accept)); })
+# else
+# define strspn(s, accept) \
+ __extension__ \
+ ({ char __a0, __a1, __a2; \
+ (__builtin_constant_p (accept) && __string2_1bptr_p (accept) \
+ ? ((__a0 = ((__const char *) (accept))[0], __a0 == '\0') \
+ ? ((void) (s), 0) \
+ : ((__a1 = ((__const char *) (accept))[1], __a1 == '\0') \
+ ? __strspn_c1 (s, __a0) \
+ : ((__a2 = ((__const char *) (accept))[2], __a2 == '\0') \
+ ? __strspn_c2 (s, __a0, __a1) \
+ : (((__const char *) (accept))[3] == '\0' \
+ ? __strspn_c3 (s, __a0, __a1, __a2) \
+ : strspn (s, accept))))) \
+ : strspn (s, accept)); })
+# endif
+# endif
+
+__STRING_INLINE size_t __strspn_c1 (__const char *__s, int __accept);
+__STRING_INLINE size_t
+__strspn_c1 (__const char *__s, int __accept)
+{
+ register size_t __result = 0;
+ /* Please note that __accept never can be '\0'. */
+ while (__s[__result] == __accept)
+ ++__result;
+ return __result;
+}
+
+__STRING_INLINE size_t __strspn_c2 (__const char *__s, int __accept1,
+ int __accept2);
+__STRING_INLINE size_t
+__strspn_c2 (__const char *__s, int __accept1, int __accept2)
+{
+ register size_t __result = 0;
+ /* Please note that __accept1 and __accept2 never can be '\0'. */
+ while (__s[__result] == __accept1 || __s[__result] == __accept2)
+ ++__result;
+ return __result;
+}
+
+__STRING_INLINE size_t __strspn_c3 (__const char *__s, int __accept1,
+ int __accept2, int __accept3);
+__STRING_INLINE size_t
+__strspn_c3 (__const char *__s, int __accept1, int __accept2, int __accept3)
+{
+ register size_t __result = 0;
+ /* Please note that __accept1 to __accept3 never can be '\0'. */
+ while (__s[__result] == __accept1 || __s[__result] == __accept2
+ || __s[__result] == __accept3)
+ ++__result;
+ return __result;
+}
+#endif
+
+
+/* Find the first occurrence in S of any character in ACCEPT. */
+#if !defined _HAVE_STRING_ARCH_strpbrk || defined _FORCE_INLINES
+# ifndef _HAVE_STRING_ARCH_strpbrk
+# if __GNUC_PREREQ (3, 2)
+# define strpbrk(s, accept) \
+ __extension__ \
+ ({ char __a0, __a1, __a2; \
+ (__builtin_constant_p (accept) && __string2_1bptr_p (accept) \
+ ? ((__builtin_constant_p (s) && __string2_1bptr_p (s)) \
+ ? __builtin_strpbrk (s, accept) \
+ : ((__a0 = ((__const char *) (accept))[0], __a0 == '\0') \
+ ? ((void) (s), (char *) NULL) \
+ : ((__a1 = ((__const char *) (accept))[1], __a1 == '\0') \
+ ? __builtin_strchr (s, __a0) \
+ : ((__a2 = ((__const char *) (accept))[2], __a2 == '\0') \
+ ? __strpbrk_c2 (s, __a0, __a1) \
+ : (((__const char *) (accept))[3] == '\0' \
+ ? __strpbrk_c3 (s, __a0, __a1, __a2) \
+ : __builtin_strpbrk (s, accept)))))) \
+ : __builtin_strpbrk (s, accept)); })
+# else
+# define strpbrk(s, accept) \
+ __extension__ \
+ ({ char __a0, __a1, __a2; \
+ (__builtin_constant_p (accept) && __string2_1bptr_p (accept) \
+ ? ((__a0 = ((__const char *) (accept))[0], __a0 == '\0') \
+ ? ((void) (s), (char *) NULL) \
+ : ((__a1 = ((__const char *) (accept))[1], __a1 == '\0') \
+ ? strchr (s, __a0) \
+ : ((__a2 = ((__const char *) (accept))[2], __a2 == '\0') \
+ ? __strpbrk_c2 (s, __a0, __a1) \
+ : (((__const char *) (accept))[3] == '\0' \
+ ? __strpbrk_c3 (s, __a0, __a1, __a2) \
+ : strpbrk (s, accept))))) \
+ : strpbrk (s, accept)); })
+# endif
+# endif
+
+__STRING_INLINE char *__strpbrk_c2 (__const char *__s, int __accept1,
+ int __accept2);
+__STRING_INLINE char *
+__strpbrk_c2 (__const char *__s, int __accept1, int __accept2)
+{
+ /* Please note that __accept1 and __accept2 never can be '\0'. */
+ while (*__s != '\0' && *__s != __accept1 && *__s != __accept2)
+ ++__s;
+ return *__s == '\0' ? NULL : (char *) (size_t) __s;
+}
+
+__STRING_INLINE char *__strpbrk_c3 (__const char *__s, int __accept1,
+ int __accept2, int __accept3);
+__STRING_INLINE char *
+__strpbrk_c3 (__const char *__s, int __accept1, int __accept2,
+ int __accept3)
+{
+ /* Please note that __accept1 to __accept3 never can be '\0'. */
+ while (*__s != '\0' && *__s != __accept1 && *__s != __accept2
+ && *__s != __accept3)
+ ++__s;
+ return *__s == '\0' ? NULL : (char *) (size_t) __s;
+}
+#endif
+
+
+/* Find the first occurrence of NEEDLE in HAYSTACK. Newer gcc versions
+ do this itself. */
+#if !defined _HAVE_STRING_ARCH_strstr && !__GNUC_PREREQ (2, 97)
+# define strstr(haystack, needle) \
+ (__extension__ (__builtin_constant_p (needle) && __string2_1bptr_p (needle) \
+ ? (((__const char *) (needle))[0] == '\0' \
+ ? (char *) (size_t) (haystack) \
+ : (((__const char *) (needle))[1] == '\0' \
+ ? strchr (haystack, \
+ ((__const char *) (needle))[0]) \
+ : strstr (haystack, needle))) \
+ : strstr (haystack, needle)))
+#endif
+
+
+#if !defined _HAVE_STRING_ARCH_strtok_r || defined _FORCE_INLINES
+# ifndef _HAVE_STRING_ARCH_strtok_r
+# define __strtok_r(s, sep, nextp) \
+ (__extension__ (__builtin_constant_p (sep) && __string2_1bptr_p (sep) \
+ ? (((__const char *) (sep))[0] != '\0' \
+ && ((__const char *) (sep))[1] == '\0' \
+ ? __strtok_r_1c (s, ((__const char *) (sep))[0], nextp) \
+ : __strtok_r (s, sep, nextp)) \
+ : __strtok_r (s, sep, nextp)))
+# endif
+
+__STRING_INLINE char *__strtok_r_1c (char *__s, char __sep, char **__nextp);
+__STRING_INLINE char *
+__strtok_r_1c (char *__s, char __sep, char **__nextp)
+{
+ char *__result;
+ if (__s == NULL)
+ __s = *__nextp;
+ while (*__s == __sep)
+ ++__s;
+ __result = NULL;
+ if (*__s != '\0')
+ {
+ __result = __s++;
+ while (*__s != '\0')
+ if (*__s++ == __sep)
+ {
+ __s[-1] = '\0';
+ break;
+ }
+ *__nextp = __s;
+ }
+ return __result;
+}
+# if defined __USE_POSIX || defined __USE_MISC
+# define strtok_r(s, sep, nextp) __strtok_r (s, sep, nextp)
+# endif
+#endif
+
+
+#if !defined _HAVE_STRING_ARCH_strsep || defined _FORCE_INLINES
+# ifndef _HAVE_STRING_ARCH_strsep
+
+extern char *__strsep_g (char **__stringp, __const char *__delim);
+# define __strsep(s, reject) \
+ __extension__ \
+ ({ char __r0, __r1, __r2; \
+ (__builtin_constant_p (reject) && __string2_1bptr_p (reject) \
+ && (__r0 = ((__const char *) (reject))[0], \
+ ((__const char *) (reject))[0] != '\0') \
+ ? ((__r1 = ((__const char *) (reject))[1], \
+ ((__const char *) (reject))[1] == '\0') \
+ ? __strsep_1c (s, __r0) \
+ : ((__r2 = ((__const char *) (reject))[2], __r2 == '\0') \
+ ? __strsep_2c (s, __r0, __r1) \
+ : (((__const char *) (reject))[3] == '\0' \
+ ? __strsep_3c (s, __r0, __r1, __r2) \
+ : __strsep_g (s, reject)))) \
+ : __strsep_g (s, reject)); })
+# endif
+
+__STRING_INLINE char *__strsep_1c (char **__s, char __reject);
+__STRING_INLINE char *
+__strsep_1c (char **__s, char __reject)
+{
+ register char *__retval = *__s;
+ if (__retval != NULL && (*__s = strchr (__retval, __reject)) != NULL)
+ *(*__s)++ = '\0';
+ return __retval;
+}
+
+__STRING_INLINE char *__strsep_2c (char **__s, char __reject1, char __reject2);
+__STRING_INLINE char *
+__strsep_2c (char **__s, char __reject1, char __reject2)
+{
+ register char *__retval = *__s;
+ if (__retval != NULL)
+ {
+ register char *__cp = __retval;
+ while (1)
+ {
+ if (*__cp == '\0')
+ {
+ __cp = NULL;
+ break;
+ }
+ if (*__cp == __reject1 || *__cp == __reject2)
+ {
+ *__cp++ = '\0';
+ break;
+ }
+ ++__cp;
+ }
+ *__s = __cp;
+ }
+ return __retval;
+}
+
+__STRING_INLINE char *__strsep_3c (char **__s, char __reject1, char __reject2,
+ char __reject3);
+__STRING_INLINE char *
+__strsep_3c (char **__s, char __reject1, char __reject2, char __reject3)
+{
+ register char *__retval = *__s;
+ if (__retval != NULL)
+ {
+ register char *__cp = __retval;
+ while (1)
+ {
+ if (*__cp == '\0')
+ {
+ __cp = NULL;
+ break;
+ }
+ if (*__cp == __reject1 || *__cp == __reject2 || *__cp == __reject3)
+ {
+ *__cp++ = '\0';
+ break;
+ }
+ ++__cp;
+ }
+ *__s = __cp;
+ }
+ return __retval;
+}
+# ifdef __USE_BSD
+# define strsep(s, reject) __strsep (s, reject)
+# endif
+#endif
+
+/* We need the memory allocation functions for inline strdup().
+ Referring to stdlib.h (even minimally) is not allowed
+ in any of the tight standards compliant modes. */
+#ifdef __USE_MISC
+
+# if !defined _HAVE_STRING_ARCH_strdup || !defined _HAVE_STRING_ARCH_strndup
+# define __need_malloc_and_calloc
+# include <stdlib.h>
+# endif
+
+# ifndef _HAVE_STRING_ARCH_strdup
+
+extern char *__strdup (__const char *__string) __THROW __attribute_malloc__;
+# define __strdup(s) \
+ (__extension__ (__builtin_constant_p (s) && __string2_1bptr_p (s) \
+ ? (((__const char *) (s))[0] == '\0' \
+ ? (char *) calloc ((size_t) 1, (size_t) 1) \
+ : ({ size_t __len = strlen (s) + 1; \
+ char *__retval = (char *) malloc (__len); \
+ if (__retval != NULL) \
+ __retval = (char *) memcpy (__retval, s, __len); \
+ __retval; })) \
+ : __strdup (s)))
+
+# if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+# define strdup(s) __strdup (s)
+# endif
+# endif
+
+# ifndef _HAVE_STRING_ARCH_strndup
+
+extern char *__strndup (__const char *__string, size_t __n)
+ __THROW __attribute_malloc__;
+# define __strndup(s, n) \
+ (__extension__ (__builtin_constant_p (s) && __string2_1bptr_p (s) \
+ ? (((__const char *) (s))[0] == '\0' \
+ ? (char *) calloc ((size_t) 1, (size_t) 1) \
+ : ({ size_t __len = strlen (s) + 1; \
+ size_t __n = (n); \
+ char *__retval; \
+ if (__n < __len) \
+ __len = __n + 1; \
+ __retval = (char *) malloc (__len); \
+ if (__retval != NULL) \
+ { \
+ __retval[__len - 1] = '\0'; \
+ __retval = (char *) memcpy (__retval, s, \
+ __len - 1); \
+ } \
+ __retval; })) \
+ : __strndup (s, n)))
+
+# ifdef __USE_GNU
+# define strndup(s, n) __strndup (s, n)
+# endif
+# endif
+
+#endif /* Use misc. or use GNU. */
+
+#ifndef _FORCE_INLINES
+# undef __STRING_INLINE
+#endif
+
+#endif /* No string inlines. */
diff --git a/sysroot/usr/include/bits/string3.h b/sysroot/usr/include/bits/string3.h
new file mode 100644
index 0000000..a5593e3
--- /dev/null
+++ b/sysroot/usr/include/bits/string3.h
@@ -0,0 +1,154 @@
+/* Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _STRING_H
+# error "Never use <bits/string3.h> directly; include <string.h> instead."
+#endif
+
+__warndecl (__warn_memset_zero_len,
+ "memset used with constant zero length parameter; this could be due to transposed parameters");
+
+#ifndef __cplusplus
+/* XXX This is temporarily. We should not redefine any of the symbols
+ and instead integrate the error checking into the original
+ definitions. */
+# undef memcpy
+# undef memmove
+# undef memset
+# undef strcat
+# undef strcpy
+# undef strncat
+# undef strncpy
+# ifdef __USE_GNU
+# undef mempcpy
+# undef stpcpy
+# endif
+# ifdef __USE_BSD
+# undef bcopy
+# undef bzero
+# endif
+#endif
+
+
+__extern_always_inline void *
+__NTH (memcpy (void *__restrict __dest, __const void *__restrict __src,
+ size_t __len))
+{
+ return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
+}
+
+__extern_always_inline void *
+__NTH (memmove (void *__restrict __dest, __const void *__restrict __src,
+ size_t __len))
+{
+ return __builtin___memmove_chk (__dest, __src, __len, __bos0 (__dest));
+}
+
+#ifdef __USE_GNU
+__extern_always_inline void *
+__NTH (mempcpy (void *__restrict __dest, __const void *__restrict __src,
+ size_t __len))
+{
+ return __builtin___mempcpy_chk (__dest, __src, __len, __bos0 (__dest));
+}
+#endif
+
+
+/* The first two tests here help to catch a somewhat common problem
+ where the second and third parameter are transposed. This is
+ especially problematic if the intended fill value is zero. In this
+ case no work is done at all. We detect these problems by referring
+ non-existing functions. */
+__extern_always_inline void *
+__NTH (memset (void *__dest, int __ch, size_t __len))
+{
+ if (__builtin_constant_p (__len) && __len == 0)
+ {
+ __warn_memset_zero_len ();
+ return __dest;
+ }
+ return __builtin___memset_chk (__dest, __ch, __len, __bos0 (__dest));
+}
+
+#ifdef __USE_BSD
+__extern_always_inline void
+__NTH (bcopy (__const void *__restrict __src, void *__restrict __dest,
+ size_t __len))
+{
+ (void) __builtin___memmove_chk (__dest, __src, __len, __bos0 (__dest));
+}
+
+__extern_always_inline void
+__NTH (bzero (void *__dest, size_t __len))
+{
+ (void) __builtin___memset_chk (__dest, '\0', __len, __bos0 (__dest));
+}
+#endif
+
+__extern_always_inline char *
+__NTH (strcpy (char *__restrict __dest, __const char *__restrict __src))
+{
+ return __builtin___strcpy_chk (__dest, __src, __bos (__dest));
+}
+
+#ifdef __USE_GNU
+__extern_always_inline char *
+__NTH (stpcpy (char *__restrict __dest, __const char *__restrict __src))
+{
+ return __builtin___stpcpy_chk (__dest, __src, __bos (__dest));
+}
+#endif
+
+
+__extern_always_inline char *
+__NTH (strncpy (char *__restrict __dest, __const char *__restrict __src,
+ size_t __len))
+{
+ return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
+}
+
+// XXX We have no corresponding builtin yet.
+extern char *__stpncpy_chk (char *__dest, __const char *__src, size_t __n,
+ size_t __destlen) __THROW;
+extern char *__REDIRECT_NTH (__stpncpy_alias, (char *__dest,
+ __const char *__src,
+ size_t __n), stpncpy);
+
+__extern_always_inline char *
+__NTH (stpncpy (char *__dest, __const char *__src, size_t __n))
+{
+ if (__bos (__dest) != (size_t) -1
+ && (!__builtin_constant_p (__n) || __n <= __bos (__dest)))
+ return __stpncpy_chk (__dest, __src, __n, __bos (__dest));
+ return __stpncpy_alias (__dest, __src, __n);
+}
+
+
+__extern_always_inline char *
+__NTH (strcat (char *__restrict __dest, __const char *__restrict __src))
+{
+ return __builtin___strcat_chk (__dest, __src, __bos (__dest));
+}
+
+
+__extern_always_inline char *
+__NTH (strncat (char *__restrict __dest, __const char *__restrict __src,
+ size_t __len))
+{
+ return __builtin___strncat_chk (__dest, __src, __len, __bos (__dest));
+}
diff --git a/sysroot/usr/include/bits/stropts.h b/sysroot/usr/include/bits/stropts.h
new file mode 100644
index 0000000..c8e2c2c
--- /dev/null
+++ b/sysroot/usr/include/bits/stropts.h
@@ -0,0 +1,231 @@
+/* Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _STROPTS_H
+# error "Never include <bits/stropts.h> directly; use <stropts.h> instead."
+#endif
+
+#ifndef _BITS_STROPTS_H
+#define _BITS_STROPTS_H 1
+
+#include <bits/types.h>
+
+/* Macros used as `request' argument to `ioctl'. */
+#define __SID ('S' << 8)
+
+#define I_NREAD (__SID | 1) /* Counts the number of data bytes in the data
+ block in the first message. */
+#define I_PUSH (__SID | 2) /* Push STREAMS module onto top of the current
+ STREAM, just below the STREAM head. */
+#define I_POP (__SID | 3) /* Remove STREAMS module from just below the
+ STREAM head. */
+#define I_LOOK (__SID | 4) /* Retrieve the name of the module just below
+ the STREAM head and place it in a character
+ string. */
+#define I_FLUSH (__SID | 5) /* Flush all input and/or output. */
+#define I_SRDOPT (__SID | 6) /* Sets the read mode. */
+#define I_GRDOPT (__SID | 7) /* Returns the current read mode setting. */
+#define I_STR (__SID | 8) /* Construct an internal STREAMS `ioctl'
+ message and send that message downstream. */
+#define I_SETSIG (__SID | 9) /* Inform the STREAM head that the process
+ wants the SIGPOLL signal issued. */
+#define I_GETSIG (__SID |10) /* Return the events for which the calling
+ process is currently registered to be sent
+ a SIGPOLL signal. */
+#define I_FIND (__SID |11) /* Compares the names of all modules currently
+ present in the STREAM to the name pointed to
+ by `arg'. */
+#define I_LINK (__SID |12) /* Connect two STREAMs. */
+#define I_UNLINK (__SID |13) /* Disconnects the two STREAMs. */
+#define I_PEEK (__SID |15) /* Allows a process to retrieve the information
+ in the first message on the STREAM head read
+ queue without taking the message off the
+ queue. */
+#define I_FDINSERT (__SID |16) /* Create a message from the specified
+ buffer(s), adds information about another
+ STREAM, and send the message downstream. */
+#define I_SENDFD (__SID |17) /* Requests the STREAM associated with `fildes'
+ to send a message, containing a file
+ pointer, to the STREAM head at the other end
+ of a STREAMS pipe. */
+#define I_RECVFD (__SID |14) /* Non-EFT definition. */
+#define I_SWROPT (__SID |19) /* Set the write mode. */
+#define I_GWROPT (__SID |20) /* Return the current write mode setting. */
+#define I_LIST (__SID |21) /* List all the module names on the STREAM, up
+ to and including the topmost driver name. */
+#define I_PLINK (__SID |22) /* Connect two STREAMs with a persistent
+ link. */
+#define I_PUNLINK (__SID |23) /* Disconnect the two STREAMs that were
+ connected with a persistent link. */
+#define I_FLUSHBAND (__SID |28) /* Flush only band specified. */
+#define I_CKBAND (__SID |29) /* Check if the message of a given priority
+ band exists on the STREAM head read
+ queue. */
+#define I_GETBAND (__SID |30) /* Return the priority band of the first
+ message on the STREAM head read queue. */
+#define I_ATMARK (__SID |31) /* See if the current message on the STREAM
+ head read queue is "marked" by some module
+ downstream. */
+#define I_SETCLTIME (__SID |32) /* Set the time the STREAM head will delay when
+ a STREAM is closing and there is data on
+ the write queues. */
+#define I_GETCLTIME (__SID |33) /* Get current value for closing timeout. */
+#define I_CANPUT (__SID |34) /* Check if a certain band is writable. */
+
+
+/* Used in `I_LOOK' request. */
+#define FMNAMESZ 8 /* compatibility w/UnixWare/Solaris. */
+
+/* Flush options. */
+#define FLUSHR 0x01 /* Flush read queues. */
+#define FLUSHW 0x02 /* Flush write queues. */
+#define FLUSHRW 0x03 /* Flush read and write queues. */
+#ifdef __USE_GNU
+# define FLUSHBAND 0x04 /* Flush only specified band. */
+#endif
+
+/* Possible arguments for `I_SETSIG'. */
+#define S_INPUT 0x0001 /* A message, other than a high-priority
+ message, has arrived. */
+#define S_HIPRI 0x0002 /* A high-priority message is present. */
+#define S_OUTPUT 0x0004 /* The write queue for normal data is no longer
+ full. */
+#define S_MSG 0x0008 /* A STREAMS signal message that contains the
+ SIGPOLL signal reaches the front of the
+ STREAM head read queue. */
+#define S_ERROR 0x0010 /* Notification of an error condition. */
+#define S_HANGUP 0x0020 /* Notification of a hangup. */
+#define S_RDNORM 0x0040 /* A normal message has arrived. */
+#define S_WRNORM S_OUTPUT
+#define S_RDBAND 0x0080 /* A message with a non-zero priority has
+ arrived. */
+#define S_WRBAND 0x0100 /* The write queue for a non-zero priority
+ band is no longer full. */
+#define S_BANDURG 0x0200 /* When used in conjunction with S_RDBAND,
+ SIGURG is generated instead of SIGPOLL when
+ a priority message reaches the front of the
+ STREAM head read queue. */
+
+/* Option for `I_PEEK'. */
+#define RS_HIPRI 0x01 /* Only look for high-priority messages. */
+
+/* Options for `I_SRDOPT'. */
+#define RNORM 0x0000 /* Byte-STREAM mode, the default. */
+#define RMSGD 0x0001 /* Message-discard mode. */
+#define RMSGN 0x0002 /* Message-nondiscard mode. */
+#define RPROTDAT 0x0004 /* Deliver the control part of a message as
+ data. */
+#define RPROTDIS 0x0008 /* Discard the control part of a message,
+ delivering any data part. */
+#define RPROTNORM 0x0010 /* Fail `read' with EBADMSG if a message
+ containing a control part is at the front
+ of the STREAM head read queue. */
+#ifdef __USE_GNU
+# define RPROTMASK 0x001C /* The RPROT bits */
+#endif
+
+/* Possible mode for `I_SWROPT'. */
+#define SNDZERO 0x001 /* Send a zero-length message downstream when a
+ `write' of 0 bytes occurs. */
+#ifdef __USE_GNU
+# define SNDPIPE 0x002 /* Send SIGPIPE on write and putmsg if
+ sd_werror is set. */
+#endif
+
+/* Arguments for `I_ATMARK'. */
+#define ANYMARK 0x01 /* Check if the message is marked. */
+#define LASTMARK 0x02 /* Check if the message is the last one marked
+ on the queue. */
+
+/* Argument for `I_UNLINK'. */
+#ifdef __USE_GNU
+# define MUXID_ALL (-1) /* Unlink all STREAMs linked to the STREAM
+ associated with `fildes'. */
+#endif
+
+
+/* Macros for `getmsg', `getpmsg', `putmsg' and `putpmsg'. */
+#define MSG_HIPRI 0x01 /* Send/receive high priority message. */
+#define MSG_ANY 0x02 /* Receive any message. */
+#define MSG_BAND 0x04 /* Receive message from specified band. */
+
+/* Values returned by getmsg and getpmsg */
+#define MORECTL 1 /* More control information is left in
+ message. */
+#define MOREDATA 2 /* More data is left in message. */
+
+
+/* Structure used for the I_FLUSHBAND ioctl on streams. */
+struct bandinfo
+ {
+ unsigned char bi_pri;
+ int bi_flag;
+ };
+
+struct strbuf
+ {
+ int maxlen; /* Maximum buffer length. */
+ int len; /* Length of data. */
+ char *buf; /* Pointer to buffer. */
+ };
+
+struct strpeek
+ {
+ struct strbuf ctlbuf;
+ struct strbuf databuf;
+ t_uscalar_t flags; /* UnixWare/Solaris compatibility. */
+ };
+
+struct strfdinsert
+ {
+ struct strbuf ctlbuf;
+ struct strbuf databuf;
+ t_uscalar_t flags; /* UnixWare/Solaris compatibility. */
+ int fildes;
+ int offset;
+ };
+
+struct strioctl
+ {
+ int ic_cmd;
+ int ic_timout;
+ int ic_len;
+ char *ic_dp;
+ };
+
+struct strrecvfd
+ {
+ int fd;
+ uid_t uid;
+ gid_t gid;
+ char __fill[8]; /* UnixWare/Solaris compatibility */
+ };
+
+
+struct str_mlist
+ {
+ char l_name[FMNAMESZ + 1];
+ };
+
+struct str_list
+ {
+ int sl_nmods;
+ struct str_mlist *sl_modlist;
+ };
+
+#endif /* bits/stropts.h */
diff --git a/sysroot/usr/include/bits/sys_errlist.h b/sysroot/usr/include/bits/sys_errlist.h
new file mode 100644
index 0000000..ee556e8
--- /dev/null
+++ b/sysroot/usr/include/bits/sys_errlist.h
@@ -0,0 +1,33 @@
+/* Declare sys_errlist and sys_nerr, or don't. Compatibility (do) version.
+ Copyright (C) 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _STDIO_H
+# error "Never include <bits/sys_errlist.h> directly; use <stdio.h> instead."
+#endif
+
+/* sys_errlist and sys_nerr are deprecated. Use strerror instead. */
+
+#ifdef __USE_BSD
+extern int sys_nerr;
+extern __const char *__const sys_errlist[];
+#endif
+#ifdef __USE_GNU
+extern int _sys_nerr;
+extern __const char *__const _sys_errlist[];
+#endif
diff --git a/sysroot/usr/include/bits/syscall.h b/sysroot/usr/include/bits/syscall.h
new file mode 100644
index 0000000..abb24ff
--- /dev/null
+++ b/sysroot/usr/include/bits/syscall.h
@@ -0,0 +1,366 @@
+/* Generated at libc build time from kernel syscall list. */
+
+#ifndef _SYSCALL_H
+# error "Never use <bits/syscall.h> directly; include <sys/syscall.h> instead."
+#endif
+
+#include <bits/wordsize.h>
+
+#define SYS__sysctl __NR__sysctl
+#define SYS_access __NR_access
+#define SYS_acct __NR_acct
+#define SYS_add_key __NR_add_key
+#define SYS_adjtimex __NR_adjtimex
+#define SYS_afs_syscall __NR_afs_syscall
+#define SYS_alarm __NR_alarm
+#define SYS_brk __NR_brk
+#define SYS_capget __NR_capget
+#define SYS_capset __NR_capset
+#define SYS_chdir __NR_chdir
+#define SYS_chmod __NR_chmod
+#define SYS_chown __NR_chown
+#define SYS_chroot __NR_chroot
+#define SYS_clock_getres __NR_clock_getres
+#define SYS_clock_gettime __NR_clock_gettime
+#define SYS_clock_nanosleep __NR_clock_nanosleep
+#define SYS_clock_settime __NR_clock_settime
+#define SYS_clone __NR_clone
+#define SYS_close __NR_close
+#define SYS_creat __NR_creat
+#define SYS_create_module __NR_create_module
+#define SYS_delete_module __NR_delete_module
+#define SYS_dup __NR_dup
+#define SYS_dup2 __NR_dup2
+#define SYS_epoll_create __NR_epoll_create
+#define SYS_epoll_ctl __NR_epoll_ctl
+#define SYS_epoll_pwait __NR_epoll_pwait
+#define SYS_epoll_wait __NR_epoll_wait
+#define SYS_eventfd __NR_eventfd
+#define SYS_execve __NR_execve
+#define SYS_exit __NR_exit
+#define SYS_exit_group __NR_exit_group
+#define SYS_faccessat __NR_faccessat
+#define SYS_fadvise64 __NR_fadvise64
+#define SYS_fallocate __NR_fallocate
+#define SYS_fchdir __NR_fchdir
+#define SYS_fchmod __NR_fchmod
+#define SYS_fchmodat __NR_fchmodat
+#define SYS_fchown __NR_fchown
+#define SYS_fchownat __NR_fchownat
+#define SYS_fcntl __NR_fcntl
+#define SYS_fdatasync __NR_fdatasync
+#define SYS_fgetxattr __NR_fgetxattr
+#define SYS_flistxattr __NR_flistxattr
+#define SYS_flock __NR_flock
+#define SYS_fork __NR_fork
+#define SYS_fremovexattr __NR_fremovexattr
+#define SYS_fsetxattr __NR_fsetxattr
+#define SYS_fstat __NR_fstat
+#define SYS_fstatfs __NR_fstatfs
+#define SYS_fsync __NR_fsync
+#define SYS_ftruncate __NR_ftruncate
+#define SYS_futex __NR_futex
+#define SYS_futimesat __NR_futimesat
+#define SYS_get_kernel_syms __NR_get_kernel_syms
+#define SYS_get_mempolicy __NR_get_mempolicy
+#define SYS_get_robust_list __NR_get_robust_list
+#define SYS_get_thread_area __NR_get_thread_area
+#define SYS_getcwd __NR_getcwd
+#define SYS_getdents __NR_getdents
+#define SYS_getdents64 __NR_getdents64
+#define SYS_getegid __NR_getegid
+#define SYS_geteuid __NR_geteuid
+#define SYS_getgid __NR_getgid
+#define SYS_getgroups __NR_getgroups
+#define SYS_getitimer __NR_getitimer
+#define SYS_getpgid __NR_getpgid
+#define SYS_getpgrp __NR_getpgrp
+#define SYS_getpid __NR_getpid
+#define SYS_getpmsg __NR_getpmsg
+#define SYS_getppid __NR_getppid
+#define SYS_getpriority __NR_getpriority
+#define SYS_getresgid __NR_getresgid
+#define SYS_getresuid __NR_getresuid
+#define SYS_getrlimit __NR_getrlimit
+#define SYS_getrusage __NR_getrusage
+#define SYS_getsid __NR_getsid
+#define SYS_gettid __NR_gettid
+#define SYS_gettimeofday __NR_gettimeofday
+#define SYS_getuid __NR_getuid
+#define SYS_getxattr __NR_getxattr
+#define SYS_init_module __NR_init_module
+#define SYS_inotify_add_watch __NR_inotify_add_watch
+#define SYS_inotify_init __NR_inotify_init
+#define SYS_inotify_rm_watch __NR_inotify_rm_watch
+#define SYS_io_cancel __NR_io_cancel
+#define SYS_io_destroy __NR_io_destroy
+#define SYS_io_getevents __NR_io_getevents
+#define SYS_io_setup __NR_io_setup
+#define SYS_io_submit __NR_io_submit
+#define SYS_ioctl __NR_ioctl
+#define SYS_ioperm __NR_ioperm
+#define SYS_iopl __NR_iopl
+#define SYS_ioprio_get __NR_ioprio_get
+#define SYS_ioprio_set __NR_ioprio_set
+#define SYS_kexec_load __NR_kexec_load
+#define SYS_keyctl __NR_keyctl
+#define SYS_kill __NR_kill
+#define SYS_lchown __NR_lchown
+#define SYS_lgetxattr __NR_lgetxattr
+#define SYS_link __NR_link
+#define SYS_linkat __NR_linkat
+#define SYS_listxattr __NR_listxattr
+#define SYS_llistxattr __NR_llistxattr
+#define SYS_lookup_dcookie __NR_lookup_dcookie
+#define SYS_lremovexattr __NR_lremovexattr
+#define SYS_lseek __NR_lseek
+#define SYS_lsetxattr __NR_lsetxattr
+#define SYS_lstat __NR_lstat
+#define SYS_madvise __NR_madvise
+#define SYS_mbind __NR_mbind
+#define SYS_migrate_pages __NR_migrate_pages
+#define SYS_mincore __NR_mincore
+#define SYS_mkdir __NR_mkdir
+#define SYS_mkdirat __NR_mkdirat
+#define SYS_mknod __NR_mknod
+#define SYS_mknodat __NR_mknodat
+#define SYS_mlock __NR_mlock
+#define SYS_mlockall __NR_mlockall
+#define SYS_mmap __NR_mmap
+#define SYS_modify_ldt __NR_modify_ldt
+#define SYS_mount __NR_mount
+#define SYS_move_pages __NR_move_pages
+#define SYS_mprotect __NR_mprotect
+#define SYS_mq_getsetattr __NR_mq_getsetattr
+#define SYS_mq_notify __NR_mq_notify
+#define SYS_mq_open __NR_mq_open
+#define SYS_mq_timedreceive __NR_mq_timedreceive
+#define SYS_mq_timedsend __NR_mq_timedsend
+#define SYS_mq_unlink __NR_mq_unlink
+#define SYS_mremap __NR_mremap
+#define SYS_msync __NR_msync
+#define SYS_munlock __NR_munlock
+#define SYS_munlockall __NR_munlockall
+#define SYS_munmap __NR_munmap
+#define SYS_nanosleep __NR_nanosleep
+#define SYS_nfsservctl __NR_nfsservctl
+#define SYS_open __NR_open
+#define SYS_openat __NR_openat
+#define SYS_pause __NR_pause
+#define SYS_personality __NR_personality
+#define SYS_pipe __NR_pipe
+#define SYS_pivot_root __NR_pivot_root
+#define SYS_poll __NR_poll
+#define SYS_ppoll __NR_ppoll
+#define SYS_prctl __NR_prctl
+#define SYS_pread64 __NR_pread64
+#define SYS_pselect6 __NR_pselect6
+#define SYS_ptrace __NR_ptrace
+#define SYS_putpmsg __NR_putpmsg
+#define SYS_pwrite64 __NR_pwrite64
+#define SYS_query_module __NR_query_module
+#define SYS_quotactl __NR_quotactl
+#define SYS_read __NR_read
+#define SYS_readahead __NR_readahead
+#define SYS_readlink __NR_readlink
+#define SYS_readlinkat __NR_readlinkat
+#define SYS_readv __NR_readv
+#define SYS_reboot __NR_reboot
+#define SYS_remap_file_pages __NR_remap_file_pages
+#define SYS_removexattr __NR_removexattr
+#define SYS_rename __NR_rename
+#define SYS_renameat __NR_renameat
+#define SYS_request_key __NR_request_key
+#define SYS_restart_syscall __NR_restart_syscall
+#define SYS_rmdir __NR_rmdir
+#define SYS_rt_sigaction __NR_rt_sigaction
+#define SYS_rt_sigpending __NR_rt_sigpending
+#define SYS_rt_sigprocmask __NR_rt_sigprocmask
+#define SYS_rt_sigqueueinfo __NR_rt_sigqueueinfo
+#define SYS_rt_sigreturn __NR_rt_sigreturn
+#define SYS_rt_sigsuspend __NR_rt_sigsuspend
+#define SYS_rt_sigtimedwait __NR_rt_sigtimedwait
+#define SYS_sched_get_priority_max __NR_sched_get_priority_max
+#define SYS_sched_get_priority_min __NR_sched_get_priority_min
+#define SYS_sched_getaffinity __NR_sched_getaffinity
+#define SYS_sched_getparam __NR_sched_getparam
+#define SYS_sched_getscheduler __NR_sched_getscheduler
+#define SYS_sched_rr_get_interval __NR_sched_rr_get_interval
+#define SYS_sched_setaffinity __NR_sched_setaffinity
+#define SYS_sched_setparam __NR_sched_setparam
+#define SYS_sched_setscheduler __NR_sched_setscheduler
+#define SYS_sched_yield __NR_sched_yield
+#define SYS_select __NR_select
+#define SYS_sendfile __NR_sendfile
+#define SYS_set_mempolicy __NR_set_mempolicy
+#define SYS_set_robust_list __NR_set_robust_list
+#define SYS_set_thread_area __NR_set_thread_area
+#define SYS_set_tid_address __NR_set_tid_address
+#define SYS_setdomainname __NR_setdomainname
+#define SYS_setfsgid __NR_setfsgid
+#define SYS_setfsuid __NR_setfsuid
+#define SYS_setgid __NR_setgid
+#define SYS_setgroups __NR_setgroups
+#define SYS_sethostname __NR_sethostname
+#define SYS_setitimer __NR_setitimer
+#define SYS_setpgid __NR_setpgid
+#define SYS_setpriority __NR_setpriority
+#define SYS_setregid __NR_setregid
+#define SYS_setresgid __NR_setresgid
+#define SYS_setresuid __NR_setresuid
+#define SYS_setreuid __NR_setreuid
+#define SYS_setrlimit __NR_setrlimit
+#define SYS_setsid __NR_setsid
+#define SYS_settimeofday __NR_settimeofday
+#define SYS_setuid __NR_setuid
+#define SYS_setxattr __NR_setxattr
+#define SYS_sigaltstack __NR_sigaltstack
+#define SYS_signalfd __NR_signalfd
+#define SYS_splice __NR_splice
+#define SYS_stat __NR_stat
+#define SYS_statfs __NR_statfs
+#define SYS_swapoff __NR_swapoff
+#define SYS_swapon __NR_swapon
+#define SYS_symlink __NR_symlink
+#define SYS_symlinkat __NR_symlinkat
+#define SYS_sync __NR_sync
+#define SYS_sync_file_range __NR_sync_file_range
+#define SYS_sysfs __NR_sysfs
+#define SYS_sysinfo __NR_sysinfo
+#define SYS_syslog __NR_syslog
+#define SYS_tee __NR_tee
+#define SYS_tgkill __NR_tgkill
+#define SYS_time __NR_time
+#define SYS_timer_create __NR_timer_create
+#define SYS_timer_delete __NR_timer_delete
+#define SYS_timer_getoverrun __NR_timer_getoverrun
+#define SYS_timer_gettime __NR_timer_gettime
+#define SYS_timer_settime __NR_timer_settime
+#define SYS_timerfd __NR_timerfd
+#define SYS_times __NR_times
+#define SYS_tkill __NR_tkill
+#define SYS_truncate __NR_truncate
+#define SYS_umask __NR_umask
+#define SYS_umount2 __NR_umount2
+#define SYS_uname __NR_uname
+#define SYS_unlink __NR_unlink
+#define SYS_unlinkat __NR_unlinkat
+#define SYS_unshare __NR_unshare
+#define SYS_uselib __NR_uselib
+#define SYS_ustat __NR_ustat
+#define SYS_utime __NR_utime
+#define SYS_utimensat __NR_utimensat
+#define SYS_utimes __NR_utimes
+#define SYS_vfork __NR_vfork
+#define SYS_vhangup __NR_vhangup
+#define SYS_vmsplice __NR_vmsplice
+#define SYS_vserver __NR_vserver
+#define SYS_wait4 __NR_wait4
+#define SYS_waitid __NR_waitid
+#define SYS_write __NR_write
+#define SYS_writev __NR_writev
+#if __WORDSIZE == 64
+#define SYS_accept __NR_accept
+#define SYS_arch_prctl __NR_arch_prctl
+#define SYS_bind __NR_bind
+#define SYS_connect __NR_connect
+#define SYS_epoll_ctl_old __NR_epoll_ctl_old
+#define SYS_epoll_wait_old __NR_epoll_wait_old
+#define SYS_getpeername __NR_getpeername
+#define SYS_getsockname __NR_getsockname
+#define SYS_getsockopt __NR_getsockopt
+#define SYS_listen __NR_listen
+#define SYS_msgctl __NR_msgctl
+#define SYS_msgget __NR_msgget
+#define SYS_msgrcv __NR_msgrcv
+#define SYS_msgsnd __NR_msgsnd
+#define SYS_newfstatat __NR_newfstatat
+#define SYS_recvfrom __NR_recvfrom
+#define SYS_recvmsg __NR_recvmsg
+#define SYS_security __NR_security
+#define SYS_semctl __NR_semctl
+#define SYS_semget __NR_semget
+#define SYS_semop __NR_semop
+#define SYS_semtimedop __NR_semtimedop
+#define SYS_sendmsg __NR_sendmsg
+#define SYS_sendto __NR_sendto
+#define SYS_setsockopt __NR_setsockopt
+#define SYS_shmat __NR_shmat
+#define SYS_shmctl __NR_shmctl
+#define SYS_shmdt __NR_shmdt
+#define SYS_shmget __NR_shmget
+#define SYS_shutdown __NR_shutdown
+#define SYS_socket __NR_socket
+#define SYS_socketpair __NR_socketpair
+#define SYS_tuxcall __NR_tuxcall
+#else
+#define SYS__llseek __NR__llseek
+#define SYS__newselect __NR__newselect
+#define SYS_bdflush __NR_bdflush
+#define SYS_break __NR_break
+#define SYS_chown32 __NR_chown32
+#define SYS_fadvise64_64 __NR_fadvise64_64
+#define SYS_fchown32 __NR_fchown32
+#define SYS_fcntl64 __NR_fcntl64
+#define SYS_fstat64 __NR_fstat64
+#define SYS_fstatat64 __NR_fstatat64
+#define SYS_fstatfs64 __NR_fstatfs64
+#define SYS_ftime __NR_ftime
+#define SYS_ftruncate64 __NR_ftruncate64
+#define SYS_getcpu __NR_getcpu
+#define SYS_getegid32 __NR_getegid32
+#define SYS_geteuid32 __NR_geteuid32
+#define SYS_getgid32 __NR_getgid32
+#define SYS_getgroups32 __NR_getgroups32
+#define SYS_getresgid32 __NR_getresgid32
+#define SYS_getresuid32 __NR_getresuid32
+#define SYS_getuid32 __NR_getuid32
+#define SYS_gtty __NR_gtty
+#define SYS_idle __NR_idle
+#define SYS_ipc __NR_ipc
+#define SYS_lchown32 __NR_lchown32
+#define SYS_lock __NR_lock
+#define SYS_lstat64 __NR_lstat64
+#define SYS_madvise1 __NR_madvise1
+#define SYS_mmap2 __NR_mmap2
+#define SYS_mpx __NR_mpx
+#define SYS_nice __NR_nice
+#define SYS_oldfstat __NR_oldfstat
+#define SYS_oldlstat __NR_oldlstat
+#define SYS_oldolduname __NR_oldolduname
+#define SYS_oldstat __NR_oldstat
+#define SYS_olduname __NR_olduname
+#define SYS_prof __NR_prof
+#define SYS_profil __NR_profil
+#define SYS_readdir __NR_readdir
+#define SYS_sendfile64 __NR_sendfile64
+#define SYS_setfsgid32 __NR_setfsgid32
+#define SYS_setfsuid32 __NR_setfsuid32
+#define SYS_setgid32 __NR_setgid32
+#define SYS_setgroups32 __NR_setgroups32
+#define SYS_setregid32 __NR_setregid32
+#define SYS_setresgid32 __NR_setresgid32
+#define SYS_setresuid32 __NR_setresuid32
+#define SYS_setreuid32 __NR_setreuid32
+#define SYS_setuid32 __NR_setuid32
+#define SYS_sgetmask __NR_sgetmask
+#define SYS_sigaction __NR_sigaction
+#define SYS_signal __NR_signal
+#define SYS_sigpending __NR_sigpending
+#define SYS_sigprocmask __NR_sigprocmask
+#define SYS_sigreturn __NR_sigreturn
+#define SYS_sigsuspend __NR_sigsuspend
+#define SYS_socketcall __NR_socketcall
+#define SYS_ssetmask __NR_ssetmask
+#define SYS_stat64 __NR_stat64
+#define SYS_statfs64 __NR_statfs64
+#define SYS_stime __NR_stime
+#define SYS_stty __NR_stty
+#define SYS_truncate64 __NR_truncate64
+#define SYS_ugetrlimit __NR_ugetrlimit
+#define SYS_ulimit __NR_ulimit
+#define SYS_umount __NR_umount
+#define SYS_vm86 __NR_vm86
+#define SYS_vm86old __NR_vm86old
+#define SYS_waitpid __NR_waitpid
+#endif
diff --git a/sysroot/usr/include/bits/syslog-ldbl.h b/sysroot/usr/include/bits/syslog-ldbl.h
new file mode 100644
index 0000000..714e70c
--- /dev/null
+++ b/sysroot/usr/include/bits/syslog-ldbl.h
@@ -0,0 +1,36 @@
+/* -mlong-double-64 compatibility mode for syslog functions.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SYSLOG_H
+# error "Never include <bits/syslog-ldbl.h> directly; use <sys/syslog.h> instead."
+#endif
+
+__LDBL_REDIR_DECL (syslog)
+
+#ifdef __USE_BSD
+__LDBL_REDIR_DECL (vsyslog)
+#endif
+
+#if __USE_FORTIFY_LEVEL > 0 && defined __extern_always_inline
+__LDBL_REDIR_DECL (__syslog_chk)
+
+# ifdef __USE_BSD
+__LDBL_REDIR_DECL (__vsyslog_chk)
+# endif
+#endif
diff --git a/sysroot/usr/include/bits/syslog-path.h b/sysroot/usr/include/bits/syslog-path.h
new file mode 100644
index 0000000..a1bbd6b
--- /dev/null
+++ b/sysroot/usr/include/bits/syslog-path.h
@@ -0,0 +1,29 @@
+/* <bits/syslog-path.h> -- _PATH_LOG definition
+ Copyright (C) 2006 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SYSLOG_H
+# error "Never include this file directly. Use <sys/syslog.h> instead"
+#endif
+
+#ifndef _BITS_SYSLOG_PATH_H
+#define _BITS_SYSLOG_PATH_H 1
+
+#define _PATH_LOG "/dev/log"
+
+#endif /* bits/syslog-path.h */
diff --git a/sysroot/usr/include/bits/syslog.h b/sysroot/usr/include/bits/syslog.h
new file mode 100644
index 0000000..853b30c
--- /dev/null
+++ b/sysroot/usr/include/bits/syslog.h
@@ -0,0 +1,50 @@
+/* Checking macros for syslog functions.
+ Copyright (C) 2005, 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SYSLOG_H
+# error "Never include <bits/syslog.h> directly; use <sys/syslog.h> instead."
+#endif
+
+
+extern void __syslog_chk (int __pri, int __flag, __const char *__fmt, ...)
+ __attribute__ ((__format__ (__printf__, 3, 4)));
+
+#ifdef __va_arg_pack
+__extern_always_inline void
+syslog (int __pri, __const char *__fmt, ...)
+{
+ return __syslog_chk (__pri, __USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ());
+}
+#elif !defined __cplusplus
+# define syslog(pri, ...) \
+ __syslog_chk (pri, __USE_FORTIFY_LEVEL - 1, __VA_ARGS__)
+#endif
+
+
+#ifdef __USE_BSD
+extern void __vsyslog_chk (int __pri, int __flag, __const char *__fmt,
+ __gnuc_va_list __ap)
+ __attribute__ ((__format__ (__printf__, 3, 0)));
+
+__extern_always_inline void
+vsyslog (int __pri, __const char *__fmt, __gnuc_va_list __ap)
+{
+ return __vsyslog_chk (__pri, __USE_FORTIFY_LEVEL - 1, __fmt, __ap);
+}
+#endif
diff --git a/sysroot/usr/include/bits/termios.h b/sysroot/usr/include/bits/termios.h
new file mode 100644
index 0000000..c71e4ad
--- /dev/null
+++ b/sysroot/usr/include/bits/termios.h
@@ -0,0 +1,218 @@
+/* termios type and macro definitions. Linux version.
+ Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2003, 2005
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _TERMIOS_H
+# error "Never include <bits/termios.h> directly; use <termios.h> instead."
+#endif
+
+typedef unsigned char cc_t;
+typedef unsigned int speed_t;
+typedef unsigned int tcflag_t;
+
+#define NCCS 32
+struct termios
+ {
+ tcflag_t c_iflag; /* input mode flags */
+ tcflag_t c_oflag; /* output mode flags */
+ tcflag_t c_cflag; /* control mode flags */
+ tcflag_t c_lflag; /* local mode flags */
+ cc_t c_line; /* line discipline */
+ cc_t c_cc[NCCS]; /* control characters */
+ speed_t c_ispeed; /* input speed */
+ speed_t c_ospeed; /* output speed */
+#define _HAVE_STRUCT_TERMIOS_C_ISPEED 1
+#define _HAVE_STRUCT_TERMIOS_C_OSPEED 1
+ };
+
+/* c_cc characters */
+#define VINTR 0
+#define VQUIT 1
+#define VERASE 2
+#define VKILL 3
+#define VEOF 4
+#define VTIME 5
+#define VMIN 6
+#define VSWTC 7
+#define VSTART 8
+#define VSTOP 9
+#define VSUSP 10
+#define VEOL 11
+#define VREPRINT 12
+#define VDISCARD 13
+#define VWERASE 14
+#define VLNEXT 15
+#define VEOL2 16
+
+/* c_iflag bits */
+#define IGNBRK 0000001
+#define BRKINT 0000002
+#define IGNPAR 0000004
+#define PARMRK 0000010
+#define INPCK 0000020
+#define ISTRIP 0000040
+#define INLCR 0000100
+#define IGNCR 0000200
+#define ICRNL 0000400
+#define IUCLC 0001000
+#define IXON 0002000
+#define IXANY 0004000
+#define IXOFF 0010000
+#define IMAXBEL 0020000
+#define IUTF8 0040000
+
+/* c_oflag bits */
+#define OPOST 0000001
+#define OLCUC 0000002
+#define ONLCR 0000004
+#define OCRNL 0000010
+#define ONOCR 0000020
+#define ONLRET 0000040
+#define OFILL 0000100
+#define OFDEL 0000200
+#if defined __USE_MISC || defined __USE_XOPEN
+# define NLDLY 0000400
+# define NL0 0000000
+# define NL1 0000400
+# define CRDLY 0003000
+# define CR0 0000000
+# define CR1 0001000
+# define CR2 0002000
+# define CR3 0003000
+# define TABDLY 0014000
+# define TAB0 0000000
+# define TAB1 0004000
+# define TAB2 0010000
+# define TAB3 0014000
+# define BSDLY 0020000
+# define BS0 0000000
+# define BS1 0020000
+# define FFDLY 0100000
+# define FF0 0000000
+# define FF1 0100000
+#endif
+
+#define VTDLY 0040000
+#define VT0 0000000
+#define VT1 0040000
+
+#ifdef __USE_MISC
+# define XTABS 0014000
+#endif
+
+/* c_cflag bit meaning */
+#ifdef __USE_MISC
+# define CBAUD 0010017
+#endif
+#define B0 0000000 /* hang up */
+#define B50 0000001
+#define B75 0000002
+#define B110 0000003
+#define B134 0000004
+#define B150 0000005
+#define B200 0000006
+#define B300 0000007
+#define B600 0000010
+#define B1200 0000011
+#define B1800 0000012
+#define B2400 0000013
+#define B4800 0000014
+#define B9600 0000015
+#define B19200 0000016
+#define B38400 0000017
+#ifdef __USE_MISC
+# define EXTA B19200
+# define EXTB B38400
+#endif
+#define CSIZE 0000060
+#define CS5 0000000
+#define CS6 0000020
+#define CS7 0000040
+#define CS8 0000060
+#define CSTOPB 0000100
+#define CREAD 0000200
+#define PARENB 0000400
+#define PARODD 0001000
+#define HUPCL 0002000
+#define CLOCAL 0004000
+#ifdef __USE_MISC
+# define CBAUDEX 0010000
+#endif
+#define B57600 0010001
+#define B115200 0010002
+#define B230400 0010003
+#define B460800 0010004
+#define B500000 0010005
+#define B576000 0010006
+#define B921600 0010007
+#define B1000000 0010010
+#define B1152000 0010011
+#define B1500000 0010012
+#define B2000000 0010013
+#define B2500000 0010014
+#define B3000000 0010015
+#define B3500000 0010016
+#define B4000000 0010017
+#define __MAX_BAUD B4000000
+#ifdef __USE_MISC
+# define CIBAUD 002003600000 /* input baud rate (not used) */
+# define CMSPAR 010000000000 /* mark or space (stick) parity */
+# define CRTSCTS 020000000000 /* flow control */
+#endif
+
+/* c_lflag bits */
+#define ISIG 0000001
+#define ICANON 0000002
+#if defined __USE_MISC || defined __USE_XOPEN
+# define XCASE 0000004
+#endif
+#define ECHO 0000010
+#define ECHOE 0000020
+#define ECHOK 0000040
+#define ECHONL 0000100
+#define NOFLSH 0000200
+#define TOSTOP 0000400
+#ifdef __USE_MISC
+# define ECHOCTL 0001000
+# define ECHOPRT 0002000
+# define ECHOKE 0004000
+# define FLUSHO 0010000
+# define PENDIN 0040000
+#endif
+#define IEXTEN 0100000
+
+/* tcflow() and TCXONC use these */
+#define TCOOFF 0
+#define TCOON 1
+#define TCIOFF 2
+#define TCION 3
+
+/* tcflush() and TCFLSH use these */
+#define TCIFLUSH 0
+#define TCOFLUSH 1
+#define TCIOFLUSH 2
+
+/* tcsetattr uses these */
+#define TCSANOW 0
+#define TCSADRAIN 1
+#define TCSAFLUSH 2
+
+
+#define _IOT_termios /* Hurd ioctl type field. */ \
+ _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2)
diff --git a/sysroot/usr/include/bits/time.h b/sysroot/usr/include/bits/time.h
new file mode 100644
index 0000000..b3184d1
--- /dev/null
+++ b/sysroot/usr/include/bits/time.h
@@ -0,0 +1,75 @@
+/* System-dependent timing definitions. Generic version.
+ Copyright (C) 1996,1997,1999-2002,2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * Never include this file directly; use <time.h> instead.
+ */
+
+#ifndef __need_timeval
+# ifndef _BITS_TIME_H
+# define _BITS_TIME_H 1
+
+/* ISO/IEC 9899:1990 7.12.1: <time.h>
+ The macro `CLOCKS_PER_SEC' is the number per second of the value
+ returned by the `clock' function. */
+/* CAE XSH, Issue 4, Version 2: <time.h>
+ The value of CLOCKS_PER_SEC is required to be 1 million on all
+ XSI-conformant systems. */
+# define CLOCKS_PER_SEC 1000000l
+
+# if !defined __STRICT_ANSI__ && !defined __USE_XOPEN2K
+/* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK
+ presents the real value for clock ticks per second for the system. */
+# include <bits/types.h>
+extern long int __sysconf (int);
+# define CLK_TCK ((__clock_t) __sysconf (2)) /* 2 is _SC_CLK_TCK */
+# endif
+
+# ifdef __USE_POSIX199309
+/* Identifier for system-wide realtime clock. */
+# define CLOCK_REALTIME 0
+/* Monotonic system-wide clock. */
+# define CLOCK_MONOTONIC 1
+/* High-resolution timer from the CPU. */
+# define CLOCK_PROCESS_CPUTIME_ID 2
+/* Thread-specific CPU-time clock. */
+# define CLOCK_THREAD_CPUTIME_ID 3
+
+/* Flag to indicate time is absolute. */
+# define TIMER_ABSTIME 1
+# endif
+
+# endif /* bits/time.h */
+#endif
+
+#ifdef __need_timeval
+# undef __need_timeval
+# ifndef _STRUCT_TIMEVAL
+# define _STRUCT_TIMEVAL 1
+# include <bits/types.h>
+
+/* A time value that is accurate to the nearest
+ microsecond but also has a range of years. */
+struct timeval
+ {
+ __time_t tv_sec; /* Seconds. */
+ __suseconds_t tv_usec; /* Microseconds. */
+ };
+# endif /* struct timeval */
+#endif /* need timeval */
diff --git a/sysroot/usr/include/bits/types.h b/sysroot/usr/include/bits/types.h
new file mode 100644
index 0000000..3ebe82f
--- /dev/null
+++ b/sysroot/usr/include/bits/types.h
@@ -0,0 +1,197 @@
+/* bits/types.h -- definitions of __*_t types underlying *_t types.
+ Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * Never include this file directly; use <sys/types.h> instead.
+ */
+
+#ifndef _BITS_TYPES_H
+#define _BITS_TYPES_H 1
+
+#include <features.h>
+#include <bits/wordsize.h>
+
+/* Convenience types. */
+typedef unsigned char __u_char;
+typedef unsigned short int __u_short;
+typedef unsigned int __u_int;
+typedef unsigned long int __u_long;
+
+/* Fixed-size types, underlying types depend on word size and compiler. */
+typedef signed char __int8_t;
+typedef unsigned char __uint8_t;
+typedef signed short int __int16_t;
+typedef unsigned short int __uint16_t;
+typedef signed int __int32_t;
+typedef unsigned int __uint32_t;
+#if __WORDSIZE == 64
+typedef signed long int __int64_t;
+typedef unsigned long int __uint64_t;
+#elif defined __GLIBC_HAVE_LONG_LONG
+__extension__ typedef signed long long int __int64_t;
+__extension__ typedef unsigned long long int __uint64_t;
+#endif
+
+/* quad_t is also 64 bits. */
+#if __WORDSIZE == 64
+typedef long int __quad_t;
+typedef unsigned long int __u_quad_t;
+#elif defined __GLIBC_HAVE_LONG_LONG
+__extension__ typedef long long int __quad_t;
+__extension__ typedef unsigned long long int __u_quad_t;
+#else
+typedef struct
+{
+ long __val[2];
+} __quad_t;
+typedef struct
+{
+ __u_long __val[2];
+} __u_quad_t;
+#endif
+
+
+/* The machine-dependent file <bits/typesizes.h> defines __*_T_TYPE
+ macros for each of the OS types we define below. The definitions
+ of those macros must use the following macros for underlying types.
+ We define __S<SIZE>_TYPE and __U<SIZE>_TYPE for the signed and unsigned
+ variants of each of the following integer types on this machine.
+
+ 16 -- "natural" 16-bit type (always short)
+ 32 -- "natural" 32-bit type (always int)
+ 64 -- "natural" 64-bit type (long or long long)
+ LONG32 -- 32-bit type, traditionally long
+ QUAD -- 64-bit type, always long long
+ WORD -- natural type of __WORDSIZE bits (int or long)
+ LONGWORD -- type of __WORDSIZE bits, traditionally long
+
+ We distinguish WORD/LONGWORD, 32/LONG32, and 64/QUAD so that the
+ conventional uses of `long' or `long long' type modifiers match the
+ types we define, even when a less-adorned type would be the same size.
+ This matters for (somewhat) portably writing printf/scanf formats for
+ these types, where using the appropriate l or ll format modifiers can
+ make the typedefs and the formats match up across all GNU platforms. If
+ we used `long' when it's 64 bits where `long long' is expected, then the
+ compiler would warn about the formats not matching the argument types,
+ and the programmer changing them to shut up the compiler would break the
+ program's portability.
+
+ Here we assume what is presently the case in all the GCC configurations
+ we support: long long is always 64 bits, long is always word/address size,
+ and int is always 32 bits. */
+
+#define __S16_TYPE short int
+#define __U16_TYPE unsigned short int
+#define __S32_TYPE int
+#define __U32_TYPE unsigned int
+#define __SLONGWORD_TYPE long int
+#define __ULONGWORD_TYPE unsigned long int
+#if __WORDSIZE == 32
+# define __SQUAD_TYPE __quad_t
+# define __UQUAD_TYPE __u_quad_t
+# define __SWORD_TYPE int
+# define __UWORD_TYPE unsigned int
+# define __SLONG32_TYPE long int
+# define __ULONG32_TYPE unsigned long int
+# define __S64_TYPE __quad_t
+# define __U64_TYPE __u_quad_t
+/* We want __extension__ before typedef's that use nonstandard base types
+ such as `long long' in C89 mode. */
+# define __STD_TYPE __extension__ typedef
+#elif __WORDSIZE == 64
+# define __SQUAD_TYPE long int
+# define __UQUAD_TYPE unsigned long int
+# define __SWORD_TYPE long int
+# define __UWORD_TYPE unsigned long int
+# define __SLONG32_TYPE int
+# define __ULONG32_TYPE unsigned int
+# define __S64_TYPE long int
+# define __U64_TYPE unsigned long int
+/* No need to mark the typedef with __extension__. */
+# define __STD_TYPE typedef
+#else
+# error
+#endif
+#include <bits/typesizes.h> /* Defines __*_T_TYPE macros. */
+
+
+__STD_TYPE __DEV_T_TYPE __dev_t; /* Type of device numbers. */
+__STD_TYPE __UID_T_TYPE __uid_t; /* Type of user identifications. */
+__STD_TYPE __GID_T_TYPE __gid_t; /* Type of group identifications. */
+__STD_TYPE __INO_T_TYPE __ino_t; /* Type of file serial numbers. */
+__STD_TYPE __INO64_T_TYPE __ino64_t; /* Type of file serial numbers (LFS).*/
+__STD_TYPE __MODE_T_TYPE __mode_t; /* Type of file attribute bitmasks. */
+__STD_TYPE __NLINK_T_TYPE __nlink_t; /* Type of file link counts. */
+__STD_TYPE __OFF_T_TYPE __off_t; /* Type of file sizes and offsets. */
+__STD_TYPE __OFF64_T_TYPE __off64_t; /* Type of file sizes and offsets (LFS). */
+__STD_TYPE __PID_T_TYPE __pid_t; /* Type of process identifications. */
+__STD_TYPE __FSID_T_TYPE __fsid_t; /* Type of file system IDs. */
+__STD_TYPE __CLOCK_T_TYPE __clock_t; /* Type of CPU usage counts. */
+__STD_TYPE __RLIM_T_TYPE __rlim_t; /* Type for resource measurement. */
+__STD_TYPE __RLIM64_T_TYPE __rlim64_t; /* Type for resource measurement (LFS). */
+__STD_TYPE __ID_T_TYPE __id_t; /* General type for IDs. */
+__STD_TYPE __TIME_T_TYPE __time_t; /* Seconds since the Epoch. */
+__STD_TYPE __USECONDS_T_TYPE __useconds_t; /* Count of microseconds. */
+__STD_TYPE __SUSECONDS_T_TYPE __suseconds_t; /* Signed count of microseconds. */
+
+__STD_TYPE __DADDR_T_TYPE __daddr_t; /* The type of a disk address. */
+__STD_TYPE __SWBLK_T_TYPE __swblk_t; /* Type of a swap block maybe? */
+__STD_TYPE __KEY_T_TYPE __key_t; /* Type of an IPC key. */
+
+/* Clock ID used in clock and timer functions. */
+__STD_TYPE __CLOCKID_T_TYPE __clockid_t;
+
+/* Timer ID returned by `timer_create'. */
+__STD_TYPE __TIMER_T_TYPE __timer_t;
+
+/* Type to represent block size. */
+__STD_TYPE __BLKSIZE_T_TYPE __blksize_t;
+
+/* Types from the Large File Support interface. */
+
+/* Type to count number of disk blocks. */
+__STD_TYPE __BLKCNT_T_TYPE __blkcnt_t;
+__STD_TYPE __BLKCNT64_T_TYPE __blkcnt64_t;
+
+/* Type to count file system blocks. */
+__STD_TYPE __FSBLKCNT_T_TYPE __fsblkcnt_t;
+__STD_TYPE __FSBLKCNT64_T_TYPE __fsblkcnt64_t;
+
+/* Type to count file system nodes. */
+__STD_TYPE __FSFILCNT_T_TYPE __fsfilcnt_t;
+__STD_TYPE __FSFILCNT64_T_TYPE __fsfilcnt64_t;
+
+__STD_TYPE __SSIZE_T_TYPE __ssize_t; /* Type of a byte count, or error. */
+
+/* These few don't really vary by system, they always correspond
+ to one of the other defined types. */
+typedef __off64_t __loff_t; /* Type of file sizes and offsets (LFS). */
+typedef __quad_t *__qaddr_t;
+typedef char *__caddr_t;
+
+/* Duplicates info from stdint.h but this is used in unistd.h. */
+__STD_TYPE __SWORD_TYPE __intptr_t;
+
+/* Duplicate info from sys/socket.h. */
+__STD_TYPE __U32_TYPE __socklen_t;
+
+
+#undef __STD_TYPE
+
+#endif /* bits/types.h */
diff --git a/sysroot/usr/include/bits/typesizes.h b/sysroot/usr/include/bits/typesizes.h
new file mode 100644
index 0000000..e9226c4
--- /dev/null
+++ b/sysroot/usr/include/bits/typesizes.h
@@ -0,0 +1,66 @@
+/* bits/typesizes.h -- underlying types for *_t. Generic version.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _BITS_TYPES_H
+# error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead."
+#endif
+
+#ifndef _BITS_TYPESIZES_H
+#define _BITS_TYPESIZES_H 1
+
+/* See <bits/types.h> for the meaning of these macros. This file exists so
+ that <bits/types.h> need not vary across different GNU platforms. */
+
+#define __DEV_T_TYPE __UQUAD_TYPE
+#define __UID_T_TYPE __U32_TYPE
+#define __GID_T_TYPE __U32_TYPE
+#define __INO_T_TYPE __ULONGWORD_TYPE
+#define __INO64_T_TYPE __UQUAD_TYPE
+#define __MODE_T_TYPE __U32_TYPE
+#define __NLINK_T_TYPE __UWORD_TYPE
+#define __OFF_T_TYPE __SLONGWORD_TYPE
+#define __OFF64_T_TYPE __SQUAD_TYPE
+#define __PID_T_TYPE __S32_TYPE
+#define __RLIM_T_TYPE __ULONGWORD_TYPE
+#define __RLIM64_T_TYPE __UQUAD_TYPE
+#define __BLKCNT_T_TYPE __SLONGWORD_TYPE
+#define __BLKCNT64_T_TYPE __SQUAD_TYPE
+#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE
+#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE
+#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE
+#define __FSFILCNT64_T_TYPE __UQUAD_TYPE
+#define __ID_T_TYPE __U32_TYPE
+#define __CLOCK_T_TYPE __SLONGWORD_TYPE
+#define __TIME_T_TYPE __SLONGWORD_TYPE
+#define __USECONDS_T_TYPE __U32_TYPE
+#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE
+#define __DADDR_T_TYPE __S32_TYPE
+#define __SWBLK_T_TYPE __SLONGWORD_TYPE
+#define __KEY_T_TYPE __S32_TYPE
+#define __CLOCKID_T_TYPE __S32_TYPE
+#define __TIMER_T_TYPE void *
+#define __BLKSIZE_T_TYPE __SLONGWORD_TYPE
+#define __FSID_T_TYPE struct { int __val[2]; }
+#define __SSIZE_T_TYPE __SWORD_TYPE
+
+/* Number of descriptors that can fit in an `fd_set'. */
+#define __FD_SETSIZE 1024
+
+
+#endif /* bits/typesizes.h */
diff --git a/sysroot/usr/include/bits/uio.h b/sysroot/usr/include/bits/uio.h
new file mode 100644
index 0000000..6a283ed
--- /dev/null
+++ b/sysroot/usr/include/bits/uio.h
@@ -0,0 +1,50 @@
+/* Copyright (C) 1996, 1997, 2006 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#if !defined _SYS_UIO_H && !defined _FCNTL_H
+# error "Never include <bits/uio.h> directly; use <sys/uio.h> instead."
+#endif
+
+#ifndef _BITS_UIO_H
+#define _BITS_UIO_H 1
+
+#include <sys/types.h>
+
+
+/* We should normally use the Linux kernel header file to define this
+ type and macros but this calls for trouble because of the header
+ includes other kernel headers. */
+
+/* Size of object which can be written atomically.
+
+ This macro has different values in different kernel versions. The
+ latest versions of the kernel use 1024 and this is good choice. Since
+ the C library implementation of readv/writev is able to emulate the
+ functionality even if the currently running kernel does not support
+ this large value the readv/writev call will not fail because of this. */
+#define UIO_MAXIOV 1024
+
+
+/* Structure for scatter/gather I/O. */
+struct iovec
+ {
+ void *iov_base; /* Pointer to data. */
+ size_t iov_len; /* Length of data. */
+ };
+
+#endif
diff --git a/sysroot/usr/include/bits/unistd.h b/sysroot/usr/include/bits/unistd.h
new file mode 100644
index 0000000..efd7f75
--- /dev/null
+++ b/sysroot/usr/include/bits/unistd.h
@@ -0,0 +1,386 @@
+/* Checking macros for unistd functions.
+ Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _UNISTD_H
+# error "Never include <bits/unistd.h> directly; use <unistd.h> instead."
+#endif
+
+extern ssize_t __read_chk (int __fd, void *__buf, size_t __nbytes,
+ size_t __buflen) __wur;
+extern ssize_t __REDIRECT (__read_alias, (int __fd, void *__buf,
+ size_t __nbytes), read) __wur;
+extern ssize_t __REDIRECT (__read_chk_warn,
+ (int __fd, void *__buf, size_t __nbytes,
+ size_t __buflen), __read_chk)
+ __wur __warnattr ("read called with bigger length than size of "
+ "the destination buffer");
+
+__extern_always_inline __wur ssize_t
+read (int __fd, void *__buf, size_t __nbytes)
+{
+ if (__bos0 (__buf) != (size_t) -1)
+ {
+ if (!__builtin_constant_p (__nbytes))
+ return __read_chk (__fd, __buf, __nbytes, __bos0 (__buf));
+
+ if (__nbytes > __bos0 (__buf))
+ return __read_chk_warn (__fd, __buf, __nbytes, __bos0 (__buf));
+ }
+ return __read_alias (__fd, __buf, __nbytes);
+}
+
+#ifdef __USE_UNIX98
+extern ssize_t __pread_chk (int __fd, void *__buf, size_t __nbytes,
+ __off_t __offset, size_t __bufsize) __wur;
+extern ssize_t __pread64_chk (int __fd, void *__buf, size_t __nbytes,
+ __off64_t __offset, size_t __bufsize) __wur;
+extern ssize_t __REDIRECT (__pread_alias,
+ (int __fd, void *__buf, size_t __nbytes,
+ __off_t __offset), pread) __wur;
+extern ssize_t __REDIRECT (__pread64_alias,
+ (int __fd, void *__buf, size_t __nbytes,
+ __off64_t __offset), pread64) __wur;
+extern ssize_t __REDIRECT (__pread_chk_warn,
+ (int __fd, void *__buf, size_t __nbytes,
+ __off_t __offset, size_t __bufsize), __pread_chk)
+ __wur __warnattr ("pread called with bigger length than size of "
+ "the destination buffer");
+extern ssize_t __REDIRECT (__pread64_chk_warn,
+ (int __fd, void *__buf, size_t __nbytes,
+ __off64_t __offset, size_t __bufsize),
+ __pread64_chk)
+ __wur __warnattr ("pread64 called with bigger length than size of "
+ "the destination buffer");
+
+# ifndef __USE_FILE_OFFSET64
+__extern_always_inline __wur ssize_t
+pread (int __fd, void *__buf, size_t __nbytes, __off_t __offset)
+{
+ if (__bos0 (__buf) != (size_t) -1)
+ {
+ if (!__builtin_constant_p (__nbytes))
+ return __pread_chk (__fd, __buf, __nbytes, __offset, __bos0 (__buf));
+
+ if ( __nbytes > __bos0 (__buf))
+ return __pread_chk_warn (__fd, __buf, __nbytes, __offset,
+ __bos0 (__buf));
+ }
+ return __pread_alias (__fd, __buf, __nbytes, __offset);
+}
+# else
+__extern_always_inline __wur ssize_t
+pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset)
+{
+ if (__bos0 (__buf) != (size_t) -1)
+ {
+ if (!__builtin_constant_p (__nbytes))
+ return __pread64_chk (__fd, __buf, __nbytes, __offset, __bos0 (__buf));
+
+ if ( __nbytes > __bos0 (__buf))
+ return __pread64_chk_warn (__fd, __buf, __nbytes, __offset,
+ __bos0 (__buf));
+ }
+
+ return __pread64_alias (__fd, __buf, __nbytes, __offset);
+}
+# endif
+
+# ifdef __USE_LARGEFILE64
+__extern_always_inline __wur ssize_t
+pread64 (int __fd, void *__buf, size_t __nbytes, __off64_t __offset)
+{
+ if (__bos0 (__buf) != (size_t) -1)
+ {
+ if (!__builtin_constant_p (__nbytes))
+ return __pread64_chk (__fd, __buf, __nbytes, __offset, __bos0 (__buf));
+
+ if ( __nbytes > __bos0 (__buf))
+ return __pread64_chk_warn (__fd, __buf, __nbytes, __offset,
+ __bos0 (__buf));
+ }
+
+ return __pread64_alias (__fd, __buf, __nbytes, __offset);
+}
+# endif
+#endif
+
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K
+extern ssize_t __readlink_chk (__const char *__restrict __path,
+ char *__restrict __buf, size_t __len,
+ size_t __buflen)
+ __THROW __nonnull ((1, 2)) __wur;
+extern ssize_t __REDIRECT_NTH (__readlink_alias,
+ (__const char *__restrict __path,
+ char *__restrict __buf, size_t __len), readlink)
+ __nonnull ((1, 2)) __wur;
+extern ssize_t __REDIRECT_NTH (__readlink_chk_warn,
+ (__const char *__restrict __path,
+ char *__restrict __buf, size_t __len,
+ size_t __buflen), __readlink_chk)
+ __nonnull ((1, 2)) __wur __warnattr ("readlink called with bigger length "
+ "than size of destination buffer");
+
+__extern_always_inline __nonnull ((1, 2)) __wur ssize_t
+__NTH (readlink (__const char *__restrict __path, char *__restrict __buf,
+ size_t __len))
+{
+ if (__bos (__buf) != (size_t) -1)
+ {
+ if (!__builtin_constant_p (__len))
+ return __readlink_chk (__path, __buf, __len, __bos (__buf));
+
+ if ( __len > __bos (__buf))
+ return __readlink_chk_warn (__path, __buf, __len, __bos (__buf));
+ }
+ return __readlink_alias (__path, __buf, __len);
+}
+#endif
+
+#ifdef __USE_ATFILE
+extern ssize_t __readlinkat_chk (int __fd, __const char *__restrict __path,
+ char *__restrict __buf, size_t __len,
+ size_t __buflen)
+ __THROW __nonnull ((2, 3)) __wur;
+extern ssize_t __REDIRECT_NTH (__readlinkat_alias,
+ (int __fd, __const char *__restrict __path,
+ char *__restrict __buf, size_t __len),
+ readlinkat)
+ __nonnull ((2, 3)) __wur;
+extern ssize_t __REDIRECT_NTH (__readlinkat_chk_warn,
+ (int __fd, __const char *__restrict __path,
+ char *__restrict __buf, size_t __len,
+ size_t __buflen), __readlinkat_chk)
+ __nonnull ((2, 3)) __wur __warnattr ("readlinkat called with bigger "
+ "length than size of destination "
+ "buffer");
+
+__extern_always_inline __nonnull ((2, 3)) __wur ssize_t
+__NTH (readlinkat (int __fd, __const char *__restrict __path,
+ char *__restrict __buf, size_t __len))
+{
+ if (__bos (__buf) != (size_t) -1)
+ {
+ if (!__builtin_constant_p (__len))
+ return __readlinkat_chk (__fd, __path, __buf, __len, __bos (__buf));
+
+ if (__len > __bos (__buf))
+ return __readlinkat_chk_warn (__fd, __path, __buf, __len,
+ __bos (__buf));
+ }
+ return __readlinkat_alias (__fd, __path, __buf, __len);
+}
+#endif
+
+extern char *__getcwd_chk (char *__buf, size_t __size, size_t __buflen)
+ __THROW __wur;
+extern char *__REDIRECT_NTH (__getcwd_alias,
+ (char *__buf, size_t __size), getcwd) __wur;
+extern char *__REDIRECT_NTH (__getcwd_chk_warn,
+ (char *__buf, size_t __size, size_t __buflen),
+ __getcwd_chk)
+ __wur __warnattr ("getcwd caller with bigger length than size of "
+ "destination buffer");
+
+__extern_always_inline __wur char *
+__NTH (getcwd (char *__buf, size_t __size))
+{
+ if (__bos (__buf) != (size_t) -1)
+ {
+ if (!__builtin_constant_p (__size))
+ return __getcwd_chk (__buf, __size, __bos (__buf));
+
+ if (__size > __bos (__buf))
+ return __getcwd_chk_warn (__buf, __size, __bos (__buf));
+ }
+ return __getcwd_alias (__buf, __size);
+}
+
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+extern char *__getwd_chk (char *__buf, size_t buflen)
+ __THROW __nonnull ((1)) __wur;
+extern char *__REDIRECT_NTH (__getwd_warn, (char *__buf), getwd)
+ __nonnull ((1)) __wur __warnattr ("please use getcwd instead, as getwd "
+ "doesn't specify buffer size");
+
+__extern_always_inline __nonnull ((1)) __attribute_deprecated__ __wur char *
+__NTH (getwd (char *__buf))
+{
+ if (__bos (__buf) != (size_t) -1)
+ return __getwd_chk (__buf, __bos (__buf));
+ return __getwd_warn (__buf);
+}
+#endif
+
+extern size_t __confstr_chk (int __name, char *__buf, size_t __len,
+ size_t __buflen) __THROW;
+extern size_t __REDIRECT_NTH (__confstr_alias, (int __name, char *__buf,
+ size_t __len), confstr);
+extern size_t __REDIRECT_NTH (__confstr_chk_warn,
+ (int __name, char *__buf, size_t __len,
+ size_t __buflen), __confstr_chk)
+ __warnattr ("confstr called with bigger length than size of destination "
+ "buffer");
+
+__extern_always_inline size_t
+__NTH (confstr (int __name, char *__buf, size_t __len))
+{
+ if (__bos (__buf) != (size_t) -1)
+ {
+ if (!__builtin_constant_p (__len))
+ return __confstr_chk (__name, __buf, __len, __bos (__buf));
+
+ if (__bos (__buf) < __len)
+ return __confstr_chk_warn (__name, __buf, __len, __bos (__buf));
+ }
+ return __confstr_alias (__name, __buf, __len);
+}
+
+
+extern int __getgroups_chk (int __size, __gid_t __list[], size_t __listlen)
+ __THROW __wur;
+extern int __REDIRECT_NTH (__getgroups_alias, (int __size, __gid_t __list[]),
+ getgroups) __wur;
+extern int __REDIRECT_NTH (__getgroups_chk_warn,
+ (int __size, __gid_t __list[], size_t __listlen),
+ __getgroups_chk)
+ __wur __warnattr ("getgroups called with bigger group count than what "
+ "can fit into destination buffer");
+
+__extern_always_inline int
+__NTH (getgroups (int __size, __gid_t __list[]))
+{
+ if (__bos (__list) != (size_t) -1)
+ {
+ if (!__builtin_constant_p (__size))
+ return __getgroups_chk (__size, __list, __bos (__list));
+
+ if (__size * sizeof (__gid_t) > __bos (__list))
+ return __getgroups_chk_warn (__size, __list, __bos (__list));
+ }
+ return __getgroups_alias (__size, __list);
+}
+
+
+extern int __ttyname_r_chk (int __fd, char *__buf, size_t __buflen,
+ size_t __nreal) __THROW __nonnull ((2));
+extern int __REDIRECT_NTH (__ttyname_r_alias, (int __fd, char *__buf,
+ size_t __buflen), ttyname_r)
+ __nonnull ((2));
+extern int __REDIRECT_NTH (__ttyname_r_chk_warn,
+ (int __fd, char *__buf, size_t __buflen,
+ size_t __nreal), __ttyname_r_chk)
+ __nonnull ((2)) __warnattr ("ttyname_r called with bigger buflen than "
+ "size of destination buffer");
+
+__extern_always_inline int
+__NTH (ttyname_r (int __fd, char *__buf, size_t __buflen))
+{
+ if (__bos (__buf) != (size_t) -1)
+ {
+ if (!__builtin_constant_p (__buflen))
+ return __ttyname_r_chk (__fd, __buf, __buflen, __bos (__buf));
+
+ if (__buflen > __bos (__buf))
+ return __ttyname_r_chk_warn (__fd, __buf, __buflen, __bos (__buf));
+ }
+ return __ttyname_r_alias (__fd, __buf, __buflen);
+}
+
+
+#if defined __USE_REENTRANT || defined __USE_POSIX199506
+extern int __getlogin_r_chk (char *__buf, size_t __buflen, size_t __nreal)
+ __nonnull ((1));
+extern int __REDIRECT (__getlogin_r_alias, (char *__buf, size_t __buflen),
+ getlogin_r) __nonnull ((1));
+extern int __REDIRECT (__getlogin_r_chk_warn,
+ (char *__buf, size_t __buflen, size_t __nreal),
+ __getlogin_r_chk)
+ __nonnull ((1)) __warnattr ("getlogin_r called with bigger buflen than "
+ "size of destination buffer");
+
+__extern_always_inline int
+getlogin_r (char *__buf, size_t __buflen)
+{
+ if (__bos (__buf) != (size_t) -1)
+ {
+ if (!__builtin_constant_p (__buflen))
+ return __getlogin_r_chk (__buf, __buflen, __bos (__buf));
+
+ if (__buflen > __bos (__buf))
+ return __getlogin_r_chk_warn (__buf, __buflen, __bos (__buf));
+ }
+ return __getlogin_r_alias (__buf, __buflen);
+}
+#endif
+
+
+#if defined __USE_BSD || defined __USE_UNIX98
+extern int __gethostname_chk (char *__buf, size_t __buflen, size_t __nreal)
+ __THROW __nonnull ((1));
+extern int __REDIRECT_NTH (__gethostname_alias, (char *__buf, size_t __buflen),
+ gethostname) __nonnull ((1));
+extern int __REDIRECT_NTH (__gethostname_chk_warn,
+ (char *__buf, size_t __buflen, size_t __nreal),
+ __gethostname_chk)
+ __nonnull ((1)) __warnattr ("gethostname called with bigger buflen than "
+ "size of destination buffer");
+
+__extern_always_inline int
+__NTH (gethostname (char *__buf, size_t __buflen))
+{
+ if (__bos (__buf) != (size_t) -1)
+ {
+ if (!__builtin_constant_p (__buflen))
+ return __gethostname_chk (__buf, __buflen, __bos (__buf));
+
+ if (__buflen > __bos (__buf))
+ return __gethostname_chk_warn (__buf, __buflen, __bos (__buf));
+ }
+ return __gethostname_alias (__buf, __buflen);
+}
+#endif
+
+
+#if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_UNIX98)
+extern int __getdomainname_chk (char *__buf, size_t __buflen, size_t __nreal)
+ __THROW __nonnull ((1)) __wur;
+extern int __REDIRECT_NTH (__getdomainname_alias, (char *__buf,
+ size_t __buflen),
+ getdomainname) __nonnull ((1)) __wur;
+extern int __REDIRECT_NTH (__getdomainname_chk_warn,
+ (char *__buf, size_t __buflen, size_t __nreal),
+ __getdomainname_chk)
+ __nonnull ((1)) __wur __warnattr ("getdomainname called with bigger "
+ "buflen than size of destination "
+ "buffer");
+
+__extern_always_inline int
+__NTH (getdomainname (char *__buf, size_t __buflen))
+{
+ if (__bos (__buf) != (size_t) -1)
+ {
+ if (!__builtin_constant_p (__buflen))
+ return __getdomainname_chk (__buf, __buflen, __bos (__buf));
+
+ if (__buflen > __bos (__buf))
+ return __getdomainname_chk_warn (__buf, __buflen, __bos (__buf));
+ }
+ return __getdomainname_alias (__buf, __buflen);
+}
+#endif
diff --git a/sysroot/usr/include/bits/ustat.h b/sysroot/usr/include/bits/ustat.h
new file mode 100644
index 0000000..69c6b72
--- /dev/null
+++ b/sysroot/usr/include/bits/ustat.h
@@ -0,0 +1,31 @@
+/* Copyright (C) 1997, 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_USTAT_H
+# error "Never include <bits/ustat.h> directly; use <sys/ustat.h> instead."
+#endif
+
+#include <sys/types.h>
+
+struct ustat
+ {
+ __daddr_t f_tfree; /* Number of free blocks. */
+ __ino_t f_tinode; /* Number of free inodes. */
+ char f_fname[6];
+ char f_fpack[6];
+ };
diff --git a/sysroot/usr/include/bits/utmp.h b/sysroot/usr/include/bits/utmp.h
new file mode 100644
index 0000000..e855ad7
--- /dev/null
+++ b/sysroot/usr/include/bits/utmp.h
@@ -0,0 +1,125 @@
+/* The `struct utmp' type, describing entries in the utmp file. GNU version.
+ Copyright (C) 1993, 1996, 1997, 1998, 1999, 2002
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _UTMP_H
+# error "Never include <bits/utmp.h> directly; use <utmp.h> instead."
+#endif
+
+#include <paths.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <bits/wordsize.h>
+
+
+#define UT_LINESIZE 32
+#define UT_NAMESIZE 32
+#define UT_HOSTSIZE 256
+
+
+/* The structure describing an entry in the database of
+ previous logins. */
+struct lastlog
+ {
+#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
+ int32_t ll_time;
+#else
+ __time_t ll_time;
+#endif
+ char ll_line[UT_LINESIZE];
+ char ll_host[UT_HOSTSIZE];
+ };
+
+
+/* The structure describing the status of a terminated process. This
+ type is used in `struct utmp' below. */
+struct exit_status
+ {
+ short int e_termination; /* Process termination status. */
+ short int e_exit; /* Process exit status. */
+ };
+
+
+/* The structure describing an entry in the user accounting database. */
+struct utmp
+{
+ short int ut_type; /* Type of login. */
+ pid_t ut_pid; /* Process ID of login process. */
+ char ut_line[UT_LINESIZE]; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+ char ut_user[UT_NAMESIZE]; /* Username. */
+ char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
+ struct exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+/* The ut_session and ut_tv fields must be the same size when compiled
+ 32- and 64-bit. This allows data files and shared memory to be
+ shared between 32- and 64-bit applications. */
+#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
+ int32_t ut_session; /* Session ID, used for windowing. */
+ struct
+ {
+ int32_t tv_sec; /* Seconds. */
+ int32_t tv_usec; /* Microseconds. */
+ } ut_tv; /* Time entry was made. */
+#else
+ long int ut_session; /* Session ID, used for windowing. */
+ struct timeval ut_tv; /* Time entry was made. */
+#endif
+
+ int32_t ut_addr_v6[4]; /* Internet address of remote host. */
+ char __unused[20]; /* Reserved for future use. */
+};
+
+/* Backwards compatibility hacks. */
+#define ut_name ut_user
+#ifndef _NO_UT_TIME
+/* We have a problem here: `ut_time' is also used otherwise. Define
+ _NO_UT_TIME if the compiler complains. */
+# define ut_time ut_tv.tv_sec
+#endif
+#define ut_xtime ut_tv.tv_sec
+#define ut_addr ut_addr_v6[0]
+
+
+/* Values for the `ut_type' field of a `struct utmp'. */
+#define EMPTY 0 /* No valid user accounting information. */
+
+#define RUN_LVL 1 /* The system's runlevel. */
+#define BOOT_TIME 2 /* Time of system boot. */
+#define NEW_TIME 3 /* Time after system clock changed. */
+#define OLD_TIME 4 /* Time when system clock changed. */
+
+#define INIT_PROCESS 5 /* Process spawned by the init process. */
+#define LOGIN_PROCESS 6 /* Session leader of a logged in user. */
+#define USER_PROCESS 7 /* Normal process. */
+#define DEAD_PROCESS 8 /* Terminated process. */
+
+#define ACCOUNTING 9
+
+/* Old Linux name for the EMPTY type. */
+#define UT_UNKNOWN EMPTY
+
+
+/* Tell the user that we have a modern system with UT_HOST, UT_PID,
+ UT_TYPE, UT_ID and UT_TV fields. */
+#define _HAVE_UT_TYPE 1
+#define _HAVE_UT_PID 1
+#define _HAVE_UT_ID 1
+#define _HAVE_UT_TV 1
+#define _HAVE_UT_HOST 1
diff --git a/sysroot/usr/include/bits/utmpx.h b/sysroot/usr/include/bits/utmpx.h
new file mode 100644
index 0000000..c84cda6
--- /dev/null
+++ b/sysroot/usr/include/bits/utmpx.h
@@ -0,0 +1,103 @@
+/* Structures and definitions for the user accounting database. GNU version.
+ Copyright (C) 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _UTMPX_H
+# error "Never include <bits/utmpx.h> directly; use <utmpx.h> instead."
+#endif
+
+#include <bits/types.h>
+#include <sys/time.h>
+#include <bits/wordsize.h>
+
+
+#ifdef __USE_GNU
+# include <paths.h>
+# define _PATH_UTMPX _PATH_UTMP
+# define _PATH_WTMPX _PATH_WTMP
+#endif
+
+
+#define __UT_LINESIZE 32
+#define __UT_NAMESIZE 32
+#define __UT_HOSTSIZE 256
+
+
+/* The structure describing the status of a terminated process. This
+ type is used in `struct utmpx' below. */
+struct __exit_status
+ {
+#ifdef __USE_GNU
+ short int e_termination; /* Process termination status. */
+ short int e_exit; /* Process exit status. */
+#else
+ short int __e_termination; /* Process termination status. */
+ short int __e_exit; /* Process exit status. */
+#endif
+ };
+
+
+/* The structure describing an entry in the user accounting database. */
+struct utmpx
+{
+ short int ut_type; /* Type of login. */
+ __pid_t ut_pid; /* Process ID of login process. */
+ char ut_line[__UT_LINESIZE]; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+ char ut_user[__UT_NAMESIZE]; /* Username. */
+ char ut_host[__UT_HOSTSIZE]; /* Hostname for remote login. */
+ struct __exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+
+/* The fields ut_session and ut_tv must be the same size when compiled
+ 32- and 64-bit. This allows files and shared memory to be shared
+ between 32- and 64-bit applications. */
+#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
+ __int32_t ut_session; /* Session ID, used for windowing. */
+ struct
+ {
+ __int32_t tv_sec; /* Seconds. */
+ __int32_t tv_usec; /* Microseconds. */
+ } ut_tv; /* Time entry was made. */
+#else
+ long int ut_session; /* Session ID, used for windowing. */
+ struct timeval ut_tv; /* Time entry was made. */
+#endif
+ __int32_t ut_addr_v6[4]; /* Internet address of remote host. */
+ char __unused[20]; /* Reserved for future use. */
+};
+
+
+/* Values for the `ut_type' field of a `struct utmpx'. */
+#define EMPTY 0 /* No valid user accounting information. */
+
+#ifdef __USE_GNU
+# define RUN_LVL 1 /* The system's runlevel. */
+#endif
+#define BOOT_TIME 2 /* Time of system boot. */
+#define NEW_TIME 3 /* Time after system clock changed. */
+#define OLD_TIME 4 /* Time when system clock changed. */
+
+#define INIT_PROCESS 5 /* Process spawned by the init process. */
+#define LOGIN_PROCESS 6 /* Session leader of a logged in user. */
+#define USER_PROCESS 7 /* Normal process. */
+#define DEAD_PROCESS 8 /* Terminated process. */
+
+#ifdef __USE_GNU
+# define ACCOUNTING 9 /* System accounting. */
+#endif
diff --git a/sysroot/usr/include/bits/utsname.h b/sysroot/usr/include/bits/utsname.h
new file mode 100644
index 0000000..35e71e3
--- /dev/null
+++ b/sysroot/usr/include/bits/utsname.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_UTSNAME_H
+# error "Never include <bits/utsname.h> directly; use <sys/utsname.h> instead."
+#endif
+
+/* Length of the entries in `struct utsname' is 65. */
+#define _UTSNAME_LENGTH 65
+
+/* Linux provides as additional information in the `struct utsname'
+ the name of the current domain. Define _UTSNAME_DOMAIN_LENGTH
+ to a value != 0 to activate this entry. */
+#define _UTSNAME_DOMAIN_LENGTH _UTSNAME_LENGTH
diff --git a/sysroot/usr/include/bits/waitflags.h b/sysroot/usr/include/bits/waitflags.h
new file mode 100644
index 0000000..464cedb
--- /dev/null
+++ b/sysroot/usr/include/bits/waitflags.h
@@ -0,0 +1,38 @@
+/* Definitions of flag bits for `waitpid' et al.
+ Copyright (C) 1992,1996,1997,2000,2004,2005 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#if !defined _SYS_WAIT_H && !defined _STDLIB_H
+# error "Never include <bits/waitflags.h> directly; use <sys/wait.h> instead."
+#endif
+
+
+/* Bits in the third argument to `waitpid'. */
+#define WNOHANG 1 /* Don't block waiting. */
+#define WUNTRACED 2 /* Report status of stopped children. */
+
+/* Bits in the fourth argument to `waitid'. */
+#define WSTOPPED 2 /* Report stopped child (same as WUNTRACED). */
+#define WEXITED 4 /* Report dead child. */
+#define WCONTINUED 8 /* Report continued child. */
+#define WNOWAIT 0x01000000 /* Don't reap, just poll status. */
+
+#define __WNOTHREAD 0x20000000 /* Don't wait on children of other threads
+ in this group */
+#define __WALL 0x40000000 /* Wait for any child. */
+#define __WCLONE 0x80000000 /* Wait for cloned process. */
diff --git a/sysroot/usr/include/bits/waitstatus.h b/sysroot/usr/include/bits/waitstatus.h
new file mode 100644
index 0000000..699c224
--- /dev/null
+++ b/sysroot/usr/include/bits/waitstatus.h
@@ -0,0 +1,106 @@
+/* Definitions of status bits for `wait' et al.
+ Copyright (C) 1992,1994,1996,1997,2000,2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#if !defined _SYS_WAIT_H && !defined _STDLIB_H
+# error "Never include <bits/waitstatus.h> directly; use <sys/wait.h> instead."
+#endif
+
+
+/* Everything extant so far uses these same bits. */
+
+
+/* If WIFEXITED(STATUS), the low-order 8 bits of the status. */
+#define __WEXITSTATUS(status) (((status) & 0xff00) >> 8)
+
+/* If WIFSIGNALED(STATUS), the terminating signal. */
+#define __WTERMSIG(status) ((status) & 0x7f)
+
+/* If WIFSTOPPED(STATUS), the signal that stopped the child. */
+#define __WSTOPSIG(status) __WEXITSTATUS(status)
+
+/* Nonzero if STATUS indicates normal termination. */
+#define __WIFEXITED(status) (__WTERMSIG(status) == 0)
+
+/* Nonzero if STATUS indicates termination by a signal. */
+#define __WIFSIGNALED(status) \
+ (((signed char) (((status) & 0x7f) + 1) >> 1) > 0)
+
+/* Nonzero if STATUS indicates the child is stopped. */
+#define __WIFSTOPPED(status) (((status) & 0xff) == 0x7f)
+
+/* Nonzero if STATUS indicates the child continued after a stop. We only
+ define this if <bits/waitflags.h> provides the WCONTINUED flag bit. */
+#ifdef WCONTINUED
+# define __WIFCONTINUED(status) ((status) == __W_CONTINUED)
+#endif
+
+/* Nonzero if STATUS indicates the child dumped core. */
+#define __WCOREDUMP(status) ((status) & __WCOREFLAG)
+
+/* Macros for constructing status values. */
+#define __W_EXITCODE(ret, sig) ((ret) << 8 | (sig))
+#define __W_STOPCODE(sig) ((sig) << 8 | 0x7f)
+#define __W_CONTINUED 0xffff
+#define __WCOREFLAG 0x80
+
+
+#ifdef __USE_BSD
+
+# include <endian.h>
+
+union wait
+ {
+ int w_status;
+ struct
+ {
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+ unsigned int __w_termsig:7; /* Terminating signal. */
+ unsigned int __w_coredump:1; /* Set if dumped core. */
+ unsigned int __w_retcode:8; /* Return code if exited normally. */
+ unsigned int:16;
+# endif /* Little endian. */
+# if __BYTE_ORDER == __BIG_ENDIAN
+ unsigned int:16;
+ unsigned int __w_retcode:8;
+ unsigned int __w_coredump:1;
+ unsigned int __w_termsig:7;
+# endif /* Big endian. */
+ } __wait_terminated;
+ struct
+ {
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+ unsigned int __w_stopval:8; /* W_STOPPED if stopped. */
+ unsigned int __w_stopsig:8; /* Stopping signal. */
+ unsigned int:16;
+# endif /* Little endian. */
+# if __BYTE_ORDER == __BIG_ENDIAN
+ unsigned int:16;
+ unsigned int __w_stopsig:8; /* Stopping signal. */
+ unsigned int __w_stopval:8; /* W_STOPPED if stopped. */
+# endif /* Big endian. */
+ } __wait_stopped;
+ };
+
+# define w_termsig __wait_terminated.__w_termsig
+# define w_coredump __wait_terminated.__w_coredump
+# define w_retcode __wait_terminated.__w_retcode
+# define w_stopsig __wait_stopped.__w_stopsig
+# define w_stopval __wait_stopped.__w_stopval
+
+#endif /* Use BSD. */
diff --git a/sysroot/usr/include/bits/wchar-ldbl.h b/sysroot/usr/include/bits/wchar-ldbl.h
new file mode 100644
index 0000000..80a6a68
--- /dev/null
+++ b/sysroot/usr/include/bits/wchar-ldbl.h
@@ -0,0 +1,75 @@
+/* -mlong-double-64 compatibility mode for <wchar.h> functions.
+ Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _WCHAR_H
+# error "Never include <bits/wchar-ldbl.h> directly; use <wchar.h> instead."
+#endif
+
+#if defined __USE_ISOC95 || defined __USE_UNIX98
+__BEGIN_NAMESPACE_C99
+__LDBL_REDIR_DECL (fwprintf);
+__LDBL_REDIR_DECL (wprintf);
+__LDBL_REDIR_DECL (swprintf);
+__LDBL_REDIR_DECL (vfwprintf);
+__LDBL_REDIR_DECL (vwprintf);
+__LDBL_REDIR_DECL (vswprintf);
+# if defined __USE_ISOC99 && !defined __USE_GNU \
+ && !defined __REDIRECT \
+ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K)
+__LDBL_REDIR1_DECL (fwscanf, __nldbl___isoc99_fwscanf)
+__LDBL_REDIR1_DECL (wscanf, __nldbl___isoc99_wscanf)
+__LDBL_REDIR1_DECL (swscanf, __nldbl___isoc99_swscanf)
+# else
+__LDBL_REDIR_DECL (fwscanf);
+__LDBL_REDIR_DECL (wscanf);
+__LDBL_REDIR_DECL (swscanf);
+# endif
+__END_NAMESPACE_C99
+#endif
+
+#ifdef __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+__LDBL_REDIR1_DECL (wcstold, wcstod);
+# if !defined __USE_GNU && !defined __REDIRECT \
+ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K)
+__LDBL_REDIR1_DECL (vfwscanf, __nldbl___isoc99_vfwscanf)
+__LDBL_REDIR1_DECL (vwscanf, __nldbl___isoc99_vwscanf)
+__LDBL_REDIR1_DECL (vswscanf, __nldbl___isoc99_vswscanf)
+# else
+__LDBL_REDIR_DECL (vfwscanf);
+__LDBL_REDIR_DECL (vwscanf);
+__LDBL_REDIR_DECL (vswscanf);
+# endif
+__END_NAMESPACE_C99
+#endif
+
+#ifdef __USE_GNU
+__LDBL_REDIR1_DECL (wcstold_l, wcstod_l);
+#endif
+
+#if __USE_FORTIFY_LEVEL > 0 && defined __extern_always_inline
+__LDBL_REDIR_DECL (__swprintf_chk)
+__LDBL_REDIR_DECL (__vswprintf_chk)
+# if __USE_FORTIFY_LEVEL > 1
+__LDBL_REDIR_DECL (__fwprintf_chk)
+__LDBL_REDIR_DECL (__wprintf_chk)
+__LDBL_REDIR_DECL (__vfwprintf_chk)
+__LDBL_REDIR_DECL (__vwprintf_chk)
+# endif
+#endif
diff --git a/sysroot/usr/include/bits/wchar.h b/sysroot/usr/include/bits/wchar.h
new file mode 100644
index 0000000..ef1f563
--- /dev/null
+++ b/sysroot/usr/include/bits/wchar.h
@@ -0,0 +1,26 @@
+/* wchar_t type related definitions.
+ Copyright (C) 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _BITS_WCHAR_H
+#define _BITS_WCHAR_H 1
+
+#define __WCHAR_MIN (-2147483647 - 1)
+#define __WCHAR_MAX (2147483647)
+
+#endif /* bits/wchar.h */
diff --git a/sysroot/usr/include/bits/wchar2.h b/sysroot/usr/include/bits/wchar2.h
new file mode 100644
index 0000000..2ec4ce1
--- /dev/null
+++ b/sysroot/usr/include/bits/wchar2.h
@@ -0,0 +1,590 @@
+/* Checking macros for wchar functions.
+ Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _WCHAR_H
+# error "Never include <bits/wchar2.h> directly; use <wchar.h> instead."
+#endif
+
+
+extern wchar_t *__wmemcpy_chk (wchar_t *__restrict __s1,
+ __const wchar_t *__restrict __s2, size_t __n,
+ size_t __ns1) __THROW;
+extern wchar_t *__REDIRECT_NTH (__wmemcpy_alias,
+ (wchar_t *__restrict __s1,
+ __const wchar_t *__restrict __s2, size_t __n),
+ wmemcpy);
+extern wchar_t *__REDIRECT_NTH (__wmemcpy_chk_warn,
+ (wchar_t *__restrict __s1,
+ __const wchar_t *__restrict __s2, size_t __n,
+ size_t __ns1), __wmemcpy_chk)
+ __warnattr ("wmemcpy called with length bigger than size of destination "
+ "buffer");
+
+__extern_always_inline wchar_t *
+__NTH (wmemcpy (wchar_t *__restrict __s1, __const wchar_t *__restrict __s2,
+ size_t __n))
+{
+ if (__bos0 (__s1) != (size_t) -1)
+ {
+ if (!__builtin_constant_p (__n))
+ return __wmemcpy_chk (__s1, __s2, __n,
+ __bos0 (__s1) / sizeof (wchar_t));
+
+ if (__n > __bos0 (__s1) / sizeof (wchar_t))
+ return __wmemcpy_chk_warn (__s1, __s2, __n,
+ __bos0 (__s1) / sizeof (wchar_t));
+ }
+ return __wmemcpy_alias (__s1, __s2, __n);
+}
+
+
+extern wchar_t *__wmemmove_chk (wchar_t *__s1, __const wchar_t *__s2,
+ size_t __n, size_t __ns1) __THROW;
+extern wchar_t *__REDIRECT_NTH (__wmemmove_alias, (wchar_t *__s1,
+ __const wchar_t *__s2,
+ size_t __n), wmemmove);
+extern wchar_t *__REDIRECT_NTH (__wmemmove_chk_warn,
+ (wchar_t *__restrict __s1,
+ __const wchar_t *__restrict __s2, size_t __n,
+ size_t __ns1), __wmemmove_chk)
+ __warnattr ("wmemmove called with length bigger than size of destination "
+ "buffer");
+
+__extern_always_inline wchar_t *
+__NTH (wmemmove (wchar_t *__restrict __s1, __const wchar_t *__restrict __s2,
+ size_t __n))
+{
+ if (__bos0 (__s1) != (size_t) -1)
+ {
+ if (!__builtin_constant_p (__n))
+ return __wmemmove_chk (__s1, __s2, __n,
+ __bos0 (__s1) / sizeof (wchar_t));
+
+ if (__n > __bos0 (__s1) / sizeof (wchar_t))
+ return __wmemmove_chk_warn (__s1, __s2, __n,
+ __bos0 (__s1) / sizeof (wchar_t));
+ }
+ return __wmemmove_alias (__s1, __s2, __n);
+}
+
+
+#ifdef __USE_GNU
+extern wchar_t *__wmempcpy_chk (wchar_t *__restrict __s1,
+ __const wchar_t *__restrict __s2, size_t __n,
+ size_t __ns1) __THROW;
+extern wchar_t *__REDIRECT_NTH (__wmempcpy_alias,
+ (wchar_t *__restrict __s1,
+ __const wchar_t *__restrict __s2,
+ size_t __n), wmempcpy);
+extern wchar_t *__REDIRECT_NTH (__wmempcpy_chk_warn,
+ (wchar_t *__restrict __s1,
+ __const wchar_t *__restrict __s2, size_t __n,
+ size_t __ns1), __wmempcpy_chk)
+ __warnattr ("wmempcpy called with length bigger than size of destination "
+ "buffer");
+
+__extern_always_inline wchar_t *
+__NTH (wmempcpy (wchar_t *__restrict __s1, __const wchar_t *__restrict __s2,
+ size_t __n))
+{
+ if (__bos0 (__s1) != (size_t) -1)
+ {
+ if (!__builtin_constant_p (__n))
+ return __wmempcpy_chk (__s1, __s2, __n,
+ __bos0 (__s1) / sizeof (wchar_t));
+
+ if (__n > __bos0 (__s1) / sizeof (wchar_t))
+ return __wmempcpy_chk_warn (__s1, __s2, __n,
+ __bos0 (__s1) / sizeof (wchar_t));
+ }
+ return __wmempcpy_alias (__s1, __s2, __n);
+}
+#endif
+
+
+extern wchar_t *__wmemset_chk (wchar_t *__s, wchar_t __c, size_t __n,
+ size_t __ns) __THROW;
+extern wchar_t *__REDIRECT_NTH (__wmemset_alias, (wchar_t *__s, wchar_t __c,
+ size_t __n), wmemset);
+extern wchar_t *__REDIRECT_NTH (__wmemset_chk_warn,
+ (wchar_t *__s, wchar_t __c, size_t __n,
+ size_t __ns), __wmemset_chk)
+ __warnattr ("wmemset called with length bigger than size of destination "
+ "buffer");
+
+__extern_always_inline wchar_t *
+__NTH (wmemset (wchar_t *__restrict __s, wchar_t __c, size_t __n))
+{
+ if (__bos0 (__s) != (size_t) -1)
+ {
+ if (!__builtin_constant_p (__n))
+ return __wmemset_chk (__s, __c, __n, __bos0 (__s) / sizeof (wchar_t));
+
+ if (__n > __bos0 (__s) / sizeof (wchar_t))
+ return __wmemset_chk_warn (__s, __c, __n,
+ __bos0 (__s) / sizeof (wchar_t));
+ }
+ return __wmemset_alias (__s, __c, __n);
+}
+
+
+extern wchar_t *__wcscpy_chk (wchar_t *__restrict __dest,
+ __const wchar_t *__restrict __src,
+ size_t __n) __THROW;
+extern wchar_t *__REDIRECT_NTH (__wcscpy_alias,
+ (wchar_t *__restrict __dest,
+ __const wchar_t *__restrict __src), wcscpy);
+
+__extern_always_inline wchar_t *
+__NTH (wcscpy (wchar_t *__dest, __const wchar_t *__src))
+{
+ if (__bos (__dest) != (size_t) -1)
+ return __wcscpy_chk (__dest, __src, __bos (__dest) / sizeof (wchar_t));
+ return __wcscpy_alias (__dest, __src);
+}
+
+
+extern wchar_t *__wcpcpy_chk (wchar_t *__dest, __const wchar_t *__src,
+ size_t __destlen) __THROW;
+extern wchar_t *__REDIRECT_NTH (__wcpcpy_alias, (wchar_t *__dest,
+ __const wchar_t *__src),
+ wcpcpy);
+
+__extern_always_inline wchar_t *
+__NTH (wcpcpy (wchar_t *__dest, __const wchar_t *__src))
+{
+ if (__bos (__dest) != (size_t) -1)
+ return __wcpcpy_chk (__dest, __src, __bos (__dest) / sizeof (wchar_t));
+ return __wcpcpy_alias (__dest, __src);
+}
+
+
+extern wchar_t *__wcsncpy_chk (wchar_t *__restrict __dest,
+ __const wchar_t *__restrict __src, size_t __n,
+ size_t __destlen) __THROW;
+extern wchar_t *__REDIRECT_NTH (__wcsncpy_alias,
+ (wchar_t *__restrict __dest,
+ __const wchar_t *__restrict __src,
+ size_t __n), wcsncpy);
+extern wchar_t *__REDIRECT_NTH (__wcsncpy_chk_warn,
+ (wchar_t *__restrict __dest,
+ __const wchar_t *__restrict __src,
+ size_t __n, size_t __destlen), __wcsncpy_chk)
+ __warnattr ("wcsncpy called with length bigger than size of destination "
+ "buffer");
+
+__extern_always_inline wchar_t *
+__NTH (wcsncpy (wchar_t *__dest, __const wchar_t *__src, size_t __n))
+{
+ if (__bos (__dest) != (size_t) -1)
+ {
+ if (!__builtin_constant_p (__n))
+ return __wcsncpy_chk (__dest, __src, __n,
+ __bos (__dest) / sizeof (wchar_t));
+ if (__n > __bos (__dest) / sizeof (wchar_t))
+ return __wcsncpy_chk_warn (__dest, __src, __n,
+ __bos (__dest) / sizeof (wchar_t));
+ }
+ return __wcsncpy_alias (__dest, __src, __n);
+}
+
+
+extern wchar_t *__wcpncpy_chk (wchar_t *__restrict __dest,
+ __const wchar_t *__restrict __src, size_t __n,
+ size_t __destlen) __THROW;
+extern wchar_t *__REDIRECT_NTH (__wcpncpy_alias,
+ (wchar_t *__restrict __dest,
+ __const wchar_t *__restrict __src,
+ size_t __n), wcpncpy);
+extern wchar_t *__REDIRECT_NTH (__wcpncpy_chk_warn,
+ (wchar_t *__restrict __dest,
+ __const wchar_t *__restrict __src,
+ size_t __n, size_t __destlen), __wcpncpy_chk)
+ __warnattr ("wcpncpy called with length bigger than size of destination "
+ "buffer");
+
+__extern_always_inline wchar_t *
+__NTH (wcpncpy (wchar_t *__dest, __const wchar_t *__src, size_t __n))
+{
+ if (__bos (__dest) != (size_t) -1)
+ {
+ if (!__builtin_constant_p (__n))
+ return __wcpncpy_chk (__dest, __src, __n,
+ __bos (__dest) / sizeof (wchar_t));
+ if (__n > __bos (__dest) / sizeof (wchar_t))
+ return __wcpncpy_chk_warn (__dest, __src, __n,
+ __bos (__dest) / sizeof (wchar_t));
+ }
+ return __wcpncpy_alias (__dest, __src, __n);
+}
+
+
+extern wchar_t *__wcscat_chk (wchar_t *__restrict __dest,
+ __const wchar_t *__restrict __src,
+ size_t __destlen) __THROW;
+extern wchar_t *__REDIRECT_NTH (__wcscat_alias,
+ (wchar_t *__restrict __dest,
+ __const wchar_t *__restrict __src), wcscat);
+
+__extern_always_inline wchar_t *
+__NTH (wcscat (wchar_t *__dest, __const wchar_t *__src))
+{
+ if (__bos (__dest) != (size_t) -1)
+ return __wcscat_chk (__dest, __src, __bos (__dest) / sizeof (wchar_t));
+ return __wcscat_alias (__dest, __src);
+}
+
+
+extern wchar_t *__wcsncat_chk (wchar_t *__restrict __dest,
+ __const wchar_t *__restrict __src,
+ size_t __n, size_t __destlen) __THROW;
+extern wchar_t *__REDIRECT_NTH (__wcsncat_alias,
+ (wchar_t *__restrict __dest,
+ __const wchar_t *__restrict __src,
+ size_t __n), wcsncat);
+
+__extern_always_inline wchar_t *
+__NTH (wcsncat (wchar_t *__dest, __const wchar_t *__src, size_t __n))
+{
+ if (__bos (__dest) != (size_t) -1)
+ return __wcsncat_chk (__dest, __src, __n,
+ __bos (__dest) / sizeof (wchar_t));
+ return __wcsncat_alias (__dest, __src, __n);
+}
+
+
+extern int __swprintf_chk (wchar_t *__restrict __s, size_t __n,
+ int __flag, size_t __s_len,
+ __const wchar_t *__restrict __format, ...)
+ __THROW /* __attribute__ ((__format__ (__wprintf__, 5, 6))) */;
+
+extern int __REDIRECT_NTH_LDBL (__swprintf_alias,
+ (wchar_t *__restrict __s, size_t __n,
+ __const wchar_t *__restrict __fmt, ...),
+ swprintf);
+
+#ifdef __va_arg_pack
+__extern_always_inline int
+__NTH (swprintf (wchar_t *__restrict __s, size_t __n,
+ __const wchar_t *__restrict __fmt, ...))
+{
+ if (__bos (__s) != (size_t) -1 || __USE_FORTIFY_LEVEL > 1)
+ return __swprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
+ __bos (__s) / sizeof (wchar_t),
+ __fmt, __va_arg_pack ());
+ return __swprintf_alias (__s, __n, __fmt, __va_arg_pack ());
+}
+#elif !defined __cplusplus
+/* XXX We might want to have support in gcc for swprintf. */
+# define swprintf(s, n, ...) \
+ (__bos (s) != (size_t) -1 || __USE_FORTIFY_LEVEL > 1 \
+ ? __swprintf_chk (s, n, __USE_FORTIFY_LEVEL - 1, \
+ __bos (s) / sizeof (wchar_t), __VA_ARGS__) \
+ : swprintf (s, n, __VA_ARGS__))
+#endif
+
+extern int __vswprintf_chk (wchar_t *__restrict __s, size_t __n,
+ int __flag, size_t __s_len,
+ __const wchar_t *__restrict __format,
+ __gnuc_va_list __arg)
+ __THROW /* __attribute__ ((__format__ (__wprintf__, 5, 0))) */;
+
+extern int __REDIRECT_NTH_LDBL (__vswprintf_alias,
+ (wchar_t *__restrict __s, size_t __n,
+ __const wchar_t *__restrict __fmt,
+ __gnuc_va_list __ap), vswprintf);
+
+__extern_always_inline int
+__NTH (vswprintf (wchar_t *__restrict __s, size_t __n,
+ __const wchar_t *__restrict __fmt, __gnuc_va_list __ap))
+{
+ if (__bos (__s) != (size_t) -1 || __USE_FORTIFY_LEVEL > 1)
+ return __vswprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
+ __bos (__s) / sizeof (wchar_t), __fmt, __ap);
+ return __vswprintf_alias (__s, __n, __fmt, __ap);
+}
+
+
+#if __USE_FORTIFY_LEVEL > 1
+
+extern int __fwprintf_chk (__FILE *__restrict __stream, int __flag,
+ __const wchar_t *__restrict __format, ...);
+extern int __wprintf_chk (int __flag, __const wchar_t *__restrict __format,
+ ...);
+extern int __vfwprintf_chk (__FILE *__restrict __stream, int __flag,
+ __const wchar_t *__restrict __format,
+ __gnuc_va_list __ap);
+extern int __vwprintf_chk (int __flag, __const wchar_t *__restrict __format,
+ __gnuc_va_list __ap);
+
+# ifdef __va_arg_pack
+__extern_always_inline int
+wprintf (__const wchar_t *__restrict __fmt, ...)
+{
+ return __wprintf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ());
+}
+
+__extern_always_inline int
+fwprintf (__FILE *__restrict __stream, __const wchar_t *__restrict __fmt, ...)
+{
+ return __fwprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
+ __va_arg_pack ());
+}
+# elif !defined __cplusplus
+# define wprintf(...) \
+ __wprintf_chk (__USE_FORTIFY_LEVEL - 1, __VA_ARGS__)
+# define fwprintf(stream, ...) \
+ __fwprintf_chk (stream, __USE_FORTIFY_LEVEL - 1, __VA_ARGS__)
+# endif
+
+__extern_always_inline int
+vwprintf (__const wchar_t *__restrict __fmt, __gnuc_va_list __ap)
+{
+ return __vwprintf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __ap);
+}
+
+__extern_always_inline int
+vfwprintf (__FILE *__restrict __stream,
+ __const wchar_t *__restrict __fmt, __gnuc_va_list __ap)
+{
+ return __vfwprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt, __ap);
+}
+
+#endif
+
+extern wchar_t *__fgetws_chk (wchar_t *__restrict __s, size_t __size, int __n,
+ __FILE *__restrict __stream) __wur;
+extern wchar_t *__REDIRECT (__fgetws_alias,
+ (wchar_t *__restrict __s, int __n,
+ __FILE *__restrict __stream), fgetws) __wur;
+extern wchar_t *__REDIRECT (__fgetws_chk_warn,
+ (wchar_t *__restrict __s, size_t __size, int __n,
+ __FILE *__restrict __stream), __fgetws_chk)
+ __wur __warnattr ("fgetws called with bigger size than length "
+ "of destination buffer");
+
+__extern_always_inline __wur wchar_t *
+fgetws (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream)
+{
+ if (__bos (__s) != (size_t) -1)
+ {
+ if (!__builtin_constant_p (__n) || __n <= 0)
+ return __fgetws_chk (__s, __bos (__s) / sizeof (wchar_t),
+ __n, __stream);
+
+ if ((size_t) __n > __bos (__s) / sizeof (wchar_t))
+ return __fgetws_chk_warn (__s, __bos (__s) / sizeof (wchar_t),
+ __n, __stream);
+ }
+ return __fgetws_alias (__s, __n, __stream);
+}
+
+#ifdef __USE_GNU
+extern wchar_t *__fgetws_unlocked_chk (wchar_t *__restrict __s, size_t __size,
+ int __n, __FILE *__restrict __stream)
+ __wur;
+extern wchar_t *__REDIRECT (__fgetws_unlocked_alias,
+ (wchar_t *__restrict __s, int __n,
+ __FILE *__restrict __stream), fgetws_unlocked)
+ __wur;
+extern wchar_t *__REDIRECT (__fgetws_unlocked_chk_warn,
+ (wchar_t *__restrict __s, size_t __size, int __n,
+ __FILE *__restrict __stream),
+ __fgetws_unlocked_chk)
+ __wur __warnattr ("fgetws_unlocked called with bigger size than length "
+ "of destination buffer");
+
+__extern_always_inline __wur wchar_t *
+fgetws_unlocked (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream)
+{
+ if (__bos (__s) != (size_t) -1)
+ {
+ if (!__builtin_constant_p (__n) || __n <= 0)
+ return __fgetws_unlocked_chk (__s, __bos (__s) / sizeof (wchar_t),
+ __n, __stream);
+
+ if ((size_t) __n > __bos (__s) / sizeof (wchar_t))
+ return __fgetws_unlocked_chk_warn (__s, __bos (__s) / sizeof (wchar_t),
+ __n, __stream);
+ }
+ return __fgetws_unlocked_alias (__s, __n, __stream);
+}
+#endif
+
+
+extern size_t __wcrtomb_chk (char *__s, wchar_t __wchar, mbstate_t *__p,
+ size_t __buflen) __THROW __wur;
+extern size_t __REDIRECT_NTH (__wcrtomb_alias,
+ (char *__restrict __s, wchar_t __wchar,
+ mbstate_t *__restrict __ps), wcrtomb) __wur;
+
+__extern_always_inline __wur size_t
+__NTH (wcrtomb (char *__s, wchar_t __wchar, mbstate_t *__ps))
+{
+ /* We would have to include <limits.h> to get a definition of MB_LEN_MAX.
+ But this would only disturb the namespace. So we define our own
+ version here. */
+#define __WCHAR_MB_LEN_MAX 16
+#if defined MB_LEN_MAX && MB_LEN_MAX != __WCHAR_MB_LEN_MAX
+# error "Assumed value of MB_LEN_MAX wrong"
+#endif
+ if (__bos (__s) != (size_t) -1 && __WCHAR_MB_LEN_MAX > __bos (__s))
+ return __wcrtomb_chk (__s, __wchar, __ps, __bos (__s));
+ return __wcrtomb_alias (__s, __wchar, __ps);
+}
+
+
+extern size_t __mbsrtowcs_chk (wchar_t *__restrict __dst,
+ __const char **__restrict __src,
+ size_t __len, mbstate_t *__restrict __ps,
+ size_t __dstlen) __THROW;
+extern size_t __REDIRECT_NTH (__mbsrtowcs_alias,
+ (wchar_t *__restrict __dst,
+ __const char **__restrict __src,
+ size_t __len, mbstate_t *__restrict __ps),
+ mbsrtowcs);
+extern size_t __REDIRECT_NTH (__mbsrtowcs_chk_warn,
+ (wchar_t *__restrict __dst,
+ __const char **__restrict __src,
+ size_t __len, mbstate_t *__restrict __ps,
+ size_t __dstlen), __mbsrtowcs_chk)
+ __warnattr ("mbsrtowcs called with dst buffer smaller than len "
+ "* sizeof (wchar_t)");
+
+__extern_always_inline size_t
+__NTH (mbsrtowcs (wchar_t *__restrict __dst, __const char **__restrict __src,
+ size_t __len, mbstate_t *__restrict __ps))
+{
+ if (__bos (__dst) != (size_t) -1)
+ {
+ if (!__builtin_constant_p (__len))
+ return __mbsrtowcs_chk (__dst, __src, __len, __ps,
+ __bos (__dst) / sizeof (wchar_t));
+
+ if (__len > __bos (__dst) / sizeof (wchar_t))
+ return __mbsrtowcs_chk_warn (__dst, __src, __len, __ps,
+ __bos (__dst) / sizeof (wchar_t));
+ }
+ return __mbsrtowcs_alias (__dst, __src, __len, __ps);
+}
+
+
+extern size_t __wcsrtombs_chk (char *__restrict __dst,
+ __const wchar_t **__restrict __src,
+ size_t __len, mbstate_t *__restrict __ps,
+ size_t __dstlen) __THROW;
+extern size_t __REDIRECT_NTH (__wcsrtombs_alias,
+ (char *__restrict __dst,
+ __const wchar_t **__restrict __src,
+ size_t __len, mbstate_t *__restrict __ps),
+ wcsrtombs);
+extern size_t __REDIRECT_NTH (__wcsrtombs_chk_warn,
+ (char *__restrict __dst,
+ __const wchar_t **__restrict __src,
+ size_t __len, mbstate_t *__restrict __ps,
+ size_t __dstlen), __wcsrtombs_chk)
+ __warnattr ("wcsrtombs called with dst buffer smaller than len");
+
+__extern_always_inline size_t
+__NTH (wcsrtombs (char *__restrict __dst, __const wchar_t **__restrict __src,
+ size_t __len, mbstate_t *__restrict __ps))
+{
+ if (__bos (__dst) != (size_t) -1)
+ {
+ if (!__builtin_constant_p (__len))
+ return __wcsrtombs_chk (__dst, __src, __len, __ps, __bos (__dst));
+
+ if (__len > __bos (__dst))
+ return __wcsrtombs_chk_warn (__dst, __src, __len, __ps, __bos (__dst));
+ }
+ return __wcsrtombs_alias (__dst, __src, __len, __ps);
+}
+
+
+#ifdef __USE_GNU
+extern size_t __mbsnrtowcs_chk (wchar_t *__restrict __dst,
+ __const char **__restrict __src, size_t __nmc,
+ size_t __len, mbstate_t *__restrict __ps,
+ size_t __dstlen) __THROW;
+extern size_t __REDIRECT_NTH (__mbsnrtowcs_alias,
+ (wchar_t *__restrict __dst,
+ __const char **__restrict __src, size_t __nmc,
+ size_t __len, mbstate_t *__restrict __ps),
+ mbsnrtowcs);
+extern size_t __REDIRECT_NTH (__mbsnrtowcs_chk_warn,
+ (wchar_t *__restrict __dst,
+ __const char **__restrict __src, size_t __nmc,
+ size_t __len, mbstate_t *__restrict __ps,
+ size_t __dstlen), __mbsnrtowcs_chk)
+ __warnattr ("mbsnrtowcs called with dst buffer smaller than len "
+ "* sizeof (wchar_t)");
+
+__extern_always_inline size_t
+__NTH (mbsnrtowcs (wchar_t *__restrict __dst, __const char **__restrict __src,
+ size_t __nmc, size_t __len, mbstate_t *__restrict __ps))
+{
+ if (__bos (__dst) != (size_t) -1)
+ {
+ if (!__builtin_constant_p (__len))
+ return __mbsnrtowcs_chk (__dst, __src, __nmc, __len, __ps,
+ __bos (__dst) / sizeof (wchar_t));
+
+ if (__len > __bos (__dst) / sizeof (wchar_t))
+ return __mbsnrtowcs_chk_warn (__dst, __src, __nmc, __len, __ps,
+ __bos (__dst) / sizeof (wchar_t));
+ }
+ return __mbsnrtowcs_alias (__dst, __src, __nmc, __len, __ps);
+}
+
+
+extern size_t __wcsnrtombs_chk (char *__restrict __dst,
+ __const wchar_t **__restrict __src,
+ size_t __nwc, size_t __len,
+ mbstate_t *__restrict __ps, size_t __dstlen)
+ __THROW;
+extern size_t __REDIRECT_NTH (__wcsnrtombs_alias,
+ (char *__restrict __dst,
+ __const wchar_t **__restrict __src,
+ size_t __nwc, size_t __len,
+ mbstate_t *__restrict __ps), wcsnrtombs);
+extern size_t __REDIRECT_NTH (__wcsnrtombs_chk_warn,
+ (char *__restrict __dst,
+ __const wchar_t **__restrict __src,
+ size_t __nwc, size_t __len,
+ mbstate_t *__restrict __ps,
+ size_t __dstlen), __wcsnrtombs_chk)
+ __warnattr ("wcsnrtombs called with dst buffer smaller than len");
+
+__extern_always_inline size_t
+__NTH (wcsnrtombs (char *__restrict __dst, __const wchar_t **__restrict __src,
+ size_t __nwc, size_t __len, mbstate_t *__restrict __ps))
+{
+ if (__bos (__dst) != (size_t) -1)
+ {
+ if (!__builtin_constant_p (__len))
+ return __wcsnrtombs_chk (__dst, __src, __nwc, __len, __ps,
+ __bos (__dst));
+
+ if (__len > __bos (__dst))
+ return __wcsnrtombs_chk_warn (__dst, __src, __nwc, __len, __ps,
+ __bos (__dst));
+ }
+ return __wcsnrtombs_alias (__dst, __src, __nwc, __len, __ps);
+}
+#endif
diff --git a/sysroot/usr/include/bits/wordsize.h b/sysroot/usr/include/bits/wordsize.h
new file mode 100644
index 0000000..a40a0d8
--- /dev/null
+++ b/sysroot/usr/include/bits/wordsize.h
@@ -0,0 +1,8 @@
+/* Determine the wordsize from the preprocessor defines. */
+
+#if defined __x86_64__
+# define __WORDSIZE 64
+# define __WORDSIZE_COMPAT32 1
+#else
+# define __WORDSIZE 32
+#endif
diff --git a/sysroot/usr/include/bits/xopen_lim.h b/sysroot/usr/include/bits/xopen_lim.h
new file mode 100644
index 0000000..7f36118
--- /dev/null
+++ b/sysroot/usr/include/bits/xopen_lim.h
@@ -0,0 +1,144 @@
+/* Copyright (C) 1996, 1997, 1999, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * Never include this file directly; use <limits.h> instead.
+ */
+
+/* Additional definitions from X/Open Portability Guide, Issue 4, Version 2
+ System Interfaces and Headers, 4.16 <limits.h>
+
+ Please note only the values which are not greater than the minimum
+ stated in the standard document are listed. The `sysconf' functions
+ should be used to obtain the actual value. */
+
+#ifndef _XOPEN_LIM_H
+#define _XOPEN_LIM_H 1
+
+#define __need_IOV_MAX
+#include <bits/stdio_lim.h>
+
+/* We do not provide fixed values for
+
+ ARG_MAX Maximum length of argument to the `exec' function
+ including environment data.
+
+ ATEXIT_MAX Maximum number of functions that may be registered
+ with `atexit'.
+
+ CHILD_MAX Maximum number of simultaneous processes per real
+ user ID.
+
+ OPEN_MAX Maximum number of files that one process can have open
+ at anyone time.
+
+ PAGESIZE
+ PAGE_SIZE Size of bytes of a page.
+
+ PASS_MAX Maximum number of significant bytes in a password.
+
+ We only provide a fixed limit for
+
+ IOV_MAX Maximum number of `iovec' structures that one process has
+ available for use with `readv' or writev'.
+
+ if this is indeed fixed by the underlying system.
+*/
+
+
+/* Maximum number of `iovec' structures that one process has available
+ for use with `readv' or writev'. */
+#define _XOPEN_IOV_MAX _POSIX_UIO_MAXIOV
+
+
+/* Maximum value of `digit' in calls to the `printf' and `scanf'
+ functions. We have no limit, so return a reasonable value. */
+#define NL_ARGMAX _POSIX_ARG_MAX
+
+/* Maximum number of bytes in a `LANG' name. We have no limit. */
+#define NL_LANGMAX _POSIX2_LINE_MAX
+
+/* Maximum message number. We have no limit. */
+#define NL_MSGMAX INT_MAX
+
+/* Maximum number of bytes in N-to-1 collation mapping. We have no
+ limit. */
+#define NL_NMAX INT_MAX
+
+/* Maximum set number. We have no limit. */
+#define NL_SETMAX INT_MAX
+
+/* Maximum number of bytes in a message. We have no limit. */
+#define NL_TEXTMAX INT_MAX
+
+/* Default process priority. */
+#define NZERO 20
+
+
+/* Number of bits in a word of type `int'. */
+#ifdef INT_MAX
+# if INT_MAX == 32767
+# define WORD_BIT 16
+# else
+# if INT_MAX == 2147483647
+# define WORD_BIT 32
+# else
+/* Safe assumption. */
+# define WORD_BIT 64
+# endif
+# endif
+#elif defined __INT_MAX__
+# if __INT_MAX__ == 32767
+# define WORD_BIT 16
+# else
+# if __INT_MAX__ == 2147483647
+# define WORD_BIT 32
+# else
+/* Safe assumption. */
+# define WORD_BIT 64
+# endif
+# endif
+#else
+# define WORD_BIT 32
+#endif
+
+/* Number of bits in a word of type `long int'. */
+#ifdef LONG_MAX
+# if LONG_MAX == 2147483647
+# define LONG_BIT 32
+# else
+/* Safe assumption. */
+# define LONG_BIT 64
+# endif
+#elif defined __LONG_MAX__
+# if __LONG_MAX__ == 2147483647
+# define LONG_BIT 32
+# else
+/* Safe assumption. */
+# define LONG_BIT 64
+# endif
+#else
+# include <bits/wordsize.h>
+# if __WORDSIZE == 64
+# define LONG_BIT 64
+# else
+# define LONG_BIT 32
+# endif
+#endif
+
+#endif /* bits/xopen_lim.h */
diff --git a/sysroot/usr/include/bits/xtitypes.h b/sysroot/usr/include/bits/xtitypes.h
new file mode 100644
index 0000000..c28b698
--- /dev/null
+++ b/sysroot/usr/include/bits/xtitypes.h
@@ -0,0 +1,34 @@
+/* bits/xtitypes.h -- Define some types used by <bits/stropts.h>. x86-64.
+ Copyright (C) 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _STROPTS_H
+# error "Never include <bits/xtitypes.h> directly; use <stropts.h> instead."
+#endif
+
+#ifndef _BITS_XTITYPES_H
+#define _BITS_XTITYPES_H 1
+
+#include <bits/types.h>
+
+/* This type is used by some structs in <bits/stropts.h>. */
+typedef __SLONG32_TYPE __t_scalar_t;
+typedef __ULONG32_TYPE __t_uscalar_t;
+
+
+#endif /* bits/xtitypes.h */
diff --git a/sysroot/usr/include/byteswap.h b/sysroot/usr/include/byteswap.h
new file mode 100644
index 0000000..b61d4dd
--- /dev/null
+++ b/sysroot/usr/include/byteswap.h
@@ -0,0 +1,40 @@
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _BYTESWAP_H
+#define _BYTESWAP_H 1
+
+/* Get the machine specific, optimized definitions. */
+#include <bits/byteswap.h>
+
+
+/* The following definitions must all be macros since otherwise some
+ of the possible optimizations are not possible. */
+
+/* Return a value with all bytes in the 16 bit argument swapped. */
+#define bswap_16(x) __bswap_16 (x)
+
+/* Return a value with all bytes in the 32 bit argument swapped. */
+#define bswap_32(x) __bswap_32 (x)
+
+#if defined __GNUC__ && __GNUC__ >= 2
+/* Return a value with all bytes in the 64 bit argument swapped. */
+# define bswap_64(x) __bswap_64 (x)
+#endif
+
+#endif /* byteswap.h */
diff --git a/sysroot/usr/include/complex.h b/sysroot/usr/include/complex.h
new file mode 100644
index 0000000..751aaf7
--- /dev/null
+++ b/sysroot/usr/include/complex.h
@@ -0,0 +1,114 @@
+/* Copyright (C) 1997, 1998, 1999, 2000, 2006 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99: 7.3 Complex arithmetic <complex.h>
+ */
+
+#ifndef _COMPLEX_H
+#define _COMPLEX_H 1
+
+#include <features.h>
+
+/* Get general and ISO C99 specific information. */
+#include <bits/mathdef.h>
+
+__BEGIN_DECLS
+
+/* We might need to add support for more compilers here. But since ISO
+ C99 is out hopefully all maintained compilers will soon provide the data
+ types `float complex' and `double complex'. */
+#if __GNUC_PREREQ (2, 7) && !__GNUC_PREREQ (2, 97)
+# define _Complex __complex__
+#endif
+
+#define complex _Complex
+
+/* Narrowest imaginary unit. This depends on the floating-point
+ evaluation method.
+ XXX This probably has to go into a gcc related file. */
+#define _Complex_I (__extension__ 1.0iF)
+
+/* Another more descriptive name is `I'.
+ XXX Once we have the imaginary support switch this to _Imaginary_I. */
+#undef I
+#define I _Complex_I
+
+/* The file <bits/cmathcalls.h> contains the prototypes for all the
+ actual math functions. These macros are used for those prototypes,
+ so we can easily declare each function as both `name' and `__name',
+ and can declare the float versions `namef' and `__namef'. */
+
+#define __MATHCALL(function, args) \
+ __MATHDECL (_Mdouble_complex_,function, args)
+#define __MATHDECL(type, function, args) \
+ __MATHDECL_1(type, function, args); \
+ __MATHDECL_1(type, __CONCAT(__,function), args)
+#define __MATHDECL_1(type, function, args) \
+ extern type __MATH_PRECNAME(function) args __THROW
+
+#define _Mdouble_ double
+#define __MATH_PRECNAME(name) name
+#include <bits/cmathcalls.h>
+#undef _Mdouble_
+#undef __MATH_PRECNAME
+
+/* Now the float versions. */
+#ifndef _Mfloat_
+# define _Mfloat_ float
+#endif
+#define _Mdouble_ _Mfloat_
+#ifdef __STDC__
+# define __MATH_PRECNAME(name) name##f
+#else
+# define __MATH_PRECNAME(name) name/**/f
+#endif
+#include <bits/cmathcalls.h>
+#undef _Mdouble_
+#undef __MATH_PRECNAME
+
+/* And the long double versions. It is non-critical to define them
+ here unconditionally since `long double' is required in ISO C99. */
+#if (__STDC__ - 0 || __GNUC__ - 0) \
+ && (!defined __NO_LONG_DOUBLE_MATH || defined __LDBL_COMPAT)
+# ifdef __LDBL_COMPAT
+# undef __MATHDECL_1
+# define __MATHDECL_1(type, function, args) \
+ extern type __REDIRECT_NTH(__MATH_PRECNAME(function), args, function)
+# endif
+
+# ifndef _Mlong_double_
+# define _Mlong_double_ long double
+# endif
+# define _Mdouble_ _Mlong_double_
+# ifdef __STDC__
+# define __MATH_PRECNAME(name) name##l
+# else
+# define __MATH_PRECNAME(name) name/**/l
+# endif
+# include <bits/cmathcalls.h>
+#endif
+#undef _Mdouble_
+#undef __MATH_PRECNAME
+#undef __MATHDECL_1
+#undef __MATHDECL
+#undef __MATHCALL
+
+__END_DECLS
+
+#endif /* complex.h */
diff --git a/sysroot/usr/include/cpio.h b/sysroot/usr/include/cpio.h
new file mode 100644
index 0000000..fae3275
--- /dev/null
+++ b/sysroot/usr/include/cpio.h
@@ -0,0 +1,74 @@
+/* Extended cpio format from POSIX.1.
+ This file is part of the GNU C Library.
+ Copyright (C) 1992, 1998 Free Software Foundation, Inc.
+ NOTE: The canonical source of this file is maintained with the GNU cpio.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _CPIO_H
+#define _CPIO_H 1
+
+/* A cpio archive consists of a sequence of files.
+ Each file has a 76 byte header,
+ a variable length, NUL terminated filename,
+ and variable length file data.
+ A header for a filename "TRAILER!!!" indicates the end of the archive. */
+
+/* All the fields in the header are ISO 646 (approximately ASCII) strings
+ of octal numbers, left padded, not NUL terminated.
+
+ Field Name Length in Bytes Notes
+ c_magic 6 must be "070707"
+ c_dev 6
+ c_ino 6
+ c_mode 6 see below for value
+ c_uid 6
+ c_gid 6
+ c_nlink 6
+ c_rdev 6 only valid for chr and blk special files
+ c_mtime 11
+ c_namesize 6 count includes terminating NUL in pathname
+ c_filesize 11 must be 0 for FIFOs and directories */
+
+/* Value for the field `c_magic'. */
+#define MAGIC "070707"
+
+/* Values for c_mode, OR'd together: */
+
+#define C_IRUSR 000400
+#define C_IWUSR 000200
+#define C_IXUSR 000100
+#define C_IRGRP 000040
+#define C_IWGRP 000020
+#define C_IXGRP 000010
+#define C_IROTH 000004
+#define C_IWOTH 000002
+#define C_IXOTH 000001
+
+#define C_ISUID 004000
+#define C_ISGID 002000
+#define C_ISVTX 001000
+
+#define C_ISBLK 060000
+#define C_ISCHR 020000
+#define C_ISDIR 040000
+#define C_ISFIFO 010000
+#define C_ISSOCK 0140000
+#define C_ISLNK 0120000
+#define C_ISCTG 0110000
+#define C_ISREG 0100000
+
+#endif /* cpio.h */
diff --git a/sysroot/usr/include/crypt.h b/sysroot/usr/include/crypt.h
new file mode 100644
index 0000000..dcb89d8
--- /dev/null
+++ b/sysroot/usr/include/crypt.h
@@ -0,0 +1,75 @@
+/*
+ * UFC-crypt: ultra fast crypt(3) implementation
+ *
+ * Copyright (C) 1991,92,93,96,97,98,2000,2004 Free Software Foundation, Inc.
+ *
+ * The GNU C Library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * The GNU C Library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with the GNU C Library; if not, write to the Free
+ * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307 USA.
+ *
+ * @(#)crypt.h 1.5 12/20/96
+ *
+ */
+
+#ifndef _CRYPT_H
+#define _CRYPT_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Encrypt at most 8 characters from KEY using salt to perturb DES. */
+extern char *crypt (__const char *__key, __const char *__salt)
+ __THROW __nonnull ((1, 2));
+
+/* Setup DES tables according KEY. */
+extern void setkey (__const char *__key) __THROW __nonnull ((1));
+
+/* Encrypt data in BLOCK in place if EDFLAG is zero; otherwise decrypt
+ block in place. */
+extern void encrypt (char *__block, int __edflag) __THROW __nonnull ((1));
+
+#ifdef __USE_GNU
+/* Reentrant versions of the functions above. The additional argument
+ points to a structure where the results are placed in. */
+struct crypt_data
+ {
+ char keysched[16 * 8];
+ char sb0[32768];
+ char sb1[32768];
+ char sb2[32768];
+ char sb3[32768];
+ /* end-of-aligment-critical-data */
+ char crypt_3_buf[14];
+ char current_salt[2];
+ long int current_saltbits;
+ int direction, initialized;
+ };
+
+extern char *crypt_r (__const char *__key, __const char *__salt,
+ struct crypt_data * __restrict __data)
+ __THROW __nonnull ((1, 2, 3));
+
+extern void setkey_r (__const char *__key,
+ struct crypt_data * __restrict __data)
+ __THROW __nonnull ((1, 2));
+
+extern void encrypt_r (char *__block, int __edflag,
+ struct crypt_data * __restrict __data)
+ __THROW __nonnull ((1, 3));
+#endif
+
+__END_DECLS
+
+#endif /* crypt.h */
diff --git a/sysroot/usr/include/ctype.h b/sysroot/usr/include/ctype.h
new file mode 100644
index 0000000..9ae7fb6
--- /dev/null
+++ b/sysroot/usr/include/ctype.h
@@ -0,0 +1,325 @@
+/* Copyright (C) 1991,92,93,95,96,97,98,99,2001,2002,2004,2007
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99 Standard 7.4: Character handling <ctype.h>
+ */
+
+#ifndef _CTYPE_H
+#define _CTYPE_H 1
+
+#include <features.h>
+#include <bits/types.h>
+
+__BEGIN_DECLS
+
+#ifndef _ISbit
+/* These are all the characteristics of characters.
+ If there get to be more than 16 distinct characteristics,
+ many things must be changed that use `unsigned short int's.
+
+ The characteristics are stored always in network byte order (big
+ endian). We define the bit value interpretations here dependent on the
+ machine's byte order. */
+
+# include <endian.h>
+# if __BYTE_ORDER == __BIG_ENDIAN
+# define _ISbit(bit) (1 << (bit))
+# else /* __BYTE_ORDER == __LITTLE_ENDIAN */
+# define _ISbit(bit) ((bit) < 8 ? ((1 << (bit)) << 8) : ((1 << (bit)) >> 8))
+# endif
+
+enum
+{
+ _ISupper = _ISbit (0), /* UPPERCASE. */
+ _ISlower = _ISbit (1), /* lowercase. */
+ _ISalpha = _ISbit (2), /* Alphabetic. */
+ _ISdigit = _ISbit (3), /* Numeric. */
+ _ISxdigit = _ISbit (4), /* Hexadecimal numeric. */
+ _ISspace = _ISbit (5), /* Whitespace. */
+ _ISprint = _ISbit (6), /* Printing. */
+ _ISgraph = _ISbit (7), /* Graphical. */
+ _ISblank = _ISbit (8), /* Blank (usually SPC and TAB). */
+ _IScntrl = _ISbit (9), /* Control character. */
+ _ISpunct = _ISbit (10), /* Punctuation. */
+ _ISalnum = _ISbit (11) /* Alphanumeric. */
+};
+#endif /* ! _ISbit */
+
+/* These are defined in ctype-info.c.
+ The declarations here must match those in localeinfo.h.
+
+ In the thread-specific locale model (see `uselocale' in <locale.h>)
+ we cannot use global variables for these as was done in the past.
+ Instead, the following accessor functions return the address of
+ each variable, which is local to the current thread if multithreaded.
+
+ These point into arrays of 384, so they can be indexed by any `unsigned
+ char' value [0,255]; by EOF (-1); or by any `signed char' value
+ [-128,-1). ISO C requires that the ctype functions work for `unsigned
+ char' values and for EOF; we also support negative `signed char' values
+ for broken old programs. The case conversion arrays are of `int's
+ rather than `unsigned char's because tolower (EOF) must be EOF, which
+ doesn't fit into an `unsigned char'. But today more important is that
+ the arrays are also used for multi-byte character sets. */
+extern __const unsigned short int **__ctype_b_loc (void)
+ __attribute__ ((__const));
+extern __const __int32_t **__ctype_tolower_loc (void)
+ __attribute__ ((__const));
+extern __const __int32_t **__ctype_toupper_loc (void)
+ __attribute__ ((__const));
+
+#define __isctype(c, type) \
+ ((*__ctype_b_loc ())[(int) (c)] & (unsigned short int) type)
+
+#define __isascii(c) (((c) & ~0x7f) == 0) /* If C is a 7 bit value. */
+#define __toascii(c) ((c) & 0x7f) /* Mask off high bits. */
+
+#define __exctype(name) extern int name (int) __THROW
+
+__BEGIN_NAMESPACE_STD
+
+/* The following names are all functions:
+ int isCHARACTERISTIC(int c);
+ which return nonzero iff C has CHARACTERISTIC.
+ For the meaning of the characteristic names, see the `enum' above. */
+__exctype (isalnum);
+__exctype (isalpha);
+__exctype (iscntrl);
+__exctype (isdigit);
+__exctype (islower);
+__exctype (isgraph);
+__exctype (isprint);
+__exctype (ispunct);
+__exctype (isspace);
+__exctype (isupper);
+__exctype (isxdigit);
+
+
+/* Return the lowercase version of C. */
+extern int tolower (int __c) __THROW;
+
+/* Return the uppercase version of C. */
+extern int toupper (int __c) __THROW;
+
+__END_NAMESPACE_STD
+
+
+/* ISO C99 introduced one new function. */
+#ifdef __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+
+__exctype (isblank);
+
+__END_NAMESPACE_C99
+#endif
+
+#ifdef __USE_GNU
+/* Test C for a set of character classes according to MASK. */
+extern int isctype (int __c, int __mask) __THROW;
+#endif
+
+#if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN
+
+/* Return nonzero iff C is in the ASCII set
+ (i.e., is no more than 7 bits wide). */
+extern int isascii (int __c) __THROW;
+
+/* Return the part of C that is in the ASCII set
+ (i.e., the low-order 7 bits of C). */
+extern int toascii (int __c) __THROW;
+
+/* These are the same as `toupper' and `tolower' except that they do not
+ check the argument for being in the range of a `char'. */
+__exctype (_toupper);
+__exctype (_tolower);
+#endif /* Use SVID or use misc. */
+
+/* This code is needed for the optimized mapping functions. */
+#define __tobody(c, f, a, args) \
+ (__extension__ \
+ ({ int __res; \
+ if (sizeof (c) > 1) \
+ { \
+ if (__builtin_constant_p (c)) \
+ { \
+ int __c = (c); \
+ __res = __c < -128 || __c > 255 ? __c : (a)[__c]; \
+ } \
+ else \
+ __res = f args; \
+ } \
+ else \
+ __res = (a)[(int) (c)]; \
+ __res; }))
+
+#if !defined __NO_CTYPE && !defined __cplusplus
+# define isalnum(c) __isctype((c), _ISalnum)
+# define isalpha(c) __isctype((c), _ISalpha)
+# define iscntrl(c) __isctype((c), _IScntrl)
+# define isdigit(c) __isctype((c), _ISdigit)
+# define islower(c) __isctype((c), _ISlower)
+# define isgraph(c) __isctype((c), _ISgraph)
+# define isprint(c) __isctype((c), _ISprint)
+# define ispunct(c) __isctype((c), _ISpunct)
+# define isspace(c) __isctype((c), _ISspace)
+# define isupper(c) __isctype((c), _ISupper)
+# define isxdigit(c) __isctype((c), _ISxdigit)
+
+# ifdef __USE_ISOC99
+# define isblank(c) __isctype((c), _ISblank)
+# endif
+
+# ifdef __USE_EXTERN_INLINES
+__extern_inline int
+__NTH (tolower (int __c))
+{
+ return __c >= -128 && __c < 256 ? (*__ctype_tolower_loc ())[__c] : __c;
+}
+
+__extern_inline int
+__NTH (toupper (int __c))
+{
+ return __c >= -128 && __c < 256 ? (*__ctype_toupper_loc ())[__c] : __c;
+}
+# endif
+
+# if __GNUC__ >= 2 && defined __OPTIMIZE__ && !defined __cplusplus
+# define tolower(c) __tobody (c, tolower, *__ctype_tolower_loc (), (c))
+# define toupper(c) __tobody (c, toupper, *__ctype_toupper_loc (), (c))
+# endif /* Optimizing gcc */
+
+# if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN
+# define isascii(c) __isascii (c)
+# define toascii(c) __toascii (c)
+
+# define _tolower(c) ((int) (*__ctype_tolower_loc ())[(int) (c)])
+# define _toupper(c) ((int) (*__ctype_toupper_loc ())[(int) (c)])
+# endif
+
+#endif /* Not __NO_CTYPE. */
+
+
+#ifdef __USE_GNU
+/* The concept of one static locale per category is not very well
+ thought out. Many applications will need to process its data using
+ information from several different locales. Another application is
+ the implementation of the internationalization handling in the
+ upcoming ISO C++ standard library. To support this another set of
+ the functions using locale data exist which have an additional
+ argument.
+
+ Attention: all these functions are *not* standardized in any form.
+ This is a proof-of-concept implementation. */
+
+/* Structure for reentrant locale using functions. This is an
+ (almost) opaque type for the user level programs. */
+# include <xlocale.h>
+
+/* These definitions are similar to the ones above but all functions
+ take as an argument a handle for the locale which shall be used. */
+# define __isctype_l(c, type, locale) \
+ ((locale)->__ctype_b[(int) (c)] & (unsigned short int) type)
+
+# define __exctype_l(name) \
+ extern int name (int, __locale_t) __THROW
+
+/* The following names are all functions:
+ int isCHARACTERISTIC(int c, locale_t *locale);
+ which return nonzero iff C has CHARACTERISTIC.
+ For the meaning of the characteristic names, see the `enum' above. */
+__exctype_l (isalnum_l);
+__exctype_l (isalpha_l);
+__exctype_l (iscntrl_l);
+__exctype_l (isdigit_l);
+__exctype_l (islower_l);
+__exctype_l (isgraph_l);
+__exctype_l (isprint_l);
+__exctype_l (ispunct_l);
+__exctype_l (isspace_l);
+__exctype_l (isupper_l);
+__exctype_l (isxdigit_l);
+
+__exctype_l (isblank_l);
+
+
+/* Return the lowercase version of C in locale L. */
+extern int __tolower_l (int __c, __locale_t __l) __THROW;
+extern int tolower_l (int __c, __locale_t __l) __THROW;
+
+/* Return the uppercase version of C. */
+extern int __toupper_l (int __c, __locale_t __l) __THROW;
+extern int toupper_l (int __c, __locale_t __l) __THROW;
+
+# if __GNUC__ >= 2 && defined __OPTIMIZE__ && !defined __cplusplus
+# define __tolower_l(c, locale) \
+ __tobody (c, __tolower_l, (locale)->__ctype_tolower, (c, locale))
+# define __toupper_l(c, locale) \
+ __tobody (c, __toupper_l, (locale)->__ctype_toupper, (c, locale))
+# define tolower_l(c, locale) __tolower_l ((c), (locale))
+# define toupper_l(c, locale) __toupper_l ((c), (locale))
+# endif /* Optimizing gcc */
+
+
+# ifndef __NO_CTYPE
+# define __isalnum_l(c,l) __isctype_l((c), _ISalnum, (l))
+# define __isalpha_l(c,l) __isctype_l((c), _ISalpha, (l))
+# define __iscntrl_l(c,l) __isctype_l((c), _IScntrl, (l))
+# define __isdigit_l(c,l) __isctype_l((c), _ISdigit, (l))
+# define __islower_l(c,l) __isctype_l((c), _ISlower, (l))
+# define __isgraph_l(c,l) __isctype_l((c), _ISgraph, (l))
+# define __isprint_l(c,l) __isctype_l((c), _ISprint, (l))
+# define __ispunct_l(c,l) __isctype_l((c), _ISpunct, (l))
+# define __isspace_l(c,l) __isctype_l((c), _ISspace, (l))
+# define __isupper_l(c,l) __isctype_l((c), _ISupper, (l))
+# define __isxdigit_l(c,l) __isctype_l((c), _ISxdigit, (l))
+
+# define __isblank_l(c,l) __isctype_l((c), _ISblank, (l))
+
+# if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN
+# define __isascii_l(c,l) ((l), __isascii (c))
+# define __toascii_l(c,l) ((l), __toascii (c))
+# endif
+
+# define isalnum_l(c,l) __isalnum_l ((c), (l))
+# define isalpha_l(c,l) __isalpha_l ((c), (l))
+# define iscntrl_l(c,l) __iscntrl_l ((c), (l))
+# define isdigit_l(c,l) __isdigit_l ((c), (l))
+# define islower_l(c,l) __islower_l ((c), (l))
+# define isgraph_l(c,l) __isgraph_l ((c), (l))
+# define isprint_l(c,l) __isprint_l ((c), (l))
+# define ispunct_l(c,l) __ispunct_l ((c), (l))
+# define isspace_l(c,l) __isspace_l ((c), (l))
+# define isupper_l(c,l) __isupper_l ((c), (l))
+# define isxdigit_l(c,l) __isxdigit_l ((c), (l))
+
+# define isblank_l(c,l) __isblank_l ((c), (l))
+
+# if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN
+# define isascii_l(c,l) __isascii_l ((c), (l))
+# define toascii_l(c,l) __toascii_l ((c), (l))
+# endif
+
+# endif /* Not __NO_CTYPE. */
+
+#endif /* Use GNU. */
+
+__END_DECLS
+
+#endif /* ctype.h */
diff --git a/sysroot/usr/include/curses.h b/sysroot/usr/include/curses.h
new file mode 100644
index 0000000..4780dc1
--- /dev/null
+++ b/sysroot/usr/include/curses.h
@@ -0,0 +1,1498 @@
+/****************************************************************************
+ * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
+ * and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ * and: Thomas E. Dickey 1996-on *
+ ****************************************************************************/
+
+/* $Id: curses.h.in,v 1.181 2007/11/18 00:32:03 tom Exp $ */
+
+#ifndef __NCURSES_H
+#define __NCURSES_H
+
+#define CURSES 1
+#define CURSES_H 1
+
+/* This should be defined for the enhanced functionality to be visible.
+ * However, some of the wide-character (enhanced) functionality is missing.
+ * So we do not define it (yet).
+#define _XOPEN_CURSES 1
+ */
+
+/* These are defined only in curses.h, and are used for conditional compiles */
+#define NCURSES_VERSION_MAJOR 5
+#define NCURSES_VERSION_MINOR 6
+#define NCURSES_VERSION_PATCH 20071124
+
+/* This is defined in more than one ncurses header, for identification */
+#undef NCURSES_VERSION
+#define NCURSES_VERSION "5.6"
+
+/*
+ * Identify the mouse encoding version.
+ */
+#define NCURSES_MOUSE_VERSION 1
+
+/*
+ * Definitions to facilitate DLL's.
+ */
+#include <ncurses_dll.h>
+
+/*
+ * User-definable tweak to disable the include of <stdbool.h>.
+ */
+#ifndef NCURSES_ENABLE_STDBOOL_H
+#define NCURSES_ENABLE_STDBOOL_H 1
+#endif
+
+/*
+ * NCURSES_ATTR_T is used to quiet compiler warnings when building ncurses
+ * configured using --disable-macros.
+ */
+#ifdef NCURSES_NOMACROS
+#ifndef NCURSES_ATTR_T
+#define NCURSES_ATTR_T attr_t
+#endif
+#endif /* NCURSES_NOMACROS */
+
+#ifndef NCURSES_ATTR_T
+#define NCURSES_ATTR_T int
+#endif
+
+/*
+ * Expands to 'const' if ncurses is configured using --enable-const. Note that
+ * doing so makes it incompatible with other implementations of X/Open Curses.
+ */
+#undef NCURSES_CONST
+#define NCURSES_CONST const
+
+#undef NCURSES_INLINE
+#define NCURSES_INLINE inline
+
+/*
+ * The internal type used for color values
+ */
+#undef NCURSES_COLOR_T
+#define NCURSES_COLOR_T short
+
+/*
+ * Definition used to make WINDOW and similar structs opaque.
+ */
+#ifndef NCURSES_OPAQUE
+#define NCURSES_OPAQUE 0
+#endif
+
+/*
+ * The internal type used for window dimensions.
+ */
+#undef NCURSES_SIZE_T
+#define NCURSES_SIZE_T short
+
+/*
+ * Control whether tparm() supports varargs or fixed-parameter list.
+ */
+#undef NCURSES_TPARM_VARARGS
+#define NCURSES_TPARM_VARARGS 1
+
+/*
+ * NCURSES_CH_T is used in building the library, but not used otherwise in
+ * this header file, since that would make the normal/wide-character versions
+ * of the header incompatible.
+ */
+#undef NCURSES_CH_T
+#define NCURSES_CH_T chtype
+
+#if 0 && defined(_LP64)
+typedef unsigned chtype;
+typedef unsigned mmask_t;
+#else
+typedef unsigned long chtype;
+typedef unsigned long mmask_t;
+#endif
+
+#include <stdio.h>
+#include <unctrl.h>
+#include <stdarg.h> /* we need va_list */
+#ifdef _XOPEN_SOURCE_EXTENDED
+#include <stddef.h> /* we want wchar_t */
+#endif /* _XOPEN_SOURCE_EXTENDED */
+
+/* X/Open and SVr4 specify that curses implements 'bool'. However, C++ may also
+ * implement it. If so, we must use the C++ compiler's type to avoid conflict
+ * with other interfaces.
+ *
+ * A further complication is that <stdbool.h> may declare 'bool' to be a
+ * different type, such as an enum which is not necessarily compatible with
+ * C++. If we have <stdbool.h>, make 'bool' a macro, so users may #undef it.
+ * Otherwise, let it remain a typedef to avoid conflicts with other #define's.
+ * In either case, make a typedef for NCURSES_BOOL which can be used if needed
+ * from either C or C++.
+ */
+
+#undef TRUE
+#define TRUE 1
+
+#undef FALSE
+#define FALSE 0
+
+typedef unsigned char NCURSES_BOOL;
+
+#if defined(__cplusplus) /* __cplusplus, etc. */
+
+/* use the C++ compiler's bool type */
+#define NCURSES_BOOL bool
+
+#else /* c89, c99, etc. */
+
+#if NCURSES_ENABLE_STDBOOL_H
+#include <stdbool.h>
+/* use whatever the C compiler decides bool really is */
+#define NCURSES_BOOL bool
+#else
+/* there is no predefined bool - use our own */
+#undef bool
+#define bool NCURSES_BOOL
+#endif
+
+#endif /* !__cplusplus, etc. */
+
+#ifdef __cplusplus
+extern "C" {
+#define NCURSES_CAST(type,value) static_cast<type>(value)
+#else
+#define NCURSES_CAST(type,value) (type)(value)
+#endif
+
+/*
+ * X/Open attributes. In the ncurses implementation, they are identical to the
+ * A_ attributes.
+ */
+#define WA_ATTRIBUTES A_ATTRIBUTES
+#define WA_NORMAL A_NORMAL
+#define WA_STANDOUT A_STANDOUT
+#define WA_UNDERLINE A_UNDERLINE
+#define WA_REVERSE A_REVERSE
+#define WA_BLINK A_BLINK
+#define WA_DIM A_DIM
+#define WA_BOLD A_BOLD
+#define WA_ALTCHARSET A_ALTCHARSET
+#define WA_INVIS A_INVIS
+#define WA_PROTECT A_PROTECT
+#define WA_HORIZONTAL A_HORIZONTAL
+#define WA_LEFT A_LEFT
+#define WA_LOW A_LOW
+#define WA_RIGHT A_RIGHT
+#define WA_TOP A_TOP
+#define WA_VERTICAL A_VERTICAL
+
+/* colors */
+#define COLOR_BLACK 0
+#define COLOR_RED 1
+#define COLOR_GREEN 2
+#define COLOR_YELLOW 3
+#define COLOR_BLUE 4
+#define COLOR_MAGENTA 5
+#define COLOR_CYAN 6
+#define COLOR_WHITE 7
+
+/* line graphics */
+
+#if 0 || 0
+NCURSES_WRAPPED_VAR(chtype*, acs_map);
+#define acs_map (_nc_acs_map())
+#else
+extern NCURSES_EXPORT_VAR(chtype) acs_map[];
+#endif
+
+#define NCURSES_ACS(c) (acs_map[NCURSES_CAST(unsigned char,c)])
+
+/* VT100 symbols begin here */
+#define ACS_ULCORNER NCURSES_ACS('l') /* upper left corner */
+#define ACS_LLCORNER NCURSES_ACS('m') /* lower left corner */
+#define ACS_URCORNER NCURSES_ACS('k') /* upper right corner */
+#define ACS_LRCORNER NCURSES_ACS('j') /* lower right corner */
+#define ACS_LTEE NCURSES_ACS('t') /* tee pointing right */
+#define ACS_RTEE NCURSES_ACS('u') /* tee pointing left */
+#define ACS_BTEE NCURSES_ACS('v') /* tee pointing up */
+#define ACS_TTEE NCURSES_ACS('w') /* tee pointing down */
+#define ACS_HLINE NCURSES_ACS('q') /* horizontal line */
+#define ACS_VLINE NCURSES_ACS('x') /* vertical line */
+#define ACS_PLUS NCURSES_ACS('n') /* large plus or crossover */
+#define ACS_S1 NCURSES_ACS('o') /* scan line 1 */
+#define ACS_S9 NCURSES_ACS('s') /* scan line 9 */
+#define ACS_DIAMOND NCURSES_ACS('`') /* diamond */
+#define ACS_CKBOARD NCURSES_ACS('a') /* checker board (stipple) */
+#define ACS_DEGREE NCURSES_ACS('f') /* degree symbol */
+#define ACS_PLMINUS NCURSES_ACS('g') /* plus/minus */
+#define ACS_BULLET NCURSES_ACS('~') /* bullet */
+/* Teletype 5410v1 symbols begin here */
+#define ACS_LARROW NCURSES_ACS(',') /* arrow pointing left */
+#define ACS_RARROW NCURSES_ACS('+') /* arrow pointing right */
+#define ACS_DARROW NCURSES_ACS('.') /* arrow pointing down */
+#define ACS_UARROW NCURSES_ACS('-') /* arrow pointing up */
+#define ACS_BOARD NCURSES_ACS('h') /* board of squares */
+#define ACS_LANTERN NCURSES_ACS('i') /* lantern symbol */
+#define ACS_BLOCK NCURSES_ACS('0') /* solid square block */
+/*
+ * These aren't documented, but a lot of System Vs have them anyway
+ * (you can spot pprryyzz{{||}} in a lot of AT&T terminfo strings).
+ * The ACS_names may not match AT&T's, our source didn't know them.
+ */
+#define ACS_S3 NCURSES_ACS('p') /* scan line 3 */
+#define ACS_S7 NCURSES_ACS('r') /* scan line 7 */
+#define ACS_LEQUAL NCURSES_ACS('y') /* less/equal */
+#define ACS_GEQUAL NCURSES_ACS('z') /* greater/equal */
+#define ACS_PI NCURSES_ACS('{') /* Pi */
+#define ACS_NEQUAL NCURSES_ACS('|') /* not equal */
+#define ACS_STERLING NCURSES_ACS('}') /* UK pound sign */
+
+/*
+ * Line drawing ACS names are of the form ACS_trbl, where t is the top, r
+ * is the right, b is the bottom, and l is the left. t, r, b, and l might
+ * be B (blank), S (single), D (double), or T (thick). The subset defined
+ * here only uses B and S.
+ */
+#define ACS_BSSB ACS_ULCORNER
+#define ACS_SSBB ACS_LLCORNER
+#define ACS_BBSS ACS_URCORNER
+#define ACS_SBBS ACS_LRCORNER
+#define ACS_SBSS ACS_RTEE
+#define ACS_SSSB ACS_LTEE
+#define ACS_SSBS ACS_BTEE
+#define ACS_BSSS ACS_TTEE
+#define ACS_BSBS ACS_HLINE
+#define ACS_SBSB ACS_VLINE
+#define ACS_SSSS ACS_PLUS
+
+#undef ERR
+#define ERR (-1)
+
+#undef OK
+#define OK (0)
+
+/* values for the _flags member */
+#define _SUBWIN 0x01 /* is this a sub-window? */
+#define _ENDLINE 0x02 /* is the window flush right? */
+#define _FULLWIN 0x04 /* is the window full-screen? */
+#define _SCROLLWIN 0x08 /* bottom edge is at screen bottom? */
+#define _ISPAD 0x10 /* is this window a pad? */
+#define _HASMOVED 0x20 /* has cursor moved since last refresh? */
+#define _WRAPPED 0x40 /* cursor was just wrappped */
+
+/*
+ * this value is used in the firstchar and lastchar fields to mark
+ * unchanged lines
+ */
+#define _NOCHANGE -1
+
+/*
+ * this value is used in the oldindex field to mark lines created by insertions
+ * and scrolls.
+ */
+#define _NEWINDEX -1
+
+typedef struct screen SCREEN;
+typedef struct _win_st WINDOW;
+
+typedef chtype attr_t; /* ...must be at least as wide as chtype */
+
+#ifdef _XOPEN_SOURCE_EXTENDED
+
+#if 0
+#ifdef mblen /* libutf8.h defines it w/o undefining first */
+#undef mblen
+#endif
+#include <libutf8.h>
+#endif
+
+#if 0
+#include <wchar.h> /* ...to get mbstate_t, etc. */
+#endif
+
+#if 0
+typedef unsigned short wchar_t;
+#endif
+
+#if 0
+typedef unsigned int wint_t;
+#endif
+
+#define CCHARW_MAX 5
+typedef struct
+{
+ attr_t attr;
+ wchar_t chars[CCHARW_MAX];
+#if 0
+#undef NCURSES_EXT_COLORS
+#define NCURSES_EXT_COLORS 20071124
+ int ext_color; /* color pair, must be more than 16-bits */
+#endif
+}
+cchar_t;
+
+#endif /* _XOPEN_SOURCE_EXTENDED */
+
+#if !NCURSES_OPAQUE
+struct ldat;
+
+struct _win_st
+{
+ NCURSES_SIZE_T _cury, _curx; /* current cursor position */
+
+ /* window location and size */
+ NCURSES_SIZE_T _maxy, _maxx; /* maximums of x and y, NOT window size */
+ NCURSES_SIZE_T _begy, _begx; /* screen coords of upper-left-hand corner */
+
+ short _flags; /* window state flags */
+
+ /* attribute tracking */
+ attr_t _attrs; /* current attribute for non-space character */
+ chtype _bkgd; /* current background char/attribute pair */
+
+ /* option values set by user */
+ bool _notimeout; /* no time out on function-key entry? */
+ bool _clear; /* consider all data in the window invalid? */
+ bool _leaveok; /* OK to not reset cursor on exit? */
+ bool _scroll; /* OK to scroll this window? */
+ bool _idlok; /* OK to use insert/delete line? */
+ bool _idcok; /* OK to use insert/delete char? */
+ bool _immed; /* window in immed mode? (not yet used) */
+ bool _sync; /* window in sync mode? */
+ bool _use_keypad; /* process function keys into KEY_ symbols? */
+ int _delay; /* 0 = nodelay, <0 = blocking, >0 = delay */
+
+ struct ldat *_line; /* the actual line data */
+
+ /* global screen state */
+ NCURSES_SIZE_T _regtop; /* top line of scrolling region */
+ NCURSES_SIZE_T _regbottom; /* bottom line of scrolling region */
+
+ /* these are used only if this is a sub-window */
+ int _parx; /* x coordinate of this window in parent */
+ int _pary; /* y coordinate of this window in parent */
+ WINDOW *_parent; /* pointer to parent if a sub-window */
+
+ /* these are used only if this is a pad */
+ struct pdat
+ {
+ NCURSES_SIZE_T _pad_y, _pad_x;
+ NCURSES_SIZE_T _pad_top, _pad_left;
+ NCURSES_SIZE_T _pad_bottom, _pad_right;
+ } _pad;
+
+ NCURSES_SIZE_T _yoffset; /* real begy is _begy + _yoffset */
+
+#ifdef _XOPEN_SOURCE_EXTENDED
+ cchar_t _bkgrnd; /* current background char/attribute pair */
+#if 0
+ int _color; /* current color-pair for non-space character */
+#endif
+#endif
+};
+#endif /* NCURSES_OPAQUE */
+
+/*
+ * This is an extension to support events...
+ */
+#if 1
+#ifdef NCURSES_WGETCH_EVENTS
+#if !defined(__BEOS__) /* Fix _nc_timed_wait() on BEOS... */
+# define NCURSES_EVENT_VERSION 1
+#endif /* !defined(__BEOS__) */
+
+/*
+ * Bits to set in _nc_event.data.flags
+ */
+# define _NC_EVENT_TIMEOUT_MSEC 1
+# define _NC_EVENT_FILE 2
+# define _NC_EVENT_FILE_READABLE 2
+# if 0 /* Not supported yet... */
+# define _NC_EVENT_FILE_WRITABLE 4
+# define _NC_EVENT_FILE_EXCEPTION 8
+# endif
+
+typedef struct
+{
+ int type;
+ union
+ {
+ long timeout_msec; /* _NC_EVENT_TIMEOUT_MSEC */
+ struct
+ {
+ unsigned int flags;
+ int fd;
+ unsigned int result;
+ } fev; /* _NC_EVENT_FILE */
+ } data;
+} _nc_event;
+
+typedef struct
+{
+ int count;
+ int result_flags; /* _NC_EVENT_TIMEOUT_MSEC or _NC_EVENT_FILE_READABLE */
+ _nc_event *events[1];
+} _nc_eventlist;
+
+extern NCURSES_EXPORT(int) wgetch_events(WINDOW *, _nc_eventlist *); /* experimental */
+extern NCURSES_EXPORT(int) wgetnstr_events(WINDOW *,char *,int,_nc_eventlist *);/* experimental */
+
+#endif /* NCURSES_WGETCH_EVENTS */
+#endif /* NCURSES_EXT_FUNCS */
+
+/*
+ * GCC (and some other compilers) define '__attribute__'; we're using this
+ * macro to alert the compiler to flag inconsistencies in printf/scanf-like
+ * function calls. Just in case '__attribute__' isn't defined, make a dummy.
+ * Old versions of G++ do not accept it anyway, at least not consistently with
+ * GCC.
+ */
+#if !(defined(__GNUC__) || defined(__GNUG__) || defined(__attribute__))
+#define __attribute__(p) /* nothing */
+#endif
+
+/*
+ * We cannot define these in ncurses_cfg.h, since they require parameters to be
+ * passed (that is non-portable). If you happen to be using gcc with warnings
+ * enabled, define
+ * GCC_PRINTF
+ * GCC_SCANF
+ * to improve checking of calls to printw(), etc.
+ */
+#ifndef GCC_PRINTFLIKE
+#if defined(GCC_PRINTF) && !defined(printf)
+#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
+#else
+#define GCC_PRINTFLIKE(fmt,var) /*nothing*/
+#endif
+#endif
+
+#ifndef GCC_SCANFLIKE
+#if defined(GCC_SCANF) && !defined(scanf)
+#define GCC_SCANFLIKE(fmt,var) __attribute__((format(scanf,fmt,var)))
+#else
+#define GCC_SCANFLIKE(fmt,var) /*nothing*/
+#endif
+#endif
+
+#ifndef GCC_NORETURN
+#define GCC_NORETURN /* nothing */
+#endif
+
+#ifndef GCC_UNUSED
+#define GCC_UNUSED /* nothing */
+#endif
+
+/*
+ * Function prototypes. This is the complete X/Open Curses list of required
+ * functions. Those marked `generated' will have sources generated from the
+ * macro definitions later in this file, in order to satisfy XPG4.2
+ * requirements.
+ */
+
+extern NCURSES_EXPORT(int) addch (const chtype); /* generated */
+extern NCURSES_EXPORT(int) addchnstr (const chtype *, int); /* generated */
+extern NCURSES_EXPORT(int) addchstr (const chtype *); /* generated */
+extern NCURSES_EXPORT(int) addnstr (const char *, int); /* generated */
+extern NCURSES_EXPORT(int) addstr (const char *); /* generated */
+extern NCURSES_EXPORT(int) attroff (NCURSES_ATTR_T); /* generated */
+extern NCURSES_EXPORT(int) attron (NCURSES_ATTR_T); /* generated */
+extern NCURSES_EXPORT(int) attrset (NCURSES_ATTR_T); /* generated */
+extern NCURSES_EXPORT(int) attr_get (attr_t *, short *, void *); /* generated */
+extern NCURSES_EXPORT(int) attr_off (attr_t, void *); /* generated */
+extern NCURSES_EXPORT(int) attr_on (attr_t, void *); /* generated */
+extern NCURSES_EXPORT(int) attr_set (attr_t, short, void *); /* generated */
+extern NCURSES_EXPORT(int) baudrate (void); /* implemented */
+extern NCURSES_EXPORT(int) beep (void); /* implemented */
+extern NCURSES_EXPORT(int) bkgd (chtype); /* generated */
+extern NCURSES_EXPORT(void) bkgdset (chtype); /* generated */
+extern NCURSES_EXPORT(int) border (chtype,chtype,chtype,chtype,chtype,chtype,chtype,chtype); /* generated */
+extern NCURSES_EXPORT(int) box (WINDOW *, chtype, chtype); /* generated */
+extern NCURSES_EXPORT(bool) can_change_color (void); /* implemented */
+extern NCURSES_EXPORT(int) cbreak (void); /* implemented */
+extern NCURSES_EXPORT(int) chgat (int, attr_t, short, const void *); /* generated */
+extern NCURSES_EXPORT(int) clear (void); /* generated */
+extern NCURSES_EXPORT(int) clearok (WINDOW *,bool); /* implemented */
+extern NCURSES_EXPORT(int) clrtobot (void); /* generated */
+extern NCURSES_EXPORT(int) clrtoeol (void); /* generated */
+extern NCURSES_EXPORT(int) color_content (short,short*,short*,short*); /* implemented */
+extern NCURSES_EXPORT(int) color_set (short,void*); /* generated */
+extern NCURSES_EXPORT(int) COLOR_PAIR (int); /* generated */
+extern NCURSES_EXPORT(int) copywin (const WINDOW*,WINDOW*,int,int,int,int,int,int,int); /* implemented */
+extern NCURSES_EXPORT(int) curs_set (int); /* implemented */
+extern NCURSES_EXPORT(int) def_prog_mode (void); /* implemented */
+extern NCURSES_EXPORT(int) def_shell_mode (void); /* implemented */
+extern NCURSES_EXPORT(int) delay_output (int); /* implemented */
+extern NCURSES_EXPORT(int) delch (void); /* generated */
+extern NCURSES_EXPORT(void) delscreen (SCREEN *); /* implemented */
+extern NCURSES_EXPORT(int) delwin (WINDOW *); /* implemented */
+extern NCURSES_EXPORT(int) deleteln (void); /* generated */
+extern NCURSES_EXPORT(WINDOW *) derwin (WINDOW *,int,int,int,int); /* implemented */
+extern NCURSES_EXPORT(int) doupdate (void); /* implemented */
+extern NCURSES_EXPORT(WINDOW *) dupwin (WINDOW *); /* implemented */
+extern NCURSES_EXPORT(int) echo (void); /* implemented */
+extern NCURSES_EXPORT(int) echochar (const chtype); /* generated */
+extern NCURSES_EXPORT(int) erase (void); /* generated */
+extern NCURSES_EXPORT(int) endwin (void); /* implemented */
+extern NCURSES_EXPORT(char) erasechar (void); /* implemented */
+extern NCURSES_EXPORT(void) filter (void); /* implemented */
+extern NCURSES_EXPORT(int) flash (void); /* implemented */
+extern NCURSES_EXPORT(int) flushinp (void); /* implemented */
+extern NCURSES_EXPORT(chtype) getbkgd (WINDOW *); /* generated */
+extern NCURSES_EXPORT(int) getch (void); /* generated */
+extern NCURSES_EXPORT(int) getnstr (char *, int); /* generated */
+extern NCURSES_EXPORT(int) getstr (char *); /* generated */
+extern NCURSES_EXPORT(WINDOW *) getwin (FILE *); /* implemented */
+extern NCURSES_EXPORT(int) halfdelay (int); /* implemented */
+extern NCURSES_EXPORT(bool) has_colors (void); /* implemented */
+extern NCURSES_EXPORT(bool) has_ic (void); /* implemented */
+extern NCURSES_EXPORT(bool) has_il (void); /* implemented */
+extern NCURSES_EXPORT(int) hline (chtype, int); /* generated */
+extern NCURSES_EXPORT(void) idcok (WINDOW *, bool); /* implemented */
+extern NCURSES_EXPORT(int) idlok (WINDOW *, bool); /* implemented */
+extern NCURSES_EXPORT(void) immedok (WINDOW *, bool); /* implemented */
+extern NCURSES_EXPORT(chtype) inch (void); /* generated */
+extern NCURSES_EXPORT(int) inchnstr (chtype *, int); /* generated */
+extern NCURSES_EXPORT(int) inchstr (chtype *); /* generated */
+extern NCURSES_EXPORT(WINDOW *) initscr (void); /* implemented */
+extern NCURSES_EXPORT(int) init_color (short,short,short,short); /* implemented */
+extern NCURSES_EXPORT(int) init_pair (short,short,short); /* implemented */
+extern NCURSES_EXPORT(int) innstr (char *, int); /* generated */
+extern NCURSES_EXPORT(int) insch (chtype); /* generated */
+extern NCURSES_EXPORT(int) insdelln (int); /* generated */
+extern NCURSES_EXPORT(int) insertln (void); /* generated */
+extern NCURSES_EXPORT(int) insnstr (const char *, int); /* generated */
+extern NCURSES_EXPORT(int) insstr (const char *); /* generated */
+extern NCURSES_EXPORT(int) instr (char *); /* generated */
+extern NCURSES_EXPORT(int) intrflush (WINDOW *,bool); /* implemented */
+extern NCURSES_EXPORT(bool) isendwin (void); /* implemented */
+extern NCURSES_EXPORT(bool) is_linetouched (WINDOW *,int); /* implemented */
+extern NCURSES_EXPORT(bool) is_wintouched (WINDOW *); /* implemented */
+extern NCURSES_EXPORT(NCURSES_CONST char *) keyname (int); /* implemented */
+extern NCURSES_EXPORT(int) keypad (WINDOW *,bool); /* implemented */
+extern NCURSES_EXPORT(char) killchar (void); /* implemented */
+extern NCURSES_EXPORT(int) leaveok (WINDOW *,bool); /* implemented */
+extern NCURSES_EXPORT(char *) longname (void); /* implemented */
+extern NCURSES_EXPORT(int) meta (WINDOW *,bool); /* implemented */
+extern NCURSES_EXPORT(int) move (int, int); /* generated */
+extern NCURSES_EXPORT(int) mvaddch (int, int, const chtype); /* generated */
+extern NCURSES_EXPORT(int) mvaddchnstr (int, int, const chtype *, int); /* generated */
+extern NCURSES_EXPORT(int) mvaddchstr (int, int, const chtype *); /* generated */
+extern NCURSES_EXPORT(int) mvaddnstr (int, int, const char *, int); /* generated */
+extern NCURSES_EXPORT(int) mvaddstr (int, int, const char *); /* generated */
+extern NCURSES_EXPORT(int) mvchgat (int, int, int, attr_t, short, const void *); /* generated */
+extern NCURSES_EXPORT(int) mvcur (int,int,int,int); /* implemented */
+extern NCURSES_EXPORT(int) mvdelch (int, int); /* generated */
+extern NCURSES_EXPORT(int) mvderwin (WINDOW *, int, int); /* implemented */
+extern NCURSES_EXPORT(int) mvgetch (int, int); /* generated */
+extern NCURSES_EXPORT(int) mvgetnstr (int, int, char *, int); /* generated */
+extern NCURSES_EXPORT(int) mvgetstr (int, int, char *); /* generated */
+extern NCURSES_EXPORT(int) mvhline (int, int, chtype, int); /* generated */
+extern NCURSES_EXPORT(chtype) mvinch (int, int); /* generated */
+extern NCURSES_EXPORT(int) mvinchnstr (int, int, chtype *, int); /* generated */
+extern NCURSES_EXPORT(int) mvinchstr (int, int, chtype *); /* generated */
+extern NCURSES_EXPORT(int) mvinnstr (int, int, char *, int); /* generated */
+extern NCURSES_EXPORT(int) mvinsch (int, int, chtype); /* generated */
+extern NCURSES_EXPORT(int) mvinsnstr (int, int, const char *, int); /* generated */
+extern NCURSES_EXPORT(int) mvinsstr (int, int, const char *); /* generated */
+extern NCURSES_EXPORT(int) mvinstr (int, int, char *); /* generated */
+extern NCURSES_EXPORT(int) mvprintw (int,int, const char *,...) /* implemented */
+ GCC_PRINTFLIKE(3,4);
+extern NCURSES_EXPORT(int) mvscanw (int,int, NCURSES_CONST char *,...) /* implemented */
+ GCC_SCANFLIKE(3,4);
+extern NCURSES_EXPORT(int) mvvline (int, int, chtype, int); /* generated */
+extern NCURSES_EXPORT(int) mvwaddch (WINDOW *, int, int, const chtype); /* generated */
+extern NCURSES_EXPORT(int) mvwaddchnstr (WINDOW *, int, int, const chtype *, int);/* generated */
+extern NCURSES_EXPORT(int) mvwaddchstr (WINDOW *, int, int, const chtype *); /* generated */
+extern NCURSES_EXPORT(int) mvwaddnstr (WINDOW *, int, int, const char *, int); /* generated */
+extern NCURSES_EXPORT(int) mvwaddstr (WINDOW *, int, int, const char *); /* generated */
+extern NCURSES_EXPORT(int) mvwchgat (WINDOW *, int, int, int, attr_t, short, const void *);/* generated */
+extern NCURSES_EXPORT(int) mvwdelch (WINDOW *, int, int); /* generated */
+extern NCURSES_EXPORT(int) mvwgetch (WINDOW *, int, int); /* generated */
+extern NCURSES_EXPORT(int) mvwgetnstr (WINDOW *, int, int, char *, int); /* generated */
+extern NCURSES_EXPORT(int) mvwgetstr (WINDOW *, int, int, char *); /* generated */
+extern NCURSES_EXPORT(int) mvwhline (WINDOW *, int, int, chtype, int); /* generated */
+extern NCURSES_EXPORT(int) mvwin (WINDOW *,int,int); /* implemented */
+extern NCURSES_EXPORT(chtype) mvwinch (WINDOW *, int, int); /* generated */
+extern NCURSES_EXPORT(int) mvwinchnstr (WINDOW *, int, int, chtype *, int); /* generated */
+extern NCURSES_EXPORT(int) mvwinchstr (WINDOW *, int, int, chtype *); /* generated */
+extern NCURSES_EXPORT(int) mvwinnstr (WINDOW *, int, int, char *, int); /* generated */
+extern NCURSES_EXPORT(int) mvwinsch (WINDOW *, int, int, chtype); /* generated */
+extern NCURSES_EXPORT(int) mvwinsnstr (WINDOW *, int, int, const char *, int); /* generated */
+extern NCURSES_EXPORT(int) mvwinsstr (WINDOW *, int, int, const char *); /* generated */
+extern NCURSES_EXPORT(int) mvwinstr (WINDOW *, int, int, char *); /* generated */
+extern NCURSES_EXPORT(int) mvwprintw (WINDOW*,int,int, const char *,...) /* implemented */
+ GCC_PRINTFLIKE(4,5);
+extern NCURSES_EXPORT(int) mvwscanw (WINDOW *,int,int, NCURSES_CONST char *,...) /* implemented */
+ GCC_SCANFLIKE(4,5);
+extern NCURSES_EXPORT(int) mvwvline (WINDOW *,int, int, chtype, int); /* generated */
+extern NCURSES_EXPORT(int) napms (int); /* implemented */
+extern NCURSES_EXPORT(WINDOW *) newpad (int,int); /* implemented */
+extern NCURSES_EXPORT(SCREEN *) newterm (NCURSES_CONST char *,FILE *,FILE *); /* implemented */
+extern NCURSES_EXPORT(WINDOW *) newwin (int,int,int,int); /* implemented */
+extern NCURSES_EXPORT(int) nl (void); /* implemented */
+extern NCURSES_EXPORT(int) nocbreak (void); /* implemented */
+extern NCURSES_EXPORT(int) nodelay (WINDOW *,bool); /* implemented */
+extern NCURSES_EXPORT(int) noecho (void); /* implemented */
+extern NCURSES_EXPORT(int) nonl (void); /* implemented */
+extern NCURSES_EXPORT(void) noqiflush (void); /* implemented */
+extern NCURSES_EXPORT(int) noraw (void); /* implemented */
+extern NCURSES_EXPORT(int) notimeout (WINDOW *,bool); /* implemented */
+extern NCURSES_EXPORT(int) overlay (const WINDOW*,WINDOW *); /* implemented */
+extern NCURSES_EXPORT(int) overwrite (const WINDOW*,WINDOW *); /* implemented */
+extern NCURSES_EXPORT(int) pair_content (short,short*,short*); /* implemented */
+extern NCURSES_EXPORT(int) PAIR_NUMBER (int); /* generated */
+extern NCURSES_EXPORT(int) pechochar (WINDOW *, const chtype); /* implemented */
+extern NCURSES_EXPORT(int) pnoutrefresh (WINDOW*,int,int,int,int,int,int);/* implemented */
+extern NCURSES_EXPORT(int) prefresh (WINDOW *,int,int,int,int,int,int); /* implemented */
+extern NCURSES_EXPORT(int) printw (const char *,...) /* implemented */
+ GCC_PRINTFLIKE(1,2);
+extern NCURSES_EXPORT(int) putwin (WINDOW *, FILE *); /* implemented */
+extern NCURSES_EXPORT(void) qiflush (void); /* implemented */
+extern NCURSES_EXPORT(int) raw (void); /* implemented */
+extern NCURSES_EXPORT(int) redrawwin (WINDOW *); /* generated */
+extern NCURSES_EXPORT(int) refresh (void); /* generated */
+extern NCURSES_EXPORT(int) resetty (void); /* implemented */
+extern NCURSES_EXPORT(int) reset_prog_mode (void); /* implemented */
+extern NCURSES_EXPORT(int) reset_shell_mode (void); /* implemented */
+extern NCURSES_EXPORT(int) ripoffline (int, int (*)(WINDOW *, int)); /* implemented */
+extern NCURSES_EXPORT(int) savetty (void); /* implemented */
+extern NCURSES_EXPORT(int) scanw (NCURSES_CONST char *,...) /* implemented */
+ GCC_SCANFLIKE(1,2);
+extern NCURSES_EXPORT(int) scr_dump (const char *); /* implemented */
+extern NCURSES_EXPORT(int) scr_init (const char *); /* implemented */
+extern NCURSES_EXPORT(int) scrl (int); /* generated */
+extern NCURSES_EXPORT(int) scroll (WINDOW *); /* generated */
+extern NCURSES_EXPORT(int) scrollok (WINDOW *,bool); /* implemented */
+extern NCURSES_EXPORT(int) scr_restore (const char *); /* implemented */
+extern NCURSES_EXPORT(int) scr_set (const char *); /* implemented */
+extern NCURSES_EXPORT(int) setscrreg (int,int); /* generated */
+extern NCURSES_EXPORT(SCREEN *) set_term (SCREEN *); /* implemented */
+extern NCURSES_EXPORT(int) slk_attroff (const chtype); /* implemented */
+extern NCURSES_EXPORT(int) slk_attr_off (const attr_t, void *); /* generated:WIDEC */
+extern NCURSES_EXPORT(int) slk_attron (const chtype); /* implemented */
+extern NCURSES_EXPORT(int) slk_attr_on (attr_t,void*); /* generated:WIDEC */
+extern NCURSES_EXPORT(int) slk_attrset (const chtype); /* implemented */
+extern NCURSES_EXPORT(attr_t) slk_attr (void); /* implemented */
+extern NCURSES_EXPORT(int) slk_attr_set (const attr_t,short,void*); /* implemented */
+extern NCURSES_EXPORT(int) slk_clear (void); /* implemented */
+extern NCURSES_EXPORT(int) slk_color (short); /* implemented */
+extern NCURSES_EXPORT(int) slk_init (int); /* implemented */
+extern NCURSES_EXPORT(char *) slk_label (int); /* implemented */
+extern NCURSES_EXPORT(int) slk_noutrefresh (void); /* implemented */
+extern NCURSES_EXPORT(int) slk_refresh (void); /* implemented */
+extern NCURSES_EXPORT(int) slk_restore (void); /* implemented */
+extern NCURSES_EXPORT(int) slk_set (int,const char *,int); /* implemented */
+extern NCURSES_EXPORT(int) slk_touch (void); /* implemented */
+extern NCURSES_EXPORT(int) standout (void); /* generated */
+extern NCURSES_EXPORT(int) standend (void); /* generated */
+extern NCURSES_EXPORT(int) start_color (void); /* implemented */
+extern NCURSES_EXPORT(WINDOW *) subpad (WINDOW *, int, int, int, int); /* implemented */
+extern NCURSES_EXPORT(WINDOW *) subwin (WINDOW *, int, int, int, int); /* implemented */
+extern NCURSES_EXPORT(int) syncok (WINDOW *, bool); /* implemented */
+extern NCURSES_EXPORT(chtype) termattrs (void); /* implemented */
+extern NCURSES_EXPORT(char *) termname (void); /* implemented */
+extern NCURSES_EXPORT(void) timeout (int); /* generated */
+extern NCURSES_EXPORT(int) touchline (WINDOW *, int, int); /* generated */
+extern NCURSES_EXPORT(int) touchwin (WINDOW *); /* generated */
+extern NCURSES_EXPORT(int) typeahead (int); /* implemented */
+extern NCURSES_EXPORT(int) ungetch (int); /* implemented */
+extern NCURSES_EXPORT(int) untouchwin (WINDOW *); /* generated */
+extern NCURSES_EXPORT(void) use_env (bool); /* implemented */
+extern NCURSES_EXPORT(int) vidattr (chtype); /* implemented */
+extern NCURSES_EXPORT(int) vidputs (chtype, int (*)(int)); /* implemented */
+extern NCURSES_EXPORT(int) vline (chtype, int); /* generated */
+extern NCURSES_EXPORT(int) vwprintw (WINDOW *, const char *,va_list); /* implemented */
+extern NCURSES_EXPORT(int) vw_printw (WINDOW *, const char *,va_list); /* generated */
+extern NCURSES_EXPORT(int) vwscanw (WINDOW *, NCURSES_CONST char *,va_list); /* implemented */
+extern NCURSES_EXPORT(int) vw_scanw (WINDOW *, NCURSES_CONST char *,va_list); /* generated */
+extern NCURSES_EXPORT(int) waddch (WINDOW *, const chtype); /* implemented */
+extern NCURSES_EXPORT(int) waddchnstr (WINDOW *,const chtype *,int); /* implemented */
+extern NCURSES_EXPORT(int) waddchstr (WINDOW *,const chtype *); /* generated */
+extern NCURSES_EXPORT(int) waddnstr (WINDOW *,const char *,int); /* implemented */
+extern NCURSES_EXPORT(int) waddstr (WINDOW *,const char *); /* generated */
+extern NCURSES_EXPORT(int) wattron (WINDOW *, int); /* generated */
+extern NCURSES_EXPORT(int) wattroff (WINDOW *, int); /* generated */
+extern NCURSES_EXPORT(int) wattrset (WINDOW *, int); /* generated */
+extern NCURSES_EXPORT(int) wattr_get (WINDOW *, attr_t *, short *, void *); /* generated */
+extern NCURSES_EXPORT(int) wattr_on (WINDOW *, attr_t, void *); /* implemented */
+extern NCURSES_EXPORT(int) wattr_off (WINDOW *, attr_t, void *); /* implemented */
+extern NCURSES_EXPORT(int) wattr_set (WINDOW *, attr_t, short, void *); /* generated */
+extern NCURSES_EXPORT(int) wbkgd (WINDOW *, chtype); /* implemented */
+extern NCURSES_EXPORT(void) wbkgdset (WINDOW *,chtype); /* implemented */
+extern NCURSES_EXPORT(int) wborder (WINDOW *,chtype,chtype,chtype,chtype,chtype,chtype,chtype,chtype); /* implemented */
+extern NCURSES_EXPORT(int) wchgat (WINDOW *, int, attr_t, short, const void *);/* implemented */
+extern NCURSES_EXPORT(int) wclear (WINDOW *); /* implemented */
+extern NCURSES_EXPORT(int) wclrtobot (WINDOW *); /* implemented */
+extern NCURSES_EXPORT(int) wclrtoeol (WINDOW *); /* implemented */
+extern NCURSES_EXPORT(int) wcolor_set (WINDOW*,short,void*); /* implemented */
+extern NCURSES_EXPORT(void) wcursyncup (WINDOW *); /* implemented */
+extern NCURSES_EXPORT(int) wdelch (WINDOW *); /* implemented */
+extern NCURSES_EXPORT(int) wdeleteln (WINDOW *); /* generated */
+extern NCURSES_EXPORT(int) wechochar (WINDOW *, const chtype); /* implemented */
+extern NCURSES_EXPORT(int) werase (WINDOW *); /* implemented */
+extern NCURSES_EXPORT(int) wgetch (WINDOW *); /* implemented */
+extern NCURSES_EXPORT(int) wgetnstr (WINDOW *,char *,int); /* implemented */
+extern NCURSES_EXPORT(int) wgetstr (WINDOW *, char *); /* generated */
+extern NCURSES_EXPORT(int) whline (WINDOW *, chtype, int); /* implemented */
+extern NCURSES_EXPORT(chtype) winch (WINDOW *); /* implemented */
+extern NCURSES_EXPORT(int) winchnstr (WINDOW *, chtype *, int); /* implemented */
+extern NCURSES_EXPORT(int) winchstr (WINDOW *, chtype *); /* generated */
+extern NCURSES_EXPORT(int) winnstr (WINDOW *, char *, int); /* implemented */
+extern NCURSES_EXPORT(int) winsch (WINDOW *, chtype); /* implemented */
+extern NCURSES_EXPORT(int) winsdelln (WINDOW *,int); /* implemented */
+extern NCURSES_EXPORT(int) winsertln (WINDOW *); /* generated */
+extern NCURSES_EXPORT(int) winsnstr (WINDOW *, const char *,int); /* implemented */
+extern NCURSES_EXPORT(int) winsstr (WINDOW *, const char *); /* generated */
+extern NCURSES_EXPORT(int) winstr (WINDOW *, char *); /* generated */
+extern NCURSES_EXPORT(int) wmove (WINDOW *,int,int); /* implemented */
+extern NCURSES_EXPORT(int) wnoutrefresh (WINDOW *); /* implemented */
+extern NCURSES_EXPORT(int) wprintw (WINDOW *, const char *,...) /* implemented */
+ GCC_PRINTFLIKE(2,3);
+extern NCURSES_EXPORT(int) wredrawln (WINDOW *,int,int); /* implemented */
+extern NCURSES_EXPORT(int) wrefresh (WINDOW *); /* implemented */
+extern NCURSES_EXPORT(int) wscanw (WINDOW *, NCURSES_CONST char *,...) /* implemented */
+ GCC_SCANFLIKE(2,3);
+extern NCURSES_EXPORT(int) wscrl (WINDOW *,int); /* implemented */
+extern NCURSES_EXPORT(int) wsetscrreg (WINDOW *,int,int); /* implemented */
+extern NCURSES_EXPORT(int) wstandout (WINDOW *); /* generated */
+extern NCURSES_EXPORT(int) wstandend (WINDOW *); /* generated */
+extern NCURSES_EXPORT(void) wsyncdown (WINDOW *); /* implemented */
+extern NCURSES_EXPORT(void) wsyncup (WINDOW *); /* implemented */
+extern NCURSES_EXPORT(void) wtimeout (WINDOW *,int); /* implemented */
+extern NCURSES_EXPORT(int) wtouchln (WINDOW *,int,int,int); /* implemented */
+extern NCURSES_EXPORT(int) wvline (WINDOW *,chtype,int); /* implemented */
+
+/*
+ * These are also declared in <term.h>:
+ */
+extern NCURSES_EXPORT(int) tigetflag (NCURSES_CONST char *); /* implemented */
+extern NCURSES_EXPORT(int) tigetnum (NCURSES_CONST char *); /* implemented */
+extern NCURSES_EXPORT(char *) tigetstr (NCURSES_CONST char *); /* implemented */
+extern NCURSES_EXPORT(int) putp (const char *); /* implemented */
+
+#if NCURSES_TPARM_VARARGS
+extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, ...); /* special */
+#else
+extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, long,long,long,long,long,long,long,long,long); /* special */
+extern NCURSES_EXPORT(char *) tparm_varargs (NCURSES_CONST char *, ...); /* special */
+#endif
+
+/*
+ * These functions are not in X/Open, but we use them in macro definitions:
+ */
+extern NCURSES_EXPORT(int) getattrs (const WINDOW *); /* generated */
+extern NCURSES_EXPORT(int) getcurx (const WINDOW *); /* generated */
+extern NCURSES_EXPORT(int) getcury (const WINDOW *); /* generated */
+extern NCURSES_EXPORT(int) getbegx (const WINDOW *); /* generated */
+extern NCURSES_EXPORT(int) getbegy (const WINDOW *); /* generated */
+extern NCURSES_EXPORT(int) getmaxx (const WINDOW *); /* generated */
+extern NCURSES_EXPORT(int) getmaxy (const WINDOW *); /* generated */
+extern NCURSES_EXPORT(int) getparx (const WINDOW *); /* generated */
+extern NCURSES_EXPORT(int) getpary (const WINDOW *); /* generated */
+
+/*
+ * vid_attr() was implemented originally based on a draft of X/Open curses.
+ */
+#ifndef _XOPEN_SOURCE_EXTENDED
+#define vid_attr(a,pair,opts) vidattr(a)
+#endif
+
+/*
+ * These functions are extensions - not in X/Open Curses.
+ */
+#undef NCURSES_EXT_FUNCS
+#if 1
+#undef NCURSES_EXT_FUNCS
+#define NCURSES_EXT_FUNCS 20071124
+typedef int (*NCURSES_CALLBACK)(WINDOW *, void *);
+extern NCURSES_EXPORT(bool) is_term_resized (int, int);
+extern NCURSES_EXPORT(char *) keybound (int, int);
+extern NCURSES_EXPORT(const char *) curses_version (void);
+extern NCURSES_EXPORT(int) assume_default_colors (int, int);
+extern NCURSES_EXPORT(int) define_key (const char *, int);
+extern NCURSES_EXPORT(int) key_defined (const char *);
+extern NCURSES_EXPORT(int) keyok (int, bool);
+extern NCURSES_EXPORT(int) resize_term (int, int);
+extern NCURSES_EXPORT(int) resizeterm (int, int);
+extern NCURSES_EXPORT(int) use_default_colors (void);
+extern NCURSES_EXPORT(int) use_extended_names (bool);
+extern NCURSES_EXPORT(int) use_legacy_coding (int);
+extern NCURSES_EXPORT(int) use_screen (SCREEN *, NCURSES_CALLBACK, void *);
+extern NCURSES_EXPORT(int) use_window (WINDOW *, NCURSES_CALLBACK, void *);
+extern NCURSES_EXPORT(int) wresize (WINDOW *, int, int);
+extern NCURSES_EXPORT(void) nofilter(void);
+
+/*
+ * These extensions provide access to information stored in the WINDOW even
+ * when NCURSES_OPAQUE is set:
+ */
+extern NCURSES_EXPORT(WINDOW *) wgetparent (const WINDOW *); /* generated */
+extern NCURSES_EXPORT(bool) is_cleared (const WINDOW *); /* generated */
+extern NCURSES_EXPORT(bool) is_idcok (const WINDOW *); /* generated */
+extern NCURSES_EXPORT(bool) is_idlok (const WINDOW *); /* generated */
+extern NCURSES_EXPORT(bool) is_immedok (const WINDOW *); /* generated */
+extern NCURSES_EXPORT(bool) is_keypad (const WINDOW *); /* generated */
+extern NCURSES_EXPORT(bool) is_leaveok (const WINDOW *); /* generated */
+extern NCURSES_EXPORT(bool) is_nodelay (const WINDOW *); /* generated */
+extern NCURSES_EXPORT(bool) is_notimeout (const WINDOW *); /* generated */
+extern NCURSES_EXPORT(bool) is_scrollok (const WINDOW *); /* generated */
+extern NCURSES_EXPORT(bool) is_syncok (const WINDOW *); /* generated */
+extern NCURSES_EXPORT(int) wgetscrreg (const WINDOW *, int *, int *); /* generated */
+
+#else
+#define curses_version() NCURSES_VERSION
+#endif
+
+/* attributes */
+
+#define NCURSES_ATTR_SHIFT 8
+#define NCURSES_BITS(mask,shift) ((mask) << ((shift) + NCURSES_ATTR_SHIFT))
+
+#define A_NORMAL (1UL - 1UL)
+#define A_ATTRIBUTES NCURSES_BITS(~(1UL - 1UL),0)
+#define A_CHARTEXT (NCURSES_BITS(1UL,0) - 1UL)
+#define A_COLOR NCURSES_BITS(((1UL) << 8) - 1UL,0)
+#define A_STANDOUT NCURSES_BITS(1UL,8)
+#define A_UNDERLINE NCURSES_BITS(1UL,9)
+#define A_REVERSE NCURSES_BITS(1UL,10)
+#define A_BLINK NCURSES_BITS(1UL,11)
+#define A_DIM NCURSES_BITS(1UL,12)
+#define A_BOLD NCURSES_BITS(1UL,13)
+#define A_ALTCHARSET NCURSES_BITS(1UL,14)
+#define A_INVIS NCURSES_BITS(1UL,15)
+#define A_PROTECT NCURSES_BITS(1UL,16)
+#define A_HORIZONTAL NCURSES_BITS(1UL,17)
+#define A_LEFT NCURSES_BITS(1UL,18)
+#define A_LOW NCURSES_BITS(1UL,19)
+#define A_RIGHT NCURSES_BITS(1UL,20)
+#define A_TOP NCURSES_BITS(1UL,21)
+#define A_VERTICAL NCURSES_BITS(1UL,22)
+
+/*
+ * Most of the pseudo functions are macros that either provide compatibility
+ * with older versions of curses, or provide inline functionality to improve
+ * performance.
+ */
+
+/*
+ * These pseudo functions are always implemented as macros:
+ */
+
+#define getyx(win,y,x) (y = getcury(win), x = getcurx(win))
+#define getbegyx(win,y,x) (y = getbegy(win), x = getbegx(win))
+#define getmaxyx(win,y,x) (y = getmaxy(win), x = getmaxx(win))
+#define getparyx(win,y,x) (y = getpary(win), x = getparx(win))
+
+#define getsyx(y,x) do { if (is_leaveok(newscr)) \
+ (y) = (x) = -1; \
+ else \
+ getyx(newscr,(y), (x)); \
+ } while(0)
+
+#define setsyx(y,x) do { if ((y) == -1 && (x) == -1) \
+ leaveok(newscr, TRUE); \
+ else { \
+ leaveok(newscr, FALSE); \
+ wmove(newscr, (y), (x)); \
+ } \
+ } while(0)
+
+#ifndef NCURSES_NOMACROS
+
+/*
+ * These miscellaneous pseudo functions are provided for compatibility:
+ */
+
+#define wgetstr(w, s) wgetnstr(w, s, -1)
+#define getnstr(s, n) wgetnstr(stdscr, s, n)
+
+#define setterm(term) setupterm(term, 1, (int *)0)
+
+#define fixterm() reset_prog_mode()
+#define resetterm() reset_shell_mode()
+#define saveterm() def_prog_mode()
+#define crmode() cbreak()
+#define nocrmode() nocbreak()
+#define gettmode()
+
+/* It seems older SYSV curses versions define these */
+#if !NCURSES_OPAQUE
+#define getattrs(win) ((win) ? (win)->_attrs : A_NORMAL)
+#define getcurx(win) ((win) ? (win)->_curx : ERR)
+#define getcury(win) ((win) ? (win)->_cury : ERR)
+#define getbegx(win) ((win) ? (win)->_begx : ERR)
+#define getbegy(win) ((win) ? (win)->_begy : ERR)
+#define getmaxx(win) ((win) ? ((win)->_maxx + 1) : ERR)
+#define getmaxy(win) ((win) ? ((win)->_maxy + 1) : ERR)
+#define getparx(win) ((win) ? (win)->_parx : ERR)
+#define getpary(win) ((win) ? (win)->_pary : ERR)
+#endif /* NCURSES_OPAQUE */
+
+#define wstandout(win) (wattrset(win,A_STANDOUT))
+#define wstandend(win) (wattrset(win,A_NORMAL))
+
+#define wattron(win,at) wattr_on(win, NCURSES_CAST(attr_t, at), NULL)
+#define wattroff(win,at) wattr_off(win, NCURSES_CAST(attr_t, at), NULL)
+
+#if !NCURSES_OPAQUE
+#if defined(_XOPEN_SOURCE_EXTENDED) && 0
+#define wattrset(win,at) ((win)->_color = PAIR_NUMBER(at), \
+ (win)->_attrs = (at))
+#else
+#define wattrset(win,at) ((win)->_attrs = (at))
+#endif
+#endif /* NCURSES_OPAQUE */
+
+#define scroll(win) wscrl(win,1)
+
+#define touchwin(win) wtouchln((win), 0, getmaxy(win), 1)
+#define touchline(win, s, c) wtouchln((win), s, c, 1)
+#define untouchwin(win) wtouchln((win), 0, getmaxy(win), 0)
+
+#define box(win, v, h) wborder(win, v, v, h, h, 0, 0, 0, 0)
+#define border(ls, rs, ts, bs, tl, tr, bl, br) wborder(stdscr, ls, rs, ts, bs, tl, tr, bl, br)
+#define hline(ch, n) whline(stdscr, ch, n)
+#define vline(ch, n) wvline(stdscr, ch, n)
+
+#define winstr(w, s) winnstr(w, s, -1)
+#define winchstr(w, s) winchnstr(w, s, -1)
+#define winsstr(w, s) winsnstr(w, s, -1)
+
+#if !NCURSES_OPAQUE
+#define redrawwin(win) wredrawln(win, 0, (win)->_maxy+1)
+#endif /* NCURSES_OPAQUE */
+
+#define waddstr(win,str) waddnstr(win,str,-1)
+#define waddchstr(win,str) waddchnstr(win,str,-1)
+
+/*
+ * These apply to the first 256 color pairs.
+ */
+#define COLOR_PAIR(n) NCURSES_BITS(n, 0)
+#define PAIR_NUMBER(a) (NCURSES_CAST(int,(((a) & A_COLOR) >> NCURSES_ATTR_SHIFT)))
+
+/*
+ * pseudo functions for standard screen
+ */
+
+#define addch(ch) waddch(stdscr,ch)
+#define addchnstr(str,n) waddchnstr(stdscr,str,n)
+#define addchstr(str) waddchstr(stdscr,str)
+#define addnstr(str,n) waddnstr(stdscr,str,n)
+#define addstr(str) waddnstr(stdscr,str,-1)
+#define attroff(at) wattroff(stdscr,at)
+#define attron(at) wattron(stdscr,at)
+#define attrset(at) wattrset(stdscr,at)
+#define attr_get(ap,cp,o) wattr_get(stdscr,ap,cp,o)
+#define attr_off(a,o) wattr_off(stdscr,a,o)
+#define attr_on(a,o) wattr_on(stdscr,a,o)
+#define attr_set(a,c,o) wattr_set(stdscr,a,c,o)
+#define bkgd(ch) wbkgd(stdscr,ch)
+#define bkgdset(ch) wbkgdset(stdscr,ch)
+#define chgat(n,a,c,o) wchgat(stdscr,n,a,c,o)
+#define clear() wclear(stdscr)
+#define clrtobot() wclrtobot(stdscr)
+#define clrtoeol() wclrtoeol(stdscr)
+#define color_set(c,o) wcolor_set(stdscr,c,o)
+#define delch() wdelch(stdscr)
+#define deleteln() winsdelln(stdscr,-1)
+#define echochar(c) wechochar(stdscr,c)
+#define erase() werase(stdscr)
+#define getch() wgetch(stdscr)
+#define getstr(str) wgetstr(stdscr,str)
+#define inch() winch(stdscr)
+#define inchnstr(s,n) winchnstr(stdscr,s,n)
+#define inchstr(s) winchstr(stdscr,s)
+#define innstr(s,n) winnstr(stdscr,s,n)
+#define insch(c) winsch(stdscr,c)
+#define insdelln(n) winsdelln(stdscr,n)
+#define insertln() winsdelln(stdscr,1)
+#define insnstr(s,n) winsnstr(stdscr,s,n)
+#define insstr(s) winsstr(stdscr,s)
+#define instr(s) winstr(stdscr,s)
+#define move(y,x) wmove(stdscr,y,x)
+#define refresh() wrefresh(stdscr)
+#define scrl(n) wscrl(stdscr,n)
+#define setscrreg(t,b) wsetscrreg(stdscr,t,b)
+#define standend() wstandend(stdscr)
+#define standout() wstandout(stdscr)
+#define timeout(delay) wtimeout(stdscr,delay)
+#define wdeleteln(win) winsdelln(win,-1)
+#define winsertln(win) winsdelln(win,1)
+
+/*
+ * mv functions
+ */
+
+#define mvwaddch(win,y,x,ch) (wmove(win,y,x) == ERR ? ERR : waddch(win,ch))
+#define mvwaddchnstr(win,y,x,str,n) (wmove(win,y,x) == ERR ? ERR : waddchnstr(win,str,n))
+#define mvwaddchstr(win,y,x,str) (wmove(win,y,x) == ERR ? ERR : waddchnstr(win,str,-1))
+#define mvwaddnstr(win,y,x,str,n) (wmove(win,y,x) == ERR ? ERR : waddnstr(win,str,n))
+#define mvwaddstr(win,y,x,str) (wmove(win,y,x) == ERR ? ERR : waddnstr(win,str,-1))
+#define mvwdelch(win,y,x) (wmove(win,y,x) == ERR ? ERR : wdelch(win))
+#define mvwchgat(win,y,x,n,a,c,o) (wmove(win,y,x) == ERR ? ERR : wchgat(win,n,a,c,o))
+#define mvwgetch(win,y,x) (wmove(win,y,x) == ERR ? ERR : wgetch(win))
+#define mvwgetnstr(win,y,x,str,n) (wmove(win,y,x) == ERR ? ERR : wgetnstr(win,str,n))
+#define mvwgetstr(win,y,x,str) (wmove(win,y,x) == ERR ? ERR : wgetstr(win,str))
+#define mvwhline(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : whline(win,c,n))
+#define mvwinch(win,y,x) (wmove(win,y,x) == ERR ? NCURSES_CAST(chtype, ERR) : winch(win))
+#define mvwinchnstr(win,y,x,s,n) (wmove(win,y,x) == ERR ? ERR : winchnstr(win,s,n))
+#define mvwinchstr(win,y,x,s) (wmove(win,y,x) == ERR ? ERR : winchstr(win,s))
+#define mvwinnstr(win,y,x,s,n) (wmove(win,y,x) == ERR ? ERR : winnstr(win,s,n))
+#define mvwinsch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : winsch(win,c))
+#define mvwinsnstr(win,y,x,s,n) (wmove(win,y,x) == ERR ? ERR : winsnstr(win,s,n))
+#define mvwinsstr(win,y,x,s) (wmove(win,y,x) == ERR ? ERR : winsstr(win,s))
+#define mvwinstr(win,y,x,s) (wmove(win,y,x) == ERR ? ERR : winstr(win,s))
+#define mvwvline(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : wvline(win,c,n))
+
+#define mvaddch(y,x,ch) mvwaddch(stdscr,y,x,ch)
+#define mvaddchnstr(y,x,str,n) mvwaddchnstr(stdscr,y,x,str,n)
+#define mvaddchstr(y,x,str) mvwaddchstr(stdscr,y,x,str)
+#define mvaddnstr(y,x,str,n) mvwaddnstr(stdscr,y,x,str,n)
+#define mvaddstr(y,x,str) mvwaddstr(stdscr,y,x,str)
+#define mvchgat(y,x,n,a,c,o) mvwchgat(stdscr,y,x,n,a,c,o)
+#define mvdelch(y,x) mvwdelch(stdscr,y,x)
+#define mvgetch(y,x) mvwgetch(stdscr,y,x)
+#define mvgetnstr(y,x,str,n) mvwgetnstr(stdscr,y,x,str,n)
+#define mvgetstr(y,x,str) mvwgetstr(stdscr,y,x,str)
+#define mvhline(y,x,c,n) mvwhline(stdscr,y,x,c,n)
+#define mvinch(y,x) mvwinch(stdscr,y,x)
+#define mvinchnstr(y,x,s,n) mvwinchnstr(stdscr,y,x,s,n)
+#define mvinchstr(y,x,s) mvwinchstr(stdscr,y,x,s)
+#define mvinnstr(y,x,s,n) mvwinnstr(stdscr,y,x,s,n)
+#define mvinsch(y,x,c) mvwinsch(stdscr,y,x,c)
+#define mvinsnstr(y,x,s,n) mvwinsnstr(stdscr,y,x,s,n)
+#define mvinsstr(y,x,s) mvwinsstr(stdscr,y,x,s)
+#define mvinstr(y,x,s) mvwinstr(stdscr,y,x,s)
+#define mvvline(y,x,c,n) mvwvline(stdscr,y,x,c,n)
+
+/*
+ * Some wide-character functions can be implemented without the extensions.
+ */
+#if !NCURSES_OPAQUE
+#define getbkgd(win) ((win)->_bkgd)
+#endif /* NCURSES_OPAQUE */
+
+#define slk_attr_off(a,v) ((v) ? ERR : slk_attroff(a))
+#define slk_attr_on(a,v) ((v) ? ERR : slk_attron(a))
+
+#if !NCURSES_OPAQUE
+#if defined(_XOPEN_SOURCE_EXTENDED) && 0
+#define wattr_set(win,a,p,opts) ((win)->_attrs = ((a) & ~A_COLOR), \
+ (win)->_color = (p), \
+ OK)
+#define wattr_get(win,a,p,opts) ((void)((a) != 0 && (*(a) = (win)->_attrs)), \
+ (void)((p) != 0 && (*(p) = (win)->_color)), \
+ OK)
+#else
+#define wattr_set(win,a,p,opts) ((win)->_attrs = (((a) & ~A_COLOR) | COLOR_PAIR(p)), OK)
+#define wattr_get(win,a,p,opts) ((void)((a) != 0 && (*(a) = (win)->_attrs)), \
+ (void)((p) != 0 && (*(p) = PAIR_NUMBER((win)->_attrs))), \
+ OK)
+#endif
+#endif /* NCURSES_OPAQUE */
+
+/*
+ * X/Open curses deprecates SVr4 vwprintw/vwscanw, which are supposed to use
+ * varargs.h. It adds new calls vw_printw/vw_scanw, which are supposed to
+ * use POSIX stdarg.h. The ncurses versions of vwprintw/vwscanw already
+ * use stdarg.h, so...
+ */
+#define vw_printw vwprintw
+#define vw_scanw vwscanw
+
+/*
+ * Export fallback function for use in C++ binding.
+ */
+#if !1
+#define vsscanf(a,b,c) _nc_vsscanf(a,b,c)
+NCURSES_EXPORT(int) vsscanf(const char *, const char *, va_list);
+#endif
+
+/*
+ * These macros are extensions - not in X/Open Curses.
+ */
+#if 1
+#if !NCURSES_OPAQUE
+#define is_cleared(win) ((win)->_clear)
+#define is_idcok(win) ((win)->_idcok)
+#define is_idlok(win) ((win)->_idlok)
+#define is_immedok(win) ((win)->_immed)
+#define is_keypad(win) ((win)->_use_keypad)
+#define is_leaveok(win) ((win)->_leaveok)
+#define is_nodelay(win) ((win)->_delay == 0)
+#define is_notimeout(win) ((win)->_notimeout)
+#define is_scrollok(win) ((win)->_scroll)
+#define is_syncok(win) ((win)->_sync)
+#define wgetparent(win) ((win) ? (win)->_parent : 0)
+#define wgetscrreg(win,t,b) ((win) ? (*(t) = (win)->_regtop, *(b) = (win)->_regbottom, OK) : ERR)
+#endif
+#endif
+
+#endif /* NCURSES_NOMACROS */
+
+/*
+ * Public variables.
+ *
+ * Notes:
+ * a. ESCDELAY was an undocumented feature under AIX curses.
+ * It gives the ESC expire time in milliseconds.
+ * b. ttytype is needed for backward compatibility
+ */
+#if 0
+
+NCURSES_WRAPPED_VAR(WINDOW *, curscr);
+NCURSES_WRAPPED_VAR(WINDOW *, newscr);
+NCURSES_WRAPPED_VAR(WINDOW *, stdscr);
+NCURSES_WRAPPED_VAR(char *, ttytype);
+NCURSES_WRAPPED_VAR(int, COLORS);
+NCURSES_WRAPPED_VAR(int, COLOR_PAIRS);
+NCURSES_WRAPPED_VAR(int, COLS);
+NCURSES_WRAPPED_VAR(int, ESCDELAY);
+NCURSES_WRAPPED_VAR(int, LINES);
+NCURSES_WRAPPED_VAR(int, TABSIZE);
+
+#define curscr NCURSES_PUBLIC_VAR(curscr())
+#define newscr NCURSES_PUBLIC_VAR(newscr())
+#define stdscr NCURSES_PUBLIC_VAR(stdscr())
+#define ttytype NCURSES_PUBLIC_VAR(ttytype())
+#define COLORS NCURSES_PUBLIC_VAR(COLORS())
+#define COLOR_PAIRS NCURSES_PUBLIC_VAR(COLOR_PAIRS())
+#define COLS NCURSES_PUBLIC_VAR(COLS())
+#define ESCDELAY NCURSES_PUBLIC_VAR(ESCDELAY())
+#define LINES NCURSES_PUBLIC_VAR(LINES())
+#define TABSIZE NCURSES_PUBLIC_VAR(TABSIZE())
+
+#else
+
+extern NCURSES_EXPORT_VAR(WINDOW *) curscr;
+extern NCURSES_EXPORT_VAR(WINDOW *) newscr;
+extern NCURSES_EXPORT_VAR(WINDOW *) stdscr;
+extern NCURSES_EXPORT_VAR(char) ttytype[];
+extern NCURSES_EXPORT_VAR(int) COLORS;
+extern NCURSES_EXPORT_VAR(int) COLOR_PAIRS;
+extern NCURSES_EXPORT_VAR(int) COLS;
+extern NCURSES_EXPORT_VAR(int) ESCDELAY;
+extern NCURSES_EXPORT_VAR(int) LINES;
+extern NCURSES_EXPORT_VAR(int) TABSIZE;
+
+#endif
+
+/*
+ * Pseudo-character tokens outside ASCII range. The curses wgetch() function
+ * will return any given one of these only if the corresponding k- capability
+ * is defined in your terminal's terminfo entry.
+ *
+ * Some keys (KEY_A1, etc) are arranged like this:
+ * a1 up a3
+ * left b2 right
+ * c1 down c3
+ *
+ * A few key codes do not depend upon the terminfo entry.
+ */
+#define KEY_CODE_YES 0400 /* A wchar_t contains a key code */
+#define KEY_MIN 0401 /* Minimum curses key */
+#define KEY_BREAK 0401 /* Break key (unreliable) */
+#define KEY_SRESET 0530 /* Soft (partial) reset (unreliable) */
+#define KEY_RESET 0531 /* Reset or hard reset (unreliable) */
+/*
+ * These definitions were generated by /build/buildd/ncurses-5.6+20071124/include/MKkey_defs.sh /build/buildd/ncurses-5.6+20071124/include/Caps
+ */
+#define KEY_DOWN 0402 /* down-arrow key */
+#define KEY_UP 0403 /* up-arrow key */
+#define KEY_LEFT 0404 /* left-arrow key */
+#define KEY_RIGHT 0405 /* right-arrow key */
+#define KEY_HOME 0406 /* home key */
+#define KEY_BACKSPACE 0407 /* backspace key */
+#define KEY_F0 0410 /* Function keys. Space for 64 */
+#define KEY_F(n) (KEY_F0+(n)) /* Value of function key n */
+#define KEY_DL 0510 /* delete-line key */
+#define KEY_IL 0511 /* insert-line key */
+#define KEY_DC 0512 /* delete-character key */
+#define KEY_IC 0513 /* insert-character key */
+#define KEY_EIC 0514 /* sent by rmir or smir in insert mode */
+#define KEY_CLEAR 0515 /* clear-screen or erase key */
+#define KEY_EOS 0516 /* clear-to-end-of-screen key */
+#define KEY_EOL 0517 /* clear-to-end-of-line key */
+#define KEY_SF 0520 /* scroll-forward key */
+#define KEY_SR 0521 /* scroll-backward key */
+#define KEY_NPAGE 0522 /* next-page key */
+#define KEY_PPAGE 0523 /* previous-page key */
+#define KEY_STAB 0524 /* set-tab key */
+#define KEY_CTAB 0525 /* clear-tab key */
+#define KEY_CATAB 0526 /* clear-all-tabs key */
+#define KEY_ENTER 0527 /* enter/send key */
+#define KEY_PRINT 0532 /* print key */
+#define KEY_LL 0533 /* lower-left key (home down) */
+#define KEY_A1 0534 /* upper left of keypad */
+#define KEY_A3 0535 /* upper right of keypad */
+#define KEY_B2 0536 /* center of keypad */
+#define KEY_C1 0537 /* lower left of keypad */
+#define KEY_C3 0540 /* lower right of keypad */
+#define KEY_BTAB 0541 /* back-tab key */
+#define KEY_BEG 0542 /* begin key */
+#define KEY_CANCEL 0543 /* cancel key */
+#define KEY_CLOSE 0544 /* close key */
+#define KEY_COMMAND 0545 /* command key */
+#define KEY_COPY 0546 /* copy key */
+#define KEY_CREATE 0547 /* create key */
+#define KEY_END 0550 /* end key */
+#define KEY_EXIT 0551 /* exit key */
+#define KEY_FIND 0552 /* find key */
+#define KEY_HELP 0553 /* help key */
+#define KEY_MARK 0554 /* mark key */
+#define KEY_MESSAGE 0555 /* message key */
+#define KEY_MOVE 0556 /* move key */
+#define KEY_NEXT 0557 /* next key */
+#define KEY_OPEN 0560 /* open key */
+#define KEY_OPTIONS 0561 /* options key */
+#define KEY_PREVIOUS 0562 /* previous key */
+#define KEY_REDO 0563 /* redo key */
+#define KEY_REFERENCE 0564 /* reference key */
+#define KEY_REFRESH 0565 /* refresh key */
+#define KEY_REPLACE 0566 /* replace key */
+#define KEY_RESTART 0567 /* restart key */
+#define KEY_RESUME 0570 /* resume key */
+#define KEY_SAVE 0571 /* save key */
+#define KEY_SBEG 0572 /* shifted begin key */
+#define KEY_SCANCEL 0573 /* shifted cancel key */
+#define KEY_SCOMMAND 0574 /* shifted command key */
+#define KEY_SCOPY 0575 /* shifted copy key */
+#define KEY_SCREATE 0576 /* shifted create key */
+#define KEY_SDC 0577 /* shifted delete-character key */
+#define KEY_SDL 0600 /* shifted delete-line key */
+#define KEY_SELECT 0601 /* select key */
+#define KEY_SEND 0602 /* shifted end key */
+#define KEY_SEOL 0603 /* shifted clear-to-end-of-line key */
+#define KEY_SEXIT 0604 /* shifted exit key */
+#define KEY_SFIND 0605 /* shifted find key */
+#define KEY_SHELP 0606 /* shifted help key */
+#define KEY_SHOME 0607 /* shifted home key */
+#define KEY_SIC 0610 /* shifted insert-character key */
+#define KEY_SLEFT 0611 /* shifted left-arrow key */
+#define KEY_SMESSAGE 0612 /* shifted message key */
+#define KEY_SMOVE 0613 /* shifted move key */
+#define KEY_SNEXT 0614 /* shifted next key */
+#define KEY_SOPTIONS 0615 /* shifted options key */
+#define KEY_SPREVIOUS 0616 /* shifted previous key */
+#define KEY_SPRINT 0617 /* shifted print key */
+#define KEY_SREDO 0620 /* shifted redo key */
+#define KEY_SREPLACE 0621 /* shifted replace key */
+#define KEY_SRIGHT 0622 /* shifted right-arrow key */
+#define KEY_SRSUME 0623 /* shifted resume key */
+#define KEY_SSAVE 0624 /* shifted save key */
+#define KEY_SSUSPEND 0625 /* shifted suspend key */
+#define KEY_SUNDO 0626 /* shifted undo key */
+#define KEY_SUSPEND 0627 /* suspend key */
+#define KEY_UNDO 0630 /* undo key */
+#define KEY_MOUSE 0631 /* Mouse event has occurred */
+#define KEY_RESIZE 0632 /* Terminal resize event */
+#define KEY_EVENT 0633 /* We were interrupted by an event */
+
+#define KEY_MAX 0777 /* Maximum key value is 0633 */
+/* $Id: curses.tail,v 1.15 2007/03/10 17:51:24 tom Exp $ */
+/*
+ * vile:cmode:
+ * This file is part of ncurses, designed to be appended after curses.h.in
+ * (see that file for the relevant copyright).
+ */
+
+/* mouse interface */
+
+#if NCURSES_MOUSE_VERSION > 1
+#define NCURSES_MOUSE_MASK(b,m) ((m) << (((b) - 1) * 5))
+#else
+#define NCURSES_MOUSE_MASK(b,m) ((m) << (((b) - 1) * 6))
+#endif
+
+#define NCURSES_BUTTON_RELEASED 001L
+#define NCURSES_BUTTON_PRESSED 002L
+#define NCURSES_BUTTON_CLICKED 004L
+#define NCURSES_DOUBLE_CLICKED 010L
+#define NCURSES_TRIPLE_CLICKED 020L
+#define NCURSES_RESERVED_EVENT 040L
+
+/* event masks */
+#define BUTTON1_RELEASED NCURSES_MOUSE_MASK(1, NCURSES_BUTTON_RELEASED)
+#define BUTTON1_PRESSED NCURSES_MOUSE_MASK(1, NCURSES_BUTTON_PRESSED)
+#define BUTTON1_CLICKED NCURSES_MOUSE_MASK(1, NCURSES_BUTTON_CLICKED)
+#define BUTTON1_DOUBLE_CLICKED NCURSES_MOUSE_MASK(1, NCURSES_DOUBLE_CLICKED)
+#define BUTTON1_TRIPLE_CLICKED NCURSES_MOUSE_MASK(1, NCURSES_TRIPLE_CLICKED)
+
+#define BUTTON2_RELEASED NCURSES_MOUSE_MASK(2, NCURSES_BUTTON_RELEASED)
+#define BUTTON2_PRESSED NCURSES_MOUSE_MASK(2, NCURSES_BUTTON_PRESSED)
+#define BUTTON2_CLICKED NCURSES_MOUSE_MASK(2, NCURSES_BUTTON_CLICKED)
+#define BUTTON2_DOUBLE_CLICKED NCURSES_MOUSE_MASK(2, NCURSES_DOUBLE_CLICKED)
+#define BUTTON2_TRIPLE_CLICKED NCURSES_MOUSE_MASK(2, NCURSES_TRIPLE_CLICKED)
+
+#define BUTTON3_RELEASED NCURSES_MOUSE_MASK(3, NCURSES_BUTTON_RELEASED)
+#define BUTTON3_PRESSED NCURSES_MOUSE_MASK(3, NCURSES_BUTTON_PRESSED)
+#define BUTTON3_CLICKED NCURSES_MOUSE_MASK(3, NCURSES_BUTTON_CLICKED)
+#define BUTTON3_DOUBLE_CLICKED NCURSES_MOUSE_MASK(3, NCURSES_DOUBLE_CLICKED)
+#define BUTTON3_TRIPLE_CLICKED NCURSES_MOUSE_MASK(3, NCURSES_TRIPLE_CLICKED)
+
+#define BUTTON4_RELEASED NCURSES_MOUSE_MASK(4, NCURSES_BUTTON_RELEASED)
+#define BUTTON4_PRESSED NCURSES_MOUSE_MASK(4, NCURSES_BUTTON_PRESSED)
+#define BUTTON4_CLICKED NCURSES_MOUSE_MASK(4, NCURSES_BUTTON_CLICKED)
+#define BUTTON4_DOUBLE_CLICKED NCURSES_MOUSE_MASK(4, NCURSES_DOUBLE_CLICKED)
+#define BUTTON4_TRIPLE_CLICKED NCURSES_MOUSE_MASK(4, NCURSES_TRIPLE_CLICKED)
+
+/*
+ * In 32 bits the version-1 scheme does not provide enough space for a 5th
+ * button, unless we choose to change the ABI by omitting the reserved-events.
+ */
+#if NCURSES_MOUSE_VERSION > 1
+
+#define BUTTON5_RELEASED NCURSES_MOUSE_MASK(5, NCURSES_BUTTON_RELEASED)
+#define BUTTON5_PRESSED NCURSES_MOUSE_MASK(5, NCURSES_BUTTON_PRESSED)
+#define BUTTON5_CLICKED NCURSES_MOUSE_MASK(5, NCURSES_BUTTON_CLICKED)
+#define BUTTON5_DOUBLE_CLICKED NCURSES_MOUSE_MASK(5, NCURSES_DOUBLE_CLICKED)
+#define BUTTON5_TRIPLE_CLICKED NCURSES_MOUSE_MASK(5, NCURSES_TRIPLE_CLICKED)
+
+#define BUTTON_CTRL NCURSES_MOUSE_MASK(6, 0001L)
+#define BUTTON_SHIFT NCURSES_MOUSE_MASK(6, 0002L)
+#define BUTTON_ALT NCURSES_MOUSE_MASK(6, 0004L)
+#define REPORT_MOUSE_POSITION NCURSES_MOUSE_MASK(6, 0010L)
+
+#else
+
+#define BUTTON1_RESERVED_EVENT NCURSES_MOUSE_MASK(1, NCURSES_RESERVED_EVENT)
+#define BUTTON2_RESERVED_EVENT NCURSES_MOUSE_MASK(2, NCURSES_RESERVED_EVENT)
+#define BUTTON3_RESERVED_EVENT NCURSES_MOUSE_MASK(3, NCURSES_RESERVED_EVENT)
+#define BUTTON4_RESERVED_EVENT NCURSES_MOUSE_MASK(4, NCURSES_RESERVED_EVENT)
+
+#define BUTTON_CTRL NCURSES_MOUSE_MASK(5, 0001L)
+#define BUTTON_SHIFT NCURSES_MOUSE_MASK(5, 0002L)
+#define BUTTON_ALT NCURSES_MOUSE_MASK(5, 0004L)
+#define REPORT_MOUSE_POSITION NCURSES_MOUSE_MASK(5, 0010L)
+
+#endif
+
+#define ALL_MOUSE_EVENTS (REPORT_MOUSE_POSITION - 1)
+
+/* macros to extract single event-bits from masks */
+#define BUTTON_RELEASE(e, x) ((e) & (001 << (6 * ((x) - 1))))
+#define BUTTON_PRESS(e, x) ((e) & (002 << (6 * ((x) - 1))))
+#define BUTTON_CLICK(e, x) ((e) & (004 << (6 * ((x) - 1))))
+#define BUTTON_DOUBLE_CLICK(e, x) ((e) & (010 << (6 * ((x) - 1))))
+#define BUTTON_TRIPLE_CLICK(e, x) ((e) & (020 << (6 * ((x) - 1))))
+#define BUTTON_RESERVED_EVENT(e, x) ((e) & (040 << (6 * ((x) - 1))))
+
+typedef struct
+{
+ short id; /* ID to distinguish multiple devices */
+ int x, y, z; /* event coordinates (character-cell) */
+ mmask_t bstate; /* button state bits */
+}
+MEVENT;
+
+extern NCURSES_EXPORT(int) getmouse (MEVENT *);
+extern NCURSES_EXPORT(int) ungetmouse (MEVENT *);
+extern NCURSES_EXPORT(mmask_t) mousemask (mmask_t, mmask_t *);
+extern NCURSES_EXPORT(bool) wenclose (const WINDOW *, int, int);
+extern NCURSES_EXPORT(int) mouseinterval (int);
+extern NCURSES_EXPORT(bool) wmouse_trafo (const WINDOW*, int*, int*, bool);
+extern NCURSES_EXPORT(bool) mouse_trafo (int*, int*, bool); /* generated */
+
+#define mouse_trafo(y,x,to_screen) wmouse_trafo(stdscr,y,x,to_screen)
+
+/* other non-XSI functions */
+
+extern NCURSES_EXPORT(int) mcprint (char *, int); /* direct data to printer */
+extern NCURSES_EXPORT(int) has_key (int); /* do we have given key? */
+
+/* Debugging : use with libncurses_g.a */
+
+extern NCURSES_EXPORT(void) _tracef (const char *, ...) GCC_PRINTFLIKE(1,2);
+extern NCURSES_EXPORT(void) _tracedump (const char *, WINDOW *);
+extern NCURSES_EXPORT(char *) _traceattr (attr_t);
+extern NCURSES_EXPORT(char *) _traceattr2 (int, chtype);
+extern NCURSES_EXPORT(char *) _nc_tracebits (void);
+extern NCURSES_EXPORT(char *) _tracechar (int);
+extern NCURSES_EXPORT(char *) _tracechtype (chtype);
+extern NCURSES_EXPORT(char *) _tracechtype2 (int, chtype);
+#ifdef _XOPEN_SOURCE_EXTENDED
+#define _tracech_t _tracecchar_t
+extern NCURSES_EXPORT(char *) _tracecchar_t (const cchar_t *);
+#define _tracech_t2 _tracecchar_t2
+extern NCURSES_EXPORT(char *) _tracecchar_t2 (int, const cchar_t *);
+#else
+#define _tracech_t _tracechtype
+#define _tracech_t2 _tracechtype2
+#endif
+extern NCURSES_EXPORT(char *) _tracemouse (const MEVENT *);
+extern NCURSES_EXPORT(void) trace (const unsigned int);
+
+/* trace masks */
+#define TRACE_DISABLE 0x0000 /* turn off tracing */
+#define TRACE_TIMES 0x0001 /* trace user and system times of updates */
+#define TRACE_TPUTS 0x0002 /* trace tputs calls */
+#define TRACE_UPDATE 0x0004 /* trace update actions, old & new screens */
+#define TRACE_MOVE 0x0008 /* trace cursor moves and scrolls */
+#define TRACE_CHARPUT 0x0010 /* trace all character outputs */
+#define TRACE_ORDINARY 0x001F /* trace all update actions */
+#define TRACE_CALLS 0x0020 /* trace all curses calls */
+#define TRACE_VIRTPUT 0x0040 /* trace virtual character puts */
+#define TRACE_IEVENT 0x0080 /* trace low-level input processing */
+#define TRACE_BITS 0x0100 /* trace state of TTY control bits */
+#define TRACE_ICALLS 0x0200 /* trace internal/nested calls */
+#define TRACE_CCALLS 0x0400 /* trace per-character calls */
+#define TRACE_DATABASE 0x0800 /* trace read/write of terminfo/termcap data */
+#define TRACE_ATTRS 0x1000 /* trace attribute updates */
+
+#define TRACE_SHIFT 13 /* number of bits in the trace masks */
+#define TRACE_MAXIMUM ((1 << TRACE_SHIFT) - 1) /* maximum trace level */
+
+#if defined(TRACE) || defined(NCURSES_TEST)
+extern NCURSES_EXPORT_VAR(int) _nc_optimize_enable; /* enable optimizations */
+extern NCURSES_EXPORT(const char *) _nc_visbuf (const char *);
+#define OPTIMIZE_MVCUR 0x01 /* cursor movement optimization */
+#define OPTIMIZE_HASHMAP 0x02 /* diff hashing to detect scrolls */
+#define OPTIMIZE_SCROLL 0x04 /* scroll optimization */
+#define OPTIMIZE_ALL 0xff /* enable all optimizations (dflt) */
+#endif
+
+#ifdef __cplusplus
+
+#ifndef NCURSES_NOMACROS
+
+/* these names conflict with STL */
+#undef box
+#undef clear
+#undef erase
+#undef move
+#undef refresh
+
+#endif /* NCURSES_NOMACROS */
+
+}
+#endif
+
+#endif /* __NCURSES_H */
diff --git a/sysroot/usr/include/cursesapp.h b/sysroot/usr/include/cursesapp.h
new file mode 100644
index 0000000..7e995d2
--- /dev/null
+++ b/sysroot/usr/include/cursesapp.h
@@ -0,0 +1,176 @@
+// * This makes emacs happy -*-Mode: C++;-*-
+/****************************************************************************
+ * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Juergen Pfeifer, 1997 *
+ ****************************************************************************/
+
+// $Id: cursesapp.h,v 1.11 2005/05/28 21:57:44 tom Exp $
+
+#ifndef NCURSES_CURSESAPP_H_incl
+#define NCURSES_CURSESAPP_H_incl
+
+#include <cursslk.h>
+
+class NCURSES_IMPEXP NCursesApplication {
+public:
+ typedef struct _slk_link { // This structure is used to maintain
+ struct _slk_link* prev; // a stack of SLKs
+ Soft_Label_Key_Set* SLKs;
+ } SLK_Link;
+private:
+ static int rinit(NCursesWindow& w); // Internal Init function for title
+ static NCursesApplication* theApp; // Global ref. to the application
+
+ static SLK_Link* slk_stack;
+
+protected:
+ static NCursesWindow* titleWindow; // The Title Window (if any)
+
+ bool b_Colors; // Is this a color application?
+ NCursesWindow* Root_Window; // This is the stdscr equiv.
+
+ // Initialization of attributes;
+ // Rewrite this in your derived class if you prefer other settings
+ virtual void init(bool bColors);
+
+ // The number of lines for the title window. Default is no title window
+ // You may rewrite this in your derived class
+ virtual int titlesize() const {
+ return 0;
+ }
+
+ // This method is called to put something into the title window initially
+ // You may rewrite this in your derived class
+ virtual void title() {
+ }
+
+ // The layout used for the Soft Label Keys. Default is to have no SLKs.
+ // You may rewrite this in your derived class
+ virtual Soft_Label_Key_Set::Label_Layout useSLKs() const {
+ return Soft_Label_Key_Set::None;
+ }
+
+ // This method is called to initialize the SLKs. Default is nothing.
+ // You may rewrite this in your derived class
+ virtual void init_labels(Soft_Label_Key_Set& S) const {
+ }
+
+ // Your derived class must implement this method. The return value must
+ // be the exit value of your application.
+ virtual int run() = 0;
+
+ // The constructor is protected, so you may use it in your derived
+ // class constructor. The argument tells whether or not you want colors.
+ NCursesApplication(bool wantColors = FALSE);
+
+ NCursesApplication& operator=(const NCursesApplication& rhs)
+ {
+ if (this != &rhs) {
+ *this = rhs;
+ }
+ return *this;
+ }
+
+ NCursesApplication(const NCursesApplication& rhs)
+ : b_Colors(rhs.b_Colors),
+ Root_Window(rhs.Root_Window)
+ {
+ }
+
+public:
+ virtual ~NCursesApplication();
+
+ // Get a pointer to the current application object
+ static NCursesApplication* getApplication() {
+ return theApp;
+ }
+
+ // This method runs the application and returns its exit value
+ int operator()(void);
+
+ // Process the commandline arguments. The default implementation simply
+ // ignores them. Your derived class may rewrite this.
+ virtual void handleArgs(int argc, char* argv[]) {
+ }
+
+ // Does this application use colors?
+ inline bool useColors() const {
+ return b_Colors;
+ }
+
+ // Push the Key Set S onto the SLK Stack. S then becomes the current set
+ // of Soft Labelled Keys.
+ void push(Soft_Label_Key_Set& S);
+
+ // Throw away the current set of SLKs and make the previous one the
+ // new current set.
+ bool pop();
+
+ // Retrieve the current set of Soft Labelled Keys.
+ Soft_Label_Key_Set* top() const;
+
+ // Attributes to use for menu and forms foregrounds
+ virtual chtype foregrounds() const {
+ return b_Colors ? COLOR_PAIR(1) : A_BOLD;
+ }
+
+ // Attributes to use for menu and forms backgrounds
+ virtual chtype backgrounds() const {
+ return b_Colors ? COLOR_PAIR(2) : A_NORMAL;
+ }
+
+ // Attributes to use for inactive (menu) elements
+ virtual chtype inactives() const {
+ return b_Colors ? (COLOR_PAIR(3)|A_DIM) : A_DIM;
+ }
+
+ // Attributes to use for (form) labels and SLKs
+ virtual chtype labels() const {
+ return b_Colors ? COLOR_PAIR(4) : A_NORMAL;
+ }
+
+ // Attributes to use for form backgrounds
+ virtual chtype dialog_backgrounds() const {
+ return b_Colors ? COLOR_PAIR(4) : A_NORMAL;
+ }
+
+ // Attributes to use as default for (form) window backgrounds
+ virtual chtype window_backgrounds() const {
+ return b_Colors ? COLOR_PAIR(5) : A_NORMAL;
+ }
+
+ // Attributes to use for the title window
+ virtual chtype screen_titles() const {
+ return b_Colors ? COLOR_PAIR(6) : A_BOLD;
+ }
+
+};
+
+#endif /* NCURSES_CURSESAPP_H_incl */
diff --git a/sysroot/usr/include/cursesf.h b/sysroot/usr/include/cursesf.h
new file mode 100644
index 0000000..70a30c3
--- /dev/null
+++ b/sysroot/usr/include/cursesf.h
@@ -0,0 +1,967 @@
+// * This makes emacs happy -*-Mode: C++;-*-
+/****************************************************************************
+ * Copyright (c) 1998-2004,2005 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Juergen Pfeifer, 1997 *
+ ****************************************************************************/
+
+// $Id: cursesf.h,v 1.28 2005/08/13 18:08:24 tom Exp $
+
+#ifndef NCURSES_CURSESF_H_incl
+#define NCURSES_CURSESF_H_incl 1
+
+#include <cursesp.h>
+
+#ifndef __EXT_QNX
+#include <string.h>
+#endif
+
+extern "C" {
+# include <form.h>
+}
+//
+// -------------------------------------------------------------------------
+// The abstract base class for buitin and user defined Fieldtypes.
+// -------------------------------------------------------------------------
+//
+class NCURSES_IMPEXP NCursesFormField; // forward declaration
+
+// Class to represent builtin field types as well as C++ written new
+// fieldtypes (see classes UserDefineFieldType...
+class NCURSES_IMPEXP NCursesFieldType
+{
+ friend class NCursesFormField;
+
+protected:
+ FIELDTYPE* fieldtype;
+
+ inline void OnError(int err) const THROWS(NCursesFormException) {
+ if (err!=E_OK)
+ THROW(new NCursesFormException (err));
+ }
+
+ NCursesFieldType(FIELDTYPE *f) : fieldtype(f) {
+ }
+
+ virtual ~NCursesFieldType() {}
+
+ // Set the fields f fieldtype to this one.
+ virtual void set(NCursesFormField& f) = 0;
+
+public:
+ NCursesFieldType()
+ : fieldtype(STATIC_CAST(FIELDTYPE*)(0))
+ {
+ }
+
+ NCursesFieldType& operator=(const NCursesFieldType& rhs)
+ {
+ if (this != &rhs) {
+ *this = rhs;
+ }
+ return *this;
+ }
+
+ NCursesFieldType(const NCursesFieldType& rhs)
+ : fieldtype(rhs.fieldtype)
+ {
+ }
+
+};
+
+//
+// -------------------------------------------------------------------------
+// The class representing a forms field, wrapping the lowlevel FIELD struct
+// -------------------------------------------------------------------------
+//
+class NCURSES_IMPEXP NCursesFormField
+{
+ friend class NCursesForm;
+
+protected:
+ FIELD *field; // lowlevel structure
+ NCursesFieldType* ftype; // Associated field type
+
+ // Error handler
+ inline void OnError (int err) const THROWS(NCursesFormException) {
+ if (err != E_OK)
+ THROW(new NCursesFormException (err));
+ }
+
+public:
+ // Create a 'Null' field. Can be used to delimit a field list
+ NCursesFormField()
+ : field(STATIC_CAST(FIELD*)(0)),
+ ftype(STATIC_CAST(NCursesFieldType*)(0))
+ {
+ }
+
+ // Create a new field
+ NCursesFormField (int rows,
+ int ncols,
+ int first_row = 0,
+ int first_col = 0,
+ int offscreen_rows = 0,
+ int additional_buffers = 0)
+ : field(0),
+ ftype(STATIC_CAST(NCursesFieldType*)(0))
+ {
+ field = ::new_field(rows, ncols, first_row, first_col,
+ offscreen_rows, additional_buffers);
+ if (!field)
+ OnError(errno);
+ }
+
+ NCursesFormField& operator=(const NCursesFormField& rhs)
+ {
+ if (this != &rhs) {
+ *this = rhs;
+ }
+ return *this;
+ }
+
+ NCursesFormField(const NCursesFormField& rhs)
+ : field(rhs.field), ftype(rhs.ftype)
+ {
+ }
+
+ virtual ~NCursesFormField ();
+
+ // Duplicate the field at a new position
+ inline NCursesFormField* dup(int first_row, int first_col)
+ {
+ NCursesFormField* f = new NCursesFormField();
+ if (!f)
+ OnError(E_SYSTEM_ERROR);
+ else {
+ f->ftype = ftype;
+ f->field = ::dup_field(field,first_row,first_col);
+ if (!f->field)
+ OnError(errno);
+ }
+ return f;
+ }
+
+ // Link the field to a new location
+ inline NCursesFormField* link(int first_row, int first_col) {
+ NCursesFormField* f = new NCursesFormField();
+ if (!f)
+ OnError(E_SYSTEM_ERROR);
+ else {
+ f->ftype = ftype;
+ f->field = ::link_field(field,first_row,first_col);
+ if (!f->field)
+ OnError(errno);
+ }
+ return f;
+ }
+
+ // Get the lowlevel field representation
+ inline FIELD* get_field() const {
+ return field;
+ }
+
+ // Retrieve info about the field
+ inline void info(int& rows, int& ncols,
+ int& first_row, int& first_col,
+ int& offscreen_rows, int& additional_buffers) const {
+ OnError(::field_info(field, &rows, &ncols,
+ &first_row, &first_col,
+ &offscreen_rows, &additional_buffers));
+ }
+
+ // Retrieve info about the fields dynamic properties.
+ inline void dynamic_info(int& dynamic_rows, int& dynamic_cols,
+ int& max_growth) const {
+ OnError(::dynamic_field_info(field, &dynamic_rows, &dynamic_cols,
+ &max_growth));
+ }
+
+ // For a dynamic field you may set the maximum growth limit.
+ // A zero means unlimited growth.
+ inline void set_maximum_growth(int growth = 0) {
+ OnError(::set_max_field(field,growth));
+ }
+
+ // Move the field to a new position
+ inline void move(int row, int col) {
+ OnError(::move_field(field,row,col));
+ }
+
+ // Mark the field to start a new page
+ inline void new_page(bool pageFlag = FALSE) {
+ OnError(::set_new_page(field,pageFlag));
+ }
+
+ // Retrieve whether or not the field starts a new page.
+ inline bool is_new_page() const {
+ return ::new_page(field);
+ }
+
+ // Set the justification for the field
+ inline void set_justification(int just) {
+ OnError(::set_field_just(field,just));
+ }
+
+ // Retrieve the fields justification
+ inline int justification() const {
+ return ::field_just(field);
+ }
+ // Set the foreground attribute for the field
+ inline void set_foreground(chtype foreground) {
+ OnError(::set_field_fore(field,foreground));
+ }
+
+ // Retrieve the fields foreground attribute
+ inline chtype fore() const {
+ return ::field_fore(field);
+ }
+
+ // Set the background attribute for the field
+ inline void set_background(chtype background) {
+ OnError(::set_field_back(field,background));
+ }
+
+ // Retrieve the fields background attribute
+ inline chtype back() const {
+ return ::field_back(field);
+ }
+
+ // Set the padding character for the field
+ inline void set_pad_character(int padding) {
+ OnError(::set_field_pad(field, padding));
+ }
+
+ // Retrieve the fields padding character
+ inline int pad() const {
+ return ::field_pad(field);
+ }
+
+ // Switch on the fields options
+ inline void options_on (Field_Options opts) {
+ OnError (::field_opts_on (field, opts));
+ }
+
+ // Switch off the fields options
+ inline void options_off (Field_Options opts) {
+ OnError (::field_opts_off (field, opts));
+ }
+
+ // Retrieve the fields options
+ inline Field_Options options () const {
+ return ::field_opts (field);
+ }
+
+ // Set the fields options
+ inline void set_options (Field_Options opts) {
+ OnError (::set_field_opts (field, opts));
+ }
+
+ // Mark the field as changed
+ inline void set_changed(bool changeFlag = TRUE) {
+ OnError(::set_field_status(field,changeFlag));
+ }
+
+ // Test whether or not the field is marked as changed
+ inline bool changed() const {
+ return ::field_status(field);
+ }
+
+ // Return the index of the field in the field array of a form
+ // or -1 if the field is not associated to a form
+ inline int (index)() const {
+ return ::field_index(field);
+ }
+
+ // Store a value in a fields buffer. The default buffer is nr. 0
+ inline void set_value(const char *val, int buffer = 0) {
+ OnError(::set_field_buffer(field,buffer,val));
+ }
+
+ // Retrieve the value of a fields buffer. The default buffer is nr. 0
+ inline char* value(int buffer = 0) const {
+ return ::field_buffer(field,buffer);
+ }
+
+ // Set the validation type of the field.
+ inline void set_fieldtype(NCursesFieldType& f) {
+ ftype = &f;
+ f.set(*this); // A good friend may do that...
+ }
+
+ // Retrieve the validation type of the field.
+ inline NCursesFieldType* fieldtype() const {
+ return ftype;
+ }
+
+};
+
+ // This are the built-in hook functions in this C++ binding. In C++ we use
+ // virtual member functions (see below On_..._Init and On_..._Termination)
+ // to provide this functionality in an object oriented manner.
+extern "C" {
+ void _nc_xx_frm_init(FORM *);
+ void _nc_xx_frm_term(FORM *);
+ void _nc_xx_fld_init(FORM *);
+ void _nc_xx_fld_term(FORM *);
+}
+
+//
+// -------------------------------------------------------------------------
+// The class representing a form, wrapping the lowlevel FORM struct
+// -------------------------------------------------------------------------
+//
+class NCURSES_IMPEXP NCursesForm : public NCursesPanel
+{
+protected:
+ FORM* form; // the lowlevel structure
+
+private:
+ NCursesWindow* sub; // the subwindow object
+ bool b_sub_owner; // is this our own subwindow?
+ bool b_framed; // has the form a border?
+ bool b_autoDelete; // Delete fields when deleting form?
+
+ NCursesFormField** my_fields; // The array of fields for this form
+
+ // This structure is used for the form's user data field to link the
+ // FORM* to the C++ object and to provide extra space for a user pointer.
+ typedef struct {
+ void* m_user; // the pointer for the user's data
+ const NCursesForm* m_back; // backward pointer to C++ object
+ const FORM* m_owner;
+ } UserHook;
+
+ // Get the backward pointer to the C++ object from a FORM
+ static inline NCursesForm* getHook(const FORM *f) {
+ UserHook* hook = reinterpret_cast<UserHook*>(::form_userptr(f));
+ assert(hook != 0 && hook->m_owner==f);
+ return const_cast<NCursesForm*>(hook->m_back);
+ }
+
+ friend void _nc_xx_frm_init(FORM *);
+ friend void _nc_xx_frm_term(FORM *);
+ friend void _nc_xx_fld_init(FORM *);
+ friend void _nc_xx_fld_term(FORM *);
+
+ // Calculate FIELD* array for the menu
+ FIELD** mapFields(NCursesFormField* nfields[]);
+
+protected:
+ // internal routines
+ inline void set_user(void *user) {
+ UserHook* uptr = reinterpret_cast<UserHook*>(::form_userptr (form));
+ assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==form);
+ uptr->m_user = user;
+ }
+
+ inline void *get_user() {
+ UserHook* uptr = reinterpret_cast<UserHook*>(::form_userptr (form));
+ assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==form);
+ return uptr->m_user;
+ }
+
+ void InitForm (NCursesFormField* Fields[],
+ bool with_frame,
+ bool autoDeleteFields);
+
+ inline void OnError (int err) const THROWS(NCursesFormException) {
+ if (err != E_OK)
+ THROW(new NCursesFormException (err));
+ }
+
+ // this wraps the form_driver call.
+ virtual int driver (int c) ;
+
+ // 'Internal' constructor, builds an object without association to a
+ // field array.
+ NCursesForm( int nlines,
+ int ncols,
+ int begin_y = 0,
+ int begin_x = 0)
+ : NCursesPanel(nlines, ncols, begin_y, begin_x),
+ form (STATIC_CAST(FORM*)(0)),
+ sub(0),
+ b_sub_owner(0),
+ b_framed(0),
+ b_autoDelete(0),
+ my_fields(0)
+ {
+ }
+
+public:
+ // Create form for the default panel.
+ NCursesForm (NCursesFormField* Fields[],
+ bool with_frame=FALSE, // reserve space for a frame?
+ bool autoDelete_Fields=FALSE) // do automatic cleanup?
+ : NCursesPanel(),
+ form(0),
+ sub(0),
+ b_sub_owner(0),
+ b_framed(0),
+ b_autoDelete(0),
+ my_fields(0)
+ {
+ InitForm(Fields, with_frame, autoDelete_Fields);
+ }
+
+ // Create a form in a panel with the given position and size.
+ NCursesForm (NCursesFormField* Fields[],
+ int nlines,
+ int ncols,
+ int begin_y,
+ int begin_x,
+ bool with_frame=FALSE, // reserve space for a frame?
+ bool autoDelete_Fields=FALSE) // do automatic cleanup?
+ : NCursesPanel(nlines, ncols, begin_y, begin_x),
+ form(0),
+ sub(0),
+ b_sub_owner(0),
+ b_framed(0),
+ b_autoDelete(0),
+ my_fields(0)
+ {
+ InitForm(Fields, with_frame, autoDelete_Fields);
+ }
+
+ NCursesForm& operator=(const NCursesForm& rhs)
+ {
+ if (this != &rhs) {
+ *this = rhs;
+ NCursesPanel::operator=(rhs);
+ }
+ return *this;
+ }
+
+ NCursesForm(const NCursesForm& rhs)
+ : NCursesPanel(rhs),
+ form(rhs.form),
+ sub(rhs.sub),
+ b_sub_owner(rhs.b_sub_owner),
+ b_framed(rhs.b_framed),
+ b_autoDelete(rhs.b_autoDelete),
+ my_fields(rhs.my_fields)
+ {
+ }
+
+ virtual ~NCursesForm();
+
+ // Set the default attributes for the form
+ virtual void setDefaultAttributes();
+
+ // Retrieve current field of the form.
+ inline NCursesFormField* current_field() const {
+ return my_fields[::field_index(::current_field(form))];
+ }
+
+ // Set the forms subwindow
+ void setSubWindow(NCursesWindow& sub);
+
+ // Set these fields for the form
+ inline void setFields(NCursesFormField* Fields[]) {
+ OnError(::set_form_fields(form,mapFields(Fields)));
+ }
+
+ // Remove the form from the screen
+ inline void unpost (void) {
+ OnError (::unpost_form (form));
+ }
+
+ // Post the form to the screen if flag is true, unpost it otherwise
+ inline void post(bool flag = TRUE) {
+ OnError (flag ? ::post_form(form) : ::unpost_form (form));
+ }
+
+ // Decorations
+ inline void frame(const char *title=NULL, const char* btitle=NULL) {
+ if (b_framed)
+ NCursesPanel::frame(title,btitle);
+ else
+ OnError(E_SYSTEM_ERROR);
+ }
+
+ inline void boldframe(const char *title=NULL, const char* btitle=NULL) {
+ if (b_framed)
+ NCursesPanel::boldframe(title,btitle);
+ else
+ OnError(E_SYSTEM_ERROR);
+ }
+
+ inline void label(const char *topLabel, const char *bottomLabel) {
+ if (b_framed)
+ NCursesPanel::label(topLabel,bottomLabel);
+ else
+ OnError(E_SYSTEM_ERROR);
+ }
+
+ // -----
+ // Hooks
+ // -----
+
+ // Called after the form gets repositioned in its window.
+ // This is especially true if the form is posted.
+ virtual void On_Form_Init();
+
+ // Called before the form gets repositioned in its window.
+ // This is especially true if the form is unposted.
+ virtual void On_Form_Termination();
+
+ // Called after the field became the current field
+ virtual void On_Field_Init(NCursesFormField& field);
+
+ // Called before this field is left as current field.
+ virtual void On_Field_Termination(NCursesFormField& field);
+
+ // Calculate required window size for the form.
+ void scale(int& rows, int& ncols) const {
+ OnError(::scale_form(form,&rows,&ncols));
+ }
+
+ // Retrieve number of fields in the form.
+ int count() const {
+ return ::field_count(form);
+ }
+
+ // Make the page the current page of the form.
+ void set_page(int pageNum) {
+ OnError(::set_form_page(form, pageNum));
+ }
+
+ // Retrieve current page number
+ int page() const {
+ return ::form_page(form);
+ }
+
+ // Switch on the forms options
+ inline void options_on (Form_Options opts) {
+ OnError (::form_opts_on (form, opts));
+ }
+
+ // Switch off the forms options
+ inline void options_off (Form_Options opts) {
+ OnError (::form_opts_off (form, opts));
+ }
+
+ // Retrieve the forms options
+ inline Form_Options options () const {
+ return ::form_opts (form);
+ }
+
+ // Set the forms options
+ inline void set_options (Form_Options opts) {
+ OnError (::set_form_opts (form, opts));
+ }
+
+ // Are there more data in the current field after the data shown
+ inline bool data_ahead() const {
+ return ::data_ahead(form);
+ }
+
+ // Are there more data in the current field before the data shown
+ inline bool data_behind() const {
+ return ::data_behind(form);
+ }
+
+ // Position the cursor to the current field
+ inline void position_cursor () {
+ OnError (::pos_form_cursor (form));
+ }
+ // Set the current field
+ inline void set_current(NCursesFormField& F) {
+ OnError (::set_current_field(form, F.field));
+ }
+
+ // Provide a default key virtualization. Translate the keyboard
+ // code c into a form request code.
+ // The default implementation provides a hopefully straightforward
+ // mapping for the most common keystrokes and form requests.
+ virtual int virtualize(int c);
+
+ // Operators
+ inline NCursesFormField* operator[](int i) const {
+ if ( (i < 0) || (i >= ::field_count (form)) )
+ OnError (E_BAD_ARGUMENT);
+ return my_fields[i];
+ }
+
+ // Perform the menu's operation
+ // Return the field where you left the form.
+ virtual NCursesFormField* operator()(void);
+
+ // Exception handlers. The default is a Beep.
+ virtual void On_Request_Denied(int c) const;
+ virtual void On_Invalid_Field(int c) const;
+ virtual void On_Unknown_Command(int c) const;
+
+};
+
+//
+// -------------------------------------------------------------------------
+// This is the typical C++ typesafe way to allow to attach
+// user data to a field of a form. Its assumed that the user
+// data belongs to some class T. Use T as template argument
+// to create a UserField.
+// -------------------------------------------------------------------------
+template<class T> class NCURSES_IMPEXP NCursesUserField : public NCursesFormField
+{
+public:
+ NCursesUserField (int rows,
+ int ncols,
+ int first_row = 0,
+ int first_col = 0,
+ const T* p_UserData = STATIC_CAST(T*)(0),
+ int offscreen_rows = 0,
+ int additional_buffers = 0)
+ : NCursesFormField (rows, ncols,
+ first_row, first_col,
+ offscreen_rows, additional_buffers) {
+ if (field)
+ OnError(::set_field_userptr(field, STATIC_CAST(void *)(p_UserData)));
+ }
+
+ virtual ~NCursesUserField() {};
+
+ inline const T* UserData (void) const {
+ return reinterpret_cast<const T*>(::field_userptr (field));
+ }
+
+ inline virtual void setUserData(const T* p_UserData) {
+ if (field)
+ OnError (::set_field_userptr (field, STATIC_CAST(void *)(p_UserData)));
+ }
+};
+//
+// -------------------------------------------------------------------------
+// The same mechanism is used to attach user data to a form
+// -------------------------------------------------------------------------
+//
+template<class T> class NCURSES_IMPEXP NCursesUserForm : public NCursesForm
+{
+protected:
+ // 'Internal' constructor, builds an object without association to a
+ // field array.
+ NCursesUserForm( int nlines,
+ int ncols,
+ int begin_y = 0,
+ int begin_x = 0,
+ const T* p_UserData = STATIC_CAST(T*)(0))
+ : NCursesForm(nlines,ncols,begin_y,begin_x) {
+ if (form)
+ set_user (const_cast<void *>(p_UserData));
+ }
+
+public:
+ NCursesUserForm (NCursesFormField Fields[],
+ const T* p_UserData = STATIC_CAST(T*)(0),
+ bool with_frame=FALSE,
+ bool autoDelete_Fields=FALSE)
+ : NCursesForm (Fields, with_frame, autoDelete_Fields) {
+ if (form)
+ set_user (const_cast<void *>(p_UserData));
+ };
+
+ NCursesUserForm (NCursesFormField Fields[],
+ int nlines,
+ int ncols,
+ int begin_y = 0,
+ int begin_x = 0,
+ const T* p_UserData = STATIC_CAST(T*)(0),
+ bool with_frame=FALSE,
+ bool autoDelete_Fields=FALSE)
+ : NCursesForm (Fields, nlines, ncols, begin_y, begin_x,
+ with_frame, autoDelete_Fields) {
+ if (form)
+ set_user (const_cast<void *>(p_UserData));
+ };
+
+ virtual ~NCursesUserForm() {
+ };
+
+ inline T* UserData (void) const {
+ return reinterpret_cast<T*>(get_user ());
+ };
+
+ inline virtual void setUserData (const T* p_UserData) {
+ if (form)
+ set_user (const_cast<void *>(p_UserData));
+ }
+
+};
+//
+// -------------------------------------------------------------------------
+// Builtin Fieldtypes
+// -------------------------------------------------------------------------
+//
+class NCURSES_IMPEXP Alpha_Field : public NCursesFieldType
+{
+private:
+ int min_field_width;
+
+ void set(NCursesFormField& f) {
+ OnError(::set_field_type(f.get_field(),fieldtype,min_field_width));
+ }
+
+public:
+ Alpha_Field(int width)
+ : NCursesFieldType(TYPE_ALPHA),
+ min_field_width(width) {
+ }
+};
+
+class NCURSES_IMPEXP Alphanumeric_Field : public NCursesFieldType
+{
+private:
+ int min_field_width;
+
+ void set(NCursesFormField& f) {
+ OnError(::set_field_type(f.get_field(),fieldtype,min_field_width));
+ }
+
+public:
+ Alphanumeric_Field(int width)
+ : NCursesFieldType(TYPE_ALNUM),
+ min_field_width(width) {
+ }
+};
+
+class NCURSES_IMPEXP Integer_Field : public NCursesFieldType
+{
+private:
+ int precision;
+ long lower_limit, upper_limit;
+
+ void set(NCursesFormField& f) {
+ OnError(::set_field_type(f.get_field(),fieldtype,
+ precision,lower_limit,upper_limit));
+ }
+
+public:
+ Integer_Field(int prec, long low=0L, long high=0L)
+ : NCursesFieldType(TYPE_INTEGER),
+ precision(prec), lower_limit(low), upper_limit(high) {
+ }
+};
+
+class NCURSES_IMPEXP Numeric_Field : public NCursesFieldType
+{
+private:
+ int precision;
+ double lower_limit, upper_limit;
+
+ void set(NCursesFormField& f) {
+ OnError(::set_field_type(f.get_field(),fieldtype,
+ precision,lower_limit,upper_limit));
+ }
+
+public:
+ Numeric_Field(int prec, double low=0.0, double high=0.0)
+ : NCursesFieldType(TYPE_NUMERIC),
+ precision(prec), lower_limit(low), upper_limit(high) {
+ }
+};
+
+class NCURSES_IMPEXP Regular_Expression_Field : public NCursesFieldType
+{
+private:
+ char* regex;
+
+ void set(NCursesFormField& f) {
+ OnError(::set_field_type(f.get_field(),fieldtype,regex));
+ }
+
+ void copy_regex(const char *source)
+ {
+ regex = new char[1 + ::strlen(source)];
+ (::strcpy)(regex, source);
+ }
+
+public:
+ Regular_Expression_Field(const char *expr)
+ : NCursesFieldType(TYPE_REGEXP),
+ regex(NULL)
+ {
+ copy_regex(expr);
+ }
+
+ Regular_Expression_Field& operator=(const Regular_Expression_Field& rhs)
+ {
+ if (this != &rhs) {
+ *this = rhs;
+ copy_regex(rhs.regex);
+ NCursesFieldType::operator=(rhs);
+ }
+ return *this;
+ }
+
+ Regular_Expression_Field(const Regular_Expression_Field& rhs)
+ : NCursesFieldType(rhs),
+ regex(NULL)
+ {
+ copy_regex(rhs.regex);
+ }
+
+ ~Regular_Expression_Field() {
+ delete[] regex;
+ }
+};
+
+class NCURSES_IMPEXP Enumeration_Field : public NCursesFieldType
+{
+private:
+ const char** list;
+ int case_sensitive;
+ int non_unique_matches;
+
+ void set(NCursesFormField& f) {
+ OnError(::set_field_type(f.get_field(),fieldtype,
+ list,case_sensitive,non_unique_matches));
+ }
+public:
+ Enumeration_Field(const char* enums[],
+ bool case_sens=FALSE,
+ bool non_unique=FALSE)
+ : NCursesFieldType(TYPE_ENUM),
+ list(enums),
+ case_sensitive(case_sens ? -1 : 0),
+ non_unique_matches(non_unique ? -1 : 0) {
+ }
+
+ Enumeration_Field& operator=(const Enumeration_Field& rhs)
+ {
+ if (this != &rhs) {
+ *this = rhs;
+ NCursesFieldType::operator=(rhs);
+ }
+ return *this;
+ }
+
+ Enumeration_Field(const Enumeration_Field& rhs)
+ : NCursesFieldType(rhs),
+ list(rhs.list),
+ case_sensitive(rhs.case_sensitive),
+ non_unique_matches(rhs.non_unique_matches)
+ {
+ }
+};
+
+class NCURSES_IMPEXP IPV4_Address_Field : public NCursesFieldType
+{
+private:
+ void set(NCursesFormField& f) {
+ OnError(::set_field_type(f.get_field(),fieldtype));
+ }
+
+public:
+ IPV4_Address_Field() : NCursesFieldType(TYPE_IPV4) {
+ }
+};
+
+extern "C" {
+ bool _nc_xx_fld_fcheck(FIELD *, const void*);
+ bool _nc_xx_fld_ccheck(int c, const void *);
+ void* _nc_xx_fld_makearg(va_list*);
+}
+
+//
+// -------------------------------------------------------------------------
+// Abstract base class for User-Defined Fieldtypes
+// -------------------------------------------------------------------------
+//
+class NCURSES_IMPEXP UserDefinedFieldType : public NCursesFieldType
+{
+ friend class UDF_Init; // Internal helper to set up statics
+private:
+ // For all C++ defined fieldtypes we need only one generic lowlevel
+ // FIELDTYPE* element.
+ static FIELDTYPE* generic_fieldtype;
+
+protected:
+ // This are the functions required by the low level libforms functions
+ // to construct a fieldtype.
+ friend bool _nc_xx_fld_fcheck(FIELD *, const void*);
+ friend bool _nc_xx_fld_ccheck(int c, const void *);
+ friend void* _nc_xx_fld_makearg(va_list*);
+
+ void set(NCursesFormField& f) {
+ OnError(::set_field_type(f.get_field(),fieldtype,&f));
+ }
+
+protected:
+ // Redefine this function to do a field validation. The argument
+ // is a reference to the field you should validate.
+ virtual bool field_check(NCursesFormField& f) = 0;
+
+ // Redefine this function to do a character validation. The argument
+ // is the character to be validated.
+ virtual bool char_check (int c) = 0;
+
+public:
+ UserDefinedFieldType() : NCursesFieldType(generic_fieldtype) {
+ }
+};
+
+extern "C" {
+ bool _nc_xx_next_choice(FIELD*, const void *);
+ bool _nc_xx_prev_choice(FIELD*, const void *);
+}
+
+//
+// -------------------------------------------------------------------------
+// Abstract base class for User-Defined Fieldtypes with Choice functions
+// -------------------------------------------------------------------------
+//
+class NCURSES_IMPEXP UserDefinedFieldType_With_Choice : public UserDefinedFieldType
+{
+ friend class UDF_Init; // Internal helper to set up statics
+private:
+ // For all C++ defined fieldtypes with choice functions we need only one
+ // generic lowlevel FIELDTYPE* element.
+ static FIELDTYPE* generic_fieldtype_with_choice;
+
+ // This are the functions required by the low level libforms functions
+ // to construct a fieldtype with choice functions.
+ friend bool _nc_xx_next_choice(FIELD*, const void *);
+ friend bool _nc_xx_prev_choice(FIELD*, const void *);
+
+protected:
+ // Redefine this function to do the retrieval of the next choice value.
+ // The argument is a reference to the field tobe examined.
+ virtual bool next (NCursesFormField& f) = 0;
+
+ // Redefine this function to do the retrieval of the previous choice value.
+ // The argument is a reference to the field tobe examined.
+ virtual bool previous(NCursesFormField& f) = 0;
+
+public:
+ UserDefinedFieldType_With_Choice() {
+ fieldtype = generic_fieldtype_with_choice;
+ }
+};
+
+#endif /* NCURSES_CURSESF_H_incl */
diff --git a/sysroot/usr/include/cursesm.h b/sysroot/usr/include/cursesm.h
new file mode 100644
index 0000000..d9c2273
--- /dev/null
+++ b/sysroot/usr/include/cursesm.h
@@ -0,0 +1,672 @@
+// * This makes emacs happy -*-Mode: C++;-*-
+/****************************************************************************
+ * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Juergen Pfeifer, 1997 *
+ ****************************************************************************/
+
+// $Id: cursesm.h,v 1.25 2005/08/13 18:10:36 tom Exp $
+
+#ifndef NCURSES_CURSESM_H_incl
+#define NCURSES_CURSESM_H_incl 1
+
+#include <cursesp.h>
+
+extern "C" {
+# include <menu.h>
+}
+//
+// -------------------------------------------------------------------------
+// This wraps the ITEM type of <menu.h>
+// -------------------------------------------------------------------------
+//
+class NCURSES_IMPEXP NCursesMenuItem
+{
+ friend class NCursesMenu;
+
+protected:
+ ITEM *item;
+
+ inline void OnError (int err) const THROWS(NCursesMenuException) {
+ if (err != E_OK)
+ THROW(new NCursesMenuException (err));
+ }
+
+public:
+ NCursesMenuItem (const char* p_name = NULL,
+ const char* p_descript = NULL)
+ : item(0)
+ {
+ item = p_name ? ::new_item (p_name, p_descript) : STATIC_CAST(ITEM*)(0);
+ if (p_name && !item)
+ OnError (E_SYSTEM_ERROR);
+ }
+ // Create an item. If you pass both parameters as NULL, a delimiting
+ // item is constructed which can be used to terminate a list of
+ // NCursesMenu objects.
+
+ NCursesMenuItem& operator=(const NCursesMenuItem& rhs)
+ {
+ if (this != &rhs) {
+ *this = rhs;
+ }
+ return *this;
+ }
+
+ NCursesMenuItem(const NCursesMenuItem& rhs)
+ : item(0)
+ {
+ }
+
+ virtual ~NCursesMenuItem ();
+ // Release the items memory
+
+ inline const char* name () const {
+ return ::item_name (item);
+ }
+ // Name of the item
+
+ inline const char* description () const {
+ return ::item_description (item);
+ }
+ // Description of the item
+
+ inline int (index) (void) const {
+ return ::item_index (item);
+ }
+ // Index of the item in an item array (or -1)
+
+ inline void options_on (Item_Options opts) {
+ OnError (::item_opts_on (item, opts));
+ }
+ // Switch on the items options
+
+ inline void options_off (Item_Options opts) {
+ OnError (::item_opts_off (item, opts));
+ }
+ // Switch off the item's option
+
+ inline Item_Options options () const {
+ return ::item_opts (item);
+ }
+ // Retrieve the items options
+
+ inline void set_options (Item_Options opts) {
+ OnError (::set_item_opts (item, opts));
+ }
+ // Set the items options
+
+ inline void set_value (bool f) {
+ OnError (::set_item_value (item,f));
+ }
+ // Set/Reset the items selection state
+
+ inline bool value () const {
+ return ::item_value (item);
+ }
+ // Retrieve the items selection state
+
+ inline bool visible () const {
+ return ::item_visible (item);
+ }
+ // Retrieve visibility of the item
+
+ virtual bool action();
+ // Perform an action associated with this item; you may use this in an
+ // user supplied driver for a menu; you may derive from this class and
+ // overload action() to supply items with different actions.
+ // If an action returns true, the menu will be exited. The default action
+ // is to do nothing.
+};
+
+// Prototype for an items callback function.
+typedef bool ITEMCALLBACK(NCursesMenuItem&);
+
+// If you don't like to create a child class for individual items to
+// overload action(), you may use this class and provide a callback
+// function pointer for items.
+class NCURSES_IMPEXP NCursesMenuCallbackItem : public NCursesMenuItem
+{
+private:
+ ITEMCALLBACK* p_fct;
+
+public:
+ NCursesMenuCallbackItem(ITEMCALLBACK* fct = NULL,
+ const char* p_name = NULL,
+ const char* p_descript = NULL )
+ : NCursesMenuItem (p_name, p_descript),
+ p_fct (fct) {
+ }
+
+ NCursesMenuCallbackItem& operator=(const NCursesMenuCallbackItem& rhs)
+ {
+ if (this != &rhs) {
+ *this = rhs;
+ }
+ return *this;
+ }
+
+ NCursesMenuCallbackItem(const NCursesMenuCallbackItem& rhs)
+ : NCursesMenuItem(rhs),
+ p_fct(0)
+ {
+ }
+
+ virtual ~NCursesMenuCallbackItem();
+
+ bool action();
+};
+
+ // This are the built-in hook functions in this C++ binding. In C++ we use
+ // virtual member functions (see below On_..._Init and On_..._Termination)
+ // to provide this functionality in an object oriented manner.
+extern "C" {
+ void _nc_xx_mnu_init(MENU *);
+ void _nc_xx_mnu_term(MENU *);
+ void _nc_xx_itm_init(MENU *);
+ void _nc_xx_itm_term(MENU *);
+}
+
+//
+// -------------------------------------------------------------------------
+// This wraps the MENU type of <menu.h>
+// -------------------------------------------------------------------------
+//
+class NCURSES_IMPEXP NCursesMenu : public NCursesPanel
+{
+protected:
+ MENU *menu;
+
+private:
+ NCursesWindow* sub; // the subwindow object
+ bool b_sub_owner; // is this our own subwindow?
+ bool b_framed; // has the menu a border?
+ bool b_autoDelete; // Delete items when deleting menu?
+
+ NCursesMenuItem** my_items; // The array of items for this menu
+
+ // This structure is used for the menu's user data field to link the
+ // MENU* to the C++ object and to provide extra space for a user pointer.
+ typedef struct {
+ void* m_user; // the pointer for the user's data
+ const NCursesMenu* m_back; // backward pointer to C++ object
+ const MENU* m_owner;
+ } UserHook;
+
+ // Get the backward pointer to the C++ object from a MENU
+ static inline NCursesMenu* getHook(const MENU *m) {
+ UserHook* hook = STATIC_CAST(UserHook*)(::menu_userptr(m));
+ assert(hook != 0 && hook->m_owner==m);
+ return const_cast<NCursesMenu*>(hook->m_back);
+ }
+
+ friend void _nc_xx_mnu_init(MENU *);
+ friend void _nc_xx_mnu_term(MENU *);
+ friend void _nc_xx_itm_init(MENU *);
+ friend void _nc_xx_itm_term(MENU *);
+
+ // Calculate ITEM* array for the menu
+ ITEM** mapItems(NCursesMenuItem* nitems[]);
+
+protected:
+ // internal routines
+ inline void set_user(void *user) {
+ UserHook* uptr = STATIC_CAST(UserHook*)(::menu_userptr (menu));
+ assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==menu);
+ uptr->m_user = user;
+ }
+
+ inline void *get_user() {
+ UserHook* uptr = STATIC_CAST(UserHook*)(::menu_userptr (menu));
+ assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==menu);
+ return uptr->m_user;
+ }
+
+ void InitMenu (NCursesMenuItem* menu[],
+ bool with_frame,
+ bool autoDeleteItems);
+
+ inline void OnError (int err) const THROWS(NCursesMenuException) {
+ if (err != E_OK)
+ THROW(new NCursesMenuException (this, err));
+ }
+
+ // this wraps the menu_driver call.
+ virtual int driver (int c) ;
+
+ // 'Internal' constructor to create a menu without association to
+ // an array of items.
+ NCursesMenu( int nlines,
+ int ncols,
+ int begin_y = 0,
+ int begin_x = 0)
+ : NCursesPanel(nlines,ncols,begin_y,begin_x),
+ menu (STATIC_CAST(MENU*)(0)),
+ sub(0),
+ b_sub_owner(0),
+ b_framed(0),
+ b_autoDelete(0),
+ my_items(0)
+ {
+ }
+
+public:
+ // Make a full window size menu
+ NCursesMenu (NCursesMenuItem* Items[],
+ bool with_frame=FALSE, // Reserve space for a frame?
+ bool autoDelete_Items=FALSE) // Autocleanup of Items?
+ : NCursesPanel(),
+ menu(0),
+ sub(0),
+ b_sub_owner(0),
+ b_framed(0),
+ b_autoDelete(0),
+ my_items(0)
+ {
+ InitMenu(Items, with_frame, autoDelete_Items);
+ }
+
+ // Make a menu with a window of this size.
+ NCursesMenu (NCursesMenuItem* Items[],
+ int nlines,
+ int ncols,
+ int begin_y = 0,
+ int begin_x = 0,
+ bool with_frame=FALSE, // Reserve space for a frame?
+ bool autoDelete_Items=FALSE) // Autocleanup of Items?
+ : NCursesPanel(nlines, ncols, begin_y, begin_x),
+ menu(0),
+ sub(0),
+ b_sub_owner(0),
+ b_framed(0),
+ b_autoDelete(0),
+ my_items(0)
+ {
+ InitMenu(Items, with_frame, autoDelete_Items);
+ }
+
+ NCursesMenu& operator=(const NCursesMenu& rhs)
+ {
+ if (this != &rhs) {
+ *this = rhs;
+ NCursesPanel::operator=(rhs);
+ }
+ return *this;
+ }
+
+ NCursesMenu(const NCursesMenu& rhs)
+ : NCursesPanel(rhs),
+ menu(rhs.menu),
+ sub(rhs.sub),
+ b_sub_owner(rhs.b_sub_owner),
+ b_framed(rhs.b_framed),
+ b_autoDelete(rhs.b_autoDelete),
+ my_items(rhs.my_items)
+ {
+ }
+
+ virtual ~NCursesMenu ();
+
+ // Retrieve the menus subwindow
+ inline NCursesWindow& subWindow() const {
+ assert(sub!=NULL);
+ return *sub;
+ }
+
+ // Set the menus subwindow
+ void setSubWindow(NCursesWindow& sub);
+
+ // Set these items for the menu
+ inline void setItems(NCursesMenuItem* Items[]) {
+ OnError(::set_menu_items(menu,mapItems(Items)));
+ }
+
+ // Remove the menu from the screen
+ inline void unpost (void) {
+ OnError (::unpost_menu (menu));
+ }
+
+ // Post the menu to the screen if flag is true, unpost it otherwise
+ inline void post(bool flag = TRUE) {
+ flag ? OnError (::post_menu(menu)) : OnError (::unpost_menu (menu));
+ }
+
+ // Get the numer of rows and columns for this menu
+ inline void scale (int& mrows, int& mcols) const {
+ OnError (::scale_menu (menu, &mrows, &mcols));
+ }
+
+ // Set the format of this menu
+ inline void set_format(int mrows, int mcols) {
+ OnError (::set_menu_format(menu, mrows, mcols));
+ }
+
+ // Get the format of this menu
+ inline void menu_format(int& rows,int& ncols) {
+ ::menu_format(menu,&rows,&ncols);
+ }
+
+ // Items of the menu
+ inline NCursesMenuItem* items() const {
+ return *my_items;
+ }
+
+ // Get the number of items in this menu
+ inline int count() const {
+ return ::item_count(menu);
+ }
+
+ // Get the current item (i.e. the one the cursor is located)
+ inline NCursesMenuItem* current_item() const {
+ return my_items[::item_index(::current_item(menu))];
+ }
+
+ // Get the marker string
+ inline const char* mark() const {
+ return ::menu_mark(menu);
+ }
+
+ // Set the marker string
+ inline void set_mark(const char *marker) {
+ OnError (::set_menu_mark (menu, marker));
+ }
+
+ // Get the name of the request code c
+ inline static const char* request_name(int c) {
+ return ::menu_request_name(c);
+ }
+
+ // Get the current pattern
+ inline char* pattern() const {
+ return ::menu_pattern(menu);
+ }
+
+ // true if there is a pattern match, false otherwise.
+ bool set_pattern (const char *pat);
+
+ // set the default attributes for the menu
+ // i.e. set fore, back and grey attribute
+ virtual void setDefaultAttributes();
+
+ // Get the menus background attributes
+ inline chtype back() const {
+ return ::menu_back(menu);
+ }
+
+ // Get the menus foreground attributes
+ inline chtype fore() const {
+ return ::menu_fore(menu);
+ }
+
+ // Get the menus grey attributes (used for unselectable items)
+ inline chtype grey() const {
+ return ::menu_grey(menu);
+ }
+
+ // Set the menus background attributes
+ inline chtype set_background(chtype a) {
+ return ::set_menu_back(menu,a);
+ }
+
+ // Set the menus foreground attributes
+ inline chtype set_foreground(chtype a) {
+ return ::set_menu_fore(menu,a);
+ }
+
+ // Set the menus grey attributes (used for unselectable items)
+ inline chtype set_grey(chtype a) {
+ return ::set_menu_grey(menu,a);
+ }
+
+ inline void options_on (Menu_Options opts) {
+ OnError (::menu_opts_on (menu,opts));
+ }
+
+ inline void options_off(Menu_Options opts) {
+ OnError (::menu_opts_off(menu,opts));
+ }
+
+ inline Menu_Options options() const {
+ return ::menu_opts(menu);
+ }
+
+ inline void set_options (Menu_Options opts) {
+ OnError (::set_menu_opts (menu,opts));
+ }
+
+ inline int pad() const {
+ return ::menu_pad(menu);
+ }
+
+ inline void set_pad (int padch) {
+ OnError (::set_menu_pad (menu, padch));
+ }
+
+ // Position the cursor to the current item
+ inline void position_cursor () const {
+ OnError (::pos_menu_cursor (menu));
+ }
+
+ // Set the current item
+ inline void set_current(NCursesMenuItem& I) {
+ OnError (::set_current_item(menu, I.item));
+ }
+
+ // Get the current top row of the menu
+ inline int top_row (void) const {
+ return ::top_row (menu);
+ }
+
+ // Set the current top row of the menu
+ inline void set_top_row (int row) {
+ OnError (::set_top_row (menu, row));
+ }
+
+ // spacing control
+ // Set the spacing for the menu
+ inline void setSpacing(int spc_description,
+ int spc_rows,
+ int spc_columns) {
+ OnError(::set_menu_spacing(menu,
+ spc_description,
+ spc_rows,
+ spc_columns));
+ }
+
+ // Get the spacing info for the menu
+ inline void Spacing(int& spc_description,
+ int& spc_rows,
+ int& spc_columns) const {
+ OnError(::menu_spacing(menu,
+ &spc_description,
+ &spc_rows,
+ &spc_columns));
+ }
+
+ // Decorations
+ inline void frame(const char *title=NULL, const char* btitle=NULL) {
+ if (b_framed)
+ NCursesPanel::frame(title,btitle);
+ else
+ OnError(E_SYSTEM_ERROR);
+ }
+
+ inline void boldframe(const char *title=NULL, const char* btitle=NULL) {
+ if (b_framed)
+ NCursesPanel::boldframe(title,btitle);
+ else
+ OnError(E_SYSTEM_ERROR);
+ }
+
+ inline void label(const char *topLabel, const char *bottomLabel) {
+ if (b_framed)
+ NCursesPanel::label(topLabel,bottomLabel);
+ else
+ OnError(E_SYSTEM_ERROR);
+ }
+
+ // -----
+ // Hooks
+ // -----
+
+ // Called after the menu gets repositioned in its window.
+ // This is especially true if the menu is posted.
+ virtual void On_Menu_Init();
+
+ // Called before the menu gets repositioned in its window.
+ // This is especially true if the menu is unposted.
+ virtual void On_Menu_Termination();
+
+ // Called after the item became the current item
+ virtual void On_Item_Init(NCursesMenuItem& item);
+
+ // Called before this item is left as current item.
+ virtual void On_Item_Termination(NCursesMenuItem& item);
+
+ // Provide a default key virtualization. Translate the keyboard
+ // code c into a menu request code.
+ // The default implementation provides a hopefully straightforward
+ // mapping for the most common keystrokes and menu requests.
+ virtual int virtualize(int c);
+
+
+ // Operators
+ inline NCursesMenuItem* operator[](int i) const {
+ if ( (i < 0) || (i >= ::item_count (menu)) )
+ OnError (E_BAD_ARGUMENT);
+ return (my_items[i]);
+ }
+
+ // Perform the menu's operation
+ // Return the item where you left the selection mark for a single
+ // selection menu, or NULL for a multivalued menu.
+ virtual NCursesMenuItem* operator()(void);
+
+ // --------------------
+ // Exception handlers
+ // Called by operator()
+ // --------------------
+
+ // Called if the request is denied
+ virtual void On_Request_Denied(int c) const;
+
+ // Called if the item is not selectable
+ virtual void On_Not_Selectable(int c) const;
+
+ // Called if pattern doesn't match
+ virtual void On_No_Match(int c) const;
+
+ // Called if the command is unknown
+ virtual void On_Unknown_Command(int c) const;
+
+};
+//
+// -------------------------------------------------------------------------
+// This is the typical C++ typesafe way to allow to attach
+// user data to an item of a menu. Its assumed that the user
+// data belongs to some class T. Use T as template argument
+// to create a UserItem.
+// -------------------------------------------------------------------------
+//
+template<class T> class NCURSES_IMPEXP NCursesUserItem : public NCursesMenuItem
+{
+public:
+ NCursesUserItem (const char* p_name,
+ const char* p_descript = NULL,
+ const T* p_UserData = STATIC_CAST(T*)(0))
+ : NCursesMenuItem (p_name, p_descript) {
+ if (item)
+ OnError (::set_item_userptr (item, const_cast<void *>(reinterpret_cast<const void*>(p_UserData))));
+ }
+
+ virtual ~NCursesUserItem() {}
+
+ inline const T* UserData (void) const {
+ return reinterpret_cast<const T*>(::item_userptr (item));
+ };
+
+ inline virtual void setUserData(const T* p_UserData) {
+ if (item)
+ OnError (::set_item_userptr (item, const_cast<void *>(reinterpret_cast<const void *>(p_UserData))));
+ }
+};
+//
+// -------------------------------------------------------------------------
+// The same mechanism is used to attach user data to a menu
+// -------------------------------------------------------------------------
+//
+template<class T> class NCURSES_IMPEXP NCursesUserMenu : public NCursesMenu
+{
+protected:
+ NCursesUserMenu( int nlines,
+ int ncols,
+ int begin_y = 0,
+ int begin_x = 0,
+ const T* p_UserData = STATIC_CAST(T*)(0))
+ : NCursesMenu(nlines,ncols,begin_y,begin_x) {
+ if (menu)
+ set_user (const_cast<void *>(p_UserData));
+ }
+
+public:
+ NCursesUserMenu (NCursesMenuItem Items[],
+ const T* p_UserData = STATIC_CAST(T*)(0),
+ bool with_frame=FALSE,
+ bool autoDelete_Items=FALSE)
+ : NCursesMenu (Items, with_frame, autoDelete_Items) {
+ if (menu)
+ set_user (const_cast<void *>(p_UserData));
+ };
+
+ NCursesUserMenu (NCursesMenuItem Items[],
+ int nlines,
+ int ncols,
+ int begin_y = 0,
+ int begin_x = 0,
+ const T* p_UserData = STATIC_CAST(T*)(0),
+ bool with_frame=FALSE)
+ : NCursesMenu (Items, nlines, ncols, begin_y, begin_x, with_frame) {
+ if (menu)
+ set_user (const_cast<void *>(p_UserData));
+ };
+
+ virtual ~NCursesUserMenu() {
+ };
+
+ inline T* UserData (void) const {
+ return reinterpret_cast<T*>(get_user ());
+ };
+
+ inline virtual void setUserData (const T* p_UserData) {
+ if (menu)
+ set_user (const_cast<void *>(p_UserData));
+ }
+};
+
+#endif /* NCURSES_CURSESM_H_incl */
diff --git a/sysroot/usr/include/cursesp.h b/sysroot/usr/include/cursesp.h
new file mode 100644
index 0000000..3d8828c
--- /dev/null
+++ b/sysroot/usr/include/cursesp.h
@@ -0,0 +1,265 @@
+// * This makes emacs happy -*-Mode: C++;-*-
+/****************************************************************************
+ * Copyright (c) 1998-2005,2007 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Juergen Pfeifer, 1997 *
+ ****************************************************************************/
+
+#ifndef NCURSES_CURSESP_H_incl
+#define NCURSES_CURSESP_H_incl 1
+
+// $Id: cursesp.h,v 1.27 2007/04/07 17:12:54 tom Exp $
+
+#include <cursesw.h>
+
+extern "C" {
+# include <panel.h>
+}
+
+class NCURSES_IMPEXP NCursesPanel
+ : public NCursesWindow
+{
+protected:
+ PANEL *p;
+ static NCursesPanel *dummy;
+
+private:
+ // This structure is used for the panel's user data field to link the
+ // PANEL* to the C++ object and to provide extra space for a user pointer.
+ typedef struct {
+ void* m_user; // the pointer for the user's data
+ const NCursesPanel* m_back; // backward pointer to C++ object
+ const PANEL* m_owner; // the panel itself
+ } UserHook;
+
+ inline UserHook *UserPointer()
+ {
+ UserHook* uptr = reinterpret_cast<UserHook*>(
+ const_cast<void *>(::panel_userptr (p)));
+ return uptr;
+ }
+
+ void init(); // Initialize the panel object
+
+protected:
+ void set_user(void *user)
+ {
+ UserHook* uptr = UserPointer();
+ assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==p);
+ uptr->m_user = user;
+ }
+ // Set the user pointer of the panel.
+
+ void *get_user()
+ {
+ UserHook* uptr = UserPointer();
+ assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==p);
+ return uptr->m_user;
+ }
+
+ void OnError (int err) const THROWS(NCursesPanelException)
+ {
+ if (err==ERR)
+ THROW(new NCursesPanelException (this, err));
+ }
+ // If err is equal to the curses error indicator ERR, an error handler
+ // is called.
+
+ // Get a keystroke. Default implementation calls getch()
+ virtual int getKey(void);
+
+public:
+ NCursesPanel(int nlines,
+ int ncols,
+ int begin_y = 0,
+ int begin_x = 0)
+ : NCursesWindow(nlines,ncols,begin_y,begin_x), p(0)
+ {
+ init();
+ }
+ // Create a panel with this size starting at the requested position.
+
+ NCursesPanel()
+ : NCursesWindow(::stdscr), p(0)
+ {
+ init();
+ }
+ // This constructor creates the default Panel associated with the
+ // ::stdscr window
+
+ NCursesPanel& operator=(const NCursesPanel& rhs)
+ {
+ if (this != &rhs) {
+ *this = rhs;
+ NCursesWindow::operator=(rhs);
+ }
+ return *this;
+ }
+
+ NCursesPanel(const NCursesPanel& rhs)
+ : NCursesWindow(rhs),
+ p(rhs.p)
+ {
+ }
+
+ virtual ~NCursesPanel();
+
+ // basic manipulation
+ inline void hide()
+ {
+ OnError (::hide_panel(p));
+ }
+ // Hide the panel. It stays in the stack but becomes invisible.
+
+ inline void show()
+ {
+ OnError (::show_panel(p));
+ }
+ // Show the panel, i.e. make it visible.
+
+ inline void top()
+ {
+ OnError (::top_panel(p));
+ }
+ // Make this panel the top panel in the stack.
+
+ inline void bottom()
+ {
+ OnError (::bottom_panel(p));
+ }
+ // Make this panel the bottom panel in the stack.
+ // N.B.: The panel associated with ::stdscr is always on the bottom. So
+ // actually bottom() makes the panel the first above ::stdscr.
+
+ virtual int mvwin(int y, int x)
+ {
+ OnError(::move_panel(p, y, x));
+ return OK;
+ }
+
+ inline bool hidden() const
+ {
+ return (::panel_hidden (p) ? TRUE : FALSE);
+ }
+ // Return TRUE if the panel is hidden, FALSE otherwise.
+
+/* The functions panel_above() and panel_below() are not reflected in
+ the NCursesPanel class. The reason for this is, that we cannot
+ assume that a panel retrieved by those operations is one wrapped
+ by a C++ class. Although this situation might be handled, we also
+ need a reverse mapping from PANEL to NCursesPanel which needs some
+ redesign of the low level stuff. At the moment, we define them in the
+ interface but they will always produce an error. */
+ inline NCursesPanel& above() const
+ {
+ OnError(ERR);
+ return *dummy;
+ }
+
+ inline NCursesPanel& below() const
+ {
+ OnError(ERR);
+ return *dummy;
+ }
+
+ // Those two are rewrites of the corresponding virtual members of
+ // NCursesWindow
+ virtual int refresh();
+ // Propagate all panel changes to the virtual screen and update the
+ // physical screen.
+
+ virtual int noutrefresh();
+ // Propagate all panel changes to the virtual screen.
+
+ static void redraw();
+ // Redraw all panels.
+
+ // decorations
+ virtual void frame(const char* title=NULL,
+ const char* btitle=NULL);
+ // Put a frame around the panel and put the title centered in the top line
+ // and btitle in the bottom line.
+
+ virtual void boldframe(const char* title=NULL,
+ const char* btitle=NULL);
+ // Same as frame(), but use highlighted attributes.
+
+ virtual void label(const char* topLabel,
+ const char* bottomLabel);
+ // Put the title centered in the top line and btitle in the bottom line.
+
+ virtual void centertext(int row,const char* label);
+ // Put the label text centered in the specified row.
+};
+
+/* We use templates to provide a typesafe mechanism to associate
+ * user data with a panel. A NCursesUserPanel<T> is a panel
+ * associated with some user data of type T.
+ */
+template<class T> class NCursesUserPanel : public NCursesPanel
+{
+public:
+ NCursesUserPanel (int nlines,
+ int ncols,
+ int begin_y = 0,
+ int begin_x = 0,
+ const T* p_UserData = STATIC_CAST(T*)(0))
+ : NCursesPanel (nlines, ncols, begin_y, begin_x)
+ {
+ if (p)
+ set_user (const_cast<void *>(p_UserData));
+ };
+ // This creates an user panel of the requested size with associated
+ // user data pointed to by p_UserData.
+
+ NCursesUserPanel(const T* p_UserData = STATIC_CAST(T*)(0)) : NCursesPanel()
+ {
+ if (p)
+ set_user(const_cast<void *>(p_UserData));
+ };
+ // This creates an user panel associated with the ::stdscr and user data
+ // pointed to by p_UserData.
+
+ virtual ~NCursesUserPanel() {};
+
+ T* UserData (void) const
+ {
+ return reinterpret_cast<T*>(get_user ());
+ };
+ // Retrieve the user data associated with the panel.
+
+ virtual void setUserData (const T* p_UserData)
+ {
+ if (p)
+ set_user (const_cast<void *>(p_UserData));
+ }
+ // Associate the user panel with the user data pointed to by p_UserData.
+};
+
+#endif /* NCURSES_CURSESP_H_incl */
diff --git a/sysroot/usr/include/cursesw.h b/sysroot/usr/include/cursesw.h
new file mode 100644
index 0000000..62c71ea
--- /dev/null
+++ b/sysroot/usr/include/cursesw.h
@@ -0,0 +1,1439 @@
+// * This makes emacs happy -*-Mode: C++;-*-
+/****************************************************************************
+ * Copyright (c) 1998-2005,2007 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+#ifndef NCURSES_CURSESW_H_incl
+#define NCURSES_CURSESW_H_incl 1
+
+// $Id: cursesw.h,v 1.46 2007/11/24 19:09:09 tom Exp $
+
+#include <etip.h>
+
+extern "C" {
+# include <curses.h>
+}
+
+/* SCO 3.2v4 curses.h includes term.h, which defines lines as a macro.
+ Undefine it here, because NCursesWindow uses lines as a method. */
+#undef lines
+
+/* "Convert" macros to inlines. We'll define it as another symbol to avoid
+ * conflict with library symbols.
+ */
+#undef UNDEF
+#define UNDEF(name) CUR_ ##name
+
+#ifdef addch
+inline int UNDEF(addch)(chtype ch) { return addch(ch); }
+#undef addch
+#define addch UNDEF(addch)
+#endif
+
+#ifdef echochar
+inline int UNDEF(echochar)(chtype ch) { return echochar(ch); }
+#undef echochar
+#define echochar UNDEF(echochar)
+#endif
+
+#ifdef insdelln
+inline int UNDEF(insdelln)(int n) { return insdelln(n); }
+#undef insdelln
+#define insdelln UNDEF(insdelln)
+#endif
+
+#ifdef addstr
+inline int UNDEF(addstr)(const char * str) { return addstr(str); }
+#undef addstr
+#define addstr UNDEF(addstr)
+#endif
+
+#ifdef attron
+inline int UNDEF(attron)(chtype at) { return attron(at); }
+#undef attron
+#define attron UNDEF(attron)
+#endif
+
+#ifdef attroff
+inline int UNDEF(attroff)(chtype at) { return attroff(at); }
+#undef attroff
+#define attroff UNDEF(attroff)
+#endif
+
+#ifdef attrset
+inline chtype UNDEF(attrset)(chtype at) { return attrset(at); }
+#undef attrset
+#define attrset UNDEF(attrset)
+#endif
+
+#ifdef color_set
+inline chtype UNDEF(color_set)(short p, void* opts) { return color_set(p, opts); }
+#undef color_set
+#define color_set UNDEF(color_set)
+#endif
+
+#ifdef border
+inline int UNDEF(border)(chtype ls, chtype rs, chtype ts, chtype bs, chtype tl, chtype tr, chtype bl, chtype br)
+{ return border(ls, rs, ts, bs, tl, tr, bl, br); }
+#undef border
+#define border UNDEF(border)
+#endif
+
+#ifdef box
+inline int UNDEF(box)(WINDOW *win, int v, int h) { return box(win, v, h); }
+#undef box
+#define box UNDEF(box)
+#endif
+
+#ifdef mvwhline
+inline int UNDEF(mvwhline)(WINDOW *win, int y, int x, chtype c, int n) {
+ return mvwhline(win, y, x, c, n); }
+#undef mvwhline
+#define mvwhline UNDEF(mvwhline)
+#endif
+
+#ifdef mvwvline
+inline int UNDEF(mvwvline)(WINDOW *win, int y, int x, chtype c, int n) {
+ return mvwvline(win, y, x, c, n); }
+#undef mvwvline
+#define mvwvline UNDEF(mvwvline)
+#endif
+
+#ifdef clear
+inline int UNDEF(clear)() { return clear(); }
+#undef clear
+#define clear UNDEF(clear)
+#endif
+
+#ifdef clearok
+inline int UNDEF(clearok)(WINDOW* win, bool bf) { return clearok(win, bf); }
+#undef clearok
+#define clearok UNDEF(clearok)
+#else
+extern "C" NCURSES_IMPEXP int NCURSES_API clearok(WINDOW*, bool);
+#endif
+
+#ifdef clrtobot
+inline int UNDEF(clrtobot)() { return clrtobot(); }
+#undef clrtobot
+#define clrtobot UNDEF(clrtobot)
+#endif
+
+#ifdef clrtoeol
+inline int UNDEF(clrtoeol)() { return clrtoeol(); }
+#undef clrtoeol
+#define clrtoeol UNDEF(clrtoeol)
+#endif
+
+#ifdef delch
+inline int UNDEF(delch)() { return delch(); }
+#undef delch
+#define delch UNDEF(delch)
+#endif
+
+#ifdef deleteln
+inline int UNDEF(deleteln)() { return deleteln(); }
+#undef deleteln
+#define deleteln UNDEF(deleteln)
+#endif
+
+#ifdef erase
+inline int UNDEF(erase)() { return erase(); }
+#undef erase
+#define erase UNDEF(erase)
+#endif
+
+#ifdef flushok
+inline int UNDEF(flushok)(WINDOW* _win, bool _bf) {
+ return flushok(_win, _bf); }
+#undef flushok
+#define flushok UNDEF(flushok)
+#else
+#define _no_flushok
+#endif
+
+#ifdef getch
+inline int UNDEF(getch)() { return getch(); }
+#undef getch
+#define getch UNDEF(getch)
+#endif
+
+#ifdef getstr
+inline int UNDEF(getstr)(char *_str) { return getstr(_str); }
+#undef getstr
+#define getstr UNDEF(getstr)
+#endif
+
+#ifdef instr
+inline int UNDEF(instr)(char *_str) { return instr(_str); }
+#undef instr
+#define instr UNDEF(instr)
+#endif
+
+#ifdef innstr
+inline int UNDEF(innstr)(char *_str, int n) { return innstr(_str, n); }
+#undef innstr
+#define innstr UNDEF(innstr)
+#endif
+
+#ifdef mvwinnstr
+inline int UNDEF(mvwinnstr)(WINDOW *win, int y, int x, char *_str, int n) {
+ return mvwinnstr(win, y, x, _str, n); }
+#undef mvwinnstr
+#define mvwinnstr UNDEF(mvwinnstr)
+#endif
+
+#ifdef mvinnstr
+inline int UNDEF(mvinnstr)(int y, int x, char *_str, int n) {
+ return mvinnstr(y, x, _str, n); }
+#undef mvinnstr
+#define mvinnstr UNDEF(mvinnstr)
+#endif
+
+#ifdef winsstr
+inline int UNDEF(winsstr)(WINDOW *w, const char *_str) {
+ return winsstr(w, _str); }
+#undef winsstr
+#define winsstr UNDEF(winsstr)
+#endif
+
+#ifdef mvwinsstr
+inline int UNDEF(mvwinsstr)(WINDOW *w, int y, int x, const char *_str) {
+ return mvwinsstr(w, y, x, _str); }
+#undef mvwinsstr
+#define mvwinsstr UNDEF(mvwinsstr)
+#endif
+
+#ifdef insstr
+inline int UNDEF(insstr)(const char *_str) {
+ return insstr(_str); }
+#undef insstr
+#define insstr UNDEF(insstr)
+#endif
+
+#ifdef mvinsstr
+inline int UNDEF(mvinsstr)(int y, int x, const char *_str) {
+ return mvinsstr(y, x, _str); }
+#undef mvinsstr
+#define mvinsstr UNDEF(mvinsstr)
+#endif
+
+#ifdef insnstr
+inline int UNDEF(insnstr)(const char *_str, int n) {
+ return insnstr(_str, n); }
+#undef insnstr
+#define insnstr UNDEF(insnstr)
+#endif
+
+#ifdef mvwinsnstr
+inline int UNDEF(mvwinsnstr)(WINDOW *w, int y, int x, const char *_str, int n) {
+ return mvwinsnstr(w, y, x, _str, n); }
+#undef mvwinsnstr
+#define mvwinsnstr UNDEF(mvwinsnstr)
+#endif
+
+#ifdef mvinsnstr
+inline int UNDEF(mvinsnstr)(int y, int x, const char *_str, int n) {
+ return mvinsnstr(y, x, _str, n); }
+#undef mvinsnstr
+#define mvinsnstr UNDEF(mvinsnstr)
+#endif
+
+#ifdef getnstr
+inline int UNDEF(getnstr)(char *_str, int n) { return getnstr(_str, n); }
+#undef getnstr
+#define getnstr UNDEF(getnstr)
+#endif
+
+#ifdef getyx
+inline void UNDEF(getyx)(const WINDOW* win, int& y, int& x) {
+ getyx(win, y, x); }
+#undef getyx
+#define getyx UNDEF(getyx)
+#endif
+
+#ifdef getbegyx
+inline void UNDEF(getbegyx)(WINDOW* win, int& y, int& x) { getbegyx(win, y, x); }
+#undef getbegyx
+#define getbegyx UNDEF(getbegyx)
+#endif
+
+#ifdef getmaxyx
+inline void UNDEF(getmaxyx)(WINDOW* win, int& y, int& x) { getmaxyx(win, y, x); }
+#undef getmaxyx
+#define getmaxyx UNDEF(getmaxyx)
+#endif
+
+#ifdef hline
+inline int UNDEF(hline)(chtype ch, int n) { return hline(ch, n); }
+#undef hline
+#define hline UNDEF(hline)
+#endif
+
+#ifdef inch
+inline chtype UNDEF(inch)() { return inch(); }
+#undef inch
+#define inch UNDEF(inch)
+#endif
+
+#ifdef insch
+inline int UNDEF(insch)(chtype c) { return insch(c); }
+#undef insch
+#define insch UNDEF(insch)
+#endif
+
+#ifdef insertln
+inline int UNDEF(insertln)() { return insertln(); }
+#undef insertln
+#define insertln UNDEF(insertln)
+#endif
+
+#ifdef leaveok
+inline int UNDEF(leaveok)(WINDOW* win, bool bf) { return leaveok(win, bf); }
+#undef leaveok
+#define leaveok UNDEF(leaveok)
+#else
+extern "C" NCURSES_IMPEXP int NCURSES_API leaveok(WINDOW* win, bool bf);
+#endif
+
+#ifdef move
+inline int UNDEF(move)(int x, int y) { return move(x, y); }
+#undef move
+#define move UNDEF(move)
+#endif
+
+#ifdef refresh
+inline int UNDEF(refresh)() { return refresh(); }
+#undef refresh
+#define refresh UNDEF(refresh)
+#endif
+
+#ifdef redrawwin
+inline int UNDEF(redrawwin)(WINDOW *win) { return redrawwin(win); }
+#undef redrawwin
+#define redrawwin UNDEF(redrawwin)
+#endif
+
+#ifdef scrl
+inline int UNDEF(scrl)(int l) { return scrl(l); }
+#undef scrl
+#define scrl UNDEF(scrl)
+#endif
+
+#ifdef scroll
+inline int UNDEF(scroll)(WINDOW *win) { return scroll(win); }
+#undef scroll
+#define scroll UNDEF(scroll)
+#endif
+
+#ifdef scrollok
+inline int UNDEF(scrollok)(WINDOW* win, bool bf) { return scrollok(win, bf); }
+#undef scrollok
+#define scrollok UNDEF(scrollok)
+#else
+#if defined(__NCURSES_H)
+extern "C" NCURSES_IMPEXP int NCURSES_API scrollok(WINDOW*, bool);
+#else
+extern "C" NCURSES_IMPEXP int NCURSES_API scrollok(WINDOW*, char);
+#endif
+#endif
+
+#ifdef setscrreg
+inline int UNDEF(setscrreg)(int t, int b) { return setscrreg(t, b); }
+#undef setscrreg
+#define setscrreg UNDEF(setscrreg)
+#endif
+
+#ifdef standend
+inline int UNDEF(standend)() { return standend(); }
+#undef standend
+#define standend UNDEF(standend)
+#endif
+
+#ifdef standout
+inline int UNDEF(standout)() { return standout(); }
+#undef standout
+#define standout UNDEF(standout)
+#endif
+
+#ifdef subpad
+inline WINDOW *UNDEF(subpad)(WINDOW *p, int l, int c, int y, int x)
+{ return derwin(p, l, c, y, x); }
+#undef subpad
+#define subpad UNDEF(subpad)
+#endif
+
+#ifdef timeout
+inline void UNDEF(timeout)(int delay) { timeout(delay); }
+#undef timeout
+#define timeout UNDEF(timeout)
+#endif
+
+#ifdef touchline
+inline int UNDEF(touchline)(WINDOW *win, int s, int c)
+{ return touchline(win, s, c); }
+#undef touchline
+#define touchline UNDEF(touchline)
+#endif
+
+#ifdef touchwin
+inline int UNDEF(touchwin)(WINDOW *win) { return touchwin(win); }
+#undef touchwin
+#define touchwin UNDEF(touchwin)
+#endif
+
+#ifdef untouchwin
+inline int UNDEF(untouchwin)(WINDOW *win) { return untouchwin(win); }
+#undef untouchwin
+#define untouchwin UNDEF(untouchwin)
+#endif
+
+#ifdef vline
+inline int UNDEF(vline)(chtype ch, int n) { return vline(ch, n); }
+#undef vline
+#define vline UNDEF(vline)
+#endif
+
+#ifdef waddstr
+inline int UNDEF(waddstr)(WINDOW *win, char *str) { return waddstr(win, str); }
+#undef waddstr
+#define waddstr UNDEF(waddstr)
+#endif
+
+#ifdef waddchstr
+inline int UNDEF(waddchstr)(WINDOW *win, chtype *at) { return waddchstr(win, at); }
+#undef waddchstr
+#define waddchstr UNDEF(waddchstr)
+#endif
+
+#ifdef wstandend
+inline int UNDEF(wstandend)(WINDOW *win) { return wstandend(win); }
+#undef wstandend
+#define wstandend UNDEF(wstandend)
+#endif
+
+#ifdef wstandout
+inline int UNDEF(wstandout)(WINDOW *win) { return wstandout(win); }
+#undef wstandout
+#define wstandout UNDEF(wstandout)
+#endif
+
+
+#ifdef wattroff
+inline int UNDEF(wattroff)(WINDOW *win, int att) { return wattroff(win, att); }
+#undef wattroff
+#define wattroff UNDEF(wattroff)
+#endif
+
+#ifdef chgat
+inline int UNDEF(chgat)(int n, attr_t attr, short color, const void *opts) {
+ return chgat(n, attr, color, opts); }
+#undef chgat
+#define chgat UNDEF(chgat)
+#endif
+
+#ifdef mvchgat
+inline int UNDEF(mvchgat)(int y, int x, int n,
+ attr_t attr, short color, const void *opts) {
+ return mvchgat(y, x, n, attr, color, opts); }
+#undef mvchgat
+#define mvchgat UNDEF(mvchgat)
+#endif
+
+#ifdef mvwchgat
+inline int UNDEF(mvwchgat)(WINDOW *win, int y, int x, int n,
+ attr_t attr, short color, const void *opts) {
+ return mvwchgat(win, y, x, n, attr, color, opts); }
+#undef mvwchgat
+#define mvwchgat UNDEF(mvwchgat)
+#endif
+
+#ifdef wattrset
+inline int UNDEF(wattrset)(WINDOW *win, int att) { return wattrset(win, att); }
+#undef wattrset
+#define wattrset UNDEF(wattrset)
+#endif
+
+#ifdef winch
+inline chtype UNDEF(winch)(const WINDOW* win) { return winch(win); }
+#undef winch
+#define winch UNDEF(winch)
+#endif
+
+#ifdef mvwaddch
+inline int UNDEF(mvwaddch)(WINDOW *win, int y, int x, const chtype ch)
+{ return mvwaddch(win, y, x, ch); }
+#undef mvwaddch
+#define mvwaddch UNDEF(mvwaddch)
+#endif
+
+#ifdef mvwaddchnstr
+inline int UNDEF(mvwaddchnstr)(WINDOW *win, int y, int x, chtype *str, int n)
+{ return mvwaddchnstr(win, y, x, str, n); }
+#undef mvwaddchnstr
+#define mvwaddchnstr UNDEF(mvwaddchnstr)
+#endif
+
+#ifdef mvwaddchstr
+inline int UNDEF(mvwaddchstr)(WINDOW *win, int y, int x, chtype *str)
+{ return mvwaddchstr(win, y, x, str); }
+#undef mvwaddchstr
+#define mvwaddchstr UNDEF(mvwaddchstr)
+#endif
+
+#ifdef addnstr
+inline int UNDEF(addnstr)(const char *str, int n)
+{ return addnstr(str, n); }
+#undef addnstr
+#define addnstr UNDEF(addnstr)
+#endif
+
+#ifdef mvwaddnstr
+inline int UNDEF(mvwaddnstr)(WINDOW *win, int y, int x, const char *str, int n)
+{ return mvwaddnstr(win, y, x, str, n); }
+#undef mvwaddnstr
+#define mvwaddnstr UNDEF(mvwaddnstr)
+#endif
+
+#ifdef mvwaddstr
+inline int UNDEF(mvwaddstr)(WINDOW *win, int y, int x, const char * str)
+{ return mvwaddstr(win, y, x, str); }
+#undef mvwaddstr
+#define mvwaddstr UNDEF(mvwaddstr)
+#endif
+
+#ifdef mvwdelch
+inline int UNDEF(mvwdelch)(WINDOW *win, int y, int x)
+{ return mvwdelch(win, y, x); }
+#undef mvwdelch
+#define mvwdelch UNDEF(mvwdelch)
+#endif
+
+#ifdef mvwgetch
+inline int UNDEF(mvwgetch)(WINDOW *win, int y, int x) { return mvwgetch(win, y, x);}
+#undef mvwgetch
+#define mvwgetch UNDEF(mvwgetch)
+#endif
+
+#ifdef mvwgetstr
+inline int UNDEF(mvwgetstr)(WINDOW *win, int y, int x, char *str)
+{return mvwgetstr(win, y, x, str);}
+#undef mvwgetstr
+#define mvwgetstr UNDEF(mvwgetstr)
+#endif
+
+#ifdef mvwgetnstr
+inline int UNDEF(mvwgetnstr)(WINDOW *win, int y, int x, char *str, int n)
+{return mvwgetnstr(win, y, x, str, n);}
+#undef mvwgetnstr
+#define mvwgetnstr UNDEF(mvwgetnstr)
+#endif
+
+#ifdef mvwinch
+inline chtype UNDEF(mvwinch)(WINDOW *win, int y, int x) {
+ return mvwinch(win, y, x);}
+#undef mvwinch
+#define mvwinch UNDEF(mvwinch)
+#endif
+
+#ifdef mvwinsch
+inline int UNDEF(mvwinsch)(WINDOW *win, int y, int x, chtype c)
+{ return mvwinsch(win, y, x, c); }
+#undef mvwinsch
+#define mvwinsch UNDEF(mvwinsch)
+#endif
+
+#ifdef mvaddch
+inline int UNDEF(mvaddch)(int y, int x, chtype ch)
+{ return mvaddch(y, x, ch); }
+#undef mvaddch
+#define mvaddch UNDEF(mvaddch)
+#endif
+
+#ifdef mvaddnstr
+inline int UNDEF(mvaddnstr)(int y, int x, const char *str, int n)
+{ return mvaddnstr(y, x, str, n); }
+#undef mvaddnstr
+#define mvaddnstr UNDEF(mvaddnstr)
+#endif
+
+#ifdef mvaddstr
+inline int UNDEF(mvaddstr)(int y, int x, const char * str)
+{ return mvaddstr(y, x, str); }
+#undef mvaddstr
+#define mvaddstr UNDEF(mvaddstr)
+#endif
+
+#ifdef mvdelch
+inline int UNDEF(mvdelch)(int y, int x) { return mvdelch(y, x);}
+#undef mvdelch
+#define mvdelch UNDEF(mvdelch)
+#endif
+
+#ifdef mvgetch
+inline int UNDEF(mvgetch)(int y, int x) { return mvgetch(y, x);}
+#undef mvgetch
+#define mvgetch UNDEF(mvgetch)
+#endif
+
+#ifdef mvgetstr
+inline int UNDEF(mvgetstr)(int y, int x, char *str) {return mvgetstr(y, x, str);}
+#undef mvgetstr
+#define mvgetstr UNDEF(mvgetstr)
+#endif
+
+#ifdef mvgetnstr
+inline int UNDEF(mvgetnstr)(int y, int x, char *str, int n) {
+ return mvgetnstr(y, x, str, n);}
+#undef mvgetnstr
+#define mvgetnstr UNDEF(mvgetnstr)
+#endif
+
+#ifdef mvinch
+inline chtype UNDEF(mvinch)(int y, int x) { return mvinch(y, x);}
+#undef mvinch
+#define mvinch UNDEF(mvinch)
+#endif
+
+#ifdef mvinsch
+inline int UNDEF(mvinsch)(int y, int x, chtype c)
+{ return mvinsch(y, x, c); }
+#undef mvinsch
+#define mvinsch UNDEF(mvinsch)
+#endif
+
+#ifdef napms
+inline void UNDEF(napms)(unsigned long x) { napms(x); }
+#undef napms
+#define napms UNDEF(napms)
+#endif
+
+#ifdef fixterm
+inline int UNDEF(fixterm)(void) { return fixterm(); }
+#undef fixterm
+#define fixterm UNDEF(fixterm)
+#endif
+
+#ifdef resetterm
+inline int UNDEF(resetterm)(void) { return resetterm(); }
+#undef resetterm
+#define resetterm UNDEF(resetterm)
+#endif
+
+#ifdef saveterm
+inline int UNDEF(saveterm)(void) { return saveterm(); }
+#undef saveterm
+#define saveterm UNDEF(saveterm)
+#endif
+
+#ifdef crmode
+inline int UNDEF(crmode)(void) { return crmode(); }
+#undef crmode
+#define crmode UNDEF(crmode)
+#endif
+
+#ifdef nocrmode
+inline int UNDEF(nocrmode)(void) { return nocrmode(); }
+#undef nocrmode
+#define nocrmode UNDEF(nocrmode)
+#endif
+
+#ifdef getbkgd
+inline chtype UNDEF(getbkgd)(const WINDOW *win) { return getbkgd(win); }
+#undef getbkgd
+#define getbkgd UNDEF(getbkgd)
+#endif
+
+#ifdef bkgd
+inline int UNDEF(bkgd)(chtype ch) { return bkgd(ch); }
+#undef bkgd
+#define bkgd UNDEF(bkgd)
+#endif
+
+#ifdef bkgdset
+inline void UNDEF(bkgdset)(chtype ch) { bkgdset(ch); }
+#undef bkgdset
+#define bkgdset UNDEF(bkgdset)
+#endif
+
+/*
+ *
+ * C++ class for windows.
+ *
+ */
+
+extern "C" int _nc_ripoffline(int, int (*init)(WINDOW*, int));
+extern "C" int _nc_xx_ripoff_init(WINDOW *, int);
+extern "C" int _nc_has_mouse(void);
+
+class NCURSES_IMPEXP NCursesWindow
+{
+ friend class NCursesMenu;
+ friend class NCursesForm;
+
+private:
+ static bool b_initialized;
+ static void initialize();
+ void constructing();
+ friend int _nc_xx_ripoff_init(WINDOW *, int);
+
+ void set_keyboard();
+
+ short getcolor(int getback) const;
+ short getPair() const;
+
+ static int setpalette(short fore, short back, short pair);
+ static int colorInitialized;
+
+ // This private constructor is only used during the initialization
+ // of windows generated by ripoffline() calls.
+ NCursesWindow(WINDOW* win, int ncols);
+
+protected:
+ virtual void err_handler(const char *) const THROWS(NCursesException);
+ // Signal an error with the given message text.
+
+ static long count; // count of all active windows:
+ // We rely on the c++ promise that
+ // all otherwise uninitialized
+ // static class vars are set to 0
+
+ WINDOW* w; // the curses WINDOW
+
+ bool alloced; // TRUE if we own the WINDOW
+
+ NCursesWindow* par; // parent, if subwindow
+ NCursesWindow* subwins; // head of subwindows list
+ NCursesWindow* sib; // next subwindow of parent
+
+ void kill_subwindows(); // disable all subwindows
+ // Destroy all subwindows.
+
+ /* Only for use by derived classes. They are then in charge to
+ fill the member variables correctly. */
+ NCursesWindow();
+
+public:
+ NCursesWindow(WINDOW* window); // useful only for stdscr
+
+ NCursesWindow(int nlines, // number of lines
+ int ncols, // number of columns
+ int begin_y, // line origin
+ int begin_x); // col origin
+
+ NCursesWindow(NCursesWindow& par,// parent window
+ int nlines, // number of lines
+ int ncols, // number of columns
+ int begin_y, // absolute or relative
+ int begin_x, // origins:
+ char absrel = 'a');// if `a', begin_y & begin_x are
+ // absolute screen pos, else if `r', they are relative to par origin
+
+ NCursesWindow(NCursesWindow& par,// parent window
+ bool do_box = TRUE);
+ // this is the very common case that we want to create the subwindow that
+ // is two lines and two columns smaller and begins at (1,1).
+ // We may automatically request the box around it.
+
+ NCursesWindow& operator=(const NCursesWindow& rhs)
+ {
+ if (this != &rhs)
+ *this = rhs;
+ return *this;
+ }
+
+ NCursesWindow(const NCursesWindow& rhs)
+ : w(rhs.w), alloced(rhs.alloced), par(rhs.par), subwins(rhs.subwins), sib(rhs.sib)
+ {
+ }
+
+ virtual ~NCursesWindow();
+
+ NCursesWindow Clone();
+ // Make an exact copy of the window.
+
+ // Initialization.
+ static void useColors(void);
+ // Call this routine very early if you want to have colors.
+
+ static int ripoffline(int ripoff_lines,
+ int (*init)(NCursesWindow& win));
+ // This function is used to generate a window of ripped-of lines.
+ // If the argument is positive, lines are removed from the top, if it
+ // is negative lines are removed from the bottom. This enhances the
+ // lowlevel ripoffline() function because it uses the internal
+ // implementation that allows to remove more than just a single line.
+ // This function must be called before any other ncurses function. The
+ // creation of the window is deferred until ncurses gets initialized.
+ // The initialization function is then called.
+
+ // -------------------------------------------------------------------------
+ // terminal status
+ // -------------------------------------------------------------------------
+ int lines() const { initialize(); return LINES; }
+ // Number of lines on terminal, *not* window
+
+ int cols() const { initialize(); return COLS; }
+ // Number of cols on terminal, *not* window
+
+ int tabsize() const { initialize(); return TABSIZE; }
+ // Size of a tab on terminal, *not* window
+
+ static int NumberOfColors();
+ // Number of available colors
+
+ int colors() const { return NumberOfColors(); }
+ // Number of available colors
+
+ // -------------------------------------------------------------------------
+ // window status
+ // -------------------------------------------------------------------------
+ int height() const { return maxy() + 1; }
+ // Number of lines in this window
+
+ int width() const { return maxx() + 1; }
+ // Number of columns in this window
+
+ int begx() const { return getbegx(w); }
+ // Column of top left corner relative to stdscr
+
+ int begy() const { return getbegy(w); }
+ // Line of top left corner relative to stdscr
+
+ int maxx() const { return getmaxx(w) == ERR ? ERR : getmaxx(w)-1; }
+ // Largest x coord in window
+
+ int maxy() const { return getmaxy(w) == ERR ? ERR : getmaxy(w)-1; }
+ // Largest y coord in window
+
+ short getcolor() const;
+ // Actual color pair
+
+ short foreground() const { return getcolor(0); }
+ // Actual foreground color
+
+ short background() const { return getcolor(1); }
+ // Actual background color
+
+ int setpalette(short fore, short back);
+ // Set color palette entry
+
+ int setcolor(short pair);
+ // Set actually used palette entry
+
+ // -------------------------------------------------------------------------
+ // window positioning
+ // -------------------------------------------------------------------------
+ virtual int mvwin(int begin_y, int begin_x) {
+ return ::mvwin(w, begin_y, begin_x); }
+ // Move window to new position with the new position as top left corner.
+ // This is virtual because it is redefined in NCursesPanel.
+
+ // -------------------------------------------------------------------------
+ // coordinate positioning
+ // -------------------------------------------------------------------------
+ int move(int y, int x) { return ::wmove(w, y, x); }
+ // Move cursor the this position
+
+ void getyx(int& y, int& x) const { ::getyx(w, y, x); }
+ // Get current position of the cursor
+
+ int mvcur(int oldrow, int oldcol, int newrow, int newcol) const {
+ return ::mvcur(oldrow, oldcol, newrow, newcol); }
+ // Perform lowlevel cursor motion that takes effect immediately.
+
+ // -------------------------------------------------------------------------
+ // input
+ // -------------------------------------------------------------------------
+ int getch() { return ::wgetch(w); }
+ // Get a keystroke from the window.
+
+ int getch(int y, int x) { return ::mvwgetch(w, y, x); }
+ // Move cursor to position and get a keystroke from the window
+
+ int getstr(char* str, int n=-1) {
+ return ::wgetnstr(w, str, n); }
+ // Read a series of characters into str until a newline or carriage return
+ // is received. Read at most n characters. If n is negative, the limit is
+ // ignored.
+
+ int getstr(int y, int x, char* str, int n=-1) {
+ return ::mvwgetnstr(w, y, x, str, n); }
+ // Move the cursor to the requested position and then perform the getstr()
+ // as described above.
+
+ int instr(char *s, int n=-1) { return ::winnstr(w, s, n); }
+ // Get a string of characters from the window into the buffer s. Retrieve
+ // at most n characters, if n is negative retrieve all characters up to the
+ // end of the current line. Attributes are stripped from the characters.
+
+ int instr(int y, int x, char *s, int n=-1) {
+ return ::mvwinnstr(w, y, x, s, n); }
+ // Move the cursor to the requested position and then perform the instr()
+ // as described above.
+
+ int scanw(const char* fmt, ...)
+ // Perform a scanw function from the window.
+#if __GNUG__ >= 2
+ __attribute__ ((format (scanf, 2, 3)));
+#else
+ ;
+#endif
+
+ int scanw(int y, int x, const char* fmt, ...)
+ // Move the cursor to the requested position and then perform a scanw
+ // from the window.
+#if __GNUG__ >= 2
+ __attribute__ ((format (scanf, 4, 5)));
+#else
+ ;
+#endif
+
+ // -------------------------------------------------------------------------
+ // output
+ // -------------------------------------------------------------------------
+ int addch(const chtype ch) { return ::waddch(w, ch); }
+ // Put attributed character to the window.
+
+ int addch(int y, int x, const chtype ch) {
+ return ::mvwaddch(w, y, x, ch); }
+ // Move cursor to the requested position and then put attributed character
+ // to the window.
+
+ int echochar(const chtype ch) { return ::wechochar(w, ch); }
+ // Put attributed character to the window and refresh it immediately.
+
+ int addstr(const char* str, int n=-1) {
+ return ::waddnstr(w, str, n); }
+ // Write the string str to the window, stop writing if the terminating
+ // NUL or the limit n is reached. If n is negative, it is ignored.
+
+ int addstr(int y, int x, const char * str, int n=-1) {
+ return ::mvwaddnstr(w, y, x, str, n); }
+ // Move the cursor to the requested position and then perform the addstr
+ // as described above.
+
+ int printw(const char* fmt, ...)
+ // Do a formatted print to the window.
+#if (__GNUG__ >= 2) && !defined(printf)
+ __attribute__ ((format (printf, 2, 3)));
+#else
+ ;
+#endif
+
+ int printw(int y, int x, const char * fmt, ...)
+ // Move the cursor and then do a formatted print to the window.
+#if (__GNUG__ >= 2) && !defined(printf)
+ __attribute__ ((format (printf, 4, 5)));
+#else
+ ;
+#endif
+
+ chtype inch() const { return ::winch(w); }
+ // Retrieve attributed character under the current cursor position.
+
+ chtype inch(int y, int x) { return ::mvwinch(w, y, x); }
+ // Move cursor to requested position and then retrieve attributed character
+ // at this position.
+
+ int insch(chtype ch) { return ::winsch(w, ch); }
+ // Insert attributed character into the window before current cursor
+ // position.
+
+ int insch(int y, int x, chtype ch) {
+ return ::mvwinsch(w, y, x, ch); }
+ // Move cursor to requested position and then insert the attributed
+ // character before that position.
+
+ int insertln() { return ::winsdelln(w, 1); }
+ // Insert an empty line above the current line.
+
+ int insdelln(int n=1) { return ::winsdelln(w, n); }
+ // If n>0 insert that many lines above the current line. If n<0 delete
+ // that many lines beginning with the current line.
+
+ int insstr(const char *s, int n=-1) {
+ return ::winsnstr(w, s, n); }
+ // Insert the string into the window before the current cursor position.
+ // Insert stops at end of string or when the limit n is reached. If n is
+ // negative, it is ignored.
+
+ int insstr(int y, int x, const char *s, int n=-1) {
+ return ::mvwinsnstr(w, y, x, s, n); }
+ // Move the cursor to the requested position and then perform the insstr()
+ // as described above.
+
+ int attron (chtype at) { return ::wattron (w, at); }
+ // Switch on the window attributes;
+
+ int attroff(chtype at) { return ::wattroff(w, static_cast<int>(at)); }
+ // Switch off the window attributes;
+
+ int attrset(chtype at) { return ::wattrset(w, static_cast<int>(at)); }
+ // Set the window attributes;
+
+ int color_set(short color_pair_number, void* opts=NULL) {
+ return ::wcolor_set(w, color_pair_number, opts); }
+ // Set the window color attribute;
+
+ int chgat(int n, attr_t attr, short color, const void *opts=NULL) {
+ return ::wchgat(w, n, attr, color, opts); }
+ // Change the attributes of the next n characters in the current line. If
+ // n is negative or greater than the number of remaining characters in the
+ // line, the attributes will be changed up to the end of the line.
+
+ int chgat(int y, int x,
+ int n, attr_t attr, short color, const void *opts=NULL) {
+ return ::mvwchgat(w, y, x, n, attr, color, opts); }
+ // Move the cursor to the requested position and then perform chgat() as
+ // described above.
+
+ // -------------------------------------------------------------------------
+ // background
+ // -------------------------------------------------------------------------
+ chtype getbkgd() const { return ::getbkgd(w); }
+ // Get current background setting.
+
+ int bkgd(const chtype ch) { return ::wbkgd(w, ch); }
+ // Set the background property and apply it to the window.
+
+ void bkgdset(chtype ch) { ::wbkgdset(w, ch); }
+ // Set the background property.
+
+ // -------------------------------------------------------------------------
+ // borders
+ // -------------------------------------------------------------------------
+ int box(chtype vert=0, chtype hor=0) {
+ return ::wborder(w, vert, vert, hor, hor, 0, 0, 0, 0); }
+ // Draw a box around the window with the given vertical and horizontal
+ // drawing characters. If you specify a zero as character, curses will try
+ // to find a "nice" character.
+
+ int border(chtype left=0, chtype right=0,
+ chtype top =0, chtype bottom=0,
+ chtype top_left =0, chtype top_right=0,
+ chtype bottom_left =0, chtype bottom_right=0) {
+ return ::wborder(w, left, right, top, bottom, top_left, top_right,
+ bottom_left, bottom_right); }
+ // Draw a border around the window with the given characters for the
+ // various parts of the border. If you pass zero for a character, curses
+ // will try to find "nice" characters.
+
+ // -------------------------------------------------------------------------
+ // lines and boxes
+ // -------------------------------------------------------------------------
+ int hline(int len, chtype ch=0) { return ::whline(w, ch, len); }
+ // Draw a horizontal line of len characters with the given character. If
+ // you pass zero for the character, curses will try to find a "nice" one.
+
+ int hline(int y, int x, int len, chtype ch=0) {
+ return ::mvwhline(w, y, x, ch, len); }
+ // Move the cursor to the requested position and then draw a horizontal line.
+
+ int vline(int len, chtype ch=0) { return ::wvline(w, ch, len); }
+ // Draw a vertical line of len characters with the given character. If
+ // you pass zero for the character, curses will try to find a "nice" one.
+
+ int vline(int y, int x, int len, chtype ch=0) {
+ return ::mvwvline(w, y, x, ch, len); }
+ // Move the cursor to the requested position and then draw a vertical line.
+
+ // -------------------------------------------------------------------------
+ // erasure
+ // -------------------------------------------------------------------------
+ int erase() { return ::werase(w); }
+ // Erase the window.
+
+ int clear() { return ::wclear(w); }
+ // Clear the window.
+
+ int clearok(bool bf) { return ::clearok(w, bf); }
+ // Set/Reset the clear flag. If set, the next refresh() will clear the
+ // screen.
+
+ int clrtobot() { return ::wclrtobot(w); }
+ // Clear to the end of the window.
+
+ int clrtoeol() { return ::wclrtoeol(w); }
+ // Clear to the end of the line.
+
+ int delch() { return ::wdelch(w); }
+ // Delete character under the cursor.
+
+ int delch(int y, int x) { return ::mvwdelch(w, y, x); }
+ // Move cursor to requested position and delete the character under the
+ // cursor.
+
+ int deleteln() { return ::winsdelln(w, -1); }
+ // Delete the current line.
+
+ // -------------------------------------------------------------------------
+ // screen control
+ // -------------------------------------------------------------------------
+ int scroll(int amount=1) { return ::wscrl(w, amount); }
+ // Scroll amount lines. If amount is positive, scroll up, otherwise
+ // scroll down.
+
+ int scrollok(bool bf) { return ::scrollok(w, bf); }
+ // If bf is TRUE, window scrolls if cursor is moved off the bottom
+ // edge of the window or a scrolling region, otherwise the cursor is left
+ // at the bottom line.
+
+ int setscrreg(int from, int to) {
+ return ::wsetscrreg(w, from, to); }
+ // Define a soft scrolling region.
+
+ int idlok(bool bf) { return ::idlok(w, bf); }
+ // If bf is TRUE, use insert/delete line hardware support if possible.
+ // Otherwise do it in software.
+
+
+ void idcok(bool bf) { ::idcok(w, bf); }
+ // If bf is TRUE, use insert/delete character hardware support if possible.
+ // Otherwise do it in software.
+
+ int touchwin() { return ::wtouchln(w, 0, height(), 1); }
+ // Mark the whole window as modified.
+
+ int untouchwin() { return ::wtouchln(w, 0, height(), 0); }
+ // Mark the whole window as unmodified.
+
+ int touchln(int s, int cnt, bool changed=TRUE) {
+ return ::wtouchln(w, s, cnt, static_cast<int>(changed ? 1 : 0)); }
+ // Mark cnt lines beginning from line s as changed or unchanged, depending
+ // on the value of the changed flag.
+
+ bool is_linetouched(int line) const {
+ return (::is_linetouched(w, line) ? TRUE:FALSE); }
+ // Return TRUE if line is marked as changed, FALSE otherwise
+
+ bool is_wintouched() const {
+ return (::is_wintouched(w) ? TRUE:FALSE); }
+ // Return TRUE if window is marked as changed, FALSE otherwise
+
+ int leaveok(bool bf) { return ::leaveok(w, bf); }
+ // If bf is TRUE, curses will leave the cursor after an update whereever
+ // it is after the update.
+
+ int redrawln(int from, int n) { return ::wredrawln(w, from, n); }
+ // Redraw n lines starting from the requested line
+
+ int redrawwin() { return ::wredrawln(w, 0, height()); }
+ // Redraw the whole window
+
+ int doupdate() { return ::doupdate(); }
+ // Do all outputs to make the physical screen looking like the virtual one
+
+ void syncdown() { ::wsyncdown(w); }
+ // Propagate the changes down to all descendant windows
+
+ void syncup() { ::wsyncup(w); }
+ // Propagate the changes up in the hierarchy
+
+ void cursyncup() { ::wcursyncup(w); }
+ // Position the cursor in all ancestor windows corresponding to our setting
+
+ int syncok(bool bf) { return ::syncok(w, bf); }
+ // If called with bf=TRUE, syncup() is called whenever the window is changed
+
+#ifndef _no_flushok
+ int flushok(bool bf) { return ::flushok(w, bf); }
+#endif
+
+ void immedok(bool bf) { ::immedok(w, bf); }
+ // If called with bf=TRUE, any change in the window will cause an
+ // automatic immediate refresh()
+
+ int keypad(bool bf) { return ::keypad(w, bf); }
+ // If called with bf=TRUE, the application will interpret function keys.
+
+ int meta(bool bf) { return ::meta(w, bf); }
+ // If called with bf=TRUE, keys may generate 8-Bit characters. Otherwise
+ // 7-Bit characters are generated.
+
+ int standout() { return ::wstandout(w); }
+ // Enable "standout" attributes
+
+ int standend() { return ::wstandend(w); }
+ // Disable "standout" attributes
+
+ // -------------------------------------------------------------------------
+ // The next two are virtual, because we redefine them in the
+ // NCursesPanel class.
+ // -------------------------------------------------------------------------
+ virtual int refresh() { return ::wrefresh(w); }
+ // Propagate the changes in this window to the virtual screen and call
+ // doupdate(). This is redefined in NCursesPanel.
+
+ virtual int noutrefresh() { return ::wnoutrefresh(w); }
+ // Propagate the changes in this window to the virtual screen. This is
+ // redefined in NCursesPanel.
+
+ // -------------------------------------------------------------------------
+ // multiple window control
+ // -------------------------------------------------------------------------
+ int overlay(NCursesWindow& win) {
+ return ::overlay(w, win.w); }
+ // Overlay this window over win.
+
+ int overwrite(NCursesWindow& win) {
+ return ::overwrite(w, win.w); }
+ // Overwrite win with this window.
+
+ int copywin(NCursesWindow& win,
+ int sminrow, int smincol,
+ int dminrow, int dmincol,
+ int dmaxrow, int dmaxcol, bool overlaywin=TRUE) {
+ return ::copywin(w, win.w, sminrow, smincol, dminrow, dmincol,
+ dmaxrow, dmaxcol, static_cast<int>(overlaywin ? 1 : 0)); }
+ // Overlay or overwrite the rectangle in win given by dminrow,dmincol,
+ // dmaxrow,dmaxcol with the rectangle in this window beginning at
+ // sminrow,smincol.
+
+ // -------------------------------------------------------------------------
+ // Extended functions
+ // -------------------------------------------------------------------------
+#ifdef NCURSES_EXT_FUNCS
+ int wresize(int newLines, int newColumns) {
+ return ::wresize(w, newLines, newColumns); }
+#endif
+
+ // -------------------------------------------------------------------------
+ // Mouse related
+ // -------------------------------------------------------------------------
+ bool has_mouse() const;
+ // Return TRUE if terminal supports a mouse, FALSE otherwise
+
+ // -------------------------------------------------------------------------
+ // traversal support
+ // -------------------------------------------------------------------------
+ NCursesWindow* child() { return subwins; }
+ // Get the first child window.
+
+ NCursesWindow* sibling() { return sib; }
+ // Get the next child of my parent.
+
+ NCursesWindow* parent() { return par; }
+ // Get my parent.
+
+ bool isDescendant(NCursesWindow& win);
+ // Return TRUE if win is a descendant of this.
+};
+
+// -------------------------------------------------------------------------
+// We leave this here for compatibility reasons.
+// -------------------------------------------------------------------------
+class NCURSES_IMPEXP NCursesColorWindow : public NCursesWindow
+{
+public:
+ NCursesColorWindow(WINDOW* &window) // useful only for stdscr
+ : NCursesWindow(window) {
+ useColors(); }
+
+ NCursesColorWindow(int nlines, // number of lines
+ int ncols, // number of columns
+ int begin_y, // line origin
+ int begin_x) // col origin
+ : NCursesWindow(nlines, ncols, begin_y, begin_x) {
+ useColors(); }
+
+ NCursesColorWindow(NCursesWindow& parentWin,// parent window
+ int nlines, // number of lines
+ int ncols, // number of columns
+ int begin_y, // absolute or relative
+ int begin_x, // origins:
+ char absrel = 'a') // if `a', by & bx are
+ : NCursesWindow(parentWin,
+ nlines, ncols, // absolute screen pos,
+ begin_y, begin_x, // else if `r', they are
+ absrel ) { // relative to par origin
+ useColors(); }
+};
+
+// These enum definitions really belong inside the NCursesPad class, but only
+// recent compilers support that feature.
+
+ typedef enum {
+ REQ_PAD_REFRESH = KEY_MAX + 1,
+ REQ_PAD_UP,
+ REQ_PAD_DOWN,
+ REQ_PAD_LEFT,
+ REQ_PAD_RIGHT,
+ REQ_PAD_EXIT
+ } Pad_Request;
+
+ const Pad_Request PAD_LOW = REQ_PAD_REFRESH; // lowest op-code
+ const Pad_Request PAD_HIGH = REQ_PAD_EXIT; // highest op-code
+
+// -------------------------------------------------------------------------
+// Pad Support. We allow an association of a pad with a "real" window
+// through which the pad may be viewed.
+// -------------------------------------------------------------------------
+class NCURSES_IMPEXP NCursesPad : public NCursesWindow
+{
+private:
+ NCursesWindow* viewWin; // the "viewport" window
+ NCursesWindow* viewSub; // the "viewport" subwindow
+
+ int h_gridsize, v_gridsize;
+
+protected:
+ int min_row, min_col; // top left row/col of the pads display area
+
+ NCursesWindow* Win(void) const {
+ // Get the window into which the pad should be copied (if any)
+ return (viewSub?viewSub:(viewWin?viewWin:0));
+ }
+
+ NCursesWindow* getWindow(void) const {
+ return viewWin;
+ }
+
+ NCursesWindow* getSubWindow(void) const {
+ return viewSub;
+ }
+
+ virtual int driver (int key); // Virtualize keystroke key
+ // The driver translates the keystroke c into an Pad_Request
+
+ virtual void OnUnknownOperation(int pad_req) {
+ ::beep();
+ }
+ // This is called if the driver returns an unknown op-code
+
+ virtual void OnNavigationError(int pad_req) {
+ ::beep();
+ }
+ // This is called if a navigation request couldn't be satisfied
+
+ virtual void OnOperation(int pad_req) {
+ };
+ // OnOperation is called if a Pad_Operation was executed and just before
+ // the refresh() operation is done.
+
+public:
+ NCursesPad(int nlines, int ncols);
+ // create a pad with the given size
+
+ NCursesPad& operator=(const NCursesPad& rhs)
+ {
+ if (this != &rhs) {
+ *this = rhs;
+ NCursesWindow::operator=(rhs);
+ }
+ return *this;
+ }
+
+ NCursesPad(const NCursesPad& rhs)
+ : NCursesWindow(rhs),
+ viewWin(rhs.viewWin),
+ viewSub(rhs.viewSub),
+ h_gridsize(rhs.h_gridsize),
+ v_gridsize(rhs.v_gridsize),
+ min_row(rhs.min_row),
+ min_col(rhs.min_col)
+ {
+ }
+
+ virtual ~NCursesPad() {}
+
+ int echochar(const chtype ch) { return ::pechochar(w, ch); }
+ // Put the attributed character onto the pad and immediately do a
+ // prefresh().
+
+ int refresh();
+ // If a viewport is defined the pad is displayed in this window, otherwise
+ // this is a noop.
+
+ int refresh(int pminrow, int pmincol,
+ int sminrow, int smincol,
+ int smaxrow, int smaxcol) {
+ return ::prefresh(w, pminrow, pmincol,
+ sminrow, smincol, smaxrow, smaxcol);
+ }
+ // The coordinates sminrow,smincol,smaxrow,smaxcol describe a rectangle
+ // on the screen. <b>refresh</b> copies a rectangle of this size beginning
+ // with top left corner pminrow,pmincol onto the screen and calls doupdate().
+
+ int noutrefresh();
+ // If a viewport is defined the pad is displayed in this window, otherwise
+ // this is a noop.
+
+ int noutrefresh(int pminrow, int pmincol,
+ int sminrow, int smincol,
+ int smaxrow, int smaxcol) {
+ return ::pnoutrefresh(w, pminrow, pmincol,
+ sminrow, smincol, smaxrow, smaxcol);
+ }
+ // Does the same as refresh() but without calling doupdate().
+
+ virtual void setWindow(NCursesWindow& view, int v_grid = 1, int h_grid = 1);
+ // Add the window "view" as viewing window to the pad.
+
+ virtual void setSubWindow(NCursesWindow& sub);
+ // Use the subwindow "sub" of the viewport window for the actual viewing.
+ // The full viewport window is usually used to provide some decorations
+ // like frames, titles etc.
+
+ virtual void operator() (void);
+ // Perform Pad's operation
+};
+
+// A FramedPad is constructed always with a viewport window. This viewport
+// will be framed (by a box() command) and the interior of the box is the
+// viewport subwindow. On the frame we display scrollbar sliders.
+class NCURSES_IMPEXP NCursesFramedPad : public NCursesPad
+{
+protected:
+ virtual void OnOperation(int pad_req);
+
+public:
+ NCursesFramedPad(NCursesWindow& win, int nlines, int ncols,
+ int v_grid = 1, int h_grid = 1)
+ : NCursesPad(nlines, ncols) {
+ NCursesPad::setWindow(win, v_grid, h_grid);
+ NCursesPad::setSubWindow(*(new NCursesWindow(win)));
+ }
+ // Construct the FramedPad with the given Window win as viewport.
+
+ virtual ~NCursesFramedPad() {
+ delete getSubWindow();
+ }
+
+ void setWindow(NCursesWindow& view, int v_grid = 1, int h_grid = 1) {
+ err_handler("Operation not allowed");
+ }
+ // Disable this call; the viewport is already defined
+
+ void setSubWindow(NCursesWindow& sub) {
+ err_handler("Operation not allowed");
+ }
+ // Disable this call; the viewport subwindow is already defined
+
+};
+
+#endif /* NCURSES_CURSESW_H_incl */
diff --git a/sysroot/usr/include/cursslk.h b/sysroot/usr/include/cursslk.h
new file mode 100644
index 0000000..091695e
--- /dev/null
+++ b/sysroot/usr/include/cursslk.h
@@ -0,0 +1,238 @@
+// * this is for making emacs happy: -*-Mode: C++;-*-
+/****************************************************************************
+ * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Juergen Pfeifer, 1997 *
+ ****************************************************************************/
+
+// $Id: cursslk.h,v 1.13 2005/05/28 21:58:18 tom Exp $
+
+#ifndef NCURSES_CURSSLK_H_incl
+#define NCURSES_CURSSLK_H_incl
+
+#include <cursesw.h>
+
+class NCURSES_IMPEXP Soft_Label_Key_Set {
+public:
+ // This inner class represents the attributes of a Soft Label Key (SLK)
+ class NCURSES_IMPEXP Soft_Label_Key {
+ friend class Soft_Label_Key_Set;
+ public:
+ typedef enum { Left=0, Center=1, Right=2 } Justification;
+
+ private:
+ char *label; // The Text of the Label
+ Justification format; // The Justification
+ int num; // The number of the Label
+
+ Soft_Label_Key() : label(NULL), format(Left), num(-1) {
+ }
+
+ virtual ~Soft_Label_Key() {
+ delete[] label;
+ };
+
+ public:
+ // Set the text of the Label
+ Soft_Label_Key& operator=(char *text);
+
+ // Set the Justification of the Label
+ Soft_Label_Key& operator=(Justification just) {
+ format = just;
+ return *this;
+ }
+
+ // Retrieve the text of the label
+ inline char* operator()(void) const {
+ return label;
+ }
+
+ Soft_Label_Key& operator=(const Soft_Label_Key& rhs)
+ {
+ if (this != &rhs) {
+ *this = rhs;
+ }
+ return *this;
+ }
+
+ Soft_Label_Key(const Soft_Label_Key& rhs)
+ : label(NULL),
+ format(rhs.format),
+ num(rhs.num)
+ {
+ *this = rhs.label;
+ }
+ };
+
+public:
+ typedef enum {
+ None = -1,
+ Three_Two_Three = 0,
+ Four_Four = 1,
+ PC_Style = 2,
+ PC_Style_With_Index = 3
+ } Label_Layout;
+
+private:
+ static long NCURSES_IMPEXP count; // Number of Key Sets
+ static Label_Layout NCURSES_IMPEXP format; // Layout of the Key Sets
+ static int NCURSES_IMPEXP num_labels; // Number Of Labels in Key Sets
+ bool NCURSES_IMPEXP b_attrInit; // Are attributes initialized
+
+ Soft_Label_Key *slk_array; // The array of SLK's
+
+ // Init the Key Set
+ void init();
+
+ // Activate or Deactivate Label# i, Label counting starts with 1!
+ void activate_label(int i, bool bf=TRUE);
+
+ // Activate of Deactivate all Labels
+ void activate_labels(bool bf);
+
+protected:
+ inline void Error (const char* msg) const THROWS(NCursesException) {
+ THROW(new NCursesException (msg));
+ }
+
+ // Remove SLK's from screen
+ void clear() {
+ if (ERR==::slk_clear())
+ Error("slk_clear");
+ }
+
+ // Restore them
+ void restore() {
+ if (ERR==::slk_restore())
+ Error("slk_restore");
+ }
+
+public:
+
+ // Construct a Key Set, use the most comfortable layout as default.
+ // You must create a Soft_Label_Key_Set before you create any object of
+ // the NCursesWindow, NCursesPanel or derived classes. (Actually before
+ // ::initscr() is called).
+ Soft_Label_Key_Set(Label_Layout fmt);
+
+ // This constructor assumes, that you already constructed a Key Set
+ // with a layout by the constructor above. This layout will be reused.
+ NCURSES_IMPEXP Soft_Label_Key_Set();
+
+ Soft_Label_Key_Set& operator=(const Soft_Label_Key_Set& rhs)
+ {
+ if (this != &rhs) {
+ *this = rhs;
+ init(); // allocate a new slk_array[]
+ }
+ return *this;
+ }
+
+ Soft_Label_Key_Set(const Soft_Label_Key_Set& rhs)
+ : b_attrInit(rhs.b_attrInit),
+ slk_array(NULL)
+ {
+ init(); // allocate a new slk_array[]
+ }
+
+ virtual ~Soft_Label_Key_Set();
+
+ // Get Label# i. Label counting starts with 1!
+ NCURSES_IMPEXP Soft_Label_Key& operator[](int i);
+
+ // Retrieve number of Labels
+ inline int labels() const { return num_labels; }
+
+ // Refresh the SLK portion of the screen
+ inline void refresh() {
+ if (ERR==::slk_refresh())
+ Error("slk_refresh");
+ }
+
+ // Mark the SLK portion of the screen for refresh, defer actual refresh
+ // until next update call.
+ inline void noutrefresh() {
+ if (ERR==::slk_noutrefresh())
+ Error("slk_noutrefresh");
+ }
+
+ // Mark the whole SLK portion of the screen as modified
+ inline void touch() {
+ if (ERR==::slk_touch())
+ Error("slk_touch");
+ }
+
+ // Activate Label# i
+ inline void show(int i) {
+ activate_label(i,FALSE);
+ activate_label(i,TRUE);
+ }
+
+ // Hide Label# i
+ inline void hide(int i) {
+ activate_label(i,FALSE);
+ }
+
+ // Show all Labels
+ inline void show() {
+ activate_labels(FALSE);
+ activate_labels(TRUE);
+ }
+
+ // Hide all Labels
+ inline void hide() {
+ activate_labels(FALSE);
+ }
+
+ inline void attron(attr_t attrs) {
+ if (ERR==::slk_attron(attrs))
+ Error("slk_attron");
+ }
+
+ inline void attroff(attr_t attrs) {
+ if (ERR==::slk_attroff(attrs))
+ Error("slk_attroff");
+ }
+
+ inline void attrset(attr_t attrs) {
+ if (ERR==::slk_attrset(attrs))
+ Error("slk_attrset");
+ }
+
+ inline void color(short color_pair_number) {
+ if (ERR==::slk_color(color_pair_number))
+ Error("slk_color");
+ }
+
+ inline attr_t attr() const {
+ return ::slk_attr();
+ }
+};
+
+#endif /* NCURSES_CURSSLK_H_incl */
diff --git a/sysroot/usr/include/dirent.h b/sysroot/usr/include/dirent.h
new file mode 100644
index 0000000..ed4147d
--- /dev/null
+++ b/sysroot/usr/include/dirent.h
@@ -0,0 +1,351 @@
+/* Copyright (C) 1991-2000, 2003, 2004, 2005 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * POSIX Standard: 5.1.2 Directory Operations <dirent.h>
+ */
+
+#ifndef _DIRENT_H
+#define _DIRENT_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+#include <bits/types.h>
+
+#ifdef __USE_XOPEN
+# ifndef __ino_t_defined
+# ifndef __USE_FILE_OFFSET64
+typedef __ino_t ino_t;
+# else
+typedef __ino64_t ino_t;
+# endif
+# define __ino_t_defined
+# endif
+# if defined __USE_LARGEFILE64 && !defined __ino64_t_defined
+typedef __ino64_t ino64_t;
+# define __ino64_t_defined
+# endif
+#endif
+
+/* This file defines `struct dirent'.
+
+ It defines the macro `_DIRENT_HAVE_D_NAMLEN' iff there is a `d_namlen'
+ member that gives the length of `d_name'.
+
+ It defines the macro `_DIRENT_HAVE_D_RECLEN' iff there is a `d_reclen'
+ member that gives the size of the entire directory entry.
+
+ It defines the macro `_DIRENT_HAVE_D_OFF' iff there is a `d_off'
+ member that gives the file offset of the next directory entry.
+
+ It defines the macro `_DIRENT_HAVE_D_TYPE' iff there is a `d_type'
+ member that gives the type of the file.
+ */
+
+#include <bits/dirent.h>
+
+#if (defined __USE_BSD || defined __USE_MISC) && !defined d_fileno
+# define d_ino d_fileno /* Backward compatibility. */
+#endif
+
+/* These macros extract size information from a `struct dirent *'.
+ They may evaluate their argument multiple times, so it must not
+ have side effects. Each of these may involve a relatively costly
+ call to `strlen' on some systems, so these values should be cached.
+
+ _D_EXACT_NAMLEN (DP) returns the length of DP->d_name, not including
+ its terminating null character.
+
+ _D_ALLOC_NAMLEN (DP) returns a size at least (_D_EXACT_NAMLEN (DP) + 1);
+ that is, the allocation size needed to hold the DP->d_name string.
+ Use this macro when you don't need the exact length, just an upper bound.
+ This macro is less likely to require calling `strlen' than _D_EXACT_NAMLEN.
+ */
+
+#ifdef _DIRENT_HAVE_D_NAMLEN
+# define _D_EXACT_NAMLEN(d) ((d)->d_namlen)
+# define _D_ALLOC_NAMLEN(d) (_D_EXACT_NAMLEN (d) + 1)
+#else
+# define _D_EXACT_NAMLEN(d) (strlen ((d)->d_name))
+# ifdef _DIRENT_HAVE_D_RECLEN
+# define _D_ALLOC_NAMLEN(d) (((char *) (d) + (d)->d_reclen) - &(d)->d_name[0])
+# else
+# define _D_ALLOC_NAMLEN(d) (sizeof (d)->d_name > 1 ? sizeof (d)->d_name : \
+ _D_EXACT_NAMLEN (d) + 1)
+# endif
+#endif
+
+
+#ifdef __USE_BSD
+/* File types for `d_type'. */
+enum
+ {
+ DT_UNKNOWN = 0,
+# define DT_UNKNOWN DT_UNKNOWN
+ DT_FIFO = 1,
+# define DT_FIFO DT_FIFO
+ DT_CHR = 2,
+# define DT_CHR DT_CHR
+ DT_DIR = 4,
+# define DT_DIR DT_DIR
+ DT_BLK = 6,
+# define DT_BLK DT_BLK
+ DT_REG = 8,
+# define DT_REG DT_REG
+ DT_LNK = 10,
+# define DT_LNK DT_LNK
+ DT_SOCK = 12,
+# define DT_SOCK DT_SOCK
+ DT_WHT = 14
+# define DT_WHT DT_WHT
+ };
+
+/* Convert between stat structure types and directory types. */
+# define IFTODT(mode) (((mode) & 0170000) >> 12)
+# define DTTOIF(dirtype) ((dirtype) << 12)
+#endif
+
+
+/* This is the data type of directory stream objects.
+ The actual structure is opaque to users. */
+typedef struct __dirstream DIR;
+
+/* Open a directory stream on NAME.
+ Return a DIR stream on the directory, or NULL if it could not be opened.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern DIR *opendir (__const char *__name) __nonnull ((1));
+
+#ifdef __USE_GNU
+/* Same as opendir, but open the stream on the file descriptor FD.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern DIR *fdopendir (int __fd);
+#endif
+
+/* Close the directory stream DIRP.
+ Return 0 if successful, -1 if not.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int closedir (DIR *__dirp) __nonnull ((1));
+
+/* Read a directory entry from DIRP. Return a pointer to a `struct
+ dirent' describing the entry, or NULL for EOF or error. The
+ storage returned may be overwritten by a later readdir call on the
+ same DIR stream.
+
+ If the Large File Support API is selected we have to use the
+ appropriate interface.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+#ifndef __USE_FILE_OFFSET64
+extern struct dirent *readdir (DIR *__dirp) __nonnull ((1));
+#else
+# ifdef __REDIRECT
+extern struct dirent *__REDIRECT (readdir, (DIR *__dirp), readdir64)
+ __nonnull ((1));
+# else
+# define readdir readdir64
+# endif
+#endif
+
+#ifdef __USE_LARGEFILE64
+extern struct dirent64 *readdir64 (DIR *__dirp) __nonnull ((1));
+#endif
+
+#if defined __USE_POSIX || defined __USE_MISC
+/* Reentrant version of `readdir'. Return in RESULT a pointer to the
+ next entry.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+# ifndef __USE_FILE_OFFSET64
+extern int readdir_r (DIR *__restrict __dirp,
+ struct dirent *__restrict __entry,
+ struct dirent **__restrict __result)
+ __nonnull ((1, 2, 3));
+# else
+# ifdef __REDIRECT
+extern int __REDIRECT (readdir_r,
+ (DIR *__restrict __dirp,
+ struct dirent *__restrict __entry,
+ struct dirent **__restrict __result),
+ readdir64_r) __nonnull ((1, 2, 3));
+# else
+# define readdir_r readdir64_r
+# endif
+# endif
+
+# ifdef __USE_LARGEFILE64
+extern int readdir64_r (DIR *__restrict __dirp,
+ struct dirent64 *__restrict __entry,
+ struct dirent64 **__restrict __result)
+ __nonnull ((1, 2, 3));
+# endif
+#endif /* POSIX or misc */
+
+/* Rewind DIRP to the beginning of the directory. */
+extern void rewinddir (DIR *__dirp) __THROW __nonnull ((1));
+
+#if defined __USE_BSD || defined __USE_MISC || defined __USE_XOPEN
+# include <bits/types.h>
+
+/* Seek to position POS on DIRP. */
+extern void seekdir (DIR *__dirp, long int __pos) __THROW __nonnull ((1));
+
+/* Return the current position of DIRP. */
+extern long int telldir (DIR *__dirp) __THROW __nonnull ((1));
+#endif
+
+#if defined __USE_BSD || defined __USE_MISC
+
+/* Return the file descriptor used by DIRP. */
+extern int dirfd (DIR *__dirp) __THROW __nonnull ((1));
+
+# if defined __OPTIMIZE__ && defined _DIR_dirfd
+# define dirfd(dirp) _DIR_dirfd (dirp)
+# endif
+
+# ifndef MAXNAMLEN
+/* Get the definitions of the POSIX.1 limits. */
+# include <bits/posix1_lim.h>
+
+/* `MAXNAMLEN' is the BSD name for what POSIX calls `NAME_MAX'. */
+# ifdef NAME_MAX
+# define MAXNAMLEN NAME_MAX
+# else
+# define MAXNAMLEN 255
+# endif
+# endif
+
+# define __need_size_t
+# include <stddef.h>
+
+/* Scan the directory DIR, calling SELECTOR on each directory entry.
+ Entries for which SELECT returns nonzero are individually malloc'd,
+ sorted using qsort with CMP, and collected in a malloc'd array in
+ *NAMELIST. Returns the number of entries selected, or -1 on error. */
+# ifndef __USE_FILE_OFFSET64
+extern int scandir (__const char *__restrict __dir,
+ struct dirent ***__restrict __namelist,
+ int (*__selector) (__const struct dirent *),
+ int (*__cmp) (__const void *, __const void *))
+ __nonnull ((1, 2));
+# else
+# ifdef __REDIRECT
+extern int __REDIRECT (scandir,
+ (__const char *__restrict __dir,
+ struct dirent ***__restrict __namelist,
+ int (*__selector) (__const struct dirent *),
+ int (*__cmp) (__const void *, __const void *)),
+ scandir64) __nonnull ((1, 2));
+# else
+# define scandir scandir64
+# endif
+# endif
+
+# if defined __USE_GNU && defined __USE_LARGEFILE64
+/* This function is like `scandir' but it uses the 64bit dirent structure.
+ Please note that the CMP function must now work with struct dirent64 **. */
+extern int scandir64 (__const char *__restrict __dir,
+ struct dirent64 ***__restrict __namelist,
+ int (*__selector) (__const struct dirent64 *),
+ int (*__cmp) (__const void *, __const void *))
+ __nonnull ((1, 2));
+# endif
+
+/* Function to compare two `struct dirent's alphabetically. */
+# ifndef __USE_FILE_OFFSET64
+extern int alphasort (__const void *__e1, __const void *__e2)
+ __THROW __attribute_pure__ __nonnull ((1, 2));
+# else
+# ifdef __REDIRECT
+extern int __REDIRECT_NTH (alphasort,
+ (__const void *__e1, __const void *__e2),
+ alphasort64) __attribute_pure__ __nonnull ((1, 2));
+# else
+# define alphasort alphasort64
+# endif
+# endif
+
+# if defined __USE_GNU && defined __USE_LARGEFILE64
+extern int alphasort64 (__const void *__e1, __const void *__e2)
+ __THROW __attribute_pure__ __nonnull ((1, 2));
+# endif
+
+# ifdef __USE_GNU
+/* Function to compare two `struct dirent's by name & version. */
+# ifndef __USE_FILE_OFFSET64
+extern int versionsort (__const void *__e1, __const void *__e2)
+ __THROW __attribute_pure__ __nonnull ((1, 2));
+# else
+# ifdef __REDIRECT
+extern int __REDIRECT_NTH (versionsort,
+ (__const void *__e1, __const void *__e2),
+ versionsort64)
+ __attribute_pure__ __nonnull ((1, 2));
+# else
+# define versionsort versionsort64
+# endif
+# endif
+
+# ifdef __USE_LARGEFILE64
+extern int versionsort64 (__const void *__e1, __const void *__e2)
+ __THROW __attribute_pure__ __nonnull ((1, 2));
+# endif
+# endif
+
+/* Read directory entries from FD into BUF, reading at most NBYTES.
+ Reading starts at offset *BASEP, and *BASEP is updated with the new
+ position after reading. Returns the number of bytes read; zero when at
+ end of directory; or -1 for errors. */
+# ifndef __USE_FILE_OFFSET64
+extern __ssize_t getdirentries (int __fd, char *__restrict __buf,
+ size_t __nbytes,
+ __off_t *__restrict __basep)
+ __THROW __nonnull ((2, 4));
+# else
+# ifdef __REDIRECT
+extern __ssize_t __REDIRECT_NTH (getdirentries,
+ (int __fd, char *__restrict __buf,
+ size_t __nbytes,
+ __off64_t *__restrict __basep),
+ getdirentries64) __nonnull ((2, 4));
+# else
+# define getdirentries getdirentries64
+# endif
+# endif
+
+# ifdef __USE_LARGEFILE64
+extern __ssize_t getdirentries64 (int __fd, char *__restrict __buf,
+ size_t __nbytes,
+ __off64_t *__restrict __basep)
+ __THROW __nonnull ((2, 4));
+# endif
+
+#endif /* Use BSD or misc. */
+
+__END_DECLS
+
+#endif /* dirent.h */
diff --git a/sysroot/usr/include/dlfcn.h b/sysroot/usr/include/dlfcn.h
new file mode 100644
index 0000000..7e373ed
--- /dev/null
+++ b/sysroot/usr/include/dlfcn.h
@@ -0,0 +1,192 @@
+/* User functions for run-time dynamic loading.
+ Copyright (C) 1995-1999,2000,2001,2003,2004,2006
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _DLFCN_H
+#define _DLFCN_H 1
+
+#include <features.h>
+#define __need_size_t
+#include <stddef.h>
+
+/* Collect various system dependent definitions and declarations. */
+#include <bits/dlfcn.h>
+
+
+#ifdef __USE_GNU
+/* If the first argument of `dlsym' or `dlvsym' is set to RTLD_NEXT
+ the run-time address of the symbol called NAME in the next shared
+ object is returned. The "next" relation is defined by the order
+ the shared objects were loaded. */
+# define RTLD_NEXT ((void *) -1l)
+
+/* If the first argument to `dlsym' or `dlvsym' is set to RTLD_DEFAULT
+ the run-time address of the symbol called NAME in the global scope
+ is returned. */
+# define RTLD_DEFAULT ((void *) 0)
+
+
+/* Type for namespace indeces. */
+typedef long int Lmid_t;
+
+/* Special namespace ID values. */
+# define LM_ID_BASE 0 /* Initial namespace. */
+# define LM_ID_NEWLM -1 /* For dlmopen: request new namespace. */
+#endif
+
+
+__BEGIN_DECLS
+
+/* Open the shared object FILE and map it in; return a handle that can be
+ passed to `dlsym' to get symbol values from it. */
+extern void *dlopen (__const char *__file, int __mode) __THROW;
+
+/* Unmap and close a shared object opened by `dlopen'.
+ The handle cannot be used again after calling `dlclose'. */
+extern int dlclose (void *__handle) __THROW __nonnull ((1));
+
+/* Find the run-time address in the shared object HANDLE refers to
+ of the symbol called NAME. */
+extern void *dlsym (void *__restrict __handle,
+ __const char *__restrict __name) __THROW __nonnull ((2));
+
+#ifdef __USE_GNU
+/* Like `dlopen', but request object to be allocated in a new namespace. */
+extern void *dlmopen (Lmid_t __nsid, __const char *__file, int __mode) __THROW;
+
+/* Find the run-time address in the shared object HANDLE refers to
+ of the symbol called NAME with VERSION. */
+extern void *dlvsym (void *__restrict __handle,
+ __const char *__restrict __name,
+ __const char *__restrict __version)
+ __THROW __nonnull ((2, 3));
+#endif
+
+/* When any of the above functions fails, call this function
+ to return a string describing the error. Each call resets
+ the error string so that a following call returns null. */
+extern char *dlerror (void) __THROW;
+
+
+#ifdef __USE_GNU
+/* Structure containing information about object searched using
+ `dladdr'. */
+typedef struct
+{
+ __const char *dli_fname; /* File name of defining object. */
+ void *dli_fbase; /* Load address of that object. */
+ __const char *dli_sname; /* Name of nearest symbol. */
+ void *dli_saddr; /* Exact value of nearest symbol. */
+} Dl_info;
+
+/* Fill in *INFO with the following information about ADDRESS.
+ Returns 0 iff no shared object's segments contain that address. */
+extern int dladdr (__const void *__address, Dl_info *__info)
+ __THROW __nonnull ((2));
+
+/* Same as `dladdr', but additionally sets *EXTRA_INFO according to FLAGS. */
+extern int dladdr1 (__const void *__address, Dl_info *__info,
+ void **__extra_info, int __flags) __THROW __nonnull ((2));
+
+/* These are the possible values for the FLAGS argument to `dladdr1'.
+ This indicates what extra information is stored at *EXTRA_INFO.
+ It may also be zero, in which case the EXTRA_INFO argument is not used. */
+enum
+ {
+ /* Matching symbol table entry (const ElfNN_Sym *). */
+ RTLD_DL_SYMENT = 1,
+
+ /* The object containing the address (struct link_map *). */
+ RTLD_DL_LINKMAP = 2
+ };
+
+
+/* Get information about the shared object HANDLE refers to.
+ REQUEST is from among the values below, and determines the use of ARG.
+
+ On success, returns zero. On failure, returns -1 and records an error
+ message to be fetched with `dlerror'. */
+extern int dlinfo (void *__restrict __handle,
+ int __request, void *__restrict __arg)
+ __THROW __nonnull ((1, 3));
+
+/* These are the possible values for the REQUEST argument to `dlinfo'. */
+enum
+ {
+ /* Treat ARG as `lmid_t *'; store namespace ID for HANDLE there. */
+ RTLD_DI_LMID = 1,
+
+ /* Treat ARG as `struct link_map **';
+ store the `struct link_map *' for HANDLE there. */
+ RTLD_DI_LINKMAP = 2,
+
+ RTLD_DI_CONFIGADDR = 3, /* Unsupported, defined by Solaris. */
+
+ /* Treat ARG as `Dl_serinfo *' (see below), and fill in to describe the
+ directories that will be searched for dependencies of this object.
+ RTLD_DI_SERINFOSIZE fills in just the `dls_cnt' and `dls_size'
+ entries to indicate the size of the buffer that must be passed to
+ RTLD_DI_SERINFO to fill in the full information. */
+ RTLD_DI_SERINFO = 4,
+ RTLD_DI_SERINFOSIZE = 5,
+
+ /* Treat ARG as `char *', and store there the directory name used to
+ expand $ORIGIN in this shared object's dependency file names. */
+ RTLD_DI_ORIGIN = 6,
+
+ RTLD_DI_PROFILENAME = 7, /* Unsupported, defined by Solaris. */
+ RTLD_DI_PROFILEOUT = 8, /* Unsupported, defined by Solaris. */
+
+ /* Treat ARG as `size_t *', and store there the TLS module ID
+ of this object's PT_TLS segment, as used in TLS relocations;
+ store zero if this object does not define a PT_TLS segment. */
+ RTLD_DI_TLS_MODID = 9,
+
+ /* Treat ARG as `void **', and store there a pointer to the calling
+ thread's TLS block corresponding to this object's PT_TLS segment.
+ Store a null pointer if this object does not define a PT_TLS
+ segment, or if the calling thread has not allocated a block for it. */
+ RTLD_DI_TLS_DATA = 10,
+
+ RTLD_DI_MAX = 10,
+ };
+
+
+/* This is the type of elements in `Dl_serinfo', below.
+ The `dls_name' member points to space in the buffer passed to `dlinfo'. */
+typedef struct
+{
+ char *dls_name; /* Name of library search path directory. */
+ unsigned int dls_flags; /* Indicates where this directory came from. */
+} Dl_serpath;
+
+/* This is the structure that must be passed (by reference) to `dlinfo' for
+ the RTLD_DI_SERINFO and RTLD_DI_SERINFOSIZE requests. */
+typedef struct
+{
+ size_t dls_size; /* Size in bytes of the whole buffer. */
+ unsigned int dls_cnt; /* Number of elements in `dls_serpath'. */
+ Dl_serpath dls_serpath[1]; /* Actually longer, dls_cnt elements. */
+} Dl_serinfo;
+#endif /* __USE_GNU */
+
+
+__END_DECLS
+
+#endif /* dlfcn.h */
diff --git a/sysroot/usr/include/elf.h b/sysroot/usr/include/elf.h
new file mode 100644
index 0000000..b02636c
--- /dev/null
+++ b/sysroot/usr/include/elf.h
@@ -0,0 +1,2646 @@
+/* This file defines standard ELF types, structures, and macros.
+ Copyright (C) 1995-2003,2004,2005,2006,2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _ELF_H
+#define _ELF_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Standard ELF types. */
+
+#include <stdint.h>
+
+/* Type for a 16-bit quantity. */
+typedef uint16_t Elf32_Half;
+typedef uint16_t Elf64_Half;
+
+/* Types for signed and unsigned 32-bit quantities. */
+typedef uint32_t Elf32_Word;
+typedef int32_t Elf32_Sword;
+typedef uint32_t Elf64_Word;
+typedef int32_t Elf64_Sword;
+
+/* Types for signed and unsigned 64-bit quantities. */
+typedef uint64_t Elf32_Xword;
+typedef int64_t Elf32_Sxword;
+typedef uint64_t Elf64_Xword;
+typedef int64_t Elf64_Sxword;
+
+/* Type of addresses. */
+typedef uint32_t Elf32_Addr;
+typedef uint64_t Elf64_Addr;
+
+/* Type of file offsets. */
+typedef uint32_t Elf32_Off;
+typedef uint64_t Elf64_Off;
+
+/* Type for section indices, which are 16-bit quantities. */
+typedef uint16_t Elf32_Section;
+typedef uint16_t Elf64_Section;
+
+/* Type for version symbol information. */
+typedef Elf32_Half Elf32_Versym;
+typedef Elf64_Half Elf64_Versym;
+
+
+/* The ELF file header. This appears at the start of every ELF file. */
+
+#define EI_NIDENT (16)
+
+typedef struct
+{
+ unsigned char e_ident[EI_NIDENT]; /* Magic number and other info */
+ Elf32_Half e_type; /* Object file type */
+ Elf32_Half e_machine; /* Architecture */
+ Elf32_Word e_version; /* Object file version */
+ Elf32_Addr e_entry; /* Entry point virtual address */
+ Elf32_Off e_phoff; /* Program header table file offset */
+ Elf32_Off e_shoff; /* Section header table file offset */
+ Elf32_Word e_flags; /* Processor-specific flags */
+ Elf32_Half e_ehsize; /* ELF header size in bytes */
+ Elf32_Half e_phentsize; /* Program header table entry size */
+ Elf32_Half e_phnum; /* Program header table entry count */
+ Elf32_Half e_shentsize; /* Section header table entry size */
+ Elf32_Half e_shnum; /* Section header table entry count */
+ Elf32_Half e_shstrndx; /* Section header string table index */
+} Elf32_Ehdr;
+
+typedef struct
+{
+ unsigned char e_ident[EI_NIDENT]; /* Magic number and other info */
+ Elf64_Half e_type; /* Object file type */
+ Elf64_Half e_machine; /* Architecture */
+ Elf64_Word e_version; /* Object file version */
+ Elf64_Addr e_entry; /* Entry point virtual address */
+ Elf64_Off e_phoff; /* Program header table file offset */
+ Elf64_Off e_shoff; /* Section header table file offset */
+ Elf64_Word e_flags; /* Processor-specific flags */
+ Elf64_Half e_ehsize; /* ELF header size in bytes */
+ Elf64_Half e_phentsize; /* Program header table entry size */
+ Elf64_Half e_phnum; /* Program header table entry count */
+ Elf64_Half e_shentsize; /* Section header table entry size */
+ Elf64_Half e_shnum; /* Section header table entry count */
+ Elf64_Half e_shstrndx; /* Section header string table index */
+} Elf64_Ehdr;
+
+/* Fields in the e_ident array. The EI_* macros are indices into the
+ array. The macros under each EI_* macro are the values the byte
+ may have. */
+
+#define EI_MAG0 0 /* File identification byte 0 index */
+#define ELFMAG0 0x7f /* Magic number byte 0 */
+
+#define EI_MAG1 1 /* File identification byte 1 index */
+#define ELFMAG1 'E' /* Magic number byte 1 */
+
+#define EI_MAG2 2 /* File identification byte 2 index */
+#define ELFMAG2 'L' /* Magic number byte 2 */
+
+#define EI_MAG3 3 /* File identification byte 3 index */
+#define ELFMAG3 'F' /* Magic number byte 3 */
+
+/* Conglomeration of the identification bytes, for easy testing as a word. */
+#define ELFMAG "\177ELF"
+#define SELFMAG 4
+
+#define EI_CLASS 4 /* File class byte index */
+#define ELFCLASSNONE 0 /* Invalid class */
+#define ELFCLASS32 1 /* 32-bit objects */
+#define ELFCLASS64 2 /* 64-bit objects */
+#define ELFCLASSNUM 3
+
+#define EI_DATA 5 /* Data encoding byte index */
+#define ELFDATANONE 0 /* Invalid data encoding */
+#define ELFDATA2LSB 1 /* 2's complement, little endian */
+#define ELFDATA2MSB 2 /* 2's complement, big endian */
+#define ELFDATANUM 3
+
+#define EI_VERSION 6 /* File version byte index */
+ /* Value must be EV_CURRENT */
+
+#define EI_OSABI 7 /* OS ABI identification */
+#define ELFOSABI_NONE 0 /* UNIX System V ABI */
+#define ELFOSABI_SYSV 0 /* Alias. */
+#define ELFOSABI_HPUX 1 /* HP-UX */
+#define ELFOSABI_NETBSD 2 /* NetBSD. */
+#define ELFOSABI_LINUX 3 /* Linux. */
+#define ELFOSABI_SOLARIS 6 /* Sun Solaris. */
+#define ELFOSABI_AIX 7 /* IBM AIX. */
+#define ELFOSABI_IRIX 8 /* SGI Irix. */
+#define ELFOSABI_FREEBSD 9 /* FreeBSD. */
+#define ELFOSABI_TRU64 10 /* Compaq TRU64 UNIX. */
+#define ELFOSABI_MODESTO 11 /* Novell Modesto. */
+#define ELFOSABI_OPENBSD 12 /* OpenBSD. */
+#define ELFOSABI_ARM 97 /* ARM */
+#define ELFOSABI_STANDALONE 255 /* Standalone (embedded) application */
+
+#define EI_ABIVERSION 8 /* ABI version */
+
+#define EI_PAD 9 /* Byte index of padding bytes */
+
+/* Legal values for e_type (object file type). */
+
+#define ET_NONE 0 /* No file type */
+#define ET_REL 1 /* Relocatable file */
+#define ET_EXEC 2 /* Executable file */
+#define ET_DYN 3 /* Shared object file */
+#define ET_CORE 4 /* Core file */
+#define ET_NUM 5 /* Number of defined types */
+#define ET_LOOS 0xfe00 /* OS-specific range start */
+#define ET_HIOS 0xfeff /* OS-specific range end */
+#define ET_LOPROC 0xff00 /* Processor-specific range start */
+#define ET_HIPROC 0xffff /* Processor-specific range end */
+
+/* Legal values for e_machine (architecture). */
+
+#define EM_NONE 0 /* No machine */
+#define EM_M32 1 /* AT&T WE 32100 */
+#define EM_SPARC 2 /* SUN SPARC */
+#define EM_386 3 /* Intel 80386 */
+#define EM_68K 4 /* Motorola m68k family */
+#define EM_88K 5 /* Motorola m88k family */
+#define EM_860 7 /* Intel 80860 */
+#define EM_MIPS 8 /* MIPS R3000 big-endian */
+#define EM_S370 9 /* IBM System/370 */
+#define EM_MIPS_RS3_LE 10 /* MIPS R3000 little-endian */
+
+#define EM_PARISC 15 /* HPPA */
+#define EM_VPP500 17 /* Fujitsu VPP500 */
+#define EM_SPARC32PLUS 18 /* Sun's "v8plus" */
+#define EM_960 19 /* Intel 80960 */
+#define EM_PPC 20 /* PowerPC */
+#define EM_PPC64 21 /* PowerPC 64-bit */
+#define EM_S390 22 /* IBM S390 */
+
+#define EM_V800 36 /* NEC V800 series */
+#define EM_FR20 37 /* Fujitsu FR20 */
+#define EM_RH32 38 /* TRW RH-32 */
+#define EM_RCE 39 /* Motorola RCE */
+#define EM_ARM 40 /* ARM */
+#define EM_FAKE_ALPHA 41 /* Digital Alpha */
+#define EM_SH 42 /* Hitachi SH */
+#define EM_SPARCV9 43 /* SPARC v9 64-bit */
+#define EM_TRICORE 44 /* Siemens Tricore */
+#define EM_ARC 45 /* Argonaut RISC Core */
+#define EM_H8_300 46 /* Hitachi H8/300 */
+#define EM_H8_300H 47 /* Hitachi H8/300H */
+#define EM_H8S 48 /* Hitachi H8S */
+#define EM_H8_500 49 /* Hitachi H8/500 */
+#define EM_IA_64 50 /* Intel Merced */
+#define EM_MIPS_X 51 /* Stanford MIPS-X */
+#define EM_COLDFIRE 52 /* Motorola Coldfire */
+#define EM_68HC12 53 /* Motorola M68HC12 */
+#define EM_MMA 54 /* Fujitsu MMA Multimedia Accelerator*/
+#define EM_PCP 55 /* Siemens PCP */
+#define EM_NCPU 56 /* Sony nCPU embeeded RISC */
+#define EM_NDR1 57 /* Denso NDR1 microprocessor */
+#define EM_STARCORE 58 /* Motorola Start*Core processor */
+#define EM_ME16 59 /* Toyota ME16 processor */
+#define EM_ST100 60 /* STMicroelectronic ST100 processor */
+#define EM_TINYJ 61 /* Advanced Logic Corp. Tinyj emb.fam*/
+#define EM_X86_64 62 /* AMD x86-64 architecture */
+#define EM_PDSP 63 /* Sony DSP Processor */
+
+#define EM_FX66 66 /* Siemens FX66 microcontroller */
+#define EM_ST9PLUS 67 /* STMicroelectronics ST9+ 8/16 mc */
+#define EM_ST7 68 /* STmicroelectronics ST7 8 bit mc */
+#define EM_68HC16 69 /* Motorola MC68HC16 microcontroller */
+#define EM_68HC11 70 /* Motorola MC68HC11 microcontroller */
+#define EM_68HC08 71 /* Motorola MC68HC08 microcontroller */
+#define EM_68HC05 72 /* Motorola MC68HC05 microcontroller */
+#define EM_SVX 73 /* Silicon Graphics SVx */
+#define EM_ST19 74 /* STMicroelectronics ST19 8 bit mc */
+#define EM_VAX 75 /* Digital VAX */
+#define EM_CRIS 76 /* Axis Communications 32-bit embedded processor */
+#define EM_JAVELIN 77 /* Infineon Technologies 32-bit embedded processor */
+#define EM_FIREPATH 78 /* Element 14 64-bit DSP Processor */
+#define EM_ZSP 79 /* LSI Logic 16-bit DSP Processor */
+#define EM_MMIX 80 /* Donald Knuth's educational 64-bit processor */
+#define EM_HUANY 81 /* Harvard University machine-independent object files */
+#define EM_PRISM 82 /* SiTera Prism */
+#define EM_AVR 83 /* Atmel AVR 8-bit microcontroller */
+#define EM_FR30 84 /* Fujitsu FR30 */
+#define EM_D10V 85 /* Mitsubishi D10V */
+#define EM_D30V 86 /* Mitsubishi D30V */
+#define EM_V850 87 /* NEC v850 */
+#define EM_M32R 88 /* Mitsubishi M32R */
+#define EM_MN10300 89 /* Matsushita MN10300 */
+#define EM_MN10200 90 /* Matsushita MN10200 */
+#define EM_PJ 91 /* picoJava */
+#define EM_OPENRISC 92 /* OpenRISC 32-bit embedded processor */
+#define EM_ARC_A5 93 /* ARC Cores Tangent-A5 */
+#define EM_XTENSA 94 /* Tensilica Xtensa Architecture */
+#define EM_NUM 95
+
+/* If it is necessary to assign new unofficial EM_* values, please
+ pick large random numbers (0x8523, 0xa7f2, etc.) to minimize the
+ chances of collision with official or non-GNU unofficial values. */
+
+#define EM_ALPHA 0x9026
+
+/* Legal values for e_version (version). */
+
+#define EV_NONE 0 /* Invalid ELF version */
+#define EV_CURRENT 1 /* Current version */
+#define EV_NUM 2
+
+/* Section header. */
+
+typedef struct
+{
+ Elf32_Word sh_name; /* Section name (string tbl index) */
+ Elf32_Word sh_type; /* Section type */
+ Elf32_Word sh_flags; /* Section flags */
+ Elf32_Addr sh_addr; /* Section virtual addr at execution */
+ Elf32_Off sh_offset; /* Section file offset */
+ Elf32_Word sh_size; /* Section size in bytes */
+ Elf32_Word sh_link; /* Link to another section */
+ Elf32_Word sh_info; /* Additional section information */
+ Elf32_Word sh_addralign; /* Section alignment */
+ Elf32_Word sh_entsize; /* Entry size if section holds table */
+} Elf32_Shdr;
+
+typedef struct
+{
+ Elf64_Word sh_name; /* Section name (string tbl index) */
+ Elf64_Word sh_type; /* Section type */
+ Elf64_Xword sh_flags; /* Section flags */
+ Elf64_Addr sh_addr; /* Section virtual addr at execution */
+ Elf64_Off sh_offset; /* Section file offset */
+ Elf64_Xword sh_size; /* Section size in bytes */
+ Elf64_Word sh_link; /* Link to another section */
+ Elf64_Word sh_info; /* Additional section information */
+ Elf64_Xword sh_addralign; /* Section alignment */
+ Elf64_Xword sh_entsize; /* Entry size if section holds table */
+} Elf64_Shdr;
+
+/* Special section indices. */
+
+#define SHN_UNDEF 0 /* Undefined section */
+#define SHN_LORESERVE 0xff00 /* Start of reserved indices */
+#define SHN_LOPROC 0xff00 /* Start of processor-specific */
+#define SHN_BEFORE 0xff00 /* Order section before all others
+ (Solaris). */
+#define SHN_AFTER 0xff01 /* Order section after all others
+ (Solaris). */
+#define SHN_HIPROC 0xff1f /* End of processor-specific */
+#define SHN_LOOS 0xff20 /* Start of OS-specific */
+#define SHN_HIOS 0xff3f /* End of OS-specific */
+#define SHN_ABS 0xfff1 /* Associated symbol is absolute */
+#define SHN_COMMON 0xfff2 /* Associated symbol is common */
+#define SHN_XINDEX 0xffff /* Index is in extra table. */
+#define SHN_HIRESERVE 0xffff /* End of reserved indices */
+
+/* Legal values for sh_type (section type). */
+
+#define SHT_NULL 0 /* Section header table entry unused */
+#define SHT_PROGBITS 1 /* Program data */
+#define SHT_SYMTAB 2 /* Symbol table */
+#define SHT_STRTAB 3 /* String table */
+#define SHT_RELA 4 /* Relocation entries with addends */
+#define SHT_HASH 5 /* Symbol hash table */
+#define SHT_DYNAMIC 6 /* Dynamic linking information */
+#define SHT_NOTE 7 /* Notes */
+#define SHT_NOBITS 8 /* Program space with no data (bss) */
+#define SHT_REL 9 /* Relocation entries, no addends */
+#define SHT_SHLIB 10 /* Reserved */
+#define SHT_DYNSYM 11 /* Dynamic linker symbol table */
+#define SHT_INIT_ARRAY 14 /* Array of constructors */
+#define SHT_FINI_ARRAY 15 /* Array of destructors */
+#define SHT_PREINIT_ARRAY 16 /* Array of pre-constructors */
+#define SHT_GROUP 17 /* Section group */
+#define SHT_SYMTAB_SHNDX 18 /* Extended section indeces */
+#define SHT_NUM 19 /* Number of defined types. */
+#define SHT_LOOS 0x60000000 /* Start OS-specific. */
+#define SHT_GNU_HASH 0x6ffffff6 /* GNU-style hash table. */
+#define SHT_GNU_LIBLIST 0x6ffffff7 /* Prelink library list */
+#define SHT_CHECKSUM 0x6ffffff8 /* Checksum for DSO content. */
+#define SHT_LOSUNW 0x6ffffffa /* Sun-specific low bound. */
+#define SHT_SUNW_move 0x6ffffffa
+#define SHT_SUNW_COMDAT 0x6ffffffb
+#define SHT_SUNW_syminfo 0x6ffffffc
+#define SHT_GNU_verdef 0x6ffffffd /* Version definition section. */
+#define SHT_GNU_verneed 0x6ffffffe /* Version needs section. */
+#define SHT_GNU_versym 0x6fffffff /* Version symbol table. */
+#define SHT_HISUNW 0x6fffffff /* Sun-specific high bound. */
+#define SHT_HIOS 0x6fffffff /* End OS-specific type */
+#define SHT_LOPROC 0x70000000 /* Start of processor-specific */
+#define SHT_HIPROC 0x7fffffff /* End of processor-specific */
+#define SHT_LOUSER 0x80000000 /* Start of application-specific */
+#define SHT_HIUSER 0x8fffffff /* End of application-specific */
+
+/* Legal values for sh_flags (section flags). */
+
+#define SHF_WRITE (1 << 0) /* Writable */
+#define SHF_ALLOC (1 << 1) /* Occupies memory during execution */
+#define SHF_EXECINSTR (1 << 2) /* Executable */
+#define SHF_MERGE (1 << 4) /* Might be merged */
+#define SHF_STRINGS (1 << 5) /* Contains nul-terminated strings */
+#define SHF_INFO_LINK (1 << 6) /* `sh_info' contains SHT index */
+#define SHF_LINK_ORDER (1 << 7) /* Preserve order after combining */
+#define SHF_OS_NONCONFORMING (1 << 8) /* Non-standard OS specific handling
+ required */
+#define SHF_GROUP (1 << 9) /* Section is member of a group. */
+#define SHF_TLS (1 << 10) /* Section hold thread-local data. */
+#define SHF_MASKOS 0x0ff00000 /* OS-specific. */
+#define SHF_MASKPROC 0xf0000000 /* Processor-specific */
+#define SHF_ORDERED (1 << 30) /* Special ordering requirement
+ (Solaris). */
+#define SHF_EXCLUDE (1 << 31) /* Section is excluded unless
+ referenced or allocated (Solaris).*/
+
+/* Section group handling. */
+#define GRP_COMDAT 0x1 /* Mark group as COMDAT. */
+
+/* Symbol table entry. */
+
+typedef struct
+{
+ Elf32_Word st_name; /* Symbol name (string tbl index) */
+ Elf32_Addr st_value; /* Symbol value */
+ Elf32_Word st_size; /* Symbol size */
+ unsigned char st_info; /* Symbol type and binding */
+ unsigned char st_other; /* Symbol visibility */
+ Elf32_Section st_shndx; /* Section index */
+} Elf32_Sym;
+
+typedef struct
+{
+ Elf64_Word st_name; /* Symbol name (string tbl index) */
+ unsigned char st_info; /* Symbol type and binding */
+ unsigned char st_other; /* Symbol visibility */
+ Elf64_Section st_shndx; /* Section index */
+ Elf64_Addr st_value; /* Symbol value */
+ Elf64_Xword st_size; /* Symbol size */
+} Elf64_Sym;
+
+/* The syminfo section if available contains additional information about
+ every dynamic symbol. */
+
+typedef struct
+{
+ Elf32_Half si_boundto; /* Direct bindings, symbol bound to */
+ Elf32_Half si_flags; /* Per symbol flags */
+} Elf32_Syminfo;
+
+typedef struct
+{
+ Elf64_Half si_boundto; /* Direct bindings, symbol bound to */
+ Elf64_Half si_flags; /* Per symbol flags */
+} Elf64_Syminfo;
+
+/* Possible values for si_boundto. */
+#define SYMINFO_BT_SELF 0xffff /* Symbol bound to self */
+#define SYMINFO_BT_PARENT 0xfffe /* Symbol bound to parent */
+#define SYMINFO_BT_LOWRESERVE 0xff00 /* Beginning of reserved entries */
+
+/* Possible bitmasks for si_flags. */
+#define SYMINFO_FLG_DIRECT 0x0001 /* Direct bound symbol */
+#define SYMINFO_FLG_PASSTHRU 0x0002 /* Pass-thru symbol for translator */
+#define SYMINFO_FLG_COPY 0x0004 /* Symbol is a copy-reloc */
+#define SYMINFO_FLG_LAZYLOAD 0x0008 /* Symbol bound to object to be lazy
+ loaded */
+/* Syminfo version values. */
+#define SYMINFO_NONE 0
+#define SYMINFO_CURRENT 1
+#define SYMINFO_NUM 2
+
+
+/* How to extract and insert information held in the st_info field. */
+
+#define ELF32_ST_BIND(val) (((unsigned char) (val)) >> 4)
+#define ELF32_ST_TYPE(val) ((val) & 0xf)
+#define ELF32_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf))
+
+/* Both Elf32_Sym and Elf64_Sym use the same one-byte st_info field. */
+#define ELF64_ST_BIND(val) ELF32_ST_BIND (val)
+#define ELF64_ST_TYPE(val) ELF32_ST_TYPE (val)
+#define ELF64_ST_INFO(bind, type) ELF32_ST_INFO ((bind), (type))
+
+/* Legal values for ST_BIND subfield of st_info (symbol binding). */
+
+#define STB_LOCAL 0 /* Local symbol */
+#define STB_GLOBAL 1 /* Global symbol */
+#define STB_WEAK 2 /* Weak symbol */
+#define STB_NUM 3 /* Number of defined types. */
+#define STB_LOOS 10 /* Start of OS-specific */
+#define STB_HIOS 12 /* End of OS-specific */
+#define STB_LOPROC 13 /* Start of processor-specific */
+#define STB_HIPROC 15 /* End of processor-specific */
+
+/* Legal values for ST_TYPE subfield of st_info (symbol type). */
+
+#define STT_NOTYPE 0 /* Symbol type is unspecified */
+#define STT_OBJECT 1 /* Symbol is a data object */
+#define STT_FUNC 2 /* Symbol is a code object */
+#define STT_SECTION 3 /* Symbol associated with a section */
+#define STT_FILE 4 /* Symbol's name is file name */
+#define STT_COMMON 5 /* Symbol is a common data object */
+#define STT_TLS 6 /* Symbol is thread-local data object*/
+#define STT_NUM 7 /* Number of defined types. */
+#define STT_LOOS 10 /* Start of OS-specific */
+#define STT_HIOS 12 /* End of OS-specific */
+#define STT_LOPROC 13 /* Start of processor-specific */
+#define STT_HIPROC 15 /* End of processor-specific */
+
+
+/* Symbol table indices are found in the hash buckets and chain table
+ of a symbol hash table section. This special index value indicates
+ the end of a chain, meaning no further symbols are found in that bucket. */
+
+#define STN_UNDEF 0 /* End of a chain. */
+
+
+/* How to extract and insert information held in the st_other field. */
+
+#define ELF32_ST_VISIBILITY(o) ((o) & 0x03)
+
+/* For ELF64 the definitions are the same. */
+#define ELF64_ST_VISIBILITY(o) ELF32_ST_VISIBILITY (o)
+
+/* Symbol visibility specification encoded in the st_other field. */
+#define STV_DEFAULT 0 /* Default symbol visibility rules */
+#define STV_INTERNAL 1 /* Processor specific hidden class */
+#define STV_HIDDEN 2 /* Sym unavailable in other modules */
+#define STV_PROTECTED 3 /* Not preemptible, not exported */
+
+
+/* Relocation table entry without addend (in section of type SHT_REL). */
+
+typedef struct
+{
+ Elf32_Addr r_offset; /* Address */
+ Elf32_Word r_info; /* Relocation type and symbol index */
+} Elf32_Rel;
+
+/* I have seen two different definitions of the Elf64_Rel and
+ Elf64_Rela structures, so we'll leave them out until Novell (or
+ whoever) gets their act together. */
+/* The following, at least, is used on Sparc v9, MIPS, and Alpha. */
+
+typedef struct
+{
+ Elf64_Addr r_offset; /* Address */
+ Elf64_Xword r_info; /* Relocation type and symbol index */
+} Elf64_Rel;
+
+/* Relocation table entry with addend (in section of type SHT_RELA). */
+
+typedef struct
+{
+ Elf32_Addr r_offset; /* Address */
+ Elf32_Word r_info; /* Relocation type and symbol index */
+ Elf32_Sword r_addend; /* Addend */
+} Elf32_Rela;
+
+typedef struct
+{
+ Elf64_Addr r_offset; /* Address */
+ Elf64_Xword r_info; /* Relocation type and symbol index */
+ Elf64_Sxword r_addend; /* Addend */
+} Elf64_Rela;
+
+/* How to extract and insert information held in the r_info field. */
+
+#define ELF32_R_SYM(val) ((val) >> 8)
+#define ELF32_R_TYPE(val) ((val) & 0xff)
+#define ELF32_R_INFO(sym, type) (((sym) << 8) + ((type) & 0xff))
+
+#define ELF64_R_SYM(i) ((i) >> 32)
+#define ELF64_R_TYPE(i) ((i) & 0xffffffff)
+#define ELF64_R_INFO(sym,type) ((((Elf64_Xword) (sym)) << 32) + (type))
+
+/* Program segment header. */
+
+typedef struct
+{
+ Elf32_Word p_type; /* Segment type */
+ Elf32_Off p_offset; /* Segment file offset */
+ Elf32_Addr p_vaddr; /* Segment virtual address */
+ Elf32_Addr p_paddr; /* Segment physical address */
+ Elf32_Word p_filesz; /* Segment size in file */
+ Elf32_Word p_memsz; /* Segment size in memory */
+ Elf32_Word p_flags; /* Segment flags */
+ Elf32_Word p_align; /* Segment alignment */
+} Elf32_Phdr;
+
+typedef struct
+{
+ Elf64_Word p_type; /* Segment type */
+ Elf64_Word p_flags; /* Segment flags */
+ Elf64_Off p_offset; /* Segment file offset */
+ Elf64_Addr p_vaddr; /* Segment virtual address */
+ Elf64_Addr p_paddr; /* Segment physical address */
+ Elf64_Xword p_filesz; /* Segment size in file */
+ Elf64_Xword p_memsz; /* Segment size in memory */
+ Elf64_Xword p_align; /* Segment alignment */
+} Elf64_Phdr;
+
+/* Legal values for p_type (segment type). */
+
+#define PT_NULL 0 /* Program header table entry unused */
+#define PT_LOAD 1 /* Loadable program segment */
+#define PT_DYNAMIC 2 /* Dynamic linking information */
+#define PT_INTERP 3 /* Program interpreter */
+#define PT_NOTE 4 /* Auxiliary information */
+#define PT_SHLIB 5 /* Reserved */
+#define PT_PHDR 6 /* Entry for header table itself */
+#define PT_TLS 7 /* Thread-local storage segment */
+#define PT_NUM 8 /* Number of defined types */
+#define PT_LOOS 0x60000000 /* Start of OS-specific */
+#define PT_GNU_EH_FRAME 0x6474e550 /* GCC .eh_frame_hdr segment */
+#define PT_GNU_STACK 0x6474e551 /* Indicates stack executability */
+#define PT_GNU_RELRO 0x6474e552 /* Read-only after relocation */
+#define PT_LOSUNW 0x6ffffffa
+#define PT_SUNWBSS 0x6ffffffa /* Sun Specific segment */
+#define PT_SUNWSTACK 0x6ffffffb /* Stack segment */
+#define PT_HISUNW 0x6fffffff
+#define PT_HIOS 0x6fffffff /* End of OS-specific */
+#define PT_LOPROC 0x70000000 /* Start of processor-specific */
+#define PT_HIPROC 0x7fffffff /* End of processor-specific */
+
+/* Legal values for p_flags (segment flags). */
+
+#define PF_X (1 << 0) /* Segment is executable */
+#define PF_W (1 << 1) /* Segment is writable */
+#define PF_R (1 << 2) /* Segment is readable */
+#define PF_MASKOS 0x0ff00000 /* OS-specific */
+#define PF_MASKPROC 0xf0000000 /* Processor-specific */
+
+/* Legal values for note segment descriptor types for core files. */
+
+#define NT_PRSTATUS 1 /* Contains copy of prstatus struct */
+#define NT_FPREGSET 2 /* Contains copy of fpregset struct */
+#define NT_PRPSINFO 3 /* Contains copy of prpsinfo struct */
+#define NT_PRXREG 4 /* Contains copy of prxregset struct */
+#define NT_TASKSTRUCT 4 /* Contains copy of task structure */
+#define NT_PLATFORM 5 /* String from sysinfo(SI_PLATFORM) */
+#define NT_AUXV 6 /* Contains copy of auxv array */
+#define NT_GWINDOWS 7 /* Contains copy of gwindows struct */
+#define NT_ASRS 8 /* Contains copy of asrset struct */
+#define NT_PSTATUS 10 /* Contains copy of pstatus struct */
+#define NT_PSINFO 13 /* Contains copy of psinfo struct */
+#define NT_PRCRED 14 /* Contains copy of prcred struct */
+#define NT_UTSNAME 15 /* Contains copy of utsname struct */
+#define NT_LWPSTATUS 16 /* Contains copy of lwpstatus struct */
+#define NT_LWPSINFO 17 /* Contains copy of lwpinfo struct */
+#define NT_PRFPXREG 20 /* Contains copy of fprxregset struct */
+#define NT_PRXFPREG 0x46e62b7f /* Contains copy of user_fxsr_struct */
+
+/* Legal values for the note segment descriptor types for object files. */
+
+#define NT_VERSION 1 /* Contains a version string. */
+
+
+/* Dynamic section entry. */
+
+typedef struct
+{
+ Elf32_Sword d_tag; /* Dynamic entry type */
+ union
+ {
+ Elf32_Word d_val; /* Integer value */
+ Elf32_Addr d_ptr; /* Address value */
+ } d_un;
+} Elf32_Dyn;
+
+typedef struct
+{
+ Elf64_Sxword d_tag; /* Dynamic entry type */
+ union
+ {
+ Elf64_Xword d_val; /* Integer value */
+ Elf64_Addr d_ptr; /* Address value */
+ } d_un;
+} Elf64_Dyn;
+
+/* Legal values for d_tag (dynamic entry type). */
+
+#define DT_NULL 0 /* Marks end of dynamic section */
+#define DT_NEEDED 1 /* Name of needed library */
+#define DT_PLTRELSZ 2 /* Size in bytes of PLT relocs */
+#define DT_PLTGOT 3 /* Processor defined value */
+#define DT_HASH 4 /* Address of symbol hash table */
+#define DT_STRTAB 5 /* Address of string table */
+#define DT_SYMTAB 6 /* Address of symbol table */
+#define DT_RELA 7 /* Address of Rela relocs */
+#define DT_RELASZ 8 /* Total size of Rela relocs */
+#define DT_RELAENT 9 /* Size of one Rela reloc */
+#define DT_STRSZ 10 /* Size of string table */
+#define DT_SYMENT 11 /* Size of one symbol table entry */
+#define DT_INIT 12 /* Address of init function */
+#define DT_FINI 13 /* Address of termination function */
+#define DT_SONAME 14 /* Name of shared object */
+#define DT_RPATH 15 /* Library search path (deprecated) */
+#define DT_SYMBOLIC 16 /* Start symbol search here */
+#define DT_REL 17 /* Address of Rel relocs */
+#define DT_RELSZ 18 /* Total size of Rel relocs */
+#define DT_RELENT 19 /* Size of one Rel reloc */
+#define DT_PLTREL 20 /* Type of reloc in PLT */
+#define DT_DEBUG 21 /* For debugging; unspecified */
+#define DT_TEXTREL 22 /* Reloc might modify .text */
+#define DT_JMPREL 23 /* Address of PLT relocs */
+#define DT_BIND_NOW 24 /* Process relocations of object */
+#define DT_INIT_ARRAY 25 /* Array with addresses of init fct */
+#define DT_FINI_ARRAY 26 /* Array with addresses of fini fct */
+#define DT_INIT_ARRAYSZ 27 /* Size in bytes of DT_INIT_ARRAY */
+#define DT_FINI_ARRAYSZ 28 /* Size in bytes of DT_FINI_ARRAY */
+#define DT_RUNPATH 29 /* Library search path */
+#define DT_FLAGS 30 /* Flags for the object being loaded */
+#define DT_ENCODING 32 /* Start of encoded range */
+#define DT_PREINIT_ARRAY 32 /* Array with addresses of preinit fct*/
+#define DT_PREINIT_ARRAYSZ 33 /* size in bytes of DT_PREINIT_ARRAY */
+#define DT_NUM 34 /* Number used */
+#define DT_LOOS 0x6000000d /* Start of OS-specific */
+#define DT_HIOS 0x6ffff000 /* End of OS-specific */
+#define DT_LOPROC 0x70000000 /* Start of processor-specific */
+#define DT_HIPROC 0x7fffffff /* End of processor-specific */
+#define DT_PROCNUM DT_MIPS_NUM /* Most used by any processor */
+
+/* DT_* entries which fall between DT_VALRNGHI & DT_VALRNGLO use the
+ Dyn.d_un.d_val field of the Elf*_Dyn structure. This follows Sun's
+ approach. */
+#define DT_VALRNGLO 0x6ffffd00
+#define DT_GNU_PRELINKED 0x6ffffdf5 /* Prelinking timestamp */
+#define DT_GNU_CONFLICTSZ 0x6ffffdf6 /* Size of conflict section */
+#define DT_GNU_LIBLISTSZ 0x6ffffdf7 /* Size of library list */
+#define DT_CHECKSUM 0x6ffffdf8
+#define DT_PLTPADSZ 0x6ffffdf9
+#define DT_MOVEENT 0x6ffffdfa
+#define DT_MOVESZ 0x6ffffdfb
+#define DT_FEATURE_1 0x6ffffdfc /* Feature selection (DTF_*). */
+#define DT_POSFLAG_1 0x6ffffdfd /* Flags for DT_* entries, effecting
+ the following DT_* entry. */
+#define DT_SYMINSZ 0x6ffffdfe /* Size of syminfo table (in bytes) */
+#define DT_SYMINENT 0x6ffffdff /* Entry size of syminfo */
+#define DT_VALRNGHI 0x6ffffdff
+#define DT_VALTAGIDX(tag) (DT_VALRNGHI - (tag)) /* Reverse order! */
+#define DT_VALNUM 12
+
+/* DT_* entries which fall between DT_ADDRRNGHI & DT_ADDRRNGLO use the
+ Dyn.d_un.d_ptr field of the Elf*_Dyn structure.
+
+ If any adjustment is made to the ELF object after it has been
+ built these entries will need to be adjusted. */
+#define DT_ADDRRNGLO 0x6ffffe00
+#define DT_GNU_HASH 0x6ffffef5 /* GNU-style hash table. */
+#define DT_TLSDESC_PLT 0x6ffffef6
+#define DT_TLSDESC_GOT 0x6ffffef7
+#define DT_GNU_CONFLICT 0x6ffffef8 /* Start of conflict section */
+#define DT_GNU_LIBLIST 0x6ffffef9 /* Library list */
+#define DT_CONFIG 0x6ffffefa /* Configuration information. */
+#define DT_DEPAUDIT 0x6ffffefb /* Dependency auditing. */
+#define DT_AUDIT 0x6ffffefc /* Object auditing. */
+#define DT_PLTPAD 0x6ffffefd /* PLT padding. */
+#define DT_MOVETAB 0x6ffffefe /* Move table. */
+#define DT_SYMINFO 0x6ffffeff /* Syminfo table. */
+#define DT_ADDRRNGHI 0x6ffffeff
+#define DT_ADDRTAGIDX(tag) (DT_ADDRRNGHI - (tag)) /* Reverse order! */
+#define DT_ADDRNUM 11
+
+/* The versioning entry types. The next are defined as part of the
+ GNU extension. */
+#define DT_VERSYM 0x6ffffff0
+
+#define DT_RELACOUNT 0x6ffffff9
+#define DT_RELCOUNT 0x6ffffffa
+
+/* These were chosen by Sun. */
+#define DT_FLAGS_1 0x6ffffffb /* State flags, see DF_1_* below. */
+#define DT_VERDEF 0x6ffffffc /* Address of version definition
+ table */
+#define DT_VERDEFNUM 0x6ffffffd /* Number of version definitions */
+#define DT_VERNEED 0x6ffffffe /* Address of table with needed
+ versions */
+#define DT_VERNEEDNUM 0x6fffffff /* Number of needed versions */
+#define DT_VERSIONTAGIDX(tag) (DT_VERNEEDNUM - (tag)) /* Reverse order! */
+#define DT_VERSIONTAGNUM 16
+
+/* Sun added these machine-independent extensions in the "processor-specific"
+ range. Be compatible. */
+#define DT_AUXILIARY 0x7ffffffd /* Shared object to load before self */
+#define DT_FILTER 0x7fffffff /* Shared object to get values from */
+#define DT_EXTRATAGIDX(tag) ((Elf32_Word)-((Elf32_Sword) (tag) <<1>>1)-1)
+#define DT_EXTRANUM 3
+
+/* Values of `d_un.d_val' in the DT_FLAGS entry. */
+#define DF_ORIGIN 0x00000001 /* Object may use DF_ORIGIN */
+#define DF_SYMBOLIC 0x00000002 /* Symbol resolutions starts here */
+#define DF_TEXTREL 0x00000004 /* Object contains text relocations */
+#define DF_BIND_NOW 0x00000008 /* No lazy binding for this object */
+#define DF_STATIC_TLS 0x00000010 /* Module uses the static TLS model */
+
+/* State flags selectable in the `d_un.d_val' element of the DT_FLAGS_1
+ entry in the dynamic section. */
+#define DF_1_NOW 0x00000001 /* Set RTLD_NOW for this object. */
+#define DF_1_GLOBAL 0x00000002 /* Set RTLD_GLOBAL for this object. */
+#define DF_1_GROUP 0x00000004 /* Set RTLD_GROUP for this object. */
+#define DF_1_NODELETE 0x00000008 /* Set RTLD_NODELETE for this object.*/
+#define DF_1_LOADFLTR 0x00000010 /* Trigger filtee loading at runtime.*/
+#define DF_1_INITFIRST 0x00000020 /* Set RTLD_INITFIRST for this object*/
+#define DF_1_NOOPEN 0x00000040 /* Set RTLD_NOOPEN for this object. */
+#define DF_1_ORIGIN 0x00000080 /* $ORIGIN must be handled. */
+#define DF_1_DIRECT 0x00000100 /* Direct binding enabled. */
+#define DF_1_TRANS 0x00000200
+#define DF_1_INTERPOSE 0x00000400 /* Object is used to interpose. */
+#define DF_1_NODEFLIB 0x00000800 /* Ignore default lib search path. */
+#define DF_1_NODUMP 0x00001000 /* Object can't be dldump'ed. */
+#define DF_1_CONFALT 0x00002000 /* Configuration alternative created.*/
+#define DF_1_ENDFILTEE 0x00004000 /* Filtee terminates filters search. */
+#define DF_1_DISPRELDNE 0x00008000 /* Disp reloc applied at build time. */
+#define DF_1_DISPRELPND 0x00010000 /* Disp reloc applied at run-time. */
+
+/* Flags for the feature selection in DT_FEATURE_1. */
+#define DTF_1_PARINIT 0x00000001
+#define DTF_1_CONFEXP 0x00000002
+
+/* Flags in the DT_POSFLAG_1 entry effecting only the next DT_* entry. */
+#define DF_P1_LAZYLOAD 0x00000001 /* Lazyload following object. */
+#define DF_P1_GROUPPERM 0x00000002 /* Symbols from next object are not
+ generally available. */
+
+/* Version definition sections. */
+
+typedef struct
+{
+ Elf32_Half vd_version; /* Version revision */
+ Elf32_Half vd_flags; /* Version information */
+ Elf32_Half vd_ndx; /* Version Index */
+ Elf32_Half vd_cnt; /* Number of associated aux entries */
+ Elf32_Word vd_hash; /* Version name hash value */
+ Elf32_Word vd_aux; /* Offset in bytes to verdaux array */
+ Elf32_Word vd_next; /* Offset in bytes to next verdef
+ entry */
+} Elf32_Verdef;
+
+typedef struct
+{
+ Elf64_Half vd_version; /* Version revision */
+ Elf64_Half vd_flags; /* Version information */
+ Elf64_Half vd_ndx; /* Version Index */
+ Elf64_Half vd_cnt; /* Number of associated aux entries */
+ Elf64_Word vd_hash; /* Version name hash value */
+ Elf64_Word vd_aux; /* Offset in bytes to verdaux array */
+ Elf64_Word vd_next; /* Offset in bytes to next verdef
+ entry */
+} Elf64_Verdef;
+
+
+/* Legal values for vd_version (version revision). */
+#define VER_DEF_NONE 0 /* No version */
+#define VER_DEF_CURRENT 1 /* Current version */
+#define VER_DEF_NUM 2 /* Given version number */
+
+/* Legal values for vd_flags (version information flags). */
+#define VER_FLG_BASE 0x1 /* Version definition of file itself */
+#define VER_FLG_WEAK 0x2 /* Weak version identifier */
+
+/* Versym symbol index values. */
+#define VER_NDX_LOCAL 0 /* Symbol is local. */
+#define VER_NDX_GLOBAL 1 /* Symbol is global. */
+#define VER_NDX_LORESERVE 0xff00 /* Beginning of reserved entries. */
+#define VER_NDX_ELIMINATE 0xff01 /* Symbol is to be eliminated. */
+
+/* Auxialiary version information. */
+
+typedef struct
+{
+ Elf32_Word vda_name; /* Version or dependency names */
+ Elf32_Word vda_next; /* Offset in bytes to next verdaux
+ entry */
+} Elf32_Verdaux;
+
+typedef struct
+{
+ Elf64_Word vda_name; /* Version or dependency names */
+ Elf64_Word vda_next; /* Offset in bytes to next verdaux
+ entry */
+} Elf64_Verdaux;
+
+
+/* Version dependency section. */
+
+typedef struct
+{
+ Elf32_Half vn_version; /* Version of structure */
+ Elf32_Half vn_cnt; /* Number of associated aux entries */
+ Elf32_Word vn_file; /* Offset of filename for this
+ dependency */
+ Elf32_Word vn_aux; /* Offset in bytes to vernaux array */
+ Elf32_Word vn_next; /* Offset in bytes to next verneed
+ entry */
+} Elf32_Verneed;
+
+typedef struct
+{
+ Elf64_Half vn_version; /* Version of structure */
+ Elf64_Half vn_cnt; /* Number of associated aux entries */
+ Elf64_Word vn_file; /* Offset of filename for this
+ dependency */
+ Elf64_Word vn_aux; /* Offset in bytes to vernaux array */
+ Elf64_Word vn_next; /* Offset in bytes to next verneed
+ entry */
+} Elf64_Verneed;
+
+
+/* Legal values for vn_version (version revision). */
+#define VER_NEED_NONE 0 /* No version */
+#define VER_NEED_CURRENT 1 /* Current version */
+#define VER_NEED_NUM 2 /* Given version number */
+
+/* Auxiliary needed version information. */
+
+typedef struct
+{
+ Elf32_Word vna_hash; /* Hash value of dependency name */
+ Elf32_Half vna_flags; /* Dependency specific information */
+ Elf32_Half vna_other; /* Unused */
+ Elf32_Word vna_name; /* Dependency name string offset */
+ Elf32_Word vna_next; /* Offset in bytes to next vernaux
+ entry */
+} Elf32_Vernaux;
+
+typedef struct
+{
+ Elf64_Word vna_hash; /* Hash value of dependency name */
+ Elf64_Half vna_flags; /* Dependency specific information */
+ Elf64_Half vna_other; /* Unused */
+ Elf64_Word vna_name; /* Dependency name string offset */
+ Elf64_Word vna_next; /* Offset in bytes to next vernaux
+ entry */
+} Elf64_Vernaux;
+
+
+/* Legal values for vna_flags. */
+#define VER_FLG_WEAK 0x2 /* Weak version identifier */
+
+
+/* Auxiliary vector. */
+
+/* This vector is normally only used by the program interpreter. The
+ usual definition in an ABI supplement uses the name auxv_t. The
+ vector is not usually defined in a standard <elf.h> file, but it
+ can't hurt. We rename it to avoid conflicts. The sizes of these
+ types are an arrangement between the exec server and the program
+ interpreter, so we don't fully specify them here. */
+
+typedef struct
+{
+ uint32_t a_type; /* Entry type */
+ union
+ {
+ uint32_t a_val; /* Integer value */
+ /* We use to have pointer elements added here. We cannot do that,
+ though, since it does not work when using 32-bit definitions
+ on 64-bit platforms and vice versa. */
+ } a_un;
+} Elf32_auxv_t;
+
+typedef struct
+{
+ uint64_t a_type; /* Entry type */
+ union
+ {
+ uint64_t a_val; /* Integer value */
+ /* We use to have pointer elements added here. We cannot do that,
+ though, since it does not work when using 32-bit definitions
+ on 64-bit platforms and vice versa. */
+ } a_un;
+} Elf64_auxv_t;
+
+/* Legal values for a_type (entry type). */
+
+#define AT_NULL 0 /* End of vector */
+#define AT_IGNORE 1 /* Entry should be ignored */
+#define AT_EXECFD 2 /* File descriptor of program */
+#define AT_PHDR 3 /* Program headers for program */
+#define AT_PHENT 4 /* Size of program header entry */
+#define AT_PHNUM 5 /* Number of program headers */
+#define AT_PAGESZ 6 /* System page size */
+#define AT_BASE 7 /* Base address of interpreter */
+#define AT_FLAGS 8 /* Flags */
+#define AT_ENTRY 9 /* Entry point of program */
+#define AT_NOTELF 10 /* Program is not ELF */
+#define AT_UID 11 /* Real uid */
+#define AT_EUID 12 /* Effective uid */
+#define AT_GID 13 /* Real gid */
+#define AT_EGID 14 /* Effective gid */
+#define AT_CLKTCK 17 /* Frequency of times() */
+
+/* Some more special a_type values describing the hardware. */
+#define AT_PLATFORM 15 /* String identifying platform. */
+#define AT_HWCAP 16 /* Machine dependent hints about
+ processor capabilities. */
+
+/* This entry gives some information about the FPU initialization
+ performed by the kernel. */
+#define AT_FPUCW 18 /* Used FPU control word. */
+
+/* Cache block sizes. */
+#define AT_DCACHEBSIZE 19 /* Data cache block size. */
+#define AT_ICACHEBSIZE 20 /* Instruction cache block size. */
+#define AT_UCACHEBSIZE 21 /* Unified cache block size. */
+
+/* A special ignored value for PPC, used by the kernel to control the
+ interpretation of the AUXV. Must be > 16. */
+#define AT_IGNOREPPC 22 /* Entry should be ignored. */
+
+#define AT_SECURE 23 /* Boolean, was exec setuid-like? */
+
+/* Pointer to the global system page used for system calls and other
+ nice things. */
+#define AT_SYSINFO 32
+#define AT_SYSINFO_EHDR 33
+
+/* Shapes of the caches. Bits 0-3 contains associativity; bits 4-7 contains
+ log2 of line size; mask those to get cache size. */
+#define AT_L1I_CACHESHAPE 34
+#define AT_L1D_CACHESHAPE 35
+#define AT_L2_CACHESHAPE 36
+#define AT_L3_CACHESHAPE 37
+
+/* Note section contents. Each entry in the note section begins with
+ a header of a fixed form. */
+
+typedef struct
+{
+ Elf32_Word n_namesz; /* Length of the note's name. */
+ Elf32_Word n_descsz; /* Length of the note's descriptor. */
+ Elf32_Word n_type; /* Type of the note. */
+} Elf32_Nhdr;
+
+typedef struct
+{
+ Elf64_Word n_namesz; /* Length of the note's name. */
+ Elf64_Word n_descsz; /* Length of the note's descriptor. */
+ Elf64_Word n_type; /* Type of the note. */
+} Elf64_Nhdr;
+
+/* Known names of notes. */
+
+/* Solaris entries in the note section have this name. */
+#define ELF_NOTE_SOLARIS "SUNW Solaris"
+
+/* Note entries for GNU systems have this name. */
+#define ELF_NOTE_GNU "GNU"
+
+
+/* Defined types of notes for Solaris. */
+
+/* Value of descriptor (one word) is desired pagesize for the binary. */
+#define ELF_NOTE_PAGESIZE_HINT 1
+
+
+/* Defined note types for GNU systems. */
+
+/* ABI information. The descriptor consists of words:
+ word 0: OS descriptor
+ word 1: major version of the ABI
+ word 2: minor version of the ABI
+ word 3: subminor version of the ABI
+*/
+#define NT_GNU_ABI_TAG 1
+#define ELF_NOTE_ABI NT_GNU_ABI_TAG /* Old name. */
+
+/* Known OSes. These values can appear in word 0 of an
+ NT_GNU_ABI_TAG note section entry. */
+#define ELF_NOTE_OS_LINUX 0
+#define ELF_NOTE_OS_GNU 1
+#define ELF_NOTE_OS_SOLARIS2 2
+#define ELF_NOTE_OS_FREEBSD 3
+
+/* Synthetic hwcap information. The descriptor begins with two words:
+ word 0: number of entries
+ word 1: bitmask of enabled entries
+ Then follow variable-length entries, one byte followed by a
+ '\0'-terminated hwcap name string. The byte gives the bit
+ number to test if enabled, (1U << bit) & bitmask. */
+#define NT_GNU_HWCAP 2
+
+/* Build ID bits as generated by ld --build-id.
+ The descriptor consists of any nonzero number of bytes. */
+#define NT_GNU_BUILD_ID 3
+
+
+/* Move records. */
+typedef struct
+{
+ Elf32_Xword m_value; /* Symbol value. */
+ Elf32_Word m_info; /* Size and index. */
+ Elf32_Word m_poffset; /* Symbol offset. */
+ Elf32_Half m_repeat; /* Repeat count. */
+ Elf32_Half m_stride; /* Stride info. */
+} Elf32_Move;
+
+typedef struct
+{
+ Elf64_Xword m_value; /* Symbol value. */
+ Elf64_Xword m_info; /* Size and index. */
+ Elf64_Xword m_poffset; /* Symbol offset. */
+ Elf64_Half m_repeat; /* Repeat count. */
+ Elf64_Half m_stride; /* Stride info. */
+} Elf64_Move;
+
+/* Macro to construct move records. */
+#define ELF32_M_SYM(info) ((info) >> 8)
+#define ELF32_M_SIZE(info) ((unsigned char) (info))
+#define ELF32_M_INFO(sym, size) (((sym) << 8) + (unsigned char) (size))
+
+#define ELF64_M_SYM(info) ELF32_M_SYM (info)
+#define ELF64_M_SIZE(info) ELF32_M_SIZE (info)
+#define ELF64_M_INFO(sym, size) ELF32_M_INFO (sym, size)
+
+
+/* Motorola 68k specific definitions. */
+
+/* Values for Elf32_Ehdr.e_flags. */
+#define EF_CPU32 0x00810000
+
+/* m68k relocs. */
+
+#define R_68K_NONE 0 /* No reloc */
+#define R_68K_32 1 /* Direct 32 bit */
+#define R_68K_16 2 /* Direct 16 bit */
+#define R_68K_8 3 /* Direct 8 bit */
+#define R_68K_PC32 4 /* PC relative 32 bit */
+#define R_68K_PC16 5 /* PC relative 16 bit */
+#define R_68K_PC8 6 /* PC relative 8 bit */
+#define R_68K_GOT32 7 /* 32 bit PC relative GOT entry */
+#define R_68K_GOT16 8 /* 16 bit PC relative GOT entry */
+#define R_68K_GOT8 9 /* 8 bit PC relative GOT entry */
+#define R_68K_GOT32O 10 /* 32 bit GOT offset */
+#define R_68K_GOT16O 11 /* 16 bit GOT offset */
+#define R_68K_GOT8O 12 /* 8 bit GOT offset */
+#define R_68K_PLT32 13 /* 32 bit PC relative PLT address */
+#define R_68K_PLT16 14 /* 16 bit PC relative PLT address */
+#define R_68K_PLT8 15 /* 8 bit PC relative PLT address */
+#define R_68K_PLT32O 16 /* 32 bit PLT offset */
+#define R_68K_PLT16O 17 /* 16 bit PLT offset */
+#define R_68K_PLT8O 18 /* 8 bit PLT offset */
+#define R_68K_COPY 19 /* Copy symbol at runtime */
+#define R_68K_GLOB_DAT 20 /* Create GOT entry */
+#define R_68K_JMP_SLOT 21 /* Create PLT entry */
+#define R_68K_RELATIVE 22 /* Adjust by program base */
+/* Keep this the last entry. */
+#define R_68K_NUM 23
+
+/* Intel 80386 specific definitions. */
+
+/* i386 relocs. */
+
+#define R_386_NONE 0 /* No reloc */
+#define R_386_32 1 /* Direct 32 bit */
+#define R_386_PC32 2 /* PC relative 32 bit */
+#define R_386_GOT32 3 /* 32 bit GOT entry */
+#define R_386_PLT32 4 /* 32 bit PLT address */
+#define R_386_COPY 5 /* Copy symbol at runtime */
+#define R_386_GLOB_DAT 6 /* Create GOT entry */
+#define R_386_JMP_SLOT 7 /* Create PLT entry */
+#define R_386_RELATIVE 8 /* Adjust by program base */
+#define R_386_GOTOFF 9 /* 32 bit offset to GOT */
+#define R_386_GOTPC 10 /* 32 bit PC relative offset to GOT */
+#define R_386_32PLT 11
+#define R_386_TLS_TPOFF 14 /* Offset in static TLS block */
+#define R_386_TLS_IE 15 /* Address of GOT entry for static TLS
+ block offset */
+#define R_386_TLS_GOTIE 16 /* GOT entry for static TLS block
+ offset */
+#define R_386_TLS_LE 17 /* Offset relative to static TLS
+ block */
+#define R_386_TLS_GD 18 /* Direct 32 bit for GNU version of
+ general dynamic thread local data */
+#define R_386_TLS_LDM 19 /* Direct 32 bit for GNU version of
+ local dynamic thread local data
+ in LE code */
+#define R_386_16 20
+#define R_386_PC16 21
+#define R_386_8 22
+#define R_386_PC8 23
+#define R_386_TLS_GD_32 24 /* Direct 32 bit for general dynamic
+ thread local data */
+#define R_386_TLS_GD_PUSH 25 /* Tag for pushl in GD TLS code */
+#define R_386_TLS_GD_CALL 26 /* Relocation for call to
+ __tls_get_addr() */
+#define R_386_TLS_GD_POP 27 /* Tag for popl in GD TLS code */
+#define R_386_TLS_LDM_32 28 /* Direct 32 bit for local dynamic
+ thread local data in LE code */
+#define R_386_TLS_LDM_PUSH 29 /* Tag for pushl in LDM TLS code */
+#define R_386_TLS_LDM_CALL 30 /* Relocation for call to
+ __tls_get_addr() in LDM code */
+#define R_386_TLS_LDM_POP 31 /* Tag for popl in LDM TLS code */
+#define R_386_TLS_LDO_32 32 /* Offset relative to TLS block */
+#define R_386_TLS_IE_32 33 /* GOT entry for negated static TLS
+ block offset */
+#define R_386_TLS_LE_32 34 /* Negated offset relative to static
+ TLS block */
+#define R_386_TLS_DTPMOD32 35 /* ID of module containing symbol */
+#define R_386_TLS_DTPOFF32 36 /* Offset in TLS block */
+#define R_386_TLS_TPOFF32 37 /* Negated offset in static TLS block */
+/* Keep this the last entry. */
+#define R_386_NUM 38
+
+/* SUN SPARC specific definitions. */
+
+/* Legal values for ST_TYPE subfield of st_info (symbol type). */
+
+#define STT_SPARC_REGISTER 13 /* Global register reserved to app. */
+
+/* Values for Elf64_Ehdr.e_flags. */
+
+#define EF_SPARCV9_MM 3
+#define EF_SPARCV9_TSO 0
+#define EF_SPARCV9_PSO 1
+#define EF_SPARCV9_RMO 2
+#define EF_SPARC_LEDATA 0x800000 /* little endian data */
+#define EF_SPARC_EXT_MASK 0xFFFF00
+#define EF_SPARC_32PLUS 0x000100 /* generic V8+ features */
+#define EF_SPARC_SUN_US1 0x000200 /* Sun UltraSPARC1 extensions */
+#define EF_SPARC_HAL_R1 0x000400 /* HAL R1 extensions */
+#define EF_SPARC_SUN_US3 0x000800 /* Sun UltraSPARCIII extensions */
+
+/* SPARC relocs. */
+
+#define R_SPARC_NONE 0 /* No reloc */
+#define R_SPARC_8 1 /* Direct 8 bit */
+#define R_SPARC_16 2 /* Direct 16 bit */
+#define R_SPARC_32 3 /* Direct 32 bit */
+#define R_SPARC_DISP8 4 /* PC relative 8 bit */
+#define R_SPARC_DISP16 5 /* PC relative 16 bit */
+#define R_SPARC_DISP32 6 /* PC relative 32 bit */
+#define R_SPARC_WDISP30 7 /* PC relative 30 bit shifted */
+#define R_SPARC_WDISP22 8 /* PC relative 22 bit shifted */
+#define R_SPARC_HI22 9 /* High 22 bit */
+#define R_SPARC_22 10 /* Direct 22 bit */
+#define R_SPARC_13 11 /* Direct 13 bit */
+#define R_SPARC_LO10 12 /* Truncated 10 bit */
+#define R_SPARC_GOT10 13 /* Truncated 10 bit GOT entry */
+#define R_SPARC_GOT13 14 /* 13 bit GOT entry */
+#define R_SPARC_GOT22 15 /* 22 bit GOT entry shifted */
+#define R_SPARC_PC10 16 /* PC relative 10 bit truncated */
+#define R_SPARC_PC22 17 /* PC relative 22 bit shifted */
+#define R_SPARC_WPLT30 18 /* 30 bit PC relative PLT address */
+#define R_SPARC_COPY 19 /* Copy symbol at runtime */
+#define R_SPARC_GLOB_DAT 20 /* Create GOT entry */
+#define R_SPARC_JMP_SLOT 21 /* Create PLT entry */
+#define R_SPARC_RELATIVE 22 /* Adjust by program base */
+#define R_SPARC_UA32 23 /* Direct 32 bit unaligned */
+
+/* Additional Sparc64 relocs. */
+
+#define R_SPARC_PLT32 24 /* Direct 32 bit ref to PLT entry */
+#define R_SPARC_HIPLT22 25 /* High 22 bit PLT entry */
+#define R_SPARC_LOPLT10 26 /* Truncated 10 bit PLT entry */
+#define R_SPARC_PCPLT32 27 /* PC rel 32 bit ref to PLT entry */
+#define R_SPARC_PCPLT22 28 /* PC rel high 22 bit PLT entry */
+#define R_SPARC_PCPLT10 29 /* PC rel trunc 10 bit PLT entry */
+#define R_SPARC_10 30 /* Direct 10 bit */
+#define R_SPARC_11 31 /* Direct 11 bit */
+#define R_SPARC_64 32 /* Direct 64 bit */
+#define R_SPARC_OLO10 33 /* 10bit with secondary 13bit addend */
+#define R_SPARC_HH22 34 /* Top 22 bits of direct 64 bit */
+#define R_SPARC_HM10 35 /* High middle 10 bits of ... */
+#define R_SPARC_LM22 36 /* Low middle 22 bits of ... */
+#define R_SPARC_PC_HH22 37 /* Top 22 bits of pc rel 64 bit */
+#define R_SPARC_PC_HM10 38 /* High middle 10 bit of ... */
+#define R_SPARC_PC_LM22 39 /* Low miggle 22 bits of ... */
+#define R_SPARC_WDISP16 40 /* PC relative 16 bit shifted */
+#define R_SPARC_WDISP19 41 /* PC relative 19 bit shifted */
+#define R_SPARC_7 43 /* Direct 7 bit */
+#define R_SPARC_5 44 /* Direct 5 bit */
+#define R_SPARC_6 45 /* Direct 6 bit */
+#define R_SPARC_DISP64 46 /* PC relative 64 bit */
+#define R_SPARC_PLT64 47 /* Direct 64 bit ref to PLT entry */
+#define R_SPARC_HIX22 48 /* High 22 bit complemented */
+#define R_SPARC_LOX10 49 /* Truncated 11 bit complemented */
+#define R_SPARC_H44 50 /* Direct high 12 of 44 bit */
+#define R_SPARC_M44 51 /* Direct mid 22 of 44 bit */
+#define R_SPARC_L44 52 /* Direct low 10 of 44 bit */
+#define R_SPARC_REGISTER 53 /* Global register usage */
+#define R_SPARC_UA64 54 /* Direct 64 bit unaligned */
+#define R_SPARC_UA16 55 /* Direct 16 bit unaligned */
+#define R_SPARC_TLS_GD_HI22 56
+#define R_SPARC_TLS_GD_LO10 57
+#define R_SPARC_TLS_GD_ADD 58
+#define R_SPARC_TLS_GD_CALL 59
+#define R_SPARC_TLS_LDM_HI22 60
+#define R_SPARC_TLS_LDM_LO10 61
+#define R_SPARC_TLS_LDM_ADD 62
+#define R_SPARC_TLS_LDM_CALL 63
+#define R_SPARC_TLS_LDO_HIX22 64
+#define R_SPARC_TLS_LDO_LOX10 65
+#define R_SPARC_TLS_LDO_ADD 66
+#define R_SPARC_TLS_IE_HI22 67
+#define R_SPARC_TLS_IE_LO10 68
+#define R_SPARC_TLS_IE_LD 69
+#define R_SPARC_TLS_IE_LDX 70
+#define R_SPARC_TLS_IE_ADD 71
+#define R_SPARC_TLS_LE_HIX22 72
+#define R_SPARC_TLS_LE_LOX10 73
+#define R_SPARC_TLS_DTPMOD32 74
+#define R_SPARC_TLS_DTPMOD64 75
+#define R_SPARC_TLS_DTPOFF32 76
+#define R_SPARC_TLS_DTPOFF64 77
+#define R_SPARC_TLS_TPOFF32 78
+#define R_SPARC_TLS_TPOFF64 79
+/* Keep this the last entry. */
+#define R_SPARC_NUM 80
+
+/* For Sparc64, legal values for d_tag of Elf64_Dyn. */
+
+#define DT_SPARC_REGISTER 0x70000001
+#define DT_SPARC_NUM 2
+
+/* Bits present in AT_HWCAP on SPARC. */
+
+#define HWCAP_SPARC_FLUSH 1 /* The CPU supports flush insn. */
+#define HWCAP_SPARC_STBAR 2
+#define HWCAP_SPARC_SWAP 4
+#define HWCAP_SPARC_MULDIV 8
+#define HWCAP_SPARC_V9 16 /* The CPU is v9, so v8plus is ok. */
+#define HWCAP_SPARC_ULTRA3 32
+#define HWCAP_SPARC_BLKINIT 64 /* Sun4v with block-init/load-twin. */
+#define HWCAP_SPARC_N2 128
+
+/* MIPS R3000 specific definitions. */
+
+/* Legal values for e_flags field of Elf32_Ehdr. */
+
+#define EF_MIPS_NOREORDER 1 /* A .noreorder directive was used */
+#define EF_MIPS_PIC 2 /* Contains PIC code */
+#define EF_MIPS_CPIC 4 /* Uses PIC calling sequence */
+#define EF_MIPS_XGOT 8
+#define EF_MIPS_64BIT_WHIRL 16
+#define EF_MIPS_ABI2 32
+#define EF_MIPS_ABI_ON32 64
+#define EF_MIPS_ARCH 0xf0000000 /* MIPS architecture level */
+
+/* Legal values for MIPS architecture level. */
+
+#define EF_MIPS_ARCH_1 0x00000000 /* -mips1 code. */
+#define EF_MIPS_ARCH_2 0x10000000 /* -mips2 code. */
+#define EF_MIPS_ARCH_3 0x20000000 /* -mips3 code. */
+#define EF_MIPS_ARCH_4 0x30000000 /* -mips4 code. */
+#define EF_MIPS_ARCH_5 0x40000000 /* -mips5 code. */
+#define EF_MIPS_ARCH_32 0x60000000 /* MIPS32 code. */
+#define EF_MIPS_ARCH_64 0x70000000 /* MIPS64 code. */
+
+/* The following are non-official names and should not be used. */
+
+#define E_MIPS_ARCH_1 0x00000000 /* -mips1 code. */
+#define E_MIPS_ARCH_2 0x10000000 /* -mips2 code. */
+#define E_MIPS_ARCH_3 0x20000000 /* -mips3 code. */
+#define E_MIPS_ARCH_4 0x30000000 /* -mips4 code. */
+#define E_MIPS_ARCH_5 0x40000000 /* -mips5 code. */
+#define E_MIPS_ARCH_32 0x60000000 /* MIPS32 code. */
+#define E_MIPS_ARCH_64 0x70000000 /* MIPS64 code. */
+
+/* Special section indices. */
+
+#define SHN_MIPS_ACOMMON 0xff00 /* Allocated common symbols */
+#define SHN_MIPS_TEXT 0xff01 /* Allocated test symbols. */
+#define SHN_MIPS_DATA 0xff02 /* Allocated data symbols. */
+#define SHN_MIPS_SCOMMON 0xff03 /* Small common symbols */
+#define SHN_MIPS_SUNDEFINED 0xff04 /* Small undefined symbols */
+
+/* Legal values for sh_type field of Elf32_Shdr. */
+
+#define SHT_MIPS_LIBLIST 0x70000000 /* Shared objects used in link */
+#define SHT_MIPS_MSYM 0x70000001
+#define SHT_MIPS_CONFLICT 0x70000002 /* Conflicting symbols */
+#define SHT_MIPS_GPTAB 0x70000003 /* Global data area sizes */
+#define SHT_MIPS_UCODE 0x70000004 /* Reserved for SGI/MIPS compilers */
+#define SHT_MIPS_DEBUG 0x70000005 /* MIPS ECOFF debugging information*/
+#define SHT_MIPS_REGINFO 0x70000006 /* Register usage information */
+#define SHT_MIPS_PACKAGE 0x70000007
+#define SHT_MIPS_PACKSYM 0x70000008
+#define SHT_MIPS_RELD 0x70000009
+#define SHT_MIPS_IFACE 0x7000000b
+#define SHT_MIPS_CONTENT 0x7000000c
+#define SHT_MIPS_OPTIONS 0x7000000d /* Miscellaneous options. */
+#define SHT_MIPS_SHDR 0x70000010
+#define SHT_MIPS_FDESC 0x70000011
+#define SHT_MIPS_EXTSYM 0x70000012
+#define SHT_MIPS_DENSE 0x70000013
+#define SHT_MIPS_PDESC 0x70000014
+#define SHT_MIPS_LOCSYM 0x70000015
+#define SHT_MIPS_AUXSYM 0x70000016
+#define SHT_MIPS_OPTSYM 0x70000017
+#define SHT_MIPS_LOCSTR 0x70000018
+#define SHT_MIPS_LINE 0x70000019
+#define SHT_MIPS_RFDESC 0x7000001a
+#define SHT_MIPS_DELTASYM 0x7000001b
+#define SHT_MIPS_DELTAINST 0x7000001c
+#define SHT_MIPS_DELTACLASS 0x7000001d
+#define SHT_MIPS_DWARF 0x7000001e /* DWARF debugging information. */
+#define SHT_MIPS_DELTADECL 0x7000001f
+#define SHT_MIPS_SYMBOL_LIB 0x70000020
+#define SHT_MIPS_EVENTS 0x70000021 /* Event section. */
+#define SHT_MIPS_TRANSLATE 0x70000022
+#define SHT_MIPS_PIXIE 0x70000023
+#define SHT_MIPS_XLATE 0x70000024
+#define SHT_MIPS_XLATE_DEBUG 0x70000025
+#define SHT_MIPS_WHIRL 0x70000026
+#define SHT_MIPS_EH_REGION 0x70000027
+#define SHT_MIPS_XLATE_OLD 0x70000028
+#define SHT_MIPS_PDR_EXCEPTION 0x70000029
+
+/* Legal values for sh_flags field of Elf32_Shdr. */
+
+#define SHF_MIPS_GPREL 0x10000000 /* Must be part of global data area */
+#define SHF_MIPS_MERGE 0x20000000
+#define SHF_MIPS_ADDR 0x40000000
+#define SHF_MIPS_STRINGS 0x80000000
+#define SHF_MIPS_NOSTRIP 0x08000000
+#define SHF_MIPS_LOCAL 0x04000000
+#define SHF_MIPS_NAMES 0x02000000
+#define SHF_MIPS_NODUPE 0x01000000
+
+
+/* Symbol tables. */
+
+/* MIPS specific values for `st_other'. */
+#define STO_MIPS_DEFAULT 0x0
+#define STO_MIPS_INTERNAL 0x1
+#define STO_MIPS_HIDDEN 0x2
+#define STO_MIPS_PROTECTED 0x3
+#define STO_MIPS_SC_ALIGN_UNUSED 0xff
+
+/* MIPS specific values for `st_info'. */
+#define STB_MIPS_SPLIT_COMMON 13
+
+/* Entries found in sections of type SHT_MIPS_GPTAB. */
+
+typedef union
+{
+ struct
+ {
+ Elf32_Word gt_current_g_value; /* -G value used for compilation */
+ Elf32_Word gt_unused; /* Not used */
+ } gt_header; /* First entry in section */
+ struct
+ {
+ Elf32_Word gt_g_value; /* If this value were used for -G */
+ Elf32_Word gt_bytes; /* This many bytes would be used */
+ } gt_entry; /* Subsequent entries in section */
+} Elf32_gptab;
+
+/* Entry found in sections of type SHT_MIPS_REGINFO. */
+
+typedef struct
+{
+ Elf32_Word ri_gprmask; /* General registers used */
+ Elf32_Word ri_cprmask[4]; /* Coprocessor registers used */
+ Elf32_Sword ri_gp_value; /* $gp register value */
+} Elf32_RegInfo;
+
+/* Entries found in sections of type SHT_MIPS_OPTIONS. */
+
+typedef struct
+{
+ unsigned char kind; /* Determines interpretation of the
+ variable part of descriptor. */
+ unsigned char size; /* Size of descriptor, including header. */
+ Elf32_Section section; /* Section header index of section affected,
+ 0 for global options. */
+ Elf32_Word info; /* Kind-specific information. */
+} Elf_Options;
+
+/* Values for `kind' field in Elf_Options. */
+
+#define ODK_NULL 0 /* Undefined. */
+#define ODK_REGINFO 1 /* Register usage information. */
+#define ODK_EXCEPTIONS 2 /* Exception processing options. */
+#define ODK_PAD 3 /* Section padding options. */
+#define ODK_HWPATCH 4 /* Hardware workarounds performed */
+#define ODK_FILL 5 /* record the fill value used by the linker. */
+#define ODK_TAGS 6 /* reserve space for desktop tools to write. */
+#define ODK_HWAND 7 /* HW workarounds. 'AND' bits when merging. */
+#define ODK_HWOR 8 /* HW workarounds. 'OR' bits when merging. */
+
+/* Values for `info' in Elf_Options for ODK_EXCEPTIONS entries. */
+
+#define OEX_FPU_MIN 0x1f /* FPE's which MUST be enabled. */
+#define OEX_FPU_MAX 0x1f00 /* FPE's which MAY be enabled. */
+#define OEX_PAGE0 0x10000 /* page zero must be mapped. */
+#define OEX_SMM 0x20000 /* Force sequential memory mode? */
+#define OEX_FPDBUG 0x40000 /* Force floating point debug mode? */
+#define OEX_PRECISEFP OEX_FPDBUG
+#define OEX_DISMISS 0x80000 /* Dismiss invalid address faults? */
+
+#define OEX_FPU_INVAL 0x10
+#define OEX_FPU_DIV0 0x08
+#define OEX_FPU_OFLO 0x04
+#define OEX_FPU_UFLO 0x02
+#define OEX_FPU_INEX 0x01
+
+/* Masks for `info' in Elf_Options for an ODK_HWPATCH entry. */
+
+#define OHW_R4KEOP 0x1 /* R4000 end-of-page patch. */
+#define OHW_R8KPFETCH 0x2 /* may need R8000 prefetch patch. */
+#define OHW_R5KEOP 0x4 /* R5000 end-of-page patch. */
+#define OHW_R5KCVTL 0x8 /* R5000 cvt.[ds].l bug. clean=1. */
+
+#define OPAD_PREFIX 0x1
+#define OPAD_POSTFIX 0x2
+#define OPAD_SYMBOL 0x4
+
+/* Entry found in `.options' section. */
+
+typedef struct
+{
+ Elf32_Word hwp_flags1; /* Extra flags. */
+ Elf32_Word hwp_flags2; /* Extra flags. */
+} Elf_Options_Hw;
+
+/* Masks for `info' in ElfOptions for ODK_HWAND and ODK_HWOR entries. */
+
+#define OHWA0_R4KEOP_CHECKED 0x00000001
+#define OHWA1_R4KEOP_CLEAN 0x00000002
+
+/* MIPS relocs. */
+
+#define R_MIPS_NONE 0 /* No reloc */
+#define R_MIPS_16 1 /* Direct 16 bit */
+#define R_MIPS_32 2 /* Direct 32 bit */
+#define R_MIPS_REL32 3 /* PC relative 32 bit */
+#define R_MIPS_26 4 /* Direct 26 bit shifted */
+#define R_MIPS_HI16 5 /* High 16 bit */
+#define R_MIPS_LO16 6 /* Low 16 bit */
+#define R_MIPS_GPREL16 7 /* GP relative 16 bit */
+#define R_MIPS_LITERAL 8 /* 16 bit literal entry */
+#define R_MIPS_GOT16 9 /* 16 bit GOT entry */
+#define R_MIPS_PC16 10 /* PC relative 16 bit */
+#define R_MIPS_CALL16 11 /* 16 bit GOT entry for function */
+#define R_MIPS_GPREL32 12 /* GP relative 32 bit */
+
+#define R_MIPS_SHIFT5 16
+#define R_MIPS_SHIFT6 17
+#define R_MIPS_64 18
+#define R_MIPS_GOT_DISP 19
+#define R_MIPS_GOT_PAGE 20
+#define R_MIPS_GOT_OFST 21
+#define R_MIPS_GOT_HI16 22
+#define R_MIPS_GOT_LO16 23
+#define R_MIPS_SUB 24
+#define R_MIPS_INSERT_A 25
+#define R_MIPS_INSERT_B 26
+#define R_MIPS_DELETE 27
+#define R_MIPS_HIGHER 28
+#define R_MIPS_HIGHEST 29
+#define R_MIPS_CALL_HI16 30
+#define R_MIPS_CALL_LO16 31
+#define R_MIPS_SCN_DISP 32
+#define R_MIPS_REL16 33
+#define R_MIPS_ADD_IMMEDIATE 34
+#define R_MIPS_PJUMP 35
+#define R_MIPS_RELGOT 36
+#define R_MIPS_JALR 37
+#define R_MIPS_TLS_DTPMOD32 38 /* Module number 32 bit */
+#define R_MIPS_TLS_DTPREL32 39 /* Module-relative offset 32 bit */
+#define R_MIPS_TLS_DTPMOD64 40 /* Module number 64 bit */
+#define R_MIPS_TLS_DTPREL64 41 /* Module-relative offset 64 bit */
+#define R_MIPS_TLS_GD 42 /* 16 bit GOT offset for GD */
+#define R_MIPS_TLS_LDM 43 /* 16 bit GOT offset for LDM */
+#define R_MIPS_TLS_DTPREL_HI16 44 /* Module-relative offset, high 16 bits */
+#define R_MIPS_TLS_DTPREL_LO16 45 /* Module-relative offset, low 16 bits */
+#define R_MIPS_TLS_GOTTPREL 46 /* 16 bit GOT offset for IE */
+#define R_MIPS_TLS_TPREL32 47 /* TP-relative offset, 32 bit */
+#define R_MIPS_TLS_TPREL64 48 /* TP-relative offset, 64 bit */
+#define R_MIPS_TLS_TPREL_HI16 49 /* TP-relative offset, high 16 bits */
+#define R_MIPS_TLS_TPREL_LO16 50 /* TP-relative offset, low 16 bits */
+#define R_MIPS_GLOB_DAT 51
+/* Keep this the last entry. */
+#define R_MIPS_NUM 52
+
+/* Legal values for p_type field of Elf32_Phdr. */
+
+#define PT_MIPS_REGINFO 0x70000000 /* Register usage information */
+#define PT_MIPS_RTPROC 0x70000001 /* Runtime procedure table. */
+#define PT_MIPS_OPTIONS 0x70000002
+
+/* Special program header types. */
+
+#define PF_MIPS_LOCAL 0x10000000
+
+/* Legal values for d_tag field of Elf32_Dyn. */
+
+#define DT_MIPS_RLD_VERSION 0x70000001 /* Runtime linker interface version */
+#define DT_MIPS_TIME_STAMP 0x70000002 /* Timestamp */
+#define DT_MIPS_ICHECKSUM 0x70000003 /* Checksum */
+#define DT_MIPS_IVERSION 0x70000004 /* Version string (string tbl index) */
+#define DT_MIPS_FLAGS 0x70000005 /* Flags */
+#define DT_MIPS_BASE_ADDRESS 0x70000006 /* Base address */
+#define DT_MIPS_MSYM 0x70000007
+#define DT_MIPS_CONFLICT 0x70000008 /* Address of CONFLICT section */
+#define DT_MIPS_LIBLIST 0x70000009 /* Address of LIBLIST section */
+#define DT_MIPS_LOCAL_GOTNO 0x7000000a /* Number of local GOT entries */
+#define DT_MIPS_CONFLICTNO 0x7000000b /* Number of CONFLICT entries */
+#define DT_MIPS_LIBLISTNO 0x70000010 /* Number of LIBLIST entries */
+#define DT_MIPS_SYMTABNO 0x70000011 /* Number of DYNSYM entries */
+#define DT_MIPS_UNREFEXTNO 0x70000012 /* First external DYNSYM */
+#define DT_MIPS_GOTSYM 0x70000013 /* First GOT entry in DYNSYM */
+#define DT_MIPS_HIPAGENO 0x70000014 /* Number of GOT page table entries */
+#define DT_MIPS_RLD_MAP 0x70000016 /* Address of run time loader map. */
+#define DT_MIPS_DELTA_CLASS 0x70000017 /* Delta C++ class definition. */
+#define DT_MIPS_DELTA_CLASS_NO 0x70000018 /* Number of entries in
+ DT_MIPS_DELTA_CLASS. */
+#define DT_MIPS_DELTA_INSTANCE 0x70000019 /* Delta C++ class instances. */
+#define DT_MIPS_DELTA_INSTANCE_NO 0x7000001a /* Number of entries in
+ DT_MIPS_DELTA_INSTANCE. */
+#define DT_MIPS_DELTA_RELOC 0x7000001b /* Delta relocations. */
+#define DT_MIPS_DELTA_RELOC_NO 0x7000001c /* Number of entries in
+ DT_MIPS_DELTA_RELOC. */
+#define DT_MIPS_DELTA_SYM 0x7000001d /* Delta symbols that Delta
+ relocations refer to. */
+#define DT_MIPS_DELTA_SYM_NO 0x7000001e /* Number of entries in
+ DT_MIPS_DELTA_SYM. */
+#define DT_MIPS_DELTA_CLASSSYM 0x70000020 /* Delta symbols that hold the
+ class declaration. */
+#define DT_MIPS_DELTA_CLASSSYM_NO 0x70000021 /* Number of entries in
+ DT_MIPS_DELTA_CLASSSYM. */
+#define DT_MIPS_CXX_FLAGS 0x70000022 /* Flags indicating for C++ flavor. */
+#define DT_MIPS_PIXIE_INIT 0x70000023
+#define DT_MIPS_SYMBOL_LIB 0x70000024
+#define DT_MIPS_LOCALPAGE_GOTIDX 0x70000025
+#define DT_MIPS_LOCAL_GOTIDX 0x70000026
+#define DT_MIPS_HIDDEN_GOTIDX 0x70000027
+#define DT_MIPS_PROTECTED_GOTIDX 0x70000028
+#define DT_MIPS_OPTIONS 0x70000029 /* Address of .options. */
+#define DT_MIPS_INTERFACE 0x7000002a /* Address of .interface. */
+#define DT_MIPS_DYNSTR_ALIGN 0x7000002b
+#define DT_MIPS_INTERFACE_SIZE 0x7000002c /* Size of the .interface section. */
+#define DT_MIPS_RLD_TEXT_RESOLVE_ADDR 0x7000002d /* Address of rld_text_rsolve
+ function stored in GOT. */
+#define DT_MIPS_PERF_SUFFIX 0x7000002e /* Default suffix of dso to be added
+ by rld on dlopen() calls. */
+#define DT_MIPS_COMPACT_SIZE 0x7000002f /* (O32)Size of compact rel section. */
+#define DT_MIPS_GP_VALUE 0x70000030 /* GP value for aux GOTs. */
+#define DT_MIPS_AUX_DYNAMIC 0x70000031 /* Address of aux .dynamic. */
+#define DT_MIPS_NUM 0x32
+
+/* Legal values for DT_MIPS_FLAGS Elf32_Dyn entry. */
+
+#define RHF_NONE 0 /* No flags */
+#define RHF_QUICKSTART (1 << 0) /* Use quickstart */
+#define RHF_NOTPOT (1 << 1) /* Hash size not power of 2 */
+#define RHF_NO_LIBRARY_REPLACEMENT (1 << 2) /* Ignore LD_LIBRARY_PATH */
+#define RHF_NO_MOVE (1 << 3)
+#define RHF_SGI_ONLY (1 << 4)
+#define RHF_GUARANTEE_INIT (1 << 5)
+#define RHF_DELTA_C_PLUS_PLUS (1 << 6)
+#define RHF_GUARANTEE_START_INIT (1 << 7)
+#define RHF_PIXIE (1 << 8)
+#define RHF_DEFAULT_DELAY_LOAD (1 << 9)
+#define RHF_REQUICKSTART (1 << 10)
+#define RHF_REQUICKSTARTED (1 << 11)
+#define RHF_CORD (1 << 12)
+#define RHF_NO_UNRES_UNDEF (1 << 13)
+#define RHF_RLD_ORDER_SAFE (1 << 14)
+
+/* Entries found in sections of type SHT_MIPS_LIBLIST. */
+
+typedef struct
+{
+ Elf32_Word l_name; /* Name (string table index) */
+ Elf32_Word l_time_stamp; /* Timestamp */
+ Elf32_Word l_checksum; /* Checksum */
+ Elf32_Word l_version; /* Interface version */
+ Elf32_Word l_flags; /* Flags */
+} Elf32_Lib;
+
+typedef struct
+{
+ Elf64_Word l_name; /* Name (string table index) */
+ Elf64_Word l_time_stamp; /* Timestamp */
+ Elf64_Word l_checksum; /* Checksum */
+ Elf64_Word l_version; /* Interface version */
+ Elf64_Word l_flags; /* Flags */
+} Elf64_Lib;
+
+
+/* Legal values for l_flags. */
+
+#define LL_NONE 0
+#define LL_EXACT_MATCH (1 << 0) /* Require exact match */
+#define LL_IGNORE_INT_VER (1 << 1) /* Ignore interface version */
+#define LL_REQUIRE_MINOR (1 << 2)
+#define LL_EXPORTS (1 << 3)
+#define LL_DELAY_LOAD (1 << 4)
+#define LL_DELTA (1 << 5)
+
+/* Entries found in sections of type SHT_MIPS_CONFLICT. */
+
+typedef Elf32_Addr Elf32_Conflict;
+
+
+/* HPPA specific definitions. */
+
+/* Legal values for e_flags field of Elf32_Ehdr. */
+
+#define EF_PARISC_TRAPNIL 0x00010000 /* Trap nil pointer dereference. */
+#define EF_PARISC_EXT 0x00020000 /* Program uses arch. extensions. */
+#define EF_PARISC_LSB 0x00040000 /* Program expects little endian. */
+#define EF_PARISC_WIDE 0x00080000 /* Program expects wide mode. */
+#define EF_PARISC_NO_KABP 0x00100000 /* No kernel assisted branch
+ prediction. */
+#define EF_PARISC_LAZYSWAP 0x00400000 /* Allow lazy swapping. */
+#define EF_PARISC_ARCH 0x0000ffff /* Architecture version. */
+
+/* Defined values for `e_flags & EF_PARISC_ARCH' are: */
+
+#define EFA_PARISC_1_0 0x020b /* PA-RISC 1.0 big-endian. */
+#define EFA_PARISC_1_1 0x0210 /* PA-RISC 1.1 big-endian. */
+#define EFA_PARISC_2_0 0x0214 /* PA-RISC 2.0 big-endian. */
+
+/* Additional section indeces. */
+
+#define SHN_PARISC_ANSI_COMMON 0xff00 /* Section for tenatively declared
+ symbols in ANSI C. */
+#define SHN_PARISC_HUGE_COMMON 0xff01 /* Common blocks in huge model. */
+
+/* Legal values for sh_type field of Elf32_Shdr. */
+
+#define SHT_PARISC_EXT 0x70000000 /* Contains product specific ext. */
+#define SHT_PARISC_UNWIND 0x70000001 /* Unwind information. */
+#define SHT_PARISC_DOC 0x70000002 /* Debug info for optimized code. */
+
+/* Legal values for sh_flags field of Elf32_Shdr. */
+
+#define SHF_PARISC_SHORT 0x20000000 /* Section with short addressing. */
+#define SHF_PARISC_HUGE 0x40000000 /* Section far from gp. */
+#define SHF_PARISC_SBP 0x80000000 /* Static branch prediction code. */
+
+/* Legal values for ST_TYPE subfield of st_info (symbol type). */
+
+#define STT_PARISC_MILLICODE 13 /* Millicode function entry point. */
+
+#define STT_HP_OPAQUE (STT_LOOS + 0x1)
+#define STT_HP_STUB (STT_LOOS + 0x2)
+
+/* HPPA relocs. */
+
+#define R_PARISC_NONE 0 /* No reloc. */
+#define R_PARISC_DIR32 1 /* Direct 32-bit reference. */
+#define R_PARISC_DIR21L 2 /* Left 21 bits of eff. address. */
+#define R_PARISC_DIR17R 3 /* Right 17 bits of eff. address. */
+#define R_PARISC_DIR17F 4 /* 17 bits of eff. address. */
+#define R_PARISC_DIR14R 6 /* Right 14 bits of eff. address. */
+#define R_PARISC_PCREL32 9 /* 32-bit rel. address. */
+#define R_PARISC_PCREL21L 10 /* Left 21 bits of rel. address. */
+#define R_PARISC_PCREL17R 11 /* Right 17 bits of rel. address. */
+#define R_PARISC_PCREL17F 12 /* 17 bits of rel. address. */
+#define R_PARISC_PCREL14R 14 /* Right 14 bits of rel. address. */
+#define R_PARISC_DPREL21L 18 /* Left 21 bits of rel. address. */
+#define R_PARISC_DPREL14R 22 /* Right 14 bits of rel. address. */
+#define R_PARISC_GPREL21L 26 /* GP-relative, left 21 bits. */
+#define R_PARISC_GPREL14R 30 /* GP-relative, right 14 bits. */
+#define R_PARISC_LTOFF21L 34 /* LT-relative, left 21 bits. */
+#define R_PARISC_LTOFF14R 38 /* LT-relative, right 14 bits. */
+#define R_PARISC_SECREL32 41 /* 32 bits section rel. address. */
+#define R_PARISC_SEGBASE 48 /* No relocation, set segment base. */
+#define R_PARISC_SEGREL32 49 /* 32 bits segment rel. address. */
+#define R_PARISC_PLTOFF21L 50 /* PLT rel. address, left 21 bits. */
+#define R_PARISC_PLTOFF14R 54 /* PLT rel. address, right 14 bits. */
+#define R_PARISC_LTOFF_FPTR32 57 /* 32 bits LT-rel. function pointer. */
+#define R_PARISC_LTOFF_FPTR21L 58 /* LT-rel. fct ptr, left 21 bits. */
+#define R_PARISC_LTOFF_FPTR14R 62 /* LT-rel. fct ptr, right 14 bits. */
+#define R_PARISC_FPTR64 64 /* 64 bits function address. */
+#define R_PARISC_PLABEL32 65 /* 32 bits function address. */
+#define R_PARISC_PLABEL21L 66 /* Left 21 bits of fdesc address. */
+#define R_PARISC_PLABEL14R 70 /* Right 14 bits of fdesc address. */
+#define R_PARISC_PCREL64 72 /* 64 bits PC-rel. address. */
+#define R_PARISC_PCREL22F 74 /* 22 bits PC-rel. address. */
+#define R_PARISC_PCREL14WR 75 /* PC-rel. address, right 14 bits. */
+#define R_PARISC_PCREL14DR 76 /* PC rel. address, right 14 bits. */
+#define R_PARISC_PCREL16F 77 /* 16 bits PC-rel. address. */
+#define R_PARISC_PCREL16WF 78 /* 16 bits PC-rel. address. */
+#define R_PARISC_PCREL16DF 79 /* 16 bits PC-rel. address. */
+#define R_PARISC_DIR64 80 /* 64 bits of eff. address. */
+#define R_PARISC_DIR14WR 83 /* 14 bits of eff. address. */
+#define R_PARISC_DIR14DR 84 /* 14 bits of eff. address. */
+#define R_PARISC_DIR16F 85 /* 16 bits of eff. address. */
+#define R_PARISC_DIR16WF 86 /* 16 bits of eff. address. */
+#define R_PARISC_DIR16DF 87 /* 16 bits of eff. address. */
+#define R_PARISC_GPREL64 88 /* 64 bits of GP-rel. address. */
+#define R_PARISC_GPREL14WR 91 /* GP-rel. address, right 14 bits. */
+#define R_PARISC_GPREL14DR 92 /* GP-rel. address, right 14 bits. */
+#define R_PARISC_GPREL16F 93 /* 16 bits GP-rel. address. */
+#define R_PARISC_GPREL16WF 94 /* 16 bits GP-rel. address. */
+#define R_PARISC_GPREL16DF 95 /* 16 bits GP-rel. address. */
+#define R_PARISC_LTOFF64 96 /* 64 bits LT-rel. address. */
+#define R_PARISC_LTOFF14WR 99 /* LT-rel. address, right 14 bits. */
+#define R_PARISC_LTOFF14DR 100 /* LT-rel. address, right 14 bits. */
+#define R_PARISC_LTOFF16F 101 /* 16 bits LT-rel. address. */
+#define R_PARISC_LTOFF16WF 102 /* 16 bits LT-rel. address. */
+#define R_PARISC_LTOFF16DF 103 /* 16 bits LT-rel. address. */
+#define R_PARISC_SECREL64 104 /* 64 bits section rel. address. */
+#define R_PARISC_SEGREL64 112 /* 64 bits segment rel. address. */
+#define R_PARISC_PLTOFF14WR 115 /* PLT-rel. address, right 14 bits. */
+#define R_PARISC_PLTOFF14DR 116 /* PLT-rel. address, right 14 bits. */
+#define R_PARISC_PLTOFF16F 117 /* 16 bits LT-rel. address. */
+#define R_PARISC_PLTOFF16WF 118 /* 16 bits PLT-rel. address. */
+#define R_PARISC_PLTOFF16DF 119 /* 16 bits PLT-rel. address. */
+#define R_PARISC_LTOFF_FPTR64 120 /* 64 bits LT-rel. function ptr. */
+#define R_PARISC_LTOFF_FPTR14WR 123 /* LT-rel. fct. ptr., right 14 bits. */
+#define R_PARISC_LTOFF_FPTR14DR 124 /* LT-rel. fct. ptr., right 14 bits. */
+#define R_PARISC_LTOFF_FPTR16F 125 /* 16 bits LT-rel. function ptr. */
+#define R_PARISC_LTOFF_FPTR16WF 126 /* 16 bits LT-rel. function ptr. */
+#define R_PARISC_LTOFF_FPTR16DF 127 /* 16 bits LT-rel. function ptr. */
+#define R_PARISC_LORESERVE 128
+#define R_PARISC_COPY 128 /* Copy relocation. */
+#define R_PARISC_IPLT 129 /* Dynamic reloc, imported PLT */
+#define R_PARISC_EPLT 130 /* Dynamic reloc, exported PLT */
+#define R_PARISC_TPREL32 153 /* 32 bits TP-rel. address. */
+#define R_PARISC_TPREL21L 154 /* TP-rel. address, left 21 bits. */
+#define R_PARISC_TPREL14R 158 /* TP-rel. address, right 14 bits. */
+#define R_PARISC_LTOFF_TP21L 162 /* LT-TP-rel. address, left 21 bits. */
+#define R_PARISC_LTOFF_TP14R 166 /* LT-TP-rel. address, right 14 bits.*/
+#define R_PARISC_LTOFF_TP14F 167 /* 14 bits LT-TP-rel. address. */
+#define R_PARISC_TPREL64 216 /* 64 bits TP-rel. address. */
+#define R_PARISC_TPREL14WR 219 /* TP-rel. address, right 14 bits. */
+#define R_PARISC_TPREL14DR 220 /* TP-rel. address, right 14 bits. */
+#define R_PARISC_TPREL16F 221 /* 16 bits TP-rel. address. */
+#define R_PARISC_TPREL16WF 222 /* 16 bits TP-rel. address. */
+#define R_PARISC_TPREL16DF 223 /* 16 bits TP-rel. address. */
+#define R_PARISC_LTOFF_TP64 224 /* 64 bits LT-TP-rel. address. */
+#define R_PARISC_LTOFF_TP14WR 227 /* LT-TP-rel. address, right 14 bits.*/
+#define R_PARISC_LTOFF_TP14DR 228 /* LT-TP-rel. address, right 14 bits.*/
+#define R_PARISC_LTOFF_TP16F 229 /* 16 bits LT-TP-rel. address. */
+#define R_PARISC_LTOFF_TP16WF 230 /* 16 bits LT-TP-rel. address. */
+#define R_PARISC_LTOFF_TP16DF 231 /* 16 bits LT-TP-rel. address. */
+#define R_PARISC_GNU_VTENTRY 232
+#define R_PARISC_GNU_VTINHERIT 233
+#define R_PARISC_TLS_GD21L 234 /* GD 21-bit left. */
+#define R_PARISC_TLS_GD14R 235 /* GD 14-bit right. */
+#define R_PARISC_TLS_GDCALL 236 /* GD call to __t_g_a. */
+#define R_PARISC_TLS_LDM21L 237 /* LD module 21-bit left. */
+#define R_PARISC_TLS_LDM14R 238 /* LD module 14-bit right. */
+#define R_PARISC_TLS_LDMCALL 239 /* LD module call to __t_g_a. */
+#define R_PARISC_TLS_LDO21L 240 /* LD offset 21-bit left. */
+#define R_PARISC_TLS_LDO14R 241 /* LD offset 14-bit right. */
+#define R_PARISC_TLS_DTPMOD32 242 /* DTP module 32-bit. */
+#define R_PARISC_TLS_DTPMOD64 243 /* DTP module 64-bit. */
+#define R_PARISC_TLS_DTPOFF32 244 /* DTP offset 32-bit. */
+#define R_PARISC_TLS_DTPOFF64 245 /* DTP offset 32-bit. */
+#define R_PARISC_TLS_LE21L R_PARISC_TPREL21L
+#define R_PARISC_TLS_LE14R R_PARISC_TPREL14R
+#define R_PARISC_TLS_IE21L R_PARISC_LTOFF_TP21L
+#define R_PARISC_TLS_IE14R R_PARISC_LTOFF_TP14R
+#define R_PARISC_TLS_TPREL32 R_PARISC_TPREL32
+#define R_PARISC_TLS_TPREL64 R_PARISC_TPREL64
+#define R_PARISC_HIRESERVE 255
+
+/* Legal values for p_type field of Elf32_Phdr/Elf64_Phdr. */
+
+#define PT_HP_TLS (PT_LOOS + 0x0)
+#define PT_HP_CORE_NONE (PT_LOOS + 0x1)
+#define PT_HP_CORE_VERSION (PT_LOOS + 0x2)
+#define PT_HP_CORE_KERNEL (PT_LOOS + 0x3)
+#define PT_HP_CORE_COMM (PT_LOOS + 0x4)
+#define PT_HP_CORE_PROC (PT_LOOS + 0x5)
+#define PT_HP_CORE_LOADABLE (PT_LOOS + 0x6)
+#define PT_HP_CORE_STACK (PT_LOOS + 0x7)
+#define PT_HP_CORE_SHM (PT_LOOS + 0x8)
+#define PT_HP_CORE_MMF (PT_LOOS + 0x9)
+#define PT_HP_PARALLEL (PT_LOOS + 0x10)
+#define PT_HP_FASTBIND (PT_LOOS + 0x11)
+#define PT_HP_OPT_ANNOT (PT_LOOS + 0x12)
+#define PT_HP_HSL_ANNOT (PT_LOOS + 0x13)
+#define PT_HP_STACK (PT_LOOS + 0x14)
+
+#define PT_PARISC_ARCHEXT 0x70000000
+#define PT_PARISC_UNWIND 0x70000001
+
+/* Legal values for p_flags field of Elf32_Phdr/Elf64_Phdr. */
+
+#define PF_PARISC_SBP 0x08000000
+
+#define PF_HP_PAGE_SIZE 0x00100000
+#define PF_HP_FAR_SHARED 0x00200000
+#define PF_HP_NEAR_SHARED 0x00400000
+#define PF_HP_CODE 0x01000000
+#define PF_HP_MODIFY 0x02000000
+#define PF_HP_LAZYSWAP 0x04000000
+#define PF_HP_SBP 0x08000000
+
+
+/* Alpha specific definitions. */
+
+/* Legal values for e_flags field of Elf64_Ehdr. */
+
+#define EF_ALPHA_32BIT 1 /* All addresses must be < 2GB. */
+#define EF_ALPHA_CANRELAX 2 /* Relocations for relaxing exist. */
+
+/* Legal values for sh_type field of Elf64_Shdr. */
+
+/* These two are primerily concerned with ECOFF debugging info. */
+#define SHT_ALPHA_DEBUG 0x70000001
+#define SHT_ALPHA_REGINFO 0x70000002
+
+/* Legal values for sh_flags field of Elf64_Shdr. */
+
+#define SHF_ALPHA_GPREL 0x10000000
+
+/* Legal values for st_other field of Elf64_Sym. */
+#define STO_ALPHA_NOPV 0x80 /* No PV required. */
+#define STO_ALPHA_STD_GPLOAD 0x88 /* PV only used for initial ldgp. */
+
+/* Alpha relocs. */
+
+#define R_ALPHA_NONE 0 /* No reloc */
+#define R_ALPHA_REFLONG 1 /* Direct 32 bit */
+#define R_ALPHA_REFQUAD 2 /* Direct 64 bit */
+#define R_ALPHA_GPREL32 3 /* GP relative 32 bit */
+#define R_ALPHA_LITERAL 4 /* GP relative 16 bit w/optimization */
+#define R_ALPHA_LITUSE 5 /* Optimization hint for LITERAL */
+#define R_ALPHA_GPDISP 6 /* Add displacement to GP */
+#define R_ALPHA_BRADDR 7 /* PC+4 relative 23 bit shifted */
+#define R_ALPHA_HINT 8 /* PC+4 relative 16 bit shifted */
+#define R_ALPHA_SREL16 9 /* PC relative 16 bit */
+#define R_ALPHA_SREL32 10 /* PC relative 32 bit */
+#define R_ALPHA_SREL64 11 /* PC relative 64 bit */
+#define R_ALPHA_GPRELHIGH 17 /* GP relative 32 bit, high 16 bits */
+#define R_ALPHA_GPRELLOW 18 /* GP relative 32 bit, low 16 bits */
+#define R_ALPHA_GPREL16 19 /* GP relative 16 bit */
+#define R_ALPHA_COPY 24 /* Copy symbol at runtime */
+#define R_ALPHA_GLOB_DAT 25 /* Create GOT entry */
+#define R_ALPHA_JMP_SLOT 26 /* Create PLT entry */
+#define R_ALPHA_RELATIVE 27 /* Adjust by program base */
+#define R_ALPHA_TLS_GD_HI 28
+#define R_ALPHA_TLSGD 29
+#define R_ALPHA_TLS_LDM 30
+#define R_ALPHA_DTPMOD64 31
+#define R_ALPHA_GOTDTPREL 32
+#define R_ALPHA_DTPREL64 33
+#define R_ALPHA_DTPRELHI 34
+#define R_ALPHA_DTPRELLO 35
+#define R_ALPHA_DTPREL16 36
+#define R_ALPHA_GOTTPREL 37
+#define R_ALPHA_TPREL64 38
+#define R_ALPHA_TPRELHI 39
+#define R_ALPHA_TPRELLO 40
+#define R_ALPHA_TPREL16 41
+/* Keep this the last entry. */
+#define R_ALPHA_NUM 46
+
+/* Magic values of the LITUSE relocation addend. */
+#define LITUSE_ALPHA_ADDR 0
+#define LITUSE_ALPHA_BASE 1
+#define LITUSE_ALPHA_BYTOFF 2
+#define LITUSE_ALPHA_JSR 3
+#define LITUSE_ALPHA_TLS_GD 4
+#define LITUSE_ALPHA_TLS_LDM 5
+
+/* Legal values for d_tag of Elf64_Dyn. */
+#define DT_ALPHA_PLTRO (DT_LOPROC + 0)
+#define DT_ALPHA_NUM 1
+
+/* PowerPC specific declarations */
+
+/* Values for Elf32/64_Ehdr.e_flags. */
+#define EF_PPC_EMB 0x80000000 /* PowerPC embedded flag */
+
+/* Cygnus local bits below */
+#define EF_PPC_RELOCATABLE 0x00010000 /* PowerPC -mrelocatable flag*/
+#define EF_PPC_RELOCATABLE_LIB 0x00008000 /* PowerPC -mrelocatable-lib
+ flag */
+
+/* PowerPC relocations defined by the ABIs */
+#define R_PPC_NONE 0
+#define R_PPC_ADDR32 1 /* 32bit absolute address */
+#define R_PPC_ADDR24 2 /* 26bit address, 2 bits ignored. */
+#define R_PPC_ADDR16 3 /* 16bit absolute address */
+#define R_PPC_ADDR16_LO 4 /* lower 16bit of absolute address */
+#define R_PPC_ADDR16_HI 5 /* high 16bit of absolute address */
+#define R_PPC_ADDR16_HA 6 /* adjusted high 16bit */
+#define R_PPC_ADDR14 7 /* 16bit address, 2 bits ignored */
+#define R_PPC_ADDR14_BRTAKEN 8
+#define R_PPC_ADDR14_BRNTAKEN 9
+#define R_PPC_REL24 10 /* PC relative 26 bit */
+#define R_PPC_REL14 11 /* PC relative 16 bit */
+#define R_PPC_REL14_BRTAKEN 12
+#define R_PPC_REL14_BRNTAKEN 13
+#define R_PPC_GOT16 14
+#define R_PPC_GOT16_LO 15
+#define R_PPC_GOT16_HI 16
+#define R_PPC_GOT16_HA 17
+#define R_PPC_PLTREL24 18
+#define R_PPC_COPY 19
+#define R_PPC_GLOB_DAT 20
+#define R_PPC_JMP_SLOT 21
+#define R_PPC_RELATIVE 22
+#define R_PPC_LOCAL24PC 23
+#define R_PPC_UADDR32 24
+#define R_PPC_UADDR16 25
+#define R_PPC_REL32 26
+#define R_PPC_PLT32 27
+#define R_PPC_PLTREL32 28
+#define R_PPC_PLT16_LO 29
+#define R_PPC_PLT16_HI 30
+#define R_PPC_PLT16_HA 31
+#define R_PPC_SDAREL16 32
+#define R_PPC_SECTOFF 33
+#define R_PPC_SECTOFF_LO 34
+#define R_PPC_SECTOFF_HI 35
+#define R_PPC_SECTOFF_HA 36
+
+/* PowerPC relocations defined for the TLS access ABI. */
+#define R_PPC_TLS 67 /* none (sym+add)@tls */
+#define R_PPC_DTPMOD32 68 /* word32 (sym+add)@dtpmod */
+#define R_PPC_TPREL16 69 /* half16* (sym+add)@tprel */
+#define R_PPC_TPREL16_LO 70 /* half16 (sym+add)@tprel@l */
+#define R_PPC_TPREL16_HI 71 /* half16 (sym+add)@tprel@h */
+#define R_PPC_TPREL16_HA 72 /* half16 (sym+add)@tprel@ha */
+#define R_PPC_TPREL32 73 /* word32 (sym+add)@tprel */
+#define R_PPC_DTPREL16 74 /* half16* (sym+add)@dtprel */
+#define R_PPC_DTPREL16_LO 75 /* half16 (sym+add)@dtprel@l */
+#define R_PPC_DTPREL16_HI 76 /* half16 (sym+add)@dtprel@h */
+#define R_PPC_DTPREL16_HA 77 /* half16 (sym+add)@dtprel@ha */
+#define R_PPC_DTPREL32 78 /* word32 (sym+add)@dtprel */
+#define R_PPC_GOT_TLSGD16 79 /* half16* (sym+add)@got@tlsgd */
+#define R_PPC_GOT_TLSGD16_LO 80 /* half16 (sym+add)@got@tlsgd@l */
+#define R_PPC_GOT_TLSGD16_HI 81 /* half16 (sym+add)@got@tlsgd@h */
+#define R_PPC_GOT_TLSGD16_HA 82 /* half16 (sym+add)@got@tlsgd@ha */
+#define R_PPC_GOT_TLSLD16 83 /* half16* (sym+add)@got@tlsld */
+#define R_PPC_GOT_TLSLD16_LO 84 /* half16 (sym+add)@got@tlsld@l */
+#define R_PPC_GOT_TLSLD16_HI 85 /* half16 (sym+add)@got@tlsld@h */
+#define R_PPC_GOT_TLSLD16_HA 86 /* half16 (sym+add)@got@tlsld@ha */
+#define R_PPC_GOT_TPREL16 87 /* half16* (sym+add)@got@tprel */
+#define R_PPC_GOT_TPREL16_LO 88 /* half16 (sym+add)@got@tprel@l */
+#define R_PPC_GOT_TPREL16_HI 89 /* half16 (sym+add)@got@tprel@h */
+#define R_PPC_GOT_TPREL16_HA 90 /* half16 (sym+add)@got@tprel@ha */
+#define R_PPC_GOT_DTPREL16 91 /* half16* (sym+add)@got@dtprel */
+#define R_PPC_GOT_DTPREL16_LO 92 /* half16* (sym+add)@got@dtprel@l */
+#define R_PPC_GOT_DTPREL16_HI 93 /* half16* (sym+add)@got@dtprel@h */
+#define R_PPC_GOT_DTPREL16_HA 94 /* half16* (sym+add)@got@dtprel@ha */
+
+/* Keep this the last entry. */
+#define R_PPC_NUM 95
+
+/* The remaining relocs are from the Embedded ELF ABI, and are not
+ in the SVR4 ELF ABI. */
+#define R_PPC_EMB_NADDR32 101
+#define R_PPC_EMB_NADDR16 102
+#define R_PPC_EMB_NADDR16_LO 103
+#define R_PPC_EMB_NADDR16_HI 104
+#define R_PPC_EMB_NADDR16_HA 105
+#define R_PPC_EMB_SDAI16 106
+#define R_PPC_EMB_SDA2I16 107
+#define R_PPC_EMB_SDA2REL 108
+#define R_PPC_EMB_SDA21 109 /* 16 bit offset in SDA */
+#define R_PPC_EMB_MRKREF 110
+#define R_PPC_EMB_RELSEC16 111
+#define R_PPC_EMB_RELST_LO 112
+#define R_PPC_EMB_RELST_HI 113
+#define R_PPC_EMB_RELST_HA 114
+#define R_PPC_EMB_BIT_FLD 115
+#define R_PPC_EMB_RELSDA 116 /* 16 bit relative offset in SDA */
+
+/* Diab tool relocations. */
+#define R_PPC_DIAB_SDA21_LO 180 /* like EMB_SDA21, but lower 16 bit */
+#define R_PPC_DIAB_SDA21_HI 181 /* like EMB_SDA21, but high 16 bit */
+#define R_PPC_DIAB_SDA21_HA 182 /* like EMB_SDA21, adjusted high 16 */
+#define R_PPC_DIAB_RELSDA_LO 183 /* like EMB_RELSDA, but lower 16 bit */
+#define R_PPC_DIAB_RELSDA_HI 184 /* like EMB_RELSDA, but high 16 bit */
+#define R_PPC_DIAB_RELSDA_HA 185 /* like EMB_RELSDA, adjusted high 16 */
+
+/* GNU relocs used in PIC code sequences. */
+#define R_PPC_REL16 249 /* word32 (sym-.) */
+#define R_PPC_REL16_LO 250 /* half16 (sym-.)@l */
+#define R_PPC_REL16_HI 251 /* half16 (sym-.)@h */
+#define R_PPC_REL16_HA 252 /* half16 (sym-.)@ha */
+
+/* This is a phony reloc to handle any old fashioned TOC16 references
+ that may still be in object files. */
+#define R_PPC_TOC16 255
+
+/* PowerPC specific values for the Dyn d_tag field. */
+#define DT_PPC_GOT (DT_LOPROC + 0)
+#define DT_PPC_NUM 1
+
+/* PowerPC64 relocations defined by the ABIs */
+#define R_PPC64_NONE R_PPC_NONE
+#define R_PPC64_ADDR32 R_PPC_ADDR32 /* 32bit absolute address */
+#define R_PPC64_ADDR24 R_PPC_ADDR24 /* 26bit address, word aligned */
+#define R_PPC64_ADDR16 R_PPC_ADDR16 /* 16bit absolute address */
+#define R_PPC64_ADDR16_LO R_PPC_ADDR16_LO /* lower 16bits of address */
+#define R_PPC64_ADDR16_HI R_PPC_ADDR16_HI /* high 16bits of address. */
+#define R_PPC64_ADDR16_HA R_PPC_ADDR16_HA /* adjusted high 16bits. */
+#define R_PPC64_ADDR14 R_PPC_ADDR14 /* 16bit address, word aligned */
+#define R_PPC64_ADDR14_BRTAKEN R_PPC_ADDR14_BRTAKEN
+#define R_PPC64_ADDR14_BRNTAKEN R_PPC_ADDR14_BRNTAKEN
+#define R_PPC64_REL24 R_PPC_REL24 /* PC-rel. 26 bit, word aligned */
+#define R_PPC64_REL14 R_PPC_REL14 /* PC relative 16 bit */
+#define R_PPC64_REL14_BRTAKEN R_PPC_REL14_BRTAKEN
+#define R_PPC64_REL14_BRNTAKEN R_PPC_REL14_BRNTAKEN
+#define R_PPC64_GOT16 R_PPC_GOT16
+#define R_PPC64_GOT16_LO R_PPC_GOT16_LO
+#define R_PPC64_GOT16_HI R_PPC_GOT16_HI
+#define R_PPC64_GOT16_HA R_PPC_GOT16_HA
+
+#define R_PPC64_COPY R_PPC_COPY
+#define R_PPC64_GLOB_DAT R_PPC_GLOB_DAT
+#define R_PPC64_JMP_SLOT R_PPC_JMP_SLOT
+#define R_PPC64_RELATIVE R_PPC_RELATIVE
+
+#define R_PPC64_UADDR32 R_PPC_UADDR32
+#define R_PPC64_UADDR16 R_PPC_UADDR16
+#define R_PPC64_REL32 R_PPC_REL32
+#define R_PPC64_PLT32 R_PPC_PLT32
+#define R_PPC64_PLTREL32 R_PPC_PLTREL32
+#define R_PPC64_PLT16_LO R_PPC_PLT16_LO
+#define R_PPC64_PLT16_HI R_PPC_PLT16_HI
+#define R_PPC64_PLT16_HA R_PPC_PLT16_HA
+
+#define R_PPC64_SECTOFF R_PPC_SECTOFF
+#define R_PPC64_SECTOFF_LO R_PPC_SECTOFF_LO
+#define R_PPC64_SECTOFF_HI R_PPC_SECTOFF_HI
+#define R_PPC64_SECTOFF_HA R_PPC_SECTOFF_HA
+#define R_PPC64_ADDR30 37 /* word30 (S + A - P) >> 2 */
+#define R_PPC64_ADDR64 38 /* doubleword64 S + A */
+#define R_PPC64_ADDR16_HIGHER 39 /* half16 #higher(S + A) */
+#define R_PPC64_ADDR16_HIGHERA 40 /* half16 #highera(S + A) */
+#define R_PPC64_ADDR16_HIGHEST 41 /* half16 #highest(S + A) */
+#define R_PPC64_ADDR16_HIGHESTA 42 /* half16 #highesta(S + A) */
+#define R_PPC64_UADDR64 43 /* doubleword64 S + A */
+#define R_PPC64_REL64 44 /* doubleword64 S + A - P */
+#define R_PPC64_PLT64 45 /* doubleword64 L + A */
+#define R_PPC64_PLTREL64 46 /* doubleword64 L + A - P */
+#define R_PPC64_TOC16 47 /* half16* S + A - .TOC */
+#define R_PPC64_TOC16_LO 48 /* half16 #lo(S + A - .TOC.) */
+#define R_PPC64_TOC16_HI 49 /* half16 #hi(S + A - .TOC.) */
+#define R_PPC64_TOC16_HA 50 /* half16 #ha(S + A - .TOC.) */
+#define R_PPC64_TOC 51 /* doubleword64 .TOC */
+#define R_PPC64_PLTGOT16 52 /* half16* M + A */
+#define R_PPC64_PLTGOT16_LO 53 /* half16 #lo(M + A) */
+#define R_PPC64_PLTGOT16_HI 54 /* half16 #hi(M + A) */
+#define R_PPC64_PLTGOT16_HA 55 /* half16 #ha(M + A) */
+
+#define R_PPC64_ADDR16_DS 56 /* half16ds* (S + A) >> 2 */
+#define R_PPC64_ADDR16_LO_DS 57 /* half16ds #lo(S + A) >> 2 */
+#define R_PPC64_GOT16_DS 58 /* half16ds* (G + A) >> 2 */
+#define R_PPC64_GOT16_LO_DS 59 /* half16ds #lo(G + A) >> 2 */
+#define R_PPC64_PLT16_LO_DS 60 /* half16ds #lo(L + A) >> 2 */
+#define R_PPC64_SECTOFF_DS 61 /* half16ds* (R + A) >> 2 */
+#define R_PPC64_SECTOFF_LO_DS 62 /* half16ds #lo(R + A) >> 2 */
+#define R_PPC64_TOC16_DS 63 /* half16ds* (S + A - .TOC.) >> 2 */
+#define R_PPC64_TOC16_LO_DS 64 /* half16ds #lo(S + A - .TOC.) >> 2 */
+#define R_PPC64_PLTGOT16_DS 65 /* half16ds* (M + A) >> 2 */
+#define R_PPC64_PLTGOT16_LO_DS 66 /* half16ds #lo(M + A) >> 2 */
+
+/* PowerPC64 relocations defined for the TLS access ABI. */
+#define R_PPC64_TLS 67 /* none (sym+add)@tls */
+#define R_PPC64_DTPMOD64 68 /* doubleword64 (sym+add)@dtpmod */
+#define R_PPC64_TPREL16 69 /* half16* (sym+add)@tprel */
+#define R_PPC64_TPREL16_LO 70 /* half16 (sym+add)@tprel@l */
+#define R_PPC64_TPREL16_HI 71 /* half16 (sym+add)@tprel@h */
+#define R_PPC64_TPREL16_HA 72 /* half16 (sym+add)@tprel@ha */
+#define R_PPC64_TPREL64 73 /* doubleword64 (sym+add)@tprel */
+#define R_PPC64_DTPREL16 74 /* half16* (sym+add)@dtprel */
+#define R_PPC64_DTPREL16_LO 75 /* half16 (sym+add)@dtprel@l */
+#define R_PPC64_DTPREL16_HI 76 /* half16 (sym+add)@dtprel@h */
+#define R_PPC64_DTPREL16_HA 77 /* half16 (sym+add)@dtprel@ha */
+#define R_PPC64_DTPREL64 78 /* doubleword64 (sym+add)@dtprel */
+#define R_PPC64_GOT_TLSGD16 79 /* half16* (sym+add)@got@tlsgd */
+#define R_PPC64_GOT_TLSGD16_LO 80 /* half16 (sym+add)@got@tlsgd@l */
+#define R_PPC64_GOT_TLSGD16_HI 81 /* half16 (sym+add)@got@tlsgd@h */
+#define R_PPC64_GOT_TLSGD16_HA 82 /* half16 (sym+add)@got@tlsgd@ha */
+#define R_PPC64_GOT_TLSLD16 83 /* half16* (sym+add)@got@tlsld */
+#define R_PPC64_GOT_TLSLD16_LO 84 /* half16 (sym+add)@got@tlsld@l */
+#define R_PPC64_GOT_TLSLD16_HI 85 /* half16 (sym+add)@got@tlsld@h */
+#define R_PPC64_GOT_TLSLD16_HA 86 /* half16 (sym+add)@got@tlsld@ha */
+#define R_PPC64_GOT_TPREL16_DS 87 /* half16ds* (sym+add)@got@tprel */
+#define R_PPC64_GOT_TPREL16_LO_DS 88 /* half16ds (sym+add)@got@tprel@l */
+#define R_PPC64_GOT_TPREL16_HI 89 /* half16 (sym+add)@got@tprel@h */
+#define R_PPC64_GOT_TPREL16_HA 90 /* half16 (sym+add)@got@tprel@ha */
+#define R_PPC64_GOT_DTPREL16_DS 91 /* half16ds* (sym+add)@got@dtprel */
+#define R_PPC64_GOT_DTPREL16_LO_DS 92 /* half16ds (sym+add)@got@dtprel@l */
+#define R_PPC64_GOT_DTPREL16_HI 93 /* half16 (sym+add)@got@dtprel@h */
+#define R_PPC64_GOT_DTPREL16_HA 94 /* half16 (sym+add)@got@dtprel@ha */
+#define R_PPC64_TPREL16_DS 95 /* half16ds* (sym+add)@tprel */
+#define R_PPC64_TPREL16_LO_DS 96 /* half16ds (sym+add)@tprel@l */
+#define R_PPC64_TPREL16_HIGHER 97 /* half16 (sym+add)@tprel@higher */
+#define R_PPC64_TPREL16_HIGHERA 98 /* half16 (sym+add)@tprel@highera */
+#define R_PPC64_TPREL16_HIGHEST 99 /* half16 (sym+add)@tprel@highest */
+#define R_PPC64_TPREL16_HIGHESTA 100 /* half16 (sym+add)@tprel@highesta */
+#define R_PPC64_DTPREL16_DS 101 /* half16ds* (sym+add)@dtprel */
+#define R_PPC64_DTPREL16_LO_DS 102 /* half16ds (sym+add)@dtprel@l */
+#define R_PPC64_DTPREL16_HIGHER 103 /* half16 (sym+add)@dtprel@higher */
+#define R_PPC64_DTPREL16_HIGHERA 104 /* half16 (sym+add)@dtprel@highera */
+#define R_PPC64_DTPREL16_HIGHEST 105 /* half16 (sym+add)@dtprel@highest */
+#define R_PPC64_DTPREL16_HIGHESTA 106 /* half16 (sym+add)@dtprel@highesta */
+
+/* Keep this the last entry. */
+#define R_PPC64_NUM 107
+
+/* PowerPC64 specific values for the Dyn d_tag field. */
+#define DT_PPC64_GLINK (DT_LOPROC + 0)
+#define DT_PPC64_OPD (DT_LOPROC + 1)
+#define DT_PPC64_OPDSZ (DT_LOPROC + 2)
+#define DT_PPC64_NUM 3
+
+
+/* ARM specific declarations */
+
+/* Processor specific flags for the ELF header e_flags field. */
+#define EF_ARM_RELEXEC 0x01
+#define EF_ARM_HASENTRY 0x02
+#define EF_ARM_INTERWORK 0x04
+#define EF_ARM_APCS_26 0x08
+#define EF_ARM_APCS_FLOAT 0x10
+#define EF_ARM_PIC 0x20
+#define EF_ARM_ALIGN8 0x40 /* 8-bit structure alignment is in use */
+#define EF_ARM_NEW_ABI 0x80
+#define EF_ARM_OLD_ABI 0x100
+
+/* Other constants defined in the ARM ELF spec. version B-01. */
+/* NB. These conflict with values defined above. */
+#define EF_ARM_SYMSARESORTED 0x04
+#define EF_ARM_DYNSYMSUSESEGIDX 0x08
+#define EF_ARM_MAPSYMSFIRST 0x10
+#define EF_ARM_EABIMASK 0XFF000000
+
+#define EF_ARM_EABI_VERSION(flags) ((flags) & EF_ARM_EABIMASK)
+#define EF_ARM_EABI_UNKNOWN 0x00000000
+#define EF_ARM_EABI_VER1 0x01000000
+#define EF_ARM_EABI_VER2 0x02000000
+
+/* Additional symbol types for Thumb */
+#define STT_ARM_TFUNC 0xd
+
+/* ARM-specific values for sh_flags */
+#define SHF_ARM_ENTRYSECT 0x10000000 /* Section contains an entry point */
+#define SHF_ARM_COMDEF 0x80000000 /* Section may be multiply defined
+ in the input to a link step */
+
+/* ARM-specific program header flags */
+#define PF_ARM_SB 0x10000000 /* Segment contains the location
+ addressed by the static base */
+
+/* Processor specific values for the Phdr p_type field. */
+#define PT_ARM_EXIDX 0x70000001 /* .ARM.exidx segment */
+
+/* ARM relocs. */
+
+#define R_ARM_NONE 0 /* No reloc */
+#define R_ARM_PC24 1 /* PC relative 26 bit branch */
+#define R_ARM_ABS32 2 /* Direct 32 bit */
+#define R_ARM_REL32 3 /* PC relative 32 bit */
+#define R_ARM_PC13 4
+#define R_ARM_ABS16 5 /* Direct 16 bit */
+#define R_ARM_ABS12 6 /* Direct 12 bit */
+#define R_ARM_THM_ABS5 7
+#define R_ARM_ABS8 8 /* Direct 8 bit */
+#define R_ARM_SBREL32 9
+#define R_ARM_THM_PC22 10
+#define R_ARM_THM_PC8 11
+#define R_ARM_AMP_VCALL9 12
+#define R_ARM_SWI24 13
+#define R_ARM_THM_SWI8 14
+#define R_ARM_XPC25 15
+#define R_ARM_THM_XPC22 16
+#define R_ARM_TLS_DTPMOD32 17 /* ID of module containing symbol */
+#define R_ARM_TLS_DTPOFF32 18 /* Offset in TLS block */
+#define R_ARM_TLS_TPOFF32 19 /* Offset in static TLS block */
+#define R_ARM_COPY 20 /* Copy symbol at runtime */
+#define R_ARM_GLOB_DAT 21 /* Create GOT entry */
+#define R_ARM_JUMP_SLOT 22 /* Create PLT entry */
+#define R_ARM_RELATIVE 23 /* Adjust by program base */
+#define R_ARM_GOTOFF 24 /* 32 bit offset to GOT */
+#define R_ARM_GOTPC 25 /* 32 bit PC relative offset to GOT */
+#define R_ARM_GOT32 26 /* 32 bit GOT entry */
+#define R_ARM_PLT32 27 /* 32 bit PLT address */
+#define R_ARM_ALU_PCREL_7_0 32
+#define R_ARM_ALU_PCREL_15_8 33
+#define R_ARM_ALU_PCREL_23_15 34
+#define R_ARM_LDR_SBREL_11_0 35
+#define R_ARM_ALU_SBREL_19_12 36
+#define R_ARM_ALU_SBREL_27_20 37
+#define R_ARM_GNU_VTENTRY 100
+#define R_ARM_GNU_VTINHERIT 101
+#define R_ARM_THM_PC11 102 /* thumb unconditional branch */
+#define R_ARM_THM_PC9 103 /* thumb conditional branch */
+#define R_ARM_TLS_GD32 104 /* PC-rel 32 bit for global dynamic
+ thread local data */
+#define R_ARM_TLS_LDM32 105 /* PC-rel 32 bit for local dynamic
+ thread local data */
+#define R_ARM_TLS_LDO32 106 /* 32 bit offset relative to TLS
+ block */
+#define R_ARM_TLS_IE32 107 /* PC-rel 32 bit for GOT entry of
+ static TLS block offset */
+#define R_ARM_TLS_LE32 108 /* 32 bit offset relative to static
+ TLS block */
+#define R_ARM_RXPC25 249
+#define R_ARM_RSBREL32 250
+#define R_ARM_THM_RPC22 251
+#define R_ARM_RREL32 252
+#define R_ARM_RABS22 253
+#define R_ARM_RPC24 254
+#define R_ARM_RBASE 255
+/* Keep this the last entry. */
+#define R_ARM_NUM 256
+
+/* IA-64 specific declarations. */
+
+/* Processor specific flags for the Ehdr e_flags field. */
+#define EF_IA_64_MASKOS 0x0000000f /* os-specific flags */
+#define EF_IA_64_ABI64 0x00000010 /* 64-bit ABI */
+#define EF_IA_64_ARCH 0xff000000 /* arch. version mask */
+
+/* Processor specific values for the Phdr p_type field. */
+#define PT_IA_64_ARCHEXT (PT_LOPROC + 0) /* arch extension bits */
+#define PT_IA_64_UNWIND (PT_LOPROC + 1) /* ia64 unwind bits */
+#define PT_IA_64_HP_OPT_ANOT (PT_LOOS + 0x12)
+#define PT_IA_64_HP_HSL_ANOT (PT_LOOS + 0x13)
+#define PT_IA_64_HP_STACK (PT_LOOS + 0x14)
+
+/* Processor specific flags for the Phdr p_flags field. */
+#define PF_IA_64_NORECOV 0x80000000 /* spec insns w/o recovery */
+
+/* Processor specific values for the Shdr sh_type field. */
+#define SHT_IA_64_EXT (SHT_LOPROC + 0) /* extension bits */
+#define SHT_IA_64_UNWIND (SHT_LOPROC + 1) /* unwind bits */
+
+/* Processor specific flags for the Shdr sh_flags field. */
+#define SHF_IA_64_SHORT 0x10000000 /* section near gp */
+#define SHF_IA_64_NORECOV 0x20000000 /* spec insns w/o recovery */
+
+/* Processor specific values for the Dyn d_tag field. */
+#define DT_IA_64_PLT_RESERVE (DT_LOPROC + 0)
+#define DT_IA_64_NUM 1
+
+/* IA-64 relocations. */
+#define R_IA64_NONE 0x00 /* none */
+#define R_IA64_IMM14 0x21 /* symbol + addend, add imm14 */
+#define R_IA64_IMM22 0x22 /* symbol + addend, add imm22 */
+#define R_IA64_IMM64 0x23 /* symbol + addend, mov imm64 */
+#define R_IA64_DIR32MSB 0x24 /* symbol + addend, data4 MSB */
+#define R_IA64_DIR32LSB 0x25 /* symbol + addend, data4 LSB */
+#define R_IA64_DIR64MSB 0x26 /* symbol + addend, data8 MSB */
+#define R_IA64_DIR64LSB 0x27 /* symbol + addend, data8 LSB */
+#define R_IA64_GPREL22 0x2a /* @gprel(sym + add), add imm22 */
+#define R_IA64_GPREL64I 0x2b /* @gprel(sym + add), mov imm64 */
+#define R_IA64_GPREL32MSB 0x2c /* @gprel(sym + add), data4 MSB */
+#define R_IA64_GPREL32LSB 0x2d /* @gprel(sym + add), data4 LSB */
+#define R_IA64_GPREL64MSB 0x2e /* @gprel(sym + add), data8 MSB */
+#define R_IA64_GPREL64LSB 0x2f /* @gprel(sym + add), data8 LSB */
+#define R_IA64_LTOFF22 0x32 /* @ltoff(sym + add), add imm22 */
+#define R_IA64_LTOFF64I 0x33 /* @ltoff(sym + add), mov imm64 */
+#define R_IA64_PLTOFF22 0x3a /* @pltoff(sym + add), add imm22 */
+#define R_IA64_PLTOFF64I 0x3b /* @pltoff(sym + add), mov imm64 */
+#define R_IA64_PLTOFF64MSB 0x3e /* @pltoff(sym + add), data8 MSB */
+#define R_IA64_PLTOFF64LSB 0x3f /* @pltoff(sym + add), data8 LSB */
+#define R_IA64_FPTR64I 0x43 /* @fptr(sym + add), mov imm64 */
+#define R_IA64_FPTR32MSB 0x44 /* @fptr(sym + add), data4 MSB */
+#define R_IA64_FPTR32LSB 0x45 /* @fptr(sym + add), data4 LSB */
+#define R_IA64_FPTR64MSB 0x46 /* @fptr(sym + add), data8 MSB */
+#define R_IA64_FPTR64LSB 0x47 /* @fptr(sym + add), data8 LSB */
+#define R_IA64_PCREL60B 0x48 /* @pcrel(sym + add), brl */
+#define R_IA64_PCREL21B 0x49 /* @pcrel(sym + add), ptb, call */
+#define R_IA64_PCREL21M 0x4a /* @pcrel(sym + add), chk.s */
+#define R_IA64_PCREL21F 0x4b /* @pcrel(sym + add), fchkf */
+#define R_IA64_PCREL32MSB 0x4c /* @pcrel(sym + add), data4 MSB */
+#define R_IA64_PCREL32LSB 0x4d /* @pcrel(sym + add), data4 LSB */
+#define R_IA64_PCREL64MSB 0x4e /* @pcrel(sym + add), data8 MSB */
+#define R_IA64_PCREL64LSB 0x4f /* @pcrel(sym + add), data8 LSB */
+#define R_IA64_LTOFF_FPTR22 0x52 /* @ltoff(@fptr(s+a)), imm22 */
+#define R_IA64_LTOFF_FPTR64I 0x53 /* @ltoff(@fptr(s+a)), imm64 */
+#define R_IA64_LTOFF_FPTR32MSB 0x54 /* @ltoff(@fptr(s+a)), data4 MSB */
+#define R_IA64_LTOFF_FPTR32LSB 0x55 /* @ltoff(@fptr(s+a)), data4 LSB */
+#define R_IA64_LTOFF_FPTR64MSB 0x56 /* @ltoff(@fptr(s+a)), data8 MSB */
+#define R_IA64_LTOFF_FPTR64LSB 0x57 /* @ltoff(@fptr(s+a)), data8 LSB */
+#define R_IA64_SEGREL32MSB 0x5c /* @segrel(sym + add), data4 MSB */
+#define R_IA64_SEGREL32LSB 0x5d /* @segrel(sym + add), data4 LSB */
+#define R_IA64_SEGREL64MSB 0x5e /* @segrel(sym + add), data8 MSB */
+#define R_IA64_SEGREL64LSB 0x5f /* @segrel(sym + add), data8 LSB */
+#define R_IA64_SECREL32MSB 0x64 /* @secrel(sym + add), data4 MSB */
+#define R_IA64_SECREL32LSB 0x65 /* @secrel(sym + add), data4 LSB */
+#define R_IA64_SECREL64MSB 0x66 /* @secrel(sym + add), data8 MSB */
+#define R_IA64_SECREL64LSB 0x67 /* @secrel(sym + add), data8 LSB */
+#define R_IA64_REL32MSB 0x6c /* data 4 + REL */
+#define R_IA64_REL32LSB 0x6d /* data 4 + REL */
+#define R_IA64_REL64MSB 0x6e /* data 8 + REL */
+#define R_IA64_REL64LSB 0x6f /* data 8 + REL */
+#define R_IA64_LTV32MSB 0x74 /* symbol + addend, data4 MSB */
+#define R_IA64_LTV32LSB 0x75 /* symbol + addend, data4 LSB */
+#define R_IA64_LTV64MSB 0x76 /* symbol + addend, data8 MSB */
+#define R_IA64_LTV64LSB 0x77 /* symbol + addend, data8 LSB */
+#define R_IA64_PCREL21BI 0x79 /* @pcrel(sym + add), 21bit inst */
+#define R_IA64_PCREL22 0x7a /* @pcrel(sym + add), 22bit inst */
+#define R_IA64_PCREL64I 0x7b /* @pcrel(sym + add), 64bit inst */
+#define R_IA64_IPLTMSB 0x80 /* dynamic reloc, imported PLT, MSB */
+#define R_IA64_IPLTLSB 0x81 /* dynamic reloc, imported PLT, LSB */
+#define R_IA64_COPY 0x84 /* copy relocation */
+#define R_IA64_SUB 0x85 /* Addend and symbol difference */
+#define R_IA64_LTOFF22X 0x86 /* LTOFF22, relaxable. */
+#define R_IA64_LDXMOV 0x87 /* Use of LTOFF22X. */
+#define R_IA64_TPREL14 0x91 /* @tprel(sym + add), imm14 */
+#define R_IA64_TPREL22 0x92 /* @tprel(sym + add), imm22 */
+#define R_IA64_TPREL64I 0x93 /* @tprel(sym + add), imm64 */
+#define R_IA64_TPREL64MSB 0x96 /* @tprel(sym + add), data8 MSB */
+#define R_IA64_TPREL64LSB 0x97 /* @tprel(sym + add), data8 LSB */
+#define R_IA64_LTOFF_TPREL22 0x9a /* @ltoff(@tprel(s+a)), imm2 */
+#define R_IA64_DTPMOD64MSB 0xa6 /* @dtpmod(sym + add), data8 MSB */
+#define R_IA64_DTPMOD64LSB 0xa7 /* @dtpmod(sym + add), data8 LSB */
+#define R_IA64_LTOFF_DTPMOD22 0xaa /* @ltoff(@dtpmod(sym + add)), imm22 */
+#define R_IA64_DTPREL14 0xb1 /* @dtprel(sym + add), imm14 */
+#define R_IA64_DTPREL22 0xb2 /* @dtprel(sym + add), imm22 */
+#define R_IA64_DTPREL64I 0xb3 /* @dtprel(sym + add), imm64 */
+#define R_IA64_DTPREL32MSB 0xb4 /* @dtprel(sym + add), data4 MSB */
+#define R_IA64_DTPREL32LSB 0xb5 /* @dtprel(sym + add), data4 LSB */
+#define R_IA64_DTPREL64MSB 0xb6 /* @dtprel(sym + add), data8 MSB */
+#define R_IA64_DTPREL64LSB 0xb7 /* @dtprel(sym + add), data8 LSB */
+#define R_IA64_LTOFF_DTPREL22 0xba /* @ltoff(@dtprel(s+a)), imm22 */
+
+/* SH specific declarations */
+
+/* SH relocs. */
+#define R_SH_NONE 0
+#define R_SH_DIR32 1
+#define R_SH_REL32 2
+#define R_SH_DIR8WPN 3
+#define R_SH_IND12W 4
+#define R_SH_DIR8WPL 5
+#define R_SH_DIR8WPZ 6
+#define R_SH_DIR8BP 7
+#define R_SH_DIR8W 8
+#define R_SH_DIR8L 9
+#define R_SH_SWITCH16 25
+#define R_SH_SWITCH32 26
+#define R_SH_USES 27
+#define R_SH_COUNT 28
+#define R_SH_ALIGN 29
+#define R_SH_CODE 30
+#define R_SH_DATA 31
+#define R_SH_LABEL 32
+#define R_SH_SWITCH8 33
+#define R_SH_GNU_VTINHERIT 34
+#define R_SH_GNU_VTENTRY 35
+#define R_SH_TLS_GD_32 144
+#define R_SH_TLS_LD_32 145
+#define R_SH_TLS_LDO_32 146
+#define R_SH_TLS_IE_32 147
+#define R_SH_TLS_LE_32 148
+#define R_SH_TLS_DTPMOD32 149
+#define R_SH_TLS_DTPOFF32 150
+#define R_SH_TLS_TPOFF32 151
+#define R_SH_GOT32 160
+#define R_SH_PLT32 161
+#define R_SH_COPY 162
+#define R_SH_GLOB_DAT 163
+#define R_SH_JMP_SLOT 164
+#define R_SH_RELATIVE 165
+#define R_SH_GOTOFF 166
+#define R_SH_GOTPC 167
+/* Keep this the last entry. */
+#define R_SH_NUM 256
+
+/* Additional s390 relocs */
+
+#define R_390_NONE 0 /* No reloc. */
+#define R_390_8 1 /* Direct 8 bit. */
+#define R_390_12 2 /* Direct 12 bit. */
+#define R_390_16 3 /* Direct 16 bit. */
+#define R_390_32 4 /* Direct 32 bit. */
+#define R_390_PC32 5 /* PC relative 32 bit. */
+#define R_390_GOT12 6 /* 12 bit GOT offset. */
+#define R_390_GOT32 7 /* 32 bit GOT offset. */
+#define R_390_PLT32 8 /* 32 bit PC relative PLT address. */
+#define R_390_COPY 9 /* Copy symbol at runtime. */
+#define R_390_GLOB_DAT 10 /* Create GOT entry. */
+#define R_390_JMP_SLOT 11 /* Create PLT entry. */
+#define R_390_RELATIVE 12 /* Adjust by program base. */
+#define R_390_GOTOFF32 13 /* 32 bit offset to GOT. */
+#define R_390_GOTPC 14 /* 32 bit PC relative offset to GOT. */
+#define R_390_GOT16 15 /* 16 bit GOT offset. */
+#define R_390_PC16 16 /* PC relative 16 bit. */
+#define R_390_PC16DBL 17 /* PC relative 16 bit shifted by 1. */
+#define R_390_PLT16DBL 18 /* 16 bit PC rel. PLT shifted by 1. */
+#define R_390_PC32DBL 19 /* PC relative 32 bit shifted by 1. */
+#define R_390_PLT32DBL 20 /* 32 bit PC rel. PLT shifted by 1. */
+#define R_390_GOTPCDBL 21 /* 32 bit PC rel. GOT shifted by 1. */
+#define R_390_64 22 /* Direct 64 bit. */
+#define R_390_PC64 23 /* PC relative 64 bit. */
+#define R_390_GOT64 24 /* 64 bit GOT offset. */
+#define R_390_PLT64 25 /* 64 bit PC relative PLT address. */
+#define R_390_GOTENT 26 /* 32 bit PC rel. to GOT entry >> 1. */
+#define R_390_GOTOFF16 27 /* 16 bit offset to GOT. */
+#define R_390_GOTOFF64 28 /* 64 bit offset to GOT. */
+#define R_390_GOTPLT12 29 /* 12 bit offset to jump slot. */
+#define R_390_GOTPLT16 30 /* 16 bit offset to jump slot. */
+#define R_390_GOTPLT32 31 /* 32 bit offset to jump slot. */
+#define R_390_GOTPLT64 32 /* 64 bit offset to jump slot. */
+#define R_390_GOTPLTENT 33 /* 32 bit rel. offset to jump slot. */
+#define R_390_PLTOFF16 34 /* 16 bit offset from GOT to PLT. */
+#define R_390_PLTOFF32 35 /* 32 bit offset from GOT to PLT. */
+#define R_390_PLTOFF64 36 /* 16 bit offset from GOT to PLT. */
+#define R_390_TLS_LOAD 37 /* Tag for load insn in TLS code. */
+#define R_390_TLS_GDCALL 38 /* Tag for function call in general
+ dynamic TLS code. */
+#define R_390_TLS_LDCALL 39 /* Tag for function call in local
+ dynamic TLS code. */
+#define R_390_TLS_GD32 40 /* Direct 32 bit for general dynamic
+ thread local data. */
+#define R_390_TLS_GD64 41 /* Direct 64 bit for general dynamic
+ thread local data. */
+#define R_390_TLS_GOTIE12 42 /* 12 bit GOT offset for static TLS
+ block offset. */
+#define R_390_TLS_GOTIE32 43 /* 32 bit GOT offset for static TLS
+ block offset. */
+#define R_390_TLS_GOTIE64 44 /* 64 bit GOT offset for static TLS
+ block offset. */
+#define R_390_TLS_LDM32 45 /* Direct 32 bit for local dynamic
+ thread local data in LE code. */
+#define R_390_TLS_LDM64 46 /* Direct 64 bit for local dynamic
+ thread local data in LE code. */
+#define R_390_TLS_IE32 47 /* 32 bit address of GOT entry for
+ negated static TLS block offset. */
+#define R_390_TLS_IE64 48 /* 64 bit address of GOT entry for
+ negated static TLS block offset. */
+#define R_390_TLS_IEENT 49 /* 32 bit rel. offset to GOT entry for
+ negated static TLS block offset. */
+#define R_390_TLS_LE32 50 /* 32 bit negated offset relative to
+ static TLS block. */
+#define R_390_TLS_LE64 51 /* 64 bit negated offset relative to
+ static TLS block. */
+#define R_390_TLS_LDO32 52 /* 32 bit offset relative to TLS
+ block. */
+#define R_390_TLS_LDO64 53 /* 64 bit offset relative to TLS
+ block. */
+#define R_390_TLS_DTPMOD 54 /* ID of module containing symbol. */
+#define R_390_TLS_DTPOFF 55 /* Offset in TLS block. */
+#define R_390_TLS_TPOFF 56 /* Negated offset in static TLS
+ block. */
+#define R_390_20 57 /* Direct 20 bit. */
+#define R_390_GOT20 58 /* 20 bit GOT offset. */
+#define R_390_GOTPLT20 59 /* 20 bit offset to jump slot. */
+#define R_390_TLS_GOTIE20 60 /* 20 bit GOT offset for static TLS
+ block offset. */
+/* Keep this the last entry. */
+#define R_390_NUM 61
+
+
+/* CRIS relocations. */
+#define R_CRIS_NONE 0
+#define R_CRIS_8 1
+#define R_CRIS_16 2
+#define R_CRIS_32 3
+#define R_CRIS_8_PCREL 4
+#define R_CRIS_16_PCREL 5
+#define R_CRIS_32_PCREL 6
+#define R_CRIS_GNU_VTINHERIT 7
+#define R_CRIS_GNU_VTENTRY 8
+#define R_CRIS_COPY 9
+#define R_CRIS_GLOB_DAT 10
+#define R_CRIS_JUMP_SLOT 11
+#define R_CRIS_RELATIVE 12
+#define R_CRIS_16_GOT 13
+#define R_CRIS_32_GOT 14
+#define R_CRIS_16_GOTPLT 15
+#define R_CRIS_32_GOTPLT 16
+#define R_CRIS_32_GOTREL 17
+#define R_CRIS_32_PLT_GOTREL 18
+#define R_CRIS_32_PLT_PCREL 19
+
+#define R_CRIS_NUM 20
+
+
+/* AMD x86-64 relocations. */
+#define R_X86_64_NONE 0 /* No reloc */
+#define R_X86_64_64 1 /* Direct 64 bit */
+#define R_X86_64_PC32 2 /* PC relative 32 bit signed */
+#define R_X86_64_GOT32 3 /* 32 bit GOT entry */
+#define R_X86_64_PLT32 4 /* 32 bit PLT address */
+#define R_X86_64_COPY 5 /* Copy symbol at runtime */
+#define R_X86_64_GLOB_DAT 6 /* Create GOT entry */
+#define R_X86_64_JUMP_SLOT 7 /* Create PLT entry */
+#define R_X86_64_RELATIVE 8 /* Adjust by program base */
+#define R_X86_64_GOTPCREL 9 /* 32 bit signed PC relative
+ offset to GOT */
+#define R_X86_64_32 10 /* Direct 32 bit zero extended */
+#define R_X86_64_32S 11 /* Direct 32 bit sign extended */
+#define R_X86_64_16 12 /* Direct 16 bit zero extended */
+#define R_X86_64_PC16 13 /* 16 bit sign extended pc relative */
+#define R_X86_64_8 14 /* Direct 8 bit sign extended */
+#define R_X86_64_PC8 15 /* 8 bit sign extended pc relative */
+#define R_X86_64_DTPMOD64 16 /* ID of module containing symbol */
+#define R_X86_64_DTPOFF64 17 /* Offset in module's TLS block */
+#define R_X86_64_TPOFF64 18 /* Offset in initial TLS block */
+#define R_X86_64_TLSGD 19 /* 32 bit signed PC relative offset
+ to two GOT entries for GD symbol */
+#define R_X86_64_TLSLD 20 /* 32 bit signed PC relative offset
+ to two GOT entries for LD symbol */
+#define R_X86_64_DTPOFF32 21 /* Offset in TLS block */
+#define R_X86_64_GOTTPOFF 22 /* 32 bit signed PC relative offset
+ to GOT entry for IE symbol */
+#define R_X86_64_TPOFF32 23 /* Offset in initial TLS block */
+
+#define R_X86_64_NUM 24
+
+
+/* AM33 relocations. */
+#define R_MN10300_NONE 0 /* No reloc. */
+#define R_MN10300_32 1 /* Direct 32 bit. */
+#define R_MN10300_16 2 /* Direct 16 bit. */
+#define R_MN10300_8 3 /* Direct 8 bit. */
+#define R_MN10300_PCREL32 4 /* PC-relative 32-bit. */
+#define R_MN10300_PCREL16 5 /* PC-relative 16-bit signed. */
+#define R_MN10300_PCREL8 6 /* PC-relative 8-bit signed. */
+#define R_MN10300_GNU_VTINHERIT 7 /* Ancient C++ vtable garbage... */
+#define R_MN10300_GNU_VTENTRY 8 /* ... collection annotation. */
+#define R_MN10300_24 9 /* Direct 24 bit. */
+#define R_MN10300_GOTPC32 10 /* 32-bit PCrel offset to GOT. */
+#define R_MN10300_GOTPC16 11 /* 16-bit PCrel offset to GOT. */
+#define R_MN10300_GOTOFF32 12 /* 32-bit offset from GOT. */
+#define R_MN10300_GOTOFF24 13 /* 24-bit offset from GOT. */
+#define R_MN10300_GOTOFF16 14 /* 16-bit offset from GOT. */
+#define R_MN10300_PLT32 15 /* 32-bit PCrel to PLT entry. */
+#define R_MN10300_PLT16 16 /* 16-bit PCrel to PLT entry. */
+#define R_MN10300_GOT32 17 /* 32-bit offset to GOT entry. */
+#define R_MN10300_GOT24 18 /* 24-bit offset to GOT entry. */
+#define R_MN10300_GOT16 19 /* 16-bit offset to GOT entry. */
+#define R_MN10300_COPY 20 /* Copy symbol at runtime. */
+#define R_MN10300_GLOB_DAT 21 /* Create GOT entry. */
+#define R_MN10300_JMP_SLOT 22 /* Create PLT entry. */
+#define R_MN10300_RELATIVE 23 /* Adjust by program base. */
+
+#define R_MN10300_NUM 24
+
+
+/* M32R relocs. */
+#define R_M32R_NONE 0 /* No reloc. */
+#define R_M32R_16 1 /* Direct 16 bit. */
+#define R_M32R_32 2 /* Direct 32 bit. */
+#define R_M32R_24 3 /* Direct 24 bit. */
+#define R_M32R_10_PCREL 4 /* PC relative 10 bit shifted. */
+#define R_M32R_18_PCREL 5 /* PC relative 18 bit shifted. */
+#define R_M32R_26_PCREL 6 /* PC relative 26 bit shifted. */
+#define R_M32R_HI16_ULO 7 /* High 16 bit with unsigned low. */
+#define R_M32R_HI16_SLO 8 /* High 16 bit with signed low. */
+#define R_M32R_LO16 9 /* Low 16 bit. */
+#define R_M32R_SDA16 10 /* 16 bit offset in SDA. */
+#define R_M32R_GNU_VTINHERIT 11
+#define R_M32R_GNU_VTENTRY 12
+/* M32R relocs use SHT_RELA. */
+#define R_M32R_16_RELA 33 /* Direct 16 bit. */
+#define R_M32R_32_RELA 34 /* Direct 32 bit. */
+#define R_M32R_24_RELA 35 /* Direct 24 bit. */
+#define R_M32R_10_PCREL_RELA 36 /* PC relative 10 bit shifted. */
+#define R_M32R_18_PCREL_RELA 37 /* PC relative 18 bit shifted. */
+#define R_M32R_26_PCREL_RELA 38 /* PC relative 26 bit shifted. */
+#define R_M32R_HI16_ULO_RELA 39 /* High 16 bit with unsigned low */
+#define R_M32R_HI16_SLO_RELA 40 /* High 16 bit with signed low */
+#define R_M32R_LO16_RELA 41 /* Low 16 bit */
+#define R_M32R_SDA16_RELA 42 /* 16 bit offset in SDA */
+#define R_M32R_RELA_GNU_VTINHERIT 43
+#define R_M32R_RELA_GNU_VTENTRY 44
+#define R_M32R_REL32 45 /* PC relative 32 bit. */
+
+#define R_M32R_GOT24 48 /* 24 bit GOT entry */
+#define R_M32R_26_PLTREL 49 /* 26 bit PC relative to PLT shifted */
+#define R_M32R_COPY 50 /* Copy symbol at runtime */
+#define R_M32R_GLOB_DAT 51 /* Create GOT entry */
+#define R_M32R_JMP_SLOT 52 /* Create PLT entry */
+#define R_M32R_RELATIVE 53 /* Adjust by program base */
+#define R_M32R_GOTOFF 54 /* 24 bit offset to GOT */
+#define R_M32R_GOTPC24 55 /* 24 bit PC relative offset to GOT */
+#define R_M32R_GOT16_HI_ULO 56 /* High 16 bit GOT entry with unsigned
+ low */
+#define R_M32R_GOT16_HI_SLO 57 /* High 16 bit GOT entry with signed
+ low */
+#define R_M32R_GOT16_LO 58 /* Low 16 bit GOT entry */
+#define R_M32R_GOTPC_HI_ULO 59 /* High 16 bit PC relative offset to
+ GOT with unsigned low */
+#define R_M32R_GOTPC_HI_SLO 60 /* High 16 bit PC relative offset to
+ GOT with signed low */
+#define R_M32R_GOTPC_LO 61 /* Low 16 bit PC relative offset to
+ GOT */
+#define R_M32R_GOTOFF_HI_ULO 62 /* High 16 bit offset to GOT
+ with unsigned low */
+#define R_M32R_GOTOFF_HI_SLO 63 /* High 16 bit offset to GOT
+ with signed low */
+#define R_M32R_GOTOFF_LO 64 /* Low 16 bit offset to GOT */
+#define R_M32R_NUM 256 /* Keep this the last entry. */
+
+
+__END_DECLS
+
+#endif /* elf.h */
diff --git a/sysroot/usr/include/endian.h b/sysroot/usr/include/endian.h
new file mode 100644
index 0000000..2f7bce1
--- /dev/null
+++ b/sysroot/usr/include/endian.h
@@ -0,0 +1,58 @@
+/* Copyright (C) 1992, 1996, 1997, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _ENDIAN_H
+#define _ENDIAN_H 1
+
+#include <features.h>
+
+/* Definitions for byte order, according to significance of bytes,
+ from low addresses to high addresses. The value is what you get by
+ putting '4' in the most significant byte, '3' in the second most
+ significant byte, '2' in the second least significant byte, and '1'
+ in the least significant byte, and then writing down one digit for
+ each byte, starting with the byte at the lowest address at the left,
+ and proceeding to the byte with the highest address at the right. */
+
+#define __LITTLE_ENDIAN 1234
+#define __BIG_ENDIAN 4321
+#define __PDP_ENDIAN 3412
+
+/* This file defines `__BYTE_ORDER' for the particular machine. */
+#include <bits/endian.h>
+
+/* Some machines may need to use a different endianness for floating point
+ values. */
+#ifndef __FLOAT_WORD_ORDER
+# define __FLOAT_WORD_ORDER __BYTE_ORDER
+#endif
+
+#ifdef __USE_BSD
+# define LITTLE_ENDIAN __LITTLE_ENDIAN
+# define BIG_ENDIAN __BIG_ENDIAN
+# define PDP_ENDIAN __PDP_ENDIAN
+# define BYTE_ORDER __BYTE_ORDER
+#endif
+
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+# define __LONG_LONG_PAIR(HI, LO) LO, HI
+#elif __BYTE_ORDER == __BIG_ENDIAN
+# define __LONG_LONG_PAIR(HI, LO) HI, LO
+#endif
+
+#endif /* endian.h */
diff --git a/sysroot/usr/include/envz.h b/sysroot/usr/include/envz.h
new file mode 100644
index 0000000..3542ded
--- /dev/null
+++ b/sysroot/usr/include/envz.h
@@ -0,0 +1,74 @@
+/* Routines for dealing with '\0' separated environment vectors
+ Copyright (C) 1995, 96, 98, 99, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _ENVZ_H
+#define _ENVZ_H 1
+
+#include <features.h>
+
+#include <errno.h>
+
+/* Envz's are argz's too, and should be created etc., using the same
+ routines. */
+#include <argz.h>
+
+__BEGIN_DECLS
+
+/* Returns a pointer to the entry in ENVZ for NAME, or 0 if there is none. */
+extern char *envz_entry (__const char *__restrict __envz, size_t __envz_len,
+ __const char *__restrict __name)
+ __THROW __attribute_pure__;
+
+/* Returns a pointer to the value portion of the entry in ENVZ for NAME, or 0
+ if there is none. */
+extern char *envz_get (__const char *__restrict __envz, size_t __envz_len,
+ __const char *__restrict __name)
+ __THROW __attribute_pure__;
+
+/* Adds an entry for NAME with value VALUE to ENVZ & ENVZ_LEN. If an entry
+ with the same name already exists in ENVZ, it is removed. If VALUE is
+ NULL, then the new entry will a special null one, for which envz_get will
+ return NULL, although envz_entry will still return an entry; this is handy
+ because when merging with another envz, the null entry can override an
+ entry in the other one. Null entries can be removed with envz_strip (). */
+extern error_t envz_add (char **__restrict __envz,
+ size_t *__restrict __envz_len,
+ __const char *__restrict __name,
+ __const char *__restrict __value) __THROW;
+
+/* Adds each entry in ENVZ2 to ENVZ & ENVZ_LEN, as if with envz_add(). If
+ OVERRIDE is true, then values in ENVZ2 will supersede those with the same
+ name in ENV, otherwise not. */
+extern error_t envz_merge (char **__restrict __envz,
+ size_t *__restrict __envz_len,
+ __const char *__restrict __envz2,
+ size_t __envz2_len, int __override) __THROW;
+
+/* Remove the entry for NAME from ENVZ & ENVZ_LEN, if any. */
+extern void envz_remove (char **__restrict __envz,
+ size_t *__restrict __envz_len,
+ __const char *__restrict __name) __THROW;
+
+/* Remove null entries. */
+extern void envz_strip (char **__restrict __envz,
+ size_t *__restrict __envz_len) __THROW;
+
+__END_DECLS
+
+#endif /* envz.h */
diff --git a/sysroot/usr/include/err.h b/sysroot/usr/include/err.h
new file mode 100644
index 0000000..7ff3553
--- /dev/null
+++ b/sysroot/usr/include/err.h
@@ -0,0 +1,58 @@
+/* 4.4BSD utility functions for error messages.
+ Copyright (C) 1995,1996,1997,1998,1999,2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _ERR_H
+#define _ERR_H 1
+
+#include <features.h>
+
+#define __need___va_list
+#include <stdarg.h>
+#ifndef __GNUC_VA_LIST
+# define __gnuc_va_list __ptr_t
+#endif
+
+__BEGIN_DECLS
+
+/* Print "program: ", FORMAT, ": ", the standard error string for errno,
+ and a newline, on stderr. */
+extern void warn (__const char *__format, ...)
+ __attribute__ ((__format__ (__printf__, 1, 2)));
+extern void vwarn (__const char *__format, __gnuc_va_list)
+ __attribute__ ((__format__ (__printf__, 1, 0)));
+
+/* Likewise, but without ": " and the standard error string. */
+extern void warnx (__const char *__format, ...)
+ __attribute__ ((__format__ (__printf__, 1, 2)));
+extern void vwarnx (__const char *__format, __gnuc_va_list)
+ __attribute__ ((__format__ (__printf__, 1, 0)));
+
+/* Likewise, and then exit with STATUS. */
+extern void err (int __status, __const char *__format, ...)
+ __attribute__ ((__noreturn__, __format__ (__printf__, 2, 3)));
+extern void verr (int __status, __const char *__format, __gnuc_va_list)
+ __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0)));
+extern void errx (int __status, __const char *__format, ...)
+ __attribute__ ((__noreturn__, __format__ (__printf__, 2, 3)));
+extern void verrx (int __status, __const char *, __gnuc_va_list)
+ __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0)));
+
+__END_DECLS
+
+#endif /* err.h */
diff --git a/sysroot/usr/include/errno.h b/sysroot/usr/include/errno.h
new file mode 100644
index 0000000..f33b0c9
--- /dev/null
+++ b/sysroot/usr/include/errno.h
@@ -0,0 +1,73 @@
+/* Copyright (C) 1991,92,93,94,95,96,97,2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99 Standard: 7.5 Errors <errno.h>
+ */
+
+#ifndef _ERRNO_H
+
+/* The includer defined __need_Emath if he wants only the definitions
+ of EDOM and ERANGE, and not everything else. */
+#ifndef __need_Emath
+# define _ERRNO_H 1
+# include <features.h>
+#endif
+
+__BEGIN_DECLS
+
+/* Get the error number constants from the system-specific file.
+ This file will test __need_Emath and _ERRNO_H. */
+#include <bits/errno.h>
+#undef __need_Emath
+
+#ifdef _ERRNO_H
+
+/* Declare the `errno' variable, unless it's defined as a macro by
+ bits/errno.h. This is the case in GNU, where it is a per-thread
+ variable. This redeclaration using the macro still works, but it
+ will be a function declaration without a prototype and may trigger
+ a -Wstrict-prototypes warning. */
+#ifndef errno
+extern int errno;
+#endif
+
+#ifdef __USE_GNU
+
+/* The full and simple forms of the name with which the program was
+ invoked. These variables are set up automatically at startup based on
+ the value of ARGV[0] (this works only if you use GNU ld). */
+extern char *program_invocation_name, *program_invocation_short_name;
+#endif /* __USE_GNU */
+#endif /* _ERRNO_H */
+
+__END_DECLS
+
+#endif /* _ERRNO_H */
+
+/* The Hurd <bits/errno.h> defines `error_t' as an enumerated type so
+ that printing `error_t' values in the debugger shows the names. We
+ might need this definition sometimes even if this file was included
+ before. */
+#if defined __USE_GNU || defined __need_error_t
+# ifndef __error_t_defined
+typedef int error_t;
+# define __error_t_defined 1
+# endif
+# undef __need_error_t
+#endif
diff --git a/sysroot/usr/include/error.h b/sysroot/usr/include/error.h
new file mode 100644
index 0000000..00321e4
--- /dev/null
+++ b/sysroot/usr/include/error.h
@@ -0,0 +1,58 @@
+/* Declaration for error-reporting function
+ Copyright (C) 1995,1996,1997,2003,2006,2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _ERROR_H
+#define _ERROR_H 1
+
+#include <features.h>
+
+
+__BEGIN_DECLS
+
+/* Print a message with `fprintf (stderr, FORMAT, ...)';
+ if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
+ If STATUS is nonzero, terminate the program with `exit (STATUS)'. */
+
+extern void error (int __status, int __errnum, __const char *__format, ...)
+ __attribute__ ((__format__ (__printf__, 3, 4)));
+
+extern void error_at_line (int __status, int __errnum, __const char *__fname,
+ unsigned int __lineno, __const char *__format, ...)
+ __attribute__ ((__format__ (__printf__, 5, 6)));
+
+/* If NULL, error will flush stdout, then print on stderr the program
+ name, a colon and a space. Otherwise, error will call this
+ function without parameters instead. */
+extern void (*error_print_progname) (void);
+
+/* This variable is incremented each time `error' is called. */
+extern unsigned int error_message_count;
+
+/* Sometimes we want to have at most one error per line. This
+ variable controls whether this mode is selected or not. */
+extern int error_one_per_line;
+
+
+#if defined __extern_always_inline && defined __va_arg_pack
+# include <bits/error.h>
+#endif
+
+__END_DECLS
+
+#endif /* error.h */
diff --git a/sysroot/usr/include/esd.h b/sysroot/usr/include/esd.h
new file mode 100644
index 0000000..4a95ce0
--- /dev/null
+++ b/sysroot/usr/include/esd.h
@@ -0,0 +1,340 @@
+#ifndef ESD_H
+#define ESD_H
+#include <audiofile.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* path and name of the default EsounD domain socket */
+#define ESD_UNIX_SOCKET_DIR esd_get_socket_dirname()
+#define ESD_UNIX_SOCKET_NAME esd_get_socket_name()
+
+/* size of the audio buffer */
+#define ESD_BUF_SIZE (4 * 1024)
+
+/* length of the authorization key, octets */
+#define ESD_KEY_LEN (16)
+
+/* default port for the EsounD server */
+#define ESD_DEFAULT_PORT (16001)
+
+/* default sample rate for the EsounD server */
+#define ESD_DEFAULT_RATE (44100)
+
+/* maximum length of a stream/sample name */
+#define ESD_NAME_MAX (128)
+
+/* a magic number to identify the relative endianness of a client */
+#define ESD_ENDIAN_KEY \
+ ( (unsigned int) ( ('E' << 24) + ('N' << 16) + ('D' << 8) + ('N') ) )
+
+#define ESD_VOLUME_BASE (256)
+
+/*************************************/
+/* what can we do to/with the EsounD */
+enum esd_proto {
+ ESD_PROTO_CONNECT, /* implied on inital client connection */
+
+ /* pseudo "security" functionality */
+ ESD_PROTO_LOCK, /* disable "foreign" client connections */
+ ESD_PROTO_UNLOCK, /* enable "foreign" client connections */
+
+ /* stream functionality: play, record, monitor */
+ ESD_PROTO_STREAM_PLAY, /* play all following data as a stream */
+ ESD_PROTO_STREAM_REC, /* record data from card as a stream */
+ ESD_PROTO_STREAM_MON, /* send mixed buffer output as a stream */
+
+ /* sample functionality: cache, free, play, loop, EOL, kill */
+ ESD_PROTO_SAMPLE_CACHE, /* cache a sample in the server */
+ ESD_PROTO_SAMPLE_FREE, /* release a sample in the server */
+ ESD_PROTO_SAMPLE_PLAY, /* play a cached sample */
+ ESD_PROTO_SAMPLE_LOOP, /* loop a cached sample, til eoloop */
+ ESD_PROTO_SAMPLE_STOP, /* stop a looping sample when done */
+ ESD_PROTO_SAMPLE_KILL, /* stop the looping sample immed. */
+
+ /* free and reclaim /dev/dsp functionality */
+ ESD_PROTO_STANDBY, /* release /dev/dsp and ignore all data */
+ ESD_PROTO_RESUME, /* reclaim /dev/dsp and play sounds again */
+
+ /* TODO: move these to a more logical place. NOTE: will break the protocol */
+ ESD_PROTO_SAMPLE_GETID, /* get the ID for an already-cached sample */
+ ESD_PROTO_STREAM_FILT, /* filter mixed buffer output as a stream */
+
+ /* esd remote management */
+ ESD_PROTO_SERVER_INFO, /* get server info (ver, sample rate, format) */
+ ESD_PROTO_ALL_INFO, /* get all info (server info, players, samples) */
+ ESD_PROTO_SUBSCRIBE, /* track new and removed players and samples */
+ ESD_PROTO_UNSUBSCRIBE, /* stop tracking updates */
+
+ /* esd remote control */
+ ESD_PROTO_STREAM_PAN, /* set stream panning */
+ ESD_PROTO_SAMPLE_PAN, /* set default sample panning */
+
+ /* esd status */
+ ESD_PROTO_STANDBY_MODE, /* see if server is in standby, autostandby, etc */
+
+ /* esd latency */
+ ESD_PROTO_LATENCY, /* retrieve latency between write()'s and output */
+
+ ESD_PROTO_MAX /* for bounds checking */
+};
+
+
+/******************/
+/* The EsounD api */
+
+/* the properties of a sound buffer are logically or'd */
+
+/* bits of stream/sample data */
+#define ESD_MASK_BITS ( 0x000F )
+#define ESD_BITS8 ( 0x0000 )
+#define ESD_BITS16 ( 0x0001 )
+
+/* how many interleaved channels of data */
+#define ESD_MASK_CHAN ( 0x00F0 )
+#define ESD_MONO ( 0x0010 )
+#define ESD_STEREO ( 0x0020 )
+
+/* whether it's a stream or a sample */
+#define ESD_MASK_MODE ( 0x0F00 )
+#define ESD_STREAM ( 0x0000 )
+#define ESD_SAMPLE ( 0x0100 )
+#define ESD_ADPCM ( 0x0200 ) /* TODO: anyone up for this? =P */
+
+/* the function of the stream/sample, and common functions */
+#define ESD_MASK_FUNC ( 0xF000 )
+#define ESD_PLAY ( 0x1000 )
+/* functions for streams only */
+#define ESD_MONITOR ( 0x0000 )
+#define ESD_RECORD ( 0x2000 )
+/* functions for samples only */
+#define ESD_STOP ( 0x0000 )
+#define ESD_LOOP ( 0x2000 )
+
+typedef int esd_format_t;
+typedef int esd_proto_t;
+
+/*******************************************************************/
+/* client side API for playing sounds */
+
+typedef unsigned char octet;
+
+/*******************************************************************/
+/* esdlib.c - basic esd client interface functions */
+
+/* opens channel, authenticates connection, and prefares for protos */
+/* returns EsounD socket for communication, result < 0 = error */
+/* server = listen socket (localhost:5001, 192.168.168.0:9999 */
+/* rate, format = (bits | channels | stream | func) */
+int esd_open_sound( const char *host );
+
+/* send the authorization cookie, create one if needed */
+int esd_send_auth( int sock );
+
+/* lock/unlock will disable/enable foreign clients from connecting */
+int esd_lock( int esd );
+int esd_unlock( int esd );
+
+/* standby/resume will free/reclaim audio device so others may use it */
+int esd_standby( int esd );
+int esd_resume( int esd );
+
+/* open a socket for playing, monitoring, or recording as a stream */
+/* the *_fallback functions try to open /dev/dsp if there's no EsounD */
+int esd_play_stream( esd_format_t format, int rate,
+ const char *host, const char *name );
+int esd_play_stream_fallback( esd_format_t format, int rate,
+ const char *host, const char *name );
+int esd_monitor_stream( esd_format_t format, int rate,
+ const char *host, const char *name );
+/* int esd_monitor_stream_fallback( esd_format_t format, int rate ); */
+int esd_record_stream( esd_format_t format, int rate,
+ const char *host, const char *name );
+int esd_record_stream_fallback( esd_format_t format, int rate,
+ const char *host, const char *name );
+int esd_filter_stream( esd_format_t format, int rate,
+ const char *host, const char *name );
+
+/* cache a sample in the server returns sample id, < 0 = error */
+int esd_sample_cache( int esd, esd_format_t format, const int rate,
+ const int length, const char *name );
+int esd_confirm_sample_cache( int esd );
+
+/* get the sample id for an already-cached sample */
+int esd_sample_getid( int esd, const char *name);
+
+/* uncache a sample in the server */
+int esd_sample_free( int esd, int sample );
+
+/* play a cached sample once */
+int esd_sample_play( int esd, int sample );
+/* make a cached sample loop */
+int esd_sample_loop( int esd, int sample );
+
+/* stop the looping sample at end */
+int esd_sample_stop( int esd, int sample );
+/* stop a playing sample immed. */
+int esd_sample_kill( int esd, int sample );
+
+/* closes fd, previously obtained by esd_open */
+int esd_close( int esd );
+
+/* get the stream latency to esound (latency is number of samples */
+/* at 44.1khz stereo 16 bit - you'll have to adjust if oyur input */
+/* sampling rate is less (in bytes per second) */
+/* so if you're at 44.1khz stereo 16bit in your stream - your lag */
+/* in bytes woudl be lag * 2 * 2 bytes (2 for stereo, 2 for 16bit) */
+/* if your stream is at 22.05 Khz it'll be double this - in mono */
+/* double again ... etc. */
+int esd_get_latency(int esd);
+
+
+/*******************************************************************/
+/* esdmgr.c - functions to implement a "sound manager" for esd */
+
+/* structures to retrieve information about streams/samples from the server */
+typedef struct esd_server_info {
+
+ int version; /* server version encoded as an int */
+ esd_format_t format; /* magic int with the format info */
+ int rate; /* sample rate */
+
+} esd_server_info_t;
+
+typedef struct esd_player_info {
+
+ struct esd_player_info *next; /* point to next entry in list */
+ esd_server_info_t *server; /* the server that contains this stream */
+
+ int source_id; /* either a stream fd or sample id */
+ char name[ ESD_NAME_MAX ]; /* name of stream for remote control */
+ int rate; /* sample rate */
+ int left_vol_scale; /* volume scaling */
+ int right_vol_scale;
+
+ esd_format_t format; /* magic int with the format info */
+
+} esd_player_info_t;
+
+typedef struct esd_sample_info {
+
+ struct esd_sample_info *next; /* point to next entry in list */
+ esd_server_info_t *server; /* the server that contains this sample */
+
+ int sample_id; /* either a stream fd or sample id */
+ char name[ ESD_NAME_MAX ]; /* name of stream for remote control */
+ int rate; /* sample rate */
+ int left_vol_scale; /* volume scaling */
+ int right_vol_scale;
+
+ esd_format_t format; /* magic int with the format info */
+ int length; /* total buffer length */
+
+} esd_sample_info_t;
+
+typedef struct esd_info {
+
+ esd_server_info_t *server;
+ esd_player_info_t *player_list;
+ esd_sample_info_t *sample_list;
+
+} esd_info_t;
+
+enum esd_standby_mode {
+ ESM_ERROR, ESM_ON_STANDBY, ESM_ON_AUTOSTANDBY, ESM_RUNNING
+};
+typedef int esd_standby_mode_t;
+
+/* define callbacks for esd_update_info() */
+/* what to do when a stream connects, or sample is played */
+typedef int esd_new_player_callback_t( esd_player_info_t * );
+/* what to do when a stream disconnects, or sample stops playing */
+typedef int esd_old_player_callback_t( esd_player_info_t * );
+/* what to do when a sample is cached */
+typedef int esd_new_sample_callback_t( esd_sample_info_t * );
+/* what to do when a sample is uncached */
+typedef int esd_old_sample_callback_t( esd_sample_info_t * );
+
+typedef struct esd_update_info_callbacks {
+ esd_new_player_callback_t *esd_new_player_callback;
+ esd_old_player_callback_t *esd_old_player_callback;
+ esd_new_sample_callback_t *esd_new_sample_callback;
+ esd_old_sample_callback_t *esd_old_sample_callback;
+} esd_update_info_callbacks_t;
+
+/* print server into to stdout */
+void esd_print_server_info( esd_server_info_t *server_info );
+void esd_print_player_info( esd_player_info_t *player_info );
+void esd_print_sample_info( esd_sample_info_t *sample_info );
+/* print all info to stdout */
+void esd_print_all_info( esd_info_t *all_info );
+
+/* retrieve server properties (sample rate, format, version number) */
+esd_server_info_t *esd_get_server_info( int esd );
+/* release all memory allocated for the server properties structure */
+void esd_free_server_info( esd_server_info_t *server_info );
+
+/* retrieve all information from server */
+esd_info_t *esd_get_all_info( int esd );
+
+/* retrieve all information from server, and update until unsubsribed or closed */
+esd_info_t *esd_subscribe_all_info( int esd );
+
+/* call to update the info structure with new information, and call callbacks */
+esd_info_t *esd_update_info( int esd, esd_info_t *info,
+ esd_update_info_callbacks_t *callbacks );
+esd_info_t *esd_unsubscribe_info( int esd );
+
+/* release all memory allocated for the esd info structure */
+void esd_free_all_info( esd_info_t *info );
+
+
+/* reset the volume panning for a stream */
+int esd_set_stream_pan( int esd, int stream_id,
+ int left_scale, int right_scale );
+
+/* reset the default volume panning for a sample */
+int esd_set_default_sample_pan( int esd, int sample_id,
+ int left_scale, int right_scale );
+
+/* see if the server is in stnaby, autostandby, etc */
+esd_standby_mode_t esd_get_standby_mode( int esd );
+
+
+/*******************************************************************/
+/* esdfile.c - audiofile wrappers for sane handling of files */
+
+int esd_send_file( int esd, AFfilehandle au_file, int frame_length );
+int esd_play_file( const char *name_prefix, const char *filename, int fallback );
+int esd_file_cache( int esd, const char *name_prefix, const char *filename );
+
+
+/*******************************************************************/
+/* audio.c - abstract the sound hardware for cross platform usage */
+extern esd_format_t esd_audio_format;
+extern int esd_audio_rate;
+extern char *esd_audio_device;
+
+const char *esd_audio_devices( void );
+int esd_audio_open( void );
+void esd_audio_close( void );
+void esd_audio_pause( void );
+int esd_audio_write( void *buffer, int buf_size );
+int esd_audio_read( void *buffer, int buf_size );
+void esd_audio_flush( void );
+
+/******************************************************************/
+/* util.c utilities */
+
+const char *esd_get_socket_dirname( void );
+const char *esd_get_socket_name( void );
+
+int have_ipv6( void );
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* #ifndef ESD_H */
diff --git a/sysroot/usr/include/eti.h b/sysroot/usr/include/eti.h
new file mode 100644
index 0000000..baa6190
--- /dev/null
+++ b/sysroot/usr/include/eti.h
@@ -0,0 +1,54 @@
+/****************************************************************************
+ * Copyright (c) 1998-2002,2003 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Juergen Pfeifer, 1995,1997 *
+ ****************************************************************************/
+
+/* $Id: eti.h,v 1.8 2003/10/25 15:24:29 tom Exp $ */
+
+#ifndef NCURSES_ETI_H_incl
+#define NCURSES_ETI_H_incl 1
+
+#define E_OK (0)
+#define E_SYSTEM_ERROR (-1)
+#define E_BAD_ARGUMENT (-2)
+#define E_POSTED (-3)
+#define E_CONNECTED (-4)
+#define E_BAD_STATE (-5)
+#define E_NO_ROOM (-6)
+#define E_NOT_POSTED (-7)
+#define E_UNKNOWN_COMMAND (-8)
+#define E_NO_MATCH (-9)
+#define E_NOT_SELECTABLE (-10)
+#define E_NOT_CONNECTED (-11)
+#define E_REQUEST_DENIED (-12)
+#define E_INVALID_FIELD (-13)
+#define E_CURRENT (-14)
+
+#endif
diff --git a/sysroot/usr/include/etip.h b/sysroot/usr/include/etip.h
new file mode 100644
index 0000000..96b4510
--- /dev/null
+++ b/sysroot/usr/include/etip.h
@@ -0,0 +1,372 @@
+// * This makes emacs happy -*-Mode: C++;-*-
+/****************************************************************************
+ * Copyright (c) 1998-2005,2007 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Juergen Pfeifer, 1997 *
+ ****************************************************************************/
+
+// $Id: etip.h.in,v 1.36 2007/04/07 18:56:32 tom Exp $
+
+#ifndef NCURSES_ETIP_H_incl
+#define NCURSES_ETIP_H_incl 1
+
+// These are substituted at configure/build time
+#ifndef HAVE_BUILTIN_H
+#define HAVE_BUILTIN_H 0
+#endif
+
+#ifndef HAVE_GXX_BUILTIN_H
+#define HAVE_GXX_BUILTIN_H 0
+#endif
+
+#ifndef HAVE_GPP_BUILTIN_H
+#define HAVE_GPP_BUILTIN_H 0
+#endif
+
+#ifndef HAVE_IOSTREAM
+#define HAVE_IOSTREAM 1
+#endif
+
+#ifndef HAVE_TYPEINFO
+#define HAVE_TYPEINFO 1
+#endif
+
+#ifndef HAVE_VALUES_H
+#define HAVE_VALUES_H 0
+#endif
+
+#ifndef ETIP_NEEDS_MATH_H
+#define ETIP_NEEDS_MATH_H 1
+#endif
+
+#ifndef ETIP_NEEDS_MATH_EXCEPTION
+#define ETIP_NEEDS_MATH_EXCEPTION 0
+#endif
+
+#ifndef CPP_HAS_PARAM_INIT
+#define CPP_HAS_PARAM_INIT 0
+#endif
+
+#ifndef CPP_HAS_STATIC_CAST
+#define CPP_HAS_STATIC_CAST 1
+#endif
+
+#ifdef __GNUG__
+# if ((__GNUG__ <= 2) && (__GNUC_MINOR__ < 8))
+# if HAVE_TYPEINFO
+# include <typeinfo>
+# endif
+# endif
+#endif
+
+#if defined(__GNUG__)
+# if HAVE_BUILTIN_H || HAVE_GXX_BUILTIN_H || HAVE_GPP_BUILTIN_H
+# if ETIP_NEEDS_MATH_H
+# if ETIP_NEEDS_MATH_EXCEPTION
+# undef exception
+# define exception math_exception
+# endif
+# include <math.h>
+# endif
+# undef exception
+# define exception builtin_exception
+# if HAVE_GPP_BUILTIN_H
+# include <gpp/builtin.h>
+# elif HAVE_GXX_BUILTIN_H
+# include <g++/builtin.h>
+# else
+# include <builtin.h>
+# endif
+# undef exception
+# endif
+#elif defined (__SUNPRO_CC)
+# include <generic.h>
+#endif
+
+#include <ncurses_dll.h>
+
+extern "C" {
+#if HAVE_VALUES_H
+# include <values.h>
+#endif
+
+#include <assert.h>
+#include <eti.h>
+#include <errno.h>
+}
+
+// Language features
+#if CPP_HAS_PARAM_INIT
+#define NCURSES_PARAM_INIT(value) = value
+#else
+#define NCURSES_PARAM_INIT(value) /*nothing*/
+#endif
+
+#if CPP_HAS_STATIC_CAST
+#define STATIC_CAST(s) static_cast<s>
+#else
+#define STATIC_CAST(s) (s)
+#endif
+
+// Forward Declarations
+class NCURSES_IMPEXP NCursesPanel;
+class NCURSES_IMPEXP NCursesMenu;
+class NCURSES_IMPEXP NCursesForm;
+
+class NCURSES_IMPEXP NCursesException
+{
+public:
+ const char *message;
+ int errorno;
+
+ NCursesException (const char* msg, int err)
+ : message(msg), errorno (err)
+ {};
+
+ NCursesException (const char* msg)
+ : message(msg), errorno (E_SYSTEM_ERROR)
+ {};
+
+ NCursesException& operator=(const NCursesException& rhs)
+ {
+ errorno = rhs.errorno;
+ return *this;
+ }
+
+ NCursesException(const NCursesException& rhs)
+ : message(rhs.message), errorno(rhs.errorno)
+ {
+ }
+
+ virtual const char *classname() const {
+ return "NCursesWindow";
+ }
+
+ virtual ~NCursesException()
+ {
+ }
+};
+
+class NCURSES_IMPEXP NCursesPanelException : public NCursesException
+{
+public:
+ const NCursesPanel* p;
+
+ NCursesPanelException (const char *msg, int err) :
+ NCursesException (msg, err),
+ p (NULL)
+ {};
+
+ NCursesPanelException (const NCursesPanel* panel,
+ const char *msg,
+ int err) :
+ NCursesException (msg, err),
+ p (panel)
+ {};
+
+ NCursesPanelException (int err) :
+ NCursesException ("panel library error", err),
+ p (NULL)
+ {};
+
+ NCursesPanelException (const NCursesPanel* panel,
+ int err) :
+ NCursesException ("panel library error", err),
+ p (panel)
+ {};
+
+ NCursesPanelException& operator=(const NCursesPanelException& rhs)
+ {
+ if (this != &rhs) {
+ NCursesException::operator=(rhs);
+ p = rhs.p;
+ }
+ return *this;
+ }
+
+ NCursesPanelException(const NCursesPanelException& rhs)
+ : NCursesException(rhs), p(rhs.p)
+ {
+ }
+
+ virtual const char *classname() const {
+ return "NCursesPanel";
+ }
+
+ virtual ~NCursesPanelException()
+ {
+ }
+};
+
+class NCURSES_IMPEXP NCursesMenuException : public NCursesException
+{
+public:
+ const NCursesMenu* m;
+
+ NCursesMenuException (const char *msg, int err) :
+ NCursesException (msg, err),
+ m (NULL)
+ {};
+
+ NCursesMenuException (const NCursesMenu* menu,
+ const char *msg,
+ int err) :
+ NCursesException (msg, err),
+ m (menu)
+ {};
+
+ NCursesMenuException (int err) :
+ NCursesException ("menu library error", err),
+ m (NULL)
+ {};
+
+ NCursesMenuException (const NCursesMenu* menu,
+ int err) :
+ NCursesException ("menu library error", err),
+ m (menu)
+ {};
+
+ NCursesMenuException& operator=(const NCursesMenuException& rhs)
+ {
+ if (this != &rhs) {
+ NCursesException::operator=(rhs);
+ m = rhs.m;
+ }
+ return *this;
+ }
+
+ NCursesMenuException(const NCursesMenuException& rhs)
+ : NCursesException(rhs), m(rhs.m)
+ {
+ }
+
+ virtual const char *classname() const {
+ return "NCursesMenu";
+ }
+
+ virtual ~NCursesMenuException()
+ {
+ }
+};
+
+class NCURSES_IMPEXP NCursesFormException : public NCursesException
+{
+public:
+ const NCursesForm* f;
+
+ NCursesFormException (const char *msg, int err) :
+ NCursesException (msg, err),
+ f (NULL)
+ {};
+
+ NCursesFormException (const NCursesForm* form,
+ const char *msg,
+ int err) :
+ NCursesException (msg, err),
+ f (form)
+ {};
+
+ NCursesFormException (int err) :
+ NCursesException ("form library error", err),
+ f (NULL)
+ {};
+
+ NCursesFormException (const NCursesForm* form,
+ int err) :
+ NCursesException ("form library error", err),
+ f (form)
+ {};
+
+ NCursesFormException& operator=(const NCursesFormException& rhs)
+ {
+ if (this != &rhs) {
+ NCursesException::operator=(rhs);
+ f = rhs.f;
+ }
+ return *this;
+ }
+
+ NCursesFormException(const NCursesFormException& rhs)
+ : NCursesException(rhs), f(rhs.f)
+ {
+ }
+
+ virtual const char *classname() const {
+ return "NCursesForm";
+ }
+
+ virtual ~NCursesFormException()
+ {
+ }
+};
+
+#if !((defined(__GNUG__) && defined(__EXCEPTIONS)) || defined(__SUNPRO_CC))
+# if HAVE_IOSTREAM
+# include <iostream>
+using std::cerr;
+using std::endl;
+# else
+# include <iostream.h>
+# endif
+ extern "C" void exit(int);
+#endif
+
+inline void THROW(const NCursesException *e) {
+#if defined(__GNUG__) && defined(__EXCEPTIONS)
+# if ((__GNUG__ <= 2) && (__GNUC_MINOR__ < 8))
+ (*lib_error_handler)(e ? e->classname() : "", e ? e->message : "");
+#else
+#define CPP_HAS_TRY_CATCH 1
+#endif
+#elif defined(__SUNPRO_CC)
+# if !defined(__SUNPRO_CC_COMPAT) || (__SUNPRO_CC_COMPAT < 5)
+ genericerror(1, ((e != 0) ? (char *)(e->message) : ""));
+#else
+#define CPP_HAS_TRY_CATCH 1
+#endif
+#else
+ if (e)
+ cerr << e->message << endl;
+ exit(0);
+#endif
+
+#ifndef CPP_HAS_TRY_CATCH
+#define CPP_HAS_TRY_CATCH 0
+#define NCURSES_CPP_TRY /* nothing */
+#define NCURSES_CPP_CATCH(e) if (false)
+#define THROWS(s) /* nothing */
+#elif CPP_HAS_TRY_CATCH
+ throw *e;
+#define NCURSES_CPP_TRY try
+#define NCURSES_CPP_CATCH(e) catch(e)
+#define THROWS(s) throw(s)
+#endif
+}
+
+#endif /* NCURSES_ETIP_H_incl */
diff --git a/sysroot/usr/include/execinfo.h b/sysroot/usr/include/execinfo.h
new file mode 100644
index 0000000..c1614cc
--- /dev/null
+++ b/sysroot/usr/include/execinfo.h
@@ -0,0 +1,44 @@
+/* Copyright (C) 1998, 1999, 2004, 2005 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _EXECINFO_H
+#define _EXECINFO_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Store up to SIZE return address of the current program state in
+ ARRAY and return the exact number of values stored. */
+extern int backtrace (void **__array, int __size) __nonnull ((1));
+
+
+/* Return names of functions from the backtrace list in ARRAY in a newly
+ malloc()ed memory block. */
+extern char **backtrace_symbols (void *__const *__array, int __size)
+ __THROW __nonnull ((1));
+
+
+/* This function is similar to backtrace_symbols() but it writes the result
+ immediately to a file. */
+extern void backtrace_symbols_fd (void *__const *__array, int __size, int __fd)
+ __THROW __nonnull ((1));
+
+__END_DECLS
+
+#endif /* execinfo.h */
diff --git a/sysroot/usr/include/fcntl.h b/sysroot/usr/include/fcntl.h
new file mode 100644
index 0000000..330bb30
--- /dev/null
+++ b/sysroot/usr/include/fcntl.h
@@ -0,0 +1,222 @@
+/* Copyright (C) 1991,1992,1994-2001,2003,2004,2005,2006,2007
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * POSIX Standard: 6.5 File Control Operations <fcntl.h>
+ */
+
+#ifndef _FCNTL_H
+#define _FCNTL_H 1
+
+#include <features.h>
+
+/* This must be early so <bits/fcntl.h> can define types winningly. */
+__BEGIN_DECLS
+
+/* Get the definitions of O_*, F_*, FD_*: all the
+ numbers and flag bits for `open', `fcntl', et al. */
+#include <bits/fcntl.h>
+
+/* For XPG all symbols from <sys/stat.h> should also be available. */
+#ifdef __USE_XOPEN
+# include <sys/stat.h>
+#endif
+
+#ifdef __USE_MISC
+# ifndef R_OK /* Verbatim from <unistd.h>. Ugh. */
+/* Values for the second argument to access.
+ These may be OR'd together. */
+# define R_OK 4 /* Test for read permission. */
+# define W_OK 2 /* Test for write permission. */
+# define X_OK 1 /* Test for execute permission. */
+# define F_OK 0 /* Test for existence. */
+# endif
+#endif /* Use misc. */
+
+/* XPG wants the following symbols. */
+#ifdef __USE_XOPEN /* <stdio.h> has the same definitions. */
+# define SEEK_SET 0 /* Seek from beginning of file. */
+# define SEEK_CUR 1 /* Seek from current position. */
+# define SEEK_END 2 /* Seek from end of file. */
+#endif /* XPG */
+
+#ifdef __USE_ATFILE
+# define AT_FDCWD -100 /* Special value used to indicate
+ the *at functions should use the
+ current working directory. */
+# define AT_SYMLINK_NOFOLLOW 0x100 /* Do not follow symbolic links. */
+# define AT_REMOVEDIR 0x200 /* Remove directory instead of
+ unlinking file. */
+# define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */
+# define AT_EACCESS 0x200 /* Test access permitted for
+ effective IDs, not real IDs. */
+#endif
+
+/* Do the file control operation described by CMD on FD.
+ The remaining arguments are interpreted depending on CMD.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int fcntl (int __fd, int __cmd, ...);
+
+/* Open FILE and return a new file descriptor for it, or -1 on error.
+ OFLAG determines the type of access used. If O_CREAT is on OFLAG,
+ the third argument is taken as a `mode_t', the mode of the created file.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+#ifndef __USE_FILE_OFFSET64
+extern int open (__const char *__file, int __oflag, ...) __nonnull ((1));
+#else
+# ifdef __REDIRECT
+extern int __REDIRECT (open, (__const char *__file, int __oflag, ...), open64)
+ __nonnull ((1));
+# else
+# define open open64
+# endif
+#endif
+#ifdef __USE_LARGEFILE64
+extern int open64 (__const char *__file, int __oflag, ...) __nonnull ((1));
+#endif
+
+#ifdef __USE_ATFILE
+/* Similar to `open' but a relative path name is interpreted relative to
+ the directory for which FD is a descriptor.
+
+ NOTE: some other `openat' implementation support additional functionality
+ through this interface, especially using the O_XATTR flag. This is not
+ yet supported here.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+# ifndef __USE_FILE_OFFSET64
+extern int openat (int __fd, __const char *__file, int __oflag, ...)
+ __nonnull ((2));
+# else
+# ifdef __REDIRECT
+extern int __REDIRECT (openat, (int __fd, __const char *__file, int __oflag,
+ ...), openat64) __nonnull ((2));
+# else
+# define openat openat64
+# endif
+# endif
+
+extern int openat64 (int __fd, __const char *__file, int __oflag, ...)
+ __nonnull ((2));
+#endif
+
+/* Create and open FILE, with mode MODE. This takes an `int' MODE
+ argument because that is what `mode_t' will be widened to.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+#ifndef __USE_FILE_OFFSET64
+extern int creat (__const char *__file, __mode_t __mode) __nonnull ((1));
+#else
+# ifdef __REDIRECT
+extern int __REDIRECT (creat, (__const char *__file, __mode_t __mode),
+ creat64) __nonnull ((1));
+# else
+# define creat creat64
+# endif
+#endif
+#ifdef __USE_LARGEFILE64
+extern int creat64 (__const char *__file, __mode_t __mode) __nonnull ((1));
+#endif
+
+#if !defined F_LOCK && (defined __USE_MISC || (defined __USE_XOPEN_EXTENDED \
+ && !defined __USE_POSIX))
+/* NOTE: These declarations also appear in <unistd.h>; be sure to keep both
+ files consistent. Some systems have them there and some here, and some
+ software depends on the macros being defined without including both. */
+
+/* `lockf' is a simpler interface to the locking facilities of `fcntl'.
+ LEN is always relative to the current file position.
+ The CMD argument is one of the following. */
+
+# define F_ULOCK 0 /* Unlock a previously locked region. */
+# define F_LOCK 1 /* Lock a region for exclusive use. */
+# define F_TLOCK 2 /* Test and lock a region for exclusive use. */
+# define F_TEST 3 /* Test a region for other processes locks. */
+
+# ifndef __USE_FILE_OFFSET64
+extern int lockf (int __fd, int __cmd, __off_t __len);
+# else
+# ifdef __REDIRECT
+extern int __REDIRECT (lockf, (int __fd, int __cmd, __off64_t __len), lockf64);
+# else
+# define lockf lockf64
+# endif
+# endif
+# ifdef __USE_LARGEFILE64
+extern int lockf64 (int __fd, int __cmd, __off64_t __len);
+# endif
+#endif
+
+#ifdef __USE_XOPEN2K
+/* Advice the system about the expected behaviour of the application with
+ respect to the file associated with FD. */
+# ifndef __USE_FILE_OFFSET64
+extern int posix_fadvise (int __fd, __off_t __offset, __off_t __len,
+ int __advise) __THROW;
+# else
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (posix_fadvise, (int __fd, __off64_t __offset,
+ __off64_t __len, int __advise),
+ posix_fadvise64);
+# else
+# define posix_fadvise posix_fadvise64
+# endif
+# endif
+# ifdef __USE_LARGEFILE64
+extern int posix_fadvise64 (int __fd, __off64_t __offset, __off64_t __len,
+ int __advise) __THROW;
+# endif
+
+
+/* Reserve storage for the data of the file associated with FD.
+
+ This function is a possible cancellation points and therefore not
+ marked with __THROW. */
+# ifndef __USE_FILE_OFFSET64
+extern int posix_fallocate (int __fd, __off_t __offset, __off_t __len);
+# else
+# ifdef __REDIRECT
+extern int __REDIRECT (posix_fallocate, (int __fd, __off64_t __offset,
+ __off64_t __len),
+ posix_fallocate64);
+# else
+# define posix_fallocate posix_fallocate64
+# endif
+# endif
+# ifdef __USE_LARGEFILE64
+extern int posix_fallocate64 (int __fd, __off64_t __offset, __off64_t __len);
+# endif
+#endif
+
+
+/* Define some inlines helping to catch common problems. */
+#if __USE_FORTIFY_LEVEL > 0 && defined __extern_always_inline \
+ && defined __va_arg_pack_len
+# include <bits/fcntl2.h>
+#endif
+
+__END_DECLS
+
+#endif /* fcntl.h */
diff --git a/sysroot/usr/include/features.h b/sysroot/usr/include/features.h
new file mode 100644
index 0000000..08ee426
--- /dev/null
+++ b/sysroot/usr/include/features.h
@@ -0,0 +1,357 @@
+/* Copyright (C) 1991,1992,1993,1995-2006,2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _FEATURES_H
+#define _FEATURES_H 1
+
+/* These are defined by the user (or the compiler)
+ to specify the desired environment:
+
+ __STRICT_ANSI__ ISO Standard C.
+ _ISOC99_SOURCE Extensions to ISO C89 from ISO C99.
+ _POSIX_SOURCE IEEE Std 1003.1.
+ _POSIX_C_SOURCE If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2;
+ if >=199309L, add IEEE Std 1003.1b-1993;
+ if >=199506L, add IEEE Std 1003.1c-1995;
+ if >=200112L, all of IEEE 1003.1-2004
+ _XOPEN_SOURCE Includes POSIX and XPG things. Set to 500 if
+ Single Unix conformance is wanted, to 600 for the
+ upcoming sixth revision.
+ _XOPEN_SOURCE_EXTENDED XPG things and X/Open Unix extensions.
+ _LARGEFILE_SOURCE Some more functions for correct standard I/O.
+ _LARGEFILE64_SOURCE Additional functionality from LFS for large files.
+ _FILE_OFFSET_BITS=N Select default filesystem interface.
+ _BSD_SOURCE ISO C, POSIX, and 4.3BSD things.
+ _SVID_SOURCE ISO C, POSIX, and SVID things.
+ _ATFILE_SOURCE Additional *at interfaces.
+ _GNU_SOURCE All of the above, plus GNU extensions.
+ _REENTRANT Select additionally reentrant object.
+ _THREAD_SAFE Same as _REENTRANT, often used by other systems.
+ _FORTIFY_SOURCE If set to numeric value > 0 additional security
+ measures are defined, according to level.
+
+ The `-ansi' switch to the GNU C compiler defines __STRICT_ANSI__.
+ If none of these are defined, the default is to have _SVID_SOURCE,
+ _BSD_SOURCE, and _POSIX_SOURCE set to one and _POSIX_C_SOURCE set to
+ 200112L. If more than one of these are defined, they accumulate.
+ For example __STRICT_ANSI__, _POSIX_SOURCE and _POSIX_C_SOURCE
+ together give you ISO C, 1003.1, and 1003.2, but nothing else.
+
+ These are defined by this file and are used by the
+ header files to decide what to declare or define:
+
+ __USE_ISOC99 Define ISO C99 things.
+ __USE_ISOC95 Define ISO C90 AMD1 (C95) things.
+ __USE_POSIX Define IEEE Std 1003.1 things.
+ __USE_POSIX2 Define IEEE Std 1003.2 things.
+ __USE_POSIX199309 Define IEEE Std 1003.1, and .1b things.
+ __USE_POSIX199506 Define IEEE Std 1003.1, .1b, .1c and .1i things.
+ __USE_XOPEN Define XPG things.
+ __USE_XOPEN_EXTENDED Define X/Open Unix things.
+ __USE_UNIX98 Define Single Unix V2 things.
+ __USE_XOPEN2K Define XPG6 things.
+ __USE_LARGEFILE Define correct standard I/O things.
+ __USE_LARGEFILE64 Define LFS things with separate names.
+ __USE_FILE_OFFSET64 Define 64bit interface as default.
+ __USE_BSD Define 4.3BSD things.
+ __USE_SVID Define SVID things.
+ __USE_MISC Define things common to BSD and System V Unix.
+ __USE_ATFILE Define *at interfaces and AT_* constants for them.
+ __USE_GNU Define GNU extensions.
+ __USE_REENTRANT Define reentrant/thread-safe *_r functions.
+ __USE_FORTIFY_LEVEL Additional security measures used, according to level.
+ __FAVOR_BSD Favor 4.3BSD things in cases of conflict.
+
+ The macros `__GNU_LIBRARY__', `__GLIBC__', and `__GLIBC_MINOR__' are
+ defined by this file unconditionally. `__GNU_LIBRARY__' is provided
+ only for compatibility. All new code should use the other symbols
+ to test for features.
+
+ All macros listed above as possibly being defined by this file are
+ explicitly undefined if they are not explicitly defined.
+ Feature-test macros that are not defined by the user or compiler
+ but are implied by the other feature-test macros defined (or by the
+ lack of any definitions) are defined by the file. */
+
+
+/* Undefine everything, so we get a clean slate. */
+#undef __USE_ISOC99
+#undef __USE_ISOC95
+#undef __USE_POSIX
+#undef __USE_POSIX2
+#undef __USE_POSIX199309
+#undef __USE_POSIX199506
+#undef __USE_XOPEN
+#undef __USE_XOPEN_EXTENDED
+#undef __USE_UNIX98
+#undef __USE_XOPEN2K
+#undef __USE_LARGEFILE
+#undef __USE_LARGEFILE64
+#undef __USE_FILE_OFFSET64
+#undef __USE_BSD
+#undef __USE_SVID
+#undef __USE_MISC
+#undef __USE_ATFILE
+#undef __USE_GNU
+#undef __USE_REENTRANT
+#undef __USE_FORTIFY_LEVEL
+#undef __FAVOR_BSD
+#undef __KERNEL_STRICT_NAMES
+
+/* Suppress kernel-name space pollution unless user expressedly asks
+ for it. */
+#ifndef _LOOSE_KERNEL_NAMES
+# define __KERNEL_STRICT_NAMES
+#endif
+
+/* Always use ISO C things. */
+#define __USE_ANSI 1
+
+/* Convenience macros to test the versions of glibc and gcc.
+ Use them like this:
+ #if __GNUC_PREREQ (2,8)
+ ... code requiring gcc 2.8 or later ...
+ #endif
+ Note - they won't work for gcc1 or glibc1, since the _MINOR macros
+ were not defined then. */
+#if defined __GNUC__ && defined __GNUC_MINOR__
+# define __GNUC_PREREQ(maj, min) \
+ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
+#else
+# define __GNUC_PREREQ(maj, min) 0
+#endif
+
+
+/* If _BSD_SOURCE was defined by the user, favor BSD over POSIX. */
+#if defined _BSD_SOURCE && \
+ !(defined _POSIX_SOURCE || defined _POSIX_C_SOURCE || \
+ defined _XOPEN_SOURCE || defined _XOPEN_SOURCE_EXTENDED || \
+ defined _GNU_SOURCE || defined _SVID_SOURCE)
+# define __FAVOR_BSD 1
+#endif
+
+/* If _GNU_SOURCE was defined by the user, turn on all the other features. */
+#ifdef _GNU_SOURCE
+# undef _ISOC99_SOURCE
+# define _ISOC99_SOURCE 1
+# undef _POSIX_SOURCE
+# define _POSIX_SOURCE 1
+# undef _POSIX_C_SOURCE
+# define _POSIX_C_SOURCE 200112L
+# undef _XOPEN_SOURCE
+# define _XOPEN_SOURCE 600
+# undef _XOPEN_SOURCE_EXTENDED
+# define _XOPEN_SOURCE_EXTENDED 1
+# undef _LARGEFILE64_SOURCE
+# define _LARGEFILE64_SOURCE 1
+# undef _BSD_SOURCE
+# define _BSD_SOURCE 1
+# undef _SVID_SOURCE
+# define _SVID_SOURCE 1
+# undef _ATFILE_SOURCE
+# define _ATFILE_SOURCE 1
+#endif
+
+/* If nothing (other than _GNU_SOURCE) is defined,
+ define _BSD_SOURCE and _SVID_SOURCE. */
+#if (!defined __STRICT_ANSI__ && !defined _ISOC99_SOURCE && \
+ !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE && \
+ !defined _XOPEN_SOURCE && !defined _XOPEN_SOURCE_EXTENDED && \
+ !defined _BSD_SOURCE && !defined _SVID_SOURCE)
+# define _BSD_SOURCE 1
+# define _SVID_SOURCE 1
+#endif
+
+/* This is to enable the ISO C99 extension. Also recognize the old macro
+ which was used prior to the standard acceptance. This macro will
+ eventually go away and the features enabled by default once the ISO C99
+ standard is widely adopted. */
+#if (defined _ISOC99_SOURCE || defined _ISOC9X_SOURCE \
+ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L))
+# define __USE_ISOC99 1
+#endif
+
+/* This is to enable the ISO C90 Amendment 1:1995 extension. */
+#if (defined _ISOC99_SOURCE || defined _ISOC9X_SOURCE \
+ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199409L))
+# define __USE_ISOC95 1
+#endif
+
+/* If none of the ANSI/POSIX macros are defined, use POSIX.1 and POSIX.2
+ (and IEEE Std 1003.1b-1993 unless _XOPEN_SOURCE is defined). */
+#if ((!defined __STRICT_ANSI__ || (_XOPEN_SOURCE - 0) >= 500) && \
+ !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE)
+# define _POSIX_SOURCE 1
+# if defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 500
+# define _POSIX_C_SOURCE 2
+# elif defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 600
+# define _POSIX_C_SOURCE 199506L
+# else
+# define _POSIX_C_SOURCE 200112L
+# endif
+#endif
+
+#if defined _POSIX_SOURCE || _POSIX_C_SOURCE >= 1 || defined _XOPEN_SOURCE
+# define __USE_POSIX 1
+#endif
+
+#if defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 2 || defined _XOPEN_SOURCE
+# define __USE_POSIX2 1
+#endif
+
+#if (_POSIX_C_SOURCE - 0) >= 199309L
+# define __USE_POSIX199309 1
+#endif
+
+#if (_POSIX_C_SOURCE - 0) >= 199506L
+# define __USE_POSIX199506 1
+#endif
+
+#if (_POSIX_C_SOURCE - 0) >= 200112L
+# define __USE_XOPEN2K 1
+#endif
+
+#ifdef _XOPEN_SOURCE
+# define __USE_XOPEN 1
+# if (_XOPEN_SOURCE - 0) >= 500
+# define __USE_XOPEN_EXTENDED 1
+# define __USE_UNIX98 1
+# undef _LARGEFILE_SOURCE
+# define _LARGEFILE_SOURCE 1
+# if (_XOPEN_SOURCE - 0) >= 600
+# define __USE_XOPEN2K 1
+# undef __USE_ISOC99
+# define __USE_ISOC99 1
+# endif
+# else
+# ifdef _XOPEN_SOURCE_EXTENDED
+# define __USE_XOPEN_EXTENDED 1
+# endif
+# endif
+#endif
+
+#ifdef _LARGEFILE_SOURCE
+# define __USE_LARGEFILE 1
+#endif
+
+#ifdef _LARGEFILE64_SOURCE
+# define __USE_LARGEFILE64 1
+#endif
+
+#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
+# define __USE_FILE_OFFSET64 1
+#endif
+
+#if defined _BSD_SOURCE || defined _SVID_SOURCE
+# define __USE_MISC 1
+#endif
+
+#ifdef _BSD_SOURCE
+# define __USE_BSD 1
+#endif
+
+#ifdef _SVID_SOURCE
+# define __USE_SVID 1
+#endif
+
+#ifdef _ATFILE_SOURCE
+# define __USE_ATFILE 1
+#endif
+
+#ifdef _GNU_SOURCE
+# define __USE_GNU 1
+#endif
+
+#if defined _REENTRANT || defined _THREAD_SAFE
+# define __USE_REENTRANT 1
+#endif
+
+#if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0 \
+ && __GNUC_PREREQ (4, 1) && defined __OPTIMIZE__ && __OPTIMIZE__ > 0
+# if _FORTIFY_SOURCE > 1
+# define __USE_FORTIFY_LEVEL 2
+# else
+# define __USE_FORTIFY_LEVEL 1
+# endif
+#else
+# define __USE_FORTIFY_LEVEL 0
+#endif
+
+/* We do support the IEC 559 math functionality, real and complex. */
+#define __STDC_IEC_559__ 1
+#define __STDC_IEC_559_COMPLEX__ 1
+
+/* wchar_t uses ISO 10646-1 (2nd ed., published 2000-09-15) / Unicode 3.1. */
+#define __STDC_ISO_10646__ 200009L
+
+/* This macro indicates that the installed library is the GNU C Library.
+ For historic reasons the value now is 6 and this will stay from now
+ on. The use of this variable is deprecated. Use __GLIBC__ and
+ __GLIBC_MINOR__ now (see below) when you want to test for a specific
+ GNU C library version and use the values in <gnu/lib-names.h> to get
+ the sonames of the shared libraries. */
+#undef __GNU_LIBRARY__
+#define __GNU_LIBRARY__ 6
+
+/* Major and minor version number of the GNU C library package. Use
+ these macros to test for features in specific releases. */
+#define __GLIBC__ 2
+#define __GLIBC_MINOR__ 7
+
+#define __GLIBC_PREREQ(maj, min) \
+ ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min))
+
+/* Decide whether a compiler supports the long long datatypes. */
+#if defined __GNUC__ \
+ || (defined __PGI && defined __i386__ ) \
+ || (defined __INTEL_COMPILER && (defined __i386__ || defined __ia64__)) \
+ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)
+# define __GLIBC_HAVE_LONG_LONG 1
+#endif
+
+/* This is here only because every header file already includes this one. */
+#ifndef __ASSEMBLER__
+# ifndef _SYS_CDEFS_H
+# include <sys/cdefs.h>
+# endif
+
+/* If we don't have __REDIRECT, prototypes will be missing if
+ __USE_FILE_OFFSET64 but not __USE_LARGEFILE[64]. */
+# if defined __USE_FILE_OFFSET64 && !defined __REDIRECT
+# define __USE_LARGEFILE 1
+# define __USE_LARGEFILE64 1
+# endif
+
+#endif /* !ASSEMBLER */
+
+/* Decide whether we can define 'extern inline' functions in headers. */
+#if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \
+ && !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__ \
+ && defined __extern_inline
+# define __USE_EXTERN_INLINES 1
+#endif
+
+
+/* This is here only because every header file already includes this one.
+ Get the definitions of all the appropriate `__stub_FUNCTION' symbols.
+ <gnu/stubs.h> contains `#define __stub_FUNCTION' when FUNCTION is a stub
+ that will always return failure (and set errno to ENOSYS). */
+#include <gnu/stubs.h>
+
+
+#endif /* features.h */
diff --git a/sysroot/usr/include/fenv.h b/sysroot/usr/include/fenv.h
new file mode 100644
index 0000000..8a06f02
--- /dev/null
+++ b/sysroot/usr/include/fenv.h
@@ -0,0 +1,136 @@
+/* Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99 7.6: Floating-point environment <fenv.h>
+ */
+
+#ifndef _FENV_H
+#define _FENV_H 1
+
+#include <features.h>
+
+/* Get the architecture dependend definitions. The following definitions
+ are expected to be done:
+
+ fenv_t type for object representing an entire floating-point
+ environment
+
+ FE_DFL_ENV macro of type pointer to fenv_t to be used as the argument
+ to functions taking an argument of type fenv_t; in this
+ case the default environment will be used
+
+ fexcept_t type for object representing the floating-point exception
+ flags including status associated with the flags
+
+ The following macros are defined iff the implementation supports this
+ kind of exception.
+ FE_INEXACT inexact result
+ FE_DIVBYZERO division by zero
+ FE_UNDERFLOW result not representable due to underflow
+ FE_OVERFLOW result not representable due to overflow
+ FE_INVALID invalid operation
+
+ FE_ALL_EXCEPT bitwise OR of all supported exceptions
+
+ The next macros are defined iff the appropriate rounding mode is
+ supported by the implementation.
+ FE_TONEAREST round to nearest
+ FE_UPWARD round toward +Inf
+ FE_DOWNWARD round toward -Inf
+ FE_TOWARDZERO round toward 0
+*/
+#include <bits/fenv.h>
+
+__BEGIN_DECLS
+
+/* Floating-point exception handling. */
+
+/* Clear the supported exceptions represented by EXCEPTS. */
+extern int feclearexcept (int __excepts) __THROW;
+
+/* Store implementation-defined representation of the exception flags
+ indicated by EXCEPTS in the object pointed to by FLAGP. */
+extern int fegetexceptflag (fexcept_t *__flagp, int __excepts) __THROW;
+
+/* Raise the supported exceptions represented by EXCEPTS. */
+extern int feraiseexcept (int __excepts) __THROW;
+
+/* Set complete status for exceptions indicated by EXCEPTS according to
+ the representation in the object pointed to by FLAGP. */
+extern int fesetexceptflag (__const fexcept_t *__flagp, int __excepts) __THROW;
+
+/* Determine which of subset of the exceptions specified by EXCEPTS are
+ currently set. */
+extern int fetestexcept (int __excepts) __THROW;
+
+
+/* Rounding control. */
+
+/* Get current rounding direction. */
+extern int fegetround (void) __THROW;
+
+/* Establish the rounding direction represented by ROUND. */
+extern int fesetround (int __rounding_direction) __THROW;
+
+
+/* Floating-point environment. */
+
+/* Store the current floating-point environment in the object pointed
+ to by ENVP. */
+extern int fegetenv (fenv_t *__envp) __THROW;
+
+/* Save the current environment in the object pointed to by ENVP, clear
+ exception flags and install a non-stop mode (if available) for all
+ exceptions. */
+extern int feholdexcept (fenv_t *__envp) __THROW;
+
+/* Establish the floating-point environment represented by the object
+ pointed to by ENVP. */
+extern int fesetenv (__const fenv_t *__envp) __THROW;
+
+/* Save current exceptions in temporary storage, install environment
+ represented by object pointed to by ENVP and raise exceptions
+ according to saved exceptions. */
+extern int feupdateenv (__const fenv_t *__envp) __THROW;
+
+
+/* Include optimization. */
+#ifdef __OPTIMIZE__
+# include <bits/fenvinline.h>
+#endif
+
+#ifdef __USE_GNU
+
+/* Enable individual exceptions. Will not enable more exceptions than
+ EXCEPTS specifies. Returns the previous enabled exceptions if all
+ exceptions are successfully set, otherwise returns -1. */
+extern int feenableexcept (int __excepts) __THROW;
+
+/* Disable individual exceptions. Will not disable more exceptions than
+ EXCEPTS specifies. Returns the previous enabled exceptions if all
+ exceptions are successfully disabled, otherwise returns -1. */
+extern int fedisableexcept (int __excepts) __THROW;
+
+/* Return enabled exceptions. */
+extern int fegetexcept (void) __THROW;
+#endif
+
+__END_DECLS
+
+#endif /* fenv.h */
diff --git a/sysroot/usr/include/fmtmsg.h b/sysroot/usr/include/fmtmsg.h
new file mode 100644
index 0000000..53e3e53
--- /dev/null
+++ b/sysroot/usr/include/fmtmsg.h
@@ -0,0 +1,106 @@
+/* Message display handling.
+ Copyright (C) 1997, 1999, 2000, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef __FMTMSG_H
+#define __FMTMSG_H 1
+
+#include <features.h>
+
+
+__BEGIN_DECLS
+
+/* Values to control `fmtmsg' function. */
+enum
+{
+ MM_HARD = 0x001, /* Source of the condition is hardware. */
+#define MM_HARD MM_HARD
+ MM_SOFT = 0x002, /* Source of the condition is software. */
+#define MM_SOFT MM_SOFT
+ MM_FIRM = 0x004, /* Source of the condition is firmware. */
+#define MM_FIRM MM_FIRM
+ MM_APPL = 0x008, /* Condition detected by application. */
+#define MM_APPL MM_APPL
+ MM_UTIL = 0x010, /* Condition detected by utility. */
+#define MM_UTIL MM_UTIL
+ MM_OPSYS = 0x020, /* Condition detected by operating system. */
+#define MM_OPSYS MM_OPSYS
+ MM_RECOVER = 0x040, /* Recoverable error. */
+#define MM_RECOVER MM_RECOVER
+ MM_NRECOV = 0x080, /* Non-recoverable error. */
+#define MM_NRECOV MM_NRECOV
+ MM_PRINT = 0x100, /* Display message in standard error. */
+#define MM_PRINT MM_PRINT
+ MM_CONSOLE = 0x200 /* Display message on system console. */
+#define MM_CONSOLE MM_CONSOLE
+};
+
+/* Values to be for SEVERITY parameter of `fmtmsg'. */
+enum
+{
+ MM_NOSEV = 0, /* No severity level provided for the message. */
+#define MM_NOSEV MM_NOSEV
+ MM_HALT, /* Error causing application to halt. */
+#define MM_HALT MM_HALT
+ MM_ERROR, /* Application has encountered a non-fatal fault. */
+#define MM_ERROR MM_ERROR
+ MM_WARNING, /* Application has detected unusual non-error
+ condition. */
+#define MM_WARNING MM_WARNING
+ MM_INFO /* Informative message. */
+#define MM_INFO MM_INFO
+};
+
+
+/* Macros which can be used as null values for the arguments of `fmtmsg'. */
+#define MM_NULLLBL ((char *) 0)
+#define MM_NULLSEV 0
+#define MM_NULLMC ((long int) 0)
+#define MM_NULLTXT ((char *) 0)
+#define MM_NULLACT ((char *) 0)
+#define MM_NULLTAG ((char *) 0)
+
+
+/* Possible return values of `fmtmsg'. */
+enum
+{
+ MM_NOTOK = -1,
+#define MM_NOTOK MM_NOTOK
+ MM_OK = 0,
+#define MM_OK MM_OK
+ MM_NOMSG = 1,
+#define MM_NOMSG MM_NOMSG
+ MM_NOCON = 4
+#define MM_NOCON MM_NOCON
+};
+
+
+/* Print message with given CLASSIFICATION, LABEL, SEVERITY, TEXT, ACTION
+ and TAG to console or standard error. */
+extern int fmtmsg (long int __classification, __const char *__label,
+ int __severity, __const char *__text,
+ __const char *__action, __const char *__tag);
+
+#ifdef __USE_SVID
+/* Add or remove severity level. */
+extern int addseverity (int __severity, __const char *__string) __THROW;
+#endif
+
+__END_DECLS
+
+#endif /* fmtmsg.h */
diff --git a/sysroot/usr/include/fnmatch.h b/sysroot/usr/include/fnmatch.h
new file mode 100644
index 0000000..aefb007
--- /dev/null
+++ b/sysroot/usr/include/fnmatch.h
@@ -0,0 +1,72 @@
+/* Copyright (C) 1991-93,96,97,98,99,2001,2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _FNMATCH_H
+#define _FNMATCH_H 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef const
+# if (defined __STDC__ && __STDC__) || defined __cplusplus
+# define __const const
+# else
+# define __const
+# endif
+#endif
+
+/* We #undef these before defining them because some losing systems
+ (HP-UX A.08.07 for example) define these in <unistd.h>. */
+#undef FNM_PATHNAME
+#undef FNM_NOESCAPE
+#undef FNM_PERIOD
+
+/* Bits set in the FLAGS argument to `fnmatch'. */
+#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */
+#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
+#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
+
+#if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE
+# define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
+# define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
+# define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
+# define FNM_EXTMATCH (1 << 5) /* Use ksh-like extended matching. */
+#endif
+
+/* Value returned by `fnmatch' if STRING does not match PATTERN. */
+#define FNM_NOMATCH 1
+
+/* This value is returned if the implementation does not support
+ `fnmatch'. Since this is not the case here it will never be
+ returned but the conformance test suites still require the symbol
+ to be defined. */
+#ifdef _XOPEN_SOURCE
+# define FNM_NOSYS (-1)
+#endif
+
+/* Match NAME against the filename pattern PATTERN,
+ returning zero if it matches, FNM_NOMATCH if not. */
+extern int fnmatch (__const char *__pattern, __const char *__name,
+ int __flags);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* fnmatch.h */
diff --git a/sysroot/usr/include/form.h b/sysroot/usr/include/form.h
new file mode 100644
index 0000000..a4691a8
--- /dev/null
+++ b/sysroot/usr/include/form.h
@@ -0,0 +1,403 @@
+/****************************************************************************
+ * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Juergen Pfeifer, 1995,1997 *
+ ****************************************************************************/
+
+/* $Id: form.h,v 0.20 2004/12/04 22:22:10 tom Exp $ */
+
+#ifndef FORM_H
+#define FORM_H
+
+#include <curses.h>
+#include <eti.h>
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+#ifndef FORM_PRIV_H
+typedef void *FIELD_CELL;
+#endif
+
+#ifndef NCURSES_FIELD_INTERNALS
+#define NCURSES_FIELD_INTERNALS /* nothing */
+#endif
+
+typedef int Form_Options;
+typedef int Field_Options;
+
+ /**********
+ * _PAGE *
+ **********/
+
+typedef struct {
+ short pmin; /* index of first field on page */
+ short pmax; /* index of last field on page */
+ short smin; /* index of top leftmost field on page */
+ short smax; /* index of bottom rightmost field on page */
+} _PAGE;
+
+ /**********
+ * FIELD *
+ **********/
+
+typedef struct fieldnode {
+ unsigned short status; /* flags */
+ short rows; /* size in rows */
+ short cols; /* size in cols */
+ short frow; /* first row */
+ short fcol; /* first col */
+ int drows; /* dynamic rows */
+ int dcols; /* dynamic cols */
+ int maxgrow; /* maximum field growth */
+ int nrow; /* off-screen rows */
+ short nbuf; /* additional buffers */
+ short just; /* justification */
+ short page; /* page on form */
+ short index; /* into form -> field */
+ int pad; /* pad character */
+ chtype fore; /* foreground attribute */
+ chtype back; /* background attribute */
+ Field_Options opts; /* options */
+ struct fieldnode * snext; /* sorted order pointer */
+ struct fieldnode * sprev; /* sorted order pointer */
+ struct fieldnode * link; /* linked field chain */
+ struct formnode * form; /* containing form */
+ struct typenode * type; /* field type */
+ void * arg; /* argument for type */
+ FIELD_CELL * buf; /* field buffers */
+ void * usrptr; /* user pointer */
+ /*
+ * The wide-character configuration requires extra information. Because
+ * there are existing applications that manipulate the members of FIELD
+ * directly, we cannot make the struct opaque. Offsets of members up to
+ * this point are the same in the narrow- and wide-character configuration.
+ * But note that the type of buf depends on the configuration, and is made
+ * opaque for that reason.
+ */
+ NCURSES_FIELD_INTERNALS
+} FIELD;
+
+ /**************
+ * FIELDTYPE *
+ **************/
+
+typedef struct typenode {
+ unsigned short status; /* flags */
+ long ref; /* reference count */
+ struct typenode * left; /* ptr to operand for | */
+ struct typenode * right; /* ptr to operand for | */
+
+ void* (*makearg)(va_list *); /* make fieldtype arg */
+ void* (*copyarg)(const void *); /* copy fieldtype arg */
+ void (*freearg)(void *); /* free fieldtype arg */
+
+ bool (*fcheck)(FIELD *,const void *); /* field validation */
+ bool (*ccheck)(int,const void *); /* character validation */
+
+ bool (*next)(FIELD *,const void *); /* enumerate next value */
+ bool (*prev)(FIELD *,const void *); /* enumerate prev value */
+
+} FIELDTYPE;
+
+ /*********
+ * FORM *
+ *********/
+
+typedef struct formnode {
+ unsigned short status; /* flags */
+ short rows; /* size in rows */
+ short cols; /* size in cols */
+ int currow; /* current row in field window */
+ int curcol; /* current col in field window */
+ int toprow; /* in scrollable field window */
+ int begincol; /* in horiz. scrollable field */
+ short maxfield; /* number of fields */
+ short maxpage; /* number of pages */
+ short curpage; /* index into page */
+ Form_Options opts; /* options */
+ WINDOW * win; /* window */
+ WINDOW * sub; /* subwindow */
+ WINDOW * w; /* window for current field */
+ FIELD ** field; /* field [maxfield] */
+ FIELD * current; /* current field */
+ _PAGE * page; /* page [maxpage] */
+ void * usrptr; /* user pointer */
+
+ void (*forminit)(struct formnode *);
+ void (*formterm)(struct formnode *);
+ void (*fieldinit)(struct formnode *);
+ void (*fieldterm)(struct formnode *);
+
+} FORM;
+
+typedef void (*Form_Hook)(FORM *);
+
+ /***************************
+ * miscellaneous #defines *
+ ***************************/
+
+/* field justification */
+#define NO_JUSTIFICATION (0)
+#define JUSTIFY_LEFT (1)
+#define JUSTIFY_CENTER (2)
+#define JUSTIFY_RIGHT (3)
+
+/* field options */
+#define O_VISIBLE (0x0001U)
+#define O_ACTIVE (0x0002U)
+#define O_PUBLIC (0x0004U)
+#define O_EDIT (0x0008U)
+#define O_WRAP (0x0010U)
+#define O_BLANK (0x0020U)
+#define O_AUTOSKIP (0x0040U)
+#define O_NULLOK (0x0080U)
+#define O_PASSOK (0x0100U)
+#define O_STATIC (0x0200U)
+
+/* form options */
+#define O_NL_OVERLOAD (0x0001U)
+#define O_BS_OVERLOAD (0x0002U)
+
+/* form driver commands */
+#define REQ_NEXT_PAGE (KEY_MAX + 1) /* move to next page */
+#define REQ_PREV_PAGE (KEY_MAX + 2) /* move to previous page */
+#define REQ_FIRST_PAGE (KEY_MAX + 3) /* move to first page */
+#define REQ_LAST_PAGE (KEY_MAX + 4) /* move to last page */
+
+#define REQ_NEXT_FIELD (KEY_MAX + 5) /* move to next field */
+#define REQ_PREV_FIELD (KEY_MAX + 6) /* move to previous field */
+#define REQ_FIRST_FIELD (KEY_MAX + 7) /* move to first field */
+#define REQ_LAST_FIELD (KEY_MAX + 8) /* move to last field */
+#define REQ_SNEXT_FIELD (KEY_MAX + 9) /* move to sorted next field */
+#define REQ_SPREV_FIELD (KEY_MAX + 10) /* move to sorted prev field */
+#define REQ_SFIRST_FIELD (KEY_MAX + 11) /* move to sorted first field */
+#define REQ_SLAST_FIELD (KEY_MAX + 12) /* move to sorted last field */
+#define REQ_LEFT_FIELD (KEY_MAX + 13) /* move to left to field */
+#define REQ_RIGHT_FIELD (KEY_MAX + 14) /* move to right to field */
+#define REQ_UP_FIELD (KEY_MAX + 15) /* move to up to field */
+#define REQ_DOWN_FIELD (KEY_MAX + 16) /* move to down to field */
+
+#define REQ_NEXT_CHAR (KEY_MAX + 17) /* move to next char in field */
+#define REQ_PREV_CHAR (KEY_MAX + 18) /* move to prev char in field */
+#define REQ_NEXT_LINE (KEY_MAX + 19) /* move to next line in field */
+#define REQ_PREV_LINE (KEY_MAX + 20) /* move to prev line in field */
+#define REQ_NEXT_WORD (KEY_MAX + 21) /* move to next word in field */
+#define REQ_PREV_WORD (KEY_MAX + 22) /* move to prev word in field */
+#define REQ_BEG_FIELD (KEY_MAX + 23) /* move to first char in field */
+#define REQ_END_FIELD (KEY_MAX + 24) /* move after last char in fld */
+#define REQ_BEG_LINE (KEY_MAX + 25) /* move to beginning of line */
+#define REQ_END_LINE (KEY_MAX + 26) /* move after last char in line */
+#define REQ_LEFT_CHAR (KEY_MAX + 27) /* move left in field */
+#define REQ_RIGHT_CHAR (KEY_MAX + 28) /* move right in field */
+#define REQ_UP_CHAR (KEY_MAX + 29) /* move up in field */
+#define REQ_DOWN_CHAR (KEY_MAX + 30) /* move down in field */
+
+#define REQ_NEW_LINE (KEY_MAX + 31) /* insert/overlay new line */
+#define REQ_INS_CHAR (KEY_MAX + 32) /* insert blank char at cursor */
+#define REQ_INS_LINE (KEY_MAX + 33) /* insert blank line at cursor */
+#define REQ_DEL_CHAR (KEY_MAX + 34) /* delete char at cursor */
+#define REQ_DEL_PREV (KEY_MAX + 35) /* delete char before cursor */
+#define REQ_DEL_LINE (KEY_MAX + 36) /* delete line at cursor */
+#define REQ_DEL_WORD (KEY_MAX + 37) /* delete word at cursor */
+#define REQ_CLR_EOL (KEY_MAX + 38) /* clear to end of line */
+#define REQ_CLR_EOF (KEY_MAX + 39) /* clear to end of field */
+#define REQ_CLR_FIELD (KEY_MAX + 40) /* clear entire field */
+#define REQ_OVL_MODE (KEY_MAX + 41) /* begin overlay mode */
+#define REQ_INS_MODE (KEY_MAX + 42) /* begin insert mode */
+#define REQ_SCR_FLINE (KEY_MAX + 43) /* scroll field forward a line */
+#define REQ_SCR_BLINE (KEY_MAX + 44) /* scroll field backward a line */
+#define REQ_SCR_FPAGE (KEY_MAX + 45) /* scroll field forward a page */
+#define REQ_SCR_BPAGE (KEY_MAX + 46) /* scroll field backward a page */
+#define REQ_SCR_FHPAGE (KEY_MAX + 47) /* scroll field forward half page */
+#define REQ_SCR_BHPAGE (KEY_MAX + 48) /* scroll field backward half page */
+#define REQ_SCR_FCHAR (KEY_MAX + 49) /* horizontal scroll char */
+#define REQ_SCR_BCHAR (KEY_MAX + 50) /* horizontal scroll char */
+#define REQ_SCR_HFLINE (KEY_MAX + 51) /* horizontal scroll line */
+#define REQ_SCR_HBLINE (KEY_MAX + 52) /* horizontal scroll line */
+#define REQ_SCR_HFHALF (KEY_MAX + 53) /* horizontal scroll half line */
+#define REQ_SCR_HBHALF (KEY_MAX + 54) /* horizontal scroll half line */
+
+#define REQ_VALIDATION (KEY_MAX + 55) /* validate field */
+#define REQ_NEXT_CHOICE (KEY_MAX + 56) /* display next field choice */
+#define REQ_PREV_CHOICE (KEY_MAX + 57) /* display prev field choice */
+
+#define MIN_FORM_COMMAND (KEY_MAX + 1) /* used by form_driver */
+#define MAX_FORM_COMMAND (KEY_MAX + 57) /* used by form_driver */
+
+#if defined(MAX_COMMAND)
+# if (MAX_FORM_COMMAND > MAX_COMMAND)
+# error Something is wrong -- MAX_FORM_COMMAND is greater than MAX_COMMAND
+# elif (MAX_COMMAND != (KEY_MAX + 128))
+# error Something is wrong -- MAX_COMMAND is already inconsistently defined.
+# endif
+#else
+# define MAX_COMMAND (KEY_MAX + 128)
+#endif
+
+ /*************************
+ * standard field types *
+ *************************/
+extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_ALPHA;
+extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_ALNUM;
+extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_ENUM;
+extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_INTEGER;
+extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_NUMERIC;
+extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_REGEXP;
+
+ /************************************
+ * built-in additional field types *
+ * They are not defined in SVr4 *
+ ************************************/
+extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_IPV4; /* Internet IP Version 4 address */
+
+ /***********************
+ * Default objects *
+ ***********************/
+extern NCURSES_EXPORT_VAR(FORM *) _nc_Default_Form;
+extern NCURSES_EXPORT_VAR(FIELD *) _nc_Default_Field;
+
+
+ /***********************
+ * FIELDTYPE routines *
+ ***********************/
+extern NCURSES_EXPORT(FIELDTYPE *) new_fieldtype (
+ bool (* const field_check)(FIELD *,const void *),
+ bool (* const char_check)(int,const void *));
+extern NCURSES_EXPORT(FIELDTYPE *) link_fieldtype(
+ FIELDTYPE *, FIELDTYPE *);
+
+extern NCURSES_EXPORT(int) free_fieldtype (FIELDTYPE *);
+extern NCURSES_EXPORT(int) set_fieldtype_arg (FIELDTYPE *,
+ void * (* const make_arg)(va_list *),
+ void * (* const copy_arg)(const void *),
+ void (* const free_arg)(void *));
+extern NCURSES_EXPORT(int) set_fieldtype_choice (FIELDTYPE *,
+ bool (* const next_choice)(FIELD *,const void *),
+ bool (* const prev_choice)(FIELD *,const void *));
+
+ /*******************
+ * FIELD routines *
+ *******************/
+extern NCURSES_EXPORT(FIELD *) new_field (int,int,int,int,int,int);
+extern NCURSES_EXPORT(FIELD *) dup_field (FIELD *,int,int);
+extern NCURSES_EXPORT(FIELD *) link_field (FIELD *,int,int);
+
+extern NCURSES_EXPORT(int) free_field (FIELD *);
+extern NCURSES_EXPORT(int) field_info (const FIELD *,int *,int *,int *,int *,int *,int *);
+extern NCURSES_EXPORT(int) dynamic_field_info (const FIELD *,int *,int *,int *);
+extern NCURSES_EXPORT(int) set_max_field ( FIELD *,int);
+extern NCURSES_EXPORT(int) move_field (FIELD *,int,int);
+extern NCURSES_EXPORT(int) set_field_type (FIELD *,FIELDTYPE *,...);
+extern NCURSES_EXPORT(int) set_new_page (FIELD *,bool);
+extern NCURSES_EXPORT(int) set_field_just (FIELD *,int);
+extern NCURSES_EXPORT(int) field_just (const FIELD *);
+extern NCURSES_EXPORT(int) set_field_fore (FIELD *,chtype);
+extern NCURSES_EXPORT(int) set_field_back (FIELD *,chtype);
+extern NCURSES_EXPORT(int) set_field_pad (FIELD *,int);
+extern NCURSES_EXPORT(int) field_pad (const FIELD *);
+extern NCURSES_EXPORT(int) set_field_buffer (FIELD *,int,const char *);
+extern NCURSES_EXPORT(int) set_field_status (FIELD *,bool);
+extern NCURSES_EXPORT(int) set_field_userptr (FIELD *, void *);
+extern NCURSES_EXPORT(int) set_field_opts (FIELD *,Field_Options);
+extern NCURSES_EXPORT(int) field_opts_on (FIELD *,Field_Options);
+extern NCURSES_EXPORT(int) field_opts_off (FIELD *,Field_Options);
+
+extern NCURSES_EXPORT(chtype) field_fore (const FIELD *);
+extern NCURSES_EXPORT(chtype) field_back (const FIELD *);
+
+extern NCURSES_EXPORT(bool) new_page (const FIELD *);
+extern NCURSES_EXPORT(bool) field_status (const FIELD *);
+
+extern NCURSES_EXPORT(void *) field_arg (const FIELD *);
+
+extern NCURSES_EXPORT(void *) field_userptr (const FIELD *);
+
+extern NCURSES_EXPORT(FIELDTYPE *) field_type (const FIELD *);
+
+extern NCURSES_EXPORT(char *) field_buffer (const FIELD *,int);
+
+extern NCURSES_EXPORT(Field_Options) field_opts (const FIELD *);
+
+ /******************
+ * FORM routines *
+ ******************/
+
+extern NCURSES_EXPORT(FORM *) new_form (FIELD **);
+
+extern NCURSES_EXPORT(FIELD **) form_fields (const FORM *);
+extern NCURSES_EXPORT(FIELD *) current_field (const FORM *);
+
+extern NCURSES_EXPORT(WINDOW *) form_win (const FORM *);
+extern NCURSES_EXPORT(WINDOW *) form_sub (const FORM *);
+
+extern NCURSES_EXPORT(Form_Hook) form_init (const FORM *);
+extern NCURSES_EXPORT(Form_Hook) form_term (const FORM *);
+extern NCURSES_EXPORT(Form_Hook) field_init (const FORM *);
+extern NCURSES_EXPORT(Form_Hook) field_term (const FORM *);
+
+extern NCURSES_EXPORT(int) free_form (FORM *);
+extern NCURSES_EXPORT(int) set_form_fields (FORM *,FIELD **);
+extern NCURSES_EXPORT(int) field_count (const FORM *);
+extern NCURSES_EXPORT(int) set_form_win (FORM *,WINDOW *);
+extern NCURSES_EXPORT(int) set_form_sub (FORM *,WINDOW *);
+extern NCURSES_EXPORT(int) set_current_field (FORM *,FIELD *);
+extern NCURSES_EXPORT(int) field_index (const FIELD *);
+extern NCURSES_EXPORT(int) set_form_page (FORM *,int);
+extern NCURSES_EXPORT(int) form_page (const FORM *);
+extern NCURSES_EXPORT(int) scale_form (const FORM *,int *,int *);
+extern NCURSES_EXPORT(int) set_form_init (FORM *,Form_Hook);
+extern NCURSES_EXPORT(int) set_form_term (FORM *,Form_Hook);
+extern NCURSES_EXPORT(int) set_field_init (FORM *,Form_Hook);
+extern NCURSES_EXPORT(int) set_field_term (FORM *,Form_Hook);
+extern NCURSES_EXPORT(int) post_form (FORM *);
+extern NCURSES_EXPORT(int) unpost_form (FORM *);
+extern NCURSES_EXPORT(int) pos_form_cursor (FORM *);
+extern NCURSES_EXPORT(int) form_driver (FORM *,int);
+extern NCURSES_EXPORT(int) set_form_userptr (FORM *,void *);
+extern NCURSES_EXPORT(int) set_form_opts (FORM *,Form_Options);
+extern NCURSES_EXPORT(int) form_opts_on (FORM *,Form_Options);
+extern NCURSES_EXPORT(int) form_opts_off (FORM *,Form_Options);
+extern NCURSES_EXPORT(int) form_request_by_name (const char *);
+
+extern NCURSES_EXPORT(const char *) form_request_name (int);
+
+extern NCURSES_EXPORT(void *) form_userptr (const FORM *);
+
+extern NCURSES_EXPORT(Form_Options) form_opts (const FORM *);
+
+extern NCURSES_EXPORT(bool) data_ahead (const FORM *);
+extern NCURSES_EXPORT(bool) data_behind (const FORM *);
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* FORM_H */
diff --git a/sysroot/usr/include/fpu_control.h b/sysroot/usr/include/fpu_control.h
new file mode 100644
index 0000000..3eae48e
--- /dev/null
+++ b/sysroot/usr/include/fpu_control.h
@@ -0,0 +1,101 @@
+/* FPU control word bits. x86-64 version.
+ Copyright (C) 1993,1995,1996,1997,1998,2000,2001,2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Olaf Flebbe.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _FPU_CONTROL_H
+#define _FPU_CONTROL_H 1
+
+/* Note that this file sets on x86-64 only the x87 FPU, it does not
+ touch the SSE unit. */
+
+/* Here is the dirty part. Set up your 387 through the control word
+ * (cw) register.
+ *
+ * 15-13 12 11-10 9-8 7-6 5 4 3 2 1 0
+ * | reserved | IC | RC | PC | reserved | PM | UM | OM | ZM | DM | IM
+ *
+ * IM: Invalid operation mask
+ * DM: Denormalized operand mask
+ * ZM: Zero-divide mask
+ * OM: Overflow mask
+ * UM: Underflow mask
+ * PM: Precision (inexact result) mask
+ *
+ * Mask bit is 1 means no interrupt.
+ *
+ * PC: Precision control
+ * 11 - round to extended precision
+ * 10 - round to double precision
+ * 00 - round to single precision
+ *
+ * RC: Rounding control
+ * 00 - rounding to nearest
+ * 01 - rounding down (toward - infinity)
+ * 10 - rounding up (toward + infinity)
+ * 11 - rounding toward zero
+ *
+ * IC: Infinity control
+ * That is for 8087 and 80287 only.
+ *
+ * The hardware default is 0x037f which we use.
+ */
+
+#include <features.h>
+
+/* masking of interrupts */
+#define _FPU_MASK_IM 0x01
+#define _FPU_MASK_DM 0x02
+#define _FPU_MASK_ZM 0x04
+#define _FPU_MASK_OM 0x08
+#define _FPU_MASK_UM 0x10
+#define _FPU_MASK_PM 0x20
+
+/* precision control */
+#define _FPU_EXTENDED 0x300 /* libm requires double extended precision. */
+#define _FPU_DOUBLE 0x200
+#define _FPU_SINGLE 0x0
+
+/* rounding control */
+#define _FPU_RC_NEAREST 0x0 /* RECOMMENDED */
+#define _FPU_RC_DOWN 0x400
+#define _FPU_RC_UP 0x800
+#define _FPU_RC_ZERO 0xC00
+
+#define _FPU_RESERVED 0xF0C0 /* Reserved bits in cw */
+
+
+/* The fdlibm code requires strict IEEE double precision arithmetic,
+ and no interrupts for exceptions, rounding to nearest. */
+
+#define _FPU_DEFAULT 0x037f
+
+/* IEEE: same as above. */
+#define _FPU_IEEE 0x037f
+
+/* Type of the control word. */
+typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__HI__)));
+
+/* Macros for accessing the hardware control word. */
+#define _FPU_GETCW(cw) __asm__ ("fnstcw %0" : "=m" (*&cw))
+#define _FPU_SETCW(cw) __asm__ ("fldcw %0" : : "m" (*&cw))
+
+/* Default control word set at startup. */
+extern fpu_control_t __fpu_control;
+
+#endif /* fpu_control.h */
diff --git a/sysroot/usr/include/fstab.h b/sysroot/usr/include/fstab.h
new file mode 100644
index 0000000..24ecad7
--- /dev/null
+++ b/sysroot/usr/include/fstab.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)fstab.h 8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _FSTAB_H
+#define _FSTAB_H 1
+
+#include <features.h>
+
+/*
+ * File system table, see fstab(5).
+ *
+ * Used by dump, mount, umount, swapon, fsck, df, ...
+ *
+ * For ufs fs_spec field is the block special name. Programs that want to
+ * use the character special name must create that name by prepending a 'r'
+ * after the right most slash. Quota files are always named "quotas", so
+ * if type is "rq", then use concatenation of fs_file and "quotas" to locate
+ * quota file.
+ */
+#define _PATH_FSTAB "/etc/fstab"
+#define FSTAB "/etc/fstab" /* deprecated */
+
+#define FSTAB_RW "rw" /* read/write device */
+#define FSTAB_RQ "rq" /* read/write with quotas */
+#define FSTAB_RO "ro" /* read-only device */
+#define FSTAB_SW "sw" /* swap device */
+#define FSTAB_XX "xx" /* ignore totally */
+
+struct fstab
+ {
+ char *fs_spec; /* block special device name */
+ char *fs_file; /* file system path prefix */
+ char *fs_vfstype; /* File system type, ufs, nfs */
+ char *fs_mntops; /* Mount options ala -o */
+ const char *fs_type; /* FSTAB_* from fs_mntops */
+ int fs_freq; /* dump frequency, in days */
+ int fs_passno; /* pass number on parallel dump */
+ };
+
+
+__BEGIN_DECLS
+
+extern struct fstab *getfsent (void) __THROW;
+extern struct fstab *getfsspec (__const char *__name) __THROW;
+extern struct fstab *getfsfile (__const char *__name) __THROW;
+extern int setfsent (void) __THROW;
+extern void endfsent (void) __THROW;
+
+__END_DECLS
+
+#endif /* fstab.h */
diff --git a/sysroot/usr/include/fts.h b/sysroot/usr/include/fts.h
new file mode 100644
index 0000000..0a070ba
--- /dev/null
+++ b/sysroot/usr/include/fts.h
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)fts.h 8.3 (Berkeley) 8/14/94
+ */
+
+#ifndef _FTS_H
+#define _FTS_H 1
+
+#include <features.h>
+#include <sys/types.h>
+
+/* The fts interface is incompatible with the LFS interface which
+ transparently uses the 64-bit file access functions. */
+#ifdef __USE_FILE_OFFSET64
+# error "<fts.h> cannot be used with -D_FILE_OFFSET_BITS==64"
+#endif
+
+
+typedef struct {
+ struct _ftsent *fts_cur; /* current node */
+ struct _ftsent *fts_child; /* linked list of children */
+ struct _ftsent **fts_array; /* sort array */
+ dev_t fts_dev; /* starting device # */
+ char *fts_path; /* path for this descent */
+ int fts_rfd; /* fd for root */
+ int fts_pathlen; /* sizeof(path) */
+ int fts_nitems; /* elements in the sort array */
+ int (*fts_compar) (const void *, const void *); /* compare fn */
+
+#define FTS_COMFOLLOW 0x0001 /* follow command line symlinks */
+#define FTS_LOGICAL 0x0002 /* logical walk */
+#define FTS_NOCHDIR 0x0004 /* don't change directories */
+#define FTS_NOSTAT 0x0008 /* don't get stat info */
+#define FTS_PHYSICAL 0x0010 /* physical walk */
+#define FTS_SEEDOT 0x0020 /* return dot and dot-dot */
+#define FTS_XDEV 0x0040 /* don't cross devices */
+#define FTS_WHITEOUT 0x0080 /* return whiteout information */
+#define FTS_OPTIONMASK 0x00ff /* valid user option mask */
+
+#define FTS_NAMEONLY 0x0100 /* (private) child names only */
+#define FTS_STOP 0x0200 /* (private) unrecoverable error */
+ int fts_options; /* fts_open options, global flags */
+} FTS;
+
+typedef struct _ftsent {
+ struct _ftsent *fts_cycle; /* cycle node */
+ struct _ftsent *fts_parent; /* parent directory */
+ struct _ftsent *fts_link; /* next file in directory */
+ long fts_number; /* local numeric value */
+ void *fts_pointer; /* local address value */
+ char *fts_accpath; /* access path */
+ char *fts_path; /* root path */
+ int fts_errno; /* errno for this node */
+ int fts_symfd; /* fd for symlink */
+ u_short fts_pathlen; /* strlen(fts_path) */
+ u_short fts_namelen; /* strlen(fts_name) */
+
+ ino_t fts_ino; /* inode */
+ dev_t fts_dev; /* device */
+ nlink_t fts_nlink; /* link count */
+
+#define FTS_ROOTPARENTLEVEL -1
+#define FTS_ROOTLEVEL 0
+ short fts_level; /* depth (-1 to N) */
+
+#define FTS_D 1 /* preorder directory */
+#define FTS_DC 2 /* directory that causes cycles */
+#define FTS_DEFAULT 3 /* none of the above */
+#define FTS_DNR 4 /* unreadable directory */
+#define FTS_DOT 5 /* dot or dot-dot */
+#define FTS_DP 6 /* postorder directory */
+#define FTS_ERR 7 /* error; errno is set */
+#define FTS_F 8 /* regular file */
+#define FTS_INIT 9 /* initialized only */
+#define FTS_NS 10 /* stat(2) failed */
+#define FTS_NSOK 11 /* no stat(2) requested */
+#define FTS_SL 12 /* symbolic link */
+#define FTS_SLNONE 13 /* symbolic link without target */
+#define FTS_W 14 /* whiteout object */
+ u_short fts_info; /* user flags for FTSENT structure */
+
+#define FTS_DONTCHDIR 0x01 /* don't chdir .. to the parent */
+#define FTS_SYMFOLLOW 0x02 /* followed a symlink to get here */
+ u_short fts_flags; /* private flags for FTSENT structure */
+
+#define FTS_AGAIN 1 /* read node again */
+#define FTS_FOLLOW 2 /* follow symbolic link */
+#define FTS_NOINSTR 3 /* no instructions */
+#define FTS_SKIP 4 /* discard node */
+ u_short fts_instr; /* fts_set() instructions */
+
+ struct stat *fts_statp; /* stat(2) information */
+ char fts_name[1]; /* file name */
+} FTSENT;
+
+__BEGIN_DECLS
+FTSENT *fts_children (FTS *, int);
+int fts_close (FTS *);
+FTS *fts_open (char * const *, int,
+ int (*)(const FTSENT **, const FTSENT **));
+FTSENT *fts_read (FTS *);
+int fts_set (FTS *, FTSENT *, int) __THROW;
+__END_DECLS
+
+#endif /* fts.h */
diff --git a/sysroot/usr/include/ftw.h b/sysroot/usr/include/ftw.h
new file mode 100644
index 0000000..4bdff88
--- /dev/null
+++ b/sysroot/usr/include/ftw.h
@@ -0,0 +1,178 @@
+/* Copyright (C) 1992,1996-1999,2003,2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * X/Open Portability Guide 4.2: ftw.h
+ */
+
+#ifndef _FTW_H
+#define _FTW_H 1
+
+#include <features.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+
+__BEGIN_DECLS
+
+/* Values for the FLAG argument to the user function passed to `ftw'
+ and 'nftw'. */
+enum
+{
+ FTW_F, /* Regular file. */
+#define FTW_F FTW_F
+ FTW_D, /* Directory. */
+#define FTW_D FTW_D
+ FTW_DNR, /* Unreadable directory. */
+#define FTW_DNR FTW_DNR
+ FTW_NS, /* Unstatable file. */
+#define FTW_NS FTW_NS
+
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+
+ FTW_SL, /* Symbolic link. */
+# define FTW_SL FTW_SL
+#endif
+
+#ifdef __USE_XOPEN_EXTENDED
+/* These flags are only passed from the `nftw' function. */
+ FTW_DP, /* Directory, all subdirs have been visited. */
+# define FTW_DP FTW_DP
+ FTW_SLN /* Symbolic link naming non-existing file. */
+# define FTW_SLN FTW_SLN
+
+#endif /* extended X/Open */
+};
+
+
+#ifdef __USE_XOPEN_EXTENDED
+/* Flags for fourth argument of `nftw'. */
+enum
+{
+ FTW_PHYS = 1, /* Perform physical walk, ignore symlinks. */
+# define FTW_PHYS FTW_PHYS
+ FTW_MOUNT = 2, /* Report only files on same file system as the
+ argument. */
+# define FTW_MOUNT FTW_MOUNT
+ FTW_CHDIR = 4, /* Change to current directory while processing it. */
+# define FTW_CHDIR FTW_CHDIR
+ FTW_DEPTH = 8 /* Report files in directory before directory itself.*/
+# define FTW_DEPTH FTW_DEPTH
+# ifdef __USE_GNU
+ ,
+ FTW_ACTIONRETVAL = 16 /* Assume callback to return FTW_* values instead of
+ zero to continue and non-zero to terminate. */
+# define FTW_ACTIONRETVAL FTW_ACTIONRETVAL
+# endif
+};
+
+#ifdef __USE_GNU
+/* Return values from callback functions. */
+enum
+{
+ FTW_CONTINUE = 0, /* Continue with next sibling or for FTW_D with the
+ first child. */
+# define FTW_CONTINUE FTW_CONTINUE
+ FTW_STOP = 1, /* Return from `ftw' or `nftw' with FTW_STOP as return
+ value. */
+# define FTW_STOP FTW_STOP
+ FTW_SKIP_SUBTREE = 2, /* Only meaningful for FTW_D: Don't walk through the
+ subtree, instead just continue with its next
+ sibling. */
+# define FTW_SKIP_SUBTREE FTW_SKIP_SUBTREE
+ FTW_SKIP_SIBLINGS = 3,/* Continue with FTW_DP callback for current directory
+ (if FTW_DEPTH) and then its siblings. */
+# define FTW_SKIP_SIBLINGS FTW_SKIP_SIBLINGS
+};
+#endif
+
+/* Structure used for fourth argument to callback function for `nftw'. */
+struct FTW
+ {
+ int base;
+ int level;
+ };
+#endif /* extended X/Open */
+
+
+/* Convenient types for callback functions. */
+typedef int (*__ftw_func_t) (__const char *__filename,
+ __const struct stat *__status, int __flag);
+#ifdef __USE_LARGEFILE64
+typedef int (*__ftw64_func_t) (__const char *__filename,
+ __const struct stat64 *__status, int __flag);
+#endif
+#ifdef __USE_XOPEN_EXTENDED
+typedef int (*__nftw_func_t) (__const char *__filename,
+ __const struct stat *__status, int __flag,
+ struct FTW *__info);
+# ifdef __USE_LARGEFILE64
+typedef int (*__nftw64_func_t) (__const char *__filename,
+ __const struct stat64 *__status,
+ int __flag, struct FTW *__info);
+# endif
+#endif
+
+/* Call a function on every element in a directory tree.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+#ifndef __USE_FILE_OFFSET64
+extern int ftw (__const char *__dir, __ftw_func_t __func, int __descriptors)
+ __nonnull ((1, 2));
+#else
+# ifdef __REDIRECT
+extern int __REDIRECT (ftw, (__const char *__dir, __ftw_func_t __func,
+ int __descriptors), ftw64) __nonnull ((1, 2));
+# else
+# define ftw ftw64
+# endif
+#endif
+#ifdef __USE_LARGEFILE64
+extern int ftw64 (__const char *__dir, __ftw64_func_t __func,
+ int __descriptors) __nonnull ((1, 2));
+#endif
+
+#ifdef __USE_XOPEN_EXTENDED
+/* Call a function on every element in a directory tree. FLAG allows
+ to specify the behaviour more detailed.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+# ifndef __USE_FILE_OFFSET64
+extern int nftw (__const char *__dir, __nftw_func_t __func, int __descriptors,
+ int __flag) __nonnull ((1, 2));
+# else
+# ifdef __REDIRECT
+extern int __REDIRECT (nftw, (__const char *__dir, __nftw_func_t __func,
+ int __descriptors, int __flag), nftw64)
+ __nonnull ((1, 2));
+# else
+# define nftw nftw64
+# endif
+# endif
+# ifdef __USE_LARGEFILE64
+extern int nftw64 (__const char *__dir, __nftw64_func_t __func,
+ int __descriptors, int __flag) __nonnull ((1, 2));
+# endif
+#endif
+
+__END_DECLS
+
+#endif /* ftw.h */
diff --git a/sysroot/usr/include/gconv.h b/sysroot/usr/include/gconv.h
new file mode 100644
index 0000000..2946335
--- /dev/null
+++ b/sysroot/usr/include/gconv.h
@@ -0,0 +1,180 @@
+/* Copyright (C) 1997-1999, 2000-2002, 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* This header provides no interface for a user to the internals of
+ the gconv implementation in the libc. Therefore there is no use
+ for these definitions beside for writing additional gconv modules. */
+
+#ifndef _GCONV_H
+#define _GCONV_H 1
+
+#include <features.h>
+#define __need_mbstate_t
+#define __need_wint_t
+#include <wchar.h>
+#define __need_size_t
+#define __need_wchar_t
+#include <stddef.h>
+
+/* ISO 10646 value used to signal invalid value. */
+#define __UNKNOWN_10646_CHAR ((wchar_t) 0xfffd)
+
+/* Error codes for gconv functions. */
+enum
+{
+ __GCONV_OK = 0,
+ __GCONV_NOCONV,
+ __GCONV_NODB,
+ __GCONV_NOMEM,
+
+ __GCONV_EMPTY_INPUT,
+ __GCONV_FULL_OUTPUT,
+ __GCONV_ILLEGAL_INPUT,
+ __GCONV_INCOMPLETE_INPUT,
+
+ __GCONV_ILLEGAL_DESCRIPTOR,
+ __GCONV_INTERNAL_ERROR
+};
+
+
+/* Flags the `__gconv_open' function can set. */
+enum
+{
+ __GCONV_IS_LAST = 0x0001,
+ __GCONV_IGNORE_ERRORS = 0x0002
+};
+
+
+/* Forward declarations. */
+struct __gconv_step;
+struct __gconv_step_data;
+struct __gconv_loaded_object;
+struct __gconv_trans_data;
+
+
+/* Type of a conversion function. */
+typedef int (*__gconv_fct) (struct __gconv_step *, struct __gconv_step_data *,
+ __const unsigned char **, __const unsigned char *,
+ unsigned char **, size_t *, int, int);
+
+/* Type of a specialized conversion function for a single byte to INTERNAL. */
+typedef wint_t (*__gconv_btowc_fct) (struct __gconv_step *, unsigned char);
+
+/* Constructor and destructor for local data for conversion step. */
+typedef int (*__gconv_init_fct) (struct __gconv_step *);
+typedef void (*__gconv_end_fct) (struct __gconv_step *);
+
+
+/* Type of a transliteration/transscription function. */
+typedef int (*__gconv_trans_fct) (struct __gconv_step *,
+ struct __gconv_step_data *, void *,
+ __const unsigned char *,
+ __const unsigned char **,
+ __const unsigned char *, unsigned char **,
+ size_t *);
+
+/* Function to call to provide transliteration module with context. */
+typedef int (*__gconv_trans_context_fct) (void *, __const unsigned char *,
+ __const unsigned char *,
+ unsigned char *, unsigned char *);
+
+/* Function to query module about supported encoded character sets. */
+typedef int (*__gconv_trans_query_fct) (__const char *, __const char ***,
+ size_t *);
+
+/* Constructor and destructor for local data for transliteration. */
+typedef int (*__gconv_trans_init_fct) (void **, const char *);
+typedef void (*__gconv_trans_end_fct) (void *);
+
+struct __gconv_trans_data
+{
+ /* Transliteration/Transscription function. */
+ __gconv_trans_fct __trans_fct;
+ __gconv_trans_context_fct __trans_context_fct;
+ __gconv_trans_end_fct __trans_end_fct;
+ void *__data;
+ struct __gconv_trans_data *__next;
+};
+
+
+/* Description of a conversion step. */
+struct __gconv_step
+{
+ struct __gconv_loaded_object *__shlib_handle;
+ __const char *__modname;
+
+ int __counter;
+
+ char *__from_name;
+ char *__to_name;
+
+ __gconv_fct __fct;
+ __gconv_btowc_fct __btowc_fct;
+ __gconv_init_fct __init_fct;
+ __gconv_end_fct __end_fct;
+
+ /* Information about the number of bytes needed or produced in this
+ step. This helps optimizing the buffer sizes. */
+ int __min_needed_from;
+ int __max_needed_from;
+ int __min_needed_to;
+ int __max_needed_to;
+
+ /* Flag whether this is a stateful encoding or not. */
+ int __stateful;
+
+ void *__data; /* Pointer to step-local data. */
+};
+
+/* Additional data for steps in use of conversion descriptor. This is
+ allocated by the `init' function. */
+struct __gconv_step_data
+{
+ unsigned char *__outbuf; /* Output buffer for this step. */
+ unsigned char *__outbufend; /* Address of first byte after the output
+ buffer. */
+
+ /* Is this the last module in the chain. */
+ int __flags;
+
+ /* Counter for number of invocations of the module function for this
+ descriptor. */
+ int __invocation_counter;
+
+ /* Flag whether this is an internal use of the module (in the mb*towc*
+ and wc*tomb* functions) or regular with iconv(3). */
+ int __internal_use;
+
+ __mbstate_t *__statep;
+ __mbstate_t __state; /* This element must not be used directly by
+ any module; always use STATEP! */
+
+ /* Transliteration information. */
+ struct __gconv_trans_data *__trans;
+};
+
+
+/* Combine conversion step description with data. */
+typedef struct __gconv_info
+{
+ size_t __nsteps;
+ struct __gconv_step *__steps;
+ __extension__ struct __gconv_step_data __data __flexarr;
+} *__gconv_t;
+
+#endif /* gconv.h */
diff --git a/sysroot/usr/include/getopt.h b/sysroot/usr/include/getopt.h
new file mode 100644
index 0000000..b7a026c
--- /dev/null
+++ b/sysroot/usr/include/getopt.h
@@ -0,0 +1,177 @@
+/* Declarations for getopt.
+ Copyright (C) 1989-1994,1996-1999,2001,2003,2004
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _GETOPT_H
+
+#ifndef __need_getopt
+# define _GETOPT_H 1
+#endif
+
+/* If __GNU_LIBRARY__ is not already defined, either we are being used
+ standalone, or this is the first header included in the source file.
+ If we are being used with glibc, we need to include <features.h>, but
+ that does not exist if we are standalone. So: if __GNU_LIBRARY__ is
+ not defined, include <ctype.h>, which will pull in <features.h> for us
+ if it's from glibc. (Why ctype.h? It's guaranteed to exist and it
+ doesn't flood the namespace with stuff the way some other headers do.) */
+#if !defined __GNU_LIBRARY__
+# include <ctype.h>
+#endif
+
+#ifndef __THROW
+# ifndef __GNUC_PREREQ
+# define __GNUC_PREREQ(maj, min) (0)
+# endif
+# if defined __cplusplus && __GNUC_PREREQ (2,8)
+# define __THROW throw ()
+# else
+# define __THROW
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* For communication from `getopt' to the caller.
+ When `getopt' finds an option that takes an argument,
+ the argument value is returned here.
+ Also, when `ordering' is RETURN_IN_ORDER,
+ each non-option ARGV-element is returned here. */
+
+extern char *optarg;
+
+/* Index in ARGV of the next element to be scanned.
+ This is used for communication to and from the caller
+ and for communication between successive calls to `getopt'.
+
+ On entry to `getopt', zero means this is the first call; initialize.
+
+ When `getopt' returns -1, this is the index of the first of the
+ non-option elements that the caller should itself scan.
+
+ Otherwise, `optind' communicates from one call to the next
+ how much of ARGV has been scanned so far. */
+
+extern int optind;
+
+/* Callers store zero here to inhibit the error message `getopt' prints
+ for unrecognized options. */
+
+extern int opterr;
+
+/* Set to an option character which was unrecognized. */
+
+extern int optopt;
+
+#ifndef __need_getopt
+/* Describe the long-named options requested by the application.
+ The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
+ of `struct option' terminated by an element containing a name which is
+ zero.
+
+ The field `has_arg' is:
+ no_argument (or 0) if the option does not take an argument,
+ required_argument (or 1) if the option requires an argument,
+ optional_argument (or 2) if the option takes an optional argument.
+
+ If the field `flag' is not NULL, it points to a variable that is set
+ to the value given in the field `val' when the option is found, but
+ left unchanged if the option is not found.
+
+ To have a long-named option do something other than set an `int' to
+ a compiled-in constant, such as set a value from `optarg', set the
+ option's `flag' field to zero and its `val' field to a nonzero
+ value (the equivalent single-letter option character, if there is
+ one). For long options that have a zero `flag' field, `getopt'
+ returns the contents of the `val' field. */
+
+struct option
+{
+ const char *name;
+ /* has_arg can't be an enum because some compilers complain about
+ type mismatches in all the code that assumes it is an int. */
+ int has_arg;
+ int *flag;
+ int val;
+};
+
+/* Names for the values of the `has_arg' field of `struct option'. */
+
+# define no_argument 0
+# define required_argument 1
+# define optional_argument 2
+#endif /* need getopt */
+
+
+/* Get definitions and prototypes for functions to process the
+ arguments in ARGV (ARGC of them, minus the program name) for
+ options given in OPTS.
+
+ Return the option character from OPTS just read. Return -1 when
+ there are no more options. For unrecognized options, or options
+ missing arguments, `optopt' is set to the option letter, and '?' is
+ returned.
+
+ The OPTS string is a list of characters which are recognized option
+ letters, optionally followed by colons, specifying that that letter
+ takes an argument, to be placed in `optarg'.
+
+ If a letter in OPTS is followed by two colons, its argument is
+ optional. This behavior is specific to the GNU `getopt'.
+
+ The argument `--' causes premature termination of argument
+ scanning, explicitly telling `getopt' that there are no more
+ options.
+
+ If OPTS begins with `--', then non-option arguments are treated as
+ arguments to the option '\0'. This behavior is specific to the GNU
+ `getopt'. */
+
+#ifdef __GNU_LIBRARY__
+/* Many other libraries have conflicting prototypes for getopt, with
+ differences in the consts, in stdlib.h. To avoid compilation
+ errors, only prototype getopt for the GNU C library. */
+extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
+ __THROW;
+#else /* not __GNU_LIBRARY__ */
+extern int getopt ();
+#endif /* __GNU_LIBRARY__ */
+
+#ifndef __need_getopt
+extern int getopt_long (int ___argc, char *const *___argv,
+ const char *__shortopts,
+ const struct option *__longopts, int *__longind)
+ __THROW;
+extern int getopt_long_only (int ___argc, char *const *___argv,
+ const char *__shortopts,
+ const struct option *__longopts, int *__longind)
+ __THROW;
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+/* Make sure we later can get all the definitions and declarations. */
+#undef __need_getopt
+
+#endif /* getopt.h */
diff --git a/sysroot/usr/include/glob.h b/sysroot/usr/include/glob.h
new file mode 100644
index 0000000..3d401f0
--- /dev/null
+++ b/sysroot/usr/include/glob.h
@@ -0,0 +1,194 @@
+/* Copyright (C) 1991,92,95-98,2000,2001,2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _GLOB_H
+#define _GLOB_H 1
+
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+
+/* We need `size_t' for the following definitions. */
+#ifndef __size_t
+# if defined __GNUC__ && __GNUC__ >= 2
+typedef __SIZE_TYPE__ __size_t;
+# ifdef __USE_XOPEN
+typedef __SIZE_TYPE__ size_t;
+# endif
+# else
+# include <stddef.h>
+# ifndef __size_t
+# define __size_t size_t
+# endif
+# endif
+#else
+/* The GNU CC stddef.h version defines __size_t as empty. We need a real
+ definition. */
+# undef __size_t
+# define __size_t size_t
+#endif
+
+/* Bits set in the FLAGS argument to `glob'. */
+#define GLOB_ERR (1 << 0)/* Return on read errors. */
+#define GLOB_MARK (1 << 1)/* Append a slash to each name. */
+#define GLOB_NOSORT (1 << 2)/* Don't sort the names. */
+#define GLOB_DOOFFS (1 << 3)/* Insert PGLOB->gl_offs NULLs. */
+#define GLOB_NOCHECK (1 << 4)/* If nothing matches, return the pattern. */
+#define GLOB_APPEND (1 << 5)/* Append to results of a previous call. */
+#define GLOB_NOESCAPE (1 << 6)/* Backslashes don't quote metacharacters. */
+#define GLOB_PERIOD (1 << 7)/* Leading `.' can be matched by metachars. */
+
+#if !defined __USE_POSIX2 || defined __USE_BSD || defined __USE_GNU
+# define GLOB_MAGCHAR (1 << 8)/* Set in gl_flags if any metachars seen. */
+# define GLOB_ALTDIRFUNC (1 << 9)/* Use gl_opendir et al functions. */
+# define GLOB_BRACE (1 << 10)/* Expand "{a,b}" to "a" "b". */
+# define GLOB_NOMAGIC (1 << 11)/* If no magic chars, return the pattern. */
+# define GLOB_TILDE (1 << 12)/* Expand ~user and ~ to home directories. */
+# define GLOB_ONLYDIR (1 << 13)/* Match only directories. */
+# define GLOB_TILDE_CHECK (1 << 14)/* Like GLOB_TILDE but return an error
+ if the user name is not available. */
+# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
+ GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
+ GLOB_PERIOD|GLOB_ALTDIRFUNC|GLOB_BRACE| \
+ GLOB_NOMAGIC|GLOB_TILDE|GLOB_ONLYDIR|GLOB_TILDE_CHECK)
+#else
+# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
+ GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
+ GLOB_PERIOD)
+#endif
+
+/* Error returns from `glob'. */
+#define GLOB_NOSPACE 1 /* Ran out of memory. */
+#define GLOB_ABORTED 2 /* Read error. */
+#define GLOB_NOMATCH 3 /* No matches found. */
+#define GLOB_NOSYS 4 /* Not implemented. */
+#ifdef __USE_GNU
+/* Previous versions of this file defined GLOB_ABEND instead of
+ GLOB_ABORTED. Provide a compatibility definition here. */
+# define GLOB_ABEND GLOB_ABORTED
+#endif
+
+/* Structure describing a globbing run. */
+#ifdef __USE_GNU
+struct stat;
+#endif
+typedef struct
+ {
+ __size_t gl_pathc; /* Count of paths matched by the pattern. */
+ char **gl_pathv; /* List of matched pathnames. */
+ __size_t gl_offs; /* Slots to reserve in `gl_pathv'. */
+ int gl_flags; /* Set to FLAGS, maybe | GLOB_MAGCHAR. */
+
+ /* If the GLOB_ALTDIRFUNC flag is set, the following functions
+ are used instead of the normal file access functions. */
+ void (*gl_closedir) (void *);
+#ifdef __USE_GNU
+ struct dirent *(*gl_readdir) (void *);
+#else
+ void *(*gl_readdir) (void *);
+#endif
+ void *(*gl_opendir) (__const char *);
+#ifdef __USE_GNU
+ int (*gl_lstat) (__const char *__restrict, struct stat *__restrict);
+ int (*gl_stat) (__const char *__restrict, struct stat *__restrict);
+#else
+ int (*gl_lstat) (__const char *__restrict, void *__restrict);
+ int (*gl_stat) (__const char *__restrict, void *__restrict);
+#endif
+ } glob_t;
+
+#ifdef __USE_LARGEFILE64
+# ifdef __USE_GNU
+struct stat64;
+# endif
+typedef struct
+ {
+ __size_t gl_pathc;
+ char **gl_pathv;
+ __size_t gl_offs;
+ int gl_flags;
+
+ /* If the GLOB_ALTDIRFUNC flag is set, the following functions
+ are used instead of the normal file access functions. */
+ void (*gl_closedir) (void *);
+# ifdef __USE_GNU
+ struct dirent64 *(*gl_readdir) (void *);
+# else
+ void *(*gl_readdir) (void *);
+# endif
+ void *(*gl_opendir) (__const char *);
+# ifdef __USE_GNU
+ int (*gl_lstat) (__const char *__restrict, struct stat64 *__restrict);
+ int (*gl_stat) (__const char *__restrict, struct stat64 *__restrict);
+# else
+ int (*gl_lstat) (__const char *__restrict, void *__restrict);
+ int (*gl_stat) (__const char *__restrict, void *__restrict);
+# endif
+ } glob64_t;
+#endif
+
+#if __USE_FILE_OFFSET64 && __GNUC__ < 2
+# define glob glob64
+# define globfree globfree64
+#endif
+
+/* Do glob searching for PATTERN, placing results in PGLOB.
+ The bits defined above may be set in FLAGS.
+ If a directory cannot be opened or read and ERRFUNC is not nil,
+ it is called with the pathname that caused the error, and the
+ `errno' value from the failing call; if it returns non-zero
+ `glob' returns GLOB_ABEND; if it returns zero, the error is ignored.
+ If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned.
+ Otherwise, `glob' returns zero. */
+#if !defined __USE_FILE_OFFSET64 || __GNUC__ < 2
+extern int glob (__const char *__restrict __pattern, int __flags,
+ int (*__errfunc) (__const char *, int),
+ glob_t *__restrict __pglob) __THROW;
+
+/* Free storage allocated in PGLOB by a previous `glob' call. */
+extern void globfree (glob_t *__pglob) __THROW;
+#else
+extern int __REDIRECT_NTH (glob, (__const char *__restrict __pattern,
+ int __flags,
+ int (*__errfunc) (__const char *, int),
+ glob_t *__restrict __pglob), glob64);
+
+extern void __REDIRECT_NTH (globfree, (glob_t *__pglob), globfree64);
+#endif
+
+#ifdef __USE_LARGEFILE64
+extern int glob64 (__const char *__restrict __pattern, int __flags,
+ int (*__errfunc) (__const char *, int),
+ glob64_t *__restrict __pglob) __THROW;
+
+extern void globfree64 (glob64_t *__pglob) __THROW;
+#endif
+
+
+#ifdef __USE_GNU
+/* Return nonzero if PATTERN contains any metacharacters.
+ Metacharacters can be quoted with backslashes if QUOTE is nonzero.
+
+ This function is not part of the interface specified by POSIX.2
+ but several programs want to use it. */
+extern int glob_pattern_p (__const char *__pattern, int __quote) __THROW;
+#endif
+
+__END_DECLS
+
+#endif /* glob.h */
diff --git a/sysroot/usr/include/gnu-versions.h b/sysroot/usr/include/gnu-versions.h
new file mode 100644
index 0000000..59e617c
--- /dev/null
+++ b/sysroot/usr/include/gnu-versions.h
@@ -0,0 +1,53 @@
+/* Header with interface version macros for library pieces copied elsewhere.
+ Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _GNU_VERSIONS_H
+#define _GNU_VERSIONS_H 1
+
+/* This file exists to define these few macros. Each specifies a version
+ number associated with the library interface of a piece of the C library
+ which is also distributed with other GNU packages. These pieces are
+ both part of the GNU C library and also distributed with other GNU
+ packages so those packages may use their facilities on systems lacking
+ the GNU C library. The source files for each piece surround all their
+ code with `#ifndef ELIDE_CODE' after defining it with this:
+
+ #define OBSTACK_INTERFACE_VERSION 1
+ #if !defined (_LIBC) && defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1
+ #include <gnu-versions.h>
+ #if _GNU_OBSTACK_INTERFACE_VERSION == OBSTACK_INTERFACE_VERSION
+ #define ELIDE_CODE
+ #endif
+ #endif
+
+ This allows those one to avoid compiling those files when part of a GNU
+ package not libc, on a system using a GNU C library that supports the
+ same interface.
+
+ Please preserve the format of the comments after each macro. And
+ remember, if any of these versions change, the libc.so major version
+ number must change too (so avoid it)! */
+
+#define _GNU_OBSTACK_INTERFACE_VERSION 1 /* vs malloc/obstack.c */
+#define _GNU_REGEX_INTERFACE_VERSION 1 /* vs posix/regex.c */
+#define _GNU_GLOB_INTERFACE_VERSION 1 /* vs posix/glob.c */
+#define _GNU_GETOPT_INTERFACE_VERSION 2 /* vs posix/getopt.c and
+ posix/getopt1.c */
+
+#endif /* gnu-versions.h */
diff --git a/sysroot/usr/include/gnu/lib-names.h b/sysroot/usr/include/gnu/lib-names.h
new file mode 100644
index 0000000..fbd10ee
--- /dev/null
+++ b/sysroot/usr/include/gnu/lib-names.h
@@ -0,0 +1,57 @@
+/* This file is automatically generated.
+ It defines macros to allow user program to find the shared
+ library files which come as part of GNU libc. */
+#ifndef __GNU_LIB_NAMES_H
+#define __GNU_LIB_NAMES_H 1
+
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+# define LD_LINUX_SO "ld-linux.so.2"
+# define LD_SO "ld-linux.so.2"
+# define LIBANL_SO "libanl.so.1"
+# define LIBBROKENLOCALE_SO "libBrokenLocale.so.1"
+# define LIBCIDN_SO "libcidn.so.1"
+# define LIBCRYPT_SO "libcrypt.so.1"
+# define LIBC_SO "libc.so.6"
+# define LIBDL_SO "libdl.so.2"
+# define LIBM_SO "libm.so.6"
+# define LIBNSL_SO "libnsl.so.1"
+# define LIBNSS_COMPAT_SO "libnss_compat.so.2"
+# define LIBNSS_DNS_SO "libnss_dns.so.2"
+# define LIBNSS_FILES_SO "libnss_files.so.2"
+# define LIBNSS_HESIOD_SO "libnss_hesiod.so.2"
+# define LIBNSS_LDAP_SO "libnss_ldap.so.2"
+# define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2"
+# define LIBNSS_NIS_SO "libnss_nis.so.2"
+# define LIBPTHREAD_SO "libpthread.so.0"
+# define LIBRESOLV_SO "libresolv.so.2"
+# define LIBRT_SO "librt.so.1"
+# define LIBTHREAD_DB_SO "libthread_db.so.1"
+# define LIBUTIL_SO "libutil.so.1"
+#else
+# define LD_LINUX_X86_64_SO "ld-linux-x86-64.so.2"
+# define LD_SO "ld-linux-x86-64.so.2"
+# define LIBANL_SO "libanl.so.1"
+# define LIBBROKENLOCALE_SO "libBrokenLocale.so.1"
+# define LIBCIDN_SO "libcidn.so.1"
+# define LIBCRYPT_SO "libcrypt.so.1"
+# define LIBC_SO "libc.so.6"
+# define LIBDL_SO "libdl.so.2"
+# define LIBM_SO "libm.so.6"
+# define LIBNSL_SO "libnsl.so.1"
+# define LIBNSS_COMPAT_SO "libnss_compat.so.2"
+# define LIBNSS_DNS_SO "libnss_dns.so.2"
+# define LIBNSS_FILES_SO "libnss_files.so.2"
+# define LIBNSS_HESIOD_SO "libnss_hesiod.so.2"
+# define LIBNSS_LDAP_SO "libnss_ldap.so.2"
+# define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2"
+# define LIBNSS_NIS_SO "libnss_nis.so.2"
+# define LIBPTHREAD_SO "libpthread.so.0"
+# define LIBRESOLV_SO "libresolv.so.2"
+# define LIBRT_SO "librt.so.1"
+# define LIBTHREAD_DB_SO "libthread_db.so.1"
+# define LIBUTIL_SO "libutil.so.1"
+#endif
+
+#endif /* gnu/lib-names.h */
diff --git a/sysroot/usr/include/gnu/libc-version.h b/sysroot/usr/include/gnu/libc-version.h
new file mode 100644
index 0000000..57071fd
--- /dev/null
+++ b/sysroot/usr/include/gnu/libc-version.h
@@ -0,0 +1,35 @@
+/* Interface to GNU libc specific functions for version information.
+ Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _GNU_LIBC_VERSION_H
+#define _GNU_LIBC_VERSION_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Return string describing release status of currently running GNU libc. */
+extern const char *gnu_get_libc_release (void) __THROW;
+
+/* Return string describing version of currently running GNU libc. */
+extern const char *gnu_get_libc_version (void) __THROW;
+
+__END_DECLS
+
+#endif /* gnu/libc-version.h */
diff --git a/sysroot/usr/include/gnu/stubs-32.h b/sysroot/usr/include/gnu/stubs-32.h
new file mode 100644
index 0000000..7f869bc
--- /dev/null
+++ b/sysroot/usr/include/gnu/stubs-32.h
@@ -0,0 +1,23 @@
+/* This file is automatically generated.
+ It defines a symbol `__stub_FUNCTION' for each function
+ in the C library which is a stub, meaning it will fail
+ every time called, usually setting errno to ENOSYS. */
+
+#ifdef _LIBC
+# error Applications may not define the macro _LIBC
+#endif
+
+#define __stub___kernel_cosl
+#define __stub___kernel_sinl
+#define __stub___kernel_tanl
+#define __stub_chflags
+#define __stub_fattach
+#define __stub_fchflags
+#define __stub_fdetach
+#define __stub_gtty
+#define __stub_lchmod
+#define __stub_revoke
+#define __stub_setlogin
+#define __stub_sigreturn
+#define __stub_sstk
+#define __stub_stty
diff --git a/sysroot/usr/include/gnu/stubs.h b/sysroot/usr/include/gnu/stubs.h
new file mode 100644
index 0000000..fc086bd
--- /dev/null
+++ b/sysroot/usr/include/gnu/stubs.h
@@ -0,0 +1,12 @@
+/* This file selects the right generated file of `__stub_FUNCTION' macros
+ based on the architecture being compiled for. */
+
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+# include <gnu/stubs-32.h>
+#elif __WORDSIZE == 64
+# include <gnu/stubs-64.h>
+#else
+# error "unexpected value for __WORDSIZE macro"
+#endif
diff --git a/sysroot/usr/include/grp.h b/sysroot/usr/include/grp.h
new file mode 100644
index 0000000..d7cc69d
--- /dev/null
+++ b/sysroot/usr/include/grp.h
@@ -0,0 +1,205 @@
+/* Copyright (C) 1991,1992,1995-2001,2003,2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * POSIX Standard: 9.2.1 Group Database Access <grp.h>
+ */
+
+#ifndef _GRP_H
+#define _GRP_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+#include <bits/types.h>
+
+#define __need_size_t
+#include <stddef.h>
+
+
+/* For the Single Unix specification we must define this type here. */
+#if (defined __USE_XOPEN || defined __USE_XOPEN2K) && !defined __gid_t_defined
+typedef __gid_t gid_t;
+# define __gid_t_defined
+#endif
+
+/* The group structure. */
+struct group
+ {
+ char *gr_name; /* Group name. */
+ char *gr_passwd; /* Password. */
+ __gid_t gr_gid; /* Group ID. */
+ char **gr_mem; /* Member list. */
+ };
+
+
+#if defined __USE_SVID || defined __USE_GNU
+# define __need_FILE
+# include <stdio.h>
+#endif
+
+
+#if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+/* Rewind the group-file stream.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern void setgrent (void);
+
+/* Close the group-file stream.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern void endgrent (void);
+
+/* Read an entry from the group-file stream, opening it if necessary.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct group *getgrent (void);
+#endif
+
+#ifdef __USE_SVID
+/* Read a group entry from STREAM.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern struct group *fgetgrent (FILE *__stream);
+#endif
+
+#ifdef __USE_GNU
+/* Write the given entry onto the given stream.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int putgrent (__const struct group *__restrict __p,
+ FILE *__restrict __f);
+#endif
+
+/* Search for an entry with a matching group ID.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct group *getgrgid (__gid_t __gid);
+
+/* Search for an entry with a matching group name.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct group *getgrnam (__const char *__name);
+
+#if defined __USE_POSIX || defined __USE_MISC
+
+# ifdef __USE_MISC
+/* Reasonable value for the buffer sized used in the reentrant
+ functions below. But better use `sysconf'. */
+# define NSS_BUFLEN_GROUP 1024
+# endif
+
+/* Reentrant versions of some of the functions above.
+
+ PLEASE NOTE: the `getgrent_r' function is not (yet) standardized.
+ The interface may change in later versions of this library. But
+ the interface is designed following the principals used for the
+ other reentrant functions so the chances are good this is what the
+ POSIX people would choose.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+
+# ifdef __USE_GNU
+extern int getgrent_r (struct group *__restrict __resultbuf,
+ char *__restrict __buffer, size_t __buflen,
+ struct group **__restrict __result);
+# endif
+
+/* Search for an entry with a matching group ID.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int getgrgid_r (__gid_t __gid, struct group *__restrict __resultbuf,
+ char *__restrict __buffer, size_t __buflen,
+ struct group **__restrict __result);
+
+/* Search for an entry with a matching group name.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int getgrnam_r (__const char *__restrict __name,
+ struct group *__restrict __resultbuf,
+ char *__restrict __buffer, size_t __buflen,
+ struct group **__restrict __result);
+
+# ifdef __USE_SVID
+/* Read a group entry from STREAM. This function is not standardized
+ an probably never will.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int fgetgrent_r (FILE *__restrict __stream,
+ struct group *__restrict __resultbuf,
+ char *__restrict __buffer, size_t __buflen,
+ struct group **__restrict __result);
+# endif
+
+#endif /* POSIX or reentrant */
+
+
+#ifdef __USE_BSD
+
+# define __need_size_t
+# include <stddef.h>
+
+/* Set the group set for the current user to GROUPS (N of them). */
+extern int setgroups (size_t __n, __const __gid_t *__groups) __THROW;
+
+/* Store at most *NGROUPS members of the group set for USER into
+ *GROUPS. Also include GROUP. The actual number of groups found is
+ returned in *NGROUPS. Return -1 if the if *NGROUPS is too small.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int getgrouplist (__const char *__user, __gid_t __group,
+ __gid_t *__groups, int *__ngroups);
+
+/* Initialize the group set for the current user
+ by reading the group database and using all groups
+ of which USER is a member. Also include GROUP.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int initgroups (__const char *__user, __gid_t __group);
+
+#endif /* Use BSD. */
+
+__END_DECLS
+
+#endif /* grp.h */
diff --git a/sysroot/usr/include/iconv.h b/sysroot/usr/include/iconv.h
new file mode 100644
index 0000000..9aebf9b
--- /dev/null
+++ b/sysroot/usr/include/iconv.h
@@ -0,0 +1,56 @@
+/* Copyright (C) 1997, 1998, 1999, 2000, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _ICONV_H
+#define _ICONV_H 1
+
+#include <features.h>
+#define __need_size_t
+#include <stddef.h>
+
+
+__BEGIN_DECLS
+
+/* Identifier for conversion method from one codeset to another. */
+typedef void *iconv_t;
+
+
+/* Allocate descriptor for code conversion from codeset FROMCODE to
+ codeset TOCODE.
+
+ This function is a possible cancellation points and therefore not
+ marked with __THROW. */
+extern iconv_t iconv_open (__const char *__tocode, __const char *__fromcode);
+
+/* Convert at most *INBYTESLEFT bytes from *INBUF according to the
+ code conversion algorithm specified by CD and place up to
+ *OUTBYTESLEFT bytes in buffer at *OUTBUF. */
+extern size_t iconv (iconv_t __cd, char **__restrict __inbuf,
+ size_t *__restrict __inbytesleft,
+ char **__restrict __outbuf,
+ size_t *__restrict __outbytesleft);
+
+/* Free resources allocated for descriptor CD for code conversion.
+
+ This function is a possible cancellation points and therefore not
+ marked with __THROW. */
+extern int iconv_close (iconv_t __cd);
+
+__END_DECLS
+
+#endif /* iconv.h */
diff --git a/sysroot/usr/include/ieee754.h b/sysroot/usr/include/ieee754.h
new file mode 100644
index 0000000..b17c29a
--- /dev/null
+++ b/sysroot/usr/include/ieee754.h
@@ -0,0 +1,199 @@
+/* Copyright (C) 1992, 1995, 1996, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _IEEE754_H
+
+#define _IEEE754_H 1
+#include <features.h>
+
+#include <endian.h>
+
+__BEGIN_DECLS
+
+union ieee754_float
+ {
+ float f;
+
+ /* This is the IEEE 754 single-precision format. */
+ struct
+ {
+#if __BYTE_ORDER == __BIG_ENDIAN
+ unsigned int negative:1;
+ unsigned int exponent:8;
+ unsigned int mantissa:23;
+#endif /* Big endian. */
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+ unsigned int mantissa:23;
+ unsigned int exponent:8;
+ unsigned int negative:1;
+#endif /* Little endian. */
+ } ieee;
+
+ /* This format makes it easier to see if a NaN is a signalling NaN. */
+ struct
+ {
+#if __BYTE_ORDER == __BIG_ENDIAN
+ unsigned int negative:1;
+ unsigned int exponent:8;
+ unsigned int quiet_nan:1;
+ unsigned int mantissa:22;
+#endif /* Big endian. */
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+ unsigned int mantissa:22;
+ unsigned int quiet_nan:1;
+ unsigned int exponent:8;
+ unsigned int negative:1;
+#endif /* Little endian. */
+ } ieee_nan;
+ };
+
+#define IEEE754_FLOAT_BIAS 0x7f /* Added to exponent. */
+
+
+union ieee754_double
+ {
+ double d;
+
+ /* This is the IEEE 754 double-precision format. */
+ struct
+ {
+#if __BYTE_ORDER == __BIG_ENDIAN
+ unsigned int negative:1;
+ unsigned int exponent:11;
+ /* Together these comprise the mantissa. */
+ unsigned int mantissa0:20;
+ unsigned int mantissa1:32;
+#endif /* Big endian. */
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+# if __FLOAT_WORD_ORDER == __BIG_ENDIAN
+ unsigned int mantissa0:20;
+ unsigned int exponent:11;
+ unsigned int negative:1;
+ unsigned int mantissa1:32;
+# else
+ /* Together these comprise the mantissa. */
+ unsigned int mantissa1:32;
+ unsigned int mantissa0:20;
+ unsigned int exponent:11;
+ unsigned int negative:1;
+# endif
+#endif /* Little endian. */
+ } ieee;
+
+ /* This format makes it easier to see if a NaN is a signalling NaN. */
+ struct
+ {
+#if __BYTE_ORDER == __BIG_ENDIAN
+ unsigned int negative:1;
+ unsigned int exponent:11;
+ unsigned int quiet_nan:1;
+ /* Together these comprise the mantissa. */
+ unsigned int mantissa0:19;
+ unsigned int mantissa1:32;
+#else
+# if __FLOAT_WORD_ORDER == __BIG_ENDIAN
+ unsigned int mantissa0:19;
+ unsigned int quiet_nan:1;
+ unsigned int exponent:11;
+ unsigned int negative:1;
+ unsigned int mantissa1:32;
+# else
+ /* Together these comprise the mantissa. */
+ unsigned int mantissa1:32;
+ unsigned int mantissa0:19;
+ unsigned int quiet_nan:1;
+ unsigned int exponent:11;
+ unsigned int negative:1;
+# endif
+#endif
+ } ieee_nan;
+ };
+
+#define IEEE754_DOUBLE_BIAS 0x3ff /* Added to exponent. */
+
+
+union ieee854_long_double
+ {
+ long double d;
+
+ /* This is the IEEE 854 double-extended-precision format. */
+ struct
+ {
+#if __BYTE_ORDER == __BIG_ENDIAN
+ unsigned int negative:1;
+ unsigned int exponent:15;
+ unsigned int empty:16;
+ unsigned int mantissa0:32;
+ unsigned int mantissa1:32;
+#endif
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+# if __FLOAT_WORD_ORDER == __BIG_ENDIAN
+ unsigned int exponent:15;
+ unsigned int negative:1;
+ unsigned int empty:16;
+ unsigned int mantissa0:32;
+ unsigned int mantissa1:32;
+# else
+ unsigned int mantissa1:32;
+ unsigned int mantissa0:32;
+ unsigned int exponent:15;
+ unsigned int negative:1;
+ unsigned int empty:16;
+# endif
+#endif
+ } ieee;
+
+ /* This is for NaNs in the IEEE 854 double-extended-precision format. */
+ struct
+ {
+#if __BYTE_ORDER == __BIG_ENDIAN
+ unsigned int negative:1;
+ unsigned int exponent:15;
+ unsigned int empty:16;
+ unsigned int one:1;
+ unsigned int quiet_nan:1;
+ unsigned int mantissa0:30;
+ unsigned int mantissa1:32;
+#endif
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+# if __FLOAT_WORD_ORDER == __BIG_ENDIAN
+ unsigned int exponent:15;
+ unsigned int negative:1;
+ unsigned int empty:16;
+ unsigned int mantissa0:30;
+ unsigned int quiet_nan:1;
+ unsigned int one:1;
+ unsigned int mantissa1:32;
+# else
+ unsigned int mantissa1:32;
+ unsigned int mantissa0:30;
+ unsigned int quiet_nan:1;
+ unsigned int one:1;
+ unsigned int exponent:15;
+ unsigned int negative:1;
+ unsigned int empty:16;
+# endif
+#endif
+ } ieee_nan;
+ };
+
+#define IEEE854_LONG_DOUBLE_BIAS 0x3fff
+
+__END_DECLS
+
+#endif /* ieee754.h */
diff --git a/sysroot/usr/include/ifaddrs.h b/sysroot/usr/include/ifaddrs.h
new file mode 100644
index 0000000..ba6a155
--- /dev/null
+++ b/sysroot/usr/include/ifaddrs.h
@@ -0,0 +1,74 @@
+/* ifaddrs.h -- declarations for getting network interface addresses
+ Copyright (C) 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _IFADDRS_H
+#define _IFADDRS_H 1
+
+#include <features.h>
+#include <sys/socket.h>
+
+__BEGIN_DECLS
+
+/* The `getifaddrs' function generates a linked list of these structures.
+ Each element of the list describes one network interface. */
+struct ifaddrs
+{
+ struct ifaddrs *ifa_next; /* Pointer to the next structure. */
+
+ char *ifa_name; /* Name of this network interface. */
+ unsigned int ifa_flags; /* Flags as from SIOCGIFFLAGS ioctl. */
+
+ struct sockaddr *ifa_addr; /* Network address of this interface. */
+ struct sockaddr *ifa_netmask; /* Netmask of this interface. */
+ union
+ {
+ /* At most one of the following two is valid. If the IFF_BROADCAST
+ bit is set in `ifa_flags', then `ifa_broadaddr' is valid. If the
+ IFF_POINTOPOINT bit is set, then `ifa_dstaddr' is valid.
+ It is never the case that both these bits are set at once. */
+ struct sockaddr *ifu_broadaddr; /* Broadcast address of this interface. */
+ struct sockaddr *ifu_dstaddr; /* Point-to-point destination address. */
+ } ifa_ifu;
+ /* These very same macros are defined by <net/if.h> for `struct ifaddr'.
+ So if they are defined already, the existing definitions will be fine. */
+# ifndef ifa_broadaddr
+# define ifa_broadaddr ifa_ifu.ifu_broadaddr
+# endif
+# ifndef ifa_dstaddr
+# define ifa_dstaddr ifa_ifu.ifu_dstaddr
+# endif
+
+ void *ifa_data; /* Address-specific data (may be unused). */
+};
+
+
+/* Create a linked list of `struct ifaddrs' structures, one for each
+ network interface on the host machine. If successful, store the
+ list in *IFAP and return 0. On errors, return -1 and set `errno'.
+
+ The storage returned in *IFAP is allocated dynamically and can
+ only be properly freed by passing it to `freeifaddrs'. */
+extern int getifaddrs (struct ifaddrs **__ifap) __THROW;
+
+/* Reclaim the storage allocated by a previous `getifaddrs' call. */
+extern void freeifaddrs (struct ifaddrs *__ifa) __THROW;
+
+__END_DECLS
+
+#endif /* ifaddrs.h */
diff --git a/sysroot/usr/include/inttypes.h b/sysroot/usr/include/inttypes.h
new file mode 100644
index 0000000..bf0fffa
--- /dev/null
+++ b/sysroot/usr/include/inttypes.h
@@ -0,0 +1,444 @@
+/* Copyright (C) 1997-2001, 2004, 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99: 7.8 Format conversion of integer types <inttypes.h>
+ */
+
+#ifndef _INTTYPES_H
+#define _INTTYPES_H 1
+
+#include <features.h>
+/* Get the type definitions. */
+#include <stdint.h>
+
+/* Get a definition for wchar_t. But we must not define wchar_t itself. */
+#ifndef ____gwchar_t_defined
+# ifdef __cplusplus
+# define __gwchar_t wchar_t
+# elif defined __WCHAR_TYPE__
+typedef __WCHAR_TYPE__ __gwchar_t;
+# else
+# define __need_wchar_t
+# include <stddef.h>
+typedef wchar_t __gwchar_t;
+# endif
+# define ____gwchar_t_defined 1
+#endif
+
+
+/* The ISO C99 standard specifies that these macros must only be
+ defined if explicitly requested. */
+#if !defined __cplusplus || defined __STDC_FORMAT_MACROS
+
+# if __WORDSIZE == 64
+# define __PRI64_PREFIX "l"
+# define __PRIPTR_PREFIX "l"
+# else
+# define __PRI64_PREFIX "ll"
+# define __PRIPTR_PREFIX
+# endif
+
+/* Macros for printing format specifiers. */
+
+/* Decimal notation. */
+# define PRId8 "d"
+# define PRId16 "d"
+# define PRId32 "d"
+# define PRId64 __PRI64_PREFIX "d"
+
+# define PRIdLEAST8 "d"
+# define PRIdLEAST16 "d"
+# define PRIdLEAST32 "d"
+# define PRIdLEAST64 __PRI64_PREFIX "d"
+
+# define PRIdFAST8 "d"
+# define PRIdFAST16 __PRIPTR_PREFIX "d"
+# define PRIdFAST32 __PRIPTR_PREFIX "d"
+# define PRIdFAST64 __PRI64_PREFIX "d"
+
+
+# define PRIi8 "i"
+# define PRIi16 "i"
+# define PRIi32 "i"
+# define PRIi64 __PRI64_PREFIX "i"
+
+# define PRIiLEAST8 "i"
+# define PRIiLEAST16 "i"
+# define PRIiLEAST32 "i"
+# define PRIiLEAST64 __PRI64_PREFIX "i"
+
+# define PRIiFAST8 "i"
+# define PRIiFAST16 __PRIPTR_PREFIX "i"
+# define PRIiFAST32 __PRIPTR_PREFIX "i"
+# define PRIiFAST64 __PRI64_PREFIX "i"
+
+/* Octal notation. */
+# define PRIo8 "o"
+# define PRIo16 "o"
+# define PRIo32 "o"
+# define PRIo64 __PRI64_PREFIX "o"
+
+# define PRIoLEAST8 "o"
+# define PRIoLEAST16 "o"
+# define PRIoLEAST32 "o"
+# define PRIoLEAST64 __PRI64_PREFIX "o"
+
+# define PRIoFAST8 "o"
+# define PRIoFAST16 __PRIPTR_PREFIX "o"
+# define PRIoFAST32 __PRIPTR_PREFIX "o"
+# define PRIoFAST64 __PRI64_PREFIX "o"
+
+/* Unsigned integers. */
+# define PRIu8 "u"
+# define PRIu16 "u"
+# define PRIu32 "u"
+# define PRIu64 __PRI64_PREFIX "u"
+
+# define PRIuLEAST8 "u"
+# define PRIuLEAST16 "u"
+# define PRIuLEAST32 "u"
+# define PRIuLEAST64 __PRI64_PREFIX "u"
+
+# define PRIuFAST8 "u"
+# define PRIuFAST16 __PRIPTR_PREFIX "u"
+# define PRIuFAST32 __PRIPTR_PREFIX "u"
+# define PRIuFAST64 __PRI64_PREFIX "u"
+
+/* lowercase hexadecimal notation. */
+# define PRIx8 "x"
+# define PRIx16 "x"
+# define PRIx32 "x"
+# define PRIx64 __PRI64_PREFIX "x"
+
+# define PRIxLEAST8 "x"
+# define PRIxLEAST16 "x"
+# define PRIxLEAST32 "x"
+# define PRIxLEAST64 __PRI64_PREFIX "x"
+
+# define PRIxFAST8 "x"
+# define PRIxFAST16 __PRIPTR_PREFIX "x"
+# define PRIxFAST32 __PRIPTR_PREFIX "x"
+# define PRIxFAST64 __PRI64_PREFIX "x"
+
+/* UPPERCASE hexadecimal notation. */
+# define PRIX8 "X"
+# define PRIX16 "X"
+# define PRIX32 "X"
+# define PRIX64 __PRI64_PREFIX "X"
+
+# define PRIXLEAST8 "X"
+# define PRIXLEAST16 "X"
+# define PRIXLEAST32 "X"
+# define PRIXLEAST64 __PRI64_PREFIX "X"
+
+# define PRIXFAST8 "X"
+# define PRIXFAST16 __PRIPTR_PREFIX "X"
+# define PRIXFAST32 __PRIPTR_PREFIX "X"
+# define PRIXFAST64 __PRI64_PREFIX "X"
+
+
+/* Macros for printing `intmax_t' and `uintmax_t'. */
+# define PRIdMAX __PRI64_PREFIX "d"
+# define PRIiMAX __PRI64_PREFIX "i"
+# define PRIoMAX __PRI64_PREFIX "o"
+# define PRIuMAX __PRI64_PREFIX "u"
+# define PRIxMAX __PRI64_PREFIX "x"
+# define PRIXMAX __PRI64_PREFIX "X"
+
+
+/* Macros for printing `intptr_t' and `uintptr_t'. */
+# define PRIdPTR __PRIPTR_PREFIX "d"
+# define PRIiPTR __PRIPTR_PREFIX "i"
+# define PRIoPTR __PRIPTR_PREFIX "o"
+# define PRIuPTR __PRIPTR_PREFIX "u"
+# define PRIxPTR __PRIPTR_PREFIX "x"
+# define PRIXPTR __PRIPTR_PREFIX "X"
+
+
+/* Macros for scanning format specifiers. */
+
+/* Signed decimal notation. */
+# define SCNd8 "hhd"
+# define SCNd16 "hd"
+# define SCNd32 "d"
+# define SCNd64 __PRI64_PREFIX "d"
+
+# define SCNdLEAST8 "hhd"
+# define SCNdLEAST16 "hd"
+# define SCNdLEAST32 "d"
+# define SCNdLEAST64 __PRI64_PREFIX "d"
+
+# define SCNdFAST8 "hhd"
+# define SCNdFAST16 __PRIPTR_PREFIX "d"
+# define SCNdFAST32 __PRIPTR_PREFIX "d"
+# define SCNdFAST64 __PRI64_PREFIX "d"
+
+/* Signed decimal notation. */
+# define SCNi8 "hhi"
+# define SCNi16 "hi"
+# define SCNi32 "i"
+# define SCNi64 __PRI64_PREFIX "i"
+
+# define SCNiLEAST8 "hhi"
+# define SCNiLEAST16 "hi"
+# define SCNiLEAST32 "i"
+# define SCNiLEAST64 __PRI64_PREFIX "i"
+
+# define SCNiFAST8 "hhi"
+# define SCNiFAST16 __PRIPTR_PREFIX "i"
+# define SCNiFAST32 __PRIPTR_PREFIX "i"
+# define SCNiFAST64 __PRI64_PREFIX "i"
+
+/* Unsigned decimal notation. */
+# define SCNu8 "hhu"
+# define SCNu16 "hu"
+# define SCNu32 "u"
+# define SCNu64 __PRI64_PREFIX "u"
+
+# define SCNuLEAST8 "hhu"
+# define SCNuLEAST16 "hu"
+# define SCNuLEAST32 "u"
+# define SCNuLEAST64 __PRI64_PREFIX "u"
+
+# define SCNuFAST8 "hhu"
+# define SCNuFAST16 __PRIPTR_PREFIX "u"
+# define SCNuFAST32 __PRIPTR_PREFIX "u"
+# define SCNuFAST64 __PRI64_PREFIX "u"
+
+/* Octal notation. */
+# define SCNo8 "hho"
+# define SCNo16 "ho"
+# define SCNo32 "o"
+# define SCNo64 __PRI64_PREFIX "o"
+
+# define SCNoLEAST8 "hho"
+# define SCNoLEAST16 "ho"
+# define SCNoLEAST32 "o"
+# define SCNoLEAST64 __PRI64_PREFIX "o"
+
+# define SCNoFAST8 "hho"
+# define SCNoFAST16 __PRIPTR_PREFIX "o"
+# define SCNoFAST32 __PRIPTR_PREFIX "o"
+# define SCNoFAST64 __PRI64_PREFIX "o"
+
+/* Hexadecimal notation. */
+# define SCNx8 "hhx"
+# define SCNx16 "hx"
+# define SCNx32 "x"
+# define SCNx64 __PRI64_PREFIX "x"
+
+# define SCNxLEAST8 "hhx"
+# define SCNxLEAST16 "hx"
+# define SCNxLEAST32 "x"
+# define SCNxLEAST64 __PRI64_PREFIX "x"
+
+# define SCNxFAST8 "hhx"
+# define SCNxFAST16 __PRIPTR_PREFIX "x"
+# define SCNxFAST32 __PRIPTR_PREFIX "x"
+# define SCNxFAST64 __PRI64_PREFIX "x"
+
+
+/* Macros for scanning `intmax_t' and `uintmax_t'. */
+# define SCNdMAX __PRI64_PREFIX "d"
+# define SCNiMAX __PRI64_PREFIX "i"
+# define SCNoMAX __PRI64_PREFIX "o"
+# define SCNuMAX __PRI64_PREFIX "u"
+# define SCNxMAX __PRI64_PREFIX "x"
+
+/* Macros for scaning `intptr_t' and `uintptr_t'. */
+# define SCNdPTR __PRIPTR_PREFIX "d"
+# define SCNiPTR __PRIPTR_PREFIX "i"
+# define SCNoPTR __PRIPTR_PREFIX "o"
+# define SCNuPTR __PRIPTR_PREFIX "u"
+# define SCNxPTR __PRIPTR_PREFIX "x"
+
+#endif /* C++ && format macros */
+
+
+__BEGIN_DECLS
+
+#if __WORDSIZE == 64
+
+/* We have to define the `uintmax_t' type using `ldiv_t'. */
+typedef struct
+ {
+ long int quot; /* Quotient. */
+ long int rem; /* Remainder. */
+ } imaxdiv_t;
+
+#else
+
+/* We have to define the `uintmax_t' type using `lldiv_t'. */
+typedef struct
+ {
+ long long int quot; /* Quotient. */
+ long long int rem; /* Remainder. */
+ } imaxdiv_t;
+
+#endif
+
+
+/* Compute absolute value of N. */
+extern intmax_t imaxabs (intmax_t __n) __THROW __attribute__ ((__const__));
+
+/* Return the `imaxdiv_t' representation of the value of NUMER over DENOM. */
+extern imaxdiv_t imaxdiv (intmax_t __numer, intmax_t __denom)
+ __THROW __attribute__ ((__const__));
+
+/* Like `strtol' but convert to `intmax_t'. */
+extern intmax_t strtoimax (__const char *__restrict __nptr,
+ char **__restrict __endptr, int __base) __THROW;
+
+/* Like `strtoul' but convert to `uintmax_t'. */
+extern uintmax_t strtoumax (__const char *__restrict __nptr,
+ char ** __restrict __endptr, int __base) __THROW;
+
+/* Like `wcstol' but convert to `intmax_t'. */
+extern intmax_t wcstoimax (__const __gwchar_t *__restrict __nptr,
+ __gwchar_t **__restrict __endptr, int __base)
+ __THROW;
+
+/* Like `wcstoul' but convert to `uintmax_t'. */
+extern uintmax_t wcstoumax (__const __gwchar_t *__restrict __nptr,
+ __gwchar_t ** __restrict __endptr, int __base)
+ __THROW;
+
+#ifdef __USE_EXTERN_INLINES
+
+# if __WORDSIZE == 64
+
+extern long int __strtol_internal (__const char *__restrict __nptr,
+ char **__restrict __endptr,
+ int __base, int __group)
+ __THROW __nonnull ((1)) __wur;
+/* Like `strtol' but convert to `intmax_t'. */
+__extern_inline intmax_t
+__NTH (strtoimax (__const char *__restrict nptr, char **__restrict endptr,
+ int base))
+{
+ return __strtol_internal (nptr, endptr, base, 0);
+}
+
+extern unsigned long int __strtoul_internal (__const char *
+ __restrict __nptr,
+ char ** __restrict __endptr,
+ int __base, int __group)
+ __THROW __nonnull ((1)) __wur;
+/* Like `strtoul' but convert to `uintmax_t'. */
+__extern_inline uintmax_t
+__NTH (strtoumax (__const char *__restrict nptr, char **__restrict endptr,
+ int base))
+{
+ return __strtoul_internal (nptr, endptr, base, 0);
+}
+
+extern long int __wcstol_internal (__const __gwchar_t * __restrict __nptr,
+ __gwchar_t **__restrict __endptr,
+ int __base, int __group)
+ __THROW __nonnull ((1)) __wur;
+/* Like `wcstol' but convert to `intmax_t'. */
+__extern_inline intmax_t
+__NTH (wcstoimax (__const __gwchar_t *__restrict nptr,
+ __gwchar_t **__restrict endptr, int base))
+{
+ return __wcstol_internal (nptr, endptr, base, 0);
+}
+
+extern unsigned long int __wcstoul_internal (__const __gwchar_t *
+ __restrict __nptr,
+ __gwchar_t **
+ __restrict __endptr,
+ int __base, int __group)
+ __THROW __nonnull ((1)) __wur;
+/* Like `wcstoul' but convert to `uintmax_t'. */
+__extern_inline uintmax_t
+__NTH (wcstoumax (__const __gwchar_t *__restrict nptr,
+ __gwchar_t **__restrict endptr, int base))
+{
+ return __wcstoul_internal (nptr, endptr, base, 0);
+}
+
+# else /* __WORDSIZE == 32 */
+
+__extension__
+extern long long int __strtoll_internal (__const char *__restrict __nptr,
+ char **__restrict __endptr,
+ int __base, int __group)
+ __THROW __nonnull ((1)) __wur;
+/* Like `strtol' but convert to `intmax_t'. */
+__extern_inline intmax_t
+__NTH (strtoimax (__const char *__restrict nptr, char **__restrict endptr,
+ int base))
+{
+ return __strtoll_internal (nptr, endptr, base, 0);
+}
+
+__extension__
+extern unsigned long long int __strtoull_internal (__const char *
+ __restrict __nptr,
+ char **
+ __restrict __endptr,
+ int __base,
+ int __group)
+ __THROW __nonnull ((1)) __wur;
+/* Like `strtoul' but convert to `uintmax_t'. */
+__extern_inline uintmax_t
+__NTH (strtoumax (__const char *__restrict nptr, char **__restrict endptr,
+ int base))
+{
+ return __strtoull_internal (nptr, endptr, base, 0);
+}
+
+__extension__
+extern long long int __wcstoll_internal (__const __gwchar_t *
+ __restrict __nptr,
+ __gwchar_t **__restrict __endptr,
+ int __base, int __group)
+ __THROW __nonnull ((1)) __wur;
+/* Like `wcstol' but convert to `intmax_t'. */
+__extern_inline intmax_t
+__NTH (wcstoimax (__const __gwchar_t *__restrict nptr,
+ __gwchar_t **__restrict endptr, int base))
+{
+ return __wcstoll_internal (nptr, endptr, base, 0);
+}
+
+
+__extension__
+extern unsigned long long int __wcstoull_internal (__const __gwchar_t *
+ __restrict __nptr,
+ __gwchar_t **
+ __restrict __endptr,
+ int __base,
+ int __group)
+ __THROW __nonnull ((1)) __wur;
+/* Like `wcstoul' but convert to `uintmax_t'. */
+__extern_inline uintmax_t
+__NTH (wcstoumax (__const __gwchar_t *__restrict nptr,
+ __gwchar_t **__restrict endptr, int base))
+{
+ return __wcstoull_internal (nptr, endptr, base, 0);
+}
+
+# endif /* __WORDSIZE == 32 */
+#endif /* Use extern inlines. */
+
+__END_DECLS
+
+#endif /* inttypes.h */
diff --git a/sysroot/usr/include/langinfo.h b/sysroot/usr/include/langinfo.h
new file mode 100644
index 0000000..10c4232
--- /dev/null
+++ b/sysroot/usr/include/langinfo.h
@@ -0,0 +1,598 @@
+/* Access to locale-dependent parameters.
+ Copyright (C) 1995-2002,2003,2004,2005 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _LANGINFO_H
+#define _LANGINFO_H 1
+
+/* Get the type definition. */
+#include <nl_types.h>
+
+#include <bits/locale.h> /* Define the __LC_* category names. */
+
+
+__BEGIN_DECLS
+
+/* Construct an `nl_item' value for `nl_langinfo' from a locale category
+ (LC_*) and an item index within the category. Some code may depend on
+ the item values within a category increasing monotonically with the
+ indices. */
+#define _NL_ITEM(category, index) (((category) << 16) | (index))
+
+/* Extract the category and item index from a constructed `nl_item' value. */
+#define _NL_ITEM_CATEGORY(item) ((int) (item) >> 16)
+#define _NL_ITEM_INDEX(item) ((int) (item) & 0xffff)
+
+/* Enumeration of locale items that can be queried with `nl_langinfo'. */
+enum
+{
+ /* LC_TIME category: date and time formatting. */
+
+ /* Abbreviated days of the week. */
+ ABDAY_1 = _NL_ITEM (__LC_TIME, 0), /* Sun */
+#define ABDAY_1 ABDAY_1
+ ABDAY_2,
+#define ABDAY_2 ABDAY_2
+ ABDAY_3,
+#define ABDAY_3 ABDAY_3
+ ABDAY_4,
+#define ABDAY_4 ABDAY_4
+ ABDAY_5,
+#define ABDAY_5 ABDAY_5
+ ABDAY_6,
+#define ABDAY_6 ABDAY_6
+ ABDAY_7,
+#define ABDAY_7 ABDAY_7
+
+ /* Long-named days of the week. */
+ DAY_1, /* Sunday */
+#define DAY_1 DAY_1
+ DAY_2, /* Monday */
+#define DAY_2 DAY_2
+ DAY_3, /* Tuesday */
+#define DAY_3 DAY_3
+ DAY_4, /* Wednesday */
+#define DAY_4 DAY_4
+ DAY_5, /* Thursday */
+#define DAY_5 DAY_5
+ DAY_6, /* Friday */
+#define DAY_6 DAY_6
+ DAY_7, /* Saturday */
+#define DAY_7 DAY_7
+
+ /* Abbreviated month names. */
+ ABMON_1, /* Jan */
+#define ABMON_1 ABMON_1
+ ABMON_2,
+#define ABMON_2 ABMON_2
+ ABMON_3,
+#define ABMON_3 ABMON_3
+ ABMON_4,
+#define ABMON_4 ABMON_4
+ ABMON_5,
+#define ABMON_5 ABMON_5
+ ABMON_6,
+#define ABMON_6 ABMON_6
+ ABMON_7,
+#define ABMON_7 ABMON_7
+ ABMON_8,
+#define ABMON_8 ABMON_8
+ ABMON_9,
+#define ABMON_9 ABMON_9
+ ABMON_10,
+#define ABMON_10 ABMON_10
+ ABMON_11,
+#define ABMON_11 ABMON_11
+ ABMON_12,
+#define ABMON_12 ABMON_12
+
+ /* Long month names. */
+ MON_1, /* January */
+#define MON_1 MON_1
+ MON_2,
+#define MON_2 MON_2
+ MON_3,
+#define MON_3 MON_3
+ MON_4,
+#define MON_4 MON_4
+ MON_5,
+#define MON_5 MON_5
+ MON_6,
+#define MON_6 MON_6
+ MON_7,
+#define MON_7 MON_7
+ MON_8,
+#define MON_8 MON_8
+ MON_9,
+#define MON_9 MON_9
+ MON_10,
+#define MON_10 MON_10
+ MON_11,
+#define MON_11 MON_11
+ MON_12,
+#define MON_12 MON_12
+
+ AM_STR, /* Ante meridiem string. */
+#define AM_STR AM_STR
+ PM_STR, /* Post meridiem string. */
+#define PM_STR PM_STR
+
+ D_T_FMT, /* Date and time format for strftime. */
+#define D_T_FMT D_T_FMT
+ D_FMT, /* Date format for strftime. */
+#define D_FMT D_FMT
+ T_FMT, /* Time format for strftime. */
+#define T_FMT T_FMT
+ T_FMT_AMPM, /* 12-hour time format for strftime. */
+#define T_FMT_AMPM T_FMT_AMPM
+
+ ERA, /* Alternate era. */
+#define ERA ERA
+ __ERA_YEAR, /* Year in alternate era format. */
+#ifdef __USE_GNU
+# define ERA_YEAR __ERA_YEAR
+#endif
+ ERA_D_FMT, /* Date in alternate era format. */
+#define ERA_D_FMT ERA_D_FMT
+ ALT_DIGITS, /* Alternate symbols for digits. */
+#define ALT_DIGITS ALT_DIGITS
+ ERA_D_T_FMT, /* Date and time in alternate era format. */
+#define ERA_D_T_FMT ERA_D_T_FMT
+ ERA_T_FMT, /* Time in alternate era format. */
+#define ERA_T_FMT ERA_T_FMT
+
+ _NL_TIME_ERA_NUM_ENTRIES, /* Number entries in the era arrays. */
+ _NL_TIME_ERA_ENTRIES, /* Structure with era entries in usable form.*/
+
+ _NL_WABDAY_1, /* Sun */
+ _NL_WABDAY_2,
+ _NL_WABDAY_3,
+ _NL_WABDAY_4,
+ _NL_WABDAY_5,
+ _NL_WABDAY_6,
+ _NL_WABDAY_7,
+
+ /* Long-named days of the week. */
+ _NL_WDAY_1, /* Sunday */
+ _NL_WDAY_2, /* Monday */
+ _NL_WDAY_3, /* Tuesday */
+ _NL_WDAY_4, /* Wednesday */
+ _NL_WDAY_5, /* Thursday */
+ _NL_WDAY_6, /* Friday */
+ _NL_WDAY_7, /* Saturday */
+
+ /* Abbreviated month names. */
+ _NL_WABMON_1, /* Jan */
+ _NL_WABMON_2,
+ _NL_WABMON_3,
+ _NL_WABMON_4,
+ _NL_WABMON_5,
+ _NL_WABMON_6,
+ _NL_WABMON_7,
+ _NL_WABMON_8,
+ _NL_WABMON_9,
+ _NL_WABMON_10,
+ _NL_WABMON_11,
+ _NL_WABMON_12,
+
+ /* Long month names. */
+ _NL_WMON_1, /* January */
+ _NL_WMON_2,
+ _NL_WMON_3,
+ _NL_WMON_4,
+ _NL_WMON_5,
+ _NL_WMON_6,
+ _NL_WMON_7,
+ _NL_WMON_8,
+ _NL_WMON_9,
+ _NL_WMON_10,
+ _NL_WMON_11,
+ _NL_WMON_12,
+
+ _NL_WAM_STR, /* Ante meridiem string. */
+ _NL_WPM_STR, /* Post meridiem string. */
+
+ _NL_WD_T_FMT, /* Date and time format for strftime. */
+ _NL_WD_FMT, /* Date format for strftime. */
+ _NL_WT_FMT, /* Time format for strftime. */
+ _NL_WT_FMT_AMPM, /* 12-hour time format for strftime. */
+
+ _NL_WERA_YEAR, /* Year in alternate era format. */
+ _NL_WERA_D_FMT, /* Date in alternate era format. */
+ _NL_WALT_DIGITS, /* Alternate symbols for digits. */
+ _NL_WERA_D_T_FMT, /* Date and time in alternate era format. */
+ _NL_WERA_T_FMT, /* Time in alternate era format. */
+
+ _NL_TIME_WEEK_NDAYS,
+ _NL_TIME_WEEK_1STDAY,
+ _NL_TIME_WEEK_1STWEEK,
+ _NL_TIME_FIRST_WEEKDAY,
+ _NL_TIME_FIRST_WORKDAY,
+ _NL_TIME_CAL_DIRECTION,
+ _NL_TIME_TIMEZONE,
+
+ _DATE_FMT, /* strftime format for date. */
+#define _DATE_FMT _DATE_FMT
+ _NL_W_DATE_FMT,
+
+ _NL_TIME_CODESET,
+
+ _NL_NUM_LC_TIME, /* Number of indices in LC_TIME category. */
+
+ /* LC_COLLATE category: text sorting.
+ This information is accessed by the strcoll and strxfrm functions.
+ These `nl_langinfo' names are used only internally. */
+ _NL_COLLATE_NRULES = _NL_ITEM (__LC_COLLATE, 0),
+ _NL_COLLATE_RULESETS,
+ _NL_COLLATE_TABLEMB,
+ _NL_COLLATE_WEIGHTMB,
+ _NL_COLLATE_EXTRAMB,
+ _NL_COLLATE_INDIRECTMB,
+ _NL_COLLATE_GAP1,
+ _NL_COLLATE_GAP2,
+ _NL_COLLATE_GAP3,
+ _NL_COLLATE_TABLEWC,
+ _NL_COLLATE_WEIGHTWC,
+ _NL_COLLATE_EXTRAWC,
+ _NL_COLLATE_INDIRECTWC,
+ _NL_COLLATE_SYMB_HASH_SIZEMB,
+ _NL_COLLATE_SYMB_TABLEMB,
+ _NL_COLLATE_SYMB_EXTRAMB,
+ _NL_COLLATE_COLLSEQMB,
+ _NL_COLLATE_COLLSEQWC,
+ _NL_COLLATE_CODESET,
+ _NL_NUM_LC_COLLATE,
+
+ /* LC_CTYPE category: character classification.
+ This information is accessed by the functions in <ctype.h>.
+ These `nl_langinfo' names are used only internally. */
+ _NL_CTYPE_CLASS = _NL_ITEM (__LC_CTYPE, 0),
+ _NL_CTYPE_TOUPPER,
+ _NL_CTYPE_GAP1,
+ _NL_CTYPE_TOLOWER,
+ _NL_CTYPE_GAP2,
+ _NL_CTYPE_CLASS32,
+ _NL_CTYPE_GAP3,
+ _NL_CTYPE_GAP4,
+ _NL_CTYPE_GAP5,
+ _NL_CTYPE_GAP6,
+ _NL_CTYPE_CLASS_NAMES,
+ _NL_CTYPE_MAP_NAMES,
+ _NL_CTYPE_WIDTH,
+ _NL_CTYPE_MB_CUR_MAX,
+ _NL_CTYPE_CODESET_NAME,
+ CODESET = _NL_CTYPE_CODESET_NAME,
+#define CODESET CODESET
+ _NL_CTYPE_TOUPPER32,
+ _NL_CTYPE_TOLOWER32,
+ _NL_CTYPE_CLASS_OFFSET,
+ _NL_CTYPE_MAP_OFFSET,
+ _NL_CTYPE_INDIGITS_MB_LEN,
+ _NL_CTYPE_INDIGITS0_MB,
+ _NL_CTYPE_INDIGITS1_MB,
+ _NL_CTYPE_INDIGITS2_MB,
+ _NL_CTYPE_INDIGITS3_MB,
+ _NL_CTYPE_INDIGITS4_MB,
+ _NL_CTYPE_INDIGITS5_MB,
+ _NL_CTYPE_INDIGITS6_MB,
+ _NL_CTYPE_INDIGITS7_MB,
+ _NL_CTYPE_INDIGITS8_MB,
+ _NL_CTYPE_INDIGITS9_MB,
+ _NL_CTYPE_INDIGITS_WC_LEN,
+ _NL_CTYPE_INDIGITS0_WC,
+ _NL_CTYPE_INDIGITS1_WC,
+ _NL_CTYPE_INDIGITS2_WC,
+ _NL_CTYPE_INDIGITS3_WC,
+ _NL_CTYPE_INDIGITS4_WC,
+ _NL_CTYPE_INDIGITS5_WC,
+ _NL_CTYPE_INDIGITS6_WC,
+ _NL_CTYPE_INDIGITS7_WC,
+ _NL_CTYPE_INDIGITS8_WC,
+ _NL_CTYPE_INDIGITS9_WC,
+ _NL_CTYPE_OUTDIGIT0_MB,
+ _NL_CTYPE_OUTDIGIT1_MB,
+ _NL_CTYPE_OUTDIGIT2_MB,
+ _NL_CTYPE_OUTDIGIT3_MB,
+ _NL_CTYPE_OUTDIGIT4_MB,
+ _NL_CTYPE_OUTDIGIT5_MB,
+ _NL_CTYPE_OUTDIGIT6_MB,
+ _NL_CTYPE_OUTDIGIT7_MB,
+ _NL_CTYPE_OUTDIGIT8_MB,
+ _NL_CTYPE_OUTDIGIT9_MB,
+ _NL_CTYPE_OUTDIGIT0_WC,
+ _NL_CTYPE_OUTDIGIT1_WC,
+ _NL_CTYPE_OUTDIGIT2_WC,
+ _NL_CTYPE_OUTDIGIT3_WC,
+ _NL_CTYPE_OUTDIGIT4_WC,
+ _NL_CTYPE_OUTDIGIT5_WC,
+ _NL_CTYPE_OUTDIGIT6_WC,
+ _NL_CTYPE_OUTDIGIT7_WC,
+ _NL_CTYPE_OUTDIGIT8_WC,
+ _NL_CTYPE_OUTDIGIT9_WC,
+ _NL_CTYPE_TRANSLIT_TAB_SIZE,
+ _NL_CTYPE_TRANSLIT_FROM_IDX,
+ _NL_CTYPE_TRANSLIT_FROM_TBL,
+ _NL_CTYPE_TRANSLIT_TO_IDX,
+ _NL_CTYPE_TRANSLIT_TO_TBL,
+ _NL_CTYPE_TRANSLIT_DEFAULT_MISSING_LEN,
+ _NL_CTYPE_TRANSLIT_DEFAULT_MISSING,
+ _NL_CTYPE_TRANSLIT_IGNORE_LEN,
+ _NL_CTYPE_TRANSLIT_IGNORE,
+ _NL_CTYPE_MAP_TO_NONASCII,
+ _NL_CTYPE_EXTRA_MAP_1,
+ _NL_CTYPE_EXTRA_MAP_2,
+ _NL_CTYPE_EXTRA_MAP_3,
+ _NL_CTYPE_EXTRA_MAP_4,
+ _NL_CTYPE_EXTRA_MAP_5,
+ _NL_CTYPE_EXTRA_MAP_6,
+ _NL_CTYPE_EXTRA_MAP_7,
+ _NL_CTYPE_EXTRA_MAP_8,
+ _NL_CTYPE_EXTRA_MAP_9,
+ _NL_CTYPE_EXTRA_MAP_10,
+ _NL_CTYPE_EXTRA_MAP_11,
+ _NL_CTYPE_EXTRA_MAP_12,
+ _NL_CTYPE_EXTRA_MAP_13,
+ _NL_CTYPE_EXTRA_MAP_14,
+ _NL_NUM_LC_CTYPE,
+
+ /* LC_MONETARY category: formatting of monetary quantities.
+ These items each correspond to a member of `struct lconv',
+ defined in <locale.h>. */
+ __INT_CURR_SYMBOL = _NL_ITEM (__LC_MONETARY, 0),
+#ifdef __USE_GNU
+# define INT_CURR_SYMBOL __INT_CURR_SYMBOL
+#endif
+ __CURRENCY_SYMBOL,
+#ifdef __USE_GNU
+# define CURRENCY_SYMBOL __CURRENCY_SYMBOL
+#endif
+ __MON_DECIMAL_POINT,
+#ifdef __USE_GNU
+# define MON_DECIMAL_POINT __MON_DECIMAL_POINT
+#endif
+ __MON_THOUSANDS_SEP,
+#ifdef __USE_GNU
+# define MON_THOUSANDS_SEP __MON_THOUSANDS_SEP
+#endif
+ __MON_GROUPING,
+#ifdef __USE_GNU
+# define MON_GROUPING __MON_GROUPING
+#endif
+ __POSITIVE_SIGN,
+#ifdef __USE_GNU
+# define POSITIVE_SIGN __POSITIVE_SIGN
+#endif
+ __NEGATIVE_SIGN,
+#ifdef __USE_GNU
+# define NEGATIVE_SIGN __NEGATIVE_SIGN
+#endif
+ __INT_FRAC_DIGITS,
+#ifdef __USE_GNU
+# define INT_FRAC_DIGITS __INT_FRAC_DIGITS
+#endif
+ __FRAC_DIGITS,
+#ifdef __USE_GNU
+# define FRAC_DIGITS __FRAC_DIGITS
+#endif
+ __P_CS_PRECEDES,
+#ifdef __USE_GNU
+# define P_CS_PRECEDES __P_CS_PRECEDES
+#endif
+ __P_SEP_BY_SPACE,
+#ifdef __USE_GNU
+# define P_SEP_BY_SPACE __P_SEP_BY_SPACE
+#endif
+ __N_CS_PRECEDES,
+#ifdef __USE_GNU
+# define N_CS_PRECEDES __N_CS_PRECEDES
+#endif
+ __N_SEP_BY_SPACE,
+#ifdef __USE_GNU
+# define N_SEP_BY_SPACE __N_SEP_BY_SPACE
+#endif
+ __P_SIGN_POSN,
+#ifdef __USE_GNU
+# define P_SIGN_POSN __P_SIGN_POSN
+#endif
+ __N_SIGN_POSN,
+#ifdef __USE_GNU
+# define N_SIGN_POSN __N_SIGN_POSN
+#endif
+ _NL_MONETARY_CRNCYSTR,
+#define CRNCYSTR _NL_MONETARY_CRNCYSTR
+ __INT_P_CS_PRECEDES,
+#ifdef __USE_GNU
+# define INT_P_CS_PRECEDES __INT_P_CS_PRECEDES
+#endif
+ __INT_P_SEP_BY_SPACE,
+#ifdef __USE_GNU
+# define INT_P_SEP_BY_SPACE __INT_P_SEP_BY_SPACE
+#endif
+ __INT_N_CS_PRECEDES,
+#ifdef __USE_GNU
+# define INT_N_CS_PRECEDES __INT_N_CS_PRECEDES
+#endif
+ __INT_N_SEP_BY_SPACE,
+#ifdef __USE_GNU
+# define INT_N_SEP_BY_SPACE __INT_N_SEP_BY_SPACE
+#endif
+ __INT_P_SIGN_POSN,
+#ifdef __USE_GNU
+# define INT_P_SIGN_POSN __INT_P_SIGN_POSN
+#endif
+ __INT_N_SIGN_POSN,
+#ifdef __USE_GNU
+# define INT_N_SIGN_POSN __INT_N_SIGN_POSN
+#endif
+ _NL_MONETARY_DUO_INT_CURR_SYMBOL,
+ _NL_MONETARY_DUO_CURRENCY_SYMBOL,
+ _NL_MONETARY_DUO_INT_FRAC_DIGITS,
+ _NL_MONETARY_DUO_FRAC_DIGITS,
+ _NL_MONETARY_DUO_P_CS_PRECEDES,
+ _NL_MONETARY_DUO_P_SEP_BY_SPACE,
+ _NL_MONETARY_DUO_N_CS_PRECEDES,
+ _NL_MONETARY_DUO_N_SEP_BY_SPACE,
+ _NL_MONETARY_DUO_INT_P_CS_PRECEDES,
+ _NL_MONETARY_DUO_INT_P_SEP_BY_SPACE,
+ _NL_MONETARY_DUO_INT_N_CS_PRECEDES,
+ _NL_MONETARY_DUO_INT_N_SEP_BY_SPACE,
+ _NL_MONETARY_DUO_P_SIGN_POSN,
+ _NL_MONETARY_DUO_N_SIGN_POSN,
+ _NL_MONETARY_DUO_INT_P_SIGN_POSN,
+ _NL_MONETARY_DUO_INT_N_SIGN_POSN,
+ _NL_MONETARY_UNO_VALID_FROM,
+ _NL_MONETARY_UNO_VALID_TO,
+ _NL_MONETARY_DUO_VALID_FROM,
+ _NL_MONETARY_DUO_VALID_TO,
+ _NL_MONETARY_CONVERSION_RATE,
+ _NL_MONETARY_DECIMAL_POINT_WC,
+ _NL_MONETARY_THOUSANDS_SEP_WC,
+ _NL_MONETARY_CODESET,
+ _NL_NUM_LC_MONETARY,
+
+ /* LC_NUMERIC category: formatting of numbers.
+ These also correspond to members of `struct lconv'; see <locale.h>. */
+ __DECIMAL_POINT = _NL_ITEM (__LC_NUMERIC, 0),
+#ifdef __USE_GNU
+# define DECIMAL_POINT __DECIMAL_POINT
+#endif
+ RADIXCHAR = __DECIMAL_POINT,
+#define RADIXCHAR RADIXCHAR
+ __THOUSANDS_SEP,
+#ifdef __USE_GNU
+# define THOUSANDS_SEP __THOUSANDS_SEP
+#endif
+ THOUSEP = __THOUSANDS_SEP,
+#define THOUSEP THOUSEP
+ __GROUPING,
+#ifdef __USE_GNU
+# define GROUPING __GROUPING
+#endif
+ _NL_NUMERIC_DECIMAL_POINT_WC,
+ _NL_NUMERIC_THOUSANDS_SEP_WC,
+ _NL_NUMERIC_CODESET,
+ _NL_NUM_LC_NUMERIC,
+
+ __YESEXPR = _NL_ITEM (__LC_MESSAGES, 0), /* Regex matching ``yes'' input. */
+#define YESEXPR __YESEXPR
+ __NOEXPR, /* Regex matching ``no'' input. */
+#define NOEXPR __NOEXPR
+ __YESSTR, /* Output string for ``yes''. */
+#if defined __USE_GNU || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
+# define YESSTR __YESSTR
+#endif
+ __NOSTR, /* Output string for ``no''. */
+#if defined __USE_GNU || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
+# define NOSTR __NOSTR
+#endif
+ _NL_MESSAGES_CODESET,
+ _NL_NUM_LC_MESSAGES,
+
+ _NL_PAPER_HEIGHT = _NL_ITEM (__LC_PAPER, 0),
+ _NL_PAPER_WIDTH,
+ _NL_PAPER_CODESET,
+ _NL_NUM_LC_PAPER,
+
+ _NL_NAME_NAME_FMT = _NL_ITEM (__LC_NAME, 0),
+ _NL_NAME_NAME_GEN,
+ _NL_NAME_NAME_MR,
+ _NL_NAME_NAME_MRS,
+ _NL_NAME_NAME_MISS,
+ _NL_NAME_NAME_MS,
+ _NL_NAME_CODESET,
+ _NL_NUM_LC_NAME,
+
+ _NL_ADDRESS_POSTAL_FMT = _NL_ITEM (__LC_ADDRESS, 0),
+ _NL_ADDRESS_COUNTRY_NAME,
+ _NL_ADDRESS_COUNTRY_POST,
+ _NL_ADDRESS_COUNTRY_AB2,
+ _NL_ADDRESS_COUNTRY_AB3,
+ _NL_ADDRESS_COUNTRY_CAR,
+ _NL_ADDRESS_COUNTRY_NUM,
+ _NL_ADDRESS_COUNTRY_ISBN,
+ _NL_ADDRESS_LANG_NAME,
+ _NL_ADDRESS_LANG_AB,
+ _NL_ADDRESS_LANG_TERM,
+ _NL_ADDRESS_LANG_LIB,
+ _NL_ADDRESS_CODESET,
+ _NL_NUM_LC_ADDRESS,
+
+ _NL_TELEPHONE_TEL_INT_FMT = _NL_ITEM (__LC_TELEPHONE, 0),
+ _NL_TELEPHONE_TEL_DOM_FMT,
+ _NL_TELEPHONE_INT_SELECT,
+ _NL_TELEPHONE_INT_PREFIX,
+ _NL_TELEPHONE_CODESET,
+ _NL_NUM_LC_TELEPHONE,
+
+ _NL_MEASUREMENT_MEASUREMENT = _NL_ITEM (__LC_MEASUREMENT, 0),
+ _NL_MEASUREMENT_CODESET,
+ _NL_NUM_LC_MEASUREMENT,
+
+ _NL_IDENTIFICATION_TITLE = _NL_ITEM (__LC_IDENTIFICATION, 0),
+ _NL_IDENTIFICATION_SOURCE,
+ _NL_IDENTIFICATION_ADDRESS,
+ _NL_IDENTIFICATION_CONTACT,
+ _NL_IDENTIFICATION_EMAIL,
+ _NL_IDENTIFICATION_TEL,
+ _NL_IDENTIFICATION_FAX,
+ _NL_IDENTIFICATION_LANGUAGE,
+ _NL_IDENTIFICATION_TERRITORY,
+ _NL_IDENTIFICATION_AUDIENCE,
+ _NL_IDENTIFICATION_APPLICATION,
+ _NL_IDENTIFICATION_ABBREVIATION,
+ _NL_IDENTIFICATION_REVISION,
+ _NL_IDENTIFICATION_DATE,
+ _NL_IDENTIFICATION_CATEGORY,
+ _NL_IDENTIFICATION_CODESET,
+ _NL_NUM_LC_IDENTIFICATION,
+
+ /* This marks the highest value used. */
+ _NL_NUM
+};
+
+/* This macro produces an item you can pass to `nl_langinfo' or
+ `nl_langinfo_l' to get the name of the locale in use for CATEGORY. */
+#define _NL_LOCALE_NAME(category) _NL_ITEM ((category), -1)
+#ifdef __USE_GNU
+# define NL_LOCALE_NAME(category) _NL_LOCALE_NAME (category)
+#endif
+
+
+/* Return the current locale's value for ITEM.
+ If ITEM is invalid, an empty string is returned.
+
+ The string returned will not change until `setlocale' is called;
+ it is usually in read-only memory and cannot be modified. */
+
+extern char *nl_langinfo (nl_item __item) __THROW;
+
+
+#ifdef __USE_GNU
+/* This interface is for the extended locale model. See <locale.h> for
+ more information. */
+
+/* Get locale datatype definition. */
+# include <xlocale.h>
+
+/* Just like nl_langinfo but get the information from the locale object L. */
+extern char *nl_langinfo_l (nl_item __item, __locale_t l);
+#endif
+
+__END_DECLS
+
+#endif /* langinfo.h */
diff --git a/sysroot/usr/include/lastlog.h b/sysroot/usr/include/lastlog.h
new file mode 100644
index 0000000..8cc4254
--- /dev/null
+++ b/sysroot/usr/include/lastlog.h
@@ -0,0 +1,4 @@
+/* This header file is used in 4.3BSD to define `struct lastlog',
+ which we define in <bits/utmp.h>. */
+
+#include <utmp.h>
diff --git a/sysroot/usr/include/libgen.h b/sysroot/usr/include/libgen.h
new file mode 100644
index 0000000..b252543
--- /dev/null
+++ b/sysroot/usr/include/libgen.h
@@ -0,0 +1,40 @@
+/* Copyright (C) 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _LIBGEN_H
+#define _LIBGEN_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Return directory part of PATH or "." if none is available. */
+extern char *dirname (char *__path) __THROW;
+
+/* Return final component of PATH.
+
+ This is the weird XPG version of this function. It sometimes will
+ modify its argument. Therefore we normally use the GNU version (in
+ <string.h>) and only if this header is included make the XPG
+ version available under the real name. */
+extern char *__xpg_basename (char *__path) __THROW;
+#define basename __xpg_basename
+
+__END_DECLS
+
+#endif /* libgen.h */
diff --git a/sysroot/usr/include/libintl.h b/sysroot/usr/include/libintl.h
new file mode 100644
index 0000000..544dec3
--- /dev/null
+++ b/sysroot/usr/include/libintl.h
@@ -0,0 +1,124 @@
+/* Message catalogs for internationalization.
+ Copyright (C) 1995-2002, 2004, 2005 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ This file is derived from the file libgettext.h in the GNU gettext package.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _LIBINTL_H
+#define _LIBINTL_H 1
+
+#include <features.h>
+
+/* We define an additional symbol to signal that we use the GNU
+ implementation of gettext. */
+#define __USE_GNU_GETTEXT 1
+
+/* Provide information about the supported file formats. Returns the
+ maximum minor revision number supported for a given major revision. */
+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) \
+ ((major) == 0 ? 1 : -1)
+
+__BEGIN_DECLS
+
+/* Look up MSGID in the current default message catalog for the current
+ LC_MESSAGES locale. If not found, returns MSGID itself (the default
+ text). */
+extern char *gettext (__const char *__msgid)
+ __THROW __attribute_format_arg__ (1);
+
+/* Look up MSGID in the DOMAINNAME message catalog for the current
+ LC_MESSAGES locale. */
+extern char *dgettext (__const char *__domainname, __const char *__msgid)
+ __THROW __attribute_format_arg__ (2);
+extern char *__dgettext (__const char *__domainname, __const char *__msgid)
+ __THROW __attribute_format_arg__ (2);
+
+/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
+ locale. */
+extern char *dcgettext (__const char *__domainname,
+ __const char *__msgid, int __category)
+ __THROW __attribute_format_arg__ (2);
+extern char *__dcgettext (__const char *__domainname,
+ __const char *__msgid, int __category)
+ __THROW __attribute_format_arg__ (2);
+
+
+/* Similar to `gettext' but select the plural form corresponding to the
+ number N. */
+extern char *ngettext (__const char *__msgid1, __const char *__msgid2,
+ unsigned long int __n)
+ __THROW __attribute_format_arg__ (1) __attribute_format_arg__ (2);
+
+/* Similar to `dgettext' but select the plural form corresponding to the
+ number N. */
+extern char *dngettext (__const char *__domainname, __const char *__msgid1,
+ __const char *__msgid2, unsigned long int __n)
+ __THROW __attribute_format_arg__ (2) __attribute_format_arg__ (3);
+
+/* Similar to `dcgettext' but select the plural form corresponding to the
+ number N. */
+extern char *dcngettext (__const char *__domainname, __const char *__msgid1,
+ __const char *__msgid2, unsigned long int __n,
+ int __category)
+ __THROW __attribute_format_arg__ (2) __attribute_format_arg__ (3);
+
+
+/* Set the current default message catalog to DOMAINNAME.
+ If DOMAINNAME is null, return the current default.
+ If DOMAINNAME is "", reset to the default of "messages". */
+extern char *textdomain (__const char *__domainname) __THROW;
+
+/* Specify that the DOMAINNAME message catalog will be found
+ in DIRNAME rather than in the system locale data base. */
+extern char *bindtextdomain (__const char *__domainname,
+ __const char *__dirname) __THROW;
+
+/* Specify the character encoding in which the messages from the
+ DOMAINNAME message catalog will be returned. */
+extern char *bind_textdomain_codeset (__const char *__domainname,
+ __const char *__codeset) __THROW;
+
+
+/* Optimized version of the function above. */
+#if defined __OPTIMIZE__ && !defined __cplusplus
+
+/* We need NULL for `gettext'. */
+# define __need_NULL
+# include <stddef.h>
+
+/* We need LC_MESSAGES for `dgettext'. */
+# include <locale.h>
+
+/* These must be macros. Inlined functions are useless because the
+ `__builtin_constant_p' predicate in dcgettext would always return
+ false. */
+
+# define gettext(msgid) dgettext (NULL, msgid)
+
+# define dgettext(domainname, msgid) \
+ dcgettext (domainname, msgid, LC_MESSAGES)
+
+# define ngettext(msgid1, msgid2, n) dngettext (NULL, msgid1, msgid2, n)
+
+# define dngettext(domainname, msgid1, msgid2, n) \
+ dcngettext (domainname, msgid1, msgid2, n, LC_MESSAGES)
+
+#endif /* Optimizing. */
+
+__END_DECLS
+
+#endif /* libintl.h */
diff --git a/sysroot/usr/include/libio.h b/sysroot/usr/include/libio.h
new file mode 100644
index 0000000..643812f
--- /dev/null
+++ b/sysroot/usr/include/libio.h
@@ -0,0 +1,553 @@
+/* Copyright (C) 1991-1995,1997-2006,2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Written by Per Bothner <bothner@cygnus.com>.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA.
+
+ As a special exception, if you link the code in this file with
+ files compiled with a GNU compiler to produce an executable,
+ that does not cause the resulting executable to be covered by
+ the GNU Lesser General Public License. This exception does not
+ however invalidate any other reasons why the executable file
+ might be covered by the GNU Lesser General Public License.
+ This exception applies to code released by its copyright holders
+ in files containing the exception. */
+
+#ifndef _IO_STDIO_H
+#define _IO_STDIO_H
+
+#include <_G_config.h>
+/* ALL of these should be defined in _G_config.h */
+#define _IO_pos_t _G_fpos_t /* obsolete */
+#define _IO_fpos_t _G_fpos_t
+#define _IO_fpos64_t _G_fpos64_t
+#define _IO_size_t _G_size_t
+#define _IO_ssize_t _G_ssize_t
+#define _IO_off_t _G_off_t
+#define _IO_off64_t _G_off64_t
+#define _IO_pid_t _G_pid_t
+#define _IO_uid_t _G_uid_t
+#define _IO_iconv_t _G_iconv_t
+#define _IO_HAVE_SYS_WAIT _G_HAVE_SYS_WAIT
+#define _IO_HAVE_ST_BLKSIZE _G_HAVE_ST_BLKSIZE
+#define _IO_BUFSIZ _G_BUFSIZ
+#define _IO_va_list _G_va_list
+#define _IO_wint_t _G_wint_t
+
+#ifdef _G_NEED_STDARG_H
+/* This define avoids name pollution if we're using GNU stdarg.h */
+# define __need___va_list
+# include <stdarg.h>
+# ifdef __GNUC_VA_LIST
+# undef _IO_va_list
+# define _IO_va_list __gnuc_va_list
+# endif /* __GNUC_VA_LIST */
+#endif
+
+#ifndef __P
+# if _G_HAVE_SYS_CDEFS
+# include <sys/cdefs.h>
+# else
+# ifdef __STDC__
+# define __P(p) p
+# define __PMT(p) p
+# else
+# define __P(p) ()
+# define __PMT(p) ()
+# endif
+# endif
+#endif /*!__P*/
+
+/* For backward compatibility */
+#ifndef _PARAMS
+# define _PARAMS(protos) __P(protos)
+#endif /*!_PARAMS*/
+
+#ifndef __STDC__
+# ifndef const
+# define const
+# endif
+#endif
+#define _IO_UNIFIED_JUMPTABLES 1
+#ifndef _G_HAVE_PRINTF_FP
+# define _IO_USE_DTOA 1
+#endif
+
+#ifndef EOF
+# define EOF (-1)
+#endif
+#ifndef NULL
+# if defined __GNUG__ && \
+ (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8))
+# define NULL (__null)
+# else
+# if !defined(__cplusplus)
+# define NULL ((void*)0)
+# else
+# define NULL (0)
+# endif
+# endif
+#endif
+
+#define _IOS_INPUT 1
+#define _IOS_OUTPUT 2
+#define _IOS_ATEND 4
+#define _IOS_APPEND 8
+#define _IOS_TRUNC 16
+#define _IOS_NOCREATE 32
+#define _IOS_NOREPLACE 64
+#define _IOS_BIN 128
+
+/* Magic numbers and bits for the _flags field.
+ The magic numbers use the high-order bits of _flags;
+ the remaining bits are available for variable flags.
+ Note: The magic numbers must all be negative if stdio
+ emulation is desired. */
+
+#define _IO_MAGIC 0xFBAD0000 /* Magic number */
+#define _OLD_STDIO_MAGIC 0xFABC0000 /* Emulate old stdio. */
+#define _IO_MAGIC_MASK 0xFFFF0000
+#define _IO_USER_BUF 1 /* User owns buffer; don't delete it on close. */
+#define _IO_UNBUFFERED 2
+#define _IO_NO_READS 4 /* Reading not allowed */
+#define _IO_NO_WRITES 8 /* Writing not allowd */
+#define _IO_EOF_SEEN 0x10
+#define _IO_ERR_SEEN 0x20
+#define _IO_DELETE_DONT_CLOSE 0x40 /* Don't call close(_fileno) on cleanup. */
+#define _IO_LINKED 0x80 /* Set if linked (using _chain) to streambuf::_list_all.*/
+#define _IO_IN_BACKUP 0x100
+#define _IO_LINE_BUF 0x200
+#define _IO_TIED_PUT_GET 0x400 /* Set if put and get pointer logicly tied. */
+#define _IO_CURRENTLY_PUTTING 0x800
+#define _IO_IS_APPENDING 0x1000
+#define _IO_IS_FILEBUF 0x2000
+#define _IO_BAD_SEEN 0x4000
+#define _IO_USER_LOCK 0x8000
+
+#define _IO_FLAGS2_MMAP 1
+#define _IO_FLAGS2_NOTCANCEL 2
+#ifdef _LIBC
+# define _IO_FLAGS2_FORTIFY 4
+#endif
+#define _IO_FLAGS2_USER_WBUF 8
+#ifdef _LIBC
+# define _IO_FLAGS2_SCANF_STD 16
+#endif
+
+/* These are "formatting flags" matching the iostream fmtflags enum values. */
+#define _IO_SKIPWS 01
+#define _IO_LEFT 02
+#define _IO_RIGHT 04
+#define _IO_INTERNAL 010
+#define _IO_DEC 020
+#define _IO_OCT 040
+#define _IO_HEX 0100
+#define _IO_SHOWBASE 0200
+#define _IO_SHOWPOINT 0400
+#define _IO_UPPERCASE 01000
+#define _IO_SHOWPOS 02000
+#define _IO_SCIENTIFIC 04000
+#define _IO_FIXED 010000
+#define _IO_UNITBUF 020000
+#define _IO_STDIO 040000
+#define _IO_DONT_CLOSE 0100000
+#define _IO_BOOLALPHA 0200000
+
+
+struct _IO_jump_t; struct _IO_FILE;
+
+/* Handle lock. */
+#ifdef _IO_MTSAFE_IO
+# if defined __GLIBC__ && __GLIBC__ >= 2
+# include <bits/stdio-lock.h>
+# else
+/*# include <comthread.h>*/
+# endif
+#else
+typedef void _IO_lock_t;
+#endif
+
+
+/* A streammarker remembers a position in a buffer. */
+
+struct _IO_marker {
+ struct _IO_marker *_next;
+ struct _IO_FILE *_sbuf;
+ /* If _pos >= 0
+ it points to _buf->Gbase()+_pos. FIXME comment */
+ /* if _pos < 0, it points to _buf->eBptr()+_pos. FIXME comment */
+ int _pos;
+#if 0
+ void set_streampos(streampos sp) { _spos = sp; }
+ void set_offset(int offset) { _pos = offset; _spos = (streampos)(-2); }
+ public:
+ streammarker(streambuf *sb);
+ ~streammarker();
+ int saving() { return _spos == -2; }
+ int delta(streammarker&);
+ int delta();
+#endif
+};
+
+/* This is the structure from the libstdc++ codecvt class. */
+enum __codecvt_result
+{
+ __codecvt_ok,
+ __codecvt_partial,
+ __codecvt_error,
+ __codecvt_noconv
+};
+
+#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
+/* The order of the elements in the following struct must match the order
+ of the virtual functions in the libstdc++ codecvt class. */
+struct _IO_codecvt
+{
+ void (*__codecvt_destr) (struct _IO_codecvt *);
+ enum __codecvt_result (*__codecvt_do_out) (struct _IO_codecvt *,
+ __mbstate_t *,
+ const wchar_t *,
+ const wchar_t *,
+ const wchar_t **, char *,
+ char *, char **);
+ enum __codecvt_result (*__codecvt_do_unshift) (struct _IO_codecvt *,
+ __mbstate_t *, char *,
+ char *, char **);
+ enum __codecvt_result (*__codecvt_do_in) (struct _IO_codecvt *,
+ __mbstate_t *,
+ const char *, const char *,
+ const char **, wchar_t *,
+ wchar_t *, wchar_t **);
+ int (*__codecvt_do_encoding) (struct _IO_codecvt *);
+ int (*__codecvt_do_always_noconv) (struct _IO_codecvt *);
+ int (*__codecvt_do_length) (struct _IO_codecvt *, __mbstate_t *,
+ const char *, const char *, _IO_size_t);
+ int (*__codecvt_do_max_length) (struct _IO_codecvt *);
+
+ _IO_iconv_t __cd_in;
+ _IO_iconv_t __cd_out;
+};
+
+/* Extra data for wide character streams. */
+struct _IO_wide_data
+{
+ wchar_t *_IO_read_ptr; /* Current read pointer */
+ wchar_t *_IO_read_end; /* End of get area. */
+ wchar_t *_IO_read_base; /* Start of putback+get area. */
+ wchar_t *_IO_write_base; /* Start of put area. */
+ wchar_t *_IO_write_ptr; /* Current put pointer. */
+ wchar_t *_IO_write_end; /* End of put area. */
+ wchar_t *_IO_buf_base; /* Start of reserve area. */
+ wchar_t *_IO_buf_end; /* End of reserve area. */
+ /* The following fields are used to support backing up and undo. */
+ wchar_t *_IO_save_base; /* Pointer to start of non-current get area. */
+ wchar_t *_IO_backup_base; /* Pointer to first valid character of
+ backup area */
+ wchar_t *_IO_save_end; /* Pointer to end of non-current get area. */
+
+ __mbstate_t _IO_state;
+ __mbstate_t _IO_last_state;
+ struct _IO_codecvt _codecvt;
+
+ wchar_t _shortbuf[1];
+
+ const struct _IO_jump_t *_wide_vtable;
+};
+#endif
+
+struct _IO_FILE {
+ int _flags; /* High-order word is _IO_MAGIC; rest is flags. */
+#define _IO_file_flags _flags
+
+ /* The following pointers correspond to the C++ streambuf protocol. */
+ /* Note: Tk uses the _IO_read_ptr and _IO_read_end fields directly. */
+ char* _IO_read_ptr; /* Current read pointer */
+ char* _IO_read_end; /* End of get area. */
+ char* _IO_read_base; /* Start of putback+get area. */
+ char* _IO_write_base; /* Start of put area. */
+ char* _IO_write_ptr; /* Current put pointer. */
+ char* _IO_write_end; /* End of put area. */
+ char* _IO_buf_base; /* Start of reserve area. */
+ char* _IO_buf_end; /* End of reserve area. */
+ /* The following fields are used to support backing up and undo. */
+ char *_IO_save_base; /* Pointer to start of non-current get area. */
+ char *_IO_backup_base; /* Pointer to first valid character of backup area */
+ char *_IO_save_end; /* Pointer to end of non-current get area. */
+
+ struct _IO_marker *_markers;
+
+ struct _IO_FILE *_chain;
+
+ int _fileno;
+#if 0
+ int _blksize;
+#else
+ int _flags2;
+#endif
+ _IO_off_t _old_offset; /* This used to be _offset but it's too small. */
+
+#define __HAVE_COLUMN /* temporary */
+ /* 1+column number of pbase(); 0 is unknown. */
+ unsigned short _cur_column;
+ signed char _vtable_offset;
+ char _shortbuf[1];
+
+ /* char* _save_gptr; char* _save_egptr; */
+
+ _IO_lock_t *_lock;
+#ifdef _IO_USE_OLD_IO_FILE
+};
+
+struct _IO_FILE_complete
+{
+ struct _IO_FILE _file;
+#endif
+#if defined _G_IO_IO_FILE_VERSION && _G_IO_IO_FILE_VERSION == 0x20001
+ _IO_off64_t _offset;
+# if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
+ /* Wide character stream stuff. */
+ struct _IO_codecvt *_codecvt;
+ struct _IO_wide_data *_wide_data;
+ struct _IO_FILE *_freeres_list;
+ void *_freeres_buf;
+ size_t _freeres_size;
+# else
+ void *__pad1;
+ void *__pad2;
+ void *__pad3;
+ void *__pad4;
+ size_t __pad5;
+# endif
+ int _mode;
+ /* Make sure we don't get into trouble again. */
+ char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
+#endif
+};
+
+#ifndef __cplusplus
+typedef struct _IO_FILE _IO_FILE;
+#endif
+
+struct _IO_FILE_plus;
+
+extern struct _IO_FILE_plus _IO_2_1_stdin_;
+extern struct _IO_FILE_plus _IO_2_1_stdout_;
+extern struct _IO_FILE_plus _IO_2_1_stderr_;
+#ifndef _LIBC
+#define _IO_stdin ((_IO_FILE*)(&_IO_2_1_stdin_))
+#define _IO_stdout ((_IO_FILE*)(&_IO_2_1_stdout_))
+#define _IO_stderr ((_IO_FILE*)(&_IO_2_1_stderr_))
+#else
+extern _IO_FILE *_IO_stdin attribute_hidden;
+extern _IO_FILE *_IO_stdout attribute_hidden;
+extern _IO_FILE *_IO_stderr attribute_hidden;
+#endif
+
+
+/* Functions to do I/O and file management for a stream. */
+
+/* Read NBYTES bytes from COOKIE into a buffer pointed to by BUF.
+ Return number of bytes read. */
+typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes);
+
+/* Write N bytes pointed to by BUF to COOKIE. Write all N bytes
+ unless there is an error. Return number of bytes written, or -1 if
+ there is an error without writing anything. If the file has been
+ opened for append (__mode.__append set), then set the file pointer
+ to the end of the file and then do the write; if not, just write at
+ the current file pointer. */
+typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf,
+ size_t __n);
+
+/* Move COOKIE's file position to *POS bytes from the
+ beginning of the file (if W is SEEK_SET),
+ the current position (if W is SEEK_CUR),
+ or the end of the file (if W is SEEK_END).
+ Set *POS to the new file position.
+ Returns zero if successful, nonzero if not. */
+typedef int __io_seek_fn (void *__cookie, _IO_off64_t *__pos, int __w);
+
+/* Close COOKIE. */
+typedef int __io_close_fn (void *__cookie);
+
+
+#ifdef _GNU_SOURCE
+/* User-visible names for the above. */
+typedef __io_read_fn cookie_read_function_t;
+typedef __io_write_fn cookie_write_function_t;
+typedef __io_seek_fn cookie_seek_function_t;
+typedef __io_close_fn cookie_close_function_t;
+
+/* The structure with the cookie function pointers. */
+typedef struct
+{
+ __io_read_fn *read; /* Read bytes. */
+ __io_write_fn *write; /* Write bytes. */
+ __io_seek_fn *seek; /* Seek/tell file position. */
+ __io_close_fn *close; /* Close file. */
+} _IO_cookie_io_functions_t;
+typedef _IO_cookie_io_functions_t cookie_io_functions_t;
+
+struct _IO_cookie_file;
+
+/* Initialize one of those. */
+extern void _IO_cookie_init (struct _IO_cookie_file *__cfile, int __read_write,
+ void *__cookie, _IO_cookie_io_functions_t __fns);
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern int __underflow (_IO_FILE *);
+extern int __uflow (_IO_FILE *);
+extern int __overflow (_IO_FILE *, int);
+#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
+extern _IO_wint_t __wunderflow (_IO_FILE *);
+extern _IO_wint_t __wuflow (_IO_FILE *);
+extern _IO_wint_t __woverflow (_IO_FILE *, _IO_wint_t);
+#endif
+
+#if __GNUC__ >= 3
+# define _IO_BE(expr, res) __builtin_expect ((expr), res)
+#else
+# define _IO_BE(expr, res) (expr)
+#endif
+
+#define _IO_getc_unlocked(_fp) \
+ (_IO_BE ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end, 0) \
+ ? __uflow (_fp) : *(unsigned char *) (_fp)->_IO_read_ptr++)
+#define _IO_peekc_unlocked(_fp) \
+ (_IO_BE ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end, 0) \
+ && __underflow (_fp) == EOF ? EOF \
+ : *(unsigned char *) (_fp)->_IO_read_ptr)
+#define _IO_putc_unlocked(_ch, _fp) \
+ (_IO_BE ((_fp)->_IO_write_ptr >= (_fp)->_IO_write_end, 0) \
+ ? __overflow (_fp, (unsigned char) (_ch)) \
+ : (unsigned char) (*(_fp)->_IO_write_ptr++ = (_ch)))
+
+#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
+# define _IO_getwc_unlocked(_fp) \
+ (_IO_BE ((_fp)->_wide_data->_IO_read_ptr >= (_fp)->_wide_data->_IO_read_end,\
+ 0) \
+ ? __wuflow (_fp) : (_IO_wint_t) *(_fp)->_wide_data->_IO_read_ptr++)
+# define _IO_putwc_unlocked(_wch, _fp) \
+ (_IO_BE ((_fp)->_wide_data->_IO_write_ptr \
+ >= (_fp)->_wide_data->_IO_write_end, 0) \
+ ? __woverflow (_fp, _wch) \
+ : (_IO_wint_t) (*(_fp)->_wide_data->_IO_write_ptr++ = (_wch)))
+#endif
+
+#define _IO_feof_unlocked(__fp) (((__fp)->_flags & _IO_EOF_SEEN) != 0)
+#define _IO_ferror_unlocked(__fp) (((__fp)->_flags & _IO_ERR_SEEN) != 0)
+
+extern int _IO_getc (_IO_FILE *__fp);
+extern int _IO_putc (int __c, _IO_FILE *__fp);
+extern int _IO_feof (_IO_FILE *__fp) __THROW;
+extern int _IO_ferror (_IO_FILE *__fp) __THROW;
+
+extern int _IO_peekc_locked (_IO_FILE *__fp);
+
+/* This one is for Emacs. */
+#define _IO_PENDING_OUTPUT_COUNT(_fp) \
+ ((_fp)->_IO_write_ptr - (_fp)->_IO_write_base)
+
+extern void _IO_flockfile (_IO_FILE *) __THROW;
+extern void _IO_funlockfile (_IO_FILE *) __THROW;
+extern int _IO_ftrylockfile (_IO_FILE *) __THROW;
+
+#ifdef _IO_MTSAFE_IO
+# define _IO_peekc(_fp) _IO_peekc_locked (_fp)
+# define _IO_flockfile(_fp) \
+ if (((_fp)->_flags & _IO_USER_LOCK) == 0) _IO_flockfile (_fp)
+# define _IO_funlockfile(_fp) \
+ if (((_fp)->_flags & _IO_USER_LOCK) == 0) _IO_funlockfile (_fp)
+#else
+# define _IO_peekc(_fp) _IO_peekc_unlocked (_fp)
+# define _IO_flockfile(_fp) /**/
+# define _IO_funlockfile(_fp) /**/
+# define _IO_ftrylockfile(_fp) /**/
+# define _IO_cleanup_region_start(_fct, _fp) /**/
+# define _IO_cleanup_region_end(_Doit) /**/
+#endif /* !_IO_MTSAFE_IO */
+
+extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict,
+ _IO_va_list, int *__restrict);
+extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict,
+ _IO_va_list);
+extern _IO_ssize_t _IO_padn (_IO_FILE *, int, _IO_ssize_t);
+extern _IO_size_t _IO_sgetn (_IO_FILE *, void *, _IO_size_t);
+
+extern _IO_off64_t _IO_seekoff (_IO_FILE *, _IO_off64_t, int, int);
+extern _IO_off64_t _IO_seekpos (_IO_FILE *, _IO_off64_t, int);
+
+extern void _IO_free_backup_area (_IO_FILE *) __THROW;
+
+#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
+extern _IO_wint_t _IO_getwc (_IO_FILE *__fp);
+extern _IO_wint_t _IO_putwc (wchar_t __wc, _IO_FILE *__fp);
+extern int _IO_fwide (_IO_FILE *__fp, int __mode) __THROW;
+# if __GNUC__ >= 2
+/* While compiling glibc we have to handle compatibility with very old
+ versions. */
+# if defined _LIBC && defined SHARED
+# include <shlib-compat.h>
+# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
+# define _IO_fwide_maybe_incompatible \
+ (__builtin_expect (&_IO_stdin_used == NULL, 0))
+extern const int _IO_stdin_used;
+weak_extern (_IO_stdin_used);
+# endif
+# endif
+# ifndef _IO_fwide_maybe_incompatible
+# define _IO_fwide_maybe_incompatible (0)
+# endif
+/* A special optimized version of the function above. It optimizes the
+ case of initializing an unoriented byte stream. */
+# define _IO_fwide(__fp, __mode) \
+ ({ int __result = (__mode); \
+ if (__result < 0 && ! _IO_fwide_maybe_incompatible) \
+ { \
+ if ((__fp)->_mode == 0) \
+ /* We know that all we have to do is to set the flag. */ \
+ (__fp)->_mode = -1; \
+ __result = (__fp)->_mode; \
+ } \
+ else if (__builtin_constant_p (__mode) && (__mode) == 0) \
+ __result = _IO_fwide_maybe_incompatible ? -1 : (__fp)->_mode; \
+ else \
+ __result = _IO_fwide (__fp, __result); \
+ __result; })
+# endif
+
+extern int _IO_vfwscanf (_IO_FILE * __restrict, const wchar_t * __restrict,
+ _IO_va_list, int *__restrict);
+extern int _IO_vfwprintf (_IO_FILE *__restrict, const wchar_t *__restrict,
+ _IO_va_list);
+extern _IO_ssize_t _IO_wpadn (_IO_FILE *, wint_t, _IO_ssize_t);
+extern void _IO_free_wbackup_area (_IO_FILE *) __THROW;
+#endif
+
+#ifdef __LDBL_COMPAT
+# include <bits/libio-ldbl.h>
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _IO_STDIO_H */
diff --git a/sysroot/usr/include/limits.h b/sysroot/usr/include/limits.h
new file mode 100644
index 0000000..3e9a5df
--- /dev/null
+++ b/sysroot/usr/include/limits.h
@@ -0,0 +1,154 @@
+/* Copyright (C) 1991, 1992, 1996, 1997, 1998, 1999, 2000, 2005
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99 Standard: 7.10/5.2.4.2.1 Sizes of integer types <limits.h>
+ */
+
+#ifndef _LIBC_LIMITS_H_
+#define _LIBC_LIMITS_H_ 1
+
+#include <features.h>
+
+
+/* Maximum length of any multibyte character in any locale.
+ We define this value here since the gcc header does not define
+ the correct value. */
+#define MB_LEN_MAX 16
+
+
+/* If we are not using GNU CC we have to define all the symbols ourself.
+ Otherwise use gcc's definitions (see below). */
+#if !defined __GNUC__ || __GNUC__ < 2
+
+/* We only protect from multiple inclusion here, because all the other
+ #include's protect themselves, and in GCC 2 we may #include_next through
+ multiple copies of this file before we get to GCC's. */
+# ifndef _LIMITS_H
+# define _LIMITS_H 1
+
+#include <bits/wordsize.h>
+
+/* We don't have #include_next.
+ Define ANSI <limits.h> for standard 32-bit words. */
+
+/* These assume 8-bit `char's, 16-bit `short int's,
+ and 32-bit `int's and `long int's. */
+
+/* Number of bits in a `char'. */
+# define CHAR_BIT 8
+
+/* Minimum and maximum values a `signed char' can hold. */
+# define SCHAR_MIN (-128)
+# define SCHAR_MAX 127
+
+/* Maximum value an `unsigned char' can hold. (Minimum is 0.) */
+# define UCHAR_MAX 255
+
+/* Minimum and maximum values a `char' can hold. */
+# ifdef __CHAR_UNSIGNED__
+# define CHAR_MIN 0
+# define CHAR_MAX UCHAR_MAX
+# else
+# define CHAR_MIN SCHAR_MIN
+# define CHAR_MAX SCHAR_MAX
+# endif
+
+/* Minimum and maximum values a `signed short int' can hold. */
+# define SHRT_MIN (-32768)
+# define SHRT_MAX 32767
+
+/* Maximum value an `unsigned short int' can hold. (Minimum is 0.) */
+# define USHRT_MAX 65535
+
+/* Minimum and maximum values a `signed int' can hold. */
+# define INT_MIN (-INT_MAX - 1)
+# define INT_MAX 2147483647
+
+/* Maximum value an `unsigned int' can hold. (Minimum is 0.) */
+# define UINT_MAX 4294967295U
+
+/* Minimum and maximum values a `signed long int' can hold. */
+# if __WORDSIZE == 64
+# define LONG_MAX 9223372036854775807L
+# else
+# define LONG_MAX 2147483647L
+# endif
+# define LONG_MIN (-LONG_MAX - 1L)
+
+/* Maximum value an `unsigned long int' can hold. (Minimum is 0.) */
+# if __WORDSIZE == 64
+# define ULONG_MAX 18446744073709551615UL
+# else
+# define ULONG_MAX 4294967295UL
+# endif
+
+# ifdef __USE_ISOC99
+
+/* Minimum and maximum values a `signed long long int' can hold. */
+# define LLONG_MAX 9223372036854775807LL
+# define LLONG_MIN (-LLONG_MAX - 1LL)
+
+/* Maximum value an `unsigned long long int' can hold. (Minimum is 0.) */
+# define ULLONG_MAX 18446744073709551615ULL
+
+# endif /* ISO C99 */
+
+# endif /* limits.h */
+#endif /* GCC 2. */
+
+#endif /* !_LIBC_LIMITS_H_ */
+
+ /* Get the compiler's limits.h, which defines almost all the ISO constants.
+
+ We put this #include_next outside the double inclusion check because
+ it should be possible to include this file more than once and still get
+ the definitions from gcc's header. */
+#if defined __GNUC__ && !defined _GCC_LIMITS_H_
+/* `_GCC_LIMITS_H_' is what GCC's file defines. */
+# include_next <limits.h>
+#endif
+
+/* The <limits.h> files in some gcc versions don't define LLONG_MIN,
+ LLONG_MAX, and ULLONG_MAX. Instead only the values gcc defined for
+ ages are available. */
+#if defined __USE_ISOC99 && defined __GNUC__
+# ifndef LLONG_MIN
+# define LLONG_MIN (-LLONG_MAX-1)
+# endif
+# ifndef LLONG_MAX
+# define LLONG_MAX __LONG_LONG_MAX__
+# endif
+# ifndef ULLONG_MAX
+# define ULLONG_MAX (LLONG_MAX * 2ULL + 1)
+# endif
+#endif
+
+#ifdef __USE_POSIX
+/* POSIX adds things to <limits.h>. */
+# include <bits/posix1_lim.h>
+#endif
+
+#ifdef __USE_POSIX2
+# include <bits/posix2_lim.h>
+#endif
+
+#ifdef __USE_XOPEN
+# include <bits/xopen_lim.h>
+#endif
diff --git a/sysroot/usr/include/link.h b/sysroot/usr/include/link.h
new file mode 100644
index 0000000..076531d
--- /dev/null
+++ b/sysroot/usr/include/link.h
@@ -0,0 +1,194 @@
+/* Data structure for communication from the run-time dynamic linker for
+ loaded ELF shared objects.
+ Copyright (C) 1995-2001, 2004, 2005, 2006 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _LINK_H
+#define _LINK_H 1
+
+#include <features.h>
+#include <elf.h>
+#include <dlfcn.h>
+#include <sys/types.h>
+
+/* We use this macro to refer to ELF types independent of the native wordsize.
+ `ElfW(TYPE)' is used in place of `Elf32_TYPE' or `Elf64_TYPE'. */
+#define ElfW(type) _ElfW (Elf, __ELF_NATIVE_CLASS, type)
+#define _ElfW(e,w,t) _ElfW_1 (e, w, _##t)
+#define _ElfW_1(e,w,t) e##w##t
+
+#include <bits/elfclass.h> /* Defines __ELF_NATIVE_CLASS. */
+#include <bits/link.h>
+
+/* Rendezvous structure used by the run-time dynamic linker to communicate
+ details of shared object loading to the debugger. If the executable's
+ dynamic section has a DT_DEBUG element, the run-time linker sets that
+ element's value to the address where this structure can be found. */
+
+struct r_debug
+ {
+ int r_version; /* Version number for this protocol. */
+
+ struct link_map *r_map; /* Head of the chain of loaded objects. */
+
+ /* This is the address of a function internal to the run-time linker,
+ that will always be called when the linker begins to map in a
+ library or unmap it, and again when the mapping change is complete.
+ The debugger can set a breakpoint at this address if it wants to
+ notice shared object mapping changes. */
+ ElfW(Addr) r_brk;
+ enum
+ {
+ /* This state value describes the mapping change taking place when
+ the `r_brk' address is called. */
+ RT_CONSISTENT, /* Mapping change is complete. */
+ RT_ADD, /* Beginning to add a new object. */
+ RT_DELETE /* Beginning to remove an object mapping. */
+ } r_state;
+
+ ElfW(Addr) r_ldbase; /* Base address the linker is loaded at. */
+ };
+
+/* This is the instance of that structure used by the dynamic linker. */
+extern struct r_debug _r_debug;
+
+/* This symbol refers to the "dynamic structure" in the `.dynamic' section
+ of whatever module refers to `_DYNAMIC'. So, to find its own
+ `struct r_debug', a program could do:
+ for (dyn = _DYNAMIC; dyn->d_tag != DT_NULL; ++dyn)
+ if (dyn->d_tag == DT_DEBUG)
+ r_debug = (struct r_debug *) dyn->d_un.d_ptr;
+ */
+extern ElfW(Dyn) _DYNAMIC[];
+
+/* Structure describing a loaded shared object. The `l_next' and `l_prev'
+ members form a chain of all the shared objects loaded at startup.
+
+ These data structures exist in space used by the run-time dynamic linker;
+ modifying them may have disastrous results. */
+
+struct link_map
+ {
+ /* These first few members are part of the protocol with the debugger.
+ This is the same format used in SVR4. */
+
+ ElfW(Addr) l_addr; /* Base address shared object is loaded at. */
+ char *l_name; /* Absolute file name object was found in. */
+ ElfW(Dyn) *l_ld; /* Dynamic section of the shared object. */
+ struct link_map *l_next, *l_prev; /* Chain of loaded objects. */
+ };
+
+#ifdef __USE_GNU
+
+/* Version numbers for la_version handshake interface. */
+#define LAV_CURRENT 1
+
+/* Activity types signaled through la_activity. */
+enum
+ {
+ LA_ACT_CONSISTENT, /* Link map consistent again. */
+ LA_ACT_ADD, /* New object will be added. */
+ LA_ACT_DELETE /* Objects will be removed. */
+ };
+
+/* Values representing origin of name for dynamic loading. */
+enum
+ {
+ LA_SER_ORIG = 0x01, /* Original name. */
+ LA_SER_LIBPATH = 0x02, /* Directory from LD_LIBRARY_PATH. */
+ LA_SER_RUNPATH = 0x04, /* Directory from RPATH/RUNPATH. */
+ LA_SER_CONFIG = 0x08, /* Found through ldconfig. */
+ LA_SER_DEFAULT = 0x40, /* Default directory. */
+ LA_SER_SECURE = 0x80 /* Unused. */
+ };
+
+/* Values for la_objopen return value. */
+enum
+ {
+ LA_FLG_BINDTO = 0x01, /* Audit symbols bound to this object. */
+ LA_FLG_BINDFROM = 0x02 /* Audit symbols bound from this object. */
+ };
+
+/* Values for la_symbind flags parameter. */
+enum
+ {
+ LA_SYMB_NOPLTENTER = 0x01, /* la_pltenter will not be called. */
+ LA_SYMB_NOPLTEXIT = 0x02, /* la_pltexit will not be called. */
+ LA_SYMB_STRUCTCALL = 0x04, /* Return value is a structure. */
+ LA_SYMB_DLSYM = 0x08, /* Binding due to dlsym call. */
+ LA_SYMB_ALTVALUE = 0x10 /* Value has been changed by a previous
+ la_symbind call. */
+ };
+
+struct dl_phdr_info
+ {
+ ElfW(Addr) dlpi_addr;
+ const char *dlpi_name;
+ const ElfW(Phdr) *dlpi_phdr;
+ ElfW(Half) dlpi_phnum;
+
+ /* Note: Following members were introduced after the first
+ version of this structure was available. Check the SIZE
+ argument passed to the dl_iterate_phdr callback to determine
+ whether or not each later member is available. */
+
+ /* Incremented when a new object may have been added. */
+ unsigned long long int dlpi_adds;
+ /* Incremented when an object may have been removed. */
+ unsigned long long int dlpi_subs;
+
+ /* If there is a PT_TLS segment, its module ID as used in
+ TLS relocations, else zero. */
+ size_t dlpi_tls_modid;
+
+ /* The address of the calling thread's instance of this module's
+ PT_TLS segment, if it has one and it has been allocated
+ in the calling thread, otherwise a null pointer. */
+ void *dlpi_tls_data;
+ };
+
+__BEGIN_DECLS
+
+extern int dl_iterate_phdr (int (*__callback) (struct dl_phdr_info *,
+ size_t, void *),
+ void *__data);
+
+
+/* Prototypes for the ld.so auditing interfaces. These are not
+ defined anywhere in ld.so but instead have to be provided by the
+ auditing DSO. */
+extern unsigned int la_version (unsigned int __version);
+extern void la_activity (uintptr_t *__cookie, unsigned int __flag);
+extern char *la_objsearch (const char *__name, uintptr_t *__cookie,
+ unsigned int __flag);
+extern unsigned int la_objopen (struct link_map *__map, Lmid_t __lmid,
+ uintptr_t *__cookie);
+extern void la_preinit (uintptr_t *__cookie);
+extern uintptr_t la_symbind32 (Elf32_Sym *__sym, unsigned int __ndx,
+ uintptr_t *__refcook, uintptr_t *__defcook,
+ unsigned int *__flags, const char *__symname);
+extern uintptr_t la_symbind64 (Elf64_Sym *__sym, unsigned int __ndx,
+ uintptr_t *__refcook, uintptr_t *__defcook,
+ unsigned int *__flags, const char *__symname);
+extern unsigned int la_objclose (uintptr_t *__cookie);
+
+__END_DECLS
+
+#endif
+
+#endif /* link.h */
diff --git a/sysroot/usr/include/linux/a.out.h b/sysroot/usr/include/linux/a.out.h
new file mode 100644
index 0000000..f913cc3
--- /dev/null
+++ b/sysroot/usr/include/linux/a.out.h
@@ -0,0 +1,268 @@
+#ifndef __A_OUT_GNU_H__
+#define __A_OUT_GNU_H__
+
+#define __GNU_EXEC_MACROS__
+
+#ifndef __STRUCT_EXEC_OVERRIDE__
+
+#include <asm/a.out.h>
+
+#endif /* __STRUCT_EXEC_OVERRIDE__ */
+
+/* these go in the N_MACHTYPE field */
+enum machine_type {
+#if defined (M_OLDSUN2)
+ M__OLDSUN2 = M_OLDSUN2,
+#else
+ M_OLDSUN2 = 0,
+#endif
+#if defined (M_68010)
+ M__68010 = M_68010,
+#else
+ M_68010 = 1,
+#endif
+#if defined (M_68020)
+ M__68020 = M_68020,
+#else
+ M_68020 = 2,
+#endif
+#if defined (M_SPARC)
+ M__SPARC = M_SPARC,
+#else
+ M_SPARC = 3,
+#endif
+ /* skip a bunch so we don't run into any of sun's numbers */
+ M_386 = 100,
+ M_MIPS1 = 151, /* MIPS R3000/R3000 binary */
+ M_MIPS2 = 152 /* MIPS R6000/R4000 binary */
+};
+
+#if !defined (N_MAGIC)
+#define N_MAGIC(exec) ((exec).a_info & 0xffff)
+#endif
+#define N_MACHTYPE(exec) ((enum machine_type)(((exec).a_info >> 16) & 0xff))
+#define N_FLAGS(exec) (((exec).a_info >> 24) & 0xff)
+#define N_SET_INFO(exec, magic, type, flags) \
+ ((exec).a_info = ((magic) & 0xffff) \
+ | (((int)(type) & 0xff) << 16) \
+ | (((flags) & 0xff) << 24))
+#define N_SET_MAGIC(exec, magic) \
+ ((exec).a_info = (((exec).a_info & 0xffff0000) | ((magic) & 0xffff)))
+
+#define N_SET_MACHTYPE(exec, machtype) \
+ ((exec).a_info = \
+ ((exec).a_info&0xff00ffff) | ((((int)(machtype))&0xff) << 16))
+
+#define N_SET_FLAGS(exec, flags) \
+ ((exec).a_info = \
+ ((exec).a_info&0x00ffffff) | (((flags) & 0xff) << 24))
+
+/* Code indicating object file or impure executable. */
+#define OMAGIC 0407
+/* Code indicating pure executable. */
+#define NMAGIC 0410
+/* Code indicating demand-paged executable. */
+#define ZMAGIC 0413
+/* This indicates a demand-paged executable with the header in the text.
+ The first page is unmapped to help trap NULL pointer references */
+#define QMAGIC 0314
+
+/* Code indicating core file. */
+#define CMAGIC 0421
+
+#if !defined (N_BADMAG)
+#define N_BADMAG(x) (N_MAGIC(x) != OMAGIC \
+ && N_MAGIC(x) != NMAGIC \
+ && N_MAGIC(x) != ZMAGIC \
+ && N_MAGIC(x) != QMAGIC)
+#endif
+
+#define _N_HDROFF(x) (1024 - sizeof (struct exec))
+
+#if !defined (N_TXTOFF)
+#define N_TXTOFF(x) \
+ (N_MAGIC(x) == ZMAGIC ? _N_HDROFF((x)) + sizeof (struct exec) : \
+ (N_MAGIC(x) == QMAGIC ? 0 : sizeof (struct exec)))
+#endif
+
+#if !defined (N_DATOFF)
+#define N_DATOFF(x) (N_TXTOFF(x) + (x).a_text)
+#endif
+
+#if !defined (N_TRELOFF)
+#define N_TRELOFF(x) (N_DATOFF(x) + (x).a_data)
+#endif
+
+#if !defined (N_DRELOFF)
+#define N_DRELOFF(x) (N_TRELOFF(x) + N_TRSIZE(x))
+#endif
+
+#if !defined (N_SYMOFF)
+#define N_SYMOFF(x) (N_DRELOFF(x) + N_DRSIZE(x))
+#endif
+
+#if !defined (N_STROFF)
+#define N_STROFF(x) (N_SYMOFF(x) + N_SYMSIZE(x))
+#endif
+
+/* Address of text segment in memory after it is loaded. */
+#if !defined (N_TXTADDR)
+#define N_TXTADDR(x) (N_MAGIC(x) == QMAGIC ? PAGE_SIZE : 0)
+#endif
+
+/* Address of data segment in memory after it is loaded.
+ Note that it is up to you to define SEGMENT_SIZE
+ on machines not listed here. */
+#if defined(vax) || defined(hp300) || defined(pyr)
+#define SEGMENT_SIZE page_size
+#endif
+#ifdef sony
+#define SEGMENT_SIZE 0x2000
+#endif /* Sony. */
+#ifdef is68k
+#define SEGMENT_SIZE 0x20000
+#endif
+#if defined(m68k) && defined(PORTAR)
+#define PAGE_SIZE 0x400
+#define SEGMENT_SIZE PAGE_SIZE
+#endif
+
+#ifdef linux
+#include <asm/page.h>
+#if defined(__i386__) || defined(__mc68000__)
+#define SEGMENT_SIZE 1024
+#else
+#ifndef SEGMENT_SIZE
+#define SEGMENT_SIZE PAGE_SIZE
+#endif
+#endif
+#endif
+
+#define _N_SEGMENT_ROUND(x) ALIGN(x, SEGMENT_SIZE)
+
+#define _N_TXTENDADDR(x) (N_TXTADDR(x)+(x).a_text)
+
+#ifndef N_DATADDR
+#define N_DATADDR(x) \
+ (N_MAGIC(x)==OMAGIC? (_N_TXTENDADDR(x)) \
+ : (_N_SEGMENT_ROUND (_N_TXTENDADDR(x))))
+#endif
+
+/* Address of bss segment in memory after it is loaded. */
+#if !defined (N_BSSADDR)
+#define N_BSSADDR(x) (N_DATADDR(x) + (x).a_data)
+#endif
+
+#if !defined (N_NLIST_DECLARED)
+struct nlist {
+ union {
+ char *n_name;
+ struct nlist *n_next;
+ long n_strx;
+ } n_un;
+ unsigned char n_type;
+ char n_other;
+ short n_desc;
+ unsigned long n_value;
+};
+#endif /* no N_NLIST_DECLARED. */
+
+#if !defined (N_UNDF)
+#define N_UNDF 0
+#endif
+#if !defined (N_ABS)
+#define N_ABS 2
+#endif
+#if !defined (N_TEXT)
+#define N_TEXT 4
+#endif
+#if !defined (N_DATA)
+#define N_DATA 6
+#endif
+#if !defined (N_BSS)
+#define N_BSS 8
+#endif
+#if !defined (N_FN)
+#define N_FN 15
+#endif
+
+#if !defined (N_EXT)
+#define N_EXT 1
+#endif
+#if !defined (N_TYPE)
+#define N_TYPE 036
+#endif
+#if !defined (N_STAB)
+#define N_STAB 0340
+#endif
+
+/* The following type indicates the definition of a symbol as being
+ an indirect reference to another symbol. The other symbol
+ appears as an undefined reference, immediately following this symbol.
+
+ Indirection is asymmetrical. The other symbol's value will be used
+ to satisfy requests for the indirect symbol, but not vice versa.
+ If the other symbol does not have a definition, libraries will
+ be searched to find a definition. */
+#define N_INDR 0xa
+
+/* The following symbols refer to set elements.
+ All the N_SET[ATDB] symbols with the same name form one set.
+ Space is allocated for the set in the text section, and each set
+ element's value is stored into one word of the space.
+ The first word of the space is the length of the set (number of elements).
+
+ The address of the set is made into an N_SETV symbol
+ whose name is the same as the name of the set.
+ This symbol acts like a N_DATA global symbol
+ in that it can satisfy undefined external references. */
+
+/* These appear as input to LD, in a .o file. */
+#define N_SETA 0x14 /* Absolute set element symbol */
+#define N_SETT 0x16 /* Text set element symbol */
+#define N_SETD 0x18 /* Data set element symbol */
+#define N_SETB 0x1A /* Bss set element symbol */
+
+/* This is output from LD. */
+#define N_SETV 0x1C /* Pointer to set vector in data area. */
+
+#if !defined (N_RELOCATION_INFO_DECLARED)
+/* This structure describes a single relocation to be performed.
+ The text-relocation section of the file is a vector of these structures,
+ all of which apply to the text section.
+ Likewise, the data-relocation section applies to the data section. */
+
+struct relocation_info
+{
+ /* Address (within segment) to be relocated. */
+ int r_address;
+ /* The meaning of r_symbolnum depends on r_extern. */
+ unsigned int r_symbolnum:24;
+ /* Nonzero means value is a pc-relative offset
+ and it should be relocated for changes in its own address
+ as well as for changes in the symbol or section specified. */
+ unsigned int r_pcrel:1;
+ /* Length (as exponent of 2) of the field to be relocated.
+ Thus, a value of 2 indicates 1<<2 bytes. */
+ unsigned int r_length:2;
+ /* 1 => relocate with value of symbol.
+ r_symbolnum is the index of the symbol
+ in file's the symbol table.
+ 0 => relocate with the address of a segment.
+ r_symbolnum is N_TEXT, N_DATA, N_BSS or N_ABS
+ (the N_EXT bit may be set also, but signifies nothing). */
+ unsigned int r_extern:1;
+ /* Four bits that aren't used, but when writing an object file
+ it is desirable to clear them. */
+#ifdef NS32K
+ unsigned r_bsr:1;
+ unsigned r_disp:1;
+ unsigned r_pad:2;
+#else
+ unsigned int r_pad:4;
+#endif
+};
+#endif /* no N_RELOCATION_INFO_DECLARED. */
+
+
+#endif /* __A_OUT_GNU_H__ */
diff --git a/sysroot/usr/include/linux/acct.h b/sysroot/usr/include/linux/acct.h
new file mode 100644
index 0000000..caea59d
--- /dev/null
+++ b/sysroot/usr/include/linux/acct.h
@@ -0,0 +1,116 @@
+/*
+ * BSD Process Accounting for Linux - Definitions
+ *
+ * Author: Marco van Wieringen (mvw@planets.elm.net)
+ *
+ * This header file contains the definitions needed to implement
+ * BSD-style process accounting. The kernel accounting code and all
+ * user-level programs that try to do something useful with the
+ * process accounting log must include this file.
+ *
+ * Copyright (C) 1995 - 1997 Marco van Wieringen - ELM Consultancy B.V.
+ *
+ */
+
+#ifndef _LINUX_ACCT_H
+#define _LINUX_ACCT_H
+
+#include <linux/types.h>
+
+#include <asm/param.h>
+#include <asm/byteorder.h>
+
+/*
+ * comp_t is a 16-bit "floating" point number with a 3-bit base 8
+ * exponent and a 13-bit fraction.
+ * comp2_t is 24-bit with 5-bit base 2 exponent and 20 bit fraction
+ * (leading 1 not stored).
+ * See linux/kernel/acct.c for the specific encoding systems used.
+ */
+
+typedef __u16 comp_t;
+typedef __u32 comp2_t;
+
+/*
+ * accounting file record
+ *
+ * This structure contains all of the information written out to the
+ * process accounting file whenever a process exits.
+ */
+
+#define ACCT_COMM 16
+
+struct acct
+{
+ char ac_flag; /* Flags */
+ char ac_version; /* Always set to ACCT_VERSION */
+ /* for binary compatibility back until 2.0 */
+ __u16 ac_uid16; /* LSB of Real User ID */
+ __u16 ac_gid16; /* LSB of Real Group ID */
+ __u16 ac_tty; /* Control Terminal */
+ __u32 ac_btime; /* Process Creation Time */
+ comp_t ac_utime; /* User Time */
+ comp_t ac_stime; /* System Time */
+ comp_t ac_etime; /* Elapsed Time */
+ comp_t ac_mem; /* Average Memory Usage */
+ comp_t ac_io; /* Chars Transferred */
+ comp_t ac_rw; /* Blocks Read or Written */
+ comp_t ac_minflt; /* Minor Pagefaults */
+ comp_t ac_majflt; /* Major Pagefaults */
+ comp_t ac_swaps; /* Number of Swaps */
+/* m68k had no padding here. */
+#if !defined(CONFIG_M68K) || !defined(__KERNEL__)
+ __u16 ac_ahz; /* AHZ */
+#endif
+ __u32 ac_exitcode; /* Exitcode */
+ char ac_comm[ACCT_COMM + 1]; /* Command Name */
+ __u8 ac_etime_hi; /* Elapsed Time MSB */
+ __u16 ac_etime_lo; /* Elapsed Time LSB */
+ __u32 ac_uid; /* Real User ID */
+ __u32 ac_gid; /* Real Group ID */
+};
+
+struct acct_v3
+{
+ char ac_flag; /* Flags */
+ char ac_version; /* Always set to ACCT_VERSION */
+ __u16 ac_tty; /* Control Terminal */
+ __u32 ac_exitcode; /* Exitcode */
+ __u32 ac_uid; /* Real User ID */
+ __u32 ac_gid; /* Real Group ID */
+ __u32 ac_pid; /* Process ID */
+ __u32 ac_ppid; /* Parent Process ID */
+ __u32 ac_btime; /* Process Creation Time */
+ float ac_etime; /* Elapsed Time */
+ comp_t ac_utime; /* User Time */
+ comp_t ac_stime; /* System Time */
+ comp_t ac_mem; /* Average Memory Usage */
+ comp_t ac_io; /* Chars Transferred */
+ comp_t ac_rw; /* Blocks Read or Written */
+ comp_t ac_minflt; /* Minor Pagefaults */
+ comp_t ac_majflt; /* Major Pagefaults */
+ comp_t ac_swaps; /* Number of Swaps */
+ char ac_comm[ACCT_COMM]; /* Command Name */
+};
+
+/*
+ * accounting flags
+ */
+ /* bit set when the process ... */
+#define AFORK 0x01 /* ... executed fork, but did not exec */
+#define ASU 0x02 /* ... used super-user privileges */
+#define ACOMPAT 0x04 /* ... used compatibility mode (VAX only not used) */
+#define ACORE 0x08 /* ... dumped core */
+#define AXSIG 0x10 /* ... was killed by a signal */
+
+#ifdef __BIG_ENDIAN
+#define ACCT_BYTEORDER 0x80 /* accounting file is big endian */
+#else
+#define ACCT_BYTEORDER 0x00 /* accounting file is little endian */
+#endif
+
+#define ACCT_VERSION 2
+#define AHZ (HZ)
+
+
+#endif /* _LINUX_ACCT_H */
diff --git a/sysroot/usr/include/linux/adb.h b/sysroot/usr/include/linux/adb.h
new file mode 100644
index 0000000..0815025
--- /dev/null
+++ b/sysroot/usr/include/linux/adb.h
@@ -0,0 +1,44 @@
+/*
+ * Definitions for ADB (Apple Desktop Bus) support.
+ */
+#ifndef __ADB_H
+#define __ADB_H
+
+/* ADB commands */
+#define ADB_BUSRESET 0
+#define ADB_FLUSH(id) (0x01 | ((id) << 4))
+#define ADB_WRITEREG(id, reg) (0x08 | (reg) | ((id) << 4))
+#define ADB_READREG(id, reg) (0x0C | (reg) | ((id) << 4))
+
+/* ADB default device IDs (upper 4 bits of ADB command byte) */
+#define ADB_DONGLE 1 /* "software execution control" devices */
+#define ADB_KEYBOARD 2
+#define ADB_MOUSE 3
+#define ADB_TABLET 4
+#define ADB_MODEM 5
+#define ADB_MISC 7 /* maybe a monitor */
+
+#define ADB_RET_OK 0
+#define ADB_RET_TIMEOUT 3
+
+/* The kind of ADB request. The controller may emulate some
+ or all of those CUDA/PMU packet kinds */
+#define ADB_PACKET 0
+#define CUDA_PACKET 1
+#define ERROR_PACKET 2
+#define TIMER_PACKET 3
+#define POWER_PACKET 4
+#define MACIIC_PACKET 5
+#define PMU_PACKET 6
+#define ADB_QUERY 7
+
+/* ADB queries */
+
+/* ADB_QUERY_GETDEVINFO
+ * Query ADB slot for device presence
+ * data[2] = id, rep[0] = orig addr, rep[1] = handler_id
+ */
+#define ADB_QUERY_GETDEVINFO 1
+
+
+#endif /* __ADB_H */
diff --git a/sysroot/usr/include/linux/adfs_fs.h b/sysroot/usr/include/linux/adfs_fs.h
new file mode 100644
index 0000000..fc9a5a1
--- /dev/null
+++ b/sysroot/usr/include/linux/adfs_fs.h
@@ -0,0 +1,44 @@
+#ifndef _ADFS_FS_H
+#define _ADFS_FS_H
+
+#include <linux/types.h>
+#include <linux/magic.h>
+
+/*
+ * Disc Record at disc address 0xc00
+ */
+struct adfs_discrecord {
+ __u8 log2secsize;
+ __u8 secspertrack;
+ __u8 heads;
+ __u8 density;
+ __u8 idlen;
+ __u8 log2bpmb;
+ __u8 skew;
+ __u8 bootoption;
+ __u8 lowsector;
+ __u8 nzones;
+ __le16 zone_spare;
+ __le32 root;
+ __le32 disc_size;
+ __le16 disc_id;
+ __u8 disc_name[10];
+ __le32 disc_type;
+ __le32 disc_size_high;
+ __u8 log2sharesize:4;
+ __u8 unused40:4;
+ __u8 big_flag:1;
+ __u8 unused41:1;
+ __u8 nzones_high;
+ __le32 format_version;
+ __le32 root_size;
+ __u8 unused52[60 - 52];
+};
+
+#define ADFS_DISCRECORD (0xc00)
+#define ADFS_DR_OFFSET (0x1c0)
+#define ADFS_DR_SIZE 60
+#define ADFS_DR_SIZE_BITS (ADFS_DR_SIZE << 3)
+
+
+#endif
diff --git a/sysroot/usr/include/linux/affs_hardblocks.h b/sysroot/usr/include/linux/affs_hardblocks.h
new file mode 100644
index 0000000..f1b948c
--- /dev/null
+++ b/sysroot/usr/include/linux/affs_hardblocks.h
@@ -0,0 +1,68 @@
+#ifndef AFFS_HARDBLOCKS_H
+#define AFFS_HARDBLOCKS_H
+
+#include <linux/types.h>
+
+/* Just the needed definitions for the RDB of an Amiga HD. */
+
+struct RigidDiskBlock {
+ __u32 rdb_ID;
+ __be32 rdb_SummedLongs;
+ __s32 rdb_ChkSum;
+ __u32 rdb_HostID;
+ __be32 rdb_BlockBytes;
+ __u32 rdb_Flags;
+ __u32 rdb_BadBlockList;
+ __be32 rdb_PartitionList;
+ __u32 rdb_FileSysHeaderList;
+ __u32 rdb_DriveInit;
+ __u32 rdb_Reserved1[6];
+ __u32 rdb_Cylinders;
+ __u32 rdb_Sectors;
+ __u32 rdb_Heads;
+ __u32 rdb_Interleave;
+ __u32 rdb_Park;
+ __u32 rdb_Reserved2[3];
+ __u32 rdb_WritePreComp;
+ __u32 rdb_ReducedWrite;
+ __u32 rdb_StepRate;
+ __u32 rdb_Reserved3[5];
+ __u32 rdb_RDBBlocksLo;
+ __u32 rdb_RDBBlocksHi;
+ __u32 rdb_LoCylinder;
+ __u32 rdb_HiCylinder;
+ __u32 rdb_CylBlocks;
+ __u32 rdb_AutoParkSeconds;
+ __u32 rdb_HighRDSKBlock;
+ __u32 rdb_Reserved4;
+ char rdb_DiskVendor[8];
+ char rdb_DiskProduct[16];
+ char rdb_DiskRevision[4];
+ char rdb_ControllerVendor[8];
+ char rdb_ControllerProduct[16];
+ char rdb_ControllerRevision[4];
+ __u32 rdb_Reserved5[10];
+};
+
+#define IDNAME_RIGIDDISK 0x5244534B /* "RDSK" */
+
+struct PartitionBlock {
+ __be32 pb_ID;
+ __be32 pb_SummedLongs;
+ __s32 pb_ChkSum;
+ __u32 pb_HostID;
+ __be32 pb_Next;
+ __u32 pb_Flags;
+ __u32 pb_Reserved1[2];
+ __u32 pb_DevFlags;
+ __u8 pb_DriveName[32];
+ __u32 pb_Reserved2[15];
+ __be32 pb_Environment[17];
+ __u32 pb_EReserved[15];
+};
+
+#define IDNAME_PARTITION 0x50415254 /* "PART" */
+
+#define RDB_ALLOCATION_LIMIT 16
+
+#endif /* AFFS_HARDBLOCKS_H */
diff --git a/sysroot/usr/include/linux/agpgart.h b/sysroot/usr/include/linux/agpgart.h
new file mode 100644
index 0000000..cf54448
--- /dev/null
+++ b/sysroot/usr/include/linux/agpgart.h
@@ -0,0 +1,111 @@
+/*
+ * AGPGART module version 0.99
+ * Copyright (C) 1999 Jeff Hartmann
+ * Copyright (C) 1999 Precision Insight, Inc.
+ * Copyright (C) 1999 Xi Graphics, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * JEFF HARTMANN, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
+ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#ifndef _AGP_H
+#define _AGP_H 1
+
+#define AGPIOC_BASE 'A'
+#define AGPIOC_INFO _IOR (AGPIOC_BASE, 0, struct agp_info*)
+#define AGPIOC_ACQUIRE _IO (AGPIOC_BASE, 1)
+#define AGPIOC_RELEASE _IO (AGPIOC_BASE, 2)
+#define AGPIOC_SETUP _IOW (AGPIOC_BASE, 3, struct agp_setup*)
+#define AGPIOC_RESERVE _IOW (AGPIOC_BASE, 4, struct agp_region*)
+#define AGPIOC_PROTECT _IOW (AGPIOC_BASE, 5, struct agp_region*)
+#define AGPIOC_ALLOCATE _IOWR(AGPIOC_BASE, 6, struct agp_allocate*)
+#define AGPIOC_DEALLOCATE _IOW (AGPIOC_BASE, 7, int)
+#define AGPIOC_BIND _IOW (AGPIOC_BASE, 8, struct agp_bind*)
+#define AGPIOC_UNBIND _IOW (AGPIOC_BASE, 9, struct agp_unbind*)
+
+#define AGP_DEVICE "/dev/agpgart"
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+#include <linux/types.h>
+#include <asm/types.h>
+
+struct agp_version {
+ __u16 major;
+ __u16 minor;
+};
+
+typedef struct _agp_info {
+ struct agp_version version; /* version of the driver */
+ __u32 bridge_id; /* bridge vendor/device */
+ __u32 agp_mode; /* mode info of bridge */
+ unsigned long aper_base;/* base of aperture */
+ size_t aper_size; /* size of aperture */
+ size_t pg_total; /* max pages (swap + system) */
+ size_t pg_system; /* max pages (system) */
+ size_t pg_used; /* current pages used */
+} agp_info;
+
+typedef struct _agp_setup {
+ __u32 agp_mode; /* mode info of bridge */
+} agp_setup;
+
+/*
+ * The "prot" down below needs still a "sleep" flag somehow ...
+ */
+typedef struct _agp_segment {
+ off_t pg_start; /* starting page to populate */
+ size_t pg_count; /* number of pages */
+ int prot; /* prot flags for mmap */
+} agp_segment;
+
+typedef struct _agp_region {
+ pid_t pid; /* pid of process */
+ size_t seg_count; /* number of segments */
+ struct _agp_segment *seg_list;
+} agp_region;
+
+typedef struct _agp_allocate {
+ int key; /* tag of allocation */
+ size_t pg_count; /* number of pages */
+ __u32 type; /* 0 == normal, other devspec */
+ __u32 physical; /* device specific (some devices
+ * need a phys address of the
+ * actual page behind the gatt
+ * table) */
+} agp_allocate;
+
+typedef struct _agp_bind {
+ int key; /* tag of allocation */
+ off_t pg_start; /* starting page to populate */
+} agp_bind;
+
+typedef struct _agp_unbind {
+ int key; /* tag of allocation */
+ __u32 priority; /* priority for paging out */
+} agp_unbind;
+
+
+#endif /* _AGP_H */
diff --git a/sysroot/usr/include/linux/aio_abi.h b/sysroot/usr/include/linux/aio_abi.h
new file mode 100644
index 0000000..9e01729
--- /dev/null
+++ b/sysroot/usr/include/linux/aio_abi.h
@@ -0,0 +1,110 @@
+/* include/linux/aio_abi.h
+ *
+ * Copyright 2000,2001,2002 Red Hat.
+ *
+ * Written by Benjamin LaHaise <bcrl@kvack.org>
+ *
+ * Distribute under the terms of the GPLv2 (see ../../COPYING) or under
+ * the following terms.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation is hereby granted, provided that the above copyright
+ * notice appears in all copies. This software is provided without any
+ * warranty, express or implied. Red Hat makes no representations about
+ * the suitability of this software for any purpose.
+ *
+ * IN NO EVENT SHALL RED HAT BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+ * SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
+ * THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF RED HAT HAS BEEN ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * RED HAT DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND
+ * RED HAT HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
+ * ENHANCEMENTS, OR MODIFICATIONS.
+ */
+#ifndef __LINUX__AIO_ABI_H
+#define __LINUX__AIO_ABI_H
+
+#include <asm/byteorder.h>
+
+typedef unsigned long aio_context_t;
+
+enum {
+ IOCB_CMD_PREAD = 0,
+ IOCB_CMD_PWRITE = 1,
+ IOCB_CMD_FSYNC = 2,
+ IOCB_CMD_FDSYNC = 3,
+ /* These two are experimental.
+ * IOCB_CMD_PREADX = 4,
+ * IOCB_CMD_POLL = 5,
+ */
+ IOCB_CMD_NOOP = 6,
+ IOCB_CMD_PREADV = 7,
+ IOCB_CMD_PWRITEV = 8,
+};
+
+/*
+ * Valid flags for the "aio_flags" member of the "struct iocb".
+ *
+ * IOCB_FLAG_RESFD - Set if the "aio_resfd" member of the "struct iocb"
+ * is valid.
+ */
+#define IOCB_FLAG_RESFD (1 << 0)
+
+/* read() from /dev/aio returns these structures. */
+struct io_event {
+ __u64 data; /* the data field from the iocb */
+ __u64 obj; /* what iocb this event came from */
+ __s64 res; /* result code for this event */
+ __s64 res2; /* secondary result */
+};
+
+#if defined(__LITTLE_ENDIAN)
+#define PADDED(x,y) x, y
+#elif defined(__BIG_ENDIAN)
+#define PADDED(x,y) y, x
+#else
+#error edit for your odd byteorder.
+#endif
+
+/*
+ * we always use a 64bit off_t when communicating
+ * with userland. its up to libraries to do the
+ * proper padding and aio_error abstraction
+ */
+
+struct iocb {
+ /* these are internal to the kernel/libc. */
+ __u64 aio_data; /* data to be returned in event's data */
+ __u32 PADDED(aio_key, aio_reserved1);
+ /* the kernel sets aio_key to the req # */
+
+ /* common fields */
+ __u16 aio_lio_opcode; /* see IOCB_CMD_ above */
+ __s16 aio_reqprio;
+ __u32 aio_fildes;
+
+ __u64 aio_buf;
+ __u64 aio_nbytes;
+ __s64 aio_offset;
+
+ /* extra parameters */
+ __u64 aio_reserved2; /* TODO: use this for a (struct sigevent *) */
+
+ /* flags for the "struct iocb" */
+ __u32 aio_flags;
+
+ /*
+ * if the IOCB_FLAG_RESFD flag of "aio_flags" is set, this is an
+ * eventfd to signal AIO readiness to
+ */
+ __u32 aio_resfd;
+}; /* 64 bytes */
+
+#undef IFBIG
+#undef IFLITTLE
+
+#endif /* __LINUX__AIO_ABI_H */
+
diff --git a/sysroot/usr/include/linux/apm_bios.h b/sysroot/usr/include/linux/apm_bios.h
new file mode 100644
index 0000000..dee19a2
--- /dev/null
+++ b/sysroot/usr/include/linux/apm_bios.h
@@ -0,0 +1,135 @@
+#ifndef _LINUX_APM_H
+#define _LINUX_APM_H
+
+/*
+ * Include file for the interface to an APM BIOS
+ * Copyright 1994-2001 Stephen Rothwell (sfr@canb.auug.org.au)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+#include <linux/types.h>
+
+typedef unsigned short apm_event_t;
+typedef unsigned short apm_eventinfo_t;
+
+struct apm_bios_info {
+ __u16 version;
+ __u16 cseg;
+ __u32 offset;
+ __u16 cseg_16;
+ __u16 dseg;
+ __u16 flags;
+ __u16 cseg_len;
+ __u16 cseg_16_len;
+ __u16 dseg_len;
+};
+
+
+/*
+ * Power states
+ */
+#define APM_STATE_READY 0x0000
+#define APM_STATE_STANDBY 0x0001
+#define APM_STATE_SUSPEND 0x0002
+#define APM_STATE_OFF 0x0003
+#define APM_STATE_BUSY 0x0004
+#define APM_STATE_REJECT 0x0005
+#define APM_STATE_OEM_SYS 0x0020
+#define APM_STATE_OEM_DEV 0x0040
+
+#define APM_STATE_DISABLE 0x0000
+#define APM_STATE_ENABLE 0x0001
+
+#define APM_STATE_DISENGAGE 0x0000
+#define APM_STATE_ENGAGE 0x0001
+
+/*
+ * Events (results of Get PM Event)
+ */
+#define APM_SYS_STANDBY 0x0001
+#define APM_SYS_SUSPEND 0x0002
+#define APM_NORMAL_RESUME 0x0003
+#define APM_CRITICAL_RESUME 0x0004
+#define APM_LOW_BATTERY 0x0005
+#define APM_POWER_STATUS_CHANGE 0x0006
+#define APM_UPDATE_TIME 0x0007
+#define APM_CRITICAL_SUSPEND 0x0008
+#define APM_USER_STANDBY 0x0009
+#define APM_USER_SUSPEND 0x000a
+#define APM_STANDBY_RESUME 0x000b
+#define APM_CAPABILITY_CHANGE 0x000c
+
+/*
+ * Error codes
+ */
+#define APM_SUCCESS 0x00
+#define APM_DISABLED 0x01
+#define APM_CONNECTED 0x02
+#define APM_NOT_CONNECTED 0x03
+#define APM_16_CONNECTED 0x05
+#define APM_16_UNSUPPORTED 0x06
+#define APM_32_CONNECTED 0x07
+#define APM_32_UNSUPPORTED 0x08
+#define APM_BAD_DEVICE 0x09
+#define APM_BAD_PARAM 0x0a
+#define APM_NOT_ENGAGED 0x0b
+#define APM_BAD_FUNCTION 0x0c
+#define APM_RESUME_DISABLED 0x0d
+#define APM_NO_ERROR 0x53
+#define APM_BAD_STATE 0x60
+#define APM_NO_EVENTS 0x80
+#define APM_NOT_PRESENT 0x86
+
+/*
+ * APM Device IDs
+ */
+#define APM_DEVICE_BIOS 0x0000
+#define APM_DEVICE_ALL 0x0001
+#define APM_DEVICE_DISPLAY 0x0100
+#define APM_DEVICE_STORAGE 0x0200
+#define APM_DEVICE_PARALLEL 0x0300
+#define APM_DEVICE_SERIAL 0x0400
+#define APM_DEVICE_NETWORK 0x0500
+#define APM_DEVICE_PCMCIA 0x0600
+#define APM_DEVICE_BATTERY 0x8000
+#define APM_DEVICE_OEM 0xe000
+#define APM_DEVICE_OLD_ALL 0xffff
+#define APM_DEVICE_CLASS 0x00ff
+#define APM_DEVICE_MASK 0xff00
+
+
+/*
+ * Battery status
+ */
+#define APM_MAX_BATTERIES 2
+
+/*
+ * APM defined capability bit flags
+ */
+#define APM_CAP_GLOBAL_STANDBY 0x0001
+#define APM_CAP_GLOBAL_SUSPEND 0x0002
+#define APM_CAP_RESUME_STANDBY_TIMER 0x0004 /* Timer resume from standby */
+#define APM_CAP_RESUME_SUSPEND_TIMER 0x0008 /* Timer resume from suspend */
+#define APM_CAP_RESUME_STANDBY_RING 0x0010 /* Resume on Ring fr standby */
+#define APM_CAP_RESUME_SUSPEND_RING 0x0020 /* Resume on Ring fr suspend */
+#define APM_CAP_RESUME_STANDBY_PCMCIA 0x0040 /* Resume on PCMCIA Ring */
+#define APM_CAP_RESUME_SUSPEND_PCMCIA 0x0080 /* Resume on PCMCIA Ring */
+
+/*
+ * ioctl operations
+ */
+#include <linux/ioctl.h>
+
+#define APM_IOC_STANDBY _IO('A', 1)
+#define APM_IOC_SUSPEND _IO('A', 2)
+
+#endif /* LINUX_APM_H */
diff --git a/sysroot/usr/include/linux/arcfb.h b/sysroot/usr/include/linux/arcfb.h
new file mode 100644
index 0000000..721e765
--- /dev/null
+++ b/sysroot/usr/include/linux/arcfb.h
@@ -0,0 +1,8 @@
+#ifndef __LINUX_ARCFB_H__
+#define __LINUX_ARCFB_H__
+
+#define FBIO_WAITEVENT _IO('F', 0x88)
+#define FBIO_GETCONTROL2 _IOR('F', 0x89, size_t)
+
+#endif
+
diff --git a/sysroot/usr/include/linux/atalk.h b/sysroot/usr/include/linux/atalk.h
new file mode 100644
index 0000000..c418d9a
--- /dev/null
+++ b/sysroot/usr/include/linux/atalk.h
@@ -0,0 +1,42 @@
+#ifndef __LINUX_ATALK_H__
+#define __LINUX_ATALK_H__
+
+#include <asm/byteorder.h>
+
+/*
+ * AppleTalk networking structures
+ *
+ * The following are directly referenced from the University Of Michigan
+ * netatalk for compatibility reasons.
+ */
+#define ATPORT_FIRST 1
+#define ATPORT_RESERVED 128
+#define ATPORT_LAST 254 /* 254 is only legal on localtalk */
+#define ATADDR_ANYNET (__u16)0
+#define ATADDR_ANYNODE (__u8)0
+#define ATADDR_ANYPORT (__u8)0
+#define ATADDR_BCAST (__u8)255
+#define DDP_MAXSZ 587
+#define DDP_MAXHOPS 15 /* 4 bits of hop counter */
+
+#define SIOCATALKDIFADDR (SIOCPROTOPRIVATE + 0)
+
+struct atalk_addr {
+ __be16 s_net;
+ __u8 s_node;
+};
+
+struct sockaddr_at {
+ sa_family_t sat_family;
+ __u8 sat_port;
+ struct atalk_addr sat_addr;
+ char sat_zero[8];
+};
+
+struct atalk_netrange {
+ __u8 nr_phase;
+ __be16 nr_firstnet;
+ __be16 nr_lastnet;
+};
+
+#endif /* __LINUX_ATALK_H__ */
diff --git a/sysroot/usr/include/linux/atm.h b/sysroot/usr/include/linux/atm.h
new file mode 100644
index 0000000..593e6c1
--- /dev/null
+++ b/sysroot/usr/include/linux/atm.h
@@ -0,0 +1,238 @@
+/* atm.h - general ATM declarations */
+
+/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
+
+
+/*
+ * WARNING: User-space programs should not #include <linux/atm.h> directly.
+ * Instead, #include <atm.h>
+ */
+
+#ifndef _LINUX_ATM_H
+#define _LINUX_ATM_H
+
+/*
+ * BEGIN_xx and END_xx markers are used for automatic generation of
+ * documentation. Do not change them.
+ */
+
+#include <linux/atmapi.h>
+#include <linux/atmsap.h>
+#include <linux/atmioc.h>
+
+
+/* general ATM constants */
+#define ATM_CELL_SIZE 53 /* ATM cell size incl. header */
+#define ATM_CELL_PAYLOAD 48 /* ATM payload size */
+#define ATM_AAL0_SDU 52 /* AAL0 SDU size */
+#define ATM_MAX_AAL34_PDU 65535 /* maximum AAL3/4 PDU payload */
+#define ATM_AAL5_TRAILER 8 /* AAL5 trailer size */
+#define ATM_MAX_AAL5_PDU 65535 /* maximum AAL5 PDU payload */
+#define ATM_MAX_CDV 9999 /* maximum (default) CDV */
+#define ATM_NOT_RSV_VCI 32 /* first non-reserved VCI value */
+
+#define ATM_MAX_VPI 255 /* maximum VPI at the UNI */
+#define ATM_MAX_VPI_NNI 4096 /* maximum VPI at the NNI */
+#define ATM_MAX_VCI 65535 /* maximum VCI */
+
+
+/* "protcol" values for the socket system call */
+#define ATM_NO_AAL 0 /* AAL not specified */
+#define ATM_AAL0 13 /* "raw" ATM cells */
+#define ATM_AAL1 1 /* AAL1 (CBR) */
+#define ATM_AAL2 2 /* AAL2 (VBR) */
+#define ATM_AAL34 3 /* AAL3/4 (data) */
+#define ATM_AAL5 5 /* AAL5 (data) */
+
+/*
+ * socket option name coding functions
+ *
+ * Note that __SO_ENCODE and __SO_LEVEL are somewhat a hack since the
+ * << 22 only reserves 9 bits for the level. On some architectures
+ * SOL_SOCKET is 0xFFFF, so that's a bit of a problem
+ */
+
+#define __SO_ENCODE(l,n,t) ((((l) & 0x1FF) << 22) | ((n) << 16) | \
+ sizeof(t))
+#define __SO_LEVEL_MATCH(c,m) (((c) >> 22) == ((m) & 0x1FF))
+#define __SO_NUMBER(c) (((c) >> 16) & 0x3f)
+#define __SO_SIZE(c) ((c) & 0x3fff)
+
+/*
+ * ATM layer
+ */
+
+#define SO_SETCLP __SO_ENCODE(SOL_ATM,0,int)
+ /* set CLP bit value - TODO */
+#define SO_CIRANGE __SO_ENCODE(SOL_ATM,1,struct atm_cirange)
+ /* connection identifier range; socket must be
+ bound or connected */
+#define SO_ATMQOS __SO_ENCODE(SOL_ATM,2,struct atm_qos)
+ /* Quality of Service setting */
+#define SO_ATMSAP __SO_ENCODE(SOL_ATM,3,struct atm_sap)
+ /* Service Access Point */
+#define SO_ATMPVC __SO_ENCODE(SOL_ATM,4,struct sockaddr_atmpvc)
+ /* "PVC" address (also for SVCs); get only */
+#define SO_MULTIPOINT __SO_ENCODE(SOL_ATM, 5, int)
+ /* make this vc a p2mp */
+
+
+/*
+ * Note @@@: since the socket layers don't really distinguish the control and
+ * the data plane but generally seems to be data plane-centric, any layer is
+ * about equally wrong for the SAP. If you have a better idea about this,
+ * please speak up ...
+ */
+
+
+/* ATM cell header (for AAL0) */
+
+/* BEGIN_CH */
+#define ATM_HDR_GFC_MASK 0xf0000000
+#define ATM_HDR_GFC_SHIFT 28
+#define ATM_HDR_VPI_MASK 0x0ff00000
+#define ATM_HDR_VPI_SHIFT 20
+#define ATM_HDR_VCI_MASK 0x000ffff0
+#define ATM_HDR_VCI_SHIFT 4
+#define ATM_HDR_PTI_MASK 0x0000000e
+#define ATM_HDR_PTI_SHIFT 1
+#define ATM_HDR_CLP 0x00000001
+/* END_CH */
+
+
+/* PTI codings */
+
+/* BEGIN_PTI */
+#define ATM_PTI_US0 0 /* user data cell, congestion not exp, SDU-type 0 */
+#define ATM_PTI_US1 1 /* user data cell, congestion not exp, SDU-type 1 */
+#define ATM_PTI_UCES0 2 /* user data cell, cong. experienced, SDU-type 0 */
+#define ATM_PTI_UCES1 3 /* user data cell, cong. experienced, SDU-type 1 */
+#define ATM_PTI_SEGF5 4 /* segment OAM F5 flow related cell */
+#define ATM_PTI_E2EF5 5 /* end-to-end OAM F5 flow related cell */
+#define ATM_PTI_RSV_RM 6 /* reserved for traffic control/resource mgmt */
+#define ATM_PTI_RSV 7 /* reserved */
+/* END_PTI */
+
+
+/*
+ * The following items should stay in linux/atm.h, which should be linked to
+ * netatm/atm.h
+ */
+
+/* Traffic description */
+
+#define ATM_NONE 0 /* no traffic */
+#define ATM_UBR 1
+#define ATM_CBR 2
+#define ATM_VBR 3
+#define ATM_ABR 4
+#define ATM_ANYCLASS 5 /* compatible with everything */
+
+#define ATM_MAX_PCR -1 /* maximum available PCR */
+
+struct atm_trafprm {
+ unsigned char traffic_class; /* traffic class (ATM_UBR, ...) */
+ int max_pcr; /* maximum PCR in cells per second */
+ int pcr; /* desired PCR in cells per second */
+ int min_pcr; /* minimum PCR in cells per second */
+ int max_cdv; /* maximum CDV in microseconds */
+ int max_sdu; /* maximum SDU in bytes */
+ /* extra params for ABR */
+ unsigned int icr; /* Initial Cell Rate (24-bit) */
+ unsigned int tbe; /* Transient Buffer Exposure (24-bit) */
+ unsigned int frtt : 24; /* Fixed Round Trip Time (24-bit) */
+ unsigned int rif : 4; /* Rate Increment Factor (4-bit) */
+ unsigned int rdf : 4; /* Rate Decrease Factor (4-bit) */
+ unsigned int nrm_pres :1; /* nrm present bit */
+ unsigned int trm_pres :1; /* rm present bit */
+ unsigned int adtf_pres :1; /* adtf present bit */
+ unsigned int cdf_pres :1; /* cdf present bit*/
+ unsigned int nrm :3; /* Max # of Cells for each forward RM cell (3-bit) */
+ unsigned int trm :3; /* Time between forward RM cells (3-bit) */
+ unsigned int adtf :10; /* ACR Decrease Time Factor (10-bit) */
+ unsigned int cdf :3; /* Cutoff Decrease Factor (3-bit) */
+ unsigned int spare :9; /* spare bits */
+};
+
+struct atm_qos {
+ struct atm_trafprm txtp; /* parameters in TX direction */
+ struct atm_trafprm rxtp __ATM_API_ALIGN;
+ /* parameters in RX direction */
+ unsigned char aal __ATM_API_ALIGN;
+};
+
+/* PVC addressing */
+
+#define ATM_ITF_ANY -1 /* "magic" PVC address values */
+#define ATM_VPI_ANY -1
+#define ATM_VCI_ANY -1
+#define ATM_VPI_UNSPEC -2
+#define ATM_VCI_UNSPEC -2
+
+
+struct sockaddr_atmpvc {
+ unsigned short sap_family; /* address family, AF_ATMPVC */
+ struct { /* PVC address */
+ short itf; /* ATM interface */
+ short vpi; /* VPI (only 8 bits at UNI) */
+ int vci; /* VCI (only 16 bits at UNI) */
+ } sap_addr __ATM_API_ALIGN; /* PVC address */
+};
+
+/* SVC addressing */
+
+#define ATM_ESA_LEN 20 /* ATM End System Address length */
+#define ATM_E164_LEN 12 /* maximum E.164 number length */
+
+#define ATM_AFI_DCC 0x39 /* DCC ATM Format */
+#define ATM_AFI_ICD 0x47 /* ICD ATM Format */
+#define ATM_AFI_E164 0x45 /* E.164 ATM Format */
+#define ATM_AFI_LOCAL 0x49 /* Local ATM Format */
+
+#define ATM_AFI_DCC_GROUP 0xBD /* DCC ATM Group Format */
+#define ATM_AFI_ICD_GROUP 0xC5 /* ICD ATM Group Format */
+#define ATM_AFI_E164_GROUP 0xC3 /* E.164 ATM Group Format */
+#define ATM_AFI_LOCAL_GROUP 0xC7 /* Local ATM Group Format */
+
+#define ATM_LIJ_NONE 0 /* no leaf-initiated join */
+#define ATM_LIJ 1 /* request joining */
+#define ATM_LIJ_RPJ 2 /* set to root-prompted join */
+#define ATM_LIJ_NJ 3 /* set to network join */
+
+
+struct sockaddr_atmsvc {
+ unsigned short sas_family; /* address family, AF_ATMSVC */
+ struct { /* SVC address */
+ unsigned char prv[ATM_ESA_LEN];/* private ATM address */
+ char pub[ATM_E164_LEN+1]; /* public address (E.164) */
+ /* unused addresses must be bzero'ed */
+ char lij_type; /* role in LIJ call; one of ATM_LIJ* */
+ uint32_t lij_id; /* LIJ call identifier */
+ } sas_addr __ATM_API_ALIGN; /* SVC address */
+};
+
+
+static __inline__ int atmsvc_addr_in_use(struct sockaddr_atmsvc addr)
+{
+ return *addr.sas_addr.prv || *addr.sas_addr.pub;
+}
+
+
+static __inline__ int atmpvc_addr_in_use(struct sockaddr_atmpvc addr)
+{
+ return addr.sap_addr.itf || addr.sap_addr.vpi || addr.sap_addr.vci;
+}
+
+
+/*
+ * Some stuff for linux/sockios.h
+ */
+
+struct atmif_sioc {
+ int number;
+ int length;
+ void *arg;
+};
+
+typedef unsigned short atm_backend_t;
+#endif
diff --git a/sysroot/usr/include/linux/atm_eni.h b/sysroot/usr/include/linux/atm_eni.h
new file mode 100644
index 0000000..34f3179
--- /dev/null
+++ b/sysroot/usr/include/linux/atm_eni.h
@@ -0,0 +1,23 @@
+/* atm_eni.h - Driver-specific declarations of the ENI driver (for use by
+ driver-specific utilities) */
+
+/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
+
+
+#ifndef LINUX_ATM_ENI_H
+#define LINUX_ATM_ENI_H
+
+#include <linux/atmioc.h>
+
+
+struct eni_multipliers {
+ int tx,rx; /* values are in percent and must be > 100 */
+};
+
+
+#define ENI_MEMDUMP _IOW('a',ATMIOC_SARPRV,struct atmif_sioc)
+ /* printk memory map */
+#define ENI_SETMULT _IOW('a',ATMIOC_SARPRV+7,struct atmif_sioc)
+ /* set buffer multipliers */
+
+#endif
diff --git a/sysroot/usr/include/linux/atm_he.h b/sysroot/usr/include/linux/atm_he.h
new file mode 100644
index 0000000..2a7713b
--- /dev/null
+++ b/sysroot/usr/include/linux/atm_he.h
@@ -0,0 +1,20 @@
+/* atm_he.h */
+
+#ifndef LINUX_ATM_HE_H
+#define LINUX_ATM_HE_H
+
+#include <linux/atmioc.h>
+
+#define HE_GET_REG _IOW('a', ATMIOC_SARPRV, struct atmif_sioc)
+
+#define HE_REGTYPE_PCI 1
+#define HE_REGTYPE_RCM 2
+#define HE_REGTYPE_TCM 3
+#define HE_REGTYPE_MBOX 4
+
+struct he_ioctl_reg {
+ unsigned addr, val;
+ char type;
+};
+
+#endif /* LINUX_ATM_HE_H */
diff --git a/sysroot/usr/include/linux/atm_idt77105.h b/sysroot/usr/include/linux/atm_idt77105.h
new file mode 100644
index 0000000..05621cf
--- /dev/null
+++ b/sysroot/usr/include/linux/atm_idt77105.h
@@ -0,0 +1,28 @@
+/* atm_idt77105.h - Driver-specific declarations of the IDT77105 driver (for
+ * use by driver-specific utilities) */
+
+/* Written 1999 by Greg Banks <gnb@linuxfan.com>. Copied from atm_suni.h. */
+
+
+#ifndef LINUX_ATM_IDT77105_H
+#define LINUX_ATM_IDT77105_H
+
+#include <asm/types.h>
+#include <linux/atmioc.h>
+#include <linux/atmdev.h>
+
+/*
+ * Structure for IDT77105_GETSTAT and IDT77105_GETSTATZ ioctls.
+ * Pointed to by `arg' in atmif_sioc.
+ */
+struct idt77105_stats {
+ __u32 symbol_errors; /* wire symbol errors */
+ __u32 tx_cells; /* cells transmitted */
+ __u32 rx_cells; /* cells received */
+ __u32 rx_hec_errors; /* Header Error Check errors on receive */
+};
+
+#define IDT77105_GETSTAT _IOW('a',ATMIOC_PHYPRV+2,struct atmif_sioc) /* get stats */
+#define IDT77105_GETSTATZ _IOW('a',ATMIOC_PHYPRV+3,struct atmif_sioc) /* get stats and zero */
+
+#endif
diff --git a/sysroot/usr/include/linux/atm_nicstar.h b/sysroot/usr/include/linux/atm_nicstar.h
new file mode 100644
index 0000000..577b79f
--- /dev/null
+++ b/sysroot/usr/include/linux/atm_nicstar.h
@@ -0,0 +1,53 @@
+/******************************************************************************
+ *
+ * atm_nicstar.h
+ *
+ * Driver-specific declarations for use by NICSTAR driver specific utils.
+ *
+ * Author: Rui Prior
+ *
+ * (C) INESC 1998
+ *
+ ******************************************************************************/
+
+
+#ifndef LINUX_ATM_NICSTAR_H
+#define LINUX_ATM_NICSTAR_H
+
+/* Note: non-kernel programs including this file must also include
+ * sys/types.h for struct timeval
+ */
+
+#include <linux/atmapi.h>
+#include <linux/atmioc.h>
+
+#define NS_GETPSTAT _IOWR('a',ATMIOC_SARPRV+1,struct atmif_sioc)
+ /* get pool statistics */
+#define NS_SETBUFLEV _IOW('a',ATMIOC_SARPRV+2,struct atmif_sioc)
+ /* set buffer level markers */
+#define NS_ADJBUFLEV _IO('a',ATMIOC_SARPRV+3)
+ /* adjust buffer level */
+
+typedef struct buf_nr
+{
+ unsigned min;
+ unsigned init;
+ unsigned max;
+}buf_nr;
+
+
+typedef struct pool_levels
+{
+ int buftype;
+ int count; /* (At least for now) only used in NS_GETPSTAT */
+ buf_nr level;
+} pool_levels;
+
+/* type must be one of the following: */
+#define NS_BUFTYPE_SMALL 1
+#define NS_BUFTYPE_LARGE 2
+#define NS_BUFTYPE_HUGE 3
+#define NS_BUFTYPE_IOVEC 4
+
+
+#endif /* LINUX_ATM_NICSTAR_H */
diff --git a/sysroot/usr/include/linux/atm_tcp.h b/sysroot/usr/include/linux/atm_tcp.h
new file mode 100644
index 0000000..b1c97e1
--- /dev/null
+++ b/sysroot/usr/include/linux/atm_tcp.h
@@ -0,0 +1,60 @@
+/* atm_tcp.h - Driver-specific declarations of the ATMTCP driver (for use by
+ driver-specific utilities) */
+
+/* Written 1997-2000 by Werner Almesberger, EPFL LRC/ICA */
+
+
+#ifndef LINUX_ATM_TCP_H
+#define LINUX_ATM_TCP_H
+
+#include <linux/atmapi.h>
+
+#include <linux/atmioc.h>
+
+
+/*
+ * All values in struct atmtcp_hdr are in network byte order
+ */
+
+struct atmtcp_hdr {
+ uint16_t vpi;
+ uint16_t vci;
+ uint32_t length; /* ... of data part */
+};
+
+/*
+ * All values in struct atmtcp_command are in host byte order
+ */
+
+#define ATMTCP_HDR_MAGIC (~0) /* this length indicates a command */
+#define ATMTCP_CTRL_OPEN 1 /* request/reply */
+#define ATMTCP_CTRL_CLOSE 2 /* request/reply */
+
+struct atmtcp_control {
+ struct atmtcp_hdr hdr; /* must be first */
+ int type; /* message type; both directions */
+ atm_kptr_t vcc; /* both directions */
+ struct sockaddr_atmpvc addr; /* suggested value from kernel */
+ struct atm_qos qos; /* both directions */
+ int result; /* to kernel only */
+} __ATM_API_ALIGN;
+
+/*
+ * Field usage:
+ * Messge type dir. hdr.v?i type addr qos vcc result
+ * ----------- ---- ------- ---- ---- --- --- ------
+ * OPEN K->D Y Y Y Y Y 0
+ * OPEN D->K - Y Y Y Y Y
+ * CLOSE K->D - - Y - Y 0
+ * CLOSE D->K - - - - Y Y
+ */
+
+#define SIOCSIFATMTCP _IO('a',ATMIOC_ITF) /* set ATMTCP mode */
+#define ATMTCP_CREATE _IO('a',ATMIOC_ITF+14) /* create persistent ATMTCP
+ interface */
+#define ATMTCP_REMOVE _IO('a',ATMIOC_ITF+15) /* destroy persistent ATMTCP
+ interface */
+
+
+
+#endif
diff --git a/sysroot/usr/include/linux/atm_zatm.h b/sysroot/usr/include/linux/atm_zatm.h
new file mode 100644
index 0000000..10f0fa2
--- /dev/null
+++ b/sysroot/usr/include/linux/atm_zatm.h
@@ -0,0 +1,52 @@
+/* atm_zatm.h - Driver-specific declarations of the ZATM driver (for use by
+ driver-specific utilities) */
+
+/* Written 1995-1999 by Werner Almesberger, EPFL LRC/ICA */
+
+
+#ifndef LINUX_ATM_ZATM_H
+#define LINUX_ATM_ZATM_H
+
+/*
+ * Note: non-kernel programs including this file must also include
+ * sys/types.h for struct timeval
+ */
+
+#include <linux/atmapi.h>
+#include <linux/atmioc.h>
+
+#define ZATM_GETPOOL _IOW('a',ATMIOC_SARPRV+1,struct atmif_sioc)
+ /* get pool statistics */
+#define ZATM_GETPOOLZ _IOW('a',ATMIOC_SARPRV+2,struct atmif_sioc)
+ /* get statistics and zero */
+#define ZATM_SETPOOL _IOW('a',ATMIOC_SARPRV+3,struct atmif_sioc)
+ /* set pool parameters */
+
+struct zatm_pool_info {
+ int ref_count; /* free buffer pool usage counters */
+ int low_water,high_water; /* refill parameters */
+ int rqa_count,rqu_count; /* queue condition counters */
+ int offset,next_off; /* alignment optimizations: offset */
+ int next_cnt,next_thres; /* repetition counter and threshold */
+};
+
+struct zatm_pool_req {
+ int pool_num; /* pool number */
+ struct zatm_pool_info info; /* actual information */
+};
+
+struct zatm_t_hist {
+ struct timeval real; /* real (wall-clock) time */
+ struct timeval expected; /* expected real time */
+};
+
+
+#define ZATM_OAM_POOL 0 /* free buffer pool for OAM cells */
+#define ZATM_AAL0_POOL 1 /* free buffer pool for AAL0 cells */
+#define ZATM_AAL5_POOL_BASE 2 /* first AAL5 free buffer pool */
+#define ZATM_LAST_POOL ZATM_AAL5_POOL_BASE+10 /* max. 64 kB */
+
+#define ZATM_TIMER_HISTORY_SIZE 16 /* number of timer adjustments to
+ record; must be 2^n */
+
+#endif
diff --git a/sysroot/usr/include/linux/atmapi.h b/sysroot/usr/include/linux/atmapi.h
new file mode 100644
index 0000000..8fe54d9
--- /dev/null
+++ b/sysroot/usr/include/linux/atmapi.h
@@ -0,0 +1,29 @@
+/* atmapi.h - ATM API user space/kernel compatibility */
+
+/* Written 1999,2000 by Werner Almesberger, EPFL ICA */
+
+
+#ifndef _LINUX_ATMAPI_H
+#define _LINUX_ATMAPI_H
+
+#if defined(__sparc__) || defined(__ia64__)
+/* such alignment is not required on 32 bit sparcs, but we can't
+ figure that we are on a sparc64 while compiling user-space programs. */
+#define __ATM_API_ALIGN __attribute__((aligned(8)))
+#else
+#define __ATM_API_ALIGN
+#endif
+
+
+/*
+ * Opaque type for kernel pointers. Note that _ is never accessed. We need
+ * the struct in order hide the array, so that we can make simple assignments
+ * instead of being forced to use memcpy. It also improves error reporting for
+ * code that still assumes that we're passing unsigned longs.
+ *
+ * Convention: NULL pointers are passed as a field of all zeroes.
+ */
+
+typedef struct { unsigned char _[8]; } __ATM_API_ALIGN atm_kptr_t;
+
+#endif
diff --git a/sysroot/usr/include/linux/atmarp.h b/sysroot/usr/include/linux/atmarp.h
new file mode 100644
index 0000000..231f4bd
--- /dev/null
+++ b/sysroot/usr/include/linux/atmarp.h
@@ -0,0 +1,41 @@
+/* atmarp.h - ATM ARP protocol and kernel-demon interface definitions */
+
+/* Written 1995-1999 by Werner Almesberger, EPFL LRC/ICA */
+
+
+#ifndef _LINUX_ATMARP_H
+#define _LINUX_ATMARP_H
+
+#include <linux/types.h>
+#include <linux/atmapi.h>
+#include <linux/atmioc.h>
+
+
+#define ATMARP_RETRY_DELAY 30 /* request next resolution or forget
+ NAK after 30 sec - should go into
+ atmclip.h */
+#define ATMARP_MAX_UNRES_PACKETS 5 /* queue that many packets while
+ waiting for the resolver */
+
+
+#define ATMARPD_CTRL _IO('a',ATMIOC_CLIP+1) /* become atmarpd ctrl sock */
+#define ATMARP_MKIP _IO('a',ATMIOC_CLIP+2) /* attach socket to IP */
+#define ATMARP_SETENTRY _IO('a',ATMIOC_CLIP+3) /* fill or hide ARP entry */
+#define ATMARP_ENCAP _IO('a',ATMIOC_CLIP+5) /* change encapsulation */
+
+
+enum atmarp_ctrl_type {
+ act_invalid, /* catch uninitialized structures */
+ act_need, /* need address resolution */
+ act_up, /* interface is coming up */
+ act_down, /* interface is going down */
+ act_change /* interface configuration has changed */
+};
+
+struct atmarp_ctrl {
+ enum atmarp_ctrl_type type; /* message type */
+ int itf_num;/* interface number (if present) */
+ __be32 ip; /* IP address (act_need only) */
+};
+
+#endif
diff --git a/sysroot/usr/include/linux/atmbr2684.h b/sysroot/usr/include/linux/atmbr2684.h
new file mode 100644
index 0000000..969fb6c
--- /dev/null
+++ b/sysroot/usr/include/linux/atmbr2684.h
@@ -0,0 +1,101 @@
+#ifndef _LINUX_ATMBR2684_H
+#define _LINUX_ATMBR2684_H
+
+#include <linux/atm.h>
+#include <linux/if.h> /* For IFNAMSIZ */
+
+/*
+ * Type of media we're bridging (ethernet, token ring, etc) Currently only
+ * ethernet is supported
+ */
+#define BR2684_MEDIA_ETHERNET (0) /* 802.3 */
+#define BR2684_MEDIA_802_4 (1) /* 802.4 */
+#define BR2684_MEDIA_TR (2) /* 802.5 - token ring */
+#define BR2684_MEDIA_FDDI (3)
+#define BR2684_MEDIA_802_6 (4) /* 802.6 */
+
+/*
+ * Is there FCS inbound on this VC? This currently isn't supported.
+ */
+#define BR2684_FCSIN_NO (0)
+#define BR2684_FCSIN_IGNORE (1)
+#define BR2684_FCSIN_VERIFY (2)
+
+/*
+ * Is there FCS outbound on this VC? This currently isn't supported.
+ */
+#define BR2684_FCSOUT_NO (0)
+#define BR2684_FCSOUT_SENDZERO (1)
+#define BR2684_FCSOUT_GENERATE (2)
+
+/*
+ * Does this VC include LLC encapsulation?
+ */
+#define BR2684_ENCAPS_VC (0) /* VC-mux */
+#define BR2684_ENCAPS_LLC (1)
+#define BR2684_ENCAPS_AUTODETECT (2) /* Unsuported */
+
+/*
+ * This is for the ATM_NEWBACKENDIF call - these are like socket families:
+ * the first element of the structure is the backend number and the rest
+ * is per-backend specific
+ */
+struct atm_newif_br2684 {
+ atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */
+ int media; /* BR2684_MEDIA_* */
+ char ifname[IFNAMSIZ];
+ int mtu;
+};
+
+/*
+ * This structure is used to specify a br2684 interface - either by a
+ * positive integer (returned by ATM_NEWBACKENDIF) or the interfaces name
+ */
+#define BR2684_FIND_BYNOTHING (0)
+#define BR2684_FIND_BYNUM (1)
+#define BR2684_FIND_BYIFNAME (2)
+struct br2684_if_spec {
+ int method; /* BR2684_FIND_* */
+ union {
+ char ifname[IFNAMSIZ];
+ int devnum;
+ } spec;
+};
+
+/*
+ * This is for the ATM_SETBACKEND call - these are like socket families:
+ * the first element of the structure is the backend number and the rest
+ * is per-backend specific
+ */
+struct atm_backend_br2684 {
+ atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */
+ struct br2684_if_spec ifspec;
+ int fcs_in; /* BR2684_FCSIN_* */
+ int fcs_out; /* BR2684_FCSOUT_* */
+ int fcs_auto; /* 1: fcs_{in,out} disabled if no FCS rx'ed */
+ int encaps; /* BR2684_ENCAPS_* */
+ int has_vpiid; /* 1: use vpn_id - Unsupported */
+ __u8 vpn_id[7];
+ int send_padding; /* unsupported */
+ int min_size; /* we will pad smaller packets than this */
+};
+
+/*
+ * The BR2684_SETFILT ioctl is an experimental mechanism for folks
+ * terminating a large number of IP-only vcc's. When netfilter allows
+ * efficient per-if in/out filters, this support will be removed
+ */
+struct br2684_filter {
+ __be32 prefix; /* network byte order */
+ __be32 netmask; /* 0 = disable filter */
+};
+
+struct br2684_filter_set {
+ struct br2684_if_spec ifspec;
+ struct br2684_filter filter;
+};
+
+#define BR2684_SETFILT _IOW( 'a', ATMIOC_BACKEND + 0, \
+ struct br2684_filter_set)
+
+#endif /* _LINUX_ATMBR2684_H */
diff --git a/sysroot/usr/include/linux/atmclip.h b/sysroot/usr/include/linux/atmclip.h
new file mode 100644
index 0000000..02c94c4
--- /dev/null
+++ b/sysroot/usr/include/linux/atmclip.h
@@ -0,0 +1,21 @@
+/* atmclip.h - Classical IP over ATM */
+
+/* Written 1995-1998 by Werner Almesberger, EPFL LRC/ICA */
+
+
+#ifndef LINUX_ATMCLIP_H
+#define LINUX_ATMCLIP_H
+
+#include <linux/sockios.h>
+#include <linux/atmioc.h>
+
+
+#define RFC1483LLC_LEN 8 /* LLC+OUI+PID = 8 */
+#define RFC1626_MTU 9180 /* RFC1626 default MTU */
+
+#define CLIP_DEFAULT_IDLETIMER 1200 /* 20 minutes, see RFC1755 */
+#define CLIP_CHECK_INTERVAL 10 /* check every ten seconds */
+
+#define SIOCMKCLIP _IO('a',ATMIOC_CLIP) /* create IP interface */
+
+#endif
diff --git a/sysroot/usr/include/linux/atmdev.h b/sysroot/usr/include/linux/atmdev.h
new file mode 100644
index 0000000..7f068b3
--- /dev/null
+++ b/sysroot/usr/include/linux/atmdev.h
@@ -0,0 +1,211 @@
+/* atmdev.h - ATM device driver declarations and various related items */
+
+/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
+
+
+#ifndef LINUX_ATMDEV_H
+#define LINUX_ATMDEV_H
+
+
+#include <linux/atmapi.h>
+#include <linux/atm.h>
+#include <linux/atmioc.h>
+
+
+#define ESI_LEN 6
+
+#define ATM_OC3_PCR (155520000/270*260/8/53)
+ /* OC3 link rate: 155520000 bps
+ SONET overhead: /270*260 (9 section, 1 path)
+ bits per cell: /8/53
+ max cell rate: 353207.547 cells/sec */
+#define ATM_25_PCR ((25600000/8-8000)/54)
+ /* 25 Mbps ATM cell rate (59111) */
+#define ATM_OC12_PCR (622080000/1080*1040/8/53)
+ /* OC12 link rate: 622080000 bps
+ SONET overhead: /1080*1040
+ bits per cell: /8/53
+ max cell rate: 1412830.188 cells/sec */
+#define ATM_DS3_PCR (8000*12)
+ /* DS3: 12 cells in a 125 usec time slot */
+
+
+#define __AAL_STAT_ITEMS \
+ __HANDLE_ITEM(tx); /* TX okay */ \
+ __HANDLE_ITEM(tx_err); /* TX errors */ \
+ __HANDLE_ITEM(rx); /* RX okay */ \
+ __HANDLE_ITEM(rx_err); /* RX errors */ \
+ __HANDLE_ITEM(rx_drop); /* RX out of memory */
+
+struct atm_aal_stats {
+#define __HANDLE_ITEM(i) int i
+ __AAL_STAT_ITEMS
+#undef __HANDLE_ITEM
+};
+
+
+struct atm_dev_stats {
+ struct atm_aal_stats aal0;
+ struct atm_aal_stats aal34;
+ struct atm_aal_stats aal5;
+} __ATM_API_ALIGN;
+
+
+#define ATM_GETLINKRATE _IOW('a',ATMIOC_ITF+1,struct atmif_sioc)
+ /* get link rate */
+#define ATM_GETNAMES _IOW('a',ATMIOC_ITF+3,struct atm_iobuf)
+ /* get interface names (numbers) */
+#define ATM_GETTYPE _IOW('a',ATMIOC_ITF+4,struct atmif_sioc)
+ /* get interface type name */
+#define ATM_GETESI _IOW('a',ATMIOC_ITF+5,struct atmif_sioc)
+ /* get interface ESI */
+#define ATM_GETADDR _IOW('a',ATMIOC_ITF+6,struct atmif_sioc)
+ /* get itf's local ATM addr. list */
+#define ATM_RSTADDR _IOW('a',ATMIOC_ITF+7,struct atmif_sioc)
+ /* reset itf's ATM address list */
+#define ATM_ADDADDR _IOW('a',ATMIOC_ITF+8,struct atmif_sioc)
+ /* add a local ATM address */
+#define ATM_DELADDR _IOW('a',ATMIOC_ITF+9,struct atmif_sioc)
+ /* remove a local ATM address */
+#define ATM_GETCIRANGE _IOW('a',ATMIOC_ITF+10,struct atmif_sioc)
+ /* get connection identifier range */
+#define ATM_SETCIRANGE _IOW('a',ATMIOC_ITF+11,struct atmif_sioc)
+ /* set connection identifier range */
+#define ATM_SETESI _IOW('a',ATMIOC_ITF+12,struct atmif_sioc)
+ /* set interface ESI */
+#define ATM_SETESIF _IOW('a',ATMIOC_ITF+13,struct atmif_sioc)
+ /* force interface ESI */
+#define ATM_ADDLECSADDR _IOW('a', ATMIOC_ITF+14, struct atmif_sioc)
+ /* register a LECS address */
+#define ATM_DELLECSADDR _IOW('a', ATMIOC_ITF+15, struct atmif_sioc)
+ /* unregister a LECS address */
+#define ATM_GETLECSADDR _IOW('a', ATMIOC_ITF+16, struct atmif_sioc)
+ /* retrieve LECS address(es) */
+
+#define ATM_GETSTAT _IOW('a',ATMIOC_SARCOM+0,struct atmif_sioc)
+ /* get AAL layer statistics */
+#define ATM_GETSTATZ _IOW('a',ATMIOC_SARCOM+1,struct atmif_sioc)
+ /* get AAL layer statistics and zero */
+#define ATM_GETLOOP _IOW('a',ATMIOC_SARCOM+2,struct atmif_sioc)
+ /* get loopback mode */
+#define ATM_SETLOOP _IOW('a',ATMIOC_SARCOM+3,struct atmif_sioc)
+ /* set loopback mode */
+#define ATM_QUERYLOOP _IOW('a',ATMIOC_SARCOM+4,struct atmif_sioc)
+ /* query supported loopback modes */
+#define ATM_SETSC _IOW('a',ATMIOC_SPECIAL+1,int)
+ /* enable or disable single-copy */
+#define ATM_SETBACKEND _IOW('a',ATMIOC_SPECIAL+2,atm_backend_t)
+ /* set backend handler */
+#define ATM_NEWBACKENDIF _IOW('a',ATMIOC_SPECIAL+3,atm_backend_t)
+ /* use backend to make new if */
+#define ATM_ADDPARTY _IOW('a', ATMIOC_SPECIAL+4,struct atm_iobuf)
+ /* add party to p2mp call */
+#define ATM_DROPPARTY _IOW('a', ATMIOC_SPECIAL+5,int)
+ /* drop party from p2mp call */
+
+/*
+ * These are backend handkers that can be set via the ATM_SETBACKEND call
+ * above. In the future we may support dynamic loading of these - for now,
+ * they're just being used to share the ATMIOC_BACKEND ioctls
+ */
+#define ATM_BACKEND_RAW 0
+#define ATM_BACKEND_PPP 1 /* PPPoATM - RFC2364 */
+#define ATM_BACKEND_BR2684 2 /* Bridged RFC1483/2684 */
+
+/* for ATM_GETTYPE */
+#define ATM_ITFTYP_LEN 8 /* maximum length of interface type name */
+
+/*
+ * Loopback modes for ATM_{PHY,SAR}_{GET,SET}LOOP
+ */
+
+/* Point of loopback CPU-->SAR-->PHY-->line--> ... */
+#define __ATM_LM_NONE 0 /* no loop back ^ ^ ^ ^ */
+#define __ATM_LM_AAL 1 /* loop back PDUs --' | | | */
+#define __ATM_LM_ATM 2 /* loop back ATM cells ---' | | */
+/* RESERVED 4 loop back on PHY side ---' */
+#define __ATM_LM_PHY 8 /* loop back bits (digital) ----' | */
+#define __ATM_LM_ANALOG 16 /* loop back the analog signal --------' */
+
+/* Direction of loopback */
+#define __ATM_LM_MKLOC(n) ((n)) /* Local (i.e. loop TX to RX) */
+#define __ATM_LM_MKRMT(n) ((n) << 8) /* Remote (i.e. loop RX to TX) */
+
+#define __ATM_LM_XTLOC(n) ((n) & 0xff)
+#define __ATM_LM_XTRMT(n) (((n) >> 8) & 0xff)
+
+#define ATM_LM_NONE 0 /* no loopback */
+
+#define ATM_LM_LOC_AAL __ATM_LM_MKLOC(__ATM_LM_AAL)
+#define ATM_LM_LOC_ATM __ATM_LM_MKLOC(__ATM_LM_ATM)
+#define ATM_LM_LOC_PHY __ATM_LM_MKLOC(__ATM_LM_PHY)
+#define ATM_LM_LOC_ANALOG __ATM_LM_MKLOC(__ATM_LM_ANALOG)
+
+#define ATM_LM_RMT_AAL __ATM_LM_MKRMT(__ATM_LM_AAL)
+#define ATM_LM_RMT_ATM __ATM_LM_MKRMT(__ATM_LM_ATM)
+#define ATM_LM_RMT_PHY __ATM_LM_MKRMT(__ATM_LM_PHY)
+#define ATM_LM_RMT_ANALOG __ATM_LM_MKRMT(__ATM_LM_ANALOG)
+
+/*
+ * Note: ATM_LM_LOC_* and ATM_LM_RMT_* can be combined, provided that
+ * __ATM_LM_XTLOC(x) <= __ATM_LM_XTRMT(x)
+ */
+
+
+struct atm_iobuf {
+ int length;
+ void *buffer;
+};
+
+/* for ATM_GETCIRANGE / ATM_SETCIRANGE */
+
+#define ATM_CI_MAX -1 /* use maximum range of VPI/VCI */
+
+struct atm_cirange {
+ signed char vpi_bits; /* 1..8, ATM_CI_MAX (-1) for maximum */
+ signed char vci_bits; /* 1..16, ATM_CI_MAX (-1) for maximum */
+};
+
+/* for ATM_SETSC; actually taken from the ATM_VF number space */
+
+#define ATM_SC_RX 1024 /* enable RX single-copy */
+#define ATM_SC_TX 2048 /* enable TX single-copy */
+
+#define ATM_BACKLOG_DEFAULT 32 /* if we get more, we're likely to time out
+ anyway */
+
+/* MF: change_qos (Modify) flags */
+
+#define ATM_MF_IMMED 1 /* Block until change is effective */
+#define ATM_MF_INC_RSV 2 /* Change reservation on increase */
+#define ATM_MF_INC_SHP 4 /* Change shaping on increase */
+#define ATM_MF_DEC_RSV 8 /* Change reservation on decrease */
+#define ATM_MF_DEC_SHP 16 /* Change shaping on decrease */
+#define ATM_MF_BWD 32 /* Set the backward direction parameters */
+
+#define ATM_MF_SET (ATM_MF_INC_RSV | ATM_MF_INC_SHP | ATM_MF_DEC_RSV | \
+ ATM_MF_DEC_SHP | ATM_MF_BWD)
+
+/*
+ * ATM_VS_* are used to express VC state in a human-friendly way.
+ */
+
+#define ATM_VS_IDLE 0 /* VC is not used */
+#define ATM_VS_CONNECTED 1 /* VC is connected */
+#define ATM_VS_CLOSING 2 /* VC is closing */
+#define ATM_VS_LISTEN 3 /* VC is listening for incoming setups */
+#define ATM_VS_INUSE 4 /* VC is in use (registered with atmsigd) */
+#define ATM_VS_BOUND 5 /* VC is bound */
+
+#define ATM_VS2TXT_MAP \
+ "IDLE", "CONNECTED", "CLOSING", "LISTEN", "INUSE", "BOUND"
+
+#define ATM_VF2TXT_MAP \
+ "ADDR", "READY", "PARTIAL", "REGIS", \
+ "RELEASED", "HASQOS", "LISTEN", "META", \
+ "256", "512", "1024", "2048", \
+ "SESSION", "HASSAP", "BOUND", "CLOSE"
+
+
+
+#endif
diff --git a/sysroot/usr/include/linux/atmioc.h b/sysroot/usr/include/linux/atmioc.h
new file mode 100644
index 0000000..37f67aa
--- /dev/null
+++ b/sysroot/usr/include/linux/atmioc.h
@@ -0,0 +1,41 @@
+/* atmioc.h - ranges for ATM-related ioctl numbers */
+
+/* Written 1995-1999 by Werner Almesberger, EPFL LRC/ICA */
+
+
+/*
+ * See http://icawww1.epfl.ch/linux-atm/magic.html for the complete list of
+ * "magic" ioctl numbers.
+ */
+
+
+#ifndef _LINUX_ATMIOC_H
+#define _LINUX_ATMIOC_H
+
+#include <asm/ioctl.h>
+ /* everybody including atmioc.h will also need _IO{,R,W,WR} */
+
+#define ATMIOC_PHYCOM 0x00 /* PHY device common ioctls, globally unique */
+#define ATMIOC_PHYCOM_END 0x0f
+#define ATMIOC_PHYTYP 0x10 /* PHY dev type ioctls, unique per PHY type */
+#define ATMIOC_PHYTYP_END 0x2f
+#define ATMIOC_PHYPRV 0x30 /* PHY dev private ioctls, unique per driver */
+#define ATMIOC_PHYPRV_END 0x4f
+#define ATMIOC_SARCOM 0x50 /* SAR device common ioctls, globally unique */
+#define ATMIOC_SARCOM_END 0x50
+#define ATMIOC_SARPRV 0x60 /* SAR dev private ioctls, unique per driver */
+#define ATMIOC_SARPRV_END 0x7f
+#define ATMIOC_ITF 0x80 /* Interface ioctls, globally unique */
+#define ATMIOC_ITF_END 0x8f
+#define ATMIOC_BACKEND 0x90 /* ATM generic backend ioctls, u. per backend */
+#define ATMIOC_BACKEND_END 0xaf
+/* 0xb0-0xbf: Reserved for future use */
+#define ATMIOC_AREQUIPA 0xc0 /* Application requested IP over ATM, glob. u. */
+#define ATMIOC_LANE 0xd0 /* LAN Emulation, globally unique */
+#define ATMIOC_MPOA 0xd8 /* MPOA, globally unique */
+#define ATMIOC_CLIP 0xe0 /* Classical IP over ATM control, globally u. */
+#define ATMIOC_CLIP_END 0xef
+#define ATMIOC_SPECIAL 0xf0 /* Special-purpose controls, globally unique */
+#define ATMIOC_SPECIAL_END 0xff
+
+#endif
diff --git a/sysroot/usr/include/linux/atmlec.h b/sysroot/usr/include/linux/atmlec.h
new file mode 100644
index 0000000..6f5a1ba
--- /dev/null
+++ b/sysroot/usr/include/linux/atmlec.h
@@ -0,0 +1,97 @@
+/*
+ * ATM Lan Emulation Daemon driver interface
+ *
+ * Marko Kiiskila <mkiiskila@yahoo.com>
+ */
+
+#ifndef _ATMLEC_H_
+#define _ATMLEC_H_
+
+#include <linux/atmapi.h>
+#include <linux/atmioc.h>
+#include <linux/atm.h>
+#include <linux/if_ether.h>
+
+/* ATM lec daemon control socket */
+#define ATMLEC_CTRL _IO('a', ATMIOC_LANE)
+#define ATMLEC_DATA _IO('a', ATMIOC_LANE+1)
+#define ATMLEC_MCAST _IO('a', ATMIOC_LANE+2)
+
+/* Maximum number of LEC interfaces (tweakable) */
+#define MAX_LEC_ITF 48
+
+/*
+ * From the total of MAX_LEC_ITF, last NUM_TR_DEVS are reserved for Token Ring.
+ * E.g. if MAX_LEC_ITF = 48 and NUM_TR_DEVS = 8, then lec0-lec39 are for
+ * Ethernet ELANs and lec40-lec47 are for Token Ring ELANS.
+ */
+#define NUM_TR_DEVS 8
+
+typedef enum {
+ l_set_mac_addr,
+ l_del_mac_addr,
+ l_svc_setup,
+ l_addr_delete,
+ l_topology_change,
+ l_flush_complete,
+ l_arp_update,
+ l_narp_req, /* LANE2 mandates the use of this */
+ l_config,
+ l_flush_tran_id,
+ l_set_lecid,
+ l_arp_xmt,
+ l_rdesc_arp_xmt,
+ l_associate_req,
+ l_should_bridge /* should we bridge this MAC? */
+} atmlec_msg_type;
+
+#define ATMLEC_MSG_TYPE_MAX l_should_bridge
+
+struct atmlec_config_msg {
+ unsigned int maximum_unknown_frame_count;
+ unsigned int max_unknown_frame_time;
+ unsigned short max_retry_count;
+ unsigned int aging_time;
+ unsigned int forward_delay_time;
+ unsigned int arp_response_time;
+ unsigned int flush_timeout;
+ unsigned int path_switching_delay;
+ unsigned int lane_version; /* LANE2: 1 for LANEv1, 2 for LANEv2 */
+ int mtu;
+ int is_proxy;
+};
+
+struct atmlec_msg {
+ atmlec_msg_type type;
+ int sizeoftlvs; /* LANE2: if != 0, tlvs follow */
+ union {
+ struct {
+ unsigned char mac_addr[ETH_ALEN];
+ unsigned char atm_addr[ATM_ESA_LEN];
+ unsigned int flag; /*
+ * Topology_change flag,
+ * remoteflag, permanent flag,
+ * lecid, transaction id
+ */
+ unsigned int targetless_le_arp; /* LANE2 */
+ unsigned int no_source_le_narp; /* LANE2 */
+ } normal;
+ struct atmlec_config_msg config;
+ struct {
+ uint16_t lec_id; /* requestor lec_id */
+ uint32_t tran_id; /* transaction id */
+ unsigned char mac_addr[ETH_ALEN]; /* dst mac addr */
+ unsigned char atm_addr[ATM_ESA_LEN]; /* reqestor ATM addr */
+ } proxy; /*
+ * For mapping LE_ARP requests to responses. Filled by
+ * zeppelin, returned by kernel. Used only when proxying
+ */
+ } content;
+} __ATM_API_ALIGN;
+
+struct atmlec_ioc {
+ int dev_num;
+ unsigned char atm_addr[ATM_ESA_LEN];
+ unsigned char receive; /* 1= receive vcc, 0 = send vcc */
+};
+#endif /* _ATMLEC_H_ */
diff --git a/sysroot/usr/include/linux/atmmpc.h b/sysroot/usr/include/linux/atmmpc.h
new file mode 100644
index 0000000..ea16504
--- /dev/null
+++ b/sysroot/usr/include/linux/atmmpc.h
@@ -0,0 +1,125 @@
+#ifndef _ATMMPC_H_
+#define _ATMMPC_H_
+
+#include <linux/atmapi.h>
+#include <linux/atmioc.h>
+#include <linux/atm.h>
+
+#define ATMMPC_CTRL _IO('a', ATMIOC_MPOA)
+#define ATMMPC_DATA _IO('a', ATMIOC_MPOA+1)
+
+#define MPC_SOCKET_INGRESS 1
+#define MPC_SOCKET_EGRESS 2
+
+struct atmmpc_ioc {
+ int dev_num;
+ __be32 ipaddr; /* the IP address of the shortcut */
+ int type; /* ingress or egress */
+};
+
+typedef struct in_ctrl_info {
+ uint8_t Last_NHRP_CIE_code;
+ uint8_t Last_Q2931_cause_value;
+ uint8_t eg_MPC_ATM_addr[ATM_ESA_LEN];
+ __be32 tag;
+ __be32 in_dst_ip; /* IP address this ingress MPC sends packets to */
+ uint16_t holding_time;
+ uint32_t request_id;
+} in_ctrl_info;
+
+typedef struct eg_ctrl_info {
+ uint8_t DLL_header[256];
+ uint8_t DH_length;
+ __be32 cache_id;
+ __be32 tag;
+ __be32 mps_ip;
+ __be32 eg_dst_ip; /* IP address to which ingress MPC sends packets */
+ uint8_t in_MPC_data_ATM_addr[ATM_ESA_LEN];
+ uint16_t holding_time;
+} eg_ctrl_info;
+
+struct mpc_parameters {
+ uint16_t mpc_p1; /* Shortcut-Setup Frame Count */
+ uint16_t mpc_p2; /* Shortcut-Setup Frame Time */
+ uint8_t mpc_p3[8]; /* Flow-detection Protocols */
+ uint16_t mpc_p4; /* MPC Initial Retry Time */
+ uint16_t mpc_p5; /* MPC Retry Time Maximum */
+ uint16_t mpc_p6; /* Hold Down Time */
+} ;
+
+struct k_message {
+ uint16_t type;
+ __be32 ip_mask;
+ uint8_t MPS_ctrl[ATM_ESA_LEN];
+ union {
+ in_ctrl_info in_info;
+ eg_ctrl_info eg_info;
+ struct mpc_parameters params;
+ } content;
+ struct atm_qos qos;
+} __ATM_API_ALIGN;
+
+struct llc_snap_hdr {
+ /* RFC 1483 LLC/SNAP encapsulation for routed IP PDUs */
+ uint8_t dsap; /* Destination Service Access Point (0xAA) */
+ uint8_t ssap; /* Source Service Access Point (0xAA) */
+ uint8_t ui; /* Unnumbered Information (0x03) */
+ uint8_t org[3]; /* Organizational identification (0x000000) */
+ uint8_t type[2]; /* Ether type (for IP) (0x0800) */
+};
+
+/* TLVs this MPC recognizes */
+#define TLV_MPOA_DEVICE_TYPE 0x00a03e2a
+
+/* MPOA device types in MPOA Device Type TLV */
+#define NON_MPOA 0
+#define MPS 1
+#define MPC 2
+#define MPS_AND_MPC 3
+
+
+/* MPC parameter defaults */
+
+#define MPC_P1 10 /* Shortcut-Setup Frame Count */
+#define MPC_P2 1 /* Shortcut-Setup Frame Time */
+#define MPC_P3 0 /* Flow-detection Protocols */
+#define MPC_P4 5 /* MPC Initial Retry Time */
+#define MPC_P5 40 /* MPC Retry Time Maximum */
+#define MPC_P6 160 /* Hold Down Time */
+#define HOLDING_TIME_DEFAULT 1200 /* same as MPS-p7 */
+
+/* MPC constants */
+
+#define MPC_C1 2 /* Retry Time Multiplier */
+#define MPC_C2 60 /* Initial Keep-Alive Lifetime */
+
+/* Message types - to MPOA daemon */
+
+#define SND_MPOA_RES_RQST 201
+#define SET_MPS_CTRL_ADDR 202
+#define SND_MPOA_RES_RTRY 203 /* Different type in a retry due to req id */
+#define STOP_KEEP_ALIVE_SM 204
+#define EGRESS_ENTRY_REMOVED 205
+#define SND_EGRESS_PURGE 206
+#define DIE 207 /* tell the daemon to exit() */
+#define DATA_PLANE_PURGE 208 /* Data plane purge because of egress cache hit miss or dead MPS */
+#define OPEN_INGRESS_SVC 209
+
+/* Message types - from MPOA daemon */
+
+#define MPOA_TRIGGER_RCVD 101
+#define MPOA_RES_REPLY_RCVD 102
+#define INGRESS_PURGE_RCVD 103
+#define EGRESS_PURGE_RCVD 104
+#define MPS_DEATH 105
+#define CACHE_IMPOS_RCVD 106
+#define SET_MPC_CTRL_ADDR 107 /* Our MPC's control ATM address */
+#define SET_MPS_MAC_ADDR 108
+#define CLEAN_UP_AND_EXIT 109
+#define SET_MPC_PARAMS 110 /* MPC configuration parameters */
+
+/* Message types - bidirectional */
+
+#define RELOAD 301 /* kill -HUP the daemon for reload */
+
+#endif /* _ATMMPC_H_ */
diff --git a/sysroot/usr/include/linux/atmppp.h b/sysroot/usr/include/linux/atmppp.h
new file mode 100644
index 0000000..300dcce
--- /dev/null
+++ b/sysroot/usr/include/linux/atmppp.h
@@ -0,0 +1,24 @@
+/* atmppp.h - RFC2364 PPPoATM */
+
+/* Written 2000 by Mitchell Blank Jr */
+
+#ifndef _LINUX_ATMPPP_H
+#define _LINUX_ATMPPP_H
+
+#include <linux/atm.h>
+
+#define PPPOATM_ENCAPS_AUTODETECT (0)
+#define PPPOATM_ENCAPS_VC (1)
+#define PPPOATM_ENCAPS_LLC (2)
+
+/*
+ * This is for the ATM_SETBACKEND call - these are like socket families:
+ * the first element of the structure is the backend number and the rest
+ * is per-backend specific
+ */
+struct atm_backend_ppp {
+ atm_backend_t backend_num; /* ATM_BACKEND_PPP */
+ int encaps; /* PPPOATM_ENCAPS_* */
+};
+
+#endif /* _LINUX_ATMPPP_H */
diff --git a/sysroot/usr/include/linux/atmsap.h b/sysroot/usr/include/linux/atmsap.h
new file mode 100644
index 0000000..799b104
--- /dev/null
+++ b/sysroot/usr/include/linux/atmsap.h
@@ -0,0 +1,162 @@
+/* atmsap.h - ATM Service Access Point addressing definitions */
+
+/* Written 1995-1999 by Werner Almesberger, EPFL LRC/ICA */
+
+
+#ifndef _LINUX_ATMSAP_H
+#define _LINUX_ATMSAP_H
+
+#include <linux/atmapi.h>
+
+/*
+ * BEGIN_xx and END_xx markers are used for automatic generation of
+ * documentation. Do not change them.
+ */
+
+
+/*
+ * Layer 2 protocol identifiers
+ */
+
+/* BEGIN_L2 */
+#define ATM_L2_NONE 0 /* L2 not specified */
+#define ATM_L2_ISO1745 0x01 /* Basic mode ISO 1745 */
+#define ATM_L2_Q291 0x02 /* ITU-T Q.291 (Rec. I.441) */
+#define ATM_L2_X25_LL 0x06 /* ITU-T X.25, link layer */
+#define ATM_L2_X25_ML 0x07 /* ITU-T X.25, multilink */
+#define ATM_L2_LAPB 0x08 /* Extended LAPB, half-duplex (Rec. T.71) */
+#define ATM_L2_HDLC_ARM 0x09 /* HDLC ARM (ISO/IEC 4335) */
+#define ATM_L2_HDLC_NRM 0x0a /* HDLC NRM (ISO/IEC 4335) */
+#define ATM_L2_HDLC_ABM 0x0b /* HDLC ABM (ISO/IEC 4335) */
+#define ATM_L2_ISO8802 0x0c /* LAN LLC (ISO/IEC 8802/2) */
+#define ATM_L2_X75 0x0d /* ITU-T X.75, SLP */
+#define ATM_L2_Q922 0x0e /* ITU-T Q.922 */
+#define ATM_L2_USER 0x10 /* user-specified */
+#define ATM_L2_ISO7776 0x11 /* ISO 7776 DTE-DTE */
+/* END_L2 */
+
+
+/*
+ * Layer 3 protocol identifiers
+ */
+
+/* BEGIN_L3 */
+#define ATM_L3_NONE 0 /* L3 not specified */
+#define ATM_L3_X25 0x06 /* ITU-T X.25, packet layer */
+#define ATM_L3_ISO8208 0x07 /* ISO/IEC 8208 */
+#define ATM_L3_X223 0x08 /* ITU-T X.223 | ISO/IEC 8878 */
+#define ATM_L3_ISO8473 0x09 /* ITU-T X.233 | ISO/IEC 8473 */
+#define ATM_L3_T70 0x0a /* ITU-T T.70 minimum network layer */
+#define ATM_L3_TR9577 0x0b /* ISO/IEC TR 9577 */
+#define ATM_L3_H310 0x0c /* ITU-T Recommendation H.310 */
+#define ATM_L3_H321 0x0d /* ITU-T Recommendation H.321 */
+#define ATM_L3_USER 0x10 /* user-specified */
+/* END_L3 */
+
+
+/*
+ * High layer identifiers
+ */
+
+/* BEGIN_HL */
+#define ATM_HL_NONE 0 /* HL not specified */
+#define ATM_HL_ISO 0x01 /* ISO */
+#define ATM_HL_USER 0x02 /* user-specific */
+#define ATM_HL_HLP 0x03 /* high layer profile - UNI 3.0 only */
+#define ATM_HL_VENDOR 0x04 /* vendor-specific application identifier */
+/* END_HL */
+
+
+/*
+ * ITU-T coded mode of operation
+ */
+
+/* BEGIN_IMD */
+#define ATM_IMD_NONE 0 /* mode not specified */
+#define ATM_IMD_NORMAL 1 /* normal mode of operation */
+#define ATM_IMD_EXTENDED 2 /* extended mode of operation */
+/* END_IMD */
+
+/*
+ * H.310 code points
+ */
+
+#define ATM_TT_NONE 0 /* terminal type not specified */
+#define ATM_TT_RX 1 /* receive only */
+#define ATM_TT_TX 2 /* send only */
+#define ATM_TT_RXTX 3 /* receive and send */
+
+#define ATM_MC_NONE 0 /* no multiplexing */
+#define ATM_MC_TS 1 /* transport stream (TS) */
+#define ATM_MC_TS_FEC 2 /* transport stream with forward error corr. */
+#define ATM_MC_PS 3 /* program stream (PS) */
+#define ATM_MC_PS_FEC 4 /* program stream with forward error corr. */
+#define ATM_MC_H221 5 /* ITU-T Rec. H.221 */
+
+/*
+ * SAP structures
+ */
+
+#define ATM_MAX_HLI 8 /* maximum high-layer information length */
+
+
+struct atm_blli {
+ unsigned char l2_proto; /* layer 2 protocol */
+ union {
+ struct {
+ unsigned char mode; /* mode of operation (ATM_IMD_xxx), 0 if */
+ /* absent */
+ unsigned char window; /* window size (k), 1-127 (0 to omit) */
+ } itu; /* ITU-T encoding */
+ unsigned char user; /* user-specified l2 information */
+ } l2;
+ unsigned char l3_proto; /* layer 3 protocol */
+ union {
+ struct {
+ unsigned char mode; /* mode of operation (ATM_IMD_xxx), 0 if */
+ /* absent */
+ unsigned char def_size; /* default packet size (log2), 4-12 (0 to */
+ /* omit) */
+ unsigned char window;/* packet window size, 1-127 (0 to omit) */
+ } itu; /* ITU-T encoding */
+ unsigned char user; /* user specified l3 information */
+ struct { /* if l3_proto = ATM_L3_H310 */
+ unsigned char term_type; /* terminal type */
+ unsigned char fw_mpx_cap; /* forward multiplexing capability */
+ /* only if term_type != ATM_TT_NONE */
+ unsigned char bw_mpx_cap; /* backward multiplexing capability */
+ /* only if term_type != ATM_TT_NONE */
+ } h310;
+ struct { /* if l3_proto = ATM_L3_TR9577 */
+ unsigned char ipi; /* initial protocol id */
+ unsigned char snap[5];/* IEEE 802.1 SNAP identifier */
+ /* (only if ipi == NLPID_IEEE802_1_SNAP) */
+ } tr9577;
+ } l3;
+} __ATM_API_ALIGN;
+
+
+struct atm_bhli {
+ unsigned char hl_type; /* high layer information type */
+ unsigned char hl_length; /* length (only if hl_type == ATM_HL_USER || */
+ /* hl_type == ATM_HL_ISO) */
+ unsigned char hl_info[ATM_MAX_HLI];/* high layer information */
+};
+
+
+#define ATM_MAX_BLLI 3 /* maximum number of BLLI elements */
+
+
+struct atm_sap {
+ struct atm_bhli bhli; /* local SAP, high-layer information */
+ struct atm_blli blli[ATM_MAX_BLLI] __ATM_API_ALIGN;
+ /* local SAP, low-layer info */
+};
+
+
+static __inline__ int blli_in_use(struct atm_blli blli)
+{
+ return blli.l2_proto || blli.l3_proto;
+}
+
+#endif
diff --git a/sysroot/usr/include/linux/atmsvc.h b/sysroot/usr/include/linux/atmsvc.h
new file mode 100644
index 0000000..aa71583
--- /dev/null
+++ b/sysroot/usr/include/linux/atmsvc.h
@@ -0,0 +1,55 @@
+/* atmsvc.h - ATM signaling kernel-demon interface definitions */
+
+/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
+
+
+#ifndef _LINUX_ATMSVC_H
+#define _LINUX_ATMSVC_H
+
+#include <linux/atmapi.h>
+#include <linux/atm.h>
+#include <linux/atmioc.h>
+
+
+#define ATMSIGD_CTRL _IO('a',ATMIOC_SPECIAL)
+ /* become ATM signaling demon control socket */
+
+enum atmsvc_msg_type { as_catch_null, as_bind, as_connect, as_accept, as_reject,
+ as_listen, as_okay, as_error, as_indicate, as_close,
+ as_itf_notify, as_modify, as_identify, as_terminate,
+ as_addparty, as_dropparty };
+
+struct atmsvc_msg {
+ enum atmsvc_msg_type type;
+ atm_kptr_t vcc;
+ atm_kptr_t listen_vcc; /* indicate */
+ int reply; /* for okay and close: */
+ /* < 0: error before active */
+ /* (sigd has discarded ctx) */
+ /* ==0: success */
+ /* > 0: error when active (still */
+ /* need to close) */
+ struct sockaddr_atmpvc pvc; /* indicate, okay (connect) */
+ struct sockaddr_atmsvc local; /* local SVC address */
+ struct atm_qos qos; /* QOS parameters */
+ struct atm_sap sap; /* SAP */
+ unsigned int session; /* for p2pm */
+ struct sockaddr_atmsvc svc; /* SVC address */
+} __ATM_API_ALIGN;
+
+/*
+ * Message contents: see ftp://icaftp.epfl.ch/pub/linux/atm/docs/isp-*.tar.gz
+ */
+
+/*
+ * Some policy stuff for atmsigd and for net/atm/svc.c. Both have to agree on
+ * what PCR is used to request bandwidth from the device driver. net/atm/svc.c
+ * tries to do better than that, but only if there's no routing decision (i.e.
+ * if signaling only uses one ATM interface).
+ */
+
+#define SELECT_TOP_PCR(tp) ((tp).pcr ? (tp).pcr : \
+ (tp).max_pcr && (tp).max_pcr != ATM_MAX_PCR ? (tp).max_pcr : \
+ (tp).min_pcr ? (tp).min_pcr : ATM_MAX_PCR)
+
+#endif
diff --git a/sysroot/usr/include/linux/audit.h b/sysroot/usr/include/linux/audit.h
new file mode 100644
index 0000000..f099ec1
--- /dev/null
+++ b/sysroot/usr/include/linux/audit.h
@@ -0,0 +1,346 @@
+/* audit.h -- Auditing support
+ *
+ * Copyright 2003-2004 Red Hat Inc., Durham, North Carolina.
+ * All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Written by Rickard E. (Rik) Faith <faith@redhat.com>
+ *
+ */
+
+#ifndef _LINUX_AUDIT_H_
+#define _LINUX_AUDIT_H_
+
+#include <linux/types.h>
+#include <linux/elf-em.h>
+
+/* The netlink messages for the audit system is divided into blocks:
+ * 1000 - 1099 are for commanding the audit system
+ * 1100 - 1199 user space trusted application messages
+ * 1200 - 1299 messages internal to the audit daemon
+ * 1300 - 1399 audit event messages
+ * 1400 - 1499 SE Linux use
+ * 1500 - 1599 AppArmor use
+ * 1600 - 1699 kernel crypto events
+ * 1700 - 1799 kernel anomaly records
+ * 1800 - 1999 future kernel use (maybe integrity labels and related events)
+ * 2000 is for otherwise unclassified kernel audit messages (legacy)
+ * 2001 - 2099 unused (kernel)
+ * 2100 - 2199 user space anomaly records
+ * 2200 - 2299 user space actions taken in response to anomalies
+ * 2300 - 2399 user space generated LSPP events
+ * 2400 - 2499 user space crypto events
+ * 2500 - 2999 future user space (maybe integrity labels and related events)
+ *
+ * Messages from 1000-1199 are bi-directional. 1200-1299 & 2100 - 2999 are
+ * exclusively user space. 1300-2099 is kernel --> user space
+ * communication.
+ */
+#define AUDIT_GET 1000 /* Get status */
+#define AUDIT_SET 1001 /* Set status (enable/disable/auditd) */
+#define AUDIT_LIST 1002 /* List syscall rules -- deprecated */
+#define AUDIT_ADD 1003 /* Add syscall rule -- deprecated */
+#define AUDIT_DEL 1004 /* Delete syscall rule -- deprecated */
+#define AUDIT_USER 1005 /* Message from userspace -- deprecated */
+#define AUDIT_LOGIN 1006 /* Define the login id and information */
+#define AUDIT_WATCH_INS 1007 /* Insert file/dir watch entry */
+#define AUDIT_WATCH_REM 1008 /* Remove file/dir watch entry */
+#define AUDIT_WATCH_LIST 1009 /* List all file/dir watches */
+#define AUDIT_SIGNAL_INFO 1010 /* Get info about sender of signal to auditd */
+#define AUDIT_ADD_RULE 1011 /* Add syscall filtering rule */
+#define AUDIT_DEL_RULE 1012 /* Delete syscall filtering rule */
+#define AUDIT_LIST_RULES 1013 /* List syscall filtering rules */
+#define AUDIT_TRIM 1014 /* Trim junk from watched tree */
+#define AUDIT_MAKE_EQUIV 1015 /* Append to watched tree */
+#define AUDIT_TTY_GET 1016 /* Get TTY auditing status */
+#define AUDIT_TTY_SET 1017 /* Set TTY auditing status */
+
+#define AUDIT_FIRST_USER_MSG 1100 /* Userspace messages mostly uninteresting to kernel */
+#define AUDIT_USER_AVC 1107 /* We filter this differently */
+#define AUDIT_USER_TTY 1124 /* Non-ICANON TTY input meaning */
+#define AUDIT_LAST_USER_MSG 1199
+#define AUDIT_FIRST_USER_MSG2 2100 /* More user space messages */
+#define AUDIT_LAST_USER_MSG2 2999
+
+#define AUDIT_DAEMON_START 1200 /* Daemon startup record */
+#define AUDIT_DAEMON_END 1201 /* Daemon normal stop record */
+#define AUDIT_DAEMON_ABORT 1202 /* Daemon error stop record */
+#define AUDIT_DAEMON_CONFIG 1203 /* Daemon config change */
+
+#define AUDIT_SYSCALL 1300 /* Syscall event */
+/* #define AUDIT_FS_WATCH 1301 * Deprecated */
+#define AUDIT_PATH 1302 /* Filename path information */
+#define AUDIT_IPC 1303 /* IPC record */
+#define AUDIT_SOCKETCALL 1304 /* sys_socketcall arguments */
+#define AUDIT_CONFIG_CHANGE 1305 /* Audit system configuration change */
+#define AUDIT_SOCKADDR 1306 /* sockaddr copied as syscall arg */
+#define AUDIT_CWD 1307 /* Current working directory */
+#define AUDIT_EXECVE 1309 /* execve arguments */
+#define AUDIT_IPC_SET_PERM 1311 /* IPC new permissions record type */
+#define AUDIT_MQ_OPEN 1312 /* POSIX MQ open record type */
+#define AUDIT_MQ_SENDRECV 1313 /* POSIX MQ send/receive record type */
+#define AUDIT_MQ_NOTIFY 1314 /* POSIX MQ notify record type */
+#define AUDIT_MQ_GETSETATTR 1315 /* POSIX MQ get/set attribute record type */
+#define AUDIT_KERNEL_OTHER 1316 /* For use by 3rd party modules */
+#define AUDIT_FD_PAIR 1317 /* audit record for pipe/socketpair */
+#define AUDIT_OBJ_PID 1318 /* ptrace target */
+#define AUDIT_TTY 1319 /* Input on an administrative TTY */
+
+#define AUDIT_AVC 1400 /* SE Linux avc denial or grant */
+#define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */
+#define AUDIT_AVC_PATH 1402 /* dentry, vfsmount pair from avc */
+#define AUDIT_MAC_POLICY_LOAD 1403 /* Policy file load */
+#define AUDIT_MAC_STATUS 1404 /* Changed enforcing,permissive,off */
+#define AUDIT_MAC_CONFIG_CHANGE 1405 /* Changes to booleans */
+#define AUDIT_MAC_UNLBL_ALLOW 1406 /* NetLabel: allow unlabeled traffic */
+#define AUDIT_MAC_CIPSOV4_ADD 1407 /* NetLabel: add CIPSOv4 DOI entry */
+#define AUDIT_MAC_CIPSOV4_DEL 1408 /* NetLabel: del CIPSOv4 DOI entry */
+#define AUDIT_MAC_MAP_ADD 1409 /* NetLabel: add LSM domain mapping */
+#define AUDIT_MAC_MAP_DEL 1410 /* NetLabel: del LSM domain mapping */
+#define AUDIT_MAC_IPSEC_ADDSA 1411 /* Not used */
+#define AUDIT_MAC_IPSEC_DELSA 1412 /* Not used */
+#define AUDIT_MAC_IPSEC_ADDSPD 1413 /* Not used */
+#define AUDIT_MAC_IPSEC_DELSPD 1414 /* Not used */
+#define AUDIT_MAC_IPSEC_EVENT 1415 /* Audit an IPSec event */
+
+#define AUDIT_APPARMOR_AUDIT 1501 /* AppArmor audited grants */
+#define AUDIT_APPARMOR_ALLOWED 1502 /* Allowed Access for learning */
+#define AUDIT_APPARMOR_DENIED 1503
+#define AUDIT_APPARMOR_HINT 1504 /* Process Tracking information */
+#define AUDIT_APPARMOR_STATUS 1505 /* Changes in config */
+#define AUDIT_APPARMOR_ERROR 1506 /* Internal AppArmor Errors */
+
+#define AUDIT_FIRST_KERN_ANOM_MSG 1700
+#define AUDIT_LAST_KERN_ANOM_MSG 1799
+#define AUDIT_ANOM_PROMISCUOUS 1700 /* Device changed promiscuous mode */
+#define AUDIT_ANOM_ABEND 1701 /* Process ended abnormally */
+
+#define AUDIT_SD 1500 /* AppArmor (SubDomain) audit */
+
+#define AUDIT_KERNEL 2000 /* Asynchronous audit record. NOT A REQUEST. */
+
+/* Rule flags */
+#define AUDIT_FILTER_USER 0x00 /* Apply rule to user-generated messages */
+#define AUDIT_FILTER_TASK 0x01 /* Apply rule at task creation (not syscall) */
+#define AUDIT_FILTER_ENTRY 0x02 /* Apply rule at syscall entry */
+#define AUDIT_FILTER_WATCH 0x03 /* Apply rule to file system watches */
+#define AUDIT_FILTER_EXIT 0x04 /* Apply rule at syscall exit */
+#define AUDIT_FILTER_TYPE 0x05 /* Apply rule at audit_log_start */
+
+#define AUDIT_NR_FILTERS 6
+
+#define AUDIT_FILTER_PREPEND 0x10 /* Prepend to front of list */
+
+/* Rule actions */
+#define AUDIT_NEVER 0 /* Do not build context if rule matches */
+#define AUDIT_POSSIBLE 1 /* Build context if rule matches */
+#define AUDIT_ALWAYS 2 /* Generate audit record if rule matches */
+
+/* Rule structure sizes -- if these change, different AUDIT_ADD and
+ * AUDIT_LIST commands must be implemented. */
+#define AUDIT_MAX_FIELDS 64
+#define AUDIT_MAX_KEY_LEN 32
+#define AUDIT_BITMASK_SIZE 64
+#define AUDIT_WORD(nr) ((__u32)((nr)/32))
+#define AUDIT_BIT(nr) (1 << ((nr) - AUDIT_WORD(nr)*32))
+
+#define AUDIT_SYSCALL_CLASSES 16
+#define AUDIT_CLASS_DIR_WRITE 0
+#define AUDIT_CLASS_DIR_WRITE_32 1
+#define AUDIT_CLASS_CHATTR 2
+#define AUDIT_CLASS_CHATTR_32 3
+#define AUDIT_CLASS_READ 4
+#define AUDIT_CLASS_READ_32 5
+#define AUDIT_CLASS_WRITE 6
+#define AUDIT_CLASS_WRITE_32 7
+#define AUDIT_CLASS_SIGNAL 8
+#define AUDIT_CLASS_SIGNAL_32 9
+
+/* This bitmask is used to validate user input. It represents all bits that
+ * are currently used in an audit field constant understood by the kernel.
+ * If you are adding a new #define AUDIT_<whatever>, please ensure that
+ * AUDIT_UNUSED_BITS is updated if need be. */
+#define AUDIT_UNUSED_BITS 0x07FFFC00
+
+
+/* Rule fields */
+ /* These are useful when checking the
+ * task structure at task creation time
+ * (AUDIT_PER_TASK). */
+#define AUDIT_PID 0
+#define AUDIT_UID 1
+#define AUDIT_EUID 2
+#define AUDIT_SUID 3
+#define AUDIT_FSUID 4
+#define AUDIT_GID 5
+#define AUDIT_EGID 6
+#define AUDIT_SGID 7
+#define AUDIT_FSGID 8
+#define AUDIT_LOGINUID 9
+#define AUDIT_PERS 10
+#define AUDIT_ARCH 11
+#define AUDIT_MSGTYPE 12
+#define AUDIT_SUBJ_USER 13 /* security label user */
+#define AUDIT_SUBJ_ROLE 14 /* security label role */
+#define AUDIT_SUBJ_TYPE 15 /* security label type */
+#define AUDIT_SUBJ_SEN 16 /* security label sensitivity label */
+#define AUDIT_SUBJ_CLR 17 /* security label clearance label */
+#define AUDIT_PPID 18
+#define AUDIT_OBJ_USER 19
+#define AUDIT_OBJ_ROLE 20
+#define AUDIT_OBJ_TYPE 21
+#define AUDIT_OBJ_LEV_LOW 22
+#define AUDIT_OBJ_LEV_HIGH 23
+
+ /* These are ONLY useful when checking
+ * at syscall exit time (AUDIT_AT_EXIT). */
+#define AUDIT_DEVMAJOR 100
+#define AUDIT_DEVMINOR 101
+#define AUDIT_INODE 102
+#define AUDIT_EXIT 103
+#define AUDIT_SUCCESS 104 /* exit >= 0; value ignored */
+#define AUDIT_WATCH 105
+#define AUDIT_PERM 106
+#define AUDIT_DIR 107
+
+#define AUDIT_ARG0 200
+#define AUDIT_ARG1 (AUDIT_ARG0+1)
+#define AUDIT_ARG2 (AUDIT_ARG0+2)
+#define AUDIT_ARG3 (AUDIT_ARG0+3)
+
+#define AUDIT_FILTERKEY 210
+
+#define AUDIT_NEGATE 0x80000000
+
+/* These are the supported operators.
+ * 4 2 1 8
+ * = > < ?
+ * ----------
+ * 0 0 0 0 00 nonsense
+ * 0 0 0 1 08 & bit mask
+ * 0 0 1 0 10 <
+ * 0 1 0 0 20 >
+ * 0 1 1 0 30 !=
+ * 1 0 0 0 40 =
+ * 1 0 0 1 48 &= bit test
+ * 1 0 1 0 50 <=
+ * 1 1 0 0 60 >=
+ * 1 1 1 1 78 all operators
+ */
+#define AUDIT_BIT_MASK 0x08000000
+#define AUDIT_LESS_THAN 0x10000000
+#define AUDIT_GREATER_THAN 0x20000000
+#define AUDIT_NOT_EQUAL 0x30000000
+#define AUDIT_EQUAL 0x40000000
+#define AUDIT_BIT_TEST (AUDIT_BIT_MASK|AUDIT_EQUAL)
+#define AUDIT_LESS_THAN_OR_EQUAL (AUDIT_LESS_THAN|AUDIT_EQUAL)
+#define AUDIT_GREATER_THAN_OR_EQUAL (AUDIT_GREATER_THAN|AUDIT_EQUAL)
+#define AUDIT_OPERATORS (AUDIT_EQUAL|AUDIT_NOT_EQUAL|AUDIT_BIT_MASK)
+
+/* Status symbols */
+ /* Mask values */
+#define AUDIT_STATUS_ENABLED 0x0001
+#define AUDIT_STATUS_FAILURE 0x0002
+#define AUDIT_STATUS_PID 0x0004
+#define AUDIT_STATUS_RATE_LIMIT 0x0008
+#define AUDIT_STATUS_BACKLOG_LIMIT 0x0010
+ /* Failure-to-log actions */
+#define AUDIT_FAIL_SILENT 0
+#define AUDIT_FAIL_PRINTK 1
+#define AUDIT_FAIL_PANIC 2
+
+/* distinguish syscall tables */
+#define __AUDIT_ARCH_64BIT 0x80000000
+#define __AUDIT_ARCH_LE 0x40000000
+#define AUDIT_ARCH_ALPHA (EM_ALPHA|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
+#define AUDIT_ARCH_ARM (EM_ARM|__AUDIT_ARCH_LE)
+#define AUDIT_ARCH_ARMEB (EM_ARM)
+#define AUDIT_ARCH_CRIS (EM_CRIS|__AUDIT_ARCH_LE)
+#define AUDIT_ARCH_FRV (EM_FRV)
+#define AUDIT_ARCH_H8300 (EM_H8_300)
+#define AUDIT_ARCH_I386 (EM_386|__AUDIT_ARCH_LE)
+#define AUDIT_ARCH_IA64 (EM_IA_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
+#define AUDIT_ARCH_M32R (EM_M32R)
+#define AUDIT_ARCH_M68K (EM_68K)
+#define AUDIT_ARCH_MIPS (EM_MIPS)
+#define AUDIT_ARCH_MIPSEL (EM_MIPS|__AUDIT_ARCH_LE)
+#define AUDIT_ARCH_MIPS64 (EM_MIPS|__AUDIT_ARCH_64BIT)
+#define AUDIT_ARCH_MIPSEL64 (EM_MIPS|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
+#define AUDIT_ARCH_PARISC (EM_PARISC)
+#define AUDIT_ARCH_PARISC64 (EM_PARISC|__AUDIT_ARCH_64BIT)
+#define AUDIT_ARCH_PPC (EM_PPC)
+#define AUDIT_ARCH_PPC64 (EM_PPC64|__AUDIT_ARCH_64BIT)
+#define AUDIT_ARCH_S390 (EM_S390)
+#define AUDIT_ARCH_S390X (EM_S390|__AUDIT_ARCH_64BIT)
+#define AUDIT_ARCH_SH (EM_SH)
+#define AUDIT_ARCH_SHEL (EM_SH|__AUDIT_ARCH_LE)
+#define AUDIT_ARCH_SH64 (EM_SH|__AUDIT_ARCH_64BIT)
+#define AUDIT_ARCH_SHEL64 (EM_SH|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
+#define AUDIT_ARCH_SPARC (EM_SPARC)
+#define AUDIT_ARCH_SPARC64 (EM_SPARCV9|__AUDIT_ARCH_64BIT)
+#define AUDIT_ARCH_V850 (EM_V850|__AUDIT_ARCH_LE)
+#define AUDIT_ARCH_X86_64 (EM_X86_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
+
+#define AUDIT_PERM_EXEC 1
+#define AUDIT_PERM_WRITE 2
+#define AUDIT_PERM_READ 4
+#define AUDIT_PERM_ATTR 8
+
+struct audit_status {
+ __u32 mask; /* Bit mask for valid entries */
+ __u32 enabled; /* 1 = enabled, 0 = disabled */
+ __u32 failure; /* Failure-to-log action */
+ __u32 pid; /* pid of auditd process */
+ __u32 rate_limit; /* messages rate limit (per second) */
+ __u32 backlog_limit; /* waiting messages limit */
+ __u32 lost; /* messages lost */
+ __u32 backlog; /* messages waiting in queue */
+};
+
+struct audit_tty_status {
+ __u32 enabled; /* 1 = enabled, 0 = disabled */
+};
+
+/* audit_rule_data supports filter rules with both integer and string
+ * fields. It corresponds with AUDIT_ADD_RULE, AUDIT_DEL_RULE and
+ * AUDIT_LIST_RULES requests.
+ */
+struct audit_rule_data {
+ __u32 flags; /* AUDIT_PER_{TASK,CALL}, AUDIT_PREPEND */
+ __u32 action; /* AUDIT_NEVER, AUDIT_POSSIBLE, AUDIT_ALWAYS */
+ __u32 field_count;
+ __u32 mask[AUDIT_BITMASK_SIZE]; /* syscall(s) affected */
+ __u32 fields[AUDIT_MAX_FIELDS];
+ __u32 values[AUDIT_MAX_FIELDS];
+ __u32 fieldflags[AUDIT_MAX_FIELDS];
+ __u32 buflen; /* total length of string fields */
+ char buf[0]; /* string fields buffer */
+};
+
+/* audit_rule is supported to maintain backward compatibility with
+ * userspace. It supports integer fields only and corresponds to
+ * AUDIT_ADD, AUDIT_DEL and AUDIT_LIST requests.
+ */
+struct audit_rule { /* for AUDIT_LIST, AUDIT_ADD, and AUDIT_DEL */
+ __u32 flags; /* AUDIT_PER_{TASK,CALL}, AUDIT_PREPEND */
+ __u32 action; /* AUDIT_NEVER, AUDIT_POSSIBLE, AUDIT_ALWAYS */
+ __u32 field_count;
+ __u32 mask[AUDIT_BITMASK_SIZE];
+ __u32 fields[AUDIT_MAX_FIELDS];
+ __u32 values[AUDIT_MAX_FIELDS];
+};
+
+#endif
diff --git a/sysroot/usr/include/linux/auto_fs.h b/sysroot/usr/include/linux/auto_fs.h
new file mode 100644
index 0000000..d911207
--- /dev/null
+++ b/sysroot/usr/include/linux/auto_fs.h
@@ -0,0 +1,79 @@
+/* -*- linux-c -*- ------------------------------------------------------- *
+ *
+ * linux/include/linux/auto_fs.h
+ *
+ * Copyright 1997 Transmeta Corporation - All Rights Reserved
+ *
+ * This file is part of the Linux kernel and is made available under
+ * the terms of the GNU General Public License, version 2, or at your
+ * option, any later version, incorporated herein by reference.
+ *
+ * ----------------------------------------------------------------------- */
+
+
+#ifndef _LINUX_AUTO_FS_H
+#define _LINUX_AUTO_FS_H
+
+
+#include <linux/ioctl.h>
+
+/* This file describes autofs v3 */
+#define AUTOFS_PROTO_VERSION 3
+
+/* Range of protocol versions defined */
+#define AUTOFS_MAX_PROTO_VERSION AUTOFS_PROTO_VERSION
+#define AUTOFS_MIN_PROTO_VERSION AUTOFS_PROTO_VERSION
+
+/*
+ * Architectures where both 32- and 64-bit binaries can be executed
+ * on 64-bit kernels need this. This keeps the structure format
+ * uniform, and makes sure the wait_queue_token isn't too big to be
+ * passed back down to the kernel.
+ *
+ * This assumes that on these architectures:
+ * mode 32 bit 64 bit
+ * -------------------------
+ * int 32 bit 32 bit
+ * long 32 bit 64 bit
+ *
+ * If so, 32-bit user-space code should be backwards compatible.
+ */
+
+#if defined(__sparc__) || defined(__mips__) || defined(__x86_64__) \
+ || defined(__powerpc__) || defined(__s390__)
+typedef unsigned int autofs_wqt_t;
+#else
+typedef unsigned long autofs_wqt_t;
+#endif
+
+/* Packet types */
+#define autofs_ptype_missing 0 /* Missing entry (mount request) */
+#define autofs_ptype_expire 1 /* Expire entry (umount request) */
+
+struct autofs_packet_hdr {
+ int proto_version; /* Protocol version */
+ int type; /* Type of packet */
+};
+
+struct autofs_packet_missing {
+ struct autofs_packet_hdr hdr;
+ autofs_wqt_t wait_queue_token;
+ int len;
+ char name[NAME_MAX+1];
+};
+
+/* v3 expire (via ioctl) */
+struct autofs_packet_expire {
+ struct autofs_packet_hdr hdr;
+ int len;
+ char name[NAME_MAX+1];
+};
+
+#define AUTOFS_IOC_READY _IO(0x93,0x60)
+#define AUTOFS_IOC_FAIL _IO(0x93,0x61)
+#define AUTOFS_IOC_CATATONIC _IO(0x93,0x62)
+#define AUTOFS_IOC_PROTOVER _IOR(0x93,0x63,int)
+#define AUTOFS_IOC_SETTIMEOUT _IOWR(0x93,0x64,unsigned long)
+#define AUTOFS_IOC_EXPIRE _IOR(0x93,0x65,struct autofs_packet_expire)
+
+#endif /* _LINUX_AUTO_FS_H */
diff --git a/sysroot/usr/include/linux/auto_fs4.h b/sysroot/usr/include/linux/auto_fs4.h
new file mode 100644
index 0000000..31a2954
--- /dev/null
+++ b/sysroot/usr/include/linux/auto_fs4.h
@@ -0,0 +1,106 @@
+/* -*- c -*-
+ * linux/include/linux/auto_fs4.h
+ *
+ * Copyright 1999-2000 Jeremy Fitzhardinge <jeremy@goop.org>
+ *
+ * This file is part of the Linux kernel and is made available under
+ * the terms of the GNU General Public License, version 2, or at your
+ * option, any later version, incorporated herein by reference.
+ */
+
+#ifndef _LINUX_AUTO_FS4_H
+#define _LINUX_AUTO_FS4_H
+
+/* Include common v3 definitions */
+#include <linux/auto_fs.h>
+
+/* autofs v4 definitions */
+#undef AUTOFS_PROTO_VERSION
+#undef AUTOFS_MIN_PROTO_VERSION
+#undef AUTOFS_MAX_PROTO_VERSION
+
+#define AUTOFS_PROTO_VERSION 5
+#define AUTOFS_MIN_PROTO_VERSION 3
+#define AUTOFS_MAX_PROTO_VERSION 5
+
+#define AUTOFS_PROTO_SUBVERSION 0
+
+/* Mask for expire behaviour */
+#define AUTOFS_EXP_IMMEDIATE 1
+#define AUTOFS_EXP_LEAVES 2
+
+/* Daemon notification packet types */
+enum autofs_notify {
+ NFY_NONE,
+ NFY_MOUNT,
+ NFY_EXPIRE
+};
+
+/* Kernel protocol version 4 packet types */
+
+/* Expire entry (umount request) */
+#define autofs_ptype_expire_multi 2
+
+/* Kernel protocol version 5 packet types */
+
+/* Indirect mount missing and expire requests. */
+#define autofs_ptype_missing_indirect 3
+#define autofs_ptype_expire_indirect 4
+
+/* Direct mount missing and expire requests */
+#define autofs_ptype_missing_direct 5
+#define autofs_ptype_expire_direct 6
+
+/* v4 multi expire (via pipe) */
+struct autofs_packet_expire_multi {
+ struct autofs_packet_hdr hdr;
+ autofs_wqt_t wait_queue_token;
+ int len;
+ char name[NAME_MAX+1];
+};
+
+union autofs_packet_union {
+ struct autofs_packet_hdr hdr;
+ struct autofs_packet_missing missing;
+ struct autofs_packet_expire expire;
+ struct autofs_packet_expire_multi expire_multi;
+};
+
+/* autofs v5 common packet struct */
+struct autofs_v5_packet {
+ struct autofs_packet_hdr hdr;
+ autofs_wqt_t wait_queue_token;
+ __u32 dev;
+ __u64 ino;
+ __u32 uid;
+ __u32 gid;
+ __u32 pid;
+ __u32 tgid;
+ __u32 len;
+ char name[NAME_MAX+1];
+};
+
+typedef struct autofs_v5_packet autofs_packet_missing_indirect_t;
+typedef struct autofs_v5_packet autofs_packet_expire_indirect_t;
+typedef struct autofs_v5_packet autofs_packet_missing_direct_t;
+typedef struct autofs_v5_packet autofs_packet_expire_direct_t;
+
+union autofs_v5_packet_union {
+ struct autofs_packet_hdr hdr;
+ struct autofs_v5_packet v5_packet;
+ autofs_packet_missing_indirect_t missing_indirect;
+ autofs_packet_expire_indirect_t expire_indirect;
+ autofs_packet_missing_direct_t missing_direct;
+ autofs_packet_expire_direct_t expire_direct;
+};
+
+#define AUTOFS_IOC_EXPIRE_MULTI _IOW(0x93,0x66,int)
+#define AUTOFS_IOC_EXPIRE_INDIRECT AUTOFS_IOC_EXPIRE_MULTI
+#define AUTOFS_IOC_EXPIRE_DIRECT AUTOFS_IOC_EXPIRE_MULTI
+#define AUTOFS_IOC_PROTOSUBVER _IOR(0x93,0x67,int)
+#define AUTOFS_IOC_ASKREGHOST _IOR(0x93,0x68,int)
+#define AUTOFS_IOC_TOGGLEREGHOST _IOR(0x93,0x69,int)
+#define AUTOFS_IOC_ASKUMOUNT _IOR(0x93,0x70,int)
+
+
+#endif /* _LINUX_AUTO_FS4_H */
diff --git a/sysroot/usr/include/linux/auxvec.h b/sysroot/usr/include/linux/auxvec.h
new file mode 100644
index 0000000..ad89545
--- /dev/null
+++ b/sysroot/usr/include/linux/auxvec.h
@@ -0,0 +1,33 @@
+#ifndef _LINUX_AUXVEC_H
+#define _LINUX_AUXVEC_H
+
+#include <asm/auxvec.h>
+
+/* Symbolic values for the entries in the auxiliary table
+ put on the initial stack */
+#define AT_NULL 0 /* end of vector */
+#define AT_IGNORE 1 /* entry should be ignored */
+#define AT_EXECFD 2 /* file descriptor of program */
+#define AT_PHDR 3 /* program headers for program */
+#define AT_PHENT 4 /* size of program header entry */
+#define AT_PHNUM 5 /* number of program headers */
+#define AT_PAGESZ 6 /* system page size */
+#define AT_BASE 7 /* base address of interpreter */
+#define AT_FLAGS 8 /* flags */
+#define AT_ENTRY 9 /* entry point of program */
+#define AT_NOTELF 10 /* program is not ELF */
+#define AT_UID 11 /* real uid */
+#define AT_EUID 12 /* effective uid */
+#define AT_GID 13 /* real gid */
+#define AT_EGID 14 /* effective gid */
+#define AT_PLATFORM 15 /* string identifying CPU for optimizations */
+#define AT_HWCAP 16 /* arch dependent hints at CPU capabilities */
+#define AT_CLKTCK 17 /* frequency at which times() increments */
+
+#define AT_SECURE 23 /* secure mode boolean */
+
+#ifdef __KERNEL__
+#define AT_VECTOR_SIZE_BASE (14 + 2) /* NEW_AUX_ENT entries in auxiliary table */
+#endif
+
+#endif /* _LINUX_AUXVEC_H */
diff --git a/sysroot/usr/include/linux/ax25.h b/sysroot/usr/include/linux/ax25.h
new file mode 100644
index 0000000..56c11f0
--- /dev/null
+++ b/sysroot/usr/include/linux/ax25.h
@@ -0,0 +1,116 @@
+/*
+ * These are the public elements of the Linux kernel AX.25 code. A similar
+ * file netrom.h exists for the NET/ROM protocol.
+ */
+
+#ifndef AX25_KERNEL_H
+#define AX25_KERNEL_H
+
+#include <linux/socket.h>
+
+#define AX25_MTU 256
+#define AX25_MAX_DIGIS 8
+
+#define AX25_WINDOW 1
+#define AX25_T1 2
+#define AX25_N2 3
+#define AX25_T3 4
+#define AX25_T2 5
+#define AX25_BACKOFF 6
+#define AX25_EXTSEQ 7
+#define AX25_PIDINCL 8
+#define AX25_IDLE 9
+#define AX25_PACLEN 10
+#define AX25_IAMDIGI 12
+
+#define AX25_KILL 99
+
+#define SIOCAX25GETUID (SIOCPROTOPRIVATE+0)
+#define SIOCAX25ADDUID (SIOCPROTOPRIVATE+1)
+#define SIOCAX25DELUID (SIOCPROTOPRIVATE+2)
+#define SIOCAX25NOUID (SIOCPROTOPRIVATE+3)
+#define SIOCAX25OPTRT (SIOCPROTOPRIVATE+7)
+#define SIOCAX25CTLCON (SIOCPROTOPRIVATE+8)
+#define SIOCAX25GETINFOOLD (SIOCPROTOPRIVATE+9)
+#define SIOCAX25ADDFWD (SIOCPROTOPRIVATE+10)
+#define SIOCAX25DELFWD (SIOCPROTOPRIVATE+11)
+#define SIOCAX25DEVCTL (SIOCPROTOPRIVATE+12)
+#define SIOCAX25GETINFO (SIOCPROTOPRIVATE+13)
+
+#define AX25_SET_RT_IPMODE 2
+
+#define AX25_NOUID_DEFAULT 0
+#define AX25_NOUID_BLOCK 1
+
+typedef struct {
+ char ax25_call[7]; /* 6 call + SSID (shifted ascii!) */
+} ax25_address;
+
+struct sockaddr_ax25 {
+ sa_family_t sax25_family;
+ ax25_address sax25_call;
+ int sax25_ndigis;
+ /* Digipeater ax25_address sets follow */
+};
+
+#define sax25_uid sax25_ndigis
+
+struct full_sockaddr_ax25 {
+ struct sockaddr_ax25 fsa_ax25;
+ ax25_address fsa_digipeater[AX25_MAX_DIGIS];
+};
+
+struct ax25_routes_struct {
+ ax25_address port_addr;
+ ax25_address dest_addr;
+ unsigned char digi_count;
+ ax25_address digi_addr[AX25_MAX_DIGIS];
+};
+
+struct ax25_route_opt_struct {
+ ax25_address port_addr;
+ ax25_address dest_addr;
+ int cmd;
+ int arg;
+};
+
+struct ax25_ctl_struct {
+ ax25_address port_addr;
+ ax25_address source_addr;
+ ax25_address dest_addr;
+ unsigned int cmd;
+ unsigned long arg;
+ unsigned char digi_count;
+ ax25_address digi_addr[AX25_MAX_DIGIS];
+};
+
+/* this will go away. Please do not export to user land */
+struct ax25_info_struct_deprecated {
+ unsigned int n2, n2count;
+ unsigned int t1, t1timer;
+ unsigned int t2, t2timer;
+ unsigned int t3, t3timer;
+ unsigned int idle, idletimer;
+ unsigned int state;
+ unsigned int rcv_q, snd_q;
+};
+
+struct ax25_info_struct {
+ unsigned int n2, n2count;
+ unsigned int t1, t1timer;
+ unsigned int t2, t2timer;
+ unsigned int t3, t3timer;
+ unsigned int idle, idletimer;
+ unsigned int state;
+ unsigned int rcv_q, snd_q;
+ unsigned int vs, vr, va, vs_max;
+ unsigned int paclen;
+ unsigned int window;
+};
+
+struct ax25_fwd_struct {
+ ax25_address port_from;
+ ax25_address port_to;
+};
+
+#endif
diff --git a/sysroot/usr/include/linux/b1lli.h b/sysroot/usr/include/linux/b1lli.h
new file mode 100644
index 0000000..713f712
--- /dev/null
+++ b/sysroot/usr/include/linux/b1lli.h
@@ -0,0 +1,73 @@
+/* $Id: b1lli.h,v 1.8.8.3 2001/09/23 22:25:05 kai Exp $
+ *
+ * ISDN lowlevel-module for AVM B1-card.
+ *
+ * Copyright 1996 by Carsten Paeth (calle@calle.in-berlin.de)
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
+ */
+
+#ifndef _B1LLI_H_
+#define _B1LLI_H_
+/*
+ * struct for loading t4 file
+ */
+typedef struct avmb1_t4file {
+ int len;
+ unsigned char *data;
+} avmb1_t4file;
+
+typedef struct avmb1_loaddef {
+ int contr;
+ avmb1_t4file t4file;
+} avmb1_loaddef;
+
+typedef struct avmb1_loadandconfigdef {
+ int contr;
+ avmb1_t4file t4file;
+ avmb1_t4file t4config;
+} avmb1_loadandconfigdef;
+
+typedef struct avmb1_resetdef {
+ int contr;
+} avmb1_resetdef;
+
+typedef struct avmb1_getdef {
+ int contr;
+ int cardtype;
+ int cardstate;
+} avmb1_getdef;
+
+/*
+ * struct for adding new cards
+ */
+typedef struct avmb1_carddef {
+ int port;
+ int irq;
+} avmb1_carddef;
+
+#define AVM_CARDTYPE_B1 0
+#define AVM_CARDTYPE_T1 1
+#define AVM_CARDTYPE_M1 2
+#define AVM_CARDTYPE_M2 3
+
+typedef struct avmb1_extcarddef {
+ int port;
+ int irq;
+ int cardtype;
+ int cardnr; /* for HEMA/T1 */
+} avmb1_extcarddef;
+
+#define AVMB1_LOAD 0 /* load image to card */
+#define AVMB1_ADDCARD 1 /* add a new card - OBSOLETE */
+#define AVMB1_RESETCARD 2 /* reset a card */
+#define AVMB1_LOAD_AND_CONFIG 3 /* load image and config to card */
+#define AVMB1_ADDCARD_WITH_TYPE 4 /* add a new card, with cardtype */
+#define AVMB1_GET_CARDINFO 5 /* get cardtype */
+#define AVMB1_REMOVECARD 6 /* remove a card - OBSOLETE */
+
+#define AVMB1_REGISTERCARD_IS_OBSOLETE
+
+#endif /* _B1LLI_H_ */
diff --git a/sysroot/usr/include/linux/baycom.h b/sysroot/usr/include/linux/baycom.h
new file mode 100644
index 0000000..81249e0
--- /dev/null
+++ b/sysroot/usr/include/linux/baycom.h
@@ -0,0 +1,39 @@
+/*
+ * The Linux BAYCOM driver for the Baycom serial 1200 baud modem
+ * and the parallel 9600 baud modem
+ * (C) 1997-1998 by Thomas Sailer, HB9JNX/AE4WA
+ */
+
+#ifndef _BAYCOM_H
+#define _BAYCOM_H
+
+/* -------------------------------------------------------------------- */
+/*
+ * structs for the IOCTL commands
+ */
+
+struct baycom_debug_data {
+ unsigned long debug1;
+ unsigned long debug2;
+ long debug3;
+};
+
+struct baycom_ioctl {
+ int cmd;
+ union {
+ struct baycom_debug_data dbg;
+ } data;
+};
+
+/* -------------------------------------------------------------------- */
+
+/*
+ * ioctl values change for baycom
+ */
+#define BAYCOMCTL_GETDEBUG 0x92
+
+/* -------------------------------------------------------------------- */
+
+#endif /* _BAYCOM_H */
+
+/* --------------------------------------------------------------------- */
diff --git a/sysroot/usr/include/linux/bfs_fs.h b/sysroot/usr/include/linux/bfs_fs.h
new file mode 100644
index 0000000..8ed6dfd
--- /dev/null
+++ b/sysroot/usr/include/linux/bfs_fs.h
@@ -0,0 +1,80 @@
+/*
+ * include/linux/bfs_fs.h - BFS data structures on disk.
+ * Copyright (C) 1999 Tigran Aivazian <tigran@veritas.com>
+ */
+
+#ifndef _LINUX_BFS_FS_H
+#define _LINUX_BFS_FS_H
+
+#define BFS_BSIZE_BITS 9
+#define BFS_BSIZE (1<<BFS_BSIZE_BITS)
+
+#define BFS_MAGIC 0x1BADFACE
+#define BFS_ROOT_INO 2
+#define BFS_INODES_PER_BLOCK 8
+
+/* SVR4 vnode type values (bfs_inode->i_vtype) */
+#define BFS_VDIR 2L
+#define BFS_VREG 1L
+
+
+/* BFS inode layout on disk */
+struct bfs_inode {
+ __le16 i_ino;
+ __u16 i_unused;
+ __le32 i_sblock;
+ __le32 i_eblock;
+ __le32 i_eoffset;
+ __le32 i_vtype;
+ __le32 i_mode;
+ __le32 i_uid;
+ __le32 i_gid;
+ __le32 i_nlink;
+ __le32 i_atime;
+ __le32 i_mtime;
+ __le32 i_ctime;
+ __u32 i_padding[4];
+};
+
+#define BFS_NAMELEN 14
+#define BFS_DIRENT_SIZE 16
+#define BFS_DIRS_PER_BLOCK 32
+
+struct bfs_dirent {
+ __le16 ino;
+ char name[BFS_NAMELEN];
+};
+
+/* BFS superblock layout on disk */
+struct bfs_super_block {
+ __le32 s_magic;
+ __le32 s_start;
+ __le32 s_end;
+ __le32 s_from;
+ __le32 s_to;
+ __s32 s_bfrom;
+ __s32 s_bto;
+ char s_fsname[6];
+ char s_volume[6];
+ __u32 s_padding[118];
+};
+
+
+#define BFS_OFF2INO(offset) \
+ ((((offset) - BFS_BSIZE) / sizeof(struct bfs_inode)) + BFS_ROOT_INO)
+
+#define BFS_INO2OFF(ino) \
+ ((__u32)(((ino) - BFS_ROOT_INO) * sizeof(struct bfs_inode)) + BFS_BSIZE)
+#define BFS_NZFILESIZE(ip) \
+ ((le32_to_cpu((ip)->i_eoffset) + 1) - le32_to_cpu((ip)->i_sblock) * BFS_BSIZE)
+
+#define BFS_FILESIZE(ip) \
+ ((ip)->i_sblock == 0 ? 0 : BFS_NZFILESIZE(ip))
+
+#define BFS_FILEBLOCKS(ip) \
+ ((ip)->i_sblock == 0 ? 0 : (le32_to_cpu((ip)->i_eblock) + 1) - le32_to_cpu((ip)->i_sblock))
+#define BFS_UNCLEAN(bfs_sb, sb) \
+ ((le32_to_cpu(bfs_sb->s_from) != -1) && (le32_to_cpu(bfs_sb->s_to) != -1) && !(sb->s_flags & MS_RDONLY))
+
+
+#endif /* _LINUX_BFS_FS_H */
diff --git a/sysroot/usr/include/linux/binfmts.h b/sysroot/usr/include/linux/binfmts.h
new file mode 100644
index 0000000..6416794
--- /dev/null
+++ b/sysroot/usr/include/linux/binfmts.h
@@ -0,0 +1,20 @@
+#ifndef _LINUX_BINFMTS_H
+#define _LINUX_BINFMTS_H
+
+#include <linux/capability.h>
+
+struct pt_regs;
+
+/*
+ * These are the maximum length and maximum number of strings passed to the
+ * execve() system call. MAX_ARG_STRLEN is essentially random but serves to
+ * prevent the kernel from being unduly impacted by misaddressed pointers.
+ * MAX_ARG_STRINGS is chosen to fit in a signed 32-bit integer.
+ */
+#define MAX_ARG_STRLEN (PAGE_SIZE * 32)
+#define MAX_ARG_STRINGS 0x7FFFFFFF
+
+/* sizeof(linux_binprm->buf) */
+#define BINPRM_BUF_SIZE 128
+
+#endif /* _LINUX_BINFMTS_H */
diff --git a/sysroot/usr/include/linux/blkpg.h b/sysroot/usr/include/linux/blkpg.h
new file mode 100644
index 0000000..15b61f7
--- /dev/null
+++ b/sysroot/usr/include/linux/blkpg.h
@@ -0,0 +1,57 @@
+#ifndef _LINUX_BLKPG_H
+#define _LINUX_BLKPG_H
+
+/*
+ * Partition table and disk geometry handling
+ *
+ * A single ioctl with lots of subfunctions:
+ *
+ * Device number stuff:
+ * get_whole_disk() (given the device number of a partition,
+ * find the device number of the encompassing disk)
+ * get_all_partitions() (given the device number of a disk, return the
+ * device numbers of all its known partitions)
+ *
+ * Partition stuff:
+ * add_partition()
+ * delete_partition()
+ * test_partition_in_use() (also for test_disk_in_use)
+ *
+ * Geometry stuff:
+ * get_geometry()
+ * set_geometry()
+ * get_bios_drivedata()
+ *
+ * For today, only the partition stuff - aeb, 990515
+ */
+#include <linux/ioctl.h>
+
+#define BLKPG _IO(0x12,105)
+
+/* The argument structure */
+struct blkpg_ioctl_arg {
+ int op;
+ int flags;
+ int datalen;
+ void *data;
+};
+
+/* The subfunctions (for the op field) */
+#define BLKPG_ADD_PARTITION 1
+#define BLKPG_DEL_PARTITION 2
+
+/* Sizes of name fields. Unused at present. */
+#define BLKPG_DEVNAMELTH 64
+#define BLKPG_VOLNAMELTH 64
+
+/* The data structure for ADD_PARTITION and DEL_PARTITION */
+struct blkpg_partition {
+ long long start; /* starting offset in bytes */
+ long long length; /* length in bytes */
+ int pno; /* partition number */
+ char devname[BLKPG_DEVNAMELTH]; /* partition name, like sda5 or c0d1p2,
+ to be used in kernel messages */
+ char volname[BLKPG_VOLNAMELTH]; /* volume label */
+};
+
+#endif /* _LINUX_BLKPG_H */
diff --git a/sysroot/usr/include/linux/bpqether.h b/sysroot/usr/include/linux/bpqether.h
new file mode 100644
index 0000000..a6c35e1
--- /dev/null
+++ b/sysroot/usr/include/linux/bpqether.h
@@ -0,0 +1,41 @@
+#ifndef __BPQETHER_H
+#define __BPQETHER_H
+
+/*
+ * Defines for the BPQETHER pseudo device driver
+ */
+
+#ifndef __LINUX_IF_ETHER_H
+#include <linux/if_ether.h>
+#endif
+
+#define SIOCSBPQETHOPT (SIOCDEVPRIVATE+0) /* reserved */
+#define SIOCSBPQETHADDR (SIOCDEVPRIVATE+1)
+
+struct bpq_ethaddr {
+ unsigned char destination[ETH_ALEN];
+ unsigned char accept[ETH_ALEN];
+};
+
+/*
+ * For SIOCSBPQETHOPT - this is compatible with PI2/PacketTwin card drivers,
+ * currently not implemented, though. If someone wants to hook a radio
+ * to his Ethernet card he may find this useful. ;-)
+ */
+
+#define SIOCGBPQETHPARAM 0x5000 /* get Level 1 parameters */
+#define SIOCSBPQETHPARAM 0x5001 /* set */
+
+struct bpq_req {
+ int cmd;
+ int speed; /* unused */
+ int clockmode; /* unused */
+ int txdelay;
+ unsigned char persist; /* unused */
+ int slotime; /* unused */
+ int squeldelay;
+ int dmachan; /* unused */
+ int irq; /* unused */
+};
+
+#endif
diff --git a/sysroot/usr/include/linux/byteorder/big_endian.h b/sysroot/usr/include/linux/byteorder/big_endian.h
new file mode 100644
index 0000000..2f21368
--- /dev/null
+++ b/sysroot/usr/include/linux/byteorder/big_endian.h
@@ -0,0 +1,106 @@
+#ifndef _LINUX_BYTEORDER_BIG_ENDIAN_H
+#define _LINUX_BYTEORDER_BIG_ENDIAN_H
+
+#ifndef __BIG_ENDIAN
+#define __BIG_ENDIAN 4321
+#endif
+#ifndef __BIG_ENDIAN_BITFIELD
+#define __BIG_ENDIAN_BITFIELD
+#endif
+
+#include <linux/types.h>
+#include <linux/byteorder/swab.h>
+
+#define __constant_htonl(x) ( (__be32)(__u32)(x))
+#define __constant_ntohl(x) ( (__u32)(__be32)(x))
+#define __constant_htons(x) ( (__be16)(__u16)(x))
+#define __constant_ntohs(x) ( (__u16)(__be16)(x))
+#define __constant_cpu_to_le64(x) ( (__le64)___constant_swab64((x)))
+#define __constant_le64_to_cpu(x) ___constant_swab64( (__u64)(__le64)(x))
+#define __constant_cpu_to_le32(x) ( (__le32)___constant_swab32((x)))
+#define __constant_le32_to_cpu(x) ___constant_swab32( (__u32)(__le32)(x))
+#define __constant_cpu_to_le16(x) ( (__le16)___constant_swab16((x)))
+#define __constant_le16_to_cpu(x) ___constant_swab16( (__u16)(__le16)(x))
+#define __constant_cpu_to_be64(x) ( (__be64)(__u64)(x))
+#define __constant_be64_to_cpu(x) ( (__u64)(__be64)(x))
+#define __constant_cpu_to_be32(x) ( (__be32)(__u32)(x))
+#define __constant_be32_to_cpu(x) ( (__u32)(__be32)(x))
+#define __constant_cpu_to_be16(x) ( (__be16)(__u16)(x))
+#define __constant_be16_to_cpu(x) ( (__u16)(__be16)(x))
+#define __cpu_to_le64(x) ( (__le64)__swab64((x)))
+#define __le64_to_cpu(x) __swab64( (__u64)(__le64)(x))
+#define __cpu_to_le32(x) ( (__le32)__swab32((x)))
+#define __le32_to_cpu(x) __swab32( (__u32)(__le32)(x))
+#define __cpu_to_le16(x) ( (__le16)__swab16((x)))
+#define __le16_to_cpu(x) __swab16( (__u16)(__le16)(x))
+#define __cpu_to_be64(x) ( (__be64)(__u64)(x))
+#define __be64_to_cpu(x) ( (__u64)(__be64)(x))
+#define __cpu_to_be32(x) ( (__be32)(__u32)(x))
+#define __be32_to_cpu(x) ( (__u32)(__be32)(x))
+#define __cpu_to_be16(x) ( (__be16)(__u16)(x))
+#define __be16_to_cpu(x) ( (__u16)(__be16)(x))
+
+static __inline__ __le64 __cpu_to_le64p(const __u64 *p)
+{
+ return (__le64)__swab64p(p);
+}
+static __inline__ __u64 __le64_to_cpup(const __le64 *p)
+{
+ return __swab64p((__u64 *)p);
+}
+static __inline__ __le32 __cpu_to_le32p(const __u32 *p)
+{
+ return (__le32)__swab32p(p);
+}
+static __inline__ __u32 __le32_to_cpup(const __le32 *p)
+{
+ return __swab32p((__u32 *)p);
+}
+static __inline__ __le16 __cpu_to_le16p(const __u16 *p)
+{
+ return (__le16)__swab16p(p);
+}
+static __inline__ __u16 __le16_to_cpup(const __le16 *p)
+{
+ return __swab16p((__u16 *)p);
+}
+static __inline__ __be64 __cpu_to_be64p(const __u64 *p)
+{
+ return (__be64)*p;
+}
+static __inline__ __u64 __be64_to_cpup(const __be64 *p)
+{
+ return (__u64)*p;
+}
+static __inline__ __be32 __cpu_to_be32p(const __u32 *p)
+{
+ return (__be32)*p;
+}
+static __inline__ __u32 __be32_to_cpup(const __be32 *p)
+{
+ return (__u32)*p;
+}
+static __inline__ __be16 __cpu_to_be16p(const __u16 *p)
+{
+ return (__be16)*p;
+}
+static __inline__ __u16 __be16_to_cpup(const __be16 *p)
+{
+ return (__u16)*p;
+}
+#define __cpu_to_le64s(x) __swab64s((x))
+#define __le64_to_cpus(x) __swab64s((x))
+#define __cpu_to_le32s(x) __swab32s((x))
+#define __le32_to_cpus(x) __swab32s((x))
+#define __cpu_to_le16s(x) __swab16s((x))
+#define __le16_to_cpus(x) __swab16s((x))
+#define __cpu_to_be64s(x) do {} while (0)
+#define __be64_to_cpus(x) do {} while (0)
+#define __cpu_to_be32s(x) do {} while (0)
+#define __be32_to_cpus(x) do {} while (0)
+#define __cpu_to_be16s(x) do {} while (0)
+#define __be16_to_cpus(x) do {} while (0)
+
+#include <linux/byteorder/generic.h>
+
+#endif /* _LINUX_BYTEORDER_BIG_ENDIAN_H */
diff --git a/sysroot/usr/include/linux/byteorder/generic.h b/sysroot/usr/include/linux/byteorder/generic.h
new file mode 100644
index 0000000..fded9bf
--- /dev/null
+++ b/sysroot/usr/include/linux/byteorder/generic.h
@@ -0,0 +1,87 @@
+#ifndef _LINUX_BYTEORDER_GENERIC_H
+#define _LINUX_BYTEORDER_GENERIC_H
+
+/*
+ * linux/byteorder_generic.h
+ * Generic Byte-reordering support
+ *
+ * The "... p" macros, like le64_to_cpup, can be used with pointers
+ * to unaligned data, but there will be a performance penalty on
+ * some architectures. Use get_unaligned for unaligned data.
+ *
+ * Francois-Rene Rideau <fare@tunes.org> 19970707
+ * gathered all the good ideas from all asm-foo/byteorder.h into one file,
+ * cleaned them up.
+ * I hope it is compliant with non-GCC compilers.
+ * I decided to put __BYTEORDER_HAS_U64__ in byteorder.h,
+ * because I wasn't sure it would be ok to put it in types.h
+ * Upgraded it to 2.1.43
+ * Francois-Rene Rideau <fare@tunes.org> 19971012
+ * Upgraded it to 2.1.57
+ * to please Linus T., replaced huge #ifdef's between little/big endian
+ * by nestedly #include'd files.
+ * Francois-Rene Rideau <fare@tunes.org> 19971205
+ * Made it to 2.1.71; now a facelift:
+ * Put files under include/linux/byteorder/
+ * Split swab from generic support.
+ *
+ * TODO:
+ * = Regular kernel maintainers could also replace all these manual
+ * byteswap macros that remain, disseminated among drivers,
+ * after some grep or the sources...
+ * = Linus might want to rename all these macros and files to fit his taste,
+ * to fit his personal naming scheme.
+ * = it seems that a few drivers would also appreciate
+ * nybble swapping support...
+ * = every architecture could add their byteswap macro in asm/byteorder.h
+ * see how some architectures already do (i386, alpha, ppc, etc)
+ * = cpu_to_beXX and beXX_to_cpu might some day need to be well
+ * distinguished throughout the kernel. This is not the case currently,
+ * since little endian, big endian, and pdp endian machines needn't it.
+ * But this might be the case for, say, a port of Linux to 20/21 bit
+ * architectures (and F21 Linux addict around?).
+ */
+
+/*
+ * The following macros are to be defined by <asm/byteorder.h>:
+ *
+ * Conversion of long and short int between network and host format
+ * ntohl(__u32 x)
+ * ntohs(__u16 x)
+ * htonl(__u32 x)
+ * htons(__u16 x)
+ * It seems that some programs (which? where? or perhaps a standard? POSIX?)
+ * might like the above to be functions, not macros (why?).
+ * if that's true, then detect them, and take measures.
+ * Anyway, the measure is: define only ___ntohl as a macro instead,
+ * and in a separate file, have
+ * unsigned long __inline__ ntohl(x){return ___ntohl(x);}
+ *
+ * The same for constant arguments
+ * __constant_ntohl(__u32 x)
+ * __constant_ntohs(__u16 x)
+ * __constant_htonl(__u32 x)
+ * __constant_htons(__u16 x)
+ *
+ * Conversion of XX-bit integers (16- 32- or 64-)
+ * between native CPU format and little/big endian format
+ * 64-bit stuff only defined for proper architectures
+ * cpu_to_[bl]eXX(__uXX x)
+ * [bl]eXX_to_cpu(__uXX x)
+ *
+ * The same, but takes a pointer to the value to convert
+ * cpu_to_[bl]eXXp(__uXX x)
+ * [bl]eXX_to_cpup(__uXX x)
+ *
+ * The same, but change in situ
+ * cpu_to_[bl]eXXs(__uXX x)
+ * [bl]eXX_to_cpus(__uXX x)
+ *
+ * See asm-foo/byteorder.h for examples of how to provide
+ * architecture-optimized versions
+ *
+ */
+
+
+
+#endif /* _LINUX_BYTEORDER_GENERIC_H */
diff --git a/sysroot/usr/include/linux/byteorder/little_endian.h b/sysroot/usr/include/linux/byteorder/little_endian.h
new file mode 100644
index 0000000..49173f0
--- /dev/null
+++ b/sysroot/usr/include/linux/byteorder/little_endian.h
@@ -0,0 +1,106 @@
+#ifndef _LINUX_BYTEORDER_LITTLE_ENDIAN_H
+#define _LINUX_BYTEORDER_LITTLE_ENDIAN_H
+
+#ifndef __LITTLE_ENDIAN
+#define __LITTLE_ENDIAN 1234
+#endif
+#ifndef __LITTLE_ENDIAN_BITFIELD
+#define __LITTLE_ENDIAN_BITFIELD
+#endif
+
+#include <linux/types.h>
+#include <linux/byteorder/swab.h>
+
+#define __constant_htonl(x) ( (__be32)___constant_swab32((x)))
+#define __constant_ntohl(x) ___constant_swab32( (__be32)(x))
+#define __constant_htons(x) ( (__be16)___constant_swab16((x)))
+#define __constant_ntohs(x) ___constant_swab16( (__be16)(x))
+#define __constant_cpu_to_le64(x) ( (__le64)(__u64)(x))
+#define __constant_le64_to_cpu(x) ( (__u64)(__le64)(x))
+#define __constant_cpu_to_le32(x) ( (__le32)(__u32)(x))
+#define __constant_le32_to_cpu(x) ( (__u32)(__le32)(x))
+#define __constant_cpu_to_le16(x) ( (__le16)(__u16)(x))
+#define __constant_le16_to_cpu(x) ( (__u16)(__le16)(x))
+#define __constant_cpu_to_be64(x) ( (__be64)___constant_swab64((x)))
+#define __constant_be64_to_cpu(x) ___constant_swab64( (__u64)(__be64)(x))
+#define __constant_cpu_to_be32(x) ( (__be32)___constant_swab32((x)))
+#define __constant_be32_to_cpu(x) ___constant_swab32( (__u32)(__be32)(x))
+#define __constant_cpu_to_be16(x) ( (__be16)___constant_swab16((x)))
+#define __constant_be16_to_cpu(x) ___constant_swab16( (__u16)(__be16)(x))
+#define __cpu_to_le64(x) ( (__le64)(__u64)(x))
+#define __le64_to_cpu(x) ( (__u64)(__le64)(x))
+#define __cpu_to_le32(x) ( (__le32)(__u32)(x))
+#define __le32_to_cpu(x) ( (__u32)(__le32)(x))
+#define __cpu_to_le16(x) ( (__le16)(__u16)(x))
+#define __le16_to_cpu(x) ( (__u16)(__le16)(x))
+#define __cpu_to_be64(x) ( (__be64)__swab64((x)))
+#define __be64_to_cpu(x) __swab64( (__u64)(__be64)(x))
+#define __cpu_to_be32(x) ( (__be32)__swab32((x)))
+#define __be32_to_cpu(x) __swab32( (__u32)(__be32)(x))
+#define __cpu_to_be16(x) ( (__be16)__swab16((x)))
+#define __be16_to_cpu(x) __swab16( (__u16)(__be16)(x))
+
+static __inline__ __le64 __cpu_to_le64p(const __u64 *p)
+{
+ return (__le64)*p;
+}
+static __inline__ __u64 __le64_to_cpup(const __le64 *p)
+{
+ return (__u64)*p;
+}
+static __inline__ __le32 __cpu_to_le32p(const __u32 *p)
+{
+ return (__le32)*p;
+}
+static __inline__ __u32 __le32_to_cpup(const __le32 *p)
+{
+ return (__u32)*p;
+}
+static __inline__ __le16 __cpu_to_le16p(const __u16 *p)
+{
+ return (__le16)*p;
+}
+static __inline__ __u16 __le16_to_cpup(const __le16 *p)
+{
+ return (__u16)*p;
+}
+static __inline__ __be64 __cpu_to_be64p(const __u64 *p)
+{
+ return (__be64)__swab64p(p);
+}
+static __inline__ __u64 __be64_to_cpup(const __be64 *p)
+{
+ return __swab64p((__u64 *)p);
+}
+static __inline__ __be32 __cpu_to_be32p(const __u32 *p)
+{
+ return (__be32)__swab32p(p);
+}
+static __inline__ __u32 __be32_to_cpup(const __be32 *p)
+{
+ return __swab32p((__u32 *)p);
+}
+static __inline__ __be16 __cpu_to_be16p(const __u16 *p)
+{
+ return (__be16)__swab16p(p);
+}
+static __inline__ __u16 __be16_to_cpup(const __be16 *p)
+{
+ return __swab16p((__u16 *)p);
+}
+#define __cpu_to_le64s(x) do {} while (0)
+#define __le64_to_cpus(x) do {} while (0)
+#define __cpu_to_le32s(x) do {} while (0)
+#define __le32_to_cpus(x) do {} while (0)
+#define __cpu_to_le16s(x) do {} while (0)
+#define __le16_to_cpus(x) do {} while (0)
+#define __cpu_to_be64s(x) __swab64s((x))
+#define __be64_to_cpus(x) __swab64s((x))
+#define __cpu_to_be32s(x) __swab32s((x))
+#define __be32_to_cpus(x) __swab32s((x))
+#define __cpu_to_be16s(x) __swab16s((x))
+#define __be16_to_cpus(x) __swab16s((x))
+
+#include <linux/byteorder/generic.h>
+
+#endif /* _LINUX_BYTEORDER_LITTLE_ENDIAN_H */
diff --git a/sysroot/usr/include/linux/byteorder/swab.h b/sysroot/usr/include/linux/byteorder/swab.h
new file mode 100644
index 0000000..82af914
--- /dev/null
+++ b/sysroot/usr/include/linux/byteorder/swab.h
@@ -0,0 +1,210 @@
+#ifndef _LINUX_BYTEORDER_SWAB_H
+#define _LINUX_BYTEORDER_SWAB_H
+
+/*
+ * linux/byteorder/swab.h
+ * Byte-swapping, independently from CPU endianness
+ * swabXX[ps]?(foo)
+ *
+ * Francois-Rene Rideau <fare@tunes.org> 19971205
+ * separated swab functions from cpu_to_XX,
+ * to clean up support for bizarre-endian architectures.
+ *
+ * Trent Piepho <xyzzy@speakeasy.org> 2007114
+ * make constant-folding work, provide C versions that
+ * gcc can optimize better, explain different versions
+ *
+ * See asm-i386/byteorder.h and suches for examples of how to provide
+ * architecture-dependent optimized versions
+ *
+ */
+
+
+/* Functions/macros defined, there are a lot:
+ *
+ * ___swabXX
+ * Generic C versions of the swab functions.
+ *
+ * ___constant_swabXX
+ * C versions that gcc can fold into a compile-time constant when
+ * the argument is a compile-time constant.
+ *
+ * __arch__swabXX[sp]?
+ * Architecture optimized versions of all the swab functions
+ * (including the s and p versions). These can be defined in
+ * asm-arch/byteorder.h. Any which are not, are defined here.
+ * __arch__swabXXs() is defined in terms of __arch__swabXXp(), which
+ * is defined in terms of __arch__swabXX(), which is in turn defined
+ * in terms of ___swabXX(x).
+ * These must be macros. They may be unsafe for arguments with
+ * side-effects.
+ *
+ * __fswabXX
+ * Inline function versions of the __arch__ macros. These _are_ safe
+ * if the arguments have side-effects. Note there are no s and p
+ * versions of these.
+ *
+ * __swabXX[sb]
+ * There are the ones you should actually use. The __swabXX versions
+ * will be a constant given a constant argument and use the arch
+ * specific code (if any) for non-constant arguments. The s and p
+ * versions always use the arch specific code (constant folding
+ * doesn't apply). They are safe to use with arguments with
+ * side-effects.
+ *
+ * swabXX[sb]
+ * Nicknames for __swabXX[sb] to use in the kernel.
+ */
+
+/* casts are necessary for constants, because we never know how for sure
+ * how U/UL/ULL map to __u16, __u32, __u64. At least not in a portable way.
+ */
+
+static __inline__ __u16 ___swab16(__u16 x)
+{
+ return x<<8 | x>>8;
+}
+static __inline__ __u32 ___swab32(__u32 x)
+{
+ return x<<24 | x>>24 |
+ (x & (__u32)0x0000ff00UL)<<8 |
+ (x & (__u32)0x00ff0000UL)>>8;
+}
+static __inline__ __u64 ___swab64(__u64 x)
+{
+ return x<<56 | x>>56 |
+ (x & (__u64)0x000000000000ff00ULL)<<40 |
+ (x & (__u64)0x0000000000ff0000ULL)<<24 |
+ (x & (__u64)0x00000000ff000000ULL)<< 8 |
+ (x & (__u64)0x000000ff00000000ULL)>> 8 |
+ (x & (__u64)0x0000ff0000000000ULL)>>24 |
+ (x & (__u64)0x00ff000000000000ULL)>>40;
+}
+
+#define ___constant_swab16(x) \
+ ((__u16)( \
+ (((__u16)(x) & (__u16)0x00ffU) << 8) | \
+ (((__u16)(x) & (__u16)0xff00U) >> 8) ))
+#define ___constant_swab32(x) \
+ ((__u32)( \
+ (((__u32)(x) & (__u32)0x000000ffUL) << 24) | \
+ (((__u32)(x) & (__u32)0x0000ff00UL) << 8) | \
+ (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
+ (((__u32)(x) & (__u32)0xff000000UL) >> 24) ))
+#define ___constant_swab64(x) \
+ ((__u64)( \
+ (__u64)(((__u64)(x) & (__u64)0x00000000000000ffULL) << 56) | \
+ (__u64)(((__u64)(x) & (__u64)0x000000000000ff00ULL) << 40) | \
+ (__u64)(((__u64)(x) & (__u64)0x0000000000ff0000ULL) << 24) | \
+ (__u64)(((__u64)(x) & (__u64)0x00000000ff000000ULL) << 8) | \
+ (__u64)(((__u64)(x) & (__u64)0x000000ff00000000ULL) >> 8) | \
+ (__u64)(((__u64)(x) & (__u64)0x0000ff0000000000ULL) >> 24) | \
+ (__u64)(((__u64)(x) & (__u64)0x00ff000000000000ULL) >> 40) | \
+ (__u64)(((__u64)(x) & (__u64)0xff00000000000000ULL) >> 56) ))
+
+/*
+ * provide defaults when no architecture-specific optimization is detected
+ */
+#ifndef __arch__swab16
+# define __arch__swab16(x) ___swab16(x)
+#endif
+#ifndef __arch__swab32
+# define __arch__swab32(x) ___swab32(x)
+#endif
+#ifndef __arch__swab64
+# define __arch__swab64(x) ___swab64(x)
+#endif
+
+#ifndef __arch__swab16p
+# define __arch__swab16p(x) __arch__swab16(*(x))
+#endif
+#ifndef __arch__swab32p
+# define __arch__swab32p(x) __arch__swab32(*(x))
+#endif
+#ifndef __arch__swab64p
+# define __arch__swab64p(x) __arch__swab64(*(x))
+#endif
+
+#ifndef __arch__swab16s
+# define __arch__swab16s(x) ((void)(*(x) = __arch__swab16p(x)))
+#endif
+#ifndef __arch__swab32s
+# define __arch__swab32s(x) ((void)(*(x) = __arch__swab32p(x)))
+#endif
+#ifndef __arch__swab64s
+# define __arch__swab64s(x) ((void)(*(x) = __arch__swab64p(x)))
+#endif
+
+
+/*
+ * Allow constant folding
+ */
+#if defined(__GNUC__) && defined(__OPTIMIZE__)
+# define __swab16(x) \
+(__builtin_constant_p((__u16)(x)) ? \
+ ___constant_swab16((x)) : \
+ __fswab16((x)))
+# define __swab32(x) \
+(__builtin_constant_p((__u32)(x)) ? \
+ ___constant_swab32((x)) : \
+ __fswab32((x)))
+# define __swab64(x) \
+(__builtin_constant_p((__u64)(x)) ? \
+ ___constant_swab64((x)) : \
+ __fswab64((x)))
+#else
+# define __swab16(x) __fswab16(x)
+# define __swab32(x) __fswab32(x)
+# define __swab64(x) __fswab64(x)
+#endif /* OPTIMIZE */
+
+
+static __inline__ __u16 __fswab16(__u16 x)
+{
+ return __arch__swab16(x);
+}
+static __inline__ __u16 __swab16p(const __u16 *x)
+{
+ return __arch__swab16p(x);
+}
+static __inline__ void __swab16s(__u16 *addr)
+{
+ __arch__swab16s(addr);
+}
+
+static __inline__ __u32 __fswab32(__u32 x)
+{
+ return __arch__swab32(x);
+}
+static __inline__ __u32 __swab32p(const __u32 *x)
+{
+ return __arch__swab32p(x);
+}
+static __inline__ void __swab32s(__u32 *addr)
+{
+ __arch__swab32s(addr);
+}
+
+#ifdef __BYTEORDER_HAS_U64__
+static __inline__ __u64 __fswab64(__u64 x)
+{
+# ifdef __SWAB_64_THRU_32__
+ __u32 h = x >> 32;
+ __u32 l = x & ((1ULL<<32)-1);
+ return (((__u64)__swab32(l)) << 32) | ((__u64)(__swab32(h)));
+# else
+ return __arch__swab64(x);
+# endif
+}
+static __inline__ __u64 __swab64p(const __u64 *x)
+{
+ return __arch__swab64p(x);
+}
+static __inline__ void __swab64s(__u64 *addr)
+{
+ __arch__swab64s(addr);
+}
+#endif /* __BYTEORDER_HAS_U64__ */
+
+
+#endif /* _LINUX_BYTEORDER_SWAB_H */
diff --git a/sysroot/usr/include/linux/capability.h b/sysroot/usr/include/linux/capability.h
new file mode 100644
index 0000000..6e50fae
--- /dev/null
+++ b/sysroot/usr/include/linux/capability.h
@@ -0,0 +1,290 @@
+/*
+ * This is <linux/capability.h>
+ *
+ * Andrew G. Morgan <morgan@kernel.org>
+ * Alexander Kjeldaas <astor@guardian.no>
+ * with help from Aleph1, Roland Buresund and Andrew Main.
+ *
+ * See here for the libcap library ("POSIX draft" compliance):
+ *
+ * ftp://linux.kernel.org/pub/linux/libs/security/linux-privs/kernel-2.6/
+ */
+
+#ifndef _LINUX_CAPABILITY_H
+#define _LINUX_CAPABILITY_H
+
+#include <linux/types.h>
+
+struct task_struct;
+
+/* User-level do most of the mapping between kernel and user
+ capabilities based on the version tag given by the kernel. The
+ kernel might be somewhat backwards compatible, but don't bet on
+ it. */
+
+/* XXX - Note, cap_t, is defined by POSIX to be an "opaque" pointer to
+ a set of three capability sets. The transposition of 3*the
+ following structure to such a composite is better handled in a user
+ library since the draft standard requires the use of malloc/free
+ etc.. */
+
+#define _LINUX_CAPABILITY_VERSION 0x19980330
+
+typedef struct __user_cap_header_struct {
+ __u32 version;
+ int pid;
+} *cap_user_header_t;
+
+typedef struct __user_cap_data_struct {
+ __u32 effective;
+ __u32 permitted;
+ __u32 inheritable;
+} *cap_user_data_t;
+
+#define XATTR_CAPS_SUFFIX "capability"
+#define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX
+
+#define XATTR_CAPS_SZ (3*sizeof(__le32))
+#define VFS_CAP_REVISION_MASK 0xFF000000
+#define VFS_CAP_REVISION_1 0x01000000
+
+#define VFS_CAP_REVISION VFS_CAP_REVISION_1
+
+#define VFS_CAP_FLAGS_MASK ~VFS_CAP_REVISION_MASK
+#define VFS_CAP_FLAGS_EFFECTIVE 0x000001
+
+struct vfs_cap_data {
+ __u32 magic_etc; /* Little endian */
+ __u32 permitted; /* Little endian */
+ __u32 inheritable; /* Little endian */
+};
+
+
+
+/**
+ ** POSIX-draft defined capabilities.
+ **/
+
+/* In a system with the [_POSIX_CHOWN_RESTRICTED] option defined, this
+ overrides the restriction of changing file ownership and group
+ ownership. */
+
+#define CAP_CHOWN 0
+
+/* Override all DAC access, including ACL execute access if
+ [_POSIX_ACL] is defined. Excluding DAC access covered by
+ CAP_LINUX_IMMUTABLE. */
+
+#define CAP_DAC_OVERRIDE 1
+
+/* Overrides all DAC restrictions regarding read and search on files
+ and directories, including ACL restrictions if [_POSIX_ACL] is
+ defined. Excluding DAC access covered by CAP_LINUX_IMMUTABLE. */
+
+#define CAP_DAC_READ_SEARCH 2
+
+/* Overrides all restrictions about allowed operations on files, where
+ file owner ID must be equal to the user ID, except where CAP_FSETID
+ is applicable. It doesn't override MAC and DAC restrictions. */
+
+#define CAP_FOWNER 3
+
+/* Overrides the following restrictions that the effective user ID
+ shall match the file owner ID when setting the S_ISUID and S_ISGID
+ bits on that file; that the effective group ID (or one of the
+ supplementary group IDs) shall match the file owner ID when setting
+ the S_ISGID bit on that file; that the S_ISUID and S_ISGID bits are
+ cleared on successful return from chown(2) (not implemented). */
+
+#define CAP_FSETID 4
+
+/* Used to decide between falling back on the old suser() or fsuser(). */
+
+#define CAP_FS_MASK 0x1f
+
+/* Overrides the restriction that the real or effective user ID of a
+ process sending a signal must match the real or effective user ID
+ of the process receiving the signal. */
+
+#define CAP_KILL 5
+
+/* Allows setgid(2) manipulation */
+/* Allows setgroups(2) */
+/* Allows forged gids on socket credentials passing. */
+
+#define CAP_SETGID 6
+
+/* Allows set*uid(2) manipulation (including fsuid). */
+/* Allows forged pids on socket credentials passing. */
+
+#define CAP_SETUID 7
+
+
+/**
+ ** Linux-specific capabilities
+ **/
+
+/* Transfer any capability in your permitted set to any pid,
+ remove any capability in your permitted set from any pid */
+
+#define CAP_SETPCAP 8
+
+/* Allow modification of S_IMMUTABLE and S_APPEND file attributes */
+
+#define CAP_LINUX_IMMUTABLE 9
+
+/* Allows binding to TCP/UDP sockets below 1024 */
+/* Allows binding to ATM VCIs below 32 */
+
+#define CAP_NET_BIND_SERVICE 10
+
+/* Allow broadcasting, listen to multicast */
+
+#define CAP_NET_BROADCAST 11
+
+/* Allow interface configuration */
+/* Allow administration of IP firewall, masquerading and accounting */
+/* Allow setting debug option on sockets */
+/* Allow modification of routing tables */
+/* Allow setting arbitrary process / process group ownership on
+ sockets */
+/* Allow binding to any address for transparent proxying */
+/* Allow setting TOS (type of service) */
+/* Allow setting promiscuous mode */
+/* Allow clearing driver statistics */
+/* Allow multicasting */
+/* Allow read/write of device-specific registers */
+/* Allow activation of ATM control sockets */
+
+#define CAP_NET_ADMIN 12
+
+/* Allow use of RAW sockets */
+/* Allow use of PACKET sockets */
+
+#define CAP_NET_RAW 13
+
+/* Allow locking of shared memory segments */
+/* Allow mlock and mlockall (which doesn't really have anything to do
+ with IPC) */
+
+#define CAP_IPC_LOCK 14
+
+/* Override IPC ownership checks */
+
+#define CAP_IPC_OWNER 15
+
+/* Insert and remove kernel modules - modify kernel without limit */
+/* Modify cap_bset */
+#define CAP_SYS_MODULE 16
+
+/* Allow ioperm/iopl access */
+/* Allow sending USB messages to any device via /proc/bus/usb */
+
+#define CAP_SYS_RAWIO 17
+
+/* Allow use of chroot() */
+
+#define CAP_SYS_CHROOT 18
+
+/* Allow ptrace() of any process */
+
+#define CAP_SYS_PTRACE 19
+
+/* Allow configuration of process accounting */
+
+#define CAP_SYS_PACCT 20
+
+/* Allow configuration of the secure attention key */
+/* Allow administration of the random device */
+/* Allow examination and configuration of disk quotas */
+/* Allow configuring the kernel's syslog (printk behaviour) */
+/* Allow setting the domainname */
+/* Allow setting the hostname */
+/* Allow calling bdflush() */
+/* Allow mount() and umount(), setting up new smb connection */
+/* Allow some autofs root ioctls */
+/* Allow nfsservctl */
+/* Allow VM86_REQUEST_IRQ */
+/* Allow to read/write pci config on alpha */
+/* Allow irix_prctl on mips (setstacksize) */
+/* Allow flushing all cache on m68k (sys_cacheflush) */
+/* Allow removing semaphores */
+/* Used instead of CAP_CHOWN to "chown" IPC message queues, semaphores
+ and shared memory */
+/* Allow locking/unlocking of shared memory segment */
+/* Allow turning swap on/off */
+/* Allow forged pids on socket credentials passing */
+/* Allow setting readahead and flushing buffers on block devices */
+/* Allow setting geometry in floppy driver */
+/* Allow turning DMA on/off in xd driver */
+/* Allow administration of md devices (mostly the above, but some
+ extra ioctls) */
+/* Allow tuning the ide driver */
+/* Allow access to the nvram device */
+/* Allow administration of apm_bios, serial and bttv (TV) device */
+/* Allow manufacturer commands in isdn CAPI support driver */
+/* Allow reading non-standardized portions of pci configuration space */
+/* Allow DDI debug ioctl on sbpcd driver */
+/* Allow setting up serial ports */
+/* Allow sending raw qic-117 commands */
+/* Allow enabling/disabling tagged queuing on SCSI controllers and sending
+ arbitrary SCSI commands */
+/* Allow setting encryption key on loopback filesystem */
+/* Allow setting zone reclaim policy */
+
+#define CAP_SYS_ADMIN 21
+
+/* Allow use of reboot() */
+
+#define CAP_SYS_BOOT 22
+
+/* Allow raising priority and setting priority on other (different
+ UID) processes */
+/* Allow use of FIFO and round-robin (realtime) scheduling on own
+ processes and setting the scheduling algorithm used by another
+ process. */
+/* Allow setting cpu affinity on other processes */
+
+#define CAP_SYS_NICE 23
+
+/* Override resource limits. Set resource limits. */
+/* Override quota limits. */
+/* Override reserved space on ext2 filesystem */
+/* Modify data journaling mode on ext3 filesystem (uses journaling
+ resources) */
+/* NOTE: ext2 honors fsuid when checking for resource overrides, so
+ you can override using fsuid too */
+/* Override size restrictions on IPC message queues */
+/* Allow more than 64hz interrupts from the real-time clock */
+/* Override max number of consoles on console allocation */
+/* Override max number of keymaps */
+
+#define CAP_SYS_RESOURCE 24
+
+/* Allow manipulation of system clock */
+/* Allow irix_stime on mips */
+/* Allow setting the real-time clock */
+
+#define CAP_SYS_TIME 25
+
+/* Allow configuration of tty devices */
+/* Allow vhangup() of tty */
+
+#define CAP_SYS_TTY_CONFIG 26
+
+/* Allow the privileged aspects of mknod() */
+
+#define CAP_MKNOD 27
+
+/* Allow taking of leases on files */
+
+#define CAP_LEASE 28
+
+#define CAP_AUDIT_WRITE 29
+
+#define CAP_AUDIT_CONTROL 30
+
+#define CAP_SETFCAP 31
+
+
+#endif /* !_LINUX_CAPABILITY_H */
diff --git a/sysroot/usr/include/linux/capi.h b/sysroot/usr/include/linux/capi.h
new file mode 100644
index 0000000..58eca17
--- /dev/null
+++ b/sysroot/usr/include/linux/capi.h
@@ -0,0 +1,131 @@
+/* $Id: capi.h,v 1.4.6.1 2001/09/23 22:25:05 kai Exp $
+ *
+ * CAPI 2.0 Interface for Linux
+ *
+ * Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de)
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
+ */
+
+#ifndef __LINUX_CAPI_H__
+#define __LINUX_CAPI_H__
+
+#include <asm/types.h>
+#include <linux/ioctl.h>
+#include <linux/kernelcapi.h>
+
+/*
+ * CAPI_REGISTER
+ */
+
+typedef struct capi_register_params { /* CAPI_REGISTER */
+ __u32 level3cnt; /* No. of simulatneous user data connections */
+ __u32 datablkcnt; /* No. of buffered data messages */
+ __u32 datablklen; /* Size of buffered data messages */
+} capi_register_params;
+
+#define CAPI_REGISTER _IOW('C',0x01,struct capi_register_params)
+
+/*
+ * CAPI_GET_MANUFACTURER
+ */
+
+#define CAPI_MANUFACTURER_LEN 64
+
+#define CAPI_GET_MANUFACTURER _IOWR('C',0x06,int) /* broken: wanted size 64 (CAPI_MANUFACTURER_LEN) */
+
+/*
+ * CAPI_GET_VERSION
+ */
+
+typedef struct capi_version {
+ __u32 majorversion;
+ __u32 minorversion;
+ __u32 majormanuversion;
+ __u32 minormanuversion;
+} capi_version;
+
+#define CAPI_GET_VERSION _IOWR('C',0x07,struct capi_version)
+
+/*
+ * CAPI_GET_SERIAL
+ */
+
+#define CAPI_SERIAL_LEN 8
+#define CAPI_GET_SERIAL _IOWR('C',0x08,int) /* broken: wanted size 8 (CAPI_SERIAL_LEN) */
+
+/*
+ * CAPI_GET_PROFILE
+ */
+
+typedef struct capi_profile {
+ __u16 ncontroller; /* number of installed controller */
+ __u16 nbchannel; /* number of B-Channels */
+ __u32 goptions; /* global options */
+ __u32 support1; /* B1 protocols support */
+ __u32 support2; /* B2 protocols support */
+ __u32 support3; /* B3 protocols support */
+ __u32 reserved[6]; /* reserved */
+ __u32 manu[5]; /* manufacturer specific information */
+} capi_profile;
+
+#define CAPI_GET_PROFILE _IOWR('C',0x09,struct capi_profile)
+
+typedef struct capi_manufacturer_cmd {
+ unsigned long cmd;
+ void *data;
+} capi_manufacturer_cmd;
+
+/*
+ * CAPI_MANUFACTURER_CMD
+ */
+
+#define CAPI_MANUFACTURER_CMD _IOWR('C',0x20, struct capi_manufacturer_cmd)
+
+/*
+ * CAPI_GET_ERRCODE
+ * capi errcode is set, * if read, write, or ioctl returns EIO,
+ * ioctl returns errcode directly, and in arg, if != 0
+ */
+
+#define CAPI_GET_ERRCODE _IOR('C',0x21, __u16)
+
+/*
+ * CAPI_INSTALLED
+ */
+#define CAPI_INSTALLED _IOR('C',0x22, __u16)
+
+
+/*
+ * member contr is input for
+ * CAPI_GET_MANUFACTURER, CAPI_VERSION, CAPI_GET_SERIAL
+ * and CAPI_GET_PROFILE
+ */
+typedef union capi_ioctl_struct {
+ __u32 contr;
+ capi_register_params rparams;
+ __u8 manufacturer[CAPI_MANUFACTURER_LEN];
+ capi_version version;
+ __u8 serial[CAPI_SERIAL_LEN];
+ capi_profile profile;
+ capi_manufacturer_cmd cmd;
+ __u16 errcode;
+} capi_ioctl_struct;
+
+/*
+ * Middleware extension
+ */
+
+#define CAPIFLAG_HIGHJACKING 0x0001
+
+#define CAPI_GET_FLAGS _IOR('C',0x23, unsigned)
+#define CAPI_SET_FLAGS _IOR('C',0x24, unsigned)
+#define CAPI_CLR_FLAGS _IOR('C',0x25, unsigned)
+
+#define CAPI_NCCI_OPENCOUNT _IOR('C',0x26, unsigned)
+
+#define CAPI_NCCI_GETUNIT _IOR('C',0x27, unsigned)
+
+#endif /* __LINUX_CAPI_H__ */
diff --git a/sysroot/usr/include/linux/cciss_ioctl.h b/sysroot/usr/include/linux/cciss_ioctl.h
new file mode 100644
index 0000000..7cbbecb
--- /dev/null
+++ b/sysroot/usr/include/linux/cciss_ioctl.h
@@ -0,0 +1,214 @@
+#ifndef CCISS_IOCTLH
+#define CCISS_IOCTLH
+
+#include <linux/types.h>
+#include <linux/ioctl.h>
+
+#define CCISS_IOC_MAGIC 'B'
+
+
+typedef struct _cciss_pci_info_struct
+{
+ unsigned char bus;
+ unsigned char dev_fn;
+ unsigned short domain;
+ __u32 board_id;
+} cciss_pci_info_struct;
+
+typedef struct _cciss_coalint_struct
+{
+ __u32 delay;
+ __u32 count;
+} cciss_coalint_struct;
+
+typedef char NodeName_type[16];
+
+typedef __u32 Heartbeat_type;
+
+#define CISS_PARSCSIU2 0x0001
+#define CISS_PARCSCIU3 0x0002
+#define CISS_FIBRE1G 0x0100
+#define CISS_FIBRE2G 0x0200
+typedef __u32 BusTypes_type;
+
+typedef char FirmwareVer_type[4];
+typedef __u32 DriverVer_type;
+
+#define MAX_KMALLOC_SIZE 128000
+
+#ifndef CCISS_CMD_H
+// This defines are duplicated in cciss_cmd.h in the driver directory
+
+//general boundary defintions
+#define SENSEINFOBYTES 32//note that this value may vary between host implementations
+
+//Command Status value
+#define CMD_SUCCESS 0x0000
+#define CMD_TARGET_STATUS 0x0001
+#define CMD_DATA_UNDERRUN 0x0002
+#define CMD_DATA_OVERRUN 0x0003
+#define CMD_INVALID 0x0004
+#define CMD_PROTOCOL_ERR 0x0005
+#define CMD_HARDWARE_ERR 0x0006
+#define CMD_CONNECTION_LOST 0x0007
+#define CMD_ABORTED 0x0008
+#define CMD_ABORT_FAILED 0x0009
+#define CMD_UNSOLICITED_ABORT 0x000A
+#define CMD_TIMEOUT 0x000B
+#define CMD_UNABORTABLE 0x000C
+
+//transfer direction
+#define XFER_NONE 0x00
+#define XFER_WRITE 0x01
+#define XFER_READ 0x02
+#define XFER_RSVD 0x03
+
+//task attribute
+#define ATTR_UNTAGGED 0x00
+#define ATTR_SIMPLE 0x04
+#define ATTR_HEADOFQUEUE 0x05
+#define ATTR_ORDERED 0x06
+#define ATTR_ACA 0x07
+
+//cdb type
+#define TYPE_CMD 0x00
+#define TYPE_MSG 0x01
+
+// Type defs used in the following structs
+#define BYTE __u8
+#define WORD __u16
+#define HWORD __u16
+#define DWORD __u32
+
+#define CISS_MAX_LUN 1024
+
+#define LEVEL2LUN 1 // index into Target(x) structure, due to byte swapping
+#define LEVEL3LUN 0
+
+#pragma pack(1)
+
+//Command List Structure
+typedef union _SCSI3Addr_struct {
+ struct {
+ BYTE Dev;
+ BYTE Bus:6;
+ BYTE Mode:2; // b00
+ } PeripDev;
+ struct {
+ BYTE DevLSB;
+ BYTE DevMSB:6;
+ BYTE Mode:2; // b01
+ } LogDev;
+ struct {
+ BYTE Dev:5;
+ BYTE Bus:3;
+ BYTE Targ:6;
+ BYTE Mode:2; // b10
+ } LogUnit;
+} SCSI3Addr_struct;
+
+typedef struct _PhysDevAddr_struct {
+ DWORD TargetId:24;
+ DWORD Bus:6;
+ DWORD Mode:2;
+ SCSI3Addr_struct Target[2]; //2 level target device addr
+} PhysDevAddr_struct;
+
+typedef struct _LogDevAddr_struct {
+ DWORD VolId:30;
+ DWORD Mode:2;
+ BYTE reserved[4];
+} LogDevAddr_struct;
+
+typedef union _LUNAddr_struct {
+ BYTE LunAddrBytes[8];
+ SCSI3Addr_struct SCSI3Lun[4];
+ PhysDevAddr_struct PhysDev;
+ LogDevAddr_struct LogDev;
+} LUNAddr_struct;
+
+typedef struct _RequestBlock_struct {
+ BYTE CDBLen;
+ struct {
+ BYTE Type:3;
+ BYTE Attribute:3;
+ BYTE Direction:2;
+ } Type;
+ HWORD Timeout;
+ BYTE CDB[16];
+} RequestBlock_struct;
+
+typedef union _MoreErrInfo_struct{
+ struct {
+ BYTE Reserved[3];
+ BYTE Type;
+ DWORD ErrorInfo;
+ }Common_Info;
+ struct{
+ BYTE Reserved[2];
+ BYTE offense_size;//size of offending entry
+ BYTE offense_num; //byte # of offense 0-base
+ DWORD offense_value;
+ }Invalid_Cmd;
+}MoreErrInfo_struct;
+typedef struct _ErrorInfo_struct {
+ BYTE ScsiStatus;
+ BYTE SenseLen;
+ HWORD CommandStatus;
+ DWORD ResidualCnt;
+ MoreErrInfo_struct MoreErrInfo;
+ BYTE SenseInfo[SENSEINFOBYTES];
+} ErrorInfo_struct;
+
+#pragma pack()
+#endif /* CCISS_CMD_H */
+
+typedef struct _IOCTL_Command_struct {
+ LUNAddr_struct LUN_info;
+ RequestBlock_struct Request;
+ ErrorInfo_struct error_info;
+ WORD buf_size; /* size in bytes of the buf */
+ BYTE *buf;
+} IOCTL_Command_struct;
+
+typedef struct _BIG_IOCTL_Command_struct {
+ LUNAddr_struct LUN_info;
+ RequestBlock_struct Request;
+ ErrorInfo_struct error_info;
+ DWORD malloc_size; /* < MAX_KMALLOC_SIZE in cciss.c */
+ DWORD buf_size; /* size in bytes of the buf */
+ /* < malloc_size * MAXSGENTRIES */
+ BYTE *buf;
+} BIG_IOCTL_Command_struct;
+
+typedef struct _LogvolInfo_struct{
+ __u32 LunID;
+ int num_opens; /* number of opens on the logical volume */
+ int num_parts; /* number of partitions configured on logvol */
+} LogvolInfo_struct;
+
+#define CCISS_GETPCIINFO _IOR(CCISS_IOC_MAGIC, 1, cciss_pci_info_struct)
+
+#define CCISS_GETINTINFO _IOR(CCISS_IOC_MAGIC, 2, cciss_coalint_struct)
+#define CCISS_SETINTINFO _IOW(CCISS_IOC_MAGIC, 3, cciss_coalint_struct)
+
+#define CCISS_GETNODENAME _IOR(CCISS_IOC_MAGIC, 4, NodeName_type)
+#define CCISS_SETNODENAME _IOW(CCISS_IOC_MAGIC, 5, NodeName_type)
+
+#define CCISS_GETHEARTBEAT _IOR(CCISS_IOC_MAGIC, 6, Heartbeat_type)
+#define CCISS_GETBUSTYPES _IOR(CCISS_IOC_MAGIC, 7, BusTypes_type)
+#define CCISS_GETFIRMVER _IOR(CCISS_IOC_MAGIC, 8, FirmwareVer_type)
+#define CCISS_GETDRIVVER _IOR(CCISS_IOC_MAGIC, 9, DriverVer_type)
+#define CCISS_REVALIDVOLS _IO(CCISS_IOC_MAGIC, 10)
+#define CCISS_PASSTHRU _IOWR(CCISS_IOC_MAGIC, 11, IOCTL_Command_struct)
+#define CCISS_DEREGDISK _IO(CCISS_IOC_MAGIC, 12)
+
+/* no longer used... use REGNEWD instead */
+#define CCISS_REGNEWDISK _IOW(CCISS_IOC_MAGIC, 13, int)
+
+#define CCISS_REGNEWD _IO(CCISS_IOC_MAGIC, 14)
+#define CCISS_RESCANDISK _IO(CCISS_IOC_MAGIC, 16)
+#define CCISS_GETLUNINFO _IOR(CCISS_IOC_MAGIC, 17, LogvolInfo_struct)
+#define CCISS_BIG_PASSTHRU _IOWR(CCISS_IOC_MAGIC, 18, BIG_IOCTL_Command_struct)
+
+#endif
diff --git a/sysroot/usr/include/linux/cdk.h b/sysroot/usr/include/linux/cdk.h
new file mode 100644
index 0000000..0908daf
--- /dev/null
+++ b/sysroot/usr/include/linux/cdk.h
@@ -0,0 +1,486 @@
+/*****************************************************************************/
+
+/*
+ * cdk.h -- CDK interface definitions.
+ *
+ * Copyright (C) 1996-1998 Stallion Technologies
+ * Copyright (C) 1994-1996 Greg Ungerer.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/*****************************************************************************/
+#ifndef _CDK_H
+#define _CDK_H
+/*****************************************************************************/
+
+#pragma pack(2)
+
+/*
+ * The following set of definitions is used to communicate with the
+ * shared memory interface of the Stallion intelligent multiport serial
+ * boards. The definitions in this file are taken directly from the
+ * document titled "Generic Stackable Interface, Downloader and
+ * Communications Development Kit".
+ */
+
+/*
+ * Define the set of important shared memory addresses. These are
+ * required to initialize the board and get things started. All of these
+ * addresses are relative to the start of the shared memory.
+ */
+#define CDK_SIGADDR 0x200
+#define CDK_FEATADDR 0x280
+#define CDK_CDKADDR 0x300
+#define CDK_RDYADDR 0x262
+
+#define CDK_ALIVEMARKER 13
+
+/*
+ * On hardware power up the ROMs located on the EasyConnection 8/64 will
+ * fill out the following signature information into shared memory. This
+ * way the host system can quickly determine that the board is present
+ * and is operational.
+ */
+typedef struct cdkecpsig {
+ unsigned long magic;
+ unsigned short romver;
+ unsigned short cputype;
+ unsigned char panelid[8];
+} cdkecpsig_t;
+
+#define ECP_MAGIC 0x21504345
+
+/*
+ * On hardware power up the ROMs located on the ONboard, Stallion and
+ * Brumbys will fill out the following signature information into shared
+ * memory. This way the host system can quickly determine that the board
+ * is present and is operational.
+ */
+typedef struct cdkonbsig {
+ unsigned short magic0;
+ unsigned short magic1;
+ unsigned short magic2;
+ unsigned short magic3;
+ unsigned short romver;
+ unsigned short memoff;
+ unsigned short memseg;
+ unsigned short amask0;
+ unsigned short pic;
+ unsigned short status;
+ unsigned short btype;
+ unsigned short clkticks;
+ unsigned short clkspeed;
+ unsigned short amask1;
+ unsigned short amask2;
+} cdkonbsig_t;
+
+#define ONB_MAGIC0 0xf2a7
+#define ONB_MAGIC1 0xa149
+#define ONB_MAGIC2 0x6352
+#define ONB_MAGIC3 0xf121
+
+/*
+ * Define the feature area structure. The feature area is the set of
+ * startup parameters used by the slave image when it starts executing.
+ * They allow for the specification of buffer sizes, debug trace, etc.
+ */
+typedef struct cdkfeature {
+ unsigned long debug;
+ unsigned long banner;
+ unsigned long etype;
+ unsigned long nrdevs;
+ unsigned long brdspec;
+ unsigned long txrqsize;
+ unsigned long rxrqsize;
+ unsigned long flags;
+} cdkfeature_t;
+
+#define ETYP_DDK 0
+#define ETYP_CDK 1
+
+/*
+ * Define the CDK header structure. This is the info that the slave
+ * environment sets up after it has been downloaded and started. It
+ * essentially provides a memory map for the shared memory interface.
+ */
+typedef struct cdkhdr {
+ unsigned short command;
+ unsigned short status;
+ unsigned short port;
+ unsigned short mode;
+ unsigned long cmd_buf[14];
+ unsigned short alive_cnt;
+ unsigned short intrpt_mode;
+ unsigned char intrpt_id[8];
+ unsigned char ver_release;
+ unsigned char ver_modification;
+ unsigned char ver_fix;
+ unsigned char deadman_restart;
+ unsigned short deadman;
+ unsigned short nrdevs;
+ unsigned long memp;
+ unsigned long hostp;
+ unsigned long slavep;
+ unsigned char hostreq;
+ unsigned char slavereq;
+ unsigned char cmd_reserved[30];
+} cdkhdr_t;
+
+#define MODE_DDK 0
+#define MODE_CDK 1
+
+#define IMD_INTR 0x0
+#define IMD_PPINTR 0x1
+#define IMD_POLL 0xff
+
+/*
+ * Define the memory mapping structure. This structure is pointed to by
+ * the memp field in the stlcdkhdr struct. As many as these structures
+ * as required are layed out in shared memory to define how the rest of
+ * shared memory is divided up. There will be one for each port.
+ */
+typedef struct cdkmem {
+ unsigned short dtype;
+ unsigned long offset;
+} cdkmem_t;
+
+#define TYP_UNDEFINED 0x0
+#define TYP_ASYNCTRL 0x1
+#define TYP_ASYNC 0x20
+#define TYP_PARALLEL 0x40
+#define TYP_SYNCX21 0x60
+
+/*****************************************************************************/
+
+/*
+ * Following is a set of defines and structures used to actually deal
+ * with the serial ports on the board. Firstly is the set of commands
+ * that can be applied to ports.
+ */
+#define ASYCMD (((unsigned long) 'a') << 8)
+
+#define A_NULL (ASYCMD | 0)
+#define A_FLUSH (ASYCMD | 1)
+#define A_BREAK (ASYCMD | 2)
+#define A_GETPORT (ASYCMD | 3)
+#define A_SETPORT (ASYCMD | 4)
+#define A_SETPORTF (ASYCMD | 5)
+#define A_SETPORTFTX (ASYCMD | 6)
+#define A_SETPORTFRX (ASYCMD | 7)
+#define A_GETSIGNALS (ASYCMD | 8)
+#define A_SETSIGNALS (ASYCMD | 9)
+#define A_SETSIGNALSF (ASYCMD | 10)
+#define A_SETSIGNALSFTX (ASYCMD | 11)
+#define A_SETSIGNALSFRX (ASYCMD | 12)
+#define A_GETNOTIFY (ASYCMD | 13)
+#define A_SETNOTIFY (ASYCMD | 14)
+#define A_NOTIFY (ASYCMD | 15)
+#define A_PORTCTRL (ASYCMD | 16)
+#define A_GETSTATS (ASYCMD | 17)
+#define A_RQSTATE (ASYCMD | 18)
+#define A_FLOWSTATE (ASYCMD | 19)
+#define A_CLEARSTATS (ASYCMD | 20)
+
+/*
+ * Define those arguments used for simple commands.
+ */
+#define FLUSHRX 0x1
+#define FLUSHTX 0x2
+
+#define BREAKON -1
+#define BREAKOFF -2
+
+/*
+ * Define the port setting structure, and all those defines that go along
+ * with it. Basically this structure defines the characteristics of this
+ * port: baud rate, chars, parity, input/output char cooking etc.
+ */
+typedef struct asyport {
+ unsigned long baudout;
+ unsigned long baudin;
+ unsigned long iflag;
+ unsigned long oflag;
+ unsigned long lflag;
+ unsigned long pflag;
+ unsigned long flow;
+ unsigned long spare1;
+ unsigned short vtime;
+ unsigned short vmin;
+ unsigned short txlo;
+ unsigned short txhi;
+ unsigned short rxlo;
+ unsigned short rxhi;
+ unsigned short rxhog;
+ unsigned short spare2;
+ unsigned char csize;
+ unsigned char stopbs;
+ unsigned char parity;
+ unsigned char stopin;
+ unsigned char startin;
+ unsigned char stopout;
+ unsigned char startout;
+ unsigned char parmark;
+ unsigned char brkmark;
+ unsigned char cc[11];
+} asyport_t;
+
+#define PT_STOP1 0x0
+#define PT_STOP15 0x1
+#define PT_STOP2 0x2
+
+#define PT_NOPARITY 0x0
+#define PT_ODDPARITY 0x1
+#define PT_EVENPARITY 0x2
+#define PT_MARKPARITY 0x3
+#define PT_SPACEPARITY 0x4
+
+#define F_NONE 0x0
+#define F_IXON 0x1
+#define F_IXOFF 0x2
+#define F_IXANY 0x4
+#define F_IOXANY 0x8
+#define F_RTSFLOW 0x10
+#define F_CTSFLOW 0x20
+#define F_DTRFLOW 0x40
+#define F_DCDFLOW 0x80
+#define F_DSROFLOW 0x100
+#define F_DSRIFLOW 0x200
+
+#define FI_NORX 0x1
+#define FI_RAW 0x2
+#define FI_ISTRIP 0x4
+#define FI_UCLC 0x8
+#define FI_INLCR 0x10
+#define FI_ICRNL 0x20
+#define FI_IGNCR 0x40
+#define FI_IGNBREAK 0x80
+#define FI_DSCRDBREAK 0x100
+#define FI_1MARKBREAK 0x200
+#define FI_2MARKBREAK 0x400
+#define FI_XCHNGBREAK 0x800
+#define FI_IGNRXERRS 0x1000
+#define FI_DSCDRXERRS 0x2000
+#define FI_1MARKRXERRS 0x4000
+#define FI_2MARKRXERRS 0x8000
+#define FI_XCHNGRXERRS 0x10000
+#define FI_DSCRDNULL 0x20000
+
+#define FO_OLCUC 0x1
+#define FO_ONLCR 0x2
+#define FO_OOCRNL 0x4
+#define FO_ONOCR 0x8
+#define FO_ONLRET 0x10
+#define FO_ONL 0x20
+#define FO_OBS 0x40
+#define FO_OVT 0x80
+#define FO_OFF 0x100
+#define FO_OTAB1 0x200
+#define FO_OTAB2 0x400
+#define FO_OTAB3 0x800
+#define FO_OCR1 0x1000
+#define FO_OCR2 0x2000
+#define FO_OCR3 0x4000
+#define FO_OFILL 0x8000
+#define FO_ODELL 0x10000
+
+#define P_RTSLOCK 0x1
+#define P_CTSLOCK 0x2
+#define P_MAPRTS 0x4
+#define P_MAPCTS 0x8
+#define P_LOOPBACK 0x10
+#define P_DTRFOLLOW 0x20
+#define P_FAKEDCD 0x40
+
+#define P_RXIMIN 0x10000
+#define P_RXITIME 0x20000
+#define P_RXTHOLD 0x40000
+
+/*
+ * Define a structure to communicate serial port signal and data state
+ * information.
+ */
+typedef struct asysigs {
+ unsigned long data;
+ unsigned long signal;
+ unsigned long sigvalue;
+} asysigs_t;
+
+#define DT_TXBUSY 0x1
+#define DT_TXEMPTY 0x2
+#define DT_TXLOW 0x4
+#define DT_TXHIGH 0x8
+#define DT_TXFULL 0x10
+#define DT_TXHOG 0x20
+#define DT_TXFLOWED 0x40
+#define DT_TXBREAK 0x80
+
+#define DT_RXBUSY 0x100
+#define DT_RXEMPTY 0x200
+#define DT_RXLOW 0x400
+#define DT_RXHIGH 0x800
+#define DT_RXFULL 0x1000
+#define DT_RXHOG 0x2000
+#define DT_RXFLOWED 0x4000
+#define DT_RXBREAK 0x8000
+
+#define SG_DTR 0x1
+#define SG_DCD 0x2
+#define SG_RTS 0x4
+#define SG_CTS 0x8
+#define SG_DSR 0x10
+#define SG_RI 0x20
+
+/*
+ * Define the notification setting structure. This is used to tell the
+ * port what events we want to be informed about. Fields here use the
+ * same defines as for the asysigs structure above.
+ */
+typedef struct asynotify {
+ unsigned long ctrl;
+ unsigned long data;
+ unsigned long signal;
+ unsigned long sigvalue;
+} asynotify_t;
+
+/*
+ * Define the port control structure. It is used to do fine grain
+ * control operations on the port.
+ */
+typedef struct {
+ unsigned long rxctrl;
+ unsigned long txctrl;
+ char rximdch;
+ char tximdch;
+ char spare1;
+ char spare2;
+} asyctrl_t;
+
+#define CT_ENABLE 0x1
+#define CT_DISABLE 0x2
+#define CT_STOP 0x4
+#define CT_START 0x8
+#define CT_STARTFLOW 0x10
+#define CT_STOPFLOW 0x20
+#define CT_SENDCHR 0x40
+
+/*
+ * Define the stats structure kept for each port. This is a useful set
+ * of data collected for each port on the slave. The A_GETSTATS command
+ * is used to retrieve this data from the slave.
+ */
+typedef struct asystats {
+ unsigned long opens;
+ unsigned long txchars;
+ unsigned long rxchars;
+ unsigned long txringq;
+ unsigned long rxringq;
+ unsigned long txmsgs;
+ unsigned long rxmsgs;
+ unsigned long txflushes;
+ unsigned long rxflushes;
+ unsigned long overruns;
+ unsigned long framing;
+ unsigned long parity;
+ unsigned long ringover;
+ unsigned long lost;
+ unsigned long rxstart;
+ unsigned long rxstop;
+ unsigned long txstart;
+ unsigned long txstop;
+ unsigned long dcdcnt;
+ unsigned long dtrcnt;
+ unsigned long ctscnt;
+ unsigned long rtscnt;
+ unsigned long dsrcnt;
+ unsigned long ricnt;
+ unsigned long txbreaks;
+ unsigned long rxbreaks;
+ unsigned long signals;
+ unsigned long state;
+ unsigned long hwid;
+} asystats_t;
+
+/*****************************************************************************/
+
+/*
+ * All command and control communication with a device on the slave is
+ * via a control block in shared memory. Each device has its own control
+ * block, defined by the following structure. The control block allows
+ * the host to open, close and control the device on the slave.
+ */
+typedef struct cdkctrl {
+ unsigned char open;
+ unsigned char close;
+ unsigned long openarg;
+ unsigned long closearg;
+ unsigned long cmd;
+ unsigned long status;
+ unsigned long args[32];
+} cdkctrl_t;
+
+/*
+ * Each device on the slave passes data to and from the host via a ring
+ * queue in shared memory. Define a ring queue structure to hold the
+ * vital information about each ring queue. Two ring queues will be
+ * allocated for each port, one for receive data and one for transmit
+ * data.
+ */
+typedef struct cdkasyrq {
+ unsigned long offset;
+ unsigned short size;
+ unsigned short head;
+ unsigned short tail;
+} cdkasyrq_t;
+
+/*
+ * Each asynchronous port is defined in shared memory by the following
+ * structure. It contains a control block to command a device, and also
+ * the necessary data channel information as well.
+ */
+typedef struct cdkasy {
+ cdkctrl_t ctrl;
+ unsigned short notify;
+ asynotify_t changed;
+ unsigned short receive;
+ cdkasyrq_t rxq;
+ unsigned short transmit;
+ cdkasyrq_t txq;
+} cdkasy_t;
+
+#pragma pack()
+
+/*****************************************************************************/
+
+/*
+ * Define the set of ioctls used by the driver to do special things
+ * to the board. These include interrupting it, and initializing
+ * the driver after board startup and shutdown.
+ */
+#include <linux/ioctl.h>
+
+#define STL_BINTR _IO('s',20)
+#define STL_BSTART _IO('s',21)
+#define STL_BSTOP _IO('s',22)
+#define STL_BRESET _IO('s',23)
+
+/*
+ * Define a set of ioctl extensions, used to get at special stuff.
+ */
+#define STL_GETPFLAG _IO('s',80)
+#define STL_SETPFLAG _IO('s',81)
+
+/*****************************************************************************/
+#endif
diff --git a/sysroot/usr/include/linux/cdrom.h b/sysroot/usr/include/linux/cdrom.h
new file mode 100644
index 0000000..4409fac
--- /dev/null
+++ b/sysroot/usr/include/linux/cdrom.h
@@ -0,0 +1,908 @@
+/*
+ * -- <linux/cdrom.h>
+ * General header file for linux CD-ROM drivers
+ * Copyright (C) 1992 David Giller, rafetmad@oxy.edu
+ * 1994, 1995 Eberhard Mönkeberg, emoenke@gwdg.de
+ * 1996 David van Leeuwen, david@tm.tno.nl
+ * 1997, 1998 Erik Andersen, andersee@debian.org
+ * 1998-2002 Jens Axboe, axboe@suse.de
+ */
+
+#ifndef _LINUX_CDROM_H
+#define _LINUX_CDROM_H
+
+#include <asm/byteorder.h>
+
+/*******************************************************
+ * As of Linux 2.1.x, all Linux CD-ROM application programs will use this
+ * (and only this) include file. It is my hope to provide Linux with
+ * a uniform interface between software accessing CD-ROMs and the various
+ * device drivers that actually talk to the drives. There may still be
+ * 23 different kinds of strange CD-ROM drives, but at least there will
+ * now be one, and only one, Linux CD-ROM interface.
+ *
+ * Additionally, as of Linux 2.1.x, all Linux application programs
+ * should use the O_NONBLOCK option when opening a CD-ROM device
+ * for subsequent ioctl commands. This allows for neat system errors
+ * like "No medium found" or "Wrong medium type" upon attempting to
+ * mount or play an empty slot, mount an audio disc, or play a data disc.
+ * Generally, changing an application program to support O_NONBLOCK
+ * is as easy as the following:
+ * - drive = open("/dev/cdrom", O_RDONLY);
+ * + drive = open("/dev/cdrom", O_RDONLY | O_NONBLOCK);
+ * It is worth the small change.
+ *
+ * Patches for many common CD programs (provided by David A. van Leeuwen)
+ * can be found at: ftp://ftp.gwdg.de/pub/linux/cdrom/drivers/cm206/
+ *
+ *******************************************************/
+
+/* When a driver supports a certain function, but the cdrom drive we are
+ * using doesn't, we will return the error EDRIVE_CANT_DO_THIS. We will
+ * borrow the "Operation not supported" error from the network folks to
+ * accomplish this. Maybe someday we will get a more targeted error code,
+ * but this will do for now... */
+#define EDRIVE_CANT_DO_THIS EOPNOTSUPP
+
+/*******************************************************
+ * The CD-ROM IOCTL commands -- these should be supported by
+ * all the various cdrom drivers. For the CD-ROM ioctls, we
+ * will commandeer byte 0x53, or 'S'.
+ *******************************************************/
+#define CDROMPAUSE 0x5301 /* Pause Audio Operation */
+#define CDROMRESUME 0x5302 /* Resume paused Audio Operation */
+#define CDROMPLAYMSF 0x5303 /* Play Audio MSF (struct cdrom_msf) */
+#define CDROMPLAYTRKIND 0x5304 /* Play Audio Track/index
+ (struct cdrom_ti) */
+#define CDROMREADTOCHDR 0x5305 /* Read TOC header
+ (struct cdrom_tochdr) */
+#define CDROMREADTOCENTRY 0x5306 /* Read TOC entry
+ (struct cdrom_tocentry) */
+#define CDROMSTOP 0x5307 /* Stop the cdrom drive */
+#define CDROMSTART 0x5308 /* Start the cdrom drive */
+#define CDROMEJECT 0x5309 /* Ejects the cdrom media */
+#define CDROMVOLCTRL 0x530a /* Control output volume
+ (struct cdrom_volctrl) */
+#define CDROMSUBCHNL 0x530b /* Read subchannel data
+ (struct cdrom_subchnl) */
+#define CDROMREADMODE2 0x530c /* Read CDROM mode 2 data (2336 Bytes)
+ (struct cdrom_read) */
+#define CDROMREADMODE1 0x530d /* Read CDROM mode 1 data (2048 Bytes)
+ (struct cdrom_read) */
+#define CDROMREADAUDIO 0x530e /* (struct cdrom_read_audio) */
+#define CDROMEJECT_SW 0x530f /* enable(1)/disable(0) auto-ejecting */
+#define CDROMMULTISESSION 0x5310 /* Obtain the start-of-last-session
+ address of multi session disks
+ (struct cdrom_multisession) */
+#define CDROM_GET_MCN 0x5311 /* Obtain the "Universal Product Code"
+ if available (struct cdrom_mcn) */
+#define CDROM_GET_UPC CDROM_GET_MCN /* This one is deprecated,
+ but here anyway for compatibility */
+#define CDROMRESET 0x5312 /* hard-reset the drive */
+#define CDROMVOLREAD 0x5313 /* Get the drive's volume setting
+ (struct cdrom_volctrl) */
+#define CDROMREADRAW 0x5314 /* read data in raw mode (2352 Bytes)
+ (struct cdrom_read) */
+/*
+ * These ioctls are used only used in aztcd.c and optcd.c
+ */
+#define CDROMREADCOOKED 0x5315 /* read data in cooked mode */
+#define CDROMSEEK 0x5316 /* seek msf address */
+
+/*
+ * This ioctl is only used by the scsi-cd driver.
+ It is for playing audio in logical block addressing mode.
+ */
+#define CDROMPLAYBLK 0x5317 /* (struct cdrom_blk) */
+
+/*
+ * These ioctls are only used in optcd.c
+ */
+#define CDROMREADALL 0x5318 /* read all 2646 bytes */
+
+/*
+ * These ioctls are (now) only in ide-cd.c for controlling
+ * drive spindown time. They should be implemented in the
+ * Uniform driver, via generic packet commands, GPCMD_MODE_SELECT_10,
+ * GPCMD_MODE_SENSE_10 and the GPMODE_POWER_PAGE...
+ * -Erik
+ */
+#define CDROMGETSPINDOWN 0x531d
+#define CDROMSETSPINDOWN 0x531e
+
+/*
+ * These ioctls are implemented through the uniform CD-ROM driver
+ * They _will_ be adopted by all CD-ROM drivers, when all the CD-ROM
+ * drivers are eventually ported to the uniform CD-ROM driver interface.
+ */
+#define CDROMCLOSETRAY 0x5319 /* pendant of CDROMEJECT */
+#define CDROM_SET_OPTIONS 0x5320 /* Set behavior options */
+#define CDROM_CLEAR_OPTIONS 0x5321 /* Clear behavior options */
+#define CDROM_SELECT_SPEED 0x5322 /* Set the CD-ROM speed */
+#define CDROM_SELECT_DISC 0x5323 /* Select disc (for juke-boxes) */
+#define CDROM_MEDIA_CHANGED 0x5325 /* Check is media changed */
+#define CDROM_DRIVE_STATUS 0x5326 /* Get tray position, etc. */
+#define CDROM_DISC_STATUS 0x5327 /* Get disc type, etc. */
+#define CDROM_CHANGER_NSLOTS 0x5328 /* Get number of slots */
+#define CDROM_LOCKDOOR 0x5329 /* lock or unlock door */
+#define CDROM_DEBUG 0x5330 /* Turn debug messages on/off */
+#define CDROM_GET_CAPABILITY 0x5331 /* get capabilities */
+
+/* Note that scsi/scsi_ioctl.h also uses 0x5382 - 0x5386.
+ * Future CDROM ioctls should be kept below 0x537F
+ */
+
+/* This ioctl is only used by sbpcd at the moment */
+#define CDROMAUDIOBUFSIZ 0x5382 /* set the audio buffer size */
+ /* conflict with SCSI_IOCTL_GET_IDLUN */
+
+/* DVD-ROM Specific ioctls */
+#define DVD_READ_STRUCT 0x5390 /* Read structure */
+#define DVD_WRITE_STRUCT 0x5391 /* Write structure */
+#define DVD_AUTH 0x5392 /* Authentication */
+
+#define CDROM_SEND_PACKET 0x5393 /* send a packet to the drive */
+#define CDROM_NEXT_WRITABLE 0x5394 /* get next writable block */
+#define CDROM_LAST_WRITTEN 0x5395 /* get last block written on disc */
+
+/*******************************************************
+ * CDROM IOCTL structures
+ *******************************************************/
+
+/* Address in MSF format */
+struct cdrom_msf0
+{
+ __u8 minute;
+ __u8 second;
+ __u8 frame;
+};
+
+/* Address in either MSF or logical format */
+union cdrom_addr
+{
+ struct cdrom_msf0 msf;
+ int lba;
+};
+
+/* This struct is used by the CDROMPLAYMSF ioctl */
+struct cdrom_msf
+{
+ __u8 cdmsf_min0; /* start minute */
+ __u8 cdmsf_sec0; /* start second */
+ __u8 cdmsf_frame0; /* start frame */
+ __u8 cdmsf_min1; /* end minute */
+ __u8 cdmsf_sec1; /* end second */
+ __u8 cdmsf_frame1; /* end frame */
+};
+
+/* This struct is used by the CDROMPLAYTRKIND ioctl */
+struct cdrom_ti
+{
+ __u8 cdti_trk0; /* start track */
+ __u8 cdti_ind0; /* start index */
+ __u8 cdti_trk1; /* end track */
+ __u8 cdti_ind1; /* end index */
+};
+
+/* This struct is used by the CDROMREADTOCHDR ioctl */
+struct cdrom_tochdr
+{
+ __u8 cdth_trk0; /* start track */
+ __u8 cdth_trk1; /* end track */
+};
+
+/* This struct is used by the CDROMVOLCTRL and CDROMVOLREAD ioctls */
+struct cdrom_volctrl
+{
+ __u8 channel0;
+ __u8 channel1;
+ __u8 channel2;
+ __u8 channel3;
+};
+
+/* This struct is used by the CDROMSUBCHNL ioctl */
+struct cdrom_subchnl
+{
+ __u8 cdsc_format;
+ __u8 cdsc_audiostatus;
+ __u8 cdsc_adr: 4;
+ __u8 cdsc_ctrl: 4;
+ __u8 cdsc_trk;
+ __u8 cdsc_ind;
+ union cdrom_addr cdsc_absaddr;
+ union cdrom_addr cdsc_reladdr;
+};
+
+
+/* This struct is used by the CDROMREADTOCENTRY ioctl */
+struct cdrom_tocentry
+{
+ __u8 cdte_track;
+ __u8 cdte_adr :4;
+ __u8 cdte_ctrl :4;
+ __u8 cdte_format;
+ union cdrom_addr cdte_addr;
+ __u8 cdte_datamode;
+};
+
+/* This struct is used by the CDROMREADMODE1, and CDROMREADMODE2 ioctls */
+struct cdrom_read
+{
+ int cdread_lba;
+ char *cdread_bufaddr;
+ int cdread_buflen;
+};
+
+/* This struct is used by the CDROMREADAUDIO ioctl */
+struct cdrom_read_audio
+{
+ union cdrom_addr addr; /* frame address */
+ __u8 addr_format; /* CDROM_LBA or CDROM_MSF */
+ int nframes; /* number of 2352-byte-frames to read at once */
+ __u8 *buf; /* frame buffer (size: nframes*2352 bytes) */
+};
+
+/* This struct is used with the CDROMMULTISESSION ioctl */
+struct cdrom_multisession
+{
+ union cdrom_addr addr; /* frame address: start-of-last-session
+ (not the new "frame 16"!). Only valid
+ if the "xa_flag" is true. */
+ __u8 xa_flag; /* 1: "is XA disk" */
+ __u8 addr_format; /* CDROM_LBA or CDROM_MSF */
+};
+
+/* This struct is used with the CDROM_GET_MCN ioctl.
+ * Very few audio discs actually have Universal Product Code information,
+ * which should just be the Medium Catalog Number on the box. Also note
+ * that the way the codeis written on CD is _not_ uniform across all discs!
+ */
+struct cdrom_mcn
+{
+ __u8 medium_catalog_number[14]; /* 13 ASCII digits, null-terminated */
+};
+
+/* This is used by the CDROMPLAYBLK ioctl */
+struct cdrom_blk
+{
+ unsigned from;
+ unsigned short len;
+};
+
+#define CDROM_PACKET_SIZE 12
+
+#define CGC_DATA_UNKNOWN 0
+#define CGC_DATA_WRITE 1
+#define CGC_DATA_READ 2
+#define CGC_DATA_NONE 3
+
+/* for CDROM_PACKET_COMMAND ioctl */
+struct cdrom_generic_command
+{
+ unsigned char cmd[CDROM_PACKET_SIZE];
+ unsigned char *buffer;
+ unsigned int buflen;
+ int stat;
+ struct request_sense *sense;
+ unsigned char data_direction;
+ int quiet;
+ int timeout;
+ void *reserved[1]; /* unused, actually */
+};
+
+/*
+ * A CD-ROM physical sector size is 2048, 2052, 2056, 2324, 2332, 2336,
+ * 2340, or 2352 bytes long.
+
+* Sector types of the standard CD-ROM data formats:
+ *
+ * format sector type user data size (bytes)
+ * -----------------------------------------------------------------------------
+ * 1 (Red Book) CD-DA 2352 (CD_FRAMESIZE_RAW)
+ * 2 (Yellow Book) Mode1 Form1 2048 (CD_FRAMESIZE)
+ * 3 (Yellow Book) Mode1 Form2 2336 (CD_FRAMESIZE_RAW0)
+ * 4 (Green Book) Mode2 Form1 2048 (CD_FRAMESIZE)
+ * 5 (Green Book) Mode2 Form2 2328 (2324+4 spare bytes)
+ *
+ *
+ * The layout of the standard CD-ROM data formats:
+ * -----------------------------------------------------------------------------
+ * - audio (red): | audio_sample_bytes |
+ * | 2352 |
+ *
+ * - data (yellow, mode1): | sync - head - data - EDC - zero - ECC |
+ * | 12 - 4 - 2048 - 4 - 8 - 276 |
+ *
+ * - data (yellow, mode2): | sync - head - data |
+ * | 12 - 4 - 2336 |
+ *
+ * - XA data (green, mode2 form1): | sync - head - sub - data - EDC - ECC |
+ * | 12 - 4 - 8 - 2048 - 4 - 276 |
+ *
+ * - XA data (green, mode2 form2): | sync - head - sub - data - Spare |
+ * | 12 - 4 - 8 - 2324 - 4 |
+ *
+ */
+
+/* Some generally useful CD-ROM information -- mostly based on the above */
+#define CD_MINS 74 /* max. minutes per CD, not really a limit */
+#define CD_SECS 60 /* seconds per minute */
+#define CD_FRAMES 75 /* frames per second */
+#define CD_SYNC_SIZE 12 /* 12 sync bytes per raw data frame */
+#define CD_MSF_OFFSET 150 /* MSF numbering offset of first frame */
+#define CD_CHUNK_SIZE 24 /* lowest-level "data bytes piece" */
+#define CD_NUM_OF_CHUNKS 98 /* chunks per frame */
+#define CD_FRAMESIZE_SUB 96 /* subchannel data "frame" size */
+#define CD_HEAD_SIZE 4 /* header (address) bytes per raw data frame */
+#define CD_SUBHEAD_SIZE 8 /* subheader bytes per raw XA data frame */
+#define CD_EDC_SIZE 4 /* bytes EDC per most raw data frame types */
+#define CD_ZERO_SIZE 8 /* bytes zero per yellow book mode 1 frame */
+#define CD_ECC_SIZE 276 /* bytes ECC per most raw data frame types */
+#define CD_FRAMESIZE 2048 /* bytes per frame, "cooked" mode */
+#define CD_FRAMESIZE_RAW 2352 /* bytes per frame, "raw" mode */
+#define CD_FRAMESIZE_RAWER 2646 /* The maximum possible returned bytes */
+/* most drives don't deliver everything: */
+#define CD_FRAMESIZE_RAW1 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE) /*2340*/
+#define CD_FRAMESIZE_RAW0 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE-CD_HEAD_SIZE) /*2336*/
+
+#define CD_XA_HEAD (CD_HEAD_SIZE+CD_SUBHEAD_SIZE) /* "before data" part of raw XA frame */
+#define CD_XA_TAIL (CD_EDC_SIZE+CD_ECC_SIZE) /* "after data" part of raw XA frame */
+#define CD_XA_SYNC_HEAD (CD_SYNC_SIZE+CD_XA_HEAD) /* sync bytes + header of XA frame */
+
+/* CD-ROM address types (cdrom_tocentry.cdte_format) */
+#define CDROM_LBA 0x01 /* "logical block": first frame is #0 */
+#define CDROM_MSF 0x02 /* "minute-second-frame": binary, not bcd here! */
+
+/* bit to tell whether track is data or audio (cdrom_tocentry.cdte_ctrl) */
+#define CDROM_DATA_TRACK 0x04
+
+/* The leadout track is always 0xAA, regardless of # of tracks on disc */
+#define CDROM_LEADOUT 0xAA
+
+/* audio states (from SCSI-2, but seen with other drives, too) */
+#define CDROM_AUDIO_INVALID 0x00 /* audio status not supported */
+#define CDROM_AUDIO_PLAY 0x11 /* audio play operation in progress */
+#define CDROM_AUDIO_PAUSED 0x12 /* audio play operation paused */
+#define CDROM_AUDIO_COMPLETED 0x13 /* audio play successfully completed */
+#define CDROM_AUDIO_ERROR 0x14 /* audio play stopped due to error */
+#define CDROM_AUDIO_NO_STATUS 0x15 /* no current audio status to return */
+
+/* capability flags used with the uniform CD-ROM driver */
+#define CDC_CLOSE_TRAY 0x1 /* caddy systems _can't_ close */
+#define CDC_OPEN_TRAY 0x2 /* but _can_ eject. */
+#define CDC_LOCK 0x4 /* disable manual eject */
+#define CDC_SELECT_SPEED 0x8 /* programmable speed */
+#define CDC_SELECT_DISC 0x10 /* select disc from juke-box */
+#define CDC_MULTI_SESSION 0x20 /* read sessions>1 */
+#define CDC_MCN 0x40 /* Medium Catalog Number */
+#define CDC_MEDIA_CHANGED 0x80 /* media changed */
+#define CDC_PLAY_AUDIO 0x100 /* audio functions */
+#define CDC_RESET 0x200 /* hard reset device */
+#define CDC_DRIVE_STATUS 0x800 /* driver implements drive status */
+#define CDC_GENERIC_PACKET 0x1000 /* driver implements generic packets */
+#define CDC_CD_R 0x2000 /* drive is a CD-R */
+#define CDC_CD_RW 0x4000 /* drive is a CD-RW */
+#define CDC_DVD 0x8000 /* drive is a DVD */
+#define CDC_DVD_R 0x10000 /* drive can write DVD-R */
+#define CDC_DVD_RAM 0x20000 /* drive can write DVD-RAM */
+#define CDC_MO_DRIVE 0x40000 /* drive is an MO device */
+#define CDC_MRW 0x80000 /* drive can read MRW */
+#define CDC_MRW_W 0x100000 /* drive can write MRW */
+#define CDC_RAM 0x200000 /* ok to open for WRITE */
+
+/* drive status possibilities returned by CDROM_DRIVE_STATUS ioctl */
+#define CDS_NO_INFO 0 /* if not implemented */
+#define CDS_NO_DISC 1
+#define CDS_TRAY_OPEN 2
+#define CDS_DRIVE_NOT_READY 3
+#define CDS_DISC_OK 4
+
+/* return values for the CDROM_DISC_STATUS ioctl */
+/* can also return CDS_NO_[INFO|DISC], from above */
+#define CDS_AUDIO 100
+#define CDS_DATA_1 101
+#define CDS_DATA_2 102
+#define CDS_XA_2_1 103
+#define CDS_XA_2_2 104
+#define CDS_MIXED 105
+
+/* User-configurable behavior options for the uniform CD-ROM driver */
+#define CDO_AUTO_CLOSE 0x1 /* close tray on first open() */
+#define CDO_AUTO_EJECT 0x2 /* open tray on last release() */
+#define CDO_USE_FFLAGS 0x4 /* use O_NONBLOCK information on open */
+#define CDO_LOCK 0x8 /* lock tray on open files */
+#define CDO_CHECK_TYPE 0x10 /* check type on open for data */
+
+/* Special codes used when specifying changer slots. */
+#define CDSL_NONE (INT_MAX-1)
+#define CDSL_CURRENT INT_MAX
+
+/* For partition based multisession access. IDE can handle 64 partitions
+ * per drive - SCSI CD-ROM's use minors to differentiate between the
+ * various drives, so we can't do multisessions the same way there.
+ * Use the -o session=x option to mount on them.
+ */
+#define CD_PART_MAX 64
+#define CD_PART_MASK (CD_PART_MAX - 1)
+
+/*********************************************************************
+ * Generic Packet commands, MMC commands, and such
+ *********************************************************************/
+
+ /* The generic packet command opcodes for CD/DVD Logical Units,
+ * From Table 57 of the SFF8090 Ver. 3 (Mt. Fuji) draft standard. */
+#define GPCMD_BLANK 0xa1
+#define GPCMD_CLOSE_TRACK 0x5b
+#define GPCMD_FLUSH_CACHE 0x35
+#define GPCMD_FORMAT_UNIT 0x04
+#define GPCMD_GET_CONFIGURATION 0x46
+#define GPCMD_GET_EVENT_STATUS_NOTIFICATION 0x4a
+#define GPCMD_GET_PERFORMANCE 0xac
+#define GPCMD_INQUIRY 0x12
+#define GPCMD_LOAD_UNLOAD 0xa6
+#define GPCMD_MECHANISM_STATUS 0xbd
+#define GPCMD_MODE_SELECT_10 0x55
+#define GPCMD_MODE_SENSE_10 0x5a
+#define GPCMD_PAUSE_RESUME 0x4b
+#define GPCMD_PLAY_AUDIO_10 0x45
+#define GPCMD_PLAY_AUDIO_MSF 0x47
+#define GPCMD_PLAY_AUDIO_TI 0x48
+#define GPCMD_PLAY_CD 0xbc
+#define GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL 0x1e
+#define GPCMD_READ_10 0x28
+#define GPCMD_READ_12 0xa8
+#define GPCMD_READ_BUFFER_CAPACITY 0x5c
+#define GPCMD_READ_CDVD_CAPACITY 0x25
+#define GPCMD_READ_CD 0xbe
+#define GPCMD_READ_CD_MSF 0xb9
+#define GPCMD_READ_DISC_INFO 0x51
+#define GPCMD_READ_DVD_STRUCTURE 0xad
+#define GPCMD_READ_FORMAT_CAPACITIES 0x23
+#define GPCMD_READ_HEADER 0x44
+#define GPCMD_READ_TRACK_RZONE_INFO 0x52
+#define GPCMD_READ_SUBCHANNEL 0x42
+#define GPCMD_READ_TOC_PMA_ATIP 0x43
+#define GPCMD_REPAIR_RZONE_TRACK 0x58
+#define GPCMD_REPORT_KEY 0xa4
+#define GPCMD_REQUEST_SENSE 0x03
+#define GPCMD_RESERVE_RZONE_TRACK 0x53
+#define GPCMD_SEND_CUE_SHEET 0x5d
+#define GPCMD_SCAN 0xba
+#define GPCMD_SEEK 0x2b
+#define GPCMD_SEND_DVD_STRUCTURE 0xbf
+#define GPCMD_SEND_EVENT 0xa2
+#define GPCMD_SEND_KEY 0xa3
+#define GPCMD_SEND_OPC 0x54
+#define GPCMD_SET_READ_AHEAD 0xa7
+#define GPCMD_SET_STREAMING 0xb6
+#define GPCMD_START_STOP_UNIT 0x1b
+#define GPCMD_STOP_PLAY_SCAN 0x4e
+#define GPCMD_TEST_UNIT_READY 0x00
+#define GPCMD_VERIFY_10 0x2f
+#define GPCMD_WRITE_10 0x2a
+#define GPCMD_WRITE_AND_VERIFY_10 0x2e
+/* This is listed as optional in ATAPI 2.6, but is (curiously)
+ * missing from Mt. Fuji, Table 57. It _is_ mentioned in Mt. Fuji
+ * Table 377 as an MMC command for SCSi devices though... Most ATAPI
+ * drives support it. */
+#define GPCMD_SET_SPEED 0xbb
+/* This seems to be a SCSI specific CD-ROM opcode
+ * to play data at track/index */
+#define GPCMD_PLAYAUDIO_TI 0x48
+/*
+ * From MS Media Status Notification Support Specification. For
+ * older drives only.
+ */
+#define GPCMD_GET_MEDIA_STATUS 0xda
+
+/* Mode page codes for mode sense/set */
+#define GPMODE_VENDOR_PAGE 0x00
+#define GPMODE_R_W_ERROR_PAGE 0x01
+#define GPMODE_WRITE_PARMS_PAGE 0x05
+#define GPMODE_WCACHING_PAGE 0x08
+#define GPMODE_AUDIO_CTL_PAGE 0x0e
+#define GPMODE_POWER_PAGE 0x1a
+#define GPMODE_FAULT_FAIL_PAGE 0x1c
+#define GPMODE_TO_PROTECT_PAGE 0x1d
+#define GPMODE_CAPABILITIES_PAGE 0x2a
+#define GPMODE_ALL_PAGES 0x3f
+/* Not in Mt. Fuji, but in ATAPI 2.6 -- deprecated now in favor
+ * of MODE_SENSE_POWER_PAGE */
+#define GPMODE_CDROM_PAGE 0x0d
+
+
+
+/* DVD struct types */
+#define DVD_STRUCT_PHYSICAL 0x00
+#define DVD_STRUCT_COPYRIGHT 0x01
+#define DVD_STRUCT_DISCKEY 0x02
+#define DVD_STRUCT_BCA 0x03
+#define DVD_STRUCT_MANUFACT 0x04
+
+struct dvd_layer {
+ __u8 book_version : 4;
+ __u8 book_type : 4;
+ __u8 min_rate : 4;
+ __u8 disc_size : 4;
+ __u8 layer_type : 4;
+ __u8 track_path : 1;
+ __u8 nlayers : 2;
+ __u8 track_density : 4;
+ __u8 linear_density : 4;
+ __u8 bca : 1;
+ __u32 start_sector;
+ __u32 end_sector;
+ __u32 end_sector_l0;
+};
+
+#define DVD_LAYERS 4
+
+struct dvd_physical {
+ __u8 type;
+ __u8 layer_num;
+ struct dvd_layer layer[DVD_LAYERS];
+};
+
+struct dvd_copyright {
+ __u8 type;
+
+ __u8 layer_num;
+ __u8 cpst;
+ __u8 rmi;
+};
+
+struct dvd_disckey {
+ __u8 type;
+
+ unsigned agid : 2;
+ __u8 value[2048];
+};
+
+struct dvd_bca {
+ __u8 type;
+
+ int len;
+ __u8 value[188];
+};
+
+struct dvd_manufact {
+ __u8 type;
+
+ __u8 layer_num;
+ int len;
+ __u8 value[2048];
+};
+
+typedef union {
+ __u8 type;
+
+ struct dvd_physical physical;
+ struct dvd_copyright copyright;
+ struct dvd_disckey disckey;
+ struct dvd_bca bca;
+ struct dvd_manufact manufact;
+} dvd_struct;
+
+/*
+ * DVD authentication ioctl
+ */
+
+/* Authentication states */
+#define DVD_LU_SEND_AGID 0
+#define DVD_HOST_SEND_CHALLENGE 1
+#define DVD_LU_SEND_KEY1 2
+#define DVD_LU_SEND_CHALLENGE 3
+#define DVD_HOST_SEND_KEY2 4
+
+/* Termination states */
+#define DVD_AUTH_ESTABLISHED 5
+#define DVD_AUTH_FAILURE 6
+
+/* Other functions */
+#define DVD_LU_SEND_TITLE_KEY 7
+#define DVD_LU_SEND_ASF 8
+#define DVD_INVALIDATE_AGID 9
+#define DVD_LU_SEND_RPC_STATE 10
+#define DVD_HOST_SEND_RPC_STATE 11
+
+/* State data */
+typedef __u8 dvd_key[5]; /* 40-bit value, MSB is first elem. */
+typedef __u8 dvd_challenge[10]; /* 80-bit value, MSB is first elem. */
+
+struct dvd_lu_send_agid {
+ __u8 type;
+ unsigned agid : 2;
+};
+
+struct dvd_host_send_challenge {
+ __u8 type;
+ unsigned agid : 2;
+
+ dvd_challenge chal;
+};
+
+struct dvd_send_key {
+ __u8 type;
+ unsigned agid : 2;
+
+ dvd_key key;
+};
+
+struct dvd_lu_send_challenge {
+ __u8 type;
+ unsigned agid : 2;
+
+ dvd_challenge chal;
+};
+
+#define DVD_CPM_NO_COPYRIGHT 0
+#define DVD_CPM_COPYRIGHTED 1
+
+#define DVD_CP_SEC_NONE 0
+#define DVD_CP_SEC_EXIST 1
+
+#define DVD_CGMS_UNRESTRICTED 0
+#define DVD_CGMS_SINGLE 2
+#define DVD_CGMS_RESTRICTED 3
+
+struct dvd_lu_send_title_key {
+ __u8 type;
+ unsigned agid : 2;
+
+ dvd_key title_key;
+ int lba;
+ unsigned cpm : 1;
+ unsigned cp_sec : 1;
+ unsigned cgms : 2;
+};
+
+struct dvd_lu_send_asf {
+ __u8 type;
+ unsigned agid : 2;
+
+ unsigned asf : 1;
+};
+
+struct dvd_host_send_rpcstate {
+ __u8 type;
+ __u8 pdrc;
+};
+
+struct dvd_lu_send_rpcstate {
+ __u8 type : 2;
+ __u8 vra : 3;
+ __u8 ucca : 3;
+ __u8 region_mask;
+ __u8 rpc_scheme;
+};
+
+typedef union {
+ __u8 type;
+
+ struct dvd_lu_send_agid lsa;
+ struct dvd_host_send_challenge hsc;
+ struct dvd_send_key lsk;
+ struct dvd_lu_send_challenge lsc;
+ struct dvd_send_key hsk;
+ struct dvd_lu_send_title_key lstk;
+ struct dvd_lu_send_asf lsasf;
+ struct dvd_host_send_rpcstate hrpcs;
+ struct dvd_lu_send_rpcstate lrpcs;
+} dvd_authinfo;
+
+struct request_sense {
+#if defined(__BIG_ENDIAN_BITFIELD)
+ __u8 valid : 1;
+ __u8 error_code : 7;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 error_code : 7;
+ __u8 valid : 1;
+#endif
+ __u8 segment_number;
+#if defined(__BIG_ENDIAN_BITFIELD)
+ __u8 reserved1 : 2;
+ __u8 ili : 1;
+ __u8 reserved2 : 1;
+ __u8 sense_key : 4;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 sense_key : 4;
+ __u8 reserved2 : 1;
+ __u8 ili : 1;
+ __u8 reserved1 : 2;
+#endif
+ __u8 information[4];
+ __u8 add_sense_len;
+ __u8 command_info[4];
+ __u8 asc;
+ __u8 ascq;
+ __u8 fruc;
+ __u8 sks[3];
+ __u8 asb[46];
+};
+
+/*
+ * feature profile
+ */
+#define CDF_RWRT 0x0020 /* "Random Writable" */
+#define CDF_HWDM 0x0024 /* "Hardware Defect Management" */
+#define CDF_MRW 0x0028
+
+/*
+ * media status bits
+ */
+#define CDM_MRW_NOTMRW 0
+#define CDM_MRW_BGFORMAT_INACTIVE 1
+#define CDM_MRW_BGFORMAT_ACTIVE 2
+#define CDM_MRW_BGFORMAT_COMPLETE 3
+
+/*
+ * mrw address spaces
+ */
+#define MRW_LBA_DMA 0
+#define MRW_LBA_GAA 1
+
+/*
+ * mrw mode pages (first is deprecated) -- probed at init time and
+ * cdi->mrw_mode_page is set
+ */
+#define MRW_MODE_PC_PRE1 0x2c
+#define MRW_MODE_PC 0x03
+
+struct mrw_feature_desc {
+ __be16 feature_code;
+#if defined(__BIG_ENDIAN_BITFIELD)
+ __u8 reserved1 : 2;
+ __u8 feature_version : 4;
+ __u8 persistent : 1;
+ __u8 curr : 1;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 curr : 1;
+ __u8 persistent : 1;
+ __u8 feature_version : 4;
+ __u8 reserved1 : 2;
+#endif
+ __u8 add_len;
+#if defined(__BIG_ENDIAN_BITFIELD)
+ __u8 reserved2 : 7;
+ __u8 write : 1;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 write : 1;
+ __u8 reserved2 : 7;
+#endif
+ __u8 reserved3;
+ __u8 reserved4;
+ __u8 reserved5;
+};
+
+/* cf. mmc4r02g.pdf 5.3.10 Random Writable Feature (0020h) pg 197 of 635 */
+struct rwrt_feature_desc {
+ __be16 feature_code;
+#if defined(__BIG_ENDIAN_BITFIELD)
+ __u8 reserved1 : 2;
+ __u8 feature_version : 4;
+ __u8 persistent : 1;
+ __u8 curr : 1;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 curr : 1;
+ __u8 persistent : 1;
+ __u8 feature_version : 4;
+ __u8 reserved1 : 2;
+#endif
+ __u8 add_len;
+ __u32 last_lba;
+ __u32 block_size;
+ __u16 blocking;
+#if defined(__BIG_ENDIAN_BITFIELD)
+ __u8 reserved2 : 7;
+ __u8 page_present : 1;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 page_present : 1;
+ __u8 reserved2 : 7;
+#endif
+ __u8 reserved3;
+};
+
+typedef struct {
+ __be16 disc_information_length;
+#if defined(__BIG_ENDIAN_BITFIELD)
+ __u8 reserved1 : 3;
+ __u8 erasable : 1;
+ __u8 border_status : 2;
+ __u8 disc_status : 2;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 disc_status : 2;
+ __u8 border_status : 2;
+ __u8 erasable : 1;
+ __u8 reserved1 : 3;
+#else
+#error "Please fix <asm/byteorder.h>"
+#endif
+ __u8 n_first_track;
+ __u8 n_sessions_lsb;
+ __u8 first_track_lsb;
+ __u8 last_track_lsb;
+#if defined(__BIG_ENDIAN_BITFIELD)
+ __u8 did_v : 1;
+ __u8 dbc_v : 1;
+ __u8 uru : 1;
+ __u8 reserved2 : 2;
+ __u8 dbit : 1;
+ __u8 mrw_status : 2;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 mrw_status : 2;
+ __u8 dbit : 1;
+ __u8 reserved2 : 2;
+ __u8 uru : 1;
+ __u8 dbc_v : 1;
+ __u8 did_v : 1;
+#endif
+ __u8 disc_type;
+ __u8 n_sessions_msb;
+ __u8 first_track_msb;
+ __u8 last_track_msb;
+ __u32 disc_id;
+ __u32 lead_in;
+ __u32 lead_out;
+ __u8 disc_bar_code[8];
+ __u8 reserved3;
+ __u8 n_opc;
+} disc_information;
+
+typedef struct {
+ __be16 track_information_length;
+ __u8 track_lsb;
+ __u8 session_lsb;
+ __u8 reserved1;
+#if defined(__BIG_ENDIAN_BITFIELD)
+ __u8 reserved2 : 2;
+ __u8 damage : 1;
+ __u8 copy : 1;
+ __u8 track_mode : 4;
+ __u8 rt : 1;
+ __u8 blank : 1;
+ __u8 packet : 1;
+ __u8 fp : 1;
+ __u8 data_mode : 4;
+ __u8 reserved3 : 6;
+ __u8 lra_v : 1;
+ __u8 nwa_v : 1;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 track_mode : 4;
+ __u8 copy : 1;
+ __u8 damage : 1;
+ __u8 reserved2 : 2;
+ __u8 data_mode : 4;
+ __u8 fp : 1;
+ __u8 packet : 1;
+ __u8 blank : 1;
+ __u8 rt : 1;
+ __u8 nwa_v : 1;
+ __u8 lra_v : 1;
+ __u8 reserved3 : 6;
+#endif
+ __be32 track_start;
+ __be32 next_writable;
+ __be32 free_blocks;
+ __be32 fixed_packet_size;
+ __be32 track_size;
+ __be32 last_rec_address;
+} track_information;
+
+struct feature_header {
+ __u32 data_len;
+ __u8 reserved1;
+ __u8 reserved2;
+ __u16 curr_profile;
+};
+
+struct mode_page_header {
+ __be16 mode_data_length;
+ __u8 medium_type;
+ __u8 reserved1;
+ __u8 reserved2;
+ __u8 reserved3;
+ __be16 desc_length;
+};
+
+
+#endif /* _LINUX_CDROM_H */
diff --git a/sysroot/usr/include/linux/cgroupstats.h b/sysroot/usr/include/linux/cgroupstats.h
new file mode 100644
index 0000000..4f53abf
--- /dev/null
+++ b/sysroot/usr/include/linux/cgroupstats.h
@@ -0,0 +1,70 @@
+/* cgroupstats.h - exporting per-cgroup statistics
+ *
+ * Copyright IBM Corporation, 2007
+ * Author Balbir Singh <balbir@linux.vnet.ibm.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2.1 of the GNU Lesser General Public License
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+#ifndef _LINUX_CGROUPSTATS_H
+#define _LINUX_CGROUPSTATS_H
+
+#include <linux/taskstats.h>
+
+/*
+ * Data shared between user space and kernel space on a per cgroup
+ * basis. This data is shared using taskstats.
+ *
+ * Most of these states are derived by looking at the task->state value
+ * For the nr_io_wait state, a flag in the delay accounting structure
+ * indicates that the task is waiting on IO
+ *
+ * Each member is aligned to a 8 byte boundary.
+ */
+struct cgroupstats {
+ __u64 nr_sleeping; /* Number of tasks sleeping */
+ __u64 nr_running; /* Number of tasks running */
+ __u64 nr_stopped; /* Number of tasks in stopped state */
+ __u64 nr_uninterruptible; /* Number of tasks in uninterruptible */
+ /* state */
+ __u64 nr_io_wait; /* Number of tasks waiting on IO */
+};
+
+/*
+ * Commands sent from userspace
+ * Not versioned. New commands should only be inserted at the enum's end
+ * prior to __CGROUPSTATS_CMD_MAX
+ */
+
+enum {
+ CGROUPSTATS_CMD_UNSPEC = __TASKSTATS_CMD_MAX, /* Reserved */
+ CGROUPSTATS_CMD_GET, /* user->kernel request/get-response */
+ CGROUPSTATS_CMD_NEW, /* kernel->user event */
+ __CGROUPSTATS_CMD_MAX,
+};
+
+#define CGROUPSTATS_CMD_MAX (__CGROUPSTATS_CMD_MAX - 1)
+
+enum {
+ CGROUPSTATS_TYPE_UNSPEC = 0, /* Reserved */
+ CGROUPSTATS_TYPE_CGROUP_STATS, /* contains name + stats */
+ __CGROUPSTATS_TYPE_MAX,
+};
+
+#define CGROUPSTATS_TYPE_MAX (__CGROUPSTATS_TYPE_MAX - 1)
+
+enum {
+ CGROUPSTATS_CMD_ATTR_UNSPEC = 0,
+ CGROUPSTATS_CMD_ATTR_FD,
+ __CGROUPSTATS_CMD_ATTR_MAX,
+};
+
+#define CGROUPSTATS_CMD_ATTR_MAX (__CGROUPSTATS_CMD_ATTR_MAX - 1)
+
+#endif /* _LINUX_CGROUPSTATS_H */
diff --git a/sysroot/usr/include/linux/chio.h b/sysroot/usr/include/linux/chio.h
new file mode 100644
index 0000000..63035ae
--- /dev/null
+++ b/sysroot/usr/include/linux/chio.h
@@ -0,0 +1,168 @@
+/*
+ * ioctl interface for the scsi media changer driver
+ */
+
+/* changer element types */
+#define CHET_MT 0 /* media transport element (robot) */
+#define CHET_ST 1 /* storage element (media slots) */
+#define CHET_IE 2 /* import/export element */
+#define CHET_DT 3 /* data transfer element (tape/cdrom/whatever) */
+#define CHET_V1 4 /* vendor specific #1 */
+#define CHET_V2 5 /* vendor specific #2 */
+#define CHET_V3 6 /* vendor specific #3 */
+#define CHET_V4 7 /* vendor specific #4 */
+
+
+/*
+ * CHIOGPARAMS
+ * query changer properties
+ *
+ * CHIOVGPARAMS
+ * query vendor-specific element types
+ *
+ * accessing elements works by specifing type and unit of the element.
+ * for eample, storage elements are addressed with type = CHET_ST and
+ * unit = 0 .. cp_nslots-1
+ *
+ */
+struct changer_params {
+ int cp_curpicker; /* current transport element */
+ int cp_npickers; /* number of transport elements (CHET_MT) */
+ int cp_nslots; /* number of storage elements (CHET_ST) */
+ int cp_nportals; /* number of import/export elements (CHET_IE) */
+ int cp_ndrives; /* number of data transfer elements (CHET_DT) */
+};
+struct changer_vendor_params {
+ int cvp_n1; /* number of vendor specific elems (CHET_V1) */
+ char cvp_label1[16];
+ int cvp_n2; /* number of vendor specific elems (CHET_V2) */
+ char cvp_label2[16];
+ int cvp_n3; /* number of vendor specific elems (CHET_V3) */
+ char cvp_label3[16];
+ int cvp_n4; /* number of vendor specific elems (CHET_V4) */
+ char cvp_label4[16];
+ int reserved[8];
+};
+
+
+/*
+ * CHIOMOVE
+ * move a medium from one element to another
+ */
+struct changer_move {
+ int cm_fromtype; /* type/unit of source element */
+ int cm_fromunit;
+ int cm_totype; /* type/unit of destination element */
+ int cm_tounit;
+ int cm_flags;
+};
+#define CM_INVERT 1 /* flag: rotate media (for double-sided like MOD) */
+
+
+/*
+ * CHIOEXCHANGE
+ * move one medium from element #1 to element #2,
+ * and another one from element #2 to element #3.
+ * element #1 and #3 are allowed to be identical.
+ */
+struct changer_exchange {
+ int ce_srctype; /* type/unit of element #1 */
+ int ce_srcunit;
+ int ce_fdsttype; /* type/unit of element #2 */
+ int ce_fdstunit;
+ int ce_sdsttype; /* type/unit of element #3 */
+ int ce_sdstunit;
+ int ce_flags;
+};
+#define CE_INVERT1 1
+#define CE_INVERT2 2
+
+
+/*
+ * CHIOPOSITION
+ * move the transport element (robot arm) to a specific element.
+ */
+struct changer_position {
+ int cp_type;
+ int cp_unit;
+ int cp_flags;
+};
+#define CP_INVERT 1
+
+
+/*
+ * CHIOGSTATUS
+ * get element status for all elements of a specific type
+ */
+struct changer_element_status {
+ int ces_type;
+ unsigned char *ces_data;
+};
+#define CESTATUS_FULL 0x01 /* full */
+#define CESTATUS_IMPEXP 0x02 /* media was imported (inserted by sysop) */
+#define CESTATUS_EXCEPT 0x04 /* error condition */
+#define CESTATUS_ACCESS 0x08 /* access allowed */
+#define CESTATUS_EXENAB 0x10 /* element can export media */
+#define CESTATUS_INENAB 0x20 /* element can import media */
+
+
+/*
+ * CHIOGELEM
+ * get more detailed status informtion for a single element
+ */
+struct changer_get_element {
+ int cge_type; /* type/unit */
+ int cge_unit;
+ int cge_status; /* status */
+ int cge_errno; /* errno */
+ int cge_srctype; /* source element of the last move/exchange */
+ int cge_srcunit;
+ int cge_id; /* scsi id (for data transfer elements) */
+ int cge_lun; /* scsi lun (for data transfer elements) */
+ char cge_pvoltag[36]; /* primary volume tag */
+ char cge_avoltag[36]; /* alternate volume tag */
+ int cge_flags;
+};
+/* flags */
+#define CGE_ERRNO 0x01 /* errno available */
+#define CGE_INVERT 0x02 /* media inverted */
+#define CGE_SRC 0x04 /* media src available */
+#define CGE_IDLUN 0x08 /* ID+LUN available */
+#define CGE_PVOLTAG 0x10 /* primary volume tag available */
+#define CGE_AVOLTAG 0x20 /* alternate volume tag available */
+
+
+/*
+ * CHIOSVOLTAG
+ * set volume tag
+ */
+struct changer_set_voltag {
+ int csv_type; /* type/unit */
+ int csv_unit;
+ char csv_voltag[36]; /* volume tag */
+ int csv_flags;
+};
+#define CSV_PVOLTAG 0x01 /* primary volume tag */
+#define CSV_AVOLTAG 0x02 /* alternate volume tag */
+#define CSV_CLEARTAG 0x04 /* clear volume tag */
+
+/* ioctls */
+#define CHIOMOVE _IOW('c', 1,struct changer_move)
+#define CHIOEXCHANGE _IOW('c', 2,struct changer_exchange)
+#define CHIOPOSITION _IOW('c', 3,struct changer_position)
+#define CHIOGPICKER _IOR('c', 4,int) /* not impl. */
+#define CHIOSPICKER _IOW('c', 5,int) /* not impl. */
+#define CHIOGPARAMS _IOR('c', 6,struct changer_params)
+#define CHIOGSTATUS _IOW('c', 8,struct changer_element_status)
+#define CHIOGELEM _IOW('c',16,struct changer_get_element)
+#define CHIOINITELEM _IO('c',17)
+#define CHIOSVOLTAG _IOW('c',18,struct changer_set_voltag)
+#define CHIOGVPARAMS _IOR('c',19,struct changer_vendor_params)
+
+/* ---------------------------------------------------------------------- */
+
+/*
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */
diff --git a/sysroot/usr/include/linux/cm4000_cs.h b/sysroot/usr/include/linux/cm4000_cs.h
new file mode 100644
index 0000000..21b8904
--- /dev/null
+++ b/sysroot/usr/include/linux/cm4000_cs.h
@@ -0,0 +1,60 @@
+#ifndef _CM4000_H_
+#define _CM4000_H_
+
+#define MAX_ATR 33
+
+#define CM4000_MAX_DEV 4
+
+/* those two structures are passed via ioctl() from/to userspace. They are
+ * used by existing userspace programs, so I kepth the awkward "bIFSD" naming
+ * not to break compilation of userspace apps. -HW */
+
+typedef struct atreq {
+ int32_t atr_len;
+ unsigned char atr[64];
+ int32_t power_act;
+ unsigned char bIFSD;
+ unsigned char bIFSC;
+} atreq_t;
+
+
+/* what is particularly stupid in the original driver is the arch-dependant
+ * member sizes. This leads to CONFIG_COMPAT breakage, since 32bit userspace
+ * will lay out the structure members differently than the 64bit kernel.
+ *
+ * I've changed "ptsreq.protocol" from "unsigned long" to "u_int32_t".
+ * On 32bit this will make no difference. With 64bit kernels, it will make
+ * 32bit apps work, too.
+ */
+
+typedef struct ptsreq {
+ u_int32_t protocol; /*T=0: 2^0, T=1: 2^1*/
+ unsigned char flags;
+ unsigned char pts1;
+ unsigned char pts2;
+ unsigned char pts3;
+} ptsreq_t;
+
+#define CM_IOC_MAGIC 'c'
+#define CM_IOC_MAXNR 255
+
+#define CM_IOCGSTATUS _IOR (CM_IOC_MAGIC, 0, unsigned char *)
+#define CM_IOCGATR _IOWR(CM_IOC_MAGIC, 1, atreq_t *)
+#define CM_IOCSPTS _IOW (CM_IOC_MAGIC, 2, ptsreq_t *)
+#define CM_IOCSRDR _IO (CM_IOC_MAGIC, 3)
+#define CM_IOCARDOFF _IO (CM_IOC_MAGIC, 4)
+
+#define CM_IOSDBGLVL _IOW(CM_IOC_MAGIC, 250, int*)
+
+/* card and device states */
+#define CM_CARD_INSERTED 0x01
+#define CM_CARD_POWERED 0x02
+#define CM_ATR_PRESENT 0x04
+#define CM_ATR_VALID 0x08
+#define CM_STATE_VALID 0x0f
+/* extra info only from CM4000 */
+#define CM_NO_READER 0x10
+#define CM_BAD_CARD 0x20
+
+
+#endif /* _CM4000_H_ */
diff --git a/sysroot/usr/include/linux/cn_proc.h b/sysroot/usr/include/linux/cn_proc.h
new file mode 100644
index 0000000..1ff6354
--- /dev/null
+++ b/sysroot/usr/include/linux/cn_proc.h
@@ -0,0 +1,100 @@
+/*
+ * cn_proc.h - process events connector
+ *
+ * Copyright (C) Matt Helsley, IBM Corp. 2005
+ * Based on cn_fork.h by Nguyen Anh Quynh and Guillaume Thouvenin
+ * Copyright (C) 2005 Nguyen Anh Quynh <aquynh@gmail.com>
+ * Copyright (C) 2005 Guillaume Thouvenin <guillaume.thouvenin@bull.net>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2.1 of the GNU Lesser General Public License
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+#ifndef CN_PROC_H
+#define CN_PROC_H
+
+#include <linux/types.h>
+
+/*
+ * Userspace sends this enum to register with the kernel that it is listening
+ * for events on the connector.
+ */
+enum proc_cn_mcast_op {
+ PROC_CN_MCAST_LISTEN = 1,
+ PROC_CN_MCAST_IGNORE = 2
+};
+
+/*
+ * From the user's point of view, the process
+ * ID is the thread group ID and thread ID is the internal
+ * kernel "pid". So, fields are assigned as follow:
+ *
+ * In user space - In kernel space
+ *
+ * parent process ID = parent->tgid
+ * parent thread ID = parent->pid
+ * child process ID = child->tgid
+ * child thread ID = child->pid
+ */
+
+struct proc_event {
+ enum what {
+ /* Use successive bits so the enums can be used to record
+ * sets of events as well
+ */
+ PROC_EVENT_NONE = 0x00000000,
+ PROC_EVENT_FORK = 0x00000001,
+ PROC_EVENT_EXEC = 0x00000002,
+ PROC_EVENT_UID = 0x00000004,
+ PROC_EVENT_GID = 0x00000040,
+ /* "next" should be 0x00000400 */
+ /* "last" is the last process event: exit */
+ PROC_EVENT_EXIT = 0x80000000
+ } what;
+ __u32 cpu;
+ __u64 __attribute__((aligned(8))) timestamp_ns;
+ /* Number of nano seconds since system boot */
+ union { /* must be last field of proc_event struct */
+ struct {
+ __u32 err;
+ } ack;
+
+ struct fork_proc_event {
+ pid_t parent_pid;
+ pid_t parent_tgid;
+ pid_t child_pid;
+ pid_t child_tgid;
+ } fork;
+
+ struct exec_proc_event {
+ pid_t process_pid;
+ pid_t process_tgid;
+ } exec;
+
+ struct id_proc_event {
+ pid_t process_pid;
+ pid_t process_tgid;
+ union {
+ __u32 ruid; /* task uid */
+ __u32 rgid; /* task gid */
+ } r;
+ union {
+ __u32 euid;
+ __u32 egid;
+ } e;
+ } id;
+
+ struct exit_proc_event {
+ pid_t process_pid;
+ pid_t process_tgid;
+ __u32 exit_code, exit_signal;
+ } exit;
+ } event_data;
+};
+
+#endif /* CN_PROC_H */
diff --git a/sysroot/usr/include/linux/coda.h b/sysroot/usr/include/linux/coda.h
new file mode 100644
index 0000000..59f1c84
--- /dev/null
+++ b/sysroot/usr/include/linux/coda.h
@@ -0,0 +1,780 @@
+/*
+ You may distribute this file under either of the two licenses that
+ follow at your discretion.
+*/
+
+/* BLURB lgpl
+
+ Coda File System
+ Release 5
+
+ Copyright (c) 1987-1999 Carnegie Mellon University
+ Additional copyrights listed below
+
+This code is distributed "AS IS" without warranty of any kind under
+the terms of the GNU Library General Public Licence Version 2, as
+shown in the file LICENSE, or under the license shown below. The
+technical and financial contributors to Coda are listed in the file
+CREDITS.
+
+ Additional copyrights
+*/
+
+/*
+
+ Coda: an Experimental Distributed File System
+ Release 4.0
+
+ Copyright (c) 1987-1999 Carnegie Mellon University
+ All Rights Reserved
+
+Permission to use, copy, modify and distribute this software and its
+documentation is hereby granted, provided that both the copyright
+notice and this permission notice appear in all copies of the
+software, derivative works or modified versions, and any portions
+thereof, and that both notices appear in supporting documentation, and
+that credit is given to Carnegie Mellon University in all documents
+and publicity pertaining to direct or indirect use of this code or its
+derivatives.
+
+CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
+SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
+FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
+DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
+RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
+ANY DERIVATIVE WORK.
+
+Carnegie Mellon encourages users of this software to return any
+improvements or extensions that they make, and to grant Carnegie
+Mellon the rights to redistribute these changes without encumbrance.
+*/
+
+/*
+ *
+ * Based on cfs.h from Mach, but revamped for increased simplicity.
+ * Linux modifications by
+ * Peter Braam, Aug 1996
+ */
+
+#ifndef _CODA_HEADER_
+#define _CODA_HEADER_
+
+
+/* Catch new _KERNEL defn for NetBSD and DJGPP/__CYGWIN32__ */
+#if defined(__NetBSD__) || \
+ ((defined(DJGPP) || defined(__CYGWIN32__)) && !defined(KERNEL))
+#include <sys/types.h>
+#endif
+
+#ifndef CODA_MAXSYMLINKS
+#define CODA_MAXSYMLINKS 10
+#endif
+
+#if defined(DJGPP) || defined(__CYGWIN32__)
+#ifdef KERNEL
+typedef unsigned long u_long;
+typedef unsigned int u_int;
+typedef unsigned short u_short;
+typedef u_long ino_t;
+typedef u_long dev_t;
+typedef void * caddr_t;
+#ifdef DOS
+typedef unsigned __int64 u_quad_t;
+#else
+typedef unsigned long long u_quad_t;
+#endif
+
+#define inline
+
+struct timespec {
+ long ts_sec;
+ long ts_nsec;
+};
+#else /* DJGPP but not KERNEL */
+#include <sys/time.h>
+typedef unsigned long long u_quad_t;
+#endif /* !KERNEL */
+#endif /* !DJGPP */
+
+
+#if defined(__linux__)
+#include <linux/time.h>
+#define cdev_t u_quad_t
+#if !defined(_UQUAD_T_) && (!defined(__GLIBC__) || __GLIBC__ < 2)
+#define _UQUAD_T_ 1
+typedef unsigned long long u_quad_t;
+#endif
+#else
+#define cdev_t dev_t
+#endif
+
+#ifdef __CYGWIN32__
+struct timespec {
+ time_t tv_sec; /* seconds */
+ long tv_nsec; /* nanoseconds */
+};
+#endif
+
+#ifndef __BIT_TYPES_DEFINED__
+#define __BIT_TYPES_DEFINED__
+typedef signed char int8_t;
+typedef unsigned char u_int8_t;
+typedef short int16_t;
+typedef unsigned short u_int16_t;
+typedef int int32_t;
+typedef unsigned int u_int32_t;
+#endif
+
+
+/*
+ * Cfs constants
+ */
+#define CODA_MAXNAMLEN 255
+#define CODA_MAXPATHLEN 1024
+#define CODA_MAXSYMLINK 10
+
+/* these are Coda's version of O_RDONLY etc combinations
+ * to deal with VFS open modes
+ */
+#define C_O_READ 0x001
+#define C_O_WRITE 0x002
+#define C_O_TRUNC 0x010
+#define C_O_EXCL 0x100
+#define C_O_CREAT 0x200
+
+/* these are to find mode bits in Venus */
+#define C_M_READ 00400
+#define C_M_WRITE 00200
+
+/* for access Venus will use */
+#define C_A_C_OK 8 /* Test for writing upon create. */
+#define C_A_R_OK 4 /* Test for read permission. */
+#define C_A_W_OK 2 /* Test for write permission. */
+#define C_A_X_OK 1 /* Test for execute permission. */
+#define C_A_F_OK 0 /* Test for existence. */
+
+
+
+#ifndef _VENUS_DIRENT_T_
+#define _VENUS_DIRENT_T_ 1
+struct venus_dirent {
+ u_int32_t d_fileno; /* file number of entry */
+ u_int16_t d_reclen; /* length of this record */
+ u_int8_t d_type; /* file type, see below */
+ u_int8_t d_namlen; /* length of string in d_name */
+ char d_name[CODA_MAXNAMLEN + 1];/* name must be no longer than this */
+};
+#undef DIRSIZ
+#define DIRSIZ(dp) ((sizeof (struct venus_dirent) - (CODA_MAXNAMLEN+1)) + \
+ (((dp)->d_namlen+1 + 3) &~ 3))
+
+/*
+ * File types
+ */
+#define CDT_UNKNOWN 0
+#define CDT_FIFO 1
+#define CDT_CHR 2
+#define CDT_DIR 4
+#define CDT_BLK 6
+#define CDT_REG 8
+#define CDT_LNK 10
+#define CDT_SOCK 12
+#define CDT_WHT 14
+
+/*
+ * Convert between stat structure types and directory types.
+ */
+#define IFTOCDT(mode) (((mode) & 0170000) >> 12)
+#define CDTTOIF(dirtype) ((dirtype) << 12)
+
+#endif
+
+#ifndef _VUID_T_
+#define _VUID_T_
+typedef u_int32_t vuid_t;
+typedef u_int32_t vgid_t;
+#endif /*_VUID_T_ */
+
+#ifdef CONFIG_CODA_FS_OLD_API
+struct CodaFid {
+ u_int32_t opaque[3];
+};
+
+static __inline__ ino_t coda_f2i(struct CodaFid *fid)
+{
+ if ( ! fid )
+ return 0;
+ if (fid->opaque[1] == 0xfffffffe || fid->opaque[1] == 0xffffffff)
+ return ((fid->opaque[0] << 20) | (fid->opaque[2] & 0xfffff));
+ else
+ return (fid->opaque[2] + (fid->opaque[1]<<10) + (fid->opaque[0]<<20));
+}
+
+struct coda_cred {
+ vuid_t cr_uid, cr_euid, cr_suid, cr_fsuid; /* Real, efftve, set, fs uid*/
+ vgid_t cr_groupid, cr_egid, cr_sgid, cr_fsgid; /* same for groups */
+};
+
+#else /* not defined(CONFIG_CODA_FS_OLD_API) */
+
+struct CodaFid {
+ u_int32_t opaque[4];
+};
+
+#define coda_f2i(fid)\
+ (fid ? (fid->opaque[3] ^ (fid->opaque[2]<<10) ^ (fid->opaque[1]<<20) ^ fid->opaque[0]) : 0)
+
+#endif
+
+#ifndef _VENUS_VATTR_T_
+#define _VENUS_VATTR_T_
+/*
+ * Vnode types. VNON means no type.
+ */
+enum coda_vtype { C_VNON, C_VREG, C_VDIR, C_VBLK, C_VCHR, C_VLNK, C_VSOCK, C_VFIFO, C_VBAD };
+
+struct coda_vattr {
+ long va_type; /* vnode type (for create) */
+ u_short va_mode; /* files access mode and type */
+ short va_nlink; /* number of references to file */
+ vuid_t va_uid; /* owner user id */
+ vgid_t va_gid; /* owner group id */
+ long va_fileid; /* file id */
+ u_quad_t va_size; /* file size in bytes */
+ long va_blocksize; /* blocksize preferred for i/o */
+ struct timespec va_atime; /* time of last access */
+ struct timespec va_mtime; /* time of last modification */
+ struct timespec va_ctime; /* time file changed */
+ u_long va_gen; /* generation number of file */
+ u_long va_flags; /* flags defined for file */
+ cdev_t va_rdev; /* device special file represents */
+ u_quad_t va_bytes; /* bytes of disk space held by file */
+ u_quad_t va_filerev; /* file modification number */
+};
+
+#endif
+
+/* structure used by CODA_STATFS for getting cache information from venus */
+struct coda_statfs {
+ int32_t f_blocks;
+ int32_t f_bfree;
+ int32_t f_bavail;
+ int32_t f_files;
+ int32_t f_ffree;
+};
+
+/*
+ * Kernel <--> Venus communications.
+ */
+
+#define CODA_ROOT 2
+#define CODA_OPEN_BY_FD 3
+#define CODA_OPEN 4
+#define CODA_CLOSE 5
+#define CODA_IOCTL 6
+#define CODA_GETATTR 7
+#define CODA_SETATTR 8
+#define CODA_ACCESS 9
+#define CODA_LOOKUP 10
+#define CODA_CREATE 11
+#define CODA_REMOVE 12
+#define CODA_LINK 13
+#define CODA_RENAME 14
+#define CODA_MKDIR 15
+#define CODA_RMDIR 16
+#define CODA_SYMLINK 18
+#define CODA_READLINK 19
+#define CODA_FSYNC 20
+#define CODA_VGET 22
+#define CODA_SIGNAL 23
+#define CODA_REPLACE 24 /* DOWNCALL */
+#define CODA_FLUSH 25 /* DOWNCALL */
+#define CODA_PURGEUSER 26 /* DOWNCALL */
+#define CODA_ZAPFILE 27 /* DOWNCALL */
+#define CODA_ZAPDIR 28 /* DOWNCALL */
+#define CODA_PURGEFID 30 /* DOWNCALL */
+#define CODA_OPEN_BY_PATH 31
+#define CODA_RESOLVE 32
+#define CODA_REINTEGRATE 33
+#define CODA_STATFS 34
+#define CODA_STORE 35
+#define CODA_RELEASE 36
+#define CODA_NCALLS 37
+
+#define DOWNCALL(opcode) (opcode >= CODA_REPLACE && opcode <= CODA_PURGEFID)
+
+#define VC_MAXDATASIZE 8192
+#define VC_MAXMSGSIZE sizeof(union inputArgs)+sizeof(union outputArgs) +\
+ VC_MAXDATASIZE
+
+#define CIOC_KERNEL_VERSION _IOWR('c', 10, size_t)
+
+#if 0
+#define CODA_KERNEL_VERSION 0 /* don't care about kernel version number */
+#define CODA_KERNEL_VERSION 1 /* The old venus 4.6 compatible interface */
+#endif
+#ifdef CONFIG_CODA_FS_OLD_API
+#define CODA_KERNEL_VERSION 2 /* venus_lookup got an extra parameter */
+#else
+#define CODA_KERNEL_VERSION 3 /* 128-bit file identifiers */
+#endif
+
+/*
+ * Venus <-> Coda RPC arguments
+ */
+struct coda_in_hdr {
+ u_int32_t opcode;
+ u_int32_t unique; /* Keep multiple outstanding msgs distinct */
+#ifdef CONFIG_CODA_FS_OLD_API
+ u_int16_t pid; /* Common to all */
+ u_int16_t pgid; /* Common to all */
+ u_int16_t sid; /* Common to all */
+ struct coda_cred cred; /* Common to all */
+#else
+ pid_t pid;
+ pid_t pgid;
+ vuid_t uid;
+#endif
+};
+
+/* Really important that opcode and unique are 1st two fields! */
+struct coda_out_hdr {
+ u_int32_t opcode;
+ u_int32_t unique;
+ u_int32_t result;
+};
+
+/* coda_root: NO_IN */
+struct coda_root_out {
+ struct coda_out_hdr oh;
+ struct CodaFid VFid;
+};
+
+struct coda_root_in {
+ struct coda_in_hdr in;
+};
+
+/* coda_open: */
+struct coda_open_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ int flags;
+};
+
+struct coda_open_out {
+ struct coda_out_hdr oh;
+ cdev_t dev;
+ ino_t inode;
+};
+
+
+/* coda_store: */
+struct coda_store_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ int flags;
+};
+
+struct coda_store_out {
+ struct coda_out_hdr out;
+};
+
+/* coda_release: */
+struct coda_release_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ int flags;
+};
+
+struct coda_release_out {
+ struct coda_out_hdr out;
+};
+
+/* coda_close: */
+struct coda_close_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ int flags;
+};
+
+struct coda_close_out {
+ struct coda_out_hdr out;
+};
+
+/* coda_ioctl: */
+struct coda_ioctl_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ int cmd;
+ int len;
+ int rwflag;
+ char *data; /* Place holder for data. */
+};
+
+struct coda_ioctl_out {
+ struct coda_out_hdr oh;
+ int len;
+ caddr_t data; /* Place holder for data. */
+};
+
+
+/* coda_getattr: */
+struct coda_getattr_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+};
+
+struct coda_getattr_out {
+ struct coda_out_hdr oh;
+ struct coda_vattr attr;
+};
+
+
+/* coda_setattr: NO_OUT */
+struct coda_setattr_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ struct coda_vattr attr;
+};
+
+struct coda_setattr_out {
+ struct coda_out_hdr out;
+};
+
+/* coda_access: NO_OUT */
+struct coda_access_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ int flags;
+};
+
+struct coda_access_out {
+ struct coda_out_hdr out;
+};
+
+
+/* lookup flags */
+#define CLU_CASE_SENSITIVE 0x01
+#define CLU_CASE_INSENSITIVE 0x02
+
+/* coda_lookup: */
+struct coda_lookup_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ int name; /* Place holder for data. */
+ int flags;
+};
+
+struct coda_lookup_out {
+ struct coda_out_hdr oh;
+ struct CodaFid VFid;
+ int vtype;
+};
+
+
+/* coda_create: */
+struct coda_create_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ struct coda_vattr attr;
+ int excl;
+ int mode;
+ int name; /* Place holder for data. */
+};
+
+struct coda_create_out {
+ struct coda_out_hdr oh;
+ struct CodaFid VFid;
+ struct coda_vattr attr;
+};
+
+
+/* coda_remove: NO_OUT */
+struct coda_remove_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ int name; /* Place holder for data. */
+};
+
+struct coda_remove_out {
+ struct coda_out_hdr out;
+};
+
+/* coda_link: NO_OUT */
+struct coda_link_in {
+ struct coda_in_hdr ih;
+ struct CodaFid sourceFid; /* cnode to link *to* */
+ struct CodaFid destFid; /* Directory in which to place link */
+ int tname; /* Place holder for data. */
+};
+
+struct coda_link_out {
+ struct coda_out_hdr out;
+};
+
+
+/* coda_rename: NO_OUT */
+struct coda_rename_in {
+ struct coda_in_hdr ih;
+ struct CodaFid sourceFid;
+ int srcname;
+ struct CodaFid destFid;
+ int destname;
+};
+
+struct coda_rename_out {
+ struct coda_out_hdr out;
+};
+
+/* coda_mkdir: */
+struct coda_mkdir_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ struct coda_vattr attr;
+ int name; /* Place holder for data. */
+};
+
+struct coda_mkdir_out {
+ struct coda_out_hdr oh;
+ struct CodaFid VFid;
+ struct coda_vattr attr;
+};
+
+
+/* coda_rmdir: NO_OUT */
+struct coda_rmdir_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ int name; /* Place holder for data. */
+};
+
+struct coda_rmdir_out {
+ struct coda_out_hdr out;
+};
+
+/* coda_symlink: NO_OUT */
+struct coda_symlink_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid; /* Directory to put symlink in */
+ int srcname;
+ struct coda_vattr attr;
+ int tname;
+};
+
+struct coda_symlink_out {
+ struct coda_out_hdr out;
+};
+
+/* coda_readlink: */
+struct coda_readlink_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+};
+
+struct coda_readlink_out {
+ struct coda_out_hdr oh;
+ int count;
+ caddr_t data; /* Place holder for data. */
+};
+
+
+/* coda_fsync: NO_OUT */
+struct coda_fsync_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+};
+
+struct coda_fsync_out {
+ struct coda_out_hdr out;
+};
+
+/* coda_vget: */
+struct coda_vget_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+};
+
+struct coda_vget_out {
+ struct coda_out_hdr oh;
+ struct CodaFid VFid;
+ int vtype;
+};
+
+
+/* CODA_SIGNAL is out-of-band, doesn't need data. */
+/* CODA_INVALIDATE is a venus->kernel call */
+/* CODA_FLUSH is a venus->kernel call */
+
+/* coda_purgeuser: */
+/* CODA_PURGEUSER is a venus->kernel call */
+struct coda_purgeuser_out {
+ struct coda_out_hdr oh;
+#ifdef CONFIG_CODA_FS_OLD_API
+ struct coda_cred cred;
+#else
+ vuid_t uid;
+#endif
+};
+
+/* coda_zapfile: */
+/* CODA_ZAPFILE is a venus->kernel call */
+struct coda_zapfile_out {
+ struct coda_out_hdr oh;
+ struct CodaFid CodaFid;
+};
+
+/* coda_zapdir: */
+/* CODA_ZAPDIR is a venus->kernel call */
+struct coda_zapdir_out {
+ struct coda_out_hdr oh;
+ struct CodaFid CodaFid;
+};
+
+/* coda_purgefid: */
+/* CODA_PURGEFID is a venus->kernel call */
+struct coda_purgefid_out {
+ struct coda_out_hdr oh;
+ struct CodaFid CodaFid;
+};
+
+/* coda_replace: */
+/* CODA_REPLACE is a venus->kernel call */
+struct coda_replace_out { /* coda_replace is a venus->kernel call */
+ struct coda_out_hdr oh;
+ struct CodaFid NewFid;
+ struct CodaFid OldFid;
+};
+
+/* coda_open_by_fd: */
+struct coda_open_by_fd_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ int flags;
+};
+
+struct coda_open_by_fd_out {
+ struct coda_out_hdr oh;
+ int fd;
+
+};
+
+/* coda_open_by_path: */
+struct coda_open_by_path_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ int flags;
+};
+
+struct coda_open_by_path_out {
+ struct coda_out_hdr oh;
+ int path;
+};
+
+/* coda_statfs: NO_IN */
+struct coda_statfs_in {
+ struct coda_in_hdr in;
+};
+
+struct coda_statfs_out {
+ struct coda_out_hdr oh;
+ struct coda_statfs stat;
+};
+
+/*
+ * Occasionally, we don't cache the fid returned by CODA_LOOKUP.
+ * For instance, if the fid is inconsistent.
+ * This case is handled by setting the top bit of the type result parameter.
+ */
+#define CODA_NOCACHE 0x80000000
+
+union inputArgs {
+ struct coda_in_hdr ih; /* NB: every struct below begins with an ih */
+ struct coda_open_in coda_open;
+ struct coda_store_in coda_store;
+ struct coda_release_in coda_release;
+ struct coda_close_in coda_close;
+ struct coda_ioctl_in coda_ioctl;
+ struct coda_getattr_in coda_getattr;
+ struct coda_setattr_in coda_setattr;
+ struct coda_access_in coda_access;
+ struct coda_lookup_in coda_lookup;
+ struct coda_create_in coda_create;
+ struct coda_remove_in coda_remove;
+ struct coda_link_in coda_link;
+ struct coda_rename_in coda_rename;
+ struct coda_mkdir_in coda_mkdir;
+ struct coda_rmdir_in coda_rmdir;
+ struct coda_symlink_in coda_symlink;
+ struct coda_readlink_in coda_readlink;
+ struct coda_fsync_in coda_fsync;
+ struct coda_vget_in coda_vget;
+ struct coda_open_by_fd_in coda_open_by_fd;
+ struct coda_open_by_path_in coda_open_by_path;
+ struct coda_statfs_in coda_statfs;
+};
+
+union outputArgs {
+ struct coda_out_hdr oh; /* NB: every struct below begins with an oh */
+ struct coda_root_out coda_root;
+ struct coda_open_out coda_open;
+ struct coda_ioctl_out coda_ioctl;
+ struct coda_getattr_out coda_getattr;
+ struct coda_lookup_out coda_lookup;
+ struct coda_create_out coda_create;
+ struct coda_mkdir_out coda_mkdir;
+ struct coda_readlink_out coda_readlink;
+ struct coda_vget_out coda_vget;
+ struct coda_purgeuser_out coda_purgeuser;
+ struct coda_zapfile_out coda_zapfile;
+ struct coda_zapdir_out coda_zapdir;
+ struct coda_purgefid_out coda_purgefid;
+ struct coda_replace_out coda_replace;
+ struct coda_open_by_fd_out coda_open_by_fd;
+ struct coda_open_by_path_out coda_open_by_path;
+ struct coda_statfs_out coda_statfs;
+};
+
+union coda_downcalls {
+ /* CODA_INVALIDATE is a venus->kernel call */
+ /* CODA_FLUSH is a venus->kernel call */
+ struct coda_purgeuser_out purgeuser;
+ struct coda_zapfile_out zapfile;
+ struct coda_zapdir_out zapdir;
+ struct coda_purgefid_out purgefid;
+ struct coda_replace_out replace;
+};
+
+
+/*
+ * Used for identifying usage of "Control" and pioctls
+ */
+
+#define PIOCPARM_MASK 0x0000ffff
+struct ViceIoctl {
+ void *in; /* Data to be transferred in */
+ void *out; /* Data to be transferred out */
+ u_short in_size; /* Size of input buffer <= 2K */
+ u_short out_size; /* Maximum size of output buffer, <= 2K */
+};
+
+struct PioctlData {
+ const char *path;
+ int follow;
+ struct ViceIoctl vi;
+};
+
+#define CODA_CONTROL ".CONTROL"
+#define CODA_CONTROLLEN 8
+#define CTL_INO -1
+
+/* Data passed to mount */
+
+#define CODA_MOUNT_VERSION 1
+
+struct coda_mount_data {
+ int version;
+ int fd; /* Opened device */
+};
+
+#endif
+
diff --git a/sysroot/usr/include/linux/coda_psdev.h b/sysroot/usr/include/linux/coda_psdev.h
new file mode 100644
index 0000000..3be20d7
--- /dev/null
+++ b/sysroot/usr/include/linux/coda_psdev.h
@@ -0,0 +1,92 @@
+#ifndef __CODA_PSDEV_H
+#define __CODA_PSDEV_H
+
+#include <linux/magic.h>
+
+#define CODA_PSDEV_MAJOR 67
+#define MAX_CODADEVS 5 /* how many do we allow */
+
+struct kstatfs;
+
+/* communication pending/processing queues */
+struct venus_comm {
+ u_long vc_seq;
+ wait_queue_head_t vc_waitq; /* Venus wait queue */
+ struct list_head vc_pending;
+ struct list_head vc_processing;
+ int vc_inuse;
+ struct super_block *vc_sb;
+};
+
+
+static __inline__ struct venus_comm *coda_vcp(struct super_block *sb)
+{
+ return (struct venus_comm *)((sb)->s_fs_info);
+}
+
+
+/* upcalls */
+int venus_rootfid(struct super_block *sb, struct CodaFid *fidp);
+int venus_getattr(struct super_block *sb, struct CodaFid *fid,
+ struct coda_vattr *attr);
+int venus_setattr(struct super_block *, struct CodaFid *, struct coda_vattr *);
+int venus_lookup(struct super_block *sb, struct CodaFid *fid,
+ const char *name, int length, int *type,
+ struct CodaFid *resfid);
+int venus_close(struct super_block *sb, struct CodaFid *fid, int flags,
+ vuid_t uid);
+int venus_open(struct super_block *sb, struct CodaFid *fid, int flags,
+ struct file **f);
+int venus_mkdir(struct super_block *sb, struct CodaFid *dirfid,
+ const char *name, int length,
+ struct CodaFid *newfid, struct coda_vattr *attrs);
+int venus_create(struct super_block *sb, struct CodaFid *dirfid,
+ const char *name, int length, int excl, int mode,
+ struct CodaFid *newfid, struct coda_vattr *attrs) ;
+int venus_rmdir(struct super_block *sb, struct CodaFid *dirfid,
+ const char *name, int length);
+int venus_remove(struct super_block *sb, struct CodaFid *dirfid,
+ const char *name, int length);
+int venus_readlink(struct super_block *sb, struct CodaFid *fid,
+ char *buffer, int *length);
+int venus_rename(struct super_block *, struct CodaFid *new_fid,
+ struct CodaFid *old_fid, size_t old_length,
+ size_t new_length, const char *old_name,
+ const char *new_name);
+int venus_link(struct super_block *sb, struct CodaFid *fid,
+ struct CodaFid *dirfid, const char *name, int len );
+int venus_symlink(struct super_block *sb, struct CodaFid *fid,
+ const char *name, int len, const char *symname, int symlen);
+int venus_access(struct super_block *sb, struct CodaFid *fid, int mask);
+int venus_pioctl(struct super_block *sb, struct CodaFid *fid,
+ unsigned int cmd, struct PioctlData *data);
+int coda_downcall(int opcode, union outputArgs *out, struct super_block *sb);
+int venus_fsync(struct super_block *sb, struct CodaFid *fid);
+int venus_statfs(struct dentry *dentry, struct kstatfs *sfs);
+
+
+/* messages between coda filesystem in kernel and Venus */
+struct upc_req {
+ struct list_head uc_chain;
+ caddr_t uc_data;
+ u_short uc_flags;
+ u_short uc_inSize; /* Size is at most 5000 bytes */
+ u_short uc_outSize;
+ u_short uc_opcode; /* copied from data to save lookup */
+ int uc_unique;
+ wait_queue_head_t uc_sleep; /* process' wait queue */
+};
+
+#define REQ_ASYNC 0x1
+#define REQ_READ 0x2
+#define REQ_WRITE 0x4
+#define REQ_ABORT 0x8
+
+
+/*
+ * Statistics
+ */
+
+extern struct venus_comm coda_comms[];
+
+#endif
diff --git a/sysroot/usr/include/linux/coff.h b/sysroot/usr/include/linux/coff.h
new file mode 100644
index 0000000..6354a7f
--- /dev/null
+++ b/sysroot/usr/include/linux/coff.h
@@ -0,0 +1,351 @@
+/* This file is derived from the GAS 2.1.4 assembler control file.
+ The GAS product is under the GNU General Public License, version 2 or later.
+ As such, this file is also under that license.
+
+ If the file format changes in the COFF object, this file should be
+ subsequently updated to reflect the changes.
+
+ The actual loader module only uses a few of these structures. The full
+ set is documented here because I received the full set. If you wish
+ more information about COFF, then O'Reilly has a very excellent book.
+*/
+
+#define E_SYMNMLEN 8 /* Number of characters in a symbol name */
+#define E_FILNMLEN 14 /* Number of characters in a file name */
+#define E_DIMNUM 4 /* Number of array dimensions in auxiliary entry */
+
+/*
+ * These defines are byte order independent. There is no alignment of fields
+ * permitted in the structures. Therefore they are declared as characters
+ * and the values loaded from the character positions. It also makes it
+ * nice to have it "endian" independent.
+ */
+
+/* Load a short int from the following tables with little-endian formats */
+#define COFF_SHORT_L(ps) ((short)(((unsigned short)((unsigned char)ps[1])<<8)|\
+ ((unsigned short)((unsigned char)ps[0]))))
+
+/* Load a long int from the following tables with little-endian formats */
+#define COFF_LONG_L(ps) (((long)(((unsigned long)((unsigned char)ps[3])<<24) |\
+ ((unsigned long)((unsigned char)ps[2])<<16) |\
+ ((unsigned long)((unsigned char)ps[1])<<8) |\
+ ((unsigned long)((unsigned char)ps[0])))))
+
+/* Load a short int from the following tables with big-endian formats */
+#define COFF_SHORT_H(ps) ((short)(((unsigned short)((unsigned char)ps[0])<<8)|\
+ ((unsigned short)((unsigned char)ps[1]))))
+
+/* Load a long int from the following tables with big-endian formats */
+#define COFF_LONG_H(ps) (((long)(((unsigned long)((unsigned char)ps[0])<<24) |\
+ ((unsigned long)((unsigned char)ps[1])<<16) |\
+ ((unsigned long)((unsigned char)ps[2])<<8) |\
+ ((unsigned long)((unsigned char)ps[3])))))
+
+/* These may be overridden later by brain dead implementations which generate
+ a big-endian header with little-endian data. In that case, generate a
+ replacement macro which tests a flag and uses either of the two above
+ as appropriate. */
+
+#define COFF_LONG(v) COFF_LONG_L(v)
+#define COFF_SHORT(v) COFF_SHORT_L(v)
+
+/*** coff information for Intel 386/486. */
+
+/********************** FILE HEADER **********************/
+
+struct COFF_filehdr {
+ char f_magic[2]; /* magic number */
+ char f_nscns[2]; /* number of sections */
+ char f_timdat[4]; /* time & date stamp */
+ char f_symptr[4]; /* file pointer to symtab */
+ char f_nsyms[4]; /* number of symtab entries */
+ char f_opthdr[2]; /* sizeof(optional hdr) */
+ char f_flags[2]; /* flags */
+};
+
+/*
+ * Bits for f_flags:
+ *
+ * F_RELFLG relocation info stripped from file
+ * F_EXEC file is executable (i.e. no unresolved external
+ * references)
+ * F_LNNO line numbers stripped from file
+ * F_LSYMS local symbols stripped from file
+ * F_MINMAL this is a minimal object file (".m") output of fextract
+ * F_UPDATE this is a fully bound update file, output of ogen
+ * F_SWABD this file has had its bytes swabbed (in names)
+ * F_AR16WR this file has the byte ordering of an AR16WR
+ * (e.g. 11/70) machine
+ * F_AR32WR this file has the byte ordering of an AR32WR machine
+ * (e.g. vax and iNTEL 386)
+ * F_AR32W this file has the byte ordering of an AR32W machine
+ * (e.g. 3b,maxi)
+ * F_PATCH file contains "patch" list in optional header
+ * F_NODF (minimal file only) no decision functions for
+ * replaced functions
+ */
+
+#define COFF_F_RELFLG 0000001
+#define COFF_F_EXEC 0000002
+#define COFF_F_LNNO 0000004
+#define COFF_F_LSYMS 0000010
+#define COFF_F_MINMAL 0000020
+#define COFF_F_UPDATE 0000040
+#define COFF_F_SWABD 0000100
+#define COFF_F_AR16WR 0000200
+#define COFF_F_AR32WR 0000400
+#define COFF_F_AR32W 0001000
+#define COFF_F_PATCH 0002000
+#define COFF_F_NODF 0002000
+
+#define COFF_I386MAGIC 0x14c /* Linux's system */
+
+#if 0 /* Perhaps, someday, these formats may be used. */
+#define COFF_I386PTXMAGIC 0x154
+#define COFF_I386AIXMAGIC 0x175 /* IBM's AIX system */
+#define COFF_I386BADMAG(x) ((COFF_SHORT((x).f_magic) != COFF_I386MAGIC) \
+ && COFF_SHORT((x).f_magic) != COFF_I386PTXMAGIC \
+ && COFF_SHORT((x).f_magic) != COFF_I386AIXMAGIC)
+#else
+#define COFF_I386BADMAG(x) (COFF_SHORT((x).f_magic) != COFF_I386MAGIC)
+#endif
+
+#define COFF_FILHDR struct COFF_filehdr
+#define COFF_FILHSZ sizeof(COFF_FILHDR)
+
+/********************** AOUT "OPTIONAL HEADER" **********************/
+
+/* Linux COFF must have this "optional" header. Standard COFF has no entry
+ location for the "entry" point. They normally would start with the first
+ location of the .text section. This is not a good idea for linux. So,
+ the use of this "optional" header is not optional. It is required.
+
+ Do not be tempted to assume that the size of the optional header is
+ a constant and simply index the next byte by the size of this structure.
+ Use the 'f_opthdr' field in the main coff header for the size of the
+ structure actually written to the file!!
+*/
+
+typedef struct
+{
+ char magic[2]; /* type of file */
+ char vstamp[2]; /* version stamp */
+ char tsize[4]; /* text size in bytes, padded to FW bdry */
+ char dsize[4]; /* initialized data " " */
+ char bsize[4]; /* uninitialized data " " */
+ char entry[4]; /* entry pt. */
+ char text_start[4]; /* base of text used for this file */
+ char data_start[4]; /* base of data used for this file */
+}
+COFF_AOUTHDR;
+
+#define COFF_AOUTSZ (sizeof(COFF_AOUTHDR))
+
+#define COFF_STMAGIC 0401
+#define COFF_OMAGIC 0404
+#define COFF_JMAGIC 0407 /* dirty text and data image, can't share */
+#define COFF_DMAGIC 0410 /* dirty text segment, data aligned */
+#define COFF_ZMAGIC 0413 /* The proper magic number for executables */
+#define COFF_SHMAGIC 0443 /* shared library header */
+
+/********************** SECTION HEADER **********************/
+
+struct COFF_scnhdr {
+ char s_name[8]; /* section name */
+ char s_paddr[4]; /* physical address, aliased s_nlib */
+ char s_vaddr[4]; /* virtual address */
+ char s_size[4]; /* section size */
+ char s_scnptr[4]; /* file ptr to raw data for section */
+ char s_relptr[4]; /* file ptr to relocation */
+ char s_lnnoptr[4]; /* file ptr to line numbers */
+ char s_nreloc[2]; /* number of relocation entries */
+ char s_nlnno[2]; /* number of line number entries */
+ char s_flags[4]; /* flags */
+};
+
+#define COFF_SCNHDR struct COFF_scnhdr
+#define COFF_SCNHSZ sizeof(COFF_SCNHDR)
+
+/*
+ * names of "special" sections
+ */
+
+#define COFF_TEXT ".text"
+#define COFF_DATA ".data"
+#define COFF_BSS ".bss"
+#define COFF_COMMENT ".comment"
+#define COFF_LIB ".lib"
+
+#define COFF_SECT_TEXT 0 /* Section for instruction code */
+#define COFF_SECT_DATA 1 /* Section for initialized globals */
+#define COFF_SECT_BSS 2 /* Section for un-initialized globals */
+#define COFF_SECT_REQD 3 /* Minimum number of sections for good file */
+
+#define COFF_STYP_REG 0x00 /* regular segment */
+#define COFF_STYP_DSECT 0x01 /* dummy segment */
+#define COFF_STYP_NOLOAD 0x02 /* no-load segment */
+#define COFF_STYP_GROUP 0x04 /* group segment */
+#define COFF_STYP_PAD 0x08 /* .pad segment */
+#define COFF_STYP_COPY 0x10 /* copy section */
+#define COFF_STYP_TEXT 0x20 /* .text segment */
+#define COFF_STYP_DATA 0x40 /* .data segment */
+#define COFF_STYP_BSS 0x80 /* .bss segment */
+#define COFF_STYP_INFO 0x200 /* .comment section */
+#define COFF_STYP_OVER 0x400 /* overlay section */
+#define COFF_STYP_LIB 0x800 /* library section */
+
+/*
+ * Shared libraries have the following section header in the data field for
+ * each library.
+ */
+
+struct COFF_slib {
+ char sl_entsz[4]; /* Size of this entry */
+ char sl_pathndx[4]; /* size of the header field */
+};
+
+#define COFF_SLIBHD struct COFF_slib
+#define COFF_SLIBSZ sizeof(COFF_SLIBHD)
+
+/********************** LINE NUMBERS **********************/
+
+/* 1 line number entry for every "breakpointable" source line in a section.
+ * Line numbers are grouped on a per function basis; first entry in a function
+ * grouping will have l_lnno = 0 and in place of physical address will be the
+ * symbol table index of the function name.
+ */
+
+struct COFF_lineno {
+ union {
+ char l_symndx[4]; /* function name symbol index, iff l_lnno == 0*/
+ char l_paddr[4]; /* (physical) address of line number */
+ } l_addr;
+ char l_lnno[2]; /* line number */
+};
+
+#define COFF_LINENO struct COFF_lineno
+#define COFF_LINESZ 6
+
+/********************** SYMBOLS **********************/
+
+#define COFF_E_SYMNMLEN 8 /* # characters in a short symbol name */
+#define COFF_E_FILNMLEN 14 /* # characters in a file name */
+#define COFF_E_DIMNUM 4 /* # array dimensions in auxiliary entry */
+
+/*
+ * All symbols and sections have the following definition
+ */
+
+struct COFF_syment
+{
+ union {
+ char e_name[E_SYMNMLEN]; /* Symbol name (first 8 characters) */
+ struct {
+ char e_zeroes[4]; /* Leading zeros */
+ char e_offset[4]; /* Offset if this is a header section */
+ } e;
+ } e;
+
+ char e_value[4]; /* Value (address) of the segment */
+ char e_scnum[2]; /* Section number */
+ char e_type[2]; /* Type of section */
+ char e_sclass[1]; /* Loader class */
+ char e_numaux[1]; /* Number of auxiliary entries which follow */
+};
+
+#define COFF_N_BTMASK (0xf) /* Mask for important class bits */
+#define COFF_N_TMASK (0x30) /* Mask for important type bits */
+#define COFF_N_BTSHFT (4) /* # bits to shift class field */
+#define COFF_N_TSHIFT (2) /* # bits to shift type field */
+
+/*
+ * Auxiliary entries because the main table is too limiting.
+ */
+
+union COFF_auxent {
+
+/*
+ * Debugger information
+ */
+
+ struct {
+ char x_tagndx[4]; /* str, un, or enum tag indx */
+ union {
+ struct {
+ char x_lnno[2]; /* declaration line number */
+ char x_size[2]; /* str/union/array size */
+ } x_lnsz;
+ char x_fsize[4]; /* size of function */
+ } x_misc;
+
+ union {
+ struct { /* if ISFCN, tag, or .bb */
+ char x_lnnoptr[4]; /* ptr to fcn line # */
+ char x_endndx[4]; /* entry ndx past block end */
+ } x_fcn;
+
+ struct { /* if ISARY, up to 4 dimen. */
+ char x_dimen[E_DIMNUM][2];
+ } x_ary;
+ } x_fcnary;
+
+ char x_tvndx[2]; /* tv index */
+ } x_sym;
+
+/*
+ * Source file names (debugger information)
+ */
+
+ union {
+ char x_fname[E_FILNMLEN];
+ struct {
+ char x_zeroes[4];
+ char x_offset[4];
+ } x_n;
+ } x_file;
+
+/*
+ * Section information
+ */
+
+ struct {
+ char x_scnlen[4]; /* section length */
+ char x_nreloc[2]; /* # relocation entries */
+ char x_nlinno[2]; /* # line numbers */
+ } x_scn;
+
+/*
+ * Transfer vector (branch table)
+ */
+
+ struct {
+ char x_tvfill[4]; /* tv fill value */
+ char x_tvlen[2]; /* length of .tv */
+ char x_tvran[2][2]; /* tv range */
+ } x_tv; /* info about .tv section (in auxent of symbol .tv)) */
+};
+
+#define COFF_SYMENT struct COFF_syment
+#define COFF_SYMESZ 18
+#define COFF_AUXENT union COFF_auxent
+#define COFF_AUXESZ 18
+
+#define COFF_ETEXT "etext"
+
+/********************** RELOCATION DIRECTIVES **********************/
+
+struct COFF_reloc {
+ char r_vaddr[4]; /* Virtual address of item */
+ char r_symndx[4]; /* Symbol index in the symtab */
+ char r_type[2]; /* Relocation type */
+};
+
+#define COFF_RELOC struct COFF_reloc
+#define COFF_RELSZ 10
+
+#define COFF_DEF_DATA_SECTION_ALIGNMENT 4
+#define COFF_DEF_BSS_SECTION_ALIGNMENT 4
+#define COFF_DEF_TEXT_SECTION_ALIGNMENT 4
+
+/* For new sections we haven't heard of before */
+#define COFF_DEF_SECTION_ALIGNMENT 4
diff --git a/sysroot/usr/include/linux/comstats.h b/sysroot/usr/include/linux/comstats.h
new file mode 100644
index 0000000..3f5ea8e
--- /dev/null
+++ b/sysroot/usr/include/linux/comstats.h
@@ -0,0 +1,119 @@
+/*****************************************************************************/
+
+/*
+ * comstats.h -- Serial Port Stats.
+ *
+ * Copyright (C) 1996-1998 Stallion Technologies
+ * Copyright (C) 1994-1996 Greg Ungerer.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/*****************************************************************************/
+#ifndef _COMSTATS_H
+#define _COMSTATS_H
+/*****************************************************************************/
+
+/*
+ * Serial port stats structure. The structure itself is UART
+ * independent, but some fields may be UART/driver specific (for
+ * example state).
+ */
+
+typedef struct {
+ unsigned long brd;
+ unsigned long panel;
+ unsigned long port;
+ unsigned long hwid;
+ unsigned long type;
+ unsigned long txtotal;
+ unsigned long rxtotal;
+ unsigned long txbuffered;
+ unsigned long rxbuffered;
+ unsigned long rxoverrun;
+ unsigned long rxparity;
+ unsigned long rxframing;
+ unsigned long rxlost;
+ unsigned long txbreaks;
+ unsigned long rxbreaks;
+ unsigned long txxon;
+ unsigned long txxoff;
+ unsigned long rxxon;
+ unsigned long rxxoff;
+ unsigned long txctson;
+ unsigned long txctsoff;
+ unsigned long rxrtson;
+ unsigned long rxrtsoff;
+ unsigned long modem;
+ unsigned long state;
+ unsigned long flags;
+ unsigned long ttystate;
+ unsigned long cflags;
+ unsigned long iflags;
+ unsigned long oflags;
+ unsigned long lflags;
+ unsigned long signals;
+} comstats_t;
+
+
+/*
+ * Board stats structure. Returns useful info about the board.
+ */
+
+#define COM_MAXPANELS 8
+
+typedef struct {
+ unsigned long panel;
+ unsigned long type;
+ unsigned long hwid;
+ unsigned long nrports;
+} companel_t;
+
+typedef struct {
+ unsigned long brd;
+ unsigned long type;
+ unsigned long hwid;
+ unsigned long state;
+ unsigned long ioaddr;
+ unsigned long ioaddr2;
+ unsigned long memaddr;
+ unsigned long irq;
+ unsigned long nrpanels;
+ unsigned long nrports;
+ companel_t panels[COM_MAXPANELS];
+} combrd_t;
+
+
+/*
+ * Define the ioctl operations for stats stuff.
+ */
+#include <linux/ioctl.h>
+
+#define COM_GETPORTSTATS _IO('c',30)
+#define COM_CLRPORTSTATS _IO('c',31)
+#define COM_GETBRDSTATS _IO('c',32)
+
+
+/*
+ * Define the set of ioctls that give user level access to the
+ * private port, panel and board structures. The argument required
+ * will be driver dependent!
+ */
+#define COM_READPORT _IO('c',40)
+#define COM_READBOARD _IO('c',41)
+#define COM_READPANEL _IO('c',42)
+
+/*****************************************************************************/
+#endif
diff --git a/sysroot/usr/include/linux/connector.h b/sysroot/usr/include/linux/connector.h
new file mode 100644
index 0000000..673cfd2
--- /dev/null
+++ b/sysroot/usr/include/linux/connector.h
@@ -0,0 +1,95 @@
+/*
+ * connector.h
+ *
+ * 2004-2005 Copyright (c) Evgeniy Polyakov <johnpol@2ka.mipt.ru>
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __CONNECTOR_H
+#define __CONNECTOR_H
+
+#include <asm/types.h>
+
+#define CN_IDX_CONNECTOR 0xffffffff
+#define CN_VAL_CONNECTOR 0xffffffff
+
+/*
+ * Process Events connector unique ids -- used for message routing
+ */
+#define CN_IDX_PROC 0x1
+#define CN_VAL_PROC 0x1
+#define CN_IDX_CIFS 0x2
+#define CN_VAL_CIFS 0x1
+#define CN_W1_IDX 0x3 /* w1 communication */
+#define CN_W1_VAL 0x1
+#define CN_IDX_V86D 0x4
+#define CN_VAL_V86D_UVESAFB 0x1
+
+#define CN_NETLINK_USERS 5
+
+/*
+ * Maximum connector's message size.
+ */
+#define CONNECTOR_MAX_MSG_SIZE 16384
+
+/*
+ * idx and val are unique identifiers which
+ * are used for message routing and
+ * must be registered in connector.h for in-kernel usage.
+ */
+
+struct cb_id {
+ __u32 idx;
+ __u32 val;
+};
+
+struct cn_msg {
+ struct cb_id id;
+
+ __u32 seq;
+ __u32 ack;
+
+ __u16 len; /* Length of the following data */
+ __u16 flags;
+ __u8 data[0];
+};
+
+/*
+ * Notify structure - requests notification about
+ * registering/unregistering idx/val in range [first, first+range].
+ */
+struct cn_notify_req {
+ __u32 first;
+ __u32 range;
+};
+
+/*
+ * Main notification control message
+ * *_notify_num - number of appropriate cn_notify_req structures after
+ * this struct.
+ * group - notification receiver's idx.
+ * len - total length of the attached data.
+ */
+struct cn_ctl_msg {
+ __u32 idx_notify_num;
+ __u32 val_notify_num;
+ __u32 group;
+ __u32 len;
+ __u8 data[0];
+};
+
+#endif /* __CONNECTOR_H */
diff --git a/sysroot/usr/include/linux/const.h b/sysroot/usr/include/linux/const.h
new file mode 100644
index 0000000..07b300b
--- /dev/null
+++ b/sysroot/usr/include/linux/const.h
@@ -0,0 +1,19 @@
+/* const.h: Macros for dealing with constants. */
+
+#ifndef _LINUX_CONST_H
+#define _LINUX_CONST_H
+
+/* Some constant macros are used in both assembler and
+ * C code. Therefore we cannot annotate them always with
+ * 'UL' and other type specifiers unilaterally. We
+ * use the following macros to deal with this.
+ */
+
+#ifdef __ASSEMBLY__
+#define _AC(X,Y) X
+#else
+#define __AC(X,Y) (X##Y)
+#define _AC(X,Y) __AC(X,Y)
+#endif
+
+#endif /* !(_LINUX_CONST_H) */
diff --git a/sysroot/usr/include/linux/cramfs_fs.h b/sysroot/usr/include/linux/cramfs_fs.h
new file mode 100644
index 0000000..3be4e5a
--- /dev/null
+++ b/sysroot/usr/include/linux/cramfs_fs.h
@@ -0,0 +1,93 @@
+#ifndef __CRAMFS_H
+#define __CRAMFS_H
+
+#include <linux/types.h>
+
+#define CRAMFS_MAGIC 0x28cd3d45 /* some random number */
+#define CRAMFS_MAGIC_WEND 0x453dcd28 /* magic number with the wrong endianess */
+#define CRAMFS_SIGNATURE "Compressed ROMFS"
+
+/*
+ * Width of various bitfields in struct cramfs_inode.
+ * Primarily used to generate warnings in mkcramfs.
+ */
+#define CRAMFS_MODE_WIDTH 16
+#define CRAMFS_UID_WIDTH 16
+#define CRAMFS_SIZE_WIDTH 24
+#define CRAMFS_GID_WIDTH 8
+#define CRAMFS_NAMELEN_WIDTH 6
+#define CRAMFS_OFFSET_WIDTH 26
+
+/*
+ * Since inode.namelen is a unsigned 6-bit number, the maximum cramfs
+ * path length is 63 << 2 = 252.
+ */
+#define CRAMFS_MAXPATHLEN (((1 << CRAMFS_NAMELEN_WIDTH) - 1) << 2)
+
+/*
+ * Reasonably terse representation of the inode data.
+ */
+struct cramfs_inode {
+ __u32 mode:CRAMFS_MODE_WIDTH, uid:CRAMFS_UID_WIDTH;
+ /* SIZE for device files is i_rdev */
+ __u32 size:CRAMFS_SIZE_WIDTH, gid:CRAMFS_GID_WIDTH;
+ /* NAMELEN is the length of the file name, divided by 4 and
+ rounded up. (cramfs doesn't support hard links.) */
+ /* OFFSET: For symlinks and non-empty regular files, this
+ contains the offset (divided by 4) of the file data in
+ compressed form (starting with an array of block pointers;
+ see README). For non-empty directories it is the offset
+ (divided by 4) of the inode of the first file in that
+ directory. For anything else, offset is zero. */
+ __u32 namelen:CRAMFS_NAMELEN_WIDTH, offset:CRAMFS_OFFSET_WIDTH;
+};
+
+struct cramfs_info {
+ __u32 crc;
+ __u32 edition;
+ __u32 blocks;
+ __u32 files;
+};
+
+/*
+ * Superblock information at the beginning of the FS.
+ */
+struct cramfs_super {
+ __u32 magic; /* 0x28cd3d45 - random number */
+ __u32 size; /* length in bytes */
+ __u32 flags; /* feature flags */
+ __u32 future; /* reserved for future use */
+ __u8 signature[16]; /* "Compressed ROMFS" */
+ struct cramfs_info fsid; /* unique filesystem info */
+ __u8 name[16]; /* user-defined name */
+ struct cramfs_inode root; /* root inode data */
+};
+
+/*
+ * Feature flags
+ *
+ * 0x00000000 - 0x000000ff: features that work for all past kernels
+ * 0x00000100 - 0xffffffff: features that don't work for past kernels
+ */
+#define CRAMFS_FLAG_FSID_VERSION_2 0x00000001 /* fsid version #2 */
+#define CRAMFS_FLAG_SORTED_DIRS 0x00000002 /* sorted dirs */
+#define CRAMFS_FLAG_HOLES 0x00000100 /* support for holes */
+#define CRAMFS_FLAG_WRONG_SIGNATURE 0x00000200 /* reserved */
+#define CRAMFS_FLAG_SHIFTED_ROOT_OFFSET 0x00000400 /* shifted root fs */
+
+/*
+ * Valid values in super.flags. Currently we refuse to mount
+ * if (flags & ~CRAMFS_SUPPORTED_FLAGS). Maybe that should be
+ * changed to test super.future instead.
+ */
+#define CRAMFS_SUPPORTED_FLAGS ( 0x000000ff \
+ | CRAMFS_FLAG_HOLES \
+ | CRAMFS_FLAG_WRONG_SIGNATURE \
+ | CRAMFS_FLAG_SHIFTED_ROOT_OFFSET )
+
+/* Uncompression interfaces to the underlying zlib */
+int cramfs_uncompress_block(void *dst, int dstlen, void *src, int srclen);
+int cramfs_uncompress_init(void);
+void cramfs_uncompress_exit(void);
+
+#endif
diff --git a/sysroot/usr/include/linux/cuda.h b/sysroot/usr/include/linux/cuda.h
new file mode 100644
index 0000000..69c8bf0
--- /dev/null
+++ b/sysroot/usr/include/linux/cuda.h
@@ -0,0 +1,28 @@
+/*
+ * Definitions for talking to the CUDA. The CUDA is a microcontroller
+ * which controls the ADB, system power, RTC, and various other things.
+ *
+ * Copyright (C) 1996 Paul Mackerras.
+ */
+
+/* CUDA commands (2nd byte) */
+#define CUDA_WARM_START 0
+#define CUDA_AUTOPOLL 1
+#define CUDA_GET_6805_ADDR 2
+#define CUDA_GET_TIME 3
+#define CUDA_GET_PRAM 7
+#define CUDA_SET_6805_ADDR 8
+#define CUDA_SET_TIME 9
+#define CUDA_POWERDOWN 0xa
+#define CUDA_POWERUP_TIME 0xb
+#define CUDA_SET_PRAM 0xc
+#define CUDA_MS_RESET 0xd
+#define CUDA_SEND_DFAC 0xe
+#define CUDA_RESET_SYSTEM 0x11
+#define CUDA_SET_IPL 0x12
+#define CUDA_SET_AUTO_RATE 0x14
+#define CUDA_GET_AUTO_RATE 0x16
+#define CUDA_SET_DEVICE_LIST 0x19
+#define CUDA_GET_DEVICE_LIST 0x1a
+#define CUDA_GET_SET_IIC 0x22
+
diff --git a/sysroot/usr/include/linux/cyclades.h b/sysroot/usr/include/linux/cyclades.h
new file mode 100644
index 0000000..76f609c
--- /dev/null
+++ b/sysroot/usr/include/linux/cyclades.h
@@ -0,0 +1,508 @@
+/* $Revision: 3.0 $$Date: 1998/11/02 14:20:59 $
+ * linux/include/linux/cyclades.h
+ *
+ * This file was initially written by
+ * Randolph Bentson <bentson@grieg.seaslug.org> and is maintained by
+ * Ivan Passos <ivan@cyclades.com>.
+ *
+ * This file contains the general definitions for the cyclades.c driver
+ *$Log: cyclades.h,v $
+ *Revision 3.1 2002/01/29 11:36:16 henrique
+ *added throttle field on struct cyclades_port to indicate whether the
+ *port is throttled or not
+ *
+ *Revision 3.1 2000/04/19 18:52:52 ivan
+ *converted address fields to unsigned long and added fields for physical
+ *addresses on cyclades_card structure;
+ *
+ *Revision 3.0 1998/11/02 14:20:59 ivan
+ *added nports field on cyclades_card structure;
+ *
+ *Revision 2.5 1998/08/03 16:57:01 ivan
+ *added cyclades_idle_stats structure;
+ *
+ *Revision 2.4 1998/06/01 12:09:53 ivan
+ *removed closing_wait2 from cyclades_port structure;
+ *
+ *Revision 2.3 1998/03/16 18:01:12 ivan
+ *changes in the cyclades_port structure to get it closer to the
+ *standard serial port structure;
+ *added constants for new ioctls;
+ *
+ *Revision 2.2 1998/02/17 16:50:00 ivan
+ *changes in the cyclades_port structure (addition of shutdown_wait and
+ *chip_rev variables);
+ *added constants for new ioctls and for CD1400 rev. numbers.
+ *
+ *Revision 2.1 1997/10/24 16:03:00 ivan
+ *added rflow (which allows enabling the CD1400 special flow control
+ *feature) and rtsdtr_inv (which allows DTR/RTS pin inversion) to
+ *cyclades_port structure;
+ *added Alpha support
+ *
+ *Revision 2.0 1997/06/30 10:30:00 ivan
+ *added some new doorbell command constants related to IOCTLW and
+ *UART error signaling
+ *
+ *Revision 1.8 1997/06/03 15:30:00 ivan
+ *added constant ZFIRM_HLT
+ *added constant CyPCI_Ze_win ( = 2 * Cy_PCI_Zwin)
+ *
+ *Revision 1.7 1997/03/26 10:30:00 daniel
+ *new entries at the end of cyclades_port struct to reallocate
+ *variables illegally allocated within card memory.
+ *
+ *Revision 1.6 1996/09/09 18:35:30 bentson
+ *fold in changes for Cyclom-Z -- including structures for
+ *communicating with board as well modest changes to original
+ *structures to support new features.
+ *
+ *Revision 1.5 1995/11/13 21:13:31 bentson
+ *changes suggested by Michael Chastain <mec@duracef.shout.net>
+ *to support use of this file in non-kernel applications
+ *
+ *
+ */
+
+#ifndef _LINUX_CYCLADES_H
+#define _LINUX_CYCLADES_H
+
+#include <linux/types.h>
+
+struct cyclades_monitor {
+ unsigned long int_count;
+ unsigned long char_count;
+ unsigned long char_max;
+ unsigned long char_last;
+};
+
+/*
+ * These stats all reflect activity since the device was last initialized.
+ * (i.e., since the port was opened with no other processes already having it
+ * open)
+ */
+struct cyclades_idle_stats {
+ time_t in_use; /* Time device has been in use (secs) */
+ time_t recv_idle; /* Time since last char received (secs) */
+ time_t xmit_idle; /* Time since last char transmitted (secs) */
+ unsigned long recv_bytes; /* Bytes received */
+ unsigned long xmit_bytes; /* Bytes transmitted */
+ unsigned long overruns; /* Input overruns */
+ unsigned long frame_errs; /* Input framing errors */
+ unsigned long parity_errs; /* Input parity errors */
+};
+
+#define CYCLADES_MAGIC 0x4359
+
+#define CYGETMON 0x435901
+#define CYGETTHRESH 0x435902
+#define CYSETTHRESH 0x435903
+#define CYGETDEFTHRESH 0x435904
+#define CYSETDEFTHRESH 0x435905
+#define CYGETTIMEOUT 0x435906
+#define CYSETTIMEOUT 0x435907
+#define CYGETDEFTIMEOUT 0x435908
+#define CYSETDEFTIMEOUT 0x435909
+#define CYSETRFLOW 0x43590a
+#define CYGETRFLOW 0x43590b
+#define CYSETRTSDTR_INV 0x43590c
+#define CYGETRTSDTR_INV 0x43590d
+#define CYZSETPOLLCYCLE 0x43590e
+#define CYZGETPOLLCYCLE 0x43590f
+#define CYGETCD1400VER 0x435910
+#define CYSETWAIT 0x435912
+#define CYGETWAIT 0x435913
+
+/*************** CYCLOM-Z ADDITIONS ***************/
+
+#define CZIOC ('M' << 8)
+#define CZ_NBOARDS (CZIOC|0xfa)
+#define CZ_BOOT_START (CZIOC|0xfb)
+#define CZ_BOOT_DATA (CZIOC|0xfc)
+#define CZ_BOOT_END (CZIOC|0xfd)
+#define CZ_TEST (CZIOC|0xfe)
+
+#define CZ_DEF_POLL (HZ/25)
+
+#define MAX_BOARD 4 /* Max number of boards */
+#define MAX_DEV 256 /* Max number of ports total */
+#define CYZ_MAX_SPEED 921600
+
+#define CYZ_FIFO_SIZE 16
+
+#define CYZ_BOOT_NWORDS 0x100
+struct CYZ_BOOT_CTRL {
+ unsigned short nboard;
+ int status[MAX_BOARD];
+ int nchannel[MAX_BOARD];
+ int fw_rev[MAX_BOARD];
+ unsigned long offset;
+ unsigned long data[CYZ_BOOT_NWORDS];
+};
+
+
+#ifndef DP_WINDOW_SIZE
+/* #include "cyclomz.h" */
+/****************** ****************** *******************/
+/*
+ * The data types defined below are used in all ZFIRM interface
+ * data structures. They accomodate differences between HW
+ * architectures and compilers.
+ */
+
+#include <asm/types.h>
+
+typedef __u64 ucdouble; /* 64 bits, unsigned */
+typedef __u32 uclong; /* 32 bits, unsigned */
+typedef __u16 ucshort; /* 16 bits, unsigned */
+typedef __u8 ucchar; /* 8 bits, unsigned */
+
+/*
+ * Memory Window Sizes
+ */
+
+#define DP_WINDOW_SIZE (0x00080000) /* window size 512 Kb */
+#define ZE_DP_WINDOW_SIZE (0x00100000) /* window size 1 Mb (Ze and
+ 8Zo V.2 */
+#define CTRL_WINDOW_SIZE (0x00000080) /* runtime regs 128 bytes */
+
+/*
+ * CUSTOM_REG - Cyclom-Z/PCI Custom Registers Set. The driver
+ * normally will access only interested on the fpga_id, fpga_version,
+ * start_cpu and stop_cpu.
+ */
+
+struct CUSTOM_REG {
+ __u32 fpga_id; /* FPGA Identification Register */
+ __u32 fpga_version; /* FPGA Version Number Register */
+ __u32 cpu_start; /* CPU start Register (write) */
+ __u32 cpu_stop; /* CPU stop Register (write) */
+ __u32 misc_reg; /* Miscelaneous Register */
+ __u32 idt_mode; /* IDT mode Register */
+ __u32 uart_irq_status; /* UART IRQ status Register */
+ __u32 clear_timer0_irq; /* Clear timer interrupt Register */
+ __u32 clear_timer1_irq; /* Clear timer interrupt Register */
+ __u32 clear_timer2_irq; /* Clear timer interrupt Register */
+ __u32 test_register; /* Test Register */
+ __u32 test_count; /* Test Count Register */
+ __u32 timer_select; /* Timer select register */
+ __u32 pr_uart_irq_status; /* Prioritized UART IRQ stat Reg */
+ __u32 ram_wait_state; /* RAM wait-state Register */
+ __u32 uart_wait_state; /* UART wait-state Register */
+ __u32 timer_wait_state; /* timer wait-state Register */
+ __u32 ack_wait_state; /* ACK wait State Register */
+};
+
+/*
+ * RUNTIME_9060 - PLX PCI9060ES local configuration and shared runtime
+ * registers. This structure can be used to access the 9060 registers
+ * (memory mapped).
+ */
+
+struct RUNTIME_9060 {
+ __u32 loc_addr_range; /* 00h - Local Address Range */
+ __u32 loc_addr_base; /* 04h - Local Address Base */
+ __u32 loc_arbitr; /* 08h - Local Arbitration */
+ __u32 endian_descr; /* 0Ch - Big/Little Endian Descriptor */
+ __u32 loc_rom_range; /* 10h - Local ROM Range */
+ __u32 loc_rom_base; /* 14h - Local ROM Base */
+ __u32 loc_bus_descr; /* 18h - Local Bus descriptor */
+ __u32 loc_range_mst; /* 1Ch - Local Range for Master to PCI */
+ __u32 loc_base_mst; /* 20h - Local Base for Master PCI */
+ __u32 loc_range_io; /* 24h - Local Range for Master IO */
+ __u32 pci_base_mst; /* 28h - PCI Base for Master PCI */
+ __u32 pci_conf_io; /* 2Ch - PCI configuration for Master IO */
+ __u32 filler1; /* 30h */
+ __u32 filler2; /* 34h */
+ __u32 filler3; /* 38h */
+ __u32 filler4; /* 3Ch */
+ __u32 mail_box_0; /* 40h - Mail Box 0 */
+ __u32 mail_box_1; /* 44h - Mail Box 1 */
+ __u32 mail_box_2; /* 48h - Mail Box 2 */
+ __u32 mail_box_3; /* 4Ch - Mail Box 3 */
+ __u32 filler5; /* 50h */
+ __u32 filler6; /* 54h */
+ __u32 filler7; /* 58h */
+ __u32 filler8; /* 5Ch */
+ __u32 pci_doorbell; /* 60h - PCI to Local Doorbell */
+ __u32 loc_doorbell; /* 64h - Local to PCI Doorbell */
+ __u32 intr_ctrl_stat; /* 68h - Interrupt Control/Status */
+ __u32 init_ctrl; /* 6Ch - EEPROM control, Init Control, etc */
+};
+
+/* Values for the Local Base Address re-map register */
+
+#define WIN_RAM 0x00000001L /* set the sliding window to RAM */
+#define WIN_CREG 0x14000001L /* set the window to custom Registers */
+
+/* Values timer select registers */
+
+#define TIMER_BY_1M 0x00 /* clock divided by 1M */
+#define TIMER_BY_256K 0x01 /* clock divided by 256k */
+#define TIMER_BY_128K 0x02 /* clock divided by 128k */
+#define TIMER_BY_32K 0x03 /* clock divided by 32k */
+
+/****************** ****************** *******************/
+#endif
+
+#ifndef ZFIRM_ID
+/* #include "zfwint.h" */
+/****************** ****************** *******************/
+/*
+ * This file contains the definitions for interfacing with the
+ * Cyclom-Z ZFIRM Firmware.
+ */
+
+/* General Constant definitions */
+
+#define MAX_CHAN 64 /* max number of channels per board */
+
+/* firmware id structure (set after boot) */
+
+#define ID_ADDRESS 0x00000180L /* signature/pointer address */
+#define ZFIRM_ID 0x5557465AL /* ZFIRM/U signature */
+#define ZFIRM_HLT 0x59505B5CL /* ZFIRM needs external power supply */
+#define ZFIRM_RST 0x56040674L /* RST signal (due to FW reset) */
+
+#define ZF_TINACT_DEF 1000 /* default inactivity timeout
+ (1000 ms) */
+#define ZF_TINACT ZF_TINACT_DEF
+
+struct FIRM_ID {
+ __u32 signature; /* ZFIRM/U signature */
+ __u32 zfwctrl_addr; /* pointer to ZFW_CTRL structure */
+};
+
+/* Op. System id */
+
+#define C_OS_LINUX 0x00000030 /* generic Linux system */
+
+/* channel op_mode */
+
+#define C_CH_DISABLE 0x00000000 /* channel is disabled */
+#define C_CH_TXENABLE 0x00000001 /* channel Tx enabled */
+#define C_CH_RXENABLE 0x00000002 /* channel Rx enabled */
+#define C_CH_ENABLE 0x00000003 /* channel Tx/Rx enabled */
+#define C_CH_LOOPBACK 0x00000004 /* Loopback mode */
+
+/* comm_parity - parity */
+
+#define C_PR_NONE 0x00000000 /* None */
+#define C_PR_ODD 0x00000001 /* Odd */
+#define C_PR_EVEN 0x00000002 /* Even */
+#define C_PR_MARK 0x00000004 /* Mark */
+#define C_PR_SPACE 0x00000008 /* Space */
+#define C_PR_PARITY 0x000000ff
+
+#define C_PR_DISCARD 0x00000100 /* discard char with frame/par error */
+#define C_PR_IGNORE 0x00000200 /* ignore frame/par error */
+
+/* comm_data_l - data length and stop bits */
+
+#define C_DL_CS5 0x00000001
+#define C_DL_CS6 0x00000002
+#define C_DL_CS7 0x00000004
+#define C_DL_CS8 0x00000008
+#define C_DL_CS 0x0000000f
+#define C_DL_1STOP 0x00000010
+#define C_DL_15STOP 0x00000020
+#define C_DL_2STOP 0x00000040
+#define C_DL_STOP 0x000000f0
+
+/* interrupt enabling/status */
+
+#define C_IN_DISABLE 0x00000000 /* zero, disable interrupts */
+#define C_IN_TXBEMPTY 0x00000001 /* tx buffer empty */
+#define C_IN_TXLOWWM 0x00000002 /* tx buffer below LWM */
+#define C_IN_RXHIWM 0x00000010 /* rx buffer above HWM */
+#define C_IN_RXNNDT 0x00000020 /* rx no new data timeout */
+#define C_IN_MDCD 0x00000100 /* modem DCD change */
+#define C_IN_MDSR 0x00000200 /* modem DSR change */
+#define C_IN_MRI 0x00000400 /* modem RI change */
+#define C_IN_MCTS 0x00000800 /* modem CTS change */
+#define C_IN_RXBRK 0x00001000 /* Break received */
+#define C_IN_PR_ERROR 0x00002000 /* parity error */
+#define C_IN_FR_ERROR 0x00004000 /* frame error */
+#define C_IN_OVR_ERROR 0x00008000 /* overrun error */
+#define C_IN_RXOFL 0x00010000 /* RX buffer overflow */
+#define C_IN_IOCTLW 0x00020000 /* I/O control w/ wait */
+#define C_IN_MRTS 0x00040000 /* modem RTS drop */
+#define C_IN_ICHAR 0x00080000
+
+/* flow control */
+
+#define C_FL_OXX 0x00000001 /* output Xon/Xoff flow control */
+#define C_FL_IXX 0x00000002 /* output Xon/Xoff flow control */
+#define C_FL_OIXANY 0x00000004 /* output Xon/Xoff (any xon) */
+#define C_FL_SWFLOW 0x0000000f
+
+/* flow status */
+
+#define C_FS_TXIDLE 0x00000000 /* no Tx data in the buffer or UART */
+#define C_FS_SENDING 0x00000001 /* UART is sending data */
+#define C_FS_SWFLOW 0x00000002 /* Tx is stopped by received Xoff */
+
+/* rs_control/rs_status RS-232 signals */
+
+#define C_RS_PARAM 0x80000000 /* Indicates presence of parameter in
+ IOCTLM command */
+#define C_RS_RTS 0x00000001 /* RTS */
+#define C_RS_DTR 0x00000004 /* DTR */
+#define C_RS_DCD 0x00000100 /* CD */
+#define C_RS_DSR 0x00000200 /* DSR */
+#define C_RS_RI 0x00000400 /* RI */
+#define C_RS_CTS 0x00000800 /* CTS */
+
+/* commands Host <-> Board */
+
+#define C_CM_RESET 0x01 /* reset/flush buffers */
+#define C_CM_IOCTL 0x02 /* re-read CH_CTRL */
+#define C_CM_IOCTLW 0x03 /* re-read CH_CTRL, intr when done */
+#define C_CM_IOCTLM 0x04 /* RS-232 outputs change */
+#define C_CM_SENDXOFF 0x10 /* send Xoff */
+#define C_CM_SENDXON 0x11 /* send Xon */
+#define C_CM_CLFLOW 0x12 /* Clear flow control (resume) */
+#define C_CM_SENDBRK 0x41 /* send break */
+#define C_CM_INTBACK 0x42 /* Interrupt back */
+#define C_CM_SET_BREAK 0x43 /* Tx break on */
+#define C_CM_CLR_BREAK 0x44 /* Tx break off */
+#define C_CM_CMD_DONE 0x45 /* Previous command done */
+#define C_CM_INTBACK2 0x46 /* Alternate Interrupt back */
+#define C_CM_TINACT 0x51 /* set inactivity detection */
+#define C_CM_IRQ_ENBL 0x52 /* enable generation of interrupts */
+#define C_CM_IRQ_DSBL 0x53 /* disable generation of interrupts */
+#define C_CM_ACK_ENBL 0x54 /* enable acknowledged interrupt mode */
+#define C_CM_ACK_DSBL 0x55 /* disable acknowledged intr mode */
+#define C_CM_FLUSH_RX 0x56 /* flushes Rx buffer */
+#define C_CM_FLUSH_TX 0x57 /* flushes Tx buffer */
+#define C_CM_Q_ENABLE 0x58 /* enables queue access from the
+ driver */
+#define C_CM_Q_DISABLE 0x59 /* disables queue access from the
+ driver */
+
+#define C_CM_TXBEMPTY 0x60 /* Tx buffer is empty */
+#define C_CM_TXLOWWM 0x61 /* Tx buffer low water mark */
+#define C_CM_RXHIWM 0x62 /* Rx buffer high water mark */
+#define C_CM_RXNNDT 0x63 /* rx no new data timeout */
+#define C_CM_TXFEMPTY 0x64
+#define C_CM_ICHAR 0x65
+#define C_CM_MDCD 0x70 /* modem DCD change */
+#define C_CM_MDSR 0x71 /* modem DSR change */
+#define C_CM_MRI 0x72 /* modem RI change */
+#define C_CM_MCTS 0x73 /* modem CTS change */
+#define C_CM_MRTS 0x74 /* modem RTS drop */
+#define C_CM_RXBRK 0x84 /* Break received */
+#define C_CM_PR_ERROR 0x85 /* Parity error */
+#define C_CM_FR_ERROR 0x86 /* Frame error */
+#define C_CM_OVR_ERROR 0x87 /* Overrun error */
+#define C_CM_RXOFL 0x88 /* RX buffer overflow */
+#define C_CM_CMDERROR 0x90 /* command error */
+#define C_CM_FATAL 0x91 /* fatal error */
+#define C_CM_HW_RESET 0x92 /* reset board */
+
+/*
+ * CH_CTRL - This per port structure contains all parameters
+ * that control an specific port. It can be seen as the
+ * configuration registers of a "super-serial-controller".
+ */
+
+struct CH_CTRL {
+ __u32 op_mode; /* operation mode */
+ __u32 intr_enable; /* interrupt masking */
+ __u32 sw_flow; /* SW flow control */
+ __u32 flow_status; /* output flow status */
+ __u32 comm_baud; /* baud rate - numerically specified */
+ __u32 comm_parity; /* parity */
+ __u32 comm_data_l; /* data length/stop */
+ __u32 comm_flags; /* other flags */
+ __u32 hw_flow; /* HW flow control */
+ __u32 rs_control; /* RS-232 outputs */
+ __u32 rs_status; /* RS-232 inputs */
+ __u32 flow_xon; /* xon char */
+ __u32 flow_xoff; /* xoff char */
+ __u32 hw_overflow; /* hw overflow counter */
+ __u32 sw_overflow; /* sw overflow counter */
+ __u32 comm_error; /* frame/parity error counter */
+ __u32 ichar;
+ __u32 filler[7];
+};
+
+
+/*
+ * BUF_CTRL - This per channel structure contains
+ * all Tx and Rx buffer control for a given channel.
+ */
+
+struct BUF_CTRL {
+ __u32 flag_dma; /* buffers are in Host memory */
+ __u32 tx_bufaddr; /* address of the tx buffer */
+ __u32 tx_bufsize; /* tx buffer size */
+ __u32 tx_threshold; /* tx low water mark */
+ __u32 tx_get; /* tail index tx buf */
+ __u32 tx_put; /* head index tx buf */
+ __u32 rx_bufaddr; /* address of the rx buffer */
+ __u32 rx_bufsize; /* rx buffer size */
+ __u32 rx_threshold; /* rx high water mark */
+ __u32 rx_get; /* tail index rx buf */
+ __u32 rx_put; /* head index rx buf */
+ __u32 filler[5]; /* filler to align structures */
+};
+
+/*
+ * BOARD_CTRL - This per board structure contains all global
+ * control fields related to the board.
+ */
+
+struct BOARD_CTRL {
+
+ /* static info provided by the on-board CPU */
+ __u32 n_channel; /* number of channels */
+ __u32 fw_version; /* firmware version */
+
+ /* static info provided by the driver */
+ __u32 op_system; /* op_system id */
+ __u32 dr_version; /* driver version */
+
+ /* board control area */
+ __u32 inactivity; /* inactivity control */
+
+ /* host to FW commands */
+ __u32 hcmd_channel; /* channel number */
+ __u32 hcmd_param; /* pointer to parameters */
+
+ /* FW to Host commands */
+ __u32 fwcmd_channel; /* channel number */
+ __u32 fwcmd_param; /* pointer to parameters */
+ __u32 zf_int_queue_addr; /* offset for INT_QUEUE structure */
+
+ /* filler so the structures are aligned */
+ __u32 filler[6];
+};
+
+/* Host Interrupt Queue */
+
+#define QUEUE_SIZE (10*MAX_CHAN)
+
+struct INT_QUEUE {
+ unsigned char intr_code[QUEUE_SIZE];
+ unsigned long channel[QUEUE_SIZE];
+ unsigned long param[QUEUE_SIZE];
+ unsigned long put;
+ unsigned long get;
+};
+
+/*
+ * ZFW_CTRL - This is the data structure that includes all other
+ * data structures used by the Firmware.
+ */
+
+struct ZFW_CTRL {
+ struct BOARD_CTRL board_ctrl;
+ struct CH_CTRL ch_ctrl[MAX_CHAN];
+ struct BUF_CTRL buf_ctrl[MAX_CHAN];
+};
+
+/****************** ****************** *******************/
+#endif
+
+#endif /* _LINUX_CYCLADES_H */
diff --git a/sysroot/usr/include/linux/cycx_cfm.h b/sysroot/usr/include/linux/cycx_cfm.h
new file mode 100644
index 0000000..032d26e
--- /dev/null
+++ b/sysroot/usr/include/linux/cycx_cfm.h
@@ -0,0 +1,101 @@
+/*
+* cycx_cfm.h Cyclom 2X WAN Link Driver.
+* Definitions for the Cyclom 2X Firmware Module (CFM).
+*
+* Author: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+*
+* Copyright: (c) 1998-2003 Arnaldo Carvalho de Melo
+*
+* Based on sdlasfm.h by Gene Kozin <74604.152@compuserve.com>
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version
+* 2 of the License, or (at your option) any later version.
+* ============================================================================
+* 1998/08/08 acme Initial version.
+*/
+#ifndef _CYCX_CFM_H
+#define _CYCX_CFM_H
+
+/* Defines */
+
+#define CFM_VERSION 2
+#define CFM_SIGNATURE "CFM - Cyclades CYCX Firmware Module"
+
+/* min/max */
+#define CFM_IMAGE_SIZE 0x20000 /* max size of CYCX code image file */
+#define CFM_DESCR_LEN 256 /* max length of description string */
+#define CFM_MAX_CYCX 1 /* max number of compatible adapters */
+#define CFM_LOAD_BUFSZ 0x400 /* buffer size for reset code (buffer_load) */
+
+/* Firmware Commands */
+#define GEN_POWER_ON 0x1280
+
+#define GEN_SET_SEG 0x1401 /* boot segment setting. */
+#define GEN_BOOT_DAT 0x1402 /* boot data. */
+#define GEN_START 0x1403 /* board start. */
+#define GEN_DEFPAR 0x1404 /* buffer length for boot. */
+
+/* Adapter Types */
+#define CYCX_2X 2
+/* for now only the 2X is supported, no plans to support 8X or 16X */
+#define CYCX_8X 8
+#define CYCX_16X 16
+
+#define CFID_X25_2X 5200
+
+/**
+ * struct cycx_fw_info - firmware module information.
+ * @codeid - firmware ID
+ * @version - firmware version number
+ * @adapter - compatible adapter types
+ * @memsize - minimum memory size
+ * @reserved - reserved
+ * @startoffs - entry point offset
+ * @winoffs - dual-port memory window offset
+ * @codeoffs - code load offset
+ * @codesize - code size
+ * @dataoffs - configuration data load offset
+ * @datasize - configuration data size
+ */
+struct cycx_fw_info {
+ unsigned short codeid;
+ unsigned short version;
+ unsigned short adapter[CFM_MAX_CYCX];
+ unsigned long memsize;
+ unsigned short reserved[2];
+ unsigned short startoffs;
+ unsigned short winoffs;
+ unsigned short codeoffs;
+ unsigned long codesize;
+ unsigned short dataoffs;
+ unsigned long datasize;
+};
+
+/**
+ * struct cycx_firmware - CYCX firmware file structure
+ * @signature - CFM file signature
+ * @version - file format version
+ * @checksum - info + image
+ * @reserved - reserved
+ * @descr - description string
+ * @info - firmware module info
+ * @image - code image (variable size)
+ */
+struct cycx_firmware {
+ char signature[80];
+ unsigned short version;
+ unsigned short checksum;
+ unsigned short reserved[6];
+ char descr[CFM_DESCR_LEN];
+ struct cycx_fw_info info;
+ unsigned char image[0];
+};
+
+struct cycx_fw_header {
+ unsigned long reset_size;
+ unsigned long data_size;
+ unsigned long code_size;
+};
+#endif /* _CYCX_CFM_H */
diff --git a/sysroot/usr/include/linux/dccp.h b/sysroot/usr/include/linux/dccp.h
new file mode 100644
index 0000000..ee7d2bb
--- /dev/null
+++ b/sysroot/usr/include/linux/dccp.h
@@ -0,0 +1,217 @@
+#ifndef _LINUX_DCCP_H
+#define _LINUX_DCCP_H
+
+#include <linux/types.h>
+#include <asm/byteorder.h>
+
+/**
+ * struct dccp_hdr - generic part of DCCP packet header
+ *
+ * @dccph_sport - Relevant port on the endpoint that sent this packet
+ * @dccph_dport - Relevant port on the other endpoint
+ * @dccph_doff - Data Offset from the start of the DCCP header, in 32-bit words
+ * @dccph_ccval - Used by the HC-Sender CCID
+ * @dccph_cscov - Parts of the packet that are covered by the Checksum field
+ * @dccph_checksum - Internet checksum, depends on dccph_cscov
+ * @dccph_x - 0 = 24 bit sequence number, 1 = 48
+ * @dccph_type - packet type, see DCCP_PKT_ prefixed macros
+ * @dccph_seq - sequence number high or low order 24 bits, depends on dccph_x
+ */
+struct dccp_hdr {
+ __be16 dccph_sport,
+ dccph_dport;
+ __u8 dccph_doff;
+#if defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 dccph_cscov:4,
+ dccph_ccval:4;
+#elif defined(__BIG_ENDIAN_BITFIELD)
+ __u8 dccph_ccval:4,
+ dccph_cscov:4;
+#else
+#error "Adjust your <asm/byteorder.h> defines"
+#endif
+ __sum16 dccph_checksum;
+#if defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 dccph_x:1,
+ dccph_type:4,
+ dccph_reserved:3;
+#elif defined(__BIG_ENDIAN_BITFIELD)
+ __u8 dccph_reserved:3,
+ dccph_type:4,
+ dccph_x:1;
+#else
+#error "Adjust your <asm/byteorder.h> defines"
+#endif
+ __u8 dccph_seq2;
+ __be16 dccph_seq;
+};
+
+/**
+ * struct dccp_hdr_ext - the low bits of a 48 bit seq packet
+ *
+ * @dccph_seq_low - low 24 bits of a 48 bit seq packet
+ */
+struct dccp_hdr_ext {
+ __be32 dccph_seq_low;
+};
+
+/**
+ * struct dccp_hdr_request - Connection initiation request header
+ *
+ * @dccph_req_service - Service to which the client app wants to connect
+ */
+struct dccp_hdr_request {
+ __be32 dccph_req_service;
+};
+/**
+ * struct dccp_hdr_ack_bits - acknowledgment bits common to most packets
+ *
+ * @dccph_resp_ack_nr_high - 48 bit ack number high order bits, contains GSR
+ * @dccph_resp_ack_nr_low - 48 bit ack number low order bits, contains GSR
+ */
+struct dccp_hdr_ack_bits {
+ __be16 dccph_reserved1;
+ __be16 dccph_ack_nr_high;
+ __be32 dccph_ack_nr_low;
+};
+/**
+ * struct dccp_hdr_response - Connection initiation response header
+ *
+ * @dccph_resp_ack - 48 bit Acknowledgment Number Subheader (5.3)
+ * @dccph_resp_service - Echoes the Service Code on a received DCCP-Request
+ */
+struct dccp_hdr_response {
+ struct dccp_hdr_ack_bits dccph_resp_ack;
+ __be32 dccph_resp_service;
+};
+
+/**
+ * struct dccp_hdr_reset - Unconditionally shut down a connection
+ *
+ * @dccph_reset_ack - 48 bit Acknowledgment Number Subheader (5.6)
+ * @dccph_reset_code - one of %dccp_reset_codes
+ * @dccph_reset_data - the Data 1 ... Data 3 fields from 5.6
+ */
+struct dccp_hdr_reset {
+ struct dccp_hdr_ack_bits dccph_reset_ack;
+ __u8 dccph_reset_code,
+ dccph_reset_data[3];
+};
+
+enum dccp_pkt_type {
+ DCCP_PKT_REQUEST = 0,
+ DCCP_PKT_RESPONSE,
+ DCCP_PKT_DATA,
+ DCCP_PKT_ACK,
+ DCCP_PKT_DATAACK,
+ DCCP_PKT_CLOSEREQ,
+ DCCP_PKT_CLOSE,
+ DCCP_PKT_RESET,
+ DCCP_PKT_SYNC,
+ DCCP_PKT_SYNCACK,
+ DCCP_PKT_INVALID,
+};
+
+#define DCCP_NR_PKT_TYPES DCCP_PKT_INVALID
+
+static __inline__ unsigned int dccp_packet_hdr_len(const __u8 type)
+{
+ if (type == DCCP_PKT_DATA)
+ return 0;
+ if (type == DCCP_PKT_DATAACK ||
+ type == DCCP_PKT_ACK ||
+ type == DCCP_PKT_SYNC ||
+ type == DCCP_PKT_SYNCACK ||
+ type == DCCP_PKT_CLOSE ||
+ type == DCCP_PKT_CLOSEREQ)
+ return sizeof(struct dccp_hdr_ack_bits);
+ if (type == DCCP_PKT_REQUEST)
+ return sizeof(struct dccp_hdr_request);
+ if (type == DCCP_PKT_RESPONSE)
+ return sizeof(struct dccp_hdr_response);
+ return sizeof(struct dccp_hdr_reset);
+}
+enum dccp_reset_codes {
+ DCCP_RESET_CODE_UNSPECIFIED = 0,
+ DCCP_RESET_CODE_CLOSED,
+ DCCP_RESET_CODE_ABORTED,
+ DCCP_RESET_CODE_NO_CONNECTION,
+ DCCP_RESET_CODE_PACKET_ERROR,
+ DCCP_RESET_CODE_OPTION_ERROR,
+ DCCP_RESET_CODE_MANDATORY_ERROR,
+ DCCP_RESET_CODE_CONNECTION_REFUSED,
+ DCCP_RESET_CODE_BAD_SERVICE_CODE,
+ DCCP_RESET_CODE_TOO_BUSY,
+ DCCP_RESET_CODE_BAD_INIT_COOKIE,
+ DCCP_RESET_CODE_AGGRESSION_PENALTY,
+
+ DCCP_MAX_RESET_CODES /* Leave at the end! */
+};
+
+/* DCCP options */
+enum {
+ DCCPO_PADDING = 0,
+ DCCPO_MANDATORY = 1,
+ DCCPO_MIN_RESERVED = 3,
+ DCCPO_MAX_RESERVED = 31,
+ DCCPO_CHANGE_L = 32,
+ DCCPO_CONFIRM_L = 33,
+ DCCPO_CHANGE_R = 34,
+ DCCPO_CONFIRM_R = 35,
+ DCCPO_NDP_COUNT = 37,
+ DCCPO_ACK_VECTOR_0 = 38,
+ DCCPO_ACK_VECTOR_1 = 39,
+ DCCPO_TIMESTAMP = 41,
+ DCCPO_TIMESTAMP_ECHO = 42,
+ DCCPO_ELAPSED_TIME = 43,
+ DCCPO_MAX = 45,
+ DCCPO_MIN_CCID_SPECIFIC = 128,
+ DCCPO_MAX_CCID_SPECIFIC = 255,
+};
+
+/* DCCP CCIDS */
+enum {
+ DCCPC_CCID2 = 2,
+ DCCPC_CCID3 = 3,
+};
+
+/* DCCP features (RFC 4340 section 6.4) */
+enum {
+ DCCPF_RESERVED = 0,
+ DCCPF_CCID = 1,
+ DCCPF_SHORT_SEQNOS = 2, /* XXX: not yet implemented */
+ DCCPF_SEQUENCE_WINDOW = 3,
+ DCCPF_ECN_INCAPABLE = 4, /* XXX: not yet implemented */
+ DCCPF_ACK_RATIO = 5,
+ DCCPF_SEND_ACK_VECTOR = 6,
+ DCCPF_SEND_NDP_COUNT = 7,
+ DCCPF_MIN_CSUM_COVER = 8,
+ DCCPF_DATA_CHECKSUM = 9, /* XXX: not yet implemented */
+ /* 10-127 reserved */
+ DCCPF_MIN_CCID_SPECIFIC = 128,
+ DCCPF_MAX_CCID_SPECIFIC = 255,
+};
+
+/* this structure is argument to DCCP_SOCKOPT_CHANGE_X */
+struct dccp_so_feat {
+ __u8 dccpsf_feat;
+ __u8 *dccpsf_val;
+ __u8 dccpsf_len;
+};
+
+/* DCCP socket options */
+#define DCCP_SOCKOPT_PACKET_SIZE 1 /* XXX deprecated, without effect */
+#define DCCP_SOCKOPT_SERVICE 2
+#define DCCP_SOCKOPT_CHANGE_L 3
+#define DCCP_SOCKOPT_CHANGE_R 4
+#define DCCP_SOCKOPT_GET_CUR_MPS 5
+#define DCCP_SOCKOPT_SEND_CSCOV 10
+#define DCCP_SOCKOPT_RECV_CSCOV 11
+#define DCCP_SOCKOPT_CCID_RX_INFO 128
+#define DCCP_SOCKOPT_CCID_TX_INFO 192
+
+/* maximum number of services provided on the same listening port */
+#define DCCP_SERVICE_LIST_MAX_LEN 32
+
+
+#endif /* _LINUX_DCCP_H */
diff --git a/sysroot/usr/include/linux/dirent.h b/sysroot/usr/include/linux/dirent.h
new file mode 100644
index 0000000..9f966b4
--- /dev/null
+++ b/sysroot/usr/include/linux/dirent.h
@@ -0,0 +1,21 @@
+#ifndef _LINUX_DIRENT_H
+#define _LINUX_DIRENT_H
+
+struct dirent {
+ long d_ino;
+ __kernel_off_t d_off;
+ unsigned short d_reclen;
+ char d_name[256]; /* We must not include limits.h! */
+};
+
+struct dirent64 {
+ __u64 d_ino;
+ __s64 d_off;
+ unsigned short d_reclen;
+ unsigned char d_type;
+ char d_name[256];
+};
+
+
+
+#endif
diff --git a/sysroot/usr/include/linux/dlm.h b/sysroot/usr/include/linux/dlm.h
new file mode 100644
index 0000000..cb0c64e
--- /dev/null
+++ b/sysroot/usr/include/linux/dlm.h
@@ -0,0 +1,213 @@
+/******************************************************************************
+*******************************************************************************
+**
+** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
+** Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
+**
+** This copyrighted material is made available to anyone wishing to use,
+** modify, copy, or redistribute it subject to the terms and conditions
+** of the GNU General Public License v.2.
+**
+*******************************************************************************
+******************************************************************************/
+
+#ifndef __DLM_DOT_H__
+#define __DLM_DOT_H__
+
+/*
+ * Interface to Distributed Lock Manager (DLM)
+ * routines and structures to use DLM lockspaces
+ */
+
+/*
+ * Lock Modes
+ */
+
+#define DLM_LOCK_IV -1 /* invalid */
+#define DLM_LOCK_NL 0 /* null */
+#define DLM_LOCK_CR 1 /* concurrent read */
+#define DLM_LOCK_CW 2 /* concurrent write */
+#define DLM_LOCK_PR 3 /* protected read */
+#define DLM_LOCK_PW 4 /* protected write */
+#define DLM_LOCK_EX 5 /* exclusive */
+
+/*
+ * Maximum size in bytes of a dlm_lock name
+ */
+
+#define DLM_RESNAME_MAXLEN 64
+
+/*
+ * Flags to dlm_lock
+ *
+ * DLM_LKF_NOQUEUE
+ *
+ * Do not queue the lock request on the wait queue if it cannot be granted
+ * immediately. If the lock cannot be granted because of this flag, DLM will
+ * either return -EAGAIN from the dlm_lock call or will return 0 from
+ * dlm_lock and -EAGAIN in the lock status block when the AST is executed.
+ *
+ * DLM_LKF_CANCEL
+ *
+ * Used to cancel a pending lock request or conversion. A converting lock is
+ * returned to its previously granted mode.
+ *
+ * DLM_LKF_CONVERT
+ *
+ * Indicates a lock conversion request. For conversions the name and namelen
+ * are ignored and the lock ID in the LKSB is used to identify the lock.
+ *
+ * DLM_LKF_VALBLK
+ *
+ * Requests DLM to return the current contents of the lock value block in the
+ * lock status block. When this flag is set in a lock conversion from PW or EX
+ * modes, DLM assigns the value specified in the lock status block to the lock
+ * value block of the lock resource. The LVB is a DLM_LVB_LEN size array
+ * containing application-specific information.
+ *
+ * DLM_LKF_QUECVT
+ *
+ * Force a conversion request to be queued, even if it is compatible with
+ * the granted modes of other locks on the same resource.
+ *
+ * DLM_LKF_IVVALBLK
+ *
+ * Invalidate the lock value block.
+ *
+ * DLM_LKF_CONVDEADLK
+ *
+ * Allows the dlm to resolve conversion deadlocks internally by demoting the
+ * granted mode of a converting lock to NL. The DLM_SBF_DEMOTED flag is
+ * returned for a conversion that's been effected by this.
+ *
+ * DLM_LKF_PERSISTENT
+ *
+ * Only relevant to locks originating in userspace. A persistent lock will not
+ * be removed if the process holding the lock exits.
+ *
+ * DLM_LKF_NODLCKWT
+ *
+ * Do not cancel the lock if it gets into conversion deadlock.
+ * Exclude this lock from being monitored due to DLM_LSFL_TIMEWARN.
+ *
+ * DLM_LKF_NODLCKBLK
+ *
+ * net yet implemented
+ *
+ * DLM_LKF_EXPEDITE
+ *
+ * Used only with new requests for NL mode locks. Tells the lock manager
+ * to grant the lock, ignoring other locks in convert and wait queues.
+ *
+ * DLM_LKF_NOQUEUEBAST
+ *
+ * Send blocking AST's before returning -EAGAIN to the caller. It is only
+ * used along with the NOQUEUE flag. Blocking AST's are not sent for failed
+ * NOQUEUE requests otherwise.
+ *
+ * DLM_LKF_HEADQUE
+ *
+ * Add a lock to the head of the convert or wait queue rather than the tail.
+ *
+ * DLM_LKF_NOORDER
+ *
+ * Disregard the standard grant order rules and grant a lock as soon as it
+ * is compatible with other granted locks.
+ *
+ * DLM_LKF_ORPHAN
+ *
+ * not yet implemented
+ *
+ * DLM_LKF_ALTPR
+ *
+ * If the requested mode cannot be granted immediately, try to grant the lock
+ * in PR mode instead. If this alternate mode is granted instead of the
+ * requested mode, DLM_SBF_ALTMODE is returned in the lksb.
+ *
+ * DLM_LKF_ALTCW
+ *
+ * The same as ALTPR, but the alternate mode is CW.
+ *
+ * DLM_LKF_FORCEUNLOCK
+ *
+ * Unlock the lock even if it is converting or waiting or has sublocks.
+ * Only really for use by the userland device.c code.
+ *
+ */
+
+#define DLM_LKF_NOQUEUE 0x00000001
+#define DLM_LKF_CANCEL 0x00000002
+#define DLM_LKF_CONVERT 0x00000004
+#define DLM_LKF_VALBLK 0x00000008
+#define DLM_LKF_QUECVT 0x00000010
+#define DLM_LKF_IVVALBLK 0x00000020
+#define DLM_LKF_CONVDEADLK 0x00000040
+#define DLM_LKF_PERSISTENT 0x00000080
+#define DLM_LKF_NODLCKWT 0x00000100
+#define DLM_LKF_NODLCKBLK 0x00000200
+#define DLM_LKF_EXPEDITE 0x00000400
+#define DLM_LKF_NOQUEUEBAST 0x00000800
+#define DLM_LKF_HEADQUE 0x00001000
+#define DLM_LKF_NOORDER 0x00002000
+#define DLM_LKF_ORPHAN 0x00004000
+#define DLM_LKF_ALTPR 0x00008000
+#define DLM_LKF_ALTCW 0x00010000
+#define DLM_LKF_FORCEUNLOCK 0x00020000
+#define DLM_LKF_TIMEOUT 0x00040000
+
+/*
+ * Some return codes that are not in errno.h
+ */
+
+#define DLM_ECANCEL 0x10001
+#define DLM_EUNLOCK 0x10002
+
+typedef void dlm_lockspace_t;
+
+/*
+ * Lock status block
+ *
+ * Use this structure to specify the contents of the lock value block. For a
+ * conversion request, this structure is used to specify the lock ID of the
+ * lock. DLM writes the status of the lock request and the lock ID assigned
+ * to the request in the lock status block.
+ *
+ * sb_lkid: the returned lock ID. It is set on new (non-conversion) requests.
+ * It is available when dlm_lock returns.
+ *
+ * sb_lvbptr: saves or returns the contents of the lock's LVB according to rules
+ * shown for the DLM_LKF_VALBLK flag.
+ *
+ * sb_flags: DLM_SBF_DEMOTED is returned if in the process of promoting a lock,
+ * it was first demoted to NL to avoid conversion deadlock.
+ * DLM_SBF_VALNOTVALID is returned if the resource's LVB is marked invalid.
+ *
+ * sb_status: the returned status of the lock request set prior to AST
+ * execution. Possible return values:
+ *
+ * 0 if lock request was successful
+ * -EAGAIN if request would block and is flagged DLM_LKF_NOQUEUE
+ * -ENOMEM if there is no memory to process request
+ * -EINVAL if there are invalid parameters
+ * -DLM_EUNLOCK if unlock request was successful
+ * -DLM_ECANCEL if a cancel completed successfully
+ */
+
+#define DLM_SBF_DEMOTED 0x01
+#define DLM_SBF_VALNOTVALID 0x02
+#define DLM_SBF_ALTMODE 0x04
+
+struct dlm_lksb {
+ int sb_status;
+ uint32_t sb_lkid;
+ char sb_flags;
+ char * sb_lvbptr;
+};
+
+#define DLM_LSFL_NODIR 0x00000001
+#define DLM_LSFL_TIMEWARN 0x00000002
+#define DLM_LSFL_FS 0x00000004
+
+
+#endif /* __DLM_DOT_H__ */
+
diff --git a/sysroot/usr/include/linux/dlm_device.h b/sysroot/usr/include/linux/dlm_device.h
new file mode 100644
index 0000000..23968cb
--- /dev/null
+++ b/sysroot/usr/include/linux/dlm_device.h
@@ -0,0 +1,103 @@
+/******************************************************************************
+*******************************************************************************
+**
+** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
+** Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
+**
+** This copyrighted material is made available to anyone wishing to use,
+** modify, copy, or redistribute it subject to the terms and conditions
+** of the GNU General Public License v.2.
+**
+*******************************************************************************
+******************************************************************************/
+
+/* This is the device interface for dlm, most users will use a library
+ * interface.
+ */
+
+#define DLM_USER_LVB_LEN 32
+
+/* Version of the device interface */
+#define DLM_DEVICE_VERSION_MAJOR 6
+#define DLM_DEVICE_VERSION_MINOR 0
+#define DLM_DEVICE_VERSION_PATCH 0
+
+/* struct passed to the lock write */
+struct dlm_lock_params {
+ __u8 mode;
+ __u8 namelen;
+ __u16 unused;
+ __u32 flags;
+ __u32 lkid;
+ __u32 parent;
+ __u64 xid;
+ __u64 timeout;
+ void *castparam;
+ void *castaddr;
+ void *bastparam;
+ void *bastaddr;
+ struct dlm_lksb *lksb;
+ char lvb[DLM_USER_LVB_LEN];
+ char name[0];
+};
+
+struct dlm_lspace_params {
+ __u32 flags;
+ __u32 minor;
+ char name[0];
+};
+
+struct dlm_purge_params {
+ __u32 nodeid;
+ __u32 pid;
+};
+
+struct dlm_write_request {
+ __u32 version[3];
+ __u8 cmd;
+ __u8 is64bit;
+ __u8 unused[2];
+
+ union {
+ struct dlm_lock_params lock;
+ struct dlm_lspace_params lspace;
+ struct dlm_purge_params purge;
+ } i;
+};
+
+struct dlm_device_version {
+ __u32 version[3];
+};
+
+/* struct read from the "device" fd,
+ consists mainly of userspace pointers for the library to use */
+
+struct dlm_lock_result {
+ __u32 version[3];
+ __u32 length;
+ void * user_astaddr;
+ void * user_astparam;
+ struct dlm_lksb * user_lksb;
+ struct dlm_lksb lksb;
+ __u8 bast_mode;
+ __u8 unused[3];
+ /* Offsets may be zero if no data is present */
+ __u32 lvb_offset;
+};
+
+/* Commands passed to the device */
+#define DLM_USER_LOCK 1
+#define DLM_USER_UNLOCK 2
+#define DLM_USER_QUERY 3
+#define DLM_USER_CREATE_LOCKSPACE 4
+#define DLM_USER_REMOVE_LOCKSPACE 5
+#define DLM_USER_PURGE 6
+#define DLM_USER_DEADLOCK 7
+
+/* Arbitrary length restriction */
+#define MAX_LS_NAME_LEN 64
+
+/* Lockspace flags */
+#define DLM_USER_LSFLG_AUTOFREE 1
+#define DLM_USER_LSFLG_FORCEFREE 2
+
diff --git a/sysroot/usr/include/linux/dlm_netlink.h b/sysroot/usr/include/linux/dlm_netlink.h
new file mode 100644
index 0000000..1927633
--- /dev/null
+++ b/sysroot/usr/include/linux/dlm_netlink.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2007 Red Hat, Inc. All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU General Public License v.2.
+ */
+
+#ifndef _DLM_NETLINK_H
+#define _DLM_NETLINK_H
+
+enum {
+ DLM_STATUS_WAITING = 1,
+ DLM_STATUS_GRANTED = 2,
+ DLM_STATUS_CONVERT = 3,
+};
+
+#define DLM_LOCK_DATA_VERSION 1
+
+struct dlm_lock_data {
+ uint16_t version;
+ uint32_t lockspace_id;
+ int nodeid;
+ int ownpid;
+ uint32_t id;
+ uint32_t remid;
+ uint64_t xid;
+ int8_t status;
+ int8_t grmode;
+ int8_t rqmode;
+ unsigned long timestamp;
+ int resource_namelen;
+ char resource_name[DLM_RESNAME_MAXLEN];
+};
+
+enum {
+ DLM_CMD_UNSPEC = 0,
+ DLM_CMD_HELLO, /* user->kernel */
+ DLM_CMD_TIMEOUT, /* kernel->user */
+ __DLM_CMD_MAX,
+};
+
+#define DLM_CMD_MAX (__DLM_CMD_MAX - 1)
+
+enum {
+ DLM_TYPE_UNSPEC = 0,
+ DLM_TYPE_LOCK,
+ __DLM_TYPE_MAX,
+};
+
+#define DLM_TYPE_MAX (__DLM_TYPE_MAX - 1)
+
+#define DLM_GENL_VERSION 0x1
+#define DLM_GENL_NAME "DLM"
+
+#endif /* _DLM_NETLINK_H */
diff --git a/sysroot/usr/include/linux/dm-ioctl.h b/sysroot/usr/include/linux/dm-ioctl.h
new file mode 100644
index 0000000..523281c
--- /dev/null
+++ b/sysroot/usr/include/linux/dm-ioctl.h
@@ -0,0 +1,332 @@
+/*
+ * Copyright (C) 2001 - 2003 Sistina Software (UK) Limited.
+ * Copyright (C) 2004 - 2005 Red Hat, Inc. All rights reserved.
+ *
+ * This file is released under the LGPL.
+ */
+
+#ifndef _LINUX_DM_IOCTL_V4_H
+#define _LINUX_DM_IOCTL_V4_H
+
+#include <linux/types.h>
+
+#define DM_DIR "mapper" /* Slashes not supported */
+#define DM_MAX_TYPE_NAME 16
+#define DM_NAME_LEN 128
+#define DM_UUID_LEN 129
+
+/*
+ * A traditional ioctl interface for the device mapper.
+ *
+ * Each device can have two tables associated with it, an
+ * 'active' table which is the one currently used by io passing
+ * through the device, and an 'inactive' one which is a table
+ * that is being prepared as a replacement for the 'active' one.
+ *
+ * DM_VERSION:
+ * Just get the version information for the ioctl interface.
+ *
+ * DM_REMOVE_ALL:
+ * Remove all dm devices, destroy all tables. Only really used
+ * for debug.
+ *
+ * DM_LIST_DEVICES:
+ * Get a list of all the dm device names.
+ *
+ * DM_DEV_CREATE:
+ * Create a new device, neither the 'active' or 'inactive' table
+ * slots will be filled. The device will be in suspended state
+ * after creation, however any io to the device will get errored
+ * since it will be out-of-bounds.
+ *
+ * DM_DEV_REMOVE:
+ * Remove a device, destroy any tables.
+ *
+ * DM_DEV_RENAME:
+ * Rename a device.
+ *
+ * DM_SUSPEND:
+ * This performs both suspend and resume, depending which flag is
+ * passed in.
+ * Suspend: This command will not return until all pending io to
+ * the device has completed. Further io will be deferred until
+ * the device is resumed.
+ * Resume: It is no longer an error to issue this command on an
+ * unsuspended device. If a table is present in the 'inactive'
+ * slot, it will be moved to the active slot, then the old table
+ * from the active slot will be _destroyed_. Finally the device
+ * is resumed.
+ *
+ * DM_DEV_STATUS:
+ * Retrieves the status for the table in the 'active' slot.
+ *
+ * DM_DEV_WAIT:
+ * Wait for a significant event to occur to the device. This
+ * could either be caused by an event triggered by one of the
+ * targets of the table in the 'active' slot, or a table change.
+ *
+ * DM_TABLE_LOAD:
+ * Load a table into the 'inactive' slot for the device. The
+ * device does _not_ need to be suspended prior to this command.
+ *
+ * DM_TABLE_CLEAR:
+ * Destroy any table in the 'inactive' slot (ie. abort).
+ *
+ * DM_TABLE_DEPS:
+ * Return a set of device dependencies for the 'active' table.
+ *
+ * DM_TABLE_STATUS:
+ * Return the targets status for the 'active' table.
+ *
+ * DM_TARGET_MSG:
+ * Pass a message string to the target at a specific offset of a device.
+ *
+ * DM_DEV_SET_GEOMETRY:
+ * Set the geometry of a device by passing in a string in this format:
+ *
+ * "cylinders heads sectors_per_track start_sector"
+ *
+ * Beware that CHS geometry is nearly obsolete and only provided
+ * for compatibility with dm devices that can be booted by a PC
+ * BIOS. See struct hd_geometry for range limits. Also note that
+ * the geometry is erased if the device size changes.
+ */
+
+/*
+ * All ioctl arguments consist of a single chunk of memory, with
+ * this structure at the start. If a uuid is specified any
+ * lookup (eg. for a DM_INFO) will be done on that, *not* the
+ * name.
+ */
+struct dm_ioctl {
+ /*
+ * The version number is made up of three parts:
+ * major - no backward or forward compatibility,
+ * minor - only backwards compatible,
+ * patch - both backwards and forwards compatible.
+ *
+ * All clients of the ioctl interface should fill in the
+ * version number of the interface that they were
+ * compiled with.
+ *
+ * All recognised ioctl commands (ie. those that don't
+ * return -ENOTTY) fill out this field, even if the
+ * command failed.
+ */
+ uint32_t version[3]; /* in/out */
+ uint32_t data_size; /* total size of data passed in
+ * including this struct */
+
+ uint32_t data_start; /* offset to start of data
+ * relative to start of this struct */
+
+ uint32_t target_count; /* in/out */
+ int32_t open_count; /* out */
+ uint32_t flags; /* in/out */
+ uint32_t event_nr; /* in/out */
+ uint32_t padding;
+
+ uint64_t dev; /* in/out */
+
+ char name[DM_NAME_LEN]; /* device name */
+ char uuid[DM_UUID_LEN]; /* unique identifier for
+ * the block device */
+ char data[7]; /* padding or data */
+};
+
+/*
+ * Used to specify tables. These structures appear after the
+ * dm_ioctl.
+ */
+struct dm_target_spec {
+ uint64_t sector_start;
+ uint64_t length;
+ int32_t status; /* used when reading from kernel only */
+
+ /*
+ * Location of the next dm_target_spec.
+ * - When specifying targets on a DM_TABLE_LOAD command, this value is
+ * the number of bytes from the start of the "current" dm_target_spec
+ * to the start of the "next" dm_target_spec.
+ * - When retrieving targets on a DM_TABLE_STATUS command, this value
+ * is the number of bytes from the start of the first dm_target_spec
+ * (that follows the dm_ioctl struct) to the start of the "next"
+ * dm_target_spec.
+ */
+ uint32_t next;
+
+ char target_type[DM_MAX_TYPE_NAME];
+
+ /*
+ * Parameter string starts immediately after this object.
+ * Be careful to add padding after string to ensure correct
+ * alignment of subsequent dm_target_spec.
+ */
+};
+
+/*
+ * Used to retrieve the target dependencies.
+ */
+struct dm_target_deps {
+ uint32_t count; /* Array size */
+ uint32_t padding; /* unused */
+ uint64_t dev[0]; /* out */
+};
+
+/*
+ * Used to get a list of all dm devices.
+ */
+struct dm_name_list {
+ uint64_t dev;
+ uint32_t next; /* offset to the next record from
+ the _start_ of this */
+ char name[0];
+};
+
+/*
+ * Used to retrieve the target versions
+ */
+struct dm_target_versions {
+ uint32_t next;
+ uint32_t version[3];
+
+ char name[0];
+};
+
+/*
+ * Used to pass message to a target
+ */
+struct dm_target_msg {
+ uint64_t sector; /* Device sector */
+
+ char message[0];
+};
+
+/*
+ * If you change this make sure you make the corresponding change
+ * to dm-ioctl.c:lookup_ioctl()
+ */
+enum {
+ /* Top level cmds */
+ DM_VERSION_CMD = 0,
+ DM_REMOVE_ALL_CMD,
+ DM_LIST_DEVICES_CMD,
+
+ /* device level cmds */
+ DM_DEV_CREATE_CMD,
+ DM_DEV_REMOVE_CMD,
+ DM_DEV_RENAME_CMD,
+ DM_DEV_SUSPEND_CMD,
+ DM_DEV_STATUS_CMD,
+ DM_DEV_WAIT_CMD,
+
+ /* Table level cmds */
+ DM_TABLE_LOAD_CMD,
+ DM_TABLE_CLEAR_CMD,
+ DM_TABLE_DEPS_CMD,
+ DM_TABLE_STATUS_CMD,
+
+ /* Added later */
+ DM_LIST_VERSIONS_CMD,
+ DM_TARGET_MSG_CMD,
+ DM_DEV_SET_GEOMETRY_CMD
+};
+
+/*
+ * The dm_ioctl struct passed into the ioctl is just the header
+ * on a larger chunk of memory. On x86-64 and other
+ * architectures the dm-ioctl struct will be padded to an 8 byte
+ * boundary so the size will be different, which would change the
+ * ioctl code - yes I really messed up. This hack forces these
+ * architectures to have the correct ioctl code.
+ */
+#ifdef CONFIG_COMPAT
+typedef char ioctl_struct[308];
+#define DM_VERSION_32 _IOWR(DM_IOCTL, DM_VERSION_CMD, ioctl_struct)
+#define DM_REMOVE_ALL_32 _IOWR(DM_IOCTL, DM_REMOVE_ALL_CMD, ioctl_struct)
+#define DM_LIST_DEVICES_32 _IOWR(DM_IOCTL, DM_LIST_DEVICES_CMD, ioctl_struct)
+
+#define DM_DEV_CREATE_32 _IOWR(DM_IOCTL, DM_DEV_CREATE_CMD, ioctl_struct)
+#define DM_DEV_REMOVE_32 _IOWR(DM_IOCTL, DM_DEV_REMOVE_CMD, ioctl_struct)
+#define DM_DEV_RENAME_32 _IOWR(DM_IOCTL, DM_DEV_RENAME_CMD, ioctl_struct)
+#define DM_DEV_SUSPEND_32 _IOWR(DM_IOCTL, DM_DEV_SUSPEND_CMD, ioctl_struct)
+#define DM_DEV_STATUS_32 _IOWR(DM_IOCTL, DM_DEV_STATUS_CMD, ioctl_struct)
+#define DM_DEV_WAIT_32 _IOWR(DM_IOCTL, DM_DEV_WAIT_CMD, ioctl_struct)
+
+#define DM_TABLE_LOAD_32 _IOWR(DM_IOCTL, DM_TABLE_LOAD_CMD, ioctl_struct)
+#define DM_TABLE_CLEAR_32 _IOWR(DM_IOCTL, DM_TABLE_CLEAR_CMD, ioctl_struct)
+#define DM_TABLE_DEPS_32 _IOWR(DM_IOCTL, DM_TABLE_DEPS_CMD, ioctl_struct)
+#define DM_TABLE_STATUS_32 _IOWR(DM_IOCTL, DM_TABLE_STATUS_CMD, ioctl_struct)
+#define DM_LIST_VERSIONS_32 _IOWR(DM_IOCTL, DM_LIST_VERSIONS_CMD, ioctl_struct)
+#define DM_TARGET_MSG_32 _IOWR(DM_IOCTL, DM_TARGET_MSG_CMD, ioctl_struct)
+#define DM_DEV_SET_GEOMETRY_32 _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, ioctl_struct)
+#endif
+
+#define DM_IOCTL 0xfd
+
+#define DM_VERSION _IOWR(DM_IOCTL, DM_VERSION_CMD, struct dm_ioctl)
+#define DM_REMOVE_ALL _IOWR(DM_IOCTL, DM_REMOVE_ALL_CMD, struct dm_ioctl)
+#define DM_LIST_DEVICES _IOWR(DM_IOCTL, DM_LIST_DEVICES_CMD, struct dm_ioctl)
+
+#define DM_DEV_CREATE _IOWR(DM_IOCTL, DM_DEV_CREATE_CMD, struct dm_ioctl)
+#define DM_DEV_REMOVE _IOWR(DM_IOCTL, DM_DEV_REMOVE_CMD, struct dm_ioctl)
+#define DM_DEV_RENAME _IOWR(DM_IOCTL, DM_DEV_RENAME_CMD, struct dm_ioctl)
+#define DM_DEV_SUSPEND _IOWR(DM_IOCTL, DM_DEV_SUSPEND_CMD, struct dm_ioctl)
+#define DM_DEV_STATUS _IOWR(DM_IOCTL, DM_DEV_STATUS_CMD, struct dm_ioctl)
+#define DM_DEV_WAIT _IOWR(DM_IOCTL, DM_DEV_WAIT_CMD, struct dm_ioctl)
+
+#define DM_TABLE_LOAD _IOWR(DM_IOCTL, DM_TABLE_LOAD_CMD, struct dm_ioctl)
+#define DM_TABLE_CLEAR _IOWR(DM_IOCTL, DM_TABLE_CLEAR_CMD, struct dm_ioctl)
+#define DM_TABLE_DEPS _IOWR(DM_IOCTL, DM_TABLE_DEPS_CMD, struct dm_ioctl)
+#define DM_TABLE_STATUS _IOWR(DM_IOCTL, DM_TABLE_STATUS_CMD, struct dm_ioctl)
+
+#define DM_LIST_VERSIONS _IOWR(DM_IOCTL, DM_LIST_VERSIONS_CMD, struct dm_ioctl)
+
+#define DM_TARGET_MSG _IOWR(DM_IOCTL, DM_TARGET_MSG_CMD, struct dm_ioctl)
+#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
+
+#define DM_VERSION_MAJOR 4
+#define DM_VERSION_MINOR 12
+#define DM_VERSION_PATCHLEVEL 0
+#define DM_VERSION_EXTRA "-ioctl (2007-10-02)"
+
+/* Status bits */
+#define DM_READONLY_FLAG (1 << 0) /* In/Out */
+#define DM_SUSPEND_FLAG (1 << 1) /* In/Out */
+#define DM_PERSISTENT_DEV_FLAG (1 << 3) /* In */
+
+/*
+ * Flag passed into ioctl STATUS command to get table information
+ * rather than current status.
+ */
+#define DM_STATUS_TABLE_FLAG (1 << 4) /* In */
+
+/*
+ * Flags that indicate whether a table is present in either of
+ * the two table slots that a device has.
+ */
+#define DM_ACTIVE_PRESENT_FLAG (1 << 5) /* Out */
+#define DM_INACTIVE_PRESENT_FLAG (1 << 6) /* Out */
+
+/*
+ * Indicates that the buffer passed in wasn't big enough for the
+ * results.
+ */
+#define DM_BUFFER_FULL_FLAG (1 << 8) /* Out */
+
+/*
+ * This flag is now ignored.
+ */
+#define DM_SKIP_BDGET_FLAG (1 << 9) /* In */
+
+/*
+ * Set this to avoid attempting to freeze any filesystem when suspending.
+ */
+#define DM_SKIP_LOCKFS_FLAG (1 << 10) /* In */
+
+/*
+ * Set this to suspend without flushing queued ios.
+ */
+#define DM_NOFLUSH_FLAG (1 << 11) /* In */
+
+#endif /* _LINUX_DM_IOCTL_H */
diff --git a/sysroot/usr/include/linux/dn.h b/sysroot/usr/include/linux/dn.h
new file mode 100644
index 0000000..02bba04
--- /dev/null
+++ b/sysroot/usr/include/linux/dn.h
@@ -0,0 +1,147 @@
+#ifndef _LINUX_DN_H
+#define _LINUX_DN_H
+
+/*
+
+ DECnet Data Structures and Constants
+
+*/
+
+/*
+ * DNPROTO_NSP can't be the same as SOL_SOCKET,
+ * so increment each by one (compared to ULTRIX)
+ */
+#define DNPROTO_NSP 2 /* NSP protocol number */
+#define DNPROTO_ROU 3 /* Routing protocol number */
+#define DNPROTO_NML 4 /* Net mgt protocol number */
+#define DNPROTO_EVL 5 /* Evl protocol number (usr) */
+#define DNPROTO_EVR 6 /* Evl protocol number (evl) */
+#define DNPROTO_NSPT 7 /* NSP trace protocol number */
+
+
+#define DN_ADDL 2
+#define DN_MAXADDL 2 /* ULTRIX headers have 20 here, but pathworks has 2 */
+#define DN_MAXOPTL 16
+#define DN_MAXOBJL 16
+#define DN_MAXACCL 40
+#define DN_MAXALIASL 128
+#define DN_MAXNODEL 256
+#define DNBUFSIZE 65023
+
+/*
+ * SET/GET Socket options - must match the DSO_ numbers below
+ */
+#define SO_CONDATA 1
+#define SO_CONACCESS 2
+#define SO_PROXYUSR 3
+#define SO_LINKINFO 7
+
+#define DSO_CONDATA 1 /* Set/Get connect data */
+#define DSO_DISDATA 10 /* Set/Get disconnect data */
+#define DSO_CONACCESS 2 /* Set/Get connect access data */
+#define DSO_ACCEPTMODE 4 /* Set/Get accept mode */
+#define DSO_CONACCEPT 5 /* Accept deferred connection */
+#define DSO_CONREJECT 6 /* Reject deferred connection */
+#define DSO_LINKINFO 7 /* Set/Get link information */
+#define DSO_STREAM 8 /* Set socket type to stream */
+#define DSO_SEQPACKET 9 /* Set socket type to sequenced packet */
+#define DSO_MAXWINDOW 11 /* Maximum window size allowed */
+#define DSO_NODELAY 12 /* Turn off nagle */
+#define DSO_CORK 13 /* Wait for more data! */
+#define DSO_SERVICES 14 /* NSP Services field */
+#define DSO_INFO 15 /* NSP Info field */
+#define DSO_MAX 15 /* Maximum option number */
+
+
+/* LINK States */
+#define LL_INACTIVE 0
+#define LL_CONNECTING 1
+#define LL_RUNNING 2
+#define LL_DISCONNECTING 3
+
+#define ACC_IMMED 0
+#define ACC_DEFER 1
+
+#define SDF_WILD 1 /* Wild card object */
+#define SDF_PROXY 2 /* Addr eligible for proxy */
+#define SDF_UICPROXY 4 /* Use uic-based proxy */
+
+/* Structures */
+
+
+struct dn_naddr
+{
+ __le16 a_len;
+ __u8 a_addr[DN_MAXADDL]; /* Two bytes little endian */
+};
+
+struct sockaddr_dn
+{
+ __u16 sdn_family;
+ __u8 sdn_flags;
+ __u8 sdn_objnum;
+ __le16 sdn_objnamel;
+ __u8 sdn_objname[DN_MAXOBJL];
+ struct dn_naddr sdn_add;
+};
+#define sdn_nodeaddrl sdn_add.a_len /* Node address length */
+#define sdn_nodeaddr sdn_add.a_addr /* Node address */
+
+
+
+/*
+ * DECnet set/get DSO_CONDATA, DSO_DISDATA (optional data) structure
+ */
+struct optdata_dn {
+ __le16 opt_status; /* Extended status return */
+#define opt_sts opt_status
+ __le16 opt_optl; /* Length of user data */
+ __u8 opt_data[16]; /* User data */
+};
+
+struct accessdata_dn
+{
+ __u8 acc_accl;
+ __u8 acc_acc[DN_MAXACCL];
+ __u8 acc_passl;
+ __u8 acc_pass[DN_MAXACCL];
+ __u8 acc_userl;
+ __u8 acc_user[DN_MAXACCL];
+};
+
+/*
+ * DECnet logical link information structure
+ */
+struct linkinfo_dn {
+ __u16 idn_segsize; /* Segment size for link */
+ __u8 idn_linkstate; /* Logical link state */
+};
+
+/*
+ * Ethernet address format (for DECnet)
+ */
+union etheraddress {
+ __u8 dne_addr[6]; /* Full ethernet address */
+ struct {
+ __u8 dne_hiord[4]; /* DECnet HIORD prefix */
+ __u8 dne_nodeaddr[2]; /* DECnet node address */
+ } dne_remote;
+};
+
+
+/*
+ * DECnet physical socket address format
+ */
+struct dn_addr {
+ __le16 dna_family; /* AF_DECnet */
+ union etheraddress dna_netaddr; /* DECnet ethernet address */
+};
+
+#define DECNET_IOCTL_BASE 0x89 /* PROTOPRIVATE range */
+
+#define SIOCSNETADDR _IOW(DECNET_IOCTL_BASE, 0xe0, struct dn_naddr)
+#define SIOCGNETADDR _IOR(DECNET_IOCTL_BASE, 0xe1, struct dn_naddr)
+#define OSIOCSNETADDR _IOW(DECNET_IOCTL_BASE, 0xe0, int)
+#define OSIOCGNETADDR _IOR(DECNET_IOCTL_BASE, 0xe1, int)
+
+#endif /* _LINUX_DN_H */
diff --git a/sysroot/usr/include/linux/dqblk_v1.h b/sysroot/usr/include/linux/dqblk_v1.h
new file mode 100644
index 0000000..57f1250
--- /dev/null
+++ b/sysroot/usr/include/linux/dqblk_v1.h
@@ -0,0 +1,24 @@
+/*
+ * File with in-memory structures of old quota format
+ */
+
+#ifndef _LINUX_DQBLK_V1_H
+#define _LINUX_DQBLK_V1_H
+
+/* Id of quota format */
+#define QFMT_VFS_OLD 1
+
+/* Root squash turned on */
+#define V1_DQF_RSQUASH 1
+
+/* Numbers of blocks needed for updates */
+#define V1_INIT_ALLOC 1
+#define V1_INIT_REWRITE 1
+#define V1_DEL_ALLOC 0
+#define V1_DEL_REWRITE 2
+
+/* Special information about quotafile */
+struct v1_mem_dqinfo {
+};
+
+#endif /* _LINUX_DQBLK_V1_H */
diff --git a/sysroot/usr/include/linux/dqblk_v2.h b/sysroot/usr/include/linux/dqblk_v2.h
new file mode 100644
index 0000000..4f85332
--- /dev/null
+++ b/sysroot/usr/include/linux/dqblk_v2.h
@@ -0,0 +1,26 @@
+/*
+ * Definitions of structures for vfsv0 quota format
+ */
+
+#ifndef _LINUX_DQBLK_V2_H
+#define _LINUX_DQBLK_V2_H
+
+#include <linux/types.h>
+
+/* id numbers of quota format */
+#define QFMT_VFS_V0 2
+
+/* Numbers of blocks needed for updates */
+#define V2_INIT_ALLOC 4
+#define V2_INIT_REWRITE 2
+#define V2_DEL_ALLOC 0
+#define V2_DEL_REWRITE 6
+
+/* Inmemory copy of version specific information */
+struct v2_mem_dqinfo {
+ unsigned int dqi_blocks;
+ unsigned int dqi_free_blk;
+ unsigned int dqi_free_entry;
+};
+
+#endif /* _LINUX_DQBLK_V2_H */
diff --git a/sysroot/usr/include/linux/dqblk_xfs.h b/sysroot/usr/include/linux/dqblk_xfs.h
new file mode 100644
index 0000000..527504c
--- /dev/null
+++ b/sysroot/usr/include/linux/dqblk_xfs.h
@@ -0,0 +1,157 @@
+/*
+ * Copyright (c) 1995-2001,2004 Silicon Graphics, Inc. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesset General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+#ifndef _LINUX_DQBLK_XFS_H
+#define _LINUX_DQBLK_XFS_H
+
+#include <linux/types.h>
+
+/*
+ * Disk quota - quotactl(2) commands for the XFS Quota Manager (XQM).
+ */
+
+#define XQM_CMD(x) (('X'<<8)+(x)) /* note: forms first QCMD argument */
+#define XQM_COMMAND(x) (((x) & (0xff<<8)) == ('X'<<8)) /* test if for XFS */
+
+#define XQM_USRQUOTA 0 /* system call user quota type */
+#define XQM_GRPQUOTA 1 /* system call group quota type */
+#define XQM_PRJQUOTA 2 /* system call project quota type */
+#define XQM_MAXQUOTAS 3
+
+#define Q_XQUOTAON XQM_CMD(1) /* enable accounting/enforcement */
+#define Q_XQUOTAOFF XQM_CMD(2) /* disable accounting/enforcement */
+#define Q_XGETQUOTA XQM_CMD(3) /* get disk limits and usage */
+#define Q_XSETQLIM XQM_CMD(4) /* set disk limits */
+#define Q_XGETQSTAT XQM_CMD(5) /* get quota subsystem status */
+#define Q_XQUOTARM XQM_CMD(6) /* free disk space used by dquots */
+#define Q_XQUOTASYNC XQM_CMD(7) /* delalloc flush, updates dquots */
+
+/*
+ * fs_disk_quota structure:
+ *
+ * This contains the current quota information regarding a user/proj/group.
+ * It is 64-bit aligned, and all the blk units are in BBs (Basic Blocks) of
+ * 512 bytes.
+ */
+#define FS_DQUOT_VERSION 1 /* fs_disk_quota.d_version */
+typedef struct fs_disk_quota {
+ __s8 d_version; /* version of this structure */
+ __s8 d_flags; /* XFS_{USER,PROJ,GROUP}_QUOTA */
+ __u16 d_fieldmask; /* field specifier */
+ __u32 d_id; /* user, project, or group ID */
+ __u64 d_blk_hardlimit;/* absolute limit on disk blks */
+ __u64 d_blk_softlimit;/* preferred limit on disk blks */
+ __u64 d_ino_hardlimit;/* maximum # allocated inodes */
+ __u64 d_ino_softlimit;/* preferred inode limit */
+ __u64 d_bcount; /* # disk blocks owned by the user */
+ __u64 d_icount; /* # inodes owned by the user */
+ __s32 d_itimer; /* zero if within inode limits */
+ /* if not, we refuse service */
+ __s32 d_btimer; /* similar to above; for disk blocks */
+ __u16 d_iwarns; /* # warnings issued wrt num inodes */
+ __u16 d_bwarns; /* # warnings issued wrt disk blocks */
+ __s32 d_padding2; /* padding2 - for future use */
+ __u64 d_rtb_hardlimit;/* absolute limit on realtime blks */
+ __u64 d_rtb_softlimit;/* preferred limit on RT disk blks */
+ __u64 d_rtbcount; /* # realtime blocks owned */
+ __s32 d_rtbtimer; /* similar to above; for RT disk blks */
+ __u16 d_rtbwarns; /* # warnings issued wrt RT disk blks */
+ __s16 d_padding3; /* padding3 - for future use */
+ char d_padding4[8]; /* yet more padding */
+} fs_disk_quota_t;
+
+/*
+ * These fields are sent to Q_XSETQLIM to specify fields that need to change.
+ */
+#define FS_DQ_ISOFT (1<<0)
+#define FS_DQ_IHARD (1<<1)
+#define FS_DQ_BSOFT (1<<2)
+#define FS_DQ_BHARD (1<<3)
+#define FS_DQ_RTBSOFT (1<<4)
+#define FS_DQ_RTBHARD (1<<5)
+#define FS_DQ_LIMIT_MASK (FS_DQ_ISOFT | FS_DQ_IHARD | FS_DQ_BSOFT | \
+ FS_DQ_BHARD | FS_DQ_RTBSOFT | FS_DQ_RTBHARD)
+/*
+ * These timers can only be set in super user's dquot. For others, timers are
+ * automatically started and stopped. Superusers timer values set the limits
+ * for the rest. In case these values are zero, the DQ_{F,B}TIMELIMIT values
+ * defined below are used.
+ * These values also apply only to the d_fieldmask field for Q_XSETQLIM.
+ */
+#define FS_DQ_BTIMER (1<<6)
+#define FS_DQ_ITIMER (1<<7)
+#define FS_DQ_RTBTIMER (1<<8)
+#define FS_DQ_TIMER_MASK (FS_DQ_BTIMER | FS_DQ_ITIMER | FS_DQ_RTBTIMER)
+
+/*
+ * Warning counts are set in both super user's dquot and others. For others,
+ * warnings are set/cleared by the administrators (or automatically by going
+ * below the soft limit). Superusers warning values set the warning limits
+ * for the rest. In case these values are zero, the DQ_{F,B}WARNLIMIT values
+ * defined below are used.
+ * These values also apply only to the d_fieldmask field for Q_XSETQLIM.
+ */
+#define FS_DQ_BWARNS (1<<9)
+#define FS_DQ_IWARNS (1<<10)
+#define FS_DQ_RTBWARNS (1<<11)
+#define FS_DQ_WARNS_MASK (FS_DQ_BWARNS | FS_DQ_IWARNS | FS_DQ_RTBWARNS)
+
+/*
+ * Various flags related to quotactl(2). Only relevant to XFS filesystems.
+ */
+#define XFS_QUOTA_UDQ_ACCT (1<<0) /* user quota accounting */
+#define XFS_QUOTA_UDQ_ENFD (1<<1) /* user quota limits enforcement */
+#define XFS_QUOTA_GDQ_ACCT (1<<2) /* group quota accounting */
+#define XFS_QUOTA_GDQ_ENFD (1<<3) /* group quota limits enforcement */
+#define XFS_QUOTA_PDQ_ACCT (1<<4) /* project quota accounting */
+#define XFS_QUOTA_PDQ_ENFD (1<<5) /* project quota limits enforcement */
+
+#define XFS_USER_QUOTA (1<<0) /* user quota type */
+#define XFS_PROJ_QUOTA (1<<1) /* project quota type */
+#define XFS_GROUP_QUOTA (1<<2) /* group quota type */
+
+/*
+ * fs_quota_stat is the struct returned in Q_XGETQSTAT for a given file system.
+ * Provides a centralized way to get meta information about the quota subsystem.
+ * eg. space taken up for user and group quotas, number of dquots currently
+ * incore.
+ */
+#define FS_QSTAT_VERSION 1 /* fs_quota_stat.qs_version */
+
+/*
+ * Some basic information about 'quota files'.
+ */
+typedef struct fs_qfilestat {
+ __u64 qfs_ino; /* inode number */
+ __u64 qfs_nblks; /* number of BBs 512-byte-blks */
+ __u32 qfs_nextents; /* number of extents */
+} fs_qfilestat_t;
+
+typedef struct fs_quota_stat {
+ __s8 qs_version; /* version number for future changes */
+ __u16 qs_flags; /* XFS_QUOTA_{U,P,G}DQ_{ACCT,ENFD} */
+ __s8 qs_pad; /* unused */
+ fs_qfilestat_t qs_uquota; /* user quota storage information */
+ fs_qfilestat_t qs_gquota; /* group quota storage information */
+ __u32 qs_incoredqs; /* number of dquots incore */
+ __s32 qs_btimelimit; /* limit for blks timer */
+ __s32 qs_itimelimit; /* limit for inodes timer */
+ __s32 qs_rtbtimelimit;/* limit for rt blks timer */
+ __u16 qs_bwarnlimit; /* limit for num warnings */
+ __u16 qs_iwarnlimit; /* limit for num warnings */
+} fs_quota_stat_t;
+
+#endif /* _LINUX_DQBLK_XFS_H */
diff --git a/sysroot/usr/include/linux/dvb/audio.h b/sysroot/usr/include/linux/dvb/audio.h
new file mode 100644
index 0000000..610e6b0
--- /dev/null
+++ b/sysroot/usr/include/linux/dvb/audio.h
@@ -0,0 +1,136 @@
+/*
+ * audio.h
+ *
+ * Copyright (C) 2000 Ralph Metzler <ralph@convergence.de>
+ * & Marcus Metzler <marcus@convergence.de>
+ * for convergence integrated media GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Lesser Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef _DVBAUDIO_H_
+#define _DVBAUDIO_H_
+
+#include <stdint.h>
+
+
+typedef enum {
+ AUDIO_SOURCE_DEMUX, /* Select the demux as the main source */
+ AUDIO_SOURCE_MEMORY /* Select internal memory as the main source */
+} audio_stream_source_t;
+
+
+typedef enum {
+ AUDIO_STOPPED, /* Device is stopped */
+ AUDIO_PLAYING, /* Device is currently playing */
+ AUDIO_PAUSED /* Device is paused */
+} audio_play_state_t;
+
+
+typedef enum {
+ AUDIO_STEREO,
+ AUDIO_MONO_LEFT,
+ AUDIO_MONO_RIGHT,
+ AUDIO_MONO,
+ AUDIO_STEREO_SWAPPED
+} audio_channel_select_t;
+
+
+typedef struct audio_mixer {
+ unsigned int volume_left;
+ unsigned int volume_right;
+ // what else do we need? bass, pass-through, ...
+} audio_mixer_t;
+
+
+typedef struct audio_status {
+ int AV_sync_state; /* sync audio and video? */
+ int mute_state; /* audio is muted */
+ audio_play_state_t play_state; /* current playback state */
+ audio_stream_source_t stream_source; /* current stream source */
+ audio_channel_select_t channel_select; /* currently selected channel */
+ int bypass_mode; /* pass on audio data to */
+ audio_mixer_t mixer_state; /* current mixer state */
+} audio_status_t; /* separate decoder hardware */
+
+
+typedef
+struct audio_karaoke{ /* if Vocal1 or Vocal2 are non-zero, they get mixed */
+ int vocal1; /* into left and right t at 70% each */
+ int vocal2; /* if both, Vocal1 and Vocal2 are non-zero, Vocal1 gets*/
+ int melody; /* mixed into the left channel and */
+ /* Vocal2 into the right channel at 100% each. */
+ /* if Melody is non-zero, the melody channel gets mixed*/
+} audio_karaoke_t; /* into left and right */
+
+
+typedef uint16_t audio_attributes_t;
+/* bits: descr. */
+/* 15-13 audio coding mode (0=ac3, 2=mpeg1, 3=mpeg2ext, 4=LPCM, 6=DTS, */
+/* 12 multichannel extension */
+/* 11-10 audio type (0=not spec, 1=language included) */
+/* 9- 8 audio application mode (0=not spec, 1=karaoke, 2=surround) */
+/* 7- 6 Quantization / DRC (mpeg audio: 1=DRC exists)(lpcm: 0=16bit, */
+/* 5- 4 Sample frequency fs (0=48kHz, 1=96kHz) */
+/* 2- 0 number of audio channels (n+1 channels) */
+
+
+/* for GET_CAPABILITIES and SET_FORMAT, the latter should only set one bit */
+#define AUDIO_CAP_DTS 1
+#define AUDIO_CAP_LPCM 2
+#define AUDIO_CAP_MP1 4
+#define AUDIO_CAP_MP2 8
+#define AUDIO_CAP_MP3 16
+#define AUDIO_CAP_AAC 32
+#define AUDIO_CAP_OGG 64
+#define AUDIO_CAP_SDDS 128
+#define AUDIO_CAP_AC3 256
+
+#define AUDIO_STOP _IO('o', 1)
+#define AUDIO_PLAY _IO('o', 2)
+#define AUDIO_PAUSE _IO('o', 3)
+#define AUDIO_CONTINUE _IO('o', 4)
+#define AUDIO_SELECT_SOURCE _IO('o', 5)
+#define AUDIO_SET_MUTE _IO('o', 6)
+#define AUDIO_SET_AV_SYNC _IO('o', 7)
+#define AUDIO_SET_BYPASS_MODE _IO('o', 8)
+#define AUDIO_CHANNEL_SELECT _IO('o', 9)
+#define AUDIO_GET_STATUS _IOR('o', 10, audio_status_t)
+
+#define AUDIO_GET_CAPABILITIES _IOR('o', 11, unsigned int)
+#define AUDIO_CLEAR_BUFFER _IO('o', 12)
+#define AUDIO_SET_ID _IO('o', 13)
+#define AUDIO_SET_MIXER _IOW('o', 14, audio_mixer_t)
+#define AUDIO_SET_STREAMTYPE _IO('o', 15)
+#define AUDIO_SET_EXT_ID _IO('o', 16)
+#define AUDIO_SET_ATTRIBUTES _IOW('o', 17, audio_attributes_t)
+#define AUDIO_SET_KARAOKE _IOW('o', 18, audio_karaoke_t)
+
+/**
+ * AUDIO_GET_PTS
+ *
+ * Read the 33 bit presentation time stamp as defined
+ * in ITU T-REC-H.222.0 / ISO/IEC 13818-1.
+ *
+ * The PTS should belong to the currently played
+ * frame if possible, but may also be a value close to it
+ * like the PTS of the last decoded frame or the last PTS
+ * extracted by the PES parser.
+ */
+#define AUDIO_GET_PTS _IOR('o', 19, __u64)
+#define AUDIO_BILINGUAL_CHANNEL_SELECT _IO('o', 20)
+
+#endif /* _DVBAUDIO_H_ */
diff --git a/sysroot/usr/include/linux/dvb/ca.h b/sysroot/usr/include/linux/dvb/ca.h
new file mode 100644
index 0000000..c18537f
--- /dev/null
+++ b/sysroot/usr/include/linux/dvb/ca.h
@@ -0,0 +1,90 @@
+/*
+ * ca.h
+ *
+ * Copyright (C) 2000 Ralph Metzler <ralph@convergence.de>
+ * & Marcus Metzler <marcus@convergence.de>
+ * for convergence integrated media GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Lesser Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef _DVBCA_H_
+#define _DVBCA_H_
+
+/* slot interface types and info */
+
+typedef struct ca_slot_info {
+ int num; /* slot number */
+
+ int type; /* CA interface this slot supports */
+#define CA_CI 1 /* CI high level interface */
+#define CA_CI_LINK 2 /* CI link layer level interface */
+#define CA_CI_PHYS 4 /* CI physical layer level interface */
+#define CA_DESCR 8 /* built-in descrambler */
+#define CA_SC 128 /* simple smart card interface */
+
+ unsigned int flags;
+#define CA_CI_MODULE_PRESENT 1 /* module (or card) inserted */
+#define CA_CI_MODULE_READY 2
+} ca_slot_info_t;
+
+
+/* descrambler types and info */
+
+typedef struct ca_descr_info {
+ unsigned int num; /* number of available descramblers (keys) */
+ unsigned int type; /* type of supported scrambling system */
+#define CA_ECD 1
+#define CA_NDS 2
+#define CA_DSS 4
+} ca_descr_info_t;
+
+typedef struct ca_caps {
+ unsigned int slot_num; /* total number of CA card and module slots */
+ unsigned int slot_type; /* OR of all supported types */
+ unsigned int descr_num; /* total number of descrambler slots (keys) */
+ unsigned int descr_type; /* OR of all supported types */
+} ca_caps_t;
+
+/* a message to/from a CI-CAM */
+typedef struct ca_msg {
+ unsigned int index;
+ unsigned int type;
+ unsigned int length;
+ unsigned char msg[256];
+} ca_msg_t;
+
+typedef struct ca_descr {
+ unsigned int index;
+ unsigned int parity; /* 0 == even, 1 == odd */
+ unsigned char cw[8];
+} ca_descr_t;
+
+typedef struct ca_pid {
+ unsigned int pid;
+ int index; /* -1 == disable*/
+} ca_pid_t;
+
+#define CA_RESET _IO('o', 128)
+#define CA_GET_CAP _IOR('o', 129, ca_caps_t)
+#define CA_GET_SLOT_INFO _IOR('o', 130, ca_slot_info_t)
+#define CA_GET_DESCR_INFO _IOR('o', 131, ca_descr_info_t)
+#define CA_GET_MSG _IOR('o', 132, ca_msg_t)
+#define CA_SEND_MSG _IOW('o', 133, ca_msg_t)
+#define CA_SET_DESCR _IOW('o', 134, ca_descr_t)
+#define CA_SET_PID _IOW('o', 135, ca_pid_t)
+
+#endif
diff --git a/sysroot/usr/include/linux/dvb/dmx.h b/sysroot/usr/include/linux/dvb/dmx.h
new file mode 100644
index 0000000..1e29ec7
--- /dev/null
+++ b/sysroot/usr/include/linux/dvb/dmx.h
@@ -0,0 +1,150 @@
+/*
+ * dmx.h
+ *
+ * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
+ * & Ralph Metzler <ralph@convergence.de>
+ * for convergence integrated media GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef _DVBDMX_H_
+#define _DVBDMX_H_
+
+#include <asm/types.h>
+#include <time.h>
+
+
+#define DMX_FILTER_SIZE 16
+
+typedef enum
+{
+ DMX_OUT_DECODER, /* Streaming directly to decoder. */
+ DMX_OUT_TAP, /* Output going to a memory buffer */
+ /* (to be retrieved via the read command).*/
+ DMX_OUT_TS_TAP /* Output multiplexed into a new TS */
+ /* (to be retrieved by reading from the */
+ /* logical DVR device). */
+} dmx_output_t;
+
+
+typedef enum
+{
+ DMX_IN_FRONTEND, /* Input from a front-end device. */
+ DMX_IN_DVR /* Input from the logical DVR device. */
+} dmx_input_t;
+
+
+typedef enum
+{
+ DMX_PES_AUDIO0,
+ DMX_PES_VIDEO0,
+ DMX_PES_TELETEXT0,
+ DMX_PES_SUBTITLE0,
+ DMX_PES_PCR0,
+
+ DMX_PES_AUDIO1,
+ DMX_PES_VIDEO1,
+ DMX_PES_TELETEXT1,
+ DMX_PES_SUBTITLE1,
+ DMX_PES_PCR1,
+
+ DMX_PES_AUDIO2,
+ DMX_PES_VIDEO2,
+ DMX_PES_TELETEXT2,
+ DMX_PES_SUBTITLE2,
+ DMX_PES_PCR2,
+
+ DMX_PES_AUDIO3,
+ DMX_PES_VIDEO3,
+ DMX_PES_TELETEXT3,
+ DMX_PES_SUBTITLE3,
+ DMX_PES_PCR3,
+
+ DMX_PES_OTHER
+} dmx_pes_type_t;
+
+#define DMX_PES_AUDIO DMX_PES_AUDIO0
+#define DMX_PES_VIDEO DMX_PES_VIDEO0
+#define DMX_PES_TELETEXT DMX_PES_TELETEXT0
+#define DMX_PES_SUBTITLE DMX_PES_SUBTITLE0
+#define DMX_PES_PCR DMX_PES_PCR0
+
+
+typedef struct dmx_filter
+{
+ __u8 filter[DMX_FILTER_SIZE];
+ __u8 mask[DMX_FILTER_SIZE];
+ __u8 mode[DMX_FILTER_SIZE];
+} dmx_filter_t;
+
+
+struct dmx_sct_filter_params
+{
+ __u16 pid;
+ dmx_filter_t filter;
+ __u32 timeout;
+ __u32 flags;
+#define DMX_CHECK_CRC 1
+#define DMX_ONESHOT 2
+#define DMX_IMMEDIATE_START 4
+#define DMX_KERNEL_CLIENT 0x8000
+};
+
+
+struct dmx_pes_filter_params
+{
+ __u16 pid;
+ dmx_input_t input;
+ dmx_output_t output;
+ dmx_pes_type_t pes_type;
+ __u32 flags;
+};
+
+typedef struct dmx_caps {
+ __u32 caps;
+ int num_decoders;
+} dmx_caps_t;
+
+typedef enum {
+ DMX_SOURCE_FRONT0 = 0,
+ DMX_SOURCE_FRONT1,
+ DMX_SOURCE_FRONT2,
+ DMX_SOURCE_FRONT3,
+ DMX_SOURCE_DVR0 = 16,
+ DMX_SOURCE_DVR1,
+ DMX_SOURCE_DVR2,
+ DMX_SOURCE_DVR3
+} dmx_source_t;
+
+struct dmx_stc {
+ unsigned int num; /* input : which STC? 0..N */
+ unsigned int base; /* output: divisor for stc to get 90 kHz clock */
+ __u64 stc; /* output: stc in 'base'*90 kHz units */
+};
+
+
+#define DMX_START _IO('o', 41)
+#define DMX_STOP _IO('o', 42)
+#define DMX_SET_FILTER _IOW('o', 43, struct dmx_sct_filter_params)
+#define DMX_SET_PES_FILTER _IOW('o', 44, struct dmx_pes_filter_params)
+#define DMX_SET_BUFFER_SIZE _IO('o', 45)
+#define DMX_GET_PES_PIDS _IOR('o', 47, __u16[5])
+#define DMX_GET_CAPS _IOR('o', 48, dmx_caps_t)
+#define DMX_SET_SOURCE _IOW('o', 49, dmx_source_t)
+#define DMX_GET_STC _IOWR('o', 50, struct dmx_stc)
+
+#endif /*_DVBDMX_H_*/
diff --git a/sysroot/usr/include/linux/dvb/frontend.h b/sysroot/usr/include/linux/dvb/frontend.h
new file mode 100644
index 0000000..c8cbd90
--- /dev/null
+++ b/sysroot/usr/include/linux/dvb/frontend.h
@@ -0,0 +1,277 @@
+/*
+ * frontend.h
+ *
+ * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
+ * Ralph Metzler <ralph@convergence.de>
+ * Holger Waechtler <holger@convergence.de>
+ * Andre Draszik <ad@convergence.de>
+ * for convergence integrated media GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef _DVBFRONTEND_H_
+#define _DVBFRONTEND_H_
+
+#include <asm/types.h>
+
+
+typedef enum fe_type {
+ FE_QPSK,
+ FE_QAM,
+ FE_OFDM,
+ FE_ATSC
+} fe_type_t;
+
+
+typedef enum fe_caps {
+ FE_IS_STUPID = 0,
+ FE_CAN_INVERSION_AUTO = 0x1,
+ FE_CAN_FEC_1_2 = 0x2,
+ FE_CAN_FEC_2_3 = 0x4,
+ FE_CAN_FEC_3_4 = 0x8,
+ FE_CAN_FEC_4_5 = 0x10,
+ FE_CAN_FEC_5_6 = 0x20,
+ FE_CAN_FEC_6_7 = 0x40,
+ FE_CAN_FEC_7_8 = 0x80,
+ FE_CAN_FEC_8_9 = 0x100,
+ FE_CAN_FEC_AUTO = 0x200,
+ FE_CAN_QPSK = 0x400,
+ FE_CAN_QAM_16 = 0x800,
+ FE_CAN_QAM_32 = 0x1000,
+ FE_CAN_QAM_64 = 0x2000,
+ FE_CAN_QAM_128 = 0x4000,
+ FE_CAN_QAM_256 = 0x8000,
+ FE_CAN_QAM_AUTO = 0x10000,
+ FE_CAN_TRANSMISSION_MODE_AUTO = 0x20000,
+ FE_CAN_BANDWIDTH_AUTO = 0x40000,
+ FE_CAN_GUARD_INTERVAL_AUTO = 0x80000,
+ FE_CAN_HIERARCHY_AUTO = 0x100000,
+ FE_CAN_8VSB = 0x200000,
+ FE_CAN_16VSB = 0x400000,
+ FE_NEEDS_BENDING = 0x20000000, // not supported anymore, don't use (frontend requires frequency bending)
+ FE_CAN_RECOVER = 0x40000000, // frontend can recover from a cable unplug automatically
+ FE_CAN_MUTE_TS = 0x80000000 // frontend can stop spurious TS data output
+} fe_caps_t;
+
+
+struct dvb_frontend_info {
+ char name[128];
+ fe_type_t type;
+ __u32 frequency_min;
+ __u32 frequency_max;
+ __u32 frequency_stepsize;
+ __u32 frequency_tolerance;
+ __u32 symbol_rate_min;
+ __u32 symbol_rate_max;
+ __u32 symbol_rate_tolerance; /* ppm */
+ __u32 notifier_delay; /* DEPRECATED */
+ fe_caps_t caps;
+};
+
+
+/**
+ * Check out the DiSEqC bus spec available on http://www.eutelsat.org/ for
+ * the meaning of this struct...
+ */
+struct dvb_diseqc_master_cmd {
+ __u8 msg [6]; /* { framing, address, command, data [3] } */
+ __u8 msg_len; /* valid values are 3...6 */
+};
+
+
+struct dvb_diseqc_slave_reply {
+ __u8 msg [4]; /* { framing, data [3] } */
+ __u8 msg_len; /* valid values are 0...4, 0 means no msg */
+ int timeout; /* return from ioctl after timeout ms with */
+}; /* errorcode when no message was received */
+
+
+typedef enum fe_sec_voltage {
+ SEC_VOLTAGE_13,
+ SEC_VOLTAGE_18,
+ SEC_VOLTAGE_OFF
+} fe_sec_voltage_t;
+
+
+typedef enum fe_sec_tone_mode {
+ SEC_TONE_ON,
+ SEC_TONE_OFF
+} fe_sec_tone_mode_t;
+
+
+typedef enum fe_sec_mini_cmd {
+ SEC_MINI_A,
+ SEC_MINI_B
+} fe_sec_mini_cmd_t;
+
+
+typedef enum fe_status {
+ FE_HAS_SIGNAL = 0x01, /* found something above the noise level */
+ FE_HAS_CARRIER = 0x02, /* found a DVB signal */
+ FE_HAS_VITERBI = 0x04, /* FEC is stable */
+ FE_HAS_SYNC = 0x08, /* found sync bytes */
+ FE_HAS_LOCK = 0x10, /* everything's working... */
+ FE_TIMEDOUT = 0x20, /* no lock within the last ~2 seconds */
+ FE_REINIT = 0x40 /* frontend was reinitialized, */
+} fe_status_t; /* application is recommended to reset */
+ /* DiSEqC, tone and parameters */
+
+typedef enum fe_spectral_inversion {
+ INVERSION_OFF,
+ INVERSION_ON,
+ INVERSION_AUTO
+} fe_spectral_inversion_t;
+
+
+typedef enum fe_code_rate {
+ FEC_NONE = 0,
+ FEC_1_2,
+ FEC_2_3,
+ FEC_3_4,
+ FEC_4_5,
+ FEC_5_6,
+ FEC_6_7,
+ FEC_7_8,
+ FEC_8_9,
+ FEC_AUTO
+} fe_code_rate_t;
+
+
+typedef enum fe_modulation {
+ QPSK,
+ QAM_16,
+ QAM_32,
+ QAM_64,
+ QAM_128,
+ QAM_256,
+ QAM_AUTO,
+ VSB_8,
+ VSB_16
+} fe_modulation_t;
+
+typedef enum fe_transmit_mode {
+ TRANSMISSION_MODE_2K,
+ TRANSMISSION_MODE_8K,
+ TRANSMISSION_MODE_AUTO
+} fe_transmit_mode_t;
+
+typedef enum fe_bandwidth {
+ BANDWIDTH_8_MHZ,
+ BANDWIDTH_7_MHZ,
+ BANDWIDTH_6_MHZ,
+ BANDWIDTH_AUTO
+} fe_bandwidth_t;
+
+
+typedef enum fe_guard_interval {
+ GUARD_INTERVAL_1_32,
+ GUARD_INTERVAL_1_16,
+ GUARD_INTERVAL_1_8,
+ GUARD_INTERVAL_1_4,
+ GUARD_INTERVAL_AUTO
+} fe_guard_interval_t;
+
+
+typedef enum fe_hierarchy {
+ HIERARCHY_NONE,
+ HIERARCHY_1,
+ HIERARCHY_2,
+ HIERARCHY_4,
+ HIERARCHY_AUTO
+} fe_hierarchy_t;
+
+
+struct dvb_qpsk_parameters {
+ __u32 symbol_rate; /* symbol rate in Symbols per second */
+ fe_code_rate_t fec_inner; /* forward error correction (see above) */
+};
+
+struct dvb_qam_parameters {
+ __u32 symbol_rate; /* symbol rate in Symbols per second */
+ fe_code_rate_t fec_inner; /* forward error correction (see above) */
+ fe_modulation_t modulation; /* modulation type (see above) */
+};
+
+struct dvb_vsb_parameters {
+ fe_modulation_t modulation; /* modulation type (see above) */
+};
+
+struct dvb_ofdm_parameters {
+ fe_bandwidth_t bandwidth;
+ fe_code_rate_t code_rate_HP; /* high priority stream code rate */
+ fe_code_rate_t code_rate_LP; /* low priority stream code rate */
+ fe_modulation_t constellation; /* modulation type (see above) */
+ fe_transmit_mode_t transmission_mode;
+ fe_guard_interval_t guard_interval;
+ fe_hierarchy_t hierarchy_information;
+};
+
+
+struct dvb_frontend_parameters {
+ __u32 frequency; /* (absolute) frequency in Hz for QAM/OFDM/ATSC */
+ /* intermediate frequency in kHz for QPSK */
+ fe_spectral_inversion_t inversion;
+ union {
+ struct dvb_qpsk_parameters qpsk;
+ struct dvb_qam_parameters qam;
+ struct dvb_ofdm_parameters ofdm;
+ struct dvb_vsb_parameters vsb;
+ } u;
+};
+
+
+struct dvb_frontend_event {
+ fe_status_t status;
+ struct dvb_frontend_parameters parameters;
+};
+
+
+/**
+ * When set, this flag will disable any zigzagging or other "normal" tuning
+ * behaviour. Additionally, there will be no automatic monitoring of the lock
+ * status, and hence no frontend events will be generated. If a frontend device
+ * is closed, this flag will be automatically turned off when the device is
+ * reopened read-write.
+ */
+#define FE_TUNE_MODE_ONESHOT 0x01
+
+
+#define FE_GET_INFO _IOR('o', 61, struct dvb_frontend_info)
+
+#define FE_DISEQC_RESET_OVERLOAD _IO('o', 62)
+#define FE_DISEQC_SEND_MASTER_CMD _IOW('o', 63, struct dvb_diseqc_master_cmd)
+#define FE_DISEQC_RECV_SLAVE_REPLY _IOR('o', 64, struct dvb_diseqc_slave_reply)
+#define FE_DISEQC_SEND_BURST _IO('o', 65) /* fe_sec_mini_cmd_t */
+
+#define FE_SET_TONE _IO('o', 66) /* fe_sec_tone_mode_t */
+#define FE_SET_VOLTAGE _IO('o', 67) /* fe_sec_voltage_t */
+#define FE_ENABLE_HIGH_LNB_VOLTAGE _IO('o', 68) /* int */
+
+#define FE_READ_STATUS _IOR('o', 69, fe_status_t)
+#define FE_READ_BER _IOR('o', 70, __u32)
+#define FE_READ_SIGNAL_STRENGTH _IOR('o', 71, __u16)
+#define FE_READ_SNR _IOR('o', 72, __u16)
+#define FE_READ_UNCORRECTED_BLOCKS _IOR('o', 73, __u32)
+
+#define FE_SET_FRONTEND _IOW('o', 76, struct dvb_frontend_parameters)
+#define FE_GET_FRONTEND _IOR('o', 77, struct dvb_frontend_parameters)
+#define FE_SET_FRONTEND_TUNE_MODE _IO('o', 81) /* unsigned int */
+#define FE_GET_EVENT _IOR('o', 78, struct dvb_frontend_event)
+
+#define FE_DISHNETWORK_SEND_LEGACY_CMD _IO('o', 80) /* unsigned int */
+
+#endif /*_DVBFRONTEND_H_*/
diff --git a/sysroot/usr/include/linux/dvb/net.h b/sysroot/usr/include/linux/dvb/net.h
new file mode 100644
index 0000000..5be474b
--- /dev/null
+++ b/sysroot/usr/include/linux/dvb/net.h
@@ -0,0 +1,53 @@
+/*
+ * net.h
+ *
+ * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
+ * & Ralph Metzler <ralph@convergence.de>
+ * for convergence integrated media GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef _DVBNET_H_
+#define _DVBNET_H_
+
+#include <asm/types.h>
+
+
+struct dvb_net_if {
+ __u16 pid;
+ __u16 if_num;
+ __u8 feedtype;
+#define DVB_NET_FEEDTYPE_MPE 0 /* multi protocol encapsulation */
+#define DVB_NET_FEEDTYPE_ULE 1 /* ultra lightweight encapsulation */
+};
+
+
+#define NET_ADD_IF _IOWR('o', 52, struct dvb_net_if)
+#define NET_REMOVE_IF _IO('o', 53)
+#define NET_GET_IF _IOWR('o', 54, struct dvb_net_if)
+
+
+/* binary compatibility cruft: */
+struct __dvb_net_if_old {
+ __u16 pid;
+ __u16 if_num;
+};
+#define __NET_ADD_IF_OLD _IOWR('o', 52, struct __dvb_net_if_old)
+#define __NET_GET_IF_OLD _IOWR('o', 54, struct __dvb_net_if_old)
+
+
+#endif /*_DVBNET_H_*/
diff --git a/sysroot/usr/include/linux/dvb/osd.h b/sysroot/usr/include/linux/dvb/osd.h
new file mode 100644
index 0000000..ba9d052
--- /dev/null
+++ b/sysroot/usr/include/linux/dvb/osd.h
@@ -0,0 +1,143 @@
+/*
+ * osd.h
+ *
+ * Copyright (C) 2001 Ralph Metzler <ralph@convergence.de>
+ * & Marcus Metzler <marcus@convergence.de>
+ * for convergence integrated media GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Lesser Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef _DVBOSD_H_
+#define _DVBOSD_H_
+
+
+typedef enum {
+ // All functions return -2 on "not open"
+ OSD_Close=1, // ()
+ // Disables OSD and releases the buffers
+ // returns 0 on success
+ OSD_Open, // (x0,y0,x1,y1,BitPerPixel[2/4/8](color&0x0F),mix[0..15](color&0xF0))
+ // Opens OSD with this size and bit depth
+ // returns 0 on success, -1 on DRAM allocation error, -2 on "already open"
+ OSD_Show, // ()
+ // enables OSD mode
+ // returns 0 on success
+ OSD_Hide, // ()
+ // disables OSD mode
+ // returns 0 on success
+ OSD_Clear, // ()
+ // Sets all pixel to color 0
+ // returns 0 on success
+ OSD_Fill, // (color)
+ // Sets all pixel to color <col>
+ // returns 0 on success
+ OSD_SetColor, // (color,R{x0},G{y0},B{x1},opacity{y1})
+ // set palette entry <num> to <r,g,b>, <mix> and <trans> apply
+ // R,G,B: 0..255
+ // R=Red, G=Green, B=Blue
+ // opacity=0: pixel opacity 0% (only video pixel shows)
+ // opacity=1..254: pixel opacity as specified in header
+ // opacity=255: pixel opacity 100% (only OSD pixel shows)
+ // returns 0 on success, -1 on error
+ OSD_SetPalette, // (firstcolor{color},lastcolor{x0},data)
+ // Set a number of entries in the palette
+ // sets the entries "firstcolor" through "lastcolor" from the array "data"
+ // data has 4 byte for each color:
+ // R,G,B, and a opacity value: 0->transparent, 1..254->mix, 255->pixel
+ OSD_SetTrans, // (transparency{color})
+ // Sets transparency of mixed pixel (0..15)
+ // returns 0 on success
+ OSD_SetPixel, // (x0,y0,color)
+ // sets pixel <x>,<y> to color number <col>
+ // returns 0 on success, -1 on error
+ OSD_GetPixel, // (x0,y0)
+ // returns color number of pixel <x>,<y>, or -1
+ OSD_SetRow, // (x0,y0,x1,data)
+ // fills pixels x0,y through x1,y with the content of data[]
+ // returns 0 on success, -1 on clipping all pixel (no pixel drawn)
+ OSD_SetBlock, // (x0,y0,x1,y1,increment{color},data)
+ // fills pixels x0,y0 through x1,y1 with the content of data[]
+ // inc contains the width of one line in the data block,
+ // inc<=0 uses blockwidth as linewidth
+ // returns 0 on success, -1 on clipping all pixel
+ OSD_FillRow, // (x0,y0,x1,color)
+ // fills pixels x0,y through x1,y with the color <col>
+ // returns 0 on success, -1 on clipping all pixel
+ OSD_FillBlock, // (x0,y0,x1,y1,color)
+ // fills pixels x0,y0 through x1,y1 with the color <col>
+ // returns 0 on success, -1 on clipping all pixel
+ OSD_Line, // (x0,y0,x1,y1,color)
+ // draw a line from x0,y0 to x1,y1 with the color <col>
+ // returns 0 on success
+ OSD_Query, // (x0,y0,x1,y1,xasp{color}}), yasp=11
+ // fills parameters with the picture dimensions and the pixel aspect ratio
+ // returns 0 on success
+ OSD_Test, // ()
+ // draws a test picture. for debugging purposes only
+ // returns 0 on success
+// TODO: remove "test" in final version
+ OSD_Text, // (x0,y0,size,color,text)
+ OSD_SetWindow, // (x0) set window with number 0<x0<8 as current
+ OSD_MoveWindow, // move current window to (x0, y0)
+ OSD_OpenRaw, // Open other types of OSD windows
+} OSD_Command;
+
+typedef struct osd_cmd_s {
+ OSD_Command cmd;
+ int x0;
+ int y0;
+ int x1;
+ int y1;
+ int color;
+ void *data;
+} osd_cmd_t;
+
+/* OSD_OpenRaw: set 'color' to desired window type */
+typedef enum {
+ OSD_BITMAP1, /* 1 bit bitmap */
+ OSD_BITMAP2, /* 2 bit bitmap */
+ OSD_BITMAP4, /* 4 bit bitmap */
+ OSD_BITMAP8, /* 8 bit bitmap */
+ OSD_BITMAP1HR, /* 1 Bit bitmap half resolution */
+ OSD_BITMAP2HR, /* 2 bit bitmap half resolution */
+ OSD_BITMAP4HR, /* 4 bit bitmap half resolution */
+ OSD_BITMAP8HR, /* 8 bit bitmap half resolution */
+ OSD_YCRCB422, /* 4:2:2 YCRCB Graphic Display */
+ OSD_YCRCB444, /* 4:4:4 YCRCB Graphic Display */
+ OSD_YCRCB444HR, /* 4:4:4 YCRCB graphic half resolution */
+ OSD_VIDEOTSIZE, /* True Size Normal MPEG Video Display */
+ OSD_VIDEOHSIZE, /* MPEG Video Display Half Resolution */
+ OSD_VIDEOQSIZE, /* MPEG Video Display Quarter Resolution */
+ OSD_VIDEODSIZE, /* MPEG Video Display Double Resolution */
+ OSD_VIDEOTHSIZE, /* True Size MPEG Video Display Half Resolution */
+ OSD_VIDEOTQSIZE, /* True Size MPEG Video Display Quarter Resolution*/
+ OSD_VIDEOTDSIZE, /* True Size MPEG Video Display Double Resolution */
+ OSD_VIDEONSIZE, /* Full Size MPEG Video Display */
+ OSD_CURSOR /* Cursor */
+} osd_raw_window_t;
+
+typedef struct osd_cap_s {
+ int cmd;
+#define OSD_CAP_MEMSIZE 1 /* memory size */
+ long val;
+} osd_cap_t;
+
+
+#define OSD_SEND_CMD _IOW('o', 160, osd_cmd_t)
+#define OSD_GET_CAPABILITY _IOR('o', 161, osd_cap_t)
+
+#endif
diff --git a/sysroot/usr/include/linux/dvb/version.h b/sysroot/usr/include/linux/dvb/version.h
new file mode 100644
index 0000000..126e0c2
--- /dev/null
+++ b/sysroot/usr/include/linux/dvb/version.h
@@ -0,0 +1,29 @@
+/*
+ * version.h
+ *
+ * Copyright (C) 2000 Holger Waechtler <holger@convergence.de>
+ * for convergence integrated media GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef _DVBVERSION_H_
+#define _DVBVERSION_H_
+
+#define DVB_API_VERSION 3
+#define DVB_API_VERSION_MINOR 2
+
+#endif /*_DVBVERSION_H_*/
diff --git a/sysroot/usr/include/linux/dvb/video.h b/sysroot/usr/include/linux/dvb/video.h
new file mode 100644
index 0000000..a5de1f3
--- /dev/null
+++ b/sysroot/usr/include/linux/dvb/video.h
@@ -0,0 +1,274 @@
+/*
+ * video.h
+ *
+ * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
+ * & Ralph Metzler <ralph@convergence.de>
+ * for convergence integrated media GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef _DVBVIDEO_H_
+#define _DVBVIDEO_H_
+
+
+#include <asm/types.h>
+#include <stdint.h>
+#include <time.h>
+
+
+typedef enum {
+ VIDEO_FORMAT_4_3, /* Select 4:3 format */
+ VIDEO_FORMAT_16_9, /* Select 16:9 format. */
+ VIDEO_FORMAT_221_1 /* 2.21:1 */
+} video_format_t;
+
+
+typedef enum {
+ VIDEO_SYSTEM_PAL,
+ VIDEO_SYSTEM_NTSC,
+ VIDEO_SYSTEM_PALN,
+ VIDEO_SYSTEM_PALNc,
+ VIDEO_SYSTEM_PALM,
+ VIDEO_SYSTEM_NTSC60,
+ VIDEO_SYSTEM_PAL60,
+ VIDEO_SYSTEM_PALM60
+} video_system_t;
+
+
+typedef enum {
+ VIDEO_PAN_SCAN, /* use pan and scan format */
+ VIDEO_LETTER_BOX, /* use letterbox format */
+ VIDEO_CENTER_CUT_OUT /* use center cut out format */
+} video_displayformat_t;
+
+typedef struct {
+ int w;
+ int h;
+ video_format_t aspect_ratio;
+} video_size_t;
+
+typedef enum {
+ VIDEO_SOURCE_DEMUX, /* Select the demux as the main source */
+ VIDEO_SOURCE_MEMORY /* If this source is selected, the stream
+ comes from the user through the write
+ system call */
+} video_stream_source_t;
+
+
+typedef enum {
+ VIDEO_STOPPED, /* Video is stopped */
+ VIDEO_PLAYING, /* Video is currently playing */
+ VIDEO_FREEZED /* Video is freezed */
+} video_play_state_t;
+
+
+/* Decoder commands */
+#define VIDEO_CMD_PLAY (0)
+#define VIDEO_CMD_STOP (1)
+#define VIDEO_CMD_FREEZE (2)
+#define VIDEO_CMD_CONTINUE (3)
+
+/* Flags for VIDEO_CMD_FREEZE */
+#define VIDEO_CMD_FREEZE_TO_BLACK (1 << 0)
+
+/* Flags for VIDEO_CMD_STOP */
+#define VIDEO_CMD_STOP_TO_BLACK (1 << 0)
+#define VIDEO_CMD_STOP_IMMEDIATELY (1 << 1)
+
+/* Play input formats: */
+/* The decoder has no special format requirements */
+#define VIDEO_PLAY_FMT_NONE (0)
+/* The decoder requires full GOPs */
+#define VIDEO_PLAY_FMT_GOP (1)
+
+/* The structure must be zeroed before use by the application
+ This ensures it can be extended safely in the future. */
+struct video_command {
+ __u32 cmd;
+ __u32 flags;
+ union {
+ struct {
+ __u64 pts;
+ } stop;
+
+ struct {
+ /* 0 or 1000 specifies normal speed,
+ 1 specifies forward single stepping,
+ -1 specifies backward single stepping,
+ >1: playback at speed/1000 of the normal speed,
+ <-1: reverse playback at (-speed/1000) of the normal speed. */
+ __s32 speed;
+ __u32 format;
+ } play;
+
+ struct {
+ __u32 data[16];
+ } raw;
+ };
+};
+
+/* FIELD_UNKNOWN can be used if the hardware does not know whether
+ the Vsync is for an odd, even or progressive (i.e. non-interlaced)
+ field. */
+#define VIDEO_VSYNC_FIELD_UNKNOWN (0)
+#define VIDEO_VSYNC_FIELD_ODD (1)
+#define VIDEO_VSYNC_FIELD_EVEN (2)
+#define VIDEO_VSYNC_FIELD_PROGRESSIVE (3)
+
+struct video_event {
+ int32_t type;
+#define VIDEO_EVENT_SIZE_CHANGED 1
+#define VIDEO_EVENT_FRAME_RATE_CHANGED 2
+#define VIDEO_EVENT_DECODER_STOPPED 3
+#define VIDEO_EVENT_VSYNC 4
+ time_t timestamp;
+ union {
+ video_size_t size;
+ unsigned int frame_rate; /* in frames per 1000sec */
+ unsigned char vsync_field; /* unknown/odd/even/progressive */
+ } u;
+};
+
+
+struct video_status {
+ int video_blank; /* blank video on freeze? */
+ video_play_state_t play_state; /* current state of playback */
+ video_stream_source_t stream_source; /* current source (demux/memory) */
+ video_format_t video_format; /* current aspect ratio of stream*/
+ video_displayformat_t display_format;/* selected cropping mode */
+};
+
+
+struct video_still_picture {
+ char *iFrame; /* pointer to a single iframe in memory */
+ int32_t size;
+};
+
+
+typedef
+struct video_highlight {
+ int active; /* 1=show highlight, 0=hide highlight */
+ uint8_t contrast1; /* 7- 4 Pattern pixel contrast */
+ /* 3- 0 Background pixel contrast */
+ uint8_t contrast2; /* 7- 4 Emphasis pixel-2 contrast */
+ /* 3- 0 Emphasis pixel-1 contrast */
+ uint8_t color1; /* 7- 4 Pattern pixel color */
+ /* 3- 0 Background pixel color */
+ uint8_t color2; /* 7- 4 Emphasis pixel-2 color */
+ /* 3- 0 Emphasis pixel-1 color */
+ uint32_t ypos; /* 23-22 auto action mode */
+ /* 21-12 start y */
+ /* 9- 0 end y */
+ uint32_t xpos; /* 23-22 button color number */
+ /* 21-12 start x */
+ /* 9- 0 end x */
+} video_highlight_t;
+
+
+typedef struct video_spu {
+ int active;
+ int stream_id;
+} video_spu_t;
+
+
+typedef struct video_spu_palette { /* SPU Palette information */
+ int length;
+ uint8_t *palette;
+} video_spu_palette_t;
+
+
+typedef struct video_navi_pack {
+ int length; /* 0 ... 1024 */
+ uint8_t data[1024];
+} video_navi_pack_t;
+
+
+typedef uint16_t video_attributes_t;
+/* bits: descr. */
+/* 15-14 Video compression mode (0=MPEG-1, 1=MPEG-2) */
+/* 13-12 TV system (0=525/60, 1=625/50) */
+/* 11-10 Aspect ratio (0=4:3, 3=16:9) */
+/* 9- 8 permitted display mode on 4:3 monitor (0=both, 1=only pan-sca */
+/* 7 line 21-1 data present in GOP (1=yes, 0=no) */
+/* 6 line 21-2 data present in GOP (1=yes, 0=no) */
+/* 5- 3 source resolution (0=720x480/576, 1=704x480/576, 2=352x480/57 */
+/* 2 source letterboxed (1=yes, 0=no) */
+/* 0 film/camera mode (0=camera, 1=film (625/50 only)) */
+
+
+/* bit definitions for capabilities: */
+/* can the hardware decode MPEG1 and/or MPEG2? */
+#define VIDEO_CAP_MPEG1 1
+#define VIDEO_CAP_MPEG2 2
+/* can you send a system and/or program stream to video device?
+ (you still have to open the video and the audio device but only
+ send the stream to the video device) */
+#define VIDEO_CAP_SYS 4
+#define VIDEO_CAP_PROG 8
+/* can the driver also handle SPU, NAVI and CSS encoded data?
+ (CSS API is not present yet) */
+#define VIDEO_CAP_SPU 16
+#define VIDEO_CAP_NAVI 32
+#define VIDEO_CAP_CSS 64
+
+
+#define VIDEO_STOP _IO('o', 21)
+#define VIDEO_PLAY _IO('o', 22)
+#define VIDEO_FREEZE _IO('o', 23)
+#define VIDEO_CONTINUE _IO('o', 24)
+#define VIDEO_SELECT_SOURCE _IO('o', 25)
+#define VIDEO_SET_BLANK _IO('o', 26)
+#define VIDEO_GET_STATUS _IOR('o', 27, struct video_status)
+#define VIDEO_GET_EVENT _IOR('o', 28, struct video_event)
+#define VIDEO_SET_DISPLAY_FORMAT _IO('o', 29)
+#define VIDEO_STILLPICTURE _IOW('o', 30, struct video_still_picture)
+#define VIDEO_FAST_FORWARD _IO('o', 31)
+#define VIDEO_SLOWMOTION _IO('o', 32)
+#define VIDEO_GET_CAPABILITIES _IOR('o', 33, unsigned int)
+#define VIDEO_CLEAR_BUFFER _IO('o', 34)
+#define VIDEO_SET_ID _IO('o', 35)
+#define VIDEO_SET_STREAMTYPE _IO('o', 36)
+#define VIDEO_SET_FORMAT _IO('o', 37)
+#define VIDEO_SET_SYSTEM _IO('o', 38)
+#define VIDEO_SET_HIGHLIGHT _IOW('o', 39, video_highlight_t)
+#define VIDEO_SET_SPU _IOW('o', 50, video_spu_t)
+#define VIDEO_SET_SPU_PALETTE _IOW('o', 51, video_spu_palette_t)
+#define VIDEO_GET_NAVI _IOR('o', 52, video_navi_pack_t)
+#define VIDEO_SET_ATTRIBUTES _IO('o', 53)
+#define VIDEO_GET_SIZE _IOR('o', 55, video_size_t)
+#define VIDEO_GET_FRAME_RATE _IOR('o', 56, unsigned int)
+
+/**
+ * VIDEO_GET_PTS
+ *
+ * Read the 33 bit presentation time stamp as defined
+ * in ITU T-REC-H.222.0 / ISO/IEC 13818-1.
+ *
+ * The PTS should belong to the currently played
+ * frame if possible, but may also be a value close to it
+ * like the PTS of the last decoded frame or the last PTS
+ * extracted by the PES parser.
+ */
+#define VIDEO_GET_PTS _IOR('o', 57, __u64)
+
+/* Read the number of displayed frames since the decoder was started */
+#define VIDEO_GET_FRAME_COUNT _IOR('o', 58, __u64)
+
+#define VIDEO_COMMAND _IOWR('o', 59, struct video_command)
+#define VIDEO_TRY_COMMAND _IOWR('o', 60, struct video_command)
+
+#endif /*_DVBVIDEO_H_*/
diff --git a/sysroot/usr/include/linux/edd.h b/sysroot/usr/include/linux/edd.h
new file mode 100644
index 0000000..20a5843
--- /dev/null
+++ b/sysroot/usr/include/linux/edd.h
@@ -0,0 +1,189 @@
+/*
+ * linux/include/linux/edd.h
+ * Copyright (C) 2002, 2003, 2004 Dell Inc.
+ * by Matt Domsch <Matt_Domsch@dell.com>
+ *
+ * structures and definitions for the int 13h, ax={41,48}h
+ * BIOS Enhanced Disk Drive Services
+ * This is based on the T13 group document D1572 Revision 0 (August 14 2002)
+ * available at http://www.t13.org/docs2002/d1572r0.pdf. It is
+ * very similar to D1484 Revision 3 http://www.t13.org/docs2002/d1484r3.pdf
+ *
+ * In a nutshell, arch/{i386,x86_64}/boot/setup.S populates a scratch
+ * table in the boot_params that contains a list of BIOS-enumerated
+ * boot devices.
+ * In arch/{i386,x86_64}/kernel/setup.c, this information is
+ * transferred into the edd structure, and in drivers/firmware/edd.c, that
+ * information is used to identify BIOS boot disk. The code in setup.S
+ * is very sensitive to the size of these structures.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License v2.0 as published by
+ * the Free Software Foundation
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+#ifndef _LINUX_EDD_H
+#define _LINUX_EDD_H
+
+#define EDDNR 0x1e9 /* addr of number of edd_info structs at EDDBUF
+ in boot_params - treat this as 1 byte */
+#define EDDBUF 0xd00 /* addr of edd_info structs in boot_params */
+#define EDDMAXNR 6 /* number of edd_info structs starting at EDDBUF */
+#define EDDEXTSIZE 8 /* change these if you muck with the structures */
+#define EDDPARMSIZE 74
+#define CHECKEXTENSIONSPRESENT 0x41
+#define GETDEVICEPARAMETERS 0x48
+#define LEGACYGETDEVICEPARAMETERS 0x08
+#define EDDMAGIC1 0x55AA
+#define EDDMAGIC2 0xAA55
+
+
+#define READ_SECTORS 0x02 /* int13 AH=0x02 is READ_SECTORS command */
+#define EDD_MBR_SIG_OFFSET 0x1B8 /* offset of signature in the MBR */
+#define EDD_MBR_SIG_BUF 0x290 /* addr in boot params */
+#define EDD_MBR_SIG_MAX 16 /* max number of signatures to store */
+#define EDD_MBR_SIG_NR_BUF 0x1ea /* addr of number of MBR signtaures at EDD_MBR_SIG_BUF
+ in boot_params - treat this as 1 byte */
+
+#ifndef __ASSEMBLY__
+
+#define EDD_EXT_FIXED_DISK_ACCESS (1 << 0)
+#define EDD_EXT_DEVICE_LOCKING_AND_EJECTING (1 << 1)
+#define EDD_EXT_ENHANCED_DISK_DRIVE_SUPPORT (1 << 2)
+#define EDD_EXT_64BIT_EXTENSIONS (1 << 3)
+
+#define EDD_INFO_DMA_BOUNDARY_ERROR_TRANSPARENT (1 << 0)
+#define EDD_INFO_GEOMETRY_VALID (1 << 1)
+#define EDD_INFO_REMOVABLE (1 << 2)
+#define EDD_INFO_WRITE_VERIFY (1 << 3)
+#define EDD_INFO_MEDIA_CHANGE_NOTIFICATION (1 << 4)
+#define EDD_INFO_LOCKABLE (1 << 5)
+#define EDD_INFO_NO_MEDIA_PRESENT (1 << 6)
+#define EDD_INFO_USE_INT13_FN50 (1 << 7)
+
+struct edd_device_params {
+ __u16 length;
+ __u16 info_flags;
+ __u32 num_default_cylinders;
+ __u32 num_default_heads;
+ __u32 sectors_per_track;
+ __u64 number_of_sectors;
+ __u16 bytes_per_sector;
+ __u32 dpte_ptr; /* 0xFFFFFFFF for our purposes */
+ __u16 key; /* = 0xBEDD */
+ __u8 device_path_info_length; /* = 44 */
+ __u8 reserved2;
+ __u16 reserved3;
+ __u8 host_bus_type[4];
+ __u8 interface_type[8];
+ union {
+ struct {
+ __u16 base_address;
+ __u16 reserved1;
+ __u32 reserved2;
+ } __attribute__ ((packed)) isa;
+ struct {
+ __u8 bus;
+ __u8 slot;
+ __u8 function;
+ __u8 channel;
+ __u32 reserved;
+ } __attribute__ ((packed)) pci;
+ /* pcix is same as pci */
+ struct {
+ __u64 reserved;
+ } __attribute__ ((packed)) ibnd;
+ struct {
+ __u64 reserved;
+ } __attribute__ ((packed)) xprs;
+ struct {
+ __u64 reserved;
+ } __attribute__ ((packed)) htpt;
+ struct {
+ __u64 reserved;
+ } __attribute__ ((packed)) unknown;
+ } interface_path;
+ union {
+ struct {
+ __u8 device;
+ __u8 reserved1;
+ __u16 reserved2;
+ __u32 reserved3;
+ __u64 reserved4;
+ } __attribute__ ((packed)) ata;
+ struct {
+ __u8 device;
+ __u8 lun;
+ __u8 reserved1;
+ __u8 reserved2;
+ __u32 reserved3;
+ __u64 reserved4;
+ } __attribute__ ((packed)) atapi;
+ struct {
+ __u16 id;
+ __u64 lun;
+ __u16 reserved1;
+ __u32 reserved2;
+ } __attribute__ ((packed)) scsi;
+ struct {
+ __u64 serial_number;
+ __u64 reserved;
+ } __attribute__ ((packed)) usb;
+ struct {
+ __u64 eui;
+ __u64 reserved;
+ } __attribute__ ((packed)) i1394;
+ struct {
+ __u64 wwid;
+ __u64 lun;
+ } __attribute__ ((packed)) fibre;
+ struct {
+ __u64 identity_tag;
+ __u64 reserved;
+ } __attribute__ ((packed)) i2o;
+ struct {
+ __u32 array_number;
+ __u32 reserved1;
+ __u64 reserved2;
+ } __attribute__ ((packed)) raid;
+ struct {
+ __u8 device;
+ __u8 reserved1;
+ __u16 reserved2;
+ __u32 reserved3;
+ __u64 reserved4;
+ } __attribute__ ((packed)) sata;
+ struct {
+ __u64 reserved1;
+ __u64 reserved2;
+ } __attribute__ ((packed)) unknown;
+ } device_path;
+ __u8 reserved4;
+ __u8 checksum;
+} __attribute__ ((packed));
+
+struct edd_info {
+ __u8 device;
+ __u8 version;
+ __u16 interface_support;
+ __u16 legacy_max_cylinder;
+ __u8 legacy_max_head;
+ __u8 legacy_sectors_per_track;
+ struct edd_device_params params;
+} __attribute__ ((packed));
+
+struct edd {
+ unsigned int mbr_signature[EDD_MBR_SIG_MAX];
+ struct edd_info edd_info[EDDMAXNR];
+ unsigned char mbr_signature_nr;
+ unsigned char edd_info_nr;
+};
+
+#endif /*!__ASSEMBLY__ */
+
+#endif /* _LINUX_EDD_H */
diff --git a/sysroot/usr/include/linux/efs_fs_sb.h b/sysroot/usr/include/linux/efs_fs_sb.h
new file mode 100644
index 0000000..ff1945e
--- /dev/null
+++ b/sysroot/usr/include/linux/efs_fs_sb.h
@@ -0,0 +1,61 @@
+/*
+ * efs_fs_sb.h
+ *
+ * Copyright (c) 1999 Al Smith
+ *
+ * Portions derived from IRIX header files (c) 1988 Silicon Graphics
+ */
+
+#ifndef __EFS_FS_SB_H__
+#define __EFS_FS_SB_H__
+
+#include <linux/magic.h>
+
+/* EFS superblock magic numbers */
+#define EFS_MAGIC 0x072959
+#define EFS_NEWMAGIC 0x07295a
+
+#define IS_EFS_MAGIC(x) ((x == EFS_MAGIC) || (x == EFS_NEWMAGIC))
+
+#define EFS_SUPER 1
+#define EFS_ROOTINODE 2
+
+/* efs superblock on disk */
+struct efs_super {
+ __be32 fs_size; /* size of filesystem, in sectors */
+ __be32 fs_firstcg; /* bb offset to first cg */
+ __be32 fs_cgfsize; /* size of cylinder group in bb's */
+ __be16 fs_cgisize; /* bb's of inodes per cylinder group */
+ __be16 fs_sectors; /* sectors per track */
+ __be16 fs_heads; /* heads per cylinder */
+ __be16 fs_ncg; /* # of cylinder groups in filesystem */
+ __be16 fs_dirty; /* fs needs to be fsck'd */
+ __be32 fs_time; /* last super-block update */
+ __be32 fs_magic; /* magic number */
+ char fs_fname[6]; /* file system name */
+ char fs_fpack[6]; /* file system pack name */
+ __be32 fs_bmsize; /* size of bitmap in bytes */
+ __be32 fs_tfree; /* total free data blocks */
+ __be32 fs_tinode; /* total free inodes */
+ __be32 fs_bmblock; /* bitmap location. */
+ __be32 fs_replsb; /* Location of replicated superblock. */
+ __be32 fs_lastialloc; /* last allocated inode */
+ char fs_spare[20]; /* space for expansion - MUST BE ZERO */
+ __be32 fs_checksum; /* checksum of volume portion of fs */
+};
+
+/* efs superblock information in memory */
+struct efs_sb_info {
+ __u32 fs_magic; /* superblock magic number */
+ __u32 fs_start; /* first block of filesystem */
+ __u32 first_block; /* first data block in filesystem */
+ __u32 total_blocks; /* total number of blocks in filesystem */
+ __u32 group_size; /* # of blocks a group consists of */
+ __u32 data_free; /* # of free data blocks */
+ __u32 inode_free; /* # of free inodes */
+ __u16 inode_blocks; /* # of blocks used for inodes in every grp */
+ __u16 total_groups; /* # of groups */
+};
+
+#endif /* __EFS_FS_SB_H__ */
+
diff --git a/sysroot/usr/include/linux/elf-em.h b/sysroot/usr/include/linux/elf-em.h
new file mode 100644
index 0000000..5834e84
--- /dev/null
+++ b/sysroot/usr/include/linux/elf-em.h
@@ -0,0 +1,52 @@
+#ifndef _LINUX_ELF_EM_H
+#define _LINUX_ELF_EM_H
+
+/* These constants define the various ELF target machines */
+#define EM_NONE 0
+#define EM_M32 1
+#define EM_SPARC 2
+#define EM_386 3
+#define EM_68K 4
+#define EM_88K 5
+#define EM_486 6 /* Perhaps disused */
+#define EM_860 7
+#define EM_MIPS 8 /* MIPS R3000 (officially, big-endian only) */
+ /* Next two are historical and binaries and
+ modules of these types will be rejected by
+ Linux. */
+#define EM_MIPS_RS3_LE 10 /* MIPS R3000 little-endian */
+#define EM_MIPS_RS4_BE 10 /* MIPS R4000 big-endian */
+
+#define EM_PARISC 15 /* HPPA */
+#define EM_SPARC32PLUS 18 /* Sun's "v8plus" */
+#define EM_PPC 20 /* PowerPC */
+#define EM_PPC64 21 /* PowerPC64 */
+#define EM_SPU 23 /* Cell BE SPU */
+#define EM_SH 42 /* SuperH */
+#define EM_SPARCV9 43 /* SPARC v9 64-bit */
+#define EM_IA_64 50 /* HP/Intel IA-64 */
+#define EM_X86_64 62 /* AMD x86-64 */
+#define EM_S390 22 /* IBM S/390 */
+#define EM_CRIS 76 /* Axis Communications 32-bit embedded processor */
+#define EM_V850 87 /* NEC v850 */
+#define EM_M32R 88 /* Renesas M32R */
+#define EM_H8_300 46 /* Renesas H8/300,300H,H8S */
+#define EM_BLACKFIN 106 /* ADI Blackfin Processor */
+#define EM_FRV 0x5441 /* Fujitsu FR-V */
+#define EM_AVR32 0x18ad /* Atmel AVR32 */
+
+/*
+ * This is an interim value that we will use until the committee comes
+ * up with a final number.
+ */
+#define EM_ALPHA 0x9026
+
+/* Bogus old v850 magic number, used by old tools. */
+#define EM_CYGNUS_V850 0x9080
+/* Bogus old m32r magic number, used by old tools. */
+#define EM_CYGNUS_M32R 0x9041
+/* This is the old interim value for S/390 architecture */
+#define EM_S390_OLD 0xA390
+
+
+#endif /* _LINUX_ELF_EM_H */
diff --git a/sysroot/usr/include/linux/elf-fdpic.h b/sysroot/usr/include/linux/elf-fdpic.h
new file mode 100644
index 0000000..9f5b745
--- /dev/null
+++ b/sysroot/usr/include/linux/elf-fdpic.h
@@ -0,0 +1,68 @@
+/* elf-fdpic.h: FDPIC ELF load map
+ *
+ * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved.
+ * Written by David Howells (dhowells@redhat.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _LINUX_ELF_FDPIC_H
+#define _LINUX_ELF_FDPIC_H
+
+#include <linux/elf.h>
+
+#define PT_GNU_STACK (PT_LOOS + 0x474e551)
+
+/* segment mappings for ELF FDPIC libraries/executables/interpreters */
+struct elf32_fdpic_loadseg {
+ Elf32_Addr addr; /* core address to which mapped */
+ Elf32_Addr p_vaddr; /* VMA recorded in file */
+ Elf32_Word p_memsz; /* allocation size recorded in file */
+};
+
+struct elf32_fdpic_loadmap {
+ Elf32_Half version; /* version of these structures, just in case... */
+ Elf32_Half nsegs; /* number of segments */
+ struct elf32_fdpic_loadseg segs[];
+};
+
+#define ELF32_FDPIC_LOADMAP_VERSION 0x0000
+
+/*
+ * binfmt binary parameters structure
+ */
+struct elf_fdpic_params {
+ struct elfhdr hdr; /* ref copy of ELF header */
+ struct elf_phdr *phdrs; /* ref copy of PT_PHDR table */
+ struct elf32_fdpic_loadmap *loadmap; /* loadmap to be passed to userspace */
+ unsigned long elfhdr_addr; /* mapped ELF header user address */
+ unsigned long ph_addr; /* mapped PT_PHDR user address */
+ unsigned long map_addr; /* mapped loadmap user address */
+ unsigned long entry_addr; /* mapped entry user address */
+ unsigned long stack_size; /* stack size requested (PT_GNU_STACK) */
+ unsigned long dynamic_addr; /* mapped PT_DYNAMIC user address */
+ unsigned long load_addr; /* user address at which to map binary */
+ unsigned long flags;
+#define ELF_FDPIC_FLAG_ARRANGEMENT 0x0000000f /* PT_LOAD arrangement flags */
+#define ELF_FDPIC_FLAG_INDEPENDENT 0x00000000 /* PT_LOADs can be put anywhere */
+#define ELF_FDPIC_FLAG_HONOURVADDR 0x00000001 /* PT_LOAD.vaddr must be honoured */
+#define ELF_FDPIC_FLAG_CONSTDISP 0x00000002 /* PT_LOADs require constant
+ * displacement */
+#define ELF_FDPIC_FLAG_CONTIGUOUS 0x00000003 /* PT_LOADs should be contiguous */
+#define ELF_FDPIC_FLAG_EXEC_STACK 0x00000010 /* T if stack to be executable */
+#define ELF_FDPIC_FLAG_NOEXEC_STACK 0x00000020 /* T if stack not to be executable */
+#define ELF_FDPIC_FLAG_EXECUTABLE 0x00000040 /* T if this object is the executable */
+#define ELF_FDPIC_FLAG_PRESENT 0x80000000 /* T if this object is present */
+};
+
+#ifdef CONFIG_MMU
+extern void elf_fdpic_arch_lay_out_mm(struct elf_fdpic_params *exec_params,
+ struct elf_fdpic_params *interp_params,
+ unsigned long *start_stack,
+ unsigned long *start_brk);
+#endif
+
+#endif /* _LINUX_ELF_FDPIC_H */
diff --git a/sysroot/usr/include/linux/elf.h b/sysroot/usr/include/linux/elf.h
new file mode 100644
index 0000000..515109a
--- /dev/null
+++ b/sysroot/usr/include/linux/elf.h
@@ -0,0 +1,402 @@
+#ifndef _LINUX_ELF_H
+#define _LINUX_ELF_H
+
+#include <linux/types.h>
+#include <linux/elf-em.h>
+#include <asm/elf.h>
+
+struct file;
+
+#ifndef elf_read_implies_exec
+ /* Executables for which elf_read_implies_exec() returns TRUE will
+ have the READ_IMPLIES_EXEC personality flag set automatically.
+ Override in asm/elf.h as needed. */
+# define elf_read_implies_exec(ex, have_pt_gnu_stack) 0
+#endif
+
+/* 32-bit ELF base types. */
+typedef __u32 Elf32_Addr;
+typedef __u16 Elf32_Half;
+typedef __u32 Elf32_Off;
+typedef __s32 Elf32_Sword;
+typedef __u32 Elf32_Word;
+
+/* 64-bit ELF base types. */
+typedef __u64 Elf64_Addr;
+typedef __u16 Elf64_Half;
+typedef __s16 Elf64_SHalf;
+typedef __u64 Elf64_Off;
+typedef __s32 Elf64_Sword;
+typedef __u32 Elf64_Word;
+typedef __u64 Elf64_Xword;
+typedef __s64 Elf64_Sxword;
+
+/* These constants are for the segment types stored in the image headers */
+#define PT_NULL 0
+#define PT_LOAD 1
+#define PT_DYNAMIC 2
+#define PT_INTERP 3
+#define PT_NOTE 4
+#define PT_SHLIB 5
+#define PT_PHDR 6
+#define PT_TLS 7 /* Thread local storage segment */
+#define PT_LOOS 0x60000000 /* OS-specific */
+#define PT_HIOS 0x6fffffff /* OS-specific */
+#define PT_LOPROC 0x70000000
+#define PT_HIPROC 0x7fffffff
+#define PT_GNU_EH_FRAME 0x6474e550
+
+#define PT_GNU_STACK (PT_LOOS + 0x474e551)
+
+/* These constants define the different elf file types */
+#define ET_NONE 0
+#define ET_REL 1
+#define ET_EXEC 2
+#define ET_DYN 3
+#define ET_CORE 4
+#define ET_LOPROC 0xff00
+#define ET_HIPROC 0xffff
+
+/* This is the info that is needed to parse the dynamic section of the file */
+#define DT_NULL 0
+#define DT_NEEDED 1
+#define DT_PLTRELSZ 2
+#define DT_PLTGOT 3
+#define DT_HASH 4
+#define DT_STRTAB 5
+#define DT_SYMTAB 6
+#define DT_RELA 7
+#define DT_RELASZ 8
+#define DT_RELAENT 9
+#define DT_STRSZ 10
+#define DT_SYMENT 11
+#define DT_INIT 12
+#define DT_FINI 13
+#define DT_SONAME 14
+#define DT_RPATH 15
+#define DT_SYMBOLIC 16
+#define DT_REL 17
+#define DT_RELSZ 18
+#define DT_RELENT 19
+#define DT_PLTREL 20
+#define DT_DEBUG 21
+#define DT_TEXTREL 22
+#define DT_JMPREL 23
+#define DT_ENCODING 32
+#define OLD_DT_LOOS 0x60000000
+#define DT_LOOS 0x6000000d
+#define DT_HIOS 0x6ffff000
+#define DT_VALRNGLO 0x6ffffd00
+#define DT_VALRNGHI 0x6ffffdff
+#define DT_ADDRRNGLO 0x6ffffe00
+#define DT_ADDRRNGHI 0x6ffffeff
+#define DT_VERSYM 0x6ffffff0
+#define DT_RELACOUNT 0x6ffffff9
+#define DT_RELCOUNT 0x6ffffffa
+#define DT_FLAGS_1 0x6ffffffb
+#define DT_VERDEF 0x6ffffffc
+#define DT_VERDEFNUM 0x6ffffffd
+#define DT_VERNEED 0x6ffffffe
+#define DT_VERNEEDNUM 0x6fffffff
+#define OLD_DT_HIOS 0x6fffffff
+#define DT_LOPROC 0x70000000
+#define DT_HIPROC 0x7fffffff
+
+/* This info is needed when parsing the symbol table */
+#define STB_LOCAL 0
+#define STB_GLOBAL 1
+#define STB_WEAK 2
+
+#define STT_NOTYPE 0
+#define STT_OBJECT 1
+#define STT_FUNC 2
+#define STT_SECTION 3
+#define STT_FILE 4
+#define STT_COMMON 5
+#define STT_TLS 6
+
+#define ELF_ST_BIND(x) ((x) >> 4)
+#define ELF_ST_TYPE(x) (((unsigned int) x) & 0xf)
+#define ELF32_ST_BIND(x) ELF_ST_BIND(x)
+#define ELF32_ST_TYPE(x) ELF_ST_TYPE(x)
+#define ELF64_ST_BIND(x) ELF_ST_BIND(x)
+#define ELF64_ST_TYPE(x) ELF_ST_TYPE(x)
+
+typedef struct dynamic{
+ Elf32_Sword d_tag;
+ union{
+ Elf32_Sword d_val;
+ Elf32_Addr d_ptr;
+ } d_un;
+} Elf32_Dyn;
+
+typedef struct {
+ Elf64_Sxword d_tag; /* entry tag value */
+ union {
+ Elf64_Xword d_val;
+ Elf64_Addr d_ptr;
+ } d_un;
+} Elf64_Dyn;
+
+/* The following are used with relocations */
+#define ELF32_R_SYM(x) ((x) >> 8)
+#define ELF32_R_TYPE(x) ((x) & 0xff)
+
+#define ELF64_R_SYM(i) ((i) >> 32)
+#define ELF64_R_TYPE(i) ((i) & 0xffffffff)
+
+typedef struct elf32_rel {
+ Elf32_Addr r_offset;
+ Elf32_Word r_info;
+} Elf32_Rel;
+
+typedef struct elf64_rel {
+ Elf64_Addr r_offset; /* Location at which to apply the action */
+ Elf64_Xword r_info; /* index and type of relocation */
+} Elf64_Rel;
+
+typedef struct elf32_rela{
+ Elf32_Addr r_offset;
+ Elf32_Word r_info;
+ Elf32_Sword r_addend;
+} Elf32_Rela;
+
+typedef struct elf64_rela {
+ Elf64_Addr r_offset; /* Location at which to apply the action */
+ Elf64_Xword r_info; /* index and type of relocation */
+ Elf64_Sxword r_addend; /* Constant addend used to compute value */
+} Elf64_Rela;
+
+typedef struct elf32_sym{
+ Elf32_Word st_name;
+ Elf32_Addr st_value;
+ Elf32_Word st_size;
+ unsigned char st_info;
+ unsigned char st_other;
+ Elf32_Half st_shndx;
+} Elf32_Sym;
+
+typedef struct elf64_sym {
+ Elf64_Word st_name; /* Symbol name, index in string tbl */
+ unsigned char st_info; /* Type and binding attributes */
+ unsigned char st_other; /* No defined meaning, 0 */
+ Elf64_Half st_shndx; /* Associated section index */
+ Elf64_Addr st_value; /* Value of the symbol */
+ Elf64_Xword st_size; /* Associated symbol size */
+} Elf64_Sym;
+
+
+#define EI_NIDENT 16
+
+typedef struct elf32_hdr{
+ unsigned char e_ident[EI_NIDENT];
+ Elf32_Half e_type;
+ Elf32_Half e_machine;
+ Elf32_Word e_version;
+ Elf32_Addr e_entry; /* Entry point */
+ Elf32_Off e_phoff;
+ Elf32_Off e_shoff;
+ Elf32_Word e_flags;
+ Elf32_Half e_ehsize;
+ Elf32_Half e_phentsize;
+ Elf32_Half e_phnum;
+ Elf32_Half e_shentsize;
+ Elf32_Half e_shnum;
+ Elf32_Half e_shstrndx;
+} Elf32_Ehdr;
+
+typedef struct elf64_hdr {
+ unsigned char e_ident[16]; /* ELF "magic number" */
+ Elf64_Half e_type;
+ Elf64_Half e_machine;
+ Elf64_Word e_version;
+ Elf64_Addr e_entry; /* Entry point virtual address */
+ Elf64_Off e_phoff; /* Program header table file offset */
+ Elf64_Off e_shoff; /* Section header table file offset */
+ Elf64_Word e_flags;
+ Elf64_Half e_ehsize;
+ Elf64_Half e_phentsize;
+ Elf64_Half e_phnum;
+ Elf64_Half e_shentsize;
+ Elf64_Half e_shnum;
+ Elf64_Half e_shstrndx;
+} Elf64_Ehdr;
+
+/* These constants define the permissions on sections in the program
+ header, p_flags. */
+#define PF_R 0x4
+#define PF_W 0x2
+#define PF_X 0x1
+
+typedef struct elf32_phdr{
+ Elf32_Word p_type;
+ Elf32_Off p_offset;
+ Elf32_Addr p_vaddr;
+ Elf32_Addr p_paddr;
+ Elf32_Word p_filesz;
+ Elf32_Word p_memsz;
+ Elf32_Word p_flags;
+ Elf32_Word p_align;
+} Elf32_Phdr;
+
+typedef struct elf64_phdr {
+ Elf64_Word p_type;
+ Elf64_Word p_flags;
+ Elf64_Off p_offset; /* Segment file offset */
+ Elf64_Addr p_vaddr; /* Segment virtual address */
+ Elf64_Addr p_paddr; /* Segment physical address */
+ Elf64_Xword p_filesz; /* Segment size in file */
+ Elf64_Xword p_memsz; /* Segment size in memory */
+ Elf64_Xword p_align; /* Segment alignment, file & memory */
+} Elf64_Phdr;
+
+/* sh_type */
+#define SHT_NULL 0
+#define SHT_PROGBITS 1
+#define SHT_SYMTAB 2
+#define SHT_STRTAB 3
+#define SHT_RELA 4
+#define SHT_HASH 5
+#define SHT_DYNAMIC 6
+#define SHT_NOTE 7
+#define SHT_NOBITS 8
+#define SHT_REL 9
+#define SHT_SHLIB 10
+#define SHT_DYNSYM 11
+#define SHT_NUM 12
+#define SHT_LOPROC 0x70000000
+#define SHT_HIPROC 0x7fffffff
+#define SHT_LOUSER 0x80000000
+#define SHT_HIUSER 0xffffffff
+
+/* sh_flags */
+#define SHF_WRITE 0x1
+#define SHF_ALLOC 0x2
+#define SHF_EXECINSTR 0x4
+#define SHF_MASKPROC 0xf0000000
+
+/* special section indexes */
+#define SHN_UNDEF 0
+#define SHN_LORESERVE 0xff00
+#define SHN_LOPROC 0xff00
+#define SHN_HIPROC 0xff1f
+#define SHN_ABS 0xfff1
+#define SHN_COMMON 0xfff2
+#define SHN_HIRESERVE 0xffff
+
+typedef struct {
+ Elf32_Word sh_name;
+ Elf32_Word sh_type;
+ Elf32_Word sh_flags;
+ Elf32_Addr sh_addr;
+ Elf32_Off sh_offset;
+ Elf32_Word sh_size;
+ Elf32_Word sh_link;
+ Elf32_Word sh_info;
+ Elf32_Word sh_addralign;
+ Elf32_Word sh_entsize;
+} Elf32_Shdr;
+
+typedef struct elf64_shdr {
+ Elf64_Word sh_name; /* Section name, index in string tbl */
+ Elf64_Word sh_type; /* Type of section */
+ Elf64_Xword sh_flags; /* Miscellaneous section attributes */
+ Elf64_Addr sh_addr; /* Section virtual addr at execution */
+ Elf64_Off sh_offset; /* Section file offset */
+ Elf64_Xword sh_size; /* Size of section in bytes */
+ Elf64_Word sh_link; /* Index of another section */
+ Elf64_Word sh_info; /* Additional section information */
+ Elf64_Xword sh_addralign; /* Section alignment */
+ Elf64_Xword sh_entsize; /* Entry size if section holds table */
+} Elf64_Shdr;
+
+#define EI_MAG0 0 /* e_ident[] indexes */
+#define EI_MAG1 1
+#define EI_MAG2 2
+#define EI_MAG3 3
+#define EI_CLASS 4
+#define EI_DATA 5
+#define EI_VERSION 6
+#define EI_OSABI 7
+#define EI_PAD 8
+
+#define ELFMAG0 0x7f /* EI_MAG */
+#define ELFMAG1 'E'
+#define ELFMAG2 'L'
+#define ELFMAG3 'F'
+#define ELFMAG "\177ELF"
+#define SELFMAG 4
+
+#define ELFCLASSNONE 0 /* EI_CLASS */
+#define ELFCLASS32 1
+#define ELFCLASS64 2
+#define ELFCLASSNUM 3
+
+#define ELFDATANONE 0 /* e_ident[EI_DATA] */
+#define ELFDATA2LSB 1
+#define ELFDATA2MSB 2
+
+#define EV_NONE 0 /* e_version, EI_VERSION */
+#define EV_CURRENT 1
+#define EV_NUM 2
+
+#define ELFOSABI_NONE 0
+#define ELFOSABI_LINUX 3
+
+#ifndef ELF_OSABI
+#define ELF_OSABI ELFOSABI_NONE
+#endif
+
+/* Notes used in ET_CORE */
+#define NT_PRSTATUS 1
+#define NT_PRFPREG 2
+#define NT_PRPSINFO 3
+#define NT_TASKSTRUCT 4
+#define NT_AUXV 6
+#define NT_PRXFPREG 0x46e62b7f /* copied from gdb5.1/include/elf/common.h */
+#define NT_PPC_VMX 0x100 /* PowerPC Altivec/VMX registers */
+
+
+/* Note header in a PT_NOTE section */
+typedef struct elf32_note {
+ Elf32_Word n_namesz; /* Name size */
+ Elf32_Word n_descsz; /* Content size */
+ Elf32_Word n_type; /* Content type */
+} Elf32_Nhdr;
+
+/* Note header in a PT_NOTE section */
+typedef struct elf64_note {
+ Elf64_Word n_namesz; /* Name size */
+ Elf64_Word n_descsz; /* Content size */
+ Elf64_Word n_type; /* Content type */
+} Elf64_Nhdr;
+
+#if ELF_CLASS == ELFCLASS32
+
+extern Elf32_Dyn _DYNAMIC [];
+#define elfhdr elf32_hdr
+#define elf_phdr elf32_phdr
+#define elf_note elf32_note
+#define elf_addr_t Elf32_Off
+
+#else
+
+extern Elf64_Dyn _DYNAMIC [];
+#define elfhdr elf64_hdr
+#define elf_phdr elf64_phdr
+#define elf_note elf64_note
+#define elf_addr_t Elf64_Off
+
+#endif
+
+/* Optional callbacks to write extra ELF notes. */
+#ifndef ARCH_HAVE_EXTRA_ELF_NOTES
+static __inline__ int elf_coredump_extra_notes_size(void) { return 0; }
+static __inline__ int elf_coredump_extra_notes_write(struct file *file,
+ loff_t *foffset) { return 0; }
+#else
+extern int elf_coredump_extra_notes_size(void);
+extern int elf_coredump_extra_notes_write(struct file *file, loff_t *foffset);
+#endif
+
+#endif /* _LINUX_ELF_H */
diff --git a/sysroot/usr/include/linux/elfcore.h b/sysroot/usr/include/linux/elfcore.h
new file mode 100644
index 0000000..6774ea0
--- /dev/null
+++ b/sysroot/usr/include/linux/elfcore.h
@@ -0,0 +1,97 @@
+#ifndef _LINUX_ELFCORE_H
+#define _LINUX_ELFCORE_H
+
+#include <linux/types.h>
+#include <linux/signal.h>
+#include <linux/time.h>
+#include <linux/user.h>
+#include <linux/ptrace.h>
+
+struct elf_siginfo
+{
+ int si_signo; /* signal number */
+ int si_code; /* extra code */
+ int si_errno; /* errno */
+};
+
+#include <asm/elf.h>
+
+typedef elf_greg_t greg_t;
+typedef elf_gregset_t gregset_t;
+typedef elf_fpregset_t fpregset_t;
+typedef elf_fpxregset_t fpxregset_t;
+#define NGREG ELF_NGREG
+
+/*
+ * Definitions to generate Intel SVR4-like core files.
+ * These mostly have the same names as the SVR4 types with "elf_"
+ * tacked on the front to prevent clashes with linux definitions,
+ * and the typedef forms have been avoided. This is mostly like
+ * the SVR4 structure, but more Linuxy, with things that Linux does
+ * not support and which gdb doesn't really use excluded.
+ * Fields present but not used are marked with "XXX".
+ */
+struct elf_prstatus
+{
+#if 0
+ long pr_flags; /* XXX Process flags */
+ short pr_why; /* XXX Reason for process halt */
+ short pr_what; /* XXX More detailed reason */
+#endif
+ struct elf_siginfo pr_info; /* Info associated with signal */
+ short pr_cursig; /* Current signal */
+ unsigned long pr_sigpend; /* Set of pending signals */
+ unsigned long pr_sighold; /* Set of held signals */
+#if 0
+ struct sigaltstack pr_altstack; /* Alternate stack info */
+ struct sigaction pr_action; /* Signal action for current sig */
+#endif
+ pid_t pr_pid;
+ pid_t pr_ppid;
+ pid_t pr_pgrp;
+ pid_t pr_sid;
+ struct timeval pr_utime; /* User time */
+ struct timeval pr_stime; /* System time */
+ struct timeval pr_cutime; /* Cumulative user time */
+ struct timeval pr_cstime; /* Cumulative system time */
+#if 0
+ long pr_instr; /* Current instruction */
+#endif
+ elf_gregset_t pr_reg; /* GP registers */
+#ifdef CONFIG_BINFMT_ELF_FDPIC
+ /* When using FDPIC, the loadmap addresses need to be communicated
+ * to GDB in order for GDB to do the necessary relocations. The
+ * fields (below) used to communicate this information are placed
+ * immediately after ``pr_reg'', so that the loadmap addresses may
+ * be viewed as part of the register set if so desired.
+ */
+ unsigned long pr_exec_fdpic_loadmap;
+ unsigned long pr_interp_fdpic_loadmap;
+#endif
+ int pr_fpvalid; /* True if math co-processor being used. */
+};
+
+#define ELF_PRARGSZ (80) /* Number of chars for args */
+
+struct elf_prpsinfo
+{
+ char pr_state; /* numeric process state */
+ char pr_sname; /* char for pr_state */
+ char pr_zomb; /* zombie */
+ char pr_nice; /* nice val */
+ unsigned long pr_flag; /* flags */
+ __kernel_uid_t pr_uid;
+ __kernel_gid_t pr_gid;
+ pid_t pr_pid, pr_ppid, pr_pgrp, pr_sid;
+ /* Lots missing */
+ char pr_fname[16]; /* filename of executable */
+ char pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */
+};
+
+typedef struct elf_prstatus prstatus_t;
+typedef struct elf_prpsinfo prpsinfo_t;
+#define PRARGSZ ELF_PRARGSZ
+
+
+
+#endif /* _LINUX_ELFCORE_H */
diff --git a/sysroot/usr/include/linux/errno.h b/sysroot/usr/include/linux/errno.h
new file mode 100644
index 0000000..6385fa3
--- /dev/null
+++ b/sysroot/usr/include/linux/errno.h
@@ -0,0 +1,7 @@
+#ifndef _LINUX_ERRNO_H
+#define _LINUX_ERRNO_H
+
+#include <asm/errno.h>
+
+
+#endif
diff --git a/sysroot/usr/include/linux/errqueue.h b/sysroot/usr/include/linux/errqueue.h
new file mode 100644
index 0000000..e794aa9
--- /dev/null
+++ b/sysroot/usr/include/linux/errqueue.h
@@ -0,0 +1,23 @@
+#ifndef _LINUX_ERRQUEUE_H
+#define _LINUX_ERRQUEUE_H 1
+
+struct sock_extended_err
+{
+ __u32 ee_errno;
+ __u8 ee_origin;
+ __u8 ee_type;
+ __u8 ee_code;
+ __u8 ee_pad;
+ __u32 ee_info;
+ __u32 ee_data;
+};
+
+#define SO_EE_ORIGIN_NONE 0
+#define SO_EE_ORIGIN_LOCAL 1
+#define SO_EE_ORIGIN_ICMP 2
+#define SO_EE_ORIGIN_ICMP6 3
+
+#define SO_EE_OFFENDER(ee) ((struct sockaddr*)((ee)+1))
+
+
+#endif
diff --git a/sysroot/usr/include/linux/ethtool.h b/sysroot/usr/include/linux/ethtool.h
new file mode 100644
index 0000000..87c7c9a
--- /dev/null
+++ b/sysroot/usr/include/linux/ethtool.h
@@ -0,0 +1,404 @@
+/*
+ * ethtool.h: Defines for Linux ethtool.
+ *
+ * Copyright (C) 1998 David S. Miller (davem@redhat.com)
+ * Copyright 2001 Jeff Garzik <jgarzik@pobox.com>
+ * Portions Copyright 2001 Sun Microsystems (thockin@sun.com)
+ * Portions Copyright 2002 Intel (eli.kupermann@intel.com,
+ * christopher.leech@intel.com,
+ * scott.feldman@intel.com)
+ */
+
+#ifndef _LINUX_ETHTOOL_H
+#define _LINUX_ETHTOOL_H
+
+
+/* This should work for both 32 and 64 bit userland. */
+struct ethtool_cmd {
+ __u32 cmd;
+ __u32 supported; /* Features this interface supports */
+ __u32 advertising; /* Features this interface advertises */
+ __u16 speed; /* The forced speed, 10Mb, 100Mb, gigabit */
+ __u8 duplex; /* Duplex, half or full */
+ __u8 port; /* Which connector port */
+ __u8 phy_address;
+ __u8 transceiver; /* Which transceiver to use */
+ __u8 autoneg; /* Enable or disable autonegotiation */
+ __u32 maxtxpkt; /* Tx pkts before generating tx int */
+ __u32 maxrxpkt; /* Rx pkts before generating rx int */
+ __u32 reserved[4];
+};
+
+#define ETHTOOL_BUSINFO_LEN 32
+/* these strings are set to whatever the driver author decides... */
+struct ethtool_drvinfo {
+ __u32 cmd;
+ char driver[32]; /* driver short name, "tulip", "eepro100" */
+ char version[32]; /* driver version string */
+ char fw_version[32]; /* firmware version string, if applicable */
+ char bus_info[ETHTOOL_BUSINFO_LEN]; /* Bus info for this IF. */
+ /* For PCI devices, use pci_name(pci_dev). */
+ char reserved1[32];
+ char reserved2[12];
+ __u32 n_priv_flags; /* number of flags valid in ETHTOOL_GPFLAGS */
+ __u32 n_stats; /* number of u64's from ETHTOOL_GSTATS */
+ __u32 testinfo_len;
+ __u32 eedump_len; /* Size of data from ETHTOOL_GEEPROM (bytes) */
+ __u32 regdump_len; /* Size of data from ETHTOOL_GREGS (bytes) */
+};
+
+#define SOPASS_MAX 6
+/* wake-on-lan settings */
+struct ethtool_wolinfo {
+ __u32 cmd;
+ __u32 supported;
+ __u32 wolopts;
+ __u8 sopass[SOPASS_MAX]; /* SecureOn(tm) password */
+};
+
+/* for passing single values */
+struct ethtool_value {
+ __u32 cmd;
+ __u32 data;
+};
+
+/* for passing big chunks of data */
+struct ethtool_regs {
+ __u32 cmd;
+ __u32 version; /* driver-specific, indicates different chips/revs */
+ __u32 len; /* bytes */
+ __u8 data[0];
+};
+
+/* for passing EEPROM chunks */
+struct ethtool_eeprom {
+ __u32 cmd;
+ __u32 magic;
+ __u32 offset; /* in bytes */
+ __u32 len; /* in bytes */
+ __u8 data[0];
+};
+
+/* for configuring coalescing parameters of chip */
+struct ethtool_coalesce {
+ __u32 cmd; /* ETHTOOL_{G,S}COALESCE */
+
+ /* How many usecs to delay an RX interrupt after
+ * a packet arrives. If 0, only rx_max_coalesced_frames
+ * is used.
+ */
+ __u32 rx_coalesce_usecs;
+
+ /* How many packets to delay an RX interrupt after
+ * a packet arrives. If 0, only rx_coalesce_usecs is
+ * used. It is illegal to set both usecs and max frames
+ * to zero as this would cause RX interrupts to never be
+ * generated.
+ */
+ __u32 rx_max_coalesced_frames;
+
+ /* Same as above two parameters, except that these values
+ * apply while an IRQ is being serviced by the host. Not
+ * all cards support this feature and the values are ignored
+ * in that case.
+ */
+ __u32 rx_coalesce_usecs_irq;
+ __u32 rx_max_coalesced_frames_irq;
+
+ /* How many usecs to delay a TX interrupt after
+ * a packet is sent. If 0, only tx_max_coalesced_frames
+ * is used.
+ */
+ __u32 tx_coalesce_usecs;
+
+ /* How many packets to delay a TX interrupt after
+ * a packet is sent. If 0, only tx_coalesce_usecs is
+ * used. It is illegal to set both usecs and max frames
+ * to zero as this would cause TX interrupts to never be
+ * generated.
+ */
+ __u32 tx_max_coalesced_frames;
+
+ /* Same as above two parameters, except that these values
+ * apply while an IRQ is being serviced by the host. Not
+ * all cards support this feature and the values are ignored
+ * in that case.
+ */
+ __u32 tx_coalesce_usecs_irq;
+ __u32 tx_max_coalesced_frames_irq;
+
+ /* How many usecs to delay in-memory statistics
+ * block updates. Some drivers do not have an in-memory
+ * statistic block, and in such cases this value is ignored.
+ * This value must not be zero.
+ */
+ __u32 stats_block_coalesce_usecs;
+
+ /* Adaptive RX/TX coalescing is an algorithm implemented by
+ * some drivers to improve latency under low packet rates and
+ * improve throughput under high packet rates. Some drivers
+ * only implement one of RX or TX adaptive coalescing. Anything
+ * not implemented by the driver causes these values to be
+ * silently ignored.
+ */
+ __u32 use_adaptive_rx_coalesce;
+ __u32 use_adaptive_tx_coalesce;
+
+ /* When the packet rate (measured in packets per second)
+ * is below pkt_rate_low, the {rx,tx}_*_low parameters are
+ * used.
+ */
+ __u32 pkt_rate_low;
+ __u32 rx_coalesce_usecs_low;
+ __u32 rx_max_coalesced_frames_low;
+ __u32 tx_coalesce_usecs_low;
+ __u32 tx_max_coalesced_frames_low;
+
+ /* When the packet rate is below pkt_rate_high but above
+ * pkt_rate_low (both measured in packets per second) the
+ * normal {rx,tx}_* coalescing parameters are used.
+ */
+
+ /* When the packet rate is (measured in packets per second)
+ * is above pkt_rate_high, the {rx,tx}_*_high parameters are
+ * used.
+ */
+ __u32 pkt_rate_high;
+ __u32 rx_coalesce_usecs_high;
+ __u32 rx_max_coalesced_frames_high;
+ __u32 tx_coalesce_usecs_high;
+ __u32 tx_max_coalesced_frames_high;
+
+ /* How often to do adaptive coalescing packet rate sampling,
+ * measured in seconds. Must not be zero.
+ */
+ __u32 rate_sample_interval;
+};
+
+/* for configuring RX/TX ring parameters */
+struct ethtool_ringparam {
+ __u32 cmd; /* ETHTOOL_{G,S}RINGPARAM */
+
+ /* Read only attributes. These indicate the maximum number
+ * of pending RX/TX ring entries the driver will allow the
+ * user to set.
+ */
+ __u32 rx_max_pending;
+ __u32 rx_mini_max_pending;
+ __u32 rx_jumbo_max_pending;
+ __u32 tx_max_pending;
+
+ /* Values changeable by the user. The valid values are
+ * in the range 1 to the "*_max_pending" counterpart above.
+ */
+ __u32 rx_pending;
+ __u32 rx_mini_pending;
+ __u32 rx_jumbo_pending;
+ __u32 tx_pending;
+};
+
+/* for configuring link flow control parameters */
+struct ethtool_pauseparam {
+ __u32 cmd; /* ETHTOOL_{G,S}PAUSEPARAM */
+
+ /* If the link is being auto-negotiated (via ethtool_cmd.autoneg
+ * being true) the user may set 'autonet' here non-zero to have the
+ * pause parameters be auto-negotiated too. In such a case, the
+ * {rx,tx}_pause values below determine what capabilities are
+ * advertised.
+ *
+ * If 'autoneg' is zero or the link is not being auto-negotiated,
+ * then {rx,tx}_pause force the driver to use/not-use pause
+ * flow control.
+ */
+ __u32 autoneg;
+ __u32 rx_pause;
+ __u32 tx_pause;
+};
+
+#define ETH_GSTRING_LEN 32
+enum ethtool_stringset {
+ ETH_SS_TEST = 0,
+ ETH_SS_STATS,
+ ETH_SS_PRIV_FLAGS,
+};
+
+/* for passing string sets for data tagging */
+struct ethtool_gstrings {
+ __u32 cmd; /* ETHTOOL_GSTRINGS */
+ __u32 string_set; /* string set id e.c. ETH_SS_TEST, etc*/
+ __u32 len; /* number of strings in the string set */
+ __u8 data[0];
+};
+
+enum ethtool_test_flags {
+ ETH_TEST_FL_OFFLINE = (1 << 0), /* online / offline */
+ ETH_TEST_FL_FAILED = (1 << 1), /* test passed / failed */
+};
+
+/* for requesting NIC test and getting results*/
+struct ethtool_test {
+ __u32 cmd; /* ETHTOOL_TEST */
+ __u32 flags; /* ETH_TEST_FL_xxx */
+ __u32 reserved;
+ __u32 len; /* result length, in number of u64 elements */
+ __u64 data[0];
+};
+
+/* for dumping NIC-specific statistics */
+struct ethtool_stats {
+ __u32 cmd; /* ETHTOOL_GSTATS */
+ __u32 n_stats; /* number of u64's being returned */
+ __u64 data[0];
+};
+
+struct ethtool_perm_addr {
+ __u32 cmd; /* ETHTOOL_GPERMADDR */
+ __u32 size;
+ __u8 data[0];
+};
+
+/* boolean flags controlling per-interface behavior characteristics.
+ * When reading, the flag indicates whether or not a certain behavior
+ * is enabled/present. When writing, the flag indicates whether
+ * or not the driver should turn on (set) or off (clear) a behavior.
+ *
+ * Some behaviors may read-only (unconditionally absent or present).
+ * If such is the case, return EINVAL in the set-flags operation if the
+ * flag differs from the read-only value.
+ */
+enum ethtool_flags {
+ ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */
+};
+
+
+/* CMDs currently supported */
+#define ETHTOOL_GSET 0x00000001 /* Get settings. */
+#define ETHTOOL_SSET 0x00000002 /* Set settings. */
+#define ETHTOOL_GDRVINFO 0x00000003 /* Get driver info. */
+#define ETHTOOL_GREGS 0x00000004 /* Get NIC registers. */
+#define ETHTOOL_GWOL 0x00000005 /* Get wake-on-lan options. */
+#define ETHTOOL_SWOL 0x00000006 /* Set wake-on-lan options. */
+#define ETHTOOL_GMSGLVL 0x00000007 /* Get driver message level */
+#define ETHTOOL_SMSGLVL 0x00000008 /* Set driver msg level. */
+#define ETHTOOL_NWAY_RST 0x00000009 /* Restart autonegotiation. */
+#define ETHTOOL_GLINK 0x0000000a /* Get link status (ethtool_value) */
+#define ETHTOOL_GEEPROM 0x0000000b /* Get EEPROM data */
+#define ETHTOOL_SEEPROM 0x0000000c /* Set EEPROM data. */
+#define ETHTOOL_GCOALESCE 0x0000000e /* Get coalesce config */
+#define ETHTOOL_SCOALESCE 0x0000000f /* Set coalesce config. */
+#define ETHTOOL_GRINGPARAM 0x00000010 /* Get ring parameters */
+#define ETHTOOL_SRINGPARAM 0x00000011 /* Set ring parameters. */
+#define ETHTOOL_GPAUSEPARAM 0x00000012 /* Get pause parameters */
+#define ETHTOOL_SPAUSEPARAM 0x00000013 /* Set pause parameters. */
+#define ETHTOOL_GRXCSUM 0x00000014 /* Get RX hw csum enable (ethtool_value) */
+#define ETHTOOL_SRXCSUM 0x00000015 /* Set RX hw csum enable (ethtool_value) */
+#define ETHTOOL_GTXCSUM 0x00000016 /* Get TX hw csum enable (ethtool_value) */
+#define ETHTOOL_STXCSUM 0x00000017 /* Set TX hw csum enable (ethtool_value) */
+#define ETHTOOL_GSG 0x00000018 /* Get scatter-gather enable
+ * (ethtool_value) */
+#define ETHTOOL_SSG 0x00000019 /* Set scatter-gather enable
+ * (ethtool_value). */
+#define ETHTOOL_TEST 0x0000001a /* execute NIC self-test. */
+#define ETHTOOL_GSTRINGS 0x0000001b /* get specified string set */
+#define ETHTOOL_PHYS_ID 0x0000001c /* identify the NIC */
+#define ETHTOOL_GSTATS 0x0000001d /* get NIC-specific statistics */
+#define ETHTOOL_GTSO 0x0000001e /* Get TSO enable (ethtool_value) */
+#define ETHTOOL_STSO 0x0000001f /* Set TSO enable (ethtool_value) */
+#define ETHTOOL_GPERMADDR 0x00000020 /* Get permanent hardware address */
+#define ETHTOOL_GUFO 0x00000021 /* Get UFO enable (ethtool_value) */
+#define ETHTOOL_SUFO 0x00000022 /* Set UFO enable (ethtool_value) */
+#define ETHTOOL_GGSO 0x00000023 /* Get GSO enable (ethtool_value) */
+#define ETHTOOL_SGSO 0x00000024 /* Set GSO enable (ethtool_value) */
+#define ETHTOOL_GFLAGS 0x00000025 /* Get flags bitmap(ethtool_value) */
+#define ETHTOOL_SFLAGS 0x00000026 /* Set flags bitmap(ethtool_value) */
+#define ETHTOOL_GPFLAGS 0x00000027 /* Get driver-private flags bitmap */
+#define ETHTOOL_SPFLAGS 0x00000028 /* Set driver-private flags bitmap */
+
+/* compatibility with older code */
+#define SPARC_ETH_GSET ETHTOOL_GSET
+#define SPARC_ETH_SSET ETHTOOL_SSET
+
+/* Indicates what features are supported by the interface. */
+#define SUPPORTED_10baseT_Half (1 << 0)
+#define SUPPORTED_10baseT_Full (1 << 1)
+#define SUPPORTED_100baseT_Half (1 << 2)
+#define SUPPORTED_100baseT_Full (1 << 3)
+#define SUPPORTED_1000baseT_Half (1 << 4)
+#define SUPPORTED_1000baseT_Full (1 << 5)
+#define SUPPORTED_Autoneg (1 << 6)
+#define SUPPORTED_TP (1 << 7)
+#define SUPPORTED_AUI (1 << 8)
+#define SUPPORTED_MII (1 << 9)
+#define SUPPORTED_FIBRE (1 << 10)
+#define SUPPORTED_BNC (1 << 11)
+#define SUPPORTED_10000baseT_Full (1 << 12)
+#define SUPPORTED_Pause (1 << 13)
+#define SUPPORTED_Asym_Pause (1 << 14)
+#define SUPPORTED_2500baseX_Full (1 << 15)
+
+/* Indicates what features are advertised by the interface. */
+#define ADVERTISED_10baseT_Half (1 << 0)
+#define ADVERTISED_10baseT_Full (1 << 1)
+#define ADVERTISED_100baseT_Half (1 << 2)
+#define ADVERTISED_100baseT_Full (1 << 3)
+#define ADVERTISED_1000baseT_Half (1 << 4)
+#define ADVERTISED_1000baseT_Full (1 << 5)
+#define ADVERTISED_Autoneg (1 << 6)
+#define ADVERTISED_TP (1 << 7)
+#define ADVERTISED_AUI (1 << 8)
+#define ADVERTISED_MII (1 << 9)
+#define ADVERTISED_FIBRE (1 << 10)
+#define ADVERTISED_BNC (1 << 11)
+#define ADVERTISED_10000baseT_Full (1 << 12)
+#define ADVERTISED_Pause (1 << 13)
+#define ADVERTISED_Asym_Pause (1 << 14)
+#define ADVERTISED_2500baseX_Full (1 << 15)
+
+/* The following are all involved in forcing a particular link
+ * mode for the device for setting things. When getting the
+ * devices settings, these indicate the current mode and whether
+ * it was foced up into this mode or autonegotiated.
+ */
+
+/* The forced speed, 10Mb, 100Mb, gigabit, 2.5Gb, 10GbE. */
+#define SPEED_10 10
+#define SPEED_100 100
+#define SPEED_1000 1000
+#define SPEED_2500 2500
+#define SPEED_10000 10000
+
+/* Duplex, half or full. */
+#define DUPLEX_HALF 0x00
+#define DUPLEX_FULL 0x01
+
+/* Which connector port. */
+#define PORT_TP 0x00
+#define PORT_AUI 0x01
+#define PORT_MII 0x02
+#define PORT_FIBRE 0x03
+#define PORT_BNC 0x04
+
+/* Which transceiver to use. */
+#define XCVR_INTERNAL 0x00
+#define XCVR_EXTERNAL 0x01
+#define XCVR_DUMMY1 0x02
+#define XCVR_DUMMY2 0x03
+#define XCVR_DUMMY3 0x04
+
+/* Enable or disable autonegotiation. If this is set to enable,
+ * the forced link modes above are completely ignored.
+ */
+#define AUTONEG_DISABLE 0x00
+#define AUTONEG_ENABLE 0x01
+
+/* Wake-On-Lan options. */
+#define WAKE_PHY (1 << 0)
+#define WAKE_UCAST (1 << 1)
+#define WAKE_MCAST (1 << 2)
+#define WAKE_BCAST (1 << 3)
+#define WAKE_ARP (1 << 4)
+#define WAKE_MAGIC (1 << 5)
+#define WAKE_MAGICSECURE (1 << 6) /* only meaningful if WAKE_MAGIC */
+
+#endif /* _LINUX_ETHTOOL_H */
diff --git a/sysroot/usr/include/linux/eventpoll.h b/sysroot/usr/include/linux/eventpoll.h
new file mode 100644
index 0000000..c2336ab
--- /dev/null
+++ b/sysroot/usr/include/linux/eventpoll.h
@@ -0,0 +1,50 @@
+/*
+ * include/linux/eventpoll.h ( Efficent event polling implementation )
+ * Copyright (C) 2001,...,2006 Davide Libenzi
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Davide Libenzi <davidel@xmailserver.org>
+ *
+ */
+
+#ifndef _LINUX_EVENTPOLL_H
+#define _LINUX_EVENTPOLL_H
+
+#include <linux/types.h>
+
+
+/* Valid opcodes to issue to sys_epoll_ctl() */
+#define EPOLL_CTL_ADD 1
+#define EPOLL_CTL_DEL 2
+#define EPOLL_CTL_MOD 3
+
+/* Set the One Shot behaviour for the target file descriptor */
+#define EPOLLONESHOT (1 << 30)
+
+/* Set the Edge Triggered behaviour for the target file descriptor */
+#define EPOLLET (1 << 31)
+
+/*
+ * On x86-64 make the 64bit structure have the same alignment as the
+ * 32bit structure. This makes 32bit emulation easier.
+ *
+ * UML/x86_64 needs the same packing as x86_64
+ */
+#ifdef __x86_64__
+#define EPOLL_PACKED __attribute__((packed))
+#else
+#define EPOLL_PACKED
+#endif
+
+struct epoll_event {
+ __u32 events;
+ __u64 data;
+} EPOLL_PACKED;
+
+
+#endif /* #ifndef _LINUX_EVENTPOLL_H */
+
diff --git a/sysroot/usr/include/linux/ext2_fs.h b/sysroot/usr/include/linux/ext2_fs.h
new file mode 100644
index 0000000..dca3766
--- /dev/null
+++ b/sysroot/usr/include/linux/ext2_fs.h
@@ -0,0 +1,532 @@
+/*
+ * linux/include/linux/ext2_fs.h
+ *
+ * Copyright (C) 1992, 1993, 1994, 1995
+ * Remy Card (card@masi.ibp.fr)
+ * Laboratoire MASI - Institut Blaise Pascal
+ * Universite Pierre et Marie Curie (Paris VI)
+ *
+ * from
+ *
+ * linux/include/linux/minix_fs.h
+ *
+ * Copyright (C) 1991, 1992 Linus Torvalds
+ */
+
+#ifndef _LINUX_EXT2_FS_H
+#define _LINUX_EXT2_FS_H
+
+#include <linux/types.h>
+#include <linux/magic.h>
+
+/*
+ * The second extended filesystem constants/structures
+ */
+
+/*
+ * Define EXT2FS_DEBUG to produce debug messages
+ */
+#undef EXT2FS_DEBUG
+
+/*
+ * Define EXT2_RESERVATION to reserve data blocks for expanding files
+ */
+#define EXT2_DEFAULT_RESERVE_BLOCKS 8
+/*max window size: 1024(direct blocks) + 3([t,d]indirect blocks) */
+#define EXT2_MAX_RESERVE_BLOCKS 1027
+#define EXT2_RESERVE_WINDOW_NOT_ALLOCATED 0
+/*
+ * The second extended file system version
+ */
+#define EXT2FS_DATE "95/08/09"
+#define EXT2FS_VERSION "0.5b"
+
+/*
+ * Debug code
+ */
+#ifdef EXT2FS_DEBUG
+# define ext2_debug(f, a...) { \
+ printk ("EXT2-fs DEBUG (%s, %d): %s:", \
+ __FILE__, __LINE__, __FUNCTION__); \
+ printk (f, ## a); \
+ }
+#else
+# define ext2_debug(f, a...) /**/
+#endif
+
+/*
+ * Special inode numbers
+ */
+#define EXT2_BAD_INO 1 /* Bad blocks inode */
+#define EXT2_ROOT_INO 2 /* Root inode */
+#define EXT2_BOOT_LOADER_INO 5 /* Boot loader inode */
+#define EXT2_UNDEL_DIR_INO 6 /* Undelete directory inode */
+
+/* First non-reserved inode for old ext2 filesystems */
+#define EXT2_GOOD_OLD_FIRST_INO 11
+
+/* Assume that user mode programs are passing in an ext2fs superblock, not
+ * a kernel struct super_block. This will allow us to call the feature-test
+ * macros from user land. */
+#define EXT2_SB(sb) (sb)
+
+/*
+ * Maximal count of links to a file
+ */
+#define EXT2_LINK_MAX 32000
+
+/*
+ * Macro-instructions used to manage several block sizes
+ */
+#define EXT2_MIN_BLOCK_SIZE 1024
+#define EXT2_MAX_BLOCK_SIZE 4096
+#define EXT2_MIN_BLOCK_LOG_SIZE 10
+# define EXT2_BLOCK_SIZE(s) (EXT2_MIN_BLOCK_SIZE << (s)->s_log_block_size)
+#define EXT2_ADDR_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof (__u32))
+# define EXT2_BLOCK_SIZE_BITS(s) ((s)->s_log_block_size + 10)
+#define EXT2_INODE_SIZE(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \
+ EXT2_GOOD_OLD_INODE_SIZE : \
+ (s)->s_inode_size)
+#define EXT2_FIRST_INO(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \
+ EXT2_GOOD_OLD_FIRST_INO : \
+ (s)->s_first_ino)
+
+/*
+ * Macro-instructions used to manage fragments
+ */
+#define EXT2_MIN_FRAG_SIZE 1024
+#define EXT2_MAX_FRAG_SIZE 4096
+#define EXT2_MIN_FRAG_LOG_SIZE 10
+# define EXT2_FRAG_SIZE(s) (EXT2_MIN_FRAG_SIZE << (s)->s_log_frag_size)
+# define EXT2_FRAGS_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / EXT2_FRAG_SIZE(s))
+
+/*
+ * Structure of a blocks group descriptor
+ */
+struct ext2_group_desc
+{
+ __le32 bg_block_bitmap; /* Blocks bitmap block */
+ __le32 bg_inode_bitmap; /* Inodes bitmap block */
+ __le32 bg_inode_table; /* Inodes table block */
+ __le16 bg_free_blocks_count; /* Free blocks count */
+ __le16 bg_free_inodes_count; /* Free inodes count */
+ __le16 bg_used_dirs_count; /* Directories count */
+ __le16 bg_pad;
+ __le32 bg_reserved[3];
+};
+
+/*
+ * Macro-instructions used to manage group descriptors
+ */
+# define EXT2_BLOCKS_PER_GROUP(s) ((s)->s_blocks_per_group)
+# define EXT2_DESC_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof (struct ext2_group_desc))
+# define EXT2_INODES_PER_GROUP(s) ((s)->s_inodes_per_group)
+
+/*
+ * Constants relative to the data blocks
+ */
+#define EXT2_NDIR_BLOCKS 12
+#define EXT2_IND_BLOCK EXT2_NDIR_BLOCKS
+#define EXT2_DIND_BLOCK (EXT2_IND_BLOCK + 1)
+#define EXT2_TIND_BLOCK (EXT2_DIND_BLOCK + 1)
+#define EXT2_N_BLOCKS (EXT2_TIND_BLOCK + 1)
+
+/*
+ * Inode flags (GETFLAGS/SETFLAGS)
+ */
+#define EXT2_SECRM_FL FS_SECRM_FL /* Secure deletion */
+#define EXT2_UNRM_FL FS_UNRM_FL /* Undelete */
+#define EXT2_COMPR_FL FS_COMPR_FL /* Compress file */
+#define EXT2_SYNC_FL FS_SYNC_FL /* Synchronous updates */
+#define EXT2_IMMUTABLE_FL FS_IMMUTABLE_FL /* Immutable file */
+#define EXT2_APPEND_FL FS_APPEND_FL /* writes to file may only append */
+#define EXT2_NODUMP_FL FS_NODUMP_FL /* do not dump file */
+#define EXT2_NOATIME_FL FS_NOATIME_FL /* do not update atime */
+/* Reserved for compression usage... */
+#define EXT2_DIRTY_FL FS_DIRTY_FL
+#define EXT2_COMPRBLK_FL FS_COMPRBLK_FL /* One or more compressed clusters */
+#define EXT2_NOCOMP_FL FS_NOCOMP_FL /* Don't compress */
+#define EXT2_ECOMPR_FL FS_ECOMPR_FL /* Compression error */
+/* End compression flags --- maybe not all used */
+#define EXT2_BTREE_FL FS_BTREE_FL /* btree format dir */
+#define EXT2_INDEX_FL FS_INDEX_FL /* hash-indexed directory */
+#define EXT2_IMAGIC_FL FS_IMAGIC_FL /* AFS directory */
+#define EXT2_JOURNAL_DATA_FL FS_JOURNAL_DATA_FL /* Reserved for ext3 */
+#define EXT2_NOTAIL_FL FS_NOTAIL_FL /* file tail should not be merged */
+#define EXT2_DIRSYNC_FL FS_DIRSYNC_FL /* dirsync behaviour (directories only) */
+#define EXT2_TOPDIR_FL FS_TOPDIR_FL /* Top of directory hierarchies*/
+#define EXT2_RESERVED_FL FS_RESERVED_FL /* reserved for ext2 lib */
+
+#define EXT2_FL_USER_VISIBLE FS_FL_USER_VISIBLE /* User visible flags */
+#define EXT2_FL_USER_MODIFIABLE FS_FL_USER_MODIFIABLE /* User modifiable flags */
+
+/*
+ * ioctl commands
+ */
+#define EXT2_IOC_GETFLAGS FS_IOC_GETFLAGS
+#define EXT2_IOC_SETFLAGS FS_IOC_SETFLAGS
+#define EXT2_IOC_GETVERSION FS_IOC_GETVERSION
+#define EXT2_IOC_SETVERSION FS_IOC_SETVERSION
+#define EXT2_IOC_GETRSVSZ _IOR('f', 5, long)
+#define EXT2_IOC_SETRSVSZ _IOW('f', 6, long)
+
+/*
+ * ioctl commands in 32 bit emulation
+ */
+#define EXT2_IOC32_GETFLAGS FS_IOC32_GETFLAGS
+#define EXT2_IOC32_SETFLAGS FS_IOC32_SETFLAGS
+#define EXT2_IOC32_GETVERSION FS_IOC32_GETVERSION
+#define EXT2_IOC32_SETVERSION FS_IOC32_SETVERSION
+
+/*
+ * Structure of an inode on the disk
+ */
+struct ext2_inode {
+ __le16 i_mode; /* File mode */
+ __le16 i_uid; /* Low 16 bits of Owner Uid */
+ __le32 i_size; /* Size in bytes */
+ __le32 i_atime; /* Access time */
+ __le32 i_ctime; /* Creation time */
+ __le32 i_mtime; /* Modification time */
+ __le32 i_dtime; /* Deletion Time */
+ __le16 i_gid; /* Low 16 bits of Group Id */
+ __le16 i_links_count; /* Links count */
+ __le32 i_blocks; /* Blocks count */
+ __le32 i_flags; /* File flags */
+ union {
+ struct {
+ __le32 l_i_reserved1;
+ } linux1;
+ struct {
+ __le32 h_i_translator;
+ } hurd1;
+ struct {
+ __le32 m_i_reserved1;
+ } masix1;
+ } osd1; /* OS dependent 1 */
+ __le32 i_block[EXT2_N_BLOCKS];/* Pointers to blocks */
+ __le32 i_generation; /* File version (for NFS) */
+ __le32 i_file_acl; /* File ACL */
+ __le32 i_dir_acl; /* Directory ACL */
+ __le32 i_faddr; /* Fragment address */
+ union {
+ struct {
+ __u8 l_i_frag; /* Fragment number */
+ __u8 l_i_fsize; /* Fragment size */
+ __u16 i_pad1;
+ __le16 l_i_uid_high; /* these 2 fields */
+ __le16 l_i_gid_high; /* were reserved2[0] */
+ __u32 l_i_reserved2;
+ } linux2;
+ struct {
+ __u8 h_i_frag; /* Fragment number */
+ __u8 h_i_fsize; /* Fragment size */
+ __le16 h_i_mode_high;
+ __le16 h_i_uid_high;
+ __le16 h_i_gid_high;
+ __le32 h_i_author;
+ } hurd2;
+ struct {
+ __u8 m_i_frag; /* Fragment number */
+ __u8 m_i_fsize; /* Fragment size */
+ __u16 m_pad1;
+ __u32 m_i_reserved2[2];
+ } masix2;
+ } osd2; /* OS dependent 2 */
+};
+
+#define i_size_high i_dir_acl
+
+#if defined(__KERNEL__) || defined(__linux__)
+#define i_reserved1 osd1.linux1.l_i_reserved1
+#define i_frag osd2.linux2.l_i_frag
+#define i_fsize osd2.linux2.l_i_fsize
+#define i_uid_low i_uid
+#define i_gid_low i_gid
+#define i_uid_high osd2.linux2.l_i_uid_high
+#define i_gid_high osd2.linux2.l_i_gid_high
+#define i_reserved2 osd2.linux2.l_i_reserved2
+#endif
+
+#ifdef __hurd__
+#define i_translator osd1.hurd1.h_i_translator
+#define i_frag osd2.hurd2.h_i_frag;
+#define i_fsize osd2.hurd2.h_i_fsize;
+#define i_uid_high osd2.hurd2.h_i_uid_high
+#define i_gid_high osd2.hurd2.h_i_gid_high
+#define i_author osd2.hurd2.h_i_author
+#endif
+
+#ifdef __masix__
+#define i_reserved1 osd1.masix1.m_i_reserved1
+#define i_frag osd2.masix2.m_i_frag
+#define i_fsize osd2.masix2.m_i_fsize
+#define i_reserved2 osd2.masix2.m_i_reserved2
+#endif
+
+/*
+ * File system states
+ */
+#define EXT2_VALID_FS 0x0001 /* Unmounted cleanly */
+#define EXT2_ERROR_FS 0x0002 /* Errors detected */
+
+/*
+ * Mount flags
+ */
+#define EXT2_MOUNT_CHECK 0x000001 /* Do mount-time checks */
+#define EXT2_MOUNT_OLDALLOC 0x000002 /* Don't use the new Orlov allocator */
+#define EXT2_MOUNT_GRPID 0x000004 /* Create files with directory's group */
+#define EXT2_MOUNT_DEBUG 0x000008 /* Some debugging messages */
+#define EXT2_MOUNT_ERRORS_CONT 0x000010 /* Continue on errors */
+#define EXT2_MOUNT_ERRORS_RO 0x000020 /* Remount fs ro on errors */
+#define EXT2_MOUNT_ERRORS_PANIC 0x000040 /* Panic on errors */
+#define EXT2_MOUNT_MINIX_DF 0x000080 /* Mimics the Minix statfs */
+#define EXT2_MOUNT_NOBH 0x000100 /* No buffer_heads */
+#define EXT2_MOUNT_NO_UID32 0x000200 /* Disable 32-bit UIDs */
+#define EXT2_MOUNT_XATTR_USER 0x004000 /* Extended user attributes */
+#define EXT2_MOUNT_POSIX_ACL 0x008000 /* POSIX Access Control Lists */
+#define EXT2_MOUNT_XIP 0x010000 /* Execute in place */
+#define EXT2_MOUNT_USRQUOTA 0x020000 /* user quota */
+#define EXT2_MOUNT_GRPQUOTA 0x040000 /* group quota */
+#define EXT2_MOUNT_RESERVATION 0x080000 /* Preallocation */
+
+
+#define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt
+#define set_opt(o, opt) o |= EXT2_MOUNT_##opt
+#define test_opt(sb, opt) (EXT2_SB(sb)->s_mount_opt & \
+ EXT2_MOUNT_##opt)
+/*
+ * Maximal mount counts between two filesystem checks
+ */
+#define EXT2_DFL_MAX_MNT_COUNT 20 /* Allow 20 mounts */
+#define EXT2_DFL_CHECKINTERVAL 0 /* Don't use interval check */
+
+/*
+ * Behaviour when detecting errors
+ */
+#define EXT2_ERRORS_CONTINUE 1 /* Continue execution */
+#define EXT2_ERRORS_RO 2 /* Remount fs read-only */
+#define EXT2_ERRORS_PANIC 3 /* Panic */
+#define EXT2_ERRORS_DEFAULT EXT2_ERRORS_CONTINUE
+
+/*
+ * Structure of the super block
+ */
+struct ext2_super_block {
+ __le32 s_inodes_count; /* Inodes count */
+ __le32 s_blocks_count; /* Blocks count */
+ __le32 s_r_blocks_count; /* Reserved blocks count */
+ __le32 s_free_blocks_count; /* Free blocks count */
+ __le32 s_free_inodes_count; /* Free inodes count */
+ __le32 s_first_data_block; /* First Data Block */
+ __le32 s_log_block_size; /* Block size */
+ __le32 s_log_frag_size; /* Fragment size */
+ __le32 s_blocks_per_group; /* # Blocks per group */
+ __le32 s_frags_per_group; /* # Fragments per group */
+ __le32 s_inodes_per_group; /* # Inodes per group */
+ __le32 s_mtime; /* Mount time */
+ __le32 s_wtime; /* Write time */
+ __le16 s_mnt_count; /* Mount count */
+ __le16 s_max_mnt_count; /* Maximal mount count */
+ __le16 s_magic; /* Magic signature */
+ __le16 s_state; /* File system state */
+ __le16 s_errors; /* Behaviour when detecting errors */
+ __le16 s_minor_rev_level; /* minor revision level */
+ __le32 s_lastcheck; /* time of last check */
+ __le32 s_checkinterval; /* max. time between checks */
+ __le32 s_creator_os; /* OS */
+ __le32 s_rev_level; /* Revision level */
+ __le16 s_def_resuid; /* Default uid for reserved blocks */
+ __le16 s_def_resgid; /* Default gid for reserved blocks */
+ /*
+ * These fields are for EXT2_DYNAMIC_REV superblocks only.
+ *
+ * Note: the difference between the compatible feature set and
+ * the incompatible feature set is that if there is a bit set
+ * in the incompatible feature set that the kernel doesn't
+ * know about, it should refuse to mount the filesystem.
+ *
+ * e2fsck's requirements are more strict; if it doesn't know
+ * about a feature in either the compatible or incompatible
+ * feature set, it must abort and not try to meddle with
+ * things it doesn't understand...
+ */
+ __le32 s_first_ino; /* First non-reserved inode */
+ __le16 s_inode_size; /* size of inode structure */
+ __le16 s_block_group_nr; /* block group # of this superblock */
+ __le32 s_feature_compat; /* compatible feature set */
+ __le32 s_feature_incompat; /* incompatible feature set */
+ __le32 s_feature_ro_compat; /* readonly-compatible feature set */
+ __u8 s_uuid[16]; /* 128-bit uuid for volume */
+ char s_volume_name[16]; /* volume name */
+ char s_last_mounted[64]; /* directory where last mounted */
+ __le32 s_algorithm_usage_bitmap; /* For compression */
+ /*
+ * Performance hints. Directory preallocation should only
+ * happen if the EXT2_COMPAT_PREALLOC flag is on.
+ */
+ __u8 s_prealloc_blocks; /* Nr of blocks to try to preallocate*/
+ __u8 s_prealloc_dir_blocks; /* Nr to preallocate for dirs */
+ __u16 s_padding1;
+ /*
+ * Journaling support valid if EXT3_FEATURE_COMPAT_HAS_JOURNAL set.
+ */
+ __u8 s_journal_uuid[16]; /* uuid of journal superblock */
+ __u32 s_journal_inum; /* inode number of journal file */
+ __u32 s_journal_dev; /* device number of journal file */
+ __u32 s_last_orphan; /* start of list of inodes to delete */
+ __u32 s_hash_seed[4]; /* HTREE hash seed */
+ __u8 s_def_hash_version; /* Default hash version to use */
+ __u8 s_reserved_char_pad;
+ __u16 s_reserved_word_pad;
+ __le32 s_default_mount_opts;
+ __le32 s_first_meta_bg; /* First metablock block group */
+ __u32 s_reserved[190]; /* Padding to the end of the block */
+};
+
+/*
+ * Codes for operating systems
+ */
+#define EXT2_OS_LINUX 0
+#define EXT2_OS_HURD 1
+#define EXT2_OS_MASIX 2
+#define EXT2_OS_FREEBSD 3
+#define EXT2_OS_LITES 4
+
+/*
+ * Revision levels
+ */
+#define EXT2_GOOD_OLD_REV 0 /* The good old (original) format */
+#define EXT2_DYNAMIC_REV 1 /* V2 format w/ dynamic inode sizes */
+
+#define EXT2_CURRENT_REV EXT2_GOOD_OLD_REV
+#define EXT2_MAX_SUPP_REV EXT2_DYNAMIC_REV
+
+#define EXT2_GOOD_OLD_INODE_SIZE 128
+
+/*
+ * Feature set definitions
+ */
+
+#define EXT2_HAS_COMPAT_FEATURE(sb,mask) \
+ ( EXT2_SB(sb)->s_es->s_feature_compat & cpu_to_le32(mask) )
+#define EXT2_HAS_RO_COMPAT_FEATURE(sb,mask) \
+ ( EXT2_SB(sb)->s_es->s_feature_ro_compat & cpu_to_le32(mask) )
+#define EXT2_HAS_INCOMPAT_FEATURE(sb,mask) \
+ ( EXT2_SB(sb)->s_es->s_feature_incompat & cpu_to_le32(mask) )
+#define EXT2_SET_COMPAT_FEATURE(sb,mask) \
+ EXT2_SB(sb)->s_es->s_feature_compat |= cpu_to_le32(mask)
+#define EXT2_SET_RO_COMPAT_FEATURE(sb,mask) \
+ EXT2_SB(sb)->s_es->s_feature_ro_compat |= cpu_to_le32(mask)
+#define EXT2_SET_INCOMPAT_FEATURE(sb,mask) \
+ EXT2_SB(sb)->s_es->s_feature_incompat |= cpu_to_le32(mask)
+#define EXT2_CLEAR_COMPAT_FEATURE(sb,mask) \
+ EXT2_SB(sb)->s_es->s_feature_compat &= ~cpu_to_le32(mask)
+#define EXT2_CLEAR_RO_COMPAT_FEATURE(sb,mask) \
+ EXT2_SB(sb)->s_es->s_feature_ro_compat &= ~cpu_to_le32(mask)
+#define EXT2_CLEAR_INCOMPAT_FEATURE(sb,mask) \
+ EXT2_SB(sb)->s_es->s_feature_incompat &= ~cpu_to_le32(mask)
+
+#define EXT2_FEATURE_COMPAT_DIR_PREALLOC 0x0001
+#define EXT2_FEATURE_COMPAT_IMAGIC_INODES 0x0002
+#define EXT3_FEATURE_COMPAT_HAS_JOURNAL 0x0004
+#define EXT2_FEATURE_COMPAT_EXT_ATTR 0x0008
+#define EXT2_FEATURE_COMPAT_RESIZE_INO 0x0010
+#define EXT2_FEATURE_COMPAT_DIR_INDEX 0x0020
+#define EXT2_FEATURE_COMPAT_ANY 0xffffffff
+
+#define EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001
+#define EXT2_FEATURE_RO_COMPAT_LARGE_FILE 0x0002
+#define EXT2_FEATURE_RO_COMPAT_BTREE_DIR 0x0004
+#define EXT2_FEATURE_RO_COMPAT_ANY 0xffffffff
+
+#define EXT2_FEATURE_INCOMPAT_COMPRESSION 0x0001
+#define EXT2_FEATURE_INCOMPAT_FILETYPE 0x0002
+#define EXT3_FEATURE_INCOMPAT_RECOVER 0x0004
+#define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV 0x0008
+#define EXT2_FEATURE_INCOMPAT_META_BG 0x0010
+#define EXT2_FEATURE_INCOMPAT_ANY 0xffffffff
+
+#define EXT2_FEATURE_COMPAT_SUPP EXT2_FEATURE_COMPAT_EXT_ATTR
+#define EXT2_FEATURE_INCOMPAT_SUPP (EXT2_FEATURE_INCOMPAT_FILETYPE| \
+ EXT2_FEATURE_INCOMPAT_META_BG)
+#define EXT2_FEATURE_RO_COMPAT_SUPP (EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER| \
+ EXT2_FEATURE_RO_COMPAT_LARGE_FILE| \
+ EXT2_FEATURE_RO_COMPAT_BTREE_DIR)
+#define EXT2_FEATURE_RO_COMPAT_UNSUPPORTED ~EXT2_FEATURE_RO_COMPAT_SUPP
+#define EXT2_FEATURE_INCOMPAT_UNSUPPORTED ~EXT2_FEATURE_INCOMPAT_SUPP
+
+/*
+ * Default values for user and/or group using reserved blocks
+ */
+#define EXT2_DEF_RESUID 0
+#define EXT2_DEF_RESGID 0
+
+/*
+ * Default mount options
+ */
+#define EXT2_DEFM_DEBUG 0x0001
+#define EXT2_DEFM_BSDGROUPS 0x0002
+#define EXT2_DEFM_XATTR_USER 0x0004
+#define EXT2_DEFM_ACL 0x0008
+#define EXT2_DEFM_UID16 0x0010
+ /* Not used by ext2, but reserved for use by ext3 */
+#define EXT3_DEFM_JMODE 0x0060
+#define EXT3_DEFM_JMODE_DATA 0x0020
+#define EXT3_DEFM_JMODE_ORDERED 0x0040
+#define EXT3_DEFM_JMODE_WBACK 0x0060
+
+/*
+ * Structure of a directory entry
+ */
+#define EXT2_NAME_LEN 255
+
+struct ext2_dir_entry {
+ __le32 inode; /* Inode number */
+ __le16 rec_len; /* Directory entry length */
+ __le16 name_len; /* Name length */
+ char name[EXT2_NAME_LEN]; /* File name */
+};
+
+/*
+ * The new version of the directory entry. Since EXT2 structures are
+ * stored in intel byte order, and the name_len field could never be
+ * bigger than 255 chars, it's safe to reclaim the extra byte for the
+ * file_type field.
+ */
+struct ext2_dir_entry_2 {
+ __le32 inode; /* Inode number */
+ __le16 rec_len; /* Directory entry length */
+ __u8 name_len; /* Name length */
+ __u8 file_type;
+ char name[EXT2_NAME_LEN]; /* File name */
+};
+
+/*
+ * Ext2 directory file types. Only the low 3 bits are used. The
+ * other bits are reserved for now.
+ */
+enum {
+ EXT2_FT_UNKNOWN,
+ EXT2_FT_REG_FILE,
+ EXT2_FT_DIR,
+ EXT2_FT_CHRDEV,
+ EXT2_FT_BLKDEV,
+ EXT2_FT_FIFO,
+ EXT2_FT_SOCK,
+ EXT2_FT_SYMLINK,
+ EXT2_FT_MAX
+};
+
+/*
+ * EXT2_DIR_PAD defines the directory entries boundaries
+ *
+ * NOTE: It must be a multiple of 4
+ */
+#define EXT2_DIR_PAD 4
+#define EXT2_DIR_ROUND (EXT2_DIR_PAD - 1)
+#define EXT2_DIR_REC_LEN(name_len) (((name_len) + 8 + EXT2_DIR_ROUND) & \
+ ~EXT2_DIR_ROUND)
+#define EXT2_MAX_REC_LEN ((1<<16)-1)
+
+#endif /* _LINUX_EXT2_FS_H */
diff --git a/sysroot/usr/include/linux/ext3_fs.h b/sysroot/usr/include/linux/ext3_fs.h
new file mode 100644
index 0000000..6193afa
--- /dev/null
+++ b/sysroot/usr/include/linux/ext3_fs.h
@@ -0,0 +1,649 @@
+/*
+ * linux/include/linux/ext3_fs.h
+ *
+ * Copyright (C) 1992, 1993, 1994, 1995
+ * Remy Card (card@masi.ibp.fr)
+ * Laboratoire MASI - Institut Blaise Pascal
+ * Universite Pierre et Marie Curie (Paris VI)
+ *
+ * from
+ *
+ * linux/include/linux/minix_fs.h
+ *
+ * Copyright (C) 1991, 1992 Linus Torvalds
+ */
+
+#ifndef _LINUX_EXT3_FS_H
+#define _LINUX_EXT3_FS_H
+
+#include <linux/types.h>
+#include <linux/magic.h>
+
+/*
+ * The second extended filesystem constants/structures
+ */
+
+/*
+ * Define EXT3FS_DEBUG to produce debug messages
+ */
+#undef EXT3FS_DEBUG
+
+/*
+ * Define EXT3_RESERVATION to reserve data blocks for expanding files
+ */
+#define EXT3_DEFAULT_RESERVE_BLOCKS 8
+/*max window size: 1024(direct blocks) + 3([t,d]indirect blocks) */
+#define EXT3_MAX_RESERVE_BLOCKS 1027
+#define EXT3_RESERVE_WINDOW_NOT_ALLOCATED 0
+
+/*
+ * Debug code
+ */
+#ifdef EXT3FS_DEBUG
+#define ext3_debug(f, a...) \
+ do { \
+ printk (KERN_DEBUG "EXT3-fs DEBUG (%s, %d): %s:", \
+ __FILE__, __LINE__, __FUNCTION__); \
+ printk (KERN_DEBUG f, ## a); \
+ } while (0)
+#else
+#define ext3_debug(f, a...) do {} while (0)
+#endif
+
+/*
+ * Special inodes numbers
+ */
+#define EXT3_BAD_INO 1 /* Bad blocks inode */
+#define EXT3_ROOT_INO 2 /* Root inode */
+#define EXT3_BOOT_LOADER_INO 5 /* Boot loader inode */
+#define EXT3_UNDEL_DIR_INO 6 /* Undelete directory inode */
+#define EXT3_RESIZE_INO 7 /* Reserved group descriptors inode */
+#define EXT3_JOURNAL_INO 8 /* Journal inode */
+
+/* First non-reserved inode for old ext3 filesystems */
+#define EXT3_GOOD_OLD_FIRST_INO 11
+
+/*
+ * Maximal count of links to a file
+ */
+#define EXT3_LINK_MAX 32000
+
+/*
+ * Macro-instructions used to manage several block sizes
+ */
+#define EXT3_MIN_BLOCK_SIZE 1024
+#define EXT3_MAX_BLOCK_SIZE 65536
+#define EXT3_MIN_BLOCK_LOG_SIZE 10
+# define EXT3_BLOCK_SIZE(s) (EXT3_MIN_BLOCK_SIZE << (s)->s_log_block_size)
+#define EXT3_ADDR_PER_BLOCK(s) (EXT3_BLOCK_SIZE(s) / sizeof (__u32))
+# define EXT3_BLOCK_SIZE_BITS(s) ((s)->s_log_block_size + 10)
+#define EXT3_INODE_SIZE(s) (((s)->s_rev_level == EXT3_GOOD_OLD_REV) ? \
+ EXT3_GOOD_OLD_INODE_SIZE : \
+ (s)->s_inode_size)
+#define EXT3_FIRST_INO(s) (((s)->s_rev_level == EXT3_GOOD_OLD_REV) ? \
+ EXT3_GOOD_OLD_FIRST_INO : \
+ (s)->s_first_ino)
+
+/*
+ * Macro-instructions used to manage fragments
+ */
+#define EXT3_MIN_FRAG_SIZE 1024
+#define EXT3_MAX_FRAG_SIZE 4096
+#define EXT3_MIN_FRAG_LOG_SIZE 10
+# define EXT3_FRAG_SIZE(s) (EXT3_MIN_FRAG_SIZE << (s)->s_log_frag_size)
+# define EXT3_FRAGS_PER_BLOCK(s) (EXT3_BLOCK_SIZE(s) / EXT3_FRAG_SIZE(s))
+
+/*
+ * Structure of a blocks group descriptor
+ */
+struct ext3_group_desc
+{
+ __le32 bg_block_bitmap; /* Blocks bitmap block */
+ __le32 bg_inode_bitmap; /* Inodes bitmap block */
+ __le32 bg_inode_table; /* Inodes table block */
+ __le16 bg_free_blocks_count; /* Free blocks count */
+ __le16 bg_free_inodes_count; /* Free inodes count */
+ __le16 bg_used_dirs_count; /* Directories count */
+ __u16 bg_pad;
+ __le32 bg_reserved[3];
+};
+
+/*
+ * Macro-instructions used to manage group descriptors
+ */
+# define EXT3_BLOCKS_PER_GROUP(s) ((s)->s_blocks_per_group)
+# define EXT3_DESC_PER_BLOCK(s) (EXT3_BLOCK_SIZE(s) / sizeof (struct ext3_group_desc))
+# define EXT3_INODES_PER_GROUP(s) ((s)->s_inodes_per_group)
+
+/*
+ * Constants relative to the data blocks
+ */
+#define EXT3_NDIR_BLOCKS 12
+#define EXT3_IND_BLOCK EXT3_NDIR_BLOCKS
+#define EXT3_DIND_BLOCK (EXT3_IND_BLOCK + 1)
+#define EXT3_TIND_BLOCK (EXT3_DIND_BLOCK + 1)
+#define EXT3_N_BLOCKS (EXT3_TIND_BLOCK + 1)
+
+/*
+ * Inode flags
+ */
+#define EXT3_SECRM_FL 0x00000001 /* Secure deletion */
+#define EXT3_UNRM_FL 0x00000002 /* Undelete */
+#define EXT3_COMPR_FL 0x00000004 /* Compress file */
+#define EXT3_SYNC_FL 0x00000008 /* Synchronous updates */
+#define EXT3_IMMUTABLE_FL 0x00000010 /* Immutable file */
+#define EXT3_APPEND_FL 0x00000020 /* writes to file may only append */
+#define EXT3_NODUMP_FL 0x00000040 /* do not dump file */
+#define EXT3_NOATIME_FL 0x00000080 /* do not update atime */
+/* Reserved for compression usage... */
+#define EXT3_DIRTY_FL 0x00000100
+#define EXT3_COMPRBLK_FL 0x00000200 /* One or more compressed clusters */
+#define EXT3_NOCOMPR_FL 0x00000400 /* Don't compress */
+#define EXT3_ECOMPR_FL 0x00000800 /* Compression error */
+/* End compression flags --- maybe not all used */
+#define EXT3_INDEX_FL 0x00001000 /* hash-indexed directory */
+#define EXT3_IMAGIC_FL 0x00002000 /* AFS directory */
+#define EXT3_JOURNAL_DATA_FL 0x00004000 /* file data should be journaled */
+#define EXT3_NOTAIL_FL 0x00008000 /* file tail should not be merged */
+#define EXT3_DIRSYNC_FL 0x00010000 /* dirsync behaviour (directories only) */
+#define EXT3_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/
+#define EXT3_RESERVED_FL 0x80000000 /* reserved for ext3 lib */
+
+#define EXT3_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */
+#define EXT3_FL_USER_MODIFIABLE 0x000380FF /* User modifiable flags */
+
+/*
+ * Inode dynamic state flags
+ */
+#define EXT3_STATE_JDATA 0x00000001 /* journaled data exists */
+#define EXT3_STATE_NEW 0x00000002 /* inode is newly created */
+#define EXT3_STATE_XATTR 0x00000004 /* has in-inode xattrs */
+
+/* Used to pass group descriptor data when online resize is done */
+struct ext3_new_group_input {
+ __u32 group; /* Group number for this data */
+ __u32 block_bitmap; /* Absolute block number of block bitmap */
+ __u32 inode_bitmap; /* Absolute block number of inode bitmap */
+ __u32 inode_table; /* Absolute block number of inode table start */
+ __u32 blocks_count; /* Total number of blocks in this group */
+ __u16 reserved_blocks; /* Number of reserved blocks in this group */
+ __u16 unused;
+};
+
+/* The struct ext3_new_group_input in kernel space, with free_blocks_count */
+struct ext3_new_group_data {
+ __u32 group;
+ __u32 block_bitmap;
+ __u32 inode_bitmap;
+ __u32 inode_table;
+ __u32 blocks_count;
+ __u16 reserved_blocks;
+ __u16 unused;
+ __u32 free_blocks_count;
+};
+
+
+/*
+ * ioctl commands
+ */
+#define EXT3_IOC_GETFLAGS FS_IOC_GETFLAGS
+#define EXT3_IOC_SETFLAGS FS_IOC_SETFLAGS
+#define EXT3_IOC_GETVERSION _IOR('f', 3, long)
+#define EXT3_IOC_SETVERSION _IOW('f', 4, long)
+#define EXT3_IOC_GROUP_EXTEND _IOW('f', 7, unsigned long)
+#define EXT3_IOC_GROUP_ADD _IOW('f', 8,struct ext3_new_group_input)
+#define EXT3_IOC_GETVERSION_OLD FS_IOC_GETVERSION
+#define EXT3_IOC_SETVERSION_OLD FS_IOC_SETVERSION
+#ifdef CONFIG_JBD_DEBUG
+#define EXT3_IOC_WAIT_FOR_READONLY _IOR('f', 99, long)
+#endif
+#define EXT3_IOC_GETRSVSZ _IOR('f', 5, long)
+#define EXT3_IOC_SETRSVSZ _IOW('f', 6, long)
+
+/*
+ * ioctl commands in 32 bit emulation
+ */
+#define EXT3_IOC32_GETFLAGS FS_IOC32_GETFLAGS
+#define EXT3_IOC32_SETFLAGS FS_IOC32_SETFLAGS
+#define EXT3_IOC32_GETVERSION _IOR('f', 3, int)
+#define EXT3_IOC32_SETVERSION _IOW('f', 4, int)
+#define EXT3_IOC32_GETRSVSZ _IOR('f', 5, int)
+#define EXT3_IOC32_SETRSVSZ _IOW('f', 6, int)
+#define EXT3_IOC32_GROUP_EXTEND _IOW('f', 7, unsigned int)
+#ifdef CONFIG_JBD_DEBUG
+#define EXT3_IOC32_WAIT_FOR_READONLY _IOR('f', 99, int)
+#endif
+#define EXT3_IOC32_GETVERSION_OLD FS_IOC32_GETVERSION
+#define EXT3_IOC32_SETVERSION_OLD FS_IOC32_SETVERSION
+
+
+/*
+ * Mount options
+ */
+struct ext3_mount_options {
+ unsigned long s_mount_opt;
+ uid_t s_resuid;
+ gid_t s_resgid;
+ unsigned long s_commit_interval;
+#ifdef CONFIG_QUOTA
+ int s_jquota_fmt;
+ char *s_qf_names[MAXQUOTAS];
+#endif
+};
+
+/*
+ * Structure of an inode on the disk
+ */
+struct ext3_inode {
+ __le16 i_mode; /* File mode */
+ __le16 i_uid; /* Low 16 bits of Owner Uid */
+ __le32 i_size; /* Size in bytes */
+ __le32 i_atime; /* Access time */
+ __le32 i_ctime; /* Creation time */
+ __le32 i_mtime; /* Modification time */
+ __le32 i_dtime; /* Deletion Time */
+ __le16 i_gid; /* Low 16 bits of Group Id */
+ __le16 i_links_count; /* Links count */
+ __le32 i_blocks; /* Blocks count */
+ __le32 i_flags; /* File flags */
+ union {
+ struct {
+ __u32 l_i_reserved1;
+ } linux1;
+ struct {
+ __u32 h_i_translator;
+ } hurd1;
+ struct {
+ __u32 m_i_reserved1;
+ } masix1;
+ } osd1; /* OS dependent 1 */
+ __le32 i_block[EXT3_N_BLOCKS];/* Pointers to blocks */
+ __le32 i_generation; /* File version (for NFS) */
+ __le32 i_file_acl; /* File ACL */
+ __le32 i_dir_acl; /* Directory ACL */
+ __le32 i_faddr; /* Fragment address */
+ union {
+ struct {
+ __u8 l_i_frag; /* Fragment number */
+ __u8 l_i_fsize; /* Fragment size */
+ __u16 i_pad1;
+ __le16 l_i_uid_high; /* these 2 fields */
+ __le16 l_i_gid_high; /* were reserved2[0] */
+ __u32 l_i_reserved2;
+ } linux2;
+ struct {
+ __u8 h_i_frag; /* Fragment number */
+ __u8 h_i_fsize; /* Fragment size */
+ __u16 h_i_mode_high;
+ __u16 h_i_uid_high;
+ __u16 h_i_gid_high;
+ __u32 h_i_author;
+ } hurd2;
+ struct {
+ __u8 m_i_frag; /* Fragment number */
+ __u8 m_i_fsize; /* Fragment size */
+ __u16 m_pad1;
+ __u32 m_i_reserved2[2];
+ } masix2;
+ } osd2; /* OS dependent 2 */
+ __le16 i_extra_isize;
+ __le16 i_pad1;
+};
+
+#define i_size_high i_dir_acl
+
+#if defined(__KERNEL__) || defined(__linux__)
+#define i_reserved1 osd1.linux1.l_i_reserved1
+#define i_frag osd2.linux2.l_i_frag
+#define i_fsize osd2.linux2.l_i_fsize
+#define i_uid_low i_uid
+#define i_gid_low i_gid
+#define i_uid_high osd2.linux2.l_i_uid_high
+#define i_gid_high osd2.linux2.l_i_gid_high
+#define i_reserved2 osd2.linux2.l_i_reserved2
+
+#elif defined(__GNU__)
+
+#define i_translator osd1.hurd1.h_i_translator
+#define i_frag osd2.hurd2.h_i_frag;
+#define i_fsize osd2.hurd2.h_i_fsize;
+#define i_uid_high osd2.hurd2.h_i_uid_high
+#define i_gid_high osd2.hurd2.h_i_gid_high
+#define i_author osd2.hurd2.h_i_author
+
+#elif defined(__masix__)
+
+#define i_reserved1 osd1.masix1.m_i_reserved1
+#define i_frag osd2.masix2.m_i_frag
+#define i_fsize osd2.masix2.m_i_fsize
+#define i_reserved2 osd2.masix2.m_i_reserved2
+
+#endif /* defined(__KERNEL__) || defined(__linux__) */
+
+/*
+ * File system states
+ */
+#define EXT3_VALID_FS 0x0001 /* Unmounted cleanly */
+#define EXT3_ERROR_FS 0x0002 /* Errors detected */
+#define EXT3_ORPHAN_FS 0x0004 /* Orphans being recovered */
+
+/*
+ * Mount flags
+ */
+#define EXT3_MOUNT_CHECK 0x00001 /* Do mount-time checks */
+#define EXT3_MOUNT_OLDALLOC 0x00002 /* Don't use the new Orlov allocator */
+#define EXT3_MOUNT_GRPID 0x00004 /* Create files with directory's group */
+#define EXT3_MOUNT_DEBUG 0x00008 /* Some debugging messages */
+#define EXT3_MOUNT_ERRORS_CONT 0x00010 /* Continue on errors */
+#define EXT3_MOUNT_ERRORS_RO 0x00020 /* Remount fs ro on errors */
+#define EXT3_MOUNT_ERRORS_PANIC 0x00040 /* Panic on errors */
+#define EXT3_MOUNT_MINIX_DF 0x00080 /* Mimics the Minix statfs */
+#define EXT3_MOUNT_NOLOAD 0x00100 /* Don't use existing journal*/
+#define EXT3_MOUNT_ABORT 0x00200 /* Fatal error detected */
+#define EXT3_MOUNT_DATA_FLAGS 0x00C00 /* Mode for data writes: */
+#define EXT3_MOUNT_JOURNAL_DATA 0x00400 /* Write data to journal */
+#define EXT3_MOUNT_ORDERED_DATA 0x00800 /* Flush data before commit */
+#define EXT3_MOUNT_WRITEBACK_DATA 0x00C00 /* No data ordering */
+#define EXT3_MOUNT_UPDATE_JOURNAL 0x01000 /* Update the journal format */
+#define EXT3_MOUNT_NO_UID32 0x02000 /* Disable 32-bit UIDs */
+#define EXT3_MOUNT_XATTR_USER 0x04000 /* Extended user attributes */
+#define EXT3_MOUNT_POSIX_ACL 0x08000 /* POSIX Access Control Lists */
+#define EXT3_MOUNT_RESERVATION 0x10000 /* Preallocation */
+#define EXT3_MOUNT_BARRIER 0x20000 /* Use block barriers */
+#define EXT3_MOUNT_NOBH 0x40000 /* No bufferheads */
+#define EXT3_MOUNT_QUOTA 0x80000 /* Some quota option set */
+#define EXT3_MOUNT_USRQUOTA 0x100000 /* "old" user quota */
+#define EXT3_MOUNT_GRPQUOTA 0x200000 /* "old" group quota */
+
+/* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */
+#ifndef _LINUX_EXT2_FS_H
+#define clear_opt(o, opt) o &= ~EXT3_MOUNT_##opt
+#define set_opt(o, opt) o |= EXT3_MOUNT_##opt
+#define test_opt(sb, opt) (EXT3_SB(sb)->s_mount_opt & \
+ EXT3_MOUNT_##opt)
+#else
+#define EXT2_MOUNT_NOLOAD EXT3_MOUNT_NOLOAD
+#define EXT2_MOUNT_ABORT EXT3_MOUNT_ABORT
+#define EXT2_MOUNT_DATA_FLAGS EXT3_MOUNT_DATA_FLAGS
+#endif
+
+#define ext3_set_bit ext2_set_bit
+#define ext3_set_bit_atomic ext2_set_bit_atomic
+#define ext3_clear_bit ext2_clear_bit
+#define ext3_clear_bit_atomic ext2_clear_bit_atomic
+#define ext3_test_bit ext2_test_bit
+#define ext3_find_first_zero_bit ext2_find_first_zero_bit
+#define ext3_find_next_zero_bit ext2_find_next_zero_bit
+
+/*
+ * Maximal mount counts between two filesystem checks
+ */
+#define EXT3_DFL_MAX_MNT_COUNT 20 /* Allow 20 mounts */
+#define EXT3_DFL_CHECKINTERVAL 0 /* Don't use interval check */
+
+/*
+ * Behaviour when detecting errors
+ */
+#define EXT3_ERRORS_CONTINUE 1 /* Continue execution */
+#define EXT3_ERRORS_RO 2 /* Remount fs read-only */
+#define EXT3_ERRORS_PANIC 3 /* Panic */
+#define EXT3_ERRORS_DEFAULT EXT3_ERRORS_CONTINUE
+
+/*
+ * Structure of the super block
+ */
+struct ext3_super_block {
+/*00*/ __le32 s_inodes_count; /* Inodes count */
+ __le32 s_blocks_count; /* Blocks count */
+ __le32 s_r_blocks_count; /* Reserved blocks count */
+ __le32 s_free_blocks_count; /* Free blocks count */
+/*10*/ __le32 s_free_inodes_count; /* Free inodes count */
+ __le32 s_first_data_block; /* First Data Block */
+ __le32 s_log_block_size; /* Block size */
+ __le32 s_log_frag_size; /* Fragment size */
+/*20*/ __le32 s_blocks_per_group; /* # Blocks per group */
+ __le32 s_frags_per_group; /* # Fragments per group */
+ __le32 s_inodes_per_group; /* # Inodes per group */
+ __le32 s_mtime; /* Mount time */
+/*30*/ __le32 s_wtime; /* Write time */
+ __le16 s_mnt_count; /* Mount count */
+ __le16 s_max_mnt_count; /* Maximal mount count */
+ __le16 s_magic; /* Magic signature */
+ __le16 s_state; /* File system state */
+ __le16 s_errors; /* Behaviour when detecting errors */
+ __le16 s_minor_rev_level; /* minor revision level */
+/*40*/ __le32 s_lastcheck; /* time of last check */
+ __le32 s_checkinterval; /* max. time between checks */
+ __le32 s_creator_os; /* OS */
+ __le32 s_rev_level; /* Revision level */
+/*50*/ __le16 s_def_resuid; /* Default uid for reserved blocks */
+ __le16 s_def_resgid; /* Default gid for reserved blocks */
+ /*
+ * These fields are for EXT3_DYNAMIC_REV superblocks only.
+ *
+ * Note: the difference between the compatible feature set and
+ * the incompatible feature set is that if there is a bit set
+ * in the incompatible feature set that the kernel doesn't
+ * know about, it should refuse to mount the filesystem.
+ *
+ * e2fsck's requirements are more strict; if it doesn't know
+ * about a feature in either the compatible or incompatible
+ * feature set, it must abort and not try to meddle with
+ * things it doesn't understand...
+ */
+ __le32 s_first_ino; /* First non-reserved inode */
+ __le16 s_inode_size; /* size of inode structure */
+ __le16 s_block_group_nr; /* block group # of this superblock */
+ __le32 s_feature_compat; /* compatible feature set */
+/*60*/ __le32 s_feature_incompat; /* incompatible feature set */
+ __le32 s_feature_ro_compat; /* readonly-compatible feature set */
+/*68*/ __u8 s_uuid[16]; /* 128-bit uuid for volume */
+/*78*/ char s_volume_name[16]; /* volume name */
+/*88*/ char s_last_mounted[64]; /* directory where last mounted */
+/*C8*/ __le32 s_algorithm_usage_bitmap; /* For compression */
+ /*
+ * Performance hints. Directory preallocation should only
+ * happen if the EXT3_FEATURE_COMPAT_DIR_PREALLOC flag is on.
+ */
+ __u8 s_prealloc_blocks; /* Nr of blocks to try to preallocate*/
+ __u8 s_prealloc_dir_blocks; /* Nr to preallocate for dirs */
+ __le16 s_reserved_gdt_blocks; /* Per group desc for online growth */
+ /*
+ * Journaling support valid if EXT3_FEATURE_COMPAT_HAS_JOURNAL set.
+ */
+/*D0*/ __u8 s_journal_uuid[16]; /* uuid of journal superblock */
+/*E0*/ __le32 s_journal_inum; /* inode number of journal file */
+ __le32 s_journal_dev; /* device number of journal file */
+ __le32 s_last_orphan; /* start of list of inodes to delete */
+ __le32 s_hash_seed[4]; /* HTREE hash seed */
+ __u8 s_def_hash_version; /* Default hash version to use */
+ __u8 s_reserved_char_pad;
+ __u16 s_reserved_word_pad;
+ __le32 s_default_mount_opts;
+ __le32 s_first_meta_bg; /* First metablock block group */
+ __u32 s_reserved[190]; /* Padding to the end of the block */
+};
+
+/* Assume that user mode programs are passing in an ext3fs superblock, not
+ * a kernel struct super_block. This will allow us to call the feature-test
+ * macros from user land. */
+#define EXT3_SB(sb) (sb)
+
+#define NEXT_ORPHAN(inode) EXT3_I(inode)->i_dtime
+
+/*
+ * Codes for operating systems
+ */
+#define EXT3_OS_LINUX 0
+#define EXT3_OS_HURD 1
+#define EXT3_OS_MASIX 2
+#define EXT3_OS_FREEBSD 3
+#define EXT3_OS_LITES 4
+
+/*
+ * Revision levels
+ */
+#define EXT3_GOOD_OLD_REV 0 /* The good old (original) format */
+#define EXT3_DYNAMIC_REV 1 /* V2 format w/ dynamic inode sizes */
+
+#define EXT3_CURRENT_REV EXT3_GOOD_OLD_REV
+#define EXT3_MAX_SUPP_REV EXT3_DYNAMIC_REV
+
+#define EXT3_GOOD_OLD_INODE_SIZE 128
+
+/*
+ * Feature set definitions
+ */
+
+#define EXT3_HAS_COMPAT_FEATURE(sb,mask) \
+ ( EXT3_SB(sb)->s_es->s_feature_compat & cpu_to_le32(mask) )
+#define EXT3_HAS_RO_COMPAT_FEATURE(sb,mask) \
+ ( EXT3_SB(sb)->s_es->s_feature_ro_compat & cpu_to_le32(mask) )
+#define EXT3_HAS_INCOMPAT_FEATURE(sb,mask) \
+ ( EXT3_SB(sb)->s_es->s_feature_incompat & cpu_to_le32(mask) )
+#define EXT3_SET_COMPAT_FEATURE(sb,mask) \
+ EXT3_SB(sb)->s_es->s_feature_compat |= cpu_to_le32(mask)
+#define EXT3_SET_RO_COMPAT_FEATURE(sb,mask) \
+ EXT3_SB(sb)->s_es->s_feature_ro_compat |= cpu_to_le32(mask)
+#define EXT3_SET_INCOMPAT_FEATURE(sb,mask) \
+ EXT3_SB(sb)->s_es->s_feature_incompat |= cpu_to_le32(mask)
+#define EXT3_CLEAR_COMPAT_FEATURE(sb,mask) \
+ EXT3_SB(sb)->s_es->s_feature_compat &= ~cpu_to_le32(mask)
+#define EXT3_CLEAR_RO_COMPAT_FEATURE(sb,mask) \
+ EXT3_SB(sb)->s_es->s_feature_ro_compat &= ~cpu_to_le32(mask)
+#define EXT3_CLEAR_INCOMPAT_FEATURE(sb,mask) \
+ EXT3_SB(sb)->s_es->s_feature_incompat &= ~cpu_to_le32(mask)
+
+#define EXT3_FEATURE_COMPAT_DIR_PREALLOC 0x0001
+#define EXT3_FEATURE_COMPAT_IMAGIC_INODES 0x0002
+#define EXT3_FEATURE_COMPAT_HAS_JOURNAL 0x0004
+#define EXT3_FEATURE_COMPAT_EXT_ATTR 0x0008
+#define EXT3_FEATURE_COMPAT_RESIZE_INODE 0x0010
+#define EXT3_FEATURE_COMPAT_DIR_INDEX 0x0020
+
+#define EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001
+#define EXT3_FEATURE_RO_COMPAT_LARGE_FILE 0x0002
+#define EXT3_FEATURE_RO_COMPAT_BTREE_DIR 0x0004
+
+#define EXT3_FEATURE_INCOMPAT_COMPRESSION 0x0001
+#define EXT3_FEATURE_INCOMPAT_FILETYPE 0x0002
+#define EXT3_FEATURE_INCOMPAT_RECOVER 0x0004 /* Needs recovery */
+#define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV 0x0008 /* Journal device */
+#define EXT3_FEATURE_INCOMPAT_META_BG 0x0010
+
+#define EXT3_FEATURE_COMPAT_SUPP EXT2_FEATURE_COMPAT_EXT_ATTR
+#define EXT3_FEATURE_INCOMPAT_SUPP (EXT3_FEATURE_INCOMPAT_FILETYPE| \
+ EXT3_FEATURE_INCOMPAT_RECOVER| \
+ EXT3_FEATURE_INCOMPAT_META_BG)
+#define EXT3_FEATURE_RO_COMPAT_SUPP (EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER| \
+ EXT3_FEATURE_RO_COMPAT_LARGE_FILE| \
+ EXT3_FEATURE_RO_COMPAT_BTREE_DIR)
+
+/*
+ * Default values for user and/or group using reserved blocks
+ */
+#define EXT3_DEF_RESUID 0
+#define EXT3_DEF_RESGID 0
+
+/*
+ * Default mount options
+ */
+#define EXT3_DEFM_DEBUG 0x0001
+#define EXT3_DEFM_BSDGROUPS 0x0002
+#define EXT3_DEFM_XATTR_USER 0x0004
+#define EXT3_DEFM_ACL 0x0008
+#define EXT3_DEFM_UID16 0x0010
+#define EXT3_DEFM_JMODE 0x0060
+#define EXT3_DEFM_JMODE_DATA 0x0020
+#define EXT3_DEFM_JMODE_ORDERED 0x0040
+#define EXT3_DEFM_JMODE_WBACK 0x0060
+
+/*
+ * Structure of a directory entry
+ */
+#define EXT3_NAME_LEN 255
+
+struct ext3_dir_entry {
+ __le32 inode; /* Inode number */
+ __le16 rec_len; /* Directory entry length */
+ __le16 name_len; /* Name length */
+ char name[EXT3_NAME_LEN]; /* File name */
+};
+
+/*
+ * The new version of the directory entry. Since EXT3 structures are
+ * stored in intel byte order, and the name_len field could never be
+ * bigger than 255 chars, it's safe to reclaim the extra byte for the
+ * file_type field.
+ */
+struct ext3_dir_entry_2 {
+ __le32 inode; /* Inode number */
+ __le16 rec_len; /* Directory entry length */
+ __u8 name_len; /* Name length */
+ __u8 file_type;
+ char name[EXT3_NAME_LEN]; /* File name */
+};
+
+/*
+ * Ext3 directory file types. Only the low 3 bits are used. The
+ * other bits are reserved for now.
+ */
+#define EXT3_FT_UNKNOWN 0
+#define EXT3_FT_REG_FILE 1
+#define EXT3_FT_DIR 2
+#define EXT3_FT_CHRDEV 3
+#define EXT3_FT_BLKDEV 4
+#define EXT3_FT_FIFO 5
+#define EXT3_FT_SOCK 6
+#define EXT3_FT_SYMLINK 7
+
+#define EXT3_FT_MAX 8
+
+/*
+ * EXT3_DIR_PAD defines the directory entries boundaries
+ *
+ * NOTE: It must be a multiple of 4
+ */
+#define EXT3_DIR_PAD 4
+#define EXT3_DIR_ROUND (EXT3_DIR_PAD - 1)
+#define EXT3_DIR_REC_LEN(name_len) (((name_len) + 8 + EXT3_DIR_ROUND) & \
+ ~EXT3_DIR_ROUND)
+#define EXT3_MAX_REC_LEN ((1<<16)-1)
+
+static __inline__ unsigned ext3_rec_len_from_disk(__le16 dlen)
+{
+ unsigned len = le16_to_cpu(dlen);
+
+ if (len == EXT3_MAX_REC_LEN)
+ return 1 << 16;
+ return len;
+}
+
+static __inline__ __le16 ext3_rec_len_to_disk(unsigned len)
+{
+ if (len == (1 << 16))
+ return cpu_to_le16(EXT3_MAX_REC_LEN);
+ else if (len > (1 << 16))
+ BUG();
+ return cpu_to_le16(len);
+}
+
+/*
+ * Hash Tree Directory indexing
+ * (c) Daniel Phillips, 2001
+ */
+
+#define is_dx(dir) (EXT3_HAS_COMPAT_FEATURE(dir->i_sb, \
+ EXT3_FEATURE_COMPAT_DIR_INDEX) && \
+ (EXT3_I(dir)->i_flags & EXT3_INDEX_FL))
+#define EXT3_DIR_LINK_MAX(dir) (!is_dx(dir) && (dir)->i_nlink >= EXT3_LINK_MAX)
+#define EXT3_DIR_LINK_EMPTY(dir) ((dir)->i_nlink == 2 || (dir)->i_nlink == 1)
+
+/* Legal values for the dx_root hash_version field: */
+
+#define DX_HASH_LEGACY 0
+#define DX_HASH_HALF_MD4 1
+#define DX_HASH_TEA 2
+
+
+#endif /* _LINUX_EXT3_FS_H */
diff --git a/sysroot/usr/include/linux/fadvise.h b/sysroot/usr/include/linux/fadvise.h
new file mode 100644
index 0000000..e8e7471
--- /dev/null
+++ b/sysroot/usr/include/linux/fadvise.h
@@ -0,0 +1,21 @@
+#ifndef FADVISE_H_INCLUDED
+#define FADVISE_H_INCLUDED
+
+#define POSIX_FADV_NORMAL 0 /* No further special treatment. */
+#define POSIX_FADV_RANDOM 1 /* Expect random page references. */
+#define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */
+#define POSIX_FADV_WILLNEED 3 /* Will need these pages. */
+
+/*
+ * The advise values for POSIX_FADV_DONTNEED and POSIX_ADV_NOREUSE
+ * for s390-64 differ from the values for the rest of the world.
+ */
+#if defined(__s390x__)
+#define POSIX_FADV_DONTNEED 6 /* Don't need these pages. */
+#define POSIX_FADV_NOREUSE 7 /* Data will be accessed once. */
+#else
+#define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */
+#define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
+#endif
+
+#endif /* FADVISE_H_INCLUDED */
diff --git a/sysroot/usr/include/linux/fb.h b/sysroot/usr/include/linux/fb.h
new file mode 100644
index 0000000..008df13
--- /dev/null
+++ b/sysroot/usr/include/linux/fb.h
@@ -0,0 +1,385 @@
+#ifndef _LINUX_FB_H
+#define _LINUX_FB_H
+
+#include <asm/types.h>
+#include <linux/i2c.h>
+
+struct dentry;
+
+/* Definitions of frame buffers */
+
+#define FB_MAJOR 29
+#define FB_MAX 32 /* sufficient for now */
+
+/* ioctls
+ 0x46 is 'F' */
+#define FBIOGET_VSCREENINFO 0x4600
+#define FBIOPUT_VSCREENINFO 0x4601
+#define FBIOGET_FSCREENINFO 0x4602
+#define FBIOGETCMAP 0x4604
+#define FBIOPUTCMAP 0x4605
+#define FBIOPAN_DISPLAY 0x4606
+#define FBIO_CURSOR _IOWR('F', 0x08, struct fb_cursor)
+/* 0x4607-0x460B are defined below */
+/* #define FBIOGET_MONITORSPEC 0x460C */
+/* #define FBIOPUT_MONITORSPEC 0x460D */
+/* #define FBIOSWITCH_MONIBIT 0x460E */
+#define FBIOGET_CON2FBMAP 0x460F
+#define FBIOPUT_CON2FBMAP 0x4610
+#define FBIOBLANK 0x4611 /* arg: 0 or vesa level + 1 */
+#define FBIOGET_VBLANK _IOR('F', 0x12, struct fb_vblank)
+#define FBIO_ALLOC 0x4613
+#define FBIO_FREE 0x4614
+#define FBIOGET_GLYPH 0x4615
+#define FBIOGET_HWCINFO 0x4616
+#define FBIOPUT_MODEINFO 0x4617
+#define FBIOGET_DISPINFO 0x4618
+
+
+#define FB_TYPE_PACKED_PIXELS 0 /* Packed Pixels */
+#define FB_TYPE_PLANES 1 /* Non interleaved planes */
+#define FB_TYPE_INTERLEAVED_PLANES 2 /* Interleaved planes */
+#define FB_TYPE_TEXT 3 /* Text/attributes */
+#define FB_TYPE_VGA_PLANES 4 /* EGA/VGA planes */
+
+#define FB_AUX_TEXT_MDA 0 /* Monochrome text */
+#define FB_AUX_TEXT_CGA 1 /* CGA/EGA/VGA Color text */
+#define FB_AUX_TEXT_S3_MMIO 2 /* S3 MMIO fasttext */
+#define FB_AUX_TEXT_MGA_STEP16 3 /* MGA Millenium I: text, attr, 14 reserved bytes */
+#define FB_AUX_TEXT_MGA_STEP8 4 /* other MGAs: text, attr, 6 reserved bytes */
+#define FB_AUX_TEXT_SVGA_GROUP 8 /* 8-15: SVGA tileblit compatible modes */
+#define FB_AUX_TEXT_SVGA_MASK 7 /* lower three bits says step */
+#define FB_AUX_TEXT_SVGA_STEP2 8 /* SVGA text mode: text, attr */
+#define FB_AUX_TEXT_SVGA_STEP4 9 /* SVGA text mode: text, attr, 2 reserved bytes */
+#define FB_AUX_TEXT_SVGA_STEP8 10 /* SVGA text mode: text, attr, 6 reserved bytes */
+#define FB_AUX_TEXT_SVGA_STEP16 11 /* SVGA text mode: text, attr, 14 reserved bytes */
+#define FB_AUX_TEXT_SVGA_LAST 15 /* reserved up to 15 */
+
+#define FB_AUX_VGA_PLANES_VGA4 0 /* 16 color planes (EGA/VGA) */
+#define FB_AUX_VGA_PLANES_CFB4 1 /* CFB4 in planes (VGA) */
+#define FB_AUX_VGA_PLANES_CFB8 2 /* CFB8 in planes (VGA) */
+
+#define FB_VISUAL_MONO01 0 /* Monochr. 1=Black 0=White */
+#define FB_VISUAL_MONO10 1 /* Monochr. 1=White 0=Black */
+#define FB_VISUAL_TRUECOLOR 2 /* True color */
+#define FB_VISUAL_PSEUDOCOLOR 3 /* Pseudo color (like atari) */
+#define FB_VISUAL_DIRECTCOLOR 4 /* Direct color */
+#define FB_VISUAL_STATIC_PSEUDOCOLOR 5 /* Pseudo color readonly */
+
+#define FB_ACCEL_NONE 0 /* no hardware accelerator */
+#define FB_ACCEL_ATARIBLITT 1 /* Atari Blitter */
+#define FB_ACCEL_AMIGABLITT 2 /* Amiga Blitter */
+#define FB_ACCEL_S3_TRIO64 3 /* Cybervision64 (S3 Trio64) */
+#define FB_ACCEL_NCR_77C32BLT 4 /* RetinaZ3 (NCR 77C32BLT) */
+#define FB_ACCEL_S3_VIRGE 5 /* Cybervision64/3D (S3 ViRGE) */
+#define FB_ACCEL_ATI_MACH64GX 6 /* ATI Mach 64GX family */
+#define FB_ACCEL_DEC_TGA 7 /* DEC 21030 TGA */
+#define FB_ACCEL_ATI_MACH64CT 8 /* ATI Mach 64CT family */
+#define FB_ACCEL_ATI_MACH64VT 9 /* ATI Mach 64CT family VT class */
+#define FB_ACCEL_ATI_MACH64GT 10 /* ATI Mach 64CT family GT class */
+#define FB_ACCEL_SUN_CREATOR 11 /* Sun Creator/Creator3D */
+#define FB_ACCEL_SUN_CGSIX 12 /* Sun cg6 */
+#define FB_ACCEL_SUN_LEO 13 /* Sun leo/zx */
+#define FB_ACCEL_IMS_TWINTURBO 14 /* IMS Twin Turbo */
+#define FB_ACCEL_3DLABS_PERMEDIA2 15 /* 3Dlabs Permedia 2 */
+#define FB_ACCEL_MATROX_MGA2064W 16 /* Matrox MGA2064W (Millenium) */
+#define FB_ACCEL_MATROX_MGA1064SG 17 /* Matrox MGA1064SG (Mystique) */
+#define FB_ACCEL_MATROX_MGA2164W 18 /* Matrox MGA2164W (Millenium II) */
+#define FB_ACCEL_MATROX_MGA2164W_AGP 19 /* Matrox MGA2164W (Millenium II) */
+#define FB_ACCEL_MATROX_MGAG100 20 /* Matrox G100 (Productiva G100) */
+#define FB_ACCEL_MATROX_MGAG200 21 /* Matrox G200 (Myst, Mill, ...) */
+#define FB_ACCEL_SUN_CG14 22 /* Sun cgfourteen */
+#define FB_ACCEL_SUN_BWTWO 23 /* Sun bwtwo */
+#define FB_ACCEL_SUN_CGTHREE 24 /* Sun cgthree */
+#define FB_ACCEL_SUN_TCX 25 /* Sun tcx */
+#define FB_ACCEL_MATROX_MGAG400 26 /* Matrox G400 */
+#define FB_ACCEL_NV3 27 /* nVidia RIVA 128 */
+#define FB_ACCEL_NV4 28 /* nVidia RIVA TNT */
+#define FB_ACCEL_NV5 29 /* nVidia RIVA TNT2 */
+#define FB_ACCEL_CT_6555x 30 /* C&T 6555x */
+#define FB_ACCEL_3DFX_BANSHEE 31 /* 3Dfx Banshee */
+#define FB_ACCEL_ATI_RAGE128 32 /* ATI Rage128 family */
+#define FB_ACCEL_IGS_CYBER2000 33 /* CyberPro 2000 */
+#define FB_ACCEL_IGS_CYBER2010 34 /* CyberPro 2010 */
+#define FB_ACCEL_IGS_CYBER5000 35 /* CyberPro 5000 */
+#define FB_ACCEL_SIS_GLAMOUR 36 /* SiS 300/630/540 */
+#define FB_ACCEL_3DLABS_PERMEDIA3 37 /* 3Dlabs Permedia 3 */
+#define FB_ACCEL_ATI_RADEON 38 /* ATI Radeon family */
+#define FB_ACCEL_I810 39 /* Intel 810/815 */
+#define FB_ACCEL_SIS_GLAMOUR_2 40 /* SiS 315, 650, 740 */
+#define FB_ACCEL_SIS_XABRE 41 /* SiS 330 ("Xabre") */
+#define FB_ACCEL_I830 42 /* Intel 830M/845G/85x/865G */
+#define FB_ACCEL_NV_10 43 /* nVidia Arch 10 */
+#define FB_ACCEL_NV_20 44 /* nVidia Arch 20 */
+#define FB_ACCEL_NV_30 45 /* nVidia Arch 30 */
+#define FB_ACCEL_NV_40 46 /* nVidia Arch 40 */
+#define FB_ACCEL_XGI_VOLARI_V 47 /* XGI Volari V3XT, V5, V8 */
+#define FB_ACCEL_XGI_VOLARI_Z 48 /* XGI Volari Z7 */
+#define FB_ACCEL_OMAP1610 49 /* TI OMAP16xx */
+#define FB_ACCEL_NEOMAGIC_NM2070 90 /* NeoMagic NM2070 */
+#define FB_ACCEL_NEOMAGIC_NM2090 91 /* NeoMagic NM2090 */
+#define FB_ACCEL_NEOMAGIC_NM2093 92 /* NeoMagic NM2093 */
+#define FB_ACCEL_NEOMAGIC_NM2097 93 /* NeoMagic NM2097 */
+#define FB_ACCEL_NEOMAGIC_NM2160 94 /* NeoMagic NM2160 */
+#define FB_ACCEL_NEOMAGIC_NM2200 95 /* NeoMagic NM2200 */
+#define FB_ACCEL_NEOMAGIC_NM2230 96 /* NeoMagic NM2230 */
+#define FB_ACCEL_NEOMAGIC_NM2360 97 /* NeoMagic NM2360 */
+#define FB_ACCEL_NEOMAGIC_NM2380 98 /* NeoMagic NM2380 */
+
+#define FB_ACCEL_SAVAGE4 0x80 /* S3 Savage4 */
+#define FB_ACCEL_SAVAGE3D 0x81 /* S3 Savage3D */
+#define FB_ACCEL_SAVAGE3D_MV 0x82 /* S3 Savage3D-MV */
+#define FB_ACCEL_SAVAGE2000 0x83 /* S3 Savage2000 */
+#define FB_ACCEL_SAVAGE_MX_MV 0x84 /* S3 Savage/MX-MV */
+#define FB_ACCEL_SAVAGE_MX 0x85 /* S3 Savage/MX */
+#define FB_ACCEL_SAVAGE_IX_MV 0x86 /* S3 Savage/IX-MV */
+#define FB_ACCEL_SAVAGE_IX 0x87 /* S3 Savage/IX */
+#define FB_ACCEL_PROSAVAGE_PM 0x88 /* S3 ProSavage PM133 */
+#define FB_ACCEL_PROSAVAGE_KM 0x89 /* S3 ProSavage KM133 */
+#define FB_ACCEL_S3TWISTER_P 0x8a /* S3 Twister */
+#define FB_ACCEL_S3TWISTER_K 0x8b /* S3 TwisterK */
+#define FB_ACCEL_SUPERSAVAGE 0x8c /* S3 Supersavage */
+#define FB_ACCEL_PROSAVAGE_DDR 0x8d /* S3 ProSavage DDR */
+#define FB_ACCEL_PROSAVAGE_DDRK 0x8e /* S3 ProSavage DDR-K */
+
+struct fb_fix_screeninfo {
+ char id[16]; /* identification string eg "TT Builtin" */
+ unsigned long smem_start; /* Start of frame buffer mem */
+ /* (physical address) */
+ __u32 smem_len; /* Length of frame buffer mem */
+ __u32 type; /* see FB_TYPE_* */
+ __u32 type_aux; /* Interleave for interleaved Planes */
+ __u32 visual; /* see FB_VISUAL_* */
+ __u16 xpanstep; /* zero if no hardware panning */
+ __u16 ypanstep; /* zero if no hardware panning */
+ __u16 ywrapstep; /* zero if no hardware ywrap */
+ __u32 line_length; /* length of a line in bytes */
+ unsigned long mmio_start; /* Start of Memory Mapped I/O */
+ /* (physical address) */
+ __u32 mmio_len; /* Length of Memory Mapped I/O */
+ __u32 accel; /* Indicate to driver which */
+ /* specific chip/card we have */
+ __u16 reserved[3]; /* Reserved for future compatibility */
+};
+
+/* Interpretation of offset for color fields: All offsets are from the right,
+ * inside a "pixel" value, which is exactly 'bits_per_pixel' wide (means: you
+ * can use the offset as right argument to <<). A pixel afterwards is a bit
+ * stream and is written to video memory as that unmodified. This implies
+ * big-endian byte order if bits_per_pixel is greater than 8.
+ */
+struct fb_bitfield {
+ __u32 offset; /* beginning of bitfield */
+ __u32 length; /* length of bitfield */
+ __u32 msb_right; /* != 0 : Most significant bit is */
+ /* right */
+};
+
+#define FB_NONSTD_HAM 1 /* Hold-And-Modify (HAM) */
+#define FB_NONSTD_REV_PIX_IN_B 2 /* order of pixels in each byte is reversed */
+
+#define FB_ACTIVATE_NOW 0 /* set values immediately (or vbl)*/
+#define FB_ACTIVATE_NXTOPEN 1 /* activate on next open */
+#define FB_ACTIVATE_TEST 2 /* don't set, round up impossible */
+#define FB_ACTIVATE_MASK 15
+ /* values */
+#define FB_ACTIVATE_VBL 16 /* activate values on next vbl */
+#define FB_CHANGE_CMAP_VBL 32 /* change colormap on vbl */
+#define FB_ACTIVATE_ALL 64 /* change all VCs on this fb */
+#define FB_ACTIVATE_FORCE 128 /* force apply even when no change*/
+#define FB_ACTIVATE_INV_MODE 256 /* invalidate videomode */
+
+#define FB_ACCELF_TEXT 1 /* (OBSOLETE) see fb_info.flags and vc_mode */
+
+#define FB_SYNC_HOR_HIGH_ACT 1 /* horizontal sync high active */
+#define FB_SYNC_VERT_HIGH_ACT 2 /* vertical sync high active */
+#define FB_SYNC_EXT 4 /* external sync */
+#define FB_SYNC_COMP_HIGH_ACT 8 /* composite sync high active */
+#define FB_SYNC_BROADCAST 16 /* broadcast video timings */
+ /* vtotal = 144d/288n/576i => PAL */
+ /* vtotal = 121d/242n/484i => NTSC */
+#define FB_SYNC_ON_GREEN 32 /* sync on green */
+
+#define FB_VMODE_NONINTERLACED 0 /* non interlaced */
+#define FB_VMODE_INTERLACED 1 /* interlaced */
+#define FB_VMODE_DOUBLE 2 /* double scan */
+#define FB_VMODE_ODD_FLD_FIRST 4 /* interlaced: top line first */
+#define FB_VMODE_MASK 255
+
+#define FB_VMODE_YWRAP 256 /* ywrap instead of panning */
+#define FB_VMODE_SMOOTH_XPAN 512 /* smooth xpan possible (internally used) */
+#define FB_VMODE_CONUPDATE 512 /* don't update x/yoffset */
+
+/*
+ * Display rotation support
+ */
+#define FB_ROTATE_UR 0
+#define FB_ROTATE_CW 1
+#define FB_ROTATE_UD 2
+#define FB_ROTATE_CCW 3
+
+#define PICOS2KHZ(a) (1000000000UL/(a))
+#define KHZ2PICOS(a) (1000000000UL/(a))
+
+struct fb_var_screeninfo {
+ __u32 xres; /* visible resolution */
+ __u32 yres;
+ __u32 xres_virtual; /* virtual resolution */
+ __u32 yres_virtual;
+ __u32 xoffset; /* offset from virtual to visible */
+ __u32 yoffset; /* resolution */
+
+ __u32 bits_per_pixel; /* guess what */
+ __u32 grayscale; /* != 0 Graylevels instead of colors */
+
+ struct fb_bitfield red; /* bitfield in fb mem if true color, */
+ struct fb_bitfield green; /* else only length is significant */
+ struct fb_bitfield blue;
+ struct fb_bitfield transp; /* transparency */
+
+ __u32 nonstd; /* != 0 Non standard pixel format */
+
+ __u32 activate; /* see FB_ACTIVATE_* */
+
+ __u32 height; /* height of picture in mm */
+ __u32 width; /* width of picture in mm */
+
+ __u32 accel_flags; /* (OBSOLETE) see fb_info.flags */
+
+ /* Timing: All values in pixclocks, except pixclock (of course) */
+ __u32 pixclock; /* pixel clock in ps (pico seconds) */
+ __u32 left_margin; /* time from sync to picture */
+ __u32 right_margin; /* time from picture to sync */
+ __u32 upper_margin; /* time from sync to picture */
+ __u32 lower_margin;
+ __u32 hsync_len; /* length of horizontal sync */
+ __u32 vsync_len; /* length of vertical sync */
+ __u32 sync; /* see FB_SYNC_* */
+ __u32 vmode; /* see FB_VMODE_* */
+ __u32 rotate; /* angle we rotate counter clockwise */
+ __u32 reserved[5]; /* Reserved for future compatibility */
+};
+
+struct fb_cmap {
+ __u32 start; /* First entry */
+ __u32 len; /* Number of entries */
+ __u16 *red; /* Red values */
+ __u16 *green;
+ __u16 *blue;
+ __u16 *transp; /* transparency, can be NULL */
+};
+
+struct fb_con2fbmap {
+ __u32 console;
+ __u32 framebuffer;
+};
+
+/* VESA Blanking Levels */
+#define VESA_NO_BLANKING 0
+#define VESA_VSYNC_SUSPEND 1
+#define VESA_HSYNC_SUSPEND 2
+#define VESA_POWERDOWN 3
+
+
+enum {
+ /* screen: unblanked, hsync: on, vsync: on */
+ FB_BLANK_UNBLANK = VESA_NO_BLANKING,
+
+ /* screen: blanked, hsync: on, vsync: on */
+ FB_BLANK_NORMAL = VESA_NO_BLANKING + 1,
+
+ /* screen: blanked, hsync: on, vsync: off */
+ FB_BLANK_VSYNC_SUSPEND = VESA_VSYNC_SUSPEND + 1,
+
+ /* screen: blanked, hsync: off, vsync: on */
+ FB_BLANK_HSYNC_SUSPEND = VESA_HSYNC_SUSPEND + 1,
+
+ /* screen: blanked, hsync: off, vsync: off */
+ FB_BLANK_POWERDOWN = VESA_POWERDOWN + 1
+};
+
+#define FB_VBLANK_VBLANKING 0x001 /* currently in a vertical blank */
+#define FB_VBLANK_HBLANKING 0x002 /* currently in a horizontal blank */
+#define FB_VBLANK_HAVE_VBLANK 0x004 /* vertical blanks can be detected */
+#define FB_VBLANK_HAVE_HBLANK 0x008 /* horizontal blanks can be detected */
+#define FB_VBLANK_HAVE_COUNT 0x010 /* global retrace counter is available */
+#define FB_VBLANK_HAVE_VCOUNT 0x020 /* the vcount field is valid */
+#define FB_VBLANK_HAVE_HCOUNT 0x040 /* the hcount field is valid */
+#define FB_VBLANK_VSYNCING 0x080 /* currently in a vsync */
+#define FB_VBLANK_HAVE_VSYNC 0x100 /* verical syncs can be detected */
+
+struct fb_vblank {
+ __u32 flags; /* FB_VBLANK flags */
+ __u32 count; /* counter of retraces since boot */
+ __u32 vcount; /* current scanline position */
+ __u32 hcount; /* current scandot position */
+ __u32 reserved[4]; /* reserved for future compatibility */
+};
+
+/* Internal HW accel */
+#define ROP_COPY 0
+#define ROP_XOR 1
+
+struct fb_copyarea {
+ __u32 dx;
+ __u32 dy;
+ __u32 width;
+ __u32 height;
+ __u32 sx;
+ __u32 sy;
+};
+
+struct fb_fillrect {
+ __u32 dx; /* screen-relative */
+ __u32 dy;
+ __u32 width;
+ __u32 height;
+ __u32 color;
+ __u32 rop;
+};
+
+struct fb_image {
+ __u32 dx; /* Where to place image */
+ __u32 dy;
+ __u32 width; /* Size of image */
+ __u32 height;
+ __u32 fg_color; /* Only used when a mono bitmap */
+ __u32 bg_color;
+ __u8 depth; /* Depth of the image */
+ const char *data; /* Pointer to image data */
+ struct fb_cmap cmap; /* color map info */
+};
+
+/*
+ * hardware cursor control
+ */
+
+#define FB_CUR_SETIMAGE 0x01
+#define FB_CUR_SETPOS 0x02
+#define FB_CUR_SETHOT 0x04
+#define FB_CUR_SETCMAP 0x08
+#define FB_CUR_SETSHAPE 0x10
+#define FB_CUR_SETSIZE 0x20
+#define FB_CUR_SETALL 0xFF
+
+struct fbcurpos {
+ __u16 x, y;
+};
+
+struct fb_cursor {
+ __u16 set; /* what to set */
+ __u16 enable; /* cursor on/off */
+ __u16 rop; /* bitop operation */
+ const char *mask; /* cursor mask bits */
+ struct fbcurpos hot; /* cursor hot spot */
+ struct fb_image image; /* Cursor image */
+};
+
+#ifdef CONFIG_FB_BACKLIGHT
+/* Settings for the generic backlight code */
+#define FB_BACKLIGHT_LEVELS 128
+#define FB_BACKLIGHT_MAX 0xFF
+#endif
+
+
+#endif /* _LINUX_FB_H */
diff --git a/sysroot/usr/include/linux/fcntl.h b/sysroot/usr/include/linux/fcntl.h
new file mode 100644
index 0000000..a4cd365
--- /dev/null
+++ b/sysroot/usr/include/linux/fcntl.h
@@ -0,0 +1,44 @@
+#ifndef _LINUX_FCNTL_H
+#define _LINUX_FCNTL_H
+
+#include <asm/fcntl.h>
+
+#define F_SETLEASE (F_LINUX_SPECIFIC_BASE + 0)
+#define F_GETLEASE (F_LINUX_SPECIFIC_BASE + 1)
+
+/*
+ * Cancel a blocking posix lock; internal use only until we expose an
+ * asynchronous lock api to userspace:
+ */
+#define F_CANCELLK (F_LINUX_SPECIFIC_BASE + 5)
+
+/* Create a file descriptor with FD_CLOEXEC set. */
+#define F_DUPFD_CLOEXEC (F_LINUX_SPECIFIC_BASE + 6)
+
+/*
+ * Request nofications on a directory.
+ * See below for events that may be notified.
+ */
+#define F_NOTIFY (F_LINUX_SPECIFIC_BASE+2)
+
+/*
+ * Types of directory notifications that may be requested.
+ */
+#define DN_ACCESS 0x00000001 /* File accessed */
+#define DN_MODIFY 0x00000002 /* File modified */
+#define DN_CREATE 0x00000004 /* File created */
+#define DN_DELETE 0x00000008 /* File removed */
+#define DN_RENAME 0x00000010 /* File renamed */
+#define DN_ATTRIB 0x00000020 /* File changed attibutes */
+#define DN_MULTISHOT 0x80000000 /* Don't remove notifier */
+
+#define AT_FDCWD -100 /* Special value used to indicate
+ openat should use the current
+ working directory. */
+#define AT_SYMLINK_NOFOLLOW 0x100 /* Do not follow symbolic links. */
+#define AT_REMOVEDIR 0x200 /* Remove directory instead of
+ unlinking file. */
+#define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */
+
+
+#endif
diff --git a/sysroot/usr/include/linux/fd.h b/sysroot/usr/include/linux/fd.h
new file mode 100644
index 0000000..cbbd0f8
--- /dev/null
+++ b/sysroot/usr/include/linux/fd.h
@@ -0,0 +1,373 @@
+#ifndef _LINUX_FD_H
+#define _LINUX_FD_H
+
+#include <linux/ioctl.h>
+
+/* New file layout: Now the ioctl definitions immediately follow the
+ * definitions of the structures that they use */
+
+/*
+ * Geometry
+ */
+struct floppy_struct {
+ unsigned int size, /* nr of sectors total */
+ sect, /* sectors per track */
+ head, /* nr of heads */
+ track, /* nr of tracks */
+ stretch; /* !=0 means double track steps */
+#define FD_STRETCH 1
+#define FD_SWAPSIDES 2
+#define FD_ZEROBASED 4
+
+ unsigned char gap, /* gap1 size */
+
+ rate, /* data rate. |= 0x40 for perpendicular */
+#define FD_2M 0x4
+#define FD_SIZECODEMASK 0x38
+#define FD_SIZECODE(floppy) (((((floppy)->rate&FD_SIZECODEMASK)>> 3)+ 2) %8)
+#define FD_SECTSIZE(floppy) ( (floppy)->rate & FD_2M ? \
+ 512 : 128 << FD_SIZECODE(floppy) )
+#define FD_PERP 0x40
+
+ spec1, /* stepping rate, head unload time */
+ fmt_gap; /* gap2 size */
+ const char * name; /* used only for predefined formats */
+};
+
+
+/* commands needing write access have 0x40 set */
+/* commands needing super user access have 0x80 set */
+
+#define FDCLRPRM _IO(2, 0x41)
+/* clear user-defined parameters */
+
+#define FDSETPRM _IOW(2, 0x42, struct floppy_struct)
+#define FDSETMEDIAPRM FDSETPRM
+/* set user-defined parameters for current media */
+
+#define FDDEFPRM _IOW(2, 0x43, struct floppy_struct)
+#define FDGETPRM _IOR(2, 0x04, struct floppy_struct)
+#define FDDEFMEDIAPRM FDDEFPRM
+#define FDGETMEDIAPRM FDGETPRM
+/* set/get disk parameters */
+
+
+#define FDMSGON _IO(2,0x45)
+#define FDMSGOFF _IO(2,0x46)
+/* issue/don't issue kernel messages on media type change */
+
+
+/*
+ * Formatting (obsolete)
+ */
+#define FD_FILL_BYTE 0xF6 /* format fill byte. */
+
+struct format_descr {
+ unsigned int device,head,track;
+};
+
+#define FDFMTBEG _IO(2,0x47)
+/* begin formatting a disk */
+#define FDFMTTRK _IOW(2,0x48, struct format_descr)
+/* format the specified track */
+#define FDFMTEND _IO(2,0x49)
+/* end formatting a disk */
+
+
+/*
+ * Error thresholds
+ */
+struct floppy_max_errors {
+ unsigned int
+ abort, /* number of errors to be reached before aborting */
+ read_track, /* maximal number of errors permitted to read an
+ * entire track at once */
+ reset, /* maximal number of errors before a reset is tried */
+ recal, /* maximal number of errors before a recalibrate is
+ * tried */
+
+ /*
+ * Threshold for reporting FDC errors to the console.
+ * Setting this to zero may flood your screen when using
+ * ultra cheap floppies ;-)
+ */
+ reporting;
+
+};
+
+#define FDSETEMSGTRESH _IO(2,0x4a)
+/* set fdc error reporting threshold */
+
+#define FDFLUSH _IO(2,0x4b)
+/* flush buffers for media; either for verifying media, or for
+ * handling a media change without closing the file descriptor */
+
+#define FDSETMAXERRS _IOW(2, 0x4c, struct floppy_max_errors)
+#define FDGETMAXERRS _IOR(2, 0x0e, struct floppy_max_errors)
+/* set/get abortion and read_track threshold. See also floppy_drive_params
+ * structure */
+
+
+typedef char floppy_drive_name[16];
+#define FDGETDRVTYP _IOR(2, 0x0f, floppy_drive_name)
+/* get drive type: 5 1/4 or 3 1/2 */
+
+
+/*
+ * Drive parameters (user modifiable)
+ */
+struct floppy_drive_params {
+ signed char cmos; /* CMOS type */
+
+ /* Spec2 is (HLD<<1 | ND), where HLD is head load time (1=2ms, 2=4 ms
+ * etc) and ND is set means no DMA. Hardcoded to 6 (HLD=6ms, use DMA).
+ */
+ unsigned long max_dtr; /* Step rate, usec */
+ unsigned long hlt; /* Head load/settle time, msec */
+ unsigned long hut; /* Head unload time (remnant of
+ * 8" drives) */
+ unsigned long srt; /* Step rate, usec */
+
+ unsigned long spinup; /* time needed for spinup (expressed
+ * in jiffies) */
+ unsigned long spindown; /* timeout needed for spindown */
+ unsigned char spindown_offset; /* decides in which position the disk
+ * will stop */
+ unsigned char select_delay; /* delay to wait after select */
+ unsigned char rps; /* rotations per second */
+ unsigned char tracks; /* maximum number of tracks */
+ unsigned long timeout; /* timeout for interrupt requests */
+
+ unsigned char interleave_sect; /* if there are more sectors, use
+ * interleave */
+
+ struct floppy_max_errors max_errors;
+
+ char flags; /* various flags, including ftd_msg */
+/*
+ * Announce successful media type detection and media information loss after
+ * disk changes.
+ * Also used to enable/disable printing of overrun warnings.
+ */
+
+#define FTD_MSG 0x10
+#define FD_BROKEN_DCL 0x20
+#define FD_DEBUG 0x02
+#define FD_SILENT_DCL_CLEAR 0x4
+#define FD_INVERTED_DCL 0x80 /* must be 0x80, because of hardware
+ considerations */
+
+ char read_track; /* use readtrack during probing? */
+
+/*
+ * Auto-detection. Each drive type has eight formats which are
+ * used in succession to try to read the disk. If the FDC cannot lock onto
+ * the disk, the next format is tried. This uses the variable 'probing'.
+ */
+ short autodetect[8]; /* autodetected formats */
+
+ int checkfreq; /* how often should the drive be checked for disk
+ * changes */
+ int native_format; /* native format of this drive */
+};
+
+enum {
+ FD_NEED_TWADDLE_BIT, /* more magic */
+ FD_VERIFY_BIT, /* inquire for write protection */
+ FD_DISK_NEWCHANGE_BIT, /* change detected, and no action undertaken yet
+ * to clear media change status */
+ FD_UNUSED_BIT,
+ FD_DISK_CHANGED_BIT, /* disk has been changed since last i/o */
+ FD_DISK_WRITABLE_BIT /* disk is writable */
+};
+
+#define FDSETDRVPRM _IOW(2, 0x90, struct floppy_drive_params)
+#define FDGETDRVPRM _IOR(2, 0x11, struct floppy_drive_params)
+/* set/get drive parameters */
+
+
+/*
+ * Current drive state (not directly modifiable by user, readonly)
+ */
+struct floppy_drive_struct {
+ unsigned long flags;
+/* values for these flags */
+#define FD_NEED_TWADDLE (1 << FD_NEED_TWADDLE_BIT)
+#define FD_VERIFY (1 << FD_VERIFY_BIT)
+#define FD_DISK_NEWCHANGE (1 << FD_DISK_NEWCHANGE_BIT)
+#define FD_DISK_CHANGED (1 << FD_DISK_CHANGED_BIT)
+#define FD_DISK_WRITABLE (1 << FD_DISK_WRITABLE_BIT)
+
+ unsigned long spinup_date;
+ unsigned long select_date;
+ unsigned long first_read_date;
+ short probed_format;
+ short track; /* current track */
+ short maxblock; /* id of highest block read */
+ short maxtrack; /* id of highest half track read */
+ int generation; /* how many diskchanges? */
+
+/*
+ * (User-provided) media information is _not_ discarded after a media change
+ * if the corresponding keep_data flag is non-zero. Positive values are
+ * decremented after each probe.
+ */
+ int keep_data;
+
+ /* Prevent "aliased" accesses. */
+ int fd_ref;
+ int fd_device;
+ unsigned long last_checked; /* when was the drive last checked for a disk
+ * change? */
+
+ char *dmabuf;
+ int bufblocks;
+};
+
+#define FDGETDRVSTAT _IOR(2, 0x12, struct floppy_drive_struct)
+#define FDPOLLDRVSTAT _IOR(2, 0x13, struct floppy_drive_struct)
+/* get drive state: GET returns the cached state, POLL polls for new state */
+
+
+/*
+ * reset FDC
+ */
+enum reset_mode {
+ FD_RESET_IF_NEEDED, /* reset only if the reset flags is set */
+ FD_RESET_IF_RAWCMD, /* obsolete */
+ FD_RESET_ALWAYS /* reset always */
+};
+#define FDRESET _IO(2, 0x54)
+
+
+/*
+ * FDC state
+ */
+struct floppy_fdc_state {
+ int spec1; /* spec1 value last used */
+ int spec2; /* spec2 value last used */
+ int dtr;
+ unsigned char version; /* FDC version code */
+ unsigned char dor;
+ unsigned long address; /* io address */
+ unsigned int rawcmd:2;
+ unsigned int reset:1;
+ unsigned int need_configure:1;
+ unsigned int perp_mode:2;
+ unsigned int has_fifo:1;
+ unsigned int driver_version; /* version code for floppy driver */
+#define FD_DRIVER_VERSION 0x100
+/* user programs using the floppy API should use floppy_fdc_state to
+ * get the version number of the floppy driver that they are running
+ * on. If this version number is bigger than the one compiled into the
+ * user program (the FD_DRIVER_VERSION define), it should be prepared
+ * to bigger structures
+ */
+
+ unsigned char track[4];
+ /* Position of the heads of the 4 units attached to this FDC,
+ * as stored on the FDC. In the future, the position as stored
+ * on the FDC might not agree with the actual physical
+ * position of these drive heads. By allowing such
+ * disagreement, it will be possible to reset the FDC without
+ * incurring the expensive cost of repositioning all heads.
+ * Right now, these positions are hard wired to 0. */
+
+};
+
+#define FDGETFDCSTAT _IOR(2, 0x15, struct floppy_fdc_state)
+
+
+/*
+ * Asynchronous Write error tracking
+ */
+struct floppy_write_errors {
+ /* Write error logging.
+ *
+ * These fields can be cleared with the FDWERRORCLR ioctl.
+ * Only writes that were attempted but failed due to a physical media
+ * error are logged. write(2) calls that fail and return an error code
+ * to the user process are not counted.
+ */
+
+ unsigned int write_errors; /* number of physical write errors
+ * encountered */
+
+ /* position of first and last write errors */
+ unsigned long first_error_sector;
+ int first_error_generation;
+ unsigned long last_error_sector;
+ int last_error_generation;
+
+ unsigned int badness; /* highest retry count for a read or write
+ * operation */
+};
+
+#define FDWERRORCLR _IO(2, 0x56)
+/* clear write error and badness information */
+#define FDWERRORGET _IOR(2, 0x17, struct floppy_write_errors)
+/* get write error and badness information */
+
+
+/*
+ * Raw commands
+ */
+/* new interface flag: now we can do them in batches */
+#define FDHAVEBATCHEDRAWCMD
+
+struct floppy_raw_cmd {
+ unsigned int flags;
+#define FD_RAW_READ 1
+#define FD_RAW_WRITE 2
+#define FD_RAW_NO_MOTOR 4
+#define FD_RAW_DISK_CHANGE 4 /* out: disk change flag was set */
+#define FD_RAW_INTR 8 /* wait for an interrupt */
+#define FD_RAW_SPIN 0x10 /* spin up the disk for this command */
+#define FD_RAW_NO_MOTOR_AFTER 0x20 /* switch the motor off after command
+ * completion */
+#define FD_RAW_NEED_DISK 0x40 /* this command needs a disk to be present */
+#define FD_RAW_NEED_SEEK 0x80 /* this command uses an implied seek (soft) */
+
+/* more "in" flags */
+#define FD_RAW_MORE 0x100 /* more records follow */
+#define FD_RAW_STOP_IF_FAILURE 0x200 /* stop if we encounter a failure */
+#define FD_RAW_STOP_IF_SUCCESS 0x400 /* stop if command successful */
+#define FD_RAW_SOFTFAILURE 0x800 /* consider the return value for failure
+ * detection too */
+
+/* more "out" flags */
+#define FD_RAW_FAILURE 0x10000 /* command sent to fdc, fdc returned error */
+#define FD_RAW_HARDFAILURE 0x20000 /* fdc had to be reset, or timed out */
+
+ void *data;
+ char *kernel_data; /* location of data buffer in the kernel */
+ struct floppy_raw_cmd *next; /* used for chaining of raw cmd's
+ * within the kernel */
+ long length; /* in: length of dma transfer. out: remaining bytes */
+ long phys_length; /* physical length, if different from dma length */
+ int buffer_length; /* length of allocated buffer */
+
+ unsigned char rate;
+ unsigned char cmd_count;
+ unsigned char cmd[16];
+ unsigned char reply_count;
+ unsigned char reply[16];
+ int track;
+ int resultcode;
+
+ int reserved1;
+ int reserved2;
+};
+
+#define FDRAWCMD _IO(2, 0x58)
+/* send a raw command to the fdc. Structure size not included, because of
+ * batches */
+
+#define FDTWADDLE _IO(2, 0x59)
+/* flicker motor-on bit before reading a sector. Experimental */
+
+
+#define FDEJECT _IO(2, 0x5a)
+/* eject the disk */
+
+#endif
diff --git a/sysroot/usr/include/linux/fdreg.h b/sysroot/usr/include/linux/fdreg.h
new file mode 100644
index 0000000..c2eeb63
--- /dev/null
+++ b/sysroot/usr/include/linux/fdreg.h
@@ -0,0 +1,137 @@
+#ifndef _LINUX_FDREG_H
+#define _LINUX_FDREG_H
+/*
+ * This file contains some defines for the floppy disk controller.
+ * Various sources. Mostly "IBM Microcomputers: A Programmers
+ * Handbook", Sanches and Canton.
+ */
+
+#ifdef FDPATCHES
+#define FD_IOPORT fdc_state[fdc].address
+#else
+/* It would be a lot saner just to force fdc_state[fdc].address to always
+ be set ! FIXME */
+#define FD_IOPORT 0x3f0
+#endif
+
+/* Fd controller regs. S&C, about page 340 */
+#define FD_STATUS (4 + FD_IOPORT )
+#define FD_DATA (5 + FD_IOPORT )
+
+/* Digital Output Register */
+#define FD_DOR (2 + FD_IOPORT )
+
+/* Digital Input Register (read) */
+#define FD_DIR (7 + FD_IOPORT )
+
+/* Diskette Control Register (write)*/
+#define FD_DCR (7 + FD_IOPORT )
+
+/* Bits of main status register */
+#define STATUS_BUSYMASK 0x0F /* drive busy mask */
+#define STATUS_BUSY 0x10 /* FDC busy */
+#define STATUS_DMA 0x20 /* 0- DMA mode */
+#define STATUS_DIR 0x40 /* 0- cpu->fdc */
+#define STATUS_READY 0x80 /* Data reg ready */
+
+/* Bits of FD_ST0 */
+#define ST0_DS 0x03 /* drive select mask */
+#define ST0_HA 0x04 /* Head (Address) */
+#define ST0_NR 0x08 /* Not Ready */
+#define ST0_ECE 0x10 /* Equipment check error */
+#define ST0_SE 0x20 /* Seek end */
+#define ST0_INTR 0xC0 /* Interrupt code mask */
+
+/* Bits of FD_ST1 */
+#define ST1_MAM 0x01 /* Missing Address Mark */
+#define ST1_WP 0x02 /* Write Protect */
+#define ST1_ND 0x04 /* No Data - unreadable */
+#define ST1_OR 0x10 /* OverRun */
+#define ST1_CRC 0x20 /* CRC error in data or addr */
+#define ST1_EOC 0x80 /* End Of Cylinder */
+
+/* Bits of FD_ST2 */
+#define ST2_MAM 0x01 /* Missing Address Mark (again) */
+#define ST2_BC 0x02 /* Bad Cylinder */
+#define ST2_SNS 0x04 /* Scan Not Satisfied */
+#define ST2_SEH 0x08 /* Scan Equal Hit */
+#define ST2_WC 0x10 /* Wrong Cylinder */
+#define ST2_CRC 0x20 /* CRC error in data field */
+#define ST2_CM 0x40 /* Control Mark = deleted */
+
+/* Bits of FD_ST3 */
+#define ST3_HA 0x04 /* Head (Address) */
+#define ST3_DS 0x08 /* drive is double-sided */
+#define ST3_TZ 0x10 /* Track Zero signal (1=track 0) */
+#define ST3_RY 0x20 /* drive is ready */
+#define ST3_WP 0x40 /* Write Protect */
+#define ST3_FT 0x80 /* Drive Fault */
+
+/* Values for FD_COMMAND */
+#define FD_RECALIBRATE 0x07 /* move to track 0 */
+#define FD_SEEK 0x0F /* seek track */
+#define FD_READ 0xE6 /* read with MT, MFM, SKip deleted */
+#define FD_WRITE 0xC5 /* write with MT, MFM */
+#define FD_SENSEI 0x08 /* Sense Interrupt Status */
+#define FD_SPECIFY 0x03 /* specify HUT etc */
+#define FD_FORMAT 0x4D /* format one track */
+#define FD_VERSION 0x10 /* get version code */
+#define FD_CONFIGURE 0x13 /* configure FIFO operation */
+#define FD_PERPENDICULAR 0x12 /* perpendicular r/w mode */
+#define FD_GETSTATUS 0x04 /* read ST3 */
+#define FD_DUMPREGS 0x0E /* dump the contents of the fdc regs */
+#define FD_READID 0xEA /* prints the header of a sector */
+#define FD_UNLOCK 0x14 /* Fifo config unlock */
+#define FD_LOCK 0x94 /* Fifo config lock */
+#define FD_RSEEK_OUT 0x8f /* seek out (i.e. to lower tracks) */
+#define FD_RSEEK_IN 0xcf /* seek in (i.e. to higher tracks) */
+
+/* the following commands are new in the 82078. They are not used in the
+ * floppy driver, except the first three. These commands may be useful for apps
+ * which use the FDRAWCMD interface. For doc, get the 82078 spec sheets at
+ * http://www-techdoc.intel.com/docs/periph/fd_contr/datasheets/ */
+
+#define FD_PARTID 0x18 /* part id ("extended" version cmd) */
+#define FD_SAVE 0x2e /* save fdc regs for later restore */
+#define FD_DRIVESPEC 0x8e /* drive specification: Access to the
+ * 2 Mbps data transfer rate for tape
+ * drives */
+
+#define FD_RESTORE 0x4e /* later restore */
+#define FD_POWERDOWN 0x27 /* configure FDC's powersave features */
+#define FD_FORMAT_N_WRITE 0xef /* format and write in one go. */
+#define FD_OPTION 0x33 /* ISO format (which is a clean way to
+ * pack more sectors on a track) */
+
+/* DMA commands */
+#define DMA_READ 0x46
+#define DMA_WRITE 0x4A
+
+/* FDC version return types */
+#define FDC_NONE 0x00
+#define FDC_UNKNOWN 0x10 /* DO NOT USE THIS TYPE EXCEPT IF IDENTIFICATION
+ FAILS EARLY */
+#define FDC_8272A 0x20 /* Intel 8272a, NEC 765 */
+#define FDC_765ED 0x30 /* Non-Intel 1MB-compatible FDC, can't detect */
+#define FDC_82072 0x40 /* Intel 82072; 8272a + FIFO + DUMPREGS */
+#define FDC_82072A 0x45 /* 82072A (on Sparcs) */
+#define FDC_82077_ORIG 0x51 /* Original version of 82077AA, sans LOCK */
+#define FDC_82077 0x52 /* 82077AA-1 */
+#define FDC_82078_UNKN 0x5f /* Unknown 82078 variant */
+#define FDC_82078 0x60 /* 44pin 82078 or 64pin 82078SL */
+#define FDC_82078_1 0x61 /* 82078-1 (2Mbps fdc) */
+#define FDC_S82078B 0x62 /* S82078B (first seen on Adaptec AVA-2825 VLB
+ * SCSI/EIDE/Floppy controller) */
+#define FDC_87306 0x63 /* National Semiconductor PC 87306 */
+
+/*
+ * Beware: the fdc type list is roughly sorted by increasing features.
+ * Presence of features is tested by comparing the FDC version id with the
+ * "oldest" version that has the needed feature.
+ * If during FDC detection, an obscure test fails late in the sequence, don't
+ * assign FDC_UNKNOWN. Else the FDC will be treated as a dumb 8272a, or worse.
+ * This is especially true if the tests are unneeded.
+ */
+
+#define FD_RESET_DELAY 20
+#endif
diff --git a/sysroot/usr/include/linux/fib_rules.h b/sysroot/usr/include/linux/fib_rules.h
new file mode 100644
index 0000000..87b606b
--- /dev/null
+++ b/sysroot/usr/include/linux/fib_rules.h
@@ -0,0 +1,71 @@
+#ifndef __LINUX_FIB_RULES_H
+#define __LINUX_FIB_RULES_H
+
+#include <linux/types.h>
+#include <linux/rtnetlink.h>
+
+/* rule is permanent, and cannot be deleted */
+#define FIB_RULE_PERMANENT 0x00000001
+#define FIB_RULE_INVERT 0x00000002
+#define FIB_RULE_UNRESOLVED 0x00000004
+#define FIB_RULE_DEV_DETACHED 0x00000008
+
+/* try to find source address in routing lookups */
+#define FIB_RULE_FIND_SADDR 0x00010000
+
+struct fib_rule_hdr
+{
+ __u8 family;
+ __u8 dst_len;
+ __u8 src_len;
+ __u8 tos;
+
+ __u8 table;
+ __u8 res1; /* reserved */
+ __u8 res2; /* reserved */
+ __u8 action;
+
+ __u32 flags;
+};
+
+enum
+{
+ FRA_UNSPEC,
+ FRA_DST, /* destination address */
+ FRA_SRC, /* source address */
+ FRA_IFNAME, /* interface name */
+ FRA_GOTO, /* target to jump to (FR_ACT_GOTO) */
+ FRA_UNUSED2,
+ FRA_PRIORITY, /* priority/preference */
+ FRA_UNUSED3,
+ FRA_UNUSED4,
+ FRA_UNUSED5,
+ FRA_FWMARK, /* mark */
+ FRA_FLOW, /* flow/class id */
+ FRA_UNUSED6,
+ FRA_UNUSED7,
+ FRA_UNUSED8,
+ FRA_TABLE, /* Extended table id */
+ FRA_FWMASK, /* mask for netfilter mark */
+ __FRA_MAX
+};
+
+#define FRA_MAX (__FRA_MAX - 1)
+
+enum
+{
+ FR_ACT_UNSPEC,
+ FR_ACT_TO_TBL, /* Pass to fixed table */
+ FR_ACT_GOTO, /* Jump to another rule */
+ FR_ACT_NOP, /* No operation */
+ FR_ACT_RES3,
+ FR_ACT_RES4,
+ FR_ACT_BLACKHOLE, /* Drop without notification */
+ FR_ACT_UNREACHABLE, /* Drop with ENETUNREACH */
+ FR_ACT_PROHIBIT, /* Drop with EACCES */
+ __FR_ACT_MAX,
+};
+
+#define FR_ACT_MAX (__FR_ACT_MAX - 1)
+
+#endif
diff --git a/sysroot/usr/include/linux/filter.h b/sysroot/usr/include/linux/filter.h
new file mode 100644
index 0000000..29360cb
--- /dev/null
+++ b/sysroot/usr/include/linux/filter.h
@@ -0,0 +1,126 @@
+/*
+ * Linux Socket Filter Data Structures
+ */
+
+#ifndef __LINUX_FILTER_H__
+#define __LINUX_FILTER_H__
+
+#include <linux/types.h>
+
+
+/*
+ * Current version of the filter code architecture.
+ */
+#define BPF_MAJOR_VERSION 1
+#define BPF_MINOR_VERSION 1
+
+/*
+ * Try and keep these values and structures similar to BSD, especially
+ * the BPF code definitions which need to match so you can share filters
+ */
+
+struct sock_filter /* Filter block */
+{
+ __u16 code; /* Actual filter code */
+ __u8 jt; /* Jump true */
+ __u8 jf; /* Jump false */
+ __u32 k; /* Generic multiuse field */
+};
+
+struct sock_fprog /* Required for SO_ATTACH_FILTER. */
+{
+ unsigned short len; /* Number of filter blocks */
+ struct sock_filter *filter;
+};
+
+
+/*
+ * Instruction classes
+ */
+
+#define BPF_CLASS(code) ((code) & 0x07)
+#define BPF_LD 0x00
+#define BPF_LDX 0x01
+#define BPF_ST 0x02
+#define BPF_STX 0x03
+#define BPF_ALU 0x04
+#define BPF_JMP 0x05
+#define BPF_RET 0x06
+#define BPF_MISC 0x07
+
+/* ld/ldx fields */
+#define BPF_SIZE(code) ((code) & 0x18)
+#define BPF_W 0x00
+#define BPF_H 0x08
+#define BPF_B 0x10
+#define BPF_MODE(code) ((code) & 0xe0)
+#define BPF_IMM 0x00
+#define BPF_ABS 0x20
+#define BPF_IND 0x40
+#define BPF_MEM 0x60
+#define BPF_LEN 0x80
+#define BPF_MSH 0xa0
+
+/* alu/jmp fields */
+#define BPF_OP(code) ((code) & 0xf0)
+#define BPF_ADD 0x00
+#define BPF_SUB 0x10
+#define BPF_MUL 0x20
+#define BPF_DIV 0x30
+#define BPF_OR 0x40
+#define BPF_AND 0x50
+#define BPF_LSH 0x60
+#define BPF_RSH 0x70
+#define BPF_NEG 0x80
+#define BPF_JA 0x00
+#define BPF_JEQ 0x10
+#define BPF_JGT 0x20
+#define BPF_JGE 0x30
+#define BPF_JSET 0x40
+#define BPF_SRC(code) ((code) & 0x08)
+#define BPF_K 0x00
+#define BPF_X 0x08
+
+/* ret - BPF_K and BPF_X also apply */
+#define BPF_RVAL(code) ((code) & 0x18)
+#define BPF_A 0x10
+
+/* misc */
+#define BPF_MISCOP(code) ((code) & 0xf8)
+#define BPF_TAX 0x00
+#define BPF_TXA 0x80
+
+#ifndef BPF_MAXINSNS
+#define BPF_MAXINSNS 4096
+#endif
+
+/*
+ * Macros for filter block array initializers.
+ */
+#ifndef BPF_STMT
+#define BPF_STMT(code, k) { (unsigned short)(code), 0, 0, k }
+#endif
+#ifndef BPF_JUMP
+#define BPF_JUMP(code, k, jt, jf) { (unsigned short)(code), jt, jf, k }
+#endif
+
+/*
+ * Number of scratch memory words for: BPF_ST and BPF_STX
+ */
+#define BPF_MEMWORDS 16
+
+/* RATIONALE. Negative offsets are invalid in BPF.
+ We use them to reference ancillary data.
+ Unlike introduction new instructions, it does not break
+ existing compilers/optimizers.
+ */
+#define SKF_AD_OFF (-0x1000)
+#define SKF_AD_PROTOCOL 0
+#define SKF_AD_PKTTYPE 4
+#define SKF_AD_IFINDEX 8
+#define SKF_AD_MAX 12
+#define SKF_NET_OFF (-0x100000)
+#define SKF_LL_OFF (-0x200000)
+
+
+#endif /* __LINUX_FILTER_H__ */
diff --git a/sysroot/usr/include/linux/firewire-cdev.h b/sysroot/usr/include/linux/firewire-cdev.h
new file mode 100644
index 0000000..0f0e271
--- /dev/null
+++ b/sysroot/usr/include/linux/firewire-cdev.h
@@ -0,0 +1,477 @@
+/*
+ * Char device interface.
+ *
+ * Copyright (C) 2005-2006 Kristian Hoegsberg <krh@bitplanet.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef _LINUX_FIREWIRE_CDEV_H
+#define _LINUX_FIREWIRE_CDEV_H
+
+#include <linux/ioctl.h>
+#include <linux/types.h>
+#include <linux/firewire-constants.h>
+
+#define FW_CDEV_EVENT_BUS_RESET 0x00
+#define FW_CDEV_EVENT_RESPONSE 0x01
+#define FW_CDEV_EVENT_REQUEST 0x02
+#define FW_CDEV_EVENT_ISO_INTERRUPT 0x03
+
+/**
+ * struct fw_cdev_event_common - Common part of all fw_cdev_event_ types
+ * @closure: For arbitrary use by userspace
+ * @type: Discriminates the fw_cdev_event_ types
+ *
+ * This struct may be used to access generic members of all fw_cdev_event_
+ * types regardless of the specific type.
+ *
+ * Data passed in the @closure field for a request will be returned in the
+ * corresponding event. It is big enough to hold a pointer on all platforms.
+ * The ioctl used to set @closure depends on the @type of event.
+ */
+struct fw_cdev_event_common {
+ __u64 closure;
+ __u32 type;
+};
+
+/**
+ * struct fw_cdev_event_bus_reset - Sent when a bus reset occurred
+ * @closure: See &fw_cdev_event_common; set by %FW_CDEV_IOC_GET_INFO ioctl
+ * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_BUS_RESET
+ * @node_id: New node ID of this node
+ * @local_node_id: Node ID of the local node, i.e. of the controller
+ * @bm_node_id: Node ID of the bus manager
+ * @irm_node_id: Node ID of the iso resource manager
+ * @root_node_id: Node ID of the root node
+ * @generation: New bus generation
+ *
+ * This event is sent when the bus the device belongs to goes through a bus
+ * reset. It provides information about the new bus configuration, such as
+ * new node ID for this device, new root ID, and others.
+ */
+struct fw_cdev_event_bus_reset {
+ __u64 closure;
+ __u32 type;
+ __u32 node_id;
+ __u32 local_node_id;
+ __u32 bm_node_id;
+ __u32 irm_node_id;
+ __u32 root_node_id;
+ __u32 generation;
+};
+
+/**
+ * struct fw_cdev_event_response - Sent when a response packet was received
+ * @closure: See &fw_cdev_event_common;
+ * set by %FW_CDEV_IOC_SEND_REQUEST ioctl
+ * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_RESPONSE
+ * @rcode: Response code returned by the remote node
+ * @length: Data length, i.e. the response's payload size in bytes
+ * @data: Payload data, if any
+ *
+ * This event is sent when the stack receives a response to an outgoing request
+ * sent by %FW_CDEV_IOC_SEND_REQUEST ioctl. The payload data for responses
+ * carrying data (read and lock responses) follows immediately and can be
+ * accessed through the @data field.
+ */
+struct fw_cdev_event_response {
+ __u64 closure;
+ __u32 type;
+ __u32 rcode;
+ __u32 length;
+ __u32 data[0];
+};
+
+/**
+ * struct fw_cdev_event_request - Sent on incoming request to an address region
+ * @closure: See &fw_cdev_event_common; set by %FW_CDEV_IOC_ALLOCATE ioctl
+ * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_REQUEST
+ * @tcode: Transaction code of the incoming request
+ * @offset: The offset into the 48-bit per-node address space
+ * @handle: Reference to the kernel-side pending request
+ * @length: Data length, i.e. the request's payload size in bytes
+ * @data: Incoming data, if any
+ *
+ * This event is sent when the stack receives an incoming request to an address
+ * region registered using the %FW_CDEV_IOC_ALLOCATE ioctl. The request is
+ * guaranteed to be completely contained in the specified region. Userspace is
+ * responsible for sending the response by %FW_CDEV_IOC_SEND_RESPONSE ioctl,
+ * using the same @handle.
+ *
+ * The payload data for requests carrying data (write and lock requests)
+ * follows immediately and can be accessed through the @data field.
+ */
+struct fw_cdev_event_request {
+ __u64 closure;
+ __u32 type;
+ __u32 tcode;
+ __u64 offset;
+ __u32 handle;
+ __u32 length;
+ __u32 data[0];
+};
+
+/**
+ * struct fw_cdev_event_iso_interrupt - Sent when an iso packet was completed
+ * @closure: See &fw_cdev_event_common;
+ * set by %FW_CDEV_CREATE_ISO_CONTEXT ioctl
+ * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_ISO_INTERRUPT
+ * @cycle: Cycle counter of the interrupt packet
+ * @header_length: Total length of following headers, in bytes
+ * @header: Stripped headers, if any
+ *
+ * This event is sent when the controller has completed an &fw_cdev_iso_packet
+ * with the %FW_CDEV_ISO_INTERRUPT bit set. In the receive case, the headers
+ * stripped of all packets up until and including the interrupt packet are
+ * returned in the @header field.
+ */
+struct fw_cdev_event_iso_interrupt {
+ __u64 closure;
+ __u32 type;
+ __u32 cycle;
+ __u32 header_length;
+ __u32 header[0];
+};
+
+/**
+ * union fw_cdev_event - Convenience union of fw_cdev_event_ types
+ * @common: Valid for all types
+ * @bus_reset: Valid if @common.type == %FW_CDEV_EVENT_BUS_RESET
+ * @response: Valid if @common.type == %FW_CDEV_EVENT_RESPONSE
+ * @request: Valid if @common.type == %FW_CDEV_EVENT_REQUEST
+ * @iso_interrupt: Valid if @common.type == %FW_CDEV_EVENT_ISO_INTERRUPT
+ *
+ * Convenience union for userspace use. Events could be read(2) into a char
+ * buffer and then cast to this union for further processing.
+ */
+union fw_cdev_event {
+ struct fw_cdev_event_common common;
+ struct fw_cdev_event_bus_reset bus_reset;
+ struct fw_cdev_event_response response;
+ struct fw_cdev_event_request request;
+ struct fw_cdev_event_iso_interrupt iso_interrupt;
+};
+
+#define FW_CDEV_IOC_GET_INFO _IOWR('#', 0x00, struct fw_cdev_get_info)
+#define FW_CDEV_IOC_SEND_REQUEST _IOW('#', 0x01, struct fw_cdev_send_request)
+#define FW_CDEV_IOC_ALLOCATE _IOWR('#', 0x02, struct fw_cdev_allocate)
+#define FW_CDEV_IOC_DEALLOCATE _IOW('#', 0x03, struct fw_cdev_deallocate)
+#define FW_CDEV_IOC_SEND_RESPONSE _IOW('#', 0x04, struct fw_cdev_send_response)
+#define FW_CDEV_IOC_INITIATE_BUS_RESET _IOW('#', 0x05, struct fw_cdev_initiate_bus_reset)
+#define FW_CDEV_IOC_ADD_DESCRIPTOR _IOWR('#', 0x06, struct fw_cdev_add_descriptor)
+#define FW_CDEV_IOC_REMOVE_DESCRIPTOR _IOW('#', 0x07, struct fw_cdev_remove_descriptor)
+
+#define FW_CDEV_IOC_CREATE_ISO_CONTEXT _IOWR('#', 0x08, struct fw_cdev_create_iso_context)
+#define FW_CDEV_IOC_QUEUE_ISO _IOWR('#', 0x09, struct fw_cdev_queue_iso)
+#define FW_CDEV_IOC_START_ISO _IOW('#', 0x0a, struct fw_cdev_start_iso)
+#define FW_CDEV_IOC_STOP_ISO _IOW('#', 0x0b, struct fw_cdev_stop_iso)
+#define FW_CDEV_IOC_GET_CYCLE_TIMER _IOR('#', 0x0c, struct fw_cdev_get_cycle_timer)
+
+/* FW_CDEV_VERSION History
+ *
+ * 1 Feb 18, 2007: Initial version.
+ */
+#define FW_CDEV_VERSION 1
+
+/**
+ * struct fw_cdev_get_info - General purpose information ioctl
+ * @version: The version field is just a running serial number.
+ * We never break backwards compatibility, but may add more
+ * structs and ioctls in later revisions.
+ * @rom_length: If @rom is non-zero, at most rom_length bytes of configuration
+ * ROM will be copied into that user space address. In either
+ * case, @rom_length is updated with the actual length of the
+ * configuration ROM.
+ * @rom: If non-zero, address of a buffer to be filled by a copy of the
+ * local node's configuration ROM
+ * @bus_reset: If non-zero, address of a buffer to be filled by a
+ * &struct fw_cdev_event_bus_reset with the current state
+ * of the bus. This does not cause a bus reset to happen.
+ * @bus_reset_closure: Value of &closure in this and subsequent bus reset events
+ * @card: The index of the card this device belongs to
+ */
+struct fw_cdev_get_info {
+ __u32 version;
+ __u32 rom_length;
+ __u64 rom;
+ __u64 bus_reset;
+ __u64 bus_reset_closure;
+ __u32 card;
+};
+
+/**
+ * struct fw_cdev_send_request - Send an asynchronous request packet
+ * @tcode: Transaction code of the request
+ * @length: Length of outgoing payload, in bytes
+ * @offset: 48-bit offset at destination node
+ * @closure: Passed back to userspace in the response event
+ * @data: Userspace pointer to payload
+ * @generation: The bus generation where packet is valid
+ *
+ * Send a request to the device. This ioctl implements all outgoing requests.
+ * Both quadlet and block request specify the payload as a pointer to the data
+ * in the @data field. Once the transaction completes, the kernel writes an
+ * &fw_cdev_event_request event back. The @closure field is passed back to
+ * user space in the response event.
+ */
+struct fw_cdev_send_request {
+ __u32 tcode;
+ __u32 length;
+ __u64 offset;
+ __u64 closure;
+ __u64 data;
+ __u32 generation;
+};
+
+/**
+ * struct fw_cdev_send_response - Send an asynchronous response packet
+ * @rcode: Response code as determined by the userspace handler
+ * @length: Length of outgoing payload, in bytes
+ * @data: Userspace pointer to payload
+ * @handle: The handle from the &fw_cdev_event_request
+ *
+ * Send a response to an incoming request. By setting up an address range using
+ * the %FW_CDEV_IOC_ALLOCATE ioctl, userspace can listen for incoming requests. An
+ * incoming request will generate an %FW_CDEV_EVENT_REQUEST, and userspace must
+ * send a reply using this ioctl. The event has a handle to the kernel-side
+ * pending transaction, which should be used with this ioctl.
+ */
+struct fw_cdev_send_response {
+ __u32 rcode;
+ __u32 length;
+ __u64 data;
+ __u32 handle;
+};
+
+/**
+ * struct fw_cdev_allocate - Allocate a CSR address range
+ * @offset: Start offset of the address range
+ * @closure: To be passed back to userspace in request events
+ * @length: Length of the address range, in bytes
+ * @handle: Handle to the allocation, written by the kernel
+ *
+ * Allocate an address range in the 48-bit address space on the local node
+ * (the controller). This allows userspace to listen for requests with an
+ * offset within that address range. When the kernel receives a request
+ * within the range, an &fw_cdev_event_request event will be written back.
+ * The @closure field is passed back to userspace in the response event.
+ * The @handle field is an out parameter, returning a handle to the allocated
+ * range to be used for later deallocation of the range.
+ */
+struct fw_cdev_allocate {
+ __u64 offset;
+ __u64 closure;
+ __u32 length;
+ __u32 handle;
+};
+
+/**
+ * struct fw_cdev_deallocate - Free an address range allocation
+ * @handle: Handle to the address range, as returned by the kernel when the
+ * range was allocated
+ */
+struct fw_cdev_deallocate {
+ __u32 handle;
+};
+
+#define FW_CDEV_LONG_RESET 0
+#define FW_CDEV_SHORT_RESET 1
+
+/**
+ * struct fw_cdev_initiate_bus_reset - Initiate a bus reset
+ * @type: %FW_CDEV_SHORT_RESET or %FW_CDEV_LONG_RESET
+ *
+ * Initiate a bus reset for the bus this device is on. The bus reset can be
+ * either the original (long) bus reset or the arbitrated (short) bus reset
+ * introduced in 1394a-2000.
+ */
+struct fw_cdev_initiate_bus_reset {
+ __u32 type; /* FW_CDEV_SHORT_RESET or FW_CDEV_LONG_RESET */
+};
+
+/**
+ * struct fw_cdev_add_descriptor - Add contents to the local node's config ROM
+ * @immediate: If non-zero, immediate key to insert before pointer
+ * @key: Upper 8 bits of root directory pointer
+ * @data: Userspace pointer to contents of descriptor block
+ * @length: Length of descriptor block data, in bytes
+ * @handle: Handle to the descriptor, written by the kernel
+ *
+ * Add a descriptor block and optionally a preceding immediate key to the local
+ * node's configuration ROM.
+ *
+ * The @key field specifies the upper 8 bits of the descriptor root directory
+ * pointer and the @data and @length fields specify the contents. The @key
+ * should be of the form 0xXX000000. The offset part of the root directory entry
+ * will be filled in by the kernel.
+ *
+ * If not 0, the @immediate field specifies an immediate key which will be
+ * inserted before the root directory pointer.
+ *
+ * If successful, the kernel adds the descriptor and writes back a handle to the
+ * kernel-side object to be used for later removal of the descriptor block and
+ * immediate key.
+ */
+struct fw_cdev_add_descriptor {
+ __u32 immediate;
+ __u32 key;
+ __u64 data;
+ __u32 length;
+ __u32 handle;
+};
+
+/**
+ * struct fw_cdev_remove_descriptor - Remove contents from the configuration ROM
+ * @handle: Handle to the descriptor, as returned by the kernel when the
+ * descriptor was added
+ *
+ * Remove a descriptor block and accompanying immediate key from the local
+ * node's configuration ROM.
+ */
+struct fw_cdev_remove_descriptor {
+ __u32 handle;
+};
+
+#define FW_CDEV_ISO_CONTEXT_TRANSMIT 0
+#define FW_CDEV_ISO_CONTEXT_RECEIVE 1
+
+/**
+ * struct fw_cdev_create_iso_context - Create a context for isochronous IO
+ * @type: %FW_CDEV_ISO_CONTEXT_TRANSMIT or %FW_CDEV_ISO_CONTEXT_RECEIVE
+ * @header_size: Header size to strip for receive contexts
+ * @channel: Channel to bind to
+ * @speed: Speed to transmit at
+ * @closure: To be returned in &fw_cdev_event_iso_interrupt
+ * @handle: Handle to context, written back by kernel
+ *
+ * Prior to sending or receiving isochronous I/O, a context must be created.
+ * The context records information about the transmit or receive configuration
+ * and typically maps to an underlying hardware resource. A context is set up
+ * for either sending or receiving. It is bound to a specific isochronous
+ * channel.
+ *
+ * If a context was successfully created, the kernel writes back a handle to the
+ * context, which must be passed in for subsequent operations on that context.
+ */
+struct fw_cdev_create_iso_context {
+ __u32 type;
+ __u32 header_size;
+ __u32 channel;
+ __u32 speed;
+ __u64 closure;
+ __u32 handle;
+};
+
+#define FW_CDEV_ISO_PAYLOAD_LENGTH(v) (v)
+#define FW_CDEV_ISO_INTERRUPT (1 << 16)
+#define FW_CDEV_ISO_SKIP (1 << 17)
+#define FW_CDEV_ISO_SYNC (1 << 17)
+#define FW_CDEV_ISO_TAG(v) ((v) << 18)
+#define FW_CDEV_ISO_SY(v) ((v) << 20)
+#define FW_CDEV_ISO_HEADER_LENGTH(v) ((v) << 24)
+
+/**
+ * struct fw_cdev_iso_packet - Isochronous packet
+ * @control: Contains the header length (8 uppermost bits), the sy field
+ * (4 bits), the tag field (2 bits), a sync flag (1 bit),
+ * a skip flag (1 bit), an interrupt flag (1 bit), and the
+ * payload length (16 lowermost bits)
+ * @header: Header and payload
+ *
+ * &struct fw_cdev_iso_packet is used to describe isochronous packet queues.
+ *
+ * Use the FW_CDEV_ISO_ macros to fill in @control. The sy and tag fields are
+ * specified by IEEE 1394a and IEC 61883.
+ *
+ * FIXME - finish this documentation
+ */
+struct fw_cdev_iso_packet {
+ __u32 control;
+ __u32 header[0];
+};
+
+/**
+ * struct fw_cdev_queue_iso - Queue isochronous packets for I/O
+ * @packets: Userspace pointer to packet data
+ * @data: Pointer into mmap()'ed payload buffer
+ * @size: Size of packet data in bytes
+ * @handle: Isochronous context handle
+ *
+ * Queue a number of isochronous packets for reception or transmission.
+ * This ioctl takes a pointer to an array of &fw_cdev_iso_packet structs,
+ * which describe how to transmit from or receive into a contiguous region
+ * of a mmap()'ed payload buffer. As part of the packet descriptors,
+ * a series of headers can be supplied, which will be prepended to the
+ * payload during DMA.
+ *
+ * The kernel may or may not queue all packets, but will write back updated
+ * values of the @packets, @data and @size fields, so the ioctl can be
+ * resubmitted easily.
+ */
+struct fw_cdev_queue_iso {
+ __u64 packets;
+ __u64 data;
+ __u32 size;
+ __u32 handle;
+};
+
+#define FW_CDEV_ISO_CONTEXT_MATCH_TAG0 1
+#define FW_CDEV_ISO_CONTEXT_MATCH_TAG1 2
+#define FW_CDEV_ISO_CONTEXT_MATCH_TAG2 4
+#define FW_CDEV_ISO_CONTEXT_MATCH_TAG3 8
+#define FW_CDEV_ISO_CONTEXT_MATCH_ALL_TAGS 15
+
+/**
+ * struct fw_cdev_start_iso - Start an isochronous transmission or reception
+ * @cycle: Cycle in which to start I/O. If @cycle is greater than or
+ * equal to 0, the I/O will start on that cycle.
+ * @sync: Determines the value to wait for for receive packets that have
+ * the %FW_CDEV_ISO_SYNC bit set
+ * @tags: Tag filter bit mask. Only valid for isochronous reception.
+ * Determines the tag values for which packets will be accepted.
+ * Use FW_CDEV_ISO_CONTEXT_MATCH_ macros to set @tags.
+ * @handle: Isochronous context handle within which to transmit or receive
+ */
+struct fw_cdev_start_iso {
+ __s32 cycle;
+ __u32 sync;
+ __u32 tags;
+ __u32 handle;
+};
+
+/**
+ * struct fw_cdev_stop_iso - Stop an isochronous transmission or reception
+ * @handle: Handle of isochronous context to stop
+ */
+struct fw_cdev_stop_iso {
+ __u32 handle;
+};
+
+/**
+ * struct fw_cdev_get_cycle_timer - read cycle timer register
+ * @local_time: system time, in microseconds since the Epoch
+ * @cycle_timer: isochronous cycle timer, as per OHCI 1.1 clause 5.13
+ *
+ * The %FW_CDEV_IOC_GET_CYCLE_TIMER ioctl reads the isochronous cycle timer
+ * and also the system clock. This allows to express the receive time of an
+ * isochronous packet as a system time with microsecond accuracy.
+ */
+struct fw_cdev_get_cycle_timer {
+ __u64 local_time;
+ __u32 cycle_timer;
+};
+
+#endif /* _LINUX_FIREWIRE_CDEV_H */
diff --git a/sysroot/usr/include/linux/firewire-constants.h b/sysroot/usr/include/linux/firewire-constants.h
new file mode 100644
index 0000000..b316770
--- /dev/null
+++ b/sysroot/usr/include/linux/firewire-constants.h
@@ -0,0 +1,67 @@
+#ifndef _LINUX_FIREWIRE_CONSTANTS_H
+#define _LINUX_FIREWIRE_CONSTANTS_H
+
+#define TCODE_WRITE_QUADLET_REQUEST 0x0
+#define TCODE_WRITE_BLOCK_REQUEST 0x1
+#define TCODE_WRITE_RESPONSE 0x2
+#define TCODE_READ_QUADLET_REQUEST 0x4
+#define TCODE_READ_BLOCK_REQUEST 0x5
+#define TCODE_READ_QUADLET_RESPONSE 0x6
+#define TCODE_READ_BLOCK_RESPONSE 0x7
+#define TCODE_CYCLE_START 0x8
+#define TCODE_LOCK_REQUEST 0x9
+#define TCODE_STREAM_DATA 0xa
+#define TCODE_LOCK_RESPONSE 0xb
+
+#define EXTCODE_MASK_SWAP 0x1
+#define EXTCODE_COMPARE_SWAP 0x2
+#define EXTCODE_FETCH_ADD 0x3
+#define EXTCODE_LITTLE_ADD 0x4
+#define EXTCODE_BOUNDED_ADD 0x5
+#define EXTCODE_WRAP_ADD 0x6
+#define EXTCODE_VENDOR_DEPENDENT 0x7
+
+/* Juju specific tcodes */
+#define TCODE_LOCK_MASK_SWAP (0x10 | EXTCODE_MASK_SWAP)
+#define TCODE_LOCK_COMPARE_SWAP (0x10 | EXTCODE_COMPARE_SWAP)
+#define TCODE_LOCK_FETCH_ADD (0x10 | EXTCODE_FETCH_ADD)
+#define TCODE_LOCK_LITTLE_ADD (0x10 | EXTCODE_LITTLE_ADD)
+#define TCODE_LOCK_BOUNDED_ADD (0x10 | EXTCODE_BOUNDED_ADD)
+#define TCODE_LOCK_WRAP_ADD (0x10 | EXTCODE_WRAP_ADD)
+#define TCODE_LOCK_VENDOR_DEPENDENT (0x10 | EXTCODE_VENDOR_DEPENDENT)
+
+#define RCODE_COMPLETE 0x0
+#define RCODE_CONFLICT_ERROR 0x4
+#define RCODE_DATA_ERROR 0x5
+#define RCODE_TYPE_ERROR 0x6
+#define RCODE_ADDRESS_ERROR 0x7
+
+/* Juju specific rcodes */
+#define RCODE_SEND_ERROR 0x10
+#define RCODE_CANCELLED 0x11
+#define RCODE_BUSY 0x12
+#define RCODE_GENERATION 0x13
+#define RCODE_NO_ACK 0x14
+
+#define SCODE_100 0x0
+#define SCODE_200 0x1
+#define SCODE_400 0x2
+#define SCODE_800 0x3
+#define SCODE_1600 0x4
+#define SCODE_3200 0x5
+#define SCODE_BETA 0x3
+
+#define ACK_COMPLETE 0x1
+#define ACK_PENDING 0x2
+#define ACK_BUSY_X 0x4
+#define ACK_BUSY_A 0x5
+#define ACK_BUSY_B 0x6
+#define ACK_DATA_ERROR 0xd
+#define ACK_TYPE_ERROR 0xe
+
+#define RETRY_1 0x00
+#define RETRY_X 0x01
+#define RETRY_A 0x02
+#define RETRY_B 0x03
+
+#endif /* _LINUX_FIREWIRE_CONSTANTS_H */
diff --git a/sysroot/usr/include/linux/flat.h b/sysroot/usr/include/linux/flat.h
new file mode 100644
index 0000000..8351bc7
--- /dev/null
+++ b/sysroot/usr/include/linux/flat.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2002-2003 David McCullough <davidm@snapgear.com>
+ * Copyright (C) 1998 Kenneth Albanowski <kjahds@kjahds.com>
+ * The Silver Hammer Group, Ltd.
+ *
+ * This file provides the definitions and structures needed to
+ * support uClinux flat-format executables.
+ */
+
+#ifndef _LINUX_FLAT_H
+#define _LINUX_FLAT_H
+
+
+#define FLAT_VERSION 0x00000004L
+
+#ifdef CONFIG_BINFMT_SHARED_FLAT
+#define MAX_SHARED_LIBS (4)
+#else
+#define MAX_SHARED_LIBS (1)
+#endif
+
+/*
+ * To make everything easier to port and manage cross platform
+ * development, all fields are in network byte order.
+ */
+
+struct flat_hdr {
+ char magic[4];
+ unsigned long rev; /* version (as above) */
+ unsigned long entry; /* Offset of first executable instruction
+ with text segment from beginning of file */
+ unsigned long data_start; /* Offset of data segment from beginning of
+ file */
+ unsigned long data_end; /* Offset of end of data segment
+ from beginning of file */
+ unsigned long bss_end; /* Offset of end of bss segment from beginning
+ of file */
+
+ /* (It is assumed that data_end through bss_end forms the bss segment.) */
+
+ unsigned long stack_size; /* Size of stack, in bytes */
+ unsigned long reloc_start; /* Offset of relocation records from
+ beginning of file */
+ unsigned long reloc_count; /* Number of relocation records */
+ unsigned long flags;
+ unsigned long build_date; /* When the program/library was built */
+ unsigned long filler[5]; /* Reservered, set to zero */
+};
+
+#define FLAT_FLAG_RAM 0x0001 /* load program entirely into RAM */
+#define FLAT_FLAG_GOTPIC 0x0002 /* program is PIC with GOT */
+#define FLAT_FLAG_GZIP 0x0004 /* all but the header is compressed */
+#define FLAT_FLAG_GZDATA 0x0008 /* only data/relocs are compressed (for XIP) */
+#define FLAT_FLAG_KTRACE 0x0010 /* output useful kernel trace for debugging */
+
+
+
+#endif /* _LINUX_FLAT_H */
diff --git a/sysroot/usr/include/linux/fs.h b/sysroot/usr/include/linux/fs.h
new file mode 100644
index 0000000..c0d5afe
--- /dev/null
+++ b/sysroot/usr/include/linux/fs.h
@@ -0,0 +1,270 @@
+#ifndef _LINUX_FS_H
+#define _LINUX_FS_H
+
+/*
+ * This file has definitions for some important file table
+ * structures etc.
+ */
+
+#include <linux/limits.h>
+#include <linux/ioctl.h>
+
+/*
+ * It's silly to have NR_OPEN bigger than NR_FILE, but you can change
+ * the file limit at runtime and only root can increase the per-process
+ * nr_file rlimit, so it's safe to set up a ridiculously high absolute
+ * upper limit on files-per-process.
+ *
+ * Some programs (notably those using select()) may have to be
+ * recompiled to take full advantage of the new limits..
+ */
+
+/* Fixed constants first: */
+#undef NR_OPEN
+#define NR_OPEN (1024*1024) /* Absolute upper limit on fd num */
+#define INR_OPEN 1024 /* Initial setting for nfile rlimits */
+
+#define BLOCK_SIZE_BITS 10
+#define BLOCK_SIZE (1<<BLOCK_SIZE_BITS)
+
+#define SEEK_SET 0 /* seek relative to beginning of file */
+#define SEEK_CUR 1 /* seek relative to current file position */
+#define SEEK_END 2 /* seek relative to end of file */
+#define SEEK_MAX SEEK_END
+
+/* And dynamically-tunable limits and defaults: */
+struct files_stat_struct {
+ int nr_files; /* read only */
+ int nr_free_files; /* read only */
+ int max_files; /* tunable */
+};
+extern struct files_stat_struct files_stat;
+extern int get_max_files(void);
+
+struct inodes_stat_t {
+ int nr_inodes;
+ int nr_unused;
+ int dummy[5]; /* padding for sysctl ABI compatibility */
+};
+extern struct inodes_stat_t inodes_stat;
+
+extern int leases_enable, lease_break_time;
+
+#ifdef CONFIG_DNOTIFY
+extern int dir_notify_enable;
+#endif
+
+#define NR_FILE 8192 /* this can well be larger on a larger system */
+
+#define MAY_EXEC 1
+#define MAY_WRITE 2
+#define MAY_READ 4
+#define MAY_APPEND 8
+
+#define FMODE_READ 1
+#define FMODE_WRITE 2
+
+/* Internal kernel extensions */
+#define FMODE_LSEEK 4
+#define FMODE_PREAD 8
+#define FMODE_PWRITE FMODE_PREAD /* These go hand in hand */
+
+/* File is being opened for execution. Primary users of this flag are
+ distributed filesystems that can use it to achieve correct ETXTBUSY
+ behavior for cross-node execution/opening_for_writing of files */
+#define FMODE_EXEC 16
+
+#define RW_MASK 1
+#define RWA_MASK 2
+#define READ 0
+#define WRITE 1
+#define READA 2 /* read-ahead - don't block if no resources */
+#define SWRITE 3 /* for ll_rw_block() - wait for buffer lock */
+#define READ_SYNC (READ | (1 << BIO_RW_SYNC))
+#define READ_META (READ | (1 << BIO_RW_META))
+#define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC))
+#define WRITE_BARRIER ((1 << BIO_RW) | (1 << BIO_RW_BARRIER))
+
+#define SEL_IN 1
+#define SEL_OUT 2
+#define SEL_EX 4
+
+/* public flags for file_system_type */
+#define FS_REQUIRES_DEV 1
+#define FS_BINARY_MOUNTDATA 2
+#define FS_HAS_SUBTYPE 4
+#define FS_REVAL_DOT 16384 /* Check the paths ".", ".." for staleness */
+#define FS_RENAME_DOES_D_MOVE 32768 /* FS will handle d_move()
+ * during rename() internally.
+ */
+
+/*
+ * These are the fs-independent mount-flags: up to 32 flags are supported
+ */
+#define MS_RDONLY 1 /* Mount read-only */
+#define MS_NOSUID 2 /* Ignore suid and sgid bits */
+#define MS_NODEV 4 /* Disallow access to device special files */
+#define MS_NOEXEC 8 /* Disallow program execution */
+#define MS_SYNCHRONOUS 16 /* Writes are synced at once */
+#define MS_REMOUNT 32 /* Alter flags of a mounted FS */
+#define MS_MANDLOCK 64 /* Allow mandatory locks on an FS */
+#define MS_DIRSYNC 128 /* Directory modifications are synchronous */
+#define MS_NOATIME 1024 /* Do not update access times. */
+#define MS_NODIRATIME 2048 /* Do not update directory access times */
+#define MS_BIND 4096
+#define MS_MOVE 8192
+#define MS_REC 16384
+#define MS_VERBOSE 32768 /* War is peace. Verbosity is silence.
+ MS_VERBOSE is deprecated. */
+#define MS_SILENT 32768
+#define MS_POSIXACL (1<<16) /* VFS does not apply the umask */
+#define MS_UNBINDABLE (1<<17) /* change to unbindable */
+#define MS_PRIVATE (1<<18) /* change to private */
+#define MS_SLAVE (1<<19) /* change to slave */
+#define MS_SHARED (1<<20) /* change to shared */
+#define MS_RELATIME (1<<21) /* Update atime relative to mtime/ctime. */
+#define MS_KERNMOUNT (1<<22) /* this is a kern_mount call */
+#define MS_ACTIVE (1<<30)
+#define MS_NOUSER (1<<31)
+
+/*
+ * Superblock flags that can be altered by MS_REMOUNT
+ */
+#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK)
+
+/*
+ * Old magic mount flag and mask
+ */
+#define MS_MGC_VAL 0xC0ED0000
+#define MS_MGC_MSK 0xffff0000
+
+/* Inode flags - they have nothing to superblock flags now */
+
+#define S_SYNC 1 /* Writes are synced at once */
+#define S_NOATIME 2 /* Do not update access times */
+#define S_APPEND 4 /* Append-only file */
+#define S_IMMUTABLE 8 /* Immutable file */
+#define S_DEAD 16 /* removed, but still open directory */
+#define S_NOQUOTA 32 /* Inode is not counted to quota */
+#define S_DIRSYNC 64 /* Directory modifications are synchronous */
+#define S_NOCMTIME 128 /* Do not update file c/mtime */
+#define S_SWAPFILE 256 /* Do not truncate: swapon got its bmaps */
+#define S_PRIVATE 512 /* Inode is fs-internal */
+
+/*
+ * Note that nosuid etc flags are inode-specific: setting some file-system
+ * flags just means all the inodes inherit those flags by default. It might be
+ * possible to override it selectively if you really wanted to with some
+ * ioctl() that is not currently implemented.
+ *
+ * Exception: MS_RDONLY is always applied to the entire file system.
+ *
+ * Unfortunately, it is possible to change a filesystems flags with it mounted
+ * with files in use. This means that all of the inodes will not have their
+ * i_flags updated. Hence, i_flags no longer inherit the superblock mount
+ * flags, so these have to be checked separately. -- rmk@arm.uk.linux.org
+ */
+#define __IS_FLG(inode,flg) ((inode)->i_sb->s_flags & (flg))
+
+#define IS_RDONLY(inode) ((inode)->i_sb->s_flags & MS_RDONLY)
+#define IS_SYNC(inode) (__IS_FLG(inode, MS_SYNCHRONOUS) || \
+ ((inode)->i_flags & S_SYNC))
+#define IS_DIRSYNC(inode) (__IS_FLG(inode, MS_SYNCHRONOUS|MS_DIRSYNC) || \
+ ((inode)->i_flags & (S_SYNC|S_DIRSYNC)))
+#define IS_MANDLOCK(inode) __IS_FLG(inode, MS_MANDLOCK)
+#define IS_NOATIME(inode) __IS_FLG(inode, MS_RDONLY|MS_NOATIME)
+
+#define IS_NOQUOTA(inode) ((inode)->i_flags & S_NOQUOTA)
+#define IS_APPEND(inode) ((inode)->i_flags & S_APPEND)
+#define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE)
+#define IS_POSIXACL(inode) __IS_FLG(inode, MS_POSIXACL)
+
+#define IS_DEADDIR(inode) ((inode)->i_flags & S_DEAD)
+#define IS_NOCMTIME(inode) ((inode)->i_flags & S_NOCMTIME)
+#define IS_SWAPFILE(inode) ((inode)->i_flags & S_SWAPFILE)
+#define IS_PRIVATE(inode) ((inode)->i_flags & S_PRIVATE)
+
+/* the read-only stuff doesn't really belong here, but any other place is
+ probably as bad and I don't want to create yet another include file. */
+
+#define BLKROSET _IO(0x12,93) /* set device read-only (0 = read-write) */
+#define BLKROGET _IO(0x12,94) /* get read-only status (0 = read_write) */
+#define BLKRRPART _IO(0x12,95) /* re-read partition table */
+#define BLKGETSIZE _IO(0x12,96) /* return device size /512 (long *arg) */
+#define BLKFLSBUF _IO(0x12,97) /* flush buffer cache */
+#define BLKRASET _IO(0x12,98) /* set read ahead for block device */
+#define BLKRAGET _IO(0x12,99) /* get current read ahead setting */
+#define BLKFRASET _IO(0x12,100)/* set filesystem (mm/filemap.c) read-ahead */
+#define BLKFRAGET _IO(0x12,101)/* get filesystem (mm/filemap.c) read-ahead */
+#define BLKSECTSET _IO(0x12,102)/* set max sectors per request (ll_rw_blk.c) */
+#define BLKSECTGET _IO(0x12,103)/* get max sectors per request (ll_rw_blk.c) */
+#define BLKSSZGET _IO(0x12,104)/* get block device sector size */
+#if 0
+#define BLKPG _IO(0x12,105)/* See blkpg.h */
+
+/* Some people are morons. Do not use sizeof! */
+
+#define BLKELVGET _IOR(0x12,106,size_t)/* elevator get */
+#define BLKELVSET _IOW(0x12,107,size_t)/* elevator set */
+/* This was here just to show that the number is taken -
+ probably all these _IO(0x12,*) ioctls should be moved to blkpg.h. */
+#endif
+/* A jump here: 108-111 have been used for various private purposes. */
+#define BLKBSZGET _IOR(0x12,112,size_t)
+#define BLKBSZSET _IOW(0x12,113,size_t)
+#define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size in bytes (u64 *arg) */
+#define BLKTRACESETUP _IOWR(0x12,115,struct blk_user_trace_setup)
+#define BLKTRACESTART _IO(0x12,116)
+#define BLKTRACESTOP _IO(0x12,117)
+#define BLKTRACETEARDOWN _IO(0x12,118)
+
+#define BMAP_IOCTL 1 /* obsolete - kept for compatibility */
+#define FIBMAP _IO(0x00,1) /* bmap access */
+#define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */
+
+#define FS_IOC_GETFLAGS _IOR('f', 1, long)
+#define FS_IOC_SETFLAGS _IOW('f', 2, long)
+#define FS_IOC_GETVERSION _IOR('v', 1, long)
+#define FS_IOC_SETVERSION _IOW('v', 2, long)
+#define FS_IOC32_GETFLAGS _IOR('f', 1, int)
+#define FS_IOC32_SETFLAGS _IOW('f', 2, int)
+#define FS_IOC32_GETVERSION _IOR('v', 1, int)
+#define FS_IOC32_SETVERSION _IOW('v', 2, int)
+
+/*
+ * Inode flags (FS_IOC_GETFLAGS / FS_IOC_SETFLAGS)
+ */
+#define FS_SECRM_FL 0x00000001 /* Secure deletion */
+#define FS_UNRM_FL 0x00000002 /* Undelete */
+#define FS_COMPR_FL 0x00000004 /* Compress file */
+#define FS_SYNC_FL 0x00000008 /* Synchronous updates */
+#define FS_IMMUTABLE_FL 0x00000010 /* Immutable file */
+#define FS_APPEND_FL 0x00000020 /* writes to file may only append */
+#define FS_NODUMP_FL 0x00000040 /* do not dump file */
+#define FS_NOATIME_FL 0x00000080 /* do not update atime */
+/* Reserved for compression usage... */
+#define FS_DIRTY_FL 0x00000100
+#define FS_COMPRBLK_FL 0x00000200 /* One or more compressed clusters */
+#define FS_NOCOMP_FL 0x00000400 /* Don't compress */
+#define FS_ECOMPR_FL 0x00000800 /* Compression error */
+/* End compression flags --- maybe not all used */
+#define FS_BTREE_FL 0x00001000 /* btree format dir */
+#define FS_INDEX_FL 0x00001000 /* hash-indexed directory */
+#define FS_IMAGIC_FL 0x00002000 /* AFS directory */
+#define FS_JOURNAL_DATA_FL 0x00004000 /* Reserved for ext3 */
+#define FS_NOTAIL_FL 0x00008000 /* file tail should not be merged */
+#define FS_DIRSYNC_FL 0x00010000 /* dirsync behaviour (directories only) */
+#define FS_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/
+#define FS_EXTENT_FL 0x00080000 /* Extents */
+#define FS_DIRECTIO_FL 0x00100000 /* Use direct i/o */
+#define FS_RESERVED_FL 0x80000000 /* reserved for ext2 lib */
+
+#define FS_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */
+#define FS_FL_USER_MODIFIABLE 0x000380FF /* User modifiable flags */
+
+
+#define SYNC_FILE_RANGE_WAIT_BEFORE 1
+#define SYNC_FILE_RANGE_WRITE 2
+#define SYNC_FILE_RANGE_WAIT_AFTER 4
+
+#endif /* _LINUX_FS_H */
diff --git a/sysroot/usr/include/linux/fuse.h b/sysroot/usr/include/linux/fuse.h
new file mode 100644
index 0000000..5c86f11
--- /dev/null
+++ b/sysroot/usr/include/linux/fuse.h
@@ -0,0 +1,407 @@
+/*
+ FUSE: Filesystem in Userspace
+ Copyright (C) 2001-2006 Miklos Szeredi <miklos@szeredi.hu>
+
+ This program can be distributed under the terms of the GNU GPL.
+ See the file COPYING.
+*/
+
+/*
+ * This file defines the kernel interface of FUSE
+ *
+ * Protocol changelog:
+ *
+ * 7.9:
+ * - new fuse_getattr_in input argument of GETATTR
+ * - add lk_flags in fuse_lk_in
+ * - add lock_owner field to fuse_setattr_in, fuse_read_in and fuse_write_in
+ * - add blksize field to fuse_attr
+ * - add file flags field to fuse_read_in and fuse_write_in
+ */
+
+#include <asm/types.h>
+#include <linux/major.h>
+
+/** Version number of this interface */
+#define FUSE_KERNEL_VERSION 7
+
+/** Minor version number of this interface */
+#define FUSE_KERNEL_MINOR_VERSION 9
+
+/** The node ID of the root inode */
+#define FUSE_ROOT_ID 1
+
+/** The major number of the fuse character device */
+#define FUSE_MAJOR MISC_MAJOR
+
+/** The minor number of the fuse character device */
+#define FUSE_MINOR 229
+
+/* Make sure all structures are padded to 64bit boundary, so 32bit
+ userspace works under 64bit kernels */
+
+struct fuse_attr {
+ __u64 ino;
+ __u64 size;
+ __u64 blocks;
+ __u64 atime;
+ __u64 mtime;
+ __u64 ctime;
+ __u32 atimensec;
+ __u32 mtimensec;
+ __u32 ctimensec;
+ __u32 mode;
+ __u32 nlink;
+ __u32 uid;
+ __u32 gid;
+ __u32 rdev;
+ __u32 blksize;
+ __u32 padding;
+};
+
+struct fuse_kstatfs {
+ __u64 blocks;
+ __u64 bfree;
+ __u64 bavail;
+ __u64 files;
+ __u64 ffree;
+ __u32 bsize;
+ __u32 namelen;
+ __u32 frsize;
+ __u32 padding;
+ __u32 spare[6];
+};
+
+struct fuse_file_lock {
+ __u64 start;
+ __u64 end;
+ __u32 type;
+ __u32 pid; /* tgid */
+};
+
+/**
+ * Bitmasks for fuse_setattr_in.valid
+ */
+#define FATTR_MODE (1 << 0)
+#define FATTR_UID (1 << 1)
+#define FATTR_GID (1 << 2)
+#define FATTR_SIZE (1 << 3)
+#define FATTR_ATIME (1 << 4)
+#define FATTR_MTIME (1 << 5)
+#define FATTR_FH (1 << 6)
+#define FATTR_ATIME_NOW (1 << 7)
+#define FATTR_MTIME_NOW (1 << 8)
+#define FATTR_LOCKOWNER (1 << 9)
+
+/**
+ * Flags returned by the OPEN request
+ *
+ * FOPEN_DIRECT_IO: bypass page cache for this open file
+ * FOPEN_KEEP_CACHE: don't invalidate the data cache on open
+ */
+#define FOPEN_DIRECT_IO (1 << 0)
+#define FOPEN_KEEP_CACHE (1 << 1)
+
+/**
+ * INIT request/reply flags
+ */
+#define FUSE_ASYNC_READ (1 << 0)
+#define FUSE_POSIX_LOCKS (1 << 1)
+#define FUSE_FILE_OPS (1 << 2)
+#define FUSE_ATOMIC_O_TRUNC (1 << 3)
+
+/**
+ * Release flags
+ */
+#define FUSE_RELEASE_FLUSH (1 << 0)
+
+/**
+ * Getattr flags
+ */
+#define FUSE_GETATTR_FH (1 << 0)
+
+/**
+ * Lock flags
+ */
+#define FUSE_LK_FLOCK (1 << 0)
+
+/**
+ * WRITE flags
+ *
+ * FUSE_WRITE_CACHE: delayed write from page cache, file handle is guessed
+ * FUSE_WRITE_LOCKOWNER: lock_owner field is valid
+ */
+#define FUSE_WRITE_CACHE (1 << 0)
+#define FUSE_WRITE_LOCKOWNER (1 << 1)
+
+/**
+ * Read flags
+ */
+#define FUSE_READ_LOCKOWNER (1 << 1)
+
+enum fuse_opcode {
+ FUSE_LOOKUP = 1,
+ FUSE_FORGET = 2, /* no reply */
+ FUSE_GETATTR = 3,
+ FUSE_SETATTR = 4,
+ FUSE_READLINK = 5,
+ FUSE_SYMLINK = 6,
+ FUSE_MKNOD = 8,
+ FUSE_MKDIR = 9,
+ FUSE_UNLINK = 10,
+ FUSE_RMDIR = 11,
+ FUSE_RENAME = 12,
+ FUSE_LINK = 13,
+ FUSE_OPEN = 14,
+ FUSE_READ = 15,
+ FUSE_WRITE = 16,
+ FUSE_STATFS = 17,
+ FUSE_RELEASE = 18,
+ FUSE_FSYNC = 20,
+ FUSE_SETXATTR = 21,
+ FUSE_GETXATTR = 22,
+ FUSE_LISTXATTR = 23,
+ FUSE_REMOVEXATTR = 24,
+ FUSE_FLUSH = 25,
+ FUSE_INIT = 26,
+ FUSE_OPENDIR = 27,
+ FUSE_READDIR = 28,
+ FUSE_RELEASEDIR = 29,
+ FUSE_FSYNCDIR = 30,
+ FUSE_GETLK = 31,
+ FUSE_SETLK = 32,
+ FUSE_SETLKW = 33,
+ FUSE_ACCESS = 34,
+ FUSE_CREATE = 35,
+ FUSE_INTERRUPT = 36,
+ FUSE_BMAP = 37,
+ FUSE_DESTROY = 38,
+};
+
+/* The read buffer is required to be at least 8k, but may be much larger */
+#define FUSE_MIN_READ_BUFFER 8192
+
+#define FUSE_COMPAT_ENTRY_OUT_SIZE 120
+
+struct fuse_entry_out {
+ __u64 nodeid; /* Inode ID */
+ __u64 generation; /* Inode generation: nodeid:gen must
+ be unique for the fs's lifetime */
+ __u64 entry_valid; /* Cache timeout for the name */
+ __u64 attr_valid; /* Cache timeout for the attributes */
+ __u32 entry_valid_nsec;
+ __u32 attr_valid_nsec;
+ struct fuse_attr attr;
+};
+
+struct fuse_forget_in {
+ __u64 nlookup;
+};
+
+struct fuse_getattr_in {
+ __u32 getattr_flags;
+ __u32 dummy;
+ __u64 fh;
+};
+
+#define FUSE_COMPAT_ATTR_OUT_SIZE 96
+
+struct fuse_attr_out {
+ __u64 attr_valid; /* Cache timeout for the attributes */
+ __u32 attr_valid_nsec;
+ __u32 dummy;
+ struct fuse_attr attr;
+};
+
+struct fuse_mknod_in {
+ __u32 mode;
+ __u32 rdev;
+};
+
+struct fuse_mkdir_in {
+ __u32 mode;
+ __u32 padding;
+};
+
+struct fuse_rename_in {
+ __u64 newdir;
+};
+
+struct fuse_link_in {
+ __u64 oldnodeid;
+};
+
+struct fuse_setattr_in {
+ __u32 valid;
+ __u32 padding;
+ __u64 fh;
+ __u64 size;
+ __u64 lock_owner;
+ __u64 atime;
+ __u64 mtime;
+ __u64 unused2;
+ __u32 atimensec;
+ __u32 mtimensec;
+ __u32 unused3;
+ __u32 mode;
+ __u32 unused4;
+ __u32 uid;
+ __u32 gid;
+ __u32 unused5;
+};
+
+struct fuse_open_in {
+ __u32 flags;
+ __u32 mode;
+};
+
+struct fuse_open_out {
+ __u64 fh;
+ __u32 open_flags;
+ __u32 padding;
+};
+
+struct fuse_release_in {
+ __u64 fh;
+ __u32 flags;
+ __u32 release_flags;
+ __u64 lock_owner;
+};
+
+struct fuse_flush_in {
+ __u64 fh;
+ __u32 unused;
+ __u32 padding;
+ __u64 lock_owner;
+};
+
+struct fuse_read_in {
+ __u64 fh;
+ __u64 offset;
+ __u32 size;
+ __u32 read_flags;
+ __u64 lock_owner;
+ __u32 flags;
+ __u32 padding;
+};
+
+#define FUSE_COMPAT_WRITE_IN_SIZE 24
+
+struct fuse_write_in {
+ __u64 fh;
+ __u64 offset;
+ __u32 size;
+ __u32 write_flags;
+ __u64 lock_owner;
+ __u32 flags;
+ __u32 padding;
+};
+
+struct fuse_write_out {
+ __u32 size;
+ __u32 padding;
+};
+
+#define FUSE_COMPAT_STATFS_SIZE 48
+
+struct fuse_statfs_out {
+ struct fuse_kstatfs st;
+};
+
+struct fuse_fsync_in {
+ __u64 fh;
+ __u32 fsync_flags;
+ __u32 padding;
+};
+
+struct fuse_setxattr_in {
+ __u32 size;
+ __u32 flags;
+};
+
+struct fuse_getxattr_in {
+ __u32 size;
+ __u32 padding;
+};
+
+struct fuse_getxattr_out {
+ __u32 size;
+ __u32 padding;
+};
+
+struct fuse_lk_in {
+ __u64 fh;
+ __u64 owner;
+ struct fuse_file_lock lk;
+ __u32 lk_flags;
+ __u32 padding;
+};
+
+struct fuse_lk_out {
+ struct fuse_file_lock lk;
+};
+
+struct fuse_access_in {
+ __u32 mask;
+ __u32 padding;
+};
+
+struct fuse_init_in {
+ __u32 major;
+ __u32 minor;
+ __u32 max_readahead;
+ __u32 flags;
+};
+
+struct fuse_init_out {
+ __u32 major;
+ __u32 minor;
+ __u32 max_readahead;
+ __u32 flags;
+ __u32 unused;
+ __u32 max_write;
+};
+
+struct fuse_interrupt_in {
+ __u64 unique;
+};
+
+struct fuse_bmap_in {
+ __u64 block;
+ __u32 blocksize;
+ __u32 padding;
+};
+
+struct fuse_bmap_out {
+ __u64 block;
+};
+
+struct fuse_in_header {
+ __u32 len;
+ __u32 opcode;
+ __u64 unique;
+ __u64 nodeid;
+ __u32 uid;
+ __u32 gid;
+ __u32 pid;
+ __u32 padding;
+};
+
+struct fuse_out_header {
+ __u32 len;
+ __s32 error;
+ __u64 unique;
+};
+
+struct fuse_dirent {
+ __u64 ino;
+ __u64 off;
+ __u32 namelen;
+ __u32 type;
+ char name[0];
+};
+
+#define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name)
+#define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(__u64) - 1) & ~(sizeof(__u64) - 1))
+#define FUSE_DIRENT_SIZE(d) \
+ FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)
diff --git a/sysroot/usr/include/linux/futex.h b/sysroot/usr/include/linux/futex.h
new file mode 100644
index 0000000..347e58e
--- /dev/null
+++ b/sysroot/usr/include/linux/futex.h
@@ -0,0 +1,136 @@
+#ifndef _LINUX_FUTEX_H
+#define _LINUX_FUTEX_H
+
+#include <linux/sched.h>
+
+union ktime;
+
+/* Second argument to futex syscall */
+
+
+#define FUTEX_WAIT 0
+#define FUTEX_WAKE 1
+#define FUTEX_FD 2
+#define FUTEX_REQUEUE 3
+#define FUTEX_CMP_REQUEUE 4
+#define FUTEX_WAKE_OP 5
+#define FUTEX_LOCK_PI 6
+#define FUTEX_UNLOCK_PI 7
+#define FUTEX_TRYLOCK_PI 8
+
+#define FUTEX_PRIVATE_FLAG 128
+#define FUTEX_CMD_MASK ~FUTEX_PRIVATE_FLAG
+
+#define FUTEX_WAIT_PRIVATE (FUTEX_WAIT | FUTEX_PRIVATE_FLAG)
+#define FUTEX_WAKE_PRIVATE (FUTEX_WAKE | FUTEX_PRIVATE_FLAG)
+#define FUTEX_REQUEUE_PRIVATE (FUTEX_REQUEUE | FUTEX_PRIVATE_FLAG)
+#define FUTEX_CMP_REQUEUE_PRIVATE (FUTEX_CMP_REQUEUE | FUTEX_PRIVATE_FLAG)
+#define FUTEX_WAKE_OP_PRIVATE (FUTEX_WAKE_OP | FUTEX_PRIVATE_FLAG)
+#define FUTEX_LOCK_PI_PRIVATE (FUTEX_LOCK_PI | FUTEX_PRIVATE_FLAG)
+#define FUTEX_UNLOCK_PI_PRIVATE (FUTEX_UNLOCK_PI | FUTEX_PRIVATE_FLAG)
+#define FUTEX_TRYLOCK_PI_PRIVATE (FUTEX_TRYLOCK_PI | FUTEX_PRIVATE_FLAG)
+
+/*
+ * Support for robust futexes: the kernel cleans up held futexes at
+ * thread exit time.
+ */
+
+/*
+ * Per-lock list entry - embedded in user-space locks, somewhere close
+ * to the futex field. (Note: user-space uses a double-linked list to
+ * achieve O(1) list add and remove, but the kernel only needs to know
+ * about the forward link)
+ *
+ * NOTE: this structure is part of the syscall ABI, and must not be
+ * changed.
+ */
+struct robust_list {
+ struct robust_list *next;
+};
+
+/*
+ * Per-thread list head:
+ *
+ * NOTE: this structure is part of the syscall ABI, and must only be
+ * changed if the change is first communicated with the glibc folks.
+ * (When an incompatible change is done, we'll increase the structure
+ * size, which glibc will detect)
+ */
+struct robust_list_head {
+ /*
+ * The head of the list. Points back to itself if empty:
+ */
+ struct robust_list list;
+
+ /*
+ * This relative offset is set by user-space, it gives the kernel
+ * the relative position of the futex field to examine. This way
+ * we keep userspace flexible, to freely shape its data-structure,
+ * without hardcoding any particular offset into the kernel:
+ */
+ long futex_offset;
+
+ /*
+ * The death of the thread may race with userspace setting
+ * up a lock's links. So to handle this race, userspace first
+ * sets this field to the address of the to-be-taken lock,
+ * then does the lock acquire, and then adds itself to the
+ * list, and then clears this field. Hence the kernel will
+ * always have full knowledge of all locks that the thread
+ * _might_ have taken. We check the owner TID in any case,
+ * so only truly owned locks will be handled.
+ */
+ struct robust_list *list_op_pending;
+};
+
+/*
+ * Are there any waiters for this robust futex:
+ */
+#define FUTEX_WAITERS 0x80000000
+
+/*
+ * The kernel signals via this bit that a thread holding a futex
+ * has exited without unlocking the futex. The kernel also does
+ * a FUTEX_WAKE on such futexes, after setting the bit, to wake
+ * up any possible waiters:
+ */
+#define FUTEX_OWNER_DIED 0x40000000
+
+/*
+ * The rest of the robust-futex field is for the TID:
+ */
+#define FUTEX_TID_MASK 0x3fffffff
+
+/*
+ * This limit protects against a deliberately circular list.
+ * (Not worth introducing an rlimit for it)
+ */
+#define ROBUST_LIST_LIMIT 2048
+
+
+#define FUTEX_OP_SET 0 /* *(int *)UADDR2 = OPARG; */
+#define FUTEX_OP_ADD 1 /* *(int *)UADDR2 += OPARG; */
+#define FUTEX_OP_OR 2 /* *(int *)UADDR2 |= OPARG; */
+#define FUTEX_OP_ANDN 3 /* *(int *)UADDR2 &= ~OPARG; */
+#define FUTEX_OP_XOR 4 /* *(int *)UADDR2 ^= OPARG; */
+
+#define FUTEX_OP_OPARG_SHIFT 8 /* Use (1 << OPARG) instead of OPARG. */
+
+#define FUTEX_OP_CMP_EQ 0 /* if (oldval == CMPARG) wake */
+#define FUTEX_OP_CMP_NE 1 /* if (oldval != CMPARG) wake */
+#define FUTEX_OP_CMP_LT 2 /* if (oldval < CMPARG) wake */
+#define FUTEX_OP_CMP_LE 3 /* if (oldval <= CMPARG) wake */
+#define FUTEX_OP_CMP_GT 4 /* if (oldval > CMPARG) wake */
+#define FUTEX_OP_CMP_GE 5 /* if (oldval >= CMPARG) wake */
+
+/* FUTEX_WAKE_OP will perform atomically
+ int oldval = *(int *)UADDR2;
+ *(int *)UADDR2 = oldval OP OPARG;
+ if (oldval CMP CMPARG)
+ wake UADDR2; */
+
+#define FUTEX_OP(op, oparg, cmp, cmparg) \
+ (((op & 0xf) << 28) | ((cmp & 0xf) << 24) \
+ | ((oparg & 0xfff) << 12) | (cmparg & 0xfff))
+
+#endif
diff --git a/sysroot/usr/include/linux/gameport.h b/sysroot/usr/include/linux/gameport.h
new file mode 100644
index 0000000..1c33c4a
--- /dev/null
+++ b/sysroot/usr/include/linux/gameport.h
@@ -0,0 +1,28 @@
+#ifndef _GAMEPORT_H
+#define _GAMEPORT_H
+
+/*
+ * Copyright (c) 1999-2002 Vojtech Pavlik
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+
+
+#define GAMEPORT_MODE_DISABLED 0
+#define GAMEPORT_MODE_RAW 1
+#define GAMEPORT_MODE_COOKED 2
+
+#define GAMEPORT_ID_VENDOR_ANALOG 0x0001
+#define GAMEPORT_ID_VENDOR_MADCATZ 0x0002
+#define GAMEPORT_ID_VENDOR_LOGITECH 0x0003
+#define GAMEPORT_ID_VENDOR_CREATIVE 0x0004
+#define GAMEPORT_ID_VENDOR_GENIUS 0x0005
+#define GAMEPORT_ID_VENDOR_INTERACT 0x0006
+#define GAMEPORT_ID_VENDOR_MICROSOFT 0x0007
+#define GAMEPORT_ID_VENDOR_THRUSTMASTER 0x0008
+#define GAMEPORT_ID_VENDOR_GRAVIS 0x0009
+#define GAMEPORT_ID_VENDOR_GUILLEMOT 0x000a
+
+#endif
diff --git a/sysroot/usr/include/linux/gen_stats.h b/sysroot/usr/include/linux/gen_stats.h
new file mode 100644
index 0000000..13f4e74
--- /dev/null
+++ b/sysroot/usr/include/linux/gen_stats.h
@@ -0,0 +1,67 @@
+#ifndef __LINUX_GEN_STATS_H
+#define __LINUX_GEN_STATS_H
+
+#include <linux/types.h>
+
+enum {
+ TCA_STATS_UNSPEC,
+ TCA_STATS_BASIC,
+ TCA_STATS_RATE_EST,
+ TCA_STATS_QUEUE,
+ TCA_STATS_APP,
+ __TCA_STATS_MAX,
+};
+#define TCA_STATS_MAX (__TCA_STATS_MAX - 1)
+
+/**
+ * struct gnet_stats_basic - byte/packet throughput statistics
+ * @bytes: number of seen bytes
+ * @packets: number of seen packets
+ */
+struct gnet_stats_basic
+{
+ __u64 bytes;
+ __u32 packets;
+};
+
+/**
+ * struct gnet_stats_rate_est - rate estimator
+ * @bps: current byte rate
+ * @pps: current packet rate
+ */
+struct gnet_stats_rate_est
+{
+ __u32 bps;
+ __u32 pps;
+};
+
+/**
+ * struct gnet_stats_queue - queuing statistics
+ * @qlen: queue length
+ * @backlog: backlog size of queue
+ * @drops: number of dropped packets
+ * @requeues: number of requeues
+ * @overlimits: number of enqueues over the limit
+ */
+struct gnet_stats_queue
+{
+ __u32 qlen;
+ __u32 backlog;
+ __u32 drops;
+ __u32 requeues;
+ __u32 overlimits;
+};
+
+/**
+ * struct gnet_estimator - rate estimator configuration
+ * @interval: sampling period
+ * @ewma_log: the log of measurement window weight
+ */
+struct gnet_estimator
+{
+ signed char interval;
+ unsigned char ewma_log;
+};
+
+
+#endif /* __LINUX_GEN_STATS_H */
diff --git a/sysroot/usr/include/linux/generic_serial.h b/sysroot/usr/include/linux/generic_serial.h
new file mode 100644
index 0000000..9f596b4
--- /dev/null
+++ b/sysroot/usr/include/linux/generic_serial.h
@@ -0,0 +1,36 @@
+/*
+ * generic_serial.h
+ *
+ * Copyright (C) 1998 R.E.Wolff@BitWizard.nl
+ *
+ * written for the SX serial driver.
+ * Contains the code that should be shared over all the serial drivers.
+ *
+ * Version 0.1 -- December, 1998.
+ */
+
+#ifndef GENERIC_SERIAL_H
+#define GENERIC_SERIAL_H
+
+
+/* Flags */
+/* Warning: serial.h defines some ASYNC_ flags, they say they are "only"
+ used in serial.c, but they are also used in all other serial drivers.
+ Make sure they don't clash with these here... */
+#define GS_TX_INTEN 0x00800000
+#define GS_RX_INTEN 0x00400000
+#define GS_ACTIVE 0x00200000
+
+
+
+#define GS_TYPE_NORMAL 1
+
+#define GS_DEBUG_FLUSH 0x00000001
+#define GS_DEBUG_BTR 0x00000002
+#define GS_DEBUG_TERMIOS 0x00000004
+#define GS_DEBUG_STUFF 0x00000008
+#define GS_DEBUG_CLOSE 0x00000010
+#define GS_DEBUG_FLOW 0x00000020
+#define GS_DEBUG_WRITE 0x00000040
+
+#endif
diff --git a/sysroot/usr/include/linux/genetlink.h b/sysroot/usr/include/linux/genetlink.h
new file mode 100644
index 0000000..7da02c9
--- /dev/null
+++ b/sysroot/usr/include/linux/genetlink.h
@@ -0,0 +1,82 @@
+#ifndef __LINUX_GENERIC_NETLINK_H
+#define __LINUX_GENERIC_NETLINK_H
+
+#include <linux/netlink.h>
+
+#define GENL_NAMSIZ 16 /* length of family name */
+
+#define GENL_MIN_ID NLMSG_MIN_TYPE
+#define GENL_MAX_ID 1023
+
+struct genlmsghdr {
+ __u8 cmd;
+ __u8 version;
+ __u16 reserved;
+};
+
+#define GENL_HDRLEN NLMSG_ALIGN(sizeof(struct genlmsghdr))
+
+#define GENL_ADMIN_PERM 0x01
+#define GENL_CMD_CAP_DO 0x02
+#define GENL_CMD_CAP_DUMP 0x04
+#define GENL_CMD_CAP_HASPOL 0x08
+
+/*
+ * List of reserved static generic netlink identifiers:
+ */
+#define GENL_ID_GENERATE 0
+#define GENL_ID_CTRL NLMSG_MIN_TYPE
+
+/**************************************************************************
+ * Controller
+ **************************************************************************/
+
+enum {
+ CTRL_CMD_UNSPEC,
+ CTRL_CMD_NEWFAMILY,
+ CTRL_CMD_DELFAMILY,
+ CTRL_CMD_GETFAMILY,
+ CTRL_CMD_NEWOPS,
+ CTRL_CMD_DELOPS,
+ CTRL_CMD_GETOPS,
+ CTRL_CMD_NEWMCAST_GRP,
+ CTRL_CMD_DELMCAST_GRP,
+ CTRL_CMD_GETMCAST_GRP, /* unused */
+ __CTRL_CMD_MAX,
+};
+
+#define CTRL_CMD_MAX (__CTRL_CMD_MAX - 1)
+
+enum {
+ CTRL_ATTR_UNSPEC,
+ CTRL_ATTR_FAMILY_ID,
+ CTRL_ATTR_FAMILY_NAME,
+ CTRL_ATTR_VERSION,
+ CTRL_ATTR_HDRSIZE,
+ CTRL_ATTR_MAXATTR,
+ CTRL_ATTR_OPS,
+ CTRL_ATTR_MCAST_GROUPS,
+ __CTRL_ATTR_MAX,
+};
+
+#define CTRL_ATTR_MAX (__CTRL_ATTR_MAX - 1)
+
+enum {
+ CTRL_ATTR_OP_UNSPEC,
+ CTRL_ATTR_OP_ID,
+ CTRL_ATTR_OP_FLAGS,
+ __CTRL_ATTR_OP_MAX,
+};
+
+#define CTRL_ATTR_OP_MAX (__CTRL_ATTR_OP_MAX - 1)
+
+enum {
+ CTRL_ATTR_MCAST_GRP_UNSPEC,
+ CTRL_ATTR_MCAST_GRP_NAME,
+ CTRL_ATTR_MCAST_GRP_ID,
+ __CTRL_ATTR_MCAST_GRP_MAX,
+};
+
+#define CTRL_ATTR_MCAST_GRP_MAX (__CTRL_ATTR_MCAST_GRP_MAX - 1)
+
+#endif /* __LINUX_GENERIC_NETLINK_H */
diff --git a/sysroot/usr/include/linux/genhd.h b/sysroot/usr/include/linux/genhd.h
new file mode 100644
index 0000000..fc308f6
--- /dev/null
+++ b/sysroot/usr/include/linux/genhd.h
@@ -0,0 +1,212 @@
+#ifndef _LINUX_GENHD_H
+#define _LINUX_GENHD_H
+
+/*
+ * genhd.h Copyright (C) 1992 Drew Eckhardt
+ * Generic hard disk header file by
+ * Drew Eckhardt
+ *
+ * <drew@colorado.edu>
+ */
+
+#include <linux/types.h>
+
+#ifdef CONFIG_BLOCK
+
+enum {
+/* These three have identical behaviour; use the second one if DOS FDISK gets
+ confused about extended/logical partitions starting past cylinder 1023. */
+ DOS_EXTENDED_PARTITION = 5,
+ LINUX_EXTENDED_PARTITION = 0x85,
+ WIN98_EXTENDED_PARTITION = 0x0f,
+
+ SUN_WHOLE_DISK = DOS_EXTENDED_PARTITION,
+
+ LINUX_SWAP_PARTITION = 0x82,
+ LINUX_DATA_PARTITION = 0x83,
+ LINUX_LVM_PARTITION = 0x8e,
+ LINUX_RAID_PARTITION = 0xfd, /* autodetect RAID partition */
+
+ SOLARIS_X86_PARTITION = LINUX_SWAP_PARTITION,
+ NEW_SOLARIS_X86_PARTITION = 0xbf,
+
+ DM6_AUX1PARTITION = 0x51, /* no DDO: use xlated geom */
+ DM6_AUX3PARTITION = 0x53, /* no DDO: use xlated geom */
+ DM6_PARTITION = 0x54, /* has DDO: use xlated geom & offset */
+ EZD_PARTITION = 0x55, /* EZ-DRIVE */
+
+ FREEBSD_PARTITION = 0xa5, /* FreeBSD Partition ID */
+ OPENBSD_PARTITION = 0xa6, /* OpenBSD Partition ID */
+ NETBSD_PARTITION = 0xa9, /* NetBSD Partition ID */
+ BSDI_PARTITION = 0xb7, /* BSDI Partition ID */
+ MINIX_PARTITION = 0x81, /* Minix Partition ID */
+ UNIXWARE_PARTITION = 0x63, /* Same as GNU_HURD and SCO Unix */
+};
+
+
+struct partition {
+ unsigned char boot_ind; /* 0x80 - active */
+ unsigned char head; /* starting head */
+ unsigned char sector; /* starting sector */
+ unsigned char cyl; /* starting cylinder */
+ unsigned char sys_ind; /* What partition type */
+ unsigned char end_head; /* end head */
+ unsigned char end_sector; /* end sector */
+ unsigned char end_cyl; /* end cylinder */
+ unsigned int start_sect; /* starting sector counting from 0 */
+ unsigned int nr_sects; /* nr of sectors in partition */
+} __attribute__((packed));
+
+
+
+#ifdef CONFIG_SOLARIS_X86_PARTITION
+
+#define SOLARIS_X86_NUMSLICE 16
+#define SOLARIS_X86_VTOC_SANE (0x600DDEEEUL)
+
+struct solaris_x86_slice {
+ __le16 s_tag; /* ID tag of partition */
+ __le16 s_flag; /* permission flags */
+ __le32 s_start; /* start sector no of partition */
+ __le32 s_size; /* # of blocks in partition */
+};
+
+struct solaris_x86_vtoc {
+ unsigned int v_bootinfo[3]; /* info needed by mboot (unsupported) */
+ __le32 v_sanity; /* to verify vtoc sanity */
+ __le32 v_version; /* layout version */
+ char v_volume[8]; /* volume name */
+ __le16 v_sectorsz; /* sector size in bytes */
+ __le16 v_nparts; /* number of partitions */
+ unsigned int v_reserved[10]; /* free space */
+ struct solaris_x86_slice
+ v_slice[SOLARIS_X86_NUMSLICE]; /* slice headers */
+ unsigned int timestamp[SOLARIS_X86_NUMSLICE]; /* timestamp (unsupported) */
+ char v_asciilabel[128]; /* for compatibility */
+};
+
+#endif /* CONFIG_SOLARIS_X86_PARTITION */
+
+#ifdef CONFIG_BSD_DISKLABEL
+/*
+ * BSD disklabel support by Yossi Gottlieb <yogo@math.tau.ac.il>
+ * updated by Marc Espie <Marc.Espie@openbsd.org>
+ */
+
+/* check against BSD src/sys/sys/disklabel.h for consistency */
+
+#define BSD_DISKMAGIC (0x82564557UL) /* The disk magic number */
+#define BSD_MAXPARTITIONS 16
+#define OPENBSD_MAXPARTITIONS 16
+#define BSD_FS_UNUSED 0 /* disklabel unused partition entry ID */
+struct bsd_disklabel {
+ __le32 d_magic; /* the magic number */
+ __s16 d_type; /* drive type */
+ __s16 d_subtype; /* controller/d_type specific */
+ char d_typename[16]; /* type name, e.g. "eagle" */
+ char d_packname[16]; /* pack identifier */
+ __u32 d_secsize; /* # of bytes per sector */
+ __u32 d_nsectors; /* # of data sectors per track */
+ __u32 d_ntracks; /* # of tracks per cylinder */
+ __u32 d_ncylinders; /* # of data cylinders per unit */
+ __u32 d_secpercyl; /* # of data sectors per cylinder */
+ __u32 d_secperunit; /* # of data sectors per unit */
+ __u16 d_sparespertrack; /* # of spare sectors per track */
+ __u16 d_sparespercyl; /* # of spare sectors per cylinder */
+ __u32 d_acylinders; /* # of alt. cylinders per unit */
+ __u16 d_rpm; /* rotational speed */
+ __u16 d_interleave; /* hardware sector interleave */
+ __u16 d_trackskew; /* sector 0 skew, per track */
+ __u16 d_cylskew; /* sector 0 skew, per cylinder */
+ __u32 d_headswitch; /* head switch time, usec */
+ __u32 d_trkseek; /* track-to-track seek, usec */
+ __u32 d_flags; /* generic flags */
+#define NDDATA 5
+ __u32 d_drivedata[NDDATA]; /* drive-type specific information */
+#define NSPARE 5
+ __u32 d_spare[NSPARE]; /* reserved for future use */
+ __le32 d_magic2; /* the magic number (again) */
+ __le16 d_checksum; /* xor of data incl. partitions */
+
+ /* filesystem and partition information: */
+ __le16 d_npartitions; /* number of partitions in following */
+ __le32 d_bbsize; /* size of boot area at sn0, bytes */
+ __le32 d_sbsize; /* max size of fs superblock, bytes */
+ struct bsd_partition { /* the partition table */
+ __le32 p_size; /* number of sectors in partition */
+ __le32 p_offset; /* starting sector */
+ __le32 p_fsize; /* filesystem basic fragment size */
+ __u8 p_fstype; /* filesystem type, see below */
+ __u8 p_frag; /* filesystem fragments per block */
+ __le16 p_cpg; /* filesystem cylinders per group */
+ } d_partitions[BSD_MAXPARTITIONS]; /* actually may be more */
+};
+
+#endif /* CONFIG_BSD_DISKLABEL */
+
+#ifdef CONFIG_UNIXWARE_DISKLABEL
+/*
+ * Unixware slices support by Andrzej Krzysztofowicz <ankry@mif.pg.gda.pl>
+ * and Krzysztof G. Baranowski <kgb@knm.org.pl>
+ */
+
+#define UNIXWARE_DISKMAGIC (0xCA5E600DUL) /* The disk magic number */
+#define UNIXWARE_DISKMAGIC2 (0x600DDEEEUL) /* The slice table magic nr */
+#define UNIXWARE_NUMSLICE 16
+#define UNIXWARE_FS_UNUSED 0 /* Unused slice entry ID */
+
+struct unixware_slice {
+ __le16 s_label; /* label */
+ __le16 s_flags; /* permission flags */
+ __le32 start_sect; /* starting sector */
+ __le32 nr_sects; /* number of sectors in slice */
+};
+
+struct unixware_disklabel {
+ __le32 d_type; /* drive type */
+ __le32 d_magic; /* the magic number */
+ __le32 d_version; /* version number */
+ char d_serial[12]; /* serial number of the device */
+ __le32 d_ncylinders; /* # of data cylinders per device */
+ __le32 d_ntracks; /* # of tracks per cylinder */
+ __le32 d_nsectors; /* # of data sectors per track */
+ __le32 d_secsize; /* # of bytes per sector */
+ __le32 d_part_start; /* # of first sector of this partition */
+ __le32 d_unknown1[12]; /* ? */
+ __le32 d_alt_tbl; /* byte offset of alternate table */
+ __le32 d_alt_len; /* byte length of alternate table */
+ __le32 d_phys_cyl; /* # of physical cylinders per device */
+ __le32 d_phys_trk; /* # of physical tracks per cylinder */
+ __le32 d_phys_sec; /* # of physical sectors per track */
+ __le32 d_phys_bytes; /* # of physical bytes per sector */
+ __le32 d_unknown2; /* ? */
+ __le32 d_unknown3; /* ? */
+ __le32 d_pad[8]; /* pad */
+
+ struct unixware_vtoc {
+ __le32 v_magic; /* the magic number */
+ __le32 v_version; /* version number */
+ char v_name[8]; /* volume name */
+ __le16 v_nslices; /* # of slices */
+ __le16 v_unknown1; /* ? */
+ __le32 v_reserved[10]; /* reserved */
+ struct unixware_slice
+ v_slice[UNIXWARE_NUMSLICE]; /* slice headers */
+ } vtoc;
+
+}; /* 408 */
+
+#endif /* CONFIG_UNIXWARE_DISKLABEL */
+
+#ifdef CONFIG_MINIX_SUBPARTITION
+# define MINIX_NR_SUBPARTITIONS 4
+#endif /* CONFIG_MINIX_SUBPARTITION */
+
+
+#else /* CONFIG_BLOCK */
+
+static __inline__ void printk_all_partitions(void) { }
+
+#endif /* CONFIG_BLOCK */
+
+#endif
diff --git a/sysroot/usr/include/linux/gfs2_ondisk.h b/sysroot/usr/include/linux/gfs2_ondisk.h
new file mode 100644
index 0000000..c3c19f9
--- /dev/null
+++ b/sysroot/usr/include/linux/gfs2_ondisk.h
@@ -0,0 +1,445 @@
+/*
+ * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
+ * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU General Public License v.2.
+ */
+
+#ifndef __GFS2_ONDISK_DOT_H__
+#define __GFS2_ONDISK_DOT_H__
+
+#define GFS2_MAGIC 0x01161970
+#define GFS2_BASIC_BLOCK 512
+#define GFS2_BASIC_BLOCK_SHIFT 9
+
+/* Lock numbers of the LM_TYPE_NONDISK type */
+
+#define GFS2_MOUNT_LOCK 0
+#define GFS2_LIVE_LOCK 1
+#define GFS2_TRANS_LOCK 2
+#define GFS2_RENAME_LOCK 3
+
+/* Format numbers for various metadata types */
+
+#define GFS2_FORMAT_NONE 0
+#define GFS2_FORMAT_SB 100
+#define GFS2_FORMAT_RG 200
+#define GFS2_FORMAT_RB 300
+#define GFS2_FORMAT_DI 400
+#define GFS2_FORMAT_IN 500
+#define GFS2_FORMAT_LF 600
+#define GFS2_FORMAT_JD 700
+#define GFS2_FORMAT_LH 800
+#define GFS2_FORMAT_LD 900
+#define GFS2_FORMAT_LB 1000
+#define GFS2_FORMAT_EA 1600
+#define GFS2_FORMAT_ED 1700
+#define GFS2_FORMAT_QC 1400
+/* These are format numbers for entities contained in files */
+#define GFS2_FORMAT_RI 1100
+#define GFS2_FORMAT_DE 1200
+#define GFS2_FORMAT_QU 1500
+/* These are part of the superblock */
+#define GFS2_FORMAT_FS 1801
+#define GFS2_FORMAT_MULTI 1900
+
+/*
+ * An on-disk inode number
+ */
+
+struct gfs2_inum {
+ __be64 no_formal_ino;
+ __be64 no_addr;
+};
+
+/*
+ * Generic metadata head structure
+ * Every inplace buffer logged in the journal must start with this.
+ */
+
+#define GFS2_METATYPE_NONE 0
+#define GFS2_METATYPE_SB 1
+#define GFS2_METATYPE_RG 2
+#define GFS2_METATYPE_RB 3
+#define GFS2_METATYPE_DI 4
+#define GFS2_METATYPE_IN 5
+#define GFS2_METATYPE_LF 6
+#define GFS2_METATYPE_JD 7
+#define GFS2_METATYPE_LH 8
+#define GFS2_METATYPE_LD 9
+#define GFS2_METATYPE_LB 12
+#define GFS2_METATYPE_EA 10
+#define GFS2_METATYPE_ED 11
+#define GFS2_METATYPE_QC 14
+
+struct gfs2_meta_header {
+ __be32 mh_magic;
+ __be32 mh_type;
+ __be64 __pad0; /* Was generation number in gfs1 */
+ __be32 mh_format;
+ __be32 __pad1; /* Was incarnation number in gfs1 */
+};
+
+/*
+ * super-block structure
+ *
+ * It's probably good if SIZEOF_SB <= GFS2_BASIC_BLOCK (512 bytes)
+ *
+ * Order is important, need to be able to read old superblocks to do on-disk
+ * version upgrades.
+ */
+
+/* Address of superblock in GFS2 basic blocks */
+#define GFS2_SB_ADDR 128
+
+/* The lock number for the superblock (must be zero) */
+#define GFS2_SB_LOCK 0
+
+/* Requirement: GFS2_LOCKNAME_LEN % 8 == 0
+ Includes: the fencing zero at the end */
+#define GFS2_LOCKNAME_LEN 64
+
+struct gfs2_sb {
+ struct gfs2_meta_header sb_header;
+
+ __be32 sb_fs_format;
+ __be32 sb_multihost_format;
+ __u32 __pad0; /* Was superblock flags in gfs1 */
+
+ __be32 sb_bsize;
+ __be32 sb_bsize_shift;
+ __u32 __pad1; /* Was journal segment size in gfs1 */
+
+ struct gfs2_inum sb_master_dir; /* Was jindex dinode in gfs1 */
+ struct gfs2_inum __pad2; /* Was rindex dinode in gfs1 */
+ struct gfs2_inum sb_root_dir;
+
+ char sb_lockproto[GFS2_LOCKNAME_LEN];
+ char sb_locktable[GFS2_LOCKNAME_LEN];
+ /* In gfs1, quota and license dinodes followed */
+};
+
+/*
+ * resource index structure
+ */
+
+struct gfs2_rindex {
+ __be64 ri_addr; /* grp block disk address */
+ __be32 ri_length; /* length of rgrp header in fs blocks */
+ __u32 __pad;
+
+ __be64 ri_data0; /* first data location */
+ __be32 ri_data; /* num of data blocks in rgrp */
+
+ __be32 ri_bitbytes; /* number of bytes in data bitmaps */
+
+ __u8 ri_reserved[64];
+};
+
+/*
+ * resource group header structure
+ */
+
+/* Number of blocks per byte in rgrp */
+#define GFS2_NBBY 4
+#define GFS2_BIT_SIZE 2
+#define GFS2_BIT_MASK 0x00000003
+
+#define GFS2_BLKST_FREE 0
+#define GFS2_BLKST_USED 1
+#define GFS2_BLKST_UNLINKED 2
+#define GFS2_BLKST_DINODE 3
+
+#define GFS2_RGF_JOURNAL 0x00000001
+#define GFS2_RGF_METAONLY 0x00000002
+#define GFS2_RGF_DATAONLY 0x00000004
+#define GFS2_RGF_NOALLOC 0x00000008
+
+struct gfs2_rgrp {
+ struct gfs2_meta_header rg_header;
+
+ __be32 rg_flags;
+ __be32 rg_free;
+ __be32 rg_dinodes;
+ __be32 __pad;
+ __be64 rg_igeneration;
+
+ __u8 rg_reserved[80]; /* Several fields from gfs1 now reserved */
+};
+
+/*
+ * quota linked list: user quotas and group quotas form two separate
+ * singly linked lists. ll_next stores uids or gids of next quotas in the
+ * linked list.
+
+Given the uid/gid, how to calculate the quota file offsets for the corresponding
+gfs2_quota structures on disk:
+
+for user quotas, given uid,
+offset = uid * sizeof(struct gfs2_quota);
+
+for group quotas, given gid,
+offset = (gid * sizeof(struct gfs2_quota)) + sizeof(struct gfs2_quota);
+
+
+ uid:0 gid:0 uid:12 gid:12 uid:17 gid:17 uid:5142 gid:5142
++-------+-------+ +-------+-------+ +-------+- - - -+ +- - - -+-------+
+| valid | valid | :: | valid | valid | :: | valid | inval | :: | inval | valid |
++-------+-------+ +-------+-------+ +-------+- - - -+ +- - - -+-------+
+next:12 next:12 next:17 next:5142 next:NULL next:NULL
+ | | | | |<-- user quota list |
+ \______|___________/ \______|___________/ group quota list -->|
+ | | |
+ \__________________/ \_______________________________________/
+
+*/
+
+/*
+ * quota structure
+ */
+
+struct gfs2_quota {
+ __be64 qu_limit;
+ __be64 qu_warn;
+ __be64 qu_value;
+ __be32 qu_ll_next; /* location of next quota in list */
+ __u8 qu_reserved[60];
+};
+
+/*
+ * dinode structure
+ */
+
+#define GFS2_MAX_META_HEIGHT 10
+#define GFS2_DIR_MAX_DEPTH 17
+
+#define DT2IF(dt) (((dt) << 12) & S_IFMT)
+#define IF2DT(sif) (((sif) & S_IFMT) >> 12)
+
+enum {
+ gfs2fl_Jdata = 0,
+ gfs2fl_ExHash = 1,
+ gfs2fl_Unused = 2,
+ gfs2fl_EaIndirect = 3,
+ gfs2fl_Directio = 4,
+ gfs2fl_Immutable = 5,
+ gfs2fl_AppendOnly = 6,
+ gfs2fl_NoAtime = 7,
+ gfs2fl_Sync = 8,
+ gfs2fl_System = 9,
+ gfs2fl_TruncInProg = 29,
+ gfs2fl_InheritDirectio = 30,
+ gfs2fl_InheritJdata = 31,
+};
+
+/* Dinode flags */
+#define GFS2_DIF_JDATA 0x00000001
+#define GFS2_DIF_EXHASH 0x00000002
+#define GFS2_DIF_UNUSED 0x00000004 /* only in gfs1 */
+#define GFS2_DIF_EA_INDIRECT 0x00000008
+#define GFS2_DIF_DIRECTIO 0x00000010
+#define GFS2_DIF_IMMUTABLE 0x00000020
+#define GFS2_DIF_APPENDONLY 0x00000040
+#define GFS2_DIF_NOATIME 0x00000080
+#define GFS2_DIF_SYNC 0x00000100
+#define GFS2_DIF_SYSTEM 0x00000200 /* New in gfs2 */
+#define GFS2_DIF_TRUNC_IN_PROG 0x20000000 /* New in gfs2 */
+#define GFS2_DIF_INHERIT_DIRECTIO 0x40000000
+#define GFS2_DIF_INHERIT_JDATA 0x80000000
+
+struct gfs2_dinode {
+ struct gfs2_meta_header di_header;
+
+ struct gfs2_inum di_num;
+
+ __be32 di_mode; /* mode of file */
+ __be32 di_uid; /* owner's user id */
+ __be32 di_gid; /* owner's group id */
+ __be32 di_nlink; /* number of links to this file */
+ __be64 di_size; /* number of bytes in file */
+ __be64 di_blocks; /* number of blocks in file */
+ __be64 di_atime; /* time last accessed */
+ __be64 di_mtime; /* time last modified */
+ __be64 di_ctime; /* time last changed */
+ __be32 di_major; /* device major number */
+ __be32 di_minor; /* device minor number */
+
+ /* This section varies from gfs1. Padding added to align with
+ * remainder of dinode
+ */
+ __be64 di_goal_meta; /* rgrp to alloc from next */
+ __be64 di_goal_data; /* data block goal */
+ __be64 di_generation; /* generation number for NFS */
+
+ __be32 di_flags; /* GFS2_DIF_... */
+ __be32 di_payload_format; /* GFS2_FORMAT_... */
+ __u16 __pad1; /* Was ditype in gfs1 */
+ __be16 di_height; /* height of metadata */
+ __u32 __pad2; /* Unused incarnation number from gfs1 */
+
+ /* These only apply to directories */
+ __u16 __pad3; /* Padding */
+ __be16 di_depth; /* Number of bits in the table */
+ __be32 di_entries; /* The number of entries in the directory */
+
+ struct gfs2_inum __pad4; /* Unused even in current gfs1 */
+
+ __be64 di_eattr; /* extended attribute block number */
+ __be32 di_atime_nsec; /* nsec portion of atime */
+ __be32 di_mtime_nsec; /* nsec portion of mtime */
+ __be32 di_ctime_nsec; /* nsec portion of ctime */
+
+ __u8 di_reserved[44];
+};
+
+/*
+ * directory structure - many of these per directory file
+ */
+
+#define GFS2_FNAMESIZE 255
+#define GFS2_DIRENT_SIZE(name_len) ((sizeof(struct gfs2_dirent) + (name_len) + 7) & ~7)
+
+struct gfs2_dirent {
+ struct gfs2_inum de_inum;
+ __be32 de_hash;
+ __be16 de_rec_len;
+ __be16 de_name_len;
+ __be16 de_type;
+ __u8 __pad[14];
+};
+
+/*
+ * Header of leaf directory nodes
+ */
+
+struct gfs2_leaf {
+ struct gfs2_meta_header lf_header;
+
+ __be16 lf_depth; /* Depth of leaf */
+ __be16 lf_entries; /* Number of dirents in leaf */
+ __be32 lf_dirent_format; /* Format of the dirents */
+ __be64 lf_next; /* Next leaf, if overflow */
+
+ __u8 lf_reserved[64];
+};
+
+/*
+ * Extended attribute header format
+ */
+
+#define GFS2_EA_MAX_NAME_LEN 255
+#define GFS2_EA_MAX_DATA_LEN 65536
+
+#define GFS2_EATYPE_UNUSED 0
+#define GFS2_EATYPE_USR 1
+#define GFS2_EATYPE_SYS 2
+#define GFS2_EATYPE_SECURITY 3
+
+#define GFS2_EATYPE_LAST 3
+#define GFS2_EATYPE_VALID(x) ((x) <= GFS2_EATYPE_LAST)
+
+#define GFS2_EAFLAG_LAST 0x01 /* last ea in block */
+
+struct gfs2_ea_header {
+ __be32 ea_rec_len;
+ __be32 ea_data_len;
+ __u8 ea_name_len; /* no NULL pointer after the string */
+ __u8 ea_type; /* GFS2_EATYPE_... */
+ __u8 ea_flags; /* GFS2_EAFLAG_... */
+ __u8 ea_num_ptrs;
+ __u32 __pad;
+};
+
+/*
+ * Log header structure
+ */
+
+#define GFS2_LOG_HEAD_UNMOUNT 0x00000001 /* log is clean */
+
+struct gfs2_log_header {
+ struct gfs2_meta_header lh_header;
+
+ __be64 lh_sequence; /* Sequence number of this transaction */
+ __be32 lh_flags; /* GFS2_LOG_HEAD_... */
+ __be32 lh_tail; /* Block number of log tail */
+ __be32 lh_blkno;
+ __be32 lh_hash;
+};
+
+/*
+ * Log type descriptor
+ */
+
+#define GFS2_LOG_DESC_METADATA 300
+/* ld_data1 is the number of metadata blocks in the descriptor.
+ ld_data2 is unused. */
+
+#define GFS2_LOG_DESC_REVOKE 301
+/* ld_data1 is the number of revoke blocks in the descriptor.
+ ld_data2 is unused. */
+
+#define GFS2_LOG_DESC_JDATA 302
+/* ld_data1 is the number of data blocks in the descriptor.
+ ld_data2 is unused. */
+
+struct gfs2_log_descriptor {
+ struct gfs2_meta_header ld_header;
+
+ __be32 ld_type; /* GFS2_LOG_DESC_... */
+ __be32 ld_length; /* Number of buffers in this chunk */
+ __be32 ld_data1; /* descriptor-specific field */
+ __be32 ld_data2; /* descriptor-specific field */
+
+ __u8 ld_reserved[32];
+};
+
+/*
+ * Inum Range
+ * Describe a range of formal inode numbers allocated to
+ * one machine to assign to inodes.
+ */
+
+#define GFS2_INUM_QUANTUM 1048576
+
+struct gfs2_inum_range {
+ __be64 ir_start;
+ __be64 ir_length;
+};
+
+/*
+ * Statfs change
+ * Describes an change to the pool of free and allocated
+ * blocks.
+ */
+
+struct gfs2_statfs_change {
+ __be64 sc_total;
+ __be64 sc_free;
+ __be64 sc_dinodes;
+};
+
+/*
+ * Quota change
+ * Describes an allocation change for a particular
+ * user or group.
+ */
+
+#define GFS2_QCF_USER 0x00000001
+
+struct gfs2_quota_change {
+ __be64 qc_change;
+ __be32 qc_flags; /* GFS2_QCF_... */
+ __be32 qc_id;
+};
+
+struct gfs2_quota_lvb {
+ __be32 qb_magic;
+ __u32 __pad;
+ __be64 qb_limit; /* Hard limit of # blocks to alloc */
+ __be64 qb_warn; /* Warn user when alloc is above this # */
+ __be64 qb_value; /* Current # blocks allocated */
+};
+
+#endif /* __GFS2_ONDISK_DOT_H__ */
diff --git a/sysroot/usr/include/linux/gigaset_dev.h b/sysroot/usr/include/linux/gigaset_dev.h
new file mode 100644
index 0000000..5dc4a31
--- /dev/null
+++ b/sysroot/usr/include/linux/gigaset_dev.h
@@ -0,0 +1,30 @@
+/*
+ * interface to user space for the gigaset driver
+ *
+ * Copyright (c) 2004 by Hansjoerg Lipp <hjlipp@web.de>
+ *
+ * =====================================================================
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ * =====================================================================
+ */
+
+#ifndef GIGASET_INTERFACE_H
+#define GIGASET_INTERFACE_H
+
+#include <linux/ioctl.h>
+
+#define GIGASET_IOCTL 0x47
+
+#define GIGVER_DRIVER 0
+#define GIGVER_COMPAT 1
+#define GIGVER_FWBASE 2
+
+#define GIGASET_REDIR _IOWR (GIGASET_IOCTL, 0, int)
+#define GIGASET_CONFIG _IOWR (GIGASET_IOCTL, 1, int)
+#define GIGASET_BRKCHARS _IOW (GIGASET_IOCTL, 2, unsigned char[6]) //FIXME [6] okay?
+#define GIGASET_VERSION _IOWR (GIGASET_IOCTL, 3, unsigned[4])
+
+#endif
diff --git a/sysroot/usr/include/linux/hayesesp.h b/sysroot/usr/include/linux/hayesesp.h
new file mode 100644
index 0000000..59d744d
--- /dev/null
+++ b/sysroot/usr/include/linux/hayesesp.h
@@ -0,0 +1,17 @@
+#ifndef HAYESESP_H
+#define HAYESESP_H
+
+struct hayes_esp_config {
+ short flow_on;
+ short flow_off;
+ short rx_trigger;
+ short tx_trigger;
+ short pio_threshold;
+ unsigned char rx_timeout;
+ char dma_channel;
+};
+
+
+
+#endif /* ESP_H */
+
diff --git a/sysroot/usr/include/linux/hdlc.h b/sysroot/usr/include/linux/hdlc.h
new file mode 100644
index 0000000..89e484d
--- /dev/null
+++ b/sysroot/usr/include/linux/hdlc.h
@@ -0,0 +1,23 @@
+/*
+ * Generic HDLC support routines for Linux
+ *
+ * Copyright (C) 1999-2005 Krzysztof Halasa <khc@pm.waw.pl>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License
+ * as published by the Free Software Foundation.
+ */
+
+#ifndef __HDLC_H
+#define __HDLC_H
+
+
+#define HDLC_MAX_MTU 1500 /* Ethernet 1500 bytes */
+#if 0
+#define HDLC_MAX_MRU (HDLC_MAX_MTU + 10 + 14 + 4) /* for ETH+VLAN over FR */
+#else
+#define HDLC_MAX_MRU 1600 /* as required for FR network */
+#endif
+
+
+#endif /* __HDLC_H */
diff --git a/sysroot/usr/include/linux/hdlc/ioctl.h b/sysroot/usr/include/linux/hdlc/ioctl.h
new file mode 100644
index 0000000..5839723
--- /dev/null
+++ b/sysroot/usr/include/linux/hdlc/ioctl.h
@@ -0,0 +1,81 @@
+#ifndef __HDLC_IOCTL_H__
+#define __HDLC_IOCTL_H__
+
+
+#define GENERIC_HDLC_VERSION 4 /* For synchronization with sethdlc utility */
+
+#define CLOCK_DEFAULT 0 /* Default setting */
+#define CLOCK_EXT 1 /* External TX and RX clock - DTE */
+#define CLOCK_INT 2 /* Internal TX and RX clock - DCE */
+#define CLOCK_TXINT 3 /* Internal TX and external RX clock */
+#define CLOCK_TXFROMRX 4 /* TX clock derived from external RX clock */
+
+
+#define ENCODING_DEFAULT 0 /* Default setting */
+#define ENCODING_NRZ 1
+#define ENCODING_NRZI 2
+#define ENCODING_FM_MARK 3
+#define ENCODING_FM_SPACE 4
+#define ENCODING_MANCHESTER 5
+
+
+#define PARITY_DEFAULT 0 /* Default setting */
+#define PARITY_NONE 1 /* No parity */
+#define PARITY_CRC16_PR0 2 /* CRC16, initial value 0x0000 */
+#define PARITY_CRC16_PR1 3 /* CRC16, initial value 0xFFFF */
+#define PARITY_CRC16_PR0_CCITT 4 /* CRC16, initial 0x0000, ITU-T version */
+#define PARITY_CRC16_PR1_CCITT 5 /* CRC16, initial 0xFFFF, ITU-T version */
+#define PARITY_CRC32_PR0_CCITT 6 /* CRC32, initial value 0x00000000 */
+#define PARITY_CRC32_PR1_CCITT 7 /* CRC32, initial value 0xFFFFFFFF */
+
+#define LMI_DEFAULT 0 /* Default setting */
+#define LMI_NONE 1 /* No LMI, all PVCs are static */
+#define LMI_ANSI 2 /* ANSI Annex D */
+#define LMI_CCITT 3 /* ITU-T Annex A */
+#define LMI_CISCO 4 /* The "original" LMI, aka Gang of Four */
+
+typedef struct {
+ unsigned int clock_rate; /* bits per second */
+ unsigned int clock_type; /* internal, external, TX-internal etc. */
+ unsigned short loopback;
+} sync_serial_settings; /* V.35, V.24, X.21 */
+
+typedef struct {
+ unsigned int clock_rate; /* bits per second */
+ unsigned int clock_type; /* internal, external, TX-internal etc. */
+ unsigned short loopback;
+ unsigned int slot_map;
+} te1_settings; /* T1, E1 */
+
+typedef struct {
+ unsigned short encoding;
+ unsigned short parity;
+} raw_hdlc_proto;
+
+typedef struct {
+ unsigned int t391;
+ unsigned int t392;
+ unsigned int n391;
+ unsigned int n392;
+ unsigned int n393;
+ unsigned short lmi;
+ unsigned short dce; /* 1 for DCE (network side) operation */
+} fr_proto;
+
+typedef struct {
+ unsigned int dlci;
+} fr_proto_pvc; /* for creating/deleting FR PVCs */
+
+typedef struct {
+ unsigned int dlci;
+ char master[IFNAMSIZ]; /* Name of master FRAD device */
+}fr_proto_pvc_info; /* for returning PVC information only */
+
+typedef struct {
+ unsigned int interval;
+ unsigned int timeout;
+} cisco_proto;
+
+/* PPP doesn't need any info now - supply length = 0 to ioctl */
+
+#endif /* __HDLC_IOCTL_H__ */
diff --git a/sysroot/usr/include/linux/hdlcdrv.h b/sysroot/usr/include/linux/hdlcdrv.h
new file mode 100644
index 0000000..422d965
--- /dev/null
+++ b/sysroot/usr/include/linux/hdlcdrv.h
@@ -0,0 +1,110 @@
+/*
+ * hdlcdrv.h -- HDLC packet radio network driver.
+ * The Linux soundcard driver for 1200 baud and 9600 baud packet radio
+ * (C) 1996-1998 by Thomas Sailer, HB9JNX/AE4WA
+ */
+
+#ifndef _HDLCDRV_H
+#define _HDLCDRV_H
+
+/* -------------------------------------------------------------------- */
+/*
+ * structs for the IOCTL commands
+ */
+
+struct hdlcdrv_params {
+ int iobase;
+ int irq;
+ int dma;
+ int dma2;
+ int seriobase;
+ int pariobase;
+ int midiiobase;
+};
+
+struct hdlcdrv_channel_params {
+ int tx_delay; /* the transmitter keyup delay in 10ms units */
+ int tx_tail; /* the transmitter keyoff delay in 10ms units */
+ int slottime; /* the slottime in 10ms; usually 10 = 100ms */
+ int ppersist; /* the p-persistence 0..255 */
+ int fulldup; /* some driver do not support full duplex, setting */
+ /* this just makes them send even if DCD is on */
+};
+
+struct hdlcdrv_old_channel_state {
+ int ptt;
+ int dcd;
+ int ptt_keyed;
+};
+
+struct hdlcdrv_channel_state {
+ int ptt;
+ int dcd;
+ int ptt_keyed;
+ unsigned long tx_packets;
+ unsigned long tx_errors;
+ unsigned long rx_packets;
+ unsigned long rx_errors;
+};
+
+struct hdlcdrv_ioctl {
+ int cmd;
+ union {
+ struct hdlcdrv_params mp;
+ struct hdlcdrv_channel_params cp;
+ struct hdlcdrv_channel_state cs;
+ struct hdlcdrv_old_channel_state ocs;
+ unsigned int calibrate;
+ unsigned char bits;
+ char modename[128];
+ char drivername[32];
+ } data;
+};
+
+/* -------------------------------------------------------------------- */
+
+/*
+ * ioctl values
+ */
+#define HDLCDRVCTL_GETMODEMPAR 0
+#define HDLCDRVCTL_SETMODEMPAR 1
+#define HDLCDRVCTL_MODEMPARMASK 2 /* not handled by hdlcdrv */
+#define HDLCDRVCTL_GETCHANNELPAR 10
+#define HDLCDRVCTL_SETCHANNELPAR 11
+#define HDLCDRVCTL_OLDGETSTAT 20
+#define HDLCDRVCTL_CALIBRATE 21
+#define HDLCDRVCTL_GETSTAT 22
+
+/*
+ * these are mainly for debugging purposes
+ */
+#define HDLCDRVCTL_GETSAMPLES 30
+#define HDLCDRVCTL_GETBITS 31
+
+/*
+ * not handled by hdlcdrv, but by its depending drivers
+ */
+#define HDLCDRVCTL_GETMODE 40
+#define HDLCDRVCTL_SETMODE 41
+#define HDLCDRVCTL_MODELIST 42
+#define HDLCDRVCTL_DRIVERNAME 43
+
+/*
+ * mask of needed modem parameters, returned by HDLCDRVCTL_MODEMPARMASK
+ */
+#define HDLCDRV_PARMASK_IOBASE (1<<0)
+#define HDLCDRV_PARMASK_IRQ (1<<1)
+#define HDLCDRV_PARMASK_DMA (1<<2)
+#define HDLCDRV_PARMASK_DMA2 (1<<3)
+#define HDLCDRV_PARMASK_SERIOBASE (1<<4)
+#define HDLCDRV_PARMASK_PARIOBASE (1<<5)
+#define HDLCDRV_PARMASK_MIDIIOBASE (1<<6)
+
+/* -------------------------------------------------------------------- */
+
+
+/* -------------------------------------------------------------------- */
+
+#endif /* _HDLCDRV_H */
+
+/* -------------------------------------------------------------------- */
diff --git a/sysroot/usr/include/linux/hdreg.h b/sysroot/usr/include/linux/hdreg.h
new file mode 100644
index 0000000..8f45225
--- /dev/null
+++ b/sysroot/usr/include/linux/hdreg.h
@@ -0,0 +1,647 @@
+#ifndef _LINUX_HDREG_H
+#define _LINUX_HDREG_H
+
+
+#include <linux/types.h>
+
+/*
+ * Command Header sizes for IOCTL commands
+ */
+
+#define HDIO_DRIVE_CMD_HDR_SIZE (4 * sizeof(__u8))
+#define HDIO_DRIVE_HOB_HDR_SIZE (8 * sizeof(__u8))
+#define HDIO_DRIVE_TASK_HDR_SIZE (8 * sizeof(__u8))
+
+#define IDE_DRIVE_TASK_INVALID -1
+#define IDE_DRIVE_TASK_NO_DATA 0
+#define IDE_DRIVE_TASK_SET_XFER 1
+
+#define IDE_DRIVE_TASK_IN 2
+
+#define IDE_DRIVE_TASK_OUT 3
+#define IDE_DRIVE_TASK_RAW_WRITE 4
+
+/*
+ * Define standard taskfile in/out register
+ */
+#define IDE_TASKFILE_STD_IN_FLAGS 0xFE
+#define IDE_HOB_STD_IN_FLAGS 0x3C
+#define IDE_TASKFILE_STD_OUT_FLAGS 0xFE
+#define IDE_HOB_STD_OUT_FLAGS 0x3C
+
+typedef unsigned char task_ioreg_t;
+typedef unsigned long sata_ioreg_t;
+
+typedef union ide_reg_valid_s {
+ unsigned all : 16;
+ struct {
+ unsigned data : 1;
+ unsigned error_feature : 1;
+ unsigned sector : 1;
+ unsigned nsector : 1;
+ unsigned lcyl : 1;
+ unsigned hcyl : 1;
+ unsigned select : 1;
+ unsigned status_command : 1;
+
+ unsigned data_hob : 1;
+ unsigned error_feature_hob : 1;
+ unsigned sector_hob : 1;
+ unsigned nsector_hob : 1;
+ unsigned lcyl_hob : 1;
+ unsigned hcyl_hob : 1;
+ unsigned select_hob : 1;
+ unsigned control_hob : 1;
+ } b;
+} ide_reg_valid_t;
+
+typedef struct ide_task_request_s {
+ task_ioreg_t io_ports[8];
+ task_ioreg_t hob_ports[8];
+ ide_reg_valid_t out_flags;
+ ide_reg_valid_t in_flags;
+ int data_phase;
+ int req_cmd;
+ unsigned long out_size;
+ unsigned long in_size;
+} ide_task_request_t;
+
+typedef struct ide_ioctl_request_s {
+ ide_task_request_t *task_request;
+ unsigned char *out_buffer;
+ unsigned char *in_buffer;
+} ide_ioctl_request_t;
+
+struct hd_drive_cmd_hdr {
+ task_ioreg_t command;
+ task_ioreg_t sector_number;
+ task_ioreg_t feature;
+ task_ioreg_t sector_count;
+};
+
+typedef struct hd_drive_task_hdr {
+ task_ioreg_t data;
+ task_ioreg_t feature;
+ task_ioreg_t sector_count;
+ task_ioreg_t sector_number;
+ task_ioreg_t low_cylinder;
+ task_ioreg_t high_cylinder;
+ task_ioreg_t device_head;
+ task_ioreg_t command;
+} task_struct_t;
+
+typedef struct hd_drive_hob_hdr {
+ task_ioreg_t data;
+ task_ioreg_t feature;
+ task_ioreg_t sector_count;
+ task_ioreg_t sector_number;
+ task_ioreg_t low_cylinder;
+ task_ioreg_t high_cylinder;
+ task_ioreg_t device_head;
+ task_ioreg_t control;
+} hob_struct_t;
+
+#define TASKFILE_INVALID 0x7fff
+#define TASKFILE_48 0x8000
+
+#define TASKFILE_NO_DATA 0x0000
+
+#define TASKFILE_IN 0x0001
+#define TASKFILE_MULTI_IN 0x0002
+
+#define TASKFILE_OUT 0x0004
+#define TASKFILE_MULTI_OUT 0x0008
+#define TASKFILE_IN_OUT 0x0010
+
+#define TASKFILE_IN_DMA 0x0020
+#define TASKFILE_OUT_DMA 0x0040
+#define TASKFILE_IN_DMAQ 0x0080
+#define TASKFILE_OUT_DMAQ 0x0100
+
+#define TASKFILE_P_IN 0x0200
+#define TASKFILE_P_OUT 0x0400
+#define TASKFILE_P_IN_DMA 0x0800
+#define TASKFILE_P_OUT_DMA 0x1000
+#define TASKFILE_P_IN_DMAQ 0x2000
+#define TASKFILE_P_OUT_DMAQ 0x4000
+
+/* ATA/ATAPI Commands pre T13 Spec */
+#define WIN_NOP 0x00
+/*
+ * 0x01->0x02 Reserved
+ */
+#define CFA_REQ_EXT_ERROR_CODE 0x03 /* CFA Request Extended Error Code */
+/*
+ * 0x04->0x07 Reserved
+ */
+#define WIN_SRST 0x08 /* ATAPI soft reset command */
+#define WIN_DEVICE_RESET 0x08
+/*
+ * 0x09->0x0F Reserved
+ */
+#define WIN_RECAL 0x10
+#define WIN_RESTORE WIN_RECAL
+/*
+ * 0x10->0x1F Reserved
+ */
+#define WIN_READ 0x20 /* 28-Bit */
+#define WIN_READ_ONCE 0x21 /* 28-Bit without retries */
+#define WIN_READ_LONG 0x22 /* 28-Bit */
+#define WIN_READ_LONG_ONCE 0x23 /* 28-Bit without retries */
+#define WIN_READ_EXT 0x24 /* 48-Bit */
+#define WIN_READDMA_EXT 0x25 /* 48-Bit */
+#define WIN_READDMA_QUEUED_EXT 0x26 /* 48-Bit */
+#define WIN_READ_NATIVE_MAX_EXT 0x27 /* 48-Bit */
+/*
+ * 0x28
+ */
+#define WIN_MULTREAD_EXT 0x29 /* 48-Bit */
+/*
+ * 0x2A->0x2F Reserved
+ */
+#define WIN_WRITE 0x30 /* 28-Bit */
+#define WIN_WRITE_ONCE 0x31 /* 28-Bit without retries */
+#define WIN_WRITE_LONG 0x32 /* 28-Bit */
+#define WIN_WRITE_LONG_ONCE 0x33 /* 28-Bit without retries */
+#define WIN_WRITE_EXT 0x34 /* 48-Bit */
+#define WIN_WRITEDMA_EXT 0x35 /* 48-Bit */
+#define WIN_WRITEDMA_QUEUED_EXT 0x36 /* 48-Bit */
+#define WIN_SET_MAX_EXT 0x37 /* 48-Bit */
+#define CFA_WRITE_SECT_WO_ERASE 0x38 /* CFA Write Sectors without erase */
+#define WIN_MULTWRITE_EXT 0x39 /* 48-Bit */
+/*
+ * 0x3A->0x3B Reserved
+ */
+#define WIN_WRITE_VERIFY 0x3C /* 28-Bit */
+/*
+ * 0x3D->0x3F Reserved
+ */
+#define WIN_VERIFY 0x40 /* 28-Bit - Read Verify Sectors */
+#define WIN_VERIFY_ONCE 0x41 /* 28-Bit - without retries */
+#define WIN_VERIFY_EXT 0x42 /* 48-Bit */
+/*
+ * 0x43->0x4F Reserved
+ */
+#define WIN_FORMAT 0x50
+/*
+ * 0x51->0x5F Reserved
+ */
+#define WIN_INIT 0x60
+/*
+ * 0x61->0x5F Reserved
+ */
+#define WIN_SEEK 0x70 /* 0x70-0x7F Reserved */
+
+#define CFA_TRANSLATE_SECTOR 0x87 /* CFA Translate Sector */
+#define WIN_DIAGNOSE 0x90
+#define WIN_SPECIFY 0x91 /* set drive geometry translation */
+#define WIN_DOWNLOAD_MICROCODE 0x92
+#define WIN_STANDBYNOW2 0x94
+#define WIN_STANDBY2 0x96
+#define WIN_SETIDLE2 0x97
+#define WIN_CHECKPOWERMODE2 0x98
+#define WIN_SLEEPNOW2 0x99
+/*
+ * 0x9A VENDOR
+ */
+#define WIN_PACKETCMD 0xA0 /* Send a packet command. */
+#define WIN_PIDENTIFY 0xA1 /* identify ATAPI device */
+#define WIN_QUEUED_SERVICE 0xA2
+#define WIN_SMART 0xB0 /* self-monitoring and reporting */
+#define CFA_ERASE_SECTORS 0xC0
+#define WIN_MULTREAD 0xC4 /* read sectors using multiple mode*/
+#define WIN_MULTWRITE 0xC5 /* write sectors using multiple mode */
+#define WIN_SETMULT 0xC6 /* enable/disable multiple mode */
+#define WIN_READDMA_QUEUED 0xC7 /* read sectors using Queued DMA transfers */
+#define WIN_READDMA 0xC8 /* read sectors using DMA transfers */
+#define WIN_READDMA_ONCE 0xC9 /* 28-Bit - without retries */
+#define WIN_WRITEDMA 0xCA /* write sectors using DMA transfers */
+#define WIN_WRITEDMA_ONCE 0xCB /* 28-Bit - without retries */
+#define WIN_WRITEDMA_QUEUED 0xCC /* write sectors using Queued DMA transfers */
+#define CFA_WRITE_MULTI_WO_ERASE 0xCD /* CFA Write multiple without erase */
+#define WIN_GETMEDIASTATUS 0xDA
+#define WIN_ACKMEDIACHANGE 0xDB /* ATA-1, ATA-2 vendor */
+#define WIN_POSTBOOT 0xDC
+#define WIN_PREBOOT 0xDD
+#define WIN_DOORLOCK 0xDE /* lock door on removable drives */
+#define WIN_DOORUNLOCK 0xDF /* unlock door on removable drives */
+#define WIN_STANDBYNOW1 0xE0
+#define WIN_IDLEIMMEDIATE 0xE1 /* force drive to become "ready" */
+#define WIN_STANDBY 0xE2 /* Set device in Standby Mode */
+#define WIN_SETIDLE1 0xE3
+#define WIN_READ_BUFFER 0xE4 /* force read only 1 sector */
+#define WIN_CHECKPOWERMODE1 0xE5
+#define WIN_SLEEPNOW1 0xE6
+#define WIN_FLUSH_CACHE 0xE7
+#define WIN_WRITE_BUFFER 0xE8 /* force write only 1 sector */
+#define WIN_WRITE_SAME 0xE9 /* read ata-2 to use */
+ /* SET_FEATURES 0x22 or 0xDD */
+#define WIN_FLUSH_CACHE_EXT 0xEA /* 48-Bit */
+#define WIN_IDENTIFY 0xEC /* ask drive to identify itself */
+#define WIN_MEDIAEJECT 0xED
+#define WIN_IDENTIFY_DMA 0xEE /* same as WIN_IDENTIFY, but DMA */
+#define WIN_SETFEATURES 0xEF /* set special drive features */
+#define EXABYTE_ENABLE_NEST 0xF0
+#define WIN_SECURITY_SET_PASS 0xF1
+#define WIN_SECURITY_UNLOCK 0xF2
+#define WIN_SECURITY_ERASE_PREPARE 0xF3
+#define WIN_SECURITY_ERASE_UNIT 0xF4
+#define WIN_SECURITY_FREEZE_LOCK 0xF5
+#define WIN_SECURITY_DISABLE 0xF6
+#define WIN_READ_NATIVE_MAX 0xF8 /* return the native maximum address */
+#define WIN_SET_MAX 0xF9
+#define DISABLE_SEAGATE 0xFB
+
+/* WIN_SMART sub-commands */
+
+#define SMART_READ_VALUES 0xD0
+#define SMART_READ_THRESHOLDS 0xD1
+#define SMART_AUTOSAVE 0xD2
+#define SMART_SAVE 0xD3
+#define SMART_IMMEDIATE_OFFLINE 0xD4
+#define SMART_READ_LOG_SECTOR 0xD5
+#define SMART_WRITE_LOG_SECTOR 0xD6
+#define SMART_WRITE_THRESHOLDS 0xD7
+#define SMART_ENABLE 0xD8
+#define SMART_DISABLE 0xD9
+#define SMART_STATUS 0xDA
+#define SMART_AUTO_OFFLINE 0xDB
+
+/* Password used in TF4 & TF5 executing SMART commands */
+
+#define SMART_LCYL_PASS 0x4F
+#define SMART_HCYL_PASS 0xC2
+
+/* WIN_SETFEATURES sub-commands */
+#define SETFEATURES_EN_8BIT 0x01 /* Enable 8-Bit Transfers */
+#define SETFEATURES_EN_WCACHE 0x02 /* Enable write cache */
+#define SETFEATURES_DIS_DEFECT 0x04 /* Disable Defect Management */
+#define SETFEATURES_EN_APM 0x05 /* Enable advanced power management */
+#define SETFEATURES_EN_SAME_R 0x22 /* for a region ATA-1 */
+#define SETFEATURES_DIS_MSN 0x31 /* Disable Media Status Notification */
+#define SETFEATURES_DIS_RETRY 0x33 /* Disable Retry */
+#define SETFEATURES_EN_AAM 0x42 /* Enable Automatic Acoustic Management */
+#define SETFEATURES_RW_LONG 0x44 /* Set Length of VS bytes */
+#define SETFEATURES_SET_CACHE 0x54 /* Set Cache segments to SC Reg. Val */
+#define SETFEATURES_DIS_RLA 0x55 /* Disable read look-ahead feature */
+#define SETFEATURES_EN_RI 0x5D /* Enable release interrupt */
+#define SETFEATURES_EN_SI 0x5E /* Enable SERVICE interrupt */
+#define SETFEATURES_DIS_RPOD 0x66 /* Disable reverting to power on defaults */
+#define SETFEATURES_DIS_ECC 0x77 /* Disable ECC byte count */
+#define SETFEATURES_DIS_8BIT 0x81 /* Disable 8-Bit Transfers */
+#define SETFEATURES_DIS_WCACHE 0x82 /* Disable write cache */
+#define SETFEATURES_EN_DEFECT 0x84 /* Enable Defect Management */
+#define SETFEATURES_DIS_APM 0x85 /* Disable advanced power management */
+#define SETFEATURES_EN_ECC 0x88 /* Enable ECC byte count */
+#define SETFEATURES_EN_MSN 0x95 /* Enable Media Status Notification */
+#define SETFEATURES_EN_RETRY 0x99 /* Enable Retry */
+#define SETFEATURES_EN_RLA 0xAA /* Enable read look-ahead feature */
+#define SETFEATURES_PREFETCH 0xAB /* Sets drive prefetch value */
+#define SETFEATURES_EN_REST 0xAC /* ATA-1 */
+#define SETFEATURES_4B_RW_LONG 0xBB /* Set Lenght of 4 bytes */
+#define SETFEATURES_DIS_AAM 0xC2 /* Disable Automatic Acoustic Management */
+#define SETFEATURES_EN_RPOD 0xCC /* Enable reverting to power on defaults */
+#define SETFEATURES_DIS_RI 0xDD /* Disable release interrupt ATAPI */
+#define SETFEATURES_EN_SAME_M 0xDD /* for a entire device ATA-1 */
+#define SETFEATURES_DIS_SI 0xDE /* Disable SERVICE interrupt ATAPI */
+
+/* WIN_SECURITY sub-commands */
+
+#define SECURITY_SET_PASSWORD 0xBA
+#define SECURITY_UNLOCK 0xBB
+#define SECURITY_ERASE_PREPARE 0xBC
+#define SECURITY_ERASE_UNIT 0xBD
+#define SECURITY_FREEZE_LOCK 0xBE
+#define SECURITY_DISABLE_PASSWORD 0xBF
+
+struct hd_geometry {
+ unsigned char heads;
+ unsigned char sectors;
+ unsigned short cylinders;
+ unsigned long start;
+};
+
+/* hd/ide ctl's that pass (arg) ptrs to user space are numbered 0x030n/0x031n */
+#define HDIO_GETGEO 0x0301 /* get device geometry */
+#define HDIO_GET_UNMASKINTR 0x0302 /* get current unmask setting */
+#define HDIO_GET_MULTCOUNT 0x0304 /* get current IDE blockmode setting */
+#define HDIO_GET_QDMA 0x0305 /* get use-qdma flag */
+
+#define HDIO_SET_XFER 0x0306 /* set transfer rate via proc */
+
+#define HDIO_OBSOLETE_IDENTITY 0x0307 /* OBSOLETE, DO NOT USE: returns 142 bytes */
+#define HDIO_GET_KEEPSETTINGS 0x0308 /* get keep-settings-on-reset flag */
+#define HDIO_GET_32BIT 0x0309 /* get current io_32bit setting */
+#define HDIO_GET_NOWERR 0x030a /* get ignore-write-error flag */
+#define HDIO_GET_DMA 0x030b /* get use-dma flag */
+#define HDIO_GET_NICE 0x030c /* get nice flags */
+#define HDIO_GET_IDENTITY 0x030d /* get IDE identification info */
+#define HDIO_GET_WCACHE 0x030e /* get write cache mode on|off */
+#define HDIO_GET_ACOUSTIC 0x030f /* get acoustic value */
+#define HDIO_GET_ADDRESS 0x0310 /* */
+
+#define HDIO_GET_BUSSTATE 0x031a /* get the bus state of the hwif */
+#define HDIO_TRISTATE_HWIF 0x031b /* execute a channel tristate */
+#define HDIO_DRIVE_RESET 0x031c /* execute a device reset */
+#define HDIO_DRIVE_TASKFILE 0x031d /* execute raw taskfile */
+#define HDIO_DRIVE_TASK 0x031e /* execute task and special drive command */
+#define HDIO_DRIVE_CMD 0x031f /* execute a special drive command */
+#define HDIO_DRIVE_CMD_AEB HDIO_DRIVE_TASK
+
+/* hd/ide ctl's that pass (arg) non-ptr values are numbered 0x032n/0x033n */
+#define HDIO_SET_MULTCOUNT 0x0321 /* change IDE blockmode */
+#define HDIO_SET_UNMASKINTR 0x0322 /* permit other irqs during I/O */
+#define HDIO_SET_KEEPSETTINGS 0x0323 /* keep ioctl settings on reset */
+#define HDIO_SET_32BIT 0x0324 /* change io_32bit flags */
+#define HDIO_SET_NOWERR 0x0325 /* change ignore-write-error flag */
+#define HDIO_SET_DMA 0x0326 /* change use-dma flag */
+#define HDIO_SET_PIO_MODE 0x0327 /* reconfig interface to new speed */
+#define HDIO_SCAN_HWIF 0x0328 /* register and (re)scan interface */
+#define HDIO_SET_NICE 0x0329 /* set nice flags */
+#define HDIO_UNREGISTER_HWIF 0x032a /* unregister interface */
+#define HDIO_SET_WCACHE 0x032b /* change write cache enable-disable */
+#define HDIO_SET_ACOUSTIC 0x032c /* change acoustic behavior */
+#define HDIO_SET_BUSSTATE 0x032d /* set the bus state of the hwif */
+#define HDIO_SET_QDMA 0x032e /* change use-qdma flag */
+#define HDIO_SET_ADDRESS 0x032f /* change lba addressing modes */
+
+/* bus states */
+enum {
+ BUSSTATE_OFF = 0,
+ BUSSTATE_ON,
+ BUSSTATE_TRISTATE
+};
+
+/* hd/ide ctl's that pass (arg) ptrs to user space are numbered 0x033n/0x033n */
+/* 0x330 is reserved - used to be HDIO_GETGEO_BIG */
+/* 0x331 is reserved - used to be HDIO_GETGEO_BIG_RAW */
+/* 0x338 is reserved - used to be HDIO_SET_IDE_SCSI */
+/* 0x339 is reserved - used to be HDIO_SET_SCSI_IDE */
+
+#define __NEW_HD_DRIVE_ID
+
+/*
+ * Structure returned by HDIO_GET_IDENTITY, as per ANSI NCITS ATA6 rev.1b spec.
+ *
+ * If you change something here, please remember to update fix_driveid() in
+ * ide/probe.c.
+ */
+struct hd_driveid {
+ unsigned short config; /* lots of obsolete bit flags */
+ unsigned short cyls; /* Obsolete, "physical" cyls */
+ unsigned short reserved2; /* reserved (word 2) */
+ unsigned short heads; /* Obsolete, "physical" heads */
+ unsigned short track_bytes; /* unformatted bytes per track */
+ unsigned short sector_bytes; /* unformatted bytes per sector */
+ unsigned short sectors; /* Obsolete, "physical" sectors per track */
+ unsigned short vendor0; /* vendor unique */
+ unsigned short vendor1; /* vendor unique */
+ unsigned short vendor2; /* Retired vendor unique */
+ unsigned char serial_no[20]; /* 0 = not_specified */
+ unsigned short buf_type; /* Retired */
+ unsigned short buf_size; /* Retired, 512 byte increments
+ * 0 = not_specified
+ */
+ unsigned short ecc_bytes; /* for r/w long cmds; 0 = not_specified */
+ unsigned char fw_rev[8]; /* 0 = not_specified */
+ unsigned char model[40]; /* 0 = not_specified */
+ unsigned char max_multsect; /* 0=not_implemented */
+ unsigned char vendor3; /* vendor unique */
+ unsigned short dword_io; /* 0=not_implemented; 1=implemented */
+ unsigned char vendor4; /* vendor unique */
+ unsigned char capability; /* (upper byte of word 49)
+ * 3: IORDYsup
+ * 2: IORDYsw
+ * 1: LBA
+ * 0: DMA
+ */
+ unsigned short reserved50; /* reserved (word 50) */
+ unsigned char vendor5; /* Obsolete, vendor unique */
+ unsigned char tPIO; /* Obsolete, 0=slow, 1=medium, 2=fast */
+ unsigned char vendor6; /* Obsolete, vendor unique */
+ unsigned char tDMA; /* Obsolete, 0=slow, 1=medium, 2=fast */
+ unsigned short field_valid; /* (word 53)
+ * 2: ultra_ok word 88
+ * 1: eide_ok words 64-70
+ * 0: cur_ok words 54-58
+ */
+ unsigned short cur_cyls; /* Obsolete, logical cylinders */
+ unsigned short cur_heads; /* Obsolete, l heads */
+ unsigned short cur_sectors; /* Obsolete, l sectors per track */
+ unsigned short cur_capacity0; /* Obsolete, l total sectors on drive */
+ unsigned short cur_capacity1; /* Obsolete, (2 words, misaligned int) */
+ unsigned char multsect; /* current multiple sector count */
+ unsigned char multsect_valid; /* when (bit0==1) multsect is ok */
+ unsigned int lba_capacity; /* Obsolete, total number of sectors */
+ unsigned short dma_1word; /* Obsolete, single-word dma info */
+ unsigned short dma_mword; /* multiple-word dma info */
+ unsigned short eide_pio_modes; /* bits 0:mode3 1:mode4 */
+ unsigned short eide_dma_min; /* min mword dma cycle time (ns) */
+ unsigned short eide_dma_time; /* recommended mword dma cycle time (ns) */
+ unsigned short eide_pio; /* min cycle time (ns), no IORDY */
+ unsigned short eide_pio_iordy; /* min cycle time (ns), with IORDY */
+ unsigned short words69_70[2]; /* reserved words 69-70
+ * future command overlap and queuing
+ */
+ /* HDIO_GET_IDENTITY currently returns only words 0 through 70 */
+ unsigned short words71_74[4]; /* reserved words 71-74
+ * for IDENTIFY PACKET DEVICE command
+ */
+ unsigned short queue_depth; /* (word 75)
+ * 15:5 reserved
+ * 4:0 Maximum queue depth -1
+ */
+ unsigned short words76_79[4]; /* reserved words 76-79 */
+ unsigned short major_rev_num; /* (word 80) */
+ unsigned short minor_rev_num; /* (word 81) */
+ unsigned short command_set_1; /* (word 82) supported
+ * 15: Obsolete
+ * 14: NOP command
+ * 13: READ_BUFFER
+ * 12: WRITE_BUFFER
+ * 11: Obsolete
+ * 10: Host Protected Area
+ * 9: DEVICE Reset
+ * 8: SERVICE Interrupt
+ * 7: Release Interrupt
+ * 6: look-ahead
+ * 5: write cache
+ * 4: PACKET Command
+ * 3: Power Management Feature Set
+ * 2: Removable Feature Set
+ * 1: Security Feature Set
+ * 0: SMART Feature Set
+ */
+ unsigned short command_set_2; /* (word 83)
+ * 15: Shall be ZERO
+ * 14: Shall be ONE
+ * 13: FLUSH CACHE EXT
+ * 12: FLUSH CACHE
+ * 11: Device Configuration Overlay
+ * 10: 48-bit Address Feature Set
+ * 9: Automatic Acoustic Management
+ * 8: SET MAX security
+ * 7: reserved 1407DT PARTIES
+ * 6: SetF sub-command Power-Up
+ * 5: Power-Up in Standby Feature Set
+ * 4: Removable Media Notification
+ * 3: APM Feature Set
+ * 2: CFA Feature Set
+ * 1: READ/WRITE DMA QUEUED
+ * 0: Download MicroCode
+ */
+ unsigned short cfsse; /* (word 84)
+ * cmd set-feature supported extensions
+ * 15: Shall be ZERO
+ * 14: Shall be ONE
+ * 13:6 reserved
+ * 5: General Purpose Logging
+ * 4: Streaming Feature Set
+ * 3: Media Card Pass Through
+ * 2: Media Serial Number Valid
+ * 1: SMART selt-test supported
+ * 0: SMART error logging
+ */
+ unsigned short cfs_enable_1; /* (word 85)
+ * command set-feature enabled
+ * 15: Obsolete
+ * 14: NOP command
+ * 13: READ_BUFFER
+ * 12: WRITE_BUFFER
+ * 11: Obsolete
+ * 10: Host Protected Area
+ * 9: DEVICE Reset
+ * 8: SERVICE Interrupt
+ * 7: Release Interrupt
+ * 6: look-ahead
+ * 5: write cache
+ * 4: PACKET Command
+ * 3: Power Management Feature Set
+ * 2: Removable Feature Set
+ * 1: Security Feature Set
+ * 0: SMART Feature Set
+ */
+ unsigned short cfs_enable_2; /* (word 86)
+ * command set-feature enabled
+ * 15: Shall be ZERO
+ * 14: Shall be ONE
+ * 13: FLUSH CACHE EXT
+ * 12: FLUSH CACHE
+ * 11: Device Configuration Overlay
+ * 10: 48-bit Address Feature Set
+ * 9: Automatic Acoustic Management
+ * 8: SET MAX security
+ * 7: reserved 1407DT PARTIES
+ * 6: SetF sub-command Power-Up
+ * 5: Power-Up in Standby Feature Set
+ * 4: Removable Media Notification
+ * 3: APM Feature Set
+ * 2: CFA Feature Set
+ * 1: READ/WRITE DMA QUEUED
+ * 0: Download MicroCode
+ */
+ unsigned short csf_default; /* (word 87)
+ * command set-feature default
+ * 15: Shall be ZERO
+ * 14: Shall be ONE
+ * 13:6 reserved
+ * 5: General Purpose Logging enabled
+ * 4: Valid CONFIGURE STREAM executed
+ * 3: Media Card Pass Through enabled
+ * 2: Media Serial Number Valid
+ * 1: SMART selt-test supported
+ * 0: SMART error logging
+ */
+ unsigned short dma_ultra; /* (word 88) */
+ unsigned short trseuc; /* time required for security erase */
+ unsigned short trsEuc; /* time required for enhanced erase */
+ unsigned short CurAPMvalues; /* current APM values */
+ unsigned short mprc; /* master password revision code */
+ unsigned short hw_config; /* hardware config (word 93)
+ * 15: Shall be ZERO
+ * 14: Shall be ONE
+ * 13:
+ * 12:
+ * 11:
+ * 10:
+ * 9:
+ * 8:
+ * 7:
+ * 6:
+ * 5:
+ * 4:
+ * 3:
+ * 2:
+ * 1:
+ * 0: Shall be ONE
+ */
+ unsigned short acoustic; /* (word 94)
+ * 15:8 Vendor's recommended value
+ * 7:0 current value
+ */
+ unsigned short msrqs; /* min stream request size */
+ unsigned short sxfert; /* stream transfer time */
+ unsigned short sal; /* stream access latency */
+ unsigned int spg; /* stream performance granularity */
+ unsigned long long lba_capacity_2;/* 48-bit total number of sectors */
+ unsigned short words104_125[22];/* reserved words 104-125 */
+ unsigned short last_lun; /* (word 126) */
+ unsigned short word127; /* (word 127) Feature Set
+ * Removable Media Notification
+ * 15:2 reserved
+ * 1:0 00 = not supported
+ * 01 = supported
+ * 10 = reserved
+ * 11 = reserved
+ */
+ unsigned short dlf; /* (word 128)
+ * device lock function
+ * 15:9 reserved
+ * 8 security level 1:max 0:high
+ * 7:6 reserved
+ * 5 enhanced erase
+ * 4 expire
+ * 3 frozen
+ * 2 locked
+ * 1 en/disabled
+ * 0 capability
+ */
+ unsigned short csfo; /* (word 129)
+ * current set features options
+ * 15:4 reserved
+ * 3: auto reassign
+ * 2: reverting
+ * 1: read-look-ahead
+ * 0: write cache
+ */
+ unsigned short words130_155[26];/* reserved vendor words 130-155 */
+ unsigned short word156; /* reserved vendor word 156 */
+ unsigned short words157_159[3];/* reserved vendor words 157-159 */
+ unsigned short cfa_power; /* (word 160) CFA Power Mode
+ * 15 word 160 supported
+ * 14 reserved
+ * 13
+ * 12
+ * 11:0
+ */
+ unsigned short words161_175[15];/* Reserved for CFA */
+ unsigned short words176_205[30];/* Current Media Serial Number */
+ unsigned short words206_254[49];/* reserved words 206-254 */
+ unsigned short integrity_word; /* (word 255)
+ * 15:8 Checksum
+ * 7:0 Signature
+ */
+};
+
+/*
+ * IDE "nice" flags. These are used on a per drive basis to determine
+ * when to be nice and give more bandwidth to the other devices which
+ * share the same IDE bus.
+ */
+#define IDE_NICE_DSC_OVERLAP (0) /* per the DSC overlap protocol */
+#define IDE_NICE_ATAPI_OVERLAP (1) /* not supported yet */
+#define IDE_NICE_0 (2) /* when sure that it won't affect us */
+#define IDE_NICE_1 (3) /* when probably won't affect us much */
+#define IDE_NICE_2 (4) /* when we know it's on our expense */
+
+#endif /* _LINUX_HDREG_H */
diff --git a/sysroot/usr/include/linux/hdsmart.h b/sysroot/usr/include/linux/hdsmart.h
new file mode 100644
index 0000000..7974a47
--- /dev/null
+++ b/sysroot/usr/include/linux/hdsmart.h
@@ -0,0 +1,124 @@
+/*
+ * linux/include/linux/hdsmart.h
+ *
+ * Copyright (C) 1999-2000 Michael Cornwell <cornwell@acm.org>
+ * Copyright (C) 2000 Andre Hedrick <andre@linux-ide.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * You should have received a copy of the GNU General Public License
+ * (for example /usr/src/linux/COPYING); if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef _LINUX_HDSMART_H
+#define _LINUX_HDSMART_H
+
+#define OFFLINE_FULL_SCAN 0
+#define SHORT_SELF_TEST 1
+#define EXTEND_SELF_TEST 2
+#define SHORT_CAPTIVE_SELF_TEST 129
+#define EXTEND_CAPTIVE_SELF_TEST 130
+
+/* smart_attribute is the vendor specific in SFF-8035 spec */
+typedef struct ata_smart_attribute_s {
+ unsigned char id;
+ unsigned short status_flag;
+ unsigned char normalized;
+ unsigned char worse_normal;
+ unsigned char raw[6];
+ unsigned char reserv;
+} __attribute__ ((packed)) ata_smart_attribute_t;
+
+/* smart_values is format of the read drive Atrribute command */
+typedef struct ata_smart_values_s {
+ unsigned short revnumber;
+ ata_smart_attribute_t vendor_attributes [30];
+ unsigned char offline_data_collection_status;
+ unsigned char self_test_exec_status;
+ unsigned short total_time_to_complete_off_line;
+ unsigned char vendor_specific_366;
+ unsigned char offline_data_collection_capability;
+ unsigned short smart_capability;
+ unsigned char errorlog_capability;
+ unsigned char vendor_specific_371;
+ unsigned char short_test_completion_time;
+ unsigned char extend_test_completion_time;
+ unsigned char reserved_374_385 [12];
+ unsigned char vendor_specific_386_509 [125];
+ unsigned char chksum;
+} __attribute__ ((packed)) ata_smart_values_t;
+
+/* Smart Threshold data structures */
+/* Vendor attribute of SMART Threshold */
+typedef struct ata_smart_threshold_entry_s {
+ unsigned char id;
+ unsigned char normalized_threshold;
+ unsigned char reserved[10];
+} __attribute__ ((packed)) ata_smart_threshold_entry_t;
+
+/* Format of Read SMART THreshold Command */
+typedef struct ata_smart_thresholds_s {
+ unsigned short revnumber;
+ ata_smart_threshold_entry_t thres_entries[30];
+ unsigned char reserved[149];
+ unsigned char chksum;
+} __attribute__ ((packed)) ata_smart_thresholds_t;
+
+typedef struct ata_smart_errorlog_command_struct_s {
+ unsigned char devicecontrolreg;
+ unsigned char featuresreg;
+ unsigned char sector_count;
+ unsigned char sector_number;
+ unsigned char cylinder_low;
+ unsigned char cylinder_high;
+ unsigned char drive_head;
+ unsigned char commandreg;
+ unsigned int timestamp;
+} __attribute__ ((packed)) ata_smart_errorlog_command_struct_t;
+
+typedef struct ata_smart_errorlog_error_struct_s {
+ unsigned char error_condition;
+ unsigned char extended_error[14];
+ unsigned char state;
+ unsigned short timestamp;
+} __attribute__ ((packed)) ata_smart_errorlog_error_struct_t;
+
+typedef struct ata_smart_errorlog_struct_s {
+ ata_smart_errorlog_command_struct_t commands[6];
+ ata_smart_errorlog_error_struct_t error_struct;
+} __attribute__ ((packed)) ata_smart_errorlog_struct_t;
+
+typedef struct ata_smart_errorlog_s {
+ unsigned char revnumber;
+ unsigned char error_log_pointer;
+ ata_smart_errorlog_struct_t errorlog_struct[5];
+ unsigned short ata_error_count;
+ unsigned short non_fatal_count;
+ unsigned short drive_timeout_count;
+ unsigned char reserved[53];
+ unsigned char chksum;
+} __attribute__ ((packed)) ata_smart_errorlog_t;
+
+typedef struct ata_smart_selftestlog_struct_s {
+ unsigned char selftestnumber;
+ unsigned char selfteststatus;
+ unsigned short timestamp;
+ unsigned char selftestfailurecheckpoint;
+ unsigned int lbafirstfailure;
+ unsigned char vendorspecific[15];
+} __attribute__ ((packed)) ata_smart_selftestlog_struct_t;
+
+typedef struct ata_smart_selftestlog_s {
+ unsigned short revnumber;
+ ata_smart_selftestlog_struct_t selftest_struct[21];
+ unsigned char vendorspecific[2];
+ unsigned char mostrecenttest;
+ unsigned char resevered[2];
+ unsigned char chksum;
+} __attribute__ ((packed)) ata_smart_selftestlog_t;
+
+#endif /* _LINUX_HDSMART_H */
diff --git a/sysroot/usr/include/linux/hiddev.h b/sysroot/usr/include/linux/hiddev.h
new file mode 100644
index 0000000..bfa1f61
--- /dev/null
+++ b/sysroot/usr/include/linux/hiddev.h
@@ -0,0 +1,210 @@
+#ifndef _HIDDEV_H
+#define _HIDDEV_H
+
+/*
+ * $Id: hiddev.h,v 1.2 2001/04/26 11:26:09 vojtech Exp $
+ *
+ * Copyright (c) 1999-2000 Vojtech Pavlik
+ *
+ * Sponsored by SuSE
+ */
+
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Should you need to contact me, the author, you can do so either by
+ * e-mail - mail your message to <vojtech@suse.cz>, or by paper mail:
+ * Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic
+ */
+
+/*
+ * The event structure itself
+ */
+
+struct hiddev_event {
+ unsigned hid;
+ signed int value;
+};
+
+struct hiddev_devinfo {
+ __u32 bustype;
+ __u32 busnum;
+ __u32 devnum;
+ __u32 ifnum;
+ __s16 vendor;
+ __s16 product;
+ __s16 version;
+ __u32 num_applications;
+};
+
+struct hiddev_collection_info {
+ __u32 index;
+ __u32 type;
+ __u32 usage;
+ __u32 level;
+};
+
+#define HID_STRING_SIZE 256
+struct hiddev_string_descriptor {
+ __s32 index;
+ char value[HID_STRING_SIZE];
+};
+
+struct hiddev_report_info {
+ __u32 report_type;
+ __u32 report_id;
+ __u32 num_fields;
+};
+
+/* To do a GUSAGE/SUSAGE, fill in at least usage_code, report_type and
+ * report_id. Set report_id to REPORT_ID_UNKNOWN if the rest of the fields
+ * are unknown. Otherwise use a usage_ref struct filled in from a previous
+ * successful GUSAGE call to save time. To actually send a value to the
+ * device, perform a SUSAGE first, followed by a SREPORT. An INITREPORT or a
+ * GREPORT isn't necessary for a GUSAGE to return valid data.
+ */
+#define HID_REPORT_ID_UNKNOWN 0xffffffff
+#define HID_REPORT_ID_FIRST 0x00000100
+#define HID_REPORT_ID_NEXT 0x00000200
+#define HID_REPORT_ID_MASK 0x000000ff
+#define HID_REPORT_ID_MAX 0x000000ff
+
+#define HID_REPORT_TYPE_INPUT 1
+#define HID_REPORT_TYPE_OUTPUT 2
+#define HID_REPORT_TYPE_FEATURE 3
+#define HID_REPORT_TYPE_MIN 1
+#define HID_REPORT_TYPE_MAX 3
+
+struct hiddev_field_info {
+ __u32 report_type;
+ __u32 report_id;
+ __u32 field_index;
+ __u32 maxusage;
+ __u32 flags;
+ __u32 physical; /* physical usage for this field */
+ __u32 logical; /* logical usage for this field */
+ __u32 application; /* application usage for this field */
+ __s32 logical_minimum;
+ __s32 logical_maximum;
+ __s32 physical_minimum;
+ __s32 physical_maximum;
+ __u32 unit_exponent;
+ __u32 unit;
+};
+
+/* Fill in report_type, report_id and field_index to get the information on a
+ * field.
+ */
+#define HID_FIELD_CONSTANT 0x001
+#define HID_FIELD_VARIABLE 0x002
+#define HID_FIELD_RELATIVE 0x004
+#define HID_FIELD_WRAP 0x008
+#define HID_FIELD_NONLINEAR 0x010
+#define HID_FIELD_NO_PREFERRED 0x020
+#define HID_FIELD_NULL_STATE 0x040
+#define HID_FIELD_VOLATILE 0x080
+#define HID_FIELD_BUFFERED_BYTE 0x100
+
+struct hiddev_usage_ref {
+ __u32 report_type;
+ __u32 report_id;
+ __u32 field_index;
+ __u32 usage_index;
+ __u32 usage_code;
+ __s32 value;
+};
+
+/* hiddev_usage_ref_multi is used for sending multiple bytes to a control.
+ * It really manifests itself as setting the value of consecutive usages */
+#define HID_MAX_MULTI_USAGES 1024
+struct hiddev_usage_ref_multi {
+ struct hiddev_usage_ref uref;
+ __u32 num_values;
+ __s32 values[HID_MAX_MULTI_USAGES];
+};
+
+/* FIELD_INDEX_NONE is returned in read() data from the kernel when flags
+ * is set to (HIDDEV_FLAG_UREF | HIDDEV_FLAG_REPORT) and a new report has
+ * been sent by the device
+ */
+#define HID_FIELD_INDEX_NONE 0xffffffff
+
+/*
+ * Protocol version.
+ */
+
+#define HID_VERSION 0x010004
+
+/*
+ * IOCTLs (0x00 - 0x7f)
+ */
+
+#define HIDIOCGVERSION _IOR('H', 0x01, int)
+#define HIDIOCAPPLICATION _IO('H', 0x02)
+#define HIDIOCGDEVINFO _IOR('H', 0x03, struct hiddev_devinfo)
+#define HIDIOCGSTRING _IOR('H', 0x04, struct hiddev_string_descriptor)
+#define HIDIOCINITREPORT _IO('H', 0x05)
+#define HIDIOCGNAME(len) _IOC(_IOC_READ, 'H', 0x06, len)
+#define HIDIOCGREPORT _IOW('H', 0x07, struct hiddev_report_info)
+#define HIDIOCSREPORT _IOW('H', 0x08, struct hiddev_report_info)
+#define HIDIOCGREPORTINFO _IOWR('H', 0x09, struct hiddev_report_info)
+#define HIDIOCGFIELDINFO _IOWR('H', 0x0A, struct hiddev_field_info)
+#define HIDIOCGUSAGE _IOWR('H', 0x0B, struct hiddev_usage_ref)
+#define HIDIOCSUSAGE _IOW('H', 0x0C, struct hiddev_usage_ref)
+#define HIDIOCGUCODE _IOWR('H', 0x0D, struct hiddev_usage_ref)
+#define HIDIOCGFLAG _IOR('H', 0x0E, int)
+#define HIDIOCSFLAG _IOW('H', 0x0F, int)
+#define HIDIOCGCOLLECTIONINDEX _IOW('H', 0x10, struct hiddev_usage_ref)
+#define HIDIOCGCOLLECTIONINFO _IOWR('H', 0x11, struct hiddev_collection_info)
+#define HIDIOCGPHYS(len) _IOC(_IOC_READ, 'H', 0x12, len)
+
+/* For writing/reading to multiple/consecutive usages */
+#define HIDIOCGUSAGES _IOWR('H', 0x13, struct hiddev_usage_ref_multi)
+#define HIDIOCSUSAGES _IOW('H', 0x14, struct hiddev_usage_ref_multi)
+
+/*
+ * Flags to be used in HIDIOCSFLAG
+ */
+#define HIDDEV_FLAG_UREF 0x1
+#define HIDDEV_FLAG_REPORT 0x2
+#define HIDDEV_FLAGS 0x3
+
+/* To traverse the input report descriptor info for a HID device, perform the
+ * following:
+ *
+ * rinfo.report_type = HID_REPORT_TYPE_INPUT;
+ * rinfo.report_id = HID_REPORT_ID_FIRST;
+ * ret = ioctl(fd, HIDIOCGREPORTINFO, &rinfo);
+ *
+ * while (ret >= 0) {
+ * for (i = 0; i < rinfo.num_fields; i++) {
+ * finfo.report_type = rinfo.report_type;
+ * finfo.report_id = rinfo.report_id;
+ * finfo.field_index = i;
+ * ioctl(fd, HIDIOCGFIELDINFO, &finfo);
+ * for (j = 0; j < finfo.maxusage; j++) {
+ * uref.field_index = i;
+ * uref.usage_index = j;
+ * ioctl(fd, HIDIOCGUCODE, &uref);
+ * ioctl(fd, HIDIOCGUSAGE, &uref);
+ * }
+ * }
+ * rinfo.report_id |= HID_REPORT_ID_NEXT;
+ * ret = ioctl(fd, HIDIOCGREPORTINFO, &rinfo);
+ * }
+ */
+
+
+#endif
diff --git a/sysroot/usr/include/linux/hpet.h b/sysroot/usr/include/linux/hpet.h
new file mode 100644
index 0000000..754051a
--- /dev/null
+++ b/sysroot/usr/include/linux/hpet.h
@@ -0,0 +1,22 @@
+#ifndef __HPET__
+#define __HPET__ 1
+
+
+
+struct hpet_info {
+ unsigned long hi_ireqfreq; /* Hz */
+ unsigned long hi_flags; /* information */
+ unsigned short hi_hpet;
+ unsigned short hi_timer;
+};
+
+#define HPET_INFO_PERIODIC 0x0001 /* timer is periodic */
+
+#define HPET_IE_ON _IO('h', 0x01) /* interrupt on */
+#define HPET_IE_OFF _IO('h', 0x02) /* interrupt off */
+#define HPET_INFO _IOR('h', 0x03, struct hpet_info)
+#define HPET_EPI _IO('h', 0x04) /* enable periodic */
+#define HPET_DPI _IO('h', 0x05) /* disable periodic */
+#define HPET_IRQFREQ _IOW('h', 0x6, unsigned long) /* IRQFREQ usec */
+
+#endif /* !__HPET__ */
diff --git a/sysroot/usr/include/linux/hysdn_if.h b/sysroot/usr/include/linux/hysdn_if.h
new file mode 100644
index 0000000..00236ae
--- /dev/null
+++ b/sysroot/usr/include/linux/hysdn_if.h
@@ -0,0 +1,33 @@
+/* $Id: hysdn_if.h,v 1.1.8.3 2001/09/23 22:25:05 kai Exp $
+ *
+ * Linux driver for HYSDN cards
+ * ioctl definitions shared by hynetmgr and driver.
+ *
+ * Author Werner Cornelius (werner@titro.de) for Hypercope GmbH
+ * Copyright 1999 by Werner Cornelius (werner@titro.de)
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
+ */
+
+/****************/
+/* error values */
+/****************/
+#define ERR_NONE 0 /* no error occurred */
+#define ERR_ALREADY_BOOT 1000 /* we are already booting */
+#define EPOF_BAD_MAGIC 1001 /* bad magic in POF header */
+#define ERR_BOARD_DPRAM 1002 /* board DPRAM failed */
+#define EPOF_INTERNAL 1003 /* internal POF handler error */
+#define EPOF_BAD_IMG_SIZE 1004 /* POF boot image size invalid */
+#define ERR_BOOTIMG_FAIL 1005 /* 1. stage boot image did not start */
+#define ERR_BOOTSEQ_FAIL 1006 /* 2. stage boot seq handshake timeout */
+#define ERR_POF_TIMEOUT 1007 /* timeout waiting for card pof ready */
+#define ERR_NOT_BOOTED 1008 /* operation only allowed when booted */
+#define ERR_CONF_LONG 1009 /* conf line is too long */
+#define ERR_INV_CHAN 1010 /* invalid channel number */
+#define ERR_ASYNC_TIME 1011 /* timeout sending async data */
+
+
+
+
diff --git a/sysroot/usr/include/linux/i2c-dev.h b/sysroot/usr/include/linux/i2c-dev.h
new file mode 100644
index 0000000..eca1ff9
--- /dev/null
+++ b/sysroot/usr/include/linux/i2c-dev.h
@@ -0,0 +1,73 @@
+/*
+ i2c-dev.h - i2c-bus driver, char device interface
+
+ Copyright (C) 1995-97 Simon G. Vogl
+ Copyright (C) 1998-99 Frodo Looijaard <frodol@dds.nl>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#ifndef _LINUX_I2C_DEV_H
+#define _LINUX_I2C_DEV_H
+
+#include <linux/types.h>
+
+/* /dev/i2c-X ioctl commands. The ioctl's parameter is always an
+ * unsigned long, except for:
+ * - I2C_FUNCS, takes pointer to an unsigned long
+ * - I2C_RDWR, takes pointer to struct i2c_rdwr_ioctl_data
+ * - I2C_SMBUS, takes pointer to struct i2c_smbus_ioctl_data
+ */
+#define I2C_RETRIES 0x0701 /* number of times a device address should
+ be polled when not acknowledging */
+#define I2C_TIMEOUT 0x0702 /* set timeout in jiffies - call with int */
+
+/* NOTE: Slave address is 7 or 10 bits, but 10-bit addresses
+ * are NOT supported! (due to code brokenness)
+ */
+#define I2C_SLAVE 0x0703 /* Use this slave address */
+#define I2C_SLAVE_FORCE 0x0706 /* Use this slave address, even if it
+ is already in use by a driver! */
+#define I2C_TENBIT 0x0704 /* 0 for 7 bit addrs, != 0 for 10 bit */
+
+#define I2C_FUNCS 0x0705 /* Get the adapter functionality mask */
+
+#define I2C_RDWR 0x0707 /* Combined R/W transfer (one STOP only) */
+
+#define I2C_PEC 0x0708 /* != 0 to use PEC with SMBus */
+#define I2C_SMBUS 0x0720 /* SMBus transfer */
+
+
+/* This is the structure as used in the I2C_SMBUS ioctl call */
+struct i2c_smbus_ioctl_data {
+ __u8 read_write;
+ __u8 command;
+ __u32 size;
+ union i2c_smbus_data *data;
+};
+
+/* This is the structure as used in the I2C_RDWR ioctl call */
+struct i2c_rdwr_ioctl_data {
+ struct i2c_msg *msgs; /* pointers to i2c_msgs */
+ __u32 nmsgs; /* number of i2c_msgs */
+};
+
+#define I2C_RDRW_IOCTL_MAX_MSGS 42
+
+#ifdef __KERNEL__
+#define I2C_MAJOR 89 /* Device major number */
+#endif
+
+#endif /* _LINUX_I2C_DEV_H */
diff --git a/sysroot/usr/include/linux/i2c.h b/sysroot/usr/include/linux/i2c.h
new file mode 100644
index 0000000..4197ef5
--- /dev/null
+++ b/sysroot/usr/include/linux/i2c.h
@@ -0,0 +1,153 @@
+/* ------------------------------------------------------------------------- */
+/* */
+/* i2c.h - definitions for the i2c-bus interface */
+/* */
+/* ------------------------------------------------------------------------- */
+/* Copyright (C) 1995-2000 Simon G. Vogl
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+/* ------------------------------------------------------------------------- */
+
+/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and
+ Frodo Looijaard <frodol@dds.nl> */
+
+#ifndef _LINUX_I2C_H
+#define _LINUX_I2C_H
+
+#include <linux/types.h>
+
+/**
+ * struct i2c_msg - an I2C transaction segment beginning with START
+ * @addr: Slave address, either seven or ten bits. When this is a ten
+ * bit address, I2C_M_TEN must be set in @flags and the adapter
+ * must support I2C_FUNC_10BIT_ADDR.
+ * @flags: I2C_M_RD is handled by all adapters. No other flags may be
+ * provided unless the adapter exported the relevant I2C_FUNC_*
+ * flags through i2c_check_functionality().
+ * @len: Number of data bytes in @buf being read from or written to the
+ * I2C slave address. For read transactions where I2C_M_RECV_LEN
+ * is set, the caller guarantees that this buffer can hold up to
+ * 32 bytes in addition to the initial length byte sent by the
+ * slave (plus, if used, the SMBus PEC); and this value will be
+ * incremented by the number of block data bytes received.
+ * @buf: The buffer into which data is read, or from which it's written.
+ *
+ * An i2c_msg is the low level representation of one segment of an I2C
+ * transaction. It is visible to drivers in the @i2c_transfer() procedure,
+ * to userspace from i2c-dev, and to I2C adapter drivers through the
+ * @i2c_adapter.@master_xfer() method.
+ *
+ * Except when I2C "protocol mangling" is used, all I2C adapters implement
+ * the standard rules for I2C transactions. Each transaction begins with a
+ * START. That is followed by the slave address, and a bit encoding read
+ * versus write. Then follow all the data bytes, possibly including a byte
+ * with SMBus PEC. The transfer terminates with a NAK, or when all those
+ * bytes have been transferred and ACKed. If this is the last message in a
+ * group, it is followed by a STOP. Otherwise it is followed by the next
+ * @i2c_msg transaction segment, beginning with a (repeated) START.
+ *
+ * Alternatively, when the adapter supports I2C_FUNC_PROTOCOL_MANGLING then
+ * passing certain @flags may have changed those standard protocol behaviors.
+ * Those flags are only for use with broken/nonconforming slaves, and with
+ * adapters which are known to support the specific mangling options they
+ * need (one or more of IGNORE_NAK, NO_RD_ACK, NOSTART, and REV_DIR_ADDR).
+ */
+struct i2c_msg {
+ __u16 addr; /* slave address */
+ __u16 flags;
+#define I2C_M_TEN 0x0010 /* this is a ten bit chip address */
+#define I2C_M_RD 0x0001 /* read data, from slave to master */
+#define I2C_M_NOSTART 0x4000 /* if I2C_FUNC_PROTOCOL_MANGLING */
+#define I2C_M_REV_DIR_ADDR 0x2000 /* if I2C_FUNC_PROTOCOL_MANGLING */
+#define I2C_M_IGNORE_NAK 0x1000 /* if I2C_FUNC_PROTOCOL_MANGLING */
+#define I2C_M_NO_RD_ACK 0x0800 /* if I2C_FUNC_PROTOCOL_MANGLING */
+#define I2C_M_RECV_LEN 0x0400 /* length will be first received byte */
+ __u16 len; /* msg length */
+ __u8 *buf; /* pointer to msg data */
+};
+
+/* To determine what functionality is present */
+
+#define I2C_FUNC_I2C 0x00000001
+#define I2C_FUNC_10BIT_ADDR 0x00000002
+#define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_{REV_DIR_ADDR,NOSTART,..} */
+#define I2C_FUNC_SMBUS_PEC 0x00000008
+#define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 */
+#define I2C_FUNC_SMBUS_QUICK 0x00010000
+#define I2C_FUNC_SMBUS_READ_BYTE 0x00020000
+#define I2C_FUNC_SMBUS_WRITE_BYTE 0x00040000
+#define I2C_FUNC_SMBUS_READ_BYTE_DATA 0x00080000
+#define I2C_FUNC_SMBUS_WRITE_BYTE_DATA 0x00100000
+#define I2C_FUNC_SMBUS_READ_WORD_DATA 0x00200000
+#define I2C_FUNC_SMBUS_WRITE_WORD_DATA 0x00400000
+#define I2C_FUNC_SMBUS_PROC_CALL 0x00800000
+#define I2C_FUNC_SMBUS_READ_BLOCK_DATA 0x01000000
+#define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA 0x02000000
+#define I2C_FUNC_SMBUS_READ_I2C_BLOCK 0x04000000 /* I2C-like block xfer */
+#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* w/ 1-byte reg. addr. */
+#define I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 0x10000000 /* I2C-like block xfer */
+#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2 0x20000000 /* w/ 2-byte reg. addr. */
+
+#define I2C_FUNC_SMBUS_BYTE (I2C_FUNC_SMBUS_READ_BYTE | \
+ I2C_FUNC_SMBUS_WRITE_BYTE)
+#define I2C_FUNC_SMBUS_BYTE_DATA (I2C_FUNC_SMBUS_READ_BYTE_DATA | \
+ I2C_FUNC_SMBUS_WRITE_BYTE_DATA)
+#define I2C_FUNC_SMBUS_WORD_DATA (I2C_FUNC_SMBUS_READ_WORD_DATA | \
+ I2C_FUNC_SMBUS_WRITE_WORD_DATA)
+#define I2C_FUNC_SMBUS_BLOCK_DATA (I2C_FUNC_SMBUS_READ_BLOCK_DATA | \
+ I2C_FUNC_SMBUS_WRITE_BLOCK_DATA)
+#define I2C_FUNC_SMBUS_I2C_BLOCK (I2C_FUNC_SMBUS_READ_I2C_BLOCK | \
+ I2C_FUNC_SMBUS_WRITE_I2C_BLOCK)
+#define I2C_FUNC_SMBUS_I2C_BLOCK_2 (I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 | \
+ I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2)
+
+#define I2C_FUNC_SMBUS_EMUL (I2C_FUNC_SMBUS_QUICK | \
+ I2C_FUNC_SMBUS_BYTE | \
+ I2C_FUNC_SMBUS_BYTE_DATA | \
+ I2C_FUNC_SMBUS_WORD_DATA | \
+ I2C_FUNC_SMBUS_PROC_CALL | \
+ I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | \
+ I2C_FUNC_SMBUS_I2C_BLOCK | \
+ I2C_FUNC_SMBUS_PEC)
+
+/*
+ * Data for SMBus Messages
+ */
+#define I2C_SMBUS_BLOCK_MAX 32 /* As specified in SMBus standard */
+union i2c_smbus_data {
+ __u8 byte;
+ __u16 word;
+ __u8 block[I2C_SMBUS_BLOCK_MAX + 2]; /* block[0] is used for length */
+ /* and one more for user-space compatibility */
+};
+
+/* smbus_access read or write markers */
+#define I2C_SMBUS_READ 1
+#define I2C_SMBUS_WRITE 0
+
+/* SMBus transaction types (size parameter in the above functions)
+ Note: these no longer correspond to the (arbitrary) PIIX4 internal codes! */
+#define I2C_SMBUS_QUICK 0
+#define I2C_SMBUS_BYTE 1
+#define I2C_SMBUS_BYTE_DATA 2
+#define I2C_SMBUS_WORD_DATA 3
+#define I2C_SMBUS_PROC_CALL 4
+#define I2C_SMBUS_BLOCK_DATA 5
+#define I2C_SMBUS_I2C_BLOCK_BROKEN 6
+#define I2C_SMBUS_BLOCK_PROC_CALL 7 /* SMBus 2.0 */
+#define I2C_SMBUS_I2C_BLOCK_DATA 8
+
+
+#endif /* _LINUX_I2C_H */
diff --git a/sysroot/usr/include/linux/i2o-dev.h b/sysroot/usr/include/linux/i2o-dev.h
new file mode 100644
index 0000000..bc580b6
--- /dev/null
+++ b/sysroot/usr/include/linux/i2o-dev.h
@@ -0,0 +1,421 @@
+/*
+ * I2O user space accessible structures/APIs
+ *
+ * (c) Copyright 1999, 2000 Red Hat Software
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ *************************************************************************
+ *
+ * This header file defines the I2O APIs that are available to both
+ * the kernel and user level applications. Kernel specific structures
+ * are defined in i2o_osm. OSMs should include _only_ i2o_osm.h which
+ * automatically includes this file.
+ *
+ */
+
+#ifndef _I2O_DEV_H
+#define _I2O_DEV_H
+
+/* How many controllers are we allowing */
+#define MAX_I2O_CONTROLLERS 32
+
+#include <linux/ioctl.h>
+#include <linux/types.h>
+
+/*
+ * I2O Control IOCTLs and structures
+ */
+#define I2O_MAGIC_NUMBER 'i'
+#define I2OGETIOPS _IOR(I2O_MAGIC_NUMBER,0,__u8[MAX_I2O_CONTROLLERS])
+#define I2OHRTGET _IOWR(I2O_MAGIC_NUMBER,1,struct i2o_cmd_hrtlct)
+#define I2OLCTGET _IOWR(I2O_MAGIC_NUMBER,2,struct i2o_cmd_hrtlct)
+#define I2OPARMSET _IOWR(I2O_MAGIC_NUMBER,3,struct i2o_cmd_psetget)
+#define I2OPARMGET _IOWR(I2O_MAGIC_NUMBER,4,struct i2o_cmd_psetget)
+#define I2OSWDL _IOWR(I2O_MAGIC_NUMBER,5,struct i2o_sw_xfer)
+#define I2OSWUL _IOWR(I2O_MAGIC_NUMBER,6,struct i2o_sw_xfer)
+#define I2OSWDEL _IOWR(I2O_MAGIC_NUMBER,7,struct i2o_sw_xfer)
+#define I2OVALIDATE _IOR(I2O_MAGIC_NUMBER,8,__u32)
+#define I2OHTML _IOWR(I2O_MAGIC_NUMBER,9,struct i2o_html)
+#define I2OEVTREG _IOW(I2O_MAGIC_NUMBER,10,struct i2o_evt_id)
+#define I2OEVTGET _IOR(I2O_MAGIC_NUMBER,11,struct i2o_evt_info)
+#define I2OPASSTHRU _IOR(I2O_MAGIC_NUMBER,12,struct i2o_cmd_passthru)
+#define I2OPASSTHRU32 _IOR(I2O_MAGIC_NUMBER,12,struct i2o_cmd_passthru32)
+
+struct i2o_cmd_passthru32 {
+ unsigned int iop; /* IOP unit number */
+ __u32 msg; /* message */
+};
+
+struct i2o_cmd_passthru {
+ unsigned int iop; /* IOP unit number */
+ void *msg; /* message */
+};
+
+struct i2o_cmd_hrtlct {
+ unsigned int iop; /* IOP unit number */
+ void *resbuf; /* Buffer for result */
+ unsigned int *reslen; /* Buffer length in bytes */
+};
+
+struct i2o_cmd_psetget {
+ unsigned int iop; /* IOP unit number */
+ unsigned int tid; /* Target device TID */
+ void *opbuf; /* Operation List buffer */
+ unsigned int oplen; /* Operation List buffer length in bytes */
+ void *resbuf; /* Result List buffer */
+ unsigned int *reslen; /* Result List buffer length in bytes */
+};
+
+struct i2o_sw_xfer {
+ unsigned int iop; /* IOP unit number */
+ unsigned char flags; /* Flags field */
+ unsigned char sw_type; /* Software type */
+ unsigned int sw_id; /* Software ID */
+ void *buf; /* Pointer to software buffer */
+ unsigned int *swlen; /* Length of software data */
+ unsigned int *maxfrag; /* Maximum fragment count */
+ unsigned int *curfrag; /* Current fragment count */
+};
+
+struct i2o_html {
+ unsigned int iop; /* IOP unit number */
+ unsigned int tid; /* Target device ID */
+ unsigned int page; /* HTML page */
+ void *resbuf; /* Buffer for reply HTML page */
+ unsigned int *reslen; /* Length in bytes of reply buffer */
+ void *qbuf; /* Pointer to HTTP query string */
+ unsigned int qlen; /* Length in bytes of query string buffer */
+};
+
+#define I2O_EVT_Q_LEN 32
+
+struct i2o_evt_id {
+ unsigned int iop;
+ unsigned int tid;
+ unsigned int evt_mask;
+};
+
+/* Event data size = frame size - message header + evt indicator */
+#define I2O_EVT_DATA_SIZE 88
+
+struct i2o_evt_info {
+ struct i2o_evt_id id;
+ unsigned char evt_data[I2O_EVT_DATA_SIZE];
+ unsigned int data_size;
+};
+
+struct i2o_evt_get {
+ struct i2o_evt_info info;
+ int pending;
+ int lost;
+};
+
+typedef struct i2o_sg_io_hdr {
+ unsigned int flags; /* see I2O_DPT_SG_IO_FLAGS */
+} i2o_sg_io_hdr_t;
+
+/**************************************************************************
+ * HRT related constants and structures
+ **************************************************************************/
+#define I2O_BUS_LOCAL 0
+#define I2O_BUS_ISA 1
+#define I2O_BUS_EISA 2
+#define I2O_BUS_MCA 3
+#define I2O_BUS_PCI 4
+#define I2O_BUS_PCMCIA 5
+#define I2O_BUS_NUBUS 6
+#define I2O_BUS_CARDBUS 7
+#define I2O_BUS_UNKNOWN 0x80
+
+typedef struct _i2o_pci_bus {
+ __u8 PciFunctionNumber;
+ __u8 PciDeviceNumber;
+ __u8 PciBusNumber;
+ __u8 reserved;
+ __u16 PciVendorID;
+ __u16 PciDeviceID;
+} i2o_pci_bus;
+
+typedef struct _i2o_local_bus {
+ __u16 LbBaseIOPort;
+ __u16 reserved;
+ __u32 LbBaseMemoryAddress;
+} i2o_local_bus;
+
+typedef struct _i2o_isa_bus {
+ __u16 IsaBaseIOPort;
+ __u8 CSN;
+ __u8 reserved;
+ __u32 IsaBaseMemoryAddress;
+} i2o_isa_bus;
+
+typedef struct _i2o_eisa_bus_info {
+ __u16 EisaBaseIOPort;
+ __u8 reserved;
+ __u8 EisaSlotNumber;
+ __u32 EisaBaseMemoryAddress;
+} i2o_eisa_bus;
+
+typedef struct _i2o_mca_bus {
+ __u16 McaBaseIOPort;
+ __u8 reserved;
+ __u8 McaSlotNumber;
+ __u32 McaBaseMemoryAddress;
+} i2o_mca_bus;
+
+typedef struct _i2o_other_bus {
+ __u16 BaseIOPort;
+ __u16 reserved;
+ __u32 BaseMemoryAddress;
+} i2o_other_bus;
+
+typedef struct _i2o_hrt_entry {
+ __u32 adapter_id;
+ __u32 parent_tid:12;
+ __u32 state:4;
+ __u32 bus_num:8;
+ __u32 bus_type:8;
+ union {
+ i2o_pci_bus pci_bus;
+ i2o_local_bus local_bus;
+ i2o_isa_bus isa_bus;
+ i2o_eisa_bus eisa_bus;
+ i2o_mca_bus mca_bus;
+ i2o_other_bus other_bus;
+ } bus;
+} i2o_hrt_entry;
+
+typedef struct _i2o_hrt {
+ __u16 num_entries;
+ __u8 entry_len;
+ __u8 hrt_version;
+ __u32 change_ind;
+ i2o_hrt_entry hrt_entry[1];
+} i2o_hrt;
+
+typedef struct _i2o_lct_entry {
+ __u32 entry_size:16;
+ __u32 tid:12;
+ __u32 reserved:4;
+ __u32 change_ind;
+ __u32 device_flags;
+ __u32 class_id:12;
+ __u32 version:4;
+ __u32 vendor_id:16;
+ __u32 sub_class;
+ __u32 user_tid:12;
+ __u32 parent_tid:12;
+ __u32 bios_info:8;
+ __u8 identity_tag[8];
+ __u32 event_capabilities;
+} i2o_lct_entry;
+
+typedef struct _i2o_lct {
+ __u32 table_size:16;
+ __u32 boot_tid:12;
+ __u32 lct_ver:4;
+ __u32 iop_flags;
+ __u32 change_ind;
+ i2o_lct_entry lct_entry[1];
+} i2o_lct;
+
+typedef struct _i2o_status_block {
+ __u16 org_id;
+ __u16 reserved;
+ __u16 iop_id:12;
+ __u16 reserved1:4;
+ __u16 host_unit_id;
+ __u16 segment_number:12;
+ __u16 i2o_version:4;
+ __u8 iop_state;
+ __u8 msg_type;
+ __u16 inbound_frame_size;
+ __u8 init_code;
+ __u8 reserved2;
+ __u32 max_inbound_frames;
+ __u32 cur_inbound_frames;
+ __u32 max_outbound_frames;
+ char product_id[24];
+ __u32 expected_lct_size;
+ __u32 iop_capabilities;
+ __u32 desired_mem_size;
+ __u32 current_mem_size;
+ __u32 current_mem_base;
+ __u32 desired_io_size;
+ __u32 current_io_size;
+ __u32 current_io_base;
+ __u32 reserved3:24;
+ __u32 cmd_status:8;
+} i2o_status_block;
+
+/* Event indicator mask flags */
+#define I2O_EVT_IND_STATE_CHANGE 0x80000000
+#define I2O_EVT_IND_GENERAL_WARNING 0x40000000
+#define I2O_EVT_IND_CONFIGURATION_FLAG 0x20000000
+#define I2O_EVT_IND_LOCK_RELEASE 0x10000000
+#define I2O_EVT_IND_CAPABILITY_CHANGE 0x08000000
+#define I2O_EVT_IND_DEVICE_RESET 0x04000000
+#define I2O_EVT_IND_EVT_MASK_MODIFIED 0x02000000
+#define I2O_EVT_IND_FIELD_MODIFIED 0x01000000
+#define I2O_EVT_IND_VENDOR_EVT 0x00800000
+#define I2O_EVT_IND_DEVICE_STATE 0x00400000
+
+/* Executive event indicitors */
+#define I2O_EVT_IND_EXEC_RESOURCE_LIMITS 0x00000001
+#define I2O_EVT_IND_EXEC_CONNECTION_FAIL 0x00000002
+#define I2O_EVT_IND_EXEC_ADAPTER_FAULT 0x00000004
+#define I2O_EVT_IND_EXEC_POWER_FAIL 0x00000008
+#define I2O_EVT_IND_EXEC_RESET_PENDING 0x00000010
+#define I2O_EVT_IND_EXEC_RESET_IMMINENT 0x00000020
+#define I2O_EVT_IND_EXEC_HW_FAIL 0x00000040
+#define I2O_EVT_IND_EXEC_XCT_CHANGE 0x00000080
+#define I2O_EVT_IND_EXEC_NEW_LCT_ENTRY 0x00000100
+#define I2O_EVT_IND_EXEC_MODIFIED_LCT 0x00000200
+#define I2O_EVT_IND_EXEC_DDM_AVAILABILITY 0x00000400
+
+/* Random Block Storage Event Indicators */
+#define I2O_EVT_IND_BSA_VOLUME_LOAD 0x00000001
+#define I2O_EVT_IND_BSA_VOLUME_UNLOAD 0x00000002
+#define I2O_EVT_IND_BSA_VOLUME_UNLOAD_REQ 0x00000004
+#define I2O_EVT_IND_BSA_CAPACITY_CHANGE 0x00000008
+#define I2O_EVT_IND_BSA_SCSI_SMART 0x00000010
+
+/* Event data for generic events */
+#define I2O_EVT_STATE_CHANGE_NORMAL 0x00
+#define I2O_EVT_STATE_CHANGE_SUSPENDED 0x01
+#define I2O_EVT_STATE_CHANGE_RESTART 0x02
+#define I2O_EVT_STATE_CHANGE_NA_RECOVER 0x03
+#define I2O_EVT_STATE_CHANGE_NA_NO_RECOVER 0x04
+#define I2O_EVT_STATE_CHANGE_QUIESCE_REQUEST 0x05
+#define I2O_EVT_STATE_CHANGE_FAILED 0x10
+#define I2O_EVT_STATE_CHANGE_FAULTED 0x11
+
+#define I2O_EVT_GEN_WARNING_NORMAL 0x00
+#define I2O_EVT_GEN_WARNING_ERROR_THRESHOLD 0x01
+#define I2O_EVT_GEN_WARNING_MEDIA_FAULT 0x02
+
+#define I2O_EVT_CAPABILITY_OTHER 0x01
+#define I2O_EVT_CAPABILITY_CHANGED 0x02
+
+#define I2O_EVT_SENSOR_STATE_CHANGED 0x01
+
+/*
+ * I2O classes / subclasses
+ */
+
+/* Class ID and Code Assignments
+ * (LCT.ClassID.Version field)
+ */
+#define I2O_CLASS_VERSION_10 0x00
+#define I2O_CLASS_VERSION_11 0x01
+
+/* Class code names
+ * (from v1.5 Table 6-1 Class Code Assignments.)
+ */
+
+#define I2O_CLASS_EXECUTIVE 0x000
+#define I2O_CLASS_DDM 0x001
+#define I2O_CLASS_RANDOM_BLOCK_STORAGE 0x010
+#define I2O_CLASS_SEQUENTIAL_STORAGE 0x011
+#define I2O_CLASS_LAN 0x020
+#define I2O_CLASS_WAN 0x030
+#define I2O_CLASS_FIBRE_CHANNEL_PORT 0x040
+#define I2O_CLASS_FIBRE_CHANNEL_PERIPHERAL 0x041
+#define I2O_CLASS_SCSI_PERIPHERAL 0x051
+#define I2O_CLASS_ATE_PORT 0x060
+#define I2O_CLASS_ATE_PERIPHERAL 0x061
+#define I2O_CLASS_FLOPPY_CONTROLLER 0x070
+#define I2O_CLASS_FLOPPY_DEVICE 0x071
+#define I2O_CLASS_BUS_ADAPTER 0x080
+#define I2O_CLASS_PEER_TRANSPORT_AGENT 0x090
+#define I2O_CLASS_PEER_TRANSPORT 0x091
+#define I2O_CLASS_END 0xfff
+
+/*
+ * Rest of 0x092 - 0x09f reserved for peer-to-peer classes
+ */
+
+#define I2O_CLASS_MATCH_ANYCLASS 0xffffffff
+
+/*
+ * Subclasses
+ */
+
+#define I2O_SUBCLASS_i960 0x001
+#define I2O_SUBCLASS_HDM 0x020
+#define I2O_SUBCLASS_ISM 0x021
+
+/* Operation functions */
+
+#define I2O_PARAMS_FIELD_GET 0x0001
+#define I2O_PARAMS_LIST_GET 0x0002
+#define I2O_PARAMS_MORE_GET 0x0003
+#define I2O_PARAMS_SIZE_GET 0x0004
+#define I2O_PARAMS_TABLE_GET 0x0005
+#define I2O_PARAMS_FIELD_SET 0x0006
+#define I2O_PARAMS_LIST_SET 0x0007
+#define I2O_PARAMS_ROW_ADD 0x0008
+#define I2O_PARAMS_ROW_DELETE 0x0009
+#define I2O_PARAMS_TABLE_CLEAR 0x000A
+
+/*
+ * I2O serial number conventions / formats
+ * (circa v1.5)
+ */
+
+#define I2O_SNFORMAT_UNKNOWN 0
+#define I2O_SNFORMAT_BINARY 1
+#define I2O_SNFORMAT_ASCII 2
+#define I2O_SNFORMAT_UNICODE 3
+#define I2O_SNFORMAT_LAN48_MAC 4
+#define I2O_SNFORMAT_WAN 5
+
+/*
+ * Plus new in v2.0 (Yellowstone pdf doc)
+ */
+
+#define I2O_SNFORMAT_LAN64_MAC 6
+#define I2O_SNFORMAT_DDM 7
+#define I2O_SNFORMAT_IEEE_REG64 8
+#define I2O_SNFORMAT_IEEE_REG128 9
+#define I2O_SNFORMAT_UNKNOWN2 0xff
+
+/*
+ * I2O Get Status State values
+ */
+
+#define ADAPTER_STATE_INITIALIZING 0x01
+#define ADAPTER_STATE_RESET 0x02
+#define ADAPTER_STATE_HOLD 0x04
+#define ADAPTER_STATE_READY 0x05
+#define ADAPTER_STATE_OPERATIONAL 0x08
+#define ADAPTER_STATE_FAILED 0x10
+#define ADAPTER_STATE_FAULTED 0x11
+
+/*
+ * Software module types
+ */
+#define I2O_SOFTWARE_MODULE_IRTOS 0x11
+#define I2O_SOFTWARE_MODULE_IOP_PRIVATE 0x22
+#define I2O_SOFTWARE_MODULE_IOP_CONFIG 0x23
+
+/*
+ * Vendors
+ */
+#define I2O_VENDOR_DPT 0x001b
+
+/*
+ * DPT / Adaptec specific values for i2o_sg_io_hdr flags.
+ */
+#define I2O_DPT_SG_FLAG_INTERPRET 0x00010000
+#define I2O_DPT_SG_FLAG_PHYSICAL 0x00020000
+
+#define I2O_DPT_FLASH_FRAG_SIZE 0x10000
+#define I2O_DPT_FLASH_READ 0x0101
+#define I2O_DPT_FLASH_WRITE 0x0102
+
+#endif /* _I2O_DEV_H */
diff --git a/sysroot/usr/include/linux/i8k.h b/sysroot/usr/include/linux/i8k.h
new file mode 100644
index 0000000..1c45ba5
--- /dev/null
+++ b/sysroot/usr/include/linux/i8k.h
@@ -0,0 +1,46 @@
+/*
+ * i8k.h -- Linux driver for accessing the SMM BIOS on Dell laptops
+ *
+ * Copyright (C) 2001 Massimo Dal Zotto <dz@debian.org>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+#ifndef _LINUX_I8K_H
+#define _LINUX_I8K_H
+
+#define I8K_PROC "/proc/i8k"
+#define I8K_PROC_FMT "1.0"
+
+#define I8K_BIOS_VERSION _IOR ('i', 0x80, int) /* broken: meant 4 bytes */
+#define I8K_MACHINE_ID _IOR ('i', 0x81, int) /* broken: meant 16 bytes */
+#define I8K_POWER_STATUS _IOR ('i', 0x82, size_t)
+#define I8K_FN_STATUS _IOR ('i', 0x83, size_t)
+#define I8K_GET_TEMP _IOR ('i', 0x84, size_t)
+#define I8K_GET_SPEED _IOWR('i', 0x85, size_t)
+#define I8K_GET_FAN _IOWR('i', 0x86, size_t)
+#define I8K_SET_FAN _IOWR('i', 0x87, size_t)
+
+#define I8K_FAN_LEFT 1
+#define I8K_FAN_RIGHT 0
+#define I8K_FAN_OFF 0
+#define I8K_FAN_LOW 1
+#define I8K_FAN_HIGH 2
+#define I8K_FAN_MAX I8K_FAN_HIGH
+
+#define I8K_VOL_UP 1
+#define I8K_VOL_DOWN 2
+#define I8K_VOL_MUTE 4
+
+#define I8K_AC 1
+#define I8K_BATTERY 0
+
+#endif
diff --git a/sysroot/usr/include/linux/icmp.h b/sysroot/usr/include/linux/icmp.h
new file mode 100644
index 0000000..9eedab5
--- /dev/null
+++ b/sysroot/usr/include/linux/icmp.h
@@ -0,0 +1,97 @@
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Definitions for the ICMP protocol.
+ *
+ * Version: @(#)icmp.h 1.0.3 04/28/93
+ *
+ * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#ifndef _LINUX_ICMP_H
+#define _LINUX_ICMP_H
+
+#include <linux/types.h>
+
+#define ICMP_ECHOREPLY 0 /* Echo Reply */
+#define ICMP_DEST_UNREACH 3 /* Destination Unreachable */
+#define ICMP_SOURCE_QUENCH 4 /* Source Quench */
+#define ICMP_REDIRECT 5 /* Redirect (change route) */
+#define ICMP_ECHO 8 /* Echo Request */
+#define ICMP_TIME_EXCEEDED 11 /* Time Exceeded */
+#define ICMP_PARAMETERPROB 12 /* Parameter Problem */
+#define ICMP_TIMESTAMP 13 /* Timestamp Request */
+#define ICMP_TIMESTAMPREPLY 14 /* Timestamp Reply */
+#define ICMP_INFO_REQUEST 15 /* Information Request */
+#define ICMP_INFO_REPLY 16 /* Information Reply */
+#define ICMP_ADDRESS 17 /* Address Mask Request */
+#define ICMP_ADDRESSREPLY 18 /* Address Mask Reply */
+#define NR_ICMP_TYPES 18
+
+
+/* Codes for UNREACH. */
+#define ICMP_NET_UNREACH 0 /* Network Unreachable */
+#define ICMP_HOST_UNREACH 1 /* Host Unreachable */
+#define ICMP_PROT_UNREACH 2 /* Protocol Unreachable */
+#define ICMP_PORT_UNREACH 3 /* Port Unreachable */
+#define ICMP_FRAG_NEEDED 4 /* Fragmentation Needed/DF set */
+#define ICMP_SR_FAILED 5 /* Source Route failed */
+#define ICMP_NET_UNKNOWN 6
+#define ICMP_HOST_UNKNOWN 7
+#define ICMP_HOST_ISOLATED 8
+#define ICMP_NET_ANO 9
+#define ICMP_HOST_ANO 10
+#define ICMP_NET_UNR_TOS 11
+#define ICMP_HOST_UNR_TOS 12
+#define ICMP_PKT_FILTERED 13 /* Packet filtered */
+#define ICMP_PREC_VIOLATION 14 /* Precedence violation */
+#define ICMP_PREC_CUTOFF 15 /* Precedence cut off */
+#define NR_ICMP_UNREACH 15 /* instead of hardcoding immediate value */
+
+/* Codes for REDIRECT. */
+#define ICMP_REDIR_NET 0 /* Redirect Net */
+#define ICMP_REDIR_HOST 1 /* Redirect Host */
+#define ICMP_REDIR_NETTOS 2 /* Redirect Net for TOS */
+#define ICMP_REDIR_HOSTTOS 3 /* Redirect Host for TOS */
+
+/* Codes for TIME_EXCEEDED. */
+#define ICMP_EXC_TTL 0 /* TTL count exceeded */
+#define ICMP_EXC_FRAGTIME 1 /* Fragment Reass time exceeded */
+
+
+struct icmphdr {
+ __u8 type;
+ __u8 code;
+ __sum16 checksum;
+ union {
+ struct {
+ __be16 id;
+ __be16 sequence;
+ } echo;
+ __be32 gateway;
+ struct {
+ __be16 __unused;
+ __be16 mtu;
+ } frag;
+ } un;
+};
+
+
+/*
+ * constants for (set|get)sockopt
+ */
+
+#define ICMP_FILTER 1
+
+struct icmp_filter {
+ __u32 data;
+};
+
+
+#endif /* _LINUX_ICMP_H */
diff --git a/sysroot/usr/include/linux/icmpv6.h b/sysroot/usr/include/linux/icmpv6.h
new file mode 100644
index 0000000..5ae3d4e
--- /dev/null
+++ b/sysroot/usr/include/linux/icmpv6.h
@@ -0,0 +1,161 @@
+#ifndef _LINUX_ICMPV6_H
+#define _LINUX_ICMPV6_H
+
+#include <asm/byteorder.h>
+
+struct icmp6hdr {
+
+ __u8 icmp6_type;
+ __u8 icmp6_code;
+ __sum16 icmp6_cksum;
+
+
+ union {
+ __be32 un_data32[1];
+ __be16 un_data16[2];
+ __u8 un_data8[4];
+
+ struct icmpv6_echo {
+ __be16 identifier;
+ __be16 sequence;
+ } u_echo;
+
+ struct icmpv6_nd_advt {
+#if defined(__LITTLE_ENDIAN_BITFIELD)
+ __u32 reserved:5,
+ override:1,
+ solicited:1,
+ router:1,
+ reserved2:24;
+#elif defined(__BIG_ENDIAN_BITFIELD)
+ __u32 router:1,
+ solicited:1,
+ override:1,
+ reserved:29;
+#else
+#error "Please fix <asm/byteorder.h>"
+#endif
+ } u_nd_advt;
+
+ struct icmpv6_nd_ra {
+ __u8 hop_limit;
+#if defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 reserved:4,
+ router_pref:2,
+ other:1,
+ managed:1;
+
+#elif defined(__BIG_ENDIAN_BITFIELD)
+ __u8 managed:1,
+ other:1,
+ router_pref:2,
+ reserved:4;
+#else
+#error "Please fix <asm/byteorder.h>"
+#endif
+ __be16 rt_lifetime;
+ } u_nd_ra;
+
+ } icmp6_dataun;
+
+#define icmp6_identifier icmp6_dataun.u_echo.identifier
+#define icmp6_sequence icmp6_dataun.u_echo.sequence
+#define icmp6_pointer icmp6_dataun.un_data32[0]
+#define icmp6_mtu icmp6_dataun.un_data32[0]
+#define icmp6_unused icmp6_dataun.un_data32[0]
+#define icmp6_maxdelay icmp6_dataun.un_data16[0]
+#define icmp6_router icmp6_dataun.u_nd_advt.router
+#define icmp6_solicited icmp6_dataun.u_nd_advt.solicited
+#define icmp6_override icmp6_dataun.u_nd_advt.override
+#define icmp6_ndiscreserved icmp6_dataun.u_nd_advt.reserved
+#define icmp6_hop_limit icmp6_dataun.u_nd_ra.hop_limit
+#define icmp6_addrconf_managed icmp6_dataun.u_nd_ra.managed
+#define icmp6_addrconf_other icmp6_dataun.u_nd_ra.other
+#define icmp6_rt_lifetime icmp6_dataun.u_nd_ra.rt_lifetime
+#define icmp6_router_pref icmp6_dataun.u_nd_ra.router_pref
+};
+
+
+#define ICMPV6_ROUTER_PREF_LOW 0x3
+#define ICMPV6_ROUTER_PREF_MEDIUM 0x0
+#define ICMPV6_ROUTER_PREF_HIGH 0x1
+#define ICMPV6_ROUTER_PREF_INVALID 0x2
+
+#define ICMPV6_DEST_UNREACH 1
+#define ICMPV6_PKT_TOOBIG 2
+#define ICMPV6_TIME_EXCEED 3
+#define ICMPV6_PARAMPROB 4
+
+#define ICMPV6_INFOMSG_MASK 0x80
+
+#define ICMPV6_ECHO_REQUEST 128
+#define ICMPV6_ECHO_REPLY 129
+#define ICMPV6_MGM_QUERY 130
+#define ICMPV6_MGM_REPORT 131
+#define ICMPV6_MGM_REDUCTION 132
+
+#define ICMPV6_NI_QUERY 139
+#define ICMPV6_NI_REPLY 140
+
+#define ICMPV6_MLD2_REPORT 143
+
+#define ICMPV6_DHAAD_REQUEST 144
+#define ICMPV6_DHAAD_REPLY 145
+#define ICMPV6_MOBILE_PREFIX_SOL 146
+#define ICMPV6_MOBILE_PREFIX_ADV 147
+
+/*
+ * Codes for Destination Unreachable
+ */
+#define ICMPV6_NOROUTE 0
+#define ICMPV6_ADM_PROHIBITED 1
+#define ICMPV6_NOT_NEIGHBOUR 2
+#define ICMPV6_ADDR_UNREACH 3
+#define ICMPV6_PORT_UNREACH 4
+
+/*
+ * Codes for Time Exceeded
+ */
+#define ICMPV6_EXC_HOPLIMIT 0
+#define ICMPV6_EXC_FRAGTIME 1
+
+/*
+ * Codes for Parameter Problem
+ */
+#define ICMPV6_HDR_FIELD 0
+#define ICMPV6_UNK_NEXTHDR 1
+#define ICMPV6_UNK_OPTION 2
+
+/*
+ * constants for (set|get)sockopt
+ */
+
+#define ICMPV6_FILTER 1
+
+/*
+ * ICMPV6 filter
+ */
+
+#define ICMPV6_FILTER_BLOCK 1
+#define ICMPV6_FILTER_PASS 2
+#define ICMPV6_FILTER_BLOCKOTHERS 3
+#define ICMPV6_FILTER_PASSONLY 4
+
+struct icmp6_filter {
+ __u32 data[8];
+};
+
+/*
+ * Definitions for MLDv2
+ */
+#define MLD2_MODE_IS_INCLUDE 1
+#define MLD2_MODE_IS_EXCLUDE 2
+#define MLD2_CHANGE_TO_INCLUDE 3
+#define MLD2_CHANGE_TO_EXCLUDE 4
+#define MLD2_ALLOW_NEW_SOURCES 5
+#define MLD2_BLOCK_OLD_SOURCES 6
+
+#define MLD2_ALL_MCR_INIT { { { 0xff,0x02,0,0,0,0,0,0,0,0,0,0,0,0,0,0x16 } } }
+
+
+#endif
diff --git a/sysroot/usr/include/linux/if.h b/sysroot/usr/include/linux/if.h
new file mode 100644
index 0000000..296cd61
--- /dev/null
+++ b/sysroot/usr/include/linux/if.h
@@ -0,0 +1,216 @@
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Global definitions for the INET interface module.
+ *
+ * Version: @(#)if.h 1.0.2 04/18/93
+ *
+ * Authors: Original taken from Berkeley UNIX 4.3, (c) UCB 1982-1988
+ * Ross Biro
+ * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#ifndef _LINUX_IF_H
+#define _LINUX_IF_H
+
+#include <linux/types.h> /* for "__kernel_caddr_t" et al */
+#include <linux/socket.h> /* for "struct sockaddr" et al */
+
+#define IFNAMSIZ 16
+#include <linux/hdlc/ioctl.h>
+
+/* Standard interface flags (netdevice->flags). */
+#define IFF_UP 0x1 /* interface is up */
+#define IFF_BROADCAST 0x2 /* broadcast address valid */
+#define IFF_DEBUG 0x4 /* turn on debugging */
+#define IFF_LOOPBACK 0x8 /* is a loopback net */
+#define IFF_POINTOPOINT 0x10 /* interface is has p-p link */
+#define IFF_NOTRAILERS 0x20 /* avoid use of trailers */
+#define IFF_RUNNING 0x40 /* interface RFC2863 OPER_UP */
+#define IFF_NOARP 0x80 /* no ARP protocol */
+#define IFF_PROMISC 0x100 /* receive all packets */
+#define IFF_ALLMULTI 0x200 /* receive all multicast packets*/
+
+#define IFF_MASTER 0x400 /* master of a load balancer */
+#define IFF_SLAVE 0x800 /* slave of a load balancer */
+
+#define IFF_MULTICAST 0x1000 /* Supports multicast */
+
+#define IFF_PORTSEL 0x2000 /* can set media type */
+#define IFF_AUTOMEDIA 0x4000 /* auto media select active */
+#define IFF_DYNAMIC 0x8000 /* dialup device with changing addresses*/
+
+#define IFF_LOWER_UP 0x10000 /* driver signals L1 up */
+#define IFF_DORMANT 0x20000 /* driver signals dormant */
+
+#define IFF_VOLATILE (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|\
+ IFF_MASTER|IFF_SLAVE|IFF_RUNNING|IFF_LOWER_UP|IFF_DORMANT)
+
+/* Private (from user) interface flags (netdevice->priv_flags). */
+#define IFF_802_1Q_VLAN 0x1 /* 802.1Q VLAN device. */
+#define IFF_EBRIDGE 0x2 /* Ethernet bridging device. */
+#define IFF_SLAVE_INACTIVE 0x4 /* bonding slave not the curr. active */
+#define IFF_MASTER_8023AD 0x8 /* bonding master, 802.3ad. */
+#define IFF_MASTER_ALB 0x10 /* bonding master, balance-alb. */
+#define IFF_BONDING 0x20 /* bonding master or slave */
+#define IFF_SLAVE_NEEDARP 0x40 /* need ARPs for validation */
+
+#define IF_GET_IFACE 0x0001 /* for querying only */
+#define IF_GET_PROTO 0x0002
+
+/* For definitions see hdlc.h */
+#define IF_IFACE_V35 0x1000 /* V.35 serial interface */
+#define IF_IFACE_V24 0x1001 /* V.24 serial interface */
+#define IF_IFACE_X21 0x1002 /* X.21 serial interface */
+#define IF_IFACE_T1 0x1003 /* T1 telco serial interface */
+#define IF_IFACE_E1 0x1004 /* E1 telco serial interface */
+#define IF_IFACE_SYNC_SERIAL 0x1005 /* can't be set by software */
+#define IF_IFACE_X21D 0x1006 /* X.21 Dual Clocking (FarSite) */
+
+/* For definitions see hdlc.h */
+#define IF_PROTO_HDLC 0x2000 /* raw HDLC protocol */
+#define IF_PROTO_PPP 0x2001 /* PPP protocol */
+#define IF_PROTO_CISCO 0x2002 /* Cisco HDLC protocol */
+#define IF_PROTO_FR 0x2003 /* Frame Relay protocol */
+#define IF_PROTO_FR_ADD_PVC 0x2004 /* Create FR PVC */
+#define IF_PROTO_FR_DEL_PVC 0x2005 /* Delete FR PVC */
+#define IF_PROTO_X25 0x2006 /* X.25 */
+#define IF_PROTO_HDLC_ETH 0x2007 /* raw HDLC, Ethernet emulation */
+#define IF_PROTO_FR_ADD_ETH_PVC 0x2008 /* Create FR Ethernet-bridged PVC */
+#define IF_PROTO_FR_DEL_ETH_PVC 0x2009 /* Delete FR Ethernet-bridged PVC */
+#define IF_PROTO_FR_PVC 0x200A /* for reading PVC status */
+#define IF_PROTO_FR_ETH_PVC 0x200B
+#define IF_PROTO_RAW 0x200C /* RAW Socket */
+
+/* RFC 2863 operational status */
+enum {
+ IF_OPER_UNKNOWN,
+ IF_OPER_NOTPRESENT,
+ IF_OPER_DOWN,
+ IF_OPER_LOWERLAYERDOWN,
+ IF_OPER_TESTING,
+ IF_OPER_DORMANT,
+ IF_OPER_UP,
+};
+
+/* link modes */
+enum {
+ IF_LINK_MODE_DEFAULT,
+ IF_LINK_MODE_DORMANT, /* limit upward transition to dormant */
+};
+
+/*
+ * Device mapping structure. I'd just gone off and designed a
+ * beautiful scheme using only loadable modules with arguments
+ * for driver options and along come the PCMCIA people 8)
+ *
+ * Ah well. The get() side of this is good for WDSETUP, and it'll
+ * be handy for debugging things. The set side is fine for now and
+ * being very small might be worth keeping for clean configuration.
+ */
+
+struct ifmap
+{
+ unsigned long mem_start;
+ unsigned long mem_end;
+ unsigned short base_addr;
+ unsigned char irq;
+ unsigned char dma;
+ unsigned char port;
+ /* 3 bytes spare */
+};
+
+struct if_settings
+{
+ unsigned int type; /* Type of physical device or protocol */
+ unsigned int size; /* Size of the data allocated by the caller */
+ union {
+ /* {atm/eth/dsl}_settings anyone ? */
+ raw_hdlc_proto *raw_hdlc;
+ cisco_proto *cisco;
+ fr_proto *fr;
+ fr_proto_pvc *fr_pvc;
+ fr_proto_pvc_info *fr_pvc_info;
+
+ /* interface settings */
+ sync_serial_settings *sync;
+ te1_settings *te1;
+ } ifs_ifsu;
+};
+
+/*
+ * Interface request structure used for socket
+ * ioctl's. All interface ioctl's must have parameter
+ * definitions which begin with ifr_name. The
+ * remainder may be interface specific.
+ */
+
+struct ifreq
+{
+#define IFHWADDRLEN 6
+ union
+ {
+ char ifrn_name[IFNAMSIZ]; /* if name, e.g. "en0" */
+ } ifr_ifrn;
+
+ union {
+ struct sockaddr ifru_addr;
+ struct sockaddr ifru_dstaddr;
+ struct sockaddr ifru_broadaddr;
+ struct sockaddr ifru_netmask;
+ struct sockaddr ifru_hwaddr;
+ short ifru_flags;
+ int ifru_ivalue;
+ int ifru_mtu;
+ struct ifmap ifru_map;
+ char ifru_slave[IFNAMSIZ]; /* Just fits the size */
+ char ifru_newname[IFNAMSIZ];
+ void * ifru_data;
+ struct if_settings ifru_settings;
+ } ifr_ifru;
+};
+
+#define ifr_name ifr_ifrn.ifrn_name /* interface name */
+#define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */
+#define ifr_addr ifr_ifru.ifru_addr /* address */
+#define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-p lnk */
+#define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */
+#define ifr_netmask ifr_ifru.ifru_netmask /* interface net mask */
+#define ifr_flags ifr_ifru.ifru_flags /* flags */
+#define ifr_metric ifr_ifru.ifru_ivalue /* metric */
+#define ifr_mtu ifr_ifru.ifru_mtu /* mtu */
+#define ifr_map ifr_ifru.ifru_map /* device map */
+#define ifr_slave ifr_ifru.ifru_slave /* slave device */
+#define ifr_data ifr_ifru.ifru_data /* for use by interface */
+#define ifr_ifindex ifr_ifru.ifru_ivalue /* interface index */
+#define ifr_bandwidth ifr_ifru.ifru_ivalue /* link bandwidth */
+#define ifr_qlen ifr_ifru.ifru_ivalue /* Queue length */
+#define ifr_newname ifr_ifru.ifru_newname /* New name */
+#define ifr_settings ifr_ifru.ifru_settings /* Device/proto settings*/
+
+/*
+ * Structure used in SIOCGIFCONF request.
+ * Used to retrieve interface configuration
+ * for machine (useful for programs which
+ * must know all networks accessible).
+ */
+
+struct ifconf
+{
+ int ifc_len; /* size of buffer */
+ union
+ {
+ char *ifcu_buf;
+ struct ifreq *ifcu_req;
+ } ifc_ifcu;
+};
+#define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */
+#define ifc_req ifc_ifcu.ifcu_req /* array of structures */
+
+#endif /* _LINUX_IF_H */
diff --git a/sysroot/usr/include/linux/if_addr.h b/sysroot/usr/include/linux/if_addr.h
new file mode 100644
index 0000000..befcb3c
--- /dev/null
+++ b/sysroot/usr/include/linux/if_addr.h
@@ -0,0 +1,60 @@
+#ifndef __LINUX_IF_ADDR_H
+#define __LINUX_IF_ADDR_H
+
+#include <linux/netlink.h>
+
+struct ifaddrmsg
+{
+ __u8 ifa_family;
+ __u8 ifa_prefixlen; /* The prefix length */
+ __u8 ifa_flags; /* Flags */
+ __u8 ifa_scope; /* Address scope */
+ __u32 ifa_index; /* Link index */
+};
+
+/*
+ * Important comment:
+ * IFA_ADDRESS is prefix address, rather than local interface address.
+ * It makes no difference for normally configured broadcast interfaces,
+ * but for point-to-point IFA_ADDRESS is DESTINATION address,
+ * local address is supplied in IFA_LOCAL attribute.
+ */
+enum
+{
+ IFA_UNSPEC,
+ IFA_ADDRESS,
+ IFA_LOCAL,
+ IFA_LABEL,
+ IFA_BROADCAST,
+ IFA_ANYCAST,
+ IFA_CACHEINFO,
+ IFA_MULTICAST,
+ __IFA_MAX,
+};
+
+#define IFA_MAX (__IFA_MAX - 1)
+
+/* ifa_flags */
+#define IFA_F_SECONDARY 0x01
+#define IFA_F_TEMPORARY IFA_F_SECONDARY
+
+#define IFA_F_NODAD 0x02
+#define IFA_F_OPTIMISTIC 0x04
+#define IFA_F_HOMEADDRESS 0x10
+#define IFA_F_DEPRECATED 0x20
+#define IFA_F_TENTATIVE 0x40
+#define IFA_F_PERMANENT 0x80
+
+struct ifa_cacheinfo
+{
+ __u32 ifa_prefered;
+ __u32 ifa_valid;
+ __u32 cstamp; /* created timestamp, hundredths of seconds */
+ __u32 tstamp; /* updated timestamp, hundredths of seconds */
+};
+
+/* backwards compatibility for userspace */
+#define IFA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg))))
+#define IFA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifaddrmsg))
+
+#endif
diff --git a/sysroot/usr/include/linux/if_arcnet.h b/sysroot/usr/include/linux/if_arcnet.h
new file mode 100644
index 0000000..27ea2ac
--- /dev/null
+++ b/sysroot/usr/include/linux/if_arcnet.h
@@ -0,0 +1,137 @@
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Global definitions for the ARCnet interface.
+ *
+ * Authors: David Woodhouse and Avery Pennarun
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _LINUX_IF_ARCNET_H
+#define _LINUX_IF_ARCNET_H
+
+#include <linux/if_ether.h>
+
+
+/*
+ * These are the defined ARCnet Protocol ID's.
+ */
+
+/* CAP mode */
+/* No macro but uses 1-8 */
+
+/* RFC1201 Protocol ID's */
+#define ARC_P_IP 212 /* 0xD4 */
+#define ARC_P_IPV6 196 /* 0xC4: RFC2497 */
+#define ARC_P_ARP 213 /* 0xD5 */
+#define ARC_P_RARP 214 /* 0xD6 */
+#define ARC_P_IPX 250 /* 0xFA */
+#define ARC_P_NOVELL_EC 236 /* 0xEC */
+
+/* Old RFC1051 Protocol ID's */
+#define ARC_P_IP_RFC1051 240 /* 0xF0 */
+#define ARC_P_ARP_RFC1051 241 /* 0xF1 */
+
+/* MS LanMan/WfWg "NDIS" encapsulation */
+#define ARC_P_ETHER 232 /* 0xE8 */
+
+/* Unsupported/indirectly supported protocols */
+#define ARC_P_DATAPOINT_BOOT 0 /* very old Datapoint equipment */
+#define ARC_P_DATAPOINT_MOUNT 1
+#define ARC_P_POWERLAN_BEACON 8 /* Probably ATA-Netbios related */
+#define ARC_P_POWERLAN_BEACON2 243 /* 0xF3 */
+#define ARC_P_LANSOFT 251 /* 0xFB - what is this? */
+#define ARC_P_ATALK 0xDD
+
+/* Hardware address length */
+#define ARCNET_ALEN 1
+
+/*
+ * The RFC1201-specific components of an arcnet packet header.
+ */
+struct arc_rfc1201
+{
+ uint8_t proto; /* protocol ID field - varies */
+ uint8_t split_flag; /* for use with split packets */
+ __be16 sequence; /* sequence number */
+ uint8_t payload[0]; /* space remaining in packet (504 bytes)*/
+};
+#define RFC1201_HDR_SIZE 4
+
+
+/*
+ * The RFC1051-specific components.
+ */
+struct arc_rfc1051
+{
+ uint8_t proto; /* ARC_P_RFC1051_ARP/RFC1051_IP */
+ uint8_t payload[0]; /* 507 bytes */
+};
+#define RFC1051_HDR_SIZE 1
+
+
+/*
+ * The ethernet-encap-specific components. We have a real ethernet header
+ * and some data.
+ */
+struct arc_eth_encap
+{
+ uint8_t proto; /* Always ARC_P_ETHER */
+ struct ethhdr eth; /* standard ethernet header (yuck!) */
+ uint8_t payload[0]; /* 493 bytes */
+};
+#define ETH_ENCAP_HDR_SIZE 14
+
+
+struct arc_cap
+{
+ uint8_t proto;
+ uint8_t cookie[sizeof(int)]; /* Actually NOT sent over the network */
+ union {
+ uint8_t ack;
+ uint8_t raw[0]; /* 507 bytes */
+ } mes;
+};
+
+/*
+ * The data needed by the actual arcnet hardware.
+ *
+ * Now, in the real arcnet hardware, the third and fourth bytes are the
+ * 'offset' specification instead of the length, and the soft data is at
+ * the _end_ of the 512-byte buffer. We hide this complexity inside the
+ * driver.
+ */
+struct arc_hardware
+{
+ uint8_t source, /* source ARCnet - filled in automagically */
+ dest, /* destination ARCnet - 0 for broadcast */
+ offset[2]; /* offset bytes (some weird semantics) */
+};
+#define ARC_HDR_SIZE 4
+
+/*
+ * This is an ARCnet frame header, as seen by the kernel (and userspace,
+ * when you do a raw packet capture).
+ */
+struct archdr
+{
+ /* hardware requirements */
+ struct arc_hardware hard;
+
+ /* arcnet encapsulation-specific bits */
+ union {
+ struct arc_rfc1201 rfc1201;
+ struct arc_rfc1051 rfc1051;
+ struct arc_eth_encap eth_encap;
+ struct arc_cap cap;
+ uint8_t raw[0]; /* 508 bytes */
+ } soft;
+};
+
+#endif /* _LINUX_IF_ARCNET_H */
diff --git a/sysroot/usr/include/linux/if_arp.h b/sysroot/usr/include/linux/if_arp.h
new file mode 100644
index 0000000..1c309e4
--- /dev/null
+++ b/sysroot/usr/include/linux/if_arp.h
@@ -0,0 +1,152 @@
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Global definitions for the ARP (RFC 826) protocol.
+ *
+ * Version: @(#)if_arp.h 1.0.1 04/16/93
+ *
+ * Authors: Original taken from Berkeley UNIX 4.3, (c) UCB 1986-1988
+ * Portions taken from the KA9Q/NOS (v2.00m PA0GRI) source.
+ * Ross Biro
+ * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ * Florian La Roche,
+ * Jonathan Layes <layes@loran.com>
+ * Arnaldo Carvalho de Melo <acme@conectiva.com.br> ARPHRD_HWX25
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#ifndef _LINUX_IF_ARP_H
+#define _LINUX_IF_ARP_H
+
+#include <linux/netdevice.h>
+
+/* ARP protocol HARDWARE identifiers. */
+#define ARPHRD_NETROM 0 /* from KA9Q: NET/ROM pseudo */
+#define ARPHRD_ETHER 1 /* Ethernet 10Mbps */
+#define ARPHRD_EETHER 2 /* Experimental Ethernet */
+#define ARPHRD_AX25 3 /* AX.25 Level 2 */
+#define ARPHRD_PRONET 4 /* PROnet token ring */
+#define ARPHRD_CHAOS 5 /* Chaosnet */
+#define ARPHRD_IEEE802 6 /* IEEE 802.2 Ethernet/TR/TB */
+#define ARPHRD_ARCNET 7 /* ARCnet */
+#define ARPHRD_APPLETLK 8 /* APPLEtalk */
+#define ARPHRD_DLCI 15 /* Frame Relay DLCI */
+#define ARPHRD_ATM 19 /* ATM */
+#define ARPHRD_METRICOM 23 /* Metricom STRIP (new IANA id) */
+#define ARPHRD_IEEE1394 24 /* IEEE 1394 IPv4 - RFC 2734 */
+#define ARPHRD_EUI64 27 /* EUI-64 */
+#define ARPHRD_INFINIBAND 32 /* InfiniBand */
+
+/* Dummy types for non ARP hardware */
+#define ARPHRD_SLIP 256
+#define ARPHRD_CSLIP 257
+#define ARPHRD_SLIP6 258
+#define ARPHRD_CSLIP6 259
+#define ARPHRD_RSRVD 260 /* Notional KISS type */
+#define ARPHRD_ADAPT 264
+#define ARPHRD_ROSE 270
+#define ARPHRD_X25 271 /* CCITT X.25 */
+#define ARPHRD_HWX25 272 /* Boards with X.25 in firmware */
+#define ARPHRD_PPP 512
+#define ARPHRD_CISCO 513 /* Cisco HDLC */
+#define ARPHRD_HDLC ARPHRD_CISCO
+#define ARPHRD_LAPB 516 /* LAPB */
+#define ARPHRD_DDCMP 517 /* Digital's DDCMP protocol */
+#define ARPHRD_RAWHDLC 518 /* Raw HDLC */
+
+#define ARPHRD_TUNNEL 768 /* IPIP tunnel */
+#define ARPHRD_TUNNEL6 769 /* IP6IP6 tunnel */
+#define ARPHRD_FRAD 770 /* Frame Relay Access Device */
+#define ARPHRD_SKIP 771 /* SKIP vif */
+#define ARPHRD_LOOPBACK 772 /* Loopback device */
+#define ARPHRD_LOCALTLK 773 /* Localtalk device */
+#define ARPHRD_FDDI 774 /* Fiber Distributed Data Interface */
+#define ARPHRD_BIF 775 /* AP1000 BIF */
+#define ARPHRD_SIT 776 /* sit0 device - IPv6-in-IPv4 */
+#define ARPHRD_IPDDP 777 /* IP over DDP tunneller */
+#define ARPHRD_IPGRE 778 /* GRE over IP */
+#define ARPHRD_PIMREG 779 /* PIMSM register interface */
+#define ARPHRD_HIPPI 780 /* High Performance Parallel Interface */
+#define ARPHRD_ASH 781 /* Nexus 64Mbps Ash */
+#define ARPHRD_ECONET 782 /* Acorn Econet */
+#define ARPHRD_IRDA 783 /* Linux-IrDA */
+/* ARP works differently on different FC media .. so */
+#define ARPHRD_FCPP 784 /* Point to point fibrechannel */
+#define ARPHRD_FCAL 785 /* Fibrechannel arbitrated loop */
+#define ARPHRD_FCPL 786 /* Fibrechannel public loop */
+#define ARPHRD_FCFABRIC 787 /* Fibrechannel fabric */
+ /* 787->799 reserved for fibrechannel media types */
+#define ARPHRD_IEEE802_TR 800 /* Magic type ident for TR */
+#define ARPHRD_IEEE80211 801 /* IEEE 802.11 */
+#define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header */
+#define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header */
+
+#define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */
+#define ARPHRD_NONE 0xFFFE /* zero header length */
+
+/* ARP protocol opcodes. */
+#define ARPOP_REQUEST 1 /* ARP request */
+#define ARPOP_REPLY 2 /* ARP reply */
+#define ARPOP_RREQUEST 3 /* RARP request */
+#define ARPOP_RREPLY 4 /* RARP reply */
+#define ARPOP_InREQUEST 8 /* InARP request */
+#define ARPOP_InREPLY 9 /* InARP reply */
+#define ARPOP_NAK 10 /* (ATM)ARP NAK */
+
+
+/* ARP ioctl request. */
+struct arpreq {
+ struct sockaddr arp_pa; /* protocol address */
+ struct sockaddr arp_ha; /* hardware address */
+ int arp_flags; /* flags */
+ struct sockaddr arp_netmask; /* netmask (only for proxy arps) */
+ char arp_dev[16];
+};
+
+struct arpreq_old {
+ struct sockaddr arp_pa; /* protocol address */
+ struct sockaddr arp_ha; /* hardware address */
+ int arp_flags; /* flags */
+ struct sockaddr arp_netmask; /* netmask (only for proxy arps) */
+};
+
+/* ARP Flag values. */
+#define ATF_COM 0x02 /* completed entry (ha valid) */
+#define ATF_PERM 0x04 /* permanent entry */
+#define ATF_PUBL 0x08 /* publish entry */
+#define ATF_USETRAILERS 0x10 /* has requested trailers */
+#define ATF_NETMASK 0x20 /* want to use a netmask (only
+ for proxy entries) */
+#define ATF_DONTPUB 0x40 /* don't answer this addresses */
+
+/*
+ * This structure defines an ethernet arp header.
+ */
+
+struct arphdr
+{
+ __be16 ar_hrd; /* format of hardware address */
+ __be16 ar_pro; /* format of protocol address */
+ unsigned char ar_hln; /* length of hardware address */
+ unsigned char ar_pln; /* length of protocol address */
+ __be16 ar_op; /* ARP opcode (command) */
+
+#if 0
+ /*
+ * Ethernet looks like this : This bit is variable sized however...
+ */
+ unsigned char ar_sha[ETH_ALEN]; /* sender hardware address */
+ unsigned char ar_sip[4]; /* sender IP address */
+ unsigned char ar_tha[ETH_ALEN]; /* target hardware address */
+ unsigned char ar_tip[4]; /* target IP address */
+#endif
+
+};
+
+
+#endif /* _LINUX_IF_ARP_H */
diff --git a/sysroot/usr/include/linux/if_bonding.h b/sysroot/usr/include/linux/if_bonding.h
new file mode 100644
index 0000000..65c2d24
--- /dev/null
+++ b/sysroot/usr/include/linux/if_bonding.h
@@ -0,0 +1,125 @@
+/*
+ * Bond several ethernet interfaces into a Cisco, running 'Etherchannel'.
+ *
+ *
+ * Portions are (c) Copyright 1995 Simon "Guru Aleph-Null" Janes
+ * NCM: Network and Communications Management, Inc.
+ *
+ * BUT, I'm the one who modified it for ethernet, so:
+ * (c) Copyright 1999, Thomas Davis, tadavis@lbl.gov
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU Public License, incorporated herein by reference.
+ *
+ * 2003/03/18 - Amir Noam <amir.noam at intel dot com>
+ * - Added support for getting slave's speed and duplex via ethtool.
+ * Needed for 802.3ad and other future modes.
+ *
+ * 2003/03/18 - Tsippy Mendelson <tsippy.mendelson at intel dot com> and
+ * Shmulik Hen <shmulik.hen at intel dot com>
+ * - Enable support of modes that need to use the unique mac address of
+ * each slave.
+ *
+ * 2003/03/18 - Tsippy Mendelson <tsippy.mendelson at intel dot com> and
+ * Amir Noam <amir.noam at intel dot com>
+ * - Moved driver's private data types to bonding.h
+ *
+ * 2003/03/18 - Amir Noam <amir.noam at intel dot com>,
+ * Tsippy Mendelson <tsippy.mendelson at intel dot com> and
+ * Shmulik Hen <shmulik.hen at intel dot com>
+ * - Added support for IEEE 802.3ad Dynamic link aggregation mode.
+ *
+ * 2003/05/01 - Amir Noam <amir.noam at intel dot com>
+ * - Added ABI version control to restore compatibility between
+ * new/old ifenslave and new/old bonding.
+ *
+ * 2003/12/01 - Shmulik Hen <shmulik.hen at intel dot com>
+ * - Code cleanup and style changes
+ *
+ * 2005/05/05 - Jason Gabler <jygabler at lbl dot gov>
+ * - added definitions for various XOR hashing policies
+ */
+
+#ifndef _LINUX_IF_BONDING_H
+#define _LINUX_IF_BONDING_H
+
+#include <linux/if.h>
+#include <linux/types.h>
+#include <linux/if_ether.h>
+
+/* userland - kernel ABI version (2003/05/08) */
+#define BOND_ABI_VERSION 2
+
+/*
+ * We can remove these ioctl definitions in 2.5. People should use the
+ * SIOC*** versions of them instead
+ */
+#define BOND_ENSLAVE_OLD (SIOCDEVPRIVATE)
+#define BOND_RELEASE_OLD (SIOCDEVPRIVATE + 1)
+#define BOND_SETHWADDR_OLD (SIOCDEVPRIVATE + 2)
+#define BOND_SLAVE_INFO_QUERY_OLD (SIOCDEVPRIVATE + 11)
+#define BOND_INFO_QUERY_OLD (SIOCDEVPRIVATE + 12)
+#define BOND_CHANGE_ACTIVE_OLD (SIOCDEVPRIVATE + 13)
+
+#define BOND_CHECK_MII_STATUS (SIOCGMIIPHY)
+
+#define BOND_MODE_ROUNDROBIN 0
+#define BOND_MODE_ACTIVEBACKUP 1
+#define BOND_MODE_XOR 2
+#define BOND_MODE_BROADCAST 3
+#define BOND_MODE_8023AD 4
+#define BOND_MODE_TLB 5
+#define BOND_MODE_ALB 6 /* TLB + RLB (receive load balancing) */
+
+/* each slave's link has 4 states */
+#define BOND_LINK_UP 0 /* link is up and running */
+#define BOND_LINK_FAIL 1 /* link has just gone down */
+#define BOND_LINK_DOWN 2 /* link has been down for too long time */
+#define BOND_LINK_BACK 3 /* link is going back */
+
+/* each slave has several states */
+#define BOND_STATE_ACTIVE 0 /* link is active */
+#define BOND_STATE_BACKUP 1 /* link is backup */
+
+#define BOND_DEFAULT_MAX_BONDS 1 /* Default maximum number of devices to support */
+
+/* hashing types */
+#define BOND_XMIT_POLICY_LAYER2 0 /* layer 2 (MAC only), default */
+#define BOND_XMIT_POLICY_LAYER34 1 /* layer 3+4 (IP ^ (TCP || UDP)) */
+#define BOND_XMIT_POLICY_LAYER23 2 /* layer 2+3 (IP ^ MAC) */
+
+typedef struct ifbond {
+ __s32 bond_mode;
+ __s32 num_slaves;
+ __s32 miimon;
+} ifbond;
+
+typedef struct ifslave
+{
+ __s32 slave_id; /* Used as an IN param to the BOND_SLAVE_INFO_QUERY ioctl */
+ char slave_name[IFNAMSIZ];
+ __s8 link;
+ __s8 state;
+ __u32 link_failure_count;
+} ifslave;
+
+struct ad_info {
+ __u16 aggregator_id;
+ __u16 ports;
+ __u16 actor_key;
+ __u16 partner_key;
+ __u8 partner_system[ETH_ALEN];
+};
+
+#endif /* _LINUX_IF_BONDING_H */
+
+/*
+ * Local variables:
+ * version-control: t
+ * kept-new-versions: 5
+ * c-indent-level: 8
+ * c-basic-offset: 8
+ * tab-width: 8
+ * End:
+ */
+
diff --git a/sysroot/usr/include/linux/if_bridge.h b/sysroot/usr/include/linux/if_bridge.h
new file mode 100644
index 0000000..29618e8
--- /dev/null
+++ b/sysroot/usr/include/linux/if_bridge.h
@@ -0,0 +1,104 @@
+/*
+ * Linux ethernet bridge
+ *
+ * Authors:
+ * Lennert Buytenhek <buytenh@gnu.org>
+ *
+ * $Id: if_bridge.h,v 1.1 2000/02/18 16:47:01 davem Exp $
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _LINUX_IF_BRIDGE_H
+#define _LINUX_IF_BRIDGE_H
+
+#include <linux/types.h>
+
+#define SYSFS_BRIDGE_ATTR "bridge"
+#define SYSFS_BRIDGE_FDB "brforward"
+#define SYSFS_BRIDGE_PORT_SUBDIR "brif"
+#define SYSFS_BRIDGE_PORT_ATTR "brport"
+#define SYSFS_BRIDGE_PORT_LINK "bridge"
+
+#define BRCTL_VERSION 1
+
+#define BRCTL_GET_VERSION 0
+#define BRCTL_GET_BRIDGES 1
+#define BRCTL_ADD_BRIDGE 2
+#define BRCTL_DEL_BRIDGE 3
+#define BRCTL_ADD_IF 4
+#define BRCTL_DEL_IF 5
+#define BRCTL_GET_BRIDGE_INFO 6
+#define BRCTL_GET_PORT_LIST 7
+#define BRCTL_SET_BRIDGE_FORWARD_DELAY 8
+#define BRCTL_SET_BRIDGE_HELLO_TIME 9
+#define BRCTL_SET_BRIDGE_MAX_AGE 10
+#define BRCTL_SET_AGEING_TIME 11
+#define BRCTL_SET_GC_INTERVAL 12
+#define BRCTL_GET_PORT_INFO 13
+#define BRCTL_SET_BRIDGE_STP_STATE 14
+#define BRCTL_SET_BRIDGE_PRIORITY 15
+#define BRCTL_SET_PORT_PRIORITY 16
+#define BRCTL_SET_PATH_COST 17
+#define BRCTL_GET_FDB_ENTRIES 18
+
+#define BR_STATE_DISABLED 0
+#define BR_STATE_LISTENING 1
+#define BR_STATE_LEARNING 2
+#define BR_STATE_FORWARDING 3
+#define BR_STATE_BLOCKING 4
+
+struct __bridge_info
+{
+ __u64 designated_root;
+ __u64 bridge_id;
+ __u32 root_path_cost;
+ __u32 max_age;
+ __u32 hello_time;
+ __u32 forward_delay;
+ __u32 bridge_max_age;
+ __u32 bridge_hello_time;
+ __u32 bridge_forward_delay;
+ __u8 topology_change;
+ __u8 topology_change_detected;
+ __u8 root_port;
+ __u8 stp_enabled;
+ __u32 ageing_time;
+ __u32 gc_interval;
+ __u32 hello_timer_value;
+ __u32 tcn_timer_value;
+ __u32 topology_change_timer_value;
+ __u32 gc_timer_value;
+};
+
+struct __port_info
+{
+ __u64 designated_root;
+ __u64 designated_bridge;
+ __u16 port_id;
+ __u16 designated_port;
+ __u32 path_cost;
+ __u32 designated_cost;
+ __u8 state;
+ __u8 top_change_ack;
+ __u8 config_pending;
+ __u8 unused0;
+ __u32 message_age_timer_value;
+ __u32 forward_delay_timer_value;
+ __u32 hold_timer_value;
+};
+
+struct __fdb_entry
+{
+ __u8 mac_addr[6];
+ __u8 port_no;
+ __u8 is_local;
+ __u32 ageing_timer_value;
+ __u32 unused;
+};
+
+
+#endif
diff --git a/sysroot/usr/include/linux/if_cablemodem.h b/sysroot/usr/include/linux/if_cablemodem.h
new file mode 100644
index 0000000..9ca1007
--- /dev/null
+++ b/sysroot/usr/include/linux/if_cablemodem.h
@@ -0,0 +1,22 @@
+#ifndef _LINUX_CABLEMODEM_H_
+#define _LINUX_CABLEMODEM_H_
+/*
+ * Author: Franco Venturi <fventuri@mediaone.net>
+ * Copyright 1998 Franco Venturi
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ */
+
+/* some useful defines for sb1000.c e cmconfig.c - fv */
+#define SIOCGCMSTATS SIOCDEVPRIVATE+0 /* get cable modem stats */
+#define SIOCGCMFIRMWARE SIOCDEVPRIVATE+1 /* get cm firmware version */
+#define SIOCGCMFREQUENCY SIOCDEVPRIVATE+2 /* get cable modem frequency */
+#define SIOCSCMFREQUENCY SIOCDEVPRIVATE+3 /* set cable modem frequency */
+#define SIOCGCMPIDS SIOCDEVPRIVATE+4 /* get cable modem PIDs */
+#define SIOCSCMPIDS SIOCDEVPRIVATE+5 /* set cable modem PIDs */
+
+#endif
diff --git a/sysroot/usr/include/linux/if_ec.h b/sysroot/usr/include/linux/if_ec.h
new file mode 100644
index 0000000..a8b81f8
--- /dev/null
+++ b/sysroot/usr/include/linux/if_ec.h
@@ -0,0 +1,36 @@
+/* Definitions for Econet sockets. */
+
+#ifndef __LINUX_IF_EC
+#define __LINUX_IF_EC
+
+/* User visible stuff. Glibc provides its own but libc5 folk will use these */
+
+struct ec_addr
+{
+ unsigned char station; /* Station number. */
+ unsigned char net; /* Network number. */
+};
+
+struct sockaddr_ec
+{
+ unsigned short sec_family;
+ unsigned char port; /* Port number. */
+ unsigned char cb; /* Control/flag byte. */
+ unsigned char type; /* Type of message. */
+ struct ec_addr addr;
+ unsigned long cookie;
+};
+
+#define ECTYPE_PACKET_RECEIVED 0 /* Packet received */
+#define ECTYPE_TRANSMIT_STATUS 0x10 /* Transmit completed,
+ low nibble holds status */
+
+#define ECTYPE_TRANSMIT_OK 1
+#define ECTYPE_TRANSMIT_NOT_LISTENING 2
+#define ECTYPE_TRANSMIT_NET_ERROR 3
+#define ECTYPE_TRANSMIT_NO_CLOCK 4
+#define ECTYPE_TRANSMIT_LINE_JAMMED 5
+#define ECTYPE_TRANSMIT_NOT_PRESENT 6
+
+
+#endif
diff --git a/sysroot/usr/include/linux/if_eql.h b/sysroot/usr/include/linux/if_eql.h
new file mode 100644
index 0000000..c0b94ec
--- /dev/null
+++ b/sysroot/usr/include/linux/if_eql.h
@@ -0,0 +1,54 @@
+/*
+ * Equalizer Load-balancer for serial network interfaces.
+ *
+ * (c) Copyright 1995 Simon "Guru Aleph-Null" Janes
+ * NCM: Network and Communications Management, Inc.
+ *
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
+ * The author may be reached as simon@ncm.com, or C/O
+ * NCM
+ * Attn: Simon Janes
+ * 6803 Whittier Ave
+ * McLean VA 22101
+ * Phone: 1-703-847-0040 ext 103
+ */
+
+#ifndef _LINUX_IF_EQL_H
+#define _LINUX_IF_EQL_H
+
+#define EQL_DEFAULT_SLAVE_PRIORITY 28800
+#define EQL_DEFAULT_MAX_SLAVES 4
+#define EQL_DEFAULT_MTU 576
+#define EQL_DEFAULT_RESCHED_IVAL 100
+
+#define EQL_ENSLAVE (SIOCDEVPRIVATE)
+#define EQL_EMANCIPATE (SIOCDEVPRIVATE + 1)
+
+#define EQL_GETSLAVECFG (SIOCDEVPRIVATE + 2)
+#define EQL_SETSLAVECFG (SIOCDEVPRIVATE + 3)
+
+#define EQL_GETMASTRCFG (SIOCDEVPRIVATE + 4)
+#define EQL_SETMASTRCFG (SIOCDEVPRIVATE + 5)
+
+
+typedef struct master_config {
+ char master_name[16];
+ int max_slaves;
+ int min_slaves;
+} master_config_t;
+
+typedef struct slave_config {
+ char slave_name[16];
+ long priority;
+} slave_config_t;
+
+typedef struct slaving_request {
+ char slave_name[16];
+ long priority;
+} slaving_request_t;
+
+
+#endif /* _LINUX_EQL_H */
diff --git a/sysroot/usr/include/linux/if_ether.h b/sysroot/usr/include/linux/if_ether.h
new file mode 100644
index 0000000..4426961
--- /dev/null
+++ b/sysroot/usr/include/linux/if_ether.h
@@ -0,0 +1,113 @@
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Global definitions for the Ethernet IEEE 802.3 interface.
+ *
+ * Version: @(#)if_ether.h 1.0.1a 02/08/94
+ *
+ * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ * Donald Becker, <becker@super.org>
+ * Alan Cox, <alan@redhat.com>
+ * Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _LINUX_IF_ETHER_H
+#define _LINUX_IF_ETHER_H
+
+#include <linux/types.h>
+
+/*
+ * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble
+ * and FCS/CRC (frame check sequence).
+ */
+
+#define ETH_ALEN 6 /* Octets in one ethernet addr */
+#define ETH_HLEN 14 /* Total octets in header. */
+#define ETH_ZLEN 60 /* Min. octets in frame sans FCS */
+#define ETH_DATA_LEN 1500 /* Max. octets in payload */
+#define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */
+#define ETH_FCS_LEN 4 /* Octets in the FCS */
+
+/*
+ * These are the defined Ethernet Protocol ID's.
+ */
+
+#define ETH_P_LOOP 0x0060 /* Ethernet Loopback packet */
+#define ETH_P_PUP 0x0200 /* Xerox PUP packet */
+#define ETH_P_PUPAT 0x0201 /* Xerox PUP Addr Trans packet */
+#define ETH_P_IP 0x0800 /* Internet Protocol packet */
+#define ETH_P_X25 0x0805 /* CCITT X.25 */
+#define ETH_P_ARP 0x0806 /* Address Resolution packet */
+#define ETH_P_BPQ 0x08FF /* G8BPQ AX.25 Ethernet Packet [ NOT AN OFFICIALLY REGISTERED ID ] */
+#define ETH_P_IEEEPUP 0x0a00 /* Xerox IEEE802.3 PUP packet */
+#define ETH_P_IEEEPUPAT 0x0a01 /* Xerox IEEE802.3 PUP Addr Trans packet */
+#define ETH_P_DEC 0x6000 /* DEC Assigned proto */
+#define ETH_P_DNA_DL 0x6001 /* DEC DNA Dump/Load */
+#define ETH_P_DNA_RC 0x6002 /* DEC DNA Remote Console */
+#define ETH_P_DNA_RT 0x6003 /* DEC DNA Routing */
+#define ETH_P_LAT 0x6004 /* DEC LAT */
+#define ETH_P_DIAG 0x6005 /* DEC Diagnostics */
+#define ETH_P_CUST 0x6006 /* DEC Customer use */
+#define ETH_P_SCA 0x6007 /* DEC Systems Comms Arch */
+#define ETH_P_RARP 0x8035 /* Reverse Addr Res packet */
+#define ETH_P_ATALK 0x809B /* Appletalk DDP */
+#define ETH_P_AARP 0x80F3 /* Appletalk AARP */
+#define ETH_P_8021Q 0x8100 /* 802.1Q VLAN Extended Header */
+#define ETH_P_IPX 0x8137 /* IPX over DIX */
+#define ETH_P_IPV6 0x86DD /* IPv6 over bluebook */
+#define ETH_P_PAUSE 0x8808 /* IEEE Pause frames. See 802.3 31B */
+#define ETH_P_SLOW 0x8809 /* Slow Protocol. See 802.3ad 43B */
+#define ETH_P_WCCP 0x883E /* Web-cache coordination protocol
+ * defined in draft-wilson-wrec-wccp-v2-00.txt */
+#define ETH_P_PPP_DISC 0x8863 /* PPPoE discovery messages */
+#define ETH_P_PPP_SES 0x8864 /* PPPoE session messages */
+#define ETH_P_MPLS_UC 0x8847 /* MPLS Unicast traffic */
+#define ETH_P_MPLS_MC 0x8848 /* MPLS Multicast traffic */
+#define ETH_P_ATMMPOA 0x884c /* MultiProtocol Over ATM */
+#define ETH_P_ATMFATE 0x8884 /* Frame-based ATM Transport
+ * over Ethernet
+ */
+#define ETH_P_AOE 0x88A2 /* ATA over Ethernet */
+#define ETH_P_TIPC 0x88CA /* TIPC */
+
+/*
+ * Non DIX types. Won't clash for 1500 types.
+ */
+
+#define ETH_P_802_3 0x0001 /* Dummy type for 802.3 frames */
+#define ETH_P_AX25 0x0002 /* Dummy protocol id for AX.25 */
+#define ETH_P_ALL 0x0003 /* Every packet (be careful!!!) */
+#define ETH_P_802_2 0x0004 /* 802.2 frames */
+#define ETH_P_SNAP 0x0005 /* Internal only */
+#define ETH_P_DDCMP 0x0006 /* DEC DDCMP: Internal only */
+#define ETH_P_WAN_PPP 0x0007 /* Dummy type for WAN PPP frames*/
+#define ETH_P_PPP_MP 0x0008 /* Dummy type for PPP MP frames */
+#define ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */
+#define ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/
+#define ETH_P_TR_802_2 0x0011 /* 802.2 frames */
+#define ETH_P_MOBITEX 0x0015 /* Mobitex (kaz@cafe.net) */
+#define ETH_P_CONTROL 0x0016 /* Card specific control frames */
+#define ETH_P_IRDA 0x0017 /* Linux-IrDA */
+#define ETH_P_ECONET 0x0018 /* Acorn Econet */
+#define ETH_P_HDLC 0x0019 /* HDLC frames */
+#define ETH_P_ARCNET 0x001A /* 1A for ArcNet :-) */
+
+/*
+ * This is an Ethernet frame header.
+ */
+
+struct ethhdr {
+ unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
+ unsigned char h_source[ETH_ALEN]; /* source ether addr */
+ __be16 h_proto; /* packet type ID field */
+} __attribute__((packed));
+
+
+#endif /* _LINUX_IF_ETHER_H */
diff --git a/sysroot/usr/include/linux/if_fc.h b/sysroot/usr/include/linux/if_fc.h
new file mode 100644
index 0000000..376a34e
--- /dev/null
+++ b/sysroot/usr/include/linux/if_fc.h
@@ -0,0 +1,50 @@
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Global definitions for Fibre Channel.
+ *
+ * Version: @(#)if_fc.h 0.0 11/20/98
+ *
+ * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ * Donald Becker, <becker@super.org>
+ * Peter De Schrijver, <stud11@cc4.kuleuven.ac.be>
+ * Vineet Abraham, <vma@iol.unh.edu>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#ifndef _LINUX_IF_FC_H
+#define _LINUX_IF_FC_H
+
+
+#define FC_ALEN 6 /* Octets in one ethernet addr */
+#define FC_HLEN (sizeof(struct fch_hdr)+sizeof(struct fcllc))
+#define FC_ID_LEN 3 /* Octets in a Fibre Channel Address */
+
+/* LLC and SNAP constants */
+#define EXTENDED_SAP 0xAA
+#define UI_CMD 0x03
+
+/* This is NOT the Fibre Channel frame header. The FC frame header is
+ * constructed in the driver as the Tachyon needs certain fields in
+ * certains positions. So, it can't be generalized here.*/
+
+struct fch_hdr {
+ __u8 daddr[FC_ALEN]; /* destination address */
+ __u8 saddr[FC_ALEN]; /* source address */
+};
+
+/* This is a Fibre Channel LLC structure */
+struct fcllc {
+ __u8 dsap; /* destination SAP */
+ __u8 ssap; /* source SAP */
+ __u8 llc; /* LLC control field */
+ __u8 protid[3]; /* protocol id */
+ __be16 ethertype; /* ether type field */
+};
+
+#endif /* _LINUX_IF_FC_H */
diff --git a/sysroot/usr/include/linux/if_fddi.h b/sysroot/usr/include/linux/if_fddi.h
new file mode 100644
index 0000000..fe2bf4c
--- /dev/null
+++ b/sysroot/usr/include/linux/if_fddi.h
@@ -0,0 +1,108 @@
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Global definitions for the ANSI FDDI interface.
+ *
+ * Version: @(#)if_fddi.h 1.0.2 Sep 29 2004
+ *
+ * Author: Lawrence V. Stefani, <stefani@lkg.dec.com>
+ *
+ * if_fddi.h is based on previous if_ether.h and if_tr.h work by
+ * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ * Donald Becker, <becker@super.org>
+ * Alan Cox, <alan@redhat.com>
+ * Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk>
+ * Peter De Schrijver, <stud11@cc4.kuleuven.ac.be>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#ifndef _LINUX_IF_FDDI_H
+#define _LINUX_IF_FDDI_H
+
+#include <linux/types.h>
+
+/*
+ * Define max and min legal sizes. The frame sizes do not include
+ * 4 byte FCS/CRC (frame check sequence).
+ */
+#define FDDI_K_ALEN 6 /* Octets in one FDDI address */
+#define FDDI_K_8022_HLEN 16 /* Total octets in 802.2 header */
+#define FDDI_K_SNAP_HLEN 21 /* Total octets in 802.2 SNAP header */
+#define FDDI_K_8022_ZLEN 16 /* Min octets in 802.2 frame sans FCS */
+#define FDDI_K_SNAP_ZLEN 21 /* Min octets in 802.2 SNAP frame sans FCS */
+#define FDDI_K_8022_DLEN 4475 /* Max octets in 802.2 payload */
+#define FDDI_K_SNAP_DLEN 4470 /* Max octets in 802.2 SNAP payload */
+#define FDDI_K_LLC_ZLEN 13 /* Min octets in LLC frame sans FCS */
+#define FDDI_K_LLC_LEN 4491 /* Max octets in LLC frame sans FCS */
+
+/* Define FDDI Frame Control (FC) Byte values */
+#define FDDI_FC_K_VOID 0x00
+#define FDDI_FC_K_NON_RESTRICTED_TOKEN 0x80
+#define FDDI_FC_K_RESTRICTED_TOKEN 0xC0
+#define FDDI_FC_K_SMT_MIN 0x41
+#define FDDI_FC_K_SMT_MAX 0x4F
+#define FDDI_FC_K_MAC_MIN 0xC1
+#define FDDI_FC_K_MAC_MAX 0xCF
+#define FDDI_FC_K_ASYNC_LLC_MIN 0x50
+#define FDDI_FC_K_ASYNC_LLC_DEF 0x54
+#define FDDI_FC_K_ASYNC_LLC_MAX 0x5F
+#define FDDI_FC_K_SYNC_LLC_MIN 0xD0
+#define FDDI_FC_K_SYNC_LLC_MAX 0xD7
+#define FDDI_FC_K_IMPLEMENTOR_MIN 0x60
+#define FDDI_FC_K_IMPLEMENTOR_MAX 0x6F
+#define FDDI_FC_K_RESERVED_MIN 0x70
+#define FDDI_FC_K_RESERVED_MAX 0x7F
+
+/* Define LLC and SNAP constants */
+#define FDDI_EXTENDED_SAP 0xAA
+#define FDDI_UI_CMD 0x03
+
+/* Define 802.2 Type 1 header */
+struct fddi_8022_1_hdr
+ {
+ __u8 dsap; /* destination service access point */
+ __u8 ssap; /* source service access point */
+ __u8 ctrl; /* control byte #1 */
+ } __attribute__ ((packed));
+
+/* Define 802.2 Type 2 header */
+struct fddi_8022_2_hdr
+ {
+ __u8 dsap; /* destination service access point */
+ __u8 ssap; /* source service access point */
+ __u8 ctrl_1; /* control byte #1 */
+ __u8 ctrl_2; /* control byte #2 */
+ } __attribute__ ((packed));
+
+/* Define 802.2 SNAP header */
+#define FDDI_K_OUI_LEN 3
+struct fddi_snap_hdr
+ {
+ __u8 dsap; /* always 0xAA */
+ __u8 ssap; /* always 0xAA */
+ __u8 ctrl; /* always 0x03 */
+ __u8 oui[FDDI_K_OUI_LEN]; /* organizational universal id */
+ __be16 ethertype; /* packet type ID field */
+ } __attribute__ ((packed));
+
+/* Define FDDI LLC frame header */
+struct fddihdr
+ {
+ __u8 fc; /* frame control */
+ __u8 daddr[FDDI_K_ALEN]; /* destination address */
+ __u8 saddr[FDDI_K_ALEN]; /* source address */
+ union
+ {
+ struct fddi_8022_1_hdr llc_8022_1;
+ struct fddi_8022_2_hdr llc_8022_2;
+ struct fddi_snap_hdr llc_snap;
+ } hdr;
+ } __attribute__ ((packed));
+
+
+#endif /* _LINUX_IF_FDDI_H */
diff --git a/sysroot/usr/include/linux/if_frad.h b/sysroot/usr/include/linux/if_frad.h
new file mode 100644
index 0000000..d0740c1
--- /dev/null
+++ b/sysroot/usr/include/linux/if_frad.h
@@ -0,0 +1,132 @@
+/*
+ * DLCI/FRAD Definitions for Frame Relay Access Devices. DLCI devices are
+ * created for each DLCI associated with a FRAD. The FRAD driver
+ * is not truly a network device, but the lower level device
+ * handler. This allows other FRAD manufacturers to use the DLCI
+ * code, including its RFC1490 encapsulation alongside the current
+ * implementation for the Sangoma cards.
+ *
+ * Version: @(#)if_ifrad.h 0.15 31 Mar 96
+ *
+ * Author: Mike McLagan <mike.mclagan@linux.org>
+ *
+ * Changes:
+ * 0.15 Mike McLagan changed structure defs (packed)
+ * re-arranged flags
+ * added DLCI_RET vars
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _FRAD_H_
+#define _FRAD_H_
+
+#include <linux/if.h>
+
+#if defined(CONFIG_DLCI) || defined(CONFIG_DLCI_MODULE)
+
+/* Structures and constants associated with the DLCI device driver */
+
+struct dlci_add
+{
+ char devname[IFNAMSIZ];
+ short dlci;
+};
+
+#define DLCI_GET_CONF (SIOCDEVPRIVATE + 2)
+#define DLCI_SET_CONF (SIOCDEVPRIVATE + 3)
+
+/*
+ * These are related to the Sangoma SDLA and should remain in order.
+ * Code within the SDLA module is based on the specifics of this
+ * structure. Change at your own peril.
+ */
+struct dlci_conf {
+ short flags;
+ short CIR_fwd;
+ short Bc_fwd;
+ short Be_fwd;
+ short CIR_bwd;
+ short Bc_bwd;
+ short Be_bwd;
+
+/* these are part of the status read */
+ short Tc_fwd;
+ short Tc_bwd;
+ short Tf_max;
+ short Tb_max;
+
+/* add any new fields here above is a mirror of sdla_dlci_conf */
+};
+
+#define DLCI_GET_SLAVE (SIOCDEVPRIVATE + 4)
+
+/* configuration flags for DLCI */
+#define DLCI_IGNORE_CIR_OUT 0x0001
+#define DLCI_ACCOUNT_CIR_IN 0x0002
+#define DLCI_BUFFER_IF 0x0008
+
+#define DLCI_VALID_FLAGS 0x000B
+
+/* FRAD driver uses these to indicate what it did with packet */
+#define DLCI_RET_OK 0x00
+#define DLCI_RET_ERR 0x01
+#define DLCI_RET_DROP 0x02
+
+/* defines for the actual Frame Relay hardware */
+#define FRAD_GET_CONF (SIOCDEVPRIVATE)
+#define FRAD_SET_CONF (SIOCDEVPRIVATE + 1)
+
+#define FRAD_LAST_IOCTL FRAD_SET_CONF
+
+/*
+ * Based on the setup for the Sangoma SDLA. If changes are
+ * necessary to this structure, a routine will need to be
+ * added to that module to copy fields.
+ */
+struct frad_conf
+{
+ short station;
+ short flags;
+ short kbaud;
+ short clocking;
+ short mtu;
+ short T391;
+ short T392;
+ short N391;
+ short N392;
+ short N393;
+ short CIR_fwd;
+ short Bc_fwd;
+ short Be_fwd;
+ short CIR_bwd;
+ short Bc_bwd;
+ short Be_bwd;
+
+/* Add new fields here, above is a mirror of the sdla_conf */
+
+};
+
+#define FRAD_STATION_CPE 0x0000
+#define FRAD_STATION_NODE 0x0001
+
+#define FRAD_TX_IGNORE_CIR 0x0001
+#define FRAD_RX_ACCOUNT_CIR 0x0002
+#define FRAD_DROP_ABORTED 0x0004
+#define FRAD_BUFFERIF 0x0008
+#define FRAD_STATS 0x0010
+#define FRAD_MCI 0x0100
+#define FRAD_AUTODLCI 0x8000
+#define FRAD_VALID_FLAGS 0x811F
+
+#define FRAD_CLOCK_INT 0x0001
+#define FRAD_CLOCK_EXT 0x0000
+
+
+#endif /* CONFIG_DLCI || CONFIG_DLCI_MODULE */
+
+
+#endif
diff --git a/sysroot/usr/include/linux/if_hippi.h b/sysroot/usr/include/linux/if_hippi.h
new file mode 100644
index 0000000..94d31ca
--- /dev/null
+++ b/sysroot/usr/include/linux/if_hippi.h
@@ -0,0 +1,157 @@
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Global definitions for the HIPPI interface.
+ *
+ * Version: @(#)if_hippi.h 1.0.0 05/26/97
+ *
+ * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ * Donald Becker, <becker@super.org>
+ * Alan Cox, <alan@redhat.com>
+ * Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk>
+ * Jes Sorensen, <Jes.Sorensen@cern.ch>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _LINUX_IF_HIPPI_H
+#define _LINUX_IF_HIPPI_H
+
+#include <asm/byteorder.h>
+
+/*
+ * HIPPI magic constants.
+ */
+
+#define HIPPI_ALEN 6 /* Bytes in one HIPPI hw-addr */
+#define HIPPI_HLEN sizeof(struct hippi_hdr)
+#define HIPPI_ZLEN 0 /* Min. bytes in frame without FCS */
+#define HIPPI_DATA_LEN 65280 /* Max. bytes in payload */
+#define HIPPI_FRAME_LEN (HIPPI_DATA_LEN + HIPPI_HLEN)
+ /* Max. bytes in frame without FCS */
+
+/*
+ * Define LLC and SNAP constants.
+ */
+#define HIPPI_EXTENDED_SAP 0xAA
+#define HIPPI_UI_CMD 0x03
+
+
+/*
+ * Do we need to list some sort of ID's here?
+ */
+
+/*
+ * HIPPI statistics collection data.
+ */
+
+struct hipnet_statistics
+{
+ int rx_packets; /* total packets received */
+ int tx_packets; /* total packets transmitted */
+ int rx_errors; /* bad packets received */
+ int tx_errors; /* packet transmit problems */
+ int rx_dropped; /* no space in linux buffers */
+ int tx_dropped; /* no space available in linux */
+
+ /* detailed rx_errors: */
+ int rx_length_errors;
+ int rx_over_errors; /* receiver ring buff overflow */
+ int rx_crc_errors; /* recved pkt with crc error */
+ int rx_frame_errors; /* recv'd frame alignment error */
+ int rx_fifo_errors; /* recv'r fifo overrun */
+ int rx_missed_errors; /* receiver missed packet */
+
+ /* detailed tx_errors */
+ int tx_aborted_errors;
+ int tx_carrier_errors;
+ int tx_fifo_errors;
+ int tx_heartbeat_errors;
+ int tx_window_errors;
+};
+
+
+struct hippi_fp_hdr
+{
+#if 0
+ __u8 ulp; /* must contain 4 */
+#if defined (__BIG_ENDIAN_BITFIELD)
+ __u8 d1_data_present:1; /* must be 1 */
+ __u8 start_d2_burst_boundary:1; /* must be zero */
+ __u8 reserved:6; /* must be zero */
+#if 0
+ __u16 reserved1:5;
+ __u16 d1_area_size:8; /* must be 3 */
+ __u16 d2_offset:3; /* must be zero */
+#endif
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 reserved:6; /* must be zero */
+ __u8 start_d2_burst_boundary:1; /* must be zero */
+ __u8 d1_data_present:1; /* must be 1 */
+#if 0
+ __u16 d2_offset:3; /* must be zero */
+ __u16 d1_area_size:8; /* must be 3 */
+ __u16 reserved1:5; /* must be zero */
+#endif
+#else
+#error "Please fix <asm/byteorder.h>"
+#endif
+#else
+ __be32 fixed;
+#endif
+ __be32 d2_size;
+} __attribute__ ((packed));
+
+struct hippi_le_hdr
+{
+#if defined (__BIG_ENDIAN_BITFIELD)
+ __u8 fc:3;
+ __u8 double_wide:1;
+ __u8 message_type:4;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 message_type:4;
+ __u8 double_wide:1;
+ __u8 fc:3;
+#endif
+ __u8 dest_switch_addr[3];
+#if defined (__BIG_ENDIAN_BITFIELD)
+ __u8 dest_addr_type:4,
+ src_addr_type:4;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 src_addr_type:4,
+ dest_addr_type:4;
+#endif
+ __u8 src_switch_addr[3];
+ __u16 reserved;
+ __u8 daddr[HIPPI_ALEN];
+ __u16 locally_administered;
+ __u8 saddr[HIPPI_ALEN];
+} __attribute__ ((packed));
+
+#define HIPPI_OUI_LEN 3
+/*
+ * Looks like the dsap and ssap fields have been swapped by mistake in
+ * RFC 2067 "IP over HIPPI".
+ */
+struct hippi_snap_hdr
+{
+ __u8 dsap; /* always 0xAA */
+ __u8 ssap; /* always 0xAA */
+ __u8 ctrl; /* always 0x03 */
+ __u8 oui[HIPPI_OUI_LEN]; /* organizational universal id (zero)*/
+ __be16 ethertype; /* packet type ID field */
+} __attribute__ ((packed));
+
+struct hippi_hdr
+{
+ struct hippi_fp_hdr fp;
+ struct hippi_le_hdr le;
+ struct hippi_snap_hdr snap;
+} __attribute__ ((packed));
+
+#endif /* _LINUX_IF_HIPPI_H */
diff --git a/sysroot/usr/include/linux/if_infiniband.h b/sysroot/usr/include/linux/if_infiniband.h
new file mode 100644
index 0000000..3e659ec
--- /dev/null
+++ b/sysroot/usr/include/linux/if_infiniband.h
@@ -0,0 +1,29 @@
+/*
+ * This software is available to you under a choice of one of two
+ * licenses. You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available at
+ * <http://www.fsf.org/copyleft/gpl.html>, or the OpenIB.org BSD
+ * license, available in the LICENSE.TXT file accompanying this
+ * software. These details are also available at
+ * <http://openib.org/license.html>.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * Copyright (c) 2004 Topspin Communications. All rights reserved.
+ *
+ * $Id$
+ */
+
+#ifndef _LINUX_IF_INFINIBAND_H
+#define _LINUX_IF_INFINIBAND_H
+
+#define INFINIBAND_ALEN 20 /* Octets in IPoIB HW addr */
+
+#endif /* _LINUX_IF_INFINIBAND_H */
diff --git a/sysroot/usr/include/linux/if_link.h b/sysroot/usr/include/linux/if_link.h
new file mode 100644
index 0000000..c948395
--- /dev/null
+++ b/sysroot/usr/include/linux/if_link.h
@@ -0,0 +1,189 @@
+#ifndef _LINUX_IF_LINK_H
+#define _LINUX_IF_LINK_H
+
+#include <linux/netlink.h>
+
+/* The struct should be in sync with struct net_device_stats */
+struct rtnl_link_stats
+{
+ __u32 rx_packets; /* total packets received */
+ __u32 tx_packets; /* total packets transmitted */
+ __u32 rx_bytes; /* total bytes received */
+ __u32 tx_bytes; /* total bytes transmitted */
+ __u32 rx_errors; /* bad packets received */
+ __u32 tx_errors; /* packet transmit problems */
+ __u32 rx_dropped; /* no space in linux buffers */
+ __u32 tx_dropped; /* no space available in linux */
+ __u32 multicast; /* multicast packets received */
+ __u32 collisions;
+
+ /* detailed rx_errors: */
+ __u32 rx_length_errors;
+ __u32 rx_over_errors; /* receiver ring buff overflow */
+ __u32 rx_crc_errors; /* recved pkt with crc error */
+ __u32 rx_frame_errors; /* recv'd frame alignment error */
+ __u32 rx_fifo_errors; /* recv'r fifo overrun */
+ __u32 rx_missed_errors; /* receiver missed packet */
+
+ /* detailed tx_errors */
+ __u32 tx_aborted_errors;
+ __u32 tx_carrier_errors;
+ __u32 tx_fifo_errors;
+ __u32 tx_heartbeat_errors;
+ __u32 tx_window_errors;
+
+ /* for cslip etc */
+ __u32 rx_compressed;
+ __u32 tx_compressed;
+};
+
+/* The struct should be in sync with struct ifmap */
+struct rtnl_link_ifmap
+{
+ __u64 mem_start;
+ __u64 mem_end;
+ __u64 base_addr;
+ __u16 irq;
+ __u8 dma;
+ __u8 port;
+};
+
+enum
+{
+ IFLA_UNSPEC,
+ IFLA_ADDRESS,
+ IFLA_BROADCAST,
+ IFLA_IFNAME,
+ IFLA_MTU,
+ IFLA_LINK,
+ IFLA_QDISC,
+ IFLA_STATS,
+ IFLA_COST,
+#define IFLA_COST IFLA_COST
+ IFLA_PRIORITY,
+#define IFLA_PRIORITY IFLA_PRIORITY
+ IFLA_MASTER,
+#define IFLA_MASTER IFLA_MASTER
+ IFLA_WIRELESS, /* Wireless Extension event - see wireless.h */
+#define IFLA_WIRELESS IFLA_WIRELESS
+ IFLA_PROTINFO, /* Protocol specific information for a link */
+#define IFLA_PROTINFO IFLA_PROTINFO
+ IFLA_TXQLEN,
+#define IFLA_TXQLEN IFLA_TXQLEN
+ IFLA_MAP,
+#define IFLA_MAP IFLA_MAP
+ IFLA_WEIGHT,
+#define IFLA_WEIGHT IFLA_WEIGHT
+ IFLA_OPERSTATE,
+ IFLA_LINKMODE,
+ IFLA_LINKINFO,
+#define IFLA_LINKINFO IFLA_LINKINFO
+ IFLA_NET_NS_PID,
+ __IFLA_MAX
+};
+
+
+#define IFLA_MAX (__IFLA_MAX - 1)
+
+/* backwards compatibility for userspace */
+#define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
+#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
+
+/* ifi_flags.
+
+ IFF_* flags.
+
+ The only change is:
+ IFF_LOOPBACK, IFF_BROADCAST and IFF_POINTOPOINT are
+ more not changeable by user. They describe link media
+ characteristics and set by device driver.
+
+ Comments:
+ - Combination IFF_BROADCAST|IFF_POINTOPOINT is invalid
+ - If neither of these three flags are set;
+ the interface is NBMA.
+
+ - IFF_MULTICAST does not mean anything special:
+ multicasts can be used on all not-NBMA links.
+ IFF_MULTICAST means that this media uses special encapsulation
+ for multicast frames. Apparently, all IFF_POINTOPOINT and
+ IFF_BROADCAST devices are able to use multicasts too.
+ */
+
+/* IFLA_LINK.
+ For usual devices it is equal ifi_index.
+ If it is a "virtual interface" (f.e. tunnel), ifi_link
+ can point to real physical interface (f.e. for bandwidth calculations),
+ or maybe 0, what means, that real media is unknown (usual
+ for IPIP tunnels, when route to endpoint is allowed to change)
+ */
+
+/* Subtype attributes for IFLA_PROTINFO */
+enum
+{
+ IFLA_INET6_UNSPEC,
+ IFLA_INET6_FLAGS, /* link flags */
+ IFLA_INET6_CONF, /* sysctl parameters */
+ IFLA_INET6_STATS, /* statistics */
+ IFLA_INET6_MCAST, /* MC things. What of them? */
+ IFLA_INET6_CACHEINFO, /* time values and max reasm size */
+ IFLA_INET6_ICMP6STATS, /* statistics (icmpv6) */
+ __IFLA_INET6_MAX
+};
+
+#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1)
+
+struct ifla_cacheinfo
+{
+ __u32 max_reasm_len;
+ __u32 tstamp; /* ipv6InterfaceTable updated timestamp */
+ __u32 reachable_time;
+ __u32 retrans_time;
+};
+
+enum
+{
+ IFLA_INFO_UNSPEC,
+ IFLA_INFO_KIND,
+ IFLA_INFO_DATA,
+ IFLA_INFO_XSTATS,
+ __IFLA_INFO_MAX,
+};
+
+#define IFLA_INFO_MAX (__IFLA_INFO_MAX - 1)
+
+/* VLAN section */
+
+enum
+{
+ IFLA_VLAN_UNSPEC,
+ IFLA_VLAN_ID,
+ IFLA_VLAN_FLAGS,
+ IFLA_VLAN_EGRESS_QOS,
+ IFLA_VLAN_INGRESS_QOS,
+ __IFLA_VLAN_MAX,
+};
+
+#define IFLA_VLAN_MAX (__IFLA_VLAN_MAX - 1)
+
+struct ifla_vlan_flags {
+ __u32 flags;
+ __u32 mask;
+};
+
+enum
+{
+ IFLA_VLAN_QOS_UNSPEC,
+ IFLA_VLAN_QOS_MAPPING,
+ __IFLA_VLAN_QOS_MAX
+};
+
+#define IFLA_VLAN_QOS_MAX (__IFLA_VLAN_QOS_MAX - 1)
+
+struct ifla_vlan_qos_mapping
+{
+ __u32 from;
+ __u32 to;
+};
+
+#endif /* _LINUX_IF_LINK_H */
diff --git a/sysroot/usr/include/linux/if_ltalk.h b/sysroot/usr/include/linux/if_ltalk.h
new file mode 100644
index 0000000..92c3e30
--- /dev/null
+++ b/sysroot/usr/include/linux/if_ltalk.h
@@ -0,0 +1,9 @@
+#ifndef __LINUX_LTALK_H
+#define __LINUX_LTALK_H
+
+#define LTALK_HLEN 1
+#define LTALK_MTU 600
+#define LTALK_ALEN 1
+
+
+#endif
diff --git a/sysroot/usr/include/linux/if_packet.h b/sysroot/usr/include/linux/if_packet.h
new file mode 100644
index 0000000..ad09609
--- /dev/null
+++ b/sysroot/usr/include/linux/if_packet.h
@@ -0,0 +1,115 @@
+#ifndef __LINUX_IF_PACKET_H
+#define __LINUX_IF_PACKET_H
+
+#include <linux/types.h>
+
+struct sockaddr_pkt
+{
+ unsigned short spkt_family;
+ unsigned char spkt_device[14];
+ __be16 spkt_protocol;
+};
+
+struct sockaddr_ll
+{
+ unsigned short sll_family;
+ __be16 sll_protocol;
+ int sll_ifindex;
+ unsigned short sll_hatype;
+ unsigned char sll_pkttype;
+ unsigned char sll_halen;
+ unsigned char sll_addr[8];
+};
+
+/* Packet types */
+
+#define PACKET_HOST 0 /* To us */
+#define PACKET_BROADCAST 1 /* To all */
+#define PACKET_MULTICAST 2 /* To group */
+#define PACKET_OTHERHOST 3 /* To someone else */
+#define PACKET_OUTGOING 4 /* Outgoing of any type */
+/* These ones are invisible by user level */
+#define PACKET_LOOPBACK 5 /* MC/BRD frame looped back */
+#define PACKET_FASTROUTE 6 /* Fastrouted frame */
+
+/* Packet socket options */
+
+#define PACKET_ADD_MEMBERSHIP 1
+#define PACKET_DROP_MEMBERSHIP 2
+#define PACKET_RECV_OUTPUT 3
+/* Value 4 is still used by obsolete turbo-packet. */
+#define PACKET_RX_RING 5
+#define PACKET_STATISTICS 6
+#define PACKET_COPY_THRESH 7
+#define PACKET_AUXDATA 8
+#define PACKET_ORIGDEV 9
+
+struct tpacket_stats
+{
+ unsigned int tp_packets;
+ unsigned int tp_drops;
+};
+
+struct tpacket_auxdata
+{
+ __u32 tp_status;
+ __u32 tp_len;
+ __u32 tp_snaplen;
+ __u16 tp_mac;
+ __u16 tp_net;
+};
+
+struct tpacket_hdr
+{
+ unsigned long tp_status;
+#define TP_STATUS_KERNEL 0
+#define TP_STATUS_USER 1
+#define TP_STATUS_COPY 2
+#define TP_STATUS_LOSING 4
+#define TP_STATUS_CSUMNOTREADY 8
+ unsigned int tp_len;
+ unsigned int tp_snaplen;
+ unsigned short tp_mac;
+ unsigned short tp_net;
+ unsigned int tp_sec;
+ unsigned int tp_usec;
+};
+
+#define TPACKET_ALIGNMENT 16
+#define TPACKET_ALIGN(x) (((x)+TPACKET_ALIGNMENT-1)&~(TPACKET_ALIGNMENT-1))
+#define TPACKET_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket_hdr)) + sizeof(struct sockaddr_ll))
+
+/*
+ Frame structure:
+
+ - Start. Frame must be aligned to TPACKET_ALIGNMENT=16
+ - struct tpacket_hdr
+ - pad to TPACKET_ALIGNMENT=16
+ - struct sockaddr_ll
+ - Gap, chosen so that packet data (Start+tp_net) alignes to TPACKET_ALIGNMENT=16
+ - Start+tp_mac: [ Optional MAC header ]
+ - Start+tp_net: Packet data, aligned to TPACKET_ALIGNMENT=16.
+ - Pad to align to TPACKET_ALIGNMENT=16
+ */
+
+struct tpacket_req
+{
+ unsigned int tp_block_size; /* Minimal size of contiguous block */
+ unsigned int tp_block_nr; /* Number of blocks */
+ unsigned int tp_frame_size; /* Size of frame */
+ unsigned int tp_frame_nr; /* Total number of frames */
+};
+
+struct packet_mreq
+{
+ int mr_ifindex;
+ unsigned short mr_type;
+ unsigned short mr_alen;
+ unsigned char mr_address[8];
+};
+
+#define PACKET_MR_MULTICAST 0
+#define PACKET_MR_PROMISC 1
+#define PACKET_MR_ALLMULTI 2
+
+#endif
diff --git a/sysroot/usr/include/linux/if_plip.h b/sysroot/usr/include/linux/if_plip.h
new file mode 100644
index 0000000..153a649
--- /dev/null
+++ b/sysroot/usr/include/linux/if_plip.h
@@ -0,0 +1,28 @@
+/*
+ * NET3 PLIP tuning facilities for the new Niibe PLIP.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ */
+
+#ifndef _LINUX_IF_PLIP_H
+#define _LINUX_IF_PLIP_H
+
+#include <linux/sockios.h>
+
+#define SIOCDEVPLIP SIOCDEVPRIVATE
+
+struct plipconf
+{
+ unsigned short pcmd;
+ unsigned long nibble;
+ unsigned long trigger;
+};
+
+#define PLIP_GET_TIMEOUT 0x1
+#define PLIP_SET_TIMEOUT 0x2
+
+#endif
diff --git a/sysroot/usr/include/linux/if_ppp.h b/sysroot/usr/include/linux/if_ppp.h
new file mode 100644
index 0000000..bdaada5
--- /dev/null
+++ b/sysroot/usr/include/linux/if_ppp.h
@@ -0,0 +1,173 @@
+/* $Id: if_ppp.h,v 1.21 2000/03/27 06:03:36 paulus Exp $ */
+
+/*
+ * if_ppp.h - Point-to-Point Protocol definitions.
+ *
+ * Copyright (c) 1989 Carnegie Mellon University.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by Carnegie Mellon University. The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ */
+
+/*
+ * ==FILEVERSION 20050812==
+ *
+ * NOTE TO MAINTAINERS:
+ * If you modify this file at all, please set the above date.
+ * if_ppp.h is shipped with a PPP distribution as well as with the kernel;
+ * if everyone increases the FILEVERSION number above, then scripts
+ * can do the right thing when deciding whether to install a new if_ppp.h
+ * file. Don't change the format of that line otherwise, so the
+ * installation script can recognize it.
+ */
+
+#ifndef _IF_PPP_H_
+#define _IF_PPP_H_
+
+
+/*
+ * Packet sizes
+ */
+
+#define PPP_MTU 1500 /* Default MTU (size of Info field) */
+#define PPP_MAXMRU 65000 /* Largest MRU we allow */
+#define PROTO_IPX 0x002b /* protocol numbers */
+#define PROTO_DNA_RT 0x0027 /* DNA Routing */
+
+
+/*
+ * Bit definitions for flags.
+ */
+
+#define SC_COMP_PROT 0x00000001 /* protocol compression (output) */
+#define SC_COMP_AC 0x00000002 /* header compression (output) */
+#define SC_COMP_TCP 0x00000004 /* TCP (VJ) compression (output) */
+#define SC_NO_TCP_CCID 0x00000008 /* disable VJ connection-id comp. */
+#define SC_REJ_COMP_AC 0x00000010 /* reject adrs/ctrl comp. on input */
+#define SC_REJ_COMP_TCP 0x00000020 /* reject TCP (VJ) comp. on input */
+#define SC_CCP_OPEN 0x00000040 /* Look at CCP packets */
+#define SC_CCP_UP 0x00000080 /* May send/recv compressed packets */
+#define SC_ENABLE_IP 0x00000100 /* IP packets may be exchanged */
+#define SC_LOOP_TRAFFIC 0x00000200 /* send traffic to pppd */
+#define SC_MULTILINK 0x00000400 /* do multilink encapsulation */
+#define SC_MP_SHORTSEQ 0x00000800 /* use short MP sequence numbers */
+#define SC_COMP_RUN 0x00001000 /* compressor has been inited */
+#define SC_DECOMP_RUN 0x00002000 /* decompressor has been inited */
+#define SC_MP_XSHORTSEQ 0x00004000 /* transmit short MP seq numbers */
+#define SC_DEBUG 0x00010000 /* enable debug messages */
+#define SC_LOG_INPKT 0x00020000 /* log contents of good pkts recvd */
+#define SC_LOG_OUTPKT 0x00040000 /* log contents of pkts sent */
+#define SC_LOG_RAWIN 0x00080000 /* log all chars received */
+#define SC_LOG_FLUSH 0x00100000 /* log all chars flushed */
+#define SC_SYNC 0x00200000 /* synchronous serial mode */
+#define SC_MUST_COMP 0x00400000 /* no uncompressed packets may be sent or received */
+#define SC_MASK 0x0f600fff /* bits that user can change */
+
+/* state bits */
+#define SC_XMIT_BUSY 0x10000000 /* (used by isdn_ppp?) */
+#define SC_RCV_ODDP 0x08000000 /* have rcvd char with odd parity */
+#define SC_RCV_EVNP 0x04000000 /* have rcvd char with even parity */
+#define SC_RCV_B7_1 0x02000000 /* have rcvd char with bit 7 = 1 */
+#define SC_RCV_B7_0 0x01000000 /* have rcvd char with bit 7 = 0 */
+#define SC_DC_FERROR 0x00800000 /* fatal decomp error detected */
+#define SC_DC_ERROR 0x00400000 /* non-fatal decomp error detected */
+
+/*
+ * Ioctl definitions.
+ */
+
+struct npioctl {
+ int protocol; /* PPP protocol, e.g. PPP_IP */
+ enum NPmode mode;
+};
+
+/* Structure describing a CCP configuration option, for PPPIOCSCOMPRESS */
+struct ppp_option_data {
+ __u8 *ptr;
+ __u32 length;
+ int transmit;
+};
+
+struct ifpppstatsreq {
+ struct ifreq b;
+ struct ppp_stats stats; /* statistic information */
+};
+
+struct ifpppcstatsreq {
+ struct ifreq b;
+ struct ppp_comp_stats stats;
+};
+
+/* For PPPIOCGL2TPSTATS */
+struct pppol2tp_ioc_stats {
+ __u16 tunnel_id; /* redundant */
+ __u16 session_id; /* if zero, get tunnel stats */
+ __u32 using_ipsec:1; /* valid only for session_id == 0 */
+ aligned_u64 tx_packets;
+ aligned_u64 tx_bytes;
+ aligned_u64 tx_errors;
+ aligned_u64 rx_packets;
+ aligned_u64 rx_bytes;
+ aligned_u64 rx_seq_discards;
+ aligned_u64 rx_oos_packets;
+ aligned_u64 rx_errors;
+};
+
+#define ifr__name b.ifr_ifrn.ifrn_name
+#define stats_ptr b.ifr_ifru.ifru_data
+
+/*
+ * Ioctl definitions.
+ */
+
+#define PPPIOCGFLAGS _IOR('t', 90, int) /* get configuration flags */
+#define PPPIOCSFLAGS _IOW('t', 89, int) /* set configuration flags */
+#define PPPIOCGASYNCMAP _IOR('t', 88, int) /* get async map */
+#define PPPIOCSASYNCMAP _IOW('t', 87, int) /* set async map */
+#define PPPIOCGUNIT _IOR('t', 86, int) /* get ppp unit number */
+#define PPPIOCGRASYNCMAP _IOR('t', 85, int) /* get receive async map */
+#define PPPIOCSRASYNCMAP _IOW('t', 84, int) /* set receive async map */
+#define PPPIOCGMRU _IOR('t', 83, int) /* get max receive unit */
+#define PPPIOCSMRU _IOW('t', 82, int) /* set max receive unit */
+#define PPPIOCSMAXCID _IOW('t', 81, int) /* set VJ max slot ID */
+#define PPPIOCGXASYNCMAP _IOR('t', 80, ext_accm) /* get extended ACCM */
+#define PPPIOCSXASYNCMAP _IOW('t', 79, ext_accm) /* set extended ACCM */
+#define PPPIOCXFERUNIT _IO('t', 78) /* transfer PPP unit */
+#define PPPIOCSCOMPRESS _IOW('t', 77, struct ppp_option_data)
+#define PPPIOCGNPMODE _IOWR('t', 76, struct npioctl) /* get NP mode */
+#define PPPIOCSNPMODE _IOW('t', 75, struct npioctl) /* set NP mode */
+#define PPPIOCSPASS _IOW('t', 71, struct sock_fprog) /* set pass filter */
+#define PPPIOCSACTIVE _IOW('t', 70, struct sock_fprog) /* set active filt */
+#define PPPIOCGDEBUG _IOR('t', 65, int) /* Read debug level */
+#define PPPIOCSDEBUG _IOW('t', 64, int) /* Set debug level */
+#define PPPIOCGIDLE _IOR('t', 63, struct ppp_idle) /* get idle time */
+#define PPPIOCNEWUNIT _IOWR('t', 62, int) /* create new ppp unit */
+#define PPPIOCATTACH _IOW('t', 61, int) /* attach to ppp unit */
+#define PPPIOCDETACH _IOW('t', 60, int) /* detach from ppp unit/chan */
+#define PPPIOCSMRRU _IOW('t', 59, int) /* set multilink MRU */
+#define PPPIOCCONNECT _IOW('t', 58, int) /* connect channel to unit */
+#define PPPIOCDISCONN _IO('t', 57) /* disconnect channel */
+#define PPPIOCATTCHAN _IOW('t', 56, int) /* attach to ppp channel */
+#define PPPIOCGCHAN _IOR('t', 55, int) /* get ppp channel number */
+#define PPPIOCGL2TPSTATS _IOR('t', 54, struct pppol2tp_ioc_stats)
+
+#define SIOCGPPPSTATS (SIOCDEVPRIVATE + 0)
+#define SIOCGPPPVER (SIOCDEVPRIVATE + 1) /* NEVER change this!! */
+#define SIOCGPPPCSTATS (SIOCDEVPRIVATE + 2)
+
+#if !defined(ifr_mtu)
+#define ifr_mtu ifr_ifru.ifru_metric
+#endif
+
+#endif /* _IF_PPP_H_ */
diff --git a/sysroot/usr/include/linux/if_pppol2tp.h b/sysroot/usr/include/linux/if_pppol2tp.h
new file mode 100644
index 0000000..f39987c
--- /dev/null
+++ b/sysroot/usr/include/linux/if_pppol2tp.h
@@ -0,0 +1,66 @@
+/***************************************************************************
+ * Linux PPP over L2TP (PPPoL2TP) Socket Implementation (RFC 2661)
+ *
+ * This file supplies definitions required by the PPP over L2TP driver
+ * (pppol2tp.c). All version information wrt this file is located in pppol2tp.c
+ *
+ * License:
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ */
+
+#ifndef __LINUX_IF_PPPOL2TP_H
+#define __LINUX_IF_PPPOL2TP_H
+
+#include <asm/types.h>
+
+
+/* Structure used to connect() the socket to a particular tunnel UDP
+ * socket.
+ */
+struct pppol2tp_addr
+{
+ pid_t pid; /* pid that owns the fd.
+ * 0 => current */
+ int fd; /* FD of UDP socket to use */
+
+ struct sockaddr_in addr; /* IP address and port to send to */
+
+ __u16 s_tunnel, s_session; /* For matching incoming packets */
+ __u16 d_tunnel, d_session; /* For sending outgoing packets */
+};
+
+/* Socket options:
+ * DEBUG - bitmask of debug message categories
+ * SENDSEQ - 0 => don't send packets with sequence numbers
+ * 1 => send packets with sequence numbers
+ * RECVSEQ - 0 => receive packet sequence numbers are optional
+ * 1 => drop receive packets without sequence numbers
+ * LNSMODE - 0 => act as LAC.
+ * 1 => act as LNS.
+ * REORDERTO - reorder timeout (in millisecs). If 0, don't try to reorder.
+ */
+enum {
+ PPPOL2TP_SO_DEBUG = 1,
+ PPPOL2TP_SO_RECVSEQ = 2,
+ PPPOL2TP_SO_SENDSEQ = 3,
+ PPPOL2TP_SO_LNSMODE = 4,
+ PPPOL2TP_SO_REORDERTO = 5,
+};
+
+/* Debug message categories for the DEBUG socket option */
+enum {
+ PPPOL2TP_MSG_DEBUG = (1 << 0), /* verbose debug (if
+ * compiled in) */
+ PPPOL2TP_MSG_CONTROL = (1 << 1), /* userspace - kernel
+ * interface */
+ PPPOL2TP_MSG_SEQ = (1 << 2), /* sequence numbers */
+ PPPOL2TP_MSG_DATA = (1 << 3), /* data packets */
+};
+
+
+
+#endif
diff --git a/sysroot/usr/include/linux/if_pppox.h b/sysroot/usr/include/linux/if_pppox.h
new file mode 100644
index 0000000..0bcbef7
--- /dev/null
+++ b/sysroot/usr/include/linux/if_pppox.h
@@ -0,0 +1,123 @@
+/***************************************************************************
+ * Linux PPP over X - Generic PPP transport layer sockets
+ * Linux PPP over Ethernet (PPPoE) Socket Implementation (RFC 2516)
+ *
+ * This file supplies definitions required by the PPP over Ethernet driver
+ * (pppox.c). All version information wrt this file is located in pppox.c
+ *
+ * License:
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ */
+
+#ifndef __LINUX_IF_PPPOX_H
+#define __LINUX_IF_PPPOX_H
+
+
+#include <asm/types.h>
+#include <asm/byteorder.h>
+
+#include <linux/if_pppol2tp.h>
+
+/* For user-space programs to pick up these definitions
+ * which they wouldn't get otherwise without defining __KERNEL__
+ */
+#ifndef AF_PPPOX
+#define AF_PPPOX 24
+#define PF_PPPOX AF_PPPOX
+#endif /* !(AF_PPPOX) */
+
+/************************************************************************
+ * PPPoE addressing definition
+ */
+typedef __be16 sid_t;
+struct pppoe_addr{
+ sid_t sid; /* Session identifier */
+ unsigned char remote[ETH_ALEN]; /* Remote address */
+ char dev[IFNAMSIZ]; /* Local device to use */
+};
+
+/************************************************************************
+ * Protocols supported by AF_PPPOX
+ */
+#define PX_PROTO_OE 0 /* Currently just PPPoE */
+#define PX_PROTO_OL2TP 1 /* Now L2TP also */
+#define PX_MAX_PROTO 2
+
+struct sockaddr_pppox {
+ sa_family_t sa_family; /* address family, AF_PPPOX */
+ unsigned int sa_protocol; /* protocol identifier */
+ union{
+ struct pppoe_addr pppoe;
+ }sa_addr;
+}__attribute__ ((packed));
+
+/* The use of the above union isn't viable because the size of this
+ * struct must stay fixed over time -- applications use sizeof(struct
+ * sockaddr_pppox) to fill it. We use a protocol specific sockaddr
+ * type instead.
+ */
+struct sockaddr_pppol2tp {
+ sa_family_t sa_family; /* address family, AF_PPPOX */
+ unsigned int sa_protocol; /* protocol identifier */
+ struct pppol2tp_addr pppol2tp;
+}__attribute__ ((packed));
+
+/*********************************************************************
+ *
+ * ioctl interface for defining forwarding of connections
+ *
+ ********************************************************************/
+
+#define PPPOEIOCSFWD _IOW(0xB1 ,0, size_t)
+#define PPPOEIOCDFWD _IO(0xB1 ,1)
+/*#define PPPOEIOCGFWD _IOWR(0xB1,2, size_t)*/
+
+/* Codes to identify message types */
+#define PADI_CODE 0x09
+#define PADO_CODE 0x07
+#define PADR_CODE 0x19
+#define PADS_CODE 0x65
+#define PADT_CODE 0xa7
+struct pppoe_tag {
+ __be16 tag_type;
+ __be16 tag_len;
+ char tag_data[0];
+} __attribute ((packed));
+
+/* Tag identifiers */
+#define PTT_EOL __constant_htons(0x0000)
+#define PTT_SRV_NAME __constant_htons(0x0101)
+#define PTT_AC_NAME __constant_htons(0x0102)
+#define PTT_HOST_UNIQ __constant_htons(0x0103)
+#define PTT_AC_COOKIE __constant_htons(0x0104)
+#define PTT_VENDOR __constant_htons(0x0105)
+#define PTT_RELAY_SID __constant_htons(0x0110)
+#define PTT_SRV_ERR __constant_htons(0x0201)
+#define PTT_SYS_ERR __constant_htons(0x0202)
+#define PTT_GEN_ERR __constant_htons(0x0203)
+
+struct pppoe_hdr {
+#if defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 ver : 4;
+ __u8 type : 4;
+#elif defined(__BIG_ENDIAN_BITFIELD)
+ __u8 type : 4;
+ __u8 ver : 4;
+#else
+#error "Please fix <asm/byteorder.h>"
+#endif
+ __u8 code;
+ __be16 sid;
+ __be16 length;
+ struct pppoe_tag tag[0];
+} __attribute__ ((packed));
+
+/* Length of entire PPPoE + PPP header */
+#define PPPOE_SES_HLEN 8
+
+
+#endif /* !(__LINUX_IF_PPPOX_H) */
diff --git a/sysroot/usr/include/linux/if_shaper.h b/sysroot/usr/include/linux/if_shaper.h
new file mode 100644
index 0000000..f7c6ace
--- /dev/null
+++ b/sysroot/usr/include/linux/if_shaper.h
@@ -0,0 +1,22 @@
+#ifndef __LINUX_SHAPER_H
+#define __LINUX_SHAPER_H
+
+
+#define SHAPER_SET_DEV 0x0001
+#define SHAPER_SET_SPEED 0x0002
+#define SHAPER_GET_DEV 0x0003
+#define SHAPER_GET_SPEED 0x0004
+
+struct shaperconf
+{
+ __u16 ss_cmd;
+ union
+ {
+ char ssu_name[14];
+ __u32 ssu_speed;
+ } ss_u;
+#define ss_speed ss_u.ssu_speed
+#define ss_name ss_u.ssu_name
+};
+
+#endif
diff --git a/sysroot/usr/include/linux/if_slip.h b/sysroot/usr/include/linux/if_slip.h
new file mode 100644
index 0000000..1eb4e3a
--- /dev/null
+++ b/sysroot/usr/include/linux/if_slip.h
@@ -0,0 +1,30 @@
+/*
+ * Swansea University Computer Society NET3
+ *
+ * This file declares the constants of special use with the SLIP/CSLIP/
+ * KISS TNC driver.
+ */
+
+#ifndef __LINUX_SLIP_H
+#define __LINUX_SLIP_H
+
+#define SL_MODE_SLIP 0
+#define SL_MODE_CSLIP 1
+#define SL_MODE_KISS 4
+
+#define SL_OPT_SIXBIT 2
+#define SL_OPT_ADAPTIVE 8
+
+/*
+ * VSV = ioctl for keepalive & outfill in SLIP driver
+ */
+
+#define SIOCSKEEPALIVE (SIOCDEVPRIVATE) /* Set keepalive timeout in sec */
+#define SIOCGKEEPALIVE (SIOCDEVPRIVATE+1) /* Get keepalive timeout */
+#define SIOCSOUTFILL (SIOCDEVPRIVATE+2) /* Set outfill timeout */
+#define SIOCGOUTFILL (SIOCDEVPRIVATE+3) /* Get outfill timeout */
+#define SIOCSLEASE (SIOCDEVPRIVATE+4) /* Set "leased" line type */
+#define SIOCGLEASE (SIOCDEVPRIVATE+5) /* Get line type */
+
+
+#endif
diff --git a/sysroot/usr/include/linux/if_strip.h b/sysroot/usr/include/linux/if_strip.h
new file mode 100644
index 0000000..fb5c5c9
--- /dev/null
+++ b/sysroot/usr/include/linux/if_strip.h
@@ -0,0 +1,25 @@
+/*
+ * if_strip.h --
+ *
+ * Definitions for the STRIP interface
+ *
+ * Copyright 1996 The Board of Trustees of The Leland Stanford
+ * Junior University. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies. Stanford University
+ * makes no representations about the suitability of this
+ * software for any purpose. It is provided "as is" without
+ * express or implied warranty.
+ */
+
+#ifndef __LINUX_STRIP_H
+#define __LINUX_STRIP_H
+
+typedef struct {
+ __u8 c[6];
+} MetricomAddress;
+
+#endif
diff --git a/sysroot/usr/include/linux/if_tr.h b/sysroot/usr/include/linux/if_tr.h
new file mode 100644
index 0000000..402ce02
--- /dev/null
+++ b/sysroot/usr/include/linux/if_tr.h
@@ -0,0 +1,94 @@
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Global definitions for the Token-Ring IEEE 802.5 interface.
+ *
+ * Version: @(#)if_tr.h 0.0 07/11/94
+ *
+ * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ * Donald Becker, <becker@super.org>
+ * Peter De Schrijver, <stud11@cc4.kuleuven.ac.be>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#ifndef _LINUX_IF_TR_H
+#define _LINUX_IF_TR_H
+
+#include <asm/byteorder.h> /* For __be16 */
+
+/* IEEE 802.5 Token-Ring magic constants. The frame sizes omit the preamble
+ and FCS/CRC (frame check sequence). */
+#define TR_ALEN 6 /* Octets in one token-ring addr */
+#define TR_HLEN (sizeof(struct trh_hdr)+sizeof(struct trllc))
+#define AC 0x10
+#define LLC_FRAME 0x40
+
+/* LLC and SNAP constants */
+#define EXTENDED_SAP 0xAA
+#define UI_CMD 0x03
+
+/* This is an Token-Ring frame header. */
+struct trh_hdr {
+ __u8 ac; /* access control field */
+ __u8 fc; /* frame control field */
+ __u8 daddr[TR_ALEN]; /* destination address */
+ __u8 saddr[TR_ALEN]; /* source address */
+ __be16 rcf; /* route control field */
+ __be16 rseg[8]; /* routing registers */
+};
+
+
+/* This is an Token-Ring LLC structure */
+struct trllc {
+ __u8 dsap; /* destination SAP */
+ __u8 ssap; /* source SAP */
+ __u8 llc; /* LLC control field */
+ __u8 protid[3]; /* protocol id */
+ __be16 ethertype; /* ether type field */
+};
+
+/* Token-Ring statistics collection data. */
+struct tr_statistics {
+ unsigned long rx_packets; /* total packets received */
+ unsigned long tx_packets; /* total packets transmitted */
+ unsigned long rx_bytes; /* total bytes received */
+ unsigned long tx_bytes; /* total bytes transmitted */
+ unsigned long rx_errors; /* bad packets received */
+ unsigned long tx_errors; /* packet transmit problems */
+ unsigned long rx_dropped; /* no space in linux buffers */
+ unsigned long tx_dropped; /* no space available in linux */
+ unsigned long multicast; /* multicast packets received */
+ unsigned long transmit_collision;
+
+ /* detailed Token-Ring errors. See IBM Token-Ring Network
+ Architecture for more info */
+
+ unsigned long line_errors;
+ unsigned long internal_errors;
+ unsigned long burst_errors;
+ unsigned long A_C_errors;
+ unsigned long abort_delimiters;
+ unsigned long lost_frames;
+ unsigned long recv_congest_count;
+ unsigned long frame_copied_errors;
+ unsigned long frequency_errors;
+ unsigned long token_errors;
+ unsigned long dummy1;
+};
+
+/* source routing stuff */
+#define TR_RII 0x80
+#define TR_RCF_DIR_BIT 0x80
+#define TR_RCF_LEN_MASK 0x1f00
+#define TR_RCF_BROADCAST 0x8000 /* all-routes broadcast */
+#define TR_RCF_LIMITED_BROADCAST 0xC000 /* single-route broadcast */
+#define TR_RCF_FRAME2K 0x20
+#define TR_RCF_BROADCAST_MASK 0xC000
+#define TR_MAXRIFLEN 18
+
+#endif /* _LINUX_IF_TR_H */
diff --git a/sysroot/usr/include/linux/if_tun.h b/sysroot/usr/include/linux/if_tun.h
new file mode 100644
index 0000000..a45f285
--- /dev/null
+++ b/sysroot/usr/include/linux/if_tun.h
@@ -0,0 +1,60 @@
+/*
+ * Universal TUN/TAP device driver.
+ * Copyright (C) 1999-2000 Maxim Krasnyansky <max_mk@yahoo.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * $Id: if_tun.h,v 1.2 2001/06/01 18:39:47 davem Exp $
+ */
+
+#ifndef __IF_TUN_H
+#define __IF_TUN_H
+
+/* Uncomment to enable debugging */
+/* #define TUN_DEBUG 1 */
+
+
+/* Read queue size */
+#define TUN_READQ_SIZE 500
+
+/* TUN device flags */
+#define TUN_TUN_DEV 0x0001
+#define TUN_TAP_DEV 0x0002
+#define TUN_TYPE_MASK 0x000f
+
+#define TUN_FASYNC 0x0010
+#define TUN_NOCHECKSUM 0x0020
+#define TUN_NO_PI 0x0040
+#define TUN_ONE_QUEUE 0x0080
+#define TUN_PERSIST 0x0100
+
+/* Ioctl defines */
+#define TUNSETNOCSUM _IOW('T', 200, int)
+#define TUNSETDEBUG _IOW('T', 201, int)
+#define TUNSETIFF _IOW('T', 202, int)
+#define TUNSETPERSIST _IOW('T', 203, int)
+#define TUNSETOWNER _IOW('T', 204, int)
+#define TUNSETLINK _IOW('T', 205, int)
+#define TUNSETGROUP _IOW('T', 206, int)
+
+/* TUNSETIFF ifr flags */
+#define IFF_TUN 0x0001
+#define IFF_TAP 0x0002
+#define IFF_NO_PI 0x1000
+#define IFF_ONE_QUEUE 0x2000
+
+struct tun_pi {
+ unsigned short flags;
+ unsigned short proto;
+};
+#define TUN_PKT_STRIP 0x0001
+
+#endif /* __IF_TUN_H */
diff --git a/sysroot/usr/include/linux/if_tunnel.h b/sysroot/usr/include/linux/if_tunnel.h
new file mode 100644
index 0000000..660b501
--- /dev/null
+++ b/sysroot/usr/include/linux/if_tunnel.h
@@ -0,0 +1,31 @@
+#ifndef _IF_TUNNEL_H_
+#define _IF_TUNNEL_H_
+
+#include <linux/types.h>
+
+#define SIOCGETTUNNEL (SIOCDEVPRIVATE + 0)
+#define SIOCADDTUNNEL (SIOCDEVPRIVATE + 1)
+#define SIOCDELTUNNEL (SIOCDEVPRIVATE + 2)
+#define SIOCCHGTUNNEL (SIOCDEVPRIVATE + 3)
+
+#define GRE_CSUM __constant_htons(0x8000)
+#define GRE_ROUTING __constant_htons(0x4000)
+#define GRE_KEY __constant_htons(0x2000)
+#define GRE_SEQ __constant_htons(0x1000)
+#define GRE_STRICT __constant_htons(0x0800)
+#define GRE_REC __constant_htons(0x0700)
+#define GRE_FLAGS __constant_htons(0x00F8)
+#define GRE_VERSION __constant_htons(0x0007)
+
+struct ip_tunnel_parm
+{
+ char name[IFNAMSIZ];
+ int link;
+ __be16 i_flags;
+ __be16 o_flags;
+ __be32 i_key;
+ __be32 o_key;
+ struct iphdr iph;
+};
+
+#endif /* _IF_TUNNEL_H_ */
diff --git a/sysroot/usr/include/linux/if_vlan.h b/sysroot/usr/include/linux/if_vlan.h
new file mode 100644
index 0000000..4014ba9
--- /dev/null
+++ b/sysroot/usr/include/linux/if_vlan.h
@@ -0,0 +1,61 @@
+/*
+ * VLAN An implementation of 802.1Q VLAN tagging.
+ *
+ * Authors: Ben Greear <greearb@candelatech.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ */
+
+#ifndef _LINUX_IF_VLAN_H_
+#define _LINUX_IF_VLAN_H_
+
+
+/* VLAN IOCTLs are found in sockios.h */
+
+/* Passed in vlan_ioctl_args structure to determine behaviour. */
+enum vlan_ioctl_cmds {
+ ADD_VLAN_CMD,
+ DEL_VLAN_CMD,
+ SET_VLAN_INGRESS_PRIORITY_CMD,
+ SET_VLAN_EGRESS_PRIORITY_CMD,
+ GET_VLAN_INGRESS_PRIORITY_CMD,
+ GET_VLAN_EGRESS_PRIORITY_CMD,
+ SET_VLAN_NAME_TYPE_CMD,
+ SET_VLAN_FLAG_CMD,
+ GET_VLAN_REALDEV_NAME_CMD, /* If this works, you know it's a VLAN device, btw */
+ GET_VLAN_VID_CMD /* Get the VID of this VLAN (specified by name) */
+};
+
+enum vlan_flags {
+ VLAN_FLAG_REORDER_HDR = 0x1,
+};
+
+enum vlan_name_types {
+ VLAN_NAME_TYPE_PLUS_VID, /* Name will look like: vlan0005 */
+ VLAN_NAME_TYPE_RAW_PLUS_VID, /* name will look like: eth1.0005 */
+ VLAN_NAME_TYPE_PLUS_VID_NO_PAD, /* Name will look like: vlan5 */
+ VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD, /* Name will look like: eth0.5 */
+ VLAN_NAME_TYPE_HIGHEST
+};
+
+struct vlan_ioctl_args {
+ int cmd; /* Should be one of the vlan_ioctl_cmds enum above. */
+ char device1[24];
+
+ union {
+ char device2[24];
+ int VID;
+ unsigned int skb_priority;
+ unsigned int name_type;
+ unsigned int bind_type;
+ unsigned int flag; /* Matches vlan_dev_info flags */
+ } u;
+
+ short vlan_qos;
+};
+
+#endif /* !(_LINUX_IF_VLAN_H_) */
diff --git a/sysroot/usr/include/linux/if_wanpipe.h b/sysroot/usr/include/linux/if_wanpipe.h
new file mode 100644
index 0000000..5c4ba07
--- /dev/null
+++ b/sysroot/usr/include/linux/if_wanpipe.h
@@ -0,0 +1,103 @@
+/*****************************************************************************
+* if_wanpipe.h Header file for the Sangoma AF_WANPIPE Socket
+*
+* Author: Nenad Corbic
+*
+* Copyright: (c) 2000 Sangoma Technologies Inc.
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version
+* 2 of the License, or (at your option) any later version.
+* ============================================================================
+*
+* Jan 28, 2000 Nenad Corbic Initial Version
+*
+*****************************************************************************/
+
+#ifndef __LINUX_IF_WAN_PACKET_H
+#define __LINUX_IF_WAN_PACKET_H
+
+struct wan_sockaddr_ll
+{
+ unsigned short sll_family;
+ unsigned short sll_protocol;
+ int sll_ifindex;
+ unsigned short sll_hatype;
+ unsigned char sll_pkttype;
+ unsigned char sll_halen;
+ unsigned char sll_addr[8];
+ unsigned char sll_device[14];
+ unsigned char sll_card[14];
+};
+
+typedef struct
+{
+ unsigned char free;
+ unsigned char state_sk;
+ int rcvbuf;
+ int sndbuf;
+ int rmem;
+ int wmem;
+ int sk_count;
+ unsigned char bound;
+ char name[14];
+ unsigned char d_state;
+ unsigned char svc;
+ unsigned short lcn;
+ unsigned char mbox;
+ unsigned char cmd_busy;
+ unsigned char command;
+ unsigned poll;
+ unsigned poll_cnt;
+ int rblock;
+} wan_debug_hdr_t;
+
+#define MAX_NUM_DEBUG 10
+#define X25_PROT 0x16
+#define PVC_PROT 0x17
+
+typedef struct
+{
+ wan_debug_hdr_t debug[MAX_NUM_DEBUG];
+}wan_debug_t;
+
+#define SIOC_WANPIPE_GET_CALL_DATA (SIOCPROTOPRIVATE + 0)
+#define SIOC_WANPIPE_SET_CALL_DATA (SIOCPROTOPRIVATE + 1)
+#define SIOC_WANPIPE_ACCEPT_CALL (SIOCPROTOPRIVATE + 2)
+#define SIOC_WANPIPE_CLEAR_CALL (SIOCPROTOPRIVATE + 3)
+#define SIOC_WANPIPE_RESET_CALL (SIOCPROTOPRIVATE + 4)
+#define SIOC_WANPIPE_DEBUG (SIOCPROTOPRIVATE + 5)
+#define SIOC_WANPIPE_SET_NONBLOCK (SIOCPROTOPRIVATE + 6)
+#define SIOC_WANPIPE_CHECK_TX (SIOCPROTOPRIVATE + 7)
+#define SIOC_WANPIPE_SOCK_STATE (SIOCPROTOPRIVATE + 8)
+
+/* Packet types */
+
+#define WAN_PACKET_HOST 0 /* To us */
+#define WAN_PACKET_BROADCAST 1 /* To all */
+#define WAN_PACKET_MULTICAST 2 /* To group */
+#define WAN_PACKET_OTHERHOST 3 /* To someone else */
+#define WAN_PACKET_OUTGOING 4 /* Outgoing of any type */
+/* These ones are invisible by user level */
+#define WAN_PACKET_LOOPBACK 5 /* MC/BRD frame looped back */
+#define WAN_PACKET_FASTROUTE 6 /* Fastrouted frame */
+
+
+/* X25 specific */
+#define WAN_PACKET_DATA 7
+#define WAN_PACKET_CMD 8
+#define WAN_PACKET_ASYNC 9
+#define WAN_PACKET_ERR 10
+
+/* Packet socket options */
+
+#define WAN_PACKET_ADD_MEMBERSHIP 1
+#define WAN_PACKET_DROP_MEMBERSHIP 2
+
+#define WAN_PACKET_MR_MULTICAST 0
+#define WAN_PACKET_MR_PROMISC 1
+#define WAN_PACKET_MR_ALLMULTI 2
+
+
+#endif
diff --git a/sysroot/usr/include/linux/igmp.h b/sysroot/usr/include/linux/igmp.h
new file mode 100644
index 0000000..27bdaae
--- /dev/null
+++ b/sysroot/usr/include/linux/igmp.h
@@ -0,0 +1,129 @@
+/*
+ * Linux NET3: Internet Group Management Protocol [IGMP]
+ *
+ * Authors:
+ * Alan Cox <Alan.Cox@linux.org>
+ *
+ * Extended to talk the BSD extended IGMP protocol of mrouted 3.6
+ *
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _LINUX_IGMP_H
+#define _LINUX_IGMP_H
+
+#include <asm/byteorder.h>
+
+/*
+ * IGMP protocol structures
+ */
+
+/*
+ * Header in on cable format
+ */
+
+struct igmphdr
+{
+ __u8 type;
+ __u8 code; /* For newer IGMP */
+ __sum16 csum;
+ __be32 group;
+};
+
+/* V3 group record types [grec_type] */
+#define IGMPV3_MODE_IS_INCLUDE 1
+#define IGMPV3_MODE_IS_EXCLUDE 2
+#define IGMPV3_CHANGE_TO_INCLUDE 3
+#define IGMPV3_CHANGE_TO_EXCLUDE 4
+#define IGMPV3_ALLOW_NEW_SOURCES 5
+#define IGMPV3_BLOCK_OLD_SOURCES 6
+
+struct igmpv3_grec {
+ __u8 grec_type;
+ __u8 grec_auxwords;
+ __be16 grec_nsrcs;
+ __be32 grec_mca;
+ __be32 grec_src[0];
+};
+
+struct igmpv3_report {
+ __u8 type;
+ __u8 resv1;
+ __be16 csum;
+ __be16 resv2;
+ __be16 ngrec;
+ struct igmpv3_grec grec[0];
+};
+
+struct igmpv3_query {
+ __u8 type;
+ __u8 code;
+ __be16 csum;
+ __be32 group;
+#if defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 qrv:3,
+ suppress:1,
+ resv:4;
+#elif defined(__BIG_ENDIAN_BITFIELD)
+ __u8 resv:4,
+ suppress:1,
+ qrv:3;
+#else
+#error "Please fix <asm/byteorder.h>"
+#endif
+ __u8 qqic;
+ __be16 nsrcs;
+ __be32 srcs[0];
+};
+
+
+#define IGMP_HOST_MEMBERSHIP_QUERY 0x11 /* From RFC1112 */
+#define IGMP_HOST_MEMBERSHIP_REPORT 0x12 /* Ditto */
+#define IGMP_DVMRP 0x13 /* DVMRP routing */
+#define IGMP_PIM 0x14 /* PIM routing */
+#define IGMP_TRACE 0x15
+#define IGMPV2_HOST_MEMBERSHIP_REPORT 0x16 /* V2 version of 0x11 */
+#define IGMP_HOST_LEAVE_MESSAGE 0x17
+#define IGMPV3_HOST_MEMBERSHIP_REPORT 0x22 /* V3 version of 0x11 */
+
+#define IGMP_MTRACE_RESP 0x1e
+#define IGMP_MTRACE 0x1f
+
+
+/*
+ * Use the BSD names for these for compatibility
+ */
+
+#define IGMP_DELAYING_MEMBER 0x01
+#define IGMP_IDLE_MEMBER 0x02
+#define IGMP_LAZY_MEMBER 0x03
+#define IGMP_SLEEPING_MEMBER 0x04
+#define IGMP_AWAKENING_MEMBER 0x05
+
+#define IGMP_MINLEN 8
+
+#define IGMP_MAX_HOST_REPORT_DELAY 10 /* max delay for response to */
+ /* query (in seconds) */
+
+#define IGMP_TIMER_SCALE 10 /* denotes that the igmphdr->timer field */
+ /* specifies time in 10th of seconds */
+
+#define IGMP_AGE_THRESHOLD 400 /* If this host don't hear any IGMP V1 */
+ /* message in this period of time, */
+ /* revert to IGMP v2 router. */
+
+#define IGMP_ALL_HOSTS htonl(0xE0000001L)
+#define IGMP_ALL_ROUTER htonl(0xE0000002L)
+#define IGMPV3_ALL_MCR htonl(0xE0000016L)
+#define IGMP_LOCAL_GROUP htonl(0xE0000000L)
+#define IGMP_LOCAL_GROUP_MASK htonl(0xFFFFFF00L)
+
+/*
+ * struct for keeping the multicast list in
+ */
+
+#endif
diff --git a/sysroot/usr/include/linux/in.h b/sysroot/usr/include/linux/in.h
new file mode 100644
index 0000000..544bc70
--- /dev/null
+++ b/sysroot/usr/include/linux/in.h
@@ -0,0 +1,249 @@
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Definitions of the Internet Protocol.
+ *
+ * Version: @(#)in.h 1.0.1 04/21/93
+ *
+ * Authors: Original taken from the GNU Project <netinet/in.h> file.
+ * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#ifndef _LINUX_IN_H
+#define _LINUX_IN_H
+
+#include <linux/types.h>
+#include <linux/socket.h>
+
+/* Standard well-defined IP protocols. */
+enum {
+ IPPROTO_IP = 0, /* Dummy protocol for TCP */
+ IPPROTO_ICMP = 1, /* Internet Control Message Protocol */
+ IPPROTO_IGMP = 2, /* Internet Group Management Protocol */
+ IPPROTO_IPIP = 4, /* IPIP tunnels (older KA9Q tunnels use 94) */
+ IPPROTO_TCP = 6, /* Transmission Control Protocol */
+ IPPROTO_EGP = 8, /* Exterior Gateway Protocol */
+ IPPROTO_PUP = 12, /* PUP protocol */
+ IPPROTO_UDP = 17, /* User Datagram Protocol */
+ IPPROTO_IDP = 22, /* XNS IDP protocol */
+ IPPROTO_DCCP = 33, /* Datagram Congestion Control Protocol */
+ IPPROTO_RSVP = 46, /* RSVP protocol */
+ IPPROTO_GRE = 47, /* Cisco GRE tunnels (rfc 1701,1702) */
+
+ IPPROTO_IPV6 = 41, /* IPv6-in-IPv4 tunnelling */
+
+ IPPROTO_ESP = 50, /* Encapsulation Security Payload protocol */
+ IPPROTO_AH = 51, /* Authentication Header protocol */
+ IPPROTO_BEETPH = 94, /* IP option pseudo header for BEET */
+ IPPROTO_PIM = 103, /* Protocol Independent Multicast */
+
+ IPPROTO_COMP = 108, /* Compression Header protocol */
+ IPPROTO_SCTP = 132, /* Stream Control Transport Protocol */
+ IPPROTO_UDPLITE = 136, /* UDP-Lite (RFC 3828) */
+
+ IPPROTO_RAW = 255, /* Raw IP packets */
+ IPPROTO_MAX
+};
+
+
+/* Internet address. */
+struct in_addr {
+ __be32 s_addr;
+};
+
+#define IP_TOS 1
+#define IP_TTL 2
+#define IP_HDRINCL 3
+#define IP_OPTIONS 4
+#define IP_ROUTER_ALERT 5
+#define IP_RECVOPTS 6
+#define IP_RETOPTS 7
+#define IP_PKTINFO 8
+#define IP_PKTOPTIONS 9
+#define IP_MTU_DISCOVER 10
+#define IP_RECVERR 11
+#define IP_RECVTTL 12
+#define IP_RECVTOS 13
+#define IP_MTU 14
+#define IP_FREEBIND 15
+#define IP_IPSEC_POLICY 16
+#define IP_XFRM_POLICY 17
+#define IP_PASSSEC 18
+
+/* BSD compatibility */
+#define IP_RECVRETOPTS IP_RETOPTS
+
+/* IP_MTU_DISCOVER values */
+#define IP_PMTUDISC_DONT 0 /* Never send DF frames */
+#define IP_PMTUDISC_WANT 1 /* Use per route hints */
+#define IP_PMTUDISC_DO 2 /* Always DF */
+#define IP_PMTUDISC_PROBE 3 /* Ignore dst pmtu */
+
+#define IP_MULTICAST_IF 32
+#define IP_MULTICAST_TTL 33
+#define IP_MULTICAST_LOOP 34
+#define IP_ADD_MEMBERSHIP 35
+#define IP_DROP_MEMBERSHIP 36
+#define IP_UNBLOCK_SOURCE 37
+#define IP_BLOCK_SOURCE 38
+#define IP_ADD_SOURCE_MEMBERSHIP 39
+#define IP_DROP_SOURCE_MEMBERSHIP 40
+#define IP_MSFILTER 41
+#define MCAST_JOIN_GROUP 42
+#define MCAST_BLOCK_SOURCE 43
+#define MCAST_UNBLOCK_SOURCE 44
+#define MCAST_LEAVE_GROUP 45
+#define MCAST_JOIN_SOURCE_GROUP 46
+#define MCAST_LEAVE_SOURCE_GROUP 47
+#define MCAST_MSFILTER 48
+
+#define MCAST_EXCLUDE 0
+#define MCAST_INCLUDE 1
+
+/* These need to appear somewhere around here */
+#define IP_DEFAULT_MULTICAST_TTL 1
+#define IP_DEFAULT_MULTICAST_LOOP 1
+
+/* Request struct for multicast socket ops */
+
+struct ip_mreq
+{
+ struct in_addr imr_multiaddr; /* IP multicast address of group */
+ struct in_addr imr_interface; /* local IP address of interface */
+};
+
+struct ip_mreqn
+{
+ struct in_addr imr_multiaddr; /* IP multicast address of group */
+ struct in_addr imr_address; /* local IP address of interface */
+ int imr_ifindex; /* Interface index */
+};
+
+struct ip_mreq_source {
+ __be32 imr_multiaddr;
+ __be32 imr_interface;
+ __be32 imr_sourceaddr;
+};
+
+struct ip_msfilter {
+ __be32 imsf_multiaddr;
+ __be32 imsf_interface;
+ __u32 imsf_fmode;
+ __u32 imsf_numsrc;
+ __be32 imsf_slist[1];
+};
+
+#define IP_MSFILTER_SIZE(numsrc) \
+ (sizeof(struct ip_msfilter) - sizeof(__u32) \
+ + (numsrc) * sizeof(__u32))
+
+struct group_req
+{
+ __u32 gr_interface; /* interface index */
+ struct __kernel_sockaddr_storage gr_group; /* group address */
+};
+
+struct group_source_req
+{
+ __u32 gsr_interface; /* interface index */
+ struct __kernel_sockaddr_storage gsr_group; /* group address */
+ struct __kernel_sockaddr_storage gsr_source; /* source address */
+};
+
+struct group_filter
+{
+ __u32 gf_interface; /* interface index */
+ struct __kernel_sockaddr_storage gf_group; /* multicast address */
+ __u32 gf_fmode; /* filter mode */
+ __u32 gf_numsrc; /* number of sources */
+ struct __kernel_sockaddr_storage gf_slist[1]; /* interface index */
+};
+
+#define GROUP_FILTER_SIZE(numsrc) \
+ (sizeof(struct group_filter) - sizeof(struct __kernel_sockaddr_storage) \
+ + (numsrc) * sizeof(struct __kernel_sockaddr_storage))
+
+struct in_pktinfo
+{
+ int ipi_ifindex;
+ struct in_addr ipi_spec_dst;
+ struct in_addr ipi_addr;
+};
+
+/* Structure describing an Internet (IP) socket address. */
+#define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */
+struct sockaddr_in {
+ sa_family_t sin_family; /* Address family */
+ __be16 sin_port; /* Port number */
+ struct in_addr sin_addr; /* Internet address */
+
+ /* Pad to size of `struct sockaddr'. */
+ unsigned char __pad[__SOCK_SIZE__ - sizeof(short int) -
+ sizeof(unsigned short int) - sizeof(struct in_addr)];
+};
+#define sin_zero __pad /* for BSD UNIX comp. -FvK */
+
+
+/*
+ * Definitions of the bits in an Internet address integer.
+ * On subnets, host and network parts are found according
+ * to the subnet mask, not these masks.
+ */
+#define IN_CLASSA(a) ((((long int) (a)) & 0x80000000) == 0)
+#define IN_CLASSA_NET 0xff000000
+#define IN_CLASSA_NSHIFT 24
+#define IN_CLASSA_HOST (0xffffffff & ~IN_CLASSA_NET)
+#define IN_CLASSA_MAX 128
+
+#define IN_CLASSB(a) ((((long int) (a)) & 0xc0000000) == 0x80000000)
+#define IN_CLASSB_NET 0xffff0000
+#define IN_CLASSB_NSHIFT 16
+#define IN_CLASSB_HOST (0xffffffff & ~IN_CLASSB_NET)
+#define IN_CLASSB_MAX 65536
+
+#define IN_CLASSC(a) ((((long int) (a)) & 0xe0000000) == 0xc0000000)
+#define IN_CLASSC_NET 0xffffff00
+#define IN_CLASSC_NSHIFT 8
+#define IN_CLASSC_HOST (0xffffffff & ~IN_CLASSC_NET)
+
+#define IN_CLASSD(a) ((((long int) (a)) & 0xf0000000) == 0xe0000000)
+#define IN_MULTICAST(a) IN_CLASSD(a)
+#define IN_MULTICAST_NET 0xF0000000
+
+#define IN_EXPERIMENTAL(a) ((((long int) (a)) & 0xf0000000) == 0xf0000000)
+#define IN_BADCLASS(a) IN_EXPERIMENTAL((a))
+
+/* Address to accept any incoming messages. */
+#define INADDR_ANY ((unsigned long int) 0x00000000)
+
+/* Address to send to all hosts. */
+#define INADDR_BROADCAST ((unsigned long int) 0xffffffff)
+
+/* Address indicating an error return. */
+#define INADDR_NONE ((unsigned long int) 0xffffffff)
+
+/* Network number for local host loopback. */
+#define IN_LOOPBACKNET 127
+
+/* Address to loopback in software to local host. */
+#define INADDR_LOOPBACK 0x7f000001 /* 127.0.0.1 */
+#define IN_LOOPBACK(a) ((((long int) (a)) & 0xff000000) == 0x7f000000)
+
+/* Defines for Multicast INADDR */
+#define INADDR_UNSPEC_GROUP 0xe0000000U /* 224.0.0.0 */
+#define INADDR_ALLHOSTS_GROUP 0xe0000001U /* 224.0.0.1 */
+#define INADDR_ALLRTRS_GROUP 0xe0000002U /* 224.0.0.2 */
+#define INADDR_MAX_LOCAL_GROUP 0xe00000ffU /* 224.0.0.255 */
+
+
+/* <asm/byteorder.h> contains the htonl type stuff.. */
+#include <asm/byteorder.h>
+
+
+#endif /* _LINUX_IN_H */
diff --git a/sysroot/usr/include/linux/in6.h b/sysroot/usr/include/linux/in6.h
new file mode 100644
index 0000000..2a61c82
--- /dev/null
+++ b/sysroot/usr/include/linux/in6.h
@@ -0,0 +1,252 @@
+/*
+ * Types and definitions for AF_INET6
+ * Linux INET6 implementation
+ *
+ * Authors:
+ * Pedro Roque <roque@di.fc.ul.pt>
+ *
+ * Sources:
+ * IPv6 Program Interfaces for BSD Systems
+ * <draft-ietf-ipngwg-bsd-api-05.txt>
+ *
+ * Advanced Sockets API for IPv6
+ * <draft-stevens-advanced-api-00.txt>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _LINUX_IN6_H
+#define _LINUX_IN6_H
+
+#include <linux/types.h>
+
+/*
+ * IPv6 address structure
+ */
+
+struct in6_addr
+{
+ union
+ {
+ __u8 u6_addr8[16];
+ __be16 u6_addr16[8];
+ __be32 u6_addr32[4];
+ } in6_u;
+#define s6_addr in6_u.u6_addr8
+#define s6_addr16 in6_u.u6_addr16
+#define s6_addr32 in6_u.u6_addr32
+};
+
+/* IPv6 Wildcard Address (::) and Loopback Address (::1) defined in RFC2553
+ * NOTE: Be aware the IN6ADDR_* constants and in6addr_* externals are defined
+ * in network byte order, not in host byte order as are the IPv4 equivalents
+ */
+extern const struct in6_addr in6addr_any;
+#define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }
+extern const struct in6_addr in6addr_loopback;
+#define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } }
+
+struct sockaddr_in6 {
+ unsigned short int sin6_family; /* AF_INET6 */
+ __be16 sin6_port; /* Transport layer port # */
+ __be32 sin6_flowinfo; /* IPv6 flow information */
+ struct in6_addr sin6_addr; /* IPv6 address */
+ __u32 sin6_scope_id; /* scope id (new in RFC2553) */
+};
+
+struct ipv6_mreq {
+ /* IPv6 multicast address of group */
+ struct in6_addr ipv6mr_multiaddr;
+
+ /* local IPv6 address of interface */
+ int ipv6mr_ifindex;
+};
+
+#define ipv6mr_acaddr ipv6mr_multiaddr
+
+struct in6_flowlabel_req
+{
+ struct in6_addr flr_dst;
+ __be32 flr_label;
+ __u8 flr_action;
+ __u8 flr_share;
+ __u16 flr_flags;
+ __u16 flr_expires;
+ __u16 flr_linger;
+ __u32 __flr_pad;
+ /* Options in format of IPV6_PKTOPTIONS */
+};
+
+#define IPV6_FL_A_GET 0
+#define IPV6_FL_A_PUT 1
+#define IPV6_FL_A_RENEW 2
+
+#define IPV6_FL_F_CREATE 1
+#define IPV6_FL_F_EXCL 2
+
+#define IPV6_FL_S_NONE 0
+#define IPV6_FL_S_EXCL 1
+#define IPV6_FL_S_PROCESS 2
+#define IPV6_FL_S_USER 3
+#define IPV6_FL_S_ANY 255
+
+
+/*
+ * Bitmask constant declarations to help applications select out the
+ * flow label and priority fields.
+ *
+ * Note that this are in host byte order while the flowinfo field of
+ * sockaddr_in6 is in network byte order.
+ */
+
+#define IPV6_FLOWINFO_FLOWLABEL 0x000fffff
+#define IPV6_FLOWINFO_PRIORITY 0x0ff00000
+
+/* These defintions are obsolete */
+#define IPV6_PRIORITY_UNCHARACTERIZED 0x0000
+#define IPV6_PRIORITY_FILLER 0x0100
+#define IPV6_PRIORITY_UNATTENDED 0x0200
+#define IPV6_PRIORITY_RESERVED1 0x0300
+#define IPV6_PRIORITY_BULK 0x0400
+#define IPV6_PRIORITY_RESERVED2 0x0500
+#define IPV6_PRIORITY_INTERACTIVE 0x0600
+#define IPV6_PRIORITY_CONTROL 0x0700
+#define IPV6_PRIORITY_8 0x0800
+#define IPV6_PRIORITY_9 0x0900
+#define IPV6_PRIORITY_10 0x0a00
+#define IPV6_PRIORITY_11 0x0b00
+#define IPV6_PRIORITY_12 0x0c00
+#define IPV6_PRIORITY_13 0x0d00
+#define IPV6_PRIORITY_14 0x0e00
+#define IPV6_PRIORITY_15 0x0f00
+
+/*
+ * IPV6 extension headers
+ */
+#define IPPROTO_HOPOPTS 0 /* IPv6 hop-by-hop options */
+#define IPPROTO_ROUTING 43 /* IPv6 routing header */
+#define IPPROTO_FRAGMENT 44 /* IPv6 fragmentation header */
+#define IPPROTO_ICMPV6 58 /* ICMPv6 */
+#define IPPROTO_NONE 59 /* IPv6 no next header */
+#define IPPROTO_DSTOPTS 60 /* IPv6 destination options */
+#define IPPROTO_MH 135 /* IPv6 mobility header */
+
+/*
+ * IPv6 TLV options.
+ */
+#define IPV6_TLV_PAD0 0
+#define IPV6_TLV_PADN 1
+#define IPV6_TLV_ROUTERALERT 5
+#define IPV6_TLV_JUMBO 194
+#define IPV6_TLV_HAO 201 /* home address option */
+
+/*
+ * IPV6 socket options
+ */
+
+#define IPV6_ADDRFORM 1
+#define IPV6_2292PKTINFO 2
+#define IPV6_2292HOPOPTS 3
+#define IPV6_2292DSTOPTS 4
+#define IPV6_2292RTHDR 5
+#define IPV6_2292PKTOPTIONS 6
+#define IPV6_CHECKSUM 7
+#define IPV6_2292HOPLIMIT 8
+#define IPV6_NEXTHOP 9
+#define IPV6_AUTHHDR 10 /* obsolete */
+#define IPV6_FLOWINFO 11
+
+#define IPV6_UNICAST_HOPS 16
+#define IPV6_MULTICAST_IF 17
+#define IPV6_MULTICAST_HOPS 18
+#define IPV6_MULTICAST_LOOP 19
+#define IPV6_ADD_MEMBERSHIP 20
+#define IPV6_DROP_MEMBERSHIP 21
+#define IPV6_ROUTER_ALERT 22
+#define IPV6_MTU_DISCOVER 23
+#define IPV6_MTU 24
+#define IPV6_RECVERR 25
+#define IPV6_V6ONLY 26
+#define IPV6_JOIN_ANYCAST 27
+#define IPV6_LEAVE_ANYCAST 28
+
+/* IPV6_MTU_DISCOVER values */
+#define IPV6_PMTUDISC_DONT 0
+#define IPV6_PMTUDISC_WANT 1
+#define IPV6_PMTUDISC_DO 2
+#define IPV6_PMTUDISC_PROBE 3
+
+/* Flowlabel */
+#define IPV6_FLOWLABEL_MGR 32
+#define IPV6_FLOWINFO_SEND 33
+
+#define IPV6_IPSEC_POLICY 34
+#define IPV6_XFRM_POLICY 35
+
+/*
+ * Multicast:
+ * Following socket options are shared between IPv4 and IPv6.
+ *
+ * MCAST_JOIN_GROUP 42
+ * MCAST_BLOCK_SOURCE 43
+ * MCAST_UNBLOCK_SOURCE 44
+ * MCAST_LEAVE_GROUP 45
+ * MCAST_JOIN_SOURCE_GROUP 46
+ * MCAST_LEAVE_SOURCE_GROUP 47
+ * MCAST_MSFILTER 48
+ */
+
+/*
+ * Advanced API (RFC3542) (1)
+ *
+ * Note: IPV6_RECVRTHDRDSTOPTS does not exist. see net/ipv6/datagram.c.
+ */
+
+#define IPV6_RECVPKTINFO 49
+#define IPV6_PKTINFO 50
+#define IPV6_RECVHOPLIMIT 51
+#define IPV6_HOPLIMIT 52
+#define IPV6_RECVHOPOPTS 53
+#define IPV6_HOPOPTS 54
+#define IPV6_RTHDRDSTOPTS 55
+#define IPV6_RECVRTHDR 56
+#define IPV6_RTHDR 57
+#define IPV6_RECVDSTOPTS 58
+#define IPV6_DSTOPTS 59
+#if 0 /* not yet */
+#define IPV6_RECVPATHMTU 60
+#define IPV6_PATHMTU 61
+#define IPV6_DONTFRAG 62
+#define IPV6_USE_MIN_MTU 63
+#endif
+
+/*
+ * Netfilter (1)
+ *
+ * Following socket options are used in ip6_tables;
+ * see include/linux/netfilter_ipv6/ip6_tables.h.
+ *
+ * IP6T_SO_SET_REPLACE / IP6T_SO_GET_INFO 64
+ * IP6T_SO_SET_ADD_COUNTERS / IP6T_SO_GET_ENTRIES 65
+ */
+
+/*
+ * Advanced API (RFC3542) (2)
+ */
+#define IPV6_RECVTCLASS 66
+#define IPV6_TCLASS 67
+
+/*
+ * Netfilter (2)
+ *
+ * Following socket options are used in ip6_tables;
+ * see include/linux/netfilter_ipv6/ip6_tables.h.
+ *
+ * IP6T_SO_GET_REVISION_MATCH 68
+ * IP6T_SO_GET_REVISION_TARGET 69
+ */
+
+#endif
diff --git a/sysroot/usr/include/linux/in_route.h b/sysroot/usr/include/linux/in_route.h
new file mode 100644
index 0000000..61f25c3
--- /dev/null
+++ b/sysroot/usr/include/linux/in_route.h
@@ -0,0 +1,32 @@
+#ifndef _LINUX_IN_ROUTE_H
+#define _LINUX_IN_ROUTE_H
+
+/* IPv4 routing cache flags */
+
+#define RTCF_DEAD RTNH_F_DEAD
+#define RTCF_ONLINK RTNH_F_ONLINK
+
+/* Obsolete flag. About to be deleted */
+#define RTCF_NOPMTUDISC RTM_F_NOPMTUDISC
+
+#define RTCF_NOTIFY 0x00010000
+#define RTCF_DIRECTDST 0x00020000
+#define RTCF_REDIRECTED 0x00040000
+#define RTCF_TPROXY 0x00080000
+
+#define RTCF_FAST 0x00200000
+#define RTCF_MASQ 0x00400000
+#define RTCF_SNAT 0x00800000
+#define RTCF_DOREDIRECT 0x01000000
+#define RTCF_DIRECTSRC 0x04000000
+#define RTCF_DNAT 0x08000000
+#define RTCF_BROADCAST 0x10000000
+#define RTCF_MULTICAST 0x20000000
+#define RTCF_REJECT 0x40000000
+#define RTCF_LOCAL 0x80000000
+
+#define RTCF_NAT (RTCF_DNAT|RTCF_SNAT)
+
+#define RT_TOS(tos) ((tos)&IPTOS_TOS_MASK)
+
+#endif /* _LINUX_IN_ROUTE_H */
diff --git a/sysroot/usr/include/linux/inet_diag.h b/sysroot/usr/include/linux/inet_diag.h
new file mode 100644
index 0000000..1ae9303
--- /dev/null
+++ b/sysroot/usr/include/linux/inet_diag.h
@@ -0,0 +1,122 @@
+#ifndef _INET_DIAG_H_
+#define _INET_DIAG_H_ 1
+
+/* Just some random number */
+#define TCPDIAG_GETSOCK 18
+#define DCCPDIAG_GETSOCK 19
+
+#define INET_DIAG_GETSOCK_MAX 24
+
+/* Socket identity */
+struct inet_diag_sockid {
+ __be16 idiag_sport;
+ __be16 idiag_dport;
+ __be32 idiag_src[4];
+ __be32 idiag_dst[4];
+ __u32 idiag_if;
+ __u32 idiag_cookie[2];
+#define INET_DIAG_NOCOOKIE (~0U)
+};
+
+/* Request structure */
+
+struct inet_diag_req {
+ __u8 idiag_family; /* Family of addresses. */
+ __u8 idiag_src_len;
+ __u8 idiag_dst_len;
+ __u8 idiag_ext; /* Query extended information */
+
+ struct inet_diag_sockid id;
+
+ __u32 idiag_states; /* States to dump */
+ __u32 idiag_dbs; /* Tables to dump (NI) */
+};
+
+enum {
+ INET_DIAG_REQ_NONE,
+ INET_DIAG_REQ_BYTECODE,
+};
+
+#define INET_DIAG_REQ_MAX INET_DIAG_REQ_BYTECODE
+
+/* Bytecode is sequence of 4 byte commands followed by variable arguments.
+ * All the commands identified by "code" are conditional jumps forward:
+ * to offset cc+"yes" or to offset cc+"no". "yes" is supposed to be
+ * length of the command and its arguments.
+ */
+
+struct inet_diag_bc_op {
+ unsigned char code;
+ unsigned char yes;
+ unsigned short no;
+};
+
+enum {
+ INET_DIAG_BC_NOP,
+ INET_DIAG_BC_JMP,
+ INET_DIAG_BC_S_GE,
+ INET_DIAG_BC_S_LE,
+ INET_DIAG_BC_D_GE,
+ INET_DIAG_BC_D_LE,
+ INET_DIAG_BC_AUTO,
+ INET_DIAG_BC_S_COND,
+ INET_DIAG_BC_D_COND,
+};
+
+struct inet_diag_hostcond {
+ __u8 family;
+ __u8 prefix_len;
+ int port;
+ __be32 addr[0];
+};
+
+/* Base info structure. It contains socket identity (addrs/ports/cookie)
+ * and, alas, the information shown by netstat. */
+struct inet_diag_msg {
+ __u8 idiag_family;
+ __u8 idiag_state;
+ __u8 idiag_timer;
+ __u8 idiag_retrans;
+
+ struct inet_diag_sockid id;
+
+ __u32 idiag_expires;
+ __u32 idiag_rqueue;
+ __u32 idiag_wqueue;
+ __u32 idiag_uid;
+ __u32 idiag_inode;
+};
+
+/* Extensions */
+
+enum {
+ INET_DIAG_NONE,
+ INET_DIAG_MEMINFO,
+ INET_DIAG_INFO,
+ INET_DIAG_VEGASINFO,
+ INET_DIAG_CONG,
+};
+
+#define INET_DIAG_MAX INET_DIAG_CONG
+
+
+/* INET_DIAG_MEM */
+
+struct inet_diag_meminfo {
+ __u32 idiag_rmem;
+ __u32 idiag_wmem;
+ __u32 idiag_fmem;
+ __u32 idiag_tmem;
+};
+
+/* INET_DIAG_VEGASINFO */
+
+struct tcpvegas_info {
+ __u32 tcpv_enabled;
+ __u32 tcpv_rttcnt;
+ __u32 tcpv_rtt;
+ __u32 tcpv_minrtt;
+};
+
+
+#endif /* _INET_DIAG_H_ */
diff --git a/sysroot/usr/include/linux/inotify.h b/sysroot/usr/include/linux/inotify.h
new file mode 100644
index 0000000..7ec4e85
--- /dev/null
+++ b/sysroot/usr/include/linux/inotify.h
@@ -0,0 +1,67 @@
+/*
+ * Inode based directory notification for Linux
+ *
+ * Copyright (C) 2005 John McCutchan
+ */
+
+#ifndef _LINUX_INOTIFY_H
+#define _LINUX_INOTIFY_H
+
+#include <linux/types.h>
+
+/*
+ * struct inotify_event - structure read from the inotify device for each event
+ *
+ * When you are watching a directory, you will receive the filename for events
+ * such as IN_CREATE, IN_DELETE, IN_OPEN, IN_CLOSE, ..., relative to the wd.
+ */
+struct inotify_event {
+ __s32 wd; /* watch descriptor */
+ __u32 mask; /* watch mask */
+ __u32 cookie; /* cookie to synchronize two events */
+ __u32 len; /* length (including nulls) of name */
+ char name[0]; /* stub for possible name */
+};
+
+/* the following are legal, implemented events that user-space can watch for */
+#define IN_ACCESS 0x00000001 /* File was accessed */
+#define IN_MODIFY 0x00000002 /* File was modified */
+#define IN_ATTRIB 0x00000004 /* Metadata changed */
+#define IN_CLOSE_WRITE 0x00000008 /* Writtable file was closed */
+#define IN_CLOSE_NOWRITE 0x00000010 /* Unwrittable file closed */
+#define IN_OPEN 0x00000020 /* File was opened */
+#define IN_MOVED_FROM 0x00000040 /* File was moved from X */
+#define IN_MOVED_TO 0x00000080 /* File was moved to Y */
+#define IN_CREATE 0x00000100 /* Subfile was created */
+#define IN_DELETE 0x00000200 /* Subfile was deleted */
+#define IN_DELETE_SELF 0x00000400 /* Self was deleted */
+#define IN_MOVE_SELF 0x00000800 /* Self was moved */
+
+/* the following are legal events. they are sent as needed to any watch */
+#define IN_UNMOUNT 0x00002000 /* Backing fs was unmounted */
+#define IN_Q_OVERFLOW 0x00004000 /* Event queued overflowed */
+#define IN_IGNORED 0x00008000 /* File was ignored */
+
+/* helper events */
+#define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* close */
+#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* moves */
+
+/* special flags */
+#define IN_ONLYDIR 0x01000000 /* only watch the path if it is a directory */
+#define IN_DONT_FOLLOW 0x02000000 /* don't follow a sym link */
+#define IN_MASK_ADD 0x20000000 /* add to the mask of an already existing watch */
+#define IN_ISDIR 0x40000000 /* event occurred against dir */
+#define IN_ONESHOT 0x80000000 /* only send event once */
+
+/*
+ * All of the events - we build the list by hand so that we can add flags in
+ * the future and not break backward compatibility. Apps will get only the
+ * events that they originally wanted. Be sure to add new events here!
+ */
+#define IN_ALL_EVENTS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | \
+ IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | \
+ IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF | \
+ IN_MOVE_SELF)
+
+
+#endif /* _LINUX_INOTIFY_H */
diff --git a/sysroot/usr/include/linux/input.h b/sysroot/usr/include/linux/input.h
new file mode 100644
index 0000000..f7e2129
--- /dev/null
+++ b/sysroot/usr/include/linux/input.h
@@ -0,0 +1,936 @@
+#ifndef _INPUT_H
+#define _INPUT_H
+
+/*
+ * Copyright (c) 1999-2002 Vojtech Pavlik
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+
+#include <sys/time.h>
+#include <sys/ioctl.h>
+#include <sys/types.h>
+#include <asm/types.h>
+
+/*
+ * The event structure itself
+ */
+
+struct input_event {
+ struct timeval time;
+ __u16 type;
+ __u16 code;
+ __s32 value;
+};
+
+/*
+ * Protocol version.
+ */
+
+#define EV_VERSION 0x010000
+
+/*
+ * IOCTLs (0x00 - 0x7f)
+ */
+
+struct input_id {
+ __u16 bustype;
+ __u16 vendor;
+ __u16 product;
+ __u16 version;
+};
+
+struct input_absinfo {
+ __s32 value;
+ __s32 minimum;
+ __s32 maximum;
+ __s32 fuzz;
+ __s32 flat;
+};
+
+#define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */
+#define EVIOCGID _IOR('E', 0x02, struct input_id) /* get device ID */
+#define EVIOCGREP _IOR('E', 0x03, int[2]) /* get repeat settings */
+#define EVIOCSREP _IOW('E', 0x03, int[2]) /* set repeat settings */
+#define EVIOCGKEYCODE _IOR('E', 0x04, int[2]) /* get keycode */
+#define EVIOCSKEYCODE _IOW('E', 0x04, int[2]) /* set keycode */
+
+#define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) /* get device name */
+#define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) /* get physical location */
+#define EVIOCGUNIQ(len) _IOC(_IOC_READ, 'E', 0x08, len) /* get unique identifier */
+
+#define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len) /* get global keystate */
+#define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len) /* get all LEDs */
+#define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len) /* get all sounds status */
+#define EVIOCGSW(len) _IOC(_IOC_READ, 'E', 0x1b, len) /* get all switch states */
+
+#define EVIOCGBIT(ev,len) _IOC(_IOC_READ, 'E', 0x20 + ev, len) /* get event bits */
+#define EVIOCGABS(abs) _IOR('E', 0x40 + abs, struct input_absinfo) /* get abs value/limits */
+#define EVIOCSABS(abs) _IOW('E', 0xc0 + abs, struct input_absinfo) /* set abs value/limits */
+
+#define EVIOCSFF _IOC(_IOC_WRITE, 'E', 0x80, sizeof(struct ff_effect)) /* send a force effect to a force feedback device */
+#define EVIOCRMFF _IOW('E', 0x81, int) /* Erase a force effect */
+#define EVIOCGEFFECTS _IOR('E', 0x84, int) /* Report number of effects playable at the same time */
+
+#define EVIOCGRAB _IOW('E', 0x90, int) /* Grab/Release device */
+
+/*
+ * Event types
+ */
+
+#define EV_SYN 0x00
+#define EV_KEY 0x01
+#define EV_REL 0x02
+#define EV_ABS 0x03
+#define EV_MSC 0x04
+#define EV_SW 0x05
+#define EV_LED 0x11
+#define EV_SND 0x12
+#define EV_REP 0x14
+#define EV_FF 0x15
+#define EV_PWR 0x16
+#define EV_FF_STATUS 0x17
+#define EV_MAX 0x1f
+#define EV_CNT (EV_MAX+1)
+
+/*
+ * Synchronization events.
+ */
+
+#define SYN_REPORT 0
+#define SYN_CONFIG 1
+
+/*
+ * Keys and buttons
+ *
+ * Most of the keys/buttons are modeled after USB HUT 1.12
+ * (see http://www.usb.org/developers/hidpage).
+ * Abbreviations in the comments:
+ * AC - Application Control
+ * AL - Application Launch Button
+ * SC - System Control
+ */
+
+#define KEY_RESERVED 0
+#define KEY_ESC 1
+#define KEY_1 2
+#define KEY_2 3
+#define KEY_3 4
+#define KEY_4 5
+#define KEY_5 6
+#define KEY_6 7
+#define KEY_7 8
+#define KEY_8 9
+#define KEY_9 10
+#define KEY_0 11
+#define KEY_MINUS 12
+#define KEY_EQUAL 13
+#define KEY_BACKSPACE 14
+#define KEY_TAB 15
+#define KEY_Q 16
+#define KEY_W 17
+#define KEY_E 18
+#define KEY_R 19
+#define KEY_T 20
+#define KEY_Y 21
+#define KEY_U 22
+#define KEY_I 23
+#define KEY_O 24
+#define KEY_P 25
+#define KEY_LEFTBRACE 26
+#define KEY_RIGHTBRACE 27
+#define KEY_ENTER 28
+#define KEY_LEFTCTRL 29
+#define KEY_A 30
+#define KEY_S 31
+#define KEY_D 32
+#define KEY_F 33
+#define KEY_G 34
+#define KEY_H 35
+#define KEY_J 36
+#define KEY_K 37
+#define KEY_L 38
+#define KEY_SEMICOLON 39
+#define KEY_APOSTROPHE 40
+#define KEY_GRAVE 41
+#define KEY_LEFTSHIFT 42
+#define KEY_BACKSLASH 43
+#define KEY_Z 44
+#define KEY_X 45
+#define KEY_C 46
+#define KEY_V 47
+#define KEY_B 48
+#define KEY_N 49
+#define KEY_M 50
+#define KEY_COMMA 51
+#define KEY_DOT 52
+#define KEY_SLASH 53
+#define KEY_RIGHTSHIFT 54
+#define KEY_KPASTERISK 55
+#define KEY_LEFTALT 56
+#define KEY_SPACE 57
+#define KEY_CAPSLOCK 58
+#define KEY_F1 59
+#define KEY_F2 60
+#define KEY_F3 61
+#define KEY_F4 62
+#define KEY_F5 63
+#define KEY_F6 64
+#define KEY_F7 65
+#define KEY_F8 66
+#define KEY_F9 67
+#define KEY_F10 68
+#define KEY_NUMLOCK 69
+#define KEY_SCROLLLOCK 70
+#define KEY_KP7 71
+#define KEY_KP8 72
+#define KEY_KP9 73
+#define KEY_KPMINUS 74
+#define KEY_KP4 75
+#define KEY_KP5 76
+#define KEY_KP6 77
+#define KEY_KPPLUS 78
+#define KEY_KP1 79
+#define KEY_KP2 80
+#define KEY_KP3 81
+#define KEY_KP0 82
+#define KEY_KPDOT 83
+
+#define KEY_ZENKAKUHANKAKU 85
+#define KEY_102ND 86
+#define KEY_F11 87
+#define KEY_F12 88
+#define KEY_RO 89
+#define KEY_KATAKANA 90
+#define KEY_HIRAGANA 91
+#define KEY_HENKAN 92
+#define KEY_KATAKANAHIRAGANA 93
+#define KEY_MUHENKAN 94
+#define KEY_KPJPCOMMA 95
+#define KEY_KPENTER 96
+#define KEY_RIGHTCTRL 97
+#define KEY_KPSLASH 98
+#define KEY_SYSRQ 99
+#define KEY_RIGHTALT 100
+#define KEY_LINEFEED 101
+#define KEY_HOME 102
+#define KEY_UP 103
+#define KEY_PAGEUP 104
+#define KEY_LEFT 105
+#define KEY_RIGHT 106
+#define KEY_END 107
+#define KEY_DOWN 108
+#define KEY_PAGEDOWN 109
+#define KEY_INSERT 110
+#define KEY_DELETE 111
+#define KEY_MACRO 112
+#define KEY_MUTE 113
+#define KEY_VOLUMEDOWN 114
+#define KEY_VOLUMEUP 115
+#define KEY_POWER 116 /* SC System Power Down */
+#define KEY_KPEQUAL 117
+#define KEY_KPPLUSMINUS 118
+#define KEY_PAUSE 119
+
+#define KEY_KPCOMMA 121
+#define KEY_HANGEUL 122
+#define KEY_HANGUEL KEY_HANGEUL
+#define KEY_HANJA 123
+#define KEY_YEN 124
+#define KEY_LEFTMETA 125
+#define KEY_RIGHTMETA 126
+#define KEY_COMPOSE 127
+
+#define KEY_STOP 128 /* AC Stop */
+#define KEY_AGAIN 129
+#define KEY_PROPS 130 /* AC Properties */
+#define KEY_UNDO 131 /* AC Undo */
+#define KEY_FRONT 132
+#define KEY_COPY 133 /* AC Copy */
+#define KEY_OPEN 134 /* AC Open */
+#define KEY_PASTE 135 /* AC Paste */
+#define KEY_FIND 136 /* AC Search */
+#define KEY_CUT 137 /* AC Cut */
+#define KEY_HELP 138 /* AL Integrated Help Center */
+#define KEY_MENU 139 /* Menu (show menu) */
+#define KEY_CALC 140 /* AL Calculator */
+#define KEY_SETUP 141
+#define KEY_SLEEP 142 /* SC System Sleep */
+#define KEY_WAKEUP 143 /* System Wake Up */
+#define KEY_FILE 144 /* AL Local Machine Browser */
+#define KEY_SENDFILE 145
+#define KEY_DELETEFILE 146
+#define KEY_XFER 147
+#define KEY_PROG1 148
+#define KEY_PROG2 149
+#define KEY_WWW 150 /* AL Internet Browser */
+#define KEY_MSDOS 151
+#define KEY_COFFEE 152 /* AL Terminal Lock/Screensaver */
+#define KEY_SCREENLOCK KEY_COFFEE
+#define KEY_DIRECTION 153
+#define KEY_CYCLEWINDOWS 154
+#define KEY_MAIL 155
+#define KEY_BOOKMARKS 156 /* AC Bookmarks */
+#define KEY_COMPUTER 157
+#define KEY_BACK 158 /* AC Back */
+#define KEY_FORWARD 159 /* AC Forward */
+#define KEY_CLOSECD 160
+#define KEY_EJECTCD 161
+#define KEY_EJECTCLOSECD 162
+#define KEY_NEXTSONG 163
+#define KEY_PLAYPAUSE 164
+#define KEY_PREVIOUSSONG 165
+#define KEY_STOPCD 166
+#define KEY_RECORD 167
+#define KEY_REWIND 168
+#define KEY_PHONE 169 /* Media Select Telephone */
+#define KEY_ISO 170
+#define KEY_CONFIG 171 /* AL Consumer Control Configuration */
+#define KEY_HOMEPAGE 172 /* AC Home */
+#define KEY_REFRESH 173 /* AC Refresh */
+#define KEY_EXIT 174 /* AC Exit */
+#define KEY_MOVE 175
+#define KEY_EDIT 176
+#define KEY_SCROLLUP 177
+#define KEY_SCROLLDOWN 178
+#define KEY_KPLEFTPAREN 179
+#define KEY_KPRIGHTPAREN 180
+#define KEY_NEW 181 /* AC New */
+#define KEY_REDO 182 /* AC Redo/Repeat */
+
+#define KEY_F13 183
+#define KEY_F14 184
+#define KEY_F15 185
+#define KEY_F16 186
+#define KEY_F17 187
+#define KEY_F18 188
+#define KEY_F19 189
+#define KEY_F20 190
+#define KEY_F21 191
+#define KEY_F22 192
+#define KEY_F23 193
+#define KEY_F24 194
+
+#define KEY_PLAYCD 200
+#define KEY_PAUSECD 201
+#define KEY_PROG3 202
+#define KEY_PROG4 203
+#define KEY_SUSPEND 205
+#define KEY_CLOSE 206 /* AC Close */
+#define KEY_PLAY 207
+#define KEY_FASTFORWARD 208
+#define KEY_BASSBOOST 209
+#define KEY_PRINT 210 /* AC Print */
+#define KEY_HP 211
+#define KEY_CAMERA 212
+#define KEY_SOUND 213
+#define KEY_QUESTION 214
+#define KEY_EMAIL 215
+#define KEY_CHAT 216
+#define KEY_SEARCH 217
+#define KEY_CONNECT 218
+#define KEY_FINANCE 219 /* AL Checkbook/Finance */
+#define KEY_SPORT 220
+#define KEY_SHOP 221
+#define KEY_ALTERASE 222
+#define KEY_CANCEL 223 /* AC Cancel */
+#define KEY_BRIGHTNESSDOWN 224
+#define KEY_BRIGHTNESSUP 225
+#define KEY_MEDIA 226
+
+#define KEY_SWITCHVIDEOMODE 227 /* Cycle between available video
+ outputs (Monitor/LCD/TV-out/etc) */
+#define KEY_KBDILLUMTOGGLE 228
+#define KEY_KBDILLUMDOWN 229
+#define KEY_KBDILLUMUP 230
+
+#define KEY_SEND 231 /* AC Send */
+#define KEY_REPLY 232 /* AC Reply */
+#define KEY_FORWARDMAIL 233 /* AC Forward Msg */
+#define KEY_SAVE 234 /* AC Save */
+#define KEY_DOCUMENTS 235
+
+#define KEY_BATTERY 236
+
+#define KEY_BLUETOOTH 237
+#define KEY_WLAN 238
+#define KEY_UWB 239
+
+#define KEY_UNKNOWN 240
+
+#define KEY_VIDEO_NEXT 241 /* drive next video source */
+#define KEY_VIDEO_PREV 242 /* drive previous video source */
+#define KEY_BRIGHTNESS_CYCLE 243 /* brightness up, after max is min */
+#define KEY_BRIGHTNESS_ZERO 244 /* brightness off, use ambient */
+#define KEY_DISPLAY_OFF 245 /* display device to off state */
+
+#define BTN_MISC 0x100
+#define BTN_0 0x100
+#define BTN_1 0x101
+#define BTN_2 0x102
+#define BTN_3 0x103
+#define BTN_4 0x104
+#define BTN_5 0x105
+#define BTN_6 0x106
+#define BTN_7 0x107
+#define BTN_8 0x108
+#define BTN_9 0x109
+
+#define BTN_MOUSE 0x110
+#define BTN_LEFT 0x110
+#define BTN_RIGHT 0x111
+#define BTN_MIDDLE 0x112
+#define BTN_SIDE 0x113
+#define BTN_EXTRA 0x114
+#define BTN_FORWARD 0x115
+#define BTN_BACK 0x116
+#define BTN_TASK 0x117
+
+#define BTN_JOYSTICK 0x120
+#define BTN_TRIGGER 0x120
+#define BTN_THUMB 0x121
+#define BTN_THUMB2 0x122
+#define BTN_TOP 0x123
+#define BTN_TOP2 0x124
+#define BTN_PINKIE 0x125
+#define BTN_BASE 0x126
+#define BTN_BASE2 0x127
+#define BTN_BASE3 0x128
+#define BTN_BASE4 0x129
+#define BTN_BASE5 0x12a
+#define BTN_BASE6 0x12b
+#define BTN_DEAD 0x12f
+
+#define BTN_GAMEPAD 0x130
+#define BTN_A 0x130
+#define BTN_B 0x131
+#define BTN_C 0x132
+#define BTN_X 0x133
+#define BTN_Y 0x134
+#define BTN_Z 0x135
+#define BTN_TL 0x136
+#define BTN_TR 0x137
+#define BTN_TL2 0x138
+#define BTN_TR2 0x139
+#define BTN_SELECT 0x13a
+#define BTN_START 0x13b
+#define BTN_MODE 0x13c
+#define BTN_THUMBL 0x13d
+#define BTN_THUMBR 0x13e
+
+#define BTN_DIGI 0x140
+#define BTN_TOOL_PEN 0x140
+#define BTN_TOOL_RUBBER 0x141
+#define BTN_TOOL_BRUSH 0x142
+#define BTN_TOOL_PENCIL 0x143
+#define BTN_TOOL_AIRBRUSH 0x144
+#define BTN_TOOL_FINGER 0x145
+#define BTN_TOOL_MOUSE 0x146
+#define BTN_TOOL_LENS 0x147
+#define BTN_TOUCH 0x14a
+#define BTN_STYLUS 0x14b
+#define BTN_STYLUS2 0x14c
+#define BTN_TOOL_DOUBLETAP 0x14d
+#define BTN_TOOL_TRIPLETAP 0x14e
+
+#define BTN_WHEEL 0x150
+#define BTN_GEAR_DOWN 0x150
+#define BTN_GEAR_UP 0x151
+
+#define KEY_OK 0x160
+#define KEY_SELECT 0x161
+#define KEY_GOTO 0x162
+#define KEY_CLEAR 0x163
+#define KEY_POWER2 0x164
+#define KEY_OPTION 0x165
+#define KEY_INFO 0x166 /* AL OEM Features/Tips/Tutorial */
+#define KEY_TIME 0x167
+#define KEY_VENDOR 0x168
+#define KEY_ARCHIVE 0x169
+#define KEY_PROGRAM 0x16a /* Media Select Program Guide */
+#define KEY_CHANNEL 0x16b
+#define KEY_FAVORITES 0x16c
+#define KEY_EPG 0x16d
+#define KEY_PVR 0x16e /* Media Select Home */
+#define KEY_MHP 0x16f
+#define KEY_LANGUAGE 0x170
+#define KEY_TITLE 0x171
+#define KEY_SUBTITLE 0x172
+#define KEY_ANGLE 0x173
+#define KEY_ZOOM 0x174
+#define KEY_MODE 0x175
+#define KEY_KEYBOARD 0x176
+#define KEY_SCREEN 0x177
+#define KEY_PC 0x178 /* Media Select Computer */
+#define KEY_TV 0x179 /* Media Select TV */
+#define KEY_TV2 0x17a /* Media Select Cable */
+#define KEY_VCR 0x17b /* Media Select VCR */
+#define KEY_VCR2 0x17c /* VCR Plus */
+#define KEY_SAT 0x17d /* Media Select Satellite */
+#define KEY_SAT2 0x17e
+#define KEY_CD 0x17f /* Media Select CD */
+#define KEY_TAPE 0x180 /* Media Select Tape */
+#define KEY_RADIO 0x181
+#define KEY_TUNER 0x182 /* Media Select Tuner */
+#define KEY_PLAYER 0x183
+#define KEY_TEXT 0x184
+#define KEY_DVD 0x185 /* Media Select DVD */
+#define KEY_AUX 0x186
+#define KEY_MP3 0x187
+#define KEY_AUDIO 0x188
+#define KEY_VIDEO 0x189
+#define KEY_DIRECTORY 0x18a
+#define KEY_LIST 0x18b
+#define KEY_MEMO 0x18c /* Media Select Messages */
+#define KEY_CALENDAR 0x18d
+#define KEY_RED 0x18e
+#define KEY_GREEN 0x18f
+#define KEY_YELLOW 0x190
+#define KEY_BLUE 0x191
+#define KEY_CHANNELUP 0x192 /* Channel Increment */
+#define KEY_CHANNELDOWN 0x193 /* Channel Decrement */
+#define KEY_FIRST 0x194
+#define KEY_LAST 0x195 /* Recall Last */
+#define KEY_AB 0x196
+#define KEY_NEXT 0x197
+#define KEY_RESTART 0x198
+#define KEY_SLOW 0x199
+#define KEY_SHUFFLE 0x19a
+#define KEY_BREAK 0x19b
+#define KEY_PREVIOUS 0x19c
+#define KEY_DIGITS 0x19d
+#define KEY_TEEN 0x19e
+#define KEY_TWEN 0x19f
+#define KEY_VIDEOPHONE 0x1a0 /* Media Select Video Phone */
+#define KEY_GAMES 0x1a1 /* Media Select Games */
+#define KEY_ZOOMIN 0x1a2 /* AC Zoom In */
+#define KEY_ZOOMOUT 0x1a3 /* AC Zoom Out */
+#define KEY_ZOOMRESET 0x1a4 /* AC Zoom */
+#define KEY_WORDPROCESSOR 0x1a5 /* AL Word Processor */
+#define KEY_EDITOR 0x1a6 /* AL Text Editor */
+#define KEY_SPREADSHEET 0x1a7 /* AL Spreadsheet */
+#define KEY_GRAPHICSEDITOR 0x1a8 /* AL Graphics Editor */
+#define KEY_PRESENTATION 0x1a9 /* AL Presentation App */
+#define KEY_DATABASE 0x1aa /* AL Database App */
+#define KEY_NEWS 0x1ab /* AL Newsreader */
+#define KEY_VOICEMAIL 0x1ac /* AL Voicemail */
+#define KEY_ADDRESSBOOK 0x1ad /* AL Contacts/Address Book */
+#define KEY_MESSENGER 0x1ae /* AL Instant Messaging */
+#define KEY_DISPLAYTOGGLE 0x1af /* Turn display (LCD) on and off */
+#define KEY_SPELLCHECK 0x1b0 /* AL Spell Check */
+#define KEY_LOGOFF 0x1b1 /* AL Logoff */
+
+#define KEY_DOLLAR 0x1b2
+#define KEY_EURO 0x1b3
+
+#define KEY_FRAMEBACK 0x1b4 /* Consumer - transport controls */
+#define KEY_FRAMEFORWARD 0x1b5
+
+#define KEY_CONTEXT_MENU 0x1b6 /* GenDesc - system context menu */
+
+#define KEY_DEL_EOL 0x1c0
+#define KEY_DEL_EOS 0x1c1
+#define KEY_INS_LINE 0x1c2
+#define KEY_DEL_LINE 0x1c3
+
+#define KEY_FN 0x1d0
+#define KEY_FN_ESC 0x1d1
+#define KEY_FN_F1 0x1d2
+#define KEY_FN_F2 0x1d3
+#define KEY_FN_F3 0x1d4
+#define KEY_FN_F4 0x1d5
+#define KEY_FN_F5 0x1d6
+#define KEY_FN_F6 0x1d7
+#define KEY_FN_F7 0x1d8
+#define KEY_FN_F8 0x1d9
+#define KEY_FN_F9 0x1da
+#define KEY_FN_F10 0x1db
+#define KEY_FN_F11 0x1dc
+#define KEY_FN_F12 0x1dd
+#define KEY_FN_1 0x1de
+#define KEY_FN_2 0x1df
+#define KEY_FN_D 0x1e0
+#define KEY_FN_E 0x1e1
+#define KEY_FN_F 0x1e2
+#define KEY_FN_S 0x1e3
+#define KEY_FN_B 0x1e4
+
+#define KEY_BRL_DOT1 0x1f1
+#define KEY_BRL_DOT2 0x1f2
+#define KEY_BRL_DOT3 0x1f3
+#define KEY_BRL_DOT4 0x1f4
+#define KEY_BRL_DOT5 0x1f5
+#define KEY_BRL_DOT6 0x1f6
+#define KEY_BRL_DOT7 0x1f7
+#define KEY_BRL_DOT8 0x1f8
+#define KEY_BRL_DOT9 0x1f9
+#define KEY_BRL_DOT10 0x1fa
+
+/* We avoid low common keys in module aliases so they don't get huge. */
+#define KEY_MIN_INTERESTING KEY_MUTE
+#define KEY_MAX 0x1ff
+#define KEY_CNT (KEY_MAX+1)
+
+/*
+ * Relative axes
+ */
+
+#define REL_X 0x00
+#define REL_Y 0x01
+#define REL_Z 0x02
+#define REL_RX 0x03
+#define REL_RY 0x04
+#define REL_RZ 0x05
+#define REL_HWHEEL 0x06
+#define REL_DIAL 0x07
+#define REL_WHEEL 0x08
+#define REL_MISC 0x09
+#define REL_MAX 0x0f
+#define REL_CNT (REL_MAX+1)
+
+/*
+ * Absolute axes
+ */
+
+#define ABS_X 0x00
+#define ABS_Y 0x01
+#define ABS_Z 0x02
+#define ABS_RX 0x03
+#define ABS_RY 0x04
+#define ABS_RZ 0x05
+#define ABS_THROTTLE 0x06
+#define ABS_RUDDER 0x07
+#define ABS_WHEEL 0x08
+#define ABS_GAS 0x09
+#define ABS_BRAKE 0x0a
+#define ABS_HAT0X 0x10
+#define ABS_HAT0Y 0x11
+#define ABS_HAT1X 0x12
+#define ABS_HAT1Y 0x13
+#define ABS_HAT2X 0x14
+#define ABS_HAT2Y 0x15
+#define ABS_HAT3X 0x16
+#define ABS_HAT3Y 0x17
+#define ABS_PRESSURE 0x18
+#define ABS_DISTANCE 0x19
+#define ABS_TILT_X 0x1a
+#define ABS_TILT_Y 0x1b
+#define ABS_TOOL_WIDTH 0x1c
+#define ABS_VOLUME 0x20
+#define ABS_MISC 0x28
+#define ABS_MAX 0x3f
+#define ABS_CNT (ABS_MAX+1)
+
+/*
+ * Switch events
+ */
+
+#define SW_LID 0x00 /* set = lid shut */
+#define SW_TABLET_MODE 0x01 /* set = tablet mode */
+#define SW_HEADPHONE_INSERT 0x02 /* set = inserted */
+#define SW_RADIO 0x03 /* set = radio enabled */
+#define SW_MAX 0x0f
+#define SW_CNT (SW_MAX+1)
+
+/*
+ * Misc events
+ */
+
+#define MSC_SERIAL 0x00
+#define MSC_PULSELED 0x01
+#define MSC_GESTURE 0x02
+#define MSC_RAW 0x03
+#define MSC_SCAN 0x04
+#define MSC_MAX 0x07
+#define MSC_CNT (MSC_MAX+1)
+
+/*
+ * LEDs
+ */
+
+#define LED_NUML 0x00
+#define LED_CAPSL 0x01
+#define LED_SCROLLL 0x02
+#define LED_COMPOSE 0x03
+#define LED_KANA 0x04
+#define LED_SLEEP 0x05
+#define LED_SUSPEND 0x06
+#define LED_MUTE 0x07
+#define LED_MISC 0x08
+#define LED_MAIL 0x09
+#define LED_CHARGING 0x0a
+#define LED_MAX 0x0f
+#define LED_CNT (LED_MAX+1)
+
+/*
+ * Autorepeat values
+ */
+
+#define REP_DELAY 0x00
+#define REP_PERIOD 0x01
+#define REP_MAX 0x01
+
+/*
+ * Sounds
+ */
+
+#define SND_CLICK 0x00
+#define SND_BELL 0x01
+#define SND_TONE 0x02
+#define SND_MAX 0x07
+#define SND_CNT (SND_MAX+1)
+
+/*
+ * IDs.
+ */
+
+#define ID_BUS 0
+#define ID_VENDOR 1
+#define ID_PRODUCT 2
+#define ID_VERSION 3
+
+#define BUS_PCI 0x01
+#define BUS_ISAPNP 0x02
+#define BUS_USB 0x03
+#define BUS_HIL 0x04
+#define BUS_BLUETOOTH 0x05
+#define BUS_VIRTUAL 0x06
+
+#define BUS_ISA 0x10
+#define BUS_I8042 0x11
+#define BUS_XTKBD 0x12
+#define BUS_RS232 0x13
+#define BUS_GAMEPORT 0x14
+#define BUS_PARPORT 0x15
+#define BUS_AMIGA 0x16
+#define BUS_ADB 0x17
+#define BUS_I2C 0x18
+#define BUS_HOST 0x19
+#define BUS_GSC 0x1A
+#define BUS_ATARI 0x1B
+
+/*
+ * Values describing the status of a force-feedback effect
+ */
+#define FF_STATUS_STOPPED 0x00
+#define FF_STATUS_PLAYING 0x01
+#define FF_STATUS_MAX 0x01
+
+/*
+ * Structures used in ioctls to upload effects to a device
+ * They are pieces of a bigger structure (called ff_effect)
+ */
+
+/*
+ * All duration values are expressed in ms. Values above 32767 ms (0x7fff)
+ * should not be used and have unspecified results.
+ */
+
+/**
+ * struct ff_replay - defines scheduling of the force-feedback effect
+ * @length: duration of the effect
+ * @delay: delay before effect should start playing
+ */
+struct ff_replay {
+ __u16 length;
+ __u16 delay;
+};
+
+/**
+ * struct ff_trigger - defines what triggers the force-feedback effect
+ * @button: number of the button triggering the effect
+ * @interval: controls how soon the effect can be re-triggered
+ */
+struct ff_trigger {
+ __u16 button;
+ __u16 interval;
+};
+
+/**
+ * struct ff_envelope - generic force-feedback effect envelope
+ * @attack_length: duration of the attack (ms)
+ * @attack_level: level at the beginning of the attack
+ * @fade_length: duration of fade (ms)
+ * @fade_level: level at the end of fade
+ *
+ * The @attack_level and @fade_level are absolute values; when applying
+ * envelope force-feedback core will convert to positive/negative
+ * value based on polarity of the default level of the effect.
+ * Valid range for the attack and fade levels is 0x0000 - 0x7fff
+ */
+struct ff_envelope {
+ __u16 attack_length;
+ __u16 attack_level;
+ __u16 fade_length;
+ __u16 fade_level;
+};
+
+/**
+ * struct ff_constant_effect - defines parameters of a constant force-feedback effect
+ * @level: strength of the effect; may be negative
+ * @envelope: envelope data
+ */
+struct ff_constant_effect {
+ __s16 level;
+ struct ff_envelope envelope;
+};
+
+/**
+ * struct ff_ramp_effect - defines parameters of a ramp force-feedback effect
+ * @start_level: beginning strength of the effect; may be negative
+ * @end_level: final strength of the effect; may be negative
+ * @envelope: envelope data
+ */
+struct ff_ramp_effect {
+ __s16 start_level;
+ __s16 end_level;
+ struct ff_envelope envelope;
+};
+
+/**
+ * struct ff_condition_effect - defines a spring or friction force-feedback effect
+ * @right_saturation: maximum level when joystick moved all way to the right
+ * @left_saturation: same for the left side
+ * @right_coeff: controls how fast the force grows when the joystick moves
+ * to the right
+ * @left_coeff: same for the left side
+ * @deadband: size of the dead zone, where no force is produced
+ * @center: position of the dead zone
+ */
+struct ff_condition_effect {
+ __u16 right_saturation;
+ __u16 left_saturation;
+
+ __s16 right_coeff;
+ __s16 left_coeff;
+
+ __u16 deadband;
+ __s16 center;
+};
+
+/**
+ * struct ff_periodic_effect - defines parameters of a periodic force-feedback effect
+ * @waveform: kind of the effect (wave)
+ * @period: period of the wave (ms)
+ * @magnitude: peak value
+ * @offset: mean value of the wave (roughly)
+ * @phase: 'horizontal' shift
+ * @envelope: envelope data
+ * @custom_len: number of samples (FF_CUSTOM only)
+ * @custom_data: buffer of samples (FF_CUSTOM only)
+ *
+ * Known waveforms - FF_SQUARE, FF_TRIANGLE, FF_SINE, FF_SAW_UP,
+ * FF_SAW_DOWN, FF_CUSTOM. The exact syntax FF_CUSTOM is undefined
+ * for the time being as no driver supports it yet.
+ *
+ * Note: the data pointed by custom_data is copied by the driver.
+ * You can therefore dispose of the memory after the upload/update.
+ */
+struct ff_periodic_effect {
+ __u16 waveform;
+ __u16 period;
+ __s16 magnitude;
+ __s16 offset;
+ __u16 phase;
+
+ struct ff_envelope envelope;
+
+ __u32 custom_len;
+ __s16 *custom_data;
+};
+
+/**
+ * struct ff_rumble_effect - defines parameters of a periodic force-feedback effect
+ * @strong_magnitude: magnitude of the heavy motor
+ * @weak_magnitude: magnitude of the light one
+ *
+ * Some rumble pads have two motors of different weight. Strong_magnitude
+ * represents the magnitude of the vibration generated by the heavy one.
+ */
+struct ff_rumble_effect {
+ __u16 strong_magnitude;
+ __u16 weak_magnitude;
+};
+
+/**
+ * struct ff_effect - defines force feedback effect
+ * @type: type of the effect (FF_CONSTANT, FF_PERIODIC, FF_RAMP, FF_SPRING,
+ * FF_FRICTION, FF_DAMPER, FF_RUMBLE, FF_INERTIA, or FF_CUSTOM)
+ * @id: an unique id assigned to an effect
+ * @direction: direction of the effect
+ * @trigger: trigger conditions (struct ff_trigger)
+ * @replay: scheduling of the effect (struct ff_replay)
+ * @u: effect-specific structure (one of ff_constant_effect, ff_ramp_effect,
+ * ff_periodic_effect, ff_condition_effect, ff_rumble_effect) further
+ * defining effect parameters
+ *
+ * This structure is sent through ioctl from the application to the driver.
+ * To create a new effect application should set its @id to -1; the kernel
+ * will return assigned @id which can later be used to update or delete
+ * this effect.
+ *
+ * Direction of the effect is encoded as follows:
+ * 0 deg -> 0x0000 (down)
+ * 90 deg -> 0x4000 (left)
+ * 180 deg -> 0x8000 (up)
+ * 270 deg -> 0xC000 (right)
+ */
+struct ff_effect {
+ __u16 type;
+ __s16 id;
+ __u16 direction;
+ struct ff_trigger trigger;
+ struct ff_replay replay;
+
+ union {
+ struct ff_constant_effect constant;
+ struct ff_ramp_effect ramp;
+ struct ff_periodic_effect periodic;
+ struct ff_condition_effect condition[2]; /* One for each axis */
+ struct ff_rumble_effect rumble;
+ } u;
+};
+
+/*
+ * Force feedback effect types
+ */
+
+#define FF_RUMBLE 0x50
+#define FF_PERIODIC 0x51
+#define FF_CONSTANT 0x52
+#define FF_SPRING 0x53
+#define FF_FRICTION 0x54
+#define FF_DAMPER 0x55
+#define FF_INERTIA 0x56
+#define FF_RAMP 0x57
+
+#define FF_EFFECT_MIN FF_RUMBLE
+#define FF_EFFECT_MAX FF_RAMP
+
+/*
+ * Force feedback periodic effect types
+ */
+
+#define FF_SQUARE 0x58
+#define FF_TRIANGLE 0x59
+#define FF_SINE 0x5a
+#define FF_SAW_UP 0x5b
+#define FF_SAW_DOWN 0x5c
+#define FF_CUSTOM 0x5d
+
+#define FF_WAVEFORM_MIN FF_SQUARE
+#define FF_WAVEFORM_MAX FF_CUSTOM
+
+/*
+ * Set ff device properties
+ */
+
+#define FF_GAIN 0x60
+#define FF_AUTOCENTER 0x61
+
+#define FF_MAX 0x7f
+#define FF_CNT (FF_MAX+1)
+
+#endif
diff --git a/sysroot/usr/include/linux/ioctl.h b/sysroot/usr/include/linux/ioctl.h
new file mode 100644
index 0000000..aa91eb3
--- /dev/null
+++ b/sysroot/usr/include/linux/ioctl.h
@@ -0,0 +1,7 @@
+#ifndef _LINUX_IOCTL_H
+#define _LINUX_IOCTL_H
+
+#include <asm/ioctl.h>
+
+#endif /* _LINUX_IOCTL_H */
+
diff --git a/sysroot/usr/include/linux/ip.h b/sysroot/usr/include/linux/ip.h
new file mode 100644
index 0000000..56f472a
--- /dev/null
+++ b/sysroot/usr/include/linux/ip.h
@@ -0,0 +1,136 @@
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Definitions for the IP protocol.
+ *
+ * Version: @(#)ip.h 1.0.2 04/28/93
+ *
+ * Authors: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#ifndef _LINUX_IP_H
+#define _LINUX_IP_H
+#include <linux/types.h>
+#include <asm/byteorder.h>
+
+#define IPTOS_TOS_MASK 0x1E
+#define IPTOS_TOS(tos) ((tos)&IPTOS_TOS_MASK)
+#define IPTOS_LOWDELAY 0x10
+#define IPTOS_THROUGHPUT 0x08
+#define IPTOS_RELIABILITY 0x04
+#define IPTOS_MINCOST 0x02
+
+#define IPTOS_PREC_MASK 0xE0
+#define IPTOS_PREC(tos) ((tos)&IPTOS_PREC_MASK)
+#define IPTOS_PREC_NETCONTROL 0xe0
+#define IPTOS_PREC_INTERNETCONTROL 0xc0
+#define IPTOS_PREC_CRITIC_ECP 0xa0
+#define IPTOS_PREC_FLASHOVERRIDE 0x80
+#define IPTOS_PREC_FLASH 0x60
+#define IPTOS_PREC_IMMEDIATE 0x40
+#define IPTOS_PREC_PRIORITY 0x20
+#define IPTOS_PREC_ROUTINE 0x00
+
+
+/* IP options */
+#define IPOPT_COPY 0x80
+#define IPOPT_CLASS_MASK 0x60
+#define IPOPT_NUMBER_MASK 0x1f
+
+#define IPOPT_COPIED(o) ((o)&IPOPT_COPY)
+#define IPOPT_CLASS(o) ((o)&IPOPT_CLASS_MASK)
+#define IPOPT_NUMBER(o) ((o)&IPOPT_NUMBER_MASK)
+
+#define IPOPT_CONTROL 0x00
+#define IPOPT_RESERVED1 0x20
+#define IPOPT_MEASUREMENT 0x40
+#define IPOPT_RESERVED2 0x60
+
+#define IPOPT_END (0 |IPOPT_CONTROL)
+#define IPOPT_NOOP (1 |IPOPT_CONTROL)
+#define IPOPT_SEC (2 |IPOPT_CONTROL|IPOPT_COPY)
+#define IPOPT_LSRR (3 |IPOPT_CONTROL|IPOPT_COPY)
+#define IPOPT_TIMESTAMP (4 |IPOPT_MEASUREMENT)
+#define IPOPT_CIPSO (6 |IPOPT_CONTROL|IPOPT_COPY)
+#define IPOPT_RR (7 |IPOPT_CONTROL)
+#define IPOPT_SID (8 |IPOPT_CONTROL|IPOPT_COPY)
+#define IPOPT_SSRR (9 |IPOPT_CONTROL|IPOPT_COPY)
+#define IPOPT_RA (20|IPOPT_CONTROL|IPOPT_COPY)
+
+#define IPVERSION 4
+#define MAXTTL 255
+#define IPDEFTTL 64
+
+#define IPOPT_OPTVAL 0
+#define IPOPT_OLEN 1
+#define IPOPT_OFFSET 2
+#define IPOPT_MINOFF 4
+#define MAX_IPOPTLEN 40
+#define IPOPT_NOP IPOPT_NOOP
+#define IPOPT_EOL IPOPT_END
+#define IPOPT_TS IPOPT_TIMESTAMP
+
+#define IPOPT_TS_TSONLY 0 /* timestamps only */
+#define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */
+#define IPOPT_TS_PRESPEC 3 /* specified modules only */
+
+#define IPV4_BEET_PHMAXLEN 8
+
+struct iphdr {
+#if defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 ihl:4,
+ version:4;
+#elif defined (__BIG_ENDIAN_BITFIELD)
+ __u8 version:4,
+ ihl:4;
+#else
+#error "Please fix <asm/byteorder.h>"
+#endif
+ __u8 tos;
+ __be16 tot_len;
+ __be16 id;
+ __be16 frag_off;
+ __u8 ttl;
+ __u8 protocol;
+ __sum16 check;
+ __be32 saddr;
+ __be32 daddr;
+ /*The options start here. */
+};
+
+
+struct ip_auth_hdr {
+ __u8 nexthdr;
+ __u8 hdrlen; /* This one is measured in 32 bit units! */
+ __be16 reserved;
+ __be32 spi;
+ __be32 seq_no; /* Sequence number */
+ __u8 auth_data[0]; /* Variable len but >=4. Mind the 64 bit alignment! */
+};
+
+struct ip_esp_hdr {
+ __be32 spi;
+ __be32 seq_no; /* Sequence number */
+ __u8 enc_data[0]; /* Variable len but >=8. Mind the 64 bit alignment! */
+};
+
+struct ip_comp_hdr {
+ __u8 nexthdr;
+ __u8 flags;
+ __be16 cpi;
+};
+
+struct ip_beet_phdr {
+ __u8 nexthdr;
+ __u8 hdrlen;
+ __u8 padlen;
+ __u8 reserved;
+};
+
+#endif /* _LINUX_IP_H */
diff --git a/sysroot/usr/include/linux/ip6_tunnel.h b/sysroot/usr/include/linux/ip6_tunnel.h
new file mode 100644
index 0000000..af3f4a7
--- /dev/null
+++ b/sysroot/usr/include/linux/ip6_tunnel.h
@@ -0,0 +1,34 @@
+/*
+ * $Id$
+ */
+
+#ifndef _IP6_TUNNEL_H
+#define _IP6_TUNNEL_H
+
+#define IPV6_TLV_TNL_ENCAP_LIMIT 4
+#define IPV6_DEFAULT_TNL_ENCAP_LIMIT 4
+
+/* don't add encapsulation limit if one isn't present in inner packet */
+#define IP6_TNL_F_IGN_ENCAP_LIMIT 0x1
+/* copy the traffic class field from the inner packet */
+#define IP6_TNL_F_USE_ORIG_TCLASS 0x2
+/* copy the flowlabel from the inner packet */
+#define IP6_TNL_F_USE_ORIG_FLOWLABEL 0x4
+/* being used for Mobile IPv6 */
+#define IP6_TNL_F_MIP6_DEV 0x8
+/* copy DSCP from the outer packet */
+#define IP6_TNL_F_RCV_DSCP_COPY 0x10
+
+struct ip6_tnl_parm {
+ char name[IFNAMSIZ]; /* name of tunnel device */
+ int link; /* ifindex of underlying L2 interface */
+ __u8 proto; /* tunnel protocol */
+ __u8 encap_limit; /* encapsulation limit for tunnel */
+ __u8 hop_limit; /* hop limit for tunnel */
+ __be32 flowinfo; /* traffic class and flowlabel for tunnel */
+ __u32 flags; /* tunnel flags */
+ struct in6_addr laddr; /* local tunnel end-point address */
+ struct in6_addr raddr; /* remote tunnel end-point address */
+};
+
+#endif
diff --git a/sysroot/usr/include/linux/ipc.h b/sysroot/usr/include/linux/ipc.h
new file mode 100644
index 0000000..98a53a1
--- /dev/null
+++ b/sysroot/usr/include/linux/ipc.h
@@ -0,0 +1,81 @@
+#ifndef _LINUX_IPC_H
+#define _LINUX_IPC_H
+
+#include <linux/types.h>
+
+#define IPC_PRIVATE ((__kernel_key_t) 0)
+
+/* Obsolete, used only for backwards compatibility and libc5 compiles */
+struct ipc_perm
+{
+ __kernel_key_t key;
+ __kernel_uid_t uid;
+ __kernel_gid_t gid;
+ __kernel_uid_t cuid;
+ __kernel_gid_t cgid;
+ __kernel_mode_t mode;
+ unsigned short seq;
+};
+
+/* Include the definition of ipc64_perm */
+#include <asm/ipcbuf.h>
+
+/* resource get request flags */
+#define IPC_CREAT 00001000 /* create if key is nonexistent */
+#define IPC_EXCL 00002000 /* fail if key exists */
+#define IPC_NOWAIT 00004000 /* return error on wait */
+
+/* these fields are used by the DIPC package so the kernel as standard
+ should avoid using them if possible */
+
+#define IPC_DIPC 00010000 /* make it distributed */
+#define IPC_OWN 00020000 /* this machine is the DIPC owner */
+
+/*
+ * Control commands used with semctl, msgctl and shmctl
+ * see also specific commands in sem.h, msg.h and shm.h
+ */
+#define IPC_RMID 0 /* remove resource */
+#define IPC_SET 1 /* set ipc_perm options */
+#define IPC_STAT 2 /* get ipc_perm options */
+#define IPC_INFO 3 /* see ipcs */
+
+/*
+ * Version flags for semctl, msgctl, and shmctl commands
+ * These are passed as bitflags or-ed with the actual command
+ */
+#define IPC_OLD 0 /* Old version (no 32-bit UID support on many
+ architectures) */
+#define IPC_64 0x0100 /* New version (support 32-bit UIDs, bigger
+ message sizes, etc. */
+
+/*
+ * These are used to wrap system calls.
+ *
+ * See architecture code for ugly details..
+ */
+struct ipc_kludge {
+ struct msgbuf *msgp;
+ long msgtyp;
+};
+
+#define SEMOP 1
+#define SEMGET 2
+#define SEMCTL 3
+#define SEMTIMEDOP 4
+#define MSGSND 11
+#define MSGRCV 12
+#define MSGGET 13
+#define MSGCTL 14
+#define SHMAT 21
+#define SHMDT 22
+#define SHMGET 23
+#define SHMCTL 24
+
+/* Used by the DIPC package, try and avoid reusing it */
+#define DIPC 25
+
+#define IPCCALL(version,op) ((version)<<16 | (op))
+
+
+#endif /* _LINUX_IPC_H */
diff --git a/sysroot/usr/include/linux/ipmi.h b/sysroot/usr/include/linux/ipmi.h
new file mode 100644
index 0000000..8fa795b
--- /dev/null
+++ b/sysroot/usr/include/linux/ipmi.h
@@ -0,0 +1,462 @@
+/*
+ * ipmi.h
+ *
+ * MontaVista IPMI interface
+ *
+ * Author: MontaVista Software, Inc.
+ * Corey Minyard <minyard@mvista.com>
+ * source@mvista.com
+ *
+ * Copyright 2002 MontaVista Software Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __LINUX_IPMI_H
+#define __LINUX_IPMI_H
+
+#include <linux/ipmi_msgdefs.h>
+
+/*
+ * This file describes an interface to an IPMI driver. You have to
+ * have a fairly good understanding of IPMI to use this, so go read
+ * the specs first before actually trying to do anything.
+ *
+ * With that said, this driver provides a multi-user interface to the
+ * IPMI driver, and it allows multiple IPMI physical interfaces below
+ * the driver. The physical interfaces bind as a lower layer on the
+ * driver. They appear as interfaces to the application using this
+ * interface.
+ *
+ * Multi-user means that multiple applications may use the driver,
+ * send commands, receive responses, etc. The driver keeps track of
+ * commands the user sends and tracks the responses. The responses
+ * will go back to the application that send the command. If the
+ * response doesn't come back in time, the driver will return a
+ * timeout error response to the application. Asynchronous events
+ * from the BMC event queue will go to all users bound to the driver.
+ * The incoming event queue in the BMC will automatically be flushed
+ * if it becomes full and it is queried once a second to see if
+ * anything is in it. Incoming commands to the driver will get
+ * delivered as commands.
+ *
+ * This driver provides two main interfaces: one for in-kernel
+ * applications and another for userland applications. The
+ * capabilities are basically the same for both interface, although
+ * the interfaces are somewhat different. The stuff in the
+ * #ifdef KERNEL below is the in-kernel interface. The userland
+ * interface is defined later in the file. */
+
+
+
+/*
+ * This is an overlay for all the address types, so it's easy to
+ * determine the actual address type. This is kind of like addresses
+ * work for sockets.
+ */
+#define IPMI_MAX_ADDR_SIZE 32
+struct ipmi_addr
+{
+ /* Try to take these from the "Channel Medium Type" table
+ in section 6.5 of the IPMI 1.5 manual. */
+ int addr_type;
+ short channel;
+ char data[IPMI_MAX_ADDR_SIZE];
+};
+
+/*
+ * When the address is not used, the type will be set to this value.
+ * The channel is the BMC's channel number for the channel (usually
+ * 0), or IPMC_BMC_CHANNEL if communicating directly with the BMC.
+ */
+#define IPMI_SYSTEM_INTERFACE_ADDR_TYPE 0x0c
+struct ipmi_system_interface_addr
+{
+ int addr_type;
+ short channel;
+ unsigned char lun;
+};
+
+/* An IPMB Address. */
+#define IPMI_IPMB_ADDR_TYPE 0x01
+/* Used for broadcast get device id as described in section 17.9 of the
+ IPMI 1.5 manual. */
+#define IPMI_IPMB_BROADCAST_ADDR_TYPE 0x41
+struct ipmi_ipmb_addr
+{
+ int addr_type;
+ short channel;
+ unsigned char slave_addr;
+ unsigned char lun;
+};
+
+/*
+ * A LAN Address. This is an address to/from a LAN interface bridged
+ * by the BMC, not an address actually out on the LAN.
+ *
+ * A concious decision was made here to deviate slightly from the IPMI
+ * spec. We do not use rqSWID and rsSWID like it shows in the
+ * message. Instead, we use remote_SWID and local_SWID. This means
+ * that any message (a request or response) from another device will
+ * always have exactly the same address. If you didn't do this,
+ * requests and responses from the same device would have different
+ * addresses, and that's not too cool.
+ *
+ * In this address, the remote_SWID is always the SWID the remote
+ * message came from, or the SWID we are sending the message to.
+ * local_SWID is always our SWID. Note that having our SWID in the
+ * message is a little weird, but this is required.
+ */
+#define IPMI_LAN_ADDR_TYPE 0x04
+struct ipmi_lan_addr
+{
+ int addr_type;
+ short channel;
+ unsigned char privilege;
+ unsigned char session_handle;
+ unsigned char remote_SWID;
+ unsigned char local_SWID;
+ unsigned char lun;
+};
+
+
+/*
+ * Channel for talking directly with the BMC. When using this
+ * channel, This is for the system interface address type only. FIXME
+ * - is this right, or should we use -1?
+ */
+#define IPMI_BMC_CHANNEL 0xf
+#define IPMI_NUM_CHANNELS 0x10
+
+/*
+ * Used to signify an "all channel" bitmask. This is more than the
+ * actual number of channels because this is used in userland and
+ * will cover us if the number of channels is extended.
+ */
+#define IPMI_CHAN_ALL (~0)
+
+
+/*
+ * A raw IPMI message without any addressing. This covers both
+ * commands and responses. The completion code is always the first
+ * byte of data in the response (as the spec shows the messages laid
+ * out).
+ */
+struct ipmi_msg
+{
+ unsigned char netfn;
+ unsigned char cmd;
+ unsigned short data_len;
+ unsigned char *data;
+};
+
+struct kernel_ipmi_msg
+{
+ unsigned char netfn;
+ unsigned char cmd;
+ unsigned short data_len;
+ unsigned char *data;
+};
+
+/*
+ * Various defines that are useful for IPMI applications.
+ */
+#define IPMI_INVALID_CMD_COMPLETION_CODE 0xC1
+#define IPMI_TIMEOUT_COMPLETION_CODE 0xC3
+#define IPMI_UNKNOWN_ERR_COMPLETION_CODE 0xff
+
+
+/*
+ * Receive types for messages coming from the receive interface. This
+ * is used for the receive in-kernel interface and in the receive
+ * IOCTL.
+ *
+ * The "IPMI_RESPONSE_RESPNOSE_TYPE" is a little strange sounding, but
+ * it allows you to get the message results when you send a response
+ * message.
+ */
+#define IPMI_RESPONSE_RECV_TYPE 1 /* A response to a command */
+#define IPMI_ASYNC_EVENT_RECV_TYPE 2 /* Something from the event queue */
+#define IPMI_CMD_RECV_TYPE 3 /* A command from somewhere else */
+#define IPMI_RESPONSE_RESPONSE_TYPE 4 /* The response for
+ a sent response, giving any
+ error status for sending the
+ response. When you send a
+ response message, this will
+ be returned. */
+/* Note that async events and received commands do not have a completion
+ code as the first byte of the incoming data, unlike a response. */
+
+
+/*
+ * Modes for ipmi_set_maint_mode() and the userland IOCTL. The AUTO
+ * setting is the default and means it will be set on certain
+ * commands. Hard setting it on and off will override automatic
+ * operation.
+ */
+#define IPMI_MAINTENANCE_MODE_AUTO 0
+#define IPMI_MAINTENANCE_MODE_OFF 1
+#define IPMI_MAINTENANCE_MODE_ON 2
+
+
+
+/*
+ * The userland interface
+ */
+
+/*
+ * The userland interface for the IPMI driver is a standard character
+ * device, with each instance of an interface registered as a minor
+ * number under the major character device.
+ *
+ * The read and write calls do not work, to get messages in and out
+ * requires ioctl calls because of the complexity of the data. select
+ * and poll do work, so you can wait for input using the file
+ * descriptor, you just can use read to get it.
+ *
+ * In general, you send a command down to the interface and receive
+ * responses back. You can use the msgid value to correlate commands
+ * and responses, the driver will take care of figuring out which
+ * incoming messages are for which command and find the proper msgid
+ * value to report. You will only receive reponses for commands you
+ * send. Asynchronous events, however, go to all open users, so you
+ * must be ready to handle these (or ignore them if you don't care).
+ *
+ * The address type depends upon the channel type. When talking
+ * directly to the BMC (IPMC_BMC_CHANNEL), the address is ignored
+ * (IPMI_UNUSED_ADDR_TYPE). When talking to an IPMB channel, you must
+ * supply a valid IPMB address with the addr_type set properly.
+ *
+ * When talking to normal channels, the driver takes care of the
+ * details of formatting and sending messages on that channel. You do
+ * not, for instance, have to format a send command, you just send
+ * whatever command you want to the channel, the driver will create
+ * the send command, automatically issue receive command and get even
+ * commands, and pass those up to the proper user.
+ */
+
+
+/* The magic IOCTL value for this interface. */
+#define IPMI_IOC_MAGIC 'i'
+
+
+/* Messages sent to the interface are this format. */
+struct ipmi_req
+{
+ unsigned char *addr; /* Address to send the message to. */
+ unsigned int addr_len;
+
+ long msgid; /* The sequence number for the message. This
+ exact value will be reported back in the
+ response to this request if it is a command.
+ If it is a response, this will be used as
+ the sequence value for the response. */
+
+ struct ipmi_msg msg;
+};
+/*
+ * Send a message to the interfaces. error values are:
+ * - EFAULT - an address supplied was invalid.
+ * - EINVAL - The address supplied was not valid, or the command
+ * was not allowed.
+ * - EMSGSIZE - The message to was too large.
+ * - ENOMEM - Buffers could not be allocated for the command.
+ */
+#define IPMICTL_SEND_COMMAND _IOR(IPMI_IOC_MAGIC, 13, \
+ struct ipmi_req)
+
+/* Messages sent to the interface with timing parameters are this
+ format. */
+struct ipmi_req_settime
+{
+ struct ipmi_req req;
+
+ /* See ipmi_request_settime() above for details on these
+ values. */
+ int retries;
+ unsigned int retry_time_ms;
+};
+/*
+ * Send a message to the interfaces with timing parameters. error values
+ * are:
+ * - EFAULT - an address supplied was invalid.
+ * - EINVAL - The address supplied was not valid, or the command
+ * was not allowed.
+ * - EMSGSIZE - The message to was too large.
+ * - ENOMEM - Buffers could not be allocated for the command.
+ */
+#define IPMICTL_SEND_COMMAND_SETTIME _IOR(IPMI_IOC_MAGIC, 21, \
+ struct ipmi_req_settime)
+
+/* Messages received from the interface are this format. */
+struct ipmi_recv
+{
+ int recv_type; /* Is this a command, response or an
+ asyncronous event. */
+
+ unsigned char *addr; /* Address the message was from is put
+ here. The caller must supply the
+ memory. */
+ unsigned int addr_len; /* The size of the address buffer.
+ The caller supplies the full buffer
+ length, this value is updated to
+ the actual message length when the
+ message is received. */
+
+ long msgid; /* The sequence number specified in the request
+ if this is a response. If this is a command,
+ this will be the sequence number from the
+ command. */
+
+ struct ipmi_msg msg; /* The data field must point to a buffer.
+ The data_size field must be set to the
+ size of the message buffer. The
+ caller supplies the full buffer
+ length, this value is updated to the
+ actual message length when the message
+ is received. */
+};
+
+/*
+ * Receive a message. error values:
+ * - EAGAIN - no messages in the queue.
+ * - EFAULT - an address supplied was invalid.
+ * - EINVAL - The address supplied was not valid.
+ * - EMSGSIZE - The message to was too large to fit into the message buffer,
+ * the message will be left in the buffer. */
+#define IPMICTL_RECEIVE_MSG _IOWR(IPMI_IOC_MAGIC, 12, \
+ struct ipmi_recv)
+
+/*
+ * Like RECEIVE_MSG, but if the message won't fit in the buffer, it
+ * will truncate the contents instead of leaving the data in the
+ * buffer.
+ */
+#define IPMICTL_RECEIVE_MSG_TRUNC _IOWR(IPMI_IOC_MAGIC, 11, \
+ struct ipmi_recv)
+
+/* Register to get commands from other entities on this interface. */
+struct ipmi_cmdspec
+{
+ unsigned char netfn;
+ unsigned char cmd;
+};
+
+/*
+ * Register to receive a specific command. error values:
+ * - EFAULT - an address supplied was invalid.
+ * - EBUSY - The netfn/cmd supplied was already in use.
+ * - ENOMEM - could not allocate memory for the entry.
+ */
+#define IPMICTL_REGISTER_FOR_CMD _IOR(IPMI_IOC_MAGIC, 14, \
+ struct ipmi_cmdspec)
+/*
+ * Unregister a regsitered command. error values:
+ * - EFAULT - an address supplied was invalid.
+ * - ENOENT - The netfn/cmd was not found registered for this user.
+ */
+#define IPMICTL_UNREGISTER_FOR_CMD _IOR(IPMI_IOC_MAGIC, 15, \
+ struct ipmi_cmdspec)
+
+/*
+ * Register to get commands from other entities on specific channels.
+ * This way, you can only listen on specific channels, or have messages
+ * from some channels go to one place and other channels to someplace
+ * else. The chans field is a bitmask, (1 << channel) for each channel.
+ * It may be IPMI_CHAN_ALL for all channels.
+ */
+struct ipmi_cmdspec_chans
+{
+ unsigned int netfn;
+ unsigned int cmd;
+ unsigned int chans;
+};
+
+/*
+ * Register to receive a specific command on specific channels. error values:
+ * - EFAULT - an address supplied was invalid.
+ * - EBUSY - One of the netfn/cmd/chans supplied was already in use.
+ * - ENOMEM - could not allocate memory for the entry.
+ */
+#define IPMICTL_REGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 28, \
+ struct ipmi_cmdspec_chans)
+/*
+ * Unregister some netfn/cmd/chans. error values:
+ * - EFAULT - an address supplied was invalid.
+ * - ENOENT - None of the netfn/cmd/chans were found registered for this user.
+ */
+#define IPMICTL_UNREGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 29, \
+ struct ipmi_cmdspec_chans)
+
+/*
+ * Set whether this interface receives events. Note that the first
+ * user registered for events will get all pending events for the
+ * interface. error values:
+ * - EFAULT - an address supplied was invalid.
+ */
+#define IPMICTL_SET_GETS_EVENTS_CMD _IOR(IPMI_IOC_MAGIC, 16, int)
+
+/*
+ * Set and get the slave address and LUN that we will use for our
+ * source messages. Note that this affects the interface, not just
+ * this user, so it will affect all users of this interface. This is
+ * so some initialization code can come in and do the OEM-specific
+ * things it takes to determine your address (if not the BMC) and set
+ * it for everyone else. You should probably leave the LUN alone.
+ */
+struct ipmi_channel_lun_address_set
+{
+ unsigned short channel;
+ unsigned char value;
+};
+#define IPMICTL_SET_MY_CHANNEL_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 24, struct ipmi_channel_lun_address_set)
+#define IPMICTL_GET_MY_CHANNEL_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 25, struct ipmi_channel_lun_address_set)
+#define IPMICTL_SET_MY_CHANNEL_LUN_CMD _IOR(IPMI_IOC_MAGIC, 26, struct ipmi_channel_lun_address_set)
+#define IPMICTL_GET_MY_CHANNEL_LUN_CMD _IOR(IPMI_IOC_MAGIC, 27, struct ipmi_channel_lun_address_set)
+/* Legacy interfaces, these only set IPMB 0. */
+#define IPMICTL_SET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 17, unsigned int)
+#define IPMICTL_GET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 18, unsigned int)
+#define IPMICTL_SET_MY_LUN_CMD _IOR(IPMI_IOC_MAGIC, 19, unsigned int)
+#define IPMICTL_GET_MY_LUN_CMD _IOR(IPMI_IOC_MAGIC, 20, unsigned int)
+
+/*
+ * Get/set the default timing values for an interface. You shouldn't
+ * generally mess with these.
+ */
+struct ipmi_timing_parms
+{
+ int retries;
+ unsigned int retry_time_ms;
+};
+#define IPMICTL_SET_TIMING_PARMS_CMD _IOR(IPMI_IOC_MAGIC, 22, \
+ struct ipmi_timing_parms)
+#define IPMICTL_GET_TIMING_PARMS_CMD _IOR(IPMI_IOC_MAGIC, 23, \
+ struct ipmi_timing_parms)
+
+/*
+ * Set the maintenance mode. See ipmi_set_maintenance_mode() above
+ * for a description of what this does.
+ */
+#define IPMICTL_GET_MAINTENANCE_MODE_CMD _IOR(IPMI_IOC_MAGIC, 30, int)
+#define IPMICTL_SET_MAINTENANCE_MODE_CMD _IOW(IPMI_IOC_MAGIC, 31, int)
+
+#endif /* __LINUX_IPMI_H */
diff --git a/sysroot/usr/include/linux/ipmi_msgdefs.h b/sysroot/usr/include/linux/ipmi_msgdefs.h
new file mode 100644
index 0000000..b56a158
--- /dev/null
+++ b/sysroot/usr/include/linux/ipmi_msgdefs.h
@@ -0,0 +1,113 @@
+/*
+ * ipmi_smi.h
+ *
+ * MontaVista IPMI system management interface
+ *
+ * Author: MontaVista Software, Inc.
+ * Corey Minyard <minyard@mvista.com>
+ * source@mvista.com
+ *
+ * Copyright 2002 MontaVista Software Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __LINUX_IPMI_MSGDEFS_H
+#define __LINUX_IPMI_MSGDEFS_H
+
+/* Various definitions for IPMI messages used by almost everything in
+ the IPMI stack. */
+
+/* NetFNs and commands used inside the IPMI stack. */
+
+#define IPMI_NETFN_SENSOR_EVENT_REQUEST 0x04
+#define IPMI_NETFN_SENSOR_EVENT_RESPONSE 0x05
+#define IPMI_GET_EVENT_RECEIVER_CMD 0x01
+
+#define IPMI_NETFN_APP_REQUEST 0x06
+#define IPMI_NETFN_APP_RESPONSE 0x07
+#define IPMI_GET_DEVICE_ID_CMD 0x01
+#define IPMI_COLD_RESET_CMD 0x02
+#define IPMI_WARM_RESET_CMD 0x03
+#define IPMI_CLEAR_MSG_FLAGS_CMD 0x30
+#define IPMI_GET_DEVICE_GUID_CMD 0x08
+#define IPMI_GET_MSG_FLAGS_CMD 0x31
+#define IPMI_SEND_MSG_CMD 0x34
+#define IPMI_GET_MSG_CMD 0x33
+#define IPMI_SET_BMC_GLOBAL_ENABLES_CMD 0x2e
+#define IPMI_GET_BMC_GLOBAL_ENABLES_CMD 0x2f
+#define IPMI_READ_EVENT_MSG_BUFFER_CMD 0x35
+#define IPMI_GET_CHANNEL_INFO_CMD 0x42
+
+#define IPMI_NETFN_STORAGE_REQUEST 0x0a
+#define IPMI_NETFN_STORAGE_RESPONSE 0x0b
+#define IPMI_ADD_SEL_ENTRY_CMD 0x44
+
+#define IPMI_NETFN_FIRMWARE_REQUEST 0x08
+#define IPMI_NETFN_FIRMWARE_RESPONSE 0x09
+
+/* The default slave address */
+#define IPMI_BMC_SLAVE_ADDR 0x20
+
+/* The BT interface on high-end HP systems supports up to 255 bytes in
+ * one transfer. Its "virtual" BMC supports some commands that are longer
+ * than 128 bytes. Use the full 256, plus NetFn/LUN, Cmd, cCode, plus
+ * some overhead; it's not worth the effort to dynamically size this based
+ * on the results of the "Get BT Capabilities" command. */
+#define IPMI_MAX_MSG_LENGTH 272 /* multiple of 16 */
+
+#define IPMI_CC_NO_ERROR 0x00
+#define IPMI_NODE_BUSY_ERR 0xc0
+#define IPMI_INVALID_COMMAND_ERR 0xc1
+#define IPMI_TIMEOUT_ERR 0xc3
+#define IPMI_ERR_MSG_TRUNCATED 0xc6
+#define IPMI_REQ_LEN_INVALID_ERR 0xc7
+#define IPMI_REQ_LEN_EXCEEDED_ERR 0xc8
+#define IPMI_NOT_IN_MY_STATE_ERR 0xd5 /* IPMI 2.0 */
+#define IPMI_LOST_ARBITRATION_ERR 0x81
+#define IPMI_BUS_ERR 0x82
+#define IPMI_NAK_ON_WRITE_ERR 0x83
+#define IPMI_ERR_UNSPECIFIED 0xff
+
+#define IPMI_CHANNEL_PROTOCOL_IPMB 1
+#define IPMI_CHANNEL_PROTOCOL_ICMB 2
+#define IPMI_CHANNEL_PROTOCOL_SMBUS 4
+#define IPMI_CHANNEL_PROTOCOL_KCS 5
+#define IPMI_CHANNEL_PROTOCOL_SMIC 6
+#define IPMI_CHANNEL_PROTOCOL_BT10 7
+#define IPMI_CHANNEL_PROTOCOL_BT15 8
+#define IPMI_CHANNEL_PROTOCOL_TMODE 9
+
+#define IPMI_CHANNEL_MEDIUM_IPMB 1
+#define IPMI_CHANNEL_MEDIUM_ICMB10 2
+#define IPMI_CHANNEL_MEDIUM_ICMB09 3
+#define IPMI_CHANNEL_MEDIUM_8023LAN 4
+#define IPMI_CHANNEL_MEDIUM_ASYNC 5
+#define IPMI_CHANNEL_MEDIUM_OTHER_LAN 6
+#define IPMI_CHANNEL_MEDIUM_PCI_SMBUS 7
+#define IPMI_CHANNEL_MEDIUM_SMBUS1 8
+#define IPMI_CHANNEL_MEDIUM_SMBUS2 9
+#define IPMI_CHANNEL_MEDIUM_USB1 10
+#define IPMI_CHANNEL_MEDIUM_USB2 11
+#define IPMI_CHANNEL_MEDIUM_SYSINTF 12
+
+#endif /* __LINUX_IPMI_MSGDEFS_H */
diff --git a/sysroot/usr/include/linux/ipsec.h b/sysroot/usr/include/linux/ipsec.h
new file mode 100644
index 0000000..d17a630
--- /dev/null
+++ b/sysroot/usr/include/linux/ipsec.h
@@ -0,0 +1,47 @@
+#ifndef _LINUX_IPSEC_H
+#define _LINUX_IPSEC_H
+
+/* The definitions, required to talk to KAME racoon IKE. */
+
+#include <linux/pfkeyv2.h>
+
+#define IPSEC_PORT_ANY 0
+#define IPSEC_ULPROTO_ANY 255
+#define IPSEC_PROTO_ANY 255
+
+enum {
+ IPSEC_MODE_ANY = 0, /* We do not support this for SA */
+ IPSEC_MODE_TRANSPORT = 1,
+ IPSEC_MODE_TUNNEL = 2,
+ IPSEC_MODE_BEET = 3
+};
+
+enum {
+ IPSEC_DIR_ANY = 0,
+ IPSEC_DIR_INBOUND = 1,
+ IPSEC_DIR_OUTBOUND = 2,
+ IPSEC_DIR_FWD = 3, /* It is our own */
+ IPSEC_DIR_MAX = 4,
+ IPSEC_DIR_INVALID = 5
+};
+
+enum {
+ IPSEC_POLICY_DISCARD = 0,
+ IPSEC_POLICY_NONE = 1,
+ IPSEC_POLICY_IPSEC = 2,
+ IPSEC_POLICY_ENTRUST = 3,
+ IPSEC_POLICY_BYPASS = 4
+};
+
+enum {
+ IPSEC_LEVEL_DEFAULT = 0,
+ IPSEC_LEVEL_USE = 1,
+ IPSEC_LEVEL_REQUIRE = 2,
+ IPSEC_LEVEL_UNIQUE = 3
+};
+
+#define IPSEC_MANUAL_REQID_MAX 0x3fff
+
+#define IPSEC_REPLAYWSIZE 32
+
+#endif /* _LINUX_IPSEC_H */
diff --git a/sysroot/usr/include/linux/ipv6.h b/sysroot/usr/include/linux/ipv6.h
new file mode 100644
index 0000000..b17ebaf
--- /dev/null
+++ b/sysroot/usr/include/linux/ipv6.h
@@ -0,0 +1,194 @@
+#ifndef _IPV6_H
+#define _IPV6_H
+
+#include <linux/in6.h>
+#include <asm/byteorder.h>
+
+/* The latest drafts declared increase in minimal mtu up to 1280. */
+
+#define IPV6_MIN_MTU 1280
+
+/*
+ * Advanced API
+ * source interface/address selection, source routing, etc...
+ * *under construction*
+ */
+
+
+struct in6_pktinfo {
+ struct in6_addr ipi6_addr;
+ int ipi6_ifindex;
+};
+
+
+struct in6_ifreq {
+ struct in6_addr ifr6_addr;
+ __u32 ifr6_prefixlen;
+ int ifr6_ifindex;
+};
+
+#define IPV6_SRCRT_STRICT 0x01 /* Deprecated; will be removed */
+#define IPV6_SRCRT_TYPE_0 0 /* Deprecated; will be removed */
+#define IPV6_SRCRT_TYPE_2 2 /* IPv6 type 2 Routing Header */
+
+/*
+ * routing header
+ */
+struct ipv6_rt_hdr {
+ __u8 nexthdr;
+ __u8 hdrlen;
+ __u8 type;
+ __u8 segments_left;
+
+ /*
+ * type specific data
+ * variable length field
+ */
+};
+
+
+struct ipv6_opt_hdr {
+ __u8 nexthdr;
+ __u8 hdrlen;
+ /*
+ * TLV encoded option data follows.
+ */
+};
+
+#define ipv6_destopt_hdr ipv6_opt_hdr
+#define ipv6_hopopt_hdr ipv6_opt_hdr
+
+
+/*
+ * routing header type 0 (used in cmsghdr struct)
+ */
+
+struct rt0_hdr {
+ struct ipv6_rt_hdr rt_hdr;
+ __u32 reserved;
+ struct in6_addr addr[0];
+
+#define rt0_type rt_hdr.type
+};
+
+/*
+ * routing header type 2
+ */
+
+struct rt2_hdr {
+ struct ipv6_rt_hdr rt_hdr;
+ __u32 reserved;
+ struct in6_addr addr;
+
+#define rt2_type rt_hdr.type
+};
+
+/*
+ * home address option in destination options header
+ */
+
+struct ipv6_destopt_hao {
+ __u8 type;
+ __u8 length;
+ struct in6_addr addr;
+} __attribute__ ((__packed__));
+
+/*
+ * IPv6 fixed header
+ *
+ * BEWARE, it is incorrect. The first 4 bits of flow_lbl
+ * are glued to priority now, forming "class".
+ */
+
+struct ipv6hdr {
+#if defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 priority:4,
+ version:4;
+#elif defined(__BIG_ENDIAN_BITFIELD)
+ __u8 version:4,
+ priority:4;
+#else
+#error "Please fix <asm/byteorder.h>"
+#endif
+ __u8 flow_lbl[3];
+
+ __be16 payload_len;
+ __u8 nexthdr;
+ __u8 hop_limit;
+
+ struct in6_addr saddr;
+ struct in6_addr daddr;
+};
+
+/*
+ * This structure contains configuration options per IPv6 link.
+ */
+struct ipv6_devconf {
+ __s32 forwarding;
+ __s32 hop_limit;
+ __s32 mtu6;
+ __s32 accept_ra;
+ __s32 accept_redirects;
+ __s32 autoconf;
+ __s32 dad_transmits;
+ __s32 rtr_solicits;
+ __s32 rtr_solicit_interval;
+ __s32 rtr_solicit_delay;
+ __s32 force_mld_version;
+#ifdef CONFIG_IPV6_PRIVACY
+ __s32 use_tempaddr;
+ __s32 temp_valid_lft;
+ __s32 temp_prefered_lft;
+ __s32 regen_max_retry;
+ __s32 max_desync_factor;
+#endif
+ __s32 max_addresses;
+ __s32 accept_ra_defrtr;
+ __s32 accept_ra_pinfo;
+#ifdef CONFIG_IPV6_ROUTER_PREF
+ __s32 accept_ra_rtr_pref;
+ __s32 rtr_probe_interval;
+#ifdef CONFIG_IPV6_ROUTE_INFO
+ __s32 accept_ra_rt_info_max_plen;
+#endif
+#endif
+ __s32 proxy_ndp;
+ __s32 accept_source_route;
+#ifdef CONFIG_IPV6_OPTIMISTIC_DAD
+ __s32 optimistic_dad;
+#endif
+ void *sysctl;
+};
+
+/* index values for the variables in ipv6_devconf */
+enum {
+ DEVCONF_FORWARDING = 0,
+ DEVCONF_HOPLIMIT,
+ DEVCONF_MTU6,
+ DEVCONF_ACCEPT_RA,
+ DEVCONF_ACCEPT_REDIRECTS,
+ DEVCONF_AUTOCONF,
+ DEVCONF_DAD_TRANSMITS,
+ DEVCONF_RTR_SOLICITS,
+ DEVCONF_RTR_SOLICIT_INTERVAL,
+ DEVCONF_RTR_SOLICIT_DELAY,
+ DEVCONF_USE_TEMPADDR,
+ DEVCONF_TEMP_VALID_LFT,
+ DEVCONF_TEMP_PREFERED_LFT,
+ DEVCONF_REGEN_MAX_RETRY,
+ DEVCONF_MAX_DESYNC_FACTOR,
+ DEVCONF_MAX_ADDRESSES,
+ DEVCONF_FORCE_MLD_VERSION,
+ DEVCONF_ACCEPT_RA_DEFRTR,
+ DEVCONF_ACCEPT_RA_PINFO,
+ DEVCONF_ACCEPT_RA_RTR_PREF,
+ DEVCONF_RTR_PROBE_INTERVAL,
+ DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN,
+ DEVCONF_PROXY_NDP,
+ DEVCONF_OPTIMISTIC_DAD,
+ DEVCONF_ACCEPT_SOURCE_ROUTE,
+ DEVCONF_MAX
+};
+
+
+#endif /* _IPV6_H */
diff --git a/sysroot/usr/include/linux/ipv6_route.h b/sysroot/usr/include/linux/ipv6_route.h
new file mode 100644
index 0000000..886bbb7
--- /dev/null
+++ b/sysroot/usr/include/linux/ipv6_route.h
@@ -0,0 +1,56 @@
+/*
+ * Linux INET6 implementation
+ *
+ * Authors:
+ * Pedro Roque <roque@di.fc.ul.pt>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _LINUX_IPV6_ROUTE_H
+#define _LINUX_IPV6_ROUTE_H
+
+#define RTF_DEFAULT 0x00010000 /* default - learned via ND */
+#define RTF_ALLONLINK 0x00020000 /* (deprecated and will be removed)
+ fallback, no routers on link */
+#define RTF_ADDRCONF 0x00040000 /* addrconf route - RA */
+#define RTF_PREFIX_RT 0x00080000 /* A prefix only route - RA */
+#define RTF_ANYCAST 0x00100000 /* Anycast */
+
+#define RTF_NONEXTHOP 0x00200000 /* route with no nexthop */
+#define RTF_EXPIRES 0x00400000
+
+#define RTF_ROUTEINFO 0x00800000 /* route information - RA */
+
+#define RTF_CACHE 0x01000000 /* cache entry */
+#define RTF_FLOW 0x02000000 /* flow significant route */
+#define RTF_POLICY 0x04000000 /* policy route */
+
+#define RTF_PREF(pref) ((pref) << 27)
+#define RTF_PREF_MASK 0x18000000
+
+#define RTF_LOCAL 0x80000000
+
+
+struct in6_rtmsg {
+ struct in6_addr rtmsg_dst;
+ struct in6_addr rtmsg_src;
+ struct in6_addr rtmsg_gateway;
+ __u32 rtmsg_type;
+ __u16 rtmsg_dst_len;
+ __u16 rtmsg_src_len;
+ __u32 rtmsg_metric;
+ unsigned long rtmsg_info;
+ __u32 rtmsg_flags;
+ int rtmsg_ifindex;
+};
+
+#define RTMSG_NEWDEVICE 0x11
+#define RTMSG_DELDEVICE 0x12
+#define RTMSG_NEWROUTE 0x21
+#define RTMSG_DELROUTE 0x22
+
+#endif
diff --git a/sysroot/usr/include/linux/ipx.h b/sysroot/usr/include/linux/ipx.h
new file mode 100644
index 0000000..eb19b4e
--- /dev/null
+++ b/sysroot/usr/include/linux/ipx.h
@@ -0,0 +1,74 @@
+#ifndef _IPX_H_
+#define _IPX_H_
+#include <linux/sockios.h>
+#include <linux/socket.h>
+#define IPX_NODE_LEN 6
+#define IPX_MTU 576
+
+struct sockaddr_ipx {
+ sa_family_t sipx_family;
+ __be16 sipx_port;
+ __be32 sipx_network;
+ unsigned char sipx_node[IPX_NODE_LEN];
+ __u8 sipx_type;
+ unsigned char sipx_zero; /* 16 byte fill */
+};
+
+/*
+ * So we can fit the extra info for SIOCSIFADDR into the address nicely
+ */
+#define sipx_special sipx_port
+#define sipx_action sipx_zero
+#define IPX_DLTITF 0
+#define IPX_CRTITF 1
+
+struct ipx_route_definition {
+ __be32 ipx_network;
+ __be32 ipx_router_network;
+ unsigned char ipx_router_node[IPX_NODE_LEN];
+};
+
+struct ipx_interface_definition {
+ __be32 ipx_network;
+ unsigned char ipx_device[16];
+ unsigned char ipx_dlink_type;
+#define IPX_FRAME_NONE 0
+#define IPX_FRAME_SNAP 1
+#define IPX_FRAME_8022 2
+#define IPX_FRAME_ETHERII 3
+#define IPX_FRAME_8023 4
+#define IPX_FRAME_TR_8022 5 /* obsolete */
+ unsigned char ipx_special;
+#define IPX_SPECIAL_NONE 0
+#define IPX_PRIMARY 1
+#define IPX_INTERNAL 2
+ unsigned char ipx_node[IPX_NODE_LEN];
+};
+
+struct ipx_config_data {
+ unsigned char ipxcfg_auto_select_primary;
+ unsigned char ipxcfg_auto_create_interfaces;
+};
+
+/*
+ * OLD Route Definition for backward compatibility.
+ */
+
+struct ipx_route_def {
+ __be32 ipx_network;
+ __be32 ipx_router_network;
+#define IPX_ROUTE_NO_ROUTER 0
+ unsigned char ipx_router_node[IPX_NODE_LEN];
+ unsigned char ipx_device[16];
+ unsigned short ipx_flags;
+#define IPX_RT_SNAP 8
+#define IPX_RT_8022 4
+#define IPX_RT_BLUEBOOK 2
+#define IPX_RT_ROUTED 1
+};
+
+#define SIOCAIPXITFCRT (SIOCPROTOPRIVATE)
+#define SIOCAIPXPRISLT (SIOCPROTOPRIVATE + 1)
+#define SIOCIPXCFGDATA (SIOCPROTOPRIVATE + 2)
+#define SIOCIPXNCPCONN (SIOCPROTOPRIVATE + 3)
+#endif /* _IPX_H_ */
diff --git a/sysroot/usr/include/linux/irda.h b/sysroot/usr/include/linux/irda.h
new file mode 100644
index 0000000..28f88ec
--- /dev/null
+++ b/sysroot/usr/include/linux/irda.h
@@ -0,0 +1,252 @@
+/*********************************************************************
+ *
+ * Filename: irda.h
+ * Version:
+ * Description:
+ * Status: Experimental.
+ * Author: Dag Brattli <dagb@cs.uit.no>
+ * Created at: Mon Mar 8 14:06:12 1999
+ * Modified at: Sat Dec 25 16:06:42 1999
+ * Modified by: Dag Brattli <dagb@cs.uit.no>
+ *
+ * Copyright (c) 1999 Dag Brattli, All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * Neither Dag Brattli nor University of Tromsø admit liability nor
+ * provide warranty for any of this software. This material is
+ * provided "AS-IS" and at no charge.
+ *
+ ********************************************************************/
+
+#ifndef KERNEL_IRDA_H
+#define KERNEL_IRDA_H
+
+/* Please do *not* add any #include in this file, this file is
+ * included as-is in user space.
+ * Please fix the calling file to properly included needed files before
+ * this one, or preferably to include <net/irda/irda.h> instead.
+ * Jean II */
+
+/* Hint bit positions for first hint byte */
+#define HINT_PNP 0x01
+#define HINT_PDA 0x02
+#define HINT_COMPUTER 0x04
+#define HINT_PRINTER 0x08
+#define HINT_MODEM 0x10
+#define HINT_FAX 0x20
+#define HINT_LAN 0x40
+#define HINT_EXTENSION 0x80
+
+/* Hint bit positions for second hint byte (first extension byte) */
+#define HINT_TELEPHONY 0x01
+#define HINT_FILE_SERVER 0x02
+#define HINT_COMM 0x04
+#define HINT_MESSAGE 0x08
+#define HINT_HTTP 0x10
+#define HINT_OBEX 0x20
+
+/* IrLMP character code values */
+#define CS_ASCII 0x00
+#define CS_ISO_8859_1 0x01
+#define CS_ISO_8859_2 0x02
+#define CS_ISO_8859_3 0x03
+#define CS_ISO_8859_4 0x04
+#define CS_ISO_8859_5 0x05
+#define CS_ISO_8859_6 0x06
+#define CS_ISO_8859_7 0x07
+#define CS_ISO_8859_8 0x08
+#define CS_ISO_8859_9 0x09
+#define CS_UNICODE 0xff
+
+/* These are the currently known dongles */
+typedef enum {
+ IRDA_TEKRAM_DONGLE = 0,
+ IRDA_ESI_DONGLE = 1,
+ IRDA_ACTISYS_DONGLE = 2,
+ IRDA_ACTISYS_PLUS_DONGLE = 3,
+ IRDA_GIRBIL_DONGLE = 4,
+ IRDA_LITELINK_DONGLE = 5,
+ IRDA_AIRPORT_DONGLE = 6,
+ IRDA_OLD_BELKIN_DONGLE = 7,
+ IRDA_EP7211_IR = 8,
+ IRDA_MCP2120_DONGLE = 9,
+ IRDA_ACT200L_DONGLE = 10,
+ IRDA_MA600_DONGLE = 11,
+ IRDA_TOIM3232_DONGLE = 12,
+ IRDA_EP7211_DONGLE = 13,
+} IRDA_DONGLE;
+
+/* Protocol types to be used for SOCK_DGRAM */
+enum {
+ IRDAPROTO_UNITDATA = 0,
+ IRDAPROTO_ULTRA = 1,
+ IRDAPROTO_MAX
+};
+
+#define SOL_IRLMP 266 /* Same as SOL_IRDA for now */
+#define SOL_IRTTP 266 /* Same as SOL_IRDA for now */
+
+#define IRLMP_ENUMDEVICES 1 /* Return discovery log */
+#define IRLMP_IAS_SET 2 /* Set an attribute in local IAS */
+#define IRLMP_IAS_QUERY 3 /* Query remote IAS for attribute */
+#define IRLMP_HINTS_SET 4 /* Set hint bits advertised */
+#define IRLMP_QOS_SET 5
+#define IRLMP_QOS_GET 6
+#define IRLMP_MAX_SDU_SIZE 7
+#define IRLMP_IAS_GET 8 /* Get an attribute from local IAS */
+#define IRLMP_IAS_DEL 9 /* Remove attribute from local IAS */
+#define IRLMP_HINT_MASK_SET 10 /* Set discovery filter */
+#define IRLMP_WAITDEVICE 11 /* Wait for a new discovery */
+
+#define IRTTP_MAX_SDU_SIZE IRLMP_MAX_SDU_SIZE /* Compatibility */
+
+#define IAS_MAX_STRING 256 /* See IrLMP 1.1, 4.3.3.2 */
+#define IAS_MAX_OCTET_STRING 1024 /* See IrLMP 1.1, 4.3.3.2 */
+#define IAS_MAX_CLASSNAME 60 /* See IrLMP 1.1, 4.3.1 */
+#define IAS_MAX_ATTRIBNAME 60 /* See IrLMP 1.1, 4.3.3.1 */
+#define IAS_MAX_ATTRIBNUMBER 256 /* See IrLMP 1.1, 4.3.3.1 */
+/* For user space backward compatibility - may be fixed in kernel 2.5.X
+ * Note : need 60+1 ('\0'), make it 64 for alignement - Jean II */
+#define IAS_EXPORT_CLASSNAME 64
+#define IAS_EXPORT_ATTRIBNAME 256
+
+/* Attribute type needed for struct irda_ias_set */
+#define IAS_MISSING 0
+#define IAS_INTEGER 1
+#define IAS_OCT_SEQ 2
+#define IAS_STRING 3
+
+#define LSAP_ANY 0xff
+
+struct sockaddr_irda {
+ sa_family_t sir_family; /* AF_IRDA */
+ __u8 sir_lsap_sel; /* LSAP selector */
+ __u32 sir_addr; /* Device address */
+ char sir_name[25]; /* Usually <service>:IrDA:TinyTP */
+};
+
+struct irda_device_info {
+ __u32 saddr; /* Address of local interface */
+ __u32 daddr; /* Address of remote device */
+ char info[22]; /* Description */
+ __u8 charset; /* Charset used for description */
+ __u8 hints[2]; /* Hint bits */
+};
+
+struct irda_device_list {
+ __u32 len;
+ struct irda_device_info dev[1];
+};
+
+struct irda_ias_set {
+ char irda_class_name[IAS_EXPORT_CLASSNAME];
+ char irda_attrib_name[IAS_EXPORT_ATTRIBNAME];
+ unsigned int irda_attrib_type;
+ union {
+ unsigned int irda_attrib_int;
+ struct {
+ unsigned short len;
+ __u8 octet_seq[IAS_MAX_OCTET_STRING];
+ } irda_attrib_octet_seq;
+ struct {
+ __u8 len;
+ __u8 charset;
+ __u8 string[IAS_MAX_STRING];
+ } irda_attrib_string;
+ } attribute;
+ __u32 daddr; /* Address of device (for some queries only) */
+};
+
+/* Some private IOCTL's (max 16) */
+#define SIOCSDONGLE (SIOCDEVPRIVATE + 0)
+#define SIOCGDONGLE (SIOCDEVPRIVATE + 1)
+#define SIOCSBANDWIDTH (SIOCDEVPRIVATE + 2)
+#define SIOCSMEDIABUSY (SIOCDEVPRIVATE + 3)
+#define SIOCGMEDIABUSY (SIOCDEVPRIVATE + 4)
+#define SIOCGRECEIVING (SIOCDEVPRIVATE + 5)
+#define SIOCSMODE (SIOCDEVPRIVATE + 6)
+#define SIOCGMODE (SIOCDEVPRIVATE + 7)
+#define SIOCSDTRRTS (SIOCDEVPRIVATE + 8)
+#define SIOCGQOS (SIOCDEVPRIVATE + 9)
+
+/* No reason to include <linux/if.h> just because of this one ;-) */
+#define IRNAMSIZ 16
+
+/* IrDA quality of service information (must not exceed 16 bytes) */
+struct if_irda_qos {
+ unsigned long baudrate;
+ unsigned short data_size;
+ unsigned short window_size;
+ unsigned short min_turn_time;
+ unsigned short max_turn_time;
+ unsigned char add_bofs;
+ unsigned char link_disc;
+};
+
+/* For setting RTS and DTR lines of a dongle */
+struct if_irda_line {
+ __u8 dtr;
+ __u8 rts;
+};
+
+/* IrDA interface configuration (data part must not exceed 16 bytes) */
+struct if_irda_req {
+ union {
+ char ifrn_name[IRNAMSIZ]; /* if name, e.g. "irda0" */
+ } ifr_ifrn;
+
+ /* Data part */
+ union {
+ struct if_irda_line ifru_line;
+ struct if_irda_qos ifru_qos;
+ unsigned short ifru_flags;
+ unsigned int ifru_receiving;
+ unsigned int ifru_mode;
+ unsigned int ifru_dongle;
+ } ifr_ifru;
+};
+
+#define ifr_baudrate ifr_ifru.ifru_qos.baudrate
+#define ifr_receiving ifr_ifru.ifru_receiving
+#define ifr_dongle ifr_ifru.ifru_dongle
+#define ifr_mode ifr_ifru.ifru_mode
+#define ifr_dtr ifr_ifru.ifru_line.dtr
+#define ifr_rts ifr_ifru.ifru_line.rts
+
+
+/* IrDA netlink definitions */
+#define IRDA_NL_NAME "irda"
+#define IRDA_NL_VERSION 1
+
+enum irda_nl_commands {
+ IRDA_NL_CMD_UNSPEC,
+ IRDA_NL_CMD_SET_MODE,
+ IRDA_NL_CMD_GET_MODE,
+
+ __IRDA_NL_CMD_AFTER_LAST
+};
+#define IRDA_NL_CMD_MAX (__IRDA_NL_CMD_AFTER_LAST - 1)
+
+enum nl80211_attrs {
+ IRDA_NL_ATTR_UNSPEC,
+ IRDA_NL_ATTR_IFNAME,
+ IRDA_NL_ATTR_MODE,
+
+ __IRDA_NL_ATTR_AFTER_LAST
+};
+#define IRDA_NL_ATTR_MAX (__IRDA_NL_ATTR_AFTER_LAST - 1)
+
+/* IrDA modes */
+#define IRDA_MODE_PRIMARY 0x1
+#define IRDA_MODE_SECONDARY 0x2
+#define IRDA_MODE_MONITOR 0x4
+
+#endif /* KERNEL_IRDA_H */
+
+
+
+
diff --git a/sysroot/usr/include/linux/isdn.h b/sysroot/usr/include/linux/isdn.h
new file mode 100644
index 0000000..ee23597
--- /dev/null
+++ b/sysroot/usr/include/linux/isdn.h
@@ -0,0 +1,148 @@
+/* $Id: isdn.h,v 1.125.2.3 2004/02/10 01:07:14 keil Exp $
+ *
+ * Main header for the Linux ISDN subsystem (linklevel).
+ *
+ * Copyright 1994,95,96 by Fritz Elfert (fritz@isdn4linux.de)
+ * Copyright 1995,96 by Thinking Objects Software GmbH Wuerzburg
+ * Copyright 1995,96 by Michael Hipp (Michael.Hipp@student.uni-tuebingen.de)
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
+ */
+
+#ifndef __ISDN_H__
+#define __ISDN_H__
+
+#include <linux/ioctl.h>
+
+#ifdef CONFIG_COBALT_MICRO_SERVER
+/* Save memory */
+#define ISDN_MAX_DRIVERS 2
+#define ISDN_MAX_CHANNELS 8
+#else
+#define ISDN_MAX_DRIVERS 32
+#define ISDN_MAX_CHANNELS 64
+#endif
+
+/* New ioctl-codes */
+#define IIOCNETAIF _IO('I',1)
+#define IIOCNETDIF _IO('I',2)
+#define IIOCNETSCF _IO('I',3)
+#define IIOCNETGCF _IO('I',4)
+#define IIOCNETANM _IO('I',5)
+#define IIOCNETDNM _IO('I',6)
+#define IIOCNETGNM _IO('I',7)
+#define IIOCGETSET _IO('I',8) /* no longer supported */
+#define IIOCSETSET _IO('I',9) /* no longer supported */
+#define IIOCSETVER _IO('I',10)
+#define IIOCNETHUP _IO('I',11)
+#define IIOCSETGST _IO('I',12)
+#define IIOCSETBRJ _IO('I',13)
+#define IIOCSIGPRF _IO('I',14)
+#define IIOCGETPRF _IO('I',15)
+#define IIOCSETPRF _IO('I',16)
+#define IIOCGETMAP _IO('I',17)
+#define IIOCSETMAP _IO('I',18)
+#define IIOCNETASL _IO('I',19)
+#define IIOCNETDIL _IO('I',20)
+#define IIOCGETCPS _IO('I',21)
+#define IIOCGETDVR _IO('I',22)
+#define IIOCNETLCR _IO('I',23) /* dwabc ioctl for LCR from isdnlog */
+#define IIOCNETDWRSET _IO('I',24) /* dwabc ioctl to reset abc-values to default on a net-interface */
+
+#define IIOCNETALN _IO('I',32)
+#define IIOCNETDLN _IO('I',33)
+
+#define IIOCNETGPN _IO('I',34)
+
+#define IIOCDBGVAR _IO('I',127)
+
+#define IIOCDRVCTL _IO('I',128)
+
+/* cisco hdlck device private ioctls */
+#define SIOCGKEEPPERIOD (SIOCDEVPRIVATE + 0)
+#define SIOCSKEEPPERIOD (SIOCDEVPRIVATE + 1)
+#define SIOCGDEBSERINT (SIOCDEVPRIVATE + 2)
+#define SIOCSDEBSERINT (SIOCDEVPRIVATE + 3)
+
+/* Packet encapsulations for net-interfaces */
+#define ISDN_NET_ENCAP_ETHER 0
+#define ISDN_NET_ENCAP_RAWIP 1
+#define ISDN_NET_ENCAP_IPTYP 2
+#define ISDN_NET_ENCAP_CISCOHDLC 3 /* Without SLARP and keepalive */
+#define ISDN_NET_ENCAP_SYNCPPP 4
+#define ISDN_NET_ENCAP_UIHDLC 5
+#define ISDN_NET_ENCAP_CISCOHDLCK 6 /* With SLARP and keepalive */
+#define ISDN_NET_ENCAP_X25IFACE 7 /* Documentation/networking/x25-iface.txt*/
+#define ISDN_NET_ENCAP_MAX_ENCAP ISDN_NET_ENCAP_X25IFACE
+
+/* Facility which currently uses an ISDN-channel */
+#define ISDN_USAGE_NONE 0
+#define ISDN_USAGE_RAW 1
+#define ISDN_USAGE_MODEM 2
+#define ISDN_USAGE_NET 3
+#define ISDN_USAGE_VOICE 4
+#define ISDN_USAGE_FAX 5
+#define ISDN_USAGE_MASK 7 /* Mask to get plain usage */
+#define ISDN_USAGE_DISABLED 32 /* This bit is set, if channel is disabled */
+#define ISDN_USAGE_EXCLUSIVE 64 /* This bit is set, if channel is exclusive */
+#define ISDN_USAGE_OUTGOING 128 /* This bit is set, if channel is outgoing */
+
+#define ISDN_MODEM_NUMREG 24 /* Number of Modem-Registers */
+#define ISDN_LMSNLEN 255 /* Length of tty's Listen-MSN string */
+#define ISDN_CMSGLEN 50 /* Length of CONNECT-Message to add for Modem */
+
+#define ISDN_MSNLEN 32
+#define NET_DV 0x06 /* Data version for isdn_net_ioctl_cfg */
+#define TTY_DV 0x06 /* Data version for iprofd etc. */
+
+#define INF_DV 0x01 /* Data version for /dev/isdninfo */
+
+typedef struct {
+ char drvid[25];
+ unsigned long arg;
+} isdn_ioctl_struct;
+
+typedef struct {
+ char name[10];
+ char phone[ISDN_MSNLEN];
+ int outgoing;
+} isdn_net_ioctl_phone;
+
+typedef struct {
+ char name[10]; /* Name of interface */
+ char master[10]; /* Name of Master for Bundling */
+ char slave[10]; /* Name of Slave for Bundling */
+ char eaz[256]; /* EAZ/MSN */
+ char drvid[25]; /* DriverId for Bindings */
+ int onhtime; /* Hangup-Timeout */
+ int charge; /* Charge-Units */
+ int l2_proto; /* Layer-2 protocol */
+ int l3_proto; /* Layer-3 protocol */
+ int p_encap; /* Encapsulation */
+ int exclusive; /* Channel, if bound exclusive */
+ int dialmax; /* Dial Retry-Counter */
+ int slavedelay; /* Delay until slave starts up */
+ int cbdelay; /* Delay before Callback */
+ int chargehup; /* Flag: Charge-Hangup */
+ int ihup; /* Flag: Hangup-Timeout on incoming line */
+ int secure; /* Flag: Secure */
+ int callback; /* Flag: Callback */
+ int cbhup; /* Flag: Reject Call before Callback */
+ int pppbind; /* ippp device for bindings */
+ int chargeint; /* Use fixed charge interval length */
+ int triggercps; /* BogoCPS needed for triggering slave */
+ int dialtimeout; /* Dial-Timeout */
+ int dialwait; /* Time to wait after failed dial */
+ int dialmode; /* Flag: off / on / auto */
+} isdn_net_ioctl_cfg;
+
+#define ISDN_NET_DIALMODE_MASK 0xC0 /* bits for status */
+#define ISDN_NET_DM_OFF 0x00 /* this interface is stopped */
+#define ISDN_NET_DM_MANUAL 0x40 /* this interface is on (manual) */
+#define ISDN_NET_DM_AUTO 0x80 /* this interface is autodial */
+#define ISDN_NET_DIALMODE(x) ((&(x))->flags & ISDN_NET_DIALMODE_MASK)
+
+
+#endif /* __ISDN_H__ */
diff --git a/sysroot/usr/include/linux/isdn/capicmd.h b/sysroot/usr/include/linux/isdn/capicmd.h
new file mode 100644
index 0000000..b58635f
--- /dev/null
+++ b/sysroot/usr/include/linux/isdn/capicmd.h
@@ -0,0 +1,115 @@
+/* $Id: capicmd.h,v 1.2.6.2 2001/09/23 22:24:33 kai Exp $
+ *
+ * CAPI 2.0 Interface for Linux
+ *
+ * Copyright 1997 by Carsten Paeth <calle@calle.de>
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
+ */
+
+#ifndef __CAPICMD_H__
+#define __CAPICMD_H__
+
+#define CAPI_MSG_BASELEN 8
+#define CAPI_DATA_B3_REQ_LEN (CAPI_MSG_BASELEN+4+4+2+2+2)
+#define CAPI_DATA_B3_RESP_LEN (CAPI_MSG_BASELEN+4+2)
+
+/*----- CAPI commands -----*/
+#define CAPI_ALERT 0x01
+#define CAPI_CONNECT 0x02
+#define CAPI_CONNECT_ACTIVE 0x03
+#define CAPI_CONNECT_B3_ACTIVE 0x83
+#define CAPI_CONNECT_B3 0x82
+#define CAPI_CONNECT_B3_T90_ACTIVE 0x88
+#define CAPI_DATA_B3 0x86
+#define CAPI_DISCONNECT_B3 0x84
+#define CAPI_DISCONNECT 0x04
+#define CAPI_FACILITY 0x80
+#define CAPI_INFO 0x08
+#define CAPI_LISTEN 0x05
+#define CAPI_MANUFACTURER 0xff
+#define CAPI_RESET_B3 0x87
+#define CAPI_SELECT_B_PROTOCOL 0x41
+
+/*----- CAPI subcommands -----*/
+
+#define CAPI_REQ 0x80
+#define CAPI_CONF 0x81
+#define CAPI_IND 0x82
+#define CAPI_RESP 0x83
+
+/*----- CAPI combined commands -----*/
+
+#define CAPICMD(cmd,subcmd) (((cmd)<<8)|(subcmd))
+
+#define CAPI_DISCONNECT_REQ CAPICMD(CAPI_DISCONNECT,CAPI_REQ)
+#define CAPI_DISCONNECT_CONF CAPICMD(CAPI_DISCONNECT,CAPI_CONF)
+#define CAPI_DISCONNECT_IND CAPICMD(CAPI_DISCONNECT,CAPI_IND)
+#define CAPI_DISCONNECT_RESP CAPICMD(CAPI_DISCONNECT,CAPI_RESP)
+
+#define CAPI_ALERT_REQ CAPICMD(CAPI_ALERT,CAPI_REQ)
+#define CAPI_ALERT_CONF CAPICMD(CAPI_ALERT,CAPI_CONF)
+
+#define CAPI_CONNECT_REQ CAPICMD(CAPI_CONNECT,CAPI_REQ)
+#define CAPI_CONNECT_CONF CAPICMD(CAPI_CONNECT,CAPI_CONF)
+#define CAPI_CONNECT_IND CAPICMD(CAPI_CONNECT,CAPI_IND)
+#define CAPI_CONNECT_RESP CAPICMD(CAPI_CONNECT,CAPI_RESP)
+
+#define CAPI_CONNECT_ACTIVE_REQ CAPICMD(CAPI_CONNECT_ACTIVE,CAPI_REQ)
+#define CAPI_CONNECT_ACTIVE_CONF CAPICMD(CAPI_CONNECT_ACTIVE,CAPI_CONF)
+#define CAPI_CONNECT_ACTIVE_IND CAPICMD(CAPI_CONNECT_ACTIVE,CAPI_IND)
+#define CAPI_CONNECT_ACTIVE_RESP CAPICMD(CAPI_CONNECT_ACTIVE,CAPI_RESP)
+
+#define CAPI_SELECT_B_PROTOCOL_REQ CAPICMD(CAPI_SELECT_B_PROTOCOL,CAPI_REQ)
+#define CAPI_SELECT_B_PROTOCOL_CONF CAPICMD(CAPI_SELECT_B_PROTOCOL,CAPI_CONF)
+
+#define CAPI_CONNECT_B3_ACTIVE_REQ CAPICMD(CAPI_CONNECT_B3_ACTIVE,CAPI_REQ)
+#define CAPI_CONNECT_B3_ACTIVE_CONF CAPICMD(CAPI_CONNECT_B3_ACTIVE,CAPI_CONF)
+#define CAPI_CONNECT_B3_ACTIVE_IND CAPICMD(CAPI_CONNECT_B3_ACTIVE,CAPI_IND)
+#define CAPI_CONNECT_B3_ACTIVE_RESP CAPICMD(CAPI_CONNECT_B3_ACTIVE,CAPI_RESP)
+
+#define CAPI_CONNECT_B3_REQ CAPICMD(CAPI_CONNECT_B3,CAPI_REQ)
+#define CAPI_CONNECT_B3_CONF CAPICMD(CAPI_CONNECT_B3,CAPI_CONF)
+#define CAPI_CONNECT_B3_IND CAPICMD(CAPI_CONNECT_B3,CAPI_IND)
+#define CAPI_CONNECT_B3_RESP CAPICMD(CAPI_CONNECT_B3,CAPI_RESP)
+
+
+#define CAPI_CONNECT_B3_T90_ACTIVE_IND CAPICMD(CAPI_CONNECT_B3_T90_ACTIVE,CAPI_IND)
+#define CAPI_CONNECT_B3_T90_ACTIVE_RESP CAPICMD(CAPI_CONNECT_B3_T90_ACTIVE,CAPI_RESP)
+
+#define CAPI_DATA_B3_REQ CAPICMD(CAPI_DATA_B3,CAPI_REQ)
+#define CAPI_DATA_B3_CONF CAPICMD(CAPI_DATA_B3,CAPI_CONF)
+#define CAPI_DATA_B3_IND CAPICMD(CAPI_DATA_B3,CAPI_IND)
+#define CAPI_DATA_B3_RESP CAPICMD(CAPI_DATA_B3,CAPI_RESP)
+
+#define CAPI_DISCONNECT_B3_REQ CAPICMD(CAPI_DISCONNECT_B3,CAPI_REQ)
+#define CAPI_DISCONNECT_B3_CONF CAPICMD(CAPI_DISCONNECT_B3,CAPI_CONF)
+#define CAPI_DISCONNECT_B3_IND CAPICMD(CAPI_DISCONNECT_B3,CAPI_IND)
+#define CAPI_DISCONNECT_B3_RESP CAPICMD(CAPI_DISCONNECT_B3,CAPI_RESP)
+
+#define CAPI_RESET_B3_REQ CAPICMD(CAPI_RESET_B3,CAPI_REQ)
+#define CAPI_RESET_B3_CONF CAPICMD(CAPI_RESET_B3,CAPI_CONF)
+#define CAPI_RESET_B3_IND CAPICMD(CAPI_RESET_B3,CAPI_IND)
+#define CAPI_RESET_B3_RESP CAPICMD(CAPI_RESET_B3,CAPI_RESP)
+
+#define CAPI_LISTEN_REQ CAPICMD(CAPI_LISTEN,CAPI_REQ)
+#define CAPI_LISTEN_CONF CAPICMD(CAPI_LISTEN,CAPI_CONF)
+
+#define CAPI_MANUFACTURER_REQ CAPICMD(CAPI_MANUFACTURER,CAPI_REQ)
+#define CAPI_MANUFACTURER_CONF CAPICMD(CAPI_MANUFACTURER,CAPI_CONF)
+#define CAPI_MANUFACTURER_IND CAPICMD(CAPI_MANUFACTURER,CAPI_IND)
+#define CAPI_MANUFACTURER_RESP CAPICMD(CAPI_MANUFACTURER,CAPI_RESP)
+
+#define CAPI_FACILITY_REQ CAPICMD(CAPI_FACILITY,CAPI_REQ)
+#define CAPI_FACILITY_CONF CAPICMD(CAPI_FACILITY,CAPI_CONF)
+#define CAPI_FACILITY_IND CAPICMD(CAPI_FACILITY,CAPI_IND)
+#define CAPI_FACILITY_RESP CAPICMD(CAPI_FACILITY,CAPI_RESP)
+
+#define CAPI_INFO_REQ CAPICMD(CAPI_INFO,CAPI_REQ)
+#define CAPI_INFO_CONF CAPICMD(CAPI_INFO,CAPI_CONF)
+#define CAPI_INFO_IND CAPICMD(CAPI_INFO,CAPI_IND)
+#define CAPI_INFO_RESP CAPICMD(CAPI_INFO,CAPI_RESP)
+
+#endif /* __CAPICMD_H__ */
diff --git a/sysroot/usr/include/linux/isdn_divertif.h b/sysroot/usr/include/linux/isdn_divertif.h
new file mode 100644
index 0000000..10ff7e7
--- /dev/null
+++ b/sysroot/usr/include/linux/isdn_divertif.h
@@ -0,0 +1,26 @@
+/* $Id: isdn_divertif.h,v 1.4.6.1 2001/09/23 22:25:05 kai Exp $
+ *
+ * Header for the diversion supplementary interface for i4l.
+ *
+ * Author Werner Cornelius (werner@titro.de)
+ * Copyright by Werner Cornelius (werner@titro.de)
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
+ */
+
+
+/***********************************************************/
+/* magic value is also used to control version information */
+/***********************************************************/
+#define DIVERT_IF_MAGIC 0x25873401
+#define DIVERT_CMD_REG 0x00 /* register command */
+#define DIVERT_CMD_REL 0x01 /* release command */
+#define DIVERT_NO_ERR 0x00 /* return value no error */
+#define DIVERT_CMD_ERR 0x01 /* invalid cmd */
+#define DIVERT_VER_ERR 0x02 /* magic/version invalid */
+#define DIVERT_REG_ERR 0x03 /* module already registered */
+#define DIVERT_REL_ERR 0x04 /* module not registered */
+#define DIVERT_REG_NAME isdn_register_divert
+
diff --git a/sysroot/usr/include/linux/isdn_ppp.h b/sysroot/usr/include/linux/isdn_ppp.h
new file mode 100644
index 0000000..aabb015
--- /dev/null
+++ b/sysroot/usr/include/linux/isdn_ppp.h
@@ -0,0 +1,67 @@
+/* Linux ISDN subsystem, sync PPP, interface to ipppd
+ *
+ * Copyright 1994-1999 by Fritz Elfert (fritz@isdn4linux.de)
+ * Copyright 1995,96 Thinking Objects Software GmbH Wuerzburg
+ * Copyright 1995,96 by Michael Hipp (Michael.Hipp@student.uni-tuebingen.de)
+ * Copyright 2000-2002 by Kai Germaschewski (kai@germaschewski.name)
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
+ */
+
+#ifndef _LINUX_ISDN_PPP_H
+#define _LINUX_ISDN_PPP_H
+
+#define CALLTYPE_INCOMING 0x1
+#define CALLTYPE_OUTGOING 0x2
+#define CALLTYPE_CALLBACK 0x4
+
+#define IPPP_VERSION "2.2.0"
+
+struct pppcallinfo
+{
+ int calltype;
+ unsigned char local_num[64];
+ unsigned char remote_num[64];
+ int charge_units;
+};
+
+#define PPPIOCGCALLINFO _IOWR('t',128,struct pppcallinfo)
+#define PPPIOCBUNDLE _IOW('t',129,int)
+#define PPPIOCGMPFLAGS _IOR('t',130,int)
+#define PPPIOCSMPFLAGS _IOW('t',131,int)
+#define PPPIOCSMPMTU _IOW('t',132,int)
+#define PPPIOCSMPMRU _IOW('t',133,int)
+#define PPPIOCGCOMPRESSORS _IOR('t',134,unsigned long [8])
+#define PPPIOCSCOMPRESSOR _IOW('t',135,int)
+#define PPPIOCGIFNAME _IOR('t',136, char [IFNAMSIZ] )
+
+
+#define SC_MP_PROT 0x00000200
+#define SC_REJ_MP_PROT 0x00000400
+#define SC_OUT_SHORT_SEQ 0x00000800
+#define SC_IN_SHORT_SEQ 0x00004000
+
+#define SC_DECOMP_ON 0x01
+#define SC_COMP_ON 0x02
+#define SC_DECOMP_DISCARD 0x04
+#define SC_COMP_DISCARD 0x08
+#define SC_LINK_DECOMP_ON 0x10
+#define SC_LINK_COMP_ON 0x20
+#define SC_LINK_DECOMP_DISCARD 0x40
+#define SC_LINK_COMP_DISCARD 0x80
+
+#define ISDN_PPP_COMP_MAX_OPTIONS 16
+
+#define IPPP_COMP_FLAG_XMIT 0x1
+#define IPPP_COMP_FLAG_LINK 0x2
+
+struct isdn_ppp_comp_data {
+ int num;
+ unsigned char options[ISDN_PPP_COMP_MAX_OPTIONS];
+ int optlen;
+ int flags;
+};
+
+#endif /* _LINUX_ISDN_PPP_H */
diff --git a/sysroot/usr/include/linux/isdnif.h b/sysroot/usr/include/linux/isdnif.h
new file mode 100644
index 0000000..1db1b0b
--- /dev/null
+++ b/sysroot/usr/include/linux/isdnif.h
@@ -0,0 +1,56 @@
+/* $Id: isdnif.h,v 1.43.2.2 2004/01/12 23:08:35 keil Exp $
+ *
+ * Linux ISDN subsystem
+ * Definition of the interface between the subsystem and its low-level drivers.
+ *
+ * Copyright 1994,95,96 by Fritz Elfert (fritz@isdn4linux.de)
+ * Copyright 1995,96 Thinking Objects Software GmbH Wuerzburg
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
+ */
+
+#ifndef __ISDNIF_H__
+#define __ISDNIF_H__
+
+
+/*
+ * Values for general protocol-selection
+ */
+#define ISDN_PTYPE_UNKNOWN 0 /* Protocol undefined */
+#define ISDN_PTYPE_1TR6 1 /* german 1TR6-protocol */
+#define ISDN_PTYPE_EURO 2 /* EDSS1-protocol */
+#define ISDN_PTYPE_LEASED 3 /* for leased lines */
+#define ISDN_PTYPE_NI1 4 /* US NI-1 protocol */
+#define ISDN_PTYPE_MAX 7 /* Max. 8 Protocols */
+
+/*
+ * Values for Layer-2-protocol-selection
+ */
+#define ISDN_PROTO_L2_X75I 0 /* X75/LAPB with I-Frames */
+#define ISDN_PROTO_L2_X75UI 1 /* X75/LAPB with UI-Frames */
+#define ISDN_PROTO_L2_X75BUI 2 /* X75/LAPB with UI-Frames */
+#define ISDN_PROTO_L2_HDLC 3 /* HDLC */
+#define ISDN_PROTO_L2_TRANS 4 /* Transparent (Voice) */
+#define ISDN_PROTO_L2_X25DTE 5 /* X25/LAPB DTE mode */
+#define ISDN_PROTO_L2_X25DCE 6 /* X25/LAPB DCE mode */
+#define ISDN_PROTO_L2_V11096 7 /* V.110 bitrate adaption 9600 Baud */
+#define ISDN_PROTO_L2_V11019 8 /* V.110 bitrate adaption 19200 Baud */
+#define ISDN_PROTO_L2_V11038 9 /* V.110 bitrate adaption 38400 Baud */
+#define ISDN_PROTO_L2_MODEM 10 /* Analog Modem on Board */
+#define ISDN_PROTO_L2_FAX 11 /* Fax Group 2/3 */
+#define ISDN_PROTO_L2_HDLC_56K 12 /* HDLC 56k */
+#define ISDN_PROTO_L2_MAX 15 /* Max. 16 Protocols */
+
+/*
+ * Values for Layer-3-protocol-selection
+ */
+#define ISDN_PROTO_L3_TRANS 0 /* Transparent */
+#define ISDN_PROTO_L3_TRANSDSP 1 /* Transparent with DSP */
+#define ISDN_PROTO_L3_FCLASS2 2 /* Fax Group 2/3 CLASS 2 */
+#define ISDN_PROTO_L3_FCLASS1 3 /* Fax Group 2/3 CLASS 1 */
+#define ISDN_PROTO_L3_MAX 7 /* Max. 8 Protocols */
+
+
+#endif /* __ISDNIF_H__ */
diff --git a/sysroot/usr/include/linux/iso_fs.h b/sysroot/usr/include/linux/iso_fs.h
new file mode 100644
index 0000000..4688ac4
--- /dev/null
+++ b/sysroot/usr/include/linux/iso_fs.h
@@ -0,0 +1,165 @@
+#ifndef _ISOFS_FS_H
+#define _ISOFS_FS_H
+
+#include <linux/types.h>
+#include <linux/magic.h>
+
+/*
+ * The isofs filesystem constants/structures
+ */
+
+/* This part borrowed from the bsd386 isofs */
+#define ISODCL(from, to) (to - from + 1)
+
+struct iso_volume_descriptor {
+ char type[ISODCL(1,1)]; /* 711 */
+ char id[ISODCL(2,6)];
+ char version[ISODCL(7,7)];
+ char data[ISODCL(8,2048)];
+};
+
+/* volume descriptor types */
+#define ISO_VD_PRIMARY 1
+#define ISO_VD_SUPPLEMENTARY 2
+#define ISO_VD_END 255
+
+#define ISO_STANDARD_ID "CD001"
+
+struct iso_primary_descriptor {
+ char type [ISODCL ( 1, 1)]; /* 711 */
+ char id [ISODCL ( 2, 6)];
+ char version [ISODCL ( 7, 7)]; /* 711 */
+ char unused1 [ISODCL ( 8, 8)];
+ char system_id [ISODCL ( 9, 40)]; /* achars */
+ char volume_id [ISODCL ( 41, 72)]; /* dchars */
+ char unused2 [ISODCL ( 73, 80)];
+ char volume_space_size [ISODCL ( 81, 88)]; /* 733 */
+ char unused3 [ISODCL ( 89, 120)];
+ char volume_set_size [ISODCL (121, 124)]; /* 723 */
+ char volume_sequence_number [ISODCL (125, 128)]; /* 723 */
+ char logical_block_size [ISODCL (129, 132)]; /* 723 */
+ char path_table_size [ISODCL (133, 140)]; /* 733 */
+ char type_l_path_table [ISODCL (141, 144)]; /* 731 */
+ char opt_type_l_path_table [ISODCL (145, 148)]; /* 731 */
+ char type_m_path_table [ISODCL (149, 152)]; /* 732 */
+ char opt_type_m_path_table [ISODCL (153, 156)]; /* 732 */
+ char root_directory_record [ISODCL (157, 190)]; /* 9.1 */
+ char volume_set_id [ISODCL (191, 318)]; /* dchars */
+ char publisher_id [ISODCL (319, 446)]; /* achars */
+ char preparer_id [ISODCL (447, 574)]; /* achars */
+ char application_id [ISODCL (575, 702)]; /* achars */
+ char copyright_file_id [ISODCL (703, 739)]; /* 7.5 dchars */
+ char abstract_file_id [ISODCL (740, 776)]; /* 7.5 dchars */
+ char bibliographic_file_id [ISODCL (777, 813)]; /* 7.5 dchars */
+ char creation_date [ISODCL (814, 830)]; /* 8.4.26.1 */
+ char modification_date [ISODCL (831, 847)]; /* 8.4.26.1 */
+ char expiration_date [ISODCL (848, 864)]; /* 8.4.26.1 */
+ char effective_date [ISODCL (865, 881)]; /* 8.4.26.1 */
+ char file_structure_version [ISODCL (882, 882)]; /* 711 */
+ char unused4 [ISODCL (883, 883)];
+ char application_data [ISODCL (884, 1395)];
+ char unused5 [ISODCL (1396, 2048)];
+};
+
+/* Almost the same as the primary descriptor but two fields are specified */
+struct iso_supplementary_descriptor {
+ char type [ISODCL ( 1, 1)]; /* 711 */
+ char id [ISODCL ( 2, 6)];
+ char version [ISODCL ( 7, 7)]; /* 711 */
+ char flags [ISODCL ( 8, 8)]; /* 853 */
+ char system_id [ISODCL ( 9, 40)]; /* achars */
+ char volume_id [ISODCL ( 41, 72)]; /* dchars */
+ char unused2 [ISODCL ( 73, 80)];
+ char volume_space_size [ISODCL ( 81, 88)]; /* 733 */
+ char escape [ISODCL ( 89, 120)]; /* 856 */
+ char volume_set_size [ISODCL (121, 124)]; /* 723 */
+ char volume_sequence_number [ISODCL (125, 128)]; /* 723 */
+ char logical_block_size [ISODCL (129, 132)]; /* 723 */
+ char path_table_size [ISODCL (133, 140)]; /* 733 */
+ char type_l_path_table [ISODCL (141, 144)]; /* 731 */
+ char opt_type_l_path_table [ISODCL (145, 148)]; /* 731 */
+ char type_m_path_table [ISODCL (149, 152)]; /* 732 */
+ char opt_type_m_path_table [ISODCL (153, 156)]; /* 732 */
+ char root_directory_record [ISODCL (157, 190)]; /* 9.1 */
+ char volume_set_id [ISODCL (191, 318)]; /* dchars */
+ char publisher_id [ISODCL (319, 446)]; /* achars */
+ char preparer_id [ISODCL (447, 574)]; /* achars */
+ char application_id [ISODCL (575, 702)]; /* achars */
+ char copyright_file_id [ISODCL (703, 739)]; /* 7.5 dchars */
+ char abstract_file_id [ISODCL (740, 776)]; /* 7.5 dchars */
+ char bibliographic_file_id [ISODCL (777, 813)]; /* 7.5 dchars */
+ char creation_date [ISODCL (814, 830)]; /* 8.4.26.1 */
+ char modification_date [ISODCL (831, 847)]; /* 8.4.26.1 */
+ char expiration_date [ISODCL (848, 864)]; /* 8.4.26.1 */
+ char effective_date [ISODCL (865, 881)]; /* 8.4.26.1 */
+ char file_structure_version [ISODCL (882, 882)]; /* 711 */
+ char unused4 [ISODCL (883, 883)];
+ char application_data [ISODCL (884, 1395)];
+ char unused5 [ISODCL (1396, 2048)];
+};
+
+
+#define HS_STANDARD_ID "CDROM"
+
+struct hs_volume_descriptor {
+ char foo [ISODCL ( 1, 8)]; /* 733 */
+ char type [ISODCL ( 9, 9)]; /* 711 */
+ char id [ISODCL ( 10, 14)];
+ char version [ISODCL ( 15, 15)]; /* 711 */
+ char data[ISODCL(16,2048)];
+};
+
+
+struct hs_primary_descriptor {
+ char foo [ISODCL ( 1, 8)]; /* 733 */
+ char type [ISODCL ( 9, 9)]; /* 711 */
+ char id [ISODCL ( 10, 14)];
+ char version [ISODCL ( 15, 15)]; /* 711 */
+ char unused1 [ISODCL ( 16, 16)]; /* 711 */
+ char system_id [ISODCL ( 17, 48)]; /* achars */
+ char volume_id [ISODCL ( 49, 80)]; /* dchars */
+ char unused2 [ISODCL ( 81, 88)]; /* 733 */
+ char volume_space_size [ISODCL ( 89, 96)]; /* 733 */
+ char unused3 [ISODCL ( 97, 128)]; /* 733 */
+ char volume_set_size [ISODCL (129, 132)]; /* 723 */
+ char volume_sequence_number [ISODCL (133, 136)]; /* 723 */
+ char logical_block_size [ISODCL (137, 140)]; /* 723 */
+ char path_table_size [ISODCL (141, 148)]; /* 733 */
+ char type_l_path_table [ISODCL (149, 152)]; /* 731 */
+ char unused4 [ISODCL (153, 180)]; /* 733 */
+ char root_directory_record [ISODCL (181, 214)]; /* 9.1 */
+};
+
+/* We use this to help us look up the parent inode numbers. */
+
+struct iso_path_table{
+ unsigned char name_len[2]; /* 721 */
+ char extent[4]; /* 731 */
+ char parent[2]; /* 721 */
+ char name[0];
+} __attribute__((packed));
+
+/* high sierra is identical to iso, except that the date is only 6 bytes, and
+ there is an extra reserved byte after the flags */
+
+struct iso_directory_record {
+ char length [ISODCL (1, 1)]; /* 711 */
+ char ext_attr_length [ISODCL (2, 2)]; /* 711 */
+ char extent [ISODCL (3, 10)]; /* 733 */
+ char size [ISODCL (11, 18)]; /* 733 */
+ char date [ISODCL (19, 25)]; /* 7 by 711 */
+ char flags [ISODCL (26, 26)];
+ char file_unit_size [ISODCL (27, 27)]; /* 711 */
+ char interleave [ISODCL (28, 28)]; /* 711 */
+ char volume_sequence_number [ISODCL (29, 32)]; /* 723 */
+ unsigned char name_len [ISODCL (33, 33)]; /* 711 */
+ char name [0];
+} __attribute__((packed));
+
+#define ISOFS_BLOCK_BITS 11
+#define ISOFS_BLOCK_SIZE 2048
+
+#define ISOFS_BUFFER_SIZE(INODE) ((INODE)->i_sb->s_blocksize)
+#define ISOFS_BUFFER_BITS(INODE) ((INODE)->i_sb->s_blocksize_bits)
+
+#endif /* _ISOFS_FS_H */
diff --git a/sysroot/usr/include/linux/ixjuser.h b/sysroot/usr/include/linux/ixjuser.h
new file mode 100644
index 0000000..7d8525e
--- /dev/null
+++ b/sysroot/usr/include/linux/ixjuser.h
@@ -0,0 +1,720 @@
+#ifndef __LINUX_IXJUSER_H
+#define __LINUX_IXJUSER_H
+
+/******************************************************************************
+ *
+ * ixjuser.h
+ *
+ * Device Driver for Quicknet Technologies, Inc.'s Telephony cards
+ * including the Internet PhoneJACK, Internet PhoneJACK Lite,
+ * Internet PhoneJACK PCI, Internet LineJACK, Internet PhoneCARD and
+ * SmartCABLE
+ *
+ * (c) Copyright 1999-2001 Quicknet Technologies, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ * Author: Ed Okerson, <eokerson@quicknet.net>
+ *
+ * Contributors: Greg Herlein, <gherlein@quicknet.net>
+ * David W. Erhart, <derhart@quicknet.net>
+ * John Sellers, <jsellers@quicknet.net>
+ * Mike Preston, <mpreston@quicknet.net>
+ *
+ * More information about the hardware related to this driver can be found
+ * at our website: http://www.quicknet.net
+ *
+ * Fixes:
+ *
+ * IN NO EVENT SHALL QUICKNET TECHNOLOGIES, INC. BE LIABLE TO ANY PARTY FOR
+ * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
+ * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF QUICKNET
+ * TECHNOLOGIES, INC.HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * QUICKNET TECHNOLOGIES, INC. SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
+ * ON AN "AS IS" BASIS, AND QUICKNET TECHNOLOGIES, INC. HAS NO OBLIGATION
+ * TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ *
+ *****************************************************************************/
+
+#include <linux/telephony.h>
+
+
+/******************************************************************************
+*
+* IOCTL's used for the Quicknet Telephony Cards
+*
+* If you use the IXJCTL_TESTRAM command, the card must be power cycled to
+* reset the SRAM values before futher use.
+*
+******************************************************************************/
+
+#define IXJCTL_DSP_RESET _IO ('q', 0xC0)
+
+#define IXJCTL_RING PHONE_RING
+#define IXJCTL_HOOKSTATE PHONE_HOOKSTATE
+#define IXJCTL_MAXRINGS PHONE_MAXRINGS
+#define IXJCTL_RING_CADENCE PHONE_RING_CADENCE
+#define IXJCTL_RING_START PHONE_RING_START
+#define IXJCTL_RING_STOP PHONE_RING_STOP
+
+#define IXJCTL_CARDTYPE _IOR ('q', 0xC1, int)
+#define IXJCTL_SERIAL _IOR ('q', 0xC2, int)
+#define IXJCTL_DSP_TYPE _IOR ('q', 0xC3, int)
+#define IXJCTL_DSP_VERSION _IOR ('q', 0xC4, int)
+#define IXJCTL_VERSION _IOR ('q', 0xDA, char *)
+#define IXJCTL_DSP_IDLE _IO ('q', 0xC5)
+#define IXJCTL_TESTRAM _IO ('q', 0xC6)
+
+/******************************************************************************
+*
+* This group of IOCTLs deal with the record settings of the DSP
+*
+* The IXJCTL_REC_DEPTH command sets the internal buffer depth of the DSP.
+* Setting a lower depth reduces latency, but increases the demand of the
+* application to service the driver without frame loss. The DSP has 480
+* bytes of physical buffer memory for the record channel so the true
+* maximum limit is determined by how many frames will fit in the buffer.
+*
+* 1 uncompressed (480 byte) 16-bit linear frame.
+* 2 uncompressed (240 byte) 8-bit A-law/mu-law frames.
+* 15 TrueSpeech 8.5 frames.
+* 20 TrueSpeech 6.3,5.3,4.8 or 4.1 frames.
+*
+* The default in the driver is currently set to 2 frames.
+*
+* The IXJCTL_REC_VOLUME and IXJCTL_PLAY_VOLUME commands both use a Q8
+* number as a parameter, 0x100 scales the signal by 1.0, 0x200 scales the
+* signal by 2.0, 0x80 scales the signal by 0.5. No protection is given
+* against over-scaling, if the multiplication factor times the input
+* signal exceeds 16 bits, overflow distortion will occur. The default
+* setting is 0x100 (1.0).
+*
+* The IXJCTL_REC_LEVEL returns the average signal level (not r.m.s.) on
+* the most recently recorded frame as a 16 bit value.
+******************************************************************************/
+
+#define IXJCTL_REC_CODEC PHONE_REC_CODEC
+#define IXJCTL_REC_START PHONE_REC_START
+#define IXJCTL_REC_STOP PHONE_REC_STOP
+#define IXJCTL_REC_DEPTH PHONE_REC_DEPTH
+#define IXJCTL_FRAME PHONE_FRAME
+#define IXJCTL_REC_VOLUME PHONE_REC_VOLUME
+#define IXJCTL_REC_LEVEL PHONE_REC_LEVEL
+
+typedef enum {
+ f300_640 = 4, f300_500, f1100, f350, f400, f480, f440, f620, f20_50,
+ f133_200, f300, f300_420, f330, f300_425, f330_440, f340, f350_400,
+ f350_440, f350_450, f360, f380_420, f392, f400_425, f400_440, f400_450,
+ f420, f425, f425_450, f425_475, f435, f440_450, f440_480, f445, f450,
+ f452, f475, f480_620, f494, f500, f520, f523, f525, f540_660, f587,
+ f590, f600, f660, f700, f740, f750, f750_1450, f770, f800, f816, f850,
+ f857_1645, f900, f900_1300, f935_1215, f941_1477, f942, f950, f950_1400,
+ f975, f1000, f1020, f1050, f1100_1750, f1140, f1200, f1209, f1330, f1336,
+ lf1366, f1380, f1400, f1477, f1600, f1633_1638, f1800, f1860
+} IXJ_FILTER_FREQ;
+
+typedef struct {
+ unsigned int filter;
+ IXJ_FILTER_FREQ freq;
+ char enable;
+} IXJ_FILTER;
+
+typedef struct {
+ char enable;
+ char en_filter;
+ unsigned int filter;
+ unsigned int on1;
+ unsigned int off1;
+ unsigned int on2;
+ unsigned int off2;
+ unsigned int on3;
+ unsigned int off3;
+} IXJ_FILTER_CADENCE;
+
+#define IXJCTL_SET_FILTER _IOW ('q', 0xC7, IXJ_FILTER *)
+#define IXJCTL_SET_FILTER_RAW _IOW ('q', 0xDD, IXJ_FILTER_RAW *)
+#define IXJCTL_GET_FILTER_HIST _IOW ('q', 0xC8, int)
+#define IXJCTL_FILTER_CADENCE _IOW ('q', 0xD6, IXJ_FILTER_CADENCE *)
+#define IXJCTL_PLAY_CID _IO ('q', 0xD7)
+/******************************************************************************
+*
+* This IOCTL allows you to reassign values in the tone index table. The
+* tone table has 32 entries (0 - 31), but the driver only allows entries
+* 13 - 27 to be modified, entry 0 is reserved for silence and 1 - 12 are
+* the standard DTMF digits and 28 - 31 are the DTMF tones for A, B, C & D.
+* The positions used internally for Call Progress Tones are as follows:
+* Dial Tone - 25
+* Ring Back - 26
+* Busy Signal - 27
+*
+* The freq values are calculated as:
+* freq = cos(2 * PI * frequency / 8000)
+*
+* The most commonly needed values are already calculated and listed in the
+* enum IXJ_TONE_FREQ. Each tone index can have two frequencies with
+* different gains, if you are only using a single frequency set the unused
+* one to 0.
+*
+* The gain values range from 0 to 15 indicating +6dB to -24dB in 2dB
+* increments.
+*
+******************************************************************************/
+
+typedef enum {
+ hz20 = 0x7ffa,
+ hz50 = 0x7fe5,
+ hz133 = 0x7f4c,
+ hz200 = 0x7e6b,
+ hz261 = 0x7d50, /* .63 C1 */
+ hz277 = 0x7cfa, /* .18 CS1 */
+ hz293 = 0x7c9f, /* .66 D1 */
+ hz300 = 0x7c75,
+ hz311 = 0x7c32, /* .13 DS1 */
+ hz329 = 0x7bbf, /* .63 E1 */
+ hz330 = 0x7bb8,
+ hz340 = 0x7b75,
+ hz349 = 0x7b37, /* .23 F1 */
+ hz350 = 0x7b30,
+ hz360 = 0x7ae9,
+ hz369 = 0x7aa8, /* .99 FS1 */
+ hz380 = 0x7a56,
+ hz392 = 0x79fa, /* .00 G1 */
+ hz400 = 0x79bb,
+ hz415 = 0x7941, /* .30 GS1 */
+ hz420 = 0x7918,
+ hz425 = 0x78ee,
+ hz435 = 0x7899,
+ hz440 = 0x786d, /* .00 A1 */
+ hz445 = 0x7842,
+ hz450 = 0x7815,
+ hz452 = 0x7803,
+ hz466 = 0x7784, /* .16 AS1 */
+ hz475 = 0x7731,
+ hz480 = 0x7701,
+ hz493 = 0x7685, /* .88 B1 */
+ hz494 = 0x767b,
+ hz500 = 0x7640,
+ hz520 = 0x7578,
+ hz523 = 0x7559, /* .25 C2 */
+ hz525 = 0x7544,
+ hz540 = 0x74a7,
+ hz554 = 0x7411, /* .37 CS2 */
+ hz587 = 0x72a1, /* .33 D2 */
+ hz590 = 0x727f,
+ hz600 = 0x720b,
+ hz620 = 0x711e,
+ hz622 = 0x7106, /* .25 DS2 */
+ hz659 = 0x6f3b, /* .26 E2 */
+ hz660 = 0x6f2e,
+ hz698 = 0x6d3d, /* .46 F2 */
+ hz700 = 0x6d22,
+ hz739 = 0x6b09, /* .99 FS2 */
+ hz740 = 0x6afa,
+ hz750 = 0x6a6c,
+ hz770 = 0x694b,
+ hz783 = 0x688b, /* .99 G2 */
+ hz800 = 0x678d,
+ hz816 = 0x6698,
+ hz830 = 0x65bf, /* .61 GS2 */
+ hz850 = 0x6484,
+ hz857 = 0x6414,
+ hz880 = 0x629f, /* .00 A2 */
+ hz900 = 0x6154,
+ hz932 = 0x5f35, /* .33 AS2 */
+ hz935 = 0x5f01,
+ hz941 = 0x5e9a,
+ hz942 = 0x5e88,
+ hz950 = 0x5dfd,
+ hz975 = 0x5c44,
+ hz1000 = 0x5a81,
+ hz1020 = 0x5912,
+ hz1050 = 0x56e2,
+ hz1100 = 0x5320,
+ hz1140 = 0x5007,
+ hz1200 = 0x4b3b,
+ hz1209 = 0x4a80,
+ hz1215 = 0x4a02,
+ hz1250 = 0x471c,
+ hz1300 = 0x42e0,
+ hz1330 = 0x4049,
+ hz1336 = 0x3fc4,
+ hz1366 = 0x3d22,
+ hz1380 = 0x3be4,
+ hz1400 = 0x3a1b,
+ hz1450 = 0x3596,
+ hz1477 = 0x331c,
+ hz1500 = 0x30fb,
+ hz1600 = 0x278d,
+ hz1633 = 0x2462,
+ hz1638 = 0x23e7,
+ hz1645 = 0x233a,
+ hz1750 = 0x18f8,
+ hz1800 = 0x1405,
+ hz1860 = 0xe0b,
+ hz2100 = 0xf5f6,
+ hz2130 = 0xf2f5,
+ hz2450 = 0xd3b3,
+ hz2750 = 0xb8e4
+} IXJ_FREQ;
+
+typedef enum {
+ C1 = hz261,
+ CS1 = hz277,
+ D1 = hz293,
+ DS1 = hz311,
+ E1 = hz329,
+ F1 = hz349,
+ FS1 = hz369,
+ G1 = hz392,
+ GS1 = hz415,
+ A1 = hz440,
+ AS1 = hz466,
+ B1 = hz493,
+ C2 = hz523,
+ CS2 = hz554,
+ D2 = hz587,
+ DS2 = hz622,
+ E2 = hz659,
+ F2 = hz698,
+ FS2 = hz739,
+ G2 = hz783,
+ GS2 = hz830,
+ A2 = hz880,
+ AS2 = hz932,
+} IXJ_NOTE;
+
+typedef struct {
+ int tone_index;
+ int freq0;
+ int gain0;
+ int freq1;
+ int gain1;
+} IXJ_TONE;
+
+#define IXJCTL_INIT_TONE _IOW ('q', 0xC9, IXJ_TONE *)
+
+/******************************************************************************
+*
+* The IXJCTL_TONE_CADENCE ioctl defines tone sequences used for various
+* Call Progress Tones (CPT). This is accomplished by setting up an array of
+* IXJ_CADENCE_ELEMENT structures that sequentially define the states of
+* the tone sequence. The tone_on_time and tone_off time are in
+* 250 microsecond intervals. A pointer to this array is passed to the
+* driver as the ce element of an IXJ_CADENCE structure. The elements_used
+* must be set to the number of IXJ_CADENCE_ELEMENTS in the array. The
+* termination variable defines what to do at the end of a cadence, the
+* options are to play the cadence once and stop, to repeat the last
+* element of the cadence indefinitely, or to repeat the entire cadence
+* indefinitely. The ce variable is a pointer to the array of IXJ_TONE
+* structures. If the freq0 variable is non-zero, the tone table contents
+* for the tone_index are updated to the frequencies and gains defined. It
+* should be noted that DTMF tones cannot be reassigned, so if DTMF tone
+* table indexes are used in a cadence the frequency and gain variables will
+* be ignored.
+*
+* If the array elements contain frequency parameters the driver will
+* initialize the needed tone table elements and begin playing the tone,
+* there is no preset limit on the number of elements in the cadence. If
+* there is more than one frequency used in the cadence, sequential elements
+* of different frequencies MUST use different tone table indexes. Only one
+* cadence can be played at a time. It is possible to build complex
+* cadences with multiple frequencies using 2 tone table indexes by
+* alternating between them.
+*
+******************************************************************************/
+
+typedef struct {
+ int index;
+ int tone_on_time;
+ int tone_off_time;
+ int freq0;
+ int gain0;
+ int freq1;
+ int gain1;
+} IXJ_CADENCE_ELEMENT;
+
+typedef enum {
+ PLAY_ONCE,
+ REPEAT_LAST_ELEMENT,
+ REPEAT_ALL
+} IXJ_CADENCE_TERM;
+
+typedef struct {
+ int elements_used;
+ IXJ_CADENCE_TERM termination;
+ IXJ_CADENCE_ELEMENT *ce;
+} IXJ_CADENCE;
+
+#define IXJCTL_TONE_CADENCE _IOW ('q', 0xCA, IXJ_CADENCE *)
+/******************************************************************************
+*
+* This group of IOCTLs deal with the playback settings of the DSP
+*
+******************************************************************************/
+
+#define IXJCTL_PLAY_CODEC PHONE_PLAY_CODEC
+#define IXJCTL_PLAY_START PHONE_PLAY_START
+#define IXJCTL_PLAY_STOP PHONE_PLAY_STOP
+#define IXJCTL_PLAY_DEPTH PHONE_PLAY_DEPTH
+#define IXJCTL_PLAY_VOLUME PHONE_PLAY_VOLUME
+#define IXJCTL_PLAY_LEVEL PHONE_PLAY_LEVEL
+
+/******************************************************************************
+*
+* This group of IOCTLs deal with the Acoustic Echo Cancellation settings
+* of the DSP
+*
+* Issuing the IXJCTL_AEC_START command with a value of AEC_OFF has the
+* same effect as IXJCTL_AEC_STOP. This is to simplify slider bar
+* controls. IXJCTL_AEC_GET_LEVEL returns the current setting of the AEC.
+******************************************************************************/
+#define IXJCTL_AEC_START _IOW ('q', 0xCB, int)
+#define IXJCTL_AEC_STOP _IO ('q', 0xCC)
+#define IXJCTL_AEC_GET_LEVEL _IO ('q', 0xCD)
+
+#define AEC_OFF 0
+#define AEC_LOW 1
+#define AEC_MED 2
+#define AEC_HIGH 3
+#define AEC_AUTO 4
+#define AEC_AGC 5
+/******************************************************************************
+*
+* Call Progress Tones, DTMF, etc.
+* IXJCTL_DTMF_OOB determines if DTMF signaling is sent as Out-Of-Band
+* only. If you pass a 1, DTMF is suppressed from the audio stream.
+* Tone on and off times are in 250 microsecond intervals so
+* ioctl(ixj1, IXJCTL_SET_TONE_ON_TIME, 360);
+* will set the tone on time of board ixj1 to 360 * 250us = 90ms
+* the default values of tone on and off times is 840 or 210ms
+******************************************************************************/
+
+#define IXJCTL_DTMF_READY PHONE_DTMF_READY
+#define IXJCTL_GET_DTMF PHONE_GET_DTMF
+#define IXJCTL_GET_DTMF_ASCII PHONE_GET_DTMF_ASCII
+#define IXJCTL_DTMF_OOB PHONE_DTMF_OOB
+#define IXJCTL_EXCEPTION PHONE_EXCEPTION
+#define IXJCTL_PLAY_TONE PHONE_PLAY_TONE
+#define IXJCTL_SET_TONE_ON_TIME PHONE_SET_TONE_ON_TIME
+#define IXJCTL_SET_TONE_OFF_TIME PHONE_SET_TONE_OFF_TIME
+#define IXJCTL_GET_TONE_ON_TIME PHONE_GET_TONE_ON_TIME
+#define IXJCTL_GET_TONE_OFF_TIME PHONE_GET_TONE_OFF_TIME
+#define IXJCTL_GET_TONE_STATE PHONE_GET_TONE_STATE
+#define IXJCTL_BUSY PHONE_BUSY
+#define IXJCTL_RINGBACK PHONE_RINGBACK
+#define IXJCTL_DIALTONE PHONE_DIALTONE
+#define IXJCTL_CPT_STOP PHONE_CPT_STOP
+
+/******************************************************************************
+* LineJACK specific IOCTLs
+*
+* The lsb 4 bits of the LED argument represent the state of each of the 4
+* LED's on the LineJACK
+******************************************************************************/
+
+#define IXJCTL_SET_LED _IOW ('q', 0xCE, int)
+#define IXJCTL_MIXER _IOW ('q', 0xCF, int)
+
+/******************************************************************************
+*
+* The master volume controls use attenuation with 32 levels from 0 to -62dB
+* with steps of 2dB each, the defines should be OR'ed together then sent
+* as the parameter to the mixer command to change the mixer settings.
+*
+******************************************************************************/
+#define MIXER_MASTER_L 0x0000
+#define MIXER_MASTER_R 0x0100
+#define ATT00DB 0x00
+#define ATT02DB 0x01
+#define ATT04DB 0x02
+#define ATT06DB 0x03
+#define ATT08DB 0x04
+#define ATT10DB 0x05
+#define ATT12DB 0x06
+#define ATT14DB 0x07
+#define ATT16DB 0x08
+#define ATT18DB 0x09
+#define ATT20DB 0x0A
+#define ATT22DB 0x0B
+#define ATT24DB 0x0C
+#define ATT26DB 0x0D
+#define ATT28DB 0x0E
+#define ATT30DB 0x0F
+#define ATT32DB 0x10
+#define ATT34DB 0x11
+#define ATT36DB 0x12
+#define ATT38DB 0x13
+#define ATT40DB 0x14
+#define ATT42DB 0x15
+#define ATT44DB 0x16
+#define ATT46DB 0x17
+#define ATT48DB 0x18
+#define ATT50DB 0x19
+#define ATT52DB 0x1A
+#define ATT54DB 0x1B
+#define ATT56DB 0x1C
+#define ATT58DB 0x1D
+#define ATT60DB 0x1E
+#define ATT62DB 0x1F
+#define MASTER_MUTE 0x80
+
+/******************************************************************************
+*
+* The input volume controls use gain with 32 levels from +12dB to -50dB
+* with steps of 2dB each, the defines should be OR'ed together then sent
+* as the parameter to the mixer command to change the mixer settings.
+*
+******************************************************************************/
+#define MIXER_PORT_CD_L 0x0600
+#define MIXER_PORT_CD_R 0x0700
+#define MIXER_PORT_LINE_IN_L 0x0800
+#define MIXER_PORT_LINE_IN_R 0x0900
+#define MIXER_PORT_POTS_REC 0x0C00
+#define MIXER_PORT_MIC 0x0E00
+
+#define GAIN12DB 0x00
+#define GAIN10DB 0x01
+#define GAIN08DB 0x02
+#define GAIN06DB 0x03
+#define GAIN04DB 0x04
+#define GAIN02DB 0x05
+#define GAIN00DB 0x06
+#define GAIN_02DB 0x07
+#define GAIN_04DB 0x08
+#define GAIN_06DB 0x09
+#define GAIN_08DB 0x0A
+#define GAIN_10DB 0x0B
+#define GAIN_12DB 0x0C
+#define GAIN_14DB 0x0D
+#define GAIN_16DB 0x0E
+#define GAIN_18DB 0x0F
+#define GAIN_20DB 0x10
+#define GAIN_22DB 0x11
+#define GAIN_24DB 0x12
+#define GAIN_26DB 0x13
+#define GAIN_28DB 0x14
+#define GAIN_30DB 0x15
+#define GAIN_32DB 0x16
+#define GAIN_34DB 0x17
+#define GAIN_36DB 0x18
+#define GAIN_38DB 0x19
+#define GAIN_40DB 0x1A
+#define GAIN_42DB 0x1B
+#define GAIN_44DB 0x1C
+#define GAIN_46DB 0x1D
+#define GAIN_48DB 0x1E
+#define GAIN_50DB 0x1F
+#define INPUT_MUTE 0x80
+
+/******************************************************************************
+*
+* The POTS volume control use attenuation with 8 levels from 0dB to -28dB
+* with steps of 4dB each, the defines should be OR'ed together then sent
+* as the parameter to the mixer command to change the mixer settings.
+*
+******************************************************************************/
+#define MIXER_PORT_POTS_PLAY 0x0F00
+
+#define POTS_ATT_00DB 0x00
+#define POTS_ATT_04DB 0x01
+#define POTS_ATT_08DB 0x02
+#define POTS_ATT_12DB 0x03
+#define POTS_ATT_16DB 0x04
+#define POTS_ATT_20DB 0x05
+#define POTS_ATT_24DB 0x06
+#define POTS_ATT_28DB 0x07
+#define POTS_MUTE 0x80
+
+/******************************************************************************
+*
+* The DAA controls the interface to the PSTN port. The driver loads the
+* US coefficients by default, so if you live in a different country you
+* need to load the set for your countries phone system.
+*
+******************************************************************************/
+#define IXJCTL_DAA_COEFF_SET _IOW ('q', 0xD0, int)
+
+#define DAA_US 1 /*PITA 8kHz */
+#define DAA_UK 2 /*ISAR34 8kHz */
+#define DAA_FRANCE 3 /* */
+#define DAA_GERMANY 4
+#define DAA_AUSTRALIA 5
+#define DAA_JAPAN 6
+
+/******************************************************************************
+*
+* Use IXJCTL_PORT to set or query the port the card is set to. If the
+* argument is set to PORT_QUERY, the return value of the ioctl will
+* indicate which port is currently in use, otherwise it will change the
+* port.
+*
+******************************************************************************/
+#define IXJCTL_PORT _IOW ('q', 0xD1, int)
+
+#define PORT_QUERY 0
+#define PORT_POTS 1
+#define PORT_PSTN 2
+#define PORT_SPEAKER 3
+#define PORT_HANDSET 4
+
+#define IXJCTL_PSTN_SET_STATE PHONE_PSTN_SET_STATE
+#define IXJCTL_PSTN_GET_STATE PHONE_PSTN_GET_STATE
+
+#define PSTN_ON_HOOK 0
+#define PSTN_RINGING 1
+#define PSTN_OFF_HOOK 2
+#define PSTN_PULSE_DIAL 3
+
+/******************************************************************************
+*
+* The DAA Analog GAIN sets 2 parameters at one time, the receive gain (AGRR),
+* and the transmit gain (AGX). OR together the components and pass them
+* as the parameter to IXJCTL_DAA_AGAIN. The default setting is both at 0dB.
+*
+******************************************************************************/
+#define IXJCTL_DAA_AGAIN _IOW ('q', 0xD2, int)
+
+#define AGRR00DB 0x00 /* Analog gain in receive direction 0dB */
+#define AGRR3_5DB 0x10 /* Analog gain in receive direction 3.5dB */
+#define AGRR06DB 0x30 /* Analog gain in receive direction 6dB */
+
+#define AGX00DB 0x00 /* Analog gain in transmit direction 0dB */
+#define AGX_6DB 0x04 /* Analog gain in transmit direction -6dB */
+#define AGX3_5DB 0x08 /* Analog gain in transmit direction 3.5dB */
+#define AGX_2_5B 0x0C /* Analog gain in transmit direction -2.5dB */
+
+#define IXJCTL_PSTN_LINETEST _IO ('q', 0xD3)
+
+#define IXJCTL_CID _IOR ('q', 0xD4, PHONE_CID *)
+#define IXJCTL_VMWI _IOR ('q', 0xD8, int)
+#define IXJCTL_CIDCW _IOW ('q', 0xD9, PHONE_CID *)
+/******************************************************************************
+*
+* The wink duration is tunable with this ioctl. The default wink duration
+* is 320ms. You do not need to use this ioctl if you do not require a
+* different wink duration.
+*
+******************************************************************************/
+#define IXJCTL_WINK_DURATION PHONE_WINK_DURATION
+
+/******************************************************************************
+*
+* This ioctl will connect the POTS port to the PSTN port on the LineJACK
+* In order for this to work properly the port selection should be set to
+* the PSTN port with IXJCTL_PORT prior to calling this ioctl. This will
+* enable conference calls between PSTN callers and network callers.
+* Passing a 1 to this ioctl enables the POTS<->PSTN connection while
+* passing a 0 turns it back off.
+*
+******************************************************************************/
+#define IXJCTL_POTS_PSTN _IOW ('q', 0xD5, int)
+
+/******************************************************************************
+*
+* IOCTLs added by request.
+*
+* IXJCTL_HZ sets the value your Linux kernel uses for HZ as defined in
+* /usr/include/asm/param.h, this determines the fundamental
+* frequency of the clock ticks on your Linux system. The kernel
+* must be rebuilt if you change this value, also all modules you
+* use (except this one) must be recompiled. The default value
+* is 100, and you only need to use this IOCTL if you use some
+* other value.
+*
+*
+* IXJCTL_RATE sets the number of times per second that the driver polls
+* the DSP. This value cannot be larger than HZ. By
+* increasing both of these values, you may be able to reduce
+* latency because the max hang time that can exist between the
+* driver and the DSP will be reduced.
+*
+******************************************************************************/
+
+#define IXJCTL_HZ _IOW ('q', 0xE0, int)
+#define IXJCTL_RATE _IOW ('q', 0xE1, int)
+#define IXJCTL_FRAMES_READ _IOR ('q', 0xE2, unsigned long)
+#define IXJCTL_FRAMES_WRITTEN _IOR ('q', 0xE3, unsigned long)
+#define IXJCTL_READ_WAIT _IOR ('q', 0xE4, unsigned long)
+#define IXJCTL_WRITE_WAIT _IOR ('q', 0xE5, unsigned long)
+#define IXJCTL_DRYBUFFER_READ _IOR ('q', 0xE6, unsigned long)
+#define IXJCTL_DRYBUFFER_CLEAR _IO ('q', 0xE7)
+#define IXJCTL_DTMF_PRESCALE _IOW ('q', 0xE8, int)
+
+/******************************************************************************
+*
+* This ioctl allows the user application to control what events the driver
+* will send signals for, and what signals it will send for which event.
+* By default, if signaling is enabled, all events will send SIGIO when
+* they occur. To disable signals for an event set the signal to 0.
+*
+******************************************************************************/
+typedef enum {
+ SIG_DTMF_READY,
+ SIG_HOOKSTATE,
+ SIG_FLASH,
+ SIG_PSTN_RING,
+ SIG_CALLER_ID,
+ SIG_PSTN_WINK,
+ SIG_F0, SIG_F1, SIG_F2, SIG_F3,
+ SIG_FC0, SIG_FC1, SIG_FC2, SIG_FC3,
+ SIG_READ_READY = 33,
+ SIG_WRITE_READY = 34
+} IXJ_SIGEVENT;
+
+typedef struct {
+ unsigned int event;
+ int signal;
+} IXJ_SIGDEF;
+
+#define IXJCTL_SIGCTL _IOW ('q', 0xE9, IXJ_SIGDEF *)
+
+/******************************************************************************
+*
+* These ioctls allow the user application to change the gain in the
+* Smart Cable of the Internet Phone Card. Sending -1 as a value will cause
+* return value to be the current setting. Valid values to set are 0x00 - 0x1F
+*
+* 11111 = +12 dB
+* 10111 = 0 dB
+* 00000 = -34.5 dB
+*
+* IXJCTL_SC_RXG sets the Receive gain
+* IXJCTL_SC_TXG sets the Transmit gain
+*
+******************************************************************************/
+#define IXJCTL_SC_RXG _IOW ('q', 0xEA, int)
+#define IXJCTL_SC_TXG _IOW ('q', 0xEB, int)
+
+/******************************************************************************
+*
+* The intercom IOCTL's short the output from one card to the input of the
+* other and vice versa (actually done in the DSP read function). It is only
+* necessary to execute the IOCTL on one card, but it is necessary to have
+* both devices open to be able to detect hook switch changes. The record
+* codec and rate of each card must match the playback codec and rate of
+* the other card for this to work properly.
+*
+******************************************************************************/
+
+#define IXJCTL_INTERCOM_START _IOW ('q', 0xFD, int)
+#define IXJCTL_INTERCOM_STOP _IOW ('q', 0xFE, int)
+
+/******************************************************************************
+ *
+ * new structure for accessing raw filter information
+ *
+ ******************************************************************************/
+
+typedef struct {
+ unsigned int filter;
+ char enable;
+ unsigned int coeff[19];
+} IXJ_FILTER_RAW;
+
+#endif
diff --git a/sysroot/usr/include/linux/jbd.h b/sysroot/usr/include/linux/jbd.h
new file mode 100644
index 0000000..944e9d1
--- /dev/null
+++ b/sysroot/usr/include/linux/jbd.h
@@ -0,0 +1,247 @@
+/*
+ * linux/include/linux/jbd.h
+ *
+ * Written by Stephen C. Tweedie <sct@redhat.com>
+ *
+ * Copyright 1998-2000 Red Hat, Inc --- All Rights Reserved
+ *
+ * This file is part of the Linux kernel and is made available under
+ * the terms of the GNU General Public License, version 2, or at your
+ * option, any later version, incorporated herein by reference.
+ *
+ * Definitions for transaction data structures for the buffer cache
+ * filesystem journaling support.
+ */
+
+#ifndef _LINUX_JBD_H
+#define _LINUX_JBD_H
+
+/* Allow this file to be included directly into e2fsprogs */
+#include "jfs_compat.h"
+#define JFS_DEBUG
+#define jfs_debug jbd_debug
+
+#define journal_oom_retry 1
+
+/*
+ * Define JBD_PARANIOD_IOFAIL to cause a kernel BUG() if ext3 finds
+ * certain classes of error which can occur due to failed IOs. Under
+ * normal use we want ext3 to continue after such errors, because
+ * hardware _can_ fail, but for debugging purposes when running tests on
+ * known-good hardware we may want to trap these errors.
+ */
+#undef JBD_PARANOID_IOFAIL
+
+/*
+ * The default maximum commit age, in seconds.
+ */
+#define JBD_DEFAULT_MAX_COMMIT_AGE 5
+
+#ifdef CONFIG_JBD_DEBUG
+/*
+ * Define JBD_EXPENSIVE_CHECKING to enable more expensive internal
+ * consistency checks. By default we don't do this unless
+ * CONFIG_JBD_DEBUG is on.
+ */
+#define JBD_EXPENSIVE_CHECKING
+extern u8 journal_enable_debug;
+
+#define jbd_debug(n, f, a...) \
+ do { \
+ if ((n) <= journal_enable_debug) { \
+ printk (KERN_DEBUG "(%s, %d): %s: ", \
+ __FILE__, __LINE__, __FUNCTION__); \
+ printk (f, ## a); \
+ } \
+ } while (0)
+#else
+#define jbd_debug(f, a...) /**/
+#endif
+
+static __inline__ void *jbd_alloc(size_t size, gfp_t flags)
+{
+ return (void *)__get_free_pages(flags, get_order(size));
+}
+
+static __inline__ void jbd_free(void *ptr, size_t size)
+{
+ free_pages((unsigned long)ptr, get_order(size));
+};
+
+#define JFS_MIN_JOURNAL_BLOCKS 1024
+
+
+/*
+ * Internal structures used by the logging mechanism:
+ */
+
+#define JFS_MAGIC_NUMBER 0xc03b3998U /* The first 4 bytes of /dev/random! */
+
+/*
+ * On-disk structures
+ */
+
+/*
+ * Descriptor block types:
+ */
+
+#define JFS_DESCRIPTOR_BLOCK 1
+#define JFS_COMMIT_BLOCK 2
+#define JFS_SUPERBLOCK_V1 3
+#define JFS_SUPERBLOCK_V2 4
+#define JFS_REVOKE_BLOCK 5
+
+/*
+ * Standard header for all descriptor blocks:
+ */
+typedef struct journal_header_s
+{
+ __be32 h_magic;
+ __be32 h_blocktype;
+ __be32 h_sequence;
+} journal_header_t;
+
+
+/*
+ * The block tag: used to describe a single buffer in the journal
+ */
+typedef struct journal_block_tag_s
+{
+ __be32 t_blocknr; /* The on-disk block number */
+ __be32 t_flags; /* See below */
+} journal_block_tag_t;
+
+/*
+ * The revoke descriptor: used on disk to describe a series of blocks to
+ * be revoked from the log
+ */
+typedef struct journal_revoke_header_s
+{
+ journal_header_t r_header;
+ __be32 r_count; /* Count of bytes used in the block */
+} journal_revoke_header_t;
+
+
+/* Definitions for the journal tag flags word: */
+#define JFS_FLAG_ESCAPE 1 /* on-disk block is escaped */
+#define JFS_FLAG_SAME_UUID 2 /* block has same uuid as previous */
+#define JFS_FLAG_DELETED 4 /* block deleted by this transaction */
+#define JFS_FLAG_LAST_TAG 8 /* last tag in this descriptor block */
+
+
+/*
+ * The journal superblock. All fields are in big-endian byte order.
+ */
+typedef struct journal_superblock_s
+{
+/* 0x0000 */
+ journal_header_t s_header;
+
+/* 0x000C */
+ /* Static information describing the journal */
+ __be32 s_blocksize; /* journal device blocksize */
+ __be32 s_maxlen; /* total blocks in journal file */
+ __be32 s_first; /* first block of log information */
+
+/* 0x0018 */
+ /* Dynamic information describing the current state of the log */
+ __be32 s_sequence; /* first commit ID expected in log */
+ __be32 s_start; /* blocknr of start of log */
+
+/* 0x0020 */
+ /* Error value, as set by journal_abort(). */
+ __be32 s_errno;
+
+/* 0x0024 */
+ /* Remaining fields are only valid in a version-2 superblock */
+ __be32 s_feature_compat; /* compatible feature set */
+ __be32 s_feature_incompat; /* incompatible feature set */
+ __be32 s_feature_ro_compat; /* readonly-compatible feature set */
+/* 0x0030 */
+ __u8 s_uuid[16]; /* 128-bit uuid for journal */
+
+/* 0x0040 */
+ __be32 s_nr_users; /* Nr of filesystems sharing log */
+
+ __be32 s_dynsuper; /* Blocknr of dynamic superblock copy*/
+
+/* 0x0048 */
+ __be32 s_max_transaction; /* Limit of journal blocks per trans.*/
+ __be32 s_max_trans_data; /* Limit of data blocks per trans. */
+
+/* 0x0050 */
+ __u32 s_padding[44];
+
+/* 0x0100 */
+ __u8 s_users[16*48]; /* ids of all fs'es sharing the log */
+/* 0x0400 */
+} journal_superblock_t;
+
+#define JFS_HAS_COMPAT_FEATURE(j,mask) \
+ ((j)->j_format_version >= 2 && \
+ ((j)->j_superblock->s_feature_compat & cpu_to_be32((mask))))
+#define JFS_HAS_RO_COMPAT_FEATURE(j,mask) \
+ ((j)->j_format_version >= 2 && \
+ ((j)->j_superblock->s_feature_ro_compat & cpu_to_be32((mask))))
+#define JFS_HAS_INCOMPAT_FEATURE(j,mask) \
+ ((j)->j_format_version >= 2 && \
+ ((j)->j_superblock->s_feature_incompat & cpu_to_be32((mask))))
+
+#define JFS_FEATURE_INCOMPAT_REVOKE 0x00000001
+
+/* Features known to this kernel version: */
+#define JFS_KNOWN_COMPAT_FEATURES 0
+#define JFS_KNOWN_ROCOMPAT_FEATURES 0
+#define JFS_KNOWN_INCOMPAT_FEATURES JFS_FEATURE_INCOMPAT_REVOKE
+
+
+/* Comparison functions for transaction IDs: perform comparisons using
+ * modulo arithmetic so that they work over sequence number wraps. */
+
+static __inline__ int tid_gt(tid_t x, tid_t y)
+{
+ int difference = (x - y);
+ return (difference > 0);
+}
+
+static __inline__ int tid_geq(tid_t x, tid_t y)
+{
+ int difference = (x - y);
+ return (difference >= 0);
+}
+
+extern int journal_blocks_per_page(struct inode *inode);
+
+/*
+ * Return the minimum number of blocks which must be free in the journal
+ * before a new transaction may be started. Must be called under j_state_lock.
+ */
+static __inline__ int jbd_space_needed(journal_t *journal)
+{
+ int nblocks = journal->j_max_transaction_buffers;
+ if (journal->j_committing_transaction)
+ nblocks += journal->j_committing_transaction->
+ t_outstanding_credits;
+ return nblocks;
+}
+
+/*
+ * Definitions which augment the buffer_head layer
+ */
+
+/* journaling buffer types */
+#define BJ_None 0 /* Not journaled */
+#define BJ_SyncData 1 /* Normal data: flush before commit */
+#define BJ_Metadata 2 /* Normal journaled metadata */
+#define BJ_Forget 3 /* Buffer superseded by this transaction */
+#define BJ_IO 4 /* Buffer is for temporary IO use */
+#define BJ_Shadow 5 /* Buffer contents being shadowed to the log */
+#define BJ_LogCtl 6 /* Buffer contains log descriptors */
+#define BJ_Reserved 7 /* Buffer is reserved for access by journal */
+#define BJ_Locked 8 /* Locked for I/O during commit */
+#define BJ_Types 9
+
+extern int jbd_blocks_per_page(struct inode *inode);
+
+
+#endif /* _LINUX_JBD_H */
diff --git a/sysroot/usr/include/linux/jffs2.h b/sysroot/usr/include/linux/jffs2.h
new file mode 100644
index 0000000..6b563ca
--- /dev/null
+++ b/sysroot/usr/include/linux/jffs2.h
@@ -0,0 +1,224 @@
+/*
+ * JFFS2 -- Journalling Flash File System, Version 2.
+ *
+ * Copyright (C) 2001-2003 Red Hat, Inc.
+ *
+ * Created by David Woodhouse <dwmw2@infradead.org>
+ *
+ * For licensing information, see the file 'LICENCE' in the
+ * jffs2 directory.
+ *
+ * $Id: jffs2.h,v 1.38 2005/09/26 11:37:23 havasi Exp $
+ *
+ */
+
+#ifndef __LINUX_JFFS2_H__
+#define __LINUX_JFFS2_H__
+
+#include <linux/magic.h>
+
+/* You must include something which defines the C99 uintXX_t types.
+ We don't do it from here because this file is used in too many
+ different environments. */
+
+/* Values we may expect to find in the 'magic' field */
+#define JFFS2_OLD_MAGIC_BITMASK 0x1984
+#define JFFS2_MAGIC_BITMASK 0x1985
+#define KSAMTIB_CIGAM_2SFFJ 0x8519 /* For detecting wrong-endian fs */
+#define JFFS2_EMPTY_BITMASK 0xffff
+#define JFFS2_DIRTY_BITMASK 0x0000
+
+/* Summary node MAGIC marker */
+#define JFFS2_SUM_MAGIC 0x02851885
+
+/* We only allow a single char for length, and 0xFF is empty flash so
+ we don't want it confused with a real length. Hence max 254.
+*/
+#define JFFS2_MAX_NAME_LEN 254
+
+/* How small can we sensibly write nodes? */
+#define JFFS2_MIN_DATA_LEN 128
+
+#define JFFS2_COMPR_NONE 0x00
+#define JFFS2_COMPR_ZERO 0x01
+#define JFFS2_COMPR_RTIME 0x02
+#define JFFS2_COMPR_RUBINMIPS 0x03
+#define JFFS2_COMPR_COPY 0x04
+#define JFFS2_COMPR_DYNRUBIN 0x05
+#define JFFS2_COMPR_ZLIB 0x06
+#define JFFS2_COMPR_LZO 0x07
+/* Compatibility flags. */
+#define JFFS2_COMPAT_MASK 0xc000 /* What do to if an unknown nodetype is found */
+#define JFFS2_NODE_ACCURATE 0x2000
+/* INCOMPAT: Fail to mount the filesystem */
+#define JFFS2_FEATURE_INCOMPAT 0xc000
+/* ROCOMPAT: Mount read-only */
+#define JFFS2_FEATURE_ROCOMPAT 0x8000
+/* RWCOMPAT_COPY: Mount read/write, and copy the node when it's GC'd */
+#define JFFS2_FEATURE_RWCOMPAT_COPY 0x4000
+/* RWCOMPAT_DELETE: Mount read/write, and delete the node when it's GC'd */
+#define JFFS2_FEATURE_RWCOMPAT_DELETE 0x0000
+
+#define JFFS2_NODETYPE_DIRENT (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 1)
+#define JFFS2_NODETYPE_INODE (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 2)
+#define JFFS2_NODETYPE_CLEANMARKER (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3)
+#define JFFS2_NODETYPE_PADDING (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 4)
+
+#define JFFS2_NODETYPE_SUMMARY (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 6)
+
+#define JFFS2_NODETYPE_XATTR (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 8)
+#define JFFS2_NODETYPE_XREF (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 9)
+
+/* XATTR Related */
+#define JFFS2_XPREFIX_USER 1 /* for "user." */
+#define JFFS2_XPREFIX_SECURITY 2 /* for "security." */
+#define JFFS2_XPREFIX_ACL_ACCESS 3 /* for "system.posix_acl_access" */
+#define JFFS2_XPREFIX_ACL_DEFAULT 4 /* for "system.posix_acl_default" */
+#define JFFS2_XPREFIX_TRUSTED 5 /* for "trusted.*" */
+
+#define JFFS2_ACL_VERSION 0x0001
+
+// Maybe later...
+//#define JFFS2_NODETYPE_CHECKPOINT (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3)
+//#define JFFS2_NODETYPE_OPTIONS (JFFS2_FEATURE_RWCOMPAT_COPY | JFFS2_NODE_ACCURATE | 4)
+
+
+#define JFFS2_INO_FLAG_PREREAD 1 /* Do read_inode() for this one at
+ mount time, don't wait for it to
+ happen later */
+#define JFFS2_INO_FLAG_USERCOMPR 2 /* User has requested a specific
+ compression type */
+
+
+/* These can go once we've made sure we've caught all uses without
+ byteswapping */
+
+typedef struct {
+ uint32_t v32;
+} __attribute__((packed)) jint32_t;
+
+typedef struct {
+ uint32_t m;
+} __attribute__((packed)) jmode_t;
+
+typedef struct {
+ uint16_t v16;
+} __attribute__((packed)) jint16_t;
+
+struct jffs2_unknown_node
+{
+ /* All start like this */
+ jint16_t magic;
+ jint16_t nodetype;
+ jint32_t totlen; /* So we can skip over nodes we don't grok */
+ jint32_t hdr_crc;
+};
+
+struct jffs2_raw_dirent
+{
+ jint16_t magic;
+ jint16_t nodetype; /* == JFFS2_NODETYPE_DIRENT */
+ jint32_t totlen;
+ jint32_t hdr_crc;
+ jint32_t pino;
+ jint32_t version;
+ jint32_t ino; /* == zero for unlink */
+ jint32_t mctime;
+ uint8_t nsize;
+ uint8_t type;
+ uint8_t unused[2];
+ jint32_t node_crc;
+ jint32_t name_crc;
+ uint8_t name[0];
+};
+
+/* The JFFS2 raw inode structure: Used for storage on physical media. */
+/* The uid, gid, atime, mtime and ctime members could be longer, but
+ are left like this for space efficiency. If and when people decide
+ they really need them extended, it's simple enough to add support for
+ a new type of raw node.
+*/
+struct jffs2_raw_inode
+{
+ jint16_t magic; /* A constant magic number. */
+ jint16_t nodetype; /* == JFFS2_NODETYPE_INODE */
+ jint32_t totlen; /* Total length of this node (inc data, etc.) */
+ jint32_t hdr_crc;
+ jint32_t ino; /* Inode number. */
+ jint32_t version; /* Version number. */
+ jmode_t mode; /* The file's type or mode. */
+ jint16_t uid; /* The file's owner. */
+ jint16_t gid; /* The file's group. */
+ jint32_t isize; /* Total resultant size of this inode (used for truncations) */
+ jint32_t atime; /* Last access time. */
+ jint32_t mtime; /* Last modification time. */
+ jint32_t ctime; /* Change time. */
+ jint32_t offset; /* Where to begin to write. */
+ jint32_t csize; /* (Compressed) data size */
+ jint32_t dsize; /* Size of the node's data. (after decompression) */
+ uint8_t compr; /* Compression algorithm used */
+ uint8_t usercompr; /* Compression algorithm requested by the user */
+ jint16_t flags; /* See JFFS2_INO_FLAG_* */
+ jint32_t data_crc; /* CRC for the (compressed) data. */
+ jint32_t node_crc; /* CRC for the raw inode (excluding data) */
+ uint8_t data[0];
+};
+
+struct jffs2_raw_xattr {
+ jint16_t magic;
+ jint16_t nodetype; /* = JFFS2_NODETYPE_XATTR */
+ jint32_t totlen;
+ jint32_t hdr_crc;
+ jint32_t xid; /* XATTR identifier number */
+ jint32_t version;
+ uint8_t xprefix;
+ uint8_t name_len;
+ jint16_t value_len;
+ jint32_t data_crc;
+ jint32_t node_crc;
+ uint8_t data[0];
+} __attribute__((packed));
+
+struct jffs2_raw_xref
+{
+ jint16_t magic;
+ jint16_t nodetype; /* = JFFS2_NODETYPE_XREF */
+ jint32_t totlen;
+ jint32_t hdr_crc;
+ jint32_t ino; /* inode number */
+ jint32_t xid; /* XATTR identifier number */
+ jint32_t xseqno; /* xref sequencial number */
+ jint32_t node_crc;
+} __attribute__((packed));
+
+struct jffs2_raw_summary
+{
+ jint16_t magic;
+ jint16_t nodetype; /* = JFFS2_NODETYPE_SUMMARY */
+ jint32_t totlen;
+ jint32_t hdr_crc;
+ jint32_t sum_num; /* number of sum entries*/
+ jint32_t cln_mkr; /* clean marker size, 0 = no cleanmarker */
+ jint32_t padded; /* sum of the size of padding nodes */
+ jint32_t sum_crc; /* summary information crc */
+ jint32_t node_crc; /* node crc */
+ jint32_t sum[0]; /* inode summary info */
+};
+
+union jffs2_node_union
+{
+ struct jffs2_raw_inode i;
+ struct jffs2_raw_dirent d;
+ struct jffs2_raw_xattr x;
+ struct jffs2_raw_xref r;
+ struct jffs2_raw_summary s;
+ struct jffs2_unknown_node u;
+};
+
+/* Data payload for device nodes. */
+union jffs2_device_node {
+ jint16_t old;
+ jint32_t new;
+};
+
+#endif /* __LINUX_JFFS2_H__ */
diff --git a/sysroot/usr/include/linux/joystick.h b/sysroot/usr/include/linux/joystick.h
new file mode 100644
index 0000000..3ba4ced
--- /dev/null
+++ b/sysroot/usr/include/linux/joystick.h
@@ -0,0 +1,138 @@
+#ifndef _LINUX_JOYSTICK_H
+#define _LINUX_JOYSTICK_H
+
+/*
+ * $Id: joystick.h,v 1.3 2000/11/30 11:07:05 vojtech Exp $
+ *
+ * Copyright (C) 1996-2000 Vojtech Pavlik
+ *
+ * Sponsored by SuSE
+ */
+
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Should you need to contact me, the author, you can do so either by
+ * e-mail - mail your message to <vojtech@suse.cz>, or by paper mail:
+ * Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic
+ */
+
+#include <asm/types.h>
+#include <linux/input.h>
+
+/*
+ * Version
+ */
+
+#define JS_VERSION 0x020100
+
+/*
+ * Types and constants for reading from /dev/js
+ */
+
+#define JS_EVENT_BUTTON 0x01 /* button pressed/released */
+#define JS_EVENT_AXIS 0x02 /* joystick moved */
+#define JS_EVENT_INIT 0x80 /* initial state of device */
+
+struct js_event {
+ __u32 time; /* event timestamp in milliseconds */
+ __s16 value; /* value */
+ __u8 type; /* event type */
+ __u8 number; /* axis/button number */
+};
+
+/*
+ * IOCTL commands for joystick driver
+ */
+
+#define JSIOCGVERSION _IOR('j', 0x01, __u32) /* get driver version */
+
+#define JSIOCGAXES _IOR('j', 0x11, __u8) /* get number of axes */
+#define JSIOCGBUTTONS _IOR('j', 0x12, __u8) /* get number of buttons */
+#define JSIOCGNAME(len) _IOC(_IOC_READ, 'j', 0x13, len) /* get identifier string */
+
+#define JSIOCSCORR _IOW('j', 0x21, struct js_corr) /* set correction values */
+#define JSIOCGCORR _IOR('j', 0x22, struct js_corr) /* get correction values */
+
+#define JSIOCSAXMAP _IOW('j', 0x31, __u8[ABS_MAX + 1]) /* set axis mapping */
+#define JSIOCGAXMAP _IOR('j', 0x32, __u8[ABS_MAX + 1]) /* get axis mapping */
+#define JSIOCSBTNMAP _IOW('j', 0x33, __u16[KEY_MAX - BTN_MISC + 1]) /* set button mapping */
+#define JSIOCGBTNMAP _IOR('j', 0x34, __u16[KEY_MAX - BTN_MISC + 1]) /* get button mapping */
+
+/*
+ * Types and constants for get/set correction
+ */
+
+#define JS_CORR_NONE 0x00 /* returns raw values */
+#define JS_CORR_BROKEN 0x01 /* broken line */
+
+struct js_corr {
+ __s32 coef[8];
+ __s16 prec;
+ __u16 type;
+};
+
+/*
+ * v0.x compatibility definitions
+ */
+
+#define JS_RETURN sizeof(struct JS_DATA_TYPE)
+#define JS_TRUE 1
+#define JS_FALSE 0
+#define JS_X_0 0x01
+#define JS_Y_0 0x02
+#define JS_X_1 0x04
+#define JS_Y_1 0x08
+#define JS_MAX 2
+
+#define JS_DEF_TIMEOUT 0x1300
+#define JS_DEF_CORR 0
+#define JS_DEF_TIMELIMIT 10L
+
+#define JS_SET_CAL 1
+#define JS_GET_CAL 2
+#define JS_SET_TIMEOUT 3
+#define JS_GET_TIMEOUT 4
+#define JS_SET_TIMELIMIT 5
+#define JS_GET_TIMELIMIT 6
+#define JS_GET_ALL 7
+#define JS_SET_ALL 8
+
+struct JS_DATA_TYPE {
+ __s32 buttons;
+ __s32 x;
+ __s32 y;
+};
+
+struct JS_DATA_SAVE_TYPE_32 {
+ __s32 JS_TIMEOUT;
+ __s32 BUSY;
+ __s32 JS_EXPIRETIME;
+ __s32 JS_TIMELIMIT;
+ struct JS_DATA_TYPE JS_SAVE;
+ struct JS_DATA_TYPE JS_CORR;
+};
+
+struct JS_DATA_SAVE_TYPE_64 {
+ __s32 JS_TIMEOUT;
+ __s32 BUSY;
+ __s64 JS_EXPIRETIME;
+ __s64 JS_TIMELIMIT;
+ struct JS_DATA_TYPE JS_SAVE;
+ struct JS_DATA_TYPE JS_CORR;
+};
+
+
+#endif /* _LINUX_JOYSTICK_H */
diff --git a/sysroot/usr/include/linux/kd.h b/sysroot/usr/include/linux/kd.h
new file mode 100644
index 0000000..80e372c
--- /dev/null
+++ b/sysroot/usr/include/linux/kd.h
@@ -0,0 +1,181 @@
+#ifndef _LINUX_KD_H
+#define _LINUX_KD_H
+#include <linux/types.h>
+
+/* 0x4B is 'K', to avoid collision with termios and vt */
+
+#define GIO_FONT 0x4B60 /* gets font in expanded form */
+#define PIO_FONT 0x4B61 /* use font in expanded form */
+
+#define GIO_FONTX 0x4B6B /* get font using struct consolefontdesc */
+#define PIO_FONTX 0x4B6C /* set font using struct consolefontdesc */
+struct consolefontdesc {
+ unsigned short charcount; /* characters in font (256 or 512) */
+ unsigned short charheight; /* scan lines per character (1-32) */
+ char *chardata; /* font data in expanded form */
+};
+
+#define PIO_FONTRESET 0x4B6D /* reset to default font */
+
+#define GIO_CMAP 0x4B70 /* gets colour palette on VGA+ */
+#define PIO_CMAP 0x4B71 /* sets colour palette on VGA+ */
+
+#define KIOCSOUND 0x4B2F /* start sound generation (0 for off) */
+#define KDMKTONE 0x4B30 /* generate tone */
+
+#define KDGETLED 0x4B31 /* return current led state */
+#define KDSETLED 0x4B32 /* set led state [lights, not flags] */
+#define LED_SCR 0x01 /* scroll lock led */
+#define LED_NUM 0x02 /* num lock led */
+#define LED_CAP 0x04 /* caps lock led */
+
+#define KDGKBTYPE 0x4B33 /* get keyboard type */
+#define KB_84 0x01
+#define KB_101 0x02 /* this is what we always answer */
+#define KB_OTHER 0x03
+
+#define KDADDIO 0x4B34 /* add i/o port as valid */
+#define KDDELIO 0x4B35 /* del i/o port as valid */
+#define KDENABIO 0x4B36 /* enable i/o to video board */
+#define KDDISABIO 0x4B37 /* disable i/o to video board */
+
+#define KDSETMODE 0x4B3A /* set text/graphics mode */
+#define KD_TEXT 0x00
+#define KD_GRAPHICS 0x01
+#define KD_TEXT0 0x02 /* obsolete */
+#define KD_TEXT1 0x03 /* obsolete */
+#define KDGETMODE 0x4B3B /* get current mode */
+
+#define KDMAPDISP 0x4B3C /* map display into address space */
+#define KDUNMAPDISP 0x4B3D /* unmap display from address space */
+
+typedef char scrnmap_t;
+#define E_TABSZ 256
+#define GIO_SCRNMAP 0x4B40 /* get screen mapping from kernel */
+#define PIO_SCRNMAP 0x4B41 /* put screen mapping table in kernel */
+#define GIO_UNISCRNMAP 0x4B69 /* get full Unicode screen mapping */
+#define PIO_UNISCRNMAP 0x4B6A /* set full Unicode screen mapping */
+
+#define GIO_UNIMAP 0x4B66 /* get unicode-to-font mapping from kernel */
+struct unipair {
+ unsigned short unicode;
+ unsigned short fontpos;
+};
+struct unimapdesc {
+ unsigned short entry_ct;
+ struct unipair *entries;
+};
+#define PIO_UNIMAP 0x4B67 /* put unicode-to-font mapping in kernel */
+#define PIO_UNIMAPCLR 0x4B68 /* clear table, possibly advise hash algorithm */
+struct unimapinit {
+ unsigned short advised_hashsize; /* 0 if no opinion */
+ unsigned short advised_hashstep; /* 0 if no opinion */
+ unsigned short advised_hashlevel; /* 0 if no opinion */
+};
+
+#define UNI_DIRECT_BASE 0xF000 /* start of Direct Font Region */
+#define UNI_DIRECT_MASK 0x01FF /* Direct Font Region bitmask */
+
+#define K_RAW 0x00
+#define K_XLATE 0x01
+#define K_MEDIUMRAW 0x02
+#define K_UNICODE 0x03
+#define KDGKBMODE 0x4B44 /* gets current keyboard mode */
+#define KDSKBMODE 0x4B45 /* sets current keyboard mode */
+
+#define K_METABIT 0x03
+#define K_ESCPREFIX 0x04
+#define KDGKBMETA 0x4B62 /* gets meta key handling mode */
+#define KDSKBMETA 0x4B63 /* sets meta key handling mode */
+
+#define K_SCROLLLOCK 0x01
+#define K_NUMLOCK 0x02
+#define K_CAPSLOCK 0x04
+#define KDGKBLED 0x4B64 /* get led flags (not lights) */
+#define KDSKBLED 0x4B65 /* set led flags (not lights) */
+
+struct kbentry {
+ unsigned char kb_table;
+ unsigned char kb_index;
+ unsigned short kb_value;
+};
+#define K_NORMTAB 0x00
+#define K_SHIFTTAB 0x01
+#define K_ALTTAB 0x02
+#define K_ALTSHIFTTAB 0x03
+
+#define KDGKBENT 0x4B46 /* gets one entry in translation table */
+#define KDSKBENT 0x4B47 /* sets one entry in translation table */
+
+struct kbsentry {
+ unsigned char kb_func;
+ unsigned char kb_string[512];
+};
+#define KDGKBSENT 0x4B48 /* gets one function key string entry */
+#define KDSKBSENT 0x4B49 /* sets one function key string entry */
+
+struct kbdiacr {
+ unsigned char diacr, base, result;
+};
+struct kbdiacrs {
+ unsigned int kb_cnt; /* number of entries in following array */
+ struct kbdiacr kbdiacr[256]; /* MAX_DIACR from keyboard.h */
+};
+#define KDGKBDIACR 0x4B4A /* read kernel accent table */
+#define KDSKBDIACR 0x4B4B /* write kernel accent table */
+
+struct kbdiacruc {
+ unsigned int diacr, base, result;
+};
+struct kbdiacrsuc {
+ unsigned int kb_cnt; /* number of entries in following array */
+ struct kbdiacruc kbdiacruc[256]; /* MAX_DIACR from keyboard.h */
+};
+#define KDGKBDIACRUC 0x4BFA /* read kernel accent table - UCS */
+#define KDSKBDIACRUC 0x4BFB /* write kernel accent table - UCS */
+
+struct kbkeycode {
+ unsigned int scancode, keycode;
+};
+#define KDGETKEYCODE 0x4B4C /* read kernel keycode table entry */
+#define KDSETKEYCODE 0x4B4D /* write kernel keycode table entry */
+
+#define KDSIGACCEPT 0x4B4E /* accept kbd generated signals */
+
+struct kbd_repeat {
+ int delay; /* in msec; <= 0: don't change */
+ int period; /* in msec; <= 0: don't change */
+ /* earlier this field was misnamed "rate" */
+};
+
+#define KDKBDREP 0x4B52 /* set keyboard delay/repeat rate;
+ * actually used values are returned */
+
+#define KDFONTOP 0x4B72 /* font operations */
+
+struct console_font_op {
+ unsigned int op; /* operation code KD_FONT_OP_* */
+ unsigned int flags; /* KD_FONT_FLAG_* */
+ unsigned int width, height; /* font size */
+ unsigned int charcount;
+ unsigned char *data; /* font data with height fixed to 32 */
+};
+
+struct console_font {
+ unsigned int width, height; /* font size */
+ unsigned int charcount;
+ unsigned char *data; /* font data with height fixed to 32 */
+};
+
+#define KD_FONT_OP_SET 0 /* Set font */
+#define KD_FONT_OP_GET 1 /* Get font */
+#define KD_FONT_OP_SET_DEFAULT 2 /* Set font to default, data points to name / NULL */
+#define KD_FONT_OP_COPY 3 /* Copy from another console */
+
+#define KD_FONT_FLAG_DONT_RECALC 1 /* Don't recalculate hw charcell size [compat] */
+
+/* note: 0x4B00-0x4B4E all have had a value at some time;
+ don't reuse for the time being */
+/* note: 0x4B60-0x4B6D, 0x4B70-0x4B72 used above */
+
+#endif /* _LINUX_KD_H */
diff --git a/sysroot/usr/include/linux/kdev_t.h b/sysroot/usr/include/linux/kdev_t.h
new file mode 100644
index 0000000..af5551d
--- /dev/null
+++ b/sysroot/usr/include/linux/kdev_t.h
@@ -0,0 +1,11 @@
+#ifndef _LINUX_KDEV_T_H
+#define _LINUX_KDEV_T_H
+
+/*
+Some programs want their definitions of MAJOR and MINOR and MKDEV
+from the kernel sources. These must be the externally visible ones.
+*/
+#define MAJOR(dev) ((dev)>>8)
+#define MINOR(dev) ((dev) & 0xff)
+#define MKDEV(ma,mi) ((ma)<<8 | (mi))
+#endif
diff --git a/sysroot/usr/include/linux/kernel.h b/sysroot/usr/include/linux/kernel.h
new file mode 100644
index 0000000..d2e207e
--- /dev/null
+++ b/sysroot/usr/include/linux/kernel.h
@@ -0,0 +1,46 @@
+#ifndef _LINUX_KERNEL_H
+#define _LINUX_KERNEL_H
+
+/*
+ * 'kernel.h' contains some often-used function prototypes etc
+ */
+
+
+#define SI_LOAD_SHIFT 16
+struct sysinfo {
+ long uptime; /* Seconds since boot */
+ unsigned long loads[3]; /* 1, 5, and 15 minute load averages */
+ unsigned long totalram; /* Total usable main memory size */
+ unsigned long freeram; /* Available memory size */
+ unsigned long sharedram; /* Amount of shared memory */
+ unsigned long bufferram; /* Memory used by buffers */
+ unsigned long totalswap; /* Total swap space size */
+ unsigned long freeswap; /* swap space still available */
+ unsigned short procs; /* Number of current processes */
+ unsigned short pad; /* explicit padding for m68k */
+ unsigned long totalhigh; /* Total high memory size */
+ unsigned long freehigh; /* Available high memory size */
+ unsigned int mem_unit; /* Memory unit size in bytes */
+ char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */
+};
+
+/* Force a compilation error if condition is true */
+#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
+
+/* Force a compilation error if condition is true, but also produce a
+ result (of value 0 and type size_t), so the expression can be used
+ e.g. in a structure initializer (or where-ever else comma expressions
+ aren't permitted). */
+#define BUILD_BUG_ON_ZERO(e) (sizeof(char[1 - 2 * !!(e)]) - 1)
+
+/* Trap pasters of __FUNCTION__ at compile-time */
+#define __FUNCTION__ (__func__)
+
+/* This helps us to avoid #ifdef CONFIG_NUMA */
+#ifdef CONFIG_NUMA
+#define NUMA_BUILD 1
+#else
+#define NUMA_BUILD 0
+#endif
+
+#endif
diff --git a/sysroot/usr/include/linux/kernelcapi.h b/sysroot/usr/include/linux/kernelcapi.h
new file mode 100644
index 0000000..92f6b42
--- /dev/null
+++ b/sysroot/usr/include/linux/kernelcapi.h
@@ -0,0 +1,47 @@
+/*
+ * $Id: kernelcapi.h,v 1.8.6.2 2001/02/07 11:31:31 kai Exp $
+ *
+ * Kernel CAPI 2.0 Interface for Linux
+ *
+ * (c) Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de)
+ *
+ */
+
+#ifndef __KERNELCAPI_H__
+#define __KERNELCAPI_H__
+
+#define CAPI_MAXAPPL 240 /* maximum number of applications */
+#define CAPI_MAXCONTR 32 /* maximum number of controller */
+#define CAPI_MAXDATAWINDOW 8
+
+
+typedef struct kcapi_flagdef {
+ int contr;
+ int flag;
+} kcapi_flagdef;
+
+typedef struct kcapi_carddef {
+ char driver[32];
+ unsigned int port;
+ unsigned irq;
+ unsigned int membase;
+ int cardnr;
+} kcapi_carddef;
+
+/* new ioctls >= 10 */
+#define KCAPI_CMD_TRACE 10
+#define KCAPI_CMD_ADDCARD 11 /* OBSOLETE */
+
+/*
+ * flag > 2 => trace also data
+ * flag & 1 => show trace
+ */
+#define KCAPI_TRACE_OFF 0
+#define KCAPI_TRACE_SHORT_NO_DATA 1
+#define KCAPI_TRACE_FULL_NO_DATA 2
+#define KCAPI_TRACE_SHORT 3
+#define KCAPI_TRACE_FULL 4
+
+
+
+#endif /* __KERNELCAPI_H__ */
diff --git a/sysroot/usr/include/linux/keyboard.h b/sysroot/usr/include/linux/keyboard.h
new file mode 100644
index 0000000..38e399f
--- /dev/null
+++ b/sysroot/usr/include/linux/keyboard.h
@@ -0,0 +1,442 @@
+#ifndef __LINUX_KEYBOARD_H
+#define __LINUX_KEYBOARD_H
+
+#include <linux/wait.h>
+
+#define KG_SHIFT 0
+#define KG_CTRL 2
+#define KG_ALT 3
+#define KG_ALTGR 1
+#define KG_SHIFTL 4
+#define KG_KANASHIFT 4
+#define KG_SHIFTR 5
+#define KG_CTRLL 6
+#define KG_CTRLR 7
+#define KG_CAPSSHIFT 8
+
+#define NR_SHIFT 9
+
+#define NR_KEYS 256
+#define MAX_NR_KEYMAPS 256
+/* This means 128Kb if all keymaps are allocated. Only the superuser
+ may increase the number of keymaps beyond MAX_NR_OF_USER_KEYMAPS. */
+#define MAX_NR_OF_USER_KEYMAPS 256 /* should be at least 7 */
+
+
+#define MAX_NR_FUNC 256 /* max nr of strings assigned to keys */
+
+#define KT_LATIN 0 /* we depend on this being zero */
+#define KT_LETTER 11 /* symbol that can be acted upon by CapsLock */
+#define KT_FN 1
+#define KT_SPEC 2
+#define KT_PAD 3
+#define KT_DEAD 4
+#define KT_CONS 5
+#define KT_CUR 6
+#define KT_SHIFT 7
+#define KT_META 8
+#define KT_ASCII 9
+#define KT_LOCK 10
+#define KT_SLOCK 12
+#define KT_BRL 14
+
+#define K(t,v) (((t)<<8)|(v))
+#define KTYP(x) ((x) >> 8)
+#define KVAL(x) ((x) & 0xff)
+
+#define K_F1 K(KT_FN,0)
+#define K_F2 K(KT_FN,1)
+#define K_F3 K(KT_FN,2)
+#define K_F4 K(KT_FN,3)
+#define K_F5 K(KT_FN,4)
+#define K_F6 K(KT_FN,5)
+#define K_F7 K(KT_FN,6)
+#define K_F8 K(KT_FN,7)
+#define K_F9 K(KT_FN,8)
+#define K_F10 K(KT_FN,9)
+#define K_F11 K(KT_FN,10)
+#define K_F12 K(KT_FN,11)
+#define K_F13 K(KT_FN,12)
+#define K_F14 K(KT_FN,13)
+#define K_F15 K(KT_FN,14)
+#define K_F16 K(KT_FN,15)
+#define K_F17 K(KT_FN,16)
+#define K_F18 K(KT_FN,17)
+#define K_F19 K(KT_FN,18)
+#define K_F20 K(KT_FN,19)
+#define K_FIND K(KT_FN,20)
+#define K_INSERT K(KT_FN,21)
+#define K_REMOVE K(KT_FN,22)
+#define K_SELECT K(KT_FN,23)
+#define K_PGUP K(KT_FN,24) /* PGUP is a synonym for PRIOR */
+#define K_PGDN K(KT_FN,25) /* PGDN is a synonym for NEXT */
+#define K_MACRO K(KT_FN,26)
+#define K_HELP K(KT_FN,27)
+#define K_DO K(KT_FN,28)
+#define K_PAUSE K(KT_FN,29)
+#define K_F21 K(KT_FN,30)
+#define K_F22 K(KT_FN,31)
+#define K_F23 K(KT_FN,32)
+#define K_F24 K(KT_FN,33)
+#define K_F25 K(KT_FN,34)
+#define K_F26 K(KT_FN,35)
+#define K_F27 K(KT_FN,36)
+#define K_F28 K(KT_FN,37)
+#define K_F29 K(KT_FN,38)
+#define K_F30 K(KT_FN,39)
+#define K_F31 K(KT_FN,40)
+#define K_F32 K(KT_FN,41)
+#define K_F33 K(KT_FN,42)
+#define K_F34 K(KT_FN,43)
+#define K_F35 K(KT_FN,44)
+#define K_F36 K(KT_FN,45)
+#define K_F37 K(KT_FN,46)
+#define K_F38 K(KT_FN,47)
+#define K_F39 K(KT_FN,48)
+#define K_F40 K(KT_FN,49)
+#define K_F41 K(KT_FN,50)
+#define K_F42 K(KT_FN,51)
+#define K_F43 K(KT_FN,52)
+#define K_F44 K(KT_FN,53)
+#define K_F45 K(KT_FN,54)
+#define K_F46 K(KT_FN,55)
+#define K_F47 K(KT_FN,56)
+#define K_F48 K(KT_FN,57)
+#define K_F49 K(KT_FN,58)
+#define K_F50 K(KT_FN,59)
+#define K_F51 K(KT_FN,60)
+#define K_F52 K(KT_FN,61)
+#define K_F53 K(KT_FN,62)
+#define K_F54 K(KT_FN,63)
+#define K_F55 K(KT_FN,64)
+#define K_F56 K(KT_FN,65)
+#define K_F57 K(KT_FN,66)
+#define K_F58 K(KT_FN,67)
+#define K_F59 K(KT_FN,68)
+#define K_F60 K(KT_FN,69)
+#define K_F61 K(KT_FN,70)
+#define K_F62 K(KT_FN,71)
+#define K_F63 K(KT_FN,72)
+#define K_F64 K(KT_FN,73)
+#define K_F65 K(KT_FN,74)
+#define K_F66 K(KT_FN,75)
+#define K_F67 K(KT_FN,76)
+#define K_F68 K(KT_FN,77)
+#define K_F69 K(KT_FN,78)
+#define K_F70 K(KT_FN,79)
+#define K_F71 K(KT_FN,80)
+#define K_F72 K(KT_FN,81)
+#define K_F73 K(KT_FN,82)
+#define K_F74 K(KT_FN,83)
+#define K_F75 K(KT_FN,84)
+#define K_F76 K(KT_FN,85)
+#define K_F77 K(KT_FN,86)
+#define K_F78 K(KT_FN,87)
+#define K_F79 K(KT_FN,88)
+#define K_F80 K(KT_FN,89)
+#define K_F81 K(KT_FN,90)
+#define K_F82 K(KT_FN,91)
+#define K_F83 K(KT_FN,92)
+#define K_F84 K(KT_FN,93)
+#define K_F85 K(KT_FN,94)
+#define K_F86 K(KT_FN,95)
+#define K_F87 K(KT_FN,96)
+#define K_F88 K(KT_FN,97)
+#define K_F89 K(KT_FN,98)
+#define K_F90 K(KT_FN,99)
+#define K_F91 K(KT_FN,100)
+#define K_F92 K(KT_FN,101)
+#define K_F93 K(KT_FN,102)
+#define K_F94 K(KT_FN,103)
+#define K_F95 K(KT_FN,104)
+#define K_F96 K(KT_FN,105)
+#define K_F97 K(KT_FN,106)
+#define K_F98 K(KT_FN,107)
+#define K_F99 K(KT_FN,108)
+#define K_F100 K(KT_FN,109)
+#define K_F101 K(KT_FN,110)
+#define K_F102 K(KT_FN,111)
+#define K_F103 K(KT_FN,112)
+#define K_F104 K(KT_FN,113)
+#define K_F105 K(KT_FN,114)
+#define K_F106 K(KT_FN,115)
+#define K_F107 K(KT_FN,116)
+#define K_F108 K(KT_FN,117)
+#define K_F109 K(KT_FN,118)
+#define K_F110 K(KT_FN,119)
+#define K_F111 K(KT_FN,120)
+#define K_F112 K(KT_FN,121)
+#define K_F113 K(KT_FN,122)
+#define K_F114 K(KT_FN,123)
+#define K_F115 K(KT_FN,124)
+#define K_F116 K(KT_FN,125)
+#define K_F117 K(KT_FN,126)
+#define K_F118 K(KT_FN,127)
+#define K_F119 K(KT_FN,128)
+#define K_F120 K(KT_FN,129)
+#define K_F121 K(KT_FN,130)
+#define K_F122 K(KT_FN,131)
+#define K_F123 K(KT_FN,132)
+#define K_F124 K(KT_FN,133)
+#define K_F125 K(KT_FN,134)
+#define K_F126 K(KT_FN,135)
+#define K_F127 K(KT_FN,136)
+#define K_F128 K(KT_FN,137)
+#define K_F129 K(KT_FN,138)
+#define K_F130 K(KT_FN,139)
+#define K_F131 K(KT_FN,140)
+#define K_F132 K(KT_FN,141)
+#define K_F133 K(KT_FN,142)
+#define K_F134 K(KT_FN,143)
+#define K_F135 K(KT_FN,144)
+#define K_F136 K(KT_FN,145)
+#define K_F137 K(KT_FN,146)
+#define K_F138 K(KT_FN,147)
+#define K_F139 K(KT_FN,148)
+#define K_F140 K(KT_FN,149)
+#define K_F141 K(KT_FN,150)
+#define K_F142 K(KT_FN,151)
+#define K_F143 K(KT_FN,152)
+#define K_F144 K(KT_FN,153)
+#define K_F145 K(KT_FN,154)
+#define K_F146 K(KT_FN,155)
+#define K_F147 K(KT_FN,156)
+#define K_F148 K(KT_FN,157)
+#define K_F149 K(KT_FN,158)
+#define K_F150 K(KT_FN,159)
+#define K_F151 K(KT_FN,160)
+#define K_F152 K(KT_FN,161)
+#define K_F153 K(KT_FN,162)
+#define K_F154 K(KT_FN,163)
+#define K_F155 K(KT_FN,164)
+#define K_F156 K(KT_FN,165)
+#define K_F157 K(KT_FN,166)
+#define K_F158 K(KT_FN,167)
+#define K_F159 K(KT_FN,168)
+#define K_F160 K(KT_FN,169)
+#define K_F161 K(KT_FN,170)
+#define K_F162 K(KT_FN,171)
+#define K_F163 K(KT_FN,172)
+#define K_F164 K(KT_FN,173)
+#define K_F165 K(KT_FN,174)
+#define K_F166 K(KT_FN,175)
+#define K_F167 K(KT_FN,176)
+#define K_F168 K(KT_FN,177)
+#define K_F169 K(KT_FN,178)
+#define K_F170 K(KT_FN,179)
+#define K_F171 K(KT_FN,180)
+#define K_F172 K(KT_FN,181)
+#define K_F173 K(KT_FN,182)
+#define K_F174 K(KT_FN,183)
+#define K_F175 K(KT_FN,184)
+#define K_F176 K(KT_FN,185)
+#define K_F177 K(KT_FN,186)
+#define K_F178 K(KT_FN,187)
+#define K_F179 K(KT_FN,188)
+#define K_F180 K(KT_FN,189)
+#define K_F181 K(KT_FN,190)
+#define K_F182 K(KT_FN,191)
+#define K_F183 K(KT_FN,192)
+#define K_F184 K(KT_FN,193)
+#define K_F185 K(KT_FN,194)
+#define K_F186 K(KT_FN,195)
+#define K_F187 K(KT_FN,196)
+#define K_F188 K(KT_FN,197)
+#define K_F189 K(KT_FN,198)
+#define K_F190 K(KT_FN,199)
+#define K_F191 K(KT_FN,200)
+#define K_F192 K(KT_FN,201)
+#define K_F193 K(KT_FN,202)
+#define K_F194 K(KT_FN,203)
+#define K_F195 K(KT_FN,204)
+#define K_F196 K(KT_FN,205)
+#define K_F197 K(KT_FN,206)
+#define K_F198 K(KT_FN,207)
+#define K_F199 K(KT_FN,208)
+#define K_F200 K(KT_FN,209)
+#define K_F201 K(KT_FN,210)
+#define K_F202 K(KT_FN,211)
+#define K_F203 K(KT_FN,212)
+#define K_F204 K(KT_FN,213)
+#define K_F205 K(KT_FN,214)
+#define K_F206 K(KT_FN,215)
+#define K_F207 K(KT_FN,216)
+#define K_F208 K(KT_FN,217)
+#define K_F209 K(KT_FN,218)
+#define K_F210 K(KT_FN,219)
+#define K_F211 K(KT_FN,220)
+#define K_F212 K(KT_FN,221)
+#define K_F213 K(KT_FN,222)
+#define K_F214 K(KT_FN,223)
+#define K_F215 K(KT_FN,224)
+#define K_F216 K(KT_FN,225)
+#define K_F217 K(KT_FN,226)
+#define K_F218 K(KT_FN,227)
+#define K_F219 K(KT_FN,228)
+#define K_F220 K(KT_FN,229)
+#define K_F221 K(KT_FN,230)
+#define K_F222 K(KT_FN,231)
+#define K_F223 K(KT_FN,232)
+#define K_F224 K(KT_FN,233)
+#define K_F225 K(KT_FN,234)
+#define K_F226 K(KT_FN,235)
+#define K_F227 K(KT_FN,236)
+#define K_F228 K(KT_FN,237)
+#define K_F229 K(KT_FN,238)
+#define K_F230 K(KT_FN,239)
+#define K_F231 K(KT_FN,240)
+#define K_F232 K(KT_FN,241)
+#define K_F233 K(KT_FN,242)
+#define K_F234 K(KT_FN,243)
+#define K_F235 K(KT_FN,244)
+#define K_F236 K(KT_FN,245)
+#define K_F237 K(KT_FN,246)
+#define K_F238 K(KT_FN,247)
+#define K_F239 K(KT_FN,248)
+#define K_F240 K(KT_FN,249)
+#define K_F241 K(KT_FN,250)
+#define K_F242 K(KT_FN,251)
+#define K_F243 K(KT_FN,252)
+#define K_F244 K(KT_FN,253)
+#define K_F245 K(KT_FN,254)
+#define K_UNDO K(KT_FN,255)
+
+
+#define K_HOLE K(KT_SPEC,0)
+#define K_ENTER K(KT_SPEC,1)
+#define K_SH_REGS K(KT_SPEC,2)
+#define K_SH_MEM K(KT_SPEC,3)
+#define K_SH_STAT K(KT_SPEC,4)
+#define K_BREAK K(KT_SPEC,5)
+#define K_CONS K(KT_SPEC,6)
+#define K_CAPS K(KT_SPEC,7)
+#define K_NUM K(KT_SPEC,8)
+#define K_HOLD K(KT_SPEC,9)
+#define K_SCROLLFORW K(KT_SPEC,10)
+#define K_SCROLLBACK K(KT_SPEC,11)
+#define K_BOOT K(KT_SPEC,12)
+#define K_CAPSON K(KT_SPEC,13)
+#define K_COMPOSE K(KT_SPEC,14)
+#define K_SAK K(KT_SPEC,15)
+#define K_DECRCONSOLE K(KT_SPEC,16)
+#define K_INCRCONSOLE K(KT_SPEC,17)
+#define K_SPAWNCONSOLE K(KT_SPEC,18)
+#define K_BARENUMLOCK K(KT_SPEC,19)
+
+#define K_ALLOCATED K(KT_SPEC,126) /* dynamically allocated keymap */
+#define K_NOSUCHMAP K(KT_SPEC,127) /* returned by KDGKBENT */
+
+#define K_P0 K(KT_PAD,0)
+#define K_P1 K(KT_PAD,1)
+#define K_P2 K(KT_PAD,2)
+#define K_P3 K(KT_PAD,3)
+#define K_P4 K(KT_PAD,4)
+#define K_P5 K(KT_PAD,5)
+#define K_P6 K(KT_PAD,6)
+#define K_P7 K(KT_PAD,7)
+#define K_P8 K(KT_PAD,8)
+#define K_P9 K(KT_PAD,9)
+#define K_PPLUS K(KT_PAD,10) /* key-pad plus */
+#define K_PMINUS K(KT_PAD,11) /* key-pad minus */
+#define K_PSTAR K(KT_PAD,12) /* key-pad asterisk (star) */
+#define K_PSLASH K(KT_PAD,13) /* key-pad slash */
+#define K_PENTER K(KT_PAD,14) /* key-pad enter */
+#define K_PCOMMA K(KT_PAD,15) /* key-pad comma: kludge... */
+#define K_PDOT K(KT_PAD,16) /* key-pad dot (period): kludge... */
+#define K_PPLUSMINUS K(KT_PAD,17) /* key-pad plus/minus */
+#define K_PPARENL K(KT_PAD,18) /* key-pad left parenthesis */
+#define K_PPARENR K(KT_PAD,19) /* key-pad right parenthesis */
+
+#define NR_PAD 20
+
+#define K_DGRAVE K(KT_DEAD,0)
+#define K_DACUTE K(KT_DEAD,1)
+#define K_DCIRCM K(KT_DEAD,2)
+#define K_DTILDE K(KT_DEAD,3)
+#define K_DDIERE K(KT_DEAD,4)
+#define K_DCEDIL K(KT_DEAD,5)
+
+#define NR_DEAD 6
+
+#define K_DOWN K(KT_CUR,0)
+#define K_LEFT K(KT_CUR,1)
+#define K_RIGHT K(KT_CUR,2)
+#define K_UP K(KT_CUR,3)
+
+#define K_SHIFT K(KT_SHIFT,KG_SHIFT)
+#define K_CTRL K(KT_SHIFT,KG_CTRL)
+#define K_ALT K(KT_SHIFT,KG_ALT)
+#define K_ALTGR K(KT_SHIFT,KG_ALTGR)
+#define K_SHIFTL K(KT_SHIFT,KG_SHIFTL)
+#define K_SHIFTR K(KT_SHIFT,KG_SHIFTR)
+#define K_CTRLL K(KT_SHIFT,KG_CTRLL)
+#define K_CTRLR K(KT_SHIFT,KG_CTRLR)
+#define K_CAPSSHIFT K(KT_SHIFT,KG_CAPSSHIFT)
+
+#define K_ASC0 K(KT_ASCII,0)
+#define K_ASC1 K(KT_ASCII,1)
+#define K_ASC2 K(KT_ASCII,2)
+#define K_ASC3 K(KT_ASCII,3)
+#define K_ASC4 K(KT_ASCII,4)
+#define K_ASC5 K(KT_ASCII,5)
+#define K_ASC6 K(KT_ASCII,6)
+#define K_ASC7 K(KT_ASCII,7)
+#define K_ASC8 K(KT_ASCII,8)
+#define K_ASC9 K(KT_ASCII,9)
+#define K_HEX0 K(KT_ASCII,10)
+#define K_HEX1 K(KT_ASCII,11)
+#define K_HEX2 K(KT_ASCII,12)
+#define K_HEX3 K(KT_ASCII,13)
+#define K_HEX4 K(KT_ASCII,14)
+#define K_HEX5 K(KT_ASCII,15)
+#define K_HEX6 K(KT_ASCII,16)
+#define K_HEX7 K(KT_ASCII,17)
+#define K_HEX8 K(KT_ASCII,18)
+#define K_HEX9 K(KT_ASCII,19)
+#define K_HEXa K(KT_ASCII,20)
+#define K_HEXb K(KT_ASCII,21)
+#define K_HEXc K(KT_ASCII,22)
+#define K_HEXd K(KT_ASCII,23)
+#define K_HEXe K(KT_ASCII,24)
+#define K_HEXf K(KT_ASCII,25)
+
+#define NR_ASCII 26
+
+#define K_SHIFTLOCK K(KT_LOCK,KG_SHIFT)
+#define K_CTRLLOCK K(KT_LOCK,KG_CTRL)
+#define K_ALTLOCK K(KT_LOCK,KG_ALT)
+#define K_ALTGRLOCK K(KT_LOCK,KG_ALTGR)
+#define K_SHIFTLLOCK K(KT_LOCK,KG_SHIFTL)
+#define K_SHIFTRLOCK K(KT_LOCK,KG_SHIFTR)
+#define K_CTRLLLOCK K(KT_LOCK,KG_CTRLL)
+#define K_CTRLRLOCK K(KT_LOCK,KG_CTRLR)
+#define K_CAPSSHIFTLOCK K(KT_LOCK,KG_CAPSSHIFT)
+
+#define K_SHIFT_SLOCK K(KT_SLOCK,KG_SHIFT)
+#define K_CTRL_SLOCK K(KT_SLOCK,KG_CTRL)
+#define K_ALT_SLOCK K(KT_SLOCK,KG_ALT)
+#define K_ALTGR_SLOCK K(KT_SLOCK,KG_ALTGR)
+#define K_SHIFTL_SLOCK K(KT_SLOCK,KG_SHIFTL)
+#define K_SHIFTR_SLOCK K(KT_SLOCK,KG_SHIFTR)
+#define K_CTRLL_SLOCK K(KT_SLOCK,KG_CTRLL)
+#define K_CTRLR_SLOCK K(KT_SLOCK,KG_CTRLR)
+#define K_CAPSSHIFT_SLOCK K(KT_SLOCK,KG_CAPSSHIFT)
+
+#define NR_LOCK 9
+
+#define K_BRL_BLANK K(KT_BRL, 0)
+#define K_BRL_DOT1 K(KT_BRL, 1)
+#define K_BRL_DOT2 K(KT_BRL, 2)
+#define K_BRL_DOT3 K(KT_BRL, 3)
+#define K_BRL_DOT4 K(KT_BRL, 4)
+#define K_BRL_DOT5 K(KT_BRL, 5)
+#define K_BRL_DOT6 K(KT_BRL, 6)
+#define K_BRL_DOT7 K(KT_BRL, 7)
+#define K_BRL_DOT8 K(KT_BRL, 8)
+#define K_BRL_DOT9 K(KT_BRL, 9)
+#define K_BRL_DOT10 K(KT_BRL, 10)
+
+#define NR_BRL 11
+
+#define MAX_DIACR 256
+#endif
diff --git a/sysroot/usr/include/linux/keyctl.h b/sysroot/usr/include/linux/keyctl.h
new file mode 100644
index 0000000..3365945
--- /dev/null
+++ b/sysroot/usr/include/linux/keyctl.h
@@ -0,0 +1,53 @@
+/* keyctl.h: keyctl command IDs
+ *
+ * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved.
+ * Written by David Howells (dhowells@redhat.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _LINUX_KEYCTL_H
+#define _LINUX_KEYCTL_H
+
+/* special process keyring shortcut IDs */
+#define KEY_SPEC_THREAD_KEYRING -1 /* - key ID for thread-specific keyring */
+#define KEY_SPEC_PROCESS_KEYRING -2 /* - key ID for process-specific keyring */
+#define KEY_SPEC_SESSION_KEYRING -3 /* - key ID for session-specific keyring */
+#define KEY_SPEC_USER_KEYRING -4 /* - key ID for UID-specific keyring */
+#define KEY_SPEC_USER_SESSION_KEYRING -5 /* - key ID for UID-session keyring */
+#define KEY_SPEC_GROUP_KEYRING -6 /* - key ID for GID-specific keyring */
+#define KEY_SPEC_REQKEY_AUTH_KEY -7 /* - key ID for assumed request_key auth key */
+
+/* request-key default keyrings */
+#define KEY_REQKEY_DEFL_NO_CHANGE -1
+#define KEY_REQKEY_DEFL_DEFAULT 0
+#define KEY_REQKEY_DEFL_THREAD_KEYRING 1
+#define KEY_REQKEY_DEFL_PROCESS_KEYRING 2
+#define KEY_REQKEY_DEFL_SESSION_KEYRING 3
+#define KEY_REQKEY_DEFL_USER_KEYRING 4
+#define KEY_REQKEY_DEFL_USER_SESSION_KEYRING 5
+#define KEY_REQKEY_DEFL_GROUP_KEYRING 6
+
+/* keyctl commands */
+#define KEYCTL_GET_KEYRING_ID 0 /* ask for a keyring's ID */
+#define KEYCTL_JOIN_SESSION_KEYRING 1 /* join or start named session keyring */
+#define KEYCTL_UPDATE 2 /* update a key */
+#define KEYCTL_REVOKE 3 /* revoke a key */
+#define KEYCTL_CHOWN 4 /* set ownership of a key */
+#define KEYCTL_SETPERM 5 /* set perms on a key */
+#define KEYCTL_DESCRIBE 6 /* describe a key */
+#define KEYCTL_CLEAR 7 /* clear contents of a keyring */
+#define KEYCTL_LINK 8 /* link a key into a keyring */
+#define KEYCTL_UNLINK 9 /* unlink a key from a keyring */
+#define KEYCTL_SEARCH 10 /* search for a key in a keyring */
+#define KEYCTL_READ 11 /* read a key or keyring's contents */
+#define KEYCTL_INSTANTIATE 12 /* instantiate a partially constructed key */
+#define KEYCTL_NEGATE 13 /* negate a partially constructed key */
+#define KEYCTL_SET_REQKEY_KEYRING 14 /* set default request-key keyring */
+#define KEYCTL_SET_TIMEOUT 15 /* set key timeout */
+#define KEYCTL_ASSUME_AUTHORITY 16 /* assume request_key() authorisation */
+
+#endif /* _LINUX_KEYCTL_H */
diff --git a/sysroot/usr/include/linux/limits.h b/sysroot/usr/include/linux/limits.h
new file mode 100644
index 0000000..2d0f941
--- /dev/null
+++ b/sysroot/usr/include/linux/limits.h
@@ -0,0 +1,20 @@
+#ifndef _LINUX_LIMITS_H
+#define _LINUX_LIMITS_H
+
+#define NR_OPEN 1024
+
+#define NGROUPS_MAX 65536 /* supplemental group IDs are available */
+#define ARG_MAX 131072 /* # bytes of args + environ for exec() */
+#define LINK_MAX 127 /* # links a file may have */
+#define MAX_CANON 255 /* size of the canonical input queue */
+#define MAX_INPUT 255 /* size of the type-ahead buffer */
+#define NAME_MAX 255 /* # chars in a file name */
+#define PATH_MAX 4096 /* # chars in a path name including nul */
+#define PIPE_BUF 4096 /* # bytes in atomic write to a pipe */
+#define XATTR_NAME_MAX 255 /* # chars in an extended attribute name */
+#define XATTR_SIZE_MAX 65536 /* size of an extended attribute value (64k) */
+#define XATTR_LIST_MAX 65536 /* size of extended attribute namelist (64k) */
+
+#define RTSIG_MAX 32
+
+#endif
diff --git a/sysroot/usr/include/linux/llc.h b/sysroot/usr/include/linux/llc.h
new file mode 100644
index 0000000..c3eb35c
--- /dev/null
+++ b/sysroot/usr/include/linux/llc.h
@@ -0,0 +1,73 @@
+#ifndef __LINUX_LLC_H
+#define __LINUX_LLC_H
+/*
+ * IEEE 802.2 User Interface SAPs for Linux, data structures and indicators.
+ *
+ * Copyright (c) 2001 by Jay Schulist <jschlst@samba.org>
+ *
+ * This program can be redistributed or modified under the terms of the
+ * GNU General Public License as published by the Free Software Foundation.
+ * This program is distributed without any warranty or implied warranty
+ * of merchantability or fitness for a particular purpose.
+ *
+ * See the GNU General Public License for more details.
+ */
+#define __LLC_SOCK_SIZE__ 16 /* sizeof(sockaddr_llc), word align. */
+struct sockaddr_llc {
+ sa_family_t sllc_family; /* AF_LLC */
+ sa_family_t sllc_arphrd; /* ARPHRD_ETHER */
+ unsigned char sllc_test;
+ unsigned char sllc_xid;
+ unsigned char sllc_ua; /* UA data, only for SOCK_STREAM. */
+ unsigned char sllc_sap;
+ unsigned char sllc_mac[IFHWADDRLEN];
+ unsigned char __pad[__LLC_SOCK_SIZE__ - sizeof(sa_family_t) * 2 -
+ sizeof(unsigned char) * 4 - IFHWADDRLEN];
+};
+
+/* sockopt definitions. */
+enum llc_sockopts {
+ LLC_OPT_UNKNOWN = 0,
+ LLC_OPT_RETRY, /* max retrans attempts. */
+ LLC_OPT_SIZE, /* max PDU size (octets). */
+ LLC_OPT_ACK_TMR_EXP, /* ack expire time (secs). */
+ LLC_OPT_P_TMR_EXP, /* pf cycle expire time (secs). */
+ LLC_OPT_REJ_TMR_EXP, /* rej sent expire time (secs). */
+ LLC_OPT_BUSY_TMR_EXP, /* busy state expire time (secs). */
+ LLC_OPT_TX_WIN, /* tx window size. */
+ LLC_OPT_RX_WIN, /* rx window size. */
+ LLC_OPT_MAX
+};
+
+#define LLC_OPT_MAX_RETRY 100
+#define LLC_OPT_MAX_SIZE 4196
+#define LLC_OPT_MAX_WIN 127
+#define LLC_OPT_MAX_ACK_TMR_EXP 60
+#define LLC_OPT_MAX_P_TMR_EXP 60
+#define LLC_OPT_MAX_REJ_TMR_EXP 60
+#define LLC_OPT_MAX_BUSY_TMR_EXP 60
+
+/* LLC SAP types. */
+#define LLC_SAP_NULL 0x00 /* NULL SAP. */
+#define LLC_SAP_LLC 0x02 /* LLC Sublayer Managment. */
+#define LLC_SAP_SNA 0x04 /* SNA Path Control. */
+#define LLC_SAP_PNM 0x0E /* Proway Network Managment. */
+#define LLC_SAP_IP 0x06 /* TCP/IP. */
+#define LLC_SAP_BSPAN 0x42 /* Bridge Spanning Tree Proto */
+#define LLC_SAP_MMS 0x4E /* Manufacturing Message Srv. */
+#define LLC_SAP_8208 0x7E /* ISO 8208 */
+#define LLC_SAP_3COM 0x80 /* 3COM. */
+#define LLC_SAP_PRO 0x8E /* Proway Active Station List */
+#define LLC_SAP_SNAP 0xAA /* SNAP. */
+#define LLC_SAP_BANYAN 0xBC /* Banyan. */
+#define LLC_SAP_IPX 0xE0 /* IPX/SPX. */
+#define LLC_SAP_NETBEUI 0xF0 /* NetBEUI. */
+#define LLC_SAP_LANMGR 0xF4 /* LanManager. */
+#define LLC_SAP_IMPL 0xF8 /* IMPL */
+#define LLC_SAP_DISC 0xFC /* Discovery */
+#define LLC_SAP_OSI 0xFE /* OSI Network Layers. */
+#define LLC_SAP_LAR 0xDC /* LAN Address Resolution */
+#define LLC_SAP_RM 0xD4 /* Resource Management */
+#define LLC_SAP_GLOBAL 0xFF /* Global SAP. */
+
+#endif /* __LINUX_LLC_H */
diff --git a/sysroot/usr/include/linux/lock_dlm_plock.h b/sysroot/usr/include/linux/lock_dlm_plock.h
new file mode 100644
index 0000000..fc34151
--- /dev/null
+++ b/sysroot/usr/include/linux/lock_dlm_plock.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2005 Red Hat, Inc. All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU General Public License v.2.
+ */
+
+#ifndef __LOCK_DLM_PLOCK_DOT_H__
+#define __LOCK_DLM_PLOCK_DOT_H__
+
+#define GDLM_PLOCK_MISC_NAME "lock_dlm_plock"
+
+#define GDLM_PLOCK_VERSION_MAJOR 1
+#define GDLM_PLOCK_VERSION_MINOR 1
+#define GDLM_PLOCK_VERSION_PATCH 0
+
+enum {
+ GDLM_PLOCK_OP_LOCK = 1,
+ GDLM_PLOCK_OP_UNLOCK,
+ GDLM_PLOCK_OP_GET,
+};
+
+struct gdlm_plock_info {
+ __u32 version[3];
+ __u8 optype;
+ __u8 ex;
+ __u8 wait;
+ __u8 pad;
+ __u32 pid;
+ __s32 nodeid;
+ __s32 rv;
+ __u32 fsid;
+ __u64 number;
+ __u64 start;
+ __u64 end;
+ __u64 owner;
+};
+
+#endif
+
diff --git a/sysroot/usr/include/linux/loop.h b/sysroot/usr/include/linux/loop.h
new file mode 100644
index 0000000..9ff9388
--- /dev/null
+++ b/sysroot/usr/include/linux/loop.h
@@ -0,0 +1,88 @@
+#ifndef _LINUX_LOOP_H
+#define _LINUX_LOOP_H
+
+/*
+ * include/linux/loop.h
+ *
+ * Written by Theodore Ts'o, 3/29/93.
+ *
+ * Copyright 1993 by Theodore Ts'o. Redistribution of this file is
+ * permitted under the GNU General Public License.
+ */
+
+#define LO_NAME_SIZE 64
+#define LO_KEY_SIZE 32
+
+
+/*
+ * Loop flags
+ */
+enum {
+ LO_FLAGS_READ_ONLY = 1,
+ LO_FLAGS_USE_AOPS = 2,
+};
+
+#include <asm/posix_types.h> /* for __kernel_old_dev_t */
+#include <asm/types.h> /* for __u64 */
+
+/* Backwards compatibility version */
+struct loop_info {
+ int lo_number; /* ioctl r/o */
+ __kernel_old_dev_t lo_device; /* ioctl r/o */
+ unsigned long lo_inode; /* ioctl r/o */
+ __kernel_old_dev_t lo_rdevice; /* ioctl r/o */
+ int lo_offset;
+ int lo_encrypt_type;
+ int lo_encrypt_key_size; /* ioctl w/o */
+ int lo_flags; /* ioctl r/o */
+ char lo_name[LO_NAME_SIZE];
+ unsigned char lo_encrypt_key[LO_KEY_SIZE]; /* ioctl w/o */
+ unsigned long lo_init[2];
+ char reserved[4];
+};
+
+struct loop_info64 {
+ __u64 lo_device; /* ioctl r/o */
+ __u64 lo_inode; /* ioctl r/o */
+ __u64 lo_rdevice; /* ioctl r/o */
+ __u64 lo_offset;
+ __u64 lo_sizelimit;/* bytes, 0 == max available */
+ __u32 lo_number; /* ioctl r/o */
+ __u32 lo_encrypt_type;
+ __u32 lo_encrypt_key_size; /* ioctl w/o */
+ __u32 lo_flags; /* ioctl r/o */
+ __u8 lo_file_name[LO_NAME_SIZE];
+ __u8 lo_crypt_name[LO_NAME_SIZE];
+ __u8 lo_encrypt_key[LO_KEY_SIZE]; /* ioctl w/o */
+ __u64 lo_init[2];
+};
+
+/*
+ * Loop filter types
+ */
+
+#define LO_CRYPT_NONE 0
+#define LO_CRYPT_XOR 1
+#define LO_CRYPT_DES 2
+#define LO_CRYPT_FISH2 3 /* Twofish encryption */
+#define LO_CRYPT_BLOW 4
+#define LO_CRYPT_CAST128 5
+#define LO_CRYPT_IDEA 6
+#define LO_CRYPT_DUMMY 9
+#define LO_CRYPT_SKIPJACK 10
+#define LO_CRYPT_CRYPTOAPI 18
+#define MAX_LO_CRYPT 20
+
+/*
+ * IOCTL commands --- we will commandeer 0x4C ('L')
+ */
+
+#define LOOP_SET_FD 0x4C00
+#define LOOP_CLR_FD 0x4C01
+#define LOOP_SET_STATUS 0x4C02
+#define LOOP_GET_STATUS 0x4C03
+#define LOOP_SET_STATUS64 0x4C04
+#define LOOP_GET_STATUS64 0x4C05
+#define LOOP_CHANGE_FD 0x4C06
+
+#endif
diff --git a/sysroot/usr/include/linux/lp.h b/sysroot/usr/include/linux/lp.h
new file mode 100644
index 0000000..59b1a6f
--- /dev/null
+++ b/sysroot/usr/include/linux/lp.h
@@ -0,0 +1,100 @@
+#ifndef _LINUX_LP_H
+#define _LINUX_LP_H
+
+/*
+ * usr/include/linux/lp.h c.1991-1992 James Wiegand
+ * many modifications copyright (C) 1992 Michael K. Johnson
+ * Interrupt support added 1993 Nigel Gamble
+ * Removed 8255 status defines from inside __KERNEL__ Marcelo Tosatti
+ */
+
+/*
+ * Per POSIX guidelines, this module reserves the LP and lp prefixes
+ * These are the lp_table[minor].flags flags...
+ */
+#define LP_EXIST 0x0001
+#define LP_SELEC 0x0002
+#define LP_BUSY 0x0004
+#define LP_BUSY_BIT_POS 2
+#define LP_OFFL 0x0008
+#define LP_NOPA 0x0010
+#define LP_ERR 0x0020
+#define LP_ABORT 0x0040
+#define LP_CAREFUL 0x0080 /* obsoleted -arca */
+#define LP_ABORTOPEN 0x0100
+
+#define LP_TRUST_IRQ_ 0x0200 /* obsolete */
+#define LP_NO_REVERSE 0x0400 /* No reverse mode available. */
+#define LP_DATA_AVAIL 0x0800 /* Data is available. */
+
+/*
+ * bit defines for 8255 status port
+ * base + 1
+ * accessed with LP_S(minor), which gets the byte...
+ */
+#define LP_PBUSY 0x80 /* inverted input, active high */
+#define LP_PACK 0x40 /* unchanged input, active low */
+#define LP_POUTPA 0x20 /* unchanged input, active high */
+#define LP_PSELECD 0x10 /* unchanged input, active high */
+#define LP_PERRORP 0x08 /* unchanged input, active low */
+
+/* timeout for each character. This is relative to bus cycles -- it
+ * is the count in a busy loop. THIS IS THE VALUE TO CHANGE if you
+ * have extremely slow printing, or if the machine seems to slow down
+ * a lot when you print. If you have slow printing, increase this
+ * number and recompile, and if your system gets bogged down, decrease
+ * this number. This can be changed with the tunelp(8) command as well.
+ */
+
+#define LP_INIT_CHAR 1000
+
+/* The parallel port specs apparently say that there needs to be
+ * a .5usec wait before and after the strobe.
+ */
+
+#define LP_INIT_WAIT 1
+
+/* This is the amount of time that the driver waits for the printer to
+ * catch up when the printer's buffer appears to be filled. If you
+ * want to tune this and have a fast printer (i.e. HPIIIP), decrease
+ * this number, and if you have a slow printer, increase this number.
+ * This is in hundredths of a second, the default 2 being .05 second.
+ * Or use the tunelp(8) command, which is especially nice if you want
+ * change back and forth between character and graphics printing, which
+ * are wildly different...
+ */
+
+#define LP_INIT_TIME 2
+
+/* IOCTL numbers */
+#define LPCHAR 0x0601 /* corresponds to LP_INIT_CHAR */
+#define LPTIME 0x0602 /* corresponds to LP_INIT_TIME */
+#define LPABORT 0x0604 /* call with TRUE arg to abort on error,
+ FALSE to retry. Default is retry. */
+#define LPSETIRQ 0x0605 /* call with new IRQ number,
+ or 0 for polling (no IRQ) */
+#define LPGETIRQ 0x0606 /* get the current IRQ number */
+#define LPWAIT 0x0608 /* corresponds to LP_INIT_WAIT */
+/* NOTE: LPCAREFUL is obsoleted and it' s always the default right now -arca */
+#define LPCAREFUL 0x0609 /* call with TRUE arg to require out-of-paper, off-
+ line, and error indicators good on all writes,
+ FALSE to ignore them. Default is ignore. */
+#define LPABORTOPEN 0x060a /* call with TRUE arg to abort open() on error,
+ FALSE to ignore error. Default is ignore. */
+#define LPGETSTATUS 0x060b /* return LP_S(minor) */
+#define LPRESET 0x060c /* reset printer */
+#ifdef LP_STATS
+#define LPGETSTATS 0x060d /* get statistics (struct lp_stats) */
+#endif
+#define LPGETFLAGS 0x060e /* get status flags */
+#define LPSETTIMEOUT 0x060f /* set parport timeout */
+
+/* timeout for printk'ing a timeout, in jiffies (100ths of a second).
+ This is also used for re-checking error conditions if LP_ABORT is
+ not set. This is the default behavior. */
+
+#define LP_TIMEOUT_INTERRUPT (60 * HZ)
+#define LP_TIMEOUT_POLLED (10 * HZ)
+
+
+#endif
diff --git a/sysroot/usr/include/linux/magic.h b/sysroot/usr/include/linux/magic.h
new file mode 100644
index 0000000..1fa0c2c
--- /dev/null
+++ b/sysroot/usr/include/linux/magic.h
@@ -0,0 +1,45 @@
+#ifndef __LINUX_MAGIC_H__
+#define __LINUX_MAGIC_H__
+
+#define ADFS_SUPER_MAGIC 0xadf5
+#define AFFS_SUPER_MAGIC 0xadff
+#define AFS_SUPER_MAGIC 0x5346414F
+#define AUTOFS_SUPER_MAGIC 0x0187
+#define CODA_SUPER_MAGIC 0x73757245
+#define EFS_SUPER_MAGIC 0x414A53
+#define EXT2_SUPER_MAGIC 0xEF53
+#define EXT3_SUPER_MAGIC 0xEF53
+#define EXT4_SUPER_MAGIC 0xEF53
+#define HPFS_SUPER_MAGIC 0xf995e849
+#define ISOFS_SUPER_MAGIC 0x9660
+#define JFFS2_SUPER_MAGIC 0x72b6
+#define ANON_INODE_FS_MAGIC 0x09041934
+
+#define MINIX_SUPER_MAGIC 0x137F /* original minix fs */
+#define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */
+#define MINIX2_SUPER_MAGIC 0x2468 /* minix V2 fs */
+#define MINIX2_SUPER_MAGIC2 0x2478 /* minix V2 fs, 30 char names */
+#define MINIX3_SUPER_MAGIC 0x4d5a /* minix V3 fs */
+
+#define MSDOS_SUPER_MAGIC 0x4d44 /* MD */
+#define NCP_SUPER_MAGIC 0x564c /* Guess, what 0x564c is :-) */
+#define NFS_SUPER_MAGIC 0x6969
+#define OPENPROM_SUPER_MAGIC 0x9fa1
+#define PROC_SUPER_MAGIC 0x9fa0
+#define QNX4_SUPER_MAGIC 0x002f /* qnx4 fs detection */
+
+#define REISERFS_SUPER_MAGIC 0x52654973 /* used by gcc */
+ /* used by file system utilities that
+ look at the superblock, etc. */
+#define REISERFS_SUPER_MAGIC_STRING "ReIsErFs"
+#define REISER2FS_SUPER_MAGIC_STRING "ReIsEr2Fs"
+#define REISER2FS_JR_SUPER_MAGIC_STRING "ReIsEr3Fs"
+
+#define SMB_SUPER_MAGIC 0x517B
+#define USBDEVICE_SUPER_MAGIC 0x9fa2
+#define CGROUP_SUPER_MAGIC 0x27e0eb
+
+#define FUTEXFS_SUPER_MAGIC 0xBAD1DEA
+#define INOTIFYFS_SUPER_MAGIC 0x2BAD1DEA
+
+#endif /* __LINUX_MAGIC_H__ */
diff --git a/sysroot/usr/include/linux/major.h b/sysroot/usr/include/linux/major.h
new file mode 100644
index 0000000..0cb9805
--- /dev/null
+++ b/sysroot/usr/include/linux/major.h
@@ -0,0 +1,173 @@
+#ifndef _LINUX_MAJOR_H
+#define _LINUX_MAJOR_H
+
+/*
+ * This file has definitions for major device numbers.
+ * For the device number assignments, see Documentation/devices.txt.
+ */
+
+#define UNNAMED_MAJOR 0
+#define MEM_MAJOR 1
+#define RAMDISK_MAJOR 1
+#define FLOPPY_MAJOR 2
+#define PTY_MASTER_MAJOR 2
+#define IDE0_MAJOR 3
+#define HD_MAJOR IDE0_MAJOR
+#define PTY_SLAVE_MAJOR 3
+#define TTY_MAJOR 4
+#define TTYAUX_MAJOR 5
+#define LP_MAJOR 6
+#define VCS_MAJOR 7
+#define LOOP_MAJOR 7
+#define SCSI_DISK0_MAJOR 8
+#define SCSI_TAPE_MAJOR 9
+#define MD_MAJOR 9
+#define MISC_MAJOR 10
+#define SCSI_CDROM_MAJOR 11
+#define MUX_MAJOR 11 /* PA-RISC only */
+#define XT_DISK_MAJOR 13
+#define INPUT_MAJOR 13
+#define SOUND_MAJOR 14
+#define CDU31A_CDROM_MAJOR 15
+#define JOYSTICK_MAJOR 15
+#define GOLDSTAR_CDROM_MAJOR 16
+#define OPTICS_CDROM_MAJOR 17
+#define SANYO_CDROM_MAJOR 18
+#define CYCLADES_MAJOR 19
+#define CYCLADESAUX_MAJOR 20
+#define MITSUMI_X_CDROM_MAJOR 20
+#define MFM_ACORN_MAJOR 21 /* ARM Linux /dev/mfm */
+#define SCSI_GENERIC_MAJOR 21
+#define IDE1_MAJOR 22
+#define DIGICU_MAJOR 22
+#define DIGI_MAJOR 23
+#define MITSUMI_CDROM_MAJOR 23
+#define CDU535_CDROM_MAJOR 24
+#define STL_SERIALMAJOR 24
+#define MATSUSHITA_CDROM_MAJOR 25
+#define STL_CALLOUTMAJOR 25
+#define MATSUSHITA_CDROM2_MAJOR 26
+#define QIC117_TAPE_MAJOR 27
+#define MATSUSHITA_CDROM3_MAJOR 27
+#define MATSUSHITA_CDROM4_MAJOR 28
+#define STL_SIOMEMMAJOR 28
+#define ACSI_MAJOR 28
+#define AZTECH_CDROM_MAJOR 29
+#define GRAPHDEV_MAJOR 29 /* SparcLinux & Linux/68k /dev/fb */
+#define CM206_CDROM_MAJOR 32
+#define IDE2_MAJOR 33
+#define IDE3_MAJOR 34
+#define Z8530_MAJOR 34
+#define XPRAM_MAJOR 35 /* Expanded storage on S/390: "slow ram"*/
+#define NETLINK_MAJOR 36
+#define PS2ESDI_MAJOR 36
+#define IDETAPE_MAJOR 37
+#define Z2RAM_MAJOR 37
+#define APBLOCK_MAJOR 38 /* AP1000 Block device */
+#define DDV_MAJOR 39 /* AP1000 DDV block device */
+#define NBD_MAJOR 43 /* Network block device */
+#define RISCOM8_NORMAL_MAJOR 48
+#define DAC960_MAJOR 48 /* 48..55 */
+#define RISCOM8_CALLOUT_MAJOR 49
+#define MKISS_MAJOR 55
+#define DSP56K_MAJOR 55 /* DSP56001 processor device */
+
+#define IDE4_MAJOR 56
+#define IDE5_MAJOR 57
+
+#define SCSI_DISK1_MAJOR 65
+#define SCSI_DISK2_MAJOR 66
+#define SCSI_DISK3_MAJOR 67
+#define SCSI_DISK4_MAJOR 68
+#define SCSI_DISK5_MAJOR 69
+#define SCSI_DISK6_MAJOR 70
+#define SCSI_DISK7_MAJOR 71
+
+#define COMPAQ_SMART2_MAJOR 72
+#define COMPAQ_SMART2_MAJOR1 73
+#define COMPAQ_SMART2_MAJOR2 74
+#define COMPAQ_SMART2_MAJOR3 75
+#define COMPAQ_SMART2_MAJOR4 76
+#define COMPAQ_SMART2_MAJOR5 77
+#define COMPAQ_SMART2_MAJOR6 78
+#define COMPAQ_SMART2_MAJOR7 79
+
+#define SPECIALIX_NORMAL_MAJOR 75
+#define SPECIALIX_CALLOUT_MAJOR 76
+
+#define AURORA_MAJOR 79
+
+#define I2O_MAJOR 80 /* 80->87 */
+
+#define SHMIQ_MAJOR 85 /* Linux/mips, SGI /dev/shmiq */
+#define SCSI_CHANGER_MAJOR 86
+
+#define IDE6_MAJOR 88
+#define IDE7_MAJOR 89
+#define IDE8_MAJOR 90
+#define IDE9_MAJOR 91
+
+#define DASD_MAJOR 94
+
+#define MDISK_MAJOR 95
+
+#define UBD_MAJOR 98
+
+#define PP_MAJOR 99
+#define JSFD_MAJOR 99
+
+#define PHONE_MAJOR 100
+
+#define COMPAQ_CISS_MAJOR 104
+#define COMPAQ_CISS_MAJOR1 105
+#define COMPAQ_CISS_MAJOR2 106
+#define COMPAQ_CISS_MAJOR3 107
+#define COMPAQ_CISS_MAJOR4 108
+#define COMPAQ_CISS_MAJOR5 109
+#define COMPAQ_CISS_MAJOR6 110
+#define COMPAQ_CISS_MAJOR7 111
+
+#define VIODASD_MAJOR 112
+#define VIOCD_MAJOR 113
+
+#define ATARAID_MAJOR 114
+
+#define SCSI_DISK8_MAJOR 128
+#define SCSI_DISK9_MAJOR 129
+#define SCSI_DISK10_MAJOR 130
+#define SCSI_DISK11_MAJOR 131
+#define SCSI_DISK12_MAJOR 132
+#define SCSI_DISK13_MAJOR 133
+#define SCSI_DISK14_MAJOR 134
+#define SCSI_DISK15_MAJOR 135
+
+#define UNIX98_PTY_MASTER_MAJOR 128
+#define UNIX98_PTY_MAJOR_COUNT 8
+#define UNIX98_PTY_SLAVE_MAJOR (UNIX98_PTY_MASTER_MAJOR+UNIX98_PTY_MAJOR_COUNT)
+
+#define RTF_MAJOR 150
+#define RAW_MAJOR 162
+
+#define USB_ACM_MAJOR 166
+#define USB_ACM_AUX_MAJOR 167
+#define USB_CHAR_MAJOR 180
+
+#define MMC_BLOCK_MAJOR 179
+
+#define VXVM_MAJOR 199 /* VERITAS volume i/o driver */
+#define VXSPEC_MAJOR 200 /* VERITAS volume config driver */
+#define VXDMP_MAJOR 201 /* VERITAS volume multipath driver */
+
+#define XENVBD_MAJOR 202 /* Xen virtual block device */
+
+#define MSR_MAJOR 202
+#define CPUID_MAJOR 203
+
+#define OSST_MAJOR 206 /* OnStream-SCx0 SCSI tape */
+
+#define IBM_TTY3270_MAJOR 227
+#define IBM_FS3270_MAJOR 228
+
+#define VIOTAPE_MAJOR 230
+
+#endif
diff --git a/sysroot/usr/include/linux/matroxfb.h b/sysroot/usr/include/linux/matroxfb.h
new file mode 100644
index 0000000..ae5b094
--- /dev/null
+++ b/sysroot/usr/include/linux/matroxfb.h
@@ -0,0 +1,43 @@
+#ifndef __LINUX_MATROXFB_H__
+#define __LINUX_MATROXFB_H__
+
+#include <asm/ioctl.h>
+#include <asm/types.h>
+#include <linux/videodev2.h>
+
+struct matroxioc_output_mode {
+ __u32 output; /* which output */
+#define MATROXFB_OUTPUT_PRIMARY 0x0000
+#define MATROXFB_OUTPUT_SECONDARY 0x0001
+#define MATROXFB_OUTPUT_DFP 0x0002
+ __u32 mode; /* which mode */
+#define MATROXFB_OUTPUT_MODE_PAL 0x0001
+#define MATROXFB_OUTPUT_MODE_NTSC 0x0002
+#define MATROXFB_OUTPUT_MODE_MONITOR 0x0080
+};
+#define MATROXFB_SET_OUTPUT_MODE _IOW('n',0xFA,size_t)
+#define MATROXFB_GET_OUTPUT_MODE _IOWR('n',0xFA,size_t)
+
+/* bitfield */
+#define MATROXFB_OUTPUT_CONN_PRIMARY (1 << MATROXFB_OUTPUT_PRIMARY)
+#define MATROXFB_OUTPUT_CONN_SECONDARY (1 << MATROXFB_OUTPUT_SECONDARY)
+#define MATROXFB_OUTPUT_CONN_DFP (1 << MATROXFB_OUTPUT_DFP)
+/* connect these outputs to this framebuffer */
+#define MATROXFB_SET_OUTPUT_CONNECTION _IOW('n',0xF8,size_t)
+/* which outputs are connected to this framebuffer */
+#define MATROXFB_GET_OUTPUT_CONNECTION _IOR('n',0xF8,size_t)
+/* which outputs are available for this framebuffer */
+#define MATROXFB_GET_AVAILABLE_OUTPUTS _IOR('n',0xF9,size_t)
+/* which outputs exist on this framebuffer */
+#define MATROXFB_GET_ALL_OUTPUTS _IOR('n',0xFB,size_t)
+
+enum matroxfb_ctrl_id {
+ MATROXFB_CID_TESTOUT = V4L2_CID_PRIVATE_BASE,
+ MATROXFB_CID_DEFLICKER,
+ MATROXFB_CID_LAST
+};
+
+#define FBIO_WAITFORVSYNC _IOW('F', 0x20, u_int32_t)
+
+#endif
+
diff --git a/sysroot/usr/include/linux/mempolicy.h b/sysroot/usr/include/linux/mempolicy.h
new file mode 100644
index 0000000..69304cc
--- /dev/null
+++ b/sysroot/usr/include/linux/mempolicy.h
@@ -0,0 +1,31 @@
+#ifndef _LINUX_MEMPOLICY_H
+#define _LINUX_MEMPOLICY_H 1
+
+#include <linux/errno.h>
+
+/*
+ * NUMA memory policies for Linux.
+ * Copyright 2003,2004 Andi Kleen SuSE Labs
+ */
+
+/* Policies */
+#define MPOL_DEFAULT 0
+#define MPOL_PREFERRED 1
+#define MPOL_BIND 2
+#define MPOL_INTERLEAVE 3
+
+#define MPOL_MAX MPOL_INTERLEAVE
+
+/* Flags for get_mem_policy */
+#define MPOL_F_NODE (1<<0) /* return next IL mode instead of node mask */
+#define MPOL_F_ADDR (1<<1) /* look up vma using address */
+#define MPOL_F_MEMS_ALLOWED (1<<2) /* return allowed memories */
+
+/* Flags for mbind */
+#define MPOL_MF_STRICT (1<<0) /* Verify existing pages in the mapping */
+#define MPOL_MF_MOVE (1<<1) /* Move pages owned by this process to conform to mapping */
+#define MPOL_MF_MOVE_ALL (1<<2) /* Move every page to conform to mapping */
+#define MPOL_MF_INTERNAL (1<<3) /* Internal flags start here */
+
+
+#endif
diff --git a/sysroot/usr/include/linux/meye.h b/sysroot/usr/include/linux/meye.h
new file mode 100644
index 0000000..39fd9c8
--- /dev/null
+++ b/sysroot/usr/include/linux/meye.h
@@ -0,0 +1,66 @@
+/*
+ * Motion Eye video4linux driver for Sony Vaio PictureBook
+ *
+ * Copyright (C) 2001-2003 Stelian Pop <stelian@popies.net>
+ *
+ * Copyright (C) 2001-2002 Alcôve <www.alcove.com>
+ *
+ * Copyright (C) 2000 Andrew Tridgell <tridge@valinux.com>
+ *
+ * Earlier work by Werner Almesberger, Paul `Rusty' Russell and Paul Mackerras.
+ *
+ * Some parts borrowed from various video4linux drivers, especially
+ * bttv-driver.c and zoran.c, see original files for credits.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef _MEYE_H_
+#define _MEYE_H_
+
+/****************************************************************************/
+/* Private API for handling mjpeg capture / playback. */
+/****************************************************************************/
+
+struct meye_params {
+ unsigned char subsample;
+ unsigned char quality;
+ unsigned char sharpness;
+ unsigned char agc;
+ unsigned char picture;
+ unsigned char framerate;
+};
+
+/* query the extended parameters */
+#define MEYEIOC_G_PARAMS _IOR ('v', BASE_VIDIOCPRIVATE+0, struct meye_params)
+/* set the extended parameters */
+#define MEYEIOC_S_PARAMS _IOW ('v', BASE_VIDIOCPRIVATE+1, struct meye_params)
+/* queue a buffer for mjpeg capture */
+#define MEYEIOC_QBUF_CAPT _IOW ('v', BASE_VIDIOCPRIVATE+2, int)
+/* sync a previously queued mjpeg buffer */
+#define MEYEIOC_SYNC _IOWR('v', BASE_VIDIOCPRIVATE+3, int)
+/* get a still uncompressed snapshot */
+#define MEYEIOC_STILLCAPT _IO ('v', BASE_VIDIOCPRIVATE+4)
+/* get a jpeg compressed snapshot */
+#define MEYEIOC_STILLJCAPT _IOR ('v', BASE_VIDIOCPRIVATE+5, int)
+
+/* V4L2 private controls */
+#define V4L2_CID_AGC V4L2_CID_PRIVATE_BASE
+#define V4L2_CID_SHARPNESS (V4L2_CID_PRIVATE_BASE + 1)
+#define V4L2_CID_PICTURE (V4L2_CID_PRIVATE_BASE + 2)
+#define V4L2_CID_JPEGQUAL (V4L2_CID_PRIVATE_BASE + 3)
+#define V4L2_CID_FRAMERATE (V4L2_CID_PRIVATE_BASE + 4)
+
+#endif
diff --git a/sysroot/usr/include/linux/mii.h b/sysroot/usr/include/linux/mii.h
new file mode 100644
index 0000000..5c6d7aa
--- /dev/null
+++ b/sysroot/usr/include/linux/mii.h
@@ -0,0 +1,146 @@
+/*
+ * linux/mii.h: definitions for MII-compatible transceivers
+ * Originally drivers/net/sunhme.h.
+ *
+ * Copyright (C) 1996, 1999, 2001 David S. Miller (davem@redhat.com)
+ */
+
+#ifndef __LINUX_MII_H__
+#define __LINUX_MII_H__
+
+#include <linux/types.h>
+
+/* Generic MII registers. */
+
+#define MII_BMCR 0x00 /* Basic mode control register */
+#define MII_BMSR 0x01 /* Basic mode status register */
+#define MII_PHYSID1 0x02 /* PHYS ID 1 */
+#define MII_PHYSID2 0x03 /* PHYS ID 2 */
+#define MII_ADVERTISE 0x04 /* Advertisement control reg */
+#define MII_LPA 0x05 /* Link partner ability reg */
+#define MII_EXPANSION 0x06 /* Expansion register */
+#define MII_CTRL1000 0x09 /* 1000BASE-T control */
+#define MII_STAT1000 0x0a /* 1000BASE-T status */
+#define MII_ESTATUS 0x0f /* Extended Status */
+#define MII_DCOUNTER 0x12 /* Disconnect counter */
+#define MII_FCSCOUNTER 0x13 /* False carrier counter */
+#define MII_NWAYTEST 0x14 /* N-way auto-neg test reg */
+#define MII_RERRCOUNTER 0x15 /* Receive error counter */
+#define MII_SREVISION 0x16 /* Silicon revision */
+#define MII_RESV1 0x17 /* Reserved... */
+#define MII_LBRERROR 0x18 /* Lpback, rx, bypass error */
+#define MII_PHYADDR 0x19 /* PHY address */
+#define MII_RESV2 0x1a /* Reserved... */
+#define MII_TPISTATUS 0x1b /* TPI status for 10mbps */
+#define MII_NCONFIG 0x1c /* Network interface config */
+
+/* Basic mode control register. */
+#define BMCR_RESV 0x003f /* Unused... */
+#define BMCR_SPEED1000 0x0040 /* MSB of Speed (1000) */
+#define BMCR_CTST 0x0080 /* Collision test */
+#define BMCR_FULLDPLX 0x0100 /* Full duplex */
+#define BMCR_ANRESTART 0x0200 /* Auto negotiation restart */
+#define BMCR_ISOLATE 0x0400 /* Disconnect DP83840 from MII */
+#define BMCR_PDOWN 0x0800 /* Powerdown the DP83840 */
+#define BMCR_ANENABLE 0x1000 /* Enable auto negotiation */
+#define BMCR_SPEED100 0x2000 /* Select 100Mbps */
+#define BMCR_LOOPBACK 0x4000 /* TXD loopback bits */
+#define BMCR_RESET 0x8000 /* Reset the DP83840 */
+
+/* Basic mode status register. */
+#define BMSR_ERCAP 0x0001 /* Ext-reg capability */
+#define BMSR_JCD 0x0002 /* Jabber detected */
+#define BMSR_LSTATUS 0x0004 /* Link status */
+#define BMSR_ANEGCAPABLE 0x0008 /* Able to do auto-negotiation */
+#define BMSR_RFAULT 0x0010 /* Remote fault detected */
+#define BMSR_ANEGCOMPLETE 0x0020 /* Auto-negotiation complete */
+#define BMSR_RESV 0x00c0 /* Unused... */
+#define BMSR_ESTATEN 0x0100 /* Extended Status in R15 */
+#define BMSR_100HALF2 0x0200 /* Can do 100BASE-T2 HDX */
+#define BMSR_100FULL2 0x0400 /* Can do 100BASE-T2 FDX */
+#define BMSR_10HALF 0x0800 /* Can do 10mbps, half-duplex */
+#define BMSR_10FULL 0x1000 /* Can do 10mbps, full-duplex */
+#define BMSR_100HALF 0x2000 /* Can do 100mbps, half-duplex */
+#define BMSR_100FULL 0x4000 /* Can do 100mbps, full-duplex */
+#define BMSR_100BASE4 0x8000 /* Can do 100mbps, 4k packets */
+
+/* Advertisement control register. */
+#define ADVERTISE_SLCT 0x001f /* Selector bits */
+#define ADVERTISE_CSMA 0x0001 /* Only selector supported */
+#define ADVERTISE_10HALF 0x0020 /* Try for 10mbps half-duplex */
+#define ADVERTISE_1000XFULL 0x0020 /* Try for 1000BASE-X full-duplex */
+#define ADVERTISE_10FULL 0x0040 /* Try for 10mbps full-duplex */
+#define ADVERTISE_1000XHALF 0x0040 /* Try for 1000BASE-X half-duplex */
+#define ADVERTISE_100HALF 0x0080 /* Try for 100mbps half-duplex */
+#define ADVERTISE_1000XPAUSE 0x0080 /* Try for 1000BASE-X pause */
+#define ADVERTISE_100FULL 0x0100 /* Try for 100mbps full-duplex */
+#define ADVERTISE_1000XPSE_ASYM 0x0100 /* Try for 1000BASE-X asym pause */
+#define ADVERTISE_100BASE4 0x0200 /* Try for 100mbps 4k packets */
+#define ADVERTISE_PAUSE_CAP 0x0400 /* Try for pause */
+#define ADVERTISE_PAUSE_ASYM 0x0800 /* Try for asymetric pause */
+#define ADVERTISE_RESV 0x1000 /* Unused... */
+#define ADVERTISE_RFAULT 0x2000 /* Say we can detect faults */
+#define ADVERTISE_LPACK 0x4000 /* Ack link partners response */
+#define ADVERTISE_NPAGE 0x8000 /* Next page bit */
+
+#define ADVERTISE_FULL (ADVERTISE_100FULL | ADVERTISE_10FULL | \
+ ADVERTISE_CSMA)
+#define ADVERTISE_ALL (ADVERTISE_10HALF | ADVERTISE_10FULL | \
+ ADVERTISE_100HALF | ADVERTISE_100FULL)
+
+/* Link partner ability register. */
+#define LPA_SLCT 0x001f /* Same as advertise selector */
+#define LPA_10HALF 0x0020 /* Can do 10mbps half-duplex */
+#define LPA_1000XFULL 0x0020 /* Can do 1000BASE-X full-duplex */
+#define LPA_10FULL 0x0040 /* Can do 10mbps full-duplex */
+#define LPA_1000XHALF 0x0040 /* Can do 1000BASE-X half-duplex */
+#define LPA_100HALF 0x0080 /* Can do 100mbps half-duplex */
+#define LPA_1000XPAUSE 0x0080 /* Can do 1000BASE-X pause */
+#define LPA_100FULL 0x0100 /* Can do 100mbps full-duplex */
+#define LPA_1000XPAUSE_ASYM 0x0100 /* Can do 1000BASE-X pause asym*/
+#define LPA_100BASE4 0x0200 /* Can do 100mbps 4k packets */
+#define LPA_PAUSE_CAP 0x0400 /* Can pause */
+#define LPA_PAUSE_ASYM 0x0800 /* Can pause asymetrically */
+#define LPA_RESV 0x1000 /* Unused... */
+#define LPA_RFAULT 0x2000 /* Link partner faulted */
+#define LPA_LPACK 0x4000 /* Link partner acked us */
+#define LPA_NPAGE 0x8000 /* Next page bit */
+
+#define LPA_DUPLEX (LPA_10FULL | LPA_100FULL)
+#define LPA_100 (LPA_100FULL | LPA_100HALF | LPA_100BASE4)
+
+/* Expansion register for auto-negotiation. */
+#define EXPANSION_NWAY 0x0001 /* Can do N-way auto-nego */
+#define EXPANSION_LCWP 0x0002 /* Got new RX page code word */
+#define EXPANSION_ENABLENPAGE 0x0004 /* This enables npage words */
+#define EXPANSION_NPCAPABLE 0x0008 /* Link partner supports npage */
+#define EXPANSION_MFAULTS 0x0010 /* Multiple faults detected */
+#define EXPANSION_RESV 0xffe0 /* Unused... */
+
+#define ESTATUS_1000_TFULL 0x2000 /* Can do 1000BT Full */
+#define ESTATUS_1000_THALF 0x1000 /* Can do 1000BT Half */
+
+/* N-way test register. */
+#define NWAYTEST_RESV1 0x00ff /* Unused... */
+#define NWAYTEST_LOOPBACK 0x0100 /* Enable loopback for N-way */
+#define NWAYTEST_RESV2 0xfe00 /* Unused... */
+
+/* 1000BASE-T Control register */
+#define ADVERTISE_1000FULL 0x0200 /* Advertise 1000BASE-T full duplex */
+#define ADVERTISE_1000HALF 0x0100 /* Advertise 1000BASE-T half duplex */
+
+/* 1000BASE-T Status register */
+#define LPA_1000LOCALRXOK 0x2000 /* Link partner local receiver status */
+#define LPA_1000REMRXOK 0x1000 /* Link partner remote receiver status */
+#define LPA_1000FULL 0x0800 /* Link partner 1000BASE-T full duplex */
+#define LPA_1000HALF 0x0400 /* Link partner 1000BASE-T half duplex */
+
+/* This structure is used in all SIOCxMIIxxx ioctl calls */
+struct mii_ioctl_data {
+ __u16 phy_id;
+ __u16 reg_num;
+ __u16 val_in;
+ __u16 val_out;
+};
+
+#endif /* __LINUX_MII_H__ */
diff --git a/sysroot/usr/include/linux/minix_fs.h b/sysroot/usr/include/linux/minix_fs.h
new file mode 100644
index 0000000..0e39745
--- /dev/null
+++ b/sysroot/usr/include/linux/minix_fs.h
@@ -0,0 +1,105 @@
+#ifndef _LINUX_MINIX_FS_H
+#define _LINUX_MINIX_FS_H
+
+#include <linux/magic.h>
+
+/*
+ * The minix filesystem constants/structures
+ */
+
+/*
+ * Thanks to Kees J Bot for sending me the definitions of the new
+ * minix filesystem (aka V2) with bigger inodes and 32-bit block
+ * pointers.
+ */
+
+#define MINIX_ROOT_INO 1
+
+/* Not the same as the bogus LINK_MAX in <linux/limits.h>. Oh well. */
+#define MINIX_LINK_MAX 250
+#define MINIX2_LINK_MAX 65530
+
+#define MINIX_I_MAP_SLOTS 8
+#define MINIX_Z_MAP_SLOTS 64
+#define MINIX_VALID_FS 0x0001 /* Clean fs. */
+#define MINIX_ERROR_FS 0x0002 /* fs has errors. */
+
+#define MINIX_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix_inode)))
+
+/*
+ * This is the original minix inode layout on disk.
+ * Note the 8-bit gid and atime and ctime.
+ */
+struct minix_inode {
+ __u16 i_mode;
+ __u16 i_uid;
+ __u32 i_size;
+ __u32 i_time;
+ __u8 i_gid;
+ __u8 i_nlinks;
+ __u16 i_zone[9];
+};
+
+/*
+ * The new minix inode has all the time entries, as well as
+ * long block numbers and a third indirect block (7+1+1+1
+ * instead of 7+1+1). Also, some previously 8-bit values are
+ * now 16-bit. The inode is now 64 bytes instead of 32.
+ */
+struct minix2_inode {
+ __u16 i_mode;
+ __u16 i_nlinks;
+ __u16 i_uid;
+ __u16 i_gid;
+ __u32 i_size;
+ __u32 i_atime;
+ __u32 i_mtime;
+ __u32 i_ctime;
+ __u32 i_zone[10];
+};
+
+/*
+ * minix super-block data on disk
+ */
+struct minix_super_block {
+ __u16 s_ninodes;
+ __u16 s_nzones;
+ __u16 s_imap_blocks;
+ __u16 s_zmap_blocks;
+ __u16 s_firstdatazone;
+ __u16 s_log_zone_size;
+ __u32 s_max_size;
+ __u16 s_magic;
+ __u16 s_state;
+ __u32 s_zones;
+};
+
+/*
+ * V3 minix super-block data on disk
+ */
+struct minix3_super_block {
+ __u32 s_ninodes;
+ __u16 s_pad0;
+ __u16 s_imap_blocks;
+ __u16 s_zmap_blocks;
+ __u16 s_firstdatazone;
+ __u16 s_log_zone_size;
+ __u16 s_pad1;
+ __u32 s_max_size;
+ __u32 s_zones;
+ __u16 s_magic;
+ __u16 s_pad2;
+ __u16 s_blocksize;
+ __u8 s_disk_version;
+};
+
+struct minix_dir_entry {
+ __u16 inode;
+ char name[0];
+};
+
+struct minix3_dir_entry {
+ __u32 inode;
+ char name[0];
+};
+#endif
diff --git a/sysroot/usr/include/linux/mman.h b/sysroot/usr/include/linux/mman.h
new file mode 100644
index 0000000..36b3004
--- /dev/null
+++ b/sysroot/usr/include/linux/mman.h
@@ -0,0 +1,13 @@
+#ifndef _LINUX_MMAN_H
+#define _LINUX_MMAN_H
+
+#include <asm/mman.h>
+
+#define MREMAP_MAYMOVE 1
+#define MREMAP_FIXED 2
+
+#define OVERCOMMIT_GUESS 0
+#define OVERCOMMIT_ALWAYS 1
+#define OVERCOMMIT_NEVER 2
+
+#endif /* _LINUX_MMAN_H */
diff --git a/sysroot/usr/include/linux/mmtimer.h b/sysroot/usr/include/linux/mmtimer.h
new file mode 100644
index 0000000..884cabf
--- /dev/null
+++ b/sysroot/usr/include/linux/mmtimer.h
@@ -0,0 +1,56 @@
+/*
+ * Intel Multimedia Timer device interface
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (c) 2001-2004 Silicon Graphics, Inc. All rights reserved.
+ *
+ * This file should define an interface compatible with the IA-PC Multimedia
+ * Timers Draft Specification (rev. 0.97) from Intel. Note that some
+ * hardware may not be able to safely export its registers to userspace,
+ * so the ioctl interface should support all necessary functionality.
+ *
+ * 11/01/01 - jbarnes - initial revision
+ * 9/10/04 - Christoph Lameter - remove interrupt support
+ * 9/17/04 - jbarnes - remove test program, move some #defines to the driver
+ */
+
+#ifndef _LINUX_MMTIMER_H
+#define _LINUX_MMTIMER_H
+
+/*
+ * Breakdown of the ioctl's available. An 'optional' next to the command
+ * indicates that supporting this command is optional, while 'required'
+ * commands must be implemented if conformance is desired.
+ *
+ * MMTIMER_GETOFFSET - optional
+ * Should return the offset (relative to the start of the page where the
+ * registers are mapped) for the counter in question.
+ *
+ * MMTIMER_GETRES - required
+ * The resolution of the clock in femto (10^-15) seconds
+ *
+ * MMTIMER_GETFREQ - required
+ * Frequency of the clock in Hz
+ *
+ * MMTIMER_GETBITS - required
+ * Number of bits in the clock's counter
+ *
+ * MMTIMER_MMAPAVAIL - required
+ * Returns nonzero if the registers can be mmap'd into userspace, 0 otherwise
+ *
+ * MMTIMER_GETCOUNTER - required
+ * Gets the current value in the counter
+ */
+#define MMTIMER_IOCTL_BASE 'm'
+
+#define MMTIMER_GETOFFSET _IO(MMTIMER_IOCTL_BASE, 0)
+#define MMTIMER_GETRES _IOR(MMTIMER_IOCTL_BASE, 1, unsigned long)
+#define MMTIMER_GETFREQ _IOR(MMTIMER_IOCTL_BASE, 2, unsigned long)
+#define MMTIMER_GETBITS _IO(MMTIMER_IOCTL_BASE, 4)
+#define MMTIMER_MMAPAVAIL _IO(MMTIMER_IOCTL_BASE, 6)
+#define MMTIMER_GETCOUNTER _IOR(MMTIMER_IOCTL_BASE, 9, unsigned long)
+
+#endif /* _LINUX_MMTIMER_H */
diff --git a/sysroot/usr/include/linux/mqueue.h b/sysroot/usr/include/linux/mqueue.h
new file mode 100644
index 0000000..8b5a796
--- /dev/null
+++ b/sysroot/usr/include/linux/mqueue.h
@@ -0,0 +1,53 @@
+/* Copyright (C) 2003 Krzysztof Benedyczak & Michal Wronski
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ It is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _LINUX_MQUEUE_H
+#define _LINUX_MQUEUE_H
+
+#define MQ_PRIO_MAX 32768
+/* per-uid limit of kernel memory used by mqueue, in bytes */
+#define MQ_BYTES_MAX 819200
+
+struct mq_attr {
+ long mq_flags; /* message queue flags */
+ long mq_maxmsg; /* maximum number of messages */
+ long mq_msgsize; /* maximum message size */
+ long mq_curmsgs; /* number of messages currently queued */
+ long __reserved[4]; /* ignored for input, zeroed for output */
+};
+
+/*
+ * SIGEV_THREAD implementation:
+ * SIGEV_THREAD must be implemented in user space. If SIGEV_THREAD is passed
+ * to mq_notify, then
+ * - sigev_signo must be the file descriptor of an AF_NETLINK socket. It's not
+ * necessary that the socket is bound.
+ * - sigev_value.sival_ptr must point to a cookie that is NOTIFY_COOKIE_LEN
+ * bytes long.
+ * If the notification is triggered, then the cookie is sent to the netlink
+ * socket. The last byte of the cookie is replaced with the NOTIFY_?? codes:
+ * NOTIFY_WOKENUP if the notification got triggered, NOTIFY_REMOVED if it was
+ * removed, either due to a close() on the message queue fd or due to a
+ * mq_notify() that removed the notification.
+ */
+#define NOTIFY_NONE 0
+#define NOTIFY_WOKENUP 1
+#define NOTIFY_REMOVED 2
+
+#define NOTIFY_COOKIE_LEN 32
+
+#endif
diff --git a/sysroot/usr/include/linux/mroute.h b/sysroot/usr/include/linux/mroute.h
new file mode 100644
index 0000000..1750da6
--- /dev/null
+++ b/sysroot/usr/include/linux/mroute.h
@@ -0,0 +1,141 @@
+#ifndef __LINUX_MROUTE_H
+#define __LINUX_MROUTE_H
+
+#include <linux/sockios.h>
+#include <linux/in.h>
+
+/*
+ * Based on the MROUTING 3.5 defines primarily to keep
+ * source compatibility with BSD.
+ *
+ * See the mrouted code for the original history.
+ *
+ * Protocol Independent Multicast (PIM) data structures included
+ * Carlos Picoto (cap@di.fc.ul.pt)
+ *
+ */
+
+#define MRT_BASE 200
+#define MRT_INIT (MRT_BASE) /* Activate the kernel mroute code */
+#define MRT_DONE (MRT_BASE+1) /* Shutdown the kernel mroute */
+#define MRT_ADD_VIF (MRT_BASE+2) /* Add a virtual interface */
+#define MRT_DEL_VIF (MRT_BASE+3) /* Delete a virtual interface */
+#define MRT_ADD_MFC (MRT_BASE+4) /* Add a multicast forwarding entry */
+#define MRT_DEL_MFC (MRT_BASE+5) /* Delete a multicast forwarding entry */
+#define MRT_VERSION (MRT_BASE+6) /* Get the kernel multicast version */
+#define MRT_ASSERT (MRT_BASE+7) /* Activate PIM assert mode */
+#define MRT_PIM (MRT_BASE+8) /* enable PIM code */
+
+#define SIOCGETVIFCNT SIOCPROTOPRIVATE /* IP protocol privates */
+#define SIOCGETSGCNT (SIOCPROTOPRIVATE+1)
+#define SIOCGETRPF (SIOCPROTOPRIVATE+2)
+
+#define MAXVIFS 32
+typedef unsigned long vifbitmap_t; /* User mode code depends on this lot */
+typedef unsigned short vifi_t;
+#define ALL_VIFS ((vifi_t)(-1))
+
+/*
+ * Same idea as select
+ */
+
+#define VIFM_SET(n,m) ((m)|=(1<<(n)))
+#define VIFM_CLR(n,m) ((m)&=~(1<<(n)))
+#define VIFM_ISSET(n,m) ((m)&(1<<(n)))
+#define VIFM_CLRALL(m) ((m)=0)
+#define VIFM_COPY(mfrom,mto) ((mto)=(mfrom))
+#define VIFM_SAME(m1,m2) ((m1)==(m2))
+
+/*
+ * Passed by mrouted for an MRT_ADD_VIF - again we use the
+ * mrouted 3.6 structures for compatibility
+ */
+
+struct vifctl {
+ vifi_t vifc_vifi; /* Index of VIF */
+ unsigned char vifc_flags; /* VIFF_ flags */
+ unsigned char vifc_threshold; /* ttl limit */
+ unsigned int vifc_rate_limit; /* Rate limiter values (NI) */
+ struct in_addr vifc_lcl_addr; /* Our address */
+ struct in_addr vifc_rmt_addr; /* IPIP tunnel addr */
+};
+
+#define VIFF_TUNNEL 0x1 /* IPIP tunnel */
+#define VIFF_SRCRT 0x2 /* NI */
+#define VIFF_REGISTER 0x4 /* register vif */
+
+/*
+ * Cache manipulation structures for mrouted and PIMd
+ */
+
+struct mfcctl
+{
+ struct in_addr mfcc_origin; /* Origin of mcast */
+ struct in_addr mfcc_mcastgrp; /* Group in question */
+ vifi_t mfcc_parent; /* Where it arrived */
+ unsigned char mfcc_ttls[MAXVIFS]; /* Where it is going */
+ unsigned int mfcc_pkt_cnt; /* pkt count for src-grp */
+ unsigned int mfcc_byte_cnt;
+ unsigned int mfcc_wrong_if;
+ int mfcc_expire;
+};
+
+/*
+ * Group count retrieval for mrouted
+ */
+
+struct sioc_sg_req
+{
+ struct in_addr src;
+ struct in_addr grp;
+ unsigned long pktcnt;
+ unsigned long bytecnt;
+ unsigned long wrong_if;
+};
+
+/*
+ * To get vif packet counts
+ */
+
+struct sioc_vif_req
+{
+ vifi_t vifi; /* Which iface */
+ unsigned long icount; /* In packets */
+ unsigned long ocount; /* Out packets */
+ unsigned long ibytes; /* In bytes */
+ unsigned long obytes; /* Out bytes */
+};
+
+/*
+ * This is the format the mroute daemon expects to see IGMP control
+ * data. Magically happens to be like an IP packet as per the original
+ */
+
+struct igmpmsg
+{
+ __u32 unused1,unused2;
+ unsigned char im_msgtype; /* What is this */
+ unsigned char im_mbz; /* Must be zero */
+ unsigned char im_vif; /* Interface (this ought to be a vifi_t!) */
+ unsigned char unused3;
+ struct in_addr im_src,im_dst;
+};
+
+/*
+ * That's all usermode folks
+ */
+
+
+
+#define MFC_ASSERT_THRESH (3*HZ) /* Maximal freq. of asserts */
+
+/*
+ * Pseudo messages used by mrouted
+ */
+
+#define IGMPMSG_NOCACHE 1 /* Kern cache fill request to mrouted */
+#define IGMPMSG_WRONGVIF 2 /* For PIM assert processing (unused) */
+#define IGMPMSG_WHOLEPKT 3 /* For PIM Register processing */
+
+
+#endif
diff --git a/sysroot/usr/include/linux/msdos_fs.h b/sysroot/usr/include/linux/msdos_fs.h
new file mode 100644
index 0000000..061eea2
--- /dev/null
+++ b/sysroot/usr/include/linux/msdos_fs.h
@@ -0,0 +1,182 @@
+#ifndef _LINUX_MSDOS_FS_H
+#define _LINUX_MSDOS_FS_H
+
+#include <linux/magic.h>
+
+/*
+ * The MS-DOS filesystem constants/structures
+ */
+#include <asm/byteorder.h>
+
+#define SECTOR_SIZE 512 /* sector size (bytes) */
+#define SECTOR_BITS 9 /* log2(SECTOR_SIZE) */
+#define MSDOS_DPB (MSDOS_DPS) /* dir entries per block */
+#define MSDOS_DPB_BITS 4 /* log2(MSDOS_DPB) */
+#define MSDOS_DPS (SECTOR_SIZE / sizeof(struct msdos_dir_entry))
+#define MSDOS_DPS_BITS 4 /* log2(MSDOS_DPS) */
+#define CF_LE_W(v) le16_to_cpu(v)
+#define CF_LE_L(v) le32_to_cpu(v)
+#define CT_LE_W(v) cpu_to_le16(v)
+#define CT_LE_L(v) cpu_to_le32(v)
+
+
+#define MSDOS_ROOT_INO 1 /* == MINIX_ROOT_INO */
+#define MSDOS_DIR_BITS 5 /* log2(sizeof(struct msdos_dir_entry)) */
+
+/* directory limit */
+#define FAT_MAX_DIR_ENTRIES (65536)
+#define FAT_MAX_DIR_SIZE (FAT_MAX_DIR_ENTRIES << MSDOS_DIR_BITS)
+
+#define ATTR_NONE 0 /* no attribute bits */
+#define ATTR_RO 1 /* read-only */
+#define ATTR_HIDDEN 2 /* hidden */
+#define ATTR_SYS 4 /* system */
+#define ATTR_VOLUME 8 /* volume label */
+#define ATTR_DIR 16 /* directory */
+#define ATTR_ARCH 32 /* archived */
+
+/* attribute bits that are copied "as is" */
+#define ATTR_UNUSED (ATTR_VOLUME | ATTR_ARCH | ATTR_SYS | ATTR_HIDDEN)
+/* bits that are used by the Windows 95/Windows NT extended FAT */
+#define ATTR_EXT (ATTR_RO | ATTR_HIDDEN | ATTR_SYS | ATTR_VOLUME)
+
+#define CASE_LOWER_BASE 8 /* base is lower case */
+#define CASE_LOWER_EXT 16 /* extension is lower case */
+
+#define DELETED_FLAG 0xe5 /* marks file as deleted when in name[0] */
+#define IS_FREE(n) (!*(n) || *(n) == DELETED_FLAG)
+
+/* valid file mode bits */
+#define MSDOS_VALID_MODE (S_IFREG | S_IFDIR | S_IRWXU | S_IRWXG | S_IRWXO)
+/* Convert attribute bits and a mask to the UNIX mode. */
+#define MSDOS_MKMODE(a, m) (m & (a & ATTR_RO ? S_IRUGO|S_IXUGO : S_IRWXUGO))
+
+#define MSDOS_NAME 11 /* maximum name length */
+#define MSDOS_LONGNAME 256 /* maximum name length */
+#define MSDOS_SLOTS 21 /* max # of slots for short and long names */
+#define MSDOS_DOT ". " /* ".", padded to MSDOS_NAME chars */
+#define MSDOS_DOTDOT ".. " /* "..", padded to MSDOS_NAME chars */
+
+/* media of boot sector */
+#define FAT_VALID_MEDIA(x) ((0xF8 <= (x) && (x) <= 0xFF) || (x) == 0xF0)
+#define FAT_FIRST_ENT(s, x) ((MSDOS_SB(s)->fat_bits == 32 ? 0x0FFFFF00 : \
+ MSDOS_SB(s)->fat_bits == 16 ? 0xFF00 : 0xF00) | (x))
+
+/* start of data cluster's entry (number of reserved clusters) */
+#define FAT_START_ENT 2
+
+/* maximum number of clusters */
+#define MAX_FAT12 0xFF4
+#define MAX_FAT16 0xFFF4
+#define MAX_FAT32 0x0FFFFFF6
+#define MAX_FAT(s) (MSDOS_SB(s)->fat_bits == 32 ? MAX_FAT32 : \
+ MSDOS_SB(s)->fat_bits == 16 ? MAX_FAT16 : MAX_FAT12)
+
+/* bad cluster mark */
+#define BAD_FAT12 0xFF7
+#define BAD_FAT16 0xFFF7
+#define BAD_FAT32 0x0FFFFFF7
+
+/* standard EOF */
+#define EOF_FAT12 0xFFF
+#define EOF_FAT16 0xFFFF
+#define EOF_FAT32 0x0FFFFFFF
+
+#define FAT_ENT_FREE (0)
+#define FAT_ENT_BAD (BAD_FAT32)
+#define FAT_ENT_EOF (EOF_FAT32)
+
+#define FAT_FSINFO_SIG1 0x41615252
+#define FAT_FSINFO_SIG2 0x61417272
+#define IS_FSINFO(x) (le32_to_cpu((x)->signature1) == FAT_FSINFO_SIG1 \
+ && le32_to_cpu((x)->signature2) == FAT_FSINFO_SIG2)
+
+/*
+ * ioctl commands
+ */
+#define VFAT_IOCTL_READDIR_BOTH _IOR('r', 1, struct dirent [2])
+#define VFAT_IOCTL_READDIR_SHORT _IOR('r', 2, struct dirent [2])
+/* <linux/videotext.h> has used 0x72 ('r') in collision, so skip a few */
+#define FAT_IOCTL_GET_ATTRIBUTES _IOR('r', 0x10, __u32)
+#define FAT_IOCTL_SET_ATTRIBUTES _IOW('r', 0x11, __u32)
+
+/*
+ * vfat shortname flags
+ */
+#define VFAT_SFN_DISPLAY_LOWER 0x0001 /* convert to lowercase for display */
+#define VFAT_SFN_DISPLAY_WIN95 0x0002 /* emulate win95 rule for display */
+#define VFAT_SFN_DISPLAY_WINNT 0x0004 /* emulate winnt rule for display */
+#define VFAT_SFN_CREATE_WIN95 0x0100 /* emulate win95 rule for create */
+#define VFAT_SFN_CREATE_WINNT 0x0200 /* emulate winnt rule for create */
+
+struct fat_boot_sector {
+ __u8 ignored[3]; /* Boot strap short or near jump */
+ __u8 system_id[8]; /* Name - can be used to special case
+ partition manager volumes */
+ __u8 sector_size[2]; /* bytes per logical sector */
+ __u8 sec_per_clus; /* sectors/cluster */
+ __le16 reserved; /* reserved sectors */
+ __u8 fats; /* number of FATs */
+ __u8 dir_entries[2]; /* root directory entries */
+ __u8 sectors[2]; /* number of sectors */
+ __u8 media; /* media code */
+ __le16 fat_length; /* sectors/FAT */
+ __le16 secs_track; /* sectors per track */
+ __le16 heads; /* number of heads */
+ __le32 hidden; /* hidden sectors (unused) */
+ __le32 total_sect; /* number of sectors (if sectors == 0) */
+
+ /* The following fields are only used by FAT32 */
+ __le32 fat32_length; /* sectors/FAT */
+ __le16 flags; /* bit 8: fat mirroring, low 4: active fat */
+ __u8 version[2]; /* major, minor filesystem version */
+ __le32 root_cluster; /* first cluster in root directory */
+ __le16 info_sector; /* filesystem info sector */
+ __le16 backup_boot; /* backup boot sector */
+ __le16 reserved2[6]; /* Unused */
+};
+
+struct fat_boot_fsinfo {
+ __le32 signature1; /* 0x41615252L */
+ __le32 reserved1[120]; /* Nothing as far as I can tell */
+ __le32 signature2; /* 0x61417272L */
+ __le32 free_clusters; /* Free cluster count. -1 if unknown */
+ __le32 next_cluster; /* Most recently allocated cluster */
+ __le32 reserved2[4];
+};
+
+struct msdos_dir_entry {
+ __u8 name[MSDOS_NAME];/* name and extension */
+ __u8 attr; /* attribute bits */
+ __u8 lcase; /* Case for base and extension */
+ __u8 ctime_cs; /* Creation time, centiseconds (0-199) */
+ __le16 ctime; /* Creation time */
+ __le16 cdate; /* Creation date */
+ __le16 adate; /* Last access date */
+ __le16 starthi; /* High 16 bits of cluster in FAT32 */
+ __le16 time,date,start;/* time, date and first cluster */
+ __le32 size; /* file size (in bytes) */
+};
+
+/* Up to 13 characters of the name */
+struct msdos_dir_slot {
+ __u8 id; /* sequence number for slot */
+ __u8 name0_4[10]; /* first 5 characters in name */
+ __u8 attr; /* attribute byte */
+ __u8 reserved; /* always 0 */
+ __u8 alias_checksum; /* checksum for 8.3 alias */
+ __u8 name5_10[12]; /* 6 more characters in name */
+ __le16 start; /* starting cluster number, 0 in long slots */
+ __u8 name11_12[4]; /* last 2 characters in name */
+};
+
+struct fat_slot_info {
+ loff_t i_pos; /* on-disk position of directory entry */
+ loff_t slot_off; /* offset for slot or de start */
+ int nr_slots; /* number of slots + 1(de) in filename */
+ struct msdos_dir_entry *de;
+ struct buffer_head *bh;
+};
+
+
+#endif
diff --git a/sysroot/usr/include/linux/msg.h b/sysroot/usr/include/linux/msg.h
new file mode 100644
index 0000000..bcd7d3d
--- /dev/null
+++ b/sysroot/usr/include/linux/msg.h
@@ -0,0 +1,65 @@
+#ifndef _LINUX_MSG_H
+#define _LINUX_MSG_H
+
+#include <linux/ipc.h>
+
+/* ipcs ctl commands */
+#define MSG_STAT 11
+#define MSG_INFO 12
+
+/* msgrcv options */
+#define MSG_NOERROR 010000 /* no error if message is too big */
+#define MSG_EXCEPT 020000 /* recv any msg except of specified type.*/
+
+/* Obsolete, used only for backwards compatibility and libc5 compiles */
+struct msqid_ds {
+ struct ipc_perm msg_perm;
+ struct msg *msg_first; /* first message on queue,unused */
+ struct msg *msg_last; /* last message in queue,unused */
+ __kernel_time_t msg_stime; /* last msgsnd time */
+ __kernel_time_t msg_rtime; /* last msgrcv time */
+ __kernel_time_t msg_ctime; /* last change time */
+ unsigned long msg_lcbytes; /* Reuse junk fields for 32 bit */
+ unsigned long msg_lqbytes; /* ditto */
+ unsigned short msg_cbytes; /* current number of bytes on queue */
+ unsigned short msg_qnum; /* number of messages in queue */
+ unsigned short msg_qbytes; /* max number of bytes on queue */
+ __kernel_ipc_pid_t msg_lspid; /* pid of last msgsnd */
+ __kernel_ipc_pid_t msg_lrpid; /* last receive pid */
+};
+
+/* Include the definition of msqid64_ds */
+#include <asm/msgbuf.h>
+
+/* message buffer for msgsnd and msgrcv calls */
+struct msgbuf {
+ long mtype; /* type of message */
+ char mtext[1]; /* message text */
+};
+
+/* buffer for msgctl calls IPC_INFO, MSG_INFO */
+struct msginfo {
+ int msgpool;
+ int msgmap;
+ int msgmax;
+ int msgmnb;
+ int msgmni;
+ int msgssz;
+ int msgtql;
+ unsigned short msgseg;
+};
+
+#define MSGMNI 16 /* <= IPCMNI */ /* max # of msg queue identifiers */
+#define MSGMAX 8192 /* <= INT_MAX */ /* max size of message (bytes) */
+#define MSGMNB 16384 /* <= INT_MAX */ /* default max size of a message queue */
+
+/* unused */
+#define MSGPOOL (MSGMNI*MSGMNB/1024) /* size in kilobytes of message pool */
+#define MSGTQL MSGMNB /* number of system message headers */
+#define MSGMAP MSGMNB /* number of entries in message map */
+#define MSGSSZ 16 /* message segment size */
+#define __MSGSEG ((MSGPOOL*1024)/ MSGSSZ) /* max no. of segments */
+#define MSGSEG (__MSGSEG <= 0xffff ? __MSGSEG : 0xffff)
+
+
+#endif /* _LINUX_MSG_H */
diff --git a/sysroot/usr/include/linux/mtio.h b/sysroot/usr/include/linux/mtio.h
new file mode 100644
index 0000000..6f8d2d4
--- /dev/null
+++ b/sysroot/usr/include/linux/mtio.h
@@ -0,0 +1,205 @@
+/*
+ * linux/mtio.h header file for Linux. Written by H. Bergman
+ *
+ * Modified for special ioctls provided by zftape in September 1997
+ * by C.-J. Heine.
+ */
+
+#ifndef _LINUX_MTIO_H
+#define _LINUX_MTIO_H
+
+#include <linux/types.h>
+#include <linux/ioctl.h>
+
+/*
+ * Structures and definitions for mag tape io control commands
+ */
+
+/* structure for MTIOCTOP - mag tape op command */
+struct mtop {
+ short mt_op; /* operations defined below */
+ int mt_count; /* how many of them */
+};
+
+/* Magnetic Tape operations [Not all operations supported by all drivers]: */
+#define MTRESET 0 /* +reset drive in case of problems */
+#define MTFSF 1 /* forward space over FileMark,
+ * position at first record of next file
+ */
+#define MTBSF 2 /* backward space FileMark (position before FM) */
+#define MTFSR 3 /* forward space record */
+#define MTBSR 4 /* backward space record */
+#define MTWEOF 5 /* write an end-of-file record (mark) */
+#define MTREW 6 /* rewind */
+#define MTOFFL 7 /* rewind and put the drive offline (eject?) */
+#define MTNOP 8 /* no op, set status only (read with MTIOCGET) */
+#define MTRETEN 9 /* retension tape */
+#define MTBSFM 10 /* +backward space FileMark, position at FM */
+#define MTFSFM 11 /* +forward space FileMark, position at FM */
+#define MTEOM 12 /* goto end of recorded media (for appending files).
+ * MTEOM positions after the last FM, ready for
+ * appending another file.
+ */
+#define MTERASE 13 /* erase tape -- be careful! */
+
+#define MTRAS1 14 /* run self test 1 (nondestructive) */
+#define MTRAS2 15 /* run self test 2 (destructive) */
+#define MTRAS3 16 /* reserved for self test 3 */
+
+#define MTSETBLK 20 /* set block length (SCSI) */
+#define MTSETDENSITY 21 /* set tape density (SCSI) */
+#define MTSEEK 22 /* seek to block (Tandberg, etc.) */
+#define MTTELL 23 /* tell block (Tandberg, etc.) */
+#define MTSETDRVBUFFER 24 /* set the drive buffering according to SCSI-2 */
+ /* ordinary buffered operation with code 1 */
+#define MTFSS 25 /* space forward over setmarks */
+#define MTBSS 26 /* space backward over setmarks */
+#define MTWSM 27 /* write setmarks */
+
+#define MTLOCK 28 /* lock the drive door */
+#define MTUNLOCK 29 /* unlock the drive door */
+#define MTLOAD 30 /* execute the SCSI load command */
+#define MTUNLOAD 31 /* execute the SCSI unload command */
+#define MTCOMPRESSION 32/* control compression with SCSI mode page 15 */
+#define MTSETPART 33 /* Change the active tape partition */
+#define MTMKPART 34 /* Format the tape with one or two partitions */
+
+/* structure for MTIOCGET - mag tape get status command */
+
+struct mtget {
+ long mt_type; /* type of magtape device */
+ long mt_resid; /* residual count: (not sure)
+ * number of bytes ignored, or
+ * number of files not skipped, or
+ * number of records not skipped.
+ */
+ /* the following registers are device dependent */
+ long mt_dsreg; /* status register */
+ long mt_gstat; /* generic (device independent) status */
+ long mt_erreg; /* error register */
+ /* The next two fields are not always used */
+ __kernel_daddr_t mt_fileno; /* number of current file on tape */
+ __kernel_daddr_t mt_blkno; /* current block number */
+};
+
+
+
+/*
+ * Constants for mt_type. Not all of these are supported,
+ * and these are not all of the ones that are supported.
+ */
+#define MT_ISUNKNOWN 0x01
+#define MT_ISQIC02 0x02 /* Generic QIC-02 tape streamer */
+#define MT_ISWT5150 0x03 /* Wangtek 5150EQ, QIC-150, QIC-02 */
+#define MT_ISARCHIVE_5945L2 0x04 /* Archive 5945L-2, QIC-24, QIC-02? */
+#define MT_ISCMSJ500 0x05 /* CMS Jumbo 500 (QIC-02?) */
+#define MT_ISTDC3610 0x06 /* Tandberg 6310, QIC-24 */
+#define MT_ISARCHIVE_VP60I 0x07 /* Archive VP60i, QIC-02 */
+#define MT_ISARCHIVE_2150L 0x08 /* Archive Viper 2150L */
+#define MT_ISARCHIVE_2060L 0x09 /* Archive Viper 2060L */
+#define MT_ISARCHIVESC499 0x0A /* Archive SC-499 QIC-36 controller */
+#define MT_ISQIC02_ALL_FEATURES 0x0F /* Generic QIC-02 with all features */
+#define MT_ISWT5099EEN24 0x11 /* Wangtek 5099-een24, 60MB, QIC-24 */
+#define MT_ISTEAC_MT2ST 0x12 /* Teac MT-2ST 155mb drive, Teac DC-1 card (Wangtek type) */
+#define MT_ISEVEREX_FT40A 0x32 /* Everex FT40A (QIC-40) */
+#define MT_ISDDS1 0x51 /* DDS device without partitions */
+#define MT_ISDDS2 0x52 /* DDS device with partitions */
+#define MT_ISONSTREAM_SC 0x61 /* OnStream SCSI tape drives (SC-x0)
+ and SCSI emulated (DI, DP, USB) */
+#define MT_ISSCSI1 0x71 /* Generic ANSI SCSI-1 tape unit */
+#define MT_ISSCSI2 0x72 /* Generic ANSI SCSI-2 tape unit */
+
+/* QIC-40/80/3010/3020 ftape supported drives.
+ * 20bit vendor ID + 0x800000 (see ftape-vendors.h)
+ */
+#define MT_ISFTAPE_UNKNOWN 0x800000 /* obsolete */
+#define MT_ISFTAPE_FLAG 0x800000
+
+
+/* structure for MTIOCPOS - mag tape get position command */
+
+struct mtpos {
+ long mt_blkno; /* current block number */
+};
+
+
+/* mag tape io control commands */
+#define MTIOCTOP _IOW('m', 1, struct mtop) /* do a mag tape op */
+#define MTIOCGET _IOR('m', 2, struct mtget) /* get tape status */
+#define MTIOCPOS _IOR('m', 3, struct mtpos) /* get tape position */
+
+
+/* Generic Mag Tape (device independent) status macros for examining
+ * mt_gstat -- HP-UX compatible.
+ * There is room for more generic status bits here, but I don't
+ * know which of them are reserved. At least three or so should
+ * be added to make this really useful.
+ */
+#define GMT_EOF(x) ((x) & 0x80000000)
+#define GMT_BOT(x) ((x) & 0x40000000)
+#define GMT_EOT(x) ((x) & 0x20000000)
+#define GMT_SM(x) ((x) & 0x10000000) /* DDS setmark */
+#define GMT_EOD(x) ((x) & 0x08000000) /* DDS EOD */
+#define GMT_WR_PROT(x) ((x) & 0x04000000)
+/* #define GMT_ ? ((x) & 0x02000000) */
+#define GMT_ONLINE(x) ((x) & 0x01000000)
+#define GMT_D_6250(x) ((x) & 0x00800000)
+#define GMT_D_1600(x) ((x) & 0x00400000)
+#define GMT_D_800(x) ((x) & 0x00200000)
+/* #define GMT_ ? ((x) & 0x00100000) */
+/* #define GMT_ ? ((x) & 0x00080000) */
+#define GMT_DR_OPEN(x) ((x) & 0x00040000) /* door open (no tape) */
+/* #define GMT_ ? ((x) & 0x00020000) */
+#define GMT_IM_REP_EN(x) ((x) & 0x00010000) /* immediate report mode */
+#define GMT_CLN(x) ((x) & 0x00008000) /* cleaning requested */
+/* 15 generic status bits unused */
+
+
+/* SCSI-tape specific definitions */
+/* Bitfield shifts in the status */
+#define MT_ST_BLKSIZE_SHIFT 0
+#define MT_ST_BLKSIZE_MASK 0xffffff
+#define MT_ST_DENSITY_SHIFT 24
+#define MT_ST_DENSITY_MASK 0xff000000
+
+#define MT_ST_SOFTERR_SHIFT 0
+#define MT_ST_SOFTERR_MASK 0xffff
+
+/* Bitfields for the MTSETDRVBUFFER ioctl */
+#define MT_ST_OPTIONS 0xf0000000
+#define MT_ST_BOOLEANS 0x10000000
+#define MT_ST_SETBOOLEANS 0x30000000
+#define MT_ST_CLEARBOOLEANS 0x40000000
+#define MT_ST_WRITE_THRESHOLD 0x20000000
+#define MT_ST_DEF_BLKSIZE 0x50000000
+#define MT_ST_DEF_OPTIONS 0x60000000
+#define MT_ST_TIMEOUTS 0x70000000
+#define MT_ST_SET_TIMEOUT (MT_ST_TIMEOUTS | 0x000000)
+#define MT_ST_SET_LONG_TIMEOUT (MT_ST_TIMEOUTS | 0x100000)
+#define MT_ST_SET_CLN 0x80000000
+
+#define MT_ST_BUFFER_WRITES 0x1
+#define MT_ST_ASYNC_WRITES 0x2
+#define MT_ST_READ_AHEAD 0x4
+#define MT_ST_DEBUGGING 0x8
+#define MT_ST_TWO_FM 0x10
+#define MT_ST_FAST_MTEOM 0x20
+#define MT_ST_AUTO_LOCK 0x40
+#define MT_ST_DEF_WRITES 0x80
+#define MT_ST_CAN_BSR 0x100
+#define MT_ST_NO_BLKLIMS 0x200
+#define MT_ST_CAN_PARTITIONS 0x400
+#define MT_ST_SCSI2LOGICAL 0x800
+#define MT_ST_SYSV 0x1000
+#define MT_ST_NOWAIT 0x2000
+
+/* The mode parameters to be controlled. Parameter chosen with bits 20-28 */
+#define MT_ST_CLEAR_DEFAULT 0xfffff
+#define MT_ST_DEF_DENSITY (MT_ST_DEF_OPTIONS | 0x100000)
+#define MT_ST_DEF_COMPRESSION (MT_ST_DEF_OPTIONS | 0x200000)
+#define MT_ST_DEF_DRVBUFFER (MT_ST_DEF_OPTIONS | 0x300000)
+
+/* The offset for the arguments for the special HP changer load command. */
+#define MT_ST_HPLOADER_OFFSET 10000
+
+#endif /* _LINUX_MTIO_H */
diff --git a/sysroot/usr/include/linux/n_r3964.h b/sysroot/usr/include/linux/n_r3964.h
new file mode 100644
index 0000000..f716807
--- /dev/null
+++ b/sysroot/usr/include/linux/n_r3964.h
@@ -0,0 +1,99 @@
+/* r3964 linediscipline for linux
+ *
+ * -----------------------------------------------------------
+ * Copyright by
+ * Philips Automation Projects
+ * Kassel (Germany)
+ * http://www.pap-philips.de
+ * -----------------------------------------------------------
+ * This software may be used and distributed according to the terms of
+ * the GNU General Public License, incorporated herein by reference.
+ *
+ * Author:
+ * L. Haag
+ *
+ * $Log: r3964.h,v $
+ * Revision 1.4 2005/12/21 19:54:24 Kurt Huwig <kurt huwig de>
+ * Fixed HZ usage on 2.6 kernels
+ * Removed unnecessary include
+ *
+ * Revision 1.3 2001/03/18 13:02:24 dwmw2
+ * Fix timer usage, use spinlocks properly.
+ *
+ * Revision 1.2 2001/03/18 12:53:15 dwmw2
+ * Merge changes in 2.4.2
+ *
+ * Revision 1.1.1.1 1998/10/13 16:43:14 dwmw2
+ * This'll screw the version control
+ *
+ * Revision 1.6 1998/09/30 00:40:38 dwmw2
+ * Updated to use kernel's N_R3964 if available
+ *
+ * Revision 1.4 1998/04/02 20:29:44 lhaag
+ * select, blocking, ...
+ *
+ * Revision 1.3 1998/02/12 18:58:43 root
+ * fixed some memory leaks
+ * calculation of checksum characters
+ *
+ * Revision 1.2 1998/02/07 13:03:17 root
+ * ioctl read_telegram
+ *
+ * Revision 1.1 1998/02/06 19:19:43 root
+ * Initial revision
+ *
+ *
+ */
+
+#ifndef __LINUX_N_R3964_H__
+#define __LINUX_N_R3964_H__
+
+/* line disciplines for r3964 protocol */
+
+
+/*
+ * Ioctl-commands
+ */
+
+#define R3964_ENABLE_SIGNALS 0x5301
+#define R3964_SETPRIORITY 0x5302
+#define R3964_USE_BCC 0x5303
+#define R3964_READ_TELEGRAM 0x5304
+
+/* Options for R3964_SETPRIORITY */
+#define R3964_MASTER 0
+#define R3964_SLAVE 1
+
+/* Options for R3964_ENABLE_SIGNALS */
+#define R3964_SIG_ACK 0x0001
+#define R3964_SIG_DATA 0x0002
+#define R3964_SIG_ALL 0x000f
+#define R3964_SIG_NONE 0x0000
+#define R3964_USE_SIGIO 0x1000
+
+/*
+ * r3964 operation states:
+ */
+
+/* types for msg_id: */
+enum {R3964_MSG_ACK=1, R3964_MSG_DATA };
+
+#define R3964_MAX_MSG_COUNT 32
+
+/* error codes for client messages */
+#define R3964_OK 0 /* no error. */
+#define R3964_TX_FAIL -1 /* transmission error, block NOT sent */
+#define R3964_OVERFLOW -2 /* msg queue overflow */
+
+/* the client gets this struct when calling read(fd,...): */
+struct r3964_client_message {
+ int msg_id;
+ int arg;
+ int error_code;
+};
+
+#define R3964_MTU 256
+
+
+
+#endif
diff --git a/sysroot/usr/include/linux/nbd.h b/sysroot/usr/include/linux/nbd.h
new file mode 100644
index 0000000..71541bc
--- /dev/null
+++ b/sysroot/usr/include/linux/nbd.h
@@ -0,0 +1,73 @@
+/*
+ * 1999 Copyright (C) Pavel Machek, pavel@ucw.cz. This code is GPL.
+ * 1999/11/04 Copyright (C) 1999 VMware, Inc. (Regis "HPReg" Duchesne)
+ * Made nbd_end_request() use the io_request_lock
+ * 2001 Copyright (C) Steven Whitehouse
+ * New nbd_end_request() for compatibility with new linux block
+ * layer code.
+ * 2003/06/24 Louis D. Langholtz <ldl@aros.net>
+ * Removed unneeded blksize_bits field from nbd_device struct.
+ * Cleanup PARANOIA usage & code.
+ * 2004/02/19 Paul Clements
+ * Removed PARANOIA, plus various cleanup and comments
+ */
+
+#ifndef LINUX_NBD_H
+#define LINUX_NBD_H
+
+#include <linux/types.h>
+
+#define NBD_SET_SOCK _IO( 0xab, 0 )
+#define NBD_SET_BLKSIZE _IO( 0xab, 1 )
+#define NBD_SET_SIZE _IO( 0xab, 2 )
+#define NBD_DO_IT _IO( 0xab, 3 )
+#define NBD_CLEAR_SOCK _IO( 0xab, 4 )
+#define NBD_CLEAR_QUE _IO( 0xab, 5 )
+#define NBD_PRINT_DEBUG _IO( 0xab, 6 )
+#define NBD_SET_SIZE_BLOCKS _IO( 0xab, 7 )
+#define NBD_DISCONNECT _IO( 0xab, 8 )
+#define NBD_SET_TIMEOUT _IO( 0xab, 9 )
+
+enum {
+ NBD_CMD_READ = 0,
+ NBD_CMD_WRITE = 1,
+ NBD_CMD_DISC = 2
+};
+
+#define nbd_cmd(req) ((req)->cmd[0])
+#define MAX_NBD 128
+
+/* userspace doesn't need the nbd_device structure */
+
+/* These are sent over the network in the request/reply magic fields */
+
+#define NBD_REQUEST_MAGIC 0x25609513
+#define NBD_REPLY_MAGIC 0x67446698
+/* Do *not* use magics: 0x12560953 0x96744668. */
+
+/*
+ * This is the packet used for communication between client and
+ * server. All data are in network byte order.
+ */
+struct nbd_request {
+ __be32 magic;
+ __be32 type; /* == READ || == WRITE */
+ char handle[8];
+ __be64 from;
+ __be32 len;
+}
+#ifdef __GNUC__
+ __attribute__ ((packed))
+#endif
+;
+
+/*
+ * This is the reply packet that nbd-server sends back to the client after
+ * it has completed an I/O request (or an error occurs).
+ */
+struct nbd_reply {
+ __be32 magic;
+ __be32 error; /* 0 = ok, else error */
+ char handle[8]; /* handle you got from request */
+};
+#endif
diff --git a/sysroot/usr/include/linux/ncp.h b/sysroot/usr/include/linux/ncp.h
new file mode 100644
index 0000000..4482ad7
--- /dev/null
+++ b/sysroot/usr/include/linux/ncp.h
@@ -0,0 +1,198 @@
+/*
+ * ncp.h
+ *
+ * Copyright (C) 1995 by Volker Lendecke
+ * Modified for sparc by J.F. Chadima
+ * Modified for __constant_ntoh by Frank A. Vorstenbosch
+ *
+ */
+
+#ifndef _LINUX_NCP_H
+#define _LINUX_NCP_H
+
+#include <linux/types.h>
+
+#define NCP_PTYPE (0x11)
+#define NCP_PORT (0x0451)
+
+#define NCP_ALLOC_SLOT_REQUEST (0x1111)
+#define NCP_REQUEST (0x2222)
+#define NCP_DEALLOC_SLOT_REQUEST (0x5555)
+
+struct ncp_request_header {
+ __u16 type;
+ __u8 sequence;
+ __u8 conn_low;
+ __u8 task;
+ __u8 conn_high;
+ __u8 function;
+ __u8 data[0];
+} __attribute__((packed));
+
+#define NCP_REPLY (0x3333)
+#define NCP_WATCHDOG (0x3E3E)
+#define NCP_POSITIVE_ACK (0x9999)
+
+struct ncp_reply_header {
+ __u16 type;
+ __u8 sequence;
+ __u8 conn_low;
+ __u8 task;
+ __u8 conn_high;
+ __u8 completion_code;
+ __u8 connection_state;
+ __u8 data[0];
+} __attribute__((packed));
+
+#define NCP_VOLNAME_LEN (16)
+#define NCP_NUMBER_OF_VOLUMES (256)
+struct ncp_volume_info {
+ __u32 total_blocks;
+ __u32 free_blocks;
+ __u32 purgeable_blocks;
+ __u32 not_yet_purgeable_blocks;
+ __u32 total_dir_entries;
+ __u32 available_dir_entries;
+ __u8 sectors_per_block;
+ char volume_name[NCP_VOLNAME_LEN + 1];
+};
+
+#define AR_READ (cpu_to_le16(1))
+#define AR_WRITE (cpu_to_le16(2))
+#define AR_EXCLUSIVE (cpu_to_le16(0x20))
+
+#define NCP_FILE_ID_LEN 6
+
+/* Defines for Name Spaces */
+#define NW_NS_DOS 0
+#define NW_NS_MAC 1
+#define NW_NS_NFS 2
+#define NW_NS_FTAM 3
+#define NW_NS_OS2 4
+
+/* Defines for ReturnInformationMask */
+#define RIM_NAME (cpu_to_le32(1))
+#define RIM_SPACE_ALLOCATED (cpu_to_le32(2))
+#define RIM_ATTRIBUTES (cpu_to_le32(4))
+#define RIM_DATA_SIZE (cpu_to_le32(8))
+#define RIM_TOTAL_SIZE (cpu_to_le32(0x10))
+#define RIM_EXT_ATTR_INFO (cpu_to_le32(0x20))
+#define RIM_ARCHIVE (cpu_to_le32(0x40))
+#define RIM_MODIFY (cpu_to_le32(0x80))
+#define RIM_CREATION (cpu_to_le32(0x100))
+#define RIM_OWNING_NAMESPACE (cpu_to_le32(0x200))
+#define RIM_DIRECTORY (cpu_to_le32(0x400))
+#define RIM_RIGHTS (cpu_to_le32(0x800))
+#define RIM_ALL (cpu_to_le32(0xFFF))
+#define RIM_COMPRESSED_INFO (cpu_to_le32(0x80000000))
+
+/* Defines for NSInfoBitMask */
+#define NSIBM_NFS_NAME 0x0001
+#define NSIBM_NFS_MODE 0x0002
+#define NSIBM_NFS_GID 0x0004
+#define NSIBM_NFS_NLINKS 0x0008
+#define NSIBM_NFS_RDEV 0x0010
+#define NSIBM_NFS_LINK 0x0020
+#define NSIBM_NFS_CREATED 0x0040
+#define NSIBM_NFS_UID 0x0080
+#define NSIBM_NFS_ACSFLAG 0x0100
+#define NSIBM_NFS_MYFLAG 0x0200
+
+/* open/create modes */
+#define OC_MODE_OPEN 0x01
+#define OC_MODE_TRUNCATE 0x02
+#define OC_MODE_REPLACE 0x02
+#define OC_MODE_CREATE 0x08
+
+/* open/create results */
+#define OC_ACTION_NONE 0x00
+#define OC_ACTION_OPEN 0x01
+#define OC_ACTION_CREATE 0x02
+#define OC_ACTION_TRUNCATE 0x04
+#define OC_ACTION_REPLACE 0x04
+
+/* access rights attributes */
+#ifndef AR_READ_ONLY
+#define AR_READ_ONLY 0x0001
+#define AR_WRITE_ONLY 0x0002
+#define AR_DENY_READ 0x0004
+#define AR_DENY_WRITE 0x0008
+#define AR_COMPATIBILITY 0x0010
+#define AR_WRITE_THROUGH 0x0040
+#define AR_OPEN_COMPRESSED 0x0100
+#endif
+
+struct nw_nfs_info {
+ __u32 mode;
+ __u32 rdev;
+};
+
+struct nw_info_struct {
+ __u32 spaceAlloc;
+ __le32 attributes;
+ __u16 flags;
+ __le32 dataStreamSize;
+ __le32 totalStreamSize;
+ __u16 numberOfStreams;
+ __le16 creationTime;
+ __le16 creationDate;
+ __u32 creatorID;
+ __le16 modifyTime;
+ __le16 modifyDate;
+ __u32 modifierID;
+ __le16 lastAccessDate;
+ __u16 archiveTime;
+ __u16 archiveDate;
+ __u32 archiverID;
+ __u16 inheritedRightsMask;
+ __le32 dirEntNum;
+ __le32 DosDirNum;
+ __u32 volNumber;
+ __u32 EADataSize;
+ __u32 EAKeyCount;
+ __u32 EAKeySize;
+ __u32 NSCreator;
+ __u8 nameLen;
+ __u8 entryName[256];
+ /* libncp may depend on there being nothing after entryName */
+} __attribute__((packed));
+
+/* modify mask - use with MODIFY_DOS_INFO structure */
+#define DM_ATTRIBUTES (cpu_to_le32(0x02))
+#define DM_CREATE_DATE (cpu_to_le32(0x04))
+#define DM_CREATE_TIME (cpu_to_le32(0x08))
+#define DM_CREATOR_ID (cpu_to_le32(0x10))
+#define DM_ARCHIVE_DATE (cpu_to_le32(0x20))
+#define DM_ARCHIVE_TIME (cpu_to_le32(0x40))
+#define DM_ARCHIVER_ID (cpu_to_le32(0x80))
+#define DM_MODIFY_DATE (cpu_to_le32(0x0100))
+#define DM_MODIFY_TIME (cpu_to_le32(0x0200))
+#define DM_MODIFIER_ID (cpu_to_le32(0x0400))
+#define DM_LAST_ACCESS_DATE (cpu_to_le32(0x0800))
+#define DM_INHERITED_RIGHTS_MASK (cpu_to_le32(0x1000))
+#define DM_MAXIMUM_SPACE (cpu_to_le32(0x2000))
+
+struct nw_modify_dos_info {
+ __le32 attributes;
+ __le16 creationDate;
+ __le16 creationTime;
+ __u32 creatorID;
+ __le16 modifyDate;
+ __le16 modifyTime;
+ __u32 modifierID;
+ __u16 archiveDate;
+ __u16 archiveTime;
+ __u32 archiverID;
+ __le16 lastAccessDate;
+ __u16 inheritanceGrantMask;
+ __u16 inheritanceRevokeMask;
+ __u32 maximumSpace;
+} __attribute__((packed));
+
+struct nw_search_sequence {
+ __u8 volNumber;
+ __u32 dirBase;
+ __u32 sequence;
+} __attribute__((packed));
+
+#endif /* _LINUX_NCP_H */
diff --git a/sysroot/usr/include/linux/ncp_fs.h b/sysroot/usr/include/linux/ncp_fs.h
new file mode 100644
index 0000000..a0eb5ef
--- /dev/null
+++ b/sysroot/usr/include/linux/ncp_fs.h
@@ -0,0 +1,147 @@
+/*
+ * ncp_fs.h
+ *
+ * Copyright (C) 1995, 1996 by Volker Lendecke
+ *
+ */
+
+#ifndef _LINUX_NCP_FS_H
+#define _LINUX_NCP_FS_H
+
+#include <linux/fs.h>
+#include <linux/in.h>
+#include <linux/types.h>
+#include <linux/magic.h>
+
+#include <linux/ipx.h>
+#include <linux/ncp_no.h>
+
+/*
+ * ioctl commands
+ */
+
+struct ncp_ioctl_request {
+ unsigned int function;
+ unsigned int size;
+ char *data;
+};
+
+struct ncp_fs_info {
+ int version;
+ struct sockaddr_ipx addr;
+ __kernel_uid_t mounted_uid;
+ int connection; /* Connection number the server assigned us */
+ int buffer_size; /* The negotiated buffer size, to be
+ used for read/write requests! */
+
+ int volume_number;
+ __le32 directory_id;
+};
+
+struct ncp_fs_info_v2 {
+ int version;
+ unsigned long mounted_uid;
+ unsigned int connection;
+ unsigned int buffer_size;
+
+ unsigned int volume_number;
+ __le32 directory_id;
+
+ __u32 dummy1;
+ __u32 dummy2;
+ __u32 dummy3;
+};
+
+struct ncp_sign_init
+{
+ char sign_root[8];
+ char sign_last[16];
+};
+
+struct ncp_lock_ioctl
+{
+#define NCP_LOCK_LOG 0
+#define NCP_LOCK_SH 1
+#define NCP_LOCK_EX 2
+#define NCP_LOCK_CLEAR 256
+ int cmd;
+ int origin;
+ unsigned int offset;
+ unsigned int length;
+#define NCP_LOCK_DEFAULT_TIMEOUT 18
+#define NCP_LOCK_MAX_TIMEOUT 180
+ int timeout;
+};
+
+struct ncp_setroot_ioctl
+{
+ int volNumber;
+ int namespace;
+ __le32 dirEntNum;
+};
+
+struct ncp_objectname_ioctl
+{
+#define NCP_AUTH_NONE 0x00
+#define NCP_AUTH_BIND 0x31
+#define NCP_AUTH_NDS 0x32
+ int auth_type;
+ size_t object_name_len;
+ void * object_name; /* an userspace data, in most cases user name */
+};
+
+struct ncp_privatedata_ioctl
+{
+ size_t len;
+ void * data; /* ~1000 for NDS */
+};
+
+/* NLS charsets by ioctl */
+#define NCP_IOCSNAME_LEN 20
+struct ncp_nls_ioctl
+{
+ unsigned char codepage[NCP_IOCSNAME_LEN+1];
+ unsigned char iocharset[NCP_IOCSNAME_LEN+1];
+};
+
+#define NCP_IOC_NCPREQUEST _IOR('n', 1, struct ncp_ioctl_request)
+#define NCP_IOC_GETMOUNTUID _IOW('n', 2, __kernel_old_uid_t)
+#define NCP_IOC_GETMOUNTUID2 _IOW('n', 2, unsigned long)
+
+#define NCP_IOC_CONN_LOGGED_IN _IO('n', 3)
+
+#define NCP_GET_FS_INFO_VERSION (1)
+#define NCP_IOC_GET_FS_INFO _IOWR('n', 4, struct ncp_fs_info)
+#define NCP_GET_FS_INFO_VERSION_V2 (2)
+#define NCP_IOC_GET_FS_INFO_V2 _IOWR('n', 4, struct ncp_fs_info_v2)
+
+#define NCP_IOC_SIGN_INIT _IOR('n', 5, struct ncp_sign_init)
+#define NCP_IOC_SIGN_WANTED _IOR('n', 6, int)
+#define NCP_IOC_SET_SIGN_WANTED _IOW('n', 6, int)
+
+#define NCP_IOC_LOCKUNLOCK _IOR('n', 7, struct ncp_lock_ioctl)
+
+#define NCP_IOC_GETROOT _IOW('n', 8, struct ncp_setroot_ioctl)
+#define NCP_IOC_SETROOT _IOR('n', 8, struct ncp_setroot_ioctl)
+
+#define NCP_IOC_GETOBJECTNAME _IOWR('n', 9, struct ncp_objectname_ioctl)
+#define NCP_IOC_SETOBJECTNAME _IOR('n', 9, struct ncp_objectname_ioctl)
+#define NCP_IOC_GETPRIVATEDATA _IOWR('n', 10, struct ncp_privatedata_ioctl)
+#define NCP_IOC_SETPRIVATEDATA _IOR('n', 10, struct ncp_privatedata_ioctl)
+
+#define NCP_IOC_GETCHARSETS _IOWR('n', 11, struct ncp_nls_ioctl)
+#define NCP_IOC_SETCHARSETS _IOR('n', 11, struct ncp_nls_ioctl)
+
+#define NCP_IOC_GETDENTRYTTL _IOW('n', 12, __u32)
+#define NCP_IOC_SETDENTRYTTL _IOR('n', 12, __u32)
+
+/*
+ * The packet size to allocate. One page should be enough.
+ */
+#define NCP_PACKET_SIZE 4070
+
+#define NCP_MAXPATHLEN 255
+#define NCP_MAXNAMELEN 14
+
+
+#endif /* _LINUX_NCP_FS_H */
diff --git a/sysroot/usr/include/linux/ncp_mount.h b/sysroot/usr/include/linux/ncp_mount.h
new file mode 100644
index 0000000..ebe4a2e
--- /dev/null
+++ b/sysroot/usr/include/linux/ncp_mount.h
@@ -0,0 +1,72 @@
+/*
+ * ncp_mount.h
+ *
+ * Copyright (C) 1995, 1996 by Volker Lendecke
+ *
+ */
+
+#ifndef _LINUX_NCP_MOUNT_H
+#define _LINUX_NCP_MOUNT_H
+
+#include <linux/types.h>
+#include <linux/ncp.h>
+
+#define NCP_MOUNT_VERSION 3 /* Binary */
+
+/* Values for flags */
+#define NCP_MOUNT_SOFT 0x0001
+#define NCP_MOUNT_INTR 0x0002
+#define NCP_MOUNT_STRONG 0x0004 /* enable delete/rename of r/o files */
+#define NCP_MOUNT_NO_OS2 0x0008 /* do not use OS/2 (LONG) namespace */
+#define NCP_MOUNT_NO_NFS 0x0010 /* do not use NFS namespace */
+#define NCP_MOUNT_EXTRAS 0x0020
+#define NCP_MOUNT_SYMLINKS 0x0040 /* enable symlinks */
+#define NCP_MOUNT_NFS_EXTRAS 0x0080 /* Enable use of NFS NS meta-info */
+
+struct ncp_mount_data {
+ int version;
+ unsigned int ncp_fd; /* The socket to the ncp port */
+ __kernel_uid_t mounted_uid; /* Who may umount() this filesystem? */
+ __kernel_pid_t wdog_pid; /* Who cares for our watchdog packets? */
+
+ unsigned char mounted_vol[NCP_VOLNAME_LEN + 1];
+ unsigned int time_out; /* How long should I wait after
+ sending a NCP request? */
+ unsigned int retry_count; /* And how often should I retry? */
+ unsigned int flags;
+
+ __kernel_uid_t uid;
+ __kernel_gid_t gid;
+ __kernel_mode_t file_mode;
+ __kernel_mode_t dir_mode;
+};
+
+#define NCP_MOUNT_VERSION_V4 (4) /* Binary or text */
+
+struct ncp_mount_data_v4 {
+ int version;
+ unsigned long flags; /* NCP_MOUNT_* flags */
+ /* MIPS uses long __kernel_uid_t, but... */
+ /* we neever pass -1, so it is safe */
+ unsigned long mounted_uid; /* Who may umount() this filesystem? */
+ /* MIPS uses long __kernel_pid_t */
+ long wdog_pid; /* Who cares for our watchdog packets? */
+
+ unsigned int ncp_fd; /* The socket to the ncp port */
+ unsigned int time_out; /* How long should I wait after
+ sending a NCP request? */
+ unsigned int retry_count; /* And how often should I retry? */
+
+ /* MIPS uses long __kernel_uid_t... */
+ /* we never pass -1, so it is safe */
+ unsigned long uid;
+ unsigned long gid;
+ /* MIPS uses unsigned long __kernel_mode_t */
+ unsigned long file_mode;
+ unsigned long dir_mode;
+};
+
+#define NCP_MOUNT_VERSION_V5 (5) /* Text only */
+
+
+#endif
diff --git a/sysroot/usr/include/linux/ncp_no.h b/sysroot/usr/include/linux/ncp_no.h
new file mode 100644
index 0000000..f56a696
--- /dev/null
+++ b/sysroot/usr/include/linux/ncp_no.h
@@ -0,0 +1,19 @@
+#ifndef _NCP_NO
+#define _NCP_NO
+
+/* these define the attribute byte as seen by NCP */
+#define aRONLY (__constant_cpu_to_le32(1))
+#define aHIDDEN (__constant_cpu_to_le32(2))
+#define aSYSTEM (__constant_cpu_to_le32(4))
+#define aEXECUTE (__constant_cpu_to_le32(8))
+#define aDIR (__constant_cpu_to_le32(0x10))
+#define aARCH (__constant_cpu_to_le32(0x20))
+#define aSHARED (__constant_cpu_to_le32(0x80))
+#define aDONTSUBALLOCATE (__constant_cpu_to_le32(1L<<11))
+#define aTRANSACTIONAL (__constant_cpu_to_le32(1L<<12))
+#define aPURGE (__constant_cpu_to_le32(1L<<16))
+#define aRENAMEINHIBIT (__constant_cpu_to_le32(1L<<17))
+#define aDELETEINHIBIT (__constant_cpu_to_le32(1L<<18))
+#define aDONTCOMPRESS (__constant_cpu_to_le32(1L<<27))
+
+#endif /* _NCP_NO */
diff --git a/sysroot/usr/include/linux/neighbour.h b/sysroot/usr/include/linux/neighbour.h
new file mode 100644
index 0000000..bd3bbf6
--- /dev/null
+++ b/sysroot/usr/include/linux/neighbour.h
@@ -0,0 +1,159 @@
+#ifndef __LINUX_NEIGHBOUR_H
+#define __LINUX_NEIGHBOUR_H
+
+#include <linux/netlink.h>
+
+struct ndmsg
+{
+ __u8 ndm_family;
+ __u8 ndm_pad1;
+ __u16 ndm_pad2;
+ __s32 ndm_ifindex;
+ __u16 ndm_state;
+ __u8 ndm_flags;
+ __u8 ndm_type;
+};
+
+enum
+{
+ NDA_UNSPEC,
+ NDA_DST,
+ NDA_LLADDR,
+ NDA_CACHEINFO,
+ NDA_PROBES,
+ __NDA_MAX
+};
+
+#define NDA_MAX (__NDA_MAX - 1)
+
+/*
+ * Neighbor Cache Entry Flags
+ */
+
+#define NTF_PROXY 0x08 /* == ATF_PUBL */
+#define NTF_ROUTER 0x80
+
+/*
+ * Neighbor Cache Entry States.
+ */
+
+#define NUD_INCOMPLETE 0x01
+#define NUD_REACHABLE 0x02
+#define NUD_STALE 0x04
+#define NUD_DELAY 0x08
+#define NUD_PROBE 0x10
+#define NUD_FAILED 0x20
+
+/* Dummy states */
+#define NUD_NOARP 0x40
+#define NUD_PERMANENT 0x80
+#define NUD_NONE 0x00
+
+/* NUD_NOARP & NUD_PERMANENT are pseudostates, they never change
+ and make no address resolution or NUD.
+ NUD_PERMANENT is also cannot be deleted by garbage collectors.
+ */
+
+struct nda_cacheinfo
+{
+ __u32 ndm_confirmed;
+ __u32 ndm_used;
+ __u32 ndm_updated;
+ __u32 ndm_refcnt;
+};
+
+/*****************************************************************
+ * Neighbour tables specific messages.
+ *
+ * To retrieve the neighbour tables send RTM_GETNEIGHTBL with the
+ * NLM_F_DUMP flag set. Every neighbour table configuration is
+ * spread over multiple messages to avoid running into message
+ * size limits on systems with many interfaces. The first message
+ * in the sequence transports all not device specific data such as
+ * statistics, configuration, and the default parameter set.
+ * This message is followed by 0..n messages carrying device
+ * specific parameter sets.
+ * Although the ordering should be sufficient, NDTA_NAME can be
+ * used to identify sequences. The initial message can be identified
+ * by checking for NDTA_CONFIG. The device specific messages do
+ * not contain this TLV but have NDTPA_IFINDEX set to the
+ * corresponding interface index.
+ *
+ * To change neighbour table attributes, send RTM_SETNEIGHTBL
+ * with NDTA_NAME set. Changeable attribute include NDTA_THRESH[1-3],
+ * NDTA_GC_INTERVAL, and all TLVs in NDTA_PARMS unless marked
+ * otherwise. Device specific parameter sets can be changed by
+ * setting NDTPA_IFINDEX to the interface index of the corresponding
+ * device.
+ ****/
+
+struct ndt_stats
+{
+ __u64 ndts_allocs;
+ __u64 ndts_destroys;
+ __u64 ndts_hash_grows;
+ __u64 ndts_res_failed;
+ __u64 ndts_lookups;
+ __u64 ndts_hits;
+ __u64 ndts_rcv_probes_mcast;
+ __u64 ndts_rcv_probes_ucast;
+ __u64 ndts_periodic_gc_runs;
+ __u64 ndts_forced_gc_runs;
+};
+
+enum {
+ NDTPA_UNSPEC,
+ NDTPA_IFINDEX, /* u32, unchangeable */
+ NDTPA_REFCNT, /* u32, read-only */
+ NDTPA_REACHABLE_TIME, /* u64, read-only, msecs */
+ NDTPA_BASE_REACHABLE_TIME, /* u64, msecs */
+ NDTPA_RETRANS_TIME, /* u64, msecs */
+ NDTPA_GC_STALETIME, /* u64, msecs */
+ NDTPA_DELAY_PROBE_TIME, /* u64, msecs */
+ NDTPA_QUEUE_LEN, /* u32 */
+ NDTPA_APP_PROBES, /* u32 */
+ NDTPA_UCAST_PROBES, /* u32 */
+ NDTPA_MCAST_PROBES, /* u32 */
+ NDTPA_ANYCAST_DELAY, /* u64, msecs */
+ NDTPA_PROXY_DELAY, /* u64, msecs */
+ NDTPA_PROXY_QLEN, /* u32 */
+ NDTPA_LOCKTIME, /* u64, msecs */
+ __NDTPA_MAX
+};
+#define NDTPA_MAX (__NDTPA_MAX - 1)
+
+struct ndtmsg
+{
+ __u8 ndtm_family;
+ __u8 ndtm_pad1;
+ __u16 ndtm_pad2;
+};
+
+struct ndt_config
+{
+ __u16 ndtc_key_len;
+ __u16 ndtc_entry_size;
+ __u32 ndtc_entries;
+ __u32 ndtc_last_flush; /* delta to now in msecs */
+ __u32 ndtc_last_rand; /* delta to now in msecs */
+ __u32 ndtc_hash_rnd;
+ __u32 ndtc_hash_mask;
+ __u32 ndtc_hash_chain_gc;
+ __u32 ndtc_proxy_qlen;
+};
+
+enum {
+ NDTA_UNSPEC,
+ NDTA_NAME, /* char *, unchangeable */
+ NDTA_THRESH1, /* u32 */
+ NDTA_THRESH2, /* u32 */
+ NDTA_THRESH3, /* u32 */
+ NDTA_CONFIG, /* struct ndt_config, read-only */
+ NDTA_PARMS, /* nested TLV NDTPA_* */
+ NDTA_STATS, /* struct ndt_stats, read-only */
+ NDTA_GC_INTERVAL, /* u64, msecs */
+ __NDTA_MAX
+};
+#define NDTA_MAX (__NDTA_MAX - 1)
+
+#endif
diff --git a/sysroot/usr/include/linux/net.h b/sysroot/usr/include/linux/net.h
new file mode 100644
index 0000000..529eaa1
--- /dev/null
+++ b/sysroot/usr/include/linux/net.h
@@ -0,0 +1,58 @@
+/*
+ * NET An implementation of the SOCKET network access protocol.
+ * This is the master header file for the Linux NET layer,
+ * or, in plain English: the networking handling part of the
+ * kernel.
+ *
+ * Version: @(#)net.h 1.0.3 05/25/93
+ *
+ * Authors: Orest Zborowski, <obz@Kodak.COM>
+ * Ross Biro
+ * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#ifndef _LINUX_NET_H
+#define _LINUX_NET_H
+
+#include <linux/wait.h>
+#include <asm/socket.h>
+
+struct poll_table_struct;
+struct inode;
+struct net;
+
+#define NPROTO 34 /* should be enough for now.. */
+
+#define SYS_SOCKET 1 /* sys_socket(2) */
+#define SYS_BIND 2 /* sys_bind(2) */
+#define SYS_CONNECT 3 /* sys_connect(2) */
+#define SYS_LISTEN 4 /* sys_listen(2) */
+#define SYS_ACCEPT 5 /* sys_accept(2) */
+#define SYS_GETSOCKNAME 6 /* sys_getsockname(2) */
+#define SYS_GETPEERNAME 7 /* sys_getpeername(2) */
+#define SYS_SOCKETPAIR 8 /* sys_socketpair(2) */
+#define SYS_SEND 9 /* sys_send(2) */
+#define SYS_RECV 10 /* sys_recv(2) */
+#define SYS_SENDTO 11 /* sys_sendto(2) */
+#define SYS_RECVFROM 12 /* sys_recvfrom(2) */
+#define SYS_SHUTDOWN 13 /* sys_shutdown(2) */
+#define SYS_SETSOCKOPT 14 /* sys_setsockopt(2) */
+#define SYS_GETSOCKOPT 15 /* sys_getsockopt(2) */
+#define SYS_SENDMSG 16 /* sys_sendmsg(2) */
+#define SYS_RECVMSG 17 /* sys_recvmsg(2) */
+
+typedef enum {
+ SS_FREE = 0, /* not allocated */
+ SS_UNCONNECTED, /* unconnected to any socket */
+ SS_CONNECTING, /* in process of connecting */
+ SS_CONNECTED, /* connected to socket */
+ SS_DISCONNECTING /* in process of disconnecting */
+} socket_state;
+
+#define __SO_ACCEPTCON (1 << 16) /* performed a listen */
+
+#endif /* _LINUX_NET_H */
diff --git a/sysroot/usr/include/linux/netdevice.h b/sysroot/usr/include/linux/netdevice.h
new file mode 100644
index 0000000..b506670
--- /dev/null
+++ b/sysroot/usr/include/linux/netdevice.h
@@ -0,0 +1,123 @@
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Definitions for the Interfaces handler.
+ *
+ * Version: @(#)dev.h 1.0.10 08/12/93
+ *
+ * Authors: Ross Biro
+ * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ * Corey Minyard <wf-rch!minyard@relay.EU.net>
+ * Donald J. Becker, <becker@cesdis.gsfc.nasa.gov>
+ * Alan Cox, <Alan.Cox@linux.org>
+ * Bjorn Ekwall. <bj0rn@blox.se>
+ * Pekka Riikonen <priikone@poseidon.pspt.fi>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ * Moved to /usr/include/linux for NET3
+ */
+#ifndef _LINUX_NETDEVICE_H
+#define _LINUX_NETDEVICE_H
+
+#include <linux/if.h>
+#include <linux/if_ether.h>
+#include <linux/if_packet.h>
+
+
+#define MAX_ADDR_LEN 32 /* Largest hardware address length */
+
+/* Driver transmit return codes */
+#define NETDEV_TX_OK 0 /* driver took care of packet */
+#define NETDEV_TX_BUSY 1 /* driver tx path was busy*/
+#define NETDEV_TX_LOCKED -1 /* driver tx lock was already taken */
+
+/*
+ * Compute the worst case header length according to the protocols
+ * used.
+ */
+
+#if !defined(CONFIG_AX25) && !defined(CONFIG_AX25_MODULE) && !defined(CONFIG_TR)
+#define LL_MAX_HEADER 32
+#else
+#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE)
+#define LL_MAX_HEADER 96
+#else
+#define LL_MAX_HEADER 48
+#endif
+#endif
+
+#if !defined(CONFIG_NET_IPIP) && !defined(CONFIG_NET_IPIP_MODULE) && \
+ !defined(CONFIG_NET_IPGRE) && !defined(CONFIG_NET_IPGRE_MODULE) && \
+ !defined(CONFIG_IPV6_SIT) && !defined(CONFIG_IPV6_SIT_MODULE) && \
+ !defined(CONFIG_IPV6_TUNNEL) && !defined(CONFIG_IPV6_TUNNEL_MODULE)
+#define MAX_HEADER LL_MAX_HEADER
+#else
+#define MAX_HEADER (LL_MAX_HEADER + 48)
+#endif
+
+struct net_device_subqueue
+{
+ /* Give a control state for each queue. This struct may contain
+ * per-queue locks in the future.
+ */
+ unsigned long state;
+};
+
+/*
+ * Network device statistics. Akin to the 2.0 ether stats but
+ * with byte counters.
+ */
+
+struct net_device_stats
+{
+ unsigned long rx_packets; /* total packets received */
+ unsigned long tx_packets; /* total packets transmitted */
+ unsigned long rx_bytes; /* total bytes received */
+ unsigned long tx_bytes; /* total bytes transmitted */
+ unsigned long rx_errors; /* bad packets received */
+ unsigned long tx_errors; /* packet transmit problems */
+ unsigned long rx_dropped; /* no space in linux buffers */
+ unsigned long tx_dropped; /* no space available in linux */
+ unsigned long multicast; /* multicast packets received */
+ unsigned long collisions;
+
+ /* detailed rx_errors: */
+ unsigned long rx_length_errors;
+ unsigned long rx_over_errors; /* receiver ring buff overflow */
+ unsigned long rx_crc_errors; /* recved pkt with crc error */
+ unsigned long rx_frame_errors; /* recv'd frame alignment error */
+ unsigned long rx_fifo_errors; /* recv'r fifo overrun */
+ unsigned long rx_missed_errors; /* receiver missed packet */
+
+ /* detailed tx_errors */
+ unsigned long tx_aborted_errors;
+ unsigned long tx_carrier_errors;
+ unsigned long tx_fifo_errors;
+ unsigned long tx_heartbeat_errors;
+ unsigned long tx_window_errors;
+
+ /* for cslip etc */
+ unsigned long rx_compressed;
+ unsigned long tx_compressed;
+};
+
+
+/* Media selection options. */
+enum {
+ IF_PORT_UNKNOWN = 0,
+ IF_PORT_10BASE2,
+ IF_PORT_10BASET,
+ IF_PORT_AUI,
+ IF_PORT_100BASET,
+ IF_PORT_100BASETX,
+ IF_PORT_100BASEFX
+};
+
+
+#endif /* _LINUX_DEV_H */
diff --git a/sysroot/usr/include/linux/netfilter.h b/sysroot/usr/include/linux/netfilter.h
new file mode 100644
index 0000000..1717636
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter.h
@@ -0,0 +1,30 @@
+#ifndef __LINUX_NETFILTER_H
+#define __LINUX_NETFILTER_H
+
+
+/* Responses from hook functions. */
+#define NF_DROP 0
+#define NF_ACCEPT 1
+#define NF_STOLEN 2
+#define NF_QUEUE 3
+#define NF_REPEAT 4
+#define NF_STOP 5
+#define NF_MAX_VERDICT NF_STOP
+
+/* we overload the higher bits for encoding auxiliary data such as the queue
+ * number. Not nice, but better than additional function arguments. */
+#define NF_VERDICT_MASK 0x0000ffff
+#define NF_VERDICT_BITS 16
+
+#define NF_VERDICT_QMASK 0xffff0000
+#define NF_VERDICT_QBITS 16
+
+#define NF_QUEUE_NR(x) (((x << NF_VERDICT_QBITS) & NF_VERDICT_QMASK) | NF_QUEUE)
+
+/* only for userspace compatibility */
+/* Generic cache responses from hook functions.
+ <= 0x2000 is used for protocol-flags. */
+#define NFC_UNKNOWN 0x4000
+#define NFC_ALTERED 0x8000
+
+#endif /*__LINUX_NETFILTER_H*/
diff --git a/sysroot/usr/include/linux/netfilter/nf_conntrack_common.h b/sysroot/usr/include/linux/netfilter/nf_conntrack_common.h
new file mode 100644
index 0000000..c658309
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/nf_conntrack_common.h
@@ -0,0 +1,140 @@
+#ifndef _NF_CONNTRACK_COMMON_H
+#define _NF_CONNTRACK_COMMON_H
+/* Connection state tracking for netfilter. This is separated from,
+ but required by, the NAT layer; it can also be used by an iptables
+ extension. */
+enum ip_conntrack_info
+{
+ /* Part of an established connection (either direction). */
+ IP_CT_ESTABLISHED,
+
+ /* Like NEW, but related to an existing connection, or ICMP error
+ (in either direction). */
+ IP_CT_RELATED,
+
+ /* Started a new connection to track (only
+ IP_CT_DIR_ORIGINAL); may be a retransmission. */
+ IP_CT_NEW,
+
+ /* >= this indicates reply direction */
+ IP_CT_IS_REPLY,
+
+ /* Number of distinct IP_CT types (no NEW in reply dirn). */
+ IP_CT_NUMBER = IP_CT_IS_REPLY * 2 - 1
+};
+
+/* Bitset representing status of connection. */
+enum ip_conntrack_status {
+ /* It's an expected connection: bit 0 set. This bit never changed */
+ IPS_EXPECTED_BIT = 0,
+ IPS_EXPECTED = (1 << IPS_EXPECTED_BIT),
+
+ /* We've seen packets both ways: bit 1 set. Can be set, not unset. */
+ IPS_SEEN_REPLY_BIT = 1,
+ IPS_SEEN_REPLY = (1 << IPS_SEEN_REPLY_BIT),
+
+ /* Conntrack should never be early-expired. */
+ IPS_ASSURED_BIT = 2,
+ IPS_ASSURED = (1 << IPS_ASSURED_BIT),
+
+ /* Connection is confirmed: originating packet has left box */
+ IPS_CONFIRMED_BIT = 3,
+ IPS_CONFIRMED = (1 << IPS_CONFIRMED_BIT),
+
+ /* Connection needs src nat in orig dir. This bit never changed. */
+ IPS_SRC_NAT_BIT = 4,
+ IPS_SRC_NAT = (1 << IPS_SRC_NAT_BIT),
+
+ /* Connection needs dst nat in orig dir. This bit never changed. */
+ IPS_DST_NAT_BIT = 5,
+ IPS_DST_NAT = (1 << IPS_DST_NAT_BIT),
+
+ /* Both together. */
+ IPS_NAT_MASK = (IPS_DST_NAT | IPS_SRC_NAT),
+
+ /* Connection needs TCP sequence adjusted. */
+ IPS_SEQ_ADJUST_BIT = 6,
+ IPS_SEQ_ADJUST = (1 << IPS_SEQ_ADJUST_BIT),
+
+ /* NAT initialization bits. */
+ IPS_SRC_NAT_DONE_BIT = 7,
+ IPS_SRC_NAT_DONE = (1 << IPS_SRC_NAT_DONE_BIT),
+
+ IPS_DST_NAT_DONE_BIT = 8,
+ IPS_DST_NAT_DONE = (1 << IPS_DST_NAT_DONE_BIT),
+
+ /* Both together */
+ IPS_NAT_DONE_MASK = (IPS_DST_NAT_DONE | IPS_SRC_NAT_DONE),
+
+ /* Connection is dying (removed from lists), can not be unset. */
+ IPS_DYING_BIT = 9,
+ IPS_DYING = (1 << IPS_DYING_BIT),
+
+ /* Connection has fixed timeout. */
+ IPS_FIXED_TIMEOUT_BIT = 10,
+ IPS_FIXED_TIMEOUT = (1 << IPS_FIXED_TIMEOUT_BIT),
+};
+
+/* Connection tracking event bits */
+enum ip_conntrack_events
+{
+ /* New conntrack */
+ IPCT_NEW_BIT = 0,
+ IPCT_NEW = (1 << IPCT_NEW_BIT),
+
+ /* Expected connection */
+ IPCT_RELATED_BIT = 1,
+ IPCT_RELATED = (1 << IPCT_RELATED_BIT),
+
+ /* Destroyed conntrack */
+ IPCT_DESTROY_BIT = 2,
+ IPCT_DESTROY = (1 << IPCT_DESTROY_BIT),
+
+ /* Timer has been refreshed */
+ IPCT_REFRESH_BIT = 3,
+ IPCT_REFRESH = (1 << IPCT_REFRESH_BIT),
+
+ /* Status has changed */
+ IPCT_STATUS_BIT = 4,
+ IPCT_STATUS = (1 << IPCT_STATUS_BIT),
+
+ /* Update of protocol info */
+ IPCT_PROTOINFO_BIT = 5,
+ IPCT_PROTOINFO = (1 << IPCT_PROTOINFO_BIT),
+
+ /* Volatile protocol info */
+ IPCT_PROTOINFO_VOLATILE_BIT = 6,
+ IPCT_PROTOINFO_VOLATILE = (1 << IPCT_PROTOINFO_VOLATILE_BIT),
+
+ /* New helper for conntrack */
+ IPCT_HELPER_BIT = 7,
+ IPCT_HELPER = (1 << IPCT_HELPER_BIT),
+
+ /* Update of helper info */
+ IPCT_HELPINFO_BIT = 8,
+ IPCT_HELPINFO = (1 << IPCT_HELPINFO_BIT),
+
+ /* Volatile helper info */
+ IPCT_HELPINFO_VOLATILE_BIT = 9,
+ IPCT_HELPINFO_VOLATILE = (1 << IPCT_HELPINFO_VOLATILE_BIT),
+
+ /* NAT info */
+ IPCT_NATINFO_BIT = 10,
+ IPCT_NATINFO = (1 << IPCT_NATINFO_BIT),
+
+ /* Counter highest bit has been set */
+ IPCT_COUNTER_FILLING_BIT = 11,
+ IPCT_COUNTER_FILLING = (1 << IPCT_COUNTER_FILLING_BIT),
+
+ /* Mark is set */
+ IPCT_MARK_BIT = 12,
+ IPCT_MARK = (1 << IPCT_MARK_BIT),
+};
+
+enum ip_conntrack_expect_events {
+ IPEXP_NEW_BIT = 0,
+ IPEXP_NEW = (1 << IPEXP_NEW_BIT),
+};
+
+
+#endif /* _NF_CONNTRACK_COMMON_H */
diff --git a/sysroot/usr/include/linux/netfilter/nf_conntrack_ftp.h b/sysroot/usr/include/linux/netfilter/nf_conntrack_ftp.h
new file mode 100644
index 0000000..c0dbb4e
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/nf_conntrack_ftp.h
@@ -0,0 +1,19 @@
+#ifndef _NF_CONNTRACK_FTP_H
+#define _NF_CONNTRACK_FTP_H
+/* FTP tracking. */
+
+/* This enum is exposed to userspace */
+enum nf_ct_ftp_type
+{
+ /* PORT command from client */
+ NF_CT_FTP_PORT,
+ /* PASV response from server */
+ NF_CT_FTP_PASV,
+ /* EPRT command from client */
+ NF_CT_FTP_EPRT,
+ /* EPSV response from server */
+ NF_CT_FTP_EPSV,
+};
+
+
+#endif /* _NF_CONNTRACK_FTP_H */
diff --git a/sysroot/usr/include/linux/netfilter/nf_conntrack_sctp.h b/sysroot/usr/include/linux/netfilter/nf_conntrack_sctp.h
new file mode 100644
index 0000000..5cf2c11
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/nf_conntrack_sctp.h
@@ -0,0 +1,27 @@
+#ifndef _NF_CONNTRACK_SCTP_H
+#define _NF_CONNTRACK_SCTP_H
+/* SCTP tracking. */
+
+#include <linux/netfilter/nf_conntrack_tuple_common.h>
+
+enum sctp_conntrack {
+ SCTP_CONNTRACK_NONE,
+ SCTP_CONNTRACK_CLOSED,
+ SCTP_CONNTRACK_COOKIE_WAIT,
+ SCTP_CONNTRACK_COOKIE_ECHOED,
+ SCTP_CONNTRACK_ESTABLISHED,
+ SCTP_CONNTRACK_SHUTDOWN_SENT,
+ SCTP_CONNTRACK_SHUTDOWN_RECD,
+ SCTP_CONNTRACK_SHUTDOWN_ACK_SENT,
+ SCTP_CONNTRACK_MAX
+};
+
+struct ip_ct_sctp
+{
+ enum sctp_conntrack state;
+
+ __be32 vtag[IP_CT_DIR_MAX];
+ u_int32_t ttag[IP_CT_DIR_MAX];
+};
+
+#endif /* _NF_CONNTRACK_SCTP_H */
diff --git a/sysroot/usr/include/linux/netfilter/nf_conntrack_tcp.h b/sysroot/usr/include/linux/netfilter/nf_conntrack_tcp.h
new file mode 100644
index 0000000..c6ace4c
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/nf_conntrack_tcp.h
@@ -0,0 +1,39 @@
+#ifndef _NF_CONNTRACK_TCP_H
+#define _NF_CONNTRACK_TCP_H
+/* TCP tracking. */
+
+/* This is exposed to userspace (ctnetlink) */
+enum tcp_conntrack {
+ TCP_CONNTRACK_NONE,
+ TCP_CONNTRACK_SYN_SENT,
+ TCP_CONNTRACK_SYN_RECV,
+ TCP_CONNTRACK_ESTABLISHED,
+ TCP_CONNTRACK_FIN_WAIT,
+ TCP_CONNTRACK_CLOSE_WAIT,
+ TCP_CONNTRACK_LAST_ACK,
+ TCP_CONNTRACK_TIME_WAIT,
+ TCP_CONNTRACK_CLOSE,
+ TCP_CONNTRACK_LISTEN,
+ TCP_CONNTRACK_MAX,
+ TCP_CONNTRACK_IGNORE
+};
+
+/* Window scaling is advertised by the sender */
+#define IP_CT_TCP_FLAG_WINDOW_SCALE 0x01
+
+/* SACK is permitted by the sender */
+#define IP_CT_TCP_FLAG_SACK_PERM 0x02
+
+/* This sender sent FIN first */
+#define IP_CT_TCP_FLAG_CLOSE_INIT 0x04
+
+/* Be liberal in window checking */
+#define IP_CT_TCP_FLAG_BE_LIBERAL 0x08
+
+struct nf_ct_tcp_flags {
+ u_int8_t flags;
+ u_int8_t mask;
+};
+
+
+#endif /* _NF_CONNTRACK_TCP_H */
diff --git a/sysroot/usr/include/linux/netfilter/nf_conntrack_tuple_common.h b/sysroot/usr/include/linux/netfilter/nf_conntrack_tuple_common.h
new file mode 100644
index 0000000..8e145f0
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/nf_conntrack_tuple_common.h
@@ -0,0 +1,13 @@
+#ifndef _NF_CONNTRACK_TUPLE_COMMON_H
+#define _NF_CONNTRACK_TUPLE_COMMON_H
+
+enum ip_conntrack_dir
+{
+ IP_CT_DIR_ORIGINAL,
+ IP_CT_DIR_REPLY,
+ IP_CT_DIR_MAX
+};
+
+#define CTINFO2DIR(ctinfo) ((ctinfo) >= IP_CT_IS_REPLY ? IP_CT_DIR_REPLY : IP_CT_DIR_ORIGINAL)
+
+#endif /* _NF_CONNTRACK_TUPLE_COMMON_H */
diff --git a/sysroot/usr/include/linux/netfilter/nfnetlink.h b/sysroot/usr/include/linux/netfilter/nfnetlink.h
new file mode 100644
index 0000000..53eef98
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/nfnetlink.h
@@ -0,0 +1,51 @@
+#ifndef _NFNETLINK_H
+#define _NFNETLINK_H
+#include <linux/types.h>
+#include <linux/netfilter/nfnetlink_compat.h>
+
+enum nfnetlink_groups {
+ NFNLGRP_NONE,
+#define NFNLGRP_NONE NFNLGRP_NONE
+ NFNLGRP_CONNTRACK_NEW,
+#define NFNLGRP_CONNTRACK_NEW NFNLGRP_CONNTRACK_NEW
+ NFNLGRP_CONNTRACK_UPDATE,
+#define NFNLGRP_CONNTRACK_UPDATE NFNLGRP_CONNTRACK_UPDATE
+ NFNLGRP_CONNTRACK_DESTROY,
+#define NFNLGRP_CONNTRACK_DESTROY NFNLGRP_CONNTRACK_DESTROY
+ NFNLGRP_CONNTRACK_EXP_NEW,
+#define NFNLGRP_CONNTRACK_EXP_NEW NFNLGRP_CONNTRACK_EXP_NEW
+ NFNLGRP_CONNTRACK_EXP_UPDATE,
+#define NFNLGRP_CONNTRACK_EXP_UPDATE NFNLGRP_CONNTRACK_EXP_UPDATE
+ NFNLGRP_CONNTRACK_EXP_DESTROY,
+#define NFNLGRP_CONNTRACK_EXP_DESTROY NFNLGRP_CONNTRACK_EXP_DESTROY
+ __NFNLGRP_MAX,
+};
+#define NFNLGRP_MAX (__NFNLGRP_MAX - 1)
+
+/* General form of address family dependent message.
+ */
+struct nfgenmsg {
+ u_int8_t nfgen_family; /* AF_xxx */
+ u_int8_t version; /* nfnetlink version */
+ __be16 res_id; /* resource id */
+};
+
+#define NFNETLINK_V0 0
+
+/* netfilter netlink message types are split in two pieces:
+ * 8 bit subsystem, 8bit operation.
+ */
+
+#define NFNL_SUBSYS_ID(x) ((x & 0xff00) >> 8)
+#define NFNL_MSG_TYPE(x) (x & 0x00ff)
+
+/* No enum here, otherwise __stringify() trick of MODULE_ALIAS_NFNL_SUBSYS()
+ * won't work anymore */
+#define NFNL_SUBSYS_NONE 0
+#define NFNL_SUBSYS_CTNETLINK 1
+#define NFNL_SUBSYS_CTNETLINK_EXP 2
+#define NFNL_SUBSYS_QUEUE 3
+#define NFNL_SUBSYS_ULOG 4
+#define NFNL_SUBSYS_COUNT 5
+
+#endif /* _NFNETLINK_H */
diff --git a/sysroot/usr/include/linux/netfilter/nfnetlink_compat.h b/sysroot/usr/include/linux/netfilter/nfnetlink_compat.h
new file mode 100644
index 0000000..02a42d8
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/nfnetlink_compat.h
@@ -0,0 +1,61 @@
+#ifndef _NFNETLINK_COMPAT_H
+#define _NFNETLINK_COMPAT_H
+#ifndef __KERNEL
+/* Old nfnetlink macros for userspace */
+
+/* nfnetlink groups: Up to 32 maximum */
+#define NF_NETLINK_CONNTRACK_NEW 0x00000001
+#define NF_NETLINK_CONNTRACK_UPDATE 0x00000002
+#define NF_NETLINK_CONNTRACK_DESTROY 0x00000004
+#define NF_NETLINK_CONNTRACK_EXP_NEW 0x00000008
+#define NF_NETLINK_CONNTRACK_EXP_UPDATE 0x00000010
+#define NF_NETLINK_CONNTRACK_EXP_DESTROY 0x00000020
+
+/* Generic structure for encapsulation optional netfilter information.
+ * It is reminiscent of sockaddr, but with sa_family replaced
+ * with attribute type.
+ * ! This should someday be put somewhere generic as now rtnetlink and
+ * ! nfnetlink use the same attributes methods. - J. Schulist.
+ */
+
+struct nfattr
+{
+ u_int16_t nfa_len;
+ u_int16_t nfa_type; /* we use 15 bits for the type, and the highest
+ * bit to indicate whether the payload is nested */
+};
+
+/* FIXME: Apart from NFNL_NFA_NESTED shamelessly copy and pasted from
+ * rtnetlink.h, it's time to put this in a generic file */
+
+#define NFNL_NFA_NEST 0x8000
+#define NFA_TYPE(attr) ((attr)->nfa_type & 0x7fff)
+
+#define NFA_ALIGNTO 4
+#define NFA_ALIGN(len) (((len) + NFA_ALIGNTO - 1) & ~(NFA_ALIGNTO - 1))
+#define NFA_OK(nfa,len) ((len) > 0 && (nfa)->nfa_len >= sizeof(struct nfattr) \
+ && (nfa)->nfa_len <= (len))
+#define NFA_NEXT(nfa,attrlen) ((attrlen) -= NFA_ALIGN((nfa)->nfa_len), \
+ (struct nfattr *)(((char *)(nfa)) + NFA_ALIGN((nfa)->nfa_len)))
+#define NFA_LENGTH(len) (NFA_ALIGN(sizeof(struct nfattr)) + (len))
+#define NFA_SPACE(len) NFA_ALIGN(NFA_LENGTH(len))
+#define NFA_DATA(nfa) ((void *)(((char *)(nfa)) + NFA_LENGTH(0)))
+#define NFA_PAYLOAD(nfa) ((int)((nfa)->nfa_len) - NFA_LENGTH(0))
+#define NFA_NEST(skb, type) \
+({ struct nfattr *__start = (struct nfattr *)skb_tail_pointer(skb); \
+ NFA_PUT(skb, (NFNL_NFA_NEST | type), 0, NULL); \
+ __start; })
+#define NFA_NEST_END(skb, start) \
+({ (start)->nfa_len = skb_tail_pointer(skb) - (unsigned char *)(start); \
+ (skb)->len; })
+#define NFA_NEST_CANCEL(skb, start) \
+({ if (start) \
+ skb_trim(skb, (unsigned char *) (start) - (skb)->data); \
+ -1; })
+
+#define NFM_NFA(n) ((struct nfattr *)(((char *)(n)) \
+ + NLMSG_ALIGN(sizeof(struct nfgenmsg))))
+#define NFM_PAYLOAD(n) NLMSG_PAYLOAD(n, sizeof(struct nfgenmsg))
+
+#endif /* ! __KERNEL__ */
+#endif /* _NFNETLINK_COMPAT_H */
diff --git a/sysroot/usr/include/linux/netfilter/nfnetlink_conntrack.h b/sysroot/usr/include/linux/netfilter/nfnetlink_conntrack.h
new file mode 100644
index 0000000..4affa3f
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/nfnetlink_conntrack.h
@@ -0,0 +1,141 @@
+#ifndef _IPCONNTRACK_NETLINK_H
+#define _IPCONNTRACK_NETLINK_H
+#include <linux/netfilter/nfnetlink.h>
+
+enum cntl_msg_types {
+ IPCTNL_MSG_CT_NEW,
+ IPCTNL_MSG_CT_GET,
+ IPCTNL_MSG_CT_DELETE,
+ IPCTNL_MSG_CT_GET_CTRZERO,
+
+ IPCTNL_MSG_MAX
+};
+
+enum ctnl_exp_msg_types {
+ IPCTNL_MSG_EXP_NEW,
+ IPCTNL_MSG_EXP_GET,
+ IPCTNL_MSG_EXP_DELETE,
+
+ IPCTNL_MSG_EXP_MAX
+};
+
+
+enum ctattr_type {
+ CTA_UNSPEC,
+ CTA_TUPLE_ORIG,
+ CTA_TUPLE_REPLY,
+ CTA_STATUS,
+ CTA_PROTOINFO,
+ CTA_HELP,
+ CTA_NAT_SRC,
+#define CTA_NAT CTA_NAT_SRC /* backwards compatibility */
+ CTA_TIMEOUT,
+ CTA_MARK,
+ CTA_COUNTERS_ORIG,
+ CTA_COUNTERS_REPLY,
+ CTA_USE,
+ CTA_ID,
+ CTA_NAT_DST,
+ CTA_TUPLE_MASTER,
+ __CTA_MAX
+};
+#define CTA_MAX (__CTA_MAX - 1)
+
+enum ctattr_tuple {
+ CTA_TUPLE_UNSPEC,
+ CTA_TUPLE_IP,
+ CTA_TUPLE_PROTO,
+ __CTA_TUPLE_MAX
+};
+#define CTA_TUPLE_MAX (__CTA_TUPLE_MAX - 1)
+
+enum ctattr_ip {
+ CTA_IP_UNSPEC,
+ CTA_IP_V4_SRC,
+ CTA_IP_V4_DST,
+ CTA_IP_V6_SRC,
+ CTA_IP_V6_DST,
+ __CTA_IP_MAX
+};
+#define CTA_IP_MAX (__CTA_IP_MAX - 1)
+
+enum ctattr_l4proto {
+ CTA_PROTO_UNSPEC,
+ CTA_PROTO_NUM,
+ CTA_PROTO_SRC_PORT,
+ CTA_PROTO_DST_PORT,
+ CTA_PROTO_ICMP_ID,
+ CTA_PROTO_ICMP_TYPE,
+ CTA_PROTO_ICMP_CODE,
+ CTA_PROTO_ICMPV6_ID,
+ CTA_PROTO_ICMPV6_TYPE,
+ CTA_PROTO_ICMPV6_CODE,
+ __CTA_PROTO_MAX
+};
+#define CTA_PROTO_MAX (__CTA_PROTO_MAX - 1)
+
+enum ctattr_protoinfo {
+ CTA_PROTOINFO_UNSPEC,
+ CTA_PROTOINFO_TCP,
+ __CTA_PROTOINFO_MAX
+};
+#define CTA_PROTOINFO_MAX (__CTA_PROTOINFO_MAX - 1)
+
+enum ctattr_protoinfo_tcp {
+ CTA_PROTOINFO_TCP_UNSPEC,
+ CTA_PROTOINFO_TCP_STATE,
+ CTA_PROTOINFO_TCP_WSCALE_ORIGINAL,
+ CTA_PROTOINFO_TCP_WSCALE_REPLY,
+ CTA_PROTOINFO_TCP_FLAGS_ORIGINAL,
+ CTA_PROTOINFO_TCP_FLAGS_REPLY,
+ __CTA_PROTOINFO_TCP_MAX
+};
+#define CTA_PROTOINFO_TCP_MAX (__CTA_PROTOINFO_TCP_MAX - 1)
+
+enum ctattr_counters {
+ CTA_COUNTERS_UNSPEC,
+ CTA_COUNTERS_PACKETS, /* old 64bit counters */
+ CTA_COUNTERS_BYTES, /* old 64bit counters */
+ CTA_COUNTERS32_PACKETS,
+ CTA_COUNTERS32_BYTES,
+ __CTA_COUNTERS_MAX
+};
+#define CTA_COUNTERS_MAX (__CTA_COUNTERS_MAX - 1)
+
+enum ctattr_nat {
+ CTA_NAT_UNSPEC,
+ CTA_NAT_MINIP,
+ CTA_NAT_MAXIP,
+ CTA_NAT_PROTO,
+ __CTA_NAT_MAX
+};
+#define CTA_NAT_MAX (__CTA_NAT_MAX - 1)
+
+enum ctattr_protonat {
+ CTA_PROTONAT_UNSPEC,
+ CTA_PROTONAT_PORT_MIN,
+ CTA_PROTONAT_PORT_MAX,
+ __CTA_PROTONAT_MAX
+};
+#define CTA_PROTONAT_MAX (__CTA_PROTONAT_MAX - 1)
+
+enum ctattr_expect {
+ CTA_EXPECT_UNSPEC,
+ CTA_EXPECT_MASTER,
+ CTA_EXPECT_TUPLE,
+ CTA_EXPECT_MASK,
+ CTA_EXPECT_TIMEOUT,
+ CTA_EXPECT_ID,
+ CTA_EXPECT_HELP_NAME,
+ __CTA_EXPECT_MAX
+};
+#define CTA_EXPECT_MAX (__CTA_EXPECT_MAX - 1)
+
+enum ctattr_help {
+ CTA_HELP_UNSPEC,
+ CTA_HELP_NAME,
+ __CTA_HELP_MAX
+};
+#define CTA_HELP_MAX (__CTA_HELP_MAX - 1)
+
+#endif /* _IPCONNTRACK_NETLINK_H */
diff --git a/sysroot/usr/include/linux/netfilter/nfnetlink_log.h b/sysroot/usr/include/linux/netfilter/nfnetlink_log.h
new file mode 100644
index 0000000..5966afa
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/nfnetlink_log.h
@@ -0,0 +1,92 @@
+#ifndef _NFNETLINK_LOG_H
+#define _NFNETLINK_LOG_H
+
+/* This file describes the netlink messages (i.e. 'protocol packets'),
+ * and not any kind of function definitions. It is shared between kernel and
+ * userspace. Don't put kernel specific stuff in here */
+
+#include <linux/types.h>
+#include <linux/netfilter/nfnetlink.h>
+
+enum nfulnl_msg_types {
+ NFULNL_MSG_PACKET, /* packet from kernel to userspace */
+ NFULNL_MSG_CONFIG, /* connect to a particular queue */
+
+ NFULNL_MSG_MAX
+};
+
+struct nfulnl_msg_packet_hdr {
+ __be16 hw_protocol; /* hw protocol (network order) */
+ u_int8_t hook; /* netfilter hook */
+ u_int8_t _pad;
+};
+
+struct nfulnl_msg_packet_hw {
+ __be16 hw_addrlen;
+ u_int16_t _pad;
+ u_int8_t hw_addr[8];
+};
+
+struct nfulnl_msg_packet_timestamp {
+ aligned_be64 sec;
+ aligned_be64 usec;
+};
+
+enum nfulnl_attr_type {
+ NFULA_UNSPEC,
+ NFULA_PACKET_HDR,
+ NFULA_MARK, /* u_int32_t nfmark */
+ NFULA_TIMESTAMP, /* nfulnl_msg_packet_timestamp */
+ NFULA_IFINDEX_INDEV, /* u_int32_t ifindex */
+ NFULA_IFINDEX_OUTDEV, /* u_int32_t ifindex */
+ NFULA_IFINDEX_PHYSINDEV, /* u_int32_t ifindex */
+ NFULA_IFINDEX_PHYSOUTDEV, /* u_int32_t ifindex */
+ NFULA_HWADDR, /* nfulnl_msg_packet_hw */
+ NFULA_PAYLOAD, /* opaque data payload */
+ NFULA_PREFIX, /* string prefix */
+ NFULA_UID, /* user id of socket */
+ NFULA_SEQ, /* instance-local sequence number */
+ NFULA_SEQ_GLOBAL, /* global sequence number */
+
+ __NFULA_MAX
+};
+#define NFULA_MAX (__NFULA_MAX - 1)
+
+enum nfulnl_msg_config_cmds {
+ NFULNL_CFG_CMD_NONE,
+ NFULNL_CFG_CMD_BIND,
+ NFULNL_CFG_CMD_UNBIND,
+ NFULNL_CFG_CMD_PF_BIND,
+ NFULNL_CFG_CMD_PF_UNBIND,
+};
+
+struct nfulnl_msg_config_cmd {
+ u_int8_t command; /* nfulnl_msg_config_cmds */
+} __attribute__ ((packed));
+
+struct nfulnl_msg_config_mode {
+ __be32 copy_range;
+ u_int8_t copy_mode;
+ u_int8_t _pad;
+} __attribute__ ((packed));
+
+enum nfulnl_attr_config {
+ NFULA_CFG_UNSPEC,
+ NFULA_CFG_CMD, /* nfulnl_msg_config_cmd */
+ NFULA_CFG_MODE, /* nfulnl_msg_config_mode */
+ NFULA_CFG_NLBUFSIZ, /* u_int32_t buffer size */
+ NFULA_CFG_TIMEOUT, /* u_int32_t in 1/100 s */
+ NFULA_CFG_QTHRESH, /* u_int32_t */
+ NFULA_CFG_FLAGS, /* u_int16_t */
+ __NFULA_CFG_MAX
+};
+#define NFULA_CFG_MAX (__NFULA_CFG_MAX -1)
+
+#define NFULNL_COPY_NONE 0x00
+#define NFULNL_COPY_META 0x01
+#define NFULNL_COPY_PACKET 0x02
+
+#define NFULNL_CFG_F_SEQ 0x0001
+#define NFULNL_CFG_F_SEQ_GLOBAL 0x0002
+
+#endif /* _NFNETLINK_LOG_H */
diff --git a/sysroot/usr/include/linux/netfilter/nfnetlink_queue.h b/sysroot/usr/include/linux/netfilter/nfnetlink_queue.h
new file mode 100644
index 0000000..83e7896
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/nfnetlink_queue.h
@@ -0,0 +1,90 @@
+#ifndef _NFNETLINK_QUEUE_H
+#define _NFNETLINK_QUEUE_H
+
+#include <linux/types.h>
+#include <linux/netfilter/nfnetlink.h>
+
+enum nfqnl_msg_types {
+ NFQNL_MSG_PACKET, /* packet from kernel to userspace */
+ NFQNL_MSG_VERDICT, /* verdict from userspace to kernel */
+ NFQNL_MSG_CONFIG, /* connect to a particular queue */
+
+ NFQNL_MSG_MAX
+};
+
+struct nfqnl_msg_packet_hdr {
+ __be32 packet_id; /* unique ID of packet in queue */
+ __be16 hw_protocol; /* hw protocol (network order) */
+ u_int8_t hook; /* netfilter hook */
+} __attribute__ ((packed));
+
+struct nfqnl_msg_packet_hw {
+ __be16 hw_addrlen;
+ u_int16_t _pad;
+ u_int8_t hw_addr[8];
+};
+
+struct nfqnl_msg_packet_timestamp {
+ aligned_be64 sec;
+ aligned_be64 usec;
+};
+
+enum nfqnl_attr_type {
+ NFQA_UNSPEC,
+ NFQA_PACKET_HDR,
+ NFQA_VERDICT_HDR, /* nfqnl_msg_verdict_hrd */
+ NFQA_MARK, /* u_int32_t nfmark */
+ NFQA_TIMESTAMP, /* nfqnl_msg_packet_timestamp */
+ NFQA_IFINDEX_INDEV, /* u_int32_t ifindex */
+ NFQA_IFINDEX_OUTDEV, /* u_int32_t ifindex */
+ NFQA_IFINDEX_PHYSINDEV, /* u_int32_t ifindex */
+ NFQA_IFINDEX_PHYSOUTDEV, /* u_int32_t ifindex */
+ NFQA_HWADDR, /* nfqnl_msg_packet_hw */
+ NFQA_PAYLOAD, /* opaque data payload */
+
+ __NFQA_MAX
+};
+#define NFQA_MAX (__NFQA_MAX - 1)
+
+struct nfqnl_msg_verdict_hdr {
+ __be32 verdict;
+ __be32 id;
+};
+
+
+enum nfqnl_msg_config_cmds {
+ NFQNL_CFG_CMD_NONE,
+ NFQNL_CFG_CMD_BIND,
+ NFQNL_CFG_CMD_UNBIND,
+ NFQNL_CFG_CMD_PF_BIND,
+ NFQNL_CFG_CMD_PF_UNBIND,
+};
+
+struct nfqnl_msg_config_cmd {
+ u_int8_t command; /* nfqnl_msg_config_cmds */
+ u_int8_t _pad;
+ __be16 pf; /* AF_xxx for PF_[UN]BIND */
+};
+
+enum nfqnl_config_mode {
+ NFQNL_COPY_NONE,
+ NFQNL_COPY_META,
+ NFQNL_COPY_PACKET,
+};
+
+struct nfqnl_msg_config_params {
+ __be32 copy_range;
+ u_int8_t copy_mode; /* enum nfqnl_config_mode */
+} __attribute__ ((packed));
+
+
+enum nfqnl_attr_config {
+ NFQA_CFG_UNSPEC,
+ NFQA_CFG_CMD, /* nfqnl_msg_config_cmd */
+ NFQA_CFG_PARAMS, /* nfqnl_msg_config_params */
+ NFQA_CFG_QUEUE_MAXLEN, /* u_int32_t */
+ __NFQA_CFG_MAX
+};
+#define NFQA_CFG_MAX (__NFQA_CFG_MAX-1)
+
+#endif /* _NFNETLINK_QUEUE_H */
diff --git a/sysroot/usr/include/linux/netfilter/x_tables.h b/sysroot/usr/include/linux/netfilter/x_tables.h
new file mode 100644
index 0000000..95bc695
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/x_tables.h
@@ -0,0 +1,130 @@
+#ifndef _X_TABLES_H
+#define _X_TABLES_H
+
+#define XT_FUNCTION_MAXNAMELEN 30
+#define XT_TABLE_MAXNAMELEN 32
+
+struct xt_entry_match
+{
+ union {
+ struct {
+ u_int16_t match_size;
+
+ /* Used by userspace */
+ char name[XT_FUNCTION_MAXNAMELEN-1];
+
+ u_int8_t revision;
+ } user;
+ struct {
+ u_int16_t match_size;
+
+ /* Used inside the kernel */
+ struct xt_match *match;
+ } kernel;
+
+ /* Total length */
+ u_int16_t match_size;
+ } u;
+
+ unsigned char data[0];
+};
+
+struct xt_entry_target
+{
+ union {
+ struct {
+ u_int16_t target_size;
+
+ /* Used by userspace */
+ char name[XT_FUNCTION_MAXNAMELEN-1];
+
+ u_int8_t revision;
+ } user;
+ struct {
+ u_int16_t target_size;
+
+ /* Used inside the kernel */
+ struct xt_target *target;
+ } kernel;
+
+ /* Total length */
+ u_int16_t target_size;
+ } u;
+
+ unsigned char data[0];
+};
+
+#define XT_TARGET_INIT(__name, __size) \
+{ \
+ .target.u.user = { \
+ .target_size = XT_ALIGN(__size), \
+ .name = __name, \
+ }, \
+}
+
+struct xt_standard_target
+{
+ struct xt_entry_target target;
+ int verdict;
+};
+
+/* The argument to IPT_SO_GET_REVISION_*. Returns highest revision
+ * kernel supports, if >= revision. */
+struct xt_get_revision
+{
+ char name[XT_FUNCTION_MAXNAMELEN-1];
+
+ u_int8_t revision;
+};
+
+/* CONTINUE verdict for targets */
+#define XT_CONTINUE 0xFFFFFFFF
+
+/* For standard target */
+#define XT_RETURN (-NF_REPEAT - 1)
+
+/* this is a dummy structure to find out the alignment requirement for a struct
+ * containing all the fundamental data types that are used in ipt_entry,
+ * ip6t_entry and arpt_entry. This sucks, and it is a hack. It will be my
+ * personal pleasure to remove it -HW
+ */
+struct _xt_align
+{
+ u_int8_t u8;
+ u_int16_t u16;
+ u_int32_t u32;
+ u_int64_t u64;
+};
+
+#define XT_ALIGN(s) (((s) + (__alignof__(struct _xt_align)-1)) \
+ & ~(__alignof__(struct _xt_align)-1))
+
+/* Standard return verdict, or do jump. */
+#define XT_STANDARD_TARGET ""
+/* Error verdict. */
+#define XT_ERROR_TARGET "ERROR"
+
+#define SET_COUNTER(c,b,p) do { (c).bcnt = (b); (c).pcnt = (p); } while(0)
+#define ADD_COUNTER(c,b,p) do { (c).bcnt += (b); (c).pcnt += (p); } while(0)
+
+struct xt_counters
+{
+ u_int64_t pcnt, bcnt; /* Packet and byte counters */
+};
+
+/* The argument to IPT_SO_ADD_COUNTERS. */
+struct xt_counters_info
+{
+ /* Which table. */
+ char name[XT_TABLE_MAXNAMELEN];
+
+ unsigned int num_counters;
+
+ /* The counters (actually `number' of these). */
+ struct xt_counters counters[0];
+};
+
+#define XT_INV_PROTO 0x40 /* Invert the sense of PROTO. */
+
+
+#endif /* _X_TABLES_H */
diff --git a/sysroot/usr/include/linux/netfilter/xt_CLASSIFY.h b/sysroot/usr/include/linux/netfilter/xt_CLASSIFY.h
new file mode 100644
index 0000000..5811135
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/xt_CLASSIFY.h
@@ -0,0 +1,8 @@
+#ifndef _XT_CLASSIFY_H
+#define _XT_CLASSIFY_H
+
+struct xt_classify_target_info {
+ u_int32_t priority;
+};
+
+#endif /*_XT_CLASSIFY_H */
diff --git a/sysroot/usr/include/linux/netfilter/xt_CONNMARK.h b/sysroot/usr/include/linux/netfilter/xt_CONNMARK.h
new file mode 100644
index 0000000..9f74468
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/xt_CONNMARK.h
@@ -0,0 +1,25 @@
+#ifndef _XT_CONNMARK_H_target
+#define _XT_CONNMARK_H_target
+
+/* Copyright (C) 2002,2004 MARA Systems AB <http://www.marasystems.com>
+ * by Henrik Nordstrom <hno@marasystems.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+enum {
+ XT_CONNMARK_SET = 0,
+ XT_CONNMARK_SAVE,
+ XT_CONNMARK_RESTORE
+};
+
+struct xt_connmark_target_info {
+ unsigned long mark;
+ unsigned long mask;
+ u_int8_t mode;
+};
+
+#endif /*_XT_CONNMARK_H_target*/
diff --git a/sysroot/usr/include/linux/netfilter/xt_CONNSECMARK.h b/sysroot/usr/include/linux/netfilter/xt_CONNSECMARK.h
new file mode 100644
index 0000000..c6bd754
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/xt_CONNSECMARK.h
@@ -0,0 +1,13 @@
+#ifndef _XT_CONNSECMARK_H_target
+#define _XT_CONNSECMARK_H_target
+
+enum {
+ CONNSECMARK_SAVE = 1,
+ CONNSECMARK_RESTORE,
+};
+
+struct xt_connsecmark_target_info {
+ u_int8_t mode;
+};
+
+#endif /*_XT_CONNSECMARK_H_target */
diff --git a/sysroot/usr/include/linux/netfilter/xt_DSCP.h b/sysroot/usr/include/linux/netfilter/xt_DSCP.h
new file mode 100644
index 0000000..3c7c963
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/xt_DSCP.h
@@ -0,0 +1,20 @@
+/* x_tables module for setting the IPv4/IPv6 DSCP field
+ *
+ * (C) 2002 Harald Welte <laforge@gnumonks.org>
+ * based on ipt_FTOS.c (C) 2000 by Matthew G. Marsh <mgm@paktronix.com>
+ * This software is distributed under GNU GPL v2, 1991
+ *
+ * See RFC2474 for a description of the DSCP field within the IP Header.
+ *
+ * xt_DSCP.h,v 1.7 2002/03/14 12:03:13 laforge Exp
+*/
+#ifndef _XT_DSCP_TARGET_H
+#define _XT_DSCP_TARGET_H
+#include <linux/netfilter/xt_dscp.h>
+
+/* target info */
+struct xt_DSCP_info {
+ u_int8_t dscp;
+};
+
+#endif /* _XT_DSCP_TARGET_H */
diff --git a/sysroot/usr/include/linux/netfilter/xt_MARK.h b/sysroot/usr/include/linux/netfilter/xt_MARK.h
new file mode 100644
index 0000000..b021e93
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/xt_MARK.h
@@ -0,0 +1,21 @@
+#ifndef _XT_MARK_H_target
+#define _XT_MARK_H_target
+
+/* Version 0 */
+struct xt_mark_target_info {
+ unsigned long mark;
+};
+
+/* Version 1 */
+enum {
+ XT_MARK_SET=0,
+ XT_MARK_AND,
+ XT_MARK_OR,
+};
+
+struct xt_mark_target_info_v1 {
+ unsigned long mark;
+ u_int8_t mode;
+};
+
+#endif /*_XT_MARK_H_target */
diff --git a/sysroot/usr/include/linux/netfilter/xt_NFLOG.h b/sysroot/usr/include/linux/netfilter/xt_NFLOG.h
new file mode 100644
index 0000000..cdcd0ed
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/xt_NFLOG.h
@@ -0,0 +1,18 @@
+#ifndef _XT_NFLOG_TARGET
+#define _XT_NFLOG_TARGET
+
+#define XT_NFLOG_DEFAULT_GROUP 0x1
+#define XT_NFLOG_DEFAULT_THRESHOLD 1
+
+#define XT_NFLOG_MASK 0x0
+
+struct xt_nflog_info {
+ u_int32_t len;
+ u_int16_t group;
+ u_int16_t threshold;
+ u_int16_t flags;
+ u_int16_t pad;
+ char prefix[64];
+};
+
+#endif /* _XT_NFLOG_TARGET */
diff --git a/sysroot/usr/include/linux/netfilter/xt_NFQUEUE.h b/sysroot/usr/include/linux/netfilter/xt_NFQUEUE.h
new file mode 100644
index 0000000..9a9af79
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/xt_NFQUEUE.h
@@ -0,0 +1,16 @@
+/* iptables module for using NFQUEUE mechanism
+ *
+ * (C) 2005 Harald Welte <laforge@netfilter.org>
+ *
+ * This software is distributed under GNU GPL v2, 1991
+ *
+*/
+#ifndef _XT_NFQ_TARGET_H
+#define _XT_NFQ_TARGET_H
+
+/* target info */
+struct xt_NFQ_info {
+ u_int16_t queuenum;
+};
+
+#endif /* _XT_NFQ_TARGET_H */
diff --git a/sysroot/usr/include/linux/netfilter/xt_SECMARK.h b/sysroot/usr/include/linux/netfilter/xt_SECMARK.h
new file mode 100644
index 0000000..c53fbff
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/xt_SECMARK.h
@@ -0,0 +1,26 @@
+#ifndef _XT_SECMARK_H_target
+#define _XT_SECMARK_H_target
+
+/*
+ * This is intended for use by various security subsystems (but not
+ * at the same time).
+ *
+ * 'mode' refers to the specific security subsystem which the
+ * packets are being marked for.
+ */
+#define SECMARK_MODE_SEL 0x01 /* SELinux */
+#define SECMARK_SELCTX_MAX 256
+
+struct xt_secmark_target_selinux_info {
+ u_int32_t selsid;
+ char selctx[SECMARK_SELCTX_MAX];
+};
+
+struct xt_secmark_target_info {
+ u_int8_t mode;
+ union {
+ struct xt_secmark_target_selinux_info sel;
+ } u;
+};
+
+#endif /*_XT_SECMARK_H_target */
diff --git a/sysroot/usr/include/linux/netfilter/xt_TCPMSS.h b/sysroot/usr/include/linux/netfilter/xt_TCPMSS.h
new file mode 100644
index 0000000..53a292c
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/xt_TCPMSS.h
@@ -0,0 +1,10 @@
+#ifndef _XT_TCPMSS_H
+#define _XT_TCPMSS_H
+
+struct xt_tcpmss_info {
+ u_int16_t mss;
+};
+
+#define XT_TCPMSS_CLAMP_PMTU 0xffff
+
+#endif /* _XT_TCPMSS_H */
diff --git a/sysroot/usr/include/linux/netfilter/xt_comment.h b/sysroot/usr/include/linux/netfilter/xt_comment.h
new file mode 100644
index 0000000..eacfedc
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/xt_comment.h
@@ -0,0 +1,10 @@
+#ifndef _XT_COMMENT_H
+#define _XT_COMMENT_H
+
+#define XT_MAX_COMMENT_LEN 256
+
+struct xt_comment_info {
+ unsigned char comment[XT_MAX_COMMENT_LEN];
+};
+
+#endif /* XT_COMMENT_H */
diff --git a/sysroot/usr/include/linux/netfilter/xt_connbytes.h b/sysroot/usr/include/linux/netfilter/xt_connbytes.h
new file mode 100644
index 0000000..c022c98
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/xt_connbytes.h
@@ -0,0 +1,25 @@
+#ifndef _XT_CONNBYTES_H
+#define _XT_CONNBYTES_H
+
+enum xt_connbytes_what {
+ XT_CONNBYTES_PKTS,
+ XT_CONNBYTES_BYTES,
+ XT_CONNBYTES_AVGPKT,
+};
+
+enum xt_connbytes_direction {
+ XT_CONNBYTES_DIR_ORIGINAL,
+ XT_CONNBYTES_DIR_REPLY,
+ XT_CONNBYTES_DIR_BOTH,
+};
+
+struct xt_connbytes_info
+{
+ struct {
+ aligned_u64 from; /* count to be matched */
+ aligned_u64 to; /* count to be matched */
+ } count;
+ u_int8_t what; /* ipt_connbytes_what */
+ u_int8_t direction; /* ipt_connbytes_direction */
+};
+#endif
diff --git a/sysroot/usr/include/linux/netfilter/xt_connmark.h b/sysroot/usr/include/linux/netfilter/xt_connmark.h
new file mode 100644
index 0000000..c592f6a
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/xt_connmark.h
@@ -0,0 +1,18 @@
+#ifndef _XT_CONNMARK_H
+#define _XT_CONNMARK_H
+
+/* Copyright (C) 2002,2004 MARA Systems AB <http://www.marasystems.com>
+ * by Henrik Nordstrom <hno@marasystems.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+struct xt_connmark_info {
+ unsigned long mark, mask;
+ u_int8_t invert;
+};
+
+#endif /*_XT_CONNMARK_H*/
diff --git a/sysroot/usr/include/linux/netfilter/xt_conntrack.h b/sysroot/usr/include/linux/netfilter/xt_conntrack.h
new file mode 100644
index 0000000..70b6f71
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/xt_conntrack.h
@@ -0,0 +1,63 @@
+/* Header file for kernel module to match connection tracking information.
+ * GPL (C) 2001 Marc Boucher (marc@mbsi.ca).
+ */
+
+#ifndef _XT_CONNTRACK_H
+#define _XT_CONNTRACK_H
+
+#include <linux/netfilter/nf_conntrack_tuple_common.h>
+#include <linux/in.h>
+
+#define XT_CONNTRACK_STATE_BIT(ctinfo) (1 << ((ctinfo)%IP_CT_IS_REPLY+1))
+#define XT_CONNTRACK_STATE_INVALID (1 << 0)
+
+#define XT_CONNTRACK_STATE_SNAT (1 << (IP_CT_NUMBER + 1))
+#define XT_CONNTRACK_STATE_DNAT (1 << (IP_CT_NUMBER + 2))
+#define XT_CONNTRACK_STATE_UNTRACKED (1 << (IP_CT_NUMBER + 3))
+
+/* flags, invflags: */
+#define XT_CONNTRACK_STATE 0x01
+#define XT_CONNTRACK_PROTO 0x02
+#define XT_CONNTRACK_ORIGSRC 0x04
+#define XT_CONNTRACK_ORIGDST 0x08
+#define XT_CONNTRACK_REPLSRC 0x10
+#define XT_CONNTRACK_REPLDST 0x20
+#define XT_CONNTRACK_STATUS 0x40
+#define XT_CONNTRACK_EXPIRES 0x80
+
+/* This is exposed to userspace, so remains frozen in time. */
+struct ip_conntrack_old_tuple
+{
+ struct {
+ __be32 ip;
+ union {
+ __u16 all;
+ } u;
+ } src;
+
+ struct {
+ __be32 ip;
+ union {
+ __u16 all;
+ } u;
+
+ /* The protocol. */
+ __u16 protonum;
+ } dst;
+};
+
+struct xt_conntrack_info
+{
+ unsigned int statemask, statusmask;
+
+ struct ip_conntrack_old_tuple tuple[IP_CT_DIR_MAX];
+ struct in_addr sipmsk[IP_CT_DIR_MAX], dipmsk[IP_CT_DIR_MAX];
+
+ unsigned long expires_min, expires_max;
+
+ /* Flags word */
+ u_int8_t flags;
+ /* Inverse flags */
+ u_int8_t invflags;
+};
+#endif /*_XT_CONNTRACK_H*/
diff --git a/sysroot/usr/include/linux/netfilter/xt_dccp.h b/sysroot/usr/include/linux/netfilter/xt_dccp.h
new file mode 100644
index 0000000..e0221b9
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/xt_dccp.h
@@ -0,0 +1,23 @@
+#ifndef _XT_DCCP_H_
+#define _XT_DCCP_H_
+
+#define XT_DCCP_SRC_PORTS 0x01
+#define XT_DCCP_DEST_PORTS 0x02
+#define XT_DCCP_TYPE 0x04
+#define XT_DCCP_OPTION 0x08
+
+#define XT_DCCP_VALID_FLAGS 0x0f
+
+struct xt_dccp_info {
+ u_int16_t dpts[2]; /* Min, Max */
+ u_int16_t spts[2]; /* Min, Max */
+
+ u_int16_t flags;
+ u_int16_t invflags;
+
+ u_int16_t typemask;
+ u_int8_t option;
+};
+
+#endif /* _XT_DCCP_H_ */
+
diff --git a/sysroot/usr/include/linux/netfilter/xt_dscp.h b/sysroot/usr/include/linux/netfilter/xt_dscp.h
new file mode 100644
index 0000000..1da61e6
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/xt_dscp.h
@@ -0,0 +1,23 @@
+/* x_tables module for matching the IPv4/IPv6 DSCP field
+ *
+ * (C) 2002 Harald Welte <laforge@gnumonks.org>
+ * This software is distributed under GNU GPL v2, 1991
+ *
+ * See RFC2474 for a description of the DSCP field within the IP Header.
+ *
+ * xt_dscp.h,v 1.3 2002/08/05 19:00:21 laforge Exp
+*/
+#ifndef _XT_DSCP_H
+#define _XT_DSCP_H
+
+#define XT_DSCP_MASK 0xfc /* 11111100 */
+#define XT_DSCP_SHIFT 2
+#define XT_DSCP_MAX 0x3f /* 00111111 */
+
+/* match info */
+struct xt_dscp_info {
+ u_int8_t dscp;
+ u_int8_t invert;
+};
+
+#endif /* _XT_DSCP_H */
diff --git a/sysroot/usr/include/linux/netfilter/xt_esp.h b/sysroot/usr/include/linux/netfilter/xt_esp.h
new file mode 100644
index 0000000..9380fb1
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/xt_esp.h
@@ -0,0 +1,14 @@
+#ifndef _XT_ESP_H
+#define _XT_ESP_H
+
+struct xt_esp
+{
+ u_int32_t spis[2]; /* Security Parameter Index */
+ u_int8_t invflags; /* Inverse flags */
+};
+
+/* Values for "invflags" field in struct xt_esp. */
+#define XT_ESP_INV_SPI 0x01 /* Invert the sense of spi. */
+#define XT_ESP_INV_MASK 0x01 /* All possible flags. */
+
+#endif /*_XT_ESP_H*/
diff --git a/sysroot/usr/include/linux/netfilter/xt_hashlimit.h b/sysroot/usr/include/linux/netfilter/xt_hashlimit.h
new file mode 100644
index 0000000..b4556b8
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/xt_hashlimit.h
@@ -0,0 +1,40 @@
+#ifndef _XT_HASHLIMIT_H
+#define _XT_HASHLIMIT_H
+
+/* timings are in milliseconds. */
+#define XT_HASHLIMIT_SCALE 10000
+/* 1/10,000 sec period => max of 10,000/sec. Min rate is then 429490
+ seconds, or one every 59 hours. */
+
+/* details of this structure hidden by the implementation */
+struct xt_hashlimit_htable;
+
+#define XT_HASHLIMIT_HASH_DIP 0x0001
+#define XT_HASHLIMIT_HASH_DPT 0x0002
+#define XT_HASHLIMIT_HASH_SIP 0x0004
+#define XT_HASHLIMIT_HASH_SPT 0x0008
+
+struct hashlimit_cfg {
+ u_int32_t mode; /* bitmask of IPT_HASHLIMIT_HASH_* */
+ u_int32_t avg; /* Average secs between packets * scale */
+ u_int32_t burst; /* Period multiplier for upper limit. */
+
+ /* user specified */
+ u_int32_t size; /* how many buckets */
+ u_int32_t max; /* max number of entries */
+ u_int32_t gc_interval; /* gc interval */
+ u_int32_t expire; /* when do entries expire? */
+};
+
+struct xt_hashlimit_info {
+ char name [IFNAMSIZ]; /* name */
+ struct hashlimit_cfg cfg;
+ struct xt_hashlimit_htable *hinfo;
+
+ /* Used internally by the kernel */
+ union {
+ void *ptr;
+ struct xt_hashlimit_info *master;
+ } u;
+};
+#endif /*_XT_HASHLIMIT_H*/
diff --git a/sysroot/usr/include/linux/netfilter/xt_helper.h b/sysroot/usr/include/linux/netfilter/xt_helper.h
new file mode 100644
index 0000000..6b42763
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/xt_helper.h
@@ -0,0 +1,8 @@
+#ifndef _XT_HELPER_H
+#define _XT_HELPER_H
+
+struct xt_helper_info {
+ int invert;
+ char name[30];
+};
+#endif /* _XT_HELPER_H */
diff --git a/sysroot/usr/include/linux/netfilter/xt_length.h b/sysroot/usr/include/linux/netfilter/xt_length.h
new file mode 100644
index 0000000..7c2b439
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/xt_length.h
@@ -0,0 +1,9 @@
+#ifndef _XT_LENGTH_H
+#define _XT_LENGTH_H
+
+struct xt_length_info {
+ u_int16_t min, max;
+ u_int8_t invert;
+};
+
+#endif /*_XT_LENGTH_H*/
diff --git a/sysroot/usr/include/linux/netfilter/xt_limit.h b/sysroot/usr/include/linux/netfilter/xt_limit.h
new file mode 100644
index 0000000..b3ce653
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/xt_limit.h
@@ -0,0 +1,21 @@
+#ifndef _XT_RATE_H
+#define _XT_RATE_H
+
+/* timings are in milliseconds. */
+#define XT_LIMIT_SCALE 10000
+
+/* 1/10,000 sec period => max of 10,000/sec. Min rate is then 429490
+ seconds, or one every 59 hours. */
+struct xt_rateinfo {
+ u_int32_t avg; /* Average secs between packets * scale */
+ u_int32_t burst; /* Period multiplier for upper limit. */
+
+ /* Used internally by the kernel */
+ unsigned long prev;
+ u_int32_t credit;
+ u_int32_t credit_cap, cost;
+
+ /* Ugly, ugly fucker. */
+ struct xt_rateinfo *master;
+};
+#endif /*_XT_RATE_H*/
diff --git a/sysroot/usr/include/linux/netfilter/xt_mac.h b/sysroot/usr/include/linux/netfilter/xt_mac.h
new file mode 100644
index 0000000..b892cdc
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/xt_mac.h
@@ -0,0 +1,8 @@
+#ifndef _XT_MAC_H
+#define _XT_MAC_H
+
+struct xt_mac_info {
+ unsigned char srcaddr[ETH_ALEN];
+ int invert;
+};
+#endif /*_XT_MAC_H*/
diff --git a/sysroot/usr/include/linux/netfilter/xt_mark.h b/sysroot/usr/include/linux/netfilter/xt_mark.h
new file mode 100644
index 0000000..802dd48
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/xt_mark.h
@@ -0,0 +1,9 @@
+#ifndef _XT_MARK_H
+#define _XT_MARK_H
+
+struct xt_mark_info {
+ unsigned long mark, mask;
+ u_int8_t invert;
+};
+
+#endif /*_XT_MARK_H*/
diff --git a/sysroot/usr/include/linux/netfilter/xt_multiport.h b/sysroot/usr/include/linux/netfilter/xt_multiport.h
new file mode 100644
index 0000000..d49ee41
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/xt_multiport.h
@@ -0,0 +1,30 @@
+#ifndef _XT_MULTIPORT_H
+#define _XT_MULTIPORT_H
+
+enum xt_multiport_flags
+{
+ XT_MULTIPORT_SOURCE,
+ XT_MULTIPORT_DESTINATION,
+ XT_MULTIPORT_EITHER
+};
+
+#define XT_MULTI_PORTS 15
+
+/* Must fit inside union xt_matchinfo: 16 bytes */
+struct xt_multiport
+{
+ u_int8_t flags; /* Type of comparison */
+ u_int8_t count; /* Number of ports */
+ u_int16_t ports[XT_MULTI_PORTS]; /* Ports */
+};
+
+struct xt_multiport_v1
+{
+ u_int8_t flags; /* Type of comparison */
+ u_int8_t count; /* Number of ports */
+ u_int16_t ports[XT_MULTI_PORTS]; /* Ports */
+ u_int8_t pflags[XT_MULTI_PORTS]; /* Port flags */
+ u_int8_t invert; /* Invert flag */
+};
+
+#endif /*_XT_MULTIPORT_H*/
diff --git a/sysroot/usr/include/linux/netfilter/xt_physdev.h b/sysroot/usr/include/linux/netfilter/xt_physdev.h
new file mode 100644
index 0000000..9d33619
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/xt_physdev.h
@@ -0,0 +1,21 @@
+#ifndef _XT_PHYSDEV_H
+#define _XT_PHYSDEV_H
+
+
+#define XT_PHYSDEV_OP_IN 0x01
+#define XT_PHYSDEV_OP_OUT 0x02
+#define XT_PHYSDEV_OP_BRIDGED 0x04
+#define XT_PHYSDEV_OP_ISIN 0x08
+#define XT_PHYSDEV_OP_ISOUT 0x10
+#define XT_PHYSDEV_OP_MASK (0x20 - 1)
+
+struct xt_physdev_info {
+ char physindev[IFNAMSIZ];
+ char in_mask[IFNAMSIZ];
+ char physoutdev[IFNAMSIZ];
+ char out_mask[IFNAMSIZ];
+ u_int8_t invert;
+ u_int8_t bitmask;
+};
+
+#endif /*_XT_PHYSDEV_H*/
diff --git a/sysroot/usr/include/linux/netfilter/xt_pkttype.h b/sysroot/usr/include/linux/netfilter/xt_pkttype.h
new file mode 100644
index 0000000..f265cf5
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/xt_pkttype.h
@@ -0,0 +1,8 @@
+#ifndef _XT_PKTTYPE_H
+#define _XT_PKTTYPE_H
+
+struct xt_pkttype_info {
+ int pkttype;
+ int invert;
+};
+#endif /*_XT_PKTTYPE_H*/
diff --git a/sysroot/usr/include/linux/netfilter/xt_policy.h b/sysroot/usr/include/linux/netfilter/xt_policy.h
new file mode 100644
index 0000000..45654d3
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/xt_policy.h
@@ -0,0 +1,58 @@
+#ifndef _XT_POLICY_H
+#define _XT_POLICY_H
+
+#define XT_POLICY_MAX_ELEM 4
+
+enum xt_policy_flags
+{
+ XT_POLICY_MATCH_IN = 0x1,
+ XT_POLICY_MATCH_OUT = 0x2,
+ XT_POLICY_MATCH_NONE = 0x4,
+ XT_POLICY_MATCH_STRICT = 0x8,
+};
+
+enum xt_policy_modes
+{
+ XT_POLICY_MODE_TRANSPORT,
+ XT_POLICY_MODE_TUNNEL
+};
+
+struct xt_policy_spec
+{
+ u_int8_t saddr:1,
+ daddr:1,
+ proto:1,
+ mode:1,
+ spi:1,
+ reqid:1;
+};
+
+union xt_policy_addr
+{
+ struct in_addr a4;
+ struct in6_addr a6;
+};
+
+struct xt_policy_elem
+{
+ union xt_policy_addr saddr;
+ union xt_policy_addr smask;
+ union xt_policy_addr daddr;
+ union xt_policy_addr dmask;
+ __be32 spi;
+ u_int32_t reqid;
+ u_int8_t proto;
+ u_int8_t mode;
+
+ struct xt_policy_spec match;
+ struct xt_policy_spec invert;
+};
+
+struct xt_policy_info
+{
+ struct xt_policy_elem pol[XT_POLICY_MAX_ELEM];
+ u_int16_t flags;
+ u_int16_t len;
+};
+
+#endif /* _XT_POLICY_H */
diff --git a/sysroot/usr/include/linux/netfilter/xt_quota.h b/sysroot/usr/include/linux/netfilter/xt_quota.h
new file mode 100644
index 0000000..acd7fd7
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/xt_quota.h
@@ -0,0 +1,16 @@
+#ifndef _XT_QUOTA_H
+#define _XT_QUOTA_H
+
+enum xt_quota_flags {
+ XT_QUOTA_INVERT = 0x1,
+};
+#define XT_QUOTA_MASK 0x1
+
+struct xt_quota_info {
+ u_int32_t flags;
+ u_int32_t pad;
+ aligned_u64 quota;
+ struct xt_quota_info *master;
+};
+
+#endif /* _XT_QUOTA_H */
diff --git a/sysroot/usr/include/linux/netfilter/xt_realm.h b/sysroot/usr/include/linux/netfilter/xt_realm.h
new file mode 100644
index 0000000..220e872
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/xt_realm.h
@@ -0,0 +1,10 @@
+#ifndef _XT_REALM_H
+#define _XT_REALM_H
+
+struct xt_realm_info {
+ u_int32_t id;
+ u_int32_t mask;
+ u_int8_t invert;
+};
+
+#endif /* _XT_REALM_H */
diff --git a/sysroot/usr/include/linux/netfilter/xt_sctp.h b/sysroot/usr/include/linux/netfilter/xt_sctp.h
new file mode 100644
index 0000000..dd5a4fd
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/xt_sctp.h
@@ -0,0 +1,104 @@
+#ifndef _XT_SCTP_H_
+#define _XT_SCTP_H_
+
+#define XT_SCTP_SRC_PORTS 0x01
+#define XT_SCTP_DEST_PORTS 0x02
+#define XT_SCTP_CHUNK_TYPES 0x04
+
+#define XT_SCTP_VALID_FLAGS 0x07
+
+struct xt_sctp_flag_info {
+ u_int8_t chunktype;
+ u_int8_t flag;
+ u_int8_t flag_mask;
+};
+
+#define XT_NUM_SCTP_FLAGS 4
+
+struct xt_sctp_info {
+ u_int16_t dpts[2]; /* Min, Max */
+ u_int16_t spts[2]; /* Min, Max */
+
+ u_int32_t chunkmap[256 / sizeof (u_int32_t)]; /* Bit mask of chunks to be matched according to RFC 2960 */
+
+#define SCTP_CHUNK_MATCH_ANY 0x01 /* Match if any of the chunk types are present */
+#define SCTP_CHUNK_MATCH_ALL 0x02 /* Match if all of the chunk types are present */
+#define SCTP_CHUNK_MATCH_ONLY 0x04 /* Match if these are the only chunk types present */
+
+ u_int32_t chunk_match_type;
+ struct xt_sctp_flag_info flag_info[XT_NUM_SCTP_FLAGS];
+ int flag_count;
+
+ u_int32_t flags;
+ u_int32_t invflags;
+};
+
+#define bytes(type) (sizeof(type) * 8)
+
+#define SCTP_CHUNKMAP_SET(chunkmap, type) \
+ do { \
+ chunkmap[type / bytes(u_int32_t)] |= \
+ 1 << (type % bytes(u_int32_t)); \
+ } while (0)
+
+#define SCTP_CHUNKMAP_CLEAR(chunkmap, type) \
+ do { \
+ chunkmap[type / bytes(u_int32_t)] &= \
+ ~(1 << (type % bytes(u_int32_t))); \
+ } while (0)
+
+#define SCTP_CHUNKMAP_IS_SET(chunkmap, type) \
+({ \
+ (chunkmap[type / bytes (u_int32_t)] & \
+ (1 << (type % bytes (u_int32_t)))) ? 1: 0; \
+})
+
+#define SCTP_CHUNKMAP_RESET(chunkmap) \
+ do { \
+ int i; \
+ for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \
+ chunkmap[i] = 0; \
+ } while (0)
+
+#define SCTP_CHUNKMAP_SET_ALL(chunkmap) \
+ do { \
+ int i; \
+ for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \
+ chunkmap[i] = ~0; \
+ } while (0)
+
+#define SCTP_CHUNKMAP_COPY(destmap, srcmap) \
+ do { \
+ int i; \
+ for (i = 0; i < ARRAY_SIZE(srcmap); i++) \
+ destmap[i] = srcmap[i]; \
+ } while (0)
+
+#define SCTP_CHUNKMAP_IS_CLEAR(chunkmap) \
+({ \
+ int i; \
+ int flag = 1; \
+ for (i = 0; i < ARRAY_SIZE(chunkmap); i++) { \
+ if (chunkmap[i]) { \
+ flag = 0; \
+ break; \
+ } \
+ } \
+ flag; \
+})
+
+#define SCTP_CHUNKMAP_IS_ALL_SET(chunkmap) \
+({ \
+ int i; \
+ int flag = 1; \
+ for (i = 0; i < ARRAY_SIZE(chunkmap); i++) { \
+ if (chunkmap[i] != ~0) { \
+ flag = 0; \
+ break; \
+ } \
+ } \
+ flag; \
+})
+
+#endif /* _XT_SCTP_H_ */
+
diff --git a/sysroot/usr/include/linux/netfilter/xt_state.h b/sysroot/usr/include/linux/netfilter/xt_state.h
new file mode 100644
index 0000000..c06f32e
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/xt_state.h
@@ -0,0 +1,13 @@
+#ifndef _XT_STATE_H
+#define _XT_STATE_H
+
+#define XT_STATE_BIT(ctinfo) (1 << ((ctinfo)%IP_CT_IS_REPLY+1))
+#define XT_STATE_INVALID (1 << 0)
+
+#define XT_STATE_UNTRACKED (1 << (IP_CT_NUMBER + 1))
+
+struct xt_state_info
+{
+ unsigned int statemask;
+};
+#endif /*_XT_STATE_H*/
diff --git a/sysroot/usr/include/linux/netfilter/xt_statistic.h b/sysroot/usr/include/linux/netfilter/xt_statistic.h
new file mode 100644
index 0000000..c344e99
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/xt_statistic.h
@@ -0,0 +1,32 @@
+#ifndef _XT_STATISTIC_H
+#define _XT_STATISTIC_H
+
+enum xt_statistic_mode {
+ XT_STATISTIC_MODE_RANDOM,
+ XT_STATISTIC_MODE_NTH,
+ __XT_STATISTIC_MODE_MAX
+};
+#define XT_STATISTIC_MODE_MAX (__XT_STATISTIC_MODE_MAX - 1)
+
+enum xt_statistic_flags {
+ XT_STATISTIC_INVERT = 0x1,
+};
+#define XT_STATISTIC_MASK 0x1
+
+struct xt_statistic_info {
+ u_int16_t mode;
+ u_int16_t flags;
+ union {
+ struct {
+ u_int32_t probability;
+ } random;
+ struct {
+ u_int32_t every;
+ u_int32_t packet;
+ u_int32_t count;
+ } nth;
+ } u;
+ struct xt_statistic_info *master __attribute__((aligned(8)));
+};
+
+#endif /* _XT_STATISTIC_H */
diff --git a/sysroot/usr/include/linux/netfilter/xt_string.h b/sysroot/usr/include/linux/netfilter/xt_string.h
new file mode 100644
index 0000000..3b3419f
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/xt_string.h
@@ -0,0 +1,18 @@
+#ifndef _XT_STRING_H
+#define _XT_STRING_H
+
+#define XT_STRING_MAX_PATTERN_SIZE 128
+#define XT_STRING_MAX_ALGO_NAME_SIZE 16
+
+struct xt_string_info
+{
+ u_int16_t from_offset;
+ u_int16_t to_offset;
+ char algo[XT_STRING_MAX_ALGO_NAME_SIZE];
+ char pattern[XT_STRING_MAX_PATTERN_SIZE];
+ u_int8_t patlen;
+ u_int8_t invert;
+ struct ts_config __attribute__((aligned(8))) *config;
+};
+
+#endif /*_XT_STRING_H*/
diff --git a/sysroot/usr/include/linux/netfilter/xt_tcpmss.h b/sysroot/usr/include/linux/netfilter/xt_tcpmss.h
new file mode 100644
index 0000000..e03274c
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/xt_tcpmss.h
@@ -0,0 +1,9 @@
+#ifndef _XT_TCPMSS_MATCH_H
+#define _XT_TCPMSS_MATCH_H
+
+struct xt_tcpmss_match_info {
+ u_int16_t mss_min, mss_max;
+ u_int8_t invert;
+};
+
+#endif /*_XT_TCPMSS_MATCH_H*/
diff --git a/sysroot/usr/include/linux/netfilter/xt_tcpudp.h b/sysroot/usr/include/linux/netfilter/xt_tcpudp.h
new file mode 100644
index 0000000..78bc65f
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter/xt_tcpudp.h
@@ -0,0 +1,36 @@
+#ifndef _XT_TCPUDP_H
+#define _XT_TCPUDP_H
+
+/* TCP matching stuff */
+struct xt_tcp
+{
+ u_int16_t spts[2]; /* Source port range. */
+ u_int16_t dpts[2]; /* Destination port range. */
+ u_int8_t option; /* TCP Option iff non-zero*/
+ u_int8_t flg_mask; /* TCP flags mask byte */
+ u_int8_t flg_cmp; /* TCP flags compare byte */
+ u_int8_t invflags; /* Inverse flags */
+};
+
+/* Values for "inv" field in struct ipt_tcp. */
+#define XT_TCP_INV_SRCPT 0x01 /* Invert the sense of source ports. */
+#define XT_TCP_INV_DSTPT 0x02 /* Invert the sense of dest ports. */
+#define XT_TCP_INV_FLAGS 0x04 /* Invert the sense of TCP flags. */
+#define XT_TCP_INV_OPTION 0x08 /* Invert the sense of option test. */
+#define XT_TCP_INV_MASK 0x0F /* All possible flags. */
+
+/* UDP matching stuff */
+struct xt_udp
+{
+ u_int16_t spts[2]; /* Source port range. */
+ u_int16_t dpts[2]; /* Destination port range. */
+ u_int8_t invflags; /* Inverse flags */
+};
+
+/* Values for "invflags" field in struct ipt_udp. */
+#define XT_UDP_INV_SRCPT 0x01 /* Invert the sense of source ports. */
+#define XT_UDP_INV_DSTPT 0x02 /* Invert the sense of dest ports. */
+#define XT_UDP_INV_MASK 0x03 /* All possible flags. */
+
+
+#endif
diff --git a/sysroot/usr/include/linux/netfilter_arp.h b/sysroot/usr/include/linux/netfilter_arp.h
new file mode 100644
index 0000000..92bc6dd
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_arp.h
@@ -0,0 +1,19 @@
+#ifndef __LINUX_ARP_NETFILTER_H
+#define __LINUX_ARP_NETFILTER_H
+
+/* ARP-specific defines for netfilter.
+ * (C)2002 Rusty Russell IBM -- This code is GPL.
+ */
+
+#include <linux/netfilter.h>
+
+/* There is no PF_ARP. */
+#define NF_ARP 0
+
+/* ARP Hooks */
+#define NF_ARP_IN 0
+#define NF_ARP_OUT 1
+#define NF_ARP_FORWARD 2
+#define NF_ARP_NUMHOOKS 3
+
+#endif /* __LINUX_ARP_NETFILTER_H */
diff --git a/sysroot/usr/include/linux/netfilter_arp/arp_tables.h b/sysroot/usr/include/linux/netfilter_arp/arp_tables.h
new file mode 100644
index 0000000..5483d43
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_arp/arp_tables.h
@@ -0,0 +1,231 @@
+/*
+ * Format of an ARP firewall descriptor
+ *
+ * src, tgt, src_mask, tgt_mask, arpop, arpop_mask are always stored in
+ * network byte order.
+ * flags are stored in host byte order (of course).
+ */
+
+#ifndef _ARPTABLES_H
+#define _ARPTABLES_H
+
+#include <linux/netfilter_arp.h>
+
+#include <linux/netfilter/x_tables.h>
+
+#define ARPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
+#define ARPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN
+#define arpt_target xt_target
+#define arpt_table xt_table
+
+#define ARPT_DEV_ADDR_LEN_MAX 16
+
+struct arpt_devaddr_info {
+ char addr[ARPT_DEV_ADDR_LEN_MAX];
+ char mask[ARPT_DEV_ADDR_LEN_MAX];
+};
+
+/* Yes, Virginia, you have to zero the padding. */
+struct arpt_arp {
+ /* Source and target IP addr */
+ struct in_addr src, tgt;
+ /* Mask for src and target IP addr */
+ struct in_addr smsk, tmsk;
+
+ /* Device hw address length, src+target device addresses */
+ u_int8_t arhln, arhln_mask;
+ struct arpt_devaddr_info src_devaddr;
+ struct arpt_devaddr_info tgt_devaddr;
+
+ /* ARP operation code. */
+ __be16 arpop, arpop_mask;
+
+ /* ARP hardware address and protocol address format. */
+ __be16 arhrd, arhrd_mask;
+ __be16 arpro, arpro_mask;
+
+ /* The protocol address length is only accepted if it is 4
+ * so there is no use in offering a way to do filtering on it.
+ */
+
+ char iniface[IFNAMSIZ], outiface[IFNAMSIZ];
+ unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ];
+
+ /* Flags word */
+ u_int8_t flags;
+ /* Inverse flags */
+ u_int16_t invflags;
+};
+
+#define arpt_entry_target xt_entry_target
+#define arpt_standard_target xt_standard_target
+
+/* Values for "flag" field in struct arpt_ip (general arp structure).
+ * No flags defined yet.
+ */
+#define ARPT_F_MASK 0x00 /* All possible flag bits mask. */
+
+/* Values for "inv" field in struct arpt_arp. */
+#define ARPT_INV_VIA_IN 0x0001 /* Invert the sense of IN IFACE. */
+#define ARPT_INV_VIA_OUT 0x0002 /* Invert the sense of OUT IFACE */
+#define ARPT_INV_SRCIP 0x0004 /* Invert the sense of SRC IP. */
+#define ARPT_INV_TGTIP 0x0008 /* Invert the sense of TGT IP. */
+#define ARPT_INV_SRCDEVADDR 0x0010 /* Invert the sense of SRC DEV ADDR. */
+#define ARPT_INV_TGTDEVADDR 0x0020 /* Invert the sense of TGT DEV ADDR. */
+#define ARPT_INV_ARPOP 0x0040 /* Invert the sense of ARP OP. */
+#define ARPT_INV_ARPHRD 0x0080 /* Invert the sense of ARP HRD. */
+#define ARPT_INV_ARPPRO 0x0100 /* Invert the sense of ARP PRO. */
+#define ARPT_INV_ARPHLN 0x0200 /* Invert the sense of ARP HLN. */
+#define ARPT_INV_MASK 0x03FF /* All possible flag bits mask. */
+
+/* This structure defines each of the firewall rules. Consists of 3
+ parts which are 1) general ARP header stuff 2) match specific
+ stuff 3) the target to perform if the rule matches */
+struct arpt_entry
+{
+ struct arpt_arp arp;
+
+ /* Size of arpt_entry + matches */
+ u_int16_t target_offset;
+ /* Size of arpt_entry + matches + target */
+ u_int16_t next_offset;
+
+ /* Back pointer */
+ unsigned int comefrom;
+
+ /* Packet and byte counters. */
+ struct xt_counters counters;
+
+ /* The matches (if any), then the target. */
+ unsigned char elems[0];
+};
+
+/*
+ * New IP firewall options for [gs]etsockopt at the RAW IP level.
+ * Unlike BSD Linux inherits IP options so you don't have to use a raw
+ * socket for this. Instead we check rights in the calls.
+ *
+ * ATTENTION: check linux/in.h before adding new number here.
+ */
+#define ARPT_BASE_CTL 96
+
+#define ARPT_SO_SET_REPLACE (ARPT_BASE_CTL)
+#define ARPT_SO_SET_ADD_COUNTERS (ARPT_BASE_CTL + 1)
+#define ARPT_SO_SET_MAX ARPT_SO_SET_ADD_COUNTERS
+
+#define ARPT_SO_GET_INFO (ARPT_BASE_CTL)
+#define ARPT_SO_GET_ENTRIES (ARPT_BASE_CTL + 1)
+/* #define ARPT_SO_GET_REVISION_MATCH (APRT_BASE_CTL + 2) */
+#define ARPT_SO_GET_REVISION_TARGET (ARPT_BASE_CTL + 3)
+#define ARPT_SO_GET_MAX (ARPT_SO_GET_REVISION_TARGET)
+
+/* CONTINUE verdict for targets */
+#define ARPT_CONTINUE XT_CONTINUE
+
+/* For standard target */
+#define ARPT_RETURN XT_RETURN
+
+/* The argument to ARPT_SO_GET_INFO */
+struct arpt_getinfo
+{
+ /* Which table: caller fills this in. */
+ char name[ARPT_TABLE_MAXNAMELEN];
+
+ /* Kernel fills these in. */
+ /* Which hook entry points are valid: bitmask */
+ unsigned int valid_hooks;
+
+ /* Hook entry points: one per netfilter hook. */
+ unsigned int hook_entry[NF_ARP_NUMHOOKS];
+
+ /* Underflow points. */
+ unsigned int underflow[NF_ARP_NUMHOOKS];
+
+ /* Number of entries */
+ unsigned int num_entries;
+
+ /* Size of entries. */
+ unsigned int size;
+};
+
+/* The argument to ARPT_SO_SET_REPLACE. */
+struct arpt_replace
+{
+ /* Which table. */
+ char name[ARPT_TABLE_MAXNAMELEN];
+
+ /* Which hook entry points are valid: bitmask. You can't
+ change this. */
+ unsigned int valid_hooks;
+
+ /* Number of entries */
+ unsigned int num_entries;
+
+ /* Total size of new entries */
+ unsigned int size;
+
+ /* Hook entry points. */
+ unsigned int hook_entry[NF_ARP_NUMHOOKS];
+
+ /* Underflow points. */
+ unsigned int underflow[NF_ARP_NUMHOOKS];
+
+ /* Information about old entries: */
+ /* Number of counters (must be equal to current number of entries). */
+ unsigned int num_counters;
+ /* The old entries' counters. */
+ struct xt_counters *counters;
+
+ /* The entries (hang off end: not really an array). */
+ struct arpt_entry entries[0];
+};
+
+/* The argument to ARPT_SO_ADD_COUNTERS. */
+#define arpt_counters_info xt_counters_info
+#define arpt_counters xt_counters
+
+/* The argument to ARPT_SO_GET_ENTRIES. */
+struct arpt_get_entries
+{
+ /* Which table: user fills this in. */
+ char name[ARPT_TABLE_MAXNAMELEN];
+
+ /* User fills this in: total entry size. */
+ unsigned int size;
+
+ /* The entries. */
+ struct arpt_entry entrytable[0];
+};
+
+/* Standard return verdict, or do jump. */
+#define ARPT_STANDARD_TARGET XT_STANDARD_TARGET
+/* Error verdict. */
+#define ARPT_ERROR_TARGET XT_ERROR_TARGET
+
+/* Helper functions */
+static __inline__ struct arpt_entry_target *arpt_get_target(struct arpt_entry *e)
+{
+ return (void *)e + e->target_offset;
+}
+
+/* fn returns 0 to continue iteration */
+#define ARPT_ENTRY_ITERATE(entries, size, fn, args...) \
+({ \
+ unsigned int __i; \
+ int __ret = 0; \
+ struct arpt_entry *__entry; \
+ \
+ for (__i = 0; __i < (size); __i += __entry->next_offset) { \
+ __entry = (void *)(entries) + __i; \
+ \
+ __ret = fn(__entry , ## args); \
+ if (__ret != 0) \
+ break; \
+ } \
+ __ret; \
+})
+
+/*
+ * Main firewall chains definitions and global var's definitions.
+ */
+#endif /* _ARPTABLES_H */
diff --git a/sysroot/usr/include/linux/netfilter_arp/arpt_mangle.h b/sysroot/usr/include/linux/netfilter_arp/arpt_mangle.h
new file mode 100644
index 0000000..250f502
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_arp/arpt_mangle.h
@@ -0,0 +1,26 @@
+#ifndef _ARPT_MANGLE_H
+#define _ARPT_MANGLE_H
+#include <linux/netfilter_arp/arp_tables.h>
+
+#define ARPT_MANGLE_ADDR_LEN_MAX sizeof(struct in_addr)
+struct arpt_mangle
+{
+ char src_devaddr[ARPT_DEV_ADDR_LEN_MAX];
+ char tgt_devaddr[ARPT_DEV_ADDR_LEN_MAX];
+ union {
+ struct in_addr src_ip;
+ } u_s;
+ union {
+ struct in_addr tgt_ip;
+ } u_t;
+ u_int8_t flags;
+ int target;
+};
+
+#define ARPT_MANGLE_SDEV 0x01
+#define ARPT_MANGLE_TDEV 0x02
+#define ARPT_MANGLE_SIP 0x04
+#define ARPT_MANGLE_TIP 0x08
+#define ARPT_MANGLE_MASK 0x0f
+
+#endif /* _ARPT_MANGLE_H */
diff --git a/sysroot/usr/include/linux/netfilter_bridge.h b/sysroot/usr/include/linux/netfilter_bridge.h
new file mode 100644
index 0000000..5094ecc
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_bridge.h
@@ -0,0 +1,27 @@
+#ifndef __LINUX_BRIDGE_NETFILTER_H
+#define __LINUX_BRIDGE_NETFILTER_H
+
+/* bridge-specific defines for netfilter.
+ */
+
+#include <linux/netfilter.h>
+#include <linux/if_ether.h>
+#include <linux/if_vlan.h>
+#include <linux/if_pppox.h>
+
+/* Bridge Hooks */
+/* After promisc drops, checksum checks. */
+#define NF_BR_PRE_ROUTING 0
+/* If the packet is destined for this box. */
+#define NF_BR_LOCAL_IN 1
+/* If the packet is destined for another interface. */
+#define NF_BR_FORWARD 2
+/* Packets coming from a local process. */
+#define NF_BR_LOCAL_OUT 3
+/* Packets about to hit the wire. */
+#define NF_BR_POST_ROUTING 4
+/* Not really a hook, but used for the ebtables broute table */
+#define NF_BR_BROUTING 5
+#define NF_BR_NUMHOOKS 6
+
+#endif
diff --git a/sysroot/usr/include/linux/netfilter_bridge/ebt_802_3.h b/sysroot/usr/include/linux/netfilter_bridge/ebt_802_3.h
new file mode 100644
index 0000000..b61e308
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_bridge/ebt_802_3.h
@@ -0,0 +1,61 @@
+#ifndef __LINUX_BRIDGE_EBT_802_3_H
+#define __LINUX_BRIDGE_EBT_802_3_H
+
+#define EBT_802_3_SAP 0x01
+#define EBT_802_3_TYPE 0x02
+
+#define EBT_802_3_MATCH "802_3"
+
+/*
+ * If frame has DSAP/SSAP value 0xaa you must check the SNAP type
+ * to discover what kind of packet we're carrying.
+ */
+#define CHECK_TYPE 0xaa
+
+/*
+ * Control field may be one or two bytes. If the first byte has
+ * the value 0x03 then the entire length is one byte, otherwise it is two.
+ * One byte controls are used in Unnumbered Information frames.
+ * Two byte controls are used in Numbered Information frames.
+ */
+#define IS_UI 0x03
+
+#define EBT_802_3_MASK (EBT_802_3_SAP | EBT_802_3_TYPE | EBT_802_3)
+
+/* ui has one byte ctrl, ni has two */
+struct hdr_ui {
+ uint8_t dsap;
+ uint8_t ssap;
+ uint8_t ctrl;
+ uint8_t orig[3];
+ __be16 type;
+};
+
+struct hdr_ni {
+ uint8_t dsap;
+ uint8_t ssap;
+ __be16 ctrl;
+ uint8_t orig[3];
+ __be16 type;
+};
+
+struct ebt_802_3_hdr {
+ uint8_t daddr[6];
+ uint8_t saddr[6];
+ __be16 len;
+ union {
+ struct hdr_ui ui;
+ struct hdr_ni ni;
+ } llc;
+};
+
+
+struct ebt_802_3_info
+{
+ uint8_t sap;
+ __be16 type;
+ uint8_t bitmask;
+ uint8_t invflags;
+};
+
+#endif
diff --git a/sysroot/usr/include/linux/netfilter_bridge/ebt_among.h b/sysroot/usr/include/linux/netfilter_bridge/ebt_among.h
new file mode 100644
index 0000000..7654069
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_bridge/ebt_among.h
@@ -0,0 +1,65 @@
+#ifndef __LINUX_BRIDGE_EBT_AMONG_H
+#define __LINUX_BRIDGE_EBT_AMONG_H
+
+#define EBT_AMONG_DST 0x01
+#define EBT_AMONG_SRC 0x02
+
+/* Grzegorz Borowiak <grzes@gnu.univ.gda.pl> 2003
+ *
+ * Write-once-read-many hash table, used for checking if a given
+ * MAC address belongs to a set or not and possibly for checking
+ * if it is related with a given IPv4 address.
+ *
+ * The hash value of an address is its last byte.
+ *
+ * In real-world ethernet addresses, values of the last byte are
+ * evenly distributed and there is no need to consider other bytes.
+ * It would only slow the routines down.
+ *
+ * For MAC address comparison speedup reasons, we introduce a trick.
+ * MAC address is mapped onto an array of two 32-bit integers.
+ * This pair of integers is compared with MAC addresses in the
+ * hash table, which are stored also in form of pairs of integers
+ * (in `cmp' array). This is quick as it requires only two elementary
+ * number comparisons in worst case. Further, we take advantage of
+ * fact that entropy of 3 last bytes of address is larger than entropy
+ * of 3 first bytes. So first we compare 4 last bytes of addresses and
+ * if they are the same we compare 2 first.
+ *
+ * Yes, it is a memory overhead, but in 2003 AD, who cares?
+ */
+
+struct ebt_mac_wormhash_tuple
+{
+ uint32_t cmp[2];
+ __be32 ip;
+};
+
+struct ebt_mac_wormhash
+{
+ int table[257];
+ int poolsize;
+ struct ebt_mac_wormhash_tuple pool[0];
+};
+
+#define ebt_mac_wormhash_size(x) ((x) ? sizeof(struct ebt_mac_wormhash) \
+ + (x)->poolsize * sizeof(struct ebt_mac_wormhash_tuple) : 0)
+
+struct ebt_among_info
+{
+ int wh_dst_ofs;
+ int wh_src_ofs;
+ int bitmask;
+};
+
+#define EBT_AMONG_DST_NEG 0x1
+#define EBT_AMONG_SRC_NEG 0x2
+
+#define ebt_among_wh_dst(x) ((x)->wh_dst_ofs ? \
+ (struct ebt_mac_wormhash*)((char*)(x) + (x)->wh_dst_ofs) : NULL)
+#define ebt_among_wh_src(x) ((x)->wh_src_ofs ? \
+ (struct ebt_mac_wormhash*)((char*)(x) + (x)->wh_src_ofs) : NULL)
+
+#define EBT_AMONG_MATCH "among"
+
+#endif
diff --git a/sysroot/usr/include/linux/netfilter_bridge/ebt_arp.h b/sysroot/usr/include/linux/netfilter_bridge/ebt_arp.h
new file mode 100644
index 0000000..cbf4843
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_bridge/ebt_arp.h
@@ -0,0 +1,34 @@
+#ifndef __LINUX_BRIDGE_EBT_ARP_H
+#define __LINUX_BRIDGE_EBT_ARP_H
+
+#define EBT_ARP_OPCODE 0x01
+#define EBT_ARP_HTYPE 0x02
+#define EBT_ARP_PTYPE 0x04
+#define EBT_ARP_SRC_IP 0x08
+#define EBT_ARP_DST_IP 0x10
+#define EBT_ARP_SRC_MAC 0x20
+#define EBT_ARP_DST_MAC 0x40
+#define EBT_ARP_GRAT 0x80
+#define EBT_ARP_MASK (EBT_ARP_OPCODE | EBT_ARP_HTYPE | EBT_ARP_PTYPE | \
+ EBT_ARP_SRC_IP | EBT_ARP_DST_IP | EBT_ARP_SRC_MAC | EBT_ARP_DST_MAC | \
+ EBT_ARP_GRAT)
+#define EBT_ARP_MATCH "arp"
+
+struct ebt_arp_info
+{
+ __be16 htype;
+ __be16 ptype;
+ __be16 opcode;
+ __be32 saddr;
+ __be32 smsk;
+ __be32 daddr;
+ __be32 dmsk;
+ unsigned char smaddr[ETH_ALEN];
+ unsigned char smmsk[ETH_ALEN];
+ unsigned char dmaddr[ETH_ALEN];
+ unsigned char dmmsk[ETH_ALEN];
+ uint8_t bitmask;
+ uint8_t invflags;
+};
+
+#endif
diff --git a/sysroot/usr/include/linux/netfilter_bridge/ebt_arpreply.h b/sysroot/usr/include/linux/netfilter_bridge/ebt_arpreply.h
new file mode 100644
index 0000000..96a8339
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_bridge/ebt_arpreply.h
@@ -0,0 +1,11 @@
+#ifndef __LINUX_BRIDGE_EBT_ARPREPLY_H
+#define __LINUX_BRIDGE_EBT_ARPREPLY_H
+
+struct ebt_arpreply_info
+{
+ unsigned char mac[ETH_ALEN];
+ int target;
+};
+#define EBT_ARPREPLY_TARGET "arpreply"
+
+#endif
diff --git a/sysroot/usr/include/linux/netfilter_bridge/ebt_ip.h b/sysroot/usr/include/linux/netfilter_bridge/ebt_ip.h
new file mode 100644
index 0000000..d684747
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_bridge/ebt_ip.h
@@ -0,0 +1,43 @@
+/*
+ * ebt_ip
+ *
+ * Authors:
+ * Bart De Schuymer <bart.de.schuymer@pandora.be>
+ *
+ * April, 2002
+ *
+ * Changes:
+ * added ip-sport and ip-dport
+ * Innominate Security Technologies AG <mhopf@innominate.com>
+ * September, 2002
+ */
+
+#ifndef __LINUX_BRIDGE_EBT_IP_H
+#define __LINUX_BRIDGE_EBT_IP_H
+
+#define EBT_IP_SOURCE 0x01
+#define EBT_IP_DEST 0x02
+#define EBT_IP_TOS 0x04
+#define EBT_IP_PROTO 0x08
+#define EBT_IP_SPORT 0x10
+#define EBT_IP_DPORT 0x20
+#define EBT_IP_MASK (EBT_IP_SOURCE | EBT_IP_DEST | EBT_IP_TOS | EBT_IP_PROTO |\
+ EBT_IP_SPORT | EBT_IP_DPORT )
+#define EBT_IP_MATCH "ip"
+
+/* the same values are used for the invflags */
+struct ebt_ip_info
+{
+ __be32 saddr;
+ __be32 daddr;
+ __be32 smsk;
+ __be32 dmsk;
+ uint8_t tos;
+ uint8_t protocol;
+ uint8_t bitmask;
+ uint8_t invflags;
+ uint16_t sport[2];
+ uint16_t dport[2];
+};
+
+#endif
diff --git a/sysroot/usr/include/linux/netfilter_bridge/ebt_limit.h b/sysroot/usr/include/linux/netfilter_bridge/ebt_limit.h
new file mode 100644
index 0000000..d8b6500
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_bridge/ebt_limit.h
@@ -0,0 +1,23 @@
+#ifndef __LINUX_BRIDGE_EBT_LIMIT_H
+#define __LINUX_BRIDGE_EBT_LIMIT_H
+
+#define EBT_LIMIT_MATCH "limit"
+
+/* timings are in milliseconds. */
+#define EBT_LIMIT_SCALE 10000
+
+/* 1/10,000 sec period => max of 10,000/sec. Min rate is then 429490
+ seconds, or one every 59 hours. */
+
+struct ebt_limit_info
+{
+ u_int32_t avg; /* Average secs between packets * scale */
+ u_int32_t burst; /* Period multiplier for upper limit. */
+
+ /* Used internally by the kernel */
+ unsigned long prev;
+ u_int32_t credit;
+ u_int32_t credit_cap, cost;
+};
+
+#endif
diff --git a/sysroot/usr/include/linux/netfilter_bridge/ebt_log.h b/sysroot/usr/include/linux/netfilter_bridge/ebt_log.h
new file mode 100644
index 0000000..96e231a
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_bridge/ebt_log.h
@@ -0,0 +1,18 @@
+#ifndef __LINUX_BRIDGE_EBT_LOG_H
+#define __LINUX_BRIDGE_EBT_LOG_H
+
+#define EBT_LOG_IP 0x01 /* if the frame is made by ip, log the ip information */
+#define EBT_LOG_ARP 0x02
+#define EBT_LOG_NFLOG 0x04
+#define EBT_LOG_MASK (EBT_LOG_IP | EBT_LOG_ARP)
+#define EBT_LOG_PREFIX_SIZE 30
+#define EBT_LOG_WATCHER "log"
+
+struct ebt_log_info
+{
+ uint8_t loglevel;
+ uint8_t prefix[EBT_LOG_PREFIX_SIZE];
+ uint32_t bitmask;
+};
+
+#endif
diff --git a/sysroot/usr/include/linux/netfilter_bridge/ebt_mark_m.h b/sysroot/usr/include/linux/netfilter_bridge/ebt_mark_m.h
new file mode 100644
index 0000000..301524f
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_bridge/ebt_mark_m.h
@@ -0,0 +1,15 @@
+#ifndef __LINUX_BRIDGE_EBT_MARK_M_H
+#define __LINUX_BRIDGE_EBT_MARK_M_H
+
+#define EBT_MARK_AND 0x01
+#define EBT_MARK_OR 0x02
+#define EBT_MARK_MASK (EBT_MARK_AND | EBT_MARK_OR)
+struct ebt_mark_m_info
+{
+ unsigned long mark, mask;
+ uint8_t invert;
+ uint8_t bitmask;
+};
+#define EBT_MARK_MATCH "mark_m"
+
+#endif
diff --git a/sysroot/usr/include/linux/netfilter_bridge/ebt_mark_t.h b/sysroot/usr/include/linux/netfilter_bridge/ebt_mark_t.h
new file mode 100644
index 0000000..6270f6f
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_bridge/ebt_mark_t.h
@@ -0,0 +1,24 @@
+#ifndef __LINUX_BRIDGE_EBT_MARK_T_H
+#define __LINUX_BRIDGE_EBT_MARK_T_H
+
+/* The target member is reused for adding new actions, the
+ * value of the real target is -1 to -NUM_STANDARD_TARGETS.
+ * For backward compatibility, the 4 lsb (2 would be enough,
+ * but let's play it safe) are kept to designate this target.
+ * The remaining bits designate the action. By making the set
+ * action 0xfffffff0, the result will look ok for older
+ * versions. [September 2006] */
+#define MARK_SET_VALUE (0xfffffff0)
+#define MARK_OR_VALUE (0xffffffe0)
+#define MARK_AND_VALUE (0xffffffd0)
+#define MARK_XOR_VALUE (0xffffffc0)
+
+struct ebt_mark_t_info
+{
+ unsigned long mark;
+ /* EBT_ACCEPT, EBT_DROP, EBT_CONTINUE or EBT_RETURN */
+ int target;
+};
+#define EBT_MARK_TARGET "mark"
+
+#endif
diff --git a/sysroot/usr/include/linux/netfilter_bridge/ebt_nat.h b/sysroot/usr/include/linux/netfilter_bridge/ebt_nat.h
new file mode 100644
index 0000000..435b886
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_bridge/ebt_nat.h
@@ -0,0 +1,14 @@
+#ifndef __LINUX_BRIDGE_EBT_NAT_H
+#define __LINUX_BRIDGE_EBT_NAT_H
+
+#define NAT_ARP_BIT (0x00000010)
+struct ebt_nat_info
+{
+ unsigned char mac[ETH_ALEN];
+ /* EBT_ACCEPT, EBT_DROP, EBT_CONTINUE or EBT_RETURN */
+ int target;
+};
+#define EBT_SNAT_TARGET "snat"
+#define EBT_DNAT_TARGET "dnat"
+
+#endif
diff --git a/sysroot/usr/include/linux/netfilter_bridge/ebt_pkttype.h b/sysroot/usr/include/linux/netfilter_bridge/ebt_pkttype.h
new file mode 100644
index 0000000..0d64bbb
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_bridge/ebt_pkttype.h
@@ -0,0 +1,11 @@
+#ifndef __LINUX_BRIDGE_EBT_PKTTYPE_H
+#define __LINUX_BRIDGE_EBT_PKTTYPE_H
+
+struct ebt_pkttype_info
+{
+ uint8_t pkt_type;
+ uint8_t invert;
+};
+#define EBT_PKTTYPE_MATCH "pkttype"
+
+#endif
diff --git a/sysroot/usr/include/linux/netfilter_bridge/ebt_redirect.h b/sysroot/usr/include/linux/netfilter_bridge/ebt_redirect.h
new file mode 100644
index 0000000..5c67990
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_bridge/ebt_redirect.h
@@ -0,0 +1,11 @@
+#ifndef __LINUX_BRIDGE_EBT_REDIRECT_H
+#define __LINUX_BRIDGE_EBT_REDIRECT_H
+
+struct ebt_redirect_info
+{
+ /* EBT_ACCEPT, EBT_DROP, EBT_CONTINUE or EBT_RETURN */
+ int target;
+};
+#define EBT_REDIRECT_TARGET "redirect"
+
+#endif
diff --git a/sysroot/usr/include/linux/netfilter_bridge/ebt_stp.h b/sysroot/usr/include/linux/netfilter_bridge/ebt_stp.h
new file mode 100644
index 0000000..e5fd678
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_bridge/ebt_stp.h
@@ -0,0 +1,46 @@
+#ifndef __LINUX_BRIDGE_EBT_STP_H
+#define __LINUX_BRIDGE_EBT_STP_H
+
+#define EBT_STP_TYPE 0x0001
+
+#define EBT_STP_FLAGS 0x0002
+#define EBT_STP_ROOTPRIO 0x0004
+#define EBT_STP_ROOTADDR 0x0008
+#define EBT_STP_ROOTCOST 0x0010
+#define EBT_STP_SENDERPRIO 0x0020
+#define EBT_STP_SENDERADDR 0x0040
+#define EBT_STP_PORT 0x0080
+#define EBT_STP_MSGAGE 0x0100
+#define EBT_STP_MAXAGE 0x0200
+#define EBT_STP_HELLOTIME 0x0400
+#define EBT_STP_FWDD 0x0800
+
+#define EBT_STP_MASK 0x0fff
+#define EBT_STP_CONFIG_MASK 0x0ffe
+
+#define EBT_STP_MATCH "stp"
+
+struct ebt_stp_config_info
+{
+ uint8_t flags;
+ uint16_t root_priol, root_priou;
+ char root_addr[6], root_addrmsk[6];
+ uint32_t root_costl, root_costu;
+ uint16_t sender_priol, sender_priou;
+ char sender_addr[6], sender_addrmsk[6];
+ uint16_t portl, portu;
+ uint16_t msg_agel, msg_ageu;
+ uint16_t max_agel, max_ageu;
+ uint16_t hello_timel, hello_timeu;
+ uint16_t forward_delayl, forward_delayu;
+};
+
+struct ebt_stp_info
+{
+ uint8_t type;
+ struct ebt_stp_config_info config;
+ uint16_t bitmask;
+ uint16_t invflags;
+};
+
+#endif
diff --git a/sysroot/usr/include/linux/netfilter_bridge/ebt_ulog.h b/sysroot/usr/include/linux/netfilter_bridge/ebt_ulog.h
new file mode 100644
index 0000000..b677e26
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_bridge/ebt_ulog.h
@@ -0,0 +1,36 @@
+#ifndef _EBT_ULOG_H
+#define _EBT_ULOG_H
+
+#define EBT_ULOG_DEFAULT_NLGROUP 0
+#define EBT_ULOG_DEFAULT_QTHRESHOLD 1
+#define EBT_ULOG_MAXNLGROUPS 32 /* hardcoded netlink max */
+#define EBT_ULOG_PREFIX_LEN 32
+#define EBT_ULOG_MAX_QLEN 50
+#define EBT_ULOG_WATCHER "ulog"
+#define EBT_ULOG_VERSION 1
+
+struct ebt_ulog_info {
+ uint32_t nlgroup;
+ unsigned int cprange;
+ unsigned int qthreshold;
+ char prefix[EBT_ULOG_PREFIX_LEN];
+};
+
+typedef struct ebt_ulog_packet_msg {
+ int version;
+ char indev[IFNAMSIZ];
+ char outdev[IFNAMSIZ];
+ char physindev[IFNAMSIZ];
+ char physoutdev[IFNAMSIZ];
+ char prefix[EBT_ULOG_PREFIX_LEN];
+ struct timeval stamp;
+ unsigned long mark;
+ unsigned int hook;
+ size_t data_len;
+ /* The complete packet, including Ethernet header and perhaps
+ * the VLAN header is appended */
+ unsigned char data[0] __attribute__
+ ((aligned (__alignof__(struct ebt_ulog_info))));
+} ebt_ulog_packet_msg_t;
+
+#endif /* _EBT_ULOG_H */
diff --git a/sysroot/usr/include/linux/netfilter_bridge/ebt_vlan.h b/sysroot/usr/include/linux/netfilter_bridge/ebt_vlan.h
new file mode 100644
index 0000000..1d98be4
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_bridge/ebt_vlan.h
@@ -0,0 +1,20 @@
+#ifndef __LINUX_BRIDGE_EBT_VLAN_H
+#define __LINUX_BRIDGE_EBT_VLAN_H
+
+#define EBT_VLAN_ID 0x01
+#define EBT_VLAN_PRIO 0x02
+#define EBT_VLAN_ENCAP 0x04
+#define EBT_VLAN_MASK (EBT_VLAN_ID | EBT_VLAN_PRIO | EBT_VLAN_ENCAP)
+#define EBT_VLAN_MATCH "vlan"
+
+struct ebt_vlan_info {
+ uint16_t id; /* VLAN ID {1-4095} */
+ uint8_t prio; /* VLAN User Priority {0-7} */
+ __be16 encap; /* VLAN Encapsulated frame code {0-65535} */
+ uint8_t bitmask; /* Args bitmask bit 1=1 - ID arg,
+ bit 2=1 User-Priority arg, bit 3=1 encap*/
+ uint8_t invflags; /* Inverse bitmask bit 1=1 - inversed ID arg,
+ bit 2=1 - inversed Pirority arg */
+};
+
+#endif
diff --git a/sysroot/usr/include/linux/netfilter_bridge/ebtables.h b/sysroot/usr/include/linux/netfilter_bridge/ebtables.h
new file mode 100644
index 0000000..7125cb9
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_bridge/ebtables.h
@@ -0,0 +1,272 @@
+/*
+ * ebtables
+ *
+ * Authors:
+ * Bart De Schuymer <bdschuym@pandora.be>
+ *
+ * ebtables.c,v 2.0, April, 2002
+ *
+ * This code is stongly inspired on the iptables code which is
+ * Copyright (C) 1999 Paul `Rusty' Russell & Michael J. Neuling
+ */
+
+#ifndef __LINUX_BRIDGE_EFF_H
+#define __LINUX_BRIDGE_EFF_H
+#include <linux/if.h>
+#include <linux/netfilter_bridge.h>
+#include <linux/if_ether.h>
+
+#define EBT_TABLE_MAXNAMELEN 32
+#define EBT_CHAIN_MAXNAMELEN EBT_TABLE_MAXNAMELEN
+#define EBT_FUNCTION_MAXNAMELEN EBT_TABLE_MAXNAMELEN
+
+/* verdicts >0 are "branches" */
+#define EBT_ACCEPT -1
+#define EBT_DROP -2
+#define EBT_CONTINUE -3
+#define EBT_RETURN -4
+#define NUM_STANDARD_TARGETS 4
+/* ebtables target modules store the verdict inside an int. We can
+ * reclaim a part of this int for backwards compatible extensions.
+ * The 4 lsb are more than enough to store the verdict. */
+#define EBT_VERDICT_BITS 0x0000000F
+
+struct ebt_counter
+{
+ uint64_t pcnt;
+ uint64_t bcnt;
+};
+
+struct ebt_replace
+{
+ char name[EBT_TABLE_MAXNAMELEN];
+ unsigned int valid_hooks;
+ /* nr of rules in the table */
+ unsigned int nentries;
+ /* total size of the entries */
+ unsigned int entries_size;
+ /* start of the chains */
+ struct ebt_entries *hook_entry[NF_BR_NUMHOOKS];
+ /* nr of counters userspace expects back */
+ unsigned int num_counters;
+ /* where the kernel will put the old counters */
+ struct ebt_counter *counters;
+ char *entries;
+};
+
+struct ebt_replace_kernel
+{
+ char name[EBT_TABLE_MAXNAMELEN];
+ unsigned int valid_hooks;
+ /* nr of rules in the table */
+ unsigned int nentries;
+ /* total size of the entries */
+ unsigned int entries_size;
+ /* start of the chains */
+ struct ebt_entries *hook_entry[NF_BR_NUMHOOKS];
+ /* nr of counters userspace expects back */
+ unsigned int num_counters;
+ /* where the kernel will put the old counters */
+ struct ebt_counter *counters;
+ char *entries;
+};
+
+struct ebt_entries {
+ /* this field is always set to zero
+ * See EBT_ENTRY_OR_ENTRIES.
+ * Must be same size as ebt_entry.bitmask */
+ unsigned int distinguisher;
+ /* the chain name */
+ char name[EBT_CHAIN_MAXNAMELEN];
+ /* counter offset for this chain */
+ unsigned int counter_offset;
+ /* one standard (accept, drop, return) per hook */
+ int policy;
+ /* nr. of entries */
+ unsigned int nentries;
+ /* entry list */
+ char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
+};
+
+/* used for the bitmask of struct ebt_entry */
+
+/* This is a hack to make a difference between an ebt_entry struct and an
+ * ebt_entries struct when traversing the entries from start to end.
+ * Using this simplifies the code alot, while still being able to use
+ * ebt_entries.
+ * Contrary, iptables doesn't use something like ebt_entries and therefore uses
+ * different techniques for naming the policy and such. So, iptables doesn't
+ * need a hack like this.
+ */
+#define EBT_ENTRY_OR_ENTRIES 0x01
+/* these are the normal masks */
+#define EBT_NOPROTO 0x02
+#define EBT_802_3 0x04
+#define EBT_SOURCEMAC 0x08
+#define EBT_DESTMAC 0x10
+#define EBT_F_MASK (EBT_NOPROTO | EBT_802_3 | EBT_SOURCEMAC | EBT_DESTMAC \
+ | EBT_ENTRY_OR_ENTRIES)
+
+#define EBT_IPROTO 0x01
+#define EBT_IIN 0x02
+#define EBT_IOUT 0x04
+#define EBT_ISOURCE 0x8
+#define EBT_IDEST 0x10
+#define EBT_ILOGICALIN 0x20
+#define EBT_ILOGICALOUT 0x40
+#define EBT_INV_MASK (EBT_IPROTO | EBT_IIN | EBT_IOUT | EBT_ILOGICALIN \
+ | EBT_ILOGICALOUT | EBT_ISOURCE | EBT_IDEST)
+
+struct ebt_entry_match
+{
+ union {
+ char name[EBT_FUNCTION_MAXNAMELEN];
+ struct ebt_match *match;
+ } u;
+ /* size of data */
+ unsigned int match_size;
+ unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
+};
+
+struct ebt_entry_watcher
+{
+ union {
+ char name[EBT_FUNCTION_MAXNAMELEN];
+ struct ebt_watcher *watcher;
+ } u;
+ /* size of data */
+ unsigned int watcher_size;
+ unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
+};
+
+struct ebt_entry_target
+{
+ union {
+ char name[EBT_FUNCTION_MAXNAMELEN];
+ struct ebt_target *target;
+ } u;
+ /* size of data */
+ unsigned int target_size;
+ unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
+};
+
+#define EBT_STANDARD_TARGET "standard"
+struct ebt_standard_target
+{
+ struct ebt_entry_target target;
+ int verdict;
+};
+
+/* one entry */
+struct ebt_entry {
+ /* this needs to be the first field */
+ unsigned int bitmask;
+ unsigned int invflags;
+ __be16 ethproto;
+ /* the physical in-dev */
+ char in[IFNAMSIZ];
+ /* the logical in-dev */
+ char logical_in[IFNAMSIZ];
+ /* the physical out-dev */
+ char out[IFNAMSIZ];
+ /* the logical out-dev */
+ char logical_out[IFNAMSIZ];
+ unsigned char sourcemac[ETH_ALEN];
+ unsigned char sourcemsk[ETH_ALEN];
+ unsigned char destmac[ETH_ALEN];
+ unsigned char destmsk[ETH_ALEN];
+ /* sizeof ebt_entry + matches */
+ unsigned int watchers_offset;
+ /* sizeof ebt_entry + matches + watchers */
+ unsigned int target_offset;
+ /* sizeof ebt_entry + matches + watchers + target */
+ unsigned int next_offset;
+ unsigned char elems[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
+};
+
+/* {g,s}etsockopt numbers */
+#define EBT_BASE_CTL 128
+
+#define EBT_SO_SET_ENTRIES (EBT_BASE_CTL)
+#define EBT_SO_SET_COUNTERS (EBT_SO_SET_ENTRIES+1)
+#define EBT_SO_SET_MAX (EBT_SO_SET_COUNTERS+1)
+
+#define EBT_SO_GET_INFO (EBT_BASE_CTL)
+#define EBT_SO_GET_ENTRIES (EBT_SO_GET_INFO+1)
+#define EBT_SO_GET_INIT_INFO (EBT_SO_GET_ENTRIES+1)
+#define EBT_SO_GET_INIT_ENTRIES (EBT_SO_GET_INIT_INFO+1)
+#define EBT_SO_GET_MAX (EBT_SO_GET_INIT_ENTRIES+1)
+
+
+/* blatently stolen from ip_tables.h
+ * fn returns 0 to continue iteration */
+#define EBT_MATCH_ITERATE(e, fn, args...) \
+({ \
+ unsigned int __i; \
+ int __ret = 0; \
+ struct ebt_entry_match *__match; \
+ \
+ for (__i = sizeof(struct ebt_entry); \
+ __i < (e)->watchers_offset; \
+ __i += __match->match_size + \
+ sizeof(struct ebt_entry_match)) { \
+ __match = (void *)(e) + __i; \
+ \
+ __ret = fn(__match , ## args); \
+ if (__ret != 0) \
+ break; \
+ } \
+ if (__ret == 0) { \
+ if (__i != (e)->watchers_offset) \
+ __ret = -EINVAL; \
+ } \
+ __ret; \
+})
+
+#define EBT_WATCHER_ITERATE(e, fn, args...) \
+({ \
+ unsigned int __i; \
+ int __ret = 0; \
+ struct ebt_entry_watcher *__watcher; \
+ \
+ for (__i = e->watchers_offset; \
+ __i < (e)->target_offset; \
+ __i += __watcher->watcher_size + \
+ sizeof(struct ebt_entry_watcher)) { \
+ __watcher = (void *)(e) + __i; \
+ \
+ __ret = fn(__watcher , ## args); \
+ if (__ret != 0) \
+ break; \
+ } \
+ if (__ret == 0) { \
+ if (__i != (e)->target_offset) \
+ __ret = -EINVAL; \
+ } \
+ __ret; \
+})
+
+#define EBT_ENTRY_ITERATE(entries, size, fn, args...) \
+({ \
+ unsigned int __i; \
+ int __ret = 0; \
+ struct ebt_entry *__entry; \
+ \
+ for (__i = 0; __i < (size);) { \
+ __entry = (void *)(entries) + __i; \
+ __ret = fn(__entry , ## args); \
+ if (__ret != 0) \
+ break; \
+ if (__entry->bitmask != 0) \
+ __i += __entry->next_offset; \
+ else \
+ __i += sizeof(struct ebt_entries); \
+ } \
+ if (__ret == 0) { \
+ if (__i != (size)) \
+ __ret = -EINVAL; \
+ } \
+ __ret; \
+})
+
+#endif
diff --git a/sysroot/usr/include/linux/netfilter_decnet.h b/sysroot/usr/include/linux/netfilter_decnet.h
new file mode 100644
index 0000000..ca70c6c
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_decnet.h
@@ -0,0 +1,72 @@
+#ifndef __LINUX_DECNET_NETFILTER_H
+#define __LINUX_DECNET_NETFILTER_H
+
+/* DECnet-specific defines for netfilter.
+ * This file (C) Steve Whitehouse 1999 derived from the
+ * ipv4 netfilter header file which is
+ * (C)1998 Rusty Russell -- This code is GPL.
+ */
+
+#include <linux/netfilter.h>
+
+/* only for userspace compatibility */
+/* IP Cache bits. */
+/* Src IP address. */
+#define NFC_DN_SRC 0x0001
+/* Dest IP address. */
+#define NFC_DN_DST 0x0002
+/* Input device. */
+#define NFC_DN_IF_IN 0x0004
+/* Output device. */
+#define NFC_DN_IF_OUT 0x0008
+
+/* DECnet Hooks */
+/* After promisc drops, checksum checks. */
+#define NF_DN_PRE_ROUTING 0
+/* If the packet is destined for this box. */
+#define NF_DN_LOCAL_IN 1
+/* If the packet is destined for another interface. */
+#define NF_DN_FORWARD 2
+/* Packets coming from a local process. */
+#define NF_DN_LOCAL_OUT 3
+/* Packets about to hit the wire. */
+#define NF_DN_POST_ROUTING 4
+/* Input Hello Packets */
+#define NF_DN_HELLO 5
+/* Input Routing Packets */
+#define NF_DN_ROUTE 6
+#define NF_DN_NUMHOOKS 7
+
+enum nf_dn_hook_priorities {
+ NF_DN_PRI_FIRST = INT_MIN,
+ NF_DN_PRI_CONNTRACK = -200,
+ NF_DN_PRI_MANGLE = -150,
+ NF_DN_PRI_NAT_DST = -100,
+ NF_DN_PRI_FILTER = 0,
+ NF_DN_PRI_NAT_SRC = 100,
+ NF_DN_PRI_DNRTMSG = 200,
+ NF_DN_PRI_LAST = INT_MAX,
+};
+
+struct nf_dn_rtmsg {
+ int nfdn_ifindex;
+};
+
+#define NFDN_RTMSG(r) ((unsigned char *)(r) + NLMSG_ALIGN(sizeof(struct nf_dn_rtmsg)))
+
+/* backwards compatibility for userspace */
+#define DNRMG_L1_GROUP 0x01
+#define DNRMG_L2_GROUP 0x02
+
+enum {
+ DNRNG_NLGRP_NONE,
+#define DNRNG_NLGRP_NONE DNRNG_NLGRP_NONE
+ DNRNG_NLGRP_L1,
+#define DNRNG_NLGRP_L1 DNRNG_NLGRP_L1
+ DNRNG_NLGRP_L2,
+#define DNRNG_NLGRP_L2 DNRNG_NLGRP_L2
+ __DNRNG_NLGRP_MAX
+};
+#define DNRNG_NLGRP_MAX (__DNRNG_NLGRP_MAX - 1)
+
+#endif /*__LINUX_DECNET_NETFILTER_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv4.h b/sysroot/usr/include/linux/netfilter_ipv4.h
new file mode 100644
index 0000000..791e50e
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4.h
@@ -0,0 +1,76 @@
+#ifndef __LINUX_IP_NETFILTER_H
+#define __LINUX_IP_NETFILTER_H
+
+/* IPv4-specific defines for netfilter.
+ * (C)1998 Rusty Russell -- This code is GPL.
+ */
+
+#include <linux/netfilter.h>
+
+/* only for userspace compatibility */
+/* IP Cache bits. */
+/* Src IP address. */
+#define NFC_IP_SRC 0x0001
+/* Dest IP address. */
+#define NFC_IP_DST 0x0002
+/* Input device. */
+#define NFC_IP_IF_IN 0x0004
+/* Output device. */
+#define NFC_IP_IF_OUT 0x0008
+/* TOS. */
+#define NFC_IP_TOS 0x0010
+/* Protocol. */
+#define NFC_IP_PROTO 0x0020
+/* IP options. */
+#define NFC_IP_OPTIONS 0x0040
+/* Frag & flags. */
+#define NFC_IP_FRAG 0x0080
+
+/* Per-protocol information: only matters if proto match. */
+/* TCP flags. */
+#define NFC_IP_TCPFLAGS 0x0100
+/* Source port. */
+#define NFC_IP_SRC_PT 0x0200
+/* Dest port. */
+#define NFC_IP_DST_PT 0x0400
+/* Something else about the proto */
+#define NFC_IP_PROTO_UNKNOWN 0x2000
+
+/* IP Hooks */
+/* After promisc drops, checksum checks. */
+#define NF_IP_PRE_ROUTING 0
+/* If the packet is destined for this box. */
+#define NF_IP_LOCAL_IN 1
+/* If the packet is destined for another interface. */
+#define NF_IP_FORWARD 2
+/* Packets coming from a local process. */
+#define NF_IP_LOCAL_OUT 3
+/* Packets about to hit the wire. */
+#define NF_IP_POST_ROUTING 4
+#define NF_IP_NUMHOOKS 5
+
+enum nf_ip_hook_priorities {
+ NF_IP_PRI_FIRST = INT_MIN,
+ NF_IP_PRI_CONNTRACK_DEFRAG = -400,
+ NF_IP_PRI_RAW = -300,
+ NF_IP_PRI_SELINUX_FIRST = -225,
+ NF_IP_PRI_CONNTRACK = -200,
+ NF_IP_PRI_MANGLE = -150,
+ NF_IP_PRI_NAT_DST = -100,
+ NF_IP_PRI_FILTER = 0,
+ NF_IP_PRI_NAT_SRC = 100,
+ NF_IP_PRI_SELINUX_LAST = 225,
+ NF_IP_PRI_CONNTRACK_HELPER = INT_MAX - 2,
+ NF_IP_PRI_NAT_SEQ_ADJUST = INT_MAX - 1,
+ NF_IP_PRI_CONNTRACK_CONFIRM = INT_MAX,
+ NF_IP_PRI_LAST = INT_MAX,
+};
+
+/* Arguments for setsockopt SOL_IP: */
+/* 2.0 firewalling went from 64 through 71 (and +256, +512, etc). */
+/* 2.2 firewalling (+ masq) went from 64 through 76 */
+/* 2.4 firewalling went 64 through 67. */
+#define SO_ORIGINAL_DST 80
+
+
+#endif /*__LINUX_IP_NETFILTER_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ip_queue.h b/sysroot/usr/include/linux/netfilter_ipv4/ip_queue.h
new file mode 100644
index 0000000..f5229b1
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ip_queue.h
@@ -0,0 +1,64 @@
+/*
+ * This is a module which is used for queueing IPv4 packets and
+ * communicating with userspace via netlink.
+ *
+ * (C) 2000 James Morris, this code is GPL.
+ */
+#ifndef _IP_QUEUE_H
+#define _IP_QUEUE_H
+
+#include <net/if.h>
+
+/* Messages sent from kernel */
+typedef struct ipq_packet_msg {
+ unsigned long packet_id; /* ID of queued packet */
+ unsigned long mark; /* Netfilter mark value */
+ long timestamp_sec; /* Packet arrival time (seconds) */
+ long timestamp_usec; /* Packet arrvial time (+useconds) */
+ unsigned int hook; /* Netfilter hook we rode in on */
+ char indev_name[IFNAMSIZ]; /* Name of incoming interface */
+ char outdev_name[IFNAMSIZ]; /* Name of outgoing interface */
+ __be16 hw_protocol; /* Hardware protocol (network order) */
+ unsigned short hw_type; /* Hardware type */
+ unsigned char hw_addrlen; /* Hardware address length */
+ unsigned char hw_addr[8]; /* Hardware address */
+ size_t data_len; /* Length of packet data */
+ unsigned char payload[0]; /* Optional packet data */
+} ipq_packet_msg_t;
+
+/* Messages sent from userspace */
+typedef struct ipq_mode_msg {
+ unsigned char value; /* Requested mode */
+ size_t range; /* Optional range of packet requested */
+} ipq_mode_msg_t;
+
+typedef struct ipq_verdict_msg {
+ unsigned int value; /* Verdict to hand to netfilter */
+ unsigned long id; /* Packet ID for this verdict */
+ size_t data_len; /* Length of replacement data */
+ unsigned char payload[0]; /* Optional replacement packet */
+} ipq_verdict_msg_t;
+
+typedef struct ipq_peer_msg {
+ union {
+ ipq_verdict_msg_t verdict;
+ ipq_mode_msg_t mode;
+ } msg;
+} ipq_peer_msg_t;
+
+/* Packet delivery modes */
+enum {
+ IPQ_COPY_NONE, /* Initial mode, packets are dropped */
+ IPQ_COPY_META, /* Copy metadata */
+ IPQ_COPY_PACKET /* Copy metadata + packet (range) */
+};
+#define IPQ_COPY_MAX IPQ_COPY_PACKET
+
+/* Types of messages */
+#define IPQM_BASE 0x10 /* standard netlink messages below this */
+#define IPQM_MODE (IPQM_BASE + 1) /* Mode request from peer */
+#define IPQM_VERDICT (IPQM_BASE + 2) /* Verdict from peer */
+#define IPQM_PACKET (IPQM_BASE + 3) /* Packet from kernel */
+#define IPQM_MAX (IPQM_BASE + 4)
+
+#endif /*_IP_QUEUE_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ip_tables.h b/sysroot/usr/include/linux/netfilter_ipv4/ip_tables.h
new file mode 100644
index 0000000..b836233
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ip_tables.h
@@ -0,0 +1,282 @@
+/*
+ * 25-Jul-1998 Major changes to allow for ip chain table
+ *
+ * 3-Jan-2000 Named tables to allow packet selection for different uses.
+ */
+
+/*
+ * Format of an IP firewall descriptor
+ *
+ * src, dst, src_mask, dst_mask are always stored in network byte order.
+ * flags are stored in host byte order (of course).
+ * Port numbers are stored in HOST byte order.
+ */
+
+#ifndef _IPTABLES_H
+#define _IPTABLES_H
+
+#include <linux/netfilter_ipv4.h>
+
+#include <linux/netfilter/x_tables.h>
+
+#define IPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
+#define IPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN
+#define ipt_match xt_match
+#define ipt_target xt_target
+#define ipt_table xt_table
+#define ipt_get_revision xt_get_revision
+
+/* Yes, Virginia, you have to zero the padding. */
+struct ipt_ip {
+ /* Source and destination IP addr */
+ struct in_addr src, dst;
+ /* Mask for src and dest IP addr */
+ struct in_addr smsk, dmsk;
+ char iniface[IFNAMSIZ], outiface[IFNAMSIZ];
+ unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ];
+
+ /* Protocol, 0 = ANY */
+ u_int16_t proto;
+
+ /* Flags word */
+ u_int8_t flags;
+ /* Inverse flags */
+ u_int8_t invflags;
+};
+
+#define ipt_entry_match xt_entry_match
+#define ipt_entry_target xt_entry_target
+#define ipt_standard_target xt_standard_target
+
+#define ipt_counters xt_counters
+
+/* Values for "flag" field in struct ipt_ip (general ip structure). */
+#define IPT_F_FRAG 0x01 /* Set if rule is a fragment rule */
+#define IPT_F_GOTO 0x02 /* Set if jump is a goto */
+#define IPT_F_MASK 0x03 /* All possible flag bits mask. */
+
+/* Values for "inv" field in struct ipt_ip. */
+#define IPT_INV_VIA_IN 0x01 /* Invert the sense of IN IFACE. */
+#define IPT_INV_VIA_OUT 0x02 /* Invert the sense of OUT IFACE */
+#define IPT_INV_TOS 0x04 /* Invert the sense of TOS. */
+#define IPT_INV_SRCIP 0x08 /* Invert the sense of SRC IP. */
+#define IPT_INV_DSTIP 0x10 /* Invert the sense of DST OP. */
+#define IPT_INV_FRAG 0x20 /* Invert the sense of FRAG. */
+#define IPT_INV_PROTO XT_INV_PROTO
+#define IPT_INV_MASK 0x7F /* All possible flag bits mask. */
+
+/* This structure defines each of the firewall rules. Consists of 3
+ parts which are 1) general IP header stuff 2) match specific
+ stuff 3) the target to perform if the rule matches */
+struct ipt_entry
+{
+ struct ipt_ip ip;
+
+ /* Mark with fields that we care about. */
+ unsigned int nfcache;
+
+ /* Size of ipt_entry + matches */
+ u_int16_t target_offset;
+ /* Size of ipt_entry + matches + target */
+ u_int16_t next_offset;
+
+ /* Back pointer */
+ unsigned int comefrom;
+
+ /* Packet and byte counters. */
+ struct xt_counters counters;
+
+ /* The matches (if any), then the target. */
+ unsigned char elems[0];
+};
+
+/*
+ * New IP firewall options for [gs]etsockopt at the RAW IP level.
+ * Unlike BSD Linux inherits IP options so you don't have to use a raw
+ * socket for this. Instead we check rights in the calls.
+ *
+ * ATTENTION: check linux/in.h before adding new number here.
+ */
+#define IPT_BASE_CTL 64
+
+#define IPT_SO_SET_REPLACE (IPT_BASE_CTL)
+#define IPT_SO_SET_ADD_COUNTERS (IPT_BASE_CTL + 1)
+#define IPT_SO_SET_MAX IPT_SO_SET_ADD_COUNTERS
+
+#define IPT_SO_GET_INFO (IPT_BASE_CTL)
+#define IPT_SO_GET_ENTRIES (IPT_BASE_CTL + 1)
+#define IPT_SO_GET_REVISION_MATCH (IPT_BASE_CTL + 2)
+#define IPT_SO_GET_REVISION_TARGET (IPT_BASE_CTL + 3)
+#define IPT_SO_GET_MAX IPT_SO_GET_REVISION_TARGET
+
+#define IPT_CONTINUE XT_CONTINUE
+#define IPT_RETURN XT_RETURN
+
+#include <linux/netfilter/xt_tcpudp.h>
+#define ipt_udp xt_udp
+#define ipt_tcp xt_tcp
+
+#define IPT_TCP_INV_SRCPT XT_TCP_INV_SRCPT
+#define IPT_TCP_INV_DSTPT XT_TCP_INV_DSTPT
+#define IPT_TCP_INV_FLAGS XT_TCP_INV_FLAGS
+#define IPT_TCP_INV_OPTION XT_TCP_INV_OPTION
+#define IPT_TCP_INV_MASK XT_TCP_INV_MASK
+
+#define IPT_UDP_INV_SRCPT XT_UDP_INV_SRCPT
+#define IPT_UDP_INV_DSTPT XT_UDP_INV_DSTPT
+#define IPT_UDP_INV_MASK XT_UDP_INV_MASK
+
+/* ICMP matching stuff */
+struct ipt_icmp
+{
+ u_int8_t type; /* type to match */
+ u_int8_t code[2]; /* range of code */
+ u_int8_t invflags; /* Inverse flags */
+};
+
+/* Values for "inv" field for struct ipt_icmp. */
+#define IPT_ICMP_INV 0x01 /* Invert the sense of type/code test */
+
+/* The argument to IPT_SO_GET_INFO */
+struct ipt_getinfo
+{
+ /* Which table: caller fills this in. */
+ char name[IPT_TABLE_MAXNAMELEN];
+
+ /* Kernel fills these in. */
+ /* Which hook entry points are valid: bitmask */
+ unsigned int valid_hooks;
+
+ /* Hook entry points: one per netfilter hook. */
+ unsigned int hook_entry[NF_IP_NUMHOOKS];
+
+ /* Underflow points. */
+ unsigned int underflow[NF_IP_NUMHOOKS];
+
+ /* Number of entries */
+ unsigned int num_entries;
+
+ /* Size of entries. */
+ unsigned int size;
+};
+
+/* The argument to IPT_SO_SET_REPLACE. */
+struct ipt_replace
+{
+ /* Which table. */
+ char name[IPT_TABLE_MAXNAMELEN];
+
+ /* Which hook entry points are valid: bitmask. You can't
+ change this. */
+ unsigned int valid_hooks;
+
+ /* Number of entries */
+ unsigned int num_entries;
+
+ /* Total size of new entries */
+ unsigned int size;
+
+ /* Hook entry points. */
+ unsigned int hook_entry[NF_IP_NUMHOOKS];
+
+ /* Underflow points. */
+ unsigned int underflow[NF_IP_NUMHOOKS];
+
+ /* Information about old entries: */
+ /* Number of counters (must be equal to current number of entries). */
+ unsigned int num_counters;
+ /* The old entries' counters. */
+ struct xt_counters *counters;
+
+ /* The entries (hang off end: not really an array). */
+ struct ipt_entry entries[0];
+};
+
+/* The argument to IPT_SO_ADD_COUNTERS. */
+#define ipt_counters_info xt_counters_info
+
+/* The argument to IPT_SO_GET_ENTRIES. */
+struct ipt_get_entries
+{
+ /* Which table: user fills this in. */
+ char name[IPT_TABLE_MAXNAMELEN];
+
+ /* User fills this in: total entry size. */
+ unsigned int size;
+
+ /* The entries. */
+ struct ipt_entry entrytable[0];
+};
+
+/* Standard return verdict, or do jump. */
+#define IPT_STANDARD_TARGET XT_STANDARD_TARGET
+/* Error verdict. */
+#define IPT_ERROR_TARGET XT_ERROR_TARGET
+
+/* Helper functions */
+static __inline__ struct ipt_entry_target *
+ipt_get_target(struct ipt_entry *e)
+{
+ return (void *)e + e->target_offset;
+}
+
+/* fn returns 0 to continue iteration */
+#define IPT_MATCH_ITERATE(e, fn, args...) \
+({ \
+ unsigned int __i; \
+ int __ret = 0; \
+ struct ipt_entry_match *__match; \
+ \
+ for (__i = sizeof(struct ipt_entry); \
+ __i < (e)->target_offset; \
+ __i += __match->u.match_size) { \
+ __match = (void *)(e) + __i; \
+ \
+ __ret = fn(__match , ## args); \
+ if (__ret != 0) \
+ break; \
+ } \
+ __ret; \
+})
+
+/* fn returns 0 to continue iteration */
+#define IPT_ENTRY_ITERATE(entries, size, fn, args...) \
+({ \
+ unsigned int __i; \
+ int __ret = 0; \
+ struct ipt_entry *__entry; \
+ \
+ for (__i = 0; __i < (size); __i += __entry->next_offset) { \
+ __entry = (void *)(entries) + __i; \
+ \
+ __ret = fn(__entry , ## args); \
+ if (__ret != 0) \
+ break; \
+ } \
+ __ret; \
+})
+
+/* fn returns 0 to continue iteration */
+#define IPT_ENTRY_ITERATE_CONTINUE(entries, size, n, fn, args...) \
+({ \
+ unsigned int __i, __n; \
+ int __ret = 0; \
+ struct ipt_entry *__entry; \
+ \
+ for (__i = 0, __n = 0; __i < (size); \
+ __i += __entry->next_offset, __n++) { \
+ __entry = (void *)(entries) + __i; \
+ if (__n < n) \
+ continue; \
+ \
+ __ret = fn(__entry , ## args); \
+ if (__ret != 0) \
+ break; \
+ } \
+ __ret; \
+})
+
+/*
+ * Main firewall chains definitions and global var's definitions.
+ */
+#endif /* _IPTABLES_H */
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_CLASSIFY.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_CLASSIFY.h
new file mode 100644
index 0000000..a46d511
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_CLASSIFY.h
@@ -0,0 +1,7 @@
+#ifndef _IPT_CLASSIFY_H
+#define _IPT_CLASSIFY_H
+
+#include <linux/netfilter/xt_CLASSIFY.h>
+#define ipt_classify_target_info xt_classify_target_info
+
+#endif /*_IPT_CLASSIFY_H */
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_CLUSTERIP.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_CLUSTERIP.h
new file mode 100644
index 0000000..daf50be
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_CLUSTERIP.h
@@ -0,0 +1,33 @@
+#ifndef _IPT_CLUSTERIP_H_target
+#define _IPT_CLUSTERIP_H_target
+
+enum clusterip_hashmode {
+ CLUSTERIP_HASHMODE_SIP = 0,
+ CLUSTERIP_HASHMODE_SIP_SPT,
+ CLUSTERIP_HASHMODE_SIP_SPT_DPT,
+};
+
+#define CLUSTERIP_HASHMODE_MAX CLUSTERIP_HASHMODE_SIP_SPT_DPT
+
+#define CLUSTERIP_MAX_NODES 16
+
+#define CLUSTERIP_FLAG_NEW 0x00000001
+
+struct clusterip_config;
+
+struct ipt_clusterip_tgt_info {
+
+ u_int32_t flags;
+
+ /* only relevant for new ones */
+ u_int8_t clustermac[6];
+ u_int16_t num_total_nodes;
+ u_int16_t num_local_nodes;
+ u_int16_t local_nodes[CLUSTERIP_MAX_NODES];
+ u_int32_t hash_mode;
+ u_int32_t hash_initval;
+
+ struct clusterip_config *config;
+};
+
+#endif /*_IPT_CLUSTERIP_H_target*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_CONNMARK.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_CONNMARK.h
new file mode 100644
index 0000000..9ecfee0
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_CONNMARK.h
@@ -0,0 +1,19 @@
+#ifndef _IPT_CONNMARK_H_target
+#define _IPT_CONNMARK_H_target
+
+/* Copyright (C) 2002,2004 MARA Systems AB <http://www.marasystems.com>
+ * by Henrik Nordstrom <hno@marasystems.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+#include <linux/netfilter/xt_CONNMARK.h>
+#define IPT_CONNMARK_SET XT_CONNMARK_SET
+#define IPT_CONNMARK_SAVE XT_CONNMARK_SAVE
+#define IPT_CONNMARK_RESTORE XT_CONNMARK_RESTORE
+
+#define ipt_connmark_target_info xt_connmark_target_info
+
+#endif /*_IPT_CONNMARK_H_target*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_DSCP.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_DSCP.h
new file mode 100644
index 0000000..3491e52
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_DSCP.h
@@ -0,0 +1,18 @@
+/* iptables module for setting the IPv4 DSCP field
+ *
+ * (C) 2002 Harald Welte <laforge@gnumonks.org>
+ * based on ipt_FTOS.c (C) 2000 by Matthew G. Marsh <mgm@paktronix.com>
+ * This software is distributed under GNU GPL v2, 1991
+ *
+ * See RFC2474 for a description of the DSCP field within the IP Header.
+ *
+ * ipt_DSCP.h,v 1.7 2002/03/14 12:03:13 laforge Exp
+*/
+#ifndef _IPT_DSCP_TARGET_H
+#define _IPT_DSCP_TARGET_H
+#include <linux/netfilter_ipv4/ipt_dscp.h>
+#include <linux/netfilter/xt_DSCP.h>
+
+#define ipt_DSCP_info xt_DSCP_info
+
+#endif /* _IPT_DSCP_TARGET_H */
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_ECN.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_ECN.h
new file mode 100644
index 0000000..94e0d98
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_ECN.h
@@ -0,0 +1,31 @@
+/* Header file for iptables ipt_ECN target
+ *
+ * (C) 2002 by Harald Welte <laforge@gnumonks.org>
+ *
+ * This software is distributed under GNU GPL v2, 1991
+ *
+ * ipt_ECN.h,v 1.3 2002/05/29 12:17:40 laforge Exp
+*/
+#ifndef _IPT_ECN_TARGET_H
+#define _IPT_ECN_TARGET_H
+#include <linux/netfilter_ipv4/ipt_DSCP.h>
+
+#define IPT_ECN_IP_MASK (~IPT_DSCP_MASK)
+
+#define IPT_ECN_OP_SET_IP 0x01 /* set ECN bits of IPv4 header */
+#define IPT_ECN_OP_SET_ECE 0x10 /* set ECE bit of TCP header */
+#define IPT_ECN_OP_SET_CWR 0x20 /* set CWR bit of TCP header */
+
+#define IPT_ECN_OP_MASK 0xce
+
+struct ipt_ECN_info {
+ u_int8_t operation; /* bitset of operations */
+ u_int8_t ip_ect; /* ECT codepoint of IPv4 header, pre-shifted */
+ union {
+ struct {
+ u_int8_t ece:1, cwr:1; /* TCP ECT bits */
+ } tcp;
+ } proto;
+};
+
+#endif /* _IPT_ECN_TARGET_H */
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_LOG.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_LOG.h
new file mode 100644
index 0000000..90fa652
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_LOG.h
@@ -0,0 +1,18 @@
+#ifndef _IPT_LOG_H
+#define _IPT_LOG_H
+
+/* make sure not to change this without changing netfilter.h:NF_LOG_* (!) */
+#define IPT_LOG_TCPSEQ 0x01 /* Log TCP sequence numbers */
+#define IPT_LOG_TCPOPT 0x02 /* Log TCP options */
+#define IPT_LOG_IPOPT 0x04 /* Log IP options */
+#define IPT_LOG_UID 0x08 /* Log UID owning local socket */
+#define IPT_LOG_NFLOG 0x10 /* Unsupported, don't reuse */
+#define IPT_LOG_MASK 0x1f
+
+struct ipt_log_info {
+ unsigned char level;
+ unsigned char logflags;
+ char prefix[30];
+};
+
+#endif /*_IPT_LOG_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_MARK.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_MARK.h
new file mode 100644
index 0000000..697a486
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_MARK.h
@@ -0,0 +1,18 @@
+#ifndef _IPT_MARK_H_target
+#define _IPT_MARK_H_target
+
+/* Backwards compatibility for old userspace */
+
+#include <linux/netfilter/xt_MARK.h>
+
+/* Version 0 */
+#define ipt_mark_target_info xt_mark_target_info
+
+/* Version 1 */
+#define IPT_MARK_SET XT_MARK_SET
+#define IPT_MARK_AND XT_MARK_AND
+#define IPT_MARK_OR XT_MARK_OR
+
+#define ipt_mark_target_info_v1 xt_mark_target_info_v1
+
+#endif /*_IPT_MARK_H_target*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_NFQUEUE.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_NFQUEUE.h
new file mode 100644
index 0000000..97a2a75
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_NFQUEUE.h
@@ -0,0 +1,16 @@
+/* iptables module for using NFQUEUE mechanism
+ *
+ * (C) 2005 Harald Welte <laforge@netfilter.org>
+ *
+ * This software is distributed under GNU GPL v2, 1991
+ *
+*/
+#ifndef _IPT_NFQ_TARGET_H
+#define _IPT_NFQ_TARGET_H
+
+/* Backwards compatibility for old userspace */
+#include <linux/netfilter/xt_NFQUEUE.h>
+
+#define ipt_NFQ_info xt_NFQ_info
+
+#endif /* _IPT_DSCP_TARGET_H */
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_REJECT.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_REJECT.h
new file mode 100644
index 0000000..4293a1a
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_REJECT.h
@@ -0,0 +1,20 @@
+#ifndef _IPT_REJECT_H
+#define _IPT_REJECT_H
+
+enum ipt_reject_with {
+ IPT_ICMP_NET_UNREACHABLE,
+ IPT_ICMP_HOST_UNREACHABLE,
+ IPT_ICMP_PROT_UNREACHABLE,
+ IPT_ICMP_PORT_UNREACHABLE,
+ IPT_ICMP_ECHOREPLY,
+ IPT_ICMP_NET_PROHIBITED,
+ IPT_ICMP_HOST_PROHIBITED,
+ IPT_TCP_RESET,
+ IPT_ICMP_ADMIN_PROHIBITED
+};
+
+struct ipt_reject_info {
+ enum ipt_reject_with with; /* reject type */
+};
+
+#endif /*_IPT_REJECT_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_SAME.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_SAME.h
new file mode 100644
index 0000000..be6e682
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_SAME.h
@@ -0,0 +1,19 @@
+#ifndef _IPT_SAME_H
+#define _IPT_SAME_H
+
+#define IPT_SAME_MAX_RANGE 10
+
+#define IPT_SAME_NODST 0x01
+
+struct ipt_same_info
+{
+ unsigned char info;
+ u_int32_t rangesize;
+ u_int32_t ipnum;
+ u_int32_t *iparray;
+
+ /* hangs off end. */
+ struct nf_nat_range range[IPT_SAME_MAX_RANGE];
+};
+
+#endif /*_IPT_SAME_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_TCPMSS.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_TCPMSS.h
new file mode 100644
index 0000000..7a850f9
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_TCPMSS.h
@@ -0,0 +1,9 @@
+#ifndef _IPT_TCPMSS_H
+#define _IPT_TCPMSS_H
+
+#include <linux/netfilter/xt_TCPMSS.h>
+
+#define ipt_tcpmss_info xt_tcpmss_info
+#define IPT_TCPMSS_CLAMP_PMTU XT_TCPMSS_CLAMP_PMTU
+
+#endif /*_IPT_TCPMSS_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_TOS.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_TOS.h
new file mode 100644
index 0000000..6bf9e1f
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_TOS.h
@@ -0,0 +1,12 @@
+#ifndef _IPT_TOS_H_target
+#define _IPT_TOS_H_target
+
+#ifndef IPTOS_NORMALSVC
+#define IPTOS_NORMALSVC 0
+#endif
+
+struct ipt_tos_target_info {
+ u_int8_t tos;
+};
+
+#endif /*_IPT_TOS_H_target*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_TTL.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_TTL.h
new file mode 100644
index 0000000..ee6611e
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_TTL.h
@@ -0,0 +1,21 @@
+/* TTL modification module for IP tables
+ * (C) 2000 by Harald Welte <laforge@netfilter.org> */
+
+#ifndef _IPT_TTL_H
+#define _IPT_TTL_H
+
+enum {
+ IPT_TTL_SET = 0,
+ IPT_TTL_INC,
+ IPT_TTL_DEC
+};
+
+#define IPT_TTL_MAXMODE IPT_TTL_DEC
+
+struct ipt_TTL_info {
+ u_int8_t mode;
+ u_int8_t ttl;
+};
+
+
+#endif
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_ULOG.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_ULOG.h
new file mode 100644
index 0000000..417aad2
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_ULOG.h
@@ -0,0 +1,49 @@
+/* Header file for IP tables userspace logging, Version 1.8
+ *
+ * (C) 2000-2002 by Harald Welte <laforge@gnumonks.org>
+ *
+ * Distributed under the terms of GNU GPL */
+
+#ifndef _IPT_ULOG_H
+#define _IPT_ULOG_H
+
+#ifndef NETLINK_NFLOG
+#define NETLINK_NFLOG 5
+#endif
+
+#define ULOG_DEFAULT_NLGROUP 1
+#define ULOG_DEFAULT_QTHRESHOLD 1
+
+#define ULOG_MAC_LEN 80
+#define ULOG_PREFIX_LEN 32
+
+#define ULOG_MAX_QLEN 50
+/* Why 50? Well... there is a limit imposed by the slab cache 131000
+ * bytes. So the multipart netlink-message has to be < 131000 bytes.
+ * Assuming a standard ethernet-mtu of 1500, we could define this up
+ * to 80... but even 50 seems to be big enough. */
+
+/* private data structure for each rule with a ULOG target */
+struct ipt_ulog_info {
+ unsigned int nl_group;
+ size_t copy_range;
+ size_t qthreshold;
+ char prefix[ULOG_PREFIX_LEN];
+};
+
+/* Format of the ULOG packets passed through netlink */
+typedef struct ulog_packet_msg {
+ unsigned long mark;
+ long timestamp_sec;
+ long timestamp_usec;
+ unsigned int hook;
+ char indev_name[IFNAMSIZ];
+ char outdev_name[IFNAMSIZ];
+ size_t data_len;
+ char prefix[ULOG_PREFIX_LEN];
+ unsigned char mac_len;
+ unsigned char mac[ULOG_MAC_LEN];
+ unsigned char payload[0];
+} ulog_packet_msg_t;
+
+#endif /*_IPT_ULOG_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_addrtype.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_addrtype.h
new file mode 100644
index 0000000..166ed01
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_addrtype.h
@@ -0,0 +1,11 @@
+#ifndef _IPT_ADDRTYPE_H
+#define _IPT_ADDRTYPE_H
+
+struct ipt_addrtype_info {
+ u_int16_t source; /* source-type mask */
+ u_int16_t dest; /* dest-type mask */
+ u_int32_t invert_source;
+ u_int32_t invert_dest;
+};
+
+#endif
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_ah.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_ah.h
new file mode 100644
index 0000000..7b9a2ac
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_ah.h
@@ -0,0 +1,16 @@
+#ifndef _IPT_AH_H
+#define _IPT_AH_H
+
+struct ipt_ah
+{
+ u_int32_t spis[2]; /* Security Parameter Index */
+ u_int8_t invflags; /* Inverse flags */
+};
+
+
+
+/* Values for "invflags" field in struct ipt_ah. */
+#define IPT_AH_INV_SPI 0x01 /* Invert the sense of spi. */
+#define IPT_AH_INV_MASK 0x01 /* All possible flags. */
+
+#endif /*_IPT_AH_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_comment.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_comment.h
new file mode 100644
index 0000000..ae2afc2
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_comment.h
@@ -0,0 +1,10 @@
+#ifndef _IPT_COMMENT_H
+#define _IPT_COMMENT_H
+
+#include <linux/netfilter/xt_comment.h>
+
+#define IPT_MAX_COMMENT_LEN XT_MAX_COMMENT_LEN
+
+#define ipt_comment_info xt_comment_info
+
+#endif /* _IPT_COMMENT_H */
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_connbytes.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_connbytes.h
new file mode 100644
index 0000000..f63e6ee
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_connbytes.h
@@ -0,0 +1,18 @@
+#ifndef _IPT_CONNBYTES_H
+#define _IPT_CONNBYTES_H
+
+#include <linux/netfilter/xt_connbytes.h>
+#define ipt_connbytes_what xt_connbytes_what
+
+#define IPT_CONNBYTES_PKTS XT_CONNBYTES_PKTS
+#define IPT_CONNBYTES_BYTES XT_CONNBYTES_BYTES
+#define IPT_CONNBYTES_AVGPKT XT_CONNBYTES_AVGPKT
+
+#define ipt_connbytes_direction xt_connbytes_direction
+#define IPT_CONNBYTES_DIR_ORIGINAL XT_CONNBYTES_DIR_ORIGINAL
+#define IPT_CONNBYTES_DIR_REPLY XT_CONNBYTES_DIR_REPLY
+#define IPT_CONNBYTES_DIR_BOTH XT_CONNBYTES_DIR_BOTH
+
+#define ipt_connbytes_info xt_connbytes_info
+
+#endif
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_connmark.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_connmark.h
new file mode 100644
index 0000000..c7ba656
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_connmark.h
@@ -0,0 +1,7 @@
+#ifndef _IPT_CONNMARK_H
+#define _IPT_CONNMARK_H
+
+#include <linux/netfilter/xt_connmark.h>
+#define ipt_connmark_info xt_connmark_info
+
+#endif /*_IPT_CONNMARK_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_conntrack.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_conntrack.h
new file mode 100644
index 0000000..cde6762
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_conntrack.h
@@ -0,0 +1,28 @@
+/* Header file for kernel module to match connection tracking information.
+ * GPL (C) 2001 Marc Boucher (marc@mbsi.ca).
+ */
+
+#ifndef _IPT_CONNTRACK_H
+#define _IPT_CONNTRACK_H
+
+#include <linux/netfilter/xt_conntrack.h>
+
+#define IPT_CONNTRACK_STATE_BIT(ctinfo) XT_CONNTRACK_STATE_BIT(ctinfo)
+#define IPT_CONNTRACK_STATE_INVALID XT_CONNTRACK_STATE_INVALID
+
+#define IPT_CONNTRACK_STATE_SNAT XT_CONNTRACK_STATE_SNAT
+#define IPT_CONNTRACK_STATE_DNAT XT_CONNTRACK_STATE_DNAT
+#define IPT_CONNTRACK_STATE_UNTRACKED XT_CONNTRACK_STATE_UNTRACKED
+
+/* flags, invflags: */
+#define IPT_CONNTRACK_STATE XT_CONNTRACK_STATE
+#define IPT_CONNTRACK_PROTO XT_CONNTRACK_PROTO
+#define IPT_CONNTRACK_ORIGSRC XT_CONNTRACK_ORIGSRC
+#define IPT_CONNTRACK_ORIGDST XT_CONNTRACK_ORIGDST
+#define IPT_CONNTRACK_REPLSRC XT_CONNTRACK_REPLSRC
+#define IPT_CONNTRACK_REPLDST XT_CONNTRACK_REPLDST
+#define IPT_CONNTRACK_STATUS XT_CONNTRACK_STATUS
+#define IPT_CONNTRACK_EXPIRES XT_CONNTRACK_EXPIRES
+
+#define ipt_conntrack_info xt_conntrack_info
+#endif /*_IPT_CONNTRACK_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_dccp.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_dccp.h
new file mode 100644
index 0000000..e70d11e
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_dccp.h
@@ -0,0 +1,15 @@
+#ifndef _IPT_DCCP_H_
+#define _IPT_DCCP_H_
+
+#include <linux/netfilter/xt_dccp.h>
+#define IPT_DCCP_SRC_PORTS XT_DCCP_SRC_PORTS
+#define IPT_DCCP_DEST_PORTS XT_DCCP_DEST_PORTS
+#define IPT_DCCP_TYPE XT_DCCP_TYPE
+#define IPT_DCCP_OPTION XT_DCCP_OPTION
+
+#define IPT_DCCP_VALID_FLAGS XT_DCCP_VALID_FLAGS
+
+#define ipt_dccp_info xt_dccp_info
+
+#endif /* _IPT_DCCP_H_ */
+
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_dscp.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_dscp.h
new file mode 100644
index 0000000..4b82ca9
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_dscp.h
@@ -0,0 +1,21 @@
+/* iptables module for matching the IPv4 DSCP field
+ *
+ * (C) 2002 Harald Welte <laforge@gnumonks.org>
+ * This software is distributed under GNU GPL v2, 1991
+ *
+ * See RFC2474 for a description of the DSCP field within the IP Header.
+ *
+ * ipt_dscp.h,v 1.3 2002/08/05 19:00:21 laforge Exp
+*/
+#ifndef _IPT_DSCP_H
+#define _IPT_DSCP_H
+
+#include <linux/netfilter/xt_dscp.h>
+
+#define IPT_DSCP_MASK XT_DSCP_MASK
+#define IPT_DSCP_SHIFT XT_DSCP_SHIFT
+#define IPT_DSCP_MAX XT_DSCP_MAX
+
+#define ipt_dscp_info xt_dscp_info
+
+#endif /* _IPT_DSCP_H */
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_ecn.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_ecn.h
new file mode 100644
index 0000000..1f0d9a4
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_ecn.h
@@ -0,0 +1,33 @@
+/* iptables module for matching the ECN header in IPv4 and TCP header
+ *
+ * (C) 2002 Harald Welte <laforge@gnumonks.org>
+ *
+ * This software is distributed under GNU GPL v2, 1991
+ *
+ * ipt_ecn.h,v 1.4 2002/08/05 19:39:00 laforge Exp
+*/
+#ifndef _IPT_ECN_H
+#define _IPT_ECN_H
+#include <linux/netfilter_ipv4/ipt_dscp.h>
+
+#define IPT_ECN_IP_MASK (~IPT_DSCP_MASK)
+
+#define IPT_ECN_OP_MATCH_IP 0x01
+#define IPT_ECN_OP_MATCH_ECE 0x10
+#define IPT_ECN_OP_MATCH_CWR 0x20
+
+#define IPT_ECN_OP_MATCH_MASK 0xce
+
+/* match info */
+struct ipt_ecn_info {
+ u_int8_t operation;
+ u_int8_t invert;
+ u_int8_t ip_ect;
+ union {
+ struct {
+ u_int8_t ect;
+ } tcp;
+ } proto;
+};
+
+#endif /* _IPT_ECN_H */
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_esp.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_esp.h
new file mode 100644
index 0000000..78296e7
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_esp.h
@@ -0,0 +1,10 @@
+#ifndef _IPT_ESP_H
+#define _IPT_ESP_H
+
+#include <linux/netfilter/xt_esp.h>
+
+#define ipt_esp xt_esp
+#define IPT_ESP_INV_SPI XT_ESP_INV_SPI
+#define IPT_ESP_INV_MASK XT_ESP_INV_MASK
+
+#endif /*_IPT_ESP_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_hashlimit.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_hashlimit.h
new file mode 100644
index 0000000..5662120
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_hashlimit.h
@@ -0,0 +1,14 @@
+#ifndef _IPT_HASHLIMIT_H
+#define _IPT_HASHLIMIT_H
+
+#include <linux/netfilter/xt_hashlimit.h>
+
+#define IPT_HASHLIMIT_SCALE XT_HASHLIMIT_SCALE
+#define IPT_HASHLIMIT_HASH_DIP XT_HASHLIMIT_HASH_DIP
+#define IPT_HASHLIMIT_HASH_DPT XT_HASHLIMIT_HASH_DPT
+#define IPT_HASHLIMIT_HASH_SIP XT_HASHLIMIT_HASH_SIP
+#define IPT_HASHLIMIT_HASH_SPT XT_HASHLIMIT_HASH_SPT
+
+#define ipt_hashlimit_info xt_hashlimit_info
+
+#endif /* _IPT_HASHLIMIT_H */
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_helper.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_helper.h
new file mode 100644
index 0000000..80452c2
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_helper.h
@@ -0,0 +1,7 @@
+#ifndef _IPT_HELPER_H
+#define _IPT_HELPER_H
+
+#include <linux/netfilter/xt_helper.h>
+#define ipt_helper_info xt_helper_info
+
+#endif /* _IPT_HELPER_H */
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_iprange.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_iprange.h
new file mode 100644
index 0000000..a92fefc
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_iprange.h
@@ -0,0 +1,25 @@
+#ifndef _IPT_IPRANGE_H
+#define _IPT_IPRANGE_H
+
+#include <linux/types.h>
+
+#define IPRANGE_SRC 0x01 /* Match source IP address */
+#define IPRANGE_DST 0x02 /* Match destination IP address */
+#define IPRANGE_SRC_INV 0x10 /* Negate the condition */
+#define IPRANGE_DST_INV 0x20 /* Negate the condition */
+
+struct ipt_iprange {
+ /* Inclusive: network order. */
+ __be32 min_ip, max_ip;
+};
+
+struct ipt_iprange_info
+{
+ struct ipt_iprange src;
+ struct ipt_iprange dst;
+
+ /* Flags from above */
+ u_int8_t flags;
+};
+
+#endif /* _IPT_IPRANGE_H */
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_length.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_length.h
new file mode 100644
index 0000000..9b45206
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_length.h
@@ -0,0 +1,7 @@
+#ifndef _IPT_LENGTH_H
+#define _IPT_LENGTH_H
+
+#include <linux/netfilter/xt_length.h>
+#define ipt_length_info xt_length_info
+
+#endif /*_IPT_LENGTH_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_limit.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_limit.h
new file mode 100644
index 0000000..92f5cd0
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_limit.h
@@ -0,0 +1,8 @@
+#ifndef _IPT_RATE_H
+#define _IPT_RATE_H
+
+#include <linux/netfilter/xt_limit.h>
+#define IPT_LIMIT_SCALE XT_LIMIT_SCALE
+#define ipt_rateinfo xt_rateinfo
+
+#endif /*_IPT_RATE_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_mac.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_mac.h
new file mode 100644
index 0000000..b186008
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_mac.h
@@ -0,0 +1,7 @@
+#ifndef _IPT_MAC_H
+#define _IPT_MAC_H
+
+#include <linux/netfilter/xt_mac.h>
+#define ipt_mac_info xt_mac_info
+
+#endif /*_IPT_MAC_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_mark.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_mark.h
new file mode 100644
index 0000000..bfde67c
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_mark.h
@@ -0,0 +1,9 @@
+#ifndef _IPT_MARK_H
+#define _IPT_MARK_H
+
+/* Backwards compatibility for old userspace */
+#include <linux/netfilter/xt_mark.h>
+
+#define ipt_mark_info xt_mark_info
+
+#endif /*_IPT_MARK_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_multiport.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_multiport.h
new file mode 100644
index 0000000..55fe85e
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_multiport.h
@@ -0,0 +1,15 @@
+#ifndef _IPT_MULTIPORT_H
+#define _IPT_MULTIPORT_H
+
+#include <linux/netfilter/xt_multiport.h>
+
+#define IPT_MULTIPORT_SOURCE XT_MULTIPORT_SOURCE
+#define IPT_MULTIPORT_DESTINATION XT_MULTIPORT_DESTINATION
+#define IPT_MULTIPORT_EITHER XT_MULTIPORT_EITHER
+
+#define IPT_MULTI_PORTS XT_MULTI_PORTS
+
+#define ipt_multiport xt_multiport
+#define ipt_multiport_v1 xt_multiport_v1
+
+#endif /*_IPT_MULTIPORT_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_owner.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_owner.h
new file mode 100644
index 0000000..92f4bda
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_owner.h
@@ -0,0 +1,20 @@
+#ifndef _IPT_OWNER_H
+#define _IPT_OWNER_H
+
+/* match and invert flags */
+#define IPT_OWNER_UID 0x01
+#define IPT_OWNER_GID 0x02
+#define IPT_OWNER_PID 0x04
+#define IPT_OWNER_SID 0x08
+#define IPT_OWNER_COMM 0x10
+
+struct ipt_owner_info {
+ uid_t uid;
+ gid_t gid;
+ pid_t pid;
+ pid_t sid;
+ char comm[16];
+ u_int8_t match, invert; /* flags */
+};
+
+#endif /*_IPT_OWNER_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_physdev.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_physdev.h
new file mode 100644
index 0000000..2400e71
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_physdev.h
@@ -0,0 +1,17 @@
+#ifndef _IPT_PHYSDEV_H
+#define _IPT_PHYSDEV_H
+
+/* Backwards compatibility for old userspace */
+
+#include <linux/netfilter/xt_physdev.h>
+
+#define IPT_PHYSDEV_OP_IN XT_PHYSDEV_OP_IN
+#define IPT_PHYSDEV_OP_OUT XT_PHYSDEV_OP_OUT
+#define IPT_PHYSDEV_OP_BRIDGED XT_PHYSDEV_OP_BRIDGED
+#define IPT_PHYSDEV_OP_ISIN XT_PHYSDEV_OP_ISIN
+#define IPT_PHYSDEV_OP_ISOUT XT_PHYSDEV_OP_ISOUT
+#define IPT_PHYSDEV_OP_MASK XT_PHYSDEV_OP_MASK
+
+#define ipt_physdev_info xt_physdev_info
+
+#endif /*_IPT_PHYSDEV_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_pkttype.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_pkttype.h
new file mode 100644
index 0000000..ff1fbc9
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_pkttype.h
@@ -0,0 +1,7 @@
+#ifndef _IPT_PKTTYPE_H
+#define _IPT_PKTTYPE_H
+
+#include <linux/netfilter/xt_pkttype.h>
+#define ipt_pkttype_info xt_pkttype_info
+
+#endif /*_IPT_PKTTYPE_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_policy.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_policy.h
new file mode 100644
index 0000000..b9478a2
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_policy.h
@@ -0,0 +1,21 @@
+#ifndef _IPT_POLICY_H
+#define _IPT_POLICY_H
+
+#define IPT_POLICY_MAX_ELEM XT_POLICY_MAX_ELEM
+
+/* ipt_policy_flags */
+#define IPT_POLICY_MATCH_IN XT_POLICY_MATCH_IN
+#define IPT_POLICY_MATCH_OUT XT_POLICY_MATCH_OUT
+#define IPT_POLICY_MATCH_NONE XT_POLICY_MATCH_NONE
+#define IPT_POLICY_MATCH_STRICT XT_POLICY_MATCH_STRICT
+
+/* ipt_policy_modes */
+#define IPT_POLICY_MODE_TRANSPORT XT_POLICY_MODE_TRANSPORT
+#define IPT_POLICY_MODE_TUNNEL XT_POLICY_MODE_TUNNEL
+
+#define ipt_policy_spec xt_policy_spec
+#define ipt_policy_addr xt_policy_addr
+#define ipt_policy_elem xt_policy_elem
+#define ipt_policy_info xt_policy_info
+
+#endif /* _IPT_POLICY_H */
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_realm.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_realm.h
new file mode 100644
index 0000000..b3996ea
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_realm.h
@@ -0,0 +1,7 @@
+#ifndef _IPT_REALM_H
+#define _IPT_REALM_H
+
+#include <linux/netfilter/xt_realm.h>
+#define ipt_realm_info xt_realm_info
+
+#endif /* _IPT_REALM_H */
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_recent.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_recent.h
new file mode 100644
index 0000000..6508a45
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_recent.h
@@ -0,0 +1,27 @@
+#ifndef _IPT_RECENT_H
+#define _IPT_RECENT_H
+
+#define RECENT_NAME "ipt_recent"
+#define RECENT_VER "v0.3.1"
+
+#define IPT_RECENT_CHECK 1
+#define IPT_RECENT_SET 2
+#define IPT_RECENT_UPDATE 4
+#define IPT_RECENT_REMOVE 8
+#define IPT_RECENT_TTL 16
+
+#define IPT_RECENT_SOURCE 0
+#define IPT_RECENT_DEST 1
+
+#define IPT_RECENT_NAME_LEN 200
+
+struct ipt_recent_info {
+ u_int32_t seconds;
+ u_int32_t hit_count;
+ u_int8_t check_set;
+ u_int8_t invert;
+ char name[IPT_RECENT_NAME_LEN];
+ u_int8_t side;
+};
+
+#endif /*_IPT_RECENT_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_sctp.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_sctp.h
new file mode 100644
index 0000000..80b3dba
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_sctp.h
@@ -0,0 +1,105 @@
+#ifndef _IPT_SCTP_H_
+#define _IPT_SCTP_H_
+
+#define IPT_SCTP_SRC_PORTS 0x01
+#define IPT_SCTP_DEST_PORTS 0x02
+#define IPT_SCTP_CHUNK_TYPES 0x04
+
+#define IPT_SCTP_VALID_FLAGS 0x07
+
+
+struct ipt_sctp_flag_info {
+ u_int8_t chunktype;
+ u_int8_t flag;
+ u_int8_t flag_mask;
+};
+
+#define IPT_NUM_SCTP_FLAGS 4
+
+struct ipt_sctp_info {
+ u_int16_t dpts[2]; /* Min, Max */
+ u_int16_t spts[2]; /* Min, Max */
+
+ u_int32_t chunkmap[256 / sizeof (u_int32_t)]; /* Bit mask of chunks to be matched according to RFC 2960 */
+
+#define SCTP_CHUNK_MATCH_ANY 0x01 /* Match if any of the chunk types are present */
+#define SCTP_CHUNK_MATCH_ALL 0x02 /* Match if all of the chunk types are present */
+#define SCTP_CHUNK_MATCH_ONLY 0x04 /* Match if these are the only chunk types present */
+
+ u_int32_t chunk_match_type;
+ struct ipt_sctp_flag_info flag_info[IPT_NUM_SCTP_FLAGS];
+ int flag_count;
+
+ u_int32_t flags;
+ u_int32_t invflags;
+};
+
+#define bytes(type) (sizeof(type) * 8)
+
+#define SCTP_CHUNKMAP_SET(chunkmap, type) \
+ do { \
+ chunkmap[type / bytes(u_int32_t)] |= \
+ 1 << (type % bytes(u_int32_t)); \
+ } while (0)
+
+#define SCTP_CHUNKMAP_CLEAR(chunkmap, type) \
+ do { \
+ chunkmap[type / bytes(u_int32_t)] &= \
+ ~(1 << (type % bytes(u_int32_t))); \
+ } while (0)
+
+#define SCTP_CHUNKMAP_IS_SET(chunkmap, type) \
+({ \
+ (chunkmap[type / bytes (u_int32_t)] & \
+ (1 << (type % bytes (u_int32_t)))) ? 1: 0; \
+})
+
+#define SCTP_CHUNKMAP_RESET(chunkmap) \
+ do { \
+ int i; \
+ for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \
+ chunkmap[i] = 0; \
+ } while (0)
+
+#define SCTP_CHUNKMAP_SET_ALL(chunkmap) \
+ do { \
+ int i; \
+ for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \
+ chunkmap[i] = ~0; \
+ } while (0)
+
+#define SCTP_CHUNKMAP_COPY(destmap, srcmap) \
+ do { \
+ int i; \
+ for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \
+ destmap[i] = srcmap[i]; \
+ } while (0)
+
+#define SCTP_CHUNKMAP_IS_CLEAR(chunkmap) \
+({ \
+ int i; \
+ int flag = 1; \
+ for (i = 0; i < ARRAY_SIZE(chunkmap); i++) { \
+ if (chunkmap[i]) { \
+ flag = 0; \
+ break; \
+ } \
+ } \
+ flag; \
+})
+
+#define SCTP_CHUNKMAP_IS_ALL_SET(chunkmap) \
+({ \
+ int i; \
+ int flag = 1; \
+ for (i = 0; i < ARRAY_SIZE(chunkmap); i++) { \
+ if (chunkmap[i] != ~0) { \
+ flag = 0; \
+ break; \
+ } \
+ } \
+ flag; \
+})
+
+#endif /* _IPT_SCTP_H_ */
+
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_state.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_state.h
new file mode 100644
index 0000000..a44a99c
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_state.h
@@ -0,0 +1,15 @@
+#ifndef _IPT_STATE_H
+#define _IPT_STATE_H
+
+/* Backwards compatibility for old userspace */
+
+#include <linux/netfilter/xt_state.h>
+
+#define IPT_STATE_BIT XT_STATE_BIT
+#define IPT_STATE_INVALID XT_STATE_INVALID
+
+#define IPT_STATE_UNTRACKED XT_STATE_UNTRACKED
+
+#define ipt_state_info xt_state_info
+
+#endif /*_IPT_STATE_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_string.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_string.h
new file mode 100644
index 0000000..c26de30
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_string.h
@@ -0,0 +1,10 @@
+#ifndef _IPT_STRING_H
+#define _IPT_STRING_H
+
+#include <linux/netfilter/xt_string.h>
+
+#define IPT_STRING_MAX_PATTERN_SIZE XT_STRING_MAX_PATTERN_SIZE
+#define IPT_STRING_MAX_ALGO_NAME_SIZE XT_STRING_MAX_ALGO_NAME_SIZE
+#define ipt_string_info xt_string_info
+
+#endif /*_IPT_STRING_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_tcpmss.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_tcpmss.h
new file mode 100644
index 0000000..18bbc8e
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_tcpmss.h
@@ -0,0 +1,7 @@
+#ifndef _IPT_TCPMSS_MATCH_H
+#define _IPT_TCPMSS_MATCH_H
+
+#include <linux/netfilter/xt_tcpmss.h>
+#define ipt_tcpmss_match_info xt_tcpmss_match_info
+
+#endif /*_IPT_TCPMSS_MATCH_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_tos.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_tos.h
new file mode 100644
index 0000000..a21f5df
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_tos.h
@@ -0,0 +1,13 @@
+#ifndef _IPT_TOS_H
+#define _IPT_TOS_H
+
+struct ipt_tos_info {
+ u_int8_t tos;
+ u_int8_t invert;
+};
+
+#ifndef IPTOS_NORMALSVC
+#define IPTOS_NORMALSVC 0
+#endif
+
+#endif /*_IPT_TOS_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv4/ipt_ttl.h b/sysroot/usr/include/linux/netfilter_ipv4/ipt_ttl.h
new file mode 100644
index 0000000..ee24fd8
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv4/ipt_ttl.h
@@ -0,0 +1,21 @@
+/* IP tables module for matching the value of the TTL
+ * (C) 2000 by Harald Welte <laforge@gnumonks.org> */
+
+#ifndef _IPT_TTL_H
+#define _IPT_TTL_H
+
+enum {
+ IPT_TTL_EQ = 0, /* equals */
+ IPT_TTL_NE, /* not equals */
+ IPT_TTL_LT, /* less than */
+ IPT_TTL_GT, /* greater than */
+};
+
+
+struct ipt_ttl_info {
+ u_int8_t mode;
+ u_int8_t ttl;
+};
+
+
+#endif
diff --git a/sysroot/usr/include/linux/netfilter_ipv6.h b/sysroot/usr/include/linux/netfilter_ipv6.h
new file mode 100644
index 0000000..6441336
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv6.h
@@ -0,0 +1,83 @@
+#ifndef __LINUX_IP6_NETFILTER_H
+#define __LINUX_IP6_NETFILTER_H
+
+/* IPv6-specific defines for netfilter.
+ * (C)1998 Rusty Russell -- This code is GPL.
+ * (C)1999 David Jeffery
+ * this header was blatantly ripped from netfilter_ipv4.h
+ * it's amazing what adding a bunch of 6s can do =8^)
+ */
+
+#include <linux/netfilter.h>
+
+/* only for userspace compatibility */
+/* IP Cache bits. */
+/* Src IP address. */
+#define NFC_IP6_SRC 0x0001
+/* Dest IP address. */
+#define NFC_IP6_DST 0x0002
+/* Input device. */
+#define NFC_IP6_IF_IN 0x0004
+/* Output device. */
+#define NFC_IP6_IF_OUT 0x0008
+/* TOS. */
+#define NFC_IP6_TOS 0x0010
+/* Protocol. */
+#define NFC_IP6_PROTO 0x0020
+/* IP options. */
+#define NFC_IP6_OPTIONS 0x0040
+/* Frag & flags. */
+#define NFC_IP6_FRAG 0x0080
+
+
+/* Per-protocol information: only matters if proto match. */
+/* TCP flags. */
+#define NFC_IP6_TCPFLAGS 0x0100
+/* Source port. */
+#define NFC_IP6_SRC_PT 0x0200
+/* Dest port. */
+#define NFC_IP6_DST_PT 0x0400
+/* Something else about the proto */
+#define NFC_IP6_PROTO_UNKNOWN 0x2000
+
+
+/* IP6 Hooks */
+/* After promisc drops, checksum checks. */
+#define NF_IP6_PRE_ROUTING 0
+/* If the packet is destined for this box. */
+#define NF_IP6_LOCAL_IN 1
+/* If the packet is destined for another interface. */
+#define NF_IP6_FORWARD 2
+/* Packets coming from a local process. */
+#define NF_IP6_LOCAL_OUT 3
+/* Packets about to hit the wire. */
+#define NF_IP6_POST_ROUTING 4
+#define NF_IP6_NUMHOOKS 5
+
+
+enum nf_ip6_hook_priorities {
+ NF_IP6_PRI_FIRST = INT_MIN,
+ NF_IP6_PRI_CONNTRACK_DEFRAG = -400,
+ NF_IP6_PRI_SELINUX_FIRST = -225,
+ NF_IP6_PRI_CONNTRACK = -200,
+ NF_IP6_PRI_MANGLE = -150,
+ NF_IP6_PRI_NAT_DST = -100,
+ NF_IP6_PRI_FILTER = 0,
+ NF_IP6_PRI_NAT_SRC = 100,
+ NF_IP6_PRI_SELINUX_LAST = 225,
+ NF_IP6_PRI_LAST = INT_MAX,
+};
+
+#ifdef CONFIG_NETFILTER
+extern int ip6_route_me_harder(struct sk_buff *skb);
+extern __sum16 nf_ip6_checksum(struct sk_buff *skb, unsigned int hook,
+ unsigned int dataoff, u_int8_t protocol);
+
+extern int ipv6_netfilter_init(void);
+extern void ipv6_netfilter_fini(void);
+#else /* CONFIG_NETFILTER */
+static __inline__ int ipv6_netfilter_init(void) { return 0; }
+static __inline__ void ipv6_netfilter_fini(void) { return; }
+#endif /* CONFIG_NETFILTER */
+
+#endif /*__LINUX_IP6_NETFILTER_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv6/ip6_tables.h b/sysroot/usr/include/linux/netfilter_ipv6/ip6_tables.h
new file mode 100644
index 0000000..784fab4
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv6/ip6_tables.h
@@ -0,0 +1,323 @@
+/*
+ * 25-Jul-1998 Major changes to allow for ip chain table
+ *
+ * 3-Jan-2000 Named tables to allow packet selection for different uses.
+ */
+
+/*
+ * Format of an IP6 firewall descriptor
+ *
+ * src, dst, src_mask, dst_mask are always stored in network byte order.
+ * flags are stored in host byte order (of course).
+ * Port numbers are stored in HOST byte order.
+ */
+
+#ifndef _IP6_TABLES_H
+#define _IP6_TABLES_H
+
+#include <linux/netfilter_ipv6.h>
+
+#include <linux/netfilter/x_tables.h>
+
+#define IP6T_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
+#define IP6T_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN
+
+#define ip6t_match xt_match
+#define ip6t_target xt_target
+#define ip6t_table xt_table
+#define ip6t_get_revision xt_get_revision
+
+/* Yes, Virginia, you have to zero the padding. */
+struct ip6t_ip6 {
+ /* Source and destination IP6 addr */
+ struct in6_addr src, dst;
+ /* Mask for src and dest IP6 addr */
+ struct in6_addr smsk, dmsk;
+ char iniface[IFNAMSIZ], outiface[IFNAMSIZ];
+ unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ];
+
+ /* Upper protocol number
+ * - The allowed value is 0 (any) or protocol number of last parsable
+ * header, which is 50 (ESP), 59 (No Next Header), 135 (MH), or
+ * the non IPv6 extension headers.
+ * - The protocol numbers of IPv6 extension headers except of ESP and
+ * MH do not match any packets.
+ * - You also need to set IP6T_FLAGS_PROTO to "flags" to check protocol.
+ */
+ u_int16_t proto;
+ /* TOS to match iff flags & IP6T_F_TOS */
+ u_int8_t tos;
+
+ /* Flags word */
+ u_int8_t flags;
+ /* Inverse flags */
+ u_int8_t invflags;
+};
+
+#define ip6t_entry_match xt_entry_match
+#define ip6t_entry_target xt_entry_target
+#define ip6t_standard_target xt_standard_target
+
+#define ip6t_counters xt_counters
+
+/* Values for "flag" field in struct ip6t_ip6 (general ip6 structure). */
+#define IP6T_F_PROTO 0x01 /* Set if rule cares about upper
+ protocols */
+#define IP6T_F_TOS 0x02 /* Match the TOS. */
+#define IP6T_F_GOTO 0x04 /* Set if jump is a goto */
+#define IP6T_F_MASK 0x07 /* All possible flag bits mask. */
+
+/* Values for "inv" field in struct ip6t_ip6. */
+#define IP6T_INV_VIA_IN 0x01 /* Invert the sense of IN IFACE. */
+#define IP6T_INV_VIA_OUT 0x02 /* Invert the sense of OUT IFACE */
+#define IP6T_INV_TOS 0x04 /* Invert the sense of TOS. */
+#define IP6T_INV_SRCIP 0x08 /* Invert the sense of SRC IP. */
+#define IP6T_INV_DSTIP 0x10 /* Invert the sense of DST OP. */
+#define IP6T_INV_FRAG 0x20 /* Invert the sense of FRAG. */
+#define IP6T_INV_PROTO XT_INV_PROTO
+#define IP6T_INV_MASK 0x7F /* All possible flag bits mask. */
+
+/* This structure defines each of the firewall rules. Consists of 3
+ parts which are 1) general IP header stuff 2) match specific
+ stuff 3) the target to perform if the rule matches */
+struct ip6t_entry
+{
+ struct ip6t_ip6 ipv6;
+
+ /* Mark with fields that we care about. */
+ unsigned int nfcache;
+
+ /* Size of ipt_entry + matches */
+ u_int16_t target_offset;
+ /* Size of ipt_entry + matches + target */
+ u_int16_t next_offset;
+
+ /* Back pointer */
+ unsigned int comefrom;
+
+ /* Packet and byte counters. */
+ struct xt_counters counters;
+
+ /* The matches (if any), then the target. */
+ unsigned char elems[0];
+};
+
+/* Standard entry */
+struct ip6t_standard
+{
+ struct ip6t_entry entry;
+ struct ip6t_standard_target target;
+};
+
+struct ip6t_error_target
+{
+ struct ip6t_entry_target target;
+ char errorname[IP6T_FUNCTION_MAXNAMELEN];
+};
+
+struct ip6t_error
+{
+ struct ip6t_entry entry;
+ struct ip6t_error_target target;
+};
+
+#define IP6T_ENTRY_INIT(__size) \
+{ \
+ .target_offset = sizeof(struct ip6t_entry), \
+ .next_offset = (__size), \
+}
+
+#define IP6T_STANDARD_INIT(__verdict) \
+{ \
+ .entry = IP6T_ENTRY_INIT(sizeof(struct ip6t_standard)), \
+ .target = XT_TARGET_INIT(IP6T_STANDARD_TARGET, \
+ sizeof(struct ip6t_standard_target)), \
+ .target.verdict = -(__verdict) - 1, \
+}
+
+#define IP6T_ERROR_INIT \
+{ \
+ .entry = IP6T_ENTRY_INIT(sizeof(struct ip6t_error)), \
+ .target = XT_TARGET_INIT(IP6T_ERROR_TARGET, \
+ sizeof(struct ip6t_error_target)), \
+ .target.errorname = "ERROR", \
+}
+
+/*
+ * New IP firewall options for [gs]etsockopt at the RAW IP level.
+ * Unlike BSD Linux inherits IP options so you don't have to use
+ * a raw socket for this. Instead we check rights in the calls.
+ *
+ * ATTENTION: check linux/in6.h before adding new number here.
+ */
+#define IP6T_BASE_CTL 64
+
+#define IP6T_SO_SET_REPLACE (IP6T_BASE_CTL)
+#define IP6T_SO_SET_ADD_COUNTERS (IP6T_BASE_CTL + 1)
+#define IP6T_SO_SET_MAX IP6T_SO_SET_ADD_COUNTERS
+
+#define IP6T_SO_GET_INFO (IP6T_BASE_CTL)
+#define IP6T_SO_GET_ENTRIES (IP6T_BASE_CTL + 1)
+#define IP6T_SO_GET_REVISION_MATCH (IP6T_BASE_CTL + 4)
+#define IP6T_SO_GET_REVISION_TARGET (IP6T_BASE_CTL + 5)
+#define IP6T_SO_GET_MAX IP6T_SO_GET_REVISION_TARGET
+
+/* CONTINUE verdict for targets */
+#define IP6T_CONTINUE XT_CONTINUE
+
+/* For standard target */
+#define IP6T_RETURN XT_RETURN
+
+/* TCP/UDP matching stuff */
+#include <linux/netfilter/xt_tcpudp.h>
+
+#define ip6t_tcp xt_tcp
+#define ip6t_udp xt_udp
+
+/* Values for "inv" field in struct ipt_tcp. */
+#define IP6T_TCP_INV_SRCPT XT_TCP_INV_SRCPT
+#define IP6T_TCP_INV_DSTPT XT_TCP_INV_DSTPT
+#define IP6T_TCP_INV_FLAGS XT_TCP_INV_FLAGS
+#define IP6T_TCP_INV_OPTION XT_TCP_INV_OPTION
+#define IP6T_TCP_INV_MASK XT_TCP_INV_MASK
+
+/* Values for "invflags" field in struct ipt_udp. */
+#define IP6T_UDP_INV_SRCPT XT_UDP_INV_SRCPT
+#define IP6T_UDP_INV_DSTPT XT_UDP_INV_DSTPT
+#define IP6T_UDP_INV_MASK XT_UDP_INV_MASK
+
+/* ICMP matching stuff */
+struct ip6t_icmp
+{
+ u_int8_t type; /* type to match */
+ u_int8_t code[2]; /* range of code */
+ u_int8_t invflags; /* Inverse flags */
+};
+
+/* Values for "inv" field for struct ipt_icmp. */
+#define IP6T_ICMP_INV 0x01 /* Invert the sense of type/code test */
+
+/* The argument to IP6T_SO_GET_INFO */
+struct ip6t_getinfo
+{
+ /* Which table: caller fills this in. */
+ char name[IP6T_TABLE_MAXNAMELEN];
+
+ /* Kernel fills these in. */
+ /* Which hook entry points are valid: bitmask */
+ unsigned int valid_hooks;
+
+ /* Hook entry points: one per netfilter hook. */
+ unsigned int hook_entry[NF_IP6_NUMHOOKS];
+
+ /* Underflow points. */
+ unsigned int underflow[NF_IP6_NUMHOOKS];
+
+ /* Number of entries */
+ unsigned int num_entries;
+
+ /* Size of entries. */
+ unsigned int size;
+};
+
+/* The argument to IP6T_SO_SET_REPLACE. */
+struct ip6t_replace
+{
+ /* Which table. */
+ char name[IP6T_TABLE_MAXNAMELEN];
+
+ /* Which hook entry points are valid: bitmask. You can't
+ change this. */
+ unsigned int valid_hooks;
+
+ /* Number of entries */
+ unsigned int num_entries;
+
+ /* Total size of new entries */
+ unsigned int size;
+
+ /* Hook entry points. */
+ unsigned int hook_entry[NF_IP6_NUMHOOKS];
+
+ /* Underflow points. */
+ unsigned int underflow[NF_IP6_NUMHOOKS];
+
+ /* Information about old entries: */
+ /* Number of counters (must be equal to current number of entries). */
+ unsigned int num_counters;
+ /* The old entries' counters. */
+ struct xt_counters *counters;
+
+ /* The entries (hang off end: not really an array). */
+ struct ip6t_entry entries[0];
+};
+
+/* The argument to IP6T_SO_ADD_COUNTERS. */
+#define ip6t_counters_info xt_counters_info
+
+/* The argument to IP6T_SO_GET_ENTRIES. */
+struct ip6t_get_entries
+{
+ /* Which table: user fills this in. */
+ char name[IP6T_TABLE_MAXNAMELEN];
+
+ /* User fills this in: total entry size. */
+ unsigned int size;
+
+ /* The entries. */
+ struct ip6t_entry entrytable[0];
+};
+
+/* Standard return verdict, or do jump. */
+#define IP6T_STANDARD_TARGET XT_STANDARD_TARGET
+/* Error verdict. */
+#define IP6T_ERROR_TARGET XT_ERROR_TARGET
+
+/* Helper functions */
+static __inline__ struct ip6t_entry_target *
+ip6t_get_target(struct ip6t_entry *e)
+{
+ return (void *)e + e->target_offset;
+}
+
+/* fn returns 0 to continue iteration */
+#define IP6T_MATCH_ITERATE(e, fn, args...) \
+({ \
+ unsigned int __i; \
+ int __ret = 0; \
+ struct ip6t_entry_match *__m; \
+ \
+ for (__i = sizeof(struct ip6t_entry); \
+ __i < (e)->target_offset; \
+ __i += __m->u.match_size) { \
+ __m = (void *)(e) + __i; \
+ \
+ __ret = fn(__m , ## args); \
+ if (__ret != 0) \
+ break; \
+ } \
+ __ret; \
+})
+
+/* fn returns 0 to continue iteration */
+#define IP6T_ENTRY_ITERATE(entries, size, fn, args...) \
+({ \
+ unsigned int __i; \
+ int __ret = 0; \
+ struct ip6t_entry *__e; \
+ \
+ for (__i = 0; __i < (size); __i += __e->next_offset) { \
+ __e = (void *)(entries) + __i; \
+ \
+ __ret = fn(__e , ## args); \
+ if (__ret != 0) \
+ break; \
+ } \
+ __ret; \
+})
+
+/*
+ * Main firewall chains definitions and global var's definitions.
+ */
+
+#endif /* _IP6_TABLES_H */
diff --git a/sysroot/usr/include/linux/netfilter_ipv6/ip6t_HL.h b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_HL.h
new file mode 100644
index 0000000..afb7813
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_HL.h
@@ -0,0 +1,22 @@
+/* Hop Limit modification module for ip6tables
+ * Maciej Soltysiak <solt@dns.toxicfilms.tv>
+ * Based on HW's TTL module */
+
+#ifndef _IP6T_HL_H
+#define _IP6T_HL_H
+
+enum {
+ IP6T_HL_SET = 0,
+ IP6T_HL_INC,
+ IP6T_HL_DEC
+};
+
+#define IP6T_HL_MAXMODE IP6T_HL_DEC
+
+struct ip6t_HL_info {
+ u_int8_t mode;
+ u_int8_t hop_limit;
+};
+
+
+#endif
diff --git a/sysroot/usr/include/linux/netfilter_ipv6/ip6t_LOG.h b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_LOG.h
new file mode 100644
index 0000000..0d0119b
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_LOG.h
@@ -0,0 +1,18 @@
+#ifndef _IP6T_LOG_H
+#define _IP6T_LOG_H
+
+/* make sure not to change this without changing netfilter.h:NF_LOG_* (!) */
+#define IP6T_LOG_TCPSEQ 0x01 /* Log TCP sequence numbers */
+#define IP6T_LOG_TCPOPT 0x02 /* Log TCP options */
+#define IP6T_LOG_IPOPT 0x04 /* Log IP options */
+#define IP6T_LOG_UID 0x08 /* Log UID owning local socket */
+#define IP6T_LOG_NFLOG 0x10 /* Unsupported, don't use */
+#define IP6T_LOG_MASK 0x1f
+
+struct ip6t_log_info {
+ unsigned char level;
+ unsigned char logflags;
+ char prefix[30];
+};
+
+#endif /*_IPT_LOG_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv6/ip6t_MARK.h b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_MARK.h
new file mode 100644
index 0000000..7cf629a
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_MARK.h
@@ -0,0 +1,9 @@
+#ifndef _IP6T_MARK_H_target
+#define _IP6T_MARK_H_target
+
+/* Backwards compatibility for old userspace */
+#include <linux/netfilter/xt_MARK.h>
+
+#define ip6t_mark_target_info xt_mark_target_info
+
+#endif /*_IP6T_MARK_H_target*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv6/ip6t_REJECT.h b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_REJECT.h
new file mode 100644
index 0000000..6be6504
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_REJECT.h
@@ -0,0 +1,18 @@
+#ifndef _IP6T_REJECT_H
+#define _IP6T_REJECT_H
+
+enum ip6t_reject_with {
+ IP6T_ICMP6_NO_ROUTE,
+ IP6T_ICMP6_ADM_PROHIBITED,
+ IP6T_ICMP6_NOT_NEIGHBOUR,
+ IP6T_ICMP6_ADDR_UNREACH,
+ IP6T_ICMP6_PORT_UNREACH,
+ IP6T_ICMP6_ECHOREPLY,
+ IP6T_TCP_RESET
+};
+
+struct ip6t_reject_info {
+ u_int32_t with; /* reject type */
+};
+
+#endif /*_IP6T_REJECT_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv6/ip6t_ah.h b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_ah.h
new file mode 100644
index 0000000..8531879
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_ah.h
@@ -0,0 +1,21 @@
+#ifndef _IP6T_AH_H
+#define _IP6T_AH_H
+
+struct ip6t_ah
+{
+ u_int32_t spis[2]; /* Security Parameter Index */
+ u_int32_t hdrlen; /* Header Length */
+ u_int8_t hdrres; /* Test of the Reserved Filed */
+ u_int8_t invflags; /* Inverse flags */
+};
+
+#define IP6T_AH_SPI 0x01
+#define IP6T_AH_LEN 0x02
+#define IP6T_AH_RES 0x04
+
+/* Values for "invflags" field in struct ip6t_ah. */
+#define IP6T_AH_INV_SPI 0x01 /* Invert the sense of spi. */
+#define IP6T_AH_INV_LEN 0x02 /* Invert the sense of length. */
+#define IP6T_AH_INV_MASK 0x03 /* All possible flags. */
+
+#endif /*_IP6T_AH_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv6/ip6t_esp.h b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_esp.h
new file mode 100644
index 0000000..f62eaf5
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_esp.h
@@ -0,0 +1,10 @@
+#ifndef _IP6T_ESP_H
+#define _IP6T_ESP_H
+
+#include <linux/netfilter/xt_esp.h>
+
+#define ip6t_esp xt_esp
+#define IP6T_ESP_INV_SPI XT_ESP_INV_SPI
+#define IP6T_ESP_INV_MASK XT_ESP_INV_MASK
+
+#endif /*_IP6T_ESP_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv6/ip6t_frag.h b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_frag.h
new file mode 100644
index 0000000..66070a0
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_frag.h
@@ -0,0 +1,24 @@
+#ifndef _IP6T_FRAG_H
+#define _IP6T_FRAG_H
+
+struct ip6t_frag
+{
+ u_int32_t ids[2]; /* Security Parameter Index */
+ u_int32_t hdrlen; /* Header Length */
+ u_int8_t flags; /* */
+ u_int8_t invflags; /* Inverse flags */
+};
+
+#define IP6T_FRAG_IDS 0x01
+#define IP6T_FRAG_LEN 0x02
+#define IP6T_FRAG_RES 0x04
+#define IP6T_FRAG_FST 0x08
+#define IP6T_FRAG_MF 0x10
+#define IP6T_FRAG_NMF 0x20
+
+/* Values for "invflags" field in struct ip6t_frag. */
+#define IP6T_FRAG_INV_IDS 0x01 /* Invert the sense of ids. */
+#define IP6T_FRAG_INV_LEN 0x02 /* Invert the sense of length. */
+#define IP6T_FRAG_INV_MASK 0x03 /* All possible flags. */
+
+#endif /*_IP6T_FRAG_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv6/ip6t_hl.h b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_hl.h
new file mode 100644
index 0000000..5ef91b8
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_hl.h
@@ -0,0 +1,22 @@
+/* ip6tables module for matching the Hop Limit value
+ * Maciej Soltysiak <solt@dns.toxicfilms.tv>
+ * Based on HW's ttl module */
+
+#ifndef _IP6T_HL_H
+#define _IP6T_HL_H
+
+enum {
+ IP6T_HL_EQ = 0, /* equals */
+ IP6T_HL_NE, /* not equals */
+ IP6T_HL_LT, /* less than */
+ IP6T_HL_GT, /* greater than */
+};
+
+
+struct ip6t_hl_info {
+ u_int8_t mode;
+ u_int8_t hop_limit;
+};
+
+
+#endif
diff --git a/sysroot/usr/include/linux/netfilter_ipv6/ip6t_ipv6header.h b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_ipv6header.h
new file mode 100644
index 0000000..51c53fc
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_ipv6header.h
@@ -0,0 +1,27 @@
+/* ipv6header match - matches IPv6 packets based
+on whether they contain certain headers */
+
+/* Original idea: Brad Chapman
+ * Rewritten by: Andras Kis-Szabo <kisza@sch.bme.hu> */
+
+
+#ifndef __IPV6HEADER_H
+#define __IPV6HEADER_H
+
+struct ip6t_ipv6header_info
+{
+ u_int8_t matchflags;
+ u_int8_t invflags;
+ u_int8_t modeflag;
+};
+
+#define MASK_HOPOPTS 128
+#define MASK_DSTOPTS 64
+#define MASK_ROUTING 32
+#define MASK_FRAGMENT 16
+#define MASK_AH 8
+#define MASK_ESP 4
+#define MASK_NONE 2
+#define MASK_PROTO 1
+
+#endif /* __IPV6HEADER_H */
diff --git a/sysroot/usr/include/linux/netfilter_ipv6/ip6t_length.h b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_length.h
new file mode 100644
index 0000000..9e9689d
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_length.h
@@ -0,0 +1,8 @@
+#ifndef _IP6T_LENGTH_H
+#define _IP6T_LENGTH_H
+
+#include <linux/netfilter/xt_length.h>
+#define ip6t_length_info xt_length_info
+
+#endif /*_IP6T_LENGTH_H*/
+
diff --git a/sysroot/usr/include/linux/netfilter_ipv6/ip6t_limit.h b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_limit.h
new file mode 100644
index 0000000..487e5ea
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_limit.h
@@ -0,0 +1,8 @@
+#ifndef _IP6T_RATE_H
+#define _IP6T_RATE_H
+
+#include <linux/netfilter/xt_limit.h>
+#define IP6T_LIMIT_SCALE XT_LIMIT_SCALE
+#define ip6t_rateinfo xt_rateinfo
+
+#endif /*_IP6T_RATE_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv6/ip6t_mac.h b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_mac.h
new file mode 100644
index 0000000..ac58e83
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_mac.h
@@ -0,0 +1,7 @@
+#ifndef _IP6T_MAC_H
+#define _IP6T_MAC_H
+
+#include <linux/netfilter/xt_mac.h>
+#define ip6t_mac_info xt_mac_info
+
+#endif /*_IP6T_MAC_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv6/ip6t_mark.h b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_mark.h
new file mode 100644
index 0000000..ff20495
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_mark.h
@@ -0,0 +1,9 @@
+#ifndef _IP6T_MARK_H
+#define _IP6T_MARK_H
+
+/* Backwards compatibility for old userspace */
+#include <linux/netfilter/xt_mark.h>
+
+#define ip6t_mark_info xt_mark_info
+
+#endif /*_IPT_MARK_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv6/ip6t_mh.h b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_mh.h
new file mode 100644
index 0000000..b9ca9a5
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_mh.h
@@ -0,0 +1,15 @@
+#ifndef _IP6T_MH_H
+#define _IP6T_MH_H
+
+/* MH matching stuff */
+struct ip6t_mh
+{
+ u_int8_t types[2]; /* MH type range */
+ u_int8_t invflags; /* Inverse flags */
+};
+
+/* Values for "invflags" field in struct ip6t_mh. */
+#define IP6T_MH_INV_TYPE 0x01 /* Invert the sense of type. */
+#define IP6T_MH_INV_MASK 0x01 /* All possible flags. */
+
+#endif /*_IP6T_MH_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv6/ip6t_multiport.h b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_multiport.h
new file mode 100644
index 0000000..042c926
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_multiport.h
@@ -0,0 +1,14 @@
+#ifndef _IP6T_MULTIPORT_H
+#define _IP6T_MULTIPORT_H
+
+#include <linux/netfilter/xt_multiport.h>
+
+#define IP6T_MULTIPORT_SOURCE XT_MULTIPORT_SOURCE
+#define IP6T_MULTIPORT_DESTINATION XT_MULTIPORT_DESTINATION
+#define IP6T_MULTIPORT_EITHER XT_MULTIPORT_EITHER
+
+#define IP6T_MULTI_PORTS XT_MULTI_PORTS
+
+#define ip6t_multiport xt_multiport
+
+#endif /*_IP6T_MULTIPORT_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv6/ip6t_opts.h b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_opts.h
new file mode 100644
index 0000000..a07e363
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_opts.h
@@ -0,0 +1,23 @@
+#ifndef _IP6T_OPTS_H
+#define _IP6T_OPTS_H
+
+#define IP6T_OPTS_OPTSNR 16
+
+struct ip6t_opts
+{
+ u_int32_t hdrlen; /* Header Length */
+ u_int8_t flags; /* */
+ u_int8_t invflags; /* Inverse flags */
+ u_int16_t opts[IP6T_OPTS_OPTSNR]; /* opts */
+ u_int8_t optsnr; /* Nr of OPts */
+};
+
+#define IP6T_OPTS_LEN 0x01
+#define IP6T_OPTS_OPTS 0x02
+#define IP6T_OPTS_NSTRICT 0x04
+
+/* Values for "invflags" field in struct ip6t_rt. */
+#define IP6T_OPTS_INV_LEN 0x01 /* Invert the sense of length. */
+#define IP6T_OPTS_INV_MASK 0x01 /* All possible flags. */
+
+#endif /*_IP6T_OPTS_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv6/ip6t_owner.h b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_owner.h
new file mode 100644
index 0000000..19937da
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_owner.h
@@ -0,0 +1,18 @@
+#ifndef _IP6T_OWNER_H
+#define _IP6T_OWNER_H
+
+/* match and invert flags */
+#define IP6T_OWNER_UID 0x01
+#define IP6T_OWNER_GID 0x02
+#define IP6T_OWNER_PID 0x04
+#define IP6T_OWNER_SID 0x08
+
+struct ip6t_owner_info {
+ uid_t uid;
+ gid_t gid;
+ pid_t pid;
+ pid_t sid;
+ u_int8_t match, invert; /* flags */
+};
+
+#endif /*_IPT_OWNER_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv6/ip6t_physdev.h b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_physdev.h
new file mode 100644
index 0000000..c161c0a
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_physdev.h
@@ -0,0 +1,17 @@
+#ifndef _IP6T_PHYSDEV_H
+#define _IP6T_PHYSDEV_H
+
+/* Backwards compatibility for old userspace */
+
+#include <linux/netfilter/xt_physdev.h>
+
+#define IP6T_PHYSDEV_OP_IN XT_PHYSDEV_OP_IN
+#define IP6T_PHYSDEV_OP_OUT XT_PHYSDEV_OP_OUT
+#define IP6T_PHYSDEV_OP_BRIDGED XT_PHYSDEV_OP_BRIDGED
+#define IP6T_PHYSDEV_OP_ISIN XT_PHYSDEV_OP_ISIN
+#define IP6T_PHYSDEV_OP_ISOUT XT_PHYSDEV_OP_ISOUT
+#define IP6T_PHYSDEV_OP_MASK XT_PHYSDEV_OP_MASK
+
+#define ip6t_physdev_info xt_physdev_info
+
+#endif /*_IP6T_PHYSDEV_H*/
diff --git a/sysroot/usr/include/linux/netfilter_ipv6/ip6t_policy.h b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_policy.h
new file mode 100644
index 0000000..6bab316
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_policy.h
@@ -0,0 +1,21 @@
+#ifndef _IP6T_POLICY_H
+#define _IP6T_POLICY_H
+
+#define IP6T_POLICY_MAX_ELEM XT_POLICY_MAX_ELEM
+
+/* ip6t_policy_flags */
+#define IP6T_POLICY_MATCH_IN XT_POLICY_MATCH_IN
+#define IP6T_POLICY_MATCH_OUT XT_POLICY_MATCH_OUT
+#define IP6T_POLICY_MATCH_NONE XT_POLICY_MATCH_NONE
+#define IP6T_POLICY_MATCH_STRICT XT_POLICY_MATCH_STRICT
+
+/* ip6t_policy_modes */
+#define IP6T_POLICY_MODE_TRANSPORT XT_POLICY_MODE_TRANSPORT
+#define IP6T_POLICY_MODE_TUNNEL XT_POLICY_MODE_TUNNEL
+
+#define ip6t_policy_spec xt_policy_spec
+#define ip6t_policy_addr xt_policy_addr
+#define ip6t_policy_elem xt_policy_elem
+#define ip6t_policy_info xt_policy_info
+
+#endif /* _IP6T_POLICY_H */
diff --git a/sysroot/usr/include/linux/netfilter_ipv6/ip6t_rt.h b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_rt.h
new file mode 100644
index 0000000..5215602
--- /dev/null
+++ b/sysroot/usr/include/linux/netfilter_ipv6/ip6t_rt.h
@@ -0,0 +1,33 @@
+#ifndef _IP6T_RT_H
+#define _IP6T_RT_H
+
+/*#include <linux/in6.h>*/
+
+#define IP6T_RT_HOPS 16
+
+struct ip6t_rt
+{
+ u_int32_t rt_type; /* Routing Type */
+ u_int32_t segsleft[2]; /* Segments Left */
+ u_int32_t hdrlen; /* Header Length */
+ u_int8_t flags; /* */
+ u_int8_t invflags; /* Inverse flags */
+ struct in6_addr addrs[IP6T_RT_HOPS]; /* Hops */
+ u_int8_t addrnr; /* Nr of Addresses */
+};
+
+#define IP6T_RT_TYP 0x01
+#define IP6T_RT_SGS 0x02
+#define IP6T_RT_LEN 0x04
+#define IP6T_RT_RES 0x08
+#define IP6T_RT_FST_MASK 0x30
+#define IP6T_RT_FST 0x10
+#define IP6T_RT_FST_NSTRICT 0x20
+
+/* Values for "invflags" field in struct ip6t_rt. */
+#define IP6T_RT_INV_TYP 0x01 /* Invert the sense of type. */
+#define IP6T_RT_INV_SGS 0x02 /* Invert the sense of Segments. */
+#define IP6T_RT_INV_LEN 0x04 /* Invert the sense of length. */
+#define IP6T_RT_INV_MASK 0x07 /* All possible flags. */
+
+#endif /*_IP6T_RT_H*/
diff --git a/sysroot/usr/include/linux/netlink.h b/sysroot/usr/include/linux/netlink.h
new file mode 100644
index 0000000..5593f05
--- /dev/null
+++ b/sysroot/usr/include/linux/netlink.h
@@ -0,0 +1,153 @@
+#ifndef __LINUX_NETLINK_H
+#define __LINUX_NETLINK_H
+
+#include <linux/socket.h> /* for sa_family_t */
+#include <linux/types.h>
+
+#define NETLINK_ROUTE 0 /* Routing/device hook */
+#define NETLINK_UNUSED 1 /* Unused number */
+#define NETLINK_USERSOCK 2 /* Reserved for user mode socket protocols */
+#define NETLINK_FIREWALL 3 /* Firewalling hook */
+#define NETLINK_INET_DIAG 4 /* INET socket monitoring */
+#define NETLINK_NFLOG 5 /* netfilter/iptables ULOG */
+#define NETLINK_XFRM 6 /* ipsec */
+#define NETLINK_SELINUX 7 /* SELinux event notifications */
+#define NETLINK_ISCSI 8 /* Open-iSCSI */
+#define NETLINK_AUDIT 9 /* auditing */
+#define NETLINK_FIB_LOOKUP 10
+#define NETLINK_CONNECTOR 11
+#define NETLINK_NETFILTER 12 /* netfilter subsystem */
+#define NETLINK_IP6_FW 13
+#define NETLINK_DNRTMSG 14 /* DECnet routing messages */
+#define NETLINK_KOBJECT_UEVENT 15 /* Kernel messages to userspace */
+#define NETLINK_GENERIC 16
+/* leave room for NETLINK_DM (DM Events) */
+#define NETLINK_SCSITRANSPORT 18 /* SCSI Transports */
+#define NETLINK_ECRYPTFS 19
+
+#define MAX_LINKS 32
+
+struct net;
+
+struct sockaddr_nl
+{
+ sa_family_t nl_family; /* AF_NETLINK */
+ unsigned short nl_pad; /* zero */
+ __u32 nl_pid; /* port ID */
+ __u32 nl_groups; /* multicast groups mask */
+};
+
+struct nlmsghdr
+{
+ __u32 nlmsg_len; /* Length of message including header */
+ __u16 nlmsg_type; /* Message content */
+ __u16 nlmsg_flags; /* Additional flags */
+ __u32 nlmsg_seq; /* Sequence number */
+ __u32 nlmsg_pid; /* Sending process port ID */
+};
+
+/* Flags values */
+
+#define NLM_F_REQUEST 1 /* It is request message. */
+#define NLM_F_MULTI 2 /* Multipart message, terminated by NLMSG_DONE */
+#define NLM_F_ACK 4 /* Reply with ack, with zero or error code */
+#define NLM_F_ECHO 8 /* Echo this request */
+
+/* Modifiers to GET request */
+#define NLM_F_ROOT 0x100 /* specify tree root */
+#define NLM_F_MATCH 0x200 /* return all matching */
+#define NLM_F_ATOMIC 0x400 /* atomic GET */
+#define NLM_F_DUMP (NLM_F_ROOT|NLM_F_MATCH)
+
+/* Modifiers to NEW request */
+#define NLM_F_REPLACE 0x100 /* Override existing */
+#define NLM_F_EXCL 0x200 /* Do not touch, if it exists */
+#define NLM_F_CREATE 0x400 /* Create, if it does not exist */
+#define NLM_F_APPEND 0x800 /* Add to end of list */
+
+/*
+ 4.4BSD ADD NLM_F_CREATE|NLM_F_EXCL
+ 4.4BSD CHANGE NLM_F_REPLACE
+
+ True CHANGE NLM_F_CREATE|NLM_F_REPLACE
+ Append NLM_F_CREATE
+ Check NLM_F_EXCL
+ */
+
+#define NLMSG_ALIGNTO 4
+#define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) )
+#define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr)))
+#define NLMSG_LENGTH(len) ((len)+NLMSG_ALIGN(NLMSG_HDRLEN))
+#define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len))
+#define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0)))
+#define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \
+ (struct nlmsghdr*)(((char*)(nlh)) + NLMSG_ALIGN((nlh)->nlmsg_len)))
+#define NLMSG_OK(nlh,len) ((len) >= (int)sizeof(struct nlmsghdr) && \
+ (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \
+ (nlh)->nlmsg_len <= (len))
+#define NLMSG_PAYLOAD(nlh,len) ((nlh)->nlmsg_len - NLMSG_SPACE((len)))
+
+#define NLMSG_NOOP 0x1 /* Nothing. */
+#define NLMSG_ERROR 0x2 /* Error */
+#define NLMSG_DONE 0x3 /* End of a dump */
+#define NLMSG_OVERRUN 0x4 /* Data lost */
+
+#define NLMSG_MIN_TYPE 0x10 /* < 0x10: reserved control messages */
+
+struct nlmsgerr
+{
+ int error;
+ struct nlmsghdr msg;
+};
+
+#define NETLINK_ADD_MEMBERSHIP 1
+#define NETLINK_DROP_MEMBERSHIP 2
+#define NETLINK_PKTINFO 3
+
+struct nl_pktinfo
+{
+ __u32 group;
+};
+
+#define NET_MAJOR 36 /* Major 36 is reserved for networking */
+
+enum {
+ NETLINK_UNCONNECTED = 0,
+ NETLINK_CONNECTED,
+};
+
+/*
+ * <------- NLA_HDRLEN ------> <-- NLA_ALIGN(payload)-->
+ * +---------------------+- - -+- - - - - - - - - -+- - -+
+ * | Header | Pad | Payload | Pad |
+ * | (struct nlattr) | ing | | ing |
+ * +---------------------+- - -+- - - - - - - - - -+- - -+
+ * <-------------- nlattr->nla_len -------------->
+ */
+
+struct nlattr
+{
+ __u16 nla_len;
+ __u16 nla_type;
+};
+
+/*
+ * nla_type (16 bits)
+ * +---+---+-------------------------------+
+ * | N | O | Attribute Type |
+ * +---+---+-------------------------------+
+ * N := Carries nested attributes
+ * O := Payload stored in network byte order
+ *
+ * Note: The N and O flag are mutually exclusive.
+ */
+#define NLA_F_NESTED (1 << 15)
+#define NLA_F_NET_BYTEORDER (1 << 14)
+#define NLA_TYPE_MASK ~(NLA_F_NESTED | NLA_F_NET_BYTEORDER)
+
+#define NLA_ALIGNTO 4
+#define NLA_ALIGN(len) (((len) + NLA_ALIGNTO - 1) & ~(NLA_ALIGNTO - 1))
+#define NLA_HDRLEN ((int) NLA_ALIGN(sizeof(struct nlattr)))
+
+
+#endif /* __LINUX_NETLINK_H */
diff --git a/sysroot/usr/include/linux/netrom.h b/sysroot/usr/include/linux/netrom.h
new file mode 100644
index 0000000..6939b32
--- /dev/null
+++ b/sysroot/usr/include/linux/netrom.h
@@ -0,0 +1,34 @@
+/*
+ * These are the public elements of the Linux kernel NET/ROM implementation.
+ * For kernel AX.25 see the file ax25.h. This file requires ax25.h for the
+ * definition of the ax25_address structure.
+ */
+
+#ifndef NETROM_KERNEL_H
+#define NETROM_KERNEL_H
+
+#define NETROM_MTU 236
+
+#define NETROM_T1 1
+#define NETROM_T2 2
+#define NETROM_N2 3
+#define NETROM_T4 6
+#define NETROM_IDLE 7
+
+#define SIOCNRDECOBS (SIOCPROTOPRIVATE+2)
+
+struct nr_route_struct {
+#define NETROM_NEIGH 0
+#define NETROM_NODE 1
+ int type;
+ ax25_address callsign;
+ char device[16];
+ unsigned int quality;
+ char mnemonic[7];
+ ax25_address neighbour;
+ unsigned int obs_count;
+ unsigned int ndigis;
+ ax25_address digipeaters[AX25_MAX_DIGIS];
+};
+
+#endif
diff --git a/sysroot/usr/include/linux/nfs.h b/sysroot/usr/include/linux/nfs.h
new file mode 100644
index 0000000..84fad5e
--- /dev/null
+++ b/sysroot/usr/include/linux/nfs.h
@@ -0,0 +1,129 @@
+/*
+ * NFS protocol definitions
+ *
+ * This file contains constants mostly for Version 2 of the protocol,
+ * but also has a couple of NFSv3 bits in (notably the error codes).
+ */
+#ifndef _LINUX_NFS_H
+#define _LINUX_NFS_H
+
+#define NFS_PROGRAM 100003
+#define NFS_PORT 2049
+#define NFS_MAXDATA 8192
+#define NFS_MAXPATHLEN 1024
+#define NFS_MAXNAMLEN 255
+#define NFS_MAXGROUPS 16
+#define NFS_FHSIZE 32
+#define NFS_COOKIESIZE 4
+#define NFS_FIFO_DEV (-1)
+#define NFSMODE_FMT 0170000
+#define NFSMODE_DIR 0040000
+#define NFSMODE_CHR 0020000
+#define NFSMODE_BLK 0060000
+#define NFSMODE_REG 0100000
+#define NFSMODE_LNK 0120000
+#define NFSMODE_SOCK 0140000
+#define NFSMODE_FIFO 0010000
+
+#define NFS_MNT_PROGRAM 100005
+#define NFS_MNT_PORT 627
+
+/*
+ * NFS stats. The good thing with these values is that NFSv3 errors are
+ * a superset of NFSv2 errors (with the exception of NFSERR_WFLUSH which
+ * no-one uses anyway), so we can happily mix code as long as we make sure
+ * no NFSv3 errors are returned to NFSv2 clients.
+ * Error codes that have a `--' in the v2 column are not part of the
+ * standard, but seem to be widely used nevertheless.
+ */
+ enum nfs_stat {
+ NFS_OK = 0, /* v2 v3 v4 */
+ NFSERR_PERM = 1, /* v2 v3 v4 */
+ NFSERR_NOENT = 2, /* v2 v3 v4 */
+ NFSERR_IO = 5, /* v2 v3 v4 */
+ NFSERR_NXIO = 6, /* v2 v3 v4 */
+ NFSERR_EAGAIN = 11, /* v2 v3 */
+ NFSERR_ACCES = 13, /* v2 v3 v4 */
+ NFSERR_EXIST = 17, /* v2 v3 v4 */
+ NFSERR_XDEV = 18, /* v3 v4 */
+ NFSERR_NODEV = 19, /* v2 v3 v4 */
+ NFSERR_NOTDIR = 20, /* v2 v3 v4 */
+ NFSERR_ISDIR = 21, /* v2 v3 v4 */
+ NFSERR_INVAL = 22, /* v2 v3 v4 */
+ NFSERR_FBIG = 27, /* v2 v3 v4 */
+ NFSERR_NOSPC = 28, /* v2 v3 v4 */
+ NFSERR_ROFS = 30, /* v2 v3 v4 */
+ NFSERR_MLINK = 31, /* v3 v4 */
+ NFSERR_OPNOTSUPP = 45, /* v2 v3 */
+ NFSERR_NAMETOOLONG = 63, /* v2 v3 v4 */
+ NFSERR_NOTEMPTY = 66, /* v2 v3 v4 */
+ NFSERR_DQUOT = 69, /* v2 v3 v4 */
+ NFSERR_STALE = 70, /* v2 v3 v4 */
+ NFSERR_REMOTE = 71, /* v2 v3 */
+ NFSERR_WFLUSH = 99, /* v2 */
+ NFSERR_BADHANDLE = 10001, /* v3 v4 */
+ NFSERR_NOT_SYNC = 10002, /* v3 */
+ NFSERR_BAD_COOKIE = 10003, /* v3 v4 */
+ NFSERR_NOTSUPP = 10004, /* v3 v4 */
+ NFSERR_TOOSMALL = 10005, /* v3 v4 */
+ NFSERR_SERVERFAULT = 10006, /* v3 v4 */
+ NFSERR_BADTYPE = 10007, /* v3 v4 */
+ NFSERR_JUKEBOX = 10008, /* v3 v4 */
+ NFSERR_SAME = 10009, /* v4 */
+ NFSERR_DENIED = 10010, /* v4 */
+ NFSERR_EXPIRED = 10011, /* v4 */
+ NFSERR_LOCKED = 10012, /* v4 */
+ NFSERR_GRACE = 10013, /* v4 */
+ NFSERR_FHEXPIRED = 10014, /* v4 */
+ NFSERR_SHARE_DENIED = 10015, /* v4 */
+ NFSERR_WRONGSEC = 10016, /* v4 */
+ NFSERR_CLID_INUSE = 10017, /* v4 */
+ NFSERR_RESOURCE = 10018, /* v4 */
+ NFSERR_MOVED = 10019, /* v4 */
+ NFSERR_NOFILEHANDLE = 10020, /* v4 */
+ NFSERR_MINOR_VERS_MISMATCH = 10021, /* v4 */
+ NFSERR_STALE_CLIENTID = 10022, /* v4 */
+ NFSERR_STALE_STATEID = 10023, /* v4 */
+ NFSERR_OLD_STATEID = 10024, /* v4 */
+ NFSERR_BAD_STATEID = 10025, /* v4 */
+ NFSERR_BAD_SEQID = 10026, /* v4 */
+ NFSERR_NOT_SAME = 10027, /* v4 */
+ NFSERR_LOCK_RANGE = 10028, /* v4 */
+ NFSERR_SYMLINK = 10029, /* v4 */
+ NFSERR_RESTOREFH = 10030, /* v4 */
+ NFSERR_LEASE_MOVED = 10031, /* v4 */
+ NFSERR_ATTRNOTSUPP = 10032, /* v4 */
+ NFSERR_NO_GRACE = 10033, /* v4 */
+ NFSERR_RECLAIM_BAD = 10034, /* v4 */
+ NFSERR_RECLAIM_CONFLICT = 10035,/* v4 */
+ NFSERR_BAD_XDR = 10036, /* v4 */
+ NFSERR_LOCKS_HELD = 10037, /* v4 */
+ NFSERR_OPENMODE = 10038, /* v4 */
+ NFSERR_BADOWNER = 10039, /* v4 */
+ NFSERR_BADCHAR = 10040, /* v4 */
+ NFSERR_BADNAME = 10041, /* v4 */
+ NFSERR_BAD_RANGE = 10042, /* v4 */
+ NFSERR_LOCK_NOTSUPP = 10043, /* v4 */
+ NFSERR_OP_ILLEGAL = 10044, /* v4 */
+ NFSERR_DEADLOCK = 10045, /* v4 */
+ NFSERR_FILE_OPEN = 10046, /* v4 */
+ NFSERR_ADMIN_REVOKED = 10047, /* v4 */
+ NFSERR_CB_PATH_DOWN = 10048, /* v4 */
+ NFSERR_REPLAY_ME = 10049 /* v4 */
+};
+
+/* NFSv2 file types - beware, these are not the same in NFSv3 */
+
+enum nfs_ftype {
+ NFNON = 0,
+ NFREG = 1,
+ NFDIR = 2,
+ NFBLK = 3,
+ NFCHR = 4,
+ NFLNK = 5,
+ NFSOCK = 6,
+ NFBAD = 7,
+ NFFIFO = 8
+};
+
+#endif /* _LINUX_NFS_H */
diff --git a/sysroot/usr/include/linux/nfs2.h b/sysroot/usr/include/linux/nfs2.h
new file mode 100644
index 0000000..0ed9517
--- /dev/null
+++ b/sysroot/usr/include/linux/nfs2.h
@@ -0,0 +1,74 @@
+/*
+ * NFS protocol definitions
+ *
+ * This file contains constants for Version 2 of the protocol.
+ */
+#ifndef _LINUX_NFS2_H
+#define _LINUX_NFS2_H
+
+#define NFS2_PORT 2049
+#define NFS2_MAXDATA 8192
+#define NFS2_MAXPATHLEN 1024
+#define NFS2_MAXNAMLEN 255
+#define NFS2_MAXGROUPS 16
+#define NFS2_FHSIZE 32
+#define NFS2_COOKIESIZE 4
+#define NFS2_FIFO_DEV (-1)
+#define NFS2MODE_FMT 0170000
+#define NFS2MODE_DIR 0040000
+#define NFS2MODE_CHR 0020000
+#define NFS2MODE_BLK 0060000
+#define NFS2MODE_REG 0100000
+#define NFS2MODE_LNK 0120000
+#define NFS2MODE_SOCK 0140000
+#define NFS2MODE_FIFO 0010000
+
+
+/* NFSv2 file types - beware, these are not the same in NFSv3 */
+enum nfs2_ftype {
+ NF2NON = 0,
+ NF2REG = 1,
+ NF2DIR = 2,
+ NF2BLK = 3,
+ NF2CHR = 4,
+ NF2LNK = 5,
+ NF2SOCK = 6,
+ NF2BAD = 7,
+ NF2FIFO = 8
+};
+
+struct nfs2_fh {
+ char data[NFS2_FHSIZE];
+};
+
+/*
+ * Procedure numbers for NFSv2
+ */
+#define NFS2_VERSION 2
+#define NFSPROC_NULL 0
+#define NFSPROC_GETATTR 1
+#define NFSPROC_SETATTR 2
+#define NFSPROC_ROOT 3
+#define NFSPROC_LOOKUP 4
+#define NFSPROC_READLINK 5
+#define NFSPROC_READ 6
+#define NFSPROC_WRITECACHE 7
+#define NFSPROC_WRITE 8
+#define NFSPROC_CREATE 9
+#define NFSPROC_REMOVE 10
+#define NFSPROC_RENAME 11
+#define NFSPROC_LINK 12
+#define NFSPROC_SYMLINK 13
+#define NFSPROC_MKDIR 14
+#define NFSPROC_RMDIR 15
+#define NFSPROC_READDIR 16
+#define NFSPROC_STATFS 17
+
+#define NFS_MNT_PROGRAM 100005
+#define NFS_MNT_VERSION 1
+#define MNTPROC_NULL 0
+#define MNTPROC_MNT 1
+#define MNTPROC_UMNT 3
+#define MNTPROC_UMNTALL 4
+
+#endif /* _LINUX_NFS2_H */
diff --git a/sysroot/usr/include/linux/nfs3.h b/sysroot/usr/include/linux/nfs3.h
new file mode 100644
index 0000000..7f11fa5
--- /dev/null
+++ b/sysroot/usr/include/linux/nfs3.h
@@ -0,0 +1,105 @@
+/*
+ * NFSv3 protocol definitions
+ */
+#ifndef _LINUX_NFS3_H
+#define _LINUX_NFS3_H
+
+#define NFS3_PORT 2049
+#define NFS3_MAXDATA 32768
+#define NFS3_MAXPATHLEN PATH_MAX
+#define NFS3_MAXNAMLEN NAME_MAX
+#define NFS3_MAXGROUPS 16
+#define NFS3_FHSIZE 64
+#define NFS3_COOKIESIZE 4
+#define NFS3_FIFO_DEV (-1)
+#define NFS3MODE_FMT 0170000
+#define NFS3MODE_DIR 0040000
+#define NFS3MODE_CHR 0020000
+#define NFS3MODE_BLK 0060000
+#define NFS3MODE_REG 0100000
+#define NFS3MODE_LNK 0120000
+#define NFS3MODE_SOCK 0140000
+#define NFS3MODE_FIFO 0010000
+
+/* Flags for access() call */
+#define NFS3_ACCESS_READ 0x0001
+#define NFS3_ACCESS_LOOKUP 0x0002
+#define NFS3_ACCESS_MODIFY 0x0004
+#define NFS3_ACCESS_EXTEND 0x0008
+#define NFS3_ACCESS_DELETE 0x0010
+#define NFS3_ACCESS_EXECUTE 0x0020
+#define NFS3_ACCESS_FULL 0x003f
+
+/* Flags for create mode */
+enum nfs3_createmode {
+ NFS3_CREATE_UNCHECKED = 0,
+ NFS3_CREATE_GUARDED = 1,
+ NFS3_CREATE_EXCLUSIVE = 2
+};
+
+/* NFSv3 file system properties */
+#define NFS3_FSF_LINK 0x0001
+#define NFS3_FSF_SYMLINK 0x0002
+#define NFS3_FSF_HOMOGENEOUS 0x0008
+#define NFS3_FSF_CANSETTIME 0x0010
+/* Some shorthands. See fs/nfsd/nfs3proc.c */
+#define NFS3_FSF_DEFAULT 0x001B
+#define NFS3_FSF_BILLYBOY 0x0018
+#define NFS3_FSF_READONLY 0x0008
+
+enum nfs3_ftype {
+ NF3NON = 0,
+ NF3REG = 1,
+ NF3DIR = 2,
+ NF3BLK = 3,
+ NF3CHR = 4,
+ NF3LNK = 5,
+ NF3SOCK = 6,
+ NF3FIFO = 7, /* changed from NFSv2 (was 8) */
+ NF3BAD = 8
+};
+
+struct nfs3_fh {
+ unsigned short size;
+ unsigned char data[NFS3_FHSIZE];
+};
+
+#define NFS3_VERSION 3
+#define NFS3PROC_NULL 0
+#define NFS3PROC_GETATTR 1
+#define NFS3PROC_SETATTR 2
+#define NFS3PROC_LOOKUP 3
+#define NFS3PROC_ACCESS 4
+#define NFS3PROC_READLINK 5
+#define NFS3PROC_READ 6
+#define NFS3PROC_WRITE 7
+#define NFS3PROC_CREATE 8
+#define NFS3PROC_MKDIR 9
+#define NFS3PROC_SYMLINK 10
+#define NFS3PROC_MKNOD 11
+#define NFS3PROC_REMOVE 12
+#define NFS3PROC_RMDIR 13
+#define NFS3PROC_RENAME 14
+#define NFS3PROC_LINK 15
+#define NFS3PROC_READDIR 16
+#define NFS3PROC_READDIRPLUS 17
+#define NFS3PROC_FSSTAT 18
+#define NFS3PROC_FSINFO 19
+#define NFS3PROC_PATHCONF 20
+#define NFS3PROC_COMMIT 21
+
+#define NFS_MNT3_PROGRAM 100005
+#define NFS_MNT3_VERSION 3
+#define MOUNTPROC3_NULL 0
+#define MOUNTPROC3_MNT 1
+#define MOUNTPROC3_UMNT 3
+#define MOUNTPROC3_UMNTALL 4
+
+
+#if defined(__KERNEL__) || defined(NFS_NEED_KERNEL_TYPES)
+
+/* Number of 32bit words in post_op_attr */
+#define NFS3_POST_OP_ATTR_WORDS 22
+
+#endif /* __KERNEL__ */
+#endif /* _LINUX_NFS3_H */
diff --git a/sysroot/usr/include/linux/nfs4.h b/sysroot/usr/include/linux/nfs4.h
new file mode 100644
index 0000000..c9095da
--- /dev/null
+++ b/sysroot/usr/include/linux/nfs4.h
@@ -0,0 +1,107 @@
+/*
+ * include/linux/nfs4.h
+ *
+ * NFSv4 protocol definitions.
+ *
+ * Copyright (c) 2002 The Regents of the University of Michigan.
+ * All rights reserved.
+ *
+ * Kendrick Smith <kmsmith@umich.edu>
+ * Andy Adamson <andros@umich.edu>
+ */
+
+#ifndef _LINUX_NFS4_H
+#define _LINUX_NFS4_H
+
+#include <linux/types.h>
+
+#define NFS4_BITMAP_SIZE 2
+#define NFS4_VERIFIER_SIZE 8
+#define NFS4_STATEID_SIZE 16
+#define NFS4_FHSIZE 128
+#define NFS4_MAXPATHLEN PATH_MAX
+#define NFS4_MAXNAMLEN NAME_MAX
+
+#define NFS4_ACCESS_READ 0x0001
+#define NFS4_ACCESS_LOOKUP 0x0002
+#define NFS4_ACCESS_MODIFY 0x0004
+#define NFS4_ACCESS_EXTEND 0x0008
+#define NFS4_ACCESS_DELETE 0x0010
+#define NFS4_ACCESS_EXECUTE 0x0020
+
+#define NFS4_FH_PERSISTENT 0x0000
+#define NFS4_FH_NOEXPIRE_WITH_OPEN 0x0001
+#define NFS4_FH_VOLATILE_ANY 0x0002
+#define NFS4_FH_VOL_MIGRATION 0x0004
+#define NFS4_FH_VOL_RENAME 0x0008
+
+#define NFS4_OPEN_RESULT_CONFIRM 0x0002
+#define NFS4_OPEN_RESULT_LOCKTYPE_POSIX 0x0004
+
+#define NFS4_SHARE_ACCESS_READ 0x0001
+#define NFS4_SHARE_ACCESS_WRITE 0x0002
+#define NFS4_SHARE_ACCESS_BOTH 0x0003
+#define NFS4_SHARE_DENY_READ 0x0001
+#define NFS4_SHARE_DENY_WRITE 0x0002
+#define NFS4_SHARE_DENY_BOTH 0x0003
+
+#define NFS4_SET_TO_SERVER_TIME 0
+#define NFS4_SET_TO_CLIENT_TIME 1
+
+#define NFS4_ACE_ACCESS_ALLOWED_ACE_TYPE 0
+#define NFS4_ACE_ACCESS_DENIED_ACE_TYPE 1
+#define NFS4_ACE_SYSTEM_AUDIT_ACE_TYPE 2
+#define NFS4_ACE_SYSTEM_ALARM_ACE_TYPE 3
+
+#define ACL4_SUPPORT_ALLOW_ACL 0x01
+#define ACL4_SUPPORT_DENY_ACL 0x02
+#define ACL4_SUPPORT_AUDIT_ACL 0x04
+#define ACL4_SUPPORT_ALARM_ACL 0x08
+
+#define NFS4_ACE_FILE_INHERIT_ACE 0x00000001
+#define NFS4_ACE_DIRECTORY_INHERIT_ACE 0x00000002
+#define NFS4_ACE_NO_PROPAGATE_INHERIT_ACE 0x00000004
+#define NFS4_ACE_INHERIT_ONLY_ACE 0x00000008
+#define NFS4_ACE_SUCCESSFUL_ACCESS_ACE_FLAG 0x00000010
+#define NFS4_ACE_FAILED_ACCESS_ACE_FLAG 0x00000020
+#define NFS4_ACE_IDENTIFIER_GROUP 0x00000040
+#define NFS4_ACE_OWNER 0x00000080
+#define NFS4_ACE_GROUP 0x00000100
+#define NFS4_ACE_EVERYONE 0x00000200
+
+#define NFS4_ACE_READ_DATA 0x00000001
+#define NFS4_ACE_LIST_DIRECTORY 0x00000001
+#define NFS4_ACE_WRITE_DATA 0x00000002
+#define NFS4_ACE_ADD_FILE 0x00000002
+#define NFS4_ACE_APPEND_DATA 0x00000004
+#define NFS4_ACE_ADD_SUBDIRECTORY 0x00000004
+#define NFS4_ACE_READ_NAMED_ATTRS 0x00000008
+#define NFS4_ACE_WRITE_NAMED_ATTRS 0x00000010
+#define NFS4_ACE_EXECUTE 0x00000020
+#define NFS4_ACE_DELETE_CHILD 0x00000040
+#define NFS4_ACE_READ_ATTRIBUTES 0x00000080
+#define NFS4_ACE_WRITE_ATTRIBUTES 0x00000100
+#define NFS4_ACE_DELETE 0x00010000
+#define NFS4_ACE_READ_ACL 0x00020000
+#define NFS4_ACE_WRITE_ACL 0x00040000
+#define NFS4_ACE_WRITE_OWNER 0x00080000
+#define NFS4_ACE_SYNCHRONIZE 0x00100000
+#define NFS4_ACE_GENERIC_READ 0x00120081
+#define NFS4_ACE_GENERIC_WRITE 0x00160106
+#define NFS4_ACE_GENERIC_EXECUTE 0x001200A0
+#define NFS4_ACE_MASK_ALL 0x001F01FF
+
+enum nfs4_acl_whotype {
+ NFS4_ACL_WHO_NAMED = 0,
+ NFS4_ACL_WHO_OWNER,
+ NFS4_ACL_WHO_GROUP,
+ NFS4_ACL_WHO_EVERYONE,
+};
+
+#endif
+
+/*
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */
diff --git a/sysroot/usr/include/linux/nfs4_mount.h b/sysroot/usr/include/linux/nfs4_mount.h
new file mode 100644
index 0000000..f4ff32d
--- /dev/null
+++ b/sysroot/usr/include/linux/nfs4_mount.h
@@ -0,0 +1,71 @@
+#ifndef _LINUX_NFS4_MOUNT_H
+#define _LINUX_NFS4_MOUNT_H
+
+/*
+ * linux/include/linux/nfs4_mount.h
+ *
+ * Copyright (C) 2002 Trond Myklebust
+ *
+ * structure passed from user-space to kernel-space during an nfsv4 mount
+ */
+
+/*
+ * WARNING! Do not delete or change the order of these fields. If
+ * a new field is required then add it to the end. The version field
+ * tracks which fields are present. This will ensure some measure of
+ * mount-to-kernel version compatibility. Some of these aren't used yet
+ * but here they are anyway.
+ */
+#define NFS4_MOUNT_VERSION 1
+
+struct nfs_string {
+ unsigned int len;
+ const char * data;
+};
+
+struct nfs4_mount_data {
+ int version; /* 1 */
+ int flags; /* 1 */
+ int rsize; /* 1 */
+ int wsize; /* 1 */
+ int timeo; /* 1 */
+ int retrans; /* 1 */
+ int acregmin; /* 1 */
+ int acregmax; /* 1 */
+ int acdirmin; /* 1 */
+ int acdirmax; /* 1 */
+
+ /* see the definition of 'struct clientaddr4' in RFC3010 */
+ struct nfs_string client_addr; /* 1 */
+
+ /* Mount path */
+ struct nfs_string mnt_path; /* 1 */
+
+ /* Server details */
+ struct nfs_string hostname; /* 1 */
+ /* Server IP address */
+ unsigned int host_addrlen; /* 1 */
+ struct sockaddr * host_addr; /* 1 */
+
+ /* Transport protocol to use */
+ int proto; /* 1 */
+
+ /* Pseudo-flavours to use for authentication. See RFC2623 */
+ int auth_flavourlen; /* 1 */
+ int *auth_flavours; /* 1 */
+};
+
+/* bits in the flags field */
+/* Note: the fields that correspond to existing NFSv2/v3 mount options
+ * should mirror the values from include/linux/nfs_mount.h
+ */
+
+#define NFS4_MOUNT_SOFT 0x0001 /* 1 */
+#define NFS4_MOUNT_INTR 0x0002 /* 1 */
+#define NFS4_MOUNT_NOCTO 0x0010 /* 1 */
+#define NFS4_MOUNT_NOAC 0x0020 /* 1 */
+#define NFS4_MOUNT_STRICTLOCK 0x1000 /* 1 */
+#define NFS4_MOUNT_UNSHARED 0x8000 /* 1 */
+#define NFS4_MOUNT_FLAGMASK 0x9033
+
+#endif
diff --git a/sysroot/usr/include/linux/nfs_fs.h b/sysroot/usr/include/linux/nfs_fs.h
new file mode 100644
index 0000000..540620a
--- /dev/null
+++ b/sysroot/usr/include/linux/nfs_fs.h
@@ -0,0 +1,48 @@
+/*
+ * linux/include/linux/nfs_fs.h
+ *
+ * Copyright (C) 1992 Rick Sladkey
+ *
+ * OS-specific nfs filesystem definitions and declarations
+ */
+
+#ifndef _LINUX_NFS_FS_H
+#define _LINUX_NFS_FS_H
+
+#include <linux/magic.h>
+
+/* Default timeout values */
+#define NFS_MAX_UDP_TIMEOUT (60*HZ)
+#define NFS_MAX_TCP_TIMEOUT (600*HZ)
+
+/*
+ * When flushing a cluster of dirty pages, there can be different
+ * strategies:
+ */
+#define FLUSH_SYNC 1 /* file being synced, or contention */
+#define FLUSH_STABLE 4 /* commit to stable storage */
+#define FLUSH_LOWPRI 8 /* low priority background flush */
+#define FLUSH_HIGHPRI 16 /* high priority memory reclaim flush */
+#define FLUSH_NOCOMMIT 32 /* Don't send the NFSv3/v4 COMMIT */
+#define FLUSH_INVALIDATE 64 /* Invalidate the page cache */
+#define FLUSH_NOWRITEPAGE 128 /* Don't call writepage() */
+
+
+/*
+ * NFS debug flags
+ */
+#define NFSDBG_VFS 0x0001
+#define NFSDBG_DIRCACHE 0x0002
+#define NFSDBG_LOOKUPCACHE 0x0004
+#define NFSDBG_PAGECACHE 0x0008
+#define NFSDBG_PROC 0x0010
+#define NFSDBG_XDR 0x0020
+#define NFSDBG_FILE 0x0040
+#define NFSDBG_ROOT 0x0080
+#define NFSDBG_CALLBACK 0x0100
+#define NFSDBG_CLIENT 0x0200
+#define NFSDBG_MOUNT 0x0400
+#define NFSDBG_ALL 0xFFFF
+
+
+#endif
diff --git a/sysroot/usr/include/linux/nfs_idmap.h b/sysroot/usr/include/linux/nfs_idmap.h
new file mode 100644
index 0000000..feb1f34
--- /dev/null
+++ b/sysroot/usr/include/linux/nfs_idmap.h
@@ -0,0 +1,63 @@
+/*
+ * include/linux/nfs_idmap.h
+ *
+ * UID and GID to name mapping for clients.
+ *
+ * Copyright (c) 2002 The Regents of the University of Michigan.
+ * All rights reserved.
+ *
+ * Marius Aamodt Eriksen <marius@umich.edu>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef NFS_IDMAP_H
+#define NFS_IDMAP_H
+
+/* XXX from bits/utmp.h */
+#define IDMAP_NAMESZ 128
+
+#define IDMAP_TYPE_USER 0
+#define IDMAP_TYPE_GROUP 1
+
+#define IDMAP_CONV_IDTONAME 0
+#define IDMAP_CONV_NAMETOID 1
+
+#define IDMAP_STATUS_INVALIDMSG 0x01
+#define IDMAP_STATUS_AGAIN 0x02
+#define IDMAP_STATUS_LOOKUPFAIL 0x04
+#define IDMAP_STATUS_SUCCESS 0x08
+
+struct idmap_msg {
+ __u8 im_type;
+ __u8 im_conv;
+ char im_name[IDMAP_NAMESZ];
+ __u32 im_id;
+ __u8 im_status;
+};
+
+
+#endif /* NFS_IDMAP_H */
diff --git a/sysroot/usr/include/linux/nfs_mount.h b/sysroot/usr/include/linux/nfs_mount.h
new file mode 100644
index 0000000..a3ade89
--- /dev/null
+++ b/sysroot/usr/include/linux/nfs_mount.h
@@ -0,0 +1,68 @@
+#ifndef _LINUX_NFS_MOUNT_H
+#define _LINUX_NFS_MOUNT_H
+
+/*
+ * linux/include/linux/nfs_mount.h
+ *
+ * Copyright (C) 1992 Rick Sladkey
+ *
+ * structure passed from user-space to kernel-space during an nfs mount
+ */
+#include <linux/in.h>
+#include <linux/nfs.h>
+#include <linux/nfs2.h>
+#include <linux/nfs3.h>
+
+/*
+ * WARNING! Do not delete or change the order of these fields. If
+ * a new field is required then add it to the end. The version field
+ * tracks which fields are present. This will ensure some measure of
+ * mount-to-kernel version compatibility. Some of these aren't used yet
+ * but here they are anyway.
+ */
+#define NFS_MOUNT_VERSION 6
+#define NFS_MAX_CONTEXT_LEN 256
+
+struct nfs_mount_data {
+ int version; /* 1 */
+ int fd; /* 1 */
+ struct nfs2_fh old_root; /* 1 */
+ int flags; /* 1 */
+ int rsize; /* 1 */
+ int wsize; /* 1 */
+ int timeo; /* 1 */
+ int retrans; /* 1 */
+ int acregmin; /* 1 */
+ int acregmax; /* 1 */
+ int acdirmin; /* 1 */
+ int acdirmax; /* 1 */
+ struct sockaddr_in addr; /* 1 */
+ char hostname[NFS_MAXNAMLEN + 1]; /* 1 */
+ int namlen; /* 2 */
+ unsigned int bsize; /* 3 */
+ struct nfs3_fh root; /* 4 */
+ int pseudoflavor; /* 5 */
+ char context[NFS_MAX_CONTEXT_LEN + 1]; /* 6 */
+};
+
+/* bits in the flags field */
+
+#define NFS_MOUNT_SOFT 0x0001 /* 1 */
+#define NFS_MOUNT_INTR 0x0002 /* 1 */
+#define NFS_MOUNT_SECURE 0x0004 /* 1 */
+#define NFS_MOUNT_POSIX 0x0008 /* 1 */
+#define NFS_MOUNT_NOCTO 0x0010 /* 1 */
+#define NFS_MOUNT_NOAC 0x0020 /* 1 */
+#define NFS_MOUNT_TCP 0x0040 /* 2 */
+#define NFS_MOUNT_VER3 0x0080 /* 3 */
+#define NFS_MOUNT_KERBEROS 0x0100 /* 3 */
+#define NFS_MOUNT_NONLM 0x0200 /* 3 */
+#define NFS_MOUNT_BROKEN_SUID 0x0400 /* 4 */
+#define NFS_MOUNT_NOACL 0x0800 /* 4 */
+#define NFS_MOUNT_STRICTLOCK 0x1000 /* reserved for NFSv4 */
+#define NFS_MOUNT_SECFLAVOUR 0x2000 /* 5 */
+#define NFS_MOUNT_NORDIRPLUS 0x4000 /* 5 */
+#define NFS_MOUNT_UNSHARED 0x8000 /* 5 */
+#define NFS_MOUNT_FLAGMASK 0xFFFF
+
+#endif
diff --git a/sysroot/usr/include/linux/nfsacl.h b/sysroot/usr/include/linux/nfsacl.h
new file mode 100644
index 0000000..df5e19f
--- /dev/null
+++ b/sysroot/usr/include/linux/nfsacl.h
@@ -0,0 +1,29 @@
+/*
+ * File: linux/nfsacl.h
+ *
+ * (C) 2003 Andreas Gruenbacher <agruen@suse.de>
+ */
+#ifndef __LINUX_NFSACL_H
+#define __LINUX_NFSACL_H
+
+#define NFS_ACL_PROGRAM 100227
+
+#define ACLPROC2_GETACL 1
+#define ACLPROC2_SETACL 2
+#define ACLPROC2_GETATTR 3
+#define ACLPROC2_ACCESS 4
+
+#define ACLPROC3_GETACL 1
+#define ACLPROC3_SETACL 2
+
+
+/* Flags for the getacl/setacl mode */
+#define NFS_ACL 0x0001
+#define NFS_ACLCNT 0x0002
+#define NFS_DFACL 0x0004
+#define NFS_DFACLCNT 0x0008
+
+/* Flag for Default ACL entries */
+#define NFS_ACL_DEFAULT 0x1000
+
+#endif /* __LINUX_NFSACL_H */
diff --git a/sysroot/usr/include/linux/nfsd/auth.h b/sysroot/usr/include/linux/nfsd/auth.h
new file mode 100644
index 0000000..561a082
--- /dev/null
+++ b/sysroot/usr/include/linux/nfsd/auth.h
@@ -0,0 +1,13 @@
+/*
+ * include/linux/nfsd/auth.h
+ *
+ * nfsd-specific authentication stuff.
+ * uid/gid mapping not yet implemented.
+ *
+ * Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de>
+ */
+
+#ifndef LINUX_NFSD_AUTH_H
+#define LINUX_NFSD_AUTH_H
+
+#endif /* LINUX_NFSD_AUTH_H */
diff --git a/sysroot/usr/include/linux/nfsd/const.h b/sysroot/usr/include/linux/nfsd/const.h
new file mode 100644
index 0000000..22ffb9a
--- /dev/null
+++ b/sysroot/usr/include/linux/nfsd/const.h
@@ -0,0 +1,30 @@
+/*
+ * include/linux/nfsd/const.h
+ *
+ * Various constants related to NFS.
+ *
+ * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de>
+ */
+
+#ifndef _LINUX_NFSD_CONST_H
+#define _LINUX_NFSD_CONST_H
+
+#include <linux/nfs.h>
+#include <linux/nfs2.h>
+#include <linux/nfs3.h>
+#include <linux/nfs4.h>
+
+/*
+ * Maximum protocol version supported by knfsd
+ */
+#define NFSSVC_MAXVERS 3
+
+/*
+ * Maximum blocksizes supported by daemon under various circumstances.
+ */
+#define NFSSVC_MAXBLKSIZE RPCSVC_MAXPAYLOAD
+/* NFSv2 is limited by the protocol specification, see RFC 1094 */
+#define NFSSVC_MAXBLKSIZE_V2 (8*1024)
+
+
+#endif /* _LINUX_NFSD_CONST_H */
diff --git a/sysroot/usr/include/linux/nfsd/debug.h b/sysroot/usr/include/linux/nfsd/debug.h
new file mode 100644
index 0000000..7d58c12
--- /dev/null
+++ b/sysroot/usr/include/linux/nfsd/debug.h
@@ -0,0 +1,40 @@
+/*
+ * linux/include/linux/nfsd/debug.h
+ *
+ * Debugging-related stuff for nfsd
+ *
+ * Copyright (C) 1995 Olaf Kirch <okir@monad.swb.de>
+ */
+
+#ifndef LINUX_NFSD_DEBUG_H
+#define LINUX_NFSD_DEBUG_H
+
+#include <linux/sunrpc/debug.h>
+
+/*
+ * Enable debugging for nfsd.
+ * Requires RPC_DEBUG.
+ */
+#ifdef RPC_DEBUG
+# define NFSD_DEBUG 1
+#endif
+
+/*
+ * knfsd debug flags
+ */
+#define NFSDDBG_SOCK 0x0001
+#define NFSDDBG_FH 0x0002
+#define NFSDDBG_EXPORT 0x0004
+#define NFSDDBG_SVC 0x0008
+#define NFSDDBG_PROC 0x0010
+#define NFSDDBG_FILEOP 0x0020
+#define NFSDDBG_AUTH 0x0040
+#define NFSDDBG_REPCACHE 0x0080
+#define NFSDDBG_XDR 0x0100
+#define NFSDDBG_LOCKD 0x0200
+#define NFSDDBG_ALL 0x7FFF
+#define NFSDDBG_NOCHANGE 0xFFFF
+
+
+
+#endif /* LINUX_NFSD_DEBUG_H */
diff --git a/sysroot/usr/include/linux/nfsd/export.h b/sysroot/usr/include/linux/nfsd/export.h
new file mode 100644
index 0000000..eaa5830
--- /dev/null
+++ b/sysroot/usr/include/linux/nfsd/export.h
@@ -0,0 +1,47 @@
+/*
+ * include/linux/nfsd/export.h
+ *
+ * Public declarations for NFS exports. The definitions for the
+ * syscall interface are in nfsctl.h
+ *
+ * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de>
+ */
+
+#ifndef NFSD_EXPORT_H
+#define NFSD_EXPORT_H
+
+#include <asm/types.h>
+
+/*
+ * Important limits for the exports stuff.
+ */
+#define NFSCLNT_IDMAX 1024
+#define NFSCLNT_ADDRMAX 16
+#define NFSCLNT_KEYMAX 32
+
+/*
+ * Export flags.
+ */
+#define NFSEXP_READONLY 0x0001
+#define NFSEXP_INSECURE_PORT 0x0002
+#define NFSEXP_ROOTSQUASH 0x0004
+#define NFSEXP_ALLSQUASH 0x0008
+#define NFSEXP_ASYNC 0x0010
+#define NFSEXP_GATHERED_WRITES 0x0020
+/* 40 80 100 currently unused */
+#define NFSEXP_NOHIDE 0x0200
+#define NFSEXP_NOSUBTREECHECK 0x0400
+#define NFSEXP_NOAUTHNLM 0x0800 /* Don't authenticate NLM requests - just trust */
+#define NFSEXP_MSNFS 0x1000 /* do silly things that MS clients expect */
+#define NFSEXP_FSID 0x2000
+#define NFSEXP_CROSSMOUNT 0x4000
+#define NFSEXP_NOACL 0x8000 /* reserved for possible ACL related use */
+#define NFSEXP_ALLFLAGS 0xFE3F
+
+/* The flags that may vary depending on security flavor: */
+#define NFSEXP_SECINFO_FLAGS (NFSEXP_READONLY | NFSEXP_ROOTSQUASH \
+ | NFSEXP_ALLSQUASH)
+
+
+#endif /* NFSD_EXPORT_H */
+
diff --git a/sysroot/usr/include/linux/nfsd/nfsfh.h b/sysroot/usr/include/linux/nfsd/nfsfh.h
new file mode 100644
index 0000000..1b958fc
--- /dev/null
+++ b/sysroot/usr/include/linux/nfsd/nfsfh.h
@@ -0,0 +1,116 @@
+/*
+ * include/linux/nfsd/nfsfh.h
+ *
+ * This file describes the layout of the file handles as passed
+ * over the wire.
+ *
+ * Earlier versions of knfsd used to sign file handles using keyed MD5
+ * or SHA. I've removed this code, because it doesn't give you more
+ * security than blocking external access to port 2049 on your firewall.
+ *
+ * Copyright (C) 1995, 1996, 1997 Olaf Kirch <okir@monad.swb.de>
+ */
+
+#ifndef _LINUX_NFSD_FH_H
+#define _LINUX_NFSD_FH_H
+
+#include <asm/types.h>
+#include <linux/nfsd/const.h>
+#include <linux/nfsd/debug.h>
+
+/*
+ * This is the old "dentry style" Linux NFSv2 file handle.
+ *
+ * The xino and xdev fields are currently used to transport the
+ * ino/dev of the exported inode.
+ */
+struct nfs_fhbase_old {
+ __u32 fb_dcookie; /* dentry cookie - always 0xfeebbaca */
+ __u32 fb_ino; /* our inode number */
+ __u32 fb_dirino; /* dir inode number, 0 for directories */
+ __u32 fb_dev; /* our device */
+ __u32 fb_xdev;
+ __u32 fb_xino;
+ __u32 fb_generation;
+};
+
+/*
+ * This is the new flexible, extensible style NFSv2/v3 file handle.
+ * by Neil Brown <neilb@cse.unsw.edu.au> - March 2000
+ *
+ * The file handle is seens as a list of 4byte words.
+ * The first word contains a version number (1) and four descriptor bytes
+ * that tell how the remaining 3 variable length fields should be handled.
+ * These three bytes are auth_type, fsid_type and fileid_type.
+ *
+ * All 4byte values are in host-byte-order.
+ *
+ * The auth_type field specifies how the filehandle can be authenticated
+ * This might allow a file to be confirmed to be in a writable part of a
+ * filetree without checking the path from it upto the root.
+ * Current values:
+ * 0 - No authentication. fb_auth is 0 bytes long
+ * Possible future values:
+ * 1 - 4 bytes taken from MD5 hash of the remainer of the file handle
+ * prefixed by a secret and with the important export flags.
+ *
+ * The fsid_type identifies how the filesystem (or export point) is
+ * encoded.
+ * Current values:
+ * 0 - 4 byte device id (ms-2-bytes major, ls-2-bytes minor), 4byte inode number
+ * NOTE: we cannot use the kdev_t device id value, because kdev_t.h
+ * says we mustn't. We must break it up and reassemble.
+ * 1 - 4 byte user specified identifier
+ * 2 - 4 byte major, 4 byte minor, 4 byte inode number - DEPRECATED
+ * 3 - 4 byte device id, encoded for user-space, 4 byte inode number
+ *
+ * The fileid_type identified how the file within the filesystem is encoded.
+ * This is (will be) passed to, and set by, the underlying filesystem if it supports
+ * filehandle operations. The filesystem must not use the value '0' or '0xff' and may
+ * only use the values 1 and 2 as defined below:
+ * Current values:
+ * 0 - The root, or export point, of the filesystem. fb_fileid is 0 bytes.
+ * 1 - 32bit inode number, 32 bit generation number.
+ * 2 - 32bit inode number, 32 bit generation number, 32 bit parent directory inode number.
+ *
+ */
+struct nfs_fhbase_new {
+ __u8 fb_version; /* == 1, even => nfs_fhbase_old */
+ __u8 fb_auth_type;
+ __u8 fb_fsid_type;
+ __u8 fb_fileid_type;
+ __u32 fb_auth[1];
+/* __u32 fb_fsid[0]; floating */
+/* __u32 fb_fileid[0]; floating */
+};
+
+struct knfsd_fh {
+ unsigned int fh_size; /* significant for NFSv3.
+ * Points to the current size while building
+ * a new file handle
+ */
+ union {
+ struct nfs_fhbase_old fh_old;
+ __u32 fh_pad[NFS4_FHSIZE/4];
+ struct nfs_fhbase_new fh_new;
+ } fh_base;
+};
+
+#define ofh_dcookie fh_base.fh_old.fb_dcookie
+#define ofh_ino fh_base.fh_old.fb_ino
+#define ofh_dirino fh_base.fh_old.fb_dirino
+#define ofh_dev fh_base.fh_old.fb_dev
+#define ofh_xdev fh_base.fh_old.fb_xdev
+#define ofh_xino fh_base.fh_old.fb_xino
+#define ofh_generation fh_base.fh_old.fb_generation
+
+#define fh_version fh_base.fh_new.fb_version
+#define fh_fsid_type fh_base.fh_new.fb_fsid_type
+#define fh_auth_type fh_base.fh_new.fb_auth_type
+#define fh_fileid_type fh_base.fh_new.fb_fileid_type
+#define fh_auth fh_base.fh_new.fb_auth
+#define fh_fsid fh_base.fh_new.fb_auth
+
+
+
+#endif /* _LINUX_NFSD_FH_H */
diff --git a/sysroot/usr/include/linux/nfsd/stats.h b/sysroot/usr/include/linux/nfsd/stats.h
new file mode 100644
index 0000000..58e93df
--- /dev/null
+++ b/sysroot/usr/include/linux/nfsd/stats.h
@@ -0,0 +1,41 @@
+/*
+ * linux/include/linux/nfsd/stats.h
+ *
+ * Statistics for NFS server.
+ *
+ * Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de>
+ */
+
+#ifndef LINUX_NFSD_STATS_H
+#define LINUX_NFSD_STATS_H
+
+#include <linux/nfs4.h>
+
+struct nfsd_stats {
+ unsigned int rchits; /* repcache hits */
+ unsigned int rcmisses; /* repcache hits */
+ unsigned int rcnocache; /* uncached reqs */
+ unsigned int fh_stale; /* FH stale error */
+ unsigned int fh_lookup; /* dentry cached */
+ unsigned int fh_anon; /* anon file dentry returned */
+ unsigned int fh_nocache_dir; /* filehandle not found in dcache */
+ unsigned int fh_nocache_nondir; /* filehandle not found in dcache */
+ unsigned int io_read; /* bytes returned to read requests */
+ unsigned int io_write; /* bytes passed in write requests */
+ unsigned int th_cnt; /* number of available threads */
+ unsigned int th_usage[10]; /* number of ticks during which n perdeciles
+ * of available threads were in use */
+ unsigned int th_fullcnt; /* number of times last free thread was used */
+ unsigned int ra_size; /* size of ra cache */
+ unsigned int ra_depth[11]; /* number of times ra entry was found that deep
+ * in the cache (10percentiles). [10] = not found */
+#ifdef CONFIG_NFSD_V4
+ unsigned int nfs4_opcount[LAST_NFS4_OP + 1]; /* count of individual nfsv4 operations */
+#endif
+
+};
+
+/* thread usage wraps very million seconds (approx one fortnight) */
+#define NFSD_USAGE_WRAP (HZ*1000000)
+
+#endif /* LINUX_NFSD_STATS_H */
diff --git a/sysroot/usr/include/linux/nfsd/syscall.h b/sysroot/usr/include/linux/nfsd/syscall.h
new file mode 100644
index 0000000..546f4b9
--- /dev/null
+++ b/sysroot/usr/include/linux/nfsd/syscall.h
@@ -0,0 +1,110 @@
+/*
+ * include/linux/nfsd/syscall.h
+ *
+ * This file holds all declarations for the knfsd syscall interface.
+ *
+ * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de>
+ */
+
+#ifndef NFSD_SYSCALL_H
+#define NFSD_SYSCALL_H
+
+#include <asm/types.h>
+#include <linux/posix_types.h>
+#include <linux/nfsd/const.h>
+#include <linux/nfsd/export.h>
+#include <linux/nfsd/nfsfh.h>
+#include <linux/nfsd/auth.h>
+
+/*
+ * Version of the syscall interface
+ */
+#define NFSCTL_VERSION 0x0201
+
+/*
+ * These are the commands understood by nfsctl().
+ */
+#define NFSCTL_SVC 0 /* This is a server process. */
+#define NFSCTL_ADDCLIENT 1 /* Add an NFS client. */
+#define NFSCTL_DELCLIENT 2 /* Remove an NFS client. */
+#define NFSCTL_EXPORT 3 /* export a file system. */
+#define NFSCTL_UNEXPORT 4 /* unexport a file system. */
+/*#define NFSCTL_UGIDUPDATE 5 / * update a client's uid/gid map. DISCARDED */
+/*#define NFSCTL_GETFH 6 / * get an fh by ino DISCARDED */
+#define NFSCTL_GETFD 7 /* get an fh by path (used by mountd) */
+#define NFSCTL_GETFS 8 /* get an fh by path with max FH len */
+
+/* SVC */
+struct nfsctl_svc {
+ unsigned short svc_port;
+ int svc_nthreads;
+};
+
+/* ADDCLIENT/DELCLIENT */
+struct nfsctl_client {
+ char cl_ident[NFSCLNT_IDMAX+1];
+ int cl_naddr;
+ struct in_addr cl_addrlist[NFSCLNT_ADDRMAX];
+ int cl_fhkeytype;
+ int cl_fhkeylen;
+ unsigned char cl_fhkey[NFSCLNT_KEYMAX];
+};
+
+/* EXPORT/UNEXPORT */
+struct nfsctl_export {
+ char ex_client[NFSCLNT_IDMAX+1];
+ char ex_path[NFS_MAXPATHLEN+1];
+ __kernel_old_dev_t ex_dev;
+ __kernel_ino_t ex_ino;
+ int ex_flags;
+ __kernel_uid_t ex_anon_uid;
+ __kernel_gid_t ex_anon_gid;
+};
+
+/* GETFD */
+struct nfsctl_fdparm {
+ struct sockaddr gd_addr;
+ char gd_path[NFS_MAXPATHLEN+1];
+ int gd_version;
+};
+
+/* GETFS - GET Filehandle with Size */
+struct nfsctl_fsparm {
+ struct sockaddr gd_addr;
+ char gd_path[NFS_MAXPATHLEN+1];
+ int gd_maxlen;
+};
+
+/*
+ * This is the argument union.
+ */
+struct nfsctl_arg {
+ int ca_version; /* safeguard */
+ union {
+ struct nfsctl_svc u_svc;
+ struct nfsctl_client u_client;
+ struct nfsctl_export u_export;
+ struct nfsctl_fdparm u_getfd;
+ struct nfsctl_fsparm u_getfs;
+ /*
+ * The following dummy member is needed to preserve binary compatibility
+ * on platforms where alignof(void*)>alignof(int). It's needed because
+ * this union used to contain a member (u_umap) which contained a
+ * pointer.
+ */
+ void *u_ptr;
+ } u;
+#define ca_svc u.u_svc
+#define ca_client u.u_client
+#define ca_export u.u_export
+#define ca_getfd u.u_getfd
+#define ca_getfs u.u_getfs
+};
+
+union nfsctl_res {
+ __u8 cr_getfh[NFS_FHSIZE];
+ struct knfsd_fh cr_getfs;
+};
+
+
+#endif /* NFSD_SYSCALL_H */
diff --git a/sysroot/usr/include/linux/nl80211.h b/sysroot/usr/include/linux/nl80211.h
new file mode 100644
index 0000000..538ee1d
--- /dev/null
+++ b/sysroot/usr/include/linux/nl80211.h
@@ -0,0 +1,129 @@
+#ifndef __LINUX_NL80211_H
+#define __LINUX_NL80211_H
+/*
+ * 802.11 netlink interface public header
+ *
+ * Copyright 2006, 2007 Johannes Berg <johannes@sipsolutions.net>
+ */
+
+/**
+ * enum nl80211_commands - supported nl80211 commands
+ *
+ * @NL80211_CMD_UNSPEC: unspecified command to catch errors
+ *
+ * @NL80211_CMD_GET_WIPHY: request information about a wiphy or dump request
+ * to get a list of all present wiphys.
+ * @NL80211_CMD_SET_WIPHY: set wiphy name, needs %NL80211_ATTR_WIPHY and
+ * %NL80211_ATTR_WIPHY_NAME.
+ * @NL80211_CMD_NEW_WIPHY: Newly created wiphy, response to get request
+ * or rename notification. Has attributes %NL80211_ATTR_WIPHY and
+ * %NL80211_ATTR_WIPHY_NAME.
+ * @NL80211_CMD_DEL_WIPHY: Wiphy deleted. Has attributes
+ * %NL80211_ATTR_WIPHY and %NL80211_ATTR_WIPHY_NAME.
+ *
+ * @NL80211_CMD_GET_INTERFACE: Request an interface's configuration;
+ * either a dump request on a %NL80211_ATTR_WIPHY or a specific get
+ * on an %NL80211_ATTR_IFINDEX is supported.
+ * @NL80211_CMD_SET_INTERFACE: Set type of a virtual interface, requires
+ * %NL80211_ATTR_IFINDEX and %NL80211_ATTR_IFTYPE.
+ * @NL80211_CMD_NEW_INTERFACE: Newly created virtual interface or response
+ * to %NL80211_CMD_GET_INTERFACE. Has %NL80211_ATTR_IFINDEX,
+ * %NL80211_ATTR_WIPHY and %NL80211_ATTR_IFTYPE attributes. Can also
+ * be sent from userspace to request creation of a new virtual interface,
+ * then requires attributes %NL80211_ATTR_WIPHY, %NL80211_ATTR_IFTYPE and
+ * %NL80211_ATTR_IFNAME.
+ * @NL80211_CMD_DEL_INTERFACE: Virtual interface was deleted, has attributes
+ * %NL80211_ATTR_IFINDEX and %NL80211_ATTR_WIPHY. Can also be sent from
+ * userspace to request deletion of a virtual interface, then requires
+ * attribute %NL80211_ATTR_IFINDEX.
+ *
+ * @NL80211_CMD_MAX: highest used command number
+ * @__NL80211_CMD_AFTER_LAST: internal use
+ */
+enum nl80211_commands {
+/* don't change the order or add anything inbetween, this is ABI! */
+ NL80211_CMD_UNSPEC,
+
+ NL80211_CMD_GET_WIPHY, /* can dump */
+ NL80211_CMD_SET_WIPHY,
+ NL80211_CMD_NEW_WIPHY,
+ NL80211_CMD_DEL_WIPHY,
+
+ NL80211_CMD_GET_INTERFACE, /* can dump */
+ NL80211_CMD_SET_INTERFACE,
+ NL80211_CMD_NEW_INTERFACE,
+ NL80211_CMD_DEL_INTERFACE,
+
+ /* add commands here */
+
+ /* used to define NL80211_CMD_MAX below */
+ __NL80211_CMD_AFTER_LAST,
+ NL80211_CMD_MAX = __NL80211_CMD_AFTER_LAST - 1
+};
+
+
+/**
+ * enum nl80211_attrs - nl80211 netlink attributes
+ *
+ * @NL80211_ATTR_UNSPEC: unspecified attribute to catch errors
+ *
+ * @NL80211_ATTR_WIPHY: index of wiphy to operate on, cf.
+ * /sys/class/ieee80211/<phyname>/index
+ * @NL80211_ATTR_WIPHY_NAME: wiphy name (used for renaming)
+ *
+ * @NL80211_ATTR_IFINDEX: network interface index of the device to operate on
+ * @NL80211_ATTR_IFNAME: network interface name
+ * @NL80211_ATTR_IFTYPE: type of virtual interface, see &enum nl80211_iftype
+ *
+ * @NL80211_ATTR_MAX: highest attribute number currently defined
+ * @__NL80211_ATTR_AFTER_LAST: internal use
+ */
+enum nl80211_attrs {
+/* don't change the order or add anything inbetween, this is ABI! */
+ NL80211_ATTR_UNSPEC,
+
+ NL80211_ATTR_WIPHY,
+ NL80211_ATTR_WIPHY_NAME,
+
+ NL80211_ATTR_IFINDEX,
+ NL80211_ATTR_IFNAME,
+ NL80211_ATTR_IFTYPE,
+
+ /* add attributes here, update the policy in nl80211.c */
+
+ __NL80211_ATTR_AFTER_LAST,
+ NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1
+};
+
+/**
+ * enum nl80211_iftype - (virtual) interface types
+ *
+ * @NL80211_IFTYPE_UNSPECIFIED: unspecified type, driver decides
+ * @NL80211_IFTYPE_ADHOC: independent BSS member
+ * @NL80211_IFTYPE_STATION: managed BSS member
+ * @NL80211_IFTYPE_AP: access point
+ * @NL80211_IFTYPE_AP_VLAN: VLAN interface for access points
+ * @NL80211_IFTYPE_WDS: wireless distribution interface
+ * @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames
+ * @NL80211_IFTYPE_MAX: highest interface type number currently defined
+ * @__NL80211_IFTYPE_AFTER_LAST: internal use
+ *
+ * These values are used with the %NL80211_ATTR_IFTYPE
+ * to set the type of an interface.
+ *
+ */
+enum nl80211_iftype {
+ NL80211_IFTYPE_UNSPECIFIED,
+ NL80211_IFTYPE_ADHOC,
+ NL80211_IFTYPE_STATION,
+ NL80211_IFTYPE_AP,
+ NL80211_IFTYPE_AP_VLAN,
+ NL80211_IFTYPE_WDS,
+ NL80211_IFTYPE_MONITOR,
+
+ /* keep last */
+ __NL80211_IFTYPE_AFTER_LAST,
+ NL80211_IFTYPE_MAX = __NL80211_IFTYPE_AFTER_LAST - 1
+};
+
+#endif /* __LINUX_NL80211_H */
diff --git a/sysroot/usr/include/linux/nubus.h b/sysroot/usr/include/linux/nubus.h
new file mode 100644
index 0000000..54f8b2a
--- /dev/null
+++ b/sysroot/usr/include/linux/nubus.h
@@ -0,0 +1,355 @@
+/*
+ nubus.h: various definitions and prototypes for NuBus drivers to use.
+
+ Originally written by Alan Cox.
+
+ Hacked to death by C. Scott Ananian and David Huggins-Daines.
+
+ Some of the constants in here are from the corresponding
+ NetBSD/OpenBSD header file, by Allen Briggs. We figured out the
+ rest of them on our own. */
+
+#ifndef LINUX_NUBUS_H
+#define LINUX_NUBUS_H
+
+
+enum nubus_category {
+ NUBUS_CAT_BOARD = 0x0001,
+ NUBUS_CAT_DISPLAY = 0x0003,
+ NUBUS_CAT_NETWORK = 0x0004,
+ NUBUS_CAT_COMMUNICATIONS = 0x0006,
+ NUBUS_CAT_FONT = 0x0009,
+ NUBUS_CAT_CPU = 0x000A,
+ /* For lack of a better name */
+ NUBUS_CAT_DUODOCK = 0x0020
+};
+
+enum nubus_type_network {
+ NUBUS_TYPE_ETHERNET = 0x0001,
+ NUBUS_TYPE_RS232 = 0x0002
+};
+
+enum nubus_type_display {
+ NUBUS_TYPE_VIDEO = 0x0001
+};
+
+enum nubus_type_cpu {
+ NUBUS_TYPE_68020 = 0x0003,
+ NUBUS_TYPE_68030 = 0x0004,
+ NUBUS_TYPE_68040 = 0x0005
+};
+
+/* Known <Cat,Type,SW,HW> tuples: (according to TattleTech and Slots)
+ * 68030 motherboards: <10,4,0,24>
+ * 68040 motherboards: <10,5,0,24>
+ * DuoDock Plus: <32,1,1,2>
+ *
+ * Toby Frame Buffer card: <3,1,1,1>
+ * RBV built-in video (IIci): <3,1,1,24>
+ * Valkyrie built-in video (Q630): <3,1,1,46>
+ * Macintosh Display Card: <3,1,1,25>
+ * Sonora built-in video (P460): <3,1,1,34>
+ * Jet framebuffer (DuoDock Plus): <3,1,1,41>
+ *
+ * SONIC comm-slot/on-board and DuoDock Ethernet: <4,1,1,272>
+ * SONIC LC-PDS Ethernet (Dayna, but like Apple 16-bit, sort of): <4,1,1,271>
+ * Apple SONIC LC-PDS Ethernet ("Apple Ethernet LC Twisted-Pair Card"): <4,1,0,281>
+ * Sonic Systems Ethernet A-Series Card: <4,1,268,256>
+ * Asante MacCon NuBus-A: <4,1,260,256> (alpha-1.0,1.1 revision)
+ * ROM on the above card: <2,1,0,0>
+ * Cabletron ethernet card: <4,1,1,265>
+ * Farallon ethernet card: <4,1,268,256> (identical to Sonic Systems card)
+ * Kinetics EtherPort IIN: <4,1,259,262>
+ * API Engineering EtherRun_LCa PDS enet card: <4,1,282,256>
+ *
+ * Add your devices to the list! You can obtain the "Slots" utility
+ * from Apple's FTP site at:
+ * ftp://dev.apple.com/devworld/Tool_Chest/Devices_-_Hardware/NuBus_Slot_Manager/
+ *
+ * Alternately, TattleTech can be found at any Info-Mac mirror site.
+ * or from its distribution site: ftp://ftp.decismkr.com/dms
+ */
+
+/* DrSW: Uniquely identifies the software interface to a board. This
+ is usually the one you want to look at when writing a driver. It's
+ not as useful as you think, though, because as we should know by
+ now (duh), "Apple Compatible" can mean a lot of things... */
+
+/* Add known DrSW values here */
+enum nubus_drsw {
+ /* NUBUS_CAT_DISPLAY */
+ NUBUS_DRSW_APPLE = 0x0001,
+ NUBUS_DRSW_APPLE_HIRES = 0x0013, /* MacII HiRes card driver */
+
+ /* NUBUS_CAT_NETWORK */
+ NUBUS_DRSW_3COM = 0x0000,
+ NUBUS_DRSW_CABLETRON = 0x0001,
+ NUBUS_DRSW_SONIC_LC = 0x0001,
+ NUBUS_DRSW_KINETICS = 0x0103,
+ NUBUS_DRSW_ASANTE = 0x0104,
+ NUBUS_DRSW_TECHWORKS = 0x0109,
+ NUBUS_DRSW_DAYNA = 0x010b,
+ NUBUS_DRSW_FARALLON = 0x010c,
+ NUBUS_DRSW_APPLE_SN = 0x010f,
+ NUBUS_DRSW_DAYNA2 = 0x0115,
+ NUBUS_DRSW_FOCUS = 0x011a,
+ NUBUS_DRSW_ASANTE_CS = 0x011d, /* use asante SMC9194 driver */
+ NUBUS_DRSW_DAYNA_LC = 0x011e,
+
+ /* NUBUS_CAT_CPU */
+ NUBUS_DRSW_NONE = 0x0000,
+};
+
+/* DrHW: Uniquely identifies the hardware interface to a board (or at
+ least, it should... some video cards are known to incorrectly
+ identify themselves as Toby cards) */
+
+/* Add known DrHW values here */
+enum nubus_drhw {
+ /* NUBUS_CAT_DISPLAY */
+ NUBUS_DRHW_APPLE_TFB = 0x0001, /* Toby frame buffer card */
+ NUBUS_DRHW_APPLE_WVC = 0x0006, /* Apple Workstation Video Card */
+ NUBUS_DRHW_SIGMA_CLRMAX = 0x0007, /* Sigma Design ColorMax */
+ NUBUS_DRHW_APPLE_SE30 = 0x0009, /* Apple SE/30 video */
+ NUBUS_DRHW_APPLE_HRVC = 0x0013, /* Mac II High-Res Video Card */
+ NUBUS_DRHW_APPLE_PVC = 0x0017, /* Mac II Portrait Video Card */
+ NUBUS_DRHW_APPLE_RBV1 = 0x0018, /* IIci RBV video */
+ NUBUS_DRHW_APPLE_MDC = 0x0019, /* Macintosh Display Card */
+ NUBUS_DRHW_APPLE_SONORA = 0x0022, /* Sonora built-in video */
+ NUBUS_DRHW_APPLE_24AC = 0x002b, /* Mac 24AC Video Card */
+ NUBUS_DRHW_APPLE_VALKYRIE = 0x002e,
+ NUBUS_DRHW_APPLE_JET = 0x0029, /* Jet framebuffer (DuoDock) */
+ NUBUS_DRHW_SMAC_GFX = 0x0105, /* SuperMac GFX */
+ NUBUS_DRHW_RASTER_CB264 = 0x013B, /* RasterOps ColorBoard 264 */
+ NUBUS_DRHW_MICRON_XCEED = 0x0146, /* Micron Exceed color */
+ NUBUS_DRHW_RDIUS_GSC = 0x0153, /* Radius GS/C */
+ NUBUS_DRHW_SMAC_SPEC8 = 0x017B, /* SuperMac Spectrum/8 */
+ NUBUS_DRHW_SMAC_SPEC24 = 0x017C, /* SuperMac Spectrum/24 */
+ NUBUS_DRHW_RASTER_CB364 = 0x026F, /* RasterOps ColorBoard 364 */
+ NUBUS_DRHW_RDIUS_DCGX = 0x027C, /* Radius DirectColor/GX */
+ NUBUS_DRHW_RDIUS_PC8 = 0x0291, /* Radius PrecisionColor 8 */
+ NUBUS_DRHW_LAPIS_PCS8 = 0x0292, /* Lapis ProColorServer 8 */
+ NUBUS_DRHW_RASTER_24LXI = 0x02A0, /* RasterOps 8/24 XLi */
+ NUBUS_DRHW_RASTER_PBPGT = 0x02A5, /* RasterOps PaintBoard Prism GT */
+ NUBUS_DRHW_EMACH_FSX = 0x02AE, /* E-Machines Futura SX */
+ NUBUS_DRHW_SMAC_THUND24 = 0x02CB, /* SuperMac Thunder/24 */
+ NUBUS_DRHW_RDIUS_PC24XP = 0x0406, /* Radius PrecisionColor 24Xp */
+ NUBUS_DRHW_RDIUS_PC24X = 0x040A, /* Radius PrecisionColor 24X */
+ NUBUS_DRHW_RDIUS_PC8XJ = 0x040B, /* Radius PrecisionColor 8XJ */
+
+ /* NUBUS_CAT_NETWORK */
+ NUBUS_DRHW_INTERLAN = 0x0100,
+ NUBUS_DRHW_SMC9194 = 0x0101,
+ NUBUS_DRHW_KINETICS = 0x0106,
+ NUBUS_DRHW_CABLETRON = 0x0109,
+ NUBUS_DRHW_ASANTE_LC = 0x010f,
+ NUBUS_DRHW_SONIC = 0x0110,
+ NUBUS_DRHW_TECHWORKS = 0x0112,
+ NUBUS_DRHW_APPLE_SONIC_NB = 0x0118,
+ NUBUS_DRHW_APPLE_SONIC_LC = 0x0119,
+ NUBUS_DRHW_FOCUS = 0x011c,
+ NUBUS_DRHW_SONNET = 0x011d,
+};
+
+/* Resource IDs: These are the identifiers for the various weird and
+ wonderful tidbits of information that may or may not reside in the
+ NuBus ROM directory. */
+enum nubus_res_id {
+ NUBUS_RESID_TYPE = 0x0001,
+ NUBUS_RESID_NAME = 0x0002,
+ NUBUS_RESID_ICON = 0x0003,
+ NUBUS_RESID_DRVRDIR = 0x0004,
+ NUBUS_RESID_LOADREC = 0x0005,
+ NUBUS_RESID_BOOTREC = 0x0006,
+ NUBUS_RESID_FLAGS = 0x0007,
+ NUBUS_RESID_HWDEVID = 0x0008,
+ NUBUS_RESID_MINOR_BASEOS = 0x000a,
+ NUBUS_RESID_MINOR_LENGTH = 0x000b,
+ NUBUS_RESID_MAJOR_BASEOS = 0x000c,
+ NUBUS_RESID_MAJOR_LENGTH = 0x000d,
+ NUBUS_RESID_CICN = 0x000f,
+ NUBUS_RESID_ICL8 = 0x0010,
+ NUBUS_RESID_ICL4 = 0x0011,
+};
+
+/* Category-specific resources. */
+enum nubus_board_res_id {
+ NUBUS_RESID_BOARDID = 0x0020,
+ NUBUS_RESID_PRAMINITDATA = 0x0021,
+ NUBUS_RESID_PRIMARYINIT = 0x0022,
+ NUBUS_RESID_TIMEOUTCONST = 0x0023,
+ NUBUS_RESID_VENDORINFO = 0x0024,
+ NUBUS_RESID_BOARDFLAGS = 0x0025,
+ NUBUS_RESID_SECONDINIT = 0x0026,
+
+ /* Not sure why Apple put these next two in here */
+ NUBUS_RESID_VIDNAMES = 0x0041,
+ NUBUS_RESID_VIDMODES = 0x007e
+};
+
+/* Fields within the vendor info directory */
+enum nubus_vendor_res_id {
+ NUBUS_RESID_VEND_ID = 0x0001,
+ NUBUS_RESID_VEND_SERIAL = 0x0002,
+ NUBUS_RESID_VEND_REV = 0x0003,
+ NUBUS_RESID_VEND_PART = 0x0004,
+ NUBUS_RESID_VEND_DATE = 0x0005
+};
+
+enum nubus_net_res_id {
+ NUBUS_RESID_MAC_ADDRESS = 0x0080
+};
+
+enum nubus_cpu_res_id {
+ NUBUS_RESID_MEMINFO = 0x0081,
+ NUBUS_RESID_ROMINFO = 0x0082
+};
+
+enum nubus_display_res_id {
+ NUBUS_RESID_GAMMADIR = 0x0040,
+ NUBUS_RESID_FIRSTMODE = 0x0080,
+ NUBUS_RESID_SECONDMODE = 0x0081,
+ NUBUS_RESID_THIRDMODE = 0x0082,
+ NUBUS_RESID_FOURTHMODE = 0x0083,
+ NUBUS_RESID_FIFTHMODE = 0x0084,
+ NUBUS_RESID_SIXTHMODE = 0x0085
+};
+
+struct nubus_dir
+{
+ unsigned char *base;
+ unsigned char *ptr;
+ int done;
+ int mask;
+};
+
+struct nubus_dirent
+{
+ unsigned char *base;
+ unsigned char type;
+ __u32 data; /* Actually 24bits used */
+ int mask;
+};
+
+struct nubus_board {
+ struct nubus_board* next;
+ struct nubus_dev* first_dev;
+
+ /* Only 9-E actually exist, though 0-8 are also theoretically
+ possible, and 0 is a special case which represents the
+ motherboard and onboard peripherals (Ethernet, video) */
+ int slot;
+ /* For slot 0, this is bogus. */
+ char name[64];
+
+ /* Format block */
+ unsigned char* fblock;
+ /* Root directory (does *not* always equal fblock + doffset!) */
+ unsigned char* directory;
+
+ unsigned long slot_addr;
+ /* Offset to root directory (sometimes) */
+ unsigned long doffset;
+ /* Length over which to compute the crc */
+ unsigned long rom_length;
+ /* Completely useless most of the time */
+ unsigned long crc;
+ unsigned char rev;
+ unsigned char format;
+ unsigned char lanes;
+};
+
+struct nubus_dev {
+ /* Next link in device list */
+ struct nubus_dev* next;
+ /* Directory entry in /proc/bus/nubus */
+ struct proc_dir_entry* procdir;
+
+ /* The functional resource ID of this device */
+ unsigned char resid;
+ /* These are mostly here for convenience; we could always read
+ them from the ROMs if we wanted to */
+ unsigned short category;
+ unsigned short type;
+ unsigned short dr_sw;
+ unsigned short dr_hw;
+ /* This is the device's name rather than the board's.
+ Sometimes they are different. Usually the board name is
+ more correct. */
+ char name[64];
+ /* MacOS driver (I kid you not) */
+ unsigned char* driver;
+ /* Actually this is an offset */
+ unsigned long iobase;
+ unsigned long iosize;
+ unsigned char flags, hwdevid;
+
+ /* Functional directory */
+ unsigned char* directory;
+ /* Much of our info comes from here */
+ struct nubus_board* board;
+};
+
+/* This is all NuBus devices (used to find devices later on) */
+extern struct nubus_dev* nubus_devices;
+/* This is all NuBus cards */
+extern struct nubus_board* nubus_boards;
+
+/* Generic NuBus interface functions, modelled after the PCI interface */
+void nubus_scan_bus(void);
+extern void nubus_proc_init(void);
+int get_nubus_list(char *buf);
+int nubus_proc_attach_device(struct nubus_dev *dev);
+int nubus_proc_detach_device(struct nubus_dev *dev);
+/* If we need more precision we can add some more of these */
+struct nubus_dev* nubus_find_device(unsigned short category,
+ unsigned short type,
+ unsigned short dr_hw,
+ unsigned short dr_sw,
+ const struct nubus_dev* from);
+struct nubus_dev* nubus_find_type(unsigned short category,
+ unsigned short type,
+ const struct nubus_dev* from);
+/* Might have more than one device in a slot, you know... */
+struct nubus_dev* nubus_find_slot(unsigned int slot,
+ const struct nubus_dev* from);
+
+/* These are somewhat more NuBus-specific. They all return 0 for
+ success and -1 for failure, as you'd expect. */
+
+/* The root directory which contains the board and functional
+ directories */
+int nubus_get_root_dir(const struct nubus_board* board,
+ struct nubus_dir* dir);
+/* The board directory */
+int nubus_get_board_dir(const struct nubus_board* board,
+ struct nubus_dir* dir);
+/* The functional directory */
+int nubus_get_func_dir(const struct nubus_dev* dev,
+ struct nubus_dir* dir);
+
+/* These work on any directory gotten via the above */
+int nubus_readdir(struct nubus_dir* dir,
+ struct nubus_dirent* ent);
+int nubus_find_rsrc(struct nubus_dir* dir,
+ unsigned char rsrc_type,
+ struct nubus_dirent* ent);
+int nubus_rewinddir(struct nubus_dir* dir);
+
+/* Things to do with directory entries */
+int nubus_get_subdir(const struct nubus_dirent* ent,
+ struct nubus_dir* dir);
+void nubus_get_rsrc_mem(void* dest,
+ const struct nubus_dirent *dirent,
+ int len);
+void nubus_get_rsrc_str(void* dest,
+ const struct nubus_dirent *dirent,
+ int maxlen);
+
+/* We'd like to get rid of this eventually. Only daynaport.c uses it now. */
+static __inline__ void *nubus_slot_addr(int slot)
+{
+ return (void *)(0xF0000000|(slot<<24));
+}
+
+#endif /* LINUX_NUBUS_H */
diff --git a/sysroot/usr/include/linux/nvram.h b/sysroot/usr/include/linux/nvram.h
new file mode 100644
index 0000000..fbaa10e
--- /dev/null
+++ b/sysroot/usr/include/linux/nvram.h
@@ -0,0 +1,16 @@
+#ifndef _LINUX_NVRAM_H
+#define _LINUX_NVRAM_H
+
+#include <linux/ioctl.h>
+
+/* /dev/nvram ioctls */
+#define NVRAM_INIT _IO('p', 0x40) /* initialize NVRAM and set checksum */
+#define NVRAM_SETCKS _IO('p', 0x41) /* recalculate checksum */
+
+/* for all current systems, this is where NVRAM starts */
+#define NVRAM_FIRST_BYTE 14
+/* all these functions expect an NVRAM offset, not an absolute */
+#define NVRAM_OFFSET(x) ((x)-NVRAM_FIRST_BYTE)
+
+
+#endif /* _LINUX_NVRAM_H */
diff --git a/sysroot/usr/include/linux/oom.h b/sysroot/usr/include/linux/oom.h
new file mode 100644
index 0000000..d7727b8
--- /dev/null
+++ b/sysroot/usr/include/linux/oom.h
@@ -0,0 +1,10 @@
+#ifndef __INCLUDE_LINUX_OOM_H
+#define __INCLUDE_LINUX_OOM_H
+
+/* /proc/<pid>/oom_adj set to -17 protects from the oom-killer */
+#define OOM_DISABLE (-17)
+/* inclusive */
+#define OOM_ADJUST_MIN (-16)
+#define OOM_ADJUST_MAX 15
+
+#endif /* _INCLUDE_LINUX_OOM_H */
diff --git a/sysroot/usr/include/linux/param.h b/sysroot/usr/include/linux/param.h
new file mode 100644
index 0000000..092e92f
--- /dev/null
+++ b/sysroot/usr/include/linux/param.h
@@ -0,0 +1,6 @@
+#ifndef _LINUX_PARAM_H
+#define _LINUX_PARAM_H
+
+#include <asm/param.h>
+
+#endif
diff --git a/sysroot/usr/include/linux/parport.h b/sysroot/usr/include/linux/parport.h
new file mode 100644
index 0000000..4272a7c
--- /dev/null
+++ b/sysroot/usr/include/linux/parport.h
@@ -0,0 +1,97 @@
+/* $Id: parport.h,v 1.1 1998/05/17 10:57:52 andrea Exp andrea $ */
+
+/*
+ * Any part of this program may be used in documents licensed under
+ * the GNU Free Documentation License, Version 1.1 or any later version
+ * published by the Free Software Foundation.
+ */
+
+#ifndef _PARPORT_H_
+#define _PARPORT_H_
+
+/* Start off with user-visible constants */
+
+/* Maximum of 16 ports per machine */
+#define PARPORT_MAX 16
+
+/* Magic numbers */
+#define PARPORT_IRQ_NONE -1
+#define PARPORT_DMA_NONE -1
+#define PARPORT_IRQ_AUTO -2
+#define PARPORT_DMA_AUTO -2
+#define PARPORT_DMA_NOFIFO -3
+#define PARPORT_DISABLE -2
+#define PARPORT_IRQ_PROBEONLY -3
+#define PARPORT_IOHI_AUTO -1
+
+#define PARPORT_CONTROL_STROBE 0x1
+#define PARPORT_CONTROL_AUTOFD 0x2
+#define PARPORT_CONTROL_INIT 0x4
+#define PARPORT_CONTROL_SELECT 0x8
+
+#define PARPORT_STATUS_ERROR 0x8
+#define PARPORT_STATUS_SELECT 0x10
+#define PARPORT_STATUS_PAPEROUT 0x20
+#define PARPORT_STATUS_ACK 0x40
+#define PARPORT_STATUS_BUSY 0x80
+
+/* Type classes for Plug-and-Play probe. */
+typedef enum {
+ PARPORT_CLASS_LEGACY = 0, /* Non-IEEE1284 device */
+ PARPORT_CLASS_PRINTER,
+ PARPORT_CLASS_MODEM,
+ PARPORT_CLASS_NET,
+ PARPORT_CLASS_HDC, /* Hard disk controller */
+ PARPORT_CLASS_PCMCIA,
+ PARPORT_CLASS_MEDIA, /* Multimedia device */
+ PARPORT_CLASS_FDC, /* Floppy disk controller */
+ PARPORT_CLASS_PORTS,
+ PARPORT_CLASS_SCANNER,
+ PARPORT_CLASS_DIGCAM,
+ PARPORT_CLASS_OTHER, /* Anything else */
+ PARPORT_CLASS_UNSPEC, /* No CLS field in ID */
+ PARPORT_CLASS_SCSIADAPTER
+} parport_device_class;
+
+/* The "modes" entry in parport is a bit field representing the
+ capabilities of the hardware. */
+#define PARPORT_MODE_PCSPP (1<<0) /* IBM PC registers available. */
+#define PARPORT_MODE_TRISTATE (1<<1) /* Can tristate. */
+#define PARPORT_MODE_EPP (1<<2) /* Hardware EPP. */
+#define PARPORT_MODE_ECP (1<<3) /* Hardware ECP. */
+#define PARPORT_MODE_COMPAT (1<<4) /* Hardware 'printer protocol'. */
+#define PARPORT_MODE_DMA (1<<5) /* Hardware can DMA. */
+#define PARPORT_MODE_SAFEININT (1<<6) /* SPP registers accessible in IRQ. */
+
+/* IEEE1284 modes:
+ Nibble mode, byte mode, ECP, ECPRLE and EPP are their own
+ 'extensibility request' values. Others are special.
+ 'Real' ECP modes must have the IEEE1284_MODE_ECP bit set. */
+#define IEEE1284_MODE_NIBBLE 0
+#define IEEE1284_MODE_BYTE (1<<0)
+#define IEEE1284_MODE_COMPAT (1<<8)
+#define IEEE1284_MODE_BECP (1<<9) /* Bounded ECP mode */
+#define IEEE1284_MODE_ECP (1<<4)
+#define IEEE1284_MODE_ECPRLE (IEEE1284_MODE_ECP | (1<<5))
+#define IEEE1284_MODE_ECPSWE (1<<10) /* Software-emulated */
+#define IEEE1284_MODE_EPP (1<<6)
+#define IEEE1284_MODE_EPPSL (1<<11) /* EPP 1.7 */
+#define IEEE1284_MODE_EPPSWE (1<<12) /* Software-emulated */
+#define IEEE1284_DEVICEID (1<<2) /* This is a flag */
+#define IEEE1284_EXT_LINK (1<<14) /* This flag causes the
+ * extensibility link to
+ * be requested, using
+ * bits 0-6. */
+
+/* For the benefit of parport_read/write, you can use these with
+ * parport_negotiate to use address operations. They have no effect
+ * other than to make parport_read/write use address transfers. */
+#define IEEE1284_ADDR (1<<13) /* This is a flag */
+#define IEEE1284_DATA 0 /* So is this */
+
+/* Flags for block transfer operations. */
+#define PARPORT_EPP_FAST (1<<0) /* Unreliable counts. */
+#define PARPORT_W91284PIC (1<<1) /* have a Warp9 w91284pic in the device */
+
+/* The rest is for the kernel only */
+#endif /* _PARPORT_H_ */
diff --git a/sysroot/usr/include/linux/patchkey.h b/sysroot/usr/include/linux/patchkey.h
new file mode 100644
index 0000000..23810dd
--- /dev/null
+++ b/sysroot/usr/include/linux/patchkey.h
@@ -0,0 +1,33 @@
+/*
+ * <linux/patchkey.h> -- definition of _PATCHKEY macro
+ *
+ * Copyright (C) 2005 Stuart Brady
+ *
+ * This exists because awe_voice.h defined its own _PATCHKEY and it wasn't
+ * clear whether removing this would break anything in userspace.
+ *
+ * Do not include this file directly. Please use <sys/soundcard.h> instead.
+ * For kernel code, use <linux/soundcard.h>
+ */
+
+#ifndef _LINUX_PATCHKEY_H_INDIRECT
+#error "patchkey.h included directly"
+#endif
+
+#ifndef _LINUX_PATCHKEY_H
+#define _LINUX_PATCHKEY_H
+
+/* Endian macros. */
+# include <endian.h>
+
+#if defined(__BYTE_ORDER)
+# if __BYTE_ORDER == __BIG_ENDIAN
+# define _PATCHKEY(id) (0xfd00|id)
+# elif __BYTE_ORDER == __LITTLE_ENDIAN
+# define _PATCHKEY(id) ((id<<8)|0x00fd)
+# else
+# error "could not determine byte order"
+# endif
+#endif
+
+#endif /* _LINUX_PATCHKEY_H */
diff --git a/sysroot/usr/include/linux/pci.h b/sysroot/usr/include/linux/pci.h
new file mode 100644
index 0000000..d3988b5
--- /dev/null
+++ b/sysroot/usr/include/linux/pci.h
@@ -0,0 +1,42 @@
+/*
+ * pci.h
+ *
+ * PCI defines and function prototypes
+ * Copyright 1994, Drew Eckhardt
+ * Copyright 1997--1999 Martin Mares <mj@ucw.cz>
+ *
+ * For more information, please consult the following manuals (look at
+ * http://www.pcisig.com/ for how to get them):
+ *
+ * PCI BIOS Specification
+ * PCI Local Bus Specification
+ * PCI to PCI Bridge Specification
+ * PCI System Design Guide
+ */
+
+#ifndef LINUX_PCI_H
+#define LINUX_PCI_H
+
+/* Include the pci register defines */
+#include <linux/pci_regs.h>
+
+/*
+ * The PCI interface treats multi-function devices as independent
+ * devices. The slot/function address of each device is encoded
+ * in a single byte as follows:
+ *
+ * 7:3 = slot
+ * 2:0 = function
+ */
+#define PCI_DEVFN(slot,func) ((((slot) & 0x1f) << 3) | ((func) & 0x07))
+#define PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f)
+#define PCI_FUNC(devfn) ((devfn) & 0x07)
+
+/* Ioctls for /proc/bus/pci/X/Y nodes. */
+#define PCIIOC_BASE ('P' << 24 | 'C' << 16 | 'I' << 8)
+#define PCIIOC_CONTROLLER (PCIIOC_BASE | 0x00) /* Get controller for PCI device. */
+#define PCIIOC_MMAP_IS_IO (PCIIOC_BASE | 0x01) /* Set mmap state to I/O space. */
+#define PCIIOC_MMAP_IS_MEM (PCIIOC_BASE | 0x02) /* Set mmap state to MEM space. */
+#define PCIIOC_WRITE_COMBINE (PCIIOC_BASE | 0x03) /* Enable/disable write-combining. */
+
+#endif /* LINUX_PCI_H */
diff --git a/sysroot/usr/include/linux/pci_regs.h b/sysroot/usr/include/linux/pci_regs.h
new file mode 100644
index 0000000..c1914a8
--- /dev/null
+++ b/sysroot/usr/include/linux/pci_regs.h
@@ -0,0 +1,530 @@
+/*
+ * pci_regs.h
+ *
+ * PCI standard defines
+ * Copyright 1994, Drew Eckhardt
+ * Copyright 1997--1999 Martin Mares <mj@ucw.cz>
+ *
+ * For more information, please consult the following manuals (look at
+ * http://www.pcisig.com/ for how to get them):
+ *
+ * PCI BIOS Specification
+ * PCI Local Bus Specification
+ * PCI to PCI Bridge Specification
+ * PCI System Design Guide
+ *
+ * For hypertransport information, please consult the following manuals
+ * from http://www.hypertransport.org
+ *
+ * The Hypertransport I/O Link Specification
+ */
+
+#ifndef LINUX_PCI_REGS_H
+#define LINUX_PCI_REGS_H
+
+/*
+ * Under PCI, each device has 256 bytes of configuration address space,
+ * of which the first 64 bytes are standardized as follows:
+ */
+#define PCI_VENDOR_ID 0x00 /* 16 bits */
+#define PCI_DEVICE_ID 0x02 /* 16 bits */
+#define PCI_COMMAND 0x04 /* 16 bits */
+#define PCI_COMMAND_IO 0x1 /* Enable response in I/O space */
+#define PCI_COMMAND_MEMORY 0x2 /* Enable response in Memory space */
+#define PCI_COMMAND_MASTER 0x4 /* Enable bus mastering */
+#define PCI_COMMAND_SPECIAL 0x8 /* Enable response to special cycles */
+#define PCI_COMMAND_INVALIDATE 0x10 /* Use memory write and invalidate */
+#define PCI_COMMAND_VGA_PALETTE 0x20 /* Enable palette snooping */
+#define PCI_COMMAND_PARITY 0x40 /* Enable parity checking */
+#define PCI_COMMAND_WAIT 0x80 /* Enable address/data stepping */
+#define PCI_COMMAND_SERR 0x100 /* Enable SERR */
+#define PCI_COMMAND_FAST_BACK 0x200 /* Enable back-to-back writes */
+#define PCI_COMMAND_INTX_DISABLE 0x400 /* INTx Emulation Disable */
+
+#define PCI_STATUS 0x06 /* 16 bits */
+#define PCI_STATUS_CAP_LIST 0x10 /* Support Capability List */
+#define PCI_STATUS_66MHZ 0x20 /* Support 66 Mhz PCI 2.1 bus */
+#define PCI_STATUS_UDF 0x40 /* Support User Definable Features [obsolete] */
+#define PCI_STATUS_FAST_BACK 0x80 /* Accept fast-back to back */
+#define PCI_STATUS_PARITY 0x100 /* Detected parity error */
+#define PCI_STATUS_DEVSEL_MASK 0x600 /* DEVSEL timing */
+#define PCI_STATUS_DEVSEL_FAST 0x000
+#define PCI_STATUS_DEVSEL_MEDIUM 0x200
+#define PCI_STATUS_DEVSEL_SLOW 0x400
+#define PCI_STATUS_SIG_TARGET_ABORT 0x800 /* Set on target abort */
+#define PCI_STATUS_REC_TARGET_ABORT 0x1000 /* Master ack of " */
+#define PCI_STATUS_REC_MASTER_ABORT 0x2000 /* Set on master abort */
+#define PCI_STATUS_SIG_SYSTEM_ERROR 0x4000 /* Set when we drive SERR */
+#define PCI_STATUS_DETECTED_PARITY 0x8000 /* Set on parity error */
+
+#define PCI_CLASS_REVISION 0x08 /* High 24 bits are class, low 8 revision */
+#define PCI_REVISION_ID 0x08 /* Revision ID */
+#define PCI_CLASS_PROG 0x09 /* Reg. Level Programming Interface */
+#define PCI_CLASS_DEVICE 0x0a /* Device class */
+
+#define PCI_CACHE_LINE_SIZE 0x0c /* 8 bits */
+#define PCI_LATENCY_TIMER 0x0d /* 8 bits */
+#define PCI_HEADER_TYPE 0x0e /* 8 bits */
+#define PCI_HEADER_TYPE_NORMAL 0
+#define PCI_HEADER_TYPE_BRIDGE 1
+#define PCI_HEADER_TYPE_CARDBUS 2
+
+#define PCI_BIST 0x0f /* 8 bits */
+#define PCI_BIST_CODE_MASK 0x0f /* Return result */
+#define PCI_BIST_START 0x40 /* 1 to start BIST, 2 secs or less */
+#define PCI_BIST_CAPABLE 0x80 /* 1 if BIST capable */
+
+/*
+ * Base addresses specify locations in memory or I/O space.
+ * Decoded size can be determined by writing a value of
+ * 0xffffffff to the register, and reading it back. Only
+ * 1 bits are decoded.
+ */
+#define PCI_BASE_ADDRESS_0 0x10 /* 32 bits */
+#define PCI_BASE_ADDRESS_1 0x14 /* 32 bits [htype 0,1 only] */
+#define PCI_BASE_ADDRESS_2 0x18 /* 32 bits [htype 0 only] */
+#define PCI_BASE_ADDRESS_3 0x1c /* 32 bits */
+#define PCI_BASE_ADDRESS_4 0x20 /* 32 bits */
+#define PCI_BASE_ADDRESS_5 0x24 /* 32 bits */
+#define PCI_BASE_ADDRESS_SPACE 0x01 /* 0 = memory, 1 = I/O */
+#define PCI_BASE_ADDRESS_SPACE_IO 0x01
+#define PCI_BASE_ADDRESS_SPACE_MEMORY 0x00
+#define PCI_BASE_ADDRESS_MEM_TYPE_MASK 0x06
+#define PCI_BASE_ADDRESS_MEM_TYPE_32 0x00 /* 32 bit address */
+#define PCI_BASE_ADDRESS_MEM_TYPE_1M 0x02 /* Below 1M [obsolete] */
+#define PCI_BASE_ADDRESS_MEM_TYPE_64 0x04 /* 64 bit address */
+#define PCI_BASE_ADDRESS_MEM_PREFETCH 0x08 /* prefetchable? */
+#define PCI_BASE_ADDRESS_MEM_MASK (~0x0fUL)
+#define PCI_BASE_ADDRESS_IO_MASK (~0x03UL)
+/* bit 1 is reserved if address_space = 1 */
+
+/* Header type 0 (normal devices) */
+#define PCI_CARDBUS_CIS 0x28
+#define PCI_SUBSYSTEM_VENDOR_ID 0x2c
+#define PCI_SUBSYSTEM_ID 0x2e
+#define PCI_ROM_ADDRESS 0x30 /* Bits 31..11 are address, 10..1 reserved */
+#define PCI_ROM_ADDRESS_ENABLE 0x01
+#define PCI_ROM_ADDRESS_MASK (~0x7ffUL)
+
+#define PCI_CAPABILITY_LIST 0x34 /* Offset of first capability list entry */
+
+/* 0x35-0x3b are reserved */
+#define PCI_INTERRUPT_LINE 0x3c /* 8 bits */
+#define PCI_INTERRUPT_PIN 0x3d /* 8 bits */
+#define PCI_MIN_GNT 0x3e /* 8 bits */
+#define PCI_MAX_LAT 0x3f /* 8 bits */
+
+/* Header type 1 (PCI-to-PCI bridges) */
+#define PCI_PRIMARY_BUS 0x18 /* Primary bus number */
+#define PCI_SECONDARY_BUS 0x19 /* Secondary bus number */
+#define PCI_SUBORDINATE_BUS 0x1a /* Highest bus number behind the bridge */
+#define PCI_SEC_LATENCY_TIMER 0x1b /* Latency timer for secondary interface */
+#define PCI_IO_BASE 0x1c /* I/O range behind the bridge */
+#define PCI_IO_LIMIT 0x1d
+#define PCI_IO_RANGE_TYPE_MASK 0x0fUL /* I/O bridging type */
+#define PCI_IO_RANGE_TYPE_16 0x00
+#define PCI_IO_RANGE_TYPE_32 0x01
+#define PCI_IO_RANGE_MASK (~0x0fUL)
+#define PCI_SEC_STATUS 0x1e /* Secondary status register, only bit 14 used */
+#define PCI_MEMORY_BASE 0x20 /* Memory range behind */
+#define PCI_MEMORY_LIMIT 0x22
+#define PCI_MEMORY_RANGE_TYPE_MASK 0x0fUL
+#define PCI_MEMORY_RANGE_MASK (~0x0fUL)
+#define PCI_PREF_MEMORY_BASE 0x24 /* Prefetchable memory range behind */
+#define PCI_PREF_MEMORY_LIMIT 0x26
+#define PCI_PREF_RANGE_TYPE_MASK 0x0fUL
+#define PCI_PREF_RANGE_TYPE_32 0x00
+#define PCI_PREF_RANGE_TYPE_64 0x01
+#define PCI_PREF_RANGE_MASK (~0x0fUL)
+#define PCI_PREF_BASE_UPPER32 0x28 /* Upper half of prefetchable memory range */
+#define PCI_PREF_LIMIT_UPPER32 0x2c
+#define PCI_IO_BASE_UPPER16 0x30 /* Upper half of I/O addresses */
+#define PCI_IO_LIMIT_UPPER16 0x32
+/* 0x34 same as for htype 0 */
+/* 0x35-0x3b is reserved */
+#define PCI_ROM_ADDRESS1 0x38 /* Same as PCI_ROM_ADDRESS, but for htype 1 */
+/* 0x3c-0x3d are same as for htype 0 */
+#define PCI_BRIDGE_CONTROL 0x3e
+#define PCI_BRIDGE_CTL_PARITY 0x01 /* Enable parity detection on secondary interface */
+#define PCI_BRIDGE_CTL_SERR 0x02 /* The same for SERR forwarding */
+#define PCI_BRIDGE_CTL_ISA 0x04 /* Enable ISA mode */
+#define PCI_BRIDGE_CTL_VGA 0x08 /* Forward VGA addresses */
+#define PCI_BRIDGE_CTL_MASTER_ABORT 0x20 /* Report master aborts */
+#define PCI_BRIDGE_CTL_BUS_RESET 0x40 /* Secondary bus reset */
+#define PCI_BRIDGE_CTL_FAST_BACK 0x80 /* Fast Back2Back enabled on secondary interface */
+
+/* Header type 2 (CardBus bridges) */
+#define PCI_CB_CAPABILITY_LIST 0x14
+/* 0x15 reserved */
+#define PCI_CB_SEC_STATUS 0x16 /* Secondary status */
+#define PCI_CB_PRIMARY_BUS 0x18 /* PCI bus number */
+#define PCI_CB_CARD_BUS 0x19 /* CardBus bus number */
+#define PCI_CB_SUBORDINATE_BUS 0x1a /* Subordinate bus number */
+#define PCI_CB_LATENCY_TIMER 0x1b /* CardBus latency timer */
+#define PCI_CB_MEMORY_BASE_0 0x1c
+#define PCI_CB_MEMORY_LIMIT_0 0x20
+#define PCI_CB_MEMORY_BASE_1 0x24
+#define PCI_CB_MEMORY_LIMIT_1 0x28
+#define PCI_CB_IO_BASE_0 0x2c
+#define PCI_CB_IO_BASE_0_HI 0x2e
+#define PCI_CB_IO_LIMIT_0 0x30
+#define PCI_CB_IO_LIMIT_0_HI 0x32
+#define PCI_CB_IO_BASE_1 0x34
+#define PCI_CB_IO_BASE_1_HI 0x36
+#define PCI_CB_IO_LIMIT_1 0x38
+#define PCI_CB_IO_LIMIT_1_HI 0x3a
+#define PCI_CB_IO_RANGE_MASK (~0x03UL)
+/* 0x3c-0x3d are same as for htype 0 */
+#define PCI_CB_BRIDGE_CONTROL 0x3e
+#define PCI_CB_BRIDGE_CTL_PARITY 0x01 /* Similar to standard bridge control register */
+#define PCI_CB_BRIDGE_CTL_SERR 0x02
+#define PCI_CB_BRIDGE_CTL_ISA 0x04
+#define PCI_CB_BRIDGE_CTL_VGA 0x08
+#define PCI_CB_BRIDGE_CTL_MASTER_ABORT 0x20
+#define PCI_CB_BRIDGE_CTL_CB_RESET 0x40 /* CardBus reset */
+#define PCI_CB_BRIDGE_CTL_16BIT_INT 0x80 /* Enable interrupt for 16-bit cards */
+#define PCI_CB_BRIDGE_CTL_PREFETCH_MEM0 0x100 /* Prefetch enable for both memory regions */
+#define PCI_CB_BRIDGE_CTL_PREFETCH_MEM1 0x200
+#define PCI_CB_BRIDGE_CTL_POST_WRITES 0x400
+#define PCI_CB_SUBSYSTEM_VENDOR_ID 0x40
+#define PCI_CB_SUBSYSTEM_ID 0x42
+#define PCI_CB_LEGACY_MODE_BASE 0x44 /* 16-bit PC Card legacy mode base address (ExCa) */
+/* 0x48-0x7f reserved */
+
+/* Capability lists */
+
+#define PCI_CAP_LIST_ID 0 /* Capability ID */
+#define PCI_CAP_ID_PM 0x01 /* Power Management */
+#define PCI_CAP_ID_AGP 0x02 /* Accelerated Graphics Port */
+#define PCI_CAP_ID_VPD 0x03 /* Vital Product Data */
+#define PCI_CAP_ID_SLOTID 0x04 /* Slot Identification */
+#define PCI_CAP_ID_MSI 0x05 /* Message Signalled Interrupts */
+#define PCI_CAP_ID_CHSWP 0x06 /* CompactPCI HotSwap */
+#define PCI_CAP_ID_PCIX 0x07 /* PCI-X */
+#define PCI_CAP_ID_HT 0x08 /* HyperTransport */
+#define PCI_CAP_ID_VNDR 0x09 /* Vendor specific */
+#define PCI_CAP_ID_DBG 0x0A /* Debug port */
+#define PCI_CAP_ID_CCRC 0x0B /* CompactPCI Central Resource Control */
+#define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */
+#define PCI_CAP_ID_SSVID 0x0D /* Bridge subsystem vendor/device ID */
+#define PCI_CAP_ID_AGP3 0x0E /* AGP Target PCI-PCI bridge */
+#define PCI_CAP_ID_EXP 0x10 /* PCI Express */
+#define PCI_CAP_ID_MSIX 0x11 /* MSI-X */
+#define PCI_CAP_LIST_NEXT 1 /* Next capability in the list */
+#define PCI_CAP_FLAGS 2 /* Capability defined flags (16 bits) */
+#define PCI_CAP_SIZEOF 4
+
+/* Power Management Registers */
+
+#define PCI_PM_PMC 2 /* PM Capabilities Register */
+#define PCI_PM_CAP_VER_MASK 0x0007 /* Version */
+#define PCI_PM_CAP_PME_CLOCK 0x0008 /* PME clock required */
+#define PCI_PM_CAP_RESERVED 0x0010 /* Reserved field */
+#define PCI_PM_CAP_DSI 0x0020 /* Device specific initialization */
+#define PCI_PM_CAP_AUX_POWER 0x01C0 /* Auxilliary power support mask */
+#define PCI_PM_CAP_D1 0x0200 /* D1 power state support */
+#define PCI_PM_CAP_D2 0x0400 /* D2 power state support */
+#define PCI_PM_CAP_PME 0x0800 /* PME pin supported */
+#define PCI_PM_CAP_PME_MASK 0xF800 /* PME Mask of all supported states */
+#define PCI_PM_CAP_PME_D0 0x0800 /* PME# from D0 */
+#define PCI_PM_CAP_PME_D1 0x1000 /* PME# from D1 */
+#define PCI_PM_CAP_PME_D2 0x2000 /* PME# from D2 */
+#define PCI_PM_CAP_PME_D3 0x4000 /* PME# from D3 (hot) */
+#define PCI_PM_CAP_PME_D3cold 0x8000 /* PME# from D3 (cold) */
+#define PCI_PM_CTRL 4 /* PM control and status register */
+#define PCI_PM_CTRL_STATE_MASK 0x0003 /* Current power state (D0 to D3) */
+#define PCI_PM_CTRL_NO_SOFT_RESET 0x0004 /* No reset for D3hot->D0 */
+#define PCI_PM_CTRL_PME_ENABLE 0x0100 /* PME pin enable */
+#define PCI_PM_CTRL_DATA_SEL_MASK 0x1e00 /* Data select (??) */
+#define PCI_PM_CTRL_DATA_SCALE_MASK 0x6000 /* Data scale (??) */
+#define PCI_PM_CTRL_PME_STATUS 0x8000 /* PME pin status */
+#define PCI_PM_PPB_EXTENSIONS 6 /* PPB support extensions (??) */
+#define PCI_PM_PPB_B2_B3 0x40 /* Stop clock when in D3hot (??) */
+#define PCI_PM_BPCC_ENABLE 0x80 /* Bus power/clock control enable (??) */
+#define PCI_PM_DATA_REGISTER 7 /* (??) */
+#define PCI_PM_SIZEOF 8
+
+/* AGP registers */
+
+#define PCI_AGP_VERSION 2 /* BCD version number */
+#define PCI_AGP_RFU 3 /* Rest of capability flags */
+#define PCI_AGP_STATUS 4 /* Status register */
+#define PCI_AGP_STATUS_RQ_MASK 0xff000000 /* Maximum number of requests - 1 */
+#define PCI_AGP_STATUS_SBA 0x0200 /* Sideband addressing supported */
+#define PCI_AGP_STATUS_64BIT 0x0020 /* 64-bit addressing supported */
+#define PCI_AGP_STATUS_FW 0x0010 /* FW transfers supported */
+#define PCI_AGP_STATUS_RATE4 0x0004 /* 4x transfer rate supported */
+#define PCI_AGP_STATUS_RATE2 0x0002 /* 2x transfer rate supported */
+#define PCI_AGP_STATUS_RATE1 0x0001 /* 1x transfer rate supported */
+#define PCI_AGP_COMMAND 8 /* Control register */
+#define PCI_AGP_COMMAND_RQ_MASK 0xff000000 /* Master: Maximum number of requests */
+#define PCI_AGP_COMMAND_SBA 0x0200 /* Sideband addressing enabled */
+#define PCI_AGP_COMMAND_AGP 0x0100 /* Allow processing of AGP transactions */
+#define PCI_AGP_COMMAND_64BIT 0x0020 /* Allow processing of 64-bit addresses */
+#define PCI_AGP_COMMAND_FW 0x0010 /* Force FW transfers */
+#define PCI_AGP_COMMAND_RATE4 0x0004 /* Use 4x rate */
+#define PCI_AGP_COMMAND_RATE2 0x0002 /* Use 2x rate */
+#define PCI_AGP_COMMAND_RATE1 0x0001 /* Use 1x rate */
+#define PCI_AGP_SIZEOF 12
+
+/* Vital Product Data */
+
+#define PCI_VPD_ADDR 2 /* Address to access (15 bits!) */
+#define PCI_VPD_ADDR_MASK 0x7fff /* Address mask */
+#define PCI_VPD_ADDR_F 0x8000 /* Write 0, 1 indicates completion */
+#define PCI_VPD_DATA 4 /* 32-bits of data returned here */
+
+/* Slot Identification */
+
+#define PCI_SID_ESR 2 /* Expansion Slot Register */
+#define PCI_SID_ESR_NSLOTS 0x1f /* Number of expansion slots available */
+#define PCI_SID_ESR_FIC 0x20 /* First In Chassis Flag */
+#define PCI_SID_CHASSIS_NR 3 /* Chassis Number */
+
+/* Message Signalled Interrupts registers */
+
+#define PCI_MSI_FLAGS 2 /* Various flags */
+#define PCI_MSI_FLAGS_64BIT 0x80 /* 64-bit addresses allowed */
+#define PCI_MSI_FLAGS_QSIZE 0x70 /* Message queue size configured */
+#define PCI_MSI_FLAGS_QMASK 0x0e /* Maximum queue size available */
+#define PCI_MSI_FLAGS_ENABLE 0x01 /* MSI feature enabled */
+#define PCI_MSI_FLAGS_MASKBIT 0x100 /* 64-bit mask bits allowed */
+#define PCI_MSI_RFU 3 /* Rest of capability flags */
+#define PCI_MSI_ADDRESS_LO 4 /* Lower 32 bits */
+#define PCI_MSI_ADDRESS_HI 8 /* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */
+#define PCI_MSI_DATA_32 8 /* 16 bits of data for 32-bit devices */
+#define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */
+#define PCI_MSI_MASK_BIT 16 /* Mask bits register */
+
+/* MSI-X registers (these are at offset PCI_MSIX_FLAGS) */
+#define PCI_MSIX_FLAGS 2
+#define PCI_MSIX_FLAGS_QSIZE 0x7FF
+#define PCI_MSIX_FLAGS_ENABLE (1 << 15)
+#define PCI_MSIX_FLAGS_MASKALL (1 << 14)
+#define PCI_MSIX_FLAGS_BIRMASK (7 << 0)
+#define PCI_MSIX_FLAGS_BITMASK (1 << 0)
+
+/* CompactPCI Hotswap Register */
+
+#define PCI_CHSWP_CSR 2 /* Control and Status Register */
+#define PCI_CHSWP_DHA 0x01 /* Device Hiding Arm */
+#define PCI_CHSWP_EIM 0x02 /* ENUM# Signal Mask */
+#define PCI_CHSWP_PIE 0x04 /* Pending Insert or Extract */
+#define PCI_CHSWP_LOO 0x08 /* LED On / Off */
+#define PCI_CHSWP_PI 0x30 /* Programming Interface */
+#define PCI_CHSWP_EXT 0x40 /* ENUM# status - extraction */
+#define PCI_CHSWP_INS 0x80 /* ENUM# status - insertion */
+
+/* PCI-X registers */
+
+#define PCI_X_CMD 2 /* Modes & Features */
+#define PCI_X_CMD_DPERR_E 0x0001 /* Data Parity Error Recovery Enable */
+#define PCI_X_CMD_ERO 0x0002 /* Enable Relaxed Ordering */
+#define PCI_X_CMD_READ_512 0x0000 /* 512 byte maximum read byte count */
+#define PCI_X_CMD_READ_1K 0x0004 /* 1Kbyte maximum read byte count */
+#define PCI_X_CMD_READ_2K 0x0008 /* 2Kbyte maximum read byte count */
+#define PCI_X_CMD_READ_4K 0x000c /* 4Kbyte maximum read byte count */
+#define PCI_X_CMD_MAX_READ 0x000c /* Max Memory Read Byte Count */
+ /* Max # of outstanding split transactions */
+#define PCI_X_CMD_SPLIT_1 0x0000 /* Max 1 */
+#define PCI_X_CMD_SPLIT_2 0x0010 /* Max 2 */
+#define PCI_X_CMD_SPLIT_3 0x0020 /* Max 3 */
+#define PCI_X_CMD_SPLIT_4 0x0030 /* Max 4 */
+#define PCI_X_CMD_SPLIT_8 0x0040 /* Max 8 */
+#define PCI_X_CMD_SPLIT_12 0x0050 /* Max 12 */
+#define PCI_X_CMD_SPLIT_16 0x0060 /* Max 16 */
+#define PCI_X_CMD_SPLIT_32 0x0070 /* Max 32 */
+#define PCI_X_CMD_MAX_SPLIT 0x0070 /* Max Outstanding Split Transactions */
+#define PCI_X_CMD_VERSION(x) (((x) >> 12) & 3) /* Version */
+#define PCI_X_STATUS 4 /* PCI-X capabilities */
+#define PCI_X_STATUS_DEVFN 0x000000ff /* A copy of devfn */
+#define PCI_X_STATUS_BUS 0x0000ff00 /* A copy of bus nr */
+#define PCI_X_STATUS_64BIT 0x00010000 /* 64-bit device */
+#define PCI_X_STATUS_133MHZ 0x00020000 /* 133 MHz capable */
+#define PCI_X_STATUS_SPL_DISC 0x00040000 /* Split Completion Discarded */
+#define PCI_X_STATUS_UNX_SPL 0x00080000 /* Unexpected Split Completion */
+#define PCI_X_STATUS_COMPLEX 0x00100000 /* Device Complexity */
+#define PCI_X_STATUS_MAX_READ 0x00600000 /* Designed Max Memory Read Count */
+#define PCI_X_STATUS_MAX_SPLIT 0x03800000 /* Designed Max Outstanding Split Transactions */
+#define PCI_X_STATUS_MAX_CUM 0x1c000000 /* Designed Max Cumulative Read Size */
+#define PCI_X_STATUS_SPL_ERR 0x20000000 /* Rcvd Split Completion Error Msg */
+#define PCI_X_STATUS_266MHZ 0x40000000 /* 266 MHz capable */
+#define PCI_X_STATUS_533MHZ 0x80000000 /* 533 MHz capable */
+
+/* PCI Express capability registers */
+
+#define PCI_EXP_FLAGS 2 /* Capabilities register */
+#define PCI_EXP_FLAGS_VERS 0x000f /* Capability version */
+#define PCI_EXP_FLAGS_TYPE 0x00f0 /* Device/Port type */
+#define PCI_EXP_TYPE_ENDPOINT 0x0 /* Express Endpoint */
+#define PCI_EXP_TYPE_LEG_END 0x1 /* Legacy Endpoint */
+#define PCI_EXP_TYPE_ROOT_PORT 0x4 /* Root Port */
+#define PCI_EXP_TYPE_UPSTREAM 0x5 /* Upstream Port */
+#define PCI_EXP_TYPE_DOWNSTREAM 0x6 /* Downstream Port */
+#define PCI_EXP_TYPE_PCI_BRIDGE 0x7 /* PCI/PCI-X Bridge */
+#define PCI_EXP_FLAGS_SLOT 0x0100 /* Slot implemented */
+#define PCI_EXP_FLAGS_IRQ 0x3e00 /* Interrupt message number */
+#define PCI_EXP_DEVCAP 4 /* Device capabilities */
+#define PCI_EXP_DEVCAP_PAYLOAD 0x07 /* Max_Payload_Size */
+#define PCI_EXP_DEVCAP_PHANTOM 0x18 /* Phantom functions */
+#define PCI_EXP_DEVCAP_EXT_TAG 0x20 /* Extended tags */
+#define PCI_EXP_DEVCAP_L0S 0x1c0 /* L0s Acceptable Latency */
+#define PCI_EXP_DEVCAP_L1 0xe00 /* L1 Acceptable Latency */
+#define PCI_EXP_DEVCAP_ATN_BUT 0x1000 /* Attention Button Present */
+#define PCI_EXP_DEVCAP_ATN_IND 0x2000 /* Attention Indicator Present */
+#define PCI_EXP_DEVCAP_PWR_IND 0x4000 /* Power Indicator Present */
+#define PCI_EXP_DEVCAP_PWR_VAL 0x3fc0000 /* Slot Power Limit Value */
+#define PCI_EXP_DEVCAP_PWR_SCL 0xc000000 /* Slot Power Limit Scale */
+#define PCI_EXP_DEVCTL 8 /* Device Control */
+#define PCI_EXP_DEVCTL_CERE 0x0001 /* Correctable Error Reporting En. */
+#define PCI_EXP_DEVCTL_NFERE 0x0002 /* Non-Fatal Error Reporting Enable */
+#define PCI_EXP_DEVCTL_FERE 0x0004 /* Fatal Error Reporting Enable */
+#define PCI_EXP_DEVCTL_URRE 0x0008 /* Unsupported Request Reporting En. */
+#define PCI_EXP_DEVCTL_RELAX_EN 0x0010 /* Enable relaxed ordering */
+#define PCI_EXP_DEVCTL_PAYLOAD 0x00e0 /* Max_Payload_Size */
+#define PCI_EXP_DEVCTL_EXT_TAG 0x0100 /* Extended Tag Field Enable */
+#define PCI_EXP_DEVCTL_PHANTOM 0x0200 /* Phantom Functions Enable */
+#define PCI_EXP_DEVCTL_AUX_PME 0x0400 /* Auxiliary Power PM Enable */
+#define PCI_EXP_DEVCTL_NOSNOOP_EN 0x0800 /* Enable No Snoop */
+#define PCI_EXP_DEVCTL_READRQ 0x7000 /* Max_Read_Request_Size */
+#define PCI_EXP_DEVSTA 10 /* Device Status */
+#define PCI_EXP_DEVSTA_CED 0x01 /* Correctable Error Detected */
+#define PCI_EXP_DEVSTA_NFED 0x02 /* Non-Fatal Error Detected */
+#define PCI_EXP_DEVSTA_FED 0x04 /* Fatal Error Detected */
+#define PCI_EXP_DEVSTA_URD 0x08 /* Unsupported Request Detected */
+#define PCI_EXP_DEVSTA_AUXPD 0x10 /* AUX Power Detected */
+#define PCI_EXP_DEVSTA_TRPND 0x20 /* Transactions Pending */
+#define PCI_EXP_LNKCAP 12 /* Link Capabilities */
+#define PCI_EXP_LNKCTL 16 /* Link Control */
+#define PCI_EXP_LNKCTL_CLKREQ_EN 0x100 /* Enable clkreq */
+#define PCI_EXP_LNKSTA 18 /* Link Status */
+#define PCI_EXP_SLTCAP 20 /* Slot Capabilities */
+#define PCI_EXP_SLTCTL 24 /* Slot Control */
+#define PCI_EXP_SLTSTA 26 /* Slot Status */
+#define PCI_EXP_RTCTL 28 /* Root Control */
+#define PCI_EXP_RTCTL_SECEE 0x01 /* System Error on Correctable Error */
+#define PCI_EXP_RTCTL_SENFEE 0x02 /* System Error on Non-Fatal Error */
+#define PCI_EXP_RTCTL_SEFEE 0x04 /* System Error on Fatal Error */
+#define PCI_EXP_RTCTL_PMEIE 0x08 /* PME Interrupt Enable */
+#define PCI_EXP_RTCTL_CRSSVE 0x10 /* CRS Software Visibility Enable */
+#define PCI_EXP_RTCAP 30 /* Root Capabilities */
+#define PCI_EXP_RTSTA 32 /* Root Status */
+
+/* Extended Capabilities (PCI-X 2.0 and Express) */
+#define PCI_EXT_CAP_ID(header) (header & 0x0000ffff)
+#define PCI_EXT_CAP_VER(header) ((header >> 16) & 0xf)
+#define PCI_EXT_CAP_NEXT(header) ((header >> 20) & 0xffc)
+
+#define PCI_EXT_CAP_ID_ERR 1
+#define PCI_EXT_CAP_ID_VC 2
+#define PCI_EXT_CAP_ID_DSN 3
+#define PCI_EXT_CAP_ID_PWR 4
+
+/* Advanced Error Reporting */
+#define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */
+#define PCI_ERR_UNC_TRAIN 0x00000001 /* Training */
+#define PCI_ERR_UNC_DLP 0x00000010 /* Data Link Protocol */
+#define PCI_ERR_UNC_POISON_TLP 0x00001000 /* Poisoned TLP */
+#define PCI_ERR_UNC_FCP 0x00002000 /* Flow Control Protocol */
+#define PCI_ERR_UNC_COMP_TIME 0x00004000 /* Completion Timeout */
+#define PCI_ERR_UNC_COMP_ABORT 0x00008000 /* Completer Abort */
+#define PCI_ERR_UNC_UNX_COMP 0x00010000 /* Unexpected Completion */
+#define PCI_ERR_UNC_RX_OVER 0x00020000 /* Receiver Overflow */
+#define PCI_ERR_UNC_MALF_TLP 0x00040000 /* Malformed TLP */
+#define PCI_ERR_UNC_ECRC 0x00080000 /* ECRC Error Status */
+#define PCI_ERR_UNC_UNSUP 0x00100000 /* Unsupported Request */
+#define PCI_ERR_UNCOR_MASK 8 /* Uncorrectable Error Mask */
+ /* Same bits as above */
+#define PCI_ERR_UNCOR_SEVER 12 /* Uncorrectable Error Severity */
+ /* Same bits as above */
+#define PCI_ERR_COR_STATUS 16 /* Correctable Error Status */
+#define PCI_ERR_COR_RCVR 0x00000001 /* Receiver Error Status */
+#define PCI_ERR_COR_BAD_TLP 0x00000040 /* Bad TLP Status */
+#define PCI_ERR_COR_BAD_DLLP 0x00000080 /* Bad DLLP Status */
+#define PCI_ERR_COR_REP_ROLL 0x00000100 /* REPLAY_NUM Rollover */
+#define PCI_ERR_COR_REP_TIMER 0x00001000 /* Replay Timer Timeout */
+#define PCI_ERR_COR_MASK 20 /* Correctable Error Mask */
+ /* Same bits as above */
+#define PCI_ERR_CAP 24 /* Advanced Error Capabilities */
+#define PCI_ERR_CAP_FEP(x) ((x) & 31) /* First Error Pointer */
+#define PCI_ERR_CAP_ECRC_GENC 0x00000020 /* ECRC Generation Capable */
+#define PCI_ERR_CAP_ECRC_GENE 0x00000040 /* ECRC Generation Enable */
+#define PCI_ERR_CAP_ECRC_CHKC 0x00000080 /* ECRC Check Capable */
+#define PCI_ERR_CAP_ECRC_CHKE 0x00000100 /* ECRC Check Enable */
+#define PCI_ERR_HEADER_LOG 28 /* Header Log Register (16 bytes) */
+#define PCI_ERR_ROOT_COMMAND 44 /* Root Error Command */
+/* Correctable Err Reporting Enable */
+#define PCI_ERR_ROOT_CMD_COR_EN 0x00000001
+/* Non-fatal Err Reporting Enable */
+#define PCI_ERR_ROOT_CMD_NONFATAL_EN 0x00000002
+/* Fatal Err Reporting Enable */
+#define PCI_ERR_ROOT_CMD_FATAL_EN 0x00000004
+#define PCI_ERR_ROOT_STATUS 48
+#define PCI_ERR_ROOT_COR_RCV 0x00000001 /* ERR_COR Received */
+/* Multi ERR_COR Received */
+#define PCI_ERR_ROOT_MULTI_COR_RCV 0x00000002
+/* ERR_FATAL/NONFATAL Recevied */
+#define PCI_ERR_ROOT_UNCOR_RCV 0x00000004
+/* Multi ERR_FATAL/NONFATAL Recevied */
+#define PCI_ERR_ROOT_MULTI_UNCOR_RCV 0x00000008
+#define PCI_ERR_ROOT_FIRST_FATAL 0x00000010 /* First Fatal */
+#define PCI_ERR_ROOT_NONFATAL_RCV 0x00000020 /* Non-Fatal Received */
+#define PCI_ERR_ROOT_FATAL_RCV 0x00000040 /* Fatal Received */
+#define PCI_ERR_ROOT_COR_SRC 52
+#define PCI_ERR_ROOT_SRC 54
+
+/* Virtual Channel */
+#define PCI_VC_PORT_REG1 4
+#define PCI_VC_PORT_REG2 8
+#define PCI_VC_PORT_CTRL 12
+#define PCI_VC_PORT_STATUS 14
+#define PCI_VC_RES_CAP 16
+#define PCI_VC_RES_CTRL 20
+#define PCI_VC_RES_STATUS 26
+
+/* Power Budgeting */
+#define PCI_PWR_DSR 4 /* Data Select Register */
+#define PCI_PWR_DATA 8 /* Data Register */
+#define PCI_PWR_DATA_BASE(x) ((x) & 0xff) /* Base Power */
+#define PCI_PWR_DATA_SCALE(x) (((x) >> 8) & 3) /* Data Scale */
+#define PCI_PWR_DATA_PM_SUB(x) (((x) >> 10) & 7) /* PM Sub State */
+#define PCI_PWR_DATA_PM_STATE(x) (((x) >> 13) & 3) /* PM State */
+#define PCI_PWR_DATA_TYPE(x) (((x) >> 15) & 7) /* Type */
+#define PCI_PWR_DATA_RAIL(x) (((x) >> 18) & 7) /* Power Rail */
+#define PCI_PWR_CAP 12 /* Capability */
+#define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */
+
+/*
+ * Hypertransport sub capability types
+ *
+ * Unfortunately there are both 3 bit and 5 bit capability types defined
+ * in the HT spec, catering for that is a little messy. You probably don't
+ * want to use these directly, just use pci_find_ht_capability() and it
+ * will do the right thing for you.
+ */
+#define HT_3BIT_CAP_MASK 0xE0
+#define HT_CAPTYPE_SLAVE 0x00 /* Slave/Primary link configuration */
+#define HT_CAPTYPE_HOST 0x20 /* Host/Secondary link configuration */
+
+#define HT_5BIT_CAP_MASK 0xF8
+#define HT_CAPTYPE_IRQ 0x80 /* IRQ Configuration */
+#define HT_CAPTYPE_REMAPPING_40 0xA0 /* 40 bit address remapping */
+#define HT_CAPTYPE_REMAPPING_64 0xA2 /* 64 bit address remapping */
+#define HT_CAPTYPE_UNITID_CLUMP 0x90 /* Unit ID clumping */
+#define HT_CAPTYPE_EXTCONF 0x98 /* Extended Configuration Space Access */
+#define HT_CAPTYPE_MSI_MAPPING 0xA8 /* MSI Mapping Capability */
+#define HT_MSI_FLAGS 0x02 /* Offset to flags */
+#define HT_MSI_FLAGS_ENABLE 0x1 /* Mapping enable */
+#define HT_MSI_FLAGS_FIXED 0x2 /* Fixed mapping only */
+#define HT_MSI_FIXED_ADDR 0x00000000FEE00000ULL /* Fixed addr */
+#define HT_MSI_ADDR_LO 0x04 /* Offset to low addr bits */
+#define HT_MSI_ADDR_LO_MASK 0xFFF00000 /* Low address bit mask */
+#define HT_MSI_ADDR_HI 0x08 /* Offset to high addr bits */
+#define HT_CAPTYPE_DIRECT_ROUTE 0xB0 /* Direct routing configuration */
+#define HT_CAPTYPE_VCSET 0xB8 /* Virtual Channel configuration */
+#define HT_CAPTYPE_ERROR_RETRY 0xC0 /* Retry on error configuration */
+#define HT_CAPTYPE_GEN3 0xD0 /* Generation 3 hypertransport configuration */
+#define HT_CAPTYPE_PM 0xE0 /* Hypertransport powermanagement configuration */
+
+
+#endif /* LINUX_PCI_REGS_H */
diff --git a/sysroot/usr/include/linux/personality.h b/sysroot/usr/include/linux/personality.h
new file mode 100644
index 0000000..9f1ab5e
--- /dev/null
+++ b/sysroot/usr/include/linux/personality.h
@@ -0,0 +1,65 @@
+#ifndef _LINUX_PERSONALITY_H
+#define _LINUX_PERSONALITY_H
+
+
+/*
+ * Flags for bug emulation.
+ *
+ * These occupy the top three bytes.
+ */
+enum {
+ ADDR_NO_RANDOMIZE = 0x0040000, /* disable randomization of VA space */
+ FDPIC_FUNCPTRS = 0x0080000, /* userspace function ptrs point to descriptors
+ * (signal handling)
+ */
+ MMAP_PAGE_ZERO = 0x0100000,
+ ADDR_COMPAT_LAYOUT = 0x0200000,
+ READ_IMPLIES_EXEC = 0x0400000,
+ ADDR_LIMIT_32BIT = 0x0800000,
+ SHORT_INODE = 0x1000000,
+ WHOLE_SECONDS = 0x2000000,
+ STICKY_TIMEOUTS = 0x4000000,
+ ADDR_LIMIT_3GB = 0x8000000,
+};
+
+/*
+ * Security-relevant compatibility flags that must be
+ * cleared upon setuid or setgid exec:
+ */
+#define PER_CLEAR_ON_SETID (READ_IMPLIES_EXEC|ADDR_NO_RANDOMIZE)
+
+/*
+ * Personality types.
+ *
+ * These go in the low byte. Avoid using the top bit, it will
+ * conflict with error returns.
+ */
+enum {
+ PER_LINUX = 0x0000,
+ PER_LINUX_32BIT = 0x0000 | ADDR_LIMIT_32BIT,
+ PER_LINUX_FDPIC = 0x0000 | FDPIC_FUNCPTRS,
+ PER_SVR4 = 0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
+ PER_SVR3 = 0x0002 | STICKY_TIMEOUTS | SHORT_INODE,
+ PER_SCOSVR3 = 0x0003 | STICKY_TIMEOUTS |
+ WHOLE_SECONDS | SHORT_INODE,
+ PER_OSR5 = 0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS,
+ PER_WYSEV386 = 0x0004 | STICKY_TIMEOUTS | SHORT_INODE,
+ PER_ISCR4 = 0x0005 | STICKY_TIMEOUTS,
+ PER_BSD = 0x0006,
+ PER_SUNOS = 0x0006 | STICKY_TIMEOUTS,
+ PER_XENIX = 0x0007 | STICKY_TIMEOUTS | SHORT_INODE,
+ PER_LINUX32 = 0x0008,
+ PER_LINUX32_3GB = 0x0008 | ADDR_LIMIT_3GB,
+ PER_IRIX32 = 0x0009 | STICKY_TIMEOUTS,/* IRIX5 32-bit */
+ PER_IRIXN32 = 0x000a | STICKY_TIMEOUTS,/* IRIX6 new 32-bit */
+ PER_IRIX64 = 0x000b | STICKY_TIMEOUTS,/* IRIX6 64-bit */
+ PER_RISCOS = 0x000c,
+ PER_SOLARIS = 0x000d | STICKY_TIMEOUTS,
+ PER_UW7 = 0x000e | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
+ PER_OSF4 = 0x000f, /* OSF/1 v4 */
+ PER_HPUX = 0x0010,
+ PER_MASK = 0x00ff,
+};
+
+
+#endif /* _LINUX_PERSONALITY_H */
diff --git a/sysroot/usr/include/linux/pfkeyv2.h b/sysroot/usr/include/linux/pfkeyv2.h
new file mode 100644
index 0000000..d9db5f6
--- /dev/null
+++ b/sysroot/usr/include/linux/pfkeyv2.h
@@ -0,0 +1,351 @@
+/* PF_KEY user interface, this is defined by rfc2367 so
+ * do not make arbitrary modifications or else this header
+ * file will not be compliant.
+ */
+
+#ifndef _LINUX_PFKEY2_H
+#define _LINUX_PFKEY2_H
+
+#include <linux/types.h>
+
+#define PF_KEY_V2 2
+#define PFKEYV2_REVISION 199806L
+
+struct sadb_msg {
+ uint8_t sadb_msg_version;
+ uint8_t sadb_msg_type;
+ uint8_t sadb_msg_errno;
+ uint8_t sadb_msg_satype;
+ uint16_t sadb_msg_len;
+ uint16_t sadb_msg_reserved;
+ uint32_t sadb_msg_seq;
+ uint32_t sadb_msg_pid;
+} __attribute__((packed));
+/* sizeof(struct sadb_msg) == 16 */
+
+struct sadb_ext {
+ uint16_t sadb_ext_len;
+ uint16_t sadb_ext_type;
+} __attribute__((packed));
+/* sizeof(struct sadb_ext) == 4 */
+
+struct sadb_sa {
+ uint16_t sadb_sa_len;
+ uint16_t sadb_sa_exttype;
+ __be32 sadb_sa_spi;
+ uint8_t sadb_sa_replay;
+ uint8_t sadb_sa_state;
+ uint8_t sadb_sa_auth;
+ uint8_t sadb_sa_encrypt;
+ uint32_t sadb_sa_flags;
+} __attribute__((packed));
+/* sizeof(struct sadb_sa) == 16 */
+
+struct sadb_lifetime {
+ uint16_t sadb_lifetime_len;
+ uint16_t sadb_lifetime_exttype;
+ uint32_t sadb_lifetime_allocations;
+ uint64_t sadb_lifetime_bytes;
+ uint64_t sadb_lifetime_addtime;
+ uint64_t sadb_lifetime_usetime;
+} __attribute__((packed));
+/* sizeof(struct sadb_lifetime) == 32 */
+
+struct sadb_address {
+ uint16_t sadb_address_len;
+ uint16_t sadb_address_exttype;
+ uint8_t sadb_address_proto;
+ uint8_t sadb_address_prefixlen;
+ uint16_t sadb_address_reserved;
+} __attribute__((packed));
+/* sizeof(struct sadb_address) == 8 */
+
+struct sadb_key {
+ uint16_t sadb_key_len;
+ uint16_t sadb_key_exttype;
+ uint16_t sadb_key_bits;
+ uint16_t sadb_key_reserved;
+} __attribute__((packed));
+/* sizeof(struct sadb_key) == 8 */
+
+struct sadb_ident {
+ uint16_t sadb_ident_len;
+ uint16_t sadb_ident_exttype;
+ uint16_t sadb_ident_type;
+ uint16_t sadb_ident_reserved;
+ uint64_t sadb_ident_id;
+} __attribute__((packed));
+/* sizeof(struct sadb_ident) == 16 */
+
+struct sadb_sens {
+ uint16_t sadb_sens_len;
+ uint16_t sadb_sens_exttype;
+ uint32_t sadb_sens_dpd;
+ uint8_t sadb_sens_sens_level;
+ uint8_t sadb_sens_sens_len;
+ uint8_t sadb_sens_integ_level;
+ uint8_t sadb_sens_integ_len;
+ uint32_t sadb_sens_reserved;
+} __attribute__((packed));
+/* sizeof(struct sadb_sens) == 16 */
+
+/* followed by:
+ uint64_t sadb_sens_bitmap[sens_len];
+ uint64_t sadb_integ_bitmap[integ_len]; */
+
+struct sadb_prop {
+ uint16_t sadb_prop_len;
+ uint16_t sadb_prop_exttype;
+ uint8_t sadb_prop_replay;
+ uint8_t sadb_prop_reserved[3];
+} __attribute__((packed));
+/* sizeof(struct sadb_prop) == 8 */
+
+/* followed by:
+ struct sadb_comb sadb_combs[(sadb_prop_len +
+ sizeof(uint64_t) - sizeof(struct sadb_prop)) /
+ sizeof(struct sadb_comb)]; */
+
+struct sadb_comb {
+ uint8_t sadb_comb_auth;
+ uint8_t sadb_comb_encrypt;
+ uint16_t sadb_comb_flags;
+ uint16_t sadb_comb_auth_minbits;
+ uint16_t sadb_comb_auth_maxbits;
+ uint16_t sadb_comb_encrypt_minbits;
+ uint16_t sadb_comb_encrypt_maxbits;
+ uint32_t sadb_comb_reserved;
+ uint32_t sadb_comb_soft_allocations;
+ uint32_t sadb_comb_hard_allocations;
+ uint64_t sadb_comb_soft_bytes;
+ uint64_t sadb_comb_hard_bytes;
+ uint64_t sadb_comb_soft_addtime;
+ uint64_t sadb_comb_hard_addtime;
+ uint64_t sadb_comb_soft_usetime;
+ uint64_t sadb_comb_hard_usetime;
+} __attribute__((packed));
+/* sizeof(struct sadb_comb) == 72 */
+
+struct sadb_supported {
+ uint16_t sadb_supported_len;
+ uint16_t sadb_supported_exttype;
+ uint32_t sadb_supported_reserved;
+} __attribute__((packed));
+/* sizeof(struct sadb_supported) == 8 */
+
+/* followed by:
+ struct sadb_alg sadb_algs[(sadb_supported_len +
+ sizeof(uint64_t) - sizeof(struct sadb_supported)) /
+ sizeof(struct sadb_alg)]; */
+
+struct sadb_alg {
+ uint8_t sadb_alg_id;
+ uint8_t sadb_alg_ivlen;
+ uint16_t sadb_alg_minbits;
+ uint16_t sadb_alg_maxbits;
+ uint16_t sadb_alg_reserved;
+} __attribute__((packed));
+/* sizeof(struct sadb_alg) == 8 */
+
+struct sadb_spirange {
+ uint16_t sadb_spirange_len;
+ uint16_t sadb_spirange_exttype;
+ uint32_t sadb_spirange_min;
+ uint32_t sadb_spirange_max;
+ uint32_t sadb_spirange_reserved;
+} __attribute__((packed));
+/* sizeof(struct sadb_spirange) == 16 */
+
+struct sadb_x_kmprivate {
+ uint16_t sadb_x_kmprivate_len;
+ uint16_t sadb_x_kmprivate_exttype;
+ uint32_t sadb_x_kmprivate_reserved;
+} __attribute__((packed));
+/* sizeof(struct sadb_x_kmprivate) == 8 */
+
+struct sadb_x_sa2 {
+ uint16_t sadb_x_sa2_len;
+ uint16_t sadb_x_sa2_exttype;
+ uint8_t sadb_x_sa2_mode;
+ uint8_t sadb_x_sa2_reserved1;
+ uint16_t sadb_x_sa2_reserved2;
+ uint32_t sadb_x_sa2_sequence;
+ uint32_t sadb_x_sa2_reqid;
+} __attribute__((packed));
+/* sizeof(struct sadb_x_sa2) == 16 */
+
+struct sadb_x_policy {
+ uint16_t sadb_x_policy_len;
+ uint16_t sadb_x_policy_exttype;
+ uint16_t sadb_x_policy_type;
+ uint8_t sadb_x_policy_dir;
+ uint8_t sadb_x_policy_reserved;
+ uint32_t sadb_x_policy_id;
+ uint32_t sadb_x_policy_priority;
+} __attribute__((packed));
+/* sizeof(struct sadb_x_policy) == 16 */
+
+struct sadb_x_ipsecrequest {
+ uint16_t sadb_x_ipsecrequest_len;
+ uint16_t sadb_x_ipsecrequest_proto;
+ uint8_t sadb_x_ipsecrequest_mode;
+ uint8_t sadb_x_ipsecrequest_level;
+ uint16_t sadb_x_ipsecrequest_reserved1;
+ uint32_t sadb_x_ipsecrequest_reqid;
+ uint32_t sadb_x_ipsecrequest_reserved2;
+} __attribute__((packed));
+/* sizeof(struct sadb_x_ipsecrequest) == 16 */
+
+/* This defines the TYPE of Nat Traversal in use. Currently only one
+ * type of NAT-T is supported, draft-ietf-ipsec-udp-encaps-06
+ */
+struct sadb_x_nat_t_type {
+ uint16_t sadb_x_nat_t_type_len;
+ uint16_t sadb_x_nat_t_type_exttype;
+ uint8_t sadb_x_nat_t_type_type;
+ uint8_t sadb_x_nat_t_type_reserved[3];
+} __attribute__((packed));
+/* sizeof(struct sadb_x_nat_t_type) == 8 */
+
+/* Pass a NAT Traversal port (Source or Dest port) */
+struct sadb_x_nat_t_port {
+ uint16_t sadb_x_nat_t_port_len;
+ uint16_t sadb_x_nat_t_port_exttype;
+ __be16 sadb_x_nat_t_port_port;
+ uint16_t sadb_x_nat_t_port_reserved;
+} __attribute__((packed));
+/* sizeof(struct sadb_x_nat_t_port) == 8 */
+
+/* Generic LSM security context */
+struct sadb_x_sec_ctx {
+ uint16_t sadb_x_sec_len;
+ uint16_t sadb_x_sec_exttype;
+ uint8_t sadb_x_ctx_alg; /* LSMs: e.g., selinux == 1 */
+ uint8_t sadb_x_ctx_doi;
+ uint16_t sadb_x_ctx_len;
+} __attribute__((packed));
+/* sizeof(struct sadb_sec_ctx) = 8 */
+
+/* Message types */
+#define SADB_RESERVED 0
+#define SADB_GETSPI 1
+#define SADB_UPDATE 2
+#define SADB_ADD 3
+#define SADB_DELETE 4
+#define SADB_GET 5
+#define SADB_ACQUIRE 6
+#define SADB_REGISTER 7
+#define SADB_EXPIRE 8
+#define SADB_FLUSH 9
+#define SADB_DUMP 10
+#define SADB_X_PROMISC 11
+#define SADB_X_PCHANGE 12
+#define SADB_X_SPDUPDATE 13
+#define SADB_X_SPDADD 14
+#define SADB_X_SPDDELETE 15
+#define SADB_X_SPDGET 16
+#define SADB_X_SPDACQUIRE 17
+#define SADB_X_SPDDUMP 18
+#define SADB_X_SPDFLUSH 19
+#define SADB_X_SPDSETIDX 20
+#define SADB_X_SPDEXPIRE 21
+#define SADB_X_SPDDELETE2 22
+#define SADB_X_NAT_T_NEW_MAPPING 23
+#define SADB_X_MIGRATE 24
+#define SADB_MAX 24
+
+/* Security Association flags */
+#define SADB_SAFLAGS_PFS 1
+#define SADB_SAFLAGS_NOPMTUDISC 0x20000000
+#define SADB_SAFLAGS_DECAP_DSCP 0x40000000
+#define SADB_SAFLAGS_NOECN 0x80000000
+
+/* Security Association states */
+#define SADB_SASTATE_LARVAL 0
+#define SADB_SASTATE_MATURE 1
+#define SADB_SASTATE_DYING 2
+#define SADB_SASTATE_DEAD 3
+#define SADB_SASTATE_MAX 3
+
+/* Security Association types */
+#define SADB_SATYPE_UNSPEC 0
+#define SADB_SATYPE_AH 2
+#define SADB_SATYPE_ESP 3
+#define SADB_SATYPE_RSVP 5
+#define SADB_SATYPE_OSPFV2 6
+#define SADB_SATYPE_RIPV2 7
+#define SADB_SATYPE_MIP 8
+#define SADB_X_SATYPE_IPCOMP 9
+#define SADB_SATYPE_MAX 9
+
+/* Authentication algorithms */
+#define SADB_AALG_NONE 0
+#define SADB_AALG_MD5HMAC 2
+#define SADB_AALG_SHA1HMAC 3
+#define SADB_X_AALG_SHA2_256HMAC 5
+#define SADB_X_AALG_SHA2_384HMAC 6
+#define SADB_X_AALG_SHA2_512HMAC 7
+#define SADB_X_AALG_RIPEMD160HMAC 8
+#define SADB_X_AALG_AES_XCBC_MAC 9
+#define SADB_X_AALG_NULL 251 /* kame */
+#define SADB_AALG_MAX 251
+
+/* Encryption algorithms */
+#define SADB_EALG_NONE 0
+#define SADB_EALG_DESCBC 2
+#define SADB_EALG_3DESCBC 3
+#define SADB_X_EALG_CASTCBC 6
+#define SADB_X_EALG_BLOWFISHCBC 7
+#define SADB_EALG_NULL 11
+#define SADB_X_EALG_AESCBC 12
+#define SADB_X_EALG_CAMELLIACBC 22
+#define SADB_EALG_MAX 253 /* last EALG */
+/* private allocations should use 249-255 (RFC2407) */
+#define SADB_X_EALG_SERPENTCBC 252 /* draft-ietf-ipsec-ciph-aes-cbc-00 */
+#define SADB_X_EALG_TWOFISHCBC 253 /* draft-ietf-ipsec-ciph-aes-cbc-00 */
+
+/* Compression algorithms */
+#define SADB_X_CALG_NONE 0
+#define SADB_X_CALG_OUI 1
+#define SADB_X_CALG_DEFLATE 2
+#define SADB_X_CALG_LZS 3
+#define SADB_X_CALG_LZJH 4
+#define SADB_X_CALG_MAX 4
+
+/* Extension Header values */
+#define SADB_EXT_RESERVED 0
+#define SADB_EXT_SA 1
+#define SADB_EXT_LIFETIME_CURRENT 2
+#define SADB_EXT_LIFETIME_HARD 3
+#define SADB_EXT_LIFETIME_SOFT 4
+#define SADB_EXT_ADDRESS_SRC 5
+#define SADB_EXT_ADDRESS_DST 6
+#define SADB_EXT_ADDRESS_PROXY 7
+#define SADB_EXT_KEY_AUTH 8
+#define SADB_EXT_KEY_ENCRYPT 9
+#define SADB_EXT_IDENTITY_SRC 10
+#define SADB_EXT_IDENTITY_DST 11
+#define SADB_EXT_SENSITIVITY 12
+#define SADB_EXT_PROPOSAL 13
+#define SADB_EXT_SUPPORTED_AUTH 14
+#define SADB_EXT_SUPPORTED_ENCRYPT 15
+#define SADB_EXT_SPIRANGE 16
+#define SADB_X_EXT_KMPRIVATE 17
+#define SADB_X_EXT_POLICY 18
+#define SADB_X_EXT_SA2 19
+/* The next four entries are for setting up NAT Traversal */
+#define SADB_X_EXT_NAT_T_TYPE 20
+#define SADB_X_EXT_NAT_T_SPORT 21
+#define SADB_X_EXT_NAT_T_DPORT 22
+#define SADB_X_EXT_NAT_T_OA 23
+#define SADB_X_EXT_SEC_CTX 24
+#define SADB_EXT_MAX 24
+
+/* Identity Extension values */
+#define SADB_IDENTTYPE_RESERVED 0
+#define SADB_IDENTTYPE_PREFIX 1
+#define SADB_IDENTTYPE_FQDN 2
+#define SADB_IDENTTYPE_USERFQDN 3
+#define SADB_IDENTTYPE_MAX 3
+
+#endif /* !(_LINUX_PFKEY2_H) */
diff --git a/sysroot/usr/include/linux/pg.h b/sysroot/usr/include/linux/pg.h
new file mode 100644
index 0000000..db994bb
--- /dev/null
+++ b/sysroot/usr/include/linux/pg.h
@@ -0,0 +1,63 @@
+/* pg.h (c) 1998 Grant R. Guenther <grant@torque.net>
+ Under the terms of the GNU General Public License
+
+
+ pg.h defines the user interface to the generic ATAPI packet
+ command driver for parallel port ATAPI devices (pg). The
+ driver is loosely modelled after the generic SCSI driver, sg,
+ although the actual interface is different.
+
+ The pg driver provides a simple character device interface for
+ sending ATAPI commands to a device. With the exception of the
+ ATAPI reset operation, all operations are performed by a pair
+ of read and write operations to the appropriate /dev/pgN device.
+ A write operation delivers a command and any outbound data in
+ a single buffer. Normally, the write will succeed unless the
+ device is offline or malfunctioning, or there is already another
+ command pending. If the write succeeds, it should be followed
+ immediately by a read operation, to obtain any returned data and
+ status information. A read will fail if there is no operation
+ in progress.
+
+ As a special case, the device can be reset with a write operation,
+ and in this case, no following read is expected, or permitted.
+
+ There are no ioctl() operations. Any single operation
+ may transfer at most PG_MAX_DATA bytes. Note that the driver must
+ copy the data through an internal buffer. In keeping with all
+ current ATAPI devices, command packets are assumed to be exactly
+ 12 bytes in length.
+
+ To permit future changes to this interface, the headers in the
+ read and write buffers contain a single character "magic" flag.
+ Currently this flag must be the character "P".
+
+*/
+
+#define PG_MAGIC 'P'
+#define PG_RESET 'Z'
+#define PG_COMMAND 'C'
+
+#define PG_MAX_DATA 32768
+
+struct pg_write_hdr {
+
+ char magic; /* == PG_MAGIC */
+ char func; /* PG_RESET or PG_COMMAND */
+ int dlen; /* number of bytes expected to transfer */
+ int timeout; /* number of seconds before timeout */
+ char packet[12]; /* packet command */
+
+};
+
+struct pg_read_hdr {
+
+ char magic; /* == PG_MAGIC */
+ char scsi; /* "scsi" status == sense key */
+ int dlen; /* size of device transfer request */
+ int duration; /* time in seconds command took */
+ char pad[12]; /* not used */
+
+};
+
+/* end of pg.h */
diff --git a/sysroot/usr/include/linux/phantom.h b/sysroot/usr/include/linux/phantom.h
new file mode 100644
index 0000000..96f4048
--- /dev/null
+++ b/sysroot/usr/include/linux/phantom.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2005-2007 Jiri Slaby <jirislaby@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef __PHANTOM_H
+#define __PHANTOM_H
+
+#include <asm/types.h>
+
+/* PHN_(G/S)ET_REG param */
+struct phm_reg {
+ __u32 reg;
+ __u32 value;
+};
+
+/* PHN_(G/S)ET_REGS param */
+struct phm_regs {
+ __u32 count;
+ __u32 mask;
+ __u32 values[8];
+};
+
+#define PH_IOC_MAGIC 'p'
+#define PHN_GET_REG _IOWR(PH_IOC_MAGIC, 0, struct phm_reg *)
+#define PHN_SET_REG _IOW (PH_IOC_MAGIC, 1, struct phm_reg *)
+#define PHN_GET_REGS _IOWR(PH_IOC_MAGIC, 2, struct phm_regs *)
+#define PHN_SET_REGS _IOW (PH_IOC_MAGIC, 3, struct phm_regs *)
+/* this ioctl tells the driver, that the caller is not OpenHaptics and might
+ * use improved registers update (no more phantom switchoffs when using
+ * libphantom) */
+#define PHN_NOT_OH _IO (PH_IOC_MAGIC, 4)
+#define PH_IOC_MAXNR 4
+
+#define PHN_CONTROL 0x6 /* control byte in iaddr space */
+#define PHN_CTL_AMP 0x1 /* switch after torques change */
+#define PHN_CTL_BUT 0x2 /* is button switched */
+#define PHN_CTL_IRQ 0x10 /* is irq enabled */
+
+#define PHN_ZERO_FORCE 2048 /* zero torque on motor */
+
+#endif
diff --git a/sysroot/usr/include/linux/pkt_cls.h b/sysroot/usr/include/linux/pkt_cls.h
new file mode 100644
index 0000000..30b8571
--- /dev/null
+++ b/sysroot/usr/include/linux/pkt_cls.h
@@ -0,0 +1,426 @@
+#ifndef __LINUX_PKT_CLS_H
+#define __LINUX_PKT_CLS_H
+
+#include <linux/pkt_sched.h>
+
+/* I think i could have done better macros ; for now this is stolen from
+ * some arch/mips code - jhs
+*/
+#define _TC_MAKE32(x) ((x))
+
+#define _TC_MAKEMASK1(n) (_TC_MAKE32(1) << _TC_MAKE32(n))
+#define _TC_MAKEMASK(v,n) (_TC_MAKE32((_TC_MAKE32(1)<<(v))-1) << _TC_MAKE32(n))
+#define _TC_MAKEVALUE(v,n) (_TC_MAKE32(v) << _TC_MAKE32(n))
+#define _TC_GETVALUE(v,n,m) ((_TC_MAKE32(v) & _TC_MAKE32(m)) >> _TC_MAKE32(n))
+
+/* verdict bit breakdown
+ *
+bit 0: when set -> this packet has been munged already
+
+bit 1: when set -> It is ok to munge this packet
+
+bit 2,3,4,5: Reclassify counter - sort of reverse TTL - if exceeded
+assume loop
+
+bit 6,7: Where this packet was last seen
+0: Above the transmit example at the socket level
+1: on the Ingress
+2: on the Egress
+
+bit 8: when set --> Request not to classify on ingress.
+
+bits 9,10,11: redirect counter - redirect TTL. Loop avoidance
+
+ *
+ * */
+
+#define TC_MUNGED _TC_MAKEMASK1(0)
+#define SET_TC_MUNGED(v) ( TC_MUNGED | (v & ~TC_MUNGED))
+#define CLR_TC_MUNGED(v) ( v & ~TC_MUNGED)
+
+#define TC_OK2MUNGE _TC_MAKEMASK1(1)
+#define SET_TC_OK2MUNGE(v) ( TC_OK2MUNGE | (v & ~TC_OK2MUNGE))
+#define CLR_TC_OK2MUNGE(v) ( v & ~TC_OK2MUNGE)
+
+#define S_TC_VERD _TC_MAKE32(2)
+#define M_TC_VERD _TC_MAKEMASK(4,S_TC_VERD)
+#define G_TC_VERD(x) _TC_GETVALUE(x,S_TC_VERD,M_TC_VERD)
+#define V_TC_VERD(x) _TC_MAKEVALUE(x,S_TC_VERD)
+#define SET_TC_VERD(v,n) ((V_TC_VERD(n)) | (v & ~M_TC_VERD))
+
+#define S_TC_FROM _TC_MAKE32(6)
+#define M_TC_FROM _TC_MAKEMASK(2,S_TC_FROM)
+#define G_TC_FROM(x) _TC_GETVALUE(x,S_TC_FROM,M_TC_FROM)
+#define V_TC_FROM(x) _TC_MAKEVALUE(x,S_TC_FROM)
+#define SET_TC_FROM(v,n) ((V_TC_FROM(n)) | (v & ~M_TC_FROM))
+#define AT_STACK 0x0
+#define AT_INGRESS 0x1
+#define AT_EGRESS 0x2
+
+#define TC_NCLS _TC_MAKEMASK1(8)
+#define SET_TC_NCLS(v) ( TC_NCLS | (v & ~TC_NCLS))
+#define CLR_TC_NCLS(v) ( v & ~TC_NCLS)
+
+#define S_TC_RTTL _TC_MAKE32(9)
+#define M_TC_RTTL _TC_MAKEMASK(3,S_TC_RTTL)
+#define G_TC_RTTL(x) _TC_GETVALUE(x,S_TC_RTTL,M_TC_RTTL)
+#define V_TC_RTTL(x) _TC_MAKEVALUE(x,S_TC_RTTL)
+#define SET_TC_RTTL(v,n) ((V_TC_RTTL(n)) | (v & ~M_TC_RTTL))
+
+#define S_TC_AT _TC_MAKE32(12)
+#define M_TC_AT _TC_MAKEMASK(2,S_TC_AT)
+#define G_TC_AT(x) _TC_GETVALUE(x,S_TC_AT,M_TC_AT)
+#define V_TC_AT(x) _TC_MAKEVALUE(x,S_TC_AT)
+#define SET_TC_AT(v,n) ((V_TC_AT(n)) | (v & ~M_TC_AT))
+
+/* Action attributes */
+enum
+{
+ TCA_ACT_UNSPEC,
+ TCA_ACT_KIND,
+ TCA_ACT_OPTIONS,
+ TCA_ACT_INDEX,
+ TCA_ACT_STATS,
+ __TCA_ACT_MAX
+};
+
+#define TCA_ACT_MAX __TCA_ACT_MAX
+#define TCA_OLD_COMPAT (TCA_ACT_MAX+1)
+#define TCA_ACT_MAX_PRIO 32
+#define TCA_ACT_BIND 1
+#define TCA_ACT_NOBIND 0
+#define TCA_ACT_UNBIND 1
+#define TCA_ACT_NOUNBIND 0
+#define TCA_ACT_REPLACE 1
+#define TCA_ACT_NOREPLACE 0
+#define MAX_REC_LOOP 4
+#define MAX_RED_LOOP 4
+
+#define TC_ACT_UNSPEC (-1)
+#define TC_ACT_OK 0
+#define TC_ACT_RECLASSIFY 1
+#define TC_ACT_SHOT 2
+#define TC_ACT_PIPE 3
+#define TC_ACT_STOLEN 4
+#define TC_ACT_QUEUED 5
+#define TC_ACT_REPEAT 6
+#define TC_ACT_JUMP 0x10000000
+
+/* Action type identifiers*/
+enum
+{
+ TCA_ID_UNSPEC=0,
+ TCA_ID_POLICE=1,
+ /* other actions go here */
+ __TCA_ID_MAX=255
+};
+
+#define TCA_ID_MAX __TCA_ID_MAX
+
+struct tc_police
+{
+ __u32 index;
+ int action;
+#define TC_POLICE_UNSPEC TC_ACT_UNSPEC
+#define TC_POLICE_OK TC_ACT_OK
+#define TC_POLICE_RECLASSIFY TC_ACT_RECLASSIFY
+#define TC_POLICE_SHOT TC_ACT_SHOT
+#define TC_POLICE_PIPE TC_ACT_PIPE
+
+ __u32 limit;
+ __u32 burst;
+ __u32 mtu;
+ struct tc_ratespec rate;
+ struct tc_ratespec peakrate;
+ int refcnt;
+ int bindcnt;
+ __u32 capab;
+};
+
+struct tcf_t
+{
+ __u64 install;
+ __u64 lastuse;
+ __u64 expires;
+};
+
+struct tc_cnt
+{
+ int refcnt;
+ int bindcnt;
+};
+
+#define tc_gen \
+ __u32 index; \
+ __u32 capab; \
+ int action; \
+ int refcnt; \
+ int bindcnt
+
+enum
+{
+ TCA_POLICE_UNSPEC,
+ TCA_POLICE_TBF,
+ TCA_POLICE_RATE,
+ TCA_POLICE_PEAKRATE,
+ TCA_POLICE_AVRATE,
+ TCA_POLICE_RESULT,
+ __TCA_POLICE_MAX
+#define TCA_POLICE_RESULT TCA_POLICE_RESULT
+};
+
+#define TCA_POLICE_MAX (__TCA_POLICE_MAX - 1)
+
+/* U32 filters */
+
+#define TC_U32_HTID(h) ((h)&0xFFF00000)
+#define TC_U32_USERHTID(h) (TC_U32_HTID(h)>>20)
+#define TC_U32_HASH(h) (((h)>>12)&0xFF)
+#define TC_U32_NODE(h) ((h)&0xFFF)
+#define TC_U32_KEY(h) ((h)&0xFFFFF)
+#define TC_U32_UNSPEC 0
+#define TC_U32_ROOT (0xFFF00000)
+
+enum
+{
+ TCA_U32_UNSPEC,
+ TCA_U32_CLASSID,
+ TCA_U32_HASH,
+ TCA_U32_LINK,
+ TCA_U32_DIVISOR,
+ TCA_U32_SEL,
+ TCA_U32_POLICE,
+ TCA_U32_ACT,
+ TCA_U32_INDEV,
+ TCA_U32_PCNT,
+ TCA_U32_MARK,
+ __TCA_U32_MAX
+};
+
+#define TCA_U32_MAX (__TCA_U32_MAX - 1)
+
+struct tc_u32_key
+{
+ __u32 mask;
+ __u32 val;
+ int off;
+ int offmask;
+};
+
+struct tc_u32_sel
+{
+ unsigned char flags;
+ unsigned char offshift;
+ unsigned char nkeys;
+
+ __u16 offmask;
+ __u16 off;
+ short offoff;
+
+ short hoff;
+ __u32 hmask;
+ struct tc_u32_key keys[0];
+};
+
+struct tc_u32_mark
+{
+ __u32 val;
+ __u32 mask;
+ __u32 success;
+};
+
+struct tc_u32_pcnt
+{
+ __u64 rcnt;
+ __u64 rhit;
+ __u64 kcnts[0];
+};
+
+/* Flags */
+
+#define TC_U32_TERMINAL 1
+#define TC_U32_OFFSET 2
+#define TC_U32_VAROFFSET 4
+#define TC_U32_EAT 8
+
+#define TC_U32_MAXDEPTH 8
+
+
+/* RSVP filter */
+
+enum
+{
+ TCA_RSVP_UNSPEC,
+ TCA_RSVP_CLASSID,
+ TCA_RSVP_DST,
+ TCA_RSVP_SRC,
+ TCA_RSVP_PINFO,
+ TCA_RSVP_POLICE,
+ TCA_RSVP_ACT,
+ __TCA_RSVP_MAX
+};
+
+#define TCA_RSVP_MAX (__TCA_RSVP_MAX - 1 )
+
+struct tc_rsvp_gpi
+{
+ __u32 key;
+ __u32 mask;
+ int offset;
+};
+
+struct tc_rsvp_pinfo
+{
+ struct tc_rsvp_gpi dpi;
+ struct tc_rsvp_gpi spi;
+ __u8 protocol;
+ __u8 tunnelid;
+ __u8 tunnelhdr;
+ __u8 pad;
+};
+
+/* ROUTE filter */
+
+enum
+{
+ TCA_ROUTE4_UNSPEC,
+ TCA_ROUTE4_CLASSID,
+ TCA_ROUTE4_TO,
+ TCA_ROUTE4_FROM,
+ TCA_ROUTE4_IIF,
+ TCA_ROUTE4_POLICE,
+ TCA_ROUTE4_ACT,
+ __TCA_ROUTE4_MAX
+};
+
+#define TCA_ROUTE4_MAX (__TCA_ROUTE4_MAX - 1)
+
+
+/* FW filter */
+
+enum
+{
+ TCA_FW_UNSPEC,
+ TCA_FW_CLASSID,
+ TCA_FW_POLICE,
+ TCA_FW_INDEV, /* used by CONFIG_NET_CLS_IND */
+ TCA_FW_ACT, /* used by CONFIG_NET_CLS_ACT */
+ TCA_FW_MASK,
+ __TCA_FW_MAX
+};
+
+#define TCA_FW_MAX (__TCA_FW_MAX - 1)
+
+/* TC index filter */
+
+enum
+{
+ TCA_TCINDEX_UNSPEC,
+ TCA_TCINDEX_HASH,
+ TCA_TCINDEX_MASK,
+ TCA_TCINDEX_SHIFT,
+ TCA_TCINDEX_FALL_THROUGH,
+ TCA_TCINDEX_CLASSID,
+ TCA_TCINDEX_POLICE,
+ TCA_TCINDEX_ACT,
+ __TCA_TCINDEX_MAX
+};
+
+#define TCA_TCINDEX_MAX (__TCA_TCINDEX_MAX - 1)
+
+/* Basic filter */
+
+enum
+{
+ TCA_BASIC_UNSPEC,
+ TCA_BASIC_CLASSID,
+ TCA_BASIC_EMATCHES,
+ TCA_BASIC_ACT,
+ TCA_BASIC_POLICE,
+ __TCA_BASIC_MAX
+};
+
+#define TCA_BASIC_MAX (__TCA_BASIC_MAX - 1)
+
+/* Extended Matches */
+
+struct tcf_ematch_tree_hdr
+{
+ __u16 nmatches;
+ __u16 progid;
+};
+
+enum
+{
+ TCA_EMATCH_TREE_UNSPEC,
+ TCA_EMATCH_TREE_HDR,
+ TCA_EMATCH_TREE_LIST,
+ __TCA_EMATCH_TREE_MAX
+};
+#define TCA_EMATCH_TREE_MAX (__TCA_EMATCH_TREE_MAX - 1)
+
+struct tcf_ematch_hdr
+{
+ __u16 matchid;
+ __u16 kind;
+ __u16 flags;
+ __u16 pad; /* currently unused */
+};
+
+/* 0 1
+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+ * +-----------------------+-+-+---+
+ * | Unused |S|I| R |
+ * +-----------------------+-+-+---+
+ *
+ * R(2) ::= relation to next ematch
+ * where: 0 0 END (last ematch)
+ * 0 1 AND
+ * 1 0 OR
+ * 1 1 Unused (invalid)
+ * I(1) ::= invert result
+ * S(1) ::= simple payload
+ */
+#define TCF_EM_REL_END 0
+#define TCF_EM_REL_AND (1<<0)
+#define TCF_EM_REL_OR (1<<1)
+#define TCF_EM_INVERT (1<<2)
+#define TCF_EM_SIMPLE (1<<3)
+
+#define TCF_EM_REL_MASK 3
+#define TCF_EM_REL_VALID(v) (((v) & TCF_EM_REL_MASK) != TCF_EM_REL_MASK)
+
+enum
+{
+ TCF_LAYER_LINK,
+ TCF_LAYER_NETWORK,
+ TCF_LAYER_TRANSPORT,
+ __TCF_LAYER_MAX
+};
+#define TCF_LAYER_MAX (__TCF_LAYER_MAX - 1)
+
+/* Ematch type assignments
+ * 1..32767 Reserved for ematches inside kernel tree
+ * 32768..65535 Free to use, not reliable
+ */
+#define TCF_EM_CONTAINER 0
+#define TCF_EM_CMP 1
+#define TCF_EM_NBYTE 2
+#define TCF_EM_U32 3
+#define TCF_EM_META 4
+#define TCF_EM_TEXT 5
+#define TCF_EM_MAX 5
+
+enum
+{
+ TCF_EM_PROG_TC
+};
+
+enum
+{
+ TCF_EM_OPND_EQ,
+ TCF_EM_OPND_GT,
+ TCF_EM_OPND_LT
+};
+
+#endif
diff --git a/sysroot/usr/include/linux/pkt_sched.h b/sysroot/usr/include/linux/pkt_sched.h
new file mode 100644
index 0000000..919af93
--- /dev/null
+++ b/sysroot/usr/include/linux/pkt_sched.h
@@ -0,0 +1,478 @@
+#ifndef __LINUX_PKT_SCHED_H
+#define __LINUX_PKT_SCHED_H
+
+/* Logical priority bands not depending on specific packet scheduler.
+ Every scheduler will map them to real traffic classes, if it has
+ no more precise mechanism to classify packets.
+
+ These numbers have no special meaning, though their coincidence
+ with obsolete IPv6 values is not occasional :-). New IPv6 drafts
+ preferred full anarchy inspired by diffserv group.
+
+ Note: TC_PRIO_BESTEFFORT does not mean that it is the most unhappy
+ class, actually, as rule it will be handled with more care than
+ filler or even bulk.
+ */
+
+#define TC_PRIO_BESTEFFORT 0
+#define TC_PRIO_FILLER 1
+#define TC_PRIO_BULK 2
+#define TC_PRIO_INTERACTIVE_BULK 4
+#define TC_PRIO_INTERACTIVE 6
+#define TC_PRIO_CONTROL 7
+
+#define TC_PRIO_MAX 15
+
+/* Generic queue statistics, available for all the elements.
+ Particular schedulers may have also their private records.
+ */
+
+struct tc_stats
+{
+ __u64 bytes; /* NUmber of enqueues bytes */
+ __u32 packets; /* Number of enqueued packets */
+ __u32 drops; /* Packets dropped because of lack of resources */
+ __u32 overlimits; /* Number of throttle events when this
+ * flow goes out of allocated bandwidth */
+ __u32 bps; /* Current flow byte rate */
+ __u32 pps; /* Current flow packet rate */
+ __u32 qlen;
+ __u32 backlog;
+};
+
+struct tc_estimator
+{
+ signed char interval;
+ unsigned char ewma_log;
+};
+
+/* "Handles"
+ ---------
+
+ All the traffic control objects have 32bit identifiers, or "handles".
+
+ They can be considered as opaque numbers from user API viewpoint,
+ but actually they always consist of two fields: major and
+ minor numbers, which are interpreted by kernel specially,
+ that may be used by applications, though not recommended.
+
+ F.e. qdisc handles always have minor number equal to zero,
+ classes (or flows) have major equal to parent qdisc major, and
+ minor uniquely identifying class inside qdisc.
+
+ Macros to manipulate handles:
+ */
+
+#define TC_H_MAJ_MASK (0xFFFF0000U)
+#define TC_H_MIN_MASK (0x0000FFFFU)
+#define TC_H_MAJ(h) ((h)&TC_H_MAJ_MASK)
+#define TC_H_MIN(h) ((h)&TC_H_MIN_MASK)
+#define TC_H_MAKE(maj,min) (((maj)&TC_H_MAJ_MASK)|((min)&TC_H_MIN_MASK))
+
+#define TC_H_UNSPEC (0U)
+#define TC_H_ROOT (0xFFFFFFFFU)
+#define TC_H_INGRESS (0xFFFFFFF1U)
+
+struct tc_ratespec
+{
+ unsigned char cell_log;
+ unsigned char __reserved;
+ unsigned short overhead;
+ short cell_align;
+ unsigned short mpu;
+ __u32 rate;
+};
+
+/* FIFO section */
+
+struct tc_fifo_qopt
+{
+ __u32 limit; /* Queue length: bytes for bfifo, packets for pfifo */
+};
+
+/* PRIO section */
+
+#define TCQ_PRIO_BANDS 16
+#define TCQ_MIN_PRIO_BANDS 2
+
+struct tc_prio_qopt
+{
+ int bands; /* Number of bands */
+ __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */
+};
+
+enum
+{
+ TCA_PRIO_UNSPEC,
+ TCA_PRIO_MQ,
+ __TCA_PRIO_MAX
+};
+
+#define TCA_PRIO_MAX (__TCA_PRIO_MAX - 1)
+
+/* TBF section */
+
+struct tc_tbf_qopt
+{
+ struct tc_ratespec rate;
+ struct tc_ratespec peakrate;
+ __u32 limit;
+ __u32 buffer;
+ __u32 mtu;
+};
+
+enum
+{
+ TCA_TBF_UNSPEC,
+ TCA_TBF_PARMS,
+ TCA_TBF_RTAB,
+ TCA_TBF_PTAB,
+ __TCA_TBF_MAX,
+};
+
+#define TCA_TBF_MAX (__TCA_TBF_MAX - 1)
+
+
+/* TEQL section */
+
+/* TEQL does not require any parameters */
+
+/* SFQ section */
+
+struct tc_sfq_qopt
+{
+ unsigned quantum; /* Bytes per round allocated to flow */
+ int perturb_period; /* Period of hash perturbation */
+ __u32 limit; /* Maximal packets in queue */
+ unsigned divisor; /* Hash divisor */
+ unsigned flows; /* Maximal number of flows */
+};
+
+/*
+ * NOTE: limit, divisor and flows are hardwired to code at the moment.
+ *
+ * limit=flows=128, divisor=1024;
+ *
+ * The only reason for this is efficiency, it is possible
+ * to change these parameters in compile time.
+ */
+
+/* RED section */
+
+enum
+{
+ TCA_RED_UNSPEC,
+ TCA_RED_PARMS,
+ TCA_RED_STAB,
+ __TCA_RED_MAX,
+};
+
+#define TCA_RED_MAX (__TCA_RED_MAX - 1)
+
+struct tc_red_qopt
+{
+ __u32 limit; /* HARD maximal queue length (bytes) */
+ __u32 qth_min; /* Min average length threshold (bytes) */
+ __u32 qth_max; /* Max average length threshold (bytes) */
+ unsigned char Wlog; /* log(W) */
+ unsigned char Plog; /* log(P_max/(qth_max-qth_min)) */
+ unsigned char Scell_log; /* cell size for idle damping */
+ unsigned char flags;
+#define TC_RED_ECN 1
+#define TC_RED_HARDDROP 2
+};
+
+struct tc_red_xstats
+{
+ __u32 early; /* Early drops */
+ __u32 pdrop; /* Drops due to queue limits */
+ __u32 other; /* Drops due to drop() calls */
+ __u32 marked; /* Marked packets */
+};
+
+/* GRED section */
+
+#define MAX_DPs 16
+
+enum
+{
+ TCA_GRED_UNSPEC,
+ TCA_GRED_PARMS,
+ TCA_GRED_STAB,
+ TCA_GRED_DPS,
+ __TCA_GRED_MAX,
+};
+
+#define TCA_GRED_MAX (__TCA_GRED_MAX - 1)
+
+struct tc_gred_qopt
+{
+ __u32 limit; /* HARD maximal queue length (bytes) */
+ __u32 qth_min; /* Min average length threshold (bytes) */
+ __u32 qth_max; /* Max average length threshold (bytes) */
+ __u32 DP; /* upto 2^32 DPs */
+ __u32 backlog;
+ __u32 qave;
+ __u32 forced;
+ __u32 early;
+ __u32 other;
+ __u32 pdrop;
+ __u8 Wlog; /* log(W) */
+ __u8 Plog; /* log(P_max/(qth_max-qth_min)) */
+ __u8 Scell_log; /* cell size for idle damping */
+ __u8 prio; /* prio of this VQ */
+ __u32 packets;
+ __u32 bytesin;
+};
+
+/* gred setup */
+struct tc_gred_sopt
+{
+ __u32 DPs;
+ __u32 def_DP;
+ __u8 grio;
+ __u8 flags;
+ __u16 pad1;
+};
+
+/* HTB section */
+#define TC_HTB_NUMPRIO 8
+#define TC_HTB_MAXDEPTH 8
+#define TC_HTB_PROTOVER 3 /* the same as HTB and TC's major */
+
+struct tc_htb_opt
+{
+ struct tc_ratespec rate;
+ struct tc_ratespec ceil;
+ __u32 buffer;
+ __u32 cbuffer;
+ __u32 quantum;
+ __u32 level; /* out only */
+ __u32 prio;
+};
+struct tc_htb_glob
+{
+ __u32 version; /* to match HTB/TC */
+ __u32 rate2quantum; /* bps->quantum divisor */
+ __u32 defcls; /* default class number */
+ __u32 debug; /* debug flags */
+
+ /* stats */
+ __u32 direct_pkts; /* count of non shapped packets */
+};
+enum
+{
+ TCA_HTB_UNSPEC,
+ TCA_HTB_PARMS,
+ TCA_HTB_INIT,
+ TCA_HTB_CTAB,
+ TCA_HTB_RTAB,
+ __TCA_HTB_MAX,
+};
+
+#define TCA_HTB_MAX (__TCA_HTB_MAX - 1)
+
+struct tc_htb_xstats
+{
+ __u32 lends;
+ __u32 borrows;
+ __u32 giants; /* too big packets (rate will not be accurate) */
+ __u32 tokens;
+ __u32 ctokens;
+};
+
+/* HFSC section */
+
+struct tc_hfsc_qopt
+{
+ __u16 defcls; /* default class */
+};
+
+struct tc_service_curve
+{
+ __u32 m1; /* slope of the first segment in bps */
+ __u32 d; /* x-projection of the first segment in us */
+ __u32 m2; /* slope of the second segment in bps */
+};
+
+struct tc_hfsc_stats
+{
+ __u64 work; /* total work done */
+ __u64 rtwork; /* work done by real-time criteria */
+ __u32 period; /* current period */
+ __u32 level; /* class level in hierarchy */
+};
+
+enum
+{
+ TCA_HFSC_UNSPEC,
+ TCA_HFSC_RSC,
+ TCA_HFSC_FSC,
+ TCA_HFSC_USC,
+ __TCA_HFSC_MAX,
+};
+
+#define TCA_HFSC_MAX (__TCA_HFSC_MAX - 1)
+
+
+/* CBQ section */
+
+#define TC_CBQ_MAXPRIO 8
+#define TC_CBQ_MAXLEVEL 8
+#define TC_CBQ_DEF_EWMA 5
+
+struct tc_cbq_lssopt
+{
+ unsigned char change;
+ unsigned char flags;
+#define TCF_CBQ_LSS_BOUNDED 1
+#define TCF_CBQ_LSS_ISOLATED 2
+ unsigned char ewma_log;
+ unsigned char level;
+#define TCF_CBQ_LSS_FLAGS 1
+#define TCF_CBQ_LSS_EWMA 2
+#define TCF_CBQ_LSS_MAXIDLE 4
+#define TCF_CBQ_LSS_MINIDLE 8
+#define TCF_CBQ_LSS_OFFTIME 0x10
+#define TCF_CBQ_LSS_AVPKT 0x20
+ __u32 maxidle;
+ __u32 minidle;
+ __u32 offtime;
+ __u32 avpkt;
+};
+
+struct tc_cbq_wrropt
+{
+ unsigned char flags;
+ unsigned char priority;
+ unsigned char cpriority;
+ unsigned char __reserved;
+ __u32 allot;
+ __u32 weight;
+};
+
+struct tc_cbq_ovl
+{
+ unsigned char strategy;
+#define TC_CBQ_OVL_CLASSIC 0
+#define TC_CBQ_OVL_DELAY 1
+#define TC_CBQ_OVL_LOWPRIO 2
+#define TC_CBQ_OVL_DROP 3
+#define TC_CBQ_OVL_RCLASSIC 4
+ unsigned char priority2;
+ __u16 pad;
+ __u32 penalty;
+};
+
+struct tc_cbq_police
+{
+ unsigned char police;
+ unsigned char __res1;
+ unsigned short __res2;
+};
+
+struct tc_cbq_fopt
+{
+ __u32 split;
+ __u32 defmap;
+ __u32 defchange;
+};
+
+struct tc_cbq_xstats
+{
+ __u32 borrows;
+ __u32 overactions;
+ __s32 avgidle;
+ __s32 undertime;
+};
+
+enum
+{
+ TCA_CBQ_UNSPEC,
+ TCA_CBQ_LSSOPT,
+ TCA_CBQ_WRROPT,
+ TCA_CBQ_FOPT,
+ TCA_CBQ_OVL_STRATEGY,
+ TCA_CBQ_RATE,
+ TCA_CBQ_RTAB,
+ TCA_CBQ_POLICE,
+ __TCA_CBQ_MAX,
+};
+
+#define TCA_CBQ_MAX (__TCA_CBQ_MAX - 1)
+
+/* dsmark section */
+
+enum {
+ TCA_DSMARK_UNSPEC,
+ TCA_DSMARK_INDICES,
+ TCA_DSMARK_DEFAULT_INDEX,
+ TCA_DSMARK_SET_TC_INDEX,
+ TCA_DSMARK_MASK,
+ TCA_DSMARK_VALUE,
+ __TCA_DSMARK_MAX,
+};
+
+#define TCA_DSMARK_MAX (__TCA_DSMARK_MAX - 1)
+
+/* ATM section */
+
+enum {
+ TCA_ATM_UNSPEC,
+ TCA_ATM_FD, /* file/socket descriptor */
+ TCA_ATM_PTR, /* pointer to descriptor - later */
+ TCA_ATM_HDR, /* LL header */
+ TCA_ATM_EXCESS, /* excess traffic class (0 for CLP) */
+ TCA_ATM_ADDR, /* PVC address (for output only) */
+ TCA_ATM_STATE, /* VC state (ATM_VS_*; for output only) */
+ __TCA_ATM_MAX,
+};
+
+#define TCA_ATM_MAX (__TCA_ATM_MAX - 1)
+
+/* Network emulator */
+
+enum
+{
+ TCA_NETEM_UNSPEC,
+ TCA_NETEM_CORR,
+ TCA_NETEM_DELAY_DIST,
+ TCA_NETEM_REORDER,
+ TCA_NETEM_CORRUPT,
+ __TCA_NETEM_MAX,
+};
+
+#define TCA_NETEM_MAX (__TCA_NETEM_MAX - 1)
+
+struct tc_netem_qopt
+{
+ __u32 latency; /* added delay (us) */
+ __u32 limit; /* fifo limit (packets) */
+ __u32 loss; /* random packet loss (0=none ~0=100%) */
+ __u32 gap; /* re-ordering gap (0 for none) */
+ __u32 duplicate; /* random packet dup (0=none ~0=100%) */
+ __u32 jitter; /* random jitter in latency (us) */
+};
+
+struct tc_netem_corr
+{
+ __u32 delay_corr; /* delay correlation */
+ __u32 loss_corr; /* packet loss correlation */
+ __u32 dup_corr; /* duplicate correlation */
+};
+
+struct tc_netem_reorder
+{
+ __u32 probability;
+ __u32 correlation;
+};
+
+struct tc_netem_corrupt
+{
+ __u32 probability;
+ __u32 correlation;
+};
+
+#define NETEM_DIST_SCALE 8192
+
+#endif
diff --git a/sysroot/usr/include/linux/pktcdvd.h b/sysroot/usr/include/linux/pktcdvd.h
new file mode 100644
index 0000000..eb6805f
--- /dev/null
+++ b/sysroot/usr/include/linux/pktcdvd.h
@@ -0,0 +1,111 @@
+/*
+ * Copyright (C) 2000 Jens Axboe <axboe@suse.de>
+ * Copyright (C) 2001-2004 Peter Osterlund <petero2@telia.com>
+ *
+ * May be copied or modified under the terms of the GNU General Public
+ * License. See linux/COPYING for more information.
+ *
+ * Packet writing layer for ATAPI and SCSI CD-R, CD-RW, DVD-R, and
+ * DVD-RW devices.
+ *
+ */
+#ifndef __PKTCDVD_H
+#define __PKTCDVD_H
+
+#include <linux/types.h>
+
+/*
+ * 1 for normal debug messages, 2 is very verbose. 0 to turn it off.
+ */
+#define PACKET_DEBUG 1
+
+#define MAX_WRITERS 8
+
+#define PKT_RB_POOL_SIZE 512
+
+/*
+ * How long we should hold a non-full packet before starting data gathering.
+ */
+#define PACKET_WAIT_TIME (HZ * 5 / 1000)
+
+/*
+ * use drive write caching -- we need deferred error handling to be
+ * able to sucessfully recover with this option (drive will return good
+ * status as soon as the cdb is validated).
+ */
+#if defined(CONFIG_CDROM_PKTCDVD_WCACHE)
+#define USE_WCACHING 1
+#else
+#define USE_WCACHING 0
+#endif
+
+/*
+ * No user-servicable parts beyond this point ->
+ */
+
+/*
+ * device types
+ */
+#define PACKET_CDR 1
+#define PACKET_CDRW 2
+#define PACKET_DVDR 3
+#define PACKET_DVDRW 4
+
+/*
+ * flags
+ */
+#define PACKET_WRITABLE 1 /* pd is writable */
+#define PACKET_NWA_VALID 2 /* next writable address valid */
+#define PACKET_LRA_VALID 3 /* last recorded address valid */
+#define PACKET_MERGE_SEGS 4 /* perform segment merging to keep */
+ /* underlying cdrom device happy */
+
+/*
+ * Disc status -- from READ_DISC_INFO
+ */
+#define PACKET_DISC_EMPTY 0
+#define PACKET_DISC_INCOMPLETE 1
+#define PACKET_DISC_COMPLETE 2
+#define PACKET_DISC_OTHER 3
+
+/*
+ * write type, and corresponding data block type
+ */
+#define PACKET_MODE1 1
+#define PACKET_MODE2 2
+#define PACKET_BLOCK_MODE1 8
+#define PACKET_BLOCK_MODE2 10
+
+/*
+ * Last session/border status
+ */
+#define PACKET_SESSION_EMPTY 0
+#define PACKET_SESSION_INCOMPLETE 1
+#define PACKET_SESSION_RESERVED 2
+#define PACKET_SESSION_COMPLETE 3
+
+#define PACKET_MCN "4a656e734178626f65323030300000"
+
+#undef PACKET_USE_LS
+
+#define PKT_CTRL_CMD_SETUP 0
+#define PKT_CTRL_CMD_TEARDOWN 1
+#define PKT_CTRL_CMD_STATUS 2
+
+struct pkt_ctrl_command {
+ __u32 command; /* in: Setup, teardown, status */
+ __u32 dev_index; /* in/out: Device index */
+ __u32 dev; /* in/out: Device nr for cdrw device */
+ __u32 pkt_dev; /* in/out: Device nr for packet device */
+ __u32 num_devices; /* out: Largest device index + 1 */
+ __u32 padding; /* Not used */
+};
+
+/*
+ * packet ioctls
+ */
+#define PACKET_IOCTL_MAGIC ('X')
+#define PACKET_CTRL_CMD _IOWR(PACKET_IOCTL_MAGIC, 1, struct pkt_ctrl_command)
+
+
+#endif /* __PKTCDVD_H */
diff --git a/sysroot/usr/include/linux/pmu.h b/sysroot/usr/include/linux/pmu.h
new file mode 100644
index 0000000..5a77399
--- /dev/null
+++ b/sysroot/usr/include/linux/pmu.h
@@ -0,0 +1,135 @@
+/*
+ * Definitions for talking to the PMU. The PMU is a microcontroller
+ * which controls battery charging and system power on PowerBook 3400
+ * and 2400 models as well as the RTC and various other things.
+ *
+ * Copyright (C) 1998 Paul Mackerras.
+ */
+
+
+#define PMU_DRIVER_VERSION 2
+
+/*
+ * PMU commands
+ */
+#define PMU_POWER_CTRL0 0x10 /* control power of some devices */
+#define PMU_POWER_CTRL 0x11 /* control power of some devices */
+#define PMU_ADB_CMD 0x20 /* send ADB packet */
+#define PMU_ADB_POLL_OFF 0x21 /* disable ADB auto-poll */
+#define PMU_WRITE_NVRAM 0x33 /* write non-volatile RAM */
+#define PMU_READ_NVRAM 0x3b /* read non-volatile RAM */
+#define PMU_SET_RTC 0x30 /* set real-time clock */
+#define PMU_READ_RTC 0x38 /* read real-time clock */
+#define PMU_SET_VOLBUTTON 0x40 /* set volume up/down position */
+#define PMU_BACKLIGHT_BRIGHT 0x41 /* set backlight brightness */
+#define PMU_GET_VOLBUTTON 0x48 /* get volume up/down position */
+#define PMU_PCEJECT 0x4c /* eject PC-card from slot */
+#define PMU_BATTERY_STATE 0x6b /* report battery state etc. */
+#define PMU_SMART_BATTERY_STATE 0x6f /* report battery state (new way) */
+#define PMU_SET_INTR_MASK 0x70 /* set PMU interrupt mask */
+#define PMU_INT_ACK 0x78 /* read interrupt bits */
+#define PMU_SHUTDOWN 0x7e /* turn power off */
+#define PMU_CPU_SPEED 0x7d /* control CPU speed on some models */
+#define PMU_SLEEP 0x7f /* put CPU to sleep */
+#define PMU_POWER_EVENTS 0x8f /* Send power-event commands to PMU */
+#define PMU_I2C_CMD 0x9a /* I2C operations */
+#define PMU_RESET 0xd0 /* reset CPU */
+#define PMU_GET_BRIGHTBUTTON 0xd9 /* report brightness up/down pos */
+#define PMU_GET_COVER 0xdc /* report cover open/closed */
+#define PMU_SYSTEM_READY 0xdf /* tell PMU we are awake */
+#define PMU_GET_VERSION 0xea /* read the PMU version */
+
+/* Bits to use with the PMU_POWER_CTRL0 command */
+#define PMU_POW0_ON 0x80 /* OR this to power ON the device */
+#define PMU_POW0_OFF 0x00 /* leave bit 7 to 0 to power it OFF */
+#define PMU_POW0_HARD_DRIVE 0x04 /* Hard drive power (on wallstreet/lombard ?) */
+
+/* Bits to use with the PMU_POWER_CTRL command */
+#define PMU_POW_ON 0x80 /* OR this to power ON the device */
+#define PMU_POW_OFF 0x00 /* leave bit 7 to 0 to power it OFF */
+#define PMU_POW_BACKLIGHT 0x01 /* backlight power */
+#define PMU_POW_CHARGER 0x02 /* battery charger power */
+#define PMU_POW_IRLED 0x04 /* IR led power (on wallstreet) */
+#define PMU_POW_MEDIABAY 0x08 /* media bay power (wallstreet/lombard ?) */
+
+/* Bits in PMU interrupt and interrupt mask bytes */
+#define PMU_INT_PCEJECT 0x04 /* PC-card eject buttons */
+#define PMU_INT_SNDBRT 0x08 /* sound/brightness up/down buttons */
+#define PMU_INT_ADB 0x10 /* ADB autopoll or reply data */
+#define PMU_INT_BATTERY 0x20 /* Battery state change */
+#define PMU_INT_ENVIRONMENT 0x40 /* Environment interrupts */
+#define PMU_INT_TICK 0x80 /* 1-second tick interrupt */
+
+/* Other bits in PMU interrupt valid when PMU_INT_ADB is set */
+#define PMU_INT_ADB_AUTO 0x04 /* ADB autopoll, when PMU_INT_ADB */
+#define PMU_INT_WAITING_CHARGER 0x01 /* ??? */
+#define PMU_INT_AUTO_SRQ_POLL 0x02 /* ??? */
+
+/* Bits in the environement message (either obtained via PMU_GET_COVER,
+ * or via PMU_INT_ENVIRONMENT on core99 */
+#define PMU_ENV_LID_CLOSED 0x01 /* The lid is closed */
+
+/* I2C related definitions */
+#define PMU_I2C_MODE_SIMPLE 0
+#define PMU_I2C_MODE_STDSUB 1
+#define PMU_I2C_MODE_COMBINED 2
+
+#define PMU_I2C_BUS_STATUS 0
+#define PMU_I2C_BUS_SYSCLK 1
+#define PMU_I2C_BUS_POWER 2
+
+#define PMU_I2C_STATUS_OK 0
+#define PMU_I2C_STATUS_DATAREAD 1
+#define PMU_I2C_STATUS_BUSY 0xfe
+
+
+/* Kind of PMU (model) */
+enum {
+ PMU_UNKNOWN,
+ PMU_OHARE_BASED, /* 2400, 3400, 3500 (old G3 powerbook) */
+ PMU_HEATHROW_BASED, /* PowerBook G3 series */
+ PMU_PADDINGTON_BASED, /* 1999 PowerBook G3 */
+ PMU_KEYLARGO_BASED, /* Core99 motherboard (PMU99) */
+ PMU_68K_V1, /* 68K PMU, version 1 */
+ PMU_68K_V2, /* 68K PMU, version 2 */
+};
+
+/* PMU PMU_POWER_EVENTS commands */
+enum {
+ PMU_PWR_GET_POWERUP_EVENTS = 0x00,
+ PMU_PWR_SET_POWERUP_EVENTS = 0x01,
+ PMU_PWR_CLR_POWERUP_EVENTS = 0x02,
+ PMU_PWR_GET_WAKEUP_EVENTS = 0x03,
+ PMU_PWR_SET_WAKEUP_EVENTS = 0x04,
+ PMU_PWR_CLR_WAKEUP_EVENTS = 0x05,
+};
+
+/* Power events wakeup bits */
+enum {
+ PMU_PWR_WAKEUP_KEY = 0x01, /* Wake on key press */
+ PMU_PWR_WAKEUP_AC_INSERT = 0x02, /* Wake on AC adapter plug */
+ PMU_PWR_WAKEUP_AC_CHANGE = 0x04,
+ PMU_PWR_WAKEUP_LID_OPEN = 0x08,
+ PMU_PWR_WAKEUP_RING = 0x10,
+};
+
+/*
+ * Ioctl commands for the /dev/pmu device
+ */
+#include <linux/ioctl.h>
+
+/* no param */
+#define PMU_IOC_SLEEP _IO('B', 0)
+/* out param: u32* backlight value: 0 to 15 */
+#define PMU_IOC_GET_BACKLIGHT _IOR('B', 1, size_t)
+/* in param: u32 backlight value: 0 to 15 */
+#define PMU_IOC_SET_BACKLIGHT _IOW('B', 2, size_t)
+/* out param: u32* PMU model */
+#define PMU_IOC_GET_MODEL _IOR('B', 3, size_t)
+/* out param: u32* has_adb: 0 or 1 */
+#define PMU_IOC_HAS_ADB _IOR('B', 4, size_t)
+/* out param: u32* can_sleep: 0 or 1 */
+#define PMU_IOC_CAN_SLEEP _IOR('B', 5, size_t)
+/* no param, but historically was _IOR('B', 6, 0), meaning 4 bytes */
+#define PMU_IOC_GRAB_BACKLIGHT _IOR('B', 6, size_t)
+
diff --git a/sysroot/usr/include/linux/poll.h b/sysroot/usr/include/linux/poll.h
new file mode 100644
index 0000000..421b305
--- /dev/null
+++ b/sysroot/usr/include/linux/poll.h
@@ -0,0 +1,7 @@
+#ifndef _LINUX_POLL_H
+#define _LINUX_POLL_H
+
+#include <asm/poll.h>
+
+
+#endif /* _LINUX_POLL_H */
diff --git a/sysroot/usr/include/linux/posix_types.h b/sysroot/usr/include/linux/posix_types.h
new file mode 100644
index 0000000..f04c98c
--- /dev/null
+++ b/sysroot/usr/include/linux/posix_types.h
@@ -0,0 +1,49 @@
+#ifndef _LINUX_POSIX_TYPES_H
+#define _LINUX_POSIX_TYPES_H
+
+#include <linux/stddef.h>
+
+/*
+ * This allows for 1024 file descriptors: if NR_OPEN is ever grown
+ * beyond that you'll have to change this too. But 1024 fd's seem to be
+ * enough even for such "real" unices like OSF/1, so hopefully this is
+ * one limit that doesn't have to be changed [again].
+ *
+ * Note that POSIX wants the FD_CLEAR(fd,fdsetp) defines to be in
+ * <sys/time.h> (and thus <linux/time.h>) - but this is a more logical
+ * place for them. Solved by having dummy defines in <sys/time.h>.
+ */
+
+/*
+ * Those macros may have been defined in <gnu/types.h>. But we always
+ * use the ones here.
+ */
+#undef __NFDBITS
+#define __NFDBITS (8 * sizeof(unsigned long))
+
+#undef __FD_SETSIZE
+#define __FD_SETSIZE 1024
+
+#undef __FDSET_LONGS
+#define __FDSET_LONGS (__FD_SETSIZE/__NFDBITS)
+
+#undef __FDELT
+#define __FDELT(d) ((d) / __NFDBITS)
+
+#undef __FDMASK
+#define __FDMASK(d) (1UL << ((d) % __NFDBITS))
+
+typedef struct {
+ unsigned long fds_bits [__FDSET_LONGS];
+} __kernel_fd_set;
+
+/* Type of a signal handler. */
+typedef void (*__kernel_sighandler_t)(int);
+
+/* Type of a SYSV IPC key. */
+typedef int __kernel_key_t;
+typedef int __kernel_mqd_t;
+
+#include <asm/posix_types.h>
+
+#endif /* _LINUX_POSIX_TYPES_H */
diff --git a/sysroot/usr/include/linux/ppdev.h b/sysroot/usr/include/linux/ppdev.h
new file mode 100644
index 0000000..dc18c5d
--- /dev/null
+++ b/sysroot/usr/include/linux/ppdev.h
@@ -0,0 +1,99 @@
+/*
+ * linux/include/linux/ppdev.h
+ *
+ * User-space parallel port device driver (header file).
+ *
+ * Copyright (C) 1998-9 Tim Waugh <tim@cyberelk.demon.co.uk>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ * Added PPGETTIME/PPSETTIME, Fred Barnes, 1999
+ * Added PPGETMODES/PPGETMODE/PPGETPHASE, Fred Barnes <frmb2@ukc.ac.uk>, 03/01/2001
+ */
+
+#define PP_IOCTL 'p'
+
+/* Set mode for read/write (e.g. IEEE1284_MODE_EPP) */
+#define PPSETMODE _IOW(PP_IOCTL, 0x80, int)
+
+/* Read status */
+#define PPRSTATUS _IOR(PP_IOCTL, 0x81, unsigned char)
+#define PPWSTATUS OBSOLETE__IOW(PP_IOCTL, 0x82, unsigned char)
+
+/* Read/write control */
+#define PPRCONTROL _IOR(PP_IOCTL, 0x83, unsigned char)
+#define PPWCONTROL _IOW(PP_IOCTL, 0x84, unsigned char)
+
+struct ppdev_frob_struct {
+ unsigned char mask;
+ unsigned char val;
+};
+#define PPFCONTROL _IOW(PP_IOCTL, 0x8e, struct ppdev_frob_struct)
+
+/* Read/write data */
+#define PPRDATA _IOR(PP_IOCTL, 0x85, unsigned char)
+#define PPWDATA _IOW(PP_IOCTL, 0x86, unsigned char)
+
+/* Read/write econtrol (not used) */
+#define PPRECONTROL OBSOLETE__IOR(PP_IOCTL, 0x87, unsigned char)
+#define PPWECONTROL OBSOLETE__IOW(PP_IOCTL, 0x88, unsigned char)
+
+/* Read/write FIFO (not used) */
+#define PPRFIFO OBSOLETE__IOR(PP_IOCTL, 0x89, unsigned char)
+#define PPWFIFO OBSOLETE__IOW(PP_IOCTL, 0x8a, unsigned char)
+
+/* Claim the port to start using it */
+#define PPCLAIM _IO(PP_IOCTL, 0x8b)
+
+/* Release the port when you aren't using it */
+#define PPRELEASE _IO(PP_IOCTL, 0x8c)
+
+/* Yield the port (release it if another driver is waiting,
+ * then reclaim) */
+#define PPYIELD _IO(PP_IOCTL, 0x8d)
+
+/* Register device exclusively (must be before PPCLAIM). */
+#define PPEXCL _IO(PP_IOCTL, 0x8f)
+
+/* Data line direction: non-zero for input mode. */
+#define PPDATADIR _IOW(PP_IOCTL, 0x90, int)
+
+/* Negotiate a particular IEEE 1284 mode. */
+#define PPNEGOT _IOW(PP_IOCTL, 0x91, int)
+
+/* Set control lines when an interrupt occurs. */
+#define PPWCTLONIRQ _IOW(PP_IOCTL, 0x92, unsigned char)
+
+/* Clear (and return) interrupt count. */
+#define PPCLRIRQ _IOR(PP_IOCTL, 0x93, int)
+
+/* Set the IEEE 1284 phase that we're in (e.g. IEEE1284_PH_FWD_IDLE) */
+#define PPSETPHASE _IOW(PP_IOCTL, 0x94, int)
+
+/* Set and get port timeout (struct timeval's) */
+#define PPGETTIME _IOR(PP_IOCTL, 0x95, struct timeval)
+#define PPSETTIME _IOW(PP_IOCTL, 0x96, struct timeval)
+
+/* Get available modes (what the hardware can do) */
+#define PPGETMODES _IOR(PP_IOCTL, 0x97, unsigned int)
+
+/* Get the current mode and phaze */
+#define PPGETMODE _IOR(PP_IOCTL, 0x98, int)
+#define PPGETPHASE _IOR(PP_IOCTL, 0x99, int)
+
+/* get/set flags */
+#define PPGETFLAGS _IOR(PP_IOCTL, 0x9a, int)
+#define PPSETFLAGS _IOW(PP_IOCTL, 0x9b, int)
+
+/* flags visible to the world */
+#define PP_FASTWRITE (1<<2)
+#define PP_FASTREAD (1<<3)
+#define PP_W91284PIC (1<<4)
+
+/* only masks user-visible flags */
+#define PP_FLAGMASK (PP_FASTWRITE | PP_FASTREAD | PP_W91284PIC)
+
+
diff --git a/sysroot/usr/include/linux/ppp-comp.h b/sysroot/usr/include/linux/ppp-comp.h
new file mode 100644
index 0000000..6abd338
--- /dev/null
+++ b/sysroot/usr/include/linux/ppp-comp.h
@@ -0,0 +1,212 @@
+/*
+ * ppp-comp.h - Definitions for doing PPP packet compression.
+ *
+ * Copyright (c) 1994 The Australian National University.
+ * All rights reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation is hereby granted, provided that the above copyright
+ * notice appears in all copies. This software is provided without any
+ * warranty, express or implied. The Australian National University
+ * makes no representations about the suitability of this software for
+ * any purpose.
+ *
+ * IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY
+ * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+ * THE AUSTRALIAN NATIONAL UNIVERSITY HAVE BEEN ADVISED OF THE POSSIBILITY
+ * OF SUCH DAMAGE.
+ *
+ * THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
+ * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO
+ * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
+ * OR MODIFICATIONS.
+ *
+ * $Id: ppp-comp.h,v 1.6 1997/11/27 06:04:44 paulus Exp $
+ */
+
+/*
+ * ==FILEVERSION 980319==
+ *
+ * NOTE TO MAINTAINERS:
+ * If you modify this file at all, please set the above date.
+ * ppp-comp.h is shipped with a PPP distribution as well as with the kernel;
+ * if everyone increases the FILEVERSION number above, then scripts
+ * can do the right thing when deciding whether to install a new ppp-comp.h
+ * file. Don't change the format of that line otherwise, so the
+ * installation script can recognize it.
+ */
+
+#ifndef _NET_PPP_COMP_H
+#define _NET_PPP_COMP_H
+
+struct module;
+
+/*
+ * The following symbols control whether we include code for
+ * various compression methods.
+ */
+
+#ifndef DO_BSD_COMPRESS
+#define DO_BSD_COMPRESS 1 /* by default, include BSD-Compress */
+#endif
+#ifndef DO_DEFLATE
+#define DO_DEFLATE 1 /* by default, include Deflate */
+#endif
+#define DO_PREDICTOR_1 0
+#define DO_PREDICTOR_2 0
+
+/*
+ * Structure giving methods for compression/decompression.
+ */
+
+struct compressor {
+ int compress_proto; /* CCP compression protocol number */
+
+ /* Allocate space for a compressor (transmit side) */
+ void *(*comp_alloc) (unsigned char *options, int opt_len);
+
+ /* Free space used by a compressor */
+ void (*comp_free) (void *state);
+
+ /* Initialize a compressor */
+ int (*comp_init) (void *state, unsigned char *options,
+ int opt_len, int unit, int opthdr, int debug);
+
+ /* Reset a compressor */
+ void (*comp_reset) (void *state);
+
+ /* Compress a packet */
+ int (*compress) (void *state, unsigned char *rptr,
+ unsigned char *obuf, int isize, int osize);
+
+ /* Return compression statistics */
+ void (*comp_stat) (void *state, struct compstat *stats);
+
+ /* Allocate space for a decompressor (receive side) */
+ void *(*decomp_alloc) (unsigned char *options, int opt_len);
+
+ /* Free space used by a decompressor */
+ void (*decomp_free) (void *state);
+
+ /* Initialize a decompressor */
+ int (*decomp_init) (void *state, unsigned char *options,
+ int opt_len, int unit, int opthdr, int mru,
+ int debug);
+
+ /* Reset a decompressor */
+ void (*decomp_reset) (void *state);
+
+ /* Decompress a packet. */
+ int (*decompress) (void *state, unsigned char *ibuf, int isize,
+ unsigned char *obuf, int osize);
+
+ /* Update state for an incompressible packet received */
+ void (*incomp) (void *state, unsigned char *ibuf, int icnt);
+
+ /* Return decompression statistics */
+ void (*decomp_stat) (void *state, struct compstat *stats);
+
+ /* Used in locking compressor modules */
+ struct module *owner;
+ /* Extra skb space needed by the compressor algorithm */
+ unsigned int comp_extra;
+};
+
+/*
+ * The return value from decompress routine is the length of the
+ * decompressed packet if successful, otherwise DECOMP_ERROR
+ * or DECOMP_FATALERROR if an error occurred.
+ *
+ * We need to make this distinction so that we can disable certain
+ * useful functionality, namely sending a CCP reset-request as a result
+ * of an error detected after decompression. This is to avoid infringing
+ * a patent held by Motorola.
+ * Don't you just lurve software patents.
+ */
+
+#define DECOMP_ERROR -1 /* error detected before decomp. */
+#define DECOMP_FATALERROR -2 /* error detected after decomp. */
+
+/*
+ * CCP codes.
+ */
+
+#define CCP_CONFREQ 1
+#define CCP_CONFACK 2
+#define CCP_TERMREQ 5
+#define CCP_TERMACK 6
+#define CCP_RESETREQ 14
+#define CCP_RESETACK 15
+
+/*
+ * Max # bytes for a CCP option
+ */
+
+#define CCP_MAX_OPTION_LENGTH 32
+
+/*
+ * Parts of a CCP packet.
+ */
+
+#define CCP_CODE(dp) ((dp)[0])
+#define CCP_ID(dp) ((dp)[1])
+#define CCP_LENGTH(dp) (((dp)[2] << 8) + (dp)[3])
+#define CCP_HDRLEN 4
+
+#define CCP_OPT_CODE(dp) ((dp)[0])
+#define CCP_OPT_LENGTH(dp) ((dp)[1])
+#define CCP_OPT_MINLEN 2
+
+/*
+ * Definitions for BSD-Compress.
+ */
+
+#define CI_BSD_COMPRESS 21 /* config. option for BSD-Compress */
+#define CILEN_BSD_COMPRESS 3 /* length of config. option */
+
+/* Macros for handling the 3rd byte of the BSD-Compress config option. */
+#define BSD_NBITS(x) ((x) & 0x1F) /* number of bits requested */
+#define BSD_VERSION(x) ((x) >> 5) /* version of option format */
+#define BSD_CURRENT_VERSION 1 /* current version number */
+#define BSD_MAKE_OPT(v, n) (((v) << 5) | (n))
+
+#define BSD_MIN_BITS 9 /* smallest code size supported */
+#define BSD_MAX_BITS 15 /* largest code size supported */
+
+/*
+ * Definitions for Deflate.
+ */
+
+#define CI_DEFLATE 26 /* config option for Deflate */
+#define CI_DEFLATE_DRAFT 24 /* value used in original draft RFC */
+#define CILEN_DEFLATE 4 /* length of its config option */
+
+#define DEFLATE_MIN_SIZE 9
+#define DEFLATE_MAX_SIZE 15
+#define DEFLATE_METHOD_VAL 8
+#define DEFLATE_SIZE(x) (((x) >> 4) + 8)
+#define DEFLATE_METHOD(x) ((x) & 0x0F)
+#define DEFLATE_MAKE_OPT(w) ((((w) - 8) << 4) + DEFLATE_METHOD_VAL)
+#define DEFLATE_CHK_SEQUENCE 0
+
+/*
+ * Definitions for MPPE.
+ */
+
+#define CI_MPPE 18 /* config option for MPPE */
+#define CILEN_MPPE 6 /* length of config option */
+
+/*
+ * Definitions for other, as yet unsupported, compression methods.
+ */
+
+#define CI_PREDICTOR_1 1 /* config option for Predictor-1 */
+#define CILEN_PREDICTOR_1 2 /* length of its config option */
+#define CI_PREDICTOR_2 2 /* config option for Predictor-2 */
+#define CILEN_PREDICTOR_2 2 /* length of its config option */
+
+
+#endif /* _NET_PPP_COMP_H */
diff --git a/sysroot/usr/include/linux/ppp_defs.h b/sysroot/usr/include/linux/ppp_defs.h
new file mode 100644
index 0000000..eb832ec
--- /dev/null
+++ b/sysroot/usr/include/linux/ppp_defs.h
@@ -0,0 +1,180 @@
+/* $Id: ppp_defs.h,v 1.2 1994/09/21 01:31:06 paulus Exp $ */
+
+/*
+ * ppp_defs.h - PPP definitions.
+ *
+ * Copyright (c) 1994 The Australian National University.
+ * All rights reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation is hereby granted, provided that the above copyright
+ * notice appears in all copies. This software is provided without any
+ * warranty, express or implied. The Australian National University
+ * makes no representations about the suitability of this software for
+ * any purpose.
+ *
+ * IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY
+ * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+ * THE AUSTRALIAN NATIONAL UNIVERSITY HAVE BEEN ADVISED OF THE POSSIBILITY
+ * OF SUCH DAMAGE.
+ *
+ * THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
+ * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO
+ * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
+ * OR MODIFICATIONS.
+ */
+
+/*
+ * ==FILEVERSION 20000114==
+ *
+ * NOTE TO MAINTAINERS:
+ * If you modify this file at all, please set the above date.
+ * ppp_defs.h is shipped with a PPP distribution as well as with the kernel;
+ * if everyone increases the FILEVERSION number above, then scripts
+ * can do the right thing when deciding whether to install a new ppp_defs.h
+ * file. Don't change the format of that line otherwise, so the
+ * installation script can recognize it.
+ */
+
+#ifndef _PPP_DEFS_H_
+#define _PPP_DEFS_H_
+
+/*
+ * The basic PPP frame.
+ */
+#define PPP_HDRLEN 4 /* octets for standard ppp header */
+#define PPP_FCSLEN 2 /* octets for FCS */
+#define PPP_MRU 1500 /* default MRU = max length of info field */
+
+#define PPP_ADDRESS(p) (((__u8 *)(p))[0])
+#define PPP_CONTROL(p) (((__u8 *)(p))[1])
+#define PPP_PROTOCOL(p) ((((__u8 *)(p))[2] << 8) + ((__u8 *)(p))[3])
+
+/*
+ * Significant octet values.
+ */
+#define PPP_ALLSTATIONS 0xff /* All-Stations broadcast address */
+#define PPP_UI 0x03 /* Unnumbered Information */
+#define PPP_FLAG 0x7e /* Flag Sequence */
+#define PPP_ESCAPE 0x7d /* Asynchronous Control Escape */
+#define PPP_TRANS 0x20 /* Asynchronous transparency modifier */
+
+/*
+ * Protocol field values.
+ */
+#define PPP_IP 0x21 /* Internet Protocol */
+#define PPP_AT 0x29 /* AppleTalk Protocol */
+#define PPP_IPX 0x2b /* IPX protocol */
+#define PPP_VJC_COMP 0x2d /* VJ compressed TCP */
+#define PPP_VJC_UNCOMP 0x2f /* VJ uncompressed TCP */
+#define PPP_MP 0x3d /* Multilink protocol */
+#define PPP_IPV6 0x57 /* Internet Protocol Version 6 */
+#define PPP_COMPFRAG 0xfb /* fragment compressed below bundle */
+#define PPP_COMP 0xfd /* compressed packet */
+#define PPP_MPLS_UC 0x0281 /* Multi Protocol Label Switching - Unicast */
+#define PPP_MPLS_MC 0x0283 /* Multi Protocol Label Switching - Multicast */
+#define PPP_IPCP 0x8021 /* IP Control Protocol */
+#define PPP_ATCP 0x8029 /* AppleTalk Control Protocol */
+#define PPP_IPXCP 0x802b /* IPX Control Protocol */
+#define PPP_IPV6CP 0x8057 /* IPv6 Control Protocol */
+#define PPP_CCPFRAG 0x80fb /* CCP at link level (below MP bundle) */
+#define PPP_CCP 0x80fd /* Compression Control Protocol */
+#define PPP_MPLSCP 0x80fd /* MPLS Control Protocol */
+#define PPP_LCP 0xc021 /* Link Control Protocol */
+#define PPP_PAP 0xc023 /* Password Authentication Protocol */
+#define PPP_LQR 0xc025 /* Link Quality Report protocol */
+#define PPP_CHAP 0xc223 /* Cryptographic Handshake Auth. Protocol */
+#define PPP_CBCP 0xc029 /* Callback Control Protocol */
+
+/*
+ * Values for FCS calculations.
+ */
+
+#define PPP_INITFCS 0xffff /* Initial FCS value */
+#define PPP_GOODFCS 0xf0b8 /* Good final FCS value */
+
+
+/*
+ * Extended asyncmap - allows any character to be escaped.
+ */
+
+typedef __u32 ext_accm[8];
+
+/*
+ * What to do with network protocol (NP) packets.
+ */
+enum NPmode {
+ NPMODE_PASS, /* pass the packet through */
+ NPMODE_DROP, /* silently drop the packet */
+ NPMODE_ERROR, /* return an error */
+ NPMODE_QUEUE /* save it up for later. */
+};
+
+/*
+ * Statistics for LQRP and pppstats
+ */
+struct pppstat {
+ __u32 ppp_discards; /* # frames discarded */
+
+ __u32 ppp_ibytes; /* bytes received */
+ __u32 ppp_ioctects; /* bytes received not in error */
+ __u32 ppp_ipackets; /* packets received */
+ __u32 ppp_ierrors; /* receive errors */
+ __u32 ppp_ilqrs; /* # LQR frames received */
+
+ __u32 ppp_obytes; /* raw bytes sent */
+ __u32 ppp_ooctects; /* frame bytes sent */
+ __u32 ppp_opackets; /* packets sent */
+ __u32 ppp_oerrors; /* transmit errors */
+ __u32 ppp_olqrs; /* # LQR frames sent */
+};
+
+struct vjstat {
+ __u32 vjs_packets; /* outbound packets */
+ __u32 vjs_compressed; /* outbound compressed packets */
+ __u32 vjs_searches; /* searches for connection state */
+ __u32 vjs_misses; /* times couldn't find conn. state */
+ __u32 vjs_uncompressedin; /* inbound uncompressed packets */
+ __u32 vjs_compressedin; /* inbound compressed packets */
+ __u32 vjs_errorin; /* inbound unknown type packets */
+ __u32 vjs_tossed; /* inbound packets tossed because of error */
+};
+
+struct compstat {
+ __u32 unc_bytes; /* total uncompressed bytes */
+ __u32 unc_packets; /* total uncompressed packets */
+ __u32 comp_bytes; /* compressed bytes */
+ __u32 comp_packets; /* compressed packets */
+ __u32 inc_bytes; /* incompressible bytes */
+ __u32 inc_packets; /* incompressible packets */
+
+ /* the compression ratio is defined as in_count / bytes_out */
+ __u32 in_count; /* Bytes received */
+ __u32 bytes_out; /* Bytes transmitted */
+
+ double ratio; /* not computed in kernel. */
+};
+
+struct ppp_stats {
+ struct pppstat p; /* basic PPP statistics */
+ struct vjstat vj; /* VJ header compression statistics */
+};
+
+struct ppp_comp_stats {
+ struct compstat c; /* packet compression statistics */
+ struct compstat d; /* packet decompression statistics */
+};
+
+/*
+ * The following structure records the time in seconds since
+ * the last NP packet was sent or received.
+ */
+struct ppp_idle {
+ time_t xmit_idle; /* time since last NP packet sent */
+ time_t recv_idle; /* time since last NP packet received */
+};
+
+#endif /* _PPP_DEFS_H_ */
diff --git a/sysroot/usr/include/linux/prctl.h b/sysroot/usr/include/linux/prctl.h
new file mode 100644
index 0000000..e2eff90
--- /dev/null
+++ b/sysroot/usr/include/linux/prctl.h
@@ -0,0 +1,66 @@
+#ifndef _LINUX_PRCTL_H
+#define _LINUX_PRCTL_H
+
+/* Values to pass as first argument to prctl() */
+
+#define PR_SET_PDEATHSIG 1 /* Second arg is a signal */
+#define PR_GET_PDEATHSIG 2 /* Second arg is a ptr to return the signal */
+
+/* Get/set current->mm->dumpable */
+#define PR_GET_DUMPABLE 3
+#define PR_SET_DUMPABLE 4
+
+/* Get/set unaligned access control bits (if meaningful) */
+#define PR_GET_UNALIGN 5
+#define PR_SET_UNALIGN 6
+# define PR_UNALIGN_NOPRINT 1 /* silently fix up unaligned user accesses */
+# define PR_UNALIGN_SIGBUS 2 /* generate SIGBUS on unaligned user access */
+
+/* Get/set whether or not to drop capabilities on setuid() away from uid 0 */
+#define PR_GET_KEEPCAPS 7
+#define PR_SET_KEEPCAPS 8
+
+/* Get/set floating-point emulation control bits (if meaningful) */
+#define PR_GET_FPEMU 9
+#define PR_SET_FPEMU 10
+# define PR_FPEMU_NOPRINT 1 /* silently emulate fp operations accesses */
+# define PR_FPEMU_SIGFPE 2 /* don't emulate fp operations, send SIGFPE instead */
+
+/* Get/set floating-point exception mode (if meaningful) */
+#define PR_GET_FPEXC 11
+#define PR_SET_FPEXC 12
+# define PR_FP_EXC_SW_ENABLE 0x80 /* Use FPEXC for FP exception enables */
+# define PR_FP_EXC_DIV 0x010000 /* floating point divide by zero */
+# define PR_FP_EXC_OVF 0x020000 /* floating point overflow */
+# define PR_FP_EXC_UND 0x040000 /* floating point underflow */
+# define PR_FP_EXC_RES 0x080000 /* floating point inexact result */
+# define PR_FP_EXC_INV 0x100000 /* floating point invalid operation */
+# define PR_FP_EXC_DISABLED 0 /* FP exceptions disabled */
+# define PR_FP_EXC_NONRECOV 1 /* async non-recoverable exc. mode */
+# define PR_FP_EXC_ASYNC 2 /* async recoverable exception mode */
+# define PR_FP_EXC_PRECISE 3 /* precise exception mode */
+
+/* Get/set whether we use statistical process timing or accurate timestamp
+ * based process timing */
+#define PR_GET_TIMING 13
+#define PR_SET_TIMING 14
+# define PR_TIMING_STATISTICAL 0 /* Normal, traditional,
+ statistical process timing */
+# define PR_TIMING_TIMESTAMP 1 /* Accurate timestamp based
+ process timing */
+
+#define PR_SET_NAME 15 /* Set process name */
+#define PR_GET_NAME 16 /* Get process name */
+
+/* Get/set process endian */
+#define PR_GET_ENDIAN 19
+#define PR_SET_ENDIAN 20
+# define PR_ENDIAN_BIG 0
+# define PR_ENDIAN_LITTLE 1 /* True little endian mode */
+# define PR_ENDIAN_PPC_LITTLE 2 /* "PowerPC" pseudo little endian */
+
+/* Get/set process seccomp mode */
+#define PR_GET_SECCOMP 21
+#define PR_SET_SECCOMP 22
+
+#endif /* _LINUX_PRCTL_H */
diff --git a/sysroot/usr/include/linux/ps2esdi.h b/sysroot/usr/include/linux/ps2esdi.h
new file mode 100644
index 0000000..c0e050b
--- /dev/null
+++ b/sysroot/usr/include/linux/ps2esdi.h
@@ -0,0 +1,98 @@
+#ifndef _PS2ESDI_H_
+#define _PS2ESDI_H_
+
+#define NRML_ESDI_ID 0xddff
+#define INTG_ESDI_ID 0xdf9f
+
+#define PRIMARY_IO_BASE 0x3510
+#define ALT_IO_BASE 0x3518
+
+#define ESDI_CMD_INT (io_base+0)
+#define ESDI_STT_INT (io_base+0)
+#define ESDI_CONTROL (io_base+2)
+#define ESDI_STATUS (io_base+2)
+#define ESDI_ATTN (io_base+3)
+#define ESDI_INTRPT (io_base+3)
+
+#define STATUS_ENABLED 0x01
+#define STATUS_ALTERNATE 0x02
+#define STATUS_BUSY 0x10
+#define STATUS_STAT_AVAIL 0x08
+#define STATUS_INTR 0x01
+#define STATUS_RESET_FAIL 0xea
+#define STATUS_CMD_INF 0x04
+
+#define CTRL_SOFT_RESET 0xe4
+#define CTRL_HARD_RESET 0x80
+#define CTRL_EOI 0xe2
+#define CTRL_ENABLE_DMA 0x02
+#define CTRL_ENABLE_INTR 0x01
+#define CTRL_DISABLE_INTR 0x00
+
+#define ATT_EOI 0x02
+
+/* bits of word 0 of configuration status block. more info see p.38 of tech ref */
+#define CONFIG_IS 0x10 /* Invalid Secondary */
+#define CONFIG_ZD 0x08 /* Zero Defect */
+#define CONFIG_SF 0x04 /* Skewed Format */
+#define CONFIG_FR 0x02 /* Removable */
+#define CONFIG_RT 0x01 /* Retries */
+
+#define PORT_SYS_A 0x92
+#define PORT_DMA_FN 0x18
+#define PORT_DMA_EX 0x1a
+
+#define ON (unsigned char)0x40
+#define OFF (unsigned char)~ON
+#define LITE_ON outb(inb(PORT_SYS_A) | ON,PORT_SYS_A)
+#define LITE_OFF outb((inb(PORT_SYS_A) & OFF),PORT_SYS_A)
+
+#define FAIL 0
+#define SUCCES 1
+
+#define INT_CMD_COMPLETE 0x01
+#define INT_CMD_ECC 0x03
+#define INT_CMD_RETRY 0x05
+#define INT_CMD_FORMAT 0x06
+#define INT_CMD_ECC_RETRY 0x07
+#define INT_CMD_WARNING 0x08
+#define INT_CMD_ABORT 0x09
+#define INT_RESET 0x0A
+#define INT_TRANSFER_REQ 0x0B
+#define INT_CMD_FAILED 0x0C
+#define INT_DMA_ERR 0x0D
+#define INT_CMD_BLK_ERR 0x0E
+#define INT_ATTN_ERROR 0x0F
+
+#define DMA_MASK_CHAN 0x90
+#define DMA_UNMASK_CHAN 0xA0
+#define DMA_WRITE_ADDR 0x20
+#define DMA_WRITE_TC 0x40
+#define DMA_WRITE_MODE 0x70
+
+#define CMD_GET_DEV_CONFIG 0x09
+#define CMD_READ 0x4601
+#define CMD_WRITE 0x4602
+#define DMA_READ_16 0x4C
+#define DMA_WRITE_16 0x44
+
+
+#define MB 1024*1024
+#define SECT_SIZE 512
+
+#define ERROR 1
+#define OK 0
+
+#define HDIO_GETGEO 0x0301
+
+#define FALSE 0
+#define TRUE !FALSE
+
+struct ps2esdi_geometry {
+ unsigned char heads;
+ unsigned char sectors;
+ unsigned short cylinders;
+ unsigned long start;
+};
+
+#endif /* _PS2ESDI_H_ */
diff --git a/sysroot/usr/include/linux/ptrace.h b/sysroot/usr/include/linux/ptrace.h
new file mode 100644
index 0000000..6e66b68
--- /dev/null
+++ b/sysroot/usr/include/linux/ptrace.h
@@ -0,0 +1,52 @@
+#ifndef _LINUX_PTRACE_H
+#define _LINUX_PTRACE_H
+/* ptrace.h */
+/* structs and defines to help the user use the ptrace system call. */
+
+/* has the defines to get at the registers. */
+
+#define PTRACE_TRACEME 0
+#define PTRACE_PEEKTEXT 1
+#define PTRACE_PEEKDATA 2
+#define PTRACE_PEEKUSR 3
+#define PTRACE_POKETEXT 4
+#define PTRACE_POKEDATA 5
+#define PTRACE_POKEUSR 6
+#define PTRACE_CONT 7
+#define PTRACE_KILL 8
+#define PTRACE_SINGLESTEP 9
+
+#define PTRACE_ATTACH 16
+#define PTRACE_DETACH 17
+
+#define PTRACE_SYSCALL 24
+
+/* 0x4200-0x4300 are reserved for architecture-independent additions. */
+#define PTRACE_SETOPTIONS 0x4200
+#define PTRACE_GETEVENTMSG 0x4201
+#define PTRACE_GETSIGINFO 0x4202
+#define PTRACE_SETSIGINFO 0x4203
+
+/* options set using PTRACE_SETOPTIONS */
+#define PTRACE_O_TRACESYSGOOD 0x00000001
+#define PTRACE_O_TRACEFORK 0x00000002
+#define PTRACE_O_TRACEVFORK 0x00000004
+#define PTRACE_O_TRACECLONE 0x00000008
+#define PTRACE_O_TRACEEXEC 0x00000010
+#define PTRACE_O_TRACEVFORKDONE 0x00000020
+#define PTRACE_O_TRACEEXIT 0x00000040
+
+#define PTRACE_O_MASK 0x0000007f
+
+/* Wait extended result codes for the above trace options. */
+#define PTRACE_EVENT_FORK 1
+#define PTRACE_EVENT_VFORK 2
+#define PTRACE_EVENT_CLONE 3
+#define PTRACE_EVENT_EXEC 4
+#define PTRACE_EVENT_VFORK_DONE 5
+#define PTRACE_EVENT_EXIT 6
+
+#include <asm/ptrace.h>
+
+
+#endif
diff --git a/sysroot/usr/include/linux/qnx4_fs.h b/sysroot/usr/include/linux/qnx4_fs.h
new file mode 100644
index 0000000..93cfc29
--- /dev/null
+++ b/sysroot/usr/include/linux/qnx4_fs.h
@@ -0,0 +1,91 @@
+/*
+ * Name : qnx4_fs.h
+ * Author : Richard Frowijn
+ * Function : qnx4 global filesystem definitions
+ * Version : 1.0.2
+ * Last modified : 2000-01-31
+ *
+ * History : 23-03-1998 created
+ */
+#ifndef _LINUX_QNX4_FS_H
+#define _LINUX_QNX4_FS_H
+
+#include <linux/qnxtypes.h>
+#include <linux/magic.h>
+
+#define QNX4_ROOT_INO 1
+
+#define QNX4_MAX_XTNTS_PER_XBLK 60
+/* for di_status */
+#define QNX4_FILE_USED 0x01
+#define QNX4_FILE_MODIFIED 0x02
+#define QNX4_FILE_BUSY 0x04
+#define QNX4_FILE_LINK 0x08
+#define QNX4_FILE_INODE 0x10
+#define QNX4_FILE_FSYSCLEAN 0x20
+
+#define QNX4_I_MAP_SLOTS 8
+#define QNX4_Z_MAP_SLOTS 64
+#define QNX4_VALID_FS 0x0001 /* Clean fs. */
+#define QNX4_ERROR_FS 0x0002 /* fs has errors. */
+#define QNX4_BLOCK_SIZE 0x200 /* blocksize of 512 bytes */
+#define QNX4_BLOCK_SIZE_BITS 9 /* blocksize shift */
+#define QNX4_DIR_ENTRY_SIZE 0x040 /* dir entry size of 64 bytes */
+#define QNX4_DIR_ENTRY_SIZE_BITS 6 /* dir entry size shift */
+#define QNX4_XBLK_ENTRY_SIZE 0x200 /* xblk entry size */
+#define QNX4_INODES_PER_BLOCK 0x08 /* 512 / 64 */
+
+/* for filenames */
+#define QNX4_SHORT_NAME_MAX 16
+#define QNX4_NAME_MAX 48
+
+/*
+ * This is the original qnx4 inode layout on disk.
+ */
+struct qnx4_inode_entry {
+ char di_fname[QNX4_SHORT_NAME_MAX];
+ qnx4_off_t di_size;
+ qnx4_xtnt_t di_first_xtnt;
+ __le32 di_xblk;
+ __le32 di_ftime;
+ __le32 di_mtime;
+ __le32 di_atime;
+ __le32 di_ctime;
+ qnx4_nxtnt_t di_num_xtnts;
+ qnx4_mode_t di_mode;
+ qnx4_muid_t di_uid;
+ qnx4_mgid_t di_gid;
+ qnx4_nlink_t di_nlink;
+ __u8 di_zero[4];
+ qnx4_ftype_t di_type;
+ __u8 di_status;
+};
+
+struct qnx4_link_info {
+ char dl_fname[QNX4_NAME_MAX];
+ __le32 dl_inode_blk;
+ __u8 dl_inode_ndx;
+ __u8 dl_spare[10];
+ __u8 dl_status;
+};
+
+struct qnx4_xblk {
+ __le32 xblk_next_xblk;
+ __le32 xblk_prev_xblk;
+ __u8 xblk_num_xtnts;
+ __u8 xblk_spare[3];
+ __le32 xblk_num_blocks;
+ qnx4_xtnt_t xblk_xtnts[QNX4_MAX_XTNTS_PER_XBLK];
+ char xblk_signature[8];
+ qnx4_xtnt_t xblk_first_xtnt;
+};
+
+struct qnx4_super_block {
+ struct qnx4_inode_entry RootDir;
+ struct qnx4_inode_entry Inode;
+ struct qnx4_inode_entry Boot;
+ struct qnx4_inode_entry AltBoot;
+};
+
+
+#endif
diff --git a/sysroot/usr/include/linux/qnxtypes.h b/sysroot/usr/include/linux/qnxtypes.h
new file mode 100644
index 0000000..a3eb113
--- /dev/null
+++ b/sysroot/usr/include/linux/qnxtypes.h
@@ -0,0 +1,29 @@
+/*
+ * Name : qnxtypes.h
+ * Author : Richard Frowijn
+ * Function : standard qnx types
+ * Version : 1.0.2
+ * Last modified : 2000-01-06
+ *
+ * History : 22-03-1998 created
+ *
+ */
+
+#ifndef _QNX4TYPES_H
+#define _QNX4TYPES_H
+
+typedef __le16 qnx4_nxtnt_t;
+typedef __u8 qnx4_ftype_t;
+
+typedef struct {
+ __le32 xtnt_blk;
+ __le32 xtnt_size;
+} qnx4_xtnt_t;
+
+typedef __le16 qnx4_mode_t;
+typedef __le16 qnx4_muid_t;
+typedef __le16 qnx4_mgid_t;
+typedef __le32 qnx4_off_t;
+typedef __le16 qnx4_nlink_t;
+
+#endif
diff --git a/sysroot/usr/include/linux/quota.h b/sysroot/usr/include/linux/quota.h
new file mode 100644
index 0000000..80a9aad
--- /dev/null
+++ b/sysroot/usr/include/linux/quota.h
@@ -0,0 +1,169 @@
+/*
+ * Copyright (c) 1982, 1986 Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Robert Elz at The University of Melbourne.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * Version: $Id: quota.h,v 2.0 1996/11/17 16:48:14 mvw Exp mvw $
+ */
+
+#ifndef _LINUX_QUOTA_
+#define _LINUX_QUOTA_
+
+#include <linux/errno.h>
+#include <linux/types.h>
+
+#define __DQUOT_VERSION__ "dquot_6.5.1"
+#define __DQUOT_NUM_VERSION__ 6*10000+5*100+1
+
+typedef __kernel_uid32_t qid_t; /* Type in which we store ids in memory */
+typedef __u64 qsize_t; /* Type in which we store sizes */
+
+/* Size of blocks in which are counted size limits */
+#define QUOTABLOCK_BITS 10
+#define QUOTABLOCK_SIZE (1 << QUOTABLOCK_BITS)
+
+/* Conversion routines from and to quota blocks */
+#define qb2kb(x) ((x) << (QUOTABLOCK_BITS-10))
+#define kb2qb(x) ((x) >> (QUOTABLOCK_BITS-10))
+#define toqb(x) (((x) + QUOTABLOCK_SIZE - 1) >> QUOTABLOCK_BITS)
+
+#define MAXQUOTAS 2
+#define USRQUOTA 0 /* element used for user quotas */
+#define GRPQUOTA 1 /* element used for group quotas */
+
+/*
+ * Definitions for the default names of the quotas files.
+ */
+#define INITQFNAMES { \
+ "user", /* USRQUOTA */ \
+ "group", /* GRPQUOTA */ \
+ "undefined", \
+};
+
+/*
+ * Command definitions for the 'quotactl' system call.
+ * The commands are broken into a main command defined below
+ * and a subcommand that is used to convey the type of
+ * quota that is being manipulated (see above).
+ */
+#define SUBCMDMASK 0x00ff
+#define SUBCMDSHIFT 8
+#define QCMD(cmd, type) (((cmd) << SUBCMDSHIFT) | ((type) & SUBCMDMASK))
+
+#define Q_SYNC 0x800001 /* sync disk copy of a filesystems quotas */
+#define Q_QUOTAON 0x800002 /* turn quotas on */
+#define Q_QUOTAOFF 0x800003 /* turn quotas off */
+#define Q_GETFMT 0x800004 /* get quota format used on given filesystem */
+#define Q_GETINFO 0x800005 /* get information about quota files */
+#define Q_SETINFO 0x800006 /* set information about quota files */
+#define Q_GETQUOTA 0x800007 /* get user quota structure */
+#define Q_SETQUOTA 0x800008 /* set user quota structure */
+
+/*
+ * Quota structure used for communication with userspace via quotactl
+ * Following flags are used to specify which fields are valid
+ */
+#define QIF_BLIMITS 1
+#define QIF_SPACE 2
+#define QIF_ILIMITS 4
+#define QIF_INODES 8
+#define QIF_BTIME 16
+#define QIF_ITIME 32
+#define QIF_LIMITS (QIF_BLIMITS | QIF_ILIMITS)
+#define QIF_USAGE (QIF_SPACE | QIF_INODES)
+#define QIF_TIMES (QIF_BTIME | QIF_ITIME)
+#define QIF_ALL (QIF_LIMITS | QIF_USAGE | QIF_TIMES)
+
+struct if_dqblk {
+ __u64 dqb_bhardlimit;
+ __u64 dqb_bsoftlimit;
+ __u64 dqb_curspace;
+ __u64 dqb_ihardlimit;
+ __u64 dqb_isoftlimit;
+ __u64 dqb_curinodes;
+ __u64 dqb_btime;
+ __u64 dqb_itime;
+ __u32 dqb_valid;
+};
+
+/*
+ * Structure used for setting quota information about file via quotactl
+ * Following flags are used to specify which fields are valid
+ */
+#define IIF_BGRACE 1
+#define IIF_IGRACE 2
+#define IIF_FLAGS 4
+#define IIF_ALL (IIF_BGRACE | IIF_IGRACE | IIF_FLAGS)
+
+struct if_dqinfo {
+ __u64 dqi_bgrace;
+ __u64 dqi_igrace;
+ __u32 dqi_flags;
+ __u32 dqi_valid;
+};
+
+/*
+ * Definitions for quota netlink interface
+ */
+#define QUOTA_NL_NOWARN 0
+#define QUOTA_NL_IHARDWARN 1 /* Inode hardlimit reached */
+#define QUOTA_NL_ISOFTLONGWARN 2 /* Inode grace time expired */
+#define QUOTA_NL_ISOFTWARN 3 /* Inode softlimit reached */
+#define QUOTA_NL_BHARDWARN 4 /* Block hardlimit reached */
+#define QUOTA_NL_BSOFTLONGWARN 5 /* Block grace time expired */
+#define QUOTA_NL_BSOFTWARN 6 /* Block softlimit reached */
+
+enum {
+ QUOTA_NL_C_UNSPEC,
+ QUOTA_NL_C_WARNING,
+ __QUOTA_NL_C_MAX,
+};
+#define QUOTA_NL_C_MAX (__QUOTA_NL_C_MAX - 1)
+
+enum {
+ QUOTA_NL_A_UNSPEC,
+ QUOTA_NL_A_QTYPE,
+ QUOTA_NL_A_EXCESS_ID,
+ QUOTA_NL_A_WARNING,
+ QUOTA_NL_A_DEV_MAJOR,
+ QUOTA_NL_A_DEV_MINOR,
+ QUOTA_NL_A_CAUSED_ID,
+ __QUOTA_NL_A_MAX,
+};
+#define QUOTA_NL_A_MAX (__QUOTA_NL_A_MAX - 1)
+
+
+
+# /* nodep */ include <sys/cdefs.h>
+
+__BEGIN_DECLS
+long quotactl __P ((unsigned int, const char *, int, caddr_t));
+__END_DECLS
+
+#endif /* _QUOTA_ */
diff --git a/sysroot/usr/include/linux/quotaio_v1.h b/sysroot/usr/include/linux/quotaio_v1.h
new file mode 100644
index 0000000..746654b
--- /dev/null
+++ b/sysroot/usr/include/linux/quotaio_v1.h
@@ -0,0 +1,33 @@
+#ifndef _LINUX_QUOTAIO_V1_H
+#define _LINUX_QUOTAIO_V1_H
+
+#include <linux/types.h>
+
+/*
+ * The following constants define the amount of time given a user
+ * before the soft limits are treated as hard limits (usually resulting
+ * in an allocation failure). The timer is started when the user crosses
+ * their soft limit, it is reset when they go below their soft limit.
+ */
+#define MAX_IQ_TIME 604800 /* (7*24*60*60) 1 week */
+#define MAX_DQ_TIME 604800 /* (7*24*60*60) 1 week */
+
+/*
+ * The following structure defines the format of the disk quota file
+ * (as it appears on disk) - the file is an array of these structures
+ * indexed by user or group number.
+ */
+struct v1_disk_dqblk {
+ __u32 dqb_bhardlimit; /* absolute limit on disk blks alloc */
+ __u32 dqb_bsoftlimit; /* preferred limit on disk blks */
+ __u32 dqb_curblocks; /* current block count */
+ __u32 dqb_ihardlimit; /* absolute limit on allocated inodes */
+ __u32 dqb_isoftlimit; /* preferred inode limit */
+ __u32 dqb_curinodes; /* current # allocated inodes */
+ time_t dqb_btime; /* time limit for excessive disk use */
+ time_t dqb_itime; /* time limit for excessive inode use */
+};
+
+#define v1_dqoff(UID) ((loff_t)((UID) * sizeof (struct v1_disk_dqblk)))
+
+#endif /* _LINUX_QUOTAIO_V1_H */
diff --git a/sysroot/usr/include/linux/quotaio_v2.h b/sysroot/usr/include/linux/quotaio_v2.h
new file mode 100644
index 0000000..303d7cb
--- /dev/null
+++ b/sysroot/usr/include/linux/quotaio_v2.h
@@ -0,0 +1,79 @@
+/*
+ * Definitions of structures for vfsv0 quota format
+ */
+
+#ifndef _LINUX_QUOTAIO_V2_H
+#define _LINUX_QUOTAIO_V2_H
+
+#include <linux/types.h>
+#include <linux/quota.h>
+
+/*
+ * Definitions of magics and versions of current quota files
+ */
+#define V2_INITQMAGICS {\
+ 0xd9c01f11, /* USRQUOTA */\
+ 0xd9c01927 /* GRPQUOTA */\
+}
+
+#define V2_INITQVERSIONS {\
+ 0, /* USRQUOTA */\
+ 0 /* GRPQUOTA */\
+}
+
+/*
+ * The following structure defines the format of the disk quota file
+ * (as it appears on disk) - the file is a radix tree whose leaves point
+ * to blocks of these structures.
+ */
+struct v2_disk_dqblk {
+ __le32 dqb_id; /* id this quota applies to */
+ __le32 dqb_ihardlimit; /* absolute limit on allocated inodes */
+ __le32 dqb_isoftlimit; /* preferred inode limit */
+ __le32 dqb_curinodes; /* current # allocated inodes */
+ __le32 dqb_bhardlimit; /* absolute limit on disk space (in QUOTABLOCK_SIZE) */
+ __le32 dqb_bsoftlimit; /* preferred limit on disk space (in QUOTABLOCK_SIZE) */
+ __le64 dqb_curspace; /* current space occupied (in bytes) */
+ __le64 dqb_btime; /* time limit for excessive disk use */
+ __le64 dqb_itime; /* time limit for excessive inode use */
+};
+
+/*
+ * Here are header structures as written on disk and their in-memory copies
+ */
+/* First generic header */
+struct v2_disk_dqheader {
+ __le32 dqh_magic; /* Magic number identifying file */
+ __le32 dqh_version; /* File version */
+};
+
+/* Header with type and version specific information */
+struct v2_disk_dqinfo {
+ __le32 dqi_bgrace; /* Time before block soft limit becomes hard limit */
+ __le32 dqi_igrace; /* Time before inode soft limit becomes hard limit */
+ __le32 dqi_flags; /* Flags for quotafile (DQF_*) */
+ __le32 dqi_blocks; /* Number of blocks in file */
+ __le32 dqi_free_blk; /* Number of first free block in the list */
+ __le32 dqi_free_entry; /* Number of block with at least one free entry */
+};
+
+/*
+ * Structure of header of block with quota structures. It is padded to 16 bytes so
+ * there will be space for exactly 21 quota-entries in a block
+ */
+struct v2_disk_dqdbheader {
+ __le32 dqdh_next_free; /* Number of next block with free entry */
+ __le32 dqdh_prev_free; /* Number of previous block with free entry */
+ __le16 dqdh_entries; /* Number of valid entries in block */
+ __le16 dqdh_pad1;
+ __le32 dqdh_pad2;
+};
+
+#define V2_DQINFOOFF sizeof(struct v2_disk_dqheader) /* Offset of info header in file */
+#define V2_DQBLKSIZE_BITS 10
+#define V2_DQBLKSIZE (1 << V2_DQBLKSIZE_BITS) /* Size of block with quota structures */
+#define V2_DQTREEOFF 1 /* Offset of tree in file in blocks */
+#define V2_DQTREEDEPTH 4 /* Depth of quota tree */
+#define V2_DQSTRINBLK ((V2_DQBLKSIZE - sizeof(struct v2_disk_dqdbheader)) / sizeof(struct v2_disk_dqblk)) /* Number of entries in one blocks */
+
+#endif /* _LINUX_QUOTAIO_V2_H */
diff --git a/sysroot/usr/include/linux/radeonfb.h b/sysroot/usr/include/linux/radeonfb.h
new file mode 100644
index 0000000..5bd8975
--- /dev/null
+++ b/sysroot/usr/include/linux/radeonfb.h
@@ -0,0 +1,15 @@
+#ifndef __LINUX_RADEONFB_H__
+#define __LINUX_RADEONFB_H__
+
+#include <asm/ioctl.h>
+#include <asm/types.h>
+
+#define ATY_RADEON_LCD_ON 0x00000001
+#define ATY_RADEON_CRT_ON 0x00000002
+
+
+#define FBIO_RADEON_GET_MIRROR _IOR('@', 3, size_t)
+#define FBIO_RADEON_SET_MIRROR _IOW('@', 4, size_t)
+
+#endif
+
diff --git a/sysroot/usr/include/linux/raid/md_p.h b/sysroot/usr/include/linux/raid/md_p.h
new file mode 100644
index 0000000..5b682a2
--- /dev/null
+++ b/sysroot/usr/include/linux/raid/md_p.h
@@ -0,0 +1,276 @@
+/*
+ md_p.h : physical layout of Linux RAID devices
+ Copyright (C) 1996-98 Ingo Molnar, Gadi Oxman
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ You should have received a copy of the GNU General Public License
+ (for example /usr/src/linux/COPYING); if not, write to the Free
+ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#ifndef _MD_P_H
+#define _MD_P_H
+
+/*
+ * RAID superblock.
+ *
+ * The RAID superblock maintains some statistics on each RAID configuration.
+ * Each real device in the RAID set contains it near the end of the device.
+ * Some of the ideas are copied from the ext2fs implementation.
+ *
+ * We currently use 4096 bytes as follows:
+ *
+ * word offset function
+ *
+ * 0 - 31 Constant generic RAID device information.
+ * 32 - 63 Generic state information.
+ * 64 - 127 Personality specific information.
+ * 128 - 511 12 32-words descriptors of the disks in the raid set.
+ * 512 - 911 Reserved.
+ * 912 - 1023 Disk specific descriptor.
+ */
+
+/*
+ * If x is the real device size in bytes, we return an apparent size of:
+ *
+ * y = (x & ~(MD_RESERVED_BYTES - 1)) - MD_RESERVED_BYTES
+ *
+ * and place the 4kB superblock at offset y.
+ */
+#define MD_RESERVED_BYTES (64 * 1024)
+#define MD_RESERVED_SECTORS (MD_RESERVED_BYTES / 512)
+#define MD_RESERVED_BLOCKS (MD_RESERVED_BYTES / BLOCK_SIZE)
+
+#define MD_NEW_SIZE_SECTORS(x) ((x & ~(MD_RESERVED_SECTORS - 1)) - MD_RESERVED_SECTORS)
+#define MD_NEW_SIZE_BLOCKS(x) ((x & ~(MD_RESERVED_BLOCKS - 1)) - MD_RESERVED_BLOCKS)
+
+#define MD_SB_BYTES 4096
+#define MD_SB_WORDS (MD_SB_BYTES / 4)
+#define MD_SB_BLOCKS (MD_SB_BYTES / BLOCK_SIZE)
+#define MD_SB_SECTORS (MD_SB_BYTES / 512)
+
+/*
+ * The following are counted in 32-bit words
+ */
+#define MD_SB_GENERIC_OFFSET 0
+#define MD_SB_PERSONALITY_OFFSET 64
+#define MD_SB_DISKS_OFFSET 128
+#define MD_SB_DESCRIPTOR_OFFSET 992
+
+#define MD_SB_GENERIC_CONSTANT_WORDS 32
+#define MD_SB_GENERIC_STATE_WORDS 32
+#define MD_SB_GENERIC_WORDS (MD_SB_GENERIC_CONSTANT_WORDS + MD_SB_GENERIC_STATE_WORDS)
+#define MD_SB_PERSONALITY_WORDS 64
+#define MD_SB_DESCRIPTOR_WORDS 32
+#define MD_SB_DISKS 27
+#define MD_SB_DISKS_WORDS (MD_SB_DISKS*MD_SB_DESCRIPTOR_WORDS)
+#define MD_SB_RESERVED_WORDS (1024 - MD_SB_GENERIC_WORDS - MD_SB_PERSONALITY_WORDS - MD_SB_DISKS_WORDS - MD_SB_DESCRIPTOR_WORDS)
+#define MD_SB_EQUAL_WORDS (MD_SB_GENERIC_WORDS + MD_SB_PERSONALITY_WORDS + MD_SB_DISKS_WORDS)
+
+/*
+ * Device "operational" state bits
+ */
+#define MD_DISK_FAULTY 0 /* disk is faulty / operational */
+#define MD_DISK_ACTIVE 1 /* disk is running or spare disk */
+#define MD_DISK_SYNC 2 /* disk is in sync with the raid set */
+#define MD_DISK_REMOVED 3 /* disk is in sync with the raid set */
+
+#define MD_DISK_WRITEMOSTLY 9 /* disk is "write-mostly" is RAID1 config.
+ * read requests will only be sent here in
+ * dire need
+ */
+
+typedef struct mdp_device_descriptor_s {
+ __u32 number; /* 0 Device number in the entire set */
+ __u32 major; /* 1 Device major number */
+ __u32 minor; /* 2 Device minor number */
+ __u32 raid_disk; /* 3 The role of the device in the raid set */
+ __u32 state; /* 4 Operational state */
+ __u32 reserved[MD_SB_DESCRIPTOR_WORDS - 5];
+} mdp_disk_t;
+
+#define MD_SB_MAGIC 0xa92b4efc
+
+/*
+ * Superblock state bits
+ */
+#define MD_SB_CLEAN 0
+#define MD_SB_ERRORS 1
+
+#define MD_SB_BITMAP_PRESENT 8 /* bitmap may be present nearby */
+
+/*
+ * Notes:
+ * - if an array is being reshaped (restriped) in order to change the
+ * the number of active devices in the array, 'raid_disks' will be
+ * the larger of the old and new numbers. 'delta_disks' will
+ * be the "new - old". So if +ve, raid_disks is the new value, and
+ * "raid_disks-delta_disks" is the old. If -ve, raid_disks is the
+ * old value and "raid_disks+delta_disks" is the new (smaller) value.
+ */
+
+
+typedef struct mdp_superblock_s {
+ /*
+ * Constant generic information
+ */
+ __u32 md_magic; /* 0 MD identifier */
+ __u32 major_version; /* 1 major version to which the set conforms */
+ __u32 minor_version; /* 2 minor version ... */
+ __u32 patch_version; /* 3 patchlevel version ... */
+ __u32 gvalid_words; /* 4 Number of used words in this section */
+ __u32 set_uuid0; /* 5 Raid set identifier */
+ __u32 ctime; /* 6 Creation time */
+ __u32 level; /* 7 Raid personality */
+ __u32 size; /* 8 Apparent size of each individual disk */
+ __u32 nr_disks; /* 9 total disks in the raid set */
+ __u32 raid_disks; /* 10 disks in a fully functional raid set */
+ __u32 md_minor; /* 11 preferred MD minor device number */
+ __u32 not_persistent; /* 12 does it have a persistent superblock */
+ __u32 set_uuid1; /* 13 Raid set identifier #2 */
+ __u32 set_uuid2; /* 14 Raid set identifier #3 */
+ __u32 set_uuid3; /* 15 Raid set identifier #4 */
+ __u32 gstate_creserved[MD_SB_GENERIC_CONSTANT_WORDS - 16];
+
+ /*
+ * Generic state information
+ */
+ __u32 utime; /* 0 Superblock update time */
+ __u32 state; /* 1 State bits (clean, ...) */
+ __u32 active_disks; /* 2 Number of currently active disks */
+ __u32 working_disks; /* 3 Number of working disks */
+ __u32 failed_disks; /* 4 Number of failed disks */
+ __u32 spare_disks; /* 5 Number of spare disks */
+ __u32 sb_csum; /* 6 checksum of the whole superblock */
+#ifdef __BIG_ENDIAN
+ __u32 events_hi; /* 7 high-order of superblock update count */
+ __u32 events_lo; /* 8 low-order of superblock update count */
+ __u32 cp_events_hi; /* 9 high-order of checkpoint update count */
+ __u32 cp_events_lo; /* 10 low-order of checkpoint update count */
+#else
+ __u32 events_lo; /* 7 low-order of superblock update count */
+ __u32 events_hi; /* 8 high-order of superblock update count */
+ __u32 cp_events_lo; /* 9 low-order of checkpoint update count */
+ __u32 cp_events_hi; /* 10 high-order of checkpoint update count */
+#endif
+ __u32 recovery_cp; /* 11 recovery checkpoint sector count */
+ /* There are only valid for minor_version > 90 */
+ __u64 reshape_position; /* 12,13 next address in array-space for reshape */
+ __u32 new_level; /* 14 new level we are reshaping to */
+ __u32 delta_disks; /* 15 change in number of raid_disks */
+ __u32 new_layout; /* 16 new layout */
+ __u32 new_chunk; /* 17 new chunk size (bytes) */
+ __u32 gstate_sreserved[MD_SB_GENERIC_STATE_WORDS - 18];
+
+ /*
+ * Personality information
+ */
+ __u32 layout; /* 0 the array's physical layout */
+ __u32 chunk_size; /* 1 chunk size in bytes */
+ __u32 root_pv; /* 2 LV root PV */
+ __u32 root_block; /* 3 LV root block */
+ __u32 pstate_reserved[MD_SB_PERSONALITY_WORDS - 4];
+
+ /*
+ * Disks information
+ */
+ mdp_disk_t disks[MD_SB_DISKS];
+
+ /*
+ * Reserved
+ */
+ __u32 reserved[MD_SB_RESERVED_WORDS];
+
+ /*
+ * Active descriptor
+ */
+ mdp_disk_t this_disk;
+
+} mdp_super_t;
+
+static __inline__ __u64 md_event(mdp_super_t *sb) {
+ __u64 ev = sb->events_hi;
+ return (ev<<32)| sb->events_lo;
+}
+
+/*
+ * The version-1 superblock :
+ * All numeric fields are little-endian.
+ *
+ * total size: 256 bytes plus 2 per device.
+ * 1K allows 384 devices.
+ */
+struct mdp_superblock_1 {
+ /* constant array information - 128 bytes */
+ __le32 magic; /* MD_SB_MAGIC: 0xa92b4efc - little endian */
+ __le32 major_version; /* 1 */
+ __le32 feature_map; /* bit 0 set if 'bitmap_offset' is meaningful */
+ __le32 pad0; /* always set to 0 when writing */
+
+ __u8 set_uuid[16]; /* user-space generated. */
+ char set_name[32]; /* set and interpreted by user-space */
+
+ __le64 ctime; /* lo 40 bits are seconds, top 24 are microseconds or 0*/
+ __le32 level; /* -4 (multipath), -1 (linear), 0,1,4,5 */
+ __le32 layout; /* only for raid5 and raid10 currently */
+ __le64 size; /* used size of component devices, in 512byte sectors */
+
+ __le32 chunksize; /* in 512byte sectors */
+ __le32 raid_disks;
+ __le32 bitmap_offset; /* sectors after start of superblock that bitmap starts
+ * NOTE: signed, so bitmap can be before superblock
+ * only meaningful of feature_map[0] is set.
+ */
+
+ /* These are only valid with feature bit '4' */
+ __le32 new_level; /* new level we are reshaping to */
+ __le64 reshape_position; /* next address in array-space for reshape */
+ __le32 delta_disks; /* change in number of raid_disks */
+ __le32 new_layout; /* new layout */
+ __le32 new_chunk; /* new chunk size (bytes) */
+ __u8 pad1[128-124]; /* set to 0 when written */
+
+ /* constant this-device information - 64 bytes */
+ __le64 data_offset; /* sector start of data, often 0 */
+ __le64 data_size; /* sectors in this device that can be used for data */
+ __le64 super_offset; /* sector start of this superblock */
+ __le64 recovery_offset;/* sectors before this offset (from data_offset) have been recovered */
+ __le32 dev_number; /* permanent identifier of this device - not role in raid */
+ __le32 cnt_corrected_read; /* number of read errors that were corrected by re-writing */
+ __u8 device_uuid[16]; /* user-space setable, ignored by kernel */
+ __u8 devflags; /* per-device flags. Only one defined...*/
+#define WriteMostly1 1 /* mask for writemostly flag in above */
+ __u8 pad2[64-57]; /* set to 0 when writing */
+
+ /* array state information - 64 bytes */
+ __le64 utime; /* 40 bits second, 24 btes microseconds */
+ __le64 events; /* incremented when superblock updated */
+ __le64 resync_offset; /* data before this offset (from data_offset) known to be in sync */
+ __le32 sb_csum; /* checksum upto devs[max_dev] */
+ __le32 max_dev; /* size of devs[] array to consider */
+ __u8 pad3[64-32]; /* set to 0 when writing */
+
+ /* device state information. Indexed by dev_number.
+ * 2 bytes per device
+ * Note there are no per-device state flags. State information is rolled
+ * into the 'roles' value. If a device is spare or faulty, then it doesn't
+ * have a meaningful role.
+ */
+ __le16 dev_roles[0]; /* role in array, or 0xffff for a spare, or 0xfffe for faulty */
+};
+
+/* feature_map bits */
+#define MD_FEATURE_BITMAP_OFFSET 1
+#define MD_FEATURE_RECOVERY_OFFSET 2 /* recovery_offset is present and
+ * must be honoured
+ */
+#define MD_FEATURE_RESHAPE_ACTIVE 4
+
+#define MD_FEATURE_ALL (1|2|4)
+
+#endif
+
diff --git a/sysroot/usr/include/linux/raid/md_u.h b/sysroot/usr/include/linux/raid/md_u.h
new file mode 100644
index 0000000..7192035
--- /dev/null
+++ b/sysroot/usr/include/linux/raid/md_u.h
@@ -0,0 +1,124 @@
+/*
+ md_u.h : user <=> kernel API between Linux raidtools and RAID drivers
+ Copyright (C) 1998 Ingo Molnar
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ You should have received a copy of the GNU General Public License
+ (for example /usr/src/linux/COPYING); if not, write to the Free
+ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#ifndef _MD_U_H
+#define _MD_U_H
+
+/* ioctls */
+
+/* status */
+#define RAID_VERSION _IOR (MD_MAJOR, 0x10, mdu_version_t)
+#define GET_ARRAY_INFO _IOR (MD_MAJOR, 0x11, mdu_array_info_t)
+#define GET_DISK_INFO _IOR (MD_MAJOR, 0x12, mdu_disk_info_t)
+#define PRINT_RAID_DEBUG _IO (MD_MAJOR, 0x13)
+#define RAID_AUTORUN _IO (MD_MAJOR, 0x14)
+#define GET_BITMAP_FILE _IOR (MD_MAJOR, 0x15, mdu_bitmap_file_t)
+
+/* configuration */
+#define CLEAR_ARRAY _IO (MD_MAJOR, 0x20)
+#define ADD_NEW_DISK _IOW (MD_MAJOR, 0x21, mdu_disk_info_t)
+#define HOT_REMOVE_DISK _IO (MD_MAJOR, 0x22)
+#define SET_ARRAY_INFO _IOW (MD_MAJOR, 0x23, mdu_array_info_t)
+#define SET_DISK_INFO _IO (MD_MAJOR, 0x24)
+#define WRITE_RAID_INFO _IO (MD_MAJOR, 0x25)
+#define UNPROTECT_ARRAY _IO (MD_MAJOR, 0x26)
+#define PROTECT_ARRAY _IO (MD_MAJOR, 0x27)
+#define HOT_ADD_DISK _IO (MD_MAJOR, 0x28)
+#define SET_DISK_FAULTY _IO (MD_MAJOR, 0x29)
+#define HOT_GENERATE_ERROR _IO (MD_MAJOR, 0x2a)
+#define SET_BITMAP_FILE _IOW (MD_MAJOR, 0x2b, int)
+
+/* usage */
+#define RUN_ARRAY _IOW (MD_MAJOR, 0x30, mdu_param_t)
+/* 0x31 was START_ARRAY */
+#define STOP_ARRAY _IO (MD_MAJOR, 0x32)
+#define STOP_ARRAY_RO _IO (MD_MAJOR, 0x33)
+#define RESTART_ARRAY_RW _IO (MD_MAJOR, 0x34)
+
+typedef struct mdu_version_s {
+ int major;
+ int minor;
+ int patchlevel;
+} mdu_version_t;
+
+typedef struct mdu_array_info_s {
+ /*
+ * Generic constant information
+ */
+ int major_version;
+ int minor_version;
+ int patch_version;
+ int ctime;
+ int level;
+ int size;
+ int nr_disks;
+ int raid_disks;
+ int md_minor;
+ int not_persistent;
+
+ /*
+ * Generic state information
+ */
+ int utime; /* 0 Superblock update time */
+ int state; /* 1 State bits (clean, ...) */
+ int active_disks; /* 2 Number of currently active disks */
+ int working_disks; /* 3 Number of working disks */
+ int failed_disks; /* 4 Number of failed disks */
+ int spare_disks; /* 5 Number of spare disks */
+
+ /*
+ * Personality information
+ */
+ int layout; /* 0 the array's physical layout */
+ int chunk_size; /* 1 chunk size in bytes */
+
+} mdu_array_info_t;
+
+typedef struct mdu_disk_info_s {
+ /*
+ * configuration/status of one particular disk
+ */
+ int number;
+ int major;
+ int minor;
+ int raid_disk;
+ int state;
+
+} mdu_disk_info_t;
+
+typedef struct mdu_start_info_s {
+ /*
+ * configuration/status of one particular disk
+ */
+ int major;
+ int minor;
+ int raid_disk;
+ int state;
+
+} mdu_start_info_t;
+
+typedef struct mdu_bitmap_file_s
+{
+ char pathname[4096];
+} mdu_bitmap_file_t;
+
+typedef struct mdu_param_s
+{
+ int personality; /* 1,2,3,4 */
+ int chunk_size; /* in bytes */
+ int max_fault; /* unused for now */
+} mdu_param_t;
+
+#endif
+
diff --git a/sysroot/usr/include/linux/random.h b/sysroot/usr/include/linux/random.h
new file mode 100644
index 0000000..78b6142
--- /dev/null
+++ b/sysroot/usr/include/linux/random.h
@@ -0,0 +1,44 @@
+/*
+ * include/linux/random.h
+ *
+ * Include file for the random number generator.
+ */
+
+#ifndef _LINUX_RANDOM_H
+#define _LINUX_RANDOM_H
+
+#include <linux/ioctl.h>
+
+/* ioctl()'s for the random number generator */
+
+/* Get the entropy count. */
+#define RNDGETENTCNT _IOR( 'R', 0x00, int )
+
+/* Add to (or subtract from) the entropy count. (Superuser only.) */
+#define RNDADDTOENTCNT _IOW( 'R', 0x01, int )
+
+/* Get the contents of the entropy pool. (Superuser only.) */
+#define RNDGETPOOL _IOR( 'R', 0x02, int [2] )
+
+/*
+ * Write bytes into the entropy pool and add to the entropy count.
+ * (Superuser only.)
+ */
+#define RNDADDENTROPY _IOW( 'R', 0x03, int [2] )
+
+/* Clear entropy count to 0. (Superuser only.) */
+#define RNDZAPENTCNT _IO( 'R', 0x04 )
+
+/* Clear the entropy pool and associated counters. (Superuser only.) */
+#define RNDCLEARPOOL _IO( 'R', 0x06 )
+
+struct rand_pool_info {
+ int entropy_count;
+ int buf_size;
+ __u32 buf[0];
+};
+
+/* Exported functions */
+
+
+#endif /* _LINUX_RANDOM_H */
diff --git a/sysroot/usr/include/linux/raw.h b/sysroot/usr/include/linux/raw.h
new file mode 100644
index 0000000..62d543e
--- /dev/null
+++ b/sysroot/usr/include/linux/raw.h
@@ -0,0 +1,18 @@
+#ifndef __LINUX_RAW_H
+#define __LINUX_RAW_H
+
+#include <linux/types.h>
+
+#define RAW_SETBIND _IO( 0xac, 0 )
+#define RAW_GETBIND _IO( 0xac, 1 )
+
+struct raw_config_request
+{
+ int raw_minor;
+ __u64 block_major;
+ __u64 block_minor;
+};
+
+#define MAX_RAW_MINORS CONFIG_MAX_RAW_DEVS
+
+#endif /* __LINUX_RAW_H */
diff --git a/sysroot/usr/include/linux/reboot.h b/sysroot/usr/include/linux/reboot.h
new file mode 100644
index 0000000..aa33674
--- /dev/null
+++ b/sysroot/usr/include/linux/reboot.h
@@ -0,0 +1,39 @@
+#ifndef _LINUX_REBOOT_H
+#define _LINUX_REBOOT_H
+
+/*
+ * Magic values required to use _reboot() system call.
+ */
+
+#define LINUX_REBOOT_MAGIC1 0xfee1dead
+#define LINUX_REBOOT_MAGIC2 672274793
+#define LINUX_REBOOT_MAGIC2A 85072278
+#define LINUX_REBOOT_MAGIC2B 369367448
+#define LINUX_REBOOT_MAGIC2C 537993216
+
+
+/*
+ * Commands accepted by the _reboot() system call.
+ *
+ * RESTART Restart system using default command and mode.
+ * HALT Stop OS and give system control to ROM monitor, if any.
+ * CAD_ON Ctrl-Alt-Del sequence causes RESTART command.
+ * CAD_OFF Ctrl-Alt-Del sequence sends SIGINT to init task.
+ * POWER_OFF Stop OS and remove all power from system, if possible.
+ * RESTART2 Restart system using given command string.
+ * SW_SUSPEND Suspend system using software suspend if compiled in.
+ * KEXEC Restart system using a previously loaded Linux kernel
+ */
+
+#define LINUX_REBOOT_CMD_RESTART 0x01234567
+#define LINUX_REBOOT_CMD_HALT 0xCDEF0123
+#define LINUX_REBOOT_CMD_CAD_ON 0x89ABCDEF
+#define LINUX_REBOOT_CMD_CAD_OFF 0x00000000
+#define LINUX_REBOOT_CMD_POWER_OFF 0x4321FEDC
+#define LINUX_REBOOT_CMD_RESTART2 0xA1B2C3D4
+#define LINUX_REBOOT_CMD_SW_SUSPEND 0xD000FCE2
+#define LINUX_REBOOT_CMD_KEXEC 0x45584543
+
+
+
+#endif /* _LINUX_REBOOT_H */
diff --git a/sysroot/usr/include/linux/reiserfs_fs.h b/sysroot/usr/include/linux/reiserfs_fs.h
new file mode 100644
index 0000000..03785d3
--- /dev/null
+++ b/sysroot/usr/include/linux/reiserfs_fs.h
@@ -0,0 +1,2192 @@
+/*
+ * Copyright 1996, 1997, 1998 Hans Reiser, see reiserfs/README for licensing and copyright details
+ */
+
+ /* this file has an amazingly stupid
+ name, yura please fix it to be
+ reiserfs.h, and merge all the rest
+ of our .h files that are in this
+ directory into it. */
+
+#ifndef _LINUX_REISER_FS_H
+#define _LINUX_REISER_FS_H
+
+#include <linux/types.h>
+#include <linux/magic.h>
+
+
+struct fid;
+
+/*
+ * include/linux/reiser_fs.h
+ *
+ * Reiser File System constants and structures
+ *
+ */
+
+/* in reading the #defines, it may help to understand that they employ
+ the following abbreviations:
+
+ B = Buffer
+ I = Item header
+ H = Height within the tree (should be changed to LEV)
+ N = Number of the item in the node
+ STAT = stat data
+ DEH = Directory Entry Header
+ EC = Entry Count
+ E = Entry number
+ UL = Unsigned Long
+ BLKH = BLocK Header
+ UNFM = UNForMatted node
+ DC = Disk Child
+ P = Path
+
+ These #defines are named by concatenating these abbreviations,
+ where first comes the arguments, and last comes the return value,
+ of the macro.
+
+*/
+
+#define USE_INODE_GENERATION_COUNTER
+
+#define REISERFS_PREALLOCATE
+#define DISPLACE_NEW_PACKING_LOCALITIES
+#define PREALLOCATION_SIZE 9
+
+/* n must be power of 2 */
+#define _ROUND_UP(x,n) (((x)+(n)-1u) & ~((n)-1u))
+
+// to be ok for alpha and others we have to align structures to 8 byte
+// boundary.
+// FIXME: do not change 4 by anything else: there is code which relies on that
+#define ROUND_UP(x) _ROUND_UP(x,8LL)
+
+/* debug levels. Right now, CONFIG_REISERFS_CHECK means print all debug
+** messages.
+*/
+#define REISERFS_DEBUG_CODE 5 /* extra messages to help find/debug errors */
+
+void reiserfs_warning(struct super_block *s, const char *fmt, ...);
+/* assertions handling */
+
+/** always check a condition and panic if it's false. */
+#define __RASSERT( cond, scond, format, args... ) \
+if( !( cond ) ) \
+ reiserfs_panic( NULL, "reiserfs[%i]: assertion " scond " failed at " \
+ __FILE__ ":%i:%s: " format "\n", \
+ in_interrupt() ? -1 : task_pid_nr(current), __LINE__ , __FUNCTION__ , ##args )
+
+#define RASSERT(cond, format, args...) __RASSERT(cond, #cond, format, ##args)
+
+#if defined( CONFIG_REISERFS_CHECK )
+#define RFALSE(cond, format, args...) __RASSERT(!(cond), "!(" #cond ")", format, ##args)
+#else
+#define RFALSE( cond, format, args... ) do {;} while( 0 )
+#endif
+
+#define CONSTF
+/*
+ * Disk Data Structures
+ */
+
+/***************************************************************************/
+/* SUPER BLOCK */
+/***************************************************************************/
+
+/*
+ * Structure of super block on disk, a version of which in RAM is often accessed as REISERFS_SB(s)->s_rs
+ * the version in RAM is part of a larger structure containing fields never written to disk.
+ */
+#define UNSET_HASH 0 // read_super will guess about, what hash names
+ // in directories were sorted with
+#define TEA_HASH 1
+#define YURA_HASH 2
+#define R5_HASH 3
+#define DEFAULT_HASH R5_HASH
+
+struct journal_params {
+ __le32 jp_journal_1st_block; /* where does journal start from on its
+ * device */
+ __le32 jp_journal_dev; /* journal device st_rdev */
+ __le32 jp_journal_size; /* size of the journal */
+ __le32 jp_journal_trans_max; /* max number of blocks in a transaction. */
+ __le32 jp_journal_magic; /* random value made on fs creation (this
+ * was sb_journal_block_count) */
+ __le32 jp_journal_max_batch; /* max number of blocks to batch into a
+ * trans */
+ __le32 jp_journal_max_commit_age; /* in seconds, how old can an async
+ * commit be */
+ __le32 jp_journal_max_trans_age; /* in seconds, how old can a transaction
+ * be */
+};
+
+/* this is the super from 3.5.X, where X >= 10 */
+struct reiserfs_super_block_v1 {
+ __le32 s_block_count; /* blocks count */
+ __le32 s_free_blocks; /* free blocks count */
+ __le32 s_root_block; /* root block number */
+ struct journal_params s_journal;
+ __le16 s_blocksize; /* block size */
+ __le16 s_oid_maxsize; /* max size of object id array, see
+ * get_objectid() commentary */
+ __le16 s_oid_cursize; /* current size of object id array */
+ __le16 s_umount_state; /* this is set to 1 when filesystem was
+ * umounted, to 2 - when not */
+ char s_magic[10]; /* reiserfs magic string indicates that
+ * file system is reiserfs:
+ * "ReIsErFs" or "ReIsEr2Fs" or "ReIsEr3Fs" */
+ __le16 s_fs_state; /* it is set to used by fsck to mark which
+ * phase of rebuilding is done */
+ __le32 s_hash_function_code; /* indicate, what hash function is being use
+ * to sort names in a directory*/
+ __le16 s_tree_height; /* height of disk tree */
+ __le16 s_bmap_nr; /* amount of bitmap blocks needed to address
+ * each block of file system */
+ __le16 s_version; /* this field is only reliable on filesystem
+ * with non-standard journal */
+ __le16 s_reserved_for_journal; /* size in blocks of journal area on main
+ * device, we need to keep after
+ * making fs with non-standard journal */
+} __attribute__ ((__packed__));
+
+#define SB_SIZE_V1 (sizeof(struct reiserfs_super_block_v1))
+
+/* this is the on disk super block */
+struct reiserfs_super_block {
+ struct reiserfs_super_block_v1 s_v1;
+ __le32 s_inode_generation;
+ __le32 s_flags; /* Right now used only by inode-attributes, if enabled */
+ unsigned char s_uuid[16]; /* filesystem unique identifier */
+ unsigned char s_label[16]; /* filesystem volume label */
+ char s_unused[88]; /* zero filled by mkreiserfs and
+ * reiserfs_convert_objectid_map_v1()
+ * so any additions must be updated
+ * there as well. */
+} __attribute__ ((__packed__));
+
+#define SB_SIZE (sizeof(struct reiserfs_super_block))
+
+#define REISERFS_VERSION_1 0
+#define REISERFS_VERSION_2 2
+
+// on-disk super block fields converted to cpu form
+#define SB_DISK_SUPER_BLOCK(s) (REISERFS_SB(s)->s_rs)
+#define SB_V1_DISK_SUPER_BLOCK(s) (&(SB_DISK_SUPER_BLOCK(s)->s_v1))
+#define SB_BLOCKSIZE(s) \
+ le32_to_cpu ((SB_V1_DISK_SUPER_BLOCK(s)->s_blocksize))
+#define SB_BLOCK_COUNT(s) \
+ le32_to_cpu ((SB_V1_DISK_SUPER_BLOCK(s)->s_block_count))
+#define SB_FREE_BLOCKS(s) \
+ le32_to_cpu ((SB_V1_DISK_SUPER_BLOCK(s)->s_free_blocks))
+#define SB_REISERFS_MAGIC(s) \
+ (SB_V1_DISK_SUPER_BLOCK(s)->s_magic)
+#define SB_ROOT_BLOCK(s) \
+ le32_to_cpu ((SB_V1_DISK_SUPER_BLOCK(s)->s_root_block))
+#define SB_TREE_HEIGHT(s) \
+ le16_to_cpu ((SB_V1_DISK_SUPER_BLOCK(s)->s_tree_height))
+#define SB_REISERFS_STATE(s) \
+ le16_to_cpu ((SB_V1_DISK_SUPER_BLOCK(s)->s_umount_state))
+#define SB_VERSION(s) le16_to_cpu ((SB_V1_DISK_SUPER_BLOCK(s)->s_version))
+#define SB_BMAP_NR(s) le16_to_cpu ((SB_V1_DISK_SUPER_BLOCK(s)->s_bmap_nr))
+
+#define PUT_SB_BLOCK_COUNT(s, val) \
+ do { SB_V1_DISK_SUPER_BLOCK(s)->s_block_count = cpu_to_le32(val); } while (0)
+#define PUT_SB_FREE_BLOCKS(s, val) \
+ do { SB_V1_DISK_SUPER_BLOCK(s)->s_free_blocks = cpu_to_le32(val); } while (0)
+#define PUT_SB_ROOT_BLOCK(s, val) \
+ do { SB_V1_DISK_SUPER_BLOCK(s)->s_root_block = cpu_to_le32(val); } while (0)
+#define PUT_SB_TREE_HEIGHT(s, val) \
+ do { SB_V1_DISK_SUPER_BLOCK(s)->s_tree_height = cpu_to_le16(val); } while (0)
+#define PUT_SB_REISERFS_STATE(s, val) \
+ do { SB_V1_DISK_SUPER_BLOCK(s)->s_umount_state = cpu_to_le16(val); } while (0)
+#define PUT_SB_VERSION(s, val) \
+ do { SB_V1_DISK_SUPER_BLOCK(s)->s_version = cpu_to_le16(val); } while (0)
+#define PUT_SB_BMAP_NR(s, val) \
+ do { SB_V1_DISK_SUPER_BLOCK(s)->s_bmap_nr = cpu_to_le16 (val); } while (0)
+
+#define SB_ONDISK_JP(s) (&SB_V1_DISK_SUPER_BLOCK(s)->s_journal)
+#define SB_ONDISK_JOURNAL_SIZE(s) \
+ le32_to_cpu ((SB_ONDISK_JP(s)->jp_journal_size))
+#define SB_ONDISK_JOURNAL_1st_BLOCK(s) \
+ le32_to_cpu ((SB_ONDISK_JP(s)->jp_journal_1st_block))
+#define SB_ONDISK_JOURNAL_DEVICE(s) \
+ le32_to_cpu ((SB_ONDISK_JP(s)->jp_journal_dev))
+#define SB_ONDISK_RESERVED_FOR_JOURNAL(s) \
+ le16_to_cpu ((SB_V1_DISK_SUPER_BLOCK(s)->s_reserved_for_journal))
+
+#define is_block_in_log_or_reserved_area(s, block) \
+ block >= SB_JOURNAL_1st_RESERVED_BLOCK(s) \
+ && block < SB_JOURNAL_1st_RESERVED_BLOCK(s) + \
+ ((!is_reiserfs_jr(SB_DISK_SUPER_BLOCK(s)) ? \
+ SB_ONDISK_JOURNAL_SIZE(s) + 1 : SB_ONDISK_RESERVED_FOR_JOURNAL(s)))
+
+int is_reiserfs_3_5(struct reiserfs_super_block *rs);
+int is_reiserfs_3_6(struct reiserfs_super_block *rs);
+int is_reiserfs_jr(struct reiserfs_super_block *rs);
+
+/* ReiserFS leaves the first 64k unused, so that partition labels have
+ enough space. If someone wants to write a fancy bootloader that
+ needs more than 64k, let us know, and this will be increased in size.
+ This number must be larger than than the largest block size on any
+ platform, or code will break. -Hans */
+#define REISERFS_DISK_OFFSET_IN_BYTES (64 * 1024)
+#define REISERFS_FIRST_BLOCK unused_define
+#define REISERFS_JOURNAL_OFFSET_IN_BYTES REISERFS_DISK_OFFSET_IN_BYTES
+
+/* the spot for the super in versions 3.5 - 3.5.10 (inclusive) */
+#define REISERFS_OLD_DISK_OFFSET_IN_BYTES (8 * 1024)
+
+// reiserfs internal error code (used by search_by_key adn fix_nodes))
+#define CARRY_ON 0
+#define REPEAT_SEARCH -1
+#define IO_ERROR -2
+#define NO_DISK_SPACE -3
+#define NO_BALANCING_NEEDED (-4)
+#define NO_MORE_UNUSED_CONTIGUOUS_BLOCKS (-5)
+#define QUOTA_EXCEEDED -6
+
+typedef __u32 b_blocknr_t;
+typedef __le32 unp_t;
+
+struct unfm_nodeinfo {
+ unp_t unfm_nodenum;
+ unsigned short unfm_freespace;
+};
+
+/* there are two formats of keys: 3.5 and 3.6
+ */
+#define KEY_FORMAT_3_5 0
+#define KEY_FORMAT_3_6 1
+
+/* there are two stat datas */
+#define STAT_DATA_V1 0
+#define STAT_DATA_V2 1
+
+static __inline__ struct reiserfs_inode_info *REISERFS_I(const struct inode *inode)
+{
+ return container_of(inode, struct reiserfs_inode_info, vfs_inode);
+}
+
+static __inline__ struct reiserfs_sb_info *REISERFS_SB(const struct super_block *sb)
+{
+ return sb->s_fs_info;
+}
+
+/* Don't trust REISERFS_SB(sb)->s_bmap_nr, it's a u16
+ * which overflows on large file systems. */
+static __inline__ u32 reiserfs_bmap_count(struct super_block *sb)
+{
+ return (SB_BLOCK_COUNT(sb) - 1) / (sb->s_blocksize * 8) + 1;
+}
+
+static __inline__ int bmap_would_wrap(unsigned bmap_nr)
+{
+ return bmap_nr > ((1LL << 16) - 1);
+}
+
+/** this says about version of key of all items (but stat data) the
+ object consists of */
+#define get_inode_item_key_version( inode ) \
+ ((REISERFS_I(inode)->i_flags & i_item_key_version_mask) ? KEY_FORMAT_3_6 : KEY_FORMAT_3_5)
+
+#define set_inode_item_key_version( inode, version ) \
+ ({ if((version)==KEY_FORMAT_3_6) \
+ REISERFS_I(inode)->i_flags |= i_item_key_version_mask; \
+ else \
+ REISERFS_I(inode)->i_flags &= ~i_item_key_version_mask; })
+
+#define get_inode_sd_version(inode) \
+ ((REISERFS_I(inode)->i_flags & i_stat_data_version_mask) ? STAT_DATA_V2 : STAT_DATA_V1)
+
+#define set_inode_sd_version(inode, version) \
+ ({ if((version)==STAT_DATA_V2) \
+ REISERFS_I(inode)->i_flags |= i_stat_data_version_mask; \
+ else \
+ REISERFS_I(inode)->i_flags &= ~i_stat_data_version_mask; })
+
+/* This is an aggressive tail suppression policy, I am hoping it
+ improves our benchmarks. The principle behind it is that percentage
+ space saving is what matters, not absolute space saving. This is
+ non-intuitive, but it helps to understand it if you consider that the
+ cost to access 4 blocks is not much more than the cost to access 1
+ block, if you have to do a seek and rotate. A tail risks a
+ non-linear disk access that is significant as a percentage of total
+ time cost for a 4 block file and saves an amount of space that is
+ less significant as a percentage of space, or so goes the hypothesis.
+ -Hans */
+#define STORE_TAIL_IN_UNFM_S1(n_file_size,n_tail_size,n_block_size) \
+(\
+ (!(n_tail_size)) || \
+ (((n_tail_size) > MAX_DIRECT_ITEM_LEN(n_block_size)) || \
+ ( (n_file_size) >= (n_block_size) * 4 ) || \
+ ( ( (n_file_size) >= (n_block_size) * 3 ) && \
+ ( (n_tail_size) >= (MAX_DIRECT_ITEM_LEN(n_block_size))/4) ) || \
+ ( ( (n_file_size) >= (n_block_size) * 2 ) && \
+ ( (n_tail_size) >= (MAX_DIRECT_ITEM_LEN(n_block_size))/2) ) || \
+ ( ( (n_file_size) >= (n_block_size) ) && \
+ ( (n_tail_size) >= (MAX_DIRECT_ITEM_LEN(n_block_size) * 3)/4) ) ) \
+)
+
+/* Another strategy for tails, this one means only create a tail if all the
+ file would fit into one DIRECT item.
+ Primary intention for this one is to increase performance by decreasing
+ seeking.
+*/
+#define STORE_TAIL_IN_UNFM_S2(n_file_size,n_tail_size,n_block_size) \
+(\
+ (!(n_tail_size)) || \
+ (((n_file_size) > MAX_DIRECT_ITEM_LEN(n_block_size)) ) \
+)
+
+/*
+ * values for s_umount_state field
+ */
+#define REISERFS_VALID_FS 1
+#define REISERFS_ERROR_FS 2
+
+//
+// there are 5 item types currently
+//
+#define TYPE_STAT_DATA 0
+#define TYPE_INDIRECT 1
+#define TYPE_DIRECT 2
+#define TYPE_DIRENTRY 3
+#define TYPE_MAXTYPE 3
+#define TYPE_ANY 15 // FIXME: comment is required
+
+/***************************************************************************/
+/* KEY & ITEM HEAD */
+/***************************************************************************/
+
+//
+// directories use this key as well as old files
+//
+struct offset_v1 {
+ __le32 k_offset;
+ __le32 k_uniqueness;
+} __attribute__ ((__packed__));
+
+struct offset_v2 {
+ __le64 v;
+} __attribute__ ((__packed__));
+
+static __inline__ __u16 offset_v2_k_type(const struct offset_v2 *v2)
+{
+ __u8 type = le64_to_cpu(v2->v) >> 60;
+ return (type <= TYPE_MAXTYPE) ? type : TYPE_ANY;
+}
+
+static __inline__ void set_offset_v2_k_type(struct offset_v2 *v2, int type)
+{
+ v2->v =
+ (v2->v & cpu_to_le64(~0ULL >> 4)) | cpu_to_le64((__u64) type << 60);
+}
+
+static __inline__ loff_t offset_v2_k_offset(const struct offset_v2 *v2)
+{
+ return le64_to_cpu(v2->v) & (~0ULL >> 4);
+}
+
+static __inline__ void set_offset_v2_k_offset(struct offset_v2 *v2, loff_t offset)
+{
+ offset &= (~0ULL >> 4);
+ v2->v = (v2->v & cpu_to_le64(15ULL << 60)) | cpu_to_le64(offset);
+}
+
+/* Key of an item determines its location in the S+tree, and
+ is composed of 4 components */
+struct reiserfs_key {
+ __le32 k_dir_id; /* packing locality: by default parent
+ directory object id */
+ __le32 k_objectid; /* object identifier */
+ union {
+ struct offset_v1 k_offset_v1;
+ struct offset_v2 k_offset_v2;
+ } __attribute__ ((__packed__)) u;
+} __attribute__ ((__packed__));
+
+struct in_core_key {
+ __u32 k_dir_id; /* packing locality: by default parent
+ directory object id */
+ __u32 k_objectid; /* object identifier */
+ __u64 k_offset;
+ __u8 k_type;
+};
+
+struct cpu_key {
+ struct in_core_key on_disk_key;
+ int version;
+ int key_length; /* 3 in all cases but direct2indirect and
+ indirect2direct conversion */
+};
+
+/* Our function for comparing keys can compare keys of different
+ lengths. It takes as a parameter the length of the keys it is to
+ compare. These defines are used in determining what is to be passed
+ to it as that parameter. */
+#define REISERFS_FULL_KEY_LEN 4
+#define REISERFS_SHORT_KEY_LEN 2
+
+/* The result of the key compare */
+#define FIRST_GREATER 1
+#define SECOND_GREATER -1
+#define KEYS_IDENTICAL 0
+#define KEY_FOUND 1
+#define KEY_NOT_FOUND 0
+
+#define KEY_SIZE (sizeof(struct reiserfs_key))
+#define SHORT_KEY_SIZE (sizeof (__u32) + sizeof (__u32))
+
+/* return values for search_by_key and clones */
+#define ITEM_FOUND 1
+#define ITEM_NOT_FOUND 0
+#define ENTRY_FOUND 1
+#define ENTRY_NOT_FOUND 0
+#define DIRECTORY_NOT_FOUND -1
+#define REGULAR_FILE_FOUND -2
+#define DIRECTORY_FOUND -3
+#define BYTE_FOUND 1
+#define BYTE_NOT_FOUND 0
+#define FILE_NOT_FOUND -1
+
+#define POSITION_FOUND 1
+#define POSITION_NOT_FOUND 0
+
+// return values for reiserfs_find_entry and search_by_entry_key
+#define NAME_FOUND 1
+#define NAME_NOT_FOUND 0
+#define GOTO_PREVIOUS_ITEM 2
+#define NAME_FOUND_INVISIBLE 3
+
+/* Everything in the filesystem is stored as a set of items. The
+ item head contains the key of the item, its free space (for
+ indirect items) and specifies the location of the item itself
+ within the block. */
+
+struct item_head {
+ /* Everything in the tree is found by searching for it based on
+ * its key.*/
+ struct reiserfs_key ih_key;
+ union {
+ /* The free space in the last unformatted node of an
+ indirect item if this is an indirect item. This
+ equals 0xFFFF iff this is a direct item or stat data
+ item. Note that the key, not this field, is used to
+ determine the item type, and thus which field this
+ union contains. */
+ __le16 ih_free_space_reserved;
+ /* Iff this is a directory item, this field equals the
+ number of directory entries in the directory item. */
+ __le16 ih_entry_count;
+ } __attribute__ ((__packed__)) u;
+ __le16 ih_item_len; /* total size of the item body */
+ __le16 ih_item_location; /* an offset to the item body
+ * within the block */
+ __le16 ih_version; /* 0 for all old items, 2 for new
+ ones. Highest bit is set by fsck
+ temporary, cleaned after all
+ done */
+} __attribute__ ((__packed__));
+/* size of item header */
+#define IH_SIZE (sizeof(struct item_head))
+
+#define ih_free_space(ih) le16_to_cpu((ih)->u.ih_free_space_reserved)
+#define ih_version(ih) le16_to_cpu((ih)->ih_version)
+#define ih_entry_count(ih) le16_to_cpu((ih)->u.ih_entry_count)
+#define ih_location(ih) le16_to_cpu((ih)->ih_item_location)
+#define ih_item_len(ih) le16_to_cpu((ih)->ih_item_len)
+
+#define put_ih_free_space(ih, val) do { (ih)->u.ih_free_space_reserved = cpu_to_le16(val); } while(0)
+#define put_ih_version(ih, val) do { (ih)->ih_version = cpu_to_le16(val); } while (0)
+#define put_ih_entry_count(ih, val) do { (ih)->u.ih_entry_count = cpu_to_le16(val); } while (0)
+#define put_ih_location(ih, val) do { (ih)->ih_item_location = cpu_to_le16(val); } while (0)
+#define put_ih_item_len(ih, val) do { (ih)->ih_item_len = cpu_to_le16(val); } while (0)
+
+#define unreachable_item(ih) (ih_version(ih) & (1 << 15))
+
+#define get_ih_free_space(ih) (ih_version (ih) == KEY_FORMAT_3_6 ? 0 : ih_free_space (ih))
+#define set_ih_free_space(ih,val) put_ih_free_space((ih), ((ih_version(ih) == KEY_FORMAT_3_6) ? 0 : (val)))
+
+/* these operate on indirect items, where you've got an array of ints
+** at a possibly unaligned location. These are a noop on ia32
+**
+** p is the array of __u32, i is the index into the array, v is the value
+** to store there.
+*/
+#define get_block_num(p, i) le32_to_cpu(get_unaligned((p) + (i)))
+#define put_block_num(p, i, v) put_unaligned(cpu_to_le32(v), (p) + (i))
+
+//
+// in old version uniqueness field shows key type
+//
+#define V1_SD_UNIQUENESS 0
+#define V1_INDIRECT_UNIQUENESS 0xfffffffe
+#define V1_DIRECT_UNIQUENESS 0xffffffff
+#define V1_DIRENTRY_UNIQUENESS 500
+#define V1_ANY_UNIQUENESS 555 // FIXME: comment is required
+
+//
+// here are conversion routines
+//
+static __inline__ int uniqueness2type(__u32 uniqueness) CONSTF;
+static __inline__ int uniqueness2type(__u32 uniqueness)
+{
+ switch ((int)uniqueness) {
+ case V1_SD_UNIQUENESS:
+ return TYPE_STAT_DATA;
+ case V1_INDIRECT_UNIQUENESS:
+ return TYPE_INDIRECT;
+ case V1_DIRECT_UNIQUENESS:
+ return TYPE_DIRECT;
+ case V1_DIRENTRY_UNIQUENESS:
+ return TYPE_DIRENTRY;
+ default:
+ reiserfs_warning(NULL, "vs-500: unknown uniqueness %d",
+ uniqueness);
+ case V1_ANY_UNIQUENESS:
+ return TYPE_ANY;
+ }
+}
+
+static __inline__ __u32 type2uniqueness(int type) CONSTF;
+static __inline__ __u32 type2uniqueness(int type)
+{
+ switch (type) {
+ case TYPE_STAT_DATA:
+ return V1_SD_UNIQUENESS;
+ case TYPE_INDIRECT:
+ return V1_INDIRECT_UNIQUENESS;
+ case TYPE_DIRECT:
+ return V1_DIRECT_UNIQUENESS;
+ case TYPE_DIRENTRY:
+ return V1_DIRENTRY_UNIQUENESS;
+ default:
+ reiserfs_warning(NULL, "vs-501: unknown type %d", type);
+ case TYPE_ANY:
+ return V1_ANY_UNIQUENESS;
+ }
+}
+
+//
+// key is pointer to on disk key which is stored in le, result is cpu,
+// there is no way to get version of object from key, so, provide
+// version to these defines
+//
+static __inline__ loff_t le_key_k_offset(int version,
+ const struct reiserfs_key *key)
+{
+ return (version == KEY_FORMAT_3_5) ?
+ le32_to_cpu(key->u.k_offset_v1.k_offset) :
+ offset_v2_k_offset(&(key->u.k_offset_v2));
+}
+
+static __inline__ loff_t le_ih_k_offset(const struct item_head *ih)
+{
+ return le_key_k_offset(ih_version(ih), &(ih->ih_key));
+}
+
+static __inline__ loff_t le_key_k_type(int version, const struct reiserfs_key *key)
+{
+ return (version == KEY_FORMAT_3_5) ?
+ uniqueness2type(le32_to_cpu(key->u.k_offset_v1.k_uniqueness)) :
+ offset_v2_k_type(&(key->u.k_offset_v2));
+}
+
+static __inline__ loff_t le_ih_k_type(const struct item_head *ih)
+{
+ return le_key_k_type(ih_version(ih), &(ih->ih_key));
+}
+
+static __inline__ void set_le_key_k_offset(int version, struct reiserfs_key *key,
+ loff_t offset)
+{
+ (version == KEY_FORMAT_3_5) ? (void)(key->u.k_offset_v1.k_offset = cpu_to_le32(offset)) : /* jdm check */
+ (void)(set_offset_v2_k_offset(&(key->u.k_offset_v2), offset));
+}
+
+static __inline__ void set_le_ih_k_offset(struct item_head *ih, loff_t offset)
+{
+ set_le_key_k_offset(ih_version(ih), &(ih->ih_key), offset);
+}
+
+static __inline__ void set_le_key_k_type(int version, struct reiserfs_key *key,
+ int type)
+{
+ (version == KEY_FORMAT_3_5) ?
+ (void)(key->u.k_offset_v1.k_uniqueness =
+ cpu_to_le32(type2uniqueness(type)))
+ : (void)(set_offset_v2_k_type(&(key->u.k_offset_v2), type));
+}
+static __inline__ void set_le_ih_k_type(struct item_head *ih, int type)
+{
+ set_le_key_k_type(ih_version(ih), &(ih->ih_key), type);
+}
+
+#define is_direntry_le_key(version,key) (le_key_k_type (version, key) == TYPE_DIRENTRY)
+#define is_direct_le_key(version,key) (le_key_k_type (version, key) == TYPE_DIRECT)
+#define is_indirect_le_key(version,key) (le_key_k_type (version, key) == TYPE_INDIRECT)
+#define is_statdata_le_key(version,key) (le_key_k_type (version, key) == TYPE_STAT_DATA)
+
+//
+// item header has version.
+//
+#define is_direntry_le_ih(ih) is_direntry_le_key (ih_version (ih), &((ih)->ih_key))
+#define is_direct_le_ih(ih) is_direct_le_key (ih_version (ih), &((ih)->ih_key))
+#define is_indirect_le_ih(ih) is_indirect_le_key (ih_version(ih), &((ih)->ih_key))
+#define is_statdata_le_ih(ih) is_statdata_le_key (ih_version (ih), &((ih)->ih_key))
+
+//
+// key is pointer to cpu key, result is cpu
+//
+static __inline__ loff_t cpu_key_k_offset(const struct cpu_key *key)
+{
+ return key->on_disk_key.k_offset;
+}
+
+static __inline__ loff_t cpu_key_k_type(const struct cpu_key *key)
+{
+ return key->on_disk_key.k_type;
+}
+
+static __inline__ void set_cpu_key_k_offset(struct cpu_key *key, loff_t offset)
+{
+ key->on_disk_key.k_offset = offset;
+}
+
+static __inline__ void set_cpu_key_k_type(struct cpu_key *key, int type)
+{
+ key->on_disk_key.k_type = type;
+}
+
+static __inline__ void cpu_key_k_offset_dec(struct cpu_key *key)
+{
+ key->on_disk_key.k_offset--;
+}
+
+#define is_direntry_cpu_key(key) (cpu_key_k_type (key) == TYPE_DIRENTRY)
+#define is_direct_cpu_key(key) (cpu_key_k_type (key) == TYPE_DIRECT)
+#define is_indirect_cpu_key(key) (cpu_key_k_type (key) == TYPE_INDIRECT)
+#define is_statdata_cpu_key(key) (cpu_key_k_type (key) == TYPE_STAT_DATA)
+
+/* are these used ? */
+#define is_direntry_cpu_ih(ih) (is_direntry_cpu_key (&((ih)->ih_key)))
+#define is_direct_cpu_ih(ih) (is_direct_cpu_key (&((ih)->ih_key)))
+#define is_indirect_cpu_ih(ih) (is_indirect_cpu_key (&((ih)->ih_key)))
+#define is_statdata_cpu_ih(ih) (is_statdata_cpu_key (&((ih)->ih_key)))
+
+#define I_K_KEY_IN_ITEM(p_s_ih, p_s_key, n_blocksize) \
+ ( ! COMP_SHORT_KEYS(p_s_ih, p_s_key) && \
+ I_OFF_BYTE_IN_ITEM(p_s_ih, k_offset (p_s_key), n_blocksize) )
+
+/* maximal length of item */
+#define MAX_ITEM_LEN(block_size) (block_size - BLKH_SIZE - IH_SIZE)
+#define MIN_ITEM_LEN 1
+
+/* object identifier for root dir */
+#define REISERFS_ROOT_OBJECTID 2
+#define REISERFS_ROOT_PARENT_OBJECTID 1
+extern struct reiserfs_key root_key;
+
+/*
+ * Picture represents a leaf of the S+tree
+ * ______________________________________________________
+ * | | Array of | | |
+ * |Block | Object-Item | F r e e | Objects- |
+ * | head | Headers | S p a c e | Items |
+ * |______|_______________|___________________|___________|
+ */
+
+/* Header of a disk block. More precisely, header of a formatted leaf
+ or internal node, and not the header of an unformatted node. */
+struct block_head {
+ __le16 blk_level; /* Level of a block in the tree. */
+ __le16 blk_nr_item; /* Number of keys/items in a block. */
+ __le16 blk_free_space; /* Block free space in bytes. */
+ __le16 blk_reserved;
+ /* dump this in v4/planA */
+ struct reiserfs_key blk_right_delim_key; /* kept only for compatibility */
+};
+
+#define BLKH_SIZE (sizeof(struct block_head))
+#define blkh_level(p_blkh) (le16_to_cpu((p_blkh)->blk_level))
+#define blkh_nr_item(p_blkh) (le16_to_cpu((p_blkh)->blk_nr_item))
+#define blkh_free_space(p_blkh) (le16_to_cpu((p_blkh)->blk_free_space))
+#define blkh_reserved(p_blkh) (le16_to_cpu((p_blkh)->blk_reserved))
+#define set_blkh_level(p_blkh,val) ((p_blkh)->blk_level = cpu_to_le16(val))
+#define set_blkh_nr_item(p_blkh,val) ((p_blkh)->blk_nr_item = cpu_to_le16(val))
+#define set_blkh_free_space(p_blkh,val) ((p_blkh)->blk_free_space = cpu_to_le16(val))
+#define set_blkh_reserved(p_blkh,val) ((p_blkh)->blk_reserved = cpu_to_le16(val))
+#define blkh_right_delim_key(p_blkh) ((p_blkh)->blk_right_delim_key)
+#define set_blkh_right_delim_key(p_blkh,val) ((p_blkh)->blk_right_delim_key = val)
+
+/*
+ * values for blk_level field of the struct block_head
+ */
+
+#define FREE_LEVEL 0 /* when node gets removed from the tree its
+ blk_level is set to FREE_LEVEL. It is then
+ used to see whether the node is still in the
+ tree */
+
+#define DISK_LEAF_NODE_LEVEL 1 /* Leaf node level. */
+
+/* Given the buffer head of a formatted node, resolve to the block head of that node. */
+#define B_BLK_HEAD(p_s_bh) ((struct block_head *)((p_s_bh)->b_data))
+/* Number of items that are in buffer. */
+#define B_NR_ITEMS(p_s_bh) (blkh_nr_item(B_BLK_HEAD(p_s_bh)))
+#define B_LEVEL(p_s_bh) (blkh_level(B_BLK_HEAD(p_s_bh)))
+#define B_FREE_SPACE(p_s_bh) (blkh_free_space(B_BLK_HEAD(p_s_bh)))
+
+#define PUT_B_NR_ITEMS(p_s_bh,val) do { set_blkh_nr_item(B_BLK_HEAD(p_s_bh),val); } while (0)
+#define PUT_B_LEVEL(p_s_bh,val) do { set_blkh_level(B_BLK_HEAD(p_s_bh),val); } while (0)
+#define PUT_B_FREE_SPACE(p_s_bh,val) do { set_blkh_free_space(B_BLK_HEAD(p_s_bh),val); } while (0)
+
+/* Get right delimiting key. -- little endian */
+#define B_PRIGHT_DELIM_KEY(p_s_bh) (&(blk_right_delim_key(B_BLK_HEAD(p_s_bh))))
+
+/* Does the buffer contain a disk leaf. */
+#define B_IS_ITEMS_LEVEL(p_s_bh) (B_LEVEL(p_s_bh) == DISK_LEAF_NODE_LEVEL)
+
+/* Does the buffer contain a disk internal node */
+#define B_IS_KEYS_LEVEL(p_s_bh) (B_LEVEL(p_s_bh) > DISK_LEAF_NODE_LEVEL \
+ && B_LEVEL(p_s_bh) <= MAX_HEIGHT)
+
+/***************************************************************************/
+/* STAT DATA */
+/***************************************************************************/
+
+//
+// old stat data is 32 bytes long. We are going to distinguish new one by
+// different size
+//
+struct stat_data_v1 {
+ __le16 sd_mode; /* file type, permissions */
+ __le16 sd_nlink; /* number of hard links */
+ __le16 sd_uid; /* owner */
+ __le16 sd_gid; /* group */
+ __le32 sd_size; /* file size */
+ __le32 sd_atime; /* time of last access */
+ __le32 sd_mtime; /* time file was last modified */
+ __le32 sd_ctime; /* time inode (stat data) was last changed (except changes to sd_atime and sd_mtime) */
+ union {
+ __le32 sd_rdev;
+ __le32 sd_blocks; /* number of blocks file uses */
+ } __attribute__ ((__packed__)) u;
+ __le32 sd_first_direct_byte; /* first byte of file which is stored
+ in a direct item: except that if it
+ equals 1 it is a symlink and if it
+ equals ~(__u32)0 there is no
+ direct item. The existence of this
+ field really grates on me. Let's
+ replace it with a macro based on
+ sd_size and our tail suppression
+ policy. Someday. -Hans */
+} __attribute__ ((__packed__));
+
+#define SD_V1_SIZE (sizeof(struct stat_data_v1))
+#define stat_data_v1(ih) (ih_version (ih) == KEY_FORMAT_3_5)
+#define sd_v1_mode(sdp) (le16_to_cpu((sdp)->sd_mode))
+#define set_sd_v1_mode(sdp,v) ((sdp)->sd_mode = cpu_to_le16(v))
+#define sd_v1_nlink(sdp) (le16_to_cpu((sdp)->sd_nlink))
+#define set_sd_v1_nlink(sdp,v) ((sdp)->sd_nlink = cpu_to_le16(v))
+#define sd_v1_uid(sdp) (le16_to_cpu((sdp)->sd_uid))
+#define set_sd_v1_uid(sdp,v) ((sdp)->sd_uid = cpu_to_le16(v))
+#define sd_v1_gid(sdp) (le16_to_cpu((sdp)->sd_gid))
+#define set_sd_v1_gid(sdp,v) ((sdp)->sd_gid = cpu_to_le16(v))
+#define sd_v1_size(sdp) (le32_to_cpu((sdp)->sd_size))
+#define set_sd_v1_size(sdp,v) ((sdp)->sd_size = cpu_to_le32(v))
+#define sd_v1_atime(sdp) (le32_to_cpu((sdp)->sd_atime))
+#define set_sd_v1_atime(sdp,v) ((sdp)->sd_atime = cpu_to_le32(v))
+#define sd_v1_mtime(sdp) (le32_to_cpu((sdp)->sd_mtime))
+#define set_sd_v1_mtime(sdp,v) ((sdp)->sd_mtime = cpu_to_le32(v))
+#define sd_v1_ctime(sdp) (le32_to_cpu((sdp)->sd_ctime))
+#define set_sd_v1_ctime(sdp,v) ((sdp)->sd_ctime = cpu_to_le32(v))
+#define sd_v1_rdev(sdp) (le32_to_cpu((sdp)->u.sd_rdev))
+#define set_sd_v1_rdev(sdp,v) ((sdp)->u.sd_rdev = cpu_to_le32(v))
+#define sd_v1_blocks(sdp) (le32_to_cpu((sdp)->u.sd_blocks))
+#define set_sd_v1_blocks(sdp,v) ((sdp)->u.sd_blocks = cpu_to_le32(v))
+#define sd_v1_first_direct_byte(sdp) \
+ (le32_to_cpu((sdp)->sd_first_direct_byte))
+#define set_sd_v1_first_direct_byte(sdp,v) \
+ ((sdp)->sd_first_direct_byte = cpu_to_le32(v))
+
+/* inode flags stored in sd_attrs (nee sd_reserved) */
+
+/* we want common flags to have the same values as in ext2,
+ so chattr(1) will work without problems */
+#define REISERFS_IMMUTABLE_FL FS_IMMUTABLE_FL
+#define REISERFS_APPEND_FL FS_APPEND_FL
+#define REISERFS_SYNC_FL FS_SYNC_FL
+#define REISERFS_NOATIME_FL FS_NOATIME_FL
+#define REISERFS_NODUMP_FL FS_NODUMP_FL
+#define REISERFS_SECRM_FL FS_SECRM_FL
+#define REISERFS_UNRM_FL FS_UNRM_FL
+#define REISERFS_COMPR_FL FS_COMPR_FL
+#define REISERFS_NOTAIL_FL FS_NOTAIL_FL
+
+/* persistent flags that file inherits from the parent directory */
+#define REISERFS_INHERIT_MASK ( REISERFS_IMMUTABLE_FL | \
+ REISERFS_SYNC_FL | \
+ REISERFS_NOATIME_FL | \
+ REISERFS_NODUMP_FL | \
+ REISERFS_SECRM_FL | \
+ REISERFS_COMPR_FL | \
+ REISERFS_NOTAIL_FL )
+
+/* Stat Data on disk (reiserfs version of UFS disk inode minus the
+ address blocks) */
+struct stat_data {
+ __le16 sd_mode; /* file type, permissions */
+ __le16 sd_attrs; /* persistent inode flags */
+ __le32 sd_nlink; /* number of hard links */
+ __le64 sd_size; /* file size */
+ __le32 sd_uid; /* owner */
+ __le32 sd_gid; /* group */
+ __le32 sd_atime; /* time of last access */
+ __le32 sd_mtime; /* time file was last modified */
+ __le32 sd_ctime; /* time inode (stat data) was last changed (except changes to sd_atime and sd_mtime) */
+ __le32 sd_blocks;
+ union {
+ __le32 sd_rdev;
+ __le32 sd_generation;
+ //__le32 sd_first_direct_byte;
+ /* first byte of file which is stored in a
+ direct item: except that if it equals 1
+ it is a symlink and if it equals
+ ~(__u32)0 there is no direct item. The
+ existence of this field really grates
+ on me. Let's replace it with a macro
+ based on sd_size and our tail
+ suppression policy? */
+ } __attribute__ ((__packed__)) u;
+} __attribute__ ((__packed__));
+//
+// this is 44 bytes long
+//
+#define SD_SIZE (sizeof(struct stat_data))
+#define SD_V2_SIZE SD_SIZE
+#define stat_data_v2(ih) (ih_version (ih) == KEY_FORMAT_3_6)
+#define sd_v2_mode(sdp) (le16_to_cpu((sdp)->sd_mode))
+#define set_sd_v2_mode(sdp,v) ((sdp)->sd_mode = cpu_to_le16(v))
+/* sd_reserved */
+/* set_sd_reserved */
+#define sd_v2_nlink(sdp) (le32_to_cpu((sdp)->sd_nlink))
+#define set_sd_v2_nlink(sdp,v) ((sdp)->sd_nlink = cpu_to_le32(v))
+#define sd_v2_size(sdp) (le64_to_cpu((sdp)->sd_size))
+#define set_sd_v2_size(sdp,v) ((sdp)->sd_size = cpu_to_le64(v))
+#define sd_v2_uid(sdp) (le32_to_cpu((sdp)->sd_uid))
+#define set_sd_v2_uid(sdp,v) ((sdp)->sd_uid = cpu_to_le32(v))
+#define sd_v2_gid(sdp) (le32_to_cpu((sdp)->sd_gid))
+#define set_sd_v2_gid(sdp,v) ((sdp)->sd_gid = cpu_to_le32(v))
+#define sd_v2_atime(sdp) (le32_to_cpu((sdp)->sd_atime))
+#define set_sd_v2_atime(sdp,v) ((sdp)->sd_atime = cpu_to_le32(v))
+#define sd_v2_mtime(sdp) (le32_to_cpu((sdp)->sd_mtime))
+#define set_sd_v2_mtime(sdp,v) ((sdp)->sd_mtime = cpu_to_le32(v))
+#define sd_v2_ctime(sdp) (le32_to_cpu((sdp)->sd_ctime))
+#define set_sd_v2_ctime(sdp,v) ((sdp)->sd_ctime = cpu_to_le32(v))
+#define sd_v2_blocks(sdp) (le32_to_cpu((sdp)->sd_blocks))
+#define set_sd_v2_blocks(sdp,v) ((sdp)->sd_blocks = cpu_to_le32(v))
+#define sd_v2_rdev(sdp) (le32_to_cpu((sdp)->u.sd_rdev))
+#define set_sd_v2_rdev(sdp,v) ((sdp)->u.sd_rdev = cpu_to_le32(v))
+#define sd_v2_generation(sdp) (le32_to_cpu((sdp)->u.sd_generation))
+#define set_sd_v2_generation(sdp,v) ((sdp)->u.sd_generation = cpu_to_le32(v))
+#define sd_v2_attrs(sdp) (le16_to_cpu((sdp)->sd_attrs))
+#define set_sd_v2_attrs(sdp,v) ((sdp)->sd_attrs = cpu_to_le16(v))
+
+/***************************************************************************/
+/* DIRECTORY STRUCTURE */
+/***************************************************************************/
+/*
+ Picture represents the structure of directory items
+ ________________________________________________
+ | Array of | | | | | |
+ | directory |N-1| N-2 | .... | 1st |0th|
+ | entry headers | | | | | |
+ |_______________|___|_____|________|_______|___|
+ <---- directory entries ------>
+
+ First directory item has k_offset component 1. We store "." and ".."
+ in one item, always, we never split "." and ".." into differing
+ items. This makes, among other things, the code for removing
+ directories simpler. */
+#define SD_OFFSET 0
+#define SD_UNIQUENESS 0
+#define DOT_OFFSET 1
+#define DOT_DOT_OFFSET 2
+#define DIRENTRY_UNIQUENESS 500
+
+/* */
+#define FIRST_ITEM_OFFSET 1
+
+/*
+ Q: How to get key of object pointed to by entry from entry?
+
+ A: Each directory entry has its header. This header has deh_dir_id and deh_objectid fields, those are key
+ of object, entry points to */
+
+/* NOT IMPLEMENTED:
+ Directory will someday contain stat data of object */
+
+struct reiserfs_de_head {
+ __le32 deh_offset; /* third component of the directory entry key */
+ __le32 deh_dir_id; /* objectid of the parent directory of the object, that is referenced
+ by directory entry */
+ __le32 deh_objectid; /* objectid of the object, that is referenced by directory entry */
+ __le16 deh_location; /* offset of name in the whole item */
+ __le16 deh_state; /* whether 1) entry contains stat data (for future), and 2) whether
+ entry is hidden (unlinked) */
+} __attribute__ ((__packed__));
+#define DEH_SIZE sizeof(struct reiserfs_de_head)
+#define deh_offset(p_deh) (le32_to_cpu((p_deh)->deh_offset))
+#define deh_dir_id(p_deh) (le32_to_cpu((p_deh)->deh_dir_id))
+#define deh_objectid(p_deh) (le32_to_cpu((p_deh)->deh_objectid))
+#define deh_location(p_deh) (le16_to_cpu((p_deh)->deh_location))
+#define deh_state(p_deh) (le16_to_cpu((p_deh)->deh_state))
+
+#define put_deh_offset(p_deh,v) ((p_deh)->deh_offset = cpu_to_le32((v)))
+#define put_deh_dir_id(p_deh,v) ((p_deh)->deh_dir_id = cpu_to_le32((v)))
+#define put_deh_objectid(p_deh,v) ((p_deh)->deh_objectid = cpu_to_le32((v)))
+#define put_deh_location(p_deh,v) ((p_deh)->deh_location = cpu_to_le16((v)))
+#define put_deh_state(p_deh,v) ((p_deh)->deh_state = cpu_to_le16((v)))
+
+/* empty directory contains two entries "." and ".." and their headers */
+#define EMPTY_DIR_SIZE \
+(DEH_SIZE * 2 + ROUND_UP (strlen (".")) + ROUND_UP (strlen ("..")))
+
+/* old format directories have this size when empty */
+#define EMPTY_DIR_SIZE_V1 (DEH_SIZE * 2 + 3)
+
+#define DEH_Statdata 0 /* not used now */
+#define DEH_Visible 2
+
+/* 64 bit systems (and the S/390) need to be aligned explicitly -jdm */
+#if BITS_PER_LONG == 64 || defined(__s390__) || defined(__hppa__)
+# define ADDR_UNALIGNED_BITS (3)
+#endif
+
+/* These are only used to manipulate deh_state.
+ * Because of this, we'll use the ext2_ bit routines,
+ * since they are little endian */
+#ifdef ADDR_UNALIGNED_BITS
+
+# define aligned_address(addr) ((void *)((long)(addr) & ~((1UL << ADDR_UNALIGNED_BITS) - 1)))
+# define unaligned_offset(addr) (((int)((long)(addr) & ((1 << ADDR_UNALIGNED_BITS) - 1))) << 3)
+
+# define set_bit_unaligned(nr, addr) ext2_set_bit((nr) + unaligned_offset(addr), aligned_address(addr))
+# define clear_bit_unaligned(nr, addr) ext2_clear_bit((nr) + unaligned_offset(addr), aligned_address(addr))
+# define test_bit_unaligned(nr, addr) ext2_test_bit((nr) + unaligned_offset(addr), aligned_address(addr))
+
+#else
+
+# define set_bit_unaligned(nr, addr) ext2_set_bit(nr, addr)
+# define clear_bit_unaligned(nr, addr) ext2_clear_bit(nr, addr)
+# define test_bit_unaligned(nr, addr) ext2_test_bit(nr, addr)
+
+#endif
+
+#define mark_de_with_sd(deh) set_bit_unaligned (DEH_Statdata, &((deh)->deh_state))
+#define mark_de_without_sd(deh) clear_bit_unaligned (DEH_Statdata, &((deh)->deh_state))
+#define mark_de_visible(deh) set_bit_unaligned (DEH_Visible, &((deh)->deh_state))
+#define mark_de_hidden(deh) clear_bit_unaligned (DEH_Visible, &((deh)->deh_state))
+
+#define de_with_sd(deh) test_bit_unaligned (DEH_Statdata, &((deh)->deh_state))
+#define de_visible(deh) test_bit_unaligned (DEH_Visible, &((deh)->deh_state))
+#define de_hidden(deh) !test_bit_unaligned (DEH_Visible, &((deh)->deh_state))
+
+extern void make_empty_dir_item_v1(char *body, __le32 dirid, __le32 objid,
+ __le32 par_dirid, __le32 par_objid);
+extern void make_empty_dir_item(char *body, __le32 dirid, __le32 objid,
+ __le32 par_dirid, __le32 par_objid);
+
+/* array of the entry headers */
+ /* get item body */
+#define B_I_PITEM(bh,ih) ( (bh)->b_data + ih_location(ih) )
+#define B_I_DEH(bh,ih) ((struct reiserfs_de_head *)(B_I_PITEM(bh,ih)))
+
+/* length of the directory entry in directory item. This define
+ calculates length of i-th directory entry using directory entry
+ locations from dir entry head. When it calculates length of 0-th
+ directory entry, it uses length of whole item in place of entry
+ location of the non-existent following entry in the calculation.
+ See picture above.*/
+/*
+#define I_DEH_N_ENTRY_LENGTH(ih,deh,i) \
+((i) ? (deh_location((deh)-1) - deh_location((deh))) : (ih_item_len((ih)) - deh_location((deh))))
+*/
+static __inline__ int entry_length(const struct buffer_head *bh,
+ const struct item_head *ih, int pos_in_item)
+{
+ struct reiserfs_de_head *deh;
+
+ deh = B_I_DEH(bh, ih) + pos_in_item;
+ if (pos_in_item)
+ return deh_location(deh - 1) - deh_location(deh);
+
+ return ih_item_len(ih) - deh_location(deh);
+}
+
+/* number of entries in the directory item, depends on ENTRY_COUNT being at the start of directory dynamic data. */
+#define I_ENTRY_COUNT(ih) (ih_entry_count((ih)))
+
+/* name by bh, ih and entry_num */
+#define B_I_E_NAME(bh,ih,entry_num) ((char *)(bh->b_data + ih_location(ih) + deh_location(B_I_DEH(bh,ih)+(entry_num))))
+
+// two entries per block (at least)
+#define REISERFS_MAX_NAME(block_size) 255
+
+/* this structure is used for operations on directory entries. It is
+ not a disk structure. */
+/* When reiserfs_find_entry or search_by_entry_key find directory
+ entry, they return filled reiserfs_dir_entry structure */
+struct reiserfs_dir_entry {
+ struct buffer_head *de_bh;
+ int de_item_num;
+ struct item_head *de_ih;
+ int de_entry_num;
+ struct reiserfs_de_head *de_deh;
+ int de_entrylen;
+ int de_namelen;
+ char *de_name;
+ unsigned long *de_gen_number_bit_string;
+
+ __u32 de_dir_id;
+ __u32 de_objectid;
+
+ struct cpu_key de_entry_key;
+};
+
+/* these defines are useful when a particular member of a reiserfs_dir_entry is needed */
+
+/* pointer to file name, stored in entry */
+#define B_I_DEH_ENTRY_FILE_NAME(bh,ih,deh) (B_I_PITEM (bh, ih) + deh_location(deh))
+
+/* length of name */
+#define I_DEH_N_ENTRY_FILE_NAME_LENGTH(ih,deh,entry_num) \
+(I_DEH_N_ENTRY_LENGTH (ih, deh, entry_num) - (de_with_sd (deh) ? SD_SIZE : 0))
+
+/* hash value occupies bits from 7 up to 30 */
+#define GET_HASH_VALUE(offset) ((offset) & 0x7fffff80LL)
+/* generation number occupies 7 bits starting from 0 up to 6 */
+#define GET_GENERATION_NUMBER(offset) ((offset) & 0x7fLL)
+#define MAX_GENERATION_NUMBER 127
+
+#define SET_GENERATION_NUMBER(offset,gen_number) (GET_HASH_VALUE(offset)|(gen_number))
+
+/*
+ * Picture represents an internal node of the reiserfs tree
+ * ______________________________________________________
+ * | | Array of | Array of | Free |
+ * |block | keys | pointers | space |
+ * | head | N | N+1 | |
+ * |______|_______________|___________________|___________|
+ */
+
+/***************************************************************************/
+/* DISK CHILD */
+/***************************************************************************/
+/* Disk child pointer: The pointer from an internal node of the tree
+ to a node that is on disk. */
+struct disk_child {
+ __le32 dc_block_number; /* Disk child's block number. */
+ __le16 dc_size; /* Disk child's used space. */
+ __le16 dc_reserved;
+};
+
+#define DC_SIZE (sizeof(struct disk_child))
+#define dc_block_number(dc_p) (le32_to_cpu((dc_p)->dc_block_number))
+#define dc_size(dc_p) (le16_to_cpu((dc_p)->dc_size))
+#define put_dc_block_number(dc_p, val) do { (dc_p)->dc_block_number = cpu_to_le32(val); } while(0)
+#define put_dc_size(dc_p, val) do { (dc_p)->dc_size = cpu_to_le16(val); } while(0)
+
+/* Get disk child by buffer header and position in the tree node. */
+#define B_N_CHILD(p_s_bh,n_pos) ((struct disk_child *)\
+((p_s_bh)->b_data+BLKH_SIZE+B_NR_ITEMS(p_s_bh)*KEY_SIZE+DC_SIZE*(n_pos)))
+
+/* Get disk child number by buffer header and position in the tree node. */
+#define B_N_CHILD_NUM(p_s_bh,n_pos) (dc_block_number(B_N_CHILD(p_s_bh,n_pos)))
+#define PUT_B_N_CHILD_NUM(p_s_bh,n_pos, val) (put_dc_block_number(B_N_CHILD(p_s_bh,n_pos), val ))
+
+ /* maximal value of field child_size in structure disk_child */
+ /* child size is the combined size of all items and their headers */
+#define MAX_CHILD_SIZE(bh) ((int)( (bh)->b_size - BLKH_SIZE ))
+
+/* amount of used space in buffer (not including block head) */
+#define B_CHILD_SIZE(cur) (MAX_CHILD_SIZE(cur)-(B_FREE_SPACE(cur)))
+
+/* max and min number of keys in internal node */
+#define MAX_NR_KEY(bh) ( (MAX_CHILD_SIZE(bh)-DC_SIZE)/(KEY_SIZE+DC_SIZE) )
+#define MIN_NR_KEY(bh) (MAX_NR_KEY(bh)/2)
+
+/***************************************************************************/
+/* PATH STRUCTURES AND DEFINES */
+/***************************************************************************/
+
+/* Search_by_key fills up the path from the root to the leaf as it descends the tree looking for the
+ key. It uses reiserfs_bread to try to find buffers in the cache given their block number. If it
+ does not find them in the cache it reads them from disk. For each node search_by_key finds using
+ reiserfs_bread it then uses bin_search to look through that node. bin_search will find the
+ position of the block_number of the next node if it is looking through an internal node. If it
+ is looking through a leaf node bin_search will find the position of the item which has key either
+ equal to given key, or which is the maximal key less than the given key. */
+
+struct path_element {
+ struct buffer_head *pe_buffer; /* Pointer to the buffer at the path in the tree. */
+ int pe_position; /* Position in the tree node which is placed in the */
+ /* buffer above. */
+};
+
+#define MAX_HEIGHT 5 /* maximal height of a tree. don't change this without changing JOURNAL_PER_BALANCE_CNT */
+#define EXTENDED_MAX_HEIGHT 7 /* Must be equals MAX_HEIGHT + FIRST_PATH_ELEMENT_OFFSET */
+#define FIRST_PATH_ELEMENT_OFFSET 2 /* Must be equal to at least 2. */
+
+#define ILLEGAL_PATH_ELEMENT_OFFSET 1 /* Must be equal to FIRST_PATH_ELEMENT_OFFSET - 1 */
+#define MAX_FEB_SIZE 6 /* this MUST be MAX_HEIGHT + 1. See about FEB below */
+
+/* We need to keep track of who the ancestors of nodes are. When we
+ perform a search we record which nodes were visited while
+ descending the tree looking for the node we searched for. This list
+ of nodes is called the path. This information is used while
+ performing balancing. Note that this path information may become
+ invalid, and this means we must check it when using it to see if it
+ is still valid. You'll need to read search_by_key and the comments
+ in it, especially about decrement_counters_in_path(), to understand
+ this structure.
+
+Paths make the code so much harder to work with and debug.... An
+enormous number of bugs are due to them, and trying to write or modify
+code that uses them just makes my head hurt. They are based on an
+excessive effort to avoid disturbing the precious VFS code.:-( The
+gods only know how we are going to SMP the code that uses them.
+znodes are the way! */
+
+#define PATH_READA 0x1 /* do read ahead */
+#define PATH_READA_BACK 0x2 /* read backwards */
+
+struct treepath {
+ int path_length; /* Length of the array above. */
+ int reada;
+ struct path_element path_elements[EXTENDED_MAX_HEIGHT]; /* Array of the path elements. */
+ int pos_in_item;
+};
+
+#define pos_in_item(path) ((path)->pos_in_item)
+
+#define INITIALIZE_PATH(var) \
+struct treepath var = {.path_length = ILLEGAL_PATH_ELEMENT_OFFSET, .reada = 0,}
+
+/* Get path element by path and path position. */
+#define PATH_OFFSET_PELEMENT(p_s_path,n_offset) ((p_s_path)->path_elements +(n_offset))
+
+/* Get buffer header at the path by path and path position. */
+#define PATH_OFFSET_PBUFFER(p_s_path,n_offset) (PATH_OFFSET_PELEMENT(p_s_path,n_offset)->pe_buffer)
+
+/* Get position in the element at the path by path and path position. */
+#define PATH_OFFSET_POSITION(p_s_path,n_offset) (PATH_OFFSET_PELEMENT(p_s_path,n_offset)->pe_position)
+
+#define PATH_PLAST_BUFFER(p_s_path) (PATH_OFFSET_PBUFFER((p_s_path), (p_s_path)->path_length))
+ /* you know, to the person who didn't
+ write this the macro name does not
+ at first suggest what it does.
+ Maybe POSITION_FROM_PATH_END? Or
+ maybe we should just focus on
+ dumping paths... -Hans */
+#define PATH_LAST_POSITION(p_s_path) (PATH_OFFSET_POSITION((p_s_path), (p_s_path)->path_length))
+
+#define PATH_PITEM_HEAD(p_s_path) B_N_PITEM_HEAD(PATH_PLAST_BUFFER(p_s_path),PATH_LAST_POSITION(p_s_path))
+
+/* in do_balance leaf has h == 0 in contrast with path structure,
+ where root has level == 0. That is why we need these defines */
+#define PATH_H_PBUFFER(p_s_path, h) PATH_OFFSET_PBUFFER (p_s_path, p_s_path->path_length - (h)) /* tb->S[h] */
+#define PATH_H_PPARENT(path, h) PATH_H_PBUFFER (path, (h) + 1) /* tb->F[h] or tb->S[0]->b_parent */
+#define PATH_H_POSITION(path, h) PATH_OFFSET_POSITION (path, path->path_length - (h))
+#define PATH_H_B_ITEM_ORDER(path, h) PATH_H_POSITION(path, h + 1) /* tb->S[h]->b_item_order */
+
+#define PATH_H_PATH_OFFSET(p_s_path, n_h) ((p_s_path)->path_length - (n_h))
+
+#define get_last_bh(path) PATH_PLAST_BUFFER(path)
+#define get_ih(path) PATH_PITEM_HEAD(path)
+#define get_item_pos(path) PATH_LAST_POSITION(path)
+#define get_item(path) ((void *)B_N_PITEM(PATH_PLAST_BUFFER(path), PATH_LAST_POSITION (path)))
+#define item_moved(ih,path) comp_items(ih, path)
+#define path_changed(ih,path) comp_items (ih, path)
+
+/***************************************************************************/
+/* MISC */
+/***************************************************************************/
+
+/* Size of pointer to the unformatted node. */
+#define UNFM_P_SIZE (sizeof(unp_t))
+#define UNFM_P_SHIFT 2
+
+// in in-core inode key is stored on le form
+#define INODE_PKEY(inode) ((struct reiserfs_key *)(REISERFS_I(inode)->i_key))
+
+#define MAX_UL_INT 0xffffffff
+#define MAX_INT 0x7ffffff
+#define MAX_US_INT 0xffff
+
+// reiserfs version 2 has max offset 60 bits. Version 1 - 32 bit offset
+#define U32_MAX (~(__u32)0)
+
+static __inline__ loff_t max_reiserfs_offset(struct inode *inode)
+{
+ if (get_inode_item_key_version(inode) == KEY_FORMAT_3_5)
+ return (loff_t) U32_MAX;
+
+ return (loff_t) ((~(__u64) 0) >> 4);
+}
+
+/*#define MAX_KEY_UNIQUENESS MAX_UL_INT*/
+#define MAX_KEY_OBJECTID MAX_UL_INT
+
+#define MAX_B_NUM MAX_UL_INT
+#define MAX_FC_NUM MAX_US_INT
+
+/* the purpose is to detect overflow of an unsigned short */
+#define REISERFS_LINK_MAX (MAX_US_INT - 1000)
+
+/* The following defines are used in reiserfs_insert_item and reiserfs_append_item */
+#define REISERFS_KERNEL_MEM 0 /* reiserfs kernel memory mode */
+#define REISERFS_USER_MEM 1 /* reiserfs user memory mode */
+
+#define fs_generation(s) (REISERFS_SB(s)->s_generation_counter)
+#define get_generation(s) atomic_read (&fs_generation(s))
+#define FILESYSTEM_CHANGED_TB(tb) (get_generation((tb)->tb_sb) != (tb)->fs_gen)
+#define __fs_changed(gen,s) (gen != get_generation (s))
+#define fs_changed(gen,s) ({cond_resched(); __fs_changed(gen, s);})
+
+/***************************************************************************/
+/* FIXATE NODES */
+/***************************************************************************/
+
+#define VI_TYPE_LEFT_MERGEABLE 1
+#define VI_TYPE_RIGHT_MERGEABLE 2
+
+/* To make any changes in the tree we always first find node, that
+ contains item to be changed/deleted or place to insert a new
+ item. We call this node S. To do balancing we need to decide what
+ we will shift to left/right neighbor, or to a new node, where new
+ item will be etc. To make this analysis simpler we build virtual
+ node. Virtual node is an array of items, that will replace items of
+ node S. (For instance if we are going to delete an item, virtual
+ node does not contain it). Virtual node keeps information about
+ item sizes and types, mergeability of first and last items, sizes
+ of all entries in directory item. We use this array of items when
+ calculating what we can shift to neighbors and how many nodes we
+ have to have if we do not any shiftings, if we shift to left/right
+ neighbor or to both. */
+struct virtual_item {
+ int vi_index; // index in the array of item operations
+ unsigned short vi_type; // left/right mergeability
+ unsigned short vi_item_len; /* length of item that it will have after balancing */
+ struct item_head *vi_ih;
+ const char *vi_item; // body of item (old or new)
+ const void *vi_new_data; // 0 always but paste mode
+ void *vi_uarea; // item specific area
+};
+
+struct virtual_node {
+ char *vn_free_ptr; /* this is a pointer to the free space in the buffer */
+ unsigned short vn_nr_item; /* number of items in virtual node */
+ short vn_size; /* size of node , that node would have if it has unlimited size and no balancing is performed */
+ short vn_mode; /* mode of balancing (paste, insert, delete, cut) */
+ short vn_affected_item_num;
+ short vn_pos_in_item;
+ struct item_head *vn_ins_ih; /* item header of inserted item, 0 for other modes */
+ const void *vn_data;
+ struct virtual_item *vn_vi; /* array of items (including a new one, excluding item to be deleted) */
+};
+
+/* used by directory items when creating virtual nodes */
+struct direntry_uarea {
+ int flags;
+ __u16 entry_count;
+ __u16 entry_sizes[1];
+} __attribute__ ((__packed__));
+
+/***************************************************************************/
+/* TREE BALANCE */
+/***************************************************************************/
+
+/* This temporary structure is used in tree balance algorithms, and
+ constructed as we go to the extent that its various parts are
+ needed. It contains arrays of nodes that can potentially be
+ involved in the balancing of node S, and parameters that define how
+ each of the nodes must be balanced. Note that in these algorithms
+ for balancing the worst case is to need to balance the current node
+ S and the left and right neighbors and all of their parents plus
+ create a new node. We implement S1 balancing for the leaf nodes
+ and S0 balancing for the internal nodes (S1 and S0 are defined in
+ our papers.)*/
+
+#define MAX_FREE_BLOCK 7 /* size of the array of buffers to free at end of do_balance */
+
+/* maximum number of FEB blocknrs on a single level */
+#define MAX_AMOUNT_NEEDED 2
+
+/* someday somebody will prefix every field in this struct with tb_ */
+struct tree_balance {
+ int tb_mode;
+ int need_balance_dirty;
+ struct super_block *tb_sb;
+ struct reiserfs_transaction_handle *transaction_handle;
+ struct treepath *tb_path;
+ struct buffer_head *L[MAX_HEIGHT]; /* array of left neighbors of nodes in the path */
+ struct buffer_head *R[MAX_HEIGHT]; /* array of right neighbors of nodes in the path */
+ struct buffer_head *FL[MAX_HEIGHT]; /* array of fathers of the left neighbors */
+ struct buffer_head *FR[MAX_HEIGHT]; /* array of fathers of the right neighbors */
+ struct buffer_head *CFL[MAX_HEIGHT]; /* array of common parents of center node and its left neighbor */
+ struct buffer_head *CFR[MAX_HEIGHT]; /* array of common parents of center node and its right neighbor */
+
+ struct buffer_head *FEB[MAX_FEB_SIZE]; /* array of empty buffers. Number of buffers in array equals
+ cur_blknum. */
+ struct buffer_head *used[MAX_FEB_SIZE];
+ struct buffer_head *thrown[MAX_FEB_SIZE];
+ int lnum[MAX_HEIGHT]; /* array of number of items which must be
+ shifted to the left in order to balance the
+ current node; for leaves includes item that
+ will be partially shifted; for internal
+ nodes, it is the number of child pointers
+ rather than items. It includes the new item
+ being created. The code sometimes subtracts
+ one to get the number of wholly shifted
+ items for other purposes. */
+ int rnum[MAX_HEIGHT]; /* substitute right for left in comment above */
+ int lkey[MAX_HEIGHT]; /* array indexed by height h mapping the key delimiting L[h] and
+ S[h] to its item number within the node CFL[h] */
+ int rkey[MAX_HEIGHT]; /* substitute r for l in comment above */
+ int insert_size[MAX_HEIGHT]; /* the number of bytes by we are trying to add or remove from
+ S[h]. A negative value means removing. */
+ int blknum[MAX_HEIGHT]; /* number of nodes that will replace node S[h] after
+ balancing on the level h of the tree. If 0 then S is
+ being deleted, if 1 then S is remaining and no new nodes
+ are being created, if 2 or 3 then 1 or 2 new nodes is
+ being created */
+
+ /* fields that are used only for balancing leaves of the tree */
+ int cur_blknum; /* number of empty blocks having been already allocated */
+ int s0num; /* number of items that fall into left most node when S[0] splits */
+ int s1num; /* number of items that fall into first new node when S[0] splits */
+ int s2num; /* number of items that fall into second new node when S[0] splits */
+ int lbytes; /* number of bytes which can flow to the left neighbor from the left */
+ /* most liquid item that cannot be shifted from S[0] entirely */
+ /* if -1 then nothing will be partially shifted */
+ int rbytes; /* number of bytes which will flow to the right neighbor from the right */
+ /* most liquid item that cannot be shifted from S[0] entirely */
+ /* if -1 then nothing will be partially shifted */
+ int s1bytes; /* number of bytes which flow to the first new node when S[0] splits */
+ /* note: if S[0] splits into 3 nodes, then items do not need to be cut */
+ int s2bytes;
+ struct buffer_head *buf_to_free[MAX_FREE_BLOCK]; /* buffers which are to be freed after do_balance finishes by unfix_nodes */
+ char *vn_buf; /* kmalloced memory. Used to create
+ virtual node and keep map of
+ dirtied bitmap blocks */
+ int vn_buf_size; /* size of the vn_buf */
+ struct virtual_node *tb_vn; /* VN starts after bitmap of bitmap blocks */
+
+ int fs_gen; /* saved value of `reiserfs_generation' counter
+ see FILESYSTEM_CHANGED() macro in reiserfs_fs.h */
+#ifdef DISPLACE_NEW_PACKING_LOCALITIES
+ struct in_core_key key; /* key pointer, to pass to block allocator or
+ another low-level subsystem */
+#endif
+};
+
+/* These are modes of balancing */
+
+/* When inserting an item. */
+#define M_INSERT 'i'
+/* When inserting into (directories only) or appending onto an already
+ existant item. */
+#define M_PASTE 'p'
+/* When deleting an item. */
+#define M_DELETE 'd'
+/* When truncating an item or removing an entry from a (directory) item. */
+#define M_CUT 'c'
+
+/* used when balancing on leaf level skipped (in reiserfsck) */
+#define M_INTERNAL 'n'
+
+/* When further balancing is not needed, then do_balance does not need
+ to be called. */
+#define M_SKIP_BALANCING 's'
+#define M_CONVERT 'v'
+
+/* modes of leaf_move_items */
+#define LEAF_FROM_S_TO_L 0
+#define LEAF_FROM_S_TO_R 1
+#define LEAF_FROM_R_TO_L 2
+#define LEAF_FROM_L_TO_R 3
+#define LEAF_FROM_S_TO_SNEW 4
+
+#define FIRST_TO_LAST 0
+#define LAST_TO_FIRST 1
+
+/* used in do_balance for passing parent of node information that has
+ been gotten from tb struct */
+struct buffer_info {
+ struct tree_balance *tb;
+ struct buffer_head *bi_bh;
+ struct buffer_head *bi_parent;
+ int bi_position;
+};
+
+/* there are 4 types of items: stat data, directory item, indirect, direct.
++-------------------+------------+--------------+------------+
+| | k_offset | k_uniqueness | mergeable? |
++-------------------+------------+--------------+------------+
+| stat data | 0 | 0 | no |
++-------------------+------------+--------------+------------+
+| 1st directory item| DOT_OFFSET |DIRENTRY_UNIQUENESS| no |
+| non 1st directory | hash value | | yes |
+| item | | | |
++-------------------+------------+--------------+------------+
+| indirect item | offset + 1 |TYPE_INDIRECT | if this is not the first indirect item of the object
++-------------------+------------+--------------+------------+
+| direct item | offset + 1 |TYPE_DIRECT | if not this is not the first direct item of the object
++-------------------+------------+--------------+------------+
+*/
+
+struct item_operations {
+ int (*bytes_number) (struct item_head * ih, int block_size);
+ void (*decrement_key) (struct cpu_key *);
+ int (*is_left_mergeable) (struct reiserfs_key * ih,
+ unsigned long bsize);
+ void (*print_item) (struct item_head *, char *item);
+ void (*check_item) (struct item_head *, char *item);
+
+ int (*create_vi) (struct virtual_node * vn, struct virtual_item * vi,
+ int is_affected, int insert_size);
+ int (*check_left) (struct virtual_item * vi, int free,
+ int start_skip, int end_skip);
+ int (*check_right) (struct virtual_item * vi, int free);
+ int (*part_size) (struct virtual_item * vi, int from, int to);
+ int (*unit_num) (struct virtual_item * vi);
+ void (*print_vi) (struct virtual_item * vi);
+};
+
+extern struct item_operations *item_ops[TYPE_ANY + 1];
+
+#define op_bytes_number(ih,bsize) item_ops[le_ih_k_type (ih)]->bytes_number (ih, bsize)
+#define op_is_left_mergeable(key,bsize) item_ops[le_key_k_type (le_key_version (key), key)]->is_left_mergeable (key, bsize)
+#define op_print_item(ih,item) item_ops[le_ih_k_type (ih)]->print_item (ih, item)
+#define op_check_item(ih,item) item_ops[le_ih_k_type (ih)]->check_item (ih, item)
+#define op_create_vi(vn,vi,is_affected,insert_size) item_ops[le_ih_k_type ((vi)->vi_ih)]->create_vi (vn,vi,is_affected,insert_size)
+#define op_check_left(vi,free,start_skip,end_skip) item_ops[(vi)->vi_index]->check_left (vi, free, start_skip, end_skip)
+#define op_check_right(vi,free) item_ops[(vi)->vi_index]->check_right (vi, free)
+#define op_part_size(vi,from,to) item_ops[(vi)->vi_index]->part_size (vi, from, to)
+#define op_unit_num(vi) item_ops[(vi)->vi_index]->unit_num (vi)
+#define op_print_vi(vi) item_ops[(vi)->vi_index]->print_vi (vi)
+
+#define COMP_SHORT_KEYS comp_short_keys
+
+/* number of blocks pointed to by the indirect item */
+#define I_UNFM_NUM(p_s_ih) ( ih_item_len(p_s_ih) / UNFM_P_SIZE )
+
+/* the used space within the unformatted node corresponding to pos within the item pointed to by ih */
+#define I_POS_UNFM_SIZE(ih,pos,size) (((pos) == I_UNFM_NUM(ih) - 1 ) ? (size) - ih_free_space(ih) : (size))
+
+/* number of bytes contained by the direct item or the unformatted nodes the indirect item points to */
+
+/* get the item header */
+#define B_N_PITEM_HEAD(bh,item_num) ( (struct item_head * )((bh)->b_data + BLKH_SIZE) + (item_num) )
+
+/* get key */
+#define B_N_PDELIM_KEY(bh,item_num) ( (struct reiserfs_key * )((bh)->b_data + BLKH_SIZE) + (item_num) )
+
+/* get the key */
+#define B_N_PKEY(bh,item_num) ( &(B_N_PITEM_HEAD(bh,item_num)->ih_key) )
+
+/* get item body */
+#define B_N_PITEM(bh,item_num) ( (bh)->b_data + ih_location(B_N_PITEM_HEAD((bh),(item_num))))
+
+/* get the stat data by the buffer header and the item order */
+#define B_N_STAT_DATA(bh,nr) \
+( (struct stat_data *)((bh)->b_data + ih_location(B_N_PITEM_HEAD((bh),(nr))) ) )
+
+ /* following defines use reiserfs buffer header and item header */
+
+/* get stat-data */
+#define B_I_STAT_DATA(bh, ih) ( (struct stat_data * )((bh)->b_data + ih_location(ih)) )
+
+// this is 3976 for size==4096
+#define MAX_DIRECT_ITEM_LEN(size) ((size) - BLKH_SIZE - 2*IH_SIZE - SD_SIZE - UNFM_P_SIZE)
+
+/* indirect items consist of entries which contain blocknrs, pos
+ indicates which entry, and B_I_POS_UNFM_POINTER resolves to the
+ blocknr contained by the entry pos points to */
+#define B_I_POS_UNFM_POINTER(bh,ih,pos) le32_to_cpu(*(((unp_t *)B_I_PITEM(bh,ih)) + (pos)))
+#define PUT_B_I_POS_UNFM_POINTER(bh,ih,pos, val) do {*(((unp_t *)B_I_PITEM(bh,ih)) + (pos)) = cpu_to_le32(val); } while (0)
+
+struct reiserfs_iget_args {
+ __u32 objectid;
+ __u32 dirid;
+};
+
+/***************************************************************************/
+/* FUNCTION DECLARATIONS */
+/***************************************************************************/
+
+/*#ifdef __KERNEL__*/
+#define get_journal_desc_magic(bh) (bh->b_data + bh->b_size - 12)
+
+#define journal_trans_half(blocksize) \
+ ((blocksize - sizeof (struct reiserfs_journal_desc) + sizeof (__u32) - 12) / sizeof (__u32))
+
+/* journal.c see journal.c for all the comments here */
+
+/* first block written in a commit. */
+struct reiserfs_journal_desc {
+ __le32 j_trans_id; /* id of commit */
+ __le32 j_len; /* length of commit. len +1 is the commit block */
+ __le32 j_mount_id; /* mount id of this trans */
+ __le32 j_realblock[1]; /* real locations for each block */
+};
+
+#define get_desc_trans_id(d) le32_to_cpu((d)->j_trans_id)
+#define get_desc_trans_len(d) le32_to_cpu((d)->j_len)
+#define get_desc_mount_id(d) le32_to_cpu((d)->j_mount_id)
+
+#define set_desc_trans_id(d,val) do { (d)->j_trans_id = cpu_to_le32 (val); } while (0)
+#define set_desc_trans_len(d,val) do { (d)->j_len = cpu_to_le32 (val); } while (0)
+#define set_desc_mount_id(d,val) do { (d)->j_mount_id = cpu_to_le32 (val); } while (0)
+
+/* last block written in a commit */
+struct reiserfs_journal_commit {
+ __le32 j_trans_id; /* must match j_trans_id from the desc block */
+ __le32 j_len; /* ditto */
+ __le32 j_realblock[1]; /* real locations for each block */
+};
+
+#define get_commit_trans_id(c) le32_to_cpu((c)->j_trans_id)
+#define get_commit_trans_len(c) le32_to_cpu((c)->j_len)
+#define get_commit_mount_id(c) le32_to_cpu((c)->j_mount_id)
+
+#define set_commit_trans_id(c,val) do { (c)->j_trans_id = cpu_to_le32 (val); } while (0)
+#define set_commit_trans_len(c,val) do { (c)->j_len = cpu_to_le32 (val); } while (0)
+
+/* this header block gets written whenever a transaction is considered fully flushed, and is more recent than the
+** last fully flushed transaction. fully flushed means all the log blocks and all the real blocks are on disk,
+** and this transaction does not need to be replayed.
+*/
+struct reiserfs_journal_header {
+ __le32 j_last_flush_trans_id; /* id of last fully flushed transaction */
+ __le32 j_first_unflushed_offset; /* offset in the log of where to start replay after a crash */
+ __le32 j_mount_id;
+ /* 12 */ struct journal_params jh_journal;
+};
+
+/* biggest tunable defines are right here */
+#define JOURNAL_BLOCK_COUNT 8192 /* number of blocks in the journal */
+#define JOURNAL_TRANS_MAX_DEFAULT 1024 /* biggest possible single transaction, don't change for now (8/3/99) */
+#define JOURNAL_TRANS_MIN_DEFAULT 256
+#define JOURNAL_MAX_BATCH_DEFAULT 900 /* max blocks to batch into one transaction, don't make this any bigger than 900 */
+#define JOURNAL_MIN_RATIO 2
+#define JOURNAL_MAX_COMMIT_AGE 30
+#define JOURNAL_MAX_TRANS_AGE 30
+#define JOURNAL_PER_BALANCE_CNT (3 * (MAX_HEIGHT-2) + 9)
+#ifdef CONFIG_QUOTA
+/* We need to update data and inode (atime) */
+#define REISERFS_QUOTA_TRANS_BLOCKS(s) (REISERFS_SB(s)->s_mount_opt & (1<<REISERFS_QUOTA) ? 2 : 0)
+/* 1 balancing, 1 bitmap, 1 data per write + stat data update */
+#define REISERFS_QUOTA_INIT_BLOCKS(s) (REISERFS_SB(s)->s_mount_opt & (1<<REISERFS_QUOTA) ? \
+(DQUOT_INIT_ALLOC*(JOURNAL_PER_BALANCE_CNT+2)+DQUOT_INIT_REWRITE+1) : 0)
+/* same as with INIT */
+#define REISERFS_QUOTA_DEL_BLOCKS(s) (REISERFS_SB(s)->s_mount_opt & (1<<REISERFS_QUOTA) ? \
+(DQUOT_DEL_ALLOC*(JOURNAL_PER_BALANCE_CNT+2)+DQUOT_DEL_REWRITE+1) : 0)
+#else
+#define REISERFS_QUOTA_TRANS_BLOCKS(s) 0
+#define REISERFS_QUOTA_INIT_BLOCKS(s) 0
+#define REISERFS_QUOTA_DEL_BLOCKS(s) 0
+#endif
+
+/* both of these can be as low as 1, or as high as you want. The min is the
+** number of 4k bitmap nodes preallocated on mount. New nodes are allocated
+** as needed, and released when transactions are committed. On release, if
+** the current number of nodes is > max, the node is freed, otherwise,
+** it is put on a free list for faster use later.
+*/
+#define REISERFS_MIN_BITMAP_NODES 10
+#define REISERFS_MAX_BITMAP_NODES 100
+
+#define JBH_HASH_SHIFT 13 /* these are based on journal hash size of 8192 */
+#define JBH_HASH_MASK 8191
+
+#define _jhashfn(sb,block) \
+ (((unsigned long)sb>>L1_CACHE_SHIFT) ^ \
+ (((block)<<(JBH_HASH_SHIFT - 6)) ^ ((block) >> 13) ^ ((block) << (JBH_HASH_SHIFT - 12))))
+#define journal_hash(t,sb,block) ((t)[_jhashfn((sb),(block)) & JBH_HASH_MASK])
+
+// We need these to make journal.c code more readable
+#define journal_find_get_block(s, block) __find_get_block(SB_JOURNAL(s)->j_dev_bd, block, s->s_blocksize)
+#define journal_getblk(s, block) __getblk(SB_JOURNAL(s)->j_dev_bd, block, s->s_blocksize)
+#define journal_bread(s, block) __bread(SB_JOURNAL(s)->j_dev_bd, block, s->s_blocksize)
+
+enum reiserfs_bh_state_bits {
+ BH_JDirty = BH_PrivateStart, /* buffer is in current transaction */
+ BH_JDirty_wait,
+ BH_JNew, /* disk block was taken off free list before
+ * being in a finished transaction, or
+ * written to disk. Can be reused immed. */
+ BH_JPrepared,
+ BH_JRestore_dirty,
+ BH_JTest, // debugging only will go away
+};
+
+BUFFER_FNS(JDirty, journaled);
+TAS_BUFFER_FNS(JDirty, journaled);
+BUFFER_FNS(JDirty_wait, journal_dirty);
+TAS_BUFFER_FNS(JDirty_wait, journal_dirty);
+BUFFER_FNS(JNew, journal_new);
+TAS_BUFFER_FNS(JNew, journal_new);
+BUFFER_FNS(JPrepared, journal_prepared);
+TAS_BUFFER_FNS(JPrepared, journal_prepared);
+BUFFER_FNS(JRestore_dirty, journal_restore_dirty);
+TAS_BUFFER_FNS(JRestore_dirty, journal_restore_dirty);
+BUFFER_FNS(JTest, journal_test);
+TAS_BUFFER_FNS(JTest, journal_test);
+
+/*
+** transaction handle which is passed around for all journal calls
+*/
+struct reiserfs_transaction_handle {
+ struct super_block *t_super; /* super for this FS when journal_begin was
+ called. saves calls to reiserfs_get_super
+ also used by nested transactions to make
+ sure they are nesting on the right FS
+ _must_ be first in the handle
+ */
+ int t_refcount;
+ int t_blocks_logged; /* number of blocks this writer has logged */
+ int t_blocks_allocated; /* number of blocks this writer allocated */
+ unsigned long t_trans_id; /* sanity check, equals the current trans id */
+ void *t_handle_save; /* save existing current->journal_info */
+ unsigned displace_new_blocks:1; /* if new block allocation occurres, that block
+ should be displaced from others */
+ struct list_head t_list;
+};
+
+/* used to keep track of ordered and tail writes, attached to the buffer
+ * head through b_journal_head.
+ */
+struct reiserfs_jh {
+ struct reiserfs_journal_list *jl;
+ struct buffer_head *bh;
+ struct list_head list;
+};
+
+void reiserfs_free_jh(struct buffer_head *bh);
+int reiserfs_add_tail_list(struct inode *inode, struct buffer_head *bh);
+int reiserfs_add_ordered_list(struct inode *inode, struct buffer_head *bh);
+int journal_mark_dirty(struct reiserfs_transaction_handle *,
+ struct super_block *, struct buffer_head *bh);
+
+static __inline__ int reiserfs_file_data_log(struct inode *inode)
+{
+ if (reiserfs_data_log(inode->i_sb) ||
+ (REISERFS_I(inode)->i_flags & i_data_log))
+ return 1;
+ return 0;
+}
+
+static __inline__ int reiserfs_transaction_running(struct super_block *s)
+{
+ struct reiserfs_transaction_handle *th = current->journal_info;
+ if (th && th->t_super == s)
+ return 1;
+ if (th && th->t_super == NULL)
+ BUG();
+ return 0;
+}
+
+static __inline__ int reiserfs_transaction_free_space(struct reiserfs_transaction_handle *th)
+{
+ return th->t_blocks_allocated - th->t_blocks_logged;
+}
+
+struct reiserfs_transaction_handle *reiserfs_persistent_transaction(struct
+ super_block
+ *,
+ int count);
+int reiserfs_end_persistent_transaction(struct reiserfs_transaction_handle *);
+int reiserfs_commit_page(struct inode *inode, struct page *page,
+ unsigned from, unsigned to);
+int reiserfs_flush_old_commits(struct super_block *);
+int reiserfs_commit_for_inode(struct inode *);
+int reiserfs_inode_needs_commit(struct inode *);
+void reiserfs_update_inode_transaction(struct inode *);
+void reiserfs_wait_on_write_block(struct super_block *s);
+void reiserfs_block_writes(struct reiserfs_transaction_handle *th);
+void reiserfs_allow_writes(struct super_block *s);
+void reiserfs_check_lock_depth(struct super_block *s, char *caller);
+int reiserfs_prepare_for_journal(struct super_block *, struct buffer_head *bh,
+ int wait);
+void reiserfs_restore_prepared_buffer(struct super_block *,
+ struct buffer_head *bh);
+int journal_init(struct super_block *, const char *j_dev_name, int old_format,
+ unsigned int);
+int journal_release(struct reiserfs_transaction_handle *, struct super_block *);
+int journal_release_error(struct reiserfs_transaction_handle *,
+ struct super_block *);
+int journal_end(struct reiserfs_transaction_handle *, struct super_block *,
+ unsigned long);
+int journal_end_sync(struct reiserfs_transaction_handle *, struct super_block *,
+ unsigned long);
+int journal_mark_freed(struct reiserfs_transaction_handle *,
+ struct super_block *, b_blocknr_t blocknr);
+int journal_transaction_should_end(struct reiserfs_transaction_handle *, int);
+int reiserfs_in_journal(struct super_block *p_s_sb, unsigned int bmap_nr,
+ int bit_nr, int searchall, b_blocknr_t *next);
+int journal_begin(struct reiserfs_transaction_handle *,
+ struct super_block *p_s_sb, unsigned long);
+int journal_join_abort(struct reiserfs_transaction_handle *,
+ struct super_block *p_s_sb, unsigned long);
+void reiserfs_journal_abort(struct super_block *sb, int errno);
+void reiserfs_abort(struct super_block *sb, int errno, const char *fmt, ...);
+int reiserfs_allocate_list_bitmaps(struct super_block *s,
+ struct reiserfs_list_bitmap *, unsigned int);
+
+void add_save_link(struct reiserfs_transaction_handle *th,
+ struct inode *inode, int truncate);
+int remove_save_link(struct inode *inode, int truncate);
+
+/* objectid.c */
+__u32 reiserfs_get_unused_objectid(struct reiserfs_transaction_handle *th);
+void reiserfs_release_objectid(struct reiserfs_transaction_handle *th,
+ __u32 objectid_to_release);
+int reiserfs_convert_objectid_map_v1(struct super_block *);
+
+/* stree.c */
+int B_IS_IN_TREE(const struct buffer_head *);
+extern void copy_item_head(struct item_head *p_v_to,
+ const struct item_head *p_v_from);
+
+// first key is in cpu form, second - le
+extern int comp_short_keys(const struct reiserfs_key *le_key,
+ const struct cpu_key *cpu_key);
+extern void le_key2cpu_key(struct cpu_key *to, const struct reiserfs_key *from);
+
+// both are in le form
+extern int comp_le_keys(const struct reiserfs_key *,
+ const struct reiserfs_key *);
+extern int comp_short_le_keys(const struct reiserfs_key *,
+ const struct reiserfs_key *);
+
+//
+// get key version from on disk key - kludge
+//
+static __inline__ int le_key_version(const struct reiserfs_key *key)
+{
+ int type;
+
+ type = offset_v2_k_type(&(key->u.k_offset_v2));
+ if (type != TYPE_DIRECT && type != TYPE_INDIRECT
+ && type != TYPE_DIRENTRY)
+ return KEY_FORMAT_3_5;
+
+ return KEY_FORMAT_3_6;
+
+}
+
+static __inline__ void copy_key(struct reiserfs_key *to,
+ const struct reiserfs_key *from)
+{
+ memcpy(to, from, KEY_SIZE);
+}
+
+int comp_items(const struct item_head *stored_ih, const struct treepath *p_s_path);
+const struct reiserfs_key *get_rkey(const struct treepath *p_s_chk_path,
+ const struct super_block *p_s_sb);
+int search_by_key(struct super_block *, const struct cpu_key *,
+ struct treepath *, int);
+#define search_item(s,key,path) search_by_key (s, key, path, DISK_LEAF_NODE_LEVEL)
+int search_for_position_by_key(struct super_block *p_s_sb,
+ const struct cpu_key *p_s_cpu_key,
+ struct treepath *p_s_search_path);
+extern void decrement_bcount(struct buffer_head *p_s_bh);
+void decrement_counters_in_path(struct treepath *p_s_search_path);
+void pathrelse(struct treepath *p_s_search_path);
+int reiserfs_check_path(struct treepath *p);
+void pathrelse_and_restore(struct super_block *s, struct treepath *p_s_search_path);
+
+int reiserfs_insert_item(struct reiserfs_transaction_handle *th,
+ struct treepath *path,
+ const struct cpu_key *key,
+ struct item_head *ih,
+ struct inode *inode, const char *body);
+
+int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th,
+ struct treepath *path,
+ const struct cpu_key *key,
+ struct inode *inode,
+ const char *body, int paste_size);
+
+int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th,
+ struct treepath *path,
+ struct cpu_key *key,
+ struct inode *inode,
+ struct page *page, loff_t new_file_size);
+
+int reiserfs_delete_item(struct reiserfs_transaction_handle *th,
+ struct treepath *path,
+ const struct cpu_key *key,
+ struct inode *inode, struct buffer_head *p_s_un_bh);
+
+void reiserfs_delete_solid_item(struct reiserfs_transaction_handle *th,
+ struct inode *inode, struct reiserfs_key *key);
+int reiserfs_delete_object(struct reiserfs_transaction_handle *th,
+ struct inode *p_s_inode);
+int reiserfs_do_truncate(struct reiserfs_transaction_handle *th,
+ struct inode *p_s_inode, struct page *,
+ int update_timestamps);
+
+#define i_block_size(inode) ((inode)->i_sb->s_blocksize)
+#define file_size(inode) ((inode)->i_size)
+#define tail_size(inode) (file_size (inode) & (i_block_size (inode) - 1))
+
+#define tail_has_to_be_packed(inode) (have_large_tails ((inode)->i_sb)?\
+!STORE_TAIL_IN_UNFM_S1(file_size (inode), tail_size(inode), inode->i_sb->s_blocksize):have_small_tails ((inode)->i_sb)?!STORE_TAIL_IN_UNFM_S2(file_size (inode), tail_size(inode), inode->i_sb->s_blocksize):0 )
+
+void padd_item(char *item, int total_length, int length);
+
+/* inode.c */
+/* args for the create parameter of reiserfs_get_block */
+#define GET_BLOCK_NO_CREATE 0 /* don't create new blocks or convert tails */
+#define GET_BLOCK_CREATE 1 /* add anything you need to find block */
+#define GET_BLOCK_NO_HOLE 2 /* return -ENOENT for file holes */
+#define GET_BLOCK_READ_DIRECT 4 /* read the tail if indirect item not found */
+#define GET_BLOCK_NO_IMUX 8 /* i_mutex is not held, don't preallocate */
+#define GET_BLOCK_NO_DANGLE 16 /* don't leave any transactions running */
+
+void reiserfs_read_locked_inode(struct inode *inode,
+ struct reiserfs_iget_args *args);
+int reiserfs_find_actor(struct inode *inode, void *p);
+int reiserfs_init_locked_inode(struct inode *inode, void *p);
+void reiserfs_delete_inode(struct inode *inode);
+int reiserfs_write_inode(struct inode *inode, int);
+int reiserfs_get_block(struct inode *inode, sector_t block,
+ struct buffer_head *bh_result, int create);
+struct dentry *reiserfs_fh_to_dentry(struct super_block *sb, struct fid *fid,
+ int fh_len, int fh_type);
+struct dentry *reiserfs_fh_to_parent(struct super_block *sb, struct fid *fid,
+ int fh_len, int fh_type);
+int reiserfs_encode_fh(struct dentry *dentry, __u32 * data, int *lenp,
+ int connectable);
+
+int reiserfs_truncate_file(struct inode *, int update_timestamps);
+void make_cpu_key(struct cpu_key *cpu_key, struct inode *inode, loff_t offset,
+ int type, int key_length);
+void make_le_item_head(struct item_head *ih, const struct cpu_key *key,
+ int version,
+ loff_t offset, int type, int length, int entry_count);
+struct inode *reiserfs_iget(struct super_block *s, const struct cpu_key *key);
+
+int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
+ struct inode *dir, int mode,
+ const char *symname, loff_t i_size,
+ struct dentry *dentry, struct inode *inode);
+
+void reiserfs_update_sd_size(struct reiserfs_transaction_handle *th,
+ struct inode *inode, loff_t size);
+
+static __inline__ void reiserfs_update_sd(struct reiserfs_transaction_handle *th,
+ struct inode *inode)
+{
+ reiserfs_update_sd_size(th, inode, inode->i_size);
+}
+
+void sd_attrs_to_i_attrs(__u16 sd_attrs, struct inode *inode);
+void i_attrs_to_sd_attrs(struct inode *inode, __u16 * sd_attrs);
+int reiserfs_setattr(struct dentry *dentry, struct iattr *attr);
+
+/* namei.c */
+void set_de_name_and_namelen(struct reiserfs_dir_entry *de);
+int search_by_entry_key(struct super_block *sb, const struct cpu_key *key,
+ struct treepath *path, struct reiserfs_dir_entry *de);
+struct dentry *reiserfs_get_parent(struct dentry *);
+/* procfs.c */
+
+#if defined( CONFIG_PROC_FS ) && defined( CONFIG_REISERFS_PROC_INFO )
+#define REISERFS_PROC_INFO
+#else
+#undef REISERFS_PROC_INFO
+#endif
+
+int reiserfs_proc_info_init(struct super_block *sb);
+int reiserfs_proc_info_done(struct super_block *sb);
+struct proc_dir_entry *reiserfs_proc_register_global(char *name,
+ read_proc_t * func);
+void reiserfs_proc_unregister_global(const char *name);
+int reiserfs_proc_info_global_init(void);
+int reiserfs_proc_info_global_done(void);
+int reiserfs_global_version_in_proc(char *buffer, char **start, off_t offset,
+ int count, int *eof, void *data);
+
+#if defined( REISERFS_PROC_INFO )
+
+#define PROC_EXP( e ) e
+
+#define __PINFO( sb ) REISERFS_SB(sb) -> s_proc_info_data
+#define PROC_INFO_MAX( sb, field, value ) \
+ __PINFO( sb ).field = \
+ max( REISERFS_SB( sb ) -> s_proc_info_data.field, value )
+#define PROC_INFO_INC( sb, field ) ( ++ ( __PINFO( sb ).field ) )
+#define PROC_INFO_ADD( sb, field, val ) ( __PINFO( sb ).field += ( val ) )
+#define PROC_INFO_BH_STAT( sb, bh, level ) \
+ PROC_INFO_INC( sb, sbk_read_at[ ( level ) ] ); \
+ PROC_INFO_ADD( sb, free_at[ ( level ) ], B_FREE_SPACE( bh ) ); \
+ PROC_INFO_ADD( sb, items_at[ ( level ) ], B_NR_ITEMS( bh ) )
+#else
+#define PROC_EXP( e )
+#define VOID_V ( ( void ) 0 )
+#define PROC_INFO_MAX( sb, field, value ) VOID_V
+#define PROC_INFO_INC( sb, field ) VOID_V
+#define PROC_INFO_ADD( sb, field, val ) VOID_V
+#define PROC_INFO_BH_STAT( p_s_sb, p_s_bh, n_node_level ) VOID_V
+#endif
+
+/* dir.c */
+extern const struct inode_operations reiserfs_dir_inode_operations;
+extern const struct inode_operations reiserfs_symlink_inode_operations;
+extern const struct inode_operations reiserfs_special_inode_operations;
+extern const struct file_operations reiserfs_dir_operations;
+
+/* tail_conversion.c */
+int direct2indirect(struct reiserfs_transaction_handle *, struct inode *,
+ struct treepath *, struct buffer_head *, loff_t);
+int indirect2direct(struct reiserfs_transaction_handle *, struct inode *,
+ struct page *, struct treepath *, const struct cpu_key *,
+ loff_t, char *);
+void reiserfs_unmap_buffer(struct buffer_head *);
+
+/* file.c */
+extern const struct inode_operations reiserfs_file_inode_operations;
+extern const struct file_operations reiserfs_file_operations;
+extern const struct address_space_operations reiserfs_address_space_operations;
+
+/* fix_nodes.c */
+
+int fix_nodes(int n_op_mode, struct tree_balance *p_s_tb,
+ struct item_head *p_s_ins_ih, const void *);
+void unfix_nodes(struct tree_balance *);
+
+/* prints.c */
+void reiserfs_panic(struct super_block *s, const char *fmt, ...)
+ __attribute__ ((noreturn));
+void reiserfs_info(struct super_block *s, const char *fmt, ...);
+void reiserfs_debug(struct super_block *s, int level, const char *fmt, ...);
+void print_indirect_item(struct buffer_head *bh, int item_num);
+void store_print_tb(struct tree_balance *tb);
+void print_cur_tb(char *mes);
+void print_de(struct reiserfs_dir_entry *de);
+void print_bi(struct buffer_info *bi, char *mes);
+#define PRINT_LEAF_ITEMS 1 /* print all items */
+#define PRINT_DIRECTORY_ITEMS 2 /* print directory items */
+#define PRINT_DIRECT_ITEMS 4 /* print contents of direct items */
+void print_block(struct buffer_head *bh, ...);
+void print_bmap(struct super_block *s, int silent);
+void print_bmap_block(int i, char *data, int size, int silent);
+/*void print_super_block (struct super_block * s, char * mes);*/
+void print_objectid_map(struct super_block *s);
+void print_block_head(struct buffer_head *bh, char *mes);
+void check_leaf(struct buffer_head *bh);
+void check_internal(struct buffer_head *bh);
+void print_statistics(struct super_block *s);
+char *reiserfs_hashname(int code);
+
+/* lbalance.c */
+int leaf_move_items(int shift_mode, struct tree_balance *tb, int mov_num,
+ int mov_bytes, struct buffer_head *Snew);
+int leaf_shift_left(struct tree_balance *tb, int shift_num, int shift_bytes);
+int leaf_shift_right(struct tree_balance *tb, int shift_num, int shift_bytes);
+void leaf_delete_items(struct buffer_info *cur_bi, int last_first, int first,
+ int del_num, int del_bytes);
+void leaf_insert_into_buf(struct buffer_info *bi, int before,
+ struct item_head *inserted_item_ih,
+ const char *inserted_item_body, int zeros_number);
+void leaf_paste_in_buffer(struct buffer_info *bi, int pasted_item_num,
+ int pos_in_item, int paste_size, const char *body,
+ int zeros_number);
+void leaf_cut_from_buffer(struct buffer_info *bi, int cut_item_num,
+ int pos_in_item, int cut_size);
+void leaf_paste_entries(struct buffer_head *bh, int item_num, int before,
+ int new_entry_count, struct reiserfs_de_head *new_dehs,
+ const char *records, int paste_size);
+/* ibalance.c */
+int balance_internal(struct tree_balance *, int, int, struct item_head *,
+ struct buffer_head **);
+
+/* do_balance.c */
+void do_balance_mark_leaf_dirty(struct tree_balance *tb,
+ struct buffer_head *bh, int flag);
+#define do_balance_mark_internal_dirty do_balance_mark_leaf_dirty
+#define do_balance_mark_sb_dirty do_balance_mark_leaf_dirty
+
+void do_balance(struct tree_balance *tb, struct item_head *ih,
+ const char *body, int flag);
+void reiserfs_invalidate_buffer(struct tree_balance *tb,
+ struct buffer_head *bh);
+
+int get_left_neighbor_position(struct tree_balance *tb, int h);
+int get_right_neighbor_position(struct tree_balance *tb, int h);
+void replace_key(struct tree_balance *tb, struct buffer_head *, int,
+ struct buffer_head *, int);
+void make_empty_node(struct buffer_info *);
+struct buffer_head *get_FEB(struct tree_balance *);
+
+/* bitmap.c */
+
+/* structure contains hints for block allocator, and it is a container for
+ * arguments, such as node, search path, transaction_handle, etc. */
+struct __reiserfs_blocknr_hint {
+ struct inode *inode; /* inode passed to allocator, if we allocate unf. nodes */
+ sector_t block; /* file offset, in blocks */
+ struct in_core_key key;
+ struct treepath *path; /* search path, used by allocator to deternine search_start by
+ * various ways */
+ struct reiserfs_transaction_handle *th; /* transaction handle is needed to log super blocks and
+ * bitmap blocks changes */
+ b_blocknr_t beg, end;
+ b_blocknr_t search_start; /* a field used to transfer search start value (block number)
+ * between different block allocator procedures
+ * (determine_search_start() and others) */
+ int prealloc_size; /* is set in determine_prealloc_size() function, used by underlayed
+ * function that do actual allocation */
+
+ unsigned formatted_node:1; /* the allocator uses different polices for getting disk space for
+ * formatted/unformatted blocks with/without preallocation */
+ unsigned preallocate:1;
+};
+
+typedef struct __reiserfs_blocknr_hint reiserfs_blocknr_hint_t;
+
+int reiserfs_parse_alloc_options(struct super_block *, char *);
+void reiserfs_init_alloc_options(struct super_block *s);
+
+/*
+ * given a directory, this will tell you what packing locality
+ * to use for a new object underneat it. The locality is returned
+ * in disk byte order (le).
+ */
+__le32 reiserfs_choose_packing(struct inode *dir);
+
+int reiserfs_init_bitmap_cache(struct super_block *sb);
+void reiserfs_free_bitmap_cache(struct super_block *sb);
+void reiserfs_cache_bitmap_metadata(struct super_block *sb, struct buffer_head *bh, struct reiserfs_bitmap_info *info);
+struct buffer_head *reiserfs_read_bitmap_block(struct super_block *sb, unsigned int bitmap);
+int is_reusable(struct super_block *s, b_blocknr_t block, int bit_value);
+void reiserfs_free_block(struct reiserfs_transaction_handle *th, struct inode *,
+ b_blocknr_t, int for_unformatted);
+int reiserfs_allocate_blocknrs(reiserfs_blocknr_hint_t *, b_blocknr_t *, int,
+ int);
+static __inline__ int reiserfs_new_form_blocknrs(struct tree_balance *tb,
+ b_blocknr_t * new_blocknrs,
+ int amount_needed)
+{
+ reiserfs_blocknr_hint_t hint = {
+ .th = tb->transaction_handle,
+ .path = tb->tb_path,
+ .inode = NULL,
+ .key = tb->key,
+ .block = 0,
+ .formatted_node = 1
+ };
+ return reiserfs_allocate_blocknrs(&hint, new_blocknrs, amount_needed,
+ 0);
+}
+
+static __inline__ int reiserfs_new_unf_blocknrs(struct reiserfs_transaction_handle
+ *th, struct inode *inode,
+ b_blocknr_t * new_blocknrs,
+ struct treepath *path,
+ sector_t block)
+{
+ reiserfs_blocknr_hint_t hint = {
+ .th = th,
+ .path = path,
+ .inode = inode,
+ .block = block,
+ .formatted_node = 0,
+ .preallocate = 0
+ };
+ return reiserfs_allocate_blocknrs(&hint, new_blocknrs, 1, 0);
+}
+
+#ifdef REISERFS_PREALLOCATE
+static __inline__ int reiserfs_new_unf_blocknrs2(struct reiserfs_transaction_handle
+ *th, struct inode *inode,
+ b_blocknr_t * new_blocknrs,
+ struct treepath *path,
+ sector_t block)
+{
+ reiserfs_blocknr_hint_t hint = {
+ .th = th,
+ .path = path,
+ .inode = inode,
+ .block = block,
+ .formatted_node = 0,
+ .preallocate = 1
+ };
+ return reiserfs_allocate_blocknrs(&hint, new_blocknrs, 1, 0);
+}
+
+void reiserfs_discard_prealloc(struct reiserfs_transaction_handle *th,
+ struct inode *inode);
+void reiserfs_discard_all_prealloc(struct reiserfs_transaction_handle *th);
+#endif
+
+/* hashes.c */
+__u32 keyed_hash(const signed char *msg, int len);
+__u32 yura_hash(const signed char *msg, int len);
+__u32 r5_hash(const signed char *msg, int len);
+
+/* the ext2 bit routines adjust for big or little endian as
+** appropriate for the arch, so in our laziness we use them rather
+** than using the bit routines they call more directly. These
+** routines must be used when changing on disk bitmaps. */
+#define reiserfs_test_and_set_le_bit ext2_set_bit
+#define reiserfs_test_and_clear_le_bit ext2_clear_bit
+#define reiserfs_test_le_bit ext2_test_bit
+#define reiserfs_find_next_zero_le_bit ext2_find_next_zero_bit
+
+/* sometimes reiserfs_truncate may require to allocate few new blocks
+ to perform indirect2direct conversion. People probably used to
+ think, that truncate should work without problems on a filesystem
+ without free disk space. They may complain that they can not
+ truncate due to lack of free disk space. This spare space allows us
+ to not worry about it. 500 is probably too much, but it should be
+ absolutely safe */
+#define SPARE_SPACE 500
+
+/* prototypes from ioctl.c */
+int reiserfs_ioctl(struct inode *inode, struct file *filp,
+ unsigned int cmd, unsigned long arg);
+long reiserfs_compat_ioctl(struct file *filp,
+ unsigned int cmd, unsigned long arg);
+
+/* ioctl's command */
+#define REISERFS_IOC_UNPACK _IOW(0xCD,1,long)
+/* define following flags to be the same as in ext2, so that chattr(1),
+ lsattr(1) will work with us. */
+#define REISERFS_IOC_GETFLAGS FS_IOC_GETFLAGS
+#define REISERFS_IOC_SETFLAGS FS_IOC_SETFLAGS
+#define REISERFS_IOC_GETVERSION FS_IOC_GETVERSION
+#define REISERFS_IOC_SETVERSION FS_IOC_SETVERSION
+
+/* the 32 bit compat definitions with int argument */
+#define REISERFS_IOC32_UNPACK _IOW(0xCD, 1, int)
+#define REISERFS_IOC32_GETFLAGS FS_IOC32_GETFLAGS
+#define REISERFS_IOC32_SETFLAGS FS_IOC32_SETFLAGS
+#define REISERFS_IOC32_GETVERSION FS_IOC32_GETVERSION
+#define REISERFS_IOC32_SETVERSION FS_IOC32_SETVERSION
+
+/* Locking primitives */
+/* Right now we are still falling back to (un)lock_kernel, but eventually that
+ would evolve into real per-fs locks */
+#define reiserfs_write_lock( sb ) lock_kernel()
+#define reiserfs_write_unlock( sb ) unlock_kernel()
+
+/* xattr stuff */
+#define REISERFS_XATTR_DIR_SEM(s) (REISERFS_SB(s)->xattr_dir_sem)
+
+#endif /* _LINUX_REISER_FS_H */
diff --git a/sysroot/usr/include/linux/reiserfs_xattr.h b/sysroot/usr/include/linux/reiserfs_xattr.h
new file mode 100644
index 0000000..7ca4b73
--- /dev/null
+++ b/sysroot/usr/include/linux/reiserfs_xattr.h
@@ -0,0 +1,19 @@
+/*
+ File: linux/reiserfs_xattr.h
+*/
+
+#ifndef _LINUX_REISERFS_XATTR_H
+#define _LINUX_REISERFS_XATTR_H
+
+#include <linux/types.h>
+
+/* Magic value in header */
+#define REISERFS_XATTR_MAGIC 0x52465841 /* "RFXA" */
+
+struct reiserfs_xattr_header {
+ __le32 h_magic; /* magic number for identification */
+ __le32 h_hash; /* hash of the value */
+};
+
+
+#endif /* _LINUX_REISERFS_XATTR_H */
diff --git a/sysroot/usr/include/linux/resource.h b/sysroot/usr/include/linux/resource.h
new file mode 100644
index 0000000..5dea4b7
--- /dev/null
+++ b/sysroot/usr/include/linux/resource.h
@@ -0,0 +1,74 @@
+#ifndef _LINUX_RESOURCE_H
+#define _LINUX_RESOURCE_H
+
+#include <linux/time.h>
+
+struct task_struct;
+
+/*
+ * Resource control/accounting header file for linux
+ */
+
+/*
+ * Definition of struct rusage taken from BSD 4.3 Reno
+ *
+ * We don't support all of these yet, but we might as well have them....
+ * Otherwise, each time we add new items, programs which depend on this
+ * structure will lose. This reduces the chances of that happening.
+ */
+#define RUSAGE_SELF 0
+#define RUSAGE_CHILDREN (-1)
+#define RUSAGE_BOTH (-2) /* sys_wait4() uses this */
+
+struct rusage {
+ struct timeval ru_utime; /* user time used */
+ struct timeval ru_stime; /* system time used */
+ long ru_maxrss; /* maximum resident set size */
+ long ru_ixrss; /* integral shared memory size */
+ long ru_idrss; /* integral unshared data size */
+ long ru_isrss; /* integral unshared stack size */
+ long ru_minflt; /* page reclaims */
+ long ru_majflt; /* page faults */
+ long ru_nswap; /* swaps */
+ long ru_inblock; /* block input operations */
+ long ru_oublock; /* block output operations */
+ long ru_msgsnd; /* messages sent */
+ long ru_msgrcv; /* messages received */
+ long ru_nsignals; /* signals received */
+ long ru_nvcsw; /* voluntary context switches */
+ long ru_nivcsw; /* involuntary " */
+};
+
+struct rlimit {
+ unsigned long rlim_cur;
+ unsigned long rlim_max;
+};
+
+#define PRIO_MIN (-20)
+#define PRIO_MAX 20
+
+#define PRIO_PROCESS 0
+#define PRIO_PGRP 1
+#define PRIO_USER 2
+
+/*
+ * Limit the stack by to some sane default: root can always
+ * increase this limit if needed.. 8MB seems reasonable.
+ */
+#define _STK_LIM (8*1024*1024)
+
+/*
+ * GPG wants 32kB of mlocked memory, to make sure pass phrases
+ * and other sensitive information are never written to disk.
+ */
+#define MLOCK_LIMIT (8 * PAGE_SIZE)
+
+/*
+ * Due to binary compatibility, the actual resource numbers
+ * may be different for different linux versions..
+ */
+#include <asm/resource.h>
+
+int getrusage(struct task_struct *p, int who, struct rusage *ru);
+
+#endif
diff --git a/sysroot/usr/include/linux/romfs_fs.h b/sysroot/usr/include/linux/romfs_fs.h
new file mode 100644
index 0000000..c490fbc
--- /dev/null
+++ b/sysroot/usr/include/linux/romfs_fs.h
@@ -0,0 +1,56 @@
+#ifndef __LINUX_ROMFS_FS_H
+#define __LINUX_ROMFS_FS_H
+
+/* The basic structures of the romfs filesystem */
+
+#define ROMBSIZE BLOCK_SIZE
+#define ROMBSBITS BLOCK_SIZE_BITS
+#define ROMBMASK (ROMBSIZE-1)
+#define ROMFS_MAGIC 0x7275
+
+#define ROMFS_MAXFN 128
+
+#define __mkw(h,l) (((h)&0x00ff)<< 8|((l)&0x00ff))
+#define __mkl(h,l) (((h)&0xffff)<<16|((l)&0xffff))
+#define __mk4(a,b,c,d) cpu_to_be32(__mkl(__mkw(a,b),__mkw(c,d)))
+#define ROMSB_WORD0 __mk4('-','r','o','m')
+#define ROMSB_WORD1 __mk4('1','f','s','-')
+
+/* On-disk "super block" */
+
+struct romfs_super_block {
+ __be32 word0;
+ __be32 word1;
+ __be32 size;
+ __be32 checksum;
+ char name[0]; /* volume name */
+};
+
+/* On disk inode */
+
+struct romfs_inode {
+ __be32 next; /* low 4 bits see ROMFH_ */
+ __be32 spec;
+ __be32 size;
+ __be32 checksum;
+ char name[0];
+};
+
+#define ROMFH_TYPE 7
+#define ROMFH_HRD 0
+#define ROMFH_DIR 1
+#define ROMFH_REG 2
+#define ROMFH_SYM 3
+#define ROMFH_BLK 4
+#define ROMFH_CHR 5
+#define ROMFH_SCK 6
+#define ROMFH_FIF 7
+#define ROMFH_EXEC 8
+
+/* Alignment */
+
+#define ROMFH_SIZE 16
+#define ROMFH_PAD (ROMFH_SIZE-1)
+#define ROMFH_MASK (~ROMFH_PAD)
+
+#endif
diff --git a/sysroot/usr/include/linux/rose.h b/sysroot/usr/include/linux/rose.h
new file mode 100644
index 0000000..c7b4b18
--- /dev/null
+++ b/sysroot/usr/include/linux/rose.h
@@ -0,0 +1,87 @@
+/*
+ * These are the public elements of the Linux kernel Rose implementation.
+ * For kernel AX.25 see the file ax25.h. This file requires ax25.h for the
+ * definition of the ax25_address structure.
+ */
+
+#ifndef ROSE_KERNEL_H
+#define ROSE_KERNEL_H
+
+#define ROSE_MTU 251
+
+#define ROSE_MAX_DIGIS 6
+
+#define ROSE_DEFER 1
+#define ROSE_T1 2
+#define ROSE_T2 3
+#define ROSE_T3 4
+#define ROSE_IDLE 5
+#define ROSE_QBITINCL 6
+#define ROSE_HOLDBACK 7
+
+#define SIOCRSGCAUSE (SIOCPROTOPRIVATE+0)
+#define SIOCRSSCAUSE (SIOCPROTOPRIVATE+1)
+#define SIOCRSL2CALL (SIOCPROTOPRIVATE+2)
+#define SIOCRSSL2CALL (SIOCPROTOPRIVATE+2)
+#define SIOCRSACCEPT (SIOCPROTOPRIVATE+3)
+#define SIOCRSCLRRT (SIOCPROTOPRIVATE+4)
+#define SIOCRSGL2CALL (SIOCPROTOPRIVATE+5)
+#define SIOCRSGFACILITIES (SIOCPROTOPRIVATE+6)
+
+#define ROSE_DTE_ORIGINATED 0x00
+#define ROSE_NUMBER_BUSY 0x01
+#define ROSE_INVALID_FACILITY 0x03
+#define ROSE_NETWORK_CONGESTION 0x05
+#define ROSE_OUT_OF_ORDER 0x09
+#define ROSE_ACCESS_BARRED 0x0B
+#define ROSE_NOT_OBTAINABLE 0x0D
+#define ROSE_REMOTE_PROCEDURE 0x11
+#define ROSE_LOCAL_PROCEDURE 0x13
+#define ROSE_SHIP_ABSENT 0x39
+
+typedef struct {
+ char rose_addr[5];
+} rose_address;
+
+struct sockaddr_rose {
+ sa_family_t srose_family;
+ rose_address srose_addr;
+ ax25_address srose_call;
+ int srose_ndigis;
+ ax25_address srose_digi;
+};
+
+struct full_sockaddr_rose {
+ sa_family_t srose_family;
+ rose_address srose_addr;
+ ax25_address srose_call;
+ unsigned int srose_ndigis;
+ ax25_address srose_digis[ROSE_MAX_DIGIS];
+};
+
+struct rose_route_struct {
+ rose_address address;
+ unsigned short mask;
+ ax25_address neighbour;
+ char device[16];
+ unsigned char ndigis;
+ ax25_address digipeaters[AX25_MAX_DIGIS];
+};
+
+struct rose_cause_struct {
+ unsigned char cause;
+ unsigned char diagnostic;
+};
+
+struct rose_facilities_struct {
+ rose_address source_addr, dest_addr;
+ ax25_address source_call, dest_call;
+ unsigned char source_ndigis, dest_ndigis;
+ ax25_address source_digis[ROSE_MAX_DIGIS];
+ ax25_address dest_digis[ROSE_MAX_DIGIS];
+ unsigned int rand;
+ rose_address fail_addr;
+ ax25_address fail_call;
+};
+
+#endif
diff --git a/sysroot/usr/include/linux/route.h b/sysroot/usr/include/linux/route.h
new file mode 100644
index 0000000..5ff8fef
--- /dev/null
+++ b/sysroot/usr/include/linux/route.h
@@ -0,0 +1,67 @@
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Global definitions for the IP router interface.
+ *
+ * Version: @(#)route.h 1.0.3 05/27/93
+ *
+ * Authors: Original taken from Berkeley UNIX 4.3, (c) UCB 1986-1988
+ * for the purposes of compatibility only.
+ *
+ * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ *
+ * Changes:
+ * Mike McLagan : Routing by source
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#ifndef _LINUX_ROUTE_H
+#define _LINUX_ROUTE_H
+
+#include <linux/if.h>
+
+/* This structure gets passed by the SIOCADDRT and SIOCDELRT calls. */
+struct rtentry
+{
+ unsigned long rt_pad1;
+ struct sockaddr rt_dst; /* target address */
+ struct sockaddr rt_gateway; /* gateway addr (RTF_GATEWAY) */
+ struct sockaddr rt_genmask; /* target network mask (IP) */
+ unsigned short rt_flags;
+ short rt_pad2;
+ unsigned long rt_pad3;
+ void *rt_pad4;
+ short rt_metric; /* +1 for binary compatibility! */
+ char *rt_dev; /* forcing the device at add */
+ unsigned long rt_mtu; /* per route MTU/Window */
+#define rt_mss rt_mtu /* Compatibility :-( */
+ unsigned long rt_window; /* Window clamping */
+ unsigned short rt_irtt; /* Initial RTT */
+};
+
+
+#define RTF_UP 0x0001 /* route usable */
+#define RTF_GATEWAY 0x0002 /* destination is a gateway */
+#define RTF_HOST 0x0004 /* host entry (net otherwise) */
+#define RTF_REINSTATE 0x0008 /* reinstate route after tmout */
+#define RTF_DYNAMIC 0x0010 /* created dyn. (by redirect) */
+#define RTF_MODIFIED 0x0020 /* modified dyn. (by redirect) */
+#define RTF_MTU 0x0040 /* specific MTU for this route */
+#define RTF_MSS RTF_MTU /* Compatibility :-( */
+#define RTF_WINDOW 0x0080 /* per route window clamping */
+#define RTF_IRTT 0x0100 /* Initial round trip time */
+#define RTF_REJECT 0x0200 /* Reject route */
+
+/*
+ * <linux/ipv6_route.h> uses RTF values >= 64k
+ */
+
+
+
+#endif /* _LINUX_ROUTE_H */
+
diff --git a/sysroot/usr/include/linux/rtc.h b/sysroot/usr/include/linux/rtc.h
new file mode 100644
index 0000000..4aae894
--- /dev/null
+++ b/sysroot/usr/include/linux/rtc.h
@@ -0,0 +1,101 @@
+/*
+ * Generic RTC interface.
+ * This version contains the part of the user interface to the Real Time Clock
+ * service. It is used with both the legacy mc146818 and also EFI
+ * Struct rtc_time and first 12 ioctl by Paul Gortmaker, 1996 - separated out
+ * from <linux/mc146818rtc.h> to this file for 2.4 kernels.
+ *
+ * Copyright (C) 1999 Hewlett-Packard Co.
+ * Copyright (C) 1999 Stephane Eranian <eranian@hpl.hp.com>
+ */
+#ifndef _LINUX_RTC_H_
+#define _LINUX_RTC_H_
+
+/*
+ * The struct used to pass data via the following ioctl. Similar to the
+ * struct tm in <time.h>, but it needs to be here so that the kernel
+ * source is self contained, allowing cross-compiles, etc. etc.
+ */
+
+struct rtc_time {
+ int tm_sec;
+ int tm_min;
+ int tm_hour;
+ int tm_mday;
+ int tm_mon;
+ int tm_year;
+ int tm_wday;
+ int tm_yday;
+ int tm_isdst;
+};
+
+/*
+ * This data structure is inspired by the EFI (v0.92) wakeup
+ * alarm API.
+ */
+struct rtc_wkalrm {
+ unsigned char enabled; /* 0 = alarm disabled, 1 = alarm enabled */
+ unsigned char pending; /* 0 = alarm not pending, 1 = alarm pending */
+ struct rtc_time time; /* time the alarm is set to */
+};
+
+/*
+ * Data structure to control PLL correction some better RTC feature
+ * pll_value is used to get or set current value of correction,
+ * the rest of the struct is used to query HW capabilities.
+ * This is modeled after the RTC used in Q40/Q60 computers but
+ * should be sufficiently flexible for other devices
+ *
+ * +ve pll_value means clock will run faster by
+ * pll_value*pll_posmult/pll_clock
+ * -ve pll_value means clock will run slower by
+ * pll_value*pll_negmult/pll_clock
+ */
+
+struct rtc_pll_info {
+ int pll_ctrl; /* placeholder for fancier control */
+ int pll_value; /* get/set correction value */
+ int pll_max; /* max +ve (faster) adjustment value */
+ int pll_min; /* max -ve (slower) adjustment value */
+ int pll_posmult; /* factor for +ve correction */
+ int pll_negmult; /* factor for -ve correction */
+ long pll_clock; /* base PLL frequency */
+};
+
+/*
+ * ioctl calls that are permitted to the /dev/rtc interface, if
+ * any of the RTC drivers are enabled.
+ */
+
+#define RTC_AIE_ON _IO('p', 0x01) /* Alarm int. enable on */
+#define RTC_AIE_OFF _IO('p', 0x02) /* ... off */
+#define RTC_UIE_ON _IO('p', 0x03) /* Update int. enable on */
+#define RTC_UIE_OFF _IO('p', 0x04) /* ... off */
+#define RTC_PIE_ON _IO('p', 0x05) /* Periodic int. enable on */
+#define RTC_PIE_OFF _IO('p', 0x06) /* ... off */
+#define RTC_WIE_ON _IO('p', 0x0f) /* Watchdog int. enable on */
+#define RTC_WIE_OFF _IO('p', 0x10) /* ... off */
+
+#define RTC_ALM_SET _IOW('p', 0x07, struct rtc_time) /* Set alarm time */
+#define RTC_ALM_READ _IOR('p', 0x08, struct rtc_time) /* Read alarm time */
+#define RTC_RD_TIME _IOR('p', 0x09, struct rtc_time) /* Read RTC time */
+#define RTC_SET_TIME _IOW('p', 0x0a, struct rtc_time) /* Set RTC time */
+#define RTC_IRQP_READ _IOR('p', 0x0b, unsigned long) /* Read IRQ rate */
+#define RTC_IRQP_SET _IOW('p', 0x0c, unsigned long) /* Set IRQ rate */
+#define RTC_EPOCH_READ _IOR('p', 0x0d, unsigned long) /* Read epoch */
+#define RTC_EPOCH_SET _IOW('p', 0x0e, unsigned long) /* Set epoch */
+
+#define RTC_WKALM_SET _IOW('p', 0x0f, struct rtc_wkalrm)/* Set wakeup alarm*/
+#define RTC_WKALM_RD _IOR('p', 0x10, struct rtc_wkalrm)/* Get wakeup alarm*/
+
+#define RTC_PLL_GET _IOR('p', 0x11, struct rtc_pll_info) /* Get PLL correction */
+#define RTC_PLL_SET _IOW('p', 0x12, struct rtc_pll_info) /* Set PLL correction */
+
+/* interrupt flags */
+#define RTC_IRQF 0x80 /* any of the following is active */
+#define RTC_PF 0x40
+#define RTC_AF 0x20
+#define RTC_UF 0x10
+
+
+#endif /* _LINUX_RTC_H_ */
diff --git a/sysroot/usr/include/linux/rtnetlink.h b/sysroot/usr/include/linux/rtnetlink.h
new file mode 100644
index 0000000..4cd0abf
--- /dev/null
+++ b/sysroot/usr/include/linux/rtnetlink.h
@@ -0,0 +1,594 @@
+#ifndef __LINUX_RTNETLINK_H
+#define __LINUX_RTNETLINK_H
+
+#include <linux/netlink.h>
+#include <linux/if_link.h>
+#include <linux/if_addr.h>
+#include <linux/neighbour.h>
+
+/****
+ * Routing/neighbour discovery messages.
+ ****/
+
+/* Types of messages */
+
+enum {
+ RTM_BASE = 16,
+#define RTM_BASE RTM_BASE
+
+ RTM_NEWLINK = 16,
+#define RTM_NEWLINK RTM_NEWLINK
+ RTM_DELLINK,
+#define RTM_DELLINK RTM_DELLINK
+ RTM_GETLINK,
+#define RTM_GETLINK RTM_GETLINK
+ RTM_SETLINK,
+#define RTM_SETLINK RTM_SETLINK
+
+ RTM_NEWADDR = 20,
+#define RTM_NEWADDR RTM_NEWADDR
+ RTM_DELADDR,
+#define RTM_DELADDR RTM_DELADDR
+ RTM_GETADDR,
+#define RTM_GETADDR RTM_GETADDR
+
+ RTM_NEWROUTE = 24,
+#define RTM_NEWROUTE RTM_NEWROUTE
+ RTM_DELROUTE,
+#define RTM_DELROUTE RTM_DELROUTE
+ RTM_GETROUTE,
+#define RTM_GETROUTE RTM_GETROUTE
+
+ RTM_NEWNEIGH = 28,
+#define RTM_NEWNEIGH RTM_NEWNEIGH
+ RTM_DELNEIGH,
+#define RTM_DELNEIGH RTM_DELNEIGH
+ RTM_GETNEIGH,
+#define RTM_GETNEIGH RTM_GETNEIGH
+
+ RTM_NEWRULE = 32,
+#define RTM_NEWRULE RTM_NEWRULE
+ RTM_DELRULE,
+#define RTM_DELRULE RTM_DELRULE
+ RTM_GETRULE,
+#define RTM_GETRULE RTM_GETRULE
+
+ RTM_NEWQDISC = 36,
+#define RTM_NEWQDISC RTM_NEWQDISC
+ RTM_DELQDISC,
+#define RTM_DELQDISC RTM_DELQDISC
+ RTM_GETQDISC,
+#define RTM_GETQDISC RTM_GETQDISC
+
+ RTM_NEWTCLASS = 40,
+#define RTM_NEWTCLASS RTM_NEWTCLASS
+ RTM_DELTCLASS,
+#define RTM_DELTCLASS RTM_DELTCLASS
+ RTM_GETTCLASS,
+#define RTM_GETTCLASS RTM_GETTCLASS
+
+ RTM_NEWTFILTER = 44,
+#define RTM_NEWTFILTER RTM_NEWTFILTER
+ RTM_DELTFILTER,
+#define RTM_DELTFILTER RTM_DELTFILTER
+ RTM_GETTFILTER,
+#define RTM_GETTFILTER RTM_GETTFILTER
+
+ RTM_NEWACTION = 48,
+#define RTM_NEWACTION RTM_NEWACTION
+ RTM_DELACTION,
+#define RTM_DELACTION RTM_DELACTION
+ RTM_GETACTION,
+#define RTM_GETACTION RTM_GETACTION
+
+ RTM_NEWPREFIX = 52,
+#define RTM_NEWPREFIX RTM_NEWPREFIX
+
+ RTM_GETMULTICAST = 58,
+#define RTM_GETMULTICAST RTM_GETMULTICAST
+
+ RTM_GETANYCAST = 62,
+#define RTM_GETANYCAST RTM_GETANYCAST
+
+ RTM_NEWNEIGHTBL = 64,
+#define RTM_NEWNEIGHTBL RTM_NEWNEIGHTBL
+ RTM_GETNEIGHTBL = 66,
+#define RTM_GETNEIGHTBL RTM_GETNEIGHTBL
+ RTM_SETNEIGHTBL,
+#define RTM_SETNEIGHTBL RTM_SETNEIGHTBL
+
+ RTM_NEWNDUSEROPT = 68,
+#define RTM_NEWNDUSEROPT RTM_NEWNDUSEROPT
+
+ __RTM_MAX,
+#define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1)
+};
+
+#define RTM_NR_MSGTYPES (RTM_MAX + 1 - RTM_BASE)
+#define RTM_NR_FAMILIES (RTM_NR_MSGTYPES >> 2)
+#define RTM_FAM(cmd) (((cmd) - RTM_BASE) >> 2)
+
+/*
+ Generic structure for encapsulation of optional route information.
+ It is reminiscent of sockaddr, but with sa_family replaced
+ with attribute type.
+ */
+
+struct rtattr
+{
+ unsigned short rta_len;
+ unsigned short rta_type;
+};
+
+/* Macros to handle rtattributes */
+
+#define RTA_ALIGNTO 4
+#define RTA_ALIGN(len) ( ((len)+RTA_ALIGNTO-1) & ~(RTA_ALIGNTO-1) )
+#define RTA_OK(rta,len) ((len) >= (int)sizeof(struct rtattr) && \
+ (rta)->rta_len >= sizeof(struct rtattr) && \
+ (rta)->rta_len <= (len))
+#define RTA_NEXT(rta,attrlen) ((attrlen) -= RTA_ALIGN((rta)->rta_len), \
+ (struct rtattr*)(((char*)(rta)) + RTA_ALIGN((rta)->rta_len)))
+#define RTA_LENGTH(len) (RTA_ALIGN(sizeof(struct rtattr)) + (len))
+#define RTA_SPACE(len) RTA_ALIGN(RTA_LENGTH(len))
+#define RTA_DATA(rta) ((void*)(((char*)(rta)) + RTA_LENGTH(0)))
+#define RTA_PAYLOAD(rta) ((int)((rta)->rta_len) - RTA_LENGTH(0))
+
+
+
+
+/******************************************************************************
+ * Definitions used in routing table administration.
+ ****/
+
+struct rtmsg
+{
+ unsigned char rtm_family;
+ unsigned char rtm_dst_len;
+ unsigned char rtm_src_len;
+ unsigned char rtm_tos;
+
+ unsigned char rtm_table; /* Routing table id */
+ unsigned char rtm_protocol; /* Routing protocol; see below */
+ unsigned char rtm_scope; /* See below */
+ unsigned char rtm_type; /* See below */
+
+ unsigned rtm_flags;
+};
+
+/* rtm_type */
+
+enum
+{
+ RTN_UNSPEC,
+ RTN_UNICAST, /* Gateway or direct route */
+ RTN_LOCAL, /* Accept locally */
+ RTN_BROADCAST, /* Accept locally as broadcast,
+ send as broadcast */
+ RTN_ANYCAST, /* Accept locally as broadcast,
+ but send as unicast */
+ RTN_MULTICAST, /* Multicast route */
+ RTN_BLACKHOLE, /* Drop */
+ RTN_UNREACHABLE, /* Destination is unreachable */
+ RTN_PROHIBIT, /* Administratively prohibited */
+ RTN_THROW, /* Not in this table */
+ RTN_NAT, /* Translate this address */
+ RTN_XRESOLVE, /* Use external resolver */
+ __RTN_MAX
+};
+
+#define RTN_MAX (__RTN_MAX - 1)
+
+
+/* rtm_protocol */
+
+#define RTPROT_UNSPEC 0
+#define RTPROT_REDIRECT 1 /* Route installed by ICMP redirects;
+ not used by current IPv4 */
+#define RTPROT_KERNEL 2 /* Route installed by kernel */
+#define RTPROT_BOOT 3 /* Route installed during boot */
+#define RTPROT_STATIC 4 /* Route installed by administrator */
+
+/* Values of protocol >= RTPROT_STATIC are not interpreted by kernel;
+ they are just passed from user and back as is.
+ It will be used by hypothetical multiple routing daemons.
+ Note that protocol values should be standardized in order to
+ avoid conflicts.
+ */
+
+#define RTPROT_GATED 8 /* Apparently, GateD */
+#define RTPROT_RA 9 /* RDISC/ND router advertisements */
+#define RTPROT_MRT 10 /* Merit MRT */
+#define RTPROT_ZEBRA 11 /* Zebra */
+#define RTPROT_BIRD 12 /* BIRD */
+#define RTPROT_DNROUTED 13 /* DECnet routing daemon */
+#define RTPROT_XORP 14 /* XORP */
+#define RTPROT_NTK 15 /* Netsukuku */
+
+/* rtm_scope
+
+ Really it is not scope, but sort of distance to the destination.
+ NOWHERE are reserved for not existing destinations, HOST is our
+ local addresses, LINK are destinations, located on directly attached
+ link and UNIVERSE is everywhere in the Universe.
+
+ Intermediate values are also possible f.e. interior routes
+ could be assigned a value between UNIVERSE and LINK.
+*/
+
+enum rt_scope_t
+{
+ RT_SCOPE_UNIVERSE=0,
+/* User defined values */
+ RT_SCOPE_SITE=200,
+ RT_SCOPE_LINK=253,
+ RT_SCOPE_HOST=254,
+ RT_SCOPE_NOWHERE=255
+};
+
+/* rtm_flags */
+
+#define RTM_F_NOTIFY 0x100 /* Notify user of route change */
+#define RTM_F_CLONED 0x200 /* This route is cloned */
+#define RTM_F_EQUALIZE 0x400 /* Multipath equalizer: NI */
+#define RTM_F_PREFIX 0x800 /* Prefix addresses */
+
+/* Reserved table identifiers */
+
+enum rt_class_t
+{
+ RT_TABLE_UNSPEC=0,
+/* User defined values */
+ RT_TABLE_DEFAULT=253,
+ RT_TABLE_MAIN=254,
+ RT_TABLE_LOCAL=255,
+ RT_TABLE_MAX=0xFFFFFFFF
+};
+
+
+/* Routing message attributes */
+
+enum rtattr_type_t
+{
+ RTA_UNSPEC,
+ RTA_DST,
+ RTA_SRC,
+ RTA_IIF,
+ RTA_OIF,
+ RTA_GATEWAY,
+ RTA_PRIORITY,
+ RTA_PREFSRC,
+ RTA_METRICS,
+ RTA_MULTIPATH,
+ RTA_PROTOINFO,
+ RTA_FLOW,
+ RTA_CACHEINFO,
+ RTA_SESSION,
+ RTA_MP_ALGO, /* no longer used */
+ RTA_TABLE,
+ __RTA_MAX
+};
+
+#define RTA_MAX (__RTA_MAX - 1)
+
+#define RTM_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct rtmsg))))
+#define RTM_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct rtmsg))
+
+/* RTM_MULTIPATH --- array of struct rtnexthop.
+ *
+ * "struct rtnexthop" describes all necessary nexthop information,
+ * i.e. parameters of path to a destination via this nexthop.
+ *
+ * At the moment it is impossible to set different prefsrc, mtu, window
+ * and rtt for different paths from multipath.
+ */
+
+struct rtnexthop
+{
+ unsigned short rtnh_len;
+ unsigned char rtnh_flags;
+ unsigned char rtnh_hops;
+ int rtnh_ifindex;
+};
+
+/* rtnh_flags */
+
+#define RTNH_F_DEAD 1 /* Nexthop is dead (used by multipath) */
+#define RTNH_F_PERVASIVE 2 /* Do recursive gateway lookup */
+#define RTNH_F_ONLINK 4 /* Gateway is forced on link */
+
+/* Macros to handle hexthops */
+
+#define RTNH_ALIGNTO 4
+#define RTNH_ALIGN(len) ( ((len)+RTNH_ALIGNTO-1) & ~(RTNH_ALIGNTO-1) )
+#define RTNH_OK(rtnh,len) ((rtnh)->rtnh_len >= sizeof(struct rtnexthop) && \
+ ((int)(rtnh)->rtnh_len) <= (len))
+#define RTNH_NEXT(rtnh) ((struct rtnexthop*)(((char*)(rtnh)) + RTNH_ALIGN((rtnh)->rtnh_len)))
+#define RTNH_LENGTH(len) (RTNH_ALIGN(sizeof(struct rtnexthop)) + (len))
+#define RTNH_SPACE(len) RTNH_ALIGN(RTNH_LENGTH(len))
+#define RTNH_DATA(rtnh) ((struct rtattr*)(((char*)(rtnh)) + RTNH_LENGTH(0)))
+
+/* RTM_CACHEINFO */
+
+struct rta_cacheinfo
+{
+ __u32 rta_clntref;
+ __u32 rta_lastuse;
+ __s32 rta_expires;
+ __u32 rta_error;
+ __u32 rta_used;
+
+#define RTNETLINK_HAVE_PEERINFO 1
+ __u32 rta_id;
+ __u32 rta_ts;
+ __u32 rta_tsage;
+};
+
+/* RTM_METRICS --- array of struct rtattr with types of RTAX_* */
+
+enum
+{
+ RTAX_UNSPEC,
+#define RTAX_UNSPEC RTAX_UNSPEC
+ RTAX_LOCK,
+#define RTAX_LOCK RTAX_LOCK
+ RTAX_MTU,
+#define RTAX_MTU RTAX_MTU
+ RTAX_WINDOW,
+#define RTAX_WINDOW RTAX_WINDOW
+ RTAX_RTT,
+#define RTAX_RTT RTAX_RTT
+ RTAX_RTTVAR,
+#define RTAX_RTTVAR RTAX_RTTVAR
+ RTAX_SSTHRESH,
+#define RTAX_SSTHRESH RTAX_SSTHRESH
+ RTAX_CWND,
+#define RTAX_CWND RTAX_CWND
+ RTAX_ADVMSS,
+#define RTAX_ADVMSS RTAX_ADVMSS
+ RTAX_REORDERING,
+#define RTAX_REORDERING RTAX_REORDERING
+ RTAX_HOPLIMIT,
+#define RTAX_HOPLIMIT RTAX_HOPLIMIT
+ RTAX_INITCWND,
+#define RTAX_INITCWND RTAX_INITCWND
+ RTAX_FEATURES,
+#define RTAX_FEATURES RTAX_FEATURES
+ RTAX_RTO_MIN,
+#define RTAX_RTO_MIN RTAX_RTO_MIN
+ __RTAX_MAX
+};
+
+#define RTAX_MAX (__RTAX_MAX - 1)
+
+#define RTAX_FEATURE_ECN 0x00000001
+#define RTAX_FEATURE_SACK 0x00000002
+#define RTAX_FEATURE_TIMESTAMP 0x00000004
+#define RTAX_FEATURE_ALLFRAG 0x00000008
+
+struct rta_session
+{
+ __u8 proto;
+ __u8 pad1;
+ __u16 pad2;
+
+ union {
+ struct {
+ __u16 sport;
+ __u16 dport;
+ } ports;
+
+ struct {
+ __u8 type;
+ __u8 code;
+ __u16 ident;
+ } icmpt;
+
+ __u32 spi;
+ } u;
+};
+
+/****
+ * General form of address family dependent message.
+ ****/
+
+struct rtgenmsg
+{
+ unsigned char rtgen_family;
+};
+
+/*****************************************************************
+ * Link layer specific messages.
+ ****/
+
+/* struct ifinfomsg
+ * passes link level specific information, not dependent
+ * on network protocol.
+ */
+
+struct ifinfomsg
+{
+ unsigned char ifi_family;
+ unsigned char __ifi_pad;
+ unsigned short ifi_type; /* ARPHRD_* */
+ int ifi_index; /* Link index */
+ unsigned ifi_flags; /* IFF_* flags */
+ unsigned ifi_change; /* IFF_* change mask */
+};
+
+/********************************************************************
+ * prefix information
+ ****/
+
+struct prefixmsg
+{
+ unsigned char prefix_family;
+ unsigned char prefix_pad1;
+ unsigned short prefix_pad2;
+ int prefix_ifindex;
+ unsigned char prefix_type;
+ unsigned char prefix_len;
+ unsigned char prefix_flags;
+ unsigned char prefix_pad3;
+};
+
+enum
+{
+ PREFIX_UNSPEC,
+ PREFIX_ADDRESS,
+ PREFIX_CACHEINFO,
+ __PREFIX_MAX
+};
+
+#define PREFIX_MAX (__PREFIX_MAX - 1)
+
+struct prefix_cacheinfo
+{
+ __u32 preferred_time;
+ __u32 valid_time;
+};
+
+
+/*****************************************************************
+ * Traffic control messages.
+ ****/
+
+struct tcmsg
+{
+ unsigned char tcm_family;
+ unsigned char tcm__pad1;
+ unsigned short tcm__pad2;
+ int tcm_ifindex;
+ __u32 tcm_handle;
+ __u32 tcm_parent;
+ __u32 tcm_info;
+};
+
+enum
+{
+ TCA_UNSPEC,
+ TCA_KIND,
+ TCA_OPTIONS,
+ TCA_STATS,
+ TCA_XSTATS,
+ TCA_RATE,
+ TCA_FCNT,
+ TCA_STATS2,
+ __TCA_MAX
+};
+
+#define TCA_MAX (__TCA_MAX - 1)
+
+#define TCA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcmsg))))
+#define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcmsg))
+
+/********************************************************************
+ * Neighbor Discovery userland options
+ ****/
+
+struct nduseroptmsg
+{
+ unsigned char nduseropt_family;
+ unsigned char nduseropt_pad1;
+ unsigned short nduseropt_opts_len; /* Total length of options */
+ int nduseropt_ifindex;
+ __u8 nduseropt_icmp_type;
+ __u8 nduseropt_icmp_code;
+ unsigned short nduseropt_pad2;
+ unsigned int nduseropt_pad3;
+ /* Followed by one or more ND options */
+};
+
+enum
+{
+ NDUSEROPT_UNSPEC,
+ NDUSEROPT_SRCADDR,
+ __NDUSEROPT_MAX
+};
+
+#define NDUSEROPT_MAX (__NDUSEROPT_MAX - 1)
+
+/* RTnetlink multicast groups - backwards compatibility for userspace */
+#define RTMGRP_LINK 1
+#define RTMGRP_NOTIFY 2
+#define RTMGRP_NEIGH 4
+#define RTMGRP_TC 8
+
+#define RTMGRP_IPV4_IFADDR 0x10
+#define RTMGRP_IPV4_MROUTE 0x20
+#define RTMGRP_IPV4_ROUTE 0x40
+#define RTMGRP_IPV4_RULE 0x80
+
+#define RTMGRP_IPV6_IFADDR 0x100
+#define RTMGRP_IPV6_MROUTE 0x200
+#define RTMGRP_IPV6_ROUTE 0x400
+#define RTMGRP_IPV6_IFINFO 0x800
+
+#define RTMGRP_DECnet_IFADDR 0x1000
+#define RTMGRP_DECnet_ROUTE 0x4000
+
+#define RTMGRP_IPV6_PREFIX 0x20000
+
+/* RTnetlink multicast groups */
+enum rtnetlink_groups {
+ RTNLGRP_NONE,
+#define RTNLGRP_NONE RTNLGRP_NONE
+ RTNLGRP_LINK,
+#define RTNLGRP_LINK RTNLGRP_LINK
+ RTNLGRP_NOTIFY,
+#define RTNLGRP_NOTIFY RTNLGRP_NOTIFY
+ RTNLGRP_NEIGH,
+#define RTNLGRP_NEIGH RTNLGRP_NEIGH
+ RTNLGRP_TC,
+#define RTNLGRP_TC RTNLGRP_TC
+ RTNLGRP_IPV4_IFADDR,
+#define RTNLGRP_IPV4_IFADDR RTNLGRP_IPV4_IFADDR
+ RTNLGRP_IPV4_MROUTE,
+#define RTNLGRP_IPV4_MROUTE RTNLGRP_IPV4_MROUTE
+ RTNLGRP_IPV4_ROUTE,
+#define RTNLGRP_IPV4_ROUTE RTNLGRP_IPV4_ROUTE
+ RTNLGRP_IPV4_RULE,
+#define RTNLGRP_IPV4_RULE RTNLGRP_IPV4_RULE
+ RTNLGRP_IPV6_IFADDR,
+#define RTNLGRP_IPV6_IFADDR RTNLGRP_IPV6_IFADDR
+ RTNLGRP_IPV6_MROUTE,
+#define RTNLGRP_IPV6_MROUTE RTNLGRP_IPV6_MROUTE
+ RTNLGRP_IPV6_ROUTE,
+#define RTNLGRP_IPV6_ROUTE RTNLGRP_IPV6_ROUTE
+ RTNLGRP_IPV6_IFINFO,
+#define RTNLGRP_IPV6_IFINFO RTNLGRP_IPV6_IFINFO
+ RTNLGRP_DECnet_IFADDR,
+#define RTNLGRP_DECnet_IFADDR RTNLGRP_DECnet_IFADDR
+ RTNLGRP_NOP2,
+ RTNLGRP_DECnet_ROUTE,
+#define RTNLGRP_DECnet_ROUTE RTNLGRP_DECnet_ROUTE
+ RTNLGRP_DECnet_RULE,
+#define RTNLGRP_DECnet_RULE RTNLGRP_DECnet_RULE
+ RTNLGRP_NOP4,
+ RTNLGRP_IPV6_PREFIX,
+#define RTNLGRP_IPV6_PREFIX RTNLGRP_IPV6_PREFIX
+ RTNLGRP_IPV6_RULE,
+#define RTNLGRP_IPV6_RULE RTNLGRP_IPV6_RULE
+ RTNLGRP_ND_USEROPT,
+#define RTNLGRP_ND_USEROPT RTNLGRP_ND_USEROPT
+ __RTNLGRP_MAX
+};
+#define RTNLGRP_MAX (__RTNLGRP_MAX - 1)
+
+/* TC action piece */
+struct tcamsg
+{
+ unsigned char tca_family;
+ unsigned char tca__pad1;
+ unsigned short tca__pad2;
+};
+#define TA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcamsg))))
+#define TA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcamsg))
+#define TCA_ACT_TAB 1 /* attr type must be >=1 */
+#define TCAA_MAX 1
+
+/* End of information exported to user level */
+
+
+
+#endif /* __LINUX_RTNETLINK_H */
diff --git a/sysroot/usr/include/linux/scc.h b/sysroot/usr/include/linux/scc.h
new file mode 100644
index 0000000..167cc03
--- /dev/null
+++ b/sysroot/usr/include/linux/scc.h
@@ -0,0 +1,172 @@
+/* $Id: scc.h,v 1.29 1997/04/02 14:56:45 jreuter Exp jreuter $ */
+
+#ifndef _SCC_H
+#define _SCC_H
+
+
+/* selection of hardware types */
+
+#define PA0HZP 0x00 /* hardware type for PA0HZP SCC card and compatible */
+#define EAGLE 0x01 /* hardware type for EAGLE card */
+#define PC100 0x02 /* hardware type for PC100 card */
+#define PRIMUS 0x04 /* hardware type for PRIMUS-PC (DG9BL) card */
+#define DRSI 0x08 /* hardware type for DRSI PC*Packet card */
+#define BAYCOM 0x10 /* hardware type for BayCom (U)SCC */
+
+/* DEV ioctl() commands */
+
+enum SCC_ioctl_cmds {
+ SIOCSCCRESERVED = SIOCDEVPRIVATE,
+ SIOCSCCCFG,
+ SIOCSCCINI,
+ SIOCSCCCHANINI,
+ SIOCSCCSMEM,
+ SIOCSCCGKISS,
+ SIOCSCCSKISS,
+ SIOCSCCGSTAT,
+ SIOCSCCCAL
+};
+
+/* Device parameter control (from WAMPES) */
+
+enum L1_params {
+ PARAM_DATA,
+ PARAM_TXDELAY,
+ PARAM_PERSIST,
+ PARAM_SLOTTIME,
+ PARAM_TXTAIL,
+ PARAM_FULLDUP,
+ PARAM_SOFTDCD, /* was: PARAM_HW */
+ PARAM_MUTE, /* ??? */
+ PARAM_DTR,
+ PARAM_RTS,
+ PARAM_SPEED,
+ PARAM_ENDDELAY, /* ??? */
+ PARAM_GROUP,
+ PARAM_IDLE,
+ PARAM_MIN,
+ PARAM_MAXKEY,
+ PARAM_WAIT,
+ PARAM_MAXDEFER,
+ PARAM_TX,
+ PARAM_HWEVENT = 31,
+ PARAM_RETURN = 255 /* reset kiss mode */
+};
+
+/* fulldup parameter */
+
+enum FULLDUP_modes {
+ KISS_DUPLEX_HALF, /* normal CSMA operation */
+ KISS_DUPLEX_FULL, /* fullduplex, key down trx after transmission */
+ KISS_DUPLEX_LINK, /* fullduplex, key down trx after 'idletime' sec */
+ KISS_DUPLEX_OPTIMA /* fullduplex, let the protocol layer control the hw */
+};
+
+/* misc. parameters */
+
+#define TIMER_OFF 65535U /* to switch off timers */
+#define NO_SUCH_PARAM 65534U /* param not implemented */
+
+/* HWEVENT parameter */
+
+enum HWEVENT_opts {
+ HWEV_DCD_ON,
+ HWEV_DCD_OFF,
+ HWEV_ALL_SENT
+};
+
+/* channel grouping */
+
+#define RXGROUP 0100 /* if set, only tx when all channels clear */
+#define TXGROUP 0200 /* if set, don't transmit simultaneously */
+
+/* Tx/Rx clock sources */
+
+enum CLOCK_sources {
+ CLK_DPLL, /* normal halfduplex operation */
+ CLK_EXTERNAL, /* external clocking (G3RUH/DF9IC modems) */
+ CLK_DIVIDER, /* Rx = DPLL, Tx = divider (fullduplex with */
+ /* modems without clock regeneration */
+ CLK_BRG /* experimental fullduplex mode with DPLL/BRG for */
+ /* MODEMs without clock recovery */
+};
+
+/* Tx state */
+
+enum TX_state {
+ TXS_IDLE, /* Transmitter off, no data pending */
+ TXS_BUSY, /* waiting for permission to send / tailtime */
+ TXS_ACTIVE, /* Transmitter on, sending data */
+ TXS_NEWFRAME, /* reset CRC and send (next) frame */
+ TXS_IDLE2, /* Transmitter on, no data pending */
+ TXS_WAIT, /* Waiting for Mintime to expire */
+ TXS_TIMEOUT /* We had a transmission timeout */
+};
+
+typedef unsigned long io_port; /* type definition for an 'io port address' */
+
+/* SCC statistical information */
+
+struct scc_stat {
+ long rxints; /* Receiver interrupts */
+ long txints; /* Transmitter interrupts */
+ long exints; /* External/status interrupts */
+ long spints; /* Special receiver interrupts */
+
+ long txframes; /* Packets sent */
+ long rxframes; /* Number of Frames Actually Received */
+ long rxerrs; /* CRC Errors */
+ long txerrs; /* KISS errors */
+
+ unsigned int nospace; /* "Out of buffers" */
+ unsigned int rx_over; /* Receiver Overruns */
+ unsigned int tx_under; /* Transmitter Underruns */
+
+ unsigned int tx_state; /* Transmitter state */
+ int tx_queued; /* tx frames enqueued */
+
+ unsigned int maxqueue; /* allocated tx_buffers */
+ unsigned int bufsize; /* used buffersize */
+};
+
+struct scc_modem {
+ long speed; /* Line speed, bps */
+ char clocksrc; /* 0 = DPLL, 1 = external, 2 = divider */
+ char nrz; /* NRZ instead of NRZI */
+};
+
+struct scc_kiss_cmd {
+ int command; /* one of the KISS-Commands defined above */
+ unsigned param; /* KISS-Param */
+};
+
+struct scc_hw_config {
+ io_port data_a; /* data port channel A */
+ io_port ctrl_a; /* control port channel A */
+ io_port data_b; /* data port channel B */
+ io_port ctrl_b; /* control port channel B */
+ io_port vector_latch; /* INTACK-Latch (#) */
+ io_port special; /* special function port */
+
+ int irq; /* irq */
+ long clock; /* clock */
+ char option; /* command for function port */
+
+ char brand; /* hardware type */
+ char escc; /* use ext. features of a 8580/85180/85280 */
+};
+
+/* (#) only one INTACK latch allowed. */
+
+
+struct scc_mem_config {
+ unsigned int dummy;
+ unsigned int bufsize;
+};
+
+struct scc_calibrate {
+ unsigned int time;
+ unsigned char pattern;
+};
+
+#endif /* defined(_SCC_H) */
diff --git a/sysroot/usr/include/linux/sched.h b/sysroot/usr/include/linux/sched.h
new file mode 100644
index 0000000..40d56a9
--- /dev/null
+++ b/sysroot/usr/include/linux/sched.h
@@ -0,0 +1,42 @@
+#ifndef _LINUX_SCHED_H
+#define _LINUX_SCHED_H
+
+/*
+ * cloning flags:
+ */
+#define CSIGNAL 0x000000ff /* signal mask to be sent at exit */
+#define CLONE_VM 0x00000100 /* set if VM shared between processes */
+#define CLONE_FS 0x00000200 /* set if fs info shared between processes */
+#define CLONE_FILES 0x00000400 /* set if open files shared between processes */
+#define CLONE_SIGHAND 0x00000800 /* set if signal handlers and blocked signals shared */
+#define CLONE_PTRACE 0x00002000 /* set if we want to let tracing continue on the child too */
+#define CLONE_VFORK 0x00004000 /* set if the parent wants the child to wake it up on mm_release */
+#define CLONE_PARENT 0x00008000 /* set if we want to have the same parent as the cloner */
+#define CLONE_THREAD 0x00010000 /* Same thread group? */
+#define CLONE_NEWNS 0x00020000 /* New namespace group? */
+#define CLONE_SYSVSEM 0x00040000 /* share system V SEM_UNDO semantics */
+#define CLONE_SETTLS 0x00080000 /* create a new TLS for the child */
+#define CLONE_PARENT_SETTID 0x00100000 /* set the TID in the parent */
+#define CLONE_CHILD_CLEARTID 0x00200000 /* clear the TID in the child */
+#define CLONE_DETACHED 0x00400000 /* Unused, ignored */
+#define CLONE_UNTRACED 0x00800000 /* set if the tracing process can't force CLONE_PTRACE on this clone */
+#define CLONE_CHILD_SETTID 0x01000000 /* set the TID in the child */
+#define CLONE_STOPPED 0x02000000 /* Start in stopped state */
+#define CLONE_NEWUTS 0x04000000 /* New utsname group? */
+#define CLONE_NEWIPC 0x08000000 /* New ipcs */
+#define CLONE_NEWUSER 0x10000000 /* New user namespace */
+#define CLONE_NEWPID 0x20000000 /* New pid namespace */
+#define CLONE_NEWNET 0x40000000 /* New network namespace */
+
+/*
+ * Scheduling policies
+ */
+#define SCHED_NORMAL 0
+#define SCHED_FIFO 1
+#define SCHED_RR 2
+#define SCHED_BATCH 3
+/* SCHED_ISO: reserved but not implemented yet */
+#define SCHED_IDLE 5
+
+
+#endif
diff --git a/sysroot/usr/include/linux/screen_info.h b/sysroot/usr/include/linux/screen_info.h
new file mode 100644
index 0000000..4885982
--- /dev/null
+++ b/sysroot/usr/include/linux/screen_info.h
@@ -0,0 +1,69 @@
+#ifndef _SCREEN_INFO_H
+#define _SCREEN_INFO_H
+
+#include <linux/types.h>
+
+/*
+ * These are set up by the setup-routine at boot-time:
+ */
+
+struct screen_info {
+ __u8 orig_x; /* 0x00 */
+ __u8 orig_y; /* 0x01 */
+ __u16 ext_mem_k; /* 0x02 */
+ __u16 orig_video_page; /* 0x04 */
+ __u8 orig_video_mode; /* 0x06 */
+ __u8 orig_video_cols; /* 0x07 */
+ __u16 unused2; /* 0x08 */
+ __u16 orig_video_ega_bx;/* 0x0a */
+ __u16 unused3; /* 0x0c */
+ __u8 orig_video_lines; /* 0x0e */
+ __u8 orig_video_isVGA; /* 0x0f */
+ __u16 orig_video_points;/* 0x10 */
+
+ /* VESA graphic mode -- linear frame buffer */
+ __u16 lfb_width; /* 0x12 */
+ __u16 lfb_height; /* 0x14 */
+ __u16 lfb_depth; /* 0x16 */
+ __u32 lfb_base; /* 0x18 */
+ __u32 lfb_size; /* 0x1c */
+ __u16 cl_magic, cl_offset; /* 0x20 */
+ __u16 lfb_linelength; /* 0x24 */
+ __u8 red_size; /* 0x26 */
+ __u8 red_pos; /* 0x27 */
+ __u8 green_size; /* 0x28 */
+ __u8 green_pos; /* 0x29 */
+ __u8 blue_size; /* 0x2a */
+ __u8 blue_pos; /* 0x2b */
+ __u8 rsvd_size; /* 0x2c */
+ __u8 rsvd_pos; /* 0x2d */
+ __u16 vesapm_seg; /* 0x2e */
+ __u16 vesapm_off; /* 0x30 */
+ __u16 pages; /* 0x32 */
+ __u16 vesa_attributes; /* 0x34 */
+ __u32 capabilities; /* 0x36 */
+ __u8 _reserved[6]; /* 0x3a */
+} __attribute__((packed));
+
+#define VIDEO_TYPE_MDA 0x10 /* Monochrome Text Display */
+#define VIDEO_TYPE_CGA 0x11 /* CGA Display */
+#define VIDEO_TYPE_EGAM 0x20 /* EGA/VGA in Monochrome Mode */
+#define VIDEO_TYPE_EGAC 0x21 /* EGA in Color Mode */
+#define VIDEO_TYPE_VGAC 0x22 /* VGA+ in Color Mode */
+#define VIDEO_TYPE_VLFB 0x23 /* VESA VGA in graphic mode */
+
+#define VIDEO_TYPE_PICA_S3 0x30 /* ACER PICA-61 local S3 video */
+#define VIDEO_TYPE_MIPS_G364 0x31 /* MIPS Magnum 4000 G364 video */
+#define VIDEO_TYPE_SGI 0x33 /* Various SGI graphics hardware */
+
+#define VIDEO_TYPE_TGAC 0x40 /* DEC TGA */
+
+#define VIDEO_TYPE_SUN 0x50 /* Sun frame buffer. */
+#define VIDEO_TYPE_SUNPCI 0x51 /* Sun PCI based frame buffer. */
+
+#define VIDEO_TYPE_PMAC 0x60 /* PowerMacintosh frame buffer. */
+
+#define VIDEO_TYPE_EFI 0x70 /* EFI graphic mode */
+
+
+#endif /* _SCREEN_INFO_H */
diff --git a/sysroot/usr/include/linux/sdla.h b/sysroot/usr/include/linux/sdla.h
new file mode 100644
index 0000000..303b4fa
--- /dev/null
+++ b/sysroot/usr/include/linux/sdla.h
@@ -0,0 +1,119 @@
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Global definitions for the Frame relay interface.
+ *
+ * Version: @(#)if_ifrad.h 0.20 13 Apr 96
+ *
+ * Author: Mike McLagan <mike.mclagan@linux.org>
+ *
+ * Changes:
+ * 0.15 Mike McLagan Structure packing
+ *
+ * 0.20 Mike McLagan New flags for S508 buffer handling
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#ifndef SDLA_H
+#define SDLA_H
+
+/* adapter type */
+#define SDLA_TYPES
+#define SDLA_S502A 5020
+#define SDLA_S502E 5021
+#define SDLA_S503 5030
+#define SDLA_S507 5070
+#define SDLA_S508 5080
+#define SDLA_S509 5090
+#define SDLA_UNKNOWN -1
+
+/* port selection flags for the S508 */
+#define SDLA_S508_PORT_V35 0x00
+#define SDLA_S508_PORT_RS232 0x02
+
+/* Z80 CPU speeds */
+#define SDLA_CPU_3M 0x00
+#define SDLA_CPU_5M 0x01
+#define SDLA_CPU_7M 0x02
+#define SDLA_CPU_8M 0x03
+#define SDLA_CPU_10M 0x04
+#define SDLA_CPU_16M 0x05
+#define SDLA_CPU_12M 0x06
+
+/* some private IOCTLs */
+#define SDLA_IDENTIFY (FRAD_LAST_IOCTL + 1)
+#define SDLA_CPUSPEED (FRAD_LAST_IOCTL + 2)
+#define SDLA_PROTOCOL (FRAD_LAST_IOCTL + 3)
+
+#define SDLA_CLEARMEM (FRAD_LAST_IOCTL + 4)
+#define SDLA_WRITEMEM (FRAD_LAST_IOCTL + 5)
+#define SDLA_READMEM (FRAD_LAST_IOCTL + 6)
+
+struct sdla_mem {
+ int addr;
+ int len;
+ void *data;
+};
+
+#define SDLA_START (FRAD_LAST_IOCTL + 7)
+#define SDLA_STOP (FRAD_LAST_IOCTL + 8)
+
+/* some offsets in the Z80's memory space */
+#define SDLA_NMIADDR 0x0000
+#define SDLA_CONF_ADDR 0x0010
+#define SDLA_S502A_NMIADDR 0x0066
+#define SDLA_CODE_BASEADDR 0x0100
+#define SDLA_WINDOW_SIZE 0x2000
+#define SDLA_ADDR_MASK 0x1FFF
+
+/* largest handleable block of data */
+#define SDLA_MAX_DATA 4080
+#define SDLA_MAX_MTU 4072 /* MAX_DATA - sizeof(fradhdr) */
+#define SDLA_MAX_DLCI 24
+
+/* this should be the same as frad_conf */
+struct sdla_conf {
+ short station;
+ short config;
+ short kbaud;
+ short clocking;
+ short max_frm;
+ short T391;
+ short T392;
+ short N391;
+ short N392;
+ short N393;
+ short CIR_fwd;
+ short Bc_fwd;
+ short Be_fwd;
+ short CIR_bwd;
+ short Bc_bwd;
+ short Be_bwd;
+};
+
+/* this should be the same as dlci_conf */
+struct sdla_dlci_conf {
+ short config;
+ short CIR_fwd;
+ short Bc_fwd;
+ short Be_fwd;
+ short CIR_bwd;
+ short Bc_bwd;
+ short Be_bwd;
+ short Tc_fwd;
+ short Tc_bwd;
+ short Tf_max;
+ short Tb_max;
+};
+
+
+void sdla(void *cfg_info, char *dev, struct frad_conf *conf, int quiet);
+
+
+#endif
diff --git a/sysroot/usr/include/linux/selinux_netlink.h b/sysroot/usr/include/linux/selinux_netlink.h
new file mode 100644
index 0000000..029179f
--- /dev/null
+++ b/sysroot/usr/include/linux/selinux_netlink.h
@@ -0,0 +1,46 @@
+/*
+ * Netlink event notifications for SELinux.
+ *
+ * Author: James Morris <jmorris@redhat.com>
+ *
+ * Copyright (C) 2004 Red Hat, Inc., James Morris <jmorris@redhat.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2,
+ * as published by the Free Software Foundation.
+ */
+#ifndef _LINUX_SELINUX_NETLINK_H
+#define _LINUX_SELINUX_NETLINK_H
+
+/* Message types. */
+#define SELNL_MSG_BASE 0x10
+enum {
+ SELNL_MSG_SETENFORCE = SELNL_MSG_BASE,
+ SELNL_MSG_POLICYLOAD,
+ SELNL_MSG_MAX
+};
+
+/* Multicast groups - backwards compatiblility for userspace */
+#define SELNL_GRP_NONE 0x00000000
+#define SELNL_GRP_AVC 0x00000001 /* AVC notifications */
+#define SELNL_GRP_ALL 0xffffffff
+
+enum selinux_nlgroups {
+ SELNLGRP_NONE,
+#define SELNLGRP_NONE SELNLGRP_NONE
+ SELNLGRP_AVC,
+#define SELNLGRP_AVC SELNLGRP_AVC
+ __SELNLGRP_MAX
+};
+#define SELNLGRP_MAX (__SELNLGRP_MAX - 1)
+
+/* Message structures */
+struct selnl_msg_setenforce {
+ int32_t val;
+};
+
+struct selnl_msg_policyload {
+ u_int32_t seqno;
+};
+
+#endif /* _LINUX_SELINUX_NETLINK_H */
diff --git a/sysroot/usr/include/linux/sem.h b/sysroot/usr/include/linux/sem.h
new file mode 100644
index 0000000..9f1974c
--- /dev/null
+++ b/sysroot/usr/include/linux/sem.h
@@ -0,0 +1,80 @@
+#ifndef _LINUX_SEM_H
+#define _LINUX_SEM_H
+
+#include <linux/ipc.h>
+
+/* semop flags */
+#define SEM_UNDO 0x1000 /* undo the operation on exit */
+
+/* semctl Command Definitions. */
+#define GETPID 11 /* get sempid */
+#define GETVAL 12 /* get semval */
+#define GETALL 13 /* get all semval's */
+#define GETNCNT 14 /* get semncnt */
+#define GETZCNT 15 /* get semzcnt */
+#define SETVAL 16 /* set semval */
+#define SETALL 17 /* set all semval's */
+
+/* ipcs ctl cmds */
+#define SEM_STAT 18
+#define SEM_INFO 19
+
+/* Obsolete, used only for backwards compatibility and libc5 compiles */
+struct semid_ds {
+ struct ipc_perm sem_perm; /* permissions .. see ipc.h */
+ __kernel_time_t sem_otime; /* last semop time */
+ __kernel_time_t sem_ctime; /* last change time */
+ struct sem *sem_base; /* ptr to first semaphore in array */
+ struct sem_queue *sem_pending; /* pending operations to be processed */
+ struct sem_queue **sem_pending_last; /* last pending operation */
+ struct sem_undo *undo; /* undo requests on this array */
+ unsigned short sem_nsems; /* no. of semaphores in array */
+};
+
+/* Include the definition of semid64_ds */
+#include <asm/sembuf.h>
+
+/* semop system calls takes an array of these. */
+struct sembuf {
+ unsigned short sem_num; /* semaphore index in array */
+ short sem_op; /* semaphore operation */
+ short sem_flg; /* operation flags */
+};
+
+/* arg for semctl system calls. */
+union semun {
+ int val; /* value for SETVAL */
+ struct semid_ds *buf; /* buffer for IPC_STAT & IPC_SET */
+ unsigned short *array; /* array for GETALL & SETALL */
+ struct seminfo *__buf; /* buffer for IPC_INFO */
+ void *__pad;
+};
+
+struct seminfo {
+ int semmap;
+ int semmni;
+ int semmns;
+ int semmnu;
+ int semmsl;
+ int semopm;
+ int semume;
+ int semusz;
+ int semvmx;
+ int semaem;
+};
+
+#define SEMMNI 128 /* <= IPCMNI max # of semaphore identifiers */
+#define SEMMSL 250 /* <= 8 000 max num of semaphores per id */
+#define SEMMNS (SEMMNI*SEMMSL) /* <= INT_MAX max # of semaphores in system */
+#define SEMOPM 32 /* <= 1 000 max num of ops per semop call */
+#define SEMVMX 32767 /* <= 32767 semaphore maximum value */
+#define SEMAEM SEMVMX /* adjust on exit max value */
+
+/* unused */
+#define SEMUME SEMOPM /* max num of undo entries per process */
+#define SEMMNU SEMMNS /* num of undo structures system wide */
+#define SEMMAP SEMMNS /* # of entries in semaphore map */
+#define SEMUSZ 20 /* sizeof struct sem_undo */
+
+
+#endif /* _LINUX_SEM_H */
diff --git a/sysroot/usr/include/linux/serial.h b/sysroot/usr/include/linux/serial.h
new file mode 100644
index 0000000..c68a3f2
--- /dev/null
+++ b/sysroot/usr/include/linux/serial.h
@@ -0,0 +1,157 @@
+/*
+ * include/linux/serial.h
+ *
+ * Copyright (C) 1992 by Theodore Ts'o.
+ *
+ * Redistribution of this file is permitted under the terms of the GNU
+ * Public License (GPL)
+ */
+
+#ifndef _LINUX_SERIAL_H
+#define _LINUX_SERIAL_H
+
+
+struct serial_struct {
+ int type;
+ int line;
+ unsigned int port;
+ int irq;
+ int flags;
+ int xmit_fifo_size;
+ int custom_divisor;
+ int baud_base;
+ unsigned short close_delay;
+ char io_type;
+ char reserved_char[1];
+ int hub6;
+ unsigned short closing_wait; /* time to wait before closing */
+ unsigned short closing_wait2; /* no longer used... */
+ unsigned char *iomem_base;
+ unsigned short iomem_reg_shift;
+ unsigned int port_high;
+ unsigned long iomap_base; /* cookie passed into ioremap */
+};
+
+/*
+ * For the close wait times, 0 means wait forever for serial port to
+ * flush its output. 65535 means don't wait at all.
+ */
+#define ASYNC_CLOSING_WAIT_INF 0
+#define ASYNC_CLOSING_WAIT_NONE 65535
+
+/*
+ * These are the supported serial types.
+ */
+#define PORT_UNKNOWN 0
+#define PORT_8250 1
+#define PORT_16450 2
+#define PORT_16550 3
+#define PORT_16550A 4
+#define PORT_CIRRUS 5 /* usurped by cyclades.c */
+#define PORT_16650 6
+#define PORT_16650V2 7
+#define PORT_16750 8
+#define PORT_STARTECH 9 /* usurped by cyclades.c */
+#define PORT_16C950 10 /* Oxford Semiconductor */
+#define PORT_16654 11
+#define PORT_16850 12
+#define PORT_RSA 13 /* RSA-DV II/S card */
+#define PORT_MAX 13
+
+#define SERIAL_IO_PORT 0
+#define SERIAL_IO_HUB6 1
+#define SERIAL_IO_MEM 2
+
+struct serial_uart_config {
+ char *name;
+ int dfl_xmit_fifo_size;
+ int flags;
+};
+
+#define UART_CLEAR_FIFO 0x01
+#define UART_USE_FIFO 0x02
+#define UART_STARTECH 0x04
+#define UART_NATSEMI 0x08
+
+/*
+ * Definitions for async_struct (and serial_struct) flags field
+ */
+#define ASYNC_HUP_NOTIFY 0x0001 /* Notify getty on hangups and closes
+ on the callout port */
+#define ASYNC_FOURPORT 0x0002 /* Set OU1, OUT2 per AST Fourport settings */
+#define ASYNC_SAK 0x0004 /* Secure Attention Key (Orange book) */
+#define ASYNC_SPLIT_TERMIOS 0x0008 /* Separate termios for dialin/callout */
+
+#define ASYNC_SPD_MASK 0x1030
+#define ASYNC_SPD_HI 0x0010 /* Use 56000 instead of 38400 bps */
+
+#define ASYNC_SPD_VHI 0x0020 /* Use 115200 instead of 38400 bps */
+#define ASYNC_SPD_CUST 0x0030 /* Use user-specified divisor */
+
+#define ASYNC_SKIP_TEST 0x0040 /* Skip UART test during autoconfiguration */
+#define ASYNC_AUTO_IRQ 0x0080 /* Do automatic IRQ during autoconfiguration */
+#define ASYNC_SESSION_LOCKOUT 0x0100 /* Lock out cua opens based on session */
+#define ASYNC_PGRP_LOCKOUT 0x0200 /* Lock out cua opens based on pgrp */
+#define ASYNC_CALLOUT_NOHUP 0x0400 /* Don't do hangups for cua device */
+
+#define ASYNC_HARDPPS_CD 0x0800 /* Call hardpps when CD goes high */
+
+#define ASYNC_SPD_SHI 0x1000 /* Use 230400 instead of 38400 bps */
+#define ASYNC_SPD_WARP 0x1010 /* Use 460800 instead of 38400 bps */
+
+#define ASYNC_LOW_LATENCY 0x2000 /* Request low latency behaviour */
+
+#define ASYNC_BUGGY_UART 0x4000 /* This is a buggy UART, skip some safety
+ * checks. Note: can be dangerous! */
+
+#define ASYNC_AUTOPROBE 0x8000 /* Port was autoprobed by PCI or PNP code */
+
+#define ASYNC_FLAGS 0x7FFF /* Possible legal async flags */
+#define ASYNC_USR_MASK 0x3430 /* Legal flags that non-privileged
+ * users can set or reset */
+
+/* Internal flags used only by kernel/chr_drv/serial.c */
+#define ASYNC_INITIALIZED 0x80000000 /* Serial port was initialized */
+#define ASYNC_NORMAL_ACTIVE 0x20000000 /* Normal device is active */
+#define ASYNC_BOOT_AUTOCONF 0x10000000 /* Autoconfigure port on bootup */
+#define ASYNC_CLOSING 0x08000000 /* Serial port is closing */
+#define ASYNC_CTS_FLOW 0x04000000 /* Do CTS flow control */
+#define ASYNC_CHECK_CD 0x02000000 /* i.e., CLOCAL */
+#define ASYNC_SHARE_IRQ 0x01000000 /* for multifunction cards
+ --- no longer used */
+#define ASYNC_CONS_FLOW 0x00800000 /* flow control for console */
+
+#define ASYNC_BOOT_ONLYMCA 0x00400000 /* Probe only if MCA bus */
+#define ASYNC_INTERNAL_FLAGS 0xFFC00000 /* Internal flags */
+
+/*
+ * Multiport serial configuration structure --- external structure
+ */
+struct serial_multiport_struct {
+ int irq;
+ int port1;
+ unsigned char mask1, match1;
+ int port2;
+ unsigned char mask2, match2;
+ int port3;
+ unsigned char mask3, match3;
+ int port4;
+ unsigned char mask4, match4;
+ int port_monitor;
+ int reserved[32];
+};
+
+/*
+ * Serial input interrupt line counters -- external structure
+ * Four lines can interrupt: CTS, DSR, RI, DCD
+ */
+struct serial_icounter_struct {
+ int cts, dsr, rng, dcd;
+ int rx, tx;
+ int frame, overrun, parity, brk;
+ int buf_overrun;
+ int reserved[9];
+};
+
+
+#endif /* _LINUX_SERIAL_H */
diff --git a/sysroot/usr/include/linux/serial_core.h b/sysroot/usr/include/linux/serial_core.h
new file mode 100644
index 0000000..8635bd5
--- /dev/null
+++ b/sysroot/usr/include/linux/serial_core.h
@@ -0,0 +1,154 @@
+/*
+ * linux/drivers/char/serial_core.h
+ *
+ * Copyright (C) 2000 Deep Blue Solutions Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#ifndef LINUX_SERIAL_CORE_H
+#define LINUX_SERIAL_CORE_H
+
+/*
+ * The type definitions. These are from Ted Ts'o's serial.h
+ */
+#define PORT_UNKNOWN 0
+#define PORT_8250 1
+#define PORT_16450 2
+#define PORT_16550 3
+#define PORT_16550A 4
+#define PORT_CIRRUS 5
+#define PORT_16650 6
+#define PORT_16650V2 7
+#define PORT_16750 8
+#define PORT_STARTECH 9
+#define PORT_16C950 10
+#define PORT_16654 11
+#define PORT_16850 12
+#define PORT_RSA 13
+#define PORT_NS16550A 14
+#define PORT_XSCALE 15
+#define PORT_RM9000 16 /* PMC-Sierra RM9xxx internal UART */
+#define PORT_MAX_8250 16 /* max port ID */
+
+/*
+ * ARM specific type numbers. These are not currently guaranteed
+ * to be implemented, and will change in the future. These are
+ * separate so any additions to the old serial.c that occur before
+ * we are merged can be easily merged here.
+ */
+#define PORT_PXA 31
+#define PORT_AMBA 32
+#define PORT_CLPS711X 33
+#define PORT_SA1100 34
+#define PORT_UART00 35
+#define PORT_21285 37
+
+/* Sparc type numbers. */
+#define PORT_SUNZILOG 38
+#define PORT_SUNSAB 39
+
+/* NEC v850. */
+#define PORT_V850E_UART 40
+
+/* DEC */
+#define PORT_DZ 46
+#define PORT_ZS 47
+
+/* Parisc type numbers. */
+#define PORT_MUX 48
+
+/* Atmel AT91 / AT32 SoC */
+#define PORT_ATMEL 49
+
+/* Macintosh Zilog type numbers */
+#define PORT_MAC_ZILOG 50 /* m68k : not yet implemented */
+#define PORT_PMAC_ZILOG 51
+
+/* SH-SCI */
+#define PORT_SCI 52
+#define PORT_SCIF 53
+#define PORT_IRDA 54
+
+/* Samsung S3C2410 SoC and derivatives thereof */
+#define PORT_S3C2410 55
+
+/* SGI IP22 aka Indy / Challenge S / Indigo 2 */
+#define PORT_IP22ZILOG 56
+
+/* Sharp LH7a40x -- an ARM9 SoC series */
+#define PORT_LH7A40X 57
+
+/* PPC CPM type number */
+#define PORT_CPM 58
+
+/* MPC52xx type numbers */
+#define PORT_MPC52xx 59
+
+/* IBM icom */
+#define PORT_ICOM 60
+
+/* Samsung S3C2440 SoC */
+#define PORT_S3C2440 61
+
+/* Motorola i.MX SoC */
+#define PORT_IMX 62
+
+/* Marvell MPSC */
+#define PORT_MPSC 63
+
+/* TXX9 type number */
+#define PORT_TXX9 64
+
+/* NEC VR4100 series SIU/DSIU */
+#define PORT_VR41XX_SIU 65
+#define PORT_VR41XX_DSIU 66
+
+/* Samsung S3C2400 SoC */
+#define PORT_S3C2400 67
+
+/* M32R SIO */
+#define PORT_M32R_SIO 68
+
+/*Digi jsm */
+#define PORT_JSM 69
+
+#define PORT_PNX8XXX 70
+
+/* Hilscher netx */
+#define PORT_NETX 71
+
+/* SUN4V Hypervisor Console */
+#define PORT_SUNHV 72
+
+#define PORT_S3C2412 73
+
+/* Xilinx uartlite */
+#define PORT_UARTLITE 74
+
+/* Blackfin bf5xx */
+#define PORT_BFIN 75
+
+/* Micrel KS8695 */
+#define PORT_KS8695 76
+
+/* Broadcom SB1250, etc. SOC */
+#define PORT_SB1250_DUART 77
+
+/* Freescale ColdFire */
+#define PORT_MCF 78
+
+
+
+#endif /* LINUX_SERIAL_CORE_H */
diff --git a/sysroot/usr/include/linux/serial_reg.h b/sysroot/usr/include/linux/serial_reg.h
new file mode 100644
index 0000000..96c0d93
--- /dev/null
+++ b/sysroot/usr/include/linux/serial_reg.h
@@ -0,0 +1,328 @@
+/*
+ * include/linux/serial_reg.h
+ *
+ * Copyright (C) 1992, 1994 by Theodore Ts'o.
+ *
+ * Redistribution of this file is permitted under the terms of the GNU
+ * Public License (GPL)
+ *
+ * These are the UART port assignments, expressed as offsets from the base
+ * register. These assignments should hold for any serial port based on
+ * a 8250, 16450, or 16550(A).
+ */
+
+#ifndef _LINUX_SERIAL_REG_H
+#define _LINUX_SERIAL_REG_H
+
+/*
+ * DLAB=0
+ */
+#define UART_RX 0 /* In: Receive buffer */
+#define UART_TX 0 /* Out: Transmit buffer */
+
+#define UART_IER 1 /* Out: Interrupt Enable Register */
+#define UART_IER_MSI 0x08 /* Enable Modem status interrupt */
+#define UART_IER_RLSI 0x04 /* Enable receiver line status interrupt */
+#define UART_IER_THRI 0x02 /* Enable Transmitter holding register int. */
+#define UART_IER_RDI 0x01 /* Enable receiver data interrupt */
+/*
+ * Sleep mode for ST16650 and TI16750. For the ST16650, EFR[4]=1
+ */
+#define UART_IERX_SLEEP 0x10 /* Enable sleep mode */
+
+#define UART_IIR 2 /* In: Interrupt ID Register */
+#define UART_IIR_NO_INT 0x01 /* No interrupts pending */
+#define UART_IIR_ID 0x06 /* Mask for the interrupt ID */
+#define UART_IIR_MSI 0x00 /* Modem status interrupt */
+#define UART_IIR_THRI 0x02 /* Transmitter holding register empty */
+#define UART_IIR_RDI 0x04 /* Receiver data interrupt */
+#define UART_IIR_RLSI 0x06 /* Receiver line status interrupt */
+
+#define UART_IIR_BUSY 0x07 /* DesignWare APB Busy Detect */
+
+#define UART_FCR 2 /* Out: FIFO Control Register */
+#define UART_FCR_ENABLE_FIFO 0x01 /* Enable the FIFO */
+#define UART_FCR_CLEAR_RCVR 0x02 /* Clear the RCVR FIFO */
+#define UART_FCR_CLEAR_XMIT 0x04 /* Clear the XMIT FIFO */
+#define UART_FCR_DMA_SELECT 0x08 /* For DMA applications */
+/*
+ * Note: The FIFO trigger levels are chip specific:
+ * RX:76 = 00 01 10 11 TX:54 = 00 01 10 11
+ * PC16550D: 1 4 8 14 xx xx xx xx
+ * TI16C550A: 1 4 8 14 xx xx xx xx
+ * TI16C550C: 1 4 8 14 xx xx xx xx
+ * ST16C550: 1 4 8 14 xx xx xx xx
+ * ST16C650: 8 16 24 28 16 8 24 30 PORT_16650V2
+ * NS16C552: 1 4 8 14 xx xx xx xx
+ * ST16C654: 8 16 56 60 8 16 32 56 PORT_16654
+ * TI16C750: 1 16 32 56 xx xx xx xx PORT_16750
+ * TI16C752: 8 16 56 60 8 16 32 56
+ */
+#define UART_FCR_R_TRIG_00 0x00
+#define UART_FCR_R_TRIG_01 0x40
+#define UART_FCR_R_TRIG_10 0x80
+#define UART_FCR_R_TRIG_11 0xc0
+#define UART_FCR_T_TRIG_00 0x00
+#define UART_FCR_T_TRIG_01 0x10
+#define UART_FCR_T_TRIG_10 0x20
+#define UART_FCR_T_TRIG_11 0x30
+
+#define UART_FCR_TRIGGER_MASK 0xC0 /* Mask for the FIFO trigger range */
+#define UART_FCR_TRIGGER_1 0x00 /* Mask for trigger set at 1 */
+#define UART_FCR_TRIGGER_4 0x40 /* Mask for trigger set at 4 */
+#define UART_FCR_TRIGGER_8 0x80 /* Mask for trigger set at 8 */
+#define UART_FCR_TRIGGER_14 0xC0 /* Mask for trigger set at 14 */
+/* 16650 definitions */
+#define UART_FCR6_R_TRIGGER_8 0x00 /* Mask for receive trigger set at 1 */
+#define UART_FCR6_R_TRIGGER_16 0x40 /* Mask for receive trigger set at 4 */
+#define UART_FCR6_R_TRIGGER_24 0x80 /* Mask for receive trigger set at 8 */
+#define UART_FCR6_R_TRIGGER_28 0xC0 /* Mask for receive trigger set at 14 */
+#define UART_FCR6_T_TRIGGER_16 0x00 /* Mask for transmit trigger set at 16 */
+#define UART_FCR6_T_TRIGGER_8 0x10 /* Mask for transmit trigger set at 8 */
+#define UART_FCR6_T_TRIGGER_24 0x20 /* Mask for transmit trigger set at 24 */
+#define UART_FCR6_T_TRIGGER_30 0x30 /* Mask for transmit trigger set at 30 */
+#define UART_FCR7_64BYTE 0x20 /* Go into 64 byte mode (TI16C750) */
+
+#define UART_LCR 3 /* Out: Line Control Register */
+/*
+ * Note: if the word length is 5 bits (UART_LCR_WLEN5), then setting
+ * UART_LCR_STOP will select 1.5 stop bits, not 2 stop bits.
+ */
+#define UART_LCR_DLAB 0x80 /* Divisor latch access bit */
+#define UART_LCR_SBC 0x40 /* Set break control */
+#define UART_LCR_SPAR 0x20 /* Stick parity (?) */
+#define UART_LCR_EPAR 0x10 /* Even parity select */
+#define UART_LCR_PARITY 0x08 /* Parity Enable */
+#define UART_LCR_STOP 0x04 /* Stop bits: 0=1 bit, 1=2 bits */
+#define UART_LCR_WLEN5 0x00 /* Wordlength: 5 bits */
+#define UART_LCR_WLEN6 0x01 /* Wordlength: 6 bits */
+#define UART_LCR_WLEN7 0x02 /* Wordlength: 7 bits */
+#define UART_LCR_WLEN8 0x03 /* Wordlength: 8 bits */
+
+#define UART_MCR 4 /* Out: Modem Control Register */
+#define UART_MCR_CLKSEL 0x80 /* Divide clock by 4 (TI16C752, EFR[4]=1) */
+#define UART_MCR_TCRTLR 0x40 /* Access TCR/TLR (TI16C752, EFR[4]=1) */
+#define UART_MCR_XONANY 0x20 /* Enable Xon Any (TI16C752, EFR[4]=1) */
+#define UART_MCR_AFE 0x20 /* Enable auto-RTS/CTS (TI16C550C/TI16C750) */
+#define UART_MCR_LOOP 0x10 /* Enable loopback test mode */
+#define UART_MCR_OUT2 0x08 /* Out2 complement */
+#define UART_MCR_OUT1 0x04 /* Out1 complement */
+#define UART_MCR_RTS 0x02 /* RTS complement */
+#define UART_MCR_DTR 0x01 /* DTR complement */
+
+#define UART_LSR 5 /* In: Line Status Register */
+#define UART_LSR_TEMT 0x40 /* Transmitter empty */
+#define UART_LSR_THRE 0x20 /* Transmit-hold-register empty */
+#define UART_LSR_BI 0x10 /* Break interrupt indicator */
+#define UART_LSR_FE 0x08 /* Frame error indicator */
+#define UART_LSR_PE 0x04 /* Parity error indicator */
+#define UART_LSR_OE 0x02 /* Overrun error indicator */
+#define UART_LSR_DR 0x01 /* Receiver data ready */
+#define UART_LSR_BRK_ERROR_BITS 0x1E /* BI, FE, PE, OE bits */
+
+#define UART_MSR 6 /* In: Modem Status Register */
+#define UART_MSR_DCD 0x80 /* Data Carrier Detect */
+#define UART_MSR_RI 0x40 /* Ring Indicator */
+#define UART_MSR_DSR 0x20 /* Data Set Ready */
+#define UART_MSR_CTS 0x10 /* Clear to Send */
+#define UART_MSR_DDCD 0x08 /* Delta DCD */
+#define UART_MSR_TERI 0x04 /* Trailing edge ring indicator */
+#define UART_MSR_DDSR 0x02 /* Delta DSR */
+#define UART_MSR_DCTS 0x01 /* Delta CTS */
+#define UART_MSR_ANY_DELTA 0x0F /* Any of the delta bits! */
+
+#define UART_SCR 7 /* I/O: Scratch Register */
+
+/*
+ * DLAB=1
+ */
+#define UART_DLL 0 /* Out: Divisor Latch Low */
+#define UART_DLM 1 /* Out: Divisor Latch High */
+
+/*
+ * LCR=0xBF (or DLAB=1 for 16C660)
+ */
+#define UART_EFR 2 /* I/O: Extended Features Register */
+#define UART_EFR_CTS 0x80 /* CTS flow control */
+#define UART_EFR_RTS 0x40 /* RTS flow control */
+#define UART_EFR_SCD 0x20 /* Special character detect */
+#define UART_EFR_ECB 0x10 /* Enhanced control bit */
+/*
+ * the low four bits control software flow control
+ */
+
+/*
+ * LCR=0xBF, TI16C752, ST16650, ST16650A, ST16654
+ */
+#define UART_XON1 4 /* I/O: Xon character 1 */
+#define UART_XON2 5 /* I/O: Xon character 2 */
+#define UART_XOFF1 6 /* I/O: Xoff character 1 */
+#define UART_XOFF2 7 /* I/O: Xoff character 2 */
+
+/*
+ * EFR[4]=1 MCR[6]=1, TI16C752
+ */
+#define UART_TI752_TCR 6 /* I/O: transmission control register */
+#define UART_TI752_TLR 7 /* I/O: trigger level register */
+
+/*
+ * LCR=0xBF, XR16C85x
+ */
+#define UART_TRG 0 /* FCTR bit 7 selects Rx or Tx
+ * In: Fifo count
+ * Out: Fifo custom trigger levels */
+/*
+ * These are the definitions for the Programmable Trigger Register
+ */
+#define UART_TRG_1 0x01
+#define UART_TRG_4 0x04
+#define UART_TRG_8 0x08
+#define UART_TRG_16 0x10
+#define UART_TRG_32 0x20
+#define UART_TRG_64 0x40
+#define UART_TRG_96 0x60
+#define UART_TRG_120 0x78
+#define UART_TRG_128 0x80
+
+#define UART_FCTR 1 /* Feature Control Register */
+#define UART_FCTR_RTS_NODELAY 0x00 /* RTS flow control delay */
+#define UART_FCTR_RTS_4DELAY 0x01
+#define UART_FCTR_RTS_6DELAY 0x02
+#define UART_FCTR_RTS_8DELAY 0x03
+#define UART_FCTR_IRDA 0x04 /* IrDa data encode select */
+#define UART_FCTR_TX_INT 0x08 /* Tx interrupt type select */
+#define UART_FCTR_TRGA 0x00 /* Tx/Rx 550 trigger table select */
+#define UART_FCTR_TRGB 0x10 /* Tx/Rx 650 trigger table select */
+#define UART_FCTR_TRGC 0x20 /* Tx/Rx 654 trigger table select */
+#define UART_FCTR_TRGD 0x30 /* Tx/Rx 850 programmable trigger select */
+#define UART_FCTR_SCR_SWAP 0x40 /* Scratch pad register swap */
+#define UART_FCTR_RX 0x00 /* Programmable trigger mode select */
+#define UART_FCTR_TX 0x80 /* Programmable trigger mode select */
+
+/*
+ * LCR=0xBF, FCTR[6]=1
+ */
+#define UART_EMSR 7 /* Extended Mode Select Register */
+#define UART_EMSR_FIFO_COUNT 0x01 /* Rx/Tx select */
+#define UART_EMSR_ALT_COUNT 0x02 /* Alternating count select */
+
+/*
+ * The Intel XScale on-chip UARTs define these bits
+ */
+#define UART_IER_DMAE 0x80 /* DMA Requests Enable */
+#define UART_IER_UUE 0x40 /* UART Unit Enable */
+#define UART_IER_NRZE 0x20 /* NRZ coding Enable */
+#define UART_IER_RTOIE 0x10 /* Receiver Time Out Interrupt Enable */
+
+#define UART_IIR_TOD 0x08 /* Character Timeout Indication Detected */
+
+#define UART_FCR_PXAR1 0x00 /* receive FIFO treshold = 1 */
+#define UART_FCR_PXAR8 0x40 /* receive FIFO treshold = 8 */
+#define UART_FCR_PXAR16 0x80 /* receive FIFO treshold = 16 */
+#define UART_FCR_PXAR32 0xc0 /* receive FIFO treshold = 32 */
+
+
+
+
+/*
+ * These register definitions are for the 16C950
+ */
+#define UART_ASR 0x01 /* Additional Status Register */
+#define UART_RFL 0x03 /* Receiver FIFO level */
+#define UART_TFL 0x04 /* Transmitter FIFO level */
+#define UART_ICR 0x05 /* Index Control Register */
+
+/* The 16950 ICR registers */
+#define UART_ACR 0x00 /* Additional Control Register */
+#define UART_CPR 0x01 /* Clock Prescalar Register */
+#define UART_TCR 0x02 /* Times Clock Register */
+#define UART_CKS 0x03 /* Clock Select Register */
+#define UART_TTL 0x04 /* Transmitter Interrupt Trigger Level */
+#define UART_RTL 0x05 /* Receiver Interrupt Trigger Level */
+#define UART_FCL 0x06 /* Flow Control Level Lower */
+#define UART_FCH 0x07 /* Flow Control Level Higher */
+#define UART_ID1 0x08 /* ID #1 */
+#define UART_ID2 0x09 /* ID #2 */
+#define UART_ID3 0x0A /* ID #3 */
+#define UART_REV 0x0B /* Revision */
+#define UART_CSR 0x0C /* Channel Software Reset */
+#define UART_NMR 0x0D /* Nine-bit Mode Register */
+#define UART_CTR 0xFF
+
+/*
+ * The 16C950 Additional Control Register
+ */
+#define UART_ACR_RXDIS 0x01 /* Receiver disable */
+#define UART_ACR_TXDIS 0x02 /* Transmitter disable */
+#define UART_ACR_DSRFC 0x04 /* DSR Flow Control */
+#define UART_ACR_TLENB 0x20 /* 950 trigger levels enable */
+#define UART_ACR_ICRRD 0x40 /* ICR Read enable */
+#define UART_ACR_ASREN 0x80 /* Additional status enable */
+
+
+
+/*
+ * These definitions are for the RSA-DV II/S card, from
+ *
+ * Kiyokazu SUTO <suto@ks-and-ks.ne.jp>
+ */
+
+#define UART_RSA_BASE (-8)
+
+#define UART_RSA_MSR ((UART_RSA_BASE) + 0) /* I/O: Mode Select Register */
+
+#define UART_RSA_MSR_SWAP (1 << 0) /* Swap low/high 8 bytes in I/O port addr */
+#define UART_RSA_MSR_FIFO (1 << 2) /* Enable the external FIFO */
+#define UART_RSA_MSR_FLOW (1 << 3) /* Enable the auto RTS/CTS flow control */
+#define UART_RSA_MSR_ITYP (1 << 4) /* Level (1) / Edge triger (0) */
+
+#define UART_RSA_IER ((UART_RSA_BASE) + 1) /* I/O: Interrupt Enable Register */
+
+#define UART_RSA_IER_Rx_FIFO_H (1 << 0) /* Enable Rx FIFO half full int. */
+#define UART_RSA_IER_Tx_FIFO_H (1 << 1) /* Enable Tx FIFO half full int. */
+#define UART_RSA_IER_Tx_FIFO_E (1 << 2) /* Enable Tx FIFO empty int. */
+#define UART_RSA_IER_Rx_TOUT (1 << 3) /* Enable char receive timeout int */
+#define UART_RSA_IER_TIMER (1 << 4) /* Enable timer interrupt */
+
+#define UART_RSA_SRR ((UART_RSA_BASE) + 2) /* IN: Status Read Register */
+
+#define UART_RSA_SRR_Tx_FIFO_NEMP (1 << 0) /* Tx FIFO is not empty (1) */
+#define UART_RSA_SRR_Tx_FIFO_NHFL (1 << 1) /* Tx FIFO is not half full (1) */
+#define UART_RSA_SRR_Tx_FIFO_NFUL (1 << 2) /* Tx FIFO is not full (1) */
+#define UART_RSA_SRR_Rx_FIFO_NEMP (1 << 3) /* Rx FIFO is not empty (1) */
+#define UART_RSA_SRR_Rx_FIFO_NHFL (1 << 4) /* Rx FIFO is not half full (1) */
+#define UART_RSA_SRR_Rx_FIFO_NFUL (1 << 5) /* Rx FIFO is not full (1) */
+#define UART_RSA_SRR_Rx_TOUT (1 << 6) /* Character reception timeout occurred (1) */
+#define UART_RSA_SRR_TIMER (1 << 7) /* Timer interrupt occurred */
+
+#define UART_RSA_FRR ((UART_RSA_BASE) + 2) /* OUT: FIFO Reset Register */
+
+#define UART_RSA_TIVSR ((UART_RSA_BASE) + 3) /* I/O: Timer Interval Value Set Register */
+
+#define UART_RSA_TCR ((UART_RSA_BASE) + 4) /* OUT: Timer Control Register */
+
+#define UART_RSA_TCR_SWITCH (1 << 0) /* Timer on */
+
+/*
+ * The RSA DSV/II board has two fixed clock frequencies. One is the
+ * standard rate, and the other is 8 times faster.
+ */
+#define SERIAL_RSA_BAUD_BASE (921600)
+#define SERIAL_RSA_BAUD_BASE_LO (SERIAL_RSA_BAUD_BASE / 8)
+
+/*
+ * Extra serial register definitions for the internal UARTs
+ * in TI OMAP processors.
+ */
+#define UART_OMAP_MDR1 0x08 /* Mode definition register */
+#define UART_OMAP_MDR2 0x09 /* Mode definition register 2 */
+#define UART_OMAP_SCR 0x10 /* Supplementary control register */
+#define UART_OMAP_SSR 0x11 /* Supplementary status register */
+#define UART_OMAP_EBLR 0x12 /* BOF length register */
+#define UART_OMAP_OSC_12M_SEL 0x13 /* OMAP1510 12MHz osc select */
+#define UART_OMAP_MVER 0x14 /* Module version register */
+#define UART_OMAP_SYSC 0x15 /* System configuration register */
+#define UART_OMAP_SYSS 0x16 /* System status register */
+
+#endif /* _LINUX_SERIAL_REG_H */
+
diff --git a/sysroot/usr/include/linux/serio.h b/sysroot/usr/include/linux/serio.h
new file mode 100644
index 0000000..d987e09
--- /dev/null
+++ b/sysroot/usr/include/linux/serio.h
@@ -0,0 +1,72 @@
+#ifndef _SERIO_H
+#define _SERIO_H
+
+/*
+ * Copyright (C) 1999-2002 Vojtech Pavlik
+*
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+
+#include <linux/ioctl.h>
+
+#define SPIOCSTYPE _IOW('q', 0x01, unsigned long)
+
+
+/*
+ * bit masks for use in "interrupt" flags (3rd argument)
+ */
+#define SERIO_TIMEOUT 1
+#define SERIO_PARITY 2
+#define SERIO_FRAME 4
+
+/*
+ * Serio types
+ */
+#define SERIO_XT 0x00
+#define SERIO_8042 0x01
+#define SERIO_RS232 0x02
+#define SERIO_HIL_MLC 0x03
+#define SERIO_PS_PSTHRU 0x05
+#define SERIO_8042_XL 0x06
+
+/*
+ * Serio types
+ */
+#define SERIO_UNKNOWN 0x00
+#define SERIO_MSC 0x01
+#define SERIO_SUN 0x02
+#define SERIO_MS 0x03
+#define SERIO_MP 0x04
+#define SERIO_MZ 0x05
+#define SERIO_MZP 0x06
+#define SERIO_MZPP 0x07
+#define SERIO_VSXXXAA 0x08
+#define SERIO_SUNKBD 0x10
+#define SERIO_WARRIOR 0x18
+#define SERIO_SPACEORB 0x19
+#define SERIO_MAGELLAN 0x1a
+#define SERIO_SPACEBALL 0x1b
+#define SERIO_GUNZE 0x1c
+#define SERIO_IFORCE 0x1d
+#define SERIO_STINGER 0x1e
+#define SERIO_NEWTON 0x1f
+#define SERIO_STOWAWAY 0x20
+#define SERIO_H3600 0x21
+#define SERIO_PS2SER 0x22
+#define SERIO_TWIDKBD 0x23
+#define SERIO_TWIDJOY 0x24
+#define SERIO_HIL 0x25
+#define SERIO_SNES232 0x26
+#define SERIO_SEMTECH 0x27
+#define SERIO_LKKBD 0x28
+#define SERIO_ELO 0x29
+#define SERIO_MICROTOUCH 0x30
+#define SERIO_PENMOUNT 0x31
+#define SERIO_TOUCHRIGHT 0x32
+#define SERIO_TOUCHWIN 0x33
+#define SERIO_TAOSEVM 0x34
+#define SERIO_FUJITSU 0x35
+
+#endif
diff --git a/sysroot/usr/include/linux/shm.h b/sysroot/usr/include/linux/shm.h
new file mode 100644
index 0000000..48bf876
--- /dev/null
+++ b/sysroot/usr/include/linux/shm.h
@@ -0,0 +1,75 @@
+#ifndef _LINUX_SHM_H_
+#define _LINUX_SHM_H_
+
+#include <linux/ipc.h>
+#include <linux/errno.h>
+#include <asm/page.h>
+
+/*
+ * SHMMAX, SHMMNI and SHMALL are upper limits are defaults which can
+ * be increased by sysctl
+ */
+
+#define SHMMAX 0x2000000 /* max shared seg size (bytes) */
+#define SHMMIN 1 /* min shared seg size (bytes) */
+#define SHMMNI 4096 /* max num of segs system wide */
+#define SHMALL (SHMMAX/PAGE_SIZE*(SHMMNI/16)) /* max shm system wide (pages) */
+#define SHMSEG SHMMNI /* max shared segs per process */
+
+
+/* Obsolete, used only for backwards compatibility and libc5 compiles */
+struct shmid_ds {
+ struct ipc_perm shm_perm; /* operation perms */
+ int shm_segsz; /* size of segment (bytes) */
+ __kernel_time_t shm_atime; /* last attach time */
+ __kernel_time_t shm_dtime; /* last detach time */
+ __kernel_time_t shm_ctime; /* last change time */
+ __kernel_ipc_pid_t shm_cpid; /* pid of creator */
+ __kernel_ipc_pid_t shm_lpid; /* pid of last operator */
+ unsigned short shm_nattch; /* no. of current attaches */
+ unsigned short shm_unused; /* compatibility */
+ void *shm_unused2; /* ditto - used by DIPC */
+ void *shm_unused3; /* unused */
+};
+
+/* Include the definition of shmid64_ds and shminfo64 */
+#include <asm/shmbuf.h>
+
+/* permission flag for shmget */
+#define SHM_R 0400 /* or S_IRUGO from <linux/stat.h> */
+#define SHM_W 0200 /* or S_IWUGO from <linux/stat.h> */
+
+/* mode for attach */
+#define SHM_RDONLY 010000 /* read-only access */
+#define SHM_RND 020000 /* round attach address to SHMLBA boundary */
+#define SHM_REMAP 040000 /* take-over region on attach */
+#define SHM_EXEC 0100000 /* execution access */
+
+/* super user shmctl commands */
+#define SHM_LOCK 11
+#define SHM_UNLOCK 12
+
+/* ipcs ctl commands */
+#define SHM_STAT 13
+#define SHM_INFO 14
+
+/* Obsolete, used only for backwards compatibility */
+struct shminfo {
+ int shmmax;
+ int shmmin;
+ int shmmni;
+ int shmseg;
+ int shmall;
+};
+
+struct shm_info {
+ int used_ids;
+ unsigned long shm_tot; /* total allocated shm */
+ unsigned long shm_rss; /* total resident shm */
+ unsigned long shm_swp; /* total swapped shm */
+ unsigned long swap_attempts;
+ unsigned long swap_successes;
+};
+
+
+#endif /* _LINUX_SHM_H_ */
diff --git a/sysroot/usr/include/linux/signal.h b/sysroot/usr/include/linux/signal.h
new file mode 100644
index 0000000..0bb69d8
--- /dev/null
+++ b/sysroot/usr/include/linux/signal.h
@@ -0,0 +1,8 @@
+#ifndef _LINUX_SIGNAL_H
+#define _LINUX_SIGNAL_H
+
+#include <asm/signal.h>
+#include <asm/siginfo.h>
+
+
+#endif /* _LINUX_SIGNAL_H */
diff --git a/sysroot/usr/include/linux/signalfd.h b/sysroot/usr/include/linux/signalfd.h
new file mode 100644
index 0000000..34a32b4
--- /dev/null
+++ b/sysroot/usr/include/linux/signalfd.h
@@ -0,0 +1,45 @@
+/*
+ * include/linux/signalfd.h
+ *
+ * Copyright (C) 2007 Davide Libenzi <davidel@xmailserver.org>
+ *
+ */
+
+#ifndef _LINUX_SIGNALFD_H
+#define _LINUX_SIGNALFD_H
+
+
+struct signalfd_siginfo {
+ __u32 ssi_signo;
+ __s32 ssi_errno;
+ __s32 ssi_code;
+ __u32 ssi_pid;
+ __u32 ssi_uid;
+ __s32 ssi_fd;
+ __u32 ssi_tid;
+ __u32 ssi_band;
+ __u32 ssi_overrun;
+ __u32 ssi_trapno;
+ __s32 ssi_status;
+ __s32 ssi_int;
+ __u64 ssi_ptr;
+ __u64 ssi_utime;
+ __u64 ssi_stime;
+ __u64 ssi_addr;
+
+ /*
+ * Pad strcture to 128 bytes. Remember to update the
+ * pad size when you add new memebers. We use a fixed
+ * size structure to avoid compatibility problems with
+ * future versions, and we leave extra space for additional
+ * members. We use fixed size members because this strcture
+ * comes out of a read(2) and we really don't want to have
+ * a compat on read(2).
+ */
+ __u8 __pad[48];
+};
+
+
+
+#endif /* _LINUX_SIGNALFD_H */
+
diff --git a/sysroot/usr/include/linux/smb.h b/sysroot/usr/include/linux/smb.h
new file mode 100644
index 0000000..9c94ad5
--- /dev/null
+++ b/sysroot/usr/include/linux/smb.h
@@ -0,0 +1,64 @@
+/*
+ * smb.h
+ *
+ * Copyright (C) 1995, 1996 by Paal-Kr. Engstad and Volker Lendecke
+ * Copyright (C) 1997 by Volker Lendecke
+ *
+ */
+
+#ifndef _LINUX_SMB_H
+#define _LINUX_SMB_H
+
+#include <linux/types.h>
+#include <linux/magic.h>
+
+enum smb_protocol {
+ SMB_PROTOCOL_NONE,
+ SMB_PROTOCOL_CORE,
+ SMB_PROTOCOL_COREPLUS,
+ SMB_PROTOCOL_LANMAN1,
+ SMB_PROTOCOL_LANMAN2,
+ SMB_PROTOCOL_NT1
+};
+
+enum smb_case_hndl {
+ SMB_CASE_DEFAULT,
+ SMB_CASE_LOWER,
+ SMB_CASE_UPPER
+};
+
+struct smb_dskattr {
+ __u16 total;
+ __u16 allocblocks;
+ __u16 blocksize;
+ __u16 free;
+};
+
+struct smb_conn_opt {
+
+ /* The socket */
+ unsigned int fd;
+
+ enum smb_protocol protocol;
+ enum smb_case_hndl case_handling;
+
+ /* Connection-Options */
+
+ __u32 max_xmit;
+ __u16 server_uid;
+ __u16 tid;
+
+ /* The following are LANMAN 1.0 options */
+ __u16 secmode;
+ __u16 maxmux;
+ __u16 maxvcs;
+ __u16 rawmode;
+ __u32 sesskey;
+
+ /* The following are NT LM 0.12 options */
+ __u32 maxraw;
+ __u32 capabilities;
+ __s16 serverzone;
+};
+
+#endif
diff --git a/sysroot/usr/include/linux/smb_fs.h b/sysroot/usr/include/linux/smb_fs.h
new file mode 100644
index 0000000..b7e9450
--- /dev/null
+++ b/sysroot/usr/include/linux/smb_fs.h
@@ -0,0 +1,25 @@
+/*
+ * smb_fs.h
+ *
+ * Copyright (C) 1995 by Paal-Kr. Engstad and Volker Lendecke
+ * Copyright (C) 1997 by Volker Lendecke
+ *
+ */
+
+#ifndef _LINUX_SMB_FS_H
+#define _LINUX_SMB_FS_H
+
+#include <linux/smb.h>
+
+/*
+ * ioctl commands
+ */
+#define SMB_IOC_GETMOUNTUID _IOR('u', 1, __kernel_old_uid_t)
+#define SMB_IOC_NEWCONN _IOW('u', 2, struct smb_conn_opt)
+
+/* __kernel_uid_t can never change, so we have to use __kernel_uid32_t */
+#define SMB_IOC_GETMOUNTUID32 _IOR('u', 3, __kernel_uid32_t)
+
+
+
+#endif /* _LINUX_SMB_FS_H */
diff --git a/sysroot/usr/include/linux/smb_mount.h b/sysroot/usr/include/linux/smb_mount.h
new file mode 100644
index 0000000..82956ba
--- /dev/null
+++ b/sysroot/usr/include/linux/smb_mount.h
@@ -0,0 +1,27 @@
+/*
+ * smb_mount.h
+ *
+ * Copyright (C) 1995, 1996 by Paal-Kr. Engstad and Volker Lendecke
+ * Copyright (C) 1997 by Volker Lendecke
+ *
+ */
+
+#ifndef _LINUX_SMB_MOUNT_H
+#define _LINUX_SMB_MOUNT_H
+
+#include <linux/types.h>
+
+#define SMB_MOUNT_VERSION 6
+
+struct smb_mount_data {
+ int version;
+ __kernel_uid_t mounted_uid; /* Who may umount() this filesystem? */
+ __kernel_uid_t uid;
+ __kernel_gid_t gid;
+ __kernel_mode_t file_mode;
+ __kernel_mode_t dir_mode;
+};
+
+
+
+#endif
diff --git a/sysroot/usr/include/linux/smbno.h b/sysroot/usr/include/linux/smbno.h
new file mode 100644
index 0000000..f99e02d
--- /dev/null
+++ b/sysroot/usr/include/linux/smbno.h
@@ -0,0 +1,363 @@
+#ifndef _SMBNO_H_
+#define _SMBNO_H_
+
+/* these define the attribute byte as seen by DOS */
+#define aRONLY (1L<<0)
+#define aHIDDEN (1L<<1)
+#define aSYSTEM (1L<<2)
+#define aVOLID (1L<<3)
+#define aDIR (1L<<4)
+#define aARCH (1L<<5)
+
+/* error classes */
+#define SUCCESS 0 /* The request was successful. */
+#define ERRDOS 0x01 /* Error is from the core DOS operating system set. */
+#define ERRSRV 0x02 /* Error is generated by the server network file manager.*/
+#define ERRHRD 0x03 /* Error is an hardware error. */
+#define ERRCMD 0xFF /* Command was not in the "SMB" format. */
+
+/* SMB X/Open error codes for the ERRdos error class */
+
+#define ERRbadfunc 1 /* Invalid function (or system call) */
+#define ERRbadfile 2 /* File not found (pathname error) */
+#define ERRbadpath 3 /* Directory not found */
+#define ERRnofids 4 /* Too many open files */
+#define ERRnoaccess 5 /* Access denied */
+#define ERRbadfid 6 /* Invalid fid */
+#define ERRbadmcb 7 /* Memory control blocks destroyed */
+#define ERRnomem 8 /* Out of memory */
+#define ERRbadmem 9 /* Invalid memory block address */
+#define ERRbadenv 10 /* Invalid environment */
+#define ERRbadformat 11 /* Invalid format */
+#define ERRbadaccess 12 /* Invalid open mode */
+#define ERRbaddata 13 /* Invalid data (only from ioctl call) */
+#define ERRres 14 /* reserved */
+#define ERRbaddrive 15 /* Invalid drive */
+#define ERRremcd 16 /* Attempt to delete current directory */
+#define ERRdiffdevice 17 /* rename/move across different filesystems */
+#define ERRnofiles 18 /* no more files found in file search */
+#define ERRbadshare 32 /* Share mode on file conflict with open mode */
+#define ERRlock 33 /* Lock request conflicts with existing lock */
+#define ERRfilexists 80 /* File in operation already exists */
+#define ERRbadpipe 230 /* Named pipe invalid */
+#define ERRpipebusy 231 /* All instances of pipe are busy */
+#define ERRpipeclosing 232 /* named pipe close in progress */
+#define ERRnotconnected 233 /* No process on other end of named pipe */
+#define ERRmoredata 234 /* More data to be returned */
+
+#define ERROR_INVALID_PARAMETER 87
+#define ERROR_DISK_FULL 112
+#define ERROR_INVALID_NAME 123
+#define ERROR_DIR_NOT_EMPTY 145
+#define ERROR_NOT_LOCKED 158
+#define ERROR_ALREADY_EXISTS 183 /* see also 80 ? */
+#define ERROR_EAS_DIDNT_FIT 275 /* Extended attributes didn't fit */
+#define ERROR_EAS_NOT_SUPPORTED 282 /* Extended attributes not supported */
+
+/* Error codes for the ERRSRV class */
+
+#define ERRerror 1 /* Non specific error code */
+#define ERRbadpw 2 /* Bad password */
+#define ERRbadtype 3 /* reserved */
+#define ERRaccess 4 /* No permissions to do the requested operation */
+#define ERRinvnid 5 /* tid invalid */
+#define ERRinvnetname 6 /* Invalid servername */
+#define ERRinvdevice 7 /* Invalid device */
+#define ERRqfull 49 /* Print queue full */
+#define ERRqtoobig 50 /* Queued item too big */
+#define ERRinvpfid 52 /* Invalid print file in smb_fid */
+#define ERRsmbcmd 64 /* Unrecognised command */
+#define ERRsrverror 65 /* smb server internal error */
+#define ERRfilespecs 67 /* fid and pathname invalid combination */
+#define ERRbadlink 68 /* reserved */
+#define ERRbadpermits 69 /* Access specified for a file is not valid */
+#define ERRbadpid 70 /* reserved */
+#define ERRsetattrmode 71 /* attribute mode invalid */
+#define ERRpaused 81 /* Message server paused */
+#define ERRmsgoff 82 /* Not receiving messages */
+#define ERRnoroom 83 /* No room for message */
+#define ERRrmuns 87 /* too many remote usernames */
+#define ERRtimeout 88 /* operation timed out */
+#define ERRnoresource 89 /* No resources currently available for request. */
+#define ERRtoomanyuids 90 /* too many userids */
+#define ERRbaduid 91 /* bad userid */
+#define ERRuseMPX 250 /* temporarily unable to use raw mode, use MPX mode */
+#define ERRuseSTD 251 /* temporarily unable to use raw mode, use std.mode */
+#define ERRcontMPX 252 /* resume MPX mode */
+#define ERRbadPW /* reserved */
+#define ERRnosupport 0xFFFF
+
+/* Error codes for the ERRHRD class */
+
+#define ERRnowrite 19 /* read only media */
+#define ERRbadunit 20 /* Unknown device */
+#define ERRnotready 21 /* Drive not ready */
+#define ERRbadcmd 22 /* Unknown command */
+#define ERRdata 23 /* Data (CRC) error */
+#define ERRbadreq 24 /* Bad request structure length */
+#define ERRseek 25
+#define ERRbadmedia 26
+#define ERRbadsector 27
+#define ERRnopaper 28
+#define ERRwrite 29 /* write fault */
+#define ERRread 30 /* read fault */
+#define ERRgeneral 31 /* General hardware failure */
+#define ERRwrongdisk 34
+#define ERRFCBunavail 35
+#define ERRsharebufexc 36 /* share buffer exceeded */
+#define ERRdiskfull 39
+
+/*
+ * Access modes when opening a file
+ */
+#define SMB_ACCMASK 0x0003
+#define SMB_O_RDONLY 0x0000
+#define SMB_O_WRONLY 0x0001
+#define SMB_O_RDWR 0x0002
+
+/* offsets into message for common items */
+#define smb_com 8
+#define smb_rcls 9
+#define smb_reh 10
+#define smb_err 11
+#define smb_flg 13
+#define smb_flg2 14
+#define smb_reb 13
+#define smb_tid 28
+#define smb_pid 30
+#define smb_uid 32
+#define smb_mid 34
+#define smb_wct 36
+#define smb_vwv 37
+#define smb_vwv0 37
+#define smb_vwv1 39
+#define smb_vwv2 41
+#define smb_vwv3 43
+#define smb_vwv4 45
+#define smb_vwv5 47
+#define smb_vwv6 49
+#define smb_vwv7 51
+#define smb_vwv8 53
+#define smb_vwv9 55
+#define smb_vwv10 57
+#define smb_vwv11 59
+#define smb_vwv12 61
+#define smb_vwv13 63
+#define smb_vwv14 65
+
+/* these are the trans2 sub fields for primary requests */
+#define smb_tpscnt smb_vwv0
+#define smb_tdscnt smb_vwv1
+#define smb_mprcnt smb_vwv2
+#define smb_mdrcnt smb_vwv3
+#define smb_msrcnt smb_vwv4
+#define smb_flags smb_vwv5
+#define smb_timeout smb_vwv6
+#define smb_pscnt smb_vwv9
+#define smb_psoff smb_vwv10
+#define smb_dscnt smb_vwv11
+#define smb_dsoff smb_vwv12
+#define smb_suwcnt smb_vwv13
+#define smb_setup smb_vwv14
+#define smb_setup0 smb_setup
+#define smb_setup1 (smb_setup+2)
+#define smb_setup2 (smb_setup+4)
+
+/* these are for the secondary requests */
+#define smb_spscnt smb_vwv2
+#define smb_spsoff smb_vwv3
+#define smb_spsdisp smb_vwv4
+#define smb_sdscnt smb_vwv5
+#define smb_sdsoff smb_vwv6
+#define smb_sdsdisp smb_vwv7
+#define smb_sfid smb_vwv8
+
+/* and these for responses */
+#define smb_tprcnt smb_vwv0
+#define smb_tdrcnt smb_vwv1
+#define smb_prcnt smb_vwv3
+#define smb_proff smb_vwv4
+#define smb_prdisp smb_vwv5
+#define smb_drcnt smb_vwv6
+#define smb_droff smb_vwv7
+#define smb_drdisp smb_vwv8
+
+/* the complete */
+#define SMBmkdir 0x00 /* create directory */
+#define SMBrmdir 0x01 /* delete directory */
+#define SMBopen 0x02 /* open file */
+#define SMBcreate 0x03 /* create file */
+#define SMBclose 0x04 /* close file */
+#define SMBflush 0x05 /* flush file */
+#define SMBunlink 0x06 /* delete file */
+#define SMBmv 0x07 /* rename file */
+#define SMBgetatr 0x08 /* get file attributes */
+#define SMBsetatr 0x09 /* set file attributes */
+#define SMBread 0x0A /* read from file */
+#define SMBwrite 0x0B /* write to file */
+#define SMBlock 0x0C /* lock byte range */
+#define SMBunlock 0x0D /* unlock byte range */
+#define SMBctemp 0x0E /* create temporary file */
+#define SMBmknew 0x0F /* make new file */
+#define SMBchkpth 0x10 /* check directory path */
+#define SMBexit 0x11 /* process exit */
+#define SMBlseek 0x12 /* seek */
+#define SMBtcon 0x70 /* tree connect */
+#define SMBtconX 0x75 /* tree connect and X*/
+#define SMBtdis 0x71 /* tree disconnect */
+#define SMBnegprot 0x72 /* negotiate protocol */
+#define SMBdskattr 0x80 /* get disk attributes */
+#define SMBsearch 0x81 /* search directory */
+#define SMBsplopen 0xC0 /* open print spool file */
+#define SMBsplwr 0xC1 /* write to print spool file */
+#define SMBsplclose 0xC2 /* close print spool file */
+#define SMBsplretq 0xC3 /* return print queue */
+#define SMBsends 0xD0 /* send single block message */
+#define SMBsendb 0xD1 /* send broadcast message */
+#define SMBfwdname 0xD2 /* forward user name */
+#define SMBcancelf 0xD3 /* cancel forward */
+#define SMBgetmac 0xD4 /* get machine name */
+#define SMBsendstrt 0xD5 /* send start of multi-block message */
+#define SMBsendend 0xD6 /* send end of multi-block message */
+#define SMBsendtxt 0xD7 /* send text of multi-block message */
+
+/* Core+ protocol */
+#define SMBlockread 0x13 /* Lock a range and read */
+#define SMBwriteunlock 0x14 /* Unlock a range then write */
+#define SMBreadbraw 0x1a /* read a block of data with no smb header */
+#define SMBwritebraw 0x1d /* write a block of data with no smb header */
+#define SMBwritec 0x20 /* secondary write request */
+#define SMBwriteclose 0x2c /* write a file then close it */
+
+/* dos extended protocol */
+#define SMBreadBraw 0x1A /* read block raw */
+#define SMBreadBmpx 0x1B /* read block multiplexed */
+#define SMBreadBs 0x1C /* read block (secondary response) */
+#define SMBwriteBraw 0x1D /* write block raw */
+#define SMBwriteBmpx 0x1E /* write block multiplexed */
+#define SMBwriteBs 0x1F /* write block (secondary request) */
+#define SMBwriteC 0x20 /* write complete response */
+#define SMBsetattrE 0x22 /* set file attributes expanded */
+#define SMBgetattrE 0x23 /* get file attributes expanded */
+#define SMBlockingX 0x24 /* lock/unlock byte ranges and X */
+#define SMBtrans 0x25 /* transaction - name, bytes in/out */
+#define SMBtranss 0x26 /* transaction (secondary request/response) */
+#define SMBioctl 0x27 /* IOCTL */
+#define SMBioctls 0x28 /* IOCTL (secondary request/response) */
+#define SMBcopy 0x29 /* copy */
+#define SMBmove 0x2A /* move */
+#define SMBecho 0x2B /* echo */
+#define SMBopenX 0x2D /* open and X */
+#define SMBreadX 0x2E /* read and X */
+#define SMBwriteX 0x2F /* write and X */
+#define SMBsesssetupX 0x73 /* Session Set Up & X (including User Logon) */
+#define SMBtconX 0x75 /* tree connect and X */
+#define SMBffirst 0x82 /* find first */
+#define SMBfunique 0x83 /* find unique */
+#define SMBfclose 0x84 /* find close */
+#define SMBinvalid 0xFE /* invalid command */
+
+
+/* Extended 2.0 protocol */
+#define SMBtrans2 0x32 /* TRANS2 protocol set */
+#define SMBtranss2 0x33 /* TRANS2 protocol set, secondary command */
+#define SMBfindclose 0x34 /* Terminate a TRANSACT2_FINDFIRST */
+#define SMBfindnclose 0x35 /* Terminate a TRANSACT2_FINDNOTIFYFIRST */
+#define SMBulogoffX 0x74 /* user logoff */
+
+/* these are the TRANS2 sub commands */
+#define TRANSACT2_OPEN 0
+#define TRANSACT2_FINDFIRST 1
+#define TRANSACT2_FINDNEXT 2
+#define TRANSACT2_QFSINFO 3
+#define TRANSACT2_SETFSINFO 4
+#define TRANSACT2_QPATHINFO 5
+#define TRANSACT2_SETPATHINFO 6
+#define TRANSACT2_QFILEINFO 7
+#define TRANSACT2_SETFILEINFO 8
+#define TRANSACT2_FSCTL 9
+#define TRANSACT2_IOCTL 10
+#define TRANSACT2_FINDNOTIFYFIRST 11
+#define TRANSACT2_FINDNOTIFYNEXT 12
+#define TRANSACT2_MKDIR 13
+
+/* Information Levels - Shared? */
+#define SMB_INFO_STANDARD 1
+#define SMB_INFO_QUERY_EA_SIZE 2
+#define SMB_INFO_QUERY_EAS_FROM_LIST 3
+#define SMB_INFO_QUERY_ALL_EAS 4
+#define SMB_INFO_IS_NAME_VALID 6
+
+/* Information Levels - TRANSACT2_FINDFIRST */
+#define SMB_FIND_FILE_DIRECTORY_INFO 0x101
+#define SMB_FIND_FILE_FULL_DIRECTORY_INFO 0x102
+#define SMB_FIND_FILE_NAMES_INFO 0x103
+#define SMB_FIND_FILE_BOTH_DIRECTORY_INFO 0x104
+
+/* Information Levels - TRANSACT2_QPATHINFO */
+#define SMB_QUERY_FILE_BASIC_INFO 0x101
+#define SMB_QUERY_FILE_STANDARD_INFO 0x102
+#define SMB_QUERY_FILE_EA_INFO 0x103
+#define SMB_QUERY_FILE_NAME_INFO 0x104
+#define SMB_QUERY_FILE_ALL_INFO 0x107
+#define SMB_QUERY_FILE_ALT_NAME_INFO 0x108
+#define SMB_QUERY_FILE_STREAM_INFO 0x109
+#define SMB_QUERY_FILE_COMPRESSION_INFO 0x10b
+
+/* Information Levels - TRANSACT2_SETFILEINFO */
+#define SMB_SET_FILE_BASIC_INFO 0x101
+#define SMB_SET_FILE_DISPOSITION_INFO 0x102
+#define SMB_SET_FILE_ALLOCATION_INFO 0x103
+#define SMB_SET_FILE_END_OF_FILE_INFO 0x104
+
+/* smb_flg field flags */
+#define SMB_FLAGS_SUPPORT_LOCKREAD 0x01
+#define SMB_FLAGS_CLIENT_BUF_AVAIL 0x02
+#define SMB_FLAGS_RESERVED 0x04
+#define SMB_FLAGS_CASELESS_PATHNAMES 0x08
+#define SMB_FLAGS_CANONICAL_PATHNAMES 0x10
+#define SMB_FLAGS_REQUEST_OPLOCK 0x20
+#define SMB_FLAGS_REQUEST_BATCH_OPLOCK 0x40
+#define SMB_FLAGS_REPLY 0x80
+
+/* smb_flg2 field flags (samba-2.2.0/source/include/smb.h) */
+#define SMB_FLAGS2_LONG_PATH_COMPONENTS 0x0001
+#define SMB_FLAGS2_EXTENDED_ATTRIBUTES 0x0002
+#define SMB_FLAGS2_DFS_PATHNAMES 0x1000
+#define SMB_FLAGS2_READ_PERMIT_NO_EXECUTE 0x2000
+#define SMB_FLAGS2_32_BIT_ERROR_CODES 0x4000
+#define SMB_FLAGS2_UNICODE_STRINGS 0x8000
+
+
+/*
+ * UNIX stuff (from samba trans2.h)
+ */
+#define MIN_UNIX_INFO_LEVEL 0x200
+#define MAX_UNIX_INFO_LEVEL 0x2FF
+#define SMB_FIND_FILE_UNIX 0x202
+#define SMB_QUERY_FILE_UNIX_BASIC 0x200
+#define SMB_QUERY_FILE_UNIX_LINK 0x201
+#define SMB_QUERY_FILE_UNIX_HLINK 0x202
+#define SMB_SET_FILE_UNIX_BASIC 0x200
+#define SMB_SET_FILE_UNIX_LINK 0x201
+#define SMB_SET_FILE_UNIX_HLINK 0x203
+#define SMB_QUERY_CIFS_UNIX_INFO 0x200
+
+/* values which means "don't change it" */
+#define SMB_MODE_NO_CHANGE 0xFFFFFFFF
+#define SMB_UID_NO_CHANGE 0xFFFFFFFF
+#define SMB_GID_NO_CHANGE 0xFFFFFFFF
+#define SMB_TIME_NO_CHANGE 0xFFFFFFFFFFFFFFFFULL
+#define SMB_SIZE_NO_CHANGE 0xFFFFFFFFFFFFFFFFULL
+
+/* UNIX filetype mappings. */
+#define UNIX_TYPE_FILE 0
+#define UNIX_TYPE_DIR 1
+#define UNIX_TYPE_SYMLINK 2
+#define UNIX_TYPE_CHARDEV 3
+#define UNIX_TYPE_BLKDEV 4
+#define UNIX_TYPE_FIFO 5
+#define UNIX_TYPE_SOCKET 6
+#define UNIX_TYPE_UNKNOWN 0xFFFFFFFF
+
+#endif /* _SMBNO_H_ */
diff --git a/sysroot/usr/include/linux/snmp.h b/sysroot/usr/include/linux/snmp.h
new file mode 100644
index 0000000..89f0c2b
--- /dev/null
+++ b/sysroot/usr/include/linux/snmp.h
@@ -0,0 +1,220 @@
+/*
+ * Definitions for MIBs
+ *
+ * Author: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
+ */
+
+#ifndef _LINUX_SNMP_H
+#define _LINUX_SNMP_H
+
+/* ipstats mib definitions */
+/*
+ * RFC 1213: MIB-II
+ * RFC 2011 (updates 1213): SNMPv2-MIB-IP
+ * RFC 2863: Interfaces Group MIB
+ * RFC 2465: IPv6 MIB: General Group
+ * draft-ietf-ipv6-rfc2011-update-10.txt: MIB for IP: IP Statistics Tables
+ */
+enum
+{
+ IPSTATS_MIB_NUM = 0,
+ IPSTATS_MIB_INRECEIVES, /* InReceives */
+ IPSTATS_MIB_INHDRERRORS, /* InHdrErrors */
+ IPSTATS_MIB_INTOOBIGERRORS, /* InTooBigErrors */
+ IPSTATS_MIB_INNOROUTES, /* InNoRoutes */
+ IPSTATS_MIB_INADDRERRORS, /* InAddrErrors */
+ IPSTATS_MIB_INUNKNOWNPROTOS, /* InUnknownProtos */
+ IPSTATS_MIB_INTRUNCATEDPKTS, /* InTruncatedPkts */
+ IPSTATS_MIB_INDISCARDS, /* InDiscards */
+ IPSTATS_MIB_INDELIVERS, /* InDelivers */
+ IPSTATS_MIB_OUTFORWDATAGRAMS, /* OutForwDatagrams */
+ IPSTATS_MIB_OUTREQUESTS, /* OutRequests */
+ IPSTATS_MIB_OUTDISCARDS, /* OutDiscards */
+ IPSTATS_MIB_OUTNOROUTES, /* OutNoRoutes */
+ IPSTATS_MIB_REASMTIMEOUT, /* ReasmTimeout */
+ IPSTATS_MIB_REASMREQDS, /* ReasmReqds */
+ IPSTATS_MIB_REASMOKS, /* ReasmOKs */
+ IPSTATS_MIB_REASMFAILS, /* ReasmFails */
+ IPSTATS_MIB_FRAGOKS, /* FragOKs */
+ IPSTATS_MIB_FRAGFAILS, /* FragFails */
+ IPSTATS_MIB_FRAGCREATES, /* FragCreates */
+ IPSTATS_MIB_INMCASTPKTS, /* InMcastPkts */
+ IPSTATS_MIB_OUTMCASTPKTS, /* OutMcastPkts */
+ IPSTATS_MIB_INBCASTPKTS, /* InBcastPkts */
+ IPSTATS_MIB_OUTBCASTPKTS, /* OutBcastPkts */
+ __IPSTATS_MIB_MAX
+};
+
+/* icmp mib definitions */
+/*
+ * RFC 1213: MIB-II ICMP Group
+ * RFC 2011 (updates 1213): SNMPv2 MIB for IP: ICMP group
+ */
+enum
+{
+ ICMP_MIB_NUM = 0,
+ ICMP_MIB_INMSGS, /* InMsgs */
+ ICMP_MIB_INERRORS, /* InErrors */
+ ICMP_MIB_INDESTUNREACHS, /* InDestUnreachs */
+ ICMP_MIB_INTIMEEXCDS, /* InTimeExcds */
+ ICMP_MIB_INPARMPROBS, /* InParmProbs */
+ ICMP_MIB_INSRCQUENCHS, /* InSrcQuenchs */
+ ICMP_MIB_INREDIRECTS, /* InRedirects */
+ ICMP_MIB_INECHOS, /* InEchos */
+ ICMP_MIB_INECHOREPS, /* InEchoReps */
+ ICMP_MIB_INTIMESTAMPS, /* InTimestamps */
+ ICMP_MIB_INTIMESTAMPREPS, /* InTimestampReps */
+ ICMP_MIB_INADDRMASKS, /* InAddrMasks */
+ ICMP_MIB_INADDRMASKREPS, /* InAddrMaskReps */
+ ICMP_MIB_OUTMSGS, /* OutMsgs */
+ ICMP_MIB_OUTERRORS, /* OutErrors */
+ ICMP_MIB_OUTDESTUNREACHS, /* OutDestUnreachs */
+ ICMP_MIB_OUTTIMEEXCDS, /* OutTimeExcds */
+ ICMP_MIB_OUTPARMPROBS, /* OutParmProbs */
+ ICMP_MIB_OUTSRCQUENCHS, /* OutSrcQuenchs */
+ ICMP_MIB_OUTREDIRECTS, /* OutRedirects */
+ ICMP_MIB_OUTECHOS, /* OutEchos */
+ ICMP_MIB_OUTECHOREPS, /* OutEchoReps */
+ ICMP_MIB_OUTTIMESTAMPS, /* OutTimestamps */
+ ICMP_MIB_OUTTIMESTAMPREPS, /* OutTimestampReps */
+ ICMP_MIB_OUTADDRMASKS, /* OutAddrMasks */
+ ICMP_MIB_OUTADDRMASKREPS, /* OutAddrMaskReps */
+ __ICMP_MIB_MAX
+};
+
+#define __ICMPMSG_MIB_MAX 512 /* Out+In for all 8-bit ICMP types */
+
+/* icmp6 mib definitions */
+/*
+ * RFC 2466: ICMPv6-MIB
+ */
+enum
+{
+ ICMP6_MIB_NUM = 0,
+ ICMP6_MIB_INMSGS, /* InMsgs */
+ ICMP6_MIB_INERRORS, /* InErrors */
+ ICMP6_MIB_OUTMSGS, /* OutMsgs */
+ __ICMP6_MIB_MAX
+};
+
+#define __ICMP6MSG_MIB_MAX 512 /* Out+In for all 8-bit ICMPv6 types */
+
+/* tcp mib definitions */
+/*
+ * RFC 1213: MIB-II TCP group
+ * RFC 2012 (updates 1213): SNMPv2-MIB-TCP
+ */
+enum
+{
+ TCP_MIB_NUM = 0,
+ TCP_MIB_RTOALGORITHM, /* RtoAlgorithm */
+ TCP_MIB_RTOMIN, /* RtoMin */
+ TCP_MIB_RTOMAX, /* RtoMax */
+ TCP_MIB_MAXCONN, /* MaxConn */
+ TCP_MIB_ACTIVEOPENS, /* ActiveOpens */
+ TCP_MIB_PASSIVEOPENS, /* PassiveOpens */
+ TCP_MIB_ATTEMPTFAILS, /* AttemptFails */
+ TCP_MIB_ESTABRESETS, /* EstabResets */
+ TCP_MIB_CURRESTAB, /* CurrEstab */
+ TCP_MIB_INSEGS, /* InSegs */
+ TCP_MIB_OUTSEGS, /* OutSegs */
+ TCP_MIB_RETRANSSEGS, /* RetransSegs */
+ TCP_MIB_INERRS, /* InErrs */
+ TCP_MIB_OUTRSTS, /* OutRsts */
+ __TCP_MIB_MAX
+};
+
+/* udp mib definitions */
+/*
+ * RFC 1213: MIB-II UDP group
+ * RFC 2013 (updates 1213): SNMPv2-MIB-UDP
+ */
+enum
+{
+ UDP_MIB_NUM = 0,
+ UDP_MIB_INDATAGRAMS, /* InDatagrams */
+ UDP_MIB_NOPORTS, /* NoPorts */
+ UDP_MIB_INERRORS, /* InErrors */
+ UDP_MIB_OUTDATAGRAMS, /* OutDatagrams */
+ UDP_MIB_RCVBUFERRORS, /* RcvbufErrors */
+ UDP_MIB_SNDBUFERRORS, /* SndbufErrors */
+ __UDP_MIB_MAX
+};
+
+/* linux mib definitions */
+enum
+{
+ LINUX_MIB_NUM = 0,
+ LINUX_MIB_SYNCOOKIESSENT, /* SyncookiesSent */
+ LINUX_MIB_SYNCOOKIESRECV, /* SyncookiesRecv */
+ LINUX_MIB_SYNCOOKIESFAILED, /* SyncookiesFailed */
+ LINUX_MIB_EMBRYONICRSTS, /* EmbryonicRsts */
+ LINUX_MIB_PRUNECALLED, /* PruneCalled */
+ LINUX_MIB_RCVPRUNED, /* RcvPruned */
+ LINUX_MIB_OFOPRUNED, /* OfoPruned */
+ LINUX_MIB_OUTOFWINDOWICMPS, /* OutOfWindowIcmps */
+ LINUX_MIB_LOCKDROPPEDICMPS, /* LockDroppedIcmps */
+ LINUX_MIB_ARPFILTER, /* ArpFilter */
+ LINUX_MIB_TIMEWAITED, /* TimeWaited */
+ LINUX_MIB_TIMEWAITRECYCLED, /* TimeWaitRecycled */
+ LINUX_MIB_TIMEWAITKILLED, /* TimeWaitKilled */
+ LINUX_MIB_PAWSPASSIVEREJECTED, /* PAWSPassiveRejected */
+ LINUX_MIB_PAWSACTIVEREJECTED, /* PAWSActiveRejected */
+ LINUX_MIB_PAWSESTABREJECTED, /* PAWSEstabRejected */
+ LINUX_MIB_DELAYEDACKS, /* DelayedACKs */
+ LINUX_MIB_DELAYEDACKLOCKED, /* DelayedACKLocked */
+ LINUX_MIB_DELAYEDACKLOST, /* DelayedACKLost */
+ LINUX_MIB_LISTENOVERFLOWS, /* ListenOverflows */
+ LINUX_MIB_LISTENDROPS, /* ListenDrops */
+ LINUX_MIB_TCPPREQUEUED, /* TCPPrequeued */
+ LINUX_MIB_TCPDIRECTCOPYFROMBACKLOG, /* TCPDirectCopyFromBacklog */
+ LINUX_MIB_TCPDIRECTCOPYFROMPREQUEUE, /* TCPDirectCopyFromPrequeue */
+ LINUX_MIB_TCPPREQUEUEDROPPED, /* TCPPrequeueDropped */
+ LINUX_MIB_TCPHPHITS, /* TCPHPHits */
+ LINUX_MIB_TCPHPHITSTOUSER, /* TCPHPHitsToUser */
+ LINUX_MIB_TCPPUREACKS, /* TCPPureAcks */
+ LINUX_MIB_TCPHPACKS, /* TCPHPAcks */
+ LINUX_MIB_TCPRENORECOVERY, /* TCPRenoRecovery */
+ LINUX_MIB_TCPSACKRECOVERY, /* TCPSackRecovery */
+ LINUX_MIB_TCPSACKRENEGING, /* TCPSACKReneging */
+ LINUX_MIB_TCPFACKREORDER, /* TCPFACKReorder */
+ LINUX_MIB_TCPSACKREORDER, /* TCPSACKReorder */
+ LINUX_MIB_TCPRENOREORDER, /* TCPRenoReorder */
+ LINUX_MIB_TCPTSREORDER, /* TCPTSReorder */
+ LINUX_MIB_TCPFULLUNDO, /* TCPFullUndo */
+ LINUX_MIB_TCPPARTIALUNDO, /* TCPPartialUndo */
+ LINUX_MIB_TCPDSACKUNDO, /* TCPDSACKUndo */
+ LINUX_MIB_TCPLOSSUNDO, /* TCPLossUndo */
+ LINUX_MIB_TCPLOSS, /* TCPLoss */
+ LINUX_MIB_TCPLOSTRETRANSMIT, /* TCPLostRetransmit */
+ LINUX_MIB_TCPRENOFAILURES, /* TCPRenoFailures */
+ LINUX_MIB_TCPSACKFAILURES, /* TCPSackFailures */
+ LINUX_MIB_TCPLOSSFAILURES, /* TCPLossFailures */
+ LINUX_MIB_TCPFASTRETRANS, /* TCPFastRetrans */
+ LINUX_MIB_TCPFORWARDRETRANS, /* TCPForwardRetrans */
+ LINUX_MIB_TCPSLOWSTARTRETRANS, /* TCPSlowStartRetrans */
+ LINUX_MIB_TCPTIMEOUTS, /* TCPTimeouts */
+ LINUX_MIB_TCPRENORECOVERYFAIL, /* TCPRenoRecoveryFail */
+ LINUX_MIB_TCPSACKRECOVERYFAIL, /* TCPSackRecoveryFail */
+ LINUX_MIB_TCPSCHEDULERFAILED, /* TCPSchedulerFailed */
+ LINUX_MIB_TCPRCVCOLLAPSED, /* TCPRcvCollapsed */
+ LINUX_MIB_TCPDSACKOLDSENT, /* TCPDSACKOldSent */
+ LINUX_MIB_TCPDSACKOFOSENT, /* TCPDSACKOfoSent */
+ LINUX_MIB_TCPDSACKRECV, /* TCPDSACKRecv */
+ LINUX_MIB_TCPDSACKOFORECV, /* TCPDSACKOfoRecv */
+ LINUX_MIB_TCPABORTONSYN, /* TCPAbortOnSyn */
+ LINUX_MIB_TCPABORTONDATA, /* TCPAbortOnData */
+ LINUX_MIB_TCPABORTONCLOSE, /* TCPAbortOnClose */
+ LINUX_MIB_TCPABORTONMEMORY, /* TCPAbortOnMemory */
+ LINUX_MIB_TCPABORTONTIMEOUT, /* TCPAbortOnTimeout */
+ LINUX_MIB_TCPABORTONLINGER, /* TCPAbortOnLinger */
+ LINUX_MIB_TCPABORTFAILED, /* TCPAbortFailed */
+ LINUX_MIB_TCPMEMORYPRESSURES, /* TCPMemoryPressures */
+ LINUX_MIB_TCPSACKDISCARD, /* TCPSACKDiscard */
+ LINUX_MIB_TCPDSACKIGNOREDOLD, /* TCPSACKIgnoredOld */
+ LINUX_MIB_TCPDSACKIGNOREDNOUNDO, /* TCPSACKIgnoredNoUndo */
+ LINUX_MIB_TCPSPURIOUSRTOS, /* TCPSpuriousRTOs */
+ __LINUX_MIB_MAX
+};
+
+#endif /* _LINUX_SNMP_H */
diff --git a/sysroot/usr/include/linux/socket.h b/sysroot/usr/include/linux/socket.h
new file mode 100644
index 0000000..7028e83
--- /dev/null
+++ b/sysroot/usr/include/linux/socket.h
@@ -0,0 +1,297 @@
+#ifndef _LINUX_SOCKET_H
+#define _LINUX_SOCKET_H
+
+/*
+ * Desired design of maximum size and alignment (see RFC2553)
+ */
+#define _K_SS_MAXSIZE 128 /* Implementation specific max size */
+#define _K_SS_ALIGNSIZE (__alignof__ (struct sockaddr *))
+ /* Implementation specific desired alignment */
+
+struct __kernel_sockaddr_storage {
+ unsigned short ss_family; /* address family */
+ /* Following field(s) are implementation specific */
+ char __data[_K_SS_MAXSIZE - sizeof(unsigned short)];
+ /* space to achieve desired size, */
+ /* _SS_MAXSIZE value minus size of ss_family */
+} __attribute__ ((aligned(_K_SS_ALIGNSIZE))); /* force desired alignment */
+
+#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
+
+#include <asm/socket.h> /* arch-dependent defines */
+#include <linux/sockios.h> /* the SIOCxxx I/O controls */
+#include <linux/uio.h> /* iovec support */
+#include <linux/types.h> /* pid_t */
+
+extern int sysctl_somaxconn;
+#ifdef CONFIG_PROC_FS
+struct seq_file;
+extern void socket_seq_show(struct seq_file *seq);
+#endif
+
+typedef unsigned short sa_family_t;
+
+/*
+ * 1003.1g requires sa_family_t and that sa_data is char.
+ */
+
+struct sockaddr {
+ sa_family_t sa_family; /* address family, AF_xxx */
+ char sa_data[14]; /* 14 bytes of protocol address */
+};
+
+struct linger {
+ int l_onoff; /* Linger active */
+ int l_linger; /* How long to linger for */
+};
+
+#define sockaddr_storage __kernel_sockaddr_storage
+
+/*
+ * As we do 4.4BSD message passing we use a 4.4BSD message passing
+ * system, not 4.3. Thus msg_accrights(len) are now missing. They
+ * belong in an obscure libc emulation or the bin.
+ */
+
+struct msghdr {
+ void * msg_name; /* Socket name */
+ int msg_namelen; /* Length of name */
+ struct iovec * msg_iov; /* Data blocks */
+ __kernel_size_t msg_iovlen; /* Number of blocks */
+ void * msg_control; /* Per protocol magic (eg BSD file descriptor passing) */
+ __kernel_size_t msg_controllen; /* Length of cmsg list */
+ unsigned msg_flags;
+};
+
+/*
+ * POSIX 1003.1g - ancillary data object information
+ * Ancillary data consits of a sequence of pairs of
+ * (cmsghdr, cmsg_data[])
+ */
+
+struct cmsghdr {
+ __kernel_size_t cmsg_len; /* data byte count, including hdr */
+ int cmsg_level; /* originating protocol */
+ int cmsg_type; /* protocol-specific type */
+};
+
+/*
+ * Ancilliary data object information MACROS
+ * Table 5-14 of POSIX 1003.1g
+ */
+
+#define __CMSG_NXTHDR(ctl, len, cmsg) __cmsg_nxthdr((ctl),(len),(cmsg))
+#define CMSG_NXTHDR(mhdr, cmsg) cmsg_nxthdr((mhdr), (cmsg))
+
+#define CMSG_ALIGN(len) ( ((len)+sizeof(long)-1) & ~(sizeof(long)-1) )
+
+#define CMSG_DATA(cmsg) ((void *)((char *)(cmsg) + CMSG_ALIGN(sizeof(struct cmsghdr))))
+#define CMSG_SPACE(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + CMSG_ALIGN(len))
+#define CMSG_LEN(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
+
+#define __CMSG_FIRSTHDR(ctl,len) ((len) >= sizeof(struct cmsghdr) ? \
+ (struct cmsghdr *)(ctl) : \
+ (struct cmsghdr *)NULL)
+#define CMSG_FIRSTHDR(msg) __CMSG_FIRSTHDR((msg)->msg_control, (msg)->msg_controllen)
+#define CMSG_OK(mhdr, cmsg) ((cmsg)->cmsg_len >= sizeof(struct cmsghdr) && \
+ (cmsg)->cmsg_len <= (unsigned long) \
+ ((mhdr)->msg_controllen - \
+ ((char *)(cmsg) - (char *)(mhdr)->msg_control)))
+
+/*
+ * This mess will go away with glibc
+ */
+
+#if defined(__GNUC__)
+#define __KINLINE static __inline__
+#elif defined(__cplusplus)
+#define __KINLINE static inline
+#else
+#define __KINLINE static
+#endif
+
+
+/*
+ * Get the next cmsg header
+ *
+ * PLEASE, do not touch this function. If you think, that it is
+ * incorrect, grep kernel sources and think about consequences
+ * before trying to improve it.
+ *
+ * Now it always returns valid, not truncated ancillary object
+ * HEADER. But caller still MUST check, that cmsg->cmsg_len is
+ * inside range, given by msg->msg_controllen before using
+ * ancillary object DATA. --ANK (980731)
+ */
+
+__KINLINE struct cmsghdr * __cmsg_nxthdr(void *__ctl, __kernel_size_t __size,
+ struct cmsghdr *__cmsg)
+{
+ struct cmsghdr * __ptr;
+
+ __ptr = (struct cmsghdr*)(((unsigned char *) __cmsg) + CMSG_ALIGN(__cmsg->cmsg_len));
+ if ((unsigned long)((char*)(__ptr+1) - (char *) __ctl) > __size)
+ return (struct cmsghdr *)0;
+
+ return __ptr;
+}
+
+__KINLINE struct cmsghdr * cmsg_nxthdr (struct msghdr *__msg, struct cmsghdr *__cmsg)
+{
+ return __cmsg_nxthdr(__msg->msg_control, __msg->msg_controllen, __cmsg);
+}
+
+/* "Socket"-level control message types: */
+
+#define SCM_RIGHTS 0x01 /* rw: access rights (array of int) */
+#define SCM_CREDENTIALS 0x02 /* rw: struct ucred */
+#define SCM_SECURITY 0x03 /* rw: security label */
+
+struct ucred {
+ __u32 pid;
+ __u32 uid;
+ __u32 gid;
+};
+
+/* Supported address families. */
+#define AF_UNSPEC 0
+#define AF_UNIX 1 /* Unix domain sockets */
+#define AF_LOCAL 1 /* POSIX name for AF_UNIX */
+#define AF_INET 2 /* Internet IP Protocol */
+#define AF_AX25 3 /* Amateur Radio AX.25 */
+#define AF_IPX 4 /* Novell IPX */
+#define AF_APPLETALK 5 /* AppleTalk DDP */
+#define AF_NETROM 6 /* Amateur Radio NET/ROM */
+#define AF_BRIDGE 7 /* Multiprotocol bridge */
+#define AF_ATMPVC 8 /* ATM PVCs */
+#define AF_X25 9 /* Reserved for X.25 project */
+#define AF_INET6 10 /* IP version 6 */
+#define AF_ROSE 11 /* Amateur Radio X.25 PLP */
+#define AF_DECnet 12 /* Reserved for DECnet project */
+#define AF_NETBEUI 13 /* Reserved for 802.2LLC project*/
+#define AF_SECURITY 14 /* Security callback pseudo AF */
+#define AF_KEY 15 /* PF_KEY key management API */
+#define AF_NETLINK 16
+#define AF_ROUTE AF_NETLINK /* Alias to emulate 4.4BSD */
+#define AF_PACKET 17 /* Packet family */
+#define AF_ASH 18 /* Ash */
+#define AF_ECONET 19 /* Acorn Econet */
+#define AF_ATMSVC 20 /* ATM SVCs */
+#define AF_SNA 22 /* Linux SNA Project (nutters!) */
+#define AF_IRDA 23 /* IRDA sockets */
+#define AF_PPPOX 24 /* PPPoX sockets */
+#define AF_WANPIPE 25 /* Wanpipe API Sockets */
+#define AF_LLC 26 /* Linux LLC */
+#define AF_TIPC 30 /* TIPC sockets */
+#define AF_BLUETOOTH 31 /* Bluetooth sockets */
+#define AF_IUCV 32 /* IUCV sockets */
+#define AF_RXRPC 33 /* RxRPC sockets */
+#define AF_MAX 34 /* For now.. */
+
+/* Protocol families, same as address families. */
+#define PF_UNSPEC AF_UNSPEC
+#define PF_UNIX AF_UNIX
+#define PF_LOCAL AF_LOCAL
+#define PF_INET AF_INET
+#define PF_AX25 AF_AX25
+#define PF_IPX AF_IPX
+#define PF_APPLETALK AF_APPLETALK
+#define PF_NETROM AF_NETROM
+#define PF_BRIDGE AF_BRIDGE
+#define PF_ATMPVC AF_ATMPVC
+#define PF_X25 AF_X25
+#define PF_INET6 AF_INET6
+#define PF_ROSE AF_ROSE
+#define PF_DECnet AF_DECnet
+#define PF_NETBEUI AF_NETBEUI
+#define PF_SECURITY AF_SECURITY
+#define PF_KEY AF_KEY
+#define PF_NETLINK AF_NETLINK
+#define PF_ROUTE AF_ROUTE
+#define PF_PACKET AF_PACKET
+#define PF_ASH AF_ASH
+#define PF_ECONET AF_ECONET
+#define PF_ATMSVC AF_ATMSVC
+#define PF_SNA AF_SNA
+#define PF_IRDA AF_IRDA
+#define PF_PPPOX AF_PPPOX
+#define PF_WANPIPE AF_WANPIPE
+#define PF_LLC AF_LLC
+#define PF_TIPC AF_TIPC
+#define PF_BLUETOOTH AF_BLUETOOTH
+#define PF_IUCV AF_IUCV
+#define PF_RXRPC AF_RXRPC
+#define PF_MAX AF_MAX
+
+/* Maximum queue length specifiable by listen. */
+#define SOMAXCONN 128
+
+/* Flags we can use with send/ and recv.
+ Added those for 1003.1g not all are supported yet
+ */
+
+#define MSG_OOB 1
+#define MSG_PEEK 2
+#define MSG_DONTROUTE 4
+#define MSG_TRYHARD 4 /* Synonym for MSG_DONTROUTE for DECnet */
+#define MSG_CTRUNC 8
+#define MSG_PROBE 0x10 /* Do not send. Only probe path f.e. for MTU */
+#define MSG_TRUNC 0x20
+#define MSG_DONTWAIT 0x40 /* Nonblocking io */
+#define MSG_EOR 0x80 /* End of record */
+#define MSG_WAITALL 0x100 /* Wait for a full request */
+#define MSG_FIN 0x200
+#define MSG_SYN 0x400
+#define MSG_CONFIRM 0x800 /* Confirm path validity */
+#define MSG_RST 0x1000
+#define MSG_ERRQUEUE 0x2000 /* Fetch message from error queue */
+#define MSG_NOSIGNAL 0x4000 /* Do not generate SIGPIPE */
+#define MSG_MORE 0x8000 /* Sender will send more */
+
+#define MSG_EOF MSG_FIN
+
+#define MSG_CMSG_CLOEXEC 0x40000000 /* Set close_on_exit for file
+ descriptor received through
+ SCM_RIGHTS */
+#if defined(CONFIG_COMPAT)
+#define MSG_CMSG_COMPAT 0x80000000 /* This message needs 32 bit fixups */
+#else
+#define MSG_CMSG_COMPAT 0 /* We never have 32 bit fixups */
+#endif
+
+
+/* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx */
+#define SOL_IP 0
+/* #define SOL_ICMP 1 No-no-no! Due to Linux :-) we cannot use SOL_ICMP=1 */
+#define SOL_TCP 6
+#define SOL_UDP 17
+#define SOL_IPV6 41
+#define SOL_ICMPV6 58
+#define SOL_SCTP 132
+#define SOL_UDPLITE 136 /* UDP-Lite (RFC 3828) */
+#define SOL_RAW 255
+#define SOL_IPX 256
+#define SOL_AX25 257
+#define SOL_ATALK 258
+#define SOL_NETROM 259
+#define SOL_ROSE 260
+#define SOL_DECNET 261
+#define SOL_X25 262
+#define SOL_PACKET 263
+#define SOL_ATM 264 /* ATM layer (cell level) */
+#define SOL_AAL 265 /* ATM Adaption Layer (packet level) */
+#define SOL_IRDA 266
+#define SOL_NETBEUI 267
+#define SOL_LLC 268
+#define SOL_DCCP 269
+#define SOL_NETLINK 270
+#define SOL_TIPC 271
+#define SOL_RXRPC 272
+#define SOL_PPPOL2TP 273
+#define SOL_BLUETOOTH 274
+
+/* IPX options */
+#define IPX_TYPE 1
+
+#endif /* not kernel and not glibc */
+#endif /* _LINUX_SOCKET_H */
diff --git a/sysroot/usr/include/linux/sockios.h b/sysroot/usr/include/linux/sockios.h
new file mode 100644
index 0000000..abef759
--- /dev/null
+++ b/sysroot/usr/include/linux/sockios.h
@@ -0,0 +1,143 @@
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Definitions of the socket-level I/O control calls.
+ *
+ * Version: @(#)sockios.h 1.0.2 03/09/93
+ *
+ * Authors: Ross Biro
+ * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#ifndef _LINUX_SOCKIOS_H
+#define _LINUX_SOCKIOS_H
+
+#include <asm/sockios.h>
+
+/* Linux-specific socket ioctls */
+#define SIOCINQ FIONREAD
+#define SIOCOUTQ TIOCOUTQ
+
+/* Routing table calls. */
+#define SIOCADDRT 0x890B /* add routing table entry */
+#define SIOCDELRT 0x890C /* delete routing table entry */
+#define SIOCRTMSG 0x890D /* call to routing system */
+
+/* Socket configuration controls. */
+#define SIOCGIFNAME 0x8910 /* get iface name */
+#define SIOCSIFLINK 0x8911 /* set iface channel */
+#define SIOCGIFCONF 0x8912 /* get iface list */
+#define SIOCGIFFLAGS 0x8913 /* get flags */
+#define SIOCSIFFLAGS 0x8914 /* set flags */
+#define SIOCGIFADDR 0x8915 /* get PA address */
+#define SIOCSIFADDR 0x8916 /* set PA address */
+#define SIOCGIFDSTADDR 0x8917 /* get remote PA address */
+#define SIOCSIFDSTADDR 0x8918 /* set remote PA address */
+#define SIOCGIFBRDADDR 0x8919 /* get broadcast PA address */
+#define SIOCSIFBRDADDR 0x891a /* set broadcast PA address */
+#define SIOCGIFNETMASK 0x891b /* get network PA mask */
+#define SIOCSIFNETMASK 0x891c /* set network PA mask */
+#define SIOCGIFMETRIC 0x891d /* get metric */
+#define SIOCSIFMETRIC 0x891e /* set metric */
+#define SIOCGIFMEM 0x891f /* get memory address (BSD) */
+#define SIOCSIFMEM 0x8920 /* set memory address (BSD) */
+#define SIOCGIFMTU 0x8921 /* get MTU size */
+#define SIOCSIFMTU 0x8922 /* set MTU size */
+#define SIOCSIFNAME 0x8923 /* set interface name */
+#define SIOCSIFHWADDR 0x8924 /* set hardware address */
+#define SIOCGIFENCAP 0x8925 /* get/set encapsulations */
+#define SIOCSIFENCAP 0x8926
+#define SIOCGIFHWADDR 0x8927 /* Get hardware address */
+#define SIOCGIFSLAVE 0x8929 /* Driver slaving support */
+#define SIOCSIFSLAVE 0x8930
+#define SIOCADDMULTI 0x8931 /* Multicast address lists */
+#define SIOCDELMULTI 0x8932
+#define SIOCGIFINDEX 0x8933 /* name -> if_index mapping */
+#define SIOGIFINDEX SIOCGIFINDEX /* misprint compatibility :-) */
+#define SIOCSIFPFLAGS 0x8934 /* set/get extended flags set */
+#define SIOCGIFPFLAGS 0x8935
+#define SIOCDIFADDR 0x8936 /* delete PA address */
+#define SIOCSIFHWBROADCAST 0x8937 /* set hardware broadcast addr */
+#define SIOCGIFCOUNT 0x8938 /* get number of devices */
+
+#define SIOCGIFBR 0x8940 /* Bridging support */
+#define SIOCSIFBR 0x8941 /* Set bridging options */
+
+#define SIOCGIFTXQLEN 0x8942 /* Get the tx queue length */
+#define SIOCSIFTXQLEN 0x8943 /* Set the tx queue length */
+
+/* SIOCGIFDIVERT was: 0x8944 Frame diversion support */
+/* SIOCSIFDIVERT was: 0x8945 Set frame diversion options */
+
+#define SIOCETHTOOL 0x8946 /* Ethtool interface */
+
+#define SIOCGMIIPHY 0x8947 /* Get address of MII PHY in use. */
+#define SIOCGMIIREG 0x8948 /* Read MII PHY register. */
+#define SIOCSMIIREG 0x8949 /* Write MII PHY register. */
+
+#define SIOCWANDEV 0x894A /* get/set netdev parameters */
+
+/* ARP cache control calls. */
+ /* 0x8950 - 0x8952 * obsolete calls, don't re-use */
+#define SIOCDARP 0x8953 /* delete ARP table entry */
+#define SIOCGARP 0x8954 /* get ARP table entry */
+#define SIOCSARP 0x8955 /* set ARP table entry */
+
+/* RARP cache control calls. */
+#define SIOCDRARP 0x8960 /* delete RARP table entry */
+#define SIOCGRARP 0x8961 /* get RARP table entry */
+#define SIOCSRARP 0x8962 /* set RARP table entry */
+
+/* Driver configuration calls */
+
+#define SIOCGIFMAP 0x8970 /* Get device parameters */
+#define SIOCSIFMAP 0x8971 /* Set device parameters */
+
+/* DLCI configuration calls */
+
+#define SIOCADDDLCI 0x8980 /* Create new DLCI device */
+#define SIOCDELDLCI 0x8981 /* Delete DLCI device */
+
+#define SIOCGIFVLAN 0x8982 /* 802.1Q VLAN support */
+#define SIOCSIFVLAN 0x8983 /* Set 802.1Q VLAN options */
+
+/* bonding calls */
+
+#define SIOCBONDENSLAVE 0x8990 /* enslave a device to the bond */
+#define SIOCBONDRELEASE 0x8991 /* release a slave from the bond*/
+#define SIOCBONDSETHWADDR 0x8992 /* set the hw addr of the bond */
+#define SIOCBONDSLAVEINFOQUERY 0x8993 /* rtn info about slave state */
+#define SIOCBONDINFOQUERY 0x8994 /* rtn info about bond state */
+#define SIOCBONDCHANGEACTIVE 0x8995 /* update to a new active slave */
+
+/* bridge calls */
+#define SIOCBRADDBR 0x89a0 /* create new bridge device */
+#define SIOCBRDELBR 0x89a1 /* remove bridge device */
+#define SIOCBRADDIF 0x89a2 /* add interface to bridge */
+#define SIOCBRDELIF 0x89a3 /* remove interface from bridge */
+
+/* Device private ioctl calls */
+
+/*
+ * These 16 ioctls are available to devices via the do_ioctl() device
+ * vector. Each device should include this file and redefine these names
+ * as their own. Because these are device dependent it is a good idea
+ * _NOT_ to issue them to random objects and hope.
+ *
+ * THESE IOCTLS ARE _DEPRECATED_ AND WILL DISAPPEAR IN 2.5.X -DaveM
+ */
+
+#define SIOCDEVPRIVATE 0x89F0 /* to 89FF */
+
+/*
+ * These 16 ioctl calls are protocol private
+ */
+
+#define SIOCPROTOPRIVATE 0x89E0 /* to 89EF */
+#endif /* _LINUX_SOCKIOS_H */
diff --git a/sysroot/usr/include/linux/som.h b/sysroot/usr/include/linux/som.h
new file mode 100644
index 0000000..166594e
--- /dev/null
+++ b/sysroot/usr/include/linux/som.h
@@ -0,0 +1,154 @@
+#ifndef _LINUX_SOM_H
+#define _LINUX_SOM_H
+
+/* File format definition for SOM executables / shared libraries */
+
+/* we need struct timespec */
+#include <linux/time.h>
+
+#define SOM_PAGESIZE 4096
+
+/* this is the SOM header */
+struct som_hdr {
+ short system_id; /* magic number - system */
+ short a_magic; /* magic number - file type */
+ unsigned int version_id; /* versiod ID: YYMMDDHH */
+ struct timespec file_time; /* system clock */
+ unsigned int entry_space; /* space for entry point */
+ unsigned int entry_subspace; /* subspace for entry point */
+ unsigned int entry_offset; /* offset of entry point */
+ unsigned int aux_header_location; /* auxiliary header location */
+ unsigned int aux_header_size; /* auxiliary header size */
+ unsigned int som_length; /* length of entire SOM */
+ unsigned int presumed_dp; /* compiler's DP value */
+ unsigned int space_location; /* space dictionary location */
+ unsigned int space_total; /* number of space entries */
+ unsigned int subspace_location; /* subspace entries location */
+ unsigned int subspace_total; /* number of subspace entries */
+ unsigned int loader_fixup_location; /* MPE/iX loader fixup */
+ unsigned int loader_fixup_total; /* number of fixup records */
+ unsigned int space_strings_location; /* (sub)space names */
+ unsigned int space_strings_size; /* size of strings area */
+ unsigned int init_array_location; /* reserved */
+ unsigned int init_array_total; /* reserved */
+ unsigned int compiler_location; /* module dictionary */
+ unsigned int compiler_total; /* number of modules */
+ unsigned int symbol_location; /* symbol dictionary */
+ unsigned int symbol_total; /* number of symbols */
+ unsigned int fixup_request_location; /* fixup requests */
+ unsigned int fixup_request_total; /* number of fixup requests */
+ unsigned int symbol_strings_location;/* module & symbol names area */
+ unsigned int symbol_strings_size; /* size of strings area */
+ unsigned int unloadable_sp_location; /* unloadable spaces location */
+ unsigned int unloadable_sp_size; /* size of data */
+ unsigned int checksum;
+};
+
+/* values for system_id */
+
+#define SOM_SID_PARISC_1_0 0x020b
+#define SOM_SID_PARISC_1_1 0x0210
+#define SOM_SID_PARISC_2_0 0x0214
+
+/* values for a_magic */
+
+#define SOM_LIB_EXEC 0x0104
+#define SOM_RELOCATABLE 0x0106
+#define SOM_EXEC_NONSHARE 0x0107
+#define SOM_EXEC_SHARE 0x0108
+#define SOM_EXEC_DEMAND 0x010B
+#define SOM_LIB_DYN 0x010D
+#define SOM_LIB_SHARE 0x010E
+#define SOM_LIB_RELOC 0x0619
+
+/* values for version_id. Decimal not hex, yes. Grr. */
+
+#define SOM_ID_OLD 85082112
+#define SOM_ID_NEW 87102412
+
+struct aux_id {
+ unsigned int mandatory :1; /* the linker must understand this */
+ unsigned int copy :1; /* Must be copied by the linker */
+ unsigned int append :1; /* Must be merged by the linker */
+ unsigned int ignore :1; /* Discard section if unknown */
+ unsigned int reserved :12;
+ unsigned int type :16; /* Header type */
+ unsigned int length; /* length of _following_ data */
+};
+
+/* The Exec Auxiliary Header. Called The HP-UX Header within HP apparently. */
+struct som_exec_auxhdr {
+ struct aux_id som_auxhdr;
+ int exec_tsize; /* Text size in bytes */
+ int exec_tmem; /* Address to load text at */
+ int exec_tfile; /* Location of text in file */
+ int exec_dsize; /* Data size in bytes */
+ int exec_dmem; /* Address to load data at */
+ int exec_dfile; /* Location of data in file */
+ int exec_bsize; /* Uninitialised data (bss) */
+ int exec_entry; /* Address to start executing */
+ int exec_flags; /* loader flags */
+ int exec_bfill; /* initialisation value for bss */
+};
+
+/* Oh, the things people do to avoid casts. Shame it'll break with gcc's
+ * new aliasing rules really.
+ */
+union name_pt {
+ char * n_name;
+ unsigned int n_strx;
+};
+
+/* The Space Dictionary */
+struct space_dictionary_record {
+ union name_pt name; /* index to subspace name */
+ unsigned int is_loadable :1; /* loadable */
+ unsigned int is_defined :1; /* defined within file */
+ unsigned int is_private :1; /* not sharable */
+ unsigned int has_intermediate_code :1; /* contains intermediate code */
+ unsigned int is_tspecific :1; /* thread specific */
+ unsigned int reserved :11; /* for future expansion */
+ unsigned int sort_key :8; /* for linker */
+ unsigned int reserved2 :8; /* for future expansion */
+
+ int space_number; /* index */
+ int subspace_index; /* index into subspace dict */
+ unsigned int subspace_quantity; /* number of subspaces */
+ int loader_fix_index; /* for loader */
+ unsigned int loader_fix_quantity; /* for loader */
+ int init_pointer_index; /* data pointer array index */
+ unsigned int init_pointer_quantity; /* number of data pointers */
+};
+
+/* The Subspace Dictionary */
+struct subspace_dictionary_record {
+ int space_index;
+ unsigned int access_control_bits :7;
+ unsigned int memory_resident :1;
+ unsigned int dup_common :1;
+ unsigned int is_common :1;
+ unsigned int quadrant :2;
+ unsigned int initially_frozen :1;
+ unsigned int is_first :1;
+ unsigned int code_only :1;
+ unsigned int sort_key :8;
+ unsigned int replicate_init :1;
+ unsigned int continuation :1;
+ unsigned int is_tspecific :1;
+ unsigned int is_comdat :1;
+ unsigned int reserved :4;
+
+ int file_loc_init_value;
+ unsigned int initialization_length;
+ unsigned int subspace_start;
+ unsigned int subspace_length;
+
+ unsigned int reserved2 :5;
+ unsigned int alignment :27;
+
+ union name_pt name;
+ int fixup_request_index;
+ unsigned int fixup_request_quantity;
+};
+
+#endif /* _LINUX_SOM_H */
diff --git a/sysroot/usr/include/linux/sonet.h b/sysroot/usr/include/linux/sonet.h
new file mode 100644
index 0000000..c68a6af
--- /dev/null
+++ b/sysroot/usr/include/linux/sonet.h
@@ -0,0 +1,60 @@
+/* sonet.h - SONET/SHD physical layer control */
+
+/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
+
+
+#ifndef LINUX_SONET_H
+#define LINUX_SONET_H
+
+#define __SONET_ITEMS \
+ __HANDLE_ITEM(section_bip); /* section parity errors (B1) */ \
+ __HANDLE_ITEM(line_bip); /* line parity errors (B2) */ \
+ __HANDLE_ITEM(path_bip); /* path parity errors (B3) */ \
+ __HANDLE_ITEM(line_febe); /* line parity errors at remote */ \
+ __HANDLE_ITEM(path_febe); /* path parity errors at remote */ \
+ __HANDLE_ITEM(corr_hcs); /* correctable header errors */ \
+ __HANDLE_ITEM(uncorr_hcs); /* uncorrectable header errors */ \
+ __HANDLE_ITEM(tx_cells); /* cells sent */ \
+ __HANDLE_ITEM(rx_cells); /* cells received */
+
+struct sonet_stats {
+#define __HANDLE_ITEM(i) int i
+ __SONET_ITEMS
+#undef __HANDLE_ITEM
+} __attribute__ ((packed));
+
+
+#define SONET_GETSTAT _IOR('a',ATMIOC_PHYTYP,struct sonet_stats)
+ /* get statistics */
+#define SONET_GETSTATZ _IOR('a',ATMIOC_PHYTYP+1,struct sonet_stats)
+ /* ... and zero counters */
+#define SONET_SETDIAG _IOWR('a',ATMIOC_PHYTYP+2,int)
+ /* set error insertion */
+#define SONET_CLRDIAG _IOWR('a',ATMIOC_PHYTYP+3,int)
+ /* clear error insertion */
+#define SONET_GETDIAG _IOR('a',ATMIOC_PHYTYP+4,int)
+ /* query error insertion */
+#define SONET_SETFRAMING _IO('a',ATMIOC_PHYTYP+5)
+ /* set framing mode (SONET/SDH) */
+#define SONET_GETFRAMING _IOR('a',ATMIOC_PHYTYP+6,int)
+ /* get framing mode */
+#define SONET_GETFRSENSE _IOR('a',ATMIOC_PHYTYP+7, \
+ unsigned char[SONET_FRSENSE_SIZE]) /* get framing sense information */
+
+#define SONET_INS_SBIP 1 /* section BIP */
+#define SONET_INS_LBIP 2 /* line BIP */
+#define SONET_INS_PBIP 4 /* path BIP */
+#define SONET_INS_FRAME 8 /* out of frame */
+#define SONET_INS_LOS 16 /* set line to zero */
+#define SONET_INS_LAIS 32 /* line alarm indication signal */
+#define SONET_INS_PAIS 64 /* path alarm indication signal */
+#define SONET_INS_HCS 128 /* insert HCS error */
+
+#define SONET_FRAME_SONET 0 /* SONET STS-3 framing */
+#define SONET_FRAME_SDH 1 /* SDH STM-1 framing */
+
+#define SONET_FRSENSE_SIZE 6 /* C1[3],H1[3] (0xff for unknown) */
+
+
+
+#endif
diff --git a/sysroot/usr/include/linux/sonypi.h b/sysroot/usr/include/linux/sonypi.h
new file mode 100644
index 0000000..9096ec1
--- /dev/null
+++ b/sysroot/usr/include/linux/sonypi.h
@@ -0,0 +1,133 @@
+/*
+ * Sony Programmable I/O Control Device driver for VAIO
+ *
+ * Copyright (C) 2001-2005 Stelian Pop <stelian@popies.net>
+ *
+ * Copyright (C) 2005 Narayanan R S <nars@kadamba.org>
+
+ * Copyright (C) 2001-2002 Alcôve <www.alcove.com>
+ *
+ * Copyright (C) 2001 Michael Ashley <m.ashley@unsw.edu.au>
+ *
+ * Copyright (C) 2001 Junichi Morita <jun1m@mars.dti.ne.jp>
+ *
+ * Copyright (C) 2000 Takaya Kinjo <t-kinjo@tc4.so-net.ne.jp>
+ *
+ * Copyright (C) 2000 Andrew Tridgell <tridge@valinux.com>
+ *
+ * Earlier work by Werner Almesberger, Paul `Rusty' Russell and Paul Mackerras.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#ifndef _SONYPI_H_
+#define _SONYPI_H_
+
+#include <linux/types.h>
+
+/* events the user application reading /dev/sonypi can use */
+
+#define SONYPI_EVENT_JOGDIAL_DOWN 1
+#define SONYPI_EVENT_JOGDIAL_UP 2
+#define SONYPI_EVENT_JOGDIAL_DOWN_PRESSED 3
+#define SONYPI_EVENT_JOGDIAL_UP_PRESSED 4
+#define SONYPI_EVENT_JOGDIAL_PRESSED 5
+#define SONYPI_EVENT_JOGDIAL_RELEASED 6 /* obsolete */
+#define SONYPI_EVENT_CAPTURE_PRESSED 7
+#define SONYPI_EVENT_CAPTURE_RELEASED 8 /* obsolete */
+#define SONYPI_EVENT_CAPTURE_PARTIALPRESSED 9
+#define SONYPI_EVENT_CAPTURE_PARTIALRELEASED 10
+#define SONYPI_EVENT_FNKEY_ESC 11
+#define SONYPI_EVENT_FNKEY_F1 12
+#define SONYPI_EVENT_FNKEY_F2 13
+#define SONYPI_EVENT_FNKEY_F3 14
+#define SONYPI_EVENT_FNKEY_F4 15
+#define SONYPI_EVENT_FNKEY_F5 16
+#define SONYPI_EVENT_FNKEY_F6 17
+#define SONYPI_EVENT_FNKEY_F7 18
+#define SONYPI_EVENT_FNKEY_F8 19
+#define SONYPI_EVENT_FNKEY_F9 20
+#define SONYPI_EVENT_FNKEY_F10 21
+#define SONYPI_EVENT_FNKEY_F11 22
+#define SONYPI_EVENT_FNKEY_F12 23
+#define SONYPI_EVENT_FNKEY_1 24
+#define SONYPI_EVENT_FNKEY_2 25
+#define SONYPI_EVENT_FNKEY_D 26
+#define SONYPI_EVENT_FNKEY_E 27
+#define SONYPI_EVENT_FNKEY_F 28
+#define SONYPI_EVENT_FNKEY_S 29
+#define SONYPI_EVENT_FNKEY_B 30
+#define SONYPI_EVENT_BLUETOOTH_PRESSED 31
+#define SONYPI_EVENT_PKEY_P1 32
+#define SONYPI_EVENT_PKEY_P2 33
+#define SONYPI_EVENT_PKEY_P3 34
+#define SONYPI_EVENT_BACK_PRESSED 35
+#define SONYPI_EVENT_LID_CLOSED 36
+#define SONYPI_EVENT_LID_OPENED 37
+#define SONYPI_EVENT_BLUETOOTH_ON 38
+#define SONYPI_EVENT_BLUETOOTH_OFF 39
+#define SONYPI_EVENT_HELP_PRESSED 40
+#define SONYPI_EVENT_FNKEY_ONLY 41
+#define SONYPI_EVENT_JOGDIAL_FAST_DOWN 42
+#define SONYPI_EVENT_JOGDIAL_FAST_UP 43
+#define SONYPI_EVENT_JOGDIAL_FAST_DOWN_PRESSED 44
+#define SONYPI_EVENT_JOGDIAL_FAST_UP_PRESSED 45
+#define SONYPI_EVENT_JOGDIAL_VFAST_DOWN 46
+#define SONYPI_EVENT_JOGDIAL_VFAST_UP 47
+#define SONYPI_EVENT_JOGDIAL_VFAST_DOWN_PRESSED 48
+#define SONYPI_EVENT_JOGDIAL_VFAST_UP_PRESSED 49
+#define SONYPI_EVENT_ZOOM_PRESSED 50
+#define SONYPI_EVENT_THUMBPHRASE_PRESSED 51
+#define SONYPI_EVENT_MEYE_FACE 52
+#define SONYPI_EVENT_MEYE_OPPOSITE 53
+#define SONYPI_EVENT_MEMORYSTICK_INSERT 54
+#define SONYPI_EVENT_MEMORYSTICK_EJECT 55
+#define SONYPI_EVENT_ANYBUTTON_RELEASED 56
+#define SONYPI_EVENT_BATTERY_INSERT 57
+#define SONYPI_EVENT_BATTERY_REMOVE 58
+#define SONYPI_EVENT_FNKEY_RELEASED 59
+#define SONYPI_EVENT_WIRELESS_ON 60
+#define SONYPI_EVENT_WIRELESS_OFF 61
+
+/* get/set brightness */
+#define SONYPI_IOCGBRT _IOR('v', 0, __u8)
+#define SONYPI_IOCSBRT _IOW('v', 0, __u8)
+
+/* get battery full capacity/remaining capacity */
+#define SONYPI_IOCGBAT1CAP _IOR('v', 2, __u16)
+#define SONYPI_IOCGBAT1REM _IOR('v', 3, __u16)
+#define SONYPI_IOCGBAT2CAP _IOR('v', 4, __u16)
+#define SONYPI_IOCGBAT2REM _IOR('v', 5, __u16)
+
+/* get battery flags: battery1/battery2/ac adapter present */
+#define SONYPI_BFLAGS_B1 0x01
+#define SONYPI_BFLAGS_B2 0x02
+#define SONYPI_BFLAGS_AC 0x04
+#define SONYPI_IOCGBATFLAGS _IOR('v', 7, __u8)
+
+/* get/set bluetooth subsystem state on/off */
+#define SONYPI_IOCGBLUE _IOR('v', 8, __u8)
+#define SONYPI_IOCSBLUE _IOW('v', 9, __u8)
+
+/* get/set fan state on/off */
+#define SONYPI_IOCGFAN _IOR('v', 10, __u8)
+#define SONYPI_IOCSFAN _IOW('v', 11, __u8)
+
+/* get temperature (C) */
+#define SONYPI_IOCGTEMP _IOR('v', 12, __u8)
+
+
+#endif /* _SONYPI_H_ */
diff --git a/sysroot/usr/include/linux/sound.h b/sysroot/usr/include/linux/sound.h
new file mode 100644
index 0000000..9e2a94f
--- /dev/null
+++ b/sysroot/usr/include/linux/sound.h
@@ -0,0 +1,42 @@
+
+/*
+ * Minor numbers for the sound driver.
+ */
+
+#include <linux/fs.h>
+
+#define SND_DEV_CTL 0 /* Control port /dev/mixer */
+#define SND_DEV_SEQ 1 /* Sequencer output /dev/sequencer (FM
+ synthesizer and MIDI output) */
+#define SND_DEV_MIDIN 2 /* Raw midi access */
+#define SND_DEV_DSP 3 /* Digitized voice /dev/dsp */
+#define SND_DEV_AUDIO 4 /* Sparc compatible /dev/audio */
+#define SND_DEV_DSP16 5 /* Like /dev/dsp but 16 bits/sample */
+/* #define SND_DEV_STATUS 6 */ /* /dev/sndstat (obsolete) */
+#define SND_DEV_UNUSED 6
+#define SND_DEV_AWFM 7 /* Reserved */
+#define SND_DEV_SEQ2 8 /* /dev/sequencer, level 2 interface */
+/* #define SND_DEV_SNDPROC 9 */ /* /dev/sndproc for programmable devices (not used) */
+/* #define SND_DEV_DMMIDI 9 */
+#define SND_DEV_SYNTH 9 /* Raw synth access /dev/synth (same as /dev/dmfm) */
+#define SND_DEV_DMFM 10 /* Raw synth access /dev/dmfm */
+#define SND_DEV_UNKNOWN11 11
+#define SND_DEV_ADSP 12 /* Like /dev/dsp (obsolete) */
+#define SND_DEV_AMIDI 13 /* Like /dev/midi (obsolete) */
+#define SND_DEV_ADMMIDI 14 /* Like /dev/dmmidi (onsolete) */
+
+/*
+ * Sound core interface functions
+ */
+
+struct device;
+extern int register_sound_special(const struct file_operations *fops, int unit);
+extern int register_sound_special_device(const struct file_operations *fops, int unit, struct device *dev);
+extern int register_sound_mixer(const struct file_operations *fops, int dev);
+extern int register_sound_midi(const struct file_operations *fops, int dev);
+extern int register_sound_dsp(const struct file_operations *fops, int dev);
+
+extern void unregister_sound_special(int unit);
+extern void unregister_sound_mixer(int unit);
+extern void unregister_sound_midi(int unit);
+extern void unregister_sound_dsp(int unit);
diff --git a/sysroot/usr/include/linux/soundcard.h b/sysroot/usr/include/linux/soundcard.h
new file mode 100644
index 0000000..4fd33a6
--- /dev/null
+++ b/sysroot/usr/include/linux/soundcard.h
@@ -0,0 +1,1306 @@
+#ifndef SOUNDCARD_H
+#define SOUNDCARD_H
+/*
+ * Copyright by Hannu Savolainen 1993-1997
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met: 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer. 2.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+/*
+ * OSS interface version. With versions earlier than 3.6 this value is
+ * an integer with value less than 361. In versions 3.6 and later
+ * it's a six digit hexadecimal value. For example value
+ * of 0x030600 represents OSS version 3.6.0.
+ * Use ioctl(fd, OSS_GETVERSION, &int) to get the version number of
+ * the currently active driver.
+ */
+#define SOUND_VERSION 0x030802
+#define OPEN_SOUND_SYSTEM
+
+/* In Linux we need to be prepared for cross compiling */
+#include <linux/ioctl.h>
+
+/* Endian macros. */
+# include <endian.h>
+
+/*
+ * Supported card ID numbers (Should be somewhere else?)
+ */
+
+#define SNDCARD_ADLIB 1
+#define SNDCARD_SB 2
+#define SNDCARD_PAS 3
+#define SNDCARD_GUS 4
+#define SNDCARD_MPU401 5
+#define SNDCARD_SB16 6
+#define SNDCARD_SB16MIDI 7
+#define SNDCARD_UART6850 8
+#define SNDCARD_GUS16 9
+#define SNDCARD_MSS 10
+#define SNDCARD_PSS 11
+#define SNDCARD_SSCAPE 12
+#define SNDCARD_PSS_MPU 13
+#define SNDCARD_PSS_MSS 14
+#define SNDCARD_SSCAPE_MSS 15
+#define SNDCARD_TRXPRO 16
+#define SNDCARD_TRXPRO_SB 17
+#define SNDCARD_TRXPRO_MPU 18
+#define SNDCARD_MAD16 19
+#define SNDCARD_MAD16_MPU 20
+#define SNDCARD_CS4232 21
+#define SNDCARD_CS4232_MPU 22
+#define SNDCARD_MAUI 23
+#define SNDCARD_PSEUDO_MSS 24
+#define SNDCARD_GUSPNP 25
+#define SNDCARD_UART401 26
+/* Sound card numbers 27 to N are reserved. Don't add more numbers here. */
+
+/***********************************
+ * IOCTL Commands for /dev/sequencer
+ */
+
+#ifndef _SIOWR
+#if defined(_IOWR) && (defined(_AIX) || (!defined(sun) && !defined(sparc) && !defined(__sparc__) && !defined(__INCioctlh) && !defined(__Lynx__)))
+/* Use already defined ioctl defines if they exist (except with Sun or Sparc) */
+#define SIOCPARM_MASK IOCPARM_MASK
+#define SIOC_VOID IOC_VOID
+#define SIOC_OUT IOC_OUT
+#define SIOC_IN IOC_IN
+#define SIOC_INOUT IOC_INOUT
+#define _SIOC_SIZE _IOC_SIZE
+#define _SIOC_DIR _IOC_DIR
+#define _SIOC_NONE _IOC_NONE
+#define _SIOC_READ _IOC_READ
+#define _SIOC_WRITE _IOC_WRITE
+#define _SIO _IO
+#define _SIOR _IOR
+#define _SIOW _IOW
+#define _SIOWR _IOWR
+#else
+
+/* Ioctl's have the command encoded in the lower word,
+ * and the size of any in or out parameters in the upper
+ * word. The high 2 bits of the upper word are used
+ * to encode the in/out status of the parameter; for now
+ * we restrict parameters to at most 8191 bytes.
+ */
+/* #define SIOCTYPE (0xff<<8) */
+#define SIOCPARM_MASK 0x1fff /* parameters must be < 8192 bytes */
+#define SIOC_VOID 0x00000000 /* no parameters */
+#define SIOC_OUT 0x20000000 /* copy out parameters */
+#define SIOC_IN 0x40000000 /* copy in parameters */
+#define SIOC_INOUT (SIOC_IN|SIOC_OUT)
+/* the 0x20000000 is so we can distinguish new ioctl's from old */
+#define _SIO(x,y) ((int)(SIOC_VOID|(x<<8)|y))
+#define _SIOR(x,y,t) ((int)(SIOC_OUT|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
+#define _SIOW(x,y,t) ((int)(SIOC_IN|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
+/* this should be _SIORW, but stdio got there first */
+#define _SIOWR(x,y,t) ((int)(SIOC_INOUT|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
+#define _SIOC_SIZE(x) ((x>>16)&SIOCPARM_MASK)
+#define _SIOC_DIR(x) (x & 0xf0000000)
+#define _SIOC_NONE SIOC_VOID
+#define _SIOC_READ SIOC_OUT
+#define _SIOC_WRITE SIOC_IN
+# endif /* _IOWR */
+#endif /* !_SIOWR */
+
+#define SNDCTL_SEQ_RESET _SIO ('Q', 0)
+#define SNDCTL_SEQ_SYNC _SIO ('Q', 1)
+#define SNDCTL_SYNTH_INFO _SIOWR('Q', 2, struct synth_info)
+#define SNDCTL_SEQ_CTRLRATE _SIOWR('Q', 3, int) /* Set/get timer resolution (HZ) */
+#define SNDCTL_SEQ_GETOUTCOUNT _SIOR ('Q', 4, int)
+#define SNDCTL_SEQ_GETINCOUNT _SIOR ('Q', 5, int)
+#define SNDCTL_SEQ_PERCMODE _SIOW ('Q', 6, int)
+#define SNDCTL_FM_LOAD_INSTR _SIOW ('Q', 7, struct sbi_instrument) /* Obsolete. Don't use!!!!!! */
+#define SNDCTL_SEQ_TESTMIDI _SIOW ('Q', 8, int)
+#define SNDCTL_SEQ_RESETSAMPLES _SIOW ('Q', 9, int)
+#define SNDCTL_SEQ_NRSYNTHS _SIOR ('Q',10, int)
+#define SNDCTL_SEQ_NRMIDIS _SIOR ('Q',11, int)
+#define SNDCTL_MIDI_INFO _SIOWR('Q',12, struct midi_info)
+#define SNDCTL_SEQ_THRESHOLD _SIOW ('Q',13, int)
+#define SNDCTL_SYNTH_MEMAVL _SIOWR('Q',14, int) /* in=dev#, out=memsize */
+#define SNDCTL_FM_4OP_ENABLE _SIOW ('Q',15, int) /* in=dev# */
+#define SNDCTL_SEQ_PANIC _SIO ('Q',17)
+#define SNDCTL_SEQ_OUTOFBAND _SIOW ('Q',18, struct seq_event_rec)
+#define SNDCTL_SEQ_GETTIME _SIOR ('Q',19, int)
+#define SNDCTL_SYNTH_ID _SIOWR('Q',20, struct synth_info)
+#define SNDCTL_SYNTH_CONTROL _SIOWR('Q',21, struct synth_control)
+#define SNDCTL_SYNTH_REMOVESAMPLE _SIOWR('Q',22, struct remove_sample)
+
+typedef struct synth_control
+{
+ int devno; /* Synthesizer # */
+ char data[4000]; /* Device spesific command/data record */
+}synth_control;
+
+typedef struct remove_sample
+{
+ int devno; /* Synthesizer # */
+ int bankno; /* MIDI bank # (0=General MIDI) */
+ int instrno; /* MIDI instrument number */
+} remove_sample;
+
+typedef struct seq_event_rec {
+ unsigned char arr[8];
+} seq_event_rec;
+
+#define SNDCTL_TMR_TIMEBASE _SIOWR('T', 1, int)
+#define SNDCTL_TMR_START _SIO ('T', 2)
+#define SNDCTL_TMR_STOP _SIO ('T', 3)
+#define SNDCTL_TMR_CONTINUE _SIO ('T', 4)
+#define SNDCTL_TMR_TEMPO _SIOWR('T', 5, int)
+#define SNDCTL_TMR_SOURCE _SIOWR('T', 6, int)
+# define TMR_INTERNAL 0x00000001
+# define TMR_EXTERNAL 0x00000002
+# define TMR_MODE_MIDI 0x00000010
+# define TMR_MODE_FSK 0x00000020
+# define TMR_MODE_CLS 0x00000040
+# define TMR_MODE_SMPTE 0x00000080
+#define SNDCTL_TMR_METRONOME _SIOW ('T', 7, int)
+#define SNDCTL_TMR_SELECT _SIOW ('T', 8, int)
+
+/*
+ * Some big endian/little endian handling macros
+ */
+
+#define _LINUX_PATCHKEY_H_INDIRECT
+#include <linux/patchkey.h>
+#undef _LINUX_PATCHKEY_H_INDIRECT
+
+#if defined(__BYTE_ORDER)
+# if __BYTE_ORDER == __BIG_ENDIAN
+# define AFMT_S16_NE AFMT_S16_BE
+# elif __BYTE_ORDER == __LITTLE_ENDIAN
+# define AFMT_S16_NE AFMT_S16_LE
+# else
+# error "could not determine byte order"
+# endif
+#endif
+
+/*
+ * Sample loading mechanism for internal synthesizers (/dev/sequencer)
+ * The following patch_info structure has been designed to support
+ * Gravis UltraSound. It tries to be universal format for uploading
+ * sample based patches but is probably too limited.
+ *
+ * (PBD) As Hannu guessed, the GUS structure is too limited for
+ * the WaveFront, but this is the right place for a constant definition.
+ */
+
+struct patch_info {
+ unsigned short key; /* Use WAVE_PATCH here */
+#define WAVE_PATCH _PATCHKEY(0x04)
+#define GUS_PATCH WAVE_PATCH
+#define WAVEFRONT_PATCH _PATCHKEY(0x06)
+
+ short device_no; /* Synthesizer number */
+ short instr_no; /* Midi pgm# */
+
+ unsigned int mode;
+/*
+ * The least significant byte has the same format than the GUS .PAT
+ * files
+ */
+#define WAVE_16_BITS 0x01 /* bit 0 = 8 or 16 bit wave data. */
+#define WAVE_UNSIGNED 0x02 /* bit 1 = Signed - Unsigned data. */
+#define WAVE_LOOPING 0x04 /* bit 2 = looping enabled-1. */
+#define WAVE_BIDIR_LOOP 0x08 /* bit 3 = Set is bidirectional looping. */
+#define WAVE_LOOP_BACK 0x10 /* bit 4 = Set is looping backward. */
+#define WAVE_SUSTAIN_ON 0x20 /* bit 5 = Turn sustaining on. (Env. pts. 3)*/
+#define WAVE_ENVELOPES 0x40 /* bit 6 = Enable envelopes - 1 */
+#define WAVE_FAST_RELEASE 0x80 /* bit 7 = Shut off immediately after note off */
+ /* (use the env_rate/env_offs fields). */
+/* Linux specific bits */
+#define WAVE_VIBRATO 0x00010000 /* The vibrato info is valid */
+#define WAVE_TREMOLO 0x00020000 /* The tremolo info is valid */
+#define WAVE_SCALE 0x00040000 /* The scaling info is valid */
+#define WAVE_FRACTIONS 0x00080000 /* Fraction information is valid */
+/* Reserved bits */
+#define WAVE_ROM 0x40000000 /* For future use */
+#define WAVE_MULAW 0x20000000 /* For future use */
+/* Other bits must be zeroed */
+
+ int len; /* Size of the wave data in bytes */
+ int loop_start, loop_end; /* Byte offsets from the beginning */
+
+/*
+ * The base_freq and base_note fields are used when computing the
+ * playback speed for a note. The base_note defines the tone frequency
+ * which is heard if the sample is played using the base_freq as the
+ * playback speed.
+ *
+ * The low_note and high_note fields define the minimum and maximum note
+ * frequencies for which this sample is valid. It is possible to define
+ * more than one samples for an instrument number at the same time. The
+ * low_note and high_note fields are used to select the most suitable one.
+ *
+ * The fields base_note, high_note and low_note should contain
+ * the note frequency multiplied by 1000. For example value for the
+ * middle A is 440*1000.
+ */
+
+ unsigned int base_freq;
+ unsigned int base_note;
+ unsigned int high_note;
+ unsigned int low_note;
+ int panning; /* -128=left, 127=right */
+ int detuning;
+
+/* New fields introduced in version 1.99.5 */
+
+ /* Envelope. Enabled by mode bit WAVE_ENVELOPES */
+ unsigned char env_rate[ 6 ]; /* GUS HW ramping rate */
+ unsigned char env_offset[ 6 ]; /* 255 == 100% */
+
+ /*
+ * The tremolo, vibrato and scale info are not supported yet.
+ * Enable by setting the mode bits WAVE_TREMOLO, WAVE_VIBRATO or
+ * WAVE_SCALE
+ */
+
+ unsigned char tremolo_sweep;
+ unsigned char tremolo_rate;
+ unsigned char tremolo_depth;
+
+ unsigned char vibrato_sweep;
+ unsigned char vibrato_rate;
+ unsigned char vibrato_depth;
+
+ int scale_frequency;
+ unsigned int scale_factor; /* from 0 to 2048 or 0 to 2 */
+
+ int volume;
+ int fractions;
+ int reserved1;
+ int spare[2];
+ char data[1]; /* The waveform data starts here */
+ };
+
+struct sysex_info {
+ short key; /* Use SYSEX_PATCH or MAUI_PATCH here */
+#define SYSEX_PATCH _PATCHKEY(0x05)
+#define MAUI_PATCH _PATCHKEY(0x06)
+ short device_no; /* Synthesizer number */
+ int len; /* Size of the sysex data in bytes */
+ unsigned char data[1]; /* Sysex data starts here */
+ };
+
+/*
+ * /dev/sequencer input events.
+ *
+ * The data written to the /dev/sequencer is a stream of events. Events
+ * are records of 4 or 8 bytes. The first byte defines the size.
+ * Any number of events can be written with a write call. There
+ * is a set of macros for sending these events. Use these macros if you
+ * want to maximize portability of your program.
+ *
+ * Events SEQ_WAIT, SEQ_MIDIPUTC and SEQ_ECHO. Are also input events.
+ * (All input events are currently 4 bytes long. Be prepared to support
+ * 8 byte events also. If you receive any event having first byte >= 128,
+ * it's a 8 byte event.
+ *
+ * The events are documented at the end of this file.
+ *
+ * Normal events (4 bytes)
+ * There is also a 8 byte version of most of the 4 byte events. The
+ * 8 byte one is recommended.
+ */
+#define SEQ_NOTEOFF 0
+#define SEQ_FMNOTEOFF SEQ_NOTEOFF /* Just old name */
+#define SEQ_NOTEON 1
+#define SEQ_FMNOTEON SEQ_NOTEON
+#define SEQ_WAIT TMR_WAIT_ABS
+#define SEQ_PGMCHANGE 3
+#define SEQ_FMPGMCHANGE SEQ_PGMCHANGE
+#define SEQ_SYNCTIMER TMR_START
+#define SEQ_MIDIPUTC 5
+#define SEQ_DRUMON 6 /*** OBSOLETE ***/
+#define SEQ_DRUMOFF 7 /*** OBSOLETE ***/
+#define SEQ_ECHO TMR_ECHO /* For synching programs with output */
+#define SEQ_AFTERTOUCH 9
+#define SEQ_CONTROLLER 10
+
+/*******************************************
+ * Midi controller numbers
+ *******************************************
+ * Controllers 0 to 31 (0x00 to 0x1f) and
+ * 32 to 63 (0x20 to 0x3f) are continuous
+ * controllers.
+ * In the MIDI 1.0 these controllers are sent using
+ * two messages. Controller numbers 0 to 31 are used
+ * to send the MSB and the controller numbers 32 to 63
+ * are for the LSB. Note that just 7 bits are used in MIDI bytes.
+ */
+
+#define CTL_BANK_SELECT 0x00
+#define CTL_MODWHEEL 0x01
+#define CTL_BREATH 0x02
+/* undefined 0x03 */
+#define CTL_FOOT 0x04
+#define CTL_PORTAMENTO_TIME 0x05
+#define CTL_DATA_ENTRY 0x06
+#define CTL_MAIN_VOLUME 0x07
+#define CTL_BALANCE 0x08
+/* undefined 0x09 */
+#define CTL_PAN 0x0a
+#define CTL_EXPRESSION 0x0b
+/* undefined 0x0c */
+/* undefined 0x0d */
+/* undefined 0x0e */
+/* undefined 0x0f */
+#define CTL_GENERAL_PURPOSE1 0x10
+#define CTL_GENERAL_PURPOSE2 0x11
+#define CTL_GENERAL_PURPOSE3 0x12
+#define CTL_GENERAL_PURPOSE4 0x13
+/* undefined 0x14 - 0x1f */
+
+/* undefined 0x20 */
+/* The controller numbers 0x21 to 0x3f are reserved for the */
+/* least significant bytes of the controllers 0x00 to 0x1f. */
+/* These controllers are not recognised by the driver. */
+
+/* Controllers 64 to 69 (0x40 to 0x45) are on/off switches. */
+/* 0=OFF and 127=ON (intermediate values are possible) */
+#define CTL_DAMPER_PEDAL 0x40
+#define CTL_SUSTAIN 0x40 /* Alias */
+#define CTL_HOLD 0x40 /* Alias */
+#define CTL_PORTAMENTO 0x41
+#define CTL_SOSTENUTO 0x42
+#define CTL_SOFT_PEDAL 0x43
+/* undefined 0x44 */
+#define CTL_HOLD2 0x45
+/* undefined 0x46 - 0x4f */
+
+#define CTL_GENERAL_PURPOSE5 0x50
+#define CTL_GENERAL_PURPOSE6 0x51
+#define CTL_GENERAL_PURPOSE7 0x52
+#define CTL_GENERAL_PURPOSE8 0x53
+/* undefined 0x54 - 0x5a */
+#define CTL_EXT_EFF_DEPTH 0x5b
+#define CTL_TREMOLO_DEPTH 0x5c
+#define CTL_CHORUS_DEPTH 0x5d
+#define CTL_DETUNE_DEPTH 0x5e
+#define CTL_CELESTE_DEPTH 0x5e /* Alias for the above one */
+#define CTL_PHASER_DEPTH 0x5f
+#define CTL_DATA_INCREMENT 0x60
+#define CTL_DATA_DECREMENT 0x61
+#define CTL_NONREG_PARM_NUM_LSB 0x62
+#define CTL_NONREG_PARM_NUM_MSB 0x63
+#define CTL_REGIST_PARM_NUM_LSB 0x64
+#define CTL_REGIST_PARM_NUM_MSB 0x65
+/* undefined 0x66 - 0x78 */
+/* reserved 0x79 - 0x7f */
+
+/* Pseudo controllers (not midi compatible) */
+#define CTRL_PITCH_BENDER 255
+#define CTRL_PITCH_BENDER_RANGE 254
+#define CTRL_EXPRESSION 253 /* Obsolete */
+#define CTRL_MAIN_VOLUME 252 /* Obsolete */
+#define SEQ_BALANCE 11
+#define SEQ_VOLMODE 12
+
+/*
+ * Volume mode decides how volumes are used
+ */
+
+#define VOL_METHOD_ADAGIO 1
+#define VOL_METHOD_LINEAR 2
+
+/*
+ * Note! SEQ_WAIT, SEQ_MIDIPUTC and SEQ_ECHO are used also as
+ * input events.
+ */
+
+/*
+ * Event codes 0xf0 to 0xfc are reserved for future extensions.
+ */
+
+#define SEQ_FULLSIZE 0xfd /* Long events */
+/*
+ * SEQ_FULLSIZE events are used for loading patches/samples to the
+ * synthesizer devices. These events are passed directly to the driver
+ * of the associated synthesizer device. There is no limit to the size
+ * of the extended events. These events are not queued but executed
+ * immediately when the write() is called (execution can take several
+ * seconds of time).
+ *
+ * When a SEQ_FULLSIZE message is written to the device, it must
+ * be written using exactly one write() call. Other events cannot
+ * be mixed to the same write.
+ *
+ * For FM synths (YM3812/OPL3) use struct sbi_instrument and write it to the
+ * /dev/sequencer. Don't write other data together with the instrument structure
+ * Set the key field of the structure to FM_PATCH. The device field is used to
+ * route the patch to the corresponding device.
+ *
+ * For wave table use struct patch_info. Initialize the key field
+ * to WAVE_PATCH.
+ */
+#define SEQ_PRIVATE 0xfe /* Low level HW dependent events (8 bytes) */
+#define SEQ_EXTENDED 0xff /* Extended events (8 bytes) OBSOLETE */
+
+/*
+ * Record for FM patches
+ */
+
+typedef unsigned char sbi_instr_data[32];
+
+struct sbi_instrument {
+ unsigned short key; /* FM_PATCH or OPL3_PATCH */
+#define FM_PATCH _PATCHKEY(0x01)
+#define OPL3_PATCH _PATCHKEY(0x03)
+ short device; /* Synth# (0-4) */
+ int channel; /* Program# to be initialized */
+ sbi_instr_data operators; /* Register settings for operator cells (.SBI format) */
+ };
+
+struct synth_info { /* Read only */
+ char name[30];
+ int device; /* 0-N. INITIALIZE BEFORE CALLING */
+ int synth_type;
+#define SYNTH_TYPE_FM 0
+#define SYNTH_TYPE_SAMPLE 1
+#define SYNTH_TYPE_MIDI 2 /* Midi interface */
+
+ int synth_subtype;
+#define FM_TYPE_ADLIB 0x00
+#define FM_TYPE_OPL3 0x01
+#define MIDI_TYPE_MPU401 0x401
+
+#define SAMPLE_TYPE_BASIC 0x10
+#define SAMPLE_TYPE_GUS SAMPLE_TYPE_BASIC
+#define SAMPLE_TYPE_WAVEFRONT 0x11
+
+ int perc_mode; /* No longer supported */
+ int nr_voices;
+ int nr_drums; /* Obsolete field */
+ int instr_bank_size;
+ unsigned int capabilities;
+#define SYNTH_CAP_PERCMODE 0x00000001 /* No longer used */
+#define SYNTH_CAP_OPL3 0x00000002 /* Set if OPL3 supported */
+#define SYNTH_CAP_INPUT 0x00000004 /* Input (MIDI) device */
+ int dummies[19]; /* Reserve space */
+ };
+
+struct sound_timer_info {
+ char name[32];
+ int caps;
+ };
+
+#define MIDI_CAP_MPU401 1 /* MPU-401 intelligent mode */
+
+struct midi_info {
+ char name[30];
+ int device; /* 0-N. INITIALIZE BEFORE CALLING */
+ unsigned int capabilities; /* To be defined later */
+ int dev_type;
+ int dummies[18]; /* Reserve space */
+ };
+
+/********************************************
+ * ioctl commands for the /dev/midi##
+ */
+typedef struct {
+ unsigned char cmd;
+ char nr_args, nr_returns;
+ unsigned char data[30];
+ } mpu_command_rec;
+
+#define SNDCTL_MIDI_PRETIME _SIOWR('m', 0, int)
+#define SNDCTL_MIDI_MPUMODE _SIOWR('m', 1, int)
+#define SNDCTL_MIDI_MPUCMD _SIOWR('m', 2, mpu_command_rec)
+
+/********************************************
+ * IOCTL commands for /dev/dsp and /dev/audio
+ */
+
+#define SNDCTL_DSP_RESET _SIO ('P', 0)
+#define SNDCTL_DSP_SYNC _SIO ('P', 1)
+#define SNDCTL_DSP_SPEED _SIOWR('P', 2, int)
+#define SNDCTL_DSP_STEREO _SIOWR('P', 3, int)
+#define SNDCTL_DSP_GETBLKSIZE _SIOWR('P', 4, int)
+#define SNDCTL_DSP_SAMPLESIZE SNDCTL_DSP_SETFMT
+#define SNDCTL_DSP_CHANNELS _SIOWR('P', 6, int)
+#define SOUND_PCM_WRITE_CHANNELS SNDCTL_DSP_CHANNELS
+#define SOUND_PCM_WRITE_FILTER _SIOWR('P', 7, int)
+#define SNDCTL_DSP_POST _SIO ('P', 8)
+#define SNDCTL_DSP_SUBDIVIDE _SIOWR('P', 9, int)
+#define SNDCTL_DSP_SETFRAGMENT _SIOWR('P',10, int)
+
+/* Audio data formats (Note! U8=8 and S16_LE=16 for compatibility) */
+#define SNDCTL_DSP_GETFMTS _SIOR ('P',11, int) /* Returns a mask */
+#define SNDCTL_DSP_SETFMT _SIOWR('P',5, int) /* Selects ONE fmt*/
+# define AFMT_QUERY 0x00000000 /* Return current fmt */
+# define AFMT_MU_LAW 0x00000001
+# define AFMT_A_LAW 0x00000002
+# define AFMT_IMA_ADPCM 0x00000004
+# define AFMT_U8 0x00000008
+# define AFMT_S16_LE 0x00000010 /* Little endian signed 16*/
+# define AFMT_S16_BE 0x00000020 /* Big endian signed 16 */
+# define AFMT_S8 0x00000040
+# define AFMT_U16_LE 0x00000080 /* Little endian U16 */
+# define AFMT_U16_BE 0x00000100 /* Big endian U16 */
+# define AFMT_MPEG 0x00000200 /* MPEG (2) audio */
+# define AFMT_AC3 0x00000400 /* Dolby Digital AC3 */
+
+/*
+ * Buffer status queries.
+ */
+typedef struct audio_buf_info {
+ int fragments; /* # of available fragments (partially usend ones not counted) */
+ int fragstotal; /* Total # of fragments allocated */
+ int fragsize; /* Size of a fragment in bytes */
+
+ int bytes; /* Available space in bytes (includes partially used fragments) */
+ /* Note! 'bytes' could be more than fragments*fragsize */
+ } audio_buf_info;
+
+#define SNDCTL_DSP_GETOSPACE _SIOR ('P',12, audio_buf_info)
+#define SNDCTL_DSP_GETISPACE _SIOR ('P',13, audio_buf_info)
+#define SNDCTL_DSP_NONBLOCK _SIO ('P',14)
+#define SNDCTL_DSP_GETCAPS _SIOR ('P',15, int)
+# define DSP_CAP_REVISION 0x000000ff /* Bits for revision level (0 to 255) */
+# define DSP_CAP_DUPLEX 0x00000100 /* Full duplex record/playback */
+# define DSP_CAP_REALTIME 0x00000200 /* Real time capability */
+# define DSP_CAP_BATCH 0x00000400 /* Device has some kind of */
+ /* internal buffers which may */
+ /* cause some delays and */
+ /* decrease precision of timing */
+# define DSP_CAP_COPROC 0x00000800 /* Has a coprocessor */
+ /* Sometimes it's a DSP */
+ /* but usually not */
+# define DSP_CAP_TRIGGER 0x00001000 /* Supports SETTRIGGER */
+# define DSP_CAP_MMAP 0x00002000 /* Supports mmap() */
+# define DSP_CAP_MULTI 0x00004000 /* support multiple open */
+# define DSP_CAP_BIND 0x00008000 /* channel binding to front/rear/cneter/lfe */
+
+
+#define SNDCTL_DSP_GETTRIGGER _SIOR ('P',16, int)
+#define SNDCTL_DSP_SETTRIGGER _SIOW ('P',16, int)
+# define PCM_ENABLE_INPUT 0x00000001
+# define PCM_ENABLE_OUTPUT 0x00000002
+
+typedef struct count_info {
+ int bytes; /* Total # of bytes processed */
+ int blocks; /* # of fragment transitions since last time */
+ int ptr; /* Current DMA pointer value */
+ } count_info;
+
+#define SNDCTL_DSP_GETIPTR _SIOR ('P',17, count_info)
+#define SNDCTL_DSP_GETOPTR _SIOR ('P',18, count_info)
+
+typedef struct buffmem_desc {
+ unsigned *buffer;
+ int size;
+ } buffmem_desc;
+#define SNDCTL_DSP_MAPINBUF _SIOR ('P', 19, buffmem_desc)
+#define SNDCTL_DSP_MAPOUTBUF _SIOR ('P', 20, buffmem_desc)
+#define SNDCTL_DSP_SETSYNCRO _SIO ('P', 21)
+#define SNDCTL_DSP_SETDUPLEX _SIO ('P', 22)
+#define SNDCTL_DSP_GETODELAY _SIOR ('P', 23, int)
+
+#define SNDCTL_DSP_GETCHANNELMASK _SIOWR('P', 64, int)
+#define SNDCTL_DSP_BIND_CHANNEL _SIOWR('P', 65, int)
+# define DSP_BIND_QUERY 0x00000000
+# define DSP_BIND_FRONT 0x00000001
+# define DSP_BIND_SURR 0x00000002
+# define DSP_BIND_CENTER_LFE 0x00000004
+# define DSP_BIND_HANDSET 0x00000008
+# define DSP_BIND_MIC 0x00000010
+# define DSP_BIND_MODEM1 0x00000020
+# define DSP_BIND_MODEM2 0x00000040
+# define DSP_BIND_I2S 0x00000080
+# define DSP_BIND_SPDIF 0x00000100
+
+#define SNDCTL_DSP_SETSPDIF _SIOW ('P', 66, int)
+#define SNDCTL_DSP_GETSPDIF _SIOR ('P', 67, int)
+# define SPDIF_PRO 0x0001
+# define SPDIF_N_AUD 0x0002
+# define SPDIF_COPY 0x0004
+# define SPDIF_PRE 0x0008
+# define SPDIF_CC 0x07f0
+# define SPDIF_L 0x0800
+# define SPDIF_DRS 0x4000
+# define SPDIF_V 0x8000
+
+/*
+ * Application's profile defines the way how playback underrun situations should be handled.
+ *
+ * APF_NORMAL (the default) and APF_NETWORK make the driver to cleanup the
+ * playback buffer whenever an underrun occurs. This consumes some time
+ * prevents looping the existing buffer.
+ * APF_CPUINTENS is intended to be set by CPU intensive applications which
+ * are likely to run out of time occasionally. In this mode the buffer cleanup is
+ * disabled which saves CPU time but also let's the previous buffer content to
+ * be played during the "pause" after the underrun.
+ */
+#define SNDCTL_DSP_PROFILE _SIOW ('P', 23, int)
+#define APF_NORMAL 0 /* Normal applications */
+#define APF_NETWORK 1 /* Underruns probably caused by an "external" delay */
+#define APF_CPUINTENS 2 /* Underruns probably caused by "overheating" the CPU */
+
+#define SOUND_PCM_READ_RATE _SIOR ('P', 2, int)
+#define SOUND_PCM_READ_CHANNELS _SIOR ('P', 6, int)
+#define SOUND_PCM_READ_BITS _SIOR ('P', 5, int)
+#define SOUND_PCM_READ_FILTER _SIOR ('P', 7, int)
+
+/* Some alias names */
+#define SOUND_PCM_WRITE_BITS SNDCTL_DSP_SETFMT
+#define SOUND_PCM_WRITE_RATE SNDCTL_DSP_SPEED
+#define SOUND_PCM_POST SNDCTL_DSP_POST
+#define SOUND_PCM_RESET SNDCTL_DSP_RESET
+#define SOUND_PCM_SYNC SNDCTL_DSP_SYNC
+#define SOUND_PCM_SUBDIVIDE SNDCTL_DSP_SUBDIVIDE
+#define SOUND_PCM_SETFRAGMENT SNDCTL_DSP_SETFRAGMENT
+#define SOUND_PCM_GETFMTS SNDCTL_DSP_GETFMTS
+#define SOUND_PCM_SETFMT SNDCTL_DSP_SETFMT
+#define SOUND_PCM_GETOSPACE SNDCTL_DSP_GETOSPACE
+#define SOUND_PCM_GETISPACE SNDCTL_DSP_GETISPACE
+#define SOUND_PCM_NONBLOCK SNDCTL_DSP_NONBLOCK
+#define SOUND_PCM_GETCAPS SNDCTL_DSP_GETCAPS
+#define SOUND_PCM_GETTRIGGER SNDCTL_DSP_GETTRIGGER
+#define SOUND_PCM_SETTRIGGER SNDCTL_DSP_SETTRIGGER
+#define SOUND_PCM_SETSYNCRO SNDCTL_DSP_SETSYNCRO
+#define SOUND_PCM_GETIPTR SNDCTL_DSP_GETIPTR
+#define SOUND_PCM_GETOPTR SNDCTL_DSP_GETOPTR
+#define SOUND_PCM_MAPINBUF SNDCTL_DSP_MAPINBUF
+#define SOUND_PCM_MAPOUTBUF SNDCTL_DSP_MAPOUTBUF
+
+/*
+ * ioctl calls to be used in communication with coprocessors and
+ * DSP chips.
+ */
+
+typedef struct copr_buffer {
+ int command; /* Set to 0 if not used */
+ int flags;
+#define CPF_NONE 0x0000
+#define CPF_FIRST 0x0001 /* First block */
+#define CPF_LAST 0x0002 /* Last block */
+ int len;
+ int offs; /* If required by the device (0 if not used) */
+
+ unsigned char data[4000]; /* NOTE! 4000 is not 4k */
+ } copr_buffer;
+
+typedef struct copr_debug_buf {
+ int command; /* Used internally. Set to 0 */
+ int parm1;
+ int parm2;
+ int flags;
+ int len; /* Length of data in bytes */
+ } copr_debug_buf;
+
+typedef struct copr_msg {
+ int len;
+ unsigned char data[4000];
+ } copr_msg;
+
+#define SNDCTL_COPR_RESET _SIO ('C', 0)
+#define SNDCTL_COPR_LOAD _SIOWR('C', 1, copr_buffer)
+#define SNDCTL_COPR_RDATA _SIOWR('C', 2, copr_debug_buf)
+#define SNDCTL_COPR_RCODE _SIOWR('C', 3, copr_debug_buf)
+#define SNDCTL_COPR_WDATA _SIOW ('C', 4, copr_debug_buf)
+#define SNDCTL_COPR_WCODE _SIOW ('C', 5, copr_debug_buf)
+#define SNDCTL_COPR_RUN _SIOWR('C', 6, copr_debug_buf)
+#define SNDCTL_COPR_HALT _SIOWR('C', 7, copr_debug_buf)
+#define SNDCTL_COPR_SENDMSG _SIOWR('C', 8, copr_msg)
+#define SNDCTL_COPR_RCVMSG _SIOR ('C', 9, copr_msg)
+
+/*********************************************
+ * IOCTL commands for /dev/mixer
+ */
+
+/*
+ * Mixer devices
+ *
+ * There can be up to 20 different analog mixer channels. The
+ * SOUND_MIXER_NRDEVICES gives the currently supported maximum.
+ * The SOUND_MIXER_READ_DEVMASK returns a bitmask which tells
+ * the devices supported by the particular mixer.
+ */
+
+#define SOUND_MIXER_NRDEVICES 25
+#define SOUND_MIXER_VOLUME 0
+#define SOUND_MIXER_BASS 1
+#define SOUND_MIXER_TREBLE 2
+#define SOUND_MIXER_SYNTH 3
+#define SOUND_MIXER_PCM 4
+#define SOUND_MIXER_SPEAKER 5
+#define SOUND_MIXER_LINE 6
+#define SOUND_MIXER_MIC 7
+#define SOUND_MIXER_CD 8
+#define SOUND_MIXER_IMIX 9 /* Recording monitor */
+#define SOUND_MIXER_ALTPCM 10
+#define SOUND_MIXER_RECLEV 11 /* Recording level */
+#define SOUND_MIXER_IGAIN 12 /* Input gain */
+#define SOUND_MIXER_OGAIN 13 /* Output gain */
+/*
+ * The AD1848 codec and compatibles have three line level inputs
+ * (line, aux1 and aux2). Since each card manufacturer have assigned
+ * different meanings to these inputs, it's inpractical to assign
+ * specific meanings (line, cd, synth etc.) to them.
+ */
+#define SOUND_MIXER_LINE1 14 /* Input source 1 (aux1) */
+#define SOUND_MIXER_LINE2 15 /* Input source 2 (aux2) */
+#define SOUND_MIXER_LINE3 16 /* Input source 3 (line) */
+#define SOUND_MIXER_DIGITAL1 17 /* Digital (input) 1 */
+#define SOUND_MIXER_DIGITAL2 18 /* Digital (input) 2 */
+#define SOUND_MIXER_DIGITAL3 19 /* Digital (input) 3 */
+#define SOUND_MIXER_PHONEIN 20 /* Phone input */
+#define SOUND_MIXER_PHONEOUT 21 /* Phone output */
+#define SOUND_MIXER_VIDEO 22 /* Video/TV (audio) in */
+#define SOUND_MIXER_RADIO 23 /* Radio in */
+#define SOUND_MIXER_MONITOR 24 /* Monitor (usually mic) volume */
+
+/* Some on/off settings (SOUND_SPECIAL_MIN - SOUND_SPECIAL_MAX) */
+/* Not counted to SOUND_MIXER_NRDEVICES, but use the same number space */
+#define SOUND_ONOFF_MIN 28
+#define SOUND_ONOFF_MAX 30
+
+/* Note! Number 31 cannot be used since the sign bit is reserved */
+#define SOUND_MIXER_NONE 31
+
+/*
+ * The following unsupported macros are no longer functional.
+ * Use SOUND_MIXER_PRIVATE# macros in future.
+ */
+#define SOUND_MIXER_ENHANCE SOUND_MIXER_NONE
+#define SOUND_MIXER_MUTE SOUND_MIXER_NONE
+#define SOUND_MIXER_LOUD SOUND_MIXER_NONE
+
+
+#define SOUND_DEVICE_LABELS {"Vol ", "Bass ", "Trebl", "Synth", "Pcm ", "Spkr ", "Line ", \
+ "Mic ", "CD ", "Mix ", "Pcm2 ", "Rec ", "IGain", "OGain", \
+ "Line1", "Line2", "Line3", "Digital1", "Digital2", "Digital3", \
+ "PhoneIn", "PhoneOut", "Video", "Radio", "Monitor"}
+
+#define SOUND_DEVICE_NAMES {"vol", "bass", "treble", "synth", "pcm", "speaker", "line", \
+ "mic", "cd", "mix", "pcm2", "rec", "igain", "ogain", \
+ "line1", "line2", "line3", "dig1", "dig2", "dig3", \
+ "phin", "phout", "video", "radio", "monitor"}
+
+/* Device bitmask identifiers */
+
+#define SOUND_MIXER_RECSRC 0xff /* Arg contains a bit for each recording source */
+#define SOUND_MIXER_DEVMASK 0xfe /* Arg contains a bit for each supported device */
+#define SOUND_MIXER_RECMASK 0xfd /* Arg contains a bit for each supported recording source */
+#define SOUND_MIXER_CAPS 0xfc
+# define SOUND_CAP_EXCL_INPUT 0x00000001 /* Only one recording source at a time */
+#define SOUND_MIXER_STEREODEVS 0xfb /* Mixer channels supporting stereo */
+#define SOUND_MIXER_OUTSRC 0xfa /* Arg contains a bit for each input source to output */
+#define SOUND_MIXER_OUTMASK 0xf9 /* Arg contains a bit for each supported input source to output */
+
+/* Device mask bits */
+
+#define SOUND_MASK_VOLUME (1 << SOUND_MIXER_VOLUME)
+#define SOUND_MASK_BASS (1 << SOUND_MIXER_BASS)
+#define SOUND_MASK_TREBLE (1 << SOUND_MIXER_TREBLE)
+#define SOUND_MASK_SYNTH (1 << SOUND_MIXER_SYNTH)
+#define SOUND_MASK_PCM (1 << SOUND_MIXER_PCM)
+#define SOUND_MASK_SPEAKER (1 << SOUND_MIXER_SPEAKER)
+#define SOUND_MASK_LINE (1 << SOUND_MIXER_LINE)
+#define SOUND_MASK_MIC (1 << SOUND_MIXER_MIC)
+#define SOUND_MASK_CD (1 << SOUND_MIXER_CD)
+#define SOUND_MASK_IMIX (1 << SOUND_MIXER_IMIX)
+#define SOUND_MASK_ALTPCM (1 << SOUND_MIXER_ALTPCM)
+#define SOUND_MASK_RECLEV (1 << SOUND_MIXER_RECLEV)
+#define SOUND_MASK_IGAIN (1 << SOUND_MIXER_IGAIN)
+#define SOUND_MASK_OGAIN (1 << SOUND_MIXER_OGAIN)
+#define SOUND_MASK_LINE1 (1 << SOUND_MIXER_LINE1)
+#define SOUND_MASK_LINE2 (1 << SOUND_MIXER_LINE2)
+#define SOUND_MASK_LINE3 (1 << SOUND_MIXER_LINE3)
+#define SOUND_MASK_DIGITAL1 (1 << SOUND_MIXER_DIGITAL1)
+#define SOUND_MASK_DIGITAL2 (1 << SOUND_MIXER_DIGITAL2)
+#define SOUND_MASK_DIGITAL3 (1 << SOUND_MIXER_DIGITAL3)
+#define SOUND_MASK_PHONEIN (1 << SOUND_MIXER_PHONEIN)
+#define SOUND_MASK_PHONEOUT (1 << SOUND_MIXER_PHONEOUT)
+#define SOUND_MASK_RADIO (1 << SOUND_MIXER_RADIO)
+#define SOUND_MASK_VIDEO (1 << SOUND_MIXER_VIDEO)
+#define SOUND_MASK_MONITOR (1 << SOUND_MIXER_MONITOR)
+
+/* Obsolete macros */
+#define SOUND_MASK_MUTE (1 << SOUND_MIXER_MUTE)
+#define SOUND_MASK_ENHANCE (1 << SOUND_MIXER_ENHANCE)
+#define SOUND_MASK_LOUD (1 << SOUND_MIXER_LOUD)
+
+#define MIXER_READ(dev) _SIOR('M', dev, int)
+#define SOUND_MIXER_READ_VOLUME MIXER_READ(SOUND_MIXER_VOLUME)
+#define SOUND_MIXER_READ_BASS MIXER_READ(SOUND_MIXER_BASS)
+#define SOUND_MIXER_READ_TREBLE MIXER_READ(SOUND_MIXER_TREBLE)
+#define SOUND_MIXER_READ_SYNTH MIXER_READ(SOUND_MIXER_SYNTH)
+#define SOUND_MIXER_READ_PCM MIXER_READ(SOUND_MIXER_PCM)
+#define SOUND_MIXER_READ_SPEAKER MIXER_READ(SOUND_MIXER_SPEAKER)
+#define SOUND_MIXER_READ_LINE MIXER_READ(SOUND_MIXER_LINE)
+#define SOUND_MIXER_READ_MIC MIXER_READ(SOUND_MIXER_MIC)
+#define SOUND_MIXER_READ_CD MIXER_READ(SOUND_MIXER_CD)
+#define SOUND_MIXER_READ_IMIX MIXER_READ(SOUND_MIXER_IMIX)
+#define SOUND_MIXER_READ_ALTPCM MIXER_READ(SOUND_MIXER_ALTPCM)
+#define SOUND_MIXER_READ_RECLEV MIXER_READ(SOUND_MIXER_RECLEV)
+#define SOUND_MIXER_READ_IGAIN MIXER_READ(SOUND_MIXER_IGAIN)
+#define SOUND_MIXER_READ_OGAIN MIXER_READ(SOUND_MIXER_OGAIN)
+#define SOUND_MIXER_READ_LINE1 MIXER_READ(SOUND_MIXER_LINE1)
+#define SOUND_MIXER_READ_LINE2 MIXER_READ(SOUND_MIXER_LINE2)
+#define SOUND_MIXER_READ_LINE3 MIXER_READ(SOUND_MIXER_LINE3)
+
+/* Obsolete macros */
+#define SOUND_MIXER_READ_MUTE MIXER_READ(SOUND_MIXER_MUTE)
+#define SOUND_MIXER_READ_ENHANCE MIXER_READ(SOUND_MIXER_ENHANCE)
+#define SOUND_MIXER_READ_LOUD MIXER_READ(SOUND_MIXER_LOUD)
+
+#define SOUND_MIXER_READ_RECSRC MIXER_READ(SOUND_MIXER_RECSRC)
+#define SOUND_MIXER_READ_DEVMASK MIXER_READ(SOUND_MIXER_DEVMASK)
+#define SOUND_MIXER_READ_RECMASK MIXER_READ(SOUND_MIXER_RECMASK)
+#define SOUND_MIXER_READ_STEREODEVS MIXER_READ(SOUND_MIXER_STEREODEVS)
+#define SOUND_MIXER_READ_CAPS MIXER_READ(SOUND_MIXER_CAPS)
+
+#define MIXER_WRITE(dev) _SIOWR('M', dev, int)
+#define SOUND_MIXER_WRITE_VOLUME MIXER_WRITE(SOUND_MIXER_VOLUME)
+#define SOUND_MIXER_WRITE_BASS MIXER_WRITE(SOUND_MIXER_BASS)
+#define SOUND_MIXER_WRITE_TREBLE MIXER_WRITE(SOUND_MIXER_TREBLE)
+#define SOUND_MIXER_WRITE_SYNTH MIXER_WRITE(SOUND_MIXER_SYNTH)
+#define SOUND_MIXER_WRITE_PCM MIXER_WRITE(SOUND_MIXER_PCM)
+#define SOUND_MIXER_WRITE_SPEAKER MIXER_WRITE(SOUND_MIXER_SPEAKER)
+#define SOUND_MIXER_WRITE_LINE MIXER_WRITE(SOUND_MIXER_LINE)
+#define SOUND_MIXER_WRITE_MIC MIXER_WRITE(SOUND_MIXER_MIC)
+#define SOUND_MIXER_WRITE_CD MIXER_WRITE(SOUND_MIXER_CD)
+#define SOUND_MIXER_WRITE_IMIX MIXER_WRITE(SOUND_MIXER_IMIX)
+#define SOUND_MIXER_WRITE_ALTPCM MIXER_WRITE(SOUND_MIXER_ALTPCM)
+#define SOUND_MIXER_WRITE_RECLEV MIXER_WRITE(SOUND_MIXER_RECLEV)
+#define SOUND_MIXER_WRITE_IGAIN MIXER_WRITE(SOUND_MIXER_IGAIN)
+#define SOUND_MIXER_WRITE_OGAIN MIXER_WRITE(SOUND_MIXER_OGAIN)
+#define SOUND_MIXER_WRITE_LINE1 MIXER_WRITE(SOUND_MIXER_LINE1)
+#define SOUND_MIXER_WRITE_LINE2 MIXER_WRITE(SOUND_MIXER_LINE2)
+#define SOUND_MIXER_WRITE_LINE3 MIXER_WRITE(SOUND_MIXER_LINE3)
+
+/* Obsolete macros */
+#define SOUND_MIXER_WRITE_MUTE MIXER_WRITE(SOUND_MIXER_MUTE)
+#define SOUND_MIXER_WRITE_ENHANCE MIXER_WRITE(SOUND_MIXER_ENHANCE)
+#define SOUND_MIXER_WRITE_LOUD MIXER_WRITE(SOUND_MIXER_LOUD)
+
+#define SOUND_MIXER_WRITE_RECSRC MIXER_WRITE(SOUND_MIXER_RECSRC)
+
+typedef struct mixer_info
+{
+ char id[16];
+ char name[32];
+ int modify_counter;
+ int fillers[10];
+} mixer_info;
+
+typedef struct _old_mixer_info /* Obsolete */
+{
+ char id[16];
+ char name[32];
+} _old_mixer_info;
+
+#define SOUND_MIXER_INFO _SIOR ('M', 101, mixer_info)
+#define SOUND_OLD_MIXER_INFO _SIOR ('M', 101, _old_mixer_info)
+
+/*
+ * A mechanism for accessing "proprietary" mixer features. This method
+ * permits passing 128 bytes of arbitrary data between a mixer application
+ * and the mixer driver. Interpretation of the record is defined by
+ * the particular mixer driver.
+ */
+typedef unsigned char mixer_record[128];
+
+#define SOUND_MIXER_ACCESS _SIOWR('M', 102, mixer_record)
+
+/*
+ * Two ioctls for special souncard function
+ */
+#define SOUND_MIXER_AGC _SIOWR('M', 103, int)
+#define SOUND_MIXER_3DSE _SIOWR('M', 104, int)
+
+/*
+ * The SOUND_MIXER_PRIVATE# commands can be redefined by low level drivers.
+ * These features can be used when accessing device specific features.
+ */
+#define SOUND_MIXER_PRIVATE1 _SIOWR('M', 111, int)
+#define SOUND_MIXER_PRIVATE2 _SIOWR('M', 112, int)
+#define SOUND_MIXER_PRIVATE3 _SIOWR('M', 113, int)
+#define SOUND_MIXER_PRIVATE4 _SIOWR('M', 114, int)
+#define SOUND_MIXER_PRIVATE5 _SIOWR('M', 115, int)
+
+/*
+ * SOUND_MIXER_GETLEVELS and SOUND_MIXER_SETLEVELS calls can be used
+ * for querying current mixer settings from the driver and for loading
+ * default volume settings _prior_ activating the mixer (loading
+ * doesn't affect current state of the mixer hardware). These calls
+ * are for internal use only.
+ */
+
+typedef struct mixer_vol_table {
+ int num; /* Index to volume table */
+ char name[32];
+ int levels[32];
+} mixer_vol_table;
+
+#define SOUND_MIXER_GETLEVELS _SIOWR('M', 116, mixer_vol_table)
+#define SOUND_MIXER_SETLEVELS _SIOWR('M', 117, mixer_vol_table)
+
+/*
+ * An ioctl for identifying the driver version. It will return value
+ * of the SOUND_VERSION macro used when compiling the driver.
+ * This call was introduced in OSS version 3.6 and it will not work
+ * with earlier versions (returns EINVAL).
+ */
+#define OSS_GETVERSION _SIOR ('M', 118, int)
+
+/*
+ * Level 2 event types for /dev/sequencer
+ */
+
+/*
+ * The 4 most significant bits of byte 0 specify the class of
+ * the event:
+ *
+ * 0x8X = system level events,
+ * 0x9X = device/port specific events, event[1] = device/port,
+ * The last 4 bits give the subtype:
+ * 0x02 = Channel event (event[3] = chn).
+ * 0x01 = note event (event[4] = note).
+ * (0x01 is not used alone but always with bit 0x02).
+ * event[2] = MIDI message code (0x80=note off etc.)
+ *
+ */
+
+#define EV_SEQ_LOCAL 0x80
+#define EV_TIMING 0x81
+#define EV_CHN_COMMON 0x92
+#define EV_CHN_VOICE 0x93
+#define EV_SYSEX 0x94
+/*
+ * Event types 200 to 220 are reserved for application use.
+ * These numbers will not be used by the driver.
+ */
+
+/*
+ * Events for event type EV_CHN_VOICE
+ */
+
+#define MIDI_NOTEOFF 0x80
+#define MIDI_NOTEON 0x90
+#define MIDI_KEY_PRESSURE 0xA0
+
+/*
+ * Events for event type EV_CHN_COMMON
+ */
+
+#define MIDI_CTL_CHANGE 0xB0
+#define MIDI_PGM_CHANGE 0xC0
+#define MIDI_CHN_PRESSURE 0xD0
+#define MIDI_PITCH_BEND 0xE0
+
+#define MIDI_SYSTEM_PREFIX 0xF0
+
+/*
+ * Timer event types
+ */
+#define TMR_WAIT_REL 1 /* Time relative to the prev time */
+#define TMR_WAIT_ABS 2 /* Absolute time since TMR_START */
+#define TMR_STOP 3
+#define TMR_START 4
+#define TMR_CONTINUE 5
+#define TMR_TEMPO 6
+#define TMR_ECHO 8
+#define TMR_CLOCK 9 /* MIDI clock */
+#define TMR_SPP 10 /* Song position pointer */
+#define TMR_TIMESIG 11 /* Time signature */
+
+/*
+ * Local event types
+ */
+#define LOCL_STARTAUDIO 1
+
+#if (!defined(__KERNEL__) && !defined(KERNEL) && !defined(INKERNEL) && !defined(_KERNEL)) || defined(USE_SEQ_MACROS)
+/*
+ * Some convenience macros to simplify programming of the
+ * /dev/sequencer interface
+ *
+ * These macros define the API which should be used when possible.
+ */
+#define SEQ_DECLAREBUF() SEQ_USE_EXTBUF()
+
+void seqbuf_dump(void); /* This function must be provided by programs */
+
+extern int OSS_init(int seqfd, int buflen);
+extern void OSS_seqbuf_dump(int fd, unsigned char *buf, int buflen);
+extern void OSS_seq_advbuf(int len, int fd, unsigned char *buf, int buflen);
+extern void OSS_seq_needbuf(int len, int fd, unsigned char *buf, int buflen);
+extern void OSS_patch_caching(int dev, int chn, int patch,
+ int fd, unsigned char *buf, int buflen);
+extern void OSS_drum_caching(int dev, int chn, int patch,
+ int fd, unsigned char *buf, int buflen);
+extern void OSS_write_patch(int fd, unsigned char *buf, int len);
+extern int OSS_write_patch2(int fd, unsigned char *buf, int len);
+
+#define SEQ_PM_DEFINES int __foo_bar___
+#ifdef OSSLIB
+# define SEQ_USE_EXTBUF() \
+ extern unsigned char *_seqbuf; \
+ extern int _seqbuflen;extern int _seqbufptr
+# define SEQ_DEFINEBUF(len) SEQ_USE_EXTBUF();static int _requested_seqbuflen=len
+# define _SEQ_ADVBUF(len) OSS_seq_advbuf(len, seqfd, _seqbuf, _seqbuflen)
+# define _SEQ_NEEDBUF(len) OSS_seq_needbuf(len, seqfd, _seqbuf, _seqbuflen)
+# define SEQ_DUMPBUF() OSS_seqbuf_dump(seqfd, _seqbuf, _seqbuflen)
+
+# define SEQ_LOAD_GMINSTR(dev, instr) \
+ OSS_patch_caching(dev, -1, instr, seqfd, _seqbuf, _seqbuflen)
+# define SEQ_LOAD_GMDRUM(dev, drum) \
+ OSS_drum_caching(dev, -1, drum, seqfd, _seqbuf, _seqbuflen)
+#else /* !OSSLIB */
+
+# define SEQ_LOAD_GMINSTR(dev, instr)
+# define SEQ_LOAD_GMDRUM(dev, drum)
+
+# define SEQ_USE_EXTBUF() \
+ extern unsigned char _seqbuf[]; \
+ extern int _seqbuflen;extern int _seqbufptr
+
+#ifndef USE_SIMPLE_MACROS
+/* Sample seqbuf_dump() implementation:
+ *
+ * SEQ_DEFINEBUF (2048); -- Defines a buffer for 2048 bytes
+ *
+ * int seqfd; -- The file descriptor for /dev/sequencer.
+ *
+ * void
+ * seqbuf_dump ()
+ * {
+ * if (_seqbufptr)
+ * if (write (seqfd, _seqbuf, _seqbufptr) == -1)
+ * {
+ * perror ("write /dev/sequencer");
+ * exit (-1);
+ * }
+ * _seqbufptr = 0;
+ * }
+ */
+
+#define SEQ_DEFINEBUF(len) unsigned char _seqbuf[len]; int _seqbuflen = len;int _seqbufptr = 0
+#define _SEQ_NEEDBUF(len) if ((_seqbufptr+(len)) > _seqbuflen) seqbuf_dump()
+#define _SEQ_ADVBUF(len) _seqbufptr += len
+#define SEQ_DUMPBUF seqbuf_dump
+#else
+/*
+ * This variation of the sequencer macros is used just to format one event
+ * using fixed buffer.
+ *
+ * The program using the macro library must define the following macros before
+ * using this library.
+ *
+ * #define _seqbuf name of the buffer (unsigned char[])
+ * #define _SEQ_ADVBUF(len) If the applic needs to know the exact
+ * size of the event, this macro can be used.
+ * Otherwise this must be defined as empty.
+ * #define _seqbufptr Define the name of index variable or 0 if
+ * not required.
+ */
+#define _SEQ_NEEDBUF(len) /* empty */
+#endif
+#endif /* !OSSLIB */
+
+#define SEQ_VOLUME_MODE(dev, mode) {_SEQ_NEEDBUF(8);\
+ _seqbuf[_seqbufptr] = SEQ_EXTENDED;\
+ _seqbuf[_seqbufptr+1] = SEQ_VOLMODE;\
+ _seqbuf[_seqbufptr+2] = (dev);\
+ _seqbuf[_seqbufptr+3] = (mode);\
+ _seqbuf[_seqbufptr+4] = 0;\
+ _seqbuf[_seqbufptr+5] = 0;\
+ _seqbuf[_seqbufptr+6] = 0;\
+ _seqbuf[_seqbufptr+7] = 0;\
+ _SEQ_ADVBUF(8);}
+
+/*
+ * Midi voice messages
+ */
+
+#define _CHN_VOICE(dev, event, chn, note, parm) \
+ {_SEQ_NEEDBUF(8);\
+ _seqbuf[_seqbufptr] = EV_CHN_VOICE;\
+ _seqbuf[_seqbufptr+1] = (dev);\
+ _seqbuf[_seqbufptr+2] = (event);\
+ _seqbuf[_seqbufptr+3] = (chn);\
+ _seqbuf[_seqbufptr+4] = (note);\
+ _seqbuf[_seqbufptr+5] = (parm);\
+ _seqbuf[_seqbufptr+6] = (0);\
+ _seqbuf[_seqbufptr+7] = 0;\
+ _SEQ_ADVBUF(8);}
+
+#define SEQ_START_NOTE(dev, chn, note, vol) \
+ _CHN_VOICE(dev, MIDI_NOTEON, chn, note, vol)
+
+#define SEQ_STOP_NOTE(dev, chn, note, vol) \
+ _CHN_VOICE(dev, MIDI_NOTEOFF, chn, note, vol)
+
+#define SEQ_KEY_PRESSURE(dev, chn, note, pressure) \
+ _CHN_VOICE(dev, MIDI_KEY_PRESSURE, chn, note, pressure)
+
+/*
+ * Midi channel messages
+ */
+
+#define _CHN_COMMON(dev, event, chn, p1, p2, w14) \
+ {_SEQ_NEEDBUF(8);\
+ _seqbuf[_seqbufptr] = EV_CHN_COMMON;\
+ _seqbuf[_seqbufptr+1] = (dev);\
+ _seqbuf[_seqbufptr+2] = (event);\
+ _seqbuf[_seqbufptr+3] = (chn);\
+ _seqbuf[_seqbufptr+4] = (p1);\
+ _seqbuf[_seqbufptr+5] = (p2);\
+ *(short *)&_seqbuf[_seqbufptr+6] = (w14);\
+ _SEQ_ADVBUF(8);}
+/*
+ * SEQ_SYSEX permits sending of sysex messages. (It may look that it permits
+ * sending any MIDI bytes but it's absolutely not possible. Trying to do
+ * so _will_ cause problems with MPU401 intelligent mode).
+ *
+ * Sysex messages are sent in blocks of 1 to 6 bytes. Longer messages must be
+ * sent by calling SEQ_SYSEX() several times (there must be no other events
+ * between them). First sysex fragment must have 0xf0 in the first byte
+ * and the last byte (buf[len-1] of the last fragment must be 0xf7. No byte
+ * between these sysex start and end markers cannot be larger than 0x7f. Also
+ * lengths of each fragments (except the last one) must be 6.
+ *
+ * Breaking the above rules may work with some MIDI ports but is likely to
+ * cause fatal problems with some other devices (such as MPU401).
+ */
+#define SEQ_SYSEX(dev, buf, len) \
+ {int ii, ll=(len); \
+ unsigned char *bufp=buf;\
+ if (ll>6)ll=6;\
+ _SEQ_NEEDBUF(8);\
+ _seqbuf[_seqbufptr] = EV_SYSEX;\
+ _seqbuf[_seqbufptr+1] = (dev);\
+ for(ii=0;ii<ll;ii++)\
+ _seqbuf[_seqbufptr+ii+2] = bufp[ii];\
+ for(ii=ll;ii<6;ii++)\
+ _seqbuf[_seqbufptr+ii+2] = 0xff;\
+ _SEQ_ADVBUF(8);}
+
+#define SEQ_CHN_PRESSURE(dev, chn, pressure) \
+ _CHN_COMMON(dev, MIDI_CHN_PRESSURE, chn, pressure, 0, 0)
+
+#define SEQ_SET_PATCH SEQ_PGM_CHANGE
+#ifdef OSSLIB
+# define SEQ_PGM_CHANGE(dev, chn, patch) \
+ {OSS_patch_caching(dev, chn, patch, seqfd, _seqbuf, _seqbuflen); \
+ _CHN_COMMON(dev, MIDI_PGM_CHANGE, chn, patch, 0, 0);}
+#else
+# define SEQ_PGM_CHANGE(dev, chn, patch) \
+ _CHN_COMMON(dev, MIDI_PGM_CHANGE, chn, patch, 0, 0)
+#endif
+
+#define SEQ_CONTROL(dev, chn, controller, value) \
+ _CHN_COMMON(dev, MIDI_CTL_CHANGE, chn, controller, 0, value)
+
+#define SEQ_BENDER(dev, chn, value) \
+ _CHN_COMMON(dev, MIDI_PITCH_BEND, chn, 0, 0, value)
+
+
+#define SEQ_V2_X_CONTROL(dev, voice, controller, value) {_SEQ_NEEDBUF(8);\
+ _seqbuf[_seqbufptr] = SEQ_EXTENDED;\
+ _seqbuf[_seqbufptr+1] = SEQ_CONTROLLER;\
+ _seqbuf[_seqbufptr+2] = (dev);\
+ _seqbuf[_seqbufptr+3] = (voice);\
+ _seqbuf[_seqbufptr+4] = (controller);\
+ _seqbuf[_seqbufptr+5] = ((value)&0xff);\
+ _seqbuf[_seqbufptr+6] = ((value>>8)&0xff);\
+ _seqbuf[_seqbufptr+7] = 0;\
+ _SEQ_ADVBUF(8);}
+/*
+ * The following 5 macros are incorrectly implemented and obsolete.
+ * Use SEQ_BENDER and SEQ_CONTROL (with proper controller) instead.
+ */
+#define SEQ_PITCHBEND(dev, voice, value) SEQ_V2_X_CONTROL(dev, voice, CTRL_PITCH_BENDER, value)
+#define SEQ_BENDER_RANGE(dev, voice, value) SEQ_V2_X_CONTROL(dev, voice, CTRL_PITCH_BENDER_RANGE, value)
+#define SEQ_EXPRESSION(dev, voice, value) SEQ_CONTROL(dev, voice, CTL_EXPRESSION, value*128)
+#define SEQ_MAIN_VOLUME(dev, voice, value) SEQ_CONTROL(dev, voice, CTL_MAIN_VOLUME, (value*16383)/100)
+#define SEQ_PANNING(dev, voice, pos) SEQ_CONTROL(dev, voice, CTL_PAN, (pos+128) / 2)
+
+/*
+ * Timing and syncronization macros
+ */
+
+#define _TIMER_EVENT(ev, parm) {_SEQ_NEEDBUF(8);\
+ _seqbuf[_seqbufptr+0] = EV_TIMING; \
+ _seqbuf[_seqbufptr+1] = (ev); \
+ _seqbuf[_seqbufptr+2] = 0;\
+ _seqbuf[_seqbufptr+3] = 0;\
+ *(unsigned int *)&_seqbuf[_seqbufptr+4] = (parm); \
+ _SEQ_ADVBUF(8);}
+
+#define SEQ_START_TIMER() _TIMER_EVENT(TMR_START, 0)
+#define SEQ_STOP_TIMER() _TIMER_EVENT(TMR_STOP, 0)
+#define SEQ_CONTINUE_TIMER() _TIMER_EVENT(TMR_CONTINUE, 0)
+#define SEQ_WAIT_TIME(ticks) _TIMER_EVENT(TMR_WAIT_ABS, ticks)
+#define SEQ_DELTA_TIME(ticks) _TIMER_EVENT(TMR_WAIT_REL, ticks)
+#define SEQ_ECHO_BACK(key) _TIMER_EVENT(TMR_ECHO, key)
+#define SEQ_SET_TEMPO(value) _TIMER_EVENT(TMR_TEMPO, value)
+#define SEQ_SONGPOS(pos) _TIMER_EVENT(TMR_SPP, pos)
+#define SEQ_TIME_SIGNATURE(sig) _TIMER_EVENT(TMR_TIMESIG, sig)
+
+/*
+ * Local control events
+ */
+
+#define _LOCAL_EVENT(ev, parm) {_SEQ_NEEDBUF(8);\
+ _seqbuf[_seqbufptr+0] = EV_SEQ_LOCAL; \
+ _seqbuf[_seqbufptr+1] = (ev); \
+ _seqbuf[_seqbufptr+2] = 0;\
+ _seqbuf[_seqbufptr+3] = 0;\
+ *(unsigned int *)&_seqbuf[_seqbufptr+4] = (parm); \
+ _SEQ_ADVBUF(8);}
+
+#define SEQ_PLAYAUDIO(devmask) _LOCAL_EVENT(LOCL_STARTAUDIO, devmask)
+/*
+ * Events for the level 1 interface only
+ */
+
+#define SEQ_MIDIOUT(device, byte) {_SEQ_NEEDBUF(4);\
+ _seqbuf[_seqbufptr] = SEQ_MIDIPUTC;\
+ _seqbuf[_seqbufptr+1] = (byte);\
+ _seqbuf[_seqbufptr+2] = (device);\
+ _seqbuf[_seqbufptr+3] = 0;\
+ _SEQ_ADVBUF(4);}
+
+/*
+ * Patch loading.
+ */
+#ifdef OSSLIB
+# define SEQ_WRPATCH(patchx, len) \
+ OSS_write_patch(seqfd, (char*)(patchx), len)
+# define SEQ_WRPATCH2(patchx, len) \
+ OSS_write_patch2(seqfd, (char*)(patchx), len)
+#else
+# define SEQ_WRPATCH(patchx, len) \
+ {if (_seqbufptr) SEQ_DUMPBUF();\
+ if (write(seqfd, (char*)(patchx), len)==-1) \
+ perror("Write patch: /dev/sequencer");}
+# define SEQ_WRPATCH2(patchx, len) \
+ (SEQ_DUMPBUF(), write(seqfd, (char*)(patchx), len))
+#endif
+
+#endif
+#endif
diff --git a/sysroot/usr/include/linux/spi/spidev.h b/sysroot/usr/include/linux/spi/spidev.h
new file mode 100644
index 0000000..c93ef9d
--- /dev/null
+++ b/sysroot/usr/include/linux/spi/spidev.h
@@ -0,0 +1,128 @@
+/*
+ * include/linux/spi/spidev.h
+ *
+ * Copyright (C) 2006 SWAPP
+ * Andrea Paterniani <a.paterniani@swapp-eng.it>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef SPIDEV_H
+#define SPIDEV_H
+
+
+/* User space versions of kernel symbols for SPI clocking modes,
+ * matching <linux/spi/spi.h>
+ */
+
+#define SPI_CPHA 0x01
+#define SPI_CPOL 0x02
+
+#define SPI_MODE_0 (0|0)
+#define SPI_MODE_1 (0|SPI_CPHA)
+#define SPI_MODE_2 (SPI_CPOL|0)
+#define SPI_MODE_3 (SPI_CPOL|SPI_CPHA)
+
+#define SPI_CS_HIGH 0x04
+#define SPI_LSB_FIRST 0x08
+#define SPI_3WIRE 0x10
+#define SPI_LOOP 0x20
+
+/*---------------------------------------------------------------------------*/
+
+/* IOCTL commands */
+
+#define SPI_IOC_MAGIC 'k'
+
+/**
+ * struct spi_ioc_transfer - describes a single SPI transfer
+ * @tx_buf: Holds pointer to userspace buffer with transmit data, or null.
+ * If no data is provided, zeroes are shifted out.
+ * @rx_buf: Holds pointer to userspace buffer for receive data, or null.
+ * @len: Length of tx and rx buffers, in bytes.
+ * @speed_hz: Temporary override of the device's bitrate.
+ * @bits_per_word: Temporary override of the device's wordsize.
+ * @delay_usecs: If nonzero, how long to delay after the last bit transfer
+ * before optionally deselecting the device before the next transfer.
+ * @cs_change: True to deselect device before starting the next transfer.
+ *
+ * This structure is mapped directly to the kernel spi_transfer structure;
+ * the fields have the same meanings, except of course that the pointers
+ * are in a different address space (and may be of different sizes in some
+ * cases, such as 32-bit i386 userspace over a 64-bit x86_64 kernel).
+ * Zero-initialize the structure, including currently unused fields, to
+ * accomodate potential future updates.
+ *
+ * SPI_IOC_MESSAGE gives userspace the equivalent of kernel spi_sync().
+ * Pass it an array of related transfers, they'll execute together.
+ * Each transfer may be half duplex (either direction) or full duplex.
+ *
+ * struct spi_ioc_transfer mesg[4];
+ * ...
+ * status = ioctl(fd, SPI_IOC_MESSAGE(4), mesg);
+ *
+ * So for example one transfer might send a nine bit command (right aligned
+ * in a 16-bit word), the next could read a block of 8-bit data before
+ * terminating that command by temporarily deselecting the chip; the next
+ * could send a different nine bit command (re-selecting the chip), and the
+ * last transfer might write some register values.
+ */
+struct spi_ioc_transfer {
+ __u64 tx_buf;
+ __u64 rx_buf;
+
+ __u32 len;
+ __u32 speed_hz;
+
+ __u16 delay_usecs;
+ __u8 bits_per_word;
+ __u8 cs_change;
+ __u32 pad;
+
+ /* If the contents of 'struct spi_ioc_transfer' ever change
+ * incompatibly, then the ioctl number (currently 0) must change;
+ * ioctls with constant size fields get a bit more in the way of
+ * error checking than ones (like this) where that field varies.
+ *
+ * NOTE: struct layout is the same in 64bit and 32bit userspace.
+ */
+};
+
+/* not all platforms use <asm-generic/ioctl.h> or _IOC_TYPECHECK() ... */
+#define SPI_MSGSIZE(N) \
+ ((((N)*(sizeof (struct spi_ioc_transfer))) < (1 << _IOC_SIZEBITS)) \
+ ? ((N)*(sizeof (struct spi_ioc_transfer))) : 0)
+#define SPI_IOC_MESSAGE(N) _IOW(SPI_IOC_MAGIC, 0, char[SPI_MSGSIZE(N)])
+
+
+/* Read / Write of SPI mode (SPI_MODE_0..SPI_MODE_3) */
+#define SPI_IOC_RD_MODE _IOR(SPI_IOC_MAGIC, 1, __u8)
+#define SPI_IOC_WR_MODE _IOW(SPI_IOC_MAGIC, 1, __u8)
+
+/* Read / Write SPI bit justification */
+#define SPI_IOC_RD_LSB_FIRST _IOR(SPI_IOC_MAGIC, 2, __u8)
+#define SPI_IOC_WR_LSB_FIRST _IOW(SPI_IOC_MAGIC, 2, __u8)
+
+/* Read / Write SPI device word length (1..N) */
+#define SPI_IOC_RD_BITS_PER_WORD _IOR(SPI_IOC_MAGIC, 3, __u8)
+#define SPI_IOC_WR_BITS_PER_WORD _IOW(SPI_IOC_MAGIC, 3, __u8)
+
+/* Read / Write SPI device default max speed hz */
+#define SPI_IOC_RD_MAX_SPEED_HZ _IOR(SPI_IOC_MAGIC, 4, __u32)
+#define SPI_IOC_WR_MAX_SPEED_HZ _IOW(SPI_IOC_MAGIC, 4, __u32)
+
+
+
+#endif /* SPIDEV_H */
diff --git a/sysroot/usr/include/linux/stat.h b/sysroot/usr/include/linux/stat.h
new file mode 100644
index 0000000..0a9f037
--- /dev/null
+++ b/sysroot/usr/include/linux/stat.h
@@ -0,0 +1,45 @@
+#ifndef _LINUX_STAT_H
+#define _LINUX_STAT_H
+
+
+#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
+
+#define S_IFMT 00170000
+#define S_IFSOCK 0140000
+#define S_IFLNK 0120000
+#define S_IFREG 0100000
+#define S_IFBLK 0060000
+#define S_IFDIR 0040000
+#define S_IFCHR 0020000
+#define S_IFIFO 0010000
+#define S_ISUID 0004000
+#define S_ISGID 0002000
+#define S_ISVTX 0001000
+
+#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
+#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
+#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
+#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
+#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
+#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
+#define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
+
+#define S_IRWXU 00700
+#define S_IRUSR 00400
+#define S_IWUSR 00200
+#define S_IXUSR 00100
+
+#define S_IRWXG 00070
+#define S_IRGRP 00040
+#define S_IWGRP 00020
+#define S_IXGRP 00010
+
+#define S_IRWXO 00007
+#define S_IROTH 00004
+#define S_IWOTH 00002
+#define S_IXOTH 00001
+
+#endif
+
+
+#endif
diff --git a/sysroot/usr/include/linux/stddef.h b/sysroot/usr/include/linux/stddef.h
new file mode 100644
index 0000000..ebbb35d
--- /dev/null
+++ b/sysroot/usr/include/linux/stddef.h
@@ -0,0 +1,13 @@
+#ifndef _LINUX_STDDEF_H
+#define _LINUX_STDDEF_H
+
+
+#undef NULL
+#if defined(__cplusplus)
+#define NULL 0
+#else
+#define NULL ((void *)0)
+#endif
+
+
+#endif
diff --git a/sysroot/usr/include/linux/string.h b/sysroot/usr/include/linux/string.h
new file mode 100644
index 0000000..d1e13b1
--- /dev/null
+++ b/sysroot/usr/include/linux/string.h
@@ -0,0 +1,7 @@
+#ifndef _LINUX_STRING_H_
+#define _LINUX_STRING_H_
+
+/* We don't want strings.h stuff being user by user stuff by accident */
+
+#include <string.h>
+#endif /* _LINUX_STRING_H_ */
diff --git a/sysroot/usr/include/linux/sunrpc/debug.h b/sysroot/usr/include/linux/sunrpc/debug.h
new file mode 100644
index 0000000..fb6c8fd
--- /dev/null
+++ b/sysroot/usr/include/linux/sunrpc/debug.h
@@ -0,0 +1,48 @@
+/*
+ * linux/include/linux/sunrpc/debug.h
+ *
+ * Debugging support for sunrpc module
+ *
+ * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
+ */
+
+#ifndef _LINUX_SUNRPC_DEBUG_H_
+#define _LINUX_SUNRPC_DEBUG_H_
+
+/*
+ * RPC debug facilities
+ */
+#define RPCDBG_XPRT 0x0001
+#define RPCDBG_CALL 0x0002
+#define RPCDBG_DEBUG 0x0004
+#define RPCDBG_NFS 0x0008
+#define RPCDBG_AUTH 0x0010
+#define RPCDBG_BIND 0x0020
+#define RPCDBG_SCHED 0x0040
+#define RPCDBG_TRANS 0x0080
+#define RPCDBG_SVCSOCK 0x0100
+#define RPCDBG_SVCDSP 0x0200
+#define RPCDBG_MISC 0x0400
+#define RPCDBG_CACHE 0x0800
+#define RPCDBG_ALL 0x7fff
+
+
+/*
+ * Declarations for the sysctl debug interface, which allows to read or
+ * change the debug flags for rpc, nfs, nfsd, and lockd. Since the sunrpc
+ * module currently registers its sysctl table dynamically, the sysctl path
+ * for module FOO is <CTL_SUNRPC, CTL_FOODEBUG>.
+ */
+
+enum {
+ CTL_RPCDEBUG = 1,
+ CTL_NFSDEBUG,
+ CTL_NFSDDEBUG,
+ CTL_NLMDEBUG,
+ CTL_SLOTTABLE_UDP,
+ CTL_SLOTTABLE_TCP,
+ CTL_MIN_RESVPORT,
+ CTL_MAX_RESVPORT,
+};
+
+#endif /* _LINUX_SUNRPC_DEBUG_H_ */
diff --git a/sysroot/usr/include/linux/synclink.h b/sysroot/usr/include/linux/synclink.h
new file mode 100644
index 0000000..c36ad93
--- /dev/null
+++ b/sysroot/usr/include/linux/synclink.h
@@ -0,0 +1,295 @@
+/*
+ * SyncLink Multiprotocol Serial Adapter Driver
+ *
+ * $Id: synclink.h,v 3.14 2006/07/17 20:15:43 paulkf Exp $
+ *
+ * Copyright (C) 1998-2000 by Microgate Corporation
+ *
+ * Redistribution of this file is permitted under
+ * the terms of the GNU Public License (GPL)
+ */
+
+#ifndef _SYNCLINK_H_
+#define _SYNCLINK_H_
+#define SYNCLINK_H_VERSION 3.6
+
+#define BOOLEAN int
+#define TRUE 1
+#define FALSE 0
+
+#define BIT0 0x0001
+#define BIT1 0x0002
+#define BIT2 0x0004
+#define BIT3 0x0008
+#define BIT4 0x0010
+#define BIT5 0x0020
+#define BIT6 0x0040
+#define BIT7 0x0080
+#define BIT8 0x0100
+#define BIT9 0x0200
+#define BIT10 0x0400
+#define BIT11 0x0800
+#define BIT12 0x1000
+#define BIT13 0x2000
+#define BIT14 0x4000
+#define BIT15 0x8000
+#define BIT16 0x00010000
+#define BIT17 0x00020000
+#define BIT18 0x00040000
+#define BIT19 0x00080000
+#define BIT20 0x00100000
+#define BIT21 0x00200000
+#define BIT22 0x00400000
+#define BIT23 0x00800000
+#define BIT24 0x01000000
+#define BIT25 0x02000000
+#define BIT26 0x04000000
+#define BIT27 0x08000000
+#define BIT28 0x10000000
+#define BIT29 0x20000000
+#define BIT30 0x40000000
+#define BIT31 0x80000000
+
+
+#define HDLC_MAX_FRAME_SIZE 65535
+#define MAX_ASYNC_TRANSMIT 4096
+#define MAX_ASYNC_BUFFER_SIZE 4096
+
+#define ASYNC_PARITY_NONE 0
+#define ASYNC_PARITY_EVEN 1
+#define ASYNC_PARITY_ODD 2
+#define ASYNC_PARITY_SPACE 3
+
+#define HDLC_FLAG_UNDERRUN_ABORT7 0x0000
+#define HDLC_FLAG_UNDERRUN_ABORT15 0x0001
+#define HDLC_FLAG_UNDERRUN_FLAG 0x0002
+#define HDLC_FLAG_UNDERRUN_CRC 0x0004
+#define HDLC_FLAG_SHARE_ZERO 0x0010
+#define HDLC_FLAG_AUTO_CTS 0x0020
+#define HDLC_FLAG_AUTO_DCD 0x0040
+#define HDLC_FLAG_AUTO_RTS 0x0080
+#define HDLC_FLAG_RXC_DPLL 0x0100
+#define HDLC_FLAG_RXC_BRG 0x0200
+#define HDLC_FLAG_RXC_TXCPIN 0x8000
+#define HDLC_FLAG_RXC_RXCPIN 0x0000
+#define HDLC_FLAG_TXC_DPLL 0x0400
+#define HDLC_FLAG_TXC_BRG 0x0800
+#define HDLC_FLAG_TXC_TXCPIN 0x0000
+#define HDLC_FLAG_TXC_RXCPIN 0x0008
+#define HDLC_FLAG_DPLL_DIV8 0x1000
+#define HDLC_FLAG_DPLL_DIV16 0x2000
+#define HDLC_FLAG_DPLL_DIV32 0x0000
+#define HDLC_FLAG_HDLC_LOOPMODE 0x4000
+
+#define HDLC_CRC_NONE 0
+#define HDLC_CRC_16_CCITT 1
+#define HDLC_CRC_32_CCITT 2
+#define HDLC_CRC_MASK 0x00ff
+#define HDLC_CRC_RETURN_EX 0x8000
+
+#define RX_OK 0
+#define RX_CRC_ERROR 1
+
+#define HDLC_TXIDLE_FLAGS 0
+#define HDLC_TXIDLE_ALT_ZEROS_ONES 1
+#define HDLC_TXIDLE_ZEROS 2
+#define HDLC_TXIDLE_ONES 3
+#define HDLC_TXIDLE_ALT_MARK_SPACE 4
+#define HDLC_TXIDLE_SPACE 5
+#define HDLC_TXIDLE_MARK 6
+#define HDLC_TXIDLE_CUSTOM_8 0x10000000
+#define HDLC_TXIDLE_CUSTOM_16 0x20000000
+
+#define HDLC_ENCODING_NRZ 0
+#define HDLC_ENCODING_NRZB 1
+#define HDLC_ENCODING_NRZI_MARK 2
+#define HDLC_ENCODING_NRZI_SPACE 3
+#define HDLC_ENCODING_NRZI HDLC_ENCODING_NRZI_SPACE
+#define HDLC_ENCODING_BIPHASE_MARK 4
+#define HDLC_ENCODING_BIPHASE_SPACE 5
+#define HDLC_ENCODING_BIPHASE_LEVEL 6
+#define HDLC_ENCODING_DIFF_BIPHASE_LEVEL 7
+
+#define HDLC_PREAMBLE_LENGTH_8BITS 0
+#define HDLC_PREAMBLE_LENGTH_16BITS 1
+#define HDLC_PREAMBLE_LENGTH_32BITS 2
+#define HDLC_PREAMBLE_LENGTH_64BITS 3
+
+#define HDLC_PREAMBLE_PATTERN_NONE 0
+#define HDLC_PREAMBLE_PATTERN_ZEROS 1
+#define HDLC_PREAMBLE_PATTERN_FLAGS 2
+#define HDLC_PREAMBLE_PATTERN_10 3
+#define HDLC_PREAMBLE_PATTERN_01 4
+#define HDLC_PREAMBLE_PATTERN_ONES 5
+
+#define MGSL_MODE_ASYNC 1
+#define MGSL_MODE_HDLC 2
+#define MGSL_MODE_MONOSYNC 3
+#define MGSL_MODE_BISYNC 4
+#define MGSL_MODE_RAW 6
+
+#define MGSL_BUS_TYPE_ISA 1
+#define MGSL_BUS_TYPE_EISA 2
+#define MGSL_BUS_TYPE_PCI 5
+
+#define MGSL_INTERFACE_MASK 0xf
+#define MGSL_INTERFACE_DISABLE 0
+#define MGSL_INTERFACE_RS232 1
+#define MGSL_INTERFACE_V35 2
+#define MGSL_INTERFACE_RS422 3
+#define MGSL_INTERFACE_RTS_EN 0x10
+#define MGSL_INTERFACE_LL 0x20
+#define MGSL_INTERFACE_RL 0x40
+
+typedef struct _MGSL_PARAMS
+{
+ /* Common */
+
+ unsigned long mode; /* Asynchronous or HDLC */
+ unsigned char loopback; /* internal loopback mode */
+
+ /* HDLC Only */
+
+ unsigned short flags;
+ unsigned char encoding; /* NRZ, NRZI, etc. */
+ unsigned long clock_speed; /* external clock speed in bits per second */
+ unsigned char addr_filter; /* receive HDLC address filter, 0xFF = disable */
+ unsigned short crc_type; /* None, CRC16-CCITT, or CRC32-CCITT */
+ unsigned char preamble_length;
+ unsigned char preamble;
+
+ /* Async Only */
+
+ unsigned long data_rate; /* bits per second */
+ unsigned char data_bits; /* 7 or 8 data bits */
+ unsigned char stop_bits; /* 1 or 2 stop bits */
+ unsigned char parity; /* none, even, or odd */
+
+} MGSL_PARAMS, *PMGSL_PARAMS;
+
+#define MICROGATE_VENDOR_ID 0x13c0
+#define SYNCLINK_DEVICE_ID 0x0010
+#define MGSCC_DEVICE_ID 0x0020
+#define SYNCLINK_SCA_DEVICE_ID 0x0030
+#define SYNCLINK_GT_DEVICE_ID 0x0070
+#define SYNCLINK_GT4_DEVICE_ID 0x0080
+#define SYNCLINK_AC_DEVICE_ID 0x0090
+#define SYNCLINK_GT2_DEVICE_ID 0x00A0
+#define MGSL_MAX_SERIAL_NUMBER 30
+
+/*
+** device diagnostics status
+*/
+
+#define DiagStatus_OK 0
+#define DiagStatus_AddressFailure 1
+#define DiagStatus_AddressConflict 2
+#define DiagStatus_IrqFailure 3
+#define DiagStatus_IrqConflict 4
+#define DiagStatus_DmaFailure 5
+#define DiagStatus_DmaConflict 6
+#define DiagStatus_PciAdapterNotFound 7
+#define DiagStatus_CantAssignPciResources 8
+#define DiagStatus_CantAssignPciMemAddr 9
+#define DiagStatus_CantAssignPciIoAddr 10
+#define DiagStatus_CantAssignPciIrq 11
+#define DiagStatus_MemoryError 12
+
+#define SerialSignal_DCD 0x01 /* Data Carrier Detect */
+#define SerialSignal_TXD 0x02 /* Transmit Data */
+#define SerialSignal_RI 0x04 /* Ring Indicator */
+#define SerialSignal_RXD 0x08 /* Receive Data */
+#define SerialSignal_CTS 0x10 /* Clear to Send */
+#define SerialSignal_RTS 0x20 /* Request to Send */
+#define SerialSignal_DSR 0x40 /* Data Set Ready */
+#define SerialSignal_DTR 0x80 /* Data Terminal Ready */
+
+
+/*
+ * Counters of the input lines (CTS, DSR, RI, CD) interrupts
+ */
+struct mgsl_icount {
+ __u32 cts, dsr, rng, dcd, tx, rx;
+ __u32 frame, parity, overrun, brk;
+ __u32 buf_overrun;
+ __u32 txok;
+ __u32 txunder;
+ __u32 txabort;
+ __u32 txtimeout;
+ __u32 rxshort;
+ __u32 rxlong;
+ __u32 rxabort;
+ __u32 rxover;
+ __u32 rxcrc;
+ __u32 rxok;
+ __u32 exithunt;
+ __u32 rxidle;
+};
+
+struct gpio_desc {
+ __u32 state;
+ __u32 smask;
+ __u32 dir;
+ __u32 dmask;
+};
+
+#define DEBUG_LEVEL_DATA 1
+#define DEBUG_LEVEL_ERROR 2
+#define DEBUG_LEVEL_INFO 3
+#define DEBUG_LEVEL_BH 4
+#define DEBUG_LEVEL_ISR 5
+
+/*
+** Event bit flags for use with MgslWaitEvent
+*/
+
+#define MgslEvent_DsrActive 0x0001
+#define MgslEvent_DsrInactive 0x0002
+#define MgslEvent_Dsr 0x0003
+#define MgslEvent_CtsActive 0x0004
+#define MgslEvent_CtsInactive 0x0008
+#define MgslEvent_Cts 0x000c
+#define MgslEvent_DcdActive 0x0010
+#define MgslEvent_DcdInactive 0x0020
+#define MgslEvent_Dcd 0x0030
+#define MgslEvent_RiActive 0x0040
+#define MgslEvent_RiInactive 0x0080
+#define MgslEvent_Ri 0x00c0
+#define MgslEvent_ExitHuntMode 0x0100
+#define MgslEvent_IdleReceived 0x0200
+
+/* Private IOCTL codes:
+ *
+ * MGSL_IOCSPARAMS set MGSL_PARAMS structure values
+ * MGSL_IOCGPARAMS get current MGSL_PARAMS structure values
+ * MGSL_IOCSTXIDLE set current transmit idle mode
+ * MGSL_IOCGTXIDLE get current transmit idle mode
+ * MGSL_IOCTXENABLE enable or disable transmitter
+ * MGSL_IOCRXENABLE enable or disable receiver
+ * MGSL_IOCTXABORT abort transmitting frame (HDLC)
+ * MGSL_IOCGSTATS return current statistics
+ * MGSL_IOCWAITEVENT wait for specified event to occur
+ * MGSL_LOOPTXDONE transmit in HDLC LoopMode done
+ * MGSL_IOCSIF set the serial interface type
+ * MGSL_IOCGIF get the serial interface type
+ */
+#define MGSL_MAGIC_IOC 'm'
+#define MGSL_IOCSPARAMS _IOW(MGSL_MAGIC_IOC,0,struct _MGSL_PARAMS)
+#define MGSL_IOCGPARAMS _IOR(MGSL_MAGIC_IOC,1,struct _MGSL_PARAMS)
+#define MGSL_IOCSTXIDLE _IO(MGSL_MAGIC_IOC,2)
+#define MGSL_IOCGTXIDLE _IO(MGSL_MAGIC_IOC,3)
+#define MGSL_IOCTXENABLE _IO(MGSL_MAGIC_IOC,4)
+#define MGSL_IOCRXENABLE _IO(MGSL_MAGIC_IOC,5)
+#define MGSL_IOCTXABORT _IO(MGSL_MAGIC_IOC,6)
+#define MGSL_IOCGSTATS _IO(MGSL_MAGIC_IOC,7)
+#define MGSL_IOCWAITEVENT _IOWR(MGSL_MAGIC_IOC,8,int)
+#define MGSL_IOCCLRMODCOUNT _IO(MGSL_MAGIC_IOC,15)
+#define MGSL_IOCLOOPTXDONE _IO(MGSL_MAGIC_IOC,9)
+#define MGSL_IOCSIF _IO(MGSL_MAGIC_IOC,10)
+#define MGSL_IOCGIF _IO(MGSL_MAGIC_IOC,11)
+#define MGSL_IOCSGPIO _IOW(MGSL_MAGIC_IOC,16,struct gpio_desc)
+#define MGSL_IOCGGPIO _IOR(MGSL_MAGIC_IOC,17,struct gpio_desc)
+#define MGSL_IOCWAITGPIO _IOWR(MGSL_MAGIC_IOC,18,struct gpio_desc)
+
+
+#endif /* _SYNCLINK_H_ */
diff --git a/sysroot/usr/include/linux/sysctl.h b/sysroot/usr/include/linux/sysctl.h
new file mode 100644
index 0000000..c4f7029
--- /dev/null
+++ b/sysroot/usr/include/linux/sysctl.h
@@ -0,0 +1,940 @@
+/*
+ * sysctl.h: General linux system control interface
+ *
+ * Begun 24 March 1995, Stephen Tweedie
+ *
+ ****************************************************************
+ ****************************************************************
+ **
+ ** WARNING:
+ ** The values in this file are exported to user space via
+ ** the sysctl() binary interface. Do *NOT* change the
+ ** numbering of any existing values here, and do not change
+ ** any numbers within any one set of values. If you have to
+ ** redefine an existing interface, use a new number for it.
+ ** The kernel will then return -ENOTDIR to any application using
+ ** the old binary interface.
+ **
+ ** For new interfaces unless you really need a binary number
+ ** please use CTL_UNNUMBERED.
+ **
+ ****************************************************************
+ ****************************************************************
+ */
+
+#ifndef _LINUX_SYSCTL_H
+#define _LINUX_SYSCTL_H
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+
+struct file;
+struct completion;
+
+#define CTL_MAXNAME 10 /* how many path components do we allow in a
+ call to sysctl? In other words, what is
+ the largest acceptable value for the nlen
+ member of a struct __sysctl_args to have? */
+
+struct __sysctl_args {
+ int *name;
+ int nlen;
+ void *oldval;
+ size_t *oldlenp;
+ void *newval;
+ size_t newlen;
+ unsigned long __unused[4];
+};
+
+/* Define sysctl names first */
+
+/* Top-level names: */
+
+/* For internal pattern-matching use only: */
+
+enum
+{
+ CTL_KERN=1, /* General kernel info and control */
+ CTL_VM=2, /* VM management */
+ CTL_NET=3, /* Networking */
+ CTL_PROC=4, /* removal breaks strace(1) compilation */
+ CTL_FS=5, /* Filesystems */
+ CTL_DEBUG=6, /* Debugging */
+ CTL_DEV=7, /* Devices */
+ CTL_BUS=8, /* Busses */
+ CTL_ABI=9, /* Binary emulation */
+ CTL_CPU=10, /* CPU stuff (speed scaling, etc) */
+ CTL_ARLAN=254, /* arlan wireless driver */
+ CTL_S390DBF=5677, /* s390 debug */
+ CTL_SUNRPC=7249, /* sunrpc debug */
+ CTL_PM=9899, /* frv power management */
+ CTL_FRV=9898, /* frv specific sysctls */
+};
+
+/* CTL_BUS names: */
+enum
+{
+ CTL_BUS_ISA=1 /* ISA */
+};
+
+/* /proc/sys/fs/inotify/ */
+enum
+{
+ INOTIFY_MAX_USER_INSTANCES=1, /* max instances per user */
+ INOTIFY_MAX_USER_WATCHES=2, /* max watches per user */
+ INOTIFY_MAX_QUEUED_EVENTS=3 /* max queued events per instance */
+};
+
+/* CTL_KERN names: */
+enum
+{
+ KERN_OSTYPE=1, /* string: system version */
+ KERN_OSRELEASE=2, /* string: system release */
+ KERN_OSREV=3, /* int: system revision */
+ KERN_VERSION=4, /* string: compile time info */
+ KERN_SECUREMASK=5, /* struct: maximum rights mask */
+ KERN_PROF=6, /* table: profiling information */
+ KERN_NODENAME=7,
+ KERN_DOMAINNAME=8,
+
+ KERN_CAP_BSET=14, /* int: capability bounding set */
+ KERN_PANIC=15, /* int: panic timeout */
+ KERN_REALROOTDEV=16, /* real root device to mount after initrd */
+
+ KERN_SPARC_REBOOT=21, /* reboot command on Sparc */
+ KERN_CTLALTDEL=22, /* int: allow ctl-alt-del to reboot */
+ KERN_PRINTK=23, /* struct: control printk logging parameters */
+ KERN_NAMETRANS=24, /* Name translation */
+ KERN_PPC_HTABRECLAIM=25, /* turn htab reclaimation on/off on PPC */
+ KERN_PPC_ZEROPAGED=26, /* turn idle page zeroing on/off on PPC */
+ KERN_PPC_POWERSAVE_NAP=27, /* use nap mode for power saving */
+ KERN_MODPROBE=28,
+ KERN_SG_BIG_BUFF=29,
+ KERN_ACCT=30, /* BSD process accounting parameters */
+ KERN_PPC_L2CR=31, /* l2cr register on PPC */
+
+ KERN_RTSIGNR=32, /* Number of rt sigs queued */
+ KERN_RTSIGMAX=33, /* Max queuable */
+
+ KERN_SHMMAX=34, /* long: Maximum shared memory segment */
+ KERN_MSGMAX=35, /* int: Maximum size of a messege */
+ KERN_MSGMNB=36, /* int: Maximum message queue size */
+ KERN_MSGPOOL=37, /* int: Maximum system message pool size */
+ KERN_SYSRQ=38, /* int: Sysreq enable */
+ KERN_MAX_THREADS=39, /* int: Maximum nr of threads in the system */
+ KERN_RANDOM=40, /* Random driver */
+ KERN_SHMALL=41, /* int: Maximum size of shared memory */
+ KERN_MSGMNI=42, /* int: msg queue identifiers */
+ KERN_SEM=43, /* struct: sysv semaphore limits */
+ KERN_SPARC_STOP_A=44, /* int: Sparc Stop-A enable */
+ KERN_SHMMNI=45, /* int: shm array identifiers */
+ KERN_OVERFLOWUID=46, /* int: overflow UID */
+ KERN_OVERFLOWGID=47, /* int: overflow GID */
+ KERN_SHMPATH=48, /* string: path to shm fs */
+ KERN_HOTPLUG=49, /* string: path to uevent helper (deprecated) */
+ KERN_IEEE_EMULATION_WARNINGS=50, /* int: unimplemented ieee instructions */
+ KERN_S390_USER_DEBUG_LOGGING=51, /* int: dumps of user faults */
+ KERN_CORE_USES_PID=52, /* int: use core or core.%pid */
+ KERN_TAINTED=53, /* int: various kernel tainted flags */
+ KERN_CADPID=54, /* int: PID of the process to notify on CAD */
+ KERN_PIDMAX=55, /* int: PID # limit */
+ KERN_CORE_PATTERN=56, /* string: pattern for core-file names */
+ KERN_PANIC_ON_OOPS=57, /* int: whether we will panic on an oops */
+ KERN_HPPA_PWRSW=58, /* int: hppa soft-power enable */
+ KERN_HPPA_UNALIGNED=59, /* int: hppa unaligned-trap enable */
+ KERN_PRINTK_RATELIMIT=60, /* int: tune printk ratelimiting */
+ KERN_PRINTK_RATELIMIT_BURST=61, /* int: tune printk ratelimiting */
+ KERN_PTY=62, /* dir: pty driver */
+ KERN_NGROUPS_MAX=63, /* int: NGROUPS_MAX */
+ KERN_SPARC_SCONS_PWROFF=64, /* int: serial console power-off halt */
+ KERN_HZ_TIMER=65, /* int: hz timer on or off */
+ KERN_UNKNOWN_NMI_PANIC=66, /* int: unknown nmi panic flag */
+ KERN_BOOTLOADER_TYPE=67, /* int: boot loader type */
+ KERN_RANDOMIZE=68, /* int: randomize virtual address space */
+ KERN_SETUID_DUMPABLE=69, /* int: behaviour of dumps for setuid core */
+ KERN_SPIN_RETRY=70, /* int: number of spinlock retries */
+ KERN_ACPI_VIDEO_FLAGS=71, /* int: flags for setting up video after ACPI sleep */
+ KERN_IA64_UNALIGNED=72, /* int: ia64 unaligned userland trap enable */
+ KERN_COMPAT_LOG=73, /* int: print compat layer messages */
+ KERN_MAX_LOCK_DEPTH=74,
+ KERN_NMI_WATCHDOG=75, /* int: enable/disable nmi watchdog */
+ KERN_PANIC_ON_NMI=76, /* int: whether we will panic on an unrecovered */
+};
+
+
+
+/* CTL_VM names: */
+enum
+{
+ VM_UNUSED1=1, /* was: struct: Set vm swapping control */
+ VM_UNUSED2=2, /* was; int: Linear or sqrt() swapout for hogs */
+ VM_UNUSED3=3, /* was: struct: Set free page thresholds */
+ VM_UNUSED4=4, /* Spare */
+ VM_OVERCOMMIT_MEMORY=5, /* Turn off the virtual memory safety limit */
+ VM_UNUSED5=6, /* was: struct: Set buffer memory thresholds */
+ VM_UNUSED7=7, /* was: struct: Set cache memory thresholds */
+ VM_UNUSED8=8, /* was: struct: Control kswapd behaviour */
+ VM_UNUSED9=9, /* was: struct: Set page table cache parameters */
+ VM_PAGE_CLUSTER=10, /* int: set number of pages to swap together */
+ VM_DIRTY_BACKGROUND=11, /* dirty_background_ratio */
+ VM_DIRTY_RATIO=12, /* dirty_ratio */
+ VM_DIRTY_WB_CS=13, /* dirty_writeback_centisecs */
+ VM_DIRTY_EXPIRE_CS=14, /* dirty_expire_centisecs */
+ VM_NR_PDFLUSH_THREADS=15, /* nr_pdflush_threads */
+ VM_OVERCOMMIT_RATIO=16, /* percent of RAM to allow overcommit in */
+ VM_PAGEBUF=17, /* struct: Control pagebuf parameters */
+ VM_HUGETLB_PAGES=18, /* int: Number of available Huge Pages */
+ VM_SWAPPINESS=19, /* Tendency to steal mapped memory */
+ VM_LOWMEM_RESERVE_RATIO=20,/* reservation ratio for lower memory zones */
+ VM_MIN_FREE_KBYTES=21, /* Minimum free kilobytes to maintain */
+ VM_MAX_MAP_COUNT=22, /* int: Maximum number of mmaps/address-space */
+ VM_LAPTOP_MODE=23, /* vm laptop mode */
+ VM_BLOCK_DUMP=24, /* block dump mode */
+ VM_HUGETLB_GROUP=25, /* permitted hugetlb group */
+ VM_VFS_CACHE_PRESSURE=26, /* dcache/icache reclaim pressure */
+ VM_LEGACY_VA_LAYOUT=27, /* legacy/compatibility virtual address space layout */
+ VM_SWAP_TOKEN_TIMEOUT=28, /* default time for token time out */
+ VM_DROP_PAGECACHE=29, /* int: nuke lots of pagecache */
+ VM_PERCPU_PAGELIST_FRACTION=30,/* int: fraction of pages in each percpu_pagelist */
+ VM_ZONE_RECLAIM_MODE=31, /* reclaim local zone memory before going off node */
+ VM_MIN_UNMAPPED=32, /* Set min percent of unmapped pages */
+ VM_PANIC_ON_OOM=33, /* panic at out-of-memory */
+ VM_VDSO_ENABLED=34, /* map VDSO into new processes? */
+ VM_MIN_SLAB=35, /* Percent pages ignored by zone reclaim */
+};
+
+
+/* CTL_NET names: */
+enum
+{
+ NET_CORE=1,
+ NET_ETHER=2,
+ NET_802=3,
+ NET_UNIX=4,
+ NET_IPV4=5,
+ NET_IPX=6,
+ NET_ATALK=7,
+ NET_NETROM=8,
+ NET_AX25=9,
+ NET_BRIDGE=10,
+ NET_ROSE=11,
+ NET_IPV6=12,
+ NET_X25=13,
+ NET_TR=14,
+ NET_DECNET=15,
+ NET_ECONET=16,
+ NET_SCTP=17,
+ NET_LLC=18,
+ NET_NETFILTER=19,
+ NET_DCCP=20,
+ NET_IRDA=412,
+};
+
+/* /proc/sys/kernel/random */
+enum
+{
+ RANDOM_POOLSIZE=1,
+ RANDOM_ENTROPY_COUNT=2,
+ RANDOM_READ_THRESH=3,
+ RANDOM_WRITE_THRESH=4,
+ RANDOM_BOOT_ID=5,
+ RANDOM_UUID=6
+};
+
+/* /proc/sys/kernel/pty */
+enum
+{
+ PTY_MAX=1,
+ PTY_NR=2
+};
+
+/* /proc/sys/bus/isa */
+enum
+{
+ BUS_ISA_MEM_BASE=1,
+ BUS_ISA_PORT_BASE=2,
+ BUS_ISA_PORT_SHIFT=3
+};
+
+/* /proc/sys/net/core */
+enum
+{
+ NET_CORE_WMEM_MAX=1,
+ NET_CORE_RMEM_MAX=2,
+ NET_CORE_WMEM_DEFAULT=3,
+ NET_CORE_RMEM_DEFAULT=4,
+/* was NET_CORE_DESTROY_DELAY */
+ NET_CORE_MAX_BACKLOG=6,
+ NET_CORE_FASTROUTE=7,
+ NET_CORE_MSG_COST=8,
+ NET_CORE_MSG_BURST=9,
+ NET_CORE_OPTMEM_MAX=10,
+ NET_CORE_HOT_LIST_LENGTH=11,
+ NET_CORE_DIVERT_VERSION=12,
+ NET_CORE_NO_CONG_THRESH=13,
+ NET_CORE_NO_CONG=14,
+ NET_CORE_LO_CONG=15,
+ NET_CORE_MOD_CONG=16,
+ NET_CORE_DEV_WEIGHT=17,
+ NET_CORE_SOMAXCONN=18,
+ NET_CORE_BUDGET=19,
+ NET_CORE_AEVENT_ETIME=20,
+ NET_CORE_AEVENT_RSEQTH=21,
+ NET_CORE_WARNINGS=22,
+};
+
+/* /proc/sys/net/ethernet */
+
+/* /proc/sys/net/802 */
+
+/* /proc/sys/net/unix */
+
+enum
+{
+ NET_UNIX_DESTROY_DELAY=1,
+ NET_UNIX_DELETE_DELAY=2,
+ NET_UNIX_MAX_DGRAM_QLEN=3,
+};
+
+/* /proc/sys/net/netfilter */
+enum
+{
+ NET_NF_CONNTRACK_MAX=1,
+ NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT=2,
+ NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV=3,
+ NET_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED=4,
+ NET_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT=5,
+ NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT=6,
+ NET_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK=7,
+ NET_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT=8,
+ NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE=9,
+ NET_NF_CONNTRACK_UDP_TIMEOUT=10,
+ NET_NF_CONNTRACK_UDP_TIMEOUT_STREAM=11,
+ NET_NF_CONNTRACK_ICMP_TIMEOUT=12,
+ NET_NF_CONNTRACK_GENERIC_TIMEOUT=13,
+ NET_NF_CONNTRACK_BUCKETS=14,
+ NET_NF_CONNTRACK_LOG_INVALID=15,
+ NET_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS=16,
+ NET_NF_CONNTRACK_TCP_LOOSE=17,
+ NET_NF_CONNTRACK_TCP_BE_LIBERAL=18,
+ NET_NF_CONNTRACK_TCP_MAX_RETRANS=19,
+ NET_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED=20,
+ NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT=21,
+ NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED=22,
+ NET_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED=23,
+ NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT=24,
+ NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD=25,
+ NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT=26,
+ NET_NF_CONNTRACK_COUNT=27,
+ NET_NF_CONNTRACK_ICMPV6_TIMEOUT=28,
+ NET_NF_CONNTRACK_FRAG6_TIMEOUT=29,
+ NET_NF_CONNTRACK_FRAG6_LOW_THRESH=30,
+ NET_NF_CONNTRACK_FRAG6_HIGH_THRESH=31,
+ NET_NF_CONNTRACK_CHECKSUM=32,
+};
+
+/* /proc/sys/net/ipv4 */
+enum
+{
+ /* v2.0 compatibile variables */
+ NET_IPV4_FORWARD=8,
+ NET_IPV4_DYNADDR=9,
+
+ NET_IPV4_CONF=16,
+ NET_IPV4_NEIGH=17,
+ NET_IPV4_ROUTE=18,
+ NET_IPV4_FIB_HASH=19,
+ NET_IPV4_NETFILTER=20,
+
+ NET_IPV4_TCP_TIMESTAMPS=33,
+ NET_IPV4_TCP_WINDOW_SCALING=34,
+ NET_IPV4_TCP_SACK=35,
+ NET_IPV4_TCP_RETRANS_COLLAPSE=36,
+ NET_IPV4_DEFAULT_TTL=37,
+ NET_IPV4_AUTOCONFIG=38,
+ NET_IPV4_NO_PMTU_DISC=39,
+ NET_IPV4_TCP_SYN_RETRIES=40,
+ NET_IPV4_IPFRAG_HIGH_THRESH=41,
+ NET_IPV4_IPFRAG_LOW_THRESH=42,
+ NET_IPV4_IPFRAG_TIME=43,
+ NET_IPV4_TCP_MAX_KA_PROBES=44,
+ NET_IPV4_TCP_KEEPALIVE_TIME=45,
+ NET_IPV4_TCP_KEEPALIVE_PROBES=46,
+ NET_IPV4_TCP_RETRIES1=47,
+ NET_IPV4_TCP_RETRIES2=48,
+ NET_IPV4_TCP_FIN_TIMEOUT=49,
+ NET_IPV4_IP_MASQ_DEBUG=50,
+ NET_TCP_SYNCOOKIES=51,
+ NET_TCP_STDURG=52,
+ NET_TCP_RFC1337=53,
+ NET_TCP_SYN_TAILDROP=54,
+ NET_TCP_MAX_SYN_BACKLOG=55,
+ NET_IPV4_LOCAL_PORT_RANGE=56,
+ NET_IPV4_ICMP_ECHO_IGNORE_ALL=57,
+ NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS=58,
+ NET_IPV4_ICMP_SOURCEQUENCH_RATE=59,
+ NET_IPV4_ICMP_DESTUNREACH_RATE=60,
+ NET_IPV4_ICMP_TIMEEXCEED_RATE=61,
+ NET_IPV4_ICMP_PARAMPROB_RATE=62,
+ NET_IPV4_ICMP_ECHOREPLY_RATE=63,
+ NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES=64,
+ NET_IPV4_IGMP_MAX_MEMBERSHIPS=65,
+ NET_TCP_TW_RECYCLE=66,
+ NET_IPV4_ALWAYS_DEFRAG=67,
+ NET_IPV4_TCP_KEEPALIVE_INTVL=68,
+ NET_IPV4_INET_PEER_THRESHOLD=69,
+ NET_IPV4_INET_PEER_MINTTL=70,
+ NET_IPV4_INET_PEER_MAXTTL=71,
+ NET_IPV4_INET_PEER_GC_MINTIME=72,
+ NET_IPV4_INET_PEER_GC_MAXTIME=73,
+ NET_TCP_ORPHAN_RETRIES=74,
+ NET_TCP_ABORT_ON_OVERFLOW=75,
+ NET_TCP_SYNACK_RETRIES=76,
+ NET_TCP_MAX_ORPHANS=77,
+ NET_TCP_MAX_TW_BUCKETS=78,
+ NET_TCP_FACK=79,
+ NET_TCP_REORDERING=80,
+ NET_TCP_ECN=81,
+ NET_TCP_DSACK=82,
+ NET_TCP_MEM=83,
+ NET_TCP_WMEM=84,
+ NET_TCP_RMEM=85,
+ NET_TCP_APP_WIN=86,
+ NET_TCP_ADV_WIN_SCALE=87,
+ NET_IPV4_NONLOCAL_BIND=88,
+ NET_IPV4_ICMP_RATELIMIT=89,
+ NET_IPV4_ICMP_RATEMASK=90,
+ NET_TCP_TW_REUSE=91,
+ NET_TCP_FRTO=92,
+ NET_TCP_LOW_LATENCY=93,
+ NET_IPV4_IPFRAG_SECRET_INTERVAL=94,
+ NET_IPV4_IGMP_MAX_MSF=96,
+ NET_TCP_NO_METRICS_SAVE=97,
+ NET_TCP_DEFAULT_WIN_SCALE=105,
+ NET_TCP_MODERATE_RCVBUF=106,
+ NET_TCP_TSO_WIN_DIVISOR=107,
+ NET_TCP_BIC_BETA=108,
+ NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR=109,
+ NET_TCP_CONG_CONTROL=110,
+ NET_TCP_ABC=111,
+ NET_IPV4_IPFRAG_MAX_DIST=112,
+ NET_TCP_MTU_PROBING=113,
+ NET_TCP_BASE_MSS=114,
+ NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS=115,
+ NET_TCP_DMA_COPYBREAK=116,
+ NET_TCP_SLOW_START_AFTER_IDLE=117,
+ NET_CIPSOV4_CACHE_ENABLE=118,
+ NET_CIPSOV4_CACHE_BUCKET_SIZE=119,
+ NET_CIPSOV4_RBM_OPTFMT=120,
+ NET_CIPSOV4_RBM_STRICTVALID=121,
+ NET_TCP_AVAIL_CONG_CONTROL=122,
+ NET_TCP_ALLOWED_CONG_CONTROL=123,
+ NET_TCP_MAX_SSTHRESH=124,
+ NET_TCP_FRTO_RESPONSE=125,
+};
+
+enum {
+ NET_IPV4_ROUTE_FLUSH=1,
+ NET_IPV4_ROUTE_MIN_DELAY=2,
+ NET_IPV4_ROUTE_MAX_DELAY=3,
+ NET_IPV4_ROUTE_GC_THRESH=4,
+ NET_IPV4_ROUTE_MAX_SIZE=5,
+ NET_IPV4_ROUTE_GC_MIN_INTERVAL=6,
+ NET_IPV4_ROUTE_GC_TIMEOUT=7,
+ NET_IPV4_ROUTE_GC_INTERVAL=8,
+ NET_IPV4_ROUTE_REDIRECT_LOAD=9,
+ NET_IPV4_ROUTE_REDIRECT_NUMBER=10,
+ NET_IPV4_ROUTE_REDIRECT_SILENCE=11,
+ NET_IPV4_ROUTE_ERROR_COST=12,
+ NET_IPV4_ROUTE_ERROR_BURST=13,
+ NET_IPV4_ROUTE_GC_ELASTICITY=14,
+ NET_IPV4_ROUTE_MTU_EXPIRES=15,
+ NET_IPV4_ROUTE_MIN_PMTU=16,
+ NET_IPV4_ROUTE_MIN_ADVMSS=17,
+ NET_IPV4_ROUTE_SECRET_INTERVAL=18,
+ NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS=19,
+};
+
+enum
+{
+ NET_PROTO_CONF_ALL=-2,
+ NET_PROTO_CONF_DEFAULT=-3
+
+ /* And device ifindices ... */
+};
+
+enum
+{
+ NET_IPV4_CONF_FORWARDING=1,
+ NET_IPV4_CONF_MC_FORWARDING=2,
+ NET_IPV4_CONF_PROXY_ARP=3,
+ NET_IPV4_CONF_ACCEPT_REDIRECTS=4,
+ NET_IPV4_CONF_SECURE_REDIRECTS=5,
+ NET_IPV4_CONF_SEND_REDIRECTS=6,
+ NET_IPV4_CONF_SHARED_MEDIA=7,
+ NET_IPV4_CONF_RP_FILTER=8,
+ NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE=9,
+ NET_IPV4_CONF_BOOTP_RELAY=10,
+ NET_IPV4_CONF_LOG_MARTIANS=11,
+ NET_IPV4_CONF_TAG=12,
+ NET_IPV4_CONF_ARPFILTER=13,
+ NET_IPV4_CONF_MEDIUM_ID=14,
+ NET_IPV4_CONF_NOXFRM=15,
+ NET_IPV4_CONF_NOPOLICY=16,
+ NET_IPV4_CONF_FORCE_IGMP_VERSION=17,
+ NET_IPV4_CONF_ARP_ANNOUNCE=18,
+ NET_IPV4_CONF_ARP_IGNORE=19,
+ NET_IPV4_CONF_PROMOTE_SECONDARIES=20,
+ NET_IPV4_CONF_ARP_ACCEPT=21,
+ __NET_IPV4_CONF_MAX
+};
+
+/* /proc/sys/net/ipv4/netfilter */
+enum
+{
+ NET_IPV4_NF_CONNTRACK_MAX=1,
+ NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT=2,
+ NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV=3,
+ NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED=4,
+ NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT=5,
+ NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT=6,
+ NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK=7,
+ NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT=8,
+ NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE=9,
+ NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT=10,
+ NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT_STREAM=11,
+ NET_IPV4_NF_CONNTRACK_ICMP_TIMEOUT=12,
+ NET_IPV4_NF_CONNTRACK_GENERIC_TIMEOUT=13,
+ NET_IPV4_NF_CONNTRACK_BUCKETS=14,
+ NET_IPV4_NF_CONNTRACK_LOG_INVALID=15,
+ NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS=16,
+ NET_IPV4_NF_CONNTRACK_TCP_LOOSE=17,
+ NET_IPV4_NF_CONNTRACK_TCP_BE_LIBERAL=18,
+ NET_IPV4_NF_CONNTRACK_TCP_MAX_RETRANS=19,
+ NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED=20,
+ NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT=21,
+ NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED=22,
+ NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED=23,
+ NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT=24,
+ NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD=25,
+ NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT=26,
+ NET_IPV4_NF_CONNTRACK_COUNT=27,
+ NET_IPV4_NF_CONNTRACK_CHECKSUM=28,
+};
+
+/* /proc/sys/net/ipv6 */
+enum {
+ NET_IPV6_CONF=16,
+ NET_IPV6_NEIGH=17,
+ NET_IPV6_ROUTE=18,
+ NET_IPV6_ICMP=19,
+ NET_IPV6_BINDV6ONLY=20,
+ NET_IPV6_IP6FRAG_HIGH_THRESH=21,
+ NET_IPV6_IP6FRAG_LOW_THRESH=22,
+ NET_IPV6_IP6FRAG_TIME=23,
+ NET_IPV6_IP6FRAG_SECRET_INTERVAL=24,
+ NET_IPV6_MLD_MAX_MSF=25,
+};
+
+enum {
+ NET_IPV6_ROUTE_FLUSH=1,
+ NET_IPV6_ROUTE_GC_THRESH=2,
+ NET_IPV6_ROUTE_MAX_SIZE=3,
+ NET_IPV6_ROUTE_GC_MIN_INTERVAL=4,
+ NET_IPV6_ROUTE_GC_TIMEOUT=5,
+ NET_IPV6_ROUTE_GC_INTERVAL=6,
+ NET_IPV6_ROUTE_GC_ELASTICITY=7,
+ NET_IPV6_ROUTE_MTU_EXPIRES=8,
+ NET_IPV6_ROUTE_MIN_ADVMSS=9,
+ NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS=10
+};
+
+enum {
+ NET_IPV6_FORWARDING=1,
+ NET_IPV6_HOP_LIMIT=2,
+ NET_IPV6_MTU=3,
+ NET_IPV6_ACCEPT_RA=4,
+ NET_IPV6_ACCEPT_REDIRECTS=5,
+ NET_IPV6_AUTOCONF=6,
+ NET_IPV6_DAD_TRANSMITS=7,
+ NET_IPV6_RTR_SOLICITS=8,
+ NET_IPV6_RTR_SOLICIT_INTERVAL=9,
+ NET_IPV6_RTR_SOLICIT_DELAY=10,
+ NET_IPV6_USE_TEMPADDR=11,
+ NET_IPV6_TEMP_VALID_LFT=12,
+ NET_IPV6_TEMP_PREFERED_LFT=13,
+ NET_IPV6_REGEN_MAX_RETRY=14,
+ NET_IPV6_MAX_DESYNC_FACTOR=15,
+ NET_IPV6_MAX_ADDRESSES=16,
+ NET_IPV6_FORCE_MLD_VERSION=17,
+ NET_IPV6_ACCEPT_RA_DEFRTR=18,
+ NET_IPV6_ACCEPT_RA_PINFO=19,
+ NET_IPV6_ACCEPT_RA_RTR_PREF=20,
+ NET_IPV6_RTR_PROBE_INTERVAL=21,
+ NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN=22,
+ NET_IPV6_PROXY_NDP=23,
+ NET_IPV6_ACCEPT_SOURCE_ROUTE=25,
+ __NET_IPV6_MAX
+};
+
+/* /proc/sys/net/ipv6/icmp */
+enum {
+ NET_IPV6_ICMP_RATELIMIT=1
+};
+
+/* /proc/sys/net/<protocol>/neigh/<dev> */
+enum {
+ NET_NEIGH_MCAST_SOLICIT=1,
+ NET_NEIGH_UCAST_SOLICIT=2,
+ NET_NEIGH_APP_SOLICIT=3,
+ NET_NEIGH_RETRANS_TIME=4,
+ NET_NEIGH_REACHABLE_TIME=5,
+ NET_NEIGH_DELAY_PROBE_TIME=6,
+ NET_NEIGH_GC_STALE_TIME=7,
+ NET_NEIGH_UNRES_QLEN=8,
+ NET_NEIGH_PROXY_QLEN=9,
+ NET_NEIGH_ANYCAST_DELAY=10,
+ NET_NEIGH_PROXY_DELAY=11,
+ NET_NEIGH_LOCKTIME=12,
+ NET_NEIGH_GC_INTERVAL=13,
+ NET_NEIGH_GC_THRESH1=14,
+ NET_NEIGH_GC_THRESH2=15,
+ NET_NEIGH_GC_THRESH3=16,
+ NET_NEIGH_RETRANS_TIME_MS=17,
+ NET_NEIGH_REACHABLE_TIME_MS=18,
+ __NET_NEIGH_MAX
+};
+
+/* /proc/sys/net/dccp */
+enum {
+ NET_DCCP_DEFAULT=1,
+};
+
+/* /proc/sys/net/ipx */
+enum {
+ NET_IPX_PPROP_BROADCASTING=1,
+ NET_IPX_FORWARDING=2
+};
+
+/* /proc/sys/net/llc */
+enum {
+ NET_LLC2=1,
+ NET_LLC_STATION=2,
+};
+
+/* /proc/sys/net/llc/llc2 */
+enum {
+ NET_LLC2_TIMEOUT=1,
+};
+
+/* /proc/sys/net/llc/station */
+enum {
+ NET_LLC_STATION_ACK_TIMEOUT=1,
+};
+
+/* /proc/sys/net/llc/llc2/timeout */
+enum {
+ NET_LLC2_ACK_TIMEOUT=1,
+ NET_LLC2_P_TIMEOUT=2,
+ NET_LLC2_REJ_TIMEOUT=3,
+ NET_LLC2_BUSY_TIMEOUT=4,
+};
+
+/* /proc/sys/net/appletalk */
+enum {
+ NET_ATALK_AARP_EXPIRY_TIME=1,
+ NET_ATALK_AARP_TICK_TIME=2,
+ NET_ATALK_AARP_RETRANSMIT_LIMIT=3,
+ NET_ATALK_AARP_RESOLVE_TIME=4
+};
+
+
+/* /proc/sys/net/netrom */
+enum {
+ NET_NETROM_DEFAULT_PATH_QUALITY=1,
+ NET_NETROM_OBSOLESCENCE_COUNT_INITIALISER=2,
+ NET_NETROM_NETWORK_TTL_INITIALISER=3,
+ NET_NETROM_TRANSPORT_TIMEOUT=4,
+ NET_NETROM_TRANSPORT_MAXIMUM_TRIES=5,
+ NET_NETROM_TRANSPORT_ACKNOWLEDGE_DELAY=6,
+ NET_NETROM_TRANSPORT_BUSY_DELAY=7,
+ NET_NETROM_TRANSPORT_REQUESTED_WINDOW_SIZE=8,
+ NET_NETROM_TRANSPORT_NO_ACTIVITY_TIMEOUT=9,
+ NET_NETROM_ROUTING_CONTROL=10,
+ NET_NETROM_LINK_FAILS_COUNT=11,
+ NET_NETROM_RESET=12
+};
+
+/* /proc/sys/net/ax25 */
+enum {
+ NET_AX25_IP_DEFAULT_MODE=1,
+ NET_AX25_DEFAULT_MODE=2,
+ NET_AX25_BACKOFF_TYPE=3,
+ NET_AX25_CONNECT_MODE=4,
+ NET_AX25_STANDARD_WINDOW=5,
+ NET_AX25_EXTENDED_WINDOW=6,
+ NET_AX25_T1_TIMEOUT=7,
+ NET_AX25_T2_TIMEOUT=8,
+ NET_AX25_T3_TIMEOUT=9,
+ NET_AX25_IDLE_TIMEOUT=10,
+ NET_AX25_N2=11,
+ NET_AX25_PACLEN=12,
+ NET_AX25_PROTOCOL=13,
+ NET_AX25_DAMA_SLAVE_TIMEOUT=14
+};
+
+/* /proc/sys/net/rose */
+enum {
+ NET_ROSE_RESTART_REQUEST_TIMEOUT=1,
+ NET_ROSE_CALL_REQUEST_TIMEOUT=2,
+ NET_ROSE_RESET_REQUEST_TIMEOUT=3,
+ NET_ROSE_CLEAR_REQUEST_TIMEOUT=4,
+ NET_ROSE_ACK_HOLD_BACK_TIMEOUT=5,
+ NET_ROSE_ROUTING_CONTROL=6,
+ NET_ROSE_LINK_FAIL_TIMEOUT=7,
+ NET_ROSE_MAX_VCS=8,
+ NET_ROSE_WINDOW_SIZE=9,
+ NET_ROSE_NO_ACTIVITY_TIMEOUT=10
+};
+
+/* /proc/sys/net/x25 */
+enum {
+ NET_X25_RESTART_REQUEST_TIMEOUT=1,
+ NET_X25_CALL_REQUEST_TIMEOUT=2,
+ NET_X25_RESET_REQUEST_TIMEOUT=3,
+ NET_X25_CLEAR_REQUEST_TIMEOUT=4,
+ NET_X25_ACK_HOLD_BACK_TIMEOUT=5,
+ NET_X25_FORWARD=6
+};
+
+/* /proc/sys/net/token-ring */
+enum
+{
+ NET_TR_RIF_TIMEOUT=1
+};
+
+/* /proc/sys/net/decnet/ */
+enum {
+ NET_DECNET_NODE_TYPE = 1,
+ NET_DECNET_NODE_ADDRESS = 2,
+ NET_DECNET_NODE_NAME = 3,
+ NET_DECNET_DEFAULT_DEVICE = 4,
+ NET_DECNET_TIME_WAIT = 5,
+ NET_DECNET_DN_COUNT = 6,
+ NET_DECNET_DI_COUNT = 7,
+ NET_DECNET_DR_COUNT = 8,
+ NET_DECNET_DST_GC_INTERVAL = 9,
+ NET_DECNET_CONF = 10,
+ NET_DECNET_NO_FC_MAX_CWND = 11,
+ NET_DECNET_MEM = 12,
+ NET_DECNET_RMEM = 13,
+ NET_DECNET_WMEM = 14,
+ NET_DECNET_DEBUG_LEVEL = 255
+};
+
+/* /proc/sys/net/decnet/conf/<dev> */
+enum {
+ NET_DECNET_CONF_LOOPBACK = -2,
+ NET_DECNET_CONF_DDCMP = -3,
+ NET_DECNET_CONF_PPP = -4,
+ NET_DECNET_CONF_X25 = -5,
+ NET_DECNET_CONF_GRE = -6,
+ NET_DECNET_CONF_ETHER = -7
+
+ /* ... and ifindex of devices */
+};
+
+/* /proc/sys/net/decnet/conf/<dev>/ */
+enum {
+ NET_DECNET_CONF_DEV_PRIORITY = 1,
+ NET_DECNET_CONF_DEV_T1 = 2,
+ NET_DECNET_CONF_DEV_T2 = 3,
+ NET_DECNET_CONF_DEV_T3 = 4,
+ NET_DECNET_CONF_DEV_FORWARDING = 5,
+ NET_DECNET_CONF_DEV_BLKSIZE = 6,
+ NET_DECNET_CONF_DEV_STATE = 7
+};
+
+/* /proc/sys/net/sctp */
+enum {
+ NET_SCTP_RTO_INITIAL = 1,
+ NET_SCTP_RTO_MIN = 2,
+ NET_SCTP_RTO_MAX = 3,
+ NET_SCTP_RTO_ALPHA = 4,
+ NET_SCTP_RTO_BETA = 5,
+ NET_SCTP_VALID_COOKIE_LIFE = 6,
+ NET_SCTP_ASSOCIATION_MAX_RETRANS = 7,
+ NET_SCTP_PATH_MAX_RETRANS = 8,
+ NET_SCTP_MAX_INIT_RETRANSMITS = 9,
+ NET_SCTP_HB_INTERVAL = 10,
+ NET_SCTP_PRESERVE_ENABLE = 11,
+ NET_SCTP_MAX_BURST = 12,
+ NET_SCTP_ADDIP_ENABLE = 13,
+ NET_SCTP_PRSCTP_ENABLE = 14,
+ NET_SCTP_SNDBUF_POLICY = 15,
+ NET_SCTP_SACK_TIMEOUT = 16,
+ NET_SCTP_RCVBUF_POLICY = 17,
+};
+
+/* /proc/sys/net/bridge */
+enum {
+ NET_BRIDGE_NF_CALL_ARPTABLES = 1,
+ NET_BRIDGE_NF_CALL_IPTABLES = 2,
+ NET_BRIDGE_NF_CALL_IP6TABLES = 3,
+ NET_BRIDGE_NF_FILTER_VLAN_TAGGED = 4,
+ NET_BRIDGE_NF_FILTER_PPPOE_TAGGED = 5,
+};
+
+/* proc/sys/net/irda */
+enum {
+ NET_IRDA_DISCOVERY=1,
+ NET_IRDA_DEVNAME=2,
+ NET_IRDA_DEBUG=3,
+ NET_IRDA_FAST_POLL=4,
+ NET_IRDA_DISCOVERY_SLOTS=5,
+ NET_IRDA_DISCOVERY_TIMEOUT=6,
+ NET_IRDA_SLOT_TIMEOUT=7,
+ NET_IRDA_MAX_BAUD_RATE=8,
+ NET_IRDA_MIN_TX_TURN_TIME=9,
+ NET_IRDA_MAX_TX_DATA_SIZE=10,
+ NET_IRDA_MAX_TX_WINDOW=11,
+ NET_IRDA_MAX_NOREPLY_TIME=12,
+ NET_IRDA_WARN_NOREPLY_TIME=13,
+ NET_IRDA_LAP_KEEPALIVE_TIME=14,
+};
+
+
+/* CTL_FS names: */
+enum
+{
+ FS_NRINODE=1, /* int:current number of allocated inodes */
+ FS_STATINODE=2,
+ FS_MAXINODE=3, /* int:maximum number of inodes that can be allocated */
+ FS_NRDQUOT=4, /* int:current number of allocated dquots */
+ FS_MAXDQUOT=5, /* int:maximum number of dquots that can be allocated */
+ FS_NRFILE=6, /* int:current number of allocated filedescriptors */
+ FS_MAXFILE=7, /* int:maximum number of filedescriptors that can be allocated */
+ FS_DENTRY=8,
+ FS_NRSUPER=9, /* int:current number of allocated super_blocks */
+ FS_MAXSUPER=10, /* int:maximum number of super_blocks that can be allocated */
+ FS_OVERFLOWUID=11, /* int: overflow UID */
+ FS_OVERFLOWGID=12, /* int: overflow GID */
+ FS_LEASES=13, /* int: leases enabled */
+ FS_DIR_NOTIFY=14, /* int: directory notification enabled */
+ FS_LEASE_TIME=15, /* int: maximum time to wait for a lease break */
+ FS_DQSTATS=16, /* disc quota usage statistics and control */
+ FS_XFS=17, /* struct: control xfs parameters */
+ FS_AIO_NR=18, /* current system-wide number of aio requests */
+ FS_AIO_MAX_NR=19, /* system-wide maximum number of aio requests */
+ FS_INOTIFY=20, /* inotify submenu */
+ FS_OCFS2=988, /* ocfs2 */
+};
+
+/* /proc/sys/fs/quota/ */
+enum {
+ FS_DQ_LOOKUPS = 1,
+ FS_DQ_DROPS = 2,
+ FS_DQ_READS = 3,
+ FS_DQ_WRITES = 4,
+ FS_DQ_CACHE_HITS = 5,
+ FS_DQ_ALLOCATED = 6,
+ FS_DQ_FREE = 7,
+ FS_DQ_SYNCS = 8,
+ FS_DQ_WARNINGS = 9,
+};
+
+/* CTL_DEBUG names: */
+
+/* CTL_DEV names: */
+enum {
+ DEV_CDROM=1,
+ DEV_HWMON=2,
+ DEV_PARPORT=3,
+ DEV_RAID=4,
+ DEV_MAC_HID=5,
+ DEV_SCSI=6,
+ DEV_IPMI=7,
+};
+
+/* /proc/sys/dev/cdrom */
+enum {
+ DEV_CDROM_INFO=1,
+ DEV_CDROM_AUTOCLOSE=2,
+ DEV_CDROM_AUTOEJECT=3,
+ DEV_CDROM_DEBUG=4,
+ DEV_CDROM_LOCK=5,
+ DEV_CDROM_CHECK_MEDIA=6
+};
+
+/* /proc/sys/dev/parport */
+enum {
+ DEV_PARPORT_DEFAULT=-3
+};
+
+/* /proc/sys/dev/raid */
+enum {
+ DEV_RAID_SPEED_LIMIT_MIN=1,
+ DEV_RAID_SPEED_LIMIT_MAX=2
+};
+
+/* /proc/sys/dev/parport/default */
+enum {
+ DEV_PARPORT_DEFAULT_TIMESLICE=1,
+ DEV_PARPORT_DEFAULT_SPINTIME=2
+};
+
+/* /proc/sys/dev/parport/parport n */
+enum {
+ DEV_PARPORT_SPINTIME=1,
+ DEV_PARPORT_BASE_ADDR=2,
+ DEV_PARPORT_IRQ=3,
+ DEV_PARPORT_DMA=4,
+ DEV_PARPORT_MODES=5,
+ DEV_PARPORT_DEVICES=6,
+ DEV_PARPORT_AUTOPROBE=16
+};
+
+/* /proc/sys/dev/parport/parport n/devices/ */
+enum {
+ DEV_PARPORT_DEVICES_ACTIVE=-3,
+};
+
+/* /proc/sys/dev/parport/parport n/devices/device n */
+enum {
+ DEV_PARPORT_DEVICE_TIMESLICE=1,
+};
+
+/* /proc/sys/dev/mac_hid */
+enum {
+ DEV_MAC_HID_KEYBOARD_SENDS_LINUX_KEYCODES=1,
+ DEV_MAC_HID_KEYBOARD_LOCK_KEYCODES=2,
+ DEV_MAC_HID_MOUSE_BUTTON_EMULATION=3,
+ DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=4,
+ DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=5,
+ DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=6
+};
+
+/* /proc/sys/dev/scsi */
+enum {
+ DEV_SCSI_LOGGING_LEVEL=1,
+};
+
+/* /proc/sys/dev/ipmi */
+enum {
+ DEV_IPMI_POWEROFF_POWERCYCLE=1,
+};
+
+/* /proc/sys/abi */
+enum
+{
+ ABI_DEFHANDLER_COFF=1, /* default handler for coff binaries */
+ ABI_DEFHANDLER_ELF=2, /* default handler for ELF binaries */
+ ABI_DEFHANDLER_LCALL7=3,/* default handler for procs using lcall7 */
+ ABI_DEFHANDLER_LIBCSO=4,/* default handler for an libc.so ELF interp */
+ ABI_TRACE=5, /* tracing flags */
+ ABI_FAKE_UTSNAME=6, /* fake target utsname information */
+};
+
+
+
+#endif /* _LINUX_SYSCTL_H */
diff --git a/sysroot/usr/include/linux/taskstats.h b/sysroot/usr/include/linux/taskstats.h
new file mode 100644
index 0000000..5d69c07
--- /dev/null
+++ b/sysroot/usr/include/linux/taskstats.h
@@ -0,0 +1,206 @@
+/* taskstats.h - exporting per-task statistics
+ *
+ * Copyright (C) Shailabh Nagar, IBM Corp. 2006
+ * (C) Balbir Singh, IBM Corp. 2006
+ * (C) Jay Lan, SGI, 2006
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2.1 of the GNU Lesser General Public License
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+#ifndef _LINUX_TASKSTATS_H
+#define _LINUX_TASKSTATS_H
+
+/* Format for per-task data returned to userland when
+ * - a task exits
+ * - listener requests stats for a task
+ *
+ * The struct is versioned. Newer versions should only add fields to
+ * the bottom of the struct to maintain backward compatibility.
+ *
+ *
+ * To add new fields
+ * a) bump up TASKSTATS_VERSION
+ * b) add comment indicating new version number at end of struct
+ * c) add new fields after version comment; maintain 64-bit alignment
+ */
+
+
+#define TASKSTATS_VERSION 6
+#define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN
+ * in linux/sched.h */
+
+struct taskstats {
+
+ /* The version number of this struct. This field is always set to
+ * TAKSTATS_VERSION, which is defined in <linux/taskstats.h>.
+ * Each time the struct is changed, the value should be incremented.
+ */
+ __u16 version;
+ __u32 ac_exitcode; /* Exit status */
+
+ /* The accounting flags of a task as defined in <linux/acct.h>
+ * Defined values are AFORK, ASU, ACOMPAT, ACORE, and AXSIG.
+ */
+ __u8 ac_flag; /* Record flags */
+ __u8 ac_nice; /* task_nice */
+
+ /* Delay accounting fields start
+ *
+ * All values, until comment "Delay accounting fields end" are
+ * available only if delay accounting is enabled, even though the last
+ * few fields are not delays
+ *
+ * xxx_count is the number of delay values recorded
+ * xxx_delay_total is the corresponding cumulative delay in nanoseconds
+ *
+ * xxx_delay_total wraps around to zero on overflow
+ * xxx_count incremented regardless of overflow
+ */
+
+ /* Delay waiting for cpu, while runnable
+ * count, delay_total NOT updated atomically
+ */
+ __u64 cpu_count __attribute__((aligned(8)));
+ __u64 cpu_delay_total;
+
+ /* Following four fields atomically updated using task->delays->lock */
+
+ /* Delay waiting for synchronous block I/O to complete
+ * does not account for delays in I/O submission
+ */
+ __u64 blkio_count;
+ __u64 blkio_delay_total;
+
+ /* Delay waiting for page fault I/O (swap in only) */
+ __u64 swapin_count;
+ __u64 swapin_delay_total;
+
+ /* cpu "wall-clock" running time
+ * On some architectures, value will adjust for cpu time stolen
+ * from the kernel in involuntary waits due to virtualization.
+ * Value is cumulative, in nanoseconds, without a corresponding count
+ * and wraps around to zero silently on overflow
+ */
+ __u64 cpu_run_real_total;
+
+ /* cpu "virtual" running time
+ * Uses time intervals seen by the kernel i.e. no adjustment
+ * for kernel's involuntary waits due to virtualization.
+ * Value is cumulative, in nanoseconds, without a corresponding count
+ * and wraps around to zero silently on overflow
+ */
+ __u64 cpu_run_virtual_total;
+ /* Delay accounting fields end */
+ /* version 1 ends here */
+
+ /* Basic Accounting Fields start */
+ char ac_comm[TS_COMM_LEN]; /* Command name */
+ __u8 ac_sched __attribute__((aligned(8)));
+ /* Scheduling discipline */
+ __u8 ac_pad[3];
+ __u32 ac_uid __attribute__((aligned(8)));
+ /* User ID */
+ __u32 ac_gid; /* Group ID */
+ __u32 ac_pid; /* Process ID */
+ __u32 ac_ppid; /* Parent process ID */
+ __u32 ac_btime; /* Begin time [sec since 1970] */
+ __u64 ac_etime __attribute__((aligned(8)));
+ /* Elapsed time [usec] */
+ __u64 ac_utime; /* User CPU time [usec] */
+ __u64 ac_stime; /* SYstem CPU time [usec] */
+ __u64 ac_minflt; /* Minor Page Fault Count */
+ __u64 ac_majflt; /* Major Page Fault Count */
+ /* Basic Accounting Fields end */
+
+ /* Extended accounting fields start */
+ /* Accumulated RSS usage in duration of a task, in MBytes-usecs.
+ * The current rss usage is added to this counter every time
+ * a tick is charged to a task's system time. So, at the end we
+ * will have memory usage multiplied by system time. Thus an
+ * average usage per system time unit can be calculated.
+ */
+ __u64 coremem; /* accumulated RSS usage in MB-usec */
+ /* Accumulated virtual memory usage in duration of a task.
+ * Same as acct_rss_mem1 above except that we keep track of VM usage.
+ */
+ __u64 virtmem; /* accumulated VM usage in MB-usec */
+
+ /* High watermark of RSS and virtual memory usage in duration of
+ * a task, in KBytes.
+ */
+ __u64 hiwater_rss; /* High-watermark of RSS usage, in KB */
+ __u64 hiwater_vm; /* High-water VM usage, in KB */
+
+ /* The following four fields are I/O statistics of a task. */
+ __u64 read_char; /* bytes read */
+ __u64 write_char; /* bytes written */
+ __u64 read_syscalls; /* read syscalls */
+ __u64 write_syscalls; /* write syscalls */
+ /* Extended accounting fields end */
+
+#define TASKSTATS_HAS_IO_ACCOUNTING
+ /* Per-task storage I/O accounting starts */
+ __u64 read_bytes; /* bytes of read I/O */
+ __u64 write_bytes; /* bytes of write I/O */
+ __u64 cancelled_write_bytes; /* bytes of cancelled write I/O */
+
+ __u64 nvcsw; /* voluntary_ctxt_switches */
+ __u64 nivcsw; /* nonvoluntary_ctxt_switches */
+
+ /* time accounting for SMT machines */
+ __u64 ac_utimescaled; /* utime scaled on frequency etc */
+ __u64 ac_stimescaled; /* stime scaled on frequency etc */
+ __u64 cpu_scaled_run_real_total; /* scaled cpu_run_real_total */
+};
+
+
+/*
+ * Commands sent from userspace
+ * Not versioned. New commands should only be inserted at the enum's end
+ * prior to __TASKSTATS_CMD_MAX
+ */
+
+enum {
+ TASKSTATS_CMD_UNSPEC = 0, /* Reserved */
+ TASKSTATS_CMD_GET, /* user->kernel request/get-response */
+ TASKSTATS_CMD_NEW, /* kernel->user event */
+ __TASKSTATS_CMD_MAX,
+};
+
+#define TASKSTATS_CMD_MAX (__TASKSTATS_CMD_MAX - 1)
+
+enum {
+ TASKSTATS_TYPE_UNSPEC = 0, /* Reserved */
+ TASKSTATS_TYPE_PID, /* Process id */
+ TASKSTATS_TYPE_TGID, /* Thread group id */
+ TASKSTATS_TYPE_STATS, /* taskstats structure */
+ TASKSTATS_TYPE_AGGR_PID, /* contains pid + stats */
+ TASKSTATS_TYPE_AGGR_TGID, /* contains tgid + stats */
+ __TASKSTATS_TYPE_MAX,
+};
+
+#define TASKSTATS_TYPE_MAX (__TASKSTATS_TYPE_MAX - 1)
+
+enum {
+ TASKSTATS_CMD_ATTR_UNSPEC = 0,
+ TASKSTATS_CMD_ATTR_PID,
+ TASKSTATS_CMD_ATTR_TGID,
+ TASKSTATS_CMD_ATTR_REGISTER_CPUMASK,
+ TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK,
+ __TASKSTATS_CMD_ATTR_MAX,
+};
+
+#define TASKSTATS_CMD_ATTR_MAX (__TASKSTATS_CMD_ATTR_MAX - 1)
+
+/* NETLINK_GENERIC related info */
+
+#define TASKSTATS_GENL_NAME "TASKSTATS"
+#define TASKSTATS_GENL_VERSION 0x1
+
+#endif /* _LINUX_TASKSTATS_H */
diff --git a/sysroot/usr/include/linux/tc_act/tc_gact.h b/sysroot/usr/include/linux/tc_act/tc_gact.h
new file mode 100644
index 0000000..23a03eb
--- /dev/null
+++ b/sysroot/usr/include/linux/tc_act/tc_gact.h
@@ -0,0 +1,34 @@
+#ifndef __LINUX_TC_GACT_H
+#define __LINUX_TC_GACT_H
+
+#include <linux/pkt_cls.h>
+
+#define TCA_ACT_GACT 5
+struct tc_gact
+{
+ tc_gen;
+
+};
+
+struct tc_gact_p
+{
+#define PGACT_NONE 0
+#define PGACT_NETRAND 1
+#define PGACT_DETERM 2
+#define MAX_RAND (PGACT_DETERM + 1 )
+ __u16 ptype;
+ __u16 pval;
+ int paction;
+};
+
+enum
+{
+ TCA_GACT_UNSPEC,
+ TCA_GACT_TM,
+ TCA_GACT_PARMS,
+ TCA_GACT_PROB,
+ __TCA_GACT_MAX
+};
+#define TCA_GACT_MAX (__TCA_GACT_MAX - 1)
+
+#endif
diff --git a/sysroot/usr/include/linux/tc_act/tc_ipt.h b/sysroot/usr/include/linux/tc_act/tc_ipt.h
new file mode 100644
index 0000000..4b6f7b6
--- /dev/null
+++ b/sysroot/usr/include/linux/tc_act/tc_ipt.h
@@ -0,0 +1,21 @@
+#ifndef __LINUX_TC_IPT_H
+#define __LINUX_TC_IPT_H
+
+#include <linux/pkt_cls.h>
+
+#define TCA_ACT_IPT 6
+
+enum
+{
+ TCA_IPT_UNSPEC,
+ TCA_IPT_TABLE,
+ TCA_IPT_HOOK,
+ TCA_IPT_INDEX,
+ TCA_IPT_CNT,
+ TCA_IPT_TM,
+ TCA_IPT_TARG,
+ __TCA_IPT_MAX
+};
+#define TCA_IPT_MAX (__TCA_IPT_MAX - 1)
+
+#endif
diff --git a/sysroot/usr/include/linux/tc_act/tc_mirred.h b/sysroot/usr/include/linux/tc_act/tc_mirred.h
new file mode 100644
index 0000000..71d6340
--- /dev/null
+++ b/sysroot/usr/include/linux/tc_act/tc_mirred.h
@@ -0,0 +1,28 @@
+#ifndef __LINUX_TC_MIR_H
+#define __LINUX_TC_MIR_H
+
+#include <linux/pkt_cls.h>
+
+#define TCA_ACT_MIRRED 8
+#define TCA_EGRESS_REDIR 1 /* packet redirect to EGRESS*/
+#define TCA_EGRESS_MIRROR 2 /* mirror packet to EGRESS */
+#define TCA_INGRESS_REDIR 3 /* packet redirect to INGRESS*/
+#define TCA_INGRESS_MIRROR 4 /* mirror packet to INGRESS */
+
+struct tc_mirred
+{
+ tc_gen;
+ int eaction; /* one of IN/EGRESS_MIRROR/REDIR */
+ __u32 ifindex; /* ifindex of egress port */
+};
+
+enum
+{
+ TCA_MIRRED_UNSPEC,
+ TCA_MIRRED_TM,
+ TCA_MIRRED_PARMS,
+ __TCA_MIRRED_MAX
+};
+#define TCA_MIRRED_MAX (__TCA_MIRRED_MAX - 1)
+
+#endif
diff --git a/sysroot/usr/include/linux/tc_act/tc_nat.h b/sysroot/usr/include/linux/tc_act/tc_nat.h
new file mode 100644
index 0000000..e7cf31e
--- /dev/null
+++ b/sysroot/usr/include/linux/tc_act/tc_nat.h
@@ -0,0 +1,29 @@
+#ifndef __LINUX_TC_NAT_H
+#define __LINUX_TC_NAT_H
+
+#include <linux/pkt_cls.h>
+#include <linux/types.h>
+
+#define TCA_ACT_NAT 9
+
+enum
+{
+ TCA_NAT_UNSPEC,
+ TCA_NAT_PARMS,
+ TCA_NAT_TM,
+ __TCA_NAT_MAX
+};
+#define TCA_NAT_MAX (__TCA_NAT_MAX - 1)
+
+#define TCA_NAT_FLAG_EGRESS 1
+
+struct tc_nat
+{
+ tc_gen;
+ __be32 old_addr;
+ __be32 new_addr;
+ __be32 mask;
+ __u32 flags;
+};
+
+#endif
diff --git a/sysroot/usr/include/linux/tc_act/tc_pedit.h b/sysroot/usr/include/linux/tc_act/tc_pedit.h
new file mode 100644
index 0000000..83e56e3
--- /dev/null
+++ b/sysroot/usr/include/linux/tc_act/tc_pedit.h
@@ -0,0 +1,36 @@
+#ifndef __LINUX_TC_PED_H
+#define __LINUX_TC_PED_H
+
+#include <linux/pkt_cls.h>
+
+#define TCA_ACT_PEDIT 7
+
+enum
+{
+ TCA_PEDIT_UNSPEC,
+ TCA_PEDIT_TM,
+ TCA_PEDIT_PARMS,
+ __TCA_PEDIT_MAX
+};
+#define TCA_PEDIT_MAX (__TCA_PEDIT_MAX - 1)
+
+struct tc_pedit_key
+{
+ __u32 mask; /* AND */
+ __u32 val; /*XOR */
+ __u32 off; /*offset */
+ __u32 at;
+ __u32 offmask;
+ __u32 shift;
+};
+
+struct tc_pedit_sel
+{
+ tc_gen;
+ unsigned char nkeys;
+ unsigned char flags;
+ struct tc_pedit_key keys[0];
+};
+#define tc_pedit tc_pedit_sel
+
+#endif
diff --git a/sysroot/usr/include/linux/tc_ematch/tc_em_cmp.h b/sysroot/usr/include/linux/tc_ematch/tc_em_cmp.h
new file mode 100644
index 0000000..c7f4d43
--- /dev/null
+++ b/sysroot/usr/include/linux/tc_ematch/tc_em_cmp.h
@@ -0,0 +1,26 @@
+#ifndef __LINUX_TC_EM_CMP_H
+#define __LINUX_TC_EM_CMP_H
+
+#include <linux/pkt_cls.h>
+
+struct tcf_em_cmp
+{
+ __u32 val;
+ __u32 mask;
+ __u16 off;
+ __u8 align:4;
+ __u8 flags:4;
+ __u8 layer:4;
+ __u8 opnd:4;
+};
+
+enum
+{
+ TCF_EM_ALIGN_U8 = 1,
+ TCF_EM_ALIGN_U16 = 2,
+ TCF_EM_ALIGN_U32 = 4
+};
+
+#define TCF_EM_CMP_TRANS 1
+
+#endif
diff --git a/sysroot/usr/include/linux/tc_ematch/tc_em_meta.h b/sysroot/usr/include/linux/tc_ematch/tc_em_meta.h
new file mode 100644
index 0000000..e21937c
--- /dev/null
+++ b/sysroot/usr/include/linux/tc_ematch/tc_em_meta.h
@@ -0,0 +1,94 @@
+#ifndef __LINUX_TC_EM_META_H
+#define __LINUX_TC_EM_META_H
+
+#include <linux/pkt_cls.h>
+
+enum
+{
+ TCA_EM_META_UNSPEC,
+ TCA_EM_META_HDR,
+ TCA_EM_META_LVALUE,
+ TCA_EM_META_RVALUE,
+ __TCA_EM_META_MAX
+};
+#define TCA_EM_META_MAX (__TCA_EM_META_MAX - 1)
+
+struct tcf_meta_val
+{
+ __u16 kind;
+ __u8 shift;
+ __u8 op;
+};
+
+#define TCF_META_TYPE_MASK (0xf << 12)
+#define TCF_META_TYPE(kind) (((kind) & TCF_META_TYPE_MASK) >> 12)
+#define TCF_META_ID_MASK 0x7ff
+#define TCF_META_ID(kind) ((kind) & TCF_META_ID_MASK)
+
+enum
+{
+ TCF_META_TYPE_VAR,
+ TCF_META_TYPE_INT,
+ __TCF_META_TYPE_MAX
+};
+#define TCF_META_TYPE_MAX (__TCF_META_TYPE_MAX - 1)
+
+enum
+{
+ TCF_META_ID_VALUE,
+ TCF_META_ID_RANDOM,
+ TCF_META_ID_LOADAVG_0,
+ TCF_META_ID_LOADAVG_1,
+ TCF_META_ID_LOADAVG_2,
+ TCF_META_ID_DEV,
+ TCF_META_ID_PRIORITY,
+ TCF_META_ID_PROTOCOL,
+ TCF_META_ID_PKTTYPE,
+ TCF_META_ID_PKTLEN,
+ TCF_META_ID_DATALEN,
+ TCF_META_ID_MACLEN,
+ TCF_META_ID_NFMARK,
+ TCF_META_ID_TCINDEX,
+ TCF_META_ID_RTCLASSID,
+ TCF_META_ID_RTIIF,
+ TCF_META_ID_SK_FAMILY,
+ TCF_META_ID_SK_STATE,
+ TCF_META_ID_SK_REUSE,
+ TCF_META_ID_SK_BOUND_IF,
+ TCF_META_ID_SK_REFCNT,
+ TCF_META_ID_SK_SHUTDOWN,
+ TCF_META_ID_SK_PROTO,
+ TCF_META_ID_SK_TYPE,
+ TCF_META_ID_SK_RCVBUF,
+ TCF_META_ID_SK_RMEM_ALLOC,
+ TCF_META_ID_SK_WMEM_ALLOC,
+ TCF_META_ID_SK_OMEM_ALLOC,
+ TCF_META_ID_SK_WMEM_QUEUED,
+ TCF_META_ID_SK_RCV_QLEN,
+ TCF_META_ID_SK_SND_QLEN,
+ TCF_META_ID_SK_ERR_QLEN,
+ TCF_META_ID_SK_FORWARD_ALLOCS,
+ TCF_META_ID_SK_SNDBUF,
+ TCF_META_ID_SK_ALLOCS,
+ TCF_META_ID_SK_ROUTE_CAPS,
+ TCF_META_ID_SK_HASH,
+ TCF_META_ID_SK_LINGERTIME,
+ TCF_META_ID_SK_ACK_BACKLOG,
+ TCF_META_ID_SK_MAX_ACK_BACKLOG,
+ TCF_META_ID_SK_PRIO,
+ TCF_META_ID_SK_RCVLOWAT,
+ TCF_META_ID_SK_RCVTIMEO,
+ TCF_META_ID_SK_SNDTIMEO,
+ TCF_META_ID_SK_SENDMSG_OFF,
+ TCF_META_ID_SK_WRITE_PENDING,
+ __TCF_META_ID_MAX
+};
+#define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1)
+
+struct tcf_meta_hdr
+{
+ struct tcf_meta_val left;
+ struct tcf_meta_val right;
+};
+
+#endif
diff --git a/sysroot/usr/include/linux/tc_ematch/tc_em_nbyte.h b/sysroot/usr/include/linux/tc_ematch/tc_em_nbyte.h
new file mode 100644
index 0000000..f19d1f5
--- /dev/null
+++ b/sysroot/usr/include/linux/tc_ematch/tc_em_nbyte.h
@@ -0,0 +1,13 @@
+#ifndef __LINUX_TC_EM_NBYTE_H
+#define __LINUX_TC_EM_NBYTE_H
+
+#include <linux/pkt_cls.h>
+
+struct tcf_em_nbyte
+{
+ __u16 off;
+ __u16 len:12;
+ __u8 layer:4;
+};
+
+#endif
diff --git a/sysroot/usr/include/linux/tc_ematch/tc_em_text.h b/sysroot/usr/include/linux/tc_ematch/tc_em_text.h
new file mode 100644
index 0000000..7cd43e9
--- /dev/null
+++ b/sysroot/usr/include/linux/tc_ematch/tc_em_text.h
@@ -0,0 +1,19 @@
+#ifndef __LINUX_TC_EM_TEXT_H
+#define __LINUX_TC_EM_TEXT_H
+
+#include <linux/pkt_cls.h>
+
+#define TC_EM_TEXT_ALGOSIZ 16
+
+struct tcf_em_text
+{
+ char algo[TC_EM_TEXT_ALGOSIZ];
+ __u16 from_offset;
+ __u16 to_offset;
+ __u16 pattern_len;
+ __u8 from_layer:4;
+ __u8 to_layer:4;
+ __u8 pad;
+};
+
+#endif
diff --git a/sysroot/usr/include/linux/tcp.h b/sysroot/usr/include/linux/tcp.h
new file mode 100644
index 0000000..dd2985e
--- /dev/null
+++ b/sysroot/usr/include/linux/tcp.h
@@ -0,0 +1,174 @@
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Definitions for the TCP protocol.
+ *
+ * Version: @(#)tcp.h 1.0.2 04/28/93
+ *
+ * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#ifndef _LINUX_TCP_H
+#define _LINUX_TCP_H
+
+#include <linux/types.h>
+#include <asm/byteorder.h>
+#include <linux/socket.h>
+
+struct tcphdr {
+ __be16 source;
+ __be16 dest;
+ __be32 seq;
+ __be32 ack_seq;
+#if defined(__LITTLE_ENDIAN_BITFIELD)
+ __u16 res1:4,
+ doff:4,
+ fin:1,
+ syn:1,
+ rst:1,
+ psh:1,
+ ack:1,
+ urg:1,
+ ece:1,
+ cwr:1;
+#elif defined(__BIG_ENDIAN_BITFIELD)
+ __u16 doff:4,
+ res1:4,
+ cwr:1,
+ ece:1,
+ urg:1,
+ ack:1,
+ psh:1,
+ rst:1,
+ syn:1,
+ fin:1;
+#else
+#error "Adjust your <asm/byteorder.h> defines"
+#endif
+ __be16 window;
+ __sum16 check;
+ __be16 urg_ptr;
+};
+
+/*
+ * The union cast uses a gcc extension to avoid aliasing problems
+ * (union is compatible to any of its members)
+ * This means this part of the code is -fstrict-aliasing safe now.
+ */
+union tcp_word_hdr {
+ struct tcphdr hdr;
+ __be32 words[5];
+};
+
+#define tcp_flag_word(tp) ( ((union tcp_word_hdr *)(tp))->words [3])
+
+enum {
+ TCP_FLAG_CWR = __constant_htonl(0x00800000),
+ TCP_FLAG_ECE = __constant_htonl(0x00400000),
+ TCP_FLAG_URG = __constant_htonl(0x00200000),
+ TCP_FLAG_ACK = __constant_htonl(0x00100000),
+ TCP_FLAG_PSH = __constant_htonl(0x00080000),
+ TCP_FLAG_RST = __constant_htonl(0x00040000),
+ TCP_FLAG_SYN = __constant_htonl(0x00020000),
+ TCP_FLAG_FIN = __constant_htonl(0x00010000),
+ TCP_RESERVED_BITS = __constant_htonl(0x0F000000),
+ TCP_DATA_OFFSET = __constant_htonl(0xF0000000)
+};
+
+/* TCP socket options */
+#define TCP_NODELAY 1 /* Turn off Nagle's algorithm. */
+#define TCP_MAXSEG 2 /* Limit MSS */
+#define TCP_CORK 3 /* Never send partially complete segments */
+#define TCP_KEEPIDLE 4 /* Start keeplives after this period */
+#define TCP_KEEPINTVL 5 /* Interval between keepalives */
+#define TCP_KEEPCNT 6 /* Number of keepalives before death */
+#define TCP_SYNCNT 7 /* Number of SYN retransmits */
+#define TCP_LINGER2 8 /* Life time of orphaned FIN-WAIT-2 state */
+#define TCP_DEFER_ACCEPT 9 /* Wake up listener only when data arrive */
+#define TCP_WINDOW_CLAMP 10 /* Bound advertised window */
+#define TCP_INFO 11 /* Information about this connection. */
+#define TCP_QUICKACK 12 /* Block/reenable quick acks */
+#define TCP_CONGESTION 13 /* Congestion control algorithm */
+#define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */
+
+#define TCPI_OPT_TIMESTAMPS 1
+#define TCPI_OPT_SACK 2
+#define TCPI_OPT_WSCALE 4
+#define TCPI_OPT_ECN 8
+
+enum tcp_ca_state
+{
+ TCP_CA_Open = 0,
+#define TCPF_CA_Open (1<<TCP_CA_Open)
+ TCP_CA_Disorder = 1,
+#define TCPF_CA_Disorder (1<<TCP_CA_Disorder)
+ TCP_CA_CWR = 2,
+#define TCPF_CA_CWR (1<<TCP_CA_CWR)
+ TCP_CA_Recovery = 3,
+#define TCPF_CA_Recovery (1<<TCP_CA_Recovery)
+ TCP_CA_Loss = 4
+#define TCPF_CA_Loss (1<<TCP_CA_Loss)
+};
+
+struct tcp_info
+{
+ __u8 tcpi_state;
+ __u8 tcpi_ca_state;
+ __u8 tcpi_retransmits;
+ __u8 tcpi_probes;
+ __u8 tcpi_backoff;
+ __u8 tcpi_options;
+ __u8 tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
+
+ __u32 tcpi_rto;
+ __u32 tcpi_ato;
+ __u32 tcpi_snd_mss;
+ __u32 tcpi_rcv_mss;
+
+ __u32 tcpi_unacked;
+ __u32 tcpi_sacked;
+ __u32 tcpi_lost;
+ __u32 tcpi_retrans;
+ __u32 tcpi_fackets;
+
+ /* Times. */
+ __u32 tcpi_last_data_sent;
+ __u32 tcpi_last_ack_sent; /* Not remembered, sorry. */
+ __u32 tcpi_last_data_recv;
+ __u32 tcpi_last_ack_recv;
+
+ /* Metrics. */
+ __u32 tcpi_pmtu;
+ __u32 tcpi_rcv_ssthresh;
+ __u32 tcpi_rtt;
+ __u32 tcpi_rttvar;
+ __u32 tcpi_snd_ssthresh;
+ __u32 tcpi_snd_cwnd;
+ __u32 tcpi_advmss;
+ __u32 tcpi_reordering;
+
+ __u32 tcpi_rcv_rtt;
+ __u32 tcpi_rcv_space;
+
+ __u32 tcpi_total_retrans;
+};
+
+/* for TCP_MD5SIG socket option */
+#define TCP_MD5SIG_MAXKEYLEN 80
+
+struct tcp_md5sig {
+ struct __kernel_sockaddr_storage tcpm_addr; /* address associated */
+ __u16 __tcpm_pad1; /* zero */
+ __u16 tcpm_keylen; /* key length */
+ __u32 __tcpm_pad2; /* zero */
+ __u8 tcpm_key[TCP_MD5SIG_MAXKEYLEN]; /* key (binary) */
+};
+
+
+#endif /* _LINUX_TCP_H */
diff --git a/sysroot/usr/include/linux/telephony.h b/sysroot/usr/include/linux/telephony.h
new file mode 100644
index 0000000..0d0cf2a
--- /dev/null
+++ b/sysroot/usr/include/linux/telephony.h
@@ -0,0 +1,266 @@
+/******************************************************************************
+ *
+ * telephony.h
+ *
+ * Basic Linux Telephony Interface
+ *
+ * (c) Copyright 1999-2001 Quicknet Technologies, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ * Authors: Ed Okerson, <eokerson@quicknet.net>
+ * Greg Herlein, <gherlein@quicknet.net>
+ *
+ * Contributors: Alan Cox, <alan@redhat.com>
+ * David W. Erhart, <derhart@quicknet.net>
+ *
+ * IN NO EVENT SHALL QUICKNET TECHNOLOGIES, INC. BE LIABLE TO ANY PARTY FOR
+ * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
+ * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF QUICKNET
+ * TECHNOLOGIES, INC. HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * QUICKNET TECHNOLOGIES, INC. SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
+ * ON AN "AS IS" BASIS, AND QUICKNET TECHNOLOGIES, INC. HAS NO OBLIGATION
+ * TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ *
+ * Version: $Revision: 4.2 $
+ *
+ * $Id: telephony.h,v 4.2 2001/08/06 07:09:43 craigs Exp $
+ *
+ *****************************************************************************/
+
+#ifndef TELEPHONY_H
+#define TELEPHONY_H
+
+#define TELEPHONY_VERSION 3013
+
+#define PHONE_VENDOR_IXJ 1
+#define PHONE_VENDOR_QUICKNET PHONE_VENDOR_IXJ
+#define PHONE_VENDOR_VOICETRONIX 2
+#define PHONE_VENDOR_ACULAB 3
+#define PHONE_VENDOR_DIGI 4
+#define PHONE_VENDOR_FRANKLIN 5
+
+/******************************************************************************
+ * Vendor Summary Information Area
+ *
+ * Quicknet Technologies, Inc. - makes low density analog telephony cards
+ * with audio compression, POTS and PSTN interfaces (www.quicknet.net)
+ *
+ * (other vendors following this API shuld add a short description of
+ * the telephony products they support under Linux)
+ *
+ *****************************************************************************/
+#define QTI_PHONEJACK 100
+#define QTI_LINEJACK 300
+#define QTI_PHONEJACK_LITE 400
+#define QTI_PHONEJACK_PCI 500
+#define QTI_PHONECARD 600
+
+/******************************************************************************
+*
+* The capabilities ioctls can inform you of the capabilities of each phone
+* device installed in your system. The PHONECTL_CAPABILITIES ioctl
+* returns an integer value indicating the number of capabilities the
+* device has. The PHONECTL_CAPABILITIES_LIST will fill an array of
+* capability structs with all of its capabilities. The
+* PHONECTL_CAPABILITIES_CHECK takes a single capability struct and returns
+* a TRUE if the device has that capability, otherwise it returns false.
+*
+******************************************************************************/
+typedef enum {
+ vendor = 0,
+ device,
+ port,
+ codec,
+ dsp
+} phone_cap;
+
+struct phone_capability {
+ char desc[80];
+ phone_cap captype;
+ int cap;
+ int handle;
+};
+
+typedef enum {
+ pots = 0,
+ pstn,
+ handset,
+ speaker
+} phone_ports;
+
+#define PHONE_CAPABILITIES _IO ('q', 0x80)
+#define PHONE_CAPABILITIES_LIST _IOR ('q', 0x81, struct phone_capability *)
+#define PHONE_CAPABILITIES_CHECK _IOW ('q', 0x82, struct phone_capability *)
+
+typedef struct {
+ char month[3];
+ char day[3];
+ char hour[3];
+ char min[3];
+ int numlen;
+ char number[11];
+ int namelen;
+ char name[80];
+} PHONE_CID;
+
+#define PHONE_RING _IO ('q', 0x83)
+#define PHONE_HOOKSTATE _IO ('q', 0x84)
+#define PHONE_MAXRINGS _IOW ('q', 0x85, char)
+#define PHONE_RING_CADENCE _IOW ('q', 0x86, short)
+#define OLD_PHONE_RING_START _IO ('q', 0x87)
+#define PHONE_RING_START _IOW ('q', 0x87, PHONE_CID *)
+#define PHONE_RING_STOP _IO ('q', 0x88)
+
+#define USA_RING_CADENCE 0xC0C0
+
+#define PHONE_REC_CODEC _IOW ('q', 0x89, int)
+#define PHONE_REC_START _IO ('q', 0x8A)
+#define PHONE_REC_STOP _IO ('q', 0x8B)
+#define PHONE_REC_DEPTH _IOW ('q', 0x8C, int)
+#define PHONE_FRAME _IOW ('q', 0x8D, int)
+#define PHONE_REC_VOLUME _IOW ('q', 0x8E, int)
+#define PHONE_REC_VOLUME_LINEAR _IOW ('q', 0xDB, int)
+#define PHONE_REC_LEVEL _IO ('q', 0x8F)
+
+#define PHONE_PLAY_CODEC _IOW ('q', 0x90, int)
+#define PHONE_PLAY_START _IO ('q', 0x91)
+#define PHONE_PLAY_STOP _IO ('q', 0x92)
+#define PHONE_PLAY_DEPTH _IOW ('q', 0x93, int)
+#define PHONE_PLAY_VOLUME _IOW ('q', 0x94, int)
+#define PHONE_PLAY_VOLUME_LINEAR _IOW ('q', 0xDC, int)
+#define PHONE_PLAY_LEVEL _IO ('q', 0x95)
+#define PHONE_DTMF_READY _IOR ('q', 0x96, int)
+#define PHONE_GET_DTMF _IOR ('q', 0x97, int)
+#define PHONE_GET_DTMF_ASCII _IOR ('q', 0x98, int)
+#define PHONE_DTMF_OOB _IOW ('q', 0x99, int)
+#define PHONE_EXCEPTION _IOR ('q', 0x9A, int)
+#define PHONE_PLAY_TONE _IOW ('q', 0x9B, char)
+#define PHONE_SET_TONE_ON_TIME _IOW ('q', 0x9C, int)
+#define PHONE_SET_TONE_OFF_TIME _IOW ('q', 0x9D, int)
+#define PHONE_GET_TONE_ON_TIME _IO ('q', 0x9E)
+#define PHONE_GET_TONE_OFF_TIME _IO ('q', 0x9F)
+#define PHONE_GET_TONE_STATE _IO ('q', 0xA0)
+#define PHONE_BUSY _IO ('q', 0xA1)
+#define PHONE_RINGBACK _IO ('q', 0xA2)
+#define PHONE_DIALTONE _IO ('q', 0xA3)
+#define PHONE_CPT_STOP _IO ('q', 0xA4)
+
+#define PHONE_PSTN_SET_STATE _IOW ('q', 0xA4, int)
+#define PHONE_PSTN_GET_STATE _IO ('q', 0xA5)
+
+#define PSTN_ON_HOOK 0
+#define PSTN_RINGING 1
+#define PSTN_OFF_HOOK 2
+#define PSTN_PULSE_DIAL 3
+
+/******************************************************************************
+*
+* The wink duration is tunable with this ioctl. The default wink duration
+* is 320ms. You do not need to use this ioctl if you do not require a
+* different wink duration.
+*
+******************************************************************************/
+#define PHONE_WINK_DURATION _IOW ('q', 0xA6, int)
+#define PHONE_WINK _IOW ('q', 0xAA, int)
+
+/******************************************************************************
+*
+* Codec Definitions
+*
+******************************************************************************/
+typedef enum {
+ G723_63 = 1,
+ G723_53 = 2,
+ TS85 = 3,
+ TS48 = 4,
+ TS41 = 5,
+ G728 = 6,
+ G729 = 7,
+ ULAW = 8,
+ ALAW = 9,
+ LINEAR16 = 10,
+ LINEAR8 = 11,
+ WSS = 12,
+ G729B = 13
+} phone_codec;
+
+struct phone_codec_data
+{
+ phone_codec type;
+ unsigned short buf_min, buf_opt, buf_max;
+};
+
+#define PHONE_QUERY_CODEC _IOWR ('q', 0xA7, struct phone_codec_data *)
+#define PHONE_PSTN_LINETEST _IO ('q', 0xA8)
+
+/******************************************************************************
+*
+* This controls the VAD/CNG functionality of G.723.1. The driver will
+* always pass full size frames, any unused bytes will be padded with zeros,
+* and frames passed to the driver should also be padded with zeros. The
+* frame type is encoded in the least significant two bits of the first
+* WORD of the frame as follows:
+*
+* bits 1-0 Frame Type Data Rate Significant Words
+* 00 0 G.723.1 6.3 12
+* 01 1 G.723.1 5.3 10
+* 10 2 VAD/CNG 2
+* 11 3 Repeat last CNG 2 bits
+*
+******************************************************************************/
+#define PHONE_VAD _IOW ('q', 0xA9, int)
+
+
+/******************************************************************************
+*
+* The exception structure allows us to multiplex multiple events onto the
+* select() exception set. If any of these flags are set select() will
+* return with a positive indication on the exception set. The dtmf_ready
+* bit indicates if there is data waiting in the DTMF buffer. The
+* hookstate bit is set if there is a change in hookstate status, it does not
+* indicate the current state of the hookswitch. The pstn_ring bit
+* indicates that the DAA on a LineJACK card has detected ring voltage on
+* the PSTN port. The caller_id bit indicates that caller_id data has been
+* received and is available. The pstn_wink bit indicates that the DAA on
+* the LineJACK has received a wink from the telco switch. The f0, f1, f2
+* and f3 bits indicate that the filter has been triggered by detecting the
+* frequency programmed into that filter.
+*
+* The remaining bits should be set to zero. They will become defined over time
+* for other interface cards and their needs.
+*
+******************************************************************************/
+struct phone_except
+{
+ unsigned int dtmf_ready:1;
+ unsigned int hookstate:1;
+ unsigned int pstn_ring:1;
+ unsigned int caller_id:1;
+ unsigned int pstn_wink:1;
+ unsigned int f0:1;
+ unsigned int f1:1;
+ unsigned int f2:1;
+ unsigned int f3:1;
+ unsigned int flash:1;
+ unsigned int fc0:1;
+ unsigned int fc1:1;
+ unsigned int fc2:1;
+ unsigned int fc3:1;
+ unsigned int reserved:18;
+};
+
+union telephony_exception {
+ struct phone_except bits;
+ unsigned int bytes;
+};
+
+
+#endif /* TELEPHONY_H */
+
diff --git a/sysroot/usr/include/linux/termios.h b/sysroot/usr/include/linux/termios.h
new file mode 100644
index 0000000..4786628
--- /dev/null
+++ b/sysroot/usr/include/linux/termios.h
@@ -0,0 +1,7 @@
+#ifndef _LINUX_TERMIOS_H
+#define _LINUX_TERMIOS_H
+
+#include <linux/types.h>
+#include <asm/termios.h>
+
+#endif
diff --git a/sysroot/usr/include/linux/time.h b/sysroot/usr/include/linux/time.h
new file mode 100644
index 0000000..d4f5523
--- /dev/null
+++ b/sysroot/usr/include/linux/time.h
@@ -0,0 +1,73 @@
+#ifndef _LINUX_TIME_H
+#define _LINUX_TIME_H
+
+#include <linux/types.h>
+
+
+#ifndef _STRUCT_TIMESPEC
+#define _STRUCT_TIMESPEC
+struct timespec {
+ time_t tv_sec; /* seconds */
+ long tv_nsec; /* nanoseconds */
+};
+#endif
+
+struct timeval {
+ time_t tv_sec; /* seconds */
+ suseconds_t tv_usec; /* microseconds */
+};
+
+struct timezone {
+ int tz_minuteswest; /* minutes west of Greenwich */
+ int tz_dsttime; /* type of dst correction */
+};
+
+
+#define NFDBITS __NFDBITS
+
+#define FD_SETSIZE __FD_SETSIZE
+#define FD_SET(fd,fdsetp) __FD_SET(fd,fdsetp)
+#define FD_CLR(fd,fdsetp) __FD_CLR(fd,fdsetp)
+#define FD_ISSET(fd,fdsetp) __FD_ISSET(fd,fdsetp)
+#define FD_ZERO(fdsetp) __FD_ZERO(fdsetp)
+
+/*
+ * Names of the interval timers, and structure
+ * defining a timer setting:
+ */
+#define ITIMER_REAL 0
+#define ITIMER_VIRTUAL 1
+#define ITIMER_PROF 2
+
+struct itimerspec {
+ struct timespec it_interval; /* timer period */
+ struct timespec it_value; /* timer expiration */
+};
+
+struct itimerval {
+ struct timeval it_interval; /* timer interval */
+ struct timeval it_value; /* current value */
+};
+
+/*
+ * The IDs of the various system clocks (for POSIX.1b interval timers):
+ */
+#define CLOCK_REALTIME 0
+#define CLOCK_MONOTONIC 1
+#define CLOCK_PROCESS_CPUTIME_ID 2
+#define CLOCK_THREAD_CPUTIME_ID 3
+
+/*
+ * The IDs of various hardware clocks:
+ */
+#define CLOCK_SGI_CYCLE 10
+#define MAX_CLOCKS 16
+#define CLOCKS_MASK (CLOCK_REALTIME | CLOCK_MONOTONIC)
+#define CLOCKS_MONO CLOCK_MONOTONIC
+
+/*
+ * The various flags for setting POSIX.1b interval timers:
+ */
+#define TIMER_ABSTIME 0x01
+
+#endif
diff --git a/sysroot/usr/include/linux/times.h b/sysroot/usr/include/linux/times.h
new file mode 100644
index 0000000..e2d3020
--- /dev/null
+++ b/sysroot/usr/include/linux/times.h
@@ -0,0 +1,13 @@
+#ifndef _LINUX_TIMES_H
+#define _LINUX_TIMES_H
+
+#include <linux/types.h>
+
+struct tms {
+ clock_t tms_utime;
+ clock_t tms_stime;
+ clock_t tms_cutime;
+ clock_t tms_cstime;
+};
+
+#endif
diff --git a/sysroot/usr/include/linux/timex.h b/sysroot/usr/include/linux/timex.h
new file mode 100644
index 0000000..4034fef
--- /dev/null
+++ b/sysroot/usr/include/linux/timex.h
@@ -0,0 +1,187 @@
+/*****************************************************************************
+ * *
+ * Copyright (c) David L. Mills 1993 *
+ * *
+ * Permission to use, copy, modify, and distribute this software and its *
+ * documentation for any purpose and without fee is hereby granted, provided *
+ * that the above copyright notice appears in all copies and that both the *
+ * copyright notice and this permission notice appear in supporting *
+ * documentation, and that the name University of Delaware not be used in *
+ * advertising or publicity pertaining to distribution of the software *
+ * without specific, written prior permission. The University of Delaware *
+ * makes no representations about the suitability this software for any *
+ * purpose. It is provided "as is" without express or implied warranty. *
+ * *
+ *****************************************************************************/
+
+/*
+ * Modification history timex.h
+ *
+ * 29 Dec 97 Russell King
+ * Moved CLOCK_TICK_RATE, CLOCK_TICK_FACTOR and FINETUNE to asm/timex.h
+ * for ARM machines
+ *
+ * 9 Jan 97 Adrian Sun
+ * Shifted LATCH define to allow access to alpha machines.
+ *
+ * 26 Sep 94 David L. Mills
+ * Added defines for hybrid phase/frequency-lock loop.
+ *
+ * 19 Mar 94 David L. Mills
+ * Moved defines from kernel routines to header file and added new
+ * defines for PPS phase-lock loop.
+ *
+ * 20 Feb 94 David L. Mills
+ * Revised status codes and structures for external clock and PPS
+ * signal discipline.
+ *
+ * 28 Nov 93 David L. Mills
+ * Adjusted parameters to improve stability and increase poll
+ * interval.
+ *
+ * 17 Sep 93 David L. Mills
+ * Created file $NTP/include/sys/timex.h
+ * 07 Oct 93 Torsten Duwe
+ * Derived linux/timex.h
+ * 1995-08-13 Torsten Duwe
+ * kernel PLL updated to 1994-12-13 specs (rfc-1589)
+ * 1997-08-30 Ulrich Windl
+ * Added new constant NTP_PHASE_LIMIT
+ * 2004-08-12 Christoph Lameter
+ * Reworked time interpolation logic
+ */
+#ifndef _LINUX_TIMEX_H
+#define _LINUX_TIMEX_H
+
+#include <linux/time.h>
+
+#include <asm/param.h>
+
+/*
+ * SHIFT_KG and SHIFT_KF establish the damping of the PLL and are chosen
+ * for a slightly underdamped convergence characteristic. SHIFT_KH
+ * establishes the damping of the FLL and is chosen by wisdom and black
+ * art.
+ *
+ * MAXTC establishes the maximum time constant of the PLL. With the
+ * SHIFT_KG and SHIFT_KF values given and a time constant range from
+ * zero to MAXTC, the PLL will converge in 15 minutes to 16 hours,
+ * respectively.
+ */
+#define SHIFT_PLL 4 /* PLL frequency factor (shift) */
+#define SHIFT_FLL 2 /* FLL frequency factor (shift) */
+#define MAXTC 10 /* maximum time constant (shift) */
+
+/*
+ * The SHIFT_UPDATE define establishes the decimal point of the
+ * time_offset variable which represents the current offset with
+ * respect to standard time.
+ *
+ * SHIFT_USEC defines the scaling (shift) of the time_freq and
+ * time_tolerance variables, which represent the current frequency
+ * offset and maximum frequency tolerance.
+ */
+#define SHIFT_UPDATE (SHIFT_HZ + 1) /* time offset scale (shift) */
+#define SHIFT_USEC 16 /* frequency offset scale (shift) */
+#define SHIFT_NSEC 12 /* kernel frequency offset scale */
+
+#define MAXPHASE 512000L /* max phase error (us) */
+#define MAXFREQ (512L << SHIFT_USEC) /* max frequency error (ppm) */
+#define MAXFREQ_NSEC (512000L << SHIFT_NSEC) /* max frequency error (ppb) */
+#define MINSEC 256 /* min interval between updates (s) */
+#define MAXSEC 2048 /* max interval between updates (s) */
+#define NTP_PHASE_LIMIT (MAXPHASE << 5) /* beyond max. dispersion */
+
+/*
+ * syscall interface - used (mainly by NTP daemon)
+ * to discipline kernel clock oscillator
+ */
+struct timex {
+ unsigned int modes; /* mode selector */
+ long offset; /* time offset (usec) */
+ long freq; /* frequency offset (scaled ppm) */
+ long maxerror; /* maximum error (usec) */
+ long esterror; /* estimated error (usec) */
+ int status; /* clock command/status */
+ long constant; /* pll time constant */
+ long precision; /* clock precision (usec) (read only) */
+ long tolerance; /* clock frequency tolerance (ppm)
+ * (read only)
+ */
+ struct timeval time; /* (read only) */
+ long tick; /* (modified) usecs between clock ticks */
+
+ long ppsfreq; /* pps frequency (scaled ppm) (ro) */
+ long jitter; /* pps jitter (us) (ro) */
+ int shift; /* interval duration (s) (shift) (ro) */
+ long stabil; /* pps stability (scaled ppm) (ro) */
+ long jitcnt; /* jitter limit exceeded (ro) */
+ long calcnt; /* calibration intervals (ro) */
+ long errcnt; /* calibration errors (ro) */
+ long stbcnt; /* stability limit exceeded (ro) */
+
+ int :32; int :32; int :32; int :32;
+ int :32; int :32; int :32; int :32;
+ int :32; int :32; int :32; int :32;
+};
+
+/*
+ * Mode codes (timex.mode)
+ */
+#define ADJ_OFFSET 0x0001 /* time offset */
+#define ADJ_FREQUENCY 0x0002 /* frequency offset */
+#define ADJ_MAXERROR 0x0004 /* maximum time error */
+#define ADJ_ESTERROR 0x0008 /* estimated time error */
+#define ADJ_STATUS 0x0010 /* clock status */
+#define ADJ_TIMECONST 0x0020 /* pll time constant */
+#define ADJ_TICK 0x4000 /* tick value */
+#define ADJ_OFFSET_SINGLESHOT 0x8001 /* old-fashioned adjtime */
+#define ADJ_OFFSET_SS_READ 0xa001 /* read-only adjtime */
+
+/* xntp 3.4 compatibility names */
+#define MOD_OFFSET ADJ_OFFSET
+#define MOD_FREQUENCY ADJ_FREQUENCY
+#define MOD_MAXERROR ADJ_MAXERROR
+#define MOD_ESTERROR ADJ_ESTERROR
+#define MOD_STATUS ADJ_STATUS
+#define MOD_TIMECONST ADJ_TIMECONST
+#define MOD_CLKB ADJ_TICK
+#define MOD_CLKA ADJ_OFFSET_SINGLESHOT /* 0x8000 in original */
+
+
+/*
+ * Status codes (timex.status)
+ */
+#define STA_PLL 0x0001 /* enable PLL updates (rw) */
+#define STA_PPSFREQ 0x0002 /* enable PPS freq discipline (rw) */
+#define STA_PPSTIME 0x0004 /* enable PPS time discipline (rw) */
+#define STA_FLL 0x0008 /* select frequency-lock mode (rw) */
+
+#define STA_INS 0x0010 /* insert leap (rw) */
+#define STA_DEL 0x0020 /* delete leap (rw) */
+#define STA_UNSYNC 0x0040 /* clock unsynchronized (rw) */
+#define STA_FREQHOLD 0x0080 /* hold frequency (rw) */
+
+#define STA_PPSSIGNAL 0x0100 /* PPS signal present (ro) */
+#define STA_PPSJITTER 0x0200 /* PPS signal jitter exceeded (ro) */
+#define STA_PPSWANDER 0x0400 /* PPS signal wander exceeded (ro) */
+#define STA_PPSERROR 0x0800 /* PPS signal calibration error (ro) */
+
+#define STA_CLOCKERR 0x1000 /* clock hardware fault (ro) */
+
+#define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \
+ STA_PPSERROR | STA_CLOCKERR) /* read-only bits */
+
+/*
+ * Clock states (time_state)
+ */
+#define TIME_OK 0 /* clock synchronized, no leap second */
+#define TIME_INS 1 /* insert leap second */
+#define TIME_DEL 2 /* delete leap second */
+#define TIME_OOP 3 /* leap second in progress */
+#define TIME_WAIT 4 /* leap second has occurred */
+#define TIME_ERROR 5 /* clock not synchronized */
+#define TIME_BAD TIME_ERROR /* bw compat */
+
+
+#endif /* LINUX_TIMEX_H */
diff --git a/sysroot/usr/include/linux/tiocl.h b/sysroot/usr/include/linux/tiocl.h
new file mode 100644
index 0000000..4756862
--- /dev/null
+++ b/sysroot/usr/include/linux/tiocl.h
@@ -0,0 +1,39 @@
+#ifndef _LINUX_TIOCL_H
+#define _LINUX_TIOCL_H
+
+#define TIOCL_SETSEL 2 /* set a selection */
+#define TIOCL_SELCHAR 0 /* select characters */
+#define TIOCL_SELWORD 1 /* select whole words */
+#define TIOCL_SELLINE 2 /* select whole lines */
+#define TIOCL_SELPOINTER 3 /* show the pointer */
+#define TIOCL_SELCLEAR 4 /* clear visibility of selection */
+#define TIOCL_SELMOUSEREPORT 16 /* report beginning of selection */
+#define TIOCL_SELBUTTONMASK 15 /* button mask for report */
+/* selection extent */
+struct tiocl_selection {
+ unsigned short xs; /* X start */
+ unsigned short ys; /* Y start */
+ unsigned short xe; /* X end */
+ unsigned short ye; /* Y end */
+ unsigned short sel_mode; /* selection mode */
+};
+
+#define TIOCL_PASTESEL 3 /* paste previous selection */
+#define TIOCL_UNBLANKSCREEN 4 /* unblank screen */
+
+#define TIOCL_SELLOADLUT 5
+ /* set characters to be considered alphabetic when selecting */
+ /* u32[8] bit array, 4 bytes-aligned with type */
+
+/* these two don't return a value: they write it back in the type */
+#define TIOCL_GETSHIFTSTATE 6 /* write shift state */
+#define TIOCL_GETMOUSEREPORTING 7 /* write whether mouse event are reported */
+#define TIOCL_SETVESABLANK 10 /* set vesa blanking mode */
+#define TIOCL_SETKMSGREDIRECT 11 /* restrict kernel messages to a vt */
+#define TIOCL_GETFGCONSOLE 12 /* get foreground vt */
+#define TIOCL_SCROLLCONSOLE 13 /* scroll console */
+#define TIOCL_BLANKSCREEN 14 /* keep screen blank even if a key is pressed */
+#define TIOCL_BLANKEDSCREEN 15 /* return which vt was blanked */
+#define TIOCL_GETKMSGREDIRECT 17 /* get the vt the kernel messages are restricted to */
+
+#endif /* _LINUX_TIOCL_H */
diff --git a/sysroot/usr/include/linux/tipc.h b/sysroot/usr/include/linux/tipc.h
new file mode 100644
index 0000000..3ef026d
--- /dev/null
+++ b/sysroot/usr/include/linux/tipc.h
@@ -0,0 +1,213 @@
+/*
+ * include/linux/tipc.h: Include file for TIPC socket interface
+ *
+ * Copyright (c) 2003-2006, Ericsson AB
+ * Copyright (c) 2005, Wind River Systems
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _LINUX_TIPC_H_
+#define _LINUX_TIPC_H_
+
+#include <linux/types.h>
+
+/*
+ * TIPC addressing primitives
+ */
+
+struct tipc_portid {
+ __u32 ref;
+ __u32 node;
+};
+
+struct tipc_name {
+ __u32 type;
+ __u32 instance;
+};
+
+struct tipc_name_seq {
+ __u32 type;
+ __u32 lower;
+ __u32 upper;
+};
+
+static __inline__ __u32 tipc_addr(unsigned int zone,
+ unsigned int cluster,
+ unsigned int node)
+{
+ return (zone << 24) | (cluster << 12) | node;
+}
+
+static __inline__ unsigned int tipc_zone(__u32 addr)
+{
+ return addr >> 24;
+}
+
+static __inline__ unsigned int tipc_cluster(__u32 addr)
+{
+ return (addr >> 12) & 0xfff;
+}
+
+static __inline__ unsigned int tipc_node(__u32 addr)
+{
+ return addr & 0xfff;
+}
+
+/*
+ * Application-accessible port name types
+ */
+
+#define TIPC_CFG_SRV 0 /* configuration service name type */
+#define TIPC_TOP_SRV 1 /* topology service name type */
+#define TIPC_RESERVED_TYPES 64 /* lowest user-publishable name type */
+
+/*
+ * Publication scopes when binding port names and port name sequences
+ */
+
+#define TIPC_ZONE_SCOPE 1
+#define TIPC_CLUSTER_SCOPE 2
+#define TIPC_NODE_SCOPE 3
+
+/*
+ * Limiting values for messages
+ */
+
+#define TIPC_MAX_USER_MSG_SIZE 66000
+
+/*
+ * Message importance levels
+ */
+
+#define TIPC_LOW_IMPORTANCE 0 /* default */
+#define TIPC_MEDIUM_IMPORTANCE 1
+#define TIPC_HIGH_IMPORTANCE 2
+#define TIPC_CRITICAL_IMPORTANCE 3
+
+/*
+ * Msg rejection/connection shutdown reasons
+ */
+
+#define TIPC_OK 0
+#define TIPC_ERR_NO_NAME 1
+#define TIPC_ERR_NO_PORT 2
+#define TIPC_ERR_NO_NODE 3
+#define TIPC_ERR_OVERLOAD 4
+#define TIPC_CONN_SHUTDOWN 5
+
+/*
+ * TIPC topology subscription service definitions
+ */
+
+#define TIPC_SUB_PORTS 0x01 /* filter for port availability */
+#define TIPC_SUB_SERVICE 0x02 /* filter for service availability */
+#define TIPC_SUB_CANCEL 0x04 /* cancel a subscription */
+#if 0
+/* The following filter options are not currently implemented */
+#define TIPC_SUB_NO_BIND_EVTS 0x04 /* filter out "publish" events */
+#define TIPC_SUB_NO_UNBIND_EVTS 0x08 /* filter out "withdraw" events */
+#define TIPC_SUB_SINGLE_EVT 0x10 /* expire after first event */
+#endif
+
+#define TIPC_WAIT_FOREVER ~0 /* timeout for permanent subscription */
+
+struct tipc_subscr {
+ struct tipc_name_seq seq; /* name sequence of interest */
+ __u32 timeout; /* subscription duration (in ms) */
+ __u32 filter; /* bitmask of filter options */
+ char usr_handle[8]; /* available for subscriber use */
+};
+
+#define TIPC_PUBLISHED 1 /* publication event */
+#define TIPC_WITHDRAWN 2 /* withdraw event */
+#define TIPC_SUBSCR_TIMEOUT 3 /* subscription timeout event */
+
+struct tipc_event {
+ __u32 event; /* event type */
+ __u32 found_lower; /* matching name seq instances */
+ __u32 found_upper; /* " " " " */
+ struct tipc_portid port; /* associated port */
+ struct tipc_subscr s; /* associated subscription */
+};
+
+/*
+ * Socket API
+ */
+
+#ifndef AF_TIPC
+#define AF_TIPC 30
+#endif
+
+#ifndef PF_TIPC
+#define PF_TIPC AF_TIPC
+#endif
+
+#ifndef SOL_TIPC
+#define SOL_TIPC 271
+#endif
+
+#define TIPC_ADDR_NAMESEQ 1
+#define TIPC_ADDR_MCAST 1
+#define TIPC_ADDR_NAME 2
+#define TIPC_ADDR_ID 3
+
+struct sockaddr_tipc {
+ unsigned short family;
+ unsigned char addrtype;
+ signed char scope;
+ union {
+ struct tipc_portid id;
+ struct tipc_name_seq nameseq;
+ struct {
+ struct tipc_name name;
+ __u32 domain; /* 0: own zone */
+ } name;
+ } addr;
+};
+
+/*
+ * Ancillary data objects supported by recvmsg()
+ */
+
+#define TIPC_ERRINFO 1 /* error info */
+#define TIPC_RETDATA 2 /* returned data */
+#define TIPC_DESTNAME 3 /* destination name */
+
+/*
+ * TIPC-specific socket option values
+ */
+
+#define TIPC_IMPORTANCE 127 /* Default: TIPC_LOW_IMPORTANCE */
+#define TIPC_SRC_DROPPABLE 128 /* Default: 0 (resend congested msg) */
+#define TIPC_DEST_DROPPABLE 129 /* Default: based on socket type */
+#define TIPC_CONN_TIMEOUT 130 /* Default: 8000 (ms) */
+
+#endif
diff --git a/sysroot/usr/include/linux/tipc_config.h b/sysroot/usr/include/linux/tipc_config.h
new file mode 100644
index 0000000..938ce68
--- /dev/null
+++ b/sysroot/usr/include/linux/tipc_config.h
@@ -0,0 +1,410 @@
+/*
+ * include/linux/tipc_config.h: Include file for TIPC configuration interface
+ *
+ * Copyright (c) 2003-2006, Ericsson AB
+ * Copyright (c) 2005, Wind River Systems
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _LINUX_TIPC_CONFIG_H_
+#define _LINUX_TIPC_CONFIG_H_
+
+#include <linux/types.h>
+#include <linux/string.h>
+#include <asm/byteorder.h>
+
+/*
+ * Configuration
+ *
+ * All configuration management messaging involves sending a request message
+ * to the TIPC configuration service on a node, which sends a reply message
+ * back. (In the future multi-message replies may be supported.)
+ *
+ * Both request and reply messages consist of a transport header and payload.
+ * The transport header contains info about the desired operation;
+ * the payload consists of zero or more type/length/value (TLV) items
+ * which specify parameters or results for the operation.
+ *
+ * For many operations, the request and reply messages have a fixed number
+ * of TLVs (usually zero or one); however, some reply messages may return
+ * a variable number of TLVs. A failed request is denoted by the presence
+ * of an "error string" TLV in the reply message instead of the TLV(s) the
+ * reply should contain if the request succeeds.
+ */
+
+/*
+ * Public commands:
+ * May be issued by any process.
+ * Accepted by own node, or by remote node only if remote management enabled.
+ */
+
+#define TIPC_CMD_NOOP 0x0000 /* tx none, rx none */
+#define TIPC_CMD_GET_NODES 0x0001 /* tx net_addr, rx node_info(s) */
+#define TIPC_CMD_GET_MEDIA_NAMES 0x0002 /* tx none, rx media_name(s) */
+#define TIPC_CMD_GET_BEARER_NAMES 0x0003 /* tx none, rx bearer_name(s) */
+#define TIPC_CMD_GET_LINKS 0x0004 /* tx net_addr, rx link_info(s) */
+#define TIPC_CMD_SHOW_NAME_TABLE 0x0005 /* tx name_tbl_query, rx ultra_string */
+#define TIPC_CMD_SHOW_PORTS 0x0006 /* tx none, rx ultra_string */
+#define TIPC_CMD_SHOW_LINK_STATS 0x000B /* tx link_name, rx ultra_string */
+
+#if 0
+#define TIPC_CMD_SHOW_PORT_STATS 0x0008 /* tx port_ref, rx ultra_string */
+#define TIPC_CMD_RESET_PORT_STATS 0x0009 /* tx port_ref, rx none */
+#define TIPC_CMD_GET_ROUTES 0x000A /* tx ?, rx ? */
+#define TIPC_CMD_GET_LINK_PEER 0x000D /* tx link_name, rx ? */
+#endif
+
+/*
+ * Protected commands:
+ * May only be issued by "network administration capable" process.
+ * Accepted by own node, or by remote node only if remote management enabled
+ * and this node is zone manager.
+ */
+
+#define TIPC_CMD_GET_REMOTE_MNG 0x4003 /* tx none, rx unsigned */
+#define TIPC_CMD_GET_MAX_PORTS 0x4004 /* tx none, rx unsigned */
+#define TIPC_CMD_GET_MAX_PUBL 0x4005 /* tx none, rx unsigned */
+#define TIPC_CMD_GET_MAX_SUBSCR 0x4006 /* tx none, rx unsigned */
+#define TIPC_CMD_GET_MAX_ZONES 0x4007 /* tx none, rx unsigned */
+#define TIPC_CMD_GET_MAX_CLUSTERS 0x4008 /* tx none, rx unsigned */
+#define TIPC_CMD_GET_MAX_NODES 0x4009 /* tx none, rx unsigned */
+#define TIPC_CMD_GET_MAX_SLAVES 0x400A /* tx none, rx unsigned */
+#define TIPC_CMD_GET_NETID 0x400B /* tx none, rx unsigned */
+
+#define TIPC_CMD_ENABLE_BEARER 0x4101 /* tx bearer_config, rx none */
+#define TIPC_CMD_DISABLE_BEARER 0x4102 /* tx bearer_name, rx none */
+#define TIPC_CMD_SET_LINK_TOL 0x4107 /* tx link_config, rx none */
+#define TIPC_CMD_SET_LINK_PRI 0x4108 /* tx link_config, rx none */
+#define TIPC_CMD_SET_LINK_WINDOW 0x4109 /* tx link_config, rx none */
+#define TIPC_CMD_SET_LOG_SIZE 0x410A /* tx unsigned, rx none */
+#define TIPC_CMD_DUMP_LOG 0x410B /* tx none, rx ultra_string */
+#define TIPC_CMD_RESET_LINK_STATS 0x410C /* tx link_name, rx none */
+
+#if 0
+#define TIPC_CMD_CREATE_LINK 0x4103 /* tx link_create, rx none */
+#define TIPC_CMD_REMOVE_LINK 0x4104 /* tx link_name, rx none */
+#define TIPC_CMD_BLOCK_LINK 0x4105 /* tx link_name, rx none */
+#define TIPC_CMD_UNBLOCK_LINK 0x4106 /* tx link_name, rx none */
+#endif
+
+/*
+ * Private commands:
+ * May only be issued by "network administration capable" process.
+ * Accepted by own node only; cannot be used on a remote node.
+ */
+
+#define TIPC_CMD_SET_NODE_ADDR 0x8001 /* tx net_addr, rx none */
+#if 0
+#define TIPC_CMD_SET_ZONE_MASTER 0x8002 /* tx none, rx none */
+#endif
+#define TIPC_CMD_SET_REMOTE_MNG 0x8003 /* tx unsigned, rx none */
+#define TIPC_CMD_SET_MAX_PORTS 0x8004 /* tx unsigned, rx none */
+#define TIPC_CMD_SET_MAX_PUBL 0x8005 /* tx unsigned, rx none */
+#define TIPC_CMD_SET_MAX_SUBSCR 0x8006 /* tx unsigned, rx none */
+#define TIPC_CMD_SET_MAX_ZONES 0x8007 /* tx unsigned, rx none */
+#define TIPC_CMD_SET_MAX_CLUSTERS 0x8008 /* tx unsigned, rx none */
+#define TIPC_CMD_SET_MAX_NODES 0x8009 /* tx unsigned, rx none */
+#define TIPC_CMD_SET_MAX_SLAVES 0x800A /* tx unsigned, rx none */
+#define TIPC_CMD_SET_NETID 0x800B /* tx unsigned, rx none */
+
+/*
+ * TLV types defined for TIPC
+ */
+
+#define TIPC_TLV_NONE 0 /* no TLV present */
+#define TIPC_TLV_VOID 1 /* empty TLV (0 data bytes)*/
+#define TIPC_TLV_UNSIGNED 2 /* 32-bit integer */
+#define TIPC_TLV_STRING 3 /* char[128] (max) */
+#define TIPC_TLV_LARGE_STRING 4 /* char[2048] (max) */
+#define TIPC_TLV_ULTRA_STRING 5 /* char[32768] (max) */
+
+#define TIPC_TLV_ERROR_STRING 16 /* char[128] containing "error code" */
+#define TIPC_TLV_NET_ADDR 17 /* 32-bit integer denoting <Z.C.N> */
+#define TIPC_TLV_MEDIA_NAME 18 /* char[TIPC_MAX_MEDIA_NAME] */
+#define TIPC_TLV_BEARER_NAME 19 /* char[TIPC_MAX_BEARER_NAME] */
+#define TIPC_TLV_LINK_NAME 20 /* char[TIPC_MAX_LINK_NAME] */
+#define TIPC_TLV_NODE_INFO 21 /* struct tipc_node_info */
+#define TIPC_TLV_LINK_INFO 22 /* struct tipc_link_info */
+#define TIPC_TLV_BEARER_CONFIG 23 /* struct tipc_bearer_config */
+#define TIPC_TLV_LINK_CONFIG 24 /* struct tipc_link_config */
+#define TIPC_TLV_NAME_TBL_QUERY 25 /* struct tipc_name_table_query */
+#define TIPC_TLV_PORT_REF 26 /* 32-bit port reference */
+
+/*
+ * Maximum sizes of TIPC bearer-related names (including terminating NUL)
+ */
+
+#define TIPC_MAX_MEDIA_NAME 16 /* format = media */
+#define TIPC_MAX_IF_NAME 16 /* format = interface */
+#define TIPC_MAX_BEARER_NAME 32 /* format = media:interface */
+#define TIPC_MAX_LINK_NAME 60 /* format = Z.C.N:interface-Z.C.N:interface */
+
+/*
+ * Link priority limits (min, default, max, media default)
+ */
+
+#define TIPC_MIN_LINK_PRI 0
+#define TIPC_DEF_LINK_PRI 10
+#define TIPC_MAX_LINK_PRI 31
+#define TIPC_MEDIA_LINK_PRI (TIPC_MAX_LINK_PRI + 1)
+
+/*
+ * Link tolerance limits (min, default, max), in ms
+ */
+
+#define TIPC_MIN_LINK_TOL 50
+#define TIPC_DEF_LINK_TOL 1500
+#define TIPC_MAX_LINK_TOL 30000
+
+/*
+ * Link window limits (min, default, max), in packets
+ */
+
+#define TIPC_MIN_LINK_WIN 16
+#define TIPC_DEF_LINK_WIN 50
+#define TIPC_MAX_LINK_WIN 150
+
+
+struct tipc_node_info {
+ __be32 addr; /* network address of node */
+ __be32 up; /* 0=down, 1= up */
+};
+
+struct tipc_link_info {
+ __be32 dest; /* network address of peer node */
+ __be32 up; /* 0=down, 1=up */
+ char str[TIPC_MAX_LINK_NAME]; /* link name */
+};
+
+struct tipc_bearer_config {
+ __be32 priority; /* Range [1,31]. Override per link */
+ __be32 detect_scope;
+ char name[TIPC_MAX_BEARER_NAME];
+};
+
+struct tipc_link_config {
+ __be32 value;
+ char name[TIPC_MAX_LINK_NAME];
+};
+
+#define TIPC_NTQ_ALLTYPES 0x80000000
+
+struct tipc_name_table_query {
+ __be32 depth; /* 1:type, 2:+name info, 3:+port info, 4+:+debug info */
+ __be32 type; /* {t,l,u} info ignored if high bit of "depth" is set */
+ __be32 lowbound; /* (i.e. displays all entries of name table) */
+ __be32 upbound;
+};
+
+/*
+ * The error string TLV is a null-terminated string describing the cause
+ * of the request failure. To simplify error processing (and to save space)
+ * the first character of the string can be a special error code character
+ * (lying by the range 0x80 to 0xFF) which represents a pre-defined reason.
+ */
+
+#define TIPC_CFG_TLV_ERROR "\x80" /* request contains incorrect TLV(s) */
+#define TIPC_CFG_NOT_NET_ADMIN "\x81" /* must be network administrator */
+#define TIPC_CFG_NOT_ZONE_MSTR "\x82" /* must be zone master */
+#define TIPC_CFG_NO_REMOTE "\x83" /* remote management not enabled */
+#define TIPC_CFG_NOT_SUPPORTED "\x84" /* request is not supported by TIPC */
+#define TIPC_CFG_INVALID_VALUE "\x85" /* request has invalid argument value */
+
+#if 0
+/* prototypes TLV structures for proposed commands */
+struct tipc_link_create {
+ __u32 domain;
+ struct tipc_media_addr peer_addr;
+ char bearer_name[TIPC_MAX_BEARER_NAME];
+};
+
+struct tipc_route_info {
+ __u32 dest;
+ __u32 router;
+};
+#endif
+
+/*
+ * A TLV consists of a descriptor, followed by the TLV value.
+ * TLV descriptor fields are stored in network byte order;
+ * TLV values must also be stored in network byte order (where applicable).
+ * TLV descriptors must be aligned to addresses which are multiple of 4,
+ * so up to 3 bytes of padding may exist at the end of the TLV value area.
+ * There must not be any padding between the TLV descriptor and its value.
+ */
+
+struct tlv_desc {
+ __be16 tlv_len; /* TLV length (descriptor + value) */
+ __be16 tlv_type; /* TLV identifier */
+};
+
+#define TLV_ALIGNTO 4
+
+#define TLV_ALIGN(datalen) (((datalen)+(TLV_ALIGNTO-1)) & ~(TLV_ALIGNTO-1))
+#define TLV_LENGTH(datalen) (sizeof(struct tlv_desc) + (datalen))
+#define TLV_SPACE(datalen) (TLV_ALIGN(TLV_LENGTH(datalen)))
+#define TLV_DATA(tlv) ((void *)((char *)(tlv) + TLV_LENGTH(0)))
+
+static __inline__ int TLV_OK(const void *tlv, __u16 space)
+{
+ /*
+ * Would also like to check that "tlv" is a multiple of 4,
+ * but don't know how to do this in a portable way.
+ * - Tried doing (!(tlv & (TLV_ALIGNTO-1))), but GCC compiler
+ * won't allow binary "&" with a pointer.
+ * - Tried casting "tlv" to integer type, but causes warning about size
+ * mismatch when pointer is bigger than chosen type (int, long, ...).
+ */
+
+ return (space >= TLV_SPACE(0)) &&
+ (ntohs(((struct tlv_desc *)tlv)->tlv_len) <= space);
+}
+
+static __inline__ int TLV_CHECK(const void *tlv, __u16 space, __u16 exp_type)
+{
+ return TLV_OK(tlv, space) &&
+ (ntohs(((struct tlv_desc *)tlv)->tlv_type) == exp_type);
+}
+
+static __inline__ int TLV_SET(void *tlv, __u16 type, void *data, __u16 len)
+{
+ struct tlv_desc *tlv_ptr;
+ int tlv_len;
+
+ tlv_len = TLV_LENGTH(len);
+ tlv_ptr = (struct tlv_desc *)tlv;
+ tlv_ptr->tlv_type = htons(type);
+ tlv_ptr->tlv_len = htons(tlv_len);
+ if (len && data)
+ memcpy(TLV_DATA(tlv_ptr), data, tlv_len);
+ return TLV_SPACE(len);
+}
+
+/*
+ * A TLV list descriptor simplifies processing of messages
+ * containing multiple TLVs.
+ */
+
+struct tlv_list_desc {
+ struct tlv_desc *tlv_ptr; /* ptr to current TLV */
+ __u32 tlv_space; /* # bytes from curr TLV to list end */
+};
+
+static __inline__ void TLV_LIST_INIT(struct tlv_list_desc *list,
+ void *data, __u32 space)
+{
+ list->tlv_ptr = (struct tlv_desc *)data;
+ list->tlv_space = space;
+}
+
+static __inline__ int TLV_LIST_EMPTY(struct tlv_list_desc *list)
+{
+ return (list->tlv_space == 0);
+}
+
+static __inline__ int TLV_LIST_CHECK(struct tlv_list_desc *list, __u16 exp_type)
+{
+ return TLV_CHECK(list->tlv_ptr, list->tlv_space, exp_type);
+}
+
+static __inline__ void *TLV_LIST_DATA(struct tlv_list_desc *list)
+{
+ return TLV_DATA(list->tlv_ptr);
+}
+
+static __inline__ void TLV_LIST_STEP(struct tlv_list_desc *list)
+{
+ __u16 tlv_space = TLV_ALIGN(ntohs(list->tlv_ptr->tlv_len));
+
+ list->tlv_ptr = (struct tlv_desc *)((char *)list->tlv_ptr + tlv_space);
+ list->tlv_space -= tlv_space;
+}
+
+/*
+ * Configuration messages exchanged via NETLINK_GENERIC use the following
+ * family id, name, version and command.
+ */
+#define TIPC_GENL_NAME "TIPC"
+#define TIPC_GENL_VERSION 0x1
+#define TIPC_GENL_CMD 0x1
+
+/*
+ * TIPC specific header used in NETLINK_GENERIC requests.
+ */
+struct tipc_genlmsghdr {
+ __u32 dest; /* Destination address */
+ __u16 cmd; /* Command */
+ __u16 reserved; /* Unused */
+};
+
+#define TIPC_GENL_HDRLEN NLMSG_ALIGN(sizeof(struct tipc_genlmsghdr))
+
+/*
+ * Configuration messages exchanged via TIPC sockets use the TIPC configuration
+ * message header, which is defined below. This structure is analogous
+ * to the Netlink message header, but fields are stored in network byte order
+ * and no padding is permitted between the header and the message data
+ * that follows.
+ */
+
+struct tipc_cfg_msg_hdr
+{
+ __be32 tcm_len; /* Message length (including header) */
+ __be16 tcm_type; /* Command type */
+ __be16 tcm_flags; /* Additional flags */
+ char tcm_reserved[8]; /* Unused */
+};
+
+#define TCM_F_REQUEST 0x1 /* Flag: Request message */
+#define TCM_F_MORE 0x2 /* Flag: Message to be continued */
+
+#define TCM_ALIGN(datalen) (((datalen)+3) & ~3)
+#define TCM_LENGTH(datalen) (sizeof(struct tipc_cfg_msg_hdr) + datalen)
+#define TCM_SPACE(datalen) (TCM_ALIGN(TCM_LENGTH(datalen)))
+#define TCM_DATA(tcm_hdr) ((void *)((char *)(tcm_hdr) + TCM_LENGTH(0)))
+
+static __inline__ int TCM_SET(void *msg, __u16 cmd, __u16 flags,
+ void *data, __u16 data_len)
+{
+ struct tipc_cfg_msg_hdr *tcm_hdr;
+ int msg_len;
+
+ msg_len = TCM_LENGTH(data_len);
+ tcm_hdr = (struct tipc_cfg_msg_hdr *)msg;
+ tcm_hdr->tcm_len = htonl(msg_len);
+ tcm_hdr->tcm_type = htons(cmd);
+ tcm_hdr->tcm_flags = htons(flags);
+ if (data_len && data)
+ memcpy(TCM_DATA(msg), data, data_len);
+ return TCM_SPACE(data_len);
+}
+
+#endif
diff --git a/sysroot/usr/include/linux/toshiba.h b/sysroot/usr/include/linux/toshiba.h
new file mode 100644
index 0000000..6a7c4ed
--- /dev/null
+++ b/sysroot/usr/include/linux/toshiba.h
@@ -0,0 +1,38 @@
+/* toshiba.h -- Linux driver for accessing the SMM on Toshiba laptops
+ *
+ * Copyright (c) 1996-2000 Jonathan A. Buzzard (jonathan@buzzard.org.uk)
+ *
+ * Thanks to Juergen Heinzl <juergen@monocerus.demon.co.uk> for the pointers
+ * on making sure the structure is aligned and packed.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef _LINUX_TOSHIBA_H
+#define _LINUX_TOSHIBA_H
+
+#define TOSH_PROC "/proc/toshiba"
+#define TOSH_DEVICE "/dev/toshiba"
+#define TOSH_SMM _IOWR('t', 0x90, int) /* broken: meant 24 bytes */
+
+typedef struct {
+ unsigned int eax;
+ unsigned int ebx __attribute__ ((packed));
+ unsigned int ecx __attribute__ ((packed));
+ unsigned int edx __attribute__ ((packed));
+ unsigned int esi __attribute__ ((packed));
+ unsigned int edi __attribute__ ((packed));
+} SMMRegisters;
+
+int tosh_smm(SMMRegisters *regs);
+
+#endif
diff --git a/sysroot/usr/include/linux/tty.h b/sysroot/usr/include/linux/tty.h
new file mode 100644
index 0000000..98996ba
--- /dev/null
+++ b/sysroot/usr/include/linux/tty.h
@@ -0,0 +1,8 @@
+#ifndef _LINUX_TTY_H
+#define _LINUX_TTY_H
+
+/*
+ * 'tty.h' defines some structures used by tty_io.c and some defines.
+ */
+
+#endif
diff --git a/sysroot/usr/include/linux/types.h b/sysroot/usr/include/linux/types.h
new file mode 100644
index 0000000..22cfdc0
--- /dev/null
+++ b/sysroot/usr/include/linux/types.h
@@ -0,0 +1,172 @@
+#ifndef _LINUX_TYPES_H
+#define _LINUX_TYPES_H
+
+
+#include <linux/posix_types.h>
+#include <asm/types.h>
+
+#ifndef __KERNEL_STRICT_NAMES
+
+typedef __u32 __kernel_dev_t;
+
+typedef __kernel_fd_set fd_set;
+typedef __kernel_dev_t dev_t;
+typedef __kernel_ino_t ino_t;
+typedef __kernel_mode_t mode_t;
+typedef __kernel_nlink_t nlink_t;
+typedef __kernel_off_t off_t;
+typedef __kernel_pid_t pid_t;
+typedef __kernel_daddr_t daddr_t;
+typedef __kernel_key_t key_t;
+typedef __kernel_suseconds_t suseconds_t;
+typedef __kernel_timer_t timer_t;
+typedef __kernel_clockid_t clockid_t;
+typedef __kernel_mqd_t mqd_t;
+
+typedef __kernel_uid_t uid_t;
+typedef __kernel_gid_t gid_t;
+
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+typedef __kernel_loff_t loff_t;
+#endif
+
+/*
+ * The following typedefs are also protected by individual ifdefs for
+ * historical reasons:
+ */
+#ifndef _SIZE_T
+#define _SIZE_T
+typedef __kernel_size_t size_t;
+#endif
+
+#ifndef _SSIZE_T
+#define _SSIZE_T
+typedef __kernel_ssize_t ssize_t;
+#endif
+
+#ifndef _PTRDIFF_T
+#define _PTRDIFF_T
+typedef __kernel_ptrdiff_t ptrdiff_t;
+#endif
+
+#ifndef _TIME_T
+#define _TIME_T
+typedef __kernel_time_t time_t;
+#endif
+
+#ifndef _CLOCK_T
+#define _CLOCK_T
+typedef __kernel_clock_t clock_t;
+#endif
+
+#ifndef _CADDR_T
+#define _CADDR_T
+typedef __kernel_caddr_t caddr_t;
+#endif
+
+/* bsd */
+typedef unsigned char u_char;
+typedef unsigned short u_short;
+typedef unsigned int u_int;
+typedef unsigned long u_long;
+
+/* sysv */
+typedef unsigned char unchar;
+typedef unsigned short ushort;
+typedef unsigned int uint;
+typedef unsigned long ulong;
+
+#ifndef __BIT_TYPES_DEFINED__
+#define __BIT_TYPES_DEFINED__
+
+typedef __u8 u_int8_t;
+typedef __s8 int8_t;
+typedef __u16 u_int16_t;
+typedef __s16 int16_t;
+typedef __u32 u_int32_t;
+typedef __s32 int32_t;
+
+#endif /* !(__BIT_TYPES_DEFINED__) */
+
+typedef __u8 uint8_t;
+typedef __u16 uint16_t;
+typedef __u32 uint32_t;
+
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+typedef __u64 uint64_t;
+typedef __u64 u_int64_t;
+typedef __s64 int64_t;
+#endif
+
+/* this is a special 64bit data type that is 8-byte aligned */
+#define aligned_u64 unsigned long long __attribute__((aligned(8)))
+#define aligned_be64 __be64 __attribute__((aligned(8)))
+#define aligned_le64 __le64 __attribute__((aligned(8)))
+
+/**
+ * The type used for indexing onto a disc or disc partition.
+ *
+ * Linux always considers sectors to be 512 bytes long independently
+ * of the devices real block size.
+ */
+#ifdef CONFIG_LBD
+typedef u64 sector_t;
+#else
+typedef unsigned long sector_t;
+#endif
+
+/*
+ * The type of the inode's block count.
+ */
+#ifdef CONFIG_LSF
+typedef u64 blkcnt_t;
+#else
+typedef unsigned long blkcnt_t;
+#endif
+
+/*
+ * The type of an index into the pagecache. Use a #define so asm/types.h
+ * can override it.
+ */
+#ifndef pgoff_t
+#define pgoff_t unsigned long
+#endif
+
+#endif /* __KERNEL_STRICT_NAMES */
+
+/*
+ * Below are truly Linux-specific types that should never collide with
+ * any application/library that wants linux/types.h.
+ */
+
+#ifdef __CHECKER__
+#define __bitwise__ __attribute__((bitwise))
+#else
+#define __bitwise__
+#endif
+#ifdef __CHECK_ENDIAN__
+#define __bitwise __bitwise__
+#else
+#define __bitwise
+#endif
+
+typedef __u16 __bitwise __le16;
+typedef __u16 __bitwise __be16;
+typedef __u32 __bitwise __le32;
+typedef __u32 __bitwise __be32;
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+typedef __u64 __bitwise __le64;
+typedef __u64 __bitwise __be64;
+#endif
+typedef __u16 __bitwise __sum16;
+typedef __u32 __bitwise __wsum;
+
+
+struct ustat {
+ __kernel_daddr_t f_tfree;
+ __kernel_ino_t f_tinode;
+ char f_fname[6];
+ char f_fpack[6];
+};
+
+#endif /* _LINUX_TYPES_H */
diff --git a/sysroot/usr/include/linux/udf_fs_i.h b/sysroot/usr/include/linux/udf_fs_i.h
new file mode 100644
index 0000000..d4d84c5
--- /dev/null
+++ b/sysroot/usr/include/linux/udf_fs_i.h
@@ -0,0 +1,24 @@
+/*
+ * udf_fs_i.h
+ *
+ * This file is intended for the Linux kernel/module.
+ *
+ * COPYRIGHT
+ * This file is distributed under the terms of the GNU General Public
+ * License (GPL). Copies of the GPL can be obtained from:
+ * ftp://prep.ai.mit.edu/pub/gnu/GPL
+ * Each contributing author retains all rights to their own work.
+ */
+
+#ifndef _UDF_FS_I_H
+#define _UDF_FS_I_H 1
+
+
+/* exported IOCTLs, we have 'l', 0x40-0x7f */
+
+#define UDF_GETEASIZE _IOR('l', 0x40, int)
+#define UDF_GETEABLOCK _IOR('l', 0x41, void *)
+#define UDF_GETVOLIDENT _IOR('l', 0x42, void *)
+#define UDF_RELOCATE_BLOCKS _IOWR('l', 0x43, long)
+
+#endif /* _UDF_FS_I_H */
diff --git a/sysroot/usr/include/linux/udp.h b/sysroot/usr/include/linux/udp.h
new file mode 100644
index 0000000..9efa149
--- /dev/null
+++ b/sysroot/usr/include/linux/udp.h
@@ -0,0 +1,40 @@
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Definitions for the UDP protocol.
+ *
+ * Version: @(#)udp.h 1.0.2 04/28/93
+ *
+ * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#ifndef _LINUX_UDP_H
+#define _LINUX_UDP_H
+
+#include <linux/types.h>
+
+struct udphdr {
+ __be16 source;
+ __be16 dest;
+ __be16 len;
+ __sum16 check;
+};
+
+
+/* UDP socket options */
+#define UDP_CORK 1 /* Never send partially complete segments */
+#define UDP_ENCAP 100 /* Set the socket to accept encapsulated packets */
+
+/* UDP encapsulation types */
+#define UDP_ENCAP_ESPINUDP_NON_IKE 1 /* draft-ietf-ipsec-nat-t-ike-00/01 */
+#define UDP_ENCAP_ESPINUDP 2 /* draft-ietf-ipsec-udp-encaps-06 */
+#define UDP_ENCAP_L2TPINUDP 3 /* rfc2661 */
+
+
+#endif /* _LINUX_UDP_H */
diff --git a/sysroot/usr/include/linux/ufs_fs.h b/sysroot/usr/include/linux/ufs_fs.h
new file mode 100644
index 0000000..0f3f17c
--- /dev/null
+++ b/sysroot/usr/include/linux/ufs_fs.h
@@ -0,0 +1,946 @@
+/*
+ * linux/include/linux/ufs_fs.h
+ *
+ * Copyright (C) 1996
+ * Adrian Rodriguez (adrian@franklins-tower.rutgers.edu)
+ * Laboratory for Computer Science Research Computing Facility
+ * Rutgers, The State University of New Jersey
+ *
+ * Clean swab support by Fare <fare@tunes.org>
+ * just hope no one is using NNUUXXI on __?64 structure elements
+ * 64-bit clean thanks to Maciej W. Rozycki <macro@ds2.pg.gda.pl>
+ *
+ * 4.4BSD (FreeBSD) support added on February 1st 1998 by
+ * Niels Kristian Bech Jensen <nkbj@image.dk> partially based
+ * on code by Martin von Loewis <martin@mira.isdn.cs.tu-berlin.de>.
+ *
+ * NeXTstep support added on February 5th 1998 by
+ * Niels Kristian Bech Jensen <nkbj@image.dk>.
+ *
+ * Write support by Daniel Pirkl <daniel.pirkl@email.cz>
+ *
+ * HP/UX hfs filesystem support added by
+ * Martin K. Petersen <mkp@mkp.net>, August 1999
+ *
+ * UFS2 (of FreeBSD 5.x) support added by
+ * Niraj Kumar <niraj17@iitbombay.org> , Jan 2004
+ *
+ */
+
+#ifndef __LINUX_UFS_FS_H
+#define __LINUX_UFS_FS_H
+
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/stat.h>
+#include <linux/fs.h>
+
+typedef __u64 __fs64;
+typedef __u32 __fs32;
+typedef __u16 __fs16;
+
+#define UFS_BBLOCK 0
+#define UFS_BBSIZE 8192
+#define UFS_SBLOCK 8192
+#define UFS_SBSIZE 8192
+
+#define UFS_SECTOR_SIZE 512
+#define UFS_SECTOR_BITS 9
+#define UFS_MAGIC 0x00011954
+#define UFS2_MAGIC 0x19540119
+#define UFS_CIGAM 0x54190100 /* byteswapped MAGIC */
+
+/* Copied from FreeBSD */
+/*
+ * Each disk drive contains some number of filesystems.
+ * A filesystem consists of a number of cylinder groups.
+ * Each cylinder group has inodes and data.
+ *
+ * A filesystem is described by its super-block, which in turn
+ * describes the cylinder groups. The super-block is critical
+ * data and is replicated in each cylinder group to protect against
+ * catastrophic loss. This is done at `newfs' time and the critical
+ * super-block data does not change, so the copies need not be
+ * referenced further unless disaster strikes.
+ *
+ * For filesystem fs, the offsets of the various blocks of interest
+ * are given in the super block as:
+ * [fs->fs_sblkno] Super-block
+ * [fs->fs_cblkno] Cylinder group block
+ * [fs->fs_iblkno] Inode blocks
+ * [fs->fs_dblkno] Data blocks
+ * The beginning of cylinder group cg in fs, is given by
+ * the ``cgbase(fs, cg)'' macro.
+ *
+ * Depending on the architecture and the media, the superblock may
+ * reside in any one of four places. For tiny media where every block
+ * counts, it is placed at the very front of the partition. Historically,
+ * UFS1 placed it 8K from the front to leave room for the disk label and
+ * a small bootstrap. For UFS2 it got moved to 64K from the front to leave
+ * room for the disk label and a bigger bootstrap, and for really piggy
+ * systems we check at 256K from the front if the first three fail. In
+ * all cases the size of the superblock will be SBLOCKSIZE. All values are
+ * given in byte-offset form, so they do not imply a sector size. The
+ * SBLOCKSEARCH specifies the order in which the locations should be searched.
+ */
+#define SBLOCK_FLOPPY 0
+#define SBLOCK_UFS1 8192
+#define SBLOCK_UFS2 65536
+#define SBLOCK_PIGGY 262144
+#define SBLOCKSIZE 8192
+#define SBLOCKSEARCH \
+ { SBLOCK_UFS2, SBLOCK_UFS1, SBLOCK_FLOPPY, SBLOCK_PIGGY, -1 }
+
+
+/* HP specific MAGIC values */
+
+#define UFS_MAGIC_LFN 0x00095014 /* fs supports filenames > 14 chars */
+#define UFS_CIGAM_LFN 0x14500900 /* srahc 41 < semanelif stroppus sf */
+
+#define UFS_MAGIC_SEC 0x00612195 /* B1 security fs */
+#define UFS_CIGAM_SEC 0x95216100
+
+#define UFS_MAGIC_FEA 0x00195612 /* fs_featurebits supported */
+#define UFS_CIGAM_FEA 0x12561900
+
+#define UFS_MAGIC_4GB 0x05231994 /* fs > 4 GB && fs_featurebits */
+#define UFS_CIGAM_4GB 0x94192305
+
+/* Seems somebody at HP goofed here. B1 and lfs are both 0x2 !?! */
+#define UFS_FSF_LFN 0x00000001 /* long file names */
+#define UFS_FSF_B1 0x00000002 /* B1 security */
+#define UFS_FSF_LFS 0x00000002 /* large files */
+#define UFS_FSF_LUID 0x00000004 /* large UIDs */
+
+/* End of HP stuff */
+
+
+#define UFS_BSIZE 8192
+#define UFS_MINBSIZE 4096
+#define UFS_FSIZE 1024
+#define UFS_MAXFRAG (UFS_BSIZE / UFS_FSIZE)
+
+#define UFS_NDADDR 12
+#define UFS_NINDIR 3
+
+#define UFS_IND_BLOCK (UFS_NDADDR + 0)
+#define UFS_DIND_BLOCK (UFS_NDADDR + 1)
+#define UFS_TIND_BLOCK (UFS_NDADDR + 2)
+
+#define UFS_NDIR_FRAGMENT (UFS_NDADDR << uspi->s_fpbshift)
+#define UFS_IND_FRAGMENT (UFS_IND_BLOCK << uspi->s_fpbshift)
+#define UFS_DIND_FRAGMENT (UFS_DIND_BLOCK << uspi->s_fpbshift)
+#define UFS_TIND_FRAGMENT (UFS_TIND_BLOCK << uspi->s_fpbshift)
+
+#define UFS_ROOTINO 2
+#define UFS_FIRST_INO (UFS_ROOTINO + 1)
+
+#define UFS_USEEFT ((__u16)65535)
+
+#define UFS_FSOK 0x7c269d38
+#define UFS_FSACTIVE ((__s8)0x00)
+#define UFS_FSCLEAN ((__s8)0x01)
+#define UFS_FSSTABLE ((__s8)0x02)
+#define UFS_FSOSF1 ((__s8)0x03) /* is this correct for DEC OSF/1? */
+#define UFS_FSBAD ((__s8)0xff)
+
+/* From here to next blank line, s_flags for ufs_sb_info */
+/* directory entry encoding */
+#define UFS_DE_MASK 0x00000010 /* mask for the following */
+#define UFS_DE_OLD 0x00000000
+#define UFS_DE_44BSD 0x00000010
+/* uid encoding */
+#define UFS_UID_MASK 0x00000060 /* mask for the following */
+#define UFS_UID_OLD 0x00000000
+#define UFS_UID_44BSD 0x00000020
+#define UFS_UID_EFT 0x00000040
+/* superblock state encoding */
+#define UFS_ST_MASK 0x00000700 /* mask for the following */
+#define UFS_ST_OLD 0x00000000
+#define UFS_ST_44BSD 0x00000100
+#define UFS_ST_SUN 0x00000200 /* Solaris */
+#define UFS_ST_SUNOS 0x00000300
+#define UFS_ST_SUNx86 0x00000400 /* Solaris x86 */
+/*cylinder group encoding */
+#define UFS_CG_MASK 0x00003000 /* mask for the following */
+#define UFS_CG_OLD 0x00000000
+#define UFS_CG_44BSD 0x00002000
+#define UFS_CG_SUN 0x00001000
+/* filesystem type encoding */
+#define UFS_TYPE_MASK 0x00010000 /* mask for the following */
+#define UFS_TYPE_UFS1 0x00000000
+#define UFS_TYPE_UFS2 0x00010000
+
+
+/* fs_inodefmt options */
+#define UFS_42INODEFMT -1
+#define UFS_44INODEFMT 2
+
+/*
+ * MINFREE gives the minimum acceptable percentage of file system
+ * blocks which may be free. If the freelist drops below this level
+ * only the superuser may continue to allocate blocks. This may
+ * be set to 0 if no reserve of free blocks is deemed necessary,
+ * however throughput drops by fifty percent if the file system
+ * is run at between 95% and 100% full; thus the minimum default
+ * value of fs_minfree is 5%. However, to get good clustering
+ * performance, 10% is a better choice. hence we use 10% as our
+ * default value. With 10% free space, fragmentation is not a
+ * problem, so we choose to optimize for time.
+ */
+#define UFS_MINFREE 5
+#define UFS_DEFAULTOPT UFS_OPTTIME
+
+/*
+ * Turn file system block numbers into disk block addresses.
+ * This maps file system blocks to device size blocks.
+ */
+#define ufs_fsbtodb(uspi, b) ((b) << (uspi)->s_fsbtodb)
+#define ufs_dbtofsb(uspi, b) ((b) >> (uspi)->s_fsbtodb)
+
+/*
+ * Cylinder group macros to locate things in cylinder groups.
+ * They calc file system addresses of cylinder group data structures.
+ */
+#define ufs_cgbase(c) (uspi->s_fpg * (c))
+#define ufs_cgstart(c) ((uspi)->fs_magic == UFS2_MAGIC ? ufs_cgbase(c) : \
+ (ufs_cgbase(c) + uspi->s_cgoffset * ((c) & ~uspi->s_cgmask)))
+#define ufs_cgsblock(c) (ufs_cgstart(c) + uspi->s_sblkno) /* super blk */
+#define ufs_cgcmin(c) (ufs_cgstart(c) + uspi->s_cblkno) /* cg block */
+#define ufs_cgimin(c) (ufs_cgstart(c) + uspi->s_iblkno) /* inode blk */
+#define ufs_cgdmin(c) (ufs_cgstart(c) + uspi->s_dblkno) /* 1st data */
+
+/*
+ * Macros for handling inode numbers:
+ * inode number to file system block offset.
+ * inode number to cylinder group number.
+ * inode number to file system block address.
+ */
+#define ufs_inotocg(x) ((x) / uspi->s_ipg)
+#define ufs_inotocgoff(x) ((x) % uspi->s_ipg)
+#define ufs_inotofsba(x) (((u64)ufs_cgimin(ufs_inotocg(x))) + ufs_inotocgoff(x) / uspi->s_inopf)
+#define ufs_inotofsbo(x) ((x) % uspi->s_inopf)
+
+/*
+ * Compute the cylinder and rotational position of a cyl block addr.
+ */
+#define ufs_cbtocylno(bno) \
+ ((bno) * uspi->s_nspf / uspi->s_spc)
+#define ufs_cbtorpos(bno) \
+ ((((bno) * uspi->s_nspf % uspi->s_spc / uspi->s_nsect \
+ * uspi->s_trackskew + (bno) * uspi->s_nspf % uspi->s_spc \
+ % uspi->s_nsect * uspi->s_interleave) % uspi->s_nsect \
+ * uspi->s_nrpos) / uspi->s_npsect)
+
+/*
+ * The following macros optimize certain frequently calculated
+ * quantities by using shifts and masks in place of divisions
+ * modulos and multiplications.
+ */
+#define ufs_blkoff(loc) ((loc) & uspi->s_qbmask)
+#define ufs_fragoff(loc) ((loc) & uspi->s_qfmask)
+#define ufs_lblktosize(blk) ((blk) << uspi->s_bshift)
+#define ufs_lblkno(loc) ((loc) >> uspi->s_bshift)
+#define ufs_numfrags(loc) ((loc) >> uspi->s_fshift)
+#define ufs_blkroundup(size) (((size) + uspi->s_qbmask) & uspi->s_bmask)
+#define ufs_fragroundup(size) (((size) + uspi->s_qfmask) & uspi->s_fmask)
+#define ufs_fragstoblks(frags) ((frags) >> uspi->s_fpbshift)
+#define ufs_blkstofrags(blks) ((blks) << uspi->s_fpbshift)
+#define ufs_fragnum(fsb) ((fsb) & uspi->s_fpbmask)
+#define ufs_blknum(fsb) ((fsb) & ~uspi->s_fpbmask)
+
+#define UFS_MAXNAMLEN 255
+#define UFS_MAXMNTLEN 512
+#define UFS2_MAXMNTLEN 468
+#define UFS2_MAXVOLLEN 32
+#define UFS_MAXCSBUFS 31
+#define UFS_LINK_MAX 32000
+/*
+#define UFS2_NOCSPTRS ((128 / sizeof(void *)) - 4)
+*/
+#define UFS2_NOCSPTRS 28
+
+/*
+ * UFS_DIR_PAD defines the directory entries boundaries
+ * (must be a multiple of 4)
+ */
+#define UFS_DIR_PAD 4
+#define UFS_DIR_ROUND (UFS_DIR_PAD - 1)
+#define UFS_DIR_REC_LEN(name_len) (((name_len) + 1 + 8 + UFS_DIR_ROUND) & ~UFS_DIR_ROUND)
+
+struct ufs_timeval {
+ __fs32 tv_sec;
+ __fs32 tv_usec;
+};
+
+struct ufs_dir_entry {
+ __fs32 d_ino; /* inode number of this entry */
+ __fs16 d_reclen; /* length of this entry */
+ union {
+ __fs16 d_namlen; /* actual length of d_name */
+ struct {
+ __u8 d_type; /* file type */
+ __u8 d_namlen; /* length of string in d_name */
+ } d_44;
+ } d_u;
+ __u8 d_name[UFS_MAXNAMLEN + 1]; /* file name */
+};
+
+struct ufs_csum {
+ __fs32 cs_ndir; /* number of directories */
+ __fs32 cs_nbfree; /* number of free blocks */
+ __fs32 cs_nifree; /* number of free inodes */
+ __fs32 cs_nffree; /* number of free frags */
+};
+struct ufs2_csum_total {
+ __fs64 cs_ndir; /* number of directories */
+ __fs64 cs_nbfree; /* number of free blocks */
+ __fs64 cs_nifree; /* number of free inodes */
+ __fs64 cs_nffree; /* number of free frags */
+ __fs64 cs_numclusters; /* number of free clusters */
+ __fs64 cs_spare[3]; /* future expansion */
+};
+
+struct ufs_csum_core {
+ __u64 cs_ndir; /* number of directories */
+ __u64 cs_nbfree; /* number of free blocks */
+ __u64 cs_nifree; /* number of free inodes */
+ __u64 cs_nffree; /* number of free frags */
+ __u64 cs_numclusters; /* number of free clusters */
+};
+
+/*
+ * File system flags
+ */
+#define UFS_UNCLEAN 0x01 /* file system not clean at mount (unused) */
+#define UFS_DOSOFTDEP 0x02 /* file system using soft dependencies */
+#define UFS_NEEDSFSCK 0x04 /* needs sync fsck (FreeBSD compat, unused) */
+#define UFS_INDEXDIRS 0x08 /* kernel supports indexed directories */
+#define UFS_ACLS 0x10 /* file system has ACLs enabled */
+#define UFS_MULTILABEL 0x20 /* file system is MAC multi-label */
+#define UFS_FLAGS_UPDATED 0x80 /* flags have been moved to new location */
+
+#if 0
+/*
+ * This is the actual superblock, as it is laid out on the disk.
+ * Do NOT use this structure, because of sizeof(ufs_super_block) > 512 and
+ * it may occupy several blocks, use
+ * struct ufs_super_block_(first,second,third) instead.
+ */
+struct ufs_super_block {
+ union {
+ struct {
+ __fs32 fs_link; /* UNUSED */
+ } fs_42;
+ struct {
+ __fs32 fs_state; /* file system state flag */
+ } fs_sun;
+ } fs_u0;
+ __fs32 fs_rlink; /* UNUSED */
+ __fs32 fs_sblkno; /* addr of super-block in filesys */
+ __fs32 fs_cblkno; /* offset of cyl-block in filesys */
+ __fs32 fs_iblkno; /* offset of inode-blocks in filesys */
+ __fs32 fs_dblkno; /* offset of first data after cg */
+ __fs32 fs_cgoffset; /* cylinder group offset in cylinder */
+ __fs32 fs_cgmask; /* used to calc mod fs_ntrak */
+ __fs32 fs_time; /* last time written -- time_t */
+ __fs32 fs_size; /* number of blocks in fs */
+ __fs32 fs_dsize; /* number of data blocks in fs */
+ __fs32 fs_ncg; /* number of cylinder groups */
+ __fs32 fs_bsize; /* size of basic blocks in fs */
+ __fs32 fs_fsize; /* size of frag blocks in fs */
+ __fs32 fs_frag; /* number of frags in a block in fs */
+/* these are configuration parameters */
+ __fs32 fs_minfree; /* minimum percentage of free blocks */
+ __fs32 fs_rotdelay; /* num of ms for optimal next block */
+ __fs32 fs_rps; /* disk revolutions per second */
+/* these fields can be computed from the others */
+ __fs32 fs_bmask; /* ``blkoff'' calc of blk offsets */
+ __fs32 fs_fmask; /* ``fragoff'' calc of frag offsets */
+ __fs32 fs_bshift; /* ``lblkno'' calc of logical blkno */
+ __fs32 fs_fshift; /* ``numfrags'' calc number of frags */
+/* these are configuration parameters */
+ __fs32 fs_maxcontig; /* max number of contiguous blks */
+ __fs32 fs_maxbpg; /* max number of blks per cyl group */
+/* these fields can be computed from the others */
+ __fs32 fs_fragshift; /* block to frag shift */
+ __fs32 fs_fsbtodb; /* fsbtodb and dbtofsb shift constant */
+ __fs32 fs_sbsize; /* actual size of super block */
+ __fs32 fs_csmask; /* csum block offset */
+ __fs32 fs_csshift; /* csum block number */
+ __fs32 fs_nindir; /* value of NINDIR */
+ __fs32 fs_inopb; /* value of INOPB */
+ __fs32 fs_nspf; /* value of NSPF */
+/* yet another configuration parameter */
+ __fs32 fs_optim; /* optimization preference, see below */
+/* these fields are derived from the hardware */
+ union {
+ struct {
+ __fs32 fs_npsect; /* # sectors/track including spares */
+ } fs_sun;
+ struct {
+ __fs32 fs_state; /* file system state time stamp */
+ } fs_sunx86;
+ } fs_u1;
+ __fs32 fs_interleave; /* hardware sector interleave */
+ __fs32 fs_trackskew; /* sector 0 skew, per track */
+/* a unique id for this filesystem (currently unused and unmaintained) */
+/* In 4.3 Tahoe this space is used by fs_headswitch and fs_trkseek */
+/* Neither of those fields is used in the Tahoe code right now but */
+/* there could be problems if they are. */
+ __fs32 fs_id[2]; /* file system id */
+/* sizes determined by number of cylinder groups and their sizes */
+ __fs32 fs_csaddr; /* blk addr of cyl grp summary area */
+ __fs32 fs_cssize; /* size of cyl grp summary area */
+ __fs32 fs_cgsize; /* cylinder group size */
+/* these fields are derived from the hardware */
+ __fs32 fs_ntrak; /* tracks per cylinder */
+ __fs32 fs_nsect; /* sectors per track */
+ __fs32 fs_spc; /* sectors per cylinder */
+/* this comes from the disk driver partitioning */
+ __fs32 fs_ncyl; /* cylinders in file system */
+/* these fields can be computed from the others */
+ __fs32 fs_cpg; /* cylinders per group */
+ __fs32 fs_ipg; /* inodes per cylinder group */
+ __fs32 fs_fpg; /* blocks per group * fs_frag */
+/* this data must be re-computed after crashes */
+ struct ufs_csum fs_cstotal; /* cylinder summary information */
+/* these fields are cleared at mount time */
+ __s8 fs_fmod; /* super block modified flag */
+ __s8 fs_clean; /* file system is clean flag */
+ __s8 fs_ronly; /* mounted read-only flag */
+ __s8 fs_flags;
+ union {
+ struct {
+ __s8 fs_fsmnt[UFS_MAXMNTLEN];/* name mounted on */
+ __fs32 fs_cgrotor; /* last cg searched */
+ __fs32 fs_csp[UFS_MAXCSBUFS];/*list of fs_cs info buffers */
+ __fs32 fs_maxcluster;
+ __fs32 fs_cpc; /* cyl per cycle in postbl */
+ __fs16 fs_opostbl[16][8]; /* old rotation block list head */
+ } fs_u1;
+ struct {
+ __s8 fs_fsmnt[UFS2_MAXMNTLEN]; /* name mounted on */
+ __u8 fs_volname[UFS2_MAXVOLLEN]; /* volume name */
+ __fs64 fs_swuid; /* system-wide uid */
+ __fs32 fs_pad; /* due to alignment of fs_swuid */
+ __fs32 fs_cgrotor; /* last cg searched */
+ __fs32 fs_ocsp[UFS2_NOCSPTRS]; /*list of fs_cs info buffers */
+ __fs32 fs_contigdirs;/*# of contiguously allocated dirs */
+ __fs32 fs_csp; /* cg summary info buffer for fs_cs */
+ __fs32 fs_maxcluster;
+ __fs32 fs_active;/* used by snapshots to track fs */
+ __fs32 fs_old_cpc; /* cyl per cycle in postbl */
+ __fs32 fs_maxbsize;/*maximum blocking factor permitted */
+ __fs64 fs_sparecon64[17];/*old rotation block list head */
+ __fs64 fs_sblockloc; /* byte offset of standard superblock */
+ struct ufs2_csum_total fs_cstotal;/*cylinder summary information*/
+ struct ufs_timeval fs_time; /* last time written */
+ __fs64 fs_size; /* number of blocks in fs */
+ __fs64 fs_dsize; /* number of data blocks in fs */
+ __fs64 fs_csaddr; /* blk addr of cyl grp summary area */
+ __fs64 fs_pendingblocks;/* blocks in process of being freed */
+ __fs32 fs_pendinginodes;/*inodes in process of being freed */
+ } fs_u2;
+ } fs_u11;
+ union {
+ struct {
+ __fs32 fs_sparecon[53];/* reserved for future constants */
+ __fs32 fs_reclaim;
+ __fs32 fs_sparecon2[1];
+ __fs32 fs_state; /* file system state time stamp */
+ __fs32 fs_qbmask[2]; /* ~usb_bmask */
+ __fs32 fs_qfmask[2]; /* ~usb_fmask */
+ } fs_sun;
+ struct {
+ __fs32 fs_sparecon[53];/* reserved for future constants */
+ __fs32 fs_reclaim;
+ __fs32 fs_sparecon2[1];
+ __fs32 fs_npsect; /* # sectors/track including spares */
+ __fs32 fs_qbmask[2]; /* ~usb_bmask */
+ __fs32 fs_qfmask[2]; /* ~usb_fmask */
+ } fs_sunx86;
+ struct {
+ __fs32 fs_sparecon[50];/* reserved for future constants */
+ __fs32 fs_contigsumsize;/* size of cluster summary array */
+ __fs32 fs_maxsymlinklen;/* max length of an internal symlink */
+ __fs32 fs_inodefmt; /* format of on-disk inodes */
+ __fs32 fs_maxfilesize[2]; /* max representable file size */
+ __fs32 fs_qbmask[2]; /* ~usb_bmask */
+ __fs32 fs_qfmask[2]; /* ~usb_fmask */
+ __fs32 fs_state; /* file system state time stamp */
+ } fs_44;
+ } fs_u2;
+ __fs32 fs_postblformat; /* format of positional layout tables */
+ __fs32 fs_nrpos; /* number of rotational positions */
+ __fs32 fs_postbloff; /* (__s16) rotation block list head */
+ __fs32 fs_rotbloff; /* (__u8) blocks for each rotation */
+ __fs32 fs_magic; /* magic number */
+ __u8 fs_space[1]; /* list of blocks for each rotation */
+};
+#endif/*struct ufs_super_block*/
+
+/*
+ * Preference for optimization.
+ */
+#define UFS_OPTTIME 0 /* minimize allocation time */
+#define UFS_OPTSPACE 1 /* minimize disk fragmentation */
+
+/*
+ * Rotational layout table format types
+ */
+#define UFS_42POSTBLFMT -1 /* 4.2BSD rotational table format */
+#define UFS_DYNAMICPOSTBLFMT 1 /* dynamic rotational table format */
+
+/*
+ * Convert cylinder group to base address of its global summary info.
+ */
+#define fs_cs(indx) s_csp[(indx)]
+
+/*
+ * Cylinder group block for a file system.
+ *
+ * Writable fields in the cylinder group are protected by the associated
+ * super block lock fs->fs_lock.
+ */
+#define CG_MAGIC 0x090255
+#define ufs_cg_chkmagic(sb, ucg) \
+ (fs32_to_cpu((sb), (ucg)->cg_magic) == CG_MAGIC)
+/*
+ * Macros for access to old cylinder group array structures
+ */
+#define ufs_ocg_blktot(sb, ucg) fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_btot)
+#define ufs_ocg_blks(sb, ucg, cylno) fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_b[cylno])
+#define ufs_ocg_inosused(sb, ucg) fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_iused)
+#define ufs_ocg_blksfree(sb, ucg) fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_free)
+#define ufs_ocg_chkmagic(sb, ucg) \
+ (fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_magic) == CG_MAGIC)
+
+/*
+ * size of this structure is 172 B
+ */
+struct ufs_cylinder_group {
+ __fs32 cg_link; /* linked list of cyl groups */
+ __fs32 cg_magic; /* magic number */
+ __fs32 cg_time; /* time last written */
+ __fs32 cg_cgx; /* we are the cgx'th cylinder group */
+ __fs16 cg_ncyl; /* number of cyl's this cg */
+ __fs16 cg_niblk; /* number of inode blocks this cg */
+ __fs32 cg_ndblk; /* number of data blocks this cg */
+ struct ufs_csum cg_cs; /* cylinder summary information */
+ __fs32 cg_rotor; /* position of last used block */
+ __fs32 cg_frotor; /* position of last used frag */
+ __fs32 cg_irotor; /* position of last used inode */
+ __fs32 cg_frsum[UFS_MAXFRAG]; /* counts of available frags */
+ __fs32 cg_btotoff; /* (__u32) block totals per cylinder */
+ __fs32 cg_boff; /* (short) free block positions */
+ __fs32 cg_iusedoff; /* (char) used inode map */
+ __fs32 cg_freeoff; /* (u_char) free block map */
+ __fs32 cg_nextfreeoff; /* (u_char) next available space */
+ union {
+ struct {
+ __fs32 cg_clustersumoff; /* (u_int32) counts of avail clusters */
+ __fs32 cg_clusteroff; /* (u_int8) free cluster map */
+ __fs32 cg_nclusterblks; /* number of clusters this cg */
+ __fs32 cg_sparecon[13]; /* reserved for future use */
+ } cg_44;
+ struct {
+ __fs32 cg_clustersumoff;/* (u_int32) counts of avail clusters */
+ __fs32 cg_clusteroff; /* (u_int8) free cluster map */
+ __fs32 cg_nclusterblks;/* number of clusters this cg */
+ __fs32 cg_niblk; /* number of inode blocks this cg */
+ __fs32 cg_initediblk; /* last initialized inode */
+ __fs32 cg_sparecon32[3];/* reserved for future use */
+ __fs64 cg_time; /* time last written */
+ __fs64 cg_sparecon[3]; /* reserved for future use */
+ } cg_u2;
+ __fs32 cg_sparecon[16]; /* reserved for future use */
+ } cg_u;
+ __u8 cg_space[1]; /* space for cylinder group maps */
+/* actually longer */
+};
+
+/* Historic Cylinder group info */
+struct ufs_old_cylinder_group {
+ __fs32 cg_link; /* linked list of cyl groups */
+ __fs32 cg_rlink; /* for incore cyl groups */
+ __fs32 cg_time; /* time last written */
+ __fs32 cg_cgx; /* we are the cgx'th cylinder group */
+ __fs16 cg_ncyl; /* number of cyl's this cg */
+ __fs16 cg_niblk; /* number of inode blocks this cg */
+ __fs32 cg_ndblk; /* number of data blocks this cg */
+ struct ufs_csum cg_cs; /* cylinder summary information */
+ __fs32 cg_rotor; /* position of last used block */
+ __fs32 cg_frotor; /* position of last used frag */
+ __fs32 cg_irotor; /* position of last used inode */
+ __fs32 cg_frsum[8]; /* counts of available frags */
+ __fs32 cg_btot[32]; /* block totals per cylinder */
+ __fs16 cg_b[32][8]; /* positions of free blocks */
+ __u8 cg_iused[256]; /* used inode map */
+ __fs32 cg_magic; /* magic number */
+ __u8 cg_free[1]; /* free block map */
+/* actually longer */
+};
+
+/*
+ * structure of an on-disk inode
+ */
+struct ufs_inode {
+ __fs16 ui_mode; /* 0x0 */
+ __fs16 ui_nlink; /* 0x2 */
+ union {
+ struct {
+ __fs16 ui_suid; /* 0x4 */
+ __fs16 ui_sgid; /* 0x6 */
+ } oldids;
+ __fs32 ui_inumber; /* 0x4 lsf: inode number */
+ __fs32 ui_author; /* 0x4 GNU HURD: author */
+ } ui_u1;
+ __fs64 ui_size; /* 0x8 */
+ struct ufs_timeval ui_atime; /* 0x10 access */
+ struct ufs_timeval ui_mtime; /* 0x18 modification */
+ struct ufs_timeval ui_ctime; /* 0x20 creation */
+ union {
+ struct {
+ __fs32 ui_db[UFS_NDADDR];/* 0x28 data blocks */
+ __fs32 ui_ib[UFS_NINDIR];/* 0x58 indirect blocks */
+ } ui_addr;
+ __u8 ui_symlink[4*(UFS_NDADDR+UFS_NINDIR)];/* 0x28 fast symlink */
+ } ui_u2;
+ __fs32 ui_flags; /* 0x64 immutable, append-only... */
+ __fs32 ui_blocks; /* 0x68 blocks in use */
+ __fs32 ui_gen; /* 0x6c like ext2 i_version, for NFS support */
+ union {
+ struct {
+ __fs32 ui_shadow; /* 0x70 shadow inode with security data */
+ __fs32 ui_uid; /* 0x74 long EFT version of uid */
+ __fs32 ui_gid; /* 0x78 long EFT version of gid */
+ __fs32 ui_oeftflag; /* 0x7c reserved */
+ } ui_sun;
+ struct {
+ __fs32 ui_uid; /* 0x70 File owner */
+ __fs32 ui_gid; /* 0x74 File group */
+ __fs32 ui_spare[2]; /* 0x78 reserved */
+ } ui_44;
+ struct {
+ __fs32 ui_uid; /* 0x70 */
+ __fs32 ui_gid; /* 0x74 */
+ __fs16 ui_modeh; /* 0x78 mode high bits */
+ __fs16 ui_spare; /* 0x7A unused */
+ __fs32 ui_trans; /* 0x7c filesystem translator */
+ } ui_hurd;
+ } ui_u3;
+};
+
+#define UFS_NXADDR 2 /* External addresses in inode. */
+struct ufs2_inode {
+ __fs16 ui_mode; /* 0: IFMT, permissions; see below. */
+ __fs16 ui_nlink; /* 2: File link count. */
+ __fs32 ui_uid; /* 4: File owner. */
+ __fs32 ui_gid; /* 8: File group. */
+ __fs32 ui_blksize; /* 12: Inode blocksize. */
+ __fs64 ui_size; /* 16: File byte count. */
+ __fs64 ui_blocks; /* 24: Bytes actually held. */
+ __fs64 ui_atime; /* 32: Last access time. */
+ __fs64 ui_mtime; /* 40: Last modified time. */
+ __fs64 ui_ctime; /* 48: Last inode change time. */
+ __fs64 ui_birthtime; /* 56: Inode creation time. */
+ __fs32 ui_mtimensec; /* 64: Last modified time. */
+ __fs32 ui_atimensec; /* 68: Last access time. */
+ __fs32 ui_ctimensec; /* 72: Last inode change time. */
+ __fs32 ui_birthnsec; /* 76: Inode creation time. */
+ __fs32 ui_gen; /* 80: Generation number. */
+ __fs32 ui_kernflags; /* 84: Kernel flags. */
+ __fs32 ui_flags; /* 88: Status flags (chflags). */
+ __fs32 ui_extsize; /* 92: External attributes block. */
+ __fs64 ui_extb[UFS_NXADDR];/* 96: External attributes block. */
+ union {
+ struct {
+ __fs64 ui_db[UFS_NDADDR]; /* 112: Direct disk blocks. */
+ __fs64 ui_ib[UFS_NINDIR];/* 208: Indirect disk blocks.*/
+ } ui_addr;
+ __u8 ui_symlink[2*4*(UFS_NDADDR+UFS_NINDIR)];/* 0x28 fast symlink */
+ } ui_u2;
+ __fs64 ui_spare[3]; /* 232: Reserved; currently unused */
+};
+
+
+/* FreeBSD has these in sys/stat.h */
+/* ui_flags that can be set by a file owner */
+#define UFS_UF_SETTABLE 0x0000ffff
+#define UFS_UF_NODUMP 0x00000001 /* do not dump */
+#define UFS_UF_IMMUTABLE 0x00000002 /* immutable (can't "change") */
+#define UFS_UF_APPEND 0x00000004 /* append-only */
+#define UFS_UF_OPAQUE 0x00000008 /* directory is opaque (unionfs) */
+#define UFS_UF_NOUNLINK 0x00000010 /* can't be removed or renamed */
+/* ui_flags that only root can set */
+#define UFS_SF_SETTABLE 0xffff0000
+#define UFS_SF_ARCHIVED 0x00010000 /* archived */
+#define UFS_SF_IMMUTABLE 0x00020000 /* immutable (can't "change") */
+#define UFS_SF_APPEND 0x00040000 /* append-only */
+#define UFS_SF_NOUNLINK 0x00100000 /* can't be removed or renamed */
+
+/*
+ * This structure is used for reading disk structures larger
+ * than the size of fragment.
+ */
+struct ufs_buffer_head {
+ __u64 fragment; /* first fragment */
+ __u64 count; /* number of fragments */
+ struct buffer_head * bh[UFS_MAXFRAG]; /* buffers */
+};
+
+struct ufs_cg_private_info {
+ struct ufs_buffer_head c_ubh;
+ __u32 c_cgx; /* number of cylidner group */
+ __u16 c_ncyl; /* number of cyl's this cg */
+ __u16 c_niblk; /* number of inode blocks this cg */
+ __u32 c_ndblk; /* number of data blocks this cg */
+ __u32 c_rotor; /* position of last used block */
+ __u32 c_frotor; /* position of last used frag */
+ __u32 c_irotor; /* position of last used inode */
+ __u32 c_btotoff; /* (__u32) block totals per cylinder */
+ __u32 c_boff; /* (short) free block positions */
+ __u32 c_iusedoff; /* (char) used inode map */
+ __u32 c_freeoff; /* (u_char) free block map */
+ __u32 c_nextfreeoff; /* (u_char) next available space */
+ __u32 c_clustersumoff;/* (u_int32) counts of avail clusters */
+ __u32 c_clusteroff; /* (u_int8) free cluster map */
+ __u32 c_nclusterblks; /* number of clusters this cg */
+};
+
+
+struct ufs_sb_private_info {
+ struct ufs_buffer_head s_ubh; /* buffer containing super block */
+ struct ufs_csum_core cs_total;
+ __u32 s_sblkno; /* offset of super-blocks in filesys */
+ __u32 s_cblkno; /* offset of cg-block in filesys */
+ __u32 s_iblkno; /* offset of inode-blocks in filesys */
+ __u32 s_dblkno; /* offset of first data after cg */
+ __u32 s_cgoffset; /* cylinder group offset in cylinder */
+ __u32 s_cgmask; /* used to calc mod fs_ntrak */
+ __u32 s_size; /* number of blocks (fragments) in fs */
+ __u32 s_dsize; /* number of data blocks in fs */
+ __u64 s_u2_size; /* ufs2: number of blocks (fragments) in fs */
+ __u64 s_u2_dsize; /*ufs2: number of data blocks in fs */
+ __u32 s_ncg; /* number of cylinder groups */
+ __u32 s_bsize; /* size of basic blocks */
+ __u32 s_fsize; /* size of fragments */
+ __u32 s_fpb; /* fragments per block */
+ __u32 s_minfree; /* minimum percentage of free blocks */
+ __u32 s_bmask; /* `blkoff'' calc of blk offsets */
+ __u32 s_fmask; /* s_fsize mask */
+ __u32 s_bshift; /* `lblkno'' calc of logical blkno */
+ __u32 s_fshift; /* s_fsize shift */
+ __u32 s_fpbshift; /* fragments per block shift */
+ __u32 s_fsbtodb; /* fsbtodb and dbtofsb shift constant */
+ __u32 s_sbsize; /* actual size of super block */
+ __u32 s_csmask; /* csum block offset */
+ __u32 s_csshift; /* csum block number */
+ __u32 s_nindir; /* value of NINDIR */
+ __u32 s_inopb; /* value of INOPB */
+ __u32 s_nspf; /* value of NSPF */
+ __u32 s_npsect; /* # sectors/track including spares */
+ __u32 s_interleave; /* hardware sector interleave */
+ __u32 s_trackskew; /* sector 0 skew, per track */
+ __u64 s_csaddr; /* blk addr of cyl grp summary area */
+ __u32 s_cssize; /* size of cyl grp summary area */
+ __u32 s_cgsize; /* cylinder group size */
+ __u32 s_ntrak; /* tracks per cylinder */
+ __u32 s_nsect; /* sectors per track */
+ __u32 s_spc; /* sectors per cylinder */
+ __u32 s_ipg; /* inodes per cylinder group */
+ __u32 s_fpg; /* fragments per group */
+ __u32 s_cpc; /* cyl per cycle in postbl */
+ __s32 s_contigsumsize;/* size of cluster summary array, 44bsd */
+ __s64 s_qbmask; /* ~usb_bmask */
+ __s64 s_qfmask; /* ~usb_fmask */
+ __s32 s_postblformat; /* format of positional layout tables */
+ __s32 s_nrpos; /* number of rotational positions */
+ __s32 s_postbloff; /* (__s16) rotation block list head */
+ __s32 s_rotbloff; /* (__u8) blocks for each rotation */
+
+ __u32 s_fpbmask; /* fragments per block mask */
+ __u32 s_apb; /* address per block */
+ __u32 s_2apb; /* address per block^2 */
+ __u32 s_3apb; /* address per block^3 */
+ __u32 s_apbmask; /* address per block mask */
+ __u32 s_apbshift; /* address per block shift */
+ __u32 s_2apbshift; /* address per block shift * 2 */
+ __u32 s_3apbshift; /* address per block shift * 3 */
+ __u32 s_nspfshift; /* number of sector per fragment shift */
+ __u32 s_nspb; /* number of sector per block */
+ __u32 s_inopf; /* inodes per fragment */
+ __u32 s_sbbase; /* offset of NeXTstep superblock */
+ __u32 s_bpf; /* bits per fragment */
+ __u32 s_bpfshift; /* bits per fragment shift*/
+ __u32 s_bpfmask; /* bits per fragment mask */
+
+ __u32 s_maxsymlinklen;/* upper limit on fast symlinks' size */
+ __s32 fs_magic; /* filesystem magic */
+ unsigned int s_dirblksize;
+};
+
+/*
+ * Sizes of this structures are:
+ * ufs_super_block_first 512
+ * ufs_super_block_second 512
+ * ufs_super_block_third 356
+ */
+struct ufs_super_block_first {
+ union {
+ struct {
+ __fs32 fs_link; /* UNUSED */
+ } fs_42;
+ struct {
+ __fs32 fs_state; /* file system state flag */
+ } fs_sun;
+ } fs_u0;
+ __fs32 fs_rlink;
+ __fs32 fs_sblkno;
+ __fs32 fs_cblkno;
+ __fs32 fs_iblkno;
+ __fs32 fs_dblkno;
+ __fs32 fs_cgoffset;
+ __fs32 fs_cgmask;
+ __fs32 fs_time;
+ __fs32 fs_size;
+ __fs32 fs_dsize;
+ __fs32 fs_ncg;
+ __fs32 fs_bsize;
+ __fs32 fs_fsize;
+ __fs32 fs_frag;
+ __fs32 fs_minfree;
+ __fs32 fs_rotdelay;
+ __fs32 fs_rps;
+ __fs32 fs_bmask;
+ __fs32 fs_fmask;
+ __fs32 fs_bshift;
+ __fs32 fs_fshift;
+ __fs32 fs_maxcontig;
+ __fs32 fs_maxbpg;
+ __fs32 fs_fragshift;
+ __fs32 fs_fsbtodb;
+ __fs32 fs_sbsize;
+ __fs32 fs_csmask;
+ __fs32 fs_csshift;
+ __fs32 fs_nindir;
+ __fs32 fs_inopb;
+ __fs32 fs_nspf;
+ __fs32 fs_optim;
+ union {
+ struct {
+ __fs32 fs_npsect;
+ } fs_sun;
+ struct {
+ __fs32 fs_state;
+ } fs_sunx86;
+ } fs_u1;
+ __fs32 fs_interleave;
+ __fs32 fs_trackskew;
+ __fs32 fs_id[2];
+ __fs32 fs_csaddr;
+ __fs32 fs_cssize;
+ __fs32 fs_cgsize;
+ __fs32 fs_ntrak;
+ __fs32 fs_nsect;
+ __fs32 fs_spc;
+ __fs32 fs_ncyl;
+ __fs32 fs_cpg;
+ __fs32 fs_ipg;
+ __fs32 fs_fpg;
+ struct ufs_csum fs_cstotal;
+ __s8 fs_fmod;
+ __s8 fs_clean;
+ __s8 fs_ronly;
+ __s8 fs_flags;
+ __s8 fs_fsmnt[UFS_MAXMNTLEN - 212];
+
+};
+
+struct ufs_super_block_second {
+ union {
+ struct {
+ __s8 fs_fsmnt[212];
+ __fs32 fs_cgrotor;
+ __fs32 fs_csp[UFS_MAXCSBUFS];
+ __fs32 fs_maxcluster;
+ __fs32 fs_cpc;
+ __fs16 fs_opostbl[82];
+ } fs_u1;
+ struct {
+ __s8 fs_fsmnt[UFS2_MAXMNTLEN - UFS_MAXMNTLEN + 212];
+ __u8 fs_volname[UFS2_MAXVOLLEN];
+ __fs64 fs_swuid;
+ __fs32 fs_pad;
+ __fs32 fs_cgrotor;
+ __fs32 fs_ocsp[UFS2_NOCSPTRS];
+ __fs32 fs_contigdirs;
+ __fs32 fs_csp;
+ __fs32 fs_maxcluster;
+ __fs32 fs_active;
+ __fs32 fs_old_cpc;
+ __fs32 fs_maxbsize;
+ __fs64 fs_sparecon64[17];
+ __fs64 fs_sblockloc;
+ __fs64 cs_ndir;
+ __fs64 cs_nbfree;
+ } fs_u2;
+ } fs_un;
+};
+
+struct ufs_super_block_third {
+ union {
+ struct {
+ __fs16 fs_opostbl[46];
+ } fs_u1;
+ struct {
+ __fs64 cs_nifree; /* number of free inodes */
+ __fs64 cs_nffree; /* number of free frags */
+ __fs64 cs_numclusters; /* number of free clusters */
+ __fs64 cs_spare[3]; /* future expansion */
+ struct ufs_timeval fs_time; /* last time written */
+ __fs64 fs_size; /* number of blocks in fs */
+ __fs64 fs_dsize; /* number of data blocks in fs */
+ __fs64 fs_csaddr; /* blk addr of cyl grp summary area */
+ __fs64 fs_pendingblocks;/* blocks in process of being freed */
+ __fs32 fs_pendinginodes;/*inodes in process of being freed */
+ } __attribute__ ((packed)) fs_u2;
+ } fs_un1;
+ union {
+ struct {
+ __fs32 fs_sparecon[53];/* reserved for future constants */
+ __fs32 fs_reclaim;
+ __fs32 fs_sparecon2[1];
+ __fs32 fs_state; /* file system state time stamp */
+ __fs32 fs_qbmask[2]; /* ~usb_bmask */
+ __fs32 fs_qfmask[2]; /* ~usb_fmask */
+ } fs_sun;
+ struct {
+ __fs32 fs_sparecon[53];/* reserved for future constants */
+ __fs32 fs_reclaim;
+ __fs32 fs_sparecon2[1];
+ __fs32 fs_npsect; /* # sectors/track including spares */
+ __fs32 fs_qbmask[2]; /* ~usb_bmask */
+ __fs32 fs_qfmask[2]; /* ~usb_fmask */
+ } fs_sunx86;
+ struct {
+ __fs32 fs_sparecon[50];/* reserved for future constants */
+ __fs32 fs_contigsumsize;/* size of cluster summary array */
+ __fs32 fs_maxsymlinklen;/* max length of an internal symlink */
+ __fs32 fs_inodefmt; /* format of on-disk inodes */
+ __fs32 fs_maxfilesize[2]; /* max representable file size */
+ __fs32 fs_qbmask[2]; /* ~usb_bmask */
+ __fs32 fs_qfmask[2]; /* ~usb_fmask */
+ __fs32 fs_state; /* file system state time stamp */
+ } fs_44;
+ } fs_un2;
+ __fs32 fs_postblformat;
+ __fs32 fs_nrpos;
+ __fs32 fs_postbloff;
+ __fs32 fs_rotbloff;
+ __fs32 fs_magic;
+ __u8 fs_space[1];
+};
+
+#endif /* __LINUX_UFS_FS_H */
diff --git a/sysroot/usr/include/linux/uinput.h b/sysroot/usr/include/linux/uinput.h
new file mode 100644
index 0000000..8ffd7da
--- /dev/null
+++ b/sysroot/usr/include/linux/uinput.h
@@ -0,0 +1,136 @@
+#ifndef __UINPUT_H_
+#define __UINPUT_H_
+/*
+ * User level driver support for input subsystem
+ *
+ * Heavily based on evdev.c by Vojtech Pavlik
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Author: Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org>
+ *
+ * Changes/Revisions:
+ * 0.3 24/05/2006 (Anssi Hannula <anssi.hannulagmail.com>)
+ * - update ff support for the changes in kernel interface
+ * - add UINPUT_VERSION
+ * 0.2 16/10/2004 (Micah Dowty <micah@navi.cx>)
+ * - added force feedback support
+ * - added UI_SET_PHYS
+ * 0.1 20/06/2002
+ * - first public version
+ */
+
+#include <linux/input.h>
+
+#define UINPUT_VERSION 3
+
+
+struct uinput_ff_upload {
+ int request_id;
+ int retval;
+ struct ff_effect effect;
+ struct ff_effect old;
+};
+
+struct uinput_ff_erase {
+ int request_id;
+ int retval;
+ int effect_id;
+};
+
+/* ioctl */
+#define UINPUT_IOCTL_BASE 'U'
+#define UI_DEV_CREATE _IO(UINPUT_IOCTL_BASE, 1)
+#define UI_DEV_DESTROY _IO(UINPUT_IOCTL_BASE, 2)
+
+#define UI_SET_EVBIT _IOW(UINPUT_IOCTL_BASE, 100, int)
+#define UI_SET_KEYBIT _IOW(UINPUT_IOCTL_BASE, 101, int)
+#define UI_SET_RELBIT _IOW(UINPUT_IOCTL_BASE, 102, int)
+#define UI_SET_ABSBIT _IOW(UINPUT_IOCTL_BASE, 103, int)
+#define UI_SET_MSCBIT _IOW(UINPUT_IOCTL_BASE, 104, int)
+#define UI_SET_LEDBIT _IOW(UINPUT_IOCTL_BASE, 105, int)
+#define UI_SET_SNDBIT _IOW(UINPUT_IOCTL_BASE, 106, int)
+#define UI_SET_FFBIT _IOW(UINPUT_IOCTL_BASE, 107, int)
+#define UI_SET_PHYS _IOW(UINPUT_IOCTL_BASE, 108, char*)
+#define UI_SET_SWBIT _IOW(UINPUT_IOCTL_BASE, 109, int)
+
+#define UI_BEGIN_FF_UPLOAD _IOWR(UINPUT_IOCTL_BASE, 200, struct uinput_ff_upload)
+#define UI_END_FF_UPLOAD _IOW(UINPUT_IOCTL_BASE, 201, struct uinput_ff_upload)
+#define UI_BEGIN_FF_ERASE _IOWR(UINPUT_IOCTL_BASE, 202, struct uinput_ff_erase)
+#define UI_END_FF_ERASE _IOW(UINPUT_IOCTL_BASE, 203, struct uinput_ff_erase)
+
+/*
+ * To write a force-feedback-capable driver, the upload_effect
+ * and erase_effect callbacks in input_dev must be implemented.
+ * The uinput driver will generate a fake input event when one of
+ * these callbacks are invoked. The userspace code then uses
+ * ioctls to retrieve additional parameters and send the return code.
+ * The callback blocks until this return code is sent.
+ *
+ * The described callback mechanism is only used if ff_effects_max
+ * is set.
+ *
+ * To implement upload_effect():
+ * 1. Wait for an event with type == EV_UINPUT and code == UI_FF_UPLOAD.
+ * A request ID will be given in 'value'.
+ * 2. Allocate a uinput_ff_upload struct, fill in request_id with
+ * the 'value' from the EV_UINPUT event.
+ * 3. Issue a UI_BEGIN_FF_UPLOAD ioctl, giving it the
+ * uinput_ff_upload struct. It will be filled in with the
+ * ff_effects passed to upload_effect().
+ * 4. Perform the effect upload, and place a return code back into
+ the uinput_ff_upload struct.
+ * 5. Issue a UI_END_FF_UPLOAD ioctl, also giving it the
+ * uinput_ff_upload_effect struct. This will complete execution
+ * of our upload_effect() handler.
+ *
+ * To implement erase_effect():
+ * 1. Wait for an event with type == EV_UINPUT and code == UI_FF_ERASE.
+ * A request ID will be given in 'value'.
+ * 2. Allocate a uinput_ff_erase struct, fill in request_id with
+ * the 'value' from the EV_UINPUT event.
+ * 3. Issue a UI_BEGIN_FF_ERASE ioctl, giving it the
+ * uinput_ff_erase struct. It will be filled in with the
+ * effect ID passed to erase_effect().
+ * 4. Perform the effect erasure, and place a return code back
+ * into the uinput_ff_erase struct.
+ * 5. Issue a UI_END_FF_ERASE ioctl, also giving it the
+ * uinput_ff_erase_effect struct. This will complete execution
+ * of our erase_effect() handler.
+ */
+
+/*
+ * This is the new event type, used only by uinput.
+ * 'code' is UI_FF_UPLOAD or UI_FF_ERASE, and 'value'
+ * is the unique request ID. This number was picked
+ * arbitrarily, above EV_MAX (since the input system
+ * never sees it) but in the range of a 16-bit int.
+ */
+#define EV_UINPUT 0x0101
+#define UI_FF_UPLOAD 1
+#define UI_FF_ERASE 2
+
+#define UINPUT_MAX_NAME_SIZE 80
+struct uinput_user_dev {
+ char name[UINPUT_MAX_NAME_SIZE];
+ struct input_id id;
+ int ff_effects_max;
+ int absmax[ABS_MAX + 1];
+ int absmin[ABS_MAX + 1];
+ int absfuzz[ABS_MAX + 1];
+ int absflat[ABS_MAX + 1];
+};
+#endif /* __UINPUT_H_ */
+
diff --git a/sysroot/usr/include/linux/uio.h b/sysroot/usr/include/linux/uio.h
new file mode 100644
index 0000000..2ba1397
--- /dev/null
+++ b/sysroot/usr/include/linux/uio.h
@@ -0,0 +1,48 @@
+#ifndef __LINUX_UIO_H
+#define __LINUX_UIO_H
+
+#include <linux/types.h>
+
+/*
+ * Berkeley style UIO structures - Alan Cox 1994.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+struct iovec
+{
+ void *iov_base; /* BSD uses caddr_t (1003.1g requires void *) */
+ __kernel_size_t iov_len; /* Must be size_t (1003.1g) */
+};
+
+
+/*
+ * UIO_MAXIOV shall be at least 16 1003.1g (5.4.1.1)
+ */
+
+#define UIO_FASTIOV 8
+#define UIO_MAXIOV 1024
+
+/*
+ * Total number of bytes covered by an iovec.
+ *
+ * NOTE that it is not safe to use this function until all the iovec's
+ * segment lengths have been validated. Because the individual lengths can
+ * overflow a size_t when added together.
+ */
+static __inline__ size_t iov_length(const struct iovec *iov, unsigned long nr_segs)
+{
+ unsigned long seg;
+ size_t ret = 0;
+
+ for (seg = 0; seg < nr_segs; seg++)
+ ret += iov[seg].iov_len;
+ return ret;
+}
+
+unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to);
+
+#endif
diff --git a/sysroot/usr/include/linux/ultrasound.h b/sysroot/usr/include/linux/ultrasound.h
new file mode 100644
index 0000000..6b7703e
--- /dev/null
+++ b/sysroot/usr/include/linux/ultrasound.h
@@ -0,0 +1,103 @@
+#ifndef _ULTRASOUND_H_
+#define _ULTRASOUND_H_
+/*
+ * ultrasound.h - Macros for programming the Gravis Ultrasound
+ * These macros are extremely device dependent
+ * and not portable.
+ */
+/*
+ * Copyright (C) by Hannu Savolainen 1993-1997
+ *
+ * OSS/Free for Linux is distributed under the GNU GENERAL PUBLIC LICENSE (GPL)
+ * Version 2 (June 1991). See the "COPYING" file distributed with this software
+ * for more info.
+ */
+
+
+/*
+ * Private events for Gravis Ultrasound (GUS)
+ *
+ * Format:
+ * byte 0 - SEQ_PRIVATE (0xfe)
+ * byte 1 - Synthesizer device number (0-N)
+ * byte 2 - Command (see below)
+ * byte 3 - Voice number (0-31)
+ * bytes 4 and 5 - parameter P1 (unsigned short)
+ * bytes 6 and 7 - parameter P2 (unsigned short)
+ *
+ * Commands:
+ * Each command affects one voice defined in byte 3.
+ * Unused parameters (P1 and/or P2 *MUST* be initialized to zero).
+ * _GUS_NUMVOICES - Sets max. number of concurrent voices (P1=14-31, default 16)
+ * _GUS_VOICESAMPLE- ************ OBSOLETE *************
+ * _GUS_VOICEON - Starts voice (P1=voice mode)
+ * _GUS_VOICEOFF - Stops voice (no parameters)
+ * _GUS_VOICEFADE - Stops the voice smoothly.
+ * _GUS_VOICEMODE - Alters the voice mode, don't start or stop voice (P1=voice mode)
+ * _GUS_VOICEBALA - Sets voice balence (P1, 0=left, 7=middle and 15=right, default 7)
+ * _GUS_VOICEFREQ - Sets voice (sample) playback frequency (P1=Hz)
+ * _GUS_VOICEVOL - Sets voice volume (P1=volume, 0xfff=max, 0xeff=half, 0x000=off)
+ * _GUS_VOICEVOL2 - Sets voice volume (P1=volume, 0xfff=max, 0xeff=half, 0x000=off)
+ * (Like GUS_VOICEVOL but doesn't change the hw
+ * volume. It just updates volume in the voice table).
+ *
+ * _GUS_RAMPRANGE - Sets limits for volume ramping (P1=low volume, P2=high volume)
+ * _GUS_RAMPRATE - Sets the speed for volume ramping (P1=scale, P2=rate)
+ * _GUS_RAMPMODE - Sets the volume ramping mode (P1=ramping mode)
+ * _GUS_RAMPON - Starts volume ramping (no parameters)
+ * _GUS_RAMPOFF - Stops volume ramping (no parameters)
+ * _GUS_VOLUME_SCALE - Changes the volume calculation constants
+ * for all voices.
+ */
+
+#define _GUS_NUMVOICES 0x00
+#define _GUS_VOICESAMPLE 0x01 /* OBSOLETE */
+#define _GUS_VOICEON 0x02
+#define _GUS_VOICEOFF 0x03
+#define _GUS_VOICEMODE 0x04
+#define _GUS_VOICEBALA 0x05
+#define _GUS_VOICEFREQ 0x06
+#define _GUS_VOICEVOL 0x07
+#define _GUS_RAMPRANGE 0x08
+#define _GUS_RAMPRATE 0x09
+#define _GUS_RAMPMODE 0x0a
+#define _GUS_RAMPON 0x0b
+#define _GUS_RAMPOFF 0x0c
+#define _GUS_VOICEFADE 0x0d
+#define _GUS_VOLUME_SCALE 0x0e
+#define _GUS_VOICEVOL2 0x0f
+#define _GUS_VOICE_POS 0x10
+
+/*
+ * GUS API macros
+ */
+
+#define _GUS_CMD(chn, voice, cmd, p1, p2) \
+ {_SEQ_NEEDBUF(8); _seqbuf[_seqbufptr] = SEQ_PRIVATE;\
+ _seqbuf[_seqbufptr+1] = (chn); _seqbuf[_seqbufptr+2] = cmd;\
+ _seqbuf[_seqbufptr+3] = voice;\
+ *(unsigned short*)&_seqbuf[_seqbufptr+4] = p1;\
+ *(unsigned short*)&_seqbuf[_seqbufptr+6] = p2;\
+ _SEQ_ADVBUF(8);}
+
+#define GUS_NUMVOICES(chn, p1) _GUS_CMD(chn, 0, _GUS_NUMVOICES, (p1), 0)
+#define GUS_VOICESAMPLE(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_VOICESAMPLE, (p1), 0) /* OBSOLETE */
+#define GUS_VOICEON(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_VOICEON, (p1), 0)
+#define GUS_VOICEOFF(chn, voice) _GUS_CMD(chn, voice, _GUS_VOICEOFF, 0, 0)
+#define GUS_VOICEFADE(chn, voice) _GUS_CMD(chn, voice, _GUS_VOICEFADE, 0, 0)
+#define GUS_VOICEMODE(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_VOICEMODE, (p1), 0)
+#define GUS_VOICEBALA(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_VOICEBALA, (p1), 0)
+#define GUS_VOICEFREQ(chn, voice, p) _GUS_CMD(chn, voice, _GUS_VOICEFREQ, \
+ (p) & 0xffff, ((p) >> 16) & 0xffff)
+#define GUS_VOICEVOL(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_VOICEVOL, (p1), 0)
+#define GUS_VOICEVOL2(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_VOICEVOL2, (p1), 0)
+#define GUS_RAMPRANGE(chn, voice, low, high) _GUS_CMD(chn, voice, _GUS_RAMPRANGE, (low), (high))
+#define GUS_RAMPRATE(chn, voice, p1, p2) _GUS_CMD(chn, voice, _GUS_RAMPRATE, (p1), (p2))
+#define GUS_RAMPMODE(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_RAMPMODE, (p1), 0)
+#define GUS_RAMPON(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_RAMPON, (p1), 0)
+#define GUS_RAMPOFF(chn, voice) _GUS_CMD(chn, voice, _GUS_RAMPOFF, 0, 0)
+#define GUS_VOLUME_SCALE(chn, voice, p1, p2) _GUS_CMD(chn, voice, _GUS_VOLUME_SCALE, (p1), (p2))
+#define GUS_VOICE_POS(chn, voice, p) _GUS_CMD(chn, voice, _GUS_VOICE_POS, \
+ (p) & 0xffff, ((p) >> 16) & 0xffff)
+
+#endif
diff --git a/sysroot/usr/include/linux/un.h b/sysroot/usr/include/linux/un.h
new file mode 100644
index 0000000..45561c5
--- /dev/null
+++ b/sysroot/usr/include/linux/un.h
@@ -0,0 +1,11 @@
+#ifndef _LINUX_UN_H
+#define _LINUX_UN_H
+
+#define UNIX_PATH_MAX 108
+
+struct sockaddr_un {
+ sa_family_t sun_family; /* AF_UNIX */
+ char sun_path[UNIX_PATH_MAX]; /* pathname */
+};
+
+#endif /* _LINUX_UN_H */
diff --git a/sysroot/usr/include/linux/unistd.h b/sysroot/usr/include/linux/unistd.h
new file mode 100644
index 0000000..aa8d5b5
--- /dev/null
+++ b/sysroot/usr/include/linux/unistd.h
@@ -0,0 +1,9 @@
+#ifndef _LINUX_UNISTD_H_
+#define _LINUX_UNISTD_H_
+
+/*
+ * Include machine specific syscall numbers
+ */
+#include <asm/unistd.h>
+
+#endif /* _LINUX_UNISTD_H_ */
diff --git a/sysroot/usr/include/linux/usb/audio.h b/sysroot/usr/include/linux/usb/audio.h
new file mode 100644
index 0000000..6bd2359
--- /dev/null
+++ b/sysroot/usr/include/linux/usb/audio.h
@@ -0,0 +1,53 @@
+/*
+ * <linux/usb/audio.h> -- USB Audio definitions.
+ *
+ * Copyright (C) 2006 Thumtronics Pty Ltd.
+ * Developed for Thumtronics by Grey Innovation
+ * Ben Williamson <ben.williamson@greyinnovation.com>
+ *
+ * This software is distributed under the terms of the GNU General Public
+ * License ("GPL") version 2, as published by the Free Software Foundation.
+ *
+ * This file holds USB constants and structures defined
+ * by the USB Device Class Definition for Audio Devices.
+ * Comments below reference relevant sections of that document:
+ *
+ * http://www.usb.org/developers/devclass_docs/audio10.pdf
+ */
+
+#ifndef __LINUX_USB_AUDIO_H
+#define __LINUX_USB_AUDIO_H
+
+#include <linux/types.h>
+
+/* A.2 Audio Interface Subclass Codes */
+#define USB_SUBCLASS_AUDIOCONTROL 0x01
+#define USB_SUBCLASS_AUDIOSTREAMING 0x02
+#define USB_SUBCLASS_MIDISTREAMING 0x03
+
+/* 4.3.2 Class-Specific AC Interface Descriptor */
+struct usb_ac_header_descriptor {
+ __u8 bLength; // 8+n
+ __u8 bDescriptorType; // USB_DT_CS_INTERFACE
+ __u8 bDescriptorSubtype; // USB_MS_HEADER
+ __le16 bcdADC; // 0x0100
+ __le16 wTotalLength; // includes Unit and Terminal desc.
+ __u8 bInCollection; // n
+ __u8 baInterfaceNr[]; // [n]
+} __attribute__ ((packed));
+
+#define USB_DT_AC_HEADER_SIZE(n) (8+(n))
+
+/* As above, but more useful for defining your own descriptors: */
+#define DECLARE_USB_AC_HEADER_DESCRIPTOR(n) \
+struct usb_ac_header_descriptor_##n { \
+ __u8 bLength; \
+ __u8 bDescriptorType; \
+ __u8 bDescriptorSubtype; \
+ __le16 bcdADC; \
+ __le16 wTotalLength; \
+ __u8 bInCollection; \
+ __u8 baInterfaceNr[n]; \
+} __attribute__ ((packed))
+
+#endif
diff --git a/sysroot/usr/include/linux/usb/cdc.h b/sysroot/usr/include/linux/usb/cdc.h
new file mode 100644
index 0000000..2204ae2
--- /dev/null
+++ b/sysroot/usr/include/linux/usb/cdc.h
@@ -0,0 +1,223 @@
+/*
+ * USB Communications Device Class (CDC) definitions
+ *
+ * CDC says how to talk to lots of different types of network adapters,
+ * notably ethernet adapters and various modems. It's used mostly with
+ * firmware based USB peripherals.
+ */
+
+#define USB_CDC_SUBCLASS_ACM 0x02
+#define USB_CDC_SUBCLASS_ETHERNET 0x06
+#define USB_CDC_SUBCLASS_WHCM 0x08
+#define USB_CDC_SUBCLASS_DMM 0x09
+#define USB_CDC_SUBCLASS_MDLM 0x0a
+#define USB_CDC_SUBCLASS_OBEX 0x0b
+
+#define USB_CDC_PROTO_NONE 0
+
+#define USB_CDC_ACM_PROTO_AT_V25TER 1
+#define USB_CDC_ACM_PROTO_AT_PCCA101 2
+#define USB_CDC_ACM_PROTO_AT_PCCA101_WAKE 3
+#define USB_CDC_ACM_PROTO_AT_GSM 4
+#define USB_CDC_ACM_PROTO_AT_3G 5
+#define USB_CDC_ACM_PROTO_AT_CDMA 6
+#define USB_CDC_ACM_PROTO_VENDOR 0xff
+
+/*-------------------------------------------------------------------------*/
+
+/*
+ * Class-Specific descriptors ... there are a couple dozen of them
+ */
+
+#define USB_CDC_HEADER_TYPE 0x00 /* header_desc */
+#define USB_CDC_CALL_MANAGEMENT_TYPE 0x01 /* call_mgmt_descriptor */
+#define USB_CDC_ACM_TYPE 0x02 /* acm_descriptor */
+#define USB_CDC_UNION_TYPE 0x06 /* union_desc */
+#define USB_CDC_COUNTRY_TYPE 0x07
+#define USB_CDC_NETWORK_TERMINAL_TYPE 0x0a /* network_terminal_desc */
+#define USB_CDC_ETHERNET_TYPE 0x0f /* ether_desc */
+#define USB_CDC_WHCM_TYPE 0x11
+#define USB_CDC_MDLM_TYPE 0x12 /* mdlm_desc */
+#define USB_CDC_MDLM_DETAIL_TYPE 0x13 /* mdlm_detail_desc */
+#define USB_CDC_DMM_TYPE 0x14
+#define USB_CDC_OBEX_TYPE 0x15
+
+/* "Header Functional Descriptor" from CDC spec 5.2.3.1 */
+struct usb_cdc_header_desc {
+ __u8 bLength;
+ __u8 bDescriptorType;
+ __u8 bDescriptorSubType;
+
+ __le16 bcdCDC;
+} __attribute__ ((packed));
+
+/* "Call Management Descriptor" from CDC spec 5.2.3.2 */
+struct usb_cdc_call_mgmt_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+ __u8 bDescriptorSubType;
+
+ __u8 bmCapabilities;
+#define USB_CDC_CALL_MGMT_CAP_CALL_MGMT 0x01
+#define USB_CDC_CALL_MGMT_CAP_DATA_INTF 0x02
+
+ __u8 bDataInterface;
+} __attribute__ ((packed));
+
+/* "Abstract Control Management Descriptor" from CDC spec 5.2.3.3 */
+struct usb_cdc_acm_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+ __u8 bDescriptorSubType;
+
+ __u8 bmCapabilities;
+} __attribute__ ((packed));
+
+/* capabilities from 5.2.3.3 */
+
+#define USB_CDC_COMM_FEATURE 0x01
+#define USB_CDC_CAP_LINE 0x02
+#define USB_CDC_CAP_BRK 0x04
+#define USB_CDC_CAP_NOTIFY 0x08
+
+/* "Union Functional Descriptor" from CDC spec 5.2.3.8 */
+struct usb_cdc_union_desc {
+ __u8 bLength;
+ __u8 bDescriptorType;
+ __u8 bDescriptorSubType;
+
+ __u8 bMasterInterface0;
+ __u8 bSlaveInterface0;
+ /* ... and there could be other slave interfaces */
+} __attribute__ ((packed));
+
+/* "Country Selection Functional Descriptor" from CDC spec 5.2.3.9 */
+struct usb_cdc_country_functional_desc {
+ __u8 bLength;
+ __u8 bDescriptorType;
+ __u8 bDescriptorSubType;
+
+ __u8 iCountryCodeRelDate;
+ __le16 wCountyCode0;
+ /* ... and there can be a lot of country codes */
+} __attribute__ ((packed));
+
+/* "Network Channel Terminal Functional Descriptor" from CDC spec 5.2.3.11 */
+struct usb_cdc_network_terminal_desc {
+ __u8 bLength;
+ __u8 bDescriptorType;
+ __u8 bDescriptorSubType;
+
+ __u8 bEntityId;
+ __u8 iName;
+ __u8 bChannelIndex;
+ __u8 bPhysicalInterface;
+} __attribute__ ((packed));
+
+/* "Ethernet Networking Functional Descriptor" from CDC spec 5.2.3.16 */
+struct usb_cdc_ether_desc {
+ __u8 bLength;
+ __u8 bDescriptorType;
+ __u8 bDescriptorSubType;
+
+ __u8 iMACAddress;
+ __le32 bmEthernetStatistics;
+ __le16 wMaxSegmentSize;
+ __le16 wNumberMCFilters;
+ __u8 bNumberPowerFilters;
+} __attribute__ ((packed));
+
+/* "MDLM Functional Descriptor" from CDC WMC spec 6.7.2.3 */
+struct usb_cdc_mdlm_desc {
+ __u8 bLength;
+ __u8 bDescriptorType;
+ __u8 bDescriptorSubType;
+
+ __le16 bcdVersion;
+ __u8 bGUID[16];
+} __attribute__ ((packed));
+
+/* "MDLM Detail Functional Descriptor" from CDC WMC spec 6.7.2.4 */
+struct usb_cdc_mdlm_detail_desc {
+ __u8 bLength;
+ __u8 bDescriptorType;
+ __u8 bDescriptorSubType;
+
+ /* type is associated with mdlm_desc.bGUID */
+ __u8 bGuidDescriptorType;
+ __u8 bDetailData[0];
+} __attribute__ ((packed));
+
+/*-------------------------------------------------------------------------*/
+
+/*
+ * Class-Specific Control Requests (6.2)
+ *
+ * section 3.6.2.1 table 4 has the ACM profile, for modems.
+ * section 3.8.2 table 10 has the ethernet profile.
+ *
+ * Microsoft's RNDIS stack for Ethernet is a vendor-specific CDC ACM variant,
+ * heavily dependent on the encapsulated (proprietary) command mechanism.
+ */
+
+#define USB_CDC_SEND_ENCAPSULATED_COMMAND 0x00
+#define USB_CDC_GET_ENCAPSULATED_RESPONSE 0x01
+#define USB_CDC_REQ_SET_LINE_CODING 0x20
+#define USB_CDC_REQ_GET_LINE_CODING 0x21
+#define USB_CDC_REQ_SET_CONTROL_LINE_STATE 0x22
+#define USB_CDC_REQ_SEND_BREAK 0x23
+#define USB_CDC_SET_ETHERNET_MULTICAST_FILTERS 0x40
+#define USB_CDC_SET_ETHERNET_PM_PATTERN_FILTER 0x41
+#define USB_CDC_GET_ETHERNET_PM_PATTERN_FILTER 0x42
+#define USB_CDC_SET_ETHERNET_PACKET_FILTER 0x43
+#define USB_CDC_GET_ETHERNET_STATISTIC 0x44
+
+/* Line Coding Structure from CDC spec 6.2.13 */
+struct usb_cdc_line_coding {
+ __le32 dwDTERate;
+ __u8 bCharFormat;
+#define USB_CDC_1_STOP_BITS 0
+#define USB_CDC_1_5_STOP_BITS 1
+#define USB_CDC_2_STOP_BITS 2
+
+ __u8 bParityType;
+#define USB_CDC_NO_PARITY 0
+#define USB_CDC_ODD_PARITY 1
+#define USB_CDC_EVEN_PARITY 2
+#define USB_CDC_MARK_PARITY 3
+#define USB_CDC_SPACE_PARITY 4
+
+ __u8 bDataBits;
+} __attribute__ ((packed));
+
+/* table 62; bits in multicast filter */
+#define USB_CDC_PACKET_TYPE_PROMISCUOUS (1 << 0)
+#define USB_CDC_PACKET_TYPE_ALL_MULTICAST (1 << 1) /* no filter */
+#define USB_CDC_PACKET_TYPE_DIRECTED (1 << 2)
+#define USB_CDC_PACKET_TYPE_BROADCAST (1 << 3)
+#define USB_CDC_PACKET_TYPE_MULTICAST (1 << 4) /* filtered */
+
+
+/*-------------------------------------------------------------------------*/
+
+/*
+ * Class-Specific Notifications (6.3) sent by interrupt transfers
+ *
+ * section 3.8.2 table 11 of the CDC spec lists Ethernet notifications
+ * section 3.6.2.1 table 5 specifies ACM notifications, accepted by RNDIS
+ * RNDIS also defines its own bit-incompatible notifications
+ */
+
+#define USB_CDC_NOTIFY_NETWORK_CONNECTION 0x00
+#define USB_CDC_NOTIFY_RESPONSE_AVAILABLE 0x01
+#define USB_CDC_NOTIFY_SERIAL_STATE 0x20
+#define USB_CDC_NOTIFY_SPEED_CHANGE 0x2a
+
+struct usb_cdc_notification {
+ __u8 bmRequestType;
+ __u8 bNotificationType;
+ __le16 wValue;
+ __le16 wIndex;
+ __le16 wLength;
+} __attribute__ ((packed));
+
diff --git a/sysroot/usr/include/linux/usb/ch9.h b/sysroot/usr/include/linux/usb/ch9.h
new file mode 100644
index 0000000..6169438
--- /dev/null
+++ b/sysroot/usr/include/linux/usb/ch9.h
@@ -0,0 +1,580 @@
+/*
+ * This file holds USB constants and structures that are needed for
+ * USB device APIs. These are used by the USB device model, which is
+ * defined in chapter 9 of the USB 2.0 specification and in the
+ * Wireless USB 1.0 (spread around). Linux has several APIs in C that
+ * need these:
+ *
+ * - the master/host side Linux-USB kernel driver API;
+ * - the "usbfs" user space API; and
+ * - the Linux "gadget" slave/device/peripheral side driver API.
+ *
+ * USB 2.0 adds an additional "On The Go" (OTG) mode, which lets systems
+ * act either as a USB master/host or as a USB slave/device. That means
+ * the master and slave side APIs benefit from working well together.
+ *
+ * There's also "Wireless USB", using low power short range radios for
+ * peripheral interconnection but otherwise building on the USB framework.
+ *
+ * Note all descriptors are declared '__attribute__((packed))' so that:
+ *
+ * [a] they never get padded, either internally (USB spec writers
+ * probably handled that) or externally;
+ *
+ * [b] so that accessing bigger-than-a-bytes fields will never
+ * generate bus errors on any platform, even when the location of
+ * its descriptor inside a bundle isn't "naturally aligned", and
+ *
+ * [c] for consistency, removing all doubt even when it appears to
+ * someone that the two other points are non-issues for that
+ * particular descriptor type.
+ */
+
+#ifndef __LINUX_USB_CH9_H
+#define __LINUX_USB_CH9_H
+
+#include <linux/types.h> /* __u8 etc */
+
+/*-------------------------------------------------------------------------*/
+
+/* CONTROL REQUEST SUPPORT */
+
+/*
+ * USB directions
+ *
+ * This bit flag is used in endpoint descriptors' bEndpointAddress field.
+ * It's also one of three fields in control requests bRequestType.
+ */
+#define USB_DIR_OUT 0 /* to device */
+#define USB_DIR_IN 0x80 /* to host */
+
+/*
+ * USB types, the second of three bRequestType fields
+ */
+#define USB_TYPE_MASK (0x03 << 5)
+#define USB_TYPE_STANDARD (0x00 << 5)
+#define USB_TYPE_CLASS (0x01 << 5)
+#define USB_TYPE_VENDOR (0x02 << 5)
+#define USB_TYPE_RESERVED (0x03 << 5)
+
+/*
+ * USB recipients, the third of three bRequestType fields
+ */
+#define USB_RECIP_MASK 0x1f
+#define USB_RECIP_DEVICE 0x00
+#define USB_RECIP_INTERFACE 0x01
+#define USB_RECIP_ENDPOINT 0x02
+#define USB_RECIP_OTHER 0x03
+/* From Wireless USB 1.0 */
+#define USB_RECIP_PORT 0x04
+#define USB_RECIP_RPIPE 0x05
+
+/*
+ * Standard requests, for the bRequest field of a SETUP packet.
+ *
+ * These are qualified by the bRequestType field, so that for example
+ * TYPE_CLASS or TYPE_VENDOR specific feature flags could be retrieved
+ * by a GET_STATUS request.
+ */
+#define USB_REQ_GET_STATUS 0x00
+#define USB_REQ_CLEAR_FEATURE 0x01
+#define USB_REQ_SET_FEATURE 0x03
+#define USB_REQ_SET_ADDRESS 0x05
+#define USB_REQ_GET_DESCRIPTOR 0x06
+#define USB_REQ_SET_DESCRIPTOR 0x07
+#define USB_REQ_GET_CONFIGURATION 0x08
+#define USB_REQ_SET_CONFIGURATION 0x09
+#define USB_REQ_GET_INTERFACE 0x0A
+#define USB_REQ_SET_INTERFACE 0x0B
+#define USB_REQ_SYNCH_FRAME 0x0C
+
+#define USB_REQ_SET_ENCRYPTION 0x0D /* Wireless USB */
+#define USB_REQ_GET_ENCRYPTION 0x0E
+#define USB_REQ_RPIPE_ABORT 0x0E
+#define USB_REQ_SET_HANDSHAKE 0x0F
+#define USB_REQ_RPIPE_RESET 0x0F
+#define USB_REQ_GET_HANDSHAKE 0x10
+#define USB_REQ_SET_CONNECTION 0x11
+#define USB_REQ_SET_SECURITY_DATA 0x12
+#define USB_REQ_GET_SECURITY_DATA 0x13
+#define USB_REQ_SET_WUSB_DATA 0x14
+#define USB_REQ_LOOPBACK_DATA_WRITE 0x15
+#define USB_REQ_LOOPBACK_DATA_READ 0x16
+#define USB_REQ_SET_INTERFACE_DS 0x17
+
+/*
+ * USB feature flags are written using USB_REQ_{CLEAR,SET}_FEATURE, and
+ * are read as a bit array returned by USB_REQ_GET_STATUS. (So there
+ * are at most sixteen features of each type.)
+ */
+#define USB_DEVICE_SELF_POWERED 0 /* (read only) */
+#define USB_DEVICE_REMOTE_WAKEUP 1 /* dev may initiate wakeup */
+#define USB_DEVICE_TEST_MODE 2 /* (wired high speed only) */
+#define USB_DEVICE_BATTERY 2 /* (wireless) */
+#define USB_DEVICE_B_HNP_ENABLE 3 /* (otg) dev may initiate HNP */
+#define USB_DEVICE_WUSB_DEVICE 3 /* (wireless)*/
+#define USB_DEVICE_A_HNP_SUPPORT 4 /* (otg) RH port supports HNP */
+#define USB_DEVICE_A_ALT_HNP_SUPPORT 5 /* (otg) other RH port does */
+#define USB_DEVICE_DEBUG_MODE 6 /* (special devices only) */
+
+#define USB_ENDPOINT_HALT 0 /* IN/OUT will STALL */
+
+
+/**
+ * struct usb_ctrlrequest - SETUP data for a USB device control request
+ * @bRequestType: matches the USB bmRequestType field
+ * @bRequest: matches the USB bRequest field
+ * @wValue: matches the USB wValue field (le16 byte order)
+ * @wIndex: matches the USB wIndex field (le16 byte order)
+ * @wLength: matches the USB wLength field (le16 byte order)
+ *
+ * This structure is used to send control requests to a USB device. It matches
+ * the different fields of the USB 2.0 Spec section 9.3, table 9-2. See the
+ * USB spec for a fuller description of the different fields, and what they are
+ * used for.
+ *
+ * Note that the driver for any interface can issue control requests.
+ * For most devices, interfaces don't coordinate with each other, so
+ * such requests may be made at any time.
+ */
+struct usb_ctrlrequest {
+ __u8 bRequestType;
+ __u8 bRequest;
+ __le16 wValue;
+ __le16 wIndex;
+ __le16 wLength;
+} __attribute__ ((packed));
+
+/*-------------------------------------------------------------------------*/
+
+/*
+ * STANDARD DESCRIPTORS ... as returned by GET_DESCRIPTOR, or
+ * (rarely) accepted by SET_DESCRIPTOR.
+ *
+ * Note that all multi-byte values here are encoded in little endian
+ * byte order "on the wire". But when exposed through Linux-USB APIs,
+ * they've been converted to cpu byte order.
+ */
+
+/*
+ * Descriptor types ... USB 2.0 spec table 9.5
+ */
+#define USB_DT_DEVICE 0x01
+#define USB_DT_CONFIG 0x02
+#define USB_DT_STRING 0x03
+#define USB_DT_INTERFACE 0x04
+#define USB_DT_ENDPOINT 0x05
+#define USB_DT_DEVICE_QUALIFIER 0x06
+#define USB_DT_OTHER_SPEED_CONFIG 0x07
+#define USB_DT_INTERFACE_POWER 0x08
+/* these are from a minor usb 2.0 revision (ECN) */
+#define USB_DT_OTG 0x09
+#define USB_DT_DEBUG 0x0a
+#define USB_DT_INTERFACE_ASSOCIATION 0x0b
+/* these are from the Wireless USB spec */
+#define USB_DT_SECURITY 0x0c
+#define USB_DT_KEY 0x0d
+#define USB_DT_ENCRYPTION_TYPE 0x0e
+#define USB_DT_BOS 0x0f
+#define USB_DT_DEVICE_CAPABILITY 0x10
+#define USB_DT_WIRELESS_ENDPOINT_COMP 0x11
+#define USB_DT_WIRE_ADAPTER 0x21
+#define USB_DT_RPIPE 0x22
+
+/* Conventional codes for class-specific descriptors. The convention is
+ * defined in the USB "Common Class" Spec (3.11). Individual class specs
+ * are authoritative for their usage, not the "common class" writeup.
+ */
+#define USB_DT_CS_DEVICE (USB_TYPE_CLASS | USB_DT_DEVICE)
+#define USB_DT_CS_CONFIG (USB_TYPE_CLASS | USB_DT_CONFIG)
+#define USB_DT_CS_STRING (USB_TYPE_CLASS | USB_DT_STRING)
+#define USB_DT_CS_INTERFACE (USB_TYPE_CLASS | USB_DT_INTERFACE)
+#define USB_DT_CS_ENDPOINT (USB_TYPE_CLASS | USB_DT_ENDPOINT)
+
+/* All standard descriptors have these 2 fields at the beginning */
+struct usb_descriptor_header {
+ __u8 bLength;
+ __u8 bDescriptorType;
+} __attribute__ ((packed));
+
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_DEVICE: Device descriptor */
+struct usb_device_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __le16 bcdUSB;
+ __u8 bDeviceClass;
+ __u8 bDeviceSubClass;
+ __u8 bDeviceProtocol;
+ __u8 bMaxPacketSize0;
+ __le16 idVendor;
+ __le16 idProduct;
+ __le16 bcdDevice;
+ __u8 iManufacturer;
+ __u8 iProduct;
+ __u8 iSerialNumber;
+ __u8 bNumConfigurations;
+} __attribute__ ((packed));
+
+#define USB_DT_DEVICE_SIZE 18
+
+
+/*
+ * Device and/or Interface Class codes
+ * as found in bDeviceClass or bInterfaceClass
+ * and defined by www.usb.org documents
+ */
+#define USB_CLASS_PER_INTERFACE 0 /* for DeviceClass */
+#define USB_CLASS_AUDIO 1
+#define USB_CLASS_COMM 2
+#define USB_CLASS_HID 3
+#define USB_CLASS_PHYSICAL 5
+#define USB_CLASS_STILL_IMAGE 6
+#define USB_CLASS_PRINTER 7
+#define USB_CLASS_MASS_STORAGE 8
+#define USB_CLASS_HUB 9
+#define USB_CLASS_CDC_DATA 0x0a
+#define USB_CLASS_CSCID 0x0b /* chip+ smart card */
+#define USB_CLASS_CONTENT_SEC 0x0d /* content security */
+#define USB_CLASS_VIDEO 0x0e
+#define USB_CLASS_WIRELESS_CONTROLLER 0xe0
+#define USB_CLASS_MISC 0xef
+#define USB_CLASS_APP_SPEC 0xfe
+#define USB_CLASS_VENDOR_SPEC 0xff
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_CONFIG: Configuration descriptor information.
+ *
+ * USB_DT_OTHER_SPEED_CONFIG is the same descriptor, except that the
+ * descriptor type is different. Highspeed-capable devices can look
+ * different depending on what speed they're currently running. Only
+ * devices with a USB_DT_DEVICE_QUALIFIER have any OTHER_SPEED_CONFIG
+ * descriptors.
+ */
+struct usb_config_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __le16 wTotalLength;
+ __u8 bNumInterfaces;
+ __u8 bConfigurationValue;
+ __u8 iConfiguration;
+ __u8 bmAttributes;
+ __u8 bMaxPower;
+} __attribute__ ((packed));
+
+#define USB_DT_CONFIG_SIZE 9
+
+/* from config descriptor bmAttributes */
+#define USB_CONFIG_ATT_ONE (1 << 7) /* must be set */
+#define USB_CONFIG_ATT_SELFPOWER (1 << 6) /* self powered */
+#define USB_CONFIG_ATT_WAKEUP (1 << 5) /* can wakeup */
+#define USB_CONFIG_ATT_BATTERY (1 << 4) /* battery powered */
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_STRING: String descriptor */
+struct usb_string_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __le16 wData[1]; /* UTF-16LE encoded */
+} __attribute__ ((packed));
+
+/* note that "string" zero is special, it holds language codes that
+ * the device supports, not Unicode characters.
+ */
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_INTERFACE: Interface descriptor */
+struct usb_interface_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __u8 bInterfaceNumber;
+ __u8 bAlternateSetting;
+ __u8 bNumEndpoints;
+ __u8 bInterfaceClass;
+ __u8 bInterfaceSubClass;
+ __u8 bInterfaceProtocol;
+ __u8 iInterface;
+} __attribute__ ((packed));
+
+#define USB_DT_INTERFACE_SIZE 9
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_ENDPOINT: Endpoint descriptor */
+struct usb_endpoint_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __u8 bEndpointAddress;
+ __u8 bmAttributes;
+ __le16 wMaxPacketSize;
+ __u8 bInterval;
+
+ /* NOTE: these two are _only_ in audio endpoints. */
+ /* use USB_DT_ENDPOINT*_SIZE in bLength, not sizeof. */
+ __u8 bRefresh;
+ __u8 bSynchAddress;
+} __attribute__ ((packed));
+
+#define USB_DT_ENDPOINT_SIZE 7
+#define USB_DT_ENDPOINT_AUDIO_SIZE 9 /* Audio extension */
+
+
+/*
+ * Endpoints
+ */
+#define USB_ENDPOINT_NUMBER_MASK 0x0f /* in bEndpointAddress */
+#define USB_ENDPOINT_DIR_MASK 0x80
+
+#define USB_ENDPOINT_XFERTYPE_MASK 0x03 /* in bmAttributes */
+#define USB_ENDPOINT_XFER_CONTROL 0
+#define USB_ENDPOINT_XFER_ISOC 1
+#define USB_ENDPOINT_XFER_BULK 2
+#define USB_ENDPOINT_XFER_INT 3
+#define USB_ENDPOINT_MAX_ADJUSTABLE 0x80
+
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_DEVICE_QUALIFIER: Device Qualifier descriptor */
+struct usb_qualifier_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __le16 bcdUSB;
+ __u8 bDeviceClass;
+ __u8 bDeviceSubClass;
+ __u8 bDeviceProtocol;
+ __u8 bMaxPacketSize0;
+ __u8 bNumConfigurations;
+ __u8 bRESERVED;
+} __attribute__ ((packed));
+
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_OTG (from OTG 1.0a supplement) */
+struct usb_otg_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __u8 bmAttributes; /* support for HNP, SRP, etc */
+} __attribute__ ((packed));
+
+/* from usb_otg_descriptor.bmAttributes */
+#define USB_OTG_SRP (1 << 0)
+#define USB_OTG_HNP (1 << 1) /* swap host/device roles */
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_DEBUG: for special highspeed devices, replacing serial console */
+struct usb_debug_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ /* bulk endpoints with 8 byte maxpacket */
+ __u8 bDebugInEndpoint;
+ __u8 bDebugOutEndpoint;
+} __attribute__((packed));
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_INTERFACE_ASSOCIATION: groups interfaces */
+struct usb_interface_assoc_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __u8 bFirstInterface;
+ __u8 bInterfaceCount;
+ __u8 bFunctionClass;
+ __u8 bFunctionSubClass;
+ __u8 bFunctionProtocol;
+ __u8 iFunction;
+} __attribute__ ((packed));
+
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_SECURITY: group of wireless security descriptors, including
+ * encryption types available for setting up a CC/association.
+ */
+struct usb_security_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __le16 wTotalLength;
+ __u8 bNumEncryptionTypes;
+} __attribute__((packed));
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_KEY: used with {GET,SET}_SECURITY_DATA; only public keys
+ * may be retrieved.
+ */
+struct usb_key_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __u8 tTKID[3];
+ __u8 bReserved;
+ __u8 bKeyData[0];
+} __attribute__((packed));
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_ENCRYPTION_TYPE: bundled in DT_SECURITY groups */
+struct usb_encryption_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __u8 bEncryptionType;
+#define USB_ENC_TYPE_UNSECURE 0
+#define USB_ENC_TYPE_WIRED 1 /* non-wireless mode */
+#define USB_ENC_TYPE_CCM_1 2 /* aes128/cbc session */
+#define USB_ENC_TYPE_RSA_1 3 /* rsa3072/sha1 auth */
+ __u8 bEncryptionValue; /* use in SET_ENCRYPTION */
+ __u8 bAuthKeyIndex;
+} __attribute__((packed));
+
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_BOS: group of wireless capabilities */
+struct usb_bos_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __le16 wTotalLength;
+ __u8 bNumDeviceCaps;
+} __attribute__((packed));
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_DEVICE_CAPABILITY: grouped with BOS */
+struct usb_dev_cap_header {
+ __u8 bLength;
+ __u8 bDescriptorType;
+ __u8 bDevCapabilityType;
+} __attribute__((packed));
+
+#define USB_CAP_TYPE_WIRELESS_USB 1
+
+struct usb_wireless_cap_descriptor { /* Ultra Wide Band */
+ __u8 bLength;
+ __u8 bDescriptorType;
+ __u8 bDevCapabilityType;
+
+ __u8 bmAttributes;
+#define USB_WIRELESS_P2P_DRD (1 << 1)
+#define USB_WIRELESS_BEACON_MASK (3 << 2)
+#define USB_WIRELESS_BEACON_SELF (1 << 2)
+#define USB_WIRELESS_BEACON_DIRECTED (2 << 2)
+#define USB_WIRELESS_BEACON_NONE (3 << 2)
+ __le16 wPHYRates; /* bit rates, Mbps */
+#define USB_WIRELESS_PHY_53 (1 << 0) /* always set */
+#define USB_WIRELESS_PHY_80 (1 << 1)
+#define USB_WIRELESS_PHY_107 (1 << 2) /* always set */
+#define USB_WIRELESS_PHY_160 (1 << 3)
+#define USB_WIRELESS_PHY_200 (1 << 4) /* always set */
+#define USB_WIRELESS_PHY_320 (1 << 5)
+#define USB_WIRELESS_PHY_400 (1 << 6)
+#define USB_WIRELESS_PHY_480 (1 << 7)
+ __u8 bmTFITXPowerInfo; /* TFI power levels */
+ __u8 bmFFITXPowerInfo; /* FFI power levels */
+ __le16 bmBandGroup;
+ __u8 bReserved;
+} __attribute__((packed));
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_WIRELESS_ENDPOINT_COMP: companion descriptor associated with
+ * each endpoint descriptor for a wireless device
+ */
+struct usb_wireless_ep_comp_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __u8 bMaxBurst;
+ __u8 bMaxSequence;
+ __le16 wMaxStreamDelay;
+ __le16 wOverTheAirPacketSize;
+ __u8 bOverTheAirInterval;
+ __u8 bmCompAttributes;
+#define USB_ENDPOINT_SWITCH_MASK 0x03 /* in bmCompAttributes */
+#define USB_ENDPOINT_SWITCH_NO 0
+#define USB_ENDPOINT_SWITCH_SWITCH 1
+#define USB_ENDPOINT_SWITCH_SCALE 2
+} __attribute__((packed));
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_REQ_SET_HANDSHAKE is a four-way handshake used between a wireless
+ * host and a device for connection set up, mutual authentication, and
+ * exchanging short lived session keys. The handshake depends on a CC.
+ */
+struct usb_handshake {
+ __u8 bMessageNumber;
+ __u8 bStatus;
+ __u8 tTKID[3];
+ __u8 bReserved;
+ __u8 CDID[16];
+ __u8 nonce[16];
+ __u8 MIC[8];
+} __attribute__((packed));
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_REQ_SET_CONNECTION modifies or revokes a connection context (CC).
+ * A CC may also be set up using non-wireless secure channels (including
+ * wired USB!), and some devices may support CCs with multiple hosts.
+ */
+struct usb_connection_context {
+ __u8 CHID[16]; /* persistent host id */
+ __u8 CDID[16]; /* device id (unique w/in host context) */
+ __u8 CK[16]; /* connection key */
+} __attribute__((packed));
+
+/*-------------------------------------------------------------------------*/
+
+/* USB 2.0 defines three speeds, here's how Linux identifies them */
+
+enum usb_device_speed {
+ USB_SPEED_UNKNOWN = 0, /* enumerating */
+ USB_SPEED_LOW, USB_SPEED_FULL, /* usb 1.1 */
+ USB_SPEED_HIGH, /* usb 2.0 */
+ USB_SPEED_VARIABLE, /* wireless (usb 2.5) */
+};
+
+enum usb_device_state {
+ /* NOTATTACHED isn't in the USB spec, and this state acts
+ * the same as ATTACHED ... but it's clearer this way.
+ */
+ USB_STATE_NOTATTACHED = 0,
+
+ /* chapter 9 and authentication (wireless) device states */
+ USB_STATE_ATTACHED,
+ USB_STATE_POWERED, /* wired */
+ USB_STATE_UNAUTHENTICATED, /* auth */
+ USB_STATE_RECONNECTING, /* auth */
+ USB_STATE_DEFAULT, /* limited function */
+ USB_STATE_ADDRESS,
+ USB_STATE_CONFIGURED, /* most functions */
+
+ USB_STATE_SUSPENDED
+
+ /* NOTE: there are actually four different SUSPENDED
+ * states, returning to POWERED, DEFAULT, ADDRESS, or
+ * CONFIGURED respectively when SOF tokens flow again.
+ */
+};
+
+#endif /* __LINUX_USB_CH9_H */
diff --git a/sysroot/usr/include/linux/usb/gadgetfs.h b/sysroot/usr/include/linux/usb/gadgetfs.h
new file mode 100644
index 0000000..e8654c3
--- /dev/null
+++ b/sysroot/usr/include/linux/usb/gadgetfs.h
@@ -0,0 +1,81 @@
+#ifndef __LINUX_USB_GADGETFS_H
+#define __LINUX_USB_GADGETFS_H
+
+#include <asm/types.h>
+#include <asm/ioctl.h>
+
+#include <linux/usb/ch9.h>
+
+/*
+ * Filesystem based user-mode API to USB Gadget controller hardware
+ *
+ * Other than ep0 operations, most things are done by read() and write()
+ * on endpoint files found in one directory. They are configured by
+ * writing descriptors, and then may be used for normal stream style
+ * i/o requests. When ep0 is configured, the device can enumerate;
+ * when it's closed, the device disconnects from usb. Operations on
+ * ep0 require ioctl() operations.
+ *
+ * Configuration and device descriptors get written to /dev/gadget/$CHIP,
+ * which may then be used to read usb_gadgetfs_event structs. The driver
+ * may activate endpoints as it handles SET_CONFIGURATION setup events,
+ * or earlier; writing endpoint descriptors to /dev/gadget/$ENDPOINT
+ * then performing data transfers by reading or writing.
+ */
+
+/*
+ * Events are delivered on the ep0 file descriptor, when the user mode driver
+ * reads from this file descriptor after writing the descriptors. Don't
+ * stop polling this descriptor.
+ */
+
+enum usb_gadgetfs_event_type {
+ GADGETFS_NOP = 0,
+
+ GADGETFS_CONNECT,
+ GADGETFS_DISCONNECT,
+ GADGETFS_SETUP,
+ GADGETFS_SUSPEND,
+ // and likely more !
+};
+
+/* NOTE: this structure must stay the same size and layout on
+ * both 32-bit and 64-bit kernels.
+ */
+struct usb_gadgetfs_event {
+ union {
+ // NOP, DISCONNECT, SUSPEND: nothing
+ // ... some hardware can't report disconnection
+
+ // CONNECT: just the speed
+ enum usb_device_speed speed;
+
+ // SETUP: packet; DATA phase i/o precedes next event
+ // (setup.bmRequestType & USB_DIR_IN) flags direction
+ // ... includes SET_CONFIGURATION, SET_INTERFACE
+ struct usb_ctrlrequest setup;
+ } u;
+ enum usb_gadgetfs_event_type type;
+};
+
+
+/* endpoint ioctls */
+
+/* IN transfers may be reported to the gadget driver as complete
+ * when the fifo is loaded, before the host reads the data;
+ * OUT transfers may be reported to the host's "client" driver as
+ * complete when they're sitting in the FIFO unread.
+ * THIS returns how many bytes are "unclaimed" in the endpoint fifo
+ * (needed for precise fault handling, when the hardware allows it)
+ */
+#define GADGETFS_FIFO_STATUS _IO('g',1)
+
+/* discards any unclaimed data in the fifo. */
+#define GADGETFS_FIFO_FLUSH _IO('g',2)
+
+/* resets endpoint halt+toggle; used to implement set_interface.
+ * some hardware (like pxa2xx) can't support this.
+ */
+#define GADGETFS_CLEAR_HALT _IO('g',3)
+
+#endif /* __LINUX_USB_GADGETFS_H */
diff --git a/sysroot/usr/include/linux/usb/midi.h b/sysroot/usr/include/linux/usb/midi.h
new file mode 100644
index 0000000..11a97d5
--- /dev/null
+++ b/sysroot/usr/include/linux/usb/midi.h
@@ -0,0 +1,112 @@
+/*
+ * <linux/usb/midi.h> -- USB MIDI definitions.
+ *
+ * Copyright (C) 2006 Thumtronics Pty Ltd.
+ * Developed for Thumtronics by Grey Innovation
+ * Ben Williamson <ben.williamson@greyinnovation.com>
+ *
+ * This software is distributed under the terms of the GNU General Public
+ * License ("GPL") version 2, as published by the Free Software Foundation.
+ *
+ * This file holds USB constants and structures defined
+ * by the USB Device Class Definition for MIDI Devices.
+ * Comments below reference relevant sections of that document:
+ *
+ * http://www.usb.org/developers/devclass_docs/midi10.pdf
+ */
+
+#ifndef __LINUX_USB_MIDI_H
+#define __LINUX_USB_MIDI_H
+
+#include <linux/types.h>
+
+/* A.1 MS Class-Specific Interface Descriptor Subtypes */
+#define USB_MS_HEADER 0x01
+#define USB_MS_MIDI_IN_JACK 0x02
+#define USB_MS_MIDI_OUT_JACK 0x03
+#define USB_MS_ELEMENT 0x04
+
+/* A.2 MS Class-Specific Endpoint Descriptor Subtypes */
+#define USB_MS_GENERAL 0x01
+
+/* A.3 MS MIDI IN and OUT Jack Types */
+#define USB_MS_EMBEDDED 0x01
+#define USB_MS_EXTERNAL 0x02
+
+/* 6.1.2.1 Class-Specific MS Interface Header Descriptor */
+struct usb_ms_header_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+ __u8 bDescriptorSubtype;
+ __le16 bcdMSC;
+ __le16 wTotalLength;
+} __attribute__ ((packed));
+
+#define USB_DT_MS_HEADER_SIZE 7
+
+/* 6.1.2.2 MIDI IN Jack Descriptor */
+struct usb_midi_in_jack_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType; // USB_DT_CS_INTERFACE
+ __u8 bDescriptorSubtype; // USB_MS_MIDI_IN_JACK
+ __u8 bJackType; // USB_MS_EMBEDDED/EXTERNAL
+ __u8 bJackID;
+ __u8 iJack;
+} __attribute__ ((packed));
+
+#define USB_DT_MIDI_IN_SIZE 6
+
+struct usb_midi_source_pin {
+ __u8 baSourceID;
+ __u8 baSourcePin;
+} __attribute__ ((packed));
+
+/* 6.1.2.3 MIDI OUT Jack Descriptor */
+struct usb_midi_out_jack_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType; // USB_DT_CS_INTERFACE
+ __u8 bDescriptorSubtype; // USB_MS_MIDI_OUT_JACK
+ __u8 bJackType; // USB_MS_EMBEDDED/EXTERNAL
+ __u8 bJackID;
+ __u8 bNrInputPins; // p
+ struct usb_midi_source_pin pins[]; // [p]
+ /*__u8 iJack; -- ommitted due to variable-sized pins[] */
+} __attribute__ ((packed));
+
+#define USB_DT_MIDI_OUT_SIZE(p) (7 + 2 * (p))
+
+/* As above, but more useful for defining your own descriptors: */
+#define DECLARE_USB_MIDI_OUT_JACK_DESCRIPTOR(p) \
+struct usb_midi_out_jack_descriptor_##p { \
+ __u8 bLength; \
+ __u8 bDescriptorType; \
+ __u8 bDescriptorSubtype; \
+ __u8 bJackType; \
+ __u8 bJackID; \
+ __u8 bNrInputPins; \
+ struct usb_midi_source_pin pins[p]; \
+ __u8 iJack; \
+} __attribute__ ((packed))
+
+/* 6.2.2 Class-Specific MS Bulk Data Endpoint Descriptor */
+struct usb_ms_endpoint_descriptor {
+ __u8 bLength; // 4+n
+ __u8 bDescriptorType; // USB_DT_CS_ENDPOINT
+ __u8 bDescriptorSubtype; // USB_MS_GENERAL
+ __u8 bNumEmbMIDIJack; // n
+ __u8 baAssocJackID[]; // [n]
+} __attribute__ ((packed));
+
+#define USB_DT_MS_ENDPOINT_SIZE(n) (4 + (n))
+
+/* As above, but more useful for defining your own descriptors: */
+#define DECLARE_USB_MS_ENDPOINT_DESCRIPTOR(n) \
+struct usb_ms_endpoint_descriptor_##n { \
+ __u8 bLength; \
+ __u8 bDescriptorType; \
+ __u8 bDescriptorSubtype; \
+ __u8 bNumEmbMIDIJack; \
+ __u8 baAssocJackID[n]; \
+} __attribute__ ((packed))
+
+#endif
diff --git a/sysroot/usr/include/linux/usbdevice_fs.h b/sysroot/usr/include/linux/usbdevice_fs.h
new file mode 100644
index 0000000..b388dd8
--- /dev/null
+++ b/sysroot/usr/include/linux/usbdevice_fs.h
@@ -0,0 +1,151 @@
+/*****************************************************************************/
+
+/*
+ * usbdevice_fs.h -- USB device file system.
+ *
+ * Copyright (C) 2000
+ * Thomas Sailer (sailer@ife.ee.ethz.ch)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * History:
+ * 0.1 04.01.2000 Created
+ *
+ * $Id: usbdevice_fs.h,v 1.1 2000/01/06 18:40:41 tom Exp $
+ */
+
+/*****************************************************************************/
+
+#ifndef _LINUX_USBDEVICE_FS_H
+#define _LINUX_USBDEVICE_FS_H
+
+#include <linux/types.h>
+#include <linux/magic.h>
+
+/* --------------------------------------------------------------------- */
+
+/* usbdevfs ioctl codes */
+
+struct usbdevfs_ctrltransfer {
+ __u8 bRequestType;
+ __u8 bRequest;
+ __u16 wValue;
+ __u16 wIndex;
+ __u16 wLength;
+ __u32 timeout; /* in milliseconds */
+ void *data;
+};
+
+struct usbdevfs_bulktransfer {
+ unsigned int ep;
+ unsigned int len;
+ unsigned int timeout; /* in milliseconds */
+ void *data;
+};
+
+struct usbdevfs_setinterface {
+ unsigned int interface;
+ unsigned int altsetting;
+};
+
+struct usbdevfs_disconnectsignal {
+ unsigned int signr;
+ void *context;
+};
+
+#define USBDEVFS_MAXDRIVERNAME 255
+
+struct usbdevfs_getdriver {
+ unsigned int interface;
+ char driver[USBDEVFS_MAXDRIVERNAME + 1];
+};
+
+struct usbdevfs_connectinfo {
+ unsigned int devnum;
+ unsigned char slow;
+};
+
+#define USBDEVFS_URB_SHORT_NOT_OK 1
+#define USBDEVFS_URB_ISO_ASAP 2
+
+#define USBDEVFS_URB_TYPE_ISO 0
+#define USBDEVFS_URB_TYPE_INTERRUPT 1
+#define USBDEVFS_URB_TYPE_CONTROL 2
+#define USBDEVFS_URB_TYPE_BULK 3
+
+struct usbdevfs_iso_packet_desc {
+ unsigned int length;
+ unsigned int actual_length;
+ unsigned int status;
+};
+
+struct usbdevfs_urb {
+ unsigned char type;
+ unsigned char endpoint;
+ int status;
+ unsigned int flags;
+ void *buffer;
+ int buffer_length;
+ int actual_length;
+ int start_frame;
+ int number_of_packets;
+ int error_count;
+ unsigned int signr; /* signal to be sent on completion,
+ or 0 if none should be sent. */
+ void *usercontext;
+ struct usbdevfs_iso_packet_desc iso_frame_desc[0];
+};
+
+/* ioctls for talking directly to drivers */
+struct usbdevfs_ioctl {
+ int ifno; /* interface 0..N ; negative numbers reserved */
+ int ioctl_code; /* MUST encode size + direction of data so the
+ * macros in <asm/ioctl.h> give correct values */
+ void *data; /* param buffer (in, or out) */
+};
+
+/* You can do most things with hubs just through control messages,
+ * except find out what device connects to what port. */
+struct usbdevfs_hub_portinfo {
+ char nports; /* number of downstream ports in this hub */
+ char port [127]; /* e.g. port 3 connects to device 27 */
+};
+
+
+#define USBDEVFS_CONTROL _IOWR('U', 0, struct usbdevfs_ctrltransfer)
+#define USBDEVFS_BULK _IOWR('U', 2, struct usbdevfs_bulktransfer)
+#define USBDEVFS_RESETEP _IOR('U', 3, unsigned int)
+#define USBDEVFS_SETINTERFACE _IOR('U', 4, struct usbdevfs_setinterface)
+#define USBDEVFS_SETCONFIGURATION _IOR('U', 5, unsigned int)
+#define USBDEVFS_GETDRIVER _IOW('U', 8, struct usbdevfs_getdriver)
+#define USBDEVFS_SUBMITURB _IOR('U', 10, struct usbdevfs_urb)
+#define USBDEVFS_SUBMITURB32 _IOR('U', 10, struct usbdevfs_urb32)
+#define USBDEVFS_DISCARDURB _IO('U', 11)
+#define USBDEVFS_REAPURB _IOW('U', 12, void *)
+#define USBDEVFS_REAPURB32 _IOW('U', 12, __u32)
+#define USBDEVFS_REAPURBNDELAY _IOW('U', 13, void *)
+#define USBDEVFS_REAPURBNDELAY32 _IOW('U', 13, __u32)
+#define USBDEVFS_DISCSIGNAL _IOR('U', 14, struct usbdevfs_disconnectsignal)
+#define USBDEVFS_CLAIMINTERFACE _IOR('U', 15, unsigned int)
+#define USBDEVFS_RELEASEINTERFACE _IOR('U', 16, unsigned int)
+#define USBDEVFS_CONNECTINFO _IOW('U', 17, struct usbdevfs_connectinfo)
+#define USBDEVFS_IOCTL _IOWR('U', 18, struct usbdevfs_ioctl)
+#define USBDEVFS_IOCTL32 _IOWR('U', 18, struct usbdevfs_ioctl32)
+#define USBDEVFS_HUB_PORTINFO _IOR('U', 19, struct usbdevfs_hub_portinfo)
+#define USBDEVFS_RESET _IO('U', 20)
+#define USBDEVFS_CLEAR_HALT _IOR('U', 21, unsigned int)
+#define USBDEVFS_DISCONNECT _IO('U', 22)
+#define USBDEVFS_CONNECT _IO('U', 23)
+#endif /* _LINUX_USBDEVICE_FS_H */
diff --git a/sysroot/usr/include/linux/user.h b/sysroot/usr/include/linux/user.h
new file mode 100644
index 0000000..68daf84
--- /dev/null
+++ b/sysroot/usr/include/linux/user.h
@@ -0,0 +1 @@
+#include <asm/user.h>
diff --git a/sysroot/usr/include/linux/utime.h b/sysroot/usr/include/linux/utime.h
new file mode 100644
index 0000000..640be6a
--- /dev/null
+++ b/sysroot/usr/include/linux/utime.h
@@ -0,0 +1,11 @@
+#ifndef _LINUX_UTIME_H
+#define _LINUX_UTIME_H
+
+#include <linux/types.h>
+
+struct utimbuf {
+ time_t actime;
+ time_t modtime;
+};
+
+#endif
diff --git a/sysroot/usr/include/linux/utsname.h b/sysroot/usr/include/linux/utsname.h
new file mode 100644
index 0000000..ff71a1a
--- /dev/null
+++ b/sysroot/usr/include/linux/utsname.h
@@ -0,0 +1,34 @@
+#ifndef _LINUX_UTSNAME_H
+#define _LINUX_UTSNAME_H
+
+#define __OLD_UTS_LEN 8
+
+struct oldold_utsname {
+ char sysname[9];
+ char nodename[9];
+ char release[9];
+ char version[9];
+ char machine[9];
+};
+
+#define __NEW_UTS_LEN 64
+
+struct old_utsname {
+ char sysname[65];
+ char nodename[65];
+ char release[65];
+ char version[65];
+ char machine[65];
+};
+
+struct new_utsname {
+ char sysname[65];
+ char nodename[65];
+ char release[65];
+ char version[65];
+ char machine[65];
+ char domainname[65];
+};
+
+
+#endif /* _LINUX_UTSNAME_H */
diff --git a/sysroot/usr/include/linux/version.h b/sysroot/usr/include/linux/version.h
new file mode 100644
index 0000000..57aa88f
--- /dev/null
+++ b/sysroot/usr/include/linux/version.h
@@ -0,0 +1,2 @@
+#define LINUX_VERSION_CODE 132632
+#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
diff --git a/sysroot/usr/include/linux/veth.h b/sysroot/usr/include/linux/veth.h
new file mode 100644
index 0000000..3354c1e
--- /dev/null
+++ b/sysroot/usr/include/linux/veth.h
@@ -0,0 +1,12 @@
+#ifndef __NET_VETH_H_
+#define __NET_VETH_H_
+
+enum {
+ VETH_INFO_UNSPEC,
+ VETH_INFO_PEER,
+
+ __VETH_INFO_MAX
+#define VETH_INFO_MAX (__VETH_INFO_MAX - 1)
+};
+
+#endif
diff --git a/sysroot/usr/include/linux/video_decoder.h b/sysroot/usr/include/linux/video_decoder.h
new file mode 100644
index 0000000..121e26d
--- /dev/null
+++ b/sysroot/usr/include/linux/video_decoder.h
@@ -0,0 +1,46 @@
+#ifndef _LINUX_VIDEO_DECODER_H
+#define _LINUX_VIDEO_DECODER_H
+
+#define HAVE_VIDEO_DECODER 1
+
+struct video_decoder_capability { /* this name is too long */
+ __u32 flags;
+#define VIDEO_DECODER_PAL 1 /* can decode PAL signal */
+#define VIDEO_DECODER_NTSC 2 /* can decode NTSC */
+#define VIDEO_DECODER_SECAM 4 /* can decode SECAM */
+#define VIDEO_DECODER_AUTO 8 /* can autosense norm */
+#define VIDEO_DECODER_CCIR 16 /* CCIR-601 pixel rate (720 pixels per line) instead of square pixel rate */
+ int inputs; /* number of inputs */
+ int outputs; /* number of outputs */
+};
+
+/*
+DECODER_GET_STATUS returns the following flags. The only one you need is
+DECODER_STATUS_GOOD, the others are just nice things to know.
+*/
+#define DECODER_STATUS_GOOD 1 /* receiving acceptable input */
+#define DECODER_STATUS_COLOR 2 /* receiving color information */
+#define DECODER_STATUS_PAL 4 /* auto detected */
+#define DECODER_STATUS_NTSC 8 /* auto detected */
+#define DECODER_STATUS_SECAM 16 /* auto detected */
+
+struct video_decoder_init {
+ unsigned char len;
+ const unsigned char *data;
+};
+
+#define DECODER_GET_CAPABILITIES _IOR('d', 1, struct video_decoder_capability)
+#define DECODER_GET_STATUS _IOR('d', 2, int)
+#define DECODER_SET_NORM _IOW('d', 3, int)
+#define DECODER_SET_INPUT _IOW('d', 4, int) /* 0 <= input < #inputs */
+#define DECODER_SET_OUTPUT _IOW('d', 5, int) /* 0 <= output < #outputs */
+#define DECODER_ENABLE_OUTPUT _IOW('d', 6, int) /* boolean output enable control */
+#define DECODER_SET_PICTURE _IOW('d', 7, struct video_picture)
+#define DECODER_SET_GPIO _IOW('d', 8, int) /* switch general purpose pin */
+#define DECODER_INIT _IOW('d', 9, struct video_decoder_init) /* init internal registers at once */
+#define DECODER_SET_VBI_BYPASS _IOW('d', 10, int) /* switch vbi bypass */
+
+#define DECODER_DUMP _IO('d', 192) /* debug hook */
+
+
+#endif
diff --git a/sysroot/usr/include/linux/video_encoder.h b/sysroot/usr/include/linux/video_encoder.h
new file mode 100644
index 0000000..4b0e690
--- /dev/null
+++ b/sysroot/usr/include/linux/video_encoder.h
@@ -0,0 +1,21 @@
+#ifndef _LINUX_VIDEO_ENCODER_H
+#define _LINUX_VIDEO_ENCODER_H
+
+struct video_encoder_capability { /* this name is too long */
+ __u32 flags;
+#define VIDEO_ENCODER_PAL 1 /* can encode PAL signal */
+#define VIDEO_ENCODER_NTSC 2 /* can encode NTSC */
+#define VIDEO_ENCODER_SECAM 4 /* can encode SECAM */
+#define VIDEO_ENCODER_CCIR 16 /* CCIR-601 pixel rate (720 pixels per line) instead of square pixel rate */
+ int inputs; /* number of inputs */
+ int outputs; /* number of outputs */
+};
+
+#define ENCODER_GET_CAPABILITIES _IOR('e', 1, struct video_encoder_capability)
+#define ENCODER_SET_NORM _IOW('e', 2, int)
+#define ENCODER_SET_INPUT _IOW('e', 3, int) /* 0 <= input < #inputs */
+#define ENCODER_SET_OUTPUT _IOW('e', 4, int) /* 0 <= output < #outputs */
+#define ENCODER_ENABLE_OUTPUT _IOW('e', 5, int) /* boolean output enable control */
+
+
+#endif
diff --git a/sysroot/usr/include/linux/videodev.h b/sysroot/usr/include/linux/videodev.h
new file mode 100644
index 0000000..9c04d74
--- /dev/null
+++ b/sysroot/usr/include/linux/videodev.h
@@ -0,0 +1,305 @@
+/*
+ * Video for Linux version 1 - OBSOLETE
+ *
+ * Header file for v4l1 drivers and applications, for
+ * Linux kernels 2.2.x or 2.4.x.
+ *
+ * Provides header for legacy drivers and applications
+ *
+ * See http://linuxtv.org for more info
+ *
+ */
+#ifndef __LINUX_VIDEODEV_H
+#define __LINUX_VIDEODEV_H
+
+#include <linux/videodev2.h>
+
+#if defined(CONFIG_VIDEO_V4L1_COMPAT) || !defined (__KERNEL__)
+
+struct video_capability
+{
+ char name[32];
+ int type;
+ int channels; /* Num channels */
+ int audios; /* Num audio devices */
+ int maxwidth; /* Supported width */
+ int maxheight; /* And height */
+ int minwidth; /* Supported width */
+ int minheight; /* And height */
+};
+
+
+struct video_channel
+{
+ int channel;
+ char name[32];
+ int tuners;
+ __u32 flags;
+#define VIDEO_VC_TUNER 1 /* Channel has a tuner */
+#define VIDEO_VC_AUDIO 2 /* Channel has audio */
+ __u16 type;
+#define VIDEO_TYPE_TV 1
+#define VIDEO_TYPE_CAMERA 2
+ __u16 norm; /* Norm set by channel */
+};
+
+struct video_tuner
+{
+ int tuner;
+ char name[32];
+ unsigned long rangelow, rangehigh; /* Tuner range */
+ __u32 flags;
+#define VIDEO_TUNER_PAL 1
+#define VIDEO_TUNER_NTSC 2
+#define VIDEO_TUNER_SECAM 4
+#define VIDEO_TUNER_LOW 8 /* Uses KHz not MHz */
+#define VIDEO_TUNER_NORM 16 /* Tuner can set norm */
+#define VIDEO_TUNER_STEREO_ON 128 /* Tuner is seeing stereo */
+#define VIDEO_TUNER_RDS_ON 256 /* Tuner is seeing an RDS datastream */
+#define VIDEO_TUNER_MBS_ON 512 /* Tuner is seeing an MBS datastream */
+ __u16 mode; /* PAL/NTSC/SECAM/OTHER */
+#define VIDEO_MODE_PAL 0
+#define VIDEO_MODE_NTSC 1
+#define VIDEO_MODE_SECAM 2
+#define VIDEO_MODE_AUTO 3
+ __u16 signal; /* Signal strength 16bit scale */
+};
+
+struct video_picture
+{
+ __u16 brightness;
+ __u16 hue;
+ __u16 colour;
+ __u16 contrast;
+ __u16 whiteness; /* Black and white only */
+ __u16 depth; /* Capture depth */
+ __u16 palette; /* Palette in use */
+#define VIDEO_PALETTE_GREY 1 /* Linear greyscale */
+#define VIDEO_PALETTE_HI240 2 /* High 240 cube (BT848) */
+#define VIDEO_PALETTE_RGB565 3 /* 565 16 bit RGB */
+#define VIDEO_PALETTE_RGB24 4 /* 24bit RGB */
+#define VIDEO_PALETTE_RGB32 5 /* 32bit RGB */
+#define VIDEO_PALETTE_RGB555 6 /* 555 15bit RGB */
+#define VIDEO_PALETTE_YUV422 7 /* YUV422 capture */
+#define VIDEO_PALETTE_YUYV 8
+#define VIDEO_PALETTE_UYVY 9 /* The great thing about standards is ... */
+#define VIDEO_PALETTE_YUV420 10
+#define VIDEO_PALETTE_YUV411 11 /* YUV411 capture */
+#define VIDEO_PALETTE_RAW 12 /* RAW capture (BT848) */
+#define VIDEO_PALETTE_YUV422P 13 /* YUV 4:2:2 Planar */
+#define VIDEO_PALETTE_YUV411P 14 /* YUV 4:1:1 Planar */
+#define VIDEO_PALETTE_YUV420P 15 /* YUV 4:2:0 Planar */
+#define VIDEO_PALETTE_YUV410P 16 /* YUV 4:1:0 Planar */
+#define VIDEO_PALETTE_PLANAR 13 /* start of planar entries */
+#define VIDEO_PALETTE_COMPONENT 7 /* start of component entries */
+};
+
+struct video_audio
+{
+ int audio; /* Audio channel */
+ __u16 volume; /* If settable */
+ __u16 bass, treble;
+ __u32 flags;
+#define VIDEO_AUDIO_MUTE 1
+#define VIDEO_AUDIO_MUTABLE 2
+#define VIDEO_AUDIO_VOLUME 4
+#define VIDEO_AUDIO_BASS 8
+#define VIDEO_AUDIO_TREBLE 16
+#define VIDEO_AUDIO_BALANCE 32
+ char name[16];
+#define VIDEO_SOUND_MONO 1
+#define VIDEO_SOUND_STEREO 2
+#define VIDEO_SOUND_LANG1 4
+#define VIDEO_SOUND_LANG2 8
+ __u16 mode;
+ __u16 balance; /* Stereo balance */
+ __u16 step; /* Step actual volume uses */
+};
+
+struct video_clip
+{
+ __s32 x,y;
+ __s32 width, height;
+ struct video_clip *next; /* For user use/driver use only */
+};
+
+struct video_window
+{
+ __u32 x,y; /* Position of window */
+ __u32 width,height; /* Its size */
+ __u32 chromakey;
+ __u32 flags;
+ struct video_clip *clips; /* Set only */
+ int clipcount;
+#define VIDEO_WINDOW_INTERLACE 1
+#define VIDEO_WINDOW_CHROMAKEY 16 /* Overlay by chromakey */
+#define VIDEO_CLIP_BITMAP -1
+/* bitmap is 1024x625, a '1' bit represents a clipped pixel */
+#define VIDEO_CLIPMAP_SIZE (128 * 625)
+};
+
+struct video_capture
+{
+ __u32 x,y; /* Offsets into image */
+ __u32 width, height; /* Area to capture */
+ __u16 decimation; /* Decimation divider */
+ __u16 flags; /* Flags for capture */
+#define VIDEO_CAPTURE_ODD 0 /* Temporal */
+#define VIDEO_CAPTURE_EVEN 1
+};
+
+struct video_buffer
+{
+ void *base;
+ int height,width;
+ int depth;
+ int bytesperline;
+};
+
+struct video_mmap
+{
+ unsigned int frame; /* Frame (0 - n) for double buffer */
+ int height,width;
+ unsigned int format; /* should be VIDEO_PALETTE_* */
+};
+
+struct video_key
+{
+ __u8 key[8];
+ __u32 flags;
+};
+
+struct video_mbuf
+{
+ int size; /* Total memory to map */
+ int frames; /* Frames */
+ int offsets[VIDEO_MAX_FRAME];
+};
+
+#define VIDEO_NO_UNIT (-1)
+
+struct video_unit
+{
+ int video; /* Video minor */
+ int vbi; /* VBI minor */
+ int radio; /* Radio minor */
+ int audio; /* Audio minor */
+ int teletext; /* Teletext minor */
+};
+
+struct vbi_format {
+ __u32 sampling_rate; /* in Hz */
+ __u32 samples_per_line;
+ __u32 sample_format; /* VIDEO_PALETTE_RAW only (1 byte) */
+ __s32 start[2]; /* starting line for each frame */
+ __u32 count[2]; /* count of lines for each frame */
+ __u32 flags;
+#define VBI_UNSYNC 1 /* can distingues between top/bottom field */
+#define VBI_INTERLACED 2 /* lines are interlaced */
+};
+
+/* video_info is biased towards hardware mpeg encode/decode */
+/* but it could apply generically to any hardware compressor/decompressor */
+struct video_info
+{
+ __u32 frame_count; /* frames output since decode/encode began */
+ __u32 h_size; /* current unscaled horizontal size */
+ __u32 v_size; /* current unscaled veritcal size */
+ __u32 smpte_timecode; /* current SMPTE timecode (for current GOP) */
+ __u32 picture_type; /* current picture type */
+ __u32 temporal_reference; /* current temporal reference */
+ __u8 user_data[256]; /* user data last found in compressed stream */
+ /* user_data[0] contains user data flags, user_data[1] has count */
+};
+
+/* generic structure for setting playback modes */
+struct video_play_mode
+{
+ int mode;
+ int p1;
+ int p2;
+};
+
+/* for loading microcode / fpga programming */
+struct video_code
+{
+ char loadwhat[16]; /* name or tag of file being passed */
+ int datasize;
+ __u8 *data;
+};
+
+#define VIDIOCGCAP _IOR('v',1,struct video_capability) /* Get capabilities */
+#define VIDIOCGCHAN _IOWR('v',2,struct video_channel) /* Get channel info (sources) */
+#define VIDIOCSCHAN _IOW('v',3,struct video_channel) /* Set channel */
+#define VIDIOCGTUNER _IOWR('v',4,struct video_tuner) /* Get tuner abilities */
+#define VIDIOCSTUNER _IOW('v',5,struct video_tuner) /* Tune the tuner for the current channel */
+#define VIDIOCGPICT _IOR('v',6,struct video_picture) /* Get picture properties */
+#define VIDIOCSPICT _IOW('v',7,struct video_picture) /* Set picture properties */
+#define VIDIOCCAPTURE _IOW('v',8,int) /* Start, end capture */
+#define VIDIOCGWIN _IOR('v',9, struct video_window) /* Get the video overlay window */
+#define VIDIOCSWIN _IOW('v',10, struct video_window) /* Set the video overlay window - passes clip list for hardware smarts , chromakey etc */
+#define VIDIOCGFBUF _IOR('v',11, struct video_buffer) /* Get frame buffer */
+#define VIDIOCSFBUF _IOW('v',12, struct video_buffer) /* Set frame buffer - root only */
+#define VIDIOCKEY _IOR('v',13, struct video_key) /* Video key event - to dev 255 is to all - cuts capture on all DMA windows with this key (0xFFFFFFFF == all) */
+#define VIDIOCGFREQ _IOR('v',14, unsigned long) /* Set tuner */
+#define VIDIOCSFREQ _IOW('v',15, unsigned long) /* Set tuner */
+#define VIDIOCGAUDIO _IOR('v',16, struct video_audio) /* Get audio info */
+#define VIDIOCSAUDIO _IOW('v',17, struct video_audio) /* Audio source, mute etc */
+#define VIDIOCSYNC _IOW('v',18, int) /* Sync with mmap grabbing */
+#define VIDIOCMCAPTURE _IOW('v',19, struct video_mmap) /* Grab frames */
+#define VIDIOCGMBUF _IOR('v',20, struct video_mbuf) /* Memory map buffer info */
+#define VIDIOCGUNIT _IOR('v',21, struct video_unit) /* Get attached units */
+#define VIDIOCGCAPTURE _IOR('v',22, struct video_capture) /* Get subcapture */
+#define VIDIOCSCAPTURE _IOW('v',23, struct video_capture) /* Set subcapture */
+#define VIDIOCSPLAYMODE _IOW('v',24, struct video_play_mode) /* Set output video mode/feature */
+#define VIDIOCSWRITEMODE _IOW('v',25, int) /* Set write mode */
+#define VIDIOCGPLAYINFO _IOR('v',26, struct video_info) /* Get current playback info from hardware */
+#define VIDIOCSMICROCODE _IOW('v',27, struct video_code) /* Load microcode into hardware */
+#define VIDIOCGVBIFMT _IOR('v',28, struct vbi_format) /* Get VBI information */
+#define VIDIOCSVBIFMT _IOW('v',29, struct vbi_format) /* Set VBI information */
+
+
+#define BASE_VIDIOCPRIVATE 192 /* 192-255 are private */
+
+/* VIDIOCSWRITEMODE */
+#define VID_WRITE_MPEG_AUD 0
+#define VID_WRITE_MPEG_VID 1
+#define VID_WRITE_OSD 2
+#define VID_WRITE_TTX 3
+#define VID_WRITE_CC 4
+#define VID_WRITE_MJPEG 5
+
+/* VIDIOCSPLAYMODE */
+#define VID_PLAY_VID_OUT_MODE 0
+ /* p1: = VIDEO_MODE_PAL, VIDEO_MODE_NTSC, etc ... */
+#define VID_PLAY_GENLOCK 1
+ /* p1: 0 = OFF, 1 = ON */
+ /* p2: GENLOCK FINE DELAY value */
+#define VID_PLAY_NORMAL 2
+#define VID_PLAY_PAUSE 3
+#define VID_PLAY_SINGLE_FRAME 4
+#define VID_PLAY_FAST_FORWARD 5
+#define VID_PLAY_SLOW_MOTION 6
+#define VID_PLAY_IMMEDIATE_NORMAL 7
+#define VID_PLAY_SWITCH_CHANNELS 8
+#define VID_PLAY_FREEZE_FRAME 9
+#define VID_PLAY_STILL_MODE 10
+#define VID_PLAY_MASTER_MODE 11
+ /* p1: see below */
+#define VID_PLAY_MASTER_NONE 1
+#define VID_PLAY_MASTER_VIDEO 2
+#define VID_PLAY_MASTER_AUDIO 3
+#define VID_PLAY_ACTIVE_SCANLINES 12
+ /* p1 = first active; p2 = last active */
+#define VID_PLAY_RESET 13
+#define VID_PLAY_END_MARK 14
+
+#endif /* CONFIG_VIDEO_V4L1_COMPAT */
+
+#endif /* __LINUX_VIDEODEV_H */
+
+/*
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */
diff --git a/sysroot/usr/include/linux/videodev2.h b/sysroot/usr/include/linux/videodev2.h
new file mode 100644
index 0000000..761ccc9
--- /dev/null
+++ b/sysroot/usr/include/linux/videodev2.h
@@ -0,0 +1,1412 @@
+/*
+ * Video for Linux Two header file
+ *
+ * Copyright (C) 1999-2007 the contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * Alternatively you can redistribute this file under the terms of the
+ * BSD license as stated below:
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. The names of its contributors may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Header file for v4l or V4L2 drivers and applications
+ * with public API.
+ * All kernel-specific stuff were moved to media/v4l2-dev.h, so
+ * no #if __KERNEL tests are allowed here
+ *
+ * See http://linuxtv.org for more info
+ *
+ * Author: Bill Dirks <bill@thedirks.org>
+ * Justin Schoeman
+ * Hans Verkuil <hverkuil@xs4all.nl>
+ * et al.
+ */
+#ifndef __LINUX_VIDEODEV2_H
+#define __LINUX_VIDEODEV2_H
+#define __user
+#include <sys/time.h>
+#include <linux/types.h>
+
+/*
+ * Common stuff for both V4L1 and V4L2
+ * Moved from videodev.h
+ */
+#define VIDEO_MAX_FRAME 32
+
+#define VID_TYPE_CAPTURE 1 /* Can capture */
+#define VID_TYPE_TUNER 2 /* Can tune */
+#define VID_TYPE_TELETEXT 4 /* Does teletext */
+#define VID_TYPE_OVERLAY 8 /* Overlay onto frame buffer */
+#define VID_TYPE_CHROMAKEY 16 /* Overlay by chromakey */
+#define VID_TYPE_CLIPPING 32 /* Can clip */
+#define VID_TYPE_FRAMERAM 64 /* Uses the frame buffer memory */
+#define VID_TYPE_SCALES 128 /* Scalable */
+#define VID_TYPE_MONOCHROME 256 /* Monochrome only */
+#define VID_TYPE_SUBCAPTURE 512 /* Can capture subareas of the image */
+#define VID_TYPE_MPEG_DECODER 1024 /* Can decode MPEG streams */
+#define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */
+#define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */
+#define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */
+
+/*
+ * M I S C E L L A N E O U S
+ */
+
+/* Four-character-code (FOURCC) */
+#define v4l2_fourcc(a,b,c,d)\
+ (((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24))
+
+/*
+ * E N U M S
+ */
+enum v4l2_field {
+ V4L2_FIELD_ANY = 0, /* driver can choose from none,
+ top, bottom, interlaced
+ depending on whatever it thinks
+ is approximate ... */
+ V4L2_FIELD_NONE = 1, /* this device has no fields ... */
+ V4L2_FIELD_TOP = 2, /* top field only */
+ V4L2_FIELD_BOTTOM = 3, /* bottom field only */
+ V4L2_FIELD_INTERLACED = 4, /* both fields interlaced */
+ V4L2_FIELD_SEQ_TB = 5, /* both fields sequential into one
+ buffer, top-bottom order */
+ V4L2_FIELD_SEQ_BT = 6, /* same as above + bottom-top order */
+ V4L2_FIELD_ALTERNATE = 7, /* both fields alternating into
+ separate buffers */
+ V4L2_FIELD_INTERLACED_TB = 8, /* both fields interlaced, top field
+ first and the top field is
+ transmitted first */
+ V4L2_FIELD_INTERLACED_BT = 9, /* both fields interlaced, top field
+ first and the bottom field is
+ transmitted first */
+};
+#define V4L2_FIELD_HAS_TOP(field) \
+ ((field) == V4L2_FIELD_TOP ||\
+ (field) == V4L2_FIELD_INTERLACED ||\
+ (field) == V4L2_FIELD_INTERLACED_TB ||\
+ (field) == V4L2_FIELD_INTERLACED_BT ||\
+ (field) == V4L2_FIELD_SEQ_TB ||\
+ (field) == V4L2_FIELD_SEQ_BT)
+#define V4L2_FIELD_HAS_BOTTOM(field) \
+ ((field) == V4L2_FIELD_BOTTOM ||\
+ (field) == V4L2_FIELD_INTERLACED ||\
+ (field) == V4L2_FIELD_INTERLACED_TB ||\
+ (field) == V4L2_FIELD_INTERLACED_BT ||\
+ (field) == V4L2_FIELD_SEQ_TB ||\
+ (field) == V4L2_FIELD_SEQ_BT)
+#define V4L2_FIELD_HAS_BOTH(field) \
+ ((field) == V4L2_FIELD_INTERLACED ||\
+ (field) == V4L2_FIELD_INTERLACED_TB ||\
+ (field) == V4L2_FIELD_INTERLACED_BT ||\
+ (field) == V4L2_FIELD_SEQ_TB ||\
+ (field) == V4L2_FIELD_SEQ_BT)
+
+enum v4l2_buf_type {
+ V4L2_BUF_TYPE_VIDEO_CAPTURE = 1,
+ V4L2_BUF_TYPE_VIDEO_OUTPUT = 2,
+ V4L2_BUF_TYPE_VIDEO_OVERLAY = 3,
+ V4L2_BUF_TYPE_VBI_CAPTURE = 4,
+ V4L2_BUF_TYPE_VBI_OUTPUT = 5,
+ V4L2_BUF_TYPE_SLICED_VBI_CAPTURE = 6,
+ V4L2_BUF_TYPE_SLICED_VBI_OUTPUT = 7,
+#if 1
+ /* Experimental */
+ V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY = 8,
+#endif
+ V4L2_BUF_TYPE_PRIVATE = 0x80,
+};
+
+enum v4l2_ctrl_type {
+ V4L2_CTRL_TYPE_INTEGER = 1,
+ V4L2_CTRL_TYPE_BOOLEAN = 2,
+ V4L2_CTRL_TYPE_MENU = 3,
+ V4L2_CTRL_TYPE_BUTTON = 4,
+ V4L2_CTRL_TYPE_INTEGER64 = 5,
+ V4L2_CTRL_TYPE_CTRL_CLASS = 6,
+};
+
+enum v4l2_tuner_type {
+ V4L2_TUNER_RADIO = 1,
+ V4L2_TUNER_ANALOG_TV = 2,
+ V4L2_TUNER_DIGITAL_TV = 3,
+};
+
+enum v4l2_memory {
+ V4L2_MEMORY_MMAP = 1,
+ V4L2_MEMORY_USERPTR = 2,
+ V4L2_MEMORY_OVERLAY = 3,
+};
+
+/* see also http://vektor.theorem.ca/graphics/ycbcr/ */
+enum v4l2_colorspace {
+ /* ITU-R 601 -- broadcast NTSC/PAL */
+ V4L2_COLORSPACE_SMPTE170M = 1,
+
+ /* 1125-Line (US) HDTV */
+ V4L2_COLORSPACE_SMPTE240M = 2,
+
+ /* HD and modern captures. */
+ V4L2_COLORSPACE_REC709 = 3,
+
+ /* broken BT878 extents (601, luma range 16-253 instead of 16-235) */
+ V4L2_COLORSPACE_BT878 = 4,
+
+ /* These should be useful. Assume 601 extents. */
+ V4L2_COLORSPACE_470_SYSTEM_M = 5,
+ V4L2_COLORSPACE_470_SYSTEM_BG = 6,
+
+ /* I know there will be cameras that send this. So, this is
+ * unspecified chromaticities and full 0-255 on each of the
+ * Y'CbCr components
+ */
+ V4L2_COLORSPACE_JPEG = 7,
+
+ /* For RGB colourspaces, this is probably a good start. */
+ V4L2_COLORSPACE_SRGB = 8,
+};
+
+enum v4l2_priority {
+ V4L2_PRIORITY_UNSET = 0, /* not initialized */
+ V4L2_PRIORITY_BACKGROUND = 1,
+ V4L2_PRIORITY_INTERACTIVE = 2,
+ V4L2_PRIORITY_RECORD = 3,
+ V4L2_PRIORITY_DEFAULT = V4L2_PRIORITY_INTERACTIVE,
+};
+
+struct v4l2_rect {
+ __s32 left;
+ __s32 top;
+ __s32 width;
+ __s32 height;
+};
+
+struct v4l2_fract {
+ __u32 numerator;
+ __u32 denominator;
+};
+
+/*
+ * D R I V E R C A P A B I L I T I E S
+ */
+struct v4l2_capability
+{
+ __u8 driver[16]; /* i.e. "bttv" */
+ __u8 card[32]; /* i.e. "Hauppauge WinTV" */
+ __u8 bus_info[32]; /* "PCI:" + pci_name(pci_dev) */
+ __u32 version; /* should use KERNEL_VERSION() */
+ __u32 capabilities; /* Device capabilities */
+ __u32 reserved[4];
+};
+
+/* Values for 'capabilities' field */
+#define V4L2_CAP_VIDEO_CAPTURE 0x00000001 /* Is a video capture device */
+#define V4L2_CAP_VIDEO_OUTPUT 0x00000002 /* Is a video output device */
+#define V4L2_CAP_VIDEO_OVERLAY 0x00000004 /* Can do video overlay */
+#define V4L2_CAP_VBI_CAPTURE 0x00000010 /* Is a raw VBI capture device */
+#define V4L2_CAP_VBI_OUTPUT 0x00000020 /* Is a raw VBI output device */
+#define V4L2_CAP_SLICED_VBI_CAPTURE 0x00000040 /* Is a sliced VBI capture device */
+#define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080 /* Is a sliced VBI output device */
+#define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */
+#define V4L2_CAP_VIDEO_OUTPUT_OVERLAY 0x00000200 /* Can do video output overlay */
+
+#define V4L2_CAP_TUNER 0x00010000 /* has a tuner */
+#define V4L2_CAP_AUDIO 0x00020000 /* has audio support */
+#define V4L2_CAP_RADIO 0x00040000 /* is a radio device */
+
+#define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */
+#define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */
+#define V4L2_CAP_STREAMING 0x04000000 /* streaming I/O ioctls */
+
+/*
+ * V I D E O I M A G E F O R M A T
+ */
+struct v4l2_pix_format
+{
+ __u32 width;
+ __u32 height;
+ __u32 pixelformat;
+ enum v4l2_field field;
+ __u32 bytesperline; /* for padding, zero if unused */
+ __u32 sizeimage;
+ enum v4l2_colorspace colorspace;
+ __u32 priv; /* private data, depends on pixelformat */
+};
+
+/* Pixel format FOURCC depth Description */
+#define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R','G','B','1') /* 8 RGB-3-3-2 */
+#define V4L2_PIX_FMT_RGB444 v4l2_fourcc('R','4','4','4') /* 16 xxxxrrrr ggggbbbb */
+#define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R','G','B','O') /* 16 RGB-5-5-5 */
+#define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R','G','B','P') /* 16 RGB-5-6-5 */
+#define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R','G','B','Q') /* 16 RGB-5-5-5 BE */
+#define V4L2_PIX_FMT_RGB565X v4l2_fourcc('R','G','B','R') /* 16 RGB-5-6-5 BE */
+#define V4L2_PIX_FMT_BGR24 v4l2_fourcc('B','G','R','3') /* 24 BGR-8-8-8 */
+#define V4L2_PIX_FMT_RGB24 v4l2_fourcc('R','G','B','3') /* 24 RGB-8-8-8 */
+#define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B','G','R','4') /* 32 BGR-8-8-8-8 */
+#define V4L2_PIX_FMT_RGB32 v4l2_fourcc('R','G','B','4') /* 32 RGB-8-8-8-8 */
+#define V4L2_PIX_FMT_GREY v4l2_fourcc('G','R','E','Y') /* 8 Greyscale */
+#define V4L2_PIX_FMT_PAL8 v4l2_fourcc('P','A','L','8') /* 8 8-bit palette */
+#define V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y','V','U','9') /* 9 YVU 4:1:0 */
+#define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y','V','1','2') /* 12 YVU 4:2:0 */
+#define V4L2_PIX_FMT_YUYV v4l2_fourcc('Y','U','Y','V') /* 16 YUV 4:2:2 */
+#define V4L2_PIX_FMT_UYVY v4l2_fourcc('U','Y','V','Y') /* 16 YUV 4:2:2 */
+#define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4','2','2','P') /* 16 YVU422 planar */
+#define V4L2_PIX_FMT_YUV411P v4l2_fourcc('4','1','1','P') /* 16 YVU411 planar */
+#define V4L2_PIX_FMT_Y41P v4l2_fourcc('Y','4','1','P') /* 12 YUV 4:1:1 */
+#define V4L2_PIX_FMT_YUV444 v4l2_fourcc('Y','4','4','4') /* 16 xxxxyyyy uuuuvvvv */
+#define V4L2_PIX_FMT_YUV555 v4l2_fourcc('Y','U','V','O') /* 16 YUV-5-5-5 */
+#define V4L2_PIX_FMT_YUV565 v4l2_fourcc('Y','U','V','P') /* 16 YUV-5-6-5 */
+#define V4L2_PIX_FMT_YUV32 v4l2_fourcc('Y','U','V','4') /* 32 YUV-8-8-8-8 */
+
+/* two planes -- one Y, one Cr + Cb interleaved */
+#define V4L2_PIX_FMT_NV12 v4l2_fourcc('N','V','1','2') /* 12 Y/CbCr 4:2:0 */
+#define V4L2_PIX_FMT_NV21 v4l2_fourcc('N','V','2','1') /* 12 Y/CrCb 4:2:0 */
+
+/* The following formats are not defined in the V4L2 specification */
+#define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y','U','V','9') /* 9 YUV 4:1:0 */
+#define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y','U','1','2') /* 12 YUV 4:2:0 */
+#define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y','Y','U','V') /* 16 YUV 4:2:2 */
+#define V4L2_PIX_FMT_HI240 v4l2_fourcc('H','I','2','4') /* 8 8-bit color */
+#define V4L2_PIX_FMT_HM12 v4l2_fourcc('H','M','1','2') /* 8 YUV 4:2:0 16x16 macroblocks */
+
+/* see http://www.siliconimaging.com/RGB%20Bayer.htm */
+#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B','A','8','1') /* 8 BGBG.. GRGR.. */
+
+/* compressed formats */
+#define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M','J','P','G') /* Motion-JPEG */
+#define V4L2_PIX_FMT_JPEG v4l2_fourcc('J','P','E','G') /* JFIF JPEG */
+#define V4L2_PIX_FMT_DV v4l2_fourcc('d','v','s','d') /* 1394 */
+#define V4L2_PIX_FMT_MPEG v4l2_fourcc('M','P','E','G') /* MPEG-1/2/4 */
+
+/* Vendor-specific formats */
+#define V4L2_PIX_FMT_WNVA v4l2_fourcc('W','N','V','A') /* Winnov hw compress */
+#define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S','9','1','0') /* SN9C10x compression */
+#define V4L2_PIX_FMT_PWC1 v4l2_fourcc('P','W','C','1') /* pwc older webcam */
+#define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P','W','C','2') /* pwc newer webcam */
+#define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E','6','2','5') /* ET61X251 compression */
+
+/*
+ * F O R M A T E N U M E R A T I O N
+ */
+struct v4l2_fmtdesc
+{
+ __u32 index; /* Format number */
+ enum v4l2_buf_type type; /* buffer type */
+ __u32 flags;
+ __u8 description[32]; /* Description string */
+ __u32 pixelformat; /* Format fourcc */
+ __u32 reserved[4];
+};
+
+#define V4L2_FMT_FLAG_COMPRESSED 0x0001
+
+#if 1
+ /* Experimental Frame Size and frame rate enumeration */
+/*
+ * F R A M E S I Z E E N U M E R A T I O N
+ */
+enum v4l2_frmsizetypes
+{
+ V4L2_FRMSIZE_TYPE_DISCRETE = 1,
+ V4L2_FRMSIZE_TYPE_CONTINUOUS = 2,
+ V4L2_FRMSIZE_TYPE_STEPWISE = 3,
+};
+
+struct v4l2_frmsize_discrete
+{
+ __u32 width; /* Frame width [pixel] */
+ __u32 height; /* Frame height [pixel] */
+};
+
+struct v4l2_frmsize_stepwise
+{
+ __u32 min_width; /* Minimum frame width [pixel] */
+ __u32 max_width; /* Maximum frame width [pixel] */
+ __u32 step_width; /* Frame width step size [pixel] */
+ __u32 min_height; /* Minimum frame height [pixel] */
+ __u32 max_height; /* Maximum frame height [pixel] */
+ __u32 step_height; /* Frame height step size [pixel] */
+};
+
+struct v4l2_frmsizeenum
+{
+ __u32 index; /* Frame size number */
+ __u32 pixel_format; /* Pixel format */
+ __u32 type; /* Frame size type the device supports. */
+
+ union { /* Frame size */
+ struct v4l2_frmsize_discrete discrete;
+ struct v4l2_frmsize_stepwise stepwise;
+ };
+
+ __u32 reserved[2]; /* Reserved space for future use */
+};
+
+/*
+ * F R A M E R A T E E N U M E R A T I O N
+ */
+enum v4l2_frmivaltypes
+{
+ V4L2_FRMIVAL_TYPE_DISCRETE = 1,
+ V4L2_FRMIVAL_TYPE_CONTINUOUS = 2,
+ V4L2_FRMIVAL_TYPE_STEPWISE = 3,
+};
+
+struct v4l2_frmival_stepwise
+{
+ struct v4l2_fract min; /* Minimum frame interval [s] */
+ struct v4l2_fract max; /* Maximum frame interval [s] */
+ struct v4l2_fract step; /* Frame interval step size [s] */
+};
+
+struct v4l2_frmivalenum
+{
+ __u32 index; /* Frame format index */
+ __u32 pixel_format; /* Pixel format */
+ __u32 width; /* Frame width */
+ __u32 height; /* Frame height */
+ __u32 type; /* Frame interval type the device supports. */
+
+ union { /* Frame interval */
+ struct v4l2_fract discrete;
+ struct v4l2_frmival_stepwise stepwise;
+ };
+
+ __u32 reserved[2]; /* Reserved space for future use */
+};
+#endif
+
+/*
+ * T I M E C O D E
+ */
+struct v4l2_timecode
+{
+ __u32 type;
+ __u32 flags;
+ __u8 frames;
+ __u8 seconds;
+ __u8 minutes;
+ __u8 hours;
+ __u8 userbits[4];
+};
+
+/* Type */
+#define V4L2_TC_TYPE_24FPS 1
+#define V4L2_TC_TYPE_25FPS 2
+#define V4L2_TC_TYPE_30FPS 3
+#define V4L2_TC_TYPE_50FPS 4
+#define V4L2_TC_TYPE_60FPS 5
+
+/* Flags */
+#define V4L2_TC_FLAG_DROPFRAME 0x0001 /* "drop-frame" mode */
+#define V4L2_TC_FLAG_COLORFRAME 0x0002
+#define V4L2_TC_USERBITS_field 0x000C
+#define V4L2_TC_USERBITS_USERDEFINED 0x0000
+#define V4L2_TC_USERBITS_8BITCHARS 0x0008
+/* The above is based on SMPTE timecodes */
+
+struct v4l2_jpegcompression
+{
+ int quality;
+
+ int APPn; /* Number of APP segment to be written,
+ * must be 0..15 */
+ int APP_len; /* Length of data in JPEG APPn segment */
+ char APP_data[60]; /* Data in the JPEG APPn segment. */
+
+ int COM_len; /* Length of data in JPEG COM segment */
+ char COM_data[60]; /* Data in JPEG COM segment */
+
+ __u32 jpeg_markers; /* Which markers should go into the JPEG
+ * output. Unless you exactly know what
+ * you do, leave them untouched.
+ * Inluding less markers will make the
+ * resulting code smaller, but there will
+ * be fewer aplications which can read it.
+ * The presence of the APP and COM marker
+ * is influenced by APP_len and COM_len
+ * ONLY, not by this property! */
+
+#define V4L2_JPEG_MARKER_DHT (1<<3) /* Define Huffman Tables */
+#define V4L2_JPEG_MARKER_DQT (1<<4) /* Define Quantization Tables */
+#define V4L2_JPEG_MARKER_DRI (1<<5) /* Define Restart Interval */
+#define V4L2_JPEG_MARKER_COM (1<<6) /* Comment segment */
+#define V4L2_JPEG_MARKER_APP (1<<7) /* App segment, driver will
+ * allways use APP0 */
+};
+
+/*
+ * M E M O R Y - M A P P I N G B U F F E R S
+ */
+struct v4l2_requestbuffers
+{
+ __u32 count;
+ enum v4l2_buf_type type;
+ enum v4l2_memory memory;
+ __u32 reserved[2];
+};
+
+struct v4l2_buffer
+{
+ __u32 index;
+ enum v4l2_buf_type type;
+ __u32 bytesused;
+ __u32 flags;
+ enum v4l2_field field;
+ struct timeval timestamp;
+ struct v4l2_timecode timecode;
+ __u32 sequence;
+
+ /* memory location */
+ enum v4l2_memory memory;
+ union {
+ __u32 offset;
+ unsigned long userptr;
+ } m;
+ __u32 length;
+ __u32 input;
+ __u32 reserved;
+};
+
+/* Flags for 'flags' field */
+#define V4L2_BUF_FLAG_MAPPED 0x0001 /* Buffer is mapped (flag) */
+#define V4L2_BUF_FLAG_QUEUED 0x0002 /* Buffer is queued for processing */
+#define V4L2_BUF_FLAG_DONE 0x0004 /* Buffer is ready */
+#define V4L2_BUF_FLAG_KEYFRAME 0x0008 /* Image is a keyframe (I-frame) */
+#define V4L2_BUF_FLAG_PFRAME 0x0010 /* Image is a P-frame */
+#define V4L2_BUF_FLAG_BFRAME 0x0020 /* Image is a B-frame */
+#define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */
+#define V4L2_BUF_FLAG_INPUT 0x0200 /* input field is valid */
+
+/*
+ * O V E R L A Y P R E V I E W
+ */
+struct v4l2_framebuffer
+{
+ __u32 capability;
+ __u32 flags;
+/* FIXME: in theory we should pass something like PCI device + memory
+ * region + offset instead of some physical address */
+ void* base;
+ struct v4l2_pix_format fmt;
+};
+/* Flags for the 'capability' field. Read only */
+#define V4L2_FBUF_CAP_EXTERNOVERLAY 0x0001
+#define V4L2_FBUF_CAP_CHROMAKEY 0x0002
+#define V4L2_FBUF_CAP_LIST_CLIPPING 0x0004
+#define V4L2_FBUF_CAP_BITMAP_CLIPPING 0x0008
+#define V4L2_FBUF_CAP_LOCAL_ALPHA 0x0010
+#define V4L2_FBUF_CAP_GLOBAL_ALPHA 0x0020
+#define V4L2_FBUF_CAP_LOCAL_INV_ALPHA 0x0040
+/* Flags for the 'flags' field. */
+#define V4L2_FBUF_FLAG_PRIMARY 0x0001
+#define V4L2_FBUF_FLAG_OVERLAY 0x0002
+#define V4L2_FBUF_FLAG_CHROMAKEY 0x0004
+#define V4L2_FBUF_FLAG_LOCAL_ALPHA 0x0008
+#define V4L2_FBUF_FLAG_GLOBAL_ALPHA 0x0010
+#define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA 0x0020
+
+struct v4l2_clip
+{
+ struct v4l2_rect c;
+ struct v4l2_clip *next;
+};
+
+struct v4l2_window
+{
+ struct v4l2_rect w;
+ enum v4l2_field field;
+ __u32 chromakey;
+ struct v4l2_clip *clips;
+ __u32 clipcount;
+ void *bitmap;
+ __u8 global_alpha;
+};
+
+/*
+ * C A P T U R E P A R A M E T E R S
+ */
+struct v4l2_captureparm
+{
+ __u32 capability; /* Supported modes */
+ __u32 capturemode; /* Current mode */
+ struct v4l2_fract timeperframe; /* Time per frame in .1us units */
+ __u32 extendedmode; /* Driver-specific extensions */
+ __u32 readbuffers; /* # of buffers for read */
+ __u32 reserved[4];
+};
+
+/* Flags for 'capability' and 'capturemode' fields */
+#define V4L2_MODE_HIGHQUALITY 0x0001 /* High quality imaging mode */
+#define V4L2_CAP_TIMEPERFRAME 0x1000 /* timeperframe field is supported */
+
+struct v4l2_outputparm
+{
+ __u32 capability; /* Supported modes */
+ __u32 outputmode; /* Current mode */
+ struct v4l2_fract timeperframe; /* Time per frame in seconds */
+ __u32 extendedmode; /* Driver-specific extensions */
+ __u32 writebuffers; /* # of buffers for write */
+ __u32 reserved[4];
+};
+
+/*
+ * I N P U T I M A G E C R O P P I N G
+ */
+struct v4l2_cropcap {
+ enum v4l2_buf_type type;
+ struct v4l2_rect bounds;
+ struct v4l2_rect defrect;
+ struct v4l2_fract pixelaspect;
+};
+
+struct v4l2_crop {
+ enum v4l2_buf_type type;
+ struct v4l2_rect c;
+};
+
+/*
+ * A N A L O G V I D E O S T A N D A R D
+ */
+
+typedef __u64 v4l2_std_id;
+
+/* one bit for each */
+#define V4L2_STD_PAL_B ((v4l2_std_id)0x00000001)
+#define V4L2_STD_PAL_B1 ((v4l2_std_id)0x00000002)
+#define V4L2_STD_PAL_G ((v4l2_std_id)0x00000004)
+#define V4L2_STD_PAL_H ((v4l2_std_id)0x00000008)
+#define V4L2_STD_PAL_I ((v4l2_std_id)0x00000010)
+#define V4L2_STD_PAL_D ((v4l2_std_id)0x00000020)
+#define V4L2_STD_PAL_D1 ((v4l2_std_id)0x00000040)
+#define V4L2_STD_PAL_K ((v4l2_std_id)0x00000080)
+
+#define V4L2_STD_PAL_M ((v4l2_std_id)0x00000100)
+#define V4L2_STD_PAL_N ((v4l2_std_id)0x00000200)
+#define V4L2_STD_PAL_Nc ((v4l2_std_id)0x00000400)
+#define V4L2_STD_PAL_60 ((v4l2_std_id)0x00000800)
+
+#define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000)
+#define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000)
+#define V4L2_STD_NTSC_443 ((v4l2_std_id)0x00004000)
+#define V4L2_STD_NTSC_M_KR ((v4l2_std_id)0x00008000)
+
+#define V4L2_STD_SECAM_B ((v4l2_std_id)0x00010000)
+#define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000)
+#define V4L2_STD_SECAM_G ((v4l2_std_id)0x00040000)
+#define V4L2_STD_SECAM_H ((v4l2_std_id)0x00080000)
+#define V4L2_STD_SECAM_K ((v4l2_std_id)0x00100000)
+#define V4L2_STD_SECAM_K1 ((v4l2_std_id)0x00200000)
+#define V4L2_STD_SECAM_L ((v4l2_std_id)0x00400000)
+#define V4L2_STD_SECAM_LC ((v4l2_std_id)0x00800000)
+
+/* ATSC/HDTV */
+#define V4L2_STD_ATSC_8_VSB ((v4l2_std_id)0x01000000)
+#define V4L2_STD_ATSC_16_VSB ((v4l2_std_id)0x02000000)
+
+/* FIXME:
+ Although std_id is 64 bits, there is an issue on PPC32 architecture that
+ makes switch(__u64) to break. So, there's a hack on v4l2-common.c rounding
+ this value to 32 bits.
+ As, currently, the max value is for V4L2_STD_ATSC_16_VSB (30 bits wide),
+ it should work fine. However, if needed to add more than two standards,
+ v4l2-common.c should be fixed.
+ */
+
+/* some merged standards */
+#define V4L2_STD_MN (V4L2_STD_PAL_M|V4L2_STD_PAL_N|V4L2_STD_PAL_Nc|V4L2_STD_NTSC)
+#define V4L2_STD_B (V4L2_STD_PAL_B|V4L2_STD_PAL_B1|V4L2_STD_SECAM_B)
+#define V4L2_STD_GH (V4L2_STD_PAL_G|V4L2_STD_PAL_H|V4L2_STD_SECAM_G|V4L2_STD_SECAM_H)
+#define V4L2_STD_DK (V4L2_STD_PAL_DK|V4L2_STD_SECAM_DK)
+
+/* some common needed stuff */
+#define V4L2_STD_PAL_BG (V4L2_STD_PAL_B |\
+ V4L2_STD_PAL_B1 |\
+ V4L2_STD_PAL_G)
+#define V4L2_STD_PAL_DK (V4L2_STD_PAL_D |\
+ V4L2_STD_PAL_D1 |\
+ V4L2_STD_PAL_K)
+#define V4L2_STD_PAL (V4L2_STD_PAL_BG |\
+ V4L2_STD_PAL_DK |\
+ V4L2_STD_PAL_H |\
+ V4L2_STD_PAL_I)
+#define V4L2_STD_NTSC (V4L2_STD_NTSC_M |\
+ V4L2_STD_NTSC_M_JP |\
+ V4L2_STD_NTSC_M_KR)
+#define V4L2_STD_SECAM_DK (V4L2_STD_SECAM_D |\
+ V4L2_STD_SECAM_K |\
+ V4L2_STD_SECAM_K1)
+#define V4L2_STD_SECAM (V4L2_STD_SECAM_B |\
+ V4L2_STD_SECAM_G |\
+ V4L2_STD_SECAM_H |\
+ V4L2_STD_SECAM_DK |\
+ V4L2_STD_SECAM_L |\
+ V4L2_STD_SECAM_LC)
+
+#define V4L2_STD_525_60 (V4L2_STD_PAL_M |\
+ V4L2_STD_PAL_60 |\
+ V4L2_STD_NTSC |\
+ V4L2_STD_NTSC_443)
+#define V4L2_STD_625_50 (V4L2_STD_PAL |\
+ V4L2_STD_PAL_N |\
+ V4L2_STD_PAL_Nc |\
+ V4L2_STD_SECAM)
+#define V4L2_STD_ATSC (V4L2_STD_ATSC_8_VSB |\
+ V4L2_STD_ATSC_16_VSB)
+
+#define V4L2_STD_UNKNOWN 0
+#define V4L2_STD_ALL (V4L2_STD_525_60 |\
+ V4L2_STD_625_50)
+
+struct v4l2_standard
+{
+ __u32 index;
+ v4l2_std_id id;
+ __u8 name[24];
+ struct v4l2_fract frameperiod; /* Frames, not fields */
+ __u32 framelines;
+ __u32 reserved[4];
+};
+
+/*
+ * V I D E O I N P U T S
+ */
+struct v4l2_input
+{
+ __u32 index; /* Which input */
+ __u8 name[32]; /* Label */
+ __u32 type; /* Type of input */
+ __u32 audioset; /* Associated audios (bitfield) */
+ __u32 tuner; /* Associated tuner */
+ v4l2_std_id std;
+ __u32 status;
+ __u32 reserved[4];
+};
+
+/* Values for the 'type' field */
+#define V4L2_INPUT_TYPE_TUNER 1
+#define V4L2_INPUT_TYPE_CAMERA 2
+
+/* field 'status' - general */
+#define V4L2_IN_ST_NO_POWER 0x00000001 /* Attached device is off */
+#define V4L2_IN_ST_NO_SIGNAL 0x00000002
+#define V4L2_IN_ST_NO_COLOR 0x00000004
+
+/* field 'status' - analog */
+#define V4L2_IN_ST_NO_H_LOCK 0x00000100 /* No horizontal sync lock */
+#define V4L2_IN_ST_COLOR_KILL 0x00000200 /* Color killer is active */
+
+/* field 'status' - digital */
+#define V4L2_IN_ST_NO_SYNC 0x00010000 /* No synchronization lock */
+#define V4L2_IN_ST_NO_EQU 0x00020000 /* No equalizer lock */
+#define V4L2_IN_ST_NO_CARRIER 0x00040000 /* Carrier recovery failed */
+
+/* field 'status' - VCR and set-top box */
+#define V4L2_IN_ST_MACROVISION 0x01000000 /* Macrovision detected */
+#define V4L2_IN_ST_NO_ACCESS 0x02000000 /* Conditional access denied */
+#define V4L2_IN_ST_VTR 0x04000000 /* VTR time constant */
+
+/*
+ * V I D E O O U T P U T S
+ */
+struct v4l2_output
+{
+ __u32 index; /* Which output */
+ __u8 name[32]; /* Label */
+ __u32 type; /* Type of output */
+ __u32 audioset; /* Associated audios (bitfield) */
+ __u32 modulator; /* Associated modulator */
+ v4l2_std_id std;
+ __u32 reserved[4];
+};
+/* Values for the 'type' field */
+#define V4L2_OUTPUT_TYPE_MODULATOR 1
+#define V4L2_OUTPUT_TYPE_ANALOG 2
+#define V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY 3
+
+/*
+ * C O N T R O L S
+ */
+struct v4l2_control
+{
+ __u32 id;
+ __s32 value;
+};
+
+struct v4l2_ext_control
+{
+ __u32 id;
+ __u32 reserved2[2];
+ union {
+ __s32 value;
+ __s64 value64;
+ void *reserved;
+ };
+} __attribute__ ((packed));
+
+struct v4l2_ext_controls
+{
+ __u32 ctrl_class;
+ __u32 count;
+ __u32 error_idx;
+ __u32 reserved[2];
+ struct v4l2_ext_control *controls;
+};
+
+/* Values for ctrl_class field */
+#define V4L2_CTRL_CLASS_USER 0x00980000 /* Old-style 'user' controls */
+#define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */
+
+#define V4L2_CTRL_ID_MASK (0x0fffffff)
+#define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL)
+#define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000)
+
+/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
+struct v4l2_queryctrl
+{
+ __u32 id;
+ enum v4l2_ctrl_type type;
+ __u8 name[32]; /* Whatever */
+ __s32 minimum; /* Note signedness */
+ __s32 maximum;
+ __s32 step;
+ __s32 default_value;
+ __u32 flags;
+ __u32 reserved[2];
+};
+
+/* Used in the VIDIOC_QUERYMENU ioctl for querying menu items */
+struct v4l2_querymenu
+{
+ __u32 id;
+ __u32 index;
+ __u8 name[32]; /* Whatever */
+ __u32 reserved;
+};
+
+/* Control flags */
+#define V4L2_CTRL_FLAG_DISABLED 0x0001
+#define V4L2_CTRL_FLAG_GRABBED 0x0002
+#define V4L2_CTRL_FLAG_READ_ONLY 0x0004
+#define V4L2_CTRL_FLAG_UPDATE 0x0008
+#define V4L2_CTRL_FLAG_INACTIVE 0x0010
+#define V4L2_CTRL_FLAG_SLIDER 0x0020
+
+/* Query flag, to be ORed with the control ID */
+#define V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000
+
+/* User-class control IDs defined by V4L2 */
+#define V4L2_CID_BASE (V4L2_CTRL_CLASS_USER | 0x900)
+#define V4L2_CID_USER_BASE V4L2_CID_BASE
+/* IDs reserved for driver specific controls */
+#define V4L2_CID_PRIVATE_BASE 0x08000000
+
+#define V4L2_CID_USER_CLASS (V4L2_CTRL_CLASS_USER | 1)
+#define V4L2_CID_BRIGHTNESS (V4L2_CID_BASE+0)
+#define V4L2_CID_CONTRAST (V4L2_CID_BASE+1)
+#define V4L2_CID_SATURATION (V4L2_CID_BASE+2)
+#define V4L2_CID_HUE (V4L2_CID_BASE+3)
+#define V4L2_CID_AUDIO_VOLUME (V4L2_CID_BASE+5)
+#define V4L2_CID_AUDIO_BALANCE (V4L2_CID_BASE+6)
+#define V4L2_CID_AUDIO_BASS (V4L2_CID_BASE+7)
+#define V4L2_CID_AUDIO_TREBLE (V4L2_CID_BASE+8)
+#define V4L2_CID_AUDIO_MUTE (V4L2_CID_BASE+9)
+#define V4L2_CID_AUDIO_LOUDNESS (V4L2_CID_BASE+10)
+#define V4L2_CID_BLACK_LEVEL (V4L2_CID_BASE+11)
+#define V4L2_CID_AUTO_WHITE_BALANCE (V4L2_CID_BASE+12)
+#define V4L2_CID_DO_WHITE_BALANCE (V4L2_CID_BASE+13)
+#define V4L2_CID_RED_BALANCE (V4L2_CID_BASE+14)
+#define V4L2_CID_BLUE_BALANCE (V4L2_CID_BASE+15)
+#define V4L2_CID_GAMMA (V4L2_CID_BASE+16)
+#define V4L2_CID_WHITENESS (V4L2_CID_GAMMA) /* ? Not sure */
+#define V4L2_CID_EXPOSURE (V4L2_CID_BASE+17)
+#define V4L2_CID_AUTOGAIN (V4L2_CID_BASE+18)
+#define V4L2_CID_GAIN (V4L2_CID_BASE+19)
+#define V4L2_CID_HFLIP (V4L2_CID_BASE+20)
+#define V4L2_CID_VFLIP (V4L2_CID_BASE+21)
+#define V4L2_CID_HCENTER (V4L2_CID_BASE+22)
+#define V4L2_CID_VCENTER (V4L2_CID_BASE+23)
+#define V4L2_CID_LASTP1 (V4L2_CID_BASE+24) /* last CID + 1 */
+
+/* MPEG-class control IDs defined by V4L2 */
+#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)
+#define V4L2_CID_MPEG_CLASS (V4L2_CTRL_CLASS_MPEG | 1)
+
+/* MPEG streams */
+#define V4L2_CID_MPEG_STREAM_TYPE (V4L2_CID_MPEG_BASE+0)
+enum v4l2_mpeg_stream_type {
+ V4L2_MPEG_STREAM_TYPE_MPEG2_PS = 0, /* MPEG-2 program stream */
+ V4L2_MPEG_STREAM_TYPE_MPEG2_TS = 1, /* MPEG-2 transport stream */
+ V4L2_MPEG_STREAM_TYPE_MPEG1_SS = 2, /* MPEG-1 system stream */
+ V4L2_MPEG_STREAM_TYPE_MPEG2_DVD = 3, /* MPEG-2 DVD-compatible stream */
+ V4L2_MPEG_STREAM_TYPE_MPEG1_VCD = 4, /* MPEG-1 VCD-compatible stream */
+ V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD = 5, /* MPEG-2 SVCD-compatible stream */
+};
+#define V4L2_CID_MPEG_STREAM_PID_PMT (V4L2_CID_MPEG_BASE+1)
+#define V4L2_CID_MPEG_STREAM_PID_AUDIO (V4L2_CID_MPEG_BASE+2)
+#define V4L2_CID_MPEG_STREAM_PID_VIDEO (V4L2_CID_MPEG_BASE+3)
+#define V4L2_CID_MPEG_STREAM_PID_PCR (V4L2_CID_MPEG_BASE+4)
+#define V4L2_CID_MPEG_STREAM_PES_ID_AUDIO (V4L2_CID_MPEG_BASE+5)
+#define V4L2_CID_MPEG_STREAM_PES_ID_VIDEO (V4L2_CID_MPEG_BASE+6)
+#define V4L2_CID_MPEG_STREAM_VBI_FMT (V4L2_CID_MPEG_BASE+7)
+enum v4l2_mpeg_stream_vbi_fmt {
+ V4L2_MPEG_STREAM_VBI_FMT_NONE = 0, /* No VBI in the MPEG stream */
+ V4L2_MPEG_STREAM_VBI_FMT_IVTV = 1, /* VBI in private packets, IVTV format */
+};
+
+/* MPEG audio */
+#define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (V4L2_CID_MPEG_BASE+100)
+enum v4l2_mpeg_audio_sampling_freq {
+ V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100 = 0,
+ V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000 = 1,
+ V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000 = 2,
+};
+#define V4L2_CID_MPEG_AUDIO_ENCODING (V4L2_CID_MPEG_BASE+101)
+enum v4l2_mpeg_audio_encoding {
+ V4L2_MPEG_AUDIO_ENCODING_LAYER_1 = 0,
+ V4L2_MPEG_AUDIO_ENCODING_LAYER_2 = 1,
+ V4L2_MPEG_AUDIO_ENCODING_LAYER_3 = 2,
+};
+#define V4L2_CID_MPEG_AUDIO_L1_BITRATE (V4L2_CID_MPEG_BASE+102)
+enum v4l2_mpeg_audio_l1_bitrate {
+ V4L2_MPEG_AUDIO_L1_BITRATE_32K = 0,
+ V4L2_MPEG_AUDIO_L1_BITRATE_64K = 1,
+ V4L2_MPEG_AUDIO_L1_BITRATE_96K = 2,
+ V4L2_MPEG_AUDIO_L1_BITRATE_128K = 3,
+ V4L2_MPEG_AUDIO_L1_BITRATE_160K = 4,
+ V4L2_MPEG_AUDIO_L1_BITRATE_192K = 5,
+ V4L2_MPEG_AUDIO_L1_BITRATE_224K = 6,
+ V4L2_MPEG_AUDIO_L1_BITRATE_256K = 7,
+ V4L2_MPEG_AUDIO_L1_BITRATE_288K = 8,
+ V4L2_MPEG_AUDIO_L1_BITRATE_320K = 9,
+ V4L2_MPEG_AUDIO_L1_BITRATE_352K = 10,
+ V4L2_MPEG_AUDIO_L1_BITRATE_384K = 11,
+ V4L2_MPEG_AUDIO_L1_BITRATE_416K = 12,
+ V4L2_MPEG_AUDIO_L1_BITRATE_448K = 13,
+};
+#define V4L2_CID_MPEG_AUDIO_L2_BITRATE (V4L2_CID_MPEG_BASE+103)
+enum v4l2_mpeg_audio_l2_bitrate {
+ V4L2_MPEG_AUDIO_L2_BITRATE_32K = 0,
+ V4L2_MPEG_AUDIO_L2_BITRATE_48K = 1,
+ V4L2_MPEG_AUDIO_L2_BITRATE_56K = 2,
+ V4L2_MPEG_AUDIO_L2_BITRATE_64K = 3,
+ V4L2_MPEG_AUDIO_L2_BITRATE_80K = 4,
+ V4L2_MPEG_AUDIO_L2_BITRATE_96K = 5,
+ V4L2_MPEG_AUDIO_L2_BITRATE_112K = 6,
+ V4L2_MPEG_AUDIO_L2_BITRATE_128K = 7,
+ V4L2_MPEG_AUDIO_L2_BITRATE_160K = 8,
+ V4L2_MPEG_AUDIO_L2_BITRATE_192K = 9,
+ V4L2_MPEG_AUDIO_L2_BITRATE_224K = 10,
+ V4L2_MPEG_AUDIO_L2_BITRATE_256K = 11,
+ V4L2_MPEG_AUDIO_L2_BITRATE_320K = 12,
+ V4L2_MPEG_AUDIO_L2_BITRATE_384K = 13,
+};
+#define V4L2_CID_MPEG_AUDIO_L3_BITRATE (V4L2_CID_MPEG_BASE+104)
+enum v4l2_mpeg_audio_l3_bitrate {
+ V4L2_MPEG_AUDIO_L3_BITRATE_32K = 0,
+ V4L2_MPEG_AUDIO_L3_BITRATE_40K = 1,
+ V4L2_MPEG_AUDIO_L3_BITRATE_48K = 2,
+ V4L2_MPEG_AUDIO_L3_BITRATE_56K = 3,
+ V4L2_MPEG_AUDIO_L3_BITRATE_64K = 4,
+ V4L2_MPEG_AUDIO_L3_BITRATE_80K = 5,
+ V4L2_MPEG_AUDIO_L3_BITRATE_96K = 6,
+ V4L2_MPEG_AUDIO_L3_BITRATE_112K = 7,
+ V4L2_MPEG_AUDIO_L3_BITRATE_128K = 8,
+ V4L2_MPEG_AUDIO_L3_BITRATE_160K = 9,
+ V4L2_MPEG_AUDIO_L3_BITRATE_192K = 10,
+ V4L2_MPEG_AUDIO_L3_BITRATE_224K = 11,
+ V4L2_MPEG_AUDIO_L3_BITRATE_256K = 12,
+ V4L2_MPEG_AUDIO_L3_BITRATE_320K = 13,
+};
+#define V4L2_CID_MPEG_AUDIO_MODE (V4L2_CID_MPEG_BASE+105)
+enum v4l2_mpeg_audio_mode {
+ V4L2_MPEG_AUDIO_MODE_STEREO = 0,
+ V4L2_MPEG_AUDIO_MODE_JOINT_STEREO = 1,
+ V4L2_MPEG_AUDIO_MODE_DUAL = 2,
+ V4L2_MPEG_AUDIO_MODE_MONO = 3,
+};
+#define V4L2_CID_MPEG_AUDIO_MODE_EXTENSION (V4L2_CID_MPEG_BASE+106)
+enum v4l2_mpeg_audio_mode_extension {
+ V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4 = 0,
+ V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_8 = 1,
+ V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_12 = 2,
+ V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_16 = 3,
+};
+#define V4L2_CID_MPEG_AUDIO_EMPHASIS (V4L2_CID_MPEG_BASE+107)
+enum v4l2_mpeg_audio_emphasis {
+ V4L2_MPEG_AUDIO_EMPHASIS_NONE = 0,
+ V4L2_MPEG_AUDIO_EMPHASIS_50_DIV_15_uS = 1,
+ V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17 = 2,
+};
+#define V4L2_CID_MPEG_AUDIO_CRC (V4L2_CID_MPEG_BASE+108)
+enum v4l2_mpeg_audio_crc {
+ V4L2_MPEG_AUDIO_CRC_NONE = 0,
+ V4L2_MPEG_AUDIO_CRC_CRC16 = 1,
+};
+#define V4L2_CID_MPEG_AUDIO_MUTE (V4L2_CID_MPEG_BASE+109)
+
+/* MPEG video */
+#define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200)
+enum v4l2_mpeg_video_encoding {
+ V4L2_MPEG_VIDEO_ENCODING_MPEG_1 = 0,
+ V4L2_MPEG_VIDEO_ENCODING_MPEG_2 = 1,
+};
+#define V4L2_CID_MPEG_VIDEO_ASPECT (V4L2_CID_MPEG_BASE+201)
+enum v4l2_mpeg_video_aspect {
+ V4L2_MPEG_VIDEO_ASPECT_1x1 = 0,
+ V4L2_MPEG_VIDEO_ASPECT_4x3 = 1,
+ V4L2_MPEG_VIDEO_ASPECT_16x9 = 2,
+ V4L2_MPEG_VIDEO_ASPECT_221x100 = 3,
+};
+#define V4L2_CID_MPEG_VIDEO_B_FRAMES (V4L2_CID_MPEG_BASE+202)
+#define V4L2_CID_MPEG_VIDEO_GOP_SIZE (V4L2_CID_MPEG_BASE+203)
+#define V4L2_CID_MPEG_VIDEO_GOP_CLOSURE (V4L2_CID_MPEG_BASE+204)
+#define V4L2_CID_MPEG_VIDEO_PULLDOWN (V4L2_CID_MPEG_BASE+205)
+#define V4L2_CID_MPEG_VIDEO_BITRATE_MODE (V4L2_CID_MPEG_BASE+206)
+enum v4l2_mpeg_video_bitrate_mode {
+ V4L2_MPEG_VIDEO_BITRATE_MODE_VBR = 0,
+ V4L2_MPEG_VIDEO_BITRATE_MODE_CBR = 1,
+};
+#define V4L2_CID_MPEG_VIDEO_BITRATE (V4L2_CID_MPEG_BASE+207)
+#define V4L2_CID_MPEG_VIDEO_BITRATE_PEAK (V4L2_CID_MPEG_BASE+208)
+#define V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION (V4L2_CID_MPEG_BASE+209)
+#define V4L2_CID_MPEG_VIDEO_MUTE (V4L2_CID_MPEG_BASE+210)
+#define V4L2_CID_MPEG_VIDEO_MUTE_YUV (V4L2_CID_MPEG_BASE+211)
+
+/* MPEG-class control IDs specific to the CX2584x driver as defined by V4L2 */
+#define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000)
+#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+0)
+enum v4l2_mpeg_cx2341x_video_spatial_filter_mode {
+ V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_MANUAL = 0,
+ V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_AUTO = 1,
+};
+#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+1)
+#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+2)
+enum v4l2_mpeg_cx2341x_video_luma_spatial_filter_type {
+ V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_OFF = 0,
+ V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_HOR = 1,
+ V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_VERT = 2,
+ V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_HV_SEPARABLE = 3,
+ V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_SYM_NON_SEPARABLE = 4,
+};
+#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+3)
+enum v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type {
+ V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_OFF = 0,
+ V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_1D_HOR = 1,
+};
+#define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+4)
+enum v4l2_mpeg_cx2341x_video_temporal_filter_mode {
+ V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_MANUAL = 0,
+ V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_AUTO = 1,
+};
+#define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+5)
+#define V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+6)
+enum v4l2_mpeg_cx2341x_video_median_filter_type {
+ V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_OFF = 0,
+ V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR = 1,
+ V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_VERT = 2,
+ V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR_VERT = 3,
+ V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_DIAG = 4,
+};
+#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+7)
+#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+8)
+#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+9)
+#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+10)
+#define V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS (V4L2_CID_MPEG_CX2341X_BASE+11)
+
+/*
+ * T U N I N G
+ */
+struct v4l2_tuner
+{
+ __u32 index;
+ __u8 name[32];
+ enum v4l2_tuner_type type;
+ __u32 capability;
+ __u32 rangelow;
+ __u32 rangehigh;
+ __u32 rxsubchans;
+ __u32 audmode;
+ __s32 signal;
+ __s32 afc;
+ __u32 reserved[4];
+};
+
+struct v4l2_modulator
+{
+ __u32 index;
+ __u8 name[32];
+ __u32 capability;
+ __u32 rangelow;
+ __u32 rangehigh;
+ __u32 txsubchans;
+ __u32 reserved[4];
+};
+
+/* Flags for the 'capability' field */
+#define V4L2_TUNER_CAP_LOW 0x0001
+#define V4L2_TUNER_CAP_NORM 0x0002
+#define V4L2_TUNER_CAP_STEREO 0x0010
+#define V4L2_TUNER_CAP_LANG2 0x0020
+#define V4L2_TUNER_CAP_SAP 0x0020
+#define V4L2_TUNER_CAP_LANG1 0x0040
+
+/* Flags for the 'rxsubchans' field */
+#define V4L2_TUNER_SUB_MONO 0x0001
+#define V4L2_TUNER_SUB_STEREO 0x0002
+#define V4L2_TUNER_SUB_LANG2 0x0004
+#define V4L2_TUNER_SUB_SAP 0x0004
+#define V4L2_TUNER_SUB_LANG1 0x0008
+
+/* Values for the 'audmode' field */
+#define V4L2_TUNER_MODE_MONO 0x0000
+#define V4L2_TUNER_MODE_STEREO 0x0001
+#define V4L2_TUNER_MODE_LANG2 0x0002
+#define V4L2_TUNER_MODE_SAP 0x0002
+#define V4L2_TUNER_MODE_LANG1 0x0003
+#define V4L2_TUNER_MODE_LANG1_LANG2 0x0004
+
+struct v4l2_frequency
+{
+ __u32 tuner;
+ enum v4l2_tuner_type type;
+ __u32 frequency;
+ __u32 reserved[8];
+};
+
+/*
+ * A U D I O
+ */
+struct v4l2_audio
+{
+ __u32 index;
+ __u8 name[32];
+ __u32 capability;
+ __u32 mode;
+ __u32 reserved[2];
+};
+
+/* Flags for the 'capability' field */
+#define V4L2_AUDCAP_STEREO 0x00001
+#define V4L2_AUDCAP_AVL 0x00002
+
+/* Flags for the 'mode' field */
+#define V4L2_AUDMODE_AVL 0x00001
+
+struct v4l2_audioout
+{
+ __u32 index;
+ __u8 name[32];
+ __u32 capability;
+ __u32 mode;
+ __u32 reserved[2];
+};
+
+/*
+ * M P E G S E R V I C E S
+ *
+ * NOTE: EXPERIMENTAL API
+ */
+#if 1
+#define V4L2_ENC_IDX_FRAME_I (0)
+#define V4L2_ENC_IDX_FRAME_P (1)
+#define V4L2_ENC_IDX_FRAME_B (2)
+#define V4L2_ENC_IDX_FRAME_MASK (0xf)
+
+struct v4l2_enc_idx_entry {
+ __u64 offset;
+ __u64 pts;
+ __u32 length;
+ __u32 flags;
+ __u32 reserved[2];
+};
+
+#define V4L2_ENC_IDX_ENTRIES (64)
+struct v4l2_enc_idx {
+ __u32 entries;
+ __u32 entries_cap;
+ __u32 reserved[4];
+ struct v4l2_enc_idx_entry entry[V4L2_ENC_IDX_ENTRIES];
+};
+
+
+#define V4L2_ENC_CMD_START (0)
+#define V4L2_ENC_CMD_STOP (1)
+#define V4L2_ENC_CMD_PAUSE (2)
+#define V4L2_ENC_CMD_RESUME (3)
+
+/* Flags for V4L2_ENC_CMD_STOP */
+#define V4L2_ENC_CMD_STOP_AT_GOP_END (1 << 0)
+
+struct v4l2_encoder_cmd {
+ __u32 cmd;
+ __u32 flags;
+ union {
+ struct {
+ __u32 data[8];
+ } raw;
+ };
+};
+
+#endif
+
+
+/*
+ * D A T A S E R V I C E S ( V B I )
+ *
+ * Data services API by Michael Schimek
+ */
+
+/* Raw VBI */
+struct v4l2_vbi_format
+{
+ __u32 sampling_rate; /* in 1 Hz */
+ __u32 offset;
+ __u32 samples_per_line;
+ __u32 sample_format; /* V4L2_PIX_FMT_* */
+ __s32 start[2];
+ __u32 count[2];
+ __u32 flags; /* V4L2_VBI_* */
+ __u32 reserved[2]; /* must be zero */
+};
+
+/* VBI flags */
+#define V4L2_VBI_UNSYNC (1<< 0)
+#define V4L2_VBI_INTERLACED (1<< 1)
+
+/* Sliced VBI
+ *
+ * This implements is a proposal V4L2 API to allow SLICED VBI
+ * required for some hardware encoders. It should change without
+ * notice in the definitive implementation.
+ */
+
+struct v4l2_sliced_vbi_format
+{
+ __u16 service_set;
+ /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field
+ service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field
+ (equals frame lines 313-336 for 625 line video
+ standards, 263-286 for 525 line standards) */
+ __u16 service_lines[2][24];
+ __u32 io_size;
+ __u32 reserved[2]; /* must be zero */
+};
+
+/* Teletext World System Teletext
+ (WST), defined on ITU-R BT.653-2 */
+#define V4L2_SLICED_TELETEXT_B (0x0001)
+/* Video Program System, defined on ETS 300 231*/
+#define V4L2_SLICED_VPS (0x0400)
+/* Closed Caption, defined on EIA-608 */
+#define V4L2_SLICED_CAPTION_525 (0x1000)
+/* Wide Screen System, defined on ITU-R BT1119.1 */
+#define V4L2_SLICED_WSS_625 (0x4000)
+
+#define V4L2_SLICED_VBI_525 (V4L2_SLICED_CAPTION_525)
+#define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_B | V4L2_SLICED_VPS | V4L2_SLICED_WSS_625)
+
+struct v4l2_sliced_vbi_cap
+{
+ __u16 service_set;
+ /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field
+ service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field
+ (equals frame lines 313-336 for 625 line video
+ standards, 263-286 for 525 line standards) */
+ __u16 service_lines[2][24];
+ enum v4l2_buf_type type;
+ __u32 reserved[3]; /* must be 0 */
+};
+
+struct v4l2_sliced_vbi_data
+{
+ __u32 id;
+ __u32 field; /* 0: first field, 1: second field */
+ __u32 line; /* 1-23 */
+ __u32 reserved; /* must be 0 */
+ __u8 data[48];
+};
+
+/*
+ * A G G R E G A T E S T R U C T U R E S
+ */
+
+/* Stream data format
+ */
+struct v4l2_format
+{
+ enum v4l2_buf_type type;
+ union
+ {
+ struct v4l2_pix_format pix; // V4L2_BUF_TYPE_VIDEO_CAPTURE
+ struct v4l2_window win; // V4L2_BUF_TYPE_VIDEO_OVERLAY
+ struct v4l2_vbi_format vbi; // V4L2_BUF_TYPE_VBI_CAPTURE
+ struct v4l2_sliced_vbi_format sliced; // V4L2_BUF_TYPE_SLICED_VBI_CAPTURE
+ __u8 raw_data[200]; // user-defined
+ } fmt;
+};
+
+
+/* Stream type-dependent parameters
+ */
+struct v4l2_streamparm
+{
+ enum v4l2_buf_type type;
+ union
+ {
+ struct v4l2_captureparm capture;
+ struct v4l2_outputparm output;
+ __u8 raw_data[200]; /* user-defined */
+ } parm;
+};
+
+/*
+ * A D V A N C E D D E B U G G I N G
+ *
+ * NOTE: EXPERIMENTAL API
+ */
+
+/* VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER */
+
+#define V4L2_CHIP_MATCH_HOST 0 /* Match against chip ID on host (0 for the host) */
+#define V4L2_CHIP_MATCH_I2C_DRIVER 1 /* Match against I2C driver ID */
+#define V4L2_CHIP_MATCH_I2C_ADDR 2 /* Match against I2C 7-bit address */
+
+struct v4l2_register {
+ __u32 match_type; /* Match type */
+ __u32 match_chip; /* Match this chip, meaning determined by match_type */
+ __u64 reg;
+ __u64 val;
+};
+
+/* VIDIOC_G_CHIP_IDENT */
+struct v4l2_chip_ident {
+ __u32 match_type; /* Match type */
+ __u32 match_chip; /* Match this chip, meaning determined by match_type */
+ __u32 ident; /* chip identifier as specified in <media/v4l2-chip-ident.h> */
+ __u32 revision; /* chip revision, chip specific */
+};
+
+/*
+ * I O C T L C O D E S F O R V I D E O D E V I C E S
+ *
+ */
+#define VIDIOC_QUERYCAP _IOR ('V', 0, struct v4l2_capability)
+#define VIDIOC_RESERVED _IO ('V', 1)
+#define VIDIOC_ENUM_FMT _IOWR ('V', 2, struct v4l2_fmtdesc)
+#define VIDIOC_G_FMT _IOWR ('V', 4, struct v4l2_format)
+#define VIDIOC_S_FMT _IOWR ('V', 5, struct v4l2_format)
+#define VIDIOC_REQBUFS _IOWR ('V', 8, struct v4l2_requestbuffers)
+#define VIDIOC_QUERYBUF _IOWR ('V', 9, struct v4l2_buffer)
+#define VIDIOC_G_FBUF _IOR ('V', 10, struct v4l2_framebuffer)
+#define VIDIOC_S_FBUF _IOW ('V', 11, struct v4l2_framebuffer)
+#define VIDIOC_OVERLAY _IOW ('V', 14, int)
+#define VIDIOC_QBUF _IOWR ('V', 15, struct v4l2_buffer)
+#define VIDIOC_DQBUF _IOWR ('V', 17, struct v4l2_buffer)
+#define VIDIOC_STREAMON _IOW ('V', 18, int)
+#define VIDIOC_STREAMOFF _IOW ('V', 19, int)
+#define VIDIOC_G_PARM _IOWR ('V', 21, struct v4l2_streamparm)
+#define VIDIOC_S_PARM _IOWR ('V', 22, struct v4l2_streamparm)
+#define VIDIOC_G_STD _IOR ('V', 23, v4l2_std_id)
+#define VIDIOC_S_STD _IOW ('V', 24, v4l2_std_id)
+#define VIDIOC_ENUMSTD _IOWR ('V', 25, struct v4l2_standard)
+#define VIDIOC_ENUMINPUT _IOWR ('V', 26, struct v4l2_input)
+#define VIDIOC_G_CTRL _IOWR ('V', 27, struct v4l2_control)
+#define VIDIOC_S_CTRL _IOWR ('V', 28, struct v4l2_control)
+#define VIDIOC_G_TUNER _IOWR ('V', 29, struct v4l2_tuner)
+#define VIDIOC_S_TUNER _IOW ('V', 30, struct v4l2_tuner)
+#define VIDIOC_G_AUDIO _IOR ('V', 33, struct v4l2_audio)
+#define VIDIOC_S_AUDIO _IOW ('V', 34, struct v4l2_audio)
+#define VIDIOC_QUERYCTRL _IOWR ('V', 36, struct v4l2_queryctrl)
+#define VIDIOC_QUERYMENU _IOWR ('V', 37, struct v4l2_querymenu)
+#define VIDIOC_G_INPUT _IOR ('V', 38, int)
+#define VIDIOC_S_INPUT _IOWR ('V', 39, int)
+#define VIDIOC_G_OUTPUT _IOR ('V', 46, int)
+#define VIDIOC_S_OUTPUT _IOWR ('V', 47, int)
+#define VIDIOC_ENUMOUTPUT _IOWR ('V', 48, struct v4l2_output)
+#define VIDIOC_G_AUDOUT _IOR ('V', 49, struct v4l2_audioout)
+#define VIDIOC_S_AUDOUT _IOW ('V', 50, struct v4l2_audioout)
+#define VIDIOC_G_MODULATOR _IOWR ('V', 54, struct v4l2_modulator)
+#define VIDIOC_S_MODULATOR _IOW ('V', 55, struct v4l2_modulator)
+#define VIDIOC_G_FREQUENCY _IOWR ('V', 56, struct v4l2_frequency)
+#define VIDIOC_S_FREQUENCY _IOW ('V', 57, struct v4l2_frequency)
+#define VIDIOC_CROPCAP _IOWR ('V', 58, struct v4l2_cropcap)
+#define VIDIOC_G_CROP _IOWR ('V', 59, struct v4l2_crop)
+#define VIDIOC_S_CROP _IOW ('V', 60, struct v4l2_crop)
+#define VIDIOC_G_JPEGCOMP _IOR ('V', 61, struct v4l2_jpegcompression)
+#define VIDIOC_S_JPEGCOMP _IOW ('V', 62, struct v4l2_jpegcompression)
+#define VIDIOC_QUERYSTD _IOR ('V', 63, v4l2_std_id)
+#define VIDIOC_TRY_FMT _IOWR ('V', 64, struct v4l2_format)
+#define VIDIOC_ENUMAUDIO _IOWR ('V', 65, struct v4l2_audio)
+#define VIDIOC_ENUMAUDOUT _IOWR ('V', 66, struct v4l2_audioout)
+#define VIDIOC_G_PRIORITY _IOR ('V', 67, enum v4l2_priority)
+#define VIDIOC_S_PRIORITY _IOW ('V', 68, enum v4l2_priority)
+#define VIDIOC_G_SLICED_VBI_CAP _IOWR ('V', 69, struct v4l2_sliced_vbi_cap)
+#define VIDIOC_LOG_STATUS _IO ('V', 70)
+#define VIDIOC_G_EXT_CTRLS _IOWR ('V', 71, struct v4l2_ext_controls)
+#define VIDIOC_S_EXT_CTRLS _IOWR ('V', 72, struct v4l2_ext_controls)
+#define VIDIOC_TRY_EXT_CTRLS _IOWR ('V', 73, struct v4l2_ext_controls)
+#if 1
+#define VIDIOC_ENUM_FRAMESIZES _IOWR ('V', 74, struct v4l2_frmsizeenum)
+#define VIDIOC_ENUM_FRAMEINTERVALS _IOWR ('V', 75, struct v4l2_frmivalenum)
+#define VIDIOC_G_ENC_INDEX _IOR ('V', 76, struct v4l2_enc_idx)
+#define VIDIOC_ENCODER_CMD _IOWR ('V', 77, struct v4l2_encoder_cmd)
+#define VIDIOC_TRY_ENCODER_CMD _IOWR ('V', 78, struct v4l2_encoder_cmd)
+
+/* Experimental, only implemented if CONFIG_VIDEO_ADV_DEBUG is defined */
+#define VIDIOC_DBG_S_REGISTER _IOW ('V', 79, struct v4l2_register)
+#define VIDIOC_DBG_G_REGISTER _IOWR ('V', 80, struct v4l2_register)
+
+#define VIDIOC_G_CHIP_IDENT _IOWR ('V', 81, struct v4l2_chip_ident)
+#endif
+
+#ifdef __OLD_VIDIOC_
+/* for compatibility, will go away some day */
+#define VIDIOC_OVERLAY_OLD _IOWR ('V', 14, int)
+#define VIDIOC_S_PARM_OLD _IOW ('V', 22, struct v4l2_streamparm)
+#define VIDIOC_S_CTRL_OLD _IOW ('V', 28, struct v4l2_control)
+#define VIDIOC_G_AUDIO_OLD _IOWR ('V', 33, struct v4l2_audio)
+#define VIDIOC_G_AUDOUT_OLD _IOWR ('V', 49, struct v4l2_audioout)
+#define VIDIOC_CROPCAP_OLD _IOR ('V', 58, struct v4l2_cropcap)
+#endif
+
+#define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */
+
+#endif /* __LINUX_VIDEODEV2_H */
+
+/*
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */
diff --git a/sysroot/usr/include/linux/videotext.h b/sysroot/usr/include/linux/videotext.h
new file mode 100644
index 0000000..1c0b410
--- /dev/null
+++ b/sysroot/usr/include/linux/videotext.h
@@ -0,0 +1,125 @@
+#ifndef _VTX_H
+#define _VTX_H
+
+/*
+ * Teletext (=Videotext) hardware decoders using interface /dev/vtx
+ * Do not confuse with drivers using /dev/vbi which decode videotext by software
+ *
+ * Videotext IOCTLs changed in order to use _IO() macros defined in <linux/ioctl.h>,
+ * unused tuner IOCTLs cleaned up by
+ * Michael Geng <linux@MichaelGeng.de>
+ *
+ * Copyright (c) 1994-97 Martin Buck <martin-2.buck@student.uni-ulm.de>
+ * Read COPYING for more information
+ *
+ */
+
+
+/*
+ * Videotext ioctls
+ */
+#define VTXIOCGETINFO _IOR (0x81, 1, vtx_info_t)
+#define VTXIOCCLRPAGE _IOW (0x81, 2, vtx_pagereq_t)
+#define VTXIOCCLRFOUND _IOW (0x81, 3, vtx_pagereq_t)
+#define VTXIOCPAGEREQ _IOW (0x81, 4, vtx_pagereq_t)
+#define VTXIOCGETSTAT _IOW (0x81, 5, vtx_pagereq_t)
+#define VTXIOCGETPAGE _IOW (0x81, 6, vtx_pagereq_t)
+#define VTXIOCSTOPDAU _IOW (0x81, 7, vtx_pagereq_t)
+#define VTXIOCPUTPAGE _IO (0x81, 8)
+#define VTXIOCSETDISP _IO (0x81, 9)
+#define VTXIOCPUTSTAT _IO (0x81, 10)
+#define VTXIOCCLRCACHE _IO (0x81, 11)
+#define VTXIOCSETVIRT _IOW (0x81, 12, long)
+
+/* for compatibility, will go away some day */
+#define VTXIOCGETINFO_OLD 0x7101 /* get version of driver & capabilities of vtx-chipset */
+#define VTXIOCCLRPAGE_OLD 0x7102 /* clear page-buffer */
+#define VTXIOCCLRFOUND_OLD 0x7103 /* clear bits indicating that page was found */
+#define VTXIOCPAGEREQ_OLD 0x7104 /* search for page */
+#define VTXIOCGETSTAT_OLD 0x7105 /* get status of page-buffer */
+#define VTXIOCGETPAGE_OLD 0x7106 /* get contents of page-buffer */
+#define VTXIOCSTOPDAU_OLD 0x7107 /* stop data acquisition unit */
+#define VTXIOCPUTPAGE_OLD 0x7108 /* display page on TV-screen */
+#define VTXIOCSETDISP_OLD 0x7109 /* set TV-mode */
+#define VTXIOCPUTSTAT_OLD 0x710a /* set status of TV-output-buffer */
+#define VTXIOCCLRCACHE_OLD 0x710b /* clear cache on VTX-interface (if avail.) */
+#define VTXIOCSETVIRT_OLD 0x710c /* turn on virtual mode (this disables TV-display) */
+
+/*
+ * Definitions for VTXIOCGETINFO
+ */
+
+#define SAA5243 0
+#define SAA5246 1
+#define SAA5249 2
+#define SAA5248 3
+#define XSTV5346 4
+
+typedef struct {
+ int version_major, version_minor; /* version of driver; if version_major changes, driver */
+ /* is not backward compatible!!! CHECK THIS!!! */
+ int numpages; /* number of page-buffers of vtx-chipset */
+ int cct_type; /* type of vtx-chipset (SAA5243, SAA5246, SAA5248 or
+ * SAA5249) */
+}
+vtx_info_t;
+
+
+/*
+ * Definitions for VTXIOC{CLRPAGE,CLRFOUND,PAGEREQ,GETSTAT,GETPAGE,STOPDAU,PUTPAGE,SETDISP}
+ */
+
+#define MIN_UNIT (1<<0)
+#define MIN_TEN (1<<1)
+#define HR_UNIT (1<<2)
+#define HR_TEN (1<<3)
+#define PG_UNIT (1<<4)
+#define PG_TEN (1<<5)
+#define PG_HUND (1<<6)
+#define PGMASK_MAX (1<<7)
+#define PGMASK_PAGE (PG_HUND | PG_TEN | PG_UNIT)
+#define PGMASK_HOUR (HR_TEN | HR_UNIT)
+#define PGMASK_MINUTE (MIN_TEN | MIN_UNIT)
+
+typedef struct
+{
+ int page; /* number of requested page (hexadecimal) */
+ int hour; /* requested hour (hexadecimal) */
+ int minute; /* requested minute (hexadecimal) */
+ int pagemask; /* mask defining which values of the above are set */
+ int pgbuf; /* buffer where page will be stored */
+ int start; /* start of requested part of page */
+ int end; /* end of requested part of page */
+ void *buffer; /* pointer to beginning of destination buffer */
+}
+vtx_pagereq_t;
+
+
+/*
+ * Definitions for VTXIOC{GETSTAT,PUTSTAT}
+ */
+
+#define VTX_PAGESIZE (40 * 24)
+#define VTX_VIRTUALSIZE (40 * 49)
+
+typedef struct
+{
+ int pagenum; /* number of page (hexadecimal) */
+ int hour; /* hour (hexadecimal) */
+ int minute; /* minute (hexadecimal) */
+ int charset; /* national charset */
+ unsigned delete : 1; /* delete page (C4) */
+ unsigned headline : 1; /* insert headline (C5) */
+ unsigned subtitle : 1; /* insert subtitle (C6) */
+ unsigned supp_header : 1; /* suppress header (C7) */
+ unsigned update : 1; /* update page (C8) */
+ unsigned inter_seq : 1; /* interrupted sequence (C9) */
+ unsigned dis_disp : 1; /* disable/suppress display (C10) */
+ unsigned serial : 1; /* serial mode (C11) */
+ unsigned notfound : 1; /* /FOUND */
+ unsigned pblf : 1; /* PBLF */
+ unsigned hamming : 1; /* hamming-error occurred */
+}
+vtx_pageinfo_t;
+
+#endif /* _VTX_H */
diff --git a/sysroot/usr/include/linux/virtio_blk.h b/sysroot/usr/include/linux/virtio_blk.h
new file mode 100644
index 0000000..bca0b10
--- /dev/null
+++ b/sysroot/usr/include/linux/virtio_blk.h
@@ -0,0 +1,53 @@
+#ifndef _LINUX_VIRTIO_BLK_H
+#define _LINUX_VIRTIO_BLK_H
+#include <linux/virtio_config.h>
+
+/* The ID for virtio_block */
+#define VIRTIO_ID_BLOCK 2
+
+/* Feature bits */
+#define VIRTIO_BLK_F_BARRIER 0 /* Does host support barriers? */
+#define VIRTIO_BLK_F_SIZE_MAX 1 /* Indicates maximum segment size */
+#define VIRTIO_BLK_F_SEG_MAX 2 /* Indicates maximum # of segments */
+
+struct virtio_blk_config
+{
+ /* The capacity (in 512-byte sectors). */
+ __le64 capacity;
+ /* The maximum segment size (if VIRTIO_BLK_F_SIZE_MAX) */
+ __le32 size_max;
+ /* The maximum number of segments (if VIRTIO_BLK_F_SEG_MAX) */
+ __le32 seg_max;
+} __attribute__((packed));
+
+/* These two define direction. */
+#define VIRTIO_BLK_T_IN 0
+#define VIRTIO_BLK_T_OUT 1
+
+/* This bit says it's a scsi command, not an actual read or write. */
+#define VIRTIO_BLK_T_SCSI_CMD 2
+
+/* Barrier before this op. */
+#define VIRTIO_BLK_T_BARRIER 0x80000000
+
+/* This is the first element of the read scatter-gather list. */
+struct virtio_blk_outhdr
+{
+ /* VIRTIO_BLK_T* */
+ __u32 type;
+ /* io priority. */
+ __u32 ioprio;
+ /* Sector (ie. 512 byte offset) */
+ __u64 sector;
+};
+
+#define VIRTIO_BLK_S_OK 0
+#define VIRTIO_BLK_S_IOERR 1
+#define VIRTIO_BLK_S_UNSUPP 2
+
+/* This is the first element of the write scatter-gather list */
+struct virtio_blk_inhdr
+{
+ unsigned char status;
+};
+#endif /* _LINUX_VIRTIO_BLK_H */
diff --git a/sysroot/usr/include/linux/virtio_config.h b/sysroot/usr/include/linux/virtio_config.h
new file mode 100644
index 0000000..23a1666
--- /dev/null
+++ b/sysroot/usr/include/linux/virtio_config.h
@@ -0,0 +1,18 @@
+#ifndef _LINUX_VIRTIO_CONFIG_H
+#define _LINUX_VIRTIO_CONFIG_H
+/* Virtio devices use a standardized configuration space to define their
+ * features and pass configuration information, but each implementation can
+ * store and access that space differently. */
+#include <linux/types.h>
+
+/* Status byte for guest to report progress, and synchronize features. */
+/* We have seen device and processed generic fields (VIRTIO_CONFIG_F_VIRTIO) */
+#define VIRTIO_CONFIG_S_ACKNOWLEDGE 1
+/* We have found a driver for the device. */
+#define VIRTIO_CONFIG_S_DRIVER 2
+/* Driver has used its parts of the config, and is happy */
+#define VIRTIO_CONFIG_S_DRIVER_OK 4
+/* We've given up on this device. */
+#define VIRTIO_CONFIG_S_FAILED 0x80
+
+#endif /* _LINUX_VIRTIO_CONFIG_H */
diff --git a/sysroot/usr/include/linux/virtio_net.h b/sysroot/usr/include/linux/virtio_net.h
new file mode 100644
index 0000000..1ea3351
--- /dev/null
+++ b/sysroot/usr/include/linux/virtio_net.h
@@ -0,0 +1,36 @@
+#ifndef _LINUX_VIRTIO_NET_H
+#define _LINUX_VIRTIO_NET_H
+#include <linux/virtio_config.h>
+
+/* The ID for virtio_net */
+#define VIRTIO_ID_NET 1
+
+/* The feature bitmap for virtio net */
+#define VIRTIO_NET_F_CSUM 0 /* Can handle pkts w/ partial csum */
+#define VIRTIO_NET_F_MAC 5 /* Host has given MAC address. */
+#define VIRTIO_NET_F_GSO 6 /* Can handle pkts w/ any GSO type */
+
+struct virtio_net_config
+{
+ /* The config defining mac address (if VIRTIO_NET_F_MAC) */
+ __u8 mac[6];
+} __attribute__((packed));
+
+/* This is the first element of the scatter-gather list. If you don't
+ * specify GSO or CSUM features, you can simply ignore the header. */
+struct virtio_net_hdr
+{
+#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 // Use csum_start, csum_offset
+ __u8 flags;
+#define VIRTIO_NET_HDR_GSO_NONE 0 // Not a GSO frame
+#define VIRTIO_NET_HDR_GSO_TCPV4 1 // GSO frame, IPv4 TCP (TSO)
+#define VIRTIO_NET_HDR_GSO_UDP 3 // GSO frame, IPv4 UDP (UFO)
+#define VIRTIO_NET_HDR_GSO_TCPV6 4 // GSO frame, IPv6 TCP
+#define VIRTIO_NET_HDR_GSO_ECN 0x80 // TCP has ECN set
+ __u8 gso_type;
+ __u16 hdr_len; /* Ethernet + IP + tcp/udp hdrs */
+ __u16 gso_size; /* Bytes to append to gso_hdr_len per frame */
+ __u16 csum_start; /* Position to start checksumming from */
+ __u16 csum_offset; /* Offset after that to place checksum */
+};
+#endif /* _LINUX_VIRTIO_NET_H */
diff --git a/sysroot/usr/include/linux/vt.h b/sysroot/usr/include/linux/vt.h
new file mode 100644
index 0000000..02c1c02
--- /dev/null
+++ b/sysroot/usr/include/linux/vt.h
@@ -0,0 +1,77 @@
+#ifndef _LINUX_VT_H
+#define _LINUX_VT_H
+
+#ifdef __KERNEL__
+struct notifier_block;
+
+struct vt_notifier_param {
+ struct vc_data *vc; /* VC on which the update happened */
+ unsigned int c; /* Printed char */
+};
+
+extern int register_vt_notifier(struct notifier_block *nb);
+extern int unregister_vt_notifier(struct notifier_block *nb);
+#endif
+
+/*
+ * These constants are also useful for user-level apps (e.g., VC
+ * resizing).
+ */
+#define MIN_NR_CONSOLES 1 /* must be at least 1 */
+#define MAX_NR_CONSOLES 63 /* serial lines start at 64 */
+#define MAX_NR_USER_CONSOLES 63 /* must be root to allocate above this */
+ /* Note: the ioctl VT_GETSTATE does not work for
+ consoles 16 and higher (since it returns a short) */
+
+/* 0x56 is 'V', to avoid collision with termios and kd */
+
+#define VT_OPENQRY 0x5600 /* find available vt */
+
+struct vt_mode {
+ char mode; /* vt mode */
+ char waitv; /* if set, hang on writes if not active */
+ short relsig; /* signal to raise on release req */
+ short acqsig; /* signal to raise on acquisition */
+ short frsig; /* unused (set to 0) */
+};
+#define VT_GETMODE 0x5601 /* get mode of active vt */
+#define VT_SETMODE 0x5602 /* set mode of active vt */
+#define VT_AUTO 0x00 /* auto vt switching */
+#define VT_PROCESS 0x01 /* process controls switching */
+#define VT_ACKACQ 0x02 /* acknowledge switch */
+
+struct vt_stat {
+ unsigned short v_active; /* active vt */
+ unsigned short v_signal; /* signal to send */
+ unsigned short v_state; /* vt bitmask */
+};
+#define VT_GETSTATE 0x5603 /* get global vt state info */
+#define VT_SENDSIG 0x5604 /* signal to send to bitmask of vts */
+
+#define VT_RELDISP 0x5605 /* release display */
+
+#define VT_ACTIVATE 0x5606 /* make vt active */
+#define VT_WAITACTIVE 0x5607 /* wait for vt active */
+#define VT_DISALLOCATE 0x5608 /* free memory associated to vt */
+
+struct vt_sizes {
+ unsigned short v_rows; /* number of rows */
+ unsigned short v_cols; /* number of columns */
+ unsigned short v_scrollsize; /* number of lines of scrollback */
+};
+#define VT_RESIZE 0x5609 /* set kernel's idea of screensize */
+
+struct vt_consize {
+ unsigned short v_rows; /* number of rows */
+ unsigned short v_cols; /* number of columns */
+ unsigned short v_vlin; /* number of pixel rows on screen */
+ unsigned short v_clin; /* number of pixel rows per character */
+ unsigned short v_vcol; /* number of pixel columns on screen */
+ unsigned short v_ccol; /* number of pixel columns per character */
+};
+#define VT_RESIZEX 0x560A /* set kernel's idea of screensize + more */
+#define VT_LOCKSWITCH 0x560B /* disallow vt switching */
+#define VT_UNLOCKSWITCH 0x560C /* allow vt switching */
+#define VT_GETHIFONTMASK 0x560D /* return hi font mask */
+
+#endif /* _LINUX_VT_H */
diff --git a/sysroot/usr/include/linux/wait.h b/sysroot/usr/include/linux/wait.h
new file mode 100644
index 0000000..03dbdc2
--- /dev/null
+++ b/sysroot/usr/include/linux/wait.h
@@ -0,0 +1,21 @@
+#ifndef _LINUX_WAIT_H
+#define _LINUX_WAIT_H
+
+#define WNOHANG 0x00000001
+#define WUNTRACED 0x00000002
+#define WSTOPPED WUNTRACED
+#define WEXITED 0x00000004
+#define WCONTINUED 0x00000008
+#define WNOWAIT 0x01000000 /* Don't reap, just poll status. */
+
+#define __WNOTHREAD 0x20000000 /* Don't wait on children of other threads in this group */
+#define __WALL 0x40000000 /* Wait on all children, regardless of type */
+#define __WCLONE 0x80000000 /* Wait only on non-SIGCHLD children */
+
+/* First argument to waitid: */
+#define P_ALL 0
+#define P_PID 1
+#define P_PGID 2
+
+
+#endif
diff --git a/sysroot/usr/include/linux/wanrouter.h b/sysroot/usr/include/linux/wanrouter.h
new file mode 100644
index 0000000..45615ab
--- /dev/null
+++ b/sysroot/usr/include/linux/wanrouter.h
@@ -0,0 +1,452 @@
+/*****************************************************************************
+* wanrouter.h Definitions for the WAN Multiprotocol Router Module.
+* This module provides API and common services for WAN Link
+* Drivers and is completely hardware-independent.
+*
+* Author: Nenad Corbic <ncorbic@sangoma.com>
+* Gideon Hack
+* Additions: Arnaldo Melo
+*
+* Copyright: (c) 1995-2000 Sangoma Technologies Inc.
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version
+* 2 of the License, or (at your option) any later version.
+* ============================================================================
+* Jul 21, 2000 Nenad Corbic Added WAN_FT1_READY State
+* Feb 24, 2000 Nenad Corbic Added support for socket based x25api
+* Jan 28, 2000 Nenad Corbic Added support for the ASYNC protocol.
+* Oct 04, 1999 Nenad Corbic Updated for 2.1.0 release
+* Jun 02, 1999 Gideon Hack Added support for the S514 adapter.
+* May 23, 1999 Arnaldo Melo Added local_addr to wanif_conf_t
+* WAN_DISCONNECTING state added
+* Jul 20, 1998 David Fong Added Inverse ARP options to 'wanif_conf_t'
+* Jun 12, 1998 David Fong Added Cisco HDLC support.
+* Dec 16, 1997 Jaspreet Singh Moved 'enable_IPX' and 'network_number' to
+* 'wanif_conf_t'
+* Dec 05, 1997 Jaspreet Singh Added 'pap', 'chap' to 'wanif_conf_t'
+* Added 'authenticator' to 'wan_ppp_conf_t'
+* Nov 06, 1997 Jaspreet Singh Changed Router Driver version to 1.1 from 1.0
+* Oct 20, 1997 Jaspreet Singh Added 'cir','bc','be' and 'mc' to 'wanif_conf_t'
+* Added 'enable_IPX' and 'network_number' to
+* 'wan_device_t'. Also added defines for
+* UDP PACKET TYPE, Interrupt test, critical values
+* for RACE conditions.
+* Oct 05, 1997 Jaspreet Singh Added 'dlci_num' and 'dlci[100]' to
+* 'wan_fr_conf_t' to configure a list of dlci(s)
+* for a NODE
+* Jul 07, 1997 Jaspreet Singh Added 'ttl' to 'wandev_conf_t' & 'wan_device_t'
+* May 29, 1997 Jaspreet Singh Added 'tx_int_enabled' to 'wan_device_t'
+* May 21, 1997 Jaspreet Singh Added 'udp_port' to 'wan_device_t'
+* Apr 25, 1997 Farhan Thawar Added 'udp_port' to 'wandev_conf_t'
+* Jan 16, 1997 Gene Kozin router_devlist made public
+* Jan 02, 1997 Gene Kozin Initial version (based on wanpipe.h).
+*****************************************************************************/
+
+#ifndef _ROUTER_H
+#define _ROUTER_H
+
+#define ROUTER_NAME "wanrouter" /* in case we ever change it */
+#define ROUTER_VERSION 1 /* version number */
+#define ROUTER_RELEASE 1 /* release (minor version) number */
+#define ROUTER_IOCTL 'W' /* for IOCTL calls */
+#define ROUTER_MAGIC 0x524D4157L /* signature: 'WANR' reversed */
+
+/* IOCTL codes for /proc/router/<device> entries (up to 255) */
+enum router_ioctls
+{
+ ROUTER_SETUP = ROUTER_IOCTL<<8, /* configure device */
+ ROUTER_DOWN, /* shut down device */
+ ROUTER_STAT, /* get device status */
+ ROUTER_IFNEW, /* add interface */
+ ROUTER_IFDEL, /* delete interface */
+ ROUTER_IFSTAT, /* get interface status */
+ ROUTER_USER = (ROUTER_IOCTL<<8)+16, /* driver-specific calls */
+ ROUTER_USER_MAX = (ROUTER_IOCTL<<8)+31
+};
+
+/* identifiers for displaying proc file data for dual port adapters */
+#define PROC_DATA_PORT_0 0x8000 /* the data is for port 0 */
+#define PROC_DATA_PORT_1 0x8001 /* the data is for port 1 */
+
+/* NLPID for packet encapsulation (ISO/IEC TR 9577) */
+#define NLPID_IP 0xCC /* Internet Protocol Datagram */
+#define NLPID_SNAP 0x80 /* IEEE Subnetwork Access Protocol */
+#define NLPID_CLNP 0x81 /* ISO/IEC 8473 */
+#define NLPID_ESIS 0x82 /* ISO/IEC 9542 */
+#define NLPID_ISIS 0x83 /* ISO/IEC ISIS */
+#define NLPID_Q933 0x08 /* CCITT Q.933 */
+
+/* Miscellaneous */
+#define WAN_IFNAME_SZ 15 /* max length of the interface name */
+#define WAN_DRVNAME_SZ 15 /* max length of the link driver name */
+#define WAN_ADDRESS_SZ 31 /* max length of the WAN media address */
+#define USED_BY_FIELD 8 /* max length of the used by field */
+
+/* Defines for UDP PACKET TYPE */
+#define UDP_PTPIPE_TYPE 0x01
+#define UDP_FPIPE_TYPE 0x02
+#define UDP_CPIPE_TYPE 0x03
+#define UDP_DRVSTATS_TYPE 0x04
+#define UDP_INVALID_TYPE 0x05
+
+/* Command return code */
+#define CMD_OK 0 /* normal firmware return code */
+#define CMD_TIMEOUT 0xFF /* firmware command timed out */
+
+/* UDP Packet Management */
+#define UDP_PKT_FRM_STACK 0x00
+#define UDP_PKT_FRM_NETWORK 0x01
+
+/* Maximum interrupt test counter */
+#define MAX_INTR_TEST_COUNTER 100
+
+/* Critical Values for RACE conditions*/
+#define CRITICAL_IN_ISR 0xA1
+#define CRITICAL_INTR_HANDLED 0xB1
+
+/****** Data Types **********************************************************/
+
+/*----------------------------------------------------------------------------
+ * X.25-specific link-level configuration.
+ */
+typedef struct wan_x25_conf
+{
+ unsigned lo_pvc; /* lowest permanent circuit number */
+ unsigned hi_pvc; /* highest permanent circuit number */
+ unsigned lo_svc; /* lowest switched circuit number */
+ unsigned hi_svc; /* highest switched circuit number */
+ unsigned hdlc_window; /* HDLC window size (1..7) */
+ unsigned pkt_window; /* X.25 packet window size (1..7) */
+ unsigned t1; /* HDLC timer T1, sec (1..30) */
+ unsigned t2; /* HDLC timer T2, sec (0..29) */
+ unsigned t4; /* HDLC supervisory frame timer = T4 * T1 */
+ unsigned n2; /* HDLC retransmission limit (1..30) */
+ unsigned t10_t20; /* X.25 RESTART timeout, sec (1..255) */
+ unsigned t11_t21; /* X.25 CALL timeout, sec (1..255) */
+ unsigned t12_t22; /* X.25 RESET timeout, sec (1..255) */
+ unsigned t13_t23; /* X.25 CLEAR timeout, sec (1..255) */
+ unsigned t16_t26; /* X.25 INTERRUPT timeout, sec (1..255) */
+ unsigned t28; /* X.25 REGISTRATION timeout, sec (1..255) */
+ unsigned r10_r20; /* RESTART retransmission limit (0..250) */
+ unsigned r12_r22; /* RESET retransmission limit (0..250) */
+ unsigned r13_r23; /* CLEAR retransmission limit (0..250) */
+ unsigned ccitt_compat; /* compatibility mode: 1988/1984/1980 */
+ unsigned x25_conf_opt; /* User defined x25 config optoins */
+ unsigned char LAPB_hdlc_only; /* Run in HDLC only mode */
+ unsigned char logging; /* Control connection logging */
+ unsigned char oob_on_modem; /* Whether to send modem status to the user app */
+} wan_x25_conf_t;
+
+/*----------------------------------------------------------------------------
+ * Frame relay specific link-level configuration.
+ */
+typedef struct wan_fr_conf
+{
+ unsigned signalling; /* local in-channel signalling type */
+ unsigned t391; /* link integrity verification timer */
+ unsigned t392; /* polling verification timer */
+ unsigned n391; /* full status polling cycle counter */
+ unsigned n392; /* error threshold counter */
+ unsigned n393; /* monitored events counter */
+ unsigned dlci_num; /* number of DLCs (access node) */
+ unsigned dlci[100]; /* List of all DLCIs */
+} wan_fr_conf_t;
+
+/*----------------------------------------------------------------------------
+ * PPP-specific link-level configuration.
+ */
+typedef struct wan_ppp_conf
+{
+ unsigned restart_tmr; /* restart timer */
+ unsigned auth_rsrt_tmr; /* authentication timer */
+ unsigned auth_wait_tmr; /* authentication timer */
+ unsigned mdm_fail_tmr; /* modem failure timer */
+ unsigned dtr_drop_tmr; /* DTR drop timer */
+ unsigned connect_tmout; /* connection timeout */
+ unsigned conf_retry; /* max. retry */
+ unsigned term_retry; /* max. retry */
+ unsigned fail_retry; /* max. retry */
+ unsigned auth_retry; /* max. retry */
+ unsigned auth_options; /* authentication opt. */
+ unsigned ip_options; /* IP options */
+ char authenticator; /* AUTHENTICATOR or not */
+ char ip_mode; /* Static/Host/Peer */
+} wan_ppp_conf_t;
+
+/*----------------------------------------------------------------------------
+ * CHDLC-specific link-level configuration.
+ */
+typedef struct wan_chdlc_conf
+{
+ unsigned char ignore_dcd; /* Protocol options: */
+ unsigned char ignore_cts; /* Ignore these to determine */
+ unsigned char ignore_keepalive; /* link status (Yes or No) */
+ unsigned char hdlc_streaming; /* hdlc_streaming mode (Y/N) */
+ unsigned char receive_only; /* no transmit buffering (Y/N) */
+ unsigned keepalive_tx_tmr; /* transmit keepalive timer */
+ unsigned keepalive_rx_tmr; /* receive keepalive timer */
+ unsigned keepalive_err_margin; /* keepalive_error_tolerance */
+ unsigned slarp_timer; /* SLARP request timer */
+} wan_chdlc_conf_t;
+
+
+/*----------------------------------------------------------------------------
+ * WAN device configuration. Passed to ROUTER_SETUP IOCTL.
+ */
+typedef struct wandev_conf
+{
+ unsigned magic; /* magic number (for verification) */
+ unsigned config_id; /* configuration structure identifier */
+ /****** hardware configuration ******/
+ unsigned ioport; /* adapter I/O port base */
+ unsigned long maddr; /* dual-port memory address */
+ unsigned msize; /* dual-port memory size */
+ int irq; /* interrupt request level */
+ int dma; /* DMA request level */
+ char S514_CPU_no[1]; /* S514 PCI adapter CPU number ('A' or 'B') */
+ unsigned PCI_slot_no; /* S514 PCI adapter slot number */
+ char auto_pci_cfg; /* S515 PCI automatic slot detection */
+ char comm_port; /* Communication Port (PRI=0, SEC=1) */
+ unsigned bps; /* data transfer rate */
+ unsigned mtu; /* maximum transmit unit size */
+ unsigned udp_port; /* UDP port for management */
+ unsigned char ttl; /* Time To Live for UDP security */
+ unsigned char ft1; /* FT1 Configurator Option */
+ char interface; /* RS-232/V.35, etc. */
+ char clocking; /* external/internal */
+ char line_coding; /* NRZ/NRZI/FM0/FM1, etc. */
+ char station; /* DTE/DCE, primary/secondary, etc. */
+ char connection; /* permanent/switched/on-demand */
+ char read_mode; /* read mode: Polling or interrupt */
+ char receive_only; /* disable tx buffers */
+ char tty; /* Create a fake tty device */
+ unsigned tty_major; /* Major number for wanpipe tty device */
+ unsigned tty_minor; /* Minor number for wanpipe tty device */
+ unsigned tty_mode; /* TTY operation mode SYNC or ASYNC */
+ char backup; /* Backup Mode */
+ unsigned hw_opt[4]; /* other hardware options */
+ unsigned reserved[4];
+ /****** arbitrary data ***************/
+ unsigned data_size; /* data buffer size */
+ void* data; /* data buffer, e.g. firmware */
+ union /****** protocol-specific ************/
+ {
+ wan_x25_conf_t x25; /* X.25 configuration */
+ wan_ppp_conf_t ppp; /* PPP configuration */
+ wan_fr_conf_t fr; /* frame relay configuration */
+ wan_chdlc_conf_t chdlc; /* Cisco HDLC configuration */
+ } u;
+} wandev_conf_t;
+
+/* 'config_id' definitions */
+#define WANCONFIG_X25 101 /* X.25 link */
+#define WANCONFIG_FR 102 /* frame relay link */
+#define WANCONFIG_PPP 103 /* synchronous PPP link */
+#define WANCONFIG_CHDLC 104 /* Cisco HDLC Link */
+#define WANCONFIG_BSC 105 /* BiSync Streaming */
+#define WANCONFIG_HDLC 106 /* HDLC Support */
+#define WANCONFIG_MPPP 107 /* Multi Port PPP over RAW CHDLC */
+
+/*
+ * Configuration options defines.
+ */
+/* general options */
+#define WANOPT_OFF 0
+#define WANOPT_ON 1
+#define WANOPT_NO 0
+#define WANOPT_YES 1
+
+/* intercace options */
+#define WANOPT_RS232 0
+#define WANOPT_V35 1
+
+/* data encoding options */
+#define WANOPT_NRZ 0
+#define WANOPT_NRZI 1
+#define WANOPT_FM0 2
+#define WANOPT_FM1 3
+
+/* link type options */
+#define WANOPT_POINTTOPOINT 0 /* RTS always active */
+#define WANOPT_MULTIDROP 1 /* RTS is active when transmitting */
+
+/* clocking options */
+#define WANOPT_EXTERNAL 0
+#define WANOPT_INTERNAL 1
+
+/* station options */
+#define WANOPT_DTE 0
+#define WANOPT_DCE 1
+#define WANOPT_CPE 0
+#define WANOPT_NODE 1
+#define WANOPT_SECONDARY 0
+#define WANOPT_PRIMARY 1
+
+/* connection options */
+#define WANOPT_PERMANENT 0 /* DTR always active */
+#define WANOPT_SWITCHED 1 /* use DTR to setup link (dial-up) */
+#define WANOPT_ONDEMAND 2 /* activate DTR only before sending */
+
+/* frame relay in-channel signalling */
+#define WANOPT_FR_ANSI 1 /* ANSI T1.617 Annex D */
+#define WANOPT_FR_Q933 2 /* ITU Q.933A */
+#define WANOPT_FR_LMI 3 /* LMI */
+
+/* PPP IP Mode Options */
+#define WANOPT_PPP_STATIC 0
+#define WANOPT_PPP_HOST 1
+#define WANOPT_PPP_PEER 2
+
+/* ASY Mode Options */
+#define WANOPT_ONE 1
+#define WANOPT_TWO 2
+#define WANOPT_ONE_AND_HALF 3
+
+#define WANOPT_NONE 0
+#define WANOPT_ODD 1
+#define WANOPT_EVEN 2
+
+/* CHDLC Protocol Options */
+/* DF Commmented out for now.
+
+#define WANOPT_CHDLC_NO_DCD IGNORE_DCD_FOR_LINK_STAT
+#define WANOPT_CHDLC_NO_CTS IGNORE_CTS_FOR_LINK_STAT
+#define WANOPT_CHDLC_NO_KEEPALIVE IGNORE_KPALV_FOR_LINK_STAT
+*/
+
+/* Port options */
+#define WANOPT_PRI 0
+#define WANOPT_SEC 1
+/* read mode */
+#define WANOPT_INTR 0
+#define WANOPT_POLL 1
+
+
+#define WANOPT_TTY_SYNC 0
+#define WANOPT_TTY_ASYNC 1
+/*----------------------------------------------------------------------------
+ * WAN Link Status Info (for ROUTER_STAT IOCTL).
+ */
+typedef struct wandev_stat
+{
+ unsigned state; /* link state */
+ unsigned ndev; /* number of configured interfaces */
+
+ /* link/interface configuration */
+ unsigned connection; /* permanent/switched/on-demand */
+ unsigned media_type; /* Frame relay/PPP/X.25/SDLC, etc. */
+ unsigned mtu; /* max. transmit unit for this device */
+
+ /* physical level statistics */
+ unsigned modem_status; /* modem status */
+ unsigned rx_frames; /* received frames count */
+ unsigned rx_overruns; /* receiver overrun error count */
+ unsigned rx_crc_err; /* receive CRC error count */
+ unsigned rx_aborts; /* received aborted frames count */
+ unsigned rx_bad_length; /* unexpetedly long/short frames count */
+ unsigned rx_dropped; /* frames discarded at device level */
+ unsigned tx_frames; /* transmitted frames count */
+ unsigned tx_underruns; /* aborted transmissions (underruns) count */
+ unsigned tx_timeouts; /* transmission timeouts */
+ unsigned tx_rejects; /* other transmit errors */
+
+ /* media level statistics */
+ unsigned rx_bad_format; /* frames with invalid format */
+ unsigned rx_bad_addr; /* frames with invalid media address */
+ unsigned tx_retries; /* frames re-transmitted */
+ unsigned reserved[16]; /* reserved for future use */
+} wandev_stat_t;
+
+/* 'state' defines */
+enum wan_states
+{
+ WAN_UNCONFIGURED, /* link/channel is not configured */
+ WAN_DISCONNECTED, /* link/channel is disconnected */
+ WAN_CONNECTING, /* connection is in progress */
+ WAN_CONNECTED, /* link/channel is operational */
+ WAN_LIMIT, /* for verification only */
+ WAN_DUALPORT, /* for Dual Port cards */
+ WAN_DISCONNECTING,
+ WAN_FT1_READY /* FT1 Configurator Ready */
+};
+
+enum {
+ WAN_LOCAL_IP,
+ WAN_POINTOPOINT_IP,
+ WAN_NETMASK_IP,
+ WAN_BROADCAST_IP
+};
+
+/* 'modem_status' masks */
+#define WAN_MODEM_CTS 0x0001 /* CTS line active */
+#define WAN_MODEM_DCD 0x0002 /* DCD line active */
+#define WAN_MODEM_DTR 0x0010 /* DTR line active */
+#define WAN_MODEM_RTS 0x0020 /* RTS line active */
+
+/*----------------------------------------------------------------------------
+ * WAN interface (logical channel) configuration (for ROUTER_IFNEW IOCTL).
+ */
+typedef struct wanif_conf
+{
+ unsigned magic; /* magic number */
+ unsigned config_id; /* configuration identifier */
+ char name[WAN_IFNAME_SZ+1]; /* interface name, ASCIIZ */
+ char addr[WAN_ADDRESS_SZ+1]; /* media address, ASCIIZ */
+ char usedby[USED_BY_FIELD]; /* used by API or WANPIPE */
+ unsigned idle_timeout; /* sec, before disconnecting */
+ unsigned hold_timeout; /* sec, before re-connecting */
+ unsigned cir; /* Committed Information Rate fwd,bwd*/
+ unsigned bc; /* Committed Burst Size fwd, bwd */
+ unsigned be; /* Excess Burst Size fwd, bwd */
+ unsigned char enable_IPX; /* Enable or Disable IPX */
+ unsigned char inarp; /* Send Inverse ARP requests Y/N */
+ unsigned inarp_interval; /* sec, between InARP requests */
+ unsigned long network_number; /* Network Number for IPX */
+ char mc; /* Multicast on or off */
+ char local_addr[WAN_ADDRESS_SZ+1];/* local media address, ASCIIZ */
+ unsigned char port; /* board port */
+ unsigned char protocol; /* prococol used in this channel (TCPOX25 or X25) */
+ char pap; /* PAP enabled or disabled */
+ char chap; /* CHAP enabled or disabled */
+ unsigned char userid[511]; /* List of User Id */
+ unsigned char passwd[511]; /* List of passwords */
+ unsigned char sysname[31]; /* Name of the system */
+ unsigned char ignore_dcd; /* Protocol options: */
+ unsigned char ignore_cts; /* Ignore these to determine */
+ unsigned char ignore_keepalive; /* link status (Yes or No) */
+ unsigned char hdlc_streaming; /* Hdlc streaming mode (Y/N) */
+ unsigned keepalive_tx_tmr; /* transmit keepalive timer */
+ unsigned keepalive_rx_tmr; /* receive keepalive timer */
+ unsigned keepalive_err_margin; /* keepalive_error_tolerance */
+ unsigned slarp_timer; /* SLARP request timer */
+ unsigned char ttl; /* Time To Live for UDP security */
+ char interface; /* RS-232/V.35, etc. */
+ char clocking; /* external/internal */
+ unsigned bps; /* data transfer rate */
+ unsigned mtu; /* maximum transmit unit size */
+ unsigned char if_down; /* brind down interface when disconnected */
+ unsigned char gateway; /* Is this interface a gateway */
+ unsigned char true_if_encoding; /* Set the dev->type to true board protocol */
+
+ unsigned char asy_data_trans; /* async API options */
+ unsigned char rts_hs_for_receive; /* async Protocol options */
+ unsigned char xon_xoff_hs_for_receive;
+ unsigned char xon_xoff_hs_for_transmit;
+ unsigned char dcd_hs_for_transmit;
+ unsigned char cts_hs_for_transmit;
+ unsigned char async_mode;
+ unsigned tx_bits_per_char;
+ unsigned rx_bits_per_char;
+ unsigned stop_bits;
+ unsigned char parity;
+ unsigned break_timer;
+ unsigned inter_char_timer;
+ unsigned rx_complete_length;
+ unsigned xon_char;
+ unsigned xoff_char;
+ unsigned char receive_only; /* no transmit buffering (Y/N) */
+} wanif_conf_t;
+
+#endif /* _ROUTER_H */
diff --git a/sysroot/usr/include/linux/watchdog.h b/sysroot/usr/include/linux/watchdog.h
new file mode 100644
index 0000000..5bc0c62
--- /dev/null
+++ b/sysroot/usr/include/linux/watchdog.h
@@ -0,0 +1,55 @@
+/*
+ * Generic watchdog defines. Derived from..
+ *
+ * Berkshire PC Watchdog Defines
+ * by Ken Hollis <khollis@bitgate.com>
+ *
+ */
+
+#ifndef _LINUX_WATCHDOG_H
+#define _LINUX_WATCHDOG_H
+
+#include <linux/ioctl.h>
+#include <linux/types.h>
+
+#define WATCHDOG_IOCTL_BASE 'W'
+
+struct watchdog_info {
+ __u32 options; /* Options the card/driver supports */
+ __u32 firmware_version; /* Firmware version of the card */
+ __u8 identity[32]; /* Identity of the board */
+};
+
+#define WDIOC_GETSUPPORT _IOR(WATCHDOG_IOCTL_BASE, 0, struct watchdog_info)
+#define WDIOC_GETSTATUS _IOR(WATCHDOG_IOCTL_BASE, 1, int)
+#define WDIOC_GETBOOTSTATUS _IOR(WATCHDOG_IOCTL_BASE, 2, int)
+#define WDIOC_GETTEMP _IOR(WATCHDOG_IOCTL_BASE, 3, int)
+#define WDIOC_SETOPTIONS _IOR(WATCHDOG_IOCTL_BASE, 4, int)
+#define WDIOC_KEEPALIVE _IOR(WATCHDOG_IOCTL_BASE, 5, int)
+#define WDIOC_SETTIMEOUT _IOWR(WATCHDOG_IOCTL_BASE, 6, int)
+#define WDIOC_GETTIMEOUT _IOR(WATCHDOG_IOCTL_BASE, 7, int)
+#define WDIOC_SETPRETIMEOUT _IOWR(WATCHDOG_IOCTL_BASE, 8, int)
+#define WDIOC_GETPRETIMEOUT _IOR(WATCHDOG_IOCTL_BASE, 9, int)
+#define WDIOC_GETTIMELEFT _IOR(WATCHDOG_IOCTL_BASE, 10, int)
+
+#define WDIOF_UNKNOWN -1 /* Unknown flag error */
+#define WDIOS_UNKNOWN -1 /* Unknown status error */
+
+#define WDIOF_OVERHEAT 0x0001 /* Reset due to CPU overheat */
+#define WDIOF_FANFAULT 0x0002 /* Fan failed */
+#define WDIOF_EXTERN1 0x0004 /* External relay 1 */
+#define WDIOF_EXTERN2 0x0008 /* External relay 2 */
+#define WDIOF_POWERUNDER 0x0010 /* Power bad/power fault */
+#define WDIOF_CARDRESET 0x0020 /* Card previously reset the CPU */
+#define WDIOF_POWEROVER 0x0040 /* Power over voltage */
+#define WDIOF_SETTIMEOUT 0x0080 /* Set timeout (in seconds) */
+#define WDIOF_MAGICCLOSE 0x0100 /* Supports magic close char */
+#define WDIOF_PRETIMEOUT 0x0200 /* Pretimeout (in seconds), get/set */
+#define WDIOF_KEEPALIVEPING 0x8000 /* Keep alive ping reply */
+
+#define WDIOS_DISABLECARD 0x0001 /* Turn off the watchdog timer */
+#define WDIOS_ENABLECARD 0x0002 /* Turn on the watchdog timer */
+#define WDIOS_TEMPPANIC 0x0004 /* Kernel panic on temperature trip */
+
+
+#endif /* ifndef _LINUX_WATCHDOG_H */
diff --git a/sysroot/usr/include/linux/wireless.h b/sysroot/usr/include/linux/wireless.h
new file mode 100644
index 0000000..364449f
--- /dev/null
+++ b/sysroot/usr/include/linux/wireless.h
@@ -0,0 +1,1111 @@
+/*
+ * This file define a set of standard wireless extensions
+ *
+ * Version : 22 16.3.07
+ *
+ * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com>
+ * Copyright (c) 1997-2007 Jean Tourrilhes, All Rights Reserved.
+ */
+
+#ifndef _LINUX_WIRELESS_H
+#define _LINUX_WIRELESS_H
+
+/************************** DOCUMENTATION **************************/
+/*
+ * Initial APIs (1996 -> onward) :
+ * -----------------------------
+ * Basically, the wireless extensions are for now a set of standard ioctl
+ * call + /proc/net/wireless
+ *
+ * The entry /proc/net/wireless give statistics and information on the
+ * driver.
+ * This is better than having each driver having its entry because
+ * its centralised and we may remove the driver module safely.
+ *
+ * Ioctl are used to configure the driver and issue commands. This is
+ * better than command line options of insmod because we may want to
+ * change dynamically (while the driver is running) some parameters.
+ *
+ * The ioctl mechanimsm are copied from standard devices ioctl.
+ * We have the list of command plus a structure descibing the
+ * data exchanged...
+ * Note that to add these ioctl, I was obliged to modify :
+ * # net/core/dev.c (two place + add include)
+ * # net/ipv4/af_inet.c (one place + add include)
+ *
+ * /proc/net/wireless is a copy of /proc/net/dev.
+ * We have a structure for data passed from the driver to /proc/net/wireless
+ * Too add this, I've modified :
+ * # net/core/dev.c (two other places)
+ * # include/linux/netdevice.h (one place)
+ * # include/linux/proc_fs.h (one place)
+ *
+ * New driver API (2002 -> onward) :
+ * -------------------------------
+ * This file is only concerned with the user space API and common definitions.
+ * The new driver API is defined and documented in :
+ * # include/net/iw_handler.h
+ *
+ * Note as well that /proc/net/wireless implementation has now moved in :
+ * # net/core/wireless.c
+ *
+ * Wireless Events (2002 -> onward) :
+ * --------------------------------
+ * Events are defined at the end of this file, and implemented in :
+ * # net/core/wireless.c
+ *
+ * Other comments :
+ * --------------
+ * Do not add here things that are redundant with other mechanisms
+ * (drivers init, ifconfig, /proc/net/dev, ...) and with are not
+ * wireless specific.
+ *
+ * These wireless extensions are not magic : each driver has to provide
+ * support for them...
+ *
+ * IMPORTANT NOTE : As everything in the kernel, this is very much a
+ * work in progress. Contact me if you have ideas of improvements...
+ */
+
+/***************************** INCLUDES *****************************/
+
+/* This header is used in user-space, therefore need to be sanitised
+ * for that purpose. Those includes are usually not compatible with glibc.
+ * To know which includes to use in user-space, check iwlib.h. */
+
+/***************************** VERSION *****************************/
+/*
+ * This constant is used to know the availability of the wireless
+ * extensions and to know which version of wireless extensions it is
+ * (there is some stuff that will be added in the future...)
+ * I just plan to increment with each new version.
+ */
+#define WIRELESS_EXT 22
+
+/*
+ * Changes :
+ *
+ * V2 to V3
+ * --------
+ * Alan Cox start some incompatibles changes. I've integrated a bit more.
+ * - Encryption renamed to Encode to avoid US regulation problems
+ * - Frequency changed from float to struct to avoid problems on old 386
+ *
+ * V3 to V4
+ * --------
+ * - Add sensitivity
+ *
+ * V4 to V5
+ * --------
+ * - Missing encoding definitions in range
+ * - Access points stuff
+ *
+ * V5 to V6
+ * --------
+ * - 802.11 support (ESSID ioctls)
+ *
+ * V6 to V7
+ * --------
+ * - define IW_ESSID_MAX_SIZE and IW_MAX_AP
+ *
+ * V7 to V8
+ * --------
+ * - Changed my e-mail address
+ * - More 802.11 support (nickname, rate, rts, frag)
+ * - List index in frequencies
+ *
+ * V8 to V9
+ * --------
+ * - Support for 'mode of operation' (ad-hoc, managed...)
+ * - Support for unicast and multicast power saving
+ * - Change encoding to support larger tokens (>64 bits)
+ * - Updated iw_params (disable, flags) and use it for NWID
+ * - Extracted iw_point from iwreq for clarity
+ *
+ * V9 to V10
+ * ---------
+ * - Add PM capability to range structure
+ * - Add PM modifier : MAX/MIN/RELATIVE
+ * - Add encoding option : IW_ENCODE_NOKEY
+ * - Add TxPower ioctls (work like TxRate)
+ *
+ * V10 to V11
+ * ----------
+ * - Add WE version in range (help backward/forward compatibility)
+ * - Add retry ioctls (work like PM)
+ *
+ * V11 to V12
+ * ----------
+ * - Add SIOCSIWSTATS to get /proc/net/wireless programatically
+ * - Add DEV PRIVATE IOCTL to avoid collisions in SIOCDEVPRIVATE space
+ * - Add new statistics (frag, retry, beacon)
+ * - Add average quality (for user space calibration)
+ *
+ * V12 to V13
+ * ----------
+ * - Document creation of new driver API.
+ * - Extract union iwreq_data from struct iwreq (for new driver API).
+ * - Rename SIOCSIWNAME as SIOCSIWCOMMIT
+ *
+ * V13 to V14
+ * ----------
+ * - Wireless Events support : define struct iw_event
+ * - Define additional specific event numbers
+ * - Add "addr" and "param" fields in union iwreq_data
+ * - AP scanning stuff (SIOCSIWSCAN and friends)
+ *
+ * V14 to V15
+ * ----------
+ * - Add IW_PRIV_TYPE_ADDR for struct sockaddr private arg
+ * - Make struct iw_freq signed (both m & e), add explicit padding
+ * - Add IWEVCUSTOM for driver specific event/scanning token
+ * - Add IW_MAX_GET_SPY for driver returning a lot of addresses
+ * - Add IW_TXPOW_RANGE for range of Tx Powers
+ * - Add IWEVREGISTERED & IWEVEXPIRED events for Access Points
+ * - Add IW_MODE_MONITOR for passive monitor
+ *
+ * V15 to V16
+ * ----------
+ * - Increase the number of bitrates in iw_range to 32 (for 802.11g)
+ * - Increase the number of frequencies in iw_range to 32 (for 802.11b+a)
+ * - Reshuffle struct iw_range for increases, add filler
+ * - Increase IW_MAX_AP to 64 for driver returning a lot of addresses
+ * - Remove IW_MAX_GET_SPY because conflict with enhanced spy support
+ * - Add SIOCSIWTHRSPY/SIOCGIWTHRSPY and "struct iw_thrspy"
+ * - Add IW_ENCODE_TEMP and iw_range->encoding_login_index
+ *
+ * V16 to V17
+ * ----------
+ * - Add flags to frequency -> auto/fixed
+ * - Document (struct iw_quality *)->updated, add new flags (INVALID)
+ * - Wireless Event capability in struct iw_range
+ * - Add support for relative TxPower (yick !)
+ *
+ * V17 to V18 (From Jouni Malinen <j@w1.fi>)
+ * ----------
+ * - Add support for WPA/WPA2
+ * - Add extended encoding configuration (SIOCSIWENCODEEXT and
+ * SIOCGIWENCODEEXT)
+ * - Add SIOCSIWGENIE/SIOCGIWGENIE
+ * - Add SIOCSIWMLME
+ * - Add SIOCSIWPMKSA
+ * - Add struct iw_range bit field for supported encoding capabilities
+ * - Add optional scan request parameters for SIOCSIWSCAN
+ * - Add SIOCSIWAUTH/SIOCGIWAUTH for setting authentication and WPA
+ * related parameters (extensible up to 4096 parameter values)
+ * - Add wireless events: IWEVGENIE, IWEVMICHAELMICFAILURE,
+ * IWEVASSOCREQIE, IWEVASSOCRESPIE, IWEVPMKIDCAND
+ *
+ * V18 to V19
+ * ----------
+ * - Remove (struct iw_point *)->pointer from events and streams
+ * - Remove header includes to help user space
+ * - Increase IW_ENCODING_TOKEN_MAX from 32 to 64
+ * - Add IW_QUAL_ALL_UPDATED and IW_QUAL_ALL_INVALID macros
+ * - Add explicit flag to tell stats are in dBm : IW_QUAL_DBM
+ * - Add IW_IOCTL_IDX() and IW_EVENT_IDX() macros
+ *
+ * V19 to V20
+ * ----------
+ * - RtNetlink requests support (SET/GET)
+ *
+ * V20 to V21
+ * ----------
+ * - Remove (struct net_device *)->get_wireless_stats()
+ * - Change length in ESSID and NICK to strlen() instead of strlen()+1
+ * - Add IW_RETRY_SHORT/IW_RETRY_LONG retry modifiers
+ * - Power/Retry relative values no longer * 100000
+ * - Add explicit flag to tell stats are in 802.11k RCPI : IW_QUAL_RCPI
+ *
+ * V21 to V22
+ * ----------
+ * - Prevent leaking of kernel space in stream on 64 bits.
+ */
+
+/**************************** CONSTANTS ****************************/
+
+/* -------------------------- IOCTL LIST -------------------------- */
+
+/* Wireless Identification */
+#define SIOCSIWCOMMIT 0x8B00 /* Commit pending changes to driver */
+#define SIOCGIWNAME 0x8B01 /* get name == wireless protocol */
+/* SIOCGIWNAME is used to verify the presence of Wireless Extensions.
+ * Common values : "IEEE 802.11-DS", "IEEE 802.11-FH", "IEEE 802.11b"...
+ * Don't put the name of your driver there, it's useless. */
+
+/* Basic operations */
+#define SIOCSIWNWID 0x8B02 /* set network id (pre-802.11) */
+#define SIOCGIWNWID 0x8B03 /* get network id (the cell) */
+#define SIOCSIWFREQ 0x8B04 /* set channel/frequency (Hz) */
+#define SIOCGIWFREQ 0x8B05 /* get channel/frequency (Hz) */
+#define SIOCSIWMODE 0x8B06 /* set operation mode */
+#define SIOCGIWMODE 0x8B07 /* get operation mode */
+#define SIOCSIWSENS 0x8B08 /* set sensitivity (dBm) */
+#define SIOCGIWSENS 0x8B09 /* get sensitivity (dBm) */
+
+/* Informative stuff */
+#define SIOCSIWRANGE 0x8B0A /* Unused */
+#define SIOCGIWRANGE 0x8B0B /* Get range of parameters */
+#define SIOCSIWPRIV 0x8B0C /* Unused */
+#define SIOCGIWPRIV 0x8B0D /* get private ioctl interface info */
+#define SIOCSIWSTATS 0x8B0E /* Unused */
+#define SIOCGIWSTATS 0x8B0F /* Get /proc/net/wireless stats */
+/* SIOCGIWSTATS is strictly used between user space and the kernel, and
+ * is never passed to the driver (i.e. the driver will never see it). */
+
+/* Spy support (statistics per MAC address - used for Mobile IP support) */
+#define SIOCSIWSPY 0x8B10 /* set spy addresses */
+#define SIOCGIWSPY 0x8B11 /* get spy info (quality of link) */
+#define SIOCSIWTHRSPY 0x8B12 /* set spy threshold (spy event) */
+#define SIOCGIWTHRSPY 0x8B13 /* get spy threshold */
+
+/* Access Point manipulation */
+#define SIOCSIWAP 0x8B14 /* set access point MAC addresses */
+#define SIOCGIWAP 0x8B15 /* get access point MAC addresses */
+#define SIOCGIWAPLIST 0x8B17 /* Deprecated in favor of scanning */
+#define SIOCSIWSCAN 0x8B18 /* trigger scanning (list cells) */
+#define SIOCGIWSCAN 0x8B19 /* get scanning results */
+
+/* 802.11 specific support */
+#define SIOCSIWESSID 0x8B1A /* set ESSID (network name) */
+#define SIOCGIWESSID 0x8B1B /* get ESSID */
+#define SIOCSIWNICKN 0x8B1C /* set node name/nickname */
+#define SIOCGIWNICKN 0x8B1D /* get node name/nickname */
+/* As the ESSID and NICKN are strings up to 32 bytes long, it doesn't fit
+ * within the 'iwreq' structure, so we need to use the 'data' member to
+ * point to a string in user space, like it is done for RANGE... */
+
+/* Other parameters useful in 802.11 and some other devices */
+#define SIOCSIWRATE 0x8B20 /* set default bit rate (bps) */
+#define SIOCGIWRATE 0x8B21 /* get default bit rate (bps) */
+#define SIOCSIWRTS 0x8B22 /* set RTS/CTS threshold (bytes) */
+#define SIOCGIWRTS 0x8B23 /* get RTS/CTS threshold (bytes) */
+#define SIOCSIWFRAG 0x8B24 /* set fragmentation thr (bytes) */
+#define SIOCGIWFRAG 0x8B25 /* get fragmentation thr (bytes) */
+#define SIOCSIWTXPOW 0x8B26 /* set transmit power (dBm) */
+#define SIOCGIWTXPOW 0x8B27 /* get transmit power (dBm) */
+#define SIOCSIWRETRY 0x8B28 /* set retry limits and lifetime */
+#define SIOCGIWRETRY 0x8B29 /* get retry limits and lifetime */
+
+/* Encoding stuff (scrambling, hardware security, WEP...) */
+#define SIOCSIWENCODE 0x8B2A /* set encoding token & mode */
+#define SIOCGIWENCODE 0x8B2B /* get encoding token & mode */
+/* Power saving stuff (power management, unicast and multicast) */
+#define SIOCSIWPOWER 0x8B2C /* set Power Management settings */
+#define SIOCGIWPOWER 0x8B2D /* get Power Management settings */
+
+/* WPA : Generic IEEE 802.11 informatiom element (e.g., for WPA/RSN/WMM).
+ * This ioctl uses struct iw_point and data buffer that includes IE id and len
+ * fields. More than one IE may be included in the request. Setting the generic
+ * IE to empty buffer (len=0) removes the generic IE from the driver. Drivers
+ * are allowed to generate their own WPA/RSN IEs, but in these cases, drivers
+ * are required to report the used IE as a wireless event, e.g., when
+ * associating with an AP. */
+#define SIOCSIWGENIE 0x8B30 /* set generic IE */
+#define SIOCGIWGENIE 0x8B31 /* get generic IE */
+
+/* WPA : IEEE 802.11 MLME requests */
+#define SIOCSIWMLME 0x8B16 /* request MLME operation; uses
+ * struct iw_mlme */
+/* WPA : Authentication mode parameters */
+#define SIOCSIWAUTH 0x8B32 /* set authentication mode params */
+#define SIOCGIWAUTH 0x8B33 /* get authentication mode params */
+
+/* WPA : Extended version of encoding configuration */
+#define SIOCSIWENCODEEXT 0x8B34 /* set encoding token & mode */
+#define SIOCGIWENCODEEXT 0x8B35 /* get encoding token & mode */
+
+/* WPA2 : PMKSA cache management */
+#define SIOCSIWPMKSA 0x8B36 /* PMKSA cache operation */
+
+/* -------------------- DEV PRIVATE IOCTL LIST -------------------- */
+
+/* These 32 ioctl are wireless device private, for 16 commands.
+ * Each driver is free to use them for whatever purpose it chooses,
+ * however the driver *must* export the description of those ioctls
+ * with SIOCGIWPRIV and *must* use arguments as defined below.
+ * If you don't follow those rules, DaveM is going to hate you (reason :
+ * it make mixed 32/64bit operation impossible).
+ */
+#define SIOCIWFIRSTPRIV 0x8BE0
+#define SIOCIWLASTPRIV 0x8BFF
+/* Previously, we were using SIOCDEVPRIVATE, but we now have our
+ * separate range because of collisions with other tools such as
+ * 'mii-tool'.
+ * We now have 32 commands, so a bit more space ;-).
+ * Also, all 'even' commands are only usable by root and don't return the
+ * content of ifr/iwr to user (but you are not obliged to use the set/get
+ * convention, just use every other two command). More details in iwpriv.c.
+ * And I repeat : you are not forced to use them with iwpriv, but you
+ * must be compliant with it.
+ */
+
+/* ------------------------- IOCTL STUFF ------------------------- */
+
+/* The first and the last (range) */
+#define SIOCIWFIRST 0x8B00
+#define SIOCIWLAST SIOCIWLASTPRIV /* 0x8BFF */
+#define IW_IOCTL_IDX(cmd) ((cmd) - SIOCIWFIRST)
+
+/* Odd : get (world access), even : set (root access) */
+#define IW_IS_SET(cmd) (!((cmd) & 0x1))
+#define IW_IS_GET(cmd) ((cmd) & 0x1)
+
+/* ----------------------- WIRELESS EVENTS ----------------------- */
+/* Those are *NOT* ioctls, do not issue request on them !!! */
+/* Most events use the same identifier as ioctl requests */
+
+#define IWEVTXDROP 0x8C00 /* Packet dropped to excessive retry */
+#define IWEVQUAL 0x8C01 /* Quality part of statistics (scan) */
+#define IWEVCUSTOM 0x8C02 /* Driver specific ascii string */
+#define IWEVREGISTERED 0x8C03 /* Discovered a new node (AP mode) */
+#define IWEVEXPIRED 0x8C04 /* Expired a node (AP mode) */
+#define IWEVGENIE 0x8C05 /* Generic IE (WPA, RSN, WMM, ..)
+ * (scan results); This includes id and
+ * length fields. One IWEVGENIE may
+ * contain more than one IE. Scan
+ * results may contain one or more
+ * IWEVGENIE events. */
+#define IWEVMICHAELMICFAILURE 0x8C06 /* Michael MIC failure
+ * (struct iw_michaelmicfailure)
+ */
+#define IWEVASSOCREQIE 0x8C07 /* IEs used in (Re)Association Request.
+ * The data includes id and length
+ * fields and may contain more than one
+ * IE. This event is required in
+ * Managed mode if the driver
+ * generates its own WPA/RSN IE. This
+ * should be sent just before
+ * IWEVREGISTERED event for the
+ * association. */
+#define IWEVASSOCRESPIE 0x8C08 /* IEs used in (Re)Association
+ * Response. The data includes id and
+ * length fields and may contain more
+ * than one IE. This may be sent
+ * between IWEVASSOCREQIE and
+ * IWEVREGISTERED events for the
+ * association. */
+#define IWEVPMKIDCAND 0x8C09 /* PMKID candidate for RSN
+ * pre-authentication
+ * (struct iw_pmkid_cand) */
+
+#define IWEVFIRST 0x8C00
+#define IW_EVENT_IDX(cmd) ((cmd) - IWEVFIRST)
+
+/* ------------------------- PRIVATE INFO ------------------------- */
+/*
+ * The following is used with SIOCGIWPRIV. It allow a driver to define
+ * the interface (name, type of data) for its private ioctl.
+ * Privates ioctl are SIOCIWFIRSTPRIV -> SIOCIWLASTPRIV
+ */
+
+#define IW_PRIV_TYPE_MASK 0x7000 /* Type of arguments */
+#define IW_PRIV_TYPE_NONE 0x0000
+#define IW_PRIV_TYPE_BYTE 0x1000 /* Char as number */
+#define IW_PRIV_TYPE_CHAR 0x2000 /* Char as character */
+#define IW_PRIV_TYPE_INT 0x4000 /* 32 bits int */
+#define IW_PRIV_TYPE_FLOAT 0x5000 /* struct iw_freq */
+#define IW_PRIV_TYPE_ADDR 0x6000 /* struct sockaddr */
+
+#define IW_PRIV_SIZE_FIXED 0x0800 /* Variable or fixed number of args */
+
+#define IW_PRIV_SIZE_MASK 0x07FF /* Max number of those args */
+
+/*
+ * Note : if the number of args is fixed and the size < 16 octets,
+ * instead of passing a pointer we will put args in the iwreq struct...
+ */
+
+/* ----------------------- OTHER CONSTANTS ----------------------- */
+
+/* Maximum frequencies in the range struct */
+#define IW_MAX_FREQUENCIES 32
+/* Note : if you have something like 80 frequencies,
+ * don't increase this constant and don't fill the frequency list.
+ * The user will be able to set by channel anyway... */
+
+/* Maximum bit rates in the range struct */
+#define IW_MAX_BITRATES 32
+
+/* Maximum tx powers in the range struct */
+#define IW_MAX_TXPOWER 8
+/* Note : if you more than 8 TXPowers, just set the max and min or
+ * a few of them in the struct iw_range. */
+
+/* Maximum of address that you may set with SPY */
+#define IW_MAX_SPY 8
+
+/* Maximum of address that you may get in the
+ list of access points in range */
+#define IW_MAX_AP 64
+
+/* Maximum size of the ESSID and NICKN strings */
+#define IW_ESSID_MAX_SIZE 32
+
+/* Modes of operation */
+#define IW_MODE_AUTO 0 /* Let the driver decides */
+#define IW_MODE_ADHOC 1 /* Single cell network */
+#define IW_MODE_INFRA 2 /* Multi cell network, roaming, ... */
+#define IW_MODE_MASTER 3 /* Synchronisation master or Access Point */
+#define IW_MODE_REPEAT 4 /* Wireless Repeater (forwarder) */
+#define IW_MODE_SECOND 5 /* Secondary master/repeater (backup) */
+#define IW_MODE_MONITOR 6 /* Passive monitor (listen only) */
+
+/* Statistics flags (bitmask in updated) */
+#define IW_QUAL_QUAL_UPDATED 0x01 /* Value was updated since last read */
+#define IW_QUAL_LEVEL_UPDATED 0x02
+#define IW_QUAL_NOISE_UPDATED 0x04
+#define IW_QUAL_ALL_UPDATED 0x07
+#define IW_QUAL_DBM 0x08 /* Level + Noise are dBm */
+#define IW_QUAL_QUAL_INVALID 0x10 /* Driver doesn't provide value */
+#define IW_QUAL_LEVEL_INVALID 0x20
+#define IW_QUAL_NOISE_INVALID 0x40
+#define IW_QUAL_RCPI 0x80 /* Level + Noise are 802.11k RCPI */
+#define IW_QUAL_ALL_INVALID 0x70
+
+/* Frequency flags */
+#define IW_FREQ_AUTO 0x00 /* Let the driver decides */
+#define IW_FREQ_FIXED 0x01 /* Force a specific value */
+
+/* Maximum number of size of encoding token available
+ * they are listed in the range structure */
+#define IW_MAX_ENCODING_SIZES 8
+
+/* Maximum size of the encoding token in bytes */
+#define IW_ENCODING_TOKEN_MAX 64 /* 512 bits (for now) */
+
+/* Flags for encoding (along with the token) */
+#define IW_ENCODE_INDEX 0x00FF /* Token index (if needed) */
+#define IW_ENCODE_FLAGS 0xFF00 /* Flags defined below */
+#define IW_ENCODE_MODE 0xF000 /* Modes defined below */
+#define IW_ENCODE_DISABLED 0x8000 /* Encoding disabled */
+#define IW_ENCODE_ENABLED 0x0000 /* Encoding enabled */
+#define IW_ENCODE_RESTRICTED 0x4000 /* Refuse non-encoded packets */
+#define IW_ENCODE_OPEN 0x2000 /* Accept non-encoded packets */
+#define IW_ENCODE_NOKEY 0x0800 /* Key is write only, so not present */
+#define IW_ENCODE_TEMP 0x0400 /* Temporary key */
+
+/* Power management flags available (along with the value, if any) */
+#define IW_POWER_ON 0x0000 /* No details... */
+#define IW_POWER_TYPE 0xF000 /* Type of parameter */
+#define IW_POWER_PERIOD 0x1000 /* Value is a period/duration of */
+#define IW_POWER_TIMEOUT 0x2000 /* Value is a timeout (to go asleep) */
+#define IW_POWER_MODE 0x0F00 /* Power Management mode */
+#define IW_POWER_UNICAST_R 0x0100 /* Receive only unicast messages */
+#define IW_POWER_MULTICAST_R 0x0200 /* Receive only multicast messages */
+#define IW_POWER_ALL_R 0x0300 /* Receive all messages though PM */
+#define IW_POWER_FORCE_S 0x0400 /* Force PM procedure for sending unicast */
+#define IW_POWER_REPEATER 0x0800 /* Repeat broadcast messages in PM period */
+#define IW_POWER_MODIFIER 0x000F /* Modify a parameter */
+#define IW_POWER_MIN 0x0001 /* Value is a minimum */
+#define IW_POWER_MAX 0x0002 /* Value is a maximum */
+#define IW_POWER_RELATIVE 0x0004 /* Value is not in seconds/ms/us */
+
+/* Transmit Power flags available */
+#define IW_TXPOW_TYPE 0x00FF /* Type of value */
+#define IW_TXPOW_DBM 0x0000 /* Value is in dBm */
+#define IW_TXPOW_MWATT 0x0001 /* Value is in mW */
+#define IW_TXPOW_RELATIVE 0x0002 /* Value is in arbitrary units */
+#define IW_TXPOW_RANGE 0x1000 /* Range of value between min/max */
+
+/* Retry limits and lifetime flags available */
+#define IW_RETRY_ON 0x0000 /* No details... */
+#define IW_RETRY_TYPE 0xF000 /* Type of parameter */
+#define IW_RETRY_LIMIT 0x1000 /* Maximum number of retries*/
+#define IW_RETRY_LIFETIME 0x2000 /* Maximum duration of retries in us */
+#define IW_RETRY_MODIFIER 0x00FF /* Modify a parameter */
+#define IW_RETRY_MIN 0x0001 /* Value is a minimum */
+#define IW_RETRY_MAX 0x0002 /* Value is a maximum */
+#define IW_RETRY_RELATIVE 0x0004 /* Value is not in seconds/ms/us */
+#define IW_RETRY_SHORT 0x0010 /* Value is for short packets */
+#define IW_RETRY_LONG 0x0020 /* Value is for long packets */
+
+/* Scanning request flags */
+#define IW_SCAN_DEFAULT 0x0000 /* Default scan of the driver */
+#define IW_SCAN_ALL_ESSID 0x0001 /* Scan all ESSIDs */
+#define IW_SCAN_THIS_ESSID 0x0002 /* Scan only this ESSID */
+#define IW_SCAN_ALL_FREQ 0x0004 /* Scan all Frequencies */
+#define IW_SCAN_THIS_FREQ 0x0008 /* Scan only this Frequency */
+#define IW_SCAN_ALL_MODE 0x0010 /* Scan all Modes */
+#define IW_SCAN_THIS_MODE 0x0020 /* Scan only this Mode */
+#define IW_SCAN_ALL_RATE 0x0040 /* Scan all Bit-Rates */
+#define IW_SCAN_THIS_RATE 0x0080 /* Scan only this Bit-Rate */
+/* struct iw_scan_req scan_type */
+#define IW_SCAN_TYPE_ACTIVE 0
+#define IW_SCAN_TYPE_PASSIVE 1
+/* Maximum size of returned data */
+#define IW_SCAN_MAX_DATA 4096 /* In bytes */
+
+/* Scan capability flags - in (struct iw_range *)->scan_capa */
+#define IW_SCAN_CAPA_NONE 0x00
+#define IW_SCAN_CAPA_ESSID 0x01
+#define IW_SCAN_CAPA_BSSID 0x02
+#define IW_SCAN_CAPA_CHANNEL 0x04
+#define IW_SCAN_CAPA_MODE 0x08
+#define IW_SCAN_CAPA_RATE 0x10
+#define IW_SCAN_CAPA_TYPE 0x20
+#define IW_SCAN_CAPA_TIME 0x40
+
+/* Max number of char in custom event - use multiple of them if needed */
+#define IW_CUSTOM_MAX 256 /* In bytes */
+
+/* Generic information element */
+#define IW_GENERIC_IE_MAX 1024
+
+/* MLME requests (SIOCSIWMLME / struct iw_mlme) */
+#define IW_MLME_DEAUTH 0
+#define IW_MLME_DISASSOC 1
+#define IW_MLME_AUTH 2
+#define IW_MLME_ASSOC 3
+
+/* SIOCSIWAUTH/SIOCGIWAUTH struct iw_param flags */
+#define IW_AUTH_INDEX 0x0FFF
+#define IW_AUTH_FLAGS 0xF000
+/* SIOCSIWAUTH/SIOCGIWAUTH parameters (0 .. 4095)
+ * (IW_AUTH_INDEX mask in struct iw_param flags; this is the index of the
+ * parameter that is being set/get to; value will be read/written to
+ * struct iw_param value field) */
+#define IW_AUTH_WPA_VERSION 0
+#define IW_AUTH_CIPHER_PAIRWISE 1
+#define IW_AUTH_CIPHER_GROUP 2
+#define IW_AUTH_KEY_MGMT 3
+#define IW_AUTH_TKIP_COUNTERMEASURES 4
+#define IW_AUTH_DROP_UNENCRYPTED 5
+#define IW_AUTH_80211_AUTH_ALG 6
+#define IW_AUTH_WPA_ENABLED 7
+#define IW_AUTH_RX_UNENCRYPTED_EAPOL 8
+#define IW_AUTH_ROAMING_CONTROL 9
+#define IW_AUTH_PRIVACY_INVOKED 10
+
+/* IW_AUTH_WPA_VERSION values (bit field) */
+#define IW_AUTH_WPA_VERSION_DISABLED 0x00000001
+#define IW_AUTH_WPA_VERSION_WPA 0x00000002
+#define IW_AUTH_WPA_VERSION_WPA2 0x00000004
+
+/* IW_AUTH_PAIRWISE_CIPHER and IW_AUTH_GROUP_CIPHER values (bit field) */
+#define IW_AUTH_CIPHER_NONE 0x00000001
+#define IW_AUTH_CIPHER_WEP40 0x00000002
+#define IW_AUTH_CIPHER_TKIP 0x00000004
+#define IW_AUTH_CIPHER_CCMP 0x00000008
+#define IW_AUTH_CIPHER_WEP104 0x00000010
+
+/* IW_AUTH_KEY_MGMT values (bit field) */
+#define IW_AUTH_KEY_MGMT_802_1X 1
+#define IW_AUTH_KEY_MGMT_PSK 2
+
+/* IW_AUTH_80211_AUTH_ALG values (bit field) */
+#define IW_AUTH_ALG_OPEN_SYSTEM 0x00000001
+#define IW_AUTH_ALG_SHARED_KEY 0x00000002
+#define IW_AUTH_ALG_LEAP 0x00000004
+
+/* IW_AUTH_ROAMING_CONTROL values */
+#define IW_AUTH_ROAMING_ENABLE 0 /* driver/firmware based roaming */
+#define IW_AUTH_ROAMING_DISABLE 1 /* user space program used for roaming
+ * control */
+
+/* SIOCSIWENCODEEXT definitions */
+#define IW_ENCODE_SEQ_MAX_SIZE 8
+/* struct iw_encode_ext ->alg */
+#define IW_ENCODE_ALG_NONE 0
+#define IW_ENCODE_ALG_WEP 1
+#define IW_ENCODE_ALG_TKIP 2
+#define IW_ENCODE_ALG_CCMP 3
+/* struct iw_encode_ext ->ext_flags */
+#define IW_ENCODE_EXT_TX_SEQ_VALID 0x00000001
+#define IW_ENCODE_EXT_RX_SEQ_VALID 0x00000002
+#define IW_ENCODE_EXT_GROUP_KEY 0x00000004
+#define IW_ENCODE_EXT_SET_TX_KEY 0x00000008
+
+/* IWEVMICHAELMICFAILURE : struct iw_michaelmicfailure ->flags */
+#define IW_MICFAILURE_KEY_ID 0x00000003 /* Key ID 0..3 */
+#define IW_MICFAILURE_GROUP 0x00000004
+#define IW_MICFAILURE_PAIRWISE 0x00000008
+#define IW_MICFAILURE_STAKEY 0x00000010
+#define IW_MICFAILURE_COUNT 0x00000060 /* 1 or 2 (0 = count not supported)
+ */
+
+/* Bit field values for enc_capa in struct iw_range */
+#define IW_ENC_CAPA_WPA 0x00000001
+#define IW_ENC_CAPA_WPA2 0x00000002
+#define IW_ENC_CAPA_CIPHER_TKIP 0x00000004
+#define IW_ENC_CAPA_CIPHER_CCMP 0x00000008
+
+/* Event capability macros - in (struct iw_range *)->event_capa
+ * Because we have more than 32 possible events, we use an array of
+ * 32 bit bitmasks. Note : 32 bits = 0x20 = 2^5. */
+#define IW_EVENT_CAPA_BASE(cmd) ((cmd >= SIOCIWFIRSTPRIV) ? \
+ (cmd - SIOCIWFIRSTPRIV + 0x60) : \
+ (cmd - SIOCSIWCOMMIT))
+#define IW_EVENT_CAPA_INDEX(cmd) (IW_EVENT_CAPA_BASE(cmd) >> 5)
+#define IW_EVENT_CAPA_MASK(cmd) (1 << (IW_EVENT_CAPA_BASE(cmd) & 0x1F))
+/* Event capability constants - event autogenerated by the kernel
+ * This list is valid for most 802.11 devices, customise as needed... */
+#define IW_EVENT_CAPA_K_0 (IW_EVENT_CAPA_MASK(0x8B04) | \
+ IW_EVENT_CAPA_MASK(0x8B06) | \
+ IW_EVENT_CAPA_MASK(0x8B1A))
+#define IW_EVENT_CAPA_K_1 (IW_EVENT_CAPA_MASK(0x8B2A))
+/* "Easy" macro to set events in iw_range (less efficient) */
+#define IW_EVENT_CAPA_SET(event_capa, cmd) (event_capa[IW_EVENT_CAPA_INDEX(cmd)] |= IW_EVENT_CAPA_MASK(cmd))
+#define IW_EVENT_CAPA_SET_KERNEL(event_capa) {event_capa[0] |= IW_EVENT_CAPA_K_0; event_capa[1] |= IW_EVENT_CAPA_K_1; }
+
+
+/****************************** TYPES ******************************/
+
+/* --------------------------- SUBTYPES --------------------------- */
+/*
+ * Generic format for most parameters that fit in an int
+ */
+struct iw_param
+{
+ __s32 value; /* The value of the parameter itself */
+ __u8 fixed; /* Hardware should not use auto select */
+ __u8 disabled; /* Disable the feature */
+ __u16 flags; /* Various specifc flags (if any) */
+};
+
+/*
+ * For all data larger than 16 octets, we need to use a
+ * pointer to memory allocated in user space.
+ */
+struct iw_point
+{
+ void *pointer; /* Pointer to the data (in user space) */
+ __u16 length; /* number of fields or size in bytes */
+ __u16 flags; /* Optional params */
+};
+
+/*
+ * A frequency
+ * For numbers lower than 10^9, we encode the number in 'm' and
+ * set 'e' to 0
+ * For number greater than 10^9, we divide it by the lowest power
+ * of 10 to get 'm' lower than 10^9, with 'm'= f / (10^'e')...
+ * The power of 10 is in 'e', the result of the division is in 'm'.
+ */
+struct iw_freq
+{
+ __s32 m; /* Mantissa */
+ __s16 e; /* Exponent */
+ __u8 i; /* List index (when in range struct) */
+ __u8 flags; /* Flags (fixed/auto) */
+};
+
+/*
+ * Quality of the link
+ */
+struct iw_quality
+{
+ __u8 qual; /* link quality (%retries, SNR,
+ %missed beacons or better...) */
+ __u8 level; /* signal level (dBm) */
+ __u8 noise; /* noise level (dBm) */
+ __u8 updated; /* Flags to know if updated */
+};
+
+/*
+ * Packet discarded in the wireless adapter due to
+ * "wireless" specific problems...
+ * Note : the list of counter and statistics in net_device_stats
+ * is already pretty exhaustive, and you should use that first.
+ * This is only additional stats...
+ */
+struct iw_discarded
+{
+ __u32 nwid; /* Rx : Wrong nwid/essid */
+ __u32 code; /* Rx : Unable to code/decode (WEP) */
+ __u32 fragment; /* Rx : Can't perform MAC reassembly */
+ __u32 retries; /* Tx : Max MAC retries num reached */
+ __u32 misc; /* Others cases */
+};
+
+/*
+ * Packet/Time period missed in the wireless adapter due to
+ * "wireless" specific problems...
+ */
+struct iw_missed
+{
+ __u32 beacon; /* Missed beacons/superframe */
+};
+
+/*
+ * Quality range (for spy threshold)
+ */
+struct iw_thrspy
+{
+ struct sockaddr addr; /* Source address (hw/mac) */
+ struct iw_quality qual; /* Quality of the link */
+ struct iw_quality low; /* Low threshold */
+ struct iw_quality high; /* High threshold */
+};
+
+/*
+ * Optional data for scan request
+ *
+ * Note: these optional parameters are controlling parameters for the
+ * scanning behavior, these do not apply to getting scan results
+ * (SIOCGIWSCAN). Drivers are expected to keep a local BSS table and
+ * provide a merged results with all BSSes even if the previous scan
+ * request limited scanning to a subset, e.g., by specifying an SSID.
+ * Especially, scan results are required to include an entry for the
+ * current BSS if the driver is in Managed mode and associated with an AP.
+ */
+struct iw_scan_req
+{
+ __u8 scan_type; /* IW_SCAN_TYPE_{ACTIVE,PASSIVE} */
+ __u8 essid_len;
+ __u8 num_channels; /* num entries in channel_list;
+ * 0 = scan all allowed channels */
+ __u8 flags; /* reserved as padding; use zero, this may
+ * be used in the future for adding flags
+ * to request different scan behavior */
+ struct sockaddr bssid; /* ff:ff:ff:ff:ff:ff for broadcast BSSID or
+ * individual address of a specific BSS */
+
+ /*
+ * Use this ESSID if IW_SCAN_THIS_ESSID flag is used instead of using
+ * the current ESSID. This allows scan requests for specific ESSID
+ * without having to change the current ESSID and potentially breaking
+ * the current association.
+ */
+ __u8 essid[IW_ESSID_MAX_SIZE];
+
+ /*
+ * Optional parameters for changing the default scanning behavior.
+ * These are based on the MLME-SCAN.request from IEEE Std 802.11.
+ * TU is 1.024 ms. If these are set to 0, driver is expected to use
+ * reasonable default values. min_channel_time defines the time that
+ * will be used to wait for the first reply on each channel. If no
+ * replies are received, next channel will be scanned after this. If
+ * replies are received, total time waited on the channel is defined by
+ * max_channel_time.
+ */
+ __u32 min_channel_time; /* in TU */
+ __u32 max_channel_time; /* in TU */
+
+ struct iw_freq channel_list[IW_MAX_FREQUENCIES];
+};
+
+/* ------------------------- WPA SUPPORT ------------------------- */
+
+/*
+ * Extended data structure for get/set encoding (this is used with
+ * SIOCSIWENCODEEXT/SIOCGIWENCODEEXT. struct iw_point and IW_ENCODE_*
+ * flags are used in the same way as with SIOCSIWENCODE/SIOCGIWENCODE and
+ * only the data contents changes (key data -> this structure, including
+ * key data).
+ *
+ * If the new key is the first group key, it will be set as the default
+ * TX key. Otherwise, default TX key index is only changed if
+ * IW_ENCODE_EXT_SET_TX_KEY flag is set.
+ *
+ * Key will be changed with SIOCSIWENCODEEXT in all cases except for
+ * special "change TX key index" operation which is indicated by setting
+ * key_len = 0 and ext_flags |= IW_ENCODE_EXT_SET_TX_KEY.
+ *
+ * tx_seq/rx_seq are only used when respective
+ * IW_ENCODE_EXT_{TX,RX}_SEQ_VALID flag is set in ext_flags. Normal
+ * TKIP/CCMP operation is to set RX seq with SIOCSIWENCODEEXT and start
+ * TX seq from zero whenever key is changed. SIOCGIWENCODEEXT is normally
+ * used only by an Authenticator (AP or an IBSS station) to get the
+ * current TX sequence number. Using TX_SEQ_VALID for SIOCSIWENCODEEXT and
+ * RX_SEQ_VALID for SIOCGIWENCODEEXT are optional, but can be useful for
+ * debugging/testing.
+ */
+struct iw_encode_ext
+{
+ __u32 ext_flags; /* IW_ENCODE_EXT_* */
+ __u8 tx_seq[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */
+ __u8 rx_seq[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */
+ struct sockaddr addr; /* ff:ff:ff:ff:ff:ff for broadcast/multicast
+ * (group) keys or unicast address for
+ * individual keys */
+ __u16 alg; /* IW_ENCODE_ALG_* */
+ __u16 key_len;
+ __u8 key[0];
+};
+
+/* SIOCSIWMLME data */
+struct iw_mlme
+{
+ __u16 cmd; /* IW_MLME_* */
+ __u16 reason_code;
+ struct sockaddr addr;
+};
+
+/* SIOCSIWPMKSA data */
+#define IW_PMKSA_ADD 1
+#define IW_PMKSA_REMOVE 2
+#define IW_PMKSA_FLUSH 3
+
+#define IW_PMKID_LEN 16
+
+struct iw_pmksa
+{
+ __u32 cmd; /* IW_PMKSA_* */
+ struct sockaddr bssid;
+ __u8 pmkid[IW_PMKID_LEN];
+};
+
+/* IWEVMICHAELMICFAILURE data */
+struct iw_michaelmicfailure
+{
+ __u32 flags;
+ struct sockaddr src_addr;
+ __u8 tsc[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */
+};
+
+/* IWEVPMKIDCAND data */
+#define IW_PMKID_CAND_PREAUTH 0x00000001 /* RNS pre-authentication enabled */
+struct iw_pmkid_cand
+{
+ __u32 flags; /* IW_PMKID_CAND_* */
+ __u32 index; /* the smaller the index, the higher the
+ * priority */
+ struct sockaddr bssid;
+};
+
+/* ------------------------ WIRELESS STATS ------------------------ */
+/*
+ * Wireless statistics (used for /proc/net/wireless)
+ */
+struct iw_statistics
+{
+ __u16 status; /* Status
+ * - device dependent for now */
+
+ struct iw_quality qual; /* Quality of the link
+ * (instant/mean/max) */
+ struct iw_discarded discard; /* Packet discarded counts */
+ struct iw_missed miss; /* Packet missed counts */
+};
+
+/* ------------------------ IOCTL REQUEST ------------------------ */
+/*
+ * This structure defines the payload of an ioctl, and is used
+ * below.
+ *
+ * Note that this structure should fit on the memory footprint
+ * of iwreq (which is the same as ifreq), which mean a max size of
+ * 16 octets = 128 bits. Warning, pointers might be 64 bits wide...
+ * You should check this when increasing the structures defined
+ * above in this file...
+ */
+union iwreq_data
+{
+ /* Config - generic */
+ char name[IFNAMSIZ];
+ /* Name : used to verify the presence of wireless extensions.
+ * Name of the protocol/provider... */
+
+ struct iw_point essid; /* Extended network name */
+ struct iw_param nwid; /* network id (or domain - the cell) */
+ struct iw_freq freq; /* frequency or channel :
+ * 0-1000 = channel
+ * > 1000 = frequency in Hz */
+
+ struct iw_param sens; /* signal level threshold */
+ struct iw_param bitrate; /* default bit rate */
+ struct iw_param txpower; /* default transmit power */
+ struct iw_param rts; /* RTS threshold threshold */
+ struct iw_param frag; /* Fragmentation threshold */
+ __u32 mode; /* Operation mode */
+ struct iw_param retry; /* Retry limits & lifetime */
+
+ struct iw_point encoding; /* Encoding stuff : tokens */
+ struct iw_param power; /* PM duration/timeout */
+ struct iw_quality qual; /* Quality part of statistics */
+
+ struct sockaddr ap_addr; /* Access point address */
+ struct sockaddr addr; /* Destination address (hw/mac) */
+
+ struct iw_param param; /* Other small parameters */
+ struct iw_point data; /* Other large parameters */
+};
+
+/*
+ * The structure to exchange data for ioctl.
+ * This structure is the same as 'struct ifreq', but (re)defined for
+ * convenience...
+ * Do I need to remind you about structure size (32 octets) ?
+ */
+struct iwreq
+{
+ union
+ {
+ char ifrn_name[IFNAMSIZ]; /* if name, e.g. "eth0" */
+ } ifr_ifrn;
+
+ /* Data part (defined just above) */
+ union iwreq_data u;
+};
+
+/* -------------------------- IOCTL DATA -------------------------- */
+/*
+ * For those ioctl which want to exchange mode data that what could
+ * fit in the above structure...
+ */
+
+/*
+ * Range of parameters
+ */
+
+struct iw_range
+{
+ /* Informative stuff (to choose between different interface) */
+ __u32 throughput; /* To give an idea... */
+ /* In theory this value should be the maximum benchmarked
+ * TCP/IP throughput, because with most of these devices the
+ * bit rate is meaningless (overhead an co) to estimate how
+ * fast the connection will go and pick the fastest one.
+ * I suggest people to play with Netperf or any benchmark...
+ */
+
+ /* NWID (or domain id) */
+ __u32 min_nwid; /* Minimal NWID we are able to set */
+ __u32 max_nwid; /* Maximal NWID we are able to set */
+
+ /* Old Frequency (backward compat - moved lower ) */
+ __u16 old_num_channels;
+ __u8 old_num_frequency;
+
+ /* Scan capabilities */
+ __u8 scan_capa; /* IW_SCAN_CAPA_* bit field */
+
+ /* Wireless event capability bitmasks */
+ __u32 event_capa[6];
+
+ /* signal level threshold range */
+ __s32 sensitivity;
+
+ /* Quality of link & SNR stuff */
+ /* Quality range (link, level, noise)
+ * If the quality is absolute, it will be in the range [0 ; max_qual],
+ * if the quality is dBm, it will be in the range [max_qual ; 0].
+ * Don't forget that we use 8 bit arithmetics... */
+ struct iw_quality max_qual; /* Quality of the link */
+ /* This should contain the average/typical values of the quality
+ * indicator. This should be the threshold between a "good" and
+ * a "bad" link (example : monitor going from green to orange).
+ * Currently, user space apps like quality monitors don't have any
+ * way to calibrate the measurement. With this, they can split
+ * the range between 0 and max_qual in different quality level
+ * (using a geometric subdivision centered on the average).
+ * I expect that people doing the user space apps will feedback
+ * us on which value we need to put in each driver... */
+ struct iw_quality avg_qual; /* Quality of the link */
+
+ /* Rates */
+ __u8 num_bitrates; /* Number of entries in the list */
+ __s32 bitrate[IW_MAX_BITRATES]; /* list, in bps */
+
+ /* RTS threshold */
+ __s32 min_rts; /* Minimal RTS threshold */
+ __s32 max_rts; /* Maximal RTS threshold */
+
+ /* Frag threshold */
+ __s32 min_frag; /* Minimal frag threshold */
+ __s32 max_frag; /* Maximal frag threshold */
+
+ /* Power Management duration & timeout */
+ __s32 min_pmp; /* Minimal PM period */
+ __s32 max_pmp; /* Maximal PM period */
+ __s32 min_pmt; /* Minimal PM timeout */
+ __s32 max_pmt; /* Maximal PM timeout */
+ __u16 pmp_flags; /* How to decode max/min PM period */
+ __u16 pmt_flags; /* How to decode max/min PM timeout */
+ __u16 pm_capa; /* What PM options are supported */
+
+ /* Encoder stuff */
+ __u16 encoding_size[IW_MAX_ENCODING_SIZES]; /* Different token sizes */
+ __u8 num_encoding_sizes; /* Number of entry in the list */
+ __u8 max_encoding_tokens; /* Max number of tokens */
+ /* For drivers that need a "login/passwd" form */
+ __u8 encoding_login_index; /* token index for login token */
+
+ /* Transmit power */
+ __u16 txpower_capa; /* What options are supported */
+ __u8 num_txpower; /* Number of entries in the list */
+ __s32 txpower[IW_MAX_TXPOWER]; /* list, in bps */
+
+ /* Wireless Extension version info */
+ __u8 we_version_compiled; /* Must be WIRELESS_EXT */
+ __u8 we_version_source; /* Last update of source */
+
+ /* Retry limits and lifetime */
+ __u16 retry_capa; /* What retry options are supported */
+ __u16 retry_flags; /* How to decode max/min retry limit */
+ __u16 r_time_flags; /* How to decode max/min retry life */
+ __s32 min_retry; /* Minimal number of retries */
+ __s32 max_retry; /* Maximal number of retries */
+ __s32 min_r_time; /* Minimal retry lifetime */
+ __s32 max_r_time; /* Maximal retry lifetime */
+
+ /* Frequency */
+ __u16 num_channels; /* Number of channels [0; num - 1] */
+ __u8 num_frequency; /* Number of entry in the list */
+ struct iw_freq freq[IW_MAX_FREQUENCIES]; /* list */
+ /* Note : this frequency list doesn't need to fit channel numbers,
+ * because each entry contain its channel index */
+
+ __u32 enc_capa; /* IW_ENC_CAPA_* bit field */
+};
+
+/*
+ * Private ioctl interface information
+ */
+
+struct iw_priv_args
+{
+ __u32 cmd; /* Number of the ioctl to issue */
+ __u16 set_args; /* Type and number of args */
+ __u16 get_args; /* Type and number of args */
+ char name[IFNAMSIZ]; /* Name of the extension */
+};
+
+/* ----------------------- WIRELESS EVENTS ----------------------- */
+/*
+ * Wireless events are carried through the rtnetlink socket to user
+ * space. They are encapsulated in the IFLA_WIRELESS field of
+ * a RTM_NEWLINK message.
+ */
+
+/*
+ * A Wireless Event. Contains basically the same data as the ioctl...
+ */
+struct iw_event
+{
+ __u16 len; /* Real lenght of this stuff */
+ __u16 cmd; /* Wireless IOCTL */
+ union iwreq_data u; /* IOCTL fixed payload */
+};
+
+/* Size of the Event prefix (including padding and alignement junk) */
+#define IW_EV_LCP_LEN (sizeof(struct iw_event) - sizeof(union iwreq_data))
+/* Size of the various events */
+#define IW_EV_CHAR_LEN (IW_EV_LCP_LEN + IFNAMSIZ)
+#define IW_EV_UINT_LEN (IW_EV_LCP_LEN + sizeof(__u32))
+#define IW_EV_FREQ_LEN (IW_EV_LCP_LEN + sizeof(struct iw_freq))
+#define IW_EV_PARAM_LEN (IW_EV_LCP_LEN + sizeof(struct iw_param))
+#define IW_EV_ADDR_LEN (IW_EV_LCP_LEN + sizeof(struct sockaddr))
+#define IW_EV_QUAL_LEN (IW_EV_LCP_LEN + sizeof(struct iw_quality))
+
+/* iw_point events are special. First, the payload (extra data) come at
+ * the end of the event, so they are bigger than IW_EV_POINT_LEN. Second,
+ * we omit the pointer, so start at an offset. */
+#define IW_EV_POINT_OFF (((char *) &(((struct iw_point *) NULL)->length)) - \
+ (char *) NULL)
+#define IW_EV_POINT_LEN (IW_EV_LCP_LEN + sizeof(struct iw_point) - \
+ IW_EV_POINT_OFF)
+
+/* Size of the Event prefix when packed in stream */
+#define IW_EV_LCP_PK_LEN (4)
+/* Size of the various events when packed in stream */
+#define IW_EV_CHAR_PK_LEN (IW_EV_LCP_PK_LEN + IFNAMSIZ)
+#define IW_EV_UINT_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(__u32))
+#define IW_EV_FREQ_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_freq))
+#define IW_EV_PARAM_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_param))
+#define IW_EV_ADDR_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct sockaddr))
+#define IW_EV_QUAL_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_quality))
+#define IW_EV_POINT_PK_LEN (IW_EV_LCP_LEN + 4)
+
+#endif /* _LINUX_WIRELESS_H */
diff --git a/sysroot/usr/include/linux/x25.h b/sysroot/usr/include/linux/x25.h
new file mode 100644
index 0000000..d035e4e
--- /dev/null
+++ b/sysroot/usr/include/linux/x25.h
@@ -0,0 +1,150 @@
+/*
+ * These are the public elements of the Linux kernel X.25 implementation.
+ *
+ * History
+ * mar/20/00 Daniela Squassoni Disabling/enabling of facilities
+ * negotiation.
+ * apr/02/05 Shaun Pereira Selective sub address matching with
+ * call user data
+ */
+
+#ifndef X25_KERNEL_H
+#define X25_KERNEL_H
+
+#include <linux/types.h>
+
+#define SIOCX25GSUBSCRIP (SIOCPROTOPRIVATE + 0)
+#define SIOCX25SSUBSCRIP (SIOCPROTOPRIVATE + 1)
+#define SIOCX25GFACILITIES (SIOCPROTOPRIVATE + 2)
+#define SIOCX25SFACILITIES (SIOCPROTOPRIVATE + 3)
+#define SIOCX25GCALLUSERDATA (SIOCPROTOPRIVATE + 4)
+#define SIOCX25SCALLUSERDATA (SIOCPROTOPRIVATE + 5)
+#define SIOCX25GCAUSEDIAG (SIOCPROTOPRIVATE + 6)
+#define SIOCX25SCUDMATCHLEN (SIOCPROTOPRIVATE + 7)
+#define SIOCX25CALLACCPTAPPRV (SIOCPROTOPRIVATE + 8)
+#define SIOCX25SENDCALLACCPT (SIOCPROTOPRIVATE + 9)
+#define SIOCX25GDTEFACILITIES (SIOCPROTOPRIVATE + 10)
+#define SIOCX25SDTEFACILITIES (SIOCPROTOPRIVATE + 11)
+
+/*
+ * Values for {get,set}sockopt.
+ */
+#define X25_QBITINCL 1
+
+/*
+ * X.25 Packet Size values.
+ */
+#define X25_PS16 4
+#define X25_PS32 5
+#define X25_PS64 6
+#define X25_PS128 7
+#define X25_PS256 8
+#define X25_PS512 9
+#define X25_PS1024 10
+#define X25_PS2048 11
+#define X25_PS4096 12
+
+/*
+ * An X.121 address, it is held as ASCII text, null terminated, up to 15
+ * digits and a null terminator.
+ */
+struct x25_address {
+ char x25_addr[16];
+};
+
+/*
+ * Linux X.25 Address structure, used for bind, and connect mostly.
+ */
+struct sockaddr_x25 {
+ sa_family_t sx25_family; /* Must be AF_X25 */
+ struct x25_address sx25_addr; /* X.121 Address */
+};
+
+/*
+ * DTE/DCE subscription options.
+ *
+ * As this is missing lots of options, user should expect major
+ * changes of this structure in 2.5.x which might break compatibilty.
+ * The somewhat ugly dimension 200-sizeof() is needed to maintain
+ * backward compatibility.
+ */
+struct x25_subscrip_struct {
+ char device[200-sizeof(unsigned long)];
+ unsigned long global_facil_mask; /* 0 to disable negotiation */
+ unsigned int extended;
+};
+
+/* values for above global_facil_mask */
+
+#define X25_MASK_REVERSE 0x01
+#define X25_MASK_THROUGHPUT 0x02
+#define X25_MASK_PACKET_SIZE 0x04
+#define X25_MASK_WINDOW_SIZE 0x08
+
+#define X25_MASK_CALLING_AE 0x10
+#define X25_MASK_CALLED_AE 0x20
+
+
+/*
+ * Routing table control structure.
+ */
+struct x25_route_struct {
+ struct x25_address address;
+ unsigned int sigdigits;
+ char device[200];
+};
+
+/*
+ * Facilities structure.
+ */
+struct x25_facilities {
+ unsigned int winsize_in, winsize_out;
+ unsigned int pacsize_in, pacsize_out;
+ unsigned int throughput;
+ unsigned int reverse;
+};
+
+/*
+* ITU DTE facilities
+* Only the called and calling address
+* extension are currently implemented.
+* The rest are in place to avoid the struct
+* changing size if someone needs them later
+*/
+
+struct x25_dte_facilities {
+ __u16 delay_cumul;
+ __u16 delay_target;
+ __u16 delay_max;
+ __u8 min_throughput;
+ __u8 expedited;
+ __u8 calling_len;
+ __u8 called_len;
+ __u8 calling_ae[20];
+ __u8 called_ae[20];
+};
+
+/*
+ * Call User Data structure.
+ */
+struct x25_calluserdata {
+ unsigned int cudlength;
+ unsigned char cuddata[128];
+};
+
+/*
+ * Call clearing Cause and Diagnostic structure.
+ */
+struct x25_causediag {
+ unsigned char cause;
+ unsigned char diagnostic;
+};
+
+/*
+ * Further optional call user data match length selection
+ */
+struct x25_subaddr {
+ unsigned int cudmatchlength;
+};
+
+#endif
diff --git a/sysroot/usr/include/linux/xattr.h b/sysroot/usr/include/linux/xattr.h
new file mode 100644
index 0000000..82ca33c
--- /dev/null
+++ b/sysroot/usr/include/linux/xattr.h
@@ -0,0 +1,17 @@
+/*
+ File: linux/xattr.h
+
+ Extended attributes handling.
+
+ Copyright (C) 2001 by Andreas Gruenbacher <a.gruenbacher@computer.org>
+ Copyright (c) 2001-2002 Silicon Graphics, Inc. All Rights Reserved.
+ Copyright (c) 2004 Red Hat, Inc., James Morris <jmorris@redhat.com>
+*/
+#ifndef _LINUX_XATTR_H
+#define _LINUX_XATTR_H
+
+#define XATTR_CREATE 0x1 /* set value, fail if attr already exists */
+#define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */
+
+
+#endif /* _LINUX_XATTR_H */
diff --git a/sysroot/usr/include/linux/xfrm.h b/sysroot/usr/include/linux/xfrm.h
new file mode 100644
index 0000000..51aa042
--- /dev/null
+++ b/sysroot/usr/include/linux/xfrm.h
@@ -0,0 +1,445 @@
+#ifndef _LINUX_XFRM_H
+#define _LINUX_XFRM_H
+
+#include <linux/types.h>
+
+/* All of the structures in this file may not change size as they are
+ * passed into the kernel from userspace via netlink sockets.
+ */
+
+/* Structure to encapsulate addresses. I do not want to use
+ * "standard" structure. My apologies.
+ */
+typedef union
+{
+ __be32 a4;
+ __be32 a6[4];
+} xfrm_address_t;
+
+/* Ident of a specific xfrm_state. It is used on input to lookup
+ * the state by (spi,daddr,ah/esp) or to store information about
+ * spi, protocol and tunnel address on output.
+ */
+struct xfrm_id
+{
+ xfrm_address_t daddr;
+ __be32 spi;
+ __u8 proto;
+};
+
+struct xfrm_sec_ctx {
+ __u8 ctx_doi;
+ __u8 ctx_alg;
+ __u16 ctx_len;
+ __u32 ctx_sid;
+ char ctx_str[0];
+};
+
+/* Security Context Domains of Interpretation */
+#define XFRM_SC_DOI_RESERVED 0
+#define XFRM_SC_DOI_LSM 1
+
+/* Security Context Algorithms */
+#define XFRM_SC_ALG_RESERVED 0
+#define XFRM_SC_ALG_SELINUX 1
+
+/* Selector, used as selector both on policy rules (SPD) and SAs. */
+
+struct xfrm_selector
+{
+ xfrm_address_t daddr;
+ xfrm_address_t saddr;
+ __be16 dport;
+ __be16 dport_mask;
+ __be16 sport;
+ __be16 sport_mask;
+ __u16 family;
+ __u8 prefixlen_d;
+ __u8 prefixlen_s;
+ __u8 proto;
+ int ifindex;
+ uid_t user;
+};
+
+#define XFRM_INF (~(__u64)0)
+
+struct xfrm_lifetime_cfg
+{
+ __u64 soft_byte_limit;
+ __u64 hard_byte_limit;
+ __u64 soft_packet_limit;
+ __u64 hard_packet_limit;
+ __u64 soft_add_expires_seconds;
+ __u64 hard_add_expires_seconds;
+ __u64 soft_use_expires_seconds;
+ __u64 hard_use_expires_seconds;
+};
+
+struct xfrm_lifetime_cur
+{
+ __u64 bytes;
+ __u64 packets;
+ __u64 add_time;
+ __u64 use_time;
+};
+
+struct xfrm_replay_state
+{
+ __u32 oseq;
+ __u32 seq;
+ __u32 bitmap;
+};
+
+struct xfrm_algo {
+ char alg_name[64];
+ int alg_key_len; /* in bits */
+ char alg_key[0];
+};
+
+struct xfrm_stats {
+ __u32 replay_window;
+ __u32 replay;
+ __u32 integrity_failed;
+};
+
+enum
+{
+ XFRM_POLICY_TYPE_MAIN = 0,
+ XFRM_POLICY_TYPE_SUB = 1,
+ XFRM_POLICY_TYPE_MAX = 2
+};
+
+enum
+{
+ XFRM_POLICY_IN = 0,
+ XFRM_POLICY_OUT = 1,
+ XFRM_POLICY_FWD = 2,
+ XFRM_POLICY_MAX = 3
+};
+
+enum
+{
+ XFRM_SHARE_ANY, /* No limitations */
+ XFRM_SHARE_SESSION, /* For this session only */
+ XFRM_SHARE_USER, /* For this user only */
+ XFRM_SHARE_UNIQUE /* Use once */
+};
+
+#define XFRM_MODE_TRANSPORT 0
+#define XFRM_MODE_TUNNEL 1
+#define XFRM_MODE_ROUTEOPTIMIZATION 2
+#define XFRM_MODE_IN_TRIGGER 3
+#define XFRM_MODE_BEET 4
+#define XFRM_MODE_MAX 5
+
+/* Netlink configuration messages. */
+enum {
+ XFRM_MSG_BASE = 0x10,
+
+ XFRM_MSG_NEWSA = 0x10,
+#define XFRM_MSG_NEWSA XFRM_MSG_NEWSA
+ XFRM_MSG_DELSA,
+#define XFRM_MSG_DELSA XFRM_MSG_DELSA
+ XFRM_MSG_GETSA,
+#define XFRM_MSG_GETSA XFRM_MSG_GETSA
+
+ XFRM_MSG_NEWPOLICY,
+#define XFRM_MSG_NEWPOLICY XFRM_MSG_NEWPOLICY
+ XFRM_MSG_DELPOLICY,
+#define XFRM_MSG_DELPOLICY XFRM_MSG_DELPOLICY
+ XFRM_MSG_GETPOLICY,
+#define XFRM_MSG_GETPOLICY XFRM_MSG_GETPOLICY
+
+ XFRM_MSG_ALLOCSPI,
+#define XFRM_MSG_ALLOCSPI XFRM_MSG_ALLOCSPI
+ XFRM_MSG_ACQUIRE,
+#define XFRM_MSG_ACQUIRE XFRM_MSG_ACQUIRE
+ XFRM_MSG_EXPIRE,
+#define XFRM_MSG_EXPIRE XFRM_MSG_EXPIRE
+
+ XFRM_MSG_UPDPOLICY,
+#define XFRM_MSG_UPDPOLICY XFRM_MSG_UPDPOLICY
+ XFRM_MSG_UPDSA,
+#define XFRM_MSG_UPDSA XFRM_MSG_UPDSA
+
+ XFRM_MSG_POLEXPIRE,
+#define XFRM_MSG_POLEXPIRE XFRM_MSG_POLEXPIRE
+
+ XFRM_MSG_FLUSHSA,
+#define XFRM_MSG_FLUSHSA XFRM_MSG_FLUSHSA
+ XFRM_MSG_FLUSHPOLICY,
+#define XFRM_MSG_FLUSHPOLICY XFRM_MSG_FLUSHPOLICY
+
+ XFRM_MSG_NEWAE,
+#define XFRM_MSG_NEWAE XFRM_MSG_NEWAE
+ XFRM_MSG_GETAE,
+#define XFRM_MSG_GETAE XFRM_MSG_GETAE
+
+ XFRM_MSG_REPORT,
+#define XFRM_MSG_REPORT XFRM_MSG_REPORT
+
+ XFRM_MSG_MIGRATE,
+#define XFRM_MSG_MIGRATE XFRM_MSG_MIGRATE
+
+ XFRM_MSG_NEWSADINFO,
+#define XFRM_MSG_NEWSADINFO XFRM_MSG_NEWSADINFO
+ XFRM_MSG_GETSADINFO,
+#define XFRM_MSG_GETSADINFO XFRM_MSG_GETSADINFO
+
+ XFRM_MSG_NEWSPDINFO,
+#define XFRM_MSG_NEWSPDINFO XFRM_MSG_NEWSPDINFO
+ XFRM_MSG_GETSPDINFO,
+#define XFRM_MSG_GETSPDINFO XFRM_MSG_GETSPDINFO
+ __XFRM_MSG_MAX
+};
+#define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1)
+
+#define XFRM_NR_MSGTYPES (XFRM_MSG_MAX + 1 - XFRM_MSG_BASE)
+
+/*
+ * Generic LSM security context for comunicating to user space
+ * NOTE: Same format as sadb_x_sec_ctx
+ */
+struct xfrm_user_sec_ctx {
+ __u16 len;
+ __u16 exttype;
+ __u8 ctx_alg; /* LSMs: e.g., selinux == 1 */
+ __u8 ctx_doi;
+ __u16 ctx_len;
+};
+
+struct xfrm_user_tmpl {
+ struct xfrm_id id;
+ __u16 family;
+ xfrm_address_t saddr;
+ __u32 reqid;
+ __u8 mode;
+ __u8 share;
+ __u8 optional;
+ __u32 aalgos;
+ __u32 ealgos;
+ __u32 calgos;
+};
+
+struct xfrm_encap_tmpl {
+ __u16 encap_type;
+ __be16 encap_sport;
+ __be16 encap_dport;
+ xfrm_address_t encap_oa;
+};
+
+/* AEVENT flags */
+enum xfrm_ae_ftype_t {
+ XFRM_AE_UNSPEC,
+ XFRM_AE_RTHR=1, /* replay threshold*/
+ XFRM_AE_RVAL=2, /* replay value */
+ XFRM_AE_LVAL=4, /* lifetime value */
+ XFRM_AE_ETHR=8, /* expiry timer threshold */
+ XFRM_AE_CR=16, /* Event cause is replay update */
+ XFRM_AE_CE=32, /* Event cause is timer expiry */
+ XFRM_AE_CU=64, /* Event cause is policy update */
+ __XFRM_AE_MAX
+
+#define XFRM_AE_MAX (__XFRM_AE_MAX - 1)
+};
+
+struct xfrm_userpolicy_type {
+ __u8 type;
+ __u16 reserved1;
+ __u8 reserved2;
+};
+
+/* Netlink message attributes. */
+enum xfrm_attr_type_t {
+ XFRMA_UNSPEC,
+ XFRMA_ALG_AUTH, /* struct xfrm_algo */
+ XFRMA_ALG_CRYPT, /* struct xfrm_algo */
+ XFRMA_ALG_COMP, /* struct xfrm_algo */
+ XFRMA_ENCAP, /* struct xfrm_algo + struct xfrm_encap_tmpl */
+ XFRMA_TMPL, /* 1 or more struct xfrm_user_tmpl */
+ XFRMA_SA,
+ XFRMA_POLICY,
+ XFRMA_SEC_CTX, /* struct xfrm_sec_ctx */
+ XFRMA_LTIME_VAL,
+ XFRMA_REPLAY_VAL,
+ XFRMA_REPLAY_THRESH,
+ XFRMA_ETIMER_THRESH,
+ XFRMA_SRCADDR, /* xfrm_address_t */
+ XFRMA_COADDR, /* xfrm_address_t */
+ XFRMA_LASTUSED,
+ XFRMA_POLICY_TYPE, /* struct xfrm_userpolicy_type */
+ XFRMA_MIGRATE,
+ __XFRMA_MAX
+
+#define XFRMA_MAX (__XFRMA_MAX - 1)
+};
+
+enum xfrm_sadattr_type_t {
+ XFRMA_SAD_UNSPEC,
+ XFRMA_SAD_CNT,
+ XFRMA_SAD_HINFO,
+ __XFRMA_SAD_MAX
+
+#define XFRMA_SAD_MAX (__XFRMA_SAD_MAX - 1)
+};
+
+struct xfrmu_sadhinfo {
+ __u32 sadhcnt; /* current hash bkts */
+ __u32 sadhmcnt; /* max allowed hash bkts */
+};
+
+enum xfrm_spdattr_type_t {
+ XFRMA_SPD_UNSPEC,
+ XFRMA_SPD_INFO,
+ XFRMA_SPD_HINFO,
+ __XFRMA_SPD_MAX
+
+#define XFRMA_SPD_MAX (__XFRMA_SPD_MAX - 1)
+};
+
+struct xfrmu_spdinfo {
+ __u32 incnt;
+ __u32 outcnt;
+ __u32 fwdcnt;
+ __u32 inscnt;
+ __u32 outscnt;
+ __u32 fwdscnt;
+};
+
+struct xfrmu_spdhinfo {
+ __u32 spdhcnt;
+ __u32 spdhmcnt;
+};
+
+struct xfrm_usersa_info {
+ struct xfrm_selector sel;
+ struct xfrm_id id;
+ xfrm_address_t saddr;
+ struct xfrm_lifetime_cfg lft;
+ struct xfrm_lifetime_cur curlft;
+ struct xfrm_stats stats;
+ __u32 seq;
+ __u32 reqid;
+ __u16 family;
+ __u8 mode; /* XFRM_MODE_xxx */
+ __u8 replay_window;
+ __u8 flags;
+#define XFRM_STATE_NOECN 1
+#define XFRM_STATE_DECAP_DSCP 2
+#define XFRM_STATE_NOPMTUDISC 4
+#define XFRM_STATE_WILDRECV 8
+};
+
+struct xfrm_usersa_id {
+ xfrm_address_t daddr;
+ __be32 spi;
+ __u16 family;
+ __u8 proto;
+};
+
+struct xfrm_aevent_id {
+ struct xfrm_usersa_id sa_id;
+ xfrm_address_t saddr;
+ __u32 flags;
+ __u32 reqid;
+};
+
+struct xfrm_userspi_info {
+ struct xfrm_usersa_info info;
+ __u32 min;
+ __u32 max;
+};
+
+struct xfrm_userpolicy_info {
+ struct xfrm_selector sel;
+ struct xfrm_lifetime_cfg lft;
+ struct xfrm_lifetime_cur curlft;
+ __u32 priority;
+ __u32 index;
+ __u8 dir;
+ __u8 action;
+#define XFRM_POLICY_ALLOW 0
+#define XFRM_POLICY_BLOCK 1
+ __u8 flags;
+#define XFRM_POLICY_LOCALOK 1 /* Allow user to override global policy */
+ __u8 share;
+};
+
+struct xfrm_userpolicy_id {
+ struct xfrm_selector sel;
+ __u32 index;
+ __u8 dir;
+};
+
+struct xfrm_user_acquire {
+ struct xfrm_id id;
+ xfrm_address_t saddr;
+ struct xfrm_selector sel;
+ struct xfrm_userpolicy_info policy;
+ __u32 aalgos;
+ __u32 ealgos;
+ __u32 calgos;
+ __u32 seq;
+};
+
+struct xfrm_user_expire {
+ struct xfrm_usersa_info state;
+ __u8 hard;
+};
+
+struct xfrm_user_polexpire {
+ struct xfrm_userpolicy_info pol;
+ __u8 hard;
+};
+
+struct xfrm_usersa_flush {
+ __u8 proto;
+};
+
+struct xfrm_user_report {
+ __u8 proto;
+ struct xfrm_selector sel;
+};
+
+struct xfrm_user_migrate {
+ xfrm_address_t old_daddr;
+ xfrm_address_t old_saddr;
+ xfrm_address_t new_daddr;
+ xfrm_address_t new_saddr;
+ __u8 proto;
+ __u8 mode;
+ __u16 reserved;
+ __u32 reqid;
+ __u16 old_family;
+ __u16 new_family;
+};
+
+/* backwards compatibility for userspace */
+#define XFRMGRP_ACQUIRE 1
+#define XFRMGRP_EXPIRE 2
+#define XFRMGRP_SA 4
+#define XFRMGRP_POLICY 8
+#define XFRMGRP_REPORT 0x20
+
+enum xfrm_nlgroups {
+ XFRMNLGRP_NONE,
+#define XFRMNLGRP_NONE XFRMNLGRP_NONE
+ XFRMNLGRP_ACQUIRE,
+#define XFRMNLGRP_ACQUIRE XFRMNLGRP_ACQUIRE
+ XFRMNLGRP_EXPIRE,
+#define XFRMNLGRP_EXPIRE XFRMNLGRP_EXPIRE
+ XFRMNLGRP_SA,
+#define XFRMNLGRP_SA XFRMNLGRP_SA
+ XFRMNLGRP_POLICY,
+#define XFRMNLGRP_POLICY XFRMNLGRP_POLICY
+ XFRMNLGRP_AEVENTS,
+#define XFRMNLGRP_AEVENTS XFRMNLGRP_AEVENTS
+ XFRMNLGRP_REPORT,
+#define XFRMNLGRP_REPORT XFRMNLGRP_REPORT
+ XFRMNLGRP_MIGRATE,
+#define XFRMNLGRP_MIGRATE XFRMNLGRP_MIGRATE
+ __XFRMNLGRP_MAX
+};
+#define XFRMNLGRP_MAX (__XFRMNLGRP_MAX - 1)
+
+#endif /* _LINUX_XFRM_H */
diff --git a/sysroot/usr/include/locale.h b/sysroot/usr/include/locale.h
new file mode 100644
index 0000000..08fc531
--- /dev/null
+++ b/sysroot/usr/include/locale.h
@@ -0,0 +1,210 @@
+/* Copyright (C) 1991,1992,1995-2002,2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99 Standard: 7.11 Localization <locale.h>
+ */
+
+#ifndef _LOCALE_H
+#define _LOCALE_H 1
+
+#include <features.h>
+
+#define __need_NULL
+#include <stddef.h>
+#include <bits/locale.h>
+
+__BEGIN_DECLS
+
+/* These are the possibilities for the first argument to setlocale.
+ The code assumes that the lowest LC_* symbol has the value zero. */
+#define LC_CTYPE __LC_CTYPE
+#define LC_NUMERIC __LC_NUMERIC
+#define LC_TIME __LC_TIME
+#define LC_COLLATE __LC_COLLATE
+#define LC_MONETARY __LC_MONETARY
+#define LC_MESSAGES __LC_MESSAGES
+#define LC_ALL __LC_ALL
+#define LC_PAPER __LC_PAPER
+#define LC_NAME __LC_NAME
+#define LC_ADDRESS __LC_ADDRESS
+#define LC_TELEPHONE __LC_TELEPHONE
+#define LC_MEASUREMENT __LC_MEASUREMENT
+#define LC_IDENTIFICATION __LC_IDENTIFICATION
+
+
+__BEGIN_NAMESPACE_STD
+
+/* Structure giving information about numeric and monetary notation. */
+struct lconv
+{
+ /* Numeric (non-monetary) information. */
+
+ char *decimal_point; /* Decimal point character. */
+ char *thousands_sep; /* Thousands separator. */
+ /* Each element is the number of digits in each group;
+ elements with higher indices are farther left.
+ An element with value CHAR_MAX means that no further grouping is done.
+ An element with value 0 means that the previous element is used
+ for all groups farther left. */
+ char *grouping;
+
+ /* Monetary information. */
+
+ /* First three chars are a currency symbol from ISO 4217.
+ Fourth char is the separator. Fifth char is '\0'. */
+ char *int_curr_symbol;
+ char *currency_symbol; /* Local currency symbol. */
+ char *mon_decimal_point; /* Decimal point character. */
+ char *mon_thousands_sep; /* Thousands separator. */
+ char *mon_grouping; /* Like `grouping' element (above). */
+ char *positive_sign; /* Sign for positive values. */
+ char *negative_sign; /* Sign for negative values. */
+ char int_frac_digits; /* Int'l fractional digits. */
+ char frac_digits; /* Local fractional digits. */
+ /* 1 if currency_symbol precedes a positive value, 0 if succeeds. */
+ char p_cs_precedes;
+ /* 1 iff a space separates currency_symbol from a positive value. */
+ char p_sep_by_space;
+ /* 1 if currency_symbol precedes a negative value, 0 if succeeds. */
+ char n_cs_precedes;
+ /* 1 iff a space separates currency_symbol from a negative value. */
+ char n_sep_by_space;
+ /* Positive and negative sign positions:
+ 0 Parentheses surround the quantity and currency_symbol.
+ 1 The sign string precedes the quantity and currency_symbol.
+ 2 The sign string follows the quantity and currency_symbol.
+ 3 The sign string immediately precedes the currency_symbol.
+ 4 The sign string immediately follows the currency_symbol. */
+ char p_sign_posn;
+ char n_sign_posn;
+#ifdef __USE_ISOC99
+ /* 1 if int_curr_symbol precedes a positive value, 0 if succeeds. */
+ char int_p_cs_precedes;
+ /* 1 iff a space separates int_curr_symbol from a positive value. */
+ char int_p_sep_by_space;
+ /* 1 if int_curr_symbol precedes a negative value, 0 if succeeds. */
+ char int_n_cs_precedes;
+ /* 1 iff a space separates int_curr_symbol from a negative value. */
+ char int_n_sep_by_space;
+ /* Positive and negative sign positions:
+ 0 Parentheses surround the quantity and int_curr_symbol.
+ 1 The sign string precedes the quantity and int_curr_symbol.
+ 2 The sign string follows the quantity and int_curr_symbol.
+ 3 The sign string immediately precedes the int_curr_symbol.
+ 4 The sign string immediately follows the int_curr_symbol. */
+ char int_p_sign_posn;
+ char int_n_sign_posn;
+#else
+ char __int_p_cs_precedes;
+ char __int_p_sep_by_space;
+ char __int_n_cs_precedes;
+ char __int_n_sep_by_space;
+ char __int_p_sign_posn;
+ char __int_n_sign_posn;
+#endif
+};
+
+
+/* Set and/or return the current locale. */
+extern char *setlocale (int __category, __const char *__locale) __THROW;
+
+/* Return the numeric/monetary information for the current locale. */
+extern struct lconv *localeconv (void) __THROW;
+
+__END_NAMESPACE_STD
+
+
+#ifdef __USE_GNU
+/* The concept of one static locale per category is not very well
+ thought out. Many applications will need to process its data using
+ information from several different locales. Another application is
+ the implementation of the internationalization handling in the
+ upcoming ISO C++ standard library. To support this another set of
+ the functions using locale data exist which have an additional
+ argument.
+
+ Attention: all these functions are *not* standardized in any form.
+ This is a proof-of-concept implementation. */
+
+/* Get locale datatype definition. */
+# include <xlocale.h>
+
+typedef __locale_t locale_t;
+
+/* Return a reference to a data structure representing a set of locale
+ datasets. Unlike for the CATEGORY parameter for `setlocale' the
+ CATEGORY_MASK parameter here uses a single bit for each category,
+ made by OR'ing together LC_*_MASK bits above. */
+extern __locale_t newlocale (int __category_mask, __const char *__locale,
+ __locale_t __base) __THROW;
+
+/* These are the bits that can be set in the CATEGORY_MASK argument to
+ `newlocale'. In the GNU implementation, LC_FOO_MASK has the value
+ of (1 << LC_FOO), but this is not a part of the interface that
+ callers can assume will be true. */
+# define LC_CTYPE_MASK (1 << __LC_CTYPE)
+# define LC_NUMERIC_MASK (1 << __LC_NUMERIC)
+# define LC_TIME_MASK (1 << __LC_TIME)
+# define LC_COLLATE_MASK (1 << __LC_COLLATE)
+# define LC_MONETARY_MASK (1 << __LC_MONETARY)
+# define LC_MESSAGES_MASK (1 << __LC_MESSAGES)
+# define LC_PAPER_MASK (1 << __LC_PAPER)
+# define LC_NAME_MASK (1 << __LC_NAME)
+# define LC_ADDRESS_MASK (1 << __LC_ADDRESS)
+# define LC_TELEPHONE_MASK (1 << __LC_TELEPHONE)
+# define LC_MEASUREMENT_MASK (1 << __LC_MEASUREMENT)
+# define LC_IDENTIFICATION_MASK (1 << __LC_IDENTIFICATION)
+# define LC_ALL_MASK (LC_CTYPE_MASK \
+ | LC_NUMERIC_MASK \
+ | LC_TIME_MASK \
+ | LC_COLLATE_MASK \
+ | LC_MONETARY_MASK \
+ | LC_MESSAGES_MASK \
+ | LC_PAPER_MASK \
+ | LC_NAME_MASK \
+ | LC_ADDRESS_MASK \
+ | LC_TELEPHONE_MASK \
+ | LC_MEASUREMENT_MASK \
+ | LC_IDENTIFICATION_MASK \
+ )
+
+/* Return a duplicate of the set of locale in DATASET. All usage
+ counters are increased if necessary. */
+extern __locale_t duplocale (__locale_t __dataset) __THROW;
+
+/* Free the data associated with a locale dataset previously returned
+ by a call to `setlocale_r'. */
+extern void freelocale (__locale_t __dataset) __THROW;
+
+/* Switch the current thread's locale to DATASET.
+ If DATASET is null, instead just return the current setting.
+ The special value LC_GLOBAL_LOCALE is the initial setting
+ for all threads and can also be installed any time, meaning
+ the thread uses the global settings controlled by `setlocale'. */
+extern __locale_t uselocale (__locale_t __dataset) __THROW;
+
+/* This value can be passed to `uselocale' and may be returned by it.
+ Passing this value to any other function has undefined behavior. */
+# define LC_GLOBAL_LOCALE ((__locale_t) -1L)
+
+#endif
+
+__END_DECLS
+
+#endif /* locale.h */
diff --git a/sysroot/usr/include/malloc.h b/sysroot/usr/include/malloc.h
new file mode 100644
index 0000000..b6d7a8a
--- /dev/null
+++ b/sysroot/usr/include/malloc.h
@@ -0,0 +1,174 @@
+/* Prototypes and definition for malloc implementation.
+ Copyright (C) 1996, 1997, 1999, 2000, 2002-2004, 2005, 2007
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _MALLOC_H
+#define _MALLOC_H 1
+
+#include <features.h>
+#include <stddef.h>
+# define __malloc_ptr_t void *
+
+/* Used by GNU libc internals. */
+#define __malloc_size_t size_t
+#define __malloc_ptrdiff_t ptrdiff_t
+
+#ifdef __GNUC__
+
+# define __MALLOC_P(args) args __THROW
+/* This macro will be used for functions which might take C++ callback
+ functions. */
+# define __MALLOC_PMT(args) args
+
+#else /* Not GCC. */
+
+# define __MALLOC_P(args) args
+# define __MALLOC_PMT(args) args
+
+#endif /* GCC. */
+
+
+__BEGIN_DECLS
+
+/* Allocate SIZE bytes of memory. */
+extern void *malloc __MALLOC_P ((size_t __size)) __attribute_malloc__ __wur;
+
+/* Allocate NMEMB elements of SIZE bytes each, all initialized to 0. */
+extern void *calloc __MALLOC_P ((size_t __nmemb, size_t __size))
+ __attribute_malloc__ __wur;
+
+/* Re-allocate the previously allocated block in __ptr, making the new
+ block SIZE bytes long. */
+/* __attribute_malloc__ is not used, because if realloc returns
+ the same pointer that was passed to it, aliasing needs to be allowed
+ between objects pointed by the old and new pointers. */
+extern void *realloc __MALLOC_P ((void *__ptr, size_t __size))
+ __attribute_warn_unused_result__;
+
+/* Free a block allocated by `malloc', `realloc' or `calloc'. */
+extern void free __MALLOC_P ((void *__ptr));
+
+/* Free a block allocated by `calloc'. */
+extern void cfree __MALLOC_P ((void *__ptr));
+
+/* Allocate SIZE bytes allocated to ALIGNMENT bytes. */
+extern void *memalign __MALLOC_P ((size_t __alignment, size_t __size))
+ __attribute_malloc__ __wur;
+
+/* Allocate SIZE bytes on a page boundary. */
+extern void *valloc __MALLOC_P ((size_t __size))
+ __attribute_malloc__ __wur;
+
+/* Equivalent to valloc(minimum-page-that-holds(n)), that is, round up
+ __size to nearest pagesize. */
+extern void * pvalloc __MALLOC_P ((size_t __size))
+ __attribute_malloc__ __wur;
+
+/* Underlying allocation function; successive calls should return
+ contiguous pieces of memory. */
+extern void *(*__morecore) __MALLOC_PMT ((ptrdiff_t __size));
+
+/* Default value of `__morecore'. */
+extern void *__default_morecore __MALLOC_P ((ptrdiff_t __size))
+ __attribute_malloc__;
+
+/* SVID2/XPG mallinfo structure */
+
+struct mallinfo {
+ int arena; /* non-mmapped space allocated from system */
+ int ordblks; /* number of free chunks */
+ int smblks; /* number of fastbin blocks */
+ int hblks; /* number of mmapped regions */
+ int hblkhd; /* space in mmapped regions */
+ int usmblks; /* maximum total allocated space */
+ int fsmblks; /* space available in freed fastbin blocks */
+ int uordblks; /* total allocated space */
+ int fordblks; /* total free space */
+ int keepcost; /* top-most, releasable (via malloc_trim) space */
+};
+
+/* Returns a copy of the updated current mallinfo. */
+extern struct mallinfo mallinfo __MALLOC_P ((void));
+
+/* SVID2/XPG mallopt options */
+#ifndef M_MXFAST
+# define M_MXFAST 1 /* maximum request size for "fastbins" */
+#endif
+#ifndef M_NLBLKS
+# define M_NLBLKS 2 /* UNUSED in this malloc */
+#endif
+#ifndef M_GRAIN
+# define M_GRAIN 3 /* UNUSED in this malloc */
+#endif
+#ifndef M_KEEP
+# define M_KEEP 4 /* UNUSED in this malloc */
+#endif
+
+/* mallopt options that actually do something */
+#define M_TRIM_THRESHOLD -1
+#define M_TOP_PAD -2
+#define M_MMAP_THRESHOLD -3
+#define M_MMAP_MAX -4
+#define M_CHECK_ACTION -5
+#define M_PERTURB -6
+
+/* General SVID/XPG interface to tunable parameters. */
+extern int mallopt __MALLOC_P ((int __param, int __val));
+
+/* Release all but __pad bytes of freed top-most memory back to the
+ system. Return 1 if successful, else 0. */
+extern int malloc_trim __MALLOC_P ((size_t __pad));
+
+/* Report the number of usable allocated bytes associated with allocated
+ chunk __ptr. */
+extern size_t malloc_usable_size __MALLOC_P ((void *__ptr));
+
+/* Prints brief summary statistics on stderr. */
+extern void malloc_stats __MALLOC_P ((void));
+
+/* Record the state of all malloc variables in an opaque data structure. */
+extern void *malloc_get_state __MALLOC_P ((void));
+
+/* Restore the state of all malloc variables from data obtained with
+ malloc_get_state(). */
+extern int malloc_set_state __MALLOC_P ((void *__ptr));
+
+/* Called once when malloc is initialized; redefining this variable in
+ the application provides the preferred way to set up the hook
+ pointers. */
+extern void (*__malloc_initialize_hook) __MALLOC_PMT ((void));
+/* Hooks for debugging and user-defined versions. */
+extern void (*__free_hook) __MALLOC_PMT ((void *__ptr,
+ __const __malloc_ptr_t));
+extern void *(*__malloc_hook) __MALLOC_PMT ((size_t __size,
+ __const __malloc_ptr_t));
+extern void *(*__realloc_hook) __MALLOC_PMT ((void *__ptr, size_t __size,
+ __const __malloc_ptr_t));
+extern void *(*__memalign_hook) __MALLOC_PMT ((size_t __alignment,
+ size_t __size,
+ __const __malloc_ptr_t));
+extern void (*__after_morecore_hook) __MALLOC_PMT ((void));
+
+/* Activate a standard set of debugging hooks. */
+extern void __malloc_check_init __MALLOC_P ((void));
+
+
+__END_DECLS
+
+#endif /* malloc.h */
diff --git a/sysroot/usr/include/math.h b/sysroot/usr/include/math.h
new file mode 100644
index 0000000..c50b2e7
--- /dev/null
+++ b/sysroot/usr/include/math.h
@@ -0,0 +1,468 @@
+/* Declarations for math functions.
+ Copyright (C) 1991-1993, 1995-1999, 2001, 2002, 2004, 2006
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99 Standard: 7.12 Mathematics <math.h>
+ */
+
+#ifndef _MATH_H
+#define _MATH_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Get machine-dependent HUGE_VAL value (returned on overflow).
+ On all IEEE754 machines, this is +Infinity. */
+#include <bits/huge_val.h>
+#ifdef __USE_ISOC99
+# include <bits/huge_valf.h>
+# include <bits/huge_vall.h>
+
+/* Get machine-dependent INFINITY value. */
+# include <bits/inf.h>
+
+/* Get machine-dependent NAN value (returned for some domain errors). */
+# include <bits/nan.h>
+#endif /* __USE_ISOC99 */
+
+/* Get general and ISO C99 specific information. */
+#include <bits/mathdef.h>
+
+/* The file <bits/mathcalls.h> contains the prototypes for all the
+ actual math functions. These macros are used for those prototypes,
+ so we can easily declare each function as both `name' and `__name',
+ and can declare the float versions `namef' and `__namef'. */
+
+#define __MATHCALL(function,suffix, args) \
+ __MATHDECL (_Mdouble_,function,suffix, args)
+#define __MATHDECL(type, function,suffix, args) \
+ __MATHDECL_1(type, function,suffix, args); \
+ __MATHDECL_1(type, __CONCAT(__,function),suffix, args)
+#define __MATHCALLX(function,suffix, args, attrib) \
+ __MATHDECLX (_Mdouble_,function,suffix, args, attrib)
+#define __MATHDECLX(type, function,suffix, args, attrib) \
+ __MATHDECL_1(type, function,suffix, args) __attribute__ (attrib); \
+ __MATHDECL_1(type, __CONCAT(__,function),suffix, args) __attribute__ (attrib)
+#define __MATHDECL_1(type, function,suffix, args) \
+ extern type __MATH_PRECNAME(function,suffix) args __THROW
+
+#define _Mdouble_ double
+#define __MATH_PRECNAME(name,r) __CONCAT(name,r)
+# define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_STD
+# define _Mdouble_END_NAMESPACE __END_NAMESPACE_STD
+#include <bits/mathcalls.h>
+#undef _Mdouble_
+#undef _Mdouble_BEGIN_NAMESPACE
+#undef _Mdouble_END_NAMESPACE
+#undef __MATH_PRECNAME
+
+#if defined __USE_MISC || defined __USE_ISOC99
+
+
+/* Include the file of declarations again, this time using `float'
+ instead of `double' and appending f to each function name. */
+
+# ifndef _Mfloat_
+# define _Mfloat_ float
+# endif
+# define _Mdouble_ _Mfloat_
+# ifdef __STDC__
+# define __MATH_PRECNAME(name,r) name##f##r
+# else
+# define __MATH_PRECNAME(name,r) name/**/f/**/r
+# endif
+# define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_C99
+# define _Mdouble_END_NAMESPACE __END_NAMESPACE_C99
+# include <bits/mathcalls.h>
+# undef _Mdouble_
+# undef _Mdouble_BEGIN_NAMESPACE
+# undef _Mdouble_END_NAMESPACE
+# undef __MATH_PRECNAME
+
+# if (__STDC__ - 0 || __GNUC__ - 0) \
+ && (!defined __NO_LONG_DOUBLE_MATH || defined __LDBL_COMPAT)
+# ifdef __LDBL_COMPAT
+
+# ifdef __USE_ISOC99
+extern float __nldbl_nexttowardf (float __x, long double __y)
+ __THROW __attribute__ ((__const__));
+# ifdef __REDIRECT_NTH
+extern float __REDIRECT_NTH (nexttowardf, (float __x, long double __y),
+ __nldbl_nexttowardf)
+ __attribute__ ((__const__));
+extern double __REDIRECT_NTH (nexttoward, (double __x, long double __y),
+ nextafter) __attribute__ ((__const__));
+extern long double __REDIRECT_NTH (nexttowardl,
+ (long double __x, long double __y),
+ nextafter) __attribute__ ((__const__));
+# endif
+# endif
+
+/* Include the file of declarations again, this time using `long double'
+ instead of `double' and appending l to each function name. */
+
+# undef __MATHDECL_1
+# define __MATHDECL_2(type, function,suffix, args, alias) \
+ extern type __REDIRECT_NTH(__MATH_PRECNAME(function,suffix), \
+ args, alias)
+# define __MATHDECL_1(type, function,suffix, args) \
+ __MATHDECL_2(type, function,suffix, args, __CONCAT(function,suffix))
+# endif
+
+# ifndef _Mlong_double_
+# define _Mlong_double_ long double
+# endif
+# define _Mdouble_ _Mlong_double_
+# ifdef __STDC__
+# define __MATH_PRECNAME(name,r) name##l##r
+# else
+# define __MATH_PRECNAME(name,r) name/**/l/**/r
+# endif
+# define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_C99
+# define _Mdouble_END_NAMESPACE __END_NAMESPACE_C99
+# include <bits/mathcalls.h>
+# undef _Mdouble_
+# undef _Mdouble_BEGIN_NAMESPACE
+# undef _Mdouble_END_NAMESPACE
+# undef __MATH_PRECNAME
+
+# endif /* __STDC__ || __GNUC__ */
+
+#endif /* Use misc or ISO C99. */
+#undef __MATHDECL_1
+#undef __MATHDECL
+#undef __MATHCALL
+
+
+#if defined __USE_MISC || defined __USE_XOPEN
+/* This variable is used by `gamma' and `lgamma'. */
+extern int signgam;
+#endif
+
+
+/* ISO C99 defines some generic macros which work on any data type. */
+#ifdef __USE_ISOC99
+
+/* Get the architecture specific values describing the floating-point
+ evaluation. The following symbols will get defined:
+
+ float_t floating-point type at least as wide as `float' used
+ to evaluate `float' expressions
+ double_t floating-point type at least as wide as `double' used
+ to evaluate `double' expressions
+
+ FLT_EVAL_METHOD
+ Defined to
+ 0 if `float_t' is `float' and `double_t' is `double'
+ 1 if `float_t' and `double_t' are `double'
+ 2 if `float_t' and `double_t' are `long double'
+ else `float_t' and `double_t' are unspecified
+
+ INFINITY representation of the infinity value of type `float'
+
+ FP_FAST_FMA
+ FP_FAST_FMAF
+ FP_FAST_FMAL
+ If defined it indicates that the `fma' function
+ generally executes about as fast as a multiply and an add.
+ This macro is defined only iff the `fma' function is
+ implemented directly with a hardware multiply-add instructions.
+
+ FP_ILOGB0 Expands to a value returned by `ilogb (0.0)'.
+ FP_ILOGBNAN Expands to a value returned by `ilogb (NAN)'.
+
+ DECIMAL_DIG Number of decimal digits supported by conversion between
+ decimal and all internal floating-point formats.
+
+*/
+
+/* All floating-point numbers can be put in one of these categories. */
+enum
+ {
+ FP_NAN,
+# define FP_NAN FP_NAN
+ FP_INFINITE,
+# define FP_INFINITE FP_INFINITE
+ FP_ZERO,
+# define FP_ZERO FP_ZERO
+ FP_SUBNORMAL,
+# define FP_SUBNORMAL FP_SUBNORMAL
+ FP_NORMAL
+# define FP_NORMAL FP_NORMAL
+ };
+
+/* Return number of classification appropriate for X. */
+# ifdef __NO_LONG_DOUBLE_MATH
+# define fpclassify(x) \
+ (sizeof (x) == sizeof (float) ? __fpclassifyf (x) : __fpclassify (x))
+# else
+# define fpclassify(x) \
+ (sizeof (x) == sizeof (float) \
+ ? __fpclassifyf (x) \
+ : sizeof (x) == sizeof (double) \
+ ? __fpclassify (x) : __fpclassifyl (x))
+# endif
+
+/* Return nonzero value if sign of X is negative. */
+# ifdef __NO_LONG_DOUBLE_MATH
+# define signbit(x) \
+ (sizeof (x) == sizeof (float) ? __signbitf (x) : __signbit (x))
+# else
+# define signbit(x) \
+ (sizeof (x) == sizeof (float) \
+ ? __signbitf (x) \
+ : sizeof (x) == sizeof (double) \
+ ? __signbit (x) : __signbitl (x))
+# endif
+
+/* Return nonzero value if X is not +-Inf or NaN. */
+# ifdef __NO_LONG_DOUBLE_MATH
+# define isfinite(x) \
+ (sizeof (x) == sizeof (float) ? __finitef (x) : __finite (x))
+# else
+# define isfinite(x) \
+ (sizeof (x) == sizeof (float) \
+ ? __finitef (x) \
+ : sizeof (x) == sizeof (double) \
+ ? __finite (x) : __finitel (x))
+# endif
+
+/* Return nonzero value if X is neither zero, subnormal, Inf, nor NaN. */
+# define isnormal(x) (fpclassify (x) == FP_NORMAL)
+
+/* Return nonzero value if X is a NaN. We could use `fpclassify' but
+ we already have this functions `__isnan' and it is faster. */
+# ifdef __NO_LONG_DOUBLE_MATH
+# define isnan(x) \
+ (sizeof (x) == sizeof (float) ? __isnanf (x) : __isnan (x))
+# else
+# define isnan(x) \
+ (sizeof (x) == sizeof (float) \
+ ? __isnanf (x) \
+ : sizeof (x) == sizeof (double) \
+ ? __isnan (x) : __isnanl (x))
+# endif
+
+/* Return nonzero value is X is positive or negative infinity. */
+# ifdef __NO_LONG_DOUBLE_MATH
+# define isinf(x) \
+ (sizeof (x) == sizeof (float) ? __isinff (x) : __isinf (x))
+# else
+# define isinf(x) \
+ (sizeof (x) == sizeof (float) \
+ ? __isinff (x) \
+ : sizeof (x) == sizeof (double) \
+ ? __isinf (x) : __isinfl (x))
+# endif
+
+/* Bitmasks for the math_errhandling macro. */
+# define MATH_ERRNO 1 /* errno set by math functions. */
+# define MATH_ERREXCEPT 2 /* Exceptions raised by math functions. */
+
+#endif /* Use ISO C99. */
+
+#ifdef __USE_MISC
+/* Support for various different standard error handling behaviors. */
+typedef enum
+{
+ _IEEE_ = -1, /* According to IEEE 754/IEEE 854. */
+ _SVID_, /* According to System V, release 4. */
+ _XOPEN_, /* Nowadays also Unix98. */
+ _POSIX_,
+ _ISOC_ /* Actually this is ISO C99. */
+} _LIB_VERSION_TYPE;
+
+/* This variable can be changed at run-time to any of the values above to
+ affect floating point error handling behavior (it may also be necessary
+ to change the hardware FPU exception settings). */
+extern _LIB_VERSION_TYPE _LIB_VERSION;
+#endif
+
+
+#ifdef __USE_SVID
+/* In SVID error handling, `matherr' is called with this description
+ of the exceptional condition.
+
+ We have a problem when using C++ since `exception' is a reserved
+ name in C++. */
+# ifdef __cplusplus
+struct __exception
+# else
+struct exception
+# endif
+ {
+ int type;
+ char *name;
+ double arg1;
+ double arg2;
+ double retval;
+ };
+
+# ifdef __cplusplus
+extern int matherr (struct __exception *__exc) throw ();
+# else
+extern int matherr (struct exception *__exc);
+# endif
+
+# define X_TLOSS 1.41484755040568800000e+16
+
+/* Types of exceptions in the `type' field. */
+# define DOMAIN 1
+# define SING 2
+# define OVERFLOW 3
+# define UNDERFLOW 4
+# define TLOSS 5
+# define PLOSS 6
+
+/* SVID mode specifies returning this large value instead of infinity. */
+# define HUGE 3.40282347e+38F
+
+#else /* !SVID */
+
+# ifdef __USE_XOPEN
+/* X/Open wants another strange constant. */
+# define MAXFLOAT 3.40282347e+38F
+# endif
+
+#endif /* SVID */
+
+
+/* Some useful constants. */
+#if defined __USE_BSD || defined __USE_XOPEN
+# define M_E 2.7182818284590452354 /* e */
+# define M_LOG2E 1.4426950408889634074 /* log_2 e */
+# define M_LOG10E 0.43429448190325182765 /* log_10 e */
+# define M_LN2 0.69314718055994530942 /* log_e 2 */
+# define M_LN10 2.30258509299404568402 /* log_e 10 */
+# define M_PI 3.14159265358979323846 /* pi */
+# define M_PI_2 1.57079632679489661923 /* pi/2 */
+# define M_PI_4 0.78539816339744830962 /* pi/4 */
+# define M_1_PI 0.31830988618379067154 /* 1/pi */
+# define M_2_PI 0.63661977236758134308 /* 2/pi */
+# define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */
+# define M_SQRT2 1.41421356237309504880 /* sqrt(2) */
+# define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
+#endif
+
+/* The above constants are not adequate for computation using `long double's.
+ Therefore we provide as an extension constants with similar names as a
+ GNU extension. Provide enough digits for the 128-bit IEEE quad. */
+#ifdef __USE_GNU
+# define M_El 2.7182818284590452353602874713526625L /* e */
+# define M_LOG2El 1.4426950408889634073599246810018921L /* log_2 e */
+# define M_LOG10El 0.4342944819032518276511289189166051L /* log_10 e */
+# define M_LN2l 0.6931471805599453094172321214581766L /* log_e 2 */
+# define M_LN10l 2.3025850929940456840179914546843642L /* log_e 10 */
+# define M_PIl 3.1415926535897932384626433832795029L /* pi */
+# define M_PI_2l 1.5707963267948966192313216916397514L /* pi/2 */
+# define M_PI_4l 0.7853981633974483096156608458198757L /* pi/4 */
+# define M_1_PIl 0.3183098861837906715377675267450287L /* 1/pi */
+# define M_2_PIl 0.6366197723675813430755350534900574L /* 2/pi */
+# define M_2_SQRTPIl 1.1283791670955125738961589031215452L /* 2/sqrt(pi) */
+# define M_SQRT2l 1.4142135623730950488016887242096981L /* sqrt(2) */
+# define M_SQRT1_2l 0.7071067811865475244008443621048490L /* 1/sqrt(2) */
+#endif
+
+
+/* When compiling in strict ISO C compatible mode we must not use the
+ inline functions since they, among other things, do not set the
+ `errno' variable correctly. */
+#if defined __STRICT_ANSI__ && !defined __NO_MATH_INLINES
+# define __NO_MATH_INLINES 1
+#endif
+
+#if defined __USE_ISOC99 && __GNUC_PREREQ(2,97)
+/* ISO C99 defines some macros to compare number while taking care for
+ unordered numbers. Many FPUs provide special instructions to support
+ these operations. Generic support in GCC for these as builtins went
+ in before 3.0.0, but not all cpus added their patterns. We define
+ versions that use the builtins here, and <bits/mathinline.h> will
+ undef/redefine as appropriate for the specific GCC version in use. */
+# define isgreater(x, y) __builtin_isgreater(x, y)
+# define isgreaterequal(x, y) __builtin_isgreaterequal(x, y)
+# define isless(x, y) __builtin_isless(x, y)
+# define islessequal(x, y) __builtin_islessequal(x, y)
+# define islessgreater(x, y) __builtin_islessgreater(x, y)
+# define isunordered(u, v) __builtin_isunordered(u, v)
+#endif
+
+/* Get machine-dependent inline versions (if there are any). */
+#ifdef __USE_EXTERN_INLINES
+# include <bits/mathinline.h>
+#endif
+
+#ifdef __USE_ISOC99
+/* If we've still got undefined comparison macros, provide defaults. */
+
+/* Return nonzero value if X is greater than Y. */
+# ifndef isgreater
+# define isgreater(x, y) \
+ (__extension__ \
+ ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
+ !isunordered (__x, __y) && __x > __y; }))
+# endif
+
+/* Return nonzero value if X is greater than or equal to Y. */
+# ifndef isgreaterequal
+# define isgreaterequal(x, y) \
+ (__extension__ \
+ ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
+ !isunordered (__x, __y) && __x >= __y; }))
+# endif
+
+/* Return nonzero value if X is less than Y. */
+# ifndef isless
+# define isless(x, y) \
+ (__extension__ \
+ ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
+ !isunordered (__x, __y) && __x < __y; }))
+# endif
+
+/* Return nonzero value if X is less than or equal to Y. */
+# ifndef islessequal
+# define islessequal(x, y) \
+ (__extension__ \
+ ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
+ !isunordered (__x, __y) && __x <= __y; }))
+# endif
+
+/* Return nonzero value if either X is less than Y or Y is less than X. */
+# ifndef islessgreater
+# define islessgreater(x, y) \
+ (__extension__ \
+ ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
+ !isunordered (__x, __y) && (__x < __y || __y < __x); }))
+# endif
+
+/* Return nonzero value if arguments are unordered. */
+# ifndef isunordered
+# define isunordered(u, v) \
+ (__extension__ \
+ ({ __typeof__(u) __u = (u); __typeof__(v) __v = (v); \
+ fpclassify (__u) == FP_NAN || fpclassify (__v) == FP_NAN; }))
+# endif
+
+#endif
+
+__END_DECLS
+
+
+#endif /* math.h */
diff --git a/sysroot/usr/include/mcheck.h b/sysroot/usr/include/mcheck.h
new file mode 100644
index 0000000..225f21e
--- /dev/null
+++ b/sysroot/usr/include/mcheck.h
@@ -0,0 +1,62 @@
+/* Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _MCHECK_H
+#define _MCHECK_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Return values for `mprobe': these are the kinds of inconsistencies that
+ `mcheck' enables detection of. */
+enum mcheck_status
+ {
+ MCHECK_DISABLED = -1, /* Consistency checking is not turned on. */
+ MCHECK_OK, /* Block is fine. */
+ MCHECK_FREE, /* Block freed twice. */
+ MCHECK_HEAD, /* Memory before the block was clobbered. */
+ MCHECK_TAIL /* Memory after the block was clobbered. */
+ };
+
+
+/* Activate a standard collection of debugging hooks. This must be called
+ before `malloc' is ever called. ABORTFUNC is called with an error code
+ (see enum above) when an inconsistency is detected. If ABORTFUNC is
+ null, the standard function prints on stderr and then calls `abort'. */
+extern int mcheck (void (*__abortfunc) (enum mcheck_status)) __THROW;
+
+/* Similar to `mcheck´ but performs checks for all block whenever one of
+ the memory handling functions is called. This can be very slow. */
+extern int mcheck_pedantic (void (*__abortfunc) (enum mcheck_status)) __THROW;
+
+/* Force check of all blocks now. */
+extern void mcheck_check_all (void);
+
+/* Check for aberrations in a particular malloc'd block. You must have
+ called `mcheck' already. These are the same checks that `mcheck' does
+ when you free or reallocate a block. */
+extern enum mcheck_status mprobe (void *__ptr) __THROW;
+
+/* Activate a standard collection of tracing hooks. */
+extern void mtrace (void) __THROW;
+extern void muntrace (void) __THROW;
+
+__END_DECLS
+
+#endif /* mcheck.h */
diff --git a/sysroot/usr/include/memory.h b/sysroot/usr/include/memory.h
new file mode 100644
index 0000000..743fa6a
--- /dev/null
+++ b/sysroot/usr/include/memory.h
@@ -0,0 +1,34 @@
+/* Copyright (C) 1991, 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * SVID
+ */
+
+#ifndef _MEMORY_H
+#define _MEMORY_H 1
+
+#include <features.h>
+
+
+#ifndef _STRING_H
+# include <string.h>
+#endif /* string.h */
+
+
+#endif /* memory.h */
diff --git a/sysroot/usr/include/menu.h b/sysroot/usr/include/menu.h
new file mode 100644
index 0000000..84352eb
--- /dev/null
+++ b/sysroot/usr/include/menu.h
@@ -0,0 +1,256 @@
+/****************************************************************************
+ * Copyright (c) 1998-2003,2007 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Juergen Pfeifer, 1995,1997 *
+ ****************************************************************************/
+
+/* $Id: menu.h,v 1.19 2007/02/24 17:32:13 tom Exp $ */
+
+#ifndef ETI_MENU
+#define ETI_MENU
+
+#ifdef AMIGA
+#define TEXT TEXT_ncurses
+#endif
+
+#include <curses.h>
+#include <eti.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef int Menu_Options;
+typedef int Item_Options;
+
+/* Menu options: */
+#define O_ONEVALUE (0x01)
+#define O_SHOWDESC (0x02)
+#define O_ROWMAJOR (0x04)
+#define O_IGNORECASE (0x08)
+#define O_SHOWMATCH (0x10)
+#define O_NONCYCLIC (0x20)
+
+/* Item options: */
+#define O_SELECTABLE (0x01)
+
+typedef struct
+{
+ const char* str;
+ unsigned short length;
+} TEXT;
+
+typedef struct tagITEM
+{
+ TEXT name; /* name of menu item */
+ TEXT description; /* description of item, optional in display */
+ struct tagMENU *imenu; /* Pointer to parent menu */
+ void *userptr; /* Pointer to user defined per item data */
+ Item_Options opt; /* Item options */
+ short index; /* Item number if connected to a menu */
+ short y; /* y and x location of item in menu */
+ short x;
+ bool value; /* Selection value */
+
+ struct tagITEM *left; /* neighbor items */
+ struct tagITEM *right;
+ struct tagITEM *up;
+ struct tagITEM *down;
+
+} ITEM;
+
+typedef void (*Menu_Hook)(struct tagMENU *);
+
+typedef struct tagMENU
+{
+ short height; /* Nr. of chars high */
+ short width; /* Nr. of chars wide */
+ short rows; /* Nr. of items high */
+ short cols; /* Nr. of items wide */
+ short frows; /* Nr. of formatted items high */
+ short fcols; /* Nr. of formatted items wide */
+ short arows; /* Nr. of items high (actual) */
+ short namelen; /* Max. name length */
+ short desclen; /* Max. description length */
+ short marklen; /* Length of mark, if any */
+ short itemlen; /* Length of one item */
+ short spc_desc; /* Spacing for descriptor */
+ short spc_cols; /* Spacing for columns */
+ short spc_rows; /* Spacing for rows */
+ char *pattern; /* Buffer to store match chars */
+ short pindex; /* Index into pattern buffer */
+ WINDOW *win; /* Window containing menu */
+ WINDOW *sub; /* Subwindow for menu display */
+ WINDOW *userwin; /* User's window */
+ WINDOW *usersub; /* User's subwindow */
+ ITEM **items; /* array of items */
+ short nitems; /* Nr. of items in menu */
+ ITEM *curitem; /* Current item */
+ short toprow; /* Top row of menu */
+ chtype fore; /* Selection attribute */
+ chtype back; /* Nonselection attribute */
+ chtype grey; /* Inactive attribute */
+ unsigned char pad; /* Pad character */
+
+ Menu_Hook menuinit; /* User hooks */
+ Menu_Hook menuterm;
+ Menu_Hook iteminit;
+ Menu_Hook itemterm;
+
+ void *userptr; /* Pointer to menus user data */
+ char *mark; /* Pointer to marker string */
+
+ Menu_Options opt; /* Menu options */
+ unsigned short status; /* Internal state of menu */
+
+} MENU;
+
+
+/* Define keys */
+
+#define REQ_LEFT_ITEM (KEY_MAX + 1)
+#define REQ_RIGHT_ITEM (KEY_MAX + 2)
+#define REQ_UP_ITEM (KEY_MAX + 3)
+#define REQ_DOWN_ITEM (KEY_MAX + 4)
+#define REQ_SCR_ULINE (KEY_MAX + 5)
+#define REQ_SCR_DLINE (KEY_MAX + 6)
+#define REQ_SCR_DPAGE (KEY_MAX + 7)
+#define REQ_SCR_UPAGE (KEY_MAX + 8)
+#define REQ_FIRST_ITEM (KEY_MAX + 9)
+#define REQ_LAST_ITEM (KEY_MAX + 10)
+#define REQ_NEXT_ITEM (KEY_MAX + 11)
+#define REQ_PREV_ITEM (KEY_MAX + 12)
+#define REQ_TOGGLE_ITEM (KEY_MAX + 13)
+#define REQ_CLEAR_PATTERN (KEY_MAX + 14)
+#define REQ_BACK_PATTERN (KEY_MAX + 15)
+#define REQ_NEXT_MATCH (KEY_MAX + 16)
+#define REQ_PREV_MATCH (KEY_MAX + 17)
+
+#define MIN_MENU_COMMAND (KEY_MAX + 1)
+#define MAX_MENU_COMMAND (KEY_MAX + 17)
+
+/*
+ * Some AT&T code expects MAX_COMMAND to be out-of-band not
+ * just for menu commands but for forms ones as well.
+ */
+#if defined(MAX_COMMAND)
+# if (MAX_MENU_COMMAND > MAX_COMMAND)
+# error Something is wrong -- MAX_MENU_COMMAND is greater than MAX_COMMAND
+# elif (MAX_COMMAND != (KEY_MAX + 128))
+# error Something is wrong -- MAX_COMMAND is already inconsistently defined.
+# endif
+#else
+# define MAX_COMMAND (KEY_MAX + 128)
+#endif
+
+
+/* --------- prototypes for libmenu functions ----------------------------- */
+
+extern NCURSES_EXPORT(ITEM **) menu_items (const MENU *);
+extern NCURSES_EXPORT(ITEM *) current_item (const MENU *);
+extern NCURSES_EXPORT(ITEM *) new_item (const char *,const char *);
+
+extern NCURSES_EXPORT(MENU *) new_menu (ITEM **);
+
+extern NCURSES_EXPORT(Item_Options) item_opts (const ITEM *);
+extern NCURSES_EXPORT(Menu_Options) menu_opts (const MENU *);
+
+extern NCURSES_EXPORT(Menu_Hook) item_init (const MENU *);
+extern NCURSES_EXPORT(Menu_Hook) item_term (const MENU *);
+extern NCURSES_EXPORT(Menu_Hook) menu_init (const MENU *);
+extern NCURSES_EXPORT(Menu_Hook) menu_term (const MENU *);
+
+extern NCURSES_EXPORT(WINDOW *) menu_sub (const MENU *);
+extern NCURSES_EXPORT(WINDOW *) menu_win (const MENU *);
+
+extern NCURSES_EXPORT(const char *) item_description (const ITEM *);
+extern NCURSES_EXPORT(const char *) item_name (const ITEM *);
+extern NCURSES_EXPORT(const char *) menu_mark (const MENU *);
+extern NCURSES_EXPORT(const char *) menu_request_name (int);
+
+extern NCURSES_EXPORT(char *) menu_pattern (const MENU *);
+
+extern NCURSES_EXPORT(void *) menu_userptr (const MENU *);
+extern NCURSES_EXPORT(void *) item_userptr (const ITEM *);
+
+extern NCURSES_EXPORT(chtype) menu_back (const MENU *);
+extern NCURSES_EXPORT(chtype) menu_fore (const MENU *);
+extern NCURSES_EXPORT(chtype) menu_grey (const MENU *);
+
+extern NCURSES_EXPORT(int) free_item (ITEM *);
+extern NCURSES_EXPORT(int) free_menu (MENU *);
+extern NCURSES_EXPORT(int) item_count (const MENU *);
+extern NCURSES_EXPORT(int) item_index (const ITEM *);
+extern NCURSES_EXPORT(int) item_opts_off (ITEM *,Item_Options);
+extern NCURSES_EXPORT(int) item_opts_on (ITEM *,Item_Options);
+extern NCURSES_EXPORT(int) menu_driver (MENU *,int);
+extern NCURSES_EXPORT(int) menu_opts_off (MENU *,Menu_Options);
+extern NCURSES_EXPORT(int) menu_opts_on (MENU *,Menu_Options);
+extern NCURSES_EXPORT(int) menu_pad (const MENU *);
+extern NCURSES_EXPORT(int) pos_menu_cursor (const MENU *);
+extern NCURSES_EXPORT(int) post_menu (MENU *);
+extern NCURSES_EXPORT(int) scale_menu (const MENU *,int *,int *);
+extern NCURSES_EXPORT(int) set_current_item (MENU *menu,ITEM *item);
+extern NCURSES_EXPORT(int) set_item_init (MENU *, Menu_Hook);
+extern NCURSES_EXPORT(int) set_item_opts (ITEM *,Item_Options);
+extern NCURSES_EXPORT(int) set_item_term (MENU *, Menu_Hook);
+extern NCURSES_EXPORT(int) set_item_userptr (ITEM *, void *);
+extern NCURSES_EXPORT(int) set_item_value (ITEM *,bool);
+extern NCURSES_EXPORT(int) set_menu_back (MENU *,chtype);
+extern NCURSES_EXPORT(int) set_menu_fore (MENU *,chtype);
+extern NCURSES_EXPORT(int) set_menu_format (MENU *,int,int);
+extern NCURSES_EXPORT(int) set_menu_grey (MENU *,chtype);
+extern NCURSES_EXPORT(int) set_menu_init (MENU *, Menu_Hook);
+extern NCURSES_EXPORT(int) set_menu_items (MENU *,ITEM **);
+extern NCURSES_EXPORT(int) set_menu_mark (MENU *, const char *);
+extern NCURSES_EXPORT(int) set_menu_opts (MENU *,Menu_Options);
+extern NCURSES_EXPORT(int) set_menu_pad (MENU *,int);
+extern NCURSES_EXPORT(int) set_menu_pattern (MENU *,const char *);
+extern NCURSES_EXPORT(int) set_menu_sub (MENU *,WINDOW *);
+extern NCURSES_EXPORT(int) set_menu_term (MENU *, Menu_Hook);
+extern NCURSES_EXPORT(int) set_menu_userptr (MENU *,void *);
+extern NCURSES_EXPORT(int) set_menu_win (MENU *,WINDOW *);
+extern NCURSES_EXPORT(int) set_top_row (MENU *,int);
+extern NCURSES_EXPORT(int) top_row (const MENU *);
+extern NCURSES_EXPORT(int) unpost_menu (MENU *);
+extern NCURSES_EXPORT(int) menu_request_by_name (const char *);
+extern NCURSES_EXPORT(int) set_menu_spacing (MENU *,int,int,int);
+extern NCURSES_EXPORT(int) menu_spacing (const MENU *,int *,int *,int *);
+
+
+extern NCURSES_EXPORT(bool) item_value (const ITEM *);
+extern NCURSES_EXPORT(bool) item_visible (const ITEM *);
+
+extern NCURSES_EXPORT(void) menu_format (const MENU *,int *,int *);
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* ETI_MENU */
diff --git a/sysroot/usr/include/mntent.h b/sysroot/usr/include/mntent.h
new file mode 100644
index 0000000..a82e953
--- /dev/null
+++ b/sysroot/usr/include/mntent.h
@@ -0,0 +1,98 @@
+/* Utilities for reading/writing fstab, mtab, etc.
+ Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _MNTENT_H
+#define _MNTENT_H 1
+
+#include <features.h>
+#define __need_FILE
+#include <stdio.h>
+#include <paths.h>
+
+
+/* File listing canonical interesting mount points. */
+#define MNTTAB _PATH_MNTTAB /* Deprecated alias. */
+
+/* File listing currently active mount points. */
+#define MOUNTED _PATH_MOUNTED /* Deprecated alias. */
+
+
+/* General filesystem types. */
+#define MNTTYPE_IGNORE "ignore" /* Ignore this entry. */
+#define MNTTYPE_NFS "nfs" /* Network file system. */
+#define MNTTYPE_SWAP "swap" /* Swap device. */
+
+
+/* Generic mount options. */
+#define MNTOPT_DEFAULTS "defaults" /* Use all default options. */
+#define MNTOPT_RO "ro" /* Read only. */
+#define MNTOPT_RW "rw" /* Read/write. */
+#define MNTOPT_SUID "suid" /* Set uid allowed. */
+#define MNTOPT_NOSUID "nosuid" /* No set uid allowed. */
+#define MNTOPT_NOAUTO "noauto" /* Do not auto mount. */
+
+
+__BEGIN_DECLS
+
+/* Structure describing a mount table entry. */
+struct mntent
+ {
+ char *mnt_fsname; /* Device or server for filesystem. */
+ char *mnt_dir; /* Directory mounted on. */
+ char *mnt_type; /* Type of filesystem: ufs, nfs, etc. */
+ char *mnt_opts; /* Comma-separated options for fs. */
+ int mnt_freq; /* Dump frequency (in days). */
+ int mnt_passno; /* Pass number for `fsck'. */
+ };
+
+
+/* Prepare to begin reading and/or writing mount table entries from the
+ beginning of FILE. MODE is as for `fopen'. */
+extern FILE *setmntent (__const char *__file, __const char *__mode) __THROW;
+
+/* Read one mount table entry from STREAM. Returns a pointer to storage
+ reused on the next call, or null for EOF or error (use feof/ferror to
+ check). */
+extern struct mntent *getmntent (FILE *__stream) __THROW;
+
+#ifdef __USE_MISC
+/* Reentrant version of the above function. */
+extern struct mntent *getmntent_r (FILE *__restrict __stream,
+ struct mntent *__restrict __result,
+ char *__restrict __buffer,
+ int __bufsize) __THROW;
+#endif
+
+/* Write the mount table entry described by MNT to STREAM.
+ Return zero on success, nonzero on failure. */
+extern int addmntent (FILE *__restrict __stream,
+ __const struct mntent *__restrict __mnt) __THROW;
+
+/* Close a stream opened with `setmntent'. */
+extern int endmntent (FILE *__stream) __THROW;
+
+/* Search MNT->mnt_opts for an option matching OPT.
+ Returns the address of the substring, or null if none found. */
+extern char *hasmntopt (__const struct mntent *__mnt,
+ __const char *__opt) __THROW;
+
+
+__END_DECLS
+
+#endif /* mntent.h */
diff --git a/sysroot/usr/include/monetary.h b/sysroot/usr/include/monetary.h
new file mode 100644
index 0000000..d9234ca
--- /dev/null
+++ b/sysroot/usr/include/monetary.h
@@ -0,0 +1,60 @@
+/* Header file for monetary value formatting functions.
+ Copyright (C) 1996,1997,1998,1999,2000,2002,2006
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _MONETARY_H
+#define _MONETARY_H 1
+
+#include <features.h>
+
+/* Get needed types. */
+#define __need_size_t
+#include <stddef.h>
+#include <bits/types.h>
+
+#ifndef __ssize_t_defined
+typedef __ssize_t ssize_t;
+# define __ssize_t_defined
+#endif
+
+
+__BEGIN_DECLS
+
+/* Formatting a monetary value according to the current locale. */
+extern ssize_t strfmon (char *__restrict __s, size_t __maxsize,
+ __const char *__restrict __format, ...)
+ __THROW __attribute_format_strfmon__ (3, 4);
+
+#ifdef __USE_GNU
+# include <xlocale.h>
+
+/* Formatting a monetary value according to the current locale. */
+extern ssize_t strfmon_l (char *__restrict __s, size_t __maxsize,
+ __locale_t loc,
+ __const char *__restrict __format, ...)
+ __THROW __attribute_format_strfmon__ (4, 5);
+#endif
+
+#ifdef __LDBL_COMPAT
+# include <bits/monetary-ldbl.h>
+#endif
+
+__END_DECLS
+
+#endif /* monetary.h */
diff --git a/sysroot/usr/include/mqueue.h b/sysroot/usr/include/mqueue.h
new file mode 100644
index 0000000..a4c3e1b
--- /dev/null
+++ b/sysroot/usr/include/mqueue.h
@@ -0,0 +1,101 @@
+/* Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _MQUEUE_H
+#define _MQUEUE_H 1
+
+#include <features.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#define __need_sigevent_t
+#include <bits/siginfo.h>
+#define __need_timespec
+#include <time.h>
+/* Get the definition of mqd_t and struct mq_attr. */
+#include <bits/mqueue.h>
+
+__BEGIN_DECLS
+
+/* Establish connection between a process and a message queue NAME and
+ return message queue descriptor or (mqd_t) -1 on error. OFLAG determines
+ the type of access used. If O_CREAT is on OFLAG, the third argument is
+ taken as a `mode_t', the mode of the created message queue, and the fourth
+ argument is taken as `struct mq_attr *', pointer to message queue
+ attributes. If the fourth argument is NULL, default attributes are
+ used. */
+extern mqd_t mq_open (__const char *__name, int __oflag, ...)
+ __THROW __nonnull ((1));
+
+/* Removes the association between message queue descriptor MQDES and its
+ message queue. */
+extern int mq_close (mqd_t __mqdes) __THROW;
+
+/* Query status and attributes of message queue MQDES. */
+extern int mq_getattr (mqd_t __mqdes, struct mq_attr *__mqstat)
+ __THROW __nonnull ((2));
+
+/* Set attributes associated with message queue MQDES and if OMQSTAT is
+ not NULL also query its old attributes. */
+extern int mq_setattr (mqd_t __mqdes,
+ __const struct mq_attr *__restrict __mqstat,
+ struct mq_attr *__restrict __omqstat)
+ __THROW __nonnull ((2));
+
+/* Remove message queue named NAME. */
+extern int mq_unlink (__const char *__name) __THROW __nonnull ((1));
+
+/* Register notification issued upon message arrival to an empty
+ message queue MQDES. */
+extern int mq_notify (mqd_t __mqdes, __const struct sigevent *__notification)
+ __THROW;
+
+/* Receive the oldest from highest priority messages in message queue
+ MQDES. */
+extern ssize_t mq_receive (mqd_t __mqdes, char *__msg_ptr, size_t __msg_len,
+ unsigned int *__msg_prio) __nonnull ((2));
+
+/* Add message pointed by MSG_PTR to message queue MQDES. */
+extern int mq_send (mqd_t __mqdes, __const char *__msg_ptr, size_t __msg_len,
+ unsigned int __msg_prio) __nonnull ((2));
+
+#ifdef __USE_XOPEN2K
+/* Receive the oldest from highest priority messages in message queue
+ MQDES, stop waiting if ABS_TIMEOUT expires. */
+extern ssize_t mq_timedreceive (mqd_t __mqdes, char *__restrict __msg_ptr,
+ size_t __msg_len,
+ unsigned int *__restrict __msg_prio,
+ __const struct timespec *__restrict __abs_timeout)
+ __nonnull ((2, 5));
+
+/* Add message pointed by MSG_PTR to message queue MQDES, stop blocking
+ on full message queue if ABS_TIMEOUT expires. */
+extern int mq_timedsend (mqd_t __mqdes, __const char *__msg_ptr,
+ size_t __msg_len, unsigned int __msg_prio,
+ __const struct timespec *__abs_timeout)
+ __nonnull ((2, 5));
+#endif
+
+/* Define some inlines helping to catch common problems. */
+#if __USE_FORTIFY_LEVEL > 0 && defined __extern_always_inline \
+ && defined __va_arg_pack_len
+# include <bits/mqueue2.h>
+#endif
+
+__END_DECLS
+
+#endif /* mqueue.h */
diff --git a/sysroot/usr/include/nc_tparm.h b/sysroot/usr/include/nc_tparm.h
new file mode 100644
index 0000000..d1d769b
--- /dev/null
+++ b/sysroot/usr/include/nc_tparm.h
@@ -0,0 +1,65 @@
+/****************************************************************************
+ * Copyright (c) 2006 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Thomas E. Dickey 2006 *
+ ****************************************************************************/
+
+/* $Id: nc_tparm.h,v 1.4 2006/11/26 00:49:25 tom Exp $ */
+
+/*
+ * Cast parameters past the formatting-string for tparm() to match the
+ * assumption of the varargs code.
+ */
+#define TPARM_ARG long
+#define TPARM_N(n) (TPARM_ARG)(n)
+
+#define TPARM_9(a,b,c,d,e,f,g,h,i,j) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f),TPARM_N(g),TPARM_N(h),TPARM_N(i),TPARM_N(j))
+
+#if NCURSES_TPARM_VARARGS
+#define TPARM_8(a,b,c,d,e,f,g,h,i) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f),TPARM_N(g),TPARM_N(h),TPARM_N(i))
+#define TPARM_7(a,b,c,d,e,f,g,h) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f),TPARM_N(g),TPARM_N(h))
+#define TPARM_6(a,b,c,d,e,f,g) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f),TPARM_N(g))
+#define TPARM_5(a,b,c,d,e,f) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f))
+#define TPARM_4(a,b,c,d,e) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e))
+#define TPARM_3(a,b,c,d) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d))
+#define TPARM_2(a,b,c) tparm(a,TPARM_N(b),TPARM_N(c))
+#define TPARM_1(a,b) tparm(a,TPARM_N(b))
+#define TPARM_0(a) tparm(a)
+#else
+#define TPARM_8(a,b,c,d,e,f,g,h,i) TPARM_9(a,b,c,d,e,f,g,h,i,0)
+#define TPARM_7(a,b,c,d,e,f,g,h) TPARM_8(a,b,c,d,e,f,g,h,0)
+#define TPARM_6(a,b,c,d,e,f,g) TPARM_7(a,b,c,d,e,f,g,0)
+#define TPARM_5(a,b,c,d,e,f) TPARM_6(a,b,c,d,e,f,0)
+#define TPARM_4(a,b,c,d,e) TPARM_5(a,b,c,d,e,0)
+#define TPARM_3(a,b,c,d) TPARM_4(a,b,c,d,0)
+#define TPARM_2(a,b,c) TPARM_3(a,b,c,0)
+#define TPARM_1(a,b) TPARM_2(a,b,0)
+#define TPARM_1(a,b) TPARM_2(a,b,0)
+#define TPARM_0(a) TPARM_1(a,0)
+#endif
diff --git a/sysroot/usr/include/ncurses.h b/sysroot/usr/include/ncurses.h
new file mode 120000
index 0000000..149de6c
--- /dev/null
+++ b/sysroot/usr/include/ncurses.h
@@ -0,0 +1 @@
+curses.h \ No newline at end of file
diff --git a/sysroot/usr/include/ncurses_dll.h b/sysroot/usr/include/ncurses_dll.h
new file mode 100644
index 0000000..e24feee
--- /dev/null
+++ b/sysroot/usr/include/ncurses_dll.h
@@ -0,0 +1,86 @@
+/****************************************************************************
+ * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+/* $Id: ncurses_dll.h,v 1.6 2007/03/10 19:21:49 tom Exp $ */
+
+#ifndef NCURSES_DLL_H_incl
+#define NCURSES_DLL_H_incl 1
+
+/* no longer needed on cygwin or mingw, thanks to auto-import */
+/* but this structure may be useful at some point for an MSVC build */
+/* so, for now unconditionally define the important flags */
+/* "the right way" for proper static and dll+auto-import behavior */
+#undef NCURSES_DLL
+#define NCURSES_STATIC
+
+#if defined(__CYGWIN__)
+# if defined(NCURSES_DLL)
+# if defined(NCURSES_STATIC)
+# undef NCURSES_STATIC
+# endif
+# endif
+# undef NCURSES_IMPEXP
+# undef NCURSES_API
+# undef NCURSES_EXPORT
+# undef NCURSES_EXPORT_VAR
+# if defined(NCURSES_DLL)
+/* building a DLL */
+# define NCURSES_IMPEXP __declspec(dllexport)
+# elif defined(NCURSES_STATIC)
+/* building or linking to a static library */
+# define NCURSES_IMPEXP /* nothing */
+# else
+/* linking to the DLL */
+# define NCURSES_IMPEXP __declspec(dllimport)
+# endif
+# define NCURSES_API __cdecl
+# define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API
+# define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type
+#endif
+
+/* Take care of non-cygwin platforms */
+#if !defined(NCURSES_IMPEXP)
+# define NCURSES_IMPEXP /* nothing */
+#endif
+#if !defined(NCURSES_API)
+# define NCURSES_API /* nothing */
+#endif
+#if !defined(NCURSES_EXPORT)
+# define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API
+#endif
+#if !defined(NCURSES_EXPORT_VAR)
+# define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type
+#endif
+
+/*
+ * For reentrant code, we map the various global variables into SCREEN by
+ * using functions to access them.
+ */
+#define NCURSES_PUBLIC_VAR(name) _nc_##name
+#define NCURSES_WRAPPED_VAR(type,name) extern type NCURSES_PUBLIC_VAR(name)(void)
+
+#endif /* NCURSES_DLL_H_incl */
diff --git a/sysroot/usr/include/net/ethernet.h b/sysroot/usr/include/net/ethernet.h
new file mode 100644
index 0000000..7ca8e83
--- /dev/null
+++ b/sysroot/usr/include/net/ethernet.h
@@ -0,0 +1,76 @@
+/* Copyright (C) 1997, 1999, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Based on the FreeBSD version of this file. Curiously, that file
+ lacks a copyright in the header. */
+
+#ifndef __NET_ETHERNET_H
+#define __NET_ETHERNET_H 1
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <linux/if_ether.h> /* IEEE 802.3 Ethernet constants */
+
+__BEGIN_DECLS
+
+/* This is a name for the 48 bit ethernet address available on many
+ systems. */
+struct ether_addr
+{
+ u_int8_t ether_addr_octet[ETH_ALEN];
+} __attribute__ ((__packed__));
+
+/* 10Mb/s ethernet header */
+struct ether_header
+{
+ u_int8_t ether_dhost[ETH_ALEN]; /* destination eth addr */
+ u_int8_t ether_shost[ETH_ALEN]; /* source ether addr */
+ u_int16_t ether_type; /* packet type ID field */
+} __attribute__ ((__packed__));
+
+/* Ethernet protocol ID's */
+#define ETHERTYPE_PUP 0x0200 /* Xerox PUP */
+#define ETHERTYPE_IP 0x0800 /* IP */
+#define ETHERTYPE_ARP 0x0806 /* Address resolution */
+#define ETHERTYPE_REVARP 0x8035 /* Reverse ARP */
+
+#define ETHER_ADDR_LEN ETH_ALEN /* size of ethernet addr */
+#define ETHER_TYPE_LEN 2 /* bytes in type field */
+#define ETHER_CRC_LEN 4 /* bytes in CRC field */
+#define ETHER_HDR_LEN ETH_HLEN /* total octets in header */
+#define ETHER_MIN_LEN (ETH_ZLEN + ETHER_CRC_LEN) /* min packet length */
+#define ETHER_MAX_LEN (ETH_FRAME_LEN + ETHER_CRC_LEN) /* max packet length */
+
+/* make sure ethenet length is valid */
+#define ETHER_IS_VALID_LEN(foo) \
+ ((foo) >= ETHER_MIN_LEN && (foo) <= ETHER_MAX_LEN)
+
+/*
+ * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
+ * (type-ETHERTYPE_TRAIL)*512 bytes of data followed
+ * by an ETHER type (as given above) and then the (variable-length) header.
+ */
+#define ETHERTYPE_TRAIL 0x1000 /* Trailer packet */
+#define ETHERTYPE_NTRAILER 16
+
+#define ETHERMTU ETH_DATA_LEN
+#define ETHERMIN (ETHER_MIN_LEN - ETHER_HDR_LEN - ETHER_CRC_LEN)
+
+__END_DECLS
+
+#endif /* net/ethernet.h */
diff --git a/sysroot/usr/include/net/if.h b/sysroot/usr/include/net/if.h
new file mode 100644
index 0000000..ebb3e9f
--- /dev/null
+++ b/sysroot/usr/include/net/if.h
@@ -0,0 +1,205 @@
+/* net/if.h -- declarations for inquiring about network interfaces
+ Copyright (C) 1997,98,99,2000,2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _NET_IF_H
+#define _NET_IF_H 1
+
+#include <features.h>
+
+#ifdef __USE_MISC
+# include <sys/types.h>
+# include <sys/socket.h>
+#endif
+
+
+/* Length of interface name. */
+#define IF_NAMESIZE 16
+
+struct if_nameindex
+ {
+ unsigned int if_index; /* 1, 2, ... */
+ char *if_name; /* null terminated name: "eth0", ... */
+ };
+
+
+#ifdef __USE_MISC
+/* Standard interface flags. */
+enum
+ {
+ IFF_UP = 0x1, /* Interface is up. */
+# define IFF_UP IFF_UP
+ IFF_BROADCAST = 0x2, /* Broadcast address valid. */
+# define IFF_BROADCAST IFF_BROADCAST
+ IFF_DEBUG = 0x4, /* Turn on debugging. */
+# define IFF_DEBUG IFF_DEBUG
+ IFF_LOOPBACK = 0x8, /* Is a loopback net. */
+# define IFF_LOOPBACK IFF_LOOPBACK
+ IFF_POINTOPOINT = 0x10, /* Interface is point-to-point link. */
+# define IFF_POINTOPOINT IFF_POINTOPOINT
+ IFF_NOTRAILERS = 0x20, /* Avoid use of trailers. */
+# define IFF_NOTRAILERS IFF_NOTRAILERS
+ IFF_RUNNING = 0x40, /* Resources allocated. */
+# define IFF_RUNNING IFF_RUNNING
+ IFF_NOARP = 0x80, /* No address resolution protocol. */
+# define IFF_NOARP IFF_NOARP
+ IFF_PROMISC = 0x100, /* Receive all packets. */
+# define IFF_PROMISC IFF_PROMISC
+
+ /* Not supported */
+ IFF_ALLMULTI = 0x200, /* Receive all multicast packets. */
+# define IFF_ALLMULTI IFF_ALLMULTI
+
+ IFF_MASTER = 0x400, /* Master of a load balancer. */
+# define IFF_MASTER IFF_MASTER
+ IFF_SLAVE = 0x800, /* Slave of a load balancer. */
+# define IFF_SLAVE IFF_SLAVE
+
+ IFF_MULTICAST = 0x1000, /* Supports multicast. */
+# define IFF_MULTICAST IFF_MULTICAST
+
+ IFF_PORTSEL = 0x2000, /* Can set media type. */
+# define IFF_PORTSEL IFF_PORTSEL
+ IFF_AUTOMEDIA = 0x4000, /* Auto media select active. */
+# define IFF_AUTOMEDIA IFF_AUTOMEDIA
+ IFF_DYNAMIC = 0x8000 /* Dialup device with changing addresses. */
+# define IFF_DYNAMIC IFF_DYNAMIC
+ };
+
+/* The ifaddr structure contains information about one address of an
+ interface. They are maintained by the different address families,
+ are allocated and attached when an address is set, and are linked
+ together so all addresses for an interface can be located. */
+
+struct ifaddr
+ {
+ struct sockaddr ifa_addr; /* Address of interface. */
+ union
+ {
+ struct sockaddr ifu_broadaddr;
+ struct sockaddr ifu_dstaddr;
+ } ifa_ifu;
+ struct iface *ifa_ifp; /* Back-pointer to interface. */
+ struct ifaddr *ifa_next; /* Next address for interface. */
+ };
+
+# define ifa_broadaddr ifa_ifu.ifu_broadaddr /* broadcast address */
+# define ifa_dstaddr ifa_ifu.ifu_dstaddr /* other end of link */
+
+/* Device mapping structure. I'd just gone off and designed a
+ beautiful scheme using only loadable modules with arguments for
+ driver options and along come the PCMCIA people 8)
+
+ Ah well. The get() side of this is good for WDSETUP, and it'll be
+ handy for debugging things. The set side is fine for now and being
+ very small might be worth keeping for clean configuration. */
+
+struct ifmap
+ {
+ unsigned long int mem_start;
+ unsigned long int mem_end;
+ unsigned short int base_addr;
+ unsigned char irq;
+ unsigned char dma;
+ unsigned char port;
+ /* 3 bytes spare */
+ };
+
+/* Interface request structure used for socket ioctl's. All interface
+ ioctl's must have parameter definitions which begin with ifr_name.
+ The remainder may be interface specific. */
+
+struct ifreq
+ {
+# define IFHWADDRLEN 6
+# define IFNAMSIZ IF_NAMESIZE
+ union
+ {
+ char ifrn_name[IFNAMSIZ]; /* Interface name, e.g. "en0". */
+ } ifr_ifrn;
+
+ union
+ {
+ struct sockaddr ifru_addr;
+ struct sockaddr ifru_dstaddr;
+ struct sockaddr ifru_broadaddr;
+ struct sockaddr ifru_netmask;
+ struct sockaddr ifru_hwaddr;
+ short int ifru_flags;
+ int ifru_ivalue;
+ int ifru_mtu;
+ struct ifmap ifru_map;
+ char ifru_slave[IFNAMSIZ]; /* Just fits the size */
+ char ifru_newname[IFNAMSIZ];
+ __caddr_t ifru_data;
+ } ifr_ifru;
+ };
+# define ifr_name ifr_ifrn.ifrn_name /* interface name */
+# define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */
+# define ifr_addr ifr_ifru.ifru_addr /* address */
+# define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-p lnk */
+# define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */
+# define ifr_netmask ifr_ifru.ifru_netmask /* interface net mask */
+# define ifr_flags ifr_ifru.ifru_flags /* flags */
+# define ifr_metric ifr_ifru.ifru_ivalue /* metric */
+# define ifr_mtu ifr_ifru.ifru_mtu /* mtu */
+# define ifr_map ifr_ifru.ifru_map /* device map */
+# define ifr_slave ifr_ifru.ifru_slave /* slave device */
+# define ifr_data ifr_ifru.ifru_data /* for use by interface */
+# define ifr_ifindex ifr_ifru.ifru_ivalue /* interface index */
+# define ifr_bandwidth ifr_ifru.ifru_ivalue /* link bandwidth */
+# define ifr_qlen ifr_ifru.ifru_ivalue /* queue length */
+# define ifr_newname ifr_ifru.ifru_newname /* New name */
+# define _IOT_ifreq _IOT(_IOTS(char),IFNAMSIZ,_IOTS(char),16,0,0)
+# define _IOT_ifreq_short _IOT(_IOTS(char),IFNAMSIZ,_IOTS(short),1,0,0)
+# define _IOT_ifreq_int _IOT(_IOTS(char),IFNAMSIZ,_IOTS(int),1,0,0)
+
+
+/* Structure used in SIOCGIFCONF request. Used to retrieve interface
+ configuration for machine (useful for programs which must know all
+ networks accessible). */
+
+struct ifconf
+ {
+ int ifc_len; /* Size of buffer. */
+ union
+ {
+ __caddr_t ifcu_buf;
+ struct ifreq *ifcu_req;
+ } ifc_ifcu;
+ };
+# define ifc_buf ifc_ifcu.ifcu_buf /* Buffer address. */
+# define ifc_req ifc_ifcu.ifcu_req /* Array of structures. */
+# define _IOT_ifconf _IOT(_IOTS(struct ifconf),1,0,0,0,0) /* not right */
+#endif /* Misc. */
+
+__BEGIN_DECLS
+
+/* Convert an interface name to an index, and vice versa. */
+extern unsigned int if_nametoindex (__const char *__ifname) __THROW;
+extern char *if_indextoname (unsigned int __ifindex, char *__ifname) __THROW;
+
+/* Return a list of all interfaces and their indices. */
+extern struct if_nameindex *if_nameindex (void) __THROW;
+
+/* Free the data returned from if_nameindex. */
+extern void if_freenameindex (struct if_nameindex *__ptr) __THROW;
+
+__END_DECLS
+
+#endif /* net/if.h */
diff --git a/sysroot/usr/include/net/if_arp.h b/sysroot/usr/include/net/if_arp.h
new file mode 100644
index 0000000..9608652
--- /dev/null
+++ b/sysroot/usr/include/net/if_arp.h
@@ -0,0 +1,182 @@
+/* Definitions for Address Resolution Protocol.
+ Copyright (C) 1997,1999,2001,2006 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Based on the 4.4BSD and Linux version of this file. */
+
+#ifndef _NET_IF_ARP_H
+
+#define _NET_IF_ARP_H 1
+#include <sys/cdefs.h>
+
+#include <sys/types.h>
+#include <sys/socket.h>
+
+__BEGIN_DECLS
+
+/* Some internals from deep down in the kernel. */
+#define MAX_ADDR_LEN 7
+
+
+/* This structure defines an ethernet arp header. */
+
+/* ARP protocol opcodes. */
+#define ARPOP_REQUEST 1 /* ARP request. */
+#define ARPOP_REPLY 2 /* ARP reply. */
+#define ARPOP_RREQUEST 3 /* RARP request. */
+#define ARPOP_RREPLY 4 /* RARP reply. */
+#define ARPOP_InREQUEST 8 /* InARP request. */
+#define ARPOP_InREPLY 9 /* InARP reply. */
+#define ARPOP_NAK 10 /* (ATM)ARP NAK. */
+
+/* See RFC 826 for protocol description. ARP packets are variable
+ in size; the arphdr structure defines the fixed-length portion.
+ Protocol type values are the same as those for 10 Mb/s Ethernet.
+ It is followed by the variable-sized fields ar_sha, arp_spa,
+ arp_tha and arp_tpa in that order, according to the lengths
+ specified. Field names used correspond to RFC 826. */
+
+struct arphdr
+ {
+ unsigned short int ar_hrd; /* Format of hardware address. */
+ unsigned short int ar_pro; /* Format of protocol address. */
+ unsigned char ar_hln; /* Length of hardware address. */
+ unsigned char ar_pln; /* Length of protocol address. */
+ unsigned short int ar_op; /* ARP opcode (command). */
+#if 0
+ /* Ethernet looks like this : This bit is variable sized
+ however... */
+ unsigned char __ar_sha[ETH_ALEN]; /* Sender hardware address. */
+ unsigned char __ar_sip[4]; /* Sender IP address. */
+ unsigned char __ar_tha[ETH_ALEN]; /* Target hardware address. */
+ unsigned char __ar_tip[4]; /* Target IP address. */
+#endif
+ };
+
+
+/* ARP protocol HARDWARE identifiers. */
+#define ARPHRD_NETROM 0 /* From KA9Q: NET/ROM pseudo. */
+#define ARPHRD_ETHER 1 /* Ethernet 10/100Mbps. */
+#define ARPHRD_EETHER 2 /* Experimental Ethernet. */
+#define ARPHRD_AX25 3 /* AX.25 Level 2. */
+#define ARPHRD_PRONET 4 /* PROnet token ring. */
+#define ARPHRD_CHAOS 5 /* Chaosnet. */
+#define ARPHRD_IEEE802 6 /* IEEE 802.2 Ethernet/TR/TB. */
+#define ARPHRD_ARCNET 7 /* ARCnet. */
+#define ARPHRD_APPLETLK 8 /* APPLEtalk. */
+#define ARPHRD_DLCI 15 /* Frame Relay DLCI. */
+#define ARPHRD_ATM 19 /* ATM. */
+#define ARPHRD_METRICOM 23 /* Metricom STRIP (new IANA id). */
+#define ARPHRD_IEEE1394 24 /* IEEE 1394 IPv4 - RFC 2734. */
+#define ARPHRD_EUI64 27 /* EUI-64. */
+#define ARPHRD_INFINIBAND 32 /* InfiniBand. */
+
+/* Dummy types for non ARP hardware */
+#define ARPHRD_SLIP 256
+#define ARPHRD_CSLIP 257
+#define ARPHRD_SLIP6 258
+#define ARPHRD_CSLIP6 259
+#define ARPHRD_RSRVD 260 /* Notional KISS type. */
+#define ARPHRD_ADAPT 264
+#define ARPHRD_ROSE 270
+#define ARPHRD_X25 271 /* CCITT X.25. */
+#define ARPHRD_HWX25 272 /* Boards with X.25 in firmware. */
+#define ARPHRD_PPP 512
+#define ARPHRD_CISCO 513 /* Cisco HDLC. */
+#define ARPHRD_HDLC ARPHRD_CISCO
+#define ARPHRD_LAPB 516 /* LAPB. */
+#define ARPHRD_DDCMP 517 /* Digital's DDCMP. */
+#define ARPHRD_RAWHDLC 518 /* Raw HDLC. */
+
+#define ARPHRD_TUNNEL 768 /* IPIP tunnel. */
+#define ARPHRD_TUNNEL6 769 /* IPIP6 tunnel. */
+#define ARPHRD_FRAD 770 /* Frame Relay Access Device. */
+#define ARPHRD_SKIP 771 /* SKIP vif. */
+#define ARPHRD_LOOPBACK 772 /* Loopback device. */
+#define ARPHRD_LOCALTLK 773 /* Localtalk device. */
+#define ARPHRD_FDDI 774 /* Fiber Distributed Data Interface. */
+#define ARPHRD_BIF 775 /* AP1000 BIF. */
+#define ARPHRD_SIT 776 /* sit0 device - IPv6-in-IPv4. */
+#define ARPHRD_IPDDP 777 /* IP-in-DDP tunnel. */
+#define ARPHRD_IPGRE 778 /* GRE over IP. */
+#define ARPHRD_PIMREG 779 /* PIMSM register interface. */
+#define ARPHRD_HIPPI 780 /* High Performance Parallel I'face. */
+#define ARPHRD_ASH 781 /* (Nexus Electronics) Ash. */
+#define ARPHRD_ECONET 782 /* Acorn Econet. */
+#define ARPHRD_IRDA 783 /* Linux-IrDA. */
+#define ARPHRD_FCPP 784 /* Point to point fibrechanel. */
+#define ARPHRD_FCAL 785 /* Fibrechanel arbitrated loop. */
+#define ARPHRD_FCPL 786 /* Fibrechanel public loop. */
+#define ARPHRD_FCFABRIC 787 /* Fibrechanel fabric. */
+#define ARPHRD_IEEE802_TR 800 /* Magic type ident for TR. */
+#define ARPHRD_IEEE80211 801 /* IEEE 802.11. */
+#define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header. */
+#define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header. */
+
+#define ARPHRD_VOID 0xFFFF /* Void type, nothing is known. */
+#define ARPHRD_NONE 0xFFFE /* Zero header length. */
+
+
+/* ARP ioctl request. */
+struct arpreq
+ {
+ struct sockaddr arp_pa; /* Protocol address. */
+ struct sockaddr arp_ha; /* Hardware address. */
+ int arp_flags; /* Flags. */
+ struct sockaddr arp_netmask; /* Netmask (only for proxy arps). */
+ char arp_dev[16];
+ };
+
+struct arpreq_old
+ {
+ struct sockaddr arp_pa; /* Protocol address. */
+ struct sockaddr arp_ha; /* Hardware address. */
+ int arp_flags; /* Flags. */
+ struct sockaddr arp_netmask; /* Netmask (only for proxy arps). */
+ };
+
+/* ARP Flag values. */
+#define ATF_COM 0x02 /* Completed entry (ha valid). */
+#define ATF_PERM 0x04 /* Permanent entry. */
+#define ATF_PUBL 0x08 /* Publish entry. */
+#define ATF_USETRAILERS 0x10 /* Has requested trailers. */
+#define ATF_NETMASK 0x20 /* Want to use a netmask (only
+ for proxy entries). */
+#define ATF_DONTPUB 0x40 /* Don't answer this addresses. */
+#define ATF_MAGIC 0x80 /* Automatically added entry. */
+
+
+/* Support for the user space arp daemon, arpd. */
+#define ARPD_UPDATE 0x01
+#define ARPD_LOOKUP 0x02
+#define ARPD_FLUSH 0x03
+
+struct arpd_request
+ {
+ unsigned short int req; /* Request type. */
+ u_int32_t ip; /* IP address of entry. */
+ unsigned long int dev; /* Device entry is tied to. */
+ unsigned long int stamp;
+ unsigned long int updated;
+ unsigned char ha[MAX_ADDR_LEN]; /* Hardware address. */
+ };
+
+__END_DECLS
+
+#endif /* net/if_arp.h */
diff --git a/sysroot/usr/include/net/if_packet.h b/sysroot/usr/include/net/if_packet.h
new file mode 100644
index 0000000..e5184e7
--- /dev/null
+++ b/sysroot/usr/include/net/if_packet.h
@@ -0,0 +1,37 @@
+/* Definitions for use with Linux SOCK_PACKET sockets.
+ Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef __IF_PACKET_H
+#define __IF_PACKET_H
+
+#include <features.h>
+#include <bits/sockaddr.h>
+
+/* This is the SOCK_PACKET address structure as used in Linux 2.0.
+ From Linux 2.1 the AF_PACKET interface is preferred and you should
+ consider using it in place of this one. */
+
+struct sockaddr_pkt
+ {
+ __SOCKADDR_COMMON (spkt_);
+ unsigned char spkt_device[14];
+ unsigned short spkt_protocol;
+ };
+
+#endif
diff --git a/sysroot/usr/include/net/if_ppp.h b/sysroot/usr/include/net/if_ppp.h
new file mode 100644
index 0000000..bf5ec83
--- /dev/null
+++ b/sysroot/usr/include/net/if_ppp.h
@@ -0,0 +1,169 @@
+/* From: if_ppp.h,v 1.3 1995/06/12 11:36:50 paulus Exp */
+
+/*
+ * if_ppp.h - Point-to-Point Protocol definitions.
+ *
+ * Copyright (c) 1989 Carnegie Mellon University.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+/*
+ * ==FILEVERSION 960926==
+ *
+ * NOTE TO MAINTAINERS:
+ * If you modify this file at all, please set the above date.
+ * if_ppp.h is shipped with a PPP distribution as well as with the kernel;
+ * if everyone increases the FILEVERSION number above, then scripts
+ * can do the right thing when deciding whether to install a new if_ppp.h
+ * file. Don't change the format of that line otherwise, so the
+ * installation script can recognize it.
+ */
+
+
+#ifndef __NET_IF_PPP_H
+#define __NET_IF_PPP_H 1
+
+#include <sys/types.h>
+#include <sys/cdefs.h>
+
+#include <net/if.h>
+#include <sys/ioctl.h>
+#include <net/ppp_defs.h>
+
+__BEGIN_DECLS
+
+/*
+ * Packet sizes
+ */
+
+#define PPP_MTU 1500 /* Default MTU (size of Info field) */
+#define PPP_MAXMRU 65000 /* Largest MRU we allow */
+#define PPP_VERSION "2.2.0"
+#define PPP_MAGIC 0x5002 /* Magic value for the ppp structure */
+#define PROTO_IPX 0x002b /* protocol numbers */
+#define PROTO_DNA_RT 0x0027 /* DNA Routing */
+
+
+/*
+ * Bit definitions for flags.
+ */
+
+#define SC_COMP_PROT 0x00000001 /* protocol compression (output) */
+#define SC_COMP_AC 0x00000002 /* header compression (output) */
+#define SC_COMP_TCP 0x00000004 /* TCP (VJ) compression (output) */
+#define SC_NO_TCP_CCID 0x00000008 /* disable VJ connection-id comp. */
+#define SC_REJ_COMP_AC 0x00000010 /* reject adrs/ctrl comp. on input */
+#define SC_REJ_COMP_TCP 0x00000020 /* reject TCP (VJ) comp. on input */
+#define SC_CCP_OPEN 0x00000040 /* Look at CCP packets */
+#define SC_CCP_UP 0x00000080 /* May send/recv compressed packets */
+#define SC_ENABLE_IP 0x00000100 /* IP packets may be exchanged */
+#define SC_COMP_RUN 0x00001000 /* compressor has been inited */
+#define SC_DECOMP_RUN 0x00002000 /* decompressor has been inited */
+#define SC_DEBUG 0x00010000 /* enable debug messages */
+#define SC_LOG_INPKT 0x00020000 /* log contents of good pkts recvd */
+#define SC_LOG_OUTPKT 0x00040000 /* log contents of pkts sent */
+#define SC_LOG_RAWIN 0x00080000 /* log all chars received */
+#define SC_LOG_FLUSH 0x00100000 /* log all chars flushed */
+#define SC_MASK 0x0fE0ffff /* bits that user can change */
+
+/* state bits */
+#define SC_ESCAPED 0x80000000 /* saw a PPP_ESCAPE */
+#define SC_FLUSH 0x40000000 /* flush input until next PPP_FLAG */
+#define SC_VJ_RESET 0x20000000 /* Need to reset the VJ decompressor */
+#define SC_XMIT_BUSY 0x10000000 /* ppp_write_wakeup is active */
+#define SC_RCV_ODDP 0x08000000 /* have rcvd char with odd parity */
+#define SC_RCV_EVNP 0x04000000 /* have rcvd char with even parity */
+#define SC_RCV_B7_1 0x02000000 /* have rcvd char with bit 7 = 1 */
+#define SC_RCV_B7_0 0x01000000 /* have rcvd char with bit 7 = 0 */
+#define SC_DC_FERROR 0x00800000 /* fatal decomp error detected */
+#define SC_DC_ERROR 0x00400000 /* non-fatal decomp error detected */
+
+/*
+ * Ioctl definitions.
+ */
+
+struct npioctl {
+ int protocol; /* PPP protocol, e.g. PPP_IP */
+ enum NPmode mode;
+};
+
+/* Structure describing a CCP configuration option, for PPPIOCSCOMPRESS */
+struct ppp_option_data {
+ u_int8_t *ptr;
+ u_int32_t length;
+ int transmit;
+};
+
+struct ifpppstatsreq {
+ struct ifreq b;
+ struct ppp_stats stats; /* statistic information */
+};
+
+struct ifpppcstatsreq {
+ struct ifreq b;
+ struct ppp_comp_stats stats;
+};
+
+#define ifr__name b.ifr_ifrn.ifrn_name
+#define stats_ptr b.ifr_ifru.ifru_data
+
+/*
+ * Ioctl definitions.
+ */
+
+#define PPPIOCGFLAGS _IOR('t', 90, int) /* get configuration flags */
+#define PPPIOCSFLAGS _IOW('t', 89, int) /* set configuration flags */
+#define PPPIOCGASYNCMAP _IOR('t', 88, int) /* get async map */
+#define PPPIOCSASYNCMAP _IOW('t', 87, int) /* set async map */
+#define PPPIOCGUNIT _IOR('t', 86, int) /* get ppp unit number */
+#define PPPIOCGRASYNCMAP _IOR('t', 85, int) /* get receive async map */
+#define PPPIOCSRASYNCMAP _IOW('t', 84, int) /* set receive async map */
+#define PPPIOCGMRU _IOR('t', 83, int) /* get max receive unit */
+#define PPPIOCSMRU _IOW('t', 82, int) /* set max receive unit */
+#define PPPIOCSMAXCID _IOW('t', 81, int) /* set VJ max slot ID */
+#define PPPIOCGXASYNCMAP _IOR('t', 80, ext_accm) /* get extended ACCM */
+#define PPPIOCSXASYNCMAP _IOW('t', 79, ext_accm) /* set extended ACCM */
+#define PPPIOCXFERUNIT _IO('t', 78) /* transfer PPP unit */
+#define PPPIOCSCOMPRESS _IOW('t', 77, struct ppp_option_data)
+#define PPPIOCGNPMODE _IOWR('t', 76, struct npioctl) /* get NP mode */
+#define PPPIOCSNPMODE _IOW('t', 75, struct npioctl) /* set NP mode */
+#define PPPIOCGDEBUG _IOR('t', 65, int) /* Read debug level */
+#define PPPIOCSDEBUG _IOW('t', 64, int) /* Set debug level */
+#define PPPIOCGIDLE _IOR('t', 63, struct ppp_idle) /* get idle time */
+
+#define SIOCGPPPSTATS (SIOCDEVPRIVATE + 0)
+#define SIOCGPPPVER (SIOCDEVPRIVATE + 1) /* NEVER change this!! */
+#define SIOCGPPPCSTATS (SIOCDEVPRIVATE + 2)
+
+#if !defined(ifr_mtu)
+#define ifr_mtu ifr_ifru.ifru_metric
+#endif
+
+__END_DECLS
+
+#endif /* net/if_ppp.h */
diff --git a/sysroot/usr/include/net/if_shaper.h b/sysroot/usr/include/net/if_shaper.h
new file mode 100644
index 0000000..7060af3
--- /dev/null
+++ b/sysroot/usr/include/net/if_shaper.h
@@ -0,0 +1,59 @@
+/* Copyright (C) 1998 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _NET_IF_SHAPER_H
+#define _NET_IF_SHAPER_H 1
+
+#include <features.h>
+#include <sys/types.h>
+#include <net/if.h>
+#include <sys/ioctl.h>
+
+__BEGIN_DECLS
+
+#define SHAPER_QLEN 10
+/*
+ * This is a bit speed dependant (read it shouldnt be a constant!)
+ *
+ * 5 is about right for 28.8 upwards. Below that double for every
+ * halving of speed or so. - ie about 20 for 9600 baud.
+ */
+#define SHAPER_LATENCY (5 * HZ)
+#define SHAPER_MAXSLIP 2
+#define SHAPER_BURST (HZ / 50) /* Good for >128K then */
+
+#define SHAPER_SET_DEV 0x0001
+#define SHAPER_SET_SPEED 0x0002
+#define SHAPER_GET_DEV 0x0003
+#define SHAPER_GET_SPEED 0x0004
+
+struct shaperconf
+{
+ u_int16_t ss_cmd;
+ union
+ {
+ char ssu_name[14];
+ u_int32_t ssu_speed;
+ } ss_u;
+#define ss_speed ss_u.ssu_speed
+#define ss_name ss_u.ssu_name
+};
+
+__END_DECLS
+
+#endif /* net/if_shaper.h */
diff --git a/sysroot/usr/include/net/if_slip.h b/sysroot/usr/include/net/if_slip.h
new file mode 100644
index 0000000..66bd7f3
--- /dev/null
+++ b/sysroot/usr/include/net/if_slip.h
@@ -0,0 +1,25 @@
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _NET_IF_SLIP_H
+#define _NET_IF_SLIP_H 1
+
+/* We can use the kernel header. */
+#include <linux/if_slip.h>
+
+#endif /* net/if_slip.h. */
diff --git a/sysroot/usr/include/net/ppp-comp.h b/sysroot/usr/include/net/ppp-comp.h
new file mode 100644
index 0000000..4a992d5
--- /dev/null
+++ b/sysroot/usr/include/net/ppp-comp.h
@@ -0,0 +1 @@
+#include <linux/ppp-comp.h>
diff --git a/sysroot/usr/include/net/ppp_defs.h b/sysroot/usr/include/net/ppp_defs.h
new file mode 100644
index 0000000..f8924c4
--- /dev/null
+++ b/sysroot/usr/include/net/ppp_defs.h
@@ -0,0 +1,10 @@
+#ifndef _NET_PPP_DEFS_H
+#define _NET_PPP_DEFS_H 1
+
+#define __need_time_t
+#include <time.h>
+
+#include <asm/types.h>
+#include <linux/ppp_defs.h>
+
+#endif /* net/ppp_defs.h */
diff --git a/sysroot/usr/include/net/route.h b/sysroot/usr/include/net/route.h
new file mode 100644
index 0000000..da5c810
--- /dev/null
+++ b/sysroot/usr/include/net/route.h
@@ -0,0 +1,145 @@
+/* Copyright (C) 1997, 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Based on the 4.4BSD and Linux version of this file. */
+
+#ifndef _NET_ROUTE_H
+#define _NET_ROUTE_H 1
+
+#include <features.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <bits/wordsize.h>
+
+
+/* This structure gets passed by the SIOCADDRT and SIOCDELRT calls. */
+struct rtentry
+ {
+ unsigned long int rt_pad1;
+ struct sockaddr rt_dst; /* Target address. */
+ struct sockaddr rt_gateway; /* Gateway addr (RTF_GATEWAY). */
+ struct sockaddr rt_genmask; /* Target network mask (IP). */
+ unsigned short int rt_flags;
+ short int rt_pad2;
+ unsigned long int rt_pad3;
+ unsigned char rt_tos;
+ unsigned char rt_class;
+#if __WORDSIZE == 64
+ short int rt_pad4[3];
+#else
+ short int rt_pad4;
+#endif
+ short int rt_metric; /* +1 for binary compatibility! */
+ char *rt_dev; /* Forcing the device at add. */
+ unsigned long int rt_mtu; /* Per route MTU/Window. */
+ unsigned long int rt_window; /* Window clamping. */
+ unsigned short int rt_irtt; /* Initial RTT. */
+ };
+/* Compatibility hack. */
+#define rt_mss rt_mtu
+
+
+struct in6_rtmsg
+ {
+ struct in6_addr rtmsg_dst;
+ struct in6_addr rtmsg_src;
+ struct in6_addr rtmsg_gateway;
+ u_int32_t rtmsg_type;
+ u_int16_t rtmsg_dst_len;
+ u_int16_t rtmsg_src_len;
+ u_int32_t rtmsg_metric;
+ unsigned long int rtmsg_info;
+ u_int32_t rtmsg_flags;
+ int rtmsg_ifindex;
+ };
+
+
+#define RTF_UP 0x0001 /* Route usable. */
+#define RTF_GATEWAY 0x0002 /* Destination is a gateway. */
+
+#define RTF_HOST 0x0004 /* Host entry (net otherwise). */
+#define RTF_REINSTATE 0x0008 /* Reinstate route after timeout. */
+#define RTF_DYNAMIC 0x0010 /* Created dyn. (by redirect). */
+#define RTF_MODIFIED 0x0020 /* Modified dyn. (by redirect). */
+#define RTF_MTU 0x0040 /* Specific MTU for this route. */
+#define RTF_MSS RTF_MTU /* Compatibility. */
+#define RTF_WINDOW 0x0080 /* Per route window clamping. */
+#define RTF_IRTT 0x0100 /* Initial round trip time. */
+#define RTF_REJECT 0x0200 /* Reject route. */
+#define RTF_STATIC 0x0400 /* Manually injected route. */
+#define RTF_XRESOLVE 0x0800 /* External resolver. */
+#define RTF_NOFORWARD 0x1000 /* Forwarding inhibited. */
+#define RTF_THROW 0x2000 /* Go to next class. */
+#define RTF_NOPMTUDISC 0x4000 /* Do not send packets with DF. */
+
+/* for IPv6 */
+#define RTF_DEFAULT 0x00010000 /* default - learned via ND */
+#define RTF_ALLONLINK 0x00020000 /* fallback, no routers on link */
+#define RTF_ADDRCONF 0x00040000 /* addrconf route - RA */
+
+#define RTF_LINKRT 0x00100000 /* link specific - device match */
+#define RTF_NONEXTHOP 0x00200000 /* route with no nexthop */
+
+#define RTF_CACHE 0x01000000 /* cache entry */
+#define RTF_FLOW 0x02000000 /* flow significant route */
+#define RTF_POLICY 0x04000000 /* policy route */
+
+#define RTCF_VALVE 0x00200000
+#define RTCF_MASQ 0x00400000
+#define RTCF_NAT 0x00800000
+#define RTCF_DOREDIRECT 0x01000000
+#define RTCF_LOG 0x02000000
+#define RTCF_DIRECTSRC 0x04000000
+
+#define RTF_LOCAL 0x80000000
+#define RTF_INTERFACE 0x40000000
+#define RTF_MULTICAST 0x20000000
+#define RTF_BROADCAST 0x10000000
+#define RTF_NAT 0x08000000
+
+#define RTF_ADDRCLASSMASK 0xF8000000
+#define RT_ADDRCLASS(flags) ((__u_int32_t) flags >> 23)
+
+#define RT_TOS(tos) ((tos) & IPTOS_TOS_MASK)
+
+#define RT_LOCALADDR(flags) ((flags & RTF_ADDRCLASSMASK) \
+ == (RTF_LOCAL|RTF_INTERFACE))
+
+#define RT_CLASS_UNSPEC 0
+#define RT_CLASS_DEFAULT 253
+
+#define RT_CLASS_MAIN 254
+#define RT_CLASS_LOCAL 255
+#define RT_CLASS_MAX 255
+
+
+#define RTMSG_ACK NLMSG_ACK
+#define RTMSG_OVERRUN NLMSG_OVERRUN
+
+#define RTMSG_NEWDEVICE 0x11
+#define RTMSG_DELDEVICE 0x12
+#define RTMSG_NEWROUTE 0x21
+#define RTMSG_DELROUTE 0x22
+#define RTMSG_NEWRULE 0x31
+#define RTMSG_DELRULE 0x32
+#define RTMSG_CONTROL 0x40
+
+#define RTMSG_AR_FAILED 0x51 /* Address Resolution failed. */
+
+#endif /* net/route.h */
diff --git a/sysroot/usr/include/netash/ash.h b/sysroot/usr/include/netash/ash.h
new file mode 100644
index 0000000..712c0aa
--- /dev/null
+++ b/sysroot/usr/include/netash/ash.h
@@ -0,0 +1,40 @@
+/* Definitions for use with Linux AF_ASH sockets.
+ Copyright (C) 1998 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _NETASH_ASH_H
+#define _NETASH_ASH_H 1
+
+#include <features.h>
+#include <bits/sockaddr.h>
+
+struct sockaddr_ash
+ {
+ __SOCKADDR_COMMON (sash_); /* Common data: address family etc. */
+ int sash_ifindex; /* Interface to use. */
+ unsigned char sash_channel; /* Realtime or control. */
+ unsigned int sash_plen;
+ unsigned char sash_prefix[16];
+ };
+
+/* Values for `channel' member. */
+#define ASH_CHANNEL_ANY 0
+#define ASH_CHANNEL_CONTROL 1
+#define ASH_CHANNEL_REALTIME 2
+
+#endif /* netash/ash.h */
diff --git a/sysroot/usr/include/netatalk/at.h b/sysroot/usr/include/netatalk/at.h
new file mode 100644
index 0000000..2668fc9
--- /dev/null
+++ b/sysroot/usr/include/netatalk/at.h
@@ -0,0 +1,30 @@
+/* Copyright (C) 1991, 1992, 1993, 1995, 1996, 1997, 2004
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _NETATALK_AT_H
+#define _NETATALK_AT_H 1
+
+#include <asm/types.h>
+#include <bits/sockaddr.h>
+#include <linux/atalk.h>
+#include <sys/socket.h>
+
+#define SOL_ATALK 258 /* sockopt level for atalk */
+
+#endif /* netatalk/at.h */
diff --git a/sysroot/usr/include/netax25/ax25.h b/sysroot/usr/include/netax25/ax25.h
new file mode 100644
index 0000000..ce3c7ab
--- /dev/null
+++ b/sysroot/usr/include/netax25/ax25.h
@@ -0,0 +1,171 @@
+/* Copyright (C) 1997, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _NETAX25_AX25_H
+#define _NETAX25_AX25_H 1
+
+#include <features.h>
+#include <bits/sockaddr.h>
+
+/* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx. */
+#define SOL_AX25 257
+
+/* AX.25 flags: */
+#define AX25_WINDOW 1
+#define AX25_T1 2
+#define AX25_T2 5
+#define AX25_T3 4
+#define AX25_N2 3
+#define AX25_BACKOFF 6
+#define AX25_EXTSEQ 7
+#define AX25_PIDINCL 8
+#define AX25_IDLE 9
+#define AX25_PACLEN 10
+#define AX25_IPMAXQUEUE 11
+#define AX25_IAMDIGI 12
+#define AX25_KILL 99
+
+/* AX.25 socket ioctls: */
+#define SIOCAX25GETUID (SIOCPROTOPRIVATE)
+#define SIOCAX25ADDUID (SIOCPROTOPRIVATE+1)
+#define SIOCAX25DELUID (SIOCPROTOPRIVATE+2)
+#define SIOCAX25NOUID (SIOCPROTOPRIVATE+3)
+#define SIOCAX25BPQADDR (SIOCPROTOPRIVATE+4)
+#define SIOCAX25GETPARMS (SIOCPROTOPRIVATE+5)
+#define SIOCAX25SETPARMS (SIOCPROTOPRIVATE+6)
+#define SIOCAX25OPTRT (SIOCPROTOPRIVATE+7)
+#define SIOCAX25CTLCON (SIOCPROTOPRIVATE+8)
+#define SIOCAX25GETINFO (SIOCPROTOPRIVATE+9)
+#define SIOCAX25ADDFWD (SIOCPROTOPRIVATE+10)
+#define SIOCAX25DELFWD (SIOCPROTOPRIVATE+11)
+
+/* unknown: */
+#define AX25_NOUID_DEFAULT 0
+#define AX25_NOUID_BLOCK 1
+#define AX25_SET_RT_IPMODE 2
+
+/* Digipeating flags: */
+#define AX25_DIGI_INBAND 0x01 /* Allow digipeating within port */
+#define AX25_DIGI_XBAND 0x02 /* Allow digipeating across ports */
+
+/* Maximim number of digipeaters: */
+#define AX25_MAX_DIGIS 8
+
+
+typedef struct
+ {
+ char ax25_call[7]; /* 6 call + SSID (shifted ascii) */
+ }
+ax25_address;
+
+struct sockaddr_ax25
+ {
+ sa_family_t sax25_family;
+ ax25_address sax25_call;
+ int sax25_ndigis;
+ };
+
+/*
+ * The sockaddr struct with the digipeater adresses:
+ */
+struct full_sockaddr_ax25
+ {
+ struct sockaddr_ax25 fsa_ax25;
+ ax25_address fsa_digipeater[AX25_MAX_DIGIS];
+ };
+#define sax25_uid sax25_ndigis
+
+struct ax25_routes_struct
+ {
+ ax25_address port_addr;
+ ax25_address dest_addr;
+ unsigned char digi_count;
+ ax25_address digi_addr[AX25_MAX_DIGIS];
+ };
+
+/* The AX.25 ioctl structure: */
+struct ax25_ctl_struct
+ {
+ ax25_address port_addr;
+ ax25_address source_addr;
+ ax25_address dest_addr;
+ unsigned int cmd;
+ unsigned long arg;
+ unsigned char digi_count;
+ ax25_address digi_addr[AX25_MAX_DIGIS];
+ };
+
+struct ax25_info_struct
+ {
+ unsigned int n2, n2count;
+ unsigned int t1, t1timer;
+ unsigned int t2, t2timer;
+ unsigned int t3, t3timer;
+ unsigned int idle, idletimer;
+ unsigned int state;
+ unsigned int rcv_q, snd_q;
+ };
+
+struct ax25_fwd_struct
+ {
+ ax25_address port_from;
+ ax25_address port_to;
+ };
+
+/* AX.25 route structure: */
+struct ax25_route_opt_struct
+ {
+ ax25_address port_addr;
+ ax25_address dest_addr;
+ int cmd;
+ int arg;
+ };
+
+/* AX.25 BPQ stuff: */
+struct ax25_bpqaddr_struct
+ {
+ char dev[16];
+ ax25_address addr;
+ };
+
+/* Definitions for the AX.25 `values' fields: */
+#define AX25_VALUES_IPDEFMODE 0 /* 'D'=DG 'V'=VC */
+#define AX25_VALUES_AXDEFMODE 1 /* 8=Normal 128=Extended Seq Nos */
+#define AX25_VALUES_NETROM 2 /* Allow NET/ROM - 0=No 1=Yes */
+#define AX25_VALUES_TEXT 3 /* Allow PID=Text - 0=No 1=Yes */
+#define AX25_VALUES_BACKOFF 4 /* 'E'=Exponential 'L'=Linear */
+#define AX25_VALUES_CONMODE 5 /* Allow connected modes - 0=No 1=Yes */
+#define AX25_VALUES_WINDOW 6 /* Default window size for standard AX.25 */
+#define AX25_VALUES_EWINDOW 7 /* Default window size for extended AX.25 */
+#define AX25_VALUES_T1 8 /* Default T1 timeout value */
+#define AX25_VALUES_T2 9 /* Default T2 timeout value */
+#define AX25_VALUES_T3 10 /* Default T3 timeout value */
+#define AX25_VALUES_N2 11 /* Default N2 value */
+#define AX25_VALUES_DIGI 12 /* Digipeat mode */
+#define AX25_VALUES_IDLE 13 /* mode vc idle timer */
+#define AX25_VALUES_PACLEN 14 /* AX.25 MTU */
+#define AX25_VALUES_IPMAXQUEUE 15 /* Maximum number of buffers enqueued */
+#define AX25_MAX_VALUES 20
+
+struct ax25_parms_struct
+ {
+ ax25_address port_addr;
+ unsigned short values[AX25_MAX_VALUES];
+ };
+
+#endif /* netax25/ax25.h */
diff --git a/sysroot/usr/include/netdb.h b/sysroot/usr/include/netdb.h
new file mode 100644
index 0000000..7c5c9c9
--- /dev/null
+++ b/sysroot/usr/include/netdb.h
@@ -0,0 +1,684 @@
+ /* Copyright (C) 1996-2002, 2003, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* All data returned by the network data base library are supplied in
+ host order and returned in network order (suitable for use in
+ system calls). */
+
+#ifndef _NETDB_H
+#define _NETDB_H 1
+
+#include <features.h>
+
+#include <netinet/in.h>
+#include <stdint.h>
+#ifdef __USE_MISC
+/* This is necessary to make this include file properly replace the
+ Sun version. */
+# include <rpc/netdb.h>
+#endif
+
+#ifdef __USE_GNU
+# define __need_sigevent_t
+# include <bits/siginfo.h>
+# define __need_timespec
+# include <time.h>
+#endif
+
+#include <bits/netdb.h>
+
+/* Absolute file name for network data base files. */
+#define _PATH_HEQUIV "/etc/hosts.equiv"
+#define _PATH_HOSTS "/etc/hosts"
+#define _PATH_NETWORKS "/etc/networks"
+#define _PATH_NSSWITCH_CONF "/etc/nsswitch.conf"
+#define _PATH_PROTOCOLS "/etc/protocols"
+#define _PATH_SERVICES "/etc/services"
+
+
+__BEGIN_DECLS
+
+/* Error status for non-reentrant lookup functions.
+ We use a macro to access always the thread-specific `h_errno' variable. */
+#define h_errno (*__h_errno_location ())
+
+/* Function to get address of global `h_errno' variable. */
+extern int *__h_errno_location (void) __THROW __attribute__ ((__const__));
+
+
+/* Possible values left in `h_errno'. */
+#define NETDB_INTERNAL -1 /* See errno. */
+#define NETDB_SUCCESS 0 /* No problem. */
+#define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found. */
+#define TRY_AGAIN 2 /* Non-Authoritative Host not found,
+ or SERVERFAIL. */
+#define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED,
+ NOTIMP. */
+#define NO_DATA 4 /* Valid name, no data record of requested
+ type. */
+#define NO_ADDRESS NO_DATA /* No address, look for MX record. */
+
+#ifdef __USE_XOPEN2K
+/* Highest reserved Internet port number. */
+# define IPPORT_RESERVED 1024
+#endif
+
+#ifdef __USE_GNU
+/* Scope delimiter for getaddrinfo(), getnameinfo(). */
+# define SCOPE_DELIMITER '%'
+#endif
+
+/* Print error indicated by `h_errno' variable on standard error. STR
+ if non-null is printed before the error string. */
+extern void herror (__const char *__str) __THROW;
+
+/* Return string associated with error ERR_NUM. */
+extern __const char *hstrerror (int __err_num) __THROW;
+
+
+
+/* Description of data base entry for a single host. */
+struct hostent
+{
+ char *h_name; /* Official name of host. */
+ char **h_aliases; /* Alias list. */
+ int h_addrtype; /* Host address type. */
+ int h_length; /* Length of address. */
+ char **h_addr_list; /* List of addresses from name server. */
+#define h_addr h_addr_list[0] /* Address, for backward compatibility. */
+};
+
+/* Open host data base files and mark them as staying open even after
+ a later search if STAY_OPEN is non-zero.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern void sethostent (int __stay_open);
+
+/* Close host data base files and clear `stay open' flag.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern void endhostent (void);
+
+/* Get next entry from host data base file. Open data base if
+ necessary.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct hostent *gethostent (void);
+
+/* Return entry from host data base which address match ADDR with
+ length LEN and type TYPE.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct hostent *gethostbyaddr (__const void *__addr, __socklen_t __len,
+ int __type);
+
+/* Return entry from host data base for host with NAME.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct hostent *gethostbyname (__const char *__name);
+
+#ifdef __USE_MISC
+/* Return entry from host data base for host with NAME. AF must be
+ set to the address type which is `AF_INET' for IPv4 or `AF_INET6'
+ for IPv6.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern struct hostent *gethostbyname2 (__const char *__name, int __af);
+
+/* Reentrant versions of the functions above. The additional
+ arguments specify a buffer of BUFLEN starting at BUF. The last
+ argument is a pointer to a variable which gets the value which
+ would be stored in the global variable `herrno' by the
+ non-reentrant functions.
+
+ These functions are not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation they are cancellation points and
+ therefore not marked with __THROW. */
+extern int gethostent_r (struct hostent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct hostent **__restrict __result,
+ int *__restrict __h_errnop);
+
+extern int gethostbyaddr_r (__const void *__restrict __addr, __socklen_t __len,
+ int __type,
+ struct hostent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct hostent **__restrict __result,
+ int *__restrict __h_errnop);
+
+extern int gethostbyname_r (__const char *__restrict __name,
+ struct hostent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct hostent **__restrict __result,
+ int *__restrict __h_errnop);
+
+extern int gethostbyname2_r (__const char *__restrict __name, int __af,
+ struct hostent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct hostent **__restrict __result,
+ int *__restrict __h_errnop);
+#endif /* misc */
+
+
+/* Open network data base files and mark them as staying open even
+ after a later search if STAY_OPEN is non-zero.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern void setnetent (int __stay_open);
+
+/* Close network data base files and clear `stay open' flag.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern void endnetent (void);
+
+/* Get next entry from network data base file. Open data base if
+ necessary.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct netent *getnetent (void);
+
+/* Return entry from network data base which address match NET and
+ type TYPE.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct netent *getnetbyaddr (uint32_t __net, int __type);
+
+/* Return entry from network data base for network with NAME.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct netent *getnetbyname (__const char *__name);
+
+#ifdef __USE_MISC
+/* Reentrant versions of the functions above. The additional
+ arguments specify a buffer of BUFLEN starting at BUF. The last
+ argument is a pointer to a variable which gets the value which
+ would be stored in the global variable `herrno' by the
+ non-reentrant functions.
+
+ These functions are not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation they are cancellation points and
+ therefore not marked with __THROW. */
+extern int getnetent_r (struct netent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct netent **__restrict __result,
+ int *__restrict __h_errnop);
+
+extern int getnetbyaddr_r (uint32_t __net, int __type,
+ struct netent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct netent **__restrict __result,
+ int *__restrict __h_errnop);
+
+extern int getnetbyname_r (__const char *__restrict __name,
+ struct netent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct netent **__restrict __result,
+ int *__restrict __h_errnop);
+#endif /* misc */
+
+
+/* Description of data base entry for a single service. */
+struct servent
+{
+ char *s_name; /* Official service name. */
+ char **s_aliases; /* Alias list. */
+ int s_port; /* Port number. */
+ char *s_proto; /* Protocol to use. */
+};
+
+/* Open service data base files and mark them as staying open even
+ after a later search if STAY_OPEN is non-zero.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern void setservent (int __stay_open);
+
+/* Close service data base files and clear `stay open' flag.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern void endservent (void);
+
+/* Get next entry from service data base file. Open data base if
+ necessary.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct servent *getservent (void);
+
+/* Return entry from network data base for network with NAME and
+ protocol PROTO.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct servent *getservbyname (__const char *__name,
+ __const char *__proto);
+
+/* Return entry from service data base which matches port PORT and
+ protocol PROTO.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct servent *getservbyport (int __port, __const char *__proto);
+
+
+#ifdef __USE_MISC
+/* Reentrant versions of the functions above. The additional
+ arguments specify a buffer of BUFLEN starting at BUF.
+
+ These functions are not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation they are cancellation points and
+ therefore not marked with __THROW. */
+extern int getservent_r (struct servent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct servent **__restrict __result);
+
+extern int getservbyname_r (__const char *__restrict __name,
+ __const char *__restrict __proto,
+ struct servent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct servent **__restrict __result);
+
+extern int getservbyport_r (int __port, __const char *__restrict __proto,
+ struct servent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct servent **__restrict __result);
+#endif /* misc */
+
+
+/* Description of data base entry for a single service. */
+struct protoent
+{
+ char *p_name; /* Official protocol name. */
+ char **p_aliases; /* Alias list. */
+ int p_proto; /* Protocol number. */
+};
+
+/* Open protocol data base files and mark them as staying open even
+ after a later search if STAY_OPEN is non-zero.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern void setprotoent (int __stay_open);
+
+/* Close protocol data base files and clear `stay open' flag.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern void endprotoent (void);
+
+/* Get next entry from protocol data base file. Open data base if
+ necessary.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct protoent *getprotoent (void);
+
+/* Return entry from protocol data base for network with NAME.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct protoent *getprotobyname (__const char *__name);
+
+/* Return entry from protocol data base which number is PROTO.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct protoent *getprotobynumber (int __proto);
+
+
+#ifdef __USE_MISC
+/* Reentrant versions of the functions above. The additional
+ arguments specify a buffer of BUFLEN starting at BUF.
+
+ These functions are not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation they are cancellation points and
+ therefore not marked with __THROW. */
+extern int getprotoent_r (struct protoent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct protoent **__restrict __result);
+
+extern int getprotobyname_r (__const char *__restrict __name,
+ struct protoent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct protoent **__restrict __result);
+
+extern int getprotobynumber_r (int __proto,
+ struct protoent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct protoent **__restrict __result);
+
+
+/* Establish network group NETGROUP for enumeration.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int setnetgrent (__const char *__netgroup);
+
+/* Free all space allocated by previous `setnetgrent' call.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern void endnetgrent (void);
+
+/* Get next member of netgroup established by last `setnetgrent' call
+ and return pointers to elements in HOSTP, USERP, and DOMAINP.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int getnetgrent (char **__restrict __hostp,
+ char **__restrict __userp,
+ char **__restrict __domainp);
+
+
+/* Test whether NETGROUP contains the triple (HOST,USER,DOMAIN).
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int innetgr (__const char *__netgroup, __const char *__host,
+ __const char *__user, __const char *domain);
+
+/* Reentrant version of `getnetgrent' where result is placed in BUFFER.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int getnetgrent_r (char **__restrict __hostp,
+ char **__restrict __userp,
+ char **__restrict __domainp,
+ char *__restrict __buffer, size_t __buflen);
+#endif /* misc */
+
+
+#ifdef __USE_BSD
+/* Call `rshd' at port RPORT on remote machine *AHOST to execute CMD.
+ The local user is LOCUSER, on the remote machine the command is
+ executed as REMUSER. In *FD2P the descriptor to the socket for the
+ connection is returned. The caller must have the right to use a
+ reserved port. When the function returns *AHOST contains the
+ official host name.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int rcmd (char **__restrict __ahost, unsigned short int __rport,
+ __const char *__restrict __locuser,
+ __const char *__restrict __remuser,
+ __const char *__restrict __cmd, int *__restrict __fd2p);
+
+/* This is the equivalent function where the protocol can be selected
+ and which therefore can be used for IPv6.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int rcmd_af (char **__restrict __ahost, unsigned short int __rport,
+ __const char *__restrict __locuser,
+ __const char *__restrict __remuser,
+ __const char *__restrict __cmd, int *__restrict __fd2p,
+ sa_family_t __af);
+
+/* Call `rexecd' at port RPORT on remote machine *AHOST to execute
+ CMD. The process runs at the remote machine using the ID of user
+ NAME whose cleartext password is PASSWD. In *FD2P the descriptor
+ to the socket for the connection is returned. When the function
+ returns *AHOST contains the official host name.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int rexec (char **__restrict __ahost, int __rport,
+ __const char *__restrict __name,
+ __const char *__restrict __pass,
+ __const char *__restrict __cmd, int *__restrict __fd2p);
+
+/* This is the equivalent function where the protocol can be selected
+ and which therefore can be used for IPv6.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int rexec_af (char **__restrict __ahost, int __rport,
+ __const char *__restrict __name,
+ __const char *__restrict __pass,
+ __const char *__restrict __cmd, int *__restrict __fd2p,
+ sa_family_t __af);
+
+/* Check whether user REMUSER on system RHOST is allowed to login as LOCUSER.
+ If SUSER is not zero the user tries to become superuser. Return 0 if
+ it is possible.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int ruserok (__const char *__rhost, int __suser,
+ __const char *__remuser, __const char *__locuser);
+
+/* This is the equivalent function where the protocol can be selected
+ and which therefore can be used for IPv6.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int ruserok_af (__const char *__rhost, int __suser,
+ __const char *__remuser, __const char *__locuser,
+ sa_family_t __af);
+
+/* Try to allocate reserved port, returning a descriptor for a socket opened
+ at this port or -1 if unsuccessful. The search for an available port
+ will start at ALPORT and continues with lower numbers.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int rresvport (int *__alport);
+
+/* This is the equivalent function where the protocol can be selected
+ and which therefore can be used for IPv6.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int rresvport_af (int *__alport, sa_family_t __af);
+#endif
+
+
+/* Extension from POSIX.1g. */
+#ifdef __USE_POSIX
+/* Structure to contain information about address of a service provider. */
+struct addrinfo
+{
+ int ai_flags; /* Input flags. */
+ int ai_family; /* Protocol family for socket. */
+ int ai_socktype; /* Socket type. */
+ int ai_protocol; /* Protocol for socket. */
+ socklen_t ai_addrlen; /* Length of socket address. */
+ struct sockaddr *ai_addr; /* Socket address for socket. */
+ char *ai_canonname; /* Canonical name for service location. */
+ struct addrinfo *ai_next; /* Pointer to next in list. */
+};
+
+# ifdef __USE_GNU
+/* Structure used as control block for asynchronous lookup. */
+struct gaicb
+{
+ const char *ar_name; /* Name to look up. */
+ const char *ar_service; /* Service name. */
+ const struct addrinfo *ar_request; /* Additional request specification. */
+ struct addrinfo *ar_result; /* Pointer to result. */
+ /* The following are internal elements. */
+ int __return;
+ int __unused[5];
+};
+
+/* Lookup mode. */
+# define GAI_WAIT 0
+# define GAI_NOWAIT 1
+# endif
+
+/* Possible values for `ai_flags' field in `addrinfo' structure. */
+# define AI_PASSIVE 0x0001 /* Socket address is intended for `bind'. */
+# define AI_CANONNAME 0x0002 /* Request for canonical name. */
+# define AI_NUMERICHOST 0x0004 /* Don't use name resolution. */
+# define AI_V4MAPPED 0x0008 /* IPv4 mapped addresses are acceptable. */
+# define AI_ALL 0x0010 /* Return IPv4 mapped and IPv6 addresses. */
+# define AI_ADDRCONFIG 0x0020 /* Use configuration of this host to choose
+ returned address type.. */
+# ifdef __USE_GNU
+# define AI_IDN 0x0040 /* IDN encode input (assuming it is encoded
+ in the current locale's character set)
+ before looking it up. */
+# define AI_CANONIDN 0x0080 /* Translate canonical name from IDN format. */
+# define AI_IDN_ALLOW_UNASSIGNED 0x0100 /* Don't reject unassigned Unicode
+ code points. */
+# define AI_IDN_USE_STD3_ASCII_RULES 0x0200 /* Validate strings according to
+ STD3 rules. */
+# endif
+# define AI_NUMERICSERV 0x0400 /* Don't use name resolution. */
+
+/* Error values for `getaddrinfo' function. */
+# define EAI_BADFLAGS -1 /* Invalid value for `ai_flags' field. */
+# define EAI_NONAME -2 /* NAME or SERVICE is unknown. */
+# define EAI_AGAIN -3 /* Temporary failure in name resolution. */
+# define EAI_FAIL -4 /* Non-recoverable failure in name res. */
+# define EAI_NODATA -5 /* No address associated with NAME. */
+# define EAI_FAMILY -6 /* `ai_family' not supported. */
+# define EAI_SOCKTYPE -7 /* `ai_socktype' not supported. */
+# define EAI_SERVICE -8 /* SERVICE not supported for `ai_socktype'. */
+# define EAI_ADDRFAMILY -9 /* Address family for NAME not supported. */
+# define EAI_MEMORY -10 /* Memory allocation failure. */
+# define EAI_SYSTEM -11 /* System error returned in `errno'. */
+# define EAI_OVERFLOW -12 /* Argument buffer overflow. */
+# ifdef __USE_GNU
+# define EAI_INPROGRESS -100 /* Processing request in progress. */
+# define EAI_CANCELED -101 /* Request canceled. */
+# define EAI_NOTCANCELED -102 /* Request not canceled. */
+# define EAI_ALLDONE -103 /* All requests done. */
+# define EAI_INTR -104 /* Interrupted by a signal. */
+# define EAI_IDN_ENCODE -105 /* IDN encoding failed. */
+# endif
+
+# define NI_MAXHOST 1025
+# define NI_MAXSERV 32
+
+# define NI_NUMERICHOST 1 /* Don't try to look up hostname. */
+# define NI_NUMERICSERV 2 /* Don't convert port number to name. */
+# define NI_NOFQDN 4 /* Only return nodename portion. */
+# define NI_NAMEREQD 8 /* Don't return numeric addresses. */
+# define NI_DGRAM 16 /* Look up UDP service rather than TCP. */
+# ifdef __USE_GNU
+# define NI_IDN 32 /* Convert name from IDN format. */
+# define NI_IDN_ALLOW_UNASSIGNED 64 /* Don't reject unassigned Unicode
+ code points. */
+# define NI_IDN_USE_STD3_ASCII_RULES 128 /* Validate strings according to
+ STD3 rules. */
+# endif
+
+/* Translate name of a service location and/or a service name to set of
+ socket addresses.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int getaddrinfo (__const char *__restrict __name,
+ __const char *__restrict __service,
+ __const struct addrinfo *__restrict __req,
+ struct addrinfo **__restrict __pai);
+
+/* Free `addrinfo' structure AI including associated storage. */
+extern void freeaddrinfo (struct addrinfo *__ai) __THROW;
+
+/* Convert error return from getaddrinfo() to a string. */
+extern __const char *gai_strerror (int __ecode) __THROW;
+
+/* Translate a socket address to a location and service name.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int getnameinfo (__const struct sockaddr *__restrict __sa,
+ socklen_t __salen, char *__restrict __host,
+ socklen_t __hostlen, char *__restrict __serv,
+ socklen_t __servlen, unsigned int __flags);
+#endif /* POSIX */
+
+#ifdef __USE_GNU
+/* Enqueue ENT requests from the LIST. If MODE is GAI_WAIT wait until all
+ requests are handled. If WAIT is GAI_NOWAIT return immediately after
+ queueing the requests and signal completion according to SIG.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int getaddrinfo_a (int __mode, struct gaicb *__list[__restrict_arr],
+ int __ent, struct sigevent *__restrict __sig);
+
+/* Suspend execution of the thread until at least one of the ENT requests
+ in LIST is handled. If TIMEOUT is not a null pointer it specifies the
+ longest time the function keeps waiting before returning with an error.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int gai_suspend (__const struct gaicb *__const __list[], int __ent,
+ __const struct timespec *__timeout);
+
+/* Get the error status of the request REQ. */
+extern int gai_error (struct gaicb *__req) __THROW;
+
+/* Cancel the requests associated with GAICBP. */
+extern int gai_cancel (struct gaicb *__gaicbp) __THROW;
+#endif /* GNU */
+
+__END_DECLS
+
+#endif /* netdb.h */
diff --git a/sysroot/usr/include/neteconet/ec.h b/sysroot/usr/include/neteconet/ec.h
new file mode 100644
index 0000000..f21601c
--- /dev/null
+++ b/sysroot/usr/include/neteconet/ec.h
@@ -0,0 +1,52 @@
+/* Definitions for use with Linux AF_ECONET sockets.
+ Copyright (C) 1998 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _NETECONET_EC_H
+#define _NETECONET_EC_H 1
+
+#include <features.h>
+#include <bits/sockaddr.h>
+
+struct ec_addr
+ {
+ unsigned char station; /* Station number. */
+ unsigned char net; /* Network number. */
+ };
+
+struct sockaddr_ec
+ {
+ __SOCKADDR_COMMON (sec_);
+ unsigned char port; /* Port number. */
+ unsigned char cb; /* Control/flag byte. */
+ unsigned char type; /* Type of message. */
+ struct ec_addr addr;
+ unsigned long cookie;
+ };
+
+#define ECTYPE_PACKET_RECEIVED 0 /* Packet received */
+#define ECTYPE_TRANSMIT_STATUS 0x10 /* Transmit completed */
+
+#define ECTYPE_TRANSMIT_OK 1
+#define ECTYPE_TRANSMIT_NOT_LISTENING 2
+#define ECTYPE_TRANSMIT_NET_ERROR 3
+#define ECTYPE_TRANSMIT_NO_CLOCK 4
+#define ECTYPE_TRANSMIT_LINE_JAMMED 5
+#define ECTYPE_TRANSMIT_NOT_PRESENT 6
+
+#endif
diff --git a/sysroot/usr/include/netinet/ether.h b/sysroot/usr/include/netinet/ether.h
new file mode 100644
index 0000000..ca780e2
--- /dev/null
+++ b/sysroot/usr/include/netinet/ether.h
@@ -0,0 +1,54 @@
+/* Functions for storing Ethernet addresses in ASCII and mapping to hostnames.
+ Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _NETINET_ETHER_H
+#define _NETINET_ETHER_H 1
+
+#include <features.h>
+
+/* Get definition of `struct ether_addr'. */
+#include <netinet/if_ether.h>
+
+__BEGIN_DECLS
+
+/* Convert 48 bit Ethernet ADDRess to ASCII. */
+extern char *ether_ntoa (__const struct ether_addr *__addr) __THROW;
+extern char *ether_ntoa_r (__const struct ether_addr *__addr, char *__buf)
+ __THROW;
+
+/* Convert ASCII string S to 48 bit Ethernet address. */
+extern struct ether_addr *ether_aton (__const char *__asc) __THROW;
+extern struct ether_addr *ether_aton_r (__const char *__asc,
+ struct ether_addr *__addr) __THROW;
+
+/* Map 48 bit Ethernet number ADDR to HOSTNAME. */
+extern int ether_ntohost (char *__hostname, __const struct ether_addr *__addr)
+ __THROW;
+
+/* Map HOSTNAME to 48 bit Ethernet address. */
+extern int ether_hostton (__const char *__hostname, struct ether_addr *__addr)
+ __THROW;
+
+/* Scan LINE and set ADDR and HOSTNAME. */
+extern int ether_line (__const char *__line, struct ether_addr *__addr,
+ char *__hostname) __THROW;
+
+__END_DECLS
+
+#endif /* netinet/ether.h */
diff --git a/sysroot/usr/include/netinet/icmp6.h b/sysroot/usr/include/netinet/icmp6.h
new file mode 100644
index 0000000..0cb1aa6
--- /dev/null
+++ b/sysroot/usr/include/netinet/icmp6.h
@@ -0,0 +1,346 @@
+/* Copyright (C) 1991-1997,2000,2006 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _NETINET_ICMP6_H
+#define _NETINET_ICMP6_H 1
+
+#include <inttypes.h>
+#include <string.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#define ICMP6_FILTER 1
+
+#define ICMP6_FILTER_BLOCK 1
+#define ICMP6_FILTER_PASS 2
+#define ICMP6_FILTER_BLOCKOTHERS 3
+#define ICMP6_FILTER_PASSONLY 4
+
+struct icmp6_filter
+ {
+ uint32_t icmp6_filt[8];
+ };
+
+struct icmp6_hdr
+ {
+ uint8_t icmp6_type; /* type field */
+ uint8_t icmp6_code; /* code field */
+ uint16_t icmp6_cksum; /* checksum field */
+ union
+ {
+ uint32_t icmp6_un_data32[1]; /* type-specific field */
+ uint16_t icmp6_un_data16[2]; /* type-specific field */
+ uint8_t icmp6_un_data8[4]; /* type-specific field */
+ } icmp6_dataun;
+ };
+
+#define icmp6_data32 icmp6_dataun.icmp6_un_data32
+#define icmp6_data16 icmp6_dataun.icmp6_un_data16
+#define icmp6_data8 icmp6_dataun.icmp6_un_data8
+#define icmp6_pptr icmp6_data32[0] /* parameter prob */
+#define icmp6_mtu icmp6_data32[0] /* packet too big */
+#define icmp6_id icmp6_data16[0] /* echo request/reply */
+#define icmp6_seq icmp6_data16[1] /* echo request/reply */
+#define icmp6_maxdelay icmp6_data16[0] /* mcast group membership */
+
+#define ICMP6_DST_UNREACH 1
+#define ICMP6_PACKET_TOO_BIG 2
+#define ICMP6_TIME_EXCEEDED 3
+#define ICMP6_PARAM_PROB 4
+
+#define ICMP6_INFOMSG_MASK 0x80 /* all informational messages */
+
+#define ICMP6_ECHO_REQUEST 128
+#define ICMP6_ECHO_REPLY 129
+#define MLD_LISTENER_QUERY 130
+#define MLD_LISTENER_REPORT 131
+#define MLD_LISTENER_REDUCTION 132
+
+#define ICMP6_DST_UNREACH_NOROUTE 0 /* no route to destination */
+#define ICMP6_DST_UNREACH_ADMIN 1 /* communication with destination */
+ /* administratively prohibited */
+#define ICMP6_DST_UNREACH_BEYONDSCOPE 2 /* beyond scope of source address */
+#define ICMP6_DST_UNREACH_ADDR 3 /* address unreachable */
+#define ICMP6_DST_UNREACH_NOPORT 4 /* bad port */
+
+#define ICMP6_TIME_EXCEED_TRANSIT 0 /* Hop Limit == 0 in transit */
+#define ICMP6_TIME_EXCEED_REASSEMBLY 1 /* Reassembly time out */
+
+#define ICMP6_PARAMPROB_HEADER 0 /* erroneous header field */
+#define ICMP6_PARAMPROB_NEXTHEADER 1 /* unrecognized Next Header */
+#define ICMP6_PARAMPROB_OPTION 2 /* unrecognized IPv6 option */
+
+#define ICMP6_FILTER_WILLPASS(type, filterp) \
+ ((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) == 0)
+
+#define ICMP6_FILTER_WILLBLOCK(type, filterp) \
+ ((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) != 0)
+
+#define ICMP6_FILTER_SETPASS(type, filterp) \
+ ((((filterp)->icmp6_filt[(type) >> 5]) &= ~(1 << ((type) & 31))))
+
+#define ICMP6_FILTER_SETBLOCK(type, filterp) \
+ ((((filterp)->icmp6_filt[(type) >> 5]) |= (1 << ((type) & 31))))
+
+#define ICMP6_FILTER_SETPASSALL(filterp) \
+ memset (filterp, 0, sizeof (struct icmp6_filter));
+
+#define ICMP6_FILTER_SETBLOCKALL(filterp) \
+ memset (filterp, 0xFF, sizeof (struct icmp6_filter));
+
+#define ND_ROUTER_SOLICIT 133
+#define ND_ROUTER_ADVERT 134
+#define ND_NEIGHBOR_SOLICIT 135
+#define ND_NEIGHBOR_ADVERT 136
+#define ND_REDIRECT 137
+
+struct nd_router_solicit /* router solicitation */
+ {
+ struct icmp6_hdr nd_rs_hdr;
+ /* could be followed by options */
+ };
+
+#define nd_rs_type nd_rs_hdr.icmp6_type
+#define nd_rs_code nd_rs_hdr.icmp6_code
+#define nd_rs_cksum nd_rs_hdr.icmp6_cksum
+#define nd_rs_reserved nd_rs_hdr.icmp6_data32[0]
+
+struct nd_router_advert /* router advertisement */
+ {
+ struct icmp6_hdr nd_ra_hdr;
+ uint32_t nd_ra_reachable; /* reachable time */
+ uint32_t nd_ra_retransmit; /* retransmit timer */
+ /* could be followed by options */
+ };
+
+#define nd_ra_type nd_ra_hdr.icmp6_type
+#define nd_ra_code nd_ra_hdr.icmp6_code
+#define nd_ra_cksum nd_ra_hdr.icmp6_cksum
+#define nd_ra_curhoplimit nd_ra_hdr.icmp6_data8[0]
+#define nd_ra_flags_reserved nd_ra_hdr.icmp6_data8[1]
+#define ND_RA_FLAG_MANAGED 0x80
+#define ND_RA_FLAG_OTHER 0x40
+#define ND_RA_FLAG_HOME_AGENT 0x20
+#define nd_ra_router_lifetime nd_ra_hdr.icmp6_data16[1]
+
+struct nd_neighbor_solicit /* neighbor solicitation */
+ {
+ struct icmp6_hdr nd_ns_hdr;
+ struct in6_addr nd_ns_target; /* target address */
+ /* could be followed by options */
+ };
+
+#define nd_ns_type nd_ns_hdr.icmp6_type
+#define nd_ns_code nd_ns_hdr.icmp6_code
+#define nd_ns_cksum nd_ns_hdr.icmp6_cksum
+#define nd_ns_reserved nd_ns_hdr.icmp6_data32[0]
+
+struct nd_neighbor_advert /* neighbor advertisement */
+ {
+ struct icmp6_hdr nd_na_hdr;
+ struct in6_addr nd_na_target; /* target address */
+ /* could be followed by options */
+ };
+
+#define nd_na_type nd_na_hdr.icmp6_type
+#define nd_na_code nd_na_hdr.icmp6_code
+#define nd_na_cksum nd_na_hdr.icmp6_cksum
+#define nd_na_flags_reserved nd_na_hdr.icmp6_data32[0]
+#if BYTE_ORDER == BIG_ENDIAN
+#define ND_NA_FLAG_ROUTER 0x80000000
+#define ND_NA_FLAG_SOLICITED 0x40000000
+#define ND_NA_FLAG_OVERRIDE 0x20000000
+#else /* BYTE_ORDER == LITTLE_ENDIAN */
+#define ND_NA_FLAG_ROUTER 0x00000080
+#define ND_NA_FLAG_SOLICITED 0x00000040
+#define ND_NA_FLAG_OVERRIDE 0x00000020
+#endif
+
+struct nd_redirect /* redirect */
+ {
+ struct icmp6_hdr nd_rd_hdr;
+ struct in6_addr nd_rd_target; /* target address */
+ struct in6_addr nd_rd_dst; /* destination address */
+ /* could be followed by options */
+ };
+
+#define nd_rd_type nd_rd_hdr.icmp6_type
+#define nd_rd_code nd_rd_hdr.icmp6_code
+#define nd_rd_cksum nd_rd_hdr.icmp6_cksum
+#define nd_rd_reserved nd_rd_hdr.icmp6_data32[0]
+
+struct nd_opt_hdr /* Neighbor discovery option header */
+ {
+ uint8_t nd_opt_type;
+ uint8_t nd_opt_len; /* in units of 8 octets */
+ /* followed by option specific data */
+ };
+
+#define ND_OPT_SOURCE_LINKADDR 1
+#define ND_OPT_TARGET_LINKADDR 2
+#define ND_OPT_PREFIX_INFORMATION 3
+#define ND_OPT_REDIRECTED_HEADER 4
+#define ND_OPT_MTU 5
+#define ND_OPT_RTR_ADV_INTERVAL 7
+#define ND_OPT_HOME_AGENT_INFO 8
+
+struct nd_opt_prefix_info /* prefix information */
+ {
+ uint8_t nd_opt_pi_type;
+ uint8_t nd_opt_pi_len;
+ uint8_t nd_opt_pi_prefix_len;
+ uint8_t nd_opt_pi_flags_reserved;
+ uint32_t nd_opt_pi_valid_time;
+ uint32_t nd_opt_pi_preferred_time;
+ uint32_t nd_opt_pi_reserved2;
+ struct in6_addr nd_opt_pi_prefix;
+ };
+
+#define ND_OPT_PI_FLAG_ONLINK 0x80
+#define ND_OPT_PI_FLAG_AUTO 0x40
+#define ND_OPT_PI_FLAG_RADDR 0x20
+
+struct nd_opt_rd_hdr /* redirected header */
+ {
+ uint8_t nd_opt_rh_type;
+ uint8_t nd_opt_rh_len;
+ uint16_t nd_opt_rh_reserved1;
+ uint32_t nd_opt_rh_reserved2;
+ /* followed by IP header and data */
+ };
+
+struct nd_opt_mtu /* MTU option */
+ {
+ uint8_t nd_opt_mtu_type;
+ uint8_t nd_opt_mtu_len;
+ uint16_t nd_opt_mtu_reserved;
+ uint32_t nd_opt_mtu_mtu;
+ };
+
+struct mld_hdr
+ {
+ struct icmp6_hdr mld_icmp6_hdr;
+ struct in6_addr mld_addr; /* multicast address */
+ };
+
+#define mld_type mld_icmp6_hdr.icmp6_type
+#define mld_code mld_icmp6_hdr.icmp6_code
+#define mld_cksum mld_icmp6_hdr.icmp6_cksum
+#define mld_maxdelay mld_icmp6_hdr.icmp6_data16[0]
+#define mld_reserved mld_icmp6_hdr.icmp6_data16[1]
+
+#define ICMP6_ROUTER_RENUMBERING 138
+
+struct icmp6_router_renum /* router renumbering header */
+ {
+ struct icmp6_hdr rr_hdr;
+ uint8_t rr_segnum;
+ uint8_t rr_flags;
+ uint16_t rr_maxdelay;
+ uint32_t rr_reserved;
+ };
+
+#define rr_type rr_hdr.icmp6_type
+#define rr_code rr_hdr.icmp6_code
+#define rr_cksum rr_hdr.icmp6_cksum
+#define rr_seqnum rr_hdr.icmp6_data32[0]
+
+/* Router renumbering flags */
+#define ICMP6_RR_FLAGS_TEST 0x80
+#define ICMP6_RR_FLAGS_REQRESULT 0x40
+#define ICMP6_RR_FLAGS_FORCEAPPLY 0x20
+#define ICMP6_RR_FLAGS_SPECSITE 0x10
+#define ICMP6_RR_FLAGS_PREVDONE 0x08
+
+struct rr_pco_match /* match prefix part */
+ {
+ uint8_t rpm_code;
+ uint8_t rpm_len;
+ uint8_t rpm_ordinal;
+ uint8_t rpm_matchlen;
+ uint8_t rpm_minlen;
+ uint8_t rpm_maxlen;
+ uint16_t rpm_reserved;
+ struct in6_addr rpm_prefix;
+ };
+
+/* PCO code values */
+#define RPM_PCO_ADD 1
+#define RPM_PCO_CHANGE 2
+#define RPM_PCO_SETGLOBAL 3
+
+struct rr_pco_use /* use prefix part */
+ {
+ uint8_t rpu_uselen;
+ uint8_t rpu_keeplen;
+ uint8_t rpu_ramask;
+ uint8_t rpu_raflags;
+ uint32_t rpu_vltime;
+ uint32_t rpu_pltime;
+ uint32_t rpu_flags;
+ struct in6_addr rpu_prefix;
+ };
+
+#define ICMP6_RR_PCOUSE_RAFLAGS_ONLINK 0x20
+#define ICMP6_RR_PCOUSE_RAFLAGS_AUTO 0x10
+
+#if BYTE_ORDER == BIG_ENDIAN
+# define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80000000
+# define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40000000
+#elif BYTE_ORDER == LITTLE_ENDIAN
+# define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80
+# define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40
+#endif
+
+struct rr_result /* router renumbering result message */
+ {
+ uint16_t rrr_flags;
+ uint8_t rrr_ordinal;
+ uint8_t rrr_matchedlen;
+ uint32_t rrr_ifid;
+ struct in6_addr rrr_prefix;
+ };
+
+#if BYTE_ORDER == BIG_ENDIAN
+# define ICMP6_RR_RESULT_FLAGS_OOB 0x0002
+# define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0001
+#elif BYTE_ORDER == LITTLE_ENDIAN
+# define ICMP6_RR_RESULT_FLAGS_OOB 0x0200
+# define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0100
+#endif
+
+/* Mobile IPv6 extension: Advertisement Interval. */
+struct nd_opt_adv_interval
+ {
+ uint8_t nd_opt_adv_interval_type;
+ uint8_t nd_opt_adv_interval_len;
+ uint16_t nd_opt_adv_interval_reserved;
+ uint32_t nd_opt_adv_interval_ival;
+ };
+
+/* Mobile IPv6 extension: Home Agent Info. */
+struct nd_opt_home_agent_info
+ {
+ uint8_t nd_opt_home_agent_info_type;
+ uint8_t nd_opt_home_agent_info_len;
+ uint16_t nd_opt_home_agent_info_reserved;
+ int16_t nd_opt_home_agent_info_preference;
+ uint16_t nd_opt_home_agent_info_lifetime;
+ };
+
+#endif /* netinet/icmpv6.h */
diff --git a/sysroot/usr/include/netinet/if_ether.h b/sysroot/usr/include/netinet/if_ether.h
new file mode 100644
index 0000000..aadb59b
--- /dev/null
+++ b/sysroot/usr/include/netinet/if_ether.h
@@ -0,0 +1,105 @@
+/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef __NETINET_IF_ETHER_H
+
+#define __NETINET_IF_ETHER_H 1
+#include <features.h>
+#include <sys/types.h>
+
+/* Get definitions from kernel header file. */
+#include <linux/if_ether.h>
+
+#ifdef __USE_BSD
+/*
+ * Copyright (c) 1982, 1986, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)if_ether.h 8.3 (Berkeley) 5/2/95
+ * $FreeBSD$
+ */
+
+#include <net/ethernet.h>
+#include <net/if_arp.h>
+
+__BEGIN_DECLS
+/*
+ * Ethernet Address Resolution Protocol.
+ *
+ * See RFC 826 for protocol description. Structure below is adapted
+ * to resolving internet addresses. Field names used correspond to
+ * RFC 826.
+ */
+struct ether_arp {
+ struct arphdr ea_hdr; /* fixed-size header */
+ u_int8_t arp_sha[ETH_ALEN]; /* sender hardware address */
+ u_int8_t arp_spa[4]; /* sender protocol address */
+ u_int8_t arp_tha[ETH_ALEN]; /* target hardware address */
+ u_int8_t arp_tpa[4]; /* target protocol address */
+};
+#define arp_hrd ea_hdr.ar_hrd
+#define arp_pro ea_hdr.ar_pro
+#define arp_hln ea_hdr.ar_hln
+#define arp_pln ea_hdr.ar_pln
+#define arp_op ea_hdr.ar_op
+
+/*
+ * Macro to map an IP multicast address to an Ethernet multicast address.
+ * The high-order 25 bits of the Ethernet address are statically assigned,
+ * and the low-order 23 bits are taken from the low end of the IP address.
+ */
+#define ETHER_MAP_IP_MULTICAST(ipaddr, enaddr) \
+ /* struct in_addr *ipaddr; */ \
+ /* u_char enaddr[ETH_ALEN]; */ \
+{ \
+ (enaddr)[0] = 0x01; \
+ (enaddr)[1] = 0x00; \
+ (enaddr)[2] = 0x5e; \
+ (enaddr)[3] = ((u_int8_t *)ipaddr)[1] & 0x7f; \
+ (enaddr)[4] = ((u_int8_t *)ipaddr)[2]; \
+ (enaddr)[5] = ((u_int8_t *)ipaddr)[3]; \
+}
+
+__END_DECLS
+#endif /* __USE_BSD */
+
+#endif /* netinet/if_ether.h */
diff --git a/sysroot/usr/include/netinet/if_fddi.h b/sysroot/usr/include/netinet/if_fddi.h
new file mode 100644
index 0000000..c5d5f0a
--- /dev/null
+++ b/sysroot/usr/include/netinet/if_fddi.h
@@ -0,0 +1,38 @@
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _NETINET_IF_FDDI_H
+#define _NETINET_IF_FDDI_H 1
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <asm/types.h>
+
+#include <linux/types.h>
+#include <linux/if_fddi.h>
+
+#ifdef __USE_BSD
+
+struct fddi_header {
+ u_int8_t fddi_fc; /* Frame Control (FC) value */
+ u_int8_t fddi_dhost[FDDI_K_ALEN]; /* Destination host */
+ u_int8_t fddi_shost[FDDI_K_ALEN]; /* Source host */
+};
+#endif
+
+#endif /* netinet/if_fddi.h */
diff --git a/sysroot/usr/include/netinet/if_tr.h b/sysroot/usr/include/netinet/if_tr.h
new file mode 100644
index 0000000..45c3911
--- /dev/null
+++ b/sysroot/usr/include/netinet/if_tr.h
@@ -0,0 +1,111 @@
+/* Copyright (C) 1997, 2005 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _NETINET_IF_TR_H
+#define _NETINET_IF_TR_H 1
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+/* IEEE 802.5 Token-Ring magic constants. The frame sizes omit the preamble
+ and FCS/CRC (frame check sequence). */
+#define TR_ALEN 6 /* Octets in one token-ring addr */
+#define TR_HLEN (sizeof (struct trh_hdr) + sizeof (struct trllc))
+#define AC 0x10
+#define LLC_FRAME 0x40
+
+/* LLC and SNAP constants */
+#define EXTENDED_SAP 0xAA
+#define UI_CMD 0x03
+
+/* This is an Token-Ring frame header. */
+struct trh_hdr
+{
+ u_int8_t ac; /* access control field */
+ u_int8_t fc; /* frame control field */
+ u_int8_t daddr[TR_ALEN]; /* destination address */
+ u_int8_t saddr[TR_ALEN]; /* source address */
+ u_int16_t rcf; /* route control field */
+ u_int16_t rseg[8]; /* routing registers */
+};
+
+/* This is an Token-Ring LLC structure */
+struct trllc
+{
+ u_int8_t dsap; /* destination SAP */
+ u_int8_t ssap; /* source SAP */
+ u_int8_t llc; /* LLC control field */
+ u_int8_t protid[3]; /* protocol id */
+ u_int16_t ethertype; /* ether type field */
+};
+
+/* Token-Ring statistics collection data. */
+struct tr_statistics
+{
+ unsigned long rx_packets; /* total packets received */
+ unsigned long tx_packets; /* total packets transmitted */
+ unsigned long rx_bytes; /* total bytes received */
+ unsigned long tx_bytes; /* total bytes transmitted */
+ unsigned long rx_errors; /* bad packets received */
+ unsigned long tx_errors; /* packet transmit problems */
+ unsigned long rx_dropped; /* no space in linux buffers */
+ unsigned long tx_dropped; /* no space available in linux */
+ unsigned long multicast; /* multicast packets received */
+ unsigned long transmit_collision;
+
+ /* detailed Token-Ring errors. See IBM Token-Ring Network
+ Architecture for more info */
+
+ unsigned long line_errors;
+ unsigned long internal_errors;
+ unsigned long burst_errors;
+ unsigned long A_C_errors;
+ unsigned long abort_delimiters;
+ unsigned long lost_frames;
+ unsigned long recv_congest_count;
+ unsigned long frame_copied_errors;
+ unsigned long frequency_errors;
+ unsigned long token_errors;
+ unsigned long dummy1;
+};
+
+/* source routing stuff */
+#define TR_RII 0x80
+#define TR_RCF_DIR_BIT 0x80
+#define TR_RCF_LEN_MASK 0x1f00
+#define TR_RCF_BROADCAST 0x8000 /* all-routes broadcast */
+#define TR_RCF_LIMITED_BROADCAST 0xC000 /* single-route broadcast */
+#define TR_RCF_FRAME2K 0x20
+#define TR_RCF_BROADCAST_MASK 0xC000
+#define TR_MAXRIFLEN 18
+
+#ifdef __USE_BSD
+
+struct trn_hdr
+{
+ u_int8_t trn_ac; /* access control field */
+ u_int8_t trn_fc; /* field control field */
+ u_int8_t trn_dhost[TR_ALEN]; /* destination host */
+ u_int8_t trn_shost[TR_ALEN]; /* source host */
+ u_int16_t trn_rcf; /* route control field */
+ u_int16_t trn_rseg[8]; /* routing registers */
+};
+
+#endif
+
+#endif /* netinet/if_tr.h */
diff --git a/sysroot/usr/include/netinet/igmp.h b/sysroot/usr/include/netinet/igmp.h
new file mode 100644
index 0000000..67396ba
--- /dev/null
+++ b/sysroot/usr/include/netinet/igmp.h
@@ -0,0 +1,126 @@
+/* Copyright (C) 1997, 1999, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _NETINET_IGMP_H
+#define _NETINET_IGMP_H 1
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+#ifdef __USE_BSD
+
+#include <netinet/in.h>
+
+__BEGIN_DECLS
+
+/*
+ * Copyright (c) 1988 Stephen Deering.
+ * Copyright (c) 1992, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Stephen Deering of Stanford University.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)igmp.h 8.1 (Berkeley) 6/10/93
+ * $FreeBSD$
+ */
+
+struct igmp {
+ u_int8_t igmp_type; /* IGMP type */
+ u_int8_t igmp_code; /* routing code */
+ u_int16_t igmp_cksum; /* checksum */
+ struct in_addr igmp_group; /* group address */
+};
+
+#define IGMP_MINLEN 8
+
+/*
+ * Message types, including version number.
+ */
+#define IGMP_MEMBERSHIP_QUERY 0x11 /* membership query */
+#define IGMP_V1_MEMBERSHIP_REPORT 0x12 /* Ver. 1 membership report */
+#define IGMP_V2_MEMBERSHIP_REPORT 0x16 /* Ver. 2 membership report */
+#define IGMP_V2_LEAVE_GROUP 0x17 /* Leave-group message */
+
+#define IGMP_DVMRP 0x13 /* DVMRP routing message */
+#define IGMP_PIM 0x14 /* PIM routing message */
+#define IGMP_TRACE 0x15
+
+#define IGMP_MTRACE_RESP 0x1e /* traceroute resp.(to sender)*/
+#define IGMP_MTRACE 0x1f /* mcast traceroute messages */
+
+#define IGMP_MAX_HOST_REPORT_DELAY 10 /* max delay for response to */
+ /* query (in seconds) according */
+ /* to RFC1112 */
+#define IGMP_TIMER_SCALE 10 /* denotes that the igmp code field */
+ /* specifies time in 10th of seconds*/
+
+/*
+ * States for the IGMP v2 state table.
+ */
+#define IGMP_DELAYING_MEMBER 1
+#define IGMP_IDLE_MEMBER 2
+#define IGMP_LAZY_MEMBER 3
+#define IGMP_SLEEPING_MEMBER 4
+#define IGMP_AWAKENING_MEMBER 5
+
+/*
+ * States for IGMP router version cache.
+ */
+#define IGMP_v1_ROUTER 1
+#define IGMP_v2_ROUTER 2
+
+/*
+ * The following four defininitions are for backwards compatibility.
+ * They should be removed as soon as all applications are updated to
+ * use the new constant names.
+ */
+#define IGMP_HOST_MEMBERSHIP_QUERY IGMP_MEMBERSHIP_QUERY
+#define IGMP_HOST_MEMBERSHIP_REPORT IGMP_V1_MEMBERSHIP_REPORT
+#define IGMP_HOST_NEW_MEMBERSHIP_REPORT IGMP_V2_MEMBERSHIP_REPORT
+#define IGMP_HOST_LEAVE_MESSAGE IGMP_V2_LEAVE_GROUP
+
+__END_DECLS
+
+#endif
+
+#endif /* netinet/igmp.h */
diff --git a/sysroot/usr/include/netinet/in.h b/sysroot/usr/include/netinet/in.h
new file mode 100644
index 0000000..1366198
--- /dev/null
+++ b/sysroot/usr/include/netinet/in.h
@@ -0,0 +1,551 @@
+/* Copyright (C) 1991-2001, 2003, 2004, 2006, 2007
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _NETINET_IN_H
+#define _NETINET_IN_H 1
+
+#include <features.h>
+#include <stdint.h>
+#include <sys/socket.h>
+#include <bits/types.h>
+
+
+__BEGIN_DECLS
+
+/* Standard well-defined IP protocols. */
+enum
+ {
+ IPPROTO_IP = 0, /* Dummy protocol for TCP. */
+#define IPPROTO_IP IPPROTO_IP
+ IPPROTO_HOPOPTS = 0, /* IPv6 Hop-by-Hop options. */
+#define IPPROTO_HOPOPTS IPPROTO_HOPOPTS
+ IPPROTO_ICMP = 1, /* Internet Control Message Protocol. */
+#define IPPROTO_ICMP IPPROTO_ICMP
+ IPPROTO_IGMP = 2, /* Internet Group Management Protocol. */
+#define IPPROTO_IGMP IPPROTO_IGMP
+ IPPROTO_IPIP = 4, /* IPIP tunnels (older KA9Q tunnels use 94). */
+#define IPPROTO_IPIP IPPROTO_IPIP
+ IPPROTO_TCP = 6, /* Transmission Control Protocol. */
+#define IPPROTO_TCP IPPROTO_TCP
+ IPPROTO_EGP = 8, /* Exterior Gateway Protocol. */
+#define IPPROTO_EGP IPPROTO_EGP
+ IPPROTO_PUP = 12, /* PUP protocol. */
+#define IPPROTO_PUP IPPROTO_PUP
+ IPPROTO_UDP = 17, /* User Datagram Protocol. */
+#define IPPROTO_UDP IPPROTO_UDP
+ IPPROTO_IDP = 22, /* XNS IDP protocol. */
+#define IPPROTO_IDP IPPROTO_IDP
+ IPPROTO_TP = 29, /* SO Transport Protocol Class 4. */
+#define IPPROTO_TP IPPROTO_TP
+ IPPROTO_IPV6 = 41, /* IPv6 header. */
+#define IPPROTO_IPV6 IPPROTO_IPV6
+ IPPROTO_ROUTING = 43, /* IPv6 routing header. */
+#define IPPROTO_ROUTING IPPROTO_ROUTING
+ IPPROTO_FRAGMENT = 44, /* IPv6 fragmentation header. */
+#define IPPROTO_FRAGMENT IPPROTO_FRAGMENT
+ IPPROTO_RSVP = 46, /* Reservation Protocol. */
+#define IPPROTO_RSVP IPPROTO_RSVP
+ IPPROTO_GRE = 47, /* General Routing Encapsulation. */
+#define IPPROTO_GRE IPPROTO_GRE
+ IPPROTO_ESP = 50, /* encapsulating security payload. */
+#define IPPROTO_ESP IPPROTO_ESP
+ IPPROTO_AH = 51, /* authentication header. */
+#define IPPROTO_AH IPPROTO_AH
+ IPPROTO_ICMPV6 = 58, /* ICMPv6. */
+#define IPPROTO_ICMPV6 IPPROTO_ICMPV6
+ IPPROTO_NONE = 59, /* IPv6 no next header. */
+#define IPPROTO_NONE IPPROTO_NONE
+ IPPROTO_DSTOPTS = 60, /* IPv6 destination options. */
+#define IPPROTO_DSTOPTS IPPROTO_DSTOPTS
+ IPPROTO_MTP = 92, /* Multicast Transport Protocol. */
+#define IPPROTO_MTP IPPROTO_MTP
+ IPPROTO_ENCAP = 98, /* Encapsulation Header. */
+#define IPPROTO_ENCAP IPPROTO_ENCAP
+ IPPROTO_PIM = 103, /* Protocol Independent Multicast. */
+#define IPPROTO_PIM IPPROTO_PIM
+ IPPROTO_COMP = 108, /* Compression Header Protocol. */
+#define IPPROTO_COMP IPPROTO_COMP
+ IPPROTO_SCTP = 132, /* Stream Control Transmission Protocol. */
+#define IPPROTO_SCTP IPPROTO_SCTP
+ IPPROTO_RAW = 255, /* Raw IP packets. */
+#define IPPROTO_RAW IPPROTO_RAW
+ IPPROTO_MAX
+ };
+
+
+/* Type to represent a port. */
+typedef uint16_t in_port_t;
+
+/* Standard well-known ports. */
+enum
+ {
+ IPPORT_ECHO = 7, /* Echo service. */
+ IPPORT_DISCARD = 9, /* Discard transmissions service. */
+ IPPORT_SYSTAT = 11, /* System status service. */
+ IPPORT_DAYTIME = 13, /* Time of day service. */
+ IPPORT_NETSTAT = 15, /* Network status service. */
+ IPPORT_FTP = 21, /* File Transfer Protocol. */
+ IPPORT_TELNET = 23, /* Telnet protocol. */
+ IPPORT_SMTP = 25, /* Simple Mail Transfer Protocol. */
+ IPPORT_TIMESERVER = 37, /* Timeserver service. */
+ IPPORT_NAMESERVER = 42, /* Domain Name Service. */
+ IPPORT_WHOIS = 43, /* Internet Whois service. */
+ IPPORT_MTP = 57,
+
+ IPPORT_TFTP = 69, /* Trivial File Transfer Protocol. */
+ IPPORT_RJE = 77,
+ IPPORT_FINGER = 79, /* Finger service. */
+ IPPORT_TTYLINK = 87,
+ IPPORT_SUPDUP = 95, /* SUPDUP protocol. */
+
+
+ IPPORT_EXECSERVER = 512, /* execd service. */
+ IPPORT_LOGINSERVER = 513, /* rlogind service. */
+ IPPORT_CMDSERVER = 514,
+ IPPORT_EFSSERVER = 520,
+
+ /* UDP ports. */
+ IPPORT_BIFFUDP = 512,
+ IPPORT_WHOSERVER = 513,
+ IPPORT_ROUTESERVER = 520,
+
+ /* Ports less than this value are reserved for privileged processes. */
+ IPPORT_RESERVED = 1024,
+
+ /* Ports greater this value are reserved for (non-privileged) servers. */
+ IPPORT_USERRESERVED = 5000
+ };
+
+
+/* Internet address. */
+typedef uint32_t in_addr_t;
+struct in_addr
+ {
+ in_addr_t s_addr;
+ };
+
+
+/* Definitions of the bits in an Internet address integer.
+
+ On subnets, host and network parts are found according to
+ the subnet mask, not these masks. */
+
+#define IN_CLASSA(a) ((((in_addr_t)(a)) & 0x80000000) == 0)
+#define IN_CLASSA_NET 0xff000000
+#define IN_CLASSA_NSHIFT 24
+#define IN_CLASSA_HOST (0xffffffff & ~IN_CLASSA_NET)
+#define IN_CLASSA_MAX 128
+
+#define IN_CLASSB(a) ((((in_addr_t)(a)) & 0xc0000000) == 0x80000000)
+#define IN_CLASSB_NET 0xffff0000
+#define IN_CLASSB_NSHIFT 16
+#define IN_CLASSB_HOST (0xffffffff & ~IN_CLASSB_NET)
+#define IN_CLASSB_MAX 65536
+
+#define IN_CLASSC(a) ((((in_addr_t)(a)) & 0xe0000000) == 0xc0000000)
+#define IN_CLASSC_NET 0xffffff00
+#define IN_CLASSC_NSHIFT 8
+#define IN_CLASSC_HOST (0xffffffff & ~IN_CLASSC_NET)
+
+#define IN_CLASSD(a) ((((in_addr_t)(a)) & 0xf0000000) == 0xe0000000)
+#define IN_MULTICAST(a) IN_CLASSD(a)
+
+#define IN_EXPERIMENTAL(a) ((((in_addr_t)(a)) & 0xe0000000) == 0xe0000000)
+#define IN_BADCLASS(a) ((((in_addr_t)(a)) & 0xf0000000) == 0xf0000000)
+
+/* Address to accept any incoming messages. */
+#define INADDR_ANY ((in_addr_t) 0x00000000)
+/* Address to send to all hosts. */
+#define INADDR_BROADCAST ((in_addr_t) 0xffffffff)
+/* Address indicating an error return. */
+#define INADDR_NONE ((in_addr_t) 0xffffffff)
+
+/* Network number for local host loopback. */
+#define IN_LOOPBACKNET 127
+/* Address to loopback in software to local host. */
+#ifndef INADDR_LOOPBACK
+# define INADDR_LOOPBACK ((in_addr_t) 0x7f000001) /* Inet 127.0.0.1. */
+#endif
+
+/* Defines for Multicast INADDR. */
+#define INADDR_UNSPEC_GROUP ((in_addr_t) 0xe0000000) /* 224.0.0.0 */
+#define INADDR_ALLHOSTS_GROUP ((in_addr_t) 0xe0000001) /* 224.0.0.1 */
+#define INADDR_ALLRTRS_GROUP ((in_addr_t) 0xe0000002) /* 224.0.0.2 */
+#define INADDR_MAX_LOCAL_GROUP ((in_addr_t) 0xe00000ff) /* 224.0.0.255 */
+
+
+/* IPv6 address */
+struct in6_addr
+ {
+ union
+ {
+ uint8_t u6_addr8[16];
+ uint16_t u6_addr16[8];
+ uint32_t u6_addr32[4];
+ } in6_u;
+#define s6_addr in6_u.u6_addr8
+#define s6_addr16 in6_u.u6_addr16
+#define s6_addr32 in6_u.u6_addr32
+ };
+
+extern const struct in6_addr in6addr_any; /* :: */
+extern const struct in6_addr in6addr_loopback; /* ::1 */
+#define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }
+#define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } }
+
+#define INET_ADDRSTRLEN 16
+#define INET6_ADDRSTRLEN 46
+
+
+/* Structure describing an Internet socket address. */
+struct sockaddr_in
+ {
+ __SOCKADDR_COMMON (sin_);
+ in_port_t sin_port; /* Port number. */
+ struct in_addr sin_addr; /* Internet address. */
+
+ /* Pad to size of `struct sockaddr'. */
+ unsigned char sin_zero[sizeof (struct sockaddr) -
+ __SOCKADDR_COMMON_SIZE -
+ sizeof (in_port_t) -
+ sizeof (struct in_addr)];
+ };
+
+/* Ditto, for IPv6. */
+struct sockaddr_in6
+ {
+ __SOCKADDR_COMMON (sin6_);
+ in_port_t sin6_port; /* Transport layer port # */
+ uint32_t sin6_flowinfo; /* IPv6 flow information */
+ struct in6_addr sin6_addr; /* IPv6 address */
+ uint32_t sin6_scope_id; /* IPv6 scope-id */
+ };
+
+
+/* IPv4 multicast request. */
+struct ip_mreq
+ {
+ /* IP multicast address of group. */
+ struct in_addr imr_multiaddr;
+
+ /* Local IP address of interface. */
+ struct in_addr imr_interface;
+ };
+
+struct ip_mreq_source
+ {
+ /* IP multicast address of group. */
+ struct in_addr imr_multiaddr;
+
+ /* IP address of source. */
+ struct in_addr imr_interface;
+
+ /* IP address of interface. */
+ struct in_addr imr_sourceaddr;
+ };
+
+/* Likewise, for IPv6. */
+struct ipv6_mreq
+ {
+ /* IPv6 multicast address of group */
+ struct in6_addr ipv6mr_multiaddr;
+
+ /* local interface */
+ unsigned int ipv6mr_interface;
+ };
+
+
+/* Multicast group request. */
+struct group_req
+ {
+ /* Interface index. */
+ uint32_t gr_interface;
+
+ /* Group address. */
+ struct sockaddr_storage gr_group;
+ };
+
+struct group_source_req
+ {
+ /* Interface index. */
+ uint32_t gsr_interface;
+
+ /* Group address. */
+ struct sockaddr_storage gsr_group;
+
+ /* Source address. */
+ struct sockaddr_storage gsr_source;
+ };
+
+
+/* Full-state filter operations. */
+struct ip_msfilter
+ {
+ /* IP multicast address of group. */
+ struct in_addr imsf_multiaddr;
+
+ /* Local IP address of interface. */
+ struct in_addr imsf_interface;
+
+ /* Filter mode. */
+ uint32_t imsf_fmode;
+
+ /* Number of source addresses. */
+ uint32_t imsf_numsrc;
+ /* Source addresses. */
+ struct in_addr imsf_slist[1];
+ };
+
+#define IP_MSFILTER_SIZE(numsrc) (sizeof (struct ip_msfilter) \
+ - sizeof (struct in_addr) \
+ + (numsrc) * sizeof (struct in_addr))
+
+struct group_filter
+ {
+ /* Interface index. */
+ uint32_t gf_interface;
+
+ /* Group address. */
+ struct sockaddr_storage gf_group;
+
+ /* Filter mode. */
+ uint32_t gf_fmode;
+
+ /* Number of source addresses. */
+ uint32_t gf_numsrc;
+ /* Source addresses. */
+ struct sockaddr_storage gf_slist[1];
+};
+
+#define GROUP_FILTER_SIZE(numsrc) (sizeof (struct group_filter) \
+ - sizeof (struct sockaddr_storage) \
+ + ((numsrc) \
+ * sizeof (struct sockaddr_storage)))
+
+
+/* Get system-specific definitions. */
+#include <bits/in.h>
+
+/* Functions to convert between host and network byte order.
+
+ Please note that these functions normally take `unsigned long int' or
+ `unsigned short int' values as arguments and also return them. But
+ this was a short-sighted decision since on different systems the types
+ may have different representations but the values are always the same. */
+
+extern uint32_t ntohl (uint32_t __netlong) __THROW __attribute__ ((__const__));
+extern uint16_t ntohs (uint16_t __netshort)
+ __THROW __attribute__ ((__const__));
+extern uint32_t htonl (uint32_t __hostlong)
+ __THROW __attribute__ ((__const__));
+extern uint16_t htons (uint16_t __hostshort)
+ __THROW __attribute__ ((__const__));
+
+#include <endian.h>
+
+/* Get machine dependent optimized versions of byte swapping functions. */
+#include <bits/byteswap.h>
+
+#ifdef __OPTIMIZE__
+/* We can optimize calls to the conversion functions. Either nothing has
+ to be done or we are using directly the byte-swapping functions which
+ often can be inlined. */
+# if __BYTE_ORDER == __BIG_ENDIAN
+/* The host byte order is the same as network byte order,
+ so these functions are all just identity. */
+# define ntohl(x) (x)
+# define ntohs(x) (x)
+# define htonl(x) (x)
+# define htons(x) (x)
+# else
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+# define ntohl(x) __bswap_32 (x)
+# define ntohs(x) __bswap_16 (x)
+# define htonl(x) __bswap_32 (x)
+# define htons(x) __bswap_16 (x)
+# endif
+# endif
+#endif
+
+#define IN6_IS_ADDR_UNSPECIFIED(a) \
+ (((__const uint32_t *) (a))[0] == 0 \
+ && ((__const uint32_t *) (a))[1] == 0 \
+ && ((__const uint32_t *) (a))[2] == 0 \
+ && ((__const uint32_t *) (a))[3] == 0)
+
+#define IN6_IS_ADDR_LOOPBACK(a) \
+ (((__const uint32_t *) (a))[0] == 0 \
+ && ((__const uint32_t *) (a))[1] == 0 \
+ && ((__const uint32_t *) (a))[2] == 0 \
+ && ((__const uint32_t *) (a))[3] == htonl (1))
+
+#define IN6_IS_ADDR_MULTICAST(a) (((__const uint8_t *) (a))[0] == 0xff)
+
+#define IN6_IS_ADDR_LINKLOCAL(a) \
+ ((((__const uint32_t *) (a))[0] & htonl (0xffc00000)) \
+ == htonl (0xfe800000))
+
+#define IN6_IS_ADDR_SITELOCAL(a) \
+ ((((__const uint32_t *) (a))[0] & htonl (0xffc00000)) \
+ == htonl (0xfec00000))
+
+#define IN6_IS_ADDR_V4MAPPED(a) \
+ ((((__const uint32_t *) (a))[0] == 0) \
+ && (((__const uint32_t *) (a))[1] == 0) \
+ && (((__const uint32_t *) (a))[2] == htonl (0xffff)))
+
+#define IN6_IS_ADDR_V4COMPAT(a) \
+ ((((__const uint32_t *) (a))[0] == 0) \
+ && (((__const uint32_t *) (a))[1] == 0) \
+ && (((__const uint32_t *) (a))[2] == 0) \
+ && (ntohl (((__const uint32_t *) (a))[3]) > 1))
+
+#define IN6_ARE_ADDR_EQUAL(a,b) \
+ ((((__const uint32_t *) (a))[0] == ((__const uint32_t *) (b))[0]) \
+ && (((__const uint32_t *) (a))[1] == ((__const uint32_t *) (b))[1]) \
+ && (((__const uint32_t *) (a))[2] == ((__const uint32_t *) (b))[2]) \
+ && (((__const uint32_t *) (a))[3] == ((__const uint32_t *) (b))[3]))
+
+/* Bind socket to a privileged IP port. */
+extern int bindresvport (int __sockfd, struct sockaddr_in *__sock_in) __THROW;
+
+/* The IPv6 version of this function. */
+extern int bindresvport6 (int __sockfd, struct sockaddr_in6 *__sock_in)
+ __THROW;
+
+
+#define IN6_IS_ADDR_MC_NODELOCAL(a) \
+ (IN6_IS_ADDR_MULTICAST(a) \
+ && ((((__const uint8_t *) (a))[1] & 0xf) == 0x1))
+
+#define IN6_IS_ADDR_MC_LINKLOCAL(a) \
+ (IN6_IS_ADDR_MULTICAST(a) \
+ && ((((__const uint8_t *) (a))[1] & 0xf) == 0x2))
+
+#define IN6_IS_ADDR_MC_SITELOCAL(a) \
+ (IN6_IS_ADDR_MULTICAST(a) \
+ && ((((__const uint8_t *) (a))[1] & 0xf) == 0x5))
+
+#define IN6_IS_ADDR_MC_ORGLOCAL(a) \
+ (IN6_IS_ADDR_MULTICAST(a) \
+ && ((((__const uint8_t *) (a))[1] & 0xf) == 0x8))
+
+#define IN6_IS_ADDR_MC_GLOBAL(a) \
+ (IN6_IS_ADDR_MULTICAST(a) \
+ && ((((__const uint8_t *) (a))[1] & 0xf) == 0xe))
+
+/* IPv6 packet information. */
+struct in6_pktinfo
+ {
+ struct in6_addr ipi6_addr; /* src/dst IPv6 address */
+ unsigned int ipi6_ifindex; /* send/recv interface index */
+ };
+
+/* IPv6 MTU information. */
+struct ip6_mtuinfo
+ {
+ struct sockaddr_in6 ip6m_addr; /* dst address including zone ID */
+ uint32_t ip6m_mtu; /* path MTU in host byte order */
+ };
+
+
+#ifdef __USE_GNU
+/* Obsolete hop-by-hop and Destination Options Processing (RFC 2292). */
+extern int inet6_option_space (int __nbytes)
+ __THROW __attribute_deprecated__;
+extern int inet6_option_init (void *__bp, struct cmsghdr **__cmsgp,
+ int __type) __THROW __attribute_deprecated__;
+extern int inet6_option_append (struct cmsghdr *__cmsg,
+ __const uint8_t *__typep, int __multx,
+ int __plusy) __THROW __attribute_deprecated__;
+extern uint8_t *inet6_option_alloc (struct cmsghdr *__cmsg, int __datalen,
+ int __multx, int __plusy)
+ __THROW __attribute_deprecated__;
+extern int inet6_option_next (__const struct cmsghdr *__cmsg,
+ uint8_t **__tptrp)
+ __THROW __attribute_deprecated__;
+extern int inet6_option_find (__const struct cmsghdr *__cmsg,
+ uint8_t **__tptrp, int __type)
+ __THROW __attribute_deprecated__;
+
+
+/* Hop-by-Hop and Destination Options Processing (RFC 3542). */
+extern int inet6_opt_init (void *__extbuf, socklen_t __extlen) __THROW;
+extern int inet6_opt_append (void *__extbuf, socklen_t __extlen, int __offset,
+ uint8_t __type, socklen_t __len, uint8_t __align,
+ void **__databufp) __THROW;
+extern int inet6_opt_finish (void *__extbuf, socklen_t __extlen, int __offset)
+ __THROW;
+extern int inet6_opt_set_val (void *__databuf, int __offset, void *__val,
+ socklen_t __vallen) __THROW;
+extern int inet6_opt_next (void *__extbuf, socklen_t __extlen, int __offset,
+ uint8_t *__typep, socklen_t *__lenp,
+ void **__databufp) __THROW;
+extern int inet6_opt_find (void *__extbuf, socklen_t __extlen, int __offset,
+ uint8_t __type, socklen_t *__lenp,
+ void **__databufp) __THROW;
+extern int inet6_opt_get_val (void *__databuf, int __offset, void *__val,
+ socklen_t __vallen) __THROW;
+
+
+/* Routing Header Option (RFC 3542). */
+extern socklen_t inet6_rth_space (int __type, int __segments) __THROW;
+extern void *inet6_rth_init (void *__bp, socklen_t __bp_len, int __type,
+ int __segments) __THROW;
+extern int inet6_rth_add (void *__bp, __const struct in6_addr *__addr) __THROW;
+extern int inet6_rth_reverse (__const void *__in, void *__out) __THROW;
+extern int inet6_rth_segments (__const void *__bp) __THROW;
+extern struct in6_addr *inet6_rth_getaddr (__const void *__bp, int __index)
+ __THROW;
+
+
+/* Multicast source filter support. */
+
+/* Get IPv4 source filter. */
+extern int getipv4sourcefilter (int __s, struct in_addr __interface_addr,
+ struct in_addr __group, uint32_t *__fmode,
+ uint32_t *__numsrc, struct in_addr *__slist)
+ __THROW;
+
+/* Set IPv4 source filter. */
+extern int setipv4sourcefilter (int __s, struct in_addr __interface_addr,
+ struct in_addr __group, uint32_t __fmode,
+ uint32_t __numsrc,
+ __const struct in_addr *__slist)
+ __THROW;
+
+
+/* Get source filter. */
+extern int getsourcefilter (int __s, uint32_t __interface_addr,
+ __const struct sockaddr *__group,
+ socklen_t __grouplen, uint32_t *__fmode,
+ uint32_t *__numsrc,
+ struct sockaddr_storage *__slist) __THROW;
+
+/* Set source filter. */
+extern int setsourcefilter (int __s, uint32_t __interface_addr,
+ __const struct sockaddr *__group,
+ socklen_t __grouplen, uint32_t __fmode,
+ uint32_t __numsrc,
+ __const struct sockaddr_storage *__slist) __THROW;
+#endif /* use GNU */
+
+__END_DECLS
+
+#endif /* netinet/in.h */
diff --git a/sysroot/usr/include/netinet/in_systm.h b/sysroot/usr/include/netinet/in_systm.h
new file mode 100644
index 0000000..51a08e1
--- /dev/null
+++ b/sysroot/usr/include/netinet/in_systm.h
@@ -0,0 +1,41 @@
+/* System specific type definitions for networking code.
+ Copyright (C) 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _NETINET_IN_SYSTM_H
+#define _NETINET_IN_SYSTM_H 1
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+__BEGIN_DECLS
+
+/*
+ * Network order versions of various data types. Unfortunately, BSD
+ * assumes specific sizes for shorts (16 bit) and longs (32 bit) which
+ * don't hold in general. As a consequence, the network order versions
+ * may not reflect the actual size of the native data types.
+ */
+
+typedef u_int16_t n_short; /* short as received from the net */
+typedef u_int32_t n_long; /* long as received from the net */
+typedef u_int32_t n_time; /* ms since 00:00 GMT, byte rev */
+
+__END_DECLS
+
+#endif /* netinet/in_systm.h */
diff --git a/sysroot/usr/include/netinet/ip.h b/sysroot/usr/include/netinet/ip.h
new file mode 100644
index 0000000..fc91440
--- /dev/null
+++ b/sysroot/usr/include/netinet/ip.h
@@ -0,0 +1,249 @@
+/* Copyright (C) 1991,92,93,95,96,97,98,99,2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef __NETINET_IP_H
+#define __NETINET_IP_H 1
+
+#include <features.h>
+#include <sys/types.h>
+
+#include <netinet/in.h>
+
+__BEGIN_DECLS
+
+struct timestamp
+ {
+ u_int8_t len;
+ u_int8_t ptr;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+ unsigned int flags:4;
+ unsigned int overflow:4;
+#elif __BYTE_ORDER == __BIG_ENDIAN
+ unsigned int overflow:4;
+ unsigned int flags:4;
+#else
+# error "Please fix <bits/endian.h>"
+#endif
+ u_int32_t data[9];
+ };
+
+struct iphdr
+ {
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+ unsigned int ihl:4;
+ unsigned int version:4;
+#elif __BYTE_ORDER == __BIG_ENDIAN
+ unsigned int version:4;
+ unsigned int ihl:4;
+#else
+# error "Please fix <bits/endian.h>"
+#endif
+ u_int8_t tos;
+ u_int16_t tot_len;
+ u_int16_t id;
+ u_int16_t frag_off;
+ u_int8_t ttl;
+ u_int8_t protocol;
+ u_int16_t check;
+ u_int32_t saddr;
+ u_int32_t daddr;
+ /*The options start here. */
+ };
+
+#ifdef __USE_BSD
+/*
+ * Copyright (c) 1982, 1986, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)ip.h 8.1 (Berkeley) 6/10/93
+ */
+
+/*
+ * Definitions for internet protocol version 4.
+ * Per RFC 791, September 1981.
+ */
+
+/*
+ * Structure of an internet header, naked of options.
+ */
+struct ip
+ {
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+ unsigned int ip_hl:4; /* header length */
+ unsigned int ip_v:4; /* version */
+#endif
+#if __BYTE_ORDER == __BIG_ENDIAN
+ unsigned int ip_v:4; /* version */
+ unsigned int ip_hl:4; /* header length */
+#endif
+ u_int8_t ip_tos; /* type of service */
+ u_short ip_len; /* total length */
+ u_short ip_id; /* identification */
+ u_short ip_off; /* fragment offset field */
+#define IP_RF 0x8000 /* reserved fragment flag */
+#define IP_DF 0x4000 /* dont fragment flag */
+#define IP_MF 0x2000 /* more fragments flag */
+#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */
+ u_int8_t ip_ttl; /* time to live */
+ u_int8_t ip_p; /* protocol */
+ u_short ip_sum; /* checksum */
+ struct in_addr ip_src, ip_dst; /* source and dest address */
+ };
+
+/*
+ * Time stamp option structure.
+ */
+struct ip_timestamp
+ {
+ u_int8_t ipt_code; /* IPOPT_TS */
+ u_int8_t ipt_len; /* size of structure (variable) */
+ u_int8_t ipt_ptr; /* index of current entry */
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+ unsigned int ipt_flg:4; /* flags, see below */
+ unsigned int ipt_oflw:4; /* overflow counter */
+#endif
+#if __BYTE_ORDER == __BIG_ENDIAN
+ unsigned int ipt_oflw:4; /* overflow counter */
+ unsigned int ipt_flg:4; /* flags, see below */
+#endif
+ u_int32_t data[9];
+ };
+#endif /* __USE_BSD */
+
+#define IPVERSION 4 /* IP version number */
+#define IP_MAXPACKET 65535 /* maximum packet size */
+
+/*
+ * Definitions for IP type of service (ip_tos)
+ */
+#define IPTOS_TOS_MASK 0x1E
+#define IPTOS_TOS(tos) ((tos) & IPTOS_TOS_MASK)
+#define IPTOS_LOWDELAY 0x10
+#define IPTOS_THROUGHPUT 0x08
+#define IPTOS_RELIABILITY 0x04
+#define IPTOS_LOWCOST 0x02
+#define IPTOS_MINCOST IPTOS_LOWCOST
+
+/*
+ * Definitions for IP precedence (also in ip_tos) (hopefully unused)
+ */
+#define IPTOS_PREC_MASK 0xe0
+#define IPTOS_PREC(tos) ((tos) & IPTOS_PREC_MASK)
+#define IPTOS_PREC_NETCONTROL 0xe0
+#define IPTOS_PREC_INTERNETCONTROL 0xc0
+#define IPTOS_PREC_CRITIC_ECP 0xa0
+#define IPTOS_PREC_FLASHOVERRIDE 0x80
+#define IPTOS_PREC_FLASH 0x60
+#define IPTOS_PREC_IMMEDIATE 0x40
+#define IPTOS_PREC_PRIORITY 0x20
+#define IPTOS_PREC_ROUTINE 0x00
+
+/*
+ * Definitions for options.
+ */
+#define IPOPT_COPY 0x80
+#define IPOPT_CLASS_MASK 0x60
+#define IPOPT_NUMBER_MASK 0x1f
+
+#define IPOPT_COPIED(o) ((o) & IPOPT_COPY)
+#define IPOPT_CLASS(o) ((o) & IPOPT_CLASS_MASK)
+#define IPOPT_NUMBER(o) ((o) & IPOPT_NUMBER_MASK)
+
+#define IPOPT_CONTROL 0x00
+#define IPOPT_RESERVED1 0x20
+#define IPOPT_DEBMEAS 0x40
+#define IPOPT_MEASUREMENT IPOPT_DEBMEAS
+#define IPOPT_RESERVED2 0x60
+
+#define IPOPT_EOL 0 /* end of option list */
+#define IPOPT_END IPOPT_EOL
+#define IPOPT_NOP 1 /* no operation */
+#define IPOPT_NOOP IPOPT_NOP
+
+#define IPOPT_RR 7 /* record packet route */
+#define IPOPT_TS 68 /* timestamp */
+#define IPOPT_TIMESTAMP IPOPT_TS
+#define IPOPT_SECURITY 130 /* provide s,c,h,tcc */
+#define IPOPT_SEC IPOPT_SECURITY
+#define IPOPT_LSRR 131 /* loose source route */
+#define IPOPT_SATID 136 /* satnet id */
+#define IPOPT_SID IPOPT_SATID
+#define IPOPT_SSRR 137 /* strict source route */
+#define IPOPT_RA 148 /* router alert */
+
+/*
+ * Offsets to fields in options other than EOL and NOP.
+ */
+#define IPOPT_OPTVAL 0 /* option ID */
+#define IPOPT_OLEN 1 /* option length */
+#define IPOPT_OFFSET 2 /* offset within option */
+#define IPOPT_MINOFF 4 /* min value of above */
+
+#define MAX_IPOPTLEN 40
+
+/* flag bits for ipt_flg */
+#define IPOPT_TS_TSONLY 0 /* timestamps only */
+#define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */
+#define IPOPT_TS_PRESPEC 3 /* specified modules only */
+
+/* bits for security (not byte swapped) */
+#define IPOPT_SECUR_UNCLASS 0x0000
+#define IPOPT_SECUR_CONFID 0xf135
+#define IPOPT_SECUR_EFTO 0x789a
+#define IPOPT_SECUR_MMMM 0xbc4d
+#define IPOPT_SECUR_RESTR 0xaf13
+#define IPOPT_SECUR_SECRET 0xd788
+#define IPOPT_SECUR_TOPSECRET 0x6bc5
+
+/*
+ * Internet implementation parameters.
+ */
+#define MAXTTL 255 /* maximum time to live (seconds) */
+#define IPDEFTTL 64 /* default ttl, from RFC 1340 */
+#define IPFRAGTTL 60 /* time to live for frags, slowhz */
+#define IPTTLDEC 1 /* subtracted when forwarding */
+
+#define IP_MSS 576 /* default maximum segment size */
+
+__END_DECLS
+
+#endif /* netinet/ip.h */
diff --git a/sysroot/usr/include/netinet/ip6.h b/sysroot/usr/include/netinet/ip6.h
new file mode 100644
index 0000000..bef2af2
--- /dev/null
+++ b/sysroot/usr/include/netinet/ip6.h
@@ -0,0 +1,189 @@
+/* Copyright (C) 1991-1997, 2001, 2003, 2006 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _NETINET_IP6_H
+#define _NETINET_IP6_H 1
+
+#include <inttypes.h>
+#include <netinet/in.h>
+
+struct ip6_hdr
+ {
+ union
+ {
+ struct ip6_hdrctl
+ {
+ uint32_t ip6_un1_flow; /* 4 bits version, 8 bits TC,
+ 20 bits flow-ID */
+ uint16_t ip6_un1_plen; /* payload length */
+ uint8_t ip6_un1_nxt; /* next header */
+ uint8_t ip6_un1_hlim; /* hop limit */
+ } ip6_un1;
+ uint8_t ip6_un2_vfc; /* 4 bits version, top 4 bits tclass */
+ } ip6_ctlun;
+ struct in6_addr ip6_src; /* source address */
+ struct in6_addr ip6_dst; /* destination address */
+ };
+
+#define ip6_vfc ip6_ctlun.ip6_un2_vfc
+#define ip6_flow ip6_ctlun.ip6_un1.ip6_un1_flow
+#define ip6_plen ip6_ctlun.ip6_un1.ip6_un1_plen
+#define ip6_nxt ip6_ctlun.ip6_un1.ip6_un1_nxt
+#define ip6_hlim ip6_ctlun.ip6_un1.ip6_un1_hlim
+#define ip6_hops ip6_ctlun.ip6_un1.ip6_un1_hlim
+
+/* Generic extension header. */
+struct ip6_ext
+ {
+ uint8_t ip6e_nxt; /* next header. */
+ uint8_t ip6e_len; /* length in units of 8 octets. */
+ };
+
+/* Hop-by-Hop options header. */
+struct ip6_hbh
+ {
+ uint8_t ip6h_nxt; /* next header. */
+ uint8_t ip6h_len; /* length in units of 8 octets. */
+ /* followed by options */
+ };
+
+/* Destination options header */
+struct ip6_dest
+ {
+ uint8_t ip6d_nxt; /* next header */
+ uint8_t ip6d_len; /* length in units of 8 octets */
+ /* followed by options */
+ };
+
+/* Routing header */
+struct ip6_rthdr
+ {
+ uint8_t ip6r_nxt; /* next header */
+ uint8_t ip6r_len; /* length in units of 8 octets */
+ uint8_t ip6r_type; /* routing type */
+ uint8_t ip6r_segleft; /* segments left */
+ /* followed by routing type specific data */
+ };
+
+/* Type 0 Routing header */
+struct ip6_rthdr0
+ {
+ uint8_t ip6r0_nxt; /* next header */
+ uint8_t ip6r0_len; /* length in units of 8 octets */
+ uint8_t ip6r0_type; /* always zero */
+ uint8_t ip6r0_segleft; /* segments left */
+ uint8_t ip6r0_reserved; /* reserved field */
+ uint8_t ip6r0_slmap[3]; /* strict/loose bit map */
+ /* followed by up to 127 struct in6_addr */
+ struct in6_addr ip6r0_addr[0];
+ };
+
+/* Fragment header */
+struct ip6_frag
+ {
+ uint8_t ip6f_nxt; /* next header */
+ uint8_t ip6f_reserved; /* reserved field */
+ uint16_t ip6f_offlg; /* offset, reserved, and flag */
+ uint32_t ip6f_ident; /* identification */
+ };
+
+#if BYTE_ORDER == BIG_ENDIAN
+# define IP6F_OFF_MASK 0xfff8 /* mask out offset from _offlg */
+# define IP6F_RESERVED_MASK 0x0006 /* reserved bits in ip6f_offlg */
+# define IP6F_MORE_FRAG 0x0001 /* more-fragments flag */
+#else /* BYTE_ORDER == LITTLE_ENDIAN */
+# define IP6F_OFF_MASK 0xf8ff /* mask out offset from _offlg */
+# define IP6F_RESERVED_MASK 0x0600 /* reserved bits in ip6f_offlg */
+# define IP6F_MORE_FRAG 0x0100 /* more-fragments flag */
+#endif
+
+/* IPv6 options */
+struct ip6_opt
+ {
+ uint8_t ip6o_type;
+ uint8_t ip6o_len;
+ };
+
+/* The high-order 3 bits of the option type define the behavior
+ * when processing an unknown option and whether or not the option
+ * content changes in flight.
+ */
+#define IP6OPT_TYPE(o) ((o) & 0xc0)
+#define IP6OPT_TYPE_SKIP 0x00
+#define IP6OPT_TYPE_DISCARD 0x40
+#define IP6OPT_TYPE_FORCEICMP 0x80
+#define IP6OPT_TYPE_ICMP 0xc0
+#define IP6OPT_TYPE_MUTABLE 0x20
+
+/* Special option types for padding. */
+#define IP6OPT_PAD1 0
+#define IP6OPT_PADN 1
+
+#define IP6OPT_JUMBO 0xc2
+#define IP6OPT_NSAP_ADDR 0xc3
+#define IP6OPT_TUNNEL_LIMIT 0x04
+#define IP6OPT_ROUTER_ALERT 0x05
+
+/* Jumbo Payload Option */
+struct ip6_opt_jumbo
+ {
+ uint8_t ip6oj_type;
+ uint8_t ip6oj_len;
+ uint8_t ip6oj_jumbo_len[4];
+ };
+#define IP6OPT_JUMBO_LEN 6
+
+/* NSAP Address Option */
+struct ip6_opt_nsap
+ {
+ uint8_t ip6on_type;
+ uint8_t ip6on_len;
+ uint8_t ip6on_src_nsap_len;
+ uint8_t ip6on_dst_nsap_len;
+ /* followed by source NSAP */
+ /* followed by destination NSAP */
+ };
+
+/* Tunnel Limit Option */
+struct ip6_opt_tunnel
+ {
+ uint8_t ip6ot_type;
+ uint8_t ip6ot_len;
+ uint8_t ip6ot_encap_limit;
+ };
+
+/* Router Alert Option */
+struct ip6_opt_router
+ {
+ uint8_t ip6or_type;
+ uint8_t ip6or_len;
+ uint8_t ip6or_value[2];
+ };
+
+/* Router alert values (in network byte order) */
+#if BYTE_ORDER == BIG_ENDIAN
+# define IP6_ALERT_MLD 0x0000
+# define IP6_ALERT_RSVP 0x0001
+# define IP6_ALERT_AN 0x0002
+#else /* BYTE_ORDER == LITTLE_ENDING */
+# define IP6_ALERT_MLD 0x0000
+# define IP6_ALERT_RSVP 0x0100
+# define IP6_ALERT_AN 0x0200
+#endif
+
+#endif /* netinet/ip6.h */
diff --git a/sysroot/usr/include/netinet/ip_icmp.h b/sysroot/usr/include/netinet/ip_icmp.h
new file mode 100644
index 0000000..2fc8e9c
--- /dev/null
+++ b/sysroot/usr/include/netinet/ip_icmp.h
@@ -0,0 +1,283 @@
+/* Copyright (C) 1991, 92, 93, 95, 96, 97, 99 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef __NETINET_IP_ICMP_H
+#define __NETINET_IP_ICMP_H 1
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+__BEGIN_DECLS
+
+struct icmphdr
+{
+ u_int8_t type; /* message type */
+ u_int8_t code; /* type sub-code */
+ u_int16_t checksum;
+ union
+ {
+ struct
+ {
+ u_int16_t id;
+ u_int16_t sequence;
+ } echo; /* echo datagram */
+ u_int32_t gateway; /* gateway address */
+ struct
+ {
+ u_int16_t __unused;
+ u_int16_t mtu;
+ } frag; /* path mtu discovery */
+ } un;
+};
+
+#define ICMP_ECHOREPLY 0 /* Echo Reply */
+#define ICMP_DEST_UNREACH 3 /* Destination Unreachable */
+#define ICMP_SOURCE_QUENCH 4 /* Source Quench */
+#define ICMP_REDIRECT 5 /* Redirect (change route) */
+#define ICMP_ECHO 8 /* Echo Request */
+#define ICMP_TIME_EXCEEDED 11 /* Time Exceeded */
+#define ICMP_PARAMETERPROB 12 /* Parameter Problem */
+#define ICMP_TIMESTAMP 13 /* Timestamp Request */
+#define ICMP_TIMESTAMPREPLY 14 /* Timestamp Reply */
+#define ICMP_INFO_REQUEST 15 /* Information Request */
+#define ICMP_INFO_REPLY 16 /* Information Reply */
+#define ICMP_ADDRESS 17 /* Address Mask Request */
+#define ICMP_ADDRESSREPLY 18 /* Address Mask Reply */
+#define NR_ICMP_TYPES 18
+
+
+/* Codes for UNREACH. */
+#define ICMP_NET_UNREACH 0 /* Network Unreachable */
+#define ICMP_HOST_UNREACH 1 /* Host Unreachable */
+#define ICMP_PROT_UNREACH 2 /* Protocol Unreachable */
+#define ICMP_PORT_UNREACH 3 /* Port Unreachable */
+#define ICMP_FRAG_NEEDED 4 /* Fragmentation Needed/DF set */
+#define ICMP_SR_FAILED 5 /* Source Route failed */
+#define ICMP_NET_UNKNOWN 6
+#define ICMP_HOST_UNKNOWN 7
+#define ICMP_HOST_ISOLATED 8
+#define ICMP_NET_ANO 9
+#define ICMP_HOST_ANO 10
+#define ICMP_NET_UNR_TOS 11
+#define ICMP_HOST_UNR_TOS 12
+#define ICMP_PKT_FILTERED 13 /* Packet filtered */
+#define ICMP_PREC_VIOLATION 14 /* Precedence violation */
+#define ICMP_PREC_CUTOFF 15 /* Precedence cut off */
+#define NR_ICMP_UNREACH 15 /* instead of hardcoding immediate value */
+
+/* Codes for REDIRECT. */
+#define ICMP_REDIR_NET 0 /* Redirect Net */
+#define ICMP_REDIR_HOST 1 /* Redirect Host */
+#define ICMP_REDIR_NETTOS 2 /* Redirect Net for TOS */
+#define ICMP_REDIR_HOSTTOS 3 /* Redirect Host for TOS */
+
+/* Codes for TIME_EXCEEDED. */
+#define ICMP_EXC_TTL 0 /* TTL count exceeded */
+#define ICMP_EXC_FRAGTIME 1 /* Fragment Reass time exceeded */
+
+
+#ifdef __USE_BSD
+/*
+ * Copyright (c) 1982, 1986, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)ip_icmp.h 8.1 (Berkeley) 6/10/93
+ */
+
+#include <netinet/in.h>
+#include <netinet/ip.h>
+
+/*
+ * Internal of an ICMP Router Advertisement
+ */
+struct icmp_ra_addr
+{
+ u_int32_t ira_addr;
+ u_int32_t ira_preference;
+};
+
+struct icmp
+{
+ u_int8_t icmp_type; /* type of message, see below */
+ u_int8_t icmp_code; /* type sub code */
+ u_int16_t icmp_cksum; /* ones complement checksum of struct */
+ union
+ {
+ u_char ih_pptr; /* ICMP_PARAMPROB */
+ struct in_addr ih_gwaddr; /* gateway address */
+ struct ih_idseq /* echo datagram */
+ {
+ u_int16_t icd_id;
+ u_int16_t icd_seq;
+ } ih_idseq;
+ u_int32_t ih_void;
+
+ /* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */
+ struct ih_pmtu
+ {
+ u_int16_t ipm_void;
+ u_int16_t ipm_nextmtu;
+ } ih_pmtu;
+
+ struct ih_rtradv
+ {
+ u_int8_t irt_num_addrs;
+ u_int8_t irt_wpa;
+ u_int16_t irt_lifetime;
+ } ih_rtradv;
+ } icmp_hun;
+#define icmp_pptr icmp_hun.ih_pptr
+#define icmp_gwaddr icmp_hun.ih_gwaddr
+#define icmp_id icmp_hun.ih_idseq.icd_id
+#define icmp_seq icmp_hun.ih_idseq.icd_seq
+#define icmp_void icmp_hun.ih_void
+#define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void
+#define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu
+#define icmp_num_addrs icmp_hun.ih_rtradv.irt_num_addrs
+#define icmp_wpa icmp_hun.ih_rtradv.irt_wpa
+#define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime
+ union
+ {
+ struct
+ {
+ u_int32_t its_otime;
+ u_int32_t its_rtime;
+ u_int32_t its_ttime;
+ } id_ts;
+ struct
+ {
+ struct ip idi_ip;
+ /* options and then 64 bits of data */
+ } id_ip;
+ struct icmp_ra_addr id_radv;
+ u_int32_t id_mask;
+ u_int8_t id_data[1];
+ } icmp_dun;
+#define icmp_otime icmp_dun.id_ts.its_otime
+#define icmp_rtime icmp_dun.id_ts.its_rtime
+#define icmp_ttime icmp_dun.id_ts.its_ttime
+#define icmp_ip icmp_dun.id_ip.idi_ip
+#define icmp_radv icmp_dun.id_radv
+#define icmp_mask icmp_dun.id_mask
+#define icmp_data icmp_dun.id_data
+};
+
+/*
+ * Lower bounds on packet lengths for various types.
+ * For the error advice packets must first insure that the
+ * packet is large enough to contain the returned ip header.
+ * Only then can we do the check to see if 64 bits of packet
+ * data have been returned, since we need to check the returned
+ * ip header length.
+ */
+#define ICMP_MINLEN 8 /* abs minimum */
+#define ICMP_TSLEN (8 + 3 * sizeof (n_time)) /* timestamp */
+#define ICMP_MASKLEN 12 /* address mask */
+#define ICMP_ADVLENMIN (8 + sizeof (struct ip) + 8) /* min */
+#ifndef _IP_VHL
+#define ICMP_ADVLEN(p) (8 + ((p)->icmp_ip.ip_hl << 2) + 8)
+ /* N.B.: must separately check that ip_hl >= 5 */
+#else
+#define ICMP_ADVLEN(p) (8 + (IP_VHL_HL((p)->icmp_ip.ip_vhl) << 2) + 8)
+ /* N.B.: must separately check that header length >= 5 */
+#endif
+
+/* Definition of type and code fields. */
+/* defined above: ICMP_ECHOREPLY, ICMP_REDIRECT, ICMP_ECHO */
+#define ICMP_UNREACH 3 /* dest unreachable, codes: */
+#define ICMP_SOURCEQUENCH 4 /* packet lost, slow down */
+#define ICMP_ROUTERADVERT 9 /* router advertisement */
+#define ICMP_ROUTERSOLICIT 10 /* router solicitation */
+#define ICMP_TIMXCEED 11 /* time exceeded, code: */
+#define ICMP_PARAMPROB 12 /* ip header bad */
+#define ICMP_TSTAMP 13 /* timestamp request */
+#define ICMP_TSTAMPREPLY 14 /* timestamp reply */
+#define ICMP_IREQ 15 /* information request */
+#define ICMP_IREQREPLY 16 /* information reply */
+#define ICMP_MASKREQ 17 /* address mask request */
+#define ICMP_MASKREPLY 18 /* address mask reply */
+
+#define ICMP_MAXTYPE 18
+
+/* UNREACH codes */
+#define ICMP_UNREACH_NET 0 /* bad net */
+#define ICMP_UNREACH_HOST 1 /* bad host */
+#define ICMP_UNREACH_PROTOCOL 2 /* bad protocol */
+#define ICMP_UNREACH_PORT 3 /* bad port */
+#define ICMP_UNREACH_NEEDFRAG 4 /* IP_DF caused drop */
+#define ICMP_UNREACH_SRCFAIL 5 /* src route failed */
+#define ICMP_UNREACH_NET_UNKNOWN 6 /* unknown net */
+#define ICMP_UNREACH_HOST_UNKNOWN 7 /* unknown host */
+#define ICMP_UNREACH_ISOLATED 8 /* src host isolated */
+#define ICMP_UNREACH_NET_PROHIB 9 /* net denied */
+#define ICMP_UNREACH_HOST_PROHIB 10 /* host denied */
+#define ICMP_UNREACH_TOSNET 11 /* bad tos for net */
+#define ICMP_UNREACH_TOSHOST 12 /* bad tos for host */
+#define ICMP_UNREACH_FILTER_PROHIB 13 /* admin prohib */
+#define ICMP_UNREACH_HOST_PRECEDENCE 14 /* host prec vio. */
+#define ICMP_UNREACH_PRECEDENCE_CUTOFF 15 /* prec cutoff */
+
+/* REDIRECT codes */
+#define ICMP_REDIRECT_NET 0 /* for network */
+#define ICMP_REDIRECT_HOST 1 /* for host */
+#define ICMP_REDIRECT_TOSNET 2 /* for tos and net */
+#define ICMP_REDIRECT_TOSHOST 3 /* for tos and host */
+
+/* TIMEXCEED codes */
+#define ICMP_TIMXCEED_INTRANS 0 /* ttl==0 in transit */
+#define ICMP_TIMXCEED_REASS 1 /* ttl==0 in reass */
+
+/* PARAMPROB code */
+#define ICMP_PARAMPROB_OPTABSENT 1 /* req. opt. absent */
+
+#define ICMP_INFOTYPE(type) \
+ ((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \
+ (type) == ICMP_ROUTERADVERT || (type) == ICMP_ROUTERSOLICIT || \
+ (type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || \
+ (type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \
+ (type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY)
+
+#endif /* __USE_BSD */
+
+__END_DECLS
+
+#endif /* netinet/ip_icmp.h */
diff --git a/sysroot/usr/include/netinet/tcp.h b/sysroot/usr/include/netinet/tcp.h
new file mode 100644
index 0000000..06e8414
--- /dev/null
+++ b/sysroot/usr/include/netinet/tcp.h
@@ -0,0 +1,246 @@
+/*
+ * Copyright (c) 1982, 1986, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)tcp.h 8.1 (Berkeley) 6/10/93
+ */
+
+#ifndef _NETINET_TCP_H
+#define _NETINET_TCP_H 1
+
+#include <features.h>
+
+/*
+ * User-settable options (used with setsockopt).
+ */
+#define TCP_NODELAY 1 /* Don't delay send to coalesce packets */
+#define TCP_MAXSEG 2 /* Set maximum segment size */
+#define TCP_CORK 3 /* Control sending of partial frames */
+#define TCP_KEEPIDLE 4 /* Start keeplives after this period */
+#define TCP_KEEPINTVL 5 /* Interval between keepalives */
+#define TCP_KEEPCNT 6 /* Number of keepalives before death */
+#define TCP_SYNCNT 7 /* Number of SYN retransmits */
+#define TCP_LINGER2 8 /* Life time of orphaned FIN-WAIT-2 state */
+#define TCP_DEFER_ACCEPT 9 /* Wake up listener only when data arrive */
+#define TCP_WINDOW_CLAMP 10 /* Bound advertised window */
+#define TCP_INFO 11 /* Information about this connection. */
+#define TCP_QUICKACK 12 /* Bock/reenable quick ACKs. */
+#define TCP_CONGESTION 13 /* Congestion control algorithm. */
+#define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */
+
+#ifdef __USE_MISC
+# include <sys/types.h>
+# include <sys/socket.h>
+
+# ifdef __FAVOR_BSD
+typedef u_int32_t tcp_seq;
+/*
+ * TCP header.
+ * Per RFC 793, September, 1981.
+ */
+struct tcphdr
+ {
+ u_int16_t th_sport; /* source port */
+ u_int16_t th_dport; /* destination port */
+ tcp_seq th_seq; /* sequence number */
+ tcp_seq th_ack; /* acknowledgement number */
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+ u_int8_t th_x2:4; /* (unused) */
+ u_int8_t th_off:4; /* data offset */
+# endif
+# if __BYTE_ORDER == __BIG_ENDIAN
+ u_int8_t th_off:4; /* data offset */
+ u_int8_t th_x2:4; /* (unused) */
+# endif
+ u_int8_t th_flags;
+# define TH_FIN 0x01
+# define TH_SYN 0x02
+# define TH_RST 0x04
+# define TH_PUSH 0x08
+# define TH_ACK 0x10
+# define TH_URG 0x20
+ u_int16_t th_win; /* window */
+ u_int16_t th_sum; /* checksum */
+ u_int16_t th_urp; /* urgent pointer */
+};
+
+# else /* !__FAVOR_BSD */
+struct tcphdr
+ {
+ u_int16_t source;
+ u_int16_t dest;
+ u_int32_t seq;
+ u_int32_t ack_seq;
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+ u_int16_t res1:4;
+ u_int16_t doff:4;
+ u_int16_t fin:1;
+ u_int16_t syn:1;
+ u_int16_t rst:1;
+ u_int16_t psh:1;
+ u_int16_t ack:1;
+ u_int16_t urg:1;
+ u_int16_t res2:2;
+# elif __BYTE_ORDER == __BIG_ENDIAN
+ u_int16_t doff:4;
+ u_int16_t res1:4;
+ u_int16_t res2:2;
+ u_int16_t urg:1;
+ u_int16_t ack:1;
+ u_int16_t psh:1;
+ u_int16_t rst:1;
+ u_int16_t syn:1;
+ u_int16_t fin:1;
+# else
+# error "Adjust your <bits/endian.h> defines"
+# endif
+ u_int16_t window;
+ u_int16_t check;
+ u_int16_t urg_ptr;
+};
+# endif /* __FAVOR_BSD */
+
+enum
+{
+ TCP_ESTABLISHED = 1,
+ TCP_SYN_SENT,
+ TCP_SYN_RECV,
+ TCP_FIN_WAIT1,
+ TCP_FIN_WAIT2,
+ TCP_TIME_WAIT,
+ TCP_CLOSE,
+ TCP_CLOSE_WAIT,
+ TCP_LAST_ACK,
+ TCP_LISTEN,
+ TCP_CLOSING /* now a valid state */
+};
+
+# define TCPOPT_EOL 0
+# define TCPOPT_NOP 1
+# define TCPOPT_MAXSEG 2
+# define TCPOLEN_MAXSEG 4
+# define TCPOPT_WINDOW 3
+# define TCPOLEN_WINDOW 3
+# define TCPOPT_SACK_PERMITTED 4 /* Experimental */
+# define TCPOLEN_SACK_PERMITTED 2
+# define TCPOPT_SACK 5 /* Experimental */
+# define TCPOPT_TIMESTAMP 8
+# define TCPOLEN_TIMESTAMP 10
+# define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */
+
+# define TCPOPT_TSTAMP_HDR \
+ (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP)
+
+/*
+ * Default maximum segment size for TCP.
+ * With an IP MSS of 576, this is 536,
+ * but 512 is probably more convenient.
+ * This should be defined as MIN(512, IP_MSS - sizeof (struct tcpiphdr)).
+ */
+# define TCP_MSS 512
+
+# define TCP_MAXWIN 65535 /* largest value for (unscaled) window */
+
+# define TCP_MAX_WINSHIFT 14 /* maximum window shift */
+
+# define SOL_TCP 6 /* TCP level */
+
+
+# define TCPI_OPT_TIMESTAMPS 1
+# define TCPI_OPT_SACK 2
+# define TCPI_OPT_WSCALE 4
+# define TCPI_OPT_ECN 8
+
+/* Values for tcpi_state. */
+enum tcp_ca_state
+{
+ TCP_CA_Open = 0,
+ TCP_CA_Disorder = 1,
+ TCP_CA_CWR = 2,
+ TCP_CA_Recovery = 3,
+ TCP_CA_Loss = 4
+};
+
+struct tcp_info
+{
+ u_int8_t tcpi_state;
+ u_int8_t tcpi_ca_state;
+ u_int8_t tcpi_retransmits;
+ u_int8_t tcpi_probes;
+ u_int8_t tcpi_backoff;
+ u_int8_t tcpi_options;
+ u_int8_t tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
+
+ u_int32_t tcpi_rto;
+ u_int32_t tcpi_ato;
+ u_int32_t tcpi_snd_mss;
+ u_int32_t tcpi_rcv_mss;
+
+ u_int32_t tcpi_unacked;
+ u_int32_t tcpi_sacked;
+ u_int32_t tcpi_lost;
+ u_int32_t tcpi_retrans;
+ u_int32_t tcpi_fackets;
+
+ /* Times. */
+ u_int32_t tcpi_last_data_sent;
+ u_int32_t tcpi_last_ack_sent; /* Not remembered, sorry. */
+ u_int32_t tcpi_last_data_recv;
+ u_int32_t tcpi_last_ack_recv;
+
+ /* Metrics. */
+ u_int32_t tcpi_pmtu;
+ u_int32_t tcpi_rcv_ssthresh;
+ u_int32_t tcpi_rtt;
+ u_int32_t tcpi_rttvar;
+ u_int32_t tcpi_snd_ssthresh;
+ u_int32_t tcpi_snd_cwnd;
+ u_int32_t tcpi_advmss;
+ u_int32_t tcpi_reordering;
+
+ u_int32_t tcpi_rcv_rtt;
+ u_int32_t tcpi_rcv_space;
+
+ u_int32_t tcpi_total_retrans;
+};
+
+
+/* For TCP_MD5SIG socket option. */
+#define TCP_MD5SIG_MAXKEYLEN 80
+
+struct tcp_md5sig
+{
+ struct sockaddr_storage tcpm_addr; /* Address associated. */
+ u_int16_t __tcpm_pad1; /* Zero. */
+ u_int16_t tcpm_keylen; /* Key length. */
+ u_int32_t __tcpm_pad2; /* Zero. */
+ u_int8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN]; /* Key (binary). */
+};
+
+#endif /* Misc. */
+
+#endif /* netinet/tcp.h */
diff --git a/sysroot/usr/include/netinet/udp.h b/sysroot/usr/include/netinet/udp.h
new file mode 100644
index 0000000..45b69f7
--- /dev/null
+++ b/sysroot/usr/include/netinet/udp.h
@@ -0,0 +1,79 @@
+/* Copyright (C) 1991, 92, 93, 95, 96, 97, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * Copyright (C) 1982, 1986 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef __NETINET_UDP_H
+#define __NETINET_UDP_H 1
+
+#include <features.h>
+#include <sys/types.h>
+
+
+/* UDP header as specified by RFC 768, August 1980. */
+#ifdef __FAVOR_BSD
+
+struct udphdr
+{
+ u_int16_t uh_sport; /* source port */
+ u_int16_t uh_dport; /* destination port */
+ u_int16_t uh_ulen; /* udp length */
+ u_int16_t uh_sum; /* udp checksum */
+};
+
+#else
+
+struct udphdr
+{
+ u_int16_t source;
+ u_int16_t dest;
+ u_int16_t len;
+ u_int16_t check;
+};
+#endif
+
+#define SOL_UDP 17 /* sockopt level for UDP */
+
+#endif /* netinet/udp.h */
diff --git a/sysroot/usr/include/netipx/ipx.h b/sysroot/usr/include/netipx/ipx.h
new file mode 100644
index 0000000..7eb42ef
--- /dev/null
+++ b/sysroot/usr/include/netipx/ipx.h
@@ -0,0 +1,113 @@
+/* Copyright (C) 1991, 92, 93, 95, 96, 97, 98 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef __NETIPX_IPX_H
+#define __NETIPX_IPX_H 1
+
+#include <features.h>
+
+#include <sys/types.h>
+#include <bits/sockaddr.h>
+
+__BEGIN_DECLS
+
+#define SOL_IPX 256 /* sockopt level */
+
+#define IPX_TYPE 1
+#define IPX_NODE_LEN 6
+#define IPX_MTU 576
+
+struct sockaddr_ipx
+ {
+ sa_family_t sipx_family;
+ u_int16_t sipx_port;
+ u_int32_t sipx_network;
+ unsigned char sipx_node[IPX_NODE_LEN];
+ u_int8_t sipx_type;
+ unsigned char sipx_zero; /* 16 byte fill */
+ };
+
+/*
+ * So we can fit the extra info for SIOCSIFADDR into the address nicely
+ */
+
+#define sipx_special sipx_port
+#define sipx_action sipx_zero
+#define IPX_DLTITF 0
+#define IPX_CRTITF 1
+
+typedef struct ipx_route_definition
+ {
+ unsigned long ipx_network;
+ unsigned long ipx_router_network;
+ unsigned char ipx_router_node[IPX_NODE_LEN];
+ }
+ipx_route_definition;
+
+typedef struct ipx_interface_definition
+ {
+ unsigned long ipx_network;
+ unsigned char ipx_device[16];
+ unsigned char ipx_dlink_type;
+#define IPX_FRAME_NONE 0
+#define IPX_FRAME_SNAP 1
+#define IPX_FRAME_8022 2
+#define IPX_FRAME_ETHERII 3
+#define IPX_FRAME_8023 4
+#define IPX_FRAME_TR_8022 5
+ unsigned char ipx_special;
+#define IPX_SPECIAL_NONE 0
+#define IPX_PRIMARY 1
+#define IPX_INTERNAL 2
+ unsigned char ipx_node[IPX_NODE_LEN];
+ }
+ipx_interface_definition;
+
+typedef struct ipx_config_data
+ {
+ unsigned char ipxcfg_auto_select_primary;
+ unsigned char ipxcfg_auto_create_interfaces;
+ }
+ipx_config_data;
+
+/*
+ * OLD Route Definition for backward compatibility.
+ */
+
+struct ipx_route_def
+ {
+ unsigned long ipx_network;
+ unsigned long ipx_router_network;
+#define IPX_ROUTE_NO_ROUTER 0
+ unsigned char ipx_router_node[IPX_NODE_LEN];
+ unsigned char ipx_device[16];
+ unsigned short ipx_flags;
+#define IPX_RT_SNAP 8
+#define IPX_RT_8022 4
+#define IPX_RT_BLUEBOOK 2
+#define IPX_RT_ROUTED 1
+ };
+
+#define SIOCAIPXITFCRT (SIOCPROTOPRIVATE)
+#define SIOCAIPXPRISLT (SIOCPROTOPRIVATE + 1)
+#define SIOCIPXCFGDATA (SIOCPROTOPRIVATE + 2)
+#define SIOCIPXNCPCONN (SIOCPROTOPRIVATE + 3)
+
+__END_DECLS
+
+#endif /* netipx/ipx.h */
diff --git a/sysroot/usr/include/netpacket/packet.h b/sysroot/usr/include/netpacket/packet.h
new file mode 100644
index 0000000..6c63428
--- /dev/null
+++ b/sysroot/usr/include/netpacket/packet.h
@@ -0,0 +1,64 @@
+/* Definitions for use with Linux AF_PACKET sockets.
+ Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef __NETPACKET_PACKET_H
+#define __NETPACKET_PACKET_H 1
+
+struct sockaddr_ll
+ {
+ unsigned short int sll_family;
+ unsigned short int sll_protocol;
+ int sll_ifindex;
+ unsigned short int sll_hatype;
+ unsigned char sll_pkttype;
+ unsigned char sll_halen;
+ unsigned char sll_addr[8];
+ };
+
+/* Packet types. */
+
+#define PACKET_HOST 0 /* To us. */
+#define PACKET_BROADCAST 1 /* To all. */
+#define PACKET_MULTICAST 2 /* To group. */
+#define PACKET_OTHERHOST 3 /* To someone else. */
+#define PACKET_OUTGOING 4 /* Originated by us . */
+#define PACKET_LOOPBACK 5
+#define PACKET_FASTROUTE 6
+
+/* Packet socket options. */
+
+#define PACKET_ADD_MEMBERSHIP 1
+#define PACKET_DROP_MEMBERSHIP 2
+#define PACKET_RECV_OUTPUT 3
+#define PACKET_RX_RING 5
+#define PACKET_STATISTICS 6
+
+struct packet_mreq
+ {
+ int mr_ifindex;
+ unsigned short int mr_type;
+ unsigned short int mr_alen;
+ unsigned char mr_address[8];
+ };
+
+#define PACKET_MR_MULTICAST 0
+#define PACKET_MR_PROMISC 1
+#define PACKET_MR_ALLMULTI 2
+
+#endif /* netpacket/packet.h */
diff --git a/sysroot/usr/include/netrom/netrom.h b/sysroot/usr/include/netrom/netrom.h
new file mode 100644
index 0000000..4984772
--- /dev/null
+++ b/sysroot/usr/include/netrom/netrom.h
@@ -0,0 +1,84 @@
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _NETROM_NETROM_H
+#define _NETROM_NETROM_H 1
+
+#include <netax25/ax25.h>
+
+/* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx. */
+#define SOL_NETROM 259
+
+/* NetRom control values: */
+#define NETROM_T1 1
+#define NETROM_T2 2
+#define NETROM_N2 3
+#define NETROM_PACLEN 5
+#define NETROM_T4 6
+#define NETROM_IDLE 7
+
+#define NETROM_KILL 99
+
+/* Type of route: */
+#define NETROM_NEIGH 0
+#define NETROM_NODE 1
+
+struct nr_route_struct
+ {
+ int type;
+ ax25_address callsign;
+ char device[16];
+ unsigned int quality;
+ char mnemonic[7];
+ ax25_address neighbour;
+ unsigned int obs_count;
+ unsigned int ndigis;
+ ax25_address digipeaters[AX25_MAX_DIGIS];
+ };
+
+/* NetRom socket ioctls: */
+#define SIOCNRGETPARMS (SIOCPROTOPRIVATE+0)
+#define SIOCNRSETPARMS (SIOCPROTOPRIVATE+1)
+#define SIOCNRDECOBS (SIOCPROTOPRIVATE+2)
+#define SIOCNRRTCTL (SIOCPROTOPRIVATE+3)
+#define SIOCNRCTLCON (SIOCPROTOPRIVATE+4)
+
+/* NetRom parameter structure: */
+struct nr_parms_struct
+ {
+ unsigned int quality;
+ unsigned int obs_count;
+ unsigned int ttl;
+ unsigned int timeout;
+ unsigned int ack_delay;
+ unsigned int busy_delay;
+ unsigned int tries;
+ unsigned int window;
+ unsigned int paclen;
+ };
+
+/* NetRom control structure: */
+struct nr_ctl_struct
+ {
+ unsigned char index;
+ unsigned char id;
+ unsigned int cmd;
+ unsigned long arg;
+ };
+
+#endif /* netrom/netrom.h */
diff --git a/sysroot/usr/include/netrose/rose.h b/sysroot/usr/include/netrose/rose.h
new file mode 100644
index 0000000..e4ba7d7
--- /dev/null
+++ b/sysroot/usr/include/netrose/rose.h
@@ -0,0 +1,116 @@
+/* Definitions for Rose packet radio address family.
+ Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* What follows is copied from the 2.1.93 <linux/rose.h>. */
+
+#ifndef _NETROSE_ROSE_H
+#define _NETROSE_ROSE_H 1
+
+/* Socket level values. */
+#define SOL_ROSE 260
+
+
+/* These are the public elements of the Linux kernel Rose
+ implementation. For kernel AX.25 see the file ax25.h. This file
+ requires ax25.h for the definition of the ax25_address structure. */
+#define ROSE_MTU 251
+
+#define ROSE_MAX_DIGIS 6
+
+#define ROSE_DEFER 1
+#define ROSE_T1 2
+#define ROSE_T2 3
+#define ROSE_T3 4
+#define ROSE_IDLE 5
+#define ROSE_QBITINCL 6
+#define ROSE_HOLDBACK 7
+
+#define SIOCRSGCAUSE (SIOCPROTOPRIVATE + 0)
+#define SIOCRSSCAUSE (SIOCPROTOPRIVATE + 1)
+#define SIOCRSL2CALL (SIOCPROTOPRIVATE + 2)
+#define SIOCRSSL2CALL (SIOCPROTOPRIVATE + 2)
+#define SIOCRSACCEPT (SIOCPROTOPRIVATE + 3)
+#define SIOCRSCLRRT (SIOCPROTOPRIVATE + 4)
+#define SIOCRSGL2CALL (SIOCPROTOPRIVATE + 5)
+#define SIOCRSGFACILITIES (SIOCPROTOPRIVATE + 6)
+
+#define ROSE_DTE_ORIGINATED 0x00
+#define ROSE_NUMBER_BUSY 0x01
+#define ROSE_INVALID_FACILITY 0x03
+#define ROSE_NETWORK_CONGESTION 0x05
+#define ROSE_OUT_OF_ORDER 0x09
+#define ROSE_ACCESS_BARRED 0x0B
+#define ROSE_NOT_OBTAINABLE 0x0D
+#define ROSE_REMOTE_PROCEDURE 0x11
+#define ROSE_LOCAL_PROCEDURE 0x13
+#define ROSE_SHIP_ABSENT 0x39
+
+
+typedef struct
+{
+ char rose_addr[5];
+} rose_address;
+
+struct sockaddr_rose
+{
+ sa_family_t srose_family;
+ rose_address srose_addr;
+ ax25_address srose_call;
+ int srose_ndigis;
+ ax25_address srose_digi;
+};
+
+struct full_sockaddr_rose
+{
+ sa_family_t srose_family;
+ rose_address srose_addr;
+ ax25_address srose_call;
+ unsigned int srose_ndigis;
+ ax25_address srose_digis[ROSE_MAX_DIGIS];
+};
+
+struct rose_route_struct
+{
+ rose_address address;
+ unsigned short int mask;
+ ax25_address neighbour;
+ char device[16];
+ unsigned char ndigis;
+ ax25_address digipeaters[AX25_MAX_DIGIS];
+};
+
+struct rose_cause_struct
+{
+ unsigned char cause;
+ unsigned char diagnostic;
+};
+
+struct rose_facilities_struct
+{
+ rose_address source_addr, dest_addr;
+ ax25_address source_call, dest_call;
+ unsigned char source_ndigis, dest_ndigis;
+ ax25_address source_digis[ROSE_MAX_DIGIS];
+ ax25_address dest_digis[ROSE_MAX_DIGIS];
+ unsigned int rand;
+ rose_address fail_addr;
+ ax25_address fail_call;
+};
+
+#endif /* netrose/rose.h */
diff --git a/sysroot/usr/include/nfs/nfs.h b/sysroot/usr/include/nfs/nfs.h
new file mode 100644
index 0000000..61e4b65
--- /dev/null
+++ b/sysroot/usr/include/nfs/nfs.h
@@ -0,0 +1 @@
+#include <linux/nfs.h>
diff --git a/sysroot/usr/include/nl_types.h b/sysroot/usr/include/nl_types.h
new file mode 100644
index 0000000..c1190b5
--- /dev/null
+++ b/sysroot/usr/include/nl_types.h
@@ -0,0 +1,55 @@
+/* Copyright (C) 1996, 1997, 1999, 2003, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _NL_TYPES_H
+#define _NL_TYPES_H 1
+
+#include <features.h>
+
+/* The default message set used by the gencat program. */
+#define NL_SETD 1
+
+/* Value for FLAG parameter of `catgets' to say we want XPG4 compliance. */
+#define NL_CAT_LOCALE 1
+
+
+__BEGIN_DECLS
+
+/* Message catalog descriptor type. */
+typedef void *nl_catd;
+
+/* Type used by `nl_langinfo'. */
+typedef int nl_item;
+
+/* Open message catalog for later use, returning descriptor.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern nl_catd catopen (__const char *__cat_name, int __flag) __nonnull ((1));
+
+/* Return translation with NUMBER in SET of CATALOG; if not found
+ return STRING. */
+extern char *catgets (nl_catd __catalog, int __set, int __number,
+ __const char *__string) __THROW __nonnull ((1));
+
+/* Close message CATALOG. */
+extern int catclose (nl_catd __catalog) __THROW __nonnull ((1));
+
+__END_DECLS
+
+#endif /* nl_types.h */
diff --git a/sysroot/usr/include/nss.h b/sysroot/usr/include/nss.h
new file mode 100644
index 0000000..f5c12af
--- /dev/null
+++ b/sysroot/usr/include/nss.h
@@ -0,0 +1,52 @@
+/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Define interface to NSS. This is meant for the interface functions
+ and for implementors of new services. */
+
+#ifndef _NSS_H
+#define _NSS_H 1
+
+#include <features.h>
+
+
+__BEGIN_DECLS
+
+/* Possible results of lookup using a nss_* function. */
+enum nss_status
+{
+ NSS_STATUS_TRYAGAIN = -2,
+ NSS_STATUS_UNAVAIL,
+ NSS_STATUS_NOTFOUND,
+ NSS_STATUS_SUCCESS,
+ NSS_STATUS_RETURN
+};
+
+
+/* Overwrite service selection for database DBNAME using specification
+ in STRING.
+ This function should only be used by system programs which have to
+ work around non-existing services (e.e., while booting).
+ Attention: Using this function repeatedly will slowly eat up the
+ whole memory since previous selection data cannot be freed. */
+extern int __nss_configure_lookup (__const char *__dbname,
+ __const char *__string) __THROW;
+
+__END_DECLS
+
+#endif /* nss.h */
diff --git a/sysroot/usr/include/obstack.h b/sysroot/usr/include/obstack.h
new file mode 100644
index 0000000..206fe55
--- /dev/null
+++ b/sysroot/usr/include/obstack.h
@@ -0,0 +1,509 @@
+/* obstack.h - object stack macros
+ Copyright (C) 1988-1994,1996-1999,2003,2004,2005
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
+
+/* Summary:
+
+All the apparent functions defined here are macros. The idea
+is that you would use these pre-tested macros to solve a
+very specific set of problems, and they would run fast.
+Caution: no side-effects in arguments please!! They may be
+evaluated MANY times!!
+
+These macros operate a stack of objects. Each object starts life
+small, and may grow to maturity. (Consider building a word syllable
+by syllable.) An object can move while it is growing. Once it has
+been "finished" it never changes address again. So the "top of the
+stack" is typically an immature growing object, while the rest of the
+stack is of mature, fixed size and fixed address objects.
+
+These routines grab large chunks of memory, using a function you
+supply, called `obstack_chunk_alloc'. On occasion, they free chunks,
+by calling `obstack_chunk_free'. You must define them and declare
+them before using any obstack macros.
+
+Each independent stack is represented by a `struct obstack'.
+Each of the obstack macros expects a pointer to such a structure
+as the first argument.
+
+One motivation for this package is the problem of growing char strings
+in symbol tables. Unless you are "fascist pig with a read-only mind"
+--Gosper's immortal quote from HAKMEM item 154, out of context--you
+would not like to put any arbitrary upper limit on the length of your
+symbols.
+
+In practice this often means you will build many short symbols and a
+few long symbols. At the time you are reading a symbol you don't know
+how long it is. One traditional method is to read a symbol into a
+buffer, realloc()ating the buffer every time you try to read a symbol
+that is longer than the buffer. This is beaut, but you still will
+want to copy the symbol from the buffer to a more permanent
+symbol-table entry say about half the time.
+
+With obstacks, you can work differently. Use one obstack for all symbol
+names. As you read a symbol, grow the name in the obstack gradually.
+When the name is complete, finalize it. Then, if the symbol exists already,
+free the newly read name.
+
+The way we do this is to take a large chunk, allocating memory from
+low addresses. When you want to build a symbol in the chunk you just
+add chars above the current "high water mark" in the chunk. When you
+have finished adding chars, because you got to the end of the symbol,
+you know how long the chars are, and you can create a new object.
+Mostly the chars will not burst over the highest address of the chunk,
+because you would typically expect a chunk to be (say) 100 times as
+long as an average object.
+
+In case that isn't clear, when we have enough chars to make up
+the object, THEY ARE ALREADY CONTIGUOUS IN THE CHUNK (guaranteed)
+so we just point to it where it lies. No moving of chars is
+needed and this is the second win: potentially long strings need
+never be explicitly shuffled. Once an object is formed, it does not
+change its address during its lifetime.
+
+When the chars burst over a chunk boundary, we allocate a larger
+chunk, and then copy the partly formed object from the end of the old
+chunk to the beginning of the new larger chunk. We then carry on
+accreting characters to the end of the object as we normally would.
+
+A special macro is provided to add a single char at a time to a
+growing object. This allows the use of register variables, which
+break the ordinary 'growth' macro.
+
+Summary:
+ We allocate large chunks.
+ We carve out one object at a time from the current chunk.
+ Once carved, an object never moves.
+ We are free to append data of any size to the currently
+ growing object.
+ Exactly one object is growing in an obstack at any one time.
+ You can run one obstack per control block.
+ You may have as many control blocks as you dare.
+ Because of the way we do it, you can `unwind' an obstack
+ back to a previous state. (You may remove objects much
+ as you would with a stack.)
+*/
+
+
+/* Don't do the contents of this file more than once. */
+
+#ifndef _OBSTACK_H
+#define _OBSTACK_H 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* We need the type of a pointer subtraction. If __PTRDIFF_TYPE__ is
+ defined, as with GNU C, use that; that way we don't pollute the
+ namespace with <stddef.h>'s symbols. Otherwise, include <stddef.h>
+ and use ptrdiff_t. */
+
+#ifdef __PTRDIFF_TYPE__
+# define PTR_INT_TYPE __PTRDIFF_TYPE__
+#else
+# include <stddef.h>
+# define PTR_INT_TYPE ptrdiff_t
+#endif
+
+/* If B is the base of an object addressed by P, return the result of
+ aligning P to the next multiple of A + 1. B and P must be of type
+ char *. A + 1 must be a power of 2. */
+
+#define __BPTR_ALIGN(B, P, A) ((B) + (((P) - (B) + (A)) & ~(A)))
+
+/* Similiar to _BPTR_ALIGN (B, P, A), except optimize the common case
+ where pointers can be converted to integers, aligned as integers,
+ and converted back again. If PTR_INT_TYPE is narrower than a
+ pointer (e.g., the AS/400), play it safe and compute the alignment
+ relative to B. Otherwise, use the faster strategy of computing the
+ alignment relative to 0. */
+
+#define __PTR_ALIGN(B, P, A) \
+ __BPTR_ALIGN (sizeof (PTR_INT_TYPE) < sizeof (void *) ? (B) : (char *) 0, \
+ P, A)
+
+#include <string.h>
+
+struct _obstack_chunk /* Lives at front of each chunk. */
+{
+ char *limit; /* 1 past end of this chunk */
+ struct _obstack_chunk *prev; /* address of prior chunk or NULL */
+ char contents[4]; /* objects begin here */
+};
+
+struct obstack /* control current object in current chunk */
+{
+ long chunk_size; /* preferred size to allocate chunks in */
+ struct _obstack_chunk *chunk; /* address of current struct obstack_chunk */
+ char *object_base; /* address of object we are building */
+ char *next_free; /* where to add next char to current object */
+ char *chunk_limit; /* address of char after current chunk */
+ union
+ {
+ PTR_INT_TYPE tempint;
+ void *tempptr;
+ } temp; /* Temporary for some macros. */
+ int alignment_mask; /* Mask of alignment for each object. */
+ /* These prototypes vary based on `use_extra_arg', and we use
+ casts to the prototypeless function type in all assignments,
+ but having prototypes here quiets -Wstrict-prototypes. */
+ struct _obstack_chunk *(*chunkfun) (void *, long);
+ void (*freefun) (void *, struct _obstack_chunk *);
+ void *extra_arg; /* first arg for chunk alloc/dealloc funcs */
+ unsigned use_extra_arg:1; /* chunk alloc/dealloc funcs take extra arg */
+ unsigned maybe_empty_object:1;/* There is a possibility that the current
+ chunk contains a zero-length object. This
+ prevents freeing the chunk if we allocate
+ a bigger chunk to replace it. */
+ unsigned alloc_failed:1; /* No longer used, as we now call the failed
+ handler on error, but retained for binary
+ compatibility. */
+};
+
+/* Declare the external functions we use; they are in obstack.c. */
+
+extern void _obstack_newchunk (struct obstack *, int);
+extern int _obstack_begin (struct obstack *, int, int,
+ void *(*) (long), void (*) (void *));
+extern int _obstack_begin_1 (struct obstack *, int, int,
+ void *(*) (void *, long),
+ void (*) (void *, void *), void *);
+extern int _obstack_memory_used (struct obstack *);
+
+void obstack_free (struct obstack *obstack, void *block);
+
+
+/* Error handler called when `obstack_chunk_alloc' failed to allocate
+ more memory. This can be set to a user defined function which
+ should either abort gracefully or use longjump - but shouldn't
+ return. The default action is to print a message and abort. */
+extern void (*obstack_alloc_failed_handler) (void);
+
+/* Exit value used when `print_and_abort' is used. */
+extern int obstack_exit_failure;
+
+/* Pointer to beginning of object being allocated or to be allocated next.
+ Note that this might not be the final address of the object
+ because a new chunk might be needed to hold the final size. */
+
+#define obstack_base(h) ((void *) (h)->object_base)
+
+/* Size for allocating ordinary chunks. */
+
+#define obstack_chunk_size(h) ((h)->chunk_size)
+
+/* Pointer to next byte not yet allocated in current chunk. */
+
+#define obstack_next_free(h) ((h)->next_free)
+
+/* Mask specifying low bits that should be clear in address of an object. */
+
+#define obstack_alignment_mask(h) ((h)->alignment_mask)
+
+/* To prevent prototype warnings provide complete argument list. */
+#define obstack_init(h) \
+ _obstack_begin ((h), 0, 0, \
+ (void *(*) (long)) obstack_chunk_alloc, \
+ (void (*) (void *)) obstack_chunk_free)
+
+#define obstack_begin(h, size) \
+ _obstack_begin ((h), (size), 0, \
+ (void *(*) (long)) obstack_chunk_alloc, \
+ (void (*) (void *)) obstack_chunk_free)
+
+#define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \
+ _obstack_begin ((h), (size), (alignment), \
+ (void *(*) (long)) (chunkfun), \
+ (void (*) (void *)) (freefun))
+
+#define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \
+ _obstack_begin_1 ((h), (size), (alignment), \
+ (void *(*) (void *, long)) (chunkfun), \
+ (void (*) (void *, void *)) (freefun), (arg))
+
+#define obstack_chunkfun(h, newchunkfun) \
+ ((h) -> chunkfun = (struct _obstack_chunk *(*)(void *, long)) (newchunkfun))
+
+#define obstack_freefun(h, newfreefun) \
+ ((h) -> freefun = (void (*)(void *, struct _obstack_chunk *)) (newfreefun))
+
+#define obstack_1grow_fast(h,achar) (*((h)->next_free)++ = (achar))
+
+#define obstack_blank_fast(h,n) ((h)->next_free += (n))
+
+#define obstack_memory_used(h) _obstack_memory_used (h)
+
+#if defined __GNUC__ && defined __STDC__ && __STDC__
+/* NextStep 2.0 cc is really gcc 1.93 but it defines __GNUC__ = 2 and
+ does not implement __extension__. But that compiler doesn't define
+ __GNUC_MINOR__. */
+# if __GNUC__ < 2 || (__NeXT__ && !__GNUC_MINOR__)
+# define __extension__
+# endif
+
+/* For GNU C, if not -traditional,
+ we can define these macros to compute all args only once
+ without using a global variable.
+ Also, we can avoid using the `temp' slot, to make faster code. */
+
+# define obstack_object_size(OBSTACK) \
+ __extension__ \
+ ({ struct obstack const *__o = (OBSTACK); \
+ (unsigned) (__o->next_free - __o->object_base); })
+
+# define obstack_room(OBSTACK) \
+ __extension__ \
+ ({ struct obstack const *__o = (OBSTACK); \
+ (unsigned) (__o->chunk_limit - __o->next_free); })
+
+# define obstack_make_room(OBSTACK,length) \
+__extension__ \
+({ struct obstack *__o = (OBSTACK); \
+ int __len = (length); \
+ if (__o->chunk_limit - __o->next_free < __len) \
+ _obstack_newchunk (__o, __len); \
+ (void) 0; })
+
+# define obstack_empty_p(OBSTACK) \
+ __extension__ \
+ ({ struct obstack const *__o = (OBSTACK); \
+ (__o->chunk->prev == 0 \
+ && __o->next_free == __PTR_ALIGN ((char *) __o->chunk, \
+ __o->chunk->contents, \
+ __o->alignment_mask)); })
+
+# define obstack_grow(OBSTACK,where,length) \
+__extension__ \
+({ struct obstack *__o = (OBSTACK); \
+ int __len = (length); \
+ if (__o->next_free + __len > __o->chunk_limit) \
+ _obstack_newchunk (__o, __len); \
+ memcpy (__o->next_free, where, __len); \
+ __o->next_free += __len; \
+ (void) 0; })
+
+# define obstack_grow0(OBSTACK,where,length) \
+__extension__ \
+({ struct obstack *__o = (OBSTACK); \
+ int __len = (length); \
+ if (__o->next_free + __len + 1 > __o->chunk_limit) \
+ _obstack_newchunk (__o, __len + 1); \
+ memcpy (__o->next_free, where, __len); \
+ __o->next_free += __len; \
+ *(__o->next_free)++ = 0; \
+ (void) 0; })
+
+# define obstack_1grow(OBSTACK,datum) \
+__extension__ \
+({ struct obstack *__o = (OBSTACK); \
+ if (__o->next_free + 1 > __o->chunk_limit) \
+ _obstack_newchunk (__o, 1); \
+ obstack_1grow_fast (__o, datum); \
+ (void) 0; })
+
+/* These assume that the obstack alignment is good enough for pointers
+ or ints, and that the data added so far to the current object
+ shares that much alignment. */
+
+# define obstack_ptr_grow(OBSTACK,datum) \
+__extension__ \
+({ struct obstack *__o = (OBSTACK); \
+ if (__o->next_free + sizeof (void *) > __o->chunk_limit) \
+ _obstack_newchunk (__o, sizeof (void *)); \
+ obstack_ptr_grow_fast (__o, datum); }) \
+
+# define obstack_int_grow(OBSTACK,datum) \
+__extension__ \
+({ struct obstack *__o = (OBSTACK); \
+ if (__o->next_free + sizeof (int) > __o->chunk_limit) \
+ _obstack_newchunk (__o, sizeof (int)); \
+ obstack_int_grow_fast (__o, datum); })
+
+# define obstack_ptr_grow_fast(OBSTACK,aptr) \
+__extension__ \
+({ struct obstack *__o1 = (OBSTACK); \
+ *(const void **) __o1->next_free = (aptr); \
+ __o1->next_free += sizeof (const void *); \
+ (void) 0; })
+
+# define obstack_int_grow_fast(OBSTACK,aint) \
+__extension__ \
+({ struct obstack *__o1 = (OBSTACK); \
+ *(int *) __o1->next_free = (aint); \
+ __o1->next_free += sizeof (int); \
+ (void) 0; })
+
+# define obstack_blank(OBSTACK,length) \
+__extension__ \
+({ struct obstack *__o = (OBSTACK); \
+ int __len = (length); \
+ if (__o->chunk_limit - __o->next_free < __len) \
+ _obstack_newchunk (__o, __len); \
+ obstack_blank_fast (__o, __len); \
+ (void) 0; })
+
+# define obstack_alloc(OBSTACK,length) \
+__extension__ \
+({ struct obstack *__h = (OBSTACK); \
+ obstack_blank (__h, (length)); \
+ obstack_finish (__h); })
+
+# define obstack_copy(OBSTACK,where,length) \
+__extension__ \
+({ struct obstack *__h = (OBSTACK); \
+ obstack_grow (__h, (where), (length)); \
+ obstack_finish (__h); })
+
+# define obstack_copy0(OBSTACK,where,length) \
+__extension__ \
+({ struct obstack *__h = (OBSTACK); \
+ obstack_grow0 (__h, (where), (length)); \
+ obstack_finish (__h); })
+
+/* The local variable is named __o1 to avoid a name conflict
+ when obstack_blank is called. */
+# define obstack_finish(OBSTACK) \
+__extension__ \
+({ struct obstack *__o1 = (OBSTACK); \
+ void *__value = (void *) __o1->object_base; \
+ if (__o1->next_free == __value) \
+ __o1->maybe_empty_object = 1; \
+ __o1->next_free \
+ = __PTR_ALIGN (__o1->object_base, __o1->next_free, \
+ __o1->alignment_mask); \
+ if (__o1->next_free - (char *)__o1->chunk \
+ > __o1->chunk_limit - (char *)__o1->chunk) \
+ __o1->next_free = __o1->chunk_limit; \
+ __o1->object_base = __o1->next_free; \
+ __value; })
+
+# define obstack_free(OBSTACK, OBJ) \
+__extension__ \
+({ struct obstack *__o = (OBSTACK); \
+ void *__obj = (OBJ); \
+ if (__obj > (void *)__o->chunk && __obj < (void *)__o->chunk_limit) \
+ __o->next_free = __o->object_base = (char *)__obj; \
+ else (obstack_free) (__o, __obj); })
+
+#else /* not __GNUC__ or not __STDC__ */
+
+# define obstack_object_size(h) \
+ (unsigned) ((h)->next_free - (h)->object_base)
+
+# define obstack_room(h) \
+ (unsigned) ((h)->chunk_limit - (h)->next_free)
+
+# define obstack_empty_p(h) \
+ ((h)->chunk->prev == 0 \
+ && (h)->next_free == __PTR_ALIGN ((char *) (h)->chunk, \
+ (h)->chunk->contents, \
+ (h)->alignment_mask))
+
+/* Note that the call to _obstack_newchunk is enclosed in (..., 0)
+ so that we can avoid having void expressions
+ in the arms of the conditional expression.
+ Casting the third operand to void was tried before,
+ but some compilers won't accept it. */
+
+# define obstack_make_room(h,length) \
+( (h)->temp.tempint = (length), \
+ (((h)->next_free + (h)->temp.tempint > (h)->chunk_limit) \
+ ? (_obstack_newchunk ((h), (h)->temp.tempint), 0) : 0))
+
+# define obstack_grow(h,where,length) \
+( (h)->temp.tempint = (length), \
+ (((h)->next_free + (h)->temp.tempint > (h)->chunk_limit) \
+ ? (_obstack_newchunk ((h), (h)->temp.tempint), 0) : 0), \
+ memcpy ((h)->next_free, where, (h)->temp.tempint), \
+ (h)->next_free += (h)->temp.tempint)
+
+# define obstack_grow0(h,where,length) \
+( (h)->temp.tempint = (length), \
+ (((h)->next_free + (h)->temp.tempint + 1 > (h)->chunk_limit) \
+ ? (_obstack_newchunk ((h), (h)->temp.tempint + 1), 0) : 0), \
+ memcpy ((h)->next_free, where, (h)->temp.tempint), \
+ (h)->next_free += (h)->temp.tempint, \
+ *((h)->next_free)++ = 0)
+
+# define obstack_1grow(h,datum) \
+( (((h)->next_free + 1 > (h)->chunk_limit) \
+ ? (_obstack_newchunk ((h), 1), 0) : 0), \
+ obstack_1grow_fast (h, datum))
+
+# define obstack_ptr_grow(h,datum) \
+( (((h)->next_free + sizeof (char *) > (h)->chunk_limit) \
+ ? (_obstack_newchunk ((h), sizeof (char *)), 0) : 0), \
+ obstack_ptr_grow_fast (h, datum))
+
+# define obstack_int_grow(h,datum) \
+( (((h)->next_free + sizeof (int) > (h)->chunk_limit) \
+ ? (_obstack_newchunk ((h), sizeof (int)), 0) : 0), \
+ obstack_int_grow_fast (h, datum))
+
+# define obstack_ptr_grow_fast(h,aptr) \
+ (((const void **) ((h)->next_free += sizeof (void *)))[-1] = (aptr))
+
+# define obstack_int_grow_fast(h,aint) \
+ (((int *) ((h)->next_free += sizeof (int)))[-1] = (aint))
+
+# define obstack_blank(h,length) \
+( (h)->temp.tempint = (length), \
+ (((h)->chunk_limit - (h)->next_free < (h)->temp.tempint) \
+ ? (_obstack_newchunk ((h), (h)->temp.tempint), 0) : 0), \
+ obstack_blank_fast (h, (h)->temp.tempint))
+
+# define obstack_alloc(h,length) \
+ (obstack_blank ((h), (length)), obstack_finish ((h)))
+
+# define obstack_copy(h,where,length) \
+ (obstack_grow ((h), (where), (length)), obstack_finish ((h)))
+
+# define obstack_copy0(h,where,length) \
+ (obstack_grow0 ((h), (where), (length)), obstack_finish ((h)))
+
+# define obstack_finish(h) \
+( ((h)->next_free == (h)->object_base \
+ ? (((h)->maybe_empty_object = 1), 0) \
+ : 0), \
+ (h)->temp.tempptr = (h)->object_base, \
+ (h)->next_free \
+ = __PTR_ALIGN ((h)->object_base, (h)->next_free, \
+ (h)->alignment_mask), \
+ (((h)->next_free - (char *) (h)->chunk \
+ > (h)->chunk_limit - (char *) (h)->chunk) \
+ ? ((h)->next_free = (h)->chunk_limit) : 0), \
+ (h)->object_base = (h)->next_free, \
+ (h)->temp.tempptr)
+
+# define obstack_free(h,obj) \
+( (h)->temp.tempint = (char *) (obj) - (char *) (h)->chunk, \
+ ((((h)->temp.tempint > 0 \
+ && (h)->temp.tempint < (h)->chunk_limit - (char *) (h)->chunk)) \
+ ? (int) ((h)->next_free = (h)->object_base \
+ = (h)->temp.tempint + (char *) (h)->chunk) \
+ : (((obstack_free) ((h), (h)->temp.tempint + (char *) (h)->chunk), 0), 0)))
+
+#endif /* not __GNUC__ or not __STDC__ */
+
+#ifdef __cplusplus
+} /* C++ */
+#endif
+
+#endif /* obstack.h */
diff --git a/sysroot/usr/include/panel.h b/sysroot/usr/include/panel.h
new file mode 100644
index 0000000..1e02091
--- /dev/null
+++ b/sysroot/usr/include/panel.h
@@ -0,0 +1,77 @@
+/****************************************************************************
+ * Copyright (c) 1998-2001,2006 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995 *
+ * and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ ****************************************************************************/
+
+/* $Id: panel.h,v 1.10 2006/05/27 19:49:40 tom Exp $ */
+
+/* panel.h -- interface file for panels library */
+
+#ifndef NCURSES_PANEL_H_incl
+#define NCURSES_PANEL_H_incl 1
+
+#include <curses.h>
+
+typedef struct panel
+{
+ WINDOW *win;
+ struct panel *below;
+ struct panel *above;
+ NCURSES_CONST void *user;
+} PANEL;
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+extern NCURSES_EXPORT(WINDOW*) panel_window (const PANEL *);
+extern NCURSES_EXPORT(void) update_panels (void);
+extern NCURSES_EXPORT(int) hide_panel (PANEL *);
+extern NCURSES_EXPORT(int) show_panel (PANEL *);
+extern NCURSES_EXPORT(int) del_panel (PANEL *);
+extern NCURSES_EXPORT(int) top_panel (PANEL *);
+extern NCURSES_EXPORT(int) bottom_panel (PANEL *);
+extern NCURSES_EXPORT(PANEL*) new_panel (WINDOW *);
+extern NCURSES_EXPORT(PANEL*) panel_above (const PANEL *);
+extern NCURSES_EXPORT(PANEL*) panel_below (const PANEL *);
+extern NCURSES_EXPORT(int) set_panel_userptr (PANEL *, NCURSES_CONST void *);
+extern NCURSES_EXPORT(NCURSES_CONST void*) panel_userptr (const PANEL *);
+extern NCURSES_EXPORT(int) move_panel (PANEL *, int, int);
+extern NCURSES_EXPORT(int) replace_panel (PANEL *,WINDOW *);
+extern NCURSES_EXPORT(int) panel_hidden (const PANEL *);
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif /* NCURSES_PANEL_H_incl */
+
+/* end of panel.h */
diff --git a/sysroot/usr/include/paths.h b/sysroot/usr/include/paths.h
new file mode 100644
index 0000000..2f7cc6d
--- /dev/null
+++ b/sysroot/usr/include/paths.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)paths.h 8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _PATHS_H_
+#define _PATHS_H_
+
+/* Default search path. */
+#define _PATH_DEFPATH "/usr/bin:/bin"
+/* All standard utilities path. */
+#define _PATH_STDPATH \
+ "/usr/bin:/bin:/usr/sbin:/sbin"
+
+#define _PATH_BSHELL "/bin/sh"
+#define _PATH_CONSOLE "/dev/console"
+#define _PATH_CSHELL "/bin/csh"
+#define _PATH_DEVDB "/var/run/dev.db"
+#define _PATH_DEVNULL "/dev/null"
+#define _PATH_DRUM "/dev/drum"
+#define _PATH_KLOG "/proc/kmsg"
+#define _PATH_KMEM "/dev/kmem"
+#define _PATH_LASTLOG "/var/log/lastlog"
+#define _PATH_MAILDIR "/var/mail"
+#define _PATH_MAN "/usr/share/man"
+#define _PATH_MEM "/dev/mem"
+#define _PATH_MNTTAB "/etc/fstab"
+#define _PATH_MOUNTED "/etc/mtab"
+#define _PATH_NOLOGIN "/etc/nologin"
+#define _PATH_PRESERVE "/var/lib"
+#define _PATH_RWHODIR "/var/spool/rwho"
+#define _PATH_SENDMAIL "/usr/sbin/sendmail"
+#define _PATH_SHADOW "/etc/shadow"
+#define _PATH_SHELLS "/etc/shells"
+#define _PATH_TTY "/dev/tty"
+#define _PATH_UNIX "/boot/vmlinux"
+#define _PATH_UTMP "/var/run/utmp"
+#define _PATH_VI "/usr/bin/vi"
+#define _PATH_WTMP "/var/log/wtmp"
+
+/* Provide trailing slash, since mostly used for building pathnames. */
+#define _PATH_DEV "/dev/"
+#define _PATH_TMP "/tmp/"
+#define _PATH_VARDB "/var/lib/misc/"
+#define _PATH_VARRUN "/var/run/"
+#define _PATH_VARTMP "/var/tmp/"
+
+#endif /* !_PATHS_H_ */
diff --git a/sysroot/usr/include/poll.h b/sysroot/usr/include/poll.h
new file mode 100644
index 0000000..06fb41a
--- /dev/null
+++ b/sysroot/usr/include/poll.h
@@ -0,0 +1 @@
+#include <sys/poll.h>
diff --git a/sysroot/usr/include/printf.h b/sysroot/usr/include/printf.h
new file mode 100644
index 0000000..360cdcc
--- /dev/null
+++ b/sysroot/usr/include/printf.h
@@ -0,0 +1,149 @@
+/* Copyright (C) 1991-1993,1995-1999,2000,2001,2006
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _PRINTF_H
+
+#define _PRINTF_H 1
+#include <features.h>
+
+__BEGIN_DECLS
+
+#define __need_FILE
+#include <stdio.h>
+#define __need_size_t
+#define __need_wchar_t
+#include <stddef.h>
+
+
+struct printf_info
+{
+ int prec; /* Precision. */
+ int width; /* Width. */
+ wchar_t spec; /* Format letter. */
+ unsigned int is_long_double:1;/* L flag. */
+ unsigned int is_short:1; /* h flag. */
+ unsigned int is_long:1; /* l flag. */
+ unsigned int alt:1; /* # flag. */
+ unsigned int space:1; /* Space flag. */
+ unsigned int left:1; /* - flag. */
+ unsigned int showsign:1; /* + flag. */
+ unsigned int group:1; /* ' flag. */
+ unsigned int extra:1; /* For special use. */
+ unsigned int is_char:1; /* hh flag. */
+ unsigned int wide:1; /* Nonzero for wide character streams. */
+ unsigned int i18n:1; /* I flag. */
+ wchar_t pad; /* Padding character. */
+};
+
+
+/* Type of a printf specifier-handler function.
+ STREAM is the FILE on which to write output.
+ INFO gives information about the format specification.
+ ARGS is a vector of pointers to the argument data;
+ the number of pointers will be the number returned
+ by the associated arginfo function for the same INFO.
+
+ The function should return the number of characters written,
+ or -1 for errors. */
+
+typedef int printf_function (FILE *__stream,
+ __const struct printf_info *__info,
+ __const void *__const *__args);
+
+/* Type of a printf specifier-arginfo function.
+ INFO gives information about the format specification.
+ N, ARGTYPES, and return value are as for parse_printf_format. */
+
+typedef int printf_arginfo_function (__const struct printf_info *__info,
+ size_t __n, int *__argtypes);
+
+
+/* Register FUNC to be called to format SPEC specifiers; ARGINFO must be
+ specified to determine how many arguments a SPEC conversion requires and
+ what their types are. */
+
+extern int register_printf_function (int __spec, printf_function __func,
+ printf_arginfo_function __arginfo);
+
+
+/* Parse FMT, and fill in N elements of ARGTYPES with the
+ types needed for the conversions FMT specifies. Returns
+ the number of arguments required by FMT.
+
+ The ARGINFO function registered with a user-defined format is passed a
+ `struct printf_info' describing the format spec being parsed. A width
+ or precision of INT_MIN means a `*' was used to indicate that the
+ width/precision will come from an arg. The function should fill in the
+ array it is passed with the types of the arguments it wants, and return
+ the number of arguments it wants. */
+
+extern size_t parse_printf_format (__const char *__restrict __fmt, size_t __n,
+ int *__restrict __argtypes) __THROW;
+
+
+/* Codes returned by `parse_printf_format' for basic types.
+
+ These values cover all the standard format specifications.
+ Users can add new values after PA_LAST for their own types. */
+
+enum
+{ /* C type: */
+ PA_INT, /* int */
+ PA_CHAR, /* int, cast to char */
+ PA_WCHAR, /* wide char */
+ PA_STRING, /* const char *, a '\0'-terminated string */
+ PA_WSTRING, /* const wchar_t *, wide character string */
+ PA_POINTER, /* void * */
+ PA_FLOAT, /* float */
+ PA_DOUBLE, /* double */
+ PA_LAST
+};
+
+/* Flag bits that can be set in a type returned by `parse_printf_format'. */
+#define PA_FLAG_MASK 0xff00
+#define PA_FLAG_LONG_LONG (1 << 8)
+#define PA_FLAG_LONG_DOUBLE PA_FLAG_LONG_LONG
+#define PA_FLAG_LONG (1 << 9)
+#define PA_FLAG_SHORT (1 << 10)
+#define PA_FLAG_PTR (1 << 11)
+
+
+
+/* Function which can be registered as `printf'-handlers. */
+
+/* Print floating point value using using abbreviations for the orders
+ of magnitude used for numbers ('k' for kilo, 'm' for mega etc). If
+ the format specifier is a uppercase character powers of 1000 are
+ used. Otherwise powers of 1024. */
+extern int printf_size (FILE *__restrict __fp,
+ __const struct printf_info *__info,
+ __const void *__const *__restrict __args) __THROW;
+
+/* This is the appropriate argument information function for `printf_size'. */
+extern int printf_size_info (__const struct printf_info *__restrict
+ __info, size_t __n, int *__restrict __argtypes)
+ __THROW;
+
+#ifdef __LDBL_COMPAT
+# include <bits/printf-ldbl.h>
+#endif
+
+__END_DECLS
+
+#endif /* printf.h */
diff --git a/sysroot/usr/include/protocols/routed.h b/sysroot/usr/include/protocols/routed.h
new file mode 100644
index 0000000..befd865
--- /dev/null
+++ b/sysroot/usr/include/protocols/routed.h
@@ -0,0 +1,101 @@
+/*-
+ * Copyright (c) 1983, 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)routed.h 8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _PROTOCOLS_ROUTED_H
+#define _PROTOCOLS_ROUTED_H 1
+
+#include <sys/socket.h>
+/*
+ * Routing Information Protocol
+ *
+ * Derived from Xerox NS Routing Information Protocol
+ * by changing 32-bit net numbers to sockaddr's and
+ * padding stuff to 32-bit boundaries.
+ */
+#define RIPVERSION 1
+
+struct netinfo {
+ struct sockaddr rip_dst; /* destination net/host */
+ int rip_metric; /* cost of route */
+};
+
+struct rip {
+ u_char rip_cmd; /* request/response */
+ u_char rip_vers; /* protocol version # */
+ u_char rip_res1[2]; /* pad to 32-bit boundary */
+ union {
+ struct netinfo ru_nets[1]; /* variable length... */
+ char ru_tracefile[1]; /* ditto ... */
+ } ripun;
+#define rip_nets ripun.ru_nets
+#define rip_tracefile ripun.ru_tracefile
+};
+
+/*
+ * Packet types.
+ */
+#define RIPCMD_REQUEST 1 /* want info */
+#define RIPCMD_RESPONSE 2 /* responding to request */
+#define RIPCMD_TRACEON 3 /* turn tracing on */
+#define RIPCMD_TRACEOFF 4 /* turn it off */
+
+#define RIPCMD_MAX 5
+#ifdef RIPCMDS
+char *ripcmds[RIPCMD_MAX] =
+ { "#0", "REQUEST", "RESPONSE", "TRACEON", "TRACEOFF" };
+#endif
+
+#define HOPCNT_INFINITY 16 /* per Xerox NS */
+#define MAXPACKETSIZE 512 /* max broadcast size */
+
+/*
+ * Timer values used in managing the routing table.
+ * Complete tables are broadcast every SUPPLY_INTERVAL seconds.
+ * If changes occur between updates, dynamic updates containing only changes
+ * may be sent. When these are sent, a timer is set for a random value
+ * between MIN_WAITTIME and MAX_WAITTIME, and no additional dynamic updates
+ * are sent until the timer expires.
+ *
+ * Every update of a routing entry forces an entry's timer to be reset.
+ * After EXPIRE_TIME without updates, the entry is marked invalid,
+ * but held onto until GARBAGE_TIME so that others may
+ * see it "be deleted".
+ */
+#define TIMER_RATE 30 /* alarm clocks every 30 seconds */
+
+#define SUPPLY_INTERVAL 30 /* time to supply tables */
+#define MIN_WAITTIME 2 /* min. interval to broadcast changes */
+#define MAX_WAITTIME 5 /* max. time to delay changes */
+
+#define EXPIRE_TIME 180 /* time to mark entry invalid */
+#define GARBAGE_TIME 240 /* time to garbage collect */
+
+#endif /* protocols/routed.h */
diff --git a/sysroot/usr/include/protocols/rwhod.h b/sysroot/usr/include/protocols/rwhod.h
new file mode 100644
index 0000000..446d6f9
--- /dev/null
+++ b/sysroot/usr/include/protocols/rwhod.h
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)rwhod.h 8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _PROTOCOLS_RWHOD_H
+#define _PROTOCOLS_RWHOD_H 1
+
+#include <sys/types.h>
+
+/*
+ * rwho protocol packet format.
+ */
+struct outmp {
+ char out_line[8]; /* tty name */
+ char out_name[8]; /* user id */
+ int32_t out_time; /* time on */
+};
+
+struct whod {
+ char wd_vers; /* protocol version # */
+ char wd_type; /* packet type, see below */
+ char wd_pad[2];
+ int wd_sendtime; /* time stamp by sender */
+ int wd_recvtime; /* time stamp applied by receiver */
+ char wd_hostname[32]; /* hosts's name */
+ int wd_loadav[3]; /* load average as in uptime */
+ int wd_boottime; /* time system booted */
+ struct whoent {
+ struct outmp we_utmp; /* active tty info */
+ int we_idle; /* tty idle time */
+ } wd_we[1024 / sizeof (struct whoent)];
+};
+
+#define WHODVERSION 1
+#define WHODTYPE_STATUS 1 /* host status */
+
+/* We used to define _PATH_RWHODIR here but it's now in <paths.h>. */
+#include <paths.h>
+
+#endif /* protocols/rwhod.h */
diff --git a/sysroot/usr/include/protocols/talkd.h b/sysroot/usr/include/protocols/talkd.h
new file mode 100644
index 0000000..a8f33b1
--- /dev/null
+++ b/sysroot/usr/include/protocols/talkd.h
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)talkd.h 8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _PROTOCOLS_TALKD_H
+#define _PROTOCOLS_TALKD_H 1
+
+/*
+ * This describes the protocol used by the talk server and clients.
+ *
+ * The talk server acts a repository of invitations, responding to
+ * requests by clients wishing to rendezvous for the purpose of
+ * holding a conversation. In normal operation, a client, the caller,
+ * initiates a rendezvous by sending a CTL_MSG to the server of
+ * type LOOK_UP. This causes the server to search its invitation
+ * tables to check if an invitation currently exists for the caller
+ * (to speak to the callee specified in the message). If the lookup
+ * fails, the caller then sends an ANNOUNCE message causing the server
+ * to broadcast an announcement on the callee's login ports requesting
+ * contact. When the callee responds, the local server uses the
+ * recorded invitation to respond with the appropriate rendezvous
+ * address and the caller and callee client programs establish a
+ * stream connection through which the conversation takes place.
+ */
+
+#include <sys/types.h>
+#include <sys/socket.h>
+
+/*
+ * Client->server request message format.
+ */
+typedef struct {
+ u_char vers; /* protocol version */
+ u_char type; /* request type, see below */
+ u_char answer; /* not used */
+ u_char pad;
+ u_int32_t id_num; /* message id */
+ struct osockaddr addr; /* old (4.3) style */
+ struct osockaddr ctl_addr; /* old (4.3) style */
+ int32_t pid; /* caller's process id */
+#define NAME_SIZE 12
+ char l_name[NAME_SIZE];/* caller's name */
+ char r_name[NAME_SIZE];/* callee's name */
+#define TTY_SIZE 16
+ char r_tty[TTY_SIZE];/* callee's tty name */
+} CTL_MSG;
+
+/*
+ * Server->client response message format.
+ */
+typedef struct {
+ u_char vers; /* protocol version */
+ u_char type; /* type of request message, see below */
+ u_char answer; /* response to request message, see below */
+ u_char pad;
+ u_int32_t id_num; /* message id */
+ struct osockaddr addr; /* address for establishing conversation */
+} CTL_RESPONSE;
+
+#define TALK_VERSION 1 /* protocol version */
+
+/* message type values */
+#define LEAVE_INVITE 0 /* leave invitation with server */
+#define LOOK_UP 1 /* check for invitation by callee */
+#define DELETE 2 /* delete invitation by caller */
+#define ANNOUNCE 3 /* announce invitation by caller */
+
+/* answer values */
+#define SUCCESS 0 /* operation completed properly */
+#define NOT_HERE 1 /* callee not logged in */
+#define FAILED 2 /* operation failed for unexplained reason */
+#define MACHINE_UNKNOWN 3 /* caller's machine name unknown */
+#define PERMISSION_DENIED 4 /* callee's tty doesn't permit announce */
+#define UNKNOWN_REQUEST 5 /* request has invalid type value */
+#define BADVERSION 6 /* request has invalid protocol version */
+#define BADADDR 7 /* request has invalid addr value */
+#define BADCTLADDR 8 /* request has invalid ctl_addr value */
+
+/*
+ * Operational parameters.
+ */
+#define MAX_LIFE 60 /* max time daemon saves invitations */
+/* RING_WAIT should be 10's of seconds less than MAX_LIFE */
+#define RING_WAIT 30 /* time to wait before resending invitation */
+
+#endif /* protocols/talkd.h */
diff --git a/sysroot/usr/include/protocols/timed.h b/sysroot/usr/include/protocols/timed.h
new file mode 100644
index 0000000..4345bed
--- /dev/null
+++ b/sysroot/usr/include/protocols/timed.h
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)timed.h 8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _PROTOCOLS_TIMED_H
+#define _PROTOCOLS_TIMED_H 1
+
+#include <rpc/types.h>
+
+/*
+ * Time Synchronization Protocol
+ */
+
+#define TSPVERSION 1
+#define ANYADDR NULL
+
+struct tsp {
+ u_char tsp_type;
+ u_char tsp_vers;
+ u_short tsp_seq;
+ union {
+ struct timeval tspu_time;
+ char tspu_hopcnt;
+ } tsp_u;
+ char tsp_name[MAXHOSTNAMELEN];
+};
+
+#define tsp_time tsp_u.tspu_time
+#define tsp_hopcnt tsp_u.tspu_hopcnt
+
+/*
+ * Command types.
+ */
+#define TSP_ANY 0 /* match any types */
+#define TSP_ADJTIME 1 /* send adjtime */
+#define TSP_ACK 2 /* generic acknowledgement */
+#define TSP_MASTERREQ 3 /* ask for master's name */
+#define TSP_MASTERACK 4 /* acknowledge master request */
+#define TSP_SETTIME 5 /* send network time */
+#define TSP_MASTERUP 6 /* inform slaves that master is up */
+#define TSP_SLAVEUP 7 /* slave is up but not polled */
+#define TSP_ELECTION 8 /* advance candidature for master */
+#define TSP_ACCEPT 9 /* support candidature of master */
+#define TSP_REFUSE 10 /* reject candidature of master */
+#define TSP_CONFLICT 11 /* two or more masters present */
+#define TSP_RESOLVE 12 /* masters' conflict resolution */
+#define TSP_QUIT 13 /* reject candidature if master is up */
+#define TSP_DATE 14 /* reset the time (date command) */
+#define TSP_DATEREQ 15 /* remote request to reset the time */
+#define TSP_DATEACK 16 /* acknowledge time setting */
+#define TSP_TRACEON 17 /* turn tracing on */
+#define TSP_TRACEOFF 18 /* turn tracing off */
+#define TSP_MSITE 19 /* find out master's site */
+#define TSP_MSITEREQ 20 /* remote master's site request */
+#define TSP_TEST 21 /* for testing election algo */
+#define TSP_SETDATE 22 /* New from date command */
+#define TSP_SETDATEREQ 23 /* New remote for above */
+#define TSP_LOOP 24 /* loop detection packet */
+
+#define TSPTYPENUMBER 25
+
+#ifdef TSPTYPES
+char *tsptype[TSPTYPENUMBER] =
+ { "ANY", "ADJTIME", "ACK", "MASTERREQ", "MASTERACK", "SETTIME", "MASTERUP",
+ "SLAVEUP", "ELECTION", "ACCEPT", "REFUSE", "CONFLICT", "RESOLVE", "QUIT",
+ "DATE", "DATEREQ", "DATEACK", "TRACEON", "TRACEOFF", "MSITE", "MSITEREQ",
+ "TEST", "SETDATE", "SETDATEREQ", "LOOP" };
+#endif
+
+#endif /* protocols/timed.h */
diff --git a/sysroot/usr/include/pthread.h b/sysroot/usr/include/pthread.h
new file mode 100644
index 0000000..d175f31
--- /dev/null
+++ b/sysroot/usr/include/pthread.h
@@ -0,0 +1,1119 @@
+/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _PTHREAD_H
+#define _PTHREAD_H 1
+
+#include <features.h>
+#include <endian.h>
+#include <sched.h>
+#include <time.h>
+
+#define __need_sigset_t
+#include <signal.h>
+#include <bits/pthreadtypes.h>
+#include <bits/setjmp.h>
+#include <bits/wordsize.h>
+
+
+/* Detach state. */
+enum
+{
+ PTHREAD_CREATE_JOINABLE,
+#define PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_JOINABLE
+ PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED PTHREAD_CREATE_DETACHED
+};
+
+
+/* Mutex types. */
+enum
+{
+ PTHREAD_MUTEX_TIMED_NP,
+ PTHREAD_MUTEX_RECURSIVE_NP,
+ PTHREAD_MUTEX_ERRORCHECK_NP,
+ PTHREAD_MUTEX_ADAPTIVE_NP
+#ifdef __USE_UNIX98
+ ,
+ PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP,
+ PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP,
+ PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP,
+ PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL
+#endif
+#ifdef __USE_GNU
+ /* For compatibility. */
+ , PTHREAD_MUTEX_FAST_NP = PTHREAD_MUTEX_TIMED_NP
+#endif
+};
+
+
+#ifdef __USE_GNU
+/* Robust mutex or not flags. */
+enum
+{
+ PTHREAD_MUTEX_STALLED_NP,
+ PTHREAD_MUTEX_ROBUST_NP
+};
+#endif
+
+
+#ifdef __USE_UNIX98
+/* Mutex protocols. */
+enum
+{
+ PTHREAD_PRIO_NONE,
+ PTHREAD_PRIO_INHERIT,
+ PTHREAD_PRIO_PROTECT
+};
+#endif
+
+
+/* Mutex initializers. */
+#if __WORDSIZE == 64
+# define PTHREAD_MUTEX_INITIALIZER \
+ { { 0, 0, 0, 0, 0, 0, { 0, 0 } } }
+# ifdef __USE_GNU
+# define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
+ { { 0, 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0, { 0, 0 } } }
+# define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
+ { { 0, 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, 0, { 0, 0 } } }
+# define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \
+ { { 0, 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, 0, { 0, 0 } } }
+# endif
+#else
+# define PTHREAD_MUTEX_INITIALIZER \
+ { { 0, 0, 0, 0, 0, { 0 } } }
+# ifdef __USE_GNU
+# define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
+ { { 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0, { 0 } } }
+# define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
+ { { 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, 0, { 0 } } }
+# define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \
+ { { 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, 0, { 0 } } }
+# endif
+#endif
+
+
+/* Read-write lock types. */
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K
+enum
+{
+ PTHREAD_RWLOCK_PREFER_READER_NP,
+ PTHREAD_RWLOCK_PREFER_WRITER_NP,
+ PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,
+ PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_READER_NP
+};
+
+/* Read-write lock initializers. */
+# define PTHREAD_RWLOCK_INITIALIZER \
+ { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }
+# ifdef __USE_GNU
+# if __WORDSIZE == 64
+# define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
+ { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
+ PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } }
+# else
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+# define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
+ { { 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, \
+ 0, 0, 0, 0 } }
+# else
+# define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
+ { { 0, 0, 0, 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,\
+ 0 } }
+# endif
+# endif
+# endif
+#endif /* Unix98 or XOpen2K */
+
+
+/* Scheduler inheritance. */
+enum
+{
+ PTHREAD_INHERIT_SCHED,
+#define PTHREAD_INHERIT_SCHED PTHREAD_INHERIT_SCHED
+ PTHREAD_EXPLICIT_SCHED
+#define PTHREAD_EXPLICIT_SCHED PTHREAD_EXPLICIT_SCHED
+};
+
+
+/* Scope handling. */
+enum
+{
+ PTHREAD_SCOPE_SYSTEM,
+#define PTHREAD_SCOPE_SYSTEM PTHREAD_SCOPE_SYSTEM
+ PTHREAD_SCOPE_PROCESS
+#define PTHREAD_SCOPE_PROCESS PTHREAD_SCOPE_PROCESS
+};
+
+
+/* Process shared or private flag. */
+enum
+{
+ PTHREAD_PROCESS_PRIVATE,
+#define PTHREAD_PROCESS_PRIVATE PTHREAD_PROCESS_PRIVATE
+ PTHREAD_PROCESS_SHARED
+#define PTHREAD_PROCESS_SHARED PTHREAD_PROCESS_SHARED
+};
+
+
+
+/* Conditional variable handling. */
+#define PTHREAD_COND_INITIALIZER { { 0, 0, 0, 0, 0, (void *) 0, 0, 0 } }
+
+
+/* Cleanup buffers */
+struct _pthread_cleanup_buffer
+{
+ void (*__routine) (void *); /* Function to call. */
+ void *__arg; /* Its argument. */
+ int __canceltype; /* Saved cancellation type. */
+ struct _pthread_cleanup_buffer *__prev; /* Chaining of cleanup functions. */
+};
+
+/* Cancellation */
+enum
+{
+ PTHREAD_CANCEL_ENABLE,
+#define PTHREAD_CANCEL_ENABLE PTHREAD_CANCEL_ENABLE
+ PTHREAD_CANCEL_DISABLE
+#define PTHREAD_CANCEL_DISABLE PTHREAD_CANCEL_DISABLE
+};
+enum
+{
+ PTHREAD_CANCEL_DEFERRED,
+#define PTHREAD_CANCEL_DEFERRED PTHREAD_CANCEL_DEFERRED
+ PTHREAD_CANCEL_ASYNCHRONOUS
+#define PTHREAD_CANCEL_ASYNCHRONOUS PTHREAD_CANCEL_ASYNCHRONOUS
+};
+#define PTHREAD_CANCELED ((void *) -1)
+
+
+/* Single execution handling. */
+#define PTHREAD_ONCE_INIT 0
+
+
+#ifdef __USE_XOPEN2K
+/* Value returned by 'pthread_barrier_wait' for one of the threads after
+ the required number of threads have called this function.
+ -1 is distinct from 0 and all errno constants */
+# define PTHREAD_BARRIER_SERIAL_THREAD -1
+#endif
+
+
+__BEGIN_DECLS
+
+/* Create a new thread, starting with execution of START-ROUTINE
+ getting passed ARG. Creation attributed come from ATTR. The new
+ handle is stored in *NEWTHREAD. */
+extern int pthread_create (pthread_t *__restrict __newthread,
+ __const pthread_attr_t *__restrict __attr,
+ void *(*__start_routine) (void *),
+ void *__restrict __arg) __THROW __nonnull ((1, 3));
+
+/* Terminate calling thread.
+
+ The registered cleanup handlers are called via exception handling
+ so we cannot mark this function with __THROW.*/
+extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__));
+
+/* Make calling thread wait for termination of the thread TH. The
+ exit status of the thread is stored in *THREAD_RETURN, if THREAD_RETURN
+ is not NULL.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int pthread_join (pthread_t __th, void **__thread_return);
+
+#ifdef __USE_GNU
+/* Check whether thread TH has terminated. If yes return the status of
+ the thread in *THREAD_RETURN, if THREAD_RETURN is not NULL. */
+extern int pthread_tryjoin_np (pthread_t __th, void **__thread_return) __THROW;
+
+/* Make calling thread wait for termination of the thread TH, but only
+ until TIMEOUT. The exit status of the thread is stored in
+ *THREAD_RETURN, if THREAD_RETURN is not NULL.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int pthread_timedjoin_np (pthread_t __th, void **__thread_return,
+ __const struct timespec *__abstime);
+#endif
+
+/* Indicate that the thread TH is never to be joined with PTHREAD_JOIN.
+ The resources of TH will therefore be freed immediately when it
+ terminates, instead of waiting for another thread to perform PTHREAD_JOIN
+ on it. */
+extern int pthread_detach (pthread_t __th) __THROW;
+
+
+/* Obtain the identifier of the current thread. */
+extern pthread_t pthread_self (void) __THROW __attribute__ ((__const__));
+
+/* Compare two thread identifiers. */
+extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) __THROW;
+
+
+/* Thread attribute handling. */
+
+/* Initialize thread attribute *ATTR with default attributes
+ (detachstate is PTHREAD_JOINABLE, scheduling policy is SCHED_OTHER,
+ no user-provided stack). */
+extern int pthread_attr_init (pthread_attr_t *__attr) __THROW __nonnull ((1));
+
+/* Destroy thread attribute *ATTR. */
+extern int pthread_attr_destroy (pthread_attr_t *__attr)
+ __THROW __nonnull ((1));
+
+/* Get detach state attribute. */
+extern int pthread_attr_getdetachstate (__const pthread_attr_t *__attr,
+ int *__detachstate)
+ __THROW __nonnull ((1, 2));
+
+/* Set detach state attribute. */
+extern int pthread_attr_setdetachstate (pthread_attr_t *__attr,
+ int __detachstate)
+ __THROW __nonnull ((1));
+
+
+/* Get the size of the guard area created for stack overflow protection. */
+extern int pthread_attr_getguardsize (__const pthread_attr_t *__attr,
+ size_t *__guardsize)
+ __THROW __nonnull ((1, 2));
+
+/* Set the size of the guard area created for stack overflow protection. */
+extern int pthread_attr_setguardsize (pthread_attr_t *__attr,
+ size_t __guardsize)
+ __THROW __nonnull ((1));
+
+
+/* Return in *PARAM the scheduling parameters of *ATTR. */
+extern int pthread_attr_getschedparam (__const pthread_attr_t *__restrict
+ __attr,
+ struct sched_param *__restrict __param)
+ __THROW __nonnull ((1, 2));
+
+/* Set scheduling parameters (priority, etc) in *ATTR according to PARAM. */
+extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr,
+ __const struct sched_param *__restrict
+ __param) __THROW __nonnull ((1, 2));
+
+/* Return in *POLICY the scheduling policy of *ATTR. */
+extern int pthread_attr_getschedpolicy (__const pthread_attr_t *__restrict
+ __attr, int *__restrict __policy)
+ __THROW __nonnull ((1, 2));
+
+/* Set scheduling policy in *ATTR according to POLICY. */
+extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy)
+ __THROW __nonnull ((1));
+
+/* Return in *INHERIT the scheduling inheritance mode of *ATTR. */
+extern int pthread_attr_getinheritsched (__const pthread_attr_t *__restrict
+ __attr, int *__restrict __inherit)
+ __THROW __nonnull ((1, 2));
+
+/* Set scheduling inheritance mode in *ATTR according to INHERIT. */
+extern int pthread_attr_setinheritsched (pthread_attr_t *__attr,
+ int __inherit)
+ __THROW __nonnull ((1));
+
+
+/* Return in *SCOPE the scheduling contention scope of *ATTR. */
+extern int pthread_attr_getscope (__const pthread_attr_t *__restrict __attr,
+ int *__restrict __scope)
+ __THROW __nonnull ((1, 2));
+
+/* Set scheduling contention scope in *ATTR according to SCOPE. */
+extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope)
+ __THROW __nonnull ((1));
+
+/* Return the previously set address for the stack. */
+extern int pthread_attr_getstackaddr (__const pthread_attr_t *__restrict
+ __attr, void **__restrict __stackaddr)
+ __THROW __nonnull ((1, 2)) __attribute_deprecated__;
+
+/* Set the starting address of the stack of the thread to be created.
+ Depending on whether the stack grows up or down the value must either
+ be higher or lower than all the address in the memory block. The
+ minimal size of the block must be PTHREAD_STACK_MIN. */
+extern int pthread_attr_setstackaddr (pthread_attr_t *__attr,
+ void *__stackaddr)
+ __THROW __nonnull ((1)) __attribute_deprecated__;
+
+/* Return the currently used minimal stack size. */
+extern int pthread_attr_getstacksize (__const pthread_attr_t *__restrict
+ __attr, size_t *__restrict __stacksize)
+ __THROW __nonnull ((1, 2));
+
+/* Add information about the minimum stack size needed for the thread
+ to be started. This size must never be less than PTHREAD_STACK_MIN
+ and must also not exceed the system limits. */
+extern int pthread_attr_setstacksize (pthread_attr_t *__attr,
+ size_t __stacksize)
+ __THROW __nonnull ((1));
+
+#ifdef __USE_XOPEN2K
+/* Return the previously set address for the stack. */
+extern int pthread_attr_getstack (__const pthread_attr_t *__restrict __attr,
+ void **__restrict __stackaddr,
+ size_t *__restrict __stacksize)
+ __THROW __nonnull ((1, 2, 3));
+
+/* The following two interfaces are intended to replace the last two. They
+ require setting the address as well as the size since only setting the
+ address will make the implementation on some architectures impossible. */
+extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr,
+ size_t __stacksize) __THROW __nonnull ((1));
+#endif
+
+#ifdef __USE_GNU
+/* Thread created with attribute ATTR will be limited to run only on
+ the processors represented in CPUSET. */
+extern int pthread_attr_setaffinity_np (pthread_attr_t *__attr,
+ size_t __cpusetsize,
+ __const cpu_set_t *__cpuset)
+ __THROW __nonnull ((1, 3));
+
+/* Get bit set in CPUSET representing the processors threads created with
+ ATTR can run on. */
+extern int pthread_attr_getaffinity_np (__const pthread_attr_t *__attr,
+ size_t __cpusetsize,
+ cpu_set_t *__cpuset)
+ __THROW __nonnull ((1, 3));
+
+
+/* Initialize thread attribute *ATTR with attributes corresponding to the
+ already running thread TH. It shall be called on unitialized ATTR
+ and destroyed with pthread_attr_destroy when no longer needed. */
+extern int pthread_getattr_np (pthread_t __th, pthread_attr_t *__attr)
+ __THROW __nonnull ((2));
+#endif
+
+
+/* Functions for scheduling control. */
+
+/* Set the scheduling parameters for TARGET_THREAD according to POLICY
+ and *PARAM. */
+extern int pthread_setschedparam (pthread_t __target_thread, int __policy,
+ __const struct sched_param *__param)
+ __THROW __nonnull ((3));
+
+/* Return in *POLICY and *PARAM the scheduling parameters for TARGET_THREAD. */
+extern int pthread_getschedparam (pthread_t __target_thread,
+ int *__restrict __policy,
+ struct sched_param *__restrict __param)
+ __THROW __nonnull ((2, 3));
+
+/* Set the scheduling priority for TARGET_THREAD. */
+extern int pthread_setschedprio (pthread_t __target_thread, int __prio)
+ __THROW;
+
+
+#ifdef __USE_UNIX98
+/* Determine level of concurrency. */
+extern int pthread_getconcurrency (void) __THROW;
+
+/* Set new concurrency level to LEVEL. */
+extern int pthread_setconcurrency (int __level) __THROW;
+#endif
+
+#ifdef __USE_GNU
+/* Yield the processor to another thread or process.
+ This function is similar to the POSIX `sched_yield' function but
+ might be differently implemented in the case of a m-on-n thread
+ implementation. */
+extern int pthread_yield (void) __THROW;
+
+
+/* Limit specified thread TH to run only on the processors represented
+ in CPUSET. */
+extern int pthread_setaffinity_np (pthread_t __th, size_t __cpusetsize,
+ __const cpu_set_t *__cpuset)
+ __THROW __nonnull ((3));
+
+/* Get bit set in CPUSET representing the processors TH can run on. */
+extern int pthread_getaffinity_np (pthread_t __th, size_t __cpusetsize,
+ cpu_set_t *__cpuset)
+ __THROW __nonnull ((3));
+#endif
+
+
+/* Functions for handling initialization. */
+
+/* Guarantee that the initialization function INIT_ROUTINE will be called
+ only once, even if pthread_once is executed several times with the
+ same ONCE_CONTROL argument. ONCE_CONTROL must point to a static or
+ extern variable initialized to PTHREAD_ONCE_INIT.
+
+ The initialization functions might throw exception which is why
+ this function is not marked with __THROW. */
+extern int pthread_once (pthread_once_t *__once_control,
+ void (*__init_routine) (void)) __nonnull ((1, 2));
+
+
+/* Functions for handling cancellation.
+
+ Note that these functions are explicitly not marked to not throw an
+ exception in C++ code. If cancellation is implemented by unwinding
+ this is necessary to have the compiler generate the unwind information. */
+
+/* Set cancelability state of current thread to STATE, returning old
+ state in *OLDSTATE if OLDSTATE is not NULL. */
+extern int pthread_setcancelstate (int __state, int *__oldstate);
+
+/* Set cancellation state of current thread to TYPE, returning the old
+ type in *OLDTYPE if OLDTYPE is not NULL. */
+extern int pthread_setcanceltype (int __type, int *__oldtype);
+
+/* Cancel THREAD immediately or at the next possibility. */
+extern int pthread_cancel (pthread_t __th);
+
+/* Test for pending cancellation for the current thread and terminate
+ the thread as per pthread_exit(PTHREAD_CANCELED) if it has been
+ cancelled. */
+extern void pthread_testcancel (void);
+
+
+/* Cancellation handling with integration into exception handling. */
+
+typedef struct
+{
+ struct
+ {
+ __jmp_buf __cancel_jmp_buf;
+ int __mask_was_saved;
+ } __cancel_jmp_buf[1];
+ void *__pad[4];
+} __pthread_unwind_buf_t __attribute__ ((__aligned__));
+
+/* No special attributes by default. */
+#ifndef __cleanup_fct_attribute
+# define __cleanup_fct_attribute
+#endif
+
+
+/* Structure to hold the cleanup handler information. */
+struct __pthread_cleanup_frame
+{
+ void (*__cancel_routine) (void *);
+ void *__cancel_arg;
+ int __do_it;
+ int __cancel_type;
+};
+
+#if defined __GNUC__ && defined __EXCEPTIONS
+# ifdef __cplusplus
+/* Class to handle cancellation handler invocation. */
+class __pthread_cleanup_class
+{
+ void (*__cancel_routine) (void *);
+ void *__cancel_arg;
+ int __do_it;
+ int __cancel_type;
+
+ public:
+ __pthread_cleanup_class (void (*__fct) (void *), void *__arg)
+ : __cancel_routine (__fct), __cancel_arg (__arg), __do_it (1) { }
+ ~__pthread_cleanup_class () { if (__do_it) __cancel_routine (__cancel_arg); }
+ void __setdoit (int __newval) { __do_it = __newval; }
+ void __defer () { pthread_setcanceltype (PTHREAD_CANCEL_DEFERRED,
+ &__cancel_type); }
+ void __restore () const { pthread_setcanceltype (__cancel_type, 0); }
+};
+
+/* Install a cleanup handler: ROUTINE will be called with arguments ARG
+ when the thread is canceled or calls pthread_exit. ROUTINE will also
+ be called with arguments ARG when the matching pthread_cleanup_pop
+ is executed with non-zero EXECUTE argument.
+
+ pthread_cleanup_push and pthread_cleanup_pop are macros and must always
+ be used in matching pairs at the same nesting level of braces. */
+# define pthread_cleanup_push(routine, arg) \
+ do { \
+ __pthread_cleanup_class __clframe (routine, arg)
+
+/* Remove a cleanup handler installed by the matching pthread_cleanup_push.
+ If EXECUTE is non-zero, the handler function is called. */
+# define pthread_cleanup_pop(execute) \
+ __clframe.__setdoit (execute); \
+ } while (0)
+
+# ifdef __USE_GNU
+/* Install a cleanup handler as pthread_cleanup_push does, but also
+ saves the current cancellation type and sets it to deferred
+ cancellation. */
+# define pthread_cleanup_push_defer_np(routine, arg) \
+ do { \
+ __pthread_cleanup_class __clframe (routine, arg); \
+ __clframe.__defer ()
+
+/* Remove a cleanup handler as pthread_cleanup_pop does, but also
+ restores the cancellation type that was in effect when the matching
+ pthread_cleanup_push_defer was called. */
+# define pthread_cleanup_pop_restore_np(execute) \
+ __clframe.__restore (); \
+ __clframe.__setdoit (execute); \
+ } while (0)
+# endif
+# else
+/* Function called to call the cleanup handler. As an extern inline
+ function the compiler is free to decide inlining the change when
+ needed or fall back on the copy which must exist somewhere
+ else. */
+__extern_inline void
+__pthread_cleanup_routine (struct __pthread_cleanup_frame *__frame)
+{
+ if (__frame->__do_it)
+ __frame->__cancel_routine (__frame->__cancel_arg);
+}
+
+/* Install a cleanup handler: ROUTINE will be called with arguments ARG
+ when the thread is canceled or calls pthread_exit. ROUTINE will also
+ be called with arguments ARG when the matching pthread_cleanup_pop
+ is executed with non-zero EXECUTE argument.
+
+ pthread_cleanup_push and pthread_cleanup_pop are macros and must always
+ be used in matching pairs at the same nesting level of braces. */
+# define pthread_cleanup_push(routine, arg) \
+ do { \
+ struct __pthread_cleanup_frame __clframe \
+ __attribute__ ((__cleanup__ (__pthread_cleanup_routine))) \
+ = { .__cancel_routine = (routine), .__cancel_arg = (arg), \
+ .__do_it = 1 };
+
+/* Remove a cleanup handler installed by the matching pthread_cleanup_push.
+ If EXECUTE is non-zero, the handler function is called. */
+# define pthread_cleanup_pop(execute) \
+ __clframe.__do_it = (execute); \
+ } while (0)
+
+# ifdef __USE_GNU
+/* Install a cleanup handler as pthread_cleanup_push does, but also
+ saves the current cancellation type and sets it to deferred
+ cancellation. */
+# define pthread_cleanup_push_defer_np(routine, arg) \
+ do { \
+ struct __pthread_cleanup_frame __clframe \
+ __attribute__ ((__cleanup__ (__pthread_cleanup_routine))) \
+ = { .__cancel_routine = (routine), .__cancel_arg = (arg), \
+ .__do_it = 1 }; \
+ (void) pthread_setcanceltype (PTHREAD_CANCEL_DEFERRED, \
+ &__clframe.__cancel_type)
+
+/* Remove a cleanup handler as pthread_cleanup_pop does, but also
+ restores the cancellation type that was in effect when the matching
+ pthread_cleanup_push_defer was called. */
+# define pthread_cleanup_pop_restore_np(execute) \
+ (void) pthread_setcanceltype (__clframe.__cancel_type, NULL); \
+ __clframe.__do_it = (execute); \
+ } while (0)
+# endif
+# endif
+#else
+/* Install a cleanup handler: ROUTINE will be called with arguments ARG
+ when the thread is canceled or calls pthread_exit. ROUTINE will also
+ be called with arguments ARG when the matching pthread_cleanup_pop
+ is executed with non-zero EXECUTE argument.
+
+ pthread_cleanup_push and pthread_cleanup_pop are macros and must always
+ be used in matching pairs at the same nesting level of braces. */
+# define pthread_cleanup_push(routine, arg) \
+ do { \
+ __pthread_unwind_buf_t __cancel_buf; \
+ void (*__cancel_routine) (void *) = (routine); \
+ void *__cancel_arg = (arg); \
+ int not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) \
+ __cancel_buf.__cancel_jmp_buf, 0); \
+ if (__builtin_expect (not_first_call, 0)) \
+ { \
+ __cancel_routine (__cancel_arg); \
+ __pthread_unwind_next (&__cancel_buf); \
+ /* NOTREACHED */ \
+ } \
+ \
+ __pthread_register_cancel (&__cancel_buf); \
+ do {
+extern void __pthread_register_cancel (__pthread_unwind_buf_t *__buf)
+ __cleanup_fct_attribute;
+
+/* Remove a cleanup handler installed by the matching pthread_cleanup_push.
+ If EXECUTE is non-zero, the handler function is called. */
+# define pthread_cleanup_pop(execute) \
+ } while (0); \
+ __pthread_unregister_cancel (&__cancel_buf); \
+ if (execute) \
+ __cancel_routine (__cancel_arg); \
+ } while (0)
+extern void __pthread_unregister_cancel (__pthread_unwind_buf_t *__buf)
+ __cleanup_fct_attribute;
+
+# ifdef __USE_GNU
+/* Install a cleanup handler as pthread_cleanup_push does, but also
+ saves the current cancellation type and sets it to deferred
+ cancellation. */
+# define pthread_cleanup_push_defer_np(routine, arg) \
+ do { \
+ __pthread_unwind_buf_t __cancel_buf; \
+ void (*__cancel_routine) (void *) = (routine); \
+ void *__cancel_arg = (arg); \
+ int not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) \
+ __cancel_buf.__cancel_jmp_buf, 0); \
+ if (__builtin_expect (not_first_call, 0)) \
+ { \
+ __cancel_routine (__cancel_arg); \
+ __pthread_unwind_next (&__cancel_buf); \
+ /* NOTREACHED */ \
+ } \
+ \
+ __pthread_register_cancel_defer (&__cancel_buf); \
+ do {
+extern void __pthread_register_cancel_defer (__pthread_unwind_buf_t *__buf)
+ __cleanup_fct_attribute;
+
+/* Remove a cleanup handler as pthread_cleanup_pop does, but also
+ restores the cancellation type that was in effect when the matching
+ pthread_cleanup_push_defer was called. */
+# define pthread_cleanup_pop_restore_np(execute) \
+ } while (0); \
+ __pthread_unregister_cancel_restore (&__cancel_buf); \
+ if (execute) \
+ __cancel_routine (__cancel_arg); \
+ } while (0)
+extern void __pthread_unregister_cancel_restore (__pthread_unwind_buf_t *__buf)
+ __cleanup_fct_attribute;
+# endif
+
+/* Internal interface to initiate cleanup. */
+extern void __pthread_unwind_next (__pthread_unwind_buf_t *__buf)
+ __cleanup_fct_attribute __attribute__ ((__noreturn__))
+# ifndef SHARED
+ __attribute__ ((__weak__))
+# endif
+ ;
+#endif
+
+/* Function used in the macros. */
+struct __jmp_buf_tag;
+extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __THROW;
+
+
+/* Mutex handling. */
+
+/* Initialize a mutex. */
+extern int pthread_mutex_init (pthread_mutex_t *__mutex,
+ __const pthread_mutexattr_t *__mutexattr)
+ __THROW __nonnull ((1));
+
+/* Destroy a mutex. */
+extern int pthread_mutex_destroy (pthread_mutex_t *__mutex)
+ __THROW __nonnull ((1));
+
+/* Try locking a mutex. */
+extern int pthread_mutex_trylock (pthread_mutex_t *__mutex)
+ __THROW __nonnull ((1));
+
+/* Lock a mutex. */
+extern int pthread_mutex_lock (pthread_mutex_t *__mutex)
+ __THROW __nonnull ((1));
+
+#ifdef __USE_XOPEN2K
+/* Wait until lock becomes available, or specified time passes. */
+extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
+ __const struct timespec *__restrict
+ __abstime) __THROW __nonnull ((1, 2));
+#endif
+
+/* Unlock a mutex. */
+extern int pthread_mutex_unlock (pthread_mutex_t *__mutex)
+ __THROW __nonnull ((1));
+
+
+#ifdef __USE_UNIX98
+/* Get the priority ceiling of MUTEX. */
+extern int pthread_mutex_getprioceiling (__const pthread_mutex_t *
+ __restrict __mutex,
+ int *__restrict __prioceiling)
+ __THROW __nonnull ((1, 2));
+
+/* Set the priority ceiling of MUTEX to PRIOCEILING, return old
+ priority ceiling value in *OLD_CEILING. */
+extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex,
+ int __prioceiling,
+ int *__restrict __old_ceiling)
+ __THROW __nonnull ((1, 3));
+#endif
+
+
+#ifdef __USE_GNU
+/* Declare the state protected by MUTEX as consistent. */
+extern int pthread_mutex_consistent_np (pthread_mutex_t *__mutex)
+ __THROW __nonnull ((1));
+#endif
+
+
+/* Functions for handling mutex attributes. */
+
+/* Initialize mutex attribute object ATTR with default attributes
+ (kind is PTHREAD_MUTEX_TIMED_NP). */
+extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr)
+ __THROW __nonnull ((1));
+
+/* Destroy mutex attribute object ATTR. */
+extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr)
+ __THROW __nonnull ((1));
+
+/* Get the process-shared flag of the mutex attribute ATTR. */
+extern int pthread_mutexattr_getpshared (__const pthread_mutexattr_t *
+ __restrict __attr,
+ int *__restrict __pshared)
+ __THROW __nonnull ((1, 2));
+
+/* Set the process-shared flag of the mutex attribute ATTR. */
+extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr,
+ int __pshared)
+ __THROW __nonnull ((1));
+
+#ifdef __USE_UNIX98
+/* Return in *KIND the mutex kind attribute in *ATTR. */
+extern int pthread_mutexattr_gettype (__const pthread_mutexattr_t *__restrict
+ __attr, int *__restrict __kind)
+ __THROW __nonnull ((1, 2));
+
+/* Set the mutex kind attribute in *ATTR to KIND (either PTHREAD_MUTEX_NORMAL,
+ PTHREAD_MUTEX_RECURSIVE, PTHREAD_MUTEX_ERRORCHECK, or
+ PTHREAD_MUTEX_DEFAULT). */
+extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind)
+ __THROW __nonnull ((1));
+
+/* Return in *PROTOCOL the mutex protocol attribute in *ATTR. */
+extern int pthread_mutexattr_getprotocol (__const pthread_mutexattr_t *
+ __restrict __attr,
+ int *__restrict __protocol)
+ __THROW __nonnull ((1, 2));
+
+/* Set the mutex protocol attribute in *ATTR to PROTOCOL (either
+ PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT, or PTHREAD_PRIO_PROTECT). */
+extern int pthread_mutexattr_setprotocol (pthread_mutexattr_t *__attr,
+ int __protocol)
+ __THROW __nonnull ((1));
+
+/* Return in *PRIOCEILING the mutex prioceiling attribute in *ATTR. */
+extern int pthread_mutexattr_getprioceiling (__const pthread_mutexattr_t *
+ __restrict __attr,
+ int *__restrict __prioceiling)
+ __THROW __nonnull ((1, 2));
+
+/* Set the mutex prioceiling attribute in *ATTR to PRIOCEILING. */
+extern int pthread_mutexattr_setprioceiling (pthread_mutexattr_t *__attr,
+ int __prioceiling)
+ __THROW __nonnull ((1));
+#endif
+
+#ifdef __USE_GNU
+/* Get the robustness flag of the mutex attribute ATTR. */
+extern int pthread_mutexattr_getrobust_np (__const pthread_mutexattr_t *__attr,
+ int *__robustness)
+ __THROW __nonnull ((1, 2));
+
+/* Set the robustness flag of the mutex attribute ATTR. */
+extern int pthread_mutexattr_setrobust_np (pthread_mutexattr_t *__attr,
+ int __robustness)
+ __THROW __nonnull ((1));
+#endif
+
+
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K
+/* Functions for handling read-write locks. */
+
+/* Initialize read-write lock RWLOCK using attributes ATTR, or use
+ the default values if later is NULL. */
+extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock,
+ __const pthread_rwlockattr_t *__restrict
+ __attr) __THROW __nonnull ((1));
+
+/* Destroy read-write lock RWLOCK. */
+extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock)
+ __THROW __nonnull ((1));
+
+/* Acquire read lock for RWLOCK. */
+extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock)
+ __THROW __nonnull ((1));
+
+/* Try to acquire read lock for RWLOCK. */
+extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock)
+ __THROW __nonnull ((1));
+
+# ifdef __USE_XOPEN2K
+/* Try to acquire read lock for RWLOCK or return after specfied time. */
+extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
+ __const struct timespec *__restrict
+ __abstime) __THROW __nonnull ((1, 2));
+# endif
+
+/* Acquire write lock for RWLOCK. */
+extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock)
+ __THROW __nonnull ((1));
+
+/* Try to acquire write lock for RWLOCK. */
+extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock)
+ __THROW __nonnull ((1));
+
+# ifdef __USE_XOPEN2K
+/* Try to acquire write lock for RWLOCK or return after specfied time. */
+extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,
+ __const struct timespec *__restrict
+ __abstime) __THROW __nonnull ((1, 2));
+# endif
+
+/* Unlock RWLOCK. */
+extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock)
+ __THROW __nonnull ((1));
+
+
+/* Functions for handling read-write lock attributes. */
+
+/* Initialize attribute object ATTR with default values. */
+extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr)
+ __THROW __nonnull ((1));
+
+/* Destroy attribute object ATTR. */
+extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr)
+ __THROW __nonnull ((1));
+
+/* Return current setting of process-shared attribute of ATTR in PSHARED. */
+extern int pthread_rwlockattr_getpshared (__const pthread_rwlockattr_t *
+ __restrict __attr,
+ int *__restrict __pshared)
+ __THROW __nonnull ((1, 2));
+
+/* Set process-shared attribute of ATTR to PSHARED. */
+extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr,
+ int __pshared)
+ __THROW __nonnull ((1));
+
+/* Return current setting of reader/writer preference. */
+extern int pthread_rwlockattr_getkind_np (__const pthread_rwlockattr_t *
+ __restrict __attr,
+ int *__restrict __pref)
+ __THROW __nonnull ((1, 2));
+
+/* Set reader/write preference. */
+extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr,
+ int __pref) __THROW __nonnull ((1));
+#endif
+
+
+/* Functions for handling conditional variables. */
+
+/* Initialize condition variable COND using attributes ATTR, or use
+ the default values if later is NULL. */
+extern int pthread_cond_init (pthread_cond_t *__restrict __cond,
+ __const pthread_condattr_t *__restrict
+ __cond_attr) __THROW __nonnull ((1));
+
+/* Destroy condition variable COND. */
+extern int pthread_cond_destroy (pthread_cond_t *__cond)
+ __THROW __nonnull ((1));
+
+/* Wake up one thread waiting for condition variable COND. */
+extern int pthread_cond_signal (pthread_cond_t *__cond)
+ __THROW __nonnull ((1));
+
+/* Wake up all threads waiting for condition variables COND. */
+extern int pthread_cond_broadcast (pthread_cond_t *__cond)
+ __THROW __nonnull ((1));
+
+/* Wait for condition variable COND to be signaled or broadcast.
+ MUTEX is assumed to be locked before.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int pthread_cond_wait (pthread_cond_t *__restrict __cond,
+ pthread_mutex_t *__restrict __mutex)
+ __nonnull ((1, 2));
+
+/* Wait for condition variable COND to be signaled or broadcast until
+ ABSTIME. MUTEX is assumed to be locked before. ABSTIME is an
+ absolute time specification; zero is the beginning of the epoch
+ (00:00:00 GMT, January 1, 1970).
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
+ pthread_mutex_t *__restrict __mutex,
+ __const struct timespec *__restrict
+ __abstime) __nonnull ((1, 2, 3));
+
+/* Functions for handling condition variable attributes. */
+
+/* Initialize condition variable attribute ATTR. */
+extern int pthread_condattr_init (pthread_condattr_t *__attr)
+ __THROW __nonnull ((1));
+
+/* Destroy condition variable attribute ATTR. */
+extern int pthread_condattr_destroy (pthread_condattr_t *__attr)
+ __THROW __nonnull ((1));
+
+/* Get the process-shared flag of the condition variable attribute ATTR. */
+extern int pthread_condattr_getpshared (__const pthread_condattr_t *
+ __restrict __attr,
+ int *__restrict __pshared)
+ __THROW __nonnull ((1, 2));
+
+/* Set the process-shared flag of the condition variable attribute ATTR. */
+extern int pthread_condattr_setpshared (pthread_condattr_t *__attr,
+ int __pshared) __THROW __nonnull ((1));
+
+#ifdef __USE_XOPEN2K
+/* Get the clock selected for the conditon variable attribute ATTR. */
+extern int pthread_condattr_getclock (__const pthread_condattr_t *
+ __restrict __attr,
+ __clockid_t *__restrict __clock_id)
+ __THROW __nonnull ((1, 2));
+
+/* Set the clock selected for the conditon variable attribute ATTR. */
+extern int pthread_condattr_setclock (pthread_condattr_t *__attr,
+ __clockid_t __clock_id)
+ __THROW __nonnull ((1));
+#endif
+
+
+#ifdef __USE_XOPEN2K
+/* Functions to handle spinlocks. */
+
+/* Initialize the spinlock LOCK. If PSHARED is nonzero the spinlock can
+ be shared between different processes. */
+extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared)
+ __THROW __nonnull ((1));
+
+/* Destroy the spinlock LOCK. */
+extern int pthread_spin_destroy (pthread_spinlock_t *__lock)
+ __THROW __nonnull ((1));
+
+/* Wait until spinlock LOCK is retrieved. */
+extern int pthread_spin_lock (pthread_spinlock_t *__lock)
+ __THROW __nonnull ((1));
+
+/* Try to lock spinlock LOCK. */
+extern int pthread_spin_trylock (pthread_spinlock_t *__lock)
+ __THROW __nonnull ((1));
+
+/* Release spinlock LOCK. */
+extern int pthread_spin_unlock (pthread_spinlock_t *__lock)
+ __THROW __nonnull ((1));
+
+
+/* Functions to handle barriers. */
+
+/* Initialize BARRIER with the attributes in ATTR. The barrier is
+ opened when COUNT waiters arrived. */
+extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier,
+ __const pthread_barrierattr_t *__restrict
+ __attr, unsigned int __count)
+ __THROW __nonnull ((1));
+
+/* Destroy a previously dynamically initialized barrier BARRIER. */
+extern int pthread_barrier_destroy (pthread_barrier_t *__barrier)
+ __THROW __nonnull ((1));
+
+/* Wait on barrier BARRIER. */
+extern int pthread_barrier_wait (pthread_barrier_t *__barrier)
+ __THROW __nonnull ((1));
+
+
+/* Initialize barrier attribute ATTR. */
+extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr)
+ __THROW __nonnull ((1));
+
+/* Destroy previously dynamically initialized barrier attribute ATTR. */
+extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr)
+ __THROW __nonnull ((1));
+
+/* Get the process-shared flag of the barrier attribute ATTR. */
+extern int pthread_barrierattr_getpshared (__const pthread_barrierattr_t *
+ __restrict __attr,
+ int *__restrict __pshared)
+ __THROW __nonnull ((1, 2));
+
+/* Set the process-shared flag of the barrier attribute ATTR. */
+extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr,
+ int __pshared)
+ __THROW __nonnull ((1));
+#endif
+
+
+/* Functions for handling thread-specific data. */
+
+/* Create a key value identifying a location in the thread-specific
+ data area. Each thread maintains a distinct thread-specific data
+ area. DESTR_FUNCTION, if non-NULL, is called with the value
+ associated to that key when the key is destroyed.
+ DESTR_FUNCTION is not called if the value associated is NULL when
+ the key is destroyed. */
+extern int pthread_key_create (pthread_key_t *__key,
+ void (*__destr_function) (void *))
+ __THROW __nonnull ((1));
+
+/* Destroy KEY. */
+extern int pthread_key_delete (pthread_key_t __key) __THROW;
+
+/* Return current value of the thread-specific data slot identified by KEY. */
+extern void *pthread_getspecific (pthread_key_t __key) __THROW;
+
+/* Store POINTER in the thread-specific data slot identified by KEY. */
+extern int pthread_setspecific (pthread_key_t __key,
+ __const void *__pointer) __THROW ;
+
+
+#ifdef __USE_XOPEN2K
+/* Get ID of CPU-time clock for thread THREAD_ID. */
+extern int pthread_getcpuclockid (pthread_t __thread_id,
+ __clockid_t *__clock_id)
+ __THROW __nonnull ((2));
+#endif
+
+
+/* Install handlers to be called when a new process is created with FORK.
+ The PREPARE handler is called in the parent process just before performing
+ FORK. The PARENT handler is called in the parent process just after FORK.
+ The CHILD handler is called in the child process. Each of the three
+ handlers can be NULL, meaning that no handler needs to be called at that
+ point.
+ PTHREAD_ATFORK can be called several times, in which case the PREPARE
+ handlers are called in LIFO order (last added with PTHREAD_ATFORK,
+ first called before FORK), and the PARENT and CHILD handlers are called
+ in FIFO (first added, first called). */
+
+extern int pthread_atfork (void (*__prepare) (void),
+ void (*__parent) (void),
+ void (*__child) (void)) __THROW;
+
+
+#ifdef __USE_EXTERN_INLINES
+/* Optimizations. */
+__extern_inline int
+__NTH (pthread_equal (pthread_t __thread1, pthread_t __thread2))
+{
+ return __thread1 == __thread2;
+}
+#endif
+
+__END_DECLS
+
+#endif /* pthread.h */
diff --git a/sysroot/usr/include/pty.h b/sysroot/usr/include/pty.h
new file mode 100644
index 0000000..2d4b5e2
--- /dev/null
+++ b/sysroot/usr/include/pty.h
@@ -0,0 +1,44 @@
+/* Functions for pseudo TTY handling.
+ Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _PTY_H
+#define _PTY_H 1
+
+#include <features.h>
+
+#include <termios.h>
+#include <sys/ioctl.h>
+
+
+__BEGIN_DECLS
+
+/* Create pseudo tty master slave pair with NAME and set terminal
+ attributes according to TERMP and WINP and return handles for both
+ ends in AMASTER and ASLAVE. */
+extern int openpty (int *__amaster, int *__aslave, char *__name,
+ struct termios *__termp, struct winsize *__winp) __THROW;
+
+/* Create child process and establish the slave pseudo terminal as the
+ child's controlling terminal. */
+extern int forkpty (int *__amaster, char *__name,
+ struct termios *__termp, struct winsize *__winp) __THROW;
+
+__END_DECLS
+
+#endif /* pty.h */
diff --git a/sysroot/usr/include/pulse/browser.h b/sysroot/usr/include/pulse/browser.h
new file mode 100644
index 0000000..c83d33a
--- /dev/null
+++ b/sysroot/usr/include/pulse/browser.h
@@ -0,0 +1,100 @@
+#ifndef foobrowserhfoo
+#define foobrowserhfoo
+
+/* $Id: browser.h 1426 2007-02-13 15:35:19Z ossman $ */
+
+/***
+ This file is part of PulseAudio.
+
+ Copyright 2004-2006 Lennart Poettering
+
+ PulseAudio is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ PulseAudio is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with PulseAudio; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+***/
+
+#include <pulse/mainloop-api.h>
+#include <pulse/sample.h>
+#include <pulse/channelmap.h>
+#include <pulse/cdecl.h>
+
+/** \file
+ * An abstract interface for Zeroconf browsing of PulseAudio servers */
+
+PA_C_DECL_BEGIN
+
+/** An opaque Zeroconf service browser object */
+typedef struct pa_browser pa_browser;
+
+/** Opcodes for pa_browser_cb_t callbacks */
+typedef enum pa_browse_opcode {
+ PA_BROWSE_NEW_SERVER = 0, /**< New server found */
+ PA_BROWSE_NEW_SINK, /**< New sink found */
+ PA_BROWSE_NEW_SOURCE, /**< New source found */
+ PA_BROWSE_REMOVE_SERVER, /**< Server disappeared */
+ PA_BROWSE_REMOVE_SINK, /**< Sink disappeared */
+ PA_BROWSE_REMOVE_SOURCE /**< Source disappeared */
+} pa_browse_opcode_t;
+
+typedef enum pa_browse_flags {
+ PA_BROWSE_FOR_SERVERS = 1, /**< Browse for servers */
+ PA_BROWSE_FOR_SINKS = 2, /**< Browse for sinks */
+ PA_BROWSE_FOR_SOURCES = 4 /** Browse for sources */
+} pa_browse_flags_t;
+
+/** Create a new browser object on the specified main loop */
+pa_browser *pa_browser_new(pa_mainloop_api *mainloop);
+
+/** Same pa_browser_new, but pass additional flags parameter. */
+pa_browser *pa_browser_new_full(pa_mainloop_api *mainloop, pa_browse_flags_t flags, const char **error_string);
+
+/** Increase reference counter of the specified browser object */
+pa_browser *pa_browser_ref(pa_browser *z);
+
+/** Decrease reference counter of the specified browser object */
+void pa_browser_unref(pa_browser *z);
+
+/** Information about a sink/source/server found with Zeroconf */
+typedef struct pa_browse_info {
+ const char *name; /**< Unique service name; always available */
+
+ const char *server; /**< Server name; always available */
+ const char *server_version; /**< Server version string; optional */
+ const char *user_name; /**< User name of the server process; optional */
+ const char *fqdn; /* Server version; optional */
+ const uint32_t *cookie; /* Server cookie; optional */
+
+ const char *device; /* Device name; always available when this information is of a sink/source */
+ const char *description; /* Device description; optional */
+ const pa_sample_spec *sample_spec; /* Sample specification of the device; optional */
+} pa_browse_info;
+
+/** Callback prototype */
+typedef void (*pa_browse_cb_t)(pa_browser *z, pa_browse_opcode_t c, const pa_browse_info *i, void *userdata);
+
+/** Set the callback pointer for the browser object */
+void pa_browser_set_callback(pa_browser *z, pa_browse_cb_t cb, void *userdata);
+
+/** Callback prototype for errors */
+typedef void (*pa_browser_error_cb_t)(pa_browser *z, const char *error_string, void *userdata);
+
+/** Set a callback function that is called whenever the browser object
+ * becomes invalid due to an error. After this function has been
+ * called the browser object has become invalid and should be
+ * freed. */
+void pa_browser_set_error_callback(pa_browser *z, pa_browser_error_cb_t, void *userdata);
+
+PA_C_DECL_END
+
+#endif
diff --git a/sysroot/usr/include/pulse/cdecl.h b/sysroot/usr/include/pulse/cdecl.h
new file mode 100644
index 0000000..bef191e
--- /dev/null
+++ b/sysroot/usr/include/pulse/cdecl.h
@@ -0,0 +1,62 @@
+#ifndef foopulsecdeclhfoo
+#define foopulsecdeclhfoo
+
+/* $Id: cdecl.h 1971 2007-10-28 19:13:50Z lennart $ */
+
+/***
+ This file is part of PulseAudio.
+
+ Copyright 2004-2006 Lennart Poettering
+
+ PulseAudio is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2 of the License,
+ or (at your option) any later version.
+
+ PulseAudio is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with PulseAudio; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+***/
+
+/** \file
+ * C++ compatibility support */
+
+#ifdef __cplusplus
+/** If using C++ this macro enables C mode, otherwise does nothing */
+#define PA_C_DECL_BEGIN extern "C" {
+/** If using C++ this macros switches back to C++ mode, otherwise does nothing */
+#define PA_C_DECL_END }
+
+#else
+/** If using C++ this macro enables C mode, otherwise does nothing */
+#define PA_C_DECL_BEGIN
+/** If using C++ this macros switches back to C++ mode, otherwise does nothing */
+#define PA_C_DECL_END
+
+#endif
+
+#ifndef PA_GCC_PURE
+#ifdef __GNUCC__
+#define PA_GCC_PURE __attribute__ ((pure))
+#else
+/** This function's return value depends only the arguments list and global state **/
+#define PA_GCC_PURE
+#endif
+#endif
+
+#ifndef PA_GCC_CONST
+#ifdef __GNUCC__
+#define PA_GCC_CONST __attribute__ ((pure))
+#else
+/** This function's return value depends only the arguments list (stricter version of PA_GCC_CONST) **/
+#define PA_GCC_CONST
+#endif
+#endif
+
+#endif
diff --git a/sysroot/usr/include/pulse/channelmap.h b/sysroot/usr/include/pulse/channelmap.h
new file mode 100644
index 0000000..9b8d2f9
--- /dev/null
+++ b/sysroot/usr/include/pulse/channelmap.h
@@ -0,0 +1,197 @@
+#ifndef foochannelmaphfoo
+#define foochannelmaphfoo
+
+/* $Id: channelmap.h 1971 2007-10-28 19:13:50Z lennart $ */
+
+/***
+ This file is part of PulseAudio.
+
+ Copyright 2005-2006 Lennart Poettering
+ Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
+
+ PulseAudio is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2 of the License,
+ or (at your option) any later version.
+
+ PulseAudio is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with PulseAudio; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+***/
+
+#include <pulse/sample.h>
+#include <pulse/cdecl.h>
+
+/** \page channelmap Channel Maps
+ *
+ * \section overv_sec Overview
+ *
+ * Channel maps provide a way to associate channels in a stream with a
+ * specific speaker position. This relieves applications of having to
+ * make sure their channel order is identical to the final output.
+ *
+ * \section init_sec Initialisation
+ *
+ * A channel map consists of an array of \ref pa_channel_position values,
+ * one for each channel. This array is stored together with a channel count
+ * in a pa_channel_map structure.
+ *
+ * Before filling the structure, the application must initialise it using
+ * pa_channel_map_init(). There are also a number of convenience functions
+ * for standard channel mappings:
+ *
+ * \li pa_channel_map_init_mono() - Create a channel map with only mono audio.
+ * \li pa_channel_map_init_stereo() - Create a standard stereo mapping.
+ * \li pa_channel_map_init_auto() - Create a standard channel map for up to
+ * six channels.
+ *
+ * \section conv_sec Convenience Functions
+ *
+ * The library contains a number of convenience functions for dealing with
+ * channel maps:
+ *
+ * \li pa_channel_map_valid() - Tests if a channel map is valid.
+ * \li pa_channel_map_equal() - Tests if two channel maps are identical.
+ * \li pa_channel_map_snprint() - Creates a textual description of a channel
+ * map.
+ */
+
+/** \file
+ * Constants and routines for channel mapping handling */
+
+PA_C_DECL_BEGIN
+
+/** A list of channel labels */
+typedef enum pa_channel_position {
+ PA_CHANNEL_POSITION_INVALID = -1,
+ PA_CHANNEL_POSITION_MONO = 0,
+
+ PA_CHANNEL_POSITION_LEFT,
+ PA_CHANNEL_POSITION_RIGHT,
+ PA_CHANNEL_POSITION_CENTER,
+
+ PA_CHANNEL_POSITION_FRONT_LEFT = PA_CHANNEL_POSITION_LEFT,
+ PA_CHANNEL_POSITION_FRONT_RIGHT = PA_CHANNEL_POSITION_RIGHT,
+ PA_CHANNEL_POSITION_FRONT_CENTER = PA_CHANNEL_POSITION_CENTER,
+
+ PA_CHANNEL_POSITION_REAR_CENTER,
+ PA_CHANNEL_POSITION_REAR_LEFT,
+ PA_CHANNEL_POSITION_REAR_RIGHT,
+
+ PA_CHANNEL_POSITION_LFE,
+ PA_CHANNEL_POSITION_SUBWOOFER = PA_CHANNEL_POSITION_LFE,
+
+ PA_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER,
+ PA_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER,
+
+ PA_CHANNEL_POSITION_SIDE_LEFT,
+ PA_CHANNEL_POSITION_SIDE_RIGHT,
+
+ PA_CHANNEL_POSITION_AUX0,
+ PA_CHANNEL_POSITION_AUX1,
+ PA_CHANNEL_POSITION_AUX2,
+ PA_CHANNEL_POSITION_AUX3,
+ PA_CHANNEL_POSITION_AUX4,
+ PA_CHANNEL_POSITION_AUX5,
+ PA_CHANNEL_POSITION_AUX6,
+ PA_CHANNEL_POSITION_AUX7,
+ PA_CHANNEL_POSITION_AUX8,
+ PA_CHANNEL_POSITION_AUX9,
+ PA_CHANNEL_POSITION_AUX10,
+ PA_CHANNEL_POSITION_AUX11,
+ PA_CHANNEL_POSITION_AUX12,
+ PA_CHANNEL_POSITION_AUX13,
+ PA_CHANNEL_POSITION_AUX14,
+ PA_CHANNEL_POSITION_AUX15,
+ PA_CHANNEL_POSITION_AUX16,
+ PA_CHANNEL_POSITION_AUX17,
+ PA_CHANNEL_POSITION_AUX18,
+ PA_CHANNEL_POSITION_AUX19,
+ PA_CHANNEL_POSITION_AUX20,
+ PA_CHANNEL_POSITION_AUX21,
+ PA_CHANNEL_POSITION_AUX22,
+ PA_CHANNEL_POSITION_AUX23,
+ PA_CHANNEL_POSITION_AUX24,
+ PA_CHANNEL_POSITION_AUX25,
+ PA_CHANNEL_POSITION_AUX26,
+ PA_CHANNEL_POSITION_AUX27,
+ PA_CHANNEL_POSITION_AUX28,
+ PA_CHANNEL_POSITION_AUX29,
+ PA_CHANNEL_POSITION_AUX30,
+ PA_CHANNEL_POSITION_AUX31,
+
+ PA_CHANNEL_POSITION_TOP_CENTER,
+
+ PA_CHANNEL_POSITION_TOP_FRONT_LEFT,
+ PA_CHANNEL_POSITION_TOP_FRONT_RIGHT,
+ PA_CHANNEL_POSITION_TOP_FRONT_CENTER,
+
+ PA_CHANNEL_POSITION_TOP_REAR_LEFT,
+ PA_CHANNEL_POSITION_TOP_REAR_RIGHT,
+ PA_CHANNEL_POSITION_TOP_REAR_CENTER,
+
+ PA_CHANNEL_POSITION_MAX
+} pa_channel_position_t;
+
+/** A list of channel mapping definitions for pa_channel_map_init_auto() */
+typedef enum pa_channel_map_def {
+ PA_CHANNEL_MAP_AIFF, /**< The mapping from RFC3551, which is based on AIFF-C */
+ PA_CHANNEL_MAP_ALSA, /**< The default mapping used by ALSA */
+ PA_CHANNEL_MAP_AUX, /**< Only aux channels */
+ PA_CHANNEL_MAP_WAVEEX, /**< Microsoft's WAVEFORMATEXTENSIBLE mapping */
+ PA_CHANNEL_MAP_OSS, /**< The default channel mapping used by OSS as defined in the OSS 4.0 API specs */
+
+ PA_CHANNEL_MAP_DEFAULT = PA_CHANNEL_MAP_AIFF /**< The default channel map */
+} pa_channel_map_def_t;
+
+/** A channel map which can be used to attach labels to specific
+ * channels of a stream. These values are relevant for conversion and
+ * mixing of streams */
+typedef struct pa_channel_map {
+ uint8_t channels; /**< Number of channels */
+ pa_channel_position_t map[PA_CHANNELS_MAX]; /**< Channel labels */
+} pa_channel_map;
+
+/** Initialize the specified channel map and return a pointer to it */
+pa_channel_map* pa_channel_map_init(pa_channel_map *m);
+
+/** Initialize the specified channel map for monoaural audio and return a pointer to it */
+pa_channel_map* pa_channel_map_init_mono(pa_channel_map *m);
+
+/** Initialize the specified channel map for stereophonic audio and return a pointer to it */
+pa_channel_map* pa_channel_map_init_stereo(pa_channel_map *m);
+
+/** Initialize the specified channel map for the specified number
+ * of channels using default labels and return a pointer to it. */
+pa_channel_map* pa_channel_map_init_auto(pa_channel_map *m, unsigned channels, pa_channel_map_def_t def);
+
+/** Return a text label for the specified channel position */
+const char* pa_channel_position_to_string(pa_channel_position_t pos) PA_GCC_PURE;
+
+/** Return a human readable text label for the specified channel position. \since 0.9.7 */
+const char* pa_channel_position_to_pretty_string(pa_channel_position_t pos);
+
+/** The maximum length of strings returned by pa_channel_map_snprint() */
+#define PA_CHANNEL_MAP_SNPRINT_MAX 336
+
+/** Make a humand readable string from the specified channel map */
+char* pa_channel_map_snprint(char *s, size_t l, const pa_channel_map *map);
+
+/** Parse a channel position list into a channel map structure. \since 0.8.1 */
+pa_channel_map *pa_channel_map_parse(pa_channel_map *map, const char *s);
+
+/** Compare two channel maps. Return 1 if both match. */
+int pa_channel_map_equal(const pa_channel_map *a, const pa_channel_map *b) PA_GCC_PURE;
+
+/** Return non-zero of the specified channel map is considered valid */
+int pa_channel_map_valid(const pa_channel_map *map) PA_GCC_PURE;
+
+PA_C_DECL_END
+
+#endif
diff --git a/sysroot/usr/include/pulse/context.h b/sysroot/usr/include/pulse/context.h
new file mode 100644
index 0000000..c959926
--- /dev/null
+++ b/sysroot/usr/include/pulse/context.h
@@ -0,0 +1,233 @@
+#ifndef foocontexthfoo
+#define foocontexthfoo
+
+/* $Id: context.h 1426 2007-02-13 15:35:19Z ossman $ */
+
+/***
+ This file is part of PulseAudio.
+
+ Copyright 2004-2006 Lennart Poettering
+ Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
+
+ PulseAudio is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2 of the License,
+ or (at your option) any later version.
+
+ PulseAudio is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with PulseAudio; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+***/
+
+#include <pulse/sample.h>
+#include <pulse/def.h>
+#include <pulse/mainloop-api.h>
+#include <pulse/cdecl.h>
+#include <pulse/operation.h>
+
+/** \page async Asynchronous API
+ *
+ * \section overv_sec Overview
+ *
+ * The asynchronous API is the native interface to the PulseAudio library.
+ * It allows full access to all available functions. This also means that
+ * it is rather complex and can take some time to fully master.
+ *
+ * \section mainloop_sec Main Loop Abstraction
+ *
+ * The API is based around an asynchronous event loop, or main loop,
+ * abstraction. This abstraction contains three basic elements:
+ *
+ * \li Deferred events - Events that will trigger as soon as possible. Note
+ * that some implementations may block all other events
+ * when a deferred event is active.
+ * \li I/O events - Events that trigger on file descriptor activities.
+ * \li Times events - Events that trigger after a fixed ammount of time.
+ *
+ * The abstraction is represented as a number of function pointers in the
+ * pa_mainloop_api structure.
+ *
+ * To actually be able to use these functions, an implementation needs to
+ * be coupled to the abstraction. There are three of these shipped with
+ * PulseAudio, but any other can be used with a minimal ammount of work,
+ * provided it supports the three basic events listed above.
+ *
+ * The implementations shipped with PulseAudio are:
+ *
+ * \li \subpage mainloop - A minimal but fast implementation based on poll().
+ * \li \subpage threaded_mainloop - A special version of the previous
+ * implementation where all of PulseAudio's
+ * internal handling runs in a separate
+ * thread.
+ * \li \subpage glib-mainloop - A wrapper around GLIB's main loop. Available
+ * for both GLIB 1.2 and GLIB 2.x.
+ *
+ * UNIX signals may be hooked to a main loop using the functions from
+ * \ref mainloop-signal.h. These rely only on the main loop abstraction
+ * and can therefore be used with any of the implementations.
+ *
+ * \section refcnt_sec Reference Counting
+ *
+ * Almost all objects in PulseAudio are reference counted. What that means
+ * is that you rarely malloc() or free() any objects. Instead you increase
+ * and decrease their reference counts. Whenever an object's reference
+ * count reaches zero, that object gets destroy and any resources it uses
+ * get freed.
+ *
+ * The benefit of this design is that an application need not worry about
+ * whether or not it needs to keep an object around in case the library is
+ * using it internally. If it is, then it has made sure it has its own
+ * reference to it.
+ *
+ * Whenever the library creates an object, it will have an initial
+ * reference count of one. Most of the time, this single reference will be
+ * sufficient for the application, so all required reference count
+ * interaction will be a single call to the objects unref function.
+ *
+ * \section context_sec Context
+ *
+ * A context is the basic object for a connection to a PulseAudio server.
+ * It multiplexes commands, data streams and events through a single
+ * channel.
+ *
+ * There is no need for more than one context per application, unless
+ * connections to multiple servers are needed.
+ *
+ * \subsection ops_subsec Operations
+ *
+ * All operations on the context are performed asynchronously. I.e. the
+ * client will not wait for the server to complete the request. To keep
+ * track of all these in-flight operations, the application is given a
+ * pa_operation object for each asynchronous operation.
+ *
+ * There are only two actions (besides reference counting) that can be
+ * performed on a pa_operation: querying its state with
+ * pa_operation_get_state() and aborting it with pa_operation_cancel().
+ *
+ * A pa_operation object is reference counted, so an application must
+ * make sure to unreference it, even if it has no intention of using it.
+ *
+ * \subsection conn_subsec Connecting
+ *
+ * A context must be connected to a server before any operation can be
+ * issued. Calling pa_context_connect() will initiate the connection
+ * procedure. Unlike most asynchronous operations, connecting does not
+ * result in a pa_operation object. Instead, the application should
+ * register a callback using pa_context_set_state_callback().
+ *
+ * \subsection disc_subsec Disconnecting
+ *
+ * When the sound support is no longer needed, the connection needs to be
+ * closed using pa_context_disconnect(). This is an immediate function that
+ * works synchronously.
+ *
+ * Since the context object has references to other objects it must be
+ * disconnected after use or there is a high risk of memory leaks. If the
+ * connection has terminated by itself, then there is no need to explicitly
+ * disconnect the context using pa_context_disconnect().
+ *
+ * \section Functions
+ *
+ * The sound server's functionality can be divided into a number of
+ * subsections:
+ *
+ * \li \subpage streams
+ * \li \subpage scache
+ * \li \subpage introspect
+ * \li \subpage subscribe
+ */
+
+/** \file
+ * Connection contexts for asynchrononous communication with a
+ * server. A pa_context object wraps a connection to a PulseAudio
+ * server using its native protocol. */
+
+/** \example pacat.c
+ * A playback and recording tool using the asynchronous API */
+
+/** \example paplay.c
+ * A sound file playback tool using the asynchronous API, based on libsndfile */
+
+PA_C_DECL_BEGIN
+
+/** An opaque connection context to a daemon */
+typedef struct pa_context pa_context;
+
+/** Generic notification callback prototype */
+typedef void (*pa_context_notify_cb_t)(pa_context *c, void *userdata);
+
+/** A generic callback for operation completion */
+typedef void (*pa_context_success_cb_t) (pa_context *c, int success, void *userdata);
+
+/** Instantiate a new connection context with an abstract mainloop API
+ * and an application name */
+pa_context *pa_context_new(pa_mainloop_api *mainloop, const char *name);
+
+/** Decrease the reference counter of the context by one */
+void pa_context_unref(pa_context *c);
+
+/** Increase the reference counter of the context by one */
+pa_context* pa_context_ref(pa_context *c);
+
+/** Set a callback function that is called whenever the context status changes */
+void pa_context_set_state_callback(pa_context *c, pa_context_notify_cb_t cb, void *userdata);
+
+/** Return the error number of the last failed operation */
+int pa_context_errno(pa_context *c);
+
+/** Return non-zero if some data is pending to be written to the connection */
+int pa_context_is_pending(pa_context *c);
+
+/** Return the current context status */
+pa_context_state_t pa_context_get_state(pa_context *c);
+
+/** Connect the context to the specified server. If server is NULL,
+connect to the default server. This routine may but will not always
+return synchronously on error. Use pa_context_set_state_callback() to
+be notified when the connection is established. If flags doesn't have
+PA_NOAUTOSPAWN set and no specific server is specified or accessible a
+new daemon is spawned. If api is non-NULL, the functions specified in
+the structure are used when forking a new child process. */
+int pa_context_connect(pa_context *c, const char *server, pa_context_flags_t flags, const pa_spawn_api *api);
+
+/** Terminate the context connection immediately */
+void pa_context_disconnect(pa_context *c);
+
+/** Drain the context. If there is nothing to drain, the function returns NULL */
+pa_operation* pa_context_drain(pa_context *c, pa_context_notify_cb_t cb, void *userdata);
+
+/** Tell the daemon to exit. The returned operation is unlikely to
+ * complete succesfully, since the daemon probably died before
+ * returning a success notification */
+pa_operation* pa_context_exit_daemon(pa_context *c, pa_context_success_cb_t cb, void *userdata);
+
+/** Set the name of the default sink. \since 0.4 */
+pa_operation* pa_context_set_default_sink(pa_context *c, const char *name, pa_context_success_cb_t cb, void *userdata);
+
+/** Set the name of the default source. \since 0.4 */
+pa_operation* pa_context_set_default_source(pa_context *c, const char *name, pa_context_success_cb_t cb, void *userdata);
+
+/** Returns 1 when the connection is to a local daemon. Returns negative when no connection has been made yet. \since 0.5 */
+int pa_context_is_local(pa_context *c);
+
+/** Set a different application name for context on the server. \since 0.5 */
+pa_operation* pa_context_set_name(pa_context *c, const char *name, pa_context_success_cb_t cb, void *userdata);
+
+/** Return the server name this context is connected to. \since 0.7 */
+const char* pa_context_get_server(pa_context *c);
+
+/** Return the protocol version of the library. \since 0.8 */
+uint32_t pa_context_get_protocol_version(pa_context *c);
+
+/** Return the protocol version of the connected server. \since 0.8 */
+uint32_t pa_context_get_server_protocol_version(pa_context *c);
+
+PA_C_DECL_END
+
+#endif
diff --git a/sysroot/usr/include/pulse/def.h b/sysroot/usr/include/pulse/def.h
new file mode 100644
index 0000000..f2ad860
--- /dev/null
+++ b/sysroot/usr/include/pulse/def.h
@@ -0,0 +1,397 @@
+#ifndef foodefhfoo
+#define foodefhfoo
+
+/* $Id: def.h 2067 2007-11-21 01:30:40Z lennart $ */
+
+/***
+ This file is part of PulseAudio.
+
+ Copyright 2004-2006 Lennart Poettering
+ Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
+
+ PulseAudio is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ PulseAudio is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with PulseAudio; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+***/
+
+#include <inttypes.h>
+#include <sys/time.h>
+#include <time.h>
+
+#include <pulse/cdecl.h>
+#include <pulse/sample.h>
+
+/** \file
+ * Global definitions */
+
+PA_C_DECL_BEGIN
+
+/** The state of a connection context */
+typedef enum pa_context_state {
+ PA_CONTEXT_UNCONNECTED, /**< The context hasn't been connected yet */
+ PA_CONTEXT_CONNECTING, /**< A connection is being established */
+ PA_CONTEXT_AUTHORIZING, /**< The client is authorizing itself to the daemon */
+ PA_CONTEXT_SETTING_NAME, /**< The client is passing its application name to the daemon */
+ PA_CONTEXT_READY, /**< The connection is established, the context is ready to execute operations */
+ PA_CONTEXT_FAILED, /**< The connection failed or was disconnected */
+ PA_CONTEXT_TERMINATED /**< The connection was terminated cleanly */
+} pa_context_state_t;
+
+/** The state of a stream */
+typedef enum pa_stream_state {
+ PA_STREAM_UNCONNECTED, /**< The stream is not yet connected to any sink or source */
+ PA_STREAM_CREATING, /**< The stream is being created */
+ PA_STREAM_READY, /**< The stream is established, you may pass audio data to it now */
+ PA_STREAM_FAILED, /**< An error occured that made the stream invalid */
+ PA_STREAM_TERMINATED /**< The stream has been terminated cleanly */
+} pa_stream_state_t;
+
+/** The state of an operation */
+typedef enum pa_operation_state {
+ PA_OPERATION_RUNNING, /**< The operation is still running */
+ PA_OPERATION_DONE, /**< The operation has been completed */
+ PA_OPERATION_CANCELED /**< The operation has been canceled */
+} pa_operation_state_t;
+
+/** An invalid index */
+#define PA_INVALID_INDEX ((uint32_t) -1)
+
+/** Some special flags for contexts. \since 0.8 */
+typedef enum pa_context_flags {
+ PA_CONTEXT_NOAUTOSPAWN = 1 /**< Disabled autospawning of the PulseAudio daemon if required */
+} pa_context_flags_t;
+
+/** The direction of a pa_stream object */
+typedef enum pa_stream_direction {
+ PA_STREAM_NODIRECTION, /**< Invalid direction */
+ PA_STREAM_PLAYBACK, /**< Playback stream */
+ PA_STREAM_RECORD, /**< Record stream */
+ PA_STREAM_UPLOAD /**< Sample upload stream */
+} pa_stream_direction_t;
+
+/** Some special flags for stream connections. \since 0.6 */
+typedef enum pa_stream_flags {
+ PA_STREAM_START_CORKED = 1, /**< Create the stream corked, requiring an explicit pa_stream_cork() call to uncork it. */
+ PA_STREAM_INTERPOLATE_TIMING = 2, /**< Interpolate the latency for
+ * this stream. When enabled,
+ * pa_stream_get_latency() and
+ * pa_stream_get_time() will try
+ * to estimate the current
+ * record/playback time based on
+ * the local time that passed
+ * since the last timing info
+ * update. Using this option
+ * has the advantage of not
+ * requiring a whole roundtrip
+ * when the current
+ * playback/recording time is
+ * needed. Consider using this
+ * option when requesting
+ * latency information
+ * frequently. This is
+ * especially useful on long
+ * latency network
+ * connections. It makes a lot
+ * of sense to combine this
+ * option with
+ * PA_STREAM_AUTO_TIMING_UPDATE. */
+ PA_STREAM_NOT_MONOTONOUS = 4, /**< Don't force the time to
+ * increase monotonically. If
+ * this option is enabled,
+ * pa_stream_get_time() will not
+ * necessarily return always
+ * monotonically increasing time
+ * values on each call. This may
+ * confuse applications which
+ * cannot deal with time going
+ * 'backwards', but has the
+ * advantage that bad transport
+ * latency estimations that
+ * caused the time to to jump
+ * ahead can be corrected
+ * quickly, without the need to
+ * wait. */
+ PA_STREAM_AUTO_TIMING_UPDATE = 8, /**< If set timing update requests
+ * are issued periodically
+ * automatically. Combined with
+ * PA_STREAM_INTERPOLATE_TIMING
+ * you will be able to query the
+ * current time and latency with
+ * pa_stream_get_time() and
+ * pa_stream_get_latency() at
+ * all times without a packet
+ * round trip.*/
+ PA_STREAM_NO_REMAP_CHANNELS = 16, /**< Don't remap channels by
+ * their name, instead map them
+ * simply by their
+ * index. Implies
+ * PA_STREAM_NO_REMIX_CHANNELS. Only
+ * supported when the server is
+ * at least PA 0.9.8. It is
+ * ignored on older
+ * servers.\since 0.9.8 */
+ PA_STREAM_NO_REMIX_CHANNELS = 32, /**< When remapping channels by
+ * name, don't upmix or downmix
+ * them to related
+ * channels. Copy them into
+ * matching channels of the
+ * device 1:1. Only supported
+ * when the server is at least
+ * PA 0.9.8. It is ignored on
+ * older servers. \since
+ * 0.9.8 */
+ PA_STREAM_FIX_FORMAT = 64, /**< Use the sample format of the
+ * sink/device this stream is being
+ * connected to, and possibly ignore
+ * the format the sample spec contains
+ * -- but you still have to pass a
+ * valid value in it as a hint to
+ * PulseAudio what would suit your
+ * stream best. If this is used you
+ * should query the used sample format
+ * after creating the stream by using
+ * pa_stream_get_sample_spec(). Also,
+ * if you specified manual buffer
+ * metrics it is recommended to update
+ * them with
+ * pa_stream_set_buffer_attr() to
+ * compensate for the changed frame
+ * sizes. Only supported when the
+ * server is at least PA 0.9.8. It is
+ * ignored on older servers. \since
+ * 0.9.8 */
+
+ PA_STREAM_FIX_RATE = 128, /**< Use the sample rate of the sink,
+ * and possibly ignore the rate the
+ * sample spec contains. Usage similar
+ * to PA_STREAM_FIX_FORMAT.Only
+ * supported when the server is at least
+ * PA 0.9.8. It is ignored on older
+ * servers. \since 0.9.8 */
+
+ PA_STREAM_FIX_CHANNELS = 256, /**< Use the number of channels and
+ * the channel map of the sink, and
+ * possibly ignore the number of
+ * channels and the map the sample spec
+ * and the passed channel map
+ * contains. Usage similar to
+ * PA_STREAM_FIX_FORMAT. Only supported
+ * when the server is at least PA
+ * 0.9.8. It is ignored on older
+ * servers. \since 0.9.8 */
+ PA_STREAM_DONT_MOVE = 512, /**< Don't allow moving of this stream to
+ * another sink/device. Useful if you use
+ * any of the PA_STREAM_FIX_ flags and
+ * want to make sure that resampling
+ * never takes place -- which might
+ * happen if the stream is moved to
+ * another sink/source whith a different
+ * sample spec/channel map. Only
+ * supported when the server is at least
+ * PA 0.9.8. It is ignored on older
+ * servers. \since 0.9.8 */
+ PA_STREAM_VARIABLE_RATE = 1024, /**< Allow dynamic changing of the
+ * sampling rate during playback
+ * with
+ * pa_stream_update_sample_rate(). Only
+ * supported when the server is at
+ * least PA 0.9.8. It is ignored
+ * on older servers. \since
+ * 0.9.8 */
+} pa_stream_flags_t;
+
+/** Playback and record buffer metrics */
+typedef struct pa_buffer_attr {
+ uint32_t maxlength; /**< Maximum length of the buffer */
+ uint32_t tlength; /**< Playback only: target length of the buffer. The server tries to assure that at least tlength bytes are always available in the buffer */
+ uint32_t prebuf; /**< Playback only: pre-buffering. The server does not start with playback before at least prebug bytes are available in the buffer */
+ uint32_t minreq; /**< Playback only: minimum request. The server does not request less than minreq bytes from the client, instead waints until the buffer is free enough to request more bytes at once */
+ uint32_t fragsize; /**< Recording only: fragment size. The server sends data in blocks of fragsize bytes size. Large values deminish interactivity with other operations on the connection context but decrease control overhead. */
+} pa_buffer_attr;
+
+/** Error values as used by pa_context_errno(). Use pa_strerror() to convert these values to human readable strings */
+enum {
+ PA_OK = 0, /**< No error */
+ PA_ERR_ACCESS, /**< Access failure */
+ PA_ERR_COMMAND, /**< Unknown command */
+ PA_ERR_INVALID, /**< Invalid argument */
+ PA_ERR_EXIST, /**< Entity exists */
+ PA_ERR_NOENTITY, /**< No such entity */
+ PA_ERR_CONNECTIONREFUSED, /**< Connection refused */
+ PA_ERR_PROTOCOL, /**< Protocol error */
+ PA_ERR_TIMEOUT, /**< Timeout */
+ PA_ERR_AUTHKEY, /**< No authorization key */
+ PA_ERR_INTERNAL, /**< Internal error */
+ PA_ERR_CONNECTIONTERMINATED, /**< Connection terminated */
+ PA_ERR_KILLED, /**< Entity killed */
+ PA_ERR_INVALIDSERVER, /**< Invalid server */
+ PA_ERR_MODINITFAILED, /**< Module initialization failed */
+ PA_ERR_BADSTATE, /**< Bad state */
+ PA_ERR_NODATA, /**< No data */
+ PA_ERR_VERSION, /**< Incompatible protocol version \since 0.8 */
+ PA_ERR_TOOLARGE, /**< Data too large \since 0.8.1 */
+ PA_ERR_NOTSUPPORTED, /**< Operation not supported \since 0.9.5 */
+ PA_ERR_MAX /**< Not really an error but the first invalid error code */
+};
+
+/** Subscription event mask, as used by pa_context_subscribe() */
+typedef enum pa_subscription_mask {
+ PA_SUBSCRIPTION_MASK_NULL = 0, /**< No events */
+ PA_SUBSCRIPTION_MASK_SINK = 1, /**< Sink events */
+ PA_SUBSCRIPTION_MASK_SOURCE = 2, /**< Source events */
+ PA_SUBSCRIPTION_MASK_SINK_INPUT = 4, /**< Sink input events */
+ PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT = 8, /**< Source output events */
+ PA_SUBSCRIPTION_MASK_MODULE = 16, /**< Module events */
+ PA_SUBSCRIPTION_MASK_CLIENT = 32, /**< Client events */
+ PA_SUBSCRIPTION_MASK_SAMPLE_CACHE = 64, /**< Sample cache events */
+ PA_SUBSCRIPTION_MASK_SERVER = 128, /**< Other global server changes. \since 0.4 */
+ PA_SUBSCRIPTION_MASK_AUTOLOAD = 256, /**< Autoload table events. \since 0.5 */
+ PA_SUBSCRIPTION_MASK_ALL = 511 /**< Catch all events \since 0.8 */
+} pa_subscription_mask_t;
+
+/** Subscription event types, as used by pa_context_subscribe() */
+typedef enum pa_subscription_event_type {
+ PA_SUBSCRIPTION_EVENT_SINK = 0, /**< Event type: Sink */
+ PA_SUBSCRIPTION_EVENT_SOURCE = 1, /**< Event type: Source */
+ PA_SUBSCRIPTION_EVENT_SINK_INPUT = 2, /**< Event type: Sink input */
+ PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT = 3, /**< Event type: Source output */
+ PA_SUBSCRIPTION_EVENT_MODULE = 4, /**< Event type: Module */
+ PA_SUBSCRIPTION_EVENT_CLIENT = 5, /**< Event type: Client */
+ PA_SUBSCRIPTION_EVENT_SAMPLE_CACHE = 6, /**< Event type: Sample cache item */
+ PA_SUBSCRIPTION_EVENT_SERVER = 7, /**< Event type: Global server change, only occuring with PA_SUBSCRIPTION_EVENT_CHANGE. \since 0.4 */
+ PA_SUBSCRIPTION_EVENT_AUTOLOAD = 8, /**< Event type: Autoload table changes. \since 0.5 */
+ PA_SUBSCRIPTION_EVENT_FACILITY_MASK = 15, /**< A mask to extract the event type from an event value */
+
+ PA_SUBSCRIPTION_EVENT_NEW = 0, /**< A new object was created */
+ PA_SUBSCRIPTION_EVENT_CHANGE = 16, /**< A property of the object was modified */
+ PA_SUBSCRIPTION_EVENT_REMOVE = 32, /**< An object was removed */
+ PA_SUBSCRIPTION_EVENT_TYPE_MASK = 16+32 /**< A mask to extract the event operation from an event value */
+} pa_subscription_event_type_t;
+
+/** Return one if an event type t matches an event mask bitfield */
+#define pa_subscription_match_flags(m, t) (!!((m) & (1 << ((t) & PA_SUBSCRIPTION_EVENT_FACILITY_MASK))))
+
+/** A structure for all kinds of timing information of a stream. See
+ * pa_stream_update_timing_info() and pa_stream_get_timing_info(). The
+ * total output latency a sample that is written with
+ * pa_stream_write() takes to be played may be estimated by
+ * sink_usec+buffer_usec+transport_usec. (where buffer_usec is defined
+ * as pa_bytes_to_usec(write_index-read_index)) The output buffer
+ * which buffer_usec relates to may be manipulated freely (with
+ * pa_stream_write()'s seek argument, pa_stream_flush() and friends),
+ * the buffers sink_usec and source_usec relate to are first-in
+ * first-out (FIFO) buffers which cannot be flushed or manipulated in
+ * any way. The total input latency a sample that is recorded takes to
+ * be delivered to the application is:
+ * source_usec+buffer_usec+transport_usec-sink_usec. (Take care of
+ * sign issues!) When connected to a monitor source sink_usec contains
+ * the latency of the owning sink. The two latency estimations
+ * described here are implemented in pa_stream_get_latency().*/
+typedef struct pa_timing_info {
+ struct timeval timestamp; /**< The time when this timing info structure was current */
+ int synchronized_clocks; /**< Non-zero if the local and the
+ * remote machine have synchronized
+ * clocks. If synchronized clocks are
+ * detected transport_usec becomes much
+ * more reliable. However, the code that
+ * detects synchronized clocks is very
+ * limited und unreliable itself. \since
+ * 0.5 */
+
+ pa_usec_t sink_usec; /**< Time in usecs a sample takes to be played on the sink. For playback streams and record streams connected to a monitor source. */
+ pa_usec_t source_usec; /**< Time in usecs a sample takes from being recorded to being delivered to the application. Only for record streams. \since 0.5*/
+ pa_usec_t transport_usec; /**< Estimated time in usecs a sample takes to be transferred to/from the daemon. For both playback and record streams. \since 0.5 */
+
+ int playing; /**< Non-zero when the stream is currently playing. Only for playback streams. */
+
+ int write_index_corrupt; /**< Non-zero if write_index is not
+ * up-to-date because a local write
+ * command that corrupted it has been
+ * issued in the time since this latency
+ * info was current . Only write
+ * commands with SEEK_RELATIVE_ON_READ
+ * and SEEK_RELATIVE_END can corrupt
+ * write_index. \since 0.8 */
+ int64_t write_index; /**< Current write index into the
+ * playback buffer in bytes. Think twice before
+ * using this for seeking purposes: it
+ * might be out of date a the time you
+ * want to use it. Consider using
+ * PA_SEEK_RELATIVE instead. \since
+ * 0.8 */
+
+ int read_index_corrupt; /**< Non-zero if read_index is not
+ * up-to-date because a local pause or
+ * flush request that corrupted it has
+ * been issued in the time since this
+ * latency info was current. \since 0.8 */
+
+ int64_t read_index; /**< Current read index into the
+ * playback buffer in bytes. Think twice before
+ * using this for seeking purposes: it
+ * might be out of date a the time you
+ * want to use it. Consider using
+ * PA_SEEK_RELATIVE_ON_READ
+ * instead. \since 0.8 */
+} pa_timing_info;
+
+/** A structure for the spawn api. This may be used to integrate auto
+ * spawned daemons into your application. For more information see
+ * pa_context_connect(). When spawning a new child process the
+ * waitpid() is used on the child's PID. The spawn routine will not
+ * block or ignore SIGCHLD signals, since this cannot be done in a
+ * thread compatible way. You might have to do this in
+ * prefork/postfork. \since 0.4 */
+typedef struct pa_spawn_api {
+ void (*prefork)(void); /**< Is called just before the fork in the parent process. May be NULL. */
+ void (*postfork)(void); /**< Is called immediately after the fork in the parent process. May be NULL.*/
+ void (*atfork)(void); /**< Is called immediately after the
+ * fork in the child process. May be
+ * NULL. It is not safe to close all
+ * file descriptors in this function
+ * unconditionally, since a UNIX socket
+ * (created using socketpair()) is
+ * passed to the new process. */
+} pa_spawn_api;
+
+/** Seek type for pa_stream_write(). \since 0.8*/
+typedef enum pa_seek_mode {
+ PA_SEEK_RELATIVE = 0, /**< Seek relatively to the write index */
+ PA_SEEK_ABSOLUTE = 1, /**< Seek relatively to the start of the buffer queue */
+ PA_SEEK_RELATIVE_ON_READ = 2, /**< Seek relatively to the read index. */
+ PA_SEEK_RELATIVE_END = 3 /**< Seek relatively to the current end of the buffer queue. */
+} pa_seek_mode_t;
+
+/** Special sink flags. \since 0.8 */
+typedef enum pa_sink_flags {
+ PA_SINK_HW_VOLUME_CTRL = 1, /**< Supports hardware volume control */
+ PA_SINK_LATENCY = 2, /**< Supports latency querying */
+ PA_SINK_HARDWARE = 4, /**< Is a hardware sink of some kind, in contrast to "virtual"/software sinks \since 0.9.3 */
+ PA_SINK_NETWORK = 8 /**< Is a networked sink of some kind. \since 0.9.7 */
+} pa_sink_flags_t;
+
+/** Special source flags. \since 0.8 */
+typedef enum pa_source_flags {
+ PA_SOURCE_HW_VOLUME_CTRL = 1, /**< Supports hardware volume control */
+ PA_SOURCE_LATENCY = 2, /**< Supports latency querying */
+ PA_SOURCE_HARDWARE = 4, /**< Is a hardware source of some kind, in contrast to "virtual"/software source \since 0.9.3 */
+ PA_SOURCE_NETWORK = 8 /**< Is a networked sink of some kind. \since 0.9.7 */
+} pa_source_flags_t;
+
+/** A generic free() like callback prototype */
+typedef void (*pa_free_cb_t)(void *p);
+
+PA_C_DECL_END
+
+#endif
diff --git a/sysroot/usr/include/pulse/error.h b/sysroot/usr/include/pulse/error.h
new file mode 100644
index 0000000..2ee4156
--- /dev/null
+++ b/sysroot/usr/include/pulse/error.h
@@ -0,0 +1,41 @@
+#ifndef fooerrorhfoo
+#define fooerrorhfoo
+
+/* $Id: error.h 1426 2007-02-13 15:35:19Z ossman $ */
+
+/***
+ This file is part of PulseAudio.
+
+ Copyright 2004-2006 Lennart Poettering
+ Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
+
+ PulseAudio is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2 of the License,
+ or (at your option) any later version.
+
+ PulseAudio is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with PulseAudio; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+***/
+
+#include <inttypes.h>
+#include <pulse/cdecl.h>
+
+/** \file
+ * Error management */
+
+PA_C_DECL_BEGIN
+
+/** Return a human readable error message for the specified numeric error code */
+const char* pa_strerror(int error);
+
+PA_C_DECL_END
+
+#endif
diff --git a/sysroot/usr/include/pulse/glib-mainloop.h b/sysroot/usr/include/pulse/glib-mainloop.h
new file mode 100644
index 0000000..4a4c0ad
--- /dev/null
+++ b/sysroot/usr/include/pulse/glib-mainloop.h
@@ -0,0 +1,65 @@
+#ifndef fooglibmainloophfoo
+#define fooglibmainloophfoo
+
+/* $Id: glib-mainloop.h 1426 2007-02-13 15:35:19Z ossman $ */
+
+/***
+ This file is part of PulseAudio.
+
+ Copyright 2004-2006 Lennart Poettering
+ Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
+
+ PulseAudio is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2 of the License,
+ or (at your option) any later version.
+
+ PulseAudio is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with PulseAudio; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+***/
+
+#include <glib.h>
+
+#include <pulse/mainloop-api.h>
+#include <pulse/cdecl.h>
+
+/** \page glib-mainloop GLIB Main Loop Bindings
+ *
+ * \section overv_sec Overview
+ *
+ * The GLIB main loop bindings are extremely easy to use. All that is
+ * required is to create a pa_glib_mainloop object using
+ * pa_glib_mainloop_new(). When the main loop abstraction is needed, it is
+ * provided by pa_glib_mainloop_get_api().
+ *
+ */
+
+/** \file
+ * GLIB main loop support */
+
+PA_C_DECL_BEGIN
+
+/** An opaque GLIB main loop object */
+typedef struct pa_glib_mainloop pa_glib_mainloop;
+
+/** Create a new GLIB main loop object for the specified GLIB main
+ * loop context. Takes an argument c for the
+ * GMainContext to use. If c is NULL the default context is used. */
+pa_glib_mainloop *pa_glib_mainloop_new(GMainContext *c);
+
+/** Free the GLIB main loop object */
+void pa_glib_mainloop_free(pa_glib_mainloop* g);
+
+/** Return the abstract main loop API vtable for the GLIB main loop object */
+pa_mainloop_api* pa_glib_mainloop_get_api(pa_glib_mainloop *g);
+
+PA_C_DECL_END
+
+#endif
diff --git a/sysroot/usr/include/pulse/introspect.h b/sysroot/usr/include/pulse/introspect.h
new file mode 100644
index 0000000..ecb3643
--- /dev/null
+++ b/sysroot/usr/include/pulse/introspect.h
@@ -0,0 +1,520 @@
+#ifndef foointrospecthfoo
+#define foointrospecthfoo
+
+/* $Id: introspect.h 1971 2007-10-28 19:13:50Z lennart $ */
+
+/***
+ This file is part of PulseAudio.
+
+ Copyright 2004-2006 Lennart Poettering
+ Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
+
+ PulseAudio is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2 of the License,
+ or (at your option) any later version.
+
+ PulseAudio is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with PulseAudio; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+***/
+
+#include <inttypes.h>
+
+#include <pulse/operation.h>
+#include <pulse/context.h>
+#include <pulse/cdecl.h>
+#include <pulse/channelmap.h>
+#include <pulse/volume.h>
+
+/** \page introspect Server Query and Control
+ *
+ * \section overv_sec Overview
+ *
+ * Sometimes it is necessary to query and modify global settings in the
+ * server. For this, PulseAudio has the introspection API. It can list sinks,
+ * sources, samples and other aspects of the server. It can also modify the
+ * attributes of the server that will affect operations on a global level,
+ * and not just the application's context.
+ *
+ * \section query_sec Querying
+ *
+ * All querying is done through callbacks. This design is necessary to
+ * maintain an asynchronous design. The client will request the information
+ * and some time later, the server will respond with the desired data.
+ *
+ * Some objects can have multiple entries at the server. When requesting all
+ * of these at once, the callback will be called multiple times, once for
+ * each object. When the list has been exhausted, the callback will be called
+ * without an information structure and the eol parameter set to a non-zero
+ * value.
+ *
+ * Note that even if a single object is requested, and not the entire list,
+ * the terminating call will still be made.
+ *
+ * If an error occurs, the callback will be called without and information
+ * structure and eol set to zero.
+ *
+ * Data members in the information structures are only valid during the
+ * duration of the callback. If they are required after the callback is
+ * finished, a deep copy must be performed.
+ *
+ * \subsection server_subsec Server Information
+ *
+ * The server can be queried about its name, the environment it's running on
+ * and the currently active global defaults. Calling
+ * pa_context_get_server_info() will get access to a pa_server_info structure
+ * containing all of these.
+ *
+ * \subsection memstat_subsec Memory Usage
+ *
+ * Statistics about memory usage can be fetched using pa_context_stat(),
+ * giving a pa_stat_info structure.
+ *
+ * \subsection sinksrc_subsec Sinks and Sources
+ *
+ * The server can have an arbitrary number of sinks and sources. Each sink
+ * and source have both an index and a name associated with it. As such
+ * there are three ways to get access to them:
+ *
+ * \li By index - pa_context_get_sink_info_by_index() /
+ * pa_context_get_source_info_by_index()
+ * \li By name - pa_context_get_sink_info_by_name() /
+ * pa_context_get_source_info_by_name()
+ * \li All - pa_context_get_sink_info_list() /
+ * pa_context_get_source_info_list()
+ *
+ * All three method use the same callback and will provide a pa_sink_info or
+ * pa_source_info structure.
+ *
+ * \subsection siso_subsec Sink Inputs and Source Outputs
+ *
+ * Sink inputs and source outputs are the representations of the client ends
+ * of streams inside the server. I.e. they connect a client stream to one of
+ * the global sinks or sources.
+ *
+ * Sink inputs and source outputs only have an index to identify them. As
+ * such, there are only two ways to get information about them:
+ *
+ * \li By index - pa_context_get_sink_input_info() /
+ * pa_context_get_source_output_info()
+ * \li All - pa_context_get_sink_input_info_list() /
+ * pa_context_get_source_output_info_list()
+ *
+ * The structure returned is the pa_sink_input_info or pa_source_output_info
+ * structure.
+ *
+ * \subsection samples_subsec Samples
+ *
+ * The list of cached samples can be retrieved from the server. Three methods
+ * exist for querying the sample cache list:
+ *
+ * \li By index - pa_context_get_sample_info_by_index()
+ * \li By name - pa_context_get_sample_info_by_name()
+ * \li All - pa_context_get_sample_info_list()
+ *
+ * Note that this only retrieves information about the sample, not the sample
+ * data itself.
+ *
+ * \subsection module_subsec Driver Modules
+ *
+ * PulseAudio driver modules are identified by index and are retrieved using either
+ * pa_context_get_module_info() or pa_context_get_module_info_list(). The
+ * information structure is called pa_module_info.
+ *
+ * \subsection autoload_subsec Autoload Entries
+ *
+ * Modules can be autoloaded as a result of a client requesting a certain
+ * sink or source. This mapping between sink/source names and modules can be
+ * queried from the server:
+ *
+ * \li By index - pa_context_get_autoload_info_by_index()
+ * \li By sink/source name - pa_context_get_autoload_info_by_name()
+ * \li All - pa_context_get_autoload_info_list()
+ *
+ * \subsection client_subsec Clients
+ *
+ * PulseAudio clients are also identified by index and are retrieved using
+ * either pa_context_get_client_info() or pa_context_get_client_info_list().
+ * The information structure is called pa_client_info.
+ *
+ * \section ctrl_sec Control
+ *
+ * Some parts of the server are only possible to read, but most can also be
+ * modified in different ways. Note that these changes will affect all
+ * connected clients and not just the one issuing the request.
+ *
+ * \subsection sinksrc_subsec Sinks and Sources
+ *
+ * The most common change one would want to do to sinks and sources is to
+ * modify the volume of the audio. Identical to how sinks and sources can
+ * be queried, there are two ways of identifying them:
+ *
+ * \li By index - pa_context_set_sink_volume_by_index() /
+ * pa_context_set_source_volume_by_index()
+ * \li By name - pa_context_set_sink_volume_by_name() /
+ * pa_context_set_source_volume_by_name()
+ *
+ * It is also possible to mute a sink or source:
+ *
+ * \li By index - pa_context_set_sink_mute_by_index() /
+ * pa_context_set_source_mute_by_index()
+ * \li By name - pa_context_set_sink_mute_by_name() /
+ * pa_context_set_source_mute_by_name()
+ *
+ * \subsection siso_subsec Sink Inputs and Source Outputs
+ *
+ * If an application desires to modify the volume of just a single stream
+ * (commonly one of its own streams), this can be done by setting the volume
+ * of its associated sink input, using pa_context_set_sink_input_volume().
+ *
+ * There is no support for modifying the volume of source outputs.
+ *
+ * It is also possible to remove sink inputs and source outputs, terminating
+ * the streams associated with them:
+ *
+ * \li Sink input - pa_context_kill_sink_input()
+ * \li Source output - pa_context_kill_source_output()
+ *
+ * \subsection module_subsec Modules
+ *
+ * Server modules can be remotely loaded and unloaded using
+ * pa_context_load_module() and pa_context_unload_module().
+ *
+ * \subsection autoload_subsec Autoload Entries
+ *
+ * New module autoloading rules can be added, and existing can be removed
+ * using pa_context_add_autoload() and pa_context_remove_autoload_by_index()
+ * / pa_context_remove_autoload_by_name().
+ *
+ * \subsection client_subsec Clients
+ *
+ * The only operation supported on clients, is the possibility of kicking
+ * them off the server using pa_context_kill_client().
+ */
+
+/** \file
+ *
+ * Routines for daemon introspection.
+ */
+
+PA_C_DECL_BEGIN
+
+/** Stores information about sinks */
+typedef struct pa_sink_info {
+ const char *name; /**< Name of the sink */
+ uint32_t index; /**< Index of the sink */
+ const char *description; /**< Description of this sink */
+ pa_sample_spec sample_spec; /**< Sample spec of this sink */
+ pa_channel_map channel_map; /**< Channel map \since 0.8 */
+ uint32_t owner_module; /**< Index of the owning module of this sink, or PA_INVALID_INDEX */
+ pa_cvolume volume; /**< Volume of the sink */
+ int mute; /**< Mute switch of the sink \since 0.8 */
+ uint32_t monitor_source; /**< Index of the monitor source connected to this sink */
+ const char *monitor_source_name; /**< The name of the monitor source */
+ pa_usec_t latency; /**< Length of filled playback buffer of this sink */
+ const char *driver; /**< Driver name. \since 0.8 */
+ pa_sink_flags_t flags; /**< Flags \since 0.8 */
+} pa_sink_info;
+
+/** Callback prototype for pa_context_get_sink_info_by_name() and friends */
+typedef void (*pa_sink_info_cb_t)(pa_context *c, const pa_sink_info *i, int eol, void *userdata);
+
+/** Get information about a sink by its name */
+pa_operation* pa_context_get_sink_info_by_name(pa_context *c, const char *name, pa_sink_info_cb_t cb, void *userdata);
+
+/** Get information about a sink by its index */
+pa_operation* pa_context_get_sink_info_by_index(pa_context *c, uint32_t id, pa_sink_info_cb_t cb, void *userdata);
+
+/** Get the complete sink list */
+pa_operation* pa_context_get_sink_info_list(pa_context *c, pa_sink_info_cb_t cb, void *userdata);
+
+/** Stores information about sources */
+typedef struct pa_source_info {
+ const char *name ; /**< Name of the source */
+ uint32_t index; /**< Index of the source */
+ const char *description; /**< Description of this source */
+ pa_sample_spec sample_spec; /**< Sample spec of this source */
+ pa_channel_map channel_map; /**< Channel map \since 0.8 */
+ uint32_t owner_module; /**< Owning module index, or PA_INVALID_INDEX */
+ pa_cvolume volume; /**< Volume of the source \since 0.8 */
+ int mute; /**< Mute switch of the sink \since 0.8 */
+ uint32_t monitor_of_sink; /**< If this is a monitor source the index of the owning sink, otherwise PA_INVALID_INDEX */
+ const char *monitor_of_sink_name; /**< Name of the owning sink, or PA_INVALID_INDEX */
+ pa_usec_t latency; /**< Length of filled record buffer of this source. \since 0.5 */
+ const char *driver; /**< Driver name \since 0.8 */
+ pa_source_flags_t flags; /**< Flags \since 0.8 */
+} pa_source_info;
+
+/** Callback prototype for pa_context_get_source_info_by_name() and friends */
+typedef void (*pa_source_info_cb_t)(pa_context *c, const pa_source_info *i, int eol, void *userdata);
+
+/** Get information about a source by its name */
+pa_operation* pa_context_get_source_info_by_name(pa_context *c, const char *name, pa_source_info_cb_t cb, void *userdata);
+
+/** Get information about a source by its index */
+pa_operation* pa_context_get_source_info_by_index(pa_context *c, uint32_t id, pa_source_info_cb_t cb, void *userdata);
+
+/** Get the complete source list */
+pa_operation* pa_context_get_source_info_list(pa_context *c, pa_source_info_cb_t cb, void *userdata);
+
+/** Server information */
+typedef struct pa_server_info {
+ const char *user_name; /**< User name of the daemon process */
+ const char *host_name; /**< Host name the daemon is running on */
+ const char *server_version; /**< Version string of the daemon */
+ const char *server_name; /**< Server package name (usually "pulseaudio") */
+ pa_sample_spec sample_spec; /**< Default sample specification */
+ const char *default_sink_name; /**< Name of default sink. \since 0.4 */
+ const char *default_source_name; /**< Name of default sink. \since 0.4*/
+ uint32_t cookie; /**< A random cookie for identifying this instance of PulseAudio. \since 0.8 */
+} pa_server_info;
+
+/** Callback prototype for pa_context_get_server_info() */
+typedef void (*pa_server_info_cb_t) (pa_context *c, const pa_server_info*i, void *userdata);
+
+/** Get some information about the server */
+pa_operation* pa_context_get_server_info(pa_context *c, pa_server_info_cb_t cb, void *userdata);
+
+/** Stores information about modules */
+typedef struct pa_module_info {
+ uint32_t index; /**< Index of the module */
+ const char*name, /**< Name of the module */
+ *argument; /**< Argument string of the module */
+ uint32_t n_used; /**< Usage counter or PA_INVALID_INDEX */
+ int auto_unload; /**< Non-zero if this is an autoloaded module */
+} pa_module_info;
+
+/** Callback prototype for pa_context_get_module_info() and firends*/
+typedef void (*pa_module_info_cb_t) (pa_context *c, const pa_module_info*i, int eol, void *userdata);
+
+/** Get some information about a module by its index */
+pa_operation* pa_context_get_module_info(pa_context *c, uint32_t idx, pa_module_info_cb_t cb, void *userdata);
+
+/** Get the complete list of currently loaded modules */
+pa_operation* pa_context_get_module_info_list(pa_context *c, pa_module_info_cb_t cb, void *userdata);
+
+/** Stores information about clients */
+typedef struct pa_client_info {
+ uint32_t index; /**< Index of this client */
+ const char *name; /**< Name of this client */
+ uint32_t owner_module; /**< Index of the owning module, or PA_INVALID_INDEX */
+ const char *driver; /**< Driver name \since 0.8 */
+} pa_client_info;
+
+/** Callback prototype for pa_context_get_client_info() and firends*/
+typedef void (*pa_client_info_cb_t) (pa_context *c, const pa_client_info*i, int eol, void *userdata);
+
+/** Get information about a client by its index */
+pa_operation* pa_context_get_client_info(pa_context *c, uint32_t idx, pa_client_info_cb_t cb, void *userdata);
+
+/** Get the complete client list */
+pa_operation* pa_context_get_client_info_list(pa_context *c, pa_client_info_cb_t cb, void *userdata);
+
+/** Stores information about sink inputs */
+typedef struct pa_sink_input_info {
+ uint32_t index; /**< Index of the sink input */
+ const char *name; /**< Name of the sink input */
+ uint32_t owner_module; /**< Index of the module this sink input belongs to, or PA_INVALID_INDEX when it does not belong to any module */
+ uint32_t client; /**< Index of the client this sink input belongs to, or PA_INVALID_INDEX when it does not belong to any client */
+ uint32_t sink; /**< Index of the connected sink */
+ pa_sample_spec sample_spec; /**< The sample specification of the sink input */
+ pa_channel_map channel_map; /**< Channel map */
+ pa_cvolume volume; /**< The volume of this sink input */
+ pa_usec_t buffer_usec; /**< Latency due to buffering in sink input, see pa_latency_info for details */
+ pa_usec_t sink_usec; /**< Latency of the sink device, see pa_latency_info for details */
+ const char *resample_method; /**< Thre resampling method used by this sink input. \since 0.7 */
+ const char *driver; /**< Driver name \since 0.8 */
+ int mute; /**< Stream muted \since 0.9.7 */
+} pa_sink_input_info;
+
+/** Callback prototype for pa_context_get_sink_input_info() and firends*/
+typedef void (*pa_sink_input_info_cb_t) (pa_context *c, const pa_sink_input_info *i, int eol, void *userdata);
+
+/** Get some information about a sink input by its index */
+pa_operation* pa_context_get_sink_input_info(pa_context *c, uint32_t idx, pa_sink_input_info_cb_t cb, void *userdata);
+
+/** Get the complete sink input list */
+pa_operation* pa_context_get_sink_input_info_list(pa_context *c, pa_sink_input_info_cb_t cb, void *userdata);
+
+/** Stores information about source outputs */
+typedef struct pa_source_output_info {
+ uint32_t index; /**< Index of the sink input */
+ const char *name; /**< Name of the sink input */
+ uint32_t owner_module; /**< Index of the module this sink input belongs to, or PA_INVALID_INDEX when it does not belong to any module */
+ uint32_t client; /**< Index of the client this sink input belongs to, or PA_INVALID_INDEX when it does not belong to any client */
+ uint32_t source; /**< Index of the connected source */
+ pa_sample_spec sample_spec; /**< The sample specification of the source output */
+ pa_channel_map channel_map; /**< Channel map */
+ pa_usec_t buffer_usec; /**< Latency due to buffering in the source output, see pa_latency_info for details. \since 0.5 */
+ pa_usec_t source_usec; /**< Latency of the source device, see pa_latency_info for details. \since 0.5 */
+ const char *resample_method; /**< Thre resampling method used by this source output. \since 0.7 */
+ const char *driver; /**< Driver name \since 0.8 */
+} pa_source_output_info;
+
+/** Callback prototype for pa_context_get_source_output_info() and firends*/
+typedef void (*pa_source_output_info_cb_t) (pa_context *c, const pa_source_output_info *i, int eol, void *userdata);
+
+/** Get information about a source output by its index */
+pa_operation* pa_context_get_source_output_info(pa_context *c, uint32_t idx, pa_source_output_info_cb_t cb, void *userdata);
+
+/** Get the complete list of source outputs */
+pa_operation* pa_context_get_source_output_info_list(pa_context *c, pa_source_output_info_cb_t cb, void *userdata);
+
+/** Set the volume of a sink device specified by its index */
+pa_operation* pa_context_set_sink_volume_by_index(pa_context *c, uint32_t idx, const pa_cvolume *volume, pa_context_success_cb_t cb, void *userdata);
+
+/** Set the volume of a sink device specified by its name */
+pa_operation* pa_context_set_sink_volume_by_name(pa_context *c, const char *name, const pa_cvolume *volume, pa_context_success_cb_t cb, void *userdata);
+
+/** Set the mute switch of a sink device specified by its index \since 0.8 */
+pa_operation* pa_context_set_sink_mute_by_index(pa_context *c, uint32_t idx, int mute, pa_context_success_cb_t cb, void *userdata);
+
+/** Set the mute switch of a sink device specified by its name \since 0.8 */
+pa_operation* pa_context_set_sink_mute_by_name(pa_context *c, const char *name, int mute, pa_context_success_cb_t cb, void *userdata);
+
+/** Set the volume of a sink input stream */
+pa_operation* pa_context_set_sink_input_volume(pa_context *c, uint32_t idx, const pa_cvolume *volume, pa_context_success_cb_t cb, void *userdata);
+
+/** Set the mute switch of a sink input stream \since 0.9.7 */
+pa_operation* pa_context_set_sink_input_mute(pa_context *c, uint32_t idx, int mute, pa_context_success_cb_t cb, void *userdata);
+
+/** Set the volume of a source device specified by its index \since 0.8 */
+pa_operation* pa_context_set_source_volume_by_index(pa_context *c, uint32_t idx, const pa_cvolume *volume, pa_context_success_cb_t cb, void *userdata);
+
+/** Set the volume of a source device specified by its name \since 0.8 */
+pa_operation* pa_context_set_source_volume_by_name(pa_context *c, const char *name, const pa_cvolume *volume, pa_context_success_cb_t cb, void *userdata);
+
+/** Set the mute switch of a source device specified by its index \since 0.8 */
+pa_operation* pa_context_set_source_mute_by_index(pa_context *c, uint32_t idx, int mute, pa_context_success_cb_t cb, void *userdata);
+
+/** Set the mute switch of a source device specified by its name \since 0.8 */
+pa_operation* pa_context_set_source_mute_by_name(pa_context *c, const char *name, int mute, pa_context_success_cb_t cb, void *userdata);
+
+/** Memory block statistics */
+typedef struct pa_stat_info {
+ uint32_t memblock_total; /**< Currently allocated memory blocks */
+ uint32_t memblock_total_size; /**< Currentl total size of allocated memory blocks */
+ uint32_t memblock_allocated; /**< Allocated memory blocks during the whole lifetime of the daemon */
+ uint32_t memblock_allocated_size; /**< Total size of all memory blocks allocated during the whole lifetime of the daemon */
+ uint32_t scache_size; /**< Total size of all sample cache entries. \since 0.4 */
+} pa_stat_info;
+
+/** Callback prototype for pa_context_stat() */
+typedef void (*pa_stat_info_cb_t) (pa_context *c, const pa_stat_info *i, void *userdata);
+
+/** Get daemon memory block statistics */
+pa_operation* pa_context_stat(pa_context *c, pa_stat_info_cb_t cb, void *userdata);
+
+/** Stores information about sample cache entries */
+typedef struct pa_sample_info {
+ uint32_t index; /**< Index of this entry */
+ const char *name; /**< Name of this entry */
+ pa_cvolume volume; /**< Default volume of this entry */
+ pa_sample_spec sample_spec; /**< Sample specification of the sample */
+ pa_channel_map channel_map; /**< The channel map */
+ pa_usec_t duration; /**< Duration of this entry */
+ uint32_t bytes; /**< Length of this sample in bytes. \since 0.4 */
+ int lazy; /**< Non-zero when this is a lazy cache entry. \since 0.5 */
+ const char *filename; /**< In case this is a lazy cache entry, the filename for the sound file to be loaded on demand. \since 0.5 */
+} pa_sample_info;
+
+/** Callback prototype for pa_context_get_sample_info_by_name() and firends */
+typedef void (*pa_sample_info_cb_t)(pa_context *c, const pa_sample_info *i, int eol, void *userdata);
+
+/** Get information about a sample by its name */
+pa_operation* pa_context_get_sample_info_by_name(pa_context *c, const char *name, pa_sample_info_cb_t cb, void *userdata);
+
+/** Get information about a sample by its index */
+pa_operation* pa_context_get_sample_info_by_index(pa_context *c, uint32_t idx, pa_sample_info_cb_t cb, void *userdata);
+
+/** Get the complete list of samples stored in the daemon. */
+pa_operation* pa_context_get_sample_info_list(pa_context *c, pa_sample_info_cb_t cb, void *userdata);
+
+/** Kill a client. \since 0.5 */
+pa_operation* pa_context_kill_client(pa_context *c, uint32_t idx, pa_context_success_cb_t cb, void *userdata);
+
+/** Kill a sink input. \since 0.5 */
+pa_operation* pa_context_kill_sink_input(pa_context *c, uint32_t idx, pa_context_success_cb_t cb, void *userdata);
+
+/** Kill a source output. \since 0.5 */
+pa_operation* pa_context_kill_source_output(pa_context *c, uint32_t idx, pa_context_success_cb_t cb, void *userdata);
+
+/** Callback prototype for pa_context_load_module() and pa_context_add_autoload() */
+typedef void (*pa_context_index_cb_t)(pa_context *c, uint32_t idx, void *userdata);
+
+/** Load a module. \since 0.5 */
+pa_operation* pa_context_load_module(pa_context *c, const char*name, const char *argument, pa_context_index_cb_t cb, void *userdata);
+
+/** Unload a module. \since 0.5 */
+pa_operation* pa_context_unload_module(pa_context *c, uint32_t idx, pa_context_success_cb_t cb, void *userdata);
+
+/** Type of an autoload entry. \since 0.5 */
+typedef enum pa_autoload_type {
+ PA_AUTOLOAD_SINK = 0,
+ PA_AUTOLOAD_SOURCE = 1
+} pa_autoload_type_t;
+
+/** Stores information about autoload entries. \since 0.5 */
+typedef struct pa_autoload_info {
+ uint32_t index; /**< Index of this autoload entry */
+ const char *name; /**< Name of the sink or source */
+ pa_autoload_type_t type; /**< Type of the autoload entry */
+ const char *module; /**< Module name to load */
+ const char *argument; /**< Argument string for module */
+} pa_autoload_info;
+
+/** Callback prototype for pa_context_get_autoload_info_by_name() and firends */
+typedef void (*pa_autoload_info_cb_t)(pa_context *c, const pa_autoload_info *i, int eol, void *userdata);
+
+/** Get info about a specific autoload entry. \since 0.6 */
+pa_operation* pa_context_get_autoload_info_by_name(pa_context *c, const char *name, pa_autoload_type_t type, pa_autoload_info_cb_t cb, void *userdata);
+
+/** Get info about a specific autoload entry. \since 0.6 */
+pa_operation* pa_context_get_autoload_info_by_index(pa_context *c, uint32_t idx, pa_autoload_info_cb_t cb, void *userdata);
+
+/** Get the complete list of autoload entries. \since 0.5 */
+pa_operation* pa_context_get_autoload_info_list(pa_context *c, pa_autoload_info_cb_t cb, void *userdata);
+
+/** Add a new autoload entry. \since 0.5 */
+pa_operation* pa_context_add_autoload(pa_context *c, const char *name, pa_autoload_type_t type, const char *module, const char*argument, pa_context_index_cb_t, void* userdata);
+
+/** Remove an autoload entry. \since 0.6 */
+pa_operation* pa_context_remove_autoload_by_name(pa_context *c, const char *name, pa_autoload_type_t type, pa_context_success_cb_t cb, void* userdata);
+
+/** Remove an autoload entry. \since 0.6 */
+pa_operation* pa_context_remove_autoload_by_index(pa_context *c, uint32_t idx, pa_context_success_cb_t cb, void* userdata);
+
+/** Move the specified sink input to a different sink. \since 0.9.5 */
+pa_operation* pa_context_move_sink_input_by_name(pa_context *c, uint32_t idx, char *sink_name, pa_context_success_cb_t cb, void* userdata);
+
+/** Move the specified sink input to a different sink. \since 0.9.5 */
+pa_operation* pa_context_move_sink_input_by_index(pa_context *c, uint32_t idx, uint32_t sink_idx, pa_context_success_cb_t cb, void* userdata);
+
+/** Move the specified source output to a different source. \since 0.9.5 */
+pa_operation* pa_context_move_source_output_by_name(pa_context *c, uint32_t idx, char *source_name, pa_context_success_cb_t cb, void* userdata);
+
+/** Move the specified source output to a different source. \since 0.9.5 */
+pa_operation* pa_context_move_source_output_by_index(pa_context *c, uint32_t idx, uint32_t source_idx, pa_context_success_cb_t cb, void* userdata);
+
+/** Suspend/Resume a sink. \since 0.9.7 */
+pa_operation* pa_context_suspend_sink_by_name(pa_context *c, char *sink_name, int suspend, pa_context_success_cb_t cb, void* userdata);
+
+/** Suspend/Resume a sink. If idx is PA_INVALID_INDEX all sinks will be suspended. \since 0.9.7 */
+pa_operation* pa_context_suspend_sink_by_index(pa_context *c, uint32_t idx, int suspend, pa_context_success_cb_t cb, void* userdata);
+
+/** Suspend/Resume a source. \since 0.9.7 */
+pa_operation* pa_context_suspend_source_by_name(pa_context *c, char *source_name, int suspend, pa_context_success_cb_t cb, void* userdata);
+
+/** Suspend/Resume a source. If idx is PA_INVALID_INDEX all sources will be suspended. \since 0.9.7 */
+pa_operation* pa_context_suspend_source_by_index(pa_context *c, uint32_t idx, int suspend, pa_context_success_cb_t cb, void* userdata);
+
+PA_C_DECL_END
+
+#endif
diff --git a/sysroot/usr/include/pulse/mainloop-api.h b/sysroot/usr/include/pulse/mainloop-api.h
new file mode 100644
index 0000000..9a21e0b
--- /dev/null
+++ b/sysroot/usr/include/pulse/mainloop-api.h
@@ -0,0 +1,124 @@
+#ifndef foomainloopapihfoo
+#define foomainloopapihfoo
+
+/* $Id: mainloop-api.h 1426 2007-02-13 15:35:19Z ossman $ */
+
+/***
+ This file is part of PulseAudio.
+
+ Copyright 2004-2006 Lennart Poettering
+ Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
+
+ PulseAudio is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ PulseAudio is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with PulseAudio; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+***/
+
+#include <sys/time.h>
+#include <time.h>
+
+#include <pulse/cdecl.h>
+
+/** \file
+ *
+ * Main loop abstraction layer. Both the PulseAudio core and the
+ * PulseAudio client library use a main loop abstraction layer. Due to
+ * this it is possible to embed PulseAudio into other
+ * applications easily. Two main loop implemenations are
+ * currently available:
+ * \li A minimal implementation based on the C library's poll() function (See \ref mainloop.h)
+ * \li A wrapper around the GLIB main loop. Use this to embed PulseAudio into your GLIB/GTK+/GNOME programs (See \ref glib-mainloop.h)
+ *
+ * The structure pa_mainloop_api is used as vtable for the main loop abstraction.
+ *
+ * This mainloop abstraction layer has no direct support for UNIX signals. Generic, mainloop implementation agnostic support is available throught \ref mainloop-signal.h.
+ * */
+
+PA_C_DECL_BEGIN
+
+/** An abstract mainloop API vtable */
+typedef struct pa_mainloop_api pa_mainloop_api;
+
+/** A bitmask for IO events */
+typedef enum pa_io_event_flags {
+ PA_IO_EVENT_NULL = 0, /**< No event */
+ PA_IO_EVENT_INPUT = 1, /**< Input event */
+ PA_IO_EVENT_OUTPUT = 2, /**< Output event */
+ PA_IO_EVENT_HANGUP = 4, /**< Hangup event */
+ PA_IO_EVENT_ERROR = 8 /**< Error event */
+} pa_io_event_flags_t;
+
+/** An opaque IO event source object */
+typedef struct pa_io_event pa_io_event;
+/** An IO event callback protoype \since 0.9.3 */
+typedef void (*pa_io_event_cb_t)(pa_mainloop_api*ea, pa_io_event* e, int fd, pa_io_event_flags_t events, void *userdata);
+/** A IO event destroy callback prototype \ since 0.9.3 */
+typedef void (*pa_io_event_destroy_cb_t)(pa_mainloop_api*a, pa_io_event *e, void *userdata);
+
+/** An opaque timer event source object */
+typedef struct pa_time_event pa_time_event;
+/** A time event callback prototype \since 0.9.3 */
+typedef void (*pa_time_event_cb_t)(pa_mainloop_api*a, pa_time_event* e, const struct timeval *tv, void *userdata);
+/** A time event destroy callback prototype \ since 0.9.3 */
+typedef void (*pa_time_event_destroy_cb_t)(pa_mainloop_api*a, pa_time_event *e, void *userdata);
+
+/** An opaque deferred event source object. Events of this type are triggered once in every main loop iteration */
+typedef struct pa_defer_event pa_defer_event;
+/** A defer event callback protoype \since 0.9.3 */
+typedef void (*pa_defer_event_cb_t)(pa_mainloop_api*a, pa_defer_event* e, void *userdata);
+/** A defer event destroy callback prototype \ since 0.9.3 */
+typedef void (*pa_defer_event_destroy_cb_t)(pa_mainloop_api*a, pa_defer_event *e, void *userdata);
+
+/** An abstract mainloop API vtable */
+struct pa_mainloop_api {
+ /** A pointer to some private, arbitrary data of the main loop implementation */
+ void *userdata;
+
+ /** Create a new IO event source object */
+ pa_io_event* (*io_new)(pa_mainloop_api*a, int fd, pa_io_event_flags_t events, pa_io_event_cb_t cb, void *userdata);
+ /** Enable or disable IO events on this object */
+ void (*io_enable)(pa_io_event* e, pa_io_event_flags_t events);
+ /** Free a IO event source object */
+ void (*io_free)(pa_io_event* e);
+ /** Set a function that is called when the IO event source is destroyed. Use this to free the userdata argument if required */
+ void (*io_set_destroy)(pa_io_event *e, pa_io_event_destroy_cb_t cb);
+
+ /** Create a new timer event source object for the specified Unix time */
+ pa_time_event* (*time_new)(pa_mainloop_api*a, const struct timeval *tv, pa_time_event_cb_t cb, void *userdata);
+ /** Restart a running or expired timer event source with a new Unix time */
+ void (*time_restart)(pa_time_event* e, const struct timeval *tv);
+ /** Free a deferred timer event source object */
+ void (*time_free)(pa_time_event* e);
+ /** Set a function that is called when the timer event source is destroyed. Use this to free the userdata argument if required */
+ void (*time_set_destroy)(pa_time_event *e, pa_time_event_destroy_cb_t cb);
+
+ /** Create a new deferred event source object */
+ pa_defer_event* (*defer_new)(pa_mainloop_api*a, pa_defer_event_cb_t cb, void *userdata);
+ /** Enable or disable a deferred event source temporarily */
+ void (*defer_enable)(pa_defer_event* e, int b);
+ /** Free a deferred event source object */
+ void (*defer_free)(pa_defer_event* e);
+ /** Set a function that is called when the deferred event source is destroyed. Use this to free the userdata argument if required */
+ void (*defer_set_destroy)(pa_defer_event *e, pa_defer_event_destroy_cb_t cb);
+
+ /** Exit the main loop and return the specfied retval*/
+ void (*quit)(pa_mainloop_api*a, int retval);
+};
+
+/** Run the specified callback function once from the main loop using an anonymous defer event. */
+void pa_mainloop_api_once(pa_mainloop_api*m, void (*callback)(pa_mainloop_api*m, void *userdata), void *userdata);
+
+PA_C_DECL_END
+
+#endif
diff --git a/sysroot/usr/include/pulse/mainloop-signal.h b/sysroot/usr/include/pulse/mainloop-signal.h
new file mode 100644
index 0000000..fc2f6ff
--- /dev/null
+++ b/sysroot/usr/include/pulse/mainloop-signal.h
@@ -0,0 +1,62 @@
+#ifndef foomainloopsignalhfoo
+#define foomainloopsignalhfoo
+
+/* $Id: mainloop-signal.h 1426 2007-02-13 15:35:19Z ossman $ */
+
+/***
+ This file is part of PulseAudio.
+
+ Copyright 2004-2006 Lennart Poettering
+ Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
+
+ PulseAudio is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2 of the License,
+ or (at your option) any later version.
+
+ PulseAudio is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with PulseAudio; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+***/
+
+#include <pulse/mainloop-api.h>
+#include <pulse/cdecl.h>
+
+PA_C_DECL_BEGIN
+
+/** \file
+ * UNIX signal support for main loops. In contrast to other
+ * main loop event sources such as timer and IO events, UNIX signal
+ * support requires modification of the global process
+ * environment. Due to this the generic main loop abstraction layer as
+ * defined in \ref mainloop-api.h doesn't have direct support for UNIX
+ * signals. However, you may hook signal support into an abstract main loop via the routines defined herein.
+ */
+
+/** Initialize the UNIX signal subsystem and bind it to the specified main loop */
+int pa_signal_init(pa_mainloop_api *api);
+
+/** Cleanup the signal subsystem */
+void pa_signal_done(void);
+
+/** An opaque UNIX signal event source object */
+typedef struct pa_signal_event pa_signal_event;
+
+/** Create a new UNIX signal event source object */
+pa_signal_event* pa_signal_new(int sig, void (*callback) (pa_mainloop_api *api, pa_signal_event*e, int sig, void *userdata), void *userdata);
+
+/** Free a UNIX signal event source object */
+void pa_signal_free(pa_signal_event *e);
+
+/** Set a function that is called when the signal event source is destroyed. Use this to free the userdata argument if required */
+void pa_signal_set_destroy(pa_signal_event *e, void (*callback) (pa_mainloop_api *api, pa_signal_event*e, void *userdata));
+
+PA_C_DECL_END
+
+#endif
diff --git a/sysroot/usr/include/pulse/mainloop.h b/sysroot/usr/include/pulse/mainloop.h
new file mode 100644
index 0000000..16ee85a
--- /dev/null
+++ b/sysroot/usr/include/pulse/mainloop.h
@@ -0,0 +1,130 @@
+#ifndef foomainloophfoo
+#define foomainloophfoo
+
+/* $Id: mainloop.h 1426 2007-02-13 15:35:19Z ossman $ */
+
+/***
+ This file is part of PulseAudio.
+
+ Copyright 2004-2006 Lennart Poettering
+ Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
+
+ PulseAudio is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2 of the License,
+ or (at your option) any later version.
+
+ PulseAudio is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with PulseAudio; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+***/
+
+#include <pulse/mainloop-api.h>
+#include <pulse/cdecl.h>
+
+PA_C_DECL_BEGIN
+
+struct pollfd;
+
+/** \page mainloop Main Loop
+ *
+ * \section overv_sec Overview
+ *
+ * The built-in main loop implementation is based on the poll() system call.
+ * It supports the functions defined in the main loop abstraction and very
+ * little else.
+ *
+ * The main loop is created using pa_mainloop_new() and destroyed using
+ * pa_mainloop_free(). To get access to the main loop abstraction,
+ * pa_mainloop_get_api() is used.
+ *
+ * \section iter_sec Iteration
+ *
+ * The main loop is designed around the concept of iterations. Each iteration
+ * consists of three steps that repeat during the application's entire
+ * lifetime:
+ *
+ * -# Prepare - Build a list of file descriptors
+ * that need to be monitored and calculate the next timeout.
+ * -# Poll - Execute the actuall poll() system call.
+ * -# Dispatch - Dispatch any events that have fired.
+ *
+ * When using the main loop, the application can either execute each
+ * iteration, one at a time, using pa_mainloop_iterate(), or let the library
+ * iterate automatically using pa_mainloop_run().
+ *
+ * \section thread_sec Threads
+ *
+ * The main loop functions are designed to be thread safe, but the objects
+ * are not. What this means is that multiple main loops can be used, but only
+ * one object per thread.
+ *
+ */
+
+/** \file
+ *
+ * A minimal main loop implementation based on the C library's poll()
+ * function. Using the routines defined herein you may create a simple
+ * main loop supporting the generic main loop abstraction layer as
+ * defined in \ref mainloop-api.h. This implementation is thread safe
+ * as long as you access the main loop object from a single thread only.*/
+
+/** An opaque main loop object */
+typedef struct pa_mainloop pa_mainloop;
+
+/** Allocate a new main loop object */
+pa_mainloop *pa_mainloop_new(void);
+
+/** Free a main loop object */
+void pa_mainloop_free(pa_mainloop* m);
+
+/** Prepare for a single iteration of the main loop. Returns a negative value
+on error or exit request. timeout specifies a maximum timeout for the subsequent
+poll, or -1 for blocking behaviour. .*/
+int pa_mainloop_prepare(pa_mainloop *m, int timeout);
+
+/** Execute the previously prepared poll. Returns a negative value on error.*/
+int pa_mainloop_poll(pa_mainloop *m);
+
+/** Dispatch timeout, io and deferred events from the previously executed poll. Returns
+a negative value on error. On success returns the number of source dispatched. */
+int pa_mainloop_dispatch(pa_mainloop *m);
+
+/** Return the return value as specified with the main loop's quit() routine. */
+int pa_mainloop_get_retval(pa_mainloop *m);
+
+/** Run a single iteration of the main loop. This is a convenience function
+for pa_mainloop_prepare(), pa_mainloop_poll() and pa_mainloop_dispatch().
+Returns a negative value on error or exit request. If block is nonzero,
+block for events if none are queued. Optionally return the return value as
+specified with the main loop's quit() routine in the integer variable retval points
+to. On success returns the number of sources dispatched in this iteration. */
+int pa_mainloop_iterate(pa_mainloop *m, int block, int *retval);
+
+/** Run unlimited iterations of the main loop object until the main loop's quit() routine is called. */
+int pa_mainloop_run(pa_mainloop *m, int *retval);
+
+/** Return the abstract main loop abstraction layer vtable for this main loop. */
+pa_mainloop_api* pa_mainloop_get_api(pa_mainloop*m);
+
+/** Shutdown the main loop */
+void pa_mainloop_quit(pa_mainloop *m, int r);
+
+/** Interrupt a running poll (for threaded systems) */
+void pa_mainloop_wakeup(pa_mainloop *m);
+
+/** Generic prototype of a poll() like function */
+typedef int (*pa_poll_func)(struct pollfd *ufds, unsigned long nfds, int timeout, void*userdata);
+
+/** Change the poll() implementation */
+void pa_mainloop_set_poll_func(pa_mainloop *m, pa_poll_func poll_func, void *userdata);
+
+PA_C_DECL_END
+
+#endif
diff --git a/sysroot/usr/include/pulse/operation.h b/sysroot/usr/include/pulse/operation.h
new file mode 100644
index 0000000..406d047
--- /dev/null
+++ b/sysroot/usr/include/pulse/operation.h
@@ -0,0 +1,52 @@
+#ifndef foooperationhfoo
+#define foooperationhfoo
+
+/* $Id: operation.h 1426 2007-02-13 15:35:19Z ossman $ */
+
+/***
+ This file is part of PulseAudio.
+
+ Copyright 2004-2006 Lennart Poettering
+
+ PulseAudio is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2 of the License,
+ or (at your option) any later version.
+
+ PulseAudio is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with PulseAudio; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+***/
+
+#include <pulse/cdecl.h>
+#include <pulse/def.h>
+
+/** \file
+ * Asynchronous operations */
+
+PA_C_DECL_BEGIN
+
+/** An asynchronous operation object */
+typedef struct pa_operation pa_operation;
+
+/** Increase the reference count by one */
+pa_operation *pa_operation_ref(pa_operation *o);
+
+/** Decrease the reference count by one */
+void pa_operation_unref(pa_operation *o);
+
+/** Cancel the operation. Beware! This will not necessarily cancel the execution of the operation on the server side. */
+void pa_operation_cancel(pa_operation *o);
+
+/** Return the current status of the operation */
+pa_operation_state_t pa_operation_get_state(pa_operation *o);
+
+PA_C_DECL_END
+
+#endif
diff --git a/sysroot/usr/include/pulse/pulseaudio.h b/sysroot/usr/include/pulse/pulseaudio.h
new file mode 100644
index 0000000..1497ce7
--- /dev/null
+++ b/sysroot/usr/include/pulse/pulseaudio.h
@@ -0,0 +1,117 @@
+#ifndef foopulseaudiohfoo
+#define foopulseaudiohfoo
+
+/* $Id: pulseaudio.h 1426 2007-02-13 15:35:19Z ossman $ */
+
+/***
+ This file is part of PulseAudio.
+
+ Copyright 2004-2006 Lennart Poettering
+ Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
+
+ PulseAudio is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ PulseAudio is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with PulseAudio; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+***/
+
+#include <pulse/mainloop-api.h>
+#include <pulse/sample.h>
+#include <pulse/def.h>
+#include <pulse/context.h>
+#include <pulse/stream.h>
+#include <pulse/introspect.h>
+#include <pulse/subscribe.h>
+#include <pulse/scache.h>
+#include <pulse/version.h>
+#include <pulse/error.h>
+#include <pulse/operation.h>
+#include <pulse/channelmap.h>
+#include <pulse/volume.h>
+#include <pulse/xmalloc.h>
+#include <pulse/utf8.h>
+#include <pulse/thread-mainloop.h>
+#include <pulse/mainloop.h>
+#include <pulse/mainloop-signal.h>
+#include <pulse/util.h>
+#include <pulse/timeval.h>
+
+/** \file
+ * Include all libpulse header files at once. The following
+ * files are included: \ref mainloop-api.h, \ref sample.h, \ref def.h,
+ * \ref context.h, \ref stream.h, \ref introspect.h, \ref subscribe.h,
+ * \ref scache.h, \ref version.h, \ref error.h, \ref channelmap.h,
+ * \ref operation.h,\ref volume.h, \ref xmalloc.h, \ref utf8.h, \ref
+ * thread-mainloop.h, \ref mainloop.h, \ref util.h, \ref timeval.h and
+ * \ref mainloop-signal.h at once */
+
+/** \mainpage
+ *
+ * \section intro_sec Introduction
+ *
+ * This document describes the client API for the PulseAudio sound
+ * server. The API comes in two flavours to accomodate different styles
+ * of applications and different needs in complexity:
+ *
+ * \li The complete but somewhat complicated to use asynchronous API
+ * \li The simplified, easy to use, but limited synchronous API
+ *
+ * All strings in PulseAudio are in the UTF-8 encoding, regardless of current
+ * locale. Some functions will filter invalid sequences from the string, some
+ * will simply fail. To ensure reliable behaviour, make sure everything you
+ * pass to the API is already in UTF-8.
+
+ * \section simple_sec Simple API
+ *
+ * Use this if you develop your program in synchronous style and just
+ * need a way to play or record data on the sound server. See
+ * \subpage simple for more details.
+ *
+ * \section async_sec Asynchronous API
+ *
+ * Use this if you develop your programs in asynchronous, event loop
+ * based style or if you want to use the advanced features of the
+ * PulseAudio API. A guide can be found in \subpage async.
+ *
+ * By using the built-in threaded main loop, it is possible to acheive a
+ * pseudo-synchronous API, which can be useful in synchronous applications
+ * where the simple API is insufficient. See the \ref async page for
+ * details.
+ *
+ * \section thread_sec Threads
+ *
+ * The PulseAudio client libraries are not designed to be used in a
+ * heavily threaded environment. They are however designed to be reentrant
+ * safe.
+ *
+ * To use a the libraries in a threaded environment, you must assure that
+ * all objects are only used in one thread at a time. Normally, this means
+ * that all objects belonging to a single context must be accessed from the
+ * same thread.
+ *
+ * The included main loop implementation is also not thread safe. Take care
+ * to make sure event lists are not manipulated when any other code is
+ * using the main loop.
+ *
+ * \section pkgconfig pkg-config
+ *
+ * The PulseAudio libraries provide pkg-config snippets for the different
+ * modules:
+ *
+ * \li libpulse - The asynchronous API and the internal main loop implementation.
+ * \li libpulse-mainloop-glib12 - GLIB 1.2 main loop bindings.
+ * \li libpulse-mainloop-glib - GLIB 2.x main loop bindings.
+ * \li libpulse-simple - The simple PulseAudio API.
+ */
+
+#endif
diff --git a/sysroot/usr/include/pulse/sample.h b/sysroot/usr/include/pulse/sample.h
new file mode 100644
index 0000000..2df7e2c
--- /dev/null
+++ b/sysroot/usr/include/pulse/sample.h
@@ -0,0 +1,216 @@
+#ifndef foosamplehfoo
+#define foosamplehfoo
+
+/* $Id: sample.h 2157 2008-03-27 23:25:08Z lennart $ */
+
+/***
+ This file is part of PulseAudio.
+
+ Copyright 2004-2006 Lennart Poettering
+ Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
+
+ PulseAudio is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2 of the License,
+ or (at your option) any later version.
+
+ PulseAudio is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with PulseAudio; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+***/
+
+#include <inttypes.h>
+#include <sys/types.h>
+#include <sys/param.h>
+#include <math.h>
+
+#include <pulse/cdecl.h>
+
+/** \page sample Sample Format Specifications
+ *
+ * \section overv_sec Overview
+ *
+ * PulseAudio is capable of handling a multitude of sample formats, rates
+ * and channels, transparently converting and mixing them as needed.
+ *
+ * \section format_sec Sample Format
+ *
+ * PulseAudio supports the following sample formats:
+ *
+ * \li PA_SAMPLE_U8 - Unsigned 8 bit integer PCM.
+ * \li PA_SAMPLE_S16LE - Signed 16 integer bit PCM, little endian.
+ * \li PA_SAMPLE_S16BE - Signed 16 integer bit PCM, big endian.
+ * \li PA_SAMPLE_FLOAT32LE - 32 bit IEEE floating point PCM, little endian.
+ * \li PA_SAMPLE_FLOAT32BE - 32 bit IEEE floating point PCM, big endian.
+ * \li PA_SAMPLE_ALAW - 8 bit a-Law.
+ * \li PA_SAMPLE_ULAW - 8 bit mu-Law.
+ * \li PA_SAMPLE_S32LE - Signed 32 bit integer PCM, little endian.
+ * \li PA_SAMPLE_S32BE - Signed 32 bit integer PCM, big endian.
+ *
+ * The floating point sample formats have the range from -1 to 1.
+ *
+ * The sample formats that are sensitive to endianness have convenience
+ * macros for native endian (NE), and reverse endian (RE).
+ *
+ * \section rate_sec Sample Rates
+ *
+ * PulseAudio supports any sample rate between 1 Hz and 4 GHz. There is no
+ * point trying to exceed the sample rate of the output device though as the
+ * signal will only get downsampled, consuming CPU on the machine running the
+ * server.
+ *
+ * \section chan_sec Channels
+ *
+ * PulseAudio supports up to 16 individiual channels. The order of the
+ * channels is up to the application, but they must be continous. To map
+ * channels to speakers, see \ref channelmap.
+ *
+ * \section calc_sec Calculations
+ *
+ * The PulseAudio library contains a number of convenience functions to do
+ * calculations on sample formats:
+ *
+ * \li pa_bytes_per_second() - The number of bytes one second of audio will
+ * take given a sample format.
+ * \li pa_frame_size() - The size, in bytes, of one frame (i.e. one set of
+ * samples, one for each channel).
+ * \li pa_sample_size() - The size, in bytes, of one sample.
+ * \li pa_bytes_to_usec() - Calculate the time it would take to play a buffer
+ * of a certain size.
+ *
+ * \section util_sec Convenience Functions
+ *
+ * The library also contains a couple of other convenience functions:
+ *
+ * \li pa_sample_spec_valid() - Tests if a sample format specification is
+ * valid.
+ * \li pa_sample_spec_equal() - Tests if the sample format specifications are
+ * identical.
+ * \li pa_sample_format_to_string() - Return a textual description of a
+ * sample format.
+ * \li pa_parse_sample_format() - Parse a text string into a sample format.
+ * \li pa_sample_spec_snprint() - Create a textual description of a complete
+ * sample format specification.
+ * \li pa_bytes_snprint() - Pretty print a byte value (e.g. 2.5 MiB).
+ */
+
+/** \file
+ * Constants and routines for sample type handling */
+
+PA_C_DECL_BEGIN
+
+#if !defined(WORDS_BIGENDIAN)
+#if defined(__BYTE_ORDER)
+#if __BYTE_ORDER == __BIG_ENDIAN
+#define WORDS_BIGENDIAN
+#endif
+#endif
+#endif
+
+/** Maximum number of allowed channels */
+#define PA_CHANNELS_MAX 32
+
+/** Maximum allowed sample rate */
+#define PA_RATE_MAX (48000*4)
+
+/** Sample format */
+typedef enum pa_sample_format {
+ PA_SAMPLE_U8, /**< Unsigned 8 Bit PCM */
+ PA_SAMPLE_ALAW, /**< 8 Bit a-Law */
+ PA_SAMPLE_ULAW, /**< 8 Bit mu-Law */
+ PA_SAMPLE_S16LE, /**< Signed 16 Bit PCM, little endian (PC) */
+ PA_SAMPLE_S16BE, /**< Signed 16 Bit PCM, big endian */
+ PA_SAMPLE_FLOAT32LE, /**< 32 Bit IEEE floating point, little endian, range -1 to 1 */
+ PA_SAMPLE_FLOAT32BE, /**< 32 Bit IEEE floating point, big endian, range -1 to 1 */
+ PA_SAMPLE_S32LE, /**< Signed 32 Bit PCM, little endian (PC) */
+ PA_SAMPLE_S32BE, /**< Signed 32 Bit PCM, big endian (PC) */
+ PA_SAMPLE_MAX, /**< Upper limit of valid sample types */
+ PA_SAMPLE_INVALID = -1 /**< An invalid value */
+} pa_sample_format_t;
+
+#ifdef WORDS_BIGENDIAN
+/** Signed 16 Bit PCM, native endian */
+#define PA_SAMPLE_S16NE PA_SAMPLE_S16BE
+/** 32 Bit IEEE floating point, native endian */
+#define PA_SAMPLE_FLOAT32NE PA_SAMPLE_FLOAT32BE
+/** Signed 32 Bit PCM, native endian */
+#define PA_SAMPLE_S32NE PA_SAMPLE_S32BE
+/** Signed 16 Bit PCM reverse endian */
+#define PA_SAMPLE_S16RE PA_SAMPLE_S16LE
+/** 32 Bit IEEE floating point, reverse endian */
+#define PA_SAMPLE_FLOAT32RE PA_SAMPLE_FLOAT32LE
+/** Signed 32 Bit PCM reverse endian */
+#define PA_SAMPLE_S32RE PA_SAMPLE_S32LE
+#else
+/** Signed 16 Bit PCM, native endian */
+#define PA_SAMPLE_S16NE PA_SAMPLE_S16LE
+/** 32 Bit IEEE floating point, native endian */
+#define PA_SAMPLE_FLOAT32NE PA_SAMPLE_FLOAT32LE
+/** Signed 32 Bit PCM, native endian */
+#define PA_SAMPLE_S32NE PA_SAMPLE_S32LE
+/** Signed 16 Bit PCM reverse endian */
+#define PA_SAMPLE_S16RE PA_SAMPLE_S16BE
+/** 32 Bit IEEE floating point, reverse endian */
+#define PA_SAMPLE_FLOAT32RE PA_SAMPLE_FLOAT32BE
+/** Signed 32 Bit PCM reverse endian */
+#define PA_SAMPLE_S32RE PA_SAMPLE_S32BE
+#endif
+
+/** A Shortcut for PA_SAMPLE_FLOAT32NE */
+#define PA_SAMPLE_FLOAT32 PA_SAMPLE_FLOAT32NE
+
+/** A sample format and attribute specification */
+typedef struct pa_sample_spec {
+ pa_sample_format_t format; /**< The sample format */
+ uint32_t rate; /**< The sample rate. (e.g. 44100) */
+ uint8_t channels; /**< Audio channels. (1 for mono, 2 for stereo, ...) */
+} pa_sample_spec;
+
+/** Type for usec specifications (unsigned). May be either 32 or 64 bit, depending on the architecture */
+typedef uint64_t pa_usec_t;
+
+/** Return the amount of bytes playback of a second of audio with the specified sample type takes */
+size_t pa_bytes_per_second(const pa_sample_spec *spec) PA_GCC_PURE;
+
+/** Return the size of a frame with the specific sample type */
+size_t pa_frame_size(const pa_sample_spec *spec) PA_GCC_PURE;
+
+/** Return the size of a sample with the specific sample type */
+size_t pa_sample_size(const pa_sample_spec *spec) PA_GCC_PURE;
+
+/** Calculate the time the specified bytes take to play with the specified sample type */
+pa_usec_t pa_bytes_to_usec(uint64_t length, const pa_sample_spec *spec) PA_GCC_PURE;
+
+/** Calculates the number of bytes that are required for the specified time. \since 0.9 */
+size_t pa_usec_to_bytes(pa_usec_t t, const pa_sample_spec *spec) PA_GCC_PURE;
+
+/** Return non-zero when the sample type specification is valid */
+int pa_sample_spec_valid(const pa_sample_spec *spec) PA_GCC_PURE;
+
+/** Return non-zero when the two sample type specifications match */
+int pa_sample_spec_equal(const pa_sample_spec*a, const pa_sample_spec*b) PA_GCC_PURE;
+
+/** Return a descriptive string for the specified sample format. \since 0.8 */
+const char *pa_sample_format_to_string(pa_sample_format_t f) PA_GCC_PURE;
+
+/** Parse a sample format text. Inverse of pa_sample_format_to_string() */
+pa_sample_format_t pa_parse_sample_format(const char *format) PA_GCC_PURE;
+
+/** Maximum required string length for pa_sample_spec_snprint() */
+#define PA_SAMPLE_SPEC_SNPRINT_MAX 32
+
+/** Pretty print a sample type specification to a string */
+char* pa_sample_spec_snprint(char *s, size_t l, const pa_sample_spec *spec);
+
+/** Pretty print a byte size value. (i.e. "2.5 MiB") */
+char* pa_bytes_snprint(char *s, size_t l, unsigned v);
+
+PA_C_DECL_END
+
+#endif
diff --git a/sysroot/usr/include/pulse/scache.h b/sysroot/usr/include/pulse/scache.h
new file mode 100644
index 0000000..dbb2c60
--- /dev/null
+++ b/sysroot/usr/include/pulse/scache.h
@@ -0,0 +1,103 @@
+#ifndef fooscachehfoo
+#define fooscachehfoo
+
+/* $Id: scache.h 1426 2007-02-13 15:35:19Z ossman $ */
+
+/***
+ This file is part of PulseAudio.
+
+ Copyright 2004-2006 Lennart Poettering
+ Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
+
+ PulseAudio is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2 of the License,
+ or (at your option) any later version.
+
+ PulseAudio is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with PulseAudio; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+***/
+
+#include <sys/types.h>
+
+#include <pulse/context.h>
+#include <pulse/stream.h>
+#include <pulse/cdecl.h>
+
+/** \page scache Sample Cache
+ *
+ * \section overv_sec Overview
+ *
+ * The sample cache provides a simple way of overcoming high network latencies
+ * and reducing bandwidth. Instead of streaming a sound precisely when it
+ * should be played, it is stored on the server and only the command to start
+ * playing it needs to be sent.
+ *
+ * \section create_sec Creation
+ *
+ * To create a sample, the normal stream API is used (see \ref streams). The
+ * function pa_stream_connect_upload() will make sure the stream is stored as
+ * a sample on the server.
+ *
+ * To complete the upload, pa_stream_finish_upload() is called and the sample
+ * will receive the same name as the stream. If the upload should be aborted,
+ * simply call pa_stream_disconnect().
+ *
+ * \section play_sec Playing samples
+ *
+ * To play back a sample, simply call pa_context_play_sample():
+ *
+ * \code
+ * pa_operation *o;
+ *
+ * o = pa_context_play_sample(my_context,
+ * "sample2", // Name of my sample
+ * NULL, // Use default sink
+ * PA_VOLUME_NORM, // Full volume
+ * NULL, // Don't need a callback
+ * NULL
+ * );
+ * if (o)
+ * pa_operation_unref(o);
+ * \endcode
+ *
+ * \section rem_sec Removing samples
+ *
+ * When a sample is no longer needed, it should be removed on the server to
+ * save resources. The sample is deleted using pa_context_remove_sample().
+ */
+
+/** \file
+ * All sample cache related routines */
+
+PA_C_DECL_BEGIN
+
+/** Make this stream a sample upload stream */
+int pa_stream_connect_upload(pa_stream *s, size_t length);
+
+/** Finish the sample upload, the stream name will become the sample name. You cancel a samp
+ * le upload by issuing pa_stream_disconnect() */
+int pa_stream_finish_upload(pa_stream *s);
+
+/** Play a sample from the sample cache to the specified device. If the latter is NULL use the default sink. Returns an operation object */
+pa_operation* pa_context_play_sample(
+ pa_context *c /**< Context */,
+ const char *name /**< Name of the sample to play */,
+ const char *dev /**< Sink to play this sample on */,
+ pa_volume_t volume /**< Volume to play this sample with */ ,
+ pa_context_success_cb_t cb /**< Call this function after successfully starting playback, or NULL */,
+ void *userdata /**< Userdata to pass to the callback */);
+
+/** Remove a sample from the sample cache. Returns an operation object which may be used to cancel the operation while it is running */
+pa_operation* pa_context_remove_sample(pa_context *c, const char *name, pa_context_success_cb_t, void *userdata);
+
+PA_C_DECL_END
+
+#endif
diff --git a/sysroot/usr/include/pulse/simple.h b/sysroot/usr/include/pulse/simple.h
new file mode 100644
index 0000000..bfa9b38
--- /dev/null
+++ b/sysroot/usr/include/pulse/simple.h
@@ -0,0 +1,149 @@
+#ifndef foosimplehfoo
+#define foosimplehfoo
+
+/* $Id: simple.h 1999 2007-10-30 14:17:41Z lennart $ */
+
+/***
+ This file is part of PulseAudio.
+
+ Copyright 2004-2006 Lennart Poettering
+ Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
+
+ PulseAudio is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2 of the License,
+ or (at your option) any later version.
+
+ PulseAudio is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with PulseAudio; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+***/
+
+#include <sys/types.h>
+
+#include <pulse/sample.h>
+#include <pulse/channelmap.h>
+#include <pulse/def.h>
+#include <pulse/cdecl.h>
+
+/** \page simple Simple API
+ *
+ * \section overv_sec Overview
+ *
+ * The simple API is designed for applications with very basic sound
+ * playback or capture needs. It can only support a single stream per
+ * connection and has no handling of complex features like events, channel
+ * mappings and volume control. It is, however, very simple to use and
+ * quite sufficent for many programs.
+ *
+ * \section conn_sec Connecting
+ *
+ * The first step before using the sound system is to connect to the
+ * server. This is normally done this way:
+ *
+ * \code
+ * pa_simple *s;
+ * pa_sample_spec ss;
+ *
+ * ss.format = PA_SAMPLE_S16NE;
+ * ss.channels = 2;
+ * ss.rate = 44100;
+ *
+ * s = pa_simple_new(NULL, // Use the default server.
+ * "Fooapp", // Our application's name.
+ * PA_STREAM_PLAYBACK,
+ * NULL, // Use the default device.
+ * "Music", // Description of our stream.
+ * &ss, // Our sample format.
+ * NULL, // Use default channel map
+ * NULL, // Use default buffering attributes.
+ * NULL, // Ignore error code.
+ * );
+ * \endcode
+ *
+ * At this point a connected object is returned, or NULL if there was a
+ * problem connecting.
+ *
+ * \section transfer_sec Transferring data
+ *
+ * Once the connection is established to the server, data can start flowing.
+ * Using the connection is very similar to the normal read() and write()
+ * system calls. The main difference is that they're call pa_simple_read()
+ * and pa_simple_write(). Note that these operations always block.
+ *
+ * \section ctrl_sec Buffer control
+ *
+ * If a playback stream is used then a few other operations are available:
+ *
+ * \li pa_simple_drain() - Will wait for all sent data to finish playing.
+ * \li pa_simple_flush() - Will throw away all data currently in buffers.
+ * \li pa_simple_get_playback_latency() - Will return the total latency of
+ * the playback pipeline.
+ *
+ * \section cleanup_sec Cleanup
+ *
+ * Once playback or capture is complete, the connection should be closed
+ * and resources freed. This is done through:
+ *
+ * \code
+ * pa_simple_free(s);
+ * \endcode
+ */
+
+/** \file
+ * A simple but limited synchronous playback and recording
+ * API. This is a synchronous, simplified wrapper around the standard
+ * asynchronous API. */
+
+/** \example pacat-simple.c
+ * A simple playback tool using the simple API */
+
+/** \example parec-simple.c
+ * A simple recording tool using the simple API */
+
+PA_C_DECL_BEGIN
+
+/** \struct pa_simple
+ * An opaque simple connection object */
+typedef struct pa_simple pa_simple;
+
+/** Create a new connection to the server */
+pa_simple* pa_simple_new(
+ const char *server, /**< Server name, or NULL for default */
+ const char *name, /**< A descriptive name for this client (application name, ...) */
+ pa_stream_direction_t dir, /**< Open this stream for recording or playback? */
+ const char *dev, /**< Sink (resp. source) name, or NULL for default */
+ const char *stream_name, /**< A descriptive name for this client (application name, song title, ...) */
+ const pa_sample_spec *ss, /**< The sample type to use */
+ const pa_channel_map *map, /**< The channel map to use, or NULL for default */
+ const pa_buffer_attr *attr, /**< Buffering attributes, or NULL for default */
+ int *error /**< A pointer where the error code is stored when the routine returns NULL. It is OK to pass NULL here. */
+ );
+
+/** Close and free the connection to the server. The connection objects becomes invalid when this is called. */
+void pa_simple_free(pa_simple *s);
+
+/** Write some data to the server */
+int pa_simple_write(pa_simple *s, const void*data, size_t bytes, int *error);
+
+/** Wait until all data already written is played by the daemon */
+int pa_simple_drain(pa_simple *s, int *error);
+
+/** Read some data from the server */
+int pa_simple_read(pa_simple *s, void*data, size_t bytes, int *error);
+
+/** Return the playback latency. \since 0.5 */
+pa_usec_t pa_simple_get_latency(pa_simple *s, int *error);
+
+/** Flush the playback buffer. \since 0.5 */
+int pa_simple_flush(pa_simple *s, int *error);
+
+PA_C_DECL_END
+
+#endif
diff --git a/sysroot/usr/include/pulse/stream.h b/sysroot/usr/include/pulse/stream.h
new file mode 100644
index 0000000..94241a7
--- /dev/null
+++ b/sysroot/usr/include/pulse/stream.h
@@ -0,0 +1,515 @@
+#ifndef foostreamhfoo
+#define foostreamhfoo
+
+/* $Id: stream.h 2067 2007-11-21 01:30:40Z lennart $ */
+
+/***
+ This file is part of PulseAudio.
+
+ Copyright 2004-2006 Lennart Poettering
+ Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
+
+ PulseAudio is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2 of the License,
+ or (at your option) any later version.
+
+ PulseAudio is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with PulseAudio; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+***/
+
+#include <sys/types.h>
+
+#include <pulse/sample.h>
+#include <pulse/channelmap.h>
+#include <pulse/volume.h>
+#include <pulse/def.h>
+#include <pulse/cdecl.h>
+#include <pulse/operation.h>
+
+/** \page streams Audio Streams
+ *
+ * \section overv_sec Overview
+ *
+ * Audio streams form the central functionality of the sound server. Data is
+ * routed, converted and mixed from several sources before it is passed along
+ * to a final output. Currently, there are three forms of audio streams:
+ *
+ * \li Playback streams - Data flows from the client to the server.
+ * \li Record streams - Data flows from the server to the client.
+ * \li Upload streams - Similar to playback streams, but the data is stored in
+ * the sample cache. See \ref scache for more information
+ * about controlling the sample cache.
+ *
+ * \section create_sec Creating
+ *
+ * To access a stream, a pa_stream object must be created using
+ * pa_stream_new(). At this point the audio sample format and mapping of
+ * channels must be specified. See \ref sample and \ref channelmap for more
+ * information about those structures.
+ *
+ * This first step will only create a client-side object, representing the
+ * stream. To use the stream, a server-side object must be created and
+ * associated with the local object. Depending on which type of stream is
+ * desired, a different function is needed:
+ *
+ * \li Playback stream - pa_stream_connect_playback()
+ * \li Record stream - pa_stream_connect_record()
+ * \li Upload stream - pa_stream_connect_upload() (see \ref scache)
+ *
+ * Similar to how connections are done in contexts, connecting a stream will
+ * not generate a pa_operation object. Also like contexts, the application
+ * should register a state change callback, using
+ * pa_stream_set_state_callback(), and wait for the stream to enter an active
+ * state.
+ *
+ * \subsection bufattr_subsec Buffer Attributes
+ *
+ * Playback and record streams always have a server side buffer as
+ * part of the data flow. The size of this buffer strikes a
+ * compromise between low latency and sensitivity for buffer
+ * overflows/underruns.
+ *
+ * The buffer metrics may be controlled by the application. They are
+ * described with a pa_buffer_attr structure which contains a number
+ * of fields:
+ *
+ * \li maxlength - The absolute maximum number of bytes that can be stored in
+ * the buffer. If this value is exceeded then data will be
+ * lost.
+ * \li tlength - The target length of a playback buffer. The server will only
+ * send requests for more data as long as the buffer has less
+ * than this number of bytes of data.
+ * \li prebuf - Number of bytes that need to be in the buffer before
+ * playback will commence. Start of playback can be forced using
+ * pa_stream_trigger() even though the prebuffer size hasn't been
+ * reached. If a buffer underrun occurs, this prebuffering will be
+ * again enabled. If the playback shall never stop in case of a buffer
+ * underrun, this value should be set to 0. In that case the read
+ * index of the output buffer overtakes the write index, and hence the
+ * fill level of the buffer is negative.
+ * \li minreq - Minimum free number of the bytes in the playback buffer before
+ * the server will request more data.
+ * \li fragsize - Maximum number of bytes that the server will push in one
+ * chunk for record streams.
+ *
+ * The server side playback buffers are indexed by a write and a read
+ * index. The application writes to the write index and the sound
+ * device reads from the read index. The read index is increased
+ * monotonically, while the write index may be freely controlled by
+ * the application. Substracting the read index from the write index
+ * will give you the current fill level of the buffer. The read/write
+ * indexes are 64bit values and measured in bytes, they will never
+ * wrap. The current read/write index may be queried using
+ * pa_stream_get_timing_info() (see below for more information). In
+ * case of a buffer underrun the read index is equal or larger than
+ * the write index. Unless the prebuf value is 0, PulseAudio will
+ * temporarily pause playback in such a case, and wait until the
+ * buffer is filled up to prebuf bytes again. If prebuf is 0, the
+ * read index may be larger than the write index, in which case
+ * silence is played. If the application writes data to indexes lower
+ * than the read index, the data is immediately lost.
+ *
+ * \section transfer_sec Transferring Data
+ *
+ * Once the stream is up, data can start flowing between the client and the
+ * server. Two different access models can be used to transfer the data:
+ *
+ * \li Asynchronous - The application register a callback using
+ * pa_stream_set_write_callback() and
+ * pa_stream_set_read_callback() to receive notifications
+ * that data can either be written or read.
+ * \li Polled - Query the library for available data/space using
+ * pa_stream_writable_size() and pa_stream_readable_size() and
+ * transfer data as needed. The sizes are stored locally, in the
+ * client end, so there is no delay when reading them.
+ *
+ * It is also possible to mix the two models freely.
+ *
+ * Once there is data/space available, it can be transferred using either
+ * pa_stream_write() for playback, or pa_stream_peek() / pa_stream_drop() for
+ * record. Make sure you do not overflow the playback buffers as data will be
+ * dropped.
+ *
+ * \section bufctl_sec Buffer Control
+ *
+ * The transfer buffers can be controlled through a number of operations:
+ *
+ * \li pa_stream_cork() - Start or stop the playback or recording.
+ * \li pa_stream_trigger() - Start playback immediatly and do not wait for
+ * the buffer to fill up to the set trigger level.
+ * \li pa_stream_prebuf() - Reenable the playback trigger level.
+ * \li pa_stream_drain() - Wait for the playback buffer to go empty. Will
+ * return a pa_operation object that will indicate when
+ * the buffer is completely drained.
+ * \li pa_stream_flush() - Drop all data from the playback buffer and do not
+ * wait for it to finish playing.
+ *
+ * \section seek_modes Seeking in the Playback Buffer
+ *
+ * A client application may freely seek in the playback buffer. To
+ * accomplish that the pa_stream_write() function takes a seek mode
+ * and an offset argument. The seek mode is one of:
+ *
+ * \li PA_SEEK_RELATIVE - seek relative to the current write index
+ * \li PA_SEEK_ABSOLUTE - seek relative to the beginning of the playback buffer, (i.e. the first that was ever played in the stream)
+ * \li PA_SEEK_RELATIVE_ON_READ - seek relative to the current read index. Use this to write data to the output buffer that should be played as soon as possible
+ * \li PA_SEEK_RELATIVE_END - seek relative to the last byte ever written.
+ *
+ * If an application just wants to append some data to the output
+ * buffer, PA_SEEK_RELATIVE and an offset of 0 should be used.
+ *
+ * After a call to pa_stream_write() the write index will be left at
+ * the position right after the last byte of the written data.
+ *
+ * \section latency_sec Latency
+ *
+ * A major problem with networked audio is the increased latency caused by
+ * the network. To remedy this, PulseAudio supports an advanced system of
+ * monitoring the current latency.
+ *
+ * To get the raw data needed to calculate latencies, call
+ * pa_stream_get_timing_info(). This will give you a pa_timing_info
+ * structure that contains everything that is known about the server
+ * side buffer transport delays and the backend active in the
+ * server. (Besides other things it contains the write and read index
+ * values mentioned above.)
+ *
+ * This structure is updated every time a
+ * pa_stream_update_timing_info() operation is executed. (i.e. before
+ * the first call to this function the timing information structure is
+ * not available!) Since it is a lot of work to keep this structure
+ * up-to-date manually, PulseAudio can do that automatically for you:
+ * if PA_STREAM_AUTO_TIMING_UPDATE is passed when connecting the
+ * stream PulseAudio will automatically update the structure every
+ * 100ms and every time a function is called that might invalidate the
+ * previously known timing data (such as pa_stream_write() or
+ * pa_stream_flush()). Please note however, that there always is a
+ * short time window when the data in the timing information structure
+ * is out-of-date. PulseAudio tries to mark these situations by
+ * setting the write_index_corrupt and read_index_corrupt fields
+ * accordingly.
+ *
+ * The raw timing data in the pa_timing_info structure is usually hard
+ * to deal with. Therefore a more simplistic interface is available:
+ * you can call pa_stream_get_time() or pa_stream_get_latency(). The
+ * former will return the current playback time of the hardware since
+ * the stream has been started. The latter returns the time a sample
+ * that you write now takes to be played by the hardware. These two
+ * functions base their calculations on the same data that is returned
+ * by pa_stream_get_timing_info(). Hence the same rules for keeping
+ * the timing data up-to-date apply here. In case the write or read
+ * index is corrupted, these two functions will fail with
+ * PA_ERR_NODATA set.
+ *
+ * Since updating the timing info structure usually requires a full
+ * network round trip and some applications monitor the timing very
+ * often PulseAudio offers a timing interpolation system. If
+ * PA_STREAM_INTERPOLATE_TIMING is passed when connecting the stream,
+ * pa_stream_get_time() and pa_stream_get_latency() will try to
+ * interpolate the current playback time/latency by estimating the
+ * number of samples that have been played back by the hardware since
+ * the last regular timing update. It is espcially useful to combine
+ * this option with PA_STREAM_AUTO_TIMING_UPDATE, which will enable
+ * you to monitor the current playback time/latency very precisely and
+ * very frequently without requiring a network round trip every time.
+ *
+ * \section flow_sec Overflow and underflow
+ *
+ * Even with the best precautions, buffers will sometime over - or
+ * underflow. To handle this gracefully, the application can be
+ * notified when this happens. Callbacks are registered using
+ * pa_stream_set_overflow_callback() and
+ * pa_stream_set_underflow_callback().
+ *
+ * \section sync_streams Sychronizing Multiple Playback Streams
+ *
+ * PulseAudio allows applications to fully synchronize multiple
+ * playback streams that are connected to the same output device. That
+ * means the streams will always be played back sample-by-sample
+ * synchronously. If stream operations like pa_stream_cork() are
+ * issued on one of the synchronized streams, they are simultaneously
+ * issued on the others.
+ *
+ * To synchronize a stream to another, just pass the "master" stream
+ * as last argument to pa_stream_connect_playack(). To make sure that
+ * the freshly created stream doesn't start playback right-away, make
+ * sure to pass PA_STREAM_START_CORKED and - after all streams have
+ * been created - uncork them all with a single call to
+ * pa_stream_cork() for the master stream.
+ *
+ * To make sure that a particular stream doesn't stop to play when a
+ * server side buffer underrun happens on it while the other
+ * synchronized streams continue playing and hence deviate you need to
+ * pass a "prebuf" pa_buffer_attr of 0 when connecting it.
+ *
+ * \section disc_sec Disconnecting
+ *
+ * When a stream has served is purpose it must be disconnected with
+ * pa_stream_disconnect(). If you only unreference it, then it will live on
+ * and eat resources both locally and on the server until you disconnect the
+ * context.
+ *
+ */
+
+/** \file
+ * Audio streams for input, output and sample upload */
+
+PA_C_DECL_BEGIN
+
+/** An opaque stream for playback or recording */
+typedef struct pa_stream pa_stream;
+
+/** A generic callback for operation completion */
+typedef void (*pa_stream_success_cb_t) (pa_stream*s, int success, void *userdata);
+
+/** A generic request callback */
+typedef void (*pa_stream_request_cb_t)(pa_stream *p, size_t bytes, void *userdata);
+
+/** A generic notification callback */
+typedef void (*pa_stream_notify_cb_t)(pa_stream *p, void *userdata);
+
+/** Create a new, unconnected stream with the specified name and sample type */
+pa_stream* pa_stream_new(
+ pa_context *c /**< The context to create this stream in */,
+ const char *name /**< A name for this stream */,
+ const pa_sample_spec *ss /**< The desired sample format */,
+ const pa_channel_map *map /**< The desired channel map, or NULL for default */);
+
+/** Decrease the reference counter by one */
+void pa_stream_unref(pa_stream *s);
+
+/** Increase the reference counter by one */
+pa_stream *pa_stream_ref(pa_stream *s);
+
+/** Return the current state of the stream */
+pa_stream_state_t pa_stream_get_state(pa_stream *p);
+
+/** Return the context this stream is attached to */
+pa_context* pa_stream_get_context(pa_stream *p);
+
+/** Return the sink input resp. source output index this stream is
+ * identified in the server with. This is useful for usage with the
+ * introspection functions, such as pa_context_get_sink_input_info()
+ * resp. pa_context_get_source_output_info(). */
+uint32_t pa_stream_get_index(pa_stream *s);
+
+/** Return the index of the sink or source this stream is connected to
+ * in the server. This is useful for usage with the introspection
+ * functions, such as pa_context_get_sink_info_by_index()
+ * resp. pa_context_get_source_info_by_index(). Please note that
+ * streams may be moved between sinks/sources and thus it is
+ * recommended to use pa_stream_set_moved_callback() to be notified
+ * about this. This function will return with PA_ERR_NOTSUPPORTED when the
+ * server is older than 0.9.8. \since 0.9.8 */
+uint32_t pa_stream_get_device_index(pa_stream *s);
+
+/** Return the name of the sink or source this stream is connected to
+ * in the server. This is useful for usage with the introspection
+ * functions, such as pa_context_get_sink_info_by_name()
+ * resp. pa_context_get_source_info_by_name(). Please note that
+ * streams may be moved between sinks/sources and thus it is
+ * recommended to use pa_stream_set_moved_callback() to be notified
+ * about this. This function will return with PA_ERR_NOTSUPPORTED when the
+ * server is older than 0.9.8. \since 0.9.8 */
+const char *pa_stream_get_device_name(pa_stream *s);
+
+/** Return 1 if the sink or source this stream is connected to has
+ * been suspended. This will return 0 if not, and negative on
+ * error. This function will return with PA_ERR_NOTSUPPORTED when the
+ * server is older than 0.9.8. \since 0.9.8 */
+int pa_stream_is_suspended(pa_stream *s);
+
+/** Connect the stream to a sink */
+int pa_stream_connect_playback(
+ pa_stream *s /**< The stream to connect to a sink */,
+ const char *dev /**< Name of the sink to connect to, or NULL for default */ ,
+ const pa_buffer_attr *attr /**< Buffering attributes, or NULL for default */,
+ pa_stream_flags_t flags /**< Additional flags, or 0 for default */,
+ pa_cvolume *volume /**< Initial volume, or NULL for default */,
+ pa_stream *sync_stream /**< Synchronize this stream with the specified one, or NULL for a standalone stream*/);
+
+/** Connect the stream to a source */
+int pa_stream_connect_record(
+ pa_stream *s /**< The stream to connect to a source */ ,
+ const char *dev /**< Name of the source to connect to, or NULL for default */,
+ const pa_buffer_attr *attr /**< Buffer attributes, or NULL for default */,
+ pa_stream_flags_t flags /**< Additional flags, or 0 for default */);
+
+/** Disconnect a stream from a source/sink */
+int pa_stream_disconnect(pa_stream *s);
+
+/** Write some data to the server (for playback sinks), if free_cb is
+ * non-NULL this routine is called when all data has been written out
+ * and an internal reference to the specified data is kept, the data
+ * is not copied. If NULL, the data is copied into an internal
+ * buffer. The client my freely seek around in the output buffer. For
+ * most applications passing 0 and PA_SEEK_RELATIVE as arguments for
+ * offset and seek should be useful.*/
+int pa_stream_write(
+ pa_stream *p /**< The stream to use */,
+ const void *data /**< The data to write */,
+ size_t bytes /**< The length of the data to write in bytes*/,
+ pa_free_cb_t free_cb /**< A cleanup routine for the data or NULL to request an internal copy */,
+ int64_t offset, /**< Offset for seeking, must be 0 for upload streams */
+ pa_seek_mode_t seek /**< Seek mode, must be PA_SEEK_RELATIVE for upload streams */);
+
+/** Read the next fragment from the buffer (for recording).
+ * data will point to the actual data and length will contain the size
+ * of the data in bytes (which can be less than a complete framgnet).
+ * Use pa_stream_drop() to actually remove the data from the
+ * buffer. If no data is available will return a NULL pointer \since 0.8 */
+int pa_stream_peek(
+ pa_stream *p /**< The stream to use */,
+ const void **data /**< Pointer to pointer that will point to data */,
+ size_t *bytes /**< The length of the data read in bytes */);
+
+/** Remove the current fragment on record streams. It is invalid to do this without first
+ * calling pa_stream_peek(). \since 0.8 */
+int pa_stream_drop(pa_stream *p);
+
+/** Return the number of bytes that may be written using pa_stream_write() */
+size_t pa_stream_writable_size(pa_stream *p);
+
+/** Return the number of bytes that may be read using pa_stream_read() \since 0.8 */
+size_t pa_stream_readable_size(pa_stream *p);
+
+/** Drain a playback stream. Use this for notification when the buffer is empty */
+pa_operation* pa_stream_drain(pa_stream *s, pa_stream_success_cb_t cb, void *userdata);
+
+/** Request a timing info structure update for a stream. Use
+ * pa_stream_get_timing_info() to get access to the raw timing data,
+ * or pa_stream_get_time() or pa_stream_get_latency() to get cleaned
+ * up values. */
+pa_operation* pa_stream_update_timing_info(pa_stream *p, pa_stream_success_cb_t cb, void *userdata);
+
+/** Set the callback function that is called whenever the state of the stream changes */
+void pa_stream_set_state_callback(pa_stream *s, pa_stream_notify_cb_t cb, void *userdata);
+
+/** Set the callback function that is called when new data may be
+ * written to the stream. */
+void pa_stream_set_write_callback(pa_stream *p, pa_stream_request_cb_t cb, void *userdata);
+
+/** Set the callback function that is called when new data is available from the stream.
+ * Return the number of bytes read. \since 0.8 */
+void pa_stream_set_read_callback(pa_stream *p, pa_stream_request_cb_t cb, void *userdata);
+
+/** Set the callback function that is called when a buffer overflow happens. (Only for playback streams) \since 0.8 */
+void pa_stream_set_overflow_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata);
+
+/** Set the callback function that is called when a buffer underflow happens. (Only for playback streams) \since 0.8 */
+void pa_stream_set_underflow_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata);
+
+/** Set the callback function that is called whenever a latency
+ * information update happens. Useful on PA_STREAM_AUTO_TIMING_UPDATE
+ * streams only. (Only for playback streams) \since 0.8.2 */
+void pa_stream_set_latency_update_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata);
+
+/** Set the callback function that is called whenever the stream is
+ * moved to a different sink/source. Use pa_stream_get_device_name()or
+ * pa_stream_get_device_index() to query the new sink/source. This
+ * notification is only generated when the server is at least
+ * 0.9.8. \since 0.9.8 */
+void pa_stream_set_moved_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata);
+
+/** Set the callback function that is called whenever the sink/source
+ * this stream is connected to is suspended or resumed. Use
+ * pa_stream_is_suspended() to query the new suspend status. Please
+ * note that the suspend status might also change when the stream is
+ * moved between devices. Thus if you call this function you very
+ * likely want to call pa_stream_set_moved_callback, too. This
+ * notification is only generated when the server is at least
+ * 0.9.8. \since 0.9.8 */
+void pa_stream_set_suspended_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata);
+
+/** Pause (or resume) playback of this stream temporarily. Available on both playback and recording streams. \since 0.3 */
+pa_operation* pa_stream_cork(pa_stream *s, int b, pa_stream_success_cb_t cb, void *userdata);
+
+/** Flush the playback buffer of this stream. Most of the time you're
+ * better off using the parameter delta of pa_stream_write() instead of this
+ * function. Available on both playback and recording streams. \since 0.3 */
+pa_operation* pa_stream_flush(pa_stream *s, pa_stream_success_cb_t cb, void *userdata);
+
+/** Reenable prebuffering as specified in the pa_buffer_attr
+ * structure. Available for playback streams only. \since 0.6 */
+pa_operation* pa_stream_prebuf(pa_stream *s, pa_stream_success_cb_t cb, void *userdata);
+
+/** Request immediate start of playback on this stream. This disables
+ * prebuffering as specified in the pa_buffer_attr
+ * structure, temporarily. Available for playback streams only. \since 0.3 */
+pa_operation* pa_stream_trigger(pa_stream *s, pa_stream_success_cb_t cb, void *userdata);
+
+/** Rename the stream. \since 0.5 */
+pa_operation* pa_stream_set_name(pa_stream *s, const char *name, pa_stream_success_cb_t cb, void *userdata);
+
+/** Return the current playback/recording time. This is based on the
+ * data in the timing info structure returned by
+ * pa_stream_get_timing_info(). This function will usually only return
+ * new data if a timing info update has been recieved. Only if timing
+ * interpolation has been requested (PA_STREAM_INTERPOLATE_TIMING)
+ * the data from the last timing update is used for an estimation of
+ * the current playback/recording time based on the local time that
+ * passed since the timing info structure has been acquired. The time
+ * value returned by this function is guaranteed to increase
+ * monotonically. (that means: the returned value is always greater or
+ * equal to the value returned on the last call) This behaviour can
+ * be disabled by using PA_STREAM_NOT_MONOTONOUS. This may be
+ * desirable to deal better with bad estimations of transport
+ * latencies, but may have strange effects if the application is not
+ * able to deal with time going 'backwards'. \since 0.6 */
+int pa_stream_get_time(pa_stream *s, pa_usec_t *r_usec);
+
+/** Return the total stream latency. This function is based on
+ * pa_stream_get_time(). In case the stream is a monitoring stream the
+ * result can be negative, i.e. the captured samples are not yet
+ * played. In this case *negative is set to 1. \since 0.6 */
+int pa_stream_get_latency(pa_stream *s, pa_usec_t *r_usec, int *negative);
+
+/** Return the latest raw timing data structure. The returned pointer
+ * points to an internal read-only instance of the timing
+ * structure. The user should make a copy of this structure if he
+ * wants to modify it. An in-place update to this data structure may
+ * be requested using pa_stream_update_timing_info(). If no
+ * pa_stream_update_timing_info() call was issued before, this
+ * function will fail with PA_ERR_NODATA. Please note that the
+ * write_index member field (and only this field) is updated on each
+ * pa_stream_write() call, not just when a timing update has been
+ * recieved. \since 0.8 */
+const pa_timing_info* pa_stream_get_timing_info(pa_stream *s);
+
+/** Return a pointer to the stream's sample specification. \since 0.6 */
+const pa_sample_spec* pa_stream_get_sample_spec(pa_stream *s);
+
+/** Return a pointer to the stream's channel map. \since 0.8 */
+const pa_channel_map* pa_stream_get_channel_map(pa_stream *s);
+
+/** Return the buffer metrics of the stream. Only valid after the
+ * stream has been connected successfuly and if the server is at least
+ * PulseAudio 0.9. \since 0.9.0 */
+const pa_buffer_attr* pa_stream_get_buffer_attr(pa_stream *s);
+
+/** Change the buffer metrics of the stream during playback. The
+ * server might have chosen different buffer metrics then
+ * requested. The selected metrics may be queried with
+ * pa_stream_get_buffer_attr() as soon as the callback is called. Only
+ * valid after the stream has been connected successfully and if the
+ * server is at least PulseAudio 0.9.8. \since 0.9.8 */
+pa_operation *pa_stream_set_buffer_attr(pa_stream *s, const pa_buffer_attr *attr, pa_stream_success_cb_t cb, void *userdata);
+
+/* Change the stream sampling rate during playback. You need to pass
+ * PA_STREAM_VARIABLE_RATE in the flags parameter of
+ * pa_stream_connect() if you plan to use this function. Only valid
+ * after the stream has been connected successfully and if the server
+ * is at least PulseAudio 0.9.8. \since 0.9.8 */
+pa_operation *pa_stream_update_sample_rate(pa_stream *s, uint32_t rate, pa_stream_success_cb_t cb, void *userdata);
+
+PA_C_DECL_END
+
+#endif
diff --git a/sysroot/usr/include/pulse/subscribe.h b/sysroot/usr/include/pulse/subscribe.h
new file mode 100644
index 0000000..6b4b55f
--- /dev/null
+++ b/sysroot/usr/include/pulse/subscribe.h
@@ -0,0 +1,64 @@
+#ifndef foosubscribehfoo
+#define foosubscribehfoo
+
+/* $Id: subscribe.h 1426 2007-02-13 15:35:19Z ossman $ */
+
+/***
+ This file is part of PulseAudio.
+
+ Copyright 2004-2006 Lennart Poettering
+ Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
+
+ PulseAudio is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2 of the License,
+ or (at your option) any later version.
+
+ PulseAudio is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with PulseAudio; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+***/
+
+#include <inttypes.h>
+
+#include <pulse/def.h>
+#include <pulse/context.h>
+#include <pulse/cdecl.h>
+
+/** \page subscribe Event Subscription
+ *
+ * \section overv_sec Overview
+ *
+ * The application can be notified, asynchronously, whenever the internal
+ * layout of the server changes. Possible notifications are desribed in the
+ * \ref pa_subscription_event_type and \ref pa_subscription_mask
+ * enumerations.
+ *
+ * The application sets the notification mask using pa_context_subscribe()
+ * and the function that will be called whenever a notification occurs using
+ * pa_context_set_subscribe_callback().
+ */
+
+/** \file
+ * Daemon introspection event subscription subsystem. */
+
+PA_C_DECL_BEGIN
+
+/** Subscription event callback prototype */
+typedef void (*pa_context_subscribe_cb_t)(pa_context *c, pa_subscription_event_type_t t, uint32_t idx, void *userdata);
+
+/** Enable event notification */
+pa_operation* pa_context_subscribe(pa_context *c, pa_subscription_mask_t m, pa_context_success_cb_t cb, void *userdata);
+
+/** Set the context specific call back function that is called whenever the state of the daemon changes */
+void pa_context_set_subscribe_callback(pa_context *c, pa_context_subscribe_cb_t cb, void *userdata);
+
+PA_C_DECL_END
+
+#endif
diff --git a/sysroot/usr/include/pulse/thread-mainloop.h b/sysroot/usr/include/pulse/thread-mainloop.h
new file mode 100644
index 0000000..fbc1423
--- /dev/null
+++ b/sysroot/usr/include/pulse/thread-mainloop.h
@@ -0,0 +1,305 @@
+#ifndef foothreadmainloophfoo
+#define foothreadmainloophfoo
+
+/* $Id: thread-mainloop.h 1971 2007-10-28 19:13:50Z lennart $ */
+
+/***
+ This file is part of PulseAudio.
+
+ Copyright 2006 Lennart Poettering
+ Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
+
+ PulseAudio is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2 of the License,
+ or (at your option) any later version.
+
+ PulseAudio is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with PulseAudio; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+***/
+
+#include <pulse/mainloop-api.h>
+#include <pulse/cdecl.h>
+
+PA_C_DECL_BEGIN
+
+/** \page threaded_mainloop Threaded Main Loop
+ *
+ * \section overv_sec Overview
+ *
+ * The threaded main loop implementation is a special version of the primary
+ * main loop implementation (see \ref mainloop). For the basic design, see
+ * its documentation.
+ *
+ * The added feature in the threaded main loop is that it spawns a new thread
+ * that runs the real main loop. This allows a synchronous application to use
+ * the asynchronous API without risking to stall the PulseAudio library.
+ *
+ * \section creat_sec Creation
+ *
+ * A pa_threaded_mainloop object is created using pa_threaded_mainloop_new().
+ * This will only allocate the required structures though, so to use it the
+ * thread must also be started. This is done through
+ * pa_threaded_mainloop_start(), after which you can start using the main loop.
+ *
+ * \section destr_sec Destruction
+ *
+ * When the PulseAudio connection has been terminated, the thread must be
+ * stopped and the resources freed. Stopping the thread is done using
+ * pa_threaded_mainloop_stop(), which must be called without the lock (see
+ * below) held. When that function returns, the thread is stopped and the
+ * pa_threaded_mainloop object can be freed using pa_threaded_mainloop_free().
+ *
+ * \section lock_sec Locking
+ *
+ * Since the PulseAudio API doesn't allow concurrent accesses to objects,
+ * a locking scheme must be used to guarantee safe usage. The threaded main
+ * loop API provides such a scheme through the functions
+ * pa_threaded_mainloop_lock() and pa_threaded_mainloop_unlock().
+ *
+ * The lock is recursive, so it's safe to use it multiple times from the same
+ * thread. Just make sure you call pa_threaded_mainloop_unlock() the same
+ * number of times you called pa_threaded_mainloop_lock().
+ *
+ * The lock needs to be held whenever you call any PulseAudio function that
+ * uses an object associated with this main loop. Make sure you do not hold
+ * on to the lock more than necessary though, as the threaded main loop stops
+ * while the lock is held.
+ *
+ * Example:
+ *
+ * \code
+ * void my_check_stream_func(pa_threaded_mainloop *m, pa_stream *s) {
+ * pa_stream_state_t state;
+ *
+ * pa_threaded_mainloop_lock(m);
+ *
+ * state = pa_stream_get_state(s);
+ *
+ * pa_threaded_mainloop_unlock(m);
+ *
+ * if (state == PA_STREAM_READY)
+ * printf("Stream is ready!");
+ * else
+ * printf("Stream is not ready!");
+ * }
+ * \endcode
+ *
+ * \section cb_sec Callbacks
+ *
+ * Callbacks in PulseAudio are asynchronous, so they require extra care when
+ * using them together with a threaded main loop.
+ *
+ * The easiest way to turn the callback based operations into synchronous
+ * ones, is to simply wait for the callback to be called and continue from
+ * there. This is the approach chosen in PulseAudio's threaded API.
+ *
+ * \subsection basic_subsec Basic callbacks
+ *
+ * For the basic case, where all that is required is to wait for the callback
+ * to be invoked, the code should look something like this:
+ *
+ * Example:
+ *
+ * \code
+ * static void my_drain_callback(pa_stream*s, int success, void *userdata) {
+ * pa_threaded_mainloop *m;
+ *
+ * m = (pa_threaded_mainloop*)userdata;
+ * assert(m);
+ *
+ * pa_threaded_mainloop_signal(m, 0);
+ * }
+ *
+ * void my_drain_stream_func(pa_threaded_mainloop *m, pa_stream *s) {
+ * pa_operation *o;
+ *
+ * pa_threaded_mainloop_lock(m);
+ *
+ * o = pa_stream_drain(s, my_drain_callback, m);
+ * assert(o);
+ *
+ * while (pa_operation_get_state(o) != OPERATION_DONE)
+ * pa_threaded_mainloop_wait(m);
+ *
+ * pa_operation_unref(o);
+ *
+ * pa_threaded_mainloop_unlock(m);
+ * }
+ * \endcode
+ *
+ * The main function, my_drain_stream_func(), will wait for the callback to
+ * be called using pa_threaded_mainloop_wait().
+ *
+ * If your application is multi-threaded, then this waiting must be done
+ * inside a while loop. The reason for this is that multiple threads might be
+ * using pa_threaded_mainloop_wait() at the same time. Each thread must
+ * therefore verify that it was its callback that was invoked.
+ *
+ * The callback, my_drain_callback(), indicates to the main function that it
+ * has been called using pa_threaded_mainloop_signal().
+ *
+ * As you can see, both pa_threaded_mainloop_wait() may only be called with
+ * the lock held. The same thing is true for pa_threaded_mainloop_signal(),
+ * but as the lock is held before the callback is invoked, you do not have to
+ * deal with that.
+ *
+ * The functions will not dead lock because the wait function will release
+ * the lock before waiting and then regrab it once it has been signaled.
+ * For those of you familiar with threads, the behaviour is that of a
+ * condition variable.
+ *
+ * \subsection data_subsec Data callbacks
+ *
+ * For many callbacks, simply knowing that they have been called is
+ * insufficient. The callback also receives some data that is desired. To
+ * access this data safely, we must extend our example a bit:
+ *
+ * \code
+ * static int *drain_result;
+ *
+ * static void my_drain_callback(pa_stream*s, int success, void *userdata) {
+ * pa_threaded_mainloop *m;
+ *
+ * m = (pa_threaded_mainloop*)userdata;
+ * assert(m);
+ *
+ * drain_result = &success;
+ *
+ * pa_threaded_mainloop_signal(m, 1);
+ * }
+ *
+ * void my_drain_stream_func(pa_threaded_mainloop *m, pa_stream *s) {
+ * pa_operation *o;
+ *
+ * pa_threaded_mainloop_lock(m);
+ *
+ * o = pa_stream_drain(s, my_drain_callback, m);
+ * assert(o);
+ *
+ * while (pa_operation_get_state(o) != OPERATION_DONE)
+ * pa_threaded_mainloop_wait(m);
+ *
+ * pa_operation_unref(o);
+ *
+ * if (*drain_result)
+ * printf("Success!");
+ * else
+ * printf("Bitter defeat...");
+ *
+ * pa_threaded_mainloop_accept(m);
+ *
+ * pa_threaded_mainloop_unlock(m);
+ * }
+ * \endcode
+ *
+ * The example is a bit silly as it would probably have been easier to just
+ * copy the contents of success, but for larger data structures this can be
+ * wasteful.
+ *
+ * The difference here compared to the basic callback is the 1 sent to
+ * pa_threaded_mainloop_signal() and the call to
+ * pa_threaded_mainloop_accept(). What will happen is that
+ * pa_threaded_mainloop_signal() will signal the main function and then stop.
+ * The main function is then free to use the data in the callback until
+ * pa_threaded_mainloop_accept() is called, which will allow the callback
+ * to continue.
+ *
+ * Note that pa_threaded_mainloop_accept() must be called some time between
+ * exiting the while loop and unlocking the main loop! Failure to do so will
+ * result in a race condition. I.e. it is not ok to release the lock and
+ * regrab it before calling pa_threaded_mainloop_accept().
+ *
+ * \subsection async_subsec Asynchronous callbacks
+ *
+ * PulseAudio also has callbacks that are completely asynchronous, meaning
+ * that they can be called at any time. The threading main loop API provides
+ * the locking mechanism to handle concurrent accesses, but nothing else.
+ * Applications will have to handle communication from the callback to the
+ * main program through some own system.
+ *
+ * The callbacks that are completely asynchronous are:
+ *
+ * \li State callbacks for contexts, streams, etc.
+ * \li Subscription notifications
+ */
+
+/** \file
+ *
+ * A thread based event loop implementation based on pa_mainloop. The
+ * event loop is run in a helper thread in the background. A few
+ * synchronization primitives are available to access the objects
+ * attached to the event loop safely. */
+
+/** An opaque threaded main loop object */
+typedef struct pa_threaded_mainloop pa_threaded_mainloop;
+
+/** Allocate a new threaded main loop object. You have to call
+ * pa_threaded_mainloop_start() before the event loop thread starts
+ * running. */
+pa_threaded_mainloop *pa_threaded_mainloop_new(void);
+
+/** Free a threaded main loop object. If the event loop thread is
+ * still running, it is terminated using pa_threaded_mainloop_stop()
+ * first. */
+void pa_threaded_mainloop_free(pa_threaded_mainloop* m);
+
+/** Start the event loop thread. */
+int pa_threaded_mainloop_start(pa_threaded_mainloop *m);
+
+/** Terminate the event loop thread cleanly. Make sure to unlock the
+ * mainloop object before calling this function. */
+void pa_threaded_mainloop_stop(pa_threaded_mainloop *m);
+
+/** Lock the event loop object, effectively blocking the event loop
+ * thread from processing events. You can use this to enforce
+ * exclusive access to all objects attached to the event loop. This
+ * lock is recursive. This function may not be called inside the event
+ * loop thread. Events that are dispatched from the event loop thread
+ * are executed with this lock held. */
+void pa_threaded_mainloop_lock(pa_threaded_mainloop *m);
+
+/** Unlock the event loop object, inverse of pa_threaded_mainloop_lock() */
+void pa_threaded_mainloop_unlock(pa_threaded_mainloop *m);
+
+/** Wait for an event to be signalled by the event loop thread. You
+ * can use this to pass data from the event loop thread to the main
+ * thread in synchronized fashion. This function may not be called
+ * inside the event loop thread. Prior to this call the event loop
+ * object needs to be locked using pa_threaded_mainloop_lock(). While
+ * waiting the lock will be released, immediately before returning it
+ * will be acquired again. */
+void pa_threaded_mainloop_wait(pa_threaded_mainloop *m);
+
+/** Signal all threads waiting for a signalling event in
+ * pa_threaded_mainloop_wait(). If wait_for_release is non-zero, do
+ * not return before the signal was accepted by a
+ * pa_threaded_mainloop_accept() call. While waiting for that condition
+ * the event loop object is unlocked. */
+void pa_threaded_mainloop_signal(pa_threaded_mainloop *m, int wait_for_accept);
+
+/** Accept a signal from the event thread issued with
+ * pa_threaded_mainloop_signal(). This call should only be used in
+ * conjunction with pa_threaded_mainloop_signal() with a non-zero
+ * wait_for_accept value. */
+void pa_threaded_mainloop_accept(pa_threaded_mainloop *m);
+
+/** Return the return value as specified with the main loop's quit() routine. */
+int pa_threaded_mainloop_get_retval(pa_threaded_mainloop *m);
+
+/** Return the abstract main loop abstraction layer vtable for this main loop. */
+pa_mainloop_api* pa_threaded_mainloop_get_api(pa_threaded_mainloop*m);
+
+/** Returns non-zero when called from withing the event loop thread. \since 0.9.7 */
+int pa_threaded_mainloop_in_thread(pa_threaded_mainloop *m);
+
+PA_C_DECL_END
+
+#endif
diff --git a/sysroot/usr/include/pulse/timeval.h b/sysroot/usr/include/pulse/timeval.h
new file mode 100644
index 0000000..d0db9d4
--- /dev/null
+++ b/sysroot/usr/include/pulse/timeval.h
@@ -0,0 +1,67 @@
+#ifndef footimevalhfoo
+#define footimevalhfoo
+
+/* $Id: timeval.h 1971 2007-10-28 19:13:50Z lennart $ */
+
+/***
+ This file is part of PulseAudio.
+
+ Copyright 2004-2006 Lennart Poettering
+ Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
+
+ PulseAudio is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ PulseAudio is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with PulseAudio; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+***/
+
+#include <pulse/cdecl.h>
+#include <pulse/sample.h>
+
+/** \file
+ * Utility functions for handling timeval calculations */
+
+PA_C_DECL_BEGIN
+
+#define PA_MSEC_PER_SEC 1000
+#define PA_USEC_PER_SEC 1000000
+#define PA_NSEC_PER_SEC 1000000000
+#define PA_USEC_PER_MSEC 1000
+
+struct timeval;
+
+/** Return the current timestamp, just like UNIX gettimeofday() */
+struct timeval *pa_gettimeofday(struct timeval *tv);
+
+/** Calculate the difference between the two specified timeval
+ * structs. */
+pa_usec_t pa_timeval_diff(const struct timeval *a, const struct timeval *b) PA_GCC_PURE;
+
+/** Compare the two timeval structs and return 0 when equal, negative when a < b, positive otherwse */
+int pa_timeval_cmp(const struct timeval *a, const struct timeval *b) PA_GCC_PURE;
+
+/** Return the time difference between now and the specified timestamp */
+pa_usec_t pa_timeval_age(const struct timeval *tv);
+
+/** Add the specified time inmicroseconds to the specified timeval structure */
+struct timeval* pa_timeval_add(struct timeval *tv, pa_usec_t v) PA_GCC_PURE;
+
+/** Store the specified uec value in the timeval struct. \since 0.9.7 */
+struct timeval* pa_timeval_store(struct timeval *tv, pa_usec_t v);
+
+/** Load the specified tv value and return it in usec. \since 0.9.7 */
+pa_usec_t pa_timeval_load(const struct timeval *tv);
+
+PA_C_DECL_END
+
+#endif
diff --git a/sysroot/usr/include/pulse/utf8.h b/sysroot/usr/include/pulse/utf8.h
new file mode 100644
index 0000000..3f79862
--- /dev/null
+++ b/sysroot/usr/include/pulse/utf8.h
@@ -0,0 +1,50 @@
+#ifndef fooutf8hfoo
+#define fooutf8hfoo
+
+/* $Id: utf8.h 1971 2007-10-28 19:13:50Z lennart $ */
+
+/***
+ This file is part of PulseAudio.
+
+ Copyright 2006 Lennart Poettering
+ Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
+
+ PulseAudio is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ PulseAudio is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with PulseAudio; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+***/
+
+#include <pulse/cdecl.h>
+
+/** \file
+ * UTF8 Validation functions
+ */
+
+PA_C_DECL_BEGIN
+
+/** Test if the specified strings qualifies as valid UTF8. Return the string if so, otherwise NULL */
+char *pa_utf8_valid(const char *str) PA_GCC_PURE;
+
+/** Filter all invalid UTF8 characters from the specified string, returning a new fully UTF8 valid string. Don't forget to free the returned string with pa_xfree() */
+char *pa_utf8_filter(const char *str);
+
+/** Convert a UTF-8 string to the current locale. Free the string using pa_xfree(). */
+char* pa_utf8_to_locale (const char *str);
+
+/** Convert a string in the current locale to UTF-8. Free the string using pa_xfree(). */
+char* pa_locale_to_utf8 (const char *str);
+
+PA_C_DECL_END
+
+#endif
diff --git a/sysroot/usr/include/pulse/util.h b/sysroot/usr/include/pulse/util.h
new file mode 100644
index 0000000..96aeb92
--- /dev/null
+++ b/sysroot/usr/include/pulse/util.h
@@ -0,0 +1,62 @@
+#ifndef fooutilhfoo
+#define fooutilhfoo
+
+/* $Id: util.h 1971 2007-10-28 19:13:50Z lennart $ */
+
+/***
+ This file is part of PulseAudio.
+
+ Copyright 2004-2006 Lennart Poettering
+ Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
+
+ PulseAudio is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ PulseAudio is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with PulseAudio; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+***/
+
+#include <stddef.h>
+
+#include <pulse/cdecl.h>
+
+/** \file
+ * Assorted utility functions */
+
+PA_C_DECL_BEGIN
+
+/** Return the current username in the specified string buffer. */
+char *pa_get_user_name(char *s, size_t l);
+
+/** Return the current hostname in the specified buffer. */
+char *pa_get_host_name(char *s, size_t l);
+
+/** Return the fully qualified domain name in s */
+char *pa_get_fqdn(char *s, size_t l);
+
+/** Return the home directory of the current user */
+char *pa_get_home_dir(char *s, size_t l);
+
+/** Return the binary file name of the current process. This is not
+ * supported on all architectures, in which case NULL is returned. */
+char *pa_get_binary_name(char *s, size_t l);
+
+/** Return a pointer to the filename inside a path (which is the last
+ * component). */
+char *pa_path_get_filename(const char *p);
+
+/** Wait t milliseconds */
+int pa_msleep(unsigned long t);
+
+PA_C_DECL_END
+
+#endif
diff --git a/sysroot/usr/include/pulse/version.h b/sysroot/usr/include/pulse/version.h
new file mode 100644
index 0000000..88eab79
--- /dev/null
+++ b/sysroot/usr/include/pulse/version.h
@@ -0,0 +1,56 @@
+#ifndef fooversionhfoo /*-*-C-*-*/
+#define fooversionhfoo
+
+/* $Id: version.h.in 1426 2007-02-13 15:35:19Z ossman $ */
+
+/***
+ This file is part of PulseAudio.
+
+ Copyright 2004-2006 Lennart Poettering
+ Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
+
+ PulseAudio is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2 of the License,
+ or (at your option) any later version.
+
+ PulseAudio is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with PulseAudio; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+***/
+
+/* WARNING: Make sure to edit the real source file version.h.in! */
+
+#include <pulse/cdecl.h>
+
+/** \file
+ * Define header version */
+
+PA_C_DECL_BEGIN
+
+/** Return the version of the header files. Keep in mind that this is
+a macro and not a function, so it is impossible to get the pointer of
+it. */
+#define pa_get_headers_version() ("0.9.10")
+
+/** Return the version of the library the current application is linked to. */
+const char* pa_get_library_version(void);
+
+/** The current API version. Version 6 relates to Polypaudio
+ * 0.6. Prior versions (i.e. Polypaudio 0.5.1 and older) have
+ * PA_API_VERSION undefined. */
+#define PA_API_VERSION 11
+
+/** The current protocol version. Version 8 relates to Polypaudio 0.8/PulseAudio 0.9.
+ * \since 0.8 */
+#define PA_PROTOCOL_VERSION 12
+
+PA_C_DECL_END
+
+#endif
diff --git a/sysroot/usr/include/pulse/volume.h b/sysroot/usr/include/pulse/volume.h
new file mode 100644
index 0000000..8295786
--- /dev/null
+++ b/sysroot/usr/include/pulse/volume.h
@@ -0,0 +1,175 @@
+#ifndef foovolumehfoo
+#define foovolumehfoo
+
+/* $Id: volume.h 1971 2007-10-28 19:13:50Z lennart $ */
+
+/***
+ This file is part of PulseAudio.
+
+ Copyright 2004-2006 Lennart Poettering
+ Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
+
+ PulseAudio is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2 of the License,
+ or (at your option) any later version.
+
+ PulseAudio is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with PulseAudio; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+***/
+
+#include <inttypes.h>
+#include <pulse/cdecl.h>
+#include <pulse/sample.h>
+
+/** \page volume Volume Control
+ *
+ * \section overv_sec Overview
+ *
+ * Sinks, sources, sink inputs and samples can all have their own volumes.
+ * To deal with these, The PulseAudio libray contains a number of functions
+ * that ease handling.
+ *
+ * The basic volume type in PulseAudio is the \ref pa_volume_t type. Most of
+ * the time, applications will use the aggregated pa_cvolume structure that
+ * can store the volume of all channels at once.
+ *
+ * Volumes commonly span between muted (0%), and normal (100%). It is possible
+ * to set volumes to higher than 100%, but clipping might occur.
+ *
+ * \section calc_sec Calculations
+ *
+ * The volumes in PulseAudio are logarithmic in nature and applications
+ * shouldn't perform calculations with them directly. Instead, they should
+ * be converted to and from either dB or a linear scale:
+ *
+ * \li dB - pa_sw_volume_from_dB() / pa_sw_volume_to_dB()
+ * \li Linear - pa_sw_volume_from_linear() / pa_sw_volume_to_linear()
+ *
+ * For simple multiplication, pa_sw_volume_multiply() and
+ * pa_sw_cvolume_multiply() can be used.
+ *
+ * Calculations can only be reliably performed on software volumes
+ * as it is commonly unknown what scale hardware volumes relate to.
+ *
+ * The functions described above are only valid when used with
+ * software volumes. Hence it is usually a better idea to treat all
+ * volume values as opaque with a range from PA_VOLUME_MUTE (0%) to
+ * PA_VOLUME_NORM (100%) and to refrain from any calculations with
+ * them.
+ *
+ * \section conv_sec Convenience Functions
+ *
+ * To handle the pa_cvolume structure, the PulseAudio library provides a
+ * number of convenienc functions:
+ *
+ * \li pa_cvolume_valid() - Tests if a pa_cvolume structure is valid.
+ * \li pa_cvolume_equal() - Tests if two pa_cvolume structures are identical.
+ * \li pa_cvolume_channels_equal_to() - Tests if all channels of a pa_cvolume
+ * structure have a given volume.
+ * \li pa_cvolume_is_muted() - Tests if all channels of a pa_cvolume
+ * structure are muted.
+ * \li pa_cvolume_is_norm() - Tests if all channels of a pa_cvolume structure
+ * are at a normal volume.
+ * \li pa_cvolume_set() - Set all channels of a pa_cvolume structure to a
+ * certain volume.
+ * \li pa_cvolume_reset() - Set all channels of a pa_cvolume structure to a
+ * normal volume.
+ * \li pa_cvolume_mute() - Set all channels of a pa_cvolume structure to a
+ * muted volume.
+ * \li pa_cvolume_avg() - Return the average volume of all channels.
+ * \li pa_cvolume_snprint() - Pretty print a pa_cvolume structure.
+ */
+
+/** \file
+ * Constants and routines for volume handling */
+
+PA_C_DECL_BEGIN
+
+/** Volume specification:
+ * PA_VOLUME_MUTED: silence;
+ * < PA_VOLUME_NORM: decreased volume;
+ * PA_VOLUME_NORM: normal volume;
+ * > PA_VOLUME_NORM: increased volume */
+typedef uint32_t pa_volume_t;
+
+/** Normal volume (100%) */
+#define PA_VOLUME_NORM (0x10000)
+
+/** Muted volume (0%) */
+#define PA_VOLUME_MUTED (0)
+
+/** A structure encapsulating a per-channel volume */
+typedef struct pa_cvolume {
+ uint8_t channels; /**< Number of channels */
+ pa_volume_t values[PA_CHANNELS_MAX]; /**< Per-channel volume */
+} pa_cvolume;
+
+/** Return non-zero when *a == *b */
+int pa_cvolume_equal(const pa_cvolume *a, const pa_cvolume *b) PA_GCC_PURE;
+
+/** Set the volume of all channels to PA_VOLUME_NORM */
+#define pa_cvolume_reset(a, n) pa_cvolume_set((a), (n), PA_VOLUME_NORM)
+
+/** Set the volume of all channels to PA_VOLUME_MUTED */
+#define pa_cvolume_mute(a, n) pa_cvolume_set((a), (n), PA_VOLUME_MUTED)
+
+/** Set the volume of all channels to the specified parameter */
+pa_cvolume* pa_cvolume_set(pa_cvolume *a, unsigned channels, pa_volume_t v);
+
+/** Maximum length of the strings returned by pa_cvolume_snprint() */
+#define PA_CVOLUME_SNPRINT_MAX 64
+
+/** Pretty print a volume structure */
+char *pa_cvolume_snprint(char *s, size_t l, const pa_cvolume *c);
+
+/** Return the average volume of all channels */
+pa_volume_t pa_cvolume_avg(const pa_cvolume *a) PA_GCC_PURE;
+
+/** Return TRUE when the passed cvolume structure is valid, FALSE otherwise */
+int pa_cvolume_valid(const pa_cvolume *v) PA_GCC_PURE;
+
+/** Return non-zero if the volume of all channels is equal to the specified value */
+int pa_cvolume_channels_equal_to(const pa_cvolume *a, pa_volume_t v) PA_GCC_PURE;
+
+/** Return 1 if the specified volume has all channels muted */
+#define pa_cvolume_is_muted(a) pa_cvolume_channels_equal_to((a), PA_VOLUME_MUTED)
+
+/** Return 1 if the specified volume has all channels on normal level */
+#define pa_cvolume_is_norm(a) pa_cvolume_channels_equal_to((a), PA_VOLUME_NORM)
+
+/** Multiply two volumes specifications, return the result. This uses PA_VOLUME_NORM as neutral element of multiplication. This is only valid for software volumes! */
+pa_volume_t pa_sw_volume_multiply(pa_volume_t a, pa_volume_t b) PA_GCC_CONST;
+
+/** Multiply to per-channel volumes and return the result in *dest. This is only valid for software volumes! */
+pa_cvolume *pa_sw_cvolume_multiply(pa_cvolume *dest, const pa_cvolume *a, const pa_cvolume *b) PA_GCC_PURE;
+
+/** Convert a decibel value to a volume. This is only valid for software volumes! \since 0.4 */
+pa_volume_t pa_sw_volume_from_dB(double f) PA_GCC_CONST;
+
+/** Convert a volume to a decibel value. This is only valid for software volumes! \since 0.4 */
+double pa_sw_volume_to_dB(pa_volume_t v) PA_GCC_CONST;
+
+/** Convert a linear factor to a volume. This is only valid for software volumes! \since 0.8 */
+pa_volume_t pa_sw_volume_from_linear(double v) PA_GCC_CONST;
+
+/** Convert a volume to a linear factor. This is only valid for software volumes! \since 0.8 */
+double pa_sw_volume_to_linear(pa_volume_t v) PA_GCC_CONST;
+
+#ifdef INFINITY
+#define PA_DECIBEL_MININFTY (-INFINITY)
+#else
+/** This value is used as minus infinity when using pa_volume_{to,from}_dB(). \since 0.4 */
+#define PA_DECIBEL_MININFTY (-200)
+#endif
+
+PA_C_DECL_END
+
+#endif
diff --git a/sysroot/usr/include/pulse/xmalloc.h b/sysroot/usr/include/pulse/xmalloc.h
new file mode 100644
index 0000000..d41fe85
--- /dev/null
+++ b/sysroot/usr/include/pulse/xmalloc.h
@@ -0,0 +1,89 @@
+#ifndef foomemoryhfoo
+#define foomemoryhfoo
+
+/* $Id: xmalloc.h 1971 2007-10-28 19:13:50Z lennart $ */
+
+/***
+ This file is part of PulseAudio.
+
+ Copyright 2004-2006 Lennart Poettering
+
+ PulseAudio is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2 of the License,
+ or (at your option) any later version.
+
+ PulseAudio is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with PulseAudio; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+***/
+
+#include <sys/types.h>
+#include <stdlib.h>
+#include <limits.h>
+#include <assert.h>
+#include <pulse/cdecl.h>
+
+/** \file
+ * Memory allocation functions.
+ */
+
+PA_C_DECL_BEGIN
+
+/** Allocate the specified number of bytes, just like malloc() does. However, in case of OOM, terminate */
+void* pa_xmalloc(size_t l);
+
+/** Same as pa_xmalloc(), but initialize allocated memory to 0 */
+void *pa_xmalloc0(size_t l);
+
+/** The combination of pa_xmalloc() and realloc() */
+void *pa_xrealloc(void *ptr, size_t size);
+
+/** Free allocated memory */
+void pa_xfree(void *p);
+
+/** Duplicate the specified string, allocating memory with pa_xmalloc() */
+char *pa_xstrdup(const char *s);
+
+/** Duplicate the specified string, but truncate after l characters */
+char *pa_xstrndup(const char *s, size_t l);
+
+/** Duplicate the specified memory block */
+void* pa_xmemdup(const void *p, size_t l);
+
+/** Internal helper for pa_xnew() */
+static inline void* pa_xnew_internal(unsigned n, size_t k) {
+ assert(n < INT_MAX/k);
+ return pa_xmalloc(n*k);
+}
+
+/** Allocate n new structures of the specified type. */
+#define pa_xnew(type, n) ((type*) pa_xnew_internal((n), sizeof(type)))
+
+/** Internal helper for pa_xnew0() */
+static inline void* pa_xnew0_internal(unsigned n, size_t k) {
+ assert(n < INT_MAX/k);
+ return pa_xmalloc0(n*k);
+}
+
+/** Same as pa_xnew() but set the memory to zero */
+#define pa_xnew0(type, n) ((type*) pa_xnew0_internal((n), sizeof(type)))
+
+/** Internal helper for pa_xnew0() */
+static inline void* pa_xnewdup_internal(const void *p, unsigned n, size_t k) {
+ assert(n < INT_MAX/k);
+ return pa_xmemdup(p, n*k);
+}
+
+/** Same as pa_xnew() but set the memory to zero */
+#define pa_xnewdup(type, p, n) ((type*) pa_xnewdup_internal((p), (n), sizeof(type)))
+
+PA_C_DECL_END
+
+#endif
diff --git a/sysroot/usr/include/pwd.h b/sysroot/usr/include/pwd.h
new file mode 100644
index 0000000..e874133
--- /dev/null
+++ b/sysroot/usr/include/pwd.h
@@ -0,0 +1,186 @@
+/* Copyright (C) 1991,1992,1995-2001,2003,2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * POSIX Standard: 9.2.2 User Database Access <pwd.h>
+ */
+
+#ifndef _PWD_H
+#define _PWD_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+#include <bits/types.h>
+
+#define __need_size_t
+#include <stddef.h>
+
+#if defined __USE_XOPEN || defined __USE_XOPEN2K
+/* The Single Unix specification says that some more types are
+ available here. */
+# ifndef __gid_t_defined
+typedef __gid_t gid_t;
+# define __gid_t_defined
+# endif
+
+# ifndef __uid_t_defined
+typedef __uid_t uid_t;
+# define __uid_t_defined
+# endif
+#endif
+
+/* The passwd structure. */
+struct passwd
+{
+ char *pw_name; /* Username. */
+ char *pw_passwd; /* Password. */
+ __uid_t pw_uid; /* User ID. */
+ __gid_t pw_gid; /* Group ID. */
+ char *pw_gecos; /* Real name. */
+ char *pw_dir; /* Home directory. */
+ char *pw_shell; /* Shell program. */
+};
+
+
+#if defined __USE_SVID || defined __USE_GNU
+# define __need_FILE
+# include <stdio.h>
+#endif
+
+
+#if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN_EXTENDED
+/* Rewind the password-file stream.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern void setpwent (void);
+
+/* Close the password-file stream.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern void endpwent (void);
+
+/* Read an entry from the password-file stream, opening it if necessary.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct passwd *getpwent (void);
+#endif
+
+#ifdef __USE_SVID
+/* Read an entry from STREAM.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern struct passwd *fgetpwent (FILE *__stream);
+
+/* Write the given entry onto the given stream.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int putpwent (__const struct passwd *__restrict __p,
+ FILE *__restrict __f);
+#endif
+
+/* Search for an entry with a matching user ID.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct passwd *getpwuid (__uid_t __uid);
+
+/* Search for an entry with a matching username.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct passwd *getpwnam (__const char *__name);
+
+#if defined __USE_POSIX || defined __USE_MISC
+
+# ifdef __USE_MISC
+/* Reasonable value for the buffer sized used in the reentrant
+ functions below. But better use `sysconf'. */
+# define NSS_BUFLEN_PASSWD 1024
+# endif
+
+/* Reentrant versions of some of the functions above.
+
+ PLEASE NOTE: the `getpwent_r' function is not (yet) standardized.
+ The interface may change in later versions of this library. But
+ the interface is designed following the principals used for the
+ other reentrant functions so the chances are good this is what the
+ POSIX people would choose. */
+
+# if defined __USE_SVID || defined __USE_MISC
+/* This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int getpwent_r (struct passwd *__restrict __resultbuf,
+ char *__restrict __buffer, size_t __buflen,
+ struct passwd **__restrict __result);
+# endif
+
+extern int getpwuid_r (__uid_t __uid,
+ struct passwd *__restrict __resultbuf,
+ char *__restrict __buffer, size_t __buflen,
+ struct passwd **__restrict __result);
+
+extern int getpwnam_r (__const char *__restrict __name,
+ struct passwd *__restrict __resultbuf,
+ char *__restrict __buffer, size_t __buflen,
+ struct passwd **__restrict __result);
+
+
+# ifdef __USE_SVID
+/* Read an entry from STREAM. This function is not standardized and
+ probably never will.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int fgetpwent_r (FILE *__restrict __stream,
+ struct passwd *__restrict __resultbuf,
+ char *__restrict __buffer, size_t __buflen,
+ struct passwd **__restrict __result);
+# endif
+
+#endif /* POSIX or reentrant */
+
+#ifdef __USE_GNU
+/* Re-construct the password-file line for the given uid
+ in the given buffer. This knows the format that the caller
+ will expect, but this need not be the format of the password file.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int getpw (__uid_t __uid, char *__buffer);
+#endif
+
+__END_DECLS
+
+#endif /* pwd.h */
diff --git a/sysroot/usr/include/re_comp.h b/sysroot/usr/include/re_comp.h
new file mode 100644
index 0000000..4911447
--- /dev/null
+++ b/sysroot/usr/include/re_comp.h
@@ -0,0 +1,26 @@
+/* Copyright (C) 1996 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _RE_COMP_H
+#define _RE_COMP_H 1
+
+/* This is only a wrapper around the <regex.h> file. XPG4.2 mentions
+ this name. */
+#include <regex.h>
+
+#endif /* re_comp.h */
diff --git a/sysroot/usr/include/regex.h b/sysroot/usr/include/regex.h
new file mode 100644
index 0000000..807c404
--- /dev/null
+++ b/sysroot/usr/include/regex.h
@@ -0,0 +1,556 @@
+/* Definitions for data structures and routines for the regular
+ expression library.
+ Copyright (C) 1985,1989-93,1995-98,2000,2001,2002,2003,2005,2006
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _REGEX_H
+#define _REGEX_H 1
+
+#include <sys/types.h>
+
+/* Allow the use in C++ code. */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* The following two types have to be signed and unsigned integer type
+ wide enough to hold a value of a pointer. For most ANSI compilers
+ ptrdiff_t and size_t should be likely OK. Still size of these two
+ types is 2 for Microsoft C. Ugh... */
+typedef long int s_reg_t;
+typedef unsigned long int active_reg_t;
+
+/* The following bits are used to determine the regexp syntax we
+ recognize. The set/not-set meanings are chosen so that Emacs syntax
+ remains the value 0. The bits are given in alphabetical order, and
+ the definitions shifted by one from the previous bit; thus, when we
+ add or remove a bit, only one other definition need change. */
+typedef unsigned long int reg_syntax_t;
+
+/* If this bit is not set, then \ inside a bracket expression is literal.
+ If set, then such a \ quotes the following character. */
+#define RE_BACKSLASH_ESCAPE_IN_LISTS ((unsigned long int) 1)
+
+/* If this bit is not set, then + and ? are operators, and \+ and \? are
+ literals.
+ If set, then \+ and \? are operators and + and ? are literals. */
+#define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)
+
+/* If this bit is set, then character classes are supported. They are:
+ [:alpha:], [:upper:], [:lower:], [:digit:], [:alnum:], [:xdigit:],
+ [:space:], [:print:], [:punct:], [:graph:], and [:cntrl:].
+ If not set, then character classes are not supported. */
+#define RE_CHAR_CLASSES (RE_BK_PLUS_QM << 1)
+
+/* If this bit is set, then ^ and $ are always anchors (outside bracket
+ expressions, of course).
+ If this bit is not set, then it depends:
+ ^ is an anchor if it is at the beginning of a regular
+ expression or after an open-group or an alternation operator;
+ $ is an anchor if it is at the end of a regular expression, or
+ before a close-group or an alternation operator.
+
+ This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because
+ POSIX draft 11.2 says that * etc. in leading positions is undefined.
+ We already implemented a previous draft which made those constructs
+ invalid, though, so we haven't changed the code back. */
+#define RE_CONTEXT_INDEP_ANCHORS (RE_CHAR_CLASSES << 1)
+
+/* If this bit is set, then special characters are always special
+ regardless of where they are in the pattern.
+ If this bit is not set, then special characters are special only in
+ some contexts; otherwise they are ordinary. Specifically,
+ * + ? and intervals are only special when not after the beginning,
+ open-group, or alternation operator. */
+#define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1)
+
+/* If this bit is set, then *, +, ?, and { cannot be first in an re or
+ immediately after an alternation or begin-group operator. */
+#define RE_CONTEXT_INVALID_OPS (RE_CONTEXT_INDEP_OPS << 1)
+
+/* If this bit is set, then . matches newline.
+ If not set, then it doesn't. */
+#define RE_DOT_NEWLINE (RE_CONTEXT_INVALID_OPS << 1)
+
+/* If this bit is set, then . doesn't match NUL.
+ If not set, then it does. */
+#define RE_DOT_NOT_NULL (RE_DOT_NEWLINE << 1)
+
+/* If this bit is set, nonmatching lists [^...] do not match newline.
+ If not set, they do. */
+#define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1)
+
+/* If this bit is set, either \{...\} or {...} defines an
+ interval, depending on RE_NO_BK_BRACES.
+ If not set, \{, \}, {, and } are literals. */
+#define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
+
+/* If this bit is set, +, ? and | aren't recognized as operators.
+ If not set, they are. */
+#define RE_LIMITED_OPS (RE_INTERVALS << 1)
+
+/* If this bit is set, newline is an alternation operator.
+ If not set, newline is literal. */
+#define RE_NEWLINE_ALT (RE_LIMITED_OPS << 1)
+
+/* If this bit is set, then `{...}' defines an interval, and \{ and \}
+ are literals.
+ If not set, then `\{...\}' defines an interval. */
+#define RE_NO_BK_BRACES (RE_NEWLINE_ALT << 1)
+
+/* If this bit is set, (...) defines a group, and \( and \) are literals.
+ If not set, \(...\) defines a group, and ( and ) are literals. */
+#define RE_NO_BK_PARENS (RE_NO_BK_BRACES << 1)
+
+/* If this bit is set, then \<digit> matches <digit>.
+ If not set, then \<digit> is a back-reference. */
+#define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1)
+
+/* If this bit is set, then | is an alternation operator, and \| is literal.
+ If not set, then \| is an alternation operator, and | is literal. */
+#define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1)
+
+/* If this bit is set, then an ending range point collating higher
+ than the starting range point, as in [z-a], is invalid.
+ If not set, then when ending range point collates higher than the
+ starting range point, the range is ignored. */
+#define RE_NO_EMPTY_RANGES (RE_NO_BK_VBAR << 1)
+
+/* If this bit is set, then an unmatched ) is ordinary.
+ If not set, then an unmatched ) is invalid. */
+#define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_NO_EMPTY_RANGES << 1)
+
+/* If this bit is set, succeed as soon as we match the whole pattern,
+ without further backtracking. */
+#define RE_NO_POSIX_BACKTRACKING (RE_UNMATCHED_RIGHT_PAREN_ORD << 1)
+
+/* If this bit is set, do not process the GNU regex operators.
+ If not set, then the GNU regex operators are recognized. */
+#define RE_NO_GNU_OPS (RE_NO_POSIX_BACKTRACKING << 1)
+
+/* If this bit is set, turn on internal regex debugging.
+ If not set, and debugging was on, turn it off.
+ This only works if regex.c is compiled -DDEBUG.
+ We define this bit always, so that all that's needed to turn on
+ debugging is to recompile regex.c; the calling code can always have
+ this bit set, and it won't affect anything in the normal case. */
+#define RE_DEBUG (RE_NO_GNU_OPS << 1)
+
+/* If this bit is set, a syntactically invalid interval is treated as
+ a string of ordinary characters. For example, the ERE 'a{1' is
+ treated as 'a\{1'. */
+#define RE_INVALID_INTERVAL_ORD (RE_DEBUG << 1)
+
+/* If this bit is set, then ignore case when matching.
+ If not set, then case is significant. */
+#define RE_ICASE (RE_INVALID_INTERVAL_ORD << 1)
+
+/* This bit is used internally like RE_CONTEXT_INDEP_ANCHORS but only
+ for ^, because it is difficult to scan the regex backwards to find
+ whether ^ should be special. */
+#define RE_CARET_ANCHORS_HERE (RE_ICASE << 1)
+
+/* If this bit is set, then \{ cannot be first in an bre or
+ immediately after an alternation or begin-group operator. */
+#define RE_CONTEXT_INVALID_DUP (RE_CARET_ANCHORS_HERE << 1)
+
+/* If this bit is set, then no_sub will be set to 1 during
+ re_compile_pattern. */
+#define RE_NO_SUB (RE_CONTEXT_INVALID_DUP << 1)
+
+/* This global variable defines the particular regexp syntax to use (for
+ some interfaces). When a regexp is compiled, the syntax used is
+ stored in the pattern buffer, so changing this does not affect
+ already-compiled regexps. */
+extern reg_syntax_t re_syntax_options;
+
+/* Define combinations of the above bits for the standard possibilities.
+ (The [[[ comments delimit what gets put into the Texinfo file, so
+ don't delete them!) */
+/* [[[begin syntaxes]]] */
+#define RE_SYNTAX_EMACS 0
+
+#define RE_SYNTAX_AWK \
+ (RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \
+ | RE_NO_BK_PARENS | RE_NO_BK_REFS \
+ | RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \
+ | RE_DOT_NEWLINE | RE_CONTEXT_INDEP_ANCHORS \
+ | RE_UNMATCHED_RIGHT_PAREN_ORD | RE_NO_GNU_OPS)
+
+#define RE_SYNTAX_GNU_AWK \
+ ((RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DEBUG) \
+ & ~(RE_DOT_NOT_NULL | RE_INTERVALS | RE_CONTEXT_INDEP_OPS \
+ | RE_CONTEXT_INVALID_OPS ))
+
+#define RE_SYNTAX_POSIX_AWK \
+ (RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS \
+ | RE_INTERVALS | RE_NO_GNU_OPS)
+
+#define RE_SYNTAX_GREP \
+ (RE_BK_PLUS_QM | RE_CHAR_CLASSES \
+ | RE_HAT_LISTS_NOT_NEWLINE | RE_INTERVALS \
+ | RE_NEWLINE_ALT)
+
+#define RE_SYNTAX_EGREP \
+ (RE_CHAR_CLASSES | RE_CONTEXT_INDEP_ANCHORS \
+ | RE_CONTEXT_INDEP_OPS | RE_HAT_LISTS_NOT_NEWLINE \
+ | RE_NEWLINE_ALT | RE_NO_BK_PARENS \
+ | RE_NO_BK_VBAR)
+
+#define RE_SYNTAX_POSIX_EGREP \
+ (RE_SYNTAX_EGREP | RE_INTERVALS | RE_NO_BK_BRACES \
+ | RE_INVALID_INTERVAL_ORD)
+
+/* P1003.2/D11.2, section 4.20.7.1, lines 5078ff. */
+#define RE_SYNTAX_ED RE_SYNTAX_POSIX_BASIC
+
+#define RE_SYNTAX_SED RE_SYNTAX_POSIX_BASIC
+
+/* Syntax bits common to both basic and extended POSIX regex syntax. */
+#define _RE_SYNTAX_POSIX_COMMON \
+ (RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \
+ | RE_INTERVALS | RE_NO_EMPTY_RANGES)
+
+#define RE_SYNTAX_POSIX_BASIC \
+ (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM | RE_CONTEXT_INVALID_DUP)
+
+/* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes
+ RE_LIMITED_OPS, i.e., \? \+ \| are not recognized. Actually, this
+ isn't minimal, since other operators, such as \`, aren't disabled. */
+#define RE_SYNTAX_POSIX_MINIMAL_BASIC \
+ (_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS)
+
+#define RE_SYNTAX_POSIX_EXTENDED \
+ (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
+ | RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \
+ | RE_NO_BK_PARENS | RE_NO_BK_VBAR \
+ | RE_CONTEXT_INVALID_OPS | RE_UNMATCHED_RIGHT_PAREN_ORD)
+
+/* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INDEP_OPS is
+ removed and RE_NO_BK_REFS is added. */
+#define RE_SYNTAX_POSIX_MINIMAL_EXTENDED \
+ (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
+ | RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES \
+ | RE_NO_BK_PARENS | RE_NO_BK_REFS \
+ | RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD)
+/* [[[end syntaxes]]] */
+
+/* Maximum number of duplicates an interval can allow. Some systems
+ (erroneously) define this in other header files, but we want our
+ value, so remove any previous define. */
+#ifdef RE_DUP_MAX
+# undef RE_DUP_MAX
+#endif
+/* If sizeof(int) == 2, then ((1 << 15) - 1) overflows. */
+#define RE_DUP_MAX (0x7fff)
+
+
+/* POSIX `cflags' bits (i.e., information for `regcomp'). */
+
+/* If this bit is set, then use extended regular expression syntax.
+ If not set, then use basic regular expression syntax. */
+#define REG_EXTENDED 1
+
+/* If this bit is set, then ignore case when matching.
+ If not set, then case is significant. */
+#define REG_ICASE (REG_EXTENDED << 1)
+
+/* If this bit is set, then anchors do not match at newline
+ characters in the string.
+ If not set, then anchors do match at newlines. */
+#define REG_NEWLINE (REG_ICASE << 1)
+
+/* If this bit is set, then report only success or fail in regexec.
+ If not set, then returns differ between not matching and errors. */
+#define REG_NOSUB (REG_NEWLINE << 1)
+
+
+/* POSIX `eflags' bits (i.e., information for regexec). */
+
+/* If this bit is set, then the beginning-of-line operator doesn't match
+ the beginning of the string (presumably because it's not the
+ beginning of a line).
+ If not set, then the beginning-of-line operator does match the
+ beginning of the string. */
+#define REG_NOTBOL 1
+
+/* Like REG_NOTBOL, except for the end-of-line. */
+#define REG_NOTEOL (1 << 1)
+
+/* Use PMATCH[0] to delimit the start and end of the search in the
+ buffer. */
+#define REG_STARTEND (1 << 2)
+
+
+/* If any error codes are removed, changed, or added, update the
+ `re_error_msg' table in regex.c. */
+typedef enum
+{
+#ifdef _XOPEN_SOURCE
+ REG_ENOSYS = -1, /* This will never happen for this implementation. */
+#endif
+
+ REG_NOERROR = 0, /* Success. */
+ REG_NOMATCH, /* Didn't find a match (for regexec). */
+
+ /* POSIX regcomp return error codes. (In the order listed in the
+ standard.) */
+ REG_BADPAT, /* Invalid pattern. */
+ REG_ECOLLATE, /* Inalid collating element. */
+ REG_ECTYPE, /* Invalid character class name. */
+ REG_EESCAPE, /* Trailing backslash. */
+ REG_ESUBREG, /* Invalid back reference. */
+ REG_EBRACK, /* Unmatched left bracket. */
+ REG_EPAREN, /* Parenthesis imbalance. */
+ REG_EBRACE, /* Unmatched \{. */
+ REG_BADBR, /* Invalid contents of \{\}. */
+ REG_ERANGE, /* Invalid range end. */
+ REG_ESPACE, /* Ran out of memory. */
+ REG_BADRPT, /* No preceding re for repetition op. */
+
+ /* Error codes we've added. */
+ REG_EEND, /* Premature end. */
+ REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */
+ REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */
+} reg_errcode_t;
+
+/* This data structure represents a compiled pattern. Before calling
+ the pattern compiler, the fields `buffer', `allocated', `fastmap',
+ `translate', and `no_sub' can be set. After the pattern has been
+ compiled, the `re_nsub' field is available. All other fields are
+ private to the regex routines. */
+
+#ifndef RE_TRANSLATE_TYPE
+# define RE_TRANSLATE_TYPE unsigned char *
+#endif
+
+struct re_pattern_buffer
+{
+ /* Space that holds the compiled pattern. It is declared as
+ `unsigned char *' because its elements are sometimes used as
+ array indexes. */
+ unsigned char *buffer;
+
+ /* Number of bytes to which `buffer' points. */
+ unsigned long int allocated;
+
+ /* Number of bytes actually used in `buffer'. */
+ unsigned long int used;
+
+ /* Syntax setting with which the pattern was compiled. */
+ reg_syntax_t syntax;
+
+ /* Pointer to a fastmap, if any, otherwise zero. re_search uses the
+ fastmap, if there is one, to skip over impossible starting points
+ for matches. */
+ char *fastmap;
+
+ /* Either a translate table to apply to all characters before
+ comparing them, or zero for no translation. The translation is
+ applied to a pattern when it is compiled and to a string when it
+ is matched. */
+ RE_TRANSLATE_TYPE translate;
+
+ /* Number of subexpressions found by the compiler. */
+ size_t re_nsub;
+
+ /* Zero if this pattern cannot match the empty string, one else.
+ Well, in truth it's used only in `re_search_2', to see whether or
+ not we should use the fastmap, so we don't set this absolutely
+ perfectly; see `re_compile_fastmap' (the `duplicate' case). */
+ unsigned can_be_null : 1;
+
+ /* If REGS_UNALLOCATED, allocate space in the `regs' structure
+ for `max (RE_NREGS, re_nsub + 1)' groups.
+ If REGS_REALLOCATE, reallocate space if necessary.
+ If REGS_FIXED, use what's there. */
+#define REGS_UNALLOCATED 0
+#define REGS_REALLOCATE 1
+#define REGS_FIXED 2
+ unsigned regs_allocated : 2;
+
+ /* Set to zero when `regex_compile' compiles a pattern; set to one
+ by `re_compile_fastmap' if it updates the fastmap. */
+ unsigned fastmap_accurate : 1;
+
+ /* If set, `re_match_2' does not return information about
+ subexpressions. */
+ unsigned no_sub : 1;
+
+ /* If set, a beginning-of-line anchor doesn't match at the beginning
+ of the string. */
+ unsigned not_bol : 1;
+
+ /* Similarly for an end-of-line anchor. */
+ unsigned not_eol : 1;
+
+ /* If true, an anchor at a newline matches. */
+ unsigned newline_anchor : 1;
+};
+
+typedef struct re_pattern_buffer regex_t;
+
+/* Type for byte offsets within the string. POSIX mandates this. */
+typedef int regoff_t;
+
+
+/* This is the structure we store register match data in. See
+ regex.texinfo for a full description of what registers match. */
+struct re_registers
+{
+ unsigned num_regs;
+ regoff_t *start;
+ regoff_t *end;
+};
+
+
+/* If `regs_allocated' is REGS_UNALLOCATED in the pattern buffer,
+ `re_match_2' returns information about at least this many registers
+ the first time a `regs' structure is passed. */
+#ifndef RE_NREGS
+# define RE_NREGS 30
+#endif
+
+
+/* POSIX specification for registers. Aside from the different names than
+ `re_registers', POSIX uses an array of structures, instead of a
+ structure of arrays. */
+typedef struct
+{
+ regoff_t rm_so; /* Byte offset from string's start to substring's start. */
+ regoff_t rm_eo; /* Byte offset from string's start to substring's end. */
+} regmatch_t;
+
+/* Declarations for routines. */
+
+/* Sets the current default syntax to SYNTAX, and return the old syntax.
+ You can also simply assign to the `re_syntax_options' variable. */
+extern reg_syntax_t re_set_syntax (reg_syntax_t __syntax);
+
+/* Compile the regular expression PATTERN, with length LENGTH
+ and syntax given by the global `re_syntax_options', into the buffer
+ BUFFER. Return NULL if successful, and an error string if not. */
+extern const char *re_compile_pattern (const char *__pattern, size_t __length,
+ struct re_pattern_buffer *__buffer);
+
+
+/* Compile a fastmap for the compiled pattern in BUFFER; used to
+ accelerate searches. Return 0 if successful and -2 if was an
+ internal error. */
+extern int re_compile_fastmap (struct re_pattern_buffer *__buffer);
+
+
+/* Search in the string STRING (with length LENGTH) for the pattern
+ compiled into BUFFER. Start searching at position START, for RANGE
+ characters. Return the starting position of the match, -1 for no
+ match, or -2 for an internal error. Also return register
+ information in REGS (if REGS and BUFFER->no_sub are nonzero). */
+extern int re_search (struct re_pattern_buffer *__buffer, const char *__string,
+ int __length, int __start, int __range,
+ struct re_registers *__regs);
+
+
+/* Like `re_search', but search in the concatenation of STRING1 and
+ STRING2. Also, stop searching at index START + STOP. */
+extern int re_search_2 (struct re_pattern_buffer *__buffer,
+ const char *__string1, int __length1,
+ const char *__string2, int __length2, int __start,
+ int __range, struct re_registers *__regs, int __stop);
+
+
+/* Like `re_search', but return how many characters in STRING the regexp
+ in BUFFER matched, starting at position START. */
+extern int re_match (struct re_pattern_buffer *__buffer, const char *__string,
+ int __length, int __start, struct re_registers *__regs);
+
+
+/* Relates to `re_match' as `re_search_2' relates to `re_search'. */
+extern int re_match_2 (struct re_pattern_buffer *__buffer,
+ const char *__string1, int __length1,
+ const char *__string2, int __length2, int __start,
+ struct re_registers *__regs, int __stop);
+
+
+/* Set REGS to hold NUM_REGS registers, storing them in STARTS and
+ ENDS. Subsequent matches using BUFFER and REGS will use this memory
+ for recording register information. STARTS and ENDS must be
+ allocated with malloc, and must each be at least `NUM_REGS * sizeof
+ (regoff_t)' bytes long.
+
+ If NUM_REGS == 0, then subsequent matches should allocate their own
+ register data.
+
+ Unless this function is called, the first search or match using
+ PATTERN_BUFFER will allocate its own register data, without
+ freeing the old data. */
+extern void re_set_registers (struct re_pattern_buffer *__buffer,
+ struct re_registers *__regs,
+ unsigned int __num_regs,
+ regoff_t *__starts, regoff_t *__ends);
+
+#if defined _REGEX_RE_COMP || defined _LIBC
+# ifndef _CRAY
+/* 4.2 bsd compatibility. */
+extern char *re_comp (const char *);
+extern int re_exec (const char *);
+# endif
+#endif
+
+/* GCC 2.95 and later have "__restrict"; C99 compilers have
+ "restrict", and "configure" may have defined "restrict". */
+#ifndef __restrict
+# if ! (2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__))
+# if defined restrict || 199901L <= __STDC_VERSION__
+# define __restrict restrict
+# else
+# define __restrict
+# endif
+# endif
+#endif
+/* gcc 3.1 and up support the [restrict] syntax. */
+#ifndef __restrict_arr
+# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) \
+ && !defined __GNUG__
+# define __restrict_arr __restrict
+# else
+# define __restrict_arr
+# endif
+#endif
+
+/* POSIX compatibility. */
+extern int regcomp (regex_t *__restrict __preg,
+ const char *__restrict __pattern,
+ int __cflags);
+
+extern int regexec (const regex_t *__restrict __preg,
+ const char *__restrict __string, size_t __nmatch,
+ regmatch_t __pmatch[__restrict_arr],
+ int __eflags);
+
+extern size_t regerror (int __errcode, const regex_t *__restrict __preg,
+ char *__restrict __errbuf, size_t __errbuf_size);
+
+extern void regfree (regex_t *__preg);
+
+
+#ifdef __cplusplus
+}
+#endif /* C++ */
+
+#endif /* regex.h */
diff --git a/sysroot/usr/include/regexp.h b/sysroot/usr/include/regexp.h
new file mode 100644
index 0000000..b7b50b7
--- /dev/null
+++ b/sysroot/usr/include/regexp.h
@@ -0,0 +1,222 @@
+/* Copyright (C) 1996, 1997, 1998, 1999, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _REGEXP_H
+#define _REGEXP_H 1
+
+/* The contents of this header file was first standardized in X/Open
+ System Interface and Headers Issue 2, originally coming from SysV.
+ In issue 4, version 2, it is marked as TO BE WITDRAWN, and it has
+ been withdrawn in SUSv3.
+
+ This code shouldn't be used in any newly written code. It is
+ included only for compatibility reasons. Use the POSIX definition
+ in <regex.h> for portable applications and a reasonable interface. */
+
+#include <features.h>
+#include <alloca.h>
+#include <regex.h>
+#include <stdlib.h>
+#include <string.h>
+
+/* The implementation provided here emulates the needed functionality
+ by mapping to the POSIX regular expression matcher. The interface
+ for the here included function is weird (this really is a harmless
+ word).
+
+ The user has to provide six macros before this header file can be
+ included:
+
+ INIT Declarations vor variables which can be used by the
+ other macros.
+
+ GETC() Return the value of the next character in the regular
+ expression pattern. Successive calls should return
+ successive characters.
+
+ PEEKC() Return the value of the next character in the regular
+ expression pattern. Immediately successive calls to
+ PEEKC() should return the same character which should
+ also be the next character returned by GETC().
+
+ UNGETC(c) Cause `c' to be returned by the next call to GETC() and
+ PEEKC().
+
+ RETURN(ptr) Used for normal exit of the `compile' function. `ptr'
+ is a pointer to the character after the last character of
+ the compiled regular expression.
+
+ ERROR(val) Used for abnormal return from `compile'. `val' is the
+ error number. The error codes are:
+ 11 Range endpoint too large.
+ 16 Bad number.
+ 25 \digit out of range.
+ 36 Illegal or missing delimiter.
+ 41 No remembered search string.
+ 42 \( \) imbalance.
+ 43 Too many \(.
+ 44 More tan two numbers given in \{ \}.
+ 45 } expected after \.
+ 46 First number exceeds second in \{ \}.
+ 49 [ ] imbalance.
+ 50 Regular expression overflow.
+
+ */
+
+__BEGIN_DECLS
+
+/* Interface variables. They contain the results of the successful
+ calls to `setp' and `advance'. */
+extern char *loc1;
+extern char *loc2;
+
+/* The use of this variable in the `advance' function is not
+ supported. */
+extern char *locs;
+
+
+#ifndef __DO_NOT_DEFINE_COMPILE
+/* Get and compile the user supplied pattern up to end of line or
+ string or until EOF is seen, whatever happens first. The result is
+ placed in the buffer starting at EXPBUF and delimited by ENDBUF.
+
+ This function cannot be defined in the libc itself since it depends
+ on the macros. */
+char *
+compile (char *__restrict instring, char *__restrict expbuf,
+ __const char *__restrict endbuf, int eof)
+{
+ char *__input_buffer = NULL;
+ size_t __input_size = 0;
+ size_t __current_size = 0;
+ int __ch;
+ int __error;
+ INIT
+
+ /* Align the expression buffer according to the needs for an object
+ of type `regex_t'. Then check for minimum size of the buffer for
+ the compiled regular expression. */
+ regex_t *__expr_ptr;
+# if defined __GNUC__ && __GNUC__ >= 2
+ const size_t __req = __alignof__ (regex_t *);
+# else
+ /* How shall we find out? We simply guess it and can change it is
+ this really proofs to be wrong. */
+ const size_t __req = 8;
+# endif
+ expbuf += __req;
+ expbuf -= (expbuf - ((char *) 0)) % __req;
+ if (endbuf < expbuf + sizeof (regex_t))
+ {
+ ERROR (50);
+ }
+ __expr_ptr = (regex_t *) expbuf;
+ /* The remaining space in the buffer can be used for the compiled
+ pattern. */
+ __expr_ptr->buffer = expbuf + sizeof (regex_t);
+ __expr_ptr->allocated = endbuf - (char *) __expr_ptr->buffer;
+
+ while ((__ch = (GETC ())) != eof)
+ {
+ if (__ch == '\0' || __ch == '\n')
+ {
+ UNGETC (__ch);
+ break;
+ }
+
+ if (__current_size + 1 >= __input_size)
+ {
+ size_t __new_size = __input_size ? 2 * __input_size : 128;
+ char *__new_room = (char *) alloca (__new_size);
+ /* See whether we can use the old buffer. */
+ if (__new_room + __new_size == __input_buffer)
+ {
+ __input_size += __new_size;
+ __input_buffer = (char *) memcpy (__new_room, __input_buffer,
+ __current_size);
+ }
+ else if (__input_buffer + __input_size == __new_room)
+ __input_size += __new_size;
+ else
+ {
+ __input_size = __new_size;
+ __input_buffer = (char *) memcpy (__new_room, __input_buffer,
+ __current_size);
+ }
+ }
+ __input_buffer[__current_size++] = __ch;
+ }
+ __input_buffer[__current_size++] = '\0';
+
+ /* Now compile the pattern. */
+ __error = regcomp (__expr_ptr, __input_buffer, REG_NEWLINE);
+ if (__error != 0)
+ /* Oh well, we have to translate POSIX error codes. */
+ switch (__error)
+ {
+ case REG_BADPAT:
+ case REG_ECOLLATE:
+ case REG_ECTYPE:
+ case REG_EESCAPE:
+ case REG_BADRPT:
+ case REG_EEND:
+ case REG_ERPAREN:
+ default:
+ /* There is no matching error code. */
+ RETURN (36);
+ case REG_ESUBREG:
+ RETURN (25);
+ case REG_EBRACK:
+ RETURN (49);
+ case REG_EPAREN:
+ RETURN (42);
+ case REG_EBRACE:
+ RETURN (44);
+ case REG_BADBR:
+ RETURN (46);
+ case REG_ERANGE:
+ RETURN (11);
+ case REG_ESPACE:
+ case REG_ESIZE:
+ ERROR (50);
+ }
+
+ /* Everything is ok. */
+ RETURN ((char *) (__expr_ptr->buffer + __expr_ptr->used));
+}
+#endif
+
+
+/* Find the next match in STRING. The compiled regular expression is
+ found in the buffer starting at EXPBUF. `loc1' will return the
+ first character matched and `loc2' points to the next unmatched
+ character. */
+extern int step (__const char *__restrict __string,
+ __const char *__restrict __expbuf) __THROW;
+
+/* Match the beginning of STRING with the compiled regular expression
+ in EXPBUF. If the match is successful `loc2' will contain the
+ position of the first unmatched character. */
+extern int advance (__const char *__restrict __string,
+ __const char *__restrict __expbuf) __THROW;
+
+
+__END_DECLS
+
+#endif /* regexp.h */
diff --git a/sysroot/usr/include/resolv.h b/sysroot/usr/include/resolv.h
new file mode 100644
index 0000000..105631e
--- /dev/null
+++ b/sysroot/usr/include/resolv.h
@@ -0,0 +1,383 @@
+/*
+ * Copyright (c) 1983, 1987, 1989
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Portions Copyright (c) 1996-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
+ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
+ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+/*
+ * @(#)resolv.h 8.1 (Berkeley) 6/2/93
+ * $BINDId: resolv.h,v 8.31 2000/03/30 20:16:50 vixie Exp $
+ */
+
+#ifndef _RESOLV_H_
+
+/* These headers are needed for types used in the `struct res_state'
+ declaration. */
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#ifndef __need_res_state
+# define _RESOLV_H_
+
+# include <sys/param.h>
+# include <sys/cdefs.h>
+# include <stdio.h>
+# include <arpa/nameser.h>
+#endif
+
+#ifndef __res_state_defined
+# define __res_state_defined
+
+typedef enum { res_goahead, res_nextns, res_modified, res_done, res_error }
+ res_sendhookact;
+
+typedef res_sendhookact (*res_send_qhook) (struct sockaddr_in * const *ns,
+ const u_char **query,
+ int *querylen,
+ u_char *ans,
+ int anssiz,
+ int *resplen);
+
+typedef res_sendhookact (*res_send_rhook) (const struct sockaddr_in *ns,
+ const u_char *query,
+ int querylen,
+ u_char *ans,
+ int anssiz,
+ int *resplen);
+
+/*
+ * Global defines and variables for resolver stub.
+ */
+# define MAXNS 3 /* max # name servers we'll track */
+# define MAXDFLSRCH 3 /* # default domain levels to try */
+# define MAXDNSRCH 6 /* max # domains in search path */
+# define LOCALDOMAINPARTS 2 /* min levels in name that is "local" */
+
+# define RES_TIMEOUT 5 /* min. seconds between retries */
+# define MAXRESOLVSORT 10 /* number of net to sort on */
+# define RES_MAXNDOTS 15 /* should reflect bit field size */
+# define RES_MAXRETRANS 30 /* only for resolv.conf/RES_OPTIONS */
+# define RES_MAXRETRY 5 /* only for resolv.conf/RES_OPTIONS */
+# define RES_DFLRETRY 2 /* Default #/tries. */
+# define RES_MAXTIME 65535 /* Infinity, in milliseconds. */
+
+struct __res_state {
+ int retrans; /* retransmition time interval */
+ int retry; /* number of times to retransmit */
+ u_long options; /* option flags - see below. */
+ int nscount; /* number of name servers */
+ struct sockaddr_in
+ nsaddr_list[MAXNS]; /* address of name server */
+# define nsaddr nsaddr_list[0] /* for backward compatibility */
+ u_short id; /* current message id */
+ /* 2 byte hole here. */
+ char *dnsrch[MAXDNSRCH+1]; /* components of domain to search */
+ char defdname[256]; /* default domain (deprecated) */
+ u_long pfcode; /* RES_PRF_ flags - see below. */
+ unsigned ndots:4; /* threshold for initial abs. query */
+ unsigned nsort:4; /* number of elements in sort_list[] */
+ unsigned ipv6_unavail:1; /* connecting to IPv6 server failed */
+ unsigned unused:23;
+ struct {
+ struct in_addr addr;
+ u_int32_t mask;
+ } sort_list[MAXRESOLVSORT];
+ /* 4 byte hole here on 64-bit architectures. */
+ res_send_qhook qhook; /* query hook */
+ res_send_rhook rhook; /* response hook */
+ int res_h_errno; /* last one set for this context */
+ int _vcsock; /* PRIVATE: for res_send VC i/o */
+ u_int _flags; /* PRIVATE: see below */
+ /* 4 byte hole here on 64-bit architectures. */
+ union {
+ char pad[52]; /* On an i386 this means 512b total. */
+ struct {
+ u_int16_t nscount;
+ u_int16_t nsmap[MAXNS];
+ int nssocks[MAXNS];
+ u_int16_t nscount6;
+ u_int16_t nsinit;
+ struct sockaddr_in6 *nsaddrs[MAXNS];
+#ifdef _LIBC
+ unsigned long long int initstamp
+ __attribute__((packed));
+#else
+ unsigned int _initstamp[2];
+#endif
+ } _ext;
+ } _u;
+};
+
+typedef struct __res_state *res_state;
+# undef __need_res_state
+#endif
+
+#ifdef _RESOLV_H_
+/*
+ * Revision information. This is the release date in YYYYMMDD format.
+ * It can change every day so the right thing to do with it is use it
+ * in preprocessor commands such as "#if (__RES > 19931104)". Do not
+ * compare for equality; rather, use it to determine whether your resolver
+ * is new enough to contain a certain feature.
+ */
+
+#define __RES 19991006
+
+/*
+ * Resolver configuration file.
+ * Normally not present, but may contain the address of the
+ * inital name server(s) to query and the domain search list.
+ */
+
+#ifndef _PATH_RESCONF
+#define _PATH_RESCONF "/etc/resolv.conf"
+#endif
+
+struct res_sym {
+ int number; /* Identifying number, like T_MX */
+ char * name; /* Its symbolic name, like "MX" */
+ char * humanname; /* Its fun name, like "mail exchanger" */
+};
+
+/*
+ * Resolver flags (used to be discrete per-module statics ints).
+ */
+#define RES_F_VC 0x00000001 /* socket is TCP */
+#define RES_F_CONN 0x00000002 /* socket is connected */
+#define RES_F_EDNS0ERR 0x00000004 /* EDNS0 caused errors */
+
+/* res_findzonecut() options */
+#define RES_EXHAUSTIVE 0x00000001 /* always do all queries */
+
+/*
+ * Resolver options (keep these in synch with res_debug.c, please)
+ */
+#define RES_INIT 0x00000001 /* address initialized */
+#define RES_DEBUG 0x00000002 /* print debug messages */
+#define RES_AAONLY 0x00000004 /* authoritative answers only (!IMPL)*/
+#define RES_USEVC 0x00000008 /* use virtual circuit */
+#define RES_PRIMARY 0x00000010 /* query primary server only (!IMPL) */
+#define RES_IGNTC 0x00000020 /* ignore trucation errors */
+#define RES_RECURSE 0x00000040 /* recursion desired */
+#define RES_DEFNAMES 0x00000080 /* use default domain name */
+#define RES_STAYOPEN 0x00000100 /* Keep TCP socket open */
+#define RES_DNSRCH 0x00000200 /* search up local domain tree */
+#define RES_INSECURE1 0x00000400 /* type 1 security disabled */
+#define RES_INSECURE2 0x00000800 /* type 2 security disabled */
+#define RES_NOALIASES 0x00001000 /* shuts off HOSTALIASES feature */
+#define RES_USE_INET6 0x00002000 /* use/map IPv6 in gethostbyname() */
+#define RES_ROTATE 0x00004000 /* rotate ns list after each query */
+#define RES_NOCHECKNAME 0x00008000 /* do not check names for sanity. */
+#define RES_KEEPTSIG 0x00010000 /* do not strip TSIG records */
+#define RES_BLAST 0x00020000 /* blast all recursive servers */
+#define RES_USEBSTRING 0x00040000 /* IPv6 reverse lookup with byte
+ strings */
+#define RES_NOIP6DOTINT 0x00080000 /* Do not use .ip6.int in IPv6
+ reverse lookup */
+#define RES_USE_EDNS0 0x00100000 /* Use EDNS0. */
+
+#define RES_DEFAULT (RES_RECURSE|RES_DEFNAMES|RES_DNSRCH|RES_NOIP6DOTINT)
+
+/*
+ * Resolver "pfcode" values. Used by dig.
+ */
+#define RES_PRF_STATS 0x00000001
+#define RES_PRF_UPDATE 0x00000002
+#define RES_PRF_CLASS 0x00000004
+#define RES_PRF_CMD 0x00000008
+#define RES_PRF_QUES 0x00000010
+#define RES_PRF_ANS 0x00000020
+#define RES_PRF_AUTH 0x00000040
+#define RES_PRF_ADD 0x00000080
+#define RES_PRF_HEAD1 0x00000100
+#define RES_PRF_HEAD2 0x00000200
+#define RES_PRF_TTLID 0x00000400
+#define RES_PRF_HEADX 0x00000800
+#define RES_PRF_QUERY 0x00001000
+#define RES_PRF_REPLY 0x00002000
+#define RES_PRF_INIT 0x00004000
+/* 0x00008000 */
+
+/* Things involving an internal (static) resolver context. */
+__BEGIN_DECLS
+extern struct __res_state *__res_state(void) __attribute__ ((__const__));
+__END_DECLS
+#define _res (*__res_state())
+
+#ifndef __BIND_NOSTATIC
+#define fp_nquery __fp_nquery
+#define fp_query __fp_query
+#define hostalias __hostalias
+#define p_query __p_query
+#define res_close __res_close
+#define res_init __res_init
+#define res_isourserver __res_isourserver
+#define res_mkquery __res_mkquery
+#define res_query __res_query
+#define res_querydomain __res_querydomain
+#define res_search __res_search
+#define res_send __res_send
+
+__BEGIN_DECLS
+void fp_nquery (const u_char *, int, FILE *) __THROW;
+void fp_query (const u_char *, FILE *) __THROW;
+const char * hostalias (const char *) __THROW;
+void p_query (const u_char *) __THROW;
+void res_close (void) __THROW;
+int res_init (void) __THROW;
+int res_isourserver (const struct sockaddr_in *) __THROW;
+int res_mkquery (int, const char *, int, int, const u_char *,
+ int, const u_char *, u_char *, int) __THROW;
+int res_query (const char *, int, int, u_char *, int) __THROW;
+int res_querydomain (const char *, const char *, int, int,
+ u_char *, int) __THROW;
+int res_search (const char *, int, int, u_char *, int) __THROW;
+int res_send (const u_char *, int, u_char *, int) __THROW;
+__END_DECLS
+#endif
+
+#define b64_ntop __b64_ntop
+#define b64_pton __b64_pton
+#define dn_comp __dn_comp
+#define dn_count_labels __dn_count_labels
+#define dn_expand __dn_expand
+#define dn_skipname __dn_skipname
+#define fp_resstat __fp_resstat
+#define loc_aton __loc_aton
+#define loc_ntoa __loc_ntoa
+#define p_cdname __p_cdname
+#define p_cdnname __p_cdnname
+#define p_class __p_class
+#define p_fqname __p_fqname
+#define p_fqnname __p_fqnname
+#define p_option __p_option
+#define p_secstodate __p_secstodate
+#define p_section __p_section
+#define p_time __p_time
+#define p_type __p_type
+#define p_rcode __p_rcode
+#define putlong __putlong
+#define putshort __putshort
+#define res_dnok __res_dnok
+#define res_hnok __res_hnok
+#define res_hostalias __res_hostalias
+#define res_mailok __res_mailok
+#define res_nameinquery __res_nameinquery
+#define res_nclose __res_nclose
+#define res_ninit __res_ninit
+#define res_nmkquery __res_nmkquery
+#define res_npquery __res_npquery
+#define res_nquery __res_nquery
+#define res_nquerydomain __res_nquerydomain
+#define res_nsearch __res_nsearch
+#define res_nsend __res_nsend
+#define res_nisourserver __res_nisourserver
+#define res_ownok __res_ownok
+#define res_queriesmatch __res_queriesmatch
+#define res_randomid __res_randomid
+#define sym_ntop __sym_ntop
+#define sym_ntos __sym_ntos
+#define sym_ston __sym_ston
+__BEGIN_DECLS
+int res_hnok (const char *) __THROW;
+int res_ownok (const char *) __THROW;
+int res_mailok (const char *) __THROW;
+int res_dnok (const char *) __THROW;
+int sym_ston (const struct res_sym *, const char *, int *) __THROW;
+const char * sym_ntos (const struct res_sym *, int, int *) __THROW;
+const char * sym_ntop (const struct res_sym *, int, int *) __THROW;
+int b64_ntop (u_char const *, size_t, char *, size_t) __THROW;
+int b64_pton (char const *, u_char *, size_t) __THROW;
+int loc_aton (const char *ascii, u_char *binary) __THROW;
+const char * loc_ntoa (const u_char *binary, char *ascii) __THROW;
+int dn_skipname (const u_char *, const u_char *) __THROW;
+void putlong (u_int32_t, u_char *) __THROW;
+void putshort (u_int16_t, u_char *) __THROW;
+const char * p_class (int) __THROW;
+const char * p_time (u_int32_t) __THROW;
+const char * p_type (int) __THROW;
+const char * p_rcode (int) __THROW;
+const u_char * p_cdnname (const u_char *, const u_char *, int, FILE *)
+ __THROW;
+const u_char * p_cdname (const u_char *, const u_char *, FILE *) __THROW;
+const u_char * p_fqnname (const u_char *cp, const u_char *msg,
+ int, char *, int) __THROW;
+const u_char * p_fqname (const u_char *, const u_char *, FILE *) __THROW;
+const char * p_option (u_long option) __THROW;
+char * p_secstodate (u_long) __THROW;
+int dn_count_labels (const char *) __THROW;
+int dn_comp (const char *, u_char *, int, u_char **, u_char **)
+ __THROW;
+int dn_expand (const u_char *, const u_char *, const u_char *,
+ char *, int) __THROW;
+u_int res_randomid (void) __THROW;
+int res_nameinquery (const char *, int, int,
+ const u_char *, const u_char *) __THROW;
+int res_queriesmatch (const u_char *, const u_char *,
+ const u_char *, const u_char *) __THROW;
+const char * p_section (int section, int opcode) __THROW;
+/* Things involving a resolver context. */
+int res_ninit (res_state) __THROW;
+int res_nisourserver (const res_state,
+ const struct sockaddr_in *) __THROW;
+void fp_resstat (const res_state, FILE *) __THROW;
+void res_npquery (const res_state, const u_char *, int, FILE *)
+ __THROW;
+const char * res_hostalias (const res_state, const char *, char *, size_t)
+ __THROW;
+int res_nquery (res_state, const char *, int, int, u_char *, int)
+ __THROW;
+int res_nsearch (res_state, const char *, int, int, u_char *, int)
+ __THROW;
+int res_nquerydomain (res_state, const char *, const char *, int,
+ int, u_char *, int) __THROW;
+int res_nmkquery (res_state, int, const char *, int, int,
+ const u_char *, int, const u_char *, u_char *,
+ int) __THROW;
+int res_nsend (res_state, const u_char *, int, u_char *, int)
+ __THROW;
+void res_nclose (res_state) __THROW;
+__END_DECLS
+#endif
+
+#endif /* !_RESOLV_H_ */
diff --git a/sysroot/usr/include/rpc/auth.h b/sysroot/usr/include/rpc/auth.h
new file mode 100644
index 0000000..7c931d8
--- /dev/null
+++ b/sysroot/usr/include/rpc/auth.h
@@ -0,0 +1,213 @@
+/* @(#)auth.h 2.3 88/08/07 4.0 RPCSRC; from 1.17 88/02/08 SMI */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+
+/*
+ * auth.h, Authentication interface.
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ *
+ * The data structures are completely opaque to the client. The client
+ * is required to pass a AUTH * to routines that create rpc
+ * "sessions".
+ */
+
+#ifndef _RPC_AUTH_H
+
+#define _RPC_AUTH_H 1
+#include <features.h>
+#include <rpc/xdr.h>
+
+__BEGIN_DECLS
+
+#define MAX_AUTH_BYTES 400
+#define MAXNETNAMELEN 255 /* maximum length of network user's name */
+
+/*
+ * Status returned from authentication check
+ */
+enum auth_stat {
+ AUTH_OK=0,
+ /*
+ * failed at remote end
+ */
+ AUTH_BADCRED=1, /* bogus credentials (seal broken) */
+ AUTH_REJECTEDCRED=2, /* client should begin new session */
+ AUTH_BADVERF=3, /* bogus verifier (seal broken) */
+ AUTH_REJECTEDVERF=4, /* verifier expired or was replayed */
+ AUTH_TOOWEAK=5, /* rejected due to security reasons */
+ /*
+ * failed locally
+ */
+ AUTH_INVALIDRESP=6, /* bogus response verifier */
+ AUTH_FAILED=7 /* some unknown reason */
+};
+
+union des_block {
+ struct {
+ u_int32_t high;
+ u_int32_t low;
+ } key;
+ char c[8];
+};
+typedef union des_block des_block;
+extern bool_t xdr_des_block (XDR *__xdrs, des_block *__blkp) __THROW;
+
+/*
+ * Authentication info. Opaque to client.
+ */
+struct opaque_auth {
+ enum_t oa_flavor; /* flavor of auth */
+ caddr_t oa_base; /* address of more auth stuff */
+ u_int oa_length; /* not to exceed MAX_AUTH_BYTES */
+};
+
+/*
+ * Auth handle, interface to client side authenticators.
+ */
+typedef struct AUTH AUTH;
+struct AUTH {
+ struct opaque_auth ah_cred;
+ struct opaque_auth ah_verf;
+ union des_block ah_key;
+ struct auth_ops {
+ void (*ah_nextverf) (AUTH *);
+ int (*ah_marshal) (AUTH *, XDR *); /* nextverf & serialize */
+ int (*ah_validate) (AUTH *, struct opaque_auth *);
+ /* validate verifier */
+ int (*ah_refresh) (AUTH *); /* refresh credentials */
+ void (*ah_destroy) (AUTH *); /* destroy this structure */
+ } *ah_ops;
+ caddr_t ah_private;
+};
+
+
+/*
+ * Authentication ops.
+ * The ops and the auth handle provide the interface to the authenticators.
+ *
+ * AUTH *auth;
+ * XDR *xdrs;
+ * struct opaque_auth verf;
+ */
+#define AUTH_NEXTVERF(auth) \
+ ((*((auth)->ah_ops->ah_nextverf))(auth))
+#define auth_nextverf(auth) \
+ ((*((auth)->ah_ops->ah_nextverf))(auth))
+
+#define AUTH_MARSHALL(auth, xdrs) \
+ ((*((auth)->ah_ops->ah_marshal))(auth, xdrs))
+#define auth_marshall(auth, xdrs) \
+ ((*((auth)->ah_ops->ah_marshal))(auth, xdrs))
+
+#define AUTH_VALIDATE(auth, verfp) \
+ ((*((auth)->ah_ops->ah_validate))((auth), verfp))
+#define auth_validate(auth, verfp) \
+ ((*((auth)->ah_ops->ah_validate))((auth), verfp))
+
+#define AUTH_REFRESH(auth) \
+ ((*((auth)->ah_ops->ah_refresh))(auth))
+#define auth_refresh(auth) \
+ ((*((auth)->ah_ops->ah_refresh))(auth))
+
+#define AUTH_DESTROY(auth) \
+ ((*((auth)->ah_ops->ah_destroy))(auth))
+#define auth_destroy(auth) \
+ ((*((auth)->ah_ops->ah_destroy))(auth))
+
+
+extern struct opaque_auth _null_auth;
+
+
+/*
+ * These are the various implementations of client side authenticators.
+ */
+
+/*
+ * Unix style authentication
+ * AUTH *authunix_create(machname, uid, gid, len, aup_gids)
+ * char *machname;
+ * int uid;
+ * int gid;
+ * int len;
+ * int *aup_gids;
+ */
+extern AUTH *authunix_create (char *__machname, __uid_t __uid, __gid_t __gid,
+ int __len, __gid_t *__aup_gids);
+extern AUTH *authunix_create_default (void);
+extern AUTH *authnone_create (void) __THROW;
+extern AUTH *authdes_create (const char *__servername, u_int __window,
+ struct sockaddr *__syncaddr, des_block *__ckey)
+ __THROW;
+extern AUTH *authdes_pk_create (const char *, netobj *, u_int,
+ struct sockaddr *, des_block *) __THROW;
+
+
+#define AUTH_NONE 0 /* no authentication */
+#define AUTH_NULL 0 /* backward compatibility */
+#define AUTH_SYS 1 /* unix style (uid, gids) */
+#define AUTH_UNIX AUTH_SYS
+#define AUTH_SHORT 2 /* short hand unix style */
+#define AUTH_DES 3 /* des style (encrypted timestamps) */
+#define AUTH_DH AUTH_DES /* Diffie-Hellman (this is DES) */
+#define AUTH_KERB 4 /* kerberos style */
+
+/*
+ * Netname manipulating functions
+ *
+ */
+extern int getnetname (char *) __THROW;
+extern int host2netname (char *, __const char *, __const char *) __THROW;
+extern int user2netname (char *, __const uid_t, __const char *) __THROW;
+extern int netname2user (__const char *, uid_t *, gid_t *, int *, gid_t *)
+ __THROW;
+extern int netname2host (__const char *, char *, __const int) __THROW;
+
+/*
+ *
+ * These routines interface to the keyserv daemon
+ *
+ */
+extern int key_decryptsession (char *, des_block *);
+extern int key_decryptsession_pk (char *, netobj *, des_block *);
+extern int key_encryptsession (char *, des_block *);
+extern int key_encryptsession_pk (char *, netobj *, des_block *);
+extern int key_gendes (des_block *);
+extern int key_setsecret (char *);
+extern int key_secretkey_is_set (void);
+extern int key_get_conv (char *, des_block *);
+
+/*
+ * XDR an opaque authentication struct.
+ */
+extern bool_t xdr_opaque_auth (XDR *, struct opaque_auth *) __THROW;
+
+__END_DECLS
+
+#endif /* rpc/auth.h */
diff --git a/sysroot/usr/include/rpc/auth_des.h b/sysroot/usr/include/rpc/auth_des.h
new file mode 100644
index 0000000..12ada84
--- /dev/null
+++ b/sysroot/usr/include/rpc/auth_des.h
@@ -0,0 +1,112 @@
+/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _RPC_AUTH_DES_H
+#define _RPC_AUTH_DES_H 1
+
+#include <sys/cdefs.h>
+#include <rpc/auth.h>
+
+__BEGIN_DECLS
+
+/* There are two kinds of "names": fullnames and nicknames */
+enum authdes_namekind
+ {
+ ADN_FULLNAME,
+ ADN_NICKNAME
+ };
+
+/* A fullname contains the network name of the client,
+ a conversation key and the window */
+struct authdes_fullname
+ {
+ char *name; /* network name of client, up to MAXNETNAMELEN */
+ des_block key; /* conversation key */
+ uint32_t window; /* associated window */
+ };
+
+/* A credential */
+struct authdes_cred
+ {
+ enum authdes_namekind adc_namekind;
+ struct authdes_fullname adc_fullname;
+ uint32_t adc_nickname;
+ };
+
+/* A timeval replacement for !32bit platforms */
+struct rpc_timeval
+ {
+ uint32_t tv_sec; /* Seconds. */
+ uint32_t tv_usec; /* Microseconds. */
+ };
+
+/* A des authentication verifier */
+struct authdes_verf
+ {
+ union
+ {
+ struct rpc_timeval adv_ctime; /* clear time */
+ des_block adv_xtime; /* crypt time */
+ }
+ adv_time_u;
+ uint32_t adv_int_u;
+ };
+
+/* des authentication verifier: client variety
+
+ adv_timestamp is the current time.
+ adv_winverf is the credential window + 1.
+ Both are encrypted using the conversation key. */
+#define adv_timestamp adv_time_u.adv_ctime
+#define adv_xtimestamp adv_time_u.adv_xtime
+#define adv_winverf adv_int_u
+
+/* des authentication verifier: server variety
+
+ adv_timeverf is the client's timestamp + client's window
+ adv_nickname is the server's nickname for the client.
+ adv_timeverf is encrypted using the conversation key. */
+#define adv_timeverf adv_time_u.adv_ctime
+#define adv_xtimeverf adv_time_u.adv_xtime
+#define adv_nickname adv_int_u
+
+/* Map a des credential into a unix cred. */
+extern int authdes_getucred (__const struct authdes_cred * __adc,
+ uid_t * __uid, gid_t * __gid,
+ short *__grouplen, gid_t * __groups) __THROW;
+
+/* Get the public key for NAME and place it in KEY. NAME can only be
+ up to MAXNETNAMELEN bytes long and the destination buffer KEY should
+ have HEXKEYBYTES + 1 bytes long to fit all characters from the key. */
+extern int getpublickey (__const char *__name, char *__key) __THROW;
+
+/* Get the secret key for NAME and place it in KEY. PASSWD is used to
+ decrypt the encrypted key stored in the database. NAME can only be
+ up to MAXNETNAMELEN bytes long and the destination buffer KEY
+ should have HEXKEYBYTES + 1 bytes long to fit all characters from
+ the key. */
+extern int getsecretkey (__const char *__name, char *__key,
+ __const char *__passwd) __THROW;
+
+extern int rtime (struct sockaddr_in *__addrp, struct rpc_timeval *__timep,
+ struct rpc_timeval *__timeout) __THROW;
+
+__END_DECLS
+
+
+#endif /* rpc/auth_des.h */
diff --git a/sysroot/usr/include/rpc/auth_unix.h b/sysroot/usr/include/rpc/auth_unix.h
new file mode 100644
index 0000000..424661d
--- /dev/null
+++ b/sysroot/usr/include/rpc/auth_unix.h
@@ -0,0 +1,90 @@
+/* @(#)auth_unix.h 2.2 88/07/29 4.0 RPCSRC; from 1.8 88/02/08 SMI */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+/* @(#)auth_unix.h 1.5 86/07/16 SMI */
+
+/*
+ * auth_unix.h, Protocol for UNIX style authentication parameters for RPC
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ */
+
+/*
+ * The system is very weak. The client uses no encryption for it
+ * credentials and only sends null verifiers. The server sends backs
+ * null verifiers or optionally a verifier that suggests a new short hand
+ * for the credentials.
+ */
+
+#ifndef _RPC_AUTH_UNIX_H
+#define _RPC_AUTH_UNIX_H 1
+
+#include <features.h>
+#include <sys/types.h>
+#include <rpc/types.h>
+#include <rpc/auth.h>
+#include <rpc/xdr.h>
+
+__BEGIN_DECLS
+
+/* The machine name is part of a credential; it may not exceed 255 bytes */
+#define MAX_MACHINE_NAME 255
+
+/* gids compose part of a credential; there may not be more than 16 of them */
+#define NGRPS 16
+
+/*
+ * Unix style credentials.
+ */
+struct authunix_parms
+ {
+ u_long aup_time;
+ char *aup_machname;
+ __uid_t aup_uid;
+ __gid_t aup_gid;
+ u_int aup_len;
+ __gid_t *aup_gids;
+ };
+
+extern bool_t xdr_authunix_parms (XDR *__xdrs, struct authunix_parms *__p)
+ __THROW;
+
+/*
+ * If a response verifier has flavor AUTH_SHORT,
+ * then the body of the response verifier encapsulates the following structure;
+ * again it is serialized in the obvious fashion.
+ */
+struct short_hand_verf
+ {
+ struct opaque_auth new_cred;
+ };
+
+__END_DECLS
+
+#endif /* rpc/auth_unix.h */
diff --git a/sysroot/usr/include/rpc/clnt.h b/sysroot/usr/include/rpc/clnt.h
new file mode 100644
index 0000000..cf271c5
--- /dev/null
+++ b/sysroot/usr/include/rpc/clnt.h
@@ -0,0 +1,421 @@
+/* @(#)clnt.h 2.1 88/07/29 4.0 RPCSRC; from 1.31 88/02/08 SMI*/
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+
+/*
+ * clnt.h - Client side remote procedure call interface.
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ */
+
+#ifndef _RPC_CLNT_H
+#define _RPC_CLNT_H 1
+
+#include <features.h>
+#include <sys/types.h>
+#include <rpc/types.h>
+#include <rpc/auth.h>
+#include <sys/un.h>
+
+__BEGIN_DECLS
+
+/*
+ * Rpc calls return an enum clnt_stat. This should be looked at more,
+ * since each implementation is required to live with this (implementation
+ * independent) list of errors.
+ */
+enum clnt_stat {
+ RPC_SUCCESS=0, /* call succeeded */
+ /*
+ * local errors
+ */
+ RPC_CANTENCODEARGS=1, /* can't encode arguments */
+ RPC_CANTDECODERES=2, /* can't decode results */
+ RPC_CANTSEND=3, /* failure in sending call */
+ RPC_CANTRECV=4, /* failure in receiving result */
+ RPC_TIMEDOUT=5, /* call timed out */
+ /*
+ * remote errors
+ */
+ RPC_VERSMISMATCH=6, /* rpc versions not compatible */
+ RPC_AUTHERROR=7, /* authentication error */
+ RPC_PROGUNAVAIL=8, /* program not available */
+ RPC_PROGVERSMISMATCH=9, /* program version mismatched */
+ RPC_PROCUNAVAIL=10, /* procedure unavailable */
+ RPC_CANTDECODEARGS=11, /* decode arguments error */
+ RPC_SYSTEMERROR=12, /* generic "other problem" */
+ RPC_NOBROADCAST = 21, /* Broadcasting not supported */
+ /*
+ * callrpc & clnt_create errors
+ */
+ RPC_UNKNOWNHOST=13, /* unknown host name */
+ RPC_UNKNOWNPROTO=17, /* unknown protocol */
+ RPC_UNKNOWNADDR = 19, /* Remote address unknown */
+
+ /*
+ * rpcbind errors
+ */
+ RPC_RPCBFAILURE=14, /* portmapper failed in its call */
+#define RPC_PMAPFAILURE RPC_RPCBFAILURE
+ RPC_PROGNOTREGISTERED=15, /* remote program is not registered */
+ RPC_N2AXLATEFAILURE = 22, /* Name to addr translation failed */
+ /*
+ * unspecified error
+ */
+ RPC_FAILED=16,
+ RPC_INTR=18,
+ RPC_TLIERROR=20,
+ RPC_UDERROR=23,
+ /*
+ * asynchronous errors
+ */
+ RPC_INPROGRESS = 24,
+ RPC_STALERACHANDLE = 25
+};
+
+
+/*
+ * Error info.
+ */
+struct rpc_err {
+ enum clnt_stat re_status;
+ union {
+ int RE_errno; /* related system error */
+ enum auth_stat RE_why; /* why the auth error occurred */
+ struct {
+ u_long low; /* lowest verion supported */
+ u_long high; /* highest verion supported */
+ } RE_vers;
+ struct { /* maybe meaningful if RPC_FAILED */
+ long s1;
+ long s2;
+ } RE_lb; /* life boot & debugging only */
+ } ru;
+#define re_errno ru.RE_errno
+#define re_why ru.RE_why
+#define re_vers ru.RE_vers
+#define re_lb ru.RE_lb
+};
+
+
+/*
+ * Client rpc handle.
+ * Created by individual implementations, see e.g. rpc_udp.c.
+ * Client is responsible for initializing auth, see e.g. auth_none.c.
+ */
+typedef struct CLIENT CLIENT;
+struct CLIENT {
+ AUTH *cl_auth; /* authenticator */
+ struct clnt_ops {
+ enum clnt_stat (*cl_call) (CLIENT *, u_long, xdrproc_t, caddr_t, xdrproc_t,
+ caddr_t, struct timeval);
+ /* call remote procedure */
+ void (*cl_abort) (void); /* abort a call */
+ void (*cl_geterr) (CLIENT *, struct rpc_err *);
+ /* get specific error code */
+ bool_t (*cl_freeres) (CLIENT *, xdrproc_t, caddr_t);
+ /* frees results */
+ void (*cl_destroy) (CLIENT *); /* destroy this structure */
+ bool_t (*cl_control) (CLIENT *, int, char *);
+ /* the ioctl() of rpc */
+ } *cl_ops;
+ caddr_t cl_private; /* private stuff */
+};
+
+
+/*
+ * client side rpc interface ops
+ *
+ * Parameter types are:
+ *
+ */
+
+/*
+ * enum clnt_stat
+ * CLNT_CALL(rh, proc, xargs, argsp, xres, resp, timeout)
+ * CLIENT *rh;
+ * u_long proc;
+ * xdrproc_t xargs;
+ * caddr_t argsp;
+ * xdrproc_t xres;
+ * caddr_t resp;
+ * struct timeval timeout;
+ */
+#define CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs) \
+ ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs))
+#define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \
+ ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs))
+
+/*
+ * void
+ * CLNT_ABORT(rh);
+ * CLIENT *rh;
+ */
+#define CLNT_ABORT(rh) ((*(rh)->cl_ops->cl_abort)(rh))
+#define clnt_abort(rh) ((*(rh)->cl_ops->cl_abort)(rh))
+
+/*
+ * struct rpc_err
+ * CLNT_GETERR(rh);
+ * CLIENT *rh;
+ */
+#define CLNT_GETERR(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp))
+#define clnt_geterr(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp))
+
+
+/*
+ * bool_t
+ * CLNT_FREERES(rh, xres, resp);
+ * CLIENT *rh;
+ * xdrproc_t xres;
+ * caddr_t resp;
+ */
+#define CLNT_FREERES(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))
+#define clnt_freeres(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))
+
+/*
+ * bool_t
+ * CLNT_CONTROL(cl, request, info)
+ * CLIENT *cl;
+ * u_int request;
+ * char *info;
+ */
+#define CLNT_CONTROL(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in))
+#define clnt_control(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in))
+
+/*
+ * control operations that apply to all transports
+ *
+ * Note: options marked XXX are no-ops in this implementation of RPC.
+ * The are present in TI-RPC but can't be implemented here since they
+ * depend on the presence of STREAMS/TLI, which we don't have.
+ */
+#define CLSET_TIMEOUT 1 /* set timeout (timeval) */
+#define CLGET_TIMEOUT 2 /* get timeout (timeval) */
+#define CLGET_SERVER_ADDR 3 /* get server's address (sockaddr) */
+#define CLGET_FD 6 /* get connections file descriptor */
+#define CLGET_SVC_ADDR 7 /* get server's address (netbuf) XXX */
+#define CLSET_FD_CLOSE 8 /* close fd while clnt_destroy */
+#define CLSET_FD_NCLOSE 9 /* Do not close fd while clnt_destroy*/
+#define CLGET_XID 10 /* Get xid */
+#define CLSET_XID 11 /* Set xid */
+#define CLGET_VERS 12 /* Get version number */
+#define CLSET_VERS 13 /* Set version number */
+#define CLGET_PROG 14 /* Get program number */
+#define CLSET_PROG 15 /* Set program number */
+#define CLSET_SVC_ADDR 16 /* get server's address (netbuf) XXX */
+#define CLSET_PUSH_TIMOD 17 /* push timod if not already present XXX */
+#define CLSET_POP_TIMOD 18 /* pop timod XXX */
+/*
+ * Connectionless only control operations
+ */
+#define CLSET_RETRY_TIMEOUT 4 /* set retry timeout (timeval) */
+#define CLGET_RETRY_TIMEOUT 5 /* get retry timeout (timeval) */
+
+/*
+ * void
+ * CLNT_DESTROY(rh);
+ * CLIENT *rh;
+ */
+#define CLNT_DESTROY(rh) ((*(rh)->cl_ops->cl_destroy)(rh))
+#define clnt_destroy(rh) ((*(rh)->cl_ops->cl_destroy)(rh))
+
+
+/*
+ * RPCTEST is a test program which is accessible on every rpc
+ * transport/port. It is used for testing, performance evaluation,
+ * and network administration.
+ */
+
+#define RPCTEST_PROGRAM ((u_long)1)
+#define RPCTEST_VERSION ((u_long)1)
+#define RPCTEST_NULL_PROC ((u_long)2)
+#define RPCTEST_NULL_BATCH_PROC ((u_long)3)
+
+/*
+ * By convention, procedure 0 takes null arguments and returns them
+ */
+
+#define NULLPROC ((u_long)0)
+
+/*
+ * Below are the client handle creation routines for the various
+ * implementations of client side rpc. They can return NULL if a
+ * creation failure occurs.
+ */
+
+/*
+ * Memory based rpc (for speed check and testing)
+ * CLIENT *
+ * clntraw_create(prog, vers)
+ * u_long prog;
+ * u_long vers;
+ */
+extern CLIENT *clntraw_create (__const u_long __prog, __const u_long __vers)
+ __THROW;
+
+
+/*
+ * Generic client creation routine. Supported protocols are "udp", "tcp" and
+ * "unix"
+ * CLIENT *
+ * clnt_create(host, prog, vers, prot)
+ * char *host; -- hostname
+ * u_long prog; -- program number
+ * u_ong vers; -- version number
+ * char *prot; -- protocol
+ */
+extern CLIENT *clnt_create (__const char *__host, __const u_long __prog,
+ __const u_long __vers, __const char *__prot)
+ __THROW;
+
+
+/*
+ * TCP based rpc
+ * CLIENT *
+ * clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz)
+ * struct sockaddr_in *raddr;
+ * u_long prog;
+ * u_long version;
+ * register int *sockp;
+ * u_int sendsz;
+ * u_int recvsz;
+ */
+extern CLIENT *clnttcp_create (struct sockaddr_in *__raddr, u_long __prog,
+ u_long __version, int *__sockp, u_int __sendsz,
+ u_int __recvsz) __THROW;
+
+/*
+ * UDP based rpc.
+ * CLIENT *
+ * clntudp_create(raddr, program, version, wait, sockp)
+ * struct sockaddr_in *raddr;
+ * u_long program;
+ * u_long version;
+ * struct timeval wait_resend;
+ * int *sockp;
+ *
+ * Same as above, but you specify max packet sizes.
+ * CLIENT *
+ * clntudp_bufcreate(raddr, program, version, wait, sockp, sendsz, recvsz)
+ * struct sockaddr_in *raddr;
+ * u_long program;
+ * u_long version;
+ * struct timeval wait_resend;
+ * int *sockp;
+ * u_int sendsz;
+ * u_int recvsz;
+ */
+extern CLIENT *clntudp_create (struct sockaddr_in *__raddr, u_long __program,
+ u_long __version, struct timeval __wait_resend,
+ int *__sockp) __THROW;
+extern CLIENT *clntudp_bufcreate (struct sockaddr_in *__raddr,
+ u_long __program, u_long __version,
+ struct timeval __wait_resend, int *__sockp,
+ u_int __sendsz, u_int __recvsz) __THROW;
+
+
+
+
+/*
+ * AF_UNIX based rpc
+ * CLIENT *
+ * clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz)
+ * struct sockaddr_un *raddr;
+ * u_long prog;
+ * u_long version;
+ * register int *sockp;
+ * u_int sendsz;
+ * u_int recvsz;
+ */
+extern CLIENT *clntunix_create (struct sockaddr_un *__raddr, u_long __program,
+ u_long __version, int *__sockp,
+ u_int __sendsz, u_int __recvsz) __THROW;
+
+
+extern int callrpc (__const char *__host, __const u_long __prognum,
+ __const u_long __versnum, __const u_long __procnum,
+ __const xdrproc_t __inproc, __const char *__in,
+ __const xdrproc_t __outproc, char *__out) __THROW;
+extern int _rpc_dtablesize (void) __THROW;
+
+/*
+ * Print why creation failed
+ */
+extern void clnt_pcreateerror (__const char *__msg); /* stderr */
+extern char *clnt_spcreateerror(__const char *__msg) __THROW; /* string */
+
+/*
+ * Like clnt_perror(), but is more verbose in its output
+ */
+extern void clnt_perrno (enum clnt_stat __num); /* stderr */
+
+/*
+ * Print an English error message, given the client error code
+ */
+extern void clnt_perror (CLIENT *__clnt, __const char *__msg);
+ /* stderr */
+extern char *clnt_sperror (CLIENT *__clnt, __const char *__msg) __THROW;
+ /* string */
+
+/*
+ * If a creation fails, the following allows the user to figure out why.
+ */
+struct rpc_createerr {
+ enum clnt_stat cf_stat;
+ struct rpc_err cf_error; /* useful when cf_stat == RPC_PMAPFAILURE */
+};
+
+extern struct rpc_createerr rpc_createerr;
+
+
+
+/*
+ * Copy error message to buffer.
+ */
+extern char *clnt_sperrno (enum clnt_stat __num) __THROW; /* string */
+
+/*
+ * get the port number on the host for the rpc program,version and proto
+ */
+extern int getrpcport (__const char * __host, u_long __prognum,
+ u_long __versnum, u_int proto) __THROW;
+
+/*
+ * get the local host's IP address without consulting
+ * name service library functions
+ */
+extern void get_myaddress (struct sockaddr_in *) __THROW;
+
+#define UDPMSGSIZE 8800 /* rpc imposed limit on udp msg size */
+#define RPCSMALLMSGSIZE 400 /* a more reasonable packet size */
+
+__END_DECLS
+
+#endif /* rpc/clnt.h */
diff --git a/sysroot/usr/include/rpc/des_crypt.h b/sysroot/usr/include/rpc/des_crypt.h
new file mode 100644
index 0000000..6a65887
--- /dev/null
+++ b/sysroot/usr/include/rpc/des_crypt.h
@@ -0,0 +1,97 @@
+/*
+ * @(#)des_crypt.h 2.1 88/08/11 4.0 RPCSRC; from 1.4 88/02/08 (C) 1986 SMI
+ *
+ * des_crypt.h, des library routine interface
+ * Copyright (C) 1986, Sun Microsystems, Inc.
+ */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+
+#ifndef __DES_CRYPT_H__
+#define __DES_CRYPT_H__ 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+#define DES_MAXDATA 8192 /* max bytes encrypted in one call */
+#define DES_DIRMASK (1 << 0)
+#define DES_ENCRYPT (0*DES_DIRMASK) /* Encrypt */
+#define DES_DECRYPT (1*DES_DIRMASK) /* Decrypt */
+
+
+#define DES_DEVMASK (1 << 1)
+#define DES_HW (0*DES_DEVMASK) /* Use hardware device */
+#define DES_SW (1*DES_DEVMASK) /* Use software device */
+
+
+#define DESERR_NONE 0 /* succeeded */
+#define DESERR_NOHWDEVICE 1 /* succeeded, but hw device not available */
+#define DESERR_HWERROR 2 /* failed, hardware/driver error */
+#define DESERR_BADPARAM 3 /* failed, bad parameter to call */
+
+#define DES_FAILED(err) \
+ ((err) > DESERR_NOHWDEVICE)
+
+/*
+ * cbc_crypt()
+ * ecb_crypt()
+ *
+ * Encrypt (or decrypt) len bytes of a buffer buf.
+ * The length must be a multiple of eight.
+ * The key should have odd parity in the low bit of each byte.
+ * ivec is the input vector, and is updated to the new one (cbc only).
+ * The mode is created by oring together the appropriate parameters.
+ * DESERR_NOHWDEVICE is returned if DES_HW was specified but
+ * there was no hardware to do it on (the data will still be
+ * encrypted though, in software).
+ */
+
+
+/*
+ * Cipher Block Chaining mode
+ */
+extern int cbc_crypt (char *__key, char *__buf, unsigned __len,
+ unsigned __mode, char *__ivec) __THROW;
+
+/*
+ * Electronic Code Book mode
+ */
+extern int ecb_crypt (char *__key, char *__buf, unsigned __len,
+ unsigned __mode) __THROW;
+
+/*
+ * Set des parity for a key.
+ * DES parity is odd and in the low bit of each byte
+ */
+extern void des_setparity (char *__key) __THROW;
+
+__END_DECLS
+
+#endif
diff --git a/sysroot/usr/include/rpc/key_prot.h b/sysroot/usr/include/rpc/key_prot.h
new file mode 100644
index 0000000..3e2eb72
--- /dev/null
+++ b/sysroot/usr/include/rpc/key_prot.h
@@ -0,0 +1,346 @@
+/*
+ * Please do not edit this file.
+ * It was generated using rpcgen.
+ */
+
+#ifndef _KEY_PROT_H_RPCGEN
+#define _KEY_PROT_H_RPCGEN
+
+#include <rpc/rpc.h>
+
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+#if 0
+#pragma ident "@(#)key_prot.x 1.7 94/04/29 SMI"
+#endif
+/* Copyright (c) 1990, 1991 Sun Microsystems, Inc. */
+
+/*
+ * Compiled from key_prot.x using rpcgen.
+ * DO NOT EDIT THIS FILE!
+ * This is NOT source code!
+ */
+#define PROOT 3
+#define HEXMODULUS "d4a0ba0250b6fd2ec626e7efd637df76c716e22d0944b88b"
+#define HEXKEYBYTES 48
+#define KEYSIZE 192
+#define KEYBYTES 24
+#define KEYCHECKSUMSIZE 16
+
+enum keystatus {
+ KEY_SUCCESS = 0,
+ KEY_NOSECRET = 1,
+ KEY_UNKNOWN = 2,
+ KEY_SYSTEMERR = 3,
+};
+typedef enum keystatus keystatus;
+#ifdef __cplusplus
+extern "C" bool_t xdr_keystatus(XDR *, keystatus*);
+#elif __STDC__
+extern bool_t xdr_keystatus(XDR *, keystatus*);
+#else /* Old Style C */
+bool_t xdr_keystatus();
+#endif /* Old Style C */
+
+
+typedef char keybuf[HEXKEYBYTES];
+#ifdef __cplusplus
+extern "C" bool_t xdr_keybuf(XDR *, keybuf);
+#elif __STDC__
+extern bool_t xdr_keybuf(XDR *, keybuf);
+#else /* Old Style C */
+bool_t xdr_keybuf();
+#endif /* Old Style C */
+
+
+typedef char *netnamestr;
+#ifdef __cplusplus
+extern "C" bool_t xdr_netnamestr(XDR *, netnamestr*);
+#elif __STDC__
+extern bool_t xdr_netnamestr(XDR *, netnamestr*);
+#else /* Old Style C */
+bool_t xdr_netnamestr();
+#endif /* Old Style C */
+
+
+struct cryptkeyarg {
+ netnamestr remotename;
+ des_block deskey;
+};
+typedef struct cryptkeyarg cryptkeyarg;
+#ifdef __cplusplus
+extern "C" bool_t xdr_cryptkeyarg(XDR *, cryptkeyarg*);
+#elif __STDC__
+extern bool_t xdr_cryptkeyarg(XDR *, cryptkeyarg*);
+#else /* Old Style C */
+bool_t xdr_cryptkeyarg();
+#endif /* Old Style C */
+
+
+struct cryptkeyarg2 {
+ netnamestr remotename;
+ netobj remotekey;
+ des_block deskey;
+};
+typedef struct cryptkeyarg2 cryptkeyarg2;
+#ifdef __cplusplus
+extern "C" bool_t xdr_cryptkeyarg2(XDR *, cryptkeyarg2*);
+#elif __STDC__
+extern bool_t xdr_cryptkeyarg2(XDR *, cryptkeyarg2*);
+#else /* Old Style C */
+bool_t xdr_cryptkeyarg2();
+#endif /* Old Style C */
+
+
+struct cryptkeyres {
+ keystatus status;
+ union {
+ des_block deskey;
+ } cryptkeyres_u;
+};
+typedef struct cryptkeyres cryptkeyres;
+#ifdef __cplusplus
+extern "C" bool_t xdr_cryptkeyres(XDR *, cryptkeyres*);
+#elif __STDC__
+extern bool_t xdr_cryptkeyres(XDR *, cryptkeyres*);
+#else /* Old Style C */
+bool_t xdr_cryptkeyres();
+#endif /* Old Style C */
+
+#define MAXGIDS 16
+
+struct unixcred {
+ u_int uid;
+ u_int gid;
+ struct {
+ u_int gids_len;
+ u_int *gids_val;
+ } gids;
+};
+typedef struct unixcred unixcred;
+#ifdef __cplusplus
+extern "C" bool_t xdr_unixcred(XDR *, unixcred*);
+#elif __STDC__
+extern bool_t xdr_unixcred(XDR *, unixcred*);
+#else /* Old Style C */
+bool_t xdr_unixcred();
+#endif /* Old Style C */
+
+
+struct getcredres {
+ keystatus status;
+ union {
+ unixcred cred;
+ } getcredres_u;
+};
+typedef struct getcredres getcredres;
+#ifdef __cplusplus
+extern "C" bool_t xdr_getcredres(XDR *, getcredres*);
+#elif __STDC__
+extern bool_t xdr_getcredres(XDR *, getcredres*);
+#else /* Old Style C */
+bool_t xdr_getcredres();
+#endif /* Old Style C */
+
+
+struct key_netstarg {
+ keybuf st_priv_key;
+ keybuf st_pub_key;
+ netnamestr st_netname;
+};
+typedef struct key_netstarg key_netstarg;
+#ifdef __cplusplus
+extern "C" bool_t xdr_key_netstarg(XDR *, key_netstarg*);
+#elif __STDC__
+extern bool_t xdr_key_netstarg(XDR *, key_netstarg*);
+#else /* Old Style C */
+bool_t xdr_key_netstarg();
+#endif /* Old Style C */
+
+
+struct key_netstres {
+ keystatus status;
+ union {
+ key_netstarg knet;
+ } key_netstres_u;
+};
+typedef struct key_netstres key_netstres;
+#ifdef __cplusplus
+extern "C" bool_t xdr_key_netstres(XDR *, key_netstres*);
+#elif __STDC__
+extern bool_t xdr_key_netstres(XDR *, key_netstres*);
+#else /* Old Style C */
+bool_t xdr_key_netstres();
+#endif /* Old Style C */
+
+
+#ifndef opaque
+#define opaque char
+#endif
+
+
+#define KEY_PROG ((u_long)100029)
+#define KEY_VERS ((u_long)1)
+
+#ifdef __cplusplus
+#define KEY_SET ((u_long)1)
+extern "C" keystatus * key_set_1(opaque *, CLIENT *);
+extern "C" keystatus * key_set_1_svc(opaque *, struct svc_req *);
+#define KEY_ENCRYPT ((u_long)2)
+extern "C" cryptkeyres * key_encrypt_1(cryptkeyarg *, CLIENT *);
+extern "C" cryptkeyres * key_encrypt_1_svc(cryptkeyarg *, struct svc_req *);
+#define KEY_DECRYPT ((u_long)3)
+extern "C" cryptkeyres * key_decrypt_1(cryptkeyarg *, CLIENT *);
+extern "C" cryptkeyres * key_decrypt_1_svc(cryptkeyarg *, struct svc_req *);
+#define KEY_GEN ((u_long)4)
+extern "C" des_block * key_gen_1(void *, CLIENT *);
+extern "C" des_block * key_gen_1_svc(void *, struct svc_req *);
+#define KEY_GETCRED ((u_long)5)
+extern "C" getcredres * key_getcred_1(netnamestr *, CLIENT *);
+extern "C" getcredres * key_getcred_1_svc(netnamestr *, struct svc_req *);
+
+#elif __STDC__
+#define KEY_SET ((u_long)1)
+extern keystatus * key_set_1(opaque *, CLIENT *);
+extern keystatus * key_set_1_svc(opaque *, struct svc_req *);
+#define KEY_ENCRYPT ((u_long)2)
+extern cryptkeyres * key_encrypt_1(cryptkeyarg *, CLIENT *);
+extern cryptkeyres * key_encrypt_1_svc(cryptkeyarg *, struct svc_req *);
+#define KEY_DECRYPT ((u_long)3)
+extern cryptkeyres * key_decrypt_1(cryptkeyarg *, CLIENT *);
+extern cryptkeyres * key_decrypt_1_svc(cryptkeyarg *, struct svc_req *);
+#define KEY_GEN ((u_long)4)
+extern des_block * key_gen_1(void *, CLIENT *);
+extern des_block * key_gen_1_svc(void *, struct svc_req *);
+#define KEY_GETCRED ((u_long)5)
+extern getcredres * key_getcred_1(netnamestr *, CLIENT *);
+extern getcredres * key_getcred_1_svc(netnamestr *, struct svc_req *);
+
+#else /* Old Style C */
+#define KEY_SET ((u_long)1)
+extern keystatus * key_set_1();
+extern keystatus * key_set_1_svc();
+#define KEY_ENCRYPT ((u_long)2)
+extern cryptkeyres * key_encrypt_1();
+extern cryptkeyres * key_encrypt_1_svc();
+#define KEY_DECRYPT ((u_long)3)
+extern cryptkeyres * key_decrypt_1();
+extern cryptkeyres * key_decrypt_1_svc();
+#define KEY_GEN ((u_long)4)
+extern des_block * key_gen_1();
+extern des_block * key_gen_1_svc();
+#define KEY_GETCRED ((u_long)5)
+extern getcredres * key_getcred_1();
+extern getcredres * key_getcred_1_svc();
+#endif /* Old Style C */
+#define KEY_VERS2 ((u_long)2)
+
+#ifdef __cplusplus
+extern "C" keystatus * key_set_2(opaque *, CLIENT *);
+extern "C" keystatus * key_set_2_svc(opaque *, struct svc_req *);
+extern "C" cryptkeyres * key_encrypt_2(cryptkeyarg *, CLIENT *);
+extern "C" cryptkeyres * key_encrypt_2_svc(cryptkeyarg *, struct svc_req *);
+extern "C" cryptkeyres * key_decrypt_2(cryptkeyarg *, CLIENT *);
+extern "C" cryptkeyres * key_decrypt_2_svc(cryptkeyarg *, struct svc_req *);
+extern "C" des_block * key_gen_2(void *, CLIENT *);
+extern "C" des_block * key_gen_2_svc(void *, struct svc_req *);
+extern "C" getcredres * key_getcred_2(netnamestr *, CLIENT *);
+extern "C" getcredres * key_getcred_2_svc(netnamestr *, struct svc_req *);
+#define KEY_ENCRYPT_PK ((u_long)6)
+extern "C" cryptkeyres * key_encrypt_pk_2(cryptkeyarg2 *, CLIENT *);
+extern "C" cryptkeyres * key_encrypt_pk_2_svc(cryptkeyarg2 *, struct svc_req *);
+#define KEY_DECRYPT_PK ((u_long)7)
+extern "C" cryptkeyres * key_decrypt_pk_2(cryptkeyarg2 *, CLIENT *);
+extern "C" cryptkeyres * key_decrypt_pk_2_svc(cryptkeyarg2 *, struct svc_req *);
+#define KEY_NET_PUT ((u_long)8)
+extern "C" keystatus * key_net_put_2(key_netstarg *, CLIENT *);
+extern "C" keystatus * key_net_put_2_svc(key_netstarg *, struct svc_req *);
+#define KEY_NET_GET ((u_long)9)
+extern "C" key_netstres * key_net_get_2(void *, CLIENT *);
+extern "C" key_netstres * key_net_get_2_svc(void *, struct svc_req *);
+#define KEY_GET_CONV ((u_long)10)
+extern "C" cryptkeyres * key_get_conv_2(opaque *, CLIENT *);
+extern "C" cryptkeyres * key_get_conv_2_svc(opaque *, struct svc_req *);
+
+#elif __STDC__
+extern keystatus * key_set_2(opaque *, CLIENT *);
+extern keystatus * key_set_2_svc(opaque *, struct svc_req *);
+extern cryptkeyres * key_encrypt_2(cryptkeyarg *, CLIENT *);
+extern cryptkeyres * key_encrypt_2_svc(cryptkeyarg *, struct svc_req *);
+extern cryptkeyres * key_decrypt_2(cryptkeyarg *, CLIENT *);
+extern cryptkeyres * key_decrypt_2_svc(cryptkeyarg *, struct svc_req *);
+extern des_block * key_gen_2(void *, CLIENT *);
+extern des_block * key_gen_2_svc(void *, struct svc_req *);
+extern getcredres * key_getcred_2(netnamestr *, CLIENT *);
+extern getcredres * key_getcred_2_svc(netnamestr *, struct svc_req *);
+#define KEY_ENCRYPT_PK ((u_long)6)
+extern cryptkeyres * key_encrypt_pk_2(cryptkeyarg2 *, CLIENT *);
+extern cryptkeyres * key_encrypt_pk_2_svc(cryptkeyarg2 *, struct svc_req *);
+#define KEY_DECRYPT_PK ((u_long)7)
+extern cryptkeyres * key_decrypt_pk_2(cryptkeyarg2 *, CLIENT *);
+extern cryptkeyres * key_decrypt_pk_2_svc(cryptkeyarg2 *, struct svc_req *);
+#define KEY_NET_PUT ((u_long)8)
+extern keystatus * key_net_put_2(key_netstarg *, CLIENT *);
+extern keystatus * key_net_put_2_svc(key_netstarg *, struct svc_req *);
+#define KEY_NET_GET ((u_long)9)
+extern key_netstres * key_net_get_2(void *, CLIENT *);
+extern key_netstres * key_net_get_2_svc(void *, struct svc_req *);
+#define KEY_GET_CONV ((u_long)10)
+extern cryptkeyres * key_get_conv_2(opaque *, CLIENT *);
+extern cryptkeyres * key_get_conv_2_svc(opaque *, struct svc_req *);
+
+#else /* Old Style C */
+extern keystatus * key_set_2();
+extern keystatus * key_set_2_svc();
+extern cryptkeyres * key_encrypt_2();
+extern cryptkeyres * key_encrypt_2_svc();
+extern cryptkeyres * key_decrypt_2();
+extern cryptkeyres * key_decrypt_2_svc();
+extern des_block * key_gen_2();
+extern des_block * key_gen_2_svc();
+extern getcredres * key_getcred_2();
+extern getcredres * key_getcred_2_svc();
+#define KEY_ENCRYPT_PK ((u_long)6)
+extern cryptkeyres * key_encrypt_pk_2();
+extern cryptkeyres * key_encrypt_pk_2_svc();
+#define KEY_DECRYPT_PK ((u_long)7)
+extern cryptkeyres * key_decrypt_pk_2();
+extern cryptkeyres * key_decrypt_pk_2_svc();
+#define KEY_NET_PUT ((u_long)8)
+extern keystatus * key_net_put_2();
+extern keystatus * key_net_put_2_svc();
+#define KEY_NET_GET ((u_long)9)
+extern key_netstres * key_net_get_2();
+extern key_netstres * key_net_get_2_svc();
+#define KEY_GET_CONV ((u_long)10)
+extern cryptkeyres * key_get_conv_2();
+extern cryptkeyres * key_get_conv_2_svc();
+#endif /* Old Style C */
+
+#endif /* !_KEY_PROT_H_RPCGEN */
diff --git a/sysroot/usr/include/rpc/netdb.h b/sysroot/usr/include/rpc/netdb.h
new file mode 100644
index 0000000..539d8c3
--- /dev/null
+++ b/sysroot/usr/include/rpc/netdb.h
@@ -0,0 +1,74 @@
+/* @(#)netdb.h 2.1 88/07/29 3.9 RPCSRC */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+/* @(#)rpc.h 1.8 87/07/24 SMI */
+
+/* Cleaned up for GNU C library roland@gnu.ai.mit.edu:
+ added multiple inclusion protection and use of <sys/cdefs.h>.
+ In GNU this file is #include'd by <netdb.h>. */
+
+#ifndef _RPC_NETDB_H
+#define _RPC_NETDB_H 1
+
+#include <features.h>
+
+#define __need_size_t
+#include <stddef.h>
+
+__BEGIN_DECLS
+
+struct rpcent
+{
+ char *r_name; /* Name of server for this rpc program. */
+ char **r_aliases; /* Alias list. */
+ int r_number; /* RPC program number. */
+};
+
+extern void setrpcent (int __stayopen) __THROW;
+extern void endrpcent (void) __THROW;
+extern struct rpcent *getrpcbyname (__const char *__name) __THROW;
+extern struct rpcent *getrpcbynumber (int __number) __THROW;
+extern struct rpcent *getrpcent (void) __THROW;
+
+#ifdef __USE_MISC
+extern int getrpcbyname_r (__const char *__name, struct rpcent *__result_buf,
+ char *__buffer, size_t __buflen,
+ struct rpcent **__result) __THROW;
+
+extern int getrpcbynumber_r (int __number, struct rpcent *__result_buf,
+ char *__buffer, size_t __buflen,
+ struct rpcent **__result) __THROW;
+
+extern int getrpcent_r (struct rpcent *__result_buf, char *__buffer,
+ size_t __buflen, struct rpcent **__result) __THROW;
+#endif
+
+__END_DECLS
+
+#endif /* rpc/netdb.h */
diff --git a/sysroot/usr/include/rpc/pmap_clnt.h b/sysroot/usr/include/rpc/pmap_clnt.h
new file mode 100644
index 0000000..1b1c452
--- /dev/null
+++ b/sysroot/usr/include/rpc/pmap_clnt.h
@@ -0,0 +1,98 @@
+/* @(#)pmap_clnt.h 2.1 88/07/29 4.0 RPCSRC; from 1.11 88/02/08 SMI */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+
+/*
+ * pmap_clnt.h
+ * Supplies C routines to get to portmap services.
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ */
+
+#ifndef _RPC_PMAP_CLNT_H
+#define _RPC_PMAP_CLNT_H 1
+
+#include <features.h>
+#include <rpc/types.h>
+#include <rpc/xdr.h>
+#include <rpc/clnt.h>
+
+__BEGIN_DECLS
+
+typedef bool_t (*resultproc_t) (caddr_t resp, struct sockaddr_in *raddr);
+
+/*
+ * Usage:
+ * success = pmap_set(program, version, protocol, port);
+ * success = pmap_unset(program, version);
+ * port = pmap_getport(address, program, version, protocol);
+ * head = pmap_getmaps(address);
+ * clnt_stat = pmap_rmtcall(address, program, version, procedure,
+ * xdrargs, argsp, xdrres, resp, tout, port_ptr)
+ * (works for udp only.)
+ * clnt_stat = clnt_broadcast(program, version, procedure,
+ * xdrargs, argsp, xdrres, resp, eachresult)
+ * (like pmap_rmtcall, except the call is broadcasted to all
+ * locally connected nets. For each valid response received,
+ * the procedure eachresult is called. Its form is:
+ * done = eachresult(resp, raddr)
+ * bool_t done;
+ * caddr_t resp;
+ * struct sockaddr_in raddr;
+ * where resp points to the results of the call and raddr is the
+ * address if the responder to the broadcast.
+ */
+
+extern bool_t pmap_set (__const u_long __program, __const u_long __vers,
+ int __protocol, u_short __port) __THROW;
+extern bool_t pmap_unset (__const u_long __program, __const u_long __vers)
+ __THROW;
+extern struct pmaplist *pmap_getmaps (struct sockaddr_in *__address) __THROW;
+extern enum clnt_stat pmap_rmtcall (struct sockaddr_in *__addr,
+ __const u_long __prog,
+ __const u_long __vers,
+ __const u_long __proc,
+ xdrproc_t __xdrargs,
+ caddr_t __argsp, xdrproc_t __xdrres,
+ caddr_t __resp, struct timeval __tout,
+ u_long *__port_ptr) __THROW;
+extern enum clnt_stat clnt_broadcast (__const u_long __prog,
+ __const u_long __vers,
+ __const u_long __proc, xdrproc_t __xargs,
+ caddr_t __argsp, xdrproc_t __xresults,
+ caddr_t __resultsp,
+ resultproc_t __eachresult) __THROW;
+extern u_short pmap_getport (struct sockaddr_in *__address,
+ __const u_long __program,
+ __const u_long __version, u_int __protocol)
+ __THROW;
+
+__END_DECLS
+
+#endif /* rpc/pmap_clnt.h */
diff --git a/sysroot/usr/include/rpc/pmap_prot.h b/sysroot/usr/include/rpc/pmap_prot.h
new file mode 100644
index 0000000..cd64e36
--- /dev/null
+++ b/sysroot/usr/include/rpc/pmap_prot.h
@@ -0,0 +1,108 @@
+/* @(#)pmap_prot.h 2.1 88/07/29 4.0 RPCSRC; from 1.14 88/02/08 SMI */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+
+/*
+ * pmap_prot.h
+ * Protocol for the local binder service, or pmap.
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ */
+
+#ifndef _RPC_PMAP_PROT_H
+#define _RPC_PMAP_PROT_H 1
+
+#include <features.h>
+
+#include <rpc/xdr.h>
+
+__BEGIN_DECLS
+
+/* The following procedures are supported by the protocol:
+ *
+ * PMAPPROC_NULL() returns ()
+ * takes nothing, returns nothing
+ *
+ * PMAPPROC_SET(struct pmap) returns (bool_t)
+ * TRUE is success, FALSE is failure. Registers the tuple
+ * [prog, vers, prot, port].
+ *
+ * PMAPPROC_UNSET(struct pmap) returns (bool_t)
+ * TRUE is success, FALSE is failure. Un-registers pair
+ * [prog, vers]. prot and port are ignored.
+ *
+ * PMAPPROC_GETPORT(struct pmap) returns (long unsigned).
+ * 0 is failure. Otherwise returns the port number where the pair
+ * [prog, vers] is registered. It may lie!
+ *
+ * PMAPPROC_DUMP() RETURNS (struct pmaplist *)
+ *
+ * PMAPPROC_CALLIT(unsigned, unsigned, unsigned, string<>)
+ * RETURNS (port, string<>);
+ * usage: encapsulatedresults = PMAPPROC_CALLIT(prog, vers, proc, encapsulatedargs);
+ * Calls the procedure on the local machine. If it is not registered,
+ * this procedure is quite; ie it does not return error information!!!
+ * This procedure only is supported on rpc/udp and calls via
+ * rpc/udp. This routine only passes null authentication parameters.
+ * This file has no interface to xdr routines for PMAPPROC_CALLIT.
+ *
+ * The service supports remote procedure calls on udp/ip or tcp/ip socket 111.
+ */
+
+#define PMAPPORT ((u_short)111)
+#define PMAPPROG ((u_long)100000)
+#define PMAPVERS ((u_long)2)
+#define PMAPVERS_PROTO ((u_long)2)
+#define PMAPVERS_ORIG ((u_long)1)
+#define PMAPPROC_NULL ((u_long)0)
+#define PMAPPROC_SET ((u_long)1)
+#define PMAPPROC_UNSET ((u_long)2)
+#define PMAPPROC_GETPORT ((u_long)3)
+#define PMAPPROC_DUMP ((u_long)4)
+#define PMAPPROC_CALLIT ((u_long)5)
+
+struct pmap {
+ long unsigned pm_prog;
+ long unsigned pm_vers;
+ long unsigned pm_prot;
+ long unsigned pm_port;
+};
+
+extern bool_t xdr_pmap (XDR *__xdrs, struct pmap *__regs) __THROW;
+
+struct pmaplist {
+ struct pmap pml_map;
+ struct pmaplist *pml_next;
+};
+
+extern bool_t xdr_pmaplist (XDR *__xdrs, struct pmaplist **__rp) __THROW;
+
+__END_DECLS
+
+#endif /* rpc/pmap_prot.h */
diff --git a/sysroot/usr/include/rpc/pmap_rmt.h b/sysroot/usr/include/rpc/pmap_rmt.h
new file mode 100644
index 0000000..7a38b5f
--- /dev/null
+++ b/sysroot/usr/include/rpc/pmap_rmt.h
@@ -0,0 +1,68 @@
+/* @(#)pmap_rmt.h 2.1 88/07/29 4.0 RPCSRC; from 1.2 88/02/08 SMI */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+
+/*
+ * Structures and XDR routines for parameters to and replies from
+ * the portmapper remote-call-service.
+ *
+ * Copyright (C) 1986, Sun Microsystems, Inc.
+ */
+
+#ifndef _RPC_PMAP_RMT_H
+#define _RPC_PMAP_RMT_H 1
+
+#include <features.h>
+#include <sys/types.h>
+#include <rpc/types.h>
+#include <rpc/xdr.h>
+
+__BEGIN_DECLS
+
+struct rmtcallargs {
+ u_long prog, vers, proc, arglen;
+ caddr_t args_ptr;
+ xdrproc_t xdr_args;
+};
+
+extern bool_t xdr_rmtcall_args (XDR *__xdrs, struct rmtcallargs *__crp)
+ __THROW;
+
+struct rmtcallres {
+ u_long *port_ptr;
+ u_long resultslen;
+ caddr_t results_ptr;
+ xdrproc_t xdr_results;
+};
+
+extern bool_t xdr_rmtcallres (XDR *__xdrs, struct rmtcallres *__crp) __THROW;
+
+__END_DECLS
+
+#endif /* rpc/pmap_rmt.h */
diff --git a/sysroot/usr/include/rpc/rpc.h b/sysroot/usr/include/rpc/rpc.h
new file mode 100644
index 0000000..38e4385
--- /dev/null
+++ b/sysroot/usr/include/rpc/rpc.h
@@ -0,0 +1,97 @@
+/* @(#)rpc.h 2.3 88/08/10 4.0 RPCSRC; from 1.9 88/02/08 SMI */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+
+/*
+ * rpc.h, Just includes the billions of rpc header files necessary to
+ * do remote procedure calling.
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ */
+
+#ifndef _RPC_RPC_H
+#define _RPC_RPC_H 1
+
+#include <rpc/types.h> /* some typedefs */
+#include <netinet/in.h>
+
+/* external data representation interfaces */
+#include <rpc/xdr.h> /* generic (de)serializer */
+
+/* Client side only authentication */
+#include <rpc/auth.h> /* generic authenticator (client side) */
+
+/* Client side (mostly) remote procedure call */
+#include <rpc/clnt.h> /* generic rpc stuff */
+
+/* semi-private protocol headers */
+#include <rpc/rpc_msg.h> /* protocol for rpc messages */
+#include <rpc/auth_unix.h> /* protocol for unix style cred */
+#include <rpc/auth_des.h> /* protocol for des style cred */
+
+/* Server side only remote procedure callee */
+#include <rpc/svc.h> /* service manager and multiplexer */
+#include <rpc/svc_auth.h> /* service side authenticator */
+
+/*
+ * COMMENT OUT THE NEXT INCLUDE IF RUNNING ON SUN OS OR ON A VERSION
+ * OF UNIX BASED ON NFSSRC. These systems will already have the structures
+ * defined by <rpc/netdb.h> included in <netdb.h>.
+ */
+/* routines for parsing /etc/rpc */
+#include <rpc/netdb.h> /* structures and routines to parse /etc/rpc */
+
+__BEGIN_DECLS
+
+/* Global variables, protected for multi-threaded applications. */
+extern fd_set *__rpc_thread_svc_fdset (void) __attribute__ ((__const__));
+#define svc_fdset (*__rpc_thread_svc_fdset ())
+
+extern struct rpc_createerr *__rpc_thread_createerr (void)
+ __attribute__ ((__const__));
+#define get_rpc_createerr() (*__rpc_thread_createerr ())
+/* The people who "engineered" RPC should bee punished for naming the
+ data structure and the variable the same. We cannot always define the
+ macro 'rpc_createerr' because this would prevent people from defining
+ object of type 'struct rpc_createerr'. So we leave it up to the user
+ to select transparent replacement also of this variable. */
+#ifdef _RPC_MT_VARS
+# define rpc_createerr (*__rpc_thread_createerr ())
+#endif
+
+extern struct pollfd **__rpc_thread_svc_pollfd (void)
+ __attribute__ ((__const__));
+#define svc_pollfd (*__rpc_thread_svc_pollfd ())
+
+extern int *__rpc_thread_svc_max_pollfd (void) __attribute__ ((__const__));
+#define svc_max_pollfd (*__rpc_thread_svc_max_pollfd ())
+
+__END_DECLS
+
+#endif /* rpc/rpc.h */
diff --git a/sysroot/usr/include/rpc/rpc_des.h b/sysroot/usr/include/rpc/rpc_des.h
new file mode 100644
index 0000000..0f36d16
--- /dev/null
+++ b/sysroot/usr/include/rpc/rpc_des.h
@@ -0,0 +1,72 @@
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+/*
+ * Generic DES driver interface
+ * Keep this file hardware independent!
+ * Copyright (c) 1986 by Sun Microsystems, Inc.
+ */
+
+#ifndef _DES_H
+#define _DES_H
+
+#include <sys/types.h>
+
+#define DES_MAXLEN 65536 /* maximum # of bytes to encrypt */
+#define DES_QUICKLEN 16 /* maximum # of bytes to encrypt quickly */
+
+enum desdir
+ {
+ ENCRYPT, DECRYPT
+ };
+enum desmode
+ {
+ CBC, ECB
+ };
+
+/*
+ * parameters to ioctl call
+ */
+struct desparams
+ {
+ u_char des_key[8]; /* key (with low bit parity) */
+ enum desdir des_dir; /* direction */
+ enum desmode des_mode; /* mode */
+ u_char des_ivec[8]; /* input vector */
+ unsigned des_len; /* number of bytes to crypt */
+ union
+ {
+ u_char UDES_data[DES_QUICKLEN];
+ u_char *UDES_buf;
+ }
+ UDES;
+#define des_data UDES.UDES_data /* direct data here if quick */
+#define des_buf UDES.UDES_buf /* otherwise, pointer to data */
+ };
+
+#endif
diff --git a/sysroot/usr/include/rpc/rpc_msg.h b/sysroot/usr/include/rpc/rpc_msg.h
new file mode 100644
index 0000000..636d60e
--- /dev/null
+++ b/sysroot/usr/include/rpc/rpc_msg.h
@@ -0,0 +1,202 @@
+/* @(#)rpc_msg.h 2.1 88/07/29 4.0 RPCSRC */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+/* @(#)rpc_msg.h 1.7 86/07/16 SMI */
+
+#ifndef _RPC_MSG_H
+#define _RPC_MSG_H 1
+
+#include <sys/cdefs.h>
+
+#include <rpc/xdr.h>
+#include <rpc/clnt.h>
+
+/*
+ * rpc_msg.h
+ * rpc message definition
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ */
+
+#define RPC_MSG_VERSION ((u_long) 2)
+#define RPC_SERVICE_PORT ((u_short) 2048)
+
+__BEGIN_DECLS
+
+/*
+ * Bottom up definition of an rpc message.
+ * NOTE: call and reply use the same overall struct but
+ * different parts of unions within it.
+ */
+
+enum msg_type {
+ CALL=0,
+ REPLY=1
+};
+
+enum reply_stat {
+ MSG_ACCEPTED=0,
+ MSG_DENIED=1
+};
+
+enum accept_stat {
+ SUCCESS=0,
+ PROG_UNAVAIL=1,
+ PROG_MISMATCH=2,
+ PROC_UNAVAIL=3,
+ GARBAGE_ARGS=4,
+ SYSTEM_ERR=5
+};
+
+enum reject_stat {
+ RPC_MISMATCH=0,
+ AUTH_ERROR=1
+};
+
+/*
+ * Reply part of an rpc exchange
+ */
+
+/*
+ * Reply to an rpc request that was accepted by the server.
+ * Note: there could be an error even though the request was
+ * accepted.
+ */
+struct accepted_reply {
+ struct opaque_auth ar_verf;
+ enum accept_stat ar_stat;
+ union {
+ struct {
+ u_long low;
+ u_long high;
+ } AR_versions;
+ struct {
+ caddr_t where;
+ xdrproc_t proc;
+ } AR_results;
+ /* and many other null cases */
+ } ru;
+#define ar_results ru.AR_results
+#define ar_vers ru.AR_versions
+};
+
+/*
+ * Reply to an rpc request that was rejected by the server.
+ */
+struct rejected_reply {
+ enum reject_stat rj_stat;
+ union {
+ struct {
+ u_long low;
+ u_long high;
+ } RJ_versions;
+ enum auth_stat RJ_why; /* why authentication did not work */
+ } ru;
+#define rj_vers ru.RJ_versions
+#define rj_why ru.RJ_why
+};
+
+/*
+ * Body of a reply to an rpc request.
+ */
+struct reply_body {
+ enum reply_stat rp_stat;
+ union {
+ struct accepted_reply RP_ar;
+ struct rejected_reply RP_dr;
+ } ru;
+#define rp_acpt ru.RP_ar
+#define rp_rjct ru.RP_dr
+};
+
+/*
+ * Body of an rpc request call.
+ */
+struct call_body {
+ u_long cb_rpcvers; /* must be equal to two */
+ u_long cb_prog;
+ u_long cb_vers;
+ u_long cb_proc;
+ struct opaque_auth cb_cred;
+ struct opaque_auth cb_verf; /* protocol specific - provided by client */
+};
+
+/*
+ * The rpc message
+ */
+struct rpc_msg {
+ u_long rm_xid;
+ enum msg_type rm_direction;
+ union {
+ struct call_body RM_cmb;
+ struct reply_body RM_rmb;
+ } ru;
+#define rm_call ru.RM_cmb
+#define rm_reply ru.RM_rmb
+};
+#define acpted_rply ru.RM_rmb.ru.RP_ar
+#define rjcted_rply ru.RM_rmb.ru.RP_dr
+
+
+/*
+ * XDR routine to handle a rpc message.
+ * xdr_callmsg(xdrs, cmsg)
+ * XDR *xdrs;
+ * struct rpc_msg *cmsg;
+ */
+extern bool_t xdr_callmsg (XDR *__xdrs, struct rpc_msg *__cmsg) __THROW;
+
+/*
+ * XDR routine to pre-serialize the static part of a rpc message.
+ * xdr_callhdr(xdrs, cmsg)
+ * XDR *xdrs;
+ * struct rpc_msg *cmsg;
+ */
+extern bool_t xdr_callhdr (XDR *__xdrs, struct rpc_msg *__cmsg) __THROW;
+
+/*
+ * XDR routine to handle a rpc reply.
+ * xdr_replymsg(xdrs, rmsg)
+ * XDR *xdrs;
+ * struct rpc_msg *rmsg;
+ */
+extern bool_t xdr_replymsg (XDR *__xdrs, struct rpc_msg *__rmsg) __THROW;
+
+/*
+ * Fills in the error part of a reply message.
+ * _seterr_reply(msg, error)
+ * struct rpc_msg *msg;
+ * struct rpc_err *error;
+ */
+extern void _seterr_reply (struct rpc_msg *__msg, struct rpc_err *__error)
+ __THROW;
+
+__END_DECLS
+
+#endif /* rpc/rpc_msg.h */
diff --git a/sysroot/usr/include/rpc/svc.h b/sysroot/usr/include/rpc/svc.h
new file mode 100644
index 0000000..3ffca50
--- /dev/null
+++ b/sysroot/usr/include/rpc/svc.h
@@ -0,0 +1,316 @@
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+
+/*
+ * svc.h, Server-side remote procedure call interface.
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ */
+
+#ifndef _RPC_SVC_H
+#define _RPC_SVC_H 1
+
+#include <features.h>
+#include <rpc/rpc_msg.h>
+
+__BEGIN_DECLS
+
+/*
+ * This interface must manage two items concerning remote procedure calling:
+ *
+ * 1) An arbitrary number of transport connections upon which rpc requests
+ * are received. The two most notable transports are TCP and UDP; they are
+ * created and registered by routines in svc_tcp.c and svc_udp.c, respectively;
+ * they in turn call xprt_register and xprt_unregister.
+ *
+ * 2) An arbitrary number of locally registered services. Services are
+ * described by the following four data: program number, version number,
+ * "service dispatch" function, a transport handle, and a boolean that
+ * indicates whether or not the exported program should be registered with a
+ * local binder service; if true the program's number and version and the
+ * port number from the transport handle are registered with the binder.
+ * These data are registered with the rpc svc system via svc_register.
+ *
+ * A service's dispatch function is called whenever an rpc request comes in
+ * on a transport. The request's program and version numbers must match
+ * those of the registered service. The dispatch function is passed two
+ * parameters, struct svc_req * and SVCXPRT *, defined below.
+ */
+
+enum xprt_stat {
+ XPRT_DIED,
+ XPRT_MOREREQS,
+ XPRT_IDLE
+};
+
+/*
+ * Server side transport handle
+ */
+typedef struct SVCXPRT SVCXPRT;
+struct SVCXPRT {
+ int xp_sock;
+ u_short xp_port; /* associated port number */
+ const struct xp_ops {
+ bool_t (*xp_recv) (SVCXPRT *__xprt, struct rpc_msg *__msg);
+ /* receive incoming requests */
+ enum xprt_stat (*xp_stat) (SVCXPRT *__xprt);
+ /* get transport status */
+ bool_t (*xp_getargs) (SVCXPRT *__xprt, xdrproc_t __xdr_args,
+ caddr_t args_ptr); /* get arguments */
+ bool_t (*xp_reply) (SVCXPRT *__xprt, struct rpc_msg *__msg);
+ /* send reply */
+ bool_t (*xp_freeargs) (SVCXPRT *__xprt, xdrproc_t __xdr_args,
+ caddr_t args_ptr);
+ /* free mem allocated for args */
+ void (*xp_destroy) (SVCXPRT *__xprt);
+ /* destroy this struct */
+ } *xp_ops;
+ int xp_addrlen; /* length of remote address */
+ struct sockaddr_in xp_raddr; /* remote address */
+ struct opaque_auth xp_verf; /* raw response verifier */
+ caddr_t xp_p1; /* private */
+ caddr_t xp_p2; /* private */
+ char xp_pad [256]; /* padding, internal use */
+};
+
+/*
+ * Approved way of getting address of caller
+ */
+#define svc_getcaller(x) (&(x)->xp_raddr)
+
+/*
+ * Operations defined on an SVCXPRT handle
+ *
+ * SVCXPRT *xprt;
+ * struct rpc_msg *msg;
+ * xdrproc_t xargs;
+ * caddr_t argsp;
+ */
+#define SVC_RECV(xprt, msg) \
+ (*(xprt)->xp_ops->xp_recv)((xprt), (msg))
+#define svc_recv(xprt, msg) \
+ (*(xprt)->xp_ops->xp_recv)((xprt), (msg))
+
+#define SVC_STAT(xprt) \
+ (*(xprt)->xp_ops->xp_stat)(xprt)
+#define svc_stat(xprt) \
+ (*(xprt)->xp_ops->xp_stat)(xprt)
+
+#define SVC_GETARGS(xprt, xargs, argsp) \
+ (*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp))
+#define svc_getargs(xprt, xargs, argsp) \
+ (*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp))
+
+#define SVC_REPLY(xprt, msg) \
+ (*(xprt)->xp_ops->xp_reply) ((xprt), (msg))
+#define svc_reply(xprt, msg) \
+ (*(xprt)->xp_ops->xp_reply) ((xprt), (msg))
+
+#define SVC_FREEARGS(xprt, xargs, argsp) \
+ (*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp))
+#define svc_freeargs(xprt, xargs, argsp) \
+ (*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp))
+
+#define SVC_DESTROY(xprt) \
+ (*(xprt)->xp_ops->xp_destroy)(xprt)
+#define svc_destroy(xprt) \
+ (*(xprt)->xp_ops->xp_destroy)(xprt)
+
+
+/*
+ * Service request
+ */
+struct svc_req {
+ rpcprog_t rq_prog; /* service program number */
+ rpcvers_t rq_vers; /* service protocol version */
+ rpcproc_t rq_proc; /* the desired procedure */
+ struct opaque_auth rq_cred; /* raw creds from the wire */
+ caddr_t rq_clntcred; /* read only cooked cred */
+ SVCXPRT *rq_xprt; /* associated transport */
+};
+
+#ifndef __DISPATCH_FN_T
+#define __DISPATCH_FN_T
+typedef void (*__dispatch_fn_t) (struct svc_req*, SVCXPRT*);
+#endif
+
+/*
+ * Service registration
+ *
+ * svc_register(xprt, prog, vers, dispatch, protocol)
+ * SVCXPRT *xprt;
+ * rpcprog_t prog;
+ * rpcvers_t vers;
+ * void (*dispatch)(struct svc_req*, SVCXPRT*);
+ * rpcprot_t protocol; like TCP or UDP, zero means do not register
+ */
+extern bool_t svc_register (SVCXPRT *__xprt, rpcprog_t __prog,
+ rpcvers_t __vers, __dispatch_fn_t __dispatch,
+ rpcprot_t __protocol) __THROW;
+
+/*
+ * Service un-registration
+ *
+ * svc_unregister(prog, vers)
+ * rpcprog_t prog;
+ * rpcvers_t vers;
+ */
+extern void svc_unregister (rpcprog_t __prog, rpcvers_t __vers) __THROW;
+
+/*
+ * Transport registration.
+ *
+ * xprt_register(xprt)
+ * SVCXPRT *xprt;
+ */
+extern void xprt_register (SVCXPRT *__xprt) __THROW;
+
+/*
+ * Transport un-register
+ *
+ * xprt_unregister(xprt)
+ * SVCXPRT *xprt;
+ */
+extern void xprt_unregister (SVCXPRT *__xprt) __THROW;
+
+
+/*
+ * When the service routine is called, it must first check to see if it
+ * knows about the procedure; if not, it should call svcerr_noproc
+ * and return. If so, it should deserialize its arguments via
+ * SVC_GETARGS (defined above). If the deserialization does not work,
+ * svcerr_decode should be called followed by a return. Successful
+ * decoding of the arguments should be followed the execution of the
+ * procedure's code and a call to svc_sendreply.
+ *
+ * Also, if the service refuses to execute the procedure due to too-
+ * weak authentication parameters, svcerr_weakauth should be called.
+ * Note: do not confuse access-control failure with weak authentication!
+ *
+ * NB: In pure implementations of rpc, the caller always waits for a reply
+ * msg. This message is sent when svc_sendreply is called.
+ * Therefore pure service implementations should always call
+ * svc_sendreply even if the function logically returns void; use
+ * xdr.h - xdr_void for the xdr routine. HOWEVER, tcp based rpc allows
+ * for the abuse of pure rpc via batched calling or pipelining. In the
+ * case of a batched call, svc_sendreply should NOT be called since
+ * this would send a return message, which is what batching tries to avoid.
+ * It is the service/protocol writer's responsibility to know which calls are
+ * batched and which are not. Warning: responding to batch calls may
+ * deadlock the caller and server processes!
+ */
+
+extern bool_t svc_sendreply (SVCXPRT *xprt, xdrproc_t __xdr_results,
+ caddr_t __xdr_location) __THROW;
+
+extern void svcerr_decode (SVCXPRT *__xprt) __THROW;
+
+extern void svcerr_weakauth (SVCXPRT *__xprt) __THROW;
+
+extern void svcerr_noproc (SVCXPRT *__xprt) __THROW;
+
+extern void svcerr_progvers (SVCXPRT *__xprt, rpcvers_t __low_vers,
+ rpcvers_t __high_vers) __THROW;
+
+extern void svcerr_auth (SVCXPRT *__xprt, enum auth_stat __why) __THROW;
+
+extern void svcerr_noprog (SVCXPRT *__xprt) __THROW;
+
+extern void svcerr_systemerr (SVCXPRT *__xprt) __THROW;
+
+/*
+ * Lowest level dispatching -OR- who owns this process anyway.
+ * Somebody has to wait for incoming requests and then call the correct
+ * service routine. The routine svc_run does infinite waiting; i.e.,
+ * svc_run never returns.
+ * Since another (coexistent) package may wish to selectively wait for
+ * incoming calls or other events outside of the rpc architecture, the
+ * routine svc_getreq is provided. It must be passed readfds, the
+ * "in-place" results of a select system call (see select, section 2).
+ */
+
+/*
+ * Global keeper of rpc service descriptors in use
+ * dynamic; must be inspected before each call to select
+ */
+
+extern struct pollfd *svc_pollfd;
+extern int svc_max_pollfd;
+extern fd_set svc_fdset;
+#define svc_fds svc_fdset.fds_bits[0] /* compatibility */
+
+/*
+ * a small program implemented by the svc_rpc implementation itself;
+ * also see clnt.h for protocol numbers.
+ */
+extern void svc_getreq (int __rdfds) __THROW;
+extern void svc_getreq_common (const int __fd) __THROW;
+extern void svc_getreqset (fd_set *__readfds) __THROW;
+extern void svc_getreq_poll (struct pollfd *, const int) __THROW;
+extern void svc_exit (void) __THROW;
+extern void svc_run (void) __THROW;
+
+/*
+ * Socket to use on svcxxx_create call to get default socket
+ */
+#define RPC_ANYSOCK -1
+
+/*
+ * These are the existing service side transport implementations
+ */
+
+/*
+ * Memory based rpc for testing and timing.
+ */
+extern SVCXPRT *svcraw_create (void) __THROW;
+
+/*
+ * Udp based rpc.
+ */
+extern SVCXPRT *svcudp_create (int __sock) __THROW;
+extern SVCXPRT *svcudp_bufcreate (int __sock, u_int __sendsz, u_int __recvsz)
+ __THROW;
+
+/*
+ * Tcp based rpc.
+ */
+extern SVCXPRT *svctcp_create (int __sock, u_int __sendsize, u_int __recvsize)
+ __THROW;
+
+
+/*
+ * Unix based rpc.
+ */
+extern SVCXPRT *svcunix_create (int __sock, u_int __sendsize, u_int __recvsize,
+ char *__path) __THROW;
+
+
+__END_DECLS
+
+#endif /* rpc/svc.h */
diff --git a/sysroot/usr/include/rpc/svc_auth.h b/sysroot/usr/include/rpc/svc_auth.h
new file mode 100644
index 0000000..1c1a715
--- /dev/null
+++ b/sysroot/usr/include/rpc/svc_auth.h
@@ -0,0 +1,54 @@
+/* @(#)svc_auth.h 2.1 88/07/29 4.0 RPCSRC */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+/* @(#)svc_auth.h 1.6 86/07/16 SMI */
+
+/*
+ * svc_auth.h, Service side of rpc authentication.
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ */
+
+#ifndef _RPC_SVC_AUTH_H
+#define _RPC_SVC_AUTH_H 1
+
+#include <features.h>
+#include <rpc/svc.h>
+
+__BEGIN_DECLS
+
+/*
+ * Server side authenticator
+ */
+extern enum auth_stat _authenticate (struct svc_req *__rqst,
+ struct rpc_msg *__msg) __THROW;
+
+__END_DECLS
+
+#endif /* rpc/svc_auth.h */
diff --git a/sysroot/usr/include/rpc/types.h b/sysroot/usr/include/rpc/types.h
new file mode 100644
index 0000000..871f3fd
--- /dev/null
+++ b/sysroot/usr/include/rpc/types.h
@@ -0,0 +1,99 @@
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+/* fixincludes should not add extern "C" to this file */
+/*
+ * Rpc additions to <sys/types.h>
+ */
+#ifndef _RPC_TYPES_H
+#define _RPC_TYPES_H 1
+
+typedef int bool_t;
+typedef int enum_t;
+/* This needs to be changed to uint32_t in the future */
+typedef unsigned long rpcprog_t;
+typedef unsigned long rpcvers_t;
+typedef unsigned long rpcproc_t;
+typedef unsigned long rpcprot_t;
+typedef unsigned long rpcport_t;
+
+#define __dontcare__ -1
+
+#ifndef FALSE
+# define FALSE (0)
+#endif
+
+#ifndef TRUE
+# define TRUE (1)
+#endif
+
+#ifndef NULL
+# define NULL 0
+#endif
+
+#include <stdlib.h> /* For malloc decl. */
+#define mem_alloc(bsize) malloc(bsize)
+/*
+ * XXX: This must not use the second argument, or code in xdr_array.c needs
+ * to be modified.
+ */
+#define mem_free(ptr, bsize) free(ptr)
+
+#ifndef makedev /* ie, we haven't already included it */
+#include <sys/types.h>
+#endif
+
+#ifndef __u_char_defined
+typedef __u_char u_char;
+typedef __u_short u_short;
+typedef __u_int u_int;
+typedef __u_long u_long;
+typedef __quad_t quad_t;
+typedef __u_quad_t u_quad_t;
+typedef __fsid_t fsid_t;
+# define __u_char_defined
+#endif
+#ifndef __daddr_t_defined
+typedef __daddr_t daddr_t;
+typedef __caddr_t caddr_t;
+# define __daddr_t_defined
+#endif
+
+#include <sys/time.h>
+#include <sys/param.h>
+
+#include <netinet/in.h>
+
+#ifndef INADDR_LOOPBACK
+#define INADDR_LOOPBACK (u_long)0x7F000001
+#endif
+#ifndef MAXHOSTNAMELEN
+#define MAXHOSTNAMELEN 64
+#endif
+
+#endif /* rpc/types.h */
diff --git a/sysroot/usr/include/rpc/xdr.h b/sysroot/usr/include/rpc/xdr.h
new file mode 100644
index 0000000..ba9691d
--- /dev/null
+++ b/sysroot/usr/include/rpc/xdr.h
@@ -0,0 +1,379 @@
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+
+/*
+ * xdr.h, External Data Representation Serialization Routines.
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ */
+
+#ifndef _RPC_XDR_H
+#define _RPC_XDR_H 1
+
+#include <features.h>
+#include <sys/types.h>
+#include <rpc/types.h>
+
+/* We need FILE. */
+#include <stdio.h>
+
+__BEGIN_DECLS
+
+/*
+ * XDR provides a conventional way for converting between C data
+ * types and an external bit-string representation. Library supplied
+ * routines provide for the conversion on built-in C data types. These
+ * routines and utility routines defined here are used to help implement
+ * a type encode/decode routine for each user-defined type.
+ *
+ * Each data type provides a single procedure which takes two arguments:
+ *
+ * bool_t
+ * xdrproc(xdrs, argresp)
+ * XDR *xdrs;
+ * <type> *argresp;
+ *
+ * xdrs is an instance of a XDR handle, to which or from which the data
+ * type is to be converted. argresp is a pointer to the structure to be
+ * converted. The XDR handle contains an operation field which indicates
+ * which of the operations (ENCODE, DECODE * or FREE) is to be performed.
+ *
+ * XDR_DECODE may allocate space if the pointer argresp is null. This
+ * data can be freed with the XDR_FREE operation.
+ *
+ * We write only one procedure per data type to make it easy
+ * to keep the encode and decode procedures for a data type consistent.
+ * In many cases the same code performs all operations on a user defined type,
+ * because all the hard work is done in the component type routines.
+ * decode as a series of calls on the nested data types.
+ */
+
+/*
+ * Xdr operations. XDR_ENCODE causes the type to be encoded into the
+ * stream. XDR_DECODE causes the type to be extracted from the stream.
+ * XDR_FREE can be used to release the space allocated by an XDR_DECODE
+ * request.
+ */
+enum xdr_op {
+ XDR_ENCODE = 0,
+ XDR_DECODE = 1,
+ XDR_FREE = 2
+};
+
+/*
+ * This is the number of bytes per unit of external data.
+ */
+#define BYTES_PER_XDR_UNIT (4)
+/*
+ * This only works if the above is a power of 2. But it's defined to be
+ * 4 by the appropriate RFCs. So it will work. And it's normally quicker
+ * than the old routine.
+ */
+#if 1
+#define RNDUP(x) (((x) + BYTES_PER_XDR_UNIT - 1) & ~(BYTES_PER_XDR_UNIT - 1))
+#else /* this is the old routine */
+#define RNDUP(x) ((((x) + BYTES_PER_XDR_UNIT - 1) / BYTES_PER_XDR_UNIT) \
+ * BYTES_PER_XDR_UNIT)
+#endif
+
+/*
+ * The XDR handle.
+ * Contains operation which is being applied to the stream,
+ * an operations vector for the particular implementation (e.g. see xdr_mem.c),
+ * and two private fields for the use of the particular implementation.
+ */
+typedef struct XDR XDR;
+struct XDR
+ {
+ enum xdr_op x_op; /* operation; fast additional param */
+ struct xdr_ops
+ {
+ bool_t (*x_getlong) (XDR *__xdrs, long *__lp);
+ /* get a long from underlying stream */
+ bool_t (*x_putlong) (XDR *__xdrs, __const long *__lp);
+ /* put a long to " */
+ bool_t (*x_getbytes) (XDR *__xdrs, caddr_t __addr, u_int __len);
+ /* get some bytes from " */
+ bool_t (*x_putbytes) (XDR *__xdrs, __const char *__addr, u_int __len);
+ /* put some bytes to " */
+ u_int (*x_getpostn) (__const XDR *__xdrs);
+ /* returns bytes off from beginning */
+ bool_t (*x_setpostn) (XDR *__xdrs, u_int __pos);
+ /* lets you reposition the stream */
+ int32_t *(*x_inline) (XDR *__xdrs, u_int __len);
+ /* buf quick ptr to buffered data */
+ void (*x_destroy) (XDR *__xdrs);
+ /* free privates of this xdr_stream */
+ bool_t (*x_getint32) (XDR *__xdrs, int32_t *__ip);
+ /* get a int from underlying stream */
+ bool_t (*x_putint32) (XDR *__xdrs, __const int32_t *__ip);
+ /* put a int to " */
+ }
+ *x_ops;
+ caddr_t x_public; /* users' data */
+ caddr_t x_private; /* pointer to private data */
+ caddr_t x_base; /* private used for position info */
+ u_int x_handy; /* extra private word */
+ };
+
+/*
+ * A xdrproc_t exists for each data type which is to be encoded or decoded.
+ *
+ * The second argument to the xdrproc_t is a pointer to an opaque pointer.
+ * The opaque pointer generally points to a structure of the data type
+ * to be decoded. If this pointer is 0, then the type routines should
+ * allocate dynamic storage of the appropriate size and return it.
+ * bool_t (*xdrproc_t)(XDR *, caddr_t *);
+ */
+typedef bool_t (*xdrproc_t) (XDR *, void *,...);
+
+
+/*
+ * Operations defined on a XDR handle
+ *
+ * XDR *xdrs;
+ * int32_t *int32p;
+ * long *longp;
+ * caddr_t addr;
+ * u_int len;
+ * u_int pos;
+ */
+#define XDR_GETINT32(xdrs, int32p) \
+ (*(xdrs)->x_ops->x_getint32)(xdrs, int32p)
+#define xdr_getint32(xdrs, int32p) \
+ (*(xdrs)->x_ops->x_getint32)(xdrs, int32p)
+
+#define XDR_PUTINT32(xdrs, int32p) \
+ (*(xdrs)->x_ops->x_putint32)(xdrs, int32p)
+#define xdr_putint32(xdrs, int32p) \
+ (*(xdrs)->x_ops->x_putint32)(xdrs, int32p)
+
+#define XDR_GETLONG(xdrs, longp) \
+ (*(xdrs)->x_ops->x_getlong)(xdrs, longp)
+#define xdr_getlong(xdrs, longp) \
+ (*(xdrs)->x_ops->x_getlong)(xdrs, longp)
+
+#define XDR_PUTLONG(xdrs, longp) \
+ (*(xdrs)->x_ops->x_putlong)(xdrs, longp)
+#define xdr_putlong(xdrs, longp) \
+ (*(xdrs)->x_ops->x_putlong)(xdrs, longp)
+
+#define XDR_GETBYTES(xdrs, addr, len) \
+ (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len)
+#define xdr_getbytes(xdrs, addr, len) \
+ (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len)
+
+#define XDR_PUTBYTES(xdrs, addr, len) \
+ (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len)
+#define xdr_putbytes(xdrs, addr, len) \
+ (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len)
+
+#define XDR_GETPOS(xdrs) \
+ (*(xdrs)->x_ops->x_getpostn)(xdrs)
+#define xdr_getpos(xdrs) \
+ (*(xdrs)->x_ops->x_getpostn)(xdrs)
+
+#define XDR_SETPOS(xdrs, pos) \
+ (*(xdrs)->x_ops->x_setpostn)(xdrs, pos)
+#define xdr_setpos(xdrs, pos) \
+ (*(xdrs)->x_ops->x_setpostn)(xdrs, pos)
+
+#define XDR_INLINE(xdrs, len) \
+ (*(xdrs)->x_ops->x_inline)(xdrs, len)
+#define xdr_inline(xdrs, len) \
+ (*(xdrs)->x_ops->x_inline)(xdrs, len)
+
+#define XDR_DESTROY(xdrs) \
+ do { \
+ if ((xdrs)->x_ops->x_destroy) \
+ (*(xdrs)->x_ops->x_destroy)(xdrs); \
+ } while (0)
+#define xdr_destroy(xdrs) \
+ do { \
+ if ((xdrs)->x_ops->x_destroy) \
+ (*(xdrs)->x_ops->x_destroy)(xdrs); \
+ } while (0)
+
+/*
+ * Support struct for discriminated unions.
+ * You create an array of xdrdiscrim structures, terminated with
+ * a entry with a null procedure pointer. The xdr_union routine gets
+ * the discriminant value and then searches the array of structures
+ * for a matching value. If a match is found the associated xdr routine
+ * is called to handle that part of the union. If there is
+ * no match, then a default routine may be called.
+ * If there is no match and no default routine it is an error.
+ */
+#define NULL_xdrproc_t ((xdrproc_t)0)
+struct xdr_discrim
+{
+ int value;
+ xdrproc_t proc;
+};
+
+/*
+ * Inline routines for fast encode/decode of primitive data types.
+ * Caveat emptor: these use single memory cycles to get the
+ * data from the underlying buffer, and will fail to operate
+ * properly if the data is not aligned. The standard way to use these
+ * is to say:
+ * if ((buf = XDR_INLINE(xdrs, count)) == NULL)
+ * return (FALSE);
+ * <<< macro calls >>>
+ * where ``count'' is the number of bytes of data occupied
+ * by the primitive data types.
+ *
+ * N.B. and frozen for all time: each data type here uses 4 bytes
+ * of external representation.
+ */
+
+#define IXDR_GET_INT32(buf) ((int32_t)ntohl((uint32_t)*(buf)++))
+#define IXDR_PUT_INT32(buf, v) (*(buf)++ = (int32_t)htonl((uint32_t)(v)))
+#define IXDR_GET_U_INT32(buf) ((uint32_t)IXDR_GET_INT32(buf))
+#define IXDR_PUT_U_INT32(buf, v) IXDR_PUT_INT32(buf, (int32_t)(v))
+
+/* WARNING: The IXDR_*_LONG defines are removed by Sun for new platforms
+ * and shouldn't be used any longer. Code which use this defines or longs
+ * in the RPC code will not work on 64bit Solaris platforms !
+ */
+#define IXDR_GET_LONG(buf) ((long)IXDR_GET_U_INT32(buf))
+#define IXDR_PUT_LONG(buf, v) ((long)IXDR_PUT_INT32(buf, (long)(v)))
+#define IXDR_GET_U_LONG(buf) ((u_long)IXDR_GET_LONG(buf))
+#define IXDR_PUT_U_LONG(buf, v) IXDR_PUT_LONG(buf, (long)(v))
+
+
+#define IXDR_GET_BOOL(buf) ((bool_t)IXDR_GET_LONG(buf))
+#define IXDR_GET_ENUM(buf, t) ((t)IXDR_GET_LONG(buf))
+#define IXDR_GET_SHORT(buf) ((short)IXDR_GET_LONG(buf))
+#define IXDR_GET_U_SHORT(buf) ((u_short)IXDR_GET_LONG(buf))
+
+#define IXDR_PUT_BOOL(buf, v) IXDR_PUT_LONG(buf, (long)(v))
+#define IXDR_PUT_ENUM(buf, v) IXDR_PUT_LONG(buf, (long)(v))
+#define IXDR_PUT_SHORT(buf, v) IXDR_PUT_LONG(buf, (long)(v))
+#define IXDR_PUT_U_SHORT(buf, v) IXDR_PUT_LONG(buf, (long)(v))
+
+/*
+ * These are the "generic" xdr routines.
+ * None of these can have const applied because it's not possible to
+ * know whether the call is a read or a write to the passed parameter
+ * also, the XDR structure is always updated by some of these calls.
+ */
+extern bool_t xdr_void (void) __THROW;
+extern bool_t xdr_short (XDR *__xdrs, short *__sp) __THROW;
+extern bool_t xdr_u_short (XDR *__xdrs, u_short *__usp) __THROW;
+extern bool_t xdr_int (XDR *__xdrs, int *__ip) __THROW;
+extern bool_t xdr_u_int (XDR *__xdrs, u_int *__up) __THROW;
+extern bool_t xdr_long (XDR *__xdrs, long *__lp) __THROW;
+extern bool_t xdr_u_long (XDR *__xdrs, u_long *__ulp) __THROW;
+extern bool_t xdr_hyper (XDR *__xdrs, quad_t *__llp) __THROW;
+extern bool_t xdr_u_hyper (XDR *__xdrs, u_quad_t *__ullp) __THROW;
+extern bool_t xdr_longlong_t (XDR *__xdrs, quad_t *__llp) __THROW;
+extern bool_t xdr_u_longlong_t (XDR *__xdrs, u_quad_t *__ullp) __THROW;
+extern bool_t xdr_int8_t (XDR *__xdrs, int8_t *__ip) __THROW;
+extern bool_t xdr_uint8_t (XDR *__xdrs, uint8_t *__up) __THROW;
+extern bool_t xdr_int16_t (XDR *__xdrs, int16_t *__ip) __THROW;
+extern bool_t xdr_uint16_t (XDR *__xdrs, uint16_t *__up) __THROW;
+extern bool_t xdr_int32_t (XDR *__xdrs, int32_t *__ip) __THROW;
+extern bool_t xdr_uint32_t (XDR *__xdrs, uint32_t *__up) __THROW;
+extern bool_t xdr_int64_t (XDR *__xdrs, int64_t *__ip) __THROW;
+extern bool_t xdr_uint64_t (XDR *__xdrs, uint64_t *__up) __THROW;
+extern bool_t xdr_quad_t (XDR *__xdrs, quad_t *__ip) __THROW;
+extern bool_t xdr_u_quad_t (XDR *__xdrs, u_quad_t *__up) __THROW;
+extern bool_t xdr_bool (XDR *__xdrs, bool_t *__bp) __THROW;
+extern bool_t xdr_enum (XDR *__xdrs, enum_t *__ep) __THROW;
+extern bool_t xdr_array (XDR * _xdrs, caddr_t *__addrp, u_int *__sizep,
+ u_int __maxsize, u_int __elsize, xdrproc_t __elproc)
+ __THROW;
+extern bool_t xdr_bytes (XDR *__xdrs, char **__cpp, u_int *__sizep,
+ u_int __maxsize) __THROW;
+extern bool_t xdr_opaque (XDR *__xdrs, caddr_t __cp, u_int __cnt) __THROW;
+extern bool_t xdr_string (XDR *__xdrs, char **__cpp, u_int __maxsize) __THROW;
+extern bool_t xdr_union (XDR *__xdrs, enum_t *__dscmp, char *__unp,
+ __const struct xdr_discrim *__choices,
+ xdrproc_t dfault) __THROW;
+extern bool_t xdr_char (XDR *__xdrs, char *__cp) __THROW;
+extern bool_t xdr_u_char (XDR *__xdrs, u_char *__cp) __THROW;
+extern bool_t xdr_vector (XDR *__xdrs, char *__basep, u_int __nelem,
+ u_int __elemsize, xdrproc_t __xdr_elem) __THROW;
+extern bool_t xdr_float (XDR *__xdrs, float *__fp) __THROW;
+extern bool_t xdr_double (XDR *__xdrs, double *__dp) __THROW;
+extern bool_t xdr_reference (XDR *__xdrs, caddr_t *__xpp, u_int __size,
+ xdrproc_t __proc) __THROW;
+extern bool_t xdr_pointer (XDR *__xdrs, char **__objpp,
+ u_int __obj_size, xdrproc_t __xdr_obj) __THROW;
+extern bool_t xdr_wrapstring (XDR *__xdrs, char **__cpp) __THROW;
+extern u_long xdr_sizeof (xdrproc_t, void *) __THROW;
+
+/*
+ * Common opaque bytes objects used by many rpc protocols;
+ * declared here due to commonality.
+ */
+#define MAX_NETOBJ_SZ 1024
+struct netobj
+{
+ u_int n_len;
+ char *n_bytes;
+};
+typedef struct netobj netobj;
+extern bool_t xdr_netobj (XDR *__xdrs, struct netobj *__np) __THROW;
+
+/*
+ * These are the public routines for the various implementations of
+ * xdr streams.
+ */
+
+/* XDR using memory buffers */
+extern void xdrmem_create (XDR *__xdrs, __const caddr_t __addr,
+ u_int __size, enum xdr_op __xop) __THROW;
+
+/* XDR using stdio library */
+extern void xdrstdio_create (XDR *__xdrs, FILE *__file, enum xdr_op __xop)
+ __THROW;
+
+/* XDR pseudo records for tcp */
+extern void xdrrec_create (XDR *__xdrs, u_int __sendsize,
+ u_int __recvsize, caddr_t __tcp_handle,
+ int (*__readit) (char *, char *, int),
+ int (*__writeit) (char *, char *, int)) __THROW;
+
+/* make end of xdr record */
+extern bool_t xdrrec_endofrecord (XDR *__xdrs, bool_t __sendnow) __THROW;
+
+/* move to beginning of next record */
+extern bool_t xdrrec_skiprecord (XDR *__xdrs) __THROW;
+
+/* true if no more input */
+extern bool_t xdrrec_eof (XDR *__xdrs) __THROW;
+
+/* free memory buffers for xdr */
+extern void xdr_free (xdrproc_t __proc, char *__objp) __THROW;
+
+__END_DECLS
+
+#endif /* rpc/xdr.h */
diff --git a/sysroot/usr/include/rpcsvc/bootparam.h b/sysroot/usr/include/rpcsvc/bootparam.h
new file mode 100644
index 0000000..b30fa8d
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/bootparam.h
@@ -0,0 +1,25 @@
+/* Copyright (C) 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _RPCSVC_BOOTPARAM_H
+#define _RPCSVC_BOOTPARAM_H
+
+#include <rpcsvc/bootparam_prot.h>
+
+#endif /* _RPCSVC_BOOTPARAM_H */
+
diff --git a/sysroot/usr/include/rpcsvc/bootparam_prot.h b/sysroot/usr/include/rpcsvc/bootparam_prot.h
new file mode 100644
index 0000000..fbed446
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/bootparam_prot.h
@@ -0,0 +1,124 @@
+/*
+ * Please do not edit this file.
+ * It was generated using rpcgen.
+ */
+
+#ifndef _BOOTPARAM_PROT_H_RPCGEN
+#define _BOOTPARAM_PROT_H_RPCGEN
+
+#include <rpc/rpc.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <rpc/types.h>
+#include <sys/time.h>
+#include <sys/errno.h>
+#include <nfs/nfs.h>
+#define MAX_MACHINE_NAME 255
+#define MAX_PATH_LEN 1024
+#define MAX_FILEID 32
+#define IP_ADDR_TYPE 1
+
+typedef char *bp_machine_name_t;
+
+typedef char *bp_path_t;
+
+typedef char *bp_fileid_t;
+
+struct ip_addr_t {
+ char net;
+ char host;
+ char lh;
+ char impno;
+};
+typedef struct ip_addr_t ip_addr_t;
+
+struct bp_address {
+ int address_type;
+ union {
+ ip_addr_t ip_addr;
+ } bp_address_u;
+};
+typedef struct bp_address bp_address;
+
+struct bp_whoami_arg {
+ bp_address client_address;
+};
+typedef struct bp_whoami_arg bp_whoami_arg;
+
+struct bp_whoami_res {
+ bp_machine_name_t client_name;
+ bp_machine_name_t domain_name;
+ bp_address router_address;
+};
+typedef struct bp_whoami_res bp_whoami_res;
+
+struct bp_getfile_arg {
+ bp_machine_name_t client_name;
+ bp_fileid_t file_id;
+};
+typedef struct bp_getfile_arg bp_getfile_arg;
+
+struct bp_getfile_res {
+ bp_machine_name_t server_name;
+ bp_address server_address;
+ bp_path_t server_path;
+};
+typedef struct bp_getfile_res bp_getfile_res;
+
+#define BOOTPARAMPROG 100026
+#define BOOTPARAMVERS 1
+
+#if defined(__STDC__) || defined(__cplusplus)
+#define BOOTPARAMPROC_WHOAMI 1
+extern bp_whoami_res * bootparamproc_whoami_1(bp_whoami_arg *, CLIENT *);
+extern bp_whoami_res * bootparamproc_whoami_1_svc(bp_whoami_arg *, struct svc_req *);
+#define BOOTPARAMPROC_GETFILE 2
+extern bp_getfile_res * bootparamproc_getfile_1(bp_getfile_arg *, CLIENT *);
+extern bp_getfile_res * bootparamproc_getfile_1_svc(bp_getfile_arg *, struct svc_req *);
+extern int bootparamprog_1_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
+
+#else /* K&R C */
+#define BOOTPARAMPROC_WHOAMI 1
+extern bp_whoami_res * bootparamproc_whoami_1();
+extern bp_whoami_res * bootparamproc_whoami_1_svc();
+#define BOOTPARAMPROC_GETFILE 2
+extern bp_getfile_res * bootparamproc_getfile_1();
+extern bp_getfile_res * bootparamproc_getfile_1_svc();
+extern int bootparamprog_1_freeresult ();
+#endif /* K&R C */
+
+/* the xdr functions */
+
+#if defined(__STDC__) || defined(__cplusplus)
+extern bool_t xdr_bp_machine_name_t (XDR *, bp_machine_name_t*);
+extern bool_t xdr_bp_path_t (XDR *, bp_path_t*);
+extern bool_t xdr_bp_fileid_t (XDR *, bp_fileid_t*);
+extern bool_t xdr_ip_addr_t (XDR *, ip_addr_t*);
+extern bool_t xdr_bp_address (XDR *, bp_address*);
+extern bool_t xdr_bp_whoami_arg (XDR *, bp_whoami_arg*);
+extern bool_t xdr_bp_whoami_res (XDR *, bp_whoami_res*);
+extern bool_t xdr_bp_getfile_arg (XDR *, bp_getfile_arg*);
+extern bool_t xdr_bp_getfile_res (XDR *, bp_getfile_res*);
+
+#else /* K&R C */
+extern bool_t xdr_bp_machine_name_t ();
+extern bool_t xdr_bp_path_t ();
+extern bool_t xdr_bp_fileid_t ();
+extern bool_t xdr_ip_addr_t ();
+extern bool_t xdr_bp_address ();
+extern bool_t xdr_bp_whoami_arg ();
+extern bool_t xdr_bp_whoami_res ();
+extern bool_t xdr_bp_getfile_arg ();
+extern bool_t xdr_bp_getfile_res ();
+
+#endif /* K&R C */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !_BOOTPARAM_PROT_H_RPCGEN */
diff --git a/sysroot/usr/include/rpcsvc/bootparam_prot.x b/sysroot/usr/include/rpcsvc/bootparam_prot.x
new file mode 100644
index 0000000..65bc0dc
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/bootparam_prot.x
@@ -0,0 +1,97 @@
+/* @(#)bootparam_prot.x 2.1 88/08/01 4.0 RPCSRC */
+/* @(#)bootparam_prot.x 1.2 87/06/24 Copyr 1987 Sun Micro */
+
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+
+/*
+ * RPC for bootparms service.
+ * There are two procedures:
+ * WHOAMI takes a net address and returns a client name and also a
+ * likely net address for routing
+ * GETFILE takes a client name and file identifier and returns the
+ * server name, server net address and pathname for the file.
+ * file identifiers typically include root, swap, pub and dump
+ */
+
+#ifdef RPC_HDR
+%#include <rpc/types.h>
+%#include <sys/time.h>
+%#include <sys/errno.h>
+%#include <nfs/nfs.h>
+#endif
+
+const MAX_MACHINE_NAME = 255;
+const MAX_PATH_LEN = 1024;
+const MAX_FILEID = 32;
+const IP_ADDR_TYPE = 1;
+
+typedef string bp_machine_name_t<MAX_MACHINE_NAME>;
+typedef string bp_path_t<MAX_PATH_LEN>;
+typedef string bp_fileid_t<MAX_FILEID>;
+
+struct ip_addr_t {
+ char net;
+ char host;
+ char lh;
+ char impno;
+};
+
+union bp_address switch (int address_type) {
+ case IP_ADDR_TYPE:
+ ip_addr_t ip_addr;
+};
+
+struct bp_whoami_arg {
+ bp_address client_address;
+};
+
+struct bp_whoami_res {
+ bp_machine_name_t client_name;
+ bp_machine_name_t domain_name;
+ bp_address router_address;
+};
+
+struct bp_getfile_arg {
+ bp_machine_name_t client_name;
+ bp_fileid_t file_id;
+};
+
+struct bp_getfile_res {
+ bp_machine_name_t server_name;
+ bp_address server_address;
+ bp_path_t server_path;
+};
+
+program BOOTPARAMPROG {
+ version BOOTPARAMVERS {
+ bp_whoami_res BOOTPARAMPROC_WHOAMI(bp_whoami_arg) = 1;
+ bp_getfile_res BOOTPARAMPROC_GETFILE(bp_getfile_arg) = 2;
+ } = 1;
+} = 100026;
diff --git a/sysroot/usr/include/rpcsvc/key_prot.h b/sysroot/usr/include/rpcsvc/key_prot.h
new file mode 100644
index 0000000..66b3c7e
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/key_prot.h
@@ -0,0 +1,264 @@
+/*
+ * Please do not edit this file.
+ * It was generated using rpcgen.
+ */
+
+#ifndef _KEY_PROT_H_RPCGEN
+#define _KEY_PROT_H_RPCGEN
+
+#include <rpc/rpc.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+#if 0
+#pragma ident "@(#)key_prot.x 1.7 94/04/29 SMI"
+#endif
+
+/* Copyright (c) 1990, 1991 Sun Microsystems, Inc. */
+
+/*
+ * Compiled from key_prot.x using rpcgen.
+ * DO NOT EDIT THIS FILE!
+ * This is NOT source code!
+ */
+#define PROOT 3
+#define HEXMODULUS "d4a0ba0250b6fd2ec626e7efd637df76c716e22d0944b88b"
+#define HEXKEYBYTES 48
+#define KEYSIZE 192
+#define KEYBYTES 24
+#define KEYCHECKSUMSIZE 16
+
+enum keystatus {
+ KEY_SUCCESS = 0,
+ KEY_NOSECRET = 1,
+ KEY_UNKNOWN = 2,
+ KEY_SYSTEMERR = 3,
+};
+typedef enum keystatus keystatus;
+
+typedef char keybuf[HEXKEYBYTES];
+
+typedef char *netnamestr;
+
+struct cryptkeyarg {
+ netnamestr remotename;
+ des_block deskey;
+};
+typedef struct cryptkeyarg cryptkeyarg;
+
+struct cryptkeyarg2 {
+ netnamestr remotename;
+ netobj remotekey;
+ des_block deskey;
+};
+typedef struct cryptkeyarg2 cryptkeyarg2;
+
+struct cryptkeyres {
+ keystatus status;
+ union {
+ des_block deskey;
+ } cryptkeyres_u;
+};
+typedef struct cryptkeyres cryptkeyres;
+#define MAXGIDS 16
+
+struct unixcred {
+ u_int uid;
+ u_int gid;
+ struct {
+ u_int gids_len;
+ u_int *gids_val;
+ } gids;
+};
+typedef struct unixcred unixcred;
+
+struct getcredres {
+ keystatus status;
+ union {
+ unixcred cred;
+ } getcredres_u;
+};
+typedef struct getcredres getcredres;
+
+struct key_netstarg {
+ keybuf st_priv_key;
+ keybuf st_pub_key;
+ netnamestr st_netname;
+};
+typedef struct key_netstarg key_netstarg;
+
+struct key_netstres {
+ keystatus status;
+ union {
+ key_netstarg knet;
+ } key_netstres_u;
+};
+typedef struct key_netstres key_netstres;
+
+#ifndef opaque
+#define opaque char
+#endif
+
+
+#define KEY_PROG 100029
+#define KEY_VERS 1
+
+#if defined(__STDC__) || defined(__cplusplus)
+#define KEY_SET 1
+extern keystatus * key_set_1(char *, CLIENT *);
+extern keystatus * key_set_1_svc(char *, struct svc_req *);
+#define KEY_ENCRYPT 2
+extern cryptkeyres * key_encrypt_1(cryptkeyarg *, CLIENT *);
+extern cryptkeyres * key_encrypt_1_svc(cryptkeyarg *, struct svc_req *);
+#define KEY_DECRYPT 3
+extern cryptkeyres * key_decrypt_1(cryptkeyarg *, CLIENT *);
+extern cryptkeyres * key_decrypt_1_svc(cryptkeyarg *, struct svc_req *);
+#define KEY_GEN 4
+extern des_block * key_gen_1(void *, CLIENT *);
+extern des_block * key_gen_1_svc(void *, struct svc_req *);
+#define KEY_GETCRED 5
+extern getcredres * key_getcred_1(netnamestr *, CLIENT *);
+extern getcredres * key_getcred_1_svc(netnamestr *, struct svc_req *);
+extern int key_prog_1_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
+
+#else /* K&R C */
+#define KEY_SET 1
+extern keystatus * key_set_1();
+extern keystatus * key_set_1_svc();
+#define KEY_ENCRYPT 2
+extern cryptkeyres * key_encrypt_1();
+extern cryptkeyres * key_encrypt_1_svc();
+#define KEY_DECRYPT 3
+extern cryptkeyres * key_decrypt_1();
+extern cryptkeyres * key_decrypt_1_svc();
+#define KEY_GEN 4
+extern des_block * key_gen_1();
+extern des_block * key_gen_1_svc();
+#define KEY_GETCRED 5
+extern getcredres * key_getcred_1();
+extern getcredres * key_getcred_1_svc();
+extern int key_prog_1_freeresult ();
+#endif /* K&R C */
+#define KEY_VERS2 2
+
+#if defined(__STDC__) || defined(__cplusplus)
+extern keystatus * key_set_2(char *, CLIENT *);
+extern keystatus * key_set_2_svc(char *, struct svc_req *);
+extern cryptkeyres * key_encrypt_2(cryptkeyarg *, CLIENT *);
+extern cryptkeyres * key_encrypt_2_svc(cryptkeyarg *, struct svc_req *);
+extern cryptkeyres * key_decrypt_2(cryptkeyarg *, CLIENT *);
+extern cryptkeyres * key_decrypt_2_svc(cryptkeyarg *, struct svc_req *);
+extern des_block * key_gen_2(void *, CLIENT *);
+extern des_block * key_gen_2_svc(void *, struct svc_req *);
+extern getcredres * key_getcred_2(netnamestr *, CLIENT *);
+extern getcredres * key_getcred_2_svc(netnamestr *, struct svc_req *);
+#define KEY_ENCRYPT_PK 6
+extern cryptkeyres * key_encrypt_pk_2(cryptkeyarg2 *, CLIENT *);
+extern cryptkeyres * key_encrypt_pk_2_svc(cryptkeyarg2 *, struct svc_req *);
+#define KEY_DECRYPT_PK 7
+extern cryptkeyres * key_decrypt_pk_2(cryptkeyarg2 *, CLIENT *);
+extern cryptkeyres * key_decrypt_pk_2_svc(cryptkeyarg2 *, struct svc_req *);
+#define KEY_NET_PUT 8
+extern keystatus * key_net_put_2(key_netstarg *, CLIENT *);
+extern keystatus * key_net_put_2_svc(key_netstarg *, struct svc_req *);
+#define KEY_NET_GET 9
+extern key_netstres * key_net_get_2(void *, CLIENT *);
+extern key_netstres * key_net_get_2_svc(void *, struct svc_req *);
+#define KEY_GET_CONV 10
+extern cryptkeyres * key_get_conv_2(char *, CLIENT *);
+extern cryptkeyres * key_get_conv_2_svc(char *, struct svc_req *);
+extern int key_prog_2_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
+
+#else /* K&R C */
+extern keystatus * key_set_2();
+extern keystatus * key_set_2_svc();
+extern cryptkeyres * key_encrypt_2();
+extern cryptkeyres * key_encrypt_2_svc();
+extern cryptkeyres * key_decrypt_2();
+extern cryptkeyres * key_decrypt_2_svc();
+extern des_block * key_gen_2();
+extern des_block * key_gen_2_svc();
+extern getcredres * key_getcred_2();
+extern getcredres * key_getcred_2_svc();
+#define KEY_ENCRYPT_PK 6
+extern cryptkeyres * key_encrypt_pk_2();
+extern cryptkeyres * key_encrypt_pk_2_svc();
+#define KEY_DECRYPT_PK 7
+extern cryptkeyres * key_decrypt_pk_2();
+extern cryptkeyres * key_decrypt_pk_2_svc();
+#define KEY_NET_PUT 8
+extern keystatus * key_net_put_2();
+extern keystatus * key_net_put_2_svc();
+#define KEY_NET_GET 9
+extern key_netstres * key_net_get_2();
+extern key_netstres * key_net_get_2_svc();
+#define KEY_GET_CONV 10
+extern cryptkeyres * key_get_conv_2();
+extern cryptkeyres * key_get_conv_2_svc();
+extern int key_prog_2_freeresult ();
+#endif /* K&R C */
+
+/* the xdr functions */
+
+#if defined(__STDC__) || defined(__cplusplus)
+extern bool_t xdr_keystatus (XDR *, keystatus*);
+extern bool_t xdr_keybuf (XDR *, keybuf);
+extern bool_t xdr_netnamestr (XDR *, netnamestr*);
+extern bool_t xdr_cryptkeyarg (XDR *, cryptkeyarg*);
+extern bool_t xdr_cryptkeyarg2 (XDR *, cryptkeyarg2*);
+extern bool_t xdr_cryptkeyres (XDR *, cryptkeyres*);
+extern bool_t xdr_unixcred (XDR *, unixcred*);
+extern bool_t xdr_getcredres (XDR *, getcredres*);
+extern bool_t xdr_key_netstarg (XDR *, key_netstarg*);
+extern bool_t xdr_key_netstres (XDR *, key_netstres*);
+
+#else /* K&R C */
+extern bool_t xdr_keystatus ();
+extern bool_t xdr_keybuf ();
+extern bool_t xdr_netnamestr ();
+extern bool_t xdr_cryptkeyarg ();
+extern bool_t xdr_cryptkeyarg2 ();
+extern bool_t xdr_cryptkeyres ();
+extern bool_t xdr_unixcred ();
+extern bool_t xdr_getcredres ();
+extern bool_t xdr_key_netstarg ();
+extern bool_t xdr_key_netstres ();
+
+#endif /* K&R C */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !_KEY_PROT_H_RPCGEN */
diff --git a/sysroot/usr/include/rpcsvc/key_prot.x b/sysroot/usr/include/rpcsvc/key_prot.x
new file mode 100644
index 0000000..d9272cb
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/key_prot.x
@@ -0,0 +1,286 @@
+%/*
+% * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+% * unrestricted use provided that this legend is included on all tape
+% * media and as a part of the software program in whole or part. Users
+% * may copy or modify Sun RPC without charge, but are not authorized
+% * to license or distribute it to anyone else except as part of a product or
+% * program developed by the user.
+% *
+% * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+% * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+% * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+% *
+% * Sun RPC is provided with no support and without any obligation on the
+% * part of Sun Microsystems, Inc. to assist in its use, correction,
+% * modification or enhancement.
+% *
+% * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+% * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+% * OR ANY PART THEREOF.
+% *
+% * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+% * or profits or other special, indirect and consequential damages, even if
+% * Sun has been advised of the possibility of such damages.
+% *
+% * Sun Microsystems, Inc.
+% * 2550 Garcia Avenue
+% * Mountain View, California 94043
+% */
+/*
+ * Key server protocol definition
+ * Copyright (C) 1990, 1991 Sun Microsystems, Inc.
+ *
+ * The keyserver is a public key storage/encryption/decryption service
+ * The encryption method used is based on the Diffie-Hellman exponential
+ * key exchange technology.
+ *
+ * The key server is local to each machine, akin to the portmapper.
+ * Under TI-RPC, communication with the keyserver is through the
+ * loopback transport.
+ *
+ * NOTE: This .x file generates the USER level headers for the keyserver.
+ * the KERNEL level headers are created by hand as they kernel has special
+ * requirements.
+ */
+
+%#if 0
+%#pragma ident "@(#)key_prot.x 1.7 94/04/29 SMI"
+%#endif
+%
+%/* Copyright (c) 1990, 1991 Sun Microsystems, Inc. */
+%
+%/*
+% * Compiled from key_prot.x using rpcgen.
+% * DO NOT EDIT THIS FILE!
+% * This is NOT source code!
+% */
+
+/*
+ * PROOT and MODULUS define the way the Diffie-Hellman key is generated.
+ *
+ * MODULUS should be chosen as a prime of the form: MODULUS == 2*p + 1,
+ * where p is also prime.
+ *
+ * PROOT satisfies the following two conditions:
+ * (1) (PROOT ** 2) % MODULUS != 1
+ * (2) (PROOT ** p) % MODULUS != 1
+ *
+ */
+
+const PROOT = 3;
+const HEXMODULUS = "d4a0ba0250b6fd2ec626e7efd637df76c716e22d0944b88b";
+
+const HEXKEYBYTES = 48; /* HEXKEYBYTES == strlen(HEXMODULUS) */
+const KEYSIZE = 192; /* KEYSIZE == bit length of key */
+const KEYBYTES = 24; /* byte length of key */
+
+/*
+ * The first 16 hex digits of the encrypted secret key are used as
+ * a checksum in the database.
+ */
+const KEYCHECKSUMSIZE = 16;
+
+/*
+ * status of operation
+ */
+enum keystatus {
+ KEY_SUCCESS, /* no problems */
+ KEY_NOSECRET, /* no secret key stored */
+ KEY_UNKNOWN, /* unknown netname */
+ KEY_SYSTEMERR /* system error (out of memory, encryption failure) */
+};
+
+typedef opaque keybuf[HEXKEYBYTES]; /* store key in hex */
+
+typedef string netnamestr<MAXNETNAMELEN>;
+
+/*
+ * Argument to ENCRYPT or DECRYPT
+ */
+struct cryptkeyarg {
+ netnamestr remotename;
+ des_block deskey;
+};
+
+/*
+ * Argument to ENCRYPT_PK or DECRYPT_PK
+ */
+struct cryptkeyarg2 {
+ netnamestr remotename;
+ netobj remotekey; /* Contains a length up to 1024 bytes */
+ des_block deskey;
+};
+
+
+/*
+ * Result of ENCRYPT, DECRYPT, ENCRYPT_PK, and DECRYPT_PK
+ */
+union cryptkeyres switch (keystatus status) {
+case KEY_SUCCESS:
+ des_block deskey;
+default:
+ void;
+};
+
+const MAXGIDS = 16; /* max number of gids in gid list */
+
+/*
+ * Unix credential
+ */
+struct unixcred {
+ u_int uid;
+ u_int gid;
+ u_int gids<MAXGIDS>;
+};
+
+/*
+ * Result returned from GETCRED
+ */
+union getcredres switch (keystatus status) {
+case KEY_SUCCESS:
+ unixcred cred;
+default:
+ void;
+};
+/*
+ * key_netstarg;
+ */
+
+struct key_netstarg {
+ keybuf st_priv_key;
+ keybuf st_pub_key;
+ netnamestr st_netname;
+};
+
+union key_netstres switch (keystatus status){
+case KEY_SUCCESS:
+ key_netstarg knet;
+default:
+ void;
+};
+
+#ifdef RPC_HDR
+%
+%#ifndef opaque
+%#define opaque char
+%#endif
+%
+#endif
+program KEY_PROG {
+ version KEY_VERS {
+
+ /*
+ * This is my secret key.
+ * Store it for me.
+ */
+ keystatus
+ KEY_SET(keybuf) = 1;
+
+ /*
+ * I want to talk to X.
+ * Encrypt a conversation key for me.
+ */
+ cryptkeyres
+ KEY_ENCRYPT(cryptkeyarg) = 2;
+
+ /*
+ * X just sent me a message.
+ * Decrypt the conversation key for me.
+ */
+ cryptkeyres
+ KEY_DECRYPT(cryptkeyarg) = 3;
+
+ /*
+ * Generate a secure conversation key for me
+ */
+ des_block
+ KEY_GEN(void) = 4;
+
+ /*
+ * Get me the uid, gid and group-access-list associated
+ * with this netname (for kernel which cannot use NIS)
+ */
+ getcredres
+ KEY_GETCRED(netnamestr) = 5;
+ } = 1;
+ version KEY_VERS2 {
+
+ /*
+ * #######
+ * Procedures 1-5 are identical to version 1
+ * #######
+ */
+
+ /*
+ * This is my secret key.
+ * Store it for me.
+ */
+ keystatus
+ KEY_SET(keybuf) = 1;
+
+ /*
+ * I want to talk to X.
+ * Encrypt a conversation key for me.
+ */
+ cryptkeyres
+ KEY_ENCRYPT(cryptkeyarg) = 2;
+
+ /*
+ * X just sent me a message.
+ * Decrypt the conversation key for me.
+ */
+ cryptkeyres
+ KEY_DECRYPT(cryptkeyarg) = 3;
+
+ /*
+ * Generate a secure conversation key for me
+ */
+ des_block
+ KEY_GEN(void) = 4;
+
+ /*
+ * Get me the uid, gid and group-access-list associated
+ * with this netname (for kernel which cannot use NIS)
+ */
+ getcredres
+ KEY_GETCRED(netnamestr) = 5;
+
+ /*
+ * I want to talk to X. and I know X's public key
+ * Encrypt a conversation key for me.
+ */
+ cryptkeyres
+ KEY_ENCRYPT_PK(cryptkeyarg2) = 6;
+
+ /*
+ * X just sent me a message. and I know X's public key
+ * Decrypt the conversation key for me.
+ */
+ cryptkeyres
+ KEY_DECRYPT_PK(cryptkeyarg2) = 7;
+
+ /*
+ * Store my public key, netname and private key.
+ */
+ keystatus
+ KEY_NET_PUT(key_netstarg) = 8;
+
+ /*
+ * Retrieve my public key, netname and private key.
+ */
+ key_netstres
+ KEY_NET_GET(void) = 9;
+
+ /*
+ * Return me the conversation key that is constructed
+ * from my secret key and this publickey.
+ */
+
+ cryptkeyres
+ KEY_GET_CONV(keybuf) = 10;
+
+
+ } = 2;
+} = 100029;
+
+
diff --git a/sysroot/usr/include/rpcsvc/klm_prot.h b/sysroot/usr/include/rpcsvc/klm_prot.h
new file mode 100644
index 0000000..6ec281e
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/klm_prot.h
@@ -0,0 +1,136 @@
+/*
+ * Please do not edit this file.
+ * It was generated using rpcgen.
+ */
+
+#ifndef _KLM_PROT_H_RPCGEN
+#define _KLM_PROT_H_RPCGEN
+
+#include <rpc/rpc.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define LM_MAXSTRLEN 1024
+
+enum klm_stats {
+ klm_granted = 0,
+ klm_denied = 1,
+ klm_denied_nolocks = 2,
+ klm_working = 3,
+};
+typedef enum klm_stats klm_stats;
+
+struct klm_lock {
+ char *server_name;
+ netobj fh;
+ int pid;
+ u_int l_offset;
+ u_int l_len;
+};
+typedef struct klm_lock klm_lock;
+
+struct klm_holder {
+ bool_t exclusive;
+ int svid;
+ u_int l_offset;
+ u_int l_len;
+};
+typedef struct klm_holder klm_holder;
+
+struct klm_stat {
+ klm_stats stat;
+};
+typedef struct klm_stat klm_stat;
+
+struct klm_testrply {
+ klm_stats stat;
+ union {
+ struct klm_holder holder;
+ } klm_testrply_u;
+};
+typedef struct klm_testrply klm_testrply;
+
+struct klm_lockargs {
+ bool_t block;
+ bool_t exclusive;
+ struct klm_lock alock;
+};
+typedef struct klm_lockargs klm_lockargs;
+
+struct klm_testargs {
+ bool_t exclusive;
+ struct klm_lock alock;
+};
+typedef struct klm_testargs klm_testargs;
+
+struct klm_unlockargs {
+ struct klm_lock alock;
+};
+typedef struct klm_unlockargs klm_unlockargs;
+
+#define KLM_PROG 100020
+#define KLM_VERS 1
+
+#if defined(__STDC__) || defined(__cplusplus)
+#define KLM_TEST 1
+extern klm_testrply * klm_test_1(struct klm_testargs *, CLIENT *);
+extern klm_testrply * klm_test_1_svc(struct klm_testargs *, struct svc_req *);
+#define KLM_LOCK 2
+extern klm_stat * klm_lock_1(struct klm_lockargs *, CLIENT *);
+extern klm_stat * klm_lock_1_svc(struct klm_lockargs *, struct svc_req *);
+#define KLM_CANCEL 3
+extern klm_stat * klm_cancel_1(struct klm_lockargs *, CLIENT *);
+extern klm_stat * klm_cancel_1_svc(struct klm_lockargs *, struct svc_req *);
+#define KLM_UNLOCK 4
+extern klm_stat * klm_unlock_1(struct klm_unlockargs *, CLIENT *);
+extern klm_stat * klm_unlock_1_svc(struct klm_unlockargs *, struct svc_req *);
+extern int klm_prog_1_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
+
+#else /* K&R C */
+#define KLM_TEST 1
+extern klm_testrply * klm_test_1();
+extern klm_testrply * klm_test_1_svc();
+#define KLM_LOCK 2
+extern klm_stat * klm_lock_1();
+extern klm_stat * klm_lock_1_svc();
+#define KLM_CANCEL 3
+extern klm_stat * klm_cancel_1();
+extern klm_stat * klm_cancel_1_svc();
+#define KLM_UNLOCK 4
+extern klm_stat * klm_unlock_1();
+extern klm_stat * klm_unlock_1_svc();
+extern int klm_prog_1_freeresult ();
+#endif /* K&R C */
+
+/* the xdr functions */
+
+#if defined(__STDC__) || defined(__cplusplus)
+extern bool_t xdr_klm_stats (XDR *, klm_stats*);
+extern bool_t xdr_klm_lock (XDR *, klm_lock*);
+extern bool_t xdr_klm_holder (XDR *, klm_holder*);
+extern bool_t xdr_klm_stat (XDR *, klm_stat*);
+extern bool_t xdr_klm_testrply (XDR *, klm_testrply*);
+extern bool_t xdr_klm_lockargs (XDR *, klm_lockargs*);
+extern bool_t xdr_klm_testargs (XDR *, klm_testargs*);
+extern bool_t xdr_klm_unlockargs (XDR *, klm_unlockargs*);
+
+#else /* K&R C */
+extern bool_t xdr_klm_stats ();
+extern bool_t xdr_klm_lock ();
+extern bool_t xdr_klm_holder ();
+extern bool_t xdr_klm_stat ();
+extern bool_t xdr_klm_testrply ();
+extern bool_t xdr_klm_lockargs ();
+extern bool_t xdr_klm_testargs ();
+extern bool_t xdr_klm_unlockargs ();
+
+#endif /* K&R C */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !_KLM_PROT_H_RPCGEN */
diff --git a/sysroot/usr/include/rpcsvc/klm_prot.x b/sysroot/usr/include/rpcsvc/klm_prot.x
new file mode 100644
index 0000000..5f3e12e
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/klm_prot.x
@@ -0,0 +1,134 @@
+/* @(#)klm_prot.x 2.1 88/08/01 4.0 RPCSRC */
+/* @(#)klm_prot.x 1.7 87/07/08 Copyr 1987 Sun Micro */
+
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+
+/*
+ * Kernel/lock manager protocol definition
+ * Copyright (C) 1986 Sun Microsystems, Inc.
+ *
+ * protocol used between the UNIX kernel (the "client") and the
+ * local lock manager. The local lock manager is a deamon running
+ * above the kernel.
+ */
+
+const LM_MAXSTRLEN = 1024;
+
+/*
+ * lock manager status returns
+ */
+enum klm_stats {
+ klm_granted = 0, /* lock is granted */
+ klm_denied = 1, /* lock is denied */
+ klm_denied_nolocks = 2, /* no lock entry available */
+ klm_working = 3 /* lock is being processed */
+};
+
+/*
+ * lock manager lock identifier
+ */
+struct klm_lock {
+ string server_name<LM_MAXSTRLEN>;
+ netobj fh; /* a counted file handle */
+ int pid; /* holder of the lock */
+ unsigned l_offset; /* beginning offset of the lock */
+ unsigned l_len; /* byte length of the lock;
+ * zero means through end of file */
+};
+
+/*
+ * lock holder identifier
+ */
+struct klm_holder {
+ bool exclusive; /* FALSE if shared lock */
+ int svid; /* holder of the lock (pid) */
+ unsigned l_offset; /* beginning offset of the lock */
+ unsigned l_len; /* byte length of the lock;
+ * zero means through end of file */
+};
+
+/*
+ * reply to KLM_LOCK / KLM_UNLOCK / KLM_CANCEL
+ */
+struct klm_stat {
+ klm_stats stat;
+};
+
+/*
+ * reply to a KLM_TEST call
+ */
+union klm_testrply switch (klm_stats stat) {
+ case klm_denied:
+ struct klm_holder holder;
+ default: /* All other cases return no arguments */
+ void;
+};
+
+
+/*
+ * arguments to KLM_LOCK
+ */
+struct klm_lockargs {
+ bool block;
+ bool exclusive;
+ struct klm_lock alock;
+};
+
+/*
+ * arguments to KLM_TEST
+ */
+struct klm_testargs {
+ bool exclusive;
+ struct klm_lock alock;
+};
+
+/*
+ * arguments to KLM_UNLOCK
+ */
+struct klm_unlockargs {
+ struct klm_lock alock;
+};
+
+program KLM_PROG {
+ version KLM_VERS {
+
+ klm_testrply KLM_TEST (struct klm_testargs) = 1;
+
+ klm_stat KLM_LOCK (struct klm_lockargs) = 2;
+
+ klm_stat KLM_CANCEL (struct klm_lockargs) = 3;
+ /* klm_granted=> the cancel request fails due to lock is already granted */
+ /* klm_denied=> the cancel request successfully aborts
+lock request */
+
+ klm_stat KLM_UNLOCK (struct klm_unlockargs) = 4;
+ } = 1;
+} = 100020;
+
diff --git a/sysroot/usr/include/rpcsvc/mount.h b/sysroot/usr/include/rpcsvc/mount.h
new file mode 100644
index 0000000..de22f29
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/mount.h
@@ -0,0 +1,144 @@
+/*
+ * Please do not edit this file.
+ * It was generated using rpcgen.
+ */
+
+#ifndef _MOUNT_H_RPCGEN
+#define _MOUNT_H_RPCGEN
+
+#include <rpc/rpc.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define MNTPATHLEN 1024
+#define MNTNAMLEN 255
+#define FHSIZE 32
+
+typedef char fhandle[FHSIZE];
+
+struct fhstatus {
+ u_int fhs_status;
+ union {
+ fhandle fhs_fhandle;
+ } fhstatus_u;
+};
+typedef struct fhstatus fhstatus;
+
+typedef char *dirpath;
+
+typedef char *name;
+
+typedef struct mountbody *mountlist;
+
+struct mountbody {
+ name ml_hostname;
+ dirpath ml_directory;
+ mountlist ml_next;
+};
+typedef struct mountbody mountbody;
+
+typedef struct groupnode *groups;
+
+struct groupnode {
+ name gr_name;
+ groups gr_next;
+};
+typedef struct groupnode groupnode;
+
+typedef struct exportnode *exports;
+
+struct exportnode {
+ dirpath ex_dir;
+ groups ex_groups;
+ exports ex_next;
+};
+typedef struct exportnode exportnode;
+
+#define MOUNTPROG 100005
+#define MOUNTVERS 1
+
+#if defined(__STDC__) || defined(__cplusplus)
+#define MOUNTPROC_NULL 0
+extern void * mountproc_null_1(void *, CLIENT *);
+extern void * mountproc_null_1_svc(void *, struct svc_req *);
+#define MOUNTPROC_MNT 1
+extern fhstatus * mountproc_mnt_1(dirpath *, CLIENT *);
+extern fhstatus * mountproc_mnt_1_svc(dirpath *, struct svc_req *);
+#define MOUNTPROC_DUMP 2
+extern mountlist * mountproc_dump_1(void *, CLIENT *);
+extern mountlist * mountproc_dump_1_svc(void *, struct svc_req *);
+#define MOUNTPROC_UMNT 3
+extern void * mountproc_umnt_1(dirpath *, CLIENT *);
+extern void * mountproc_umnt_1_svc(dirpath *, struct svc_req *);
+#define MOUNTPROC_UMNTALL 4
+extern void * mountproc_umntall_1(void *, CLIENT *);
+extern void * mountproc_umntall_1_svc(void *, struct svc_req *);
+#define MOUNTPROC_EXPORT 5
+extern exports * mountproc_export_1(void *, CLIENT *);
+extern exports * mountproc_export_1_svc(void *, struct svc_req *);
+#define MOUNTPROC_EXPORTALL 6
+extern exports * mountproc_exportall_1(void *, CLIENT *);
+extern exports * mountproc_exportall_1_svc(void *, struct svc_req *);
+extern int mountprog_1_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
+
+#else /* K&R C */
+#define MOUNTPROC_NULL 0
+extern void * mountproc_null_1();
+extern void * mountproc_null_1_svc();
+#define MOUNTPROC_MNT 1
+extern fhstatus * mountproc_mnt_1();
+extern fhstatus * mountproc_mnt_1_svc();
+#define MOUNTPROC_DUMP 2
+extern mountlist * mountproc_dump_1();
+extern mountlist * mountproc_dump_1_svc();
+#define MOUNTPROC_UMNT 3
+extern void * mountproc_umnt_1();
+extern void * mountproc_umnt_1_svc();
+#define MOUNTPROC_UMNTALL 4
+extern void * mountproc_umntall_1();
+extern void * mountproc_umntall_1_svc();
+#define MOUNTPROC_EXPORT 5
+extern exports * mountproc_export_1();
+extern exports * mountproc_export_1_svc();
+#define MOUNTPROC_EXPORTALL 6
+extern exports * mountproc_exportall_1();
+extern exports * mountproc_exportall_1_svc();
+extern int mountprog_1_freeresult ();
+#endif /* K&R C */
+
+/* the xdr functions */
+
+#if defined(__STDC__) || defined(__cplusplus)
+extern bool_t xdr_fhandle (XDR *, fhandle);
+extern bool_t xdr_fhstatus (XDR *, fhstatus*);
+extern bool_t xdr_dirpath (XDR *, dirpath*);
+extern bool_t xdr_name (XDR *, name*);
+extern bool_t xdr_mountlist (XDR *, mountlist*);
+extern bool_t xdr_mountbody (XDR *, mountbody*);
+extern bool_t xdr_groups (XDR *, groups*);
+extern bool_t xdr_groupnode (XDR *, groupnode*);
+extern bool_t xdr_exports (XDR *, exports*);
+extern bool_t xdr_exportnode (XDR *, exportnode*);
+
+#else /* K&R C */
+extern bool_t xdr_fhandle ();
+extern bool_t xdr_fhstatus ();
+extern bool_t xdr_dirpath ();
+extern bool_t xdr_name ();
+extern bool_t xdr_mountlist ();
+extern bool_t xdr_mountbody ();
+extern bool_t xdr_groups ();
+extern bool_t xdr_groupnode ();
+extern bool_t xdr_exports ();
+extern bool_t xdr_exportnode ();
+
+#endif /* K&R C */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !_MOUNT_H_RPCGEN */
diff --git a/sysroot/usr/include/rpcsvc/mount.x b/sysroot/usr/include/rpcsvc/mount.x
new file mode 100644
index 0000000..310b4ca
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/mount.x
@@ -0,0 +1,161 @@
+/* @(#)mount.x 2.1 88/08/01 4.0 RPCSRC */
+/* @(#)mount.x 1.2 87/09/18 Copyr 1987 Sun Micro */
+
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+
+/*
+ * Protocol description for the mount program
+ */
+
+
+const MNTPATHLEN = 1024; /* maximum bytes in a pathname argument */
+const MNTNAMLEN = 255; /* maximum bytes in a name argument */
+const FHSIZE = 32; /* size in bytes of a file handle */
+
+/*
+ * The fhandle is the file handle that the server passes to the client.
+ * All file operations are done using the file handles to refer to a file
+ * or a directory. The file handle can contain whatever information the
+ * server needs to distinguish an individual file.
+ */
+typedef opaque fhandle[FHSIZE];
+
+/*
+ * If a status of zero is returned, the call completed successfully, and
+ * a file handle for the directory follows. A non-zero status indicates
+ * some sort of error. The status corresponds with UNIX error numbers.
+ */
+union fhstatus switch (unsigned fhs_status) {
+case 0:
+ fhandle fhs_fhandle;
+default:
+ void;
+};
+
+/*
+ * The type dirpath is the pathname of a directory
+ */
+typedef string dirpath<MNTPATHLEN>;
+
+/*
+ * The type name is used for arbitrary names (hostnames, groupnames)
+ */
+typedef string name<MNTNAMLEN>;
+
+/*
+ * A list of who has what mounted
+ */
+typedef struct mountbody *mountlist;
+struct mountbody {
+ name ml_hostname;
+ dirpath ml_directory;
+ mountlist ml_next;
+};
+
+/*
+ * A list of netgroups
+ */
+typedef struct groupnode *groups;
+struct groupnode {
+ name gr_name;
+ groups gr_next;
+};
+
+/*
+ * A list of what is exported and to whom
+ */
+typedef struct exportnode *exports;
+struct exportnode {
+ dirpath ex_dir;
+ groups ex_groups;
+ exports ex_next;
+};
+
+program MOUNTPROG {
+ /*
+ * Version one of the mount protocol communicates with version two
+ * of the NFS protocol. The only connecting point is the fhandle
+ * structure, which is the same for both protocols.
+ */
+ version MOUNTVERS {
+ /*
+ * Does no work. It is made available in all RPC services
+ * to allow server response testing and timing
+ */
+ void
+ MOUNTPROC_NULL(void) = 0;
+
+ /*
+ * If fhs_status is 0, then fhs_fhandle contains the
+ * file handle for the directory. This file handle may
+ * be used in the NFS protocol. This procedure also adds
+ * a new entry to the mount list for this client mounting
+ * the directory.
+ * Unix authentication required.
+ */
+ fhstatus
+ MOUNTPROC_MNT(dirpath) = 1;
+
+ /*
+ * Returns the list of remotely mounted filesystems. The
+ * mountlist contains one entry for each hostname and
+ * directory pair.
+ */
+ mountlist
+ MOUNTPROC_DUMP(void) = 2;
+
+ /*
+ * Removes the mount list entry for the directory
+ * Unix authentication required.
+ */
+ void
+ MOUNTPROC_UMNT(dirpath) = 3;
+
+ /*
+ * Removes all of the mount list entries for this client
+ * Unix authentication required.
+ */
+ void
+ MOUNTPROC_UMNTALL(void) = 4;
+
+ /*
+ * Returns a list of all the exported filesystems, and which
+ * machines are allowed to import it.
+ */
+ exports
+ MOUNTPROC_EXPORT(void) = 5;
+
+ /*
+ * Identical to MOUNTPROC_EXPORT above
+ */
+ exports
+ MOUNTPROC_EXPORTALL(void) = 6;
+ } = 1;
+} = 100005;
diff --git a/sysroot/usr/include/rpcsvc/nfs_prot.h b/sysroot/usr/include/rpcsvc/nfs_prot.h
new file mode 100644
index 0000000..6cf626a
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/nfs_prot.h
@@ -0,0 +1,450 @@
+/*
+ * Please do not edit this file.
+ * It was generated using rpcgen.
+ */
+
+#ifndef _NFS_PROT_H_RPCGEN
+#define _NFS_PROT_H_RPCGEN
+
+#include <rpc/rpc.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define NFS_PORT 2049
+#define NFS_MAXDATA 8192
+#define NFS_MAXPATHLEN 1024
+#define NFS_MAXNAMLEN 255
+#define NFS_FHSIZE 32
+#define NFS_COOKIESIZE 4
+#define NFS_FIFO_DEV -1
+#define NFSMODE_FMT 0170000
+#define NFSMODE_DIR 0040000
+#define NFSMODE_CHR 0020000
+#define NFSMODE_BLK 0060000
+#define NFSMODE_REG 0100000
+#define NFSMODE_LNK 0120000
+#define NFSMODE_SOCK 0140000
+#define NFSMODE_FIFO 0010000
+
+enum nfsstat {
+ NFS_OK = 0,
+ NFSERR_PERM = 1,
+ NFSERR_NOENT = 2,
+ NFSERR_IO = 5,
+ NFSERR_NXIO = 6,
+ NFSERR_ACCES = 13,
+ NFSERR_EXIST = 17,
+ NFSERR_NODEV = 19,
+ NFSERR_NOTDIR = 20,
+ NFSERR_ISDIR = 21,
+ NFSERR_FBIG = 27,
+ NFSERR_NOSPC = 28,
+ NFSERR_ROFS = 30,
+ NFSERR_NAMETOOLONG = 63,
+ NFSERR_NOTEMPTY = 66,
+ NFSERR_DQUOT = 69,
+ NFSERR_STALE = 70,
+ NFSERR_WFLUSH = 99,
+};
+typedef enum nfsstat nfsstat;
+
+enum ftype {
+ NFNON = 0,
+ NFREG = 1,
+ NFDIR = 2,
+ NFBLK = 3,
+ NFCHR = 4,
+ NFLNK = 5,
+ NFSOCK = 6,
+ NFBAD = 7,
+ NFFIFO = 8,
+};
+typedef enum ftype ftype;
+
+struct nfs_fh {
+ char data[NFS_FHSIZE];
+};
+typedef struct nfs_fh nfs_fh;
+
+struct nfstime {
+ u_int seconds;
+ u_int useconds;
+};
+typedef struct nfstime nfstime;
+
+struct fattr {
+ ftype type;
+ u_int mode;
+ u_int nlink;
+ u_int uid;
+ u_int gid;
+ u_int size;
+ u_int blocksize;
+ u_int rdev;
+ u_int blocks;
+ u_int fsid;
+ u_int fileid;
+ nfstime atime;
+ nfstime mtime;
+ nfstime ctime;
+};
+typedef struct fattr fattr;
+
+struct sattr {
+ u_int mode;
+ u_int uid;
+ u_int gid;
+ u_int size;
+ nfstime atime;
+ nfstime mtime;
+};
+typedef struct sattr sattr;
+
+typedef char *filename;
+
+typedef char *nfspath;
+
+struct attrstat {
+ nfsstat status;
+ union {
+ fattr attributes;
+ } attrstat_u;
+};
+typedef struct attrstat attrstat;
+
+struct sattrargs {
+ nfs_fh file;
+ sattr attributes;
+};
+typedef struct sattrargs sattrargs;
+
+struct diropargs {
+ nfs_fh dir;
+ filename name;
+};
+typedef struct diropargs diropargs;
+
+struct diropokres {
+ nfs_fh file;
+ fattr attributes;
+};
+typedef struct diropokres diropokres;
+
+struct diropres {
+ nfsstat status;
+ union {
+ diropokres diropres;
+ } diropres_u;
+};
+typedef struct diropres diropres;
+
+struct readlinkres {
+ nfsstat status;
+ union {
+ nfspath data;
+ } readlinkres_u;
+};
+typedef struct readlinkres readlinkres;
+
+struct readargs {
+ nfs_fh file;
+ u_int offset;
+ u_int count;
+ u_int totalcount;
+};
+typedef struct readargs readargs;
+
+struct readokres {
+ fattr attributes;
+ struct {
+ u_int data_len;
+ char *data_val;
+ } data;
+};
+typedef struct readokres readokres;
+
+struct readres {
+ nfsstat status;
+ union {
+ readokres reply;
+ } readres_u;
+};
+typedef struct readres readres;
+
+struct writeargs {
+ nfs_fh file;
+ u_int beginoffset;
+ u_int offset;
+ u_int totalcount;
+ struct {
+ u_int data_len;
+ char *data_val;
+ } data;
+};
+typedef struct writeargs writeargs;
+
+struct createargs {
+ diropargs where;
+ sattr attributes;
+};
+typedef struct createargs createargs;
+
+struct renameargs {
+ diropargs from;
+ diropargs to;
+};
+typedef struct renameargs renameargs;
+
+struct linkargs {
+ nfs_fh from;
+ diropargs to;
+};
+typedef struct linkargs linkargs;
+
+struct symlinkargs {
+ diropargs from;
+ nfspath to;
+ sattr attributes;
+};
+typedef struct symlinkargs symlinkargs;
+
+typedef char nfscookie[NFS_COOKIESIZE];
+
+struct readdirargs {
+ nfs_fh dir;
+ nfscookie cookie;
+ u_int count;
+};
+typedef struct readdirargs readdirargs;
+
+struct entry {
+ u_int fileid;
+ filename name;
+ nfscookie cookie;
+ struct entry *nextentry;
+};
+typedef struct entry entry;
+
+struct dirlist {
+ entry *entries;
+ bool_t eof;
+};
+typedef struct dirlist dirlist;
+
+struct readdirres {
+ nfsstat status;
+ union {
+ dirlist reply;
+ } readdirres_u;
+};
+typedef struct readdirres readdirres;
+
+struct statfsokres {
+ u_int tsize;
+ u_int bsize;
+ u_int blocks;
+ u_int bfree;
+ u_int bavail;
+};
+typedef struct statfsokres statfsokres;
+
+struct statfsres {
+ nfsstat status;
+ union {
+ statfsokres reply;
+ } statfsres_u;
+};
+typedef struct statfsres statfsres;
+
+#define NFS_PROGRAM 100003
+#define NFS_VERSION 2
+
+#if defined(__STDC__) || defined(__cplusplus)
+#define NFSPROC_NULL 0
+extern void * nfsproc_null_2(void *, CLIENT *);
+extern void * nfsproc_null_2_svc(void *, struct svc_req *);
+#define NFSPROC_GETATTR 1
+extern attrstat * nfsproc_getattr_2(nfs_fh *, CLIENT *);
+extern attrstat * nfsproc_getattr_2_svc(nfs_fh *, struct svc_req *);
+#define NFSPROC_SETATTR 2
+extern attrstat * nfsproc_setattr_2(sattrargs *, CLIENT *);
+extern attrstat * nfsproc_setattr_2_svc(sattrargs *, struct svc_req *);
+#define NFSPROC_ROOT 3
+extern void * nfsproc_root_2(void *, CLIENT *);
+extern void * nfsproc_root_2_svc(void *, struct svc_req *);
+#define NFSPROC_LOOKUP 4
+extern diropres * nfsproc_lookup_2(diropargs *, CLIENT *);
+extern diropres * nfsproc_lookup_2_svc(diropargs *, struct svc_req *);
+#define NFSPROC_READLINK 5
+extern readlinkres * nfsproc_readlink_2(nfs_fh *, CLIENT *);
+extern readlinkres * nfsproc_readlink_2_svc(nfs_fh *, struct svc_req *);
+#define NFSPROC_READ 6
+extern readres * nfsproc_read_2(readargs *, CLIENT *);
+extern readres * nfsproc_read_2_svc(readargs *, struct svc_req *);
+#define NFSPROC_WRITECACHE 7
+extern void * nfsproc_writecache_2(void *, CLIENT *);
+extern void * nfsproc_writecache_2_svc(void *, struct svc_req *);
+#define NFSPROC_WRITE 8
+extern attrstat * nfsproc_write_2(writeargs *, CLIENT *);
+extern attrstat * nfsproc_write_2_svc(writeargs *, struct svc_req *);
+#define NFSPROC_CREATE 9
+extern diropres * nfsproc_create_2(createargs *, CLIENT *);
+extern diropres * nfsproc_create_2_svc(createargs *, struct svc_req *);
+#define NFSPROC_REMOVE 10
+extern nfsstat * nfsproc_remove_2(diropargs *, CLIENT *);
+extern nfsstat * nfsproc_remove_2_svc(diropargs *, struct svc_req *);
+#define NFSPROC_RENAME 11
+extern nfsstat * nfsproc_rename_2(renameargs *, CLIENT *);
+extern nfsstat * nfsproc_rename_2_svc(renameargs *, struct svc_req *);
+#define NFSPROC_LINK 12
+extern nfsstat * nfsproc_link_2(linkargs *, CLIENT *);
+extern nfsstat * nfsproc_link_2_svc(linkargs *, struct svc_req *);
+#define NFSPROC_SYMLINK 13
+extern nfsstat * nfsproc_symlink_2(symlinkargs *, CLIENT *);
+extern nfsstat * nfsproc_symlink_2_svc(symlinkargs *, struct svc_req *);
+#define NFSPROC_MKDIR 14
+extern diropres * nfsproc_mkdir_2(createargs *, CLIENT *);
+extern diropres * nfsproc_mkdir_2_svc(createargs *, struct svc_req *);
+#define NFSPROC_RMDIR 15
+extern nfsstat * nfsproc_rmdir_2(diropargs *, CLIENT *);
+extern nfsstat * nfsproc_rmdir_2_svc(diropargs *, struct svc_req *);
+#define NFSPROC_READDIR 16
+extern readdirres * nfsproc_readdir_2(readdirargs *, CLIENT *);
+extern readdirres * nfsproc_readdir_2_svc(readdirargs *, struct svc_req *);
+#define NFSPROC_STATFS 17
+extern statfsres * nfsproc_statfs_2(nfs_fh *, CLIENT *);
+extern statfsres * nfsproc_statfs_2_svc(nfs_fh *, struct svc_req *);
+extern int nfs_program_2_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
+
+#else /* K&R C */
+#define NFSPROC_NULL 0
+extern void * nfsproc_null_2();
+extern void * nfsproc_null_2_svc();
+#define NFSPROC_GETATTR 1
+extern attrstat * nfsproc_getattr_2();
+extern attrstat * nfsproc_getattr_2_svc();
+#define NFSPROC_SETATTR 2
+extern attrstat * nfsproc_setattr_2();
+extern attrstat * nfsproc_setattr_2_svc();
+#define NFSPROC_ROOT 3
+extern void * nfsproc_root_2();
+extern void * nfsproc_root_2_svc();
+#define NFSPROC_LOOKUP 4
+extern diropres * nfsproc_lookup_2();
+extern diropres * nfsproc_lookup_2_svc();
+#define NFSPROC_READLINK 5
+extern readlinkres * nfsproc_readlink_2();
+extern readlinkres * nfsproc_readlink_2_svc();
+#define NFSPROC_READ 6
+extern readres * nfsproc_read_2();
+extern readres * nfsproc_read_2_svc();
+#define NFSPROC_WRITECACHE 7
+extern void * nfsproc_writecache_2();
+extern void * nfsproc_writecache_2_svc();
+#define NFSPROC_WRITE 8
+extern attrstat * nfsproc_write_2();
+extern attrstat * nfsproc_write_2_svc();
+#define NFSPROC_CREATE 9
+extern diropres * nfsproc_create_2();
+extern diropres * nfsproc_create_2_svc();
+#define NFSPROC_REMOVE 10
+extern nfsstat * nfsproc_remove_2();
+extern nfsstat * nfsproc_remove_2_svc();
+#define NFSPROC_RENAME 11
+extern nfsstat * nfsproc_rename_2();
+extern nfsstat * nfsproc_rename_2_svc();
+#define NFSPROC_LINK 12
+extern nfsstat * nfsproc_link_2();
+extern nfsstat * nfsproc_link_2_svc();
+#define NFSPROC_SYMLINK 13
+extern nfsstat * nfsproc_symlink_2();
+extern nfsstat * nfsproc_symlink_2_svc();
+#define NFSPROC_MKDIR 14
+extern diropres * nfsproc_mkdir_2();
+extern diropres * nfsproc_mkdir_2_svc();
+#define NFSPROC_RMDIR 15
+extern nfsstat * nfsproc_rmdir_2();
+extern nfsstat * nfsproc_rmdir_2_svc();
+#define NFSPROC_READDIR 16
+extern readdirres * nfsproc_readdir_2();
+extern readdirres * nfsproc_readdir_2_svc();
+#define NFSPROC_STATFS 17
+extern statfsres * nfsproc_statfs_2();
+extern statfsres * nfsproc_statfs_2_svc();
+extern int nfs_program_2_freeresult ();
+#endif /* K&R C */
+
+/* the xdr functions */
+
+#if defined(__STDC__) || defined(__cplusplus)
+extern bool_t xdr_nfsstat (XDR *, nfsstat*);
+extern bool_t xdr_ftype (XDR *, ftype*);
+extern bool_t xdr_nfs_fh (XDR *, nfs_fh*);
+extern bool_t xdr_nfstime (XDR *, nfstime*);
+extern bool_t xdr_fattr (XDR *, fattr*);
+extern bool_t xdr_sattr (XDR *, sattr*);
+extern bool_t xdr_filename (XDR *, filename*);
+extern bool_t xdr_nfspath (XDR *, nfspath*);
+extern bool_t xdr_attrstat (XDR *, attrstat*);
+extern bool_t xdr_sattrargs (XDR *, sattrargs*);
+extern bool_t xdr_diropargs (XDR *, diropargs*);
+extern bool_t xdr_diropokres (XDR *, diropokres*);
+extern bool_t xdr_diropres (XDR *, diropres*);
+extern bool_t xdr_readlinkres (XDR *, readlinkres*);
+extern bool_t xdr_readargs (XDR *, readargs*);
+extern bool_t xdr_readokres (XDR *, readokres*);
+extern bool_t xdr_readres (XDR *, readres*);
+extern bool_t xdr_writeargs (XDR *, writeargs*);
+extern bool_t xdr_createargs (XDR *, createargs*);
+extern bool_t xdr_renameargs (XDR *, renameargs*);
+extern bool_t xdr_linkargs (XDR *, linkargs*);
+extern bool_t xdr_symlinkargs (XDR *, symlinkargs*);
+extern bool_t xdr_nfscookie (XDR *, nfscookie);
+extern bool_t xdr_readdirargs (XDR *, readdirargs*);
+extern bool_t xdr_entry (XDR *, entry*);
+extern bool_t xdr_dirlist (XDR *, dirlist*);
+extern bool_t xdr_readdirres (XDR *, readdirres*);
+extern bool_t xdr_statfsokres (XDR *, statfsokres*);
+extern bool_t xdr_statfsres (XDR *, statfsres*);
+
+#else /* K&R C */
+extern bool_t xdr_nfsstat ();
+extern bool_t xdr_ftype ();
+extern bool_t xdr_nfs_fh ();
+extern bool_t xdr_nfstime ();
+extern bool_t xdr_fattr ();
+extern bool_t xdr_sattr ();
+extern bool_t xdr_filename ();
+extern bool_t xdr_nfspath ();
+extern bool_t xdr_attrstat ();
+extern bool_t xdr_sattrargs ();
+extern bool_t xdr_diropargs ();
+extern bool_t xdr_diropokres ();
+extern bool_t xdr_diropres ();
+extern bool_t xdr_readlinkres ();
+extern bool_t xdr_readargs ();
+extern bool_t xdr_readokres ();
+extern bool_t xdr_readres ();
+extern bool_t xdr_writeargs ();
+extern bool_t xdr_createargs ();
+extern bool_t xdr_renameargs ();
+extern bool_t xdr_linkargs ();
+extern bool_t xdr_symlinkargs ();
+extern bool_t xdr_nfscookie ();
+extern bool_t xdr_readdirargs ();
+extern bool_t xdr_entry ();
+extern bool_t xdr_dirlist ();
+extern bool_t xdr_readdirres ();
+extern bool_t xdr_statfsokres ();
+extern bool_t xdr_statfsres ();
+
+#endif /* K&R C */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !_NFS_PROT_H_RPCGEN */
diff --git a/sysroot/usr/include/rpcsvc/nfs_prot.x b/sysroot/usr/include/rpcsvc/nfs_prot.x
new file mode 100644
index 0000000..630dab2
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/nfs_prot.x
@@ -0,0 +1,354 @@
+/* @(#)nfs_prot.x 2.1 88/08/01 4.0 RPCSRC */
+
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+
+/*
+ * nfs_prot.x 1.2 87/10/12
+ * Copyright 1987 Sun Microsystems, Inc.
+ */
+const NFS_PORT = 2049;
+const NFS_MAXDATA = 8192;
+const NFS_MAXPATHLEN = 1024;
+const NFS_MAXNAMLEN = 255;
+const NFS_FHSIZE = 32;
+const NFS_COOKIESIZE = 4;
+const NFS_FIFO_DEV = -1; /* size kludge for named pipes */
+
+/*
+ * File types
+ */
+const NFSMODE_FMT = 0170000; /* type of file */
+const NFSMODE_DIR = 0040000; /* directory */
+const NFSMODE_CHR = 0020000; /* character special */
+const NFSMODE_BLK = 0060000; /* block special */
+const NFSMODE_REG = 0100000; /* regular */
+const NFSMODE_LNK = 0120000; /* symbolic link */
+const NFSMODE_SOCK = 0140000; /* socket */
+const NFSMODE_FIFO = 0010000; /* fifo */
+
+/*
+ * Error status
+ */
+enum nfsstat {
+ NFS_OK= 0, /* no error */
+ NFSERR_PERM=1, /* Not owner */
+ NFSERR_NOENT=2, /* No such file or directory */
+ NFSERR_IO=5, /* I/O error */
+ NFSERR_NXIO=6, /* No such device or address */
+ NFSERR_ACCES=13, /* Permission denied */
+ NFSERR_EXIST=17, /* File exists */
+ NFSERR_NODEV=19, /* No such device */
+ NFSERR_NOTDIR=20, /* Not a directory*/
+ NFSERR_ISDIR=21, /* Is a directory */
+ NFSERR_FBIG=27, /* File too large */
+ NFSERR_NOSPC=28, /* No space left on device */
+ NFSERR_ROFS=30, /* Read-only file system */
+ NFSERR_NAMETOOLONG=63, /* File name too long */
+ NFSERR_NOTEMPTY=66, /* Directory not empty */
+ NFSERR_DQUOT=69, /* Disc quota exceeded */
+ NFSERR_STALE=70, /* Stale NFS file handle */
+ NFSERR_WFLUSH=99 /* write cache flushed */
+};
+
+/*
+ * File types
+ */
+enum ftype {
+ NFNON = 0, /* non-file */
+ NFREG = 1, /* regular file */
+ NFDIR = 2, /* directory */
+ NFBLK = 3, /* block special */
+ NFCHR = 4, /* character special */
+ NFLNK = 5, /* symbolic link */
+ NFSOCK = 6, /* unix domain sockets */
+ NFBAD = 7, /* unused */
+ NFFIFO = 8 /* named pipe */
+};
+
+/*
+ * File access handle
+ */
+struct nfs_fh {
+ opaque data[NFS_FHSIZE];
+};
+
+/*
+ * Timeval
+ */
+struct nfstime {
+ unsigned seconds;
+ unsigned useconds;
+};
+
+
+/*
+ * File attributes
+ */
+struct fattr {
+ ftype type; /* file type */
+ unsigned mode; /* protection mode bits */
+ unsigned nlink; /* # hard links */
+ unsigned uid; /* owner user id */
+ unsigned gid; /* owner group id */
+ unsigned size; /* file size in bytes */
+ unsigned blocksize; /* preferred block size */
+ unsigned rdev; /* special device # */
+ unsigned blocks; /* Kb of disk used by file */
+ unsigned fsid; /* device # */
+ unsigned fileid; /* inode # */
+ nfstime atime; /* time of last access */
+ nfstime mtime; /* time of last modification */
+ nfstime ctime; /* time of last change */
+};
+
+/*
+ * File attributes which can be set
+ */
+struct sattr {
+ unsigned mode; /* protection mode bits */
+ unsigned uid; /* owner user id */
+ unsigned gid; /* owner group id */
+ unsigned size; /* file size in bytes */
+ nfstime atime; /* time of last access */
+ nfstime mtime; /* time of last modification */
+};
+
+
+typedef string filename<NFS_MAXNAMLEN>;
+typedef string nfspath<NFS_MAXPATHLEN>;
+
+/*
+ * Reply status with file attributes
+ */
+union attrstat switch (nfsstat status) {
+case NFS_OK:
+ fattr attributes;
+default:
+ void;
+};
+
+struct sattrargs {
+ nfs_fh file;
+ sattr attributes;
+};
+
+/*
+ * Arguments for directory operations
+ */
+struct diropargs {
+ nfs_fh dir; /* directory file handle */
+ filename name; /* name (up to NFS_MAXNAMLEN bytes) */
+};
+
+struct diropokres {
+ nfs_fh file;
+ fattr attributes;
+};
+
+/*
+ * Results from directory operation
+ */
+union diropres switch (nfsstat status) {
+case NFS_OK:
+ diropokres diropres;
+default:
+ void;
+};
+
+union readlinkres switch (nfsstat status) {
+case NFS_OK:
+ nfspath data;
+default:
+ void;
+};
+
+/*
+ * Arguments to remote read
+ */
+struct readargs {
+ nfs_fh file; /* handle for file */
+ unsigned offset; /* byte offset in file */
+ unsigned count; /* immediate read count */
+ unsigned totalcount; /* total read count (from this offset)*/
+};
+
+/*
+ * Status OK portion of remote read reply
+ */
+struct readokres {
+ fattr attributes; /* attributes, need for pagin*/
+ opaque data<NFS_MAXDATA>;
+};
+
+union readres switch (nfsstat status) {
+case NFS_OK:
+ readokres reply;
+default:
+ void;
+};
+
+/*
+ * Arguments to remote write
+ */
+struct writeargs {
+ nfs_fh file; /* handle for file */
+ unsigned beginoffset; /* beginning byte offset in file */
+ unsigned offset; /* current byte offset in file */
+ unsigned totalcount; /* total write count (to this offset)*/
+ opaque data<NFS_MAXDATA>;
+};
+
+struct createargs {
+ diropargs where;
+ sattr attributes;
+};
+
+struct renameargs {
+ diropargs from;
+ diropargs to;
+};
+
+struct linkargs {
+ nfs_fh from;
+ diropargs to;
+};
+
+struct symlinkargs {
+ diropargs from;
+ nfspath to;
+ sattr attributes;
+};
+
+
+typedef opaque nfscookie[NFS_COOKIESIZE];
+
+/*
+ * Arguments to readdir
+ */
+struct readdirargs {
+ nfs_fh dir; /* directory handle */
+ nfscookie cookie;
+ unsigned count; /* number of directory bytes to read */
+};
+
+struct entry {
+ unsigned fileid;
+ filename name;
+ nfscookie cookie;
+ entry *nextentry;
+};
+
+struct dirlist {
+ entry *entries;
+ bool eof;
+};
+
+union readdirres switch (nfsstat status) {
+case NFS_OK:
+ dirlist reply;
+default:
+ void;
+};
+
+struct statfsokres {
+ unsigned tsize; /* preferred transfer size in bytes */
+ unsigned bsize; /* fundamental file system block size */
+ unsigned blocks; /* total blocks in file system */
+ unsigned bfree; /* free blocks in fs */
+ unsigned bavail; /* free blocks avail to non-superuser */
+};
+
+union statfsres switch (nfsstat status) {
+case NFS_OK:
+ statfsokres reply;
+default:
+ void;
+};
+
+/*
+ * Remote file service routines
+ */
+program NFS_PROGRAM {
+ version NFS_VERSION {
+ void
+ NFSPROC_NULL(void) = 0;
+
+ attrstat
+ NFSPROC_GETATTR(nfs_fh) = 1;
+
+ attrstat
+ NFSPROC_SETATTR(sattrargs) = 2;
+
+ void
+ NFSPROC_ROOT(void) = 3;
+
+ diropres
+ NFSPROC_LOOKUP(diropargs) = 4;
+
+ readlinkres
+ NFSPROC_READLINK(nfs_fh) = 5;
+
+ readres
+ NFSPROC_READ(readargs) = 6;
+
+ void
+ NFSPROC_WRITECACHE(void) = 7;
+
+ attrstat
+ NFSPROC_WRITE(writeargs) = 8;
+
+ diropres
+ NFSPROC_CREATE(createargs) = 9;
+
+ nfsstat
+ NFSPROC_REMOVE(diropargs) = 10;
+
+ nfsstat
+ NFSPROC_RENAME(renameargs) = 11;
+
+ nfsstat
+ NFSPROC_LINK(linkargs) = 12;
+
+ nfsstat
+ NFSPROC_SYMLINK(symlinkargs) = 13;
+
+ diropres
+ NFSPROC_MKDIR(createargs) = 14;
+
+ nfsstat
+ NFSPROC_RMDIR(diropargs) = 15;
+
+ readdirres
+ NFSPROC_READDIR(readdirargs) = 16;
+
+ statfsres
+ NFSPROC_STATFS(nfs_fh) = 17;
+ } = 2;
+} = 100003;
diff --git a/sysroot/usr/include/rpcsvc/nis.h b/sysroot/usr/include/rpcsvc/nis.h
new file mode 100644
index 0000000..0495457
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/nis.h
@@ -0,0 +1,615 @@
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user or with the express written consent of
+ * Sun Microsystems, Inc.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+
+#ifndef _RPCSVC_NIS_H
+#define _RPCSVC_NIS_H 1
+
+#include <features.h>
+#include <rpc/rpc.h>
+#include <rpcsvc/nis_tags.h>
+
+__BEGIN_DECLS
+
+/*
+ * nis.h
+ *
+ * This file is the main include file for NIS clients. It contains
+ * both the client library function defines and the various data
+ * structures used by the NIS service. It includes the file nis_tags.h
+ * which defines the tag values. This allows the tags to change without
+ * having to change the nis.x file.
+ *
+ * NOTE : THIS FILE IS NOT GENERATED WITH RPCGEN ! SO YOU HAVE TO
+ * ADD ALL THE CHANGES ON nis_*.x FILES HERE AGAIN !
+ *
+ * I have removed all the Solaris internal structs and variables,
+ * because they are not supported, Sun changed them between various
+ * releases and they shouldn't be used in user programs.
+ * <kukuk@suse.de>
+ */
+
+
+#ifndef __nis_object_h
+#define __nis_object_h
+
+#define NIS_MAXSTRINGLEN 255
+#define NIS_MAXNAMELEN 1024
+#define NIS_MAXATTRNAME 32
+#define NIS_MAXATTRVAL 2048
+#define NIS_MAXCOLUMNS 64
+#define NIS_MAXATTR 16
+#define NIS_MAXPATH 1024
+#define NIS_MAXREPLICAS 128
+#define NIS_MAXLINKS 16
+#define NIS_PK_NONE 0
+#define NIS_PK_DH 1
+#define NIS_PK_RSA 2
+#define NIS_PK_KERB 3
+#define NIS_PK_DHEXT 4
+
+struct nis_attr {
+ char *zattr_ndx;
+ struct {
+ u_int zattr_val_len;
+ char *zattr_val_val;
+ } zattr_val;
+};
+typedef struct nis_attr nis_attr;
+
+typedef char *nis_name;
+
+enum zotypes {
+ BOGUS_OBJ = 0,
+ NO_OBJ = 1,
+ DIRECTORY_OBJ = 2,
+ GROUP_OBJ = 3,
+ TABLE_OBJ = 4,
+ ENTRY_OBJ = 5,
+ LINK_OBJ = 6,
+ PRIVATE_OBJ = 7,
+ NIS_BOGUS_OBJ = 0,
+ NIS_NO_OBJ = 1,
+ NIS_DIRECTORY_OBJ = 2,
+ NIS_GROUP_OBJ = 3,
+ NIS_TABLE_OBJ = 4,
+ NIS_ENTRY_OBJ = 5,
+ NIS_LINK_OBJ = 6,
+ NIS_PRIVATE_OBJ = 7
+};
+typedef enum zotypes zotypes;
+
+enum nstype {
+ UNKNOWN = 0,
+ NIS = 1,
+ SUNYP = 2,
+ IVY = 3,
+ DNS = 4,
+ X500 = 5,
+ DNANS = 6,
+ XCHS = 7,
+ CDS = 8,
+};
+typedef enum nstype nstype;
+
+struct oar_mask {
+ uint32_t oa_rights;
+ zotypes oa_otype;
+};
+typedef struct oar_mask oar_mask;
+
+struct endpoint {
+ char *uaddr;
+ char *family;
+ char *proto;
+};
+typedef struct endpoint endpoint;
+
+struct nis_server {
+ nis_name name;
+ struct {
+ u_int ep_len;
+ endpoint *ep_val;
+ } ep;
+ uint32_t key_type;
+ netobj pkey;
+};
+typedef struct nis_server nis_server;
+
+struct directory_obj {
+ nis_name do_name;
+ nstype do_type;
+ struct {
+ u_int do_servers_len;
+ nis_server *do_servers_val;
+ } do_servers;
+ uint32_t do_ttl;
+ struct {
+ u_int do_armask_len;
+ oar_mask *do_armask_val;
+ } do_armask;
+};
+typedef struct directory_obj directory_obj;
+
+#define EN_BINARY 1
+#define EN_CRYPT 2
+#define EN_XDR 4
+#define EN_MODIFIED 8
+#define EN_ASN1 64
+
+struct entry_col {
+ uint32_t ec_flags;
+ struct {
+ u_int ec_value_len;
+ char *ec_value_val;
+ } ec_value;
+};
+typedef struct entry_col entry_col;
+
+struct entry_obj {
+ char *en_type;
+ struct {
+ u_int en_cols_len;
+ entry_col *en_cols_val;
+ } en_cols;
+};
+typedef struct entry_obj entry_obj;
+
+struct group_obj {
+ uint32_t gr_flags;
+ struct {
+ u_int gr_members_len;
+ nis_name *gr_members_val;
+ } gr_members;
+};
+typedef struct group_obj group_obj;
+
+struct link_obj {
+ zotypes li_rtype;
+ struct {
+ u_int li_attrs_len;
+ nis_attr *li_attrs_val;
+ } li_attrs;
+ nis_name li_name;
+};
+typedef struct link_obj link_obj;
+
+#define TA_BINARY 1
+#define TA_CRYPT 2
+#define TA_XDR 4
+#define TA_SEARCHABLE 8
+#define TA_CASE 16
+#define TA_MODIFIED 32
+#define TA_ASN1 64
+
+struct table_col {
+ char *tc_name;
+ uint32_t tc_flags;
+ uint32_t tc_rights;
+};
+typedef struct table_col table_col;
+
+struct table_obj {
+ char *ta_type;
+ int ta_maxcol;
+ u_char ta_sep;
+ struct {
+ u_int ta_cols_len;
+ table_col *ta_cols_val;
+ } ta_cols;
+ char *ta_path;
+};
+typedef struct table_obj table_obj;
+
+struct objdata {
+ zotypes zo_type;
+ union {
+ struct directory_obj di_data;
+ struct group_obj gr_data;
+ struct table_obj ta_data;
+ struct entry_obj en_data;
+ struct link_obj li_data;
+ struct {
+ u_int po_data_len;
+ char *po_data_val;
+ } po_data;
+ } objdata_u;
+};
+typedef struct objdata objdata;
+
+struct nis_oid {
+ uint32_t ctime;
+ uint32_t mtime;
+};
+typedef struct nis_oid nis_oid;
+
+struct nis_object {
+ nis_oid zo_oid;
+ nis_name zo_name;
+ nis_name zo_owner;
+ nis_name zo_group;
+ nis_name zo_domain;
+ uint32_t zo_access;
+ uint32_t zo_ttl;
+ objdata zo_data;
+};
+typedef struct nis_object nis_object;
+
+#endif /* if __nis_object_h */
+
+enum nis_error {
+ NIS_SUCCESS = 0,
+ NIS_S_SUCCESS = 1,
+ NIS_NOTFOUND = 2,
+ NIS_S_NOTFOUND = 3,
+ NIS_CACHEEXPIRED = 4,
+ NIS_NAMEUNREACHABLE = 5,
+ NIS_UNKNOWNOBJ = 6,
+ NIS_TRYAGAIN = 7,
+ NIS_SYSTEMERROR = 8,
+ NIS_CHAINBROKEN = 9,
+ NIS_PERMISSION = 10,
+ NIS_NOTOWNER = 11,
+ NIS_NOT_ME = 12,
+ NIS_NOMEMORY = 13,
+ NIS_NAMEEXISTS = 14,
+ NIS_NOTMASTER = 15,
+ NIS_INVALIDOBJ = 16,
+ NIS_BADNAME = 17,
+ NIS_NOCALLBACK = 18,
+ NIS_CBRESULTS = 19,
+ NIS_NOSUCHNAME = 20,
+ NIS_NOTUNIQUE = 21,
+ NIS_IBMODERROR = 22,
+ NIS_NOSUCHTABLE = 23,
+ NIS_TYPEMISMATCH = 24,
+ NIS_LINKNAMEERROR = 25,
+ NIS_PARTIAL = 26,
+ NIS_TOOMANYATTRS = 27,
+ NIS_RPCERROR = 28,
+ NIS_BADATTRIBUTE = 29,
+ NIS_NOTSEARCHABLE = 30,
+ NIS_CBERROR = 31,
+ NIS_FOREIGNNS = 32,
+ NIS_BADOBJECT = 33,
+ NIS_NOTSAMEOBJ = 34,
+ NIS_MODFAIL = 35,
+ NIS_BADREQUEST = 36,
+ NIS_NOTEMPTY = 37,
+ NIS_COLDSTART_ERR = 38,
+ NIS_RESYNC = 39,
+ NIS_FAIL = 40,
+ NIS_UNAVAIL = 41,
+ NIS_RES2BIG = 42,
+ NIS_SRVAUTH = 43,
+ NIS_CLNTAUTH = 44,
+ NIS_NOFILESPACE = 45,
+ NIS_NOPROC = 46,
+ NIS_DUMPLATER = 47,
+};
+typedef enum nis_error nis_error;
+
+struct nis_result {
+ nis_error status;
+ struct {
+ u_int objects_len;
+ nis_object *objects_val;
+ } objects;
+ netobj cookie;
+ uint32_t zticks;
+ uint32_t dticks;
+ uint32_t aticks;
+ uint32_t cticks;
+};
+typedef struct nis_result nis_result;
+
+struct ns_request {
+ nis_name ns_name;
+ struct {
+ u_int ns_object_len;
+ nis_object *ns_object_val;
+ } ns_object;
+};
+typedef struct ns_request ns_request;
+
+struct ib_request {
+ nis_name ibr_name;
+ struct {
+ u_int ibr_srch_len;
+ nis_attr *ibr_srch_val;
+ } ibr_srch;
+ uint32_t ibr_flags;
+ struct {
+ u_int ibr_obj_len;
+ nis_object *ibr_obj_val;
+ } ibr_obj;
+ struct {
+ u_int ibr_cbhost_len;
+ nis_server *ibr_cbhost_val;
+ } ibr_cbhost;
+ u_int ibr_bufsize;
+ netobj ibr_cookie;
+};
+typedef struct ib_request ib_request;
+
+struct ping_args {
+ nis_name dir;
+ uint32_t stamp;
+};
+typedef struct ping_args ping_args;
+
+enum log_entry_t {
+ LOG_NOP = 0,
+ ADD_NAME = 1,
+ REM_NAME = 2,
+ MOD_NAME_OLD = 3,
+ MOD_NAME_NEW = 4,
+ ADD_IBASE = 5,
+ REM_IBASE = 6,
+ MOD_IBASE = 7,
+ UPD_STAMP = 8,
+};
+typedef enum log_entry_t log_entry_t;
+
+struct log_entry {
+ uint32_t le_time;
+ log_entry_t le_type;
+ nis_name le_princp;
+ nis_name le_name;
+ struct {
+ u_int le_attrs_len;
+ nis_attr *le_attrs_val;
+ } le_attrs;
+ nis_object le_object;
+};
+typedef struct log_entry log_entry;
+
+struct log_result {
+ nis_error lr_status;
+ netobj lr_cookie;
+ struct {
+ u_int lr_entries_len;
+ log_entry *lr_entries_val;
+ } lr_entries;
+};
+typedef struct log_result log_result;
+
+struct cp_result {
+ nis_error cp_status;
+ uint32_t cp_zticks;
+ uint32_t cp_dticks;
+};
+typedef struct cp_result cp_result;
+
+struct nis_tag {
+ uint32_t tag_type;
+ char *tag_val;
+};
+typedef struct nis_tag nis_tag;
+
+struct nis_taglist {
+ struct {
+ u_int tags_len;
+ nis_tag *tags_val;
+ } tags;
+};
+typedef struct nis_taglist nis_taglist;
+
+struct dump_args {
+ nis_name da_dir;
+ uint32_t da_time;
+ struct {
+ u_int da_cbhost_len;
+ nis_server *da_cbhost_val;
+ } da_cbhost;
+};
+typedef struct dump_args dump_args;
+
+struct fd_args {
+ nis_name dir_name;
+ nis_name requester;
+};
+typedef struct fd_args fd_args;
+
+struct fd_result {
+ nis_error status;
+ nis_name source;
+ struct {
+ u_int dir_data_len;
+ char *dir_data_val;
+ } dir_data;
+ struct {
+ u_int signature_len;
+ char *signature_val;
+ } signature;
+};
+typedef struct fd_result fd_result;
+
+/* Generic client creating flags */
+#define ZMH_VC 1
+#define ZMH_DG 2
+#define ZMH_AUTH 4
+
+/* Testing Access rights for objects */
+
+#define NIS_READ_ACC 1
+#define NIS_MODIFY_ACC 2
+#define NIS_CREATE_ACC 4
+#define NIS_DESTROY_ACC 8
+/* Test macros. a == access rights, m == desired rights. */
+#define NIS_WORLD(a, m) (((a) & (m)) != 0)
+#define NIS_GROUP(a, m) (((a) & ((m) << 8)) != 0)
+#define NIS_OWNER(a, m) (((a) & ((m) << 16)) != 0)
+#define NIS_NOBODY(a, m) (((a) & ((m) << 24)) != 0)
+/*
+ * EOL Alert - The following non-prefixed test macros are
+ * here for backward compatability, and will be not be present
+ * in future releases - use the NIS_*() macros above.
+ */
+#define WORLD(a, m) (((a) & (m)) != 0)
+#define GROUP(a, m) (((a) & ((m) << 8)) != 0)
+#define OWNER(a, m) (((a) & ((m) << 16)) != 0)
+#define NOBODY(a, m) (((a) & ((m) << 24)) != 0)
+
+#define OATYPE(d, n) (((d)->do_armask.do_armask_val+n)->oa_otype)
+#define OARIGHTS(d, n) (((d)->do_armask.do_armask_val+n)->oa_rights)
+#define WORLD_DEFAULT (NIS_READ_ACC)
+#define GROUP_DEFAULT (NIS_READ_ACC << 8)
+#define OWNER_DEFAULT ((NIS_READ_ACC + NIS_MODIFY_ACC + NIS_CREATE_ACC +\
+ NIS_DESTROY_ACC) << 16)
+#define DEFAULT_RIGHTS (WORLD_DEFAULT | GROUP_DEFAULT | OWNER_DEFAULT)
+
+/* Result manipulation defines ... */
+#define NIS_RES_NUMOBJ(x) ((x)->objects.objects_len)
+#define NIS_RES_OBJECT(x) ((x)->objects.objects_val)
+#define NIS_RES_COOKIE(x) ((x)->cookie)
+#define NIS_RES_STATUS(x) ((x)->status)
+
+/* These defines make getting at the variant part of the object easier. */
+#define TA_data zo_data.objdata_u.ta_data
+#define EN_data zo_data.objdata_u.en_data
+#define DI_data zo_data.objdata_u.di_data
+#define LI_data zo_data.objdata_u.li_data
+#define GR_data zo_data.objdata_u.gr_data
+
+#define __type_of(o) ((o)->zo_data.zo_type)
+
+/* Declarations for the internal subroutines in nislib.c */
+enum name_pos {SAME_NAME, HIGHER_NAME, LOWER_NAME, NOT_SEQUENTIAL, BAD_NAME};
+typedef enum name_pos name_pos;
+
+/*
+ * Defines for getting at column data in entry objects. Because RPCGEN
+ * generates some rather wordy structures, we create some defines that
+ * collapse the needed keystrokes to access a particular value using
+ * these definitions they take an nis_object *, and an int and return
+ * a u_char * for Value, and an int for length.
+ */
+#define ENTRY_VAL(obj, col) (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_val
+#define ENTRY_LEN(obj, col) (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_len
+
+
+/* Prototypes, and extern declarations for the NIS library functions. */
+#include <rpcsvc/nislib.h>
+#endif
+
+/*
+ * nis_3.h
+ *
+ * This file contains definitions that are only of interest to the actual
+ * service daemon and client stubs. Normal users of NIS will not include
+ * this file.
+ *
+ * NOTE : This include file is automatically created by a combination
+ * of rpcgen and sed. DO NOT EDIT IT, change the nis.x file instead
+ * and then remake this file.
+ */
+#ifndef __nis_3_h
+#define __nis_3_h
+
+#define NIS_PROG 100300
+#define NIS_VERSION 3
+
+#define NIS_LOOKUP 1
+extern nis_result * nis_lookup_3 (ns_request *, CLIENT *) __THROW;
+extern nis_result * nis_lookup_3_svc (ns_request *, struct svc_req *) __THROW;
+#define NIS_ADD 2
+extern nis_result * nis_add_3 (ns_request *, CLIENT *) __THROW;
+extern nis_result * nis_add_3_svc (ns_request *, struct svc_req *) __THROW;
+#define NIS_MODIFY 3
+extern nis_result * nis_modify_3 (ns_request *, CLIENT *) __THROW;
+extern nis_result * nis_modify_3_svc (ns_request *, struct svc_req *) __THROW;
+#define NIS_REMOVE 4
+extern nis_result * nis_remove_3 (ns_request *, CLIENT *) __THROW;
+extern nis_result * nis_remove_3_svc (ns_request *, struct svc_req *) __THROW;
+#define NIS_IBLIST 5
+extern nis_result * nis_iblist_3 (ib_request *, CLIENT *) __THROW;
+extern nis_result * nis_iblist_3_svc (ib_request *, struct svc_req *) __THROW;
+#define NIS_IBADD 6
+extern nis_result * nis_ibadd_3 (ib_request *, CLIENT *) __THROW;
+extern nis_result * nis_ibadd_3_svc (ib_request *, struct svc_req *) __THROW;
+#define NIS_IBMODIFY 7
+extern nis_result * nis_ibmodify_3 (ib_request *, CLIENT *) __THROW;
+extern nis_result * nis_ibmodify_3_svc (ib_request *, struct svc_req *)
+ __THROW;
+#define NIS_IBREMOVE 8
+extern nis_result * nis_ibremove_3 (ib_request *, CLIENT *) __THROW;
+extern nis_result * nis_ibremove_3_svc (ib_request *, struct svc_req *)
+ __THROW;
+#define NIS_IBFIRST 9
+extern nis_result * nis_ibfirst_3 (ib_request *, CLIENT *) __THROW;
+extern nis_result * nis_ibfirst_3_svc (ib_request *, struct svc_req *)
+ __THROW;
+#define NIS_IBNEXT 10
+extern nis_result * nis_ibnext_3 (ib_request *, CLIENT *) __THROW;
+extern nis_result * nis_ibnext_3_svc (ib_request *, struct svc_req *) __THROW;
+#define NIS_FINDDIRECTORY 12
+extern fd_result * nis_finddirectory_3 (fd_args *, CLIENT *) __THROW;
+extern fd_result * nis_finddirectory_3_svc (fd_args *,
+ struct svc_req *) __THROW;
+#define NIS_STATUS 14
+extern nis_taglist * nis_status_3 (nis_taglist *, CLIENT *) __THROW;
+extern nis_taglist * nis_status_3_svc (nis_taglist *, struct svc_req *)
+ __THROW;
+#define NIS_DUMPLOG 15
+extern log_result * nis_dumplog_3 (dump_args *, CLIENT *) __THROW;
+extern log_result * nis_dumplog_3_svc (dump_args *, struct svc_req *) __THROW;
+#define NIS_DUMP 16
+extern log_result * nis_dump_3 (dump_args *, CLIENT *) __THROW;
+extern log_result * nis_dump_3_svc (dump_args *, struct svc_req *) __THROW;
+#define NIS_CALLBACK 17
+extern bool_t * nis_callback_3 (netobj *, CLIENT *) __THROW;
+extern bool_t * nis_callback_3_svc (netobj *, struct svc_req *) __THROW;
+#define NIS_CPTIME 18
+extern uint32_t * nis_cptime_3 (nis_name *, CLIENT *) __THROW;
+extern uint32_t * nis_cptime_3_svc (nis_name *, struct svc_req *) __THROW;
+#define NIS_CHECKPOINT 19
+extern cp_result * nis_checkpoint_3 (nis_name *, CLIENT *) __THROW;
+extern cp_result * nis_checkpoint_3_svc (nis_name *, struct svc_req *)
+ __THROW;
+#define NIS_PING 20
+extern void * nis_ping_3 (ping_args *, CLIENT *) __THROW;
+extern void * nis_ping_3_svc (ping_args *, struct svc_req *) __THROW;
+#define NIS_SERVSTATE 21
+extern nis_taglist * nis_servstate_3 (nis_taglist *, CLIENT *) __THROW;
+extern nis_taglist * nis_servstate_3_svc (nis_taglist *,
+ struct svc_req *) __THROW;
+#define NIS_MKDIR 22
+extern nis_error * nis_mkdir_3 (nis_name *, CLIENT *) __THROW;
+extern nis_error * nis_mkdir_3_svc (nis_name *, struct svc_req *) __THROW;
+#define NIS_RMDIR 23
+extern nis_error * nis_rmdir_3 (nis_name *, CLIENT *) __THROW;
+extern nis_error * nis_rmdir_3_svc (nis_name *, struct svc_req *) __THROW;
+#define NIS_UPDKEYS 24
+extern nis_error * nis_updkeys_3 (nis_name *, CLIENT *) __THROW;
+extern nis_error * nis_updkeys_3_svc (nis_name *, struct svc_req *) __THROW;
+
+__END_DECLS
+
+#endif /* ! _RPCSVC_NIS_H */
diff --git a/sysroot/usr/include/rpcsvc/nis.x b/sysroot/usr/include/rpcsvc/nis.x
new file mode 100644
index 0000000..54ddb05
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/nis.x
@@ -0,0 +1,473 @@
+%/*
+% * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+% * unrestricted use provided that this legend is included on all tape
+% * media and as a part of the software program in whole or part. Users
+% * may copy or modify Sun RPC without charge, but are not authorized
+% * to license or distribute it to anyone else except as part of a product or
+% * program developed by the user or with the express written consent of
+% * Sun Microsystems, Inc.
+% *
+% * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+% * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+% * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+% *
+% * Sun RPC is provided with no support and without any obligation on the
+% * part of Sun Microsystems, Inc. to assist in its use, correction,
+% * modification or enhancement.
+% *
+% * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+% * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+% * OR ANY PART THEREOF.
+% *
+% * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+% * or profits or other special, indirect and consequential damages, even if
+% * Sun has been advised of the possibility of such damages.
+% *
+% * Sun Microsystems, Inc.
+% * 2550 Garcia Avenue
+% * Mountain View, California 94043
+% */
+
+#ifdef RPC_HDR
+%/*
+% * nis.h
+% *
+% * This file is the main include file for NIS clients. It contains
+% * both the client library function defines and the various data
+% * structures used by the NIS service. It includes the file nis_tags.h
+% * which defines the tag values. This allows the tags to change without
+% * having to change the nis.x file.
+% *
+% * NOTE : DO NOT EDIT THIS FILE! It is automatically generated when
+% * rpcgen is run on the nis.x file. Note that there is a
+% * simple sed script to remove some unneeded lines. (See the
+% * Makefile target nis.h)
+% *
+% */
+%#include <rpcsvc/nis_tags.h>
+#endif
+
+/* This gets stuffed into the source files. */
+#if RPC_HDR
+%#include <rpc/xdr.h>
+#endif
+
+/* Include the RPC Language description of NIS objects */
+#include "nis_object.x"
+
+/* Errors that can be returned by the service */
+enum nis_error {
+ NIS_SUCCESS = 0, /* A-ok, let's rock n roll */
+ NIS_S_SUCCESS = 1, /* Name found (maybe) */
+ NIS_NOTFOUND = 2, /* Name definitely not found */
+ NIS_S_NOTFOUND = 3, /* Name maybe not found */
+ NIS_CACHEEXPIRED = 4, /* Name exists but cache out of date */
+ NIS_NAMEUNREACHABLE = 5, /* Can't get there from here */
+ NIS_UNKNOWNOBJ = 6, /* Object type is bogus */
+ NIS_TRYAGAIN = 7, /* I'm busy, call back */
+ NIS_SYSTEMERROR = 8, /* Generic system error */
+ NIS_CHAINBROKEN = 9, /* First/Next warning */
+ NIS_PERMISSION = 10, /* Not enough permission to access */
+ NIS_NOTOWNER = 11, /* You don't own it, sorry */
+ NIS_NOT_ME = 12, /* I don't serve this name */
+ NIS_NOMEMORY = 13, /* Outta VM! Help! */
+ NIS_NAMEEXISTS = 14, /* Can't create over another name */
+ NIS_NOTMASTER = 15, /* I'm justa secondaray, don't ask me */
+ NIS_INVALIDOBJ = 16, /* Object is broken somehow */
+ NIS_BADNAME = 17, /* Unparsable name */
+ NIS_NOCALLBACK = 18, /* Couldn't talk to call back proc */
+ NIS_CBRESULTS = 19, /* Results being called back to you */
+ NIS_NOSUCHNAME = 20, /* Name unknown */
+ NIS_NOTUNIQUE = 21, /* Value is not uniques (entry) */
+ NIS_IBMODERROR = 22, /* Inf. Base. Modify error. */
+ NIS_NOSUCHTABLE = 23, /* Name for table was wrong */
+ NIS_TYPEMISMATCH = 24, /* Entry and table type mismatch */
+ NIS_LINKNAMEERROR = 25, /* Link points to bogus name */
+ NIS_PARTIAL = 26, /* Partial success, found table */
+ NIS_TOOMANYATTRS = 27, /* Too many attributes */
+ NIS_RPCERROR = 28, /* RPC error encountered */
+ NIS_BADATTRIBUTE = 29, /* Bad or invalid attribute */
+ NIS_NOTSEARCHABLE = 30, /* Non-searchable object searched */
+ NIS_CBERROR = 31, /* Error during callback (svc crash) */
+ NIS_FOREIGNNS = 32, /* Foreign Namespace */
+ NIS_BADOBJECT = 33, /* Malformed object structure */
+ NIS_NOTSAMEOBJ = 34, /* Object swapped during deletion */
+ NIS_MODFAIL = 35, /* Failure during a Modify. */
+ NIS_BADREQUEST = 36, /* Illegal query for table */
+ NIS_NOTEMPTY = 37, /* Attempt to remove a non-empty tbl */
+ NIS_COLDSTART_ERR = 38, /* Error accesing the cold start file */
+ NIS_RESYNC = 39, /* Transaction log too far out of date */
+ NIS_FAIL = 40, /* NIS operation failed. */
+ NIS_UNAVAIL = 41, /* NIS+ service is unavailable (client) */
+ NIS_RES2BIG = 42, /* NIS+ result too big for datagram */
+ NIS_SRVAUTH = 43, /* NIS+ server wasn't authenticated. */
+ NIS_CLNTAUTH = 44, /* NIS+ Client wasn't authenticated. */
+ NIS_NOFILESPACE = 45, /* NIS+ server ran out of disk space */
+ NIS_NOPROC = 46, /* NIS+ server couldn't create new proc */
+ NIS_DUMPLATER = 47 /* NIS+ server already has dump child */
+};
+
+
+/*
+ * Structure definitions for the parameters and results of the actual
+ * NIS RPC calls.
+ *
+ * This is the standard result (in the protocol) of most of the nis
+ * requests.
+ */
+
+struct nis_result {
+ nis_error status; /* Status of the response */
+ nis_object objects<>; /* objects found */
+ netobj cookie; /* Cookie Data */
+ uint32_t zticks; /* server ticks */
+ uint32_t dticks; /* DBM ticks. */
+ uint32_t aticks; /* Cache (accel) ticks */
+ uint32_t cticks; /* Client ticks */
+};
+
+/*
+ * A Name Service request
+ * This request is used to access the name space, ns_name is the name
+ * of the object within the namespace and the object is it's value, for
+ * add/modify, a copy of the original for remove.
+ */
+
+struct ns_request {
+ nis_name ns_name; /* Name in the NIS name space */
+ nis_object ns_object<1>; /* Optional Object (add/remove) */
+};
+
+/*
+ * An information base request
+ * This request includes the NIS name of the table we wish to search, the
+ * search criteria in the form of attribute/value pairs and an optional
+ * callback program number. If the callback program number is provided
+ * the server will send back objects one at a time, otherwise it will
+ * return them all in the response.
+ */
+
+struct ib_request {
+ nis_name ibr_name; /* The name of the Table */
+ nis_attr ibr_srch<>; /* The search critereia */
+ uint32_t ibr_flags; /* Optional flags */
+ nis_object ibr_obj<1>; /* optional object (add/modify) */
+ nis_server ibr_cbhost<1>; /* Optional callback info */
+ u_int ibr_bufsize; /* Optional first/next bufsize */
+ netobj ibr_cookie; /* The first/next cookie */
+};
+
+/*
+ * This argument to the PING call notifies the replicas that something in
+ * a directory has changed and this is it's timestamp. The replica will use
+ * the timestamp to determine if its resync operation was successful.
+ */
+struct ping_args {
+ nis_name dir; /* Directory that had the change */
+ uint32_t stamp; /* timestamp of the transaction */
+};
+
+/*
+ * These are the type of entries that are stored in the transaction log,
+ * note that modifications will appear as two entries, for names, they have
+ * a "OLD" entry followed by a "NEW" entry. For entries in tables, there
+ * is a remove followed by an add. It is done this way so that we can read
+ * the log backwards to back out transactions and forwards to propogate
+ * updated.
+ */
+enum log_entry_t {
+ LOG_NOP = 0,
+ ADD_NAME = 1, /* Name Added to name space */
+ REM_NAME = 2, /* Name removed from name space */
+ MOD_NAME_OLD = 3, /* Name was modified in the name space */
+ MOD_NAME_NEW = 4, /* Name was modified in the name space */
+ ADD_IBASE = 5, /* Entry added to information base */
+ REM_IBASE = 6, /* Entry removed from information base */
+ MOD_IBASE = 7, /* Entry was modified in information base */
+ UPD_STAMP = 8 /* Update timestamp (used as fenceposts) */
+};
+
+/*
+ * This result is returned from the name service when it is requested to
+ * dump logged entries from its transaction log. Information base updates
+ * will have the name of the information base in the le_name field and
+ * a canonical set of attribute/value pairs to fully specify the entry's
+ * 'name'.
+ */
+struct log_entry {
+ uint32_t le_time; /* Time in seconds */
+ log_entry_t le_type; /* Type of log entry */
+ nis_name le_princp; /* Principal making the change */
+ nis_name le_name; /* Name of table/dir involved */
+ nis_attr le_attrs<>; /* List of AV pairs. */
+ nis_object le_object; /* Actual object value */
+};
+
+struct log_result {
+ nis_error lr_status; /* The status itself */
+ netobj lr_cookie; /* Used by the dump callback */
+ log_entry lr_entries<>; /* zero or more entries */
+};
+
+struct cp_result {
+ nis_error cp_status; /* Status of the checkpoint */
+ uint32_t cp_zticks; /* Service 'ticks' */
+ uint32_t cp_dticks; /* Database 'ticks' */
+};
+
+/*
+ * This structure defines a generic NIS tag list. The taglist contains
+ * zero or tags, each of which is a type and a value. (u_int).
+ * These are used to report statistics (see tag definitions below)
+ * and to set or reset state variables.
+ */
+struct nis_tag {
+ uint32_t tag_type; /* Statistic tag (may vary) */
+ string tag_val<>; /* Statistic value may also vary */
+};
+
+struct nis_taglist {
+ nis_tag tags<>; /* List of tags */
+};
+
+struct dump_args {
+ nis_name da_dir; /* Directory to dump */
+ uint32_t da_time; /* From this timestamp */
+ nis_server da_cbhost<1>; /* Callback to use. */
+};
+
+struct fd_args {
+ nis_name dir_name; /* The directory we're looking for */
+ nis_name requester; /* Host principal name for signature */
+};
+
+struct fd_result {
+ nis_error status; /* Status returned by function */
+ nis_name source; /* Source of this answer */
+ opaque dir_data<>; /* Directory Data (XDR'ed) */
+ opaque signature<>; /* Signature of the source */
+};
+
+%/*
+% * Structures used for server binding.
+% */
+struct nis_bound_endpoint {
+ endpoint ep;
+ int generation;
+ int rank;
+ uint32_t flags;
+ int hostnum;
+ int epnum;
+ nis_name uaddr;
+ endpoint cbep;
+};
+typedef struct nis_bound_endpoint nis_bound_endpoint;
+
+struct nis_bound_directory {
+ int generation;
+ int min_rank; /* minimum rank of bound endpoints */
+ int optimal_rank; /* best possible rank of all endpoints */
+ directory_obj dobj;
+ nis_bound_endpoint BEP<>;
+};
+typedef struct nis_bound_directory nis_bound_directory;
+%#define bep_len BEP.BEP_len
+%#define bep_val BEP.BEP_val
+
+struct nis_active_endpoint {
+ endpoint ep;
+ nis_name hostname;
+ int rank;
+ int uaddr_generation;
+ nis_name uaddr;
+ int cbep_generation;
+ endpoint cbep;
+};
+typedef struct nis_active_endpoint nis_active_endpoint;
+
+%/* defines for nis_bound_endpoint.flags */
+%#define NIS_BOUND 0x1
+%#define NIS_TRANSIENT_ERRORS 0x2
+
+program NIS_PROG {
+
+ /* RPC Language description of the NIS+ protocol */
+ version NIS_VERSION {
+ /* The name service functions */
+ nis_result NIS_LOOKUP(ns_request) = 1;
+ nis_result NIS_ADD(ns_request) = 2;
+ nis_result NIS_MODIFY(ns_request) = 3;
+ nis_result NIS_REMOVE(ns_request) = 4;
+
+ /* The information base functions */
+ nis_result NIS_IBLIST(ib_request) = 5;
+ nis_result NIS_IBADD(ib_request) = 6;
+ nis_result NIS_IBMODIFY(ib_request) = 7;
+ nis_result NIS_IBREMOVE(ib_request) = 8;
+ nis_result NIS_IBFIRST(ib_request) = 9;
+ nis_result NIS_IBNEXT(ib_request) = 10;
+
+ /* NIS Administrative functions */
+ fd_result NIS_FINDDIRECTORY(fd_args) = 12;
+
+ /* If fetch and optionally reset statistics */
+ nis_taglist NIS_STATUS(nis_taglist) = 14;
+
+ /* Dump changes to directory since time in da_time */
+ log_result NIS_DUMPLOG(dump_args) = 15;
+
+ /* Dump contents of directory named */
+ log_result NIS_DUMP(dump_args) = 16;
+
+ /* Check status of callback thread */
+ bool NIS_CALLBACK(netobj) = 17;
+
+ /* Return last update time for named dir */
+ uint32_t NIS_CPTIME(nis_name) = 18;
+
+ /* Checkpoint directory or table named */
+ cp_result NIS_CHECKPOINT(nis_name) = 19;
+
+ /* Send 'status changed' ping to replicates */
+ void NIS_PING(ping_args) = 20;
+
+ /* Modify server behaviour (such as debugging) */
+ nis_taglist NIS_SERVSTATE(nis_taglist) = 21;
+
+ /* Create a Directory */
+ nis_error NIS_MKDIR(nis_name) = 22;
+
+ /* Remove a Directory */
+ nis_error NIS_RMDIR(nis_name) = 23;
+
+ /* Update public keys of a directory object */
+ nis_error NIS_UPDKEYS(nis_name) = 24;
+ } = 3;
+} = 100300;
+
+/*
+ * Included below are the defines that become part of nis.h,
+ * they are technically not part of the protocol, but do define
+ * key aspects of the implementation and are therefore useful
+ * in building a conforming server or client.
+ */
+#if RPC_HDR
+%/*
+% * Generic "hash" datastructures, used by all types of hashed data.
+% */
+%struct nis_hash_data {
+% nis_name name; /* NIS name of hashed item */
+% int keychain; /* It's hash key (for pop) */
+% struct nis_hash_data *next; /* Hash collision pointer */
+% struct nis_hash_data *prv_item; /* A serial, doubly linked list */
+% struct nis_hash_data *nxt_item; /* of items in the hash table */
+%};
+%typedef struct nis_hash_data NIS_HASH_ITEM;
+%
+%struct nis_hash_table {
+% NIS_HASH_ITEM *keys[64]; /* A hash table of items */
+% NIS_HASH_ITEM *first; /* The first "item" in serial list */
+%};
+%typedef struct nis_hash_table NIS_HASH_TABLE;
+%
+%/* Structure for storing dynamically allocated static data */
+%struct nis_sdata {
+% void *buf; /* Memory allocation pointer */
+% u_int size; /* Buffer size */
+%};
+%
+%/* Generic client creating flags */
+%#define ZMH_VC 1
+%#define ZMH_DG 2
+%#define ZMH_AUTH 4
+%
+%/* Testing Access rights for objects */
+%
+%#define NIS_READ_ACC 1
+%#define NIS_MODIFY_ACC 2
+%#define NIS_CREATE_ACC 4
+%#define NIS_DESTROY_ACC 8
+%/* Test macros. a == access rights, m == desired rights. */
+%#define NIS_WORLD(a, m) (((a) & (m)) != 0)
+%#define NIS_GROUP(a, m) (((a) & ((m) << 8)) != 0)
+%#define NIS_OWNER(a, m) (((a) & ((m) << 16)) != 0)
+%#define NIS_NOBODY(a, m) (((a) & ((m) << 24)) != 0)
+%/*
+% * EOL Alert - The following non-prefixed test macros are
+% * here for backward compatability, and will be not be present
+% * in future releases - use the NIS_*() macros above.
+% */
+%#define WORLD(a, m) (((a) & (m)) != 0)
+%#define GROUP(a, m) (((a) & ((m) << 8)) != 0)
+%#define OWNER(a, m) (((a) & ((m) << 16)) != 0)
+%#define NOBODY(a, m) (((a) & ((m) << 24)) != 0)
+%
+%#define OATYPE(d, n) (((d)->do_armask.do_armask_val+n)->oa_otype)
+%#define OARIGHTS(d, n) (((d)->do_armask.do_armask_val+n)->oa_rights)
+%#define WORLD_DEFAULT (NIS_READ_ACC)
+%#define GROUP_DEFAULT (NIS_READ_ACC << 8)
+%#define OWNER_DEFAULT ((NIS_READ_ACC +\
+ NIS_MODIFY_ACC +\
+ NIS_CREATE_ACC +\
+ NIS_DESTROY_ACC) << 16)
+%#define DEFAULT_RIGHTS (WORLD_DEFAULT | GROUP_DEFAULT | OWNER_DEFAULT)
+%
+%/* Result manipulation defines ... */
+%#define NIS_RES_NUMOBJ(x) ((x)->objects.objects_len)
+%#define NIS_RES_OBJECT(x) ((x)->objects.objects_val)
+%#define NIS_RES_COOKIE(x) ((x)->cookie)
+%#define NIS_RES_STATUS(x) ((x)->status)
+%
+%/* These defines make getting at the variant part of the object easier. */
+%#define TA_data zo_data.objdata_u.ta_data
+%#define EN_data zo_data.objdata_u.en_data
+%#define DI_data zo_data.objdata_u.di_data
+%#define LI_data zo_data.objdata_u.li_data
+%#define GR_data zo_data.objdata_u.gr_data
+%
+%#define __type_of(o) ((o)->zo_data.zo_type)
+%
+%/* Declarations for the internal subroutines in nislib.c */
+%enum name_pos {SAME_NAME, HIGHER_NAME, LOWER_NAME, NOT_SEQUENTIAL, BAD_NAME};
+%typedef enum name_pos name_pos;
+%
+%/*
+% * Defines for getting at column data in entry objects. Because RPCGEN
+% * generates some rather wordy structures, we create some defines that
+% * collapse the needed keystrokes to access a particular value using
+% * these definitions they take an nis_object *, and an int and return
+% * a u_char * for Value, and an int for length.
+% */
+%#define ENTRY_VAL(obj, col) \
+% (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_val
+%#define ENTRY_LEN(obj, col) \
+% (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_len
+%
+%
+%
+%#ifdef __cplusplus
+%}
+%#endif
+%
+%/* Prototypes, and extern declarations for the NIS library functions. */
+%#include <rpcsvc/nislib.h>
+%#endif /* __NIS_RPCGEN_H */
+%/* EDIT_START */
+%
+%/*
+% * nis_3.h
+% *
+% * This file contains definitions that are only of interest to the actual
+% * service daemon and client stubs. Normal users of NIS will not include
+% * this file.
+% *
+% * NOTE : This include file is automatically created by a combination
+% * of rpcgen and sed. DO NOT EDIT IT, change the nis.x file instead
+% * and then remake this file.
+% */
+%#ifndef __nis_3_h
+%#define __nis_3_h
+%#ifdef __cplusplus
+%extern "C" {
+%#endif
+#endif
diff --git a/sysroot/usr/include/rpcsvc/nis_callback.h b/sysroot/usr/include/rpcsvc/nis_callback.h
new file mode 100644
index 0000000..eca4ed9
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/nis_callback.h
@@ -0,0 +1,71 @@
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user or with the express written consent of
+ * Sun Microsystems, Inc.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+#ifndef _RPCSVC_NIS_CALLBACK_H
+#define _RPCSVC_NIS_CALLBACK_H 1
+
+#include <rpc/rpc.h>
+#include <rpcsvc/nis.h>
+
+__BEGIN_DECLS
+
+typedef nis_object *obj_p;
+
+struct cback_data {
+ struct {
+ u_int entries_len;
+ obj_p *entries_val;
+ } entries;
+};
+typedef struct cback_data cback_data;
+
+#define CB_PROG 100302
+#define CB_VERS 1
+
+#define CBPROC_RECEIVE 1
+extern bool_t * cbproc_receive_1 (cback_data *, CLIENT *) __THROW;
+extern bool_t * cbproc_receive_1_svc (cback_data *, struct svc_req *) __THROW;
+
+#define CBPROC_FINISH 2
+extern void * cbproc_finish_1 (void *, CLIENT *) __THROW;
+extern void * cbproc_finish_1_svc (void *, struct svc_req *) __THROW;
+
+#define CBPROC_ERROR 3
+extern void * cbproc_error_1 (nis_error *, CLIENT *) __THROW;
+extern void * cbproc_error_1_svc (nis_error *, struct svc_req *) __THROW;
+extern int cb_prog_1_freeresult (SVCXPRT *, xdrproc_t, caddr_t) __THROW;
+
+/* the xdr functions */
+
+extern bool_t xdr_obj_p (XDR *, obj_p*) __THROW;
+extern bool_t xdr_cback_data (XDR *, cback_data*) __THROW;
+
+__END_DECLS
+
+#endif /* !_RPCVSC_NIS_CALLBACK_H */
diff --git a/sysroot/usr/include/rpcsvc/nis_callback.x b/sysroot/usr/include/rpcsvc/nis_callback.x
new file mode 100644
index 0000000..4817865
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/nis_callback.x
@@ -0,0 +1,65 @@
+%/*
+% * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+% * unrestricted use provided that this legend is included on all tape
+% * media and as a part of the software program in whole or part. Users
+% * may copy or modify Sun RPC without charge, but are not authorized
+% * to license or distribute it to anyone else except as part of a product or
+% * program developed by the user or with the express written consent of
+% * Sun Microsystems, Inc.
+% *
+% * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+% * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+% * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+% *
+% * Sun RPC is provided with no support and without any obligation on the
+% * part of Sun Microsystems, Inc. to assist in its use, correction,
+% * modification or enhancement.
+% *
+% * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+% * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+% * OR ANY PART THEREOF.
+% *
+% * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+% * or profits or other special, indirect and consequential damages, even if
+% * Sun has been advised of the possibility of such damages.
+% *
+% * Sun Microsystems, Inc.
+% * 2550 Garcia Avenue
+% * Mountain View, California 94043
+% */
+
+/*
+ * nis_callback.x
+ *
+ * Copyright (c) 1988-1992 Sun Microsystems Inc
+ * All Rights Reserved.
+ */
+
+%#pragma ident "@(#)nis_callback.x 1.7 94/05/03 SMI"
+
+/*
+ * "@(#)zns_cback.x 1.2 90/09/10 Copyr 1990 Sun Micro"
+ *
+ * RPCL description of the Callback Service.
+ */
+
+#ifdef RPC_HDR
+%#include <rpcsvc/nis.h>
+#endif
+#ifdef RPC_XDR
+%#include "nis_clnt.h"
+#endif
+
+typedef nis_object *obj_p;
+
+struct cback_data {
+ obj_p entries<>; /* List of objects */
+};
+
+program CB_PROG {
+ version CB_VERS {
+ bool CBPROC_RECEIVE(cback_data) = 1;
+ void CBPROC_FINISH(void) = 2;
+ void CBPROC_ERROR(nis_error) = 3;
+ } = 1;
+} = 100302;
diff --git a/sysroot/usr/include/rpcsvc/nis_object.x b/sysroot/usr/include/rpcsvc/nis_object.x
new file mode 100644
index 0000000..43e7688
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/nis_object.x
@@ -0,0 +1,302 @@
+/*
+ * nis_object.x
+ *
+ * Copyright (c) 1988-1992 Sun Microsystems Inc
+ * All Rights Reserved.
+ */
+
+%#pragma ident "@(#)nis_object.x 1.12 97/11/19 SMI"
+
+#if RPC_HDR
+%
+%#ifndef __nis_object_h
+%#define __nis_object_h
+%
+#endif
+/*
+ * This file defines the format for a NIS object in RPC language.
+ * It is included by the main .x file and the database access protocol
+ * file. It is common because both of them need to deal with the same
+ * type of object. Generating the actual code though is a bit messy because
+ * the nis.x file and the nis_dba.x file will generate xdr routines to
+ * encode/decode objects when only one set is needed. Such is life when
+ * one is using rpcgen.
+ *
+ * Note, the protocol doesn't specify any limits on such things as
+ * maximum name length, number of attributes, etc. These are enforced
+ * by the database backend. When you hit them you will no. Also see
+ * the db_getlimits() function for fetching the limit values.
+ *
+ */
+
+/* Some manifest constants, chosen to maximize flexibility without
+ * plugging the wire full of data.
+ */
+const NIS_MAXSTRINGLEN = 255;
+const NIS_MAXNAMELEN = 1024;
+const NIS_MAXATTRNAME = 32;
+const NIS_MAXATTRVAL = 2048;
+const NIS_MAXCOLUMNS = 64;
+const NIS_MAXATTR = 16;
+const NIS_MAXPATH = 1024;
+const NIS_MAXREPLICAS = 128;
+const NIS_MAXLINKS = 16;
+
+const NIS_PK_NONE = 0; /* no public key (unix/sys auth) */
+const NIS_PK_DH = 1; /* Public key is Diffie-Hellman type */
+const NIS_PK_RSA = 2; /* Public key if RSA type */
+const NIS_PK_KERB = 3; /* Use kerberos style authentication */
+const NIS_PK_DHEXT = 4; /* Extended Diffie-Hellman for RPC-GSS */
+
+/*
+ * The fundamental name type of NIS. The name may consist of two parts,
+ * the first being the fully qualified name, and the second being an
+ * optional set of attribute/value pairs.
+ */
+struct nis_attr {
+ string zattr_ndx<>; /* name of the index */
+ opaque zattr_val<>; /* Value for the attribute. */
+};
+
+typedef string nis_name<>; /* The NIS name itself. */
+
+/* NIS object types are defined by the following enumeration. The numbers
+ * they use are based on the following scheme :
+ * 0 - 1023 are reserved for Sun,
+ * 1024 - 2047 are defined to be private to a particular tree.
+ * 2048 - 4095 are defined to be user defined.
+ * 4096 - ... are reserved for future use.
+ *
+ * EOL Alert - The non-prefixed names are present for backward
+ * compatability only, and will not exist in future releases. Use
+ * the NIS_* names for future compatability.
+ */
+
+enum zotypes {
+
+ BOGUS_OBJ = 0, /* Uninitialized object structure */
+ NO_OBJ = 1, /* NULL object (no data) */
+ DIRECTORY_OBJ = 2, /* Directory object describing domain */
+ GROUP_OBJ = 3, /* Group object (a list of names) */
+ TABLE_OBJ = 4, /* Table object (a database schema) */
+ ENTRY_OBJ = 5, /* Entry object (a database record) */
+ LINK_OBJ = 6, /* A name link. */
+ PRIVATE_OBJ = 7, /* Private object (all opaque data) */
+
+ NIS_BOGUS_OBJ = 0, /* Uninitialized object structure */
+ NIS_NO_OBJ = 1, /* NULL object (no data) */
+ NIS_DIRECTORY_OBJ = 2, /* Directory object describing domain */
+ NIS_GROUP_OBJ = 3, /* Group object (a list of names) */
+ NIS_TABLE_OBJ = 4, /* Table object (a database schema) */
+ NIS_ENTRY_OBJ = 5, /* Entry object (a database record) */
+ NIS_LINK_OBJ = 6, /* A name link. */
+ NIS_PRIVATE_OBJ = 7 /* Private object (all opaque data) */
+};
+
+/*
+ * The types of Name services NIS knows about. They are enumerated
+ * here. The Binder code will use this type to determine if it has
+ * a set of library routines that will access the indicated name service.
+ */
+enum nstype {
+ UNKNOWN = 0,
+ NIS = 1, /* Nis Plus Service */
+ SUNYP = 2, /* Old NIS Service */
+ IVY = 3, /* Nis Plus Plus Service */
+ DNS = 4, /* Domain Name Service */
+ X500 = 5, /* ISO/CCCIT X.500 Service */
+ DNANS = 6, /* Digital DECNet Name Service */
+ XCHS = 7, /* Xerox ClearingHouse Service */
+ CDS= 8
+};
+
+/*
+ * DIRECTORY - The name service object. These objects identify other name
+ * servers that are serving some portion of the name space. Each has a
+ * type associated with it. The resolver library will note whether or not
+ * is has the needed routines to access that type of service.
+ * The oarmask structure defines an access rights mask on a per object
+ * type basis for the name spaces. The only bits currently used are
+ * create and destroy. By enabling or disabling these access rights for
+ * a specific object type for a one of the accessor entities (owner,
+ * group, world) the administrator can control what types of objects
+ * may be freely added to the name space and which require the
+ * administrator's approval.
+ */
+struct oar_mask {
+ uint32_t oa_rights; /* Access rights mask */
+ zotypes oa_otype; /* Object type */
+};
+
+struct endpoint {
+ string uaddr<>;
+ string family<>; /* Transport family (INET, OSI, etc) */
+ string proto<>; /* Protocol (TCP, UDP, CLNP, etc) */
+};
+
+/*
+ * Note: pkey is a netobj which is limited to 1024 bytes which limits the
+ * keysize to 8192 bits. This is consider to be a reasonable limit for
+ * the expected lifetime of this service.
+ */
+struct nis_server {
+ nis_name name; /* Principal name of the server */
+ endpoint ep<>; /* Universal addr(s) for server */
+ uint32_t key_type; /* Public key type */
+ netobj pkey; /* server's public key */
+};
+
+struct directory_obj {
+ nis_name do_name; /* Name of the directory being served */
+ nstype do_type; /* one of NIS, DNS, IVY, YP, or X.500 */
+ nis_server do_servers<>; /* <0> == Primary name server */
+ uint32_t do_ttl; /* Time To Live (for caches) */
+ oar_mask do_armask<>; /* Create/Destroy rights by object type */
+};
+
+/*
+ * ENTRY - This is one row of data from an information base.
+ * The type value is used by the client library to convert the entry to
+ * it's internal structure representation. The Table name is a back pointer
+ * to the table where the entry is stored. This allows the client library
+ * to determine where to send a request if the client wishes to change this
+ * entry but got to it through a LINK rather than directly.
+ * If the entry is a "standalone" entry then this field is void.
+ */
+const EN_BINARY = 1; /* Indicates value is binary data */
+const EN_CRYPT = 2; /* Indicates the value is encrypted */
+const EN_XDR = 4; /* Indicates the value is XDR encoded */
+const EN_MODIFIED = 8; /* Indicates entry is modified. */
+const EN_ASN1 = 64; /* Means contents use ASN.1 encoding */
+
+struct entry_col {
+ uint32_t ec_flags; /* Flags for this value */
+ opaque ec_value<>; /* It's textual value */
+};
+
+struct entry_obj {
+ string en_type<>; /* Type of entry such as "passwd" */
+ entry_col en_cols<>; /* Value for the entry */
+};
+
+/*
+ * GROUP - The group object contains a list of NIS principal names. Groups
+ * are used to authorize principals. Each object has a set of access rights
+ * for members of its group. Principal names in groups are in the form
+ * name.directory and recursive groups are expressed as @groupname.directory
+ */
+struct group_obj {
+ uint32_t gr_flags; /* Flags controlling group */
+ nis_name gr_members<>; /* List of names in group */
+};
+
+/*
+ * LINK - This is the LINK object. It is quite similar to a symbolic link
+ * in the UNIX filesystem. The attributes in the main object structure are
+ * relative to the LINK data and not what it points to (like the file system)
+ * "modify" privleges here indicate the right to modify what the link points
+ * at and not to modify that actual object pointed to by the link.
+ */
+struct link_obj {
+ zotypes li_rtype; /* Real type of the object */
+ nis_attr li_attrs<>; /* Attribute/Values for tables */
+ nis_name li_name; /* The object's real NIS name */
+};
+
+/*
+ * TABLE - This is the table object. It implements a simple
+ * data base that applications and use for configuration or
+ * administration purposes. The role of the table is to group together
+ * a set of related entries. Tables are the simple database component
+ * of NIS. Like many databases, tables are logically divided into columns
+ * and rows. The columns are labeled with indexes and each ENTRY makes
+ * up a row. Rows may be addressed within the table by selecting one
+ * or more indexes, and values for those indexes. Each row which has
+ * a value for the given index that matches the desired value is returned.
+ * Within the definition of each column there is a flags variable, this
+ * variable contains flags which determine whether or not the column is
+ * searchable, contains binary data, and access rights for the entry objects
+ * column value.
+ */
+
+const TA_BINARY = 1; /* Means table data is binary */
+const TA_CRYPT = 2; /* Means value should be encrypted */
+const TA_XDR = 4; /* Means value is XDR encoded */
+const TA_SEARCHABLE = 8; /* Means this column is searchable */
+const TA_CASE = 16; /* Means this column is Case Sensitive */
+const TA_MODIFIED = 32; /* Means this columns attrs are modified*/
+const TA_ASN1 = 64; /* Means contents use ASN.1 encoding */
+
+struct table_col {
+ string tc_name<64>; /* Column Name */
+ uint32_t tc_flags; /* control flags */
+ uint32_t tc_rights; /* Access rights mask */
+};
+
+struct table_obj {
+ string ta_type<64>; /* Table type such as "passwd" */
+ int ta_maxcol; /* Total number of columns */
+ u_char ta_sep; /* Separator character */
+ table_col ta_cols<>; /* The number of table indexes */
+ string ta_path<>; /* A search path for this table */
+};
+
+/*
+ * This union joins together all of the currently known objects.
+ */
+union objdata switch (zotypes zo_type) {
+ case NIS_DIRECTORY_OBJ :
+ struct directory_obj di_data;
+ case NIS_GROUP_OBJ :
+ struct group_obj gr_data;
+ case NIS_TABLE_OBJ :
+ struct table_obj ta_data;
+ case NIS_ENTRY_OBJ:
+ struct entry_obj en_data;
+ case NIS_LINK_OBJ :
+ struct link_obj li_data;
+ case NIS_PRIVATE_OBJ :
+ opaque po_data<>;
+ case NIS_NO_OBJ :
+ void;
+ case NIS_BOGUS_OBJ :
+ void;
+ default :
+ void;
+};
+
+/*
+ * This is the basic NIS object data type. It consists of a generic part
+ * which all objects contain, and a specialized part which varies depending
+ * on the type of the object. All of the specialized sections have been
+ * described above. You might have wondered why they all start with an
+ * integer size, followed by the useful data. The answer is, when the
+ * server doesn't recognize the type returned it treats it as opaque data.
+ * And the definition for opaque data is {int size; char *data;}. In this
+ * way, servers and utility routines that do not understand a given type
+ * may still pass it around. One has to be careful in setting
+ * this variable accurately, it must take into account such things as
+ * XDR padding of structures etc. The best way to set it is to note one's
+ * position in the XDR encoding stream, encode the structure, look at the
+ * new position and calculate the size.
+ */
+struct nis_oid {
+ uint32_t ctime; /* Time of objects creation */
+ uint32_t mtime; /* Time of objects modification */
+};
+
+struct nis_object {
+ nis_oid zo_oid; /* object identity verifier. */
+ nis_name zo_name; /* The NIS name for this object */
+ nis_name zo_owner; /* NIS name of object owner. */
+ nis_name zo_group; /* NIS name of access group. */
+ nis_name zo_domain; /* The administrator for the object */
+ uint32_t zo_access; /* Access rights (owner, group, world) */
+ uint32_t zo_ttl; /* Object's time to live in seconds. */
+ objdata zo_data; /* Data structure for this type */
+};
+#if RPC_HDR
+%
+%#endif /* if __nis_object_h */
+%
+#endif
diff --git a/sysroot/usr/include/rpcsvc/nis_tags.h b/sysroot/usr/include/rpcsvc/nis_tags.h
new file mode 100644
index 0000000..9a24188
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/nis_tags.h
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 1991, Sun Microsystems Inc.
+ */
+
+/*
+ * nis_tags.h
+ *
+ * This file contains the tags and statistics definitions. It is
+ * automatically included by nis.h
+ */
+
+#ifndef _RPCSVC_NIS_TAGS_H
+#define _RPCSVC_NIS_TAGS_H
+
+#if 0
+#pragma ident "@(#)nis_tags.h 1.16 96/10/25 SMI"
+#endif
+/* from file: zns_tags.h 1.7 Copyright (c) 1990 Sun Microsystems */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#define NIS_DIR "data"
+
+/* Lookup and List function flags */
+#define FOLLOW_LINKS (1<<0) /* Follow link objects */
+#define FOLLOW_PATH (1<<1) /* Follow the path in a table */
+#define HARD_LOOKUP (1<<2) /* Block until successful */
+#define ALL_RESULTS (1<<3) /* Retrieve all results */
+#define NO_CACHE (1<<4) /* Do not return 'cached' results */
+#define MASTER_ONLY (1<<5) /* Get value only from master server */
+#define EXPAND_NAME (1<<6) /* Expand partitially qualified names */
+
+/* Semantic modification for table operations flags */
+#define RETURN_RESULT (1<<7) /* Return resulting object to client */
+#define ADD_OVERWRITE (1<<8) /* Allow overwrites on ADD */
+#define REM_MULTIPLE (1<<9) /* Allow wildcard deletes */
+#define MOD_SAMEOBJ (1<<10) /* Check modified object before write */
+#define ADD_RESERVED (1<<11) /* Spare ADD semantic */
+#define REM_RESERVED (1<<12) /* Spare REM semantic */
+#define MOD_EXCLUSIVE (1<<13) /* Modify no overwrite on modified keys */
+
+/* Lookup and List function flags (continued) */
+#define SOFT_LOOKUP (1<<14) /* The "old default" return on failure */
+
+/* Transport specific modifications to the operation */
+#define USE_DGRAM (1<<16) /* Use a datagram transport */
+#define NO_AUTHINFO (1<<17) /* Don't bother attaching auth info */
+
+/*
+ * Declarations for "standard" NIS+ tags
+ * State variable tags have values 0 - 2047
+ * Statistic tags have values 2048 - 65535
+ * User Tags have values >2^16
+ */
+#define TAG_DEBUG 1 /* set debug level */
+#define TAG_STATS 2 /* Enable/disable statistics */
+#define TAG_GCACHE 3 /* Flush the Group Cache */
+#define TAG_GCACHE_ALL TAG_GCACHE
+#define TAG_DCACHE 4 /* Flush the directory cache */
+#define TAG_DCACHE_ONE TAG_DCACHE
+#define TAG_OCACHE 5 /* Flush the Object Cache */
+#define TAG_SECURE 6 /* Set the security level */
+#define TAG_TCACHE_ONE 7 /* Flush the table cache */
+#define TAG_DCACHE_ALL 8 /* Flush entire directory cache */
+#define TAG_TCACHE_ALL 9 /* Flush entire table cache */
+#define TAG_GCACHE_ONE 10 /* Flush one group object */
+#define TAG_DCACHE_ONE_REFRESH 11 /* Flush and refresh one DO */
+#define TAG_READONLY 12 /* Set read only mode */
+#define TAG_READWRITE 14 /* Reset read-write mode */
+
+#define TAG_OPSTATS 2048 /* NIS+ operations statistics */
+#define TAG_THREADS 2049 /* Child process/thread status */
+#define TAG_HEAP 2050 /* Heap usage statistics */
+#define TAG_UPDATES 2051 /* Updates to this service */
+#define TAG_VISIBLE 2052 /* First update that isn't replicated */
+#define TAG_S_DCACHE 2053 /* Directory cache statistics */
+#define TAG_S_OCACHE 2054 /* Object cache statistics */
+#define TAG_S_GCACHE 2055 /* Group cache statistics */
+#define TAG_S_STORAGE 2056 /* Group cache statistics */
+#define TAG_UPTIME 2057 /* Time that server has been up */
+#define TAG_DIRLIST 2058 /* Dir served by this server */
+#define TAG_NISCOMPAT 2059 /* Whether supports NIS compat mode */
+#define TAG_DNSFORWARDING 2060 /* Whether DNS forwarding supported */
+#define TAG_SECURITY_LEVEL 2061 /* Security level of the server */
+#define TAG_ROOTSERVER 2062 /* Whether root server */
+
+/*
+ * Declarations for the Group object flags. Currently
+ * there are only 3.
+ */
+#define IMPMEM_GROUPS 1 /* Implicit Membership allowed */
+#define RECURS_GROUPS 2 /* Recursive Groups allowed */
+#define NEGMEM_GROUPS 4 /* Negative Groups allowed */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _RPCSVC_NIS_TAGS_H */
diff --git a/sysroot/usr/include/rpcsvc/nislib.h b/sysroot/usr/include/rpcsvc/nislib.h
new file mode 100644
index 0000000..c8927ec
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/nislib.h
@@ -0,0 +1,287 @@
+/* Copyright (C) 1997, 1998, 1999, 2006, 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Thorsten Kukuk <kukuk@suse.de>, 1997.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef __RPCSVC_NISLIB_H__
+#define __RPCSVC_NISLIB_H__
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+typedef const char *const_nis_name;
+
+/* nis_names: These functions are used to locate and manipulate all NIS+
+ * objects except the NIS+ entry objects.
+ *
+ * nis_lookup (name, flags) resolves a NIS+ name and returns a copy of
+ * that object from a NIS+ server.
+ * const nis_name name: name of the object to be resolved
+ * unsigned int flags: logically ORing zero or more flags (FOLLOW_LINKS,
+ * HARD_LOOKUP, [NO_CACHE], MASTER_ONLY, EXPAND_NAME)
+ *
+ * nis_add (name, obj) adds objects to the NIS+ namespace.
+ * const nis_name name: fully qualified NIS+ name.
+ * const nis_object *obj: object members zo_name and zo_domain will be
+ * constructed from name.
+ *
+ * nis_remove (name, obj) removes objects from the NIS+ namespace.
+ * const nis_name name: fully qualified NIS+ name.
+ * const nis_object *obj: if not NULL, it is assumed to point to a copy
+ * of the object being removed. In this case, if
+ * the object on the server does not have the same
+ * object identifier as the object being passed,
+ * the operation will fail with the NIS_NOTSAMEOBJ
+ * error.
+ *
+ * nis_modify (name, obj) can change specific attributes of an object
+ * that already exists in the namespace.
+ */
+extern nis_result *nis_lookup (const_nis_name name, unsigned int flags)
+ __THROW;
+extern nis_result *nis_add (const_nis_name name, const nis_object *obj)
+ __THROW;
+extern nis_result *nis_remove (const_nis_name name,
+ const nis_object *obj) __THROW;
+extern nis_result *nis_modify (const_nis_name name,
+ const nis_object *obj) __THROW;
+
+/* nis_tables: These functions are used to search and modify NIS+ tables.
+ *
+ * nis_list (table_name, flags, callback(table_name, obj, userdata), userdata)
+ * search a table in the NIS+ namespace.
+ * const nis_name table_name: indexed name ([xx=yy],table.dir)
+ * unsigned int flags: logically ORing one or more flags (FOLLOW_LINKS,
+ * [FOLLOW_PATH], HARD_LOOKUP, [ALL_RESULTS], [NO_CACHE],
+ * MASTER_ONLY, EXPAND_NAME, RETURN_RESULT)
+ * callback(): callback is an optional pointer to a function that will
+ * process the ENTRY type objects that are returned from the
+ * search. If this pointer is NULL, then all entries that match
+ * the search criteria are returned in the nis_result structure,
+ * otherwise this function will be called once for each
+ * entry returned.
+ * void *userdata: passed to callback function along with the returned
+ * entry object.
+ *
+ * nis_add_entry (table_name, obj, flags) will add the NIS+ object to the
+ * NIS+ table_name.
+ * const nis_name table_name
+ * const nis_object *obj
+ * unsigned int flags: 0, ADD_OVERWRITE, RETURN_RESULT
+ *
+ * nis_modify_entry (name, obj, flags) modifies an object identified by name.
+ * const nis_name name: object identifier
+ * const nis_object *obj: should point to an entry with the EN_MODIFIED
+ * flag set in each column that contains new
+ * information.
+ * unsigned int flags: 0, MOD_SAMEOBJ, RETURN_RESULT
+ *
+ * nis_remove_entry (table_name, obj, flags) removes a set of entries
+ * identified by table_name from the table.
+ * const nis_name table_name: indexed NIS+ name
+ * const nis_object *obj: if obj is non-null, it is presumed to point to
+ * a cached copy of the entry. When the removal is
+ * attempted, and the object that would be removed
+ * is not the same as the cached object pointed to
+ * by object then the operation will fail with an
+ * NIS_NOTSAMEOBJ error
+ * unsigned int flags: 0, REM_MULTIPLE
+ *
+ * nis_first_entry (table_name) fetches entries from a table one at a time.
+ * const nis_name table_name
+ *
+ * nis_next_entry (table_name, cookie) retrieves the "next" entry from a
+ * table specified by table_name.
+ * const nis_name table_name:
+ * const netobj *cookie: The value of cookie from the nis_result structure
+ * form the previous call.
+ */
+extern nis_result *nis_list (const_nis_name name, unsigned int flags,
+ int (*callback)(const_nis_name table_name,
+ const nis_object *obj,
+ const void *userdata),
+ const void *userdata) __THROW;
+extern nis_result *nis_add_entry (const_nis_name table_name,
+ const nis_object *obj,
+ unsigned int flags) __THROW;
+extern nis_result *nis_modify_entry (const_nis_name name,
+ const nis_object *obj,
+ unsigned int flags) __THROW;
+extern nis_result *nis_remove_entry (const_nis_name table_name,
+ const nis_object *obj,
+ unsigned int flags) __THROW;
+extern nis_result *nis_first_entry (const_nis_name table_name) __THROW;
+extern nis_result *nis_next_entry (const_nis_name table_name,
+ const netobj *cookie) __THROW;
+/*
+** nis_server
+*/
+extern nis_error nis_mkdir (const_nis_name dirname,
+ const nis_server *machine) __THROW;
+extern nis_error nis_rmdir (const_nis_name dirname,
+ const nis_server *machine) __THROW;
+extern nis_error nis_servstate (const nis_server *machine,
+ const nis_tag *tags, int numtags,
+ nis_tag **result) __THROW;
+extern nis_error nis_stats (const nis_server *machine,
+ const nis_tag *tags, int numtags,
+ nis_tag **result) __THROW;
+extern void nis_freetags (nis_tag *tags, int numtags) __THROW;
+extern nis_server **nis_getservlist (const_nis_name dirname) __THROW;
+extern void nis_freeservlist (nis_server **machines) __THROW;
+
+/*
+** nis_subr
+*/
+extern nis_name nis_leaf_of (const_nis_name name) __THROW;
+extern nis_name nis_leaf_of_r (const_nis_name name, char *buffer,
+ size_t buflen) __THROW;
+extern nis_name nis_name_of (const_nis_name name) __THROW;
+extern nis_name nis_name_of_r (const_nis_name name, char *buffer,
+ size_t buflen) __THROW;
+extern nis_name nis_domain_of (const_nis_name name) __THROW;
+extern nis_name nis_domain_of_r (const_nis_name name, char *buffer,
+ size_t buflen) __THROW;
+extern nis_name *nis_getnames (const_nis_name name) __THROW;
+extern void nis_freenames (nis_name *namelist) __THROW;
+extern name_pos nis_dir_cmp (const_nis_name n1, const_nis_name n2) __THROW;
+extern nis_object *nis_clone_object (const nis_object *src,
+ nis_object *dest) __THROW;
+extern void nis_destroy_object (nis_object *obj) __THROW;
+extern void nis_print_object (const nis_object *obj) __THROW;
+
+/*
+** nis_local_names
+*/
+extern nis_name nis_local_group (void) __THROW;
+extern nis_name nis_local_directory (void) __THROW;
+extern nis_name nis_local_principal (void) __THROW;
+extern nis_name nis_local_host (void) __THROW;
+
+/*
+** nis_error
+*/
+extern const char *nis_sperrno (const nis_error status) __THROW;
+extern void nis_perror (const nis_error status, const char *label) __THROW;
+extern void nis_lerror (const nis_error status, const char *label) __THROW;
+extern char *nis_sperror (const nis_error status, const char *label) __THROW;
+extern char *nis_sperror_r (const nis_error status, const char *label,
+ char *buffer, size_t buflen) __THROW;
+/*
+** nis_groups
+*/
+extern bool_t nis_ismember (const_nis_name principal,
+ const_nis_name group) __THROW;
+extern nis_error nis_addmember (const_nis_name member,
+ const_nis_name group) __THROW;
+extern nis_error nis_removemember (const_nis_name member,
+ const_nis_name group) __THROW;
+extern nis_error nis_creategroup (const_nis_name group,
+ unsigned int flags) __THROW;
+extern nis_error nis_destroygroup (const_nis_name group) __THROW;
+extern void nis_print_group_entry (const_nis_name group) __THROW;
+extern nis_error nis_verifygroup (const_nis_name group) __THROW;
+
+/*
+** nis_ping
+*/
+extern void nis_ping (const_nis_name dirname, uint32_t utime,
+ const nis_object *dirobj) __THROW;
+extern nis_result *nis_checkpoint (const_nis_name dirname) __THROW;
+
+/*
+** nis_print (XXX INTERNAL FUNCTIONS, SHOULD NOT BE USED !!)
+*/
+extern void nis_print_result (const nis_result *result) __THROW;
+extern void nis_print_rights (unsigned int rights) __THROW;
+extern void nis_print_directory (const directory_obj *dirobj) __THROW;
+extern void nis_print_group (const group_obj *grpobj) __THROW;
+extern void nis_print_table (const table_obj *tblobj) __THROW;
+extern void nis_print_link (const link_obj *lnkobj) __THROW;
+extern void nis_print_entry (const entry_obj *enobj) __THROW;
+
+/*
+** nis_file (XXX INTERNAL FUNCTIONS, SHOULD NOT BE USED !!)
+*/
+extern directory_obj *readColdStartFile (void) __THROW;
+extern bool_t writeColdStartFile (const directory_obj *dirobj) __THROW;
+extern nis_object *nis_read_obj (const char *obj) __THROW;
+extern bool_t nis_write_obj (const char *file, const nis_object *obj) __THROW;
+
+/*
+** nis_clone - (XXX INTERNAL FUNCTIONS, SHOULD NOT BE USED !!)
+*/
+extern directory_obj *nis_clone_directory (const directory_obj *src,
+ directory_obj *dest) __THROW;
+extern nis_result *nis_clone_result (const nis_result *src,
+ nis_result *dest) __THROW;
+
+/* nis_free - nis_freeresult */
+extern void nis_freeresult (nis_result *result) __THROW;
+/* (XXX THE FOLLOWING ARE INTERNAL FUNCTIONS, SHOULD NOT BE USED !!) */
+extern void nis_free_request (ib_request *req) __THROW;
+extern void nis_free_directory (directory_obj *dirobj) __THROW;
+extern void nis_free_object (nis_object *obj) __THROW;
+
+/* (XXX INTERNAL FUNCTIONS, SHOULD NOT BE USED !!) */
+extern nis_name __nis_default_owner (char *) __THROW;
+extern nis_name __nis_default_group (char *) __THROW;
+extern uint32_t __nis_default_ttl (char *) __THROW;
+extern unsigned int __nis_default_access (char *, unsigned int) __THROW;
+extern fd_result *__nis_finddirectory (directory_obj *, const_nis_name) __THROW;
+extern void __free_fdresult (fd_result *) __THROW;
+extern uint32_t __nis_hash (const void *keyarg, register size_t len) __THROW;
+
+/* NIS+ cache locking */
+extern int __nis_lock_cache (void) __THROW;
+extern int __nis_unlock_cache (void) __THROW;
+
+/* (XXX INTERNAL FUNCTIONS, ONLY FOR rpc.nisd AND glibc !!) */
+#if defined (NIS_INTERNAL) || defined (_LIBC)
+
+struct dir_binding
+{
+ CLIENT *clnt; /* RPC CLIENT handle */
+ nis_server *server_val; /* List of servers */
+ unsigned int server_len; /* # of servers */
+ unsigned int server_used; /* Which server we are bind in the moment ? */
+ unsigned int current_ep; /* Which endpoint of the server are in use? */
+ unsigned int trys; /* How many server have we tried ? */
+ unsigned int class; /* From which class is server_val ? */
+ bool_t master_only; /* Is only binded to the master */
+ bool_t use_auth; /* Do we use AUTH ? */
+ bool_t use_udp; /* Do we use UDP ? */
+ struct sockaddr_in addr; /* Server's IP address */
+ int socket; /* Server's local socket */
+};
+typedef struct dir_binding dir_binding;
+
+extern nis_error __nisbind_create (dir_binding *, const nis_server *,
+ unsigned int, unsigned int, unsigned int,
+ unsigned int) __THROW;
+extern nis_error __nisbind_connect (dir_binding *) __THROW;
+extern nis_error __nisbind_next (dir_binding *) __THROW;
+extern void __nisbind_destroy (dir_binding *) __THROW;
+extern nis_error __nisfind_server (const_nis_name, int, directory_obj **,
+ dir_binding *, unsigned int) __THROW;
+
+#endif
+
+__END_DECLS
+
+#endif /* __RPCSVC_NISLIB_H__ */
diff --git a/sysroot/usr/include/rpcsvc/nlm_prot.h b/sysroot/usr/include/rpcsvc/nlm_prot.h
new file mode 100644
index 0000000..5420a6c
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/nlm_prot.h
@@ -0,0 +1,330 @@
+/*
+ * Please do not edit this file.
+ * It was generated using rpcgen.
+ */
+
+#ifndef _NLM_PROT_H_RPCGEN
+#define _NLM_PROT_H_RPCGEN
+
+#include <rpc/rpc.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define LM_MAXSTRLEN 1024
+#define MAXNAMELEN LM_MAXSTRLEN+1
+
+enum nlm_stats {
+ nlm_granted = 0,
+ nlm_denied = 1,
+ nlm_denied_nolocks = 2,
+ nlm_blocked = 3,
+ nlm_denied_grace_period = 4,
+};
+typedef enum nlm_stats nlm_stats;
+
+struct nlm_holder {
+ bool_t exclusive;
+ int svid;
+ netobj oh;
+ u_int l_offset;
+ u_int l_len;
+};
+typedef struct nlm_holder nlm_holder;
+
+struct nlm_testrply {
+ nlm_stats stat;
+ union {
+ struct nlm_holder holder;
+ } nlm_testrply_u;
+};
+typedef struct nlm_testrply nlm_testrply;
+
+struct nlm_stat {
+ nlm_stats stat;
+};
+typedef struct nlm_stat nlm_stat;
+
+struct nlm_res {
+ netobj cookie;
+ nlm_stat stat;
+};
+typedef struct nlm_res nlm_res;
+
+struct nlm_testres {
+ netobj cookie;
+ nlm_testrply stat;
+};
+typedef struct nlm_testres nlm_testres;
+
+struct nlm_lock {
+ char *caller_name;
+ netobj fh;
+ netobj oh;
+ int svid;
+ u_int l_offset;
+ u_int l_len;
+};
+typedef struct nlm_lock nlm_lock;
+
+struct nlm_lockargs {
+ netobj cookie;
+ bool_t block;
+ bool_t exclusive;
+ struct nlm_lock alock;
+ bool_t reclaim;
+ int state;
+};
+typedef struct nlm_lockargs nlm_lockargs;
+
+struct nlm_cancargs {
+ netobj cookie;
+ bool_t block;
+ bool_t exclusive;
+ struct nlm_lock alock;
+};
+typedef struct nlm_cancargs nlm_cancargs;
+
+struct nlm_testargs {
+ netobj cookie;
+ bool_t exclusive;
+ struct nlm_lock alock;
+};
+typedef struct nlm_testargs nlm_testargs;
+
+struct nlm_unlockargs {
+ netobj cookie;
+ struct nlm_lock alock;
+};
+typedef struct nlm_unlockargs nlm_unlockargs;
+/*
+ * The following enums are actually bit encoded for efficient
+ * boolean algebra.... DON'T change them.....
+ */
+
+enum fsh_mode {
+ fsm_DN = 0,
+ fsm_DR = 1,
+ fsm_DW = 2,
+ fsm_DRW = 3,
+};
+typedef enum fsh_mode fsh_mode;
+
+enum fsh_access {
+ fsa_NONE = 0,
+ fsa_R = 1,
+ fsa_W = 2,
+ fsa_RW = 3,
+};
+typedef enum fsh_access fsh_access;
+
+struct nlm_share {
+ char *caller_name;
+ netobj fh;
+ netobj oh;
+ fsh_mode mode;
+ fsh_access access;
+};
+typedef struct nlm_share nlm_share;
+
+struct nlm_shareargs {
+ netobj cookie;
+ nlm_share share;
+ bool_t reclaim;
+};
+typedef struct nlm_shareargs nlm_shareargs;
+
+struct nlm_shareres {
+ netobj cookie;
+ nlm_stats stat;
+ int sequence;
+};
+typedef struct nlm_shareres nlm_shareres;
+
+struct nlm_notify {
+ char *name;
+ long state;
+};
+typedef struct nlm_notify nlm_notify;
+
+#define NLM_PROG 100021
+#define NLM_VERS 1
+
+#if defined(__STDC__) || defined(__cplusplus)
+#define NLM_TEST 1
+extern nlm_testres * nlm_test_1(struct nlm_testargs *, CLIENT *);
+extern nlm_testres * nlm_test_1_svc(struct nlm_testargs *, struct svc_req *);
+#define NLM_LOCK 2
+extern nlm_res * nlm_lock_1(struct nlm_lockargs *, CLIENT *);
+extern nlm_res * nlm_lock_1_svc(struct nlm_lockargs *, struct svc_req *);
+#define NLM_CANCEL 3
+extern nlm_res * nlm_cancel_1(struct nlm_cancargs *, CLIENT *);
+extern nlm_res * nlm_cancel_1_svc(struct nlm_cancargs *, struct svc_req *);
+#define NLM_UNLOCK 4
+extern nlm_res * nlm_unlock_1(struct nlm_unlockargs *, CLIENT *);
+extern nlm_res * nlm_unlock_1_svc(struct nlm_unlockargs *, struct svc_req *);
+#define NLM_GRANTED 5
+extern nlm_res * nlm_granted_1(struct nlm_testargs *, CLIENT *);
+extern nlm_res * nlm_granted_1_svc(struct nlm_testargs *, struct svc_req *);
+#define NLM_TEST_MSG 6
+extern void * nlm_test_msg_1(struct nlm_testargs *, CLIENT *);
+extern void * nlm_test_msg_1_svc(struct nlm_testargs *, struct svc_req *);
+#define NLM_LOCK_MSG 7
+extern void * nlm_lock_msg_1(struct nlm_lockargs *, CLIENT *);
+extern void * nlm_lock_msg_1_svc(struct nlm_lockargs *, struct svc_req *);
+#define NLM_CANCEL_MSG 8
+extern void * nlm_cancel_msg_1(struct nlm_cancargs *, CLIENT *);
+extern void * nlm_cancel_msg_1_svc(struct nlm_cancargs *, struct svc_req *);
+#define NLM_UNLOCK_MSG 9
+extern void * nlm_unlock_msg_1(struct nlm_unlockargs *, CLIENT *);
+extern void * nlm_unlock_msg_1_svc(struct nlm_unlockargs *, struct svc_req *);
+#define NLM_GRANTED_MSG 10
+extern void * nlm_granted_msg_1(struct nlm_testargs *, CLIENT *);
+extern void * nlm_granted_msg_1_svc(struct nlm_testargs *, struct svc_req *);
+#define NLM_TEST_RES 11
+extern void * nlm_test_res_1(nlm_testres *, CLIENT *);
+extern void * nlm_test_res_1_svc(nlm_testres *, struct svc_req *);
+#define NLM_LOCK_RES 12
+extern void * nlm_lock_res_1(nlm_res *, CLIENT *);
+extern void * nlm_lock_res_1_svc(nlm_res *, struct svc_req *);
+#define NLM_CANCEL_RES 13
+extern void * nlm_cancel_res_1(nlm_res *, CLIENT *);
+extern void * nlm_cancel_res_1_svc(nlm_res *, struct svc_req *);
+#define NLM_UNLOCK_RES 14
+extern void * nlm_unlock_res_1(nlm_res *, CLIENT *);
+extern void * nlm_unlock_res_1_svc(nlm_res *, struct svc_req *);
+#define NLM_GRANTED_RES 15
+extern void * nlm_granted_res_1(nlm_res *, CLIENT *);
+extern void * nlm_granted_res_1_svc(nlm_res *, struct svc_req *);
+extern int nlm_prog_1_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
+
+#else /* K&R C */
+#define NLM_TEST 1
+extern nlm_testres * nlm_test_1();
+extern nlm_testres * nlm_test_1_svc();
+#define NLM_LOCK 2
+extern nlm_res * nlm_lock_1();
+extern nlm_res * nlm_lock_1_svc();
+#define NLM_CANCEL 3
+extern nlm_res * nlm_cancel_1();
+extern nlm_res * nlm_cancel_1_svc();
+#define NLM_UNLOCK 4
+extern nlm_res * nlm_unlock_1();
+extern nlm_res * nlm_unlock_1_svc();
+#define NLM_GRANTED 5
+extern nlm_res * nlm_granted_1();
+extern nlm_res * nlm_granted_1_svc();
+#define NLM_TEST_MSG 6
+extern void * nlm_test_msg_1();
+extern void * nlm_test_msg_1_svc();
+#define NLM_LOCK_MSG 7
+extern void * nlm_lock_msg_1();
+extern void * nlm_lock_msg_1_svc();
+#define NLM_CANCEL_MSG 8
+extern void * nlm_cancel_msg_1();
+extern void * nlm_cancel_msg_1_svc();
+#define NLM_UNLOCK_MSG 9
+extern void * nlm_unlock_msg_1();
+extern void * nlm_unlock_msg_1_svc();
+#define NLM_GRANTED_MSG 10
+extern void * nlm_granted_msg_1();
+extern void * nlm_granted_msg_1_svc();
+#define NLM_TEST_RES 11
+extern void * nlm_test_res_1();
+extern void * nlm_test_res_1_svc();
+#define NLM_LOCK_RES 12
+extern void * nlm_lock_res_1();
+extern void * nlm_lock_res_1_svc();
+#define NLM_CANCEL_RES 13
+extern void * nlm_cancel_res_1();
+extern void * nlm_cancel_res_1_svc();
+#define NLM_UNLOCK_RES 14
+extern void * nlm_unlock_res_1();
+extern void * nlm_unlock_res_1_svc();
+#define NLM_GRANTED_RES 15
+extern void * nlm_granted_res_1();
+extern void * nlm_granted_res_1_svc();
+extern int nlm_prog_1_freeresult ();
+#endif /* K&R C */
+#define NLM_VERSX 3
+
+#if defined(__STDC__) || defined(__cplusplus)
+#define NLM_SHARE 20
+extern nlm_shareres * nlm_share_3(nlm_shareargs *, CLIENT *);
+extern nlm_shareres * nlm_share_3_svc(nlm_shareargs *, struct svc_req *);
+#define NLM_UNSHARE 21
+extern nlm_shareres * nlm_unshare_3(nlm_shareargs *, CLIENT *);
+extern nlm_shareres * nlm_unshare_3_svc(nlm_shareargs *, struct svc_req *);
+#define NLM_NM_LOCK 22
+extern nlm_res * nlm_nm_lock_3(nlm_lockargs *, CLIENT *);
+extern nlm_res * nlm_nm_lock_3_svc(nlm_lockargs *, struct svc_req *);
+#define NLM_FREE_ALL 23
+extern void * nlm_free_all_3(nlm_notify *, CLIENT *);
+extern void * nlm_free_all_3_svc(nlm_notify *, struct svc_req *);
+extern int nlm_prog_3_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
+
+#else /* K&R C */
+#define NLM_SHARE 20
+extern nlm_shareres * nlm_share_3();
+extern nlm_shareres * nlm_share_3_svc();
+#define NLM_UNSHARE 21
+extern nlm_shareres * nlm_unshare_3();
+extern nlm_shareres * nlm_unshare_3_svc();
+#define NLM_NM_LOCK 22
+extern nlm_res * nlm_nm_lock_3();
+extern nlm_res * nlm_nm_lock_3_svc();
+#define NLM_FREE_ALL 23
+extern void * nlm_free_all_3();
+extern void * nlm_free_all_3_svc();
+extern int nlm_prog_3_freeresult ();
+#endif /* K&R C */
+
+/* the xdr functions */
+
+#if defined(__STDC__) || defined(__cplusplus)
+extern bool_t xdr_nlm_stats (XDR *, nlm_stats*);
+extern bool_t xdr_nlm_holder (XDR *, nlm_holder*);
+extern bool_t xdr_nlm_testrply (XDR *, nlm_testrply*);
+extern bool_t xdr_nlm_stat (XDR *, nlm_stat*);
+extern bool_t xdr_nlm_res (XDR *, nlm_res*);
+extern bool_t xdr_nlm_testres (XDR *, nlm_testres*);
+extern bool_t xdr_nlm_lock (XDR *, nlm_lock*);
+extern bool_t xdr_nlm_lockargs (XDR *, nlm_lockargs*);
+extern bool_t xdr_nlm_cancargs (XDR *, nlm_cancargs*);
+extern bool_t xdr_nlm_testargs (XDR *, nlm_testargs*);
+extern bool_t xdr_nlm_unlockargs (XDR *, nlm_unlockargs*);
+extern bool_t xdr_fsh_mode (XDR *, fsh_mode*);
+extern bool_t xdr_fsh_access (XDR *, fsh_access*);
+extern bool_t xdr_nlm_share (XDR *, nlm_share*);
+extern bool_t xdr_nlm_shareargs (XDR *, nlm_shareargs*);
+extern bool_t xdr_nlm_shareres (XDR *, nlm_shareres*);
+extern bool_t xdr_nlm_notify (XDR *, nlm_notify*);
+
+#else /* K&R C */
+extern bool_t xdr_nlm_stats ();
+extern bool_t xdr_nlm_holder ();
+extern bool_t xdr_nlm_testrply ();
+extern bool_t xdr_nlm_stat ();
+extern bool_t xdr_nlm_res ();
+extern bool_t xdr_nlm_testres ();
+extern bool_t xdr_nlm_lock ();
+extern bool_t xdr_nlm_lockargs ();
+extern bool_t xdr_nlm_cancargs ();
+extern bool_t xdr_nlm_testargs ();
+extern bool_t xdr_nlm_unlockargs ();
+extern bool_t xdr_fsh_mode ();
+extern bool_t xdr_fsh_access ();
+extern bool_t xdr_nlm_share ();
+extern bool_t xdr_nlm_shareargs ();
+extern bool_t xdr_nlm_shareres ();
+extern bool_t xdr_nlm_notify ();
+
+#endif /* K&R C */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !_NLM_PROT_H_RPCGEN */
diff --git a/sysroot/usr/include/rpcsvc/nlm_prot.x b/sysroot/usr/include/rpcsvc/nlm_prot.x
new file mode 100644
index 0000000..e60c931
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/nlm_prot.x
@@ -0,0 +1,179 @@
+/* @(#)nlm_prot.x 2.1 88/08/01 4.0 RPCSRC */
+/* @(#)nlm_prot.x 1.8 87/09/21 Copyr 1987 Sun Micro */
+
+/*
+ * Network lock manager protocol definition
+ * Copyright (C) 1986 Sun Microsystems, Inc.
+ *
+ * protocol used between local lock manager and remote lock manager
+ */
+
+#ifdef RPC_HDR
+%#define LM_MAXSTRLEN 1024
+%#define MAXNAMELEN LM_MAXSTRLEN+1
+#endif
+
+/*
+ * status of a call to the lock manager
+ */
+enum nlm_stats {
+ nlm_granted = 0,
+ nlm_denied = 1,
+ nlm_denied_nolocks = 2,
+ nlm_blocked = 3,
+ nlm_denied_grace_period = 4
+};
+
+struct nlm_holder {
+ bool exclusive;
+ int svid;
+ netobj oh;
+ unsigned l_offset;
+ unsigned l_len;
+};
+
+union nlm_testrply switch (nlm_stats stat) {
+ case nlm_denied:
+ struct nlm_holder holder;
+ default:
+ void;
+};
+
+struct nlm_stat {
+ nlm_stats stat;
+};
+
+struct nlm_res {
+ netobj cookie;
+ nlm_stat stat;
+};
+
+struct nlm_testres {
+ netobj cookie;
+ nlm_testrply stat;
+};
+
+struct nlm_lock {
+ string caller_name<LM_MAXSTRLEN>;
+ netobj fh; /* identify a file */
+ netobj oh; /* identify owner of a lock */
+ int svid; /* generated from pid for svid */
+ unsigned l_offset;
+ unsigned l_len;
+};
+
+struct nlm_lockargs {
+ netobj cookie;
+ bool block;
+ bool exclusive;
+ struct nlm_lock alock;
+ bool reclaim; /* used for recovering locks */
+ int state; /* specify local status monitor state */
+};
+
+struct nlm_cancargs {
+ netobj cookie;
+ bool block;
+ bool exclusive;
+ struct nlm_lock alock;
+};
+
+struct nlm_testargs {
+ netobj cookie;
+ bool exclusive;
+ struct nlm_lock alock;
+};
+
+struct nlm_unlockargs {
+ netobj cookie;
+ struct nlm_lock alock;
+};
+
+
+#ifdef RPC_HDR
+%/*
+% * The following enums are actually bit encoded for efficient
+% * boolean algebra.... DON'T change them.....
+% */
+#endif
+enum fsh_mode {
+ fsm_DN = 0, /* deny none */
+ fsm_DR = 1, /* deny read */
+ fsm_DW = 2, /* deny write */
+ fsm_DRW = 3 /* deny read/write */
+};
+
+enum fsh_access {
+ fsa_NONE = 0, /* for completeness */
+ fsa_R = 1, /* read only */
+ fsa_W = 2, /* write only */
+ fsa_RW = 3 /* read/write */
+};
+
+struct nlm_share {
+ string caller_name<LM_MAXSTRLEN>;
+ netobj fh;
+ netobj oh;
+ fsh_mode mode;
+ fsh_access access;
+};
+
+struct nlm_shareargs {
+ netobj cookie;
+ nlm_share share;
+ bool reclaim;
+};
+
+struct nlm_shareres {
+ netobj cookie;
+ nlm_stats stat;
+ int sequence;
+};
+
+struct nlm_notify {
+ string name<MAXNAMELEN>;
+ long state;
+};
+
+/*
+ * Over-the-wire protocol used between the network lock managers
+ */
+
+program NLM_PROG {
+ version NLM_VERS {
+
+ nlm_testres NLM_TEST(struct nlm_testargs) = 1;
+
+ nlm_res NLM_LOCK(struct nlm_lockargs) = 2;
+
+ nlm_res NLM_CANCEL(struct nlm_cancargs) = 3;
+ nlm_res NLM_UNLOCK(struct nlm_unlockargs) = 4;
+
+ /*
+ * remote lock manager call-back to grant lock
+ */
+ nlm_res NLM_GRANTED(struct nlm_testargs)= 5;
+ /*
+ * message passing style of requesting lock
+ */
+ void NLM_TEST_MSG(struct nlm_testargs) = 6;
+ void NLM_LOCK_MSG(struct nlm_lockargs) = 7;
+ void NLM_CANCEL_MSG(struct nlm_cancargs) =8;
+ void NLM_UNLOCK_MSG(struct nlm_unlockargs) = 9;
+ void NLM_GRANTED_MSG(struct nlm_testargs) = 10;
+ void NLM_TEST_RES(nlm_testres) = 11;
+ void NLM_LOCK_RES(nlm_res) = 12;
+ void NLM_CANCEL_RES(nlm_res) = 13;
+ void NLM_UNLOCK_RES(nlm_res) = 14;
+ void NLM_GRANTED_RES(nlm_res) = 15;
+ } = 1;
+
+ version NLM_VERSX {
+ nlm_shareres NLM_SHARE(nlm_shareargs) = 20;
+ nlm_shareres NLM_UNSHARE(nlm_shareargs) = 21;
+ nlm_res NLM_NM_LOCK(nlm_lockargs) = 22;
+ void NLM_FREE_ALL(nlm_notify) = 23;
+ } = 3;
+
+} = 100021;
+
diff --git a/sysroot/usr/include/rpcsvc/rex.h b/sysroot/usr/include/rpcsvc/rex.h
new file mode 100644
index 0000000..3c80ce7
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/rex.h
@@ -0,0 +1,227 @@
+/*
+ * Please do not edit this file.
+ * It was generated using rpcgen.
+ */
+
+#ifndef _REX_H_RPCGEN
+#define _REX_H_RPCGEN
+
+#include <rpc/rpc.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define STRINGSIZE 1024
+
+typedef char *rexstring;
+#define SIGINT 2
+#define REX_INTERACTIVE 1
+
+struct rex_start {
+ struct {
+ u_int rst_cmd_len;
+ rexstring *rst_cmd_val;
+ } rst_cmd;
+ rexstring rst_host;
+ rexstring rst_fsname;
+ rexstring rst_dirwithin;
+ struct {
+ u_int rst_env_len;
+ rexstring *rst_env_val;
+ } rst_env;
+ u_int rst_port0;
+ u_int rst_port1;
+ u_int rst_port2;
+ u_int rst_flags;
+};
+typedef struct rex_start rex_start;
+
+struct rex_result {
+ int rlt_stat;
+ rexstring rlt_message;
+};
+typedef struct rex_result rex_result;
+
+struct sgttyb {
+ u_int four;
+ char chars[4];
+ u_int flags;
+};
+typedef struct sgttyb sgttyb;
+#define B0 0
+#define B50 1
+#define B75 2
+#define B110 3
+#define B134 4
+#define B150 5
+#define B200 6
+#define B300 7
+#define B600 8
+#define B1200 9
+#define B1800 10
+#define B2400 11
+#define B4800 12
+#define B9600 13
+#define B19200 14
+#define B38400 15
+#define TANDEM 0x00000001
+#define CBREAK 0x00000002
+#define LCASE 0x00000004
+#define ECHO 0x00000008
+#define CRMOD 0x00000010
+#define RAW 0x00000020
+#define ODDP 0x00000040
+#define EVENP 0x00000080
+#define ANYP 0x000000c0
+#define NLDELAY 0x00000300
+#define NL0 0x00000000
+#define NL1 0x00000100
+#define NL2 0x00000200
+#define NL3 0x00000300
+#define TBDELAY 0x00000c00
+#define TAB0 0x00000000
+#define TAB1 0x00000400
+#define TAB2 0x00000800
+#define XTABS 0x00000c00
+#define CRDELAY 0x00003000
+#define CR0 0x00000000
+#define CR1 0x00001000
+#define CR2 0x00002000
+#define CR3 0x00003000
+#define VTDELAY 0x00004000
+#define FF0 0x00000000
+#define FF1 0x00004000
+#define BSDELAY 0x00008000
+#define BS0 0x00000000
+#define BS1 0x00008000
+#define CRTBS 0x00010000
+#define PRTERA 0x00020000
+#define CRTERA 0x00040000
+#define TILDE 0x00080000
+#define MDMBUF 0x00100000
+#define LITOUT 0x00200000
+#define TOSTOP 0x00400000
+#define FLUSHO 0x00800000
+#define NOHANG 0x01000000
+#define L001000 0x02000000
+#define CRTKIL 0x04000000
+#define PASS8 0x08000000
+#define CTLECH 0x10000000
+#define PENDIN 0x20000000
+#define DECCTQ 0x40000000
+#define NOFLSH 0x80000000
+
+struct tchars {
+ u_int six;
+ char chars[6];
+};
+typedef struct tchars tchars;
+
+struct ltchars {
+ u_int six;
+ char chars[6];
+ u_int mode;
+};
+typedef struct ltchars ltchars;
+
+struct rex_ttysize {
+ int ts_lines;
+ int ts_cols;
+};
+typedef struct rex_ttysize rex_ttysize;
+
+struct rex_ttymode {
+ sgttyb basic;
+ tchars more;
+ ltchars yetmore;
+ u_int andmore;
+};
+typedef struct rex_ttymode rex_ttymode;
+#define LCRTBS 0x0001
+#define LPRTERA 0x0002
+#define LCRTERA 0x0004
+#define LTILDE 0x0008
+#define LMDMBUF 0x0010
+#define LLITOUT 0x0020
+#define LTOSTOP 0x0040
+#define LFLUSHO 0x0080
+#define LNOHANG 0x0100
+#define LL001000 0x0200
+#define LCRTKIL 0x0400
+#define LPASS8 0x0800
+#define LCTLECH 0x1000
+#define LPENDIN 0x2000
+#define LDECCTQ 0x4000
+#define LNOFLSH 0x8000
+
+#define REXPROG 100017
+#define REXVERS 1
+
+#if defined(__STDC__) || defined(__cplusplus)
+#define REXPROC_START 1
+extern rex_result * rexproc_start_1(rex_start *, CLIENT *);
+extern rex_result * rexproc_start_1_svc(rex_start *, struct svc_req *);
+#define REXPROC_WAIT 2
+extern rex_result * rexproc_wait_1(void *, CLIENT *);
+extern rex_result * rexproc_wait_1_svc(void *, struct svc_req *);
+#define REXPROC_MODES 3
+extern void * rexproc_modes_1(rex_ttymode *, CLIENT *);
+extern void * rexproc_modes_1_svc(rex_ttymode *, struct svc_req *);
+#define REXPROC_WINCH 4
+extern void * rexproc_winch_1(rex_ttysize *, CLIENT *);
+extern void * rexproc_winch_1_svc(rex_ttysize *, struct svc_req *);
+#define REXPROC_SIGNAL 5
+extern void * rexproc_signal_1(int *, CLIENT *);
+extern void * rexproc_signal_1_svc(int *, struct svc_req *);
+extern int rexprog_1_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
+
+#else /* K&R C */
+#define REXPROC_START 1
+extern rex_result * rexproc_start_1();
+extern rex_result * rexproc_start_1_svc();
+#define REXPROC_WAIT 2
+extern rex_result * rexproc_wait_1();
+extern rex_result * rexproc_wait_1_svc();
+#define REXPROC_MODES 3
+extern void * rexproc_modes_1();
+extern void * rexproc_modes_1_svc();
+#define REXPROC_WINCH 4
+extern void * rexproc_winch_1();
+extern void * rexproc_winch_1_svc();
+#define REXPROC_SIGNAL 5
+extern void * rexproc_signal_1();
+extern void * rexproc_signal_1_svc();
+extern int rexprog_1_freeresult ();
+#endif /* K&R C */
+
+/* the xdr functions */
+
+#if defined(__STDC__) || defined(__cplusplus)
+extern bool_t xdr_rexstring (XDR *, rexstring*);
+extern bool_t xdr_rex_start (XDR *, rex_start*);
+extern bool_t xdr_rex_result (XDR *, rex_result*);
+extern bool_t xdr_sgttyb (XDR *, sgttyb*);
+extern bool_t xdr_tchars (XDR *, tchars*);
+extern bool_t xdr_ltchars (XDR *, ltchars*);
+extern bool_t xdr_rex_ttysize (XDR *, rex_ttysize*);
+extern bool_t xdr_rex_ttymode (XDR *, rex_ttymode*);
+
+#else /* K&R C */
+extern bool_t xdr_rexstring ();
+extern bool_t xdr_rex_start ();
+extern bool_t xdr_rex_result ();
+extern bool_t xdr_sgttyb ();
+extern bool_t xdr_tchars ();
+extern bool_t xdr_ltchars ();
+extern bool_t xdr_rex_ttysize ();
+extern bool_t xdr_rex_ttymode ();
+
+#endif /* K&R C */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !_REX_H_RPCGEN */
diff --git a/sysroot/usr/include/rpcsvc/rex.x b/sysroot/usr/include/rpcsvc/rex.x
new file mode 100644
index 0000000..949d9f0
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/rex.x
@@ -0,0 +1,229 @@
+/* @(#)rex.x 2.1 88/08/01 4.0 RPCSRC */
+/* @(#)rex.x 1.3 87/09/18 Copyr 1987 Sun Micro */
+
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+
+/*
+ * Remote execution (rex) protocol specification
+ */
+
+const STRINGSIZE = 1024;
+typedef string rexstring<1024>;
+
+/*
+ * values to pass to REXPROC_SIGNAL
+ */
+const SIGINT = 2; /* interrupt */
+
+/*
+ * Values for rst_flags, below
+ */
+const REX_INTERACTIVE = 1; /* interactive mode */
+
+struct rex_start {
+ rexstring rst_cmd<>; /* list of command and args */
+ rexstring rst_host; /* working directory host name */
+ rexstring rst_fsname; /* working directory file system name */
+ rexstring rst_dirwithin;/* working directory within file system */
+ rexstring rst_env<>; /* list of environment */
+ unsigned int rst_port0; /* port for stdin */
+ unsigned int rst_port1; /* port for stdout */
+ unsigned int rst_port2; /* port for stderr */
+ unsigned int rst_flags; /* options - see const above */
+};
+
+struct rex_result {
+ int rlt_stat; /* integer status code */
+ rexstring rlt_message; /* string message for human consumption */
+};
+
+
+struct sgttyb {
+ unsigned four; /* always equals 4 */
+ opaque chars[4];
+ /* chars[0] == input speed */
+ /* chars[1] == output speed */
+ /* chars[2] == kill character */
+ /* chars[3] == erase character */
+ unsigned flags;
+};
+/* values for speeds above (baud rates) */
+const B0 = 0;
+const B50 = 1;
+const B75 = 2;
+const B110 = 3;
+const B134 = 4;
+const B150 = 5;
+const B200 = 6;
+const B300 = 7;
+const B600 = 8;
+const B1200 = 9;
+const B1800 = 10;
+const B2400 = 11;
+const B4800 = 12;
+const B9600 = 13;
+const B19200 = 14;
+const B38400 = 15;
+
+/* values for flags above */
+const TANDEM = 0x00000001; /* send stopc on out q full */
+const CBREAK = 0x00000002; /* half-cooked mode */
+const LCASE = 0x00000004; /* simulate lower case */
+const ECHO = 0x00000008; /* echo input */
+const CRMOD = 0x00000010; /* map \r to \r\n on output */
+const RAW = 0x00000020; /* no i/o processing */
+const ODDP = 0x00000040; /* get/send odd parity */
+const EVENP = 0x00000080; /* get/send even parity */
+const ANYP = 0x000000c0; /* get any parity/send none */
+const NLDELAY = 0x00000300; /* \n delay */
+const NL0 = 0x00000000;
+const NL1 = 0x00000100; /* tty 37 */
+const NL2 = 0x00000200; /* vt05 */
+const NL3 = 0x00000300;
+const TBDELAY = 0x00000c00; /* horizontal tab delay */
+const TAB0 = 0x00000000;
+const TAB1 = 0x00000400; /* tty 37 */
+const TAB2 = 0x00000800;
+const XTABS = 0x00000c00; /* expand tabs on output */
+const CRDELAY = 0x00003000; /* \r delay */
+const CR0 = 0x00000000;
+const CR1 = 0x00001000; /* tn 300 */
+const CR2 = 0x00002000; /* tty 37 */
+const CR3 = 0x00003000; /* concept 100 */
+const VTDELAY = 0x00004000; /* vertical tab delay */
+const FF0 = 0x00000000;
+const FF1 = 0x00004000; /* tty 37 */
+const BSDELAY = 0x00008000; /* \b delay */
+const BS0 = 0x00000000;
+const BS1 = 0x00008000;
+const CRTBS = 0x00010000; /* do backspacing for crt */
+const PRTERA = 0x00020000; /* \ ... / erase */
+const CRTERA = 0x00040000; /* " \b " to wipe out char */
+const TILDE = 0x00080000; /* hazeltine tilde kludge */
+const MDMBUF = 0x00100000; /* start/stop output on carrier intr */
+const LITOUT = 0x00200000; /* literal output */
+const TOSTOP = 0x00400000; /* SIGTTOU on background output */
+const FLUSHO = 0x00800000; /* flush output to terminal */
+const NOHANG = 0x01000000; /* no SIGHUP on carrier drop */
+const L001000 = 0x02000000;
+const CRTKIL = 0x04000000; /* kill line with " \b " */
+const PASS8 = 0x08000000;
+const CTLECH = 0x10000000; /* echo control chars as ^X */
+const PENDIN = 0x20000000; /* tp->t_rawq needs reread */
+const DECCTQ = 0x40000000; /* only ^Q starts after ^S */
+const NOFLSH = 0x80000000; /* no output flush on signal */
+
+struct tchars {
+ unsigned six; /* always equals 6 */
+ opaque chars[6];
+ /* chars[0] == interrupt char */
+ /* chars[1] == quit char */
+ /* chars[2] == start output char */
+ /* chars[3] == stop output char */
+ /* chars[4] == end-of-file char */
+ /* chars[5] == input delimiter (like nl) */
+};
+
+struct ltchars {
+ unsigned six; /* always equals 6 */
+ opaque chars[6];
+ /* chars[0] == stop process signal */
+ /* chars[1] == delayed stop process signal */
+ /* chars[2] == reprint line */
+ /* chars[3] == flush output */
+ /* chars[4] == word erase */
+ /* chars[5] == literal next character */
+ unsigned mode;
+};
+
+struct rex_ttysize {
+ int ts_lines;
+ int ts_cols;
+};
+
+struct rex_ttymode {
+ sgttyb basic; /* standard unix tty flags */
+ tchars more; /* interrupt, kill characters, etc. */
+ ltchars yetmore; /* special Berkeley characters */
+ unsigned andmore; /* and Berkeley modes */
+};
+
+/* values for andmore above */
+const LCRTBS = 0x0001; /* do backspacing for crt */
+const LPRTERA = 0x0002; /* \ ... / erase */
+const LCRTERA = 0x0004; /* " \b " to wipe out char */
+const LTILDE = 0x0008; /* hazeltine tilde kludge */
+const LMDMBUF = 0x0010; /* start/stop output on carrier intr */
+const LLITOUT = 0x0020; /* literal output */
+const LTOSTOP = 0x0040; /* SIGTTOU on background output */
+const LFLUSHO = 0x0080; /* flush output to terminal */
+const LNOHANG = 0x0100; /* no SIGHUP on carrier drop */
+const LL001000 = 0x0200;
+const LCRTKIL = 0x0400; /* kill line with " \b " */
+const LPASS8 = 0x0800;
+const LCTLECH = 0x1000; /* echo control chars as ^X */
+const LPENDIN = 0x2000; /* needs reread */
+const LDECCTQ = 0x4000; /* only ^Q starts after ^S */
+const LNOFLSH = 0x8000; /* no output flush on signal */
+
+program REXPROG {
+ version REXVERS {
+
+ /*
+ * Start remote execution
+ */
+ rex_result
+ REXPROC_START(rex_start) = 1;
+
+ /*
+ * Wait for remote execution to terminate
+ */
+ rex_result
+ REXPROC_WAIT(void) = 2;
+
+ /*
+ * Send tty modes
+ */
+ void
+ REXPROC_MODES(rex_ttymode) = 3;
+
+ /*
+ * Send window size change
+ */
+ void
+ REXPROC_WINCH(rex_ttysize) = 4;
+
+ /*
+ * Send other signal
+ */
+ void
+ REXPROC_SIGNAL(int) = 5;
+ } = 1;
+} = 100017;
diff --git a/sysroot/usr/include/rpcsvc/rquota.h b/sysroot/usr/include/rpcsvc/rquota.h
new file mode 100644
index 0000000..b506460
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/rquota.h
@@ -0,0 +1,95 @@
+/*
+ * Please do not edit this file.
+ * It was generated using rpcgen.
+ */
+
+#ifndef _RQUOTA_H_RPCGEN
+#define _RQUOTA_H_RPCGEN
+
+#include <rpc/rpc.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define RQ_PATHLEN 1024
+
+struct getquota_args {
+ char *gqa_pathp;
+ int gqa_uid;
+};
+typedef struct getquota_args getquota_args;
+
+struct rquota {
+ int rq_bsize;
+ bool_t rq_active;
+ u_int rq_bhardlimit;
+ u_int rq_bsoftlimit;
+ u_int rq_curblocks;
+ u_int rq_fhardlimit;
+ u_int rq_fsoftlimit;
+ u_int rq_curfiles;
+ u_int rq_btimeleft;
+ u_int rq_ftimeleft;
+};
+typedef struct rquota rquota;
+
+enum gqr_status {
+ Q_OK = 1,
+ Q_NOQUOTA = 2,
+ Q_EPERM = 3,
+};
+typedef enum gqr_status gqr_status;
+
+struct getquota_rslt {
+ gqr_status status;
+ union {
+ rquota gqr_rquota;
+ } getquota_rslt_u;
+};
+typedef struct getquota_rslt getquota_rslt;
+
+#define RQUOTAPROG 100011
+#define RQUOTAVERS 1
+
+#if defined(__STDC__) || defined(__cplusplus)
+#define RQUOTAPROC_GETQUOTA 1
+extern getquota_rslt * rquotaproc_getquota_1(getquota_args *, CLIENT *);
+extern getquota_rslt * rquotaproc_getquota_1_svc(getquota_args *, struct svc_req *);
+#define RQUOTAPROC_GETACTIVEQUOTA 2
+extern getquota_rslt * rquotaproc_getactivequota_1(getquota_args *, CLIENT *);
+extern getquota_rslt * rquotaproc_getactivequota_1_svc(getquota_args *, struct svc_req *);
+extern int rquotaprog_1_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
+
+#else /* K&R C */
+#define RQUOTAPROC_GETQUOTA 1
+extern getquota_rslt * rquotaproc_getquota_1();
+extern getquota_rslt * rquotaproc_getquota_1_svc();
+#define RQUOTAPROC_GETACTIVEQUOTA 2
+extern getquota_rslt * rquotaproc_getactivequota_1();
+extern getquota_rslt * rquotaproc_getactivequota_1_svc();
+extern int rquotaprog_1_freeresult ();
+#endif /* K&R C */
+
+/* the xdr functions */
+
+#if defined(__STDC__) || defined(__cplusplus)
+extern bool_t xdr_getquota_args (XDR *, getquota_args*);
+extern bool_t xdr_rquota (XDR *, rquota*);
+extern bool_t xdr_gqr_status (XDR *, gqr_status*);
+extern bool_t xdr_getquota_rslt (XDR *, getquota_rslt*);
+
+#else /* K&R C */
+extern bool_t xdr_getquota_args ();
+extern bool_t xdr_rquota ();
+extern bool_t xdr_gqr_status ();
+extern bool_t xdr_getquota_rslt ();
+
+#endif /* K&R C */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !_RQUOTA_H_RPCGEN */
diff --git a/sysroot/usr/include/rpcsvc/rquota.x b/sysroot/usr/include/rpcsvc/rquota.x
new file mode 100644
index 0000000..62888f6
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/rquota.x
@@ -0,0 +1,61 @@
+/* @(#)rquota.x 2.1 88/08/01 4.0 RPCSRC */
+/* @(#)rquota.x 1.2 87/09/20 Copyr 1987 Sun Micro */
+
+/*
+ * Remote quota protocol
+ * Requires unix authentication
+ */
+
+const RQ_PATHLEN = 1024;
+
+struct getquota_args {
+ string gqa_pathp<RQ_PATHLEN>; /* path to filesystem of interest */
+ int gqa_uid; /* inquire about quota for uid */
+};
+
+/*
+ * remote quota structure
+ */
+struct rquota {
+ int rq_bsize; /* block size for block counts */
+ bool rq_active; /* indicates whether quota is active */
+ unsigned int rq_bhardlimit; /* absolute limit on disk blks alloc */
+ unsigned int rq_bsoftlimit; /* preferred limit on disk blks */
+ unsigned int rq_curblocks; /* current block count */
+ unsigned int rq_fhardlimit; /* absolute limit on allocated files */
+ unsigned int rq_fsoftlimit; /* preferred file limit */
+ unsigned int rq_curfiles; /* current # allocated files */
+ unsigned int rq_btimeleft; /* time left for excessive disk use */
+ unsigned int rq_ftimeleft; /* time left for excessive files */
+};
+
+enum gqr_status {
+ Q_OK = 1, /* quota returned */
+ Q_NOQUOTA = 2, /* noquota for uid */
+ Q_EPERM = 3 /* no permission to access quota */
+};
+
+union getquota_rslt switch (gqr_status status) {
+case Q_OK:
+ rquota gqr_rquota; /* valid if status == Q_OK */
+case Q_NOQUOTA:
+ void;
+case Q_EPERM:
+ void;
+};
+
+program RQUOTAPROG {
+ version RQUOTAVERS {
+ /*
+ * Get all quotas
+ */
+ getquota_rslt
+ RQUOTAPROC_GETQUOTA(getquota_args) = 1;
+
+ /*
+ * Get active quotas only
+ */
+ getquota_rslt
+ RQUOTAPROC_GETACTIVEQUOTA(getquota_args) = 2;
+ } = 1;
+} = 100011;
diff --git a/sysroot/usr/include/rpcsvc/rstat.h b/sysroot/usr/include/rpcsvc/rstat.h
new file mode 100644
index 0000000..abc0ba8
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/rstat.h
@@ -0,0 +1,162 @@
+/*
+ * Please do not edit this file.
+ * It was generated using rpcgen.
+ */
+
+#ifndef _RSTAT_H_RPCGEN
+#define _RSTAT_H_RPCGEN
+
+#include <rpc/rpc.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef FSCALE
+/*
+ * Scale factor for scaled integers used to count load averages.
+ */
+#define FSHIFT 8 /* bits to right of fixed binary point */
+#define FSCALE (1<<FSHIFT)
+
+#endif /* ndef FSCALE */
+#define CPUSTATES 4
+#define DK_NDRIVE 4
+
+struct rstat_timeval {
+ u_int tv_sec;
+ u_int tv_usec;
+};
+typedef struct rstat_timeval rstat_timeval;
+
+struct statstime {
+ int cp_time[CPUSTATES];
+ int dk_xfer[DK_NDRIVE];
+ u_int v_pgpgin;
+ u_int v_pgpgout;
+ u_int v_pswpin;
+ u_int v_pswpout;
+ u_int v_intr;
+ int if_ipackets;
+ int if_ierrors;
+ int if_oerrors;
+ int if_collisions;
+ u_int v_swtch;
+ int avenrun[3];
+ rstat_timeval boottime;
+ rstat_timeval curtime;
+ int if_opackets;
+};
+typedef struct statstime statstime;
+
+struct statsswtch {
+ int cp_time[CPUSTATES];
+ int dk_xfer[DK_NDRIVE];
+ u_int v_pgpgin;
+ u_int v_pgpgout;
+ u_int v_pswpin;
+ u_int v_pswpout;
+ u_int v_intr;
+ int if_ipackets;
+ int if_ierrors;
+ int if_oerrors;
+ int if_collisions;
+ u_int v_swtch;
+ u_int avenrun[3];
+ rstat_timeval boottime;
+ int if_opackets;
+};
+typedef struct statsswtch statsswtch;
+
+struct stats {
+ int cp_time[CPUSTATES];
+ int dk_xfer[DK_NDRIVE];
+ u_int v_pgpgin;
+ u_int v_pgpgout;
+ u_int v_pswpin;
+ u_int v_pswpout;
+ u_int v_intr;
+ int if_ipackets;
+ int if_ierrors;
+ int if_oerrors;
+ int if_collisions;
+ int if_opackets;
+};
+typedef struct stats stats;
+
+#define RSTATPROG 100001
+#define RSTATVERS_TIME 3
+
+#if defined(__STDC__) || defined(__cplusplus)
+#define RSTATPROC_STATS 1
+extern statstime * rstatproc_stats_3(void *, CLIENT *);
+extern statstime * rstatproc_stats_3_svc(void *, struct svc_req *);
+#define RSTATPROC_HAVEDISK 2
+extern u_int * rstatproc_havedisk_3(void *, CLIENT *);
+extern u_int * rstatproc_havedisk_3_svc(void *, struct svc_req *);
+extern int rstatprog_3_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
+
+#else /* K&R C */
+#define RSTATPROC_STATS 1
+extern statstime * rstatproc_stats_3();
+extern statstime * rstatproc_stats_3_svc();
+#define RSTATPROC_HAVEDISK 2
+extern u_int * rstatproc_havedisk_3();
+extern u_int * rstatproc_havedisk_3_svc();
+extern int rstatprog_3_freeresult ();
+#endif /* K&R C */
+#define RSTATVERS_SWTCH 2
+
+#if defined(__STDC__) || defined(__cplusplus)
+extern statsswtch * rstatproc_stats_2(void *, CLIENT *);
+extern statsswtch * rstatproc_stats_2_svc(void *, struct svc_req *);
+extern u_int * rstatproc_havedisk_2(void *, CLIENT *);
+extern u_int * rstatproc_havedisk_2_svc(void *, struct svc_req *);
+extern int rstatprog_2_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
+
+#else /* K&R C */
+extern statsswtch * rstatproc_stats_2();
+extern statsswtch * rstatproc_stats_2_svc();
+extern u_int * rstatproc_havedisk_2();
+extern u_int * rstatproc_havedisk_2_svc();
+extern int rstatprog_2_freeresult ();
+#endif /* K&R C */
+#define RSTATVERS_ORIG 1
+
+#if defined(__STDC__) || defined(__cplusplus)
+extern stats * rstatproc_stats_1(void *, CLIENT *);
+extern stats * rstatproc_stats_1_svc(void *, struct svc_req *);
+extern u_int * rstatproc_havedisk_1(void *, CLIENT *);
+extern u_int * rstatproc_havedisk_1_svc(void *, struct svc_req *);
+extern int rstatprog_1_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
+
+#else /* K&R C */
+extern stats * rstatproc_stats_1();
+extern stats * rstatproc_stats_1_svc();
+extern u_int * rstatproc_havedisk_1();
+extern u_int * rstatproc_havedisk_1_svc();
+extern int rstatprog_1_freeresult ();
+#endif /* K&R C */
+
+/* the xdr functions */
+
+#if defined(__STDC__) || defined(__cplusplus)
+extern bool_t xdr_rstat_timeval (XDR *, rstat_timeval*);
+extern bool_t xdr_statstime (XDR *, statstime*);
+extern bool_t xdr_statsswtch (XDR *, statsswtch*);
+extern bool_t xdr_stats (XDR *, stats*);
+
+#else /* K&R C */
+extern bool_t xdr_rstat_timeval ();
+extern bool_t xdr_statstime ();
+extern bool_t xdr_statsswtch ();
+extern bool_t xdr_stats ();
+
+#endif /* K&R C */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !_RSTAT_H_RPCGEN */
diff --git a/sysroot/usr/include/rpcsvc/rstat.x b/sysroot/usr/include/rpcsvc/rstat.x
new file mode 100644
index 0000000..6367c43
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/rstat.x
@@ -0,0 +1,145 @@
+/* @(#)rstat.x 2.2 88/08/01 4.0 RPCSRC */
+/* @(#)rstat.x 1.2 87/09/18 Copyr 1987 Sun Micro */
+
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+
+/*
+ * Gather statistics on remote machines
+ */
+
+#ifdef RPC_HDR
+
+%#ifndef FSCALE
+%/*
+% * Scale factor for scaled integers used to count load averages.
+% */
+%#define FSHIFT 8 /* bits to right of fixed binary point */
+%#define FSCALE (1<<FSHIFT)
+%
+%#endif /* ndef FSCALE */
+
+#endif /* def RPC_HDR */
+
+const CPUSTATES = 4;
+const DK_NDRIVE = 4;
+
+/*
+ * GMT since 0:00, January 1, 1970
+ */
+struct rstat_timeval {
+ unsigned int tv_sec; /* seconds */
+ unsigned int tv_usec; /* and microseconds */
+};
+
+struct statstime { /* RSTATVERS_TIME */
+ int cp_time[CPUSTATES];
+ int dk_xfer[DK_NDRIVE];
+ unsigned int v_pgpgin; /* these are cumulative sum */
+ unsigned int v_pgpgout;
+ unsigned int v_pswpin;
+ unsigned int v_pswpout;
+ unsigned int v_intr;
+ int if_ipackets;
+ int if_ierrors;
+ int if_oerrors;
+ int if_collisions;
+ unsigned int v_swtch;
+ int avenrun[3]; /* scaled by FSCALE */
+ rstat_timeval boottime;
+ rstat_timeval curtime;
+ int if_opackets;
+};
+
+struct statsswtch { /* RSTATVERS_SWTCH */
+ int cp_time[CPUSTATES];
+ int dk_xfer[DK_NDRIVE];
+ unsigned int v_pgpgin; /* these are cumulative sum */
+ unsigned int v_pgpgout;
+ unsigned int v_pswpin;
+ unsigned int v_pswpout;
+ unsigned int v_intr;
+ int if_ipackets;
+ int if_ierrors;
+ int if_oerrors;
+ int if_collisions;
+ unsigned int v_swtch;
+ unsigned int avenrun[3];/* scaled by FSCALE */
+ rstat_timeval boottime;
+ int if_opackets;
+};
+
+struct stats { /* RSTATVERS_ORIG */
+ int cp_time[CPUSTATES];
+ int dk_xfer[DK_NDRIVE];
+ unsigned int v_pgpgin; /* these are cumulative sum */
+ unsigned int v_pgpgout;
+ unsigned int v_pswpin;
+ unsigned int v_pswpout;
+ unsigned int v_intr;
+ int if_ipackets;
+ int if_ierrors;
+ int if_oerrors;
+ int if_collisions;
+ int if_opackets;
+};
+
+
+program RSTATPROG {
+ /*
+ * Newest version includes current time and context switching info
+ */
+ version RSTATVERS_TIME {
+ statstime
+ RSTATPROC_STATS(void) = 1;
+
+ unsigned int
+ RSTATPROC_HAVEDISK(void) = 2;
+ } = 3;
+ /*
+ * Does not have current time
+ */
+ version RSTATVERS_SWTCH {
+ statsswtch
+ RSTATPROC_STATS(void) = 1;
+
+ unsigned int
+ RSTATPROC_HAVEDISK(void) = 2;
+ } = 2;
+ /*
+ * Old version has no info about current time or context switching
+ */
+ version RSTATVERS_ORIG {
+ stats
+ RSTATPROC_STATS(void) = 1;
+
+ unsigned int
+ RSTATPROC_HAVEDISK(void) = 2;
+ } = 1;
+} = 100001;
diff --git a/sysroot/usr/include/rpcsvc/rusers.h b/sysroot/usr/include/rpcsvc/rusers.h
new file mode 100644
index 0000000..dc2d3b0
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/rusers.h
@@ -0,0 +1,147 @@
+/*
+ * Please do not edit this file.
+ * It was generated using rpcgen.
+ */
+
+#ifndef _RUSERS_H_RPCGEN
+#define _RUSERS_H_RPCGEN
+
+#include <rpc/rpc.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Find out about remote users
+ */
+#define RUSERS_MAXUSERLEN 32
+#define RUSERS_MAXLINELEN 32
+#define RUSERS_MAXHOSTLEN 257
+
+struct rusers_utmp {
+ char *ut_user;
+ char *ut_line;
+ char *ut_host;
+ int ut_type;
+ int ut_time;
+ u_int ut_idle;
+};
+typedef struct rusers_utmp rusers_utmp;
+
+typedef struct {
+ u_int utmp_array_len;
+ rusers_utmp *utmp_array_val;
+} utmp_array;
+
+/*
+ * Values for ut_type field above.
+ */
+#define RUSERS_EMPTY 0
+#define RUSERS_RUN_LVL 1
+#define RUSERS_BOOT_TIME 2
+#define RUSERS_OLD_TIME 3
+#define RUSERS_NEW_TIME 4
+#define RUSERS_INIT_PROCESS 5
+#define RUSERS_LOGIN_PROCESS 6
+#define RUSERS_USER_PROCESS 7
+#define RUSERS_DEAD_PROCESS 8
+#define RUSERS_ACCOUNTING 9
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <rpc/xdr.h>
+
+/*
+ * The following structures are used by version 2 of the rusersd protocol.
+ * They were not developed with rpcgen, so they do not appear as RPCL.
+ */
+
+#define RUSERSVERS_IDLE 2
+#define RUSERSVERS 3 /* current version */
+#define MAXUSERS 100
+
+/*
+ * This is the structure used in version 2 of the rusersd RPC service.
+ * It corresponds to the utmp structure for BSD systems.
+ */
+struct ru_utmp {
+ char ut_line[8]; /* tty name */
+ char ut_name[8]; /* user id */
+ char ut_host[16]; /* host name, if remote */
+ long int ut_time; /* time on */
+};
+
+struct utmparr {
+ struct ru_utmp **uta_arr;
+ int uta_cnt;
+};
+typedef struct utmparr utmparr;
+
+extern bool_t xdr_utmparr (XDR *xdrs, struct utmparr *objp) __THROW;
+
+struct utmpidle {
+ struct ru_utmp ui_utmp;
+ unsigned int ui_idle;
+};
+
+struct utmpidlearr {
+ struct utmpidle **uia_arr;
+ int uia_cnt;
+};
+
+extern bool_t xdr_utmpidlearr (XDR *xdrs, struct utmpidlearr *objp) __THROW;
+
+#ifdef __cplusplus
+}
+#endif
+
+#define RUSERSPROG 100002
+#define RUSERSVERS_3 3
+
+#if defined(__STDC__) || defined(__cplusplus)
+#define RUSERSPROC_NUM 1
+extern int * rusersproc_num_3(void *, CLIENT *);
+extern int * rusersproc_num_3_svc(void *, struct svc_req *);
+#define RUSERSPROC_NAMES 2
+extern utmp_array * rusersproc_names_3(void *, CLIENT *);
+extern utmp_array * rusersproc_names_3_svc(void *, struct svc_req *);
+#define RUSERSPROC_ALLNAMES 3
+extern utmp_array * rusersproc_allnames_3(void *, CLIENT *);
+extern utmp_array * rusersproc_allnames_3_svc(void *, struct svc_req *);
+extern int rusersprog_3_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
+
+#else /* K&R C */
+#define RUSERSPROC_NUM 1
+extern int * rusersproc_num_3();
+extern int * rusersproc_num_3_svc();
+#define RUSERSPROC_NAMES 2
+extern utmp_array * rusersproc_names_3();
+extern utmp_array * rusersproc_names_3_svc();
+#define RUSERSPROC_ALLNAMES 3
+extern utmp_array * rusersproc_allnames_3();
+extern utmp_array * rusersproc_allnames_3_svc();
+extern int rusersprog_3_freeresult ();
+#endif /* K&R C */
+
+/* the xdr functions */
+
+#if defined(__STDC__) || defined(__cplusplus)
+extern bool_t xdr_rusers_utmp (XDR *, rusers_utmp*);
+extern bool_t xdr_utmp_array (XDR *, utmp_array*);
+
+#else /* K&R C */
+extern bool_t xdr_rusers_utmp ();
+extern bool_t xdr_utmp_array ();
+
+#endif /* K&R C */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !_RUSERS_H_RPCGEN */
diff --git a/sysroot/usr/include/rpcsvc/rusers.x b/sysroot/usr/include/rpcsvc/rusers.x
new file mode 100644
index 0000000..b72c293
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/rusers.x
@@ -0,0 +1,240 @@
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+
+%/*
+% * Find out about remote users
+% */
+
+const RUSERS_MAXUSERLEN = 32;
+const RUSERS_MAXLINELEN = 32;
+const RUSERS_MAXHOSTLEN = 257;
+
+struct rusers_utmp {
+ string ut_user<RUSERS_MAXUSERLEN>; /* aka ut_name */
+ string ut_line<RUSERS_MAXLINELEN>; /* device */
+ string ut_host<RUSERS_MAXHOSTLEN>; /* host user logged on from */
+ int ut_type; /* type of entry */
+ int ut_time; /* time entry was made */
+ unsigned int ut_idle; /* minutes idle */
+};
+
+typedef rusers_utmp utmp_array<>;
+
+#ifdef RPC_HDR
+%
+%/*
+% * Values for ut_type field above.
+% */
+#endif
+const RUSERS_EMPTY = 0;
+const RUSERS_RUN_LVL = 1;
+const RUSERS_BOOT_TIME = 2;
+const RUSERS_OLD_TIME = 3;
+const RUSERS_NEW_TIME = 4;
+const RUSERS_INIT_PROCESS = 5;
+const RUSERS_LOGIN_PROCESS = 6;
+const RUSERS_USER_PROCESS = 7;
+const RUSERS_DEAD_PROCESS = 8;
+const RUSERS_ACCOUNTING = 9;
+
+program RUSERSPROG {
+
+ version RUSERSVERS_3 {
+ int
+ RUSERSPROC_NUM(void) = 1;
+
+ utmp_array
+ RUSERSPROC_NAMES(void) = 2;
+
+ utmp_array
+ RUSERSPROC_ALLNAMES(void) = 3;
+ } = 3;
+
+} = 100002;
+
+#ifdef RPC_HDR
+%
+%
+%#ifdef __cplusplus
+%extern "C" {
+%#endif
+%
+%#include <rpc/xdr.h>
+%
+%/*
+% * The following structures are used by version 2 of the rusersd protocol.
+% * They were not developed with rpcgen, so they do not appear as RPCL.
+% */
+%
+%#define RUSERSVERS_IDLE 2
+%#define RUSERSVERS 3 /* current version */
+%#define MAXUSERS 100
+%
+%/*
+% * This is the structure used in version 2 of the rusersd RPC service.
+% * It corresponds to the utmp structure for BSD systems.
+% */
+%struct ru_utmp {
+% char ut_line[8]; /* tty name */
+% char ut_name[8]; /* user id */
+% char ut_host[16]; /* host name, if remote */
+% long int ut_time; /* time on */
+%};
+%
+%struct utmparr {
+% struct ru_utmp **uta_arr;
+% int uta_cnt;
+%};
+%typedef struct utmparr utmparr;
+%
+%extern bool_t xdr_utmparr (XDR *xdrs, struct utmparr *objp) __THROW;
+%
+%struct utmpidle {
+% struct ru_utmp ui_utmp;
+% unsigned int ui_idle;
+%};
+%
+%struct utmpidlearr {
+% struct utmpidle **uia_arr;
+% int uia_cnt;
+%};
+%
+%extern bool_t xdr_utmpidlearr (XDR *xdrs, struct utmpidlearr *objp) __THROW;
+%
+%#ifdef __cplusplus
+%}
+%#endif
+#endif
+
+
+#ifdef RPC_XDR
+%bool_t xdr_utmp (XDR *xdrs, struct ru_utmp *objp);
+%
+%bool_t
+%xdr_utmp(xdrs, objp)
+% XDR *xdrs;
+% struct ru_utmp *objp;
+%{
+% /* Since the fields are char foo [xxx], we should not free them. */
+% if (xdrs->x_op != XDR_FREE)
+% {
+% char *ptr;
+% unsigned int size;
+% ptr = objp->ut_line;
+% size = sizeof (objp->ut_line);
+% if (!xdr_bytes (xdrs, &ptr, &size, size)) {
+% return (FALSE);
+% }
+% ptr = objp->ut_name;
+% size = sizeof (objp->ut_name);
+% if (!xdr_bytes (xdrs, &ptr, &size, size)) {
+% return (FALSE);
+% }
+% ptr = objp->ut_host;
+% size = sizeof (objp->ut_host);
+% if (!xdr_bytes (xdrs, &ptr, &size, size)) {
+% return (FALSE);
+% }
+% }
+% if (!xdr_long(xdrs, &objp->ut_time)) {
+% return (FALSE);
+% }
+% return (TRUE);
+%}
+%
+%bool_t xdr_utmpptr(XDR *xdrs, struct ru_utmp **objpp);
+%
+%bool_t
+%xdr_utmpptr(xdrs, objpp)
+% XDR *xdrs;
+% struct ru_utmp **objpp;
+%{
+% if (!xdr_reference(xdrs, (char **) objpp, sizeof (struct ru_utmp),
+% (xdrproc_t) xdr_utmp)) {
+% return (FALSE);
+% }
+% return (TRUE);
+%}
+%
+%bool_t
+%xdr_utmparr(xdrs, objp)
+% XDR *xdrs;
+% struct utmparr *objp;
+%{
+% if (!xdr_array(xdrs, (char **)&objp->uta_arr, (u_int *)&objp->uta_cnt,
+% MAXUSERS, sizeof(struct ru_utmp *),
+% (xdrproc_t) xdr_utmpptr)) {
+% return (FALSE);
+% }
+% return (TRUE);
+%}
+%
+%bool_t xdr_utmpidle(XDR *xdrs, struct utmpidle *objp);
+%
+%bool_t
+%xdr_utmpidle(xdrs, objp)
+% XDR *xdrs;
+% struct utmpidle *objp;
+%{
+% if (!xdr_utmp(xdrs, &objp->ui_utmp)) {
+% return (FALSE);
+% }
+% if (!xdr_u_int(xdrs, &objp->ui_idle)) {
+% return (FALSE);
+% }
+% return (TRUE);
+%}
+%
+%bool_t xdr_utmpidleptr(XDR *xdrs, struct utmpidle **objp);
+%
+%bool_t
+%xdr_utmpidleptr(xdrs, objpp)
+% XDR *xdrs;
+% struct utmpidle **objpp;
+%{
+% if (!xdr_reference(xdrs, (char **) objpp, sizeof (struct utmpidle),
+% (xdrproc_t) xdr_utmpidle)) {
+% return (FALSE);
+% }
+% return (TRUE);
+%}
+%
+%bool_t
+%xdr_utmpidlearr(xdrs, objp)
+% XDR *xdrs;
+% struct utmpidlearr *objp;
+%{
+% if (!xdr_array(xdrs, (char **)&objp->uia_arr, (u_int *)&objp->uia_cnt,
+% MAXUSERS, sizeof(struct utmpidle *),
+% (xdrproc_t) xdr_utmpidleptr)) {
+% return (FALSE);
+% }
+% return (TRUE);
+%}
+#endif
diff --git a/sysroot/usr/include/rpcsvc/sm_inter.h b/sysroot/usr/include/rpcsvc/sm_inter.h
new file mode 100644
index 0000000..d4bc3e1
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/sm_inter.h
@@ -0,0 +1,135 @@
+/*
+ * Please do not edit this file.
+ * It was generated using rpcgen.
+ */
+
+#ifndef _SM_INTER_H_RPCGEN
+#define _SM_INTER_H_RPCGEN
+
+#include <rpc/rpc.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define SM_MAXSTRLEN 1024
+
+struct sm_name {
+ char *mon_name;
+};
+typedef struct sm_name sm_name;
+
+struct my_id {
+ char *my_name;
+ int my_prog;
+ int my_vers;
+ int my_proc;
+};
+typedef struct my_id my_id;
+
+struct mon_id {
+ char *mon_name;
+ struct my_id my_id;
+};
+typedef struct mon_id mon_id;
+
+struct mon {
+ struct mon_id mon_id;
+ char priv[16];
+};
+typedef struct mon mon;
+
+struct sm_stat {
+ int state;
+};
+typedef struct sm_stat sm_stat;
+
+enum res {
+ stat_succ = 0,
+ stat_fail = 1,
+};
+typedef enum res res;
+
+struct sm_stat_res {
+ res res_stat;
+ int state;
+};
+typedef struct sm_stat_res sm_stat_res;
+
+struct status {
+ char *mon_name;
+ int state;
+ char priv[16];
+};
+typedef struct status status;
+
+#define SM_PROG 100024
+#define SM_VERS 1
+
+#if defined(__STDC__) || defined(__cplusplus)
+#define SM_STAT 1
+extern struct sm_stat_res * sm_stat_1(struct sm_name *, CLIENT *);
+extern struct sm_stat_res * sm_stat_1_svc(struct sm_name *, struct svc_req *);
+#define SM_MON 2
+extern struct sm_stat_res * sm_mon_1(struct mon *, CLIENT *);
+extern struct sm_stat_res * sm_mon_1_svc(struct mon *, struct svc_req *);
+#define SM_UNMON 3
+extern struct sm_stat * sm_unmon_1(struct mon_id *, CLIENT *);
+extern struct sm_stat * sm_unmon_1_svc(struct mon_id *, struct svc_req *);
+#define SM_UNMON_ALL 4
+extern struct sm_stat * sm_unmon_all_1(struct my_id *, CLIENT *);
+extern struct sm_stat * sm_unmon_all_1_svc(struct my_id *, struct svc_req *);
+#define SM_SIMU_CRASH 5
+extern void * sm_simu_crash_1(void *, CLIENT *);
+extern void * sm_simu_crash_1_svc(void *, struct svc_req *);
+extern int sm_prog_1_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
+
+#else /* K&R C */
+#define SM_STAT 1
+extern struct sm_stat_res * sm_stat_1();
+extern struct sm_stat_res * sm_stat_1_svc();
+#define SM_MON 2
+extern struct sm_stat_res * sm_mon_1();
+extern struct sm_stat_res * sm_mon_1_svc();
+#define SM_UNMON 3
+extern struct sm_stat * sm_unmon_1();
+extern struct sm_stat * sm_unmon_1_svc();
+#define SM_UNMON_ALL 4
+extern struct sm_stat * sm_unmon_all_1();
+extern struct sm_stat * sm_unmon_all_1_svc();
+#define SM_SIMU_CRASH 5
+extern void * sm_simu_crash_1();
+extern void * sm_simu_crash_1_svc();
+extern int sm_prog_1_freeresult ();
+#endif /* K&R C */
+
+/* the xdr functions */
+
+#if defined(__STDC__) || defined(__cplusplus)
+extern bool_t xdr_sm_name (XDR *, sm_name*);
+extern bool_t xdr_my_id (XDR *, my_id*);
+extern bool_t xdr_mon_id (XDR *, mon_id*);
+extern bool_t xdr_mon (XDR *, mon*);
+extern bool_t xdr_sm_stat (XDR *, sm_stat*);
+extern bool_t xdr_res (XDR *, res*);
+extern bool_t xdr_sm_stat_res (XDR *, sm_stat_res*);
+extern bool_t xdr_status (XDR *, status*);
+
+#else /* K&R C */
+extern bool_t xdr_sm_name ();
+extern bool_t xdr_my_id ();
+extern bool_t xdr_mon_id ();
+extern bool_t xdr_mon ();
+extern bool_t xdr_sm_stat ();
+extern bool_t xdr_res ();
+extern bool_t xdr_sm_stat_res ();
+extern bool_t xdr_status ();
+
+#endif /* K&R C */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !_SM_INTER_H_RPCGEN */
diff --git a/sysroot/usr/include/rpcsvc/sm_inter.x b/sysroot/usr/include/rpcsvc/sm_inter.x
new file mode 100644
index 0000000..9cbb701
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/sm_inter.x
@@ -0,0 +1,116 @@
+/* @(#)sm_inter.x 2.2 88/08/01 4.0 RPCSRC */
+/* @(#)sm_inter.x 1.7 87/06/24 Copyr 1987 Sun Micro */
+
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+
+/*
+ * Status monitor protocol specification
+ * Copyright (C) 1986 Sun Microsystems, Inc.
+ *
+ */
+
+
+program SM_PROG {
+ version SM_VERS {
+ /* res_stat = stat_succ if status monitor agrees to monitor */
+ /* res_stat = stat_fail if status monitor cannot monitor */
+ /* if res_stat == stat_succ, state = state number of site sm_name */
+ struct sm_stat_res SM_STAT(struct sm_name) = 1;
+
+ /* res_stat = stat_succ if status monitor agrees to monitor */
+ /* res_stat = stat_fail if status monitor cannot monitor */
+ /* stat consists of state number of local site */
+ struct sm_stat_res SM_MON(struct mon) = 2;
+
+ /* stat consists of state number of local site */
+ struct sm_stat SM_UNMON(struct mon_id) = 3;
+
+ /* stat consists of state number of local site */
+ struct sm_stat SM_UNMON_ALL(struct my_id) = 4;
+
+ void SM_SIMU_CRASH(void) = 5;
+
+ } = 1;
+} = 100024;
+
+const SM_MAXSTRLEN = 1024;
+
+struct sm_name {
+ string mon_name<SM_MAXSTRLEN>;
+};
+
+struct my_id {
+ string my_name<SM_MAXSTRLEN>; /* name of the site initiating the monitoring request*/
+ int my_prog; /* rpc program # of the requesting process */
+ int my_vers; /* rpc version # of the requesting process */
+ int my_proc; /* rpc procedure # of the requesting process */
+};
+
+struct mon_id {
+ string mon_name<SM_MAXSTRLEN>; /* name of the site to be monitored */
+ struct my_id my_id;
+};
+
+
+struct mon{
+ struct mon_id mon_id;
+ opaque priv[16]; /* private information to store at monitor for requesting process */
+};
+
+
+/*
+ * state # of status monitor monotonically increases each time
+ * status of the site changes:
+ * an even number (>= 0) indicates the site is down and
+ * an odd number (> 0) indicates the site is up;
+ */
+struct sm_stat {
+ int state; /* state # of status monitor */
+};
+
+enum res {
+ stat_succ = 0, /* status monitor agrees to monitor */
+ stat_fail = 1 /* status monitor cannot monitor */
+};
+
+struct sm_stat_res {
+ res res_stat;
+ int state;
+};
+
+/*
+ * structure of the status message sent back by the status monitor
+ * when monitor site status changes
+ */
+struct status {
+ string mon_name<SM_MAXSTRLEN>;
+ int state;
+ opaque priv[16]; /* stored private information */
+};
diff --git a/sysroot/usr/include/rpcsvc/spray.h b/sysroot/usr/include/rpcsvc/spray.h
new file mode 100644
index 0000000..b19e402
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/spray.h
@@ -0,0 +1,81 @@
+/*
+ * Please do not edit this file.
+ * It was generated using rpcgen.
+ */
+
+#ifndef _SPRAY_H_RPCGEN
+#define _SPRAY_H_RPCGEN
+
+#include <rpc/rpc.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define SPRAYMAX 8845
+
+struct spraytimeval {
+ u_int sec;
+ u_int usec;
+};
+typedef struct spraytimeval spraytimeval;
+
+struct spraycumul {
+ u_int counter;
+ spraytimeval clock;
+};
+typedef struct spraycumul spraycumul;
+
+typedef struct {
+ u_int sprayarr_len;
+ char *sprayarr_val;
+} sprayarr;
+
+#define SPRAYPROG 100012
+#define SPRAYVERS 1
+
+#if defined(__STDC__) || defined(__cplusplus)
+#define SPRAYPROC_SPRAY 1
+extern void * sprayproc_spray_1(sprayarr *, CLIENT *);
+extern void * sprayproc_spray_1_svc(sprayarr *, struct svc_req *);
+#define SPRAYPROC_GET 2
+extern spraycumul * sprayproc_get_1(void *, CLIENT *);
+extern spraycumul * sprayproc_get_1_svc(void *, struct svc_req *);
+#define SPRAYPROC_CLEAR 3
+extern void * sprayproc_clear_1(void *, CLIENT *);
+extern void * sprayproc_clear_1_svc(void *, struct svc_req *);
+extern int sprayprog_1_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
+
+#else /* K&R C */
+#define SPRAYPROC_SPRAY 1
+extern void * sprayproc_spray_1();
+extern void * sprayproc_spray_1_svc();
+#define SPRAYPROC_GET 2
+extern spraycumul * sprayproc_get_1();
+extern spraycumul * sprayproc_get_1_svc();
+#define SPRAYPROC_CLEAR 3
+extern void * sprayproc_clear_1();
+extern void * sprayproc_clear_1_svc();
+extern int sprayprog_1_freeresult ();
+#endif /* K&R C */
+
+/* the xdr functions */
+
+#if defined(__STDC__) || defined(__cplusplus)
+extern bool_t xdr_spraytimeval (XDR *, spraytimeval*);
+extern bool_t xdr_spraycumul (XDR *, spraycumul*);
+extern bool_t xdr_sprayarr (XDR *, sprayarr*);
+
+#else /* K&R C */
+extern bool_t xdr_spraytimeval ();
+extern bool_t xdr_spraycumul ();
+extern bool_t xdr_sprayarr ();
+
+#endif /* K&R C */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !_SPRAY_H_RPCGEN */
diff --git a/sysroot/usr/include/rpcsvc/spray.x b/sysroot/usr/include/rpcsvc/spray.x
new file mode 100644
index 0000000..b242f0a
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/spray.x
@@ -0,0 +1,84 @@
+/* @(#)spray.x 2.1 88/08/01 4.0 RPCSRC */
+/* @(#)spray.x 1.2 87/09/18 Copyr 1987 Sun Micro */
+
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+
+/*
+ * Spray a server with packets
+ * Useful for testing flakiness of network interfaces
+ */
+
+const SPRAYMAX = 8845; /* max amount can spray */
+
+/*
+ * GMT since 0:00, 1 January 1970
+ */
+struct spraytimeval {
+ unsigned int sec;
+ unsigned int usec;
+};
+
+/*
+ * spray statistics
+ */
+struct spraycumul {
+ unsigned int counter;
+ spraytimeval clock;
+};
+
+/*
+ * spray data
+ */
+typedef opaque sprayarr<SPRAYMAX>;
+
+program SPRAYPROG {
+ version SPRAYVERS {
+ /*
+ * Just throw away the data and increment the counter
+ * This call never returns, so the client should always
+ * time it out.
+ */
+ void
+ SPRAYPROC_SPRAY(sprayarr) = 1;
+
+ /*
+ * Get the value of the counter and elapsed time since
+ * last CLEAR.
+ */
+ spraycumul
+ SPRAYPROC_GET(void) = 2;
+
+ /*
+ * Clear the counter and reset the elapsed time
+ */
+ void
+ SPRAYPROC_CLEAR(void) = 3;
+ } = 1;
+} = 100012;
diff --git a/sysroot/usr/include/rpcsvc/yp.h b/sysroot/usr/include/rpcsvc/yp.h
new file mode 100644
index 0000000..ffc13b8
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/yp.h
@@ -0,0 +1,337 @@
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+
+#ifndef __RPCSVC_YP_H__
+#define __RPCSVC_YP_H__
+
+#include <features.h>
+#include <rpc/rpc.h>
+
+#define YPMAXRECORD 1024
+#define YPMAXDOMAIN 64
+#define YPMAXMAP 64
+#define YPMAXPEER 64
+
+enum ypstat {
+ YP_TRUE = 1,
+ YP_NOMORE = 2,
+ YP_FALSE = 0,
+ YP_NOMAP = -1,
+ YP_NODOM = -2,
+ YP_NOKEY = -3,
+ YP_BADOP = -4,
+ YP_BADDB = -5,
+ YP_YPERR = -6,
+ YP_BADARGS = -7,
+ YP_VERS = -8,
+};
+typedef enum ypstat ypstat;
+
+enum ypxfrstat {
+ YPXFR_SUCC = 1,
+ YPXFR_AGE = 2,
+ YPXFR_NOMAP = -1,
+ YPXFR_NODOM = -2,
+ YPXFR_RSRC = -3,
+ YPXFR_RPC = -4,
+ YPXFR_MADDR = -5,
+ YPXFR_YPERR = -6,
+ YPXFR_BADARGS = -7,
+ YPXFR_DBM = -8,
+ YPXFR_FILE = -9,
+ YPXFR_SKEW = -10,
+ YPXFR_CLEAR = -11,
+ YPXFR_FORCE = -12,
+ YPXFR_XFRERR = -13,
+ YPXFR_REFUSED = -14,
+};
+typedef enum ypxfrstat ypxfrstat;
+
+typedef char *domainname;
+typedef char *mapname;
+typedef char *peername;
+
+typedef struct {
+ u_int keydat_len;
+ char *keydat_val;
+} keydat;
+
+typedef struct {
+ u_int valdat_len;
+ char *valdat_val;
+} valdat;
+
+struct ypmap_parms {
+ domainname domain;
+ mapname map;
+ u_int ordernum;
+ peername peer;
+};
+typedef struct ypmap_parms ypmap_parms;
+
+struct ypreq_key {
+ domainname domain;
+ mapname map;
+ keydat key;
+};
+typedef struct ypreq_key ypreq_key;
+
+struct ypreq_nokey {
+ domainname domain;
+ mapname map;
+};
+typedef struct ypreq_nokey ypreq_nokey;
+
+struct ypreq_xfr {
+ ypmap_parms map_parms;
+ u_int transid;
+ u_int prog;
+ u_int port;
+};
+typedef struct ypreq_xfr ypreq_xfr;
+
+struct ypresp_val {
+ ypstat stat;
+ valdat val;
+};
+typedef struct ypresp_val ypresp_val;
+
+struct ypresp_key_val {
+ ypstat stat;
+#ifdef STUPID_SUN_BUG
+ /* This is the form as distributed by Sun. But even the Sun NIS
+ servers expect the values in the other order. So their
+ implementation somehow must change the order internally. We
+ don't want to follow this bad example since the user should be
+ able to use rpcgen on this file. */
+ keydat key;
+ valdat val;
+#else
+ valdat val;
+ keydat key;
+#endif
+};
+typedef struct ypresp_key_val ypresp_key_val;
+
+struct ypresp_master {
+ ypstat stat;
+ peername peer;
+};
+typedef struct ypresp_master ypresp_master;
+
+struct ypresp_order {
+ ypstat stat;
+ u_int ordernum;
+};
+typedef struct ypresp_order ypresp_order;
+
+struct ypresp_all {
+ bool_t more;
+ union {
+ ypresp_key_val val;
+ } ypresp_all_u;
+};
+typedef struct ypresp_all ypresp_all;
+
+struct ypresp_xfr {
+ u_int transid;
+ ypxfrstat xfrstat;
+};
+typedef struct ypresp_xfr ypresp_xfr;
+
+struct ypmaplist {
+ mapname map;
+ struct ypmaplist *next;
+};
+typedef struct ypmaplist ypmaplist;
+
+struct ypresp_maplist {
+ ypstat stat;
+ ypmaplist *maps;
+};
+typedef struct ypresp_maplist ypresp_maplist;
+
+enum yppush_status {
+ YPPUSH_SUCC = 1,
+ YPPUSH_AGE = 2,
+ YPPUSH_NOMAP = -1,
+ YPPUSH_NODOM = -2,
+ YPPUSH_RSRC = -3,
+ YPPUSH_RPC = -4,
+ YPPUSH_MADDR = -5,
+ YPPUSH_YPERR = -6,
+ YPPUSH_BADARGS = -7,
+ YPPUSH_DBM = -8,
+ YPPUSH_FILE = -9,
+ YPPUSH_SKEW = -10,
+ YPPUSH_CLEAR = -11,
+ YPPUSH_FORCE = -12,
+ YPPUSH_XFRERR = -13,
+ YPPUSH_REFUSED = -14,
+};
+typedef enum yppush_status yppush_status;
+
+struct yppushresp_xfr {
+ u_int transid;
+ yppush_status status;
+};
+typedef struct yppushresp_xfr yppushresp_xfr;
+
+enum ypbind_resptype {
+ YPBIND_SUCC_VAL = 1,
+ YPBIND_FAIL_VAL = 2,
+};
+typedef enum ypbind_resptype ypbind_resptype;
+
+struct ypbind_binding {
+ char ypbind_binding_addr[4];
+ char ypbind_binding_port[2];
+};
+typedef struct ypbind_binding ypbind_binding;
+
+struct ypbind_resp {
+ ypbind_resptype ypbind_status;
+ union {
+ u_int ypbind_error;
+ ypbind_binding ypbind_bindinfo;
+ } ypbind_resp_u;
+};
+typedef struct ypbind_resp ypbind_resp;
+
+#define YPBIND_ERR_ERR 1
+#define YPBIND_ERR_NOSERV 2
+#define YPBIND_ERR_RESC 3
+
+struct ypbind_setdom {
+ domainname ypsetdom_domain;
+ ypbind_binding ypsetdom_binding;
+ u_int ypsetdom_vers;
+};
+typedef struct ypbind_setdom ypbind_setdom;
+
+__BEGIN_DECLS
+
+#define YPPROG 100004
+#define YPVERS 2
+
+#define YPPROC_NULL 0
+extern void *ypproc_null_2 (void *, CLIENT *);
+extern void *ypproc_null_2_svc (void *, struct svc_req *);
+#define YPPROC_DOMAIN 1
+extern bool_t *ypproc_domain_2 (domainname *, CLIENT *);
+extern bool_t *ypproc_domain_2_svc (domainname *, struct svc_req *);
+#define YPPROC_DOMAIN_NONACK 2
+extern bool_t *ypproc_domain_nonack_2 (domainname *, CLIENT *);
+extern bool_t *ypproc_domain_nonack_2_svc (domainname *, struct svc_req *);
+#define YPPROC_MATCH 3
+extern ypresp_val *ypproc_match_2 (ypreq_key *, CLIENT *);
+extern ypresp_val *ypproc_match_2_svc (ypreq_key *, struct svc_req *);
+#define YPPROC_FIRST 4
+extern ypresp_key_val *ypproc_first_2 (ypreq_key *, CLIENT *);
+extern ypresp_key_val *ypproc_first_2_svc (ypreq_key *, struct svc_req *);
+#define YPPROC_NEXT 5
+extern ypresp_key_val *ypproc_next_2 (ypreq_key *, CLIENT *);
+extern ypresp_key_val *ypproc_next_2_svc (ypreq_key *, struct svc_req *);
+#define YPPROC_XFR 6
+extern ypresp_xfr *ypproc_xfr_2 (ypreq_xfr *, CLIENT *);
+extern ypresp_xfr *ypproc_xfr_2_svc (ypreq_xfr *, struct svc_req *);
+#define YPPROC_CLEAR 7
+extern void *ypproc_clear_2 (void *, CLIENT *);
+extern void *ypproc_clear_2_svc (void *, struct svc_req *);
+#define YPPROC_ALL 8
+extern ypresp_all *ypproc_all_2 (ypreq_nokey *, CLIENT *);
+extern ypresp_all *ypproc_all_2_svc (ypreq_nokey *, struct svc_req *);
+#define YPPROC_MASTER 9
+extern ypresp_master *ypproc_master_2 (ypreq_nokey *, CLIENT *);
+extern ypresp_master *ypproc_master_2_svc (ypreq_nokey *, struct svc_req *);
+#define YPPROC_ORDER 10
+extern ypresp_order *ypproc_order_2 (ypreq_nokey *, CLIENT *);
+extern ypresp_order *ypproc_order_2_svc (ypreq_nokey *, struct svc_req *);
+#define YPPROC_MAPLIST 11
+extern ypresp_maplist *ypproc_maplist_2 (domainname *, CLIENT *);
+extern ypresp_maplist *ypproc_maplist_2_svc (domainname *, struct svc_req *);
+extern int ypprog_2_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
+
+
+#define YPPUSH_XFRRESPPROG (0x40000000)
+#define YPPUSH_XFRRESPVERS 1
+
+#define YPPUSHPROC_NULL 0
+extern void *yppushproc_null_1 (void *, CLIENT *);
+extern void *yppushproc_null_1_svc (void *, struct svc_req *);
+#define YPPUSHPROC_XFRRESP 1
+extern void *yppushproc_xfrresp_1 (yppushresp_xfr *, CLIENT *);
+extern void *yppushproc_xfrresp_1_svc (yppushresp_xfr *, struct svc_req *);
+extern int yppush_xfrrespprog_1_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
+
+
+#define YPBINDPROG 100007
+#define YPBINDVERS 2
+
+#define YPBINDPROC_NULL 0
+extern void *ypbindproc_null_2 (void *, CLIENT *);
+extern void *ypbindproc_null_2_svc (void *, struct svc_req *);
+#define YPBINDPROC_DOMAIN 1
+extern ypbind_resp *ypbindproc_domain_2 (domainname *, CLIENT *);
+extern ypbind_resp *ypbindproc_domain_2_svc (domainname *, struct svc_req *);
+#define YPBINDPROC_SETDOM 2
+extern void *ypbindproc_setdom_2 (ypbind_setdom *, CLIENT *);
+extern void *ypbindproc_setdom_2_svc (ypbind_setdom *, struct svc_req *);
+extern int ypbindprog_2_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
+
+
+extern bool_t xdr_ypstat (XDR *, ypstat*);
+extern bool_t xdr_ypxfrstat (XDR *, ypxfrstat*);
+extern bool_t xdr_domainname (XDR *, domainname*);
+extern bool_t xdr_mapname (XDR *, mapname*);
+extern bool_t xdr_peername (XDR *, peername*);
+extern bool_t xdr_keydat (XDR *, keydat*);
+extern bool_t xdr_valdat (XDR *, valdat*);
+extern bool_t xdr_ypmap_parms (XDR *, ypmap_parms*);
+extern bool_t xdr_ypreq_key (XDR *, ypreq_key*);
+extern bool_t xdr_ypreq_nokey (XDR *, ypreq_nokey*);
+extern bool_t xdr_ypreq_xfr (XDR *, ypreq_xfr*);
+extern bool_t xdr_ypresp_val (XDR *, ypresp_val*);
+extern bool_t xdr_ypresp_key_val (XDR *, ypresp_key_val*);
+extern bool_t xdr_ypresp_master (XDR *, ypresp_master*);
+extern bool_t xdr_ypresp_order (XDR *, ypresp_order*);
+extern bool_t xdr_ypresp_all (XDR *, ypresp_all*);
+extern bool_t xdr_ypresp_xfr (XDR *, ypresp_xfr*);
+extern bool_t xdr_ypmaplist (XDR *, ypmaplist*);
+extern bool_t xdr_ypresp_maplist (XDR *, ypresp_maplist*);
+extern bool_t xdr_yppush_status (XDR *, yppush_status*);
+extern bool_t xdr_yppushresp_xfr (XDR *, yppushresp_xfr*);
+extern bool_t xdr_ypbind_resptype (XDR *, ypbind_resptype*);
+extern bool_t xdr_ypbind_binding (XDR *, ypbind_binding*);
+extern bool_t xdr_ypbind_resp (XDR *, ypbind_resp*);
+extern bool_t xdr_ypbind_setdom (XDR *, ypbind_setdom*);
+
+__END_DECLS
+
+#endif /* !__RPCSVC_YP_H__ */
diff --git a/sysroot/usr/include/rpcsvc/yp.x b/sysroot/usr/include/rpcsvc/yp.x
new file mode 100644
index 0000000..b1b2565
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/yp.x
@@ -0,0 +1,309 @@
+/* @(#)yp.x 2.1 88/08/01 4.0 RPCSRC */
+
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+
+/*
+ * Protocol description file for the Yellow Pages Service
+ */
+
+const YPMAXRECORD = 1024;
+const YPMAXDOMAIN = 64;
+const YPMAXMAP = 64;
+const YPMAXPEER = 64;
+
+
+enum ypstat {
+ YP_TRUE = 1,
+ YP_NOMORE = 2,
+ YP_FALSE = 0,
+ YP_NOMAP = -1,
+ YP_NODOM = -2,
+ YP_NOKEY = -3,
+ YP_BADOP = -4,
+ YP_BADDB = -5,
+ YP_YPERR = -6,
+ YP_BADARGS = -7,
+ YP_VERS = -8
+};
+
+
+enum ypxfrstat {
+ YPXFR_SUCC = 1,
+ YPXFR_AGE = 2,
+ YPXFR_NOMAP = -1,
+ YPXFR_NODOM = -2,
+ YPXFR_RSRC = -3,
+ YPXFR_RPC = -4,
+ YPXFR_MADDR = -5,
+ YPXFR_YPERR = -6,
+ YPXFR_BADARGS = -7,
+ YPXFR_DBM = -8,
+ YPXFR_FILE = -9,
+ YPXFR_SKEW = -10,
+ YPXFR_CLEAR = -11,
+ YPXFR_FORCE = -12,
+ YPXFR_XFRERR = -13,
+ YPXFR_REFUSED = -14
+};
+
+
+typedef string domainname<YPMAXDOMAIN>;
+typedef string mapname<YPMAXMAP>;
+typedef string peername<YPMAXPEER>;
+typedef opaque keydat<YPMAXRECORD>;
+typedef opaque valdat<YPMAXRECORD>;
+
+
+struct ypmap_parms {
+ domainname domain;
+ mapname map;
+ unsigned int ordernum;
+ peername peer;
+};
+
+struct ypreq_key {
+ domainname domain;
+ mapname map;
+ keydat key;
+};
+
+struct ypreq_nokey {
+ domainname domain;
+ mapname map;
+};
+
+struct ypreq_xfr {
+ ypmap_parms map_parms;
+ unsigned int transid;
+ unsigned int prog;
+ unsigned int port;
+};
+
+
+struct ypresp_val {
+ ypstat stat;
+ valdat val;
+};
+
+struct ypresp_key_val {
+ ypstat stat;
+#ifdef STUPID_SUN_BUG
+ /* This is the form as distributed by Sun. But even the Sun NIS
+ servers expect the values in the other order. So their
+ implementation somehow must change the order internally. We
+ don't want to follow this bad example since the user should be
+ able to use rpcgen on this file. */
+ keydat key;
+ valdat val;
+#else
+ valdat val;
+ keydat key;
+#endif
+};
+
+
+struct ypresp_master {
+ ypstat stat;
+ peername peer;
+};
+
+struct ypresp_order {
+ ypstat stat;
+ unsigned int ordernum;
+};
+
+union ypresp_all switch (bool more) {
+case TRUE:
+ ypresp_key_val val;
+case FALSE:
+ void;
+};
+
+struct ypresp_xfr {
+ unsigned int transid;
+ ypxfrstat xfrstat;
+};
+
+struct ypmaplist {
+ mapname map;
+ ypmaplist *next;
+};
+
+struct ypresp_maplist {
+ ypstat stat;
+ ypmaplist *maps;
+};
+
+enum yppush_status {
+ YPPUSH_SUCC = 1, /* Success */
+ YPPUSH_AGE = 2, /* Master's version not newer */
+ YPPUSH_NOMAP = -1, /* Can't find server for map */
+ YPPUSH_NODOM = -2, /* Domain not supported */
+ YPPUSH_RSRC = -3, /* Local resource alloc failure */
+ YPPUSH_RPC = -4, /* RPC failure talking to server */
+ YPPUSH_MADDR = -5, /* Can't get master address */
+ YPPUSH_YPERR = -6, /* YP server/map db error */
+ YPPUSH_BADARGS = -7, /* Request arguments bad */
+ YPPUSH_DBM = -8, /* Local dbm operation failed */
+ YPPUSH_FILE = -9, /* Local file I/O operation failed */
+ YPPUSH_SKEW = -10, /* Map version skew during transfer */
+ YPPUSH_CLEAR = -11, /* Can't send "Clear" req to local ypserv */
+ YPPUSH_FORCE = -12, /* No local order number in map use -f flag. */
+ YPPUSH_XFRERR = -13, /* ypxfr error */
+ YPPUSH_REFUSED = -14 /* Transfer request refused by ypserv */
+};
+
+struct yppushresp_xfr {
+ unsigned transid;
+ yppush_status status;
+};
+
+/*
+ * Response structure and overall result status codes. Success and failure
+ * represent two separate response message types.
+ */
+
+enum ypbind_resptype {
+ YPBIND_SUCC_VAL = 1,
+ YPBIND_FAIL_VAL = 2
+};
+
+struct ypbind_binding {
+ opaque ypbind_binding_addr[4]; /* In network order */
+ opaque ypbind_binding_port[2]; /* In network order */
+};
+
+union ypbind_resp switch (ypbind_resptype ypbind_status) {
+case YPBIND_FAIL_VAL:
+ unsigned ypbind_error;
+case YPBIND_SUCC_VAL:
+ ypbind_binding ypbind_bindinfo;
+};
+
+/* Detailed failure reason codes for response field ypbind_error*/
+
+const YPBIND_ERR_ERR = 1; /* Internal error */
+const YPBIND_ERR_NOSERV = 2; /* No bound server for passed domain */
+const YPBIND_ERR_RESC = 3; /* System resource allocation failure */
+
+
+/*
+ * Request data structure for ypbind "Set domain" procedure.
+ */
+struct ypbind_setdom {
+ domainname ypsetdom_domain;
+ ypbind_binding ypsetdom_binding;
+ unsigned ypsetdom_vers;
+};
+
+
+/*
+ * YP access protocol
+ */
+program YPPROG {
+ version YPVERS {
+ void
+ YPPROC_NULL(void) = 0;
+
+ bool
+ YPPROC_DOMAIN(domainname) = 1;
+
+ bool
+ YPPROC_DOMAIN_NONACK(domainname) = 2;
+
+ ypresp_val
+ YPPROC_MATCH(ypreq_key) = 3;
+
+ ypresp_key_val
+ YPPROC_FIRST(ypreq_key) = 4;
+
+ ypresp_key_val
+ YPPROC_NEXT(ypreq_key) = 5;
+
+ ypresp_xfr
+ YPPROC_XFR(ypreq_xfr) = 6;
+
+ void
+ YPPROC_CLEAR(void) = 7;
+
+ ypresp_all
+ YPPROC_ALL(ypreq_nokey) = 8;
+
+ ypresp_master
+ YPPROC_MASTER(ypreq_nokey) = 9;
+
+ ypresp_order
+ YPPROC_ORDER(ypreq_nokey) = 10;
+
+ ypresp_maplist
+ YPPROC_MAPLIST(domainname) = 11;
+ } = 2;
+} = 100004;
+
+
+/*
+ * YPPUSHPROC_XFRRESP is the callback routine for result of YPPROC_XFR
+ */
+program YPPUSH_XFRRESPPROG {
+ version YPPUSH_XFRRESPVERS {
+ void
+ YPPUSHPROC_NULL(void) = 0;
+
+#ifdef STUPID_SUN_BUG
+ /* This is the form as distributed by Sun. But even
+ the Sun NIS servers expect the values in the other
+ order. So their implementation somehow must change
+ the order internally. We don't want to follow this
+ bad example since the user should be able to use
+ rpcgen on this file. */
+ yppushresp_xfr
+ YPPUSHPROC_XFRRESP(void) = 1;
+#else
+ void
+ YPPUSHPROC_XFRRESP(yppushresp_xfr) = 1;
+#endif
+ } = 1;
+} = 0x40000000; /* transient: could be anything up to 0x5fffffff */
+
+/*
+ * YP binding protocol
+ */
+program YPBINDPROG {
+ version YPBINDVERS {
+ void
+ YPBINDPROC_NULL(void) = 0;
+
+ ypbind_resp
+ YPBINDPROC_DOMAIN(domainname) = 1;
+
+ void
+ YPBINDPROC_SETDOM(ypbind_setdom) = 2;
+ } = 2;
+} = 100007;
diff --git a/sysroot/usr/include/rpcsvc/yp_prot.h b/sysroot/usr/include/rpcsvc/yp_prot.h
new file mode 100644
index 0000000..ae0db36
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/yp_prot.h
@@ -0,0 +1,366 @@
+/*
+ * This file contains symbols and structures defining the rpc protocol
+ * between the NIS clients and the NIS servers. The servers
+ * are the NIS database servers, and the NIS binders.
+ */
+
+#ifndef _RPCSVC_YP_PROT_H
+#define _RPCSVC_YP_PROT_H
+
+#include <features.h>
+
+#include <rpc/rpc.h>
+#include <rpcsvc/ypclnt.h>
+
+__BEGIN_DECLS
+
+/*
+ * The following procedures are supported by the protocol:
+ *
+ * YPPROC_NULL() returns () takes nothing, returns nothing. This indicates
+ * that the NIS server is alive.
+ *
+ * YPPROC_DOMAIN (char *) returns (bool_t) TRUE. Indicates that the
+ * responding NIS server does serve the named domain; FALSE indicates no
+ * support.
+ *
+ * YPPROC_DOMAIN_NONACK (char *) returns (TRUE) if the NIS server does serve
+ * the named domain, otherwise does not return. Used in the broadcast case.
+ *
+ * YPPROC_MATCH (struct ypreq_key) returns (struct ypresp_val). Returns the
+ * right-hand value for a passed left-hand key, within a named map and
+ * domain.
+ *
+ * YPPROC_FIRST (struct ypreq_nokey) returns (struct ypresp_key_val).
+ * Returns the first key-value pair from a named domain and map.
+ *
+ * YPPROC_NEXT (struct ypreq_key) returns (struct ypresp_key_val). Returns
+ * the key-value pair following a passed key-value pair within a named
+ * domain and map.
+ *
+ * YPPROC_XFR (struct ypreq_xfr) returns nothing. Indicates to a server that
+ * a map should be updated.
+ *
+ * YPPROC_CLEAR takes nothing, returns nothing. Instructs a NIS server to
+ * close the current map, so that old versions of the disk file don't get
+ * held open.
+ *
+ * YPPROC_ALL (struct ypreq_nokey), returns
+ * union switch (bool_t more) {
+ * TRUE: (struct ypresp_key_val);
+ * FALSE: (struct) {};
+ * }
+ *
+ * YPPROC_MASTER (struct ypreq_nokey), returns (ypresp_master)
+ *
+ * YPPROC_ORDER (struct ypreq_nokey), returns (ypresp_order)
+ *
+ * YPPROC_MAPLIST (char *), returns (struct ypmaplist *)
+ */
+
+/* Program and version symbols, magic numbers */
+
+#define YPPROG 100004
+#define YPVERS 2
+#define YPVERS_ORIG 1
+#define YPMAXRECORD 1024
+#define YPMAXDOMAIN 64 /* XXX orig. yp_prot.h defines 256 */
+#define YPMAXMAP 64
+#define YPMAXPEER 64 /* XXX orig. yp_prot.h defines 256 */
+
+/* byte size of a large NIS packet */
+#define YPMSGSZ 1600
+
+typedef struct {
+ u_int keydat_len;
+ char *keydat_val;
+} keydat_t;
+
+typedef struct {
+ u_int valdat_len;
+ char *valdat_val;
+} valdat_t;
+
+struct ypmap_parms {
+ char *domain; /* Null string means not available */
+ char *map; /* Null string means not available */
+ unsigned int ordernum; /* 0 means not available */
+ char *owner; /* Null string means not available */
+};
+
+/*
+ * Request parameter structures
+ */
+
+struct ypreq_key {
+ const char *domain;
+ const char *map;
+ keydat_t keydat;
+};
+
+struct ypreq_nokey {
+ char *domain;
+ char *map;
+};
+
+struct ypreq_xfr {
+ struct ypmap_parms map_parms;
+ u_int transid;
+ u_int proto;
+ u_int port;
+};
+
+#define ypxfr_domain map_parms.domain
+#define ypxfr_map map_parms.map
+#define ypxfr_ordernum map_parms.ordernum
+#define ypxfr_owner map_parms.owner
+
+/* Return status values */
+
+enum ypstat {
+ YP_TRUE = 1, /* General purpose success code */
+#define YP_TRUE YP_TRUE
+ YP_NOMORE = 2, /* No more entries in map */
+#define YP_NOMORE YP_NOMORE
+ YP_FALSE = 0, /* General purpose failure code */
+#define YP_FALSE YP_FALSE
+ YP_NOMAP = -1, /* No such map in domain */
+#define YP_NOMAP YP_NOMAP
+ YP_NODOM = -2, /* Domain not supported */
+#define YP_NODOM YP_NODOM
+ YP_NOKEY = -3, /* No such key in map */
+#define YP_NOKEY YP_NOKEY
+ YP_BADOP = -4, /* Invalid operation */
+#define YP_BADOP YP_BADOP
+ YP_BADDB = -5, /* Server data base is bad */
+#define YP_BADDB YP_BADDB
+ YP_YPERR = -6, /* NIS server error */
+#define YP_YPERR YP_YPERR
+ YP_BADARGS = -7, /* Request arguments bad */
+#define YP_BADARGS YP_BADARGS
+ YP_VERS = -8, /* NIS server version mismatch - server can't supply
+ requested service. */
+#define YP_VERS YP_VERS
+};
+
+/*
+ * Response parameter structures
+ */
+
+typedef enum ypstat ypstat;
+
+struct ypresp_val {
+ ypstat status;
+ valdat_t valdat;
+};
+
+struct ypresp_key_val {
+ ypstat status;
+#ifdef STUPID_SUN_BUG
+ /* This is the form as distributed by Sun. But even the Sun NIS
+ servers expect the values in the other order. So their
+ implementation somehow must change the order internally. We
+ don't want to follow this bad example since the user should be
+ able to use rpcgen on this file. */
+ keydat_t keydat;
+ valdat_t valdat;
+#else
+ valdat_t valdat;
+ keydat_t keydat;
+#endif
+};
+
+struct ypresp_master {
+ ypstat status;
+ char *master;
+};
+
+struct ypresp_order {
+ ypstat status;
+ u_int ordernum;
+};
+
+struct ypmaplist {
+ char *map;
+#define ypml_name map
+ struct ypmaplist *next;
+#define ypml_next next
+};
+
+struct ypresp_maplist {
+ ypstat status;
+ struct ypmaplist *list;
+};
+
+/*
+ * Procedure symbols. YPPROC_NULL, YPPROC_DOMAIN, and YPPROC_DOMAIN_NONACK
+ * must keep the same values (0, 1, and 2) that they had in the first version
+ * of the protocol.
+ */
+
+#define YPPROC_NULL 0
+#define YPPROC_DOMAIN 1
+#define YPPROC_DOMAIN_NONACK 2
+#define YPPROC_MATCH 3
+#define YPPROC_FIRST 4
+#define YPPROC_NEXT 5
+#define YPPROC_XFR 6
+#define YPPROC_CLEAR 7
+#define YPPROC_ALL 8
+#define YPPROC_MASTER 9
+#define YPPROC_ORDER 10
+#define YPPROC_MAPLIST 11
+#define YPPROC_NEWXFR 12
+
+/*
+ * Protocol between clients and NIS binder servers
+ */
+
+/*
+ * The following procedures are supported by the protocol:
+ *
+ * YPBINDPROC_NULL() returns ()
+ * takes nothing, returns nothing
+ *
+ * YPBINDPROC_DOMAIN takes (char *) returns (struct ypbind_resp)
+ *
+ * YPBINDPROC_SETDOM takes (struct ypbind_setdom) returns nothing
+ */
+
+/* Program and version symbols, magic numbers */
+
+#define YPBINDPROG 100007
+#define YPBINDVERS 2
+#define YPBINDVERS_ORIG 1
+
+/* Procedure symbols */
+
+#define YPBINDPROC_NULL 0
+#define YPBINDPROC_DOMAIN 1
+#define YPBINDPROC_SETDOM 2
+/*
+ * Response structure and overall result status codes. Success and failure
+ * represent two separate response message types.
+ */
+
+enum ypbind_resptype {YPBIND_SUCC_VAL = 1, YPBIND_FAIL_VAL = 2};
+
+struct ypbind_binding {
+ struct in_addr ypbind_binding_addr; /* In network order */
+ unsigned short int ypbind_binding_port; /* In network order */
+};
+
+struct ypbind_resp {
+ enum ypbind_resptype ypbind_status;
+ union {
+ u_int ypbind_error;
+ struct ypbind_binding ypbind_bindinfo;
+ } ypbind_respbody;
+};
+
+
+/* Detailed failure reason codes for response field ypbind_error*/
+
+#define YPBIND_ERR_ERR 1 /* Internal error */
+#define YPBIND_ERR_NOSERV 2 /* No bound server for passed domain */
+#define YPBIND_ERR_RESC 3 /* System resource allocation failure */
+
+/*
+ * Request data structure for ypbind "Set domain" procedure.
+ */
+struct ypbind_setdom {
+ char *ypsetdom_domain;
+ struct ypbind_binding ypsetdom_binding;
+ u_int ypsetdom_vers;
+};
+#define ypsetdom_addr ypsetdom_binding.ypbind_binding_addr
+#define ypsetdom_port ypsetdom_binding.ypbind_binding_port
+
+/*
+ * Protocol between clients (ypxfr, only) and yppush
+ * yppush speaks a protocol in the transient range, which
+ * is supplied to ypxfr as a command-line parameter when it
+ * is activated by ypserv.
+ */
+#define YPPUSHVERS 1
+#define YPPUSHVERS_ORIG 1
+
+/* Procedure symbols */
+
+#define YPPUSHPROC_NULL 0
+#define YPPUSHPROC_XFRRESP 1
+
+/* Status values for yppushresp_xfr.status */
+
+enum yppush_status {
+ YPPUSH_SUCC = 1, /* Success */
+#define YPPUSH_SUCC YPPUSH_SUCC
+ YPPUSH_AGE = 2, /* Master's version not newer */
+#define YPPUSH_AGE YPPUSH_AGE
+ YPPUSH_NOMAP = -1, /* Can't find server for map */
+#define YPPUSH_NOMAP YPPUSH_NOMAP
+ YPPUSH_NODOM = -2, /* Domain not supported */
+#define YPPUSH_NODOM YPPUSH_NODOM
+ YPPUSH_RSRC = -3, /* Local resouce alloc failure */
+#define YPPUSH_RSRC YPPUSH_RSRC
+ YPPUSH_RPC = -4, /* RPC failure talking to server */
+#define YPPUSH_RPC YPPUSH_RPC
+ YPPUSH_MADDR = -5, /* Can't get master address */
+#define YPPUSH_MADDR YPPUSH_MADDR
+ YPPUSH_YPERR = -6, /* NIS server/map db error */
+#define YPPUSH_YPERR YPPUSH_YPERR
+ YPPUSH_BADARGS = -7, /* Request arguments bad */
+#define YPPUSH_BADARGS YPPUSH_BADARGS
+ YPPUSH_DBM = -8, /* Local dbm operation failed */
+#define YPPUSH_DBM YPPUSH_DBM
+ YPPUSH_FILE = -9, /* Local file I/O operation failed */
+#define YPPUSH_FILE YPPUSH_FILE
+ YPPUSH_SKEW = -10, /* Map version skew during transfer */
+#define YPPUSH_SKEW YPPUSH_SKEW
+ YPPUSH_CLEAR = -11, /* Can't send "Clear" req to local ypserv */
+#define YPPUSH_CLEAR YPPUSH_CLEAR
+ YPPUSH_FORCE = -12, /* No local order number in map - use -f flag*/
+#define YPPUSH_FORCE YPPUSH_FORCE
+ YPPUSH_XFRERR = -13, /* ypxfr error */
+#define YPPUSH_XFRERR YPPUSH_XFRERR
+ YPPUSH_REFUSED = -14, /* Transfer request refused by ypserv */
+#define YPPUSH_REFUSED YPPUSH_REFUSED
+ YPPUSH_NOALIAS = -15 /* Alias not found for map or domain */
+#define YPPUSH_NOALIAS YPPUSH_NOALIAS
+};
+typedef enum yppush_status yppush_status;
+
+struct yppushresp_xfr {
+ u_int transid;
+ yppush_status status;
+};
+
+struct ypresp_all {
+ bool_t more;
+ union {
+ struct ypresp_key_val val;
+ } ypresp_all_u;
+};
+
+extern bool_t xdr_ypreq_key (XDR *__xdrs, struct ypreq_key * __objp);
+extern bool_t xdr_ypreq_nokey (XDR *__xdrs, struct ypreq_nokey * __objp);
+extern bool_t xdr_ypreq_xfr (XDR *__xdrs, struct ypreq_xfr * __objp);
+extern bool_t xdr_ypresp_val (XDR *__xdrs, struct ypresp_val * __objp);
+extern bool_t xdr_ypresp_key_val (XDR *__xdrs, struct ypresp_key_val * __objp);
+extern bool_t xdr_ypbind_resp (XDR *__xdrs, struct ypbind_resp * __objp);
+extern bool_t xdr_ypbind_setdom (XDR *__xdrs, struct ypbind_setdom * __objp);
+extern bool_t xdr_ypmap_parms (XDR *__xdrs, struct ypmap_parms * __objp);
+extern bool_t xdr_yppushresp_xfr (XDR *__xdrs, struct yppushresp_xfr * __objp);
+extern bool_t xdr_ypresp_order (XDR *__xdrs, struct ypresp_order * __objp);
+extern bool_t xdr_ypresp_master (XDR *__xdrs, struct ypresp_master * __objp);
+extern bool_t xdr_ypall (XDR *__xdrs, struct ypall_callback * __objp);
+extern bool_t xdr_ypresp_maplist (XDR *__xdrs, struct ypresp_maplist * __objp);
+extern bool_t xdr_ypbind_binding (XDR *__xdrs, struct ypbind_binding * __objp);
+extern bool_t xdr_ypbind_resptype (XDR *__xdrs, enum ypbind_resptype * __objp);
+extern bool_t xdr_ypstat (XDR *__xdrs, enum ypbind_resptype * __objp);
+extern bool_t xdr_ypresp_all (XDR *__xdrs, struct ypresp_all * __objp);
+extern bool_t xdr_domainname (XDR *__xdrs, char ** __objp);
+
+__END_DECLS
+
+#endif /* _RPCSVC_YP_PROT_H */
diff --git a/sysroot/usr/include/rpcsvc/ypclnt.h b/sysroot/usr/include/rpcsvc/ypclnt.h
new file mode 100644
index 0000000..aa37a29
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/ypclnt.h
@@ -0,0 +1,89 @@
+/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Thorsten Kukuk <kukuk@suse.de>, 1996.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+
+#ifndef __RPCSVC_YPCLNT_H__
+#define __RPCSVC_YPCLNT_H__
+
+#include <features.h>
+
+/* Some defines */
+#define YPERR_SUCCESS 0 /* There is no error */
+#define YPERR_BADARGS 1 /* Args to function are bad */
+#define YPERR_RPC 2 /* RPC failure */
+#define YPERR_DOMAIN 3 /* Can't bind to a server with this domain */
+#define YPERR_MAP 4 /* No such map in server's domain */
+#define YPERR_KEY 5 /* No such key in map */
+#define YPERR_YPERR 6 /* Internal yp server or client error */
+#define YPERR_RESRC 7 /* Local resource allocation failure */
+#define YPERR_NOMORE 8 /* No more records in map database */
+#define YPERR_PMAP 9 /* Can't communicate with portmapper */
+#define YPERR_YPBIND 10 /* Can't communicate with ypbind */
+#define YPERR_YPSERV 11 /* Can't communicate with ypserv */
+#define YPERR_NODOM 12 /* Local domain name not set */
+#define YPERR_BADDB 13 /* yp data base is bad */
+#define YPERR_VERS 14 /* YP version mismatch */
+#define YPERR_ACCESS 15 /* Access violation */
+#define YPERR_BUSY 16 /* Database is busy */
+
+/* Types of update operations */
+#define YPOP_CHANGE 1 /* Change, do not add */
+#define YPOP_INSERT 2 /* Add, do not change */
+#define YPOP_DELETE 3 /* Delete this entry */
+#define YPOP_STORE 4 /* Add, or change */
+
+__BEGIN_DECLS
+
+/* struct ypall_callback * is the arg which must be passed to yp_all. */
+struct ypall_callback
+ {
+ int (*foreach) (int __status, char *__key, int __keylen,
+ char *__val, int __vallen, char *__data);
+ char *data;
+ };
+
+/* External NIS client function references. */
+extern int yp_bind (__const char *) __THROW;
+extern void yp_unbind (__const char *) __THROW;
+extern int yp_get_default_domain (char **) __THROW;
+extern int yp_match (__const char *, __const char *, __const char *,
+ __const int, char **, int *) __THROW;
+extern int yp_first (__const char *, __const char *, char **,
+ int *, char **, int *) __THROW;
+extern int yp_next (__const char *, __const char *, __const char *,
+ __const int, char **, int *, char **, int *) __THROW;
+extern int yp_master (__const char *, __const char *, char **) __THROW;
+extern int yp_order (__const char *, __const char *, unsigned int *) __THROW;
+extern int yp_all (__const char *, __const char *,
+ __const struct ypall_callback *) __THROW;
+extern __const char *yperr_string (__const int) __THROW;
+extern __const char *ypbinderr_string (__const int) __THROW;
+extern int ypprot_err (__const int) __THROW;
+extern int yp_update (char *, char *, unsigned int, char *,
+ int, char *, int) __THROW;
+#if 0
+extern int yp_maplist (__const char *, struct ypmaplist **) __THROW;
+#endif
+
+/* This functions exists only under BSD and Linux systems. */
+extern int __yp_check (char **) __THROW;
+
+__END_DECLS
+
+#endif /* __RPCSVC_YPCLNT_H__ */
diff --git a/sysroot/usr/include/rpcsvc/yppasswd.h b/sysroot/usr/include/rpcsvc/yppasswd.h
new file mode 100644
index 0000000..adbe9b3
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/yppasswd.h
@@ -0,0 +1,66 @@
+/*
+ * Please do not edit this file.
+ * It was generated using rpcgen.
+ */
+
+#ifndef _YPPASSWD_H_RPCGEN
+#define _YPPASSWD_H_RPCGEN
+
+#include <rpc/rpc.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+struct passwd {
+ char *pw_name;
+ char *pw_passwd;
+ int pw_uid;
+ int pw_gid;
+ char *pw_gecos;
+ char *pw_dir;
+ char *pw_shell;
+};
+typedef struct passwd passwd;
+
+struct yppasswd {
+ char *oldpass;
+ passwd newpw;
+};
+typedef struct yppasswd yppasswd;
+
+#define YPPASSWDPROG 100009
+#define YPPASSWDVERS 1
+
+#if defined(__STDC__) || defined(__cplusplus)
+#define YPPASSWDPROC_UPDATE 1
+extern int * yppasswdproc_update_1(yppasswd *, CLIENT *);
+extern int * yppasswdproc_update_1_svc(yppasswd *, struct svc_req *);
+extern int yppasswdprog_1_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
+
+#else /* K&R C */
+#define YPPASSWDPROC_UPDATE 1
+extern int * yppasswdproc_update_1();
+extern int * yppasswdproc_update_1_svc();
+extern int yppasswdprog_1_freeresult ();
+#endif /* K&R C */
+
+/* the xdr functions */
+
+#if defined(__STDC__) || defined(__cplusplus)
+extern bool_t xdr_passwd (XDR *, passwd*);
+extern bool_t xdr_yppasswd (XDR *, yppasswd*);
+
+#else /* K&R C */
+extern bool_t xdr_passwd ();
+extern bool_t xdr_yppasswd ();
+
+#endif /* K&R C */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !_YPPASSWD_H_RPCGEN */
diff --git a/sysroot/usr/include/rpcsvc/yppasswd.x b/sysroot/usr/include/rpcsvc/yppasswd.x
new file mode 100644
index 0000000..ad349ad
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/yppasswd.x
@@ -0,0 +1,63 @@
+/* @(#)yppasswd.x 2.1 88/08/01 4.0 RPCSRC */
+/* @(#)yppasswd.x 1.1 87/04/13 Copyr 1987 Sun Micro */
+
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+
+/*
+ * YP password update protocol
+ * Requires unix authentication
+ */
+program YPPASSWDPROG {
+ version YPPASSWDVERS {
+ /*
+ * Update my passwd entry
+ */
+ int
+ YPPASSWDPROC_UPDATE(yppasswd) = 1;
+ } = 1;
+} = 100009;
+
+
+struct passwd {
+ string pw_name<>; /* username */
+ string pw_passwd<>; /* encrypted password */
+ int pw_uid; /* user id */
+ int pw_gid; /* group id */
+ string pw_gecos<>; /* in real life name */
+ string pw_dir<>; /* home directory */
+ string pw_shell<>; /* default shell */
+};
+
+struct yppasswd {
+ string oldpass<>; /* unencrypted old password */
+ passwd newpw; /* new passwd entry */
+};
+
+
diff --git a/sysroot/usr/include/rpcsvc/ypupd.h b/sysroot/usr/include/rpcsvc/ypupd.h
new file mode 100644
index 0000000..c53e69d
--- /dev/null
+++ b/sysroot/usr/include/rpcsvc/ypupd.h
@@ -0,0 +1,90 @@
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user or with the express written consent of
+ * Sun Microsystems, Inc.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+/*
+ * Copyright (c) 1986, 1990 by Sun Microsystems, Inc.
+ */
+/* from @(#)ypupdate_prot.x 1.3 91/03/11 TIRPC 1.0 */
+
+#ifndef __RPCSVC_YPUPD_H__
+#define __RPCSVC_YPUPD_H__
+
+#include <features.h>
+
+#include <rpc/rpc.h>
+
+#define MAXMAPNAMELEN 255
+#define MAXYPDATALEN 1023
+#define MAXERRMSGLEN 255
+
+__BEGIN_DECLS
+
+typedef struct {
+ u_int yp_buf_len;
+ char *yp_buf_val;
+} yp_buf;
+
+extern bool_t xdr_yp_buf (XDR *, yp_buf*);
+
+struct ypupdate_args {
+ char *mapname;
+ yp_buf key;
+ yp_buf datum;
+};
+typedef struct ypupdate_args ypupdate_args;
+
+extern bool_t xdr_ypupdate_args (XDR *, ypupdate_args*);
+
+struct ypdelete_args {
+ char *mapname;
+ yp_buf key;
+};
+typedef struct ypdelete_args ypdelete_args;
+
+extern bool_t xdr_ypdelete_args (XDR *, ypdelete_args*);
+
+#define YPU_PROG 100028
+#define YPU_VERS 1
+
+#define YPU_CHANGE 1
+extern u_int * ypu_change_1 (ypupdate_args *, CLIENT *);
+extern u_int * ypu_change_1_svc (ypupdate_args *, struct svc_req *);
+#define YPU_INSERT 2
+extern u_int * ypu_insert_1 (ypupdate_args *, CLIENT *);
+extern u_int * ypu_insert_1_svc (ypupdate_args *, struct svc_req *);
+#define YPU_DELETE 3
+extern u_int * ypu_delete_1 (ypdelete_args *, CLIENT *);
+extern u_int * ypu_delete_1_svc (ypdelete_args *, struct svc_req *);
+#define YPU_STORE 4
+extern u_int * ypu_store_1 (ypupdate_args *, CLIENT *);
+extern u_int * ypu_store_1_svc (ypupdate_args *, struct svc_req *);
+
+__END_DECLS
+
+#endif /* !__RPCSVC_YPUPD_H__ */
diff --git a/sysroot/usr/include/sched.h b/sysroot/usr/include/sched.h
new file mode 100644
index 0000000..e95c80f
--- /dev/null
+++ b/sysroot/usr/include/sched.h
@@ -0,0 +1,120 @@
+/* Definitions for POSIX 1003.1b-1993 (aka POSIX.4) scheduling interface.
+ Copyright (C) 1996,1997,1999,2001-2004,2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SCHED_H
+#define _SCHED_H 1
+
+#include <features.h>
+
+/* Get type definitions. */
+#include <bits/types.h>
+
+#define __need_size_t
+#include <stddef.h>
+
+#define __need_timespec
+#include <time.h>
+
+/* Get system specific constant and data structure definitions. */
+#include <bits/sched.h>
+/* Define the real names for the elements of `struct sched_param'. */
+#define sched_priority __sched_priority
+
+
+__BEGIN_DECLS
+
+/* Set scheduling parameters for a process. */
+extern int sched_setparam (__pid_t __pid, __const struct sched_param *__param)
+ __THROW;
+
+/* Retrieve scheduling parameters for a particular process. */
+extern int sched_getparam (__pid_t __pid, struct sched_param *__param) __THROW;
+
+/* Set scheduling algorithm and/or parameters for a process. */
+extern int sched_setscheduler (__pid_t __pid, int __policy,
+ __const struct sched_param *__param) __THROW;
+
+/* Retrieve scheduling algorithm for a particular purpose. */
+extern int sched_getscheduler (__pid_t __pid) __THROW;
+
+/* Yield the processor. */
+extern int sched_yield (void) __THROW;
+
+/* Get maximum priority value for a scheduler. */
+extern int sched_get_priority_max (int __algorithm) __THROW;
+
+/* Get minimum priority value for a scheduler. */
+extern int sched_get_priority_min (int __algorithm) __THROW;
+
+/* Get the SCHED_RR interval for the named process. */
+extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __THROW;
+
+
+#ifdef __USE_GNU
+/* Access macros for `cpu_set'. */
+# define CPU_SETSIZE __CPU_SETSIZE
+# define CPU_SET(cpu, cpusetp) __CPU_SET_S (cpu, sizeof (cpu_set_t), cpusetp)
+# define CPU_CLR(cpu, cpusetp) __CPU_CLR_S (cpu, sizeof (cpu_set_t), cpusetp)
+# define CPU_ISSET(cpu, cpusetp) __CPU_ISSET_S (cpu, sizeof (cpu_set_t), \
+ cpusetp)
+# define CPU_ZERO(cpusetp) __CPU_ZERO_S (sizeof (cpu_set_t), cpusetp)
+# define CPU_COUNT(cpusetp) __CPU_COUNT_S (sizeof (cpu_set_t), cpusetp)
+
+# define CPU_SET_S(cpu, setsize, cpusetp) __CPU_SET_S (cpu, setsize, cpusetp)
+# define CPU_CLR_S(cpu, setsize, cpusetp) __CPU_CLR_S (cpu, setsize, cpusetp)
+# define CPU_ISSET_S(cpu, setsize, cpusetp) __CPU_ISSET_S (cpu, setsize, \
+ cpusetp)
+# define CPU_ZERO_S(setsize, cpusetp) __CPU_ZERO_S (setsize, cpusetp)
+# define CPU_COUNT_S(setsize, cpusetp) __CPU_COUNT_S (setsize, cpusetp)
+
+# define CPU_EQUAL(cpusetp1, cpusetp2) \
+ __CPU_EQUAL_S (sizeof (cpu_set_t), cpusetp1, cpusetp2)
+# define CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \
+ __CPU_EQUAL_S (setsize, cpusetp1, cpusetp2)
+
+# define CPU_AND(destset, srcset1, srcset2) \
+ __CPU_OP_S (sizeof (cpu_set_t), destset, srcset1, srcset2, &)
+# define CPU_OR(destset, srcset1, srcset2) \
+ __CPU_OP_S (sizeof (cpu_set_t), destset, srcset1, srcset2, |)
+# define CPU_XOR(destset, srcset1, srcset2) \
+ __CPU_OP_S (sizeof (cpu_set_t), destset, srcset1, srcset2, ^)
+# define CPU_AND_S(setsize, destset, srcset1, srcset2) \
+ __CPU_OP_S (setsize, destset, srcset1, srcset2, &)
+# define CPU_OR_S(setsize, destset, srcset1, srcset2) \
+ __CPU_OP_S (setsize, destset, srcset1, srcset2, |)
+# define CPU_XOR_S(setsize, destset, srcset1, srcset2) \
+ __CPU_OP_S (setsize, destset, srcset1, srcset2, ^)
+
+# define CPU_ALLOC_SIZE(count) __CPU_ALLOC_SIZE (count)
+# define CPU_ALLOC(count) __CPU_ALLOC (count)
+# define CPU_FREE(cpuset) __CPU_FREE (cpuset)
+
+
+/* Set the CPU affinity for a task */
+extern int sched_setaffinity (__pid_t __pid, size_t __cpusetsize,
+ __const cpu_set_t *__cpuset) __THROW;
+
+/* Get the CPU affinity for a task */
+extern int sched_getaffinity (__pid_t __pid, size_t __cpusetsize,
+ cpu_set_t *__cpuset) __THROW;
+#endif
+
+__END_DECLS
+
+#endif /* sched.h */
diff --git a/sysroot/usr/include/scsi/scsi.h b/sysroot/usr/include/scsi/scsi.h
new file mode 100644
index 0000000..49ab758
--- /dev/null
+++ b/sysroot/usr/include/scsi/scsi.h
@@ -0,0 +1,226 @@
+/* Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * This header file contains public constants and structures used by
+ * the scsi code for linux.
+ */
+
+#ifndef _SCSI_SCSI_H
+#define _SCSI_SCSI_H 1
+
+#include <features.h>
+
+/*
+ * SCSI opcodes
+ */
+
+#define TEST_UNIT_READY 0x00
+#define REZERO_UNIT 0x01
+#define REQUEST_SENSE 0x03
+#define FORMAT_UNIT 0x04
+#define READ_BLOCK_LIMITS 0x05
+#define REASSIGN_BLOCKS 0x07
+#define READ_6 0x08
+#define WRITE_6 0x0a
+#define SEEK_6 0x0b
+#define READ_REVERSE 0x0f
+#define WRITE_FILEMARKS 0x10
+#define SPACE 0x11
+#define INQUIRY 0x12
+#define RECOVER_BUFFERED_DATA 0x14
+#define MODE_SELECT 0x15
+#define RESERVE 0x16
+#define RELEASE 0x17
+#define COPY 0x18
+#define ERASE 0x19
+#define MODE_SENSE 0x1a
+#define START_STOP 0x1b
+#define RECEIVE_DIAGNOSTIC 0x1c
+#define SEND_DIAGNOSTIC 0x1d
+#define ALLOW_MEDIUM_REMOVAL 0x1e
+
+#define SET_WINDOW 0x24
+#define READ_CAPACITY 0x25
+#define READ_10 0x28
+#define WRITE_10 0x2a
+#define SEEK_10 0x2b
+#define WRITE_VERIFY 0x2e
+#define VERIFY 0x2f
+#define SEARCH_HIGH 0x30
+#define SEARCH_EQUAL 0x31
+#define SEARCH_LOW 0x32
+#define SET_LIMITS 0x33
+#define PRE_FETCH 0x34
+#define READ_POSITION 0x34
+#define SYNCHRONIZE_CACHE 0x35
+#define LOCK_UNLOCK_CACHE 0x36
+#define READ_DEFECT_DATA 0x37
+#define MEDIUM_SCAN 0x38
+#define COMPARE 0x39
+#define COPY_VERIFY 0x3a
+#define WRITE_BUFFER 0x3b
+#define READ_BUFFER 0x3c
+#define UPDATE_BLOCK 0x3d
+#define READ_LONG 0x3e
+#define WRITE_LONG 0x3f
+#define CHANGE_DEFINITION 0x40
+#define WRITE_SAME 0x41
+#define READ_TOC 0x43
+#define LOG_SELECT 0x4c
+#define LOG_SENSE 0x4d
+#define MODE_SELECT_10 0x55
+#define RESERVE_10 0x56
+#define RELEASE_10 0x57
+#define MODE_SENSE_10 0x5a
+#define PERSISTENT_RESERVE_IN 0x5e
+#define PERSISTENT_RESERVE_OUT 0x5f
+#define MOVE_MEDIUM 0xa5
+#define READ_12 0xa8
+#define WRITE_12 0xaa
+#define WRITE_VERIFY_12 0xae
+#define SEARCH_HIGH_12 0xb0
+#define SEARCH_EQUAL_12 0xb1
+#define SEARCH_LOW_12 0xb2
+#define READ_ELEMENT_STATUS 0xb8
+#define SEND_VOLUME_TAG 0xb6
+#define WRITE_LONG_2 0xea
+
+/*
+ * Status codes
+ */
+
+#define GOOD 0x00
+#define CHECK_CONDITION 0x01
+#define CONDITION_GOOD 0x02
+#define BUSY 0x04
+#define INTERMEDIATE_GOOD 0x08
+#define INTERMEDIATE_C_GOOD 0x0a
+#define RESERVATION_CONFLICT 0x0c
+#define COMMAND_TERMINATED 0x11
+#define QUEUE_FULL 0x14
+
+#define STATUS_MASK 0x3e
+
+/*
+ * SENSE KEYS
+ */
+
+#define NO_SENSE 0x00
+#define RECOVERED_ERROR 0x01
+#define NOT_READY 0x02
+#define MEDIUM_ERROR 0x03
+#define HARDWARE_ERROR 0x04
+#define ILLEGAL_REQUEST 0x05
+#define UNIT_ATTENTION 0x06
+#define DATA_PROTECT 0x07
+#define BLANK_CHECK 0x08
+#define COPY_ABORTED 0x0a
+#define ABORTED_COMMAND 0x0b
+#define VOLUME_OVERFLOW 0x0d
+#define MISCOMPARE 0x0e
+
+
+/*
+ * DEVICE TYPES
+ */
+
+#define TYPE_DISK 0x00
+#define TYPE_TAPE 0x01
+#define TYPE_PROCESSOR 0x03 /* HP scanners use this */
+#define TYPE_WORM 0x04 /* Treated as ROM by our system */
+#define TYPE_ROM 0x05
+#define TYPE_SCANNER 0x06
+#define TYPE_MOD 0x07 /* Magneto-optical disk -
+ * - treated as TYPE_DISK */
+#define TYPE_MEDIUM_CHANGER 0x08
+#define TYPE_ENCLOSURE 0x0d /* Enclosure Services Device */
+#define TYPE_NO_LUN 0x7f
+
+/*
+ * standard mode-select header prepended to all mode-select commands
+ *
+ * moved here from cdrom.h -- kraxel
+ */
+
+struct ccs_modesel_head
+ {
+ unsigned char _r1; /* reserved. */
+ unsigned char medium; /* device-specific medium type. */
+ unsigned char _r2; /* reserved. */
+ unsigned char block_desc_length; /* block descriptor length. */
+ unsigned char density; /* device-specific density code. */
+ unsigned char number_blocks_hi; /* number of blocks in this block
+ desc. */
+ unsigned char number_blocks_med;
+ unsigned char number_blocks_lo;
+ unsigned char _r3;
+ unsigned char block_length_hi; /* block length for blocks in this
+ desc. */
+ unsigned char block_length_med;
+ unsigned char block_length_lo;
+ };
+
+/*
+ * MESSAGE CODES
+ */
+
+#define COMMAND_COMPLETE 0x00
+#define EXTENDED_MESSAGE 0x01
+#define EXTENDED_MODIFY_DATA_POINTER 0x00
+#define EXTENDED_SDTR 0x01
+#define EXTENDED_EXTENDED_IDENTIFY 0x02 /* SCSI-I only */
+#define EXTENDED_WDTR 0x03
+#define SAVE_POINTERS 0x02
+#define RESTORE_POINTERS 0x03
+#define DISCONNECT 0x04
+#define INITIATOR_ERROR 0x05
+#define ABORT 0x06
+#define MESSAGE_REJECT 0x07
+#define NOP 0x08
+#define MSG_PARITY_ERROR 0x09
+#define LINKED_CMD_COMPLETE 0x0a
+#define LINKED_FLG_CMD_COMPLETE 0x0b
+#define BUS_DEVICE_RESET 0x0c
+
+#define INITIATE_RECOVERY 0x0f /* SCSI-II only */
+#define RELEASE_RECOVERY 0x10 /* SCSI-II only */
+
+#define SIMPLE_QUEUE_TAG 0x20
+#define HEAD_OF_QUEUE_TAG 0x21
+#define ORDERED_QUEUE_TAG 0x22
+
+/*
+ * Here are some scsi specific ioctl commands which are sometimes useful.
+ */
+/* These are a few other constants only used by scsi devices. */
+
+#define SCSI_IOCTL_GET_IDLUN 0x5382
+
+/* Used to turn on and off tagged queuing for scsi devices. */
+
+#define SCSI_IOCTL_TAGGED_ENABLE 0x5383
+#define SCSI_IOCTL_TAGGED_DISABLE 0x5384
+
+/* Used to obtain the host number of a device. */
+#define SCSI_IOCTL_PROBE_HOST 0x5385
+
+/* Used to get the bus number for a device. */
+#define SCSI_IOCTL_GET_BUS_NUMBER 0x5386
+
+#endif /* scsi/scsi.h */
diff --git a/sysroot/usr/include/scsi/scsi_ioctl.h b/sysroot/usr/include/scsi/scsi_ioctl.h
new file mode 100644
index 0000000..11f0161
--- /dev/null
+++ b/sysroot/usr/include/scsi/scsi_ioctl.h
@@ -0,0 +1,34 @@
+/* Copyright (C) 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SCSI_IOCTL_H
+#define _SCSI_IOCTL_H
+
+/* IOCTLs for SCSI. */
+#define SCSI_IOCTL_SEND_COMMAND 1 /* Send a command to the SCSI host. */
+#define SCSI_IOCTL_TEST_UNIT_READY 2 /* Test if unit is ready. */
+#define SCSI_IOCTL_BENCHMARK_COMMAND 3
+#define SCSI_IOCTL_SYNC 4 /* Request synchronous parameters. */
+#define SCSI_IOCTL_START_UNIT 5
+#define SCSI_IOCTL_STOP_UNIT 6
+#define SCSI_IOCTL_DOORLOCK 0x5380 /* Lock the eject mechanism. */
+#define SCSI_IOCTL_DOORUNLOCK 0x5381 /* Unlock the mechanism. */
+
+#endif
+
+
diff --git a/sysroot/usr/include/scsi/sg.h b/sysroot/usr/include/scsi/sg.h
new file mode 100644
index 0000000..b0dc0ad
--- /dev/null
+++ b/sysroot/usr/include/scsi/sg.h
@@ -0,0 +1,275 @@
+/* Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ History:
+ Started: Aug 9 by Lawrence Foard (entropy@world.std.com), to allow user
+ process control of SCSI devices.
+ Development Sponsored by Killy Corp. NY NY
+*/
+
+#ifndef _SCSI_SG_H
+#define _SCSI_SG_H 1
+
+#include <features.h>
+
+
+/* New interface introduced in the 3.x SG drivers follows */
+
+/* Same structure as used by readv() Linux system call. It defines one
+ scatter-gather element. */
+typedef struct sg_iovec
+{
+ void * iov_base; /* Starting address */
+ size_t iov_len; /* Length in bytes */
+} sg_iovec_t;
+
+
+typedef struct sg_io_hdr
+{
+ int interface_id; /* [i] 'S' for SCSI generic (required) */
+ int dxfer_direction; /* [i] data transfer direction */
+ unsigned char cmd_len; /* [i] SCSI command length ( <= 16 bytes) */
+ unsigned char mx_sb_len; /* [i] max length to write to sbp */
+ unsigned short int iovec_count; /* [i] 0 implies no scatter gather */
+ unsigned int dxfer_len; /* [i] byte count of data transfer */
+ void * dxferp; /* [i], [*io] points to data transfer memory
+ or scatter gather list */
+ unsigned char * cmdp; /* [i], [*i] points to command to perform */
+ unsigned char * sbp; /* [i], [*o] points to sense_buffer memory */
+ unsigned int timeout; /* [i] MAX_UINT->no timeout (unit: millisec) */
+ unsigned int flags; /* [i] 0 -> default, see SG_FLAG... */
+ int pack_id; /* [i->o] unused internally (normally) */
+ void * usr_ptr; /* [i->o] unused internally */
+ unsigned char status; /* [o] scsi status */
+ unsigned char masked_status;/* [o] shifted, masked scsi status */
+ unsigned char msg_status; /* [o] messaging level data (optional) */
+ unsigned char sb_len_wr; /* [o] byte count actually written to sbp */
+ unsigned short int host_status; /* [o] errors from host adapter */
+ unsigned short int driver_status;/* [o] errors from software driver */
+ int resid; /* [o] dxfer_len - actual_transferred */
+ unsigned int duration; /* [o] time taken by cmd (unit: millisec) */
+ unsigned int info; /* [o] auxiliary information */
+} sg_io_hdr_t;
+
+
+/* Use negative values to flag difference from original sg_header structure. */
+#define SG_DXFER_NONE -1 /* e.g. a SCSI Test Unit Ready command */
+#define SG_DXFER_TO_DEV -2 /* e.g. a SCSI WRITE command */
+#define SG_DXFER_FROM_DEV -3 /* e.g. a SCSI READ command */
+#define SG_DXFER_TO_FROM_DEV -4 /* treated like SG_DXFER_FROM_DEV with the
+ additional property than during indirect
+ IO the user buffer is copied into the
+ kernel buffers before the transfer */
+
+
+/* following flag values can be "or"-ed together */
+#define SG_FLAG_DIRECT_IO 1 /* default is indirect IO */
+#define SG_FLAG_LUN_INHIBIT 2 /* default is to put device's lun into */
+ /* the 2nd byte of SCSI command */
+#define SG_FLAG_NO_DXFER 0x10000 /* no transfer of kernel buffers to/from */
+ /* user space (debug indirect IO) */
+
+/* The following 'info' values are "or"-ed together. */
+#define SG_INFO_OK_MASK 0x1
+#define SG_INFO_OK 0x0 /* no sense, host nor driver "noise" */
+#define SG_INFO_CHECK 0x1 /* something abnormal happened */
+
+#define SG_INFO_DIRECT_IO_MASK 0x6
+#define SG_INFO_INDIRECT_IO 0x0 /* data xfer via kernel buffers (or no xfer) */
+#define SG_INFO_DIRECT_IO 0x2 /* direct IO requested and performed */
+#define SG_INFO_MIXED_IO 0x4 /* part direct, part indirect IO */
+
+
+/* Request information about a specific SG device, used by
+ SG_GET_SCSI_ID ioctl (). */
+struct sg_scsi_id {
+ /* Host number as in "scsi<n>" where 'n' is one of 0, 1, 2 etc. */
+ int host_no;
+ int channel;
+ /* SCSI id of target device. */
+ int scsi_id;
+ int lun;
+ /* TYPE_... defined in <scsi/scsi.h>. */
+ int scsi_type;
+ /* Host (adapter) maximum commands per lun. */
+ short int h_cmd_per_lun;
+ /* Device (or adapter) maximum queue length. */
+ short int d_queue_depth;
+ /* Unused, set to 0 for now. */
+ int unused[2];
+};
+
+/* Used by SG_GET_REQUEST_TABLE ioctl(). */
+typedef struct sg_req_info {
+ char req_state; /* 0 -> not used, 1 -> written, 2 -> ready to read */
+ char orphan; /* 0 -> normal request, 1 -> from interruped SG_IO */
+ char sg_io_owned; /* 0 -> complete with read(), 1 -> owned by SG_IO */
+ char problem; /* 0 -> no problem detected, 1 -> error to report */
+ int pack_id; /* pack_id associated with request */
+ void * usr_ptr; /* user provided pointer (in new interface) */
+ unsigned int duration; /* millisecs elapsed since written (req_state==1)
+ or request duration (req_state==2) */
+ int unused;
+} sg_req_info_t;
+
+
+/* IOCTLs: Those ioctls that are relevant to the SG 3.x drivers follow.
+ [Those that only apply to the SG 2.x drivers are at the end of the file.]
+ (_GET_s yield result via 'int *' 3rd argument unless otherwise indicated) */
+
+#define SG_EMULATED_HOST 0x2203 /* true for emulated host adapter (ATAPI) */
+
+/* Used to configure SCSI command transformation layer for ATAPI devices */
+/* Only supported by the ide-scsi driver */
+#define SG_SET_TRANSFORM 0x2204 /* N.B. 3rd arg is not pointer but value: */
+ /* 3rd arg = 0 to disable transform, 1 to enable it */
+#define SG_GET_TRANSFORM 0x2205
+
+#define SG_SET_RESERVED_SIZE 0x2275 /* request a new reserved buffer size */
+#define SG_GET_RESERVED_SIZE 0x2272 /* actual size of reserved buffer */
+
+/* The following ioctl has a 'sg_scsi_id_t *' object as its 3rd argument. */
+#define SG_GET_SCSI_ID 0x2276 /* Yields fd's bus, chan, dev, lun + type */
+/* SCSI id information can also be obtained from SCSI_IOCTL_GET_IDLUN */
+
+/* Override host setting and always DMA using low memory ( <16MB on i386) */
+#define SG_SET_FORCE_LOW_DMA 0x2279 /* 0-> use adapter setting, 1-> force */
+#define SG_GET_LOW_DMA 0x227a /* 0-> use all ram for dma; 1-> low dma ram */
+
+/* When SG_SET_FORCE_PACK_ID set to 1, pack_id is input to read() which
+ tries to fetch a packet with a matching pack_id, waits, or returns EAGAIN.
+ If pack_id is -1 then read oldest waiting. When ...FORCE_PACK_ID set to 0
+ then pack_id ignored by read() and oldest readable fetched. */
+#define SG_SET_FORCE_PACK_ID 0x227b
+#define SG_GET_PACK_ID 0x227c /* Yields oldest readable pack_id (or -1) */
+
+#define SG_GET_NUM_WAITING 0x227d /* Number of commands awaiting read() */
+
+/* Yields max scatter gather tablesize allowed by current host adapter */
+#define SG_GET_SG_TABLESIZE 0x227F /* 0 implies can't do scatter gather */
+
+#define SG_GET_VERSION_NUM 0x2282 /* Example: version 2.1.34 yields 20134 */
+
+/* Returns -EBUSY if occupied. 3rd argument pointer to int (see next) */
+#define SG_SCSI_RESET 0x2284
+/* Associated values that can be given to SG_SCSI_RESET follow */
+#define SG_SCSI_RESET_NOTHING 0
+#define SG_SCSI_RESET_DEVICE 1
+#define SG_SCSI_RESET_BUS 2
+#define SG_SCSI_RESET_HOST 3
+
+/* synchronous SCSI command ioctl, (only in version 3 interface) */
+#define SG_IO 0x2285 /* similar effect as write() followed by read() */
+
+#define SG_GET_REQUEST_TABLE 0x2286 /* yields table of active requests */
+
+/* How to treat EINTR during SG_IO ioctl(), only in SG 3.x series */
+#define SG_SET_KEEP_ORPHAN 0x2287 /* 1 -> hold for read(), 0 -> drop (def) */
+#define SG_GET_KEEP_ORPHAN 0x2288
+
+
+#define SG_SCATTER_SZ (8 * 4096) /* PAGE_SIZE not available to user */
+/* Largest size (in bytes) a single scatter-gather list element can have.
+ The value must be a power of 2 and <= (PAGE_SIZE * 32) [131072 bytes on
+ i386]. The minimum value is PAGE_SIZE. If scatter-gather not supported
+ by adapter then this value is the largest data block that can be
+ read/written by a single scsi command. The user can find the value of
+ PAGE_SIZE by calling getpagesize() defined in unistd.h . */
+
+#define SG_DEFAULT_RETRIES 1
+
+/* Defaults, commented if they differ from original sg driver */
+#define SG_DEF_FORCE_LOW_DMA 0 /* was 1 -> memory below 16MB on i386 */
+#define SG_DEF_FORCE_PACK_ID 0
+#define SG_DEF_KEEP_ORPHAN 0
+#define SG_DEF_RESERVED_SIZE SG_SCATTER_SZ /* load time option */
+
+/* maximum outstanding requests, write() yields EDOM if exceeded */
+#define SG_MAX_QUEUE 16
+
+#define SG_BIG_BUFF SG_DEF_RESERVED_SIZE /* for backward compatibility */
+
+/* Alternate style type names, "..._t" variants preferred */
+typedef struct sg_io_hdr Sg_io_hdr;
+typedef struct sg_io_vec Sg_io_vec;
+typedef struct sg_scsi_id Sg_scsi_id;
+typedef struct sg_req_info Sg_req_info;
+
+
+/* vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv */
+/* The older SG interface based on the 'sg_header' structure follows. */
+/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */
+
+#define SG_MAX_SENSE 16 /* this only applies to the sg_header interface */
+
+struct sg_header
+ {
+ /* Length of incoming packet (including header). */
+ int pack_len;
+ /* Maximal length of expected reply. */
+ int reply_len;
+ /* Id number of packet. */
+ int pack_id;
+ /* 0==ok, otherwise error number. */
+ int result;
+ /* Force 12 byte command length for group 6 & 7 commands. */
+ unsigned int twelve_byte:1;
+ /* SCSI status from target. */
+ unsigned int target_status:5;
+ /* Host status (see "DID" codes). */
+ unsigned int host_status:8;
+ /* Driver status+suggestion. */
+ unsigned int driver_status:8;
+ /* Unused. */
+ unsigned int other_flags:10;
+ /* Output in 3 cases:
+ when target_status is CHECK_CONDITION or
+ when target_status is COMMAND_TERMINATED or
+ when (driver_status & DRIVER_SENSE) is true. */
+ unsigned char sense_buffer[SG_MAX_SENSE];
+ };
+
+
+/* IOCTLs: The following are not required (or ignored) when the sg_io_hdr_t
+ interface is used. They are kept for backward compatibility with
+ the original and version 2 drivers. */
+
+#define SG_SET_TIMEOUT 0x2201 /* Set timeout; *(int *)arg==timeout. */
+#define SG_GET_TIMEOUT 0x2202 /* Get timeout; return timeout. */
+
+/* Get/set command queuing state per fd (default is SG_DEF_COMMAND_Q). */
+#define SG_GET_COMMAND_Q 0x2270 /* Yields 0 (queuing off) or 1 (on). */
+#define SG_SET_COMMAND_Q 0x2271 /* Change queuing state with 0 or 1. */
+
+/* Turn on error sense trace (1..8), dump this device to log/console (9)
+ or dump all sg device states ( >9 ) to log/console. */
+#define SG_SET_DEBUG 0x227e /* 0 -> turn off debug */
+
+#define SG_NEXT_CMD_LEN 0x2283 /* Override SCSI command length with given
+ number on the next write() on this file
+ descriptor. */
+
+/* Defaults, commented if they differ from original sg driver */
+#define SG_DEFAULT_TIMEOUT (60*HZ) /* HZ == 'jiffies in 1 second' */
+#define SG_DEF_COMMAND_Q 0 /* command queuing is always on when
+ the new interface is used */
+#define SG_DEF_UNDERRUN_FLAG 0
+
+
+#endif /* scsi/sg.h */
diff --git a/sysroot/usr/include/search.h b/sysroot/usr/include/search.h
new file mode 100644
index 0000000..2ffba69
--- /dev/null
+++ b/sysroot/usr/include/search.h
@@ -0,0 +1,175 @@
+/* Declarations for System V style searching functions.
+ Copyright (C) 1995-1999, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SEARCH_H
+#define _SEARCH_H 1
+
+#include <features.h>
+
+#define __need_size_t
+#include <stddef.h>
+
+__BEGIN_DECLS
+
+#if defined __USE_SVID || defined __USE_XOPEN_EXTENDED
+/* Prototype structure for a linked-list data structure.
+ This is the type used by the `insque' and `remque' functions. */
+
+# ifdef __USE_GNU
+struct qelem
+ {
+ struct qelem *q_forw;
+ struct qelem *q_back;
+ char q_data[1];
+ };
+# endif
+
+
+/* Insert ELEM into a doubly-linked list, after PREV. */
+extern void insque (void *__elem, void *__prev) __THROW;
+
+/* Unlink ELEM from the doubly-linked list that it is in. */
+extern void remque (void *__elem) __THROW;
+#endif
+
+
+/* For use with hsearch(3). */
+#ifndef __COMPAR_FN_T
+# define __COMPAR_FN_T
+typedef int (*__compar_fn_t) (__const void *, __const void *);
+
+# ifdef __USE_GNU
+typedef __compar_fn_t comparison_fn_t;
+# endif
+#endif
+
+/* Action which shall be performed in the call the hsearch. */
+typedef enum
+ {
+ FIND,
+ ENTER
+ }
+ACTION;
+
+typedef struct entry
+ {
+ char *key;
+ void *data;
+ }
+ENTRY;
+
+/* Opaque type for internal use. */
+struct _ENTRY;
+
+/* Family of hash table handling functions. The functions also
+ have reentrant counterparts ending with _r. The non-reentrant
+ functions all work on a signle internal hashing table. */
+
+/* Search for entry matching ITEM.key in internal hash table. If
+ ACTION is `FIND' return found entry or signal error by returning
+ NULL. If ACTION is `ENTER' replace existing data (if any) with
+ ITEM.data. */
+extern ENTRY *hsearch (ENTRY __item, ACTION __action) __THROW;
+
+/* Create a new hashing table which will at most contain NEL elements. */
+extern int hcreate (size_t __nel) __THROW;
+
+/* Destroy current internal hashing table. */
+extern void hdestroy (void) __THROW;
+
+#ifdef __USE_GNU
+/* Data type for reentrant functions. */
+struct hsearch_data
+ {
+ struct _ENTRY *table;
+ unsigned int size;
+ unsigned int filled;
+ };
+
+/* Reentrant versions which can handle multiple hashing tables at the
+ same time. */
+extern int hsearch_r (ENTRY __item, ACTION __action, ENTRY **__retval,
+ struct hsearch_data *__htab) __THROW;
+extern int hcreate_r (size_t __nel, struct hsearch_data *__htab) __THROW;
+extern void hdestroy_r (struct hsearch_data *__htab) __THROW;
+#endif
+
+
+/* The tsearch routines are very interesting. They make many
+ assumptions about the compiler. It assumes that the first field
+ in node must be the "key" field, which points to the datum.
+ Everything depends on that. */
+/* For tsearch */
+typedef enum
+{
+ preorder,
+ postorder,
+ endorder,
+ leaf
+}
+VISIT;
+
+/* Search for an entry matching the given KEY in the tree pointed to
+ by *ROOTP and insert a new element if not found. */
+extern void *tsearch (__const void *__key, void **__rootp,
+ __compar_fn_t __compar);
+
+/* Search for an entry matching the given KEY in the tree pointed to
+ by *ROOTP. If no matching entry is available return NULL. */
+extern void *tfind (__const void *__key, void *__const *__rootp,
+ __compar_fn_t __compar);
+
+/* Remove the element matching KEY from the tree pointed to by *ROOTP. */
+extern void *tdelete (__const void *__restrict __key,
+ void **__restrict __rootp,
+ __compar_fn_t __compar);
+
+#ifndef __ACTION_FN_T
+# define __ACTION_FN_T
+typedef void (*__action_fn_t) (__const void *__nodep, VISIT __value,
+ int __level);
+#endif
+
+/* Walk through the whole tree and call the ACTION callback for every node
+ or leaf. */
+extern void twalk (__const void *__root, __action_fn_t __action);
+
+#ifdef __USE_GNU
+/* Callback type for function to free a tree node. If the keys are atomic
+ data this function should do nothing. */
+typedef void (*__free_fn_t) (void *__nodep);
+
+/* Destroy the whole tree, call FREEFCT for each node or leaf. */
+extern void tdestroy (void *__root, __free_fn_t __freefct);
+#endif
+
+
+/* Perform linear search for KEY by comparing by COMPAR in an array
+ [BASE,BASE+NMEMB*SIZE). */
+extern void *lfind (__const void *__key, __const void *__base,
+ size_t *__nmemb, size_t __size, __compar_fn_t __compar);
+
+/* Perform linear search for KEY by comparing by COMPAR function in
+ array [BASE,BASE+NMEMB*SIZE) and insert entry if not found. */
+extern void *lsearch (__const void *__key, void *__base,
+ size_t *__nmemb, size_t __size, __compar_fn_t __compar);
+
+__END_DECLS
+
+#endif /* search.h */
diff --git a/sysroot/usr/include/semaphore.h b/sysroot/usr/include/semaphore.h
new file mode 100644
index 0000000..4f13725
--- /dev/null
+++ b/sysroot/usr/include/semaphore.h
@@ -0,0 +1,79 @@
+/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SEMAPHORE_H
+#define _SEMAPHORE_H 1
+
+#include <features.h>
+#include <sys/types.h>
+#ifdef __USE_XOPEN2K
+# define __need_timespec
+# include <time.h>
+#endif
+
+/* Get the definition for sem_t. */
+#include <bits/semaphore.h>
+
+
+__BEGIN_DECLS
+
+/* Initialize semaphore object SEM to VALUE. If PSHARED then share it
+ with other processes. */
+extern int sem_init (sem_t *__sem, int __pshared, unsigned int __value)
+ __THROW;
+/* Free resources associated with semaphore object SEM. */
+extern int sem_destroy (sem_t *__sem) __THROW;
+
+/* Open a named semaphore NAME with open flags OFLAG. */
+extern sem_t *sem_open (__const char *__name, int __oflag, ...) __THROW;
+
+/* Close descriptor for named semaphore SEM. */
+extern int sem_close (sem_t *__sem) __THROW;
+
+/* Remove named semaphore NAME. */
+extern int sem_unlink (__const char *__name) __THROW;
+
+/* Wait for SEM being posted.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int sem_wait (sem_t *__sem);
+
+#ifdef __USE_XOPEN2K
+/* Similar to `sem_wait' but wait only until ABSTIME.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int sem_timedwait (sem_t *__restrict __sem,
+ __const struct timespec *__restrict __abstime);
+#endif
+
+/* Test whether SEM is posted. */
+extern int sem_trywait (sem_t *__sem) __THROW;
+
+/* Post SEM. */
+extern int sem_post (sem_t *__sem) __THROW;
+
+/* Get current value of SEM and store it in *SVAL. */
+extern int sem_getvalue (sem_t *__restrict __sem, int *__restrict __sval)
+ __THROW;
+
+
+__END_DECLS
+
+#endif /* semaphore.h */
diff --git a/sysroot/usr/include/setjmp.h b/sysroot/usr/include/setjmp.h
new file mode 100644
index 0000000..6b1037f
--- /dev/null
+++ b/sysroot/usr/include/setjmp.h
@@ -0,0 +1,116 @@
+/* Copyright (C) 1991-1999, 2001, 2002, 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99 Standard: 7.13 Nonlocal jumps <setjmp.h>
+ */
+
+#ifndef _SETJMP_H
+#define _SETJMP_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+#include <bits/setjmp.h> /* Get `__jmp_buf'. */
+#include <bits/sigset.h> /* Get `__sigset_t'. */
+
+
+/* Calling environment, plus possibly a saved signal mask. */
+struct __jmp_buf_tag
+ {
+ /* NOTE: The machine-dependent definitions of `__sigsetjmp'
+ assume that a `jmp_buf' begins with a `__jmp_buf' and that
+ `__mask_was_saved' follows it. Do not move these members
+ or add others before it. */
+ __jmp_buf __jmpbuf; /* Calling environment. */
+ int __mask_was_saved; /* Saved the signal mask? */
+ __sigset_t __saved_mask; /* Saved signal mask. */
+ };
+
+
+__BEGIN_NAMESPACE_STD
+
+typedef struct __jmp_buf_tag jmp_buf[1];
+
+/* Store the calling environment in ENV, also saving the signal mask.
+ Return 0. */
+extern int setjmp (jmp_buf __env) __THROW;
+
+__END_NAMESPACE_STD
+
+/* Store the calling environment in ENV, also saving the
+ signal mask if SAVEMASK is nonzero. Return 0.
+ This is the internal name for `sigsetjmp'. */
+extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __THROW;
+
+#ifndef __FAVOR_BSD
+/* Store the calling environment in ENV, not saving the signal mask.
+ Return 0. */
+extern int _setjmp (struct __jmp_buf_tag __env[1]) __THROW;
+
+/* Do not save the signal mask. This is equivalent to the `_setjmp'
+ BSD function. */
+# define setjmp(env) _setjmp (env)
+#else
+/* We are in 4.3 BSD-compatibility mode in which `setjmp'
+ saves the signal mask like `sigsetjmp (ENV, 1)'. We have to
+ define a macro since ISO C says `setjmp' is one. */
+# define setjmp(env) setjmp (env)
+#endif /* Favor BSD. */
+
+
+__BEGIN_NAMESPACE_STD
+
+/* Jump to the environment saved in ENV, making the
+ `setjmp' call there return VAL, or 1 if VAL is 0. */
+extern void longjmp (struct __jmp_buf_tag __env[1], int __val)
+ __THROW __attribute__ ((__noreturn__));
+
+__END_NAMESPACE_STD
+
+#if defined __USE_BSD || defined __USE_XOPEN
+/* Same. Usually `_longjmp' is used with `_setjmp', which does not save
+ the signal mask. But it is how ENV was saved that determines whether
+ `longjmp' restores the mask; `_longjmp' is just an alias. */
+extern void _longjmp (struct __jmp_buf_tag __env[1], int __val)
+ __THROW __attribute__ ((__noreturn__));
+#endif
+
+
+#ifdef __USE_POSIX
+/* Use the same type for `jmp_buf' and `sigjmp_buf'.
+ The `__mask_was_saved' flag determines whether
+ or not `longjmp' will restore the signal mask. */
+typedef struct __jmp_buf_tag sigjmp_buf[1];
+
+/* Store the calling environment in ENV, also saving the
+ signal mask if SAVEMASK is nonzero. Return 0. */
+# define sigsetjmp(env, savemask) __sigsetjmp (env, savemask)
+
+/* Jump to the environment saved in ENV, making the
+ sigsetjmp call there return VAL, or 1 if VAL is 0.
+ Restore the signal mask if that sigsetjmp call saved it.
+ This is just an alias `longjmp'. */
+extern void siglongjmp (sigjmp_buf __env, int __val)
+ __THROW __attribute__ ((__noreturn__));
+#endif /* Use POSIX. */
+
+__END_DECLS
+
+#endif /* setjmp.h */
diff --git a/sysroot/usr/include/sgtty.h b/sysroot/usr/include/sgtty.h
new file mode 100644
index 0000000..5b2bc41
--- /dev/null
+++ b/sysroot/usr/include/sgtty.h
@@ -0,0 +1,41 @@
+/* Copyright (C) 1991, 1992, 1996, 1998, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SGTTY_H
+#define _SGTTY_H 1
+
+#include <features.h>
+
+#include <sys/ioctl.h>
+
+/* On some systems this type is not defined by <bits/ioctl-types.h>;
+ in that case, the functions are just stubs that return ENOSYS. */
+struct sgttyb;
+
+__BEGIN_DECLS
+
+/* Fill in *PARAMS with terminal parameters associated with FD. */
+extern int gtty (int __fd, struct sgttyb *__params) __THROW;
+
+/* Set the terminal parameters associated with FD to *PARAMS. */
+extern int stty (int __fd, __const struct sgttyb *__params) __THROW;
+
+
+__END_DECLS
+
+#endif /* sgtty.h */
diff --git a/sysroot/usr/include/shadow.h b/sysroot/usr/include/shadow.h
new file mode 100644
index 0000000..778df52
--- /dev/null
+++ b/sysroot/usr/include/shadow.h
@@ -0,0 +1,149 @@
+/* Copyright (C) 1996, 1997, 1998, 1999, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Declaration of types and functions for shadow password suite. */
+
+#ifndef _SHADOW_H
+#define _SHADOW_H 1
+
+#include <features.h>
+
+#include <paths.h>
+
+#define __need_FILE
+#include <stdio.h>
+#define __need_size_t
+#include <stddef.h>
+
+/* Paths to the user database files. */
+#define SHADOW _PATH_SHADOW
+
+
+__BEGIN_DECLS
+
+/* Structure of the password file. */
+struct spwd
+ {
+ char *sp_namp; /* Login name. */
+ char *sp_pwdp; /* Encrypted password. */
+ long int sp_lstchg; /* Date of last change. */
+ long int sp_min; /* Minimum number of days between changes. */
+ long int sp_max; /* Maximum number of days between changes. */
+ long int sp_warn; /* Number of days to warn user to change
+ the password. */
+ long int sp_inact; /* Number of days the account may be
+ inactive. */
+ long int sp_expire; /* Number of days since 1970-01-01 until
+ account expires. */
+ unsigned long int sp_flag; /* Reserved. */
+ };
+
+
+/* Open database for reading.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern void setspent (void);
+
+/* Close database.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern void endspent (void);
+
+/* Get next entry from database, perhaps after opening the file.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern struct spwd *getspent (void);
+
+/* Get shadow entry matching NAME.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern struct spwd *getspnam (__const char *__name);
+
+/* Read shadow entry from STRING.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern struct spwd *sgetspent (__const char *__string);
+
+/* Read next shadow entry from STREAM.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern struct spwd *fgetspent (FILE *__stream);
+
+/* Write line containing shadow password entry to stream.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int putspent (__const struct spwd *__p, FILE *__stream);
+
+
+#ifdef __USE_MISC
+/* Reentrant versions of some of the functions above.
+
+ These functions are not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation they are cancellation points and
+ therefore not marked with __THROW. */
+extern int getspent_r (struct spwd *__result_buf, char *__buffer,
+ size_t __buflen, struct spwd **__result);
+
+extern int getspnam_r (__const char *__name, struct spwd *__result_buf,
+ char *__buffer, size_t __buflen,
+ struct spwd **__result);
+
+extern int sgetspent_r (__const char *__string, struct spwd *__result_buf,
+ char *__buffer, size_t __buflen,
+ struct spwd **__result);
+
+extern int fgetspent_r (FILE *__stream, struct spwd *__result_buf,
+ char *__buffer, size_t __buflen,
+ struct spwd **__result);
+#endif /* misc */
+
+
+/* The simple locking functionality provided here is not suitable for
+ multi-threaded applications. */
+
+/* Protect password file against multi writers. */
+extern int lckpwdf (void) __THROW;
+
+/* Unlock password file. */
+extern int ulckpwdf (void) __THROW;
+
+__END_DECLS
+
+#endif /* shadow.h */
diff --git a/sysroot/usr/include/signal.h b/sysroot/usr/include/signal.h
new file mode 100644
index 0000000..aa21037
--- /dev/null
+++ b/sysroot/usr/include/signal.h
@@ -0,0 +1,404 @@
+/* Copyright (C) 1991-2003, 2004, 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99 Standard: 7.14 Signal handling <signal.h>
+ */
+
+#ifndef _SIGNAL_H
+
+#if !defined __need_sig_atomic_t && !defined __need_sigset_t
+# define _SIGNAL_H
+#endif
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+#include <bits/sigset.h> /* __sigset_t, __sig_atomic_t. */
+
+/* An integral type that can be modified atomically, without the
+ possibility of a signal arriving in the middle of the operation. */
+#if defined __need_sig_atomic_t || defined _SIGNAL_H
+# ifndef __sig_atomic_t_defined
+# define __sig_atomic_t_defined
+__BEGIN_NAMESPACE_STD
+typedef __sig_atomic_t sig_atomic_t;
+__END_NAMESPACE_STD
+# endif
+# undef __need_sig_atomic_t
+#endif
+
+#if defined __need_sigset_t || (defined _SIGNAL_H && defined __USE_POSIX)
+# ifndef __sigset_t_defined
+# define __sigset_t_defined
+typedef __sigset_t sigset_t;
+# endif
+# undef __need_sigset_t
+#endif
+
+#ifdef _SIGNAL_H
+
+#include <bits/types.h>
+#include <bits/signum.h>
+
+#if defined __USE_XOPEN || defined __USE_XOPEN2K
+# ifndef __pid_t_defined
+typedef __pid_t pid_t;
+# define __pid_t_defined
+#endif
+#ifdef __USE_XOPEN
+# endif
+# ifndef __uid_t_defined
+typedef __uid_t uid_t;
+# define __uid_t_defined
+# endif
+#endif /* Unix98 */
+
+
+/* Type of a signal handler. */
+typedef void (*__sighandler_t) (int);
+
+/* The X/Open definition of `signal' specifies the SVID semantic. Use
+ the additional function `sysv_signal' when X/Open compatibility is
+ requested. */
+extern __sighandler_t __sysv_signal (int __sig, __sighandler_t __handler)
+ __THROW;
+#ifdef __USE_GNU
+extern __sighandler_t sysv_signal (int __sig, __sighandler_t __handler)
+ __THROW;
+#endif
+
+/* Set the handler for the signal SIG to HANDLER, returning the old
+ handler, or SIG_ERR on error.
+ By default `signal' has the BSD semantic. */
+__BEGIN_NAMESPACE_STD
+#ifdef __USE_BSD
+extern __sighandler_t signal (int __sig, __sighandler_t __handler)
+ __THROW;
+#else
+/* Make sure the used `signal' implementation is the SVID version. */
+# ifdef __REDIRECT_NTH
+extern __sighandler_t __REDIRECT_NTH (signal,
+ (int __sig, __sighandler_t __handler),
+ __sysv_signal);
+# else
+# define signal __sysv_signal
+# endif
+#endif
+__END_NAMESPACE_STD
+
+#ifdef __USE_XOPEN
+/* The X/Open definition of `signal' conflicts with the BSD version.
+ So they defined another function `bsd_signal'. */
+extern __sighandler_t bsd_signal (int __sig, __sighandler_t __handler)
+ __THROW;
+#endif
+
+/* Send signal SIG to process number PID. If PID is zero,
+ send SIG to all processes in the current process's process group.
+ If PID is < -1, send SIG to all processes in process group - PID. */
+#ifdef __USE_POSIX
+extern int kill (__pid_t __pid, int __sig) __THROW;
+#endif /* Use POSIX. */
+
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+/* Send SIG to all processes in process group PGRP.
+ If PGRP is zero, send SIG to all processes in
+ the current process's process group. */
+extern int killpg (__pid_t __pgrp, int __sig) __THROW;
+#endif /* Use BSD || X/Open Unix. */
+
+__BEGIN_NAMESPACE_STD
+/* Raise signal SIG, i.e., send SIG to yourself. */
+extern int raise (int __sig) __THROW;
+__END_NAMESPACE_STD
+
+#ifdef __USE_SVID
+/* SVID names for the same things. */
+extern __sighandler_t ssignal (int __sig, __sighandler_t __handler)
+ __THROW;
+extern int gsignal (int __sig) __THROW;
+#endif /* Use SVID. */
+
+#ifdef __USE_MISC
+/* Print a message describing the meaning of the given signal number. */
+extern void psignal (int __sig, __const char *__s);
+#endif /* Use misc. */
+
+
+/* The `sigpause' function has two different interfaces. The original
+ BSD definition defines the argument as a mask of the signal, while
+ the more modern interface in X/Open defines it as the signal
+ number. We go with the BSD version unless the user explicitly
+ selects the X/Open version.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int __sigpause (int __sig_or_mask, int __is_sig);
+
+#ifdef __FAVOR_BSD
+/* Set the mask of blocked signals to MASK,
+ wait for a signal to arrive, and then restore the mask. */
+extern int sigpause (int __mask) __THROW __attribute_deprecated__;
+#else
+# ifdef __USE_XOPEN
+# ifdef __GNUC__
+extern int sigpause (int __sig) __asm__ ("__xpg_sigpause");
+# else
+/* Remove a signal from the signal mask and suspend the process. */
+# define sigpause(sig) __sigpause ((sig), 1)
+# endif
+# endif
+#endif
+
+
+#ifdef __USE_BSD
+/* None of the following functions should be used anymore. They are here
+ only for compatibility. A single word (`int') is not guaranteed to be
+ enough to hold a complete signal mask and therefore these functions
+ simply do not work in many situations. Use `sigprocmask' instead. */
+
+/* Compute mask for signal SIG. */
+# define sigmask(sig) __sigmask(sig)
+
+/* Block signals in MASK, returning the old mask. */
+extern int sigblock (int __mask) __THROW __attribute_deprecated__;
+
+/* Set the mask of blocked signals to MASK, returning the old mask. */
+extern int sigsetmask (int __mask) __THROW __attribute_deprecated__;
+
+/* Return currently selected signal mask. */
+extern int siggetmask (void) __THROW __attribute_deprecated__;
+#endif /* Use BSD. */
+
+
+#ifdef __USE_MISC
+# define NSIG _NSIG
+#endif
+
+#ifdef __USE_GNU
+typedef __sighandler_t sighandler_t;
+#endif
+
+/* 4.4 BSD uses the name `sig_t' for this. */
+#ifdef __USE_BSD
+typedef __sighandler_t sig_t;
+#endif
+
+#ifdef __USE_POSIX
+
+# ifdef __USE_POSIX199309
+/* We need `struct timespec' later on. */
+# define __need_timespec
+# include <time.h>
+
+/* Get the `siginfo_t' type plus the needed symbols. */
+# include <bits/siginfo.h>
+# endif
+
+/* Clear all signals from SET. */
+extern int sigemptyset (sigset_t *__set) __THROW __nonnull ((1));
+
+/* Set all signals in SET. */
+extern int sigfillset (sigset_t *__set) __THROW __nonnull ((1));
+
+/* Add SIGNO to SET. */
+extern int sigaddset (sigset_t *__set, int __signo) __THROW __nonnull ((1));
+
+/* Remove SIGNO from SET. */
+extern int sigdelset (sigset_t *__set, int __signo) __THROW __nonnull ((1));
+
+/* Return 1 if SIGNO is in SET, 0 if not. */
+extern int sigismember (__const sigset_t *__set, int __signo)
+ __THROW __nonnull ((1));
+
+# ifdef __USE_GNU
+/* Return non-empty value is SET is not empty. */
+extern int sigisemptyset (__const sigset_t *__set) __THROW __nonnull ((1));
+
+/* Build new signal set by combining the two inputs set using logical AND. */
+extern int sigandset (sigset_t *__set, __const sigset_t *__left,
+ __const sigset_t *__right) __THROW __nonnull ((1, 2, 3));
+
+/* Build new signal set by combining the two inputs set using logical OR. */
+extern int sigorset (sigset_t *__set, __const sigset_t *__left,
+ __const sigset_t *__right) __THROW __nonnull ((1, 2, 3));
+# endif /* GNU */
+
+/* Get the system-specific definitions of `struct sigaction'
+ and the `SA_*' and `SIG_*'. constants. */
+# include <bits/sigaction.h>
+
+/* Get and/or change the set of blocked signals. */
+extern int sigprocmask (int __how, __const sigset_t *__restrict __set,
+ sigset_t *__restrict __oset) __THROW;
+
+/* Change the set of blocked signals to SET,
+ wait until a signal arrives, and restore the set of blocked signals.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int sigsuspend (__const sigset_t *__set) __nonnull ((1));
+
+/* Get and/or set the action for signal SIG. */
+extern int sigaction (int __sig, __const struct sigaction *__restrict __act,
+ struct sigaction *__restrict __oact) __THROW;
+
+/* Put in SET all signals that are blocked and waiting to be delivered. */
+extern int sigpending (sigset_t *__set) __THROW __nonnull ((1));
+
+
+/* Select any of pending signals from SET or wait for any to arrive.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int sigwait (__const sigset_t *__restrict __set, int *__restrict __sig)
+ __nonnull ((1, 2));
+
+# ifdef __USE_POSIX199309
+/* Select any of pending signals from SET and place information in INFO.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int sigwaitinfo (__const sigset_t *__restrict __set,
+ siginfo_t *__restrict __info) __nonnull ((1));
+
+/* Select any of pending signals from SET and place information in INFO.
+ Wait the time specified by TIMEOUT if no signal is pending.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int sigtimedwait (__const sigset_t *__restrict __set,
+ siginfo_t *__restrict __info,
+ __const struct timespec *__restrict __timeout)
+ __nonnull ((1));
+
+/* Send signal SIG to the process PID. Associate data in VAL with the
+ signal. */
+extern int sigqueue (__pid_t __pid, int __sig, __const union sigval __val)
+ __THROW;
+# endif /* Use POSIX 199306. */
+
+#endif /* Use POSIX. */
+
+#ifdef __USE_BSD
+
+/* Names of the signals. This variable exists only for compatibility.
+ Use `strsignal' instead (see <string.h>). */
+extern __const char *__const _sys_siglist[_NSIG];
+extern __const char *__const sys_siglist[_NSIG];
+
+/* Structure passed to `sigvec'. */
+struct sigvec
+ {
+ __sighandler_t sv_handler; /* Signal handler. */
+ int sv_mask; /* Mask of signals to be blocked. */
+
+ int sv_flags; /* Flags (see below). */
+# define sv_onstack sv_flags /* 4.2 BSD compatibility. */
+ };
+
+/* Bits in `sv_flags'. */
+# define SV_ONSTACK (1 << 0)/* Take the signal on the signal stack. */
+# define SV_INTERRUPT (1 << 1)/* Do not restart system calls. */
+# define SV_RESETHAND (1 << 2)/* Reset handler to SIG_DFL on receipt. */
+
+
+/* If VEC is non-NULL, set the handler for SIG to the `sv_handler' member
+ of VEC. The signals in `sv_mask' will be blocked while the handler runs.
+ If the SV_RESETHAND bit is set in `sv_flags', the handler for SIG will be
+ reset to SIG_DFL before `sv_handler' is entered. If OVEC is non-NULL,
+ it is filled in with the old information for SIG. */
+extern int sigvec (int __sig, __const struct sigvec *__vec,
+ struct sigvec *__ovec) __THROW;
+
+
+/* Get machine-dependent `struct sigcontext' and signal subcodes. */
+# include <bits/sigcontext.h>
+
+/* Restore the state saved in SCP. */
+extern int sigreturn (struct sigcontext *__scp) __THROW;
+
+#endif /* use BSD. */
+
+
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+# define __need_size_t
+# include <stddef.h>
+
+/* If INTERRUPT is nonzero, make signal SIG interrupt system calls
+ (causing them to fail with EINTR); if INTERRUPT is zero, make system
+ calls be restarted after signal SIG. */
+extern int siginterrupt (int __sig, int __interrupt) __THROW;
+
+# include <bits/sigstack.h>
+# ifdef __USE_XOPEN
+/* This will define `ucontext_t' and `mcontext_t'. */
+# include <sys/ucontext.h>
+# endif
+
+/* Run signals handlers on the stack specified by SS (if not NULL).
+ If OSS is not NULL, it is filled in with the old signal stack status.
+ This interface is obsolete and on many platform not implemented. */
+extern int sigstack (struct sigstack *__ss, struct sigstack *__oss)
+ __THROW __attribute_deprecated__;
+
+/* Alternate signal handler stack interface.
+ This interface should always be preferred over `sigstack'. */
+extern int sigaltstack (__const struct sigaltstack *__restrict __ss,
+ struct sigaltstack *__restrict __oss) __THROW;
+
+#endif /* use BSD or X/Open Unix. */
+
+#ifdef __USE_XOPEN_EXTENDED
+/* Simplified interface for signal management. */
+
+/* Add SIG to the calling process' signal mask. */
+extern int sighold (int __sig) __THROW;
+
+/* Remove SIG from the calling process' signal mask. */
+extern int sigrelse (int __sig) __THROW;
+
+/* Set the disposition of SIG to SIG_IGN. */
+extern int sigignore (int __sig) __THROW;
+
+/* Set the disposition of SIG. */
+extern __sighandler_t sigset (int __sig, __sighandler_t __disp) __THROW;
+#endif
+
+#if defined __USE_POSIX199506 || defined __USE_UNIX98
+/* Some of the functions for handling signals in threaded programs must
+ be defined here. */
+# include <bits/pthreadtypes.h>
+# include <bits/sigthread.h>
+#endif /* use Unix98 */
+
+/* The following functions are used internally in the C library and in
+ other code which need deep insights. */
+
+/* Return number of available real-time signal with highest priority. */
+extern int __libc_current_sigrtmin (void) __THROW;
+/* Return number of available real-time signal with lowest priority. */
+extern int __libc_current_sigrtmax (void) __THROW;
+
+#endif /* signal.h */
+
+__END_DECLS
+
+#endif /* not signal.h */
diff --git a/sysroot/usr/include/spawn.h b/sysroot/usr/include/spawn.h
new file mode 100644
index 0000000..ff77fcc
--- /dev/null
+++ b/sysroot/usr/include/spawn.h
@@ -0,0 +1,190 @@
+/* Definitions for POSIX spawn interface.
+ Copyright (C) 2000, 2003, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SPAWN_H
+#define _SPAWN_H 1
+
+#include <features.h>
+#include <sched.h>
+#include <signal.h>
+#include <sys/types.h>
+
+
+/* Data structure to contain attributes for thread creation. */
+typedef struct
+{
+ short int __flags;
+ pid_t __pgrp;
+ sigset_t __sd;
+ sigset_t __ss;
+ struct sched_param __sp;
+ int __policy;
+ int __pad[16];
+} posix_spawnattr_t;
+
+
+/* Data structure to contain information about the actions to be
+ performed in the new process with respect to file descriptors. */
+typedef struct
+{
+ int __allocated;
+ int __used;
+ struct __spawn_action *__actions;
+ int __pad[16];
+} posix_spawn_file_actions_t;
+
+
+/* Flags to be set in the `posix_spawnattr_t'. */
+#define POSIX_SPAWN_RESETIDS 0x01
+#define POSIX_SPAWN_SETPGROUP 0x02
+#define POSIX_SPAWN_SETSIGDEF 0x04
+#define POSIX_SPAWN_SETSIGMASK 0x08
+#define POSIX_SPAWN_SETSCHEDPARAM 0x10
+#define POSIX_SPAWN_SETSCHEDULER 0x20
+#ifdef __USE_GNU
+# define POSIX_SPAWN_USEVFORK 0x40
+#endif
+
+
+__BEGIN_DECLS
+
+/* Spawn a new process executing PATH with the attributes describes in *ATTRP.
+ Before running the process perform the actions described in FILE-ACTIONS.
+
+ This function is a possible cancellation points and therefore not
+ marked with __THROW. */
+extern int posix_spawn (pid_t *__restrict __pid,
+ __const char *__restrict __path,
+ __const posix_spawn_file_actions_t *__restrict
+ __file_actions,
+ __const posix_spawnattr_t *__restrict __attrp,
+ char *__const argv[__restrict_arr],
+ char *__const envp[__restrict_arr]);
+
+/* Similar to `posix_spawn' but search for FILE in the PATH.
+
+ This function is a possible cancellation points and therefore not
+ marked with __THROW. */
+extern int posix_spawnp (pid_t *__pid, __const char *__file,
+ __const posix_spawn_file_actions_t *__file_actions,
+ __const posix_spawnattr_t *__attrp,
+ char *__const argv[], char *__const envp[]);
+
+
+/* Initialize data structure with attributes for `spawn' to default values. */
+extern int posix_spawnattr_init (posix_spawnattr_t *__attr) __THROW;
+
+/* Free resources associated with ATTR. */
+extern int posix_spawnattr_destroy (posix_spawnattr_t *__attr) __THROW;
+
+/* Store signal mask for signals with default handling from ATTR in
+ SIGDEFAULT. */
+extern int posix_spawnattr_getsigdefault (__const posix_spawnattr_t *
+ __restrict __attr,
+ sigset_t *__restrict __sigdefault)
+ __THROW;
+
+/* Set signal mask for signals with default handling in ATTR to SIGDEFAULT. */
+extern int posix_spawnattr_setsigdefault (posix_spawnattr_t *__restrict __attr,
+ __const sigset_t *__restrict
+ __sigdefault)
+ __THROW;
+
+/* Store signal mask for the new process from ATTR in SIGMASK. */
+extern int posix_spawnattr_getsigmask (__const posix_spawnattr_t *__restrict
+ __attr,
+ sigset_t *__restrict __sigmask) __THROW;
+
+/* Set signal mask for the new process in ATTR to SIGMASK. */
+extern int posix_spawnattr_setsigmask (posix_spawnattr_t *__restrict __attr,
+ __const sigset_t *__restrict __sigmask)
+ __THROW;
+
+/* Get flag word from the attribute structure. */
+extern int posix_spawnattr_getflags (__const posix_spawnattr_t *__restrict
+ __attr,
+ short int *__restrict __flags) __THROW;
+
+/* Store flags in the attribute structure. */
+extern int posix_spawnattr_setflags (posix_spawnattr_t *_attr,
+ short int __flags) __THROW;
+
+/* Get process group ID from the attribute structure. */
+extern int posix_spawnattr_getpgroup (__const posix_spawnattr_t *__restrict
+ __attr, pid_t *__restrict __pgroup)
+ __THROW;
+
+/* Store process group ID in the attribute structure. */
+extern int posix_spawnattr_setpgroup (posix_spawnattr_t *__attr,
+ pid_t __pgroup) __THROW;
+
+/* Get scheduling policy from the attribute structure. */
+extern int posix_spawnattr_getschedpolicy (__const posix_spawnattr_t *
+ __restrict __attr,
+ int *__restrict __schedpolicy)
+ __THROW;
+
+/* Store scheduling policy in the attribute structure. */
+extern int posix_spawnattr_setschedpolicy (posix_spawnattr_t *__attr,
+ int __schedpolicy) __THROW;
+
+/* Get scheduling parameters from the attribute structure. */
+extern int posix_spawnattr_getschedparam (__const posix_spawnattr_t *
+ __restrict __attr,
+ struct sched_param *__restrict
+ __schedparam) __THROW;
+
+/* Store scheduling parameters in the attribute structure. */
+extern int posix_spawnattr_setschedparam (posix_spawnattr_t *__restrict __attr,
+ const struct sched_param *
+ __restrict __schedparam) __THROW;
+
+
+/* Initialize data structure for file attribute for `spawn' call. */
+extern int posix_spawn_file_actions_init (posix_spawn_file_actions_t *
+ __file_actions) __THROW;
+
+/* Free resources associated with FILE-ACTIONS. */
+extern int posix_spawn_file_actions_destroy (posix_spawn_file_actions_t *
+ __file_actions) __THROW;
+
+/* Add an action to FILE-ACTIONS which tells the implementation to call
+ `open' for the given file during the `spawn' call. */
+extern int posix_spawn_file_actions_addopen (posix_spawn_file_actions_t *
+ __restrict __file_actions,
+ int __fd,
+ __const char *__restrict __path,
+ int __oflag, mode_t __mode)
+ __THROW;
+
+/* Add an action to FILE-ACTIONS which tells the implementation to call
+ `close' for the given file descriptor during the `spawn' call. */
+extern int posix_spawn_file_actions_addclose (posix_spawn_file_actions_t *
+ __file_actions, int __fd)
+ __THROW;
+
+/* Add an action to FILE-ACTIONS which tells the implementation to call
+ `dup2' for the given file descriptors during the `spawn' call. */
+extern int posix_spawn_file_actions_adddup2 (posix_spawn_file_actions_t *
+ __file_actions,
+ int __fd, int __newfd) __THROW;
+
+__END_DECLS
+
+#endif /* spawn.h */
diff --git a/sysroot/usr/include/stab.h b/sysroot/usr/include/stab.h
new file mode 100644
index 0000000..9dc3c32
--- /dev/null
+++ b/sysroot/usr/include/stab.h
@@ -0,0 +1,17 @@
+#ifndef __GNU_STAB__
+
+/* Indicate the GNU stab.h is in use. */
+
+#define __GNU_STAB__
+
+#define __define_stab(NAME, CODE, STRING) NAME=CODE,
+
+enum __stab_debug_code
+{
+#include <bits/stab.def>
+LAST_UNUSED_STAB_CODE
+};
+
+#undef __define_stab
+
+#endif /* __GNU_STAB_ */
diff --git a/sysroot/usr/include/stdint.h b/sysroot/usr/include/stdint.h
new file mode 100644
index 0000000..2c729ad
--- /dev/null
+++ b/sysroot/usr/include/stdint.h
@@ -0,0 +1,320 @@
+/* Copyright (C) 1997,1998,1999,2000,2001,2006 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99: 7.18 Integer types <stdint.h>
+ */
+
+#ifndef _STDINT_H
+#define _STDINT_H 1
+
+#include <features.h>
+#include <bits/wchar.h>
+#include <bits/wordsize.h>
+
+/* Exact integral types. */
+
+/* Signed. */
+
+/* There is some amount of overlap with <sys/types.h> as known by inet code */
+#ifndef __int8_t_defined
+# define __int8_t_defined
+typedef signed char int8_t;
+typedef short int int16_t;
+typedef int int32_t;
+# if __WORDSIZE == 64
+typedef long int int64_t;
+# else
+__extension__
+typedef long long int int64_t;
+# endif
+#endif
+
+/* Unsigned. */
+typedef unsigned char uint8_t;
+typedef unsigned short int uint16_t;
+#ifndef __uint32_t_defined
+typedef unsigned int uint32_t;
+# define __uint32_t_defined
+#endif
+#if __WORDSIZE == 64
+typedef unsigned long int uint64_t;
+#else
+__extension__
+typedef unsigned long long int uint64_t;
+#endif
+
+
+/* Small types. */
+
+/* Signed. */
+typedef signed char int_least8_t;
+typedef short int int_least16_t;
+typedef int int_least32_t;
+#if __WORDSIZE == 64
+typedef long int int_least64_t;
+#else
+__extension__
+typedef long long int int_least64_t;
+#endif
+
+/* Unsigned. */
+typedef unsigned char uint_least8_t;
+typedef unsigned short int uint_least16_t;
+typedef unsigned int uint_least32_t;
+#if __WORDSIZE == 64
+typedef unsigned long int uint_least64_t;
+#else
+__extension__
+typedef unsigned long long int uint_least64_t;
+#endif
+
+
+/* Fast types. */
+
+/* Signed. */
+typedef signed char int_fast8_t;
+#if __WORDSIZE == 64
+typedef long int int_fast16_t;
+typedef long int int_fast32_t;
+typedef long int int_fast64_t;
+#else
+typedef int int_fast16_t;
+typedef int int_fast32_t;
+__extension__
+typedef long long int int_fast64_t;
+#endif
+
+/* Unsigned. */
+typedef unsigned char uint_fast8_t;
+#if __WORDSIZE == 64
+typedef unsigned long int uint_fast16_t;
+typedef unsigned long int uint_fast32_t;
+typedef unsigned long int uint_fast64_t;
+#else
+typedef unsigned int uint_fast16_t;
+typedef unsigned int uint_fast32_t;
+__extension__
+typedef unsigned long long int uint_fast64_t;
+#endif
+
+
+/* Types for `void *' pointers. */
+#if __WORDSIZE == 64
+# ifndef __intptr_t_defined
+typedef long int intptr_t;
+# define __intptr_t_defined
+# endif
+typedef unsigned long int uintptr_t;
+#else
+# ifndef __intptr_t_defined
+typedef int intptr_t;
+# define __intptr_t_defined
+# endif
+typedef unsigned int uintptr_t;
+#endif
+
+
+/* Largest integral types. */
+#if __WORDSIZE == 64
+typedef long int intmax_t;
+typedef unsigned long int uintmax_t;
+#else
+__extension__
+typedef long long int intmax_t;
+__extension__
+typedef unsigned long long int uintmax_t;
+#endif
+
+
+/* The ISO C99 standard specifies that in C++ implementations these
+ macros should only be defined if explicitly requested. */
+#if !defined __cplusplus || defined __STDC_LIMIT_MACROS
+
+# if __WORDSIZE == 64
+# define __INT64_C(c) c ## L
+# define __UINT64_C(c) c ## UL
+# else
+# define __INT64_C(c) c ## LL
+# define __UINT64_C(c) c ## ULL
+# endif
+
+/* Limits of integral types. */
+
+/* Minimum of signed integral types. */
+# define INT8_MIN (-128)
+# define INT16_MIN (-32767-1)
+# define INT32_MIN (-2147483647-1)
+# define INT64_MIN (-__INT64_C(9223372036854775807)-1)
+/* Maximum of signed integral types. */
+# define INT8_MAX (127)
+# define INT16_MAX (32767)
+# define INT32_MAX (2147483647)
+# define INT64_MAX (__INT64_C(9223372036854775807))
+
+/* Maximum of unsigned integral types. */
+# define UINT8_MAX (255)
+# define UINT16_MAX (65535)
+# define UINT32_MAX (4294967295U)
+# define UINT64_MAX (__UINT64_C(18446744073709551615))
+
+
+/* Minimum of signed integral types having a minimum size. */
+# define INT_LEAST8_MIN (-128)
+# define INT_LEAST16_MIN (-32767-1)
+# define INT_LEAST32_MIN (-2147483647-1)
+# define INT_LEAST64_MIN (-__INT64_C(9223372036854775807)-1)
+/* Maximum of signed integral types having a minimum size. */
+# define INT_LEAST8_MAX (127)
+# define INT_LEAST16_MAX (32767)
+# define INT_LEAST32_MAX (2147483647)
+# define INT_LEAST64_MAX (__INT64_C(9223372036854775807))
+
+/* Maximum of unsigned integral types having a minimum size. */
+# define UINT_LEAST8_MAX (255)
+# define UINT_LEAST16_MAX (65535)
+# define UINT_LEAST32_MAX (4294967295U)
+# define UINT_LEAST64_MAX (__UINT64_C(18446744073709551615))
+
+
+/* Minimum of fast signed integral types having a minimum size. */
+# define INT_FAST8_MIN (-128)
+# if __WORDSIZE == 64
+# define INT_FAST16_MIN (-9223372036854775807L-1)
+# define INT_FAST32_MIN (-9223372036854775807L-1)
+# else
+# define INT_FAST16_MIN (-2147483647-1)
+# define INT_FAST32_MIN (-2147483647-1)
+# endif
+# define INT_FAST64_MIN (-__INT64_C(9223372036854775807)-1)
+/* Maximum of fast signed integral types having a minimum size. */
+# define INT_FAST8_MAX (127)
+# if __WORDSIZE == 64
+# define INT_FAST16_MAX (9223372036854775807L)
+# define INT_FAST32_MAX (9223372036854775807L)
+# else
+# define INT_FAST16_MAX (2147483647)
+# define INT_FAST32_MAX (2147483647)
+# endif
+# define INT_FAST64_MAX (__INT64_C(9223372036854775807))
+
+/* Maximum of fast unsigned integral types having a minimum size. */
+# define UINT_FAST8_MAX (255)
+# if __WORDSIZE == 64
+# define UINT_FAST16_MAX (18446744073709551615UL)
+# define UINT_FAST32_MAX (18446744073709551615UL)
+# else
+# define UINT_FAST16_MAX (4294967295U)
+# define UINT_FAST32_MAX (4294967295U)
+# endif
+# define UINT_FAST64_MAX (__UINT64_C(18446744073709551615))
+
+
+/* Values to test for integral types holding `void *' pointer. */
+# if __WORDSIZE == 64
+# define INTPTR_MIN (-9223372036854775807L-1)
+# define INTPTR_MAX (9223372036854775807L)
+# define UINTPTR_MAX (18446744073709551615UL)
+# else
+# define INTPTR_MIN (-2147483647-1)
+# define INTPTR_MAX (2147483647)
+# define UINTPTR_MAX (4294967295U)
+# endif
+
+
+/* Minimum for largest signed integral type. */
+# define INTMAX_MIN (-__INT64_C(9223372036854775807)-1)
+/* Maximum for largest signed integral type. */
+# define INTMAX_MAX (__INT64_C(9223372036854775807))
+
+/* Maximum for largest unsigned integral type. */
+# define UINTMAX_MAX (__UINT64_C(18446744073709551615))
+
+
+/* Limits of other integer types. */
+
+/* Limits of `ptrdiff_t' type. */
+# if __WORDSIZE == 64
+# define PTRDIFF_MIN (-9223372036854775807L-1)
+# define PTRDIFF_MAX (9223372036854775807L)
+# else
+# define PTRDIFF_MIN (-2147483647-1)
+# define PTRDIFF_MAX (2147483647)
+# endif
+
+/* Limits of `sig_atomic_t'. */
+# define SIG_ATOMIC_MIN (-2147483647-1)
+# define SIG_ATOMIC_MAX (2147483647)
+
+/* Limit of `size_t' type. */
+# if __WORDSIZE == 64
+# define SIZE_MAX (18446744073709551615UL)
+# else
+# define SIZE_MAX (4294967295U)
+# endif
+
+/* Limits of `wchar_t'. */
+# ifndef WCHAR_MIN
+/* These constants might also be defined in <wchar.h>. */
+# define WCHAR_MIN __WCHAR_MIN
+# define WCHAR_MAX __WCHAR_MAX
+# endif
+
+/* Limits of `wint_t'. */
+# define WINT_MIN (0u)
+# define WINT_MAX (4294967295u)
+
+#endif /* C++ && limit macros */
+
+
+/* The ISO C99 standard specifies that in C++ implementations these
+ should only be defined if explicitly requested. */
+#if !defined __cplusplus || defined __STDC_CONSTANT_MACROS
+
+/* Signed. */
+# define INT8_C(c) c
+# define INT16_C(c) c
+# define INT32_C(c) c
+# if __WORDSIZE == 64
+# define INT64_C(c) c ## L
+# else
+# define INT64_C(c) c ## LL
+# endif
+
+/* Unsigned. */
+# define UINT8_C(c) c
+# define UINT16_C(c) c
+# define UINT32_C(c) c ## U
+# if __WORDSIZE == 64
+# define UINT64_C(c) c ## UL
+# else
+# define UINT64_C(c) c ## ULL
+# endif
+
+/* Maximal type. */
+# if __WORDSIZE == 64
+# define INTMAX_C(c) c ## L
+# define UINTMAX_C(c) c ## UL
+# else
+# define INTMAX_C(c) c ## LL
+# define UINTMAX_C(c) c ## ULL
+# endif
+
+#endif /* C++ && constant macros */
+
+#endif /* stdint.h */
diff --git a/sysroot/usr/include/stdio.h b/sysroot/usr/include/stdio.h
new file mode 100644
index 0000000..47c6cb0
--- /dev/null
+++ b/sysroot/usr/include/stdio.h
@@ -0,0 +1,916 @@
+/* Define ISO C stdio on top of C++ iostreams.
+ Copyright (C) 1991,1994-2004,2005,2006,2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99 Standard: 7.19 Input/output <stdio.h>
+ */
+
+#ifndef _STDIO_H
+
+#if !defined __need_FILE && !defined __need___FILE
+# define _STDIO_H 1
+# include <features.h>
+
+__BEGIN_DECLS
+
+# define __need_size_t
+# define __need_NULL
+# include <stddef.h>
+
+# include <bits/types.h>
+# define __need_FILE
+# define __need___FILE
+#endif /* Don't need FILE. */
+
+
+#if !defined __FILE_defined && defined __need_FILE
+
+/* Define outside of namespace so the C++ is happy. */
+struct _IO_FILE;
+
+__BEGIN_NAMESPACE_STD
+/* The opaque type of streams. This is the definition used elsewhere. */
+typedef struct _IO_FILE FILE;
+__END_NAMESPACE_STD
+#if defined __USE_LARGEFILE64 || defined __USE_SVID || defined __USE_POSIX \
+ || defined __USE_BSD || defined __USE_ISOC99 || defined __USE_XOPEN \
+ || defined __USE_POSIX2
+__USING_NAMESPACE_STD(FILE)
+#endif
+
+# define __FILE_defined 1
+#endif /* FILE not defined. */
+#undef __need_FILE
+
+
+#if !defined ____FILE_defined && defined __need___FILE
+
+/* The opaque type of streams. This is the definition used elsewhere. */
+typedef struct _IO_FILE __FILE;
+
+# define ____FILE_defined 1
+#endif /* __FILE not defined. */
+#undef __need___FILE
+
+
+#ifdef _STDIO_H
+#define _STDIO_USES_IOSTREAM
+
+#include <libio.h>
+
+#ifdef __USE_XOPEN
+# ifdef __GNUC__
+# ifndef _VA_LIST_DEFINED
+typedef _G_va_list va_list;
+# define _VA_LIST_DEFINED
+# endif
+# else
+# include <stdarg.h>
+# endif
+#endif
+
+/* The type of the second argument to `fgetpos' and `fsetpos'. */
+__BEGIN_NAMESPACE_STD
+#ifndef __USE_FILE_OFFSET64
+typedef _G_fpos_t fpos_t;
+#else
+typedef _G_fpos64_t fpos_t;
+#endif
+__END_NAMESPACE_STD
+#ifdef __USE_LARGEFILE64
+typedef _G_fpos64_t fpos64_t;
+#endif
+
+/* The possibilities for the third argument to `setvbuf'. */
+#define _IOFBF 0 /* Fully buffered. */
+#define _IOLBF 1 /* Line buffered. */
+#define _IONBF 2 /* No buffering. */
+
+
+/* Default buffer size. */
+#ifndef BUFSIZ
+# define BUFSIZ _IO_BUFSIZ
+#endif
+
+
+/* End of file character.
+ Some things throughout the library rely on this being -1. */
+#ifndef EOF
+# define EOF (-1)
+#endif
+
+
+/* The possibilities for the third argument to `fseek'.
+ These values should not be changed. */
+#define SEEK_SET 0 /* Seek from beginning of file. */
+#define SEEK_CUR 1 /* Seek from current position. */
+#define SEEK_END 2 /* Seek from end of file. */
+
+
+#if defined __USE_SVID || defined __USE_XOPEN
+/* Default path prefix for `tempnam' and `tmpnam'. */
+# define P_tmpdir "/tmp"
+#endif
+
+
+/* Get the values:
+ L_tmpnam How long an array of chars must be to be passed to `tmpnam'.
+ TMP_MAX The minimum number of unique filenames generated by tmpnam
+ (and tempnam when it uses tmpnam's name space),
+ or tempnam (the two are separate).
+ L_ctermid How long an array to pass to `ctermid'.
+ L_cuserid How long an array to pass to `cuserid'.
+ FOPEN_MAX Minimum number of files that can be open at once.
+ FILENAME_MAX Maximum length of a filename. */
+#include <bits/stdio_lim.h>
+
+
+/* Standard streams. */
+extern struct _IO_FILE *stdin; /* Standard input stream. */
+extern struct _IO_FILE *stdout; /* Standard output stream. */
+extern struct _IO_FILE *stderr; /* Standard error output stream. */
+/* C89/C99 say they're macros. Make them happy. */
+#define stdin stdin
+#define stdout stdout
+#define stderr stderr
+
+__BEGIN_NAMESPACE_STD
+/* Remove file FILENAME. */
+extern int remove (__const char *__filename) __THROW;
+/* Rename file OLD to NEW. */
+extern int rename (__const char *__old, __const char *__new) __THROW;
+__END_NAMESPACE_STD
+
+#ifdef __USE_ATFILE
+/* Rename file OLD relative to OLDFD to NEW relative to NEWFD. */
+extern int renameat (int __oldfd, __const char *__old, int __newfd,
+ __const char *__new) __THROW;
+#endif
+
+__BEGIN_NAMESPACE_STD
+/* Create a temporary file and open it read/write.
+
+ This function is a possible cancellation points and therefore not
+ marked with __THROW. */
+#ifndef __USE_FILE_OFFSET64
+extern FILE *tmpfile (void) __wur;
+#else
+# ifdef __REDIRECT
+extern FILE *__REDIRECT (tmpfile, (void), tmpfile64) __wur;
+# else
+# define tmpfile tmpfile64
+# endif
+#endif
+
+#ifdef __USE_LARGEFILE64
+extern FILE *tmpfile64 (void) __wur;
+#endif
+
+/* Generate a temporary filename. */
+extern char *tmpnam (char *__s) __THROW __wur;
+__END_NAMESPACE_STD
+
+#ifdef __USE_MISC
+/* This is the reentrant variant of `tmpnam'. The only difference is
+ that it does not allow S to be NULL. */
+extern char *tmpnam_r (char *__s) __THROW __wur;
+#endif
+
+
+#if defined __USE_SVID || defined __USE_XOPEN
+/* Generate a unique temporary filename using up to five characters of PFX
+ if it is not NULL. The directory to put this file in is searched for
+ as follows: First the environment variable "TMPDIR" is checked.
+ If it contains the name of a writable directory, that directory is used.
+ If not and if DIR is not NULL, that value is checked. If that fails,
+ P_tmpdir is tried and finally "/tmp". The storage for the filename
+ is allocated by `malloc'. */
+extern char *tempnam (__const char *__dir, __const char *__pfx)
+ __THROW __attribute_malloc__ __wur;
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+/* Close STREAM.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int fclose (FILE *__stream);
+/* Flush STREAM, or all streams if STREAM is NULL.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int fflush (FILE *__stream);
+__END_NAMESPACE_STD
+
+#ifdef __USE_MISC
+/* Faster versions when locking is not required.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int fflush_unlocked (FILE *__stream);
+#endif
+
+#ifdef __USE_GNU
+/* Close all streams.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int fcloseall (void);
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+#ifndef __USE_FILE_OFFSET64
+/* Open a file and create a new stream for it.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern FILE *fopen (__const char *__restrict __filename,
+ __const char *__restrict __modes) __wur;
+/* Open a file, replacing an existing stream with it.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern FILE *freopen (__const char *__restrict __filename,
+ __const char *__restrict __modes,
+ FILE *__restrict __stream) __wur;
+#else
+# ifdef __REDIRECT
+extern FILE *__REDIRECT (fopen, (__const char *__restrict __filename,
+ __const char *__restrict __modes), fopen64)
+ __wur;
+extern FILE *__REDIRECT (freopen, (__const char *__restrict __filename,
+ __const char *__restrict __modes,
+ FILE *__restrict __stream), freopen64)
+ __wur;
+# else
+# define fopen fopen64
+# define freopen freopen64
+# endif
+#endif
+__END_NAMESPACE_STD
+#ifdef __USE_LARGEFILE64
+extern FILE *fopen64 (__const char *__restrict __filename,
+ __const char *__restrict __modes) __wur;
+extern FILE *freopen64 (__const char *__restrict __filename,
+ __const char *__restrict __modes,
+ FILE *__restrict __stream) __wur;
+#endif
+
+#ifdef __USE_POSIX
+/* Create a new stream that refers to an existing system file descriptor. */
+extern FILE *fdopen (int __fd, __const char *__modes) __THROW __wur;
+#endif
+
+#ifdef __USE_GNU
+/* Create a new stream that refers to the given magic cookie,
+ and uses the given functions for input and output. */
+extern FILE *fopencookie (void *__restrict __magic_cookie,
+ __const char *__restrict __modes,
+ _IO_cookie_io_functions_t __io_funcs) __THROW __wur;
+
+/* Create a new stream that refers to a memory buffer. */
+extern FILE *fmemopen (void *__s, size_t __len, __const char *__modes)
+ __THROW __wur;
+
+/* Open a stream that writes into a malloc'd buffer that is expanded as
+ necessary. *BUFLOC and *SIZELOC are updated with the buffer's location
+ and the number of characters written on fflush or fclose. */
+extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __THROW __wur;
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+/* If BUF is NULL, make STREAM unbuffered.
+ Else make it use buffer BUF, of size BUFSIZ. */
+extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __THROW;
+/* Make STREAM use buffering mode MODE.
+ If BUF is not NULL, use N bytes of it for buffering;
+ else allocate an internal buffer N bytes long. */
+extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
+ int __modes, size_t __n) __THROW;
+__END_NAMESPACE_STD
+
+#ifdef __USE_BSD
+/* If BUF is NULL, make STREAM unbuffered.
+ Else make it use SIZE bytes of BUF for buffering. */
+extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
+ size_t __size) __THROW;
+
+/* Make STREAM line-buffered. */
+extern void setlinebuf (FILE *__stream) __THROW;
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+/* Write formatted output to STREAM.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int fprintf (FILE *__restrict __stream,
+ __const char *__restrict __format, ...);
+/* Write formatted output to stdout.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int printf (__const char *__restrict __format, ...);
+/* Write formatted output to S. */
+extern int sprintf (char *__restrict __s,
+ __const char *__restrict __format, ...) __THROW;
+
+/* Write formatted output to S from argument list ARG.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format,
+ _G_va_list __arg);
+/* Write formatted output to stdout from argument list ARG.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int vprintf (__const char *__restrict __format, _G_va_list __arg);
+/* Write formatted output to S from argument list ARG. */
+extern int vsprintf (char *__restrict __s, __const char *__restrict __format,
+ _G_va_list __arg) __THROW;
+__END_NAMESPACE_STD
+
+#if defined __USE_BSD || defined __USE_ISOC99 || defined __USE_UNIX98
+__BEGIN_NAMESPACE_C99
+/* Maximum chars of output to write in MAXLEN. */
+extern int snprintf (char *__restrict __s, size_t __maxlen,
+ __const char *__restrict __format, ...)
+ __THROW __attribute__ ((__format__ (__printf__, 3, 4)));
+
+extern int vsnprintf (char *__restrict __s, size_t __maxlen,
+ __const char *__restrict __format, _G_va_list __arg)
+ __THROW __attribute__ ((__format__ (__printf__, 3, 0)));
+__END_NAMESPACE_C99
+#endif
+
+#ifdef __USE_GNU
+/* Write formatted output to a string dynamically allocated with `malloc'.
+ Store the address of the string in *PTR. */
+extern int vasprintf (char **__restrict __ptr, __const char *__restrict __f,
+ _G_va_list __arg)
+ __THROW __attribute__ ((__format__ (__printf__, 2, 0))) __wur;
+extern int __asprintf (char **__restrict __ptr,
+ __const char *__restrict __fmt, ...)
+ __THROW __attribute__ ((__format__ (__printf__, 2, 3))) __wur;
+extern int asprintf (char **__restrict __ptr,
+ __const char *__restrict __fmt, ...)
+ __THROW __attribute__ ((__format__ (__printf__, 2, 3))) __wur;
+
+/* Write formatted output to a file descriptor.
+
+ These functions are not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation they are cancellation points and
+ therefore not marked with __THROW. */
+extern int vdprintf (int __fd, __const char *__restrict __fmt,
+ _G_va_list __arg)
+ __attribute__ ((__format__ (__printf__, 2, 0)));
+extern int dprintf (int __fd, __const char *__restrict __fmt, ...)
+ __attribute__ ((__format__ (__printf__, 2, 3)));
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+/* Read formatted input from STREAM.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int fscanf (FILE *__restrict __stream,
+ __const char *__restrict __format, ...) __wur;
+/* Read formatted input from stdin.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int scanf (__const char *__restrict __format, ...) __wur;
+/* Read formatted input from S. */
+extern int sscanf (__const char *__restrict __s,
+ __const char *__restrict __format, ...) __THROW;
+
+#if defined __USE_ISOC99 && !defined __USE_GNU \
+ && (!defined __LDBL_COMPAT || !defined __REDIRECT) \
+ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K)
+# ifdef __REDIRECT
+/* For strict ISO C99 or POSIX compliance disallow %as, %aS and %a[
+ GNU extension which conflicts with valid %a followed by letter
+ s, S or [. */
+extern int __REDIRECT (fscanf, (FILE *__restrict __stream,
+ __const char *__restrict __format, ...),
+ __isoc99_fscanf) __wur;
+extern int __REDIRECT (scanf, (__const char *__restrict __format, ...),
+ __isoc99_scanf) __wur;
+extern int __REDIRECT (sscanf, (__const char *__restrict __s,
+ __const char *__restrict __format, ...),
+ __isoc99_sscanf) __THROW;
+# else
+extern int __isoc99_fscanf (FILE *__restrict __stream,
+ __const char *__restrict __format, ...) __wur;
+extern int __isoc99_scanf (__const char *__restrict __format, ...) __wur;
+extern int __isoc99_sscanf (__const char *__restrict __s,
+ __const char *__restrict __format, ...) __THROW;
+# define fscanf __isoc99_fscanf
+# define scanf __isoc99_scanf
+# define sscanf __isoc99_sscanf
+# endif
+#endif
+
+__END_NAMESPACE_STD
+
+#ifdef __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Read formatted input from S into argument list ARG.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int vfscanf (FILE *__restrict __s, __const char *__restrict __format,
+ _G_va_list __arg)
+ __attribute__ ((__format__ (__scanf__, 2, 0))) __wur;
+
+/* Read formatted input from stdin into argument list ARG.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int vscanf (__const char *__restrict __format, _G_va_list __arg)
+ __attribute__ ((__format__ (__scanf__, 1, 0))) __wur;
+
+/* Read formatted input from S into argument list ARG. */
+extern int vsscanf (__const char *__restrict __s,
+ __const char *__restrict __format, _G_va_list __arg)
+ __THROW __attribute__ ((__format__ (__scanf__, 2, 0)));
+
+# if !defined __USE_GNU \
+ && (!defined __LDBL_COMPAT || !defined __REDIRECT) \
+ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K)
+# ifdef __REDIRECT
+/* For strict ISO C99 or POSIX compliance disallow %as, %aS and %a[
+ GNU extension which conflicts with valid %a followed by letter
+ s, S or [. */
+extern int __REDIRECT (vfscanf,
+ (FILE *__restrict __s,
+ __const char *__restrict __format, _G_va_list __arg),
+ __isoc99_vfscanf)
+ __attribute__ ((__format__ (__scanf__, 2, 0))) __wur;
+extern int __REDIRECT (vscanf, (__const char *__restrict __format,
+ _G_va_list __arg), __isoc99_vfscanf)
+ __attribute__ ((__format__ (__scanf__, 1, 0))) __wur;
+extern int __REDIRECT (vsscanf,
+ (__const char *__restrict __s,
+ __const char *__restrict __format, _G_va_list __arg),
+ __isoc99_vsscanf)
+ __THROW __attribute__ ((__format__ (__scanf__, 2, 0)));
+# else
+extern int __isoc99_vfscanf (FILE *__restrict __s,
+ __const char *__restrict __format,
+ _G_va_list __arg) __wur;
+extern int __isoc99_vscanf (__const char *__restrict __format,
+ _G_va_list __arg) __wur;
+extern int __isoc99_vsscanf (__const char *__restrict __s,
+ __const char *__restrict __format,
+ _G_va_list __arg) __THROW;
+# define vfscanf __isoc99_vfscanf
+# define vscanf __isoc99_vsscanf
+# define vsscanf __isoc99_vsscanf
+# endif
+# endif
+
+__END_NAMESPACE_C99
+#endif /* Use ISO C9x. */
+
+
+__BEGIN_NAMESPACE_STD
+/* Read a character from STREAM.
+
+ These functions are possible cancellation points and therefore not
+ marked with __THROW. */
+extern int fgetc (FILE *__stream);
+extern int getc (FILE *__stream);
+
+/* Read a character from stdin.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int getchar (void);
+__END_NAMESPACE_STD
+
+/* The C standard explicitly says this is a macro, so we always do the
+ optimization for it. */
+#define getc(_fp) _IO_getc (_fp)
+
+#if defined __USE_POSIX || defined __USE_MISC
+/* These are defined in POSIX.1:1996.
+
+ These functions are possible cancellation points and therefore not
+ marked with __THROW. */
+extern int getc_unlocked (FILE *__stream);
+extern int getchar_unlocked (void);
+#endif /* Use POSIX or MISC. */
+
+#ifdef __USE_MISC
+/* Faster version when locking is not necessary.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int fgetc_unlocked (FILE *__stream);
+#endif /* Use MISC. */
+
+
+__BEGIN_NAMESPACE_STD
+/* Write a character to STREAM.
+
+ These functions are possible cancellation points and therefore not
+ marked with __THROW.
+
+ These functions is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int fputc (int __c, FILE *__stream);
+extern int putc (int __c, FILE *__stream);
+
+/* Write a character to stdout.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int putchar (int __c);
+__END_NAMESPACE_STD
+
+/* The C standard explicitly says this can be a macro,
+ so we always do the optimization for it. */
+#define putc(_ch, _fp) _IO_putc (_ch, _fp)
+
+#ifdef __USE_MISC
+/* Faster version when locking is not necessary.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int fputc_unlocked (int __c, FILE *__stream);
+#endif /* Use MISC. */
+
+#if defined __USE_POSIX || defined __USE_MISC
+/* These are defined in POSIX.1:1996.
+
+ These functions are possible cancellation points and therefore not
+ marked with __THROW. */
+extern int putc_unlocked (int __c, FILE *__stream);
+extern int putchar_unlocked (int __c);
+#endif /* Use POSIX or MISC. */
+
+
+#if defined __USE_SVID || defined __USE_MISC \
+ || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
+/* Get a word (int) from STREAM. */
+extern int getw (FILE *__stream);
+
+/* Write a word (int) to STREAM. */
+extern int putw (int __w, FILE *__stream);
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+/* Get a newline-terminated string of finite length from STREAM.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
+ __wur;
+
+/* Get a newline-terminated string from stdin, removing the newline.
+ DO NOT USE THIS FUNCTION!! There is no limit on how much it will read.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern char *gets (char *__s) __wur;
+__END_NAMESPACE_STD
+
+#ifdef __USE_GNU
+/* This function does the same as `fgets' but does not lock the stream.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern char *fgets_unlocked (char *__restrict __s, int __n,
+ FILE *__restrict __stream) __wur;
+#endif
+
+
+#ifdef __USE_GNU
+/* Read up to (and including) a DELIMITER from STREAM into *LINEPTR
+ (and null-terminate it). *LINEPTR is a pointer returned from malloc (or
+ NULL), pointing to *N characters of space. It is realloc'd as
+ necessary. Returns the number of characters read (not including the
+ null terminator), or -1 on error or EOF.
+
+ These functions are not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation they are cancellation points and
+ therefore not marked with __THROW. */
+extern _IO_ssize_t __getdelim (char **__restrict __lineptr,
+ size_t *__restrict __n, int __delimiter,
+ FILE *__restrict __stream) __wur;
+extern _IO_ssize_t getdelim (char **__restrict __lineptr,
+ size_t *__restrict __n, int __delimiter,
+ FILE *__restrict __stream) __wur;
+
+/* Like `getdelim', but reads up to a newline.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern _IO_ssize_t getline (char **__restrict __lineptr,
+ size_t *__restrict __n,
+ FILE *__restrict __stream) __wur;
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+/* Write a string to STREAM.
+
+ This function is a possible cancellation points and therefore not
+ marked with __THROW. */
+extern int fputs (__const char *__restrict __s, FILE *__restrict __stream);
+
+/* Write a string, followed by a newline, to stdout.
+
+ This function is a possible cancellation points and therefore not
+ marked with __THROW. */
+extern int puts (__const char *__s);
+
+
+/* Push a character back onto the input buffer of STREAM.
+
+ This function is a possible cancellation points and therefore not
+ marked with __THROW. */
+extern int ungetc (int __c, FILE *__stream);
+
+
+/* Read chunks of generic data from STREAM.
+
+ This function is a possible cancellation points and therefore not
+ marked with __THROW. */
+extern size_t fread (void *__restrict __ptr, size_t __size,
+ size_t __n, FILE *__restrict __stream) __wur;
+/* Write chunks of generic data to STREAM.
+
+ This function is a possible cancellation points and therefore not
+ marked with __THROW. */
+extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
+ size_t __n, FILE *__restrict __s) __wur;
+__END_NAMESPACE_STD
+
+#ifdef __USE_GNU
+/* This function does the same as `fputs' but does not lock the stream.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int fputs_unlocked (__const char *__restrict __s,
+ FILE *__restrict __stream);
+#endif
+
+#ifdef __USE_MISC
+/* Faster versions when locking is not necessary.
+
+ These functions are not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation they are cancellation points and
+ therefore not marked with __THROW. */
+extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
+ size_t __n, FILE *__restrict __stream) __wur;
+extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size,
+ size_t __n, FILE *__restrict __stream) __wur;
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+/* Seek to a certain position on STREAM.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int fseek (FILE *__stream, long int __off, int __whence);
+/* Return the current position of STREAM.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern long int ftell (FILE *__stream) __wur;
+/* Rewind to the beginning of STREAM.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern void rewind (FILE *__stream);
+__END_NAMESPACE_STD
+
+/* The Single Unix Specification, Version 2, specifies an alternative,
+ more adequate interface for the two functions above which deal with
+ file offset. `long int' is not the right type. These definitions
+ are originally defined in the Large File Support API. */
+
+#if defined __USE_LARGEFILE || defined __USE_XOPEN2K
+# ifndef __USE_FILE_OFFSET64
+/* Seek to a certain position on STREAM.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int fseeko (FILE *__stream, __off_t __off, int __whence);
+/* Return the current position of STREAM.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern __off_t ftello (FILE *__stream) __wur;
+# else
+# ifdef __REDIRECT
+extern int __REDIRECT (fseeko,
+ (FILE *__stream, __off64_t __off, int __whence),
+ fseeko64);
+extern __off64_t __REDIRECT (ftello, (FILE *__stream), ftello64);
+# else
+# define fseeko fseeko64
+# define ftello ftello64
+# endif
+# endif
+#endif
+
+__BEGIN_NAMESPACE_STD
+#ifndef __USE_FILE_OFFSET64
+/* Get STREAM's position.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos);
+/* Set STREAM's position.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int fsetpos (FILE *__stream, __const fpos_t *__pos);
+#else
+# ifdef __REDIRECT
+extern int __REDIRECT (fgetpos, (FILE *__restrict __stream,
+ fpos_t *__restrict __pos), fgetpos64);
+extern int __REDIRECT (fsetpos,
+ (FILE *__stream, __const fpos_t *__pos), fsetpos64);
+# else
+# define fgetpos fgetpos64
+# define fsetpos fsetpos64
+# endif
+#endif
+__END_NAMESPACE_STD
+
+#ifdef __USE_LARGEFILE64
+extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
+extern __off64_t ftello64 (FILE *__stream) __wur;
+extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
+extern int fsetpos64 (FILE *__stream, __const fpos64_t *__pos);
+#endif
+
+__BEGIN_NAMESPACE_STD
+/* Clear the error and EOF indicators for STREAM. */
+extern void clearerr (FILE *__stream) __THROW;
+/* Return the EOF indicator for STREAM. */
+extern int feof (FILE *__stream) __THROW __wur;
+/* Return the error indicator for STREAM. */
+extern int ferror (FILE *__stream) __THROW __wur;
+__END_NAMESPACE_STD
+
+#ifdef __USE_MISC
+/* Faster versions when locking is not required. */
+extern void clearerr_unlocked (FILE *__stream) __THROW;
+extern int feof_unlocked (FILE *__stream) __THROW __wur;
+extern int ferror_unlocked (FILE *__stream) __THROW __wur;
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+/* Print a message describing the meaning of the value of errno.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern void perror (__const char *__s);
+__END_NAMESPACE_STD
+
+/* Provide the declarations for `sys_errlist' and `sys_nerr' if they
+ are available on this system. Even if available, these variables
+ should not be used directly. The `strerror' function provides
+ all the necessary functionality. */
+#include <bits/sys_errlist.h>
+
+
+#ifdef __USE_POSIX
+/* Return the system file descriptor for STREAM. */
+extern int fileno (FILE *__stream) __THROW __wur;
+#endif /* Use POSIX. */
+
+#ifdef __USE_MISC
+/* Faster version when locking is not required. */
+extern int fileno_unlocked (FILE *__stream) __THROW __wur;
+#endif
+
+
+#if (defined __USE_POSIX2 || defined __USE_SVID || defined __USE_BSD || \
+ defined __USE_MISC)
+/* Create a new stream connected to a pipe running the given command.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern FILE *popen (__const char *__command, __const char *__modes) __wur;
+
+/* Close a stream opened by popen and return the status of its child.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int pclose (FILE *__stream);
+#endif
+
+
+#ifdef __USE_POSIX
+/* Return the name of the controlling terminal. */
+extern char *ctermid (char *__s) __THROW;
+#endif /* Use POSIX. */
+
+
+#ifdef __USE_XOPEN
+/* Return the name of the current user. */
+extern char *cuserid (char *__s);
+#endif /* Use X/Open, but not issue 6. */
+
+
+#ifdef __USE_GNU
+struct obstack; /* See <obstack.h>. */
+
+/* Write formatted output to an obstack. */
+extern int obstack_printf (struct obstack *__restrict __obstack,
+ __const char *__restrict __format, ...)
+ __THROW __attribute__ ((__format__ (__printf__, 2, 3)));
+extern int obstack_vprintf (struct obstack *__restrict __obstack,
+ __const char *__restrict __format,
+ _G_va_list __args)
+ __THROW __attribute__ ((__format__ (__printf__, 2, 0)));
+#endif /* Use GNU. */
+
+
+#if defined __USE_POSIX || defined __USE_MISC
+/* These are defined in POSIX.1:1996. */
+
+/* Acquire ownership of STREAM. */
+extern void flockfile (FILE *__stream) __THROW;
+
+/* Try to acquire ownership of STREAM but do not block if it is not
+ possible. */
+extern int ftrylockfile (FILE *__stream) __THROW __wur;
+
+/* Relinquish the ownership granted for STREAM. */
+extern void funlockfile (FILE *__stream) __THROW;
+#endif /* POSIX || misc */
+
+#if defined __USE_XOPEN && !defined __USE_XOPEN2K && !defined __USE_GNU
+/* The X/Open standard requires some functions and variables to be
+ declared here which do not belong into this header. But we have to
+ follow. In GNU mode we don't do this nonsense. */
+# define __need_getopt
+# include <getopt.h>
+#endif /* X/Open, but not issue 6 and not for GNU. */
+
+/* If we are compiling with optimizing read this file. It contains
+ several optimizing inline functions and macros. */
+#ifdef __USE_EXTERN_INLINES
+# include <bits/stdio.h>
+#endif
+#if __USE_FORTIFY_LEVEL > 0 && defined __extern_always_inline
+# include <bits/stdio2.h>
+#endif
+#ifdef __LDBL_COMPAT
+# include <bits/stdio-ldbl.h>
+#endif
+
+__END_DECLS
+
+#endif /* <stdio.h> included. */
+
+#endif /* !_STDIO_H */
diff --git a/sysroot/usr/include/stdio_ext.h b/sysroot/usr/include/stdio_ext.h
new file mode 100644
index 0000000..23d12e0
--- /dev/null
+++ b/sysroot/usr/include/stdio_ext.h
@@ -0,0 +1,87 @@
+/* Functions to access FILE structure internals.
+ Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* This header contains the same definitions as the header of the same name
+ on Sun's Solaris OS. */
+
+#ifndef _STDIO_EXT_H
+#define _STDIO_EXT_H 1
+
+#include <stdio.h>
+
+enum
+{
+ /* Query current state of the locking status. */
+ FSETLOCKING_QUERY = 0,
+#define FSETLOCKING_QUERY FSETLOCKING_QUERY
+ /* The library protects all uses of the stream functions, except for
+ uses of the *_unlocked functions, by calls equivalent to flockfile(). */
+ FSETLOCKING_INTERNAL,
+#define FSETLOCKING_INTERNAL FSETLOCKING_INTERNAL
+ /* The user will take care of locking. */
+ FSETLOCKING_BYCALLER
+#define FSETLOCKING_BYCALLER FSETLOCKING_BYCALLER
+};
+
+
+__BEGIN_DECLS
+
+/* Return the size of the buffer of FP in bytes currently in use by
+ the given stream. */
+extern size_t __fbufsize (FILE *__fp) __THROW;
+
+
+/* Return non-zero value iff the stream FP is opened readonly, or if the
+ last operation on the stream was a read operation. */
+extern int __freading (FILE *__fp) __THROW;
+
+/* Return non-zero value iff the stream FP is opened write-only or
+ append-only, or if the last operation on the stream was a write
+ operation. */
+extern int __fwriting (FILE *__fp) __THROW;
+
+
+/* Return non-zero value iff stream FP is not opened write-only or
+ append-only. */
+extern int __freadable (FILE *__fp) __THROW;
+
+/* Return non-zero value iff stream FP is not opened read-only. */
+extern int __fwritable (FILE *__fp) __THROW;
+
+
+/* Return non-zero value iff the stream FP is line-buffered. */
+extern int __flbf (FILE *__fp) __THROW;
+
+
+/* Discard all pending buffered I/O on the stream FP. */
+extern void __fpurge (FILE *__fp) __THROW;
+
+/* Return amount of output in bytes pending on a stream FP. */
+extern size_t __fpending (FILE *__fp) __THROW;
+
+/* Flush all line-buffered files. */
+extern void _flushlbf (void);
+
+
+/* Set locking status of stream FP to TYPE. */
+extern int __fsetlocking (FILE *__fp, int __type) __THROW;
+
+__END_DECLS
+
+#endif /* stdio_ext.h */
diff --git a/sysroot/usr/include/stdlib.h b/sysroot/usr/include/stdlib.h
new file mode 100644
index 0000000..3c2ea72
--- /dev/null
+++ b/sysroot/usr/include/stdlib.h
@@ -0,0 +1,885 @@
+/* Copyright (C) 1991-2003,2004,2005,2006,2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99 Standard: 7.20 General utilities <stdlib.h>
+ */
+
+#ifndef _STDLIB_H
+
+#include <features.h>
+
+/* Get size_t, wchar_t and NULL from <stddef.h>. */
+#define __need_size_t
+#ifndef __need_malloc_and_calloc
+# define __need_wchar_t
+# define __need_NULL
+#endif
+#include <stddef.h>
+
+__BEGIN_DECLS
+
+#ifndef __need_malloc_and_calloc
+#define _STDLIB_H 1
+
+#if defined __USE_XOPEN && !defined _SYS_WAIT_H
+/* XPG requires a few symbols from <sys/wait.h> being defined. */
+# include <bits/waitflags.h>
+# include <bits/waitstatus.h>
+
+# ifdef __USE_BSD
+
+/* Lots of hair to allow traditional BSD use of `union wait'
+ as well as POSIX.1 use of `int' for the status word. */
+
+# if defined __GNUC__ && !defined __cplusplus
+# define __WAIT_INT(status) \
+ (__extension__ ({ union { __typeof(status) __in; int __i; } __u; \
+ __u.__in = (status); __u.__i; }))
+# else
+# define __WAIT_INT(status) (*(int *) &(status))
+# endif
+
+/* This is the type of the argument to `wait'. The funky union
+ causes redeclarations with ether `int *' or `union wait *' to be
+ allowed without complaint. __WAIT_STATUS_DEFN is the type used in
+ the actual function definitions. */
+
+# if !defined __GNUC__ || __GNUC__ < 2 || defined __cplusplus
+# define __WAIT_STATUS void *
+# define __WAIT_STATUS_DEFN void *
+# else
+/* This works in GCC 2.6.1 and later. */
+typedef union
+ {
+ union wait *__uptr;
+ int *__iptr;
+ } __WAIT_STATUS __attribute__ ((__transparent_union__));
+# define __WAIT_STATUS_DEFN int *
+# endif
+
+# else /* Don't use BSD. */
+
+# define __WAIT_INT(status) (status)
+# define __WAIT_STATUS int *
+# define __WAIT_STATUS_DEFN int *
+
+# endif /* Use BSD. */
+
+/* Define the macros <sys/wait.h> also would define this way. */
+# define WEXITSTATUS(status) __WEXITSTATUS(__WAIT_INT(status))
+# define WTERMSIG(status) __WTERMSIG(__WAIT_INT(status))
+# define WSTOPSIG(status) __WSTOPSIG(__WAIT_INT(status))
+# define WIFEXITED(status) __WIFEXITED(__WAIT_INT(status))
+# define WIFSIGNALED(status) __WIFSIGNALED(__WAIT_INT(status))
+# define WIFSTOPPED(status) __WIFSTOPPED(__WAIT_INT(status))
+# ifdef __WIFCONTINUED
+# define WIFCONTINUED(status) __WIFCONTINUED(__WAIT_INT(status))
+# endif
+#endif /* X/Open and <sys/wait.h> not included. */
+
+__BEGIN_NAMESPACE_STD
+/* Returned by `div'. */
+typedef struct
+ {
+ int quot; /* Quotient. */
+ int rem; /* Remainder. */
+ } div_t;
+
+/* Returned by `ldiv'. */
+#ifndef __ldiv_t_defined
+typedef struct
+ {
+ long int quot; /* Quotient. */
+ long int rem; /* Remainder. */
+ } ldiv_t;
+# define __ldiv_t_defined 1
+#endif
+__END_NAMESPACE_STD
+
+#if defined __USE_ISOC99 && !defined __lldiv_t_defined
+__BEGIN_NAMESPACE_C99
+/* Returned by `lldiv'. */
+__extension__ typedef struct
+ {
+ long long int quot; /* Quotient. */
+ long long int rem; /* Remainder. */
+ } lldiv_t;
+# define __lldiv_t_defined 1
+__END_NAMESPACE_C99
+#endif
+
+
+/* The largest number rand will return (same as INT_MAX). */
+#define RAND_MAX 2147483647
+
+
+/* We define these the same for all machines.
+ Changes from this to the outside world should be done in `_exit'. */
+#define EXIT_FAILURE 1 /* Failing exit status. */
+#define EXIT_SUCCESS 0 /* Successful exit status. */
+
+
+/* Maximum length of a multibyte character in the current locale. */
+#define MB_CUR_MAX (__ctype_get_mb_cur_max ())
+extern size_t __ctype_get_mb_cur_max (void) __THROW __wur;
+
+
+__BEGIN_NAMESPACE_STD
+/* Convert a string to a floating-point number. */
+extern double atof (__const char *__nptr)
+ __THROW __attribute_pure__ __nonnull ((1)) __wur;
+/* Convert a string to an integer. */
+extern int atoi (__const char *__nptr)
+ __THROW __attribute_pure__ __nonnull ((1)) __wur;
+/* Convert a string to a long integer. */
+extern long int atol (__const char *__nptr)
+ __THROW __attribute_pure__ __nonnull ((1)) __wur;
+__END_NAMESPACE_STD
+
+#if defined __USE_ISOC99 || (defined __GLIBC_HAVE_LONG_LONG && defined __USE_MISC)
+__BEGIN_NAMESPACE_C99
+/* Convert a string to a long long integer. */
+__extension__ extern long long int atoll (__const char *__nptr)
+ __THROW __attribute_pure__ __nonnull ((1)) __wur;
+__END_NAMESPACE_C99
+#endif
+
+__BEGIN_NAMESPACE_STD
+/* Convert a string to a floating-point number. */
+extern double strtod (__const char *__restrict __nptr,
+ char **__restrict __endptr)
+ __THROW __nonnull ((1)) __wur;
+__END_NAMESPACE_STD
+
+#ifdef __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Likewise for `float' and `long double' sizes of floating-point numbers. */
+extern float strtof (__const char *__restrict __nptr,
+ char **__restrict __endptr) __THROW __nonnull ((1)) __wur;
+
+extern long double strtold (__const char *__restrict __nptr,
+ char **__restrict __endptr)
+ __THROW __nonnull ((1)) __wur;
+__END_NAMESPACE_C99
+#endif
+
+__BEGIN_NAMESPACE_STD
+/* Convert a string to a long integer. */
+extern long int strtol (__const char *__restrict __nptr,
+ char **__restrict __endptr, int __base)
+ __THROW __nonnull ((1)) __wur;
+/* Convert a string to an unsigned long integer. */
+extern unsigned long int strtoul (__const char *__restrict __nptr,
+ char **__restrict __endptr, int __base)
+ __THROW __nonnull ((1)) __wur;
+__END_NAMESPACE_STD
+
+#if defined __GLIBC_HAVE_LONG_LONG && defined __USE_BSD
+/* Convert a string to a quadword integer. */
+__extension__
+extern long long int strtoq (__const char *__restrict __nptr,
+ char **__restrict __endptr, int __base)
+ __THROW __nonnull ((1)) __wur;
+/* Convert a string to an unsigned quadword integer. */
+__extension__
+extern unsigned long long int strtouq (__const char *__restrict __nptr,
+ char **__restrict __endptr, int __base)
+ __THROW __nonnull ((1)) __wur;
+#endif /* GCC and use BSD. */
+
+#if defined __USE_ISOC99 || (defined __GLIBC_HAVE_LONG_LONG && defined __USE_MISC)
+__BEGIN_NAMESPACE_C99
+/* Convert a string to a quadword integer. */
+__extension__
+extern long long int strtoll (__const char *__restrict __nptr,
+ char **__restrict __endptr, int __base)
+ __THROW __nonnull ((1)) __wur;
+/* Convert a string to an unsigned quadword integer. */
+__extension__
+extern unsigned long long int strtoull (__const char *__restrict __nptr,
+ char **__restrict __endptr, int __base)
+ __THROW __nonnull ((1)) __wur;
+__END_NAMESPACE_C99
+#endif /* ISO C99 or GCC and use MISC. */
+
+
+#ifdef __USE_GNU
+/* The concept of one static locale per category is not very well
+ thought out. Many applications will need to process its data using
+ information from several different locales. Another application is
+ the implementation of the internationalization handling in the
+ upcoming ISO C++ standard library. To support this another set of
+ the functions using locale data exist which have an additional
+ argument.
+
+ Attention: all these functions are *not* standardized in any form.
+ This is a proof-of-concept implementation. */
+
+/* Structure for reentrant locale using functions. This is an
+ (almost) opaque type for the user level programs. */
+# include <xlocale.h>
+
+/* Special versions of the functions above which take the locale to
+ use as an additional parameter. */
+extern long int strtol_l (__const char *__restrict __nptr,
+ char **__restrict __endptr, int __base,
+ __locale_t __loc) __THROW __nonnull ((1, 4)) __wur;
+
+extern unsigned long int strtoul_l (__const char *__restrict __nptr,
+ char **__restrict __endptr,
+ int __base, __locale_t __loc)
+ __THROW __nonnull ((1, 4)) __wur;
+
+__extension__
+extern long long int strtoll_l (__const char *__restrict __nptr,
+ char **__restrict __endptr, int __base,
+ __locale_t __loc)
+ __THROW __nonnull ((1, 4)) __wur;
+
+__extension__
+extern unsigned long long int strtoull_l (__const char *__restrict __nptr,
+ char **__restrict __endptr,
+ int __base, __locale_t __loc)
+ __THROW __nonnull ((1, 4)) __wur;
+
+extern double strtod_l (__const char *__restrict __nptr,
+ char **__restrict __endptr, __locale_t __loc)
+ __THROW __nonnull ((1, 3)) __wur;
+
+extern float strtof_l (__const char *__restrict __nptr,
+ char **__restrict __endptr, __locale_t __loc)
+ __THROW __nonnull ((1, 3)) __wur;
+
+extern long double strtold_l (__const char *__restrict __nptr,
+ char **__restrict __endptr,
+ __locale_t __loc)
+ __THROW __nonnull ((1, 3)) __wur;
+#endif /* GNU */
+
+
+#ifdef __USE_EXTERN_INLINES
+__BEGIN_NAMESPACE_STD
+__extern_inline double
+__NTH (atof (__const char *__nptr))
+{
+ return strtod (__nptr, (char **) NULL);
+}
+__extern_inline int
+__NTH (atoi (__const char *__nptr))
+{
+ return (int) strtol (__nptr, (char **) NULL, 10);
+}
+__extern_inline long int
+__NTH (atol (__const char *__nptr))
+{
+ return strtol (__nptr, (char **) NULL, 10);
+}
+__END_NAMESPACE_STD
+
+# if defined __USE_MISC || defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+__extension__ __extern_inline long long int
+__NTH (atoll (__const char *__nptr))
+{
+ return strtoll (__nptr, (char **) NULL, 10);
+}
+__END_NAMESPACE_C99
+# endif
+#endif /* Optimizing and Inlining. */
+
+
+#if defined __USE_SVID || defined __USE_XOPEN_EXTENDED
+/* Convert N to base 64 using the digits "./0-9A-Za-z", least-significant
+ digit first. Returns a pointer to static storage overwritten by the
+ next call. */
+extern char *l64a (long int __n) __THROW __wur;
+
+/* Read a number from a string S in base 64 as above. */
+extern long int a64l (__const char *__s)
+ __THROW __attribute_pure__ __nonnull ((1)) __wur;
+
+#endif /* Use SVID || extended X/Open. */
+
+#if defined __USE_SVID || defined __USE_XOPEN_EXTENDED || defined __USE_BSD
+# include <sys/types.h> /* we need int32_t... */
+
+/* These are the functions that actually do things. The `random', `srandom',
+ `initstate' and `setstate' functions are those from BSD Unices.
+ The `rand' and `srand' functions are required by the ANSI standard.
+ We provide both interfaces to the same random number generator. */
+/* Return a random long integer between 0 and RAND_MAX inclusive. */
+extern long int random (void) __THROW;
+
+/* Seed the random number generator with the given number. */
+extern void srandom (unsigned int __seed) __THROW;
+
+/* Initialize the random number generator to use state buffer STATEBUF,
+ of length STATELEN, and seed it with SEED. Optimal lengths are 8, 16,
+ 32, 64, 128 and 256, the bigger the better; values less than 8 will
+ cause an error and values greater than 256 will be rounded down. */
+extern char *initstate (unsigned int __seed, char *__statebuf,
+ size_t __statelen) __THROW __nonnull ((2));
+
+/* Switch the random number generator to state buffer STATEBUF,
+ which should have been previously initialized by `initstate'. */
+extern char *setstate (char *__statebuf) __THROW __nonnull ((1));
+
+
+# ifdef __USE_MISC
+/* Reentrant versions of the `random' family of functions.
+ These functions all use the following data structure to contain
+ state, rather than global state variables. */
+
+struct random_data
+ {
+ int32_t *fptr; /* Front pointer. */
+ int32_t *rptr; /* Rear pointer. */
+ int32_t *state; /* Array of state values. */
+ int rand_type; /* Type of random number generator. */
+ int rand_deg; /* Degree of random number generator. */
+ int rand_sep; /* Distance between front and rear. */
+ int32_t *end_ptr; /* Pointer behind state table. */
+ };
+
+extern int random_r (struct random_data *__restrict __buf,
+ int32_t *__restrict __result) __THROW __nonnull ((1, 2));
+
+extern int srandom_r (unsigned int __seed, struct random_data *__buf)
+ __THROW __nonnull ((2));
+
+extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
+ size_t __statelen,
+ struct random_data *__restrict __buf)
+ __THROW __nonnull ((2, 4));
+
+extern int setstate_r (char *__restrict __statebuf,
+ struct random_data *__restrict __buf)
+ __THROW __nonnull ((1, 2));
+# endif /* Use misc. */
+#endif /* Use SVID || extended X/Open || BSD. */
+
+
+__BEGIN_NAMESPACE_STD
+/* Return a random integer between 0 and RAND_MAX inclusive. */
+extern int rand (void) __THROW;
+/* Seed the random number generator with the given number. */
+extern void srand (unsigned int __seed) __THROW;
+__END_NAMESPACE_STD
+
+#ifdef __USE_POSIX
+/* Reentrant interface according to POSIX.1. */
+extern int rand_r (unsigned int *__seed) __THROW;
+#endif
+
+
+#if defined __USE_SVID || defined __USE_XOPEN
+/* System V style 48-bit random number generator functions. */
+
+/* Return non-negative, double-precision floating-point value in [0.0,1.0). */
+extern double drand48 (void) __THROW;
+extern double erand48 (unsigned short int __xsubi[3]) __THROW __nonnull ((1));
+
+/* Return non-negative, long integer in [0,2^31). */
+extern long int lrand48 (void) __THROW;
+extern long int nrand48 (unsigned short int __xsubi[3])
+ __THROW __nonnull ((1));
+
+/* Return signed, long integers in [-2^31,2^31). */
+extern long int mrand48 (void) __THROW;
+extern long int jrand48 (unsigned short int __xsubi[3])
+ __THROW __nonnull ((1));
+
+/* Seed random number generator. */
+extern void srand48 (long int __seedval) __THROW;
+extern unsigned short int *seed48 (unsigned short int __seed16v[3])
+ __THROW __nonnull ((1));
+extern void lcong48 (unsigned short int __param[7]) __THROW __nonnull ((1));
+
+# ifdef __USE_MISC
+/* Data structure for communication with thread safe versions. This
+ type is to be regarded as opaque. It's only exported because users
+ have to allocate objects of this type. */
+struct drand48_data
+ {
+ unsigned short int __x[3]; /* Current state. */
+ unsigned short int __old_x[3]; /* Old state. */
+ unsigned short int __c; /* Additive const. in congruential formula. */
+ unsigned short int __init; /* Flag for initializing. */
+ unsigned long long int __a; /* Factor in congruential formula. */
+ };
+
+/* Return non-negative, double-precision floating-point value in [0.0,1.0). */
+extern int drand48_r (struct drand48_data *__restrict __buffer,
+ double *__restrict __result) __THROW __nonnull ((1, 2));
+extern int erand48_r (unsigned short int __xsubi[3],
+ struct drand48_data *__restrict __buffer,
+ double *__restrict __result) __THROW __nonnull ((1, 2));
+
+/* Return non-negative, long integer in [0,2^31). */
+extern int lrand48_r (struct drand48_data *__restrict __buffer,
+ long int *__restrict __result)
+ __THROW __nonnull ((1, 2));
+extern int nrand48_r (unsigned short int __xsubi[3],
+ struct drand48_data *__restrict __buffer,
+ long int *__restrict __result)
+ __THROW __nonnull ((1, 2));
+
+/* Return signed, long integers in [-2^31,2^31). */
+extern int mrand48_r (struct drand48_data *__restrict __buffer,
+ long int *__restrict __result)
+ __THROW __nonnull ((1, 2));
+extern int jrand48_r (unsigned short int __xsubi[3],
+ struct drand48_data *__restrict __buffer,
+ long int *__restrict __result)
+ __THROW __nonnull ((1, 2));
+
+/* Seed random number generator. */
+extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
+ __THROW __nonnull ((2));
+
+extern int seed48_r (unsigned short int __seed16v[3],
+ struct drand48_data *__buffer) __THROW __nonnull ((1, 2));
+
+extern int lcong48_r (unsigned short int __param[7],
+ struct drand48_data *__buffer)
+ __THROW __nonnull ((1, 2));
+# endif /* Use misc. */
+#endif /* Use SVID or X/Open. */
+
+#endif /* don't just need malloc and calloc */
+
+#ifndef __malloc_and_calloc_defined
+# define __malloc_and_calloc_defined
+__BEGIN_NAMESPACE_STD
+/* Allocate SIZE bytes of memory. */
+extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
+/* Allocate NMEMB elements of SIZE bytes each, all initialized to 0. */
+extern void *calloc (size_t __nmemb, size_t __size)
+ __THROW __attribute_malloc__ __wur;
+__END_NAMESPACE_STD
+#endif
+
+#ifndef __need_malloc_and_calloc
+__BEGIN_NAMESPACE_STD
+/* Re-allocate the previously allocated block
+ in PTR, making the new block SIZE bytes long. */
+/* __attribute_malloc__ is not used, because if realloc returns
+ the same pointer that was passed to it, aliasing needs to be allowed
+ between objects pointed by the old and new pointers. */
+extern void *realloc (void *__ptr, size_t __size)
+ __THROW __attribute_warn_unused_result__;
+/* Free a block allocated by `malloc', `realloc' or `calloc'. */
+extern void free (void *__ptr) __THROW;
+__END_NAMESPACE_STD
+
+#ifdef __USE_MISC
+/* Free a block. An alias for `free'. (Sun Unices). */
+extern void cfree (void *__ptr) __THROW;
+#endif /* Use misc. */
+
+#if defined __USE_GNU || defined __USE_BSD || defined __USE_MISC
+# include <alloca.h>
+#endif /* Use GNU, BSD, or misc. */
+
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+/* Allocate SIZE bytes on a page boundary. The storage cannot be freed. */
+extern void *valloc (size_t __size) __THROW __attribute_malloc__ __wur;
+#endif
+
+#ifdef __USE_XOPEN2K
+/* Allocate memory of SIZE bytes with an alignment of ALIGNMENT. */
+extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
+ __THROW __nonnull ((1)) __wur;
+#endif
+
+__BEGIN_NAMESPACE_STD
+/* Abort execution and generate a core-dump. */
+extern void abort (void) __THROW __attribute__ ((__noreturn__));
+
+
+/* Register a function to be called when `exit' is called. */
+extern int atexit (void (*__func) (void)) __THROW __nonnull ((1));
+__END_NAMESPACE_STD
+
+#ifdef __USE_MISC
+/* Register a function to be called with the status
+ given to `exit' and the given argument. */
+extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
+ __THROW __nonnull ((1));
+#endif
+
+__BEGIN_NAMESPACE_STD
+/* Call all functions registered with `atexit' and `on_exit',
+ in the reverse of the order in which they were registered
+ perform stdio cleanup, and terminate program execution with STATUS. */
+extern void exit (int __status) __THROW __attribute__ ((__noreturn__));
+__END_NAMESPACE_STD
+
+#ifdef __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Terminate the program with STATUS without calling any of the
+ functions registered with `atexit' or `on_exit'. */
+extern void _Exit (int __status) __THROW __attribute__ ((__noreturn__));
+__END_NAMESPACE_C99
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+/* Return the value of envariable NAME, or NULL if it doesn't exist. */
+extern char *getenv (__const char *__name) __THROW __nonnull ((1)) __wur;
+__END_NAMESPACE_STD
+
+/* This function is similar to the above but returns NULL if the
+ programs is running with SUID or SGID enabled. */
+extern char *__secure_getenv (__const char *__name)
+ __THROW __nonnull ((1)) __wur;
+
+#if defined __USE_SVID || defined __USE_XOPEN
+/* The SVID says this is in <stdio.h>, but this seems a better place. */
+/* Put STRING, which is of the form "NAME=VALUE", in the environment.
+ If there is no `=', remove NAME from the environment. */
+extern int putenv (char *__string) __THROW __nonnull ((1));
+#endif
+
+#if defined __USE_BSD || defined __USE_XOPEN2K
+/* Set NAME to VALUE in the environment.
+ If REPLACE is nonzero, overwrite an existing value. */
+extern int setenv (__const char *__name, __const char *__value, int __replace)
+ __THROW __nonnull ((2));
+
+/* Remove the variable NAME from the environment. */
+extern int unsetenv (__const char *__name) __THROW;
+#endif
+
+#ifdef __USE_MISC
+/* The `clearenv' was planned to be added to POSIX.1 but probably
+ never made it. Nevertheless the POSIX.9 standard (POSIX bindings
+ for Fortran 77) requires this function. */
+extern int clearenv (void) __THROW;
+#endif
+
+
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
+/* Generate a unique temporary file name from TEMPLATE.
+ The last six characters of TEMPLATE must be "XXXXXX";
+ they are replaced with a string that makes the file name unique.
+ Returns TEMPLATE, or a null pointer if it cannot get a unique file name. */
+extern char *mktemp (char *__template) __THROW __nonnull ((1)) __wur;
+
+/* Generate a unique temporary file name from TEMPLATE.
+ The last six characters of TEMPLATE must be "XXXXXX";
+ they are replaced with a string that makes the filename unique.
+ Returns a file descriptor open on the file for reading and writing,
+ or -1 if it cannot create a uniquely-named file.
+
+ This function is a possible cancellation points and therefore not
+ marked with __THROW. */
+# ifndef __USE_FILE_OFFSET64
+extern int mkstemp (char *__template) __nonnull ((1)) __wur;
+# else
+# ifdef __REDIRECT
+extern int __REDIRECT (mkstemp, (char *__template), mkstemp64)
+ __nonnull ((1)) __wur;
+# else
+# define mkstemp mkstemp64
+# endif
+# endif
+# ifdef __USE_LARGEFILE64
+extern int mkstemp64 (char *__template) __nonnull ((1)) __wur;
+# endif
+#endif
+
+#ifdef __USE_BSD
+/* Create a unique temporary directory from TEMPLATE.
+ The last six characters of TEMPLATE must be "XXXXXX";
+ they are replaced with a string that makes the directory name unique.
+ Returns TEMPLATE, or a null pointer if it cannot get a unique name.
+ The directory is created mode 700. */
+extern char *mkdtemp (char *__template) __THROW __nonnull ((1)) __wur;
+#endif
+
+#ifdef __USE_GNU
+/* Generate a unique temporary file name from TEMPLATE similar to
+ mkstemp. But allow the caller to pass additional flags which are
+ used in the open call to create the file..
+
+ This function is a possible cancellation points and therefore not
+ marked with __THROW. */
+# ifndef __USE_FILE_OFFSET64
+extern int mkostemp (char *__template, int __flags) __nonnull ((1)) __wur;
+# else
+# ifdef __REDIRECT
+extern int __REDIRECT (mkostemp, (char *__template, int __flags), mkostemp64)
+ __nonnull ((1)) __wur;
+# else
+# define mkostemp mkostemp64
+# endif
+# endif
+# ifdef __USE_LARGEFILE64
+extern int mkostemp64 (char *__template, int __flags) __nonnull ((1)) __wur;
+# endif
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+/* Execute the given line as a shell command.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int system (__const char *__command) __wur;
+__END_NAMESPACE_STD
+
+
+#ifdef __USE_GNU
+/* Return a malloc'd string containing the canonical absolute name of the
+ existing named file. */
+extern char *canonicalize_file_name (__const char *__name)
+ __THROW __nonnull ((1)) __wur;
+#endif
+
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+/* Return the canonical absolute name of file NAME. If RESOLVED is
+ null, the result is malloc'd; otherwise, if the canonical name is
+ PATH_MAX chars or more, returns null with `errno' set to
+ ENAMETOOLONG; if the name fits in fewer than PATH_MAX chars,
+ returns the name in RESOLVED. */
+extern char *realpath (__const char *__restrict __name,
+ char *__restrict __resolved) __THROW __wur;
+#endif
+
+
+/* Shorthand for type of comparison functions. */
+#ifndef __COMPAR_FN_T
+# define __COMPAR_FN_T
+typedef int (*__compar_fn_t) (__const void *, __const void *);
+
+# ifdef __USE_GNU
+typedef __compar_fn_t comparison_fn_t;
+# endif
+#endif
+
+__BEGIN_NAMESPACE_STD
+/* Do a binary search for KEY in BASE, which consists of NMEMB elements
+ of SIZE bytes each, using COMPAR to perform the comparisons. */
+extern void *bsearch (__const void *__key, __const void *__base,
+ size_t __nmemb, size_t __size, __compar_fn_t __compar)
+ __nonnull ((1, 2, 5)) __wur;
+
+/* Sort NMEMB elements of BASE, of SIZE bytes each,
+ using COMPAR to perform the comparisons. */
+extern void qsort (void *__base, size_t __nmemb, size_t __size,
+ __compar_fn_t __compar) __nonnull ((1, 4));
+
+
+/* Return the absolute value of X. */
+extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
+extern long int labs (long int __x) __THROW __attribute__ ((__const__)) __wur;
+__END_NAMESPACE_STD
+
+#ifdef __USE_ISOC99
+__extension__ extern long long int llabs (long long int __x)
+ __THROW __attribute__ ((__const__)) __wur;
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+/* Return the `div_t', `ldiv_t' or `lldiv_t' representation
+ of the value of NUMER over DENOM. */
+/* GCC may have built-ins for these someday. */
+extern div_t div (int __numer, int __denom)
+ __THROW __attribute__ ((__const__)) __wur;
+extern ldiv_t ldiv (long int __numer, long int __denom)
+ __THROW __attribute__ ((__const__)) __wur;
+__END_NAMESPACE_STD
+
+#ifdef __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+__extension__ extern lldiv_t lldiv (long long int __numer,
+ long long int __denom)
+ __THROW __attribute__ ((__const__)) __wur;
+__END_NAMESPACE_C99
+#endif
+
+
+#if defined __USE_SVID || defined __USE_XOPEN_EXTENDED
+/* Convert floating point numbers to strings. The returned values are
+ valid only until another call to the same function. */
+
+/* Convert VALUE to a string with NDIGIT digits and return a pointer to
+ this. Set *DECPT with the position of the decimal character and *SIGN
+ with the sign of the number. */
+extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
+ int *__restrict __sign) __THROW __nonnull ((3, 4)) __wur;
+
+/* Convert VALUE to a string rounded to NDIGIT decimal digits. Set *DECPT
+ with the position of the decimal character and *SIGN with the sign of
+ the number. */
+extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
+ int *__restrict __sign) __THROW __nonnull ((3, 4)) __wur;
+
+/* If possible convert VALUE to a string with NDIGIT significant digits.
+ Otherwise use exponential representation. The resulting string will
+ be written to BUF. */
+extern char *gcvt (double __value, int __ndigit, char *__buf)
+ __THROW __nonnull ((3)) __wur;
+
+
+# ifdef __USE_MISC
+/* Long double versions of above functions. */
+extern char *qecvt (long double __value, int __ndigit,
+ int *__restrict __decpt, int *__restrict __sign)
+ __THROW __nonnull ((3, 4)) __wur;
+extern char *qfcvt (long double __value, int __ndigit,
+ int *__restrict __decpt, int *__restrict __sign)
+ __THROW __nonnull ((3, 4)) __wur;
+extern char *qgcvt (long double __value, int __ndigit, char *__buf)
+ __THROW __nonnull ((3)) __wur;
+
+
+/* Reentrant version of the functions above which provide their own
+ buffers. */
+extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
+ int *__restrict __sign, char *__restrict __buf,
+ size_t __len) __THROW __nonnull ((3, 4, 5));
+extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
+ int *__restrict __sign, char *__restrict __buf,
+ size_t __len) __THROW __nonnull ((3, 4, 5));
+
+extern int qecvt_r (long double __value, int __ndigit,
+ int *__restrict __decpt, int *__restrict __sign,
+ char *__restrict __buf, size_t __len)
+ __THROW __nonnull ((3, 4, 5));
+extern int qfcvt_r (long double __value, int __ndigit,
+ int *__restrict __decpt, int *__restrict __sign,
+ char *__restrict __buf, size_t __len)
+ __THROW __nonnull ((3, 4, 5));
+# endif /* misc */
+#endif /* use MISC || use X/Open Unix */
+
+
+__BEGIN_NAMESPACE_STD
+/* Return the length of the multibyte character
+ in S, which is no longer than N. */
+extern int mblen (__const char *__s, size_t __n) __THROW __wur;
+/* Return the length of the given multibyte character,
+ putting its `wchar_t' representation in *PWC. */
+extern int mbtowc (wchar_t *__restrict __pwc,
+ __const char *__restrict __s, size_t __n) __THROW __wur;
+/* Put the multibyte character represented
+ by WCHAR in S, returning its length. */
+extern int wctomb (char *__s, wchar_t __wchar) __THROW __wur;
+
+
+/* Convert a multibyte string to a wide char string. */
+extern size_t mbstowcs (wchar_t *__restrict __pwcs,
+ __const char *__restrict __s, size_t __n) __THROW;
+/* Convert a wide char string to multibyte string. */
+extern size_t wcstombs (char *__restrict __s,
+ __const wchar_t *__restrict __pwcs, size_t __n)
+ __THROW;
+__END_NAMESPACE_STD
+
+
+#ifdef __USE_SVID
+/* Determine whether the string value of RESPONSE matches the affirmation
+ or negative response expression as specified by the LC_MESSAGES category
+ in the program's current locale. Returns 1 if affirmative, 0 if
+ negative, and -1 if not matching. */
+extern int rpmatch (__const char *__response) __THROW __nonnull ((1)) __wur;
+#endif
+
+
+#ifdef __USE_XOPEN_EXTENDED
+/* Parse comma separated suboption from *OPTIONP and match against
+ strings in TOKENS. If found return index and set *VALUEP to
+ optional value introduced by an equal sign. If the suboption is
+ not part of TOKENS return in *VALUEP beginning of unknown
+ suboption. On exit *OPTIONP is set to the beginning of the next
+ token or at the terminating NUL character. */
+extern int getsubopt (char **__restrict __optionp,
+ char *__const *__restrict __tokens,
+ char **__restrict __valuep)
+ __THROW __nonnull ((1, 2, 3)) __wur;
+#endif
+
+
+#ifdef __USE_XOPEN
+/* Setup DES tables according KEY. */
+extern void setkey (__const char *__key) __THROW __nonnull ((1));
+#endif
+
+
+/* X/Open pseudo terminal handling. */
+
+#ifdef __USE_XOPEN2K
+/* Return a master pseudo-terminal handle. */
+extern int posix_openpt (int __oflag) __wur;
+#endif
+
+#ifdef __USE_XOPEN
+/* The next four functions all take a master pseudo-tty fd and
+ perform an operation on the associated slave: */
+
+/* Chown the slave to the calling user. */
+extern int grantpt (int __fd) __THROW;
+
+/* Release an internal lock so the slave can be opened.
+ Call after grantpt(). */
+extern int unlockpt (int __fd) __THROW;
+
+/* Return the pathname of the pseudo terminal slave assoicated with
+ the master FD is open on, or NULL on errors.
+ The returned storage is good until the next call to this function. */
+extern char *ptsname (int __fd) __THROW __wur;
+#endif
+
+#ifdef __USE_GNU
+/* Store at most BUFLEN characters of the pathname of the slave pseudo
+ terminal associated with the master FD is open on in BUF.
+ Return 0 on success, otherwise an error number. */
+extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
+ __THROW __nonnull ((2));
+
+/* Open a master pseudo terminal and return its file descriptor. */
+extern int getpt (void);
+#endif
+
+#ifdef __USE_BSD
+/* Put the 1 minute, 5 minute and 15 minute load averages into the first
+ NELEM elements of LOADAVG. Return the number written (never more than
+ three, but may be less than NELEM), or -1 if an error occurred. */
+extern int getloadavg (double __loadavg[], int __nelem)
+ __THROW __nonnull ((1));
+#endif
+
+
+/* Define some macros helping to catch buffer overflows. */
+#if __USE_FORTIFY_LEVEL > 0 && defined __extern_always_inline
+# include <bits/stdlib.h>
+#endif
+#ifdef __LDBL_COMPAT
+# include <bits/stdlib-ldbl.h>
+#endif
+
+#endif /* don't just need malloc and calloc */
+#undef __need_malloc_and_calloc
+
+__END_DECLS
+
+#endif /* stdlib.h */
diff --git a/sysroot/usr/include/string.h b/sysroot/usr/include/string.h
new file mode 100644
index 0000000..90c92d4
--- /dev/null
+++ b/sysroot/usr/include/string.h
@@ -0,0 +1,434 @@
+/* Copyright (C) 1991-1993, 1995-2004, 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99 Standard: 7.21 String handling <string.h>
+ */
+
+#ifndef _STRING_H
+#define _STRING_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Get size_t and NULL from <stddef.h>. */
+#define __need_size_t
+#define __need_NULL
+#include <stddef.h>
+
+
+__BEGIN_NAMESPACE_STD
+/* Copy N bytes of SRC to DEST. */
+extern void *memcpy (void *__restrict __dest,
+ __const void *__restrict __src, size_t __n)
+ __THROW __nonnull ((1, 2));
+/* Copy N bytes of SRC to DEST, guaranteeing
+ correct behavior for overlapping strings. */
+extern void *memmove (void *__dest, __const void *__src, size_t __n)
+ __THROW __nonnull ((1, 2));
+__END_NAMESPACE_STD
+
+/* Copy no more than N bytes of SRC to DEST, stopping when C is found.
+ Return the position in DEST one byte past where C was copied,
+ or NULL if C was not found in the first N bytes of SRC. */
+#if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN
+extern void *memccpy (void *__restrict __dest, __const void *__restrict __src,
+ int __c, size_t __n)
+ __THROW __nonnull ((1, 2));
+#endif /* SVID. */
+
+
+__BEGIN_NAMESPACE_STD
+/* Set N bytes of S to C. */
+extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
+
+/* Compare N bytes of S1 and S2. */
+extern int memcmp (__const void *__s1, __const void *__s2, size_t __n)
+ __THROW __attribute_pure__ __nonnull ((1, 2));
+
+/* Search N bytes of S for C. */
+extern void *memchr (__const void *__s, int __c, size_t __n)
+ __THROW __attribute_pure__ __nonnull ((1));
+__END_NAMESPACE_STD
+
+#ifdef __USE_GNU
+/* Search in S for C. This is similar to `memchr' but there is no
+ length limit. */
+extern void *rawmemchr (__const void *__s, int __c)
+ __THROW __attribute_pure__ __nonnull ((1));
+
+/* Search N bytes of S for the final occurrence of C. */
+extern void *memrchr (__const void *__s, int __c, size_t __n)
+ __THROW __attribute_pure__ __nonnull ((1));
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+/* Copy SRC to DEST. */
+extern char *strcpy (char *__restrict __dest, __const char *__restrict __src)
+ __THROW __nonnull ((1, 2));
+/* Copy no more than N characters of SRC to DEST. */
+extern char *strncpy (char *__restrict __dest,
+ __const char *__restrict __src, size_t __n)
+ __THROW __nonnull ((1, 2));
+
+/* Append SRC onto DEST. */
+extern char *strcat (char *__restrict __dest, __const char *__restrict __src)
+ __THROW __nonnull ((1, 2));
+/* Append no more than N characters from SRC onto DEST. */
+extern char *strncat (char *__restrict __dest, __const char *__restrict __src,
+ size_t __n) __THROW __nonnull ((1, 2));
+
+/* Compare S1 and S2. */
+extern int strcmp (__const char *__s1, __const char *__s2)
+ __THROW __attribute_pure__ __nonnull ((1, 2));
+/* Compare N characters of S1 and S2. */
+extern int strncmp (__const char *__s1, __const char *__s2, size_t __n)
+ __THROW __attribute_pure__ __nonnull ((1, 2));
+
+/* Compare the collated forms of S1 and S2. */
+extern int strcoll (__const char *__s1, __const char *__s2)
+ __THROW __attribute_pure__ __nonnull ((1, 2));
+/* Put a transformation of SRC into no more than N bytes of DEST. */
+extern size_t strxfrm (char *__restrict __dest,
+ __const char *__restrict __src, size_t __n)
+ __THROW __nonnull ((2));
+__END_NAMESPACE_STD
+
+#ifdef __USE_GNU
+/* The following functions are equivalent to the both above but they
+ take the locale they use for the collation as an extra argument.
+ This is not standardsized but something like will come. */
+# include <xlocale.h>
+
+/* Compare the collated forms of S1 and S2 using rules from L. */
+extern int strcoll_l (__const char *__s1, __const char *__s2, __locale_t __l)
+ __THROW __attribute_pure__ __nonnull ((1, 2, 3));
+/* Put a transformation of SRC into no more than N bytes of DEST. */
+extern size_t strxfrm_l (char *__dest, __const char *__src, size_t __n,
+ __locale_t __l) __THROW __nonnull ((2, 4));
+#endif
+
+#if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+/* Duplicate S, returning an identical malloc'd string. */
+extern char *strdup (__const char *__s)
+ __THROW __attribute_malloc__ __nonnull ((1));
+#endif
+
+/* Return a malloc'd copy of at most N bytes of STRING. The
+ resultant string is terminated even if no null terminator
+ appears before STRING[N]. */
+#if defined __USE_GNU
+extern char *strndup (__const char *__string, size_t __n)
+ __THROW __attribute_malloc__ __nonnull ((1));
+#endif
+
+#if defined __USE_GNU && defined __GNUC__
+/* Duplicate S, returning an identical alloca'd string. */
+# define strdupa(s) \
+ (__extension__ \
+ ({ \
+ __const char *__old = (s); \
+ size_t __len = strlen (__old) + 1; \
+ char *__new = (char *) __builtin_alloca (__len); \
+ (char *) memcpy (__new, __old, __len); \
+ }))
+
+/* Return an alloca'd copy of at most N bytes of string. */
+# define strndupa(s, n) \
+ (__extension__ \
+ ({ \
+ __const char *__old = (s); \
+ size_t __len = strnlen (__old, (n)); \
+ char *__new = (char *) __builtin_alloca (__len + 1); \
+ __new[__len] = '\0'; \
+ (char *) memcpy (__new, __old, __len); \
+ }))
+#endif
+
+__BEGIN_NAMESPACE_STD
+/* Find the first occurrence of C in S. */
+extern char *strchr (__const char *__s, int __c)
+ __THROW __attribute_pure__ __nonnull ((1));
+/* Find the last occurrence of C in S. */
+extern char *strrchr (__const char *__s, int __c)
+ __THROW __attribute_pure__ __nonnull ((1));
+__END_NAMESPACE_STD
+
+#ifdef __USE_GNU
+/* This function is similar to `strchr'. But it returns a pointer to
+ the closing NUL byte in case C is not found in S. */
+extern char *strchrnul (__const char *__s, int __c)
+ __THROW __attribute_pure__ __nonnull ((1));
+#endif
+
+__BEGIN_NAMESPACE_STD
+/* Return the length of the initial segment of S which
+ consists entirely of characters not in REJECT. */
+extern size_t strcspn (__const char *__s, __const char *__reject)
+ __THROW __attribute_pure__ __nonnull ((1, 2));
+/* Return the length of the initial segment of S which
+ consists entirely of characters in ACCEPT. */
+extern size_t strspn (__const char *__s, __const char *__accept)
+ __THROW __attribute_pure__ __nonnull ((1, 2));
+/* Find the first occurrence in S of any character in ACCEPT. */
+extern char *strpbrk (__const char *__s, __const char *__accept)
+ __THROW __attribute_pure__ __nonnull ((1, 2));
+/* Find the first occurrence of NEEDLE in HAYSTACK. */
+extern char *strstr (__const char *__haystack, __const char *__needle)
+ __THROW __attribute_pure__ __nonnull ((1, 2));
+
+
+/* Divide S into tokens separated by characters in DELIM. */
+extern char *strtok (char *__restrict __s, __const char *__restrict __delim)
+ __THROW __nonnull ((2));
+__END_NAMESPACE_STD
+
+/* Divide S into tokens separated by characters in DELIM. Information
+ passed between calls are stored in SAVE_PTR. */
+extern char *__strtok_r (char *__restrict __s,
+ __const char *__restrict __delim,
+ char **__restrict __save_ptr)
+ __THROW __nonnull ((2, 3));
+#if defined __USE_POSIX || defined __USE_MISC
+extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim,
+ char **__restrict __save_ptr)
+ __THROW __nonnull ((2, 3));
+#endif
+
+#ifdef __USE_GNU
+/* Similar to `strstr' but this function ignores the case of both strings. */
+extern char *strcasestr (__const char *__haystack, __const char *__needle)
+ __THROW __attribute_pure__ __nonnull ((1, 2));
+#endif
+
+#ifdef __USE_GNU
+/* Find the first occurrence of NEEDLE in HAYSTACK.
+ NEEDLE is NEEDLELEN bytes long;
+ HAYSTACK is HAYSTACKLEN bytes long. */
+extern void *memmem (__const void *__haystack, size_t __haystacklen,
+ __const void *__needle, size_t __needlelen)
+ __THROW __attribute_pure__ __nonnull ((1, 3));
+
+/* Copy N bytes of SRC to DEST, return pointer to bytes after the
+ last written byte. */
+extern void *__mempcpy (void *__restrict __dest,
+ __const void *__restrict __src, size_t __n)
+ __THROW __nonnull ((1, 2));
+extern void *mempcpy (void *__restrict __dest,
+ __const void *__restrict __src, size_t __n)
+ __THROW __nonnull ((1, 2));
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+/* Return the length of S. */
+extern size_t strlen (__const char *__s)
+ __THROW __attribute_pure__ __nonnull ((1));
+__END_NAMESPACE_STD
+
+#ifdef __USE_GNU
+/* Find the length of STRING, but scan at most MAXLEN characters.
+ If no '\0' terminator is found in that many characters, return MAXLEN. */
+extern size_t strnlen (__const char *__string, size_t __maxlen)
+ __THROW __attribute_pure__ __nonnull ((1));
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+/* Return a string describing the meaning of the `errno' code in ERRNUM. */
+extern char *strerror (int __errnum) __THROW;
+__END_NAMESPACE_STD
+#if defined __USE_XOPEN2K || defined __USE_MISC
+/* Reentrant version of `strerror'.
+ There are 2 flavors of `strerror_r', GNU which returns the string
+ and may or may not use the supplied temporary buffer and POSIX one
+ which fills the string into the buffer.
+ To use the POSIX version, -D_XOPEN_SOURCE=600 or -D_POSIX_C_SOURCE=200112L
+ without -D_GNU_SOURCE is needed, otherwise the GNU version is
+ preferred. */
+# if defined __USE_XOPEN2K && !defined __USE_GNU
+/* Fill BUF with a string describing the meaning of the `errno' code in
+ ERRNUM. */
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (strerror_r,
+ (int __errnum, char *__buf, size_t __buflen),
+ __xpg_strerror_r) __nonnull ((2));
+# else
+extern int __xpg_strerror_r (int __errnum, char *__buf, size_t __buflen)
+ __THROW __nonnull ((2));
+# define strerror_r __xpg_strerror_r
+# endif
+# else
+/* If a temporary buffer is required, at most BUFLEN bytes of BUF will be
+ used. */
+extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
+ __THROW __nonnull ((2));
+# endif
+#endif
+
+#ifdef __USE_GNU
+/* Translate error number to string according to the locale L. */
+extern char *strerror_l (int __errnum, __locale_t __l) __THROW;
+#endif
+
+
+/* We define this function always since `bzero' is sometimes needed when
+ the namespace rules does not allow this. */
+extern void __bzero (void *__s, size_t __n) __THROW __nonnull ((1));
+
+#ifdef __USE_BSD
+/* Copy N bytes of SRC to DEST (like memmove, but args reversed). */
+extern void bcopy (__const void *__src, void *__dest, size_t __n)
+ __THROW __nonnull ((1, 2));
+
+/* Set N bytes of S to 0. */
+extern void bzero (void *__s, size_t __n) __THROW __nonnull ((1));
+
+/* Compare N bytes of S1 and S2 (same as memcmp). */
+extern int bcmp (__const void *__s1, __const void *__s2, size_t __n)
+ __THROW __attribute_pure__ __nonnull ((1, 2));
+
+/* Find the first occurrence of C in S (same as strchr). */
+extern char *index (__const char *__s, int __c)
+ __THROW __attribute_pure__ __nonnull ((1));
+
+/* Find the last occurrence of C in S (same as strrchr). */
+extern char *rindex (__const char *__s, int __c)
+ __THROW __attribute_pure__ __nonnull ((1));
+
+/* Return the position of the first bit set in I, or 0 if none are set.
+ The least-significant bit is position 1, the most-significant 32. */
+extern int ffs (int __i) __THROW __attribute__ ((__const__));
+
+/* The following two functions are non-standard but necessary for non-32 bit
+ platforms. */
+# ifdef __USE_GNU
+extern int ffsl (long int __l) __THROW __attribute__ ((__const__));
+# ifdef __GNUC__
+__extension__ extern int ffsll (long long int __ll)
+ __THROW __attribute__ ((__const__));
+# endif
+# endif
+
+/* Compare S1 and S2, ignoring case. */
+extern int strcasecmp (__const char *__s1, __const char *__s2)
+ __THROW __attribute_pure__ __nonnull ((1, 2));
+
+/* Compare no more than N chars of S1 and S2, ignoring case. */
+extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n)
+ __THROW __attribute_pure__ __nonnull ((1, 2));
+#endif /* Use BSD. */
+
+#ifdef __USE_GNU
+/* Again versions of a few functions which use the given locale instead
+ of the global one. */
+extern int strcasecmp_l (__const char *__s1, __const char *__s2,
+ __locale_t __loc)
+ __THROW __attribute_pure__ __nonnull ((1, 2, 3));
+
+extern int strncasecmp_l (__const char *__s1, __const char *__s2,
+ size_t __n, __locale_t __loc)
+ __THROW __attribute_pure__ __nonnull ((1, 2, 4));
+#endif
+
+#ifdef __USE_BSD
+/* Return the next DELIM-delimited token from *STRINGP,
+ terminating it with a '\0', and update *STRINGP to point past it. */
+extern char *strsep (char **__restrict __stringp,
+ __const char *__restrict __delim)
+ __THROW __nonnull ((1, 2));
+#endif
+
+#ifdef __USE_GNU
+/* Compare S1 and S2 as strings holding name & indices/version numbers. */
+extern int strverscmp (__const char *__s1, __const char *__s2)
+ __THROW __attribute_pure__ __nonnull ((1, 2));
+
+/* Return a string describing the meaning of the signal number in SIG. */
+extern char *strsignal (int __sig) __THROW;
+
+/* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */
+extern char *__stpcpy (char *__restrict __dest, __const char *__restrict __src)
+ __THROW __nonnull ((1, 2));
+extern char *stpcpy (char *__restrict __dest, __const char *__restrict __src)
+ __THROW __nonnull ((1, 2));
+
+/* Copy no more than N characters of SRC to DEST, returning the address of
+ the last character written into DEST. */
+extern char *__stpncpy (char *__restrict __dest,
+ __const char *__restrict __src, size_t __n)
+ __THROW __nonnull ((1, 2));
+extern char *stpncpy (char *__restrict __dest,
+ __const char *__restrict __src, size_t __n)
+ __THROW __nonnull ((1, 2));
+
+/* Sautee STRING briskly. */
+extern char *strfry (char *__string) __THROW __nonnull ((1));
+
+/* Frobnicate N bytes of S. */
+extern void *memfrob (void *__s, size_t __n) __THROW __nonnull ((1));
+
+# ifndef basename
+/* Return the file name within directory of FILENAME. We don't
+ declare the function if the `basename' macro is available (defined
+ in <libgen.h>) which makes the XPG version of this function
+ available. */
+extern char *basename (__const char *__filename) __THROW __nonnull ((1));
+# endif
+#endif
+
+
+#if defined __GNUC__ && __GNUC__ >= 2
+# if defined __OPTIMIZE__ && !defined __OPTIMIZE_SIZE__ \
+ && !defined __NO_INLINE__ && !defined __cplusplus
+/* When using GNU CC we provide some optimized versions of selected
+ functions from this header. There are two kinds of optimizations:
+
+ - machine-dependent optimizations, most probably using inline
+ assembler code; these might be quite expensive since the code
+ size can increase significantly.
+ These optimizations are not used unless the symbol
+ __USE_STRING_INLINES
+ is defined before including this header.
+
+ - machine-independent optimizations which do not increase the
+ code size significantly and which optimize mainly situations
+ where one or more arguments are compile-time constants.
+ These optimizations are used always when the compiler is
+ taught to optimize.
+
+ One can inhibit all optimizations by defining __NO_STRING_INLINES. */
+
+/* Get the machine-dependent optimizations (if any). */
+# include <bits/string.h>
+
+/* These are generic optimizations which do not add too much inline code. */
+# include <bits/string2.h>
+# endif
+
+# if __USE_FORTIFY_LEVEL > 0 && defined __extern_always_inline
+/* Functions with security checks. */
+# include <bits/string3.h>
+# endif
+#endif
+
+__END_DECLS
+
+#endif /* string.h */
diff --git a/sysroot/usr/include/strings.h b/sysroot/usr/include/strings.h
new file mode 100644
index 0000000..3ba2b04
--- /dev/null
+++ b/sysroot/usr/include/strings.h
@@ -0,0 +1,65 @@
+/* Copyright (C) 1991,92,96,97,99,2000,2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _STRINGS_H
+#define _STRINGS_H 1
+
+/* We don't need and should not read this file if <string.h> was already
+ read. The one exception being that if __USE_BSD isn't defined, then
+ these aren't defined in string.h, so we need to define them here. */
+#if !defined _STRING_H || !defined __USE_BSD
+
+# include <features.h>
+# define __need_size_t
+# include <stddef.h>
+
+__BEGIN_DECLS
+
+/* Compare N bytes of S1 and S2 (same as memcmp). */
+extern int bcmp (__const void *__s1, __const void *__s2, size_t __n)
+ __THROW __attribute_pure__;
+
+/* Copy N bytes of SRC to DEST (like memmove, but args reversed). */
+extern void bcopy (__const void *__src, void *__dest, size_t __n) __THROW;
+
+/* Set N bytes of S to 0. */
+extern void bzero (void *__s, size_t __n) __THROW;
+
+/* Return the position of the first bit set in I, or 0 if none are set.
+ The least-significant bit is position 1, the most-significant 32. */
+extern int ffs (int __i) __THROW __attribute__ ((const));
+
+/* Find the first occurrence of C in S (same as strchr). */
+extern char *index (__const char *__s, int __c) __THROW __attribute_pure__;
+
+/* Find the last occurrence of C in S (same as strrchr). */
+extern char *rindex (__const char *__s, int __c) __THROW __attribute_pure__;
+
+/* Compare S1 and S2, ignoring case. */
+extern int strcasecmp (__const char *__s1, __const char *__s2)
+ __THROW __attribute_pure__;
+
+/* Compare no more than N chars of S1 and S2, ignoring case. */
+extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n)
+ __THROW __attribute_pure__;
+
+__END_DECLS
+
+#endif /* string.h */
+
+#endif /* strings.h */
diff --git a/sysroot/usr/include/stropts.h b/sysroot/usr/include/stropts.h
new file mode 100644
index 0000000..192c09b
--- /dev/null
+++ b/sysroot/usr/include/stropts.h
@@ -0,0 +1,92 @@
+/* Copyright (C) 1998, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _STROPTS_H
+#define _STROPTS_H 1
+
+#include <features.h>
+#include <bits/types.h>
+#include <bits/xtitypes.h>
+
+#ifndef __gid_t_defined
+typedef __gid_t gid_t;
+# define __gid_t_defined
+#endif
+
+#ifndef __uid_t_defined
+typedef __uid_t uid_t;
+# define __uid_t_defined
+#endif
+
+typedef __t_uscalar_t t_uscalar_t;
+
+/* Get system specific contants. */
+#include <bits/stropts.h>
+
+
+__BEGIN_DECLS
+
+/* Test whether FILDES is associated with a STREAM-based file. */
+extern int isastream (int __fildes) __THROW;
+
+/* Receive next message from a STREAMS file.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int getmsg (int __fildes, struct strbuf *__restrict __ctlptr,
+ struct strbuf *__restrict __dataptr,
+ int *__restrict __flagsp);
+
+/* Receive next message from a STREAMS file, with *FLAGSP allowing to
+ control which message.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int getpmsg (int __fildes, struct strbuf *__restrict __ctlptr,
+ struct strbuf *__restrict __dataptr,
+ int *__restrict __bandp, int *__restrict __flagsp);
+
+/* Perform the I/O control operation specified by REQUEST on FD.
+ One argument may follow; its presence and type depend on REQUEST.
+ Return value depends on REQUEST. Usually -1 indicates error. */
+extern int ioctl (int __fd, unsigned long int __request, ...) __THROW;
+
+/* Send a message on a STREAM.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int putmsg (int __fildes, __const struct strbuf *__ctlptr,
+ __const struct strbuf *__dataptr, int __flags);
+
+/* Send a message on a STREAM to the BAND.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int putpmsg (int __fildes, __const struct strbuf *__ctlptr,
+ __const struct strbuf *__dataptr, int __band, int __flags);
+
+/* Attach a STREAMS-based file descriptor FILDES to a file PATH in the
+ file system name space. */
+extern int fattach (int __fildes, __const char *__path) __THROW;
+
+/* Detach a name PATH from a STREAMS-based file descriptor. */
+extern int fdetach (__const char *__path) __THROW;
+
+__END_DECLS
+
+#endif /* stropts.h */
diff --git a/sysroot/usr/include/sys/acct.h b/sysroot/usr/include/sys/acct.h
new file mode 100644
index 0000000..47c63eb
--- /dev/null
+++ b/sysroot/usr/include/sys/acct.h
@@ -0,0 +1,109 @@
+/* Copyright (C) 1996, 1997, 1998, 1999, 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_ACCT_H
+#define _SYS_ACCT_H 1
+
+#include <features.h>
+
+#include <endian.h>
+#define __need_time_t
+#include <time.h>
+#include <sys/types.h>
+
+__BEGIN_DECLS
+
+#define ACCT_COMM 16
+
+/*
+ comp_t is a 16-bit "floating" point number with a 3-bit base 8
+ exponent and a 13-bit fraction. See linux/kernel/acct.c for the
+ specific encoding system used.
+*/
+
+typedef u_int16_t comp_t;
+
+struct acct
+{
+ char ac_flag; /* Flags. */
+ u_int16_t ac_uid; /* Real user ID. */
+ u_int16_t ac_gid; /* Real group ID. */
+ u_int16_t ac_tty; /* Controlling terminal. */
+ u_int32_t ac_btime; /* Beginning time. */
+ comp_t ac_utime; /* User time. */
+ comp_t ac_stime; /* System time. */
+ comp_t ac_etime; /* Elapsed time. */
+ comp_t ac_mem; /* Average memory usage. */
+ comp_t ac_io; /* Chars transferred. */
+ comp_t ac_rw; /* Blocks read or written. */
+ comp_t ac_minflt; /* Minor pagefaults. */
+ comp_t ac_majflt; /* Major pagefaults. */
+ comp_t ac_swaps; /* Number of swaps. */
+ u_int32_t ac_exitcode; /* Process exitcode. */
+ char ac_comm[ACCT_COMM+1]; /* Command name. */
+ char ac_pad[10]; /* Padding bytes. */
+};
+
+
+struct acct_v3
+{
+ char ac_flag; /* Flags */
+ char ac_version; /* Always set to ACCT_VERSION */
+ u_int16_t ac_tty; /* Control Terminal */
+ u_int32_t ac_exitcode; /* Exitcode */
+ u_int32_t ac_uid; /* Real User ID */
+ u_int32_t ac_gid; /* Real Group ID */
+ u_int32_t ac_pid; /* Process ID */
+ u_int32_t ac_ppid; /* Parent Process ID */
+ u_int32_t ac_btime; /* Process Creation Time */
+ float ac_etime; /* Elapsed Time */
+ comp_t ac_utime; /* User Time */
+ comp_t ac_stime; /* System Time */
+ comp_t ac_mem; /* Average Memory Usage */
+ comp_t ac_io; /* Chars Transferred */
+ comp_t ac_rw; /* Blocks Read or Written */
+ comp_t ac_minflt; /* Minor Pagefaults */
+ comp_t ac_majflt; /* Major Pagefaults */
+ comp_t ac_swaps; /* Number of Swaps */
+ char ac_comm[ACCT_COMM]; /* Command Name */
+};
+
+
+enum
+ {
+ AFORK = 0x01, /* Has executed fork, but no exec. */
+ ASU = 0x02, /* Used super-user privileges. */
+ ACORE = 0x08, /* Dumped core. */
+ AXSIG = 0x10 /* Killed by a signal. */
+ };
+
+#if __BYTE_ORDER == __BIG_ENDIAN
+# define ACCT_BYTEORDER 0x80 /* Accounting file is big endian. */
+#else
+# define ACCT_BYTEORDER 0x00 /* Accounting file is little endian. */
+#endif
+
+#define AHZ 100
+
+
+/* Switch process accounting on and off. */
+extern int acct (__const char *__filename) __THROW;
+
+__END_DECLS
+
+#endif /* sys/acct.h */
diff --git a/sysroot/usr/include/sys/asoundlib.h b/sysroot/usr/include/sys/asoundlib.h
new file mode 100644
index 0000000..47f587c
--- /dev/null
+++ b/sysroot/usr/include/sys/asoundlib.h
@@ -0,0 +1,2 @@
+#warning This header is deprecated, use <alsa/asoundlib.h> instead.
+#include <alsa/asoundlib.h>
diff --git a/sysroot/usr/include/sys/bitypes.h b/sysroot/usr/include/sys/bitypes.h
new file mode 100644
index 0000000..3a9860f
--- /dev/null
+++ b/sysroot/usr/include/sys/bitypes.h
@@ -0,0 +1,3 @@
+/* The GNU <sys/types.h> defines all the necessary types. */
+
+#include <sys/types.h>
diff --git a/sysroot/usr/include/sys/cdefs.h b/sysroot/usr/include/sys/cdefs.h
new file mode 100644
index 0000000..efdc4f9
--- /dev/null
+++ b/sysroot/usr/include/sys/cdefs.h
@@ -0,0 +1,382 @@
+/* Copyright (C) 1992-2001, 2002, 2004, 2005, 2006, 2007
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_CDEFS_H
+#define _SYS_CDEFS_H 1
+
+/* We are almost always included from features.h. */
+#ifndef _FEATURES_H
+# include <features.h>
+#endif
+
+/* The GNU libc does not support any K&R compilers or the traditional mode
+ of ISO C compilers anymore. Check for some of the combinations not
+ anymore supported. */
+#if defined __GNUC__ && !defined __STDC__
+# error "You need a ISO C conforming compiler to use the glibc headers"
+#endif
+
+/* Some user header file might have defined this before. */
+#undef __P
+#undef __PMT
+
+#ifdef __GNUC__
+
+/* GCC can always grok prototypes. For C++ programs we add throw()
+ to help it optimize the function calls. But this works only with
+ gcc 2.8.x and egcs. For gcc 3.2 and up we even mark C functions
+ as non-throwing using a function attribute since programs can use
+ the -fexceptions options for C code as well. */
+# if !defined __cplusplus && __GNUC_PREREQ (3, 3)
+# define __THROW __attribute__ ((__nothrow__))
+# define __NTH(fct) __attribute__ ((__nothrow__)) fct
+# else
+# if defined __cplusplus && __GNUC_PREREQ (2,8)
+# define __THROW throw ()
+# define __NTH(fct) fct throw ()
+# else
+# define __THROW
+# define __NTH(fct) fct
+# endif
+# endif
+
+#else /* Not GCC. */
+
+# define __inline /* No inline functions. */
+
+# define __THROW
+# define __NTH(fct) fct
+
+# define __const const
+# define __signed signed
+# define __volatile volatile
+
+#endif /* GCC. */
+
+/* These two macros are not used in glibc anymore. They are kept here
+ only because some other projects expect the macros to be defined. */
+#define __P(args) args
+#define __PMT(args) args
+
+/* For these things, GCC behaves the ANSI way normally,
+ and the non-ANSI way under -traditional. */
+
+#define __CONCAT(x,y) x ## y
+#define __STRING(x) #x
+
+/* This is not a typedef so `const __ptr_t' does the right thing. */
+#define __ptr_t void *
+#define __long_double_t long double
+
+
+/* C++ needs to know that types and declarations are C, not C++. */
+#ifdef __cplusplus
+# define __BEGIN_DECLS extern "C" {
+# define __END_DECLS }
+#else
+# define __BEGIN_DECLS
+# define __END_DECLS
+#endif
+
+
+/* The standard library needs the functions from the ISO C90 standard
+ in the std namespace. At the same time we want to be safe for
+ future changes and we include the ISO C99 code in the non-standard
+ namespace __c99. The C++ wrapper header take case of adding the
+ definitions to the global namespace. */
+#if defined __cplusplus && defined _GLIBCPP_USE_NAMESPACES
+# define __BEGIN_NAMESPACE_STD namespace std {
+# define __END_NAMESPACE_STD }
+# define __USING_NAMESPACE_STD(name) using std::name;
+# define __BEGIN_NAMESPACE_C99 namespace __c99 {
+# define __END_NAMESPACE_C99 }
+# define __USING_NAMESPACE_C99(name) using __c99::name;
+#else
+/* For compatibility we do not add the declarations into any
+ namespace. They will end up in the global namespace which is what
+ old code expects. */
+# define __BEGIN_NAMESPACE_STD
+# define __END_NAMESPACE_STD
+# define __USING_NAMESPACE_STD(name)
+# define __BEGIN_NAMESPACE_C99
+# define __END_NAMESPACE_C99
+# define __USING_NAMESPACE_C99(name)
+#endif
+
+
+/* Support for bounded pointers. */
+#ifndef __BOUNDED_POINTERS__
+# define __bounded /* nothing */
+# define __unbounded /* nothing */
+# define __ptrvalue /* nothing */
+#endif
+
+
+/* Fortify support. */
+#define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1)
+#define __bos0(ptr) __builtin_object_size (ptr, 0)
+
+#if __GNUC_PREREQ (4,3)
+# define __warndecl(name, msg) \
+ extern void name (void) __attribute__((__warning__ (msg)))
+# define __warnattr(msg) __attribute__((__warning__ (msg)))
+# define __errordecl(name, msg) \
+ extern void name (void) __attribute__((__error__ (msg)))
+#else
+# define __warndecl(name, msg) extern void name (void)
+# define __warnattr(msg)
+# define __errordecl(name, msg) extern void name (void)
+#endif
+
+/* Support for flexible arrays. */
+#if __GNUC_PREREQ (2,97)
+/* GCC 2.97 supports C99 flexible array members. */
+# define __flexarr []
+#else
+# ifdef __GNUC__
+# define __flexarr [0]
+# else
+# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
+# define __flexarr []
+# else
+/* Some other non-C99 compiler. Approximate with [1]. */
+# define __flexarr [1]
+# endif
+# endif
+#endif
+
+
+/* __asm__ ("xyz") is used throughout the headers to rename functions
+ at the assembly language level. This is wrapped by the __REDIRECT
+ macro, in order to support compilers that can do this some other
+ way. When compilers don't support asm-names at all, we have to do
+ preprocessor tricks instead (which don't have exactly the right
+ semantics, but it's the best we can do).
+
+ Example:
+ int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */
+
+#if defined __GNUC__ && __GNUC__ >= 2
+
+# define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias))
+# ifdef __cplusplus
+# define __REDIRECT_NTH(name, proto, alias) \
+ name proto __THROW __asm__ (__ASMNAME (#alias))
+# else
+# define __REDIRECT_NTH(name, proto, alias) \
+ name proto __asm__ (__ASMNAME (#alias)) __THROW
+# endif
+# define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname)
+# define __ASMNAME2(prefix, cname) __STRING (prefix) cname
+
+/*
+#elif __SOME_OTHER_COMPILER__
+
+# define __REDIRECT(name, proto, alias) name proto; \
+ _Pragma("let " #name " = " #alias)
+*/
+#endif
+
+/* GCC has various useful declarations that can be made with the
+ `__attribute__' syntax. All of the ways we use this do fine if
+ they are omitted for compilers that don't understand it. */
+#if !defined __GNUC__ || __GNUC__ < 2
+# define __attribute__(xyz) /* Ignore */
+#endif
+
+/* At some point during the gcc 2.96 development the `malloc' attribute
+ for functions was introduced. We don't want to use it unconditionally
+ (although this would be possible) since it generates warnings. */
+#if __GNUC_PREREQ (2,96)
+# define __attribute_malloc__ __attribute__ ((__malloc__))
+#else
+# define __attribute_malloc__ /* Ignore */
+#endif
+
+/* At some point during the gcc 2.96 development the `pure' attribute
+ for functions was introduced. We don't want to use it unconditionally
+ (although this would be possible) since it generates warnings. */
+#if __GNUC_PREREQ (2,96)
+# define __attribute_pure__ __attribute__ ((__pure__))
+#else
+# define __attribute_pure__ /* Ignore */
+#endif
+
+/* At some point during the gcc 3.1 development the `used' attribute
+ for functions was introduced. We don't want to use it unconditionally
+ (although this would be possible) since it generates warnings. */
+#if __GNUC_PREREQ (3,1)
+# define __attribute_used__ __attribute__ ((__used__))
+# define __attribute_noinline__ __attribute__ ((__noinline__))
+#else
+# define __attribute_used__ __attribute__ ((__unused__))
+# define __attribute_noinline__ /* Ignore */
+#endif
+
+/* gcc allows marking deprecated functions. */
+#if __GNUC_PREREQ (3,2)
+# define __attribute_deprecated__ __attribute__ ((__deprecated__))
+#else
+# define __attribute_deprecated__ /* Ignore */
+#endif
+
+/* At some point during the gcc 2.8 development the `format_arg' attribute
+ for functions was introduced. We don't want to use it unconditionally
+ (although this would be possible) since it generates warnings.
+ If several `format_arg' attributes are given for the same function, in
+ gcc-3.0 and older, all but the last one are ignored. In newer gccs,
+ all designated arguments are considered. */
+#if __GNUC_PREREQ (2,8)
+# define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x)))
+#else
+# define __attribute_format_arg__(x) /* Ignore */
+#endif
+
+/* At some point during the gcc 2.97 development the `strfmon' format
+ attribute for functions was introduced. We don't want to use it
+ unconditionally (although this would be possible) since it
+ generates warnings. */
+#if __GNUC_PREREQ (2,97)
+# define __attribute_format_strfmon__(a,b) \
+ __attribute__ ((__format__ (__strfmon__, a, b)))
+#else
+# define __attribute_format_strfmon__(a,b) /* Ignore */
+#endif
+
+/* The nonull function attribute allows to mark pointer parameters which
+ must not be NULL. */
+#if __GNUC_PREREQ (3,3)
+# define __nonnull(params) __attribute__ ((__nonnull__ params))
+#else
+# define __nonnull(params)
+#endif
+
+/* If fortification mode, we warn about unused results of certain
+ function calls which can lead to problems. */
+#if __GNUC_PREREQ (3,4)
+# define __attribute_warn_unused_result__ \
+ __attribute__ ((__warn_unused_result__))
+# if __USE_FORTIFY_LEVEL > 0
+# define __wur __attribute_warn_unused_result__
+# endif
+#else
+# define __attribute_warn_unused_result__ /* empty */
+#endif
+#ifndef __wur
+# define __wur /* Ignore */
+#endif
+
+/* Forces a function to be always inlined. */
+#if __GNUC_PREREQ (3,2)
+# define __always_inline __inline __attribute__ ((__always_inline__))
+#else
+# define __always_inline __inline
+#endif
+
+/* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
+ inline semantics, unless -fgnu89-inline is used. */
+#if !defined __cplusplus || __GNUC_PREREQ (4,3)
+# if defined __GNUC_STDC_INLINE__ || defined __cplusplus
+# define __extern_inline extern __inline __attribute__ ((__gnu_inline__))
+# if __GNUC_PREREQ (4,3)
+# define __extern_always_inline \
+ extern __always_inline __attribute__ ((__gnu_inline__, __artificial__))
+# else
+# define __extern_always_inline \
+ extern __always_inline __attribute__ ((__gnu_inline__))
+# endif
+# else
+# define __extern_inline extern __inline
+# define __extern_always_inline extern __always_inline
+# endif
+#endif
+
+/* GCC 4.3 and above allow passing all anonymous arguments of an
+ __extern_always_inline function to some other vararg function. */
+#if __GNUC_PREREQ (4,3)
+# define __va_arg_pack() __builtin_va_arg_pack ()
+# define __va_arg_pack_len() __builtin_va_arg_pack_len ()
+#endif
+
+/* It is possible to compile containing GCC extensions even if GCC is
+ run in pedantic mode if the uses are carefully marked using the
+ `__extension__' keyword. But this is not generally available before
+ version 2.8. */
+#if !__GNUC_PREREQ (2,8)
+# define __extension__ /* Ignore */
+#endif
+
+/* __restrict is known in EGCS 1.2 and above. */
+#if !__GNUC_PREREQ (2,92)
+# define __restrict /* Ignore */
+#endif
+
+/* ISO C99 also allows to declare arrays as non-overlapping. The syntax is
+ array_name[restrict]
+ GCC 3.1 supports this. */
+#if __GNUC_PREREQ (3,1) && !defined __GNUG__
+# define __restrict_arr __restrict
+#else
+# ifdef __GNUC__
+# define __restrict_arr /* Not supported in old GCC. */
+# else
+# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
+# define __restrict_arr restrict
+# else
+/* Some other non-C99 compiler. */
+# define __restrict_arr /* Not supported. */
+# endif
+# endif
+#endif
+
+#include <bits/wordsize.h>
+
+#if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
+# define __LDBL_COMPAT 1
+# ifdef __REDIRECT
+# define __LDBL_REDIR1(name, proto, alias) __REDIRECT (name, proto, alias)
+# define __LDBL_REDIR(name, proto) \
+ __LDBL_REDIR1 (name, proto, __nldbl_##name)
+# define __LDBL_REDIR1_NTH(name, proto, alias) __REDIRECT_NTH (name, proto, alias)
+# define __LDBL_REDIR_NTH(name, proto) \
+ __LDBL_REDIR1_NTH (name, proto, __nldbl_##name)
+# define __LDBL_REDIR1_DECL(name, alias) \
+ extern __typeof (name) name __asm (__ASMNAME (#alias));
+# define __LDBL_REDIR_DECL(name) \
+ extern __typeof (name) name __asm (__ASMNAME ("__nldbl_" #name));
+# define __REDIRECT_LDBL(name, proto, alias) \
+ __LDBL_REDIR1 (name, proto, __nldbl_##alias)
+# define __REDIRECT_NTH_LDBL(name, proto, alias) \
+ __LDBL_REDIR1_NTH (name, proto, __nldbl_##alias)
+# endif
+#endif
+#if !defined __LDBL_COMPAT || !defined __REDIRECT
+# define __LDBL_REDIR1(name, proto, alias) name proto
+# define __LDBL_REDIR(name, proto) name proto
+# define __LDBL_REDIR1_NTH(name, proto, alias) name proto __THROW
+# define __LDBL_REDIR_NTH(name, proto) name proto __THROW
+# define __LDBL_REDIR_DECL(name)
+# ifdef __REDIRECT
+# define __REDIRECT_LDBL(name, proto, alias) __REDIRECT (name, proto, alias)
+# define __REDIRECT_NTH_LDBL(name, proto, alias) \
+ __REDIRECT_NTH (name, proto, alias)
+# endif
+#endif
+
+#endif /* sys/cdefs.h */
diff --git a/sysroot/usr/include/sys/debugreg.h b/sysroot/usr/include/sys/debugreg.h
new file mode 100644
index 0000000..8abbf75
--- /dev/null
+++ b/sysroot/usr/include/sys/debugreg.h
@@ -0,0 +1,88 @@
+/* Copyright (C) 2001, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_DEBUGREG_H
+#define _SYS_DEBUGREG_H 1
+#include <bits/wordsize.h>
+
+/* Indicate the register numbers for a number of the specific
+ debug registers. Registers 0-3 contain the addresses we wish to trap on */
+#define DR_FIRSTADDR 0 /* u_debugreg[DR_FIRSTADDR] */
+#define DR_LASTADDR 3 /* u_debugreg[DR_LASTADDR] */
+
+#define DR_STATUS 6 /* u_debugreg[DR_STATUS] */
+#define DR_CONTROL 7 /* u_debugreg[DR_CONTROL] */
+
+/* Define a few things for the status register. We can use this to determine
+ which debugging register was responsible for the trap. The other bits
+ are either reserved or not of interest to us. */
+
+#define DR_TRAP0 (0x1) /* db0 */
+#define DR_TRAP1 (0x2) /* db1 */
+#define DR_TRAP2 (0x4) /* db2 */
+#define DR_TRAP3 (0x8) /* db3 */
+
+#define DR_STEP (0x4000) /* single-step */
+#define DR_SWITCH (0x8000) /* task switch */
+
+/* Now define a bunch of things for manipulating the control register.
+ The top two bytes of the control register consist of 4 fields of 4
+ bits - each field corresponds to one of the four debug registers,
+ and indicates what types of access we trap on, and how large the data
+ field is that we are looking at */
+
+#define DR_CONTROL_SHIFT 16 /* Skip this many bits in ctl register */
+#define DR_CONTROL_SIZE 4 /* 4 control bits per register */
+
+#define DR_RW_EXECUTE (0x0) /* Settings for the access types to trap on */
+#define DR_RW_WRITE (0x1)
+#define DR_RW_READ (0x3)
+
+#define DR_LEN_1 (0x0) /* Settings for data length to trap on */
+#define DR_LEN_2 (0x4)
+#define DR_LEN_4 (0xC)
+#define DR_LEN_8 (0x8)
+
+/* The low byte to the control register determine which registers are
+ enabled. There are 4 fields of two bits. One bit is "local", meaning
+ that the processor will reset the bit after a task switch and the other
+ is global meaning that we have to explicitly reset the bit. With linux,
+ you can use either one, since we explicitly zero the register when we enter
+ kernel mode. */
+
+#define DR_LOCAL_ENABLE_SHIFT 0 /* Extra shift to the local enable bit */
+#define DR_GLOBAL_ENABLE_SHIFT 1 /* Extra shift to the global enable bit */
+#define DR_ENABLE_SIZE 2 /* 2 enable bits per register */
+
+#define DR_LOCAL_ENABLE_MASK (0x55) /* Set local bits for all 4 regs */
+#define DR_GLOBAL_ENABLE_MASK (0xAA) /* Set global bits for all 4 regs */
+
+/* The second byte to the control register has a few special
+ things. */
+
+
+
+#if __WORDSIZE == 64
+# define DR_CONTROL_RESERVED (0xFFFFFFFF0000FC00UL) /* Reserved */
+#else
+# define DR_CONTROL_RESERVED (0x00FC00U) /* Reserved */
+#endif
+#define DR_LOCAL_SLOWDOWN (0x100) /* Local slow the pipeline */
+#define DR_GLOBAL_SLOWDOWN (0x200) /* Global slow the pipeline */
+
+#endif /* sys/debugreg.h */
diff --git a/sysroot/usr/include/sys/dir.h b/sysroot/usr/include/sys/dir.h
new file mode 100644
index 0000000..2611d6c
--- /dev/null
+++ b/sysroot/usr/include/sys/dir.h
@@ -0,0 +1,28 @@
+/* Copyright (C) 1991, 1996 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_DIR_H
+#define _SYS_DIR_H 1
+
+#include <features.h>
+
+#include <dirent.h>
+
+#define direct dirent
+
+#endif /* sys/dir.h */
diff --git a/sysroot/usr/include/sys/elf.h b/sysroot/usr/include/sys/elf.h
new file mode 100644
index 0000000..d959cdc
--- /dev/null
+++ b/sysroot/usr/include/sys/elf.h
@@ -0,0 +1,26 @@
+/* Copyright (C) 1998, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_ELF_H
+#define _SYS_ELF_H 1
+
+#warning "This header is obsolete; use <sys/procfs.h> instead."
+
+#include <sys/procfs.h>
+
+#endif /* _SYS_ELF_H */
diff --git a/sysroot/usr/include/sys/epoll.h b/sysroot/usr/include/sys/epoll.h
new file mode 100644
index 0000000..dfb65fe
--- /dev/null
+++ b/sysroot/usr/include/sys/epoll.h
@@ -0,0 +1,130 @@
+/* Copyright (C) 2002,2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_EPOLL_H
+#define _SYS_EPOLL_H 1
+
+#include <stdint.h>
+#include <sys/types.h>
+
+/* Get __sigset_t. */
+#include <bits/sigset.h>
+
+#ifndef __sigset_t_defined
+# define __sigset_t_defined
+typedef __sigset_t sigset_t;
+#endif
+
+
+enum EPOLL_EVENTS
+ {
+ EPOLLIN = 0x001,
+#define EPOLLIN EPOLLIN
+ EPOLLPRI = 0x002,
+#define EPOLLPRI EPOLLPRI
+ EPOLLOUT = 0x004,
+#define EPOLLOUT EPOLLOUT
+ EPOLLRDNORM = 0x040,
+#define EPOLLRDNORM EPOLLRDNORM
+ EPOLLRDBAND = 0x080,
+#define EPOLLRDBAND EPOLLRDBAND
+ EPOLLWRNORM = 0x100,
+#define EPOLLWRNORM EPOLLWRNORM
+ EPOLLWRBAND = 0x200,
+#define EPOLLWRBAND EPOLLWRBAND
+ EPOLLMSG = 0x400,
+#define EPOLLMSG EPOLLMSG
+ EPOLLERR = 0x008,
+#define EPOLLERR EPOLLERR
+ EPOLLHUP = 0x010,
+#define EPOLLHUP EPOLLHUP
+ EPOLLRDHUP = 0x2000,
+#define EPOLLRDHUP EPOLLRDHUP
+ EPOLLONESHOT = (1 << 30),
+#define EPOLLONESHOT EPOLLONESHOT
+ EPOLLET = (1 << 31)
+#define EPOLLET EPOLLET
+ };
+
+
+/* Valid opcodes ( "op" parameter ) to issue to epoll_ctl(). */
+#define EPOLL_CTL_ADD 1 /* Add a file decriptor to the interface. */
+#define EPOLL_CTL_DEL 2 /* Remove a file decriptor from the interface. */
+#define EPOLL_CTL_MOD 3 /* Change file decriptor epoll_event structure. */
+
+
+typedef union epoll_data
+{
+ void *ptr;
+ int fd;
+ uint32_t u32;
+ uint64_t u64;
+} epoll_data_t;
+
+struct epoll_event
+{
+ uint32_t events; /* Epoll events */
+ epoll_data_t data; /* User data variable */
+} __attribute__ ((__packed__));
+
+
+__BEGIN_DECLS
+
+/* Creates an epoll instance. Returns an fd for the new instance.
+ The "size" parameter is a hint specifying the number of file
+ descriptors to be associated with the new instance. The fd
+ returned by epoll_create() should be closed with close(). */
+extern int epoll_create (int __size) __THROW;
+
+
+/* Manipulate an epoll instance "epfd". Returns 0 in case of success,
+ -1 in case of error ( the "errno" variable will contain the
+ specific error code ) The "op" parameter is one of the EPOLL_CTL_*
+ constants defined above. The "fd" parameter is the target of the
+ operation. The "event" parameter describes which events the caller
+ is interested in and any associated user data. */
+extern int epoll_ctl (int __epfd, int __op, int __fd,
+ struct epoll_event *__event) __THROW;
+
+
+/* Wait for events on an epoll instance "epfd". Returns the number of
+ triggered events returned in "events" buffer. Or -1 in case of
+ error with the "errno" variable set to the specific error code. The
+ "events" parameter is a buffer that will contain triggered
+ events. The "maxevents" is the maximum number of events to be
+ returned ( usually size of "events" ). The "timeout" parameter
+ specifies the maximum wait time in milliseconds (-1 == infinite).
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int epoll_wait (int __epfd, struct epoll_event *__events,
+ int __maxevents, int __timeout);
+
+
+/* Same as epoll_wait, but the thread's signal mask is temporarily
+ and atomically replaced with the one provided as parameter.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int epoll_pwait (int __epfd, struct epoll_event *__events,
+ int __maxevents, int __timeout,
+ __const __sigset_t *__ss);
+
+__END_DECLS
+
+#endif /* sys/epoll.h */
diff --git a/sysroot/usr/include/sys/errno.h b/sysroot/usr/include/sys/errno.h
new file mode 100644
index 0000000..339f4fc
--- /dev/null
+++ b/sysroot/usr/include/sys/errno.h
@@ -0,0 +1 @@
+#include <errno.h>
diff --git a/sysroot/usr/include/sys/fcntl.h b/sysroot/usr/include/sys/fcntl.h
new file mode 100644
index 0000000..cd30455
--- /dev/null
+++ b/sysroot/usr/include/sys/fcntl.h
@@ -0,0 +1 @@
+#include <fcntl.h>
diff --git a/sysroot/usr/include/sys/file.h b/sysroot/usr/include/sys/file.h
new file mode 100644
index 0000000..93b3635
--- /dev/null
+++ b/sysroot/usr/include/sys/file.h
@@ -0,0 +1,56 @@
+/* Copyright (C) 1991, 92, 96, 97, 98, 99 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_FILE_H
+#define _SYS_FILE_H 1
+
+#include <features.h>
+
+#ifndef _FCNTL_H
+# include <fcntl.h>
+#endif
+
+__BEGIN_DECLS
+
+
+/* Alternate names for values for the WHENCE argument to `lseek'.
+ These are the same as SEEK_SET, SEEK_CUR, and SEEK_END, respectively. */
+#ifndef L_SET
+# define L_SET 0 /* Seek from beginning of file. */
+# define L_INCR 1 /* Seek from current position. */
+# define L_XTND 2 /* Seek from end of file. */
+#endif
+
+
+/* Operations for the `flock' call. */
+#define LOCK_SH 1 /* Shared lock. */
+#define LOCK_EX 2 /* Exclusive lock. */
+#define LOCK_UN 8 /* Unlock. */
+
+/* Can be OR'd in to one of the above. */
+#define LOCK_NB 4 /* Don't block when locking. */
+
+
+/* Apply or remove an advisory lock, according to OPERATION,
+ on the file FD refers to. */
+extern int flock (int __fd, int __operation) __THROW;
+
+
+__END_DECLS
+
+#endif /* sys/file.h */
diff --git a/sysroot/usr/include/sys/fsuid.h b/sysroot/usr/include/sys/fsuid.h
new file mode 100644
index 0000000..4ecb199
--- /dev/null
+++ b/sysroot/usr/include/sys/fsuid.h
@@ -0,0 +1,36 @@
+/* Copyright (C) 1997, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_FSUID_H
+#define _SYS_FSUID_H 1
+
+#include <features.h>
+#include <sys/types.h>
+
+__BEGIN_DECLS
+
+/* Change uid used for file access control to UID, without affecting
+ other privileges (such as who can send signals at the process). */
+extern int setfsuid (__uid_t __uid) __THROW;
+
+/* Ditto for group id. */
+extern int setfsgid (__gid_t __gid) __THROW;
+
+__END_DECLS
+
+#endif /* fsuid.h */
diff --git a/sysroot/usr/include/sys/gmon.h b/sysroot/usr/include/sys/gmon.h
new file mode 100644
index 0000000..c02f831
--- /dev/null
+++ b/sysroot/usr/include/sys/gmon.h
@@ -0,0 +1,201 @@
+/*-
+ * Copyright (c) 1982, 1986, 1992, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)gmon.h 8.2 (Berkeley) 1/4/94
+ */
+
+#ifndef _SYS_GMON_H
+#define _SYS_GMON_H 1
+
+#include <features.h>
+
+#include <sys/types.h>
+
+/*
+ * See gmon_out.h for gmon.out format.
+ */
+
+/* structure emitted by "gcc -a". This must match struct bb in
+ gcc/libgcc2.c. It is OK for gcc to declare a longer structure as
+ long as the members below are present. */
+struct __bb
+{
+ long zero_word;
+ const char *filename;
+ long *counts;
+ long ncounts;
+ struct __bb *next;
+ const unsigned long *addresses;
+};
+
+extern struct __bb *__bb_head;
+
+/*
+ * histogram counters are unsigned shorts (according to the kernel).
+ */
+#define HISTCOUNTER unsigned short
+
+/*
+ * fraction of text space to allocate for histogram counters here, 1/2
+ */
+#define HISTFRACTION 2
+
+/*
+ * Fraction of text space to allocate for from hash buckets.
+ * The value of HASHFRACTION is based on the minimum number of bytes
+ * of separation between two subroutine call points in the object code.
+ * Given MIN_SUBR_SEPARATION bytes of separation the value of
+ * HASHFRACTION is calculated as:
+ *
+ * HASHFRACTION = MIN_SUBR_SEPARATION / (2 * sizeof(short) - 1);
+ *
+ * For example, on the VAX, the shortest two call sequence is:
+ *
+ * calls $0,(r0)
+ * calls $0,(r0)
+ *
+ * which is separated by only three bytes, thus HASHFRACTION is
+ * calculated as:
+ *
+ * HASHFRACTION = 3 / (2 * 2 - 1) = 1
+ *
+ * Note that the division above rounds down, thus if MIN_SUBR_FRACTION
+ * is less than three, this algorithm will not work!
+ *
+ * In practice, however, call instructions are rarely at a minimal
+ * distance. Hence, we will define HASHFRACTION to be 2 across all
+ * architectures. This saves a reasonable amount of space for
+ * profiling data structures without (in practice) sacrificing
+ * any granularity.
+ */
+#define HASHFRACTION 2
+
+/*
+ * Percent of text space to allocate for tostructs.
+ * This is a heuristic; we will fail with a warning when profiling programs
+ * with a very large number of very small functions, but that's
+ * normally OK.
+ * 2 is probably still a good value for normal programs.
+ * Profiling a test case with 64000 small functions will work if
+ * you raise this value to 3 and link statically (which bloats the
+ * text size, thus raising the number of arcs expected by the heuristic).
+ */
+#define ARCDENSITY 3
+
+/*
+ * Always allocate at least this many tostructs. This
+ * hides the inadequacy of the ARCDENSITY heuristic, at least
+ * for small programs.
+ */
+#define MINARCS 50
+
+/*
+ * The type used to represent indices into gmonparam.tos[].
+ */
+#define ARCINDEX u_long
+
+/*
+ * Maximum number of arcs we want to allow.
+ * Used to be max representable value of ARCINDEX minus 2, but now
+ * that ARCINDEX is a long, that's too large; we don't really want
+ * to allow a 48 gigabyte table.
+ * The old value of 1<<16 wasn't high enough in practice for large C++
+ * programs; will 1<<20 be adequate for long? FIXME
+ */
+#define MAXARCS (1 << 20)
+
+struct tostruct {
+ u_long selfpc;
+ long count;
+ ARCINDEX link;
+};
+
+/*
+ * a raw arc, with pointers to the calling site and
+ * the called site and a count.
+ */
+struct rawarc {
+ u_long raw_frompc;
+ u_long raw_selfpc;
+ long raw_count;
+};
+
+/*
+ * general rounding functions.
+ */
+#define ROUNDDOWN(x,y) (((x)/(y))*(y))
+#define ROUNDUP(x,y) ((((x)+(y)-1)/(y))*(y))
+
+/*
+ * The profiling data structures are housed in this structure.
+ */
+struct gmonparam {
+ long int state;
+ u_short *kcount;
+ u_long kcountsize;
+ ARCINDEX *froms;
+ u_long fromssize;
+ struct tostruct *tos;
+ u_long tossize;
+ long tolimit;
+ u_long lowpc;
+ u_long highpc;
+ u_long textsize;
+ u_long hashfraction;
+ long log_hashfraction;
+};
+
+/*
+ * Possible states of profiling.
+ */
+#define GMON_PROF_ON 0
+#define GMON_PROF_BUSY 1
+#define GMON_PROF_ERROR 2
+#define GMON_PROF_OFF 3
+
+/*
+ * Sysctl definitions for extracting profiling information from the kernel.
+ */
+#define GPROF_STATE 0 /* int: profiling enabling variable */
+#define GPROF_COUNT 1 /* struct: profile tick count buffer */
+#define GPROF_FROMS 2 /* struct: from location hash bucket */
+#define GPROF_TOS 3 /* struct: destination/count structure */
+#define GPROF_GMONPARAM 4 /* struct: profiling parameters (see above) */
+
+__BEGIN_DECLS
+
+/* Set up data structures and start profiling. */
+extern void __monstartup (u_long __lowpc, u_long __highpc) __THROW;
+extern void monstartup (u_long __lowpc, u_long __highpc) __THROW;
+
+/* Clean up profiling and write out gmon.out. */
+extern void _mcleanup (void) __THROW;
+
+__END_DECLS
+
+#endif /* sys/gmon.h */
diff --git a/sysroot/usr/include/sys/gmon_out.h b/sysroot/usr/include/sys/gmon_out.h
new file mode 100644
index 0000000..6fa09e8
--- /dev/null
+++ b/sysroot/usr/include/sys/gmon_out.h
@@ -0,0 +1,80 @@
+/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David Mosberger <davidm@cs.arizona.edu>.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* This file specifies the format of gmon.out files. It should have
+ as few external dependencies as possible as it is going to be included
+ in many different programs. That is, minimize the number of #include's.
+
+ A gmon.out file consists of a header (defined by gmon_hdr) followed by
+ a sequence of records. Each record starts with a one-byte tag
+ identifying the type of records, followed by records specific data. */
+
+#ifndef _SYS_GMON_OUT_H
+#define _SYS_GMON_OUT_H 1
+
+#include <features.h>
+
+#define GMON_MAGIC "gmon" /* magic cookie */
+#define GMON_VERSION 1 /* version number */
+
+/* For profiling shared object we need a new format. */
+#define GMON_SHOBJ_VERSION 0x1ffff
+
+__BEGIN_DECLS
+
+/*
+ * Raw header as it appears on file (without padding). This header
+ * always comes first in gmon.out and is then followed by a series
+ * records defined below.
+ */
+struct gmon_hdr
+ {
+ char cookie[4];
+ char version[4];
+ char spare[3 * 4];
+ };
+
+/* types of records in this file: */
+typedef enum
+ {
+ GMON_TAG_TIME_HIST = 0,
+ GMON_TAG_CG_ARC = 1,
+ GMON_TAG_BB_COUNT = 2
+ } GMON_Record_Tag;
+
+struct gmon_hist_hdr
+ {
+ char low_pc[sizeof (char *)]; /* base pc address of sample buffer */
+ char high_pc[sizeof (char *)]; /* max pc address of sampled buffer */
+ char hist_size[4]; /* size of sample buffer */
+ char prof_rate[4]; /* profiling clock rate */
+ char dimen[15]; /* phys. dim., usually "seconds" */
+ char dimen_abbrev; /* usually 's' for "seconds" */
+ };
+
+struct gmon_cg_arc_record
+ {
+ char from_pc[sizeof (char *)]; /* address within caller's body */
+ char self_pc[sizeof (char *)]; /* address within callee's body */
+ char count[4]; /* number of arc traversals */
+ };
+
+__END_DECLS
+
+#endif /* sys/gmon_out.h */
diff --git a/sysroot/usr/include/sys/inotify.h b/sysroot/usr/include/sys/inotify.h
new file mode 100644
index 0000000..0131db9
--- /dev/null
+++ b/sysroot/usr/include/sys/inotify.h
@@ -0,0 +1,92 @@
+/* Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_INOTIFY_H
+#define _SYS_INOTIFY_H 1
+
+#include <stdint.h>
+
+
+/* Structure describing an inotify event. */
+struct inotify_event
+{
+ int wd; /* Watch descriptor. */
+ uint32_t mask; /* Watch mask. */
+ uint32_t cookie; /* Cookie to synchronize two events. */
+ uint32_t len; /* Length (including NULs) of name. */
+ char name __flexarr; /* Name. */
+};
+
+
+/* Supported events suitable for MASK parameter of INOTIFY_ADD_WATCH. */
+#define IN_ACCESS 0x00000001 /* File was accessed. */
+#define IN_MODIFY 0x00000002 /* File was modified. */
+#define IN_ATTRIB 0x00000004 /* Metadata changed. */
+#define IN_CLOSE_WRITE 0x00000008 /* Writtable file was closed. */
+#define IN_CLOSE_NOWRITE 0x00000010 /* Unwrittable file closed. */
+#define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* Close. */
+#define IN_OPEN 0x00000020 /* File was opened. */
+#define IN_MOVED_FROM 0x00000040 /* File was moved from X. */
+#define IN_MOVED_TO 0x00000080 /* File was moved to Y. */
+#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* Moves. */
+#define IN_CREATE 0x00000100 /* Subfile was created. */
+#define IN_DELETE 0x00000200 /* Subfile was deleted. */
+#define IN_DELETE_SELF 0x00000400 /* Self was deleted. */
+#define IN_MOVE_SELF 0x00000800 /* Self was moved. */
+
+/* Events sent by the kernel. */
+#define IN_UNMOUNT 0x00002000 /* Backing fs was unmounted. */
+#define IN_Q_OVERFLOW 0x00004000 /* Event queued overflowed. */
+#define IN_IGNORED 0x00008000 /* File was ignored. */
+
+/* Helper events. */
+#define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* Close. */
+#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* Moves. */
+
+/* Special flags. */
+#define IN_ONLYDIR 0x01000000 /* Only watch the path if it is a
+ directory. */
+#define IN_DONT_FOLLOW 0x02000000 /* Do not follow a sym link. */
+#define IN_MASK_ADD 0x20000000 /* Add to the mask of an already
+ existing watch. */
+#define IN_ISDIR 0x40000000 /* Event occurred against dir. */
+#define IN_ONESHOT 0x80000000 /* Only send event once. */
+
+/* All events which a program can wait on. */
+#define IN_ALL_EVENTS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE \
+ | IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM \
+ | IN_MOVED_TO | IN_CREATE | IN_DELETE \
+ | IN_DELETE_SELF | IN_MOVE_SELF)
+
+
+__BEGIN_DECLS
+
+/* Create and initialize inotify instance. */
+extern int inotify_init (void) __THROW;
+
+/* Add watch of object NAME to inotify instance FD. Notify about
+ events specified by MASK. */
+extern int inotify_add_watch (int __fd, const char *__name, uint32_t __mask)
+ __THROW;
+
+/* Remove the watch specified by WD from the inotify instance FD. */
+extern int inotify_rm_watch (int __fd, uint32_t __wd) __THROW;
+
+__END_DECLS
+
+#endif /* sys/inotify.h */
diff --git a/sysroot/usr/include/sys/io.h b/sysroot/usr/include/sys/io.h
new file mode 100644
index 0000000..802a0df
--- /dev/null
+++ b/sysroot/usr/include/sys/io.h
@@ -0,0 +1,181 @@
+/* Copyright (C) 1996, 2000, 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_IO_H
+#define _SYS_IO_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* If TURN_ON is TRUE, request for permission to do direct i/o on the
+ port numbers in the range [FROM,FROM+NUM-1]. Otherwise, turn I/O
+ permission off for that range. This call requires root privileges.
+
+ Portability note: not all Linux platforms support this call. Most
+ platforms based on the PC I/O architecture probably will, however.
+ E.g., Linux/Alpha for Alpha PCs supports this. */
+extern int ioperm (unsigned long int __from, unsigned long int __num,
+ int __turn_on) __THROW;
+
+/* Set the I/O privilege level to LEVEL. If LEVEL>3, permission to
+ access any I/O port is granted. This call requires root
+ privileges. */
+extern int iopl (int __level) __THROW;
+
+#if defined __GNUC__ && __GNUC__ >= 2
+
+static __inline unsigned char
+inb (unsigned short int port)
+{
+ unsigned char _v;
+
+ __asm__ __volatile__ ("inb %w1,%0":"=a" (_v):"Nd" (port));
+ return _v;
+}
+
+static __inline unsigned char
+inb_p (unsigned short int port)
+{
+ unsigned char _v;
+
+ __asm__ __volatile__ ("inb %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (port));
+ return _v;
+}
+
+static __inline unsigned short int
+inw (unsigned short int port)
+{
+ unsigned short _v;
+
+ __asm__ __volatile__ ("inw %w1,%0":"=a" (_v):"Nd" (port));
+ return _v;
+}
+
+static __inline unsigned short int
+inw_p (unsigned short int port)
+{
+ unsigned short int _v;
+
+ __asm__ __volatile__ ("inw %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (port));
+ return _v;
+}
+
+static __inline unsigned int
+inl (unsigned short int port)
+{
+ unsigned int _v;
+
+ __asm__ __volatile__ ("inl %w1,%0":"=a" (_v):"Nd" (port));
+ return _v;
+}
+
+static __inline unsigned int
+inl_p (unsigned short int port)
+{
+ unsigned int _v;
+ __asm__ __volatile__ ("inl %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (port));
+ return _v;
+}
+
+static __inline void
+outb (unsigned char value, unsigned short int port)
+{
+ __asm__ __volatile__ ("outb %b0,%w1": :"a" (value), "Nd" (port));
+}
+
+static __inline void
+outb_p (unsigned char value, unsigned short int port)
+{
+ __asm__ __volatile__ ("outb %b0,%w1\noutb %%al,$0x80": :"a" (value),
+ "Nd" (port));
+}
+
+static __inline void
+outw (unsigned short int value, unsigned short int port)
+{
+ __asm__ __volatile__ ("outw %w0,%w1": :"a" (value), "Nd" (port));
+
+}
+
+static __inline void
+outw_p (unsigned short int value, unsigned short int port)
+{
+ __asm__ __volatile__ ("outw %w0,%w1\noutb %%al,$0x80": :"a" (value),
+ "Nd" (port));
+}
+
+static __inline void
+outl (unsigned int value, unsigned short int port)
+{
+ __asm__ __volatile__ ("outl %0,%w1": :"a" (value), "Nd" (port));
+}
+
+static __inline void
+outl_p (unsigned int value, unsigned short int port)
+{
+ __asm__ __volatile__ ("outl %0,%w1\noutb %%al,$0x80": :"a" (value),
+ "Nd" (port));
+}
+
+static __inline void
+insb (unsigned short int port, void *addr, unsigned long int count)
+{
+ __asm__ __volatile__ ("cld ; rep ; insb":"=D" (addr),
+ "=c" (count):"d" (port), "0" (addr), "1" (count));
+}
+
+static __inline void
+insw (unsigned short int port, void *addr, unsigned long int count)
+{
+ __asm__ __volatile__ ("cld ; rep ; insw":"=D" (addr),
+ "=c" (count):"d" (port), "0" (addr), "1" (count));
+}
+
+static __inline void
+insl (unsigned short int port, void *addr, unsigned long int count)
+{
+ __asm__ __volatile__ ("cld ; rep ; insl":"=D" (addr),
+ "=c" (count):"d" (port), "0" (addr), "1" (count));
+}
+
+static __inline void
+outsb (unsigned short int port, const void *addr, unsigned long int count)
+{
+ __asm__ __volatile__ ("cld ; rep ; outsb":"=S" (addr),
+ "=c" (count):"d" (port), "0" (addr), "1" (count));
+}
+
+static __inline void
+outsw (unsigned short int port, const void *addr, unsigned long int count)
+{
+ __asm__ __volatile__ ("cld ; rep ; outsw":"=S" (addr),
+ "=c" (count):"d" (port), "0" (addr), "1" (count));
+}
+
+static __inline void
+outsl (unsigned short int port, const void *addr, unsigned long int count)
+{
+ __asm__ __volatile__ ("cld ; rep ; outsl":"=S" (addr),
+ "=c" (count):"d" (port), "0" (addr), "1" (count));
+}
+
+#endif /* GNU C */
+
+__END_DECLS
+#endif /* _SYS_IO_H */
diff --git a/sysroot/usr/include/sys/ioctl.h b/sysroot/usr/include/sys/ioctl.h
new file mode 100644
index 0000000..6d8a0f4
--- /dev/null
+++ b/sysroot/usr/include/sys/ioctl.h
@@ -0,0 +1,46 @@
+/* Copyright (C) 1991, 92, 93, 94, 96, 98, 99 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_IOCTL_H
+#define _SYS_IOCTL_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Get the list of `ioctl' requests and related constants. */
+#include <bits/ioctls.h>
+
+/* Define some types used by `ioctl' requests. */
+#include <bits/ioctl-types.h>
+
+/* On a Unix system, the system <sys/ioctl.h> probably defines some of
+ the symbols we define in <sys/ttydefaults.h> (usually with the same
+ values). The code to generate <bits/ioctls.h> has omitted these
+ symbols to avoid the conflict, but a Unix program expects <sys/ioctl.h>
+ to define them, so we must include <sys/ttydefaults.h> here. */
+#include <sys/ttydefaults.h>
+
+/* Perform the I/O control operation specified by REQUEST on FD.
+ One argument may follow; its presence and type depend on REQUEST.
+ Return value depends on REQUEST. Usually -1 indicates error. */
+extern int ioctl (int __fd, unsigned long int __request, ...) __THROW;
+
+__END_DECLS
+
+#endif /* sys/ioctl.h */
diff --git a/sysroot/usr/include/sys/ipc.h b/sysroot/usr/include/sys/ipc.h
new file mode 100644
index 0000000..158c09e
--- /dev/null
+++ b/sysroot/usr/include/sys/ipc.h
@@ -0,0 +1,59 @@
+/* Copyright (C) 1995,1996,1997,1999,2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_IPC_H
+#define _SYS_IPC_H 1
+
+#include <features.h>
+
+#if !defined __USE_SVID && !defined __USE_XOPEN && __GNUC__ >= 2
+# warning "Files using this header must be compiled with _SVID_SOURCE or _XOPEN_SOURCE"
+#endif
+
+/* Get system dependent definition of `struct ipc_perm' and more. */
+#include <bits/ipctypes.h>
+#include <bits/ipc.h>
+
+#ifndef __uid_t_defined
+typedef __uid_t uid_t;
+# define __uid_t_defined
+#endif
+
+#ifndef __gid_t_defined
+typedef __gid_t gid_t;
+# define __gid_t_defined
+#endif
+
+#ifndef __mode_t_defined
+typedef __mode_t mode_t;
+# define __mode_t_defined
+#endif
+
+#ifndef __key_t_defined
+typedef __key_t key_t;
+# define __key_t_defined
+#endif
+
+__BEGIN_DECLS
+
+/* Generates key for System V style IPC. */
+extern key_t ftok (__const char *__pathname, int __proj_id) __THROW;
+
+__END_DECLS
+
+#endif /* sys/ipc.h */
diff --git a/sysroot/usr/include/sys/kd.h b/sysroot/usr/include/sys/kd.h
new file mode 100644
index 0000000..d459c07
--- /dev/null
+++ b/sysroot/usr/include/sys/kd.h
@@ -0,0 +1,35 @@
+/* Copyright (C) 1996, 1997, 2005 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_KD_H
+#define _SYS_KD_H 1
+
+/* Make sure the <linux/types.h> header is not loaded. */
+#ifndef _LINUX_TYPES_H
+# define _LINUX_TYPES_H 1
+# define __undef_LINUX_TYPES_H
+#endif
+
+#include <linux/kd.h>
+
+#ifdef __undef_LINUX_TYPES_H
+# undef _LINUX_TYPES_H
+# undef __undef_LINUX_TYPES_H
+#endif
+
+#endif /* sys/kd.h */
diff --git a/sysroot/usr/include/sys/kdaemon.h b/sysroot/usr/include/sys/kdaemon.h
new file mode 100644
index 0000000..61491f9
--- /dev/null
+++ b/sysroot/usr/include/sys/kdaemon.h
@@ -0,0 +1,33 @@
+/* Copyright (C) 1996, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Interfaces to control the various kernel daemons. */
+
+#ifndef _SYS_KDAEMON_H
+
+#define _SYS_KDAEMON_H 1
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Start, flush, or tune the kernel's buffer flushing daemon. */
+extern int bdflush (int __func, long int __data) __THROW;
+
+__END_DECLS
+
+#endif /* _SYS_KDAEMON_H */
diff --git a/sysroot/usr/include/sys/klog.h b/sysroot/usr/include/sys/klog.h
new file mode 100644
index 0000000..35f5fe4
--- /dev/null
+++ b/sysroot/usr/include/sys/klog.h
@@ -0,0 +1,34 @@
+/* Copyright (C) 1996, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_KLOG_H
+
+#define _SYS_KLOG_H 1
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Control the kernel's logging facility. This corresponds exactly to
+ the kernel's syslog system call, but that name is easily confused
+ with the user-level syslog facility, which is something completely
+ different. */
+extern int klogctl (int __type, char *__bufp, int __len) __THROW;
+
+__END_DECLS
+
+#endif /* _SYS_KLOG_H */
diff --git a/sysroot/usr/include/sys/mman.h b/sysroot/usr/include/sys/mman.h
new file mode 100644
index 0000000..4cd8a3f
--- /dev/null
+++ b/sysroot/usr/include/sys/mman.h
@@ -0,0 +1,152 @@
+/* Definitions for BSD-style memory management.
+ Copyright (C) 1994-2000, 2003, 2004, 2005 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_MMAN_H
+#define _SYS_MMAN_H 1
+
+#include <features.h>
+#include <bits/types.h>
+#define __need_size_t
+#include <stddef.h>
+
+#ifndef __off_t_defined
+# ifndef __USE_FILE_OFFSET64
+typedef __off_t off_t;
+# else
+typedef __off64_t off_t;
+# endif
+# define __off_t_defined
+#endif
+
+#ifndef __mode_t_defined
+typedef __mode_t mode_t;
+# define __mode_t_defined
+#endif
+
+#include <bits/mman.h>
+
+/* Return value of `mmap' in case of an error. */
+#define MAP_FAILED ((void *) -1)
+
+__BEGIN_DECLS
+/* Map addresses starting near ADDR and extending for LEN bytes. from
+ OFFSET into the file FD describes according to PROT and FLAGS. If ADDR
+ is nonzero, it is the desired mapping address. If the MAP_FIXED bit is
+ set in FLAGS, the mapping will be at ADDR exactly (which must be
+ page-aligned); otherwise the system chooses a convenient nearby address.
+ The return value is the actual mapping address chosen or MAP_FAILED
+ for errors (in which case `errno' is set). A successful `mmap' call
+ deallocates any previous mapping for the affected region. */
+
+#ifndef __USE_FILE_OFFSET64
+extern void *mmap (void *__addr, size_t __len, int __prot,
+ int __flags, int __fd, __off_t __offset) __THROW;
+#else
+# ifdef __REDIRECT_NTH
+extern void * __REDIRECT_NTH (mmap,
+ (void *__addr, size_t __len, int __prot,
+ int __flags, int __fd, __off64_t __offset),
+ mmap64);
+# else
+# define mmap mmap64
+# endif
+#endif
+#ifdef __USE_LARGEFILE64
+extern void *mmap64 (void *__addr, size_t __len, int __prot,
+ int __flags, int __fd, __off64_t __offset) __THROW;
+#endif
+
+/* Deallocate any mapping for the region starting at ADDR and extending LEN
+ bytes. Returns 0 if successful, -1 for errors (and sets errno). */
+extern int munmap (void *__addr, size_t __len) __THROW;
+
+/* Change the memory protection of the region starting at ADDR and
+ extending LEN bytes to PROT. Returns 0 if successful, -1 for errors
+ (and sets errno). */
+extern int mprotect (void *__addr, size_t __len, int __prot) __THROW;
+
+/* Synchronize the region starting at ADDR and extending LEN bytes with the
+ file it maps. Filesystem operations on a file being mapped are
+ unpredictable before this is done. Flags are from the MS_* set.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int msync (void *__addr, size_t __len, int __flags);
+
+#ifdef __USE_BSD
+/* Advise the system about particular usage patterns the program follows
+ for the region starting at ADDR and extending LEN bytes. */
+extern int madvise (void *__addr, size_t __len, int __advice) __THROW;
+#endif
+#ifdef __USE_XOPEN2K
+/* This is the POSIX name for this function. */
+extern int posix_madvise (void *__addr, size_t __len, int __advice) __THROW;
+#endif
+
+/* Guarantee all whole pages mapped by the range [ADDR,ADDR+LEN) to
+ be memory resident. */
+extern int mlock (__const void *__addr, size_t __len) __THROW;
+
+/* Unlock whole pages previously mapped by the range [ADDR,ADDR+LEN). */
+extern int munlock (__const void *__addr, size_t __len) __THROW;
+
+/* Cause all currently mapped pages of the process to be memory resident
+ until unlocked by a call to the `munlockall', until the process exits,
+ or until the process calls `execve'. */
+extern int mlockall (int __flags) __THROW;
+
+/* All currently mapped pages of the process' address space become
+ unlocked. */
+extern int munlockall (void) __THROW;
+
+#ifdef __USE_MISC
+/* mincore returns the memory residency status of the pages in the
+ current process's address space specified by [start, start + len).
+ The status is returned in a vector of bytes. The least significant
+ bit of each byte is 1 if the referenced page is in memory, otherwise
+ it is zero. */
+extern int mincore (void *__start, size_t __len, unsigned char *__vec)
+ __THROW;
+#endif
+
+#ifdef __USE_GNU
+/* Remap pages mapped by the range [ADDR,ADDR+OLD_LEN) to new length
+ NEW_LEN. If MREMAP_MAYMOVE is set in FLAGS the returned address
+ may differ from ADDR. If MREMAP_FIXED is set in FLAGS the function
+ takes another paramter which is a fixed address at which the block
+ resides after a successful call. */
+extern void *mremap (void *__addr, size_t __old_len, size_t __new_len,
+ int __flags, ...) __THROW;
+
+/* Remap arbitrary pages of a shared backing store within an existing
+ VMA. */
+extern int remap_file_pages (void *__start, size_t __size, int __prot,
+ size_t __pgoff, int __flags) __THROW;
+#endif
+
+
+/* Open shared memory segment. */
+extern int shm_open (__const char *__name, int __oflag, mode_t __mode);
+
+/* Remove shared memory segment. */
+extern int shm_unlink (__const char *__name);
+
+__END_DECLS
+
+#endif /* sys/mman.h */
diff --git a/sysroot/usr/include/sys/mount.h b/sysroot/usr/include/sys/mount.h
new file mode 100644
index 0000000..b305549
--- /dev/null
+++ b/sysroot/usr/include/sys/mount.h
@@ -0,0 +1,119 @@
+/* Header file for mounting/unmount Linux filesystems.
+ Copyright (C) 1996,1997,1998,1999,2000,2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* This is taken from /usr/include/linux/fs.h. */
+
+#ifndef _SYS_MOUNT_H
+#define _SYS_MOUNT_H 1
+
+#include <features.h>
+#include <sys/ioctl.h>
+
+#define BLOCK_SIZE 1024
+#define BLOCK_SIZE_BITS 10
+
+
+/* These are the fs-independent mount-flags: up to 16 flags are
+ supported */
+enum
+{
+ MS_RDONLY = 1, /* Mount read-only. */
+#define MS_RDONLY MS_RDONLY
+ MS_NOSUID = 2, /* Ignore suid and sgid bits. */
+#define MS_NOSUID MS_NOSUID
+ MS_NODEV = 4, /* Disallow access to device special files. */
+#define MS_NODEV MS_NODEV
+ MS_NOEXEC = 8, /* Disallow program execution. */
+#define MS_NOEXEC MS_NOEXEC
+ MS_SYNCHRONOUS = 16, /* Writes are synced at once. */
+#define MS_SYNCHRONOUS MS_SYNCHRONOUS
+ MS_REMOUNT = 32, /* Alter flags of a mounted FS. */
+#define MS_REMOUNT MS_REMOUNT
+ MS_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
+#define MS_MANDLOCK MS_MANDLOCK
+ S_WRITE = 128, /* Write on file/directory/symlink. */
+#define S_WRITE S_WRITE
+ S_APPEND = 256, /* Append-only file. */
+#define S_APPEND S_APPEND
+ S_IMMUTABLE = 512, /* Immutable file. */
+#define S_IMMUTABLE S_IMMUTABLE
+ MS_NOATIME = 1024, /* Do not update access times. */
+#define MS_NOATIME MS_NOATIME
+ MS_NODIRATIME = 2048, /* Do not update directory access times. */
+#define MS_NODIRATIME MS_NODIRATIME
+ MS_BIND = 4096, /* Bind directory at different place. */
+#define MS_BIND MS_BIND
+};
+
+/* Flags that can be altered by MS_REMOUNT */
+#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME \
+ |MS_NODIRATIME)
+
+
+/* Magic mount flag number. Has to be or-ed to the flag values. */
+
+#define MS_MGC_VAL 0xc0ed0000 /* Magic flag number to indicate "new" flags */
+#define MS_MGC_MSK 0xffff0000 /* Magic flag number mask */
+
+
+/* The read-only stuff doesn't really belong here, but any other place
+ is probably as bad and I don't want to create yet another include
+ file. */
+
+#define BLKROSET _IO(0x12, 93) /* Set device read-only (0 = read-write). */
+#define BLKROGET _IO(0x12, 94) /* Get read-only status (0 = read_write). */
+#define BLKRRPART _IO(0x12, 95) /* Re-read partition table. */
+#define BLKGETSIZE _IO(0x12, 96) /* Return device size. */
+#define BLKFLSBUF _IO(0x12, 97) /* Flush buffer cache. */
+#define BLKRASET _IO(0x12, 98) /* Set read ahead for block device. */
+#define BLKRAGET _IO(0x12, 99) /* Get current read ahead setting. */
+#define BLKFRASET _IO(0x12,100) /* Set filesystem read-ahead. */
+#define BLKFRAGET _IO(0x12,101) /* Get filesystem read-ahead. */
+#define BLKSECTSET _IO(0x12,102) /* Set max sectors per request. */
+#define BLKSECTGET _IO(0x12,103) /* Get max sectors per request. */
+#define BLKSSZGET _IO(0x12,104) /* Get block device sector size. */
+#define BLKBSZGET _IOR(0x12,112,size_t)
+#define BLKBSZSET _IOW(0x12,113,size_t)
+#define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size. */
+
+
+/* Possible value for FLAGS parameter of `umount2'. */
+enum
+{
+ MNT_FORCE = 1 /* Force unmounting. */
+#define MNT_FORCE MNT_FORCE
+};
+
+
+__BEGIN_DECLS
+
+/* Mount a filesystem. */
+extern int mount (__const char *__special_file, __const char *__dir,
+ __const char *__fstype, unsigned long int __rwflag,
+ __const void *__data) __THROW;
+
+/* Unmount a filesystem. */
+extern int umount (__const char *__special_file) __THROW;
+
+/* Unmount a filesystem. Force unmounting if FLAGS is set to MNT_FORCE. */
+extern int umount2 (__const char *__special_file, int __flags) __THROW;
+
+__END_DECLS
+
+#endif /* _SYS_MOUNT_H */
diff --git a/sysroot/usr/include/sys/msg.h b/sysroot/usr/include/sys/msg.h
new file mode 100644
index 0000000..cdc96be
--- /dev/null
+++ b/sysroot/usr/include/sys/msg.h
@@ -0,0 +1,85 @@
+/* Copyright (C) 1995-1997,1999,2000,2003,2006,2007
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_MSG_H
+#define _SYS_MSG_H
+
+#include <features.h>
+
+#define __need_size_t
+#include <stddef.h>
+
+/* Get common definition of System V style IPC. */
+#include <sys/ipc.h>
+
+/* Get system dependent definition of `struct msqid_ds' and more. */
+#include <bits/msq.h>
+
+/* Define types required by the standard. */
+#define __need_time_t
+#include <time.h>
+
+#ifndef __pid_t_defined
+typedef __pid_t pid_t;
+# define __pid_t_defined
+#endif
+
+#ifndef __ssize_t_defined
+typedef __ssize_t ssize_t;
+# define __ssize_t_defined
+#endif
+
+/* The following System V style IPC functions implement a message queue
+ system. The definition is found in XPG2. */
+
+#ifdef __USE_GNU
+/* Template for struct to be used as argument for `msgsnd' and `msgrcv'. */
+struct msgbuf
+ {
+ long int mtype; /* type of received/sent message */
+ char mtext[1]; /* text of the message */
+ };
+#endif
+
+
+__BEGIN_DECLS
+
+/* Message queue control operation. */
+extern int msgctl (int __msqid, int __cmd, struct msqid_ds *__buf) __THROW;
+
+/* Get messages queue. */
+extern int msgget (key_t __key, int __msgflg) __THROW;
+
+/* Receive message from message queue.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern ssize_t msgrcv (int __msqid, void *__msgp, size_t __msgsz,
+ long int __msgtyp, int __msgflg);
+
+/* Send message to message queue.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int msgsnd (int __msqid, __const void *__msgp, size_t __msgsz,
+ int __msgflg);
+
+__END_DECLS
+
+#endif /* sys/msg.h */
diff --git a/sysroot/usr/include/sys/mtio.h b/sysroot/usr/include/sys/mtio.h
new file mode 100644
index 0000000..51fa550
--- /dev/null
+++ b/sysroot/usr/include/sys/mtio.h
@@ -0,0 +1,277 @@
+/* Structures and definitions for magnetic tape I/O control commands.
+ Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Written by H. Bergman <hennus@cybercomm.nl>. */
+
+#ifndef _SYS_MTIO_H
+#define _SYS_MTIO_H 1
+
+/* Get necessary definitions from system and kernel headers. */
+#include <sys/types.h>
+#include <sys/ioctl.h>
+
+
+/* Structure for MTIOCTOP - magnetic tape operation command. */
+struct mtop
+ {
+ short int mt_op; /* Operations defined below. */
+ int mt_count; /* How many of them. */
+ };
+#define _IOT_mtop /* Hurd ioctl type field. */ \
+ _IOT (_IOTS (short), 1, _IOTS (int), 1, 0, 0)
+
+/* Magnetic Tape operations [Not all operations supported by all drivers]. */
+#define MTRESET 0 /* +reset drive in case of problems. */
+#define MTFSF 1 /* Forward space over FileMark,
+ * position at first record of next file. */
+#define MTBSF 2 /* Backward space FileMark (position before FM). */
+#define MTFSR 3 /* Forward space record. */
+#define MTBSR 4 /* Backward space record. */
+#define MTWEOF 5 /* Write an end-of-file record (mark). */
+#define MTREW 6 /* Rewind. */
+#define MTOFFL 7 /* Rewind and put the drive offline (eject?). */
+#define MTNOP 8 /* No op, set status only (read with MTIOCGET). */
+#define MTRETEN 9 /* Retension tape. */
+#define MTBSFM 10 /* +backward space FileMark, position at FM. */
+#define MTFSFM 11 /* +forward space FileMark, position at FM. */
+#define MTEOM 12 /* Goto end of recorded media (for appending files).
+ MTEOM positions after the last FM, ready for
+ appending another file. */
+#define MTERASE 13 /* Erase tape -- be careful! */
+
+#define MTRAS1 14 /* Run self test 1 (nondestructive). */
+#define MTRAS2 15 /* Run self test 2 (destructive). */
+#define MTRAS3 16 /* Reserved for self test 3. */
+
+#define MTSETBLK 20 /* Set block length (SCSI). */
+#define MTSETDENSITY 21 /* Set tape density (SCSI). */
+#define MTSEEK 22 /* Seek to block (Tandberg, etc.). */
+#define MTTELL 23 /* Tell block (Tandberg, etc.). */
+#define MTSETDRVBUFFER 24 /* Set the drive buffering according to SCSI-2.
+ Ordinary buffered operation with code 1. */
+#define MTFSS 25 /* Space forward over setmarks. */
+#define MTBSS 26 /* Space backward over setmarks. */
+#define MTWSM 27 /* Write setmarks. */
+
+#define MTLOCK 28 /* Lock the drive door. */
+#define MTUNLOCK 29 /* Unlock the drive door. */
+#define MTLOAD 30 /* Execute the SCSI load command. */
+#define MTUNLOAD 31 /* Execute the SCSI unload command. */
+#define MTCOMPRESSION 32/* Control compression with SCSI mode page 15. */
+#define MTSETPART 33 /* Change the active tape partition. */
+#define MTMKPART 34 /* Format the tape with one or two partitions. */
+
+/* structure for MTIOCGET - mag tape get status command */
+
+struct mtget
+ {
+ long int mt_type; /* Type of magtape device. */
+ long int mt_resid; /* Residual count: (not sure)
+ number of bytes ignored, or
+ number of files not skipped, or
+ number of records not skipped. */
+ /* The following registers are device dependent. */
+ long int mt_dsreg; /* Status register. */
+ long int mt_gstat; /* Generic (device independent) status. */
+ long int mt_erreg; /* Error register. */
+ /* The next two fields are not always used. */
+ __daddr_t mt_fileno; /* Number of current file on tape. */
+ __daddr_t mt_blkno; /* Current block number. */
+ };
+#define _IOT_mtget /* Hurd ioctl type field. */ \
+ _IOT (_IOTS (long), 7, 0, 0, 0, 0)
+
+
+/* Constants for mt_type. Not all of these are supported, and
+ these are not all of the ones that are supported. */
+#define MT_ISUNKNOWN 0x01
+#define MT_ISQIC02 0x02 /* Generic QIC-02 tape streamer. */
+#define MT_ISWT5150 0x03 /* Wangtek 5150EQ, QIC-150, QIC-02. */
+#define MT_ISARCHIVE_5945L2 0x04 /* Archive 5945L-2, QIC-24, QIC-02?. */
+#define MT_ISCMSJ500 0x05 /* CMS Jumbo 500 (QIC-02?). */
+#define MT_ISTDC3610 0x06 /* Tandberg 6310, QIC-24. */
+#define MT_ISARCHIVE_VP60I 0x07 /* Archive VP60i, QIC-02. */
+#define MT_ISARCHIVE_2150L 0x08 /* Archive Viper 2150L. */
+#define MT_ISARCHIVE_2060L 0x09 /* Archive Viper 2060L. */
+#define MT_ISARCHIVESC499 0x0A /* Archive SC-499 QIC-36 controller. */
+#define MT_ISQIC02_ALL_FEATURES 0x0F /* Generic QIC-02 with all features. */
+#define MT_ISWT5099EEN24 0x11 /* Wangtek 5099-een24, 60MB, QIC-24. */
+#define MT_ISTEAC_MT2ST 0x12 /* Teac MT-2ST 155mb drive,
+ Teac DC-1 card (Wangtek type). */
+#define MT_ISEVEREX_FT40A 0x32 /* Everex FT40A (QIC-40). */
+#define MT_ISDDS1 0x51 /* DDS device without partitions. */
+#define MT_ISDDS2 0x52 /* DDS device with partitions. */
+#define MT_ISSCSI1 0x71 /* Generic ANSI SCSI-1 tape unit. */
+#define MT_ISSCSI2 0x72 /* Generic ANSI SCSI-2 tape unit. */
+
+/* QIC-40/80/3010/3020 ftape supported drives.
+ 20bit vendor ID + 0x800000 (see vendors.h in ftape distribution). */
+#define MT_ISFTAPE_UNKNOWN 0x800000 /* obsolete */
+#define MT_ISFTAPE_FLAG 0x800000
+
+struct mt_tape_info
+ {
+ long int t_type; /* Device type id (mt_type). */
+ char *t_name; /* Descriptive name. */
+ };
+
+#define MT_TAPE_INFO \
+ { \
+ {MT_ISUNKNOWN, "Unknown type of tape device"}, \
+ {MT_ISQIC02, "Generic QIC-02 tape streamer"}, \
+ {MT_ISWT5150, "Wangtek 5150, QIC-150"}, \
+ {MT_ISARCHIVE_5945L2, "Archive 5945L-2"}, \
+ {MT_ISCMSJ500, "CMS Jumbo 500"}, \
+ {MT_ISTDC3610, "Tandberg TDC 3610, QIC-24"}, \
+ {MT_ISARCHIVE_VP60I, "Archive VP60i, QIC-02"}, \
+ {MT_ISARCHIVE_2150L, "Archive Viper 2150L"}, \
+ {MT_ISARCHIVE_2060L, "Archive Viper 2060L"}, \
+ {MT_ISARCHIVESC499, "Archive SC-499 QIC-36 controller"}, \
+ {MT_ISQIC02_ALL_FEATURES, "Generic QIC-02 tape, all features"}, \
+ {MT_ISWT5099EEN24, "Wangtek 5099-een24, 60MB"}, \
+ {MT_ISTEAC_MT2ST, "Teac MT-2ST 155mb data cassette drive"}, \
+ {MT_ISEVEREX_FT40A, "Everex FT40A, QIC-40"}, \
+ {MT_ISSCSI1, "Generic SCSI-1 tape"}, \
+ {MT_ISSCSI2, "Generic SCSI-2 tape"}, \
+ {0, NULL} \
+ }
+
+
+/* Structure for MTIOCPOS - mag tape get position command. */
+
+struct mtpos
+ {
+ long int mt_blkno; /* Current block number. */
+ };
+#define _IOT_mtpos /* Hurd ioctl type field. */ \
+ _IOT_SIMPLE (long)
+
+
+/* Structure for MTIOCGETCONFIG/MTIOCSETCONFIG primarily intended
+ as an interim solution for QIC-02 until DDI is fully implemented. */
+struct mtconfiginfo
+ {
+ long int mt_type; /* Drive type. */
+ long int ifc_type; /* Interface card type. */
+ unsigned short int irqnr; /* IRQ number to use. */
+ unsigned short int dmanr; /* DMA channel to use. */
+ unsigned short int port; /* IO port base address. */
+
+ unsigned long int debug; /* Debugging flags. */
+
+ unsigned have_dens:1;
+ unsigned have_bsf:1;
+ unsigned have_fsr:1;
+ unsigned have_bsr:1;
+ unsigned have_eod:1;
+ unsigned have_seek:1;
+ unsigned have_tell:1;
+ unsigned have_ras1:1;
+ unsigned have_ras2:1;
+ unsigned have_ras3:1;
+ unsigned have_qfa:1;
+
+ unsigned pad1:5;
+ char reserved[10];
+ };
+#define _IOT_mtconfiginfo /* Hurd ioctl type field. */ \
+ _IOT (_IOTS (long), 2, _IOTS (short), 3, _IOTS (long), 1) /* XXX wrong */
+
+
+/* Magnetic tape I/O control commands. */
+#define MTIOCTOP _IOW('m', 1, struct mtop) /* Do a mag tape op. */
+#define MTIOCGET _IOR('m', 2, struct mtget) /* Get tape status. */
+#define MTIOCPOS _IOR('m', 3, struct mtpos) /* Get tape position.*/
+
+/* The next two are used by the QIC-02 driver for runtime reconfiguration.
+ See tpqic02.h for struct mtconfiginfo. */
+#define MTIOCGETCONFIG _IOR('m', 4, struct mtconfiginfo) /* Get tape config.*/
+#define MTIOCSETCONFIG _IOW('m', 5, struct mtconfiginfo) /* Set tape config.*/
+
+/* Generic Mag Tape (device independent) status macros for examining
+ mt_gstat -- HP-UX compatible.
+ There is room for more generic status bits here, but I don't
+ know which of them are reserved. At least three or so should
+ be added to make this really useful. */
+#define GMT_EOF(x) ((x) & 0x80000000)
+#define GMT_BOT(x) ((x) & 0x40000000)
+#define GMT_EOT(x) ((x) & 0x20000000)
+#define GMT_SM(x) ((x) & 0x10000000) /* DDS setmark */
+#define GMT_EOD(x) ((x) & 0x08000000) /* DDS EOD */
+#define GMT_WR_PROT(x) ((x) & 0x04000000)
+/* #define GMT_ ? ((x) & 0x02000000) */
+#define GMT_ONLINE(x) ((x) & 0x01000000)
+#define GMT_D_6250(x) ((x) & 0x00800000)
+#define GMT_D_1600(x) ((x) & 0x00400000)
+#define GMT_D_800(x) ((x) & 0x00200000)
+/* #define GMT_ ? ((x) & 0x00100000) */
+/* #define GMT_ ? ((x) & 0x00080000) */
+#define GMT_DR_OPEN(x) ((x) & 0x00040000) /* Door open (no tape). */
+/* #define GMT_ ? ((x) & 0x00020000) */
+#define GMT_IM_REP_EN(x) ((x) & 0x00010000) /* Immediate report mode.*/
+/* 16 generic status bits unused. */
+
+
+/* SCSI-tape specific definitions. Bitfield shifts in the status */
+#define MT_ST_BLKSIZE_SHIFT 0
+#define MT_ST_BLKSIZE_MASK 0xffffff
+#define MT_ST_DENSITY_SHIFT 24
+#define MT_ST_DENSITY_MASK 0xff000000
+
+#define MT_ST_SOFTERR_SHIFT 0
+#define MT_ST_SOFTERR_MASK 0xffff
+
+/* Bitfields for the MTSETDRVBUFFER ioctl. */
+#define MT_ST_OPTIONS 0xf0000000
+#define MT_ST_BOOLEANS 0x10000000
+#define MT_ST_SETBOOLEANS 0x30000000
+#define MT_ST_CLEARBOOLEANS 0x40000000
+#define MT_ST_WRITE_THRESHOLD 0x20000000
+#define MT_ST_DEF_BLKSIZE 0x50000000
+#define MT_ST_DEF_OPTIONS 0x60000000
+
+#define MT_ST_BUFFER_WRITES 0x1
+#define MT_ST_ASYNC_WRITES 0x2
+#define MT_ST_READ_AHEAD 0x4
+#define MT_ST_DEBUGGING 0x8
+#define MT_ST_TWO_FM 0x10
+#define MT_ST_FAST_MTEOM 0x20
+#define MT_ST_AUTO_LOCK 0x40
+#define MT_ST_DEF_WRITES 0x80
+#define MT_ST_CAN_BSR 0x100
+#define MT_ST_NO_BLKLIMS 0x200
+#define MT_ST_CAN_PARTITIONS 0x400
+#define MT_ST_SCSI2LOGICAL 0x800
+
+/* The mode parameters to be controlled. Parameter chosen with bits 20-28. */
+#define MT_ST_CLEAR_DEFAULT 0xfffff
+#define MT_ST_DEF_DENSITY (MT_ST_DEF_OPTIONS | 0x100000)
+#define MT_ST_DEF_COMPRESSION (MT_ST_DEF_OPTIONS | 0x200000)
+#define MT_ST_DEF_DRVBUFFER (MT_ST_DEF_OPTIONS | 0x300000)
+
+/* The offset for the arguments for the special HP changer load command. */
+#define MT_ST_HPLOADER_OFFSET 10000
+
+
+/* Specify default tape device. */
+#ifndef DEFTAPE
+# define DEFTAPE "/dev/tape"
+#endif
+
+#endif /* mtio.h */
diff --git a/sysroot/usr/include/sys/param.h b/sysroot/usr/include/sys/param.h
new file mode 100644
index 0000000..0b0424e
--- /dev/null
+++ b/sysroot/usr/include/sys/param.h
@@ -0,0 +1,72 @@
+/* Copyright (C) 1995,1996,1997,2000,2001,2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_PARAM_H
+#define _SYS_PARAM_H 1
+
+#include <limits.h>
+#include <linux/limits.h>
+#include <linux/param.h>
+
+/* BSD names for some <limits.h> values. */
+
+#define NBBY CHAR_BIT
+#ifndef NGROUPS
+# define NGROUPS NGROUPS_MAX
+#endif
+#define MAXSYMLINKS 20
+#define CANBSIZ MAX_CANON
+#define NCARGS ARG_MAX
+#define MAXPATHLEN PATH_MAX
+/* The following is not really correct but it is a value we used for a
+ long time and which seems to be usable. People should not use NOFILE
+ anyway. */
+#define NOFILE 256
+
+
+#include <sys/types.h>
+
+/* Bit map related macros. */
+#define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
+#define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
+#define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
+#define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
+
+/* Macros for counting and rounding. */
+#ifndef howmany
+# define howmany(x, y) (((x) + ((y) - 1)) / (y))
+#endif
+#ifdef __GNUC__
+# define roundup(x, y) (__builtin_constant_p (y) && powerof2 (y) \
+ ? (((x) + (y) - 1) & ~((y) - 1)) \
+ : ((((x) + ((y) - 1)) / (y)) * (y)))
+#else
+# define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
+#endif
+#define powerof2(x) ((((x) - 1) & (x)) == 0)
+
+/* Macros for min/max. */
+#define MIN(a,b) (((a)<(b))?(a):(b))
+#define MAX(a,b) (((a)>(b))?(a):(b))
+
+
+/* Unit of `st_blocks'. */
+#define DEV_BSIZE 512
+
+
+#endif /* sys/param.h */
diff --git a/sysroot/usr/include/sys/pci.h b/sysroot/usr/include/sys/pci.h
new file mode 100644
index 0000000..fb26269
--- /dev/null
+++ b/sysroot/usr/include/sys/pci.h
@@ -0,0 +1,25 @@
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_PCI_H
+#define _SYS_PCI_H 1
+
+/* We use the constants from the kernel. */
+#include <linux/pci.h>
+
+#endif /* sys/pci.h */
diff --git a/sysroot/usr/include/sys/perm.h b/sysroot/usr/include/sys/perm.h
new file mode 100644
index 0000000..382fa92
--- /dev/null
+++ b/sysroot/usr/include/sys/perm.h
@@ -0,0 +1,36 @@
+/* Copyright (C) 1996, 1999, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_PERM_H
+
+#define _SYS_PERM_H 1
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Set port input/output permissions. */
+extern int ioperm (unsigned long int __from, unsigned long int __num,
+ int __turn_on) __THROW;
+
+
+/* Change I/O privilege level. */
+extern int iopl (int __level) __THROW;
+
+__END_DECLS
+
+#endif /* _SYS_PERM_H */
diff --git a/sysroot/usr/include/sys/personality.h b/sysroot/usr/include/sys/personality.h
new file mode 100644
index 0000000..ff7c61a
--- /dev/null
+++ b/sysroot/usr/include/sys/personality.h
@@ -0,0 +1,76 @@
+/* Copyright (C) 2002, 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Taken verbatim from Linux 2.6 (include/linux/personality.h). */
+
+#ifndef _SYS_PERSONALITY_H
+#define _SYS_PERSONALITY_H 1
+
+#include <features.h>
+
+/* Flags for bug emulation.
+ These occupy the top three bytes. */
+enum
+ {
+ ADDR_NO_RANDOMIZE = 0x0040000,
+ MMAP_PAGE_ZERO = 0x0100000,
+ ADDR_LIMIT_32BIT = 0x0800000,
+ SHORT_INODE = 0x1000000,
+ WHOLE_SECONDS = 0x2000000,
+ STICKY_TIMEOUTS = 0x4000000,
+ ADDR_LIMIT_3GB = 0x8000000
+ };
+
+/* Personality types.
+
+ These go in the low byte. Avoid using the top bit, it will
+ conflict with error returns. */
+enum
+ {
+ PER_LINUX = 0x0000,
+ PER_LINUX_32BIT = 0x0000 | ADDR_LIMIT_32BIT,
+ PER_SVR4 = 0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
+ PER_SVR3 = 0x0002 | STICKY_TIMEOUTS | SHORT_INODE,
+ PER_SCOSVR3 = 0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS | SHORT_INODE,
+ PER_OSR5 = 0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS,
+ PER_WYSEV386 = 0x0004 | STICKY_TIMEOUTS | SHORT_INODE,
+ PER_ISCR4 = 0x0005 | STICKY_TIMEOUTS,
+ PER_BSD = 0x0006,
+ PER_SUNOS = 0x0006 | STICKY_TIMEOUTS,
+ PER_XENIX = 0x0007 | STICKY_TIMEOUTS | SHORT_INODE,
+ PER_LINUX32 = 0x0008,
+ PER_LINUX32_3GB = 0x0008 | ADDR_LIMIT_3GB,
+ PER_IRIX32 = 0x0009 | STICKY_TIMEOUTS, /* IRIX5 32-bit */
+ PER_IRIXN32 = 0x000a | STICKY_TIMEOUTS, /* IRIX6 new 32-bit */
+ PER_IRIX64 = 0x000b | STICKY_TIMEOUTS, /* IRIX6 64-bit */
+ PER_RISCOS = 0x000c,
+ PER_SOLARIS = 0x000d | STICKY_TIMEOUTS,
+ PER_UW7 = 0x000e | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
+ PER_OSF4 = 0x000f,
+ PER_HPUX = 0x0010,
+ PER_MASK = 0x00ff,
+ };
+
+__BEGIN_DECLS
+
+/* Set different ABIs (personalities). */
+extern int personality (unsigned long int __persona) __THROW;
+
+__END_DECLS
+
+#endif /* sys/personality.h */
diff --git a/sysroot/usr/include/sys/poll.h b/sysroot/usr/include/sys/poll.h
new file mode 100644
index 0000000..4085b78
--- /dev/null
+++ b/sysroot/usr/include/sys/poll.h
@@ -0,0 +1,74 @@
+/* Compatibility definitions for System V `poll' interface.
+ Copyright (C) 1994,1996-2001,2004,2005,2006 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_POLL_H
+#define _SYS_POLL_H 1
+
+#include <features.h>
+
+/* Get the platform dependent bits of `poll'. */
+#include <bits/poll.h>
+#ifdef __USE_GNU
+/* Get the __sigset_t definition. */
+# include <bits/sigset.h>
+/* Get the timespec definition. */
+# define __need_timespec
+# include <time.h>
+#endif
+
+
+/* Type used for the number of file descriptors. */
+typedef unsigned long int nfds_t;
+
+/* Data structure describing a polling request. */
+struct pollfd
+ {
+ int fd; /* File descriptor to poll. */
+ short int events; /* Types of events poller cares about. */
+ short int revents; /* Types of events that actually occurred. */
+ };
+
+
+__BEGIN_DECLS
+
+/* Poll the file descriptors described by the NFDS structures starting at
+ FDS. If TIMEOUT is nonzero and not -1, allow TIMEOUT milliseconds for
+ an event to occur; if TIMEOUT is -1, block until an event occurs.
+ Returns the number of file descriptors with events, zero if timed out,
+ or -1 for errors.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int poll (struct pollfd *__fds, nfds_t __nfds, int __timeout);
+
+#ifdef __USE_GNU
+/* Like poll, but before waiting the threads signal mask is replaced
+ with that specified in the fourth parameter. For better usability,
+ the timeout value is specified using a TIMESPEC object.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int ppoll (struct pollfd *__fds, nfds_t __nfds,
+ __const struct timespec *__timeout,
+ __const __sigset_t *__ss);
+#endif
+
+__END_DECLS
+
+#endif /* sys/poll.h */
diff --git a/sysroot/usr/include/sys/prctl.h b/sysroot/usr/include/sys/prctl.h
new file mode 100644
index 0000000..7e9b72d
--- /dev/null
+++ b/sysroot/usr/include/sys/prctl.h
@@ -0,0 +1,32 @@
+/* Copyright (C) 1997, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_PRCTL_H
+#define _SYS_PRCTL_H 1
+
+#include <features.h>
+#include <linux/prctl.h> /* The magic values come from here */
+
+__BEGIN_DECLS
+
+/* Control process execution. */
+extern int prctl (int __option, ...) __THROW;
+
+__END_DECLS
+
+#endif /* sys/prctl.h */
diff --git a/sysroot/usr/include/sys/procfs.h b/sysroot/usr/include/sys/procfs.h
new file mode 100644
index 0000000..853d7db
--- /dev/null
+++ b/sysroot/usr/include/sys/procfs.h
@@ -0,0 +1,142 @@
+/* Copyright (C) 2001, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_PROCFS_H
+#define _SYS_PROCFS_H 1
+
+/* This is somewhat modelled after the file of the same name on SVR4
+ systems. It provides a definition of the core file format for ELF
+ used on Linux. It doesn't have anything to do with the /proc file
+ system, even though Linux has one.
+
+ Anyway, the whole purpose of this file is for GDB and GDB only.
+ Don't read too much into it. Don't use it for anything other than
+ GDB unless you know what you are doing. */
+
+#include <features.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/user.h>
+
+__BEGIN_DECLS
+
+/* Type for a general-purpose register. */
+typedef unsigned long elf_greg_t;
+
+/* And the whole bunch of them. We could have used `struct
+ user_regs_struct' directly in the typedef, but tradition says that
+ the register set is an array, which does have some peculiar
+ semantics, so leave it that way. */
+#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t))
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+#if __WORDSIZE == 32
+/* Register set for the floating-point registers. */
+typedef struct user_fpregs_struct elf_fpregset_t;
+
+/* Register set for the extended floating-point registers. Includes
+ the Pentium III SSE registers in addition to the classic
+ floating-point stuff. */
+typedef struct user_fpxregs_struct elf_fpxregset_t;
+#else
+/* Register set for the extended floating-point registers. Includes
+ the Pentium III SSE registers in addition to the classic
+ floating-point stuff. */
+typedef struct user_fpregs_struct elf_fpregset_t;
+#endif
+
+/* Signal info. */
+struct elf_siginfo
+ {
+ int si_signo; /* Signal number. */
+ int si_code; /* Extra code. */
+ int si_errno; /* Errno. */
+ };
+
+
+/* Definitions to generate Intel SVR4-like core files. These mostly
+ have the same names as the SVR4 types with "elf_" tacked on the
+ front to prevent clashes with Linux definitions, and the typedef
+ forms have been avoided. This is mostly like the SVR4 structure,
+ but more Linuxy, with things that Linux does not support and which
+ GDB doesn't really use excluded. */
+
+struct elf_prstatus
+ {
+ struct elf_siginfo pr_info; /* Info associated with signal. */
+ short int pr_cursig; /* Current signal. */
+ unsigned long int pr_sigpend; /* Set of pending signals. */
+ unsigned long int pr_sighold; /* Set of held signals. */
+ __pid_t pr_pid;
+ __pid_t pr_ppid;
+ __pid_t pr_pgrp;
+ __pid_t pr_sid;
+ struct timeval pr_utime; /* User time. */
+ struct timeval pr_stime; /* System time. */
+ struct timeval pr_cutime; /* Cumulative user time. */
+ struct timeval pr_cstime; /* Cumulative system time. */
+ elf_gregset_t pr_reg; /* GP registers. */
+ int pr_fpvalid; /* True if math copro being used. */
+ };
+
+
+#define ELF_PRARGSZ (80) /* Number of chars for args. */
+
+struct elf_prpsinfo
+ {
+ char pr_state; /* Numeric process state. */
+ char pr_sname; /* Char for pr_state. */
+ char pr_zomb; /* Zombie. */
+ char pr_nice; /* Nice val. */
+ unsigned long int pr_flag; /* Flags. */
+#if __WORDSIZE == 32
+ unsigned short int pr_uid;
+ unsigned short int pr_gid;
+#else
+ unsigned int pr_uid;
+ unsigned int pr_gid;
+#endif
+ int pr_pid, pr_ppid, pr_pgrp, pr_sid;
+ /* Lots missing */
+ char pr_fname[16]; /* Filename of executable. */
+ char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */
+ };
+
+
+/* The rest of this file provides the types for emulation of the
+ Solaris <proc_service.h> interfaces that should be implemented by
+ users of libthread_db. */
+
+/* Addresses. */
+typedef void *psaddr_t;
+
+/* Register sets. Linux has different names. */
+typedef elf_gregset_t prgregset_t;
+typedef elf_fpregset_t prfpregset_t;
+
+/* We don't have any differences between processes and threads,
+ therefore have only one PID type. */
+typedef __pid_t lwpid_t;
+
+/* Process status and info. In the end we do provide typedefs for them. */
+typedef struct elf_prstatus prstatus_t;
+typedef struct elf_prpsinfo prpsinfo_t;
+
+__END_DECLS
+
+#endif /* sys/procfs.h */
diff --git a/sysroot/usr/include/sys/profil.h b/sysroot/usr/include/sys/profil.h
new file mode 100644
index 0000000..9548ec7
--- /dev/null
+++ b/sysroot/usr/include/sys/profil.h
@@ -0,0 +1,61 @@
+/* Copyright (C) 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _PROFIL_H
+#define _PROFIL_H 1
+
+#include <features.h>
+
+#include <sys/time.h>
+#include <sys/types.h>
+
+/* This interface is intended to follow the sprofil() system calls as
+ described by the sprofil(2) man page of Irix v6.5, except that:
+
+ - there is no a priori limit on number of text sections
+ - pr_scale is declared as unsigned long (instead of "unsigned int")
+ - pr_size is declared as size_t (instead of "unsigned int")
+ - pr_off is declared as void * (instead of "__psunsigned_t")
+ - the overflow bin (pr_base==0, pr_scale==2) can appear anywhere
+ in the profp array
+ - PROF_FAST has no effect */
+
+struct prof
+ {
+ void *pr_base; /* buffer base */
+ size_t pr_size; /* buffer size */
+ size_t pr_off; /* pc offset */
+ unsigned long int pr_scale; /* pc scaling (fixed-point number) */
+ };
+
+enum
+ {
+ PROF_USHORT = 0, /* use 16-bit counters (default) */
+ PROF_UINT = 1 << 0, /* use 32-bit counters */
+ PROF_FAST = 1 << 1 /* profile faster than usual */
+ };
+
+
+__BEGIN_DECLS
+
+extern int sprofil (struct prof *__profp, int __profcnt,
+ struct timeval *__tvp, unsigned int __flags) __THROW;
+
+__END_DECLS
+
+#endif /* profil.h */
diff --git a/sysroot/usr/include/sys/ptrace.h b/sysroot/usr/include/sys/ptrace.h
new file mode 100644
index 0000000..08658f9
--- /dev/null
+++ b/sysroot/usr/include/sys/ptrace.h
@@ -0,0 +1,168 @@
+/* `ptrace' debugger support interface. Linux version.
+ Copyright (C) 1996-1999,2000,2006,2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_PTRACE_H
+#define _SYS_PTRACE_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Type of the REQUEST argument to `ptrace.' */
+enum __ptrace_request
+{
+ /* Indicate that the process making this request should be traced.
+ All signals received by this process can be intercepted by its
+ parent, and its parent can use the other `ptrace' requests. */
+ PTRACE_TRACEME = 0,
+#define PT_TRACE_ME PTRACE_TRACEME
+
+ /* Return the word in the process's text space at address ADDR. */
+ PTRACE_PEEKTEXT = 1,
+#define PT_READ_I PTRACE_PEEKTEXT
+
+ /* Return the word in the process's data space at address ADDR. */
+ PTRACE_PEEKDATA = 2,
+#define PT_READ_D PTRACE_PEEKDATA
+
+ /* Return the word in the process's user area at offset ADDR. */
+ PTRACE_PEEKUSER = 3,
+#define PT_READ_U PTRACE_PEEKUSER
+
+ /* Write the word DATA into the process's text space at address ADDR. */
+ PTRACE_POKETEXT = 4,
+#define PT_WRITE_I PTRACE_POKETEXT
+
+ /* Write the word DATA into the process's data space at address ADDR. */
+ PTRACE_POKEDATA = 5,
+#define PT_WRITE_D PTRACE_POKEDATA
+
+ /* Write the word DATA into the process's user area at offset ADDR. */
+ PTRACE_POKEUSER = 6,
+#define PT_WRITE_U PTRACE_POKEUSER
+
+ /* Continue the process. */
+ PTRACE_CONT = 7,
+#define PT_CONTINUE PTRACE_CONT
+
+ /* Kill the process. */
+ PTRACE_KILL = 8,
+#define PT_KILL PTRACE_KILL
+
+ /* Single step the process.
+ This is not supported on all machines. */
+ PTRACE_SINGLESTEP = 9,
+#define PT_STEP PTRACE_SINGLESTEP
+
+ /* Get all general purpose registers used by a processes.
+ This is not supported on all machines. */
+ PTRACE_GETREGS = 12,
+#define PT_GETREGS PTRACE_GETREGS
+
+ /* Set all general purpose registers used by a processes.
+ This is not supported on all machines. */
+ PTRACE_SETREGS = 13,
+#define PT_SETREGS PTRACE_SETREGS
+
+ /* Get all floating point registers used by a processes.
+ This is not supported on all machines. */
+ PTRACE_GETFPREGS = 14,
+#define PT_GETFPREGS PTRACE_GETFPREGS
+
+ /* Set all floating point registers used by a processes.
+ This is not supported on all machines. */
+ PTRACE_SETFPREGS = 15,
+#define PT_SETFPREGS PTRACE_SETFPREGS
+
+ /* Attach to a process that is already running. */
+ PTRACE_ATTACH = 16,
+#define PT_ATTACH PTRACE_ATTACH
+
+ /* Detach from a process attached to with PTRACE_ATTACH. */
+ PTRACE_DETACH = 17,
+#define PT_DETACH PTRACE_DETACH
+
+ /* Get all extended floating point registers used by a processes.
+ This is not supported on all machines. */
+ PTRACE_GETFPXREGS = 18,
+#define PT_GETFPXREGS PTRACE_GETFPXREGS
+
+ /* Set all extended floating point registers used by a processes.
+ This is not supported on all machines. */
+ PTRACE_SETFPXREGS = 19,
+#define PT_SETFPXREGS PTRACE_SETFPXREGS
+
+ /* Continue and stop at the next (return from) syscall. */
+ PTRACE_SYSCALL = 24,
+#define PT_SYSCALL PTRACE_SYSCALL
+
+ /* Set ptrace filter options. */
+ PTRACE_SETOPTIONS = 0x4200,
+#define PT_SETOPTIONS PTRACE_SETOPTIONS
+
+ /* Get last ptrace message. */
+ PTRACE_GETEVENTMSG = 0x4201,
+#define PT_GETEVENTMSG PTRACE_GETEVENTMSG
+
+ /* Get siginfo for process. */
+ PTRACE_GETSIGINFO = 0x4202,
+#define PT_GETSIGINFO PTRACE_GETSIGINFO
+
+ /* Set new siginfo for process. */
+ PTRACE_SETSIGINFO = 0x4203
+#define PT_SETSIGINFO PTRACE_SETSIGINFO
+};
+
+
+/* Options set using PTRACE_SETOPTIONS. */
+enum __ptrace_setoptions {
+ PTRACE_O_TRACESYSGOOD = 0x00000001,
+ PTRACE_O_TRACEFORK = 0x00000002,
+ PTRACE_O_TRACEVFORK = 0x00000004,
+ PTRACE_O_TRACECLONE = 0x00000008,
+ PTRACE_O_TRACEEXEC = 0x00000010,
+ PTRACE_O_TRACEVFORKDONE = 0x00000020,
+ PTRACE_O_TRACEEXIT = 0x00000040,
+ PTRACE_O_MASK = 0x0000007f
+};
+
+/* Wait extended result codes for the above trace options. */
+enum __ptrace_eventcodes {
+ PTRACE_EVENT_FORK = 1,
+ PTRACE_EVENT_VFORK = 2,
+ PTRACE_EVENT_CLONE = 3,
+ PTRACE_EVENT_EXEC = 4,
+ PTRACE_EVENT_VFORK_DONE = 5,
+ PTRACE_EVENT_EXIT = 6
+};
+
+/* Perform process tracing functions. REQUEST is one of the values
+ above, and determines the action to be taken.
+ For all requests except PTRACE_TRACEME, PID specifies the process to be
+ traced.
+
+ PID and the other arguments described above for the various requests should
+ appear (those that are used for the particular request) as:
+ pid_t PID, void *ADDR, int DATA, void *ADDR2
+ after REQUEST. */
+extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
+
+__END_DECLS
+
+#endif /* _SYS_PTRACE_H */
diff --git a/sysroot/usr/include/sys/queue.h b/sysroot/usr/include/sys/queue.h
new file mode 100644
index 0000000..b0e6b38
--- /dev/null
+++ b/sysroot/usr/include/sys/queue.h
@@ -0,0 +1,557 @@
+/*
+ * Copyright (c) 1991, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)queue.h 8.5 (Berkeley) 8/20/94
+ */
+
+#ifndef _SYS_QUEUE_H_
+#define _SYS_QUEUE_H_
+
+/*
+ * This file defines five types of data structures: singly-linked lists,
+ * lists, simple queues, tail queues, and circular queues.
+ *
+ * A singly-linked list is headed by a single forward pointer. The
+ * elements are singly linked for minimum space and pointer manipulation
+ * overhead at the expense of O(n) removal for arbitrary elements. New
+ * elements can be added to the list after an existing element or at the
+ * head of the list. Elements being removed from the head of the list
+ * should use the explicit macro for this purpose for optimum
+ * efficiency. A singly-linked list may only be traversed in the forward
+ * direction. Singly-linked lists are ideal for applications with large
+ * datasets and few or no removals or for implementing a LIFO queue.
+ *
+ * A list is headed by a single forward pointer (or an array of forward
+ * pointers for a hash table header). The elements are doubly linked
+ * so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before
+ * or after an existing element or at the head of the list. A list
+ * may only be traversed in the forward direction.
+ *
+ * A simple queue is headed by a pair of pointers, one the head of the
+ * list and the other to the tail of the list. The elements are singly
+ * linked to save space, so elements can only be removed from the
+ * head of the list. New elements can be added to the list after
+ * an existing element, at the head of the list, or at the end of the
+ * list. A simple queue may only be traversed in the forward direction.
+ *
+ * A tail queue is headed by a pair of pointers, one to the head of the
+ * list and the other to the tail of the list. The elements are doubly
+ * linked so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before or
+ * after an existing element, at the head of the list, or at the end of
+ * the list. A tail queue may be traversed in either direction.
+ *
+ * A circle queue is headed by a pair of pointers, one to the head of the
+ * list and the other to the tail of the list. The elements are doubly
+ * linked so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before or after
+ * an existing element, at the head of the list, or at the end of the list.
+ * A circle queue may be traversed in either direction, but has a more
+ * complex end of list detection.
+ *
+ * For details on the use of these macros, see the queue(3) manual page.
+ */
+
+/*
+ * List definitions.
+ */
+#define LIST_HEAD(name, type) \
+struct name { \
+ struct type *lh_first; /* first element */ \
+}
+
+#define LIST_HEAD_INITIALIZER(head) \
+ { NULL }
+
+#define LIST_ENTRY(type) \
+struct { \
+ struct type *le_next; /* next element */ \
+ struct type **le_prev; /* address of previous next element */ \
+}
+
+/*
+ * List functions.
+ */
+#define LIST_INIT(head) do { \
+ (head)->lh_first = NULL; \
+} while (/*CONSTCOND*/0)
+
+#define LIST_INSERT_AFTER(listelm, elm, field) do { \
+ if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \
+ (listelm)->field.le_next->field.le_prev = \
+ &(elm)->field.le_next; \
+ (listelm)->field.le_next = (elm); \
+ (elm)->field.le_prev = &(listelm)->field.le_next; \
+} while (/*CONSTCOND*/0)
+
+#define LIST_INSERT_BEFORE(listelm, elm, field) do { \
+ (elm)->field.le_prev = (listelm)->field.le_prev; \
+ (elm)->field.le_next = (listelm); \
+ *(listelm)->field.le_prev = (elm); \
+ (listelm)->field.le_prev = &(elm)->field.le_next; \
+} while (/*CONSTCOND*/0)
+
+#define LIST_INSERT_HEAD(head, elm, field) do { \
+ if (((elm)->field.le_next = (head)->lh_first) != NULL) \
+ (head)->lh_first->field.le_prev = &(elm)->field.le_next;\
+ (head)->lh_first = (elm); \
+ (elm)->field.le_prev = &(head)->lh_first; \
+} while (/*CONSTCOND*/0)
+
+#define LIST_REMOVE(elm, field) do { \
+ if ((elm)->field.le_next != NULL) \
+ (elm)->field.le_next->field.le_prev = \
+ (elm)->field.le_prev; \
+ *(elm)->field.le_prev = (elm)->field.le_next; \
+} while (/*CONSTCOND*/0)
+
+#define LIST_FOREACH(var, head, field) \
+ for ((var) = ((head)->lh_first); \
+ (var); \
+ (var) = ((var)->field.le_next))
+
+/*
+ * List access methods.
+ */
+#define LIST_EMPTY(head) ((head)->lh_first == NULL)
+#define LIST_FIRST(head) ((head)->lh_first)
+#define LIST_NEXT(elm, field) ((elm)->field.le_next)
+
+
+/*
+ * Singly-linked List definitions.
+ */
+#define SLIST_HEAD(name, type) \
+struct name { \
+ struct type *slh_first; /* first element */ \
+}
+
+#define SLIST_HEAD_INITIALIZER(head) \
+ { NULL }
+
+#define SLIST_ENTRY(type) \
+struct { \
+ struct type *sle_next; /* next element */ \
+}
+
+/*
+ * Singly-linked List functions.
+ */
+#define SLIST_INIT(head) do { \
+ (head)->slh_first = NULL; \
+} while (/*CONSTCOND*/0)
+
+#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \
+ (elm)->field.sle_next = (slistelm)->field.sle_next; \
+ (slistelm)->field.sle_next = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define SLIST_INSERT_HEAD(head, elm, field) do { \
+ (elm)->field.sle_next = (head)->slh_first; \
+ (head)->slh_first = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define SLIST_REMOVE_HEAD(head, field) do { \
+ (head)->slh_first = (head)->slh_first->field.sle_next; \
+} while (/*CONSTCOND*/0)
+
+#define SLIST_REMOVE(head, elm, type, field) do { \
+ if ((head)->slh_first == (elm)) { \
+ SLIST_REMOVE_HEAD((head), field); \
+ } \
+ else { \
+ struct type *curelm = (head)->slh_first; \
+ while(curelm->field.sle_next != (elm)) \
+ curelm = curelm->field.sle_next; \
+ curelm->field.sle_next = \
+ curelm->field.sle_next->field.sle_next; \
+ } \
+} while (/*CONSTCOND*/0)
+
+#define SLIST_FOREACH(var, head, field) \
+ for((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next)
+
+/*
+ * Singly-linked List access methods.
+ */
+#define SLIST_EMPTY(head) ((head)->slh_first == NULL)
+#define SLIST_FIRST(head) ((head)->slh_first)
+#define SLIST_NEXT(elm, field) ((elm)->field.sle_next)
+
+
+/*
+ * Singly-linked Tail queue declarations.
+ */
+#define STAILQ_HEAD(name, type) \
+struct name { \
+ struct type *stqh_first; /* first element */ \
+ struct type **stqh_last; /* addr of last next element */ \
+}
+
+#define STAILQ_HEAD_INITIALIZER(head) \
+ { NULL, &(head).stqh_first }
+
+#define STAILQ_ENTRY(type) \
+struct { \
+ struct type *stqe_next; /* next element */ \
+}
+
+/*
+ * Singly-linked Tail queue functions.
+ */
+#define STAILQ_INIT(head) do { \
+ (head)->stqh_first = NULL; \
+ (head)->stqh_last = &(head)->stqh_first; \
+} while (/*CONSTCOND*/0)
+
+#define STAILQ_INSERT_HEAD(head, elm, field) do { \
+ if (((elm)->field.stqe_next = (head)->stqh_first) == NULL) \
+ (head)->stqh_last = &(elm)->field.stqe_next; \
+ (head)->stqh_first = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define STAILQ_INSERT_TAIL(head, elm, field) do { \
+ (elm)->field.stqe_next = NULL; \
+ *(head)->stqh_last = (elm); \
+ (head)->stqh_last = &(elm)->field.stqe_next; \
+} while (/*CONSTCOND*/0)
+
+#define STAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
+ if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\
+ (head)->stqh_last = &(elm)->field.stqe_next; \
+ (listelm)->field.stqe_next = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define STAILQ_REMOVE_HEAD(head, field) do { \
+ if (((head)->stqh_first = (head)->stqh_first->field.stqe_next) == NULL) \
+ (head)->stqh_last = &(head)->stqh_first; \
+} while (/*CONSTCOND*/0)
+
+#define STAILQ_REMOVE(head, elm, type, field) do { \
+ if ((head)->stqh_first == (elm)) { \
+ STAILQ_REMOVE_HEAD((head), field); \
+ } else { \
+ struct type *curelm = (head)->stqh_first; \
+ while (curelm->field.stqe_next != (elm)) \
+ curelm = curelm->field.stqe_next; \
+ if ((curelm->field.stqe_next = \
+ curelm->field.stqe_next->field.stqe_next) == NULL) \
+ (head)->stqh_last = &(curelm)->field.stqe_next; \
+ } \
+} while (/*CONSTCOND*/0)
+
+#define STAILQ_FOREACH(var, head, field) \
+ for ((var) = ((head)->stqh_first); \
+ (var); \
+ (var) = ((var)->field.stqe_next))
+
+/*
+ * Singly-linked Tail queue access methods.
+ */
+#define STAILQ_EMPTY(head) ((head)->stqh_first == NULL)
+#define STAILQ_FIRST(head) ((head)->stqh_first)
+#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next)
+
+
+/*
+ * Simple queue definitions.
+ */
+#define SIMPLEQ_HEAD(name, type) \
+struct name { \
+ struct type *sqh_first; /* first element */ \
+ struct type **sqh_last; /* addr of last next element */ \
+}
+
+#define SIMPLEQ_HEAD_INITIALIZER(head) \
+ { NULL, &(head).sqh_first }
+
+#define SIMPLEQ_ENTRY(type) \
+struct { \
+ struct type *sqe_next; /* next element */ \
+}
+
+/*
+ * Simple queue functions.
+ */
+#define SIMPLEQ_INIT(head) do { \
+ (head)->sqh_first = NULL; \
+ (head)->sqh_last = &(head)->sqh_first; \
+} while (/*CONSTCOND*/0)
+
+#define SIMPLEQ_INSERT_HEAD(head, elm, field) do { \
+ if (((elm)->field.sqe_next = (head)->sqh_first) == NULL) \
+ (head)->sqh_last = &(elm)->field.sqe_next; \
+ (head)->sqh_first = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define SIMPLEQ_INSERT_TAIL(head, elm, field) do { \
+ (elm)->field.sqe_next = NULL; \
+ *(head)->sqh_last = (elm); \
+ (head)->sqh_last = &(elm)->field.sqe_next; \
+} while (/*CONSTCOND*/0)
+
+#define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do { \
+ if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\
+ (head)->sqh_last = &(elm)->field.sqe_next; \
+ (listelm)->field.sqe_next = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define SIMPLEQ_REMOVE_HEAD(head, field) do { \
+ if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL) \
+ (head)->sqh_last = &(head)->sqh_first; \
+} while (/*CONSTCOND*/0)
+
+#define SIMPLEQ_REMOVE(head, elm, type, field) do { \
+ if ((head)->sqh_first == (elm)) { \
+ SIMPLEQ_REMOVE_HEAD((head), field); \
+ } else { \
+ struct type *curelm = (head)->sqh_first; \
+ while (curelm->field.sqe_next != (elm)) \
+ curelm = curelm->field.sqe_next; \
+ if ((curelm->field.sqe_next = \
+ curelm->field.sqe_next->field.sqe_next) == NULL) \
+ (head)->sqh_last = &(curelm)->field.sqe_next; \
+ } \
+} while (/*CONSTCOND*/0)
+
+#define SIMPLEQ_FOREACH(var, head, field) \
+ for ((var) = ((head)->sqh_first); \
+ (var); \
+ (var) = ((var)->field.sqe_next))
+
+/*
+ * Simple queue access methods.
+ */
+#define SIMPLEQ_EMPTY(head) ((head)->sqh_first == NULL)
+#define SIMPLEQ_FIRST(head) ((head)->sqh_first)
+#define SIMPLEQ_NEXT(elm, field) ((elm)->field.sqe_next)
+
+
+/*
+ * Tail queue definitions.
+ */
+#define _TAILQ_HEAD(name, type, qual) \
+struct name { \
+ qual type *tqh_first; /* first element */ \
+ qual type *qual *tqh_last; /* addr of last next element */ \
+}
+#define TAILQ_HEAD(name, type) _TAILQ_HEAD(name, struct type,)
+
+#define TAILQ_HEAD_INITIALIZER(head) \
+ { NULL, &(head).tqh_first }
+
+#define _TAILQ_ENTRY(type, qual) \
+struct { \
+ qual type *tqe_next; /* next element */ \
+ qual type *qual *tqe_prev; /* address of previous next element */\
+}
+#define TAILQ_ENTRY(type) _TAILQ_ENTRY(struct type,)
+
+/*
+ * Tail queue functions.
+ */
+#define TAILQ_INIT(head) do { \
+ (head)->tqh_first = NULL; \
+ (head)->tqh_last = &(head)->tqh_first; \
+} while (/*CONSTCOND*/0)
+
+#define TAILQ_INSERT_HEAD(head, elm, field) do { \
+ if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \
+ (head)->tqh_first->field.tqe_prev = \
+ &(elm)->field.tqe_next; \
+ else \
+ (head)->tqh_last = &(elm)->field.tqe_next; \
+ (head)->tqh_first = (elm); \
+ (elm)->field.tqe_prev = &(head)->tqh_first; \
+} while (/*CONSTCOND*/0)
+
+#define TAILQ_INSERT_TAIL(head, elm, field) do { \
+ (elm)->field.tqe_next = NULL; \
+ (elm)->field.tqe_prev = (head)->tqh_last; \
+ *(head)->tqh_last = (elm); \
+ (head)->tqh_last = &(elm)->field.tqe_next; \
+} while (/*CONSTCOND*/0)
+
+#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
+ if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
+ (elm)->field.tqe_next->field.tqe_prev = \
+ &(elm)->field.tqe_next; \
+ else \
+ (head)->tqh_last = &(elm)->field.tqe_next; \
+ (listelm)->field.tqe_next = (elm); \
+ (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \
+} while (/*CONSTCOND*/0)
+
+#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \
+ (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
+ (elm)->field.tqe_next = (listelm); \
+ *(listelm)->field.tqe_prev = (elm); \
+ (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \
+} while (/*CONSTCOND*/0)
+
+#define TAILQ_REMOVE(head, elm, field) do { \
+ if (((elm)->field.tqe_next) != NULL) \
+ (elm)->field.tqe_next->field.tqe_prev = \
+ (elm)->field.tqe_prev; \
+ else \
+ (head)->tqh_last = (elm)->field.tqe_prev; \
+ *(elm)->field.tqe_prev = (elm)->field.tqe_next; \
+} while (/*CONSTCOND*/0)
+
+#define TAILQ_FOREACH(var, head, field) \
+ for ((var) = ((head)->tqh_first); \
+ (var); \
+ (var) = ((var)->field.tqe_next))
+
+#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \
+ for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last)); \
+ (var); \
+ (var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last)))
+
+/*
+ * Tail queue access methods.
+ */
+#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL)
+#define TAILQ_FIRST(head) ((head)->tqh_first)
+#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
+
+#define TAILQ_LAST(head, headname) \
+ (*(((struct headname *)((head)->tqh_last))->tqh_last))
+#define TAILQ_PREV(elm, headname, field) \
+ (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
+
+
+/*
+ * Circular queue definitions.
+ */
+#define CIRCLEQ_HEAD(name, type) \
+struct name { \
+ struct type *cqh_first; /* first element */ \
+ struct type *cqh_last; /* last element */ \
+}
+
+#define CIRCLEQ_HEAD_INITIALIZER(head) \
+ { (void *)&head, (void *)&head }
+
+#define CIRCLEQ_ENTRY(type) \
+struct { \
+ struct type *cqe_next; /* next element */ \
+ struct type *cqe_prev; /* previous element */ \
+}
+
+/*
+ * Circular queue functions.
+ */
+#define CIRCLEQ_INIT(head) do { \
+ (head)->cqh_first = (void *)(head); \
+ (head)->cqh_last = (void *)(head); \
+} while (/*CONSTCOND*/0)
+
+#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \
+ (elm)->field.cqe_next = (listelm)->field.cqe_next; \
+ (elm)->field.cqe_prev = (listelm); \
+ if ((listelm)->field.cqe_next == (void *)(head)) \
+ (head)->cqh_last = (elm); \
+ else \
+ (listelm)->field.cqe_next->field.cqe_prev = (elm); \
+ (listelm)->field.cqe_next = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \
+ (elm)->field.cqe_next = (listelm); \
+ (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \
+ if ((listelm)->field.cqe_prev == (void *)(head)) \
+ (head)->cqh_first = (elm); \
+ else \
+ (listelm)->field.cqe_prev->field.cqe_next = (elm); \
+ (listelm)->field.cqe_prev = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \
+ (elm)->field.cqe_next = (head)->cqh_first; \
+ (elm)->field.cqe_prev = (void *)(head); \
+ if ((head)->cqh_last == (void *)(head)) \
+ (head)->cqh_last = (elm); \
+ else \
+ (head)->cqh_first->field.cqe_prev = (elm); \
+ (head)->cqh_first = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \
+ (elm)->field.cqe_next = (void *)(head); \
+ (elm)->field.cqe_prev = (head)->cqh_last; \
+ if ((head)->cqh_first == (void *)(head)) \
+ (head)->cqh_first = (elm); \
+ else \
+ (head)->cqh_last->field.cqe_next = (elm); \
+ (head)->cqh_last = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define CIRCLEQ_REMOVE(head, elm, field) do { \
+ if ((elm)->field.cqe_next == (void *)(head)) \
+ (head)->cqh_last = (elm)->field.cqe_prev; \
+ else \
+ (elm)->field.cqe_next->field.cqe_prev = \
+ (elm)->field.cqe_prev; \
+ if ((elm)->field.cqe_prev == (void *)(head)) \
+ (head)->cqh_first = (elm)->field.cqe_next; \
+ else \
+ (elm)->field.cqe_prev->field.cqe_next = \
+ (elm)->field.cqe_next; \
+} while (/*CONSTCOND*/0)
+
+#define CIRCLEQ_FOREACH(var, head, field) \
+ for ((var) = ((head)->cqh_first); \
+ (var) != (const void *)(head); \
+ (var) = ((var)->field.cqe_next))
+
+#define CIRCLEQ_FOREACH_REVERSE(var, head, field) \
+ for ((var) = ((head)->cqh_last); \
+ (var) != (const void *)(head); \
+ (var) = ((var)->field.cqe_prev))
+
+/*
+ * Circular queue access methods.
+ */
+#define CIRCLEQ_EMPTY(head) ((head)->cqh_first == (void *)(head))
+#define CIRCLEQ_FIRST(head) ((head)->cqh_first)
+#define CIRCLEQ_LAST(head) ((head)->cqh_last)
+#define CIRCLEQ_NEXT(elm, field) ((elm)->field.cqe_next)
+#define CIRCLEQ_PREV(elm, field) ((elm)->field.cqe_prev)
+
+#define CIRCLEQ_LOOP_NEXT(head, elm, field) \
+ (((elm)->field.cqe_next == (void *)(head)) \
+ ? ((head)->cqh_first) \
+ : (elm->field.cqe_next))
+#define CIRCLEQ_LOOP_PREV(head, elm, field) \
+ (((elm)->field.cqe_prev == (void *)(head)) \
+ ? ((head)->cqh_last) \
+ : (elm->field.cqe_prev))
+
+#endif /* sys/queue.h */
diff --git a/sysroot/usr/include/sys/quota.h b/sysroot/usr/include/sys/quota.h
new file mode 100644
index 0000000..5aa0ec0
--- /dev/null
+++ b/sysroot/usr/include/sys/quota.h
@@ -0,0 +1,225 @@
+/* This just represents the non-kernel parts of <linux/quota.h>.
+ *
+ * here's the corresponding copyright:
+ * Copyright (c) 1982, 1986 Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Robert Elz at The University of Melbourne.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _SYS_QUOTA_H
+#define _SYS_QUOTA_H 1
+
+#include <features.h>
+#include <sys/types.h>
+
+/*
+ * Select between different incompatible quota versions.
+ * Default to the version used by Linux kernel version 2.4.22
+ * or later. */
+#ifndef _LINUX_QUOTA_VERSION
+# define _LINUX_QUOTA_VERSION 2
+#endif
+
+/*
+ * Convert diskblocks to blocks and the other way around.
+ * currently only to fool the BSD source. :-)
+ */
+#define dbtob(num) ((num) << 10)
+#define btodb(num) ((num) >> 10)
+
+/*
+ * Convert count of filesystem blocks to diskquota blocks, meant
+ * for filesystems where i_blksize != BLOCK_SIZE
+ */
+#define fs_to_dq_blocks(num, blksize) (((num) * (blksize)) / BLOCK_SIZE)
+
+/*
+ * Definitions for disk quotas imposed on the average user
+ * (big brother finally hits Linux).
+ *
+ * The following constants define the amount of time given a user
+ * before the soft limits are treated as hard limits (usually resulting
+ * in an allocation failure). The timer is started when the user crosses
+ * their soft limit, it is reset when they go below their soft limit.
+ */
+#define MAX_IQ_TIME 604800 /* (7*24*60*60) 1 week */
+#define MAX_DQ_TIME 604800 /* (7*24*60*60) 1 week */
+
+#define MAXQUOTAS 2
+#define USRQUOTA 0 /* element used for user quotas */
+#define GRPQUOTA 1 /* element used for group quotas */
+
+/*
+ * Definitions for the default names of the quotas files.
+ */
+#define INITQFNAMES { \
+ "user", /* USRQUOTA */ \
+ "group", /* GRPQUOTA */ \
+ "undefined", \
+};
+
+#define QUOTAFILENAME "quota"
+#define QUOTAGROUP "staff"
+
+#define NR_DQHASH 43 /* Just an arbitrary number any suggestions ? */
+#define NR_DQUOTS 256 /* Number of quotas active at one time */
+
+/*
+ * Command definitions for the 'quotactl' system call.
+ * The commands are broken into a main command defined below
+ * and a subcommand that is used to convey the type of
+ * quota that is being manipulated (see above).
+ */
+#define SUBCMDMASK 0x00ff
+#define SUBCMDSHIFT 8
+#define QCMD(cmd, type) (((cmd) << SUBCMDSHIFT) | ((type) & SUBCMDMASK))
+
+#if _LINUX_QUOTA_VERSION < 2
+# define Q_QUOTAON 0x0100 /* enable quotas */
+# define Q_QUOTAOFF 0x0200 /* disable quotas */
+# define Q_GETQUOTA 0x0300 /* get limits and usage */
+# define Q_SETQUOTA 0x0400 /* set limits and usage */
+# define Q_SETUSE 0x0500 /* set usage */
+# define Q_SYNC 0x0600 /* sync disk copy of a filesystems quotas */
+# define Q_SETQLIM 0x0700 /* set limits */
+# define Q_GETSTATS 0x0800 /* get collected stats */
+# define Q_RSQUASH 0x1000 /* set root_squash option */
+#else
+# define Q_SYNC 0x800001 /* sync disk copy of a filesystems quotas */
+# define Q_QUOTAON 0x800002 /* turn quotas on */
+# define Q_QUOTAOFF 0x800003 /* turn quotas off */
+# define Q_GETFMT 0x800004 /* get quota format used on given filesystem */
+# define Q_GETINFO 0x800005 /* get information about quota files */
+# define Q_SETINFO 0x800006 /* set information about quota files */
+# define Q_GETQUOTA 0x800007 /* get user quota structure */
+# define Q_SETQUOTA 0x800008 /* set user quota structure */
+#endif
+
+/*
+ * The following structure defines the format of the disk quota file
+ * (as it appears on disk) - the file is an array of these structures
+ * indexed by user or group number.
+ */
+#if _LINUX_QUOTA_VERSION < 2
+struct dqblk
+ {
+ u_int32_t dqb_bhardlimit; /* absolute limit on disk blks alloc */
+ u_int32_t dqb_bsoftlimit; /* preferred limit on disk blks */
+ u_int32_t dqb_curblocks; /* current block count */
+ u_int32_t dqb_ihardlimit; /* maximum # allocated inodes */
+ u_int32_t dqb_isoftlimit; /* preferred inode limit */
+ u_int32_t dqb_curinodes; /* current # allocated inodes */
+ time_t dqb_btime; /* time limit for excessive disk use */
+ time_t dqb_itime; /* time limit for excessive files */
+ };
+#else
+
+/* Flags that indicate which fields in dqblk structure are valid. */
+#define QIF_BLIMITS 1
+#define QIF_SPACE 2
+#define QIF_ILIMITS 4
+#define QIF_INODES 8
+#define QIF_BTIME 16
+#define QIF_ITIME 32
+#define QIF_LIMITS (QIF_BLIMITS | QIF_ILIMITS)
+#define QIF_USAGE (QIF_SPACE | QIF_INODES)
+#define QIF_TIMES (QIF_BTIME | QIF_ITIME)
+#define QIF_ALL (QIF_LIMITS | QIF_USAGE | QIF_TIMES)
+
+struct dqblk
+ {
+ u_int64_t dqb_bhardlimit; /* absolute limit on disk quota blocks alloc */
+ u_int64_t dqb_bsoftlimit; /* preferred limit on disk quota blocks */
+ u_int64_t dqb_curspace; /* current quota block count */
+ u_int64_t dqb_ihardlimit; /* maximum # allocated inodes */
+ u_int64_t dqb_isoftlimit; /* preferred inode limit */
+ u_int64_t dqb_curinodes; /* current # allocated inodes */
+ u_int64_t dqb_btime; /* time limit for excessive disk use */
+ u_int64_t dqb_itime; /* time limit for excessive files */
+ u_int32_t dqb_valid; /* bitmask of QIF_* constants */
+ };
+#endif
+
+/*
+ * Shorthand notation.
+ */
+#define dq_bhardlimit dq_dqb.dqb_bhardlimit
+#define dq_bsoftlimit dq_dqb.dqb_bsoftlimit
+#if _LINUX_QUOTA_VERSION < 2
+# define dq_curblocks dq_dqb.dqb_curblocks
+#else
+# define dq_curspace dq_dqb.dqb_curspace
+# define dq_valid dq_dqb.dqb_valid
+#endif
+#define dq_ihardlimit dq_dqb.dqb_ihardlimit
+#define dq_isoftlimit dq_dqb.dqb_isoftlimit
+#define dq_curinodes dq_dqb.dqb_curinodes
+#define dq_btime dq_dqb.dqb_btime
+#define dq_itime dq_dqb.dqb_itime
+
+#define dqoff(UID) ((loff_t)((UID) * sizeof (struct dqblk)))
+
+#if _LINUX_QUOTA_VERSION < 2
+struct dqstats
+ {
+ u_int32_t lookups;
+ u_int32_t drops;
+ u_int32_t reads;
+ u_int32_t writes;
+ u_int32_t cache_hits;
+ u_int32_t pages_allocated;
+ u_int32_t allocated_dquots;
+ u_int32_t free_dquots;
+ u_int32_t syncs;
+ };
+#else
+
+/* Flags that indicate which fields in dqinfo structure are valid. */
+# define IIF_BGRACE 1
+# define IIF_IGRACE 2
+# define IIF_FLAGS 4
+# define IIF_ALL (IIF_BGRACE | IIF_IGRACE | IIF_FLAGS)
+
+struct dqinfo
+ {
+ u_int64_t dqi_bgrace;
+ u_int64_t dqi_igrace;
+ u_int32_t dqi_flags;
+ u_int32_t dqi_valid;
+ };
+#endif
+
+__BEGIN_DECLS
+
+extern int quotactl (int __cmd, const char *__special, int __id,
+ caddr_t __addr) __THROW;
+
+__END_DECLS
+
+#endif /* sys/quota.h */
diff --git a/sysroot/usr/include/sys/raw.h b/sysroot/usr/include/sys/raw.h
new file mode 100644
index 0000000..642f78c
--- /dev/null
+++ b/sysroot/usr/include/sys/raw.h
@@ -0,0 +1,39 @@
+/* Copyright (C) 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_RAW_H
+#define _SYS_RAW_H 1
+
+#include <stdint.h>
+#include <sys/ioctl.h>
+
+/* The major device number for raw devices. */
+#define RAW_MAJOR 162
+
+/* `ioctl' commands for raw devices. */
+#define RAW_SETBIND _IO(0xac, 0)
+#define RAW_GETBIND _IO(0xac, 1)
+
+struct raw_config_request
+{
+ int raw_minor;
+ uint64_t block_major;
+ uint64_t block_minor;
+};
+
+#endif /* sys/raw.h */
diff --git a/sysroot/usr/include/sys/reboot.h b/sysroot/usr/include/sys/reboot.h
new file mode 100644
index 0000000..2a719c7
--- /dev/null
+++ b/sysroot/usr/include/sys/reboot.h
@@ -0,0 +1,49 @@
+/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* This file should define RB_* macros to be used as flag
+ bits in the argument to the `reboot' system call. */
+
+#ifndef _SYS_REBOOT_H
+#define _SYS_REBOOT_H 1
+
+#include <features.h>
+
+/* Perform a hard reset now. */
+#define RB_AUTOBOOT 0x01234567
+
+/* Halt the system. */
+#define RB_HALT_SYSTEM 0xcdef0123
+
+/* Enable reboot using Ctrl-Alt-Delete keystroke. */
+#define RB_ENABLE_CAD 0x89abcdef
+
+/* Disable reboot using Ctrl-Alt-Delete keystroke. */
+#define RB_DISABLE_CAD 0
+
+/* Stop system and switch power off if possible. */
+#define RB_POWER_OFF 0x4321fedc
+
+__BEGIN_DECLS
+
+/* Reboot or halt the system. */
+extern int reboot (int __howto) __THROW;
+
+__END_DECLS
+
+#endif /* _SYS_REBOOT_H */
diff --git a/sysroot/usr/include/sys/reg.h b/sysroot/usr/include/sys/reg.h
new file mode 100644
index 0000000..acb71a2
--- /dev/null
+++ b/sysroot/usr/include/sys/reg.h
@@ -0,0 +1,79 @@
+/* Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_REG_H
+#define _SYS_REG_H 1
+#include <bits/wordsize.h>
+
+
+#if __WORDSIZE == 64
+/* Index into an array of 8 byte longs returned from ptrace for
+ location of the users' stored general purpose registers. */
+
+# define R15 0
+# define R14 1
+# define R13 2
+# define R12 3
+# define RBP 4
+# define RBX 5
+# define R11 6
+# define R10 7
+# define R9 8
+# define R8 9
+# define RAX 10
+# define RCX 11
+# define RDX 12
+# define RSI 13
+# define RDI 14
+# define ORIG_RAX 15
+# define RIP 16
+# define CS 17
+# define EFLAGS 18
+# define RSP 19
+# define SS 20
+# define FS_BASE 21
+# define GS_BASE 22
+# define DS 23
+# define ES 24
+# define FS 25
+# define GS 26
+#else
+
+/* Index into an array of 4 byte integers returned from ptrace for
+ * location of the users' stored general purpose registers. */
+
+# define EBX 0
+# define ECX 1
+# define EDX 2
+# define ESI 3
+# define EDI 4
+# define EBP 5
+# define EAX 6
+# define DS 7
+# define ES 8
+# define FS 9
+# define GS 10
+# define ORIG_EAX 11
+# define EIP 12
+# define CS 13
+# define EFL 14
+# define UESP 15
+# define SS 16
+#endif
+
+#endif
diff --git a/sysroot/usr/include/sys/resource.h b/sysroot/usr/include/sys/resource.h
new file mode 100644
index 0000000..3912741
--- /dev/null
+++ b/sysroot/usr/include/sys/resource.h
@@ -0,0 +1,103 @@
+/* Copyright (C) 1992,94,1996-2000,2002,2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_RESOURCE_H
+#define _SYS_RESOURCE_H 1
+
+#include <features.h>
+
+/* Get the system-dependent definitions of structures and bit values. */
+#include <bits/resource.h>
+
+#ifndef __id_t_defined
+typedef __id_t id_t;
+# define __id_t_defined
+#endif
+
+__BEGIN_DECLS
+
+/* The X/Open standard defines that all the functions below must use
+ `int' as the type for the first argument. When we are compiling with
+ GNU extensions we change this slightly to provide better error
+ checking. */
+#if defined __USE_GNU && !defined __cplusplus
+typedef enum __rlimit_resource __rlimit_resource_t;
+typedef enum __rusage_who __rusage_who_t;
+typedef enum __priority_which __priority_which_t;
+#else
+typedef int __rlimit_resource_t;
+typedef int __rusage_who_t;
+typedef int __priority_which_t;
+#endif
+
+/* Put the soft and hard limits for RESOURCE in *RLIMITS.
+ Returns 0 if successful, -1 if not (and sets errno). */
+#ifndef __USE_FILE_OFFSET64
+extern int getrlimit (__rlimit_resource_t __resource,
+ struct rlimit *__rlimits) __THROW;
+#else
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (getrlimit, (__rlimit_resource_t __resource,
+ struct rlimit *__rlimits), getrlimit64);
+# else
+# define getrlimit getrlimit64
+# endif
+#endif
+#ifdef __USE_LARGEFILE64
+extern int getrlimit64 (__rlimit_resource_t __resource,
+ struct rlimit64 *__rlimits) __THROW;
+#endif
+
+/* Set the soft and hard limits for RESOURCE to *RLIMITS.
+ Only the super-user can increase hard limits.
+ Return 0 if successful, -1 if not (and sets errno). */
+#ifndef __USE_FILE_OFFSET64
+extern int setrlimit (__rlimit_resource_t __resource,
+ __const struct rlimit *__rlimits) __THROW;
+#else
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (setrlimit, (__rlimit_resource_t __resource,
+ __const struct rlimit *__rlimits),
+ setrlimit64);
+# else
+# define setrlimit setrlimit64
+# endif
+#endif
+#ifdef __USE_LARGEFILE64
+extern int setrlimit64 (__rlimit_resource_t __resource,
+ __const struct rlimit64 *__rlimits) __THROW;
+#endif
+
+/* Return resource usage information on process indicated by WHO
+ and put it in *USAGE. Returns 0 for success, -1 for failure. */
+extern int getrusage (__rusage_who_t __who, struct rusage *__usage) __THROW;
+
+/* Return the highest priority of any process specified by WHICH and WHO
+ (see above); if WHO is zero, the current process, process group, or user
+ (as specified by WHO) is used. A lower priority number means higher
+ priority. Priorities range from PRIO_MIN to PRIO_MAX (above). */
+extern int getpriority (__priority_which_t __which, id_t __who) __THROW;
+
+/* Set the priority of all processes specified by WHICH and WHO (see above)
+ to PRIO. Returns 0 on success, -1 on errors. */
+extern int setpriority (__priority_which_t __which, id_t __who, int __prio)
+ __THROW;
+
+__END_DECLS
+
+#endif /* sys/resource.h */
diff --git a/sysroot/usr/include/sys/select.h b/sysroot/usr/include/sys/select.h
new file mode 100644
index 0000000..2a40843
--- /dev/null
+++ b/sysroot/usr/include/sys/select.h
@@ -0,0 +1,130 @@
+/* `fd_set' type and related macros, and `select'/`pselect' declarations.
+ Copyright (C) 1996,97,98,99,2000,01,02,2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* POSIX 1003.1g: 6.2 Select from File Descriptor Sets <sys/select.h> */
+
+#ifndef _SYS_SELECT_H
+#define _SYS_SELECT_H 1
+
+#include <features.h>
+
+/* Get definition of needed basic types. */
+#include <bits/types.h>
+
+/* Get __FD_* definitions. */
+#include <bits/select.h>
+
+/* Get __sigset_t. */
+#include <bits/sigset.h>
+
+#ifndef __sigset_t_defined
+# define __sigset_t_defined
+typedef __sigset_t sigset_t;
+#endif
+
+/* Get definition of timer specification structures. */
+#define __need_time_t
+#define __need_timespec
+#include <time.h>
+#define __need_timeval
+#include <bits/time.h>
+
+#ifndef __suseconds_t_defined
+typedef __suseconds_t suseconds_t;
+# define __suseconds_t_defined
+#endif
+
+
+/* The fd_set member is required to be an array of longs. */
+typedef long int __fd_mask;
+
+/* Some versions of <linux/posix_types.h> define these macros. */
+#undef __NFDBITS
+#undef __FDELT
+#undef __FDMASK
+/* It's easier to assume 8-bit bytes than to get CHAR_BIT. */
+#define __NFDBITS (8 * sizeof (__fd_mask))
+#define __FDELT(d) ((d) / __NFDBITS)
+#define __FDMASK(d) ((__fd_mask) 1 << ((d) % __NFDBITS))
+
+/* fd_set for select and pselect. */
+typedef struct
+ {
+ /* XPG4.2 requires this member name. Otherwise avoid the name
+ from the global namespace. */
+#ifdef __USE_XOPEN
+ __fd_mask fds_bits[__FD_SETSIZE / __NFDBITS];
+# define __FDS_BITS(set) ((set)->fds_bits)
+#else
+ __fd_mask __fds_bits[__FD_SETSIZE / __NFDBITS];
+# define __FDS_BITS(set) ((set)->__fds_bits)
+#endif
+ } fd_set;
+
+/* Maximum number of file descriptors in `fd_set'. */
+#define FD_SETSIZE __FD_SETSIZE
+
+#ifdef __USE_MISC
+/* Sometimes the fd_set member is assumed to have this type. */
+typedef __fd_mask fd_mask;
+
+/* Number of bits per word of `fd_set' (some code assumes this is 32). */
+# define NFDBITS __NFDBITS
+#endif
+
+
+/* Access macros for `fd_set'. */
+#define FD_SET(fd, fdsetp) __FD_SET (fd, fdsetp)
+#define FD_CLR(fd, fdsetp) __FD_CLR (fd, fdsetp)
+#define FD_ISSET(fd, fdsetp) __FD_ISSET (fd, fdsetp)
+#define FD_ZERO(fdsetp) __FD_ZERO (fdsetp)
+
+
+__BEGIN_DECLS
+
+/* Check the first NFDS descriptors each in READFDS (if not NULL) for read
+ readiness, in WRITEFDS (if not NULL) for write readiness, and in EXCEPTFDS
+ (if not NULL) for exceptional conditions. If TIMEOUT is not NULL, time out
+ after waiting the interval specified therein. Returns the number of ready
+ descriptors, or -1 for errors.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int select (int __nfds, fd_set *__restrict __readfds,
+ fd_set *__restrict __writefds,
+ fd_set *__restrict __exceptfds,
+ struct timeval *__restrict __timeout);
+
+#ifdef __USE_XOPEN2K
+/* Same as above only that the TIMEOUT value is given with higher
+ resolution and a sigmask which is been set temporarily. This version
+ should be used.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int pselect (int __nfds, fd_set *__restrict __readfds,
+ fd_set *__restrict __writefds,
+ fd_set *__restrict __exceptfds,
+ const struct timespec *__restrict __timeout,
+ const __sigset_t *__restrict __sigmask);
+#endif
+
+__END_DECLS
+
+#endif /* sys/select.h */
diff --git a/sysroot/usr/include/sys/sem.h b/sysroot/usr/include/sys/sem.h
new file mode 100644
index 0000000..24a57fc
--- /dev/null
+++ b/sysroot/usr/include/sys/sem.h
@@ -0,0 +1,69 @@
+/* Copyright (C) 1995-1999, 2000, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SEM_H
+#define _SYS_SEM_H 1
+
+#include <features.h>
+
+#define __need_size_t
+#include <stddef.h>
+
+/* Get common definition of System V style IPC. */
+#include <sys/ipc.h>
+
+/* Get system dependent definition of `struct semid_ds' and more. */
+#include <bits/sem.h>
+
+#ifdef __USE_GNU
+# define __need_timespec
+# include <time.h>
+#endif
+
+/* The following System V style IPC functions implement a semaphore
+ handling. The definition is found in XPG2. */
+
+/* Structure used for argument to `semop' to describe operations. */
+struct sembuf
+{
+ unsigned short int sem_num; /* semaphore number */
+ short int sem_op; /* semaphore operation */
+ short int sem_flg; /* operation flag */
+};
+
+
+__BEGIN_DECLS
+
+/* Semaphore control operation. */
+extern int semctl (int __semid, int __semnum, int __cmd, ...) __THROW;
+
+/* Get semaphore. */
+extern int semget (key_t __key, int __nsems, int __semflg) __THROW;
+
+/* Operate on semaphore. */
+extern int semop (int __semid, struct sembuf *__sops, size_t __nsops) __THROW;
+
+#ifdef __USE_GNU
+/* Operate on semaphore with timeout. */
+extern int semtimedop (int __semid, struct sembuf *__sops, size_t __nsops,
+ __const struct timespec *__timeout) __THROW;
+#endif
+
+__END_DECLS
+
+#endif /* sys/sem.h */
diff --git a/sysroot/usr/include/sys/sendfile.h b/sysroot/usr/include/sys/sendfile.h
new file mode 100644
index 0000000..4c1367b
--- /dev/null
+++ b/sysroot/usr/include/sys/sendfile.h
@@ -0,0 +1,52 @@
+/* sendfile -- copy data directly from one file descriptor to another
+ Copyright (C) 1998,99,01,2002,2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SENDFILE_H
+#define _SYS_SENDFILE_H 1
+
+#include <features.h>
+#include <sys/types.h>
+
+__BEGIN_DECLS
+
+/* Send up to COUNT bytes from file associated with IN_FD starting at
+ *OFFSET to descriptor OUT_FD. Set *OFFSET to the IN_FD's file position
+ following the read bytes. If OFFSET is a null pointer, use the normal
+ file position instead. Return the number of written bytes, or -1 in
+ case of error. */
+#ifndef __USE_FILE_OFFSET64
+extern ssize_t sendfile (int __out_fd, int __in_fd, off_t *__offset,
+ size_t __count) __THROW;
+#else
+# ifdef __REDIRECT_NTH
+extern ssize_t __REDIRECT_NTH (sendfile,
+ (int __out_fd, int __in_fd, __off64_t *__offset,
+ size_t __count), sendfile64);
+# else
+# define sendfile sendfile64
+# endif
+#endif
+#ifdef __USE_LARGEFILE64
+extern ssize_t sendfile64 (int __out_fd, int __in_fd, __off64_t *__offset,
+ size_t __count) __THROW;
+#endif
+
+__END_DECLS
+
+#endif /* sys/sendfile.h */
diff --git a/sysroot/usr/include/sys/shm.h b/sysroot/usr/include/sys/shm.h
new file mode 100644
index 0000000..786ce75
--- /dev/null
+++ b/sysroot/usr/include/sys/shm.h
@@ -0,0 +1,65 @@
+/* Copyright (C) 1995-1999, 2000, 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SHM_H
+#define _SYS_SHM_H 1
+
+#include <features.h>
+
+#define __need_size_t
+#include <stddef.h>
+
+/* Get common definition of System V style IPC. */
+#include <sys/ipc.h>
+
+/* Get system dependent definition of `struct shmid_ds' and more. */
+#include <bits/shm.h>
+
+/* Define types required by the standard. */
+#define __need_time_t
+#include <time.h>
+
+#ifdef __USE_XOPEN
+# ifndef __pid_t_defined
+typedef __pid_t pid_t;
+# define __pid_t_defined
+# endif
+#endif /* X/Open */
+
+
+__BEGIN_DECLS
+
+/* The following System V style IPC functions implement a shared memory
+ facility. The definition is found in XPG4.2. */
+
+/* Shared memory control operation. */
+extern int shmctl (int __shmid, int __cmd, struct shmid_ds *__buf) __THROW;
+
+/* Get shared memory segment. */
+extern int shmget (key_t __key, size_t __size, int __shmflg) __THROW;
+
+/* Attach shared memory segment. */
+extern void *shmat (int __shmid, __const void *__shmaddr, int __shmflg)
+ __THROW;
+
+/* Detach shared memory segment. */
+extern int shmdt (__const void *__shmaddr) __THROW;
+
+__END_DECLS
+
+#endif /* sys/shm.h */
diff --git a/sysroot/usr/include/sys/signal.h b/sysroot/usr/include/sys/signal.h
new file mode 100644
index 0000000..2e602da
--- /dev/null
+++ b/sysroot/usr/include/sys/signal.h
@@ -0,0 +1 @@
+#include <signal.h>
diff --git a/sysroot/usr/include/sys/socket.h b/sysroot/usr/include/sys/socket.h
new file mode 100644
index 0000000..6d9eab7
--- /dev/null
+++ b/sysroot/usr/include/sys/socket.h
@@ -0,0 +1,243 @@
+/* Declarations of socket constants, types, and functions.
+ Copyright (C) 1991,92,1994-2001,2003,2005,2007
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SOCKET_H
+#define _SYS_SOCKET_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+#include <sys/uio.h>
+#define __need_size_t
+#include <stddef.h>
+
+
+/* This operating system-specific header file defines the SOCK_*, PF_*,
+ AF_*, MSG_*, SOL_*, and SO_* constants, and the `struct sockaddr',
+ `struct msghdr', and `struct linger' types. */
+#include <bits/socket.h>
+
+#ifdef __USE_BSD
+/* This is the 4.3 BSD `struct sockaddr' format, which is used as wire
+ format in the grotty old 4.3 `talk' protocol. */
+struct osockaddr
+ {
+ unsigned short int sa_family;
+ unsigned char sa_data[14];
+ };
+#endif
+
+/* The following constants should be used for the second parameter of
+ `shutdown'. */
+enum
+{
+ SHUT_RD = 0, /* No more receptions. */
+#define SHUT_RD SHUT_RD
+ SHUT_WR, /* No more transmissions. */
+#define SHUT_WR SHUT_WR
+ SHUT_RDWR /* No more receptions or transmissions. */
+#define SHUT_RDWR SHUT_RDWR
+};
+
+/* This is the type we use for generic socket address arguments.
+
+ With GCC 2.7 and later, the funky union causes redeclarations or
+ uses with any of the listed types to be allowed without complaint.
+ G++ 2.7 does not support transparent unions so there we want the
+ old-style declaration, too. */
+#if defined __cplusplus || !__GNUC_PREREQ (2, 7) || !defined __USE_GNU
+# define __SOCKADDR_ARG struct sockaddr *__restrict
+# define __CONST_SOCKADDR_ARG __const struct sockaddr *
+#else
+/* Add more `struct sockaddr_AF' types here as necessary.
+ These are all the ones I found on NetBSD and Linux. */
+# define __SOCKADDR_ALLTYPES \
+ __SOCKADDR_ONETYPE (sockaddr) \
+ __SOCKADDR_ONETYPE (sockaddr_at) \
+ __SOCKADDR_ONETYPE (sockaddr_ax25) \
+ __SOCKADDR_ONETYPE (sockaddr_dl) \
+ __SOCKADDR_ONETYPE (sockaddr_eon) \
+ __SOCKADDR_ONETYPE (sockaddr_in) \
+ __SOCKADDR_ONETYPE (sockaddr_in6) \
+ __SOCKADDR_ONETYPE (sockaddr_inarp) \
+ __SOCKADDR_ONETYPE (sockaddr_ipx) \
+ __SOCKADDR_ONETYPE (sockaddr_iso) \
+ __SOCKADDR_ONETYPE (sockaddr_ns) \
+ __SOCKADDR_ONETYPE (sockaddr_un) \
+ __SOCKADDR_ONETYPE (sockaddr_x25)
+
+# define __SOCKADDR_ONETYPE(type) struct type *__restrict __##type##__;
+typedef union { __SOCKADDR_ALLTYPES
+ } __SOCKADDR_ARG __attribute__ ((__transparent_union__));
+# undef __SOCKADDR_ONETYPE
+# define __SOCKADDR_ONETYPE(type) __const struct type *__restrict __##type##__;
+typedef union { __SOCKADDR_ALLTYPES
+ } __CONST_SOCKADDR_ARG __attribute__ ((__transparent_union__));
+# undef __SOCKADDR_ONETYPE
+#endif
+
+
+/* Create a new socket of type TYPE in domain DOMAIN, using
+ protocol PROTOCOL. If PROTOCOL is zero, one is chosen automatically.
+ Returns a file descriptor for the new socket, or -1 for errors. */
+extern int socket (int __domain, int __type, int __protocol) __THROW;
+
+/* Create two new sockets, of type TYPE in domain DOMAIN and using
+ protocol PROTOCOL, which are connected to each other, and put file
+ descriptors for them in FDS[0] and FDS[1]. If PROTOCOL is zero,
+ one will be chosen automatically. Returns 0 on success, -1 for errors. */
+extern int socketpair (int __domain, int __type, int __protocol,
+ int __fds[2]) __THROW;
+
+/* Give the socket FD the local address ADDR (which is LEN bytes long). */
+extern int bind (int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len)
+ __THROW;
+
+/* Put the local address of FD into *ADDR and its length in *LEN. */
+extern int getsockname (int __fd, __SOCKADDR_ARG __addr,
+ socklen_t *__restrict __len) __THROW;
+
+/* Open a connection on socket FD to peer at ADDR (which LEN bytes long).
+ For connectionless socket types, just set the default address to send to
+ and the only address from which to accept transmissions.
+ Return 0 on success, -1 for errors.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int connect (int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len);
+
+/* Put the address of the peer connected to socket FD into *ADDR
+ (which is *LEN bytes long), and its actual length into *LEN. */
+extern int getpeername (int __fd, __SOCKADDR_ARG __addr,
+ socklen_t *__restrict __len) __THROW;
+
+
+/* Send N bytes of BUF to socket FD. Returns the number sent or -1.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern ssize_t send (int __fd, __const void *__buf, size_t __n, int __flags);
+
+/* Read N bytes into BUF from socket FD.
+ Returns the number read or -1 for errors.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern ssize_t recv (int __fd, void *__buf, size_t __n, int __flags);
+
+/* Send N bytes of BUF on socket FD to peer at address ADDR (which is
+ ADDR_LEN bytes long). Returns the number sent, or -1 for errors.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern ssize_t sendto (int __fd, __const void *__buf, size_t __n,
+ int __flags, __CONST_SOCKADDR_ARG __addr,
+ socklen_t __addr_len);
+
+/* Read N bytes into BUF through socket FD.
+ If ADDR is not NULL, fill in *ADDR_LEN bytes of it with tha address of
+ the sender, and store the actual size of the address in *ADDR_LEN.
+ Returns the number of bytes read or -1 for errors.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern ssize_t recvfrom (int __fd, void *__restrict __buf, size_t __n,
+ int __flags, __SOCKADDR_ARG __addr,
+ socklen_t *__restrict __addr_len);
+
+
+/* Send a message described MESSAGE on socket FD.
+ Returns the number of bytes sent, or -1 for errors.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern ssize_t sendmsg (int __fd, __const struct msghdr *__message,
+ int __flags);
+
+/* Receive a message as described by MESSAGE from socket FD.
+ Returns the number of bytes read or -1 for errors.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern ssize_t recvmsg (int __fd, struct msghdr *__message, int __flags);
+
+
+/* Put the current value for socket FD's option OPTNAME at protocol level LEVEL
+ into OPTVAL (which is *OPTLEN bytes long), and set *OPTLEN to the value's
+ actual length. Returns 0 on success, -1 for errors. */
+extern int getsockopt (int __fd, int __level, int __optname,
+ void *__restrict __optval,
+ socklen_t *__restrict __optlen) __THROW;
+
+/* Set socket FD's option OPTNAME at protocol level LEVEL
+ to *OPTVAL (which is OPTLEN bytes long).
+ Returns 0 on success, -1 for errors. */
+extern int setsockopt (int __fd, int __level, int __optname,
+ __const void *__optval, socklen_t __optlen) __THROW;
+
+
+/* Prepare to accept connections on socket FD.
+ N connection requests will be queued before further requests are refused.
+ Returns 0 on success, -1 for errors. */
+extern int listen (int __fd, int __n) __THROW;
+
+/* Await a connection on socket FD.
+ When a connection arrives, open a new socket to communicate with it,
+ set *ADDR (which is *ADDR_LEN bytes long) to the address of the connecting
+ peer and *ADDR_LEN to the address's actual length, and return the
+ new socket's descriptor, or -1 for errors.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int accept (int __fd, __SOCKADDR_ARG __addr,
+ socklen_t *__restrict __addr_len);
+
+/* Shut down all or part of the connection open on socket FD.
+ HOW determines what to shut down:
+ SHUT_RD = No more receptions;
+ SHUT_WR = No more transmissions;
+ SHUT_RDWR = No more receptions or transmissions.
+ Returns 0 on success, -1 for errors. */
+extern int shutdown (int __fd, int __how) __THROW;
+
+
+#ifdef __USE_XOPEN2K
+/* Determine wheter socket is at a out-of-band mark. */
+extern int sockatmark (int __fd) __THROW;
+#endif
+
+
+#ifdef __USE_MISC
+/* FDTYPE is S_IFSOCK or another S_IF* macro defined in <sys/stat.h>;
+ returns 1 if FD is open on an object of the indicated type, 0 if not,
+ or -1 for errors (setting errno). */
+extern int isfdtype (int __fd, int __fdtype) __THROW;
+#endif
+
+
+/* Define some macros helping to catch buffer overflows. */
+#if __USE_FORTIFY_LEVEL > 0 && defined __extern_always_inline
+# include <bits/socket2.h>
+#endif
+
+__END_DECLS
+
+#endif /* sys/socket.h */
diff --git a/sysroot/usr/include/sys/socketvar.h b/sysroot/usr/include/sys/socketvar.h
new file mode 100644
index 0000000..b177158
--- /dev/null
+++ b/sysroot/usr/include/sys/socketvar.h
@@ -0,0 +1,3 @@
+/* This header is used on many systems but for GNU we have everything
+ already defined in the standard header. */
+#include <sys/socket.h>
diff --git a/sysroot/usr/include/sys/soundcard.h b/sysroot/usr/include/sys/soundcard.h
new file mode 100644
index 0000000..fade986
--- /dev/null
+++ b/sysroot/usr/include/sys/soundcard.h
@@ -0,0 +1 @@
+#include <linux/soundcard.h>
diff --git a/sysroot/usr/include/sys/stat.h b/sysroot/usr/include/sys/stat.h
new file mode 100644
index 0000000..364c43f
--- /dev/null
+++ b/sysroot/usr/include/sys/stat.h
@@ -0,0 +1,535 @@
+/* Copyright (C) 1991, 1992, 1995-2004, 2005, 2006, 2007
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * POSIX Standard: 5.6 File Characteristics <sys/stat.h>
+ */
+
+#ifndef _SYS_STAT_H
+#define _SYS_STAT_H 1
+
+#include <features.h>
+
+#include <bits/types.h> /* For __mode_t and __dev_t. */
+
+#if defined __USE_XOPEN || defined __USE_XOPEN2K || defined __USE_MISC \
+ || defined __USE_ATFILE
+# if defined __USE_XOPEN || defined __USE_XOPEN2K
+# define __need_time_t
+# endif
+# if defined __USE_MISC || defined __USE_ATFILE
+# define __need_timespec
+# endif
+# include <time.h> /* For time_t resp. timespec. */
+#endif
+
+#if defined __USE_XOPEN || defined __USE_XOPEN2K
+/* The Single Unix specification says that some more types are
+ available here. */
+# ifndef __dev_t_defined
+typedef __dev_t dev_t;
+# define __dev_t_defined
+# endif
+
+# ifndef __gid_t_defined
+typedef __gid_t gid_t;
+# define __gid_t_defined
+# endif
+
+# ifndef __ino_t_defined
+# ifndef __USE_FILE_OFFSET64
+typedef __ino_t ino_t;
+# else
+typedef __ino64_t ino_t;
+# endif
+# define __ino_t_defined
+# endif
+
+# ifndef __mode_t_defined
+typedef __mode_t mode_t;
+# define __mode_t_defined
+# endif
+
+# ifndef __nlink_t_defined
+typedef __nlink_t nlink_t;
+# define __nlink_t_defined
+# endif
+
+# ifndef __off_t_defined
+# ifndef __USE_FILE_OFFSET64
+typedef __off_t off_t;
+# else
+typedef __off64_t off_t;
+# endif
+# define __off_t_defined
+# endif
+
+# ifndef __uid_t_defined
+typedef __uid_t uid_t;
+# define __uid_t_defined
+# endif
+#endif /* X/Open */
+
+#ifdef __USE_UNIX98
+# ifndef __blkcnt_t_defined
+# ifndef __USE_FILE_OFFSET64
+typedef __blkcnt_t blkcnt_t;
+# else
+typedef __blkcnt64_t blkcnt_t;
+# endif
+# define __blkcnt_t_defined
+# endif
+
+# ifndef __blksize_t_defined
+typedef __blksize_t blksize_t;
+# define __blksize_t_defined
+# endif
+#endif /* Unix98 */
+
+__BEGIN_DECLS
+
+#include <bits/stat.h>
+
+#if defined __USE_BSD || defined __USE_MISC || defined __USE_XOPEN
+# define S_IFMT __S_IFMT
+# define S_IFDIR __S_IFDIR
+# define S_IFCHR __S_IFCHR
+# define S_IFBLK __S_IFBLK
+# define S_IFREG __S_IFREG
+# ifdef __S_IFIFO
+# define S_IFIFO __S_IFIFO
+# endif
+# ifdef __S_IFLNK
+# define S_IFLNK __S_IFLNK
+# endif
+# if (defined __USE_BSD || defined __USE_MISC || defined __USE_UNIX98) \
+ && defined __S_IFSOCK
+# define S_IFSOCK __S_IFSOCK
+# endif
+#endif
+
+/* Test macros for file types. */
+
+#define __S_ISTYPE(mode, mask) (((mode) & __S_IFMT) == (mask))
+
+#define S_ISDIR(mode) __S_ISTYPE((mode), __S_IFDIR)
+#define S_ISCHR(mode) __S_ISTYPE((mode), __S_IFCHR)
+#define S_ISBLK(mode) __S_ISTYPE((mode), __S_IFBLK)
+#define S_ISREG(mode) __S_ISTYPE((mode), __S_IFREG)
+#ifdef __S_IFIFO
+# define S_ISFIFO(mode) __S_ISTYPE((mode), __S_IFIFO)
+#endif
+#ifdef __S_IFLNK
+# define S_ISLNK(mode) __S_ISTYPE((mode), __S_IFLNK)
+#endif
+
+#if defined __USE_BSD && !defined __S_IFLNK
+# define S_ISLNK(mode) 0
+#endif
+
+#if (defined __USE_BSD || defined __USE_UNIX98) \
+ && defined __S_IFSOCK
+# define S_ISSOCK(mode) __S_ISTYPE((mode), __S_IFSOCK)
+#endif
+
+/* These are from POSIX.1b. If the objects are not implemented using separate
+ distinct file types, the macros always will evaluate to zero. Unlike the
+ other S_* macros the following three take a pointer to a `struct stat'
+ object as the argument. */
+#ifdef __USE_POSIX199309
+# define S_TYPEISMQ(buf) __S_TYPEISMQ(buf)
+# define S_TYPEISSEM(buf) __S_TYPEISSEM(buf)
+# define S_TYPEISSHM(buf) __S_TYPEISSHM(buf)
+#endif
+
+
+/* Protection bits. */
+
+#define S_ISUID __S_ISUID /* Set user ID on execution. */
+#define S_ISGID __S_ISGID /* Set group ID on execution. */
+
+#if defined __USE_BSD || defined __USE_MISC || defined __USE_XOPEN
+/* Save swapped text after use (sticky bit). This is pretty well obsolete. */
+# define S_ISVTX __S_ISVTX
+#endif
+
+#define S_IRUSR __S_IREAD /* Read by owner. */
+#define S_IWUSR __S_IWRITE /* Write by owner. */
+#define S_IXUSR __S_IEXEC /* Execute by owner. */
+/* Read, write, and execute by owner. */
+#define S_IRWXU (__S_IREAD|__S_IWRITE|__S_IEXEC)
+
+#if defined __USE_MISC && defined __USE_BSD
+# define S_IREAD S_IRUSR
+# define S_IWRITE S_IWUSR
+# define S_IEXEC S_IXUSR
+#endif
+
+#define S_IRGRP (S_IRUSR >> 3) /* Read by group. */
+#define S_IWGRP (S_IWUSR >> 3) /* Write by group. */
+#define S_IXGRP (S_IXUSR >> 3) /* Execute by group. */
+/* Read, write, and execute by group. */
+#define S_IRWXG (S_IRWXU >> 3)
+
+#define S_IROTH (S_IRGRP >> 3) /* Read by others. */
+#define S_IWOTH (S_IWGRP >> 3) /* Write by others. */
+#define S_IXOTH (S_IXGRP >> 3) /* Execute by others. */
+/* Read, write, and execute by others. */
+#define S_IRWXO (S_IRWXG >> 3)
+
+
+#ifdef __USE_BSD
+/* Macros for common mode bit masks. */
+# define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */
+# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)/* 07777 */
+# define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)/* 0666*/
+
+# define S_BLKSIZE 512 /* Block size for `st_blocks'. */
+#endif
+
+
+#ifndef __USE_FILE_OFFSET64
+/* Get file attributes for FILE and put them in BUF. */
+extern int stat (__const char *__restrict __file,
+ struct stat *__restrict __buf) __THROW __nonnull ((1, 2));
+
+/* Get file attributes for the file, device, pipe, or socket
+ that file descriptor FD is open on and put them in BUF. */
+extern int fstat (int __fd, struct stat *__buf) __THROW __nonnull ((2));
+#else
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (stat, (__const char *__restrict __file,
+ struct stat *__restrict __buf), stat64)
+ __nonnull ((1, 2));
+extern int __REDIRECT_NTH (fstat, (int __fd, struct stat *__buf), fstat64)
+ __nonnull ((2));
+# else
+# define stat stat64
+# define fstat fstat64
+# endif
+#endif
+#ifdef __USE_LARGEFILE64
+extern int stat64 (__const char *__restrict __file,
+ struct stat64 *__restrict __buf) __THROW __nonnull ((1, 2));
+extern int fstat64 (int __fd, struct stat64 *__buf) __THROW __nonnull ((2));
+#endif
+
+#ifdef __USE_ATFILE
+/* Similar to stat, get the attributes for FILE and put them in BUF.
+ Relative path names are interpreted relative to FD unless FD is
+ AT_FDCWD. */
+# ifndef __USE_FILE_OFFSET64
+extern int fstatat (int __fd, __const char *__restrict __file,
+ struct stat *__restrict __buf, int __flag)
+ __THROW __nonnull ((2, 3));
+# else
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (fstatat, (int __fd, __const char *__restrict __file,
+ struct stat *__restrict __buf,
+ int __flag),
+ fstatat64) __nonnull ((2, 3));
+# else
+# define fstatat fstatat64
+# endif
+# endif
+
+extern int fstatat64 (int __fd, __const char *__restrict __file,
+ struct stat64 *__restrict __buf, int __flag)
+ __THROW __nonnull ((2, 3));
+#endif
+
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+# ifndef __USE_FILE_OFFSET64
+/* Get file attributes about FILE and put them in BUF.
+ If FILE is a symbolic link, do not follow it. */
+extern int lstat (__const char *__restrict __file,
+ struct stat *__restrict __buf) __THROW __nonnull ((1, 2));
+# else
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (lstat,
+ (__const char *__restrict __file,
+ struct stat *__restrict __buf), lstat64)
+ __nonnull ((1, 2));
+# else
+# define lstat lstat64
+# endif
+# endif
+# ifdef __USE_LARGEFILE64
+extern int lstat64 (__const char *__restrict __file,
+ struct stat64 *__restrict __buf)
+ __THROW __nonnull ((1, 2));
+# endif
+#endif
+
+/* Set file access permissions for FILE to MODE.
+ If FILE is a symbolic link, this affects its target instead. */
+extern int chmod (__const char *__file, __mode_t __mode)
+ __THROW __nonnull ((1));
+
+#ifdef __USE_BSD
+/* Set file access permissions for FILE to MODE.
+ If FILE is a symbolic link, this affects the link itself
+ rather than its target. */
+extern int lchmod (__const char *__file, __mode_t __mode)
+ __THROW __nonnull ((1));
+#endif
+
+/* Set file access permissions of the file FD is open on to MODE. */
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+extern int fchmod (int __fd, __mode_t __mode) __THROW;
+#endif
+
+#ifdef __USE_ATFILE
+/* Set file access permissions of FILE relative to
+ the directory FD is open on. */
+extern int fchmodat (int __fd, __const char *__file, __mode_t mode, int __flag)
+ __THROW __nonnull ((2)) __wur;
+#endif /* Use ATFILE. */
+
+
+
+/* Set the file creation mask of the current process to MASK,
+ and return the old creation mask. */
+extern __mode_t umask (__mode_t __mask) __THROW;
+
+#ifdef __USE_GNU
+/* Get the current `umask' value without changing it.
+ This function is only available under the GNU Hurd. */
+extern __mode_t getumask (void) __THROW;
+#endif
+
+/* Create a new directory named PATH, with permission bits MODE. */
+extern int mkdir (__const char *__path, __mode_t __mode)
+ __THROW __nonnull ((1));
+
+#ifdef __USE_ATFILE
+/* Like mkdir, create a new directory with permission bits MODE. But
+ interpret relative PATH names relative to the directory associated
+ with FD. */
+extern int mkdirat (int __fd, __const char *__path, __mode_t __mode)
+ __THROW __nonnull ((2));
+#endif
+
+/* Create a device file named PATH, with permission and special bits MODE
+ and device number DEV (which can be constructed from major and minor
+ device numbers with the `makedev' macro above). */
+#if defined __USE_MISC || defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+extern int mknod (__const char *__path, __mode_t __mode, __dev_t __dev)
+ __THROW __nonnull ((1));
+#endif
+
+#ifdef __USE_ATFILE
+/* Like mknod, create a new device file with permission bits MODE and
+ device number DEV. But interpret relative PATH names relative to
+ the directory associated with FD. */
+extern int mknodat (int __fd, __const char *__path, __mode_t __mode,
+ __dev_t __dev) __THROW __nonnull ((2));
+#endif
+
+
+/* Create a new FIFO named PATH, with permission bits MODE. */
+extern int mkfifo (__const char *__path, __mode_t __mode)
+ __THROW __nonnull ((1));
+
+#ifdef __USE_ATFILE
+/* Like mkfifo, create a new FIFO with permission bits MODE. But
+ interpret relative PATH names relative to the directory associated
+ with FD. */
+extern int mkfifoat (int __fd, __const char *__path, __mode_t __mode)
+ __THROW __nonnull ((2));
+#endif
+
+#ifdef __USE_ATFILE
+/* Set file access and modification times relative to directory file
+ descriptor. */
+extern int utimensat (int __fd, __const char *__path,
+ __const struct timespec __times[2],
+ int __flags)
+ __THROW __nonnull ((2));
+#endif
+
+#ifdef __USE_GNU
+/* XXX This will change to the macro for the next 2008 POSIX revision. */
+/* Set file access and modification times of the file associated with FD. */
+extern int futimens (int __fd, __const struct timespec __times[2]) __THROW;
+#endif
+
+/* To allow the `struct stat' structure and the file type `mode_t'
+ bits to vary without changing shared library major version number,
+ the `stat' family of functions and `mknod' are in fact inline
+ wrappers around calls to `xstat', `fxstat', `lxstat', and `xmknod',
+ which all take a leading version-number argument designating the
+ data structure and bits used. <bits/stat.h> defines _STAT_VER with
+ the version number corresponding to `struct stat' as defined in
+ that file; and _MKNOD_VER with the version number corresponding to
+ the S_IF* macros defined therein. It is arranged that when not
+ inlined these function are always statically linked; that way a
+ dynamically-linked executable always encodes the version number
+ corresponding to the data structures it uses, so the `x' functions
+ in the shared library can adapt without needing to recompile all
+ callers. */
+
+#ifndef _STAT_VER
+# define _STAT_VER 0
+#endif
+#ifndef _MKNOD_VER
+# define _MKNOD_VER 0
+#endif
+
+/* Wrappers for stat and mknod system calls. */
+#ifndef __USE_FILE_OFFSET64
+extern int __fxstat (int __ver, int __fildes, struct stat *__stat_buf)
+ __THROW __nonnull ((3));
+extern int __xstat (int __ver, __const char *__filename,
+ struct stat *__stat_buf) __THROW __nonnull ((2, 3));
+extern int __lxstat (int __ver, __const char *__filename,
+ struct stat *__stat_buf) __THROW __nonnull ((2, 3));
+extern int __fxstatat (int __ver, int __fildes, __const char *__filename,
+ struct stat *__stat_buf, int __flag)
+ __THROW __nonnull ((3, 4));
+#else
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (__fxstat, (int __ver, int __fildes,
+ struct stat *__stat_buf), __fxstat64)
+ __nonnull ((3));
+extern int __REDIRECT_NTH (__xstat, (int __ver, __const char *__filename,
+ struct stat *__stat_buf), __xstat64)
+ __nonnull ((2, 3));
+extern int __REDIRECT_NTH (__lxstat, (int __ver, __const char *__filename,
+ struct stat *__stat_buf), __lxstat64)
+ __nonnull ((2, 3));
+extern int __REDIRECT_NTH (__fxstatat, (int __ver, int __fildes,
+ __const char *__filename,
+ struct stat *__stat_buf, int __flag),
+ __fxstatat64) __nonnull ((3, 4));
+
+# else
+# define __fxstat __fxstat64
+# define __xstat __xstat64
+# define __lxstat __lxstat64
+# endif
+#endif
+
+#ifdef __USE_LARGEFILE64
+extern int __fxstat64 (int __ver, int __fildes, struct stat64 *__stat_buf)
+ __THROW __nonnull ((3));
+extern int __xstat64 (int __ver, __const char *__filename,
+ struct stat64 *__stat_buf) __THROW __nonnull ((2, 3));
+extern int __lxstat64 (int __ver, __const char *__filename,
+ struct stat64 *__stat_buf) __THROW __nonnull ((2, 3));
+extern int __fxstatat64 (int __ver, int __fildes, __const char *__filename,
+ struct stat64 *__stat_buf, int __flag)
+ __THROW __nonnull ((3, 4));
+#endif
+extern int __xmknod (int __ver, __const char *__path, __mode_t __mode,
+ __dev_t *__dev) __THROW __nonnull ((2, 4));
+
+extern int __xmknodat (int __ver, int __fd, __const char *__path,
+ __mode_t __mode, __dev_t *__dev)
+ __THROW __nonnull ((3, 5));
+
+#if defined __GNUC__ && __GNUC__ >= 2 && defined __USE_EXTERN_INLINES
+/* Inlined versions of the real stat and mknod functions. */
+
+__extern_inline int
+__NTH (stat (__const char *__path, struct stat *__statbuf))
+{
+ return __xstat (_STAT_VER, __path, __statbuf);
+}
+
+# if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+__extern_inline int
+__NTH (lstat (__const char *__path, struct stat *__statbuf))
+{
+ return __lxstat (_STAT_VER, __path, __statbuf);
+}
+# endif
+
+__extern_inline int
+__NTH (fstat (int __fd, struct stat *__statbuf))
+{
+ return __fxstat (_STAT_VER, __fd, __statbuf);
+}
+
+# ifdef __USE_ATFILE
+__extern_inline int
+__NTH (fstatat (int __fd, __const char *__filename, struct stat *__statbuf,
+ int __flag))
+{
+ return __fxstatat (_STAT_VER, __fd, __filename, __statbuf, __flag);
+}
+# endif
+
+# if defined __USE_MISC || defined __USE_BSD
+__extern_inline int
+__NTH (mknod (__const char *__path, __mode_t __mode, __dev_t __dev))
+{
+ return __xmknod (_MKNOD_VER, __path, __mode, &__dev);
+}
+# endif
+
+# ifdef __USE_ATFILE
+__extern_inline int
+__NTH (mknodat (int __fd, __const char *__path, __mode_t __mode,
+ __dev_t __dev))
+{
+ return __xmknodat (_MKNOD_VER, __fd, __path, __mode, &__dev);
+}
+# endif
+
+# if defined __USE_LARGEFILE64 \
+ && (! defined __USE_FILE_OFFSET64 \
+ || (defined __REDIRECT_NTH && defined __OPTIMIZE__))
+__extern_inline int
+__NTH (stat64 (__const char *__path, struct stat64 *__statbuf))
+{
+ return __xstat64 (_STAT_VER, __path, __statbuf);
+}
+
+# if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+__extern_inline int
+__NTH (lstat64 (__const char *__path, struct stat64 *__statbuf))
+{
+ return __lxstat64 (_STAT_VER, __path, __statbuf);
+}
+# endif
+
+__extern_inline int
+__NTH (fstat64 (int __fd, struct stat64 *__statbuf))
+{
+ return __fxstat64 (_STAT_VER, __fd, __statbuf);
+}
+
+# ifdef __USE_GNU
+__extern_inline int
+__NTH (fstatat64 (int __fd, __const char *__filename, struct stat64 *__statbuf,
+ int __flag))
+{
+ return __fxstatat64 (_STAT_VER, __fd, __filename, __statbuf, __flag);
+}
+# endif
+
+# endif
+
+#endif
+
+__END_DECLS
+
+
+#endif /* sys/stat.h */
diff --git a/sysroot/usr/include/sys/statfs.h b/sysroot/usr/include/sys/statfs.h
new file mode 100644
index 0000000..3b2226b
--- /dev/null
+++ b/sysroot/usr/include/sys/statfs.h
@@ -0,0 +1,68 @@
+/* Definitions for getting information about a filesystem.
+ Copyright (C) 1996, 1997, 1998, 1999, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_STATFS_H
+#define _SYS_STATFS_H 1
+
+#include <features.h>
+
+/* Get the system-specific definition of `struct statfs'. */
+#include <bits/statfs.h>
+
+__BEGIN_DECLS
+
+/* Return information about the filesystem on which FILE resides. */
+#ifndef __USE_FILE_OFFSET64
+extern int statfs (__const char *__file, struct statfs *__buf)
+ __THROW __nonnull ((1, 2));
+#else
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (statfs,
+ (__const char *__file, struct statfs *__buf),
+ statfs64) __nonnull ((1, 2));
+# else
+# define statfs statfs64
+# endif
+#endif
+#ifdef __USE_LARGEFILE64
+extern int statfs64 (__const char *__file, struct statfs64 *__buf)
+ __THROW __nonnull ((1, 2));
+#endif
+
+/* Return information about the filesystem containing the file FILDES
+ refers to. */
+#ifndef __USE_FILE_OFFSET64
+extern int fstatfs (int __fildes, struct statfs *__buf)
+ __THROW __nonnull ((2));
+#else
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (fstatfs, (int __fildes, struct statfs *__buf),
+ fstatfs64) __nonnull ((2));
+# else
+# define fstatfs fstatfs64
+# endif
+#endif
+#ifdef __USE_LARGEFILE64
+extern int fstatfs64 (int __fildes, struct statfs64 *__buf)
+ __THROW __nonnull ((2));
+#endif
+
+__END_DECLS
+
+#endif /* sys/statfs.h */
diff --git a/sysroot/usr/include/sys/statvfs.h b/sysroot/usr/include/sys/statvfs.h
new file mode 100644
index 0000000..909662b
--- /dev/null
+++ b/sysroot/usr/include/sys/statvfs.h
@@ -0,0 +1,91 @@
+/* Definitions for getting information about a filesystem.
+ Copyright (C) 1998, 1999, 2000, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_STATVFS_H
+#define _SYS_STATVFS_H 1
+
+#include <features.h>
+
+/* Get the system-specific definition of `struct statfs'. */
+#include <bits/statvfs.h>
+
+#ifndef __USE_FILE_OFFSET64
+# ifndef __fsblkcnt_t_defined
+typedef __fsblkcnt_t fsblkcnt_t; /* Type to count file system blocks. */
+# define __fsblkcnt_t_defined
+# endif
+# ifndef __fsfilcnt_t_defined
+typedef __fsfilcnt_t fsfilcnt_t; /* Type to count file system inodes. */
+# define __fsfilcnt_t_defined
+# endif
+#else
+# ifndef __fsblkcnt_t_defined
+typedef __fsblkcnt64_t fsblkcnt_t; /* Type to count file system blocks. */
+# define __fsblkcnt_t_defined
+# endif
+# ifndef __fsfilcnt_t_defined
+typedef __fsfilcnt64_t fsfilcnt_t; /* Type to count file system inodes. */
+# define __fsfilcnt_t_defined
+# endif
+#endif
+
+__BEGIN_DECLS
+
+/* Return information about the filesystem on which FILE resides. */
+#ifndef __USE_FILE_OFFSET64
+extern int statvfs (__const char *__restrict __file,
+ struct statvfs *__restrict __buf)
+ __THROW __nonnull ((1, 2));
+#else
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (statvfs,
+ (__const char *__restrict __file,
+ struct statvfs *__restrict __buf), statvfs64)
+ __nonnull ((1, 2));
+# else
+# define statvfs statvfs64
+# endif
+#endif
+#ifdef __USE_LARGEFILE64
+extern int statvfs64 (__const char *__restrict __file,
+ struct statvfs64 *__restrict __buf)
+ __THROW __nonnull ((1, 2));
+#endif
+
+/* Return information about the filesystem containing the file FILDES
+ refers to. */
+#ifndef __USE_FILE_OFFSET64
+extern int fstatvfs (int __fildes, struct statvfs *__buf)
+ __THROW __nonnull ((2));
+#else
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (fstatvfs, (int __fildes, struct statvfs *__buf),
+ fstatvfs64) __nonnull ((2));
+# else
+# define fstatvfs fstatvfs64
+# endif
+#endif
+#ifdef __USE_LARGEFILE64
+extern int fstatvfs64 (int __fildes, struct statvfs64 *__buf)
+ __THROW __nonnull ((2));
+#endif
+
+__END_DECLS
+
+#endif /* sys/statvfs.h */
diff --git a/sysroot/usr/include/sys/stropts.h b/sysroot/usr/include/sys/stropts.h
new file mode 100644
index 0000000..5b5bc02
--- /dev/null
+++ b/sysroot/usr/include/sys/stropts.h
@@ -0,0 +1 @@
+#include <stropts.h>
diff --git a/sysroot/usr/include/sys/swap.h b/sysroot/usr/include/sys/swap.h
new file mode 100644
index 0000000..b6e7bef
--- /dev/null
+++ b/sysroot/usr/include/sys/swap.h
@@ -0,0 +1,43 @@
+/* Calls to enable and disable swapping on specified locations. Linux version.
+ Copyright (C) 1996, 1998, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SWAP_H
+
+#define _SYS_SWAP_H 1
+#include <features.h>
+
+/* The swap priority is encoded as:
+ (prio << SWAP_FLAG_PRIO_SHIFT) & SWAP_FLAG_PRIO_MASK
+*/
+#define SWAP_FLAG_PREFER 0x8000 /* Set if swap priority is specified. */
+#define SWAP_FLAG_PRIO_MASK 0x7fff
+#define SWAP_FLAG_PRIO_SHIFT 0
+
+__BEGIN_DECLS
+
+/* Make the block special device PATH available to the system for swapping.
+ This call is restricted to the super-user. */
+extern int swapon (__const char *__path, int __flags) __THROW;
+
+/* Stop using block special device PATH for swapping. */
+extern int swapoff (__const char *__path) __THROW;
+
+__END_DECLS
+
+#endif /* _SYS_SWAP_H */
diff --git a/sysroot/usr/include/sys/syscall.h b/sysroot/usr/include/sys/syscall.h
new file mode 100644
index 0000000..445ca37
--- /dev/null
+++ b/sysroot/usr/include/sys/syscall.h
@@ -0,0 +1,35 @@
+/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYSCALL_H
+#define _SYSCALL_H 1
+
+/* This file should list the numbers of the system the system knows.
+ But instead of duplicating this we use the information available
+ from the kernel sources. */
+#include <asm/unistd.h>
+
+#ifndef _LIBC
+/* The Linux kernel header file defines macros `__NR_<name>', but some
+ programs expect the traditional form `SYS_<name>'. So in building libc
+ we scan the kernel's list and produce <bits/syscall.h> with macros for
+ all the `SYS_' names. */
+# include <bits/syscall.h>
+#endif
+
+#endif
diff --git a/sysroot/usr/include/sys/sysctl.h b/sysroot/usr/include/sys/sysctl.h
new file mode 100644
index 0000000..110efaa
--- /dev/null
+++ b/sysroot/usr/include/sys/sysctl.h
@@ -0,0 +1,72 @@
+/* Copyright (C) 1996, 1999, 2002, 2003, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SYSCTL_H
+#define _SYS_SYSCTL_H 1
+
+#include <features.h>
+#define __need_size_t
+#include <stddef.h>
+/* Prevent more kernel headers than necessary to be included. */
+#ifndef _LINUX_KERNEL_H
+# define _LINUX_KERNEL_H 1
+# define __undef_LINUX_KERNEL_H
+#endif
+#ifndef _LINUX_TYPES_H
+# define _LINUX_TYPES_H 1
+# define __undef_LINUX_TYPES_H
+#endif
+#ifndef _LINUX_LIST_H
+# define _LINUX_LIST_H 1
+# define __undef_LINUX_LIST_H
+#endif
+#ifndef __LINUX_COMPILER_H
+# define __LINUX_COMPILER_H 1
+# define __user
+# define __undef__LINUX_COMPILER_H
+#endif
+
+#include <linux/sysctl.h>
+
+#ifdef __undef_LINUX_KERNEL_H
+# undef _LINUX_KERNEL_H
+# undef __undef_LINUX_KERNEL_H
+#endif
+#ifdef __undef_LINUX_TYPES_H
+# undef _LINUX_TYPES_H
+# undef __undef_LINUX_TYPES_H
+#endif
+#ifdef __undef_LINUX_LIST_H
+# undef _LINUX_LIST_H
+# undef __undef_LINUX_LIST_H
+#endif
+#ifdef __undef__LINUX_COMPILER_H
+# undef __LINUX_COMPILER_H
+# undef __user
+# undef __undef__LINUX_COMPILER_H
+#endif
+
+__BEGIN_DECLS
+
+/* Read or write system parameters. */
+extern int sysctl (int *__name, int __nlen, void *__oldval,
+ size_t *__oldlenp, void *__newval, size_t __newlen) __THROW;
+
+__END_DECLS
+
+#endif /* _SYS_SYSCTL_H */
diff --git a/sysroot/usr/include/sys/sysinfo.h b/sysroot/usr/include/sys/sysinfo.h
new file mode 100644
index 0000000..a6727b2
--- /dev/null
+++ b/sysroot/usr/include/sys/sysinfo.h
@@ -0,0 +1,48 @@
+/* Copyright (C) 1996, 1999, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SYSINFO_H
+#define _SYS_SYSINFO_H 1
+
+#include <features.h>
+
+/* Get sysinfo structure from kernel header. */
+#include <linux/kernel.h>
+
+__BEGIN_DECLS
+
+/* Returns information on overall system statistics. */
+extern int sysinfo (struct sysinfo *__info) __THROW;
+
+
+/* Return number of configured processors. */
+extern int get_nprocs_conf (void) __THROW;
+
+/* Return number of available processors. */
+extern int get_nprocs (void) __THROW;
+
+
+/* Return number of physical pages of memory in the system. */
+extern long int get_phys_pages (void) __THROW;
+
+/* Return number of available physical pages of memory in the system. */
+extern long int get_avphys_pages (void) __THROW;
+
+__END_DECLS
+
+#endif /* sys/sysinfo.h */
diff --git a/sysroot/usr/include/sys/syslog.h b/sysroot/usr/include/sys/syslog.h
new file mode 100644
index 0000000..22da1ce
--- /dev/null
+++ b/sysroot/usr/include/sys/syslog.h
@@ -0,0 +1,215 @@
+/*
+ * Copyright (c) 1982, 1986, 1988, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)syslog.h 8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _SYS_SYSLOG_H
+#define _SYS_SYSLOG_H 1
+
+#include <features.h>
+#define __need___va_list
+#include <stdarg.h>
+
+/* This file defines _PATH_LOG. */
+#include <bits/syslog-path.h>
+
+/*
+ * priorities/facilities are encoded into a single 32-bit quantity, where the
+ * bottom 3 bits are the priority (0-7) and the top 28 bits are the facility
+ * (0-big number). Both the priorities and the facilities map roughly
+ * one-to-one to strings in the syslogd(8) source code. This mapping is
+ * included in this file.
+ *
+ * priorities (these are ordered)
+ */
+#define LOG_EMERG 0 /* system is unusable */
+#define LOG_ALERT 1 /* action must be taken immediately */
+#define LOG_CRIT 2 /* critical conditions */
+#define LOG_ERR 3 /* error conditions */
+#define LOG_WARNING 4 /* warning conditions */
+#define LOG_NOTICE 5 /* normal but significant condition */
+#define LOG_INFO 6 /* informational */
+#define LOG_DEBUG 7 /* debug-level messages */
+
+#define LOG_PRIMASK 0x07 /* mask to extract priority part (internal) */
+ /* extract priority */
+#define LOG_PRI(p) ((p) & LOG_PRIMASK)
+#define LOG_MAKEPRI(fac, pri) (((fac) << 3) | (pri))
+
+#ifdef SYSLOG_NAMES
+#define INTERNAL_NOPRI 0x10 /* the "no priority" priority */
+ /* mark "facility" */
+#define INTERNAL_MARK LOG_MAKEPRI(LOG_NFACILITIES, 0)
+typedef struct _code {
+ char *c_name;
+ int c_val;
+} CODE;
+
+CODE prioritynames[] =
+ {
+ { "alert", LOG_ALERT },
+ { "crit", LOG_CRIT },
+ { "debug", LOG_DEBUG },
+ { "emerg", LOG_EMERG },
+ { "err", LOG_ERR },
+ { "error", LOG_ERR }, /* DEPRECATED */
+ { "info", LOG_INFO },
+ { "none", INTERNAL_NOPRI }, /* INTERNAL */
+ { "notice", LOG_NOTICE },
+ { "panic", LOG_EMERG }, /* DEPRECATED */
+ { "warn", LOG_WARNING }, /* DEPRECATED */
+ { "warning", LOG_WARNING },
+ { NULL, -1 }
+ };
+#endif
+
+/* facility codes */
+#define LOG_KERN (0<<3) /* kernel messages */
+#define LOG_USER (1<<3) /* random user-level messages */
+#define LOG_MAIL (2<<3) /* mail system */
+#define LOG_DAEMON (3<<3) /* system daemons */
+#define LOG_AUTH (4<<3) /* security/authorization messages */
+#define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */
+#define LOG_LPR (6<<3) /* line printer subsystem */
+#define LOG_NEWS (7<<3) /* network news subsystem */
+#define LOG_UUCP (8<<3) /* UUCP subsystem */
+#define LOG_CRON (9<<3) /* clock daemon */
+#define LOG_AUTHPRIV (10<<3) /* security/authorization messages (private) */
+#define LOG_FTP (11<<3) /* ftp daemon */
+
+ /* other codes through 15 reserved for system use */
+#define LOG_LOCAL0 (16<<3) /* reserved for local use */
+#define LOG_LOCAL1 (17<<3) /* reserved for local use */
+#define LOG_LOCAL2 (18<<3) /* reserved for local use */
+#define LOG_LOCAL3 (19<<3) /* reserved for local use */
+#define LOG_LOCAL4 (20<<3) /* reserved for local use */
+#define LOG_LOCAL5 (21<<3) /* reserved for local use */
+#define LOG_LOCAL6 (22<<3) /* reserved for local use */
+#define LOG_LOCAL7 (23<<3) /* reserved for local use */
+
+#define LOG_NFACILITIES 24 /* current number of facilities */
+#define LOG_FACMASK 0x03f8 /* mask to extract facility part */
+ /* facility of pri */
+#define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3)
+
+#ifdef SYSLOG_NAMES
+CODE facilitynames[] =
+ {
+ { "auth", LOG_AUTH },
+ { "authpriv", LOG_AUTHPRIV },
+ { "cron", LOG_CRON },
+ { "daemon", LOG_DAEMON },
+ { "ftp", LOG_FTP },
+ { "kern", LOG_KERN },
+ { "lpr", LOG_LPR },
+ { "mail", LOG_MAIL },
+ { "mark", INTERNAL_MARK }, /* INTERNAL */
+ { "news", LOG_NEWS },
+ { "security", LOG_AUTH }, /* DEPRECATED */
+ { "syslog", LOG_SYSLOG },
+ { "user", LOG_USER },
+ { "uucp", LOG_UUCP },
+ { "local0", LOG_LOCAL0 },
+ { "local1", LOG_LOCAL1 },
+ { "local2", LOG_LOCAL2 },
+ { "local3", LOG_LOCAL3 },
+ { "local4", LOG_LOCAL4 },
+ { "local5", LOG_LOCAL5 },
+ { "local6", LOG_LOCAL6 },
+ { "local7", LOG_LOCAL7 },
+ { NULL, -1 }
+ };
+#endif
+
+/*
+ * arguments to setlogmask.
+ */
+#define LOG_MASK(pri) (1 << (pri)) /* mask for one priority */
+#define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) /* all priorities through pri */
+
+/*
+ * Option flags for openlog.
+ *
+ * LOG_ODELAY no longer does anything.
+ * LOG_NDELAY is the inverse of what it used to be.
+ */
+#define LOG_PID 0x01 /* log the pid with each message */
+#define LOG_CONS 0x02 /* log on the console if errors in sending */
+#define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */
+#define LOG_NDELAY 0x08 /* don't delay open */
+#define LOG_NOWAIT 0x10 /* don't wait for console forks: DEPRECATED */
+#define LOG_PERROR 0x20 /* log to stderr as well */
+
+__BEGIN_DECLS
+
+/* Close descriptor used to write to system logger.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern void closelog (void);
+
+/* Open connection to system logger.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern void openlog (__const char *__ident, int __option, int __facility);
+
+/* Set the log mask level. */
+extern int setlogmask (int __mask) __THROW;
+
+/* Generate a log message using FMT string and option arguments.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern void syslog (int __pri, __const char *__fmt, ...)
+ __attribute__ ((__format__ (__printf__, 2, 3)));
+
+#ifdef __USE_BSD
+/* Generate a log message using FMT and using arguments pointed to by AP.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern void vsyslog (int __pri, __const char *__fmt, __gnuc_va_list __ap)
+ __attribute__ ((__format__ (__printf__, 2, 0)));
+#endif
+
+
+/* Define some macros helping to catch buffer overflows. */
+#if __USE_FORTIFY_LEVEL > 0 && defined __extern_always_inline
+# include <bits/syslog.h>
+#endif
+#ifdef __LDBL_COMPAT
+# include <bits/syslog-ldbl.h>
+#endif
+
+__END_DECLS
+
+#endif /* sys/syslog.h */
diff --git a/sysroot/usr/include/sys/sysmacros.h b/sysroot/usr/include/sys/sysmacros.h
new file mode 100644
index 0000000..92b3a19
--- /dev/null
+++ b/sysroot/usr/include/sys/sysmacros.h
@@ -0,0 +1,70 @@
+/* Definitions of macros to access `dev_t' values.
+ Copyright (C) 1996, 1997, 1999, 2003, 2004, 2007
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SYSMACROS_H
+#define _SYS_SYSMACROS_H 1
+
+#include <features.h>
+
+/* If the compiler does not know long long it is out of luck. We are
+ not going to hack weird hacks to support the dev_t representation
+ they need. */
+#ifdef __GLIBC_HAVE_LONG_LONG
+__extension__
+extern unsigned int gnu_dev_major (unsigned long long int __dev)
+ __THROW;
+__extension__
+extern unsigned int gnu_dev_minor (unsigned long long int __dev)
+ __THROW;
+__extension__
+extern unsigned long long int gnu_dev_makedev (unsigned int __major,
+ unsigned int __minor)
+ __THROW;
+
+# if defined __GNUC__ && __GNUC__ >= 2 && defined __USE_EXTERN_INLINES
+__extension__ __extern_inline unsigned int
+__NTH (gnu_dev_major (unsigned long long int __dev))
+{
+ return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff);
+}
+
+__extension__ __extern_inline unsigned int
+__NTH (gnu_dev_minor (unsigned long long int __dev))
+{
+ return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff);
+}
+
+__extension__ __extern_inline unsigned long long int
+__NTH (gnu_dev_makedev (unsigned int __major, unsigned int __minor))
+{
+ return ((__minor & 0xff) | ((__major & 0xfff) << 8)
+ | (((unsigned long long int) (__minor & ~0xff)) << 12)
+ | (((unsigned long long int) (__major & ~0xfff)) << 32));
+}
+# endif
+
+
+/* Access the functions with their traditional names. */
+# define major(dev) gnu_dev_major (dev)
+# define minor(dev) gnu_dev_minor (dev)
+# define makedev(maj, min) gnu_dev_makedev (maj, min)
+#endif
+
+#endif /* sys/sysmacros.h */
diff --git a/sysroot/usr/include/sys/termios.h b/sysroot/usr/include/sys/termios.h
new file mode 100644
index 0000000..3e18805
--- /dev/null
+++ b/sysroot/usr/include/sys/termios.h
@@ -0,0 +1,4 @@
+#ifndef _SYS_TERMIOS_H
+#define _SYS_TERMIOS_H
+#include <termios.h>
+#endif
diff --git a/sysroot/usr/include/sys/time.h b/sysroot/usr/include/sys/time.h
new file mode 100644
index 0000000..177696b
--- /dev/null
+++ b/sysroot/usr/include/sys/time.h
@@ -0,0 +1,193 @@
+/* Copyright (C) 1991-1994,1996-2002,2003,2005,2006
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_TIME_H
+#define _SYS_TIME_H 1
+
+#include <features.h>
+
+#include <bits/types.h>
+#define __need_time_t
+#include <time.h>
+#define __need_timeval
+#include <bits/time.h>
+
+#include <sys/select.h>
+
+#ifndef __suseconds_t_defined
+typedef __suseconds_t suseconds_t;
+# define __suseconds_t_defined
+#endif
+
+
+__BEGIN_DECLS
+
+#ifdef __USE_GNU
+/* Macros for converting between `struct timeval' and `struct timespec'. */
+# define TIMEVAL_TO_TIMESPEC(tv, ts) { \
+ (ts)->tv_sec = (tv)->tv_sec; \
+ (ts)->tv_nsec = (tv)->tv_usec * 1000; \
+}
+# define TIMESPEC_TO_TIMEVAL(tv, ts) { \
+ (tv)->tv_sec = (ts)->tv_sec; \
+ (tv)->tv_usec = (ts)->tv_nsec / 1000; \
+}
+#endif
+
+
+#ifdef __USE_BSD
+/* Structure crudely representing a timezone.
+ This is obsolete and should never be used. */
+struct timezone
+ {
+ int tz_minuteswest; /* Minutes west of GMT. */
+ int tz_dsttime; /* Nonzero if DST is ever in effect. */
+ };
+
+typedef struct timezone *__restrict __timezone_ptr_t;
+#else
+typedef void *__restrict __timezone_ptr_t;
+#endif
+
+/* Get the current time of day and timezone information,
+ putting it into *TV and *TZ. If TZ is NULL, *TZ is not filled.
+ Returns 0 on success, -1 on errors.
+ NOTE: This form of timezone information is obsolete.
+ Use the functions and variables declared in <time.h> instead. */
+extern int gettimeofday (struct timeval *__restrict __tv,
+ __timezone_ptr_t __tz) __THROW __nonnull ((1));
+
+#ifdef __USE_BSD
+/* Set the current time of day and timezone information.
+ This call is restricted to the super-user. */
+extern int settimeofday (__const struct timeval *__tv,
+ __const struct timezone *__tz)
+ __THROW __nonnull ((1));
+
+/* Adjust the current time of day by the amount in DELTA.
+ If OLDDELTA is not NULL, it is filled in with the amount
+ of time adjustment remaining to be done from the last `adjtime' call.
+ This call is restricted to the super-user. */
+extern int adjtime (__const struct timeval *__delta,
+ struct timeval *__olddelta) __THROW;
+#endif
+
+
+/* Values for the first argument to `getitimer' and `setitimer'. */
+enum __itimer_which
+ {
+ /* Timers run in real time. */
+ ITIMER_REAL = 0,
+#define ITIMER_REAL ITIMER_REAL
+ /* Timers run only when the process is executing. */
+ ITIMER_VIRTUAL = 1,
+#define ITIMER_VIRTUAL ITIMER_VIRTUAL
+ /* Timers run when the process is executing and when
+ the system is executing on behalf of the process. */
+ ITIMER_PROF = 2
+#define ITIMER_PROF ITIMER_PROF
+ };
+
+/* Type of the second argument to `getitimer' and
+ the second and third arguments `setitimer'. */
+struct itimerval
+ {
+ /* Value to put into `it_value' when the timer expires. */
+ struct timeval it_interval;
+ /* Time to the next timer expiration. */
+ struct timeval it_value;
+ };
+
+#if defined __USE_GNU && !defined __cplusplus
+/* Use the nicer parameter type only in GNU mode and not for C++ since the
+ strict C++ rules prevent the automatic promotion. */
+typedef enum __itimer_which __itimer_which_t;
+#else
+typedef int __itimer_which_t;
+#endif
+
+/* Set *VALUE to the current setting of timer WHICH.
+ Return 0 on success, -1 on errors. */
+extern int getitimer (__itimer_which_t __which,
+ struct itimerval *__value) __THROW;
+
+/* Set the timer WHICH to *NEW. If OLD is not NULL,
+ set *OLD to the old value of timer WHICH.
+ Returns 0 on success, -1 on errors. */
+extern int setitimer (__itimer_which_t __which,
+ __const struct itimerval *__restrict __new,
+ struct itimerval *__restrict __old) __THROW;
+
+/* Change the access time of FILE to TVP[0] and the modification time of
+ FILE to TVP[1]. If TVP is a null pointer, use the current time instead.
+ Returns 0 on success, -1 on errors. */
+extern int utimes (__const char *__file, __const struct timeval __tvp[2])
+ __THROW __nonnull ((1));
+
+#ifdef __USE_BSD
+/* Same as `utimes', but does not follow symbolic links. */
+extern int lutimes (__const char *__file, __const struct timeval __tvp[2])
+ __THROW __nonnull ((1));
+
+/* Same as `utimes', but takes an open file descriptor instead of a name. */
+extern int futimes (int __fd, __const struct timeval __tvp[2]) __THROW;
+#endif
+
+#ifdef __USE_ATFILE
+/* Change the access time of FILE relative to FD to TVP[0] and the
+ modification time of FILE to TVP[1]. If TVP is a null pointer, use
+ the current time instead. Returns 0 on success, -1 on errors. */
+extern int futimesat (int __fd, __const char *__file,
+ __const struct timeval __tvp[2]) __THROW;
+#endif
+
+
+#ifdef __USE_BSD
+/* Convenience macros for operations on timevals.
+ NOTE: `timercmp' does not work for >= or <=. */
+# define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
+# define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0)
+# define timercmp(a, b, CMP) \
+ (((a)->tv_sec == (b)->tv_sec) ? \
+ ((a)->tv_usec CMP (b)->tv_usec) : \
+ ((a)->tv_sec CMP (b)->tv_sec))
+# define timeradd(a, b, result) \
+ do { \
+ (result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \
+ (result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \
+ if ((result)->tv_usec >= 1000000) \
+ { \
+ ++(result)->tv_sec; \
+ (result)->tv_usec -= 1000000; \
+ } \
+ } while (0)
+# define timersub(a, b, result) \
+ do { \
+ (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
+ (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
+ if ((result)->tv_usec < 0) { \
+ --(result)->tv_sec; \
+ (result)->tv_usec += 1000000; \
+ } \
+ } while (0)
+#endif /* BSD */
+
+__END_DECLS
+
+#endif /* sys/time.h */
diff --git a/sysroot/usr/include/sys/timeb.h b/sysroot/usr/include/sys/timeb.h
new file mode 100644
index 0000000..dbdbf45
--- /dev/null
+++ b/sysroot/usr/include/sys/timeb.h
@@ -0,0 +1,46 @@
+/* Copyright (C) 1994, 1995, 1996, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_TIMEB_H
+#define _SYS_TIMEB_H 1
+
+#include <features.h>
+
+#define __need_time_t
+#include <time.h>
+
+
+__BEGIN_DECLS
+
+/* Structure returned by the `ftime' function. */
+
+struct timeb
+ {
+ time_t time; /* Seconds since epoch, as from `time'. */
+ unsigned short int millitm; /* Additional milliseconds. */
+ short int timezone; /* Minutes west of GMT. */
+ short int dstflag; /* Nonzero if Daylight Savings Time used. */
+ };
+
+/* Fill in TIMEBUF with information about the current time. */
+
+extern int ftime (struct timeb *__timebuf);
+
+__END_DECLS
+
+#endif /* sys/timeb.h */
diff --git a/sysroot/usr/include/sys/times.h b/sysroot/usr/include/sys/times.h
new file mode 100644
index 0000000..6022f2f
--- /dev/null
+++ b/sysroot/usr/include/sys/times.h
@@ -0,0 +1,53 @@
+/* Copyright (C) 1991, 1992, 1996, 1998, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * POSIX Standard: 4.5.2 Process Times <sys/times.h>
+ */
+
+#ifndef _SYS_TIMES_H
+#define _SYS_TIMES_H 1
+
+#include <features.h>
+
+#define __need_clock_t
+#include <time.h>
+
+
+__BEGIN_DECLS
+
+/* Structure describing CPU time used by a process and its children. */
+struct tms
+ {
+ clock_t tms_utime; /* User CPU time. */
+ clock_t tms_stime; /* System CPU time. */
+
+ clock_t tms_cutime; /* User CPU time of dead children. */
+ clock_t tms_cstime; /* System CPU time of dead children. */
+ };
+
+
+/* Store the CPU time used by this process and all its
+ dead children (and their dead children) in BUFFER.
+ Return the elapsed real time, or (clock_t) -1 for errors.
+ All times are in CLK_TCKths of a second. */
+extern clock_t times (struct tms *__buffer) __THROW;
+
+__END_DECLS
+
+#endif /* sys/times.h */
diff --git a/sysroot/usr/include/sys/timex.h b/sysroot/usr/include/sys/timex.h
new file mode 100644
index 0000000..773a5ab
--- /dev/null
+++ b/sysroot/usr/include/sys/timex.h
@@ -0,0 +1,127 @@
+/* Copyright (C) 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_TIMEX_H
+#define _SYS_TIMEX_H 1
+
+#include <features.h>
+#include <sys/time.h>
+
+/* These definitions from linux/timex.h as of 2.2.0. */
+
+struct ntptimeval
+{
+ struct timeval time; /* current time (ro) */
+ long int maxerror; /* maximum error (us) (ro) */
+ long int esterror; /* estimated error (us) (ro) */
+};
+
+struct timex
+{
+ unsigned int modes; /* mode selector */
+ long int offset; /* time offset (usec) */
+ long int freq; /* frequency offset (scaled ppm) */
+ long int maxerror; /* maximum error (usec) */
+ long int esterror; /* estimated error (usec) */
+ int status; /* clock command/status */
+ long int constant; /* pll time constant */
+ long int precision; /* clock precision (usec) (read only) */
+ long int tolerance; /* clock frequency tolerance (ppm) (read only) */
+ struct timeval time; /* (read only) */
+ long int tick; /* (modified) usecs between clock ticks */
+
+ long int ppsfreq; /* pps frequency (scaled ppm) (ro) */
+ long int jitter; /* pps jitter (us) (ro) */
+ int shift; /* interval duration (s) (shift) (ro) */
+ long int stabil; /* pps stability (scaled ppm) (ro) */
+ long int jitcnt; /* jitter limit exceeded (ro) */
+ long int calcnt; /* calibration intervals (ro) */
+ long int errcnt; /* calibration errors (ro) */
+ long int stbcnt; /* stability limit exceeded (ro) */
+
+ /* ??? */
+ int :32; int :32; int :32; int :32;
+ int :32; int :32; int :32; int :32;
+ int :32; int :32; int :32; int :32;
+};
+
+/* Mode codes (timex.mode) */
+#define ADJ_OFFSET 0x0001 /* time offset */
+#define ADJ_FREQUENCY 0x0002 /* frequency offset */
+#define ADJ_MAXERROR 0x0004 /* maximum time error */
+#define ADJ_ESTERROR 0x0008 /* estimated time error */
+#define ADJ_STATUS 0x0010 /* clock status */
+#define ADJ_TIMECONST 0x0020 /* pll time constant */
+#define ADJ_TICK 0x4000 /* tick value */
+#define ADJ_OFFSET_SINGLESHOT 0x8001 /* old-fashioned adjtime */
+
+/* xntp 3.4 compatibility names */
+#define MOD_OFFSET ADJ_OFFSET
+#define MOD_FREQUENCY ADJ_FREQUENCY
+#define MOD_MAXERROR ADJ_MAXERROR
+#define MOD_ESTERROR ADJ_ESTERROR
+#define MOD_STATUS ADJ_STATUS
+#define MOD_TIMECONST ADJ_TIMECONST
+#define MOD_CLKB ADJ_TICK
+#define MOD_CLKA ADJ_OFFSET_SINGLESHOT /* 0x8000 in original */
+
+
+/* Status codes (timex.status) */
+#define STA_PLL 0x0001 /* enable PLL updates (rw) */
+#define STA_PPSFREQ 0x0002 /* enable PPS freq discipline (rw) */
+#define STA_PPSTIME 0x0004 /* enable PPS time discipline (rw) */
+#define STA_FLL 0x0008 /* select frequency-lock mode (rw) */
+
+#define STA_INS 0x0010 /* insert leap (rw) */
+#define STA_DEL 0x0020 /* delete leap (rw) */
+#define STA_UNSYNC 0x0040 /* clock unsynchronized (rw) */
+#define STA_FREQHOLD 0x0080 /* hold frequency (rw) */
+
+#define STA_PPSSIGNAL 0x0100 /* PPS signal present (ro) */
+#define STA_PPSJITTER 0x0200 /* PPS signal jitter exceeded (ro) */
+#define STA_PPSWANDER 0x0400 /* PPS signal wander exceeded (ro) */
+#define STA_PPSERROR 0x0800 /* PPS signal calibration error (ro) */
+
+#define STA_CLOCKERR 0x1000 /* clock hardware fault (ro) */
+
+#define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \
+ STA_PPSERROR | STA_CLOCKERR) /* read-only bits */
+
+/* Clock states (time_state) */
+#define TIME_OK 0 /* clock synchronized, no leap second */
+#define TIME_INS 1 /* insert leap second */
+#define TIME_DEL 2 /* delete leap second */
+#define TIME_OOP 3 /* leap second in progress */
+#define TIME_WAIT 4 /* leap second has occurred */
+#define TIME_ERROR 5 /* clock not synchronized */
+#define TIME_BAD TIME_ERROR /* bw compat */
+
+/* Maximum time constant of the PLL. */
+#define MAXTC 6
+
+__BEGIN_DECLS
+
+extern int __adjtimex (struct timex *__ntx) __THROW;
+extern int adjtimex (struct timex *__ntx) __THROW;
+
+extern int ntp_gettime (struct ntptimeval *__ntv) __THROW;
+extern int ntp_adjtime (struct timex *__tntx) __THROW;
+
+__END_DECLS
+
+#endif /* sys/timex.h */
diff --git a/sysroot/usr/include/sys/ttychars.h b/sysroot/usr/include/sys/ttychars.h
new file mode 100644
index 0000000..7043f60
--- /dev/null
+++ b/sysroot/usr/include/sys/ttychars.h
@@ -0,0 +1,61 @@
+/*-
+ * Copyright (c) 1982, 1986, 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)ttychars.h 8.2 (Berkeley) 1/4/94
+ */
+
+/*
+ * 4.3 COMPATIBILITY FILE
+ *
+ * User visible structures and constants related to terminal handling.
+ */
+#ifndef _SYS_TTYCHARS_H
+#define _SYS_TTYCHARS_H 1
+
+struct ttychars {
+ char tc_erase; /* erase last character */
+ char tc_kill; /* erase entire line */
+ char tc_intrc; /* interrupt */
+ char tc_quitc; /* quit */
+ char tc_startc; /* start output */
+ char tc_stopc; /* stop output */
+ char tc_eofc; /* end-of-file */
+ char tc_brkc; /* input delimiter (like nl) */
+ char tc_suspc; /* stop process signal */
+ char tc_dsuspc; /* delayed stop process signal */
+ char tc_rprntc; /* reprint line */
+ char tc_flushc; /* flush output (toggles) */
+ char tc_werasc; /* word erase */
+ char tc_lnextc; /* literal next character */
+};
+
+#ifdef __USE_OLD_TTY
+#include <sys/ttydefaults.h> /* to pick up character defaults */
+#endif
+
+#endif /* sys/ttychars.h */
diff --git a/sysroot/usr/include/sys/ttydefaults.h b/sysroot/usr/include/sys/ttydefaults.h
new file mode 100644
index 0000000..9be168b
--- /dev/null
+++ b/sysroot/usr/include/sys/ttydefaults.h
@@ -0,0 +1,100 @@
+/*-
+ * Copyright (c) 1982, 1986, 1993
+ * The Regents of the University of California. All rights reserved.
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)ttydefaults.h 8.4 (Berkeley) 1/21/94
+ */
+
+/*
+ * System wide defaults for terminal state. Linux version.
+ */
+#ifndef _SYS_TTYDEFAULTS_H_
+#define _SYS_TTYDEFAULTS_H_
+
+/*
+ * Defaults on "first" open.
+ */
+#define TTYDEF_IFLAG (BRKINT | ISTRIP | ICRNL | IMAXBEL | IXON | IXANY)
+#define TTYDEF_OFLAG (OPOST | ONLCR | XTABS)
+#define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL)
+#define TTYDEF_CFLAG (CREAD | CS7 | PARENB | HUPCL)
+#define TTYDEF_SPEED (B9600)
+
+/*
+ * Control Character Defaults
+ */
+#define CTRL(x) (x&037)
+#define CEOF CTRL('d')
+#ifdef _POSIX_VDISABLE
+# define CEOL _POSIX_VDISABLE
+#else
+# define CEOL '\0' /* XXX avoid _POSIX_VDISABLE */
+#endif
+#define CERASE 0177
+#define CINTR CTRL('c')
+#ifdef _POSIX_VDISABLE
+# define CSTATUS _POSIX_VDISABLE
+#else
+# define CSTATUS '\0' /* XXX avoid _POSIX_VDISABLE */
+#endif
+#define CKILL CTRL('u')
+#define CMIN 1
+#define CQUIT 034 /* FS, ^\ */
+#define CSUSP CTRL('z')
+#define CTIME 0
+#define CDSUSP CTRL('y')
+#define CSTART CTRL('q')
+#define CSTOP CTRL('s')
+#define CLNEXT CTRL('v')
+#define CDISCARD CTRL('o')
+#define CWERASE CTRL('w')
+#define CREPRINT CTRL('r')
+#define CEOT CEOF
+/* compat */
+#define CBRK CEOL
+#define CRPRNT CREPRINT
+#define CFLUSH CDISCARD
+
+/* PROTECTED INCLUSION ENDS HERE */
+#endif /* !_SYS_TTYDEFAULTS_H_ */
+
+/*
+ * #define TTYDEFCHARS to include an array of default control characters.
+ */
+#ifdef TTYDEFCHARS
+cc_t ttydefchars[NCCS] = {
+ CEOF, CEOL, CEOL, CERASE, CWERASE, CKILL, CREPRINT,
+ _POSIX_VDISABLE, CINTR, CQUIT, CSUSP, CDSUSP, CSTART, CSTOP, CLNEXT,
+ CDISCARD, CMIN, CTIME, CSTATUS, _POSIX_VDISABLE
+};
+#undef TTYDEFCHARS
+#endif
diff --git a/sysroot/usr/include/sys/types.h b/sysroot/usr/include/sys/types.h
new file mode 100644
index 0000000..04563a4
--- /dev/null
+++ b/sysroot/usr/include/sys/types.h
@@ -0,0 +1,275 @@
+/* Copyright (C) 1991,1992,1994,1995,1996,1997,1998,1999,2000,2001,2002,2006
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * POSIX Standard: 2.6 Primitive System Data Types <sys/types.h>
+ */
+
+#ifndef _SYS_TYPES_H
+#define _SYS_TYPES_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+#include <bits/types.h>
+
+#ifdef __USE_BSD
+# ifndef __u_char_defined
+typedef __u_char u_char;
+typedef __u_short u_short;
+typedef __u_int u_int;
+typedef __u_long u_long;
+typedef __quad_t quad_t;
+typedef __u_quad_t u_quad_t;
+typedef __fsid_t fsid_t;
+# define __u_char_defined
+# endif
+#endif
+
+typedef __loff_t loff_t;
+
+#ifndef __ino_t_defined
+# ifndef __USE_FILE_OFFSET64
+typedef __ino_t ino_t;
+# else
+typedef __ino64_t ino_t;
+# endif
+# define __ino_t_defined
+#endif
+#if defined __USE_LARGEFILE64 && !defined __ino64_t_defined
+typedef __ino64_t ino64_t;
+# define __ino64_t_defined
+#endif
+
+#ifndef __dev_t_defined
+typedef __dev_t dev_t;
+# define __dev_t_defined
+#endif
+
+#ifndef __gid_t_defined
+typedef __gid_t gid_t;
+# define __gid_t_defined
+#endif
+
+#ifndef __mode_t_defined
+typedef __mode_t mode_t;
+# define __mode_t_defined
+#endif
+
+#ifndef __nlink_t_defined
+typedef __nlink_t nlink_t;
+# define __nlink_t_defined
+#endif
+
+#ifndef __uid_t_defined
+typedef __uid_t uid_t;
+# define __uid_t_defined
+#endif
+
+#ifndef __off_t_defined
+# ifndef __USE_FILE_OFFSET64
+typedef __off_t off_t;
+# else
+typedef __off64_t off_t;
+# endif
+# define __off_t_defined
+#endif
+#if defined __USE_LARGEFILE64 && !defined __off64_t_defined
+typedef __off64_t off64_t;
+# define __off64_t_defined
+#endif
+
+#ifndef __pid_t_defined
+typedef __pid_t pid_t;
+# define __pid_t_defined
+#endif
+
+#if (defined __USE_SVID || defined __USE_XOPEN) && !defined __id_t_defined
+typedef __id_t id_t;
+# define __id_t_defined
+#endif
+
+#ifndef __ssize_t_defined
+typedef __ssize_t ssize_t;
+# define __ssize_t_defined
+#endif
+
+#ifdef __USE_BSD
+# ifndef __daddr_t_defined
+typedef __daddr_t daddr_t;
+typedef __caddr_t caddr_t;
+# define __daddr_t_defined
+# endif
+#endif
+
+#if (defined __USE_SVID || defined __USE_XOPEN) && !defined __key_t_defined
+typedef __key_t key_t;
+# define __key_t_defined
+#endif
+
+#ifdef __USE_XOPEN
+# define __need_clock_t
+#endif
+#define __need_time_t
+#define __need_timer_t
+#define __need_clockid_t
+#include <time.h>
+
+#ifdef __USE_XOPEN
+# ifndef __useconds_t_defined
+typedef __useconds_t useconds_t;
+# define __useconds_t_defined
+# endif
+# ifndef __suseconds_t_defined
+typedef __suseconds_t suseconds_t;
+# define __suseconds_t_defined
+# endif
+#endif
+
+#define __need_size_t
+#include <stddef.h>
+
+#ifdef __USE_MISC
+/* Old compatibility names for C types. */
+typedef unsigned long int ulong;
+typedef unsigned short int ushort;
+typedef unsigned int uint;
+#endif
+
+/* These size-specific names are used by some of the inet code. */
+
+#if !__GNUC_PREREQ (2, 7)
+
+/* These types are defined by the ISO C99 header <inttypes.h>. */
+# ifndef __int8_t_defined
+# define __int8_t_defined
+typedef char int8_t;
+typedef short int int16_t;
+typedef int int32_t;
+# if __WORDSIZE == 64
+typedef long int int64_t;
+# elif __GLIBC_HAVE_LONG_LONG
+__extension__ typedef long long int int64_t;
+# endif
+# endif
+
+/* But these were defined by ISO C without the first `_'. */
+typedef unsigned char u_int8_t;
+typedef unsigned short int u_int16_t;
+typedef unsigned int u_int32_t;
+# if __WORDSIZE == 64
+typedef unsigned long int u_int64_t;
+# elif __GLIBC_HAVE_LONG_LONG
+__extension__ typedef unsigned long long int u_int64_t;
+# endif
+
+typedef int register_t;
+
+#else
+
+/* For GCC 2.7 and later, we can use specific type-size attributes. */
+# define __intN_t(N, MODE) \
+ typedef int int##N##_t __attribute__ ((__mode__ (MODE)))
+# define __u_intN_t(N, MODE) \
+ typedef unsigned int u_int##N##_t __attribute__ ((__mode__ (MODE)))
+
+# ifndef __int8_t_defined
+# define __int8_t_defined
+__intN_t (8, __QI__);
+__intN_t (16, __HI__);
+__intN_t (32, __SI__);
+__intN_t (64, __DI__);
+# endif
+
+__u_intN_t (8, __QI__);
+__u_intN_t (16, __HI__);
+__u_intN_t (32, __SI__);
+__u_intN_t (64, __DI__);
+
+typedef int register_t __attribute__ ((__mode__ (__word__)));
+
+
+/* Some code from BIND tests this macro to see if the types above are
+ defined. */
+#endif
+#define __BIT_TYPES_DEFINED__ 1
+
+
+#ifdef __USE_BSD
+/* In BSD <sys/types.h> is expected to define BYTE_ORDER. */
+# include <endian.h>
+
+/* It also defines `fd_set' and the FD_* macros for `select'. */
+# include <sys/select.h>
+
+/* BSD defines these symbols, so we follow. */
+# include <sys/sysmacros.h>
+#endif /* Use BSD. */
+
+
+#if defined __USE_UNIX98 && !defined __blksize_t_defined
+typedef __blksize_t blksize_t;
+# define __blksize_t_defined
+#endif
+
+/* Types from the Large File Support interface. */
+#ifndef __USE_FILE_OFFSET64
+# ifndef __blkcnt_t_defined
+typedef __blkcnt_t blkcnt_t; /* Type to count number of disk blocks. */
+# define __blkcnt_t_defined
+# endif
+# ifndef __fsblkcnt_t_defined
+typedef __fsblkcnt_t fsblkcnt_t; /* Type to count file system blocks. */
+# define __fsblkcnt_t_defined
+# endif
+# ifndef __fsfilcnt_t_defined
+typedef __fsfilcnt_t fsfilcnt_t; /* Type to count file system inodes. */
+# define __fsfilcnt_t_defined
+# endif
+#else
+# ifndef __blkcnt_t_defined
+typedef __blkcnt64_t blkcnt_t; /* Type to count number of disk blocks. */
+# define __blkcnt_t_defined
+# endif
+# ifndef __fsblkcnt_t_defined
+typedef __fsblkcnt64_t fsblkcnt_t; /* Type to count file system blocks. */
+# define __fsblkcnt_t_defined
+# endif
+# ifndef __fsfilcnt_t_defined
+typedef __fsfilcnt64_t fsfilcnt_t; /* Type to count file system inodes. */
+# define __fsfilcnt_t_defined
+# endif
+#endif
+
+#ifdef __USE_LARGEFILE64
+typedef __blkcnt64_t blkcnt64_t; /* Type to count number of disk blocks. */
+typedef __fsblkcnt64_t fsblkcnt64_t; /* Type to count file system blocks. */
+typedef __fsfilcnt64_t fsfilcnt64_t; /* Type to count file system inodes. */
+#endif
+
+
+/* Now add the thread types. */
+#if defined __USE_POSIX199506 || defined __USE_UNIX98
+# include <bits/pthreadtypes.h>
+#endif
+
+__END_DECLS
+
+#endif /* sys/types.h */
diff --git a/sysroot/usr/include/sys/ucontext.h b/sysroot/usr/include/sys/ucontext.h
new file mode 100644
index 0000000..b59cd29
--- /dev/null
+++ b/sysroot/usr/include/sys/ucontext.h
@@ -0,0 +1,248 @@
+/* Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H 1
+
+#include <features.h>
+#include <signal.h>
+#include <bits/wordsize.h>
+
+/* We need the signal context definitions even if they are not used
+ included in <signal.h>. */
+#include <bits/sigcontext.h>
+
+#if __WORDSIZE == 64
+
+/* Type for general register. */
+typedef long int greg_t;
+
+/* Number of general registers. */
+#define NGREG 23
+
+/* Container for all general registers. */
+typedef greg_t gregset_t[NGREG];
+
+#ifdef __USE_GNU
+/* Number of each register in the `gregset_t' array. */
+enum
+{
+ REG_R8 = 0,
+# define REG_R8 REG_R8
+ REG_R9,
+# define REG_R9 REG_R9
+ REG_R10,
+# define REG_R10 REG_R10
+ REG_R11,
+# define REG_R11 REG_R11
+ REG_R12,
+# define REG_R12 REG_R12
+ REG_R13,
+# define REG_R13 REG_R13
+ REG_R14,
+# define REG_R14 REG_R14
+ REG_R15,
+# define REG_R15 REG_R15
+ REG_RDI,
+# define REG_RDI REG_RDI
+ REG_RSI,
+# define REG_RSI REG_RSI
+ REG_RBP,
+# define REG_RBP REG_RBP
+ REG_RBX,
+# define REG_RBX REG_RBX
+ REG_RDX,
+# define REG_RDX REG_RDX
+ REG_RAX,
+# define REG_RAX REG_RAX
+ REG_RCX,
+# define REG_RCX REG_RCX
+ REG_RSP,
+# define REG_RSP REG_RSP
+ REG_RIP,
+# define REG_RIP REG_RIP
+ REG_EFL,
+# define REG_EFL REG_EFL
+ REG_CSGSFS, /* Actually short cs, gs, fs, __pad0. */
+# define REG_CSGSFS REG_CSGSFS
+ REG_ERR,
+# define REG_ERR REG_ERR
+ REG_TRAPNO,
+# define REG_TRAPNO REG_TRAPNO
+ REG_OLDMASK,
+# define REG_OLDMASK REG_OLDMASK
+ REG_CR2
+# define REG_CR2 REG_CR2
+};
+#endif
+
+struct _libc_fpxreg
+{
+ unsigned short int significand[4];
+ unsigned short int exponent;
+ unsigned short int padding[3];
+};
+
+struct _libc_xmmreg
+{
+ __uint32_t element[4];
+};
+
+struct _libc_fpstate
+{
+ /* 64-bit FXSAVE format. */
+ __uint16_t cwd;
+ __uint16_t swd;
+ __uint16_t ftw;
+ __uint16_t fop;
+ __uint64_t rip;
+ __uint64_t rdp;
+ __uint32_t mxcsr;
+ __uint32_t mxcr_mask;
+ struct _libc_fpxreg _st[8];
+ struct _libc_xmmreg _xmm[16];
+ __uint32_t padding[24];
+};
+
+/* Structure to describe FPU registers. */
+typedef struct _libc_fpstate *fpregset_t;
+
+/* Context to describe whole processor state. */
+typedef struct
+ {
+ gregset_t gregs;
+ /* Note that fpregs is a pointer. */
+ fpregset_t fpregs;
+ unsigned long __reserved1 [8];
+} mcontext_t;
+
+/* Userlevel context. */
+typedef struct ucontext
+ {
+ unsigned long int uc_flags;
+ struct ucontext *uc_link;
+ stack_t uc_stack;
+ mcontext_t uc_mcontext;
+ __sigset_t uc_sigmask;
+ struct _libc_fpstate __fpregs_mem;
+ } ucontext_t;
+
+#else /* __WORDSIZE == 32 */
+
+/* Type for general register. */
+typedef int greg_t;
+
+/* Number of general registers. */
+#define NGREG 19
+
+/* Container for all general registers. */
+typedef greg_t gregset_t[NGREG];
+
+#ifdef __USE_GNU
+/* Number of each register is the `gregset_t' array. */
+enum
+{
+ REG_GS = 0,
+# define REG_GS REG_GS
+ REG_FS,
+# define REG_FS REG_FS
+ REG_ES,
+# define REG_ES REG_ES
+ REG_DS,
+# define REG_DS REG_DS
+ REG_EDI,
+# define REG_EDI REG_EDI
+ REG_ESI,
+# define REG_ESI REG_ESI
+ REG_EBP,
+# define REG_EBP REG_EBP
+ REG_ESP,
+# define REG_ESP REG_ESP
+ REG_EBX,
+# define REG_EBX REG_EBX
+ REG_EDX,
+# define REG_EDX REG_EDX
+ REG_ECX,
+# define REG_ECX REG_ECX
+ REG_EAX,
+# define REG_EAX REG_EAX
+ REG_TRAPNO,
+# define REG_TRAPNO REG_TRAPNO
+ REG_ERR,
+# define REG_ERR REG_ERR
+ REG_EIP,
+# define REG_EIP REG_EIP
+ REG_CS,
+# define REG_CS REG_CS
+ REG_EFL,
+# define REG_EFL REG_EFL
+ REG_UESP,
+# define REG_UESP REG_UESP
+ REG_SS
+# define REG_SS REG_SS
+};
+#endif
+
+/* Definitions taken from the kernel headers. */
+struct _libc_fpreg
+{
+ unsigned short int significand[4];
+ unsigned short int exponent;
+};
+
+struct _libc_fpstate
+{
+ unsigned long int cw;
+ unsigned long int sw;
+ unsigned long int tag;
+ unsigned long int ipoff;
+ unsigned long int cssel;
+ unsigned long int dataoff;
+ unsigned long int datasel;
+ struct _libc_fpreg _st[8];
+ unsigned long int status;
+};
+
+/* Structure to describe FPU registers. */
+typedef struct _libc_fpstate *fpregset_t;
+
+/* Context to describe whole processor state. */
+typedef struct
+ {
+ gregset_t gregs;
+ /* Due to Linux's history we have to use a pointer here. The SysV/i386
+ ABI requires a struct with the values. */
+ fpregset_t fpregs;
+ unsigned long int oldmask;
+ unsigned long int cr2;
+ } mcontext_t;
+
+/* Userlevel context. */
+typedef struct ucontext
+ {
+ unsigned long int uc_flags;
+ struct ucontext *uc_link;
+ stack_t uc_stack;
+ mcontext_t uc_mcontext;
+ __sigset_t uc_sigmask;
+ struct _libc_fpstate __fpregs_mem;
+ } ucontext_t;
+
+#endif /* __WORDSIZE == 32 */
+
+#endif /* sys/ucontext.h */
diff --git a/sysroot/usr/include/sys/uio.h b/sysroot/usr/include/sys/uio.h
new file mode 100644
index 0000000..1b203f7
--- /dev/null
+++ b/sysroot/usr/include/sys/uio.h
@@ -0,0 +1,54 @@
+/* Copyright (C) 1991, 92, 96, 97, 98, 99, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_UIO_H
+#define _SYS_UIO_H 1
+
+#include <features.h>
+
+#include <sys/types.h>
+
+__BEGIN_DECLS
+
+/* This file defines `struct iovec'. */
+#include <bits/uio.h>
+
+
+/* Read data from file descriptor FD, and put the result in the
+ buffers described by IOVEC, which is a vector of COUNT `struct iovec's.
+ The buffers are filled in the order specified.
+ Operates just like `read' (see <unistd.h>) except that data are
+ put in IOVEC instead of a contiguous buffer.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern ssize_t readv (int __fd, __const struct iovec *__iovec, int __count);
+
+/* Write data pointed by the buffers described by IOVEC, which
+ is a vector of COUNT `struct iovec's, to file descriptor FD.
+ The data is written in the order specified.
+ Operates just like `write' (see <unistd.h>) except that the data
+ are taken from IOVEC instead of a contiguous buffer.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern ssize_t writev (int __fd, __const struct iovec *__iovec, int __count);
+
+__END_DECLS
+
+#endif /* sys/uio.h */
diff --git a/sysroot/usr/include/sys/ultrasound.h b/sysroot/usr/include/sys/ultrasound.h
new file mode 100644
index 0000000..a65c385
--- /dev/null
+++ b/sysroot/usr/include/sys/ultrasound.h
@@ -0,0 +1 @@
+#include <linux/ultrasound.h>
diff --git a/sysroot/usr/include/sys/un.h b/sysroot/usr/include/sys/un.h
new file mode 100644
index 0000000..1fa10e4
--- /dev/null
+++ b/sysroot/usr/include/sys/un.h
@@ -0,0 +1,47 @@
+/* Copyright (C) 1991, 1995, 1996, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_UN_H
+#define _SYS_UN_H 1
+
+#include <sys/cdefs.h>
+
+/* Get the definition of the macro to define the common sockaddr members. */
+#include <bits/sockaddr.h>
+
+__BEGIN_DECLS
+
+/* Structure describing the address of an AF_LOCAL (aka AF_UNIX) socket. */
+struct sockaddr_un
+ {
+ __SOCKADDR_COMMON (sun_);
+ char sun_path[108]; /* Path name. */
+ };
+
+
+#ifdef __USE_MISC
+# include <string.h> /* For prototype of `strlen'. */
+
+/* Evaluate to actual length of the `sockaddr_un' structure. */
+# define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \
+ + strlen ((ptr)->sun_path))
+#endif
+
+__END_DECLS
+
+#endif /* sys/un.h */
diff --git a/sysroot/usr/include/sys/unistd.h b/sysroot/usr/include/sys/unistd.h
new file mode 100644
index 0000000..1e823fb
--- /dev/null
+++ b/sysroot/usr/include/sys/unistd.h
@@ -0,0 +1 @@
+#include <unistd.h>
diff --git a/sysroot/usr/include/sys/user.h b/sysroot/usr/include/sys/user.h
new file mode 100644
index 0000000..e1f45be
--- /dev/null
+++ b/sysroot/usr/include/sys/user.h
@@ -0,0 +1,175 @@
+/* Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_USER_H
+#define _SYS_USER_H 1
+
+/* The whole purpose of this file is for GDB and GDB only. Don't read
+ too much into it. Don't use it for anything other than GDB unless
+ you know what you are doing. */
+
+#include <bits/wordsize.h>
+#include <unistd.h>
+
+#if __WORDSIZE == 64
+
+struct user_fpregs_struct
+{
+ __uint16_t cwd;
+ __uint16_t swd;
+ __uint16_t ftw;
+ __uint16_t fop;
+ __uint64_t rip;
+ __uint64_t rdp;
+ __uint32_t mxcsr;
+ __uint32_t mxcr_mask;
+ __uint32_t st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */
+ __uint32_t xmm_space[64]; /* 16*16 bytes for each XMM-reg = 256 bytes */
+ __uint32_t padding[24];
+};
+
+struct user_regs_struct
+{
+ unsigned long r15;
+ unsigned long r14;
+ unsigned long r13;
+ unsigned long r12;
+ unsigned long rbp;
+ unsigned long rbx;
+ unsigned long r11;
+ unsigned long r10;
+ unsigned long r9;
+ unsigned long r8;
+ unsigned long rax;
+ unsigned long rcx;
+ unsigned long rdx;
+ unsigned long rsi;
+ unsigned long rdi;
+ unsigned long orig_rax;
+ unsigned long rip;
+ unsigned long cs;
+ unsigned long eflags;
+ unsigned long rsp;
+ unsigned long ss;
+ unsigned long fs_base;
+ unsigned long gs_base;
+ unsigned long ds;
+ unsigned long es;
+ unsigned long fs;
+ unsigned long gs;
+};
+
+struct user
+{
+ struct user_regs_struct regs;
+ int u_fpvalid;
+ struct user_fpregs_struct i387;
+ unsigned long int u_tsize;
+ unsigned long int u_dsize;
+ unsigned long int u_ssize;
+ unsigned long start_code;
+ unsigned long start_stack;
+ long int signal;
+ int reserved;
+ struct user_regs_struct* u_ar0;
+ struct user_fpregs_struct* u_fpstate;
+ unsigned long int magic;
+ char u_comm [32];
+ unsigned long int u_debugreg [8];
+};
+
+#else
+/* These are the 32-bit x86 structures. */
+struct user_fpregs_struct
+{
+ long int cwd;
+ long int swd;
+ long int twd;
+ long int fip;
+ long int fcs;
+ long int foo;
+ long int fos;
+ long int st_space [20];
+};
+
+struct user_fpxregs_struct
+{
+ unsigned short int cwd;
+ unsigned short int swd;
+ unsigned short int twd;
+ unsigned short int fop;
+ long int fip;
+ long int fcs;
+ long int foo;
+ long int fos;
+ long int mxcsr;
+ long int reserved;
+ long int st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */
+ long int xmm_space[32]; /* 8*16 bytes for each XMM-reg = 128 bytes */
+ long int padding[56];
+};
+
+struct user_regs_struct
+{
+ long int ebx;
+ long int ecx;
+ long int edx;
+ long int esi;
+ long int edi;
+ long int ebp;
+ long int eax;
+ long int xds;
+ long int xes;
+ long int xfs;
+ long int xgs;
+ long int orig_eax;
+ long int eip;
+ long int xcs;
+ long int eflags;
+ long int esp;
+ long int xss;
+};
+
+struct user
+{
+ struct user_regs_struct regs;
+ int u_fpvalid;
+ struct user_fpregs_struct i387;
+ unsigned long int u_tsize;
+ unsigned long int u_dsize;
+ unsigned long int u_ssize;
+ unsigned long start_code;
+ unsigned long start_stack;
+ long int signal;
+ int reserved;
+ struct user_regs_struct* u_ar0;
+ struct user_fpregs_struct* u_fpstate;
+ unsigned long int magic;
+ char u_comm [32];
+ int u_debugreg [8];
+};
+#endif /* __WORDSIZE */
+
+#define PAGE_SIZE sysconf(_SC_PAGESIZE)
+#define PAGE_MASK (~(PAGE_SIZE-1))
+#define NBPG PAGE_SIZE
+#define UPAGES 1
+#define HOST_TEXT_START_ADDR (u.start_code)
+#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
+
+#endif /* _SYS_USER_H */
diff --git a/sysroot/usr/include/sys/ustat.h b/sysroot/usr/include/sys/ustat.h
new file mode 100644
index 0000000..7a9cdac
--- /dev/null
+++ b/sysroot/usr/include/sys/ustat.h
@@ -0,0 +1,38 @@
+/* Header describing obsolete `ustat' interface.
+ Copyright (C) 1996, 1998, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * This interface is obsolete. Use <sys/statfs.h> instead.
+ */
+
+#ifndef _SYS_USTAT_H
+#define _SYS_USTAT_H 1
+
+#include <features.h>
+
+#include <sys/types.h>
+#include <bits/ustat.h>
+
+__BEGIN_DECLS
+
+extern int ustat (__dev_t __dev, struct ustat *__ubuf) __THROW;
+
+__END_DECLS
+
+#endif /* sys/ustat.h */
diff --git a/sysroot/usr/include/sys/utsname.h b/sysroot/usr/include/sys/utsname.h
new file mode 100644
index 0000000..a03aab9
--- /dev/null
+++ b/sysroot/usr/include/sys/utsname.h
@@ -0,0 +1,87 @@
+/* Copyright (C) 1991,92,94,96,97,99,2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * POSIX Standard: 4.4 System Identification <sys/utsname.h>
+ */
+
+#ifndef _SYS_UTSNAME_H
+#define _SYS_UTSNAME_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+#include <bits/utsname.h>
+
+#ifndef _UTSNAME_SYSNAME_LENGTH
+# define _UTSNAME_SYSNAME_LENGTH _UTSNAME_LENGTH
+#endif
+#ifndef _UTSNAME_NODENAME_LENGTH
+# define _UTSNAME_NODENAME_LENGTH _UTSNAME_LENGTH
+#endif
+#ifndef _UTSNAME_RELEASE_LENGTH
+# define _UTSNAME_RELEASE_LENGTH _UTSNAME_LENGTH
+#endif
+#ifndef _UTSNAME_VERSION_LENGTH
+# define _UTSNAME_VERSION_LENGTH _UTSNAME_LENGTH
+#endif
+#ifndef _UTSNAME_MACHINE_LENGTH
+# define _UTSNAME_MACHINE_LENGTH _UTSNAME_LENGTH
+#endif
+
+/* Structure describing the system and machine. */
+struct utsname
+ {
+ /* Name of the implementation of the operating system. */
+ char sysname[_UTSNAME_SYSNAME_LENGTH];
+
+ /* Name of this node on the network. */
+ char nodename[_UTSNAME_NODENAME_LENGTH];
+
+ /* Current release level of this implementation. */
+ char release[_UTSNAME_RELEASE_LENGTH];
+ /* Current version level of this release. */
+ char version[_UTSNAME_VERSION_LENGTH];
+
+ /* Name of the hardware type the system is running on. */
+ char machine[_UTSNAME_MACHINE_LENGTH];
+
+#if _UTSNAME_DOMAIN_LENGTH - 0
+ /* Name of the domain of this node on the network. */
+# ifdef __USE_GNU
+ char domainname[_UTSNAME_DOMAIN_LENGTH];
+# else
+ char __domainname[_UTSNAME_DOMAIN_LENGTH];
+# endif
+#endif
+ };
+
+#ifdef __USE_SVID
+/* Note that SVID assumes all members have the same size. */
+# define SYS_NMLN _UTSNAME_LENGTH
+#endif
+
+
+/* Put information about the system in NAME. */
+extern int uname (struct utsname *__name) __THROW;
+
+
+__END_DECLS
+
+#endif /* sys/utsname.h */
diff --git a/sysroot/usr/include/sys/vfs.h b/sysroot/usr/include/sys/vfs.h
new file mode 100644
index 0000000..fa22d31
--- /dev/null
+++ b/sysroot/usr/include/sys/vfs.h
@@ -0,0 +1,4 @@
+/* Other systems declare `struct statfs' et al in <sys/vfs.h>,
+ so we have this file to be compatible with programs expecting it. */
+
+#include <sys/statfs.h>
diff --git a/sysroot/usr/include/sys/vlimit.h b/sysroot/usr/include/sys/vlimit.h
new file mode 100644
index 0000000..2f7a09a
--- /dev/null
+++ b/sysroot/usr/include/sys/vlimit.h
@@ -0,0 +1,68 @@
+/* Copyright (C) 1991, 1992, 1996, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_VLIMIT_H
+#define _SYS_VLIMIT_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* This interface is obsolete, and is superseded by <sys/resource.h>. */
+
+/* Kinds of resource limit. */
+enum __vlimit_resource
+{
+ /* Setting this non-zero makes it impossible to raise limits.
+ Only the super-use can set it to zero.
+
+ This is not implemented in recent versions of BSD, nor by
+ the GNU C library. */
+ LIM_NORAISE,
+
+ /* CPU time available for each process (seconds). */
+ LIM_CPU,
+
+ /* Largest file which can be created (bytes). */
+ LIM_FSIZE,
+
+ /* Maximum size of the data segment (bytes). */
+ LIM_DATA,
+
+ /* Maximum size of the stack segment (bytes). */
+ LIM_STACK,
+
+ /* Largest core file that will be created (bytes). */
+ LIM_CORE,
+
+ /* Resident set size (bytes). */
+ LIM_MAXRSS
+};
+
+/* This means no limit. */
+#define INFINITY 0x7fffffff
+
+
+/* Set the soft limit for RESOURCE to be VALUE.
+ Returns 0 for success, -1 for failure. */
+extern int vlimit (enum __vlimit_resource __resource, int __value) __THROW;
+
+
+__END_DECLS
+
+#endif /* sys/vlimit.h */
diff --git a/sysroot/usr/include/sys/vm86.h b/sysroot/usr/include/sys/vm86.h
new file mode 100644
index 0000000..4c5152c
--- /dev/null
+++ b/sysroot/usr/include/sys/vm86.h
@@ -0,0 +1,35 @@
+/* Copyright (C) 1996, 1999, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_VM86_H
+
+#define _SYS_VM86_H 1
+#include <features.h>
+
+/* Get constants and data types from kernel header file. */
+#include <asm/vm86.h>
+
+__BEGIN_DECLS
+
+/* Enter virtual 8086 mode. */
+extern int vm86 (unsigned long int __subfunction,
+ struct vm86plus_struct *__info) __THROW;
+
+__END_DECLS
+
+#endif /* _SYS_VM86_H */
diff --git a/sysroot/usr/include/sys/vt.h b/sysroot/usr/include/sys/vt.h
new file mode 100644
index 0000000..834abfb
--- /dev/null
+++ b/sysroot/usr/include/sys/vt.h
@@ -0,0 +1 @@
+#include <linux/vt.h>
diff --git a/sysroot/usr/include/sys/vtimes.h b/sysroot/usr/include/sys/vtimes.h
new file mode 100644
index 0000000..b57f3a7
--- /dev/null
+++ b/sysroot/usr/include/sys/vtimes.h
@@ -0,0 +1,69 @@
+/* Copyright (C) 1991, 1992, 1996, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_VTIMES_H
+#define _SYS_VTIMES_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* This interface is obsolete; use `getrusage' instead. */
+
+/* Granularity of the `vm_utime' and `vm_stime' fields of a `struct vtimes'.
+ (This is the frequency of the machine's power supply, in Hz.) */
+#define VTIMES_UNITS_PER_SECOND 60
+
+struct vtimes
+{
+ /* User time used in units of 1/VTIMES_UNITS_PER_SECOND seconds. */
+ int vm_utime;
+ /* System time used in units of 1/VTIMES_UNITS_PER_SECOND seconds. */
+ int vm_stime;
+
+ /* Amount of data and stack memory used (kilobyte-seconds). */
+ unsigned int vm_idsrss;
+ /* Amount of text memory used (kilobyte-seconds). */
+ unsigned int vm_ixrss;
+ /* Maximum resident set size (text, data, and stack) (kilobytes). */
+ int vm_maxrss;
+
+ /* Number of hard page faults (i.e. those that required I/O). */
+ int vm_majflt;
+ /* Number of soft page faults (i.e. those serviced by reclaiming
+ a page from the list of pages awaiting reallocation. */
+ int vm_minflt;
+
+ /* Number of times a process was swapped out of physical memory. */
+ int vm_nswap;
+
+ /* Number of input operations via the file system. Note: This
+ and `ru_oublock' do not include operations with the cache. */
+ int vm_inblk;
+ /* Number of output operations via the file system. */
+ int vm_oublk;
+};
+
+/* If CURRENT is not NULL, write statistics for the current process into
+ *CURRENT. If CHILD is not NULL, write statistics for all terminated child
+ processes into *CHILD. Returns 0 for success, -1 for failure. */
+extern int vtimes (struct vtimes * __current, struct vtimes * __child) __THROW;
+
+__END_DECLS
+
+#endif /* sys/vtimes.h */
diff --git a/sysroot/usr/include/sys/wait.h b/sysroot/usr/include/sys/wait.h
new file mode 100644
index 0000000..fe10357
--- /dev/null
+++ b/sysroot/usr/include/sys/wait.h
@@ -0,0 +1,182 @@
+/* Copyright (C) 1991-1994,1996-2001,2003,2004,2005,2007
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * POSIX Standard: 3.2.1 Wait for Process Termination <sys/wait.h>
+ */
+
+#ifndef _SYS_WAIT_H
+#define _SYS_WAIT_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+#include <signal.h>
+#include <sys/resource.h>
+
+/* These macros could also be defined in <stdlib.h>. */
+#if !defined _STDLIB_H || !defined __USE_XOPEN
+/* This will define the `W*' macros for the flag
+ bits to `waitpid', `wait3', and `wait4'. */
+# include <bits/waitflags.h>
+
+# ifdef __USE_BSD
+
+/* Lots of hair to allow traditional BSD use of `union wait'
+ as well as POSIX.1 use of `int' for the status word. */
+
+# if defined __GNUC__ && !defined __cplusplus
+# define __WAIT_INT(status) \
+ (__extension__ (((union { __typeof(status) __in; int __i; }) \
+ { .__in = (status) }).__i))
+# else
+# define __WAIT_INT(status) (*(__const int *) &(status))
+# endif
+
+/* This is the type of the argument to `wait'. The funky union
+ causes redeclarations with ether `int *' or `union wait *' to be
+ allowed without complaint. __WAIT_STATUS_DEFN is the type used in
+ the actual function definitions. */
+
+# if !defined __GNUC__ || __GNUC__ < 2 || defined __cplusplus
+# define __WAIT_STATUS void *
+# define __WAIT_STATUS_DEFN void *
+# else
+/* This works in GCC 2.6.1 and later. */
+typedef union
+ {
+ union wait *__uptr;
+ int *__iptr;
+ } __WAIT_STATUS __attribute__ ((__transparent_union__));
+# define __WAIT_STATUS_DEFN int *
+# endif
+
+# else /* Don't use BSD. */
+
+# define __WAIT_INT(status) (status)
+# define __WAIT_STATUS int *
+# define __WAIT_STATUS_DEFN int *
+
+# endif /* Use BSD. */
+
+/* This will define all the `__W*' macros. */
+# include <bits/waitstatus.h>
+
+# define WEXITSTATUS(status) __WEXITSTATUS(__WAIT_INT(status))
+# define WTERMSIG(status) __WTERMSIG(__WAIT_INT(status))
+# define WSTOPSIG(status) __WSTOPSIG(__WAIT_INT(status))
+# define WIFEXITED(status) __WIFEXITED(__WAIT_INT(status))
+# define WIFSIGNALED(status) __WIFSIGNALED(__WAIT_INT(status))
+# define WIFSTOPPED(status) __WIFSTOPPED(__WAIT_INT(status))
+# ifdef __WIFCONTINUED
+# define WIFCONTINUED(status) __WIFCONTINUED(__WAIT_INT(status))
+# endif
+#endif /* <stdlib.h> not included. */
+
+#ifdef __USE_BSD
+# define WCOREFLAG __WCOREFLAG
+# define WCOREDUMP(status) __WCOREDUMP(__WAIT_INT(status))
+# define W_EXITCODE(ret, sig) __W_EXITCODE(ret, sig)
+# define W_STOPCODE(sig) __W_STOPCODE(sig)
+#endif
+
+/* The following values are used by the `waitid' function. */
+#if defined __USE_SVID || defined __USE_XOPEN
+typedef enum
+{
+ P_ALL, /* Wait for any child. */
+ P_PID, /* Wait for specified process. */
+ P_PGID /* Wait for members of process group. */
+} idtype_t;
+#endif
+
+
+/* Wait for a child to die. When one does, put its status in *STAT_LOC
+ and return its process ID. For errors, return (pid_t) -1.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern __pid_t wait (__WAIT_STATUS __stat_loc);
+
+#ifdef __USE_BSD
+/* Special values for the PID argument to `waitpid' and `wait4'. */
+# define WAIT_ANY (-1) /* Any process. */
+# define WAIT_MYPGRP 0 /* Any process in my process group. */
+#endif
+
+/* Wait for a child matching PID to die.
+ If PID is greater than 0, match any process whose process ID is PID.
+ If PID is (pid_t) -1, match any process.
+ If PID is (pid_t) 0, match any process with the
+ same process group as the current process.
+ If PID is less than -1, match any process whose
+ process group is the absolute value of PID.
+ If the WNOHANG bit is set in OPTIONS, and that child
+ is not already dead, return (pid_t) 0. If successful,
+ return PID and store the dead child's status in STAT_LOC.
+ Return (pid_t) -1 for errors. If the WUNTRACED bit is
+ set in OPTIONS, return status for stopped children; otherwise don't.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern __pid_t waitpid (__pid_t __pid, int *__stat_loc, int __options);
+
+#if defined __USE_SVID || defined __USE_XOPEN
+# define __need_siginfo_t
+# include <bits/siginfo.h>
+/* Wait for a childing matching IDTYPE and ID to change the status and
+ place appropriate information in *INFOP.
+ If IDTYPE is P_PID, match any process whose process ID is ID.
+ If IDTYPE is P_PGID, match any process whose process group is ID.
+ If IDTYPE is P_ALL, match any process.
+ If the WNOHANG bit is set in OPTIONS, and that child
+ is not already dead, clear *INFOP and return 0. If successful, store
+ exit code and status in *INFOP.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int waitid (idtype_t __idtype, __id_t __id, siginfo_t *__infop,
+ int __options);
+#endif
+
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+/* This being here makes the prototypes valid whether or not
+ we have already included <sys/resource.h> to define `struct rusage'. */
+struct rusage;
+
+/* Wait for a child to exit. When one does, put its status in *STAT_LOC and
+ return its process ID. For errors return (pid_t) -1. If USAGE is not
+ nil, store information about the child's resource usage there. If the
+ WUNTRACED bit is set in OPTIONS, return status for stopped children;
+ otherwise don't. */
+extern __pid_t wait3 (__WAIT_STATUS __stat_loc, int __options,
+ struct rusage * __usage) __THROW;
+#endif
+
+#ifdef __USE_BSD
+/* PID is like waitpid. Other args are like wait3. */
+extern __pid_t wait4 (__pid_t __pid, __WAIT_STATUS __stat_loc, int __options,
+ struct rusage *__usage) __THROW;
+#endif /* Use BSD. */
+
+
+__END_DECLS
+
+#endif /* sys/wait.h */
diff --git a/sysroot/usr/include/sys/xattr.h b/sysroot/usr/include/sys/xattr.h
new file mode 100644
index 0000000..2737f90
--- /dev/null
+++ b/sysroot/usr/include/sys/xattr.h
@@ -0,0 +1,104 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_XATTR_H
+#define _SYS_XATTR_H 1
+
+#include <features.h>
+#include <sys/types.h>
+
+
+__BEGIN_DECLS
+
+/* The following constants should be used for the fifth parameter of
+ `*setxattr'. */
+enum
+{
+ XATTR_CREATE = 1, /* set value, fail if attr already exists. */
+#define XATTR_CREATE XATTR_CREATE
+ XATTR_REPLACE = 2 /* set value, fail if attr does not exist. */
+#define XATTR_REPLACE XATTR_REPLACE
+};
+
+/* Set the attribute NAME of the file pointed to by PATH to VALUE (which
+ is SIZE bytes long). Return 0 on success, -1 for errors. */
+extern int setxattr (__const char *__path, __const char *__name,
+ __const void *__value, size_t __size, int __flags)
+ __THROW;
+
+/* Set the attribute NAME of the file pointed to by PATH to VALUE (which is
+ SIZE bytes long), not following symlinks for the last pathname component.
+ Return 0 on success, -1 for errors. */
+extern int lsetxattr (__const char *__path, __const char *__name,
+ __const void *__value, size_t __size, int __flags)
+ __THROW;
+
+/* Set the attribute NAME of the file descriptor FD to VALUE (which is SIZE
+ bytes long). Return 0 on success, -1 for errors. */
+extern int fsetxattr (int __fd, __const char *__name, __const void *__value,
+ size_t __size, int __flags) __THROW;
+
+/* Get the attribute NAME of the file pointed to by PATH to VALUE (which is
+ SIZE bytes long). Return 0 on success, -1 for errors. */
+extern ssize_t getxattr (__const char *__path, __const char *__name,
+ void *__value, size_t __size) __THROW;
+
+/* Get the attribute NAME of the file pointed to by PATH to VALUE (which is
+ SIZE bytes long), not following symlinks for the last pathname component.
+ Return 0 on success, -1 for errors. */
+extern ssize_t lgetxattr (__const char *__path, __const char *__name,
+ void *__value, size_t __size) __THROW;
+
+/* Get the attribute NAME of the file descriptor FD to VALUE (which is SIZE
+ bytes long). Return 0 on success, -1 for errors. */
+extern ssize_t fgetxattr (int __fd, __const char *__name, void *__value,
+ size_t __size) __THROW;
+
+/* List attributes of the file pointed to by PATH into the user-supplied
+ buffer LIST (which is SIZE bytes big). Return 0 on success, -1 for
+ errors. */
+extern ssize_t listxattr (__const char *__path, char *__list, size_t __size)
+ __THROW;
+
+/* List attributes of the file pointed to by PATH into the user-supplied
+ buffer LIST (which is SIZE bytes big), not following symlinks for the
+ last pathname component. Return 0 on success, -1 for errors. */
+extern ssize_t llistxattr (__const char *__path, char *__list, size_t __size)
+ __THROW;
+
+/* List attributes of the file descriptor FD into the user-supplied buffer
+ LIST (which is SIZE bytes big). Return 0 on success, -1 for errors. */
+extern ssize_t flistxattr (int __fd, char *__list, size_t __size)
+ __THROW;
+
+/* Remove the attribute NAME from the file pointed to by PATH. Return 0
+ on success, -1 for errors. */
+extern int removexattr (__const char *__path, __const char *__name) __THROW;
+
+/* Remove the attribute NAME from the file pointed to by PATH, not
+ following symlinks for the last pathname component. Return 0 on
+ success, -1 for errors. */
+extern int lremovexattr (__const char *__path, __const char *__name) __THROW;
+
+/* Remove the attribute NAME from the file descriptor FD. Return 0 on
+ success, -1 for errors. */
+extern int fremovexattr (int __fd, __const char *__name) __THROW;
+
+__END_DECLS
+
+#endif /* sys/xattr.h */
diff --git a/sysroot/usr/include/syscall.h b/sysroot/usr/include/syscall.h
new file mode 100644
index 0000000..4c30578
--- /dev/null
+++ b/sysroot/usr/include/syscall.h
@@ -0,0 +1 @@
+#include <sys/syscall.h>
diff --git a/sysroot/usr/include/sysexits.h b/sysroot/usr/include/sysexits.h
new file mode 100644
index 0000000..37246b6
--- /dev/null
+++ b/sysroot/usr/include/sysexits.h
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 1987, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)sysexits.h 8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _SYSEXITS_H
+#define _SYSEXITS_H 1
+
+/*
+ * SYSEXITS.H -- Exit status codes for system programs.
+ *
+ * This include file attempts to categorize possible error
+ * exit statuses for system programs, notably delivermail
+ * and the Berkeley network.
+ *
+ * Error numbers begin at EX__BASE to reduce the possibility of
+ * clashing with other exit statuses that random programs may
+ * already return. The meaning of the codes is approximately
+ * as follows:
+ *
+ * EX_USAGE -- The command was used incorrectly, e.g., with
+ * the wrong number of arguments, a bad flag, a bad
+ * syntax in a parameter, or whatever.
+ * EX_DATAERR -- The input data was incorrect in some way.
+ * This should only be used for user's data & not
+ * system files.
+ * EX_NOINPUT -- An input file (not a system file) did not
+ * exist or was not readable. This could also include
+ * errors like "No message" to a mailer (if it cared
+ * to catch it).
+ * EX_NOUSER -- The user specified did not exist. This might
+ * be used for mail addresses or remote logins.
+ * EX_NOHOST -- The host specified did not exist. This is used
+ * in mail addresses or network requests.
+ * EX_UNAVAILABLE -- A service is unavailable. This can occur
+ * if a support program or file does not exist. This
+ * can also be used as a catchall message when something
+ * you wanted to do doesn't work, but you don't know
+ * why.
+ * EX_SOFTWARE -- An internal software error has been detected.
+ * This should be limited to non-operating system related
+ * errors as possible.
+ * EX_OSERR -- An operating system error has been detected.
+ * This is intended to be used for such things as "cannot
+ * fork", "cannot create pipe", or the like. It includes
+ * things like getuid returning a user that does not
+ * exist in the passwd file.
+ * EX_OSFILE -- Some system file (e.g., /etc/passwd, /etc/utmp,
+ * etc.) does not exist, cannot be opened, or has some
+ * sort of error (e.g., syntax error).
+ * EX_CANTCREAT -- A (user specified) output file cannot be
+ * created.
+ * EX_IOERR -- An error occurred while doing I/O on some file.
+ * EX_TEMPFAIL -- temporary failure, indicating something that
+ * is not really an error. In sendmail, this means
+ * that a mailer (e.g.) could not create a connection,
+ * and the request should be reattempted later.
+ * EX_PROTOCOL -- the remote system returned something that
+ * was "not possible" during a protocol exchange.
+ * EX_NOPERM -- You did not have sufficient permission to
+ * perform the operation. This is not intended for
+ * file system problems, which should use NOINPUT or
+ * CANTCREAT, but rather for higher level permissions.
+ */
+
+#define EX_OK 0 /* successful termination */
+
+#define EX__BASE 64 /* base value for error messages */
+
+#define EX_USAGE 64 /* command line usage error */
+#define EX_DATAERR 65 /* data format error */
+#define EX_NOINPUT 66 /* cannot open input */
+#define EX_NOUSER 67 /* addressee unknown */
+#define EX_NOHOST 68 /* host name unknown */
+#define EX_UNAVAILABLE 69 /* service unavailable */
+#define EX_SOFTWARE 70 /* internal software error */
+#define EX_OSERR 71 /* system error (e.g., can't fork) */
+#define EX_OSFILE 72 /* critical OS file missing */
+#define EX_CANTCREAT 73 /* can't create (user) output file */
+#define EX_IOERR 74 /* input/output error */
+#define EX_TEMPFAIL 75 /* temp failure; user is invited to retry */
+#define EX_PROTOCOL 76 /* remote error in protocol */
+#define EX_NOPERM 77 /* permission denied */
+#define EX_CONFIG 78 /* configuration error */
+
+#define EX__MAX 78 /* maximum listed value */
+
+#endif /* sysexits.h */
diff --git a/sysroot/usr/include/syslog.h b/sysroot/usr/include/syslog.h
new file mode 100644
index 0000000..830b492
--- /dev/null
+++ b/sysroot/usr/include/syslog.h
@@ -0,0 +1 @@
+#include <sys/syslog.h>
diff --git a/sysroot/usr/include/tar.h b/sysroot/usr/include/tar.h
new file mode 100644
index 0000000..ddfef75
--- /dev/null
+++ b/sysroot/usr/include/tar.h
@@ -0,0 +1,108 @@
+/* Extended tar format from POSIX.1.
+ Copyright (C) 1992, 1996 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Written by David J. MacKenzie.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _TAR_H
+#define _TAR_H 1
+
+/* A tar archive consists of 512-byte blocks.
+ Each file in the archive has a header block followed by 0+ data blocks.
+ Two blocks of NUL bytes indicate the end of the archive. */
+
+/* The fields of header blocks:
+ All strings are stored as ISO 646 (approximately ASCII) strings.
+
+ Fields are numeric unless otherwise noted below; numbers are ISO 646
+ representations of octal numbers, with leading zeros as needed.
+
+ linkname is only valid when typeflag==LNKTYPE. It doesn't use prefix;
+ files that are links to pathnames >100 chars long can not be stored
+ in a tar archive.
+
+ If typeflag=={LNKTYPE,SYMTYPE,DIRTYPE} then size must be 0.
+
+ devmajor and devminor are only valid for typeflag=={BLKTYPE,CHRTYPE}.
+
+ chksum contains the sum of all 512 bytes in the header block,
+ treating each byte as an 8-bit unsigned value and treating the
+ 8 bytes of chksum as blank characters.
+
+ uname and gname are used in preference to uid and gid, if those
+ names exist locally.
+
+ Field Name Byte Offset Length in Bytes Field Type
+ name 0 100 NUL-terminated if NUL fits
+ mode 100 8
+ uid 108 8
+ gid 116 8
+ size 124 12
+ mtime 136 12
+ chksum 148 8
+ typeflag 156 1 see below
+ linkname 157 100 NUL-terminated if NUL fits
+ magic 257 6 must be TMAGIC (NUL term.)
+ version 263 2 must be TVERSION
+ uname 265 32 NUL-terminated
+ gname 297 32 NUL-terminated
+ devmajor 329 8
+ devminor 337 8
+ prefix 345 155 NUL-terminated if NUL fits
+
+ If the first character of prefix is '\0', the file name is name;
+ otherwise, it is prefix/name. Files whose pathnames don't fit in that
+ length can not be stored in a tar archive. */
+
+/* The bits in mode: */
+#define TSUID 04000
+#define TSGID 02000
+#define TSVTX 01000
+#define TUREAD 00400
+#define TUWRITE 00200
+#define TUEXEC 00100
+#define TGREAD 00040
+#define TGWRITE 00020
+#define TGEXEC 00010
+#define TOREAD 00004
+#define TOWRITE 00002
+#define TOEXEC 00001
+
+/* The values for typeflag:
+ Values 'A'-'Z' are reserved for custom implementations.
+ All other values are reserved for future POSIX.1 revisions. */
+
+#define REGTYPE '0' /* Regular file (preferred code). */
+#define AREGTYPE '\0' /* Regular file (alternate code). */
+#define LNKTYPE '1' /* Hard link. */
+#define SYMTYPE '2' /* Symbolic link (hard if not supported). */
+#define CHRTYPE '3' /* Character special. */
+#define BLKTYPE '4' /* Block special. */
+#define DIRTYPE '5' /* Directory. */
+#define FIFOTYPE '6' /* Named pipe. */
+#define CONTTYPE '7' /* Contiguous file */
+ /* (regular file if not supported). */
+
+/* Contents of magic field and its length. */
+#define TMAGIC "ustar"
+#define TMAGLEN 6
+
+/* Contents of the version field and its length. */
+#define TVERSION "00"
+#define TVERSLEN 2
+
+#endif /* tar.h */
diff --git a/sysroot/usr/include/term.h b/sysroot/usr/include/term.h
new file mode 100644
index 0000000..0f09f90
--- /dev/null
+++ b/sysroot/usr/include/term.h
@@ -0,0 +1,790 @@
+/****************************************************************************
+ * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************/
+/* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 */
+/* and: Eric S. Raymond <esr@snark.thyrsus.com> */
+/* and: Thomas E. Dickey 1995-on */
+/****************************************************************************/
+
+/* $Id: MKterm.h.awk.in,v 1.49 2007/08/18 11:44:26 tom Exp $ */
+
+/*
+** term.h -- Definition of struct term
+*/
+
+#ifndef NCURSES_TERM_H_incl
+#define NCURSES_TERM_H_incl 1
+
+#undef NCURSES_VERSION
+#define NCURSES_VERSION "5.6"
+
+#include <ncurses_dll.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Make this file self-contained by providing defaults for the HAVE_TERMIO[S]_H
+ * definition (based on the system for which this was configured).
+ */
+
+#undef NCURSES_CONST
+#define NCURSES_CONST const
+
+#undef NCURSES_SBOOL
+#define NCURSES_SBOOL char
+
+#undef NCURSES_XNAMES
+#define NCURSES_XNAMES 1
+
+/* We will use these symbols to hide differences between
+ * termios/termio/sgttyb interfaces.
+ */
+#undef TTY
+#undef SET_TTY
+#undef GET_TTY
+
+/* Assume POSIX termio if we have the header and function */
+/* #if HAVE_TERMIOS_H && HAVE_TCGETATTR */
+#if 1 && 1
+
+#undef TERMIOS
+#define TERMIOS 1
+
+#include <termios.h>
+#define TTY struct termios
+
+#else /* !HAVE_TERMIOS_H */
+
+/* #if HAVE_TERMIO_H */
+#if 1
+
+#undef TERMIOS
+#define TERMIOS 1
+
+#include <termio.h>
+#define TTY struct termio
+
+/* Add definitions to make termio look like termios.
+ * But ifdef it, since there are some implementations
+ * that try to do this for us in a fake <termio.h>.
+ */
+#ifndef TCSANOW
+#define TCSANOW TCSETA
+#endif
+#ifndef TCSADRAIN
+#define TCSADRAIN TCSETAW
+#endif
+#ifndef TCSAFLUSH
+#define TCSAFLUSH TCSETAF
+#endif
+#ifndef tcsetattr
+#define tcsetattr(fd, cmd, arg) ioctl(fd, cmd, arg)
+#endif
+#ifndef tcgetattr
+#define tcgetattr(fd, arg) ioctl(fd, TCGETA, arg)
+#endif
+#ifndef cfgetospeed
+#define cfgetospeed(t) ((t)->c_cflag & CBAUD)
+#endif
+#ifndef TCIFLUSH
+#define TCIFLUSH 0
+#endif
+#ifndef TCOFLUSH
+#define TCOFLUSH 1
+#endif
+#ifndef TCIOFLUSH
+#define TCIOFLUSH 2
+#endif
+#ifndef tcflush
+#define tcflush(fd, arg) ioctl(fd, TCFLSH, arg)
+#endif
+
+#else /* !HAVE_TERMIO_H */
+
+#undef TERMIOS
+#include <sgtty.h>
+#include <sys/ioctl.h>
+#define TTY struct sgttyb
+
+#endif /* HAVE_TERMIO_H */
+
+#endif /* HAVE_TERMIOS_H */
+
+#ifdef TERMIOS
+#define GET_TTY(fd, buf) tcgetattr(fd, buf)
+#define SET_TTY(fd, buf) tcsetattr(fd, TCSADRAIN, buf)
+#else
+#define GET_TTY(fd, buf) gtty(fd, buf)
+#define SET_TTY(fd, buf) stty(fd, buf)
+#endif
+
+#define NAMESIZE 256
+
+#define CUR cur_term->type.
+
+#define auto_left_margin CUR Booleans[0]
+#define auto_right_margin CUR Booleans[1]
+#define no_esc_ctlc CUR Booleans[2]
+#define ceol_standout_glitch CUR Booleans[3]
+#define eat_newline_glitch CUR Booleans[4]
+#define erase_overstrike CUR Booleans[5]
+#define generic_type CUR Booleans[6]
+#define hard_copy CUR Booleans[7]
+#define has_meta_key CUR Booleans[8]
+#define has_status_line CUR Booleans[9]
+#define insert_null_glitch CUR Booleans[10]
+#define memory_above CUR Booleans[11]
+#define memory_below CUR Booleans[12]
+#define move_insert_mode CUR Booleans[13]
+#define move_standout_mode CUR Booleans[14]
+#define over_strike CUR Booleans[15]
+#define status_line_esc_ok CUR Booleans[16]
+#define dest_tabs_magic_smso CUR Booleans[17]
+#define tilde_glitch CUR Booleans[18]
+#define transparent_underline CUR Booleans[19]
+#define xon_xoff CUR Booleans[20]
+#define needs_xon_xoff CUR Booleans[21]
+#define prtr_silent CUR Booleans[22]
+#define hard_cursor CUR Booleans[23]
+#define non_rev_rmcup CUR Booleans[24]
+#define no_pad_char CUR Booleans[25]
+#define non_dest_scroll_region CUR Booleans[26]
+#define can_change CUR Booleans[27]
+#define back_color_erase CUR Booleans[28]
+#define hue_lightness_saturation CUR Booleans[29]
+#define col_addr_glitch CUR Booleans[30]
+#define cr_cancels_micro_mode CUR Booleans[31]
+#define has_print_wheel CUR Booleans[32]
+#define row_addr_glitch CUR Booleans[33]
+#define semi_auto_right_margin CUR Booleans[34]
+#define cpi_changes_res CUR Booleans[35]
+#define lpi_changes_res CUR Booleans[36]
+#define columns CUR Numbers[0]
+#define init_tabs CUR Numbers[1]
+#define lines CUR Numbers[2]
+#define lines_of_memory CUR Numbers[3]
+#define magic_cookie_glitch CUR Numbers[4]
+#define padding_baud_rate CUR Numbers[5]
+#define virtual_terminal CUR Numbers[6]
+#define width_status_line CUR Numbers[7]
+#define num_labels CUR Numbers[8]
+#define label_height CUR Numbers[9]
+#define label_width CUR Numbers[10]
+#define max_attributes CUR Numbers[11]
+#define maximum_windows CUR Numbers[12]
+#define max_colors CUR Numbers[13]
+#define max_pairs CUR Numbers[14]
+#define no_color_video CUR Numbers[15]
+#define buffer_capacity CUR Numbers[16]
+#define dot_vert_spacing CUR Numbers[17]
+#define dot_horz_spacing CUR Numbers[18]
+#define max_micro_address CUR Numbers[19]
+#define max_micro_jump CUR Numbers[20]
+#define micro_col_size CUR Numbers[21]
+#define micro_line_size CUR Numbers[22]
+#define number_of_pins CUR Numbers[23]
+#define output_res_char CUR Numbers[24]
+#define output_res_line CUR Numbers[25]
+#define output_res_horz_inch CUR Numbers[26]
+#define output_res_vert_inch CUR Numbers[27]
+#define print_rate CUR Numbers[28]
+#define wide_char_size CUR Numbers[29]
+#define buttons CUR Numbers[30]
+#define bit_image_entwining CUR Numbers[31]
+#define bit_image_type CUR Numbers[32]
+#define back_tab CUR Strings[0]
+#define bell CUR Strings[1]
+#define carriage_return CUR Strings[2]
+#define change_scroll_region CUR Strings[3]
+#define clear_all_tabs CUR Strings[4]
+#define clear_screen CUR Strings[5]
+#define clr_eol CUR Strings[6]
+#define clr_eos CUR Strings[7]
+#define column_address CUR Strings[8]
+#define command_character CUR Strings[9]
+#define cursor_address CUR Strings[10]
+#define cursor_down CUR Strings[11]
+#define cursor_home CUR Strings[12]
+#define cursor_invisible CUR Strings[13]
+#define cursor_left CUR Strings[14]
+#define cursor_mem_address CUR Strings[15]
+#define cursor_normal CUR Strings[16]
+#define cursor_right CUR Strings[17]
+#define cursor_to_ll CUR Strings[18]
+#define cursor_up CUR Strings[19]
+#define cursor_visible CUR Strings[20]
+#define delete_character CUR Strings[21]
+#define delete_line CUR Strings[22]
+#define dis_status_line CUR Strings[23]
+#define down_half_line CUR Strings[24]
+#define enter_alt_charset_mode CUR Strings[25]
+#define enter_blink_mode CUR Strings[26]
+#define enter_bold_mode CUR Strings[27]
+#define enter_ca_mode CUR Strings[28]
+#define enter_delete_mode CUR Strings[29]
+#define enter_dim_mode CUR Strings[30]
+#define enter_insert_mode CUR Strings[31]
+#define enter_secure_mode CUR Strings[32]
+#define enter_protected_mode CUR Strings[33]
+#define enter_reverse_mode CUR Strings[34]
+#define enter_standout_mode CUR Strings[35]
+#define enter_underline_mode CUR Strings[36]
+#define erase_chars CUR Strings[37]
+#define exit_alt_charset_mode CUR Strings[38]
+#define exit_attribute_mode CUR Strings[39]
+#define exit_ca_mode CUR Strings[40]
+#define exit_delete_mode CUR Strings[41]
+#define exit_insert_mode CUR Strings[42]
+#define exit_standout_mode CUR Strings[43]
+#define exit_underline_mode CUR Strings[44]
+#define flash_screen CUR Strings[45]
+#define form_feed CUR Strings[46]
+#define from_status_line CUR Strings[47]
+#define init_1string CUR Strings[48]
+#define init_2string CUR Strings[49]
+#define init_3string CUR Strings[50]
+#define init_file CUR Strings[51]
+#define insert_character CUR Strings[52]
+#define insert_line CUR Strings[53]
+#define insert_padding CUR Strings[54]
+#define key_backspace CUR Strings[55]
+#define key_catab CUR Strings[56]
+#define key_clear CUR Strings[57]
+#define key_ctab CUR Strings[58]
+#define key_dc CUR Strings[59]
+#define key_dl CUR Strings[60]
+#define key_down CUR Strings[61]
+#define key_eic CUR Strings[62]
+#define key_eol CUR Strings[63]
+#define key_eos CUR Strings[64]
+#define key_f0 CUR Strings[65]
+#define key_f1 CUR Strings[66]
+#define key_f10 CUR Strings[67]
+#define key_f2 CUR Strings[68]
+#define key_f3 CUR Strings[69]
+#define key_f4 CUR Strings[70]
+#define key_f5 CUR Strings[71]
+#define key_f6 CUR Strings[72]
+#define key_f7 CUR Strings[73]
+#define key_f8 CUR Strings[74]
+#define key_f9 CUR Strings[75]
+#define key_home CUR Strings[76]
+#define key_ic CUR Strings[77]
+#define key_il CUR Strings[78]
+#define key_left CUR Strings[79]
+#define key_ll CUR Strings[80]
+#define key_npage CUR Strings[81]
+#define key_ppage CUR Strings[82]
+#define key_right CUR Strings[83]
+#define key_sf CUR Strings[84]
+#define key_sr CUR Strings[85]
+#define key_stab CUR Strings[86]
+#define key_up CUR Strings[87]
+#define keypad_local CUR Strings[88]
+#define keypad_xmit CUR Strings[89]
+#define lab_f0 CUR Strings[90]
+#define lab_f1 CUR Strings[91]
+#define lab_f10 CUR Strings[92]
+#define lab_f2 CUR Strings[93]
+#define lab_f3 CUR Strings[94]
+#define lab_f4 CUR Strings[95]
+#define lab_f5 CUR Strings[96]
+#define lab_f6 CUR Strings[97]
+#define lab_f7 CUR Strings[98]
+#define lab_f8 CUR Strings[99]
+#define lab_f9 CUR Strings[100]
+#define meta_off CUR Strings[101]
+#define meta_on CUR Strings[102]
+#define newline CUR Strings[103]
+#define pad_char CUR Strings[104]
+#define parm_dch CUR Strings[105]
+#define parm_delete_line CUR Strings[106]
+#define parm_down_cursor CUR Strings[107]
+#define parm_ich CUR Strings[108]
+#define parm_index CUR Strings[109]
+#define parm_insert_line CUR Strings[110]
+#define parm_left_cursor CUR Strings[111]
+#define parm_right_cursor CUR Strings[112]
+#define parm_rindex CUR Strings[113]
+#define parm_up_cursor CUR Strings[114]
+#define pkey_key CUR Strings[115]
+#define pkey_local CUR Strings[116]
+#define pkey_xmit CUR Strings[117]
+#define print_screen CUR Strings[118]
+#define prtr_off CUR Strings[119]
+#define prtr_on CUR Strings[120]
+#define repeat_char CUR Strings[121]
+#define reset_1string CUR Strings[122]
+#define reset_2string CUR Strings[123]
+#define reset_3string CUR Strings[124]
+#define reset_file CUR Strings[125]
+#define restore_cursor CUR Strings[126]
+#define row_address CUR Strings[127]
+#define save_cursor CUR Strings[128]
+#define scroll_forward CUR Strings[129]
+#define scroll_reverse CUR Strings[130]
+#define set_attributes CUR Strings[131]
+#define set_tab CUR Strings[132]
+#define set_window CUR Strings[133]
+#define tab CUR Strings[134]
+#define to_status_line CUR Strings[135]
+#define underline_char CUR Strings[136]
+#define up_half_line CUR Strings[137]
+#define init_prog CUR Strings[138]
+#define key_a1 CUR Strings[139]
+#define key_a3 CUR Strings[140]
+#define key_b2 CUR Strings[141]
+#define key_c1 CUR Strings[142]
+#define key_c3 CUR Strings[143]
+#define prtr_non CUR Strings[144]
+#define char_padding CUR Strings[145]
+#define acs_chars CUR Strings[146]
+#define plab_norm CUR Strings[147]
+#define key_btab CUR Strings[148]
+#define enter_xon_mode CUR Strings[149]
+#define exit_xon_mode CUR Strings[150]
+#define enter_am_mode CUR Strings[151]
+#define exit_am_mode CUR Strings[152]
+#define xon_character CUR Strings[153]
+#define xoff_character CUR Strings[154]
+#define ena_acs CUR Strings[155]
+#define label_on CUR Strings[156]
+#define label_off CUR Strings[157]
+#define key_beg CUR Strings[158]
+#define key_cancel CUR Strings[159]
+#define key_close CUR Strings[160]
+#define key_command CUR Strings[161]
+#define key_copy CUR Strings[162]
+#define key_create CUR Strings[163]
+#define key_end CUR Strings[164]
+#define key_enter CUR Strings[165]
+#define key_exit CUR Strings[166]
+#define key_find CUR Strings[167]
+#define key_help CUR Strings[168]
+#define key_mark CUR Strings[169]
+#define key_message CUR Strings[170]
+#define key_move CUR Strings[171]
+#define key_next CUR Strings[172]
+#define key_open CUR Strings[173]
+#define key_options CUR Strings[174]
+#define key_previous CUR Strings[175]
+#define key_print CUR Strings[176]
+#define key_redo CUR Strings[177]
+#define key_reference CUR Strings[178]
+#define key_refresh CUR Strings[179]
+#define key_replace CUR Strings[180]
+#define key_restart CUR Strings[181]
+#define key_resume CUR Strings[182]
+#define key_save CUR Strings[183]
+#define key_suspend CUR Strings[184]
+#define key_undo CUR Strings[185]
+#define key_sbeg CUR Strings[186]
+#define key_scancel CUR Strings[187]
+#define key_scommand CUR Strings[188]
+#define key_scopy CUR Strings[189]
+#define key_screate CUR Strings[190]
+#define key_sdc CUR Strings[191]
+#define key_sdl CUR Strings[192]
+#define key_select CUR Strings[193]
+#define key_send CUR Strings[194]
+#define key_seol CUR Strings[195]
+#define key_sexit CUR Strings[196]
+#define key_sfind CUR Strings[197]
+#define key_shelp CUR Strings[198]
+#define key_shome CUR Strings[199]
+#define key_sic CUR Strings[200]
+#define key_sleft CUR Strings[201]
+#define key_smessage CUR Strings[202]
+#define key_smove CUR Strings[203]
+#define key_snext CUR Strings[204]
+#define key_soptions CUR Strings[205]
+#define key_sprevious CUR Strings[206]
+#define key_sprint CUR Strings[207]
+#define key_sredo CUR Strings[208]
+#define key_sreplace CUR Strings[209]
+#define key_sright CUR Strings[210]
+#define key_srsume CUR Strings[211]
+#define key_ssave CUR Strings[212]
+#define key_ssuspend CUR Strings[213]
+#define key_sundo CUR Strings[214]
+#define req_for_input CUR Strings[215]
+#define key_f11 CUR Strings[216]
+#define key_f12 CUR Strings[217]
+#define key_f13 CUR Strings[218]
+#define key_f14 CUR Strings[219]
+#define key_f15 CUR Strings[220]
+#define key_f16 CUR Strings[221]
+#define key_f17 CUR Strings[222]
+#define key_f18 CUR Strings[223]
+#define key_f19 CUR Strings[224]
+#define key_f20 CUR Strings[225]
+#define key_f21 CUR Strings[226]
+#define key_f22 CUR Strings[227]
+#define key_f23 CUR Strings[228]
+#define key_f24 CUR Strings[229]
+#define key_f25 CUR Strings[230]
+#define key_f26 CUR Strings[231]
+#define key_f27 CUR Strings[232]
+#define key_f28 CUR Strings[233]
+#define key_f29 CUR Strings[234]
+#define key_f30 CUR Strings[235]
+#define key_f31 CUR Strings[236]
+#define key_f32 CUR Strings[237]
+#define key_f33 CUR Strings[238]
+#define key_f34 CUR Strings[239]
+#define key_f35 CUR Strings[240]
+#define key_f36 CUR Strings[241]
+#define key_f37 CUR Strings[242]
+#define key_f38 CUR Strings[243]
+#define key_f39 CUR Strings[244]
+#define key_f40 CUR Strings[245]
+#define key_f41 CUR Strings[246]
+#define key_f42 CUR Strings[247]
+#define key_f43 CUR Strings[248]
+#define key_f44 CUR Strings[249]
+#define key_f45 CUR Strings[250]
+#define key_f46 CUR Strings[251]
+#define key_f47 CUR Strings[252]
+#define key_f48 CUR Strings[253]
+#define key_f49 CUR Strings[254]
+#define key_f50 CUR Strings[255]
+#define key_f51 CUR Strings[256]
+#define key_f52 CUR Strings[257]
+#define key_f53 CUR Strings[258]
+#define key_f54 CUR Strings[259]
+#define key_f55 CUR Strings[260]
+#define key_f56 CUR Strings[261]
+#define key_f57 CUR Strings[262]
+#define key_f58 CUR Strings[263]
+#define key_f59 CUR Strings[264]
+#define key_f60 CUR Strings[265]
+#define key_f61 CUR Strings[266]
+#define key_f62 CUR Strings[267]
+#define key_f63 CUR Strings[268]
+#define clr_bol CUR Strings[269]
+#define clear_margins CUR Strings[270]
+#define set_left_margin CUR Strings[271]
+#define set_right_margin CUR Strings[272]
+#define label_format CUR Strings[273]
+#define set_clock CUR Strings[274]
+#define display_clock CUR Strings[275]
+#define remove_clock CUR Strings[276]
+#define create_window CUR Strings[277]
+#define goto_window CUR Strings[278]
+#define hangup CUR Strings[279]
+#define dial_phone CUR Strings[280]
+#define quick_dial CUR Strings[281]
+#define tone CUR Strings[282]
+#define pulse CUR Strings[283]
+#define flash_hook CUR Strings[284]
+#define fixed_pause CUR Strings[285]
+#define wait_tone CUR Strings[286]
+#define user0 CUR Strings[287]
+#define user1 CUR Strings[288]
+#define user2 CUR Strings[289]
+#define user3 CUR Strings[290]
+#define user4 CUR Strings[291]
+#define user5 CUR Strings[292]
+#define user6 CUR Strings[293]
+#define user7 CUR Strings[294]
+#define user8 CUR Strings[295]
+#define user9 CUR Strings[296]
+#define orig_pair CUR Strings[297]
+#define orig_colors CUR Strings[298]
+#define initialize_color CUR Strings[299]
+#define initialize_pair CUR Strings[300]
+#define set_color_pair CUR Strings[301]
+#define set_foreground CUR Strings[302]
+#define set_background CUR Strings[303]
+#define change_char_pitch CUR Strings[304]
+#define change_line_pitch CUR Strings[305]
+#define change_res_horz CUR Strings[306]
+#define change_res_vert CUR Strings[307]
+#define define_char CUR Strings[308]
+#define enter_doublewide_mode CUR Strings[309]
+#define enter_draft_quality CUR Strings[310]
+#define enter_italics_mode CUR Strings[311]
+#define enter_leftward_mode CUR Strings[312]
+#define enter_micro_mode CUR Strings[313]
+#define enter_near_letter_quality CUR Strings[314]
+#define enter_normal_quality CUR Strings[315]
+#define enter_shadow_mode CUR Strings[316]
+#define enter_subscript_mode CUR Strings[317]
+#define enter_superscript_mode CUR Strings[318]
+#define enter_upward_mode CUR Strings[319]
+#define exit_doublewide_mode CUR Strings[320]
+#define exit_italics_mode CUR Strings[321]
+#define exit_leftward_mode CUR Strings[322]
+#define exit_micro_mode CUR Strings[323]
+#define exit_shadow_mode CUR Strings[324]
+#define exit_subscript_mode CUR Strings[325]
+#define exit_superscript_mode CUR Strings[326]
+#define exit_upward_mode CUR Strings[327]
+#define micro_column_address CUR Strings[328]
+#define micro_down CUR Strings[329]
+#define micro_left CUR Strings[330]
+#define micro_right CUR Strings[331]
+#define micro_row_address CUR Strings[332]
+#define micro_up CUR Strings[333]
+#define order_of_pins CUR Strings[334]
+#define parm_down_micro CUR Strings[335]
+#define parm_left_micro CUR Strings[336]
+#define parm_right_micro CUR Strings[337]
+#define parm_up_micro CUR Strings[338]
+#define select_char_set CUR Strings[339]
+#define set_bottom_margin CUR Strings[340]
+#define set_bottom_margin_parm CUR Strings[341]
+#define set_left_margin_parm CUR Strings[342]
+#define set_right_margin_parm CUR Strings[343]
+#define set_top_margin CUR Strings[344]
+#define set_top_margin_parm CUR Strings[345]
+#define start_bit_image CUR Strings[346]
+#define start_char_set_def CUR Strings[347]
+#define stop_bit_image CUR Strings[348]
+#define stop_char_set_def CUR Strings[349]
+#define subscript_characters CUR Strings[350]
+#define superscript_characters CUR Strings[351]
+#define these_cause_cr CUR Strings[352]
+#define zero_motion CUR Strings[353]
+#define char_set_names CUR Strings[354]
+#define key_mouse CUR Strings[355]
+#define mouse_info CUR Strings[356]
+#define req_mouse_pos CUR Strings[357]
+#define get_mouse CUR Strings[358]
+#define set_a_foreground CUR Strings[359]
+#define set_a_background CUR Strings[360]
+#define pkey_plab CUR Strings[361]
+#define device_type CUR Strings[362]
+#define code_set_init CUR Strings[363]
+#define set0_des_seq CUR Strings[364]
+#define set1_des_seq CUR Strings[365]
+#define set2_des_seq CUR Strings[366]
+#define set3_des_seq CUR Strings[367]
+#define set_lr_margin CUR Strings[368]
+#define set_tb_margin CUR Strings[369]
+#define bit_image_repeat CUR Strings[370]
+#define bit_image_newline CUR Strings[371]
+#define bit_image_carriage_return CUR Strings[372]
+#define color_names CUR Strings[373]
+#define define_bit_image_region CUR Strings[374]
+#define end_bit_image_region CUR Strings[375]
+#define set_color_band CUR Strings[376]
+#define set_page_length CUR Strings[377]
+#define display_pc_char CUR Strings[378]
+#define enter_pc_charset_mode CUR Strings[379]
+#define exit_pc_charset_mode CUR Strings[380]
+#define enter_scancode_mode CUR Strings[381]
+#define exit_scancode_mode CUR Strings[382]
+#define pc_term_options CUR Strings[383]
+#define scancode_escape CUR Strings[384]
+#define alt_scancode_esc CUR Strings[385]
+#define enter_horizontal_hl_mode CUR Strings[386]
+#define enter_left_hl_mode CUR Strings[387]
+#define enter_low_hl_mode CUR Strings[388]
+#define enter_right_hl_mode CUR Strings[389]
+#define enter_top_hl_mode CUR Strings[390]
+#define enter_vertical_hl_mode CUR Strings[391]
+#define set_a_attributes CUR Strings[392]
+#define set_pglen_inch CUR Strings[393]
+
+#define BOOLWRITE 37
+#define NUMWRITE 33
+#define STRWRITE 394
+
+/* older synonyms for some capabilities */
+#define beehive_glitch no_esc_ctlc
+#define teleray_glitch dest_tabs_magic_smso
+#define micro_char_size micro_col_size
+
+#ifdef __INTERNAL_CAPS_VISIBLE
+#define termcap_init2 CUR Strings[394]
+#define termcap_reset CUR Strings[395]
+#define magic_cookie_glitch_ul CUR Numbers[33]
+#define backspaces_with_bs CUR Booleans[37]
+#define crt_no_scrolling CUR Booleans[38]
+#define no_correctly_working_cr CUR Booleans[39]
+#define carriage_return_delay CUR Numbers[34]
+#define new_line_delay CUR Numbers[35]
+#define linefeed_if_not_lf CUR Strings[396]
+#define backspace_if_not_bs CUR Strings[397]
+#define gnu_has_meta_key CUR Booleans[40]
+#define linefeed_is_newline CUR Booleans[41]
+#define backspace_delay CUR Numbers[36]
+#define horizontal_tab_delay CUR Numbers[37]
+#define number_of_function_keys CUR Numbers[38]
+#define other_non_function_keys CUR Strings[398]
+#define arrow_key_map CUR Strings[399]
+#define has_hardware_tabs CUR Booleans[42]
+#define return_does_clr_eol CUR Booleans[43]
+#define acs_ulcorner CUR Strings[400]
+#define acs_llcorner CUR Strings[401]
+#define acs_urcorner CUR Strings[402]
+#define acs_lrcorner CUR Strings[403]
+#define acs_ltee CUR Strings[404]
+#define acs_rtee CUR Strings[405]
+#define acs_btee CUR Strings[406]
+#define acs_ttee CUR Strings[407]
+#define acs_hline CUR Strings[408]
+#define acs_vline CUR Strings[409]
+#define acs_plus CUR Strings[410]
+#define memory_lock CUR Strings[411]
+#define memory_unlock CUR Strings[412]
+#define box_chars_1 CUR Strings[413]
+#endif /* __INTERNAL_CAPS_VISIBLE */
+
+
+/*
+ * Predefined terminfo array sizes
+ */
+#define BOOLCOUNT 44
+#define NUMCOUNT 39
+#define STRCOUNT 414
+
+/* used by code for comparing entries */
+#define acs_chars_index 146
+
+typedef struct termtype { /* in-core form of terminfo data */
+ char *term_names; /* str_table offset of term names */
+ char *str_table; /* pointer to string table */
+ NCURSES_SBOOL *Booleans; /* array of boolean values */
+ short *Numbers; /* array of integer values */
+ char **Strings; /* array of string offsets */
+
+#if NCURSES_XNAMES
+ char *ext_str_table; /* pointer to extended string table */
+ char **ext_Names; /* corresponding names */
+
+ unsigned short num_Booleans;/* count total Booleans */
+ unsigned short num_Numbers; /* count total Numbers */
+ unsigned short num_Strings; /* count total Strings */
+
+ unsigned short ext_Booleans;/* count extensions to Booleans */
+ unsigned short ext_Numbers; /* count extensions to Numbers */
+ unsigned short ext_Strings; /* count extensions to Strings */
+#endif /* NCURSES_XNAMES */
+
+} TERMTYPE;
+
+typedef struct term { /* describe an actual terminal */
+ TERMTYPE type; /* terminal type description */
+ short Filedes; /* file description being written to */
+ TTY Ottyb, /* original state of the terminal */
+ Nttyb; /* current state of the terminal */
+ int _baudrate; /* used to compute padding */
+ char * _termname; /* used for termname() */
+} TERMINAL;
+
+extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term;
+
+#if 0 || 0
+NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolnames);
+NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolcodes);
+NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolfnames);
+NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, numnames);
+NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, numcodes);
+NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, numfnames);
+NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strnames);
+NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strcodes);
+NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strfnames);
+
+#define boolnames NCURSES_PUBLIC_VAR(boolnames())
+#define boolcodes NCURSES_PUBLIC_VAR(boolcodes())
+#define boolfnames NCURSES_PUBLIC_VAR(boolfnames())
+#define numnames NCURSES_PUBLIC_VAR(numnames())
+#define numcodes NCURSES_PUBLIC_VAR(numcodes())
+#define numfnames NCURSES_PUBLIC_VAR(numfnames())
+#define strnames NCURSES_PUBLIC_VAR(strnames())
+#define strcodes NCURSES_PUBLIC_VAR(strcodes())
+#define strfnames NCURSES_PUBLIC_VAR(strfnames())
+
+#else
+
+extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolnames[];
+extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolcodes[];
+extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolfnames[];
+extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numnames[];
+extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numcodes[];
+extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numfnames[];
+extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strnames[];
+extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strcodes[];
+extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strfnames[];
+
+#endif
+
+/* internals */
+extern NCURSES_EXPORT(int) _nc_set_tty_mode (TTY *buf);
+extern NCURSES_EXPORT(int) _nc_get_tty_mode (TTY *buf);
+extern NCURSES_EXPORT(int) _nc_read_entry (const char * const, char * const, TERMTYPE *const);
+extern NCURSES_EXPORT(int) _nc_read_file_entry (const char *const, TERMTYPE *);
+extern NCURSES_EXPORT(int) _nc_read_termtype (TERMTYPE *, char *, int);
+extern NCURSES_EXPORT(char *) _nc_first_name (const char *const);
+extern NCURSES_EXPORT(int) _nc_name_match (const char *const, const char *const, const char *const);
+extern NCURSES_EXPORT(const TERMTYPE *) _nc_fallback (const char *);
+
+/* entry points */
+extern NCURSES_EXPORT(TERMINAL *) set_curterm (TERMINAL *);
+extern NCURSES_EXPORT(int) del_curterm (TERMINAL *);
+
+/* miscellaneous entry points */
+extern NCURSES_EXPORT(int) restartterm (NCURSES_CONST char *, int, int *);
+extern NCURSES_EXPORT(int) setupterm (NCURSES_CONST char *,int,int *);
+
+/* terminfo entry points, also declared in curses.h */
+#if !defined(__NCURSES_H)
+extern NCURSES_EXPORT(char *) tigetstr (NCURSES_CONST char *);
+extern NCURSES_EXPORT_VAR(char) ttytype[];
+extern NCURSES_EXPORT(int) putp (const char *);
+extern NCURSES_EXPORT(int) tigetflag (NCURSES_CONST char *);
+extern NCURSES_EXPORT(int) tigetnum (NCURSES_CONST char *);
+
+#if 1 /* NCURSES_TPARM_VARARGS */
+extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, ...); /* special */
+#else
+extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, long,long,long,long,long,long,long,long,long); /* special */
+extern NCURSES_EXPORT(char *) tparm_varargs (NCURSES_CONST char *, ...); /* special */
+#endif
+
+#endif /* __NCURSES_H */
+
+/* termcap database emulation (XPG4 uses const only for 2nd param of tgetent) */
+#if !defined(NCURSES_TERMCAP_H_incl)
+extern NCURSES_EXPORT(char *) tgetstr (NCURSES_CONST char *, char **);
+extern NCURSES_EXPORT(char *) tgoto (const char *, int, int);
+extern NCURSES_EXPORT(int) tgetent (char *, const char *);
+extern NCURSES_EXPORT(int) tgetflag (NCURSES_CONST char *);
+extern NCURSES_EXPORT(int) tgetnum (NCURSES_CONST char *);
+extern NCURSES_EXPORT(int) tputs (const char *, int, int (*)(int));
+#endif /* NCURSES_TERMCAP_H_incl */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* NCURSES_TERM_H_incl */
diff --git a/sysroot/usr/include/term_entry.h b/sysroot/usr/include/term_entry.h
new file mode 100644
index 0000000..c880c3a
--- /dev/null
+++ b/sysroot/usr/include/term_entry.h
@@ -0,0 +1,168 @@
+/****************************************************************************
+ * Copyright (c) 1998-2001,2004 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
+ * and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ * and: Thomas E. Dickey 1998-2004 *
+ ****************************************************************************/
+
+/* $Id: term_entry.h,v 1.34 2005/07/16 21:15:07 tom Exp $ */
+
+/*
+ * term_entry.h -- interface to entry-manipulation code
+ */
+
+#ifndef NCURSES_TERM_ENTRY_H_incl
+#define NCURSES_TERM_ENTRY_H_incl 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <term.h>
+
+#define MAX_USES 32
+#define MAX_CROSSLINKS 16
+
+typedef struct entry {
+ TERMTYPE tterm;
+ int nuses;
+ struct
+ {
+ char *name;
+ struct entry *link;
+ long line;
+ }
+ uses[MAX_USES];
+ int ncrosslinks;
+ struct entry *crosslinks[MAX_CROSSLINKS];
+ long cstart, cend;
+ long startline;
+ struct entry *next;
+ struct entry *last;
+}
+ENTRY;
+
+#if NCURSES_XNAMES
+#define NUM_BOOLEANS(tp) (tp)->num_Booleans
+#define NUM_NUMBERS(tp) (tp)->num_Numbers
+#define NUM_STRINGS(tp) (tp)->num_Strings
+#define EXT_NAMES(tp,i,limit,index,table) (i >= limit) ? tp->ext_Names[index] : table[i]
+#else
+#define NUM_BOOLEANS(tp) BOOLCOUNT
+#define NUM_NUMBERS(tp) NUMCOUNT
+#define NUM_STRINGS(tp) STRCOUNT
+#define EXT_NAMES(tp,i,limit,index,table) table[i]
+#endif
+
+#define NUM_EXT_NAMES(tp) ((tp)->ext_Booleans + (tp)->ext_Numbers + (tp)->ext_Strings)
+
+#define for_each_boolean(n,tp) for(n = 0; n < NUM_BOOLEANS(tp); n++)
+#define for_each_number(n,tp) for(n = 0; n < NUM_NUMBERS(tp); n++)
+#define for_each_string(n,tp) for(n = 0; n < NUM_STRINGS(tp); n++)
+
+#define ExtBoolname(tp,i,names) EXT_NAMES(tp, i, BOOLCOUNT, (i - (tp->num_Booleans - tp->ext_Booleans)), names)
+#define ExtNumname(tp,i,names) EXT_NAMES(tp, i, NUMCOUNT, (i - (tp->num_Numbers - tp->ext_Numbers)) + tp->ext_Booleans, names)
+#define ExtStrname(tp,i,names) EXT_NAMES(tp, i, STRCOUNT, (i - (tp->num_Strings - tp->ext_Strings)) + (tp->ext_Numbers + tp->ext_Booleans), names)
+
+extern NCURSES_EXPORT_VAR(ENTRY *) _nc_head;
+extern NCURSES_EXPORT_VAR(ENTRY *) _nc_tail;
+#define for_entry_list(qp) for (qp = _nc_head; qp; qp = qp->next)
+
+#define MAX_LINE 132
+
+#define NULLHOOK (bool(*)(ENTRY *))0
+
+/*
+ * Note that WANTED and PRESENT are not simple inverses! If a capability
+ * has been explicitly cancelled, it's not considered WANTED.
+ */
+#define WANTED(s) ((s) == ABSENT_STRING)
+#define PRESENT(s) (((s) != ABSENT_STRING) && ((s) != CANCELLED_STRING))
+
+#define ANDMISSING(p,q) \
+ {if (PRESENT(p) && !PRESENT(q)) _nc_warning(#p " but no " #q);}
+
+#define PAIRED(p,q) \
+ { \
+ if (PRESENT(q) && !PRESENT(p)) \
+ _nc_warning(#q " but no " #p); \
+ if (PRESENT(p) && !PRESENT(q)) \
+ _nc_warning(#p " but no " #q); \
+ }
+
+/* alloc_entry.c: elementary allocation code */
+extern NCURSES_EXPORT(ENTRY *) _nc_copy_entry (ENTRY *oldp);
+extern NCURSES_EXPORT(char *) _nc_save_str (const char *const);
+extern NCURSES_EXPORT(void) _nc_init_entry (TERMTYPE *const);
+extern NCURSES_EXPORT(void) _nc_merge_entry (TERMTYPE *const, TERMTYPE *const);
+extern NCURSES_EXPORT(void) _nc_wrap_entry (ENTRY *const, bool);
+
+/* alloc_ttype.c: elementary allocation code */
+extern NCURSES_EXPORT(void) _nc_align_termtype (TERMTYPE *, TERMTYPE *);
+extern NCURSES_EXPORT(void) _nc_copy_termtype (TERMTYPE *, TERMTYPE *);
+
+/* free_ttype.c: elementary allocation code */
+extern NCURSES_EXPORT(void) _nc_free_termtype (TERMTYPE *);
+
+/* lib_acs.c */
+extern NCURSES_EXPORT(void) _nc_init_acs (void); /* corresponds to traditional 'init_acs()' */
+
+/* lib_termcap.c: trim sgr0 string for termcap users */
+extern NCURSES_EXPORT(char *) _nc_trim_sgr0 (TERMTYPE *);
+
+/* parse_entry.c: entry-parsing code */
+#if NCURSES_XNAMES
+extern NCURSES_EXPORT_VAR(bool) _nc_user_definable;
+extern NCURSES_EXPORT_VAR(bool) _nc_disable_period;
+#endif
+extern NCURSES_EXPORT(int) _nc_parse_entry (ENTRY *, int, bool);
+extern NCURSES_EXPORT(int) _nc_capcmp (const char *, const char *);
+
+/* write_entry.c: writing an entry to the file system */
+extern NCURSES_EXPORT(void) _nc_set_writedir (char *);
+extern NCURSES_EXPORT(void) _nc_write_entry (TERMTYPE *const);
+
+/* comp_parse.c: entry list handling */
+extern NCURSES_EXPORT(void) _nc_read_entry_source (FILE*, char*, int, bool, bool (*)(ENTRY*));
+extern NCURSES_EXPORT(bool) _nc_entry_match (char *, char *);
+extern NCURSES_EXPORT(int) _nc_resolve_uses (bool); /* obs 20040705 */
+extern NCURSES_EXPORT(int) _nc_resolve_uses2 (bool, bool);
+extern NCURSES_EXPORT(void) _nc_free_entries (ENTRY *);
+extern NCURSES_IMPEXP void NCURSES_API (*_nc_check_termtype)(TERMTYPE *); /* obs 20040705 */
+extern NCURSES_IMPEXP void NCURSES_API (*_nc_check_termtype2)(TERMTYPE *, bool);
+
+/* trace_xnames.c */
+extern NCURSES_EXPORT(void) _nc_trace_xnames (TERMTYPE *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* NCURSES_TERM_ENTRY_H_incl */
diff --git a/sysroot/usr/include/termcap.h b/sysroot/usr/include/termcap.h
new file mode 100644
index 0000000..76dba20
--- /dev/null
+++ b/sysroot/usr/include/termcap.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+ * Copyright (c) 1998,2000 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
+ * and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ ****************************************************************************/
+
+/* $Id: termcap.h.in,v 1.16 2001/03/24 21:53:27 tom Exp $ */
+
+#ifndef NCURSES_TERMCAP_H_incl
+#define NCURSES_TERMCAP_H_incl 1
+
+#undef NCURSES_VERSION
+#define NCURSES_VERSION "5.6"
+
+#include <ncurses_dll.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#include <sys/types.h>
+
+#undef NCURSES_CONST
+#define NCURSES_CONST const
+
+#undef NCURSES_OSPEED
+#define NCURSES_OSPEED short
+
+extern NCURSES_EXPORT_VAR(char) PC;
+extern NCURSES_EXPORT_VAR(char *) UP;
+extern NCURSES_EXPORT_VAR(char *) BC;
+extern NCURSES_EXPORT_VAR(NCURSES_OSPEED) ospeed;
+
+#if !defined(NCURSES_TERM_H_incl)
+extern NCURSES_EXPORT(char *) tgetstr (NCURSES_CONST char *, char **);
+extern NCURSES_EXPORT(char *) tgoto (const char *, int, int);
+extern NCURSES_EXPORT(int) tgetent (char *, const char *);
+extern NCURSES_EXPORT(int) tgetflag (NCURSES_CONST char *);
+extern NCURSES_EXPORT(int) tgetnum (NCURSES_CONST char *);
+extern NCURSES_EXPORT(int) tputs (const char *, int, int (*)(int));
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* NCURSES_TERMCAP_H_incl */
diff --git a/sysroot/usr/include/termio.h b/sysroot/usr/include/termio.h
new file mode 100644
index 0000000..0e610f0
--- /dev/null
+++ b/sysroot/usr/include/termio.h
@@ -0,0 +1,6 @@
+/* Compatible <termio.h> for old `struct termio' ioctl interface.
+ This is obsolete; use the POSIX.1 `struct termios' interface
+ defined in <termios.h> instead. */
+
+#include <termios.h>
+#include <sys/ioctl.h>
diff --git a/sysroot/usr/include/termios.h b/sysroot/usr/include/termios.h
new file mode 100644
index 0000000..9698b1f
--- /dev/null
+++ b/sysroot/usr/include/termios.h
@@ -0,0 +1,110 @@
+/* Copyright (C) 1991,92,93,94,96,97,98,99, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * POSIX Standard: 7.1-2 General Terminal Interface <termios.h>
+ */
+
+#ifndef _TERMIOS_H
+#define _TERMIOS_H 1
+
+#include <features.h>
+#ifdef __USE_UNIX98
+/* We need `pid_t'. */
+# include <bits/types.h>
+# ifndef __pid_t_defined
+typedef __pid_t pid_t;
+# define __pid_t_defined
+# endif
+#endif
+
+__BEGIN_DECLS
+
+/* Get the system-dependent definitions of `struct termios', `tcflag_t',
+ `cc_t', `speed_t', and all the macros specifying the flag bits. */
+#include <bits/termios.h>
+
+#ifdef __USE_BSD
+/* Compare a character C to a value VAL from the `c_cc' array in a
+ `struct termios'. If VAL is _POSIX_VDISABLE, no character can match it. */
+# define CCEQ(val, c) ((c) == (val) && (val) != _POSIX_VDISABLE)
+#endif
+
+/* Return the output baud rate stored in *TERMIOS_P. */
+extern speed_t cfgetospeed (__const struct termios *__termios_p) __THROW;
+
+/* Return the input baud rate stored in *TERMIOS_P. */
+extern speed_t cfgetispeed (__const struct termios *__termios_p) __THROW;
+
+/* Set the output baud rate stored in *TERMIOS_P to SPEED. */
+extern int cfsetospeed (struct termios *__termios_p, speed_t __speed) __THROW;
+
+/* Set the input baud rate stored in *TERMIOS_P to SPEED. */
+extern int cfsetispeed (struct termios *__termios_p, speed_t __speed) __THROW;
+
+#ifdef __USE_BSD
+/* Set both the input and output baud rates in *TERMIOS_OP to SPEED. */
+extern int cfsetspeed (struct termios *__termios_p, speed_t __speed) __THROW;
+#endif
+
+
+/* Put the state of FD into *TERMIOS_P. */
+extern int tcgetattr (int __fd, struct termios *__termios_p) __THROW;
+
+/* Set the state of FD to *TERMIOS_P.
+ Values for OPTIONAL_ACTIONS (TCSA*) are in <bits/termios.h>. */
+extern int tcsetattr (int __fd, int __optional_actions,
+ __const struct termios *__termios_p) __THROW;
+
+
+#ifdef __USE_BSD
+/* Set *TERMIOS_P to indicate raw mode. */
+extern void cfmakeraw (struct termios *__termios_p) __THROW;
+#endif
+
+/* Send zero bits on FD. */
+extern int tcsendbreak (int __fd, int __duration) __THROW;
+
+/* Wait for pending output to be written on FD.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int tcdrain (int __fd);
+
+/* Flush pending data on FD.
+ Values for QUEUE_SELECTOR (TC{I,O,IO}FLUSH) are in <bits/termios.h>. */
+extern int tcflush (int __fd, int __queue_selector) __THROW;
+
+/* Suspend or restart transmission on FD.
+ Values for ACTION (TC[IO]{OFF,ON}) are in <bits/termios.h>. */
+extern int tcflow (int __fd, int __action) __THROW;
+
+
+#ifdef __USE_UNIX98
+/* Get process group ID for session leader for controlling terminal FD. */
+extern __pid_t tcgetsid (int __fd) __THROW;
+#endif
+
+
+#ifdef __USE_BSD
+# include <sys/ttydefaults.h>
+#endif
+
+__END_DECLS
+
+#endif /* termios.h */
diff --git a/sysroot/usr/include/tgmath.h b/sysroot/usr/include/tgmath.h
new file mode 100644
index 0000000..4f45aaa
--- /dev/null
+++ b/sysroot/usr/include/tgmath.h
@@ -0,0 +1,449 @@
+/* Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2007
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99 Standard: 7.22 Type-generic math <tgmath.h>
+ */
+
+#ifndef _TGMATH_H
+#define _TGMATH_H 1
+
+/* Include the needed headers. */
+#include <math.h>
+#include <complex.h>
+
+
+/* Since `complex' is currently not really implemented in most C compilers
+ and if it is implemented, the implementations differ. This makes it
+ quite difficult to write a generic implementation of this header. We
+ do not try this for now and instead concentrate only on GNU CC. Once
+ we have more information support for other compilers might follow. */
+
+#if __GNUC_PREREQ (2, 7)
+
+# ifdef __NO_LONG_DOUBLE_MATH
+# define __tgml(fct) fct
+# else
+# define __tgml(fct) fct ## l
+# endif
+
+/* This is ugly but unless gcc gets appropriate builtins we have to do
+ something like this. Don't ask how it works. */
+
+/* 1 if 'type' is a floating type, 0 if 'type' is an integer type.
+ Allows for _Bool. Expands to an integer constant expression. */
+# define __floating_type(type) (((type) 0.25) && ((type) 0.25 - 1))
+
+/* The tgmath real type for T, where E is 0 if T is an integer type and
+ 1 for a floating type. */
+# define __tgmath_real_type_sub(T, E) \
+ __typeof__ (*(0 ? (__typeof__ (0 ? (double *) 0 : (void *) (E))) 0 \
+ : (__typeof__ (0 ? (T *) 0 : (void *) (!(E)))) 0))
+
+/* The tgmath real type of EXPR. */
+# define __tgmath_real_type(expr) \
+ __tgmath_real_type_sub (__typeof__ ((__typeof__ (expr)) 0), \
+ __floating_type (__typeof__ (expr)))
+
+
+/* We have two kinds of generic macros: to support functions which are
+ only defined on real valued parameters and those which are defined
+ for complex functions as well. */
+# define __TGMATH_UNARY_REAL_ONLY(Val, Fct) \
+ (__extension__ ((sizeof (Val) == sizeof (double) \
+ || __builtin_classify_type (Val) != 8) \
+ ? (__tgmath_real_type (Val)) Fct (Val) \
+ : (sizeof (Val) == sizeof (float)) \
+ ? (__tgmath_real_type (Val)) Fct##f (Val) \
+ : (__tgmath_real_type (Val)) __tgml(Fct) (Val)))
+
+# define __TGMATH_UNARY_REAL_RET_ONLY(Val, RetType, Fct) \
+ (__extension__ ((sizeof (Val) == sizeof (double) \
+ || __builtin_classify_type (Val) != 8) \
+ ? (RetType) Fct (Val) \
+ : (sizeof (Val) == sizeof (float)) \
+ ? (RetType) Fct##f (Val) \
+ : (RetType) __tgml(Fct) (Val)))
+
+# define __TGMATH_BINARY_FIRST_REAL_ONLY(Val1, Val2, Fct) \
+ (__extension__ ((sizeof (Val1) == sizeof (double) \
+ || __builtin_classify_type (Val1) != 8) \
+ ? (__tgmath_real_type (Val1)) Fct (Val1, Val2) \
+ : (sizeof (Val1) == sizeof (float)) \
+ ? (__tgmath_real_type (Val1)) Fct##f (Val1, Val2) \
+ : (__tgmath_real_type (Val1)) __tgml(Fct) (Val1, Val2)))
+
+# define __TGMATH_BINARY_REAL_ONLY(Val1, Val2, Fct) \
+ (__extension__ (((sizeof (Val1) > sizeof (double) \
+ || sizeof (Val2) > sizeof (double)) \
+ && __builtin_classify_type ((Val1) + (Val2)) == 8) \
+ ? (__typeof ((__tgmath_real_type (Val1)) 0 \
+ + (__tgmath_real_type (Val2)) 0)) \
+ __tgml(Fct) (Val1, Val2) \
+ : (sizeof (Val1) == sizeof (double) \
+ || sizeof (Val2) == sizeof (double) \
+ || __builtin_classify_type (Val1) != 8 \
+ || __builtin_classify_type (Val2) != 8) \
+ ? (__typeof ((__tgmath_real_type (Val1)) 0 \
+ + (__tgmath_real_type (Val2)) 0)) \
+ Fct (Val1, Val2) \
+ : (__typeof ((__tgmath_real_type (Val1)) 0 \
+ + (__tgmath_real_type (Val2)) 0)) \
+ Fct##f (Val1, Val2)))
+
+# define __TGMATH_TERNARY_FIRST_SECOND_REAL_ONLY(Val1, Val2, Val3, Fct) \
+ (__extension__ (((sizeof (Val1) > sizeof (double) \
+ || sizeof (Val2) > sizeof (double)) \
+ && __builtin_classify_type ((Val1) + (Val2)) == 8) \
+ ? (__typeof ((__tgmath_real_type (Val1)) 0 \
+ + (__tgmath_real_type (Val2)) 0)) \
+ __tgml(Fct) (Val1, Val2, Val3) \
+ : (sizeof (Val1) == sizeof (double) \
+ || sizeof (Val2) == sizeof (double) \
+ || __builtin_classify_type (Val1) != 8 \
+ || __builtin_classify_type (Val2) != 8) \
+ ? (__typeof ((__tgmath_real_type (Val1)) 0 \
+ + (__tgmath_real_type (Val2)) 0)) \
+ Fct (Val1, Val2, Val3) \
+ : (__typeof ((__tgmath_real_type (Val1)) 0 \
+ + (__tgmath_real_type (Val2)) 0)) \
+ Fct##f (Val1, Val2, Val3)))
+
+# define __TGMATH_TERNARY_REAL_ONLY(Val1, Val2, Val3, Fct) \
+ (__extension__ (((sizeof (Val1) > sizeof (double) \
+ || sizeof (Val2) > sizeof (double) \
+ || sizeof (Val3) > sizeof (double)) \
+ && __builtin_classify_type ((Val1) + (Val2) + (Val3)) \
+ == 8) \
+ ? (__typeof ((__tgmath_real_type (Val1)) 0 \
+ + (__tgmath_real_type (Val2)) 0 \
+ + (__tgmath_real_type (Val3)) 0)) \
+ __tgml(Fct) (Val1, Val2, Val3) \
+ : (sizeof (Val1) == sizeof (double) \
+ || sizeof (Val2) == sizeof (double) \
+ || sizeof (Val3) == sizeof (double) \
+ || __builtin_classify_type (Val1) != 8 \
+ || __builtin_classify_type (Val2) != 8 \
+ || __builtin_classify_type (Val3) != 8) \
+ ? (__typeof ((__tgmath_real_type (Val1)) 0 \
+ + (__tgmath_real_type (Val2)) 0 \
+ + (__tgmath_real_type (Val3)) 0)) \
+ Fct (Val1, Val2, Val3) \
+ : (__typeof ((__tgmath_real_type (Val1)) 0 \
+ + (__tgmath_real_type (Val2)) 0 \
+ + (__tgmath_real_type (Val3)) 0)) \
+ Fct##f (Val1, Val2, Val3)))
+
+/* XXX This definition has to be changed as soon as the compiler understands
+ the imaginary keyword. */
+# define __TGMATH_UNARY_REAL_IMAG(Val, Fct, Cfct) \
+ (__extension__ ((sizeof (__real__ (Val)) == sizeof (double) \
+ || __builtin_classify_type (__real__ (Val)) != 8) \
+ ? ((sizeof (__real__ (Val)) == sizeof (Val)) \
+ ? (__tgmath_real_type (Val)) Fct (Val) \
+ : (__tgmath_real_type (Val)) Cfct (Val)) \
+ : (sizeof (__real__ (Val)) == sizeof (float)) \
+ ? ((sizeof (__real__ (Val)) == sizeof (Val)) \
+ ? (__tgmath_real_type (Val)) Fct##f (Val) \
+ : (__tgmath_real_type (Val)) Cfct##f (Val)) \
+ : ((sizeof (__real__ (Val)) == sizeof (Val)) \
+ ? (__tgmath_real_type (Val)) __tgml(Fct) (Val) \
+ : (__tgmath_real_type (Val)) __tgml(Cfct) (Val))))
+
+# define __TGMATH_UNARY_IMAG(Val, Cfct) \
+ (__extension__ ((sizeof (__real__ (Val)) == sizeof (double) \
+ || __builtin_classify_type (__real__ (Val)) != 8) \
+ ? (__typeof__ ((__tgmath_real_type (Val)) 0 \
+ + _Complex_I)) Cfct (Val) \
+ : (sizeof (__real__ (Val)) == sizeof (float)) \
+ ? (__typeof__ ((__tgmath_real_type (Val)) 0 \
+ + _Complex_I)) Cfct##f (Val) \
+ : (__typeof__ ((__tgmath_real_type (Val)) 0 \
+ + _Complex_I)) __tgml(Cfct) (Val)))
+
+/* XXX This definition has to be changed as soon as the compiler understands
+ the imaginary keyword. */
+# define __TGMATH_UNARY_REAL_IMAG_RET_REAL(Val, Fct, Cfct) \
+ (__extension__ ((sizeof (__real__ (Val)) == sizeof (double) \
+ || __builtin_classify_type (__real__ (Val)) != 8) \
+ ? ((sizeof (__real__ (Val)) == sizeof (Val)) \
+ ? (__typeof__ (__real__ (__tgmath_real_type (Val)) 0))\
+ Fct (Val) \
+ : (__typeof__ (__real__ (__tgmath_real_type (Val)) 0))\
+ Cfct (Val)) \
+ : (sizeof (__real__ (Val)) == sizeof (float)) \
+ ? ((sizeof (__real__ (Val)) == sizeof (Val)) \
+ ? (__typeof__ (__real__ (__tgmath_real_type (Val)) 0))\
+ Fct##f (Val) \
+ : (__typeof__ (__real__ (__tgmath_real_type (Val)) 0))\
+ Cfct##f (Val)) \
+ : ((sizeof (__real__ (Val)) == sizeof (Val)) \
+ ? (__typeof__ (__real__ (__tgmath_real_type (Val)) 0))\
+ __tgml(Fct) (Val) \
+ : (__typeof__ (__real__ (__tgmath_real_type (Val)) 0))\
+ __tgml(Cfct) (Val))))
+
+/* XXX This definition has to be changed as soon as the compiler understands
+ the imaginary keyword. */
+# define __TGMATH_BINARY_REAL_IMAG(Val1, Val2, Fct, Cfct) \
+ (__extension__ (((sizeof (__real__ (Val1)) > sizeof (double) \
+ || sizeof (__real__ (Val2)) > sizeof (double)) \
+ && __builtin_classify_type (__real__ (Val1) \
+ + __real__ (Val2)) == 8) \
+ ? ((sizeof (__real__ (Val1)) == sizeof (Val1) \
+ && sizeof (__real__ (Val2)) == sizeof (Val2)) \
+ ? (__typeof ((__tgmath_real_type (Val1)) 0 \
+ + (__tgmath_real_type (Val2)) 0)) \
+ __tgml(Fct) (Val1, Val2) \
+ : (__typeof ((__tgmath_real_type (Val1)) 0 \
+ + (__tgmath_real_type (Val2)) 0)) \
+ __tgml(Cfct) (Val1, Val2)) \
+ : (sizeof (__real__ (Val1)) == sizeof (double) \
+ || sizeof (__real__ (Val2)) == sizeof (double) \
+ || __builtin_classify_type (__real__ (Val1)) != 8 \
+ || __builtin_classify_type (__real__ (Val2)) != 8) \
+ ? ((sizeof (__real__ (Val1)) == sizeof (Val1) \
+ && sizeof (__real__ (Val2)) == sizeof (Val2)) \
+ ? (__typeof ((__tgmath_real_type (Val1)) 0 \
+ + (__tgmath_real_type (Val2)) 0)) \
+ Fct (Val1, Val2) \
+ : (__typeof ((__tgmath_real_type (Val1)) 0 \
+ + (__tgmath_real_type (Val2)) 0)) \
+ Cfct (Val1, Val2)) \
+ : ((sizeof (__real__ (Val1)) == sizeof (Val1) \
+ && sizeof (__real__ (Val2)) == sizeof (Val2)) \
+ ? (__typeof ((__tgmath_real_type (Val1)) 0 \
+ + (__tgmath_real_type (Val2)) 0)) \
+ Fct##f (Val1, Val2) \
+ : (__typeof ((__tgmath_real_type (Val1)) 0 \
+ + (__tgmath_real_type (Val2)) 0)) \
+ Cfct##f (Val1, Val2))))
+#else
+# error "Unsupported compiler; you cannot use <tgmath.h>"
+#endif
+
+
+/* Unary functions defined for real and complex values. */
+
+
+/* Trigonometric functions. */
+
+/* Arc cosine of X. */
+#define acos(Val) __TGMATH_UNARY_REAL_IMAG (Val, acos, cacos)
+/* Arc sine of X. */
+#define asin(Val) __TGMATH_UNARY_REAL_IMAG (Val, asin, casin)
+/* Arc tangent of X. */
+#define atan(Val) __TGMATH_UNARY_REAL_IMAG (Val, atan, catan)
+/* Arc tangent of Y/X. */
+#define atan2(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, atan2)
+
+/* Cosine of X. */
+#define cos(Val) __TGMATH_UNARY_REAL_IMAG (Val, cos, ccos)
+/* Sine of X. */
+#define sin(Val) __TGMATH_UNARY_REAL_IMAG (Val, sin, csin)
+/* Tangent of X. */
+#define tan(Val) __TGMATH_UNARY_REAL_IMAG (Val, tan, ctan)
+
+
+/* Hyperbolic functions. */
+
+/* Hyperbolic arc cosine of X. */
+#define acosh(Val) __TGMATH_UNARY_REAL_IMAG (Val, acosh, cacosh)
+/* Hyperbolic arc sine of X. */
+#define asinh(Val) __TGMATH_UNARY_REAL_IMAG (Val, asinh, casinh)
+/* Hyperbolic arc tangent of X. */
+#define atanh(Val) __TGMATH_UNARY_REAL_IMAG (Val, atanh, catanh)
+
+/* Hyperbolic cosine of X. */
+#define cosh(Val) __TGMATH_UNARY_REAL_IMAG (Val, cosh, ccosh)
+/* Hyperbolic sine of X. */
+#define sinh(Val) __TGMATH_UNARY_REAL_IMAG (Val, sinh, csinh)
+/* Hyperbolic tangent of X. */
+#define tanh(Val) __TGMATH_UNARY_REAL_IMAG (Val, tanh, ctanh)
+
+
+/* Exponential and logarithmic functions. */
+
+/* Exponential function of X. */
+#define exp(Val) __TGMATH_UNARY_REAL_IMAG (Val, exp, cexp)
+
+/* Break VALUE into a normalized fraction and an integral power of 2. */
+#define frexp(Val1, Val2) __TGMATH_BINARY_FIRST_REAL_ONLY (Val1, Val2, frexp)
+
+/* X times (two to the EXP power). */
+#define ldexp(Val1, Val2) __TGMATH_BINARY_FIRST_REAL_ONLY (Val1, Val2, ldexp)
+
+/* Natural logarithm of X. */
+#define log(Val) __TGMATH_UNARY_REAL_IMAG (Val, log, clog)
+
+/* Base-ten logarithm of X. */
+#ifdef __USE_GNU
+# define log10(Val) __TGMATH_UNARY_REAL_IMAG (Val, log10, __clog10)
+#else
+# define log10(Val) __TGMATH_UNARY_REAL_ONLY (Val, log10)
+#endif
+
+/* Return exp(X) - 1. */
+#define expm1(Val) __TGMATH_UNARY_REAL_ONLY (Val, expm1)
+
+/* Return log(1 + X). */
+#define log1p(Val) __TGMATH_UNARY_REAL_ONLY (Val, log1p)
+
+/* Return the base 2 signed integral exponent of X. */
+#define logb(Val) __TGMATH_UNARY_REAL_ONLY (Val, logb)
+
+/* Compute base-2 exponential of X. */
+#define exp2(Val) __TGMATH_UNARY_REAL_ONLY (Val, exp2)
+
+/* Compute base-2 logarithm of X. */
+#define log2(Val) __TGMATH_UNARY_REAL_ONLY (Val, log2)
+
+
+/* Power functions. */
+
+/* Return X to the Y power. */
+#define pow(Val1, Val2) __TGMATH_BINARY_REAL_IMAG (Val1, Val2, pow, cpow)
+
+/* Return the square root of X. */
+#define sqrt(Val) __TGMATH_UNARY_REAL_IMAG (Val, sqrt, csqrt)
+
+/* Return `sqrt(X*X + Y*Y)'. */
+#define hypot(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, hypot)
+
+/* Return the cube root of X. */
+#define cbrt(Val) __TGMATH_UNARY_REAL_ONLY (Val, cbrt)
+
+
+/* Nearest integer, absolute value, and remainder functions. */
+
+/* Smallest integral value not less than X. */
+#define ceil(Val) __TGMATH_UNARY_REAL_ONLY (Val, ceil)
+
+/* Absolute value of X. */
+#define fabs(Val) __TGMATH_UNARY_REAL_IMAG_RET_REAL (Val, fabs, cabs)
+
+/* Largest integer not greater than X. */
+#define floor(Val) __TGMATH_UNARY_REAL_ONLY (Val, floor)
+
+/* Floating-point modulo remainder of X/Y. */
+#define fmod(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, fmod)
+
+/* Round X to integral valuein floating-point format using current
+ rounding direction, but do not raise inexact exception. */
+#define nearbyint(Val) __TGMATH_UNARY_REAL_ONLY (Val, nearbyint)
+
+/* Round X to nearest integral value, rounding halfway cases away from
+ zero. */
+#define round(Val) __TGMATH_UNARY_REAL_ONLY (Val, round)
+
+/* Round X to the integral value in floating-point format nearest but
+ not larger in magnitude. */
+#define trunc(Val) __TGMATH_UNARY_REAL_ONLY (Val, trunc)
+
+/* Compute remainder of X and Y and put in *QUO a value with sign of x/y
+ and magnitude congruent `mod 2^n' to the magnitude of the integral
+ quotient x/y, with n >= 3. */
+#define remquo(Val1, Val2, Val3) \
+ __TGMATH_TERNARY_FIRST_SECOND_REAL_ONLY (Val1, Val2, Val3, remquo)
+
+/* Round X to nearest integral value according to current rounding
+ direction. */
+#define lrint(Val) __TGMATH_UNARY_REAL_RET_ONLY (Val, long int, lrint)
+#define llrint(Val) __TGMATH_UNARY_REAL_RET_ONLY (Val, long long int, llrint)
+
+/* Round X to nearest integral value, rounding halfway cases away from
+ zero. */
+#define lround(Val) __TGMATH_UNARY_REAL_RET_ONLY (Val, long int, lround)
+#define llround(Val) __TGMATH_UNARY_REAL_RET_ONLY (Val, long long int, llround)
+
+
+/* Return X with its signed changed to Y's. */
+#define copysign(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, copysign)
+
+/* Error and gamma functions. */
+#define erf(Val) __TGMATH_UNARY_REAL_ONLY (Val, erf)
+#define erfc(Val) __TGMATH_UNARY_REAL_ONLY (Val, erfc)
+#define tgamma(Val) __TGMATH_UNARY_REAL_ONLY (Val, tgamma)
+#define lgamma(Val) __TGMATH_UNARY_REAL_ONLY (Val, lgamma)
+
+
+/* Return the integer nearest X in the direction of the
+ prevailing rounding mode. */
+#define rint(Val) __TGMATH_UNARY_REAL_ONLY (Val, rint)
+
+/* Return X + epsilon if X < Y, X - epsilon if X > Y. */
+#define nextafter(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, nextafter)
+#define nexttoward(Val1, Val2) \
+ __TGMATH_BINARY_FIRST_REAL_ONLY (Val1, Val2, nexttoward)
+
+/* Return the remainder of integer divison X / Y with infinite precision. */
+#define remainder(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, remainder)
+
+/* Return X times (2 to the Nth power). */
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
+# define scalb(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, scalb)
+#endif
+
+/* Return X times (2 to the Nth power). */
+#define scalbn(Val1, Val2) __TGMATH_BINARY_FIRST_REAL_ONLY (Val1, Val2, scalbn)
+
+/* Return X times (2 to the Nth power). */
+#define scalbln(Val1, Val2) \
+ __TGMATH_BINARY_FIRST_REAL_ONLY (Val1, Val2, scalbln)
+
+/* Return the binary exponent of X, which must be nonzero. */
+#define ilogb(Val) __TGMATH_UNARY_REAL_RET_ONLY (Val, int, ilogb)
+
+
+/* Return positive difference between X and Y. */
+#define fdim(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, fdim)
+
+/* Return maximum numeric value from X and Y. */
+#define fmax(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, fmax)
+
+/* Return minimum numeric value from X and Y. */
+#define fmin(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, fmin)
+
+
+/* Multiply-add function computed as a ternary operation. */
+#define fma(Val1, Val2, Val3) \
+ __TGMATH_TERNARY_REAL_ONLY (Val1, Val2, Val3, fma)
+
+
+/* Absolute value, conjugates, and projection. */
+
+/* Argument value of Z. */
+#define carg(Val) __TGMATH_UNARY_REAL_IMAG_RET_REAL (Val, carg, carg)
+
+/* Complex conjugate of Z. */
+#define conj(Val) __TGMATH_UNARY_IMAG (Val, conj)
+
+/* Projection of Z onto the Riemann sphere. */
+#define cproj(Val) __TGMATH_UNARY_IMAG (Val, cproj)
+
+
+/* Decomposing complex values. */
+
+/* Imaginary part of Z. */
+#define cimag(Val) __TGMATH_UNARY_REAL_IMAG_RET_REAL (Val, cimag, cimag)
+
+/* Real part of Z. */
+#define creal(Val) __TGMATH_UNARY_REAL_IMAG_RET_REAL (Val, creal, creal)
+
+#endif /* tgmath.h */
diff --git a/sysroot/usr/include/thread_db.h b/sysroot/usr/include/thread_db.h
new file mode 100644
index 0000000..433b54f
--- /dev/null
+++ b/sysroot/usr/include/thread_db.h
@@ -0,0 +1,459 @@
+/* thread_db.h -- interface to libthread_db.so library for debugging -lpthread
+ Copyright (C) 1999,2001,2002,2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _THREAD_DB_H
+#define _THREAD_DB_H 1
+
+/* This is the debugger interface for the NPTL library. It is
+ modelled closely after the interface with same names in Solaris
+ with the goal to share the same code in the debugger. */
+#include <pthread.h>
+#include <stdint.h>
+#include <sys/types.h>
+#include <sys/procfs.h>
+
+
+/* Error codes of the library. */
+typedef enum
+{
+ TD_OK, /* No error. */
+ TD_ERR, /* No further specified error. */
+ TD_NOTHR, /* No matching thread found. */
+ TD_NOSV, /* No matching synchronization handle found. */
+ TD_NOLWP, /* No matching light-weighted process found. */
+ TD_BADPH, /* Invalid process handle. */
+ TD_BADTH, /* Invalid thread handle. */
+ TD_BADSH, /* Invalid synchronization handle. */
+ TD_BADTA, /* Invalid thread agent. */
+ TD_BADKEY, /* Invalid key. */
+ TD_NOMSG, /* No event available. */
+ TD_NOFPREGS, /* No floating-point register content available. */
+ TD_NOLIBTHREAD, /* Application not linked with thread library. */
+ TD_NOEVENT, /* Requested event is not supported. */
+ TD_NOCAPAB, /* Capability not available. */
+ TD_DBERR, /* Internal debug library error. */
+ TD_NOAPLIC, /* Operation is not applicable. */
+ TD_NOTSD, /* No thread-specific data available. */
+ TD_MALLOC, /* Out of memory. */
+ TD_PARTIALREG, /* Not entire register set was read or written. */
+ TD_NOXREGS, /* X register set not available for given thread. */
+ TD_TLSDEFER, /* Thread has not yet allocated TLS for given module. */
+ TD_NOTALLOC = TD_TLSDEFER,
+ TD_VERSION, /* Version if libpthread and libthread_db do not match. */
+ TD_NOTLS /* There is no TLS segment in the given module. */
+} td_err_e;
+
+
+/* Possible thread states. TD_THR_ANY_STATE is a pseudo-state used to
+ select threads regardless of state in td_ta_thr_iter(). */
+typedef enum
+{
+ TD_THR_ANY_STATE,
+ TD_THR_UNKNOWN,
+ TD_THR_STOPPED,
+ TD_THR_RUN,
+ TD_THR_ACTIVE,
+ TD_THR_ZOMBIE,
+ TD_THR_SLEEP,
+ TD_THR_STOPPED_ASLEEP
+} td_thr_state_e;
+
+/* Thread type: user or system. TD_THR_ANY_TYPE is a pseudo-type used
+ to select threads regardless of type in td_ta_thr_iter(). */
+typedef enum
+{
+ TD_THR_ANY_TYPE,
+ TD_THR_USER,
+ TD_THR_SYSTEM
+} td_thr_type_e;
+
+
+/* Types of the debugging library. */
+
+/* Handle for a process. This type is opaque. */
+typedef struct td_thragent td_thragent_t;
+
+/* The actual thread handle type. This is also opaque. */
+typedef struct td_thrhandle
+{
+ td_thragent_t *th_ta_p;
+ psaddr_t th_unique;
+} td_thrhandle_t;
+
+
+/* Forward declaration of a type defined by and for the dynamic linker. */
+struct link_map;
+
+
+/* Flags for `td_ta_thr_iter'. */
+#define TD_THR_ANY_USER_FLAGS 0xffffffff
+#define TD_THR_LOWEST_PRIORITY -20
+#define TD_SIGNO_MASK NULL
+
+
+#define TD_EVENTSIZE 2
+#define BT_UISHIFT 5 /* log base 2 of BT_NBIPUI, to extract word index */
+#define BT_NBIPUI (1 << BT_UISHIFT) /* n bits per uint */
+#define BT_UIMASK (BT_NBIPUI - 1) /* to extract bit index */
+
+/* Bitmask of enabled events. */
+typedef struct td_thr_events
+{
+ uint32_t event_bits[TD_EVENTSIZE];
+} td_thr_events_t;
+
+/* Event set manipulation macros. */
+#define __td_eventmask(n) \
+ (UINT32_C (1) << (((n) - 1) & BT_UIMASK))
+#define __td_eventword(n) \
+ ((UINT32_C ((n) - 1)) >> BT_UISHIFT)
+
+#define td_event_emptyset(setp) \
+ do { \
+ int __i; \
+ for (__i = TD_EVENTSIZE; __i > 0; --__i) \
+ (setp)->event_bits[__i - 1] = 0; \
+ } while (0)
+
+#define td_event_fillset(setp) \
+ do { \
+ int __i; \
+ for (__i = TD_EVENTSIZE; __i > 0; --__i) \
+ (setp)->event_bits[__i - 1] = UINT32_C (0xffffffff); \
+ } while (0)
+
+#define td_event_addset(setp, n) \
+ (((setp)->event_bits[__td_eventword (n)]) |= __td_eventmask (n))
+#define td_event_delset(setp, n) \
+ (((setp)->event_bits[__td_eventword (n)]) &= ~__td_eventmask (n))
+#define td_eventismember(setp, n) \
+ (__td_eventmask (n) & ((setp)->event_bits[__td_eventword (n)]))
+#if TD_EVENTSIZE == 2
+# define td_eventisempty(setp) \
+ (!((setp)->event_bits[0]) && !((setp)->event_bits[1]))
+#else
+# error "td_eventisempty must be changed to match TD_EVENTSIZE"
+#endif
+
+/* Events reportable by the thread implementation. */
+typedef enum
+{
+ TD_ALL_EVENTS, /* Pseudo-event number. */
+ TD_EVENT_NONE = TD_ALL_EVENTS, /* Depends on context. */
+ TD_READY, /* Is executable now. */
+ TD_SLEEP, /* Blocked in a synchronization obj. */
+ TD_SWITCHTO, /* Now assigned to a process. */
+ TD_SWITCHFROM, /* Not anymore assigned to a process. */
+ TD_LOCK_TRY, /* Trying to get an unavailable lock. */
+ TD_CATCHSIG, /* Signal posted to the thread. */
+ TD_IDLE, /* Process getting idle. */
+ TD_CREATE, /* New thread created. */
+ TD_DEATH, /* Thread terminated. */
+ TD_PREEMPT, /* Preempted. */
+ TD_PRI_INHERIT, /* Inherited elevated priority. */
+ TD_REAP, /* Reaped. */
+ TD_CONCURRENCY, /* Number of processes changing. */
+ TD_TIMEOUT, /* Conditional variable wait timed out. */
+ TD_MIN_EVENT_NUM = TD_READY,
+ TD_MAX_EVENT_NUM = TD_TIMEOUT,
+ TD_EVENTS_ENABLE = 31 /* Event reporting enabled. */
+} td_event_e;
+
+/* Values representing the different ways events are reported. */
+typedef enum
+{
+ NOTIFY_BPT, /* User must insert breakpoint at u.bptaddr. */
+ NOTIFY_AUTOBPT, /* Breakpoint at u.bptaddr is automatically
+ inserted. */
+ NOTIFY_SYSCALL /* System call u.syscallno will be invoked. */
+} td_notify_e;
+
+/* Description how event type is reported. */
+typedef struct td_notify
+{
+ td_notify_e type; /* Way the event is reported. */
+ union
+ {
+ psaddr_t bptaddr; /* Address of breakpoint. */
+ int syscallno; /* Number of system call used. */
+ } u;
+} td_notify_t;
+
+/* Structure used to report event. */
+typedef struct td_event_msg
+{
+ td_event_e event; /* Event type being reported. */
+ const td_thrhandle_t *th_p; /* Thread reporting the event. */
+ union
+ {
+# if 0
+ td_synchandle_t *sh; /* Handle of synchronization object. */
+#endif
+ uintptr_t data; /* Event specific data. */
+ } msg;
+} td_event_msg_t;
+
+/* Structure containing event data available in each thread structure. */
+typedef struct
+{
+ td_thr_events_t eventmask; /* Mask of enabled events. */
+ td_event_e eventnum; /* Number of last event. */
+ void *eventdata; /* Data associated with event. */
+} td_eventbuf_t;
+
+
+/* Gathered statistics about the process. */
+typedef struct td_ta_stats
+{
+ int nthreads; /* Total number of threads in use. */
+ int r_concurrency; /* Concurrency level requested by user. */
+ int nrunnable_num; /* Average runnable threads, numerator. */
+ int nrunnable_den; /* Average runnable threads, denominator. */
+ int a_concurrency_num; /* Achieved concurrency level, numerator. */
+ int a_concurrency_den; /* Achieved concurrency level, denominator. */
+ int nlwps_num; /* Average number of processes in use,
+ numerator. */
+ int nlwps_den; /* Average number of processes in use,
+ denominator. */
+ int nidle_num; /* Average number of idling processes,
+ numerator. */
+ int nidle_den; /* Average number of idling processes,
+ denominator. */
+} td_ta_stats_t;
+
+
+/* Since Sun's library is based on Solaris threads we have to define a few
+ types to map them to POSIX threads. */
+typedef pthread_t thread_t;
+typedef pthread_key_t thread_key_t;
+
+
+/* Callback for iteration over threads. */
+typedef int td_thr_iter_f (const td_thrhandle_t *, void *);
+
+/* Callback for iteration over thread local data. */
+typedef int td_key_iter_f (thread_key_t, void (*) (void *), void *);
+
+
+
+/* Forward declaration. This has to be defined by the user. */
+struct ps_prochandle;
+
+
+/* Information about the thread. */
+typedef struct td_thrinfo
+{
+ td_thragent_t *ti_ta_p; /* Process handle. */
+ unsigned int ti_user_flags; /* Unused. */
+ thread_t ti_tid; /* Thread ID returned by
+ pthread_create(). */
+ char *ti_tls; /* Pointer to thread-local data. */
+ psaddr_t ti_startfunc; /* Start function passed to
+ pthread_create(). */
+ psaddr_t ti_stkbase; /* Base of thread's stack. */
+ long int ti_stksize; /* Size of thread's stack. */
+ psaddr_t ti_ro_area; /* Unused. */
+ int ti_ro_size; /* Unused. */
+ td_thr_state_e ti_state; /* Thread state. */
+ unsigned char ti_db_suspended; /* Nonzero if suspended by debugger. */
+ td_thr_type_e ti_type; /* Type of the thread (system vs
+ user thread). */
+ intptr_t ti_pc; /* Unused. */
+ intptr_t ti_sp; /* Unused. */
+ short int ti_flags; /* Unused. */
+ int ti_pri; /* Thread priority. */
+ lwpid_t ti_lid; /* Kernel PID for this thread. */
+ sigset_t ti_sigmask; /* Signal mask. */
+ unsigned char ti_traceme; /* Nonzero if event reporting
+ enabled. */
+ unsigned char ti_preemptflag; /* Unused. */
+ unsigned char ti_pirecflag; /* Unused. */
+ sigset_t ti_pending; /* Set of pending signals. */
+ td_thr_events_t ti_events; /* Set of enabled events. */
+} td_thrinfo_t;
+
+
+
+/* Prototypes for exported library functions. */
+
+/* Initialize the thread debug support library. */
+extern td_err_e td_init (void);
+
+/* Historical relict. Should not be used anymore. */
+extern td_err_e td_log (void);
+
+/* Return list of symbols the library can request. */
+extern const char **td_symbol_list (void);
+
+/* Generate new thread debug library handle for process PS. */
+extern td_err_e td_ta_new (struct ps_prochandle *__ps, td_thragent_t **__ta);
+
+/* Free resources allocated for TA. */
+extern td_err_e td_ta_delete (td_thragent_t *__ta);
+
+/* Get number of currently running threads in process associated with TA. */
+extern td_err_e td_ta_get_nthreads (const td_thragent_t *__ta, int *__np);
+
+/* Return process handle passed in `td_ta_new' for process associated with
+ TA. */
+extern td_err_e td_ta_get_ph (const td_thragent_t *__ta,
+ struct ps_prochandle **__ph);
+
+/* Map thread library handle PT to thread debug library handle for process
+ associated with TA and store result in *TH. */
+extern td_err_e td_ta_map_id2thr (const td_thragent_t *__ta, pthread_t __pt,
+ td_thrhandle_t *__th);
+
+/* Map process ID LWPID to thread debug library handle for process
+ associated with TA and store result in *TH. */
+extern td_err_e td_ta_map_lwp2thr (const td_thragent_t *__ta, lwpid_t __lwpid,
+ td_thrhandle_t *__th);
+
+
+/* Call for each thread in a process associated with TA the callback function
+ CALLBACK. */
+extern td_err_e td_ta_thr_iter (const td_thragent_t *__ta,
+ td_thr_iter_f *__callback, void *__cbdata_p,
+ td_thr_state_e __state, int __ti_pri,
+ sigset_t *__ti_sigmask_p,
+ unsigned int __ti_user_flags);
+
+/* Call for each defined thread local data entry the callback function KI. */
+extern td_err_e td_ta_tsd_iter (const td_thragent_t *__ta, td_key_iter_f *__ki,
+ void *__p);
+
+
+/* Get event address for EVENT. */
+extern td_err_e td_ta_event_addr (const td_thragent_t *__ta,
+ td_event_e __event, td_notify_t *__ptr);
+
+/* Enable EVENT in global mask. */
+extern td_err_e td_ta_set_event (const td_thragent_t *__ta,
+ td_thr_events_t *__event);
+
+/* Disable EVENT in global mask. */
+extern td_err_e td_ta_clear_event (const td_thragent_t *__ta,
+ td_thr_events_t *__event);
+
+/* Return information about last event. */
+extern td_err_e td_ta_event_getmsg (const td_thragent_t *__ta,
+ td_event_msg_t *__msg);
+
+
+/* Set suggested concurrency level for process associated with TA. */
+extern td_err_e td_ta_setconcurrency (const td_thragent_t *__ta, int __level);
+
+
+/* Enable collecting statistics for process associated with TA. */
+extern td_err_e td_ta_enable_stats (const td_thragent_t *__ta, int __enable);
+
+/* Reset statistics. */
+extern td_err_e td_ta_reset_stats (const td_thragent_t *__ta);
+
+/* Retrieve statistics from process associated with TA. */
+extern td_err_e td_ta_get_stats (const td_thragent_t *__ta,
+ td_ta_stats_t *__statsp);
+
+
+/* Validate that TH is a thread handle. */
+extern td_err_e td_thr_validate (const td_thrhandle_t *__th);
+
+/* Return information about thread TH. */
+extern td_err_e td_thr_get_info (const td_thrhandle_t *__th,
+ td_thrinfo_t *__infop);
+
+/* Retrieve floating-point register contents of process running thread TH. */
+extern td_err_e td_thr_getfpregs (const td_thrhandle_t *__th,
+ prfpregset_t *__regset);
+
+/* Retrieve general register contents of process running thread TH. */
+extern td_err_e td_thr_getgregs (const td_thrhandle_t *__th,
+ prgregset_t __gregs);
+
+/* Retrieve extended register contents of process running thread TH. */
+extern td_err_e td_thr_getxregs (const td_thrhandle_t *__th, void *__xregs);
+
+/* Get size of extended register set of process running thread TH. */
+extern td_err_e td_thr_getxregsize (const td_thrhandle_t *__th, int *__sizep);
+
+/* Set floating-point register contents of process running thread TH. */
+extern td_err_e td_thr_setfpregs (const td_thrhandle_t *__th,
+ const prfpregset_t *__fpregs);
+
+/* Set general register contents of process running thread TH. */
+extern td_err_e td_thr_setgregs (const td_thrhandle_t *__th,
+ prgregset_t __gregs);
+
+/* Set extended register contents of process running thread TH. */
+extern td_err_e td_thr_setxregs (const td_thrhandle_t *__th,
+ const void *__addr);
+
+
+/* Get address of the given module's TLS storage area for the given thread. */
+extern td_err_e td_thr_tlsbase (const td_thrhandle_t *__th,
+ unsigned long int __modid,
+ psaddr_t *__base);
+
+/* Get address of thread local variable. */
+extern td_err_e td_thr_tls_get_addr (const td_thrhandle_t *__th,
+ psaddr_t __map_address, size_t __offset,
+ psaddr_t *__address);
+
+
+/* Enable reporting for EVENT for thread TH. */
+extern td_err_e td_thr_event_enable (const td_thrhandle_t *__th, int __event);
+
+/* Enable EVENT for thread TH. */
+extern td_err_e td_thr_set_event (const td_thrhandle_t *__th,
+ td_thr_events_t *__event);
+
+/* Disable EVENT for thread TH. */
+extern td_err_e td_thr_clear_event (const td_thrhandle_t *__th,
+ td_thr_events_t *__event);
+
+/* Get event message for thread TH. */
+extern td_err_e td_thr_event_getmsg (const td_thrhandle_t *__th,
+ td_event_msg_t *__msg);
+
+
+/* Set priority of thread TH. */
+extern td_err_e td_thr_setprio (const td_thrhandle_t *__th, int __prio);
+
+
+/* Set pending signals for thread TH. */
+extern td_err_e td_thr_setsigpending (const td_thrhandle_t *__th,
+ unsigned char __n, const sigset_t *__ss);
+
+/* Set signal mask for thread TH. */
+extern td_err_e td_thr_sigsetmask (const td_thrhandle_t *__th,
+ const sigset_t *__ss);
+
+
+/* Return thread local data associated with key TK in thread TH. */
+extern td_err_e td_thr_tsd (const td_thrhandle_t *__th,
+ const thread_key_t __tk, void **__data);
+
+
+/* Suspend execution of thread TH. */
+extern td_err_e td_thr_dbsuspend (const td_thrhandle_t *__th);
+
+/* Resume execution of thread TH. */
+extern td_err_e td_thr_dbresume (const td_thrhandle_t *__th);
+
+#endif /* thread_db.h */
diff --git a/sysroot/usr/include/tic.h b/sysroot/usr/include/tic.h
new file mode 100644
index 0000000..4e10399
--- /dev/null
+++ b/sysroot/usr/include/tic.h
@@ -0,0 +1,332 @@
+/****************************************************************************
+ * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
+ * and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ * and: Thomas E. Dickey 1996 on *
+ ****************************************************************************/
+
+/*
+ * $Id: tic.h,v 1.62 2007/08/11 16:12:43 tom Exp $
+ * tic.h - Global variables and structures for the terminfo
+ * compiler.
+ */
+
+#ifndef __TIC_H
+#define __TIC_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <curses.h> /* for the _tracef() prototype, ERR/OK, bool defs */
+
+/*
+** The format of compiled terminfo files is as follows:
+**
+** Header (12 bytes), containing information given below
+** Names Section, containing the names of the terminal
+** Boolean Section, containing the values of all of the
+** boolean capabilities
+** A null byte may be inserted here to make
+** sure that the Number Section begins on an
+** even word boundary.
+** Number Section, containing the values of all of the numeric
+** capabilities, each as a short integer
+** String Section, containing short integer offsets into the
+** String Table, one per string capability
+** String Table, containing the actual characters of the string
+** capabilities.
+**
+** NOTE that all short integers in the file are stored using VAX/PDP-style
+** byte-order, i.e., least-significant byte first.
+**
+** There is no structure definition here because it would only confuse
+** matters. Terminfo format is a raw byte layout, not a structure
+** dump. If you happen to be on a little-endian machine with 16-bit
+** shorts that requires no padding between short members in a struct,
+** then there is a natural C structure that captures the header, but
+** not very helpfully.
+*/
+
+#define MAGIC 0432 /* first two bytes of a compiled entry */
+
+#undef BYTE
+#define BYTE(p,n) (unsigned char)((p)[n])
+
+#define IS_NEG1(p) ((BYTE(p,0) == 0377) && (BYTE(p,1) == 0377))
+#define IS_NEG2(p) ((BYTE(p,0) == 0376) && (BYTE(p,1) == 0377))
+#define LOW_MSB(p) (BYTE(p,0) + 256*BYTE(p,1))
+
+#define IS_TIC_MAGIC(p) (LOW_MSB(p) == MAGIC)
+
+/*
+ * The "maximum" here is misleading; XSI guarantees minimum values, which a
+ * given implementation may exceed.
+ */
+#define MAX_NAME_SIZE 512 /* maximum legal name field size (XSI:127) */
+#define MAX_ENTRY_SIZE 4096 /* maximum legal entry size */
+
+/*
+ * The maximum size of individual name or alias is guaranteed in XSI to be at
+ * least 14, since that corresponds to the older filename lengths. Newer
+ * systems allow longer aliases, though not many terminal descriptions are
+ * written to use them. The MAX_ALIAS symbol is used for warnings.
+ */
+#if HAVE_LONG_FILE_NAMES
+#define MAX_ALIAS 32 /* smaller than POSIX minimum for PATH_MAX */
+#else
+#define MAX_ALIAS 14 /* SVr3 filename length */
+#endif
+
+/* location of user's personal info directory */
+#define PRIVATE_INFO "%s/.terminfo" /* plug getenv("HOME") into %s */
+
+/*
+ * Some traces are designed to be used via tic's verbose option (and similar in
+ * infocmp and toe) rather than the 'trace()' function. So we use the bits
+ * above the normal trace() parameter as a debug-level.
+ */
+
+#define MAX_DEBUG_LEVEL 15
+#define DEBUG_LEVEL(n) ((n) << TRACE_SHIFT)
+
+#define set_trace_level(n) \
+ _nc_tracing &= DEBUG_LEVEL(MAX_DEBUG_LEVEL), \
+ _nc_tracing |= DEBUG_LEVEL(n)
+
+#ifdef TRACE
+#define DEBUG(n, a) if (_nc_tracing >= DEBUG_LEVEL(n)) _tracef a
+#else
+#define DEBUG(n, a) /*nothing*/
+#endif
+
+extern NCURSES_EXPORT_VAR(unsigned) _nc_tracing;
+extern NCURSES_EXPORT(void) _nc_tracef (char *, ...) GCC_PRINTFLIKE(1,2);
+extern NCURSES_EXPORT(const char *) _nc_visbuf (const char *);
+extern NCURSES_EXPORT(const char *) _nc_visbuf2 (int, const char *);
+
+/*
+ * These are the types of tokens returned by the scanner. The first
+ * three are also used in the hash table of capability names. The scanner
+ * returns one of these values after loading the specifics into the global
+ * structure curr_token.
+ */
+
+#define BOOLEAN 0 /* Boolean capability */
+#define NUMBER 1 /* Numeric capability */
+#define STRING 2 /* String-valued capability */
+#define CANCEL 3 /* Capability to be cancelled in following tc's */
+#define NAMES 4 /* The names for a terminal type */
+#define UNDEF 5 /* Undefined */
+
+#define NO_PUSHBACK -1 /* used in pushtype to indicate no pushback */
+
+ /*
+ * The global structure in which the specific parts of a
+ * scanned token are returned.
+ *
+ */
+
+struct token
+{
+ char *tk_name; /* name of capability */
+ int tk_valnumber; /* value of capability (if a number) */
+ char *tk_valstring; /* value of capability (if a string) */
+};
+
+extern NCURSES_EXPORT_VAR(struct token) _nc_curr_token;
+
+ /*
+ * Offsets to string capabilities, with the corresponding functionkey
+ * codes.
+ */
+struct tinfo_fkeys {
+ unsigned offset;
+ chtype code;
+ };
+
+#if BROKEN_LINKER
+
+#define _nc_tinfo_fkeys _nc_tinfo_fkeysf()
+extern NCURSES_EXPORT(const struct tinfo_fkeys *) _nc_tinfo_fkeysf (void);
+
+#else
+
+extern NCURSES_EXPORT_VAR(const struct tinfo_fkeys) _nc_tinfo_fkeys[];
+
+#endif
+
+ /*
+ * The file comp_captab.c contains an array of these structures, one
+ * per possible capability. These are indexed by a hash table array of
+ * pointers to the same structures for use by the parser.
+ */
+
+struct name_table_entry
+{
+ const char *nte_name; /* name to hash on */
+ int nte_type; /* BOOLEAN, NUMBER or STRING */
+ short nte_index; /* index of associated variable in its array */
+ short nte_link; /* index in table of next hash, or -1 */
+};
+
+struct alias
+{
+ const char *from;
+ const char *to;
+ const char *source;
+};
+
+extern NCURSES_EXPORT(const struct name_table_entry *) _nc_get_table (bool);
+extern NCURSES_EXPORT(const short *) _nc_get_hash_table (bool);
+extern NCURSES_EXPORT(const struct alias *) _nc_get_alias_table (bool);
+
+#define NOTFOUND ((struct name_table_entry *) 0)
+
+/* out-of-band values for representing absent capabilities */
+#define ABSENT_BOOLEAN ((signed char)-1) /* 255 */
+#define ABSENT_NUMERIC (-1)
+#define ABSENT_STRING (char *)0
+
+/* out-of-band values for representing cancels */
+#define CANCELLED_BOOLEAN ((signed char)-2) /* 254 */
+#define CANCELLED_NUMERIC (-2)
+#define CANCELLED_STRING (char *)(-1)
+
+#define VALID_BOOLEAN(s) ((unsigned char)(s) <= 1) /* reject "-1" */
+#define VALID_NUMERIC(s) ((s) >= 0)
+#define VALID_STRING(s) ((s) != CANCELLED_STRING && (s) != ABSENT_STRING)
+
+/* termcap entries longer than this may break old binaries */
+#define MAX_TERMCAP_LENGTH 1023
+
+/* this is a documented limitation of terminfo */
+#define MAX_TERMINFO_LENGTH 4096
+
+#ifndef TERMINFO
+#define TERMINFO "/usr/share/terminfo"
+#endif
+
+/* access.c */
+extern NCURSES_EXPORT(unsigned) _nc_pathlast (const char *);
+extern NCURSES_EXPORT(bool) _nc_is_abs_path (const char *);
+extern NCURSES_EXPORT(bool) _nc_is_dir_path (const char *);
+extern NCURSES_EXPORT(bool) _nc_is_file_path (const char *);
+extern NCURSES_EXPORT(char *) _nc_basename (char *);
+extern NCURSES_EXPORT(char *) _nc_rootname (char *);
+
+/* comp_hash.c: name lookup */
+extern NCURSES_EXPORT(struct name_table_entry const *) _nc_find_entry
+ (const char *, const short *);
+extern NCURSES_EXPORT(struct name_table_entry const *) _nc_find_type_entry
+ (const char *, int, const struct name_table_entry *);
+
+/* comp_scan.c: lexical analysis */
+extern NCURSES_EXPORT(int) _nc_get_token (bool);
+extern NCURSES_EXPORT(void) _nc_panic_mode (char);
+extern NCURSES_EXPORT(void) _nc_push_token (int);
+extern NCURSES_EXPORT(void) _nc_reset_input (FILE *, char *);
+extern NCURSES_EXPORT_VAR(int) _nc_curr_col;
+extern NCURSES_EXPORT_VAR(int) _nc_curr_line;
+extern NCURSES_EXPORT_VAR(int) _nc_syntax;
+extern NCURSES_EXPORT_VAR(long) _nc_comment_end;
+extern NCURSES_EXPORT_VAR(long) _nc_comment_start;
+extern NCURSES_EXPORT_VAR(long) _nc_curr_file_pos;
+extern NCURSES_EXPORT_VAR(long) _nc_start_line;
+#define SYN_TERMINFO 0
+#define SYN_TERMCAP 1
+
+/* comp_error.c: warning & abort messages */
+extern NCURSES_EXPORT(const char *) _nc_get_source (void);
+extern NCURSES_EXPORT(void) _nc_err_abort (const char *const,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
+extern NCURSES_EXPORT(void) _nc_get_type (char *name);
+extern NCURSES_EXPORT(void) _nc_set_source (const char *const);
+extern NCURSES_EXPORT(void) _nc_set_type (const char *const);
+extern NCURSES_EXPORT(void) _nc_syserr_abort (const char *const,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
+extern NCURSES_EXPORT(void) _nc_warning (const char *const,...) GCC_PRINTFLIKE(1,2);
+extern NCURSES_EXPORT_VAR(bool) _nc_suppress_warnings;
+
+/* comp_expand.c: expand string into readable form */
+extern NCURSES_EXPORT(char *) _nc_tic_expand (const char *, bool, int);
+
+/* comp_scan.c: decode string from readable form */
+extern NCURSES_EXPORT(int) _nc_trans_string (char *, char *);
+
+/* captoinfo.c: capability conversion */
+extern NCURSES_EXPORT(char *) _nc_captoinfo (const char *, const char *, int const);
+extern NCURSES_EXPORT(char *) _nc_infotocap (const char *, const char *, int const);
+
+/* home_terminfo.c */
+extern NCURSES_EXPORT(char *) _nc_home_terminfo (void);
+
+/* lib_tparm.c */
+#define NUM_PARM 9
+
+extern NCURSES_EXPORT_VAR(int) _nc_tparm_err;
+
+extern NCURSES_EXPORT(int) _nc_tparm_analyze(const char *, char **, int *);
+
+/* lib_tputs.c */
+extern NCURSES_EXPORT_VAR(int) _nc_nulls_sent; /* Add one for every null sent */
+
+/* comp_main.c: compiler main */
+extern const char * _nc_progname;
+
+/* db_iterator.c */
+typedef enum {
+ dbdTIC = 0,
+#if USE_DATABASE
+ dbdEnvOnce,
+ dbdHome,
+ dbdEnvList,
+ dbdCfgList,
+ dbdCfgOnce,
+#endif
+#if USE_TERMCAP
+ dbdEnvOnce2,
+ dbdEnvList2,
+ dbdCfgList2,
+#endif
+ dbdLAST
+} DBDIRS;
+
+extern NCURSES_EXPORT(const char *) _nc_next_db(DBDIRS *, int *);
+extern NCURSES_EXPORT(const char *) _nc_tic_dir (const char *);
+extern NCURSES_EXPORT(void) _nc_first_db(DBDIRS *, int *);
+extern NCURSES_EXPORT(void) _nc_last_db(void);
+
+/* write_entry.c */
+extern NCURSES_EXPORT(int) _nc_tic_written (void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __TIC_H */
diff --git a/sysroot/usr/include/time.h b/sysroot/usr/include/time.h
new file mode 100644
index 0000000..6c8f79d
--- /dev/null
+++ b/sysroot/usr/include/time.h
@@ -0,0 +1,420 @@
+/* Copyright (C) 1991-1999,2000,2001,2002,2003,2006
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99 Standard: 7.23 Date and time <time.h>
+ */
+
+#ifndef _TIME_H
+
+#if (! defined __need_time_t && !defined __need_clock_t && \
+ ! defined __need_timespec)
+# define _TIME_H 1
+# include <features.h>
+
+__BEGIN_DECLS
+
+#endif
+
+#ifdef _TIME_H
+/* Get size_t and NULL from <stddef.h>. */
+# define __need_size_t
+# define __need_NULL
+# include <stddef.h>
+
+/* This defines CLOCKS_PER_SEC, which is the number of processor clock
+ ticks per second. */
+# include <bits/time.h>
+
+/* This is the obsolete POSIX.1-1988 name for the same constant. */
+# if !defined __STRICT_ANSI__ && !defined __USE_XOPEN2K
+# ifndef CLK_TCK
+# define CLK_TCK CLOCKS_PER_SEC
+# endif
+# endif
+
+#endif /* <time.h> included. */
+
+#if !defined __clock_t_defined && (defined _TIME_H || defined __need_clock_t)
+# define __clock_t_defined 1
+
+# include <bits/types.h>
+
+__BEGIN_NAMESPACE_STD
+/* Returned by `clock'. */
+typedef __clock_t clock_t;
+__END_NAMESPACE_STD
+#if defined __USE_XOPEN || defined __USE_POSIX || defined __USE_MISC
+__USING_NAMESPACE_STD(clock_t)
+#endif
+
+#endif /* clock_t not defined and <time.h> or need clock_t. */
+#undef __need_clock_t
+
+#if !defined __time_t_defined && (defined _TIME_H || defined __need_time_t)
+# define __time_t_defined 1
+
+# include <bits/types.h>
+
+__BEGIN_NAMESPACE_STD
+/* Returned by `time'. */
+typedef __time_t time_t;
+__END_NAMESPACE_STD
+#if defined __USE_POSIX || defined __USE_MISC || defined __USE_SVID
+__USING_NAMESPACE_STD(time_t)
+#endif
+
+#endif /* time_t not defined and <time.h> or need time_t. */
+#undef __need_time_t
+
+#if !defined __clockid_t_defined && \
+ ((defined _TIME_H && defined __USE_POSIX199309) || defined __need_clockid_t)
+# define __clockid_t_defined 1
+
+# include <bits/types.h>
+
+/* Clock ID used in clock and timer functions. */
+typedef __clockid_t clockid_t;
+
+#endif /* clockid_t not defined and <time.h> or need clockid_t. */
+#undef __clockid_time_t
+
+#if !defined __timer_t_defined && \
+ ((defined _TIME_H && defined __USE_POSIX199309) || defined __need_timer_t)
+# define __timer_t_defined 1
+
+# include <bits/types.h>
+
+/* Timer ID returned by `timer_create'. */
+typedef __timer_t timer_t;
+
+#endif /* timer_t not defined and <time.h> or need timer_t. */
+#undef __need_timer_t
+
+
+#if !defined __timespec_defined && \
+ ((defined _TIME_H && \
+ (defined __USE_POSIX199309 || defined __USE_MISC)) || \
+ defined __need_timespec)
+# define __timespec_defined 1
+
+# include <bits/types.h> /* This defines __time_t for us. */
+
+/* POSIX.1b structure for a time value. This is like a `struct timeval' but
+ has nanoseconds instead of microseconds. */
+struct timespec
+ {
+ __time_t tv_sec; /* Seconds. */
+ long int tv_nsec; /* Nanoseconds. */
+ };
+
+#endif /* timespec not defined and <time.h> or need timespec. */
+#undef __need_timespec
+
+
+#ifdef _TIME_H
+__BEGIN_NAMESPACE_STD
+/* Used by other time functions. */
+struct tm
+{
+ int tm_sec; /* Seconds. [0-60] (1 leap second) */
+ int tm_min; /* Minutes. [0-59] */
+ int tm_hour; /* Hours. [0-23] */
+ int tm_mday; /* Day. [1-31] */
+ int tm_mon; /* Month. [0-11] */
+ int tm_year; /* Year - 1900. */
+ int tm_wday; /* Day of week. [0-6] */
+ int tm_yday; /* Days in year.[0-365] */
+ int tm_isdst; /* DST. [-1/0/1]*/
+
+#ifdef __USE_BSD
+ long int tm_gmtoff; /* Seconds east of UTC. */
+ __const char *tm_zone; /* Timezone abbreviation. */
+#else
+ long int __tm_gmtoff; /* Seconds east of UTC. */
+ __const char *__tm_zone; /* Timezone abbreviation. */
+#endif
+};
+__END_NAMESPACE_STD
+#if defined __USE_XOPEN || defined __USE_POSIX || defined __USE_MISC
+__USING_NAMESPACE_STD(tm)
+#endif
+
+
+#ifdef __USE_POSIX199309
+/* POSIX.1b structure for timer start values and intervals. */
+struct itimerspec
+ {
+ struct timespec it_interval;
+ struct timespec it_value;
+ };
+
+/* We can use a simple forward declaration. */
+struct sigevent;
+
+#endif /* POSIX.1b */
+
+#ifdef __USE_XOPEN2K
+# ifndef __pid_t_defined
+typedef __pid_t pid_t;
+# define __pid_t_defined
+# endif
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+/* Time used by the program so far (user time + system time).
+ The result / CLOCKS_PER_SECOND is program time in seconds. */
+extern clock_t clock (void) __THROW;
+
+/* Return the current time and put it in *TIMER if TIMER is not NULL. */
+extern time_t time (time_t *__timer) __THROW;
+
+/* Return the difference between TIME1 and TIME0. */
+extern double difftime (time_t __time1, time_t __time0)
+ __THROW __attribute__ ((__const__));
+
+/* Return the `time_t' representation of TP and normalize TP. */
+extern time_t mktime (struct tm *__tp) __THROW;
+
+
+/* Format TP into S according to FORMAT.
+ Write no more than MAXSIZE characters and return the number
+ of characters written, or 0 if it would exceed MAXSIZE. */
+extern size_t strftime (char *__restrict __s, size_t __maxsize,
+ __const char *__restrict __format,
+ __const struct tm *__restrict __tp) __THROW;
+__END_NAMESPACE_STD
+
+# ifdef __USE_XOPEN
+/* Parse S according to FORMAT and store binary time information in TP.
+ The return value is a pointer to the first unparsed character in S. */
+extern char *strptime (__const char *__restrict __s,
+ __const char *__restrict __fmt, struct tm *__tp)
+ __THROW;
+# endif
+
+# ifdef __USE_GNU
+/* Similar to the two functions above but take the information from
+ the provided locale and not the global locale. */
+# include <xlocale.h>
+
+extern size_t strftime_l (char *__restrict __s, size_t __maxsize,
+ __const char *__restrict __format,
+ __const struct tm *__restrict __tp,
+ __locale_t __loc) __THROW;
+
+extern char *strptime_l (__const char *__restrict __s,
+ __const char *__restrict __fmt, struct tm *__tp,
+ __locale_t __loc) __THROW;
+# endif
+
+
+__BEGIN_NAMESPACE_STD
+/* Return the `struct tm' representation of *TIMER
+ in Universal Coordinated Time (aka Greenwich Mean Time). */
+extern struct tm *gmtime (__const time_t *__timer) __THROW;
+
+/* Return the `struct tm' representation
+ of *TIMER in the local timezone. */
+extern struct tm *localtime (__const time_t *__timer) __THROW;
+__END_NAMESPACE_STD
+
+# if defined __USE_POSIX || defined __USE_MISC
+/* Return the `struct tm' representation of *TIMER in UTC,
+ using *TP to store the result. */
+extern struct tm *gmtime_r (__const time_t *__restrict __timer,
+ struct tm *__restrict __tp) __THROW;
+
+/* Return the `struct tm' representation of *TIMER in local time,
+ using *TP to store the result. */
+extern struct tm *localtime_r (__const time_t *__restrict __timer,
+ struct tm *__restrict __tp) __THROW;
+# endif /* POSIX or misc */
+
+__BEGIN_NAMESPACE_STD
+/* Return a string of the form "Day Mon dd hh:mm:ss yyyy\n"
+ that is the representation of TP in this format. */
+extern char *asctime (__const struct tm *__tp) __THROW;
+
+/* Equivalent to `asctime (localtime (timer))'. */
+extern char *ctime (__const time_t *__timer) __THROW;
+__END_NAMESPACE_STD
+
+# if defined __USE_POSIX || defined __USE_MISC
+/* Reentrant versions of the above functions. */
+
+/* Return in BUF a string of the form "Day Mon dd hh:mm:ss yyyy\n"
+ that is the representation of TP in this format. */
+extern char *asctime_r (__const struct tm *__restrict __tp,
+ char *__restrict __buf) __THROW;
+
+/* Equivalent to `asctime_r (localtime_r (timer, *TMP*), buf)'. */
+extern char *ctime_r (__const time_t *__restrict __timer,
+ char *__restrict __buf) __THROW;
+# endif /* POSIX or misc */
+
+
+/* Defined in localtime.c. */
+extern char *__tzname[2]; /* Current timezone names. */
+extern int __daylight; /* If daylight-saving time is ever in use. */
+extern long int __timezone; /* Seconds west of UTC. */
+
+
+# ifdef __USE_POSIX
+/* Same as above. */
+extern char *tzname[2];
+
+/* Set time conversion information from the TZ environment variable.
+ If TZ is not defined, a locale-dependent default is used. */
+extern void tzset (void) __THROW;
+# endif
+
+# if defined __USE_SVID || defined __USE_XOPEN
+extern int daylight;
+extern long int timezone;
+# endif
+
+# ifdef __USE_SVID
+/* Set the system time to *WHEN.
+ This call is restricted to the superuser. */
+extern int stime (__const time_t *__when) __THROW;
+# endif
+
+
+/* Nonzero if YEAR is a leap year (every 4 years,
+ except every 100th isn't, and every 400th is). */
+# define __isleap(year) \
+ ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
+
+
+# ifdef __USE_MISC
+/* Miscellaneous functions many Unices inherited from the public domain
+ localtime package. These are included only for compatibility. */
+
+/* Like `mktime', but for TP represents Universal Time, not local time. */
+extern time_t timegm (struct tm *__tp) __THROW;
+
+/* Another name for `mktime'. */
+extern time_t timelocal (struct tm *__tp) __THROW;
+
+/* Return the number of days in YEAR. */
+extern int dysize (int __year) __THROW __attribute__ ((__const__));
+# endif
+
+
+# ifdef __USE_POSIX199309
+/* Pause execution for a number of nanoseconds.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int nanosleep (__const struct timespec *__requested_time,
+ struct timespec *__remaining);
+
+
+/* Get resolution of clock CLOCK_ID. */
+extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __THROW;
+
+/* Get current value of clock CLOCK_ID and store it in TP. */
+extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __THROW;
+
+/* Set clock CLOCK_ID to value TP. */
+extern int clock_settime (clockid_t __clock_id, __const struct timespec *__tp)
+ __THROW;
+
+# ifdef __USE_XOPEN2K
+/* High-resolution sleep with the specified clock.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int clock_nanosleep (clockid_t __clock_id, int __flags,
+ __const struct timespec *__req,
+ struct timespec *__rem);
+
+/* Return clock ID for CPU-time clock. */
+extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __THROW;
+# endif
+
+
+/* Create new per-process timer using CLOCK_ID. */
+extern int timer_create (clockid_t __clock_id,
+ struct sigevent *__restrict __evp,
+ timer_t *__restrict __timerid) __THROW;
+
+/* Delete timer TIMERID. */
+extern int timer_delete (timer_t __timerid) __THROW;
+
+/* Set timer TIMERID to VALUE, returning old value in OVLAUE. */
+extern int timer_settime (timer_t __timerid, int __flags,
+ __const struct itimerspec *__restrict __value,
+ struct itimerspec *__restrict __ovalue) __THROW;
+
+/* Get current value of timer TIMERID and store it in VLAUE. */
+extern int timer_gettime (timer_t __timerid, struct itimerspec *__value)
+ __THROW;
+
+/* Get expiration overrun for timer TIMERID. */
+extern int timer_getoverrun (timer_t __timerid) __THROW;
+# endif
+
+
+# ifdef __USE_XOPEN_EXTENDED
+/* Set to one of the following values to indicate an error.
+ 1 the DATEMSK environment variable is null or undefined,
+ 2 the template file cannot be opened for reading,
+ 3 failed to get file status information,
+ 4 the template file is not a regular file,
+ 5 an error is encountered while reading the template file,
+ 6 memory allication failed (not enough memory available),
+ 7 there is no line in the template that matches the input,
+ 8 invalid input specification Example: February 31 or a time is
+ specified that can not be represented in a time_t (representing
+ the time in seconds since 00:00:00 UTC, January 1, 1970) */
+extern int getdate_err;
+
+/* Parse the given string as a date specification and return a value
+ representing the value. The templates from the file identified by
+ the environment variable DATEMSK are used. In case of an error
+ `getdate_err' is set.
+
+ This function is a possible cancellation points and therefore not
+ marked with __THROW. */
+extern struct tm *getdate (__const char *__string);
+# endif
+
+# ifdef __USE_GNU
+/* Since `getdate' is not reentrant because of the use of `getdate_err'
+ and the static buffer to return the result in, we provide a thread-safe
+ variant. The functionality is the same. The result is returned in
+ the buffer pointed to by RESBUFP and in case of an error the return
+ value is != 0 with the same values as given above for `getdate_err'.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int getdate_r (__const char *__restrict __string,
+ struct tm *__restrict __resbufp);
+# endif
+
+__END_DECLS
+
+#endif /* <time.h> included. */
+
+#endif /* <time.h> not already included. */
diff --git a/sysroot/usr/include/ttyent.h b/sysroot/usr/include/ttyent.h
new file mode 100644
index 0000000..0b221bc
--- /dev/null
+++ b/sysroot/usr/include/ttyent.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)ttyent.h 8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _TTYENT_H
+#define _TTYENT_H 1
+
+#include <features.h>
+
+#define _PATH_TTYS "/etc/ttys"
+
+#define _TTYS_OFF "off"
+#define _TTYS_ON "on"
+#define _TTYS_SECURE "secure"
+#define _TTYS_WINDOW "window"
+
+struct ttyent {
+ char *ty_name; /* terminal device name */
+ char *ty_getty; /* command to execute, usually getty */
+ char *ty_type; /* terminal type for termcap */
+#define TTY_ON 0x01 /* enable logins (start ty_getty program) */
+#define TTY_SECURE 0x02 /* allow uid of 0 to login */
+ int ty_status; /* status flags */
+ char *ty_window; /* command to start up window manager */
+ char *ty_comment; /* comment field */
+};
+
+
+__BEGIN_DECLS
+
+extern struct ttyent *getttyent (void) __THROW;
+extern struct ttyent *getttynam (__const char *__tty) __THROW;
+extern int setttyent (void) __THROW;
+extern int endttyent (void) __THROW;
+
+__END_DECLS
+
+#endif /* ttyent.h */
diff --git a/sysroot/usr/include/ucontext.h b/sysroot/usr/include/ucontext.h
new file mode 100644
index 0000000..ee6f594
--- /dev/null
+++ b/sysroot/usr/include/ucontext.h
@@ -0,0 +1,53 @@
+/* Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* System V ABI compliant user-level context switching support. */
+
+#ifndef _UCONTEXT_H
+#define _UCONTEXT_H 1
+
+#include <features.h>
+
+/* Get machine dependent definition of data structures. */
+#include <sys/ucontext.h>
+
+__BEGIN_DECLS
+
+/* Get user context and store it in variable pointed to by UCP. */
+extern int getcontext (ucontext_t *__ucp) __THROW;
+
+/* Set user context from information of variable pointed to by UCP. */
+extern int setcontext (__const ucontext_t *__ucp) __THROW;
+
+/* Save current context in context variable pointed to by OUCP and set
+ context from variable pointed to by UCP. */
+extern int swapcontext (ucontext_t *__restrict __oucp,
+ __const ucontext_t *__restrict __ucp) __THROW;
+
+/* Manipulate user context UCP to continue with calling functions FUNC
+ and the ARGC-1 parameters following ARGC when the context is used
+ the next time in `setcontext' or `swapcontext'.
+
+ We cannot say anything about the parameters FUNC takes; `void'
+ is as good as any other choice. */
+extern void makecontext (ucontext_t *__ucp, void (*__func) (void),
+ int __argc, ...) __THROW;
+
+__END_DECLS
+
+#endif /* ucontext.h */
diff --git a/sysroot/usr/include/ulimit.h b/sysroot/usr/include/ulimit.h
new file mode 100644
index 0000000..93b5f37
--- /dev/null
+++ b/sysroot/usr/include/ulimit.h
@@ -0,0 +1,48 @@
+/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _ULIMIT_H
+#define _ULIMIT_H 1
+
+#include <features.h>
+
+/* Constants used as the first parameter for `ulimit'. They denote limits
+ which can be set or retrieved using this function. */
+enum
+{
+ UL_GETFSIZE = 1, /* Return limit on the size of a file,
+ in units of 512 bytes. */
+#define UL_GETFSIZE UL_GETFSIZE
+ UL_SETFSIZE, /* Set limit on the size of a file to
+ second argument. */
+#define UL_SETFSIZE UL_SETFSIZE
+ __UL_GETMAXBRK, /* Return the maximum possible address
+ of the data segment. */
+ __UL_GETOPENMAX /* Return the maximum number of files
+ that the calling process can open.*/
+};
+
+
+__BEGIN_DECLS
+
+/* Control process limits according to CMD. */
+extern long int ulimit (int __cmd, ...) __THROW;
+
+__END_DECLS
+
+#endif /* ulimit.h */
diff --git a/sysroot/usr/include/unctrl.h b/sysroot/usr/include/unctrl.h
new file mode 100644
index 0000000..e2bb42b
--- /dev/null
+++ b/sysroot/usr/include/unctrl.h
@@ -0,0 +1,63 @@
+/****************************************************************************
+ * Copyright (c) 1998,2000 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
+ * and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ ****************************************************************************/
+
+/*
+ * unctrl.h
+ *
+ * Display a printable version of a control character.
+ * Control characters are displayed in caret notation (^x), DELETE is displayed
+ * as ^?. Printable characters are displayed as is.
+ */
+
+/* $Id: unctrl.h.in,v 1.10 2001/03/24 21:53:25 tom Exp $ */
+
+#ifndef NCURSES_UNCTRL_H_incl
+#define NCURSES_UNCTRL_H_incl 1
+
+#undef NCURSES_VERSION
+#define NCURSES_VERSION "5.6"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <curses.h>
+
+#undef unctrl
+NCURSES_EXPORT(NCURSES_CONST char *) unctrl (chtype);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* NCURSES_UNCTRL_H_incl */
diff --git a/sysroot/usr/include/unistd.h b/sysroot/usr/include/unistd.h
new file mode 100644
index 0000000..476c1f3
--- /dev/null
+++ b/sysroot/usr/include/unistd.h
@@ -0,0 +1,1105 @@
+/* Copyright (C) 1991-2006, 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * POSIX Standard: 2.10 Symbolic Constants <unistd.h>
+ */
+
+#ifndef _UNISTD_H
+#define _UNISTD_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* These may be used to determine what facilities are present at compile time.
+ Their values can be obtained at run time from `sysconf'. */
+
+/* POSIX Standard approved as ISO/IEC 9945-1 as of December 2001. */
+#define _POSIX_VERSION 200112L
+
+/* These are not #ifdef __USE_POSIX2 because they are
+ in the theoretically application-owned namespace. */
+
+/* The utilities on GNU systems also correspond to this version. */
+#define _POSIX2_VERSION 200112L
+
+/* If defined, the implementation supports the
+ C Language Bindings Option. */
+#define _POSIX2_C_BIND 200112L
+
+/* If defined, the implementation supports the
+ C Language Development Utilities Option. */
+#define _POSIX2_C_DEV 200112L
+
+/* If defined, the implementation supports the
+ Software Development Utilities Option. */
+#define _POSIX2_SW_DEV 200112L
+
+/* If defined, the implementation supports the
+ creation of locales with the localedef utility. */
+#define _POSIX2_LOCALEDEF 200112L
+
+/* X/Open version number to which the library conforms. It is selectable. */
+#ifdef __USE_XOPEN2K
+# define _XOPEN_VERSION 600
+#elif defined __USE_UNIX98
+# define _XOPEN_VERSION 500
+#else
+# define _XOPEN_VERSION 4
+#endif
+
+/* Commands and utilities from XPG4 are available. */
+#define _XOPEN_XCU_VERSION 4
+
+/* We are compatible with the old published standards as well. */
+#define _XOPEN_XPG2 1
+#define _XOPEN_XPG3 1
+#define _XOPEN_XPG4 1
+
+/* The X/Open Unix extensions are available. */
+#define _XOPEN_UNIX 1
+
+/* Encryption is present. */
+#define _XOPEN_CRYPT 1
+
+/* The enhanced internationalization capabilities according to XPG4.2
+ are present. */
+#define _XOPEN_ENH_I18N 1
+
+/* The legacy interfaces are also available. */
+#define _XOPEN_LEGACY 1
+
+
+/* Get values of POSIX options:
+
+ If these symbols are defined, the corresponding features are
+ always available. If not, they may be available sometimes.
+ The current values can be obtained with `sysconf'.
+
+ _POSIX_JOB_CONTROL Job control is supported.
+ _POSIX_SAVED_IDS Processes have a saved set-user-ID
+ and a saved set-group-ID.
+ _POSIX_REALTIME_SIGNALS Real-time, queued signals are supported.
+ _POSIX_PRIORITY_SCHEDULING Priority scheduling is supported.
+ _POSIX_TIMERS POSIX.4 clocks and timers are supported.
+ _POSIX_ASYNCHRONOUS_IO Asynchronous I/O is supported.
+ _POSIX_PRIORITIZED_IO Prioritized asynchronous I/O is supported.
+ _POSIX_SYNCHRONIZED_IO Synchronizing file data is supported.
+ _POSIX_FSYNC The fsync function is present.
+ _POSIX_MAPPED_FILES Mapping of files to memory is supported.
+ _POSIX_MEMLOCK Locking of all memory is supported.
+ _POSIX_MEMLOCK_RANGE Locking of ranges of memory is supported.
+ _POSIX_MEMORY_PROTECTION Setting of memory protections is supported.
+ _POSIX_MESSAGE_PASSING POSIX.4 message queues are supported.
+ _POSIX_SEMAPHORES POSIX.4 counting semaphores are supported.
+ _POSIX_SHARED_MEMORY_OBJECTS POSIX.4 shared memory objects are supported.
+ _POSIX_THREADS POSIX.1c pthreads are supported.
+ _POSIX_THREAD_ATTR_STACKADDR Thread stack address attribute option supported.
+ _POSIX_THREAD_ATTR_STACKSIZE Thread stack size attribute option supported.
+ _POSIX_THREAD_SAFE_FUNCTIONS Thread-safe functions are supported.
+ _POSIX_THREAD_PRIORITY_SCHEDULING
+ POSIX.1c thread execution scheduling supported.
+ _POSIX_THREAD_PRIO_INHERIT Thread priority inheritance option supported.
+ _POSIX_THREAD_PRIO_PROTECT Thread priority protection option supported.
+ _POSIX_THREAD_PROCESS_SHARED Process-shared synchronization supported.
+ _POSIX_PII Protocol-independent interfaces are supported.
+ _POSIX_PII_XTI XTI protocol-indep. interfaces are supported.
+ _POSIX_PII_SOCKET Socket protocol-indep. interfaces are supported.
+ _POSIX_PII_INTERNET Internet family of protocols supported.
+ _POSIX_PII_INTERNET_STREAM Connection-mode Internet protocol supported.
+ _POSIX_PII_INTERNET_DGRAM Connectionless Internet protocol supported.
+ _POSIX_PII_OSI ISO/OSI family of protocols supported.
+ _POSIX_PII_OSI_COTS Connection-mode ISO/OSI service supported.
+ _POSIX_PII_OSI_CLTS Connectionless ISO/OSI service supported.
+ _POSIX_POLL Implementation supports `poll' function.
+ _POSIX_SELECT Implementation supports `select' and `pselect'.
+
+ _XOPEN_REALTIME X/Open realtime support is available.
+ _XOPEN_REALTIME_THREADS X/Open realtime thread support is available.
+ _XOPEN_SHM Shared memory interface according to XPG4.2.
+
+ _XBS5_ILP32_OFF32 Implementation provides environment with 32-bit
+ int, long, pointer, and off_t types.
+ _XBS5_ILP32_OFFBIG Implementation provides environment with 32-bit
+ int, long, and pointer and off_t with at least
+ 64 bits.
+ _XBS5_LP64_OFF64 Implementation provides environment with 32-bit
+ int, and 64-bit long, pointer, and off_t types.
+ _XBS5_LPBIG_OFFBIG Implementation provides environment with at
+ least 32 bits int and long, pointer, and off_t
+ with at least 64 bits.
+
+ If any of these symbols is defined as -1, the corresponding option is not
+ true for any file. If any is defined as other than -1, the corresponding
+ option is true for all files. If a symbol is not defined at all, the value
+ for a specific file can be obtained from `pathconf' and `fpathconf'.
+
+ _POSIX_CHOWN_RESTRICTED Only the super user can use `chown' to change
+ the owner of a file. `chown' can only be used
+ to change the group ID of a file to a group of
+ which the calling process is a member.
+ _POSIX_NO_TRUNC Pathname components longer than
+ NAME_MAX generate an error.
+ _POSIX_VDISABLE If defined, if the value of an element of the
+ `c_cc' member of `struct termios' is
+ _POSIX_VDISABLE, no character will have the
+ effect associated with that element.
+ _POSIX_SYNC_IO Synchronous I/O may be performed.
+ _POSIX_ASYNC_IO Asynchronous I/O may be performed.
+ _POSIX_PRIO_IO Prioritized Asynchronous I/O may be performed.
+
+ Support for the Large File Support interface is not generally available.
+ If it is available the following constants are defined to one.
+ _LFS64_LARGEFILE Low-level I/O supports large files.
+ _LFS64_STDIO Standard I/O supports large files.
+ */
+
+#include <bits/posix_opt.h>
+
+/* Get the environment definitions from Unix98. */
+#ifdef __USE_UNIX98
+# include <bits/environments.h>
+#endif
+
+/* Standard file descriptors. */
+#define STDIN_FILENO 0 /* Standard input. */
+#define STDOUT_FILENO 1 /* Standard output. */
+#define STDERR_FILENO 2 /* Standard error output. */
+
+
+/* All functions that are not declared anywhere else. */
+
+#include <bits/types.h>
+
+#ifndef __ssize_t_defined
+typedef __ssize_t ssize_t;
+# define __ssize_t_defined
+#endif
+
+#define __need_size_t
+#define __need_NULL
+#include <stddef.h>
+
+#if defined __USE_XOPEN || defined __USE_XOPEN2K
+/* The Single Unix specification says that some more types are
+ available here. */
+# ifndef __gid_t_defined
+typedef __gid_t gid_t;
+# define __gid_t_defined
+# endif
+
+# ifndef __uid_t_defined
+typedef __uid_t uid_t;
+# define __uid_t_defined
+# endif
+
+# ifndef __off_t_defined
+# ifndef __USE_FILE_OFFSET64
+typedef __off_t off_t;
+# else
+typedef __off64_t off_t;
+# endif
+# define __off_t_defined
+# endif
+# if defined __USE_LARGEFILE64 && !defined __off64_t_defined
+typedef __off64_t off64_t;
+# define __off64_t_defined
+# endif
+
+# ifndef __useconds_t_defined
+typedef __useconds_t useconds_t;
+# define __useconds_t_defined
+# endif
+
+# ifndef __pid_t_defined
+typedef __pid_t pid_t;
+# define __pid_t_defined
+# endif
+#endif /* X/Open */
+
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
+# ifndef __intptr_t_defined
+typedef __intptr_t intptr_t;
+# define __intptr_t_defined
+# endif
+#endif
+
+#if defined __USE_BSD || defined __USE_XOPEN
+# ifndef __socklen_t_defined
+typedef __socklen_t socklen_t;
+# define __socklen_t_defined
+# endif
+#endif
+
+/* Values for the second argument to access.
+ These may be OR'd together. */
+#define R_OK 4 /* Test for read permission. */
+#define W_OK 2 /* Test for write permission. */
+#define X_OK 1 /* Test for execute permission. */
+#define F_OK 0 /* Test for existence. */
+
+/* Test for access to NAME using the real UID and real GID. */
+extern int access (__const char *__name, int __type) __THROW __nonnull ((1));
+
+#ifdef __USE_GNU
+/* Test for access to NAME using the effective UID and GID
+ (as normal file operations use). */
+extern int euidaccess (__const char *__name, int __type)
+ __THROW __nonnull ((1));
+
+/* An alias for `euidaccess', used by some other systems. */
+extern int eaccess (__const char *__name, int __type)
+ __THROW __nonnull ((1));
+#endif
+
+#ifdef __USE_ATFILE
+/* Test for access to FILE relative to the directory FD is open on.
+ If AT_EACCESS is set in FLAG, then use effective IDs like `eaccess',
+ otherwise use real IDs like `access'. */
+extern int faccessat (int __fd, __const char *__file, int __type, int __flag)
+ __THROW __nonnull ((2)) __wur;
+#endif /* Use GNU. */
+
+
+/* Values for the WHENCE argument to lseek. */
+#ifndef _STDIO_H /* <stdio.h> has the same definitions. */
+# define SEEK_SET 0 /* Seek from beginning of file. */
+# define SEEK_CUR 1 /* Seek from current position. */
+# define SEEK_END 2 /* Seek from end of file. */
+#endif
+
+#if defined __USE_BSD && !defined L_SET
+/* Old BSD names for the same constants; just for compatibility. */
+# define L_SET SEEK_SET
+# define L_INCR SEEK_CUR
+# define L_XTND SEEK_END
+#endif
+
+
+/* Move FD's file position to OFFSET bytes from the
+ beginning of the file (if WHENCE is SEEK_SET),
+ the current position (if WHENCE is SEEK_CUR),
+ or the end of the file (if WHENCE is SEEK_END).
+ Return the new file position. */
+#ifndef __USE_FILE_OFFSET64
+extern __off_t lseek (int __fd, __off_t __offset, int __whence) __THROW;
+#else
+# ifdef __REDIRECT_NTH
+extern __off64_t __REDIRECT_NTH (lseek,
+ (int __fd, __off64_t __offset, int __whence),
+ lseek64);
+# else
+# define lseek lseek64
+# endif
+#endif
+#ifdef __USE_LARGEFILE64
+extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
+ __THROW;
+#endif
+
+/* Close the file descriptor FD.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int close (int __fd);
+
+/* Read NBYTES into BUF from FD. Return the
+ number read, -1 for errors or 0 for EOF.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur;
+
+/* Write N bytes of BUF to FD. Return the number written, or -1.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern ssize_t write (int __fd, __const void *__buf, size_t __n) __wur;
+
+#ifdef __USE_UNIX98
+# ifndef __USE_FILE_OFFSET64
+/* Read NBYTES into BUF from FD at the given position OFFSET without
+ changing the file pointer. Return the number read, -1 for errors
+ or 0 for EOF.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern ssize_t pread (int __fd, void *__buf, size_t __nbytes,
+ __off_t __offset) __wur;
+
+/* Write N bytes of BUF to FD at the given position OFFSET without
+ changing the file pointer. Return the number written, or -1.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern ssize_t pwrite (int __fd, __const void *__buf, size_t __n,
+ __off_t __offset) __wur;
+# else
+# ifdef __REDIRECT
+extern ssize_t __REDIRECT (pread, (int __fd, void *__buf, size_t __nbytes,
+ __off64_t __offset),
+ pread64) __wur;
+extern ssize_t __REDIRECT (pwrite, (int __fd, __const void *__buf,
+ size_t __nbytes, __off64_t __offset),
+ pwrite64) __wur;
+# else
+# define pread pread64
+# define pwrite pwrite64
+# endif
+# endif
+
+# ifdef __USE_LARGEFILE64
+/* Read NBYTES into BUF from FD at the given position OFFSET without
+ changing the file pointer. Return the number read, -1 for errors
+ or 0 for EOF. */
+extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
+ __off64_t __offset) __wur;
+/* Write N bytes of BUF to FD at the given position OFFSET without
+ changing the file pointer. Return the number written, or -1. */
+extern ssize_t pwrite64 (int __fd, __const void *__buf, size_t __n,
+ __off64_t __offset) __wur;
+# endif
+#endif
+
+/* Create a one-way communication channel (pipe).
+ If successful, two file descriptors are stored in PIPEDES;
+ bytes written on PIPEDES[1] can be read from PIPEDES[0].
+ Returns 0 if successful, -1 if not. */
+extern int pipe (int __pipedes[2]) __THROW __wur;
+
+/* Schedule an alarm. In SECONDS seconds, the process will get a SIGALRM.
+ If SECONDS is zero, any currently scheduled alarm will be cancelled.
+ The function returns the number of seconds remaining until the last
+ alarm scheduled would have signaled, or zero if there wasn't one.
+ There is no return value to indicate an error, but you can set `errno'
+ to 0 and check its value after calling `alarm', and this might tell you.
+ The signal may come late due to processor scheduling. */
+extern unsigned int alarm (unsigned int __seconds) __THROW;
+
+/* Make the process sleep for SECONDS seconds, or until a signal arrives
+ and is not ignored. The function returns the number of seconds less
+ than SECONDS which it actually slept (thus zero if it slept the full time).
+ If a signal handler does a `longjmp' or modifies the handling of the
+ SIGALRM signal while inside `sleep' call, the handling of the SIGALRM
+ signal afterwards is undefined. There is no return value to indicate
+ error, but if `sleep' returns SECONDS, it probably didn't work.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern unsigned int sleep (unsigned int __seconds);
+
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+/* Set an alarm to go off (generating a SIGALRM signal) in VALUE
+ microseconds. If INTERVAL is nonzero, when the alarm goes off, the
+ timer is reset to go off every INTERVAL microseconds thereafter.
+ Returns the number of microseconds remaining before the alarm. */
+extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
+ __THROW;
+
+/* Sleep USECONDS microseconds, or until a signal arrives that is not blocked
+ or ignored.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int usleep (__useconds_t __useconds);
+#endif
+
+
+/* Suspend the process until a signal arrives.
+ This always returns -1 and sets `errno' to EINTR.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int pause (void);
+
+
+/* Change the owner and group of FILE. */
+extern int chown (__const char *__file, __uid_t __owner, __gid_t __group)
+ __THROW __nonnull ((1)) __wur;
+
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+/* Change the owner and group of the file that FD is open on. */
+extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __THROW __wur;
+
+
+/* Change owner and group of FILE, if it is a symbolic
+ link the ownership of the symbolic link is changed. */
+extern int lchown (__const char *__file, __uid_t __owner, __gid_t __group)
+ __THROW __nonnull ((1)) __wur;
+
+#endif /* Use BSD || X/Open Unix. */
+
+#ifdef __USE_ATFILE
+/* Change the owner and group of FILE relative to the directory FD is open
+ on. */
+extern int fchownat (int __fd, __const char *__file, __uid_t __owner,
+ __gid_t __group, int __flag)
+ __THROW __nonnull ((2)) __wur;
+#endif /* Use GNU. */
+
+/* Change the process's working directory to PATH. */
+extern int chdir (__const char *__path) __THROW __nonnull ((1)) __wur;
+
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+/* Change the process's working directory to the one FD is open on. */
+extern int fchdir (int __fd) __THROW __wur;
+#endif
+
+/* Get the pathname of the current working directory,
+ and put it in SIZE bytes of BUF. Returns NULL if the
+ directory couldn't be determined or SIZE was too small.
+ If successful, returns BUF. In GNU, if BUF is NULL,
+ an array is allocated with `malloc'; the array is SIZE
+ bytes long, unless SIZE == 0, in which case it is as
+ big as necessary. */
+extern char *getcwd (char *__buf, size_t __size) __THROW __wur;
+
+#ifdef __USE_GNU
+/* Return a malloc'd string containing the current directory name.
+ If the environment variable `PWD' is set, and its value is correct,
+ that value is used. */
+extern char *get_current_dir_name (void) __THROW;
+#endif
+
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+/* Put the absolute pathname of the current working directory in BUF.
+ If successful, return BUF. If not, put an error message in
+ BUF and return NULL. BUF should be at least PATH_MAX bytes long. */
+extern char *getwd (char *__buf)
+ __THROW __nonnull ((1)) __attribute_deprecated__ __wur;
+#endif
+
+
+/* Duplicate FD, returning a new file descriptor on the same file. */
+extern int dup (int __fd) __THROW __wur;
+
+/* Duplicate FD to FD2, closing FD2 and making it open on the same file. */
+extern int dup2 (int __fd, int __fd2) __THROW;
+
+/* NULL-terminated array of "NAME=VALUE" environment variables. */
+extern char **__environ;
+#ifdef __USE_GNU
+extern char **environ;
+#endif
+
+
+/* Replace the current process, executing PATH with arguments ARGV and
+ environment ENVP. ARGV and ENVP are terminated by NULL pointers. */
+extern int execve (__const char *__path, char *__const __argv[],
+ char *__const __envp[]) __THROW __nonnull ((1));
+
+#ifdef __USE_GNU
+/* Execute the file FD refers to, overlaying the running program image.
+ ARGV and ENVP are passed to the new program, as for `execve'. */
+extern int fexecve (int __fd, char *__const __argv[], char *__const __envp[])
+ __THROW;
+#endif
+
+
+/* Execute PATH with arguments ARGV and environment from `environ'. */
+extern int execv (__const char *__path, char *__const __argv[])
+ __THROW __nonnull ((1));
+
+/* Execute PATH with all arguments after PATH until a NULL pointer,
+ and the argument after that for environment. */
+extern int execle (__const char *__path, __const char *__arg, ...)
+ __THROW __nonnull ((1));
+
+/* Execute PATH with all arguments after PATH until
+ a NULL pointer and environment from `environ'. */
+extern int execl (__const char *__path, __const char *__arg, ...)
+ __THROW __nonnull ((1));
+
+/* Execute FILE, searching in the `PATH' environment variable if it contains
+ no slashes, with arguments ARGV and environment from `environ'. */
+extern int execvp (__const char *__file, char *__const __argv[])
+ __THROW __nonnull ((1));
+
+/* Execute FILE, searching in the `PATH' environment variable if
+ it contains no slashes, with all arguments after FILE until a
+ NULL pointer and environment from `environ'. */
+extern int execlp (__const char *__file, __const char *__arg, ...)
+ __THROW __nonnull ((1));
+
+
+#if defined __USE_MISC || defined __USE_XOPEN
+/* Add INC to priority of the current process. */
+extern int nice (int __inc) __THROW __wur;
+#endif
+
+
+/* Terminate program execution with the low-order 8 bits of STATUS. */
+extern void _exit (int __status) __attribute__ ((__noreturn__));
+
+
+/* Get the `_PC_*' symbols for the NAME argument to `pathconf' and `fpathconf';
+ the `_SC_*' symbols for the NAME argument to `sysconf';
+ and the `_CS_*' symbols for the NAME argument to `confstr'. */
+#include <bits/confname.h>
+
+/* Get file-specific configuration information about PATH. */
+extern long int pathconf (__const char *__path, int __name)
+ __THROW __nonnull ((1));
+
+/* Get file-specific configuration about descriptor FD. */
+extern long int fpathconf (int __fd, int __name) __THROW;
+
+/* Get the value of the system variable NAME. */
+extern long int sysconf (int __name) __THROW;
+
+#ifdef __USE_POSIX2
+/* Get the value of the string-valued system variable NAME. */
+extern size_t confstr (int __name, char *__buf, size_t __len) __THROW;
+#endif
+
+
+/* Get the process ID of the calling process. */
+extern __pid_t getpid (void) __THROW;
+
+/* Get the process ID of the calling process's parent. */
+extern __pid_t getppid (void) __THROW;
+
+/* Get the process group ID of the calling process.
+ This function is different on old BSD. */
+#ifndef __FAVOR_BSD
+extern __pid_t getpgrp (void) __THROW;
+#else
+# ifdef __REDIRECT_NTH
+extern __pid_t __REDIRECT_NTH (getpgrp, (__pid_t __pid), __getpgid);
+# else
+# define getpgrp __getpgid
+# endif
+#endif
+
+/* Get the process group ID of process PID. */
+extern __pid_t __getpgid (__pid_t __pid) __THROW;
+#ifdef __USE_XOPEN_EXTENDED
+extern __pid_t getpgid (__pid_t __pid) __THROW;
+#endif
+
+
+/* Set the process group ID of the process matching PID to PGID.
+ If PID is zero, the current process's process group ID is set.
+ If PGID is zero, the process ID of the process is used. */
+extern int setpgid (__pid_t __pid, __pid_t __pgid) __THROW;
+
+#if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+/* Both System V and BSD have `setpgrp' functions, but with different
+ calling conventions. The BSD function is the same as POSIX.1 `setpgid'
+ (above). The System V function takes no arguments and puts the calling
+ process in its on group like `setpgid (0, 0)'.
+
+ New programs should always use `setpgid' instead.
+
+ The default in GNU is to provide the System V function. The BSD
+ function is available under -D_BSD_SOURCE. */
+
+# ifndef __FAVOR_BSD
+
+/* Set the process group ID of the calling process to its own PID.
+ This is exactly the same as `setpgid (0, 0)'. */
+extern int setpgrp (void) __THROW;
+
+# else
+
+/* Another name for `setpgid' (above). */
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (setpgrp, (__pid_t __pid, __pid_t __pgrp), setpgid);
+# else
+# define setpgrp setpgid
+# endif
+
+# endif /* Favor BSD. */
+#endif /* Use SVID or BSD. */
+
+/* Create a new session with the calling process as its leader.
+ The process group IDs of the session and the calling process
+ are set to the process ID of the calling process, which is returned. */
+extern __pid_t setsid (void) __THROW;
+
+#ifdef __USE_XOPEN_EXTENDED
+/* Return the session ID of the given process. */
+extern __pid_t getsid (__pid_t __pid) __THROW;
+#endif
+
+/* Get the real user ID of the calling process. */
+extern __uid_t getuid (void) __THROW;
+
+/* Get the effective user ID of the calling process. */
+extern __uid_t geteuid (void) __THROW;
+
+/* Get the real group ID of the calling process. */
+extern __gid_t getgid (void) __THROW;
+
+/* Get the effective group ID of the calling process. */
+extern __gid_t getegid (void) __THROW;
+
+/* If SIZE is zero, return the number of supplementary groups
+ the calling process is in. Otherwise, fill in the group IDs
+ of its supplementary groups in LIST and return the number written. */
+extern int getgroups (int __size, __gid_t __list[]) __THROW __wur;
+
+#ifdef __USE_GNU
+/* Return nonzero iff the calling process is in group GID. */
+extern int group_member (__gid_t __gid) __THROW;
+#endif
+
+/* Set the user ID of the calling process to UID.
+ If the calling process is the super-user, set the real
+ and effective user IDs, and the saved set-user-ID to UID;
+ if not, the effective user ID is set to UID. */
+extern int setuid (__uid_t __uid) __THROW;
+
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+/* Set the real user ID of the calling process to RUID,
+ and the effective user ID of the calling process to EUID. */
+extern int setreuid (__uid_t __ruid, __uid_t __euid) __THROW;
+#endif
+
+#if defined __USE_BSD || defined __USE_XOPEN2K
+/* Set the effective user ID of the calling process to UID. */
+extern int seteuid (__uid_t __uid) __THROW;
+#endif /* Use BSD. */
+
+/* Set the group ID of the calling process to GID.
+ If the calling process is the super-user, set the real
+ and effective group IDs, and the saved set-group-ID to GID;
+ if not, the effective group ID is set to GID. */
+extern int setgid (__gid_t __gid) __THROW;
+
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+/* Set the real group ID of the calling process to RGID,
+ and the effective group ID of the calling process to EGID. */
+extern int setregid (__gid_t __rgid, __gid_t __egid) __THROW;
+#endif
+
+#if defined __USE_BSD || defined __USE_XOPEN2K
+/* Set the effective group ID of the calling process to GID. */
+extern int setegid (__gid_t __gid) __THROW;
+#endif /* Use BSD. */
+
+#ifdef __USE_GNU
+/* Fetch the real user ID, effective user ID, and saved-set user ID,
+ of the calling process. */
+extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
+ __THROW;
+
+/* Fetch the real group ID, effective group ID, and saved-set group ID,
+ of the calling process. */
+extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
+ __THROW;
+
+/* Set the real user ID, effective user ID, and saved-set user ID,
+ of the calling process to RUID, EUID, and SUID, respectively. */
+extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
+ __THROW;
+
+/* Set the real group ID, effective group ID, and saved-set group ID,
+ of the calling process to RGID, EGID, and SGID, respectively. */
+extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
+ __THROW;
+#endif
+
+
+/* Clone the calling process, creating an exact copy.
+ Return -1 for errors, 0 to the new process,
+ and the process ID of the new process to the old process. */
+extern __pid_t fork (void) __THROW;
+
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+/* Clone the calling process, but without copying the whole address space.
+ The calling process is suspended until the new process exits or is
+ replaced by a call to `execve'. Return -1 for errors, 0 to the new process,
+ and the process ID of the new process to the old process. */
+extern __pid_t vfork (void) __THROW;
+#endif /* Use BSD. */
+
+
+/* Return the pathname of the terminal FD is open on, or NULL on errors.
+ The returned storage is good only until the next call to this function. */
+extern char *ttyname (int __fd) __THROW;
+
+/* Store at most BUFLEN characters of the pathname of the terminal FD is
+ open on in BUF. Return 0 on success, otherwise an error number. */
+extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
+ __THROW __nonnull ((2)) __wur;
+
+/* Return 1 if FD is a valid descriptor associated
+ with a terminal, zero if not. */
+extern int isatty (int __fd) __THROW;
+
+#if defined __USE_BSD \
+ || (defined __USE_XOPEN_EXTENDED && !defined __USE_UNIX98)
+/* Return the index into the active-logins file (utmp) for
+ the controlling terminal. */
+extern int ttyslot (void) __THROW;
+#endif
+
+
+/* Make a link to FROM named TO. */
+extern int link (__const char *__from, __const char *__to)
+ __THROW __nonnull ((1, 2)) __wur;
+
+#ifdef __USE_ATFILE
+/* Like link but relative paths in TO and FROM are interpreted relative
+ to FROMFD and TOFD respectively. */
+extern int linkat (int __fromfd, __const char *__from, int __tofd,
+ __const char *__to, int __flags)
+ __THROW __nonnull ((2, 4)) __wur;
+#endif
+
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K
+/* Make a symbolic link to FROM named TO. */
+extern int symlink (__const char *__from, __const char *__to)
+ __THROW __nonnull ((1, 2)) __wur;
+
+/* Read the contents of the symbolic link PATH into no more than
+ LEN bytes of BUF. The contents are not null-terminated.
+ Returns the number of characters read, or -1 for errors. */
+extern ssize_t readlink (__const char *__restrict __path,
+ char *__restrict __buf, size_t __len)
+ __THROW __nonnull ((1, 2)) __wur;
+#endif /* Use BSD. */
+
+#ifdef __USE_ATFILE
+/* Like symlink but a relative path in TO is interpreted relative to TOFD. */
+extern int symlinkat (__const char *__from, int __tofd,
+ __const char *__to) __THROW __nonnull ((1, 3)) __wur;
+
+/* Like readlink but a relative PATH is interpreted relative to FD. */
+extern ssize_t readlinkat (int __fd, __const char *__restrict __path,
+ char *__restrict __buf, size_t __len)
+ __THROW __nonnull ((2, 3)) __wur;
+#endif
+
+/* Remove the link NAME. */
+extern int unlink (__const char *__name) __THROW __nonnull ((1));
+
+#ifdef __USE_ATFILE
+/* Remove the link NAME relative to FD. */
+extern int unlinkat (int __fd, __const char *__name, int __flag)
+ __THROW __nonnull ((2));
+#endif
+
+/* Remove the directory PATH. */
+extern int rmdir (__const char *__path) __THROW __nonnull ((1));
+
+
+/* Return the foreground process group ID of FD. */
+extern __pid_t tcgetpgrp (int __fd) __THROW;
+
+/* Set the foreground process group ID of FD set PGRP_ID. */
+extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __THROW;
+
+
+/* Return the login name of the user.
+
+ This function is a possible cancellation points and therefore not
+ marked with __THROW. */
+extern char *getlogin (void);
+#if defined __USE_REENTRANT || defined __USE_POSIX199506
+/* Return at most NAME_LEN characters of the login name of the user in NAME.
+ If it cannot be determined or some other error occurred, return the error
+ code. Otherwise return 0.
+
+ This function is a possible cancellation points and therefore not
+ marked with __THROW. */
+extern int getlogin_r (char *__name, size_t __name_len) __nonnull ((1));
+#endif
+
+#ifdef __USE_BSD
+/* Set the login name returned by `getlogin'. */
+extern int setlogin (__const char *__name) __THROW __nonnull ((1));
+#endif
+
+
+#ifdef __USE_POSIX2
+/* Get definitions and prototypes for functions to process the
+ arguments in ARGV (ARGC of them, minus the program name) for
+ options given in OPTS. */
+# define __need_getopt
+# include <getopt.h>
+#endif
+
+
+#if defined __USE_BSD || defined __USE_UNIX98
+/* Put the name of the current host in no more than LEN bytes of NAME.
+ The result is null-terminated if LEN is large enough for the full
+ name and the terminator. */
+extern int gethostname (char *__name, size_t __len) __THROW __nonnull ((1));
+#endif
+
+
+#if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_UNIX98)
+/* Set the name of the current host to NAME, which is LEN bytes long.
+ This call is restricted to the super-user. */
+extern int sethostname (__const char *__name, size_t __len)
+ __THROW __nonnull ((1)) __wur;
+
+/* Set the current machine's Internet number to ID.
+ This call is restricted to the super-user. */
+extern int sethostid (long int __id) __THROW __wur;
+
+
+/* Get and set the NIS (aka YP) domain name, if any.
+ Called just like `gethostname' and `sethostname'.
+ The NIS domain name is usually the empty string when not using NIS. */
+extern int getdomainname (char *__name, size_t __len)
+ __THROW __nonnull ((1)) __wur;
+extern int setdomainname (__const char *__name, size_t __len)
+ __THROW __nonnull ((1)) __wur;
+
+
+/* Revoke access permissions to all processes currently communicating
+ with the control terminal, and then send a SIGHUP signal to the process
+ group of the control terminal. */
+extern int vhangup (void) __THROW;
+
+/* Revoke the access of all descriptors currently open on FILE. */
+extern int revoke (__const char *__file) __THROW __nonnull ((1)) __wur;
+
+
+/* Enable statistical profiling, writing samples of the PC into at most
+ SIZE bytes of SAMPLE_BUFFER; every processor clock tick while profiling
+ is enabled, the system examines the user PC and increments
+ SAMPLE_BUFFER[((PC - OFFSET) / 2) * SCALE / 65536]. If SCALE is zero,
+ disable profiling. Returns zero on success, -1 on error. */
+extern int profil (unsigned short int *__sample_buffer, size_t __size,
+ size_t __offset, unsigned int __scale)
+ __THROW __nonnull ((1));
+
+
+/* Turn accounting on if NAME is an existing file. The system will then write
+ a record for each process as it terminates, to this file. If NAME is NULL,
+ turn accounting off. This call is restricted to the super-user. */
+extern int acct (__const char *__name) __THROW;
+
+
+/* Successive calls return the shells listed in `/etc/shells'. */
+extern char *getusershell (void) __THROW;
+extern void endusershell (void) __THROW; /* Discard cached info. */
+extern void setusershell (void) __THROW; /* Rewind and re-read the file. */
+
+
+/* Put the program in the background, and dissociate from the controlling
+ terminal. If NOCHDIR is zero, do `chdir ("/")'. If NOCLOSE is zero,
+ redirects stdin, stdout, and stderr to /dev/null. */
+extern int daemon (int __nochdir, int __noclose) __THROW __wur;
+#endif /* Use BSD || X/Open. */
+
+
+#if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
+/* Make PATH be the root directory (the starting point for absolute paths).
+ This call is restricted to the super-user. */
+extern int chroot (__const char *__path) __THROW __nonnull ((1)) __wur;
+
+/* Prompt with PROMPT and read a string from the terminal without echoing.
+ Uses /dev/tty if possible; otherwise stderr and stdin. */
+extern char *getpass (__const char *__prompt) __nonnull ((1));
+#endif /* Use BSD || X/Open. */
+
+
+#if defined __USE_BSD || defined __USE_XOPEN
+/* Make all changes done to FD actually appear on disk.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int fsync (int __fd);
+#endif /* Use BSD || X/Open. */
+
+
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+
+/* Return identifier for the current host. */
+extern long int gethostid (void);
+
+/* Make all changes done to all files actually appear on disk. */
+extern void sync (void) __THROW;
+
+
+/* Return the number of bytes in a page. This is the system's page size,
+ which is not necessarily the same as the hardware page size. */
+extern int getpagesize (void) __THROW __attribute__ ((__const__));
+
+
+/* Return the maximum number of file descriptors
+ the current process could possibly have. */
+extern int getdtablesize (void) __THROW;
+
+
+/* Truncate FILE to LENGTH bytes. */
+# ifndef __USE_FILE_OFFSET64
+extern int truncate (__const char *__file, __off_t __length)
+ __THROW __nonnull ((1)) __wur;
+# else
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (truncate,
+ (__const char *__file, __off64_t __length),
+ truncate64) __nonnull ((1)) __wur;
+# else
+# define truncate truncate64
+# endif
+# endif
+# ifdef __USE_LARGEFILE64
+extern int truncate64 (__const char *__file, __off64_t __length)
+ __THROW __nonnull ((1)) __wur;
+# endif
+
+#endif /* Use BSD || X/Open Unix. */
+
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K
+
+/* Truncate the file FD is open on to LENGTH bytes. */
+# ifndef __USE_FILE_OFFSET64
+extern int ftruncate (int __fd, __off_t __length) __THROW __wur;
+# else
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (ftruncate, (int __fd, __off64_t __length),
+ ftruncate64) __wur;
+# else
+# define ftruncate ftruncate64
+# endif
+# endif
+# ifdef __USE_LARGEFILE64
+extern int ftruncate64 (int __fd, __off64_t __length) __THROW __wur;
+# endif
+
+#endif /* Use BSD || X/Open Unix || POSIX 2003. */
+
+
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
+
+/* Set the end of accessible data space (aka "the break") to ADDR.
+ Returns zero on success and -1 for errors (with errno set). */
+extern int brk (void *__addr) __THROW __wur;
+
+/* Increase or decrease the end of accessible data space by DELTA bytes.
+ If successful, returns the address the previous end of data space
+ (i.e. the beginning of the new space, if DELTA > 0);
+ returns (void *) -1 for errors (with errno set). */
+extern void *sbrk (intptr_t __delta) __THROW;
+#endif
+
+
+#ifdef __USE_MISC
+/* Invoke `system call' number SYSNO, passing it the remaining arguments.
+ This is completely system-dependent, and not often useful.
+
+ In Unix, `syscall' sets `errno' for all errors and most calls return -1
+ for errors; in many systems you cannot pass arguments or get return
+ values for all system calls (`pipe', `fork', and `getppid' typically
+ among them).
+
+ In Mach, all system calls take normal arguments and always return an
+ error code (zero for success). */
+extern long int syscall (long int __sysno, ...) __THROW;
+
+#endif /* Use misc. */
+
+
+#if (defined __USE_MISC || defined __USE_XOPEN_EXTENDED) && !defined F_LOCK
+/* NOTE: These declarations also appear in <fcntl.h>; be sure to keep both
+ files consistent. Some systems have them there and some here, and some
+ software depends on the macros being defined without including both. */
+
+/* `lockf' is a simpler interface to the locking facilities of `fcntl'.
+ LEN is always relative to the current file position.
+ The CMD argument is one of the following.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+
+# define F_ULOCK 0 /* Unlock a previously locked region. */
+# define F_LOCK 1 /* Lock a region for exclusive use. */
+# define F_TLOCK 2 /* Test and lock a region for exclusive use. */
+# define F_TEST 3 /* Test a region for other processes locks. */
+
+# ifndef __USE_FILE_OFFSET64
+extern int lockf (int __fd, int __cmd, __off_t __len) __wur;
+# else
+# ifdef __REDIRECT
+extern int __REDIRECT (lockf, (int __fd, int __cmd, __off64_t __len),
+ lockf64) __wur;
+# else
+# define lockf lockf64
+# endif
+# endif
+# ifdef __USE_LARGEFILE64
+extern int lockf64 (int __fd, int __cmd, __off64_t __len) __wur;
+# endif
+#endif /* Use misc and F_LOCK not already defined. */
+
+
+#ifdef __USE_GNU
+
+/* Evaluate EXPRESSION, and repeat as long as it returns -1 with `errno'
+ set to EINTR. */
+
+# define TEMP_FAILURE_RETRY(expression) \
+ (__extension__ \
+ ({ long int __result; \
+ do __result = (long int) (expression); \
+ while (__result == -1L && errno == EINTR); \
+ __result; }))
+#endif
+
+#if defined __USE_POSIX199309 || defined __USE_UNIX98
+/* Synchronize at least the data part of a file with the underlying
+ media. */
+extern int fdatasync (int __fildes);
+#endif /* Use POSIX199309 */
+
+
+/* XPG4.2 specifies that prototypes for the encryption functions must
+ be defined here. */
+#ifdef __USE_XOPEN
+/* Encrypt at most 8 characters from KEY using salt to perturb DES. */
+extern char *crypt (__const char *__key, __const char *__salt)
+ __THROW __nonnull ((1, 2));
+
+/* Encrypt data in BLOCK in place if EDFLAG is zero; otherwise decrypt
+ block in place. */
+extern void encrypt (char *__block, int __edflag) __THROW __nonnull ((1));
+
+
+/* Swab pairs bytes in the first N bytes of the area pointed to by
+ FROM and copy the result to TO. The value of TO must not be in the
+ range [FROM - N + 1, FROM - 1]. If N is odd the first byte in FROM
+ is without partner. */
+extern void swab (__const void *__restrict __from, void *__restrict __to,
+ ssize_t __n) __THROW __nonnull ((1, 2));
+#endif
+
+
+/* The Single Unix specification demands this prototype to be here.
+ It is also found in <stdio.h>. */
+#ifdef __USE_XOPEN
+/* Return the name of the controlling terminal. */
+extern char *ctermid (char *__s) __THROW;
+#endif
+
+
+/* Define some macros helping to catch buffer overflows. */
+#if __USE_FORTIFY_LEVEL > 0 && defined __extern_always_inline
+# include <bits/unistd.h>
+#endif
+
+__END_DECLS
+
+#endif /* unistd.h */
diff --git a/sysroot/usr/include/ustat.h b/sysroot/usr/include/ustat.h
new file mode 100644
index 0000000..cba150e
--- /dev/null
+++ b/sysroot/usr/include/ustat.h
@@ -0,0 +1 @@
+#include <sys/ustat.h>
diff --git a/sysroot/usr/include/utime.h b/sysroot/usr/include/utime.h
new file mode 100644
index 0000000..dd5d265
--- /dev/null
+++ b/sysroot/usr/include/utime.h
@@ -0,0 +1,52 @@
+/* Copyright (C) 1991, 92, 96, 97, 98, 99, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * POSIX Standard: 5.6.6 Set File Access and Modification Times <utime.h>
+ */
+
+#ifndef _UTIME_H
+#define _UTIME_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+#include <bits/types.h>
+
+#if defined __USE_XOPEN || defined __USE_XOPEN2K
+# define __need_time_t
+# include <time.h>
+#endif
+
+/* Structure describing file times. */
+struct utimbuf
+ {
+ __time_t actime; /* Access time. */
+ __time_t modtime; /* Modification time. */
+ };
+
+/* Set the access and modification times of FILE to those given in
+ *FILE_TIMES. If FILE_TIMES is NULL, set them to the current time. */
+extern int utime (__const char *__file,
+ __const struct utimbuf *__file_times)
+ __THROW __nonnull ((1));
+
+__END_DECLS
+
+#endif /* utime.h */
diff --git a/sysroot/usr/include/utmp.h b/sysroot/usr/include/utmp.h
new file mode 100644
index 0000000..64b1088
--- /dev/null
+++ b/sysroot/usr/include/utmp.h
@@ -0,0 +1,97 @@
+/* Copyright (C) 1993, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _UTMP_H
+#define _UTMP_H 1
+
+#include <features.h>
+
+#include <sys/types.h>
+
+
+__BEGIN_DECLS
+
+/* Get system dependent values and data structures. */
+#include <bits/utmp.h>
+
+/* Compatibility names for the strings of the canonical file names. */
+#define UTMP_FILE _PATH_UTMP
+#define UTMP_FILENAME _PATH_UTMP
+#define WTMP_FILE _PATH_WTMP
+#define WTMP_FILENAME _PATH_WTMP
+
+
+
+/* Make FD be the controlling terminal, stdin, stdout, and stderr;
+ then close FD. Returns 0 on success, nonzero on error. */
+extern int login_tty (int __fd) __THROW;
+
+
+/* Write the given entry into utmp and wtmp. */
+extern void login (__const struct utmp *__entry) __THROW;
+
+/* Write the utmp entry to say the user on UT_LINE has logged out. */
+extern int logout (__const char *__ut_line) __THROW;
+
+/* Append to wtmp an entry for the current time and the given info. */
+extern void logwtmp (__const char *__ut_line, __const char *__ut_name,
+ __const char *__ut_host) __THROW;
+
+/* Append entry UTMP to the wtmp-like file WTMP_FILE. */
+extern void updwtmp (__const char *__wtmp_file, __const struct utmp *__utmp)
+ __THROW;
+
+/* Change name of the utmp file to be examined. */
+extern int utmpname (__const char *__file) __THROW;
+
+/* Read next entry from a utmp-like file. */
+extern struct utmp *getutent (void) __THROW;
+
+/* Reset the input stream to the beginning of the file. */
+extern void setutent (void) __THROW;
+
+/* Close the current open file. */
+extern void endutent (void) __THROW;
+
+/* Search forward from the current point in the utmp file until the
+ next entry with a ut_type matching ID->ut_type. */
+extern struct utmp *getutid (__const struct utmp *__id) __THROW;
+
+/* Search forward from the current point in the utmp file until the
+ next entry with a ut_line matching LINE->ut_line. */
+extern struct utmp *getutline (__const struct utmp *__line) __THROW;
+
+/* Write out entry pointed to by UTMP_PTR into the utmp file. */
+extern struct utmp *pututline (__const struct utmp *__utmp_ptr) __THROW;
+
+
+#ifdef __USE_MISC
+/* Reentrant versions of the file for handling utmp files. */
+extern int getutent_r (struct utmp *__buffer, struct utmp **__result) __THROW;
+
+extern int getutid_r (__const struct utmp *__id, struct utmp *__buffer,
+ struct utmp **__result) __THROW;
+
+extern int getutline_r (__const struct utmp *__line,
+ struct utmp *__buffer, struct utmp **__result) __THROW;
+
+#endif /* Use misc. */
+
+__END_DECLS
+
+#endif /* utmp.h */
diff --git a/sysroot/usr/include/utmpx.h b/sysroot/usr/include/utmpx.h
new file mode 100644
index 0000000..8622916
--- /dev/null
+++ b/sysroot/usr/include/utmpx.h
@@ -0,0 +1,127 @@
+/* Copyright (C) 1997, 1998, 1999, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _UTMPX_H
+#define _UTMPX_H 1
+
+#include <features.h>
+#include <sys/time.h>
+
+/* Required according to Unix98. */
+#ifndef __pid_t_defined
+typedef __pid_t pid_t;
+# define __pid_t_defined
+#endif
+
+/* Get system dependent values and data structures. */
+#include <bits/utmpx.h>
+
+#ifdef __USE_GNU
+/* Compatibility names for the strings of the canonical file names. */
+# define UTMPX_FILE _PATH_UTMPX
+# define UTMPX_FILENAME _PATH_UTMPX
+# define WTMPX_FILE _PATH_WTMPX
+# define WTMPX_FILENAME _PATH_WTMPX
+#endif
+
+/* For the getutmp{,x} functions we need the `struct utmp'. */
+#ifdef __USE_GNU
+struct utmp;
+#endif
+
+
+__BEGIN_DECLS
+
+/* Open user accounting database.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern void setutxent (void);
+
+/* Close user accounting database.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern void endutxent (void);
+
+/* Get the next entry from the user accounting database.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct utmpx *getutxent (void);
+
+/* Get the user accounting database entry corresponding to ID.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct utmpx *getutxid (__const struct utmpx *__id);
+
+/* Get the user accounting database entry corresponding to LINE.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct utmpx *getutxline (__const struct utmpx *__line);
+
+/* Write the entry UTMPX into the user accounting database.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct utmpx *pututxline (__const struct utmpx *__utmpx);
+
+
+#ifdef __USE_GNU
+/* Change name of the utmpx file to be examined.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int utmpxname (__const char *__file);
+
+/* Append entry UTMP to the wtmpx-like file WTMPX_FILE.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern void updwtmpx (__const char *__wtmpx_file,
+ __const struct utmpx *__utmpx);
+
+
+/* Copy the information in UTMPX to UTMP.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern void getutmp (__const struct utmpx *__utmpx,
+ struct utmp *__utmp);
+
+/* Copy the information in UTMP to UTMPX.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern void getutmpx (__const struct utmp *__utmp,
+ struct utmpx *__utmpx);
+#endif
+
+__END_DECLS
+
+#endif /* utmpx.h */
diff --git a/sysroot/usr/include/values.h b/sysroot/usr/include/values.h
new file mode 100644
index 0000000..c8b376f
--- /dev/null
+++ b/sysroot/usr/include/values.h
@@ -0,0 +1,69 @@
+/* Old compatibility names for <limits.h> and <float.h> constants.
+ Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* This interface is obsolete. New programs should use
+ <limits.h> and/or <float.h> instead of <values.h>. */
+
+#ifndef _VALUES_H
+#define _VALUES_H 1
+
+#include <features.h>
+
+#include <limits.h>
+
+#define _TYPEBITS(type) (sizeof (type) * CHAR_BIT)
+
+#define CHARBITS _TYPEBITS (char)
+#define SHORTBITS _TYPEBITS (short int)
+#define INTBITS _TYPEBITS (int)
+#define LONGBITS _TYPEBITS (long int)
+#define PTRBITS _TYPEBITS (char *)
+#define DOUBLEBITS _TYPEBITS (double)
+#define FLOATBITS _TYPEBITS (float)
+
+#define MINSHORT SHRT_MIN
+#define MININT INT_MIN
+#define MINLONG LONG_MIN
+
+#define MAXSHORT SHRT_MAX
+#define MAXINT INT_MAX
+#define MAXLONG LONG_MAX
+
+#define HIBITS MINSHORT
+#define HIBITL MINLONG
+
+
+#include <float.h>
+
+#define MAXDOUBLE DBL_MAX
+#define MAXFLOAT FLT_MAX
+#define MINDOUBLE DBL_MIN
+#define MINFLOAT FLT_MIN
+#define DMINEXP DBL_MIN_EXP
+#define FMINEXP FLT_MIN_EXP
+#define DMAXEXP DBL_MAX_EXP
+#define FMAXEXP FLT_MAX_EXP
+
+
+#ifdef __USE_MISC
+/* Some systems define this name instead of CHAR_BIT or CHARBITS. */
+# define BITSPERBYTE CHAR_BIT
+#endif
+
+#endif /* values.h */
diff --git a/sysroot/usr/include/wait.h b/sysroot/usr/include/wait.h
new file mode 100644
index 0000000..d01b811
--- /dev/null
+++ b/sysroot/usr/include/wait.h
@@ -0,0 +1 @@
+#include <sys/wait.h>
diff --git a/sysroot/usr/include/wchar.h b/sysroot/usr/include/wchar.h
new file mode 100644
index 0000000..76c00ef
--- /dev/null
+++ b/sysroot/usr/include/wchar.h
@@ -0,0 +1,847 @@
+/* Copyright (C) 1995-2004,2005,2006,2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99 Standard: 7.24
+ * Extended multibyte and wide character utilities <wchar.h>
+ */
+
+#ifndef _WCHAR_H
+
+#if !defined __need_mbstate_t && !defined __need_wint_t
+# define _WCHAR_H 1
+# include <features.h>
+#endif
+
+#ifdef _WCHAR_H
+/* Get FILE definition. */
+# define __need___FILE
+# ifdef __USE_UNIX98
+# define __need_FILE
+# endif
+# include <stdio.h>
+/* Get va_list definition. */
+# define __need___va_list
+# include <stdarg.h>
+
+# include <bits/wchar.h>
+
+/* Get size_t, wchar_t, wint_t and NULL from <stddef.h>. */
+# define __need_size_t
+# define __need_wchar_t
+# define __need_NULL
+#endif
+#if defined _WCHAR_H || defined __need_wint_t || !defined __WINT_TYPE__
+# undef __need_wint_t
+# define __need_wint_t
+# include <stddef.h>
+
+/* We try to get wint_t from <stddef.h>, but not all GCC versions define it
+ there. So define it ourselves if it remains undefined. */
+# ifndef _WINT_T
+/* Integral type unchanged by default argument promotions that can
+ hold any value corresponding to members of the extended character
+ set, as well as at least one value that does not correspond to any
+ member of the extended character set. */
+# define _WINT_T
+typedef unsigned int wint_t;
+# else
+/* Work around problems with the <stddef.h> file which doesn't put
+ wint_t in the std namespace. */
+# if defined __cplusplus && defined _GLIBCPP_USE_NAMESPACES \
+ && defined __WINT_TYPE__
+__BEGIN_NAMESPACE_STD
+typedef __WINT_TYPE__ wint_t;
+__END_NAMESPACE_STD
+# endif
+# endif
+#endif
+
+#if (defined _WCHAR_H || defined __need_mbstate_t) && !defined __mbstate_t_defined
+# define __mbstate_t_defined 1
+/* Conversion state information. */
+typedef struct
+{
+ int __count;
+ union
+ {
+# ifdef __WINT_TYPE__
+ __WINT_TYPE__ __wch;
+# else
+ wint_t __wch;
+# endif
+ char __wchb[4];
+ } __value; /* Value so far. */
+} __mbstate_t;
+#endif
+#undef __need_mbstate_t
+
+
+/* The rest of the file is only used if used if __need_mbstate_t is not
+ defined. */
+#ifdef _WCHAR_H
+
+__BEGIN_NAMESPACE_C99
+/* Public type. */
+typedef __mbstate_t mbstate_t;
+__END_NAMESPACE_C99
+#ifdef __USE_GNU
+__USING_NAMESPACE_C99(mbstate_t)
+#endif
+
+#ifndef WCHAR_MIN
+/* These constants might also be defined in <inttypes.h>. */
+# define WCHAR_MIN __WCHAR_MIN
+# define WCHAR_MAX __WCHAR_MAX
+#endif
+
+#ifndef WEOF
+# define WEOF (0xffffffffu)
+#endif
+
+/* For XPG4 compliance we have to define the stuff from <wctype.h> here
+ as well. */
+#if defined __USE_XOPEN && !defined __USE_UNIX98
+# include <wctype.h>
+#endif
+
+
+__BEGIN_DECLS
+
+__BEGIN_NAMESPACE_STD
+/* This incomplete type is defined in <time.h> but needed here because
+ of `wcsftime'. */
+struct tm;
+__END_NAMESPACE_STD
+/* XXX We have to clean this up at some point. Since tm is in the std
+ namespace but wcsftime is in __c99 the type wouldn't be found
+ without inserting it in the global namespace. */
+__USING_NAMESPACE_STD(tm)
+
+
+__BEGIN_NAMESPACE_STD
+/* Copy SRC to DEST. */
+extern wchar_t *wcscpy (wchar_t *__restrict __dest,
+ __const wchar_t *__restrict __src) __THROW;
+/* Copy no more than N wide-characters of SRC to DEST. */
+extern wchar_t *wcsncpy (wchar_t *__restrict __dest,
+ __const wchar_t *__restrict __src, size_t __n)
+ __THROW;
+
+/* Append SRC onto DEST. */
+extern wchar_t *wcscat (wchar_t *__restrict __dest,
+ __const wchar_t *__restrict __src) __THROW;
+/* Append no more than N wide-characters of SRC onto DEST. */
+extern wchar_t *wcsncat (wchar_t *__restrict __dest,
+ __const wchar_t *__restrict __src, size_t __n)
+ __THROW;
+
+/* Compare S1 and S2. */
+extern int wcscmp (__const wchar_t *__s1, __const wchar_t *__s2)
+ __THROW __attribute_pure__;
+/* Compare N wide-characters of S1 and S2. */
+extern int wcsncmp (__const wchar_t *__s1, __const wchar_t *__s2, size_t __n)
+ __THROW __attribute_pure__;
+__END_NAMESPACE_STD
+
+#ifdef __USE_GNU
+/* Compare S1 and S2, ignoring case. */
+extern int wcscasecmp (__const wchar_t *__s1, __const wchar_t *__s2) __THROW;
+
+/* Compare no more than N chars of S1 and S2, ignoring case. */
+extern int wcsncasecmp (__const wchar_t *__s1, __const wchar_t *__s2,
+ size_t __n) __THROW;
+
+/* Similar to the two functions above but take the information from
+ the provided locale and not the global locale. */
+# include <xlocale.h>
+
+extern int wcscasecmp_l (__const wchar_t *__s1, __const wchar_t *__s2,
+ __locale_t __loc) __THROW;
+
+extern int wcsncasecmp_l (__const wchar_t *__s1, __const wchar_t *__s2,
+ size_t __n, __locale_t __loc) __THROW;
+#endif
+
+__BEGIN_NAMESPACE_STD
+/* Compare S1 and S2, both interpreted as appropriate to the
+ LC_COLLATE category of the current locale. */
+extern int wcscoll (__const wchar_t *__s1, __const wchar_t *__s2) __THROW;
+/* Transform S2 into array pointed to by S1 such that if wcscmp is
+ applied to two transformed strings the result is the as applying
+ `wcscoll' to the original strings. */
+extern size_t wcsxfrm (wchar_t *__restrict __s1,
+ __const wchar_t *__restrict __s2, size_t __n) __THROW;
+__END_NAMESPACE_STD
+
+#ifdef __USE_GNU
+/* Similar to the two functions above but take the information from
+ the provided locale and not the global locale. */
+
+/* Compare S1 and S2, both interpreted as appropriate to the
+ LC_COLLATE category of the given locale. */
+extern int wcscoll_l (__const wchar_t *__s1, __const wchar_t *__s2,
+ __locale_t __loc) __THROW;
+
+/* Transform S2 into array pointed to by S1 such that if wcscmp is
+ applied to two transformed strings the result is the as applying
+ `wcscoll' to the original strings. */
+extern size_t wcsxfrm_l (wchar_t *__s1, __const wchar_t *__s2,
+ size_t __n, __locale_t __loc) __THROW;
+
+/* Duplicate S, returning an identical malloc'd string. */
+extern wchar_t *wcsdup (__const wchar_t *__s) __THROW __attribute_malloc__;
+#endif
+
+__BEGIN_NAMESPACE_STD
+/* Find the first occurrence of WC in WCS. */
+extern wchar_t *wcschr (__const wchar_t *__wcs, wchar_t __wc)
+ __THROW __attribute_pure__;
+/* Find the last occurrence of WC in WCS. */
+extern wchar_t *wcsrchr (__const wchar_t *__wcs, wchar_t __wc)
+ __THROW __attribute_pure__;
+__END_NAMESPACE_STD
+
+#ifdef __USE_GNU
+/* This function is similar to `wcschr'. But it returns a pointer to
+ the closing NUL wide character in case C is not found in S. */
+extern wchar_t *wcschrnul (__const wchar_t *__s, wchar_t __wc)
+ __THROW __attribute_pure__;
+#endif
+
+__BEGIN_NAMESPACE_STD
+/* Return the length of the initial segmet of WCS which
+ consists entirely of wide characters not in REJECT. */
+extern size_t wcscspn (__const wchar_t *__wcs, __const wchar_t *__reject)
+ __THROW __attribute_pure__;
+/* Return the length of the initial segmet of WCS which
+ consists entirely of wide characters in ACCEPT. */
+extern size_t wcsspn (__const wchar_t *__wcs, __const wchar_t *__accept)
+ __THROW __attribute_pure__;
+/* Find the first occurrence in WCS of any character in ACCEPT. */
+extern wchar_t *wcspbrk (__const wchar_t *__wcs, __const wchar_t *__accept)
+ __THROW __attribute_pure__;
+/* Find the first occurrence of NEEDLE in HAYSTACK. */
+extern wchar_t *wcsstr (__const wchar_t *__haystack, __const wchar_t *__needle)
+ __THROW __attribute_pure__;
+
+/* Divide WCS into tokens separated by characters in DELIM. */
+extern wchar_t *wcstok (wchar_t *__restrict __s,
+ __const wchar_t *__restrict __delim,
+ wchar_t **__restrict __ptr) __THROW;
+
+/* Return the number of wide characters in S. */
+extern size_t wcslen (__const wchar_t *__s) __THROW __attribute_pure__;
+__END_NAMESPACE_STD
+
+#ifdef __USE_XOPEN
+/* Another name for `wcsstr' from XPG4. */
+extern wchar_t *wcswcs (__const wchar_t *__haystack, __const wchar_t *__needle)
+ __THROW __attribute_pure__;
+#endif
+
+#ifdef __USE_GNU
+/* Return the number of wide characters in S, but at most MAXLEN. */
+extern size_t wcsnlen (__const wchar_t *__s, size_t __maxlen)
+ __THROW __attribute_pure__;
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+/* Search N wide characters of S for C. */
+extern wchar_t *wmemchr (__const wchar_t *__s, wchar_t __c, size_t __n)
+ __THROW __attribute_pure__;
+
+/* Compare N wide characters of S1 and S2. */
+extern int wmemcmp (__const wchar_t *__restrict __s1,
+ __const wchar_t *__restrict __s2, size_t __n)
+ __THROW __attribute_pure__;
+
+/* Copy N wide characters of SRC to DEST. */
+extern wchar_t *wmemcpy (wchar_t *__restrict __s1,
+ __const wchar_t *__restrict __s2, size_t __n) __THROW;
+
+/* Copy N wide characters of SRC to DEST, guaranteeing
+ correct behavior for overlapping strings. */
+extern wchar_t *wmemmove (wchar_t *__s1, __const wchar_t *__s2, size_t __n)
+ __THROW;
+
+/* Set N wide characters of S to C. */
+extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
+__END_NAMESPACE_STD
+
+#ifdef __USE_GNU
+/* Copy N wide characters of SRC to DEST and return pointer to following
+ wide character. */
+extern wchar_t *wmempcpy (wchar_t *__restrict __s1,
+ __const wchar_t *__restrict __s2, size_t __n)
+ __THROW;
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+/* Determine whether C constitutes a valid (one-byte) multibyte
+ character. */
+extern wint_t btowc (int __c) __THROW;
+
+/* Determine whether C corresponds to a member of the extended
+ character set whose multibyte representation is a single byte. */
+extern int wctob (wint_t __c) __THROW;
+
+/* Determine whether PS points to an object representing the initial
+ state. */
+extern int mbsinit (__const mbstate_t *__ps) __THROW __attribute_pure__;
+
+/* Write wide character representation of multibyte character pointed
+ to by S to PWC. */
+extern size_t mbrtowc (wchar_t *__restrict __pwc,
+ __const char *__restrict __s, size_t __n,
+ mbstate_t *__p) __THROW;
+
+/* Write multibyte representation of wide character WC to S. */
+extern size_t wcrtomb (char *__restrict __s, wchar_t __wc,
+ mbstate_t *__restrict __ps) __THROW;
+
+/* Return number of bytes in multibyte character pointed to by S. */
+extern size_t __mbrlen (__const char *__restrict __s, size_t __n,
+ mbstate_t *__restrict __ps) __THROW;
+extern size_t mbrlen (__const char *__restrict __s, size_t __n,
+ mbstate_t *__restrict __ps) __THROW;
+__END_NAMESPACE_STD
+
+#ifdef __USE_EXTERN_INLINES
+/* Define inline function as optimization. */
+
+/* We can use the BTOWC and WCTOB optimizations since we know that all
+ locales must use ASCII encoding for the values in the ASCII range
+ and because the wchar_t encoding is always ISO 10646. */
+extern wint_t __btowc_alias (int __c) __asm ("btowc");
+__extern_inline wint_t
+__NTH (btowc (int __c))
+{ return (__builtin_constant_p (__c) && __c >= '\0' && __c <= '\x7f'
+ ? (wint_t) __c : __btowc_alias (__c)); }
+
+extern int __wctob_alias (wint_t __c) __asm ("wctob");
+__extern_inline int
+__NTH (wctob (wint_t __wc))
+{ return (__builtin_constant_p (__wc) && __wc >= L'\0' && __wc <= L'\x7f'
+ ? (int) __wc : __wctob_alias (__wc)); }
+
+__extern_inline size_t
+__NTH (mbrlen (__const char *__restrict __s, size_t __n,
+ mbstate_t *__restrict __ps))
+{ return (__ps != NULL
+ ? mbrtowc (NULL, __s, __n, __ps) : __mbrlen (__s, __n, NULL)); }
+#endif
+
+__BEGIN_NAMESPACE_STD
+/* Write wide character representation of multibyte character string
+ SRC to DST. */
+extern size_t mbsrtowcs (wchar_t *__restrict __dst,
+ __const char **__restrict __src, size_t __len,
+ mbstate_t *__restrict __ps) __THROW;
+
+/* Write multibyte character representation of wide character string
+ SRC to DST. */
+extern size_t wcsrtombs (char *__restrict __dst,
+ __const wchar_t **__restrict __src, size_t __len,
+ mbstate_t *__restrict __ps) __THROW;
+__END_NAMESPACE_STD
+
+
+#ifdef __USE_GNU
+/* Write wide character representation of at most NMC bytes of the
+ multibyte character string SRC to DST. */
+extern size_t mbsnrtowcs (wchar_t *__restrict __dst,
+ __const char **__restrict __src, size_t __nmc,
+ size_t __len, mbstate_t *__restrict __ps) __THROW;
+
+/* Write multibyte character representation of at most NWC characters
+ from the wide character string SRC to DST. */
+extern size_t wcsnrtombs (char *__restrict __dst,
+ __const wchar_t **__restrict __src,
+ size_t __nwc, size_t __len,
+ mbstate_t *__restrict __ps) __THROW;
+#endif /* use GNU */
+
+
+/* The following functions are extensions found in X/Open CAE. */
+#ifdef __USE_XOPEN
+/* Determine number of column positions required for C. */
+extern int wcwidth (wchar_t __c) __THROW;
+
+/* Determine number of column positions required for first N wide
+ characters (or fewer if S ends before this) in S. */
+extern int wcswidth (__const wchar_t *__s, size_t __n) __THROW;
+#endif /* Use X/Open. */
+
+
+__BEGIN_NAMESPACE_STD
+/* Convert initial portion of the wide string NPTR to `double'
+ representation. */
+extern double wcstod (__const wchar_t *__restrict __nptr,
+ wchar_t **__restrict __endptr) __THROW;
+__END_NAMESPACE_STD
+
+#ifdef __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Likewise for `float' and `long double' sizes of floating-point numbers. */
+extern float wcstof (__const wchar_t *__restrict __nptr,
+ wchar_t **__restrict __endptr) __THROW;
+extern long double wcstold (__const wchar_t *__restrict __nptr,
+ wchar_t **__restrict __endptr) __THROW;
+__END_NAMESPACE_C99
+#endif /* C99 */
+
+
+__BEGIN_NAMESPACE_STD
+/* Convert initial portion of wide string NPTR to `long int'
+ representation. */
+extern long int wcstol (__const wchar_t *__restrict __nptr,
+ wchar_t **__restrict __endptr, int __base) __THROW;
+
+/* Convert initial portion of wide string NPTR to `unsigned long int'
+ representation. */
+extern unsigned long int wcstoul (__const wchar_t *__restrict __nptr,
+ wchar_t **__restrict __endptr, int __base)
+ __THROW;
+__END_NAMESPACE_STD
+
+#if defined __USE_ISOC99 || (defined __GNUC__ && defined __USE_GNU)
+__BEGIN_NAMESPACE_C99
+/* Convert initial portion of wide string NPTR to `long long int'
+ representation. */
+__extension__
+extern long long int wcstoll (__const wchar_t *__restrict __nptr,
+ wchar_t **__restrict __endptr, int __base)
+ __THROW;
+
+/* Convert initial portion of wide string NPTR to `unsigned long long int'
+ representation. */
+__extension__
+extern unsigned long long int wcstoull (__const wchar_t *__restrict __nptr,
+ wchar_t **__restrict __endptr,
+ int __base) __THROW;
+__END_NAMESPACE_C99
+#endif /* ISO C99 or GCC and GNU. */
+
+#if defined __GNUC__ && defined __USE_GNU
+/* Convert initial portion of wide string NPTR to `long long int'
+ representation. */
+__extension__
+extern long long int wcstoq (__const wchar_t *__restrict __nptr,
+ wchar_t **__restrict __endptr, int __base)
+ __THROW;
+
+/* Convert initial portion of wide string NPTR to `unsigned long long int'
+ representation. */
+__extension__
+extern unsigned long long int wcstouq (__const wchar_t *__restrict __nptr,
+ wchar_t **__restrict __endptr,
+ int __base) __THROW;
+#endif /* GCC and use GNU. */
+
+#ifdef __USE_GNU
+/* The concept of one static locale per category is not very well
+ thought out. Many applications will need to process its data using
+ information from several different locales. Another application is
+ the implementation of the internationalization handling in the
+ upcoming ISO C++ standard library. To support this another set of
+ the functions using locale data exist which have an additional
+ argument.
+
+ Attention: all these functions are *not* standardized in any form.
+ This is a proof-of-concept implementation. */
+
+/* Structure for reentrant locale using functions. This is an
+ (almost) opaque type for the user level programs. */
+# include <xlocale.h>
+
+/* Special versions of the functions above which take the locale to
+ use as an additional parameter. */
+extern long int wcstol_l (__const wchar_t *__restrict __nptr,
+ wchar_t **__restrict __endptr, int __base,
+ __locale_t __loc) __THROW;
+
+extern unsigned long int wcstoul_l (__const wchar_t *__restrict __nptr,
+ wchar_t **__restrict __endptr,
+ int __base, __locale_t __loc) __THROW;
+
+__extension__
+extern long long int wcstoll_l (__const wchar_t *__restrict __nptr,
+ wchar_t **__restrict __endptr,
+ int __base, __locale_t __loc) __THROW;
+
+__extension__
+extern unsigned long long int wcstoull_l (__const wchar_t *__restrict __nptr,
+ wchar_t **__restrict __endptr,
+ int __base, __locale_t __loc)
+ __THROW;
+
+extern double wcstod_l (__const wchar_t *__restrict __nptr,
+ wchar_t **__restrict __endptr, __locale_t __loc)
+ __THROW;
+
+extern float wcstof_l (__const wchar_t *__restrict __nptr,
+ wchar_t **__restrict __endptr, __locale_t __loc)
+ __THROW;
+
+extern long double wcstold_l (__const wchar_t *__restrict __nptr,
+ wchar_t **__restrict __endptr,
+ __locale_t __loc) __THROW;
+#endif /* GNU */
+
+
+#ifdef __USE_GNU
+/* Copy SRC to DEST, returning the address of the terminating L'\0' in
+ DEST. */
+extern wchar_t *wcpcpy (wchar_t *__dest, __const wchar_t *__src) __THROW;
+
+/* Copy no more than N characters of SRC to DEST, returning the address of
+ the last character written into DEST. */
+extern wchar_t *wcpncpy (wchar_t *__dest, __const wchar_t *__src, size_t __n)
+ __THROW;
+#endif /* use GNU */
+
+
+/* Wide character I/O functions. */
+
+#ifdef __USE_GNU
+/* Like OPEN_MEMSTREAM, but the stream is wide oriented and produces
+ a wide character string. */
+extern __FILE *open_wmemstream (wchar_t **__bufloc, size_t *__sizeloc) __THROW;
+#endif
+
+#if defined __USE_ISOC95 || defined __USE_UNIX98
+__BEGIN_NAMESPACE_STD
+
+/* Select orientation for stream. */
+extern int fwide (__FILE *__fp, int __mode) __THROW;
+
+
+/* Write formatted output to STREAM.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int fwprintf (__FILE *__restrict __stream,
+ __const wchar_t *__restrict __format, ...)
+ /* __attribute__ ((__format__ (__wprintf__, 2, 3))) */;
+/* Write formatted output to stdout.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int wprintf (__const wchar_t *__restrict __format, ...)
+ /* __attribute__ ((__format__ (__wprintf__, 1, 2))) */;
+/* Write formatted output of at most N characters to S. */
+extern int swprintf (wchar_t *__restrict __s, size_t __n,
+ __const wchar_t *__restrict __format, ...)
+ __THROW /* __attribute__ ((__format__ (__wprintf__, 3, 4))) */;
+
+/* Write formatted output to S from argument list ARG.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int vfwprintf (__FILE *__restrict __s,
+ __const wchar_t *__restrict __format,
+ __gnuc_va_list __arg)
+ /* __attribute__ ((__format__ (__wprintf__, 2, 0))) */;
+/* Write formatted output to stdout from argument list ARG.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int vwprintf (__const wchar_t *__restrict __format,
+ __gnuc_va_list __arg)
+ /* __attribute__ ((__format__ (__wprintf__, 1, 0))) */;
+/* Write formatted output of at most N character to S from argument
+ list ARG. */
+extern int vswprintf (wchar_t *__restrict __s, size_t __n,
+ __const wchar_t *__restrict __format,
+ __gnuc_va_list __arg)
+ __THROW /* __attribute__ ((__format__ (__wprintf__, 3, 0))) */;
+
+
+/* Read formatted input from STREAM.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int fwscanf (__FILE *__restrict __stream,
+ __const wchar_t *__restrict __format, ...)
+ /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */;
+/* Read formatted input from stdin.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int wscanf (__const wchar_t *__restrict __format, ...)
+ /* __attribute__ ((__format__ (__wscanf__, 1, 2))) */;
+/* Read formatted input from S. */
+extern int swscanf (__const wchar_t *__restrict __s,
+ __const wchar_t *__restrict __format, ...)
+ __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */;
+
+# if defined __USE_ISOC99 && !defined __USE_GNU \
+ && (!defined __LDBL_COMPAT || !defined __REDIRECT) \
+ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K)
+# ifdef __REDIRECT
+/* For strict ISO C99 or POSIX compliance disallow %as, %aS and %a[
+ GNU extension which conflicts with valid %a followed by letter
+ s, S or [. */
+extern int __REDIRECT (fwscanf, (__FILE *__restrict __stream,
+ __const wchar_t *__restrict __format, ...),
+ __isoc99_fwscanf)
+ /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */;
+extern int __REDIRECT (wscanf, (__const wchar_t *__restrict __format, ...),
+ __isoc99_wscanf)
+ /* __attribute__ ((__format__ (__wscanf__, 1, 2))) */;
+extern int __REDIRECT (swscanf, (__const wchar_t *__restrict __s,
+ __const wchar_t *__restrict __format, ...),
+ __isoc99_swscanf)
+ __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */;
+# else
+extern int __isoc99_fwscanf (__FILE *__restrict __stream,
+ __const wchar_t *__restrict __format, ...);
+extern int __isoc99_wscanf (__const wchar_t *__restrict __format, ...);
+extern int __isoc99_swscanf (__const wchar_t *__restrict __s,
+ __const wchar_t *__restrict __format, ...)
+ __THROW;
+# define fwscanf __isoc99_fwscanf
+# define wscanf __isoc99_wscanf
+# define swscanf __isoc99_swscanf
+# endif
+# endif
+
+__END_NAMESPACE_STD
+#endif /* Use ISO C95, C99 and Unix98. */
+
+#ifdef __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Read formatted input from S into argument list ARG.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int vfwscanf (__FILE *__restrict __s,
+ __const wchar_t *__restrict __format,
+ __gnuc_va_list __arg)
+ /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */;
+/* Read formatted input from stdin into argument list ARG.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int vwscanf (__const wchar_t *__restrict __format,
+ __gnuc_va_list __arg)
+ /* __attribute__ ((__format__ (__wscanf__, 1, 0))) */;
+/* Read formatted input from S into argument list ARG. */
+extern int vswscanf (__const wchar_t *__restrict __s,
+ __const wchar_t *__restrict __format,
+ __gnuc_va_list __arg)
+ __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */;
+
+# if !defined __USE_GNU \
+ && (!defined __LDBL_COMPAT || !defined __REDIRECT) \
+ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K)
+# ifdef __REDIRECT
+extern int __REDIRECT (vfwscanf, (__FILE *__restrict __s,
+ __const wchar_t *__restrict __format,
+ __gnuc_va_list __arg), __isoc99_vfwscanf)
+ /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */;
+extern int __REDIRECT (vwscanf, (__const wchar_t *__restrict __format,
+ __gnuc_va_list __arg), __isoc99_vwscanf)
+ /* __attribute__ ((__format__ (__wscanf__, 1, 0))) */;
+extern int __REDIRECT (vswscanf, (__const wchar_t *__restrict __s,
+ __const wchar_t *__restrict __format,
+ __gnuc_va_list __arg), __isoc99_vswscanf)
+ __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */;
+# else
+extern int __isoc99_vfwscanf (__FILE *__restrict __s,
+ __const wchar_t *__restrict __format,
+ __gnuc_va_list __arg);
+extern int __isoc99_vwscanf (__const wchar_t *__restrict __format,
+ __gnuc_va_list __arg);
+extern int __isoc99_vswscanf (__const wchar_t *__restrict __s,
+ __const wchar_t *__restrict __format,
+ __gnuc_va_list __arg) __THROW;
+# define vfwscanf __isoc99_vfwscanf
+# define vwscanf __isoc99_vwscanf
+# define vswscanf __isoc99_vswscanf
+# endif
+# endif
+
+__END_NAMESPACE_C99
+#endif /* Use ISO C99. */
+
+
+__BEGIN_NAMESPACE_STD
+/* Read a character from STREAM.
+
+ These functions are possible cancellation points and therefore not
+ marked with __THROW. */
+extern wint_t fgetwc (__FILE *__stream);
+extern wint_t getwc (__FILE *__stream);
+
+/* Read a character from stdin.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern wint_t getwchar (void);
+
+
+/* Write a character to STREAM.
+
+ These functions are possible cancellation points and therefore not
+ marked with __THROW. */
+extern wint_t fputwc (wchar_t __wc, __FILE *__stream);
+extern wint_t putwc (wchar_t __wc, __FILE *__stream);
+
+/* Write a character to stdout.
+
+ This function is a possible cancellation points and therefore not
+ marked with __THROW. */
+extern wint_t putwchar (wchar_t __wc);
+
+
+/* Get a newline-terminated wide character string of finite length
+ from STREAM.
+
+ This function is a possible cancellation points and therefore not
+ marked with __THROW. */
+extern wchar_t *fgetws (wchar_t *__restrict __ws, int __n,
+ __FILE *__restrict __stream);
+
+/* Write a string to STREAM.
+
+ This function is a possible cancellation points and therefore not
+ marked with __THROW. */
+extern int fputws (__const wchar_t *__restrict __ws,
+ __FILE *__restrict __stream);
+
+
+/* Push a character back onto the input buffer of STREAM.
+
+ This function is a possible cancellation points and therefore not
+ marked with __THROW. */
+extern wint_t ungetwc (wint_t __wc, __FILE *__stream);
+__END_NAMESPACE_STD
+
+
+#ifdef __USE_GNU
+/* These are defined to be equivalent to the `char' functions defined
+ in POSIX.1:1996.
+
+ These functions are not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation they are cancellation points and
+ therefore not marked with __THROW. */
+extern wint_t getwc_unlocked (__FILE *__stream);
+extern wint_t getwchar_unlocked (void);
+
+/* This is the wide character version of a GNU extension.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern wint_t fgetwc_unlocked (__FILE *__stream);
+
+/* Faster version when locking is not necessary.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern wint_t fputwc_unlocked (wchar_t __wc, __FILE *__stream);
+
+/* These are defined to be equivalent to the `char' functions defined
+ in POSIX.1:1996.
+
+ These functions are not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation they are cancellation points and
+ therefore not marked with __THROW. */
+extern wint_t putwc_unlocked (wchar_t __wc, __FILE *__stream);
+extern wint_t putwchar_unlocked (wchar_t __wc);
+
+
+/* This function does the same as `fgetws' but does not lock the stream.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern wchar_t *fgetws_unlocked (wchar_t *__restrict __ws, int __n,
+ __FILE *__restrict __stream);
+
+/* This function does the same as `fputws' but does not lock the stream.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int fputws_unlocked (__const wchar_t *__restrict __ws,
+ __FILE *__restrict __stream);
+#endif
+
+
+__BEGIN_NAMESPACE_C99
+/* Format TP into S according to FORMAT.
+ Write no more than MAXSIZE wide characters and return the number
+ of wide characters written, or 0 if it would exceed MAXSIZE. */
+extern size_t wcsftime (wchar_t *__restrict __s, size_t __maxsize,
+ __const wchar_t *__restrict __format,
+ __const struct tm *__restrict __tp) __THROW;
+__END_NAMESPACE_C99
+
+# ifdef __USE_GNU
+# include <xlocale.h>
+
+/* Similar to `wcsftime' but takes the information from
+ the provided locale and not the global locale. */
+extern size_t wcsftime_l (wchar_t *__restrict __s, size_t __maxsize,
+ __const wchar_t *__restrict __format,
+ __const struct tm *__restrict __tp,
+ __locale_t __loc) __THROW;
+# endif
+
+/* The X/Open standard demands that most of the functions defined in
+ the <wctype.h> header must also appear here. This is probably
+ because some X/Open members wrote their implementation before the
+ ISO C standard was published and introduced the better solution.
+ We have to provide these definitions for compliance reasons but we
+ do this nonsense only if really necessary. */
+#if defined __USE_UNIX98 && !defined __USE_GNU
+# define __need_iswxxx
+# include <wctype.h>
+#endif
+
+/* Define some macros helping to catch buffer overflows. */
+#if __USE_FORTIFY_LEVEL > 0 && defined __extern_always_inline
+# include <bits/wchar2.h>
+#endif
+
+#ifdef __LDBL_COMPAT
+# include <bits/wchar-ldbl.h>
+#endif
+
+__END_DECLS
+
+#endif /* _WCHAR_H defined */
+
+/* Undefined all __need_* constants in case we are included to get those
+ constants but the whole file was already read. */
+#undef __need_mbstate_t
+#undef __need_wint_t
+
+#endif /* wchar.h */
diff --git a/sysroot/usr/include/wctype.h b/sysroot/usr/include/wctype.h
new file mode 100644
index 0000000..6032559
--- /dev/null
+++ b/sysroot/usr/include/wctype.h
@@ -0,0 +1,319 @@
+/* Copyright (C) 1996-2002, 2005, 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99 Standard: 7.25
+ * Wide character classification and mapping utilities <wctype.h>
+ */
+
+#ifndef _WCTYPE_H
+
+#include <features.h>
+#include <bits/types.h>
+
+#ifndef __need_iswxxx
+# define _WCTYPE_H 1
+
+/* Get wint_t from <wchar.h>. */
+# define __need_wint_t
+# include <wchar.h>
+
+/* Constant expression of type `wint_t' whose value does not correspond
+ to any member of the extended character set. */
+# ifndef WEOF
+# define WEOF (0xffffffffu)
+# endif
+#endif
+#undef __need_iswxxx
+
+
+/* The following part is also used in the <wcsmbs.h> header when compiled
+ in the Unix98 compatibility mode. */
+#ifndef __iswxxx_defined
+# define __iswxxx_defined 1
+
+__BEGIN_NAMESPACE_C99
+/* Scalar type that can hold values which represent locale-specific
+ character classifications. */
+typedef unsigned long int wctype_t;
+__END_NAMESPACE_C99
+
+# ifndef _ISwbit
+/* The characteristics are stored always in network byte order (big
+ endian). We define the bit value interpretations here dependent on the
+ machine's byte order. */
+
+# include <endian.h>
+# if __BYTE_ORDER == __BIG_ENDIAN
+# define _ISwbit(bit) (1 << (bit))
+# else /* __BYTE_ORDER == __LITTLE_ENDIAN */
+# define _ISwbit(bit) \
+ ((bit) < 8 ? (int) ((1UL << (bit)) << 24) \
+ : ((bit) < 16 ? (int) ((1UL << (bit)) << 8) \
+ : ((bit) < 24 ? (int) ((1UL << (bit)) >> 8) \
+ : (int) ((1UL << (bit)) >> 24))))
+# endif
+
+enum
+{
+ __ISwupper = 0, /* UPPERCASE. */
+ __ISwlower = 1, /* lowercase. */
+ __ISwalpha = 2, /* Alphabetic. */
+ __ISwdigit = 3, /* Numeric. */
+ __ISwxdigit = 4, /* Hexadecimal numeric. */
+ __ISwspace = 5, /* Whitespace. */
+ __ISwprint = 6, /* Printing. */
+ __ISwgraph = 7, /* Graphical. */
+ __ISwblank = 8, /* Blank (usually SPC and TAB). */
+ __ISwcntrl = 9, /* Control character. */
+ __ISwpunct = 10, /* Punctuation. */
+ __ISwalnum = 11, /* Alphanumeric. */
+
+ _ISwupper = _ISwbit (__ISwupper), /* UPPERCASE. */
+ _ISwlower = _ISwbit (__ISwlower), /* lowercase. */
+ _ISwalpha = _ISwbit (__ISwalpha), /* Alphabetic. */
+ _ISwdigit = _ISwbit (__ISwdigit), /* Numeric. */
+ _ISwxdigit = _ISwbit (__ISwxdigit), /* Hexadecimal numeric. */
+ _ISwspace = _ISwbit (__ISwspace), /* Whitespace. */
+ _ISwprint = _ISwbit (__ISwprint), /* Printing. */
+ _ISwgraph = _ISwbit (__ISwgraph), /* Graphical. */
+ _ISwblank = _ISwbit (__ISwblank), /* Blank (usually SPC and TAB). */
+ _ISwcntrl = _ISwbit (__ISwcntrl), /* Control character. */
+ _ISwpunct = _ISwbit (__ISwpunct), /* Punctuation. */
+ _ISwalnum = _ISwbit (__ISwalnum) /* Alphanumeric. */
+};
+# endif /* Not _ISwbit */
+
+
+__BEGIN_DECLS
+
+__BEGIN_NAMESPACE_C99
+/*
+ * Wide-character classification functions: 7.15.2.1.
+ */
+
+/* Test for any wide character for which `iswalpha' or `iswdigit' is
+ true. */
+extern int iswalnum (wint_t __wc) __THROW;
+
+/* Test for any wide character for which `iswupper' or 'iswlower' is
+ true, or any wide character that is one of a locale-specific set of
+ wide-characters for which none of `iswcntrl', `iswdigit',
+ `iswpunct', or `iswspace' is true. */
+extern int iswalpha (wint_t __wc) __THROW;
+
+/* Test for any control wide character. */
+extern int iswcntrl (wint_t __wc) __THROW;
+
+/* Test for any wide character that corresponds to a decimal-digit
+ character. */
+extern int iswdigit (wint_t __wc) __THROW;
+
+/* Test for any wide character for which `iswprint' is true and
+ `iswspace' is false. */
+extern int iswgraph (wint_t __wc) __THROW;
+
+/* Test for any wide character that corresponds to a lowercase letter
+ or is one of a locale-specific set of wide characters for which
+ none of `iswcntrl', `iswdigit', `iswpunct', or `iswspace' is true. */
+extern int iswlower (wint_t __wc) __THROW;
+
+/* Test for any printing wide character. */
+extern int iswprint (wint_t __wc) __THROW;
+
+/* Test for any printing wide character that is one of a
+ locale-specific et of wide characters for which neither `iswspace'
+ nor `iswalnum' is true. */
+extern int iswpunct (wint_t __wc) __THROW;
+
+/* Test for any wide character that corresponds to a locale-specific
+ set of wide characters for which none of `iswalnum', `iswgraph', or
+ `iswpunct' is true. */
+extern int iswspace (wint_t __wc) __THROW;
+
+/* Test for any wide character that corresponds to an uppercase letter
+ or is one of a locale-specific set of wide character for which none
+ of `iswcntrl', `iswdigit', `iswpunct', or `iswspace' is true. */
+extern int iswupper (wint_t __wc) __THROW;
+
+/* Test for any wide character that corresponds to a hexadecimal-digit
+ character equivalent to that performed be the functions described
+ in the previous subclause. */
+extern int iswxdigit (wint_t __wc) __THROW;
+
+/* Test for any wide character that corresponds to a standard blank
+ wide character or a locale-specific set of wide characters for
+ which `iswalnum' is false. */
+# ifdef __USE_ISOC99
+extern int iswblank (wint_t __wc) __THROW;
+# endif
+
+/*
+ * Extensible wide-character classification functions: 7.15.2.2.
+ */
+
+/* Construct value that describes a class of wide characters identified
+ by the string argument PROPERTY. */
+extern wctype_t wctype (__const char *__property) __THROW;
+
+/* Determine whether the wide-character WC has the property described by
+ DESC. */
+extern int iswctype (wint_t __wc, wctype_t __desc) __THROW;
+__END_NAMESPACE_C99
+
+
+/*
+ * Wide-character case-mapping functions: 7.15.3.1.
+ */
+
+__BEGIN_NAMESPACE_C99
+/* Scalar type that can hold values which represent locale-specific
+ character mappings. */
+typedef __const __int32_t *wctrans_t;
+__END_NAMESPACE_C99
+#ifdef __USE_GNU
+__USING_NAMESPACE_C99(wctrans_t)
+#endif
+
+__BEGIN_NAMESPACE_C99
+/* Converts an uppercase letter to the corresponding lowercase letter. */
+extern wint_t towlower (wint_t __wc) __THROW;
+
+/* Converts an lowercase letter to the corresponding uppercase letter. */
+extern wint_t towupper (wint_t __wc) __THROW;
+__END_NAMESPACE_C99
+
+__END_DECLS
+
+#endif /* need iswxxx. */
+
+
+/* The remaining definitions and declarations must not appear in the
+ <wcsmbs.h> header. */
+#ifdef _WCTYPE_H
+
+/*
+ * Extensible wide-character mapping functions: 7.15.3.2.
+ */
+
+__BEGIN_DECLS
+
+__BEGIN_NAMESPACE_C99
+/* Construct value that describes a mapping between wide characters
+ identified by the string argument PROPERTY. */
+extern wctrans_t wctrans (__const char *__property) __THROW;
+
+/* Map the wide character WC using the mapping described by DESC. */
+extern wint_t towctrans (wint_t __wc, wctrans_t __desc) __THROW;
+__END_NAMESPACE_C99
+
+# ifdef __USE_GNU
+/* Declare the interface to extended locale model. */
+# include <xlocale.h>
+
+/* Test for any wide character for which `iswalpha' or `iswdigit' is
+ true. */
+extern int iswalnum_l (wint_t __wc, __locale_t __locale) __THROW;
+
+/* Test for any wide character for which `iswupper' or 'iswlower' is
+ true, or any wide character that is one of a locale-specific set of
+ wide-characters for which none of `iswcntrl', `iswdigit',
+ `iswpunct', or `iswspace' is true. */
+extern int iswalpha_l (wint_t __wc, __locale_t __locale) __THROW;
+
+/* Test for any control wide character. */
+extern int iswcntrl_l (wint_t __wc, __locale_t __locale) __THROW;
+
+/* Test for any wide character that corresponds to a decimal-digit
+ character. */
+extern int iswdigit_l (wint_t __wc, __locale_t __locale) __THROW;
+
+/* Test for any wide character for which `iswprint' is true and
+ `iswspace' is false. */
+extern int iswgraph_l (wint_t __wc, __locale_t __locale) __THROW;
+
+/* Test for any wide character that corresponds to a lowercase letter
+ or is one of a locale-specific set of wide characters for which
+ none of `iswcntrl', `iswdigit', `iswpunct', or `iswspace' is true. */
+extern int iswlower_l (wint_t __wc, __locale_t __locale) __THROW;
+
+/* Test for any printing wide character. */
+extern int iswprint_l (wint_t __wc, __locale_t __locale) __THROW;
+
+/* Test for any printing wide character that is one of a
+ locale-specific et of wide characters for which neither `iswspace'
+ nor `iswalnum' is true. */
+extern int iswpunct_l (wint_t __wc, __locale_t __locale) __THROW;
+
+/* Test for any wide character that corresponds to a locale-specific
+ set of wide characters for which none of `iswalnum', `iswgraph', or
+ `iswpunct' is true. */
+extern int iswspace_l (wint_t __wc, __locale_t __locale) __THROW;
+
+/* Test for any wide character that corresponds to an uppercase letter
+ or is one of a locale-specific set of wide character for which none
+ of `iswcntrl', `iswdigit', `iswpunct', or `iswspace' is true. */
+extern int iswupper_l (wint_t __wc, __locale_t __locale) __THROW;
+
+/* Test for any wide character that corresponds to a hexadecimal-digit
+ character equivalent to that performed be the functions described
+ in the previous subclause. */
+extern int iswxdigit_l (wint_t __wc, __locale_t __locale) __THROW;
+
+/* Test for any wide character that corresponds to a standard blank
+ wide character or a locale-specific set of wide characters for
+ which `iswalnum' is false. */
+extern int iswblank_l (wint_t __wc, __locale_t __locale) __THROW;
+
+/* Construct value that describes a class of wide characters identified
+ by the string argument PROPERTY. */
+extern wctype_t wctype_l (__const char *__property, __locale_t __locale)
+ __THROW;
+
+/* Determine whether the wide-character WC has the property described by
+ DESC. */
+extern int iswctype_l (wint_t __wc, wctype_t __desc, __locale_t __locale)
+ __THROW;
+
+
+/*
+ * Wide-character case-mapping functions.
+ */
+
+/* Converts an uppercase letter to the corresponding lowercase letter. */
+extern wint_t towlower_l (wint_t __wc, __locale_t __locale) __THROW;
+
+/* Converts an lowercase letter to the corresponding uppercase letter. */
+extern wint_t towupper_l (wint_t __wc, __locale_t __locale) __THROW;
+
+/* Construct value that describes a mapping between wide characters
+ identified by the string argument PROPERTY. */
+extern wctrans_t wctrans_l (__const char *__property, __locale_t __locale)
+ __THROW;
+
+/* Map the wide character WC using the mapping described by DESC. */
+extern wint_t towctrans_l (wint_t __wc, wctrans_t __desc,
+ __locale_t __locale) __THROW;
+
+# endif /* Use GNU. */
+
+__END_DECLS
+
+#endif /* __WCTYPE_H defined. */
+
+#endif /* wctype.h */
diff --git a/sysroot/usr/include/wordexp.h b/sysroot/usr/include/wordexp.h
new file mode 100644
index 0000000..1c40e61
--- /dev/null
+++ b/sysroot/usr/include/wordexp.h
@@ -0,0 +1,71 @@
+/* Copyright (C) 1991, 92, 1996-1999, 2001, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _WORDEXP_H
+#define _WORDEXP_H 1
+
+#include <features.h>
+#define __need_size_t
+#include <stddef.h>
+
+__BEGIN_DECLS
+
+/* Bits set in the FLAGS argument to `wordexp'. */
+enum
+ {
+ WRDE_DOOFFS = (1 << 0), /* Insert PWORDEXP->we_offs NULLs. */
+ WRDE_APPEND = (1 << 1), /* Append to results of a previous call. */
+ WRDE_NOCMD = (1 << 2), /* Don't do command substitution. */
+ WRDE_REUSE = (1 << 3), /* Reuse storage in PWORDEXP. */
+ WRDE_SHOWERR = (1 << 4), /* Don't redirect stderr to /dev/null. */
+ WRDE_UNDEF = (1 << 5), /* Error for expanding undefined variables. */
+ __WRDE_FLAGS = (WRDE_DOOFFS | WRDE_APPEND | WRDE_NOCMD |
+ WRDE_REUSE | WRDE_SHOWERR | WRDE_UNDEF)
+ };
+
+/* Structure describing a word-expansion run. */
+typedef struct
+ {
+ size_t we_wordc; /* Count of words matched. */
+ char **we_wordv; /* List of expanded words. */
+ size_t we_offs; /* Slots to reserve in `we_wordv'. */
+ } wordexp_t;
+
+/* Possible nonzero return values from `wordexp'. */
+enum
+ {
+#ifdef __USE_XOPEN
+ WRDE_NOSYS = -1, /* Never used since we support `wordexp'. */
+#endif
+ WRDE_NOSPACE = 1, /* Ran out of memory. */
+ WRDE_BADCHAR, /* A metachar appears in the wrong place. */
+ WRDE_BADVAL, /* Undefined var reference with WRDE_UNDEF. */
+ WRDE_CMDSUB, /* Command substitution with WRDE_NOCMD. */
+ WRDE_SYNTAX /* Shell syntax error. */
+ };
+
+/* Do word expansion of WORDS into PWORDEXP. */
+extern int wordexp (__const char *__restrict __words,
+ wordexp_t *__restrict __pwordexp, int __flags);
+
+/* Free the storage allocated by a `wordexp' call. */
+extern void wordfree (wordexp_t *__wordexp) __THROW;
+
+__END_DECLS
+
+#endif /* wordexp.h */
diff --git a/sysroot/usr/include/xlocale.h b/sysroot/usr/include/xlocale.h
new file mode 100644
index 0000000..2b17d69
--- /dev/null
+++ b/sysroot/usr/include/xlocale.h
@@ -0,0 +1,42 @@
+/* Definition of locale datatype.
+ Copyright (C) 1997,2000,02 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _XLOCALE_H
+#define _XLOCALE_H 1
+
+/* Structure for reentrant locale using functions. This is an
+ (almost) opaque type for the user level programs. The file and
+ this data structure is not standardized. Don't rely on it. It can
+ go away without warning. */
+typedef struct __locale_struct
+{
+ /* Note: LC_ALL is not a valid index into this array. */
+ struct locale_data *__locales[13]; /* 13 = __LC_LAST. */
+
+ /* To increase the speed of this solution we add some special members. */
+ const unsigned short int *__ctype_b;
+ const int *__ctype_tolower;
+ const int *__ctype_toupper;
+
+ /* Note: LC_ALL is not a valid index into this array. */
+ const char *__names[13];
+} *__locale_t;
+
+#endif /* xlocale.h */
diff --git a/sysroot/usr/include/zconf.h b/sysroot/usr/include/zconf.h
new file mode 100644
index 0000000..dc047be
--- /dev/null
+++ b/sysroot/usr/include/zconf.h
@@ -0,0 +1,394 @@
+/* zconf.h -- configuration of the zlib compression library
+ * Copyright (C) 1995-2006 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id$ */
+
+#ifndef ZCONF_H
+#define ZCONF_H
+
+/*
+ * If you *really* need a unique prefix for all types and library functions,
+ * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
+ * Even better than compiling with -DZ_PREFIX would be to use configure to set
+ * this permanently in zconf.h using "./configure --zprefix".
+ */
+#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
+
+/* all linked symbols */
+# define _dist_code z__dist_code
+# define _length_code z__length_code
+# define _tr_align z__tr_align
+# define _tr_flush_block z__tr_flush_block
+# define _tr_init z__tr_init
+# define _tr_stored_block z__tr_stored_block
+# define _tr_tally z__tr_tally
+# define adler32 z_adler32
+# define adler32_combine z_adler32_combine
+# define compress z_compress
+# define compress2 z_compress2
+# define compressBound z_compressBound
+# define crc32 z_crc32
+# define crc32_combine z_crc32_combine
+# define deflate z_deflate
+# define deflateBound z_deflateBound
+# define deflateCopy z_deflateCopy
+# define deflateEnd z_deflateEnd
+# define deflateInit2_ z_deflateInit2_
+# define deflateInit_ z_deflateInit_
+# define deflateParams z_deflateParams
+# define deflatePrime z_deflatePrime
+# define deflateReset z_deflateReset
+# define deflateSetDictionary z_deflateSetDictionary
+# define deflateSetHeader z_deflateSetHeader
+# define deflateTune z_deflateTune
+# define deflate_copyright z_deflate_copyright
+# define get_crc_table z_get_crc_table
+# define gzclearerr z_gzclearerr
+# define gzclose z_gzclose
+# define gzdirect z_gzdirect
+# define gzdopen z_gzdopen
+# define gzeof z_gzeof
+# define gzerror z_gzerror
+# define gzflush z_gzflush
+# define gzgetc z_gzgetc
+# define gzgets z_gzgets
+# define gzopen z_gzopen
+# define gzprintf z_gzprintf
+# define gzputc z_gzputc
+# define gzputs z_gzputs
+# define gzread z_gzread
+# define gzrewind z_gzrewind
+# define gzseek z_gzseek
+# define gzsetparams z_gzsetparams
+# define gztell z_gztell
+# define gzungetc z_gzungetc
+# define gzwrite z_gzwrite
+# define inflate z_inflate
+# define inflateBack z_inflateBack
+# define inflateBackEnd z_inflateBackEnd
+# define inflateBackInit_ z_inflateBackInit_
+# define inflateCopy z_inflateCopy
+# define inflateEnd z_inflateEnd
+# define inflateGetHeader z_inflateGetHeader
+# define inflateInit2_ z_inflateInit2_
+# define inflateInit_ z_inflateInit_
+# define inflatePrime z_inflatePrime
+# define inflateReset z_inflateReset
+# define inflateSetDictionary z_inflateSetDictionary
+# define inflateSync z_inflateSync
+# define inflateSyncPoint z_inflateSyncPoint
+# define inflate_copyright z_inflate_copyright
+# define inflate_fast z_inflate_fast
+# define inflate_table z_inflate_table
+# define uncompress z_uncompress
+# define zError z_zError
+# define z_errmsg z_z_errmsg
+# define zcalloc z_zcalloc
+# define zcfree z_zcfree
+# define zlibCompileFlags z_zlibCompileFlags
+# define zlibVersion z_zlibVersion
+
+/* all zlib typedefs in zlib.h and zconf.h */
+# define Byte z_Byte
+# define Bytef z_Bytef
+# define alloc_func z_alloc_func
+# define charf z_charf
+# define free_func z_free_func
+# define gzFile z_gzFile
+# define gz_header z_gz_header
+# define gz_headerp z_gz_headerp
+# define in_func z_in_func
+# define intf z_intf
+# define out_func z_out_func
+# define uInt z_uInt
+# define uIntf z_uIntf
+# define uLong z_uLong
+# define uLongf z_uLongf
+# define voidp z_voidp
+# define voidp z_voidp
+# define voidpc z_voidpc
+# define voidpc z_voidpc
+# define voidpf z_voidpf
+# define voidpf z_voidpf
+# define z_stream z_z_stream
+# define z_streamp z_z_streamp
+
+/* all zlib structs in zlib.h and zconf.h */
+# define gz_header_s z_gz_header_s
+# define internal_state z_internal_state
+# define z_stream_s z_z_stream_s
+
+#endif
+
+#if defined(__MSDOS__) && !defined(MSDOS)
+# define MSDOS
+#endif
+#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
+# define OS2
+#endif
+#if defined(_WINDOWS) && !defined(WINDOWS)
+# define WINDOWS
+#endif
+#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
+# ifndef WIN32
+# define WIN32
+# endif
+#endif
+#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
+# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
+# ifndef SYS16BIT
+# define SYS16BIT
+# endif
+# endif
+#endif
+
+/*
+ * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
+ * than 64k bytes at a time (needed on systems with 16-bit int).
+ */
+#ifdef SYS16BIT
+# define MAXSEG_64K
+#endif
+#ifdef MSDOS
+# define UNALIGNED_OK
+#endif
+
+#ifdef __STDC_VERSION__
+# ifndef STDC
+# define STDC
+# endif
+# if __STDC_VERSION__ >= 199901L
+# ifndef STDC99
+# define STDC99
+# endif
+# endif
+#endif
+#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
+# define STDC
+#endif
+#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
+# define STDC
+#endif
+#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
+# define STDC
+#endif
+#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
+# define STDC
+#endif
+
+#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
+# define STDC
+#endif
+
+#ifndef STDC
+# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
+# define const /* note: need a more gentle solution here */
+# endif
+#endif
+
+/* Some Mac compilers merge all .h files incorrectly: */
+#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
+# define NO_DUMMY_DECL
+#endif
+
+/* Maximum value for memLevel in deflateInit2 */
+#ifndef MAX_MEM_LEVEL
+# ifdef MAXSEG_64K
+# define MAX_MEM_LEVEL 8
+# else
+# define MAX_MEM_LEVEL 9
+# endif
+#endif
+
+/* Maximum value for windowBits in deflateInit2 and inflateInit2.
+ * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
+ * created by gzip. (Files created by minigzip can still be extracted by
+ * gzip.)
+ */
+#ifndef MAX_WBITS
+# define MAX_WBITS 15 /* 32K LZ77 window */
+#endif
+
+/* The memory requirements for deflate are (in bytes):
+ (1 << (windowBits+2)) + (1 << (memLevel+9))
+ that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
+ plus a few kilobytes for small objects. For example, if you want to reduce
+ the default memory requirements from 256K to 128K, compile with
+ make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
+ Of course this will generally degrade compression (there's no free lunch).
+
+ The memory requirements for inflate are (in bytes) 1 << windowBits
+ that is, 32K for windowBits=15 (default value) plus a few kilobytes
+ for small objects.
+*/
+
+ /* Type declarations */
+
+#ifndef OF /* function prototypes */
+# ifdef STDC
+# define OF(args) args
+# else
+# define OF(args) ()
+# endif
+#endif
+
+/* The following definitions for FAR are needed only for MSDOS mixed
+ * model programming (small or medium model with some far allocations).
+ * This was tested only with MSC; for other MSDOS compilers you may have
+ * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
+ * just define FAR to be empty.
+ */
+#ifdef SYS16BIT
+# if defined(M_I86SM) || defined(M_I86MM)
+ /* MSC small or medium model */
+# define SMALL_MEDIUM
+# ifdef _MSC_VER
+# define FAR _far
+# else
+# define FAR far
+# endif
+# endif
+# if (defined(__SMALL__) || defined(__MEDIUM__))
+ /* Turbo C small or medium model */
+# define SMALL_MEDIUM
+# ifdef __BORLANDC__
+# define FAR _far
+# else
+# define FAR far
+# endif
+# endif
+#endif
+
+#if defined(WINDOWS) || defined(WIN32)
+ /* If building or using zlib as a DLL, define ZLIB_DLL.
+ * This is not mandatory, but it offers a little performance increase.
+ */
+# ifdef ZLIB_DLL
+# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
+# ifdef ZLIB_INTERNAL
+# define ZEXTERN extern __declspec(dllexport)
+# else
+# define ZEXTERN extern __declspec(dllimport)
+# endif
+# endif
+# endif /* ZLIB_DLL */
+ /* If building or using zlib with the WINAPI/WINAPIV calling convention,
+ * define ZLIB_WINAPI.
+ * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
+ */
+# ifdef ZLIB_WINAPI
+# ifdef FAR
+# undef FAR
+# endif
+# include <windows.h>
+ /* No need for _export, use ZLIB.DEF instead. */
+ /* For complete Windows compatibility, use WINAPI, not __stdcall. */
+# define ZEXPORT WINAPI
+# ifdef WIN32
+# define ZEXPORTVA WINAPIV
+# else
+# define ZEXPORTVA FAR CDECL
+# endif
+# endif
+#endif
+
+#if defined (__BEOS__)
+# ifdef ZLIB_DLL
+# ifdef ZLIB_INTERNAL
+# define ZEXPORT __declspec(dllexport)
+# define ZEXPORTVA __declspec(dllexport)
+# else
+# define ZEXPORT __declspec(dllimport)
+# define ZEXPORTVA __declspec(dllimport)
+# endif
+# endif
+#endif
+
+#ifdef HAVE_VISIBILITY_PRAGMA
+# define ZEXTERN __attribute__((visibility ("default"))) extern
+#endif
+
+#ifndef ZEXTERN
+# define ZEXTERN extern
+#endif
+#ifndef ZEXPORT
+# define ZEXPORT
+#endif
+#ifndef ZEXPORTVA
+# define ZEXPORTVA
+#endif
+
+#ifndef FAR
+# define FAR
+#endif
+
+#if !defined(__MACTYPES__)
+typedef unsigned char Byte; /* 8 bits */
+#endif
+typedef unsigned int uInt; /* 16 bits or more */
+typedef unsigned long uLong; /* 32 bits or more */
+
+#ifdef SMALL_MEDIUM
+ /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
+# define Bytef Byte FAR
+#else
+ typedef Byte FAR Bytef;
+#endif
+typedef char FAR charf;
+typedef int FAR intf;
+typedef uInt FAR uIntf;
+typedef uLong FAR uLongf;
+
+#ifdef STDC
+ typedef void const *voidpc;
+ typedef void FAR *voidpf;
+ typedef void *voidp;
+#else
+ typedef Byte const *voidpc;
+ typedef Byte FAR *voidpf;
+ typedef Byte *voidp;
+#endif
+
+#include "zlibdefs.h" /* created by configure */
+
+#ifdef _LARGEFILE64_SOURCE
+#include <sys/types.h>
+#endif
+
+#ifndef SEEK_SET
+# define SEEK_SET 0 /* Seek from beginning of file. */
+# define SEEK_CUR 1 /* Seek from current position. */
+# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
+#endif
+#ifndef z_off_t
+# define z_off_t long
+#endif
+
+#if defined(__OS400__)
+# define NO_vsnprintf
+#endif
+
+#if defined(__MVS__)
+# define NO_vsnprintf
+#endif
+
+/* MVS linker does not support external names larger than 8 bytes */
+#if defined(__MVS__)
+# pragma map(deflateInit_,"DEIN")
+# pragma map(deflateInit2_,"DEIN2")
+# pragma map(deflateEnd,"DEEND")
+# pragma map(deflateBound,"DEBND")
+# pragma map(inflateInit_,"ININ")
+# pragma map(inflateInit2_,"ININ2")
+# pragma map(inflateEnd,"INEND")
+# pragma map(inflateSync,"INSY")
+# pragma map(inflateSetDictionary,"INSEDI")
+# pragma map(compressBound,"CMBND")
+# pragma map(inflate_table,"INTABL")
+# pragma map(inflate_fast,"INFA")
+# pragma map(inflate_copyright,"INCOPY")
+#endif
+
+#endif /* ZCONF_H */
diff --git a/sysroot/usr/include/zlib.h b/sysroot/usr/include/zlib.h
new file mode 100644
index 0000000..bb164c0
--- /dev/null
+++ b/sysroot/usr/include/zlib.h
@@ -0,0 +1,1399 @@
+/* zlib.h -- interface of the 'zlib' general purpose compression library
+ version 1.2.3.3, October 2nd, 2006
+
+ Copyright (C) 1995-2006 Jean-loup Gailly and Mark Adler
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+ Jean-loup Gailly Mark Adler
+ jloup@gzip.org madler@alumni.caltech.edu
+
+
+ The data format used by the zlib library is described by RFCs (Request for
+ Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt
+ (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
+*/
+
+#ifndef ZLIB_H
+#define ZLIB_H
+
+#include "zconf.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define ZLIB_VERSION "1.2.3.3"
+#define ZLIB_VERNUM 0x1233
+#define ZLIB_VER_MAJOR 1
+#define ZLIB_VER_MINOR 2
+#define ZLIB_VER_REVISION 3
+
+/*
+ The 'zlib' compression library provides in-memory compression and
+ decompression functions, including integrity checks of the uncompressed
+ data. This version of the library supports only one compression method
+ (deflation) but other algorithms will be added later and will have the same
+ stream interface.
+
+ Compression can be done in a single step if the buffers are large
+ enough (for example if an input file is mmap'ed), or can be done by
+ repeated calls of the compression function. In the latter case, the
+ application must provide more input and/or consume the output
+ (providing more output space) before each call.
+
+ The compressed data format used by default by the in-memory functions is
+ the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped
+ around a deflate stream, which is itself documented in RFC 1951.
+
+ The library also supports reading and writing files in gzip (.gz) format
+ with an interface similar to that of stdio using the functions that start
+ with "gz". The gzip format is different from the zlib format. gzip is a
+ gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.
+
+ This library can optionally read and write gzip streams in memory as well.
+
+ The zlib format was designed to be compact and fast for use in memory
+ and on communications channels. The gzip format was designed for single-
+ file compression on file systems, has a larger header than zlib to maintain
+ directory information, and uses a different, slower check method than zlib.
+
+ The library does not install any signal handler. The decoder checks
+ the consistency of the compressed data, so the library should never
+ crash even in case of corrupted input.
+*/
+
+typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
+typedef void (*free_func) OF((voidpf opaque, voidpf address));
+
+struct internal_state;
+
+typedef struct z_stream_s {
+ Bytef *next_in; /* next input byte */
+ uInt avail_in; /* number of bytes available at next_in */
+ uLong total_in; /* total nb of input bytes read so far */
+
+ Bytef *next_out; /* next output byte should be put there */
+ uInt avail_out; /* remaining free space at next_out */
+ uLong total_out; /* total nb of bytes output so far */
+
+ char *msg; /* last error message, NULL if no error */
+ struct internal_state FAR *state; /* not visible by applications */
+
+ alloc_func zalloc; /* used to allocate the internal state */
+ free_func zfree; /* used to free the internal state */
+ voidpf opaque; /* private data object passed to zalloc and zfree */
+
+ int data_type; /* best guess about the data type: binary or text */
+ uLong adler; /* adler32 value of the uncompressed data */
+ uLong reserved; /* reserved for future use */
+} z_stream;
+
+typedef z_stream FAR *z_streamp;
+
+/*
+ gzip header information passed to and from zlib routines. See RFC 1952
+ for more details on the meanings of these fields.
+*/
+typedef struct gz_header_s {
+ int text; /* true if compressed data believed to be text */
+ uLong time; /* modification time */
+ int xflags; /* extra flags (not used when writing a gzip file) */
+ int os; /* operating system */
+ Bytef *extra; /* pointer to extra field or Z_NULL if none */
+ uInt extra_len; /* extra field length (valid if extra != Z_NULL) */
+ uInt extra_max; /* space at extra (only when reading header) */
+ Bytef *name; /* pointer to zero-terminated file name or Z_NULL */
+ uInt name_max; /* space at name (only when reading header) */
+ Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */
+ uInt comm_max; /* space at comment (only when reading header) */
+ int hcrc; /* true if there was or will be a header crc */
+ int done; /* true when done reading gzip header (not used
+ when writing a gzip file) */
+} gz_header;
+
+typedef gz_header FAR *gz_headerp;
+
+/*
+ The application must update next_in and avail_in when avail_in has
+ dropped to zero. It must update next_out and avail_out when avail_out
+ has dropped to zero. The application must initialize zalloc, zfree and
+ opaque before calling the init function. All other fields are set by the
+ compression library and must not be updated by the application.
+
+ The opaque value provided by the application will be passed as the first
+ parameter for calls of zalloc and zfree. This can be useful for custom
+ memory management. The compression library attaches no meaning to the
+ opaque value.
+
+ zalloc must return Z_NULL if there is not enough memory for the object.
+ If zlib is used in a multi-threaded application, zalloc and zfree must be
+ thread safe.
+
+ On 16-bit systems, the functions zalloc and zfree must be able to allocate
+ exactly 65536 bytes, but will not be required to allocate more than this
+ if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS,
+ pointers returned by zalloc for objects of exactly 65536 bytes *must*
+ have their offset normalized to zero. The default allocation function
+ provided by this library ensures this (see zutil.c). To reduce memory
+ requirements and avoid any allocation of 64K objects, at the expense of
+ compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h).
+
+ The fields total_in and total_out can be used for statistics or
+ progress reports. After compression, total_in holds the total size of
+ the uncompressed data and may be saved for use in the decompressor
+ (particularly if the decompressor wants to decompress everything in
+ a single step).
+*/
+
+ /* constants */
+
+#define Z_NO_FLUSH 0
+#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */
+#define Z_SYNC_FLUSH 2
+#define Z_FULL_FLUSH 3
+#define Z_FINISH 4
+#define Z_BLOCK 5
+/* Allowed flush values; see deflate() and inflate() below for details */
+
+#define Z_OK 0
+#define Z_STREAM_END 1
+#define Z_NEED_DICT 2
+#define Z_ERRNO (-1)
+#define Z_STREAM_ERROR (-2)
+#define Z_DATA_ERROR (-3)
+#define Z_MEM_ERROR (-4)
+#define Z_BUF_ERROR (-5)
+#define Z_VERSION_ERROR (-6)
+/* Return codes for the compression/decompression functions. Negative
+ * values are errors, positive values are used for special but normal events.
+ */
+
+#define Z_NO_COMPRESSION 0
+#define Z_BEST_SPEED 1
+#define Z_BEST_COMPRESSION 9
+#define Z_DEFAULT_COMPRESSION (-1)
+/* compression levels */
+
+#define Z_FILTERED 1
+#define Z_HUFFMAN_ONLY 2
+#define Z_RLE 3
+#define Z_FIXED 4
+#define Z_DEFAULT_STRATEGY 0
+/* compression strategy; see deflateInit2() below for details */
+
+#define Z_BINARY 0
+#define Z_TEXT 1
+#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */
+#define Z_UNKNOWN 2
+/* Possible values of the data_type field (though see inflate()) */
+
+#define Z_DEFLATED 8
+/* The deflate compression method (the only one supported in this version) */
+
+#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */
+
+#define zlib_version zlibVersion()
+/* for compatibility with versions < 1.0.2 */
+
+ /* basic functions */
+
+ZEXTERN const char * ZEXPORT zlibVersion OF((void));
+/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
+ If the first character differs, the library code actually used is
+ not compatible with the zlib.h header file used by the application.
+ This check is automatically made by deflateInit and inflateInit.
+ */
+
+/*
+ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
+
+ Initializes the internal stream state for compression. The fields
+ zalloc, zfree and opaque must be initialized before by the caller.
+ If zalloc and zfree are set to Z_NULL, deflateInit updates them to
+ use default allocation functions.
+
+ The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
+ 1 gives best speed, 9 gives best compression, 0 gives no compression at
+ all (the input data is simply copied a block at a time).
+ Z_DEFAULT_COMPRESSION requests a default compromise between speed and
+ compression (currently equivalent to level 6).
+
+ deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_STREAM_ERROR if level is not a valid compression level,
+ Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
+ with the version assumed by the caller (ZLIB_VERSION).
+ msg is set to null if there is no error message. deflateInit does not
+ perform any compression: this will be done by deflate().
+*/
+
+
+ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
+/*
+ deflate compresses as much data as possible, and stops when the input
+ buffer becomes empty or the output buffer becomes full. It may introduce some
+ output latency (reading input without producing any output) except when
+ forced to flush.
+
+ The detailed semantics are as follows. deflate performs one or both of the
+ following actions:
+
+ - Compress more input starting at next_in and update next_in and avail_in
+ accordingly. If not all input can be processed (because there is not
+ enough room in the output buffer), next_in and avail_in are updated and
+ processing will resume at this point for the next call of deflate().
+
+ - Provide more output starting at next_out and update next_out and avail_out
+ accordingly. This action is forced if the parameter flush is non zero.
+ Forcing flush frequently degrades the compression ratio, so this parameter
+ should be set only when necessary (in interactive applications).
+ Some output may be provided even if flush is not set.
+
+ Before the call of deflate(), the application should ensure that at least
+ one of the actions is possible, by providing more input and/or consuming
+ more output, and updating avail_in or avail_out accordingly; avail_out
+ should never be zero before the call. The application can consume the
+ compressed output when it wants, for example when the output buffer is full
+ (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK
+ and with zero avail_out, it must be called again after making room in the
+ output buffer because there might be more output pending.
+
+ Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to
+ decide how much data to accumualte before producing output, in order to
+ maximize compression.
+
+ If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
+ flushed to the output buffer and the output is aligned on a byte boundary, so
+ that the decompressor can get all input data available so far. (In particular
+ avail_in is zero after the call if enough output space has been provided
+ before the call.) Flushing may degrade compression for some compression
+ algorithms and so it should be used only when necessary.
+
+ If flush is set to Z_FULL_FLUSH, all output is flushed as with
+ Z_SYNC_FLUSH, and the compression state is reset so that decompression can
+ restart from this point if previous compressed data has been damaged or if
+ random access is desired. Using Z_FULL_FLUSH too often can seriously degrade
+ compression.
+
+ If deflate returns with avail_out == 0, this function must be called again
+ with the same value of the flush parameter and more output space (updated
+ avail_out), until the flush is complete (deflate returns with non-zero
+ avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that
+ avail_out is greater than six to avoid repeated flush markers due to
+ avail_out == 0 on return.
+
+ If the parameter flush is set to Z_FINISH, pending input is processed,
+ pending output is flushed and deflate returns with Z_STREAM_END if there
+ was enough output space; if deflate returns with Z_OK, this function must be
+ called again with Z_FINISH and more output space (updated avail_out) but no
+ more input data, until it returns with Z_STREAM_END or an error. After
+ deflate has returned Z_STREAM_END, the only possible operations on the
+ stream are deflateReset or deflateEnd.
+
+ Z_FINISH can be used immediately after deflateInit if all the compression
+ is to be done in a single step. In this case, avail_out must be at least
+ the value returned by deflateBound (see below). If deflate does not return
+ Z_STREAM_END, then it must be called again as described above.
+
+ deflate() sets strm->adler to the adler32 checksum of all input read
+ so far (that is, total_in bytes).
+
+ deflate() may update strm->data_type if it can make a good guess about
+ the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered
+ binary. This field is only for information purposes and does not affect
+ the compression algorithm in any manner.
+
+ deflate() returns Z_OK if some progress has been made (more input
+ processed or more output produced), Z_STREAM_END if all input has been
+ consumed and all output has been produced (only when flush is set to
+ Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
+ if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible
+ (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not
+ fatal, and deflate() can be called again with more input and more output
+ space to continue compressing.
+*/
+
+
+ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
+/*
+ All dynamically allocated data structures for this stream are freed.
+ This function discards any unprocessed input and does not flush any
+ pending output.
+
+ deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
+ stream state was inconsistent, Z_DATA_ERROR if the stream was freed
+ prematurely (some input or output was discarded). In the error case,
+ msg may be set but then points to a static string (which must not be
+ deallocated).
+*/
+
+
+/*
+ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
+
+ Initializes the internal stream state for decompression. The fields
+ next_in, avail_in, zalloc, zfree and opaque must be initialized before by
+ the caller. If next_in is not Z_NULL and avail_in is large enough (the exact
+ value depends on the compression method), inflateInit determines the
+ compression method from the zlib header and allocates all data structures
+ accordingly; otherwise the allocation will be deferred to the first call of
+ inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to
+ use default allocation functions.
+
+ inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
+ version assumed by the caller, or Z_STREAM_ERROR if the parameters are
+ invalid, such as a null pointer to the structure. msg is set to null if
+ there is no error message. inflateInit does not perform any decompression
+ apart from possibly reading the zlib header if present: actual decompression
+ will be done by inflate(). (So next_in and avail_in may be modified, but
+ next_out and avail_out are unused and unchanged.) The current
+ implementation of inflateInit() does not process any header information --
+ that is deferred until inflate() is called.
+*/
+
+
+ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
+/*
+ inflate decompresses as much data as possible, and stops when the input
+ buffer becomes empty or the output buffer becomes full. It may introduce
+ some output latency (reading input without producing any output) except when
+ forced to flush.
+
+ The detailed semantics are as follows. inflate performs one or both of the
+ following actions:
+
+ - Decompress more input starting at next_in and update next_in and avail_in
+ accordingly. If not all input can be processed (because there is not
+ enough room in the output buffer), next_in is updated and processing
+ will resume at this point for the next call of inflate().
+
+ - Provide more output starting at next_out and update next_out and avail_out
+ accordingly. inflate() provides as much output as possible, until there
+ is no more input data or no more space in the output buffer (see below
+ about the flush parameter).
+
+ Before the call of inflate(), the application should ensure that at least
+ one of the actions is possible, by providing more input and/or consuming
+ more output, and updating the next_* and avail_* values accordingly.
+ The application can consume the uncompressed output when it wants, for
+ example when the output buffer is full (avail_out == 0), or after each
+ call of inflate(). If inflate returns Z_OK and with zero avail_out, it
+ must be called again after making room in the output buffer because there
+ might be more output pending.
+
+ The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH,
+ Z_FINISH, or Z_BLOCK. Z_SYNC_FLUSH requests that inflate() flush as much
+ output as possible to the output buffer. Z_BLOCK requests that inflate() stop
+ if and when it gets to the next deflate block boundary. When decoding the
+ zlib or gzip format, this will cause inflate() to return immediately after
+ the header and before the first block. When doing a raw inflate, inflate()
+ will go ahead and process the first block, and will return when it gets to
+ the end of that block, or when it runs out of data.
+
+ The Z_BLOCK option assists in appending to or combining deflate streams.
+ Also to assist in this, on return inflate() will set strm->data_type to the
+ number of unused bits in the last byte taken from strm->next_in, plus 64
+ if inflate() is currently decoding the last block in the deflate stream,
+ plus 128 if inflate() returned immediately after decoding an end-of-block
+ code or decoding the complete header up to just before the first byte of the
+ deflate stream. The end-of-block will not be indicated until all of the
+ uncompressed data from that block has been written to strm->next_out. The
+ number of unused bits may in general be greater than seven, except when
+ bit 7 of data_type is set, in which case the number of unused bits will be
+ less than eight.
+
+ inflate() should normally be called until it returns Z_STREAM_END or an
+ error. However if all decompression is to be performed in a single step
+ (a single call of inflate), the parameter flush should be set to
+ Z_FINISH. In this case all pending input is processed and all pending
+ output is flushed; avail_out must be large enough to hold all the
+ uncompressed data. (The size of the uncompressed data may have been saved
+ by the compressor for this purpose.) The next operation on this stream must
+ be inflateEnd to deallocate the decompression state. The use of Z_FINISH
+ is never required, but can be used to inform inflate that a faster approach
+ may be used for the single inflate() call.
+
+ In this implementation, inflate() always flushes as much output as
+ possible to the output buffer, and always uses the faster approach on the
+ first call. So the only effect of the flush parameter in this implementation
+ is on the return value of inflate(), as noted below, or when it returns early
+ because Z_BLOCK is used.
+
+ If a preset dictionary is needed after this call (see inflateSetDictionary
+ below), inflate sets strm->adler to the adler32 checksum of the dictionary
+ chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
+ strm->adler to the adler32 checksum of all output produced so far (that is,
+ total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
+ below. At the end of the stream, inflate() checks that its computed adler32
+ checksum is equal to that saved by the compressor and returns Z_STREAM_END
+ only if the checksum is correct.
+
+ inflate() will decompress and check either zlib-wrapped or gzip-wrapped
+ deflate data. The header type is detected automatically. Any information
+ contained in the gzip header is not retained, so applications that need that
+ information should instead use raw inflate, see inflateInit2() below, or
+ inflateBack() and perform their own processing of the gzip header and
+ trailer.
+
+ inflate() returns Z_OK if some progress has been made (more input processed
+ or more output produced), Z_STREAM_END if the end of the compressed data has
+ been reached and all uncompressed output has been produced, Z_NEED_DICT if a
+ preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
+ corrupted (input stream not conforming to the zlib format or incorrect check
+ value), Z_STREAM_ERROR if the stream structure was inconsistent (for example
+ if next_in or next_out was NULL), Z_MEM_ERROR if there was not enough memory,
+ Z_BUF_ERROR if no progress is possible or if there was not enough room in the
+ output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and
+ inflate() can be called again with more input and more output space to
+ continue decompressing. If Z_DATA_ERROR is returned, the application may then
+ call inflateSync() to look for a good compression block if a partial recovery
+ of the data is desired.
+*/
+
+
+ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
+/*
+ All dynamically allocated data structures for this stream are freed.
+ This function discards any unprocessed input and does not flush any
+ pending output.
+
+ inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
+ was inconsistent. In the error case, msg may be set but then points to a
+ static string (which must not be deallocated).
+*/
+
+ /* Advanced functions */
+
+/*
+ The following functions are needed only in some special applications.
+*/
+
+/*
+ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
+ int level,
+ int method,
+ int windowBits,
+ int memLevel,
+ int strategy));
+
+ This is another version of deflateInit with more compression options. The
+ fields next_in, zalloc, zfree and opaque must be initialized before by
+ the caller.
+
+ The method parameter is the compression method. It must be Z_DEFLATED in
+ this version of the library.
+
+ The windowBits parameter is the base two logarithm of the window size
+ (the size of the history buffer). It should be in the range 8..15 for this
+ version of the library. Larger values of this parameter result in better
+ compression at the expense of memory usage. The default value is 15 if
+ deflateInit is used instead.
+
+ windowBits can also be -8..-15 for raw deflate. In this case, -windowBits
+ determines the window size. deflate() will then generate raw deflate data
+ with no zlib header or trailer, and will not compute an adler32 check value.
+
+ windowBits can also be greater than 15 for optional gzip encoding. Add
+ 16 to windowBits to write a simple gzip header and trailer around the
+ compressed data instead of a zlib wrapper. The gzip header will have no
+ file name, no extra data, no comment, no modification time (set to zero),
+ no header crc, and the operating system will be set to 255 (unknown). If a
+ gzip stream is being written, strm->adler is a crc32 instead of an adler32.
+
+ The memLevel parameter specifies how much memory should be allocated
+ for the internal compression state. memLevel=1 uses minimum memory but
+ is slow and reduces compression ratio; memLevel=9 uses maximum memory
+ for optimal speed. The default value is 8. See zconf.h for total memory
+ usage as a function of windowBits and memLevel.
+
+ The strategy parameter is used to tune the compression algorithm. Use the
+ value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
+ filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no
+ string match), or Z_RLE to limit match distances to one (run-length
+ encoding). Filtered data consists mostly of small values with a somewhat
+ random distribution. In this case, the compression algorithm is tuned to
+ compress them better. The effect of Z_FILTERED is to force more Huffman
+ coding and less string matching; it is somewhat intermediate between
+ Z_DEFAULT and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as fast as
+ Z_HUFFMAN_ONLY, but give better compression for PNG image data. The strategy
+ parameter only affects the compression ratio but not the correctness of the
+ compressed output even if it is not set appropriately. Z_FIXED prevents the
+ use of dynamic Huffman codes, allowing for a simpler decoder for special
+ applications.
+
+ deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid
+ method). msg is set to null if there is no error message. deflateInit2 does
+ not perform any compression: this will be done by deflate().
+*/
+
+ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
+ const Bytef *dictionary,
+ uInt dictLength));
+/*
+ Initializes the compression dictionary from the given byte sequence
+ without producing any compressed output. This function must be called
+ immediately after deflateInit, deflateInit2 or deflateReset, before any
+ call of deflate. The compressor and decompressor must use exactly the same
+ dictionary (see inflateSetDictionary).
+
+ The dictionary should consist of strings (byte sequences) that are likely
+ to be encountered later in the data to be compressed, with the most commonly
+ used strings preferably put towards the end of the dictionary. Using a
+ dictionary is most useful when the data to be compressed is short and can be
+ predicted with good accuracy; the data can then be compressed better than
+ with the default empty dictionary.
+
+ Depending on the size of the compression data structures selected by
+ deflateInit or deflateInit2, a part of the dictionary may in effect be
+ discarded, for example if the dictionary is larger than the window size in
+ deflate or deflate2. Thus the strings most likely to be useful should be
+ put at the end of the dictionary, not at the front. In addition, the
+ current implementation of deflate will use at most the window size minus
+ 262 bytes of the provided dictionary.
+
+ Upon return of this function, strm->adler is set to the adler32 value
+ of the dictionary; the decompressor may later use this value to determine
+ which dictionary has been used by the compressor. (The adler32 value
+ applies to the whole dictionary even if only a subset of the dictionary is
+ actually used by the compressor.) If a raw deflate was requested, then the
+ adler32 value is not computed and strm->adler is not set.
+
+ deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
+ parameter is invalid (such as NULL dictionary) or the stream state is
+ inconsistent (for example if deflate has already been called for this stream
+ or if the compression method is bsort). deflateSetDictionary does not
+ perform any compression: this will be done by deflate().
+*/
+
+ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
+ z_streamp source));
+/*
+ Sets the destination stream as a complete copy of the source stream.
+
+ This function can be useful when several compression strategies will be
+ tried, for example when there are several ways of pre-processing the input
+ data with a filter. The streams that will be discarded should then be freed
+ by calling deflateEnd. Note that deflateCopy duplicates the internal
+ compression state which can be quite large, so this strategy is slow and
+ can consume lots of memory.
+
+ deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
+ (such as zalloc being NULL). msg is left unchanged in both source and
+ destination.
+*/
+
+ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
+/*
+ This function is equivalent to deflateEnd followed by deflateInit,
+ but does not free and reallocate all the internal compression state.
+ The stream will keep the same compression level and any other attributes
+ that may have been set by deflateInit2.
+
+ deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent (such as zalloc or state being NULL).
+*/
+
+ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
+ int level,
+ int strategy));
+/*
+ Dynamically update the compression level and compression strategy. The
+ interpretation of level and strategy is as in deflateInit2. This can be
+ used to switch between compression and straight copy of the input data, or
+ to switch to a different kind of input data requiring a different
+ strategy. If the compression level is changed, the input available so far
+ is compressed with the old level (and may be flushed); the new level will
+ take effect only at the next call of deflate().
+
+ Before the call of deflateParams, the stream state must be set as for
+ a call of deflate(), since the currently available input may have to
+ be compressed and flushed. In particular, strm->avail_out must be non-zero.
+
+ deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
+ stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR
+ if strm->avail_out was zero.
+*/
+
+ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm,
+ int good_length,
+ int max_lazy,
+ int nice_length,
+ int max_chain));
+/*
+ Fine tune deflate's internal compression parameters. This should only be
+ used by someone who understands the algorithm used by zlib's deflate for
+ searching for the best matching string, and even then only by the most
+ fanatic optimizer trying to squeeze out the last compressed bit for their
+ specific input data. Read the deflate.c source code for the meaning of the
+ max_lazy, good_length, nice_length, and max_chain parameters.
+
+ deflateTune() can be called after deflateInit() or deflateInit2(), and
+ returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream.
+ */
+
+ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
+ uLong sourceLen));
+/*
+ deflateBound() returns an upper bound on the compressed size after
+ deflation of sourceLen bytes. It must be called after deflateInit() or
+ deflateInit2(), and after deflateSetHeader(), if used. This would be used
+ to allocate an output buffer for deflation in a single pass, and so would be
+ called before deflate().
+*/
+
+ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
+ int bits,
+ int value));
+/*
+ deflatePrime() inserts bits in the deflate output stream. The intent
+ is that this function is used to start off the deflate output with the
+ bits leftover from a previous deflate stream when appending to it. As such,
+ this function can only be used for raw deflate, and must be used before the
+ first deflate() call after a deflateInit2() or deflateReset(). bits must be
+ less than or equal to 16, and that many of the least significant bits of
+ value will be inserted in the output.
+
+ deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent.
+*/
+
+ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
+ gz_headerp head));
+/*
+ deflateSetHeader() provides gzip header information for when a gzip
+ stream is requested by deflateInit2(). deflateSetHeader() may be called
+ after deflateInit2() or deflateReset() and before the first call of
+ deflate(). The text, time, os, extra field, name, and comment information
+ in the provided gz_header structure are written to the gzip header (xflag is
+ ignored -- the extra flags are set according to the compression level). The
+ caller must assure that, if not Z_NULL, name and comment are terminated with
+ a zero byte, and that if extra is not Z_NULL, that extra_len bytes are
+ available there. If hcrc is true, a gzip header crc is included. Note that
+ the current versions of the command-line version of gzip (up through version
+ 1.3.x) do not support header crc's, and will report that it is a "multi-part
+ gzip file" and give up.
+
+ If deflateSetHeader is not used, the default gzip header has text false,
+ the time set to zero, and os set to 255, with no extra, name, or comment
+ fields. The gzip header is returned to the default state by deflateReset().
+
+ deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent.
+*/
+
+/*
+ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
+ int windowBits));
+
+ This is another version of inflateInit with an extra parameter. The
+ fields next_in, avail_in, zalloc, zfree and opaque must be initialized
+ before by the caller.
+
+ The windowBits parameter is the base two logarithm of the maximum window
+ size (the size of the history buffer). It should be in the range 8..15 for
+ this version of the library. The default value is 15 if inflateInit is used
+ instead. windowBits must be greater than or equal to the windowBits value
+ provided to deflateInit2() while compressing, or it must be equal to 15 if
+ deflateInit2() was not used. If a compressed stream with a larger window
+ size is given as input, inflate() will return with the error code
+ Z_DATA_ERROR instead of trying to allocate a larger window.
+
+ windowBits can also be -8..-15 for raw inflate. In this case, -windowBits
+ determines the window size. inflate() will then process raw deflate data,
+ not looking for a zlib or gzip header, not generating a check value, and not
+ looking for any check values for comparison at the end of the stream. This
+ is for use with other formats that use the deflate compressed data format
+ such as zip. Those formats provide their own check values. If a custom
+ format is developed using the raw deflate format for compressed data, it is
+ recommended that a check value such as an adler32 or a crc32 be applied to
+ the uncompressed data as is done in the zlib, gzip, and zip formats. For
+ most applications, the zlib format should be used as is. Note that comments
+ above on the use in deflateInit2() applies to the magnitude of windowBits.
+
+ windowBits can also be greater than 15 for optional gzip decoding. Add
+ 32 to windowBits to enable zlib and gzip decoding with automatic header
+ detection, or add 16 to decode only the gzip format (the zlib format will
+ return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is
+ a crc32 instead of an adler32.
+
+ inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
+ version assumed by the caller, or Z_STREAM_ERROR if the parameters are
+ invalid, such as a null pointer to the structure. msg is set to null if
+ there is no error message. inflateInit2 does not perform any decompression
+ apart from possibly reading the zlib header if present: actual decompression
+ will be done by inflate(). (So next_in and avail_in may be modified, but
+ next_out and avail_out are unused and unchanged.) The current
+ implementation of inflateInit2() does not process any header information --
+ that is deferred until inflate() is called.
+*/
+
+ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
+ const Bytef *dictionary,
+ uInt dictLength));
+/*
+ Initializes the decompression dictionary from the given uncompressed byte
+ sequence. This function must be called immediately after a call of inflate,
+ if that call returned Z_NEED_DICT. The dictionary chosen by the compressor
+ can be determined from the adler32 value returned by that call of inflate.
+ The compressor and decompressor must use exactly the same dictionary (see
+ deflateSetDictionary). For raw inflate, this function can be called
+ immediately after inflateInit2() or inflateReset() and before any call of
+ inflate() to set the dictionary. The application must insure that the
+ dictionary that was used for compression is provided.
+
+ inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
+ parameter is invalid (such as NULL dictionary) or the stream state is
+ inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
+ expected one (incorrect adler32 value). inflateSetDictionary does not
+ perform any decompression: this will be done by subsequent calls of
+ inflate().
+*/
+
+ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
+/*
+ Skips invalid compressed data until a full flush point (see above the
+ description of deflate with Z_FULL_FLUSH) can be found, or until all
+ available input is skipped. No output is provided.
+
+ inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR
+ if no more input was provided, Z_DATA_ERROR if no flush point has been found,
+ or Z_STREAM_ERROR if the stream structure was inconsistent. In the success
+ case, the application may save the current current value of total_in which
+ indicates where valid compressed data was found. In the error case, the
+ application may repeatedly call inflateSync, providing more input each time,
+ until success or end of the input data.
+*/
+
+ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
+ z_streamp source));
+/*
+ Sets the destination stream as a complete copy of the source stream.
+
+ This function can be useful when randomly accessing a large stream. The
+ first pass through the stream can periodically record the inflate state,
+ allowing restarting inflate at those points when randomly accessing the
+ stream.
+
+ inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
+ (such as zalloc being NULL). msg is left unchanged in both source and
+ destination.
+*/
+
+ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
+/*
+ This function is equivalent to inflateEnd followed by inflateInit,
+ but does not free and reallocate all the internal decompression state.
+ The stream will keep attributes that may have been set by inflateInit2.
+
+ inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent (such as zalloc or state being NULL).
+*/
+
+ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
+ int bits,
+ int value));
+/*
+ This function inserts bits in the inflate input stream. The intent is
+ that this function is used to start inflating at a bit position in the
+ middle of a byte. The provided bits will be used before any bytes are used
+ from next_in. This function should only be used with raw inflate, and
+ should be used before the first inflate() call after inflateInit2() or
+ inflateReset(). bits must be less than or equal to 16, and that many of the
+ least significant bits of value will be inserted in the input.
+
+ inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent.
+*/
+
+ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
+ gz_headerp head));
+/*
+ inflateGetHeader() requests that gzip header information be stored in the
+ provided gz_header structure. inflateGetHeader() may be called after
+ inflateInit2() or inflateReset(), and before the first call of inflate().
+ As inflate() processes the gzip stream, head->done is zero until the header
+ is completed, at which time head->done is set to one. If a zlib stream is
+ being decoded, then head->done is set to -1 to indicate that there will be
+ no gzip header information forthcoming. Note that Z_BLOCK can be used to
+ force inflate() to return immediately after header processing is complete
+ and before any actual data is decompressed.
+
+ The text, time, xflags, and os fields are filled in with the gzip header
+ contents. hcrc is set to true if there is a header CRC. (The header CRC
+ was valid if done is set to one.) If extra is not Z_NULL, then extra_max
+ contains the maximum number of bytes to write to extra. Once done is true,
+ extra_len contains the actual extra field length, and extra contains the
+ extra field, or that field truncated if extra_max is less than extra_len.
+ If name is not Z_NULL, then up to name_max characters are written there,
+ terminated with a zero unless the length is greater than name_max. If
+ comment is not Z_NULL, then up to comm_max characters are written there,
+ terminated with a zero unless the length is greater than comm_max. When
+ any of extra, name, or comment are not Z_NULL and the respective field is
+ not present in the header, then that field is set to Z_NULL to signal its
+ absence. This allows the use of deflateSetHeader() with the returned
+ structure to duplicate the header. However if those fields are set to
+ allocated memory, then the application will need to save those pointers
+ elsewhere so that they can be eventually freed.
+
+ If inflateGetHeader is not used, then the header information is simply
+ discarded. The header is always checked for validity, including the header
+ CRC if present. inflateReset() will reset the process to discard the header
+ information. The application would need to call inflateGetHeader() again to
+ retrieve the header from the next gzip stream.
+
+ inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent.
+*/
+
+/*
+ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
+ unsigned char FAR *window));
+
+ Initialize the internal stream state for decompression using inflateBack()
+ calls. The fields zalloc, zfree and opaque in strm must be initialized
+ before the call. If zalloc and zfree are Z_NULL, then the default library-
+ derived memory allocation routines are used. windowBits is the base two
+ logarithm of the window size, in the range 8..15. window is a caller
+ supplied buffer of that size. Except for special applications where it is
+ assured that deflate was used with small window sizes, windowBits must be 15
+ and a 32K byte window must be supplied to be able to decompress general
+ deflate streams.
+
+ See inflateBack() for the usage of these routines.
+
+ inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
+ the paramaters are invalid, Z_MEM_ERROR if the internal state could not
+ be allocated, or Z_VERSION_ERROR if the version of the library does not
+ match the version of the header file.
+*/
+
+typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *));
+typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
+
+ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
+ in_func in, void FAR *in_desc,
+ out_func out, void FAR *out_desc));
+/*
+ inflateBack() does a raw inflate with a single call using a call-back
+ interface for input and output. This is more efficient than inflate() for
+ file i/o applications in that it avoids copying between the output and the
+ sliding window by simply making the window itself the output buffer. This
+ function trusts the application to not change the output buffer passed by
+ the output function, at least until inflateBack() returns.
+
+ inflateBackInit() must be called first to allocate the internal state
+ and to initialize the state with the user-provided window buffer.
+ inflateBack() may then be used multiple times to inflate a complete, raw
+ deflate stream with each call. inflateBackEnd() is then called to free
+ the allocated state.
+
+ A raw deflate stream is one with no zlib or gzip header or trailer.
+ This routine would normally be used in a utility that reads zip or gzip
+ files and writes out uncompressed files. The utility would decode the
+ header and process the trailer on its own, hence this routine expects
+ only the raw deflate stream to decompress. This is different from the
+ normal behavior of inflate(), which expects either a zlib or gzip header and
+ trailer around the deflate stream.
+
+ inflateBack() uses two subroutines supplied by the caller that are then
+ called by inflateBack() for input and output. inflateBack() calls those
+ routines until it reads a complete deflate stream and writes out all of the
+ uncompressed data, or until it encounters an error. The function's
+ parameters and return types are defined above in the in_func and out_func
+ typedefs. inflateBack() will call in(in_desc, &buf) which should return the
+ number of bytes of provided input, and a pointer to that input in buf. If
+ there is no input available, in() must return zero--buf is ignored in that
+ case--and inflateBack() will return a buffer error. inflateBack() will call
+ out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out()
+ should return zero on success, or non-zero on failure. If out() returns
+ non-zero, inflateBack() will return with an error. Neither in() nor out()
+ are permitted to change the contents of the window provided to
+ inflateBackInit(), which is also the buffer that out() uses to write from.
+ The length written by out() will be at most the window size. Any non-zero
+ amount of input may be provided by in().
+
+ For convenience, inflateBack() can be provided input on the first call by
+ setting strm->next_in and strm->avail_in. If that input is exhausted, then
+ in() will be called. Therefore strm->next_in must be initialized before
+ calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called
+ immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in
+ must also be initialized, and then if strm->avail_in is not zero, input will
+ initially be taken from strm->next_in[0 .. strm->avail_in - 1].
+
+ The in_desc and out_desc parameters of inflateBack() is passed as the
+ first parameter of in() and out() respectively when they are called. These
+ descriptors can be optionally used to pass any information that the caller-
+ supplied in() and out() functions need to do their job.
+
+ On return, inflateBack() will set strm->next_in and strm->avail_in to
+ pass back any unused input that was provided by the last in() call. The
+ return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR
+ if in() or out() returned an error, Z_DATA_ERROR if there was a format
+ error in the deflate stream (in which case strm->msg is set to indicate the
+ nature of the error), or Z_STREAM_ERROR if the stream was not properly
+ initialized. In the case of Z_BUF_ERROR, an input or output error can be
+ distinguished using strm->next_in which will be Z_NULL only if in() returned
+ an error. If strm->next is not Z_NULL, then the Z_BUF_ERROR was due to
+ out() returning non-zero. (in() will always be called before out(), so
+ strm->next_in is assured to be defined if out() returns non-zero.) Note
+ that inflateBack() cannot return Z_OK.
+*/
+
+ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm));
+/*
+ All memory allocated by inflateBackInit() is freed.
+
+ inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream
+ state was inconsistent.
+*/
+
+ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
+/* Return flags indicating compile-time options.
+
+ Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other:
+ 1.0: size of uInt
+ 3.2: size of uLong
+ 5.4: size of voidpf (pointer)
+ 7.6: size of z_off_t
+
+ Compiler, assembler, and debug options:
+ 8: DEBUG
+ 9: ASMV or ASMINF -- use ASM code
+ 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention
+ 11: 0 (reserved)
+
+ One-time table building (smaller code, but not thread-safe if true):
+ 12: BUILDFIXED -- build static block decoding tables when needed
+ 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed
+ 14,15: 0 (reserved)
+
+ Library content (indicates missing functionality):
+ 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking
+ deflate code when not needed)
+ 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect
+ and decode gzip streams (to avoid linking crc code)
+ 18-19: 0 (reserved)
+
+ Operation variations (changes in library functionality):
+ 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate
+ 21: FASTEST -- deflate algorithm with only one, lowest compression level
+ 22,23: 0 (reserved)
+
+ The sprintf variant used by gzprintf (zero is best):
+ 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format
+ 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure!
+ 26: 0 = returns value, 1 = void -- 1 means inferred string length returned
+
+ Remainder:
+ 27-31: 0 (reserved)
+ */
+
+
+ /* utility functions */
+
+/*
+ The following utility functions are implemented on top of the
+ basic stream-oriented functions. To simplify the interface, some
+ default options are assumed (compression level and memory usage,
+ standard memory allocation functions). The source code of these
+ utility functions can easily be modified if you need special options.
+*/
+
+ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen));
+/*
+ Compresses the source buffer into the destination buffer. sourceLen is
+ the byte length of the source buffer. Upon entry, destLen is the total
+ size of the destination buffer, which must be at least the value returned
+ by compressBound(sourceLen). Upon exit, destLen is the actual size of the
+ compressed buffer.
+ This function can be used to compress a whole file at once if the
+ input file is mmap'ed.
+ compress returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_BUF_ERROR if there was not enough room in the output
+ buffer.
+*/
+
+ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen,
+ int level));
+/*
+ Compresses the source buffer into the destination buffer. The level
+ parameter has the same meaning as in deflateInit. sourceLen is the byte
+ length of the source buffer. Upon entry, destLen is the total size of the
+ destination buffer, which must be at least the value returned by
+ compressBound(sourceLen). Upon exit, destLen is the actual size of the
+ compressed buffer.
+
+ compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_BUF_ERROR if there was not enough room in the output buffer,
+ Z_STREAM_ERROR if the level parameter is invalid.
+*/
+
+ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen));
+/*
+ compressBound() returns an upper bound on the compressed size after
+ compress() or compress2() on sourceLen bytes. It would be used before
+ a compress() or compress2() call to allocate the destination buffer.
+*/
+
+ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen));
+/*
+ Decompresses the source buffer into the destination buffer. sourceLen is
+ the byte length of the source buffer. Upon entry, destLen is the total
+ size of the destination buffer, which must be large enough to hold the
+ entire uncompressed data. (The size of the uncompressed data must have
+ been saved previously by the compressor and transmitted to the decompressor
+ by some mechanism outside the scope of this compression library.)
+ Upon exit, destLen is the actual size of the compressed buffer.
+ This function can be used to decompress a whole file at once if the
+ input file is mmap'ed.
+
+ uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_BUF_ERROR if there was not enough room in the output
+ buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete.
+*/
+
+
+typedef voidp gzFile;
+
+/*
+ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
+
+ Opens a gzip (.gz) file for reading or writing. The mode parameter
+ is as in fopen ("rb" or "wb") but can also include a compression level
+ ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for
+ Huffman only compression as in "wb1h", or 'R' for run-length encoding
+ as in "wb1R". (See the description of deflateInit2 for more information
+ about the strategy parameter.)
+
+ gzopen can be used to read a file which is not in gzip format; in this
+ case gzread will directly read from the file without decompression.
+
+ gzopen returns NULL if the file could not be opened or if there was
+ insufficient memory to allocate the (de)compression state; errno
+ can be checked to distinguish the two cases (if errno is zero, the
+ zlib error is Z_MEM_ERROR). */
+
+ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
+/*
+ gzdopen() associates a gzFile with the file descriptor fd. File
+ descriptors are obtained from calls like open, dup, creat, pipe or
+ fileno (in the file has been previously opened with fopen).
+ The mode parameter is as in gzopen.
+ The next call of gzclose on the returned gzFile will also close the
+ file descriptor fd, just like fclose(fdopen(fd), mode) closes the file
+ descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode).
+ gzdopen returns NULL if there was insufficient memory to allocate
+ the (de)compression state.
+*/
+
+ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
+/*
+ Dynamically update the compression level or strategy. See the description
+ of deflateInit2 for the meaning of these parameters.
+ gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
+ opened for writing.
+*/
+
+ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
+/*
+ Reads the given number of uncompressed bytes from the compressed file.
+ If the input file was not in gzip format, gzread copies the given number
+ of bytes into the buffer.
+ gzread returns the number of uncompressed bytes actually read (0 for
+ end of file, -1 for error). */
+
+ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
+ voidpc buf, unsigned len));
+/*
+ Writes the given number of uncompressed bytes into the compressed file.
+ gzwrite returns the number of uncompressed bytes actually written
+ (0 in case of error).
+*/
+
+ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));
+/*
+ Converts, formats, and writes the args to the compressed file under
+ control of the format string, as in fprintf. gzprintf returns the number of
+ uncompressed bytes actually written (0 in case of error). The number of
+ uncompressed bytes written is limited to 4095. The caller should assure that
+ this limit is not exceeded. If it is exceeded, then gzprintf() will return
+ return an error (0) with nothing written. In this case, there may also be a
+ buffer overflow with unpredictable consequences, which is possible only if
+ zlib was compiled with the insecure functions sprintf() or vsprintf()
+ because the secure snprintf() or vsnprintf() functions were not available.
+*/
+
+ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
+/*
+ Writes the given null-terminated string to the compressed file, excluding
+ the terminating null character.
+ gzputs returns the number of characters written, or -1 in case of error.
+*/
+
+ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
+/*
+ Reads bytes from the compressed file until len-1 characters are read, or
+ a newline character is read and transferred to buf, or an end-of-file
+ condition is encountered. The string is then terminated with a null
+ character.
+ gzgets returns buf, or Z_NULL in case of error.
+*/
+
+ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
+/*
+ Writes c, converted to an unsigned char, into the compressed file.
+ gzputc returns the value that was written, or -1 in case of error.
+*/
+
+ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
+/*
+ Reads one byte from the compressed file. gzgetc returns this byte
+ or -1 in case of end of file or error.
+*/
+
+ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
+/*
+ Push one character back onto the stream to be read again later.
+ Only one character of push-back is allowed. gzungetc() returns the
+ character pushed, or -1 on failure. gzungetc() will fail if a
+ character has been pushed but not read yet, or if c is -1. The pushed
+ character will be discarded if the stream is repositioned with gzseek()
+ or gzrewind().
+*/
+
+ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
+/*
+ Flushes all pending output into the compressed file. The parameter
+ flush is as in the deflate() function. The return value is the zlib
+ error number (see function gzerror below). gzflush returns Z_OK if
+ the flush parameter is Z_FINISH and all output could be flushed.
+ gzflush should be called only when strictly necessary because it can
+ degrade compression.
+*/
+
+/*
+ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
+ z_off_t offset, int whence));
+
+ Sets the starting position for the next gzread or gzwrite on the
+ given compressed file. The offset represents a number of bytes in the
+ uncompressed data stream. The whence parameter is defined as in lseek(2);
+ the value SEEK_END is not supported.
+ If the file is opened for reading, this function is emulated but can be
+ extremely slow. If the file is opened for writing, only forward seeks are
+ supported; gzseek then compresses a sequence of zeroes up to the new
+ starting position.
+
+ gzseek returns the resulting offset location as measured in bytes from
+ the beginning of the uncompressed stream, or -1 in case of error, in
+ particular if the file is opened for writing and the new starting position
+ would be before the current position.
+*/
+
+ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
+/*
+ Rewinds the given file. This function is supported only for reading.
+
+ gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
+*/
+
+/*
+ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
+
+ Returns the starting position for the next gzread or gzwrite on the
+ given compressed file. This position represents a number of bytes in the
+ uncompressed data stream.
+
+ gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
+*/
+
+ZEXTERN int ZEXPORT gzeof OF((gzFile file));
+/*
+ Returns 1 when EOF has previously been detected reading the given
+ input stream, otherwise zero.
+*/
+
+ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
+/*
+ Returns 1 if file is being read directly without decompression, otherwise
+ zero.
+*/
+
+ZEXTERN int ZEXPORT gzclose OF((gzFile file));
+/*
+ Flushes all pending output if necessary, closes the compressed file
+ and deallocates all the (de)compression state. The return value is the zlib
+ error number. Note that once file is close, you cannot call gzerror with
+ file, since its structures have been deallocated.
+*/
+
+ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
+/*
+ Returns the error message for the last error which occurred on the
+ given compressed file. errnum is set to zlib error number. If an
+ error occurred in the file system and not in the compression library,
+ errnum is set to Z_ERRNO and the application may consult errno
+ to get the exact error code.
+
+ The application must not modify the returned string and future calls to
+ this function may invalidate the returned string.
+*/
+
+ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
+/*
+ Clears the error and end-of-file flags for file. This is analogous to the
+ clearerr() function in stdio. This is useful for continuing to read a gzip
+ file that is being written concurrently.
+*/
+
+ /* checksum functions */
+
+/*
+ These functions are not related to compression but are exported
+ anyway because they might be useful in applications using the
+ compression library.
+*/
+
+ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
+/*
+ Update a running Adler-32 checksum with the bytes buf[0..len-1] and
+ return the updated checksum. If buf is NULL, this function returns
+ the required initial value for the checksum.
+ An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
+ much faster. Usage example:
+
+ uLong adler = adler32(0L, Z_NULL, 0);
+
+ while (read_buffer(buffer, length) != EOF) {
+ adler = adler32(adler, buffer, length);
+ }
+ if (adler != original_adler) error();
+*/
+
+/*
+ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
+ z_off_t len2));
+
+ Combine two Adler-32 checksums into one. For two sequences of bytes, seq1
+ and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for
+ each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of
+ seq1 and seq2 concatenated, requiring only adler1, adler2, and len2.
+*/
+
+ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
+/*
+ Update a running CRC-32 with the bytes buf[0..len-1] and return the
+ updated CRC-32. If buf is NULL, this function returns the required initial
+ value for the for the crc. Pre- and post-conditioning (one's complement) is
+ performed within this function so it shouldn't be done by the application.
+ Usage example:
+
+ uLong crc = crc32(0L, Z_NULL, 0);
+
+ while (read_buffer(buffer, length) != EOF) {
+ crc = crc32(crc, buffer, length);
+ }
+ if (crc != original_crc) error();
+*/
+
+/*
+ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
+
+ Combine two CRC-32 check values into one. For two sequences of bytes,
+ seq1 and seq2 with lengths len1 and len2, CRC-32 check values were
+ calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32
+ check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and
+ len2.
+*/
+
+
+ /* various hacks, don't look :) */
+
+/* deflateInit and inflateInit are macros to allow checking the zlib version
+ * and the compiler's view of z_stream:
+ */
+ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
+ const char *version, int stream_size));
+ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
+ const char *version, int stream_size));
+ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method,
+ int windowBits, int memLevel,
+ int strategy, const char *version,
+ int stream_size));
+ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
+ const char *version, int stream_size));
+ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
+ unsigned char FAR *window,
+ const char *version,
+ int stream_size));
+#define deflateInit(strm, level) \
+ deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream))
+#define inflateInit(strm) \
+ inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream))
+#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
+ deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
+ (strategy), ZLIB_VERSION, sizeof(z_stream))
+#define inflateInit2(strm, windowBits) \
+ inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
+#define inflateBackInit(strm, windowBits, window) \
+ inflateBackInit_((strm), (windowBits), (window), \
+ ZLIB_VERSION, sizeof(z_stream))
+
+#ifdef _LARGEFILE64_SOURCE
+ ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
+ ZEXTERN off64_t ZEXPORT gzseek64 OF((gzFile, off64_t, int));
+ ZEXTERN off64_t ZEXPORT gztell64 OF((gzFile));
+ ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, off64_t));
+ ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, off64_t));
+#endif
+
+#if _FILE_OFFSET_BITS == 64
+# define gzopen gzopen64
+# define gzseek gzseek64
+# define gztell gztell64
+# define adler32_combine adler32_combine64
+# define crc32_combine crc32_combine64
+#else
+ ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
+ ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int));
+ ZEXTERN z_off_t ZEXPORT gztell OF((gzFile));
+ ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
+ ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
+#endif
+
+#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL)
+ struct internal_state {int dummy;}; /* hack for buggy compilers */
+#endif
+
+ZEXTERN const char * ZEXPORT zError OF((int));
+ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp));
+ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void));
+ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ZLIB_H */
diff --git a/sysroot/usr/include/zlibdefs.h b/sysroot/usr/include/zlibdefs.h
new file mode 100644
index 0000000..80d6e81
--- /dev/null
+++ b/sysroot/usr/include/zlibdefs.h
@@ -0,0 +1,13 @@
+/* zlibdefs.h -- compile-time definitions for the zlib compression library
+ * Copyright (C) 1995-2006 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include <sys/types.h> /* for off_t */
+#include <unistd.h> /* for SEEK_* and off_t */
+#ifdef VMS
+# include <unixio.h> /* for off_t */
+#endif
+#ifndef z_off_t
+# define z_off_t off_t
+#endif
diff --git a/sysroot/usr/lib/Mcrt1.o b/sysroot/usr/lib/Mcrt1.o
new file mode 100644
index 0000000..7879614
--- /dev/null
+++ b/sysroot/usr/lib/Mcrt1.o
Binary files differ
diff --git a/sysroot/usr/lib/Scrt1.o b/sysroot/usr/lib/Scrt1.o
new file mode 100644
index 0000000..653f085
--- /dev/null
+++ b/sysroot/usr/lib/Scrt1.o
Binary files differ
diff --git a/sysroot/usr/lib/crt1.o b/sysroot/usr/lib/crt1.o
new file mode 100644
index 0000000..d3d25a4
--- /dev/null
+++ b/sysroot/usr/lib/crt1.o
Binary files differ
diff --git a/sysroot/usr/lib/crti.o b/sysroot/usr/lib/crti.o
new file mode 100644
index 0000000..293cccb
--- /dev/null
+++ b/sysroot/usr/lib/crti.o
Binary files differ
diff --git a/sysroot/usr/lib/crtn.o b/sysroot/usr/lib/crtn.o
new file mode 100644
index 0000000..a1d773b
--- /dev/null
+++ b/sysroot/usr/lib/crtn.o
Binary files differ
diff --git a/sysroot/usr/lib/esound/libesddsp.so.0 b/sysroot/usr/lib/esound/libesddsp.so.0
new file mode 120000
index 0000000..ff7312f
--- /dev/null
+++ b/sysroot/usr/lib/esound/libesddsp.so.0
@@ -0,0 +1 @@
+libesddsp.so.0.2.38 \ No newline at end of file
diff --git a/sysroot/usr/lib/esound/libesddsp.so.0.2.38 b/sysroot/usr/lib/esound/libesddsp.so.0.2.38
new file mode 100644
index 0000000..8b2b311
--- /dev/null
+++ b/sysroot/usr/lib/esound/libesddsp.so.0.2.38
Binary files differ
diff --git a/sysroot/usr/lib/gconv/ANSI_X3.110.so b/sysroot/usr/lib/gconv/ANSI_X3.110.so
new file mode 100644
index 0000000..fba5e58
--- /dev/null
+++ b/sysroot/usr/lib/gconv/ANSI_X3.110.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/ARMSCII-8.so b/sysroot/usr/lib/gconv/ARMSCII-8.so
new file mode 100644
index 0000000..a0b084e
--- /dev/null
+++ b/sysroot/usr/lib/gconv/ARMSCII-8.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/ASMO_449.so b/sysroot/usr/lib/gconv/ASMO_449.so
new file mode 100644
index 0000000..9314bdf
--- /dev/null
+++ b/sysroot/usr/lib/gconv/ASMO_449.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/BIG5.so b/sysroot/usr/lib/gconv/BIG5.so
new file mode 100644
index 0000000..2edec4a
--- /dev/null
+++ b/sysroot/usr/lib/gconv/BIG5.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/BIG5HKSCS.so b/sysroot/usr/lib/gconv/BIG5HKSCS.so
new file mode 100644
index 0000000..5cc0792
--- /dev/null
+++ b/sysroot/usr/lib/gconv/BIG5HKSCS.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/BRF.so b/sysroot/usr/lib/gconv/BRF.so
new file mode 100644
index 0000000..1d830e4
--- /dev/null
+++ b/sysroot/usr/lib/gconv/BRF.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/CP10007.so b/sysroot/usr/lib/gconv/CP10007.so
new file mode 100644
index 0000000..2cfc9fb
--- /dev/null
+++ b/sysroot/usr/lib/gconv/CP10007.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/CP1125.so b/sysroot/usr/lib/gconv/CP1125.so
new file mode 100644
index 0000000..86767be
--- /dev/null
+++ b/sysroot/usr/lib/gconv/CP1125.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/CP1250.so b/sysroot/usr/lib/gconv/CP1250.so
new file mode 100644
index 0000000..467fee4
--- /dev/null
+++ b/sysroot/usr/lib/gconv/CP1250.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/CP1251.so b/sysroot/usr/lib/gconv/CP1251.so
new file mode 100644
index 0000000..85693d5
--- /dev/null
+++ b/sysroot/usr/lib/gconv/CP1251.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/CP1252.so b/sysroot/usr/lib/gconv/CP1252.so
new file mode 100644
index 0000000..a77a193
--- /dev/null
+++ b/sysroot/usr/lib/gconv/CP1252.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/CP1253.so b/sysroot/usr/lib/gconv/CP1253.so
new file mode 100644
index 0000000..3c7eb41
--- /dev/null
+++ b/sysroot/usr/lib/gconv/CP1253.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/CP1254.so b/sysroot/usr/lib/gconv/CP1254.so
new file mode 100644
index 0000000..c84e3a1
--- /dev/null
+++ b/sysroot/usr/lib/gconv/CP1254.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/CP1255.so b/sysroot/usr/lib/gconv/CP1255.so
new file mode 100644
index 0000000..546f27a
--- /dev/null
+++ b/sysroot/usr/lib/gconv/CP1255.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/CP1256.so b/sysroot/usr/lib/gconv/CP1256.so
new file mode 100644
index 0000000..43f2905
--- /dev/null
+++ b/sysroot/usr/lib/gconv/CP1256.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/CP1257.so b/sysroot/usr/lib/gconv/CP1257.so
new file mode 100644
index 0000000..8291a0b
--- /dev/null
+++ b/sysroot/usr/lib/gconv/CP1257.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/CP1258.so b/sysroot/usr/lib/gconv/CP1258.so
new file mode 100644
index 0000000..a66743b
--- /dev/null
+++ b/sysroot/usr/lib/gconv/CP1258.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/CP737.so b/sysroot/usr/lib/gconv/CP737.so
new file mode 100644
index 0000000..bdaadd0
--- /dev/null
+++ b/sysroot/usr/lib/gconv/CP737.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/CP775.so b/sysroot/usr/lib/gconv/CP775.so
new file mode 100644
index 0000000..846939f
--- /dev/null
+++ b/sysroot/usr/lib/gconv/CP775.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/CP932.so b/sysroot/usr/lib/gconv/CP932.so
new file mode 100644
index 0000000..5ea9b3e
--- /dev/null
+++ b/sysroot/usr/lib/gconv/CP932.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/CSN_369103.so b/sysroot/usr/lib/gconv/CSN_369103.so
new file mode 100644
index 0000000..89f7ef1
--- /dev/null
+++ b/sysroot/usr/lib/gconv/CSN_369103.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/CWI.so b/sysroot/usr/lib/gconv/CWI.so
new file mode 100644
index 0000000..9421cfa
--- /dev/null
+++ b/sysroot/usr/lib/gconv/CWI.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/DEC-MCS.so b/sysroot/usr/lib/gconv/DEC-MCS.so
new file mode 100644
index 0000000..0016c69
--- /dev/null
+++ b/sysroot/usr/lib/gconv/DEC-MCS.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/EBCDIC-AT-DE-A.so b/sysroot/usr/lib/gconv/EBCDIC-AT-DE-A.so
new file mode 100644
index 0000000..d4c2f8c
--- /dev/null
+++ b/sysroot/usr/lib/gconv/EBCDIC-AT-DE-A.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/EBCDIC-AT-DE.so b/sysroot/usr/lib/gconv/EBCDIC-AT-DE.so
new file mode 100644
index 0000000..2ba023a
--- /dev/null
+++ b/sysroot/usr/lib/gconv/EBCDIC-AT-DE.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/EBCDIC-CA-FR.so b/sysroot/usr/lib/gconv/EBCDIC-CA-FR.so
new file mode 100644
index 0000000..c3e1fb7
--- /dev/null
+++ b/sysroot/usr/lib/gconv/EBCDIC-CA-FR.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/EBCDIC-DK-NO-A.so b/sysroot/usr/lib/gconv/EBCDIC-DK-NO-A.so
new file mode 100644
index 0000000..4682fab
--- /dev/null
+++ b/sysroot/usr/lib/gconv/EBCDIC-DK-NO-A.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/EBCDIC-DK-NO.so b/sysroot/usr/lib/gconv/EBCDIC-DK-NO.so
new file mode 100644
index 0000000..fbe2dfa
--- /dev/null
+++ b/sysroot/usr/lib/gconv/EBCDIC-DK-NO.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/EBCDIC-ES-A.so b/sysroot/usr/lib/gconv/EBCDIC-ES-A.so
new file mode 100644
index 0000000..cc0e4c7
--- /dev/null
+++ b/sysroot/usr/lib/gconv/EBCDIC-ES-A.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/EBCDIC-ES-S.so b/sysroot/usr/lib/gconv/EBCDIC-ES-S.so
new file mode 100644
index 0000000..f52ab85
--- /dev/null
+++ b/sysroot/usr/lib/gconv/EBCDIC-ES-S.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/EBCDIC-ES.so b/sysroot/usr/lib/gconv/EBCDIC-ES.so
new file mode 100644
index 0000000..522fed6
--- /dev/null
+++ b/sysroot/usr/lib/gconv/EBCDIC-ES.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/EBCDIC-FI-SE-A.so b/sysroot/usr/lib/gconv/EBCDIC-FI-SE-A.so
new file mode 100644
index 0000000..9f79c82
--- /dev/null
+++ b/sysroot/usr/lib/gconv/EBCDIC-FI-SE-A.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/EBCDIC-FI-SE.so b/sysroot/usr/lib/gconv/EBCDIC-FI-SE.so
new file mode 100644
index 0000000..312092b
--- /dev/null
+++ b/sysroot/usr/lib/gconv/EBCDIC-FI-SE.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/EBCDIC-FR.so b/sysroot/usr/lib/gconv/EBCDIC-FR.so
new file mode 100644
index 0000000..91579da
--- /dev/null
+++ b/sysroot/usr/lib/gconv/EBCDIC-FR.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/EBCDIC-IS-FRISS.so b/sysroot/usr/lib/gconv/EBCDIC-IS-FRISS.so
new file mode 100644
index 0000000..78fba47
--- /dev/null
+++ b/sysroot/usr/lib/gconv/EBCDIC-IS-FRISS.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/EBCDIC-IT.so b/sysroot/usr/lib/gconv/EBCDIC-IT.so
new file mode 100644
index 0000000..b528ded
--- /dev/null
+++ b/sysroot/usr/lib/gconv/EBCDIC-IT.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/EBCDIC-PT.so b/sysroot/usr/lib/gconv/EBCDIC-PT.so
new file mode 100644
index 0000000..bbd2c45
--- /dev/null
+++ b/sysroot/usr/lib/gconv/EBCDIC-PT.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/EBCDIC-UK.so b/sysroot/usr/lib/gconv/EBCDIC-UK.so
new file mode 100644
index 0000000..65c5ee0
--- /dev/null
+++ b/sysroot/usr/lib/gconv/EBCDIC-UK.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/EBCDIC-US.so b/sysroot/usr/lib/gconv/EBCDIC-US.so
new file mode 100644
index 0000000..d647a1f
--- /dev/null
+++ b/sysroot/usr/lib/gconv/EBCDIC-US.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/ECMA-CYRILLIC.so b/sysroot/usr/lib/gconv/ECMA-CYRILLIC.so
new file mode 100644
index 0000000..5eabf3f
--- /dev/null
+++ b/sysroot/usr/lib/gconv/ECMA-CYRILLIC.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/EUC-CN.so b/sysroot/usr/lib/gconv/EUC-CN.so
new file mode 100644
index 0000000..5524313
--- /dev/null
+++ b/sysroot/usr/lib/gconv/EUC-CN.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/EUC-JISX0213.so b/sysroot/usr/lib/gconv/EUC-JISX0213.so
new file mode 100644
index 0000000..e4ba0d5
--- /dev/null
+++ b/sysroot/usr/lib/gconv/EUC-JISX0213.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/EUC-JP-MS.so b/sysroot/usr/lib/gconv/EUC-JP-MS.so
new file mode 100644
index 0000000..fb11d81
--- /dev/null
+++ b/sysroot/usr/lib/gconv/EUC-JP-MS.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/EUC-JP.so b/sysroot/usr/lib/gconv/EUC-JP.so
new file mode 100644
index 0000000..efd0dd5
--- /dev/null
+++ b/sysroot/usr/lib/gconv/EUC-JP.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/EUC-KR.so b/sysroot/usr/lib/gconv/EUC-KR.so
new file mode 100644
index 0000000..7926b70
--- /dev/null
+++ b/sysroot/usr/lib/gconv/EUC-KR.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/EUC-TW.so b/sysroot/usr/lib/gconv/EUC-TW.so
new file mode 100644
index 0000000..caf80ff
--- /dev/null
+++ b/sysroot/usr/lib/gconv/EUC-TW.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/GB18030.so b/sysroot/usr/lib/gconv/GB18030.so
new file mode 100644
index 0000000..de04747
--- /dev/null
+++ b/sysroot/usr/lib/gconv/GB18030.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/GBBIG5.so b/sysroot/usr/lib/gconv/GBBIG5.so
new file mode 100644
index 0000000..ee7a23b
--- /dev/null
+++ b/sysroot/usr/lib/gconv/GBBIG5.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/GBGBK.so b/sysroot/usr/lib/gconv/GBGBK.so
new file mode 100644
index 0000000..d7db41b
--- /dev/null
+++ b/sysroot/usr/lib/gconv/GBGBK.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/GBK.so b/sysroot/usr/lib/gconv/GBK.so
new file mode 100644
index 0000000..edbbbad
--- /dev/null
+++ b/sysroot/usr/lib/gconv/GBK.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/GEORGIAN-ACADEMY.so b/sysroot/usr/lib/gconv/GEORGIAN-ACADEMY.so
new file mode 100644
index 0000000..e9ab9f0
--- /dev/null
+++ b/sysroot/usr/lib/gconv/GEORGIAN-ACADEMY.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/GEORGIAN-PS.so b/sysroot/usr/lib/gconv/GEORGIAN-PS.so
new file mode 100644
index 0000000..2f16017
--- /dev/null
+++ b/sysroot/usr/lib/gconv/GEORGIAN-PS.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/GOST_19768-74.so b/sysroot/usr/lib/gconv/GOST_19768-74.so
new file mode 100644
index 0000000..3cd0d6d
--- /dev/null
+++ b/sysroot/usr/lib/gconv/GOST_19768-74.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/GREEK-CCITT.so b/sysroot/usr/lib/gconv/GREEK-CCITT.so
new file mode 100644
index 0000000..5a2c527
--- /dev/null
+++ b/sysroot/usr/lib/gconv/GREEK-CCITT.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/GREEK7-OLD.so b/sysroot/usr/lib/gconv/GREEK7-OLD.so
new file mode 100644
index 0000000..7a2f171
--- /dev/null
+++ b/sysroot/usr/lib/gconv/GREEK7-OLD.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/GREEK7.so b/sysroot/usr/lib/gconv/GREEK7.so
new file mode 100644
index 0000000..1cae084
--- /dev/null
+++ b/sysroot/usr/lib/gconv/GREEK7.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/HP-ROMAN8.so b/sysroot/usr/lib/gconv/HP-ROMAN8.so
new file mode 100644
index 0000000..764ae36
--- /dev/null
+++ b/sysroot/usr/lib/gconv/HP-ROMAN8.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM037.so b/sysroot/usr/lib/gconv/IBM037.so
new file mode 100644
index 0000000..1e66288
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM037.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM038.so b/sysroot/usr/lib/gconv/IBM038.so
new file mode 100644
index 0000000..6c77f00
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM038.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1004.so b/sysroot/usr/lib/gconv/IBM1004.so
new file mode 100644
index 0000000..ce9e333
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1004.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1008.so b/sysroot/usr/lib/gconv/IBM1008.so
new file mode 100644
index 0000000..035fcbe
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1008.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1008_420.so b/sysroot/usr/lib/gconv/IBM1008_420.so
new file mode 100644
index 0000000..0c5148e
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1008_420.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1025.so b/sysroot/usr/lib/gconv/IBM1025.so
new file mode 100644
index 0000000..a8e4901
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1025.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1026.so b/sysroot/usr/lib/gconv/IBM1026.so
new file mode 100644
index 0000000..57f8c40
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1026.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1046.so b/sysroot/usr/lib/gconv/IBM1046.so
new file mode 100644
index 0000000..1db9412
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1046.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1047.so b/sysroot/usr/lib/gconv/IBM1047.so
new file mode 100644
index 0000000..3feb2c0
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1047.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1097.so b/sysroot/usr/lib/gconv/IBM1097.so
new file mode 100644
index 0000000..f86bf93
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1097.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1112.so b/sysroot/usr/lib/gconv/IBM1112.so
new file mode 100644
index 0000000..fa0cec6
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1112.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1122.so b/sysroot/usr/lib/gconv/IBM1122.so
new file mode 100644
index 0000000..0d9f5cb
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1122.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1123.so b/sysroot/usr/lib/gconv/IBM1123.so
new file mode 100644
index 0000000..663a4f1
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1123.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1124.so b/sysroot/usr/lib/gconv/IBM1124.so
new file mode 100644
index 0000000..6910662
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1124.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1129.so b/sysroot/usr/lib/gconv/IBM1129.so
new file mode 100644
index 0000000..ccfe2b8
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1129.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1130.so b/sysroot/usr/lib/gconv/IBM1130.so
new file mode 100644
index 0000000..13b3915
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1130.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1132.so b/sysroot/usr/lib/gconv/IBM1132.so
new file mode 100644
index 0000000..9fd96f9
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1132.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1133.so b/sysroot/usr/lib/gconv/IBM1133.so
new file mode 100644
index 0000000..ae9d278
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1133.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1137.so b/sysroot/usr/lib/gconv/IBM1137.so
new file mode 100644
index 0000000..4ba3d8e
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1137.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1140.so b/sysroot/usr/lib/gconv/IBM1140.so
new file mode 100644
index 0000000..c43ee28
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1140.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1141.so b/sysroot/usr/lib/gconv/IBM1141.so
new file mode 100644
index 0000000..13352da
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1141.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1142.so b/sysroot/usr/lib/gconv/IBM1142.so
new file mode 100644
index 0000000..94dd73b
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1142.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1143.so b/sysroot/usr/lib/gconv/IBM1143.so
new file mode 100644
index 0000000..9df2570
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1143.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1144.so b/sysroot/usr/lib/gconv/IBM1144.so
new file mode 100644
index 0000000..3ca3f7a
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1144.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1145.so b/sysroot/usr/lib/gconv/IBM1145.so
new file mode 100644
index 0000000..e967e34
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1145.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1146.so b/sysroot/usr/lib/gconv/IBM1146.so
new file mode 100644
index 0000000..340e346
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1146.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1147.so b/sysroot/usr/lib/gconv/IBM1147.so
new file mode 100644
index 0000000..1b484c5
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1147.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1148.so b/sysroot/usr/lib/gconv/IBM1148.so
new file mode 100644
index 0000000..a7ecb7f
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1148.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1149.so b/sysroot/usr/lib/gconv/IBM1149.so
new file mode 100644
index 0000000..068d0bf
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1149.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1153.so b/sysroot/usr/lib/gconv/IBM1153.so
new file mode 100644
index 0000000..e29a962
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1153.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1154.so b/sysroot/usr/lib/gconv/IBM1154.so
new file mode 100644
index 0000000..2954ba2
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1154.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1155.so b/sysroot/usr/lib/gconv/IBM1155.so
new file mode 100644
index 0000000..68dda4f
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1155.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1156.so b/sysroot/usr/lib/gconv/IBM1156.so
new file mode 100644
index 0000000..ab08363
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1156.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1157.so b/sysroot/usr/lib/gconv/IBM1157.so
new file mode 100644
index 0000000..5ad1b44
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1157.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1158.so b/sysroot/usr/lib/gconv/IBM1158.so
new file mode 100644
index 0000000..884c77e
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1158.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1160.so b/sysroot/usr/lib/gconv/IBM1160.so
new file mode 100644
index 0000000..cdd286a
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1160.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1161.so b/sysroot/usr/lib/gconv/IBM1161.so
new file mode 100644
index 0000000..f3d4b71
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1161.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1162.so b/sysroot/usr/lib/gconv/IBM1162.so
new file mode 100644
index 0000000..83665ec
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1162.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1163.so b/sysroot/usr/lib/gconv/IBM1163.so
new file mode 100644
index 0000000..bc80981
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1163.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1164.so b/sysroot/usr/lib/gconv/IBM1164.so
new file mode 100644
index 0000000..0123dcb
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1164.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1166.so b/sysroot/usr/lib/gconv/IBM1166.so
new file mode 100644
index 0000000..e3c02a4
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1166.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1167.so b/sysroot/usr/lib/gconv/IBM1167.so
new file mode 100644
index 0000000..7f2253b
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1167.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM12712.so b/sysroot/usr/lib/gconv/IBM12712.so
new file mode 100644
index 0000000..f06a4ab
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM12712.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1364.so b/sysroot/usr/lib/gconv/IBM1364.so
new file mode 100644
index 0000000..ae51980
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1364.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1371.so b/sysroot/usr/lib/gconv/IBM1371.so
new file mode 100644
index 0000000..cc3b936
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1371.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1388.so b/sysroot/usr/lib/gconv/IBM1388.so
new file mode 100644
index 0000000..9734466
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1388.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1390.so b/sysroot/usr/lib/gconv/IBM1390.so
new file mode 100644
index 0000000..39b7d4e
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1390.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM1399.so b/sysroot/usr/lib/gconv/IBM1399.so
new file mode 100644
index 0000000..dacd295
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM1399.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM16804.so b/sysroot/usr/lib/gconv/IBM16804.so
new file mode 100644
index 0000000..a97d5a9
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM16804.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM256.so b/sysroot/usr/lib/gconv/IBM256.so
new file mode 100644
index 0000000..099e775
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM256.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM273.so b/sysroot/usr/lib/gconv/IBM273.so
new file mode 100644
index 0000000..b10a8bc
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM273.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM274.so b/sysroot/usr/lib/gconv/IBM274.so
new file mode 100644
index 0000000..035adf2
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM274.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM275.so b/sysroot/usr/lib/gconv/IBM275.so
new file mode 100644
index 0000000..3932fbc
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM275.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM277.so b/sysroot/usr/lib/gconv/IBM277.so
new file mode 100644
index 0000000..3ba9fee
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM277.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM278.so b/sysroot/usr/lib/gconv/IBM278.so
new file mode 100644
index 0000000..de6d5c5
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM278.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM280.so b/sysroot/usr/lib/gconv/IBM280.so
new file mode 100644
index 0000000..28dc831
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM280.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM281.so b/sysroot/usr/lib/gconv/IBM281.so
new file mode 100644
index 0000000..c607d75
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM281.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM284.so b/sysroot/usr/lib/gconv/IBM284.so
new file mode 100644
index 0000000..cbc8eb4
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM284.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM285.so b/sysroot/usr/lib/gconv/IBM285.so
new file mode 100644
index 0000000..5413947
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM285.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM290.so b/sysroot/usr/lib/gconv/IBM290.so
new file mode 100644
index 0000000..9c0cfca
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM290.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM297.so b/sysroot/usr/lib/gconv/IBM297.so
new file mode 100644
index 0000000..ef5fd90
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM297.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM420.so b/sysroot/usr/lib/gconv/IBM420.so
new file mode 100644
index 0000000..b31b918
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM420.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM423.so b/sysroot/usr/lib/gconv/IBM423.so
new file mode 100644
index 0000000..80634ba
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM423.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM424.so b/sysroot/usr/lib/gconv/IBM424.so
new file mode 100644
index 0000000..027b638
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM424.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM437.so b/sysroot/usr/lib/gconv/IBM437.so
new file mode 100644
index 0000000..797ce94
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM437.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM4517.so b/sysroot/usr/lib/gconv/IBM4517.so
new file mode 100644
index 0000000..90e7de8
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM4517.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM4899.so b/sysroot/usr/lib/gconv/IBM4899.so
new file mode 100644
index 0000000..9f7aab8
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM4899.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM4909.so b/sysroot/usr/lib/gconv/IBM4909.so
new file mode 100644
index 0000000..cdc13d2
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM4909.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM4971.so b/sysroot/usr/lib/gconv/IBM4971.so
new file mode 100644
index 0000000..b287f3d
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM4971.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM500.so b/sysroot/usr/lib/gconv/IBM500.so
new file mode 100644
index 0000000..06cb9a1
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM500.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM5347.so b/sysroot/usr/lib/gconv/IBM5347.so
new file mode 100644
index 0000000..112f64a
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM5347.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM803.so b/sysroot/usr/lib/gconv/IBM803.so
new file mode 100644
index 0000000..a87c4d8
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM803.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM850.so b/sysroot/usr/lib/gconv/IBM850.so
new file mode 100644
index 0000000..20966ba
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM850.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM851.so b/sysroot/usr/lib/gconv/IBM851.so
new file mode 100644
index 0000000..693d707
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM851.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM852.so b/sysroot/usr/lib/gconv/IBM852.so
new file mode 100644
index 0000000..013a67f
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM852.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM855.so b/sysroot/usr/lib/gconv/IBM855.so
new file mode 100644
index 0000000..931824e
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM855.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM856.so b/sysroot/usr/lib/gconv/IBM856.so
new file mode 100644
index 0000000..a0e5535
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM856.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM857.so b/sysroot/usr/lib/gconv/IBM857.so
new file mode 100644
index 0000000..be91fe4
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM857.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM860.so b/sysroot/usr/lib/gconv/IBM860.so
new file mode 100644
index 0000000..4116ca4
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM860.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM861.so b/sysroot/usr/lib/gconv/IBM861.so
new file mode 100644
index 0000000..11f5583
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM861.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM862.so b/sysroot/usr/lib/gconv/IBM862.so
new file mode 100644
index 0000000..9412927
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM862.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM863.so b/sysroot/usr/lib/gconv/IBM863.so
new file mode 100644
index 0000000..f7404db
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM863.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM864.so b/sysroot/usr/lib/gconv/IBM864.so
new file mode 100644
index 0000000..169a014
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM864.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM865.so b/sysroot/usr/lib/gconv/IBM865.so
new file mode 100644
index 0000000..4114ac3
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM865.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM866.so b/sysroot/usr/lib/gconv/IBM866.so
new file mode 100644
index 0000000..6c67e97
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM866.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM866NAV.so b/sysroot/usr/lib/gconv/IBM866NAV.so
new file mode 100644
index 0000000..967199d
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM866NAV.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM868.so b/sysroot/usr/lib/gconv/IBM868.so
new file mode 100644
index 0000000..1f44c36
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM868.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM869.so b/sysroot/usr/lib/gconv/IBM869.so
new file mode 100644
index 0000000..cb5f993
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM869.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM870.so b/sysroot/usr/lib/gconv/IBM870.so
new file mode 100644
index 0000000..ebd8835
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM870.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM871.so b/sysroot/usr/lib/gconv/IBM871.so
new file mode 100644
index 0000000..338de37
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM871.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM874.so b/sysroot/usr/lib/gconv/IBM874.so
new file mode 100644
index 0000000..ce7de6b
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM874.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM875.so b/sysroot/usr/lib/gconv/IBM875.so
new file mode 100644
index 0000000..dbcd9e5
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM875.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM880.so b/sysroot/usr/lib/gconv/IBM880.so
new file mode 100644
index 0000000..9e62971
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM880.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM891.so b/sysroot/usr/lib/gconv/IBM891.so
new file mode 100644
index 0000000..e97a060
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM891.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM901.so b/sysroot/usr/lib/gconv/IBM901.so
new file mode 100644
index 0000000..af3a3c9
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM901.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM902.so b/sysroot/usr/lib/gconv/IBM902.so
new file mode 100644
index 0000000..c5d6382
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM902.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM903.so b/sysroot/usr/lib/gconv/IBM903.so
new file mode 100644
index 0000000..5c05637
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM903.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM9030.so b/sysroot/usr/lib/gconv/IBM9030.so
new file mode 100644
index 0000000..37cfb50
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM9030.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM904.so b/sysroot/usr/lib/gconv/IBM904.so
new file mode 100644
index 0000000..be1bb63
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM904.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM905.so b/sysroot/usr/lib/gconv/IBM905.so
new file mode 100644
index 0000000..392e56b
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM905.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM9066.so b/sysroot/usr/lib/gconv/IBM9066.so
new file mode 100644
index 0000000..1d5a14a
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM9066.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM918.so b/sysroot/usr/lib/gconv/IBM918.so
new file mode 100644
index 0000000..ed936ea
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM918.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM921.so b/sysroot/usr/lib/gconv/IBM921.so
new file mode 100644
index 0000000..fab7327
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM921.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM922.so b/sysroot/usr/lib/gconv/IBM922.so
new file mode 100644
index 0000000..c49cbdd
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM922.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM930.so b/sysroot/usr/lib/gconv/IBM930.so
new file mode 100644
index 0000000..3b93265
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM930.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM932.so b/sysroot/usr/lib/gconv/IBM932.so
new file mode 100644
index 0000000..8d819e5
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM932.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM933.so b/sysroot/usr/lib/gconv/IBM933.so
new file mode 100644
index 0000000..415663e
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM933.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM935.so b/sysroot/usr/lib/gconv/IBM935.so
new file mode 100644
index 0000000..3fd51a4
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM935.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM937.so b/sysroot/usr/lib/gconv/IBM937.so
new file mode 100644
index 0000000..ede88dc
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM937.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM939.so b/sysroot/usr/lib/gconv/IBM939.so
new file mode 100644
index 0000000..008fb68
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM939.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM943.so b/sysroot/usr/lib/gconv/IBM943.so
new file mode 100644
index 0000000..53e90d0
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM943.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IBM9448.so b/sysroot/usr/lib/gconv/IBM9448.so
new file mode 100644
index 0000000..0b00012
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IBM9448.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/IEC_P27-1.so b/sysroot/usr/lib/gconv/IEC_P27-1.so
new file mode 100644
index 0000000..5f40767
--- /dev/null
+++ b/sysroot/usr/lib/gconv/IEC_P27-1.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/INIS-8.so b/sysroot/usr/lib/gconv/INIS-8.so
new file mode 100644
index 0000000..74f4c72
--- /dev/null
+++ b/sysroot/usr/lib/gconv/INIS-8.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/INIS-CYRILLIC.so b/sysroot/usr/lib/gconv/INIS-CYRILLIC.so
new file mode 100644
index 0000000..7e50519
--- /dev/null
+++ b/sysroot/usr/lib/gconv/INIS-CYRILLIC.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/INIS.so b/sysroot/usr/lib/gconv/INIS.so
new file mode 100644
index 0000000..6c12d31
--- /dev/null
+++ b/sysroot/usr/lib/gconv/INIS.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/ISIRI-3342.so b/sysroot/usr/lib/gconv/ISIRI-3342.so
new file mode 100644
index 0000000..fc533e0
--- /dev/null
+++ b/sysroot/usr/lib/gconv/ISIRI-3342.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/ISO-2022-CN-EXT.so b/sysroot/usr/lib/gconv/ISO-2022-CN-EXT.so
new file mode 100644
index 0000000..c09c84c
--- /dev/null
+++ b/sysroot/usr/lib/gconv/ISO-2022-CN-EXT.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/ISO-2022-CN.so b/sysroot/usr/lib/gconv/ISO-2022-CN.so
new file mode 100644
index 0000000..e701916
--- /dev/null
+++ b/sysroot/usr/lib/gconv/ISO-2022-CN.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/ISO-2022-JP-3.so b/sysroot/usr/lib/gconv/ISO-2022-JP-3.so
new file mode 100644
index 0000000..1281291
--- /dev/null
+++ b/sysroot/usr/lib/gconv/ISO-2022-JP-3.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/ISO-2022-JP.so b/sysroot/usr/lib/gconv/ISO-2022-JP.so
new file mode 100644
index 0000000..0663019
--- /dev/null
+++ b/sysroot/usr/lib/gconv/ISO-2022-JP.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/ISO-2022-KR.so b/sysroot/usr/lib/gconv/ISO-2022-KR.so
new file mode 100644
index 0000000..aef37e5
--- /dev/null
+++ b/sysroot/usr/lib/gconv/ISO-2022-KR.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/ISO-IR-197.so b/sysroot/usr/lib/gconv/ISO-IR-197.so
new file mode 100644
index 0000000..1cbc632
--- /dev/null
+++ b/sysroot/usr/lib/gconv/ISO-IR-197.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/ISO-IR-209.so b/sysroot/usr/lib/gconv/ISO-IR-209.so
new file mode 100644
index 0000000..ae09688
--- /dev/null
+++ b/sysroot/usr/lib/gconv/ISO-IR-209.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/ISO646.so b/sysroot/usr/lib/gconv/ISO646.so
new file mode 100644
index 0000000..1884771
--- /dev/null
+++ b/sysroot/usr/lib/gconv/ISO646.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/ISO8859-1.so b/sysroot/usr/lib/gconv/ISO8859-1.so
new file mode 100644
index 0000000..eb005fd
--- /dev/null
+++ b/sysroot/usr/lib/gconv/ISO8859-1.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/ISO8859-10.so b/sysroot/usr/lib/gconv/ISO8859-10.so
new file mode 100644
index 0000000..e343dfd
--- /dev/null
+++ b/sysroot/usr/lib/gconv/ISO8859-10.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/ISO8859-11.so b/sysroot/usr/lib/gconv/ISO8859-11.so
new file mode 100644
index 0000000..c80fab9
--- /dev/null
+++ b/sysroot/usr/lib/gconv/ISO8859-11.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/ISO8859-13.so b/sysroot/usr/lib/gconv/ISO8859-13.so
new file mode 100644
index 0000000..2a39410
--- /dev/null
+++ b/sysroot/usr/lib/gconv/ISO8859-13.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/ISO8859-14.so b/sysroot/usr/lib/gconv/ISO8859-14.so
new file mode 100644
index 0000000..2c6d086
--- /dev/null
+++ b/sysroot/usr/lib/gconv/ISO8859-14.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/ISO8859-15.so b/sysroot/usr/lib/gconv/ISO8859-15.so
new file mode 100644
index 0000000..6ffc302
--- /dev/null
+++ b/sysroot/usr/lib/gconv/ISO8859-15.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/ISO8859-16.so b/sysroot/usr/lib/gconv/ISO8859-16.so
new file mode 100644
index 0000000..f7204bd
--- /dev/null
+++ b/sysroot/usr/lib/gconv/ISO8859-16.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/ISO8859-2.so b/sysroot/usr/lib/gconv/ISO8859-2.so
new file mode 100644
index 0000000..b838098
--- /dev/null
+++ b/sysroot/usr/lib/gconv/ISO8859-2.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/ISO8859-3.so b/sysroot/usr/lib/gconv/ISO8859-3.so
new file mode 100644
index 0000000..d3c2ee6
--- /dev/null
+++ b/sysroot/usr/lib/gconv/ISO8859-3.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/ISO8859-4.so b/sysroot/usr/lib/gconv/ISO8859-4.so
new file mode 100644
index 0000000..3d36bee
--- /dev/null
+++ b/sysroot/usr/lib/gconv/ISO8859-4.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/ISO8859-5.so b/sysroot/usr/lib/gconv/ISO8859-5.so
new file mode 100644
index 0000000..706b766
--- /dev/null
+++ b/sysroot/usr/lib/gconv/ISO8859-5.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/ISO8859-6.so b/sysroot/usr/lib/gconv/ISO8859-6.so
new file mode 100644
index 0000000..1c08aec
--- /dev/null
+++ b/sysroot/usr/lib/gconv/ISO8859-6.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/ISO8859-7.so b/sysroot/usr/lib/gconv/ISO8859-7.so
new file mode 100644
index 0000000..c7649b6
--- /dev/null
+++ b/sysroot/usr/lib/gconv/ISO8859-7.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/ISO8859-8.so b/sysroot/usr/lib/gconv/ISO8859-8.so
new file mode 100644
index 0000000..17510ce
--- /dev/null
+++ b/sysroot/usr/lib/gconv/ISO8859-8.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/ISO8859-9.so b/sysroot/usr/lib/gconv/ISO8859-9.so
new file mode 100644
index 0000000..4b9a58b
--- /dev/null
+++ b/sysroot/usr/lib/gconv/ISO8859-9.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/ISO8859-9E.so b/sysroot/usr/lib/gconv/ISO8859-9E.so
new file mode 100644
index 0000000..a787317
--- /dev/null
+++ b/sysroot/usr/lib/gconv/ISO8859-9E.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/ISO_10367-BOX.so b/sysroot/usr/lib/gconv/ISO_10367-BOX.so
new file mode 100644
index 0000000..2fad92f
--- /dev/null
+++ b/sysroot/usr/lib/gconv/ISO_10367-BOX.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/ISO_11548-1.so b/sysroot/usr/lib/gconv/ISO_11548-1.so
new file mode 100644
index 0000000..80017ca
--- /dev/null
+++ b/sysroot/usr/lib/gconv/ISO_11548-1.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/ISO_2033.so b/sysroot/usr/lib/gconv/ISO_2033.so
new file mode 100644
index 0000000..157562d
--- /dev/null
+++ b/sysroot/usr/lib/gconv/ISO_2033.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/ISO_5427-EXT.so b/sysroot/usr/lib/gconv/ISO_5427-EXT.so
new file mode 100644
index 0000000..9cf25d8
--- /dev/null
+++ b/sysroot/usr/lib/gconv/ISO_5427-EXT.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/ISO_5427.so b/sysroot/usr/lib/gconv/ISO_5427.so
new file mode 100644
index 0000000..5c7a296
--- /dev/null
+++ b/sysroot/usr/lib/gconv/ISO_5427.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/ISO_5428.so b/sysroot/usr/lib/gconv/ISO_5428.so
new file mode 100644
index 0000000..36edc0f
--- /dev/null
+++ b/sysroot/usr/lib/gconv/ISO_5428.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/ISO_6937-2.so b/sysroot/usr/lib/gconv/ISO_6937-2.so
new file mode 100644
index 0000000..7df1888
--- /dev/null
+++ b/sysroot/usr/lib/gconv/ISO_6937-2.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/ISO_6937.so b/sysroot/usr/lib/gconv/ISO_6937.so
new file mode 100644
index 0000000..6d2948f
--- /dev/null
+++ b/sysroot/usr/lib/gconv/ISO_6937.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/JOHAB.so b/sysroot/usr/lib/gconv/JOHAB.so
new file mode 100644
index 0000000..0b05751
--- /dev/null
+++ b/sysroot/usr/lib/gconv/JOHAB.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/KOI-8.so b/sysroot/usr/lib/gconv/KOI-8.so
new file mode 100644
index 0000000..b9b89ad
--- /dev/null
+++ b/sysroot/usr/lib/gconv/KOI-8.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/KOI8-R.so b/sysroot/usr/lib/gconv/KOI8-R.so
new file mode 100644
index 0000000..615d5f6
--- /dev/null
+++ b/sysroot/usr/lib/gconv/KOI8-R.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/KOI8-RU.so b/sysroot/usr/lib/gconv/KOI8-RU.so
new file mode 100644
index 0000000..7a98aad
--- /dev/null
+++ b/sysroot/usr/lib/gconv/KOI8-RU.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/KOI8-T.so b/sysroot/usr/lib/gconv/KOI8-T.so
new file mode 100644
index 0000000..273ffda
--- /dev/null
+++ b/sysroot/usr/lib/gconv/KOI8-T.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/KOI8-U.so b/sysroot/usr/lib/gconv/KOI8-U.so
new file mode 100644
index 0000000..1c0a7eb
--- /dev/null
+++ b/sysroot/usr/lib/gconv/KOI8-U.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/LATIN-GREEK-1.so b/sysroot/usr/lib/gconv/LATIN-GREEK-1.so
new file mode 100644
index 0000000..e9270c5
--- /dev/null
+++ b/sysroot/usr/lib/gconv/LATIN-GREEK-1.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/LATIN-GREEK.so b/sysroot/usr/lib/gconv/LATIN-GREEK.so
new file mode 100644
index 0000000..af28de6
--- /dev/null
+++ b/sysroot/usr/lib/gconv/LATIN-GREEK.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/MAC-CENTRALEUROPE.so b/sysroot/usr/lib/gconv/MAC-CENTRALEUROPE.so
new file mode 100644
index 0000000..3ac4340
--- /dev/null
+++ b/sysroot/usr/lib/gconv/MAC-CENTRALEUROPE.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/MAC-IS.so b/sysroot/usr/lib/gconv/MAC-IS.so
new file mode 100644
index 0000000..8d5869e
--- /dev/null
+++ b/sysroot/usr/lib/gconv/MAC-IS.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/MAC-SAMI.so b/sysroot/usr/lib/gconv/MAC-SAMI.so
new file mode 100644
index 0000000..3a76930
--- /dev/null
+++ b/sysroot/usr/lib/gconv/MAC-SAMI.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/MAC-UK.so b/sysroot/usr/lib/gconv/MAC-UK.so
new file mode 100644
index 0000000..94125b4
--- /dev/null
+++ b/sysroot/usr/lib/gconv/MAC-UK.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/MACINTOSH.so b/sysroot/usr/lib/gconv/MACINTOSH.so
new file mode 100644
index 0000000..2c0a29d
--- /dev/null
+++ b/sysroot/usr/lib/gconv/MACINTOSH.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/MIK.so b/sysroot/usr/lib/gconv/MIK.so
new file mode 100644
index 0000000..a56e796
--- /dev/null
+++ b/sysroot/usr/lib/gconv/MIK.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/NATS-DANO.so b/sysroot/usr/lib/gconv/NATS-DANO.so
new file mode 100644
index 0000000..9358d25
--- /dev/null
+++ b/sysroot/usr/lib/gconv/NATS-DANO.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/NATS-SEFI.so b/sysroot/usr/lib/gconv/NATS-SEFI.so
new file mode 100644
index 0000000..f4be436
--- /dev/null
+++ b/sysroot/usr/lib/gconv/NATS-SEFI.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/PT154.so b/sysroot/usr/lib/gconv/PT154.so
new file mode 100644
index 0000000..2cc59b5
--- /dev/null
+++ b/sysroot/usr/lib/gconv/PT154.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/RK1048.so b/sysroot/usr/lib/gconv/RK1048.so
new file mode 100644
index 0000000..39abedd
--- /dev/null
+++ b/sysroot/usr/lib/gconv/RK1048.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/SAMI-WS2.so b/sysroot/usr/lib/gconv/SAMI-WS2.so
new file mode 100644
index 0000000..8bc24bc
--- /dev/null
+++ b/sysroot/usr/lib/gconv/SAMI-WS2.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/SHIFT_JISX0213.so b/sysroot/usr/lib/gconv/SHIFT_JISX0213.so
new file mode 100644
index 0000000..dd87643
--- /dev/null
+++ b/sysroot/usr/lib/gconv/SHIFT_JISX0213.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/SJIS.so b/sysroot/usr/lib/gconv/SJIS.so
new file mode 100644
index 0000000..9032412
--- /dev/null
+++ b/sysroot/usr/lib/gconv/SJIS.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/T.61.so b/sysroot/usr/lib/gconv/T.61.so
new file mode 100644
index 0000000..90bf7b4
--- /dev/null
+++ b/sysroot/usr/lib/gconv/T.61.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/TCVN5712-1.so b/sysroot/usr/lib/gconv/TCVN5712-1.so
new file mode 100644
index 0000000..1a9cce8
--- /dev/null
+++ b/sysroot/usr/lib/gconv/TCVN5712-1.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/TIS-620.so b/sysroot/usr/lib/gconv/TIS-620.so
new file mode 100644
index 0000000..87470f9
--- /dev/null
+++ b/sysroot/usr/lib/gconv/TIS-620.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/TSCII.so b/sysroot/usr/lib/gconv/TSCII.so
new file mode 100644
index 0000000..776eb06
--- /dev/null
+++ b/sysroot/usr/lib/gconv/TSCII.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/UHC.so b/sysroot/usr/lib/gconv/UHC.so
new file mode 100644
index 0000000..f532ebc
--- /dev/null
+++ b/sysroot/usr/lib/gconv/UHC.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/UNICODE.so b/sysroot/usr/lib/gconv/UNICODE.so
new file mode 100644
index 0000000..0346c4f
--- /dev/null
+++ b/sysroot/usr/lib/gconv/UNICODE.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/UTF-16.so b/sysroot/usr/lib/gconv/UTF-16.so
new file mode 100644
index 0000000..c3629a7
--- /dev/null
+++ b/sysroot/usr/lib/gconv/UTF-16.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/UTF-32.so b/sysroot/usr/lib/gconv/UTF-32.so
new file mode 100644
index 0000000..e6c7168
--- /dev/null
+++ b/sysroot/usr/lib/gconv/UTF-32.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/UTF-7.so b/sysroot/usr/lib/gconv/UTF-7.so
new file mode 100644
index 0000000..d4e20ca
--- /dev/null
+++ b/sysroot/usr/lib/gconv/UTF-7.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/VISCII.so b/sysroot/usr/lib/gconv/VISCII.so
new file mode 100644
index 0000000..e684a5c
--- /dev/null
+++ b/sysroot/usr/lib/gconv/VISCII.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/gconv-modules b/sysroot/usr/lib/gconv/gconv-modules
new file mode 100644
index 0000000..a8fcd8f
--- /dev/null
+++ b/sysroot/usr/lib/gconv/gconv-modules
@@ -0,0 +1,1929 @@
+# GNU libc iconv configuration.
+# Copyright (C) 1997-2004, 2005, 2007 Free Software Foundation, Inc.
+# This file is part of the GNU C Library.
+
+# The GNU C Library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# The GNU C Library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with the GNU C Library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+# 02111-1307 USA.
+
+# All lines contain the following information:
+
+# If the lines start with `module'
+# fromset: either a name triple or a regular expression triple.
+# toset: a name triple or an expression with \N to get regular
+# expression matching results.
+# filename: filename of the module implementing the transformation.
+# If it is not absolute the path is made absolute by prepending
+# the directory the configuration file is found in.
+# cost: optional cost of the transformation. Default is 1.
+
+# If the lines start with `alias'
+# alias: alias name which is not really recognized.
+# name: the real name of the character set
+
+alias ISO-IR-4// BS_4730//
+alias ISO646-GB// BS_4730//
+alias GB// BS_4730//
+alias UK// BS_4730//
+alias CSISO4UNITEDKINGDOM// BS_4730//
+module BS_4730// INTERNAL ISO646 2
+module INTERNAL BS_4730// ISO646 2
+
+alias ISO-IR-121// CSA_Z243.4-1985-1//
+alias ISO646-CA// CSA_Z243.4-1985-1//
+alias CSA7-1// CSA_Z243.4-1985-1//
+alias CA// CSA_Z243.4-1985-1//
+alias CSISO121CANADIAN1// CSA_Z243.4-1985-1//
+alias CSA_Z243.419851// CSA_Z243.4-1985-1//
+module CSA_Z243.4-1985-1// INTERNAL ISO646 2
+module INTERNAL CSA_Z243.4-1985-1// ISO646 2
+
+alias ISO-IR-122// CSA_Z243.4-1985-2//
+alias ISO646-CA2// CSA_Z243.4-1985-2//
+alias CSA7-2// CSA_Z243.4-1985-2//
+alias CSISO122CANADIAN2// CSA_Z243.4-1985-2//
+alias CSA_Z243.419852// CSA_Z243.4-1985-2//
+module CSA_Z243.4-1985-2// INTERNAL ISO646 2
+module INTERNAL CSA_Z243.4-1985-2// ISO646 2
+
+alias ISO-IR-21// DIN_66003//
+alias DE// DIN_66003//
+alias ISO646-DE// DIN_66003//
+alias CSISO21GERMAN// DIN_66003//
+module DIN_66003// INTERNAL ISO646 2
+module INTERNAL DIN_66003// ISO646 2
+
+alias DS2089// DS_2089//
+alias ISO646-DK// DS_2089//
+alias DK// DS_2089//
+alias CSISO646DANISH// DS_2089//
+module DS_2089// INTERNAL ISO646 2
+module INTERNAL DS_2089// ISO646 2
+
+alias ISO-IR-17// ES//
+alias ISO646-ES// ES//
+alias CSISO17SPANISH// ES//
+module ES// INTERNAL ISO646 2
+module INTERNAL ES// ISO646 2
+
+alias ISO-IR-85// ES2//
+alias ISO646-ES2// ES2//
+alias CSISO85SPANISH2// ES2//
+module ES2// INTERNAL ISO646 2
+module INTERNAL ES2// ISO646 2
+
+alias ISO-IR-57// GB_1988-80//
+alias CN// GB_1988-80//
+alias ISO646-CN// GB_1988-80//
+alias CSISO58GB1988// GB_1988-80//
+alias GB_198880// GB_1988-80//
+module GB_1988-80// INTERNAL ISO646 2
+module INTERNAL GB_1988-80// ISO646 2
+
+alias ISO-IR-15// IT//
+alias ISO646-IT// IT//
+alias CSISO15ITALIAN// IT//
+module IT// INTERNAL ISO646 2
+module INTERNAL IT// ISO646 2
+
+alias ISO-IR-14// JIS_C6220-1969-RO//
+alias JP// JIS_C6220-1969-RO//
+alias ISO646-JP// JIS_C6220-1969-RO//
+alias CSISO14JISC6220RO// JIS_C6220-1969-RO//
+alias JIS_C62201969RO// JIS_C6220-1969-RO//
+module JIS_C6220-1969-RO// INTERNAL ISO646 2
+module INTERNAL JIS_C6220-1969-RO// ISO646 2
+
+alias ISO-IR-92// JIS_C6229-1984-B//
+alias ISO646-JP-OCR-B// JIS_C6229-1984-B//
+alias JP-OCR-B// JIS_C6229-1984-B//
+alias CSISO92JISC62991984B// JIS_C6229-1984-B//
+alias JIS_C62291984B// JIS_C6229-1984-B//
+module JIS_C6229-1984-B// INTERNAL ISO646 2
+module INTERNAL JIS_C6229-1984-B// ISO646 2
+
+alias ISO-IR-141// JUS_I.B1.002//
+alias ISO646-YU// JUS_I.B1.002//
+alias JS// JUS_I.B1.002//
+alias YU// JUS_I.B1.002//
+alias CSISO141JUSIB1002// JUS_I.B1.002//
+module JUS_I.B1.002// INTERNAL ISO646 2
+module INTERNAL JUS_I.B1.002// ISO646 2
+
+alias ISO646-KR// KSC5636//
+alias CSKSC5636// KSC5636//
+module KSC5636// INTERNAL ISO646 2
+module INTERNAL KSC5636// ISO646 2
+
+alias ISO-IR-86// MSZ_7795.3//
+alias ISO646-HU// MSZ_7795.3//
+alias HU// MSZ_7795.3//
+alias CSISO86HUNGARIAN// MSZ_7795.3//
+module MSZ_7795.3// INTERNAL ISO646 2
+module INTERNAL MSZ_7795.3// ISO646 2
+
+alias CUBA// NC_NC00-10//
+alias NC_NC00-10:81// NC_NC00-10//
+alias ISO-IR-151// NC_NC00-10//
+alias ISO646-CU// NC_NC00-10//
+alias CSISO151CUBA// NC_NC00-10//
+alias NC_NC0010// NC_NC00-10//
+module NC_NC00-10// INTERNAL ISO646 2
+module INTERNAL NC_NC00-10// ISO646 2
+
+alias ISO-IR-69// NF_Z_62-010//
+alias ISO646-FR// NF_Z_62-010//
+alias FR// NF_Z_62-010//
+alias CSISO69FRENCH// NF_Z_62-010//
+alias NF_Z_62010// NF_Z_62-010//
+module NF_Z_62-010// INTERNAL ISO646 2
+module INTERNAL NF_Z_62-010// ISO646 2
+
+alias ISO-IR-25// NF_Z_62-010_1973//
+alias ISO646-FR1// NF_Z_62-010_1973//
+alias NF_Z_62-010_(1973)// NF_Z_62-010_1973//
+alias CSISO25FRENCH// NF_Z_62-010_1973//
+alias NF_Z_62010_1973// NF_Z_62-010_1973//
+module NF_Z_62-010_1973// INTERNAL ISO646 2
+module INTERNAL NF_Z_62-010_1973// ISO646 2
+
+alias ISO-IR-60// NS_4551-1//
+alias ISO646-NO// NS_4551-1//
+alias NO// NS_4551-1//
+alias CSISO60DANISHNORWEGIAN// NS_4551-1//
+alias CSISO60NORWEGIAN1// NS_4551-1//
+alias NS_45511// NS_4551-1//
+module NS_4551-1// INTERNAL ISO646 2
+module INTERNAL NS_4551-1// ISO646 2
+
+alias ISO646-NO2// NS_4551-2//
+alias ISO-IR-61// NS_4551-2//
+alias NO2// NS_4551-2//
+alias CSISO61NORWEGIAN2// NS_4551-2//
+alias NS_45512// NS_4551-2//
+module NS_4551-2// INTERNAL ISO646 2
+module INTERNAL NS_4551-2// ISO646 2
+
+alias ISO-IR-16// PT//
+alias ISO646-PT// PT//
+alias CSISO16PORTUGESE// PT//
+module PT// INTERNAL ISO646 2
+module INTERNAL PT// ISO646 2
+
+alias ISO-IR-84// PT2//
+alias ISO646-PT2// PT2//
+alias CSISO84PORTUGUESE2// PT2//
+module PT2// INTERNAL ISO646 2
+module INTERNAL PT2// ISO646 2
+
+alias ISO-IR-10// SEN_850200_B//
+alias FI// SEN_850200_B//
+alias ISO646-FI// SEN_850200_B//
+alias ISO646-SE// SEN_850200_B//
+alias SE// SEN_850200_B//
+alias CSISO10SWEDISH// SEN_850200_B//
+alias SS636127// SEN_850200_B//
+module SEN_850200_B// INTERNAL ISO646 2
+module INTERNAL SEN_850200_B// ISO646 2
+
+alias ISO-IR-11// SEN_850200_C//
+alias ISO646-SE2// SEN_850200_C//
+alias SE2// SEN_850200_C//
+alias CSISO11SWEDISHFORNAMES// SEN_850200_C//
+module SEN_850200_C// INTERNAL ISO646 2
+module INTERNAL SEN_850200_C// ISO646 2
+
+# from to module cost
+alias ISO-IR-100// ISO-8859-1//
+alias ISO_8859-1:1987// ISO-8859-1//
+alias ISO_8859-1// ISO-8859-1//
+alias ISO8859-1// ISO-8859-1//
+alias ISO88591// ISO-8859-1//
+alias LATIN1// ISO-8859-1//
+alias L1// ISO-8859-1//
+alias IBM819// ISO-8859-1//
+alias CP819// ISO-8859-1//
+alias CSISOLATIN1// ISO-8859-1//
+alias 8859_1// ISO-8859-1//
+alias OSF00010001// ISO-8859-1//
+module ISO-8859-1// INTERNAL ISO8859-1 1
+module INTERNAL ISO-8859-1// ISO8859-1 1
+
+# from to module cost
+alias ISO-IR-101// ISO-8859-2//
+alias ISO_8859-2:1987// ISO-8859-2//
+alias ISO_8859-2// ISO-8859-2//
+alias ISO8859-2// ISO-8859-2//
+alias ISO88592// ISO-8859-2//
+alias LATIN2// ISO-8859-2//
+alias L2// ISO-8859-2//
+alias CSISOLATIN2// ISO-8859-2//
+alias 8859_2// ISO-8859-2//
+alias OSF00010002// ISO-8859-2//
+alias IBM912// ISO-8859-2//
+alias CP912// ISO-8859-2//
+module ISO-8859-2// INTERNAL ISO8859-2 1
+module INTERNAL ISO-8859-2// ISO8859-2 1
+
+# from to module cost
+alias ISO-IR-109// ISO-8859-3//
+alias ISO_8859-3:1988// ISO-8859-3//
+alias ISO_8859-3// ISO-8859-3//
+alias ISO8859-3// ISO-8859-3//
+alias ISO88593// ISO-8859-3//
+alias LATIN3// ISO-8859-3//
+alias L3// ISO-8859-3//
+alias CSISOLATIN3// ISO-8859-3//
+alias 8859_3// ISO-8859-3//
+alias OSF00010003// ISO-8859-3//
+module ISO-8859-3// INTERNAL ISO8859-3 1
+module INTERNAL ISO-8859-3// ISO8859-3 1
+
+# from to module cost
+alias ISO-IR-110// ISO-8859-4//
+alias ISO_8859-4:1988// ISO-8859-4//
+alias ISO_8859-4// ISO-8859-4//
+alias ISO8859-4// ISO-8859-4//
+alias ISO88594// ISO-8859-4//
+alias LATIN4// ISO-8859-4//
+alias L4// ISO-8859-4//
+alias CSISOLATIN4// ISO-8859-4//
+alias 8859_4// ISO-8859-4//
+alias OSF00010004// ISO-8859-4//
+module ISO-8859-4// INTERNAL ISO8859-4 1
+module INTERNAL ISO-8859-4// ISO8859-4 1
+
+# from to module cost
+alias ISO-IR-144// ISO-8859-5//
+alias ISO_8859-5:1988// ISO-8859-5//
+alias ISO_8859-5// ISO-8859-5//
+alias ISO8859-5// ISO-8859-5//
+alias ISO88595// ISO-8859-5//
+alias CYRILLIC// ISO-8859-5//
+alias CSISOLATINCYRILLIC// ISO-8859-5//
+alias 8859_5// ISO-8859-5//
+alias OSF00010005// ISO-8859-5//
+alias IBM915// ISO-8859-5//
+alias CP915// ISO-8859-5//
+module ISO-8859-5// INTERNAL ISO8859-5 1
+module INTERNAL ISO-8859-5// ISO8859-5 1
+
+# from to module cost
+alias ISO-IR-127// ISO-8859-6//
+alias ISO_8859-6:1987// ISO-8859-6//
+alias ISO_8859-6// ISO-8859-6//
+alias ISO8859-6// ISO-8859-6//
+alias ISO88596// ISO-8859-6//
+alias ECMA-114// ISO-8859-6//
+alias ASMO-708// ISO-8859-6//
+alias ARABIC// ISO-8859-6//
+alias CSISOLATINARABIC// ISO-8859-6//
+alias 8859_6// ISO-8859-6//
+alias OSF00010006// ISO-8859-6//
+alias IBM1089// ISO-8859-6//
+alias CP1089// ISO-8859-6//
+module ISO-8859-6// INTERNAL ISO8859-6 1
+module INTERNAL ISO-8859-6// ISO8859-6 1
+
+# from to module cost
+alias ISO-IR-126// ISO-8859-7//
+alias ISO_8859-7:2003// ISO-8859-7//
+alias ISO_8859-7:1987// ISO-8859-7//
+alias ISO_8859-7// ISO-8859-7//
+alias ISO8859-7// ISO-8859-7//
+alias ISO88597// ISO-8859-7//
+alias ELOT_928// ISO-8859-7//
+alias ECMA-118// ISO-8859-7//
+alias GREEK// ISO-8859-7//
+alias GREEK8// ISO-8859-7//
+alias CSISOLATINGREEK// ISO-8859-7//
+alias 8859_7// ISO-8859-7//
+alias OSF00010007// ISO-8859-7//
+alias IBM813// ISO-8859-7//
+alias CP813// ISO-8859-7//
+module ISO-8859-7// INTERNAL ISO8859-7 1
+module INTERNAL ISO-8859-7// ISO8859-7 1
+
+# from to module cost
+alias ISO-IR-138// ISO-8859-8//
+alias ISO_8859-8:1988// ISO-8859-8//
+alias ISO_8859-8// ISO-8859-8//
+alias ISO8859-8// ISO-8859-8//
+alias ISO88598// ISO-8859-8//
+alias HEBREW// ISO-8859-8//
+alias CSISOLATINHEBREW// ISO-8859-8//
+alias 8859_8// ISO-8859-8//
+alias OSF00010008// ISO-8859-8//
+alias IBM916// ISO-8859-8//
+alias CP916// ISO-8859-8//
+module ISO-8859-8// INTERNAL ISO8859-8 1
+module INTERNAL ISO-8859-8// ISO8859-8 1
+
+# from to module cost
+alias ISO-IR-148// ISO-8859-9//
+alias ISO_8859-9:1989// ISO-8859-9//
+alias ISO_8859-9// ISO-8859-9//
+alias ISO8859-9// ISO-8859-9//
+alias ISO88599// ISO-8859-9//
+alias LATIN5// ISO-8859-9//
+alias L5// ISO-8859-9//
+alias CSISOLATIN5// ISO-8859-9//
+alias 8859_9// ISO-8859-9//
+alias OSF00010009// ISO-8859-9//
+alias IBM920// ISO-8859-9//
+alias CP920// ISO-8859-9//
+alias TS-5881// ISO-8859-9//
+alias ECMA-128// ISO-8859-9//
+module ISO-8859-9// INTERNAL ISO8859-9 1
+module INTERNAL ISO-8859-9// ISO8859-9 1
+
+# from to module cost
+alias ISO-IR-157// ISO-8859-10//
+alias ISO_8859-10:1992// ISO-8859-10//
+alias ISO_8859-10// ISO-8859-10//
+alias ISO8859-10// ISO-8859-10//
+alias ISO885910// ISO-8859-10//
+alias LATIN6// ISO-8859-10//
+alias L6// ISO-8859-10//
+alias CSISOLATIN6// ISO-8859-10//
+alias OSF0001000A// ISO-8859-10//
+module ISO-8859-10// INTERNAL ISO8859-10 1
+module INTERNAL ISO-8859-10// ISO8859-10 1
+
+# from to module cost
+alias ISO8859-11// ISO-8859-11//
+alias ISO885911// ISO-8859-11//
+module ISO-8859-11// INTERNAL ISO8859-11 1
+module INTERNAL ISO-8859-11// ISO8859-11 1
+
+# from to module cost
+alias ISO8859-13// ISO-8859-13//
+alias ISO885913// ISO-8859-13//
+alias ISO-IR-179// ISO-8859-13//
+alias LATIN7// ISO-8859-13//
+alias L7// ISO-8859-13//
+alias BALTIC// ISO-8859-13//
+module ISO-8859-13// INTERNAL ISO8859-13 1
+module INTERNAL ISO-8859-13// ISO8859-13 1
+
+# from to module cost
+alias ISO8859-14// ISO-8859-14//
+alias ISO885914// ISO-8859-14//
+alias ISO-IR-199// ISO-8859-14//
+alias LATIN8// ISO-8859-14//
+alias L8// ISO-8859-14//
+alias ISO_8859-14:1998// ISO-8859-14//
+alias ISO_8859-14// ISO-8859-14//
+alias ISO-CELTIC// ISO-8859-14//
+module ISO-8859-14// INTERNAL ISO8859-14 1
+module INTERNAL ISO-8859-14// ISO8859-14 1
+
+# from to module cost
+alias ISO8859-15// ISO-8859-15//
+alias ISO885915// ISO-8859-15//
+alias ISO-IR-203// ISO-8859-15//
+alias ISO_8859-15// ISO-8859-15//
+alias LATIN-9// ISO-8859-15//
+alias ISO_8859-15:1998// ISO-8859-15//
+module ISO-8859-15// INTERNAL ISO8859-15 1
+module INTERNAL ISO-8859-15// ISO8859-15 1
+
+# from to module cost
+alias ISO8859-16// ISO-8859-16//
+alias ISO885916// ISO-8859-16//
+alias ISO-IR-226// ISO-8859-16//
+alias LATIN10// ISO-8859-16//
+alias L10// ISO-8859-16//
+alias ISO_8859-16:2001// ISO-8859-16//
+alias ISO_8859-16// ISO-8859-16//
+module ISO-8859-16// INTERNAL ISO8859-16 1
+module INTERNAL ISO-8859-16// ISO8859-16 1
+
+# from to module cost
+alias T.61// T.61-8BIT//
+alias ISO-IR-103// T.61-8BIT//
+alias CSISO103T618BIT// T.61-8BIT//
+alias T.618BIT// T.61-8BIT//
+module T.61-8BIT// INTERNAL T.61 1
+module INTERNAL T.61-8BIT// T.61 1
+
+# from to module cost
+alias ISO-IR-156// ISO_6937//
+alias ISO_6937:1992// ISO_6937//
+alias ISO6937// ISO_6937//
+module ISO_6937// INTERNAL ISO_6937 1
+module INTERNAL ISO_6937// ISO_6937 1
+
+
+# from to module cost
+alias ISO-IR-90// ISO_6937-2//
+alias ISO_6937-2:1983// ISO_6937-2//
+alias CSISO90// ISO_6937-2//
+alias ISO_69372// ISO_6937-2//
+module ISO_6937-2// INTERNAL ISO_6937-2 1
+module INTERNAL ISO_6937-2// ISO_6937-2 1
+
+# from to module cost
+alias SHIFT-JIS// SJIS//
+alias SHIFT_JIS// SJIS//
+alias MS_KANJI// SJIS//
+alias CSSHIFTJIS// SJIS//
+module SJIS// INTERNAL SJIS 1
+module INTERNAL SJIS// SJIS 1
+
+# from to module cost
+alias WINDOWS-31J// CP932//
+alias MS932// CP932//
+alias SJIS-OPEN// CP932//
+alias SJIS-WIN// CP932//
+alias CSWINDOWS31J// CP932//
+module CP932// INTERNAL CP932 1
+module INTERNAL CP932// CP932 1
+
+# from to module cost
+alias KOI8// KOI-8//
+module KOI-8// INTERNAL KOI-8 1
+module INTERNAL KOI-8// KOI-8 1
+
+# from to module cost
+alias CSKOI8R// KOI8-R//
+alias KOI8R// KOI8-R//
+module KOI8-R// INTERNAL KOI8-R 1
+module INTERNAL KOI8-R// KOI8-R 1
+
+# from to module cost
+alias ISO-IR-19// LATIN-GREEK//
+alias CSISO19LATINGREEK// LATIN-GREEK//
+alias LATINGREEK// LATIN-GREEK//
+module LATIN-GREEK// INTERNAL LATIN-GREEK 1
+module INTERNAL LATIN-GREEK// LATIN-GREEK 1
+
+# from to module cost
+alias ISO-IR-27// LATIN-GREEK-1//
+alias CSISO27LATINGREEK1// LATIN-GREEK-1//
+alias LATINGREEK1// LATIN-GREEK-1//
+module LATIN-GREEK-1// INTERNAL LATIN-GREEK-1 1
+module INTERNAL LATIN-GREEK-1// LATIN-GREEK-1 1
+
+# from to module cost
+alias ROMAN8// HP-ROMAN8//
+alias R8// HP-ROMAN8//
+alias CSHPROMAN8// HP-ROMAN8//
+alias OSF10010001// HP-ROMAN8//
+alias HPROMAN8// HP-ROMAN8//
+module HP-ROMAN8// INTERNAL HP-ROMAN8 1
+module INTERNAL HP-ROMAN8// HP-ROMAN8 1
+
+# from to module cost
+alias CSEBCDICATDE// EBCDIC-AT-DE//
+alias EBCDICATDE// EBCDIC-AT-DE//
+module EBCDIC-AT-DE// INTERNAL EBCDIC-AT-DE 1
+module INTERNAL EBCDIC-AT-DE// EBCDIC-AT-DE 1
+
+# from to module cost
+alias CSEBCDICATDEA// EBCDIC-AT-DE-A//
+alias EBCDICATDEA// EBCDIC-AT-DE-A//
+module EBCDIC-AT-DE-A// INTERNAL EBCDIC-AT-DE-A 1
+module INTERNAL EBCDIC-AT-DE-A// EBCDIC-AT-DE-A 1
+
+# from to module cost
+alias CSEBCDICCAFR// EBCDIC-CA-FR//
+alias EBCDICCAFR// EBCDIC-CA-FR//
+module EBCDIC-CA-FR// INTERNAL EBCDIC-CA-FR 1
+module INTERNAL EBCDIC-CA-FR// EBCDIC-CA-FR 1
+
+# from to module cost
+alias CSEBCDICDKNO// EBCDIC-DK-NO//
+alias EBCDICDKNO// EBCDIC-DK-NO//
+module EBCDIC-DK-NO// INTERNAL EBCDIC-DK-NO 1
+module INTERNAL EBCDIC-DK-NO// EBCDIC-DK-NO 1
+
+# from to module cost
+alias CSEBCDICDKNOA// EBCDIC-DK-NO-A//
+alias EBCDICDKNOA// EBCDIC-DK-NO-A//
+module EBCDIC-DK-NO-A// INTERNAL EBCDIC-DK-NO-A 1
+module INTERNAL EBCDIC-DK-NO-A// EBCDIC-DK-NO-A 1
+
+# from to module cost
+alias CSEBCDICES// EBCDIC-ES//
+alias EBCDICES// EBCDIC-ES//
+module EBCDIC-ES// INTERNAL EBCDIC-ES 1
+module INTERNAL EBCDIC-ES// EBCDIC-ES 1
+
+# from to module cost
+alias CSEBCDICESA// EBCDIC-ES-A//
+alias EBCDICESA// EBCDIC-ES-A//
+module EBCDIC-ES-A// INTERNAL EBCDIC-ES-A 1
+module INTERNAL EBCDIC-ES-A// EBCDIC-ES-A 1
+
+# from to module cost
+alias CSEBCDICESS// EBCDIC-ES-S//
+alias EBCDICESS// EBCDIC-ES-S//
+module EBCDIC-ES-S// INTERNAL EBCDIC-ES-S 1
+module INTERNAL EBCDIC-ES-S// EBCDIC-ES-S 1
+
+# from to module cost
+alias CSEBCDICFISE// EBCDIC-FI-SE//
+alias EBCDICFISE// EBCDIC-FI-SE//
+module EBCDIC-FI-SE// INTERNAL EBCDIC-FI-SE 1
+module INTERNAL EBCDIC-FI-SE// EBCDIC-FI-SE 1
+
+# from to module cost
+alias CSEBCDICFISEA// EBCDIC-FI-SE-A//
+alias EBCDICFISEA// EBCDIC-FI-SE-A//
+module EBCDIC-FI-SE-A// INTERNAL EBCDIC-FI-SE-A 1
+module INTERNAL EBCDIC-FI-SE-A// EBCDIC-FI-SE-A 1
+
+# from to module cost
+alias CSEBCDICFR// EBCDIC-FR//
+alias EBCDICFR// EBCDIC-FR//
+module EBCDIC-FR// INTERNAL EBCDIC-FR 1
+module INTERNAL EBCDIC-FR// EBCDIC-FR 1
+
+# from to module cost
+alias EBCDICISFRISS// EBCDIC-IS-FRISS//
+module EBCDIC-IS-FRISS// INTERNAL EBCDIC-IS-FRISS 1
+module INTERNAL EBCDIC-IS-FRISS// EBCDIC-IS-FRISS 1
+
+# from to module cost
+alias CSEBCDICIT// EBCDIC-IT//
+alias EBCDICIT// EBCDIC-IT//
+module EBCDIC-IT// INTERNAL EBCDIC-IT 1
+module INTERNAL EBCDIC-IT// EBCDIC-IT 1
+
+# from to module cost
+alias CSEBCDICPT// EBCDIC-PT//
+alias EBCDICPT// EBCDIC-PT//
+module EBCDIC-PT// INTERNAL EBCDIC-PT 1
+module INTERNAL EBCDIC-PT// EBCDIC-PT 1
+
+# from to module cost
+alias CSEBCDICUK// EBCDIC-UK//
+alias EBCDICUK// EBCDIC-UK//
+module EBCDIC-UK// INTERNAL EBCDIC-UK 1
+module INTERNAL EBCDIC-UK// EBCDIC-UK 1
+
+# from to module cost
+alias CSEBCDICUS// EBCDIC-US//
+alias EBCDICUS// EBCDIC-US//
+module EBCDIC-US// INTERNAL EBCDIC-US 1
+module INTERNAL EBCDIC-US// EBCDIC-US 1
+
+# from to module cost
+alias CP037// IBM037//
+alias EBCDIC-CP-US// IBM037//
+alias EBCDIC-CP-CA// IBM037//
+alias EBCDIC-CP-WT// IBM037//
+alias EBCDIC-CP-NL// IBM037//
+alias CSIBM037// IBM037//
+alias OSF10020025// IBM037//
+alias CP1070// IBM037//
+alias CP282// IBM037//
+module IBM037// INTERNAL IBM037 1
+module INTERNAL IBM037// IBM037 1
+
+# from to module cost
+alias EBCDIC-INT// IBM038//
+alias CP038// IBM038//
+alias CSIBM038// IBM038//
+module IBM038// INTERNAL IBM038 1
+module INTERNAL IBM038// IBM038 1
+
+# from to module cost
+alias EBCDIC-INT1// IBM256//
+module IBM256// INTERNAL IBM256 1
+module INTERNAL IBM256// IBM256 1
+
+# from to module cost
+alias CP273// IBM273//
+alias CSIBM273// IBM273//
+alias OSF10020111// IBM273//
+module IBM273// INTERNAL IBM273 1
+module INTERNAL IBM273// IBM273 1
+
+# from to module cost
+alias EBCDIC-BE// IBM274//
+alias CP274// IBM274//
+alias CSIBM274// IBM274//
+module IBM274// INTERNAL IBM274 1
+module INTERNAL IBM274// IBM274 1
+
+# from to module cost
+alias EBCDIC-BR// IBM275//
+alias CP275// IBM275//
+alias CSIBM275// IBM275//
+module IBM275// INTERNAL IBM275 1
+module INTERNAL IBM275// IBM275 1
+
+# from to module cost
+alias EBCDIC-CP-DK// IBM277//
+alias EBCDIC-CP-NO// IBM277//
+alias CSIBM277// IBM277//
+alias OSF10020115// IBM277//
+module IBM277// INTERNAL IBM277 1
+module INTERNAL IBM277// IBM277 1
+
+# from to module cost
+alias CP278// IBM278//
+alias EBCDIC-CP-FI// IBM278//
+alias EBCDIC-CP-SE// IBM278//
+alias CSIBM278// IBM278//
+alias OSF10020116// IBM278//
+module IBM278// INTERNAL IBM278 1
+module INTERNAL IBM278// IBM278 1
+
+# from to module cost
+alias CP280// IBM280//
+alias EBCDIC-CP-IT// IBM280//
+alias CSIBM280// IBM280//
+alias OSF10020118// IBM280//
+module IBM280// INTERNAL IBM280 1
+module INTERNAL IBM280// IBM280 1
+
+# from to module cost
+alias EBCDIC-JP-E// IBM281//
+alias CP281// IBM281//
+alias CSIBM281// IBM281//
+module IBM281// INTERNAL IBM281 1
+module INTERNAL IBM281// IBM281 1
+
+# from to module cost
+alias CP284// IBM284//
+alias EBCDIC-CP-ES// IBM284//
+alias CSIBM284// IBM284//
+alias OSF1002011C// IBM284//
+alias CP1079// IBM284//
+module IBM284// INTERNAL IBM284 1
+module INTERNAL IBM284// IBM284 1
+
+# from to module cost
+alias CP285// IBM285//
+alias EBCDIC-CP-GB// IBM285//
+alias CSIBM285// IBM285//
+alias OSF1002011D// IBM285//
+module IBM285// INTERNAL IBM285 1
+module INTERNAL IBM285// IBM285 1
+
+# from to module cost
+alias CP290// IBM290//
+alias EBCDIC-JP-KANA// IBM290//
+alias CSIBM290// IBM290//
+alias OSF10020122// IBM290//
+module IBM290// INTERNAL IBM290 1
+module INTERNAL IBM290// IBM290 1
+
+# from to module cost
+alias CP297// IBM297//
+alias EBCDIC-CP-FR// IBM297//
+alias CSIBM297// IBM297//
+alias OSF10020129// IBM297//
+alias CP1081// IBM297//
+module IBM297// INTERNAL IBM297 1
+module INTERNAL IBM297// IBM297 1
+
+# from to module cost
+alias CP420// IBM420//
+alias EBCDIC-CP-AR1// IBM420//
+alias CSIBM420// IBM420//
+alias OSF100201A4// IBM420//
+module IBM420// INTERNAL IBM420 1
+module INTERNAL IBM420// IBM420 1
+
+# from to module cost
+alias CP423// IBM423//
+alias EBCDIC-CP-GR// IBM423//
+alias CSIBM423// IBM423//
+module IBM423// INTERNAL IBM423 1
+module INTERNAL IBM423// IBM423 1
+
+# from to module cost
+alias CP424// IBM424//
+alias EBCDIC-CP-HE// IBM424//
+alias CSIBM424// IBM424//
+alias OSF100201A8// IBM424//
+module IBM424// INTERNAL IBM424 1
+module INTERNAL IBM424// IBM424 1
+
+# from to module cost
+alias CP437// IBM437//
+alias 437// IBM437//
+alias CSPC8CODEPAGE437// IBM437//
+alias OSF100201B5// IBM437//
+module IBM437// INTERNAL IBM437 1
+module INTERNAL IBM437// IBM437 1
+
+# from to module cost
+alias CP500// IBM500//
+alias 500// IBM500//
+alias 500V1// IBM500//
+alias EBCDIC-CP-BE// IBM500//
+alias EBCDIC-CP-CH// IBM500//
+alias CSIBM500// IBM500//
+alias OSF100201F4// IBM500//
+alias CP1084// IBM500//
+module IBM500// INTERNAL IBM500 1
+module INTERNAL IBM500// IBM500 1
+
+# from to module cost
+alias CP850// IBM850//
+alias 850// IBM850//
+alias CSPC850MULTILINGUAL// IBM850//
+alias OSF10020352// IBM850//
+module IBM850// INTERNAL IBM850 1
+module INTERNAL IBM850// IBM850 1
+
+# from to module cost
+alias CP851// IBM851//
+alias 851// IBM851//
+alias CSIBM851// IBM851//
+module IBM851// INTERNAL IBM851 1
+module INTERNAL IBM851// IBM851 1
+
+# from to module cost
+alias CP852// IBM852//
+alias 852// IBM852//
+alias CSPCP852// IBM852//
+alias OSF10020354// IBM852//
+module IBM852// INTERNAL IBM852 1
+module INTERNAL IBM852// IBM852 1
+
+# from to module cost
+alias CP855// IBM855//
+alias 855// IBM855//
+alias CSIBM855// IBM855//
+alias OSF10020357// IBM855//
+module IBM855// INTERNAL IBM855 1
+module INTERNAL IBM855// IBM855 1
+
+# from to module cost
+alias IBM-856// IBM856//
+alias CP856// IBM856//
+alias 856// IBM856//
+alias CSIBM856// IBM856//
+module IBM856// INTERNAL IBM856 1
+module INTERNAL IBM856// IBM856 1
+
+# from to module cost
+alias CP857// IBM857//
+alias 857// IBM857//
+alias CSIBM857// IBM857//
+alias OSF10020359// IBM857//
+module IBM857// INTERNAL IBM857 1
+module INTERNAL IBM857// IBM857 1
+
+# from to module cost
+alias CP860// IBM860//
+alias 860// IBM860//
+alias CSIBM860// IBM860//
+module IBM860// INTERNAL IBM860 1
+module INTERNAL IBM860// IBM860 1
+
+# from to module cost
+alias CP861// IBM861//
+alias 861// IBM861//
+alias CPIBM861// IBM861//
+alias OSF1002035D// IBM861//
+module IBM861// INTERNAL IBM861 1
+module INTERNAL IBM861// IBM861 1
+
+# from to module cost
+alias CP862// IBM862//
+alias 862// IBM862//
+alias CSPC862LATINHEBREW// IBM862//
+alias OSF1002035E// IBM862//
+module IBM862// INTERNAL IBM862 1
+module INTERNAL IBM862// IBM862 1
+
+# from to module cost
+alias CP863// IBM863//
+alias 863// IBM863//
+alias CSIBM863// IBM863//
+alias OSF1002035F// IBM863//
+module IBM863// INTERNAL IBM863 1
+module INTERNAL IBM863// IBM863 1
+
+# from to module cost
+alias CP864// IBM864//
+alias 864// IBM864//
+alias CSIBM864// IBM864//
+alias OSF10020360// IBM864//
+module IBM864// INTERNAL IBM864 1
+module INTERNAL IBM864// IBM864 1
+
+# from to module cost
+alias CP865// IBM865//
+alias 865// IBM865//
+alias CSIBM865// IBM865//
+module IBM865// INTERNAL IBM865 1
+module INTERNAL IBM865// IBM865 1
+
+# from to module cost
+alias CP866// IBM866//
+alias 866// IBM866//
+alias CSIBM866// IBM866//
+module IBM866// INTERNAL IBM866 1
+module INTERNAL IBM866// IBM866 1
+
+# from to module cost
+alias CP866NAV// IBM866NAV//
+alias 866NAV// IBM866NAV//
+module IBM866NAV// INTERNAL IBM866NAV 1
+module INTERNAL IBM866NAV// IBM866NAV 1
+
+# from to module cost
+alias CP868// IBM868//
+alias CP-AR// IBM868//
+alias CSIBM868// IBM868//
+alias OSF10020364// IBM868//
+module IBM868// INTERNAL IBM868 1
+module INTERNAL IBM868// IBM868 1
+
+# from to module cost
+alias CP869// IBM869//
+alias 869// IBM869//
+alias CP-GR// IBM869//
+alias CSIBM869// IBM869//
+alias OSF10020365// IBM869//
+module IBM869// INTERNAL IBM869 1
+module INTERNAL IBM869// IBM869 1
+
+# from to module cost
+alias CP870// IBM870//
+alias EBCDIC-CP-ROECE// IBM870//
+alias EBCDIC-CP-YU// IBM870//
+alias CSIBM870// IBM870//
+alias OSF10020366// IBM870//
+module IBM870// INTERNAL IBM870 1
+module INTERNAL IBM870// IBM870 1
+
+# from to module cost
+alias CP871// IBM871//
+alias EBCDIC-CP-IS// IBM871//
+alias CSIBM871// IBM871//
+alias OSF10020367// IBM871//
+module IBM871// INTERNAL IBM871 1
+module INTERNAL IBM871// IBM871 1
+
+# from to module cost
+alias CP875// IBM875//
+alias EBCDIC-GREEK// IBM875//
+alias OSF1002036B// IBM875//
+module IBM875// INTERNAL IBM875 1
+module INTERNAL IBM875// IBM875 1
+
+# from to module cost
+alias CP880// IBM880//
+alias EBCDIC-CYRILLIC// IBM880//
+alias CSIBM880// IBM880//
+alias OSF10020370// IBM880//
+module IBM880// INTERNAL IBM880 1
+module INTERNAL IBM880// IBM880 1
+
+# from to module cost
+alias CP891// IBM891//
+alias CSIBM891// IBM891//
+alias OSF1002037B// IBM891//
+module IBM891// INTERNAL IBM891 1
+module INTERNAL IBM891// IBM891 1
+
+# from to module cost
+alias CP903// IBM903//
+alias CSIBM903// IBM903//
+alias OSF10020387// IBM903//
+module IBM903// INTERNAL IBM903 1
+module INTERNAL IBM903// IBM903 1
+
+# from to module cost
+alias CP904// IBM904//
+alias 904// IBM904//
+alias CSIBM904// IBM904//
+alias OSF10020388// IBM904//
+module IBM904// INTERNAL IBM904 1
+module INTERNAL IBM904// IBM904 1
+
+# from to module cost
+alias CP905// IBM905//
+alias EBCDIC-CP-TR// IBM905//
+alias CSIBM905// IBM905//
+module IBM905// INTERNAL IBM905 1
+module INTERNAL IBM905// IBM905 1
+
+# from to module cost
+alias CP918// IBM918//
+alias EBCDIC-CP-AR2// IBM918//
+alias CSIBM918// IBM918//
+alias OSF10020396// IBM918//
+module IBM918// INTERNAL IBM918 1
+module INTERNAL IBM918// IBM918 1
+
+# from to module cost
+alias IBM-922// IBM922//
+alias CP922// IBM922//
+alias CSIBM922// IBM922//
+module IBM922// INTERNAL IBM922 1
+module INTERNAL IBM922// IBM922 1
+
+# from to module cost
+alias IBM-930// IBM930//
+alias CP930// IBM930//
+alias EBCDIC-CP-AR2// IBM930//
+alias CSIBM930// IBM930//
+module IBM930// INTERNAL IBM930 1
+module INTERNAL IBM930// IBM930 1
+
+# from to module cost
+alias IBM-932// IBM932//
+alias CSIBM932// IBM932//
+module IBM932// INTERNAL IBM932 1
+module INTERNAL IBM932// IBM932 1
+
+# from to module cost
+alias IBM-933// IBM933//
+alias CP933// IBM933//
+alias EBCDIC-CP-AR2// IBM933//
+alias CSIBM933// IBM933//
+module IBM933// INTERNAL IBM933 1
+module INTERNAL IBM933// IBM933 1
+
+# from to module cost
+alias IBM-935// IBM935//
+alias CP935// IBM935//
+alias EBCDIC-CP-AR2// IBM935//
+alias CSIBM935// IBM935//
+module IBM935// INTERNAL IBM935 1
+module INTERNAL IBM935// IBM935 1
+
+# from to module cost
+alias IBM-937// IBM937//
+alias CP937// IBM937//
+alias EBCDIC-CP-AR2// IBM937//
+alias CSIBM937// IBM937//
+module IBM937// INTERNAL IBM937 1
+module INTERNAL IBM937// IBM937 1
+
+# from to module cost
+alias IBM-939// IBM939//
+alias CP939// IBM939//
+alias EBCDIC-CP-AR2// IBM939//
+alias CSIBM939// IBM939//
+module IBM939// INTERNAL IBM939 1
+module INTERNAL IBM939// IBM939 1
+
+# from to module cost
+alias IBM-943// IBM943//
+alias CSIBM943// IBM943//
+module IBM943// INTERNAL IBM943 1
+module INTERNAL IBM943// IBM943 1
+
+# from to module cost
+alias CP1004// IBM1004//
+alias OS2LATIN1// IBM1004//
+module IBM1004// INTERNAL IBM1004 1
+module INTERNAL IBM1004// IBM1004 1
+
+# from to module cost
+alias CP1026// IBM1026//
+alias 1026// IBM1026//
+alias CSIBM1026// IBM1026//
+alias OSF10020402// IBM1026//
+module IBM1026// INTERNAL IBM1026 1
+module INTERNAL IBM1026// IBM1026 1
+
+# from to module cost
+alias IBM-1046// IBM1046//
+alias CP1046// IBM1046//
+alias 1046// IBM1046//
+module IBM1046// INTERNAL IBM1046 1
+module INTERNAL IBM1046// IBM1046 1
+
+# from to module cost
+alias IBM-1047// IBM1047//
+alias CP1047// IBM1047//
+alias 1047// IBM1047//
+alias OSF10020417// IBM1047//
+module IBM1047// INTERNAL IBM1047 1
+module INTERNAL IBM1047// IBM1047 1
+
+# from to module cost
+alias IBM-1124// IBM1124//
+alias CP1124// IBM1124//
+alias CSIBM1124// IBM1124//
+module IBM1124// INTERNAL IBM1124 1
+module INTERNAL IBM1124// IBM1124 1
+
+# from to module cost
+alias IBM-1129// IBM1129//
+alias CP1129// IBM1129//
+alias CSIBM1129// IBM1129//
+module IBM1129// INTERNAL IBM1129 1
+module INTERNAL IBM1129// IBM1129 1
+
+# from to module cost
+alias IBM-1160// IBM1160//
+alias CP1160// IBM1160//
+alias CSIBM1160// IBM1160//
+module IBM1160// INTERNAL IBM1160 1
+module INTERNAL IBM1160// IBM1160 1
+
+# from to module cost
+alias IBM-1161// IBM1161//
+alias CP1161// IBM1161//
+alias CSIBM1161// IBM1161//
+module IBM1161// INTERNAL IBM1161 1
+module INTERNAL IBM1161// IBM1161 1
+
+# from to module cost
+alias IBM-1132// IBM1132//
+alias CP1132// IBM1132//
+alias CSIBM1132// IBM1132//
+module IBM1132// INTERNAL IBM1132 1
+module INTERNAL IBM1132// IBM1132 1
+
+# from to module cost
+alias IBM-1133// IBM1133//
+alias CP1133// IBM1133//
+alias CSIBM1133// IBM1133//
+module IBM1133// INTERNAL IBM1133 1
+module INTERNAL IBM1133// IBM1133 1
+
+# from to module cost
+alias IBM-1162// IBM1162//
+alias CP1162// IBM1162//
+alias CSIBM11621162// IBM1162//
+module IBM1162// INTERNAL IBM1162 1
+module INTERNAL IBM1162// IBM1162 1
+
+# from to module cost
+alias IBM-1163// IBM1163//
+alias CP1163// IBM1163//
+alias CSIBM1163// IBM1163//
+module IBM1163// INTERNAL IBM1163 1
+module INTERNAL IBM1163// IBM1163 1
+
+# from to module cost
+alias IBM-1164// IBM1164//
+alias CP1164// IBM1164//
+alias CSIBM1164// IBM1164//
+module IBM1164// INTERNAL IBM1164 1
+module INTERNAL IBM1164// IBM1164 1
+
+# from to module cost
+alias EUCKR// EUC-KR//
+alias CSEUCKR// EUC-KR//
+alias OSF0004000a// EUC-KR//
+module EUC-KR// INTERNAL EUC-KR 1
+module INTERNAL EUC-KR// EUC-KR 1
+
+# from to module cost
+alias MSCP949// UHC//
+alias CP949// UHC//
+alias OSF100203B5// UHC//
+module UHC// INTERNAL UHC 1
+module INTERNAL UHC// UHC 1
+
+# from to module cost
+alias MSCP1361// JOHAB//
+alias CP1361// JOHAB//
+module JOHAB// INTERNAL JOHAB 1
+module INTERNAL JOHAB// JOHAB 1
+
+# from to module cost
+alias BIG-FIVE// BIG5//
+alias BIGFIVE// BIG5//
+alias BIG-5// BIG5//
+alias CN-BIG5// BIG5//
+alias CP950// BIG5//
+module BIG5// INTERNAL BIG5 1
+module INTERNAL BIG5// BIG5 1
+
+# from to module cost
+alias BIG5-HKSCS// BIG5HKSCS//
+module BIG5HKSCS// INTERNAL BIG5HKSCS 1
+module INTERNAL BIG5HKSCS// BIG5HKSCS 1
+
+# from to module cost
+alias EUCJP-MS// EUC-JP-MS//
+alias EUCJP-OPEN// EUC-JP-MS//
+alias EUCJP-WIN// EUC-JP-MS//
+module EUC-JP-MS// INTERNAL EUC-JP-MS 1
+module INTERNAL EUC-JP-MS// EUC-JP-MS 1
+
+# from to module cost
+alias EUCJP// EUC-JP//
+alias CSEUCPKDFMTJAPANESE// EUC-JP//
+alias OSF00030010// EUC-JP//
+alias UJIS// EUC-JP//
+module EUC-JP// INTERNAL EUC-JP 1
+module INTERNAL EUC-JP// EUC-JP 1
+
+# from to module cost
+alias EUCCN// EUC-CN//
+alias GB2312// EUC-CN//
+alias csGB2312// EUC-CN//
+alias CN-GB// EUC-CN//
+module EUC-CN// INTERNAL EUC-CN 1
+module INTERNAL EUC-CN// EUC-CN 1
+
+# from to module cost
+module EUC-CN// BIG5// GBBIG5 1
+module BIG5// EUC-CN// GBBIG5 1
+
+# from to module cost
+alias GB13000// GBK//
+alias CP936// GBK//
+alias MS936// GBK//
+alias WINDOWS-936// GBK//
+module GBK// INTERNAL GBK 1
+module INTERNAL GBK// GBK 1
+
+# from to module cost
+module GBK// EUC-CN// GBGBK 1
+module EUC-CN// GBK// GBGBK 1
+
+# from to module cost
+alias EUCTW// EUC-TW//
+alias OSF0005000a// EUC-TW//
+module EUC-TW// INTERNAL EUC-TW 1
+module INTERNAL EUC-TW// EUC-TW 1
+
+# from to module cost
+alias RUSCII// CP1125//
+alias IBM848// CP1125//
+module CP1125// INTERNAL CP1125 1
+module INTERNAL CP1125// CP1125 1
+
+# from to module cost
+alias MS-EE// CP1250//
+alias WINDOWS-1250// CP1250//
+module CP1250// INTERNAL CP1250 1
+module INTERNAL CP1250// CP1250 1
+
+# from to module cost
+alias MS-CYRL// CP1251//
+alias WINDOWS-1251// CP1251//
+module CP1251// INTERNAL CP1251 1
+module INTERNAL CP1251// CP1251 1
+
+# from to module cost
+alias MS-ANSI// CP1252//
+alias WINDOWS-1252// CP1252//
+module CP1252// INTERNAL CP1252 1
+module INTERNAL CP1252// CP1252 1
+
+# from to module cost
+alias MS-GREEK// CP1253//
+alias WINDOWS-1253// CP1253//
+module CP1253// INTERNAL CP1253 1
+module INTERNAL CP1253// CP1253 1
+
+# from to module cost
+alias MS-TURK// CP1254//
+alias WINDOWS-1254// CP1254//
+module CP1254// INTERNAL CP1254 1
+module INTERNAL CP1254// CP1254 1
+
+# from to module cost
+alias MS-HEBR// CP1255//
+alias WINDOWS-1255// CP1255//
+module CP1255// INTERNAL CP1255 1
+module INTERNAL CP1255// CP1255 1
+
+# from to module cost
+alias MS-ARAB// CP1256//
+alias WINDOWS-1256// CP1256//
+module CP1256// INTERNAL CP1256 1
+module INTERNAL CP1256// CP1256 1
+
+# from to module cost
+alias WINBALTRIM// CP1257//
+alias WINDOWS-1257// CP1257//
+module CP1257// INTERNAL CP1257 1
+module INTERNAL CP1257// CP1257 1
+
+# from to module cost
+alias WINDOWS-1258// CP1258//
+module CP1258// INTERNAL CP1258 1
+module INTERNAL CP1258// CP1258 1
+
+# from to module cost
+alias 874// IBM874//
+alias CP874// IBM874//
+alias WINDOWS-874// IBM874//
+module IBM874// INTERNAL IBM874 1
+module INTERNAL IBM874// IBM874 1
+
+# from to module cost
+module CP737// INTERNAL CP737 1
+module INTERNAL CP737// CP737 1
+
+# from to module cost
+alias IBM775// CP775//
+alias CSPC775BALTIC// CP775//
+module CP775// INTERNAL CP775 1
+module INTERNAL CP775// CP775 1
+
+# from to module cost
+alias CSISO2022JP// ISO-2022-JP//
+alias ISO2022JP// ISO-2022-JP//
+module ISO-2022-JP// INTERNAL ISO-2022-JP 1
+module INTERNAL ISO-2022-JP// ISO-2022-JP 1
+
+# from to module cost
+alias CSISO2022JP2// ISO-2022-JP-2//
+alias ISO2022JP2// ISO-2022-JP-2//
+module ISO-2022-JP-2// INTERNAL ISO-2022-JP 1
+module INTERNAL ISO-2022-JP-2// ISO-2022-JP 1
+
+# from to module cost
+module ISO-2022-JP-3// INTERNAL ISO-2022-JP-3 1
+module INTERNAL ISO-2022-JP-3// ISO-2022-JP-3 1
+
+# from to module cost
+alias CSISO2022KR// ISO-2022-KR//
+alias ISO2022KR// ISO-2022-KR//
+module ISO-2022-KR// INTERNAL ISO-2022-KR 1
+module INTERNAL ISO-2022-KR// ISO-2022-KR 1
+
+# from to module cost
+alias CSISO2022CN// ISO-2022-CN//
+alias ISO2022CN// ISO-2022-CN//
+module ISO-2022-CN// INTERNAL ISO-2022-CN 1
+module INTERNAL ISO-2022-CN// ISO-2022-CN 1
+
+# from to module cost
+alias ISO2022CNEXT// ISO-2022-CN-EXT//
+module ISO-2022-CN-EXT// INTERNAL ISO-2022-CN-EXT 1
+module INTERNAL ISO-2022-CN-EXT// ISO-2022-CN-EXT 1
+
+# from to module cost
+alias MAC// MACINTOSH//
+alias CSMACINTOSH// MACINTOSH//
+module MACINTOSH// INTERNAL MACINTOSH 1
+module INTERNAL MACINTOSH// MACINTOSH 1
+
+# from to module cost
+alias ISO-IR-143// IEC_P27-1//
+alias CSISO143IECP271// IEC_P27-1//
+alias IEC_P271// IEC_P27-1//
+module IEC_P27-1// INTERNAL IEC_P27-1 1
+module INTERNAL IEC_P27-1// IEC_P27-1 1
+
+# from to module cost
+alias ISO_9036// ASMO_449//
+alias ARABIC7// ASMO_449//
+alias ISO-IR-89// ASMO_449//
+alias CSISO89ASMO449// ASMO_449//
+module ASMO_449// INTERNAL ASMO_449 1
+module INTERNAL ASMO_449// ASMO_449 1
+
+# from to module cost
+alias ANSI_X3.110-1983// ANSI_X3.110//
+alias ISO-IR-99// ANSI_X3.110//
+alias CSA_T500-1983// ANSI_X3.110//
+alias CSA_T500// ANSI_X3.110//
+alias NAPLPS// ANSI_X3.110//
+alias CSISO99NAPLPS// ANSI_X3.110//
+module ANSI_X3.110// INTERNAL ANSI_X3.110 1
+module INTERNAL ANSI_X3.110// ANSI_X3.110 1
+
+# from to module cost
+alias ISO-IR-139// CSN_369103//
+alias CSISO139CSN369103// CSN_369103//
+module CSN_369103// INTERNAL CSN_369103 1
+module INTERNAL CSN_369103// CSN_369103 1
+
+# from to module cost
+alias CWI-2// CWI//
+alias CP-HU// CWI//
+module CWI// INTERNAL CWI 1
+module INTERNAL CWI// CWI 1
+
+# from to module cost
+alias DEC// DEC-MCS//
+alias CSDECMCS// DEC-MCS//
+alias DECMCS// DEC-MCS//
+module DEC-MCS// INTERNAL DEC-MCS 1
+module INTERNAL DEC-MCS// DEC-MCS 1
+
+# from to module cost
+alias ISO-IR-111// ECMA-CYRILLIC//
+alias CSISO111ECMACYRILLIC// ECMA-CYRILLIC//
+alias ECMACYRILLIC// ECMA-CYRILLIC//
+module ECMA-CYRILLIC// INTERNAL ECMA-CYRILLIC 1
+module INTERNAL ECMA-CYRILLIC// ECMA-CYRILLIC 1
+
+# from to module cost
+alias ST_SEV_358-88// GOST_19768-74//
+alias GOST_19768// GOST_19768-74//
+alias ISO-IR-153// GOST_19768-74//
+alias CSISO153GOST1976874// GOST_19768-74//
+alias GOST_1976874// GOST_19768-74//
+module GOST_19768-74// INTERNAL GOST_19768-74 1
+module INTERNAL GOST_19768-74// GOST_19768-74 1
+
+# from to module cost
+alias ISO-IR-150// GREEK-CCITT//
+alias CSISO150// GREEK-CCITT//
+alias CSISO150GREEKCCITT// GREEK-CCITT//
+alias GREEKCCITT// GREEK-CCITT//
+module GREEK-CCITT// INTERNAL GREEK-CCITT 1
+module INTERNAL GREEK-CCITT// GREEK-CCITT 1
+
+# from to module cost
+alias ISO-IR-88// GREEK7//
+alias CSISO88GREEK7// GREEK7//
+module GREEK7// INTERNAL GREEK7 1
+module INTERNAL GREEK7// GREEK7 1
+
+# from to module cost
+alias ISO-IR-18// GREEK7-OLD//
+alias CSISO18GREEK7OLD// GREEK7-OLD//
+alias GREEK7OLD// GREEK7-OLD//
+module GREEK7-OLD// INTERNAL GREEK7-OLD 1
+module INTERNAL GREEK7-OLD// GREEK7-OLD 1
+
+# from to module cost
+alias ISO-IR-49// INIS//
+alias CSISO49INIS// INIS//
+module INIS// INTERNAL INIS 1
+module INTERNAL INIS// INIS 1
+
+# from to module cost
+alias ISO-IR-50// INIS-8//
+alias CSISO50INIS8// INIS-8//
+alias INIS8// INIS-8//
+module INIS-8// INTERNAL INIS-8 1
+module INTERNAL INIS-8// INIS-8 1
+
+# from to module cost
+alias ISO-IR-51// INIS-CYRILLIC//
+alias CSISO51INISCYRILLIC// INIS-CYRILLIC//
+alias INISCYRILLIC// INIS-CYRILLIC//
+module INIS-CYRILLIC// INTERNAL INIS-CYRILLIC 1
+module INTERNAL INIS-CYRILLIC// INIS-CYRILLIC 1
+
+# from to module cost
+alias ISO-IR-98// ISO_2033//
+alias ISO_2033-1983// ISO_2033//
+alias E13B// ISO_2033//
+alias CSISO2033// ISO_2033//
+module ISO_2033// INTERNAL ISO_2033 1
+module INTERNAL ISO_2033// ISO_2033 1
+
+# from to module cost
+alias ISO-IR-37// ISO_5427//
+alias KOI-7// ISO_5427//
+alias CSISO5427CYRILLIC// ISO_5427//
+module ISO_5427// INTERNAL ISO_5427 1
+module INTERNAL ISO_5427// ISO_5427 1
+
+# from to module cost
+alias ISO-IR-54// ISO_5427-EXT//
+alias ISO_5427:1981// ISO_5427-EXT//
+alias CSISO5427CYRILLIC1981// ISO_5427-EXT//
+alias ISO_5427EXT// ISO_5427-EXT//
+module ISO_5427-EXT// INTERNAL ISO_5427-EXT 1
+module INTERNAL ISO_5427-EXT// ISO_5427-EXT 1
+
+# from to module cost
+alias ISO-IR-55// ISO_5428//
+alias ISO_5428:1980// ISO_5428//
+alias CSISO5428GREEK// ISO_5428//
+module ISO_5428// INTERNAL ISO_5428 1
+module INTERNAL ISO_5428// ISO_5428 1
+
+# from to module cost
+alias ISO-IR-155// ISO_10367-BOX//
+alias CSISO10367BOX// ISO_10367-BOX//
+alias ISO_10367BOX// ISO_10367-BOX//
+module ISO_10367-BOX// INTERNAL ISO_10367-BOX 1
+module INTERNAL ISO_10367-BOX// ISO_10367-BOX 1
+
+# from to module cost
+alias MACIS// MAC-IS//
+module MAC-IS// INTERNAL MAC-IS 1
+module INTERNAL MAC-IS// MAC-IS 1
+
+# from to module cost
+alias MACUK// MAC-UK//
+alias MACUKRAINIAN// MAC-UK//
+alias MAC-CYRILLIC// MAC-UK//
+alias MACCYRILLIC// MAC-UK//
+module MAC-UK// INTERNAL MAC-UK 1
+module INTERNAL MAC-UK// MAC-UK 1
+
+# from to module cost
+alias MS-MAC-CYRILLIC// CP10007//
+alias MSMACCYRILLIC// CP10007//
+module CP10007// INTERNAL CP10007 1
+module INTERNAL CP10007// CP10007 1
+
+# from to module cost
+alias ISO-IR-9-1// NATS-DANO//
+alias CSNATSDANO// NATS-DANO//
+alias NATSDANO// NATS-DANO//
+module NATS-DANO// INTERNAL NATS-DANO 1
+module INTERNAL NATS-DANO// NATS-DANO 1
+
+# from to module cost
+alias ISO-IR-8-1// NATS-SEFI//
+alias CSNATSSEFI// NATS-SEFI//
+alias NATSSEFI// NATS-SEFI//
+module NATS-SEFI// INTERNAL NATS-SEFI 1
+module INTERNAL NATS-SEFI// NATS-SEFI 1
+
+# from to module cost
+alias WS2// WIN-SAMI-2//
+alias WINSAMI2// WIN-SAMI-2//
+module WIN-SAMI-2// INTERNAL SAMI-WS2 1
+module INTERNAL WIN-SAMI-2// SAMI-WS2 1
+
+# from to module cost
+module ISO-IR-197// INTERNAL ISO-IR-197 1
+module INTERNAL ISO-IR-197// ISO-IR-197 1
+
+# from to module cost
+alias TIS620// TIS-620//
+alias TIS620-0// TIS-620//
+alias TIS620.2529-1// TIS-620//
+alias TIS620.2533-0// TIS-620//
+alias ISO-IR-166// TIS-620//
+module TIS-620// INTERNAL TIS-620 1
+module INTERNAL TIS-620// TIS-620 1
+
+# from to module cost
+alias KOI8U// KOI8-U//
+module KOI8-U// INTERNAL KOI8-U 1
+module INTERNAL KOI8-U// KOI8-U 1
+
+# from to module cost
+alias ISIRI3342// ISIRI-3342//
+module ISIRI-3342// INTERNAL ISIRI-3342 1
+module INTERNAL ISIRI-3342// ISIRI-3342 1
+
+# from to module cost
+alias UTF16// UTF-16//
+module UTF-16// INTERNAL UTF-16 1
+module INTERNAL UTF-16// UTF-16 1
+
+# from to module cost
+alias UTF16LE// UTF-16LE//
+module UTF-16LE// INTERNAL UTF-16 1
+module INTERNAL UTF-16LE// UTF-16 1
+
+# from to module cost
+alias UTF16BE// UTF-16BE//
+module UTF-16BE// INTERNAL UTF-16 1
+module INTERNAL UTF-16BE// UTF-16 1
+
+# from to module cost
+alias CSUNICODE// UNICODE//
+module UNICODE// INTERNAL UNICODE 1
+module INTERNAL UNICODE// UNICODE 1
+
+# from to module cost
+alias UTF32// UTF-32//
+module UTF-32// INTERNAL UTF-32 1
+module INTERNAL UTF-32// UTF-32 1
+
+# from to module cost
+alias UTF32LE// UTF-32LE//
+module UTF-32LE// INTERNAL UTF-32 1
+module INTERNAL UTF-32LE// UTF-32 1
+
+# from to module cost
+alias UTF32BE// UTF-32BE//
+module UTF-32BE// INTERNAL UTF-32 1
+module INTERNAL UTF-32BE// UTF-32 1
+
+# from to module cost
+alias UTF7// UTF-7//
+module UTF-7// INTERNAL UTF-7 1
+module INTERNAL UTF-7// UTF-7 1
+
+# from to module cost
+module GB18030// INTERNAL GB18030 1
+module INTERNAL GB18030// GB18030 1
+
+# from to module cost
+module VISCII// INTERNAL VISCII 1
+module INTERNAL VISCII// VISCII 1
+
+# from to module cost
+module KOI8-T// INTERNAL KOI8-T 1
+module INTERNAL KOI8-T// KOI8-T 1
+
+# from to module cost
+module GEORGIAN-PS// INTERNAL GEORGIAN-PS 1
+module INTERNAL GEORGIAN-PS// GEORGIAN-PS 1
+
+# from to module cost
+module GEORGIAN-ACADEMY// INTERNAL GEORGIAN-ACADEMY 1
+module INTERNAL GEORGIAN-ACADEMY// GEORGIAN-ACADEMY 1
+
+# from to module cost
+module ISO-IR-209// INTERNAL ISO-IR-209 1
+module INTERNAL ISO-IR-209// ISO-IR-209 1
+
+# from to module cost
+module MAC-SAMI// INTERNAL MAC-SAMI 1
+module INTERNAL MAC-SAMI// MAC-SAMI 1
+
+# from to module cost
+module ARMSCII-8// INTERNAL ARMSCII-8 1
+module INTERNAL ARMSCII-8// ARMSCII-8 1
+
+# from to module cost
+alias TCVN// TCVN5712-1//
+alias TCVN-5712// TCVN5712-1//
+alias TCVN5712-1:1993// TCVN5712-1//
+module TCVN5712-1// INTERNAL TCVN5712-1 1
+module INTERNAL TCVN5712-1// TCVN5712-1 1
+
+# from to module cost
+module EUC-JISX0213// INTERNAL EUC-JISX0213 1
+module INTERNAL EUC-JISX0213// EUC-JISX0213 1
+
+# from to module cost
+module Shift_JISX0213// INTERNAL SHIFT_JISX0213 1
+module INTERNAL Shift_JISX0213// SHIFT_JISX0213 1
+
+# from to module cost
+module TSCII// INTERNAL TSCII 1
+module INTERNAL TSCII// TSCII 1
+
+# from to module cost
+module PT154// INTERNAL PT154 1
+module INTERNAL PT154// PT154 1
+
+# from to module cost
+alias STRK1048-2002// RK1048//
+module RK1048// INTERNAL RK1048 1
+module INTERNAL RK1048// RK1048 1
+
+# from to module cost
+alias IBM-1025// IBM1025//
+alias CP1025// IBM1025//
+alias CSIBM1025// IBM1025//
+module IBM1025// INTERNAL IBM1025 1
+module INTERNAL IBM1025// IBM1025 1
+
+# from to module cost
+alias IBM-1122// IBM1122//
+alias CP1122// IBM1122//
+alias CSIBM1122// IBM1122//
+module IBM1122// INTERNAL IBM1122 1
+module INTERNAL IBM1122// IBM1122 1
+
+# from to module cost
+alias IBM-1137// IBM1137//
+alias CP1137// IBM1137//
+alias CSIBM1137// IBM1137//
+module IBM1137// INTERNAL IBM1137 1
+module INTERNAL IBM1137// IBM1137 1
+
+# from to module cost
+alias IBM-1153// IBM1153//
+alias CP1153// IBM1153//
+alias CSIBM1153// IBM1153//
+module IBM1153// INTERNAL IBM1153 1
+module INTERNAL IBM1153// IBM1153 1
+
+# from to module cost
+alias IBM-1154// IBM1154//
+alias CP1154// IBM1154//
+alias CSIBM1154// IBM1154//
+module IBM1154// INTERNAL IBM1154 1
+module INTERNAL IBM1154// IBM1154 1
+
+# from to module cost
+alias IBM-1155// IBM1155//
+alias CP1155// IBM1155//
+alias CSIBM1155// IBM1155//
+module IBM1155// INTERNAL IBM1155 1
+module INTERNAL IBM1155// IBM1155 1
+
+# from to module cost
+alias IBM-1155// IBM1155//
+alias CP1155// IBM1155//
+alias CSIBM1155// IBM1155//
+module IBM1155// INTERNAL IBM1155 1
+module INTERNAL IBM1155// IBM1155 1
+
+# from to module cost
+alias IBM-1156// IBM1156//
+alias CP1156// IBM1156//
+alias CSIBM1156// IBM1156//
+module IBM1156// INTERNAL IBM1156 1
+module INTERNAL IBM1156// IBM1156 1
+
+# from to module cost
+alias IBM-1157// IBM1157//
+alias CP1157// IBM1157//
+alias CSIBM1157// IBM1157//
+module IBM1157// INTERNAL IBM1157 1
+module INTERNAL IBM1157// IBM1157 1
+
+# from to module cost
+alias IBM-1158// IBM1158//
+alias CP1158// IBM1158//
+alias CSIBM1158// IBM1158//
+module IBM1158// INTERNAL IBM1158 1
+module INTERNAL IBM1158// IBM1158 1
+
+# from to module cost
+alias IBM-803// IBM803//
+alias CP803// IBM803//
+alias CSIBM803// IBM803//
+module IBM803// INTERNAL IBM803 1
+module INTERNAL IBM803// IBM803 1
+
+# from to module cost
+alias IBM-901// IBM901//
+alias CP901// IBM901//
+alias CSIBM901// IBM901//
+module IBM901// INTERNAL IBM901 1
+module INTERNAL IBM901// IBM901 1
+
+# from to module cost
+alias IBM-902// IBM902//
+alias CP902// IBM902//
+alias CSIBM902// IBM902//
+module IBM902// INTERNAL IBM902 1
+module INTERNAL IBM902// IBM902 1
+
+# from to module cost
+alias IBM-921// IBM921//
+alias CP921// IBM921//
+alias CSIBM921// IBM921//
+module IBM921// INTERNAL IBM921 1
+module INTERNAL IBM921// IBM921 1
+
+# from to module cost
+alias IBM-1008// IBM1008//
+alias CP1008// IBM1008//
+alias CSIBM1008// IBM1008//
+module IBM1008// INTERNAL IBM1008 1
+module INTERNAL IBM1008// IBM1008 1
+
+# from to module cost
+module IBM1008// IBM420// IBM1008_420 1
+module IBM420// IBM1008// IBM1008_420 1
+
+# from to module cost
+alias IBM-1097// IBM1097//
+alias CP1097// IBM1097//
+alias CSIBM1097// IBM1097//
+module IBM1097// INTERNAL IBM1097 1
+module INTERNAL IBM1097// IBM1097 1
+
+# from to module cost
+alias IBM-1112// IBM1112//
+alias CP1112// IBM1112//
+alias CSIBM1112// IBM1112//
+module IBM1112// INTERNAL IBM1112 1
+module INTERNAL IBM1112// IBM1112 1
+
+# from to module cost
+alias IBM-1123// IBM1123//
+alias CP1123// IBM1123//
+alias CSIBM1123// IBM1123//
+module IBM1123// INTERNAL IBM1123 1
+module INTERNAL IBM1123// IBM1123 1
+
+# from to module cost
+alias IBM-1130// IBM1130//
+alias CP1130// IBM1130//
+alias CSIBM1130// IBM1130//
+module IBM1130// INTERNAL IBM1130 1
+module INTERNAL IBM1130// IBM1130 1
+
+# from to module cost
+alias IBM-1140// IBM1140//
+alias CP1140// IBM1140//
+alias CSIBM1140// IBM1140//
+module IBM1140// INTERNAL IBM1140 1
+module INTERNAL IBM1140// IBM1140 1
+
+# from to module cost
+alias IBM-1141// IBM1141//
+alias CP1141// IBM1141//
+alias CSIBM1141// IBM1141//
+module IBM1141// INTERNAL IBM1141 1
+module INTERNAL IBM1141// IBM1141 1
+
+# from to module cost
+alias IBM-1142// IBM1142//
+alias CP1142// IBM1142//
+alias CSIBM1142// IBM1142//
+module IBM1142// INTERNAL IBM1142 1
+module INTERNAL IBM1142// IBM1142 1
+
+# from to module cost
+alias IBM-1143// IBM1143//
+alias CP1143// IBM1143//
+alias CSIBM1143// IBM1143//
+module IBM1143// INTERNAL IBM1143 1
+module INTERNAL IBM1143// IBM1143 1
+
+# from to module cost
+alias IBM-1144// IBM1144//
+alias CP1144// IBM1144//
+alias CSIBM1144// IBM1144//
+module IBM1144// INTERNAL IBM1144 1
+module INTERNAL IBM1144// IBM1144 1
+
+# from to module cost
+alias IBM-1145// IBM1145//
+alias CP1145// IBM1145//
+alias CSIBM1145// IBM1145//
+module IBM1145// INTERNAL IBM1145 1
+module INTERNAL IBM1145// IBM1145 1
+
+# from to module cost
+alias IBM-1146// IBM1146//
+alias CP1146// IBM1146//
+alias CSIBM1146// IBM1146//
+module IBM1146// INTERNAL IBM1146 1
+module INTERNAL IBM1146// IBM1146 1
+
+# from to module cost
+alias IBM-1147// IBM1147//
+alias CP1147// IBM1147//
+alias CSIBM1147// IBM1147//
+module IBM1147// INTERNAL IBM1147 1
+module INTERNAL IBM1147// IBM1147 1
+
+# from to module cost
+alias IBM-1148// IBM1148//
+alias CP1148// IBM1148//
+alias CSIBM1148// IBM1148//
+module IBM1148// INTERNAL IBM1148 1
+module INTERNAL IBM1148// IBM1148 1
+
+# from to module cost
+alias IBM-1149// IBM1149//
+alias CP1149// IBM1149//
+alias CSIBM1149// IBM1149//
+module IBM1149// INTERNAL IBM1149 1
+module INTERNAL IBM1149// IBM1149 1
+
+# from to module cost
+alias IBM-1166// IBM1166//
+alias CP1166// IBM1166//
+alias CSIBM1166// IBM1166//
+module IBM1166// INTERNAL IBM1166 1
+module INTERNAL IBM1166// IBM1166 1
+
+# from to module cost
+alias IBM-1167// IBM1167//
+alias CP1167// IBM1167//
+alias CSIBM1167// IBM1167//
+module IBM1167// INTERNAL IBM1167 1
+module INTERNAL IBM1167// IBM1167 1
+
+# from to module cost
+alias IBM-4517// IBM4517//
+alias CP4517// IBM4517//
+alias CSIBM4517// IBM4517//
+module IBM4517// INTERNAL IBM4517 1
+module INTERNAL IBM4517// IBM4517 1
+
+# from to module cost
+alias IBM-4899// IBM4899//
+alias CP4899// IBM4899//
+alias CSIBM4899// IBM4899//
+module IBM4899// INTERNAL IBM4899 1
+module INTERNAL IBM4899// IBM4899 1
+
+# from to module cost
+alias IBM-4909// IBM4909//
+alias CP4909// IBM4909//
+alias CSIBM4909// IBM4909//
+module IBM4909// INTERNAL IBM4909 1
+module INTERNAL IBM4909// IBM4909 1
+
+# from to module cost
+alias IBM-4971// IBM4971//
+alias CP4971// IBM4971//
+alias CSIBM4971// IBM4971//
+module IBM4971// INTERNAL IBM4971 1
+module INTERNAL IBM4971// IBM4971 1
+
+# from to module cost
+alias IBM-5347// IBM5347//
+alias CP5347// IBM5347//
+alias CSIBM5347// IBM5347//
+module IBM5347// INTERNAL IBM5347 1
+module INTERNAL IBM5347// IBM5347 1
+
+# from to module cost
+alias IBM-9030// IBM9030//
+alias CP9030// IBM9030//
+alias CSIBM9030// IBM9030//
+module IBM9030// INTERNAL IBM9030 1
+module INTERNAL IBM9030// IBM9030 1
+
+# from to module cost
+alias IBM-9066// IBM9066//
+alias CP9066// IBM9066//
+alias CSIBM9066// IBM9066//
+module IBM9066// INTERNAL IBM9066 1
+module INTERNAL IBM9066// IBM9066 1
+
+# from to module cost
+alias IBM-9448// IBM9448//
+alias CP9448// IBM9448//
+alias CSIBM9448// IBM9448//
+module IBM9448// INTERNAL IBM9448 1
+module INTERNAL IBM9448// IBM9448 1
+
+# from to module cost
+alias IBM-12712// IBM12712//
+alias CP12712// IBM12712//
+alias CSIBM12712// IBM12712//
+module IBM12712// INTERNAL IBM12712 1
+module INTERNAL IBM12712// IBM12712 1
+
+# from to module cost
+alias IBM-16804// IBM16804//
+alias CP16804// IBM16804//
+alias CSIBM16804// IBM16804//
+module IBM16804// INTERNAL IBM16804 1
+module INTERNAL IBM16804// IBM16804 1
+
+# from to module cost
+alias IBM-1364// IBM1364//
+alias CP1364// IBM1364//
+alias CSIBM1364// IBM1364//
+module IBM1364// INTERNAL IBM1364 1
+module INTERNAL IBM1364// IBM1364 1
+
+# from to module cost
+alias IBM-1371// IBM1371//
+alias CP1371// IBM1371//
+alias CSIBM1371// IBM1371//
+module IBM1371// INTERNAL IBM1371 1
+module INTERNAL IBM1371// IBM1371 1
+
+# from to module cost
+alias IBM-1388// IBM1388//
+alias CP1388// IBM1388//
+alias CSIBM1388// IBM1388//
+module IBM1388// INTERNAL IBM1388 1
+module INTERNAL IBM1388// IBM1388 1
+
+# from to module cost
+alias IBM-1390// IBM1390//
+alias CP1390// IBM1390//
+alias CSIBM1390// IBM1390//
+module IBM1390// INTERNAL IBM1390 1
+module INTERNAL IBM1390// IBM1390 1
+
+# from to module cost
+alias IBM-1399// IBM1399//
+alias CP1399// IBM1399//
+alias CSIBM1399// IBM1399//
+module IBM1399// INTERNAL IBM1399 1
+module INTERNAL IBM1399// IBM1399 1
+
+# from to module cost
+alias ISO/TR_11548-1/ ISO_11548-1//
+alias ISO11548-1// ISO_11548-1//
+module ISO_11548-1// INTERNAL ISO_11548-1 1
+module INTERNAL ISO_11548-1// ISO_11548-1 1
+
+# from to module cost
+module MIK// INTERNAL MIK 1
+module INTERNAL MIK// MIK 1
+
+# from to module cost
+module BRF// INTERNAL BRF 1
+module INTERNAL BRF// BRF 1
+
+# from to module cost
+alias CP1282// MAC-CENTRALEUROPE//
+module MAC-CENTRALEUROPE// INTERNAL MAC-CENTRALEUROPE 1
+module INTERNAL MAC-CENTRALEUROPE// MAC-CENTRALEUROPE 1
+
+# from to module cost
+module KOI8-RU// INTERNAL KOI8-RU 1
+module INTERNAL KOI8-RU// KOI8-RU 1
+
+# from to module cost
+alias ISO_8859-9E// ISO-8859-9E//
+alias ISO8859-9E// ISO-8859-9E//
+alias ISO88599E// ISO-8859-9E//
+module ISO-8859-9E// INTERNAL ISO8859-9E 1
+module INTERNAL ISO-8859-9E// ISO8859-9E 1
diff --git a/sysroot/usr/lib/gconv/libCNS.so b/sysroot/usr/lib/gconv/libCNS.so
new file mode 100644
index 0000000..27ca91c
--- /dev/null
+++ b/sysroot/usr/lib/gconv/libCNS.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/libGB.so b/sysroot/usr/lib/gconv/libGB.so
new file mode 100644
index 0000000..b28a627
--- /dev/null
+++ b/sysroot/usr/lib/gconv/libGB.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/libISOIR165.so b/sysroot/usr/lib/gconv/libISOIR165.so
new file mode 100644
index 0000000..6e5c013
--- /dev/null
+++ b/sysroot/usr/lib/gconv/libISOIR165.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/libJIS.so b/sysroot/usr/lib/gconv/libJIS.so
new file mode 100644
index 0000000..a4bf341
--- /dev/null
+++ b/sysroot/usr/lib/gconv/libJIS.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/libJISX0213.so b/sysroot/usr/lib/gconv/libJISX0213.so
new file mode 100644
index 0000000..ca4f16a
--- /dev/null
+++ b/sysroot/usr/lib/gconv/libJISX0213.so
Binary files differ
diff --git a/sysroot/usr/lib/gconv/libKSC.so b/sysroot/usr/lib/gconv/libKSC.so
new file mode 100644
index 0000000..3eea210
--- /dev/null
+++ b/sysroot/usr/lib/gconv/libKSC.so
Binary files differ
diff --git a/sysroot/usr/lib/gcrt1.o b/sysroot/usr/lib/gcrt1.o
new file mode 100644
index 0000000..f56336f
--- /dev/null
+++ b/sysroot/usr/lib/gcrt1.o
Binary files differ
diff --git a/sysroot/usr/lib/ld-2.7.so b/sysroot/usr/lib/ld-2.7.so
new file mode 100755
index 0000000..ce715d1
--- /dev/null
+++ b/sysroot/usr/lib/ld-2.7.so
Binary files differ
diff --git a/sysroot/usr/lib/ld-linux.so.2 b/sysroot/usr/lib/ld-linux.so.2
new file mode 120000
index 0000000..ff5cf3c
--- /dev/null
+++ b/sysroot/usr/lib/ld-linux.so.2
@@ -0,0 +1 @@
+ld-2.7.so \ No newline at end of file
diff --git a/sysroot/usr/lib/libBrokenLocale-2.7.so b/sysroot/usr/lib/libBrokenLocale-2.7.so
new file mode 100644
index 0000000..7331daf
--- /dev/null
+++ b/sysroot/usr/lib/libBrokenLocale-2.7.so
Binary files differ
diff --git a/sysroot/usr/lib/libBrokenLocale.a b/sysroot/usr/lib/libBrokenLocale.a
new file mode 100644
index 0000000..4dd662b
--- /dev/null
+++ b/sysroot/usr/lib/libBrokenLocale.a
Binary files differ
diff --git a/sysroot/usr/lib/libBrokenLocale.so b/sysroot/usr/lib/libBrokenLocale.so
new file mode 120000
index 0000000..68104c3
--- /dev/null
+++ b/sysroot/usr/lib/libBrokenLocale.so
@@ -0,0 +1 @@
+libBrokenLocale.so.1 \ No newline at end of file
diff --git a/sysroot/usr/lib/libBrokenLocale.so.1 b/sysroot/usr/lib/libBrokenLocale.so.1
new file mode 120000
index 0000000..ab1eef6
--- /dev/null
+++ b/sysroot/usr/lib/libBrokenLocale.so.1
@@ -0,0 +1 @@
+libBrokenLocale-2.7.so \ No newline at end of file
diff --git a/sysroot/usr/lib/libGL.so b/sysroot/usr/lib/libGL.so
new file mode 120000
index 0000000..3cdd9c0
--- /dev/null
+++ b/sysroot/usr/lib/libGL.so
@@ -0,0 +1 @@
+libGL.so.1 \ No newline at end of file
diff --git a/sysroot/usr/lib/libGL.so.1 b/sysroot/usr/lib/libGL.so.1
new file mode 120000
index 0000000..c0ab8c3
--- /dev/null
+++ b/sysroot/usr/lib/libGL.so.1
@@ -0,0 +1 @@
+libGL.so.1.2 \ No newline at end of file
diff --git a/sysroot/usr/lib/libGL.so.1.2 b/sysroot/usr/lib/libGL.so.1.2
new file mode 100644
index 0000000..ebaa858
--- /dev/null
+++ b/sysroot/usr/lib/libGL.so.1.2
Binary files differ
diff --git a/sysroot/usr/lib/libSegFault.so b/sysroot/usr/lib/libSegFault.so
new file mode 100644
index 0000000..9a1fd8f
--- /dev/null
+++ b/sysroot/usr/lib/libSegFault.so
Binary files differ
diff --git a/sysroot/usr/lib/libX11.a b/sysroot/usr/lib/libX11.a
new file mode 100644
index 0000000..7a59db5
--- /dev/null
+++ b/sysroot/usr/lib/libX11.a
Binary files differ
diff --git a/sysroot/usr/lib/libX11.so b/sysroot/usr/lib/libX11.so
new file mode 120000
index 0000000..5263072
--- /dev/null
+++ b/sysroot/usr/lib/libX11.so
@@ -0,0 +1 @@
+libX11.so.6.2.0 \ No newline at end of file
diff --git a/sysroot/usr/lib/libX11.so.6 b/sysroot/usr/lib/libX11.so.6
new file mode 120000
index 0000000..5263072
--- /dev/null
+++ b/sysroot/usr/lib/libX11.so.6
@@ -0,0 +1 @@
+libX11.so.6.2.0 \ No newline at end of file
diff --git a/sysroot/usr/lib/libX11.so.6.2 b/sysroot/usr/lib/libX11.so.6.2
new file mode 120000
index 0000000..5263072
--- /dev/null
+++ b/sysroot/usr/lib/libX11.so.6.2
@@ -0,0 +1 @@
+libX11.so.6.2.0 \ No newline at end of file
diff --git a/sysroot/usr/lib/libX11.so.6.2.0 b/sysroot/usr/lib/libX11.so.6.2.0
new file mode 100644
index 0000000..2931d5d
--- /dev/null
+++ b/sysroot/usr/lib/libX11.so.6.2.0
Binary files differ
diff --git a/sysroot/usr/lib/libXau.so.6 b/sysroot/usr/lib/libXau.so.6
new file mode 120000
index 0000000..339636b
--- /dev/null
+++ b/sysroot/usr/lib/libXau.so.6
@@ -0,0 +1 @@
+libXau.so.6.0.0 \ No newline at end of file
diff --git a/sysroot/usr/lib/libXau.so.6.0 b/sysroot/usr/lib/libXau.so.6.0
new file mode 120000
index 0000000..339636b
--- /dev/null
+++ b/sysroot/usr/lib/libXau.so.6.0
@@ -0,0 +1 @@
+libXau.so.6.0.0 \ No newline at end of file
diff --git a/sysroot/usr/lib/libXau.so.6.0.0 b/sysroot/usr/lib/libXau.so.6.0.0
new file mode 100644
index 0000000..f6d639a
--- /dev/null
+++ b/sysroot/usr/lib/libXau.so.6.0.0
Binary files differ
diff --git a/sysroot/usr/lib/libXdamage.so.1 b/sysroot/usr/lib/libXdamage.so.1
new file mode 120000
index 0000000..a61d91e
--- /dev/null
+++ b/sysroot/usr/lib/libXdamage.so.1
@@ -0,0 +1 @@
+libXdamage.so.1.1.0 \ No newline at end of file
diff --git a/sysroot/usr/lib/libXdamage.so.1.1 b/sysroot/usr/lib/libXdamage.so.1.1
new file mode 120000
index 0000000..a61d91e
--- /dev/null
+++ b/sysroot/usr/lib/libXdamage.so.1.1
@@ -0,0 +1 @@
+libXdamage.so.1.1.0 \ No newline at end of file
diff --git a/sysroot/usr/lib/libXdamage.so.1.1.0 b/sysroot/usr/lib/libXdamage.so.1.1.0
new file mode 100644
index 0000000..47f9431
--- /dev/null
+++ b/sysroot/usr/lib/libXdamage.so.1.1.0
Binary files differ
diff --git a/sysroot/usr/lib/libXdmcp.so.6 b/sysroot/usr/lib/libXdmcp.so.6
new file mode 120000
index 0000000..bbf4646
--- /dev/null
+++ b/sysroot/usr/lib/libXdmcp.so.6
@@ -0,0 +1 @@
+libXdmcp.so.6.0.0 \ No newline at end of file
diff --git a/sysroot/usr/lib/libXdmcp.so.6.0 b/sysroot/usr/lib/libXdmcp.so.6.0
new file mode 120000
index 0000000..bbf4646
--- /dev/null
+++ b/sysroot/usr/lib/libXdmcp.so.6.0
@@ -0,0 +1 @@
+libXdmcp.so.6.0.0 \ No newline at end of file
diff --git a/sysroot/usr/lib/libXdmcp.so.6.0.0 b/sysroot/usr/lib/libXdmcp.so.6.0.0
new file mode 100644
index 0000000..16ca246
--- /dev/null
+++ b/sysroot/usr/lib/libXdmcp.so.6.0.0
Binary files differ
diff --git a/sysroot/usr/lib/libXext.so.6 b/sysroot/usr/lib/libXext.so.6
new file mode 120000
index 0000000..465f805
--- /dev/null
+++ b/sysroot/usr/lib/libXext.so.6
@@ -0,0 +1 @@
+libXext.so.6.4.0 \ No newline at end of file
diff --git a/sysroot/usr/lib/libXext.so.6.4 b/sysroot/usr/lib/libXext.so.6.4
new file mode 120000
index 0000000..465f805
--- /dev/null
+++ b/sysroot/usr/lib/libXext.so.6.4
@@ -0,0 +1 @@
+libXext.so.6.4.0 \ No newline at end of file
diff --git a/sysroot/usr/lib/libXext.so.6.4.0 b/sysroot/usr/lib/libXext.so.6.4.0
new file mode 100644
index 0000000..0d1269c
--- /dev/null
+++ b/sysroot/usr/lib/libXext.so.6.4.0
Binary files differ
diff --git a/sysroot/usr/lib/libXfixes.so.3 b/sysroot/usr/lib/libXfixes.so.3
new file mode 120000
index 0000000..927da99
--- /dev/null
+++ b/sysroot/usr/lib/libXfixes.so.3
@@ -0,0 +1 @@
+libXfixes.so.3.1.0 \ No newline at end of file
diff --git a/sysroot/usr/lib/libXfixes.so.3.1 b/sysroot/usr/lib/libXfixes.so.3.1
new file mode 120000
index 0000000..927da99
--- /dev/null
+++ b/sysroot/usr/lib/libXfixes.so.3.1
@@ -0,0 +1 @@
+libXfixes.so.3.1.0 \ No newline at end of file
diff --git a/sysroot/usr/lib/libXfixes.so.3.1.0 b/sysroot/usr/lib/libXfixes.so.3.1.0
new file mode 100644
index 0000000..1c57ebe
--- /dev/null
+++ b/sysroot/usr/lib/libXfixes.so.3.1.0
Binary files differ
diff --git a/sysroot/usr/lib/libXxf86vm.so.1 b/sysroot/usr/lib/libXxf86vm.so.1
new file mode 120000
index 0000000..e991ff9
--- /dev/null
+++ b/sysroot/usr/lib/libXxf86vm.so.1
@@ -0,0 +1 @@
+libXxf86vm.so.1.0.0 \ No newline at end of file
diff --git a/sysroot/usr/lib/libXxf86vm.so.1.0 b/sysroot/usr/lib/libXxf86vm.so.1.0
new file mode 120000
index 0000000..e991ff9
--- /dev/null
+++ b/sysroot/usr/lib/libXxf86vm.so.1.0
@@ -0,0 +1 @@
+libXxf86vm.so.1.0.0 \ No newline at end of file
diff --git a/sysroot/usr/lib/libXxf86vm.so.1.0.0 b/sysroot/usr/lib/libXxf86vm.so.1.0.0
new file mode 100644
index 0000000..65b501a
--- /dev/null
+++ b/sysroot/usr/lib/libXxf86vm.so.1.0.0
Binary files differ
diff --git a/sysroot/usr/lib/libanl-2.7.so b/sysroot/usr/lib/libanl-2.7.so
new file mode 100644
index 0000000..f829c6e
--- /dev/null
+++ b/sysroot/usr/lib/libanl-2.7.so
Binary files differ
diff --git a/sysroot/usr/lib/libanl.a b/sysroot/usr/lib/libanl.a
new file mode 100644
index 0000000..b38b1a5
--- /dev/null
+++ b/sysroot/usr/lib/libanl.a
Binary files differ
diff --git a/sysroot/usr/lib/libanl.so b/sysroot/usr/lib/libanl.so
new file mode 120000
index 0000000..4f0c4c5
--- /dev/null
+++ b/sysroot/usr/lib/libanl.so
@@ -0,0 +1 @@
+libanl.so.1 \ No newline at end of file
diff --git a/sysroot/usr/lib/libanl.so.1 b/sysroot/usr/lib/libanl.so.1
new file mode 120000
index 0000000..0dfd8ac
--- /dev/null
+++ b/sysroot/usr/lib/libanl.so.1
@@ -0,0 +1 @@
+libanl-2.7.so \ No newline at end of file
diff --git a/sysroot/usr/lib/libasound.a b/sysroot/usr/lib/libasound.a
new file mode 100644
index 0000000..abbc969
--- /dev/null
+++ b/sysroot/usr/lib/libasound.a
Binary files differ
diff --git a/sysroot/usr/lib/libasound.la b/sysroot/usr/lib/libasound.la
new file mode 100644
index 0000000..384a652
--- /dev/null
+++ b/sysroot/usr/lib/libasound.la
@@ -0,0 +1,35 @@
+# libasound.la - a libtool library file
+# Generated by ltmain.sh - GNU libtool 1.5.24 Debian 1.5.24-1 (1.1220.2.456 2007/06/24 02:25:32)
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='libasound.so.2'
+
+# Names of this library.
+library_names='libasound.so.2.0.0 libasound.so.2 libasound.so'
+
+# The name of the static archive.
+old_library='libasound.a'
+
+# Libraries that this one depends upon.
+dependency_libs=' -lm -ldl -lpthread'
+
+# Version information for libasound.
+current=2
+age=0
+revision=0
+
+# Is this an already installed library?
+installed=yes
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=no
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir='/usr/lib'
diff --git a/sysroot/usr/lib/libasound.so b/sysroot/usr/lib/libasound.so
new file mode 120000
index 0000000..42dfc99
--- /dev/null
+++ b/sysroot/usr/lib/libasound.so
@@ -0,0 +1 @@
+libasound.so.2.0.0 \ No newline at end of file
diff --git a/sysroot/usr/lib/libasound.so.2 b/sysroot/usr/lib/libasound.so.2
new file mode 120000
index 0000000..42dfc99
--- /dev/null
+++ b/sysroot/usr/lib/libasound.so.2
@@ -0,0 +1 @@
+libasound.so.2.0.0 \ No newline at end of file
diff --git a/sysroot/usr/lib/libasound.so.2.0 b/sysroot/usr/lib/libasound.so.2.0
new file mode 120000
index 0000000..42dfc99
--- /dev/null
+++ b/sysroot/usr/lib/libasound.so.2.0
@@ -0,0 +1 @@
+libasound.so.2.0.0 \ No newline at end of file
diff --git a/sysroot/usr/lib/libasound.so.2.0.0 b/sysroot/usr/lib/libasound.so.2.0.0
new file mode 100644
index 0000000..79a55ee
--- /dev/null
+++ b/sysroot/usr/lib/libasound.so.2.0.0
Binary files differ
diff --git a/sysroot/usr/lib/libaudiofile.a b/sysroot/usr/lib/libaudiofile.a
new file mode 100644
index 0000000..c9902a8
--- /dev/null
+++ b/sysroot/usr/lib/libaudiofile.a
Binary files differ
diff --git a/sysroot/usr/lib/libaudiofile.la b/sysroot/usr/lib/libaudiofile.la
new file mode 100644
index 0000000..2c6c8a9
--- /dev/null
+++ b/sysroot/usr/lib/libaudiofile.la
@@ -0,0 +1,35 @@
+# libaudiofile.la - a libtool library file
+# Generated by ltmain.sh - GNU libtool 1.5.2 (1.1220.2.60 2004/01/25 12:25:08) Debian: 192 $
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='libaudiofile.so.0'
+
+# Names of this library.
+library_names='libaudiofile.so.0.0.2 libaudiofile.so.0 libaudiofile.so'
+
+# The name of the static archive.
+old_library='libaudiofile.a'
+
+# Libraries that this one depends upon.
+dependency_libs=' -lm'
+
+# Version information for libaudiofile.
+current=0
+age=0
+revision=2
+
+# Is this an already installed library?
+installed=yes
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=no
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir='/usr/lib'
diff --git a/sysroot/usr/lib/libaudiofile.so b/sysroot/usr/lib/libaudiofile.so
new file mode 120000
index 0000000..0f44c80
--- /dev/null
+++ b/sysroot/usr/lib/libaudiofile.so
@@ -0,0 +1 @@
+libaudiofile.so.0.0.2 \ No newline at end of file
diff --git a/sysroot/usr/lib/libaudiofile.so.0.0 b/sysroot/usr/lib/libaudiofile.so.0.0
new file mode 120000
index 0000000..0f44c80
--- /dev/null
+++ b/sysroot/usr/lib/libaudiofile.so.0.0
@@ -0,0 +1 @@
+libaudiofile.so.0.0.2 \ No newline at end of file
diff --git a/sysroot/usr/lib/libbsd-compat.a b/sysroot/usr/lib/libbsd-compat.a
new file mode 100644
index 0000000..fd5188a
--- /dev/null
+++ b/sysroot/usr/lib/libbsd-compat.a
Binary files differ
diff --git a/sysroot/usr/lib/libc-2.7.so b/sysroot/usr/lib/libc-2.7.so
new file mode 100755
index 0000000..82d0d38
--- /dev/null
+++ b/sysroot/usr/lib/libc-2.7.so
Binary files differ
diff --git a/sysroot/usr/lib/libc.a b/sysroot/usr/lib/libc.a
new file mode 100644
index 0000000..f999169
--- /dev/null
+++ b/sysroot/usr/lib/libc.a
Binary files differ
diff --git a/sysroot/usr/lib/libc.so b/sysroot/usr/lib/libc.so
new file mode 100644
index 0000000..0b3082c
--- /dev/null
+++ b/sysroot/usr/lib/libc.so
@@ -0,0 +1,5 @@
+/* GNU ld script
+ Use the shared library, but some functions are only in
+ the static library, so try that secondarily. */
+OUTPUT_FORMAT(elf32-i386)
+GROUP ( libc.so.6 libc_nonshared.a AS_NEEDED ( ld-linux.so.2 ) )
diff --git a/sysroot/usr/lib/libc.so.6 b/sysroot/usr/lib/libc.so.6
new file mode 120000
index 0000000..1d77825
--- /dev/null
+++ b/sysroot/usr/lib/libc.so.6
@@ -0,0 +1 @@
+libc-2.7.so \ No newline at end of file
diff --git a/sysroot/usr/lib/libc_nonshared.a b/sysroot/usr/lib/libc_nonshared.a
new file mode 100644
index 0000000..63b9650
--- /dev/null
+++ b/sysroot/usr/lib/libc_nonshared.a
Binary files differ
diff --git a/sysroot/usr/lib/libcidn-2.7.so b/sysroot/usr/lib/libcidn-2.7.so
new file mode 100644
index 0000000..317c7e1
--- /dev/null
+++ b/sysroot/usr/lib/libcidn-2.7.so
Binary files differ
diff --git a/sysroot/usr/lib/libcidn.so b/sysroot/usr/lib/libcidn.so
new file mode 120000
index 0000000..30a01a6
--- /dev/null
+++ b/sysroot/usr/lib/libcidn.so
@@ -0,0 +1 @@
+libcidn.so.1 \ No newline at end of file
diff --git a/sysroot/usr/lib/libcidn.so.1 b/sysroot/usr/lib/libcidn.so.1
new file mode 120000
index 0000000..7cb0545
--- /dev/null
+++ b/sysroot/usr/lib/libcidn.so.1
@@ -0,0 +1 @@
+libcidn-2.7.so \ No newline at end of file
diff --git a/sysroot/usr/lib/libcrypt-2.7.so b/sysroot/usr/lib/libcrypt-2.7.so
new file mode 100644
index 0000000..6413fc5
--- /dev/null
+++ b/sysroot/usr/lib/libcrypt-2.7.so
Binary files differ
diff --git a/sysroot/usr/lib/libcrypt.a b/sysroot/usr/lib/libcrypt.a
new file mode 100644
index 0000000..c5f2782
--- /dev/null
+++ b/sysroot/usr/lib/libcrypt.a
Binary files differ
diff --git a/sysroot/usr/lib/libcrypt.so b/sysroot/usr/lib/libcrypt.so
new file mode 120000
index 0000000..3b11fff
--- /dev/null
+++ b/sysroot/usr/lib/libcrypt.so
@@ -0,0 +1 @@
+libcrypt.so.1 \ No newline at end of file
diff --git a/sysroot/usr/lib/libcrypt.so.1 b/sysroot/usr/lib/libcrypt.so.1
new file mode 120000
index 0000000..b05547f
--- /dev/null
+++ b/sysroot/usr/lib/libcrypt.so.1
@@ -0,0 +1 @@
+libcrypt-2.7.so \ No newline at end of file
diff --git a/sysroot/usr/lib/libcurses.a b/sysroot/usr/lib/libcurses.a
new file mode 120000
index 0000000..5745611
--- /dev/null
+++ b/sysroot/usr/lib/libcurses.a
@@ -0,0 +1 @@
+libncurses.a \ No newline at end of file
diff --git a/sysroot/usr/lib/libcurses.so b/sysroot/usr/lib/libcurses.so
new file mode 120000
index 0000000..67f8e61
--- /dev/null
+++ b/sysroot/usr/lib/libcurses.so
@@ -0,0 +1 @@
+libncurses.so \ No newline at end of file
diff --git a/sysroot/usr/lib/libdl-2.7.so b/sysroot/usr/lib/libdl-2.7.so
new file mode 100644
index 0000000..1d65793
--- /dev/null
+++ b/sysroot/usr/lib/libdl-2.7.so
Binary files differ
diff --git a/sysroot/usr/lib/libdl.a b/sysroot/usr/lib/libdl.a
new file mode 100644
index 0000000..12298bd
--- /dev/null
+++ b/sysroot/usr/lib/libdl.a
Binary files differ
diff --git a/sysroot/usr/lib/libdl.so b/sysroot/usr/lib/libdl.so
new file mode 120000
index 0000000..691f199
--- /dev/null
+++ b/sysroot/usr/lib/libdl.so
@@ -0,0 +1 @@
+libdl.so.2 \ No newline at end of file
diff --git a/sysroot/usr/lib/libdl.so.2 b/sysroot/usr/lib/libdl.so.2
new file mode 120000
index 0000000..23ad873
--- /dev/null
+++ b/sysroot/usr/lib/libdl.so.2
@@ -0,0 +1 @@
+libdl-2.7.so \ No newline at end of file
diff --git a/sysroot/usr/lib/libdrm.so.2 b/sysroot/usr/lib/libdrm.so.2
new file mode 120000
index 0000000..815ad9f
--- /dev/null
+++ b/sysroot/usr/lib/libdrm.so.2
@@ -0,0 +1 @@
+libdrm.so.2.3.0 \ No newline at end of file
diff --git a/sysroot/usr/lib/libdrm.so.2.3 b/sysroot/usr/lib/libdrm.so.2.3
new file mode 120000
index 0000000..815ad9f
--- /dev/null
+++ b/sysroot/usr/lib/libdrm.so.2.3
@@ -0,0 +1 @@
+libdrm.so.2.3.0 \ No newline at end of file
diff --git a/sysroot/usr/lib/libdrm.so.2.3.0 b/sysroot/usr/lib/libdrm.so.2.3.0
new file mode 100644
index 0000000..6621e10
--- /dev/null
+++ b/sysroot/usr/lib/libdrm.so.2.3.0
Binary files differ
diff --git a/sysroot/usr/lib/libesd.a b/sysroot/usr/lib/libesd.a
new file mode 100644
index 0000000..93cc525
--- /dev/null
+++ b/sysroot/usr/lib/libesd.a
Binary files differ
diff --git a/sysroot/usr/lib/libesd.la b/sysroot/usr/lib/libesd.la
new file mode 100644
index 0000000..4f10a7a
--- /dev/null
+++ b/sysroot/usr/lib/libesd.la
@@ -0,0 +1,35 @@
+# libesd.la - a libtool library file
+# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='libesd.so.0'
+
+# Names of this library.
+library_names='libesd.so.0.2.38 libesd.so.0 libesd.so'
+
+# The name of the static archive.
+old_library='libesd.a'
+
+# Libraries that this one depends upon.
+dependency_libs=' /usr/lib/libaudiofile.la -lm'
+
+# Version information for libesd.
+current=2
+age=2
+revision=38
+
+# Is this an already installed library?
+installed=yes
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=no
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir='/usr/lib'
diff --git a/sysroot/usr/lib/libesd.so b/sysroot/usr/lib/libesd.so
new file mode 120000
index 0000000..d57b14b
--- /dev/null
+++ b/sysroot/usr/lib/libesd.so
@@ -0,0 +1 @@
+libesd.so.0.2.38 \ No newline at end of file
diff --git a/sysroot/usr/lib/libesd.so.0 b/sysroot/usr/lib/libesd.so.0
new file mode 120000
index 0000000..d57b14b
--- /dev/null
+++ b/sysroot/usr/lib/libesd.so.0
@@ -0,0 +1 @@
+libesd.so.0.2.38 \ No newline at end of file
diff --git a/sysroot/usr/lib/libesd.so.0.2 b/sysroot/usr/lib/libesd.so.0.2
new file mode 120000
index 0000000..d57b14b
--- /dev/null
+++ b/sysroot/usr/lib/libesd.so.0.2
@@ -0,0 +1 @@
+libesd.so.0.2.38 \ No newline at end of file
diff --git a/sysroot/usr/lib/libesd.so.0.2.38 b/sysroot/usr/lib/libesd.so.0.2.38
new file mode 100644
index 0000000..a7c8c55
--- /dev/null
+++ b/sysroot/usr/lib/libesd.so.0.2.38
Binary files differ
diff --git a/sysroot/usr/lib/libform.a b/sysroot/usr/lib/libform.a
new file mode 100644
index 0000000..789d40f
--- /dev/null
+++ b/sysroot/usr/lib/libform.a
Binary files differ
diff --git a/sysroot/usr/lib/libform.so b/sysroot/usr/lib/libform.so
new file mode 120000
index 0000000..10e9169
--- /dev/null
+++ b/sysroot/usr/lib/libform.so
@@ -0,0 +1 @@
+libform.so.5 \ No newline at end of file
diff --git a/sysroot/usr/lib/libform.so.5 b/sysroot/usr/lib/libform.so.5
new file mode 120000
index 0000000..4a80f6b
--- /dev/null
+++ b/sysroot/usr/lib/libform.so.5
@@ -0,0 +1 @@
+libform.so.5.6 \ No newline at end of file
diff --git a/sysroot/usr/lib/libform.so.5.6 b/sysroot/usr/lib/libform.so.5.6
new file mode 100644
index 0000000..6ef6c6f
--- /dev/null
+++ b/sysroot/usr/lib/libform.so.5.6
Binary files differ
diff --git a/sysroot/usr/lib/libg.a b/sysroot/usr/lib/libg.a
new file mode 100644
index 0000000..fd5188a
--- /dev/null
+++ b/sysroot/usr/lib/libg.a
Binary files differ
diff --git a/sysroot/usr/lib/libieee.a b/sysroot/usr/lib/libieee.a
new file mode 100644
index 0000000..6ab4488
--- /dev/null
+++ b/sysroot/usr/lib/libieee.a
Binary files differ
diff --git a/sysroot/usr/lib/libm-2.7.so b/sysroot/usr/lib/libm-2.7.so
new file mode 100644
index 0000000..a1fe2db
--- /dev/null
+++ b/sysroot/usr/lib/libm-2.7.so
Binary files differ
diff --git a/sysroot/usr/lib/libm.a b/sysroot/usr/lib/libm.a
new file mode 100644
index 0000000..171bf70
--- /dev/null
+++ b/sysroot/usr/lib/libm.a
Binary files differ
diff --git a/sysroot/usr/lib/libm.so b/sysroot/usr/lib/libm.so
new file mode 120000
index 0000000..c60797d
--- /dev/null
+++ b/sysroot/usr/lib/libm.so
@@ -0,0 +1 @@
+libm.so.6 \ No newline at end of file
diff --git a/sysroot/usr/lib/libm.so.6 b/sysroot/usr/lib/libm.so.6
new file mode 120000
index 0000000..95262a9
--- /dev/null
+++ b/sysroot/usr/lib/libm.so.6
@@ -0,0 +1 @@
+libm-2.7.so \ No newline at end of file
diff --git a/sysroot/usr/lib/libmcheck.a b/sysroot/usr/lib/libmcheck.a
new file mode 100644
index 0000000..c9b93f4
--- /dev/null
+++ b/sysroot/usr/lib/libmcheck.a
Binary files differ
diff --git a/sysroot/usr/lib/libmemusage.so b/sysroot/usr/lib/libmemusage.so
new file mode 100644
index 0000000..86be0d0
--- /dev/null
+++ b/sysroot/usr/lib/libmemusage.so
Binary files differ
diff --git a/sysroot/usr/lib/libmenu.a b/sysroot/usr/lib/libmenu.a
new file mode 100644
index 0000000..1ac7f27
--- /dev/null
+++ b/sysroot/usr/lib/libmenu.a
Binary files differ
diff --git a/sysroot/usr/lib/libmenu.so b/sysroot/usr/lib/libmenu.so
new file mode 120000
index 0000000..b12b5cf
--- /dev/null
+++ b/sysroot/usr/lib/libmenu.so
@@ -0,0 +1 @@
+libmenu.so.5 \ No newline at end of file
diff --git a/sysroot/usr/lib/libmenu.so.5 b/sysroot/usr/lib/libmenu.so.5
new file mode 120000
index 0000000..869f4a5
--- /dev/null
+++ b/sysroot/usr/lib/libmenu.so.5
@@ -0,0 +1 @@
+libmenu.so.5.6 \ No newline at end of file
diff --git a/sysroot/usr/lib/libmenu.so.5.6 b/sysroot/usr/lib/libmenu.so.5.6
new file mode 100644
index 0000000..3d878c8
--- /dev/null
+++ b/sysroot/usr/lib/libmenu.so.5.6
Binary files differ
diff --git a/sysroot/usr/lib/libncurses++.a b/sysroot/usr/lib/libncurses++.a
new file mode 100644
index 0000000..020e48b
--- /dev/null
+++ b/sysroot/usr/lib/libncurses++.a
Binary files differ
diff --git a/sysroot/usr/lib/libncurses.a b/sysroot/usr/lib/libncurses.a
new file mode 100644
index 0000000..a90285d
--- /dev/null
+++ b/sysroot/usr/lib/libncurses.a
Binary files differ
diff --git a/sysroot/usr/lib/libncurses.so b/sysroot/usr/lib/libncurses.so
new file mode 120000
index 0000000..7257b6a
--- /dev/null
+++ b/sysroot/usr/lib/libncurses.so
@@ -0,0 +1 @@
+libncurses.so.5 \ No newline at end of file
diff --git a/sysroot/usr/lib/libncurses.so.5 b/sysroot/usr/lib/libncurses.so.5
new file mode 120000
index 0000000..c7b1e02
--- /dev/null
+++ b/sysroot/usr/lib/libncurses.so.5
@@ -0,0 +1 @@
+libncurses.so.5.6 \ No newline at end of file
diff --git a/sysroot/usr/lib/libncurses.so.5.6 b/sysroot/usr/lib/libncurses.so.5.6
new file mode 100644
index 0000000..7ab1053
--- /dev/null
+++ b/sysroot/usr/lib/libncurses.so.5.6
Binary files differ
diff --git a/sysroot/usr/lib/libnsl-2.7.so b/sysroot/usr/lib/libnsl-2.7.so
new file mode 100644
index 0000000..c9e93db
--- /dev/null
+++ b/sysroot/usr/lib/libnsl-2.7.so
Binary files differ
diff --git a/sysroot/usr/lib/libnsl.a b/sysroot/usr/lib/libnsl.a
new file mode 100644
index 0000000..5077f58
--- /dev/null
+++ b/sysroot/usr/lib/libnsl.a
Binary files differ
diff --git a/sysroot/usr/lib/libnsl.so b/sysroot/usr/lib/libnsl.so
new file mode 120000
index 0000000..28d16d9
--- /dev/null
+++ b/sysroot/usr/lib/libnsl.so
@@ -0,0 +1 @@
+libnsl.so.1 \ No newline at end of file
diff --git a/sysroot/usr/lib/libnsl.so.1 b/sysroot/usr/lib/libnsl.so.1
new file mode 120000
index 0000000..5954dfd
--- /dev/null
+++ b/sysroot/usr/lib/libnsl.so.1
@@ -0,0 +1 @@
+libnsl-2.7.so \ No newline at end of file
diff --git a/sysroot/usr/lib/libnss_compat-2.7.so b/sysroot/usr/lib/libnss_compat-2.7.so
new file mode 100644
index 0000000..cc40c77
--- /dev/null
+++ b/sysroot/usr/lib/libnss_compat-2.7.so
Binary files differ
diff --git a/sysroot/usr/lib/libnss_compat.so b/sysroot/usr/lib/libnss_compat.so
new file mode 120000
index 0000000..b0fa17f
--- /dev/null
+++ b/sysroot/usr/lib/libnss_compat.so
@@ -0,0 +1 @@
+libnss_compat.so.2 \ No newline at end of file
diff --git a/sysroot/usr/lib/libnss_compat.so.2 b/sysroot/usr/lib/libnss_compat.so.2
new file mode 120000
index 0000000..419dee4
--- /dev/null
+++ b/sysroot/usr/lib/libnss_compat.so.2
@@ -0,0 +1 @@
+libnss_compat-2.7.so \ No newline at end of file
diff --git a/sysroot/usr/lib/libnss_dns-2.7.so b/sysroot/usr/lib/libnss_dns-2.7.so
new file mode 100644
index 0000000..cfde264
--- /dev/null
+++ b/sysroot/usr/lib/libnss_dns-2.7.so
Binary files differ
diff --git a/sysroot/usr/lib/libnss_dns.so b/sysroot/usr/lib/libnss_dns.so
new file mode 120000
index 0000000..7d7a168
--- /dev/null
+++ b/sysroot/usr/lib/libnss_dns.so
@@ -0,0 +1 @@
+libnss_dns.so.2 \ No newline at end of file
diff --git a/sysroot/usr/lib/libnss_dns.so.2 b/sysroot/usr/lib/libnss_dns.so.2
new file mode 120000
index 0000000..575e7c3
--- /dev/null
+++ b/sysroot/usr/lib/libnss_dns.so.2
@@ -0,0 +1 @@
+libnss_dns-2.7.so \ No newline at end of file
diff --git a/sysroot/usr/lib/libnss_files-2.7.so b/sysroot/usr/lib/libnss_files-2.7.so
new file mode 100644
index 0000000..240a8c3
--- /dev/null
+++ b/sysroot/usr/lib/libnss_files-2.7.so
Binary files differ
diff --git a/sysroot/usr/lib/libnss_files.so b/sysroot/usr/lib/libnss_files.so
new file mode 120000
index 0000000..2b9e398
--- /dev/null
+++ b/sysroot/usr/lib/libnss_files.so
@@ -0,0 +1 @@
+libnss_files.so.2 \ No newline at end of file
diff --git a/sysroot/usr/lib/libnss_files.so.2 b/sysroot/usr/lib/libnss_files.so.2
new file mode 120000
index 0000000..8d016cc
--- /dev/null
+++ b/sysroot/usr/lib/libnss_files.so.2
@@ -0,0 +1 @@
+libnss_files-2.7.so \ No newline at end of file
diff --git a/sysroot/usr/lib/libnss_hesiod-2.7.so b/sysroot/usr/lib/libnss_hesiod-2.7.so
new file mode 100644
index 0000000..17e66d5
--- /dev/null
+++ b/sysroot/usr/lib/libnss_hesiod-2.7.so
Binary files differ
diff --git a/sysroot/usr/lib/libnss_hesiod.so b/sysroot/usr/lib/libnss_hesiod.so
new file mode 120000
index 0000000..fd7f174
--- /dev/null
+++ b/sysroot/usr/lib/libnss_hesiod.so
@@ -0,0 +1 @@
+libnss_hesiod.so.2 \ No newline at end of file
diff --git a/sysroot/usr/lib/libnss_hesiod.so.2 b/sysroot/usr/lib/libnss_hesiod.so.2
new file mode 120000
index 0000000..2fa7b5c
--- /dev/null
+++ b/sysroot/usr/lib/libnss_hesiod.so.2
@@ -0,0 +1 @@
+libnss_hesiod-2.7.so \ No newline at end of file
diff --git a/sysroot/usr/lib/libnss_nis-2.7.so b/sysroot/usr/lib/libnss_nis-2.7.so
new file mode 100644
index 0000000..47bcb40
--- /dev/null
+++ b/sysroot/usr/lib/libnss_nis-2.7.so
Binary files differ
diff --git a/sysroot/usr/lib/libnss_nis.so b/sysroot/usr/lib/libnss_nis.so
new file mode 120000
index 0000000..a403652
--- /dev/null
+++ b/sysroot/usr/lib/libnss_nis.so
@@ -0,0 +1 @@
+libnss_nis.so.2 \ No newline at end of file
diff --git a/sysroot/usr/lib/libnss_nis.so.2 b/sysroot/usr/lib/libnss_nis.so.2
new file mode 120000
index 0000000..20a19a1
--- /dev/null
+++ b/sysroot/usr/lib/libnss_nis.so.2
@@ -0,0 +1 @@
+libnss_nis-2.7.so \ No newline at end of file
diff --git a/sysroot/usr/lib/libnss_nisplus-2.7.so b/sysroot/usr/lib/libnss_nisplus-2.7.so
new file mode 100644
index 0000000..7653681
--- /dev/null
+++ b/sysroot/usr/lib/libnss_nisplus-2.7.so
Binary files differ
diff --git a/sysroot/usr/lib/libnss_nisplus.so b/sysroot/usr/lib/libnss_nisplus.so
new file mode 120000
index 0000000..ba618f1
--- /dev/null
+++ b/sysroot/usr/lib/libnss_nisplus.so
@@ -0,0 +1 @@
+libnss_nisplus.so.2 \ No newline at end of file
diff --git a/sysroot/usr/lib/libnss_nisplus.so.2 b/sysroot/usr/lib/libnss_nisplus.so.2
new file mode 120000
index 0000000..093b3cb
--- /dev/null
+++ b/sysroot/usr/lib/libnss_nisplus.so.2
@@ -0,0 +1 @@
+libnss_nisplus-2.7.so \ No newline at end of file
diff --git a/sysroot/usr/lib/libpanel.a b/sysroot/usr/lib/libpanel.a
new file mode 100644
index 0000000..13f1b7c
--- /dev/null
+++ b/sysroot/usr/lib/libpanel.a
Binary files differ
diff --git a/sysroot/usr/lib/libpanel.so b/sysroot/usr/lib/libpanel.so
new file mode 120000
index 0000000..b5cd4a7
--- /dev/null
+++ b/sysroot/usr/lib/libpanel.so
@@ -0,0 +1 @@
+libpanel.so.5 \ No newline at end of file
diff --git a/sysroot/usr/lib/libpanel.so.5 b/sysroot/usr/lib/libpanel.so.5
new file mode 120000
index 0000000..ff2e80a
--- /dev/null
+++ b/sysroot/usr/lib/libpanel.so.5
@@ -0,0 +1 @@
+libpanel.so.5.6 \ No newline at end of file
diff --git a/sysroot/usr/lib/libpanel.so.5.6 b/sysroot/usr/lib/libpanel.so.5.6
new file mode 100644
index 0000000..471cb20
--- /dev/null
+++ b/sysroot/usr/lib/libpanel.so.5.6
Binary files differ
diff --git a/sysroot/usr/lib/libpcprofile.so b/sysroot/usr/lib/libpcprofile.so
new file mode 100644
index 0000000..7437064
--- /dev/null
+++ b/sysroot/usr/lib/libpcprofile.so
Binary files differ
diff --git a/sysroot/usr/lib/libpthread-2.7.so b/sysroot/usr/lib/libpthread-2.7.so
new file mode 100755
index 0000000..3b20bd4
--- /dev/null
+++ b/sysroot/usr/lib/libpthread-2.7.so
Binary files differ
diff --git a/sysroot/usr/lib/libpthread.a b/sysroot/usr/lib/libpthread.a
new file mode 100644
index 0000000..7cff40c
--- /dev/null
+++ b/sysroot/usr/lib/libpthread.a
Binary files differ
diff --git a/sysroot/usr/lib/libpthread.so b/sysroot/usr/lib/libpthread.so
new file mode 100644
index 0000000..e8d7c93
--- /dev/null
+++ b/sysroot/usr/lib/libpthread.so
@@ -0,0 +1,5 @@
+/* GNU ld script
+ Use the shared library, but some functions are only in
+ the static library, so try that secondarily. */
+OUTPUT_FORMAT(elf32-i386)
+GROUP ( libpthread.so.0 libpthread_nonshared.a )
diff --git a/sysroot/usr/lib/libpthread.so.0 b/sysroot/usr/lib/libpthread.so.0
new file mode 120000
index 0000000..acd5853
--- /dev/null
+++ b/sysroot/usr/lib/libpthread.so.0
@@ -0,0 +1 @@
+libpthread-2.7.so \ No newline at end of file
diff --git a/sysroot/usr/lib/libpthread_nonshared.a b/sysroot/usr/lib/libpthread_nonshared.a
new file mode 100644
index 0000000..411e829
--- /dev/null
+++ b/sysroot/usr/lib/libpthread_nonshared.a
Binary files differ
diff --git a/sysroot/usr/lib/libpulse-browse.a b/sysroot/usr/lib/libpulse-browse.a
new file mode 100644
index 0000000..28c3034
--- /dev/null
+++ b/sysroot/usr/lib/libpulse-browse.a
Binary files differ
diff --git a/sysroot/usr/lib/libpulse-browse.so b/sysroot/usr/lib/libpulse-browse.so
new file mode 120000
index 0000000..97411b3
--- /dev/null
+++ b/sysroot/usr/lib/libpulse-browse.so
@@ -0,0 +1 @@
+libpulse-browse.so.0.1.1 \ No newline at end of file
diff --git a/sysroot/usr/lib/libpulse-browse.so.0.1 b/sysroot/usr/lib/libpulse-browse.so.0.1
new file mode 120000
index 0000000..97411b3
--- /dev/null
+++ b/sysroot/usr/lib/libpulse-browse.so.0.1
@@ -0,0 +1 @@
+libpulse-browse.so.0.1.1 \ No newline at end of file
diff --git a/sysroot/usr/lib/libpulse-mainloop-glib.a b/sysroot/usr/lib/libpulse-mainloop-glib.a
new file mode 100644
index 0000000..e83cc45
--- /dev/null
+++ b/sysroot/usr/lib/libpulse-mainloop-glib.a
Binary files differ
diff --git a/sysroot/usr/lib/libpulse-mainloop-glib.so b/sysroot/usr/lib/libpulse-mainloop-glib.so
new file mode 120000
index 0000000..5d56760
--- /dev/null
+++ b/sysroot/usr/lib/libpulse-mainloop-glib.so
@@ -0,0 +1 @@
+libpulse-mainloop-glib.so.0.0.3 \ No newline at end of file
diff --git a/sysroot/usr/lib/libpulse-mainloop-glib.so.0.0 b/sysroot/usr/lib/libpulse-mainloop-glib.so.0.0
new file mode 120000
index 0000000..5d56760
--- /dev/null
+++ b/sysroot/usr/lib/libpulse-mainloop-glib.so.0.0
@@ -0,0 +1 @@
+libpulse-mainloop-glib.so.0.0.3 \ No newline at end of file
diff --git a/sysroot/usr/lib/libpulse-simple.a b/sysroot/usr/lib/libpulse-simple.a
new file mode 100644
index 0000000..83c42b7
--- /dev/null
+++ b/sysroot/usr/lib/libpulse-simple.a
Binary files differ
diff --git a/sysroot/usr/lib/libpulse-simple.so b/sysroot/usr/lib/libpulse-simple.so
new file mode 120000
index 0000000..d07b4c0
--- /dev/null
+++ b/sysroot/usr/lib/libpulse-simple.so
@@ -0,0 +1 @@
+libpulse-simple.so.0.0.1 \ No newline at end of file
diff --git a/sysroot/usr/lib/libpulse-simple.so.0 b/sysroot/usr/lib/libpulse-simple.so.0
new file mode 120000
index 0000000..d07b4c0
--- /dev/null
+++ b/sysroot/usr/lib/libpulse-simple.so.0
@@ -0,0 +1 @@
+libpulse-simple.so.0.0.1 \ No newline at end of file
diff --git a/sysroot/usr/lib/libpulse-simple.so.0.0 b/sysroot/usr/lib/libpulse-simple.so.0.0
new file mode 120000
index 0000000..d07b4c0
--- /dev/null
+++ b/sysroot/usr/lib/libpulse-simple.so.0.0
@@ -0,0 +1 @@
+libpulse-simple.so.0.0.1 \ No newline at end of file
diff --git a/sysroot/usr/lib/libpulse-simple.so.0.0.1 b/sysroot/usr/lib/libpulse-simple.so.0.0.1
new file mode 100644
index 0000000..7f19b70
--- /dev/null
+++ b/sysroot/usr/lib/libpulse-simple.so.0.0.1
Binary files differ
diff --git a/sysroot/usr/lib/libpulse.a b/sysroot/usr/lib/libpulse.a
new file mode 100644
index 0000000..04f31c5
--- /dev/null
+++ b/sysroot/usr/lib/libpulse.a
Binary files differ
diff --git a/sysroot/usr/lib/libpulse.so b/sysroot/usr/lib/libpulse.so
new file mode 120000
index 0000000..b53c962
--- /dev/null
+++ b/sysroot/usr/lib/libpulse.so
@@ -0,0 +1 @@
+libpulse.so.0.4.1 \ No newline at end of file
diff --git a/sysroot/usr/lib/libpulse.so.0 b/sysroot/usr/lib/libpulse.so.0
new file mode 120000
index 0000000..b53c962
--- /dev/null
+++ b/sysroot/usr/lib/libpulse.so.0
@@ -0,0 +1 @@
+libpulse.so.0.4.1 \ No newline at end of file
diff --git a/sysroot/usr/lib/libpulse.so.0.4 b/sysroot/usr/lib/libpulse.so.0.4
new file mode 120000
index 0000000..b53c962
--- /dev/null
+++ b/sysroot/usr/lib/libpulse.so.0.4
@@ -0,0 +1 @@
+libpulse.so.0.4.1 \ No newline at end of file
diff --git a/sysroot/usr/lib/libpulse.so.0.4.1 b/sysroot/usr/lib/libpulse.so.0.4.1
new file mode 100644
index 0000000..6f013bb
--- /dev/null
+++ b/sysroot/usr/lib/libpulse.so.0.4.1
Binary files differ
diff --git a/sysroot/usr/lib/libresolv-2.7.so b/sysroot/usr/lib/libresolv-2.7.so
new file mode 100644
index 0000000..4218185
--- /dev/null
+++ b/sysroot/usr/lib/libresolv-2.7.so
Binary files differ
diff --git a/sysroot/usr/lib/libresolv.a b/sysroot/usr/lib/libresolv.a
new file mode 100644
index 0000000..def5781
--- /dev/null
+++ b/sysroot/usr/lib/libresolv.a
Binary files differ
diff --git a/sysroot/usr/lib/libresolv.so b/sysroot/usr/lib/libresolv.so
new file mode 120000
index 0000000..bf6c17f
--- /dev/null
+++ b/sysroot/usr/lib/libresolv.so
@@ -0,0 +1 @@
+libresolv.so.2 \ No newline at end of file
diff --git a/sysroot/usr/lib/libresolv.so.2 b/sysroot/usr/lib/libresolv.so.2
new file mode 120000
index 0000000..e6bef56
--- /dev/null
+++ b/sysroot/usr/lib/libresolv.so.2
@@ -0,0 +1 @@
+libresolv-2.7.so \ No newline at end of file
diff --git a/sysroot/usr/lib/librpcsvc.a b/sysroot/usr/lib/librpcsvc.a
new file mode 100644
index 0000000..6460448
--- /dev/null
+++ b/sysroot/usr/lib/librpcsvc.a
Binary files differ
diff --git a/sysroot/usr/lib/librt-2.7.so b/sysroot/usr/lib/librt-2.7.so
new file mode 100644
index 0000000..55cebce
--- /dev/null
+++ b/sysroot/usr/lib/librt-2.7.so
Binary files differ
diff --git a/sysroot/usr/lib/librt.a b/sysroot/usr/lib/librt.a
new file mode 100644
index 0000000..ee21268
--- /dev/null
+++ b/sysroot/usr/lib/librt.a
Binary files differ
diff --git a/sysroot/usr/lib/librt.so b/sysroot/usr/lib/librt.so
new file mode 120000
index 0000000..0820df4
--- /dev/null
+++ b/sysroot/usr/lib/librt.so
@@ -0,0 +1 @@
+librt.so.1 \ No newline at end of file
diff --git a/sysroot/usr/lib/librt.so.1 b/sysroot/usr/lib/librt.so.1
new file mode 120000
index 0000000..2d7e900
--- /dev/null
+++ b/sysroot/usr/lib/librt.so.1
@@ -0,0 +1 @@
+librt-2.7.so \ No newline at end of file
diff --git a/sysroot/usr/lib/libtermcap.a b/sysroot/usr/lib/libtermcap.a
new file mode 120000
index 0000000..5745611
--- /dev/null
+++ b/sysroot/usr/lib/libtermcap.a
@@ -0,0 +1 @@
+libncurses.a \ No newline at end of file
diff --git a/sysroot/usr/lib/libtermcap.so b/sysroot/usr/lib/libtermcap.so
new file mode 120000
index 0000000..67f8e61
--- /dev/null
+++ b/sysroot/usr/lib/libtermcap.so
@@ -0,0 +1 @@
+libncurses.so \ No newline at end of file
diff --git a/sysroot/usr/lib/libthread_db-1.0.so b/sysroot/usr/lib/libthread_db-1.0.so
new file mode 100644
index 0000000..66eb41a
--- /dev/null
+++ b/sysroot/usr/lib/libthread_db-1.0.so
Binary files differ
diff --git a/sysroot/usr/lib/libthread_db.so b/sysroot/usr/lib/libthread_db.so
new file mode 120000
index 0000000..3919454
--- /dev/null
+++ b/sysroot/usr/lib/libthread_db.so
@@ -0,0 +1 @@
+libthread_db.so.1 \ No newline at end of file
diff --git a/sysroot/usr/lib/libthread_db.so.1 b/sysroot/usr/lib/libthread_db.so.1
new file mode 120000
index 0000000..bc52514
--- /dev/null
+++ b/sysroot/usr/lib/libthread_db.so.1
@@ -0,0 +1 @@
+libthread_db-1.0.so \ No newline at end of file
diff --git a/sysroot/usr/lib/libtic.a b/sysroot/usr/lib/libtic.a
new file mode 100644
index 0000000..5d1d588
--- /dev/null
+++ b/sysroot/usr/lib/libtic.a
Binary files differ
diff --git a/sysroot/usr/lib/libtic.so b/sysroot/usr/lib/libtic.so
new file mode 120000
index 0000000..b28c55b
--- /dev/null
+++ b/sysroot/usr/lib/libtic.so
@@ -0,0 +1 @@
+libtic.so.5 \ No newline at end of file
diff --git a/sysroot/usr/lib/libtic.so.5 b/sysroot/usr/lib/libtic.so.5
new file mode 120000
index 0000000..ac03314
--- /dev/null
+++ b/sysroot/usr/lib/libtic.so.5
@@ -0,0 +1 @@
+libtic.so.5.6 \ No newline at end of file
diff --git a/sysroot/usr/lib/libtic.so.5.6 b/sysroot/usr/lib/libtic.so.5.6
new file mode 100644
index 0000000..9e8575a
--- /dev/null
+++ b/sysroot/usr/lib/libtic.so.5.6
Binary files differ
diff --git a/sysroot/usr/lib/libutil-2.7.so b/sysroot/usr/lib/libutil-2.7.so
new file mode 100644
index 0000000..316b767
--- /dev/null
+++ b/sysroot/usr/lib/libutil-2.7.so
Binary files differ
diff --git a/sysroot/usr/lib/libutil.a b/sysroot/usr/lib/libutil.a
new file mode 100644
index 0000000..61ecc04
--- /dev/null
+++ b/sysroot/usr/lib/libutil.a
Binary files differ
diff --git a/sysroot/usr/lib/libutil.so b/sysroot/usr/lib/libutil.so
new file mode 120000
index 0000000..b3af646
--- /dev/null
+++ b/sysroot/usr/lib/libutil.so
@@ -0,0 +1 @@
+libutil.so.1 \ No newline at end of file
diff --git a/sysroot/usr/lib/libutil.so.1 b/sysroot/usr/lib/libutil.so.1
new file mode 120000
index 0000000..7aad231
--- /dev/null
+++ b/sysroot/usr/lib/libutil.so.1
@@ -0,0 +1 @@
+libutil-2.7.so \ No newline at end of file
diff --git a/sysroot/usr/lib/libxcb-xlib.so.0 b/sysroot/usr/lib/libxcb-xlib.so.0
new file mode 120000
index 0000000..f70377c
--- /dev/null
+++ b/sysroot/usr/lib/libxcb-xlib.so.0
@@ -0,0 +1 @@
+libxcb-xlib.so.0.0.0 \ No newline at end of file
diff --git a/sysroot/usr/lib/libxcb-xlib.so.0.0 b/sysroot/usr/lib/libxcb-xlib.so.0.0
new file mode 120000
index 0000000..f70377c
--- /dev/null
+++ b/sysroot/usr/lib/libxcb-xlib.so.0.0
@@ -0,0 +1 @@
+libxcb-xlib.so.0.0.0 \ No newline at end of file
diff --git a/sysroot/usr/lib/libxcb-xlib.so.0.0.0 b/sysroot/usr/lib/libxcb-xlib.so.0.0.0
new file mode 100644
index 0000000..185540b
--- /dev/null
+++ b/sysroot/usr/lib/libxcb-xlib.so.0.0.0
Binary files differ
diff --git a/sysroot/usr/lib/libxcb.so.1 b/sysroot/usr/lib/libxcb.so.1
new file mode 120000
index 0000000..076f67e
--- /dev/null
+++ b/sysroot/usr/lib/libxcb.so.1
@@ -0,0 +1 @@
+libxcb.so.1.0.0 \ No newline at end of file
diff --git a/sysroot/usr/lib/libxcb.so.1.0 b/sysroot/usr/lib/libxcb.so.1.0
new file mode 120000
index 0000000..076f67e
--- /dev/null
+++ b/sysroot/usr/lib/libxcb.so.1.0
@@ -0,0 +1 @@
+libxcb.so.1.0.0 \ No newline at end of file
diff --git a/sysroot/usr/lib/libxcb.so.1.0.0 b/sysroot/usr/lib/libxcb.so.1.0.0
new file mode 100644
index 0000000..bc66171
--- /dev/null
+++ b/sysroot/usr/lib/libxcb.so.1.0.0
Binary files differ
diff --git a/sysroot/usr/lib/libz.a b/sysroot/usr/lib/libz.a
new file mode 100644
index 0000000..59efb72
--- /dev/null
+++ b/sysroot/usr/lib/libz.a
Binary files differ
diff --git a/sysroot/usr/lib/libz.so b/sysroot/usr/lib/libz.so
new file mode 120000
index 0000000..127db36
--- /dev/null
+++ b/sysroot/usr/lib/libz.so
@@ -0,0 +1 @@
+libz.so.1.2.3.3 \ No newline at end of file
diff --git a/sysroot/usr/lib/libz.so.1 b/sysroot/usr/lib/libz.so.1
new file mode 120000
index 0000000..127db36
--- /dev/null
+++ b/sysroot/usr/lib/libz.so.1
@@ -0,0 +1 @@
+libz.so.1.2.3.3 \ No newline at end of file
diff --git a/sysroot/usr/lib/libz.so.1.2.3 b/sysroot/usr/lib/libz.so.1.2.3
new file mode 120000
index 0000000..127db36
--- /dev/null
+++ b/sysroot/usr/lib/libz.so.1.2.3
@@ -0,0 +1 @@
+libz.so.1.2.3.3 \ No newline at end of file
diff --git a/sysroot/usr/lib/libz.so.1.2.3.3 b/sysroot/usr/lib/libz.so.1.2.3.3
new file mode 100644
index 0000000..1711f99
--- /dev/null
+++ b/sysroot/usr/lib/libz.so.1.2.3.3
Binary files differ
diff --git a/sysroot/usr/lib/pkgconfig/alsa.pc b/sysroot/usr/lib/pkgconfig/alsa.pc
new file mode 100644
index 0000000..7fb195e
--- /dev/null
+++ b/sysroot/usr/lib/pkgconfig/alsa.pc
@@ -0,0 +1,14 @@
+prefix=/usr
+exec_prefix=/usr
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: alsa
+Description: Advanced Linux Sound Architecture (ALSA) - Library
+Version: 1.0.15
+Requires:
+Libs: -L${libdir} -lasound
+Libs.private: -lm -ldl -lpthread
+# -I${includedir}/alsa below is just for backward compatibility
+# (it was set so mistakely in the older version)
+Cflags: -I${includedir} -I${includedir}/alsa
diff --git a/sysroot/usr/lib/pkgconfig/audiofile.pc b/sysroot/usr/lib/pkgconfig/audiofile.pc
new file mode 100644
index 0000000..851e45a
--- /dev/null
+++ b/sysroot/usr/lib/pkgconfig/audiofile.pc
@@ -0,0 +1,12 @@
+prefix=/usr
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: audiofile
+Description: audiofile
+Requires:
+Version: 0.2.6
+Libs: -L${libdir} -laudiofile
+Libs.private: -lm
+Cflags: -I${includedir}
diff --git a/sysroot/usr/lib/pkgconfig/esound.pc b/sysroot/usr/lib/pkgconfig/esound.pc
new file mode 100644
index 0000000..81b84da
--- /dev/null
+++ b/sysroot/usr/lib/pkgconfig/esound.pc
@@ -0,0 +1,12 @@
+prefix=/usr
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+esd_serverdir=${prefix}/bin
+
+Name: esound
+Description: esound
+Requires: audiofile
+Version: 0.2.38
+Libs: -L${libdir} -lesd
+Cflags: -I${includedir}
diff --git a/sysroot/usr/lib/pkgconfig/inputproto.pc b/sysroot/usr/lib/pkgconfig/inputproto.pc
new file mode 100644
index 0000000..514657f
--- /dev/null
+++ b/sysroot/usr/lib/pkgconfig/inputproto.pc
@@ -0,0 +1,9 @@
+prefix=/usr
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: InputProto
+Description: Input extension headers
+Version: 1.4.2
+Cflags: -I${includedir}
diff --git a/sysroot/usr/lib/pkgconfig/kbproto.pc b/sysroot/usr/lib/pkgconfig/kbproto.pc
new file mode 100644
index 0000000..7ce28ed
--- /dev/null
+++ b/sysroot/usr/lib/pkgconfig/kbproto.pc
@@ -0,0 +1,9 @@
+prefix=/usr
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: KBProto
+Description: KB extension headers
+Version: 1.0.3
+Cflags: -I${includedir}
diff --git a/sysroot/usr/lib/pkgconfig/libpulse-browse.pc b/sysroot/usr/lib/pkgconfig/libpulse-browse.pc
new file mode 100644
index 0000000..ed49cd5
--- /dev/null
+++ b/sysroot/usr/lib/pkgconfig/libpulse-browse.pc
@@ -0,0 +1,11 @@
+prefix=/usr
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: libpulse-browse
+Description: PulseAudio Network Browsing API
+Version: 0.9.10
+Libs: -L${libdir} -lpulse-browse
+Cflags: -D_REENTRANT -I${includedir}
+Requires: libpulse
diff --git a/sysroot/usr/lib/pkgconfig/libpulse-mainloop-glib.pc b/sysroot/usr/lib/pkgconfig/libpulse-mainloop-glib.pc
new file mode 100644
index 0000000..2b8b01e
--- /dev/null
+++ b/sysroot/usr/lib/pkgconfig/libpulse-mainloop-glib.pc
@@ -0,0 +1,11 @@
+prefix=/usr
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: libpulse-mainloop-glib
+Description: GLIB 2.0 Main Loop Wrapper for PulseAudio
+Version: 0.9.10
+Libs: -L${libdir} -lpulse-mainloop-glib
+Cflags: -D_REENTRANT -I${includedir}
+Requires: libpulse glib-2.0
diff --git a/sysroot/usr/lib/pkgconfig/libpulse-simple.pc b/sysroot/usr/lib/pkgconfig/libpulse-simple.pc
new file mode 100644
index 0000000..6131530
--- /dev/null
+++ b/sysroot/usr/lib/pkgconfig/libpulse-simple.pc
@@ -0,0 +1,11 @@
+prefix=/usr
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: libpulse-simple
+Description: Simplified Synchronous Client Interface to PulseAudio
+Version: 0.9.10
+Libs: -L${libdir} -lpulse-simple
+Cflags: -D_REENTRANT -I${includedir}
+Requires: libpulse
diff --git a/sysroot/usr/lib/pkgconfig/libpulse.pc b/sysroot/usr/lib/pkgconfig/libpulse.pc
new file mode 100644
index 0000000..de41e41
--- /dev/null
+++ b/sysroot/usr/lib/pkgconfig/libpulse.pc
@@ -0,0 +1,10 @@
+prefix=/usr
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: libpulse
+Description: Client Interface to PulseAudio
+Version: 0.9.10
+Libs: -L${libdir} -lpulse
+Cflags: -D_REENTRANT -I${includedir}
diff --git a/sysroot/usr/lib/pkgconfig/x11.pc b/sysroot/usr/lib/pkgconfig/x11.pc
new file mode 100644
index 0000000..94e32f6
--- /dev/null
+++ b/sysroot/usr/lib/pkgconfig/x11.pc
@@ -0,0 +1,15 @@
+prefix=/usr
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+xthreadlib=-lpthread
+
+Name: X11
+Description: X Library
+Version: 1.1.3
+Requires: xproto kbproto
+Requires.private: xau xdmcp xcb-xlib
+Cflags: -I${includedir}
+Libs: -L${libdir} -lX11
+Libs.private: -lpthread
diff --git a/sysroot/usr/lib/pkgconfig/xextproto.pc b/sysroot/usr/lib/pkgconfig/xextproto.pc
new file mode 100644
index 0000000..adc0cf4
--- /dev/null
+++ b/sysroot/usr/lib/pkgconfig/xextproto.pc
@@ -0,0 +1,9 @@
+prefix=/usr
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: XExtProto
+Description: XExt extension headers
+Version: 7.0.2
+Cflags: -I${includedir}
diff --git a/sysroot/usr/lib/pkgconfig/xproto.pc b/sysroot/usr/lib/pkgconfig/xproto.pc
new file mode 100644
index 0000000..ea24d6e
--- /dev/null
+++ b/sysroot/usr/lib/pkgconfig/xproto.pc
@@ -0,0 +1,10 @@
+prefix=/usr
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+includex11dir=${prefix}/include/X11
+
+Name: Xproto
+Description: Xproto headers
+Version: 7.0.11
+Cflags: -I${includedir}
diff --git a/sysroot/usr/lib/pt_chown b/sysroot/usr/lib/pt_chown
new file mode 100755
index 0000000..5e12900
--- /dev/null
+++ b/sysroot/usr/lib/pt_chown
Binary files differ
diff --git a/sysroot/usr/lib/xen/libBrokenLocale.a b/sysroot/usr/lib/xen/libBrokenLocale.a
new file mode 100644
index 0000000..15891d1
--- /dev/null
+++ b/sysroot/usr/lib/xen/libBrokenLocale.a
Binary files differ
diff --git a/sysroot/usr/lib/xen/libanl.a b/sysroot/usr/lib/xen/libanl.a
new file mode 100644
index 0000000..77927a8
--- /dev/null
+++ b/sysroot/usr/lib/xen/libanl.a
Binary files differ
diff --git a/sysroot/usr/lib/xen/libbsd-compat.a b/sysroot/usr/lib/xen/libbsd-compat.a
new file mode 100644
index 0000000..0627d34
--- /dev/null
+++ b/sysroot/usr/lib/xen/libbsd-compat.a
Binary files differ
diff --git a/sysroot/usr/lib/xen/libc.a b/sysroot/usr/lib/xen/libc.a
new file mode 100644
index 0000000..3fa03e9
--- /dev/null
+++ b/sysroot/usr/lib/xen/libc.a
Binary files differ
diff --git a/sysroot/usr/lib/xen/libc_nonshared.a b/sysroot/usr/lib/xen/libc_nonshared.a
new file mode 100644
index 0000000..49de681
--- /dev/null
+++ b/sysroot/usr/lib/xen/libc_nonshared.a
Binary files differ
diff --git a/sysroot/usr/lib/xen/libcrypt.a b/sysroot/usr/lib/xen/libcrypt.a
new file mode 100644
index 0000000..8910b11
--- /dev/null
+++ b/sysroot/usr/lib/xen/libcrypt.a
Binary files differ
diff --git a/sysroot/usr/lib/xen/libdl.a b/sysroot/usr/lib/xen/libdl.a
new file mode 100644
index 0000000..aaf7cc8
--- /dev/null
+++ b/sysroot/usr/lib/xen/libdl.a
Binary files differ
diff --git a/sysroot/usr/lib/xen/libg.a b/sysroot/usr/lib/xen/libg.a
new file mode 100644
index 0000000..0627d34
--- /dev/null
+++ b/sysroot/usr/lib/xen/libg.a
Binary files differ
diff --git a/sysroot/usr/lib/xen/libieee.a b/sysroot/usr/lib/xen/libieee.a
new file mode 100644
index 0000000..6ab4488
--- /dev/null
+++ b/sysroot/usr/lib/xen/libieee.a
Binary files differ
diff --git a/sysroot/usr/lib/xen/libm.a b/sysroot/usr/lib/xen/libm.a
new file mode 100644
index 0000000..46cfd75
--- /dev/null
+++ b/sysroot/usr/lib/xen/libm.a
Binary files differ
diff --git a/sysroot/usr/lib/xen/libmcheck.a b/sysroot/usr/lib/xen/libmcheck.a
new file mode 100644
index 0000000..c9b93f4
--- /dev/null
+++ b/sysroot/usr/lib/xen/libmcheck.a
Binary files differ
diff --git a/sysroot/usr/lib/xen/libnsl.a b/sysroot/usr/lib/xen/libnsl.a
new file mode 100644
index 0000000..c570b4a
--- /dev/null
+++ b/sysroot/usr/lib/xen/libnsl.a
Binary files differ
diff --git a/sysroot/usr/lib/xen/libpthread.a b/sysroot/usr/lib/xen/libpthread.a
new file mode 100644
index 0000000..8396e00
--- /dev/null
+++ b/sysroot/usr/lib/xen/libpthread.a
Binary files differ
diff --git a/sysroot/usr/lib/xen/libpthread_nonshared.a b/sysroot/usr/lib/xen/libpthread_nonshared.a
new file mode 100644
index 0000000..5eb18b9
--- /dev/null
+++ b/sysroot/usr/lib/xen/libpthread_nonshared.a
Binary files differ
diff --git a/sysroot/usr/lib/xen/libresolv.a b/sysroot/usr/lib/xen/libresolv.a
new file mode 100644
index 0000000..9608f2f
--- /dev/null
+++ b/sysroot/usr/lib/xen/libresolv.a
Binary files differ
diff --git a/sysroot/usr/lib/xen/librt.a b/sysroot/usr/lib/xen/librt.a
new file mode 100644
index 0000000..68d8811
--- /dev/null
+++ b/sysroot/usr/lib/xen/librt.a
Binary files differ
diff --git a/sysroot/usr/lib/xen/libutil.a b/sysroot/usr/lib/xen/libutil.a
new file mode 100644
index 0000000..94dc1f0
--- /dev/null
+++ b/sysroot/usr/lib/xen/libutil.a
Binary files differ